diff --git a/.asf.yaml b/.asf.yaml index c7267ca5f346a..60bc1df21a48a 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -# https://cwiki.apache.org/confluence/display/INFRA/.asf.yaml+features+for+git+repositories +# https://cwiki.apache.org/confluence/display/INFRA/git+-+.asf.yaml+features --- github: description: "Apache Spark - A unified analytics engine for large-scale data processing" diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE index fcd3588cf81ee..66c28ee9666ee 100644 --- a/.github/PULL_REQUEST_TEMPLATE +++ b/.github/PULL_REQUEST_TEMPLATE @@ -8,6 +8,8 @@ Thanks for sending a pull request! Here are some tips for you: 6. If possible, provide a concise example to reproduce the issue for a faster review. 7. If you want to add a new configuration, please read the guideline first for naming configurations in 'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'. + 8. If you want to add or modify an error message, please read the guideline first: + https://spark.apache.org/error-message-guidelines.html --> ### What changes were proposed in this pull request? diff --git a/.github/autolabeler.yml b/.github/autolabeler.yml deleted file mode 100644 index 3bca01f89950a..0000000000000 --- a/.github/autolabeler.yml +++ /dev/null @@ -1,133 +0,0 @@ -# -# 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 -# -# https://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. -# - -# Bot page: https://github.com/apps/probot-autolabeler -# The matching patterns follow the .gitignore spec. -# See: https://git-scm.com/docs/gitignore#_pattern_format -# Also, note that the plugin uses 'ignore' package. See also -# https://github.com/kaelzhang/node-ignore -INFRA: - - ".github/" - - "appveyor.yml" - - "/tools/" - - "/dev/create-release/" - - ".asf.yaml" - - ".gitattributes" - - ".gitignore" - - "/dev/github_jira_sync.py" - - "/dev/merge_spark_pr.py" - - "/dev/run-tests-jenkins*" -BUILD: - - "/dev/" - - "!/dev/github_jira_sync.py" - - "!/dev/merge_spark_pr.py" - - "!/dev/run-tests-jenkins*" - - "!/dev/.rat-excludes" - - "/build/" - - "/project/" - - "/assembly/" - - "*pom.xml" - - "/bin/docker-image-tool.sh" - - "/bin/find-spark-home*" - - "scalastyle-config.xml" -DOCS: - - "docs/" - - "/README.md" - - "/CONTRIBUTING.md" -EXAMPLES: - - "examples/" - - "/bin/run-example*" -CORE: - - "/core/" - - "!UI.scala" - - "!ui/" - - "/common/kvstore/" - - "/common/network-common/" - - "/common/network-shuffle/" - - "/python/pyspark/*.py" - - "/python/pyspark/tests/*.py" -SPARK SUBMIT: - - "/bin/spark-submit*" -SPARK SHELL: - - "/repl/" - - "/bin/spark-shell*" -SQL: - - "sql/" - - "/common/unsafe/" - - "!/python/pyspark/sql/avro/" - - "!/python/pyspark/sql/streaming.py" - - "!/python/pyspark/sql/tests/test_streaming.py" - - "/bin/spark-sql*" - - "/bin/beeline*" - - "/sbin/*thriftserver*.sh" - - "*SQL*.R" - - "DataFrame.R" - - "WindowSpec.R" - - "catalog.R" - - "column.R" - - "functions.R" - - "group.R" - - "schema.R" - - "types.R" -AVRO: - - "/external/avro/" - - "/python/pyspark/sql/avro/" -DSTREAM: - - "/streaming/" - - "/data/streaming/" - - "/external/flume*" - - "/external/kinesis*" - - "/external/kafka*" - - "/python/pyspark/streaming/" -GRAPHX: - - "/graphx/" - - "/data/graphx/" -ML: - - "ml/" - - "*mllib_*.R" -MLLIB: - - "spark/mllib/" - - "/mllib-local/" - - "/python/pyspark/mllib/" -STRUCTURED STREAMING: - - "sql/**/streaming/" - - "/external/kafka-0-10-sql/" - - "/python/pyspark/sql/streaming.py" - - "/python/pyspark/sql/tests/test_streaming.py" - - "*streaming.R" -PYTHON: - - "/bin/pyspark*" - - "python/" -R: - - "r/" - - "R/" - - "/bin/sparkR*" -YARN: - - "/resource-managers/yarn/" -MESOS: - - "/resource-managers/mesos/" - - "/sbin/*mesos*.sh" -KUBERNETES: - - "/resource-managers/kubernetes/" -WINDOWS: - - "*.cmd" - - "/R/pkg/tests/fulltests/test_Windows.R" -WEB UI: - - "ui/" - - "UI.scala" -DEPLOY: - - "/sbin/" diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000000..bd61902925e33 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,152 @@ +# +# 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. +# + +# +# Pull Request Labeler Github Action Configuration: https://github.com/marketplace/actions/labeler +# +# Note that we currently cannot use the negatioon operator (i.e. `!`) for miniglob matches as they +# would match any file that doesn't touch them. What's needed is the concept of `any `, which takes a +# list of constraints / globs and then matches all of the constraints for either `any` of the files or +# `all` of the files in the change set. +# +# However, `any`/`all` are not supported in a released version and testing off of the `main` branch +# resulted in some other errors when testing. +# +# An issue has been opened upstream requesting that a release be cut that has support for all/any: +# - https://github.com/actions/labeler/issues/111 +# +# While we wait for this issue to be handled upstream, we can remove +# the negated / `!` matches for now and at least have labels again. +# +INFRA: + - ".github/**/*" + - "appveyor.yml" + - "tools/**/*" + - "dev/create-release/**/*" + - ".asf.yaml" + - ".gitattributes" + - ".gitignore" + - "dev/github_jira_sync.py" + - "dev/merge_spark_pr.py" + - "dev/run-tests-jenkins*" +BUILD: + # Can be supported when a stable release with correct all/any is released + #- any: ['dev/**/*', '!dev/github_jira_sync.py', '!dev/merge_spark_pr.py', '!dev/.rat-excludes'] + - "dev/**/*" + - "build/**/*" + - "project/**/*" + - "assembly/**/*" + - "**/*pom.xml" + - "bin/docker-image-tool.sh" + - "bin/find-spark-home*" + - "scalastyle-config.xml" + # These can be added in the above `any` clause (and the /dev/**/* glob removed) when + # `any`/`all` support is released + # - "!dev/github_jira_sync.py" + # - "!dev/merge_spark_pr.py" + # - "!dev/run-tests-jenkins*" + # - "!dev/.rat-excludes" +DOCS: + - "docs/**/*" + - "**/README.md" + - "**/CONTRIBUTING.md" +EXAMPLES: + - "examples/**/*" + - "bin/run-example*" +# CORE needs to be updated when all/any are released upstream. +CORE: + # - any: ["core/**/*", "!**/*UI.scala", "!**/ui/**/*"] # If any file matches all of the globs defined in the list started by `any`, label is applied. + - "core/**/*" + - "common/kvstore/**/*" + - "common/network-common/**/*" + - "common/network-shuffle/**/*" + - "python/pyspark/**/*.py" + - "python/pyspark/tests/**/*.py" +SPARK SUBMIT: + - "bin/spark-submit*" +SPARK SHELL: + - "repl/**/*" + - "bin/spark-shell*" +SQL: +#- any: ["**/sql/**/*", "!python/pyspark/sql/avro/**/*", "!python/pyspark/sql/streaming.py", "!python/pyspark/sql/tests/test_streaming.py"] + - "**/sql/**/*" + - "common/unsafe/**/*" + #- "!python/pyspark/sql/avro/**/*" + #- "!python/pyspark/sql/streaming.py" + #- "!python/pyspark/sql/tests/test_streaming.py" + - "bin/spark-sql*" + - "bin/beeline*" + - "sbin/*thriftserver*.sh" + - "**/*SQL*.R" + - "**/DataFrame.R" + - "**/*WindowSpec.R" + - "**/*catalog.R" + - "**/*column.R" + - "**/*functions.R" + - "**/*group.R" + - "**/*schema.R" + - "**/*types.R" +AVRO: + - "external/avro/**/*" + - "python/pyspark/sql/avro/**/*" +DSTREAM: + - "streaming/**/*" + - "data/streaming/**/*" + - "external/kinesis*" + - "external/kafka*" + - "python/pyspark/streaming/**/*" +GRAPHX: + - "graphx/**/*" + - "data/graphx/**/*" +ML: + - "**/ml/**/*" + - "**/*mllib_*.R" +MLLIB: + - "**/spark/mllib/**/*" + - "mllib-local/**/*" + - "python/pyspark/mllib/**/*" +STRUCTURED STREAMING: + - "**/sql/**/streaming/**/*" + - "external/kafka-0-10-sql/**/*" + - "python/pyspark/sql/streaming.py" + - "python/pyspark/sql/tests/test_streaming.py" + - "**/*streaming.R" +PYTHON: + - "bin/pyspark*" + - "**/python/**/*" +R: + - "**/r/**/*" + - "**/R/**/*" + - "bin/sparkR*" +YARN: + - "resource-managers/yarn/**/*" +MESOS: + - "resource-managers/mesos/**/*" + - "sbin/*mesos*.sh" +KUBERNETES: + - "resource-managers/kubernetes/**/*" +WINDOWS: + - "**/*.cmd" + - "R/pkg/tests/fulltests/test_Windows.R" +WEB UI: + - "**/ui/**/*" + - "**/*UI.scala" +DEPLOY: + - "sbin/**/*" + diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 0000000000000..76ae152f2307f --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,100 @@ +name: Run benchmarks + +on: + workflow_dispatch: + inputs: + class: + description: 'Benchmark class' + required: true + default: '*' + jdk: + description: 'JDK version: 8 or 11' + required: true + default: '8' + failfast: + description: 'Failfast: true or false' + required: true + default: 'true' + num-splits: + description: 'Number of job splits' + required: true + default: '1' + +jobs: + matrix-gen: + name: Generate matrix for job splits + runs-on: ubuntu-20.04 + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + env: + SPARK_BENCHMARK_NUM_SPLITS: ${{ github.event.inputs.num-splits }} + steps: + - name: Generate matrix + id: set-matrix + run: echo "::set-output name=matrix::["`seq -s, 1 $SPARK_BENCHMARK_NUM_SPLITS`"]" + + benchmark: + name: "Run benchmarks: ${{ github.event.inputs.class }} (JDK ${{ github.event.inputs.jdk }}, ${{ matrix.split }} out of ${{ github.event.inputs.num-splits }} splits)" + needs: matrix-gen + # Ubuntu 20.04 is the latest LTS. The next LTS is 22.04. + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + split: ${{fromJSON(needs.matrix-gen.outputs.matrix)}} + env: + SPARK_BENCHMARK_FAILFAST: ${{ github.event.inputs.failfast }} + SPARK_BENCHMARK_NUM_SPLITS: ${{ github.event.inputs.num-splits }} + SPARK_BENCHMARK_CUR_SPLIT: ${{ matrix.split }} + SPARK_GENERATE_BENCHMARK_FILES: 1 + SPARK_LOCAL_IP: localhost + steps: + - name: Checkout Spark repository + uses: actions/checkout@v2 + # In order to get diff files + with: + fetch-depth: 0 + - name: Cache Scala, SBT and Maven + uses: actions/cache@v2 + with: + path: | + build/apache-maven-* + build/scala-* + build/*.jar + ~/.sbt + key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }} + restore-keys: | + build- + - name: Cache Coursier local repository + uses: actions/cache@v2 + with: + path: ~/.cache/coursier + key: benchmark-coursier-${{ github.event.inputs.jdk }}-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }} + restore-keys: | + benchmark-coursier-${{ github.event.inputs.jdk }} + - name: Install Java ${{ github.event.inputs.jdk }} + uses: actions/setup-java@v1 + with: + java-version: ${{ github.event.inputs.jdk }} + - name: Run benchmarks + run: | + ./build/sbt -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -Phadoop-cloud -Pkinesis-asl -Pspark-ganglia-lgpl test:package + # Make less noisy + cp conf/log4j.properties.template conf/log4j.properties + sed -i 's/log4j.rootCategory=INFO, console/log4j.rootCategory=WARN, console/g' conf/log4j.properties + # In benchmark, we use local as master so set driver memory only. Note that GitHub Actions has 7 GB memory limit. + bin/spark-submit \ + --driver-memory 6g --class org.apache.spark.benchmark.Benchmarks \ + --jars "`find . -name '*-SNAPSHOT-tests.jar' -o -name '*avro*-SNAPSHOT.jar' | paste -sd ',' -`" \ + "`find . -name 'spark-core*-SNAPSHOT-tests.jar'`" \ + "${{ github.event.inputs.class }}" + # To keep the directory structure and file permissions, tar them + # See also https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files + echo "Preparing the benchmark results:" + tar -cvf benchmark-results-${{ github.event.inputs.jdk }}.tar `git diff --name-only` `git ls-files --others --exclude-standard` + - name: Upload benchmark results + uses: actions/upload-artifact@v2 + with: + name: benchmark-results-${{ github.event.inputs.jdk }}-${{ matrix.split }} + path: benchmark-results-${{ github.event.inputs.jdk }}.tar + diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml new file mode 100644 index 0000000000000..be5978e7ecb97 --- /dev/null +++ b/.github/workflows/build_and_test.yml @@ -0,0 +1,561 @@ +name: Build and test + +on: + push: + branches: + - '**' + - '!branch-*.*' + +jobs: + # Build: build Spark and run the tests for specified modules. + build: + name: "Build modules: ${{ matrix.modules }} ${{ matrix.comment }} (JDK ${{ matrix.java }}, ${{ matrix.hadoop }}, ${{ matrix.hive }})" + # Ubuntu 20.04 is the latest LTS. The next LTS is 22.04. + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + java: + - 8 + hadoop: + - hadoop3.2 + hive: + - hive2.3 + # TODO(SPARK-32246): We don't test 'streaming-kinesis-asl' for now. + # Kinesis tests depends on external Amazon kinesis service. + # Note that the modules below are from sparktestsupport/modules.py. + modules: + - >- + core, unsafe, kvstore, avro, + network-common, network-shuffle, repl, launcher, + examples, sketch, graphx + - >- + catalyst, hive-thriftserver + - >- + streaming, sql-kafka-0-10, streaming-kafka-0-10, + mllib-local, mllib, + yarn, mesos, kubernetes, hadoop-cloud, spark-ganglia-lgpl + # Here, we split Hive and SQL tests into some of slow ones and the rest of them. + included-tags: [""] + excluded-tags: [""] + comment: [""] + include: + # Hive tests + - modules: hive + java: 8 + hadoop: hadoop3.2 + hive: hive2.3 + included-tags: org.apache.spark.tags.SlowHiveTest + comment: "- slow tests" + - modules: hive + java: 8 + hadoop: hadoop3.2 + hive: hive2.3 + excluded-tags: org.apache.spark.tags.SlowHiveTest + comment: "- other tests" + # SQL tests + - modules: sql + java: 8 + hadoop: hadoop3.2 + hive: hive2.3 + included-tags: org.apache.spark.tags.ExtendedSQLTest + comment: "- slow tests" + - modules: sql + java: 8 + hadoop: hadoop3.2 + hive: hive2.3 + excluded-tags: org.apache.spark.tags.ExtendedSQLTest + comment: "- other tests" + env: + MODULES_TO_TEST: ${{ matrix.modules }} + EXCLUDED_TAGS: ${{ matrix.excluded-tags }} + INCLUDED_TAGS: ${{ matrix.included-tags }} + HADOOP_PROFILE: ${{ matrix.hadoop }} + HIVE_PROFILE: ${{ matrix.hive }} + GITHUB_PREV_SHA: ${{ github.event.before }} + SPARK_LOCAL_IP: localhost + steps: + - name: Checkout Spark repository + uses: actions/checkout@v2 + # In order to fetch changed files + with: + fetch-depth: 0 + repository: apache/spark + ref: master + - name: Sync the current branch with the latest in Apache Spark + if: github.repository != 'apache/spark' + id: sync-branch + run: | + apache_spark_ref=`git rev-parse HEAD` + git fetch https://github.com/$GITHUB_REPOSITORY.git ${GITHUB_REF#refs/heads/} + git -c user.name='Apache Spark Test Account' -c user.email='sparktestacc@gmail.com' merge --no-commit --progress --squash FETCH_HEAD + git -c user.name='Apache Spark Test Account' -c user.email='sparktestacc@gmail.com' commit -m "Merged commit" + echo "::set-output name=APACHE_SPARK_REF::$apache_spark_ref" + # Cache local repositories. Note that GitHub Actions cache has a 2G limit. + - name: Cache Scala, SBT and Maven + uses: actions/cache@v2 + with: + path: | + build/apache-maven-* + build/scala-* + build/*.jar + ~/.sbt + key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }} + restore-keys: | + build- + - name: Cache Coursier local repository + uses: actions/cache@v2 + with: + path: ~/.cache/coursier + key: ${{ matrix.java }}-${{ matrix.hadoop }}-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }} + restore-keys: | + ${{ matrix.java }}-${{ matrix.hadoop }}-coursier- + - name: Install Java ${{ matrix.java }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Install Python 3.8 + uses: actions/setup-python@v2 + # We should install one Python that is higher then 3+ for SQL and Yarn because: + # - SQL component also has Python related tests, for example, IntegratedUDFTestUtils. + # - Yarn has a Python specific test too, for example, YarnClusterSuite. + if: contains(matrix.modules, 'yarn') || (contains(matrix.modules, 'sql') && !contains(matrix.modules, 'sql-')) + with: + python-version: 3.8 + architecture: x64 + - name: Install Python packages (Python 3.8) + if: (contains(matrix.modules, 'sql') && !contains(matrix.modules, 'sql-')) + run: | + python3.8 -m pip install numpy 'pyarrow<3.0.0' pandas scipy xmlrunner + python3.8 -m pip list + # Run the tests. + - name: Run tests + run: | + export APACHE_SPARK_REF=${{ steps.sync-branch.outputs.APACHE_SPARK_REF }} + # Hive and SQL tests become flaky when running in parallel as it's too intensive. + if [[ "$MODULES_TO_TEST" == "hive" ]] || [[ "$MODULES_TO_TEST" == "sql" ]]; then export SERIAL_SBT_TESTS=1; fi + ./dev/run-tests --parallelism 2 --modules "$MODULES_TO_TEST" --included-tags "$INCLUDED_TAGS" --excluded-tags "$EXCLUDED_TAGS" + - name: Upload test results to report + if: always() + uses: actions/upload-artifact@v2 + with: + name: test-results-${{ matrix.modules }}-${{ matrix.comment }}-${{ matrix.java }}-${{ matrix.hadoop }}-${{ matrix.hive }} + path: "**/target/test-reports/*.xml" + - name: Upload unit tests log files + if: failure() + uses: actions/upload-artifact@v2 + with: + name: unit-tests-log-${{ matrix.modules }}-${{ matrix.comment }}-${{ matrix.java }}-${{ matrix.hadoop }}-${{ matrix.hive }} + path: "**/target/unit-tests.log" + + pyspark: + name: "Build modules: ${{ matrix.modules }}" + runs-on: ubuntu-20.04 + container: + image: dongjoon/apache-spark-github-action-image:20201025 + strategy: + fail-fast: false + matrix: + modules: + - >- + pyspark-sql, pyspark-mllib, pyspark-resource + - >- + pyspark-core, pyspark-streaming, pyspark-ml + - >- + pyspark-pandas + env: + MODULES_TO_TEST: ${{ matrix.modules }} + HADOOP_PROFILE: hadoop3.2 + HIVE_PROFILE: hive2.3 + GITHUB_PREV_SHA: ${{ github.event.before }} + SPARK_LOCAL_IP: localhost + steps: + - name: Checkout Spark repository + uses: actions/checkout@v2 + # In order to fetch changed files + with: + fetch-depth: 0 + repository: apache/spark + ref: master + - name: Sync the current branch with the latest in Apache Spark + if: github.repository != 'apache/spark' + id: sync-branch + run: | + apache_spark_ref=`git rev-parse HEAD` + git fetch https://github.com/$GITHUB_REPOSITORY.git ${GITHUB_REF#refs/heads/} + git -c user.name='Apache Spark Test Account' -c user.email='sparktestacc@gmail.com' merge --no-commit --progress --squash FETCH_HEAD + git -c user.name='Apache Spark Test Account' -c user.email='sparktestacc@gmail.com' commit -m "Merged commit" + echo "::set-output name=APACHE_SPARK_REF::$apache_spark_ref" + # Cache local repositories. Note that GitHub Actions cache has a 2G limit. + - name: Cache Scala, SBT and Maven + uses: actions/cache@v2 + with: + path: | + build/apache-maven-* + build/scala-* + build/*.jar + ~/.sbt + key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }} + restore-keys: | + build- + - name: Cache Coursier local repository + uses: actions/cache@v2 + with: + path: ~/.cache/coursier + key: pyspark-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }} + restore-keys: | + pyspark-coursier- + - name: Install Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: 3.6 + architecture: x64 + # This step takes much less time (~30s) than other Python versions so it is not included + # in the Docker image being used. There is also a technical issue to install Python 3.6 on + # Ubuntu 20.04. See also SPARK-33162. + - name: Install Python packages (Python 3.6) + run: | + python3.6 -m pip install numpy 'pyarrow<3.0.0' pandas scipy xmlrunner + python3.6 -m pip list + - name: Install Conda for pip packaging test + run: | + curl -s https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh > miniconda.sh + bash miniconda.sh -b -p $HOME/miniconda + # Run the tests. + - name: Run tests + run: | + export APACHE_SPARK_REF=${{ steps.sync-branch.outputs.APACHE_SPARK_REF }} + export PATH=$PATH:$HOME/miniconda/bin + ./dev/run-tests --parallelism 2 --modules "$MODULES_TO_TEST" + - name: Upload test results to report + if: always() + uses: actions/upload-artifact@v2 + with: + name: test-results-${{ matrix.modules }}--8-hadoop3.2-hive2.3 + path: "**/target/test-reports/*.xml" + - name: Upload unit tests log files + if: failure() + uses: actions/upload-artifact@v2 + with: + name: unit-tests-log-${{ matrix.modules }}--8-hadoop3.2-hive2.3 + path: "**/target/unit-tests.log" + + sparkr: + name: "Build modules: sparkr" + runs-on: ubuntu-20.04 + container: + image: dongjoon/apache-spark-github-action-image:20201025 + env: + HADOOP_PROFILE: hadoop3.2 + HIVE_PROFILE: hive2.3 + GITHUB_PREV_SHA: ${{ github.event.before }} + SPARK_LOCAL_IP: localhost + steps: + - name: Checkout Spark repository + uses: actions/checkout@v2 + # In order to fetch changed files + with: + fetch-depth: 0 + repository: apache/spark + ref: master + - name: Sync the current branch with the latest in Apache Spark + if: github.repository != 'apache/spark' + id: sync-branch + run: | + apache_spark_ref=`git rev-parse HEAD` + git fetch https://github.com/$GITHUB_REPOSITORY.git ${GITHUB_REF#refs/heads/} + git -c user.name='Apache Spark Test Account' -c user.email='sparktestacc@gmail.com' merge --no-commit --progress --squash FETCH_HEAD + git -c user.name='Apache Spark Test Account' -c user.email='sparktestacc@gmail.com' commit -m "Merged commit" + echo "::set-output name=APACHE_SPARK_REF::$apache_spark_ref" + # Cache local repositories. Note that GitHub Actions cache has a 2G limit. + - name: Cache Scala, SBT and Maven + uses: actions/cache@v2 + with: + path: | + build/apache-maven-* + build/scala-* + build/*.jar + ~/.sbt + key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }} + restore-keys: | + build- + - name: Cache Coursier local repository + uses: actions/cache@v2 + with: + path: ~/.cache/coursier + key: sparkr-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }} + restore-keys: | + sparkr-coursier- + - name: Run tests + run: | + # The followings are also used by `r-lib/actions/setup-r` to avoid + # R issues at docker environment + export TZ=UTC + export _R_CHECK_SYSTEM_CLOCK_=FALSE + export APACHE_SPARK_REF=${{ steps.sync-branch.outputs.APACHE_SPARK_REF }} + ./dev/run-tests --parallelism 2 --modules sparkr + - name: Upload test results to report + if: always() + uses: actions/upload-artifact@v2 + with: + name: test-results-sparkr--8-hadoop3.2-hive2.3 + path: "**/target/test-reports/*.xml" + + # Static analysis, and documentation build + lint: + name: Linters, licenses, dependencies and documentation generation + runs-on: ubuntu-20.04 + env: + LC_ALL: C.UTF-8 + LANG: C.UTF-8 + container: + image: dongjoon/apache-spark-github-action-image:20201025 + steps: + - name: Checkout Spark repository + uses: actions/checkout@v2 + # Cache local repositories. Note that GitHub Actions cache has a 2G limit. + - name: Cache Scala, SBT and Maven + uses: actions/cache@v2 + with: + path: | + build/apache-maven-* + build/scala-* + build/*.jar + ~/.sbt + key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }} + restore-keys: | + build- + - name: Cache Coursier local repository + uses: actions/cache@v2 + with: + path: ~/.cache/coursier + key: docs-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }} + restore-keys: | + docs-coursier- + - name: Cache Maven local repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: docs-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + docs-maven- + - name: Install Python 3.6 + uses: actions/setup-python@v2 + with: + python-version: 3.6 + architecture: x64 + - name: Install Python linter dependencies + run: | + # TODO(SPARK-32407): Sphinx 3.1+ does not correctly index nested classes. + # See also https://github.com/sphinx-doc/sphinx/issues/7551. + # Jinja2 3.0.0+ causes error when building with Sphinx. + # See also https://issues.apache.org/jira/browse/SPARK-35375. + python3.6 -m pip install flake8 'sphinx<3.1.0' numpy pydata_sphinx_theme ipython nbsphinx mypy numpydoc 'jinja2<3.0.0' + - name: Install R linter dependencies and SparkR + run: | + apt-get install -y libcurl4-openssl-dev libgit2-dev libssl-dev libxml2-dev + Rscript -e "install.packages(c('devtools'), repos='https://cloud.r-project.org/')" + Rscript -e "devtools::install_github('jimhester/lintr@v2.0.1')" + ./R/install-dev.sh + - name: Instll JavaScript linter dependencies + run: | + apt update + apt-get install -y nodejs npm + - name: Install dependencies for documentation generation + run: | + # pandoc is required to generate PySpark APIs as well in nbsphinx. + apt-get install -y libcurl4-openssl-dev pandoc + # TODO(SPARK-32407): Sphinx 3.1+ does not correctly index nested classes. + # See also https://github.com/sphinx-doc/sphinx/issues/7551. + # Jinja2 3.0.0+ causes error when building with Sphinx. + # See also https://issues.apache.org/jira/browse/SPARK-35375. + python3.6 -m pip install 'sphinx<3.1.0' mkdocs numpy pydata_sphinx_theme ipython nbsphinx numpydoc 'jinja2<3.0.0' + apt-get update -y + apt-get install -y ruby ruby-dev + Rscript -e "install.packages(c('devtools', 'testthat', 'knitr', 'rmarkdown', 'roxygen2'), repos='https://cloud.r-project.org/')" + gem install bundler + cd docs + bundle install + - name: Scala linter + run: ./dev/lint-scala + - name: Java linter + run: ./dev/lint-java + - name: Python linter + run: ./dev/lint-python + - name: R linter + run: ./dev/lint-r + - name: JS linter + run: ./dev/lint-js + - name: License test + run: ./dev/check-license + - name: Dependencies test + run: ./dev/test-dependencies.sh + - name: Run documentation build + run: | + cd docs + bundle exec jekyll build + + java-11: + name: Java 11 build with Maven + runs-on: ubuntu-20.04 + steps: + - name: Checkout Spark repository + uses: actions/checkout@v2 + - name: Cache Scala, SBT and Maven + uses: actions/cache@v2 + with: + path: | + build/apache-maven-* + build/scala-* + build/*.jar + ~/.sbt + key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }} + restore-keys: | + build- + - name: Cache Maven local repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: java11-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + java11-maven- + - name: Install Java 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + - name: Build with Maven + run: | + export MAVEN_OPTS="-Xss256m -Xmx2g -XX:ReservedCodeCacheSize=1g -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN" + export MAVEN_CLI_OPTS="--no-transfer-progress" + # It uses Maven's 'install' intentionally, see https://github.com/apache/spark/pull/26414. + ./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -Phadoop-cloud -Djava.version=11 install + rm -rf ~/.m2/repository/org/apache/spark + + scala-213: + name: Scala 2.13 build with SBT + runs-on: ubuntu-20.04 + steps: + - name: Checkout Spark repository + uses: actions/checkout@v2 + - name: Cache Scala, SBT and Maven + uses: actions/cache@v2 + with: + path: | + build/apache-maven-* + build/scala-* + build/*.jar + ~/.sbt + key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }} + restore-keys: | + build- + - name: Cache Coursier local repository + uses: actions/cache@v2 + with: + path: ~/.cache/coursier + key: scala-213-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }} + restore-keys: | + scala-213-coursier- + - name: Install Java 8 + uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Build with SBT + run: | + ./dev/change-scala-version.sh 2.13 + ./build/sbt -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -Phadoop-cloud -Pkinesis-asl -Pdocker-integration-tests -Pkubernetes-integration-tests -Pspark-ganglia-lgpl -Pscala-2.13 compile test:compile + + hadoop-2: + name: Hadoop 2 build with SBT + runs-on: ubuntu-20.04 + steps: + - name: Checkout Spark repository + uses: actions/checkout@v2 + - name: Cache Scala, SBT and Maven + uses: actions/cache@v2 + with: + path: | + build/apache-maven-* + build/scala-* + build/*.jar + ~/.sbt + key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }} + restore-keys: | + build- + - name: Cache Coursier local repository + uses: actions/cache@v2 + with: + path: ~/.cache/coursier + key: hadoop-2-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }} + restore-keys: | + hadoop-2-coursier- + - name: Install Java 8 + uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Build with SBT + run: | + ./build/sbt -Pyarn -Pmesos -Pkubernetes -Phive -Phive-thriftserver -Phadoop-cloud -Pkinesis-asl -Phadoop-2.7 compile test:compile + + tpcds-1g: + name: Run TPC-DS queries with SF=1 + runs-on: ubuntu-20.04 + env: + SPARK_LOCAL_IP: localhost + steps: + - name: Checkout Spark repository + uses: actions/checkout@v2 + - name: Cache Scala, SBT and Maven + uses: actions/cache@v2 + with: + path: | + build/apache-maven-* + build/scala-* + build/*.jar + ~/.sbt + key: build-${{ hashFiles('**/pom.xml', 'project/build.properties', 'build/mvn', 'build/sbt', 'build/sbt-launch-lib.bash', 'build/spark-build-info') }} + restore-keys: | + build- + - name: Cache Coursier local repository + uses: actions/cache@v2 + with: + path: ~/.cache/coursier + key: tpcds-coursier-${{ hashFiles('**/pom.xml', '**/plugins.sbt') }} + restore-keys: | + tpcds-coursier- + - name: Install Java 8 + uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Cache TPC-DS generated data + id: cache-tpcds-sf-1 + uses: actions/cache@v2 + with: + path: ./tpcds-sf-1 + key: tpcds-${{ hashFiles('.github/workflows/build_and_test.yml', 'sql/core/src/test/scala/org/apache/spark/sql/TPCDSSchema.scala') }} + - name: Checkout tpcds-kit repository + if: steps.cache-tpcds-sf-1.outputs.cache-hit != 'true' + uses: actions/checkout@v2 + with: + repository: databricks/tpcds-kit + path: ./tpcds-kit + - name: Build tpcds-kit + if: steps.cache-tpcds-sf-1.outputs.cache-hit != 'true' + run: cd tpcds-kit/tools && make OS=LINUX + - name: Generate TPC-DS (SF=1) table data + if: steps.cache-tpcds-sf-1.outputs.cache-hit != 'true' + run: build/sbt "sql/test:runMain org.apache.spark.sql.GenTPCDSData --dsdgenDir `pwd`/tpcds-kit/tools --location `pwd`/tpcds-sf-1 --scaleFactor 1 --numPartitions 1 --overwrite" + - name: Run TPC-DS queries + run: | + SPARK_TPCDS_DATA=`pwd`/tpcds-sf-1 build/sbt "sql/testOnly org.apache.spark.sql.TPCDSQueryTestSuite" + - name: Upload test results to report + if: always() + uses: actions/upload-artifact@v2 + with: + name: test-results-tpcds--8-hadoop3.2-hive2.3 + path: "**/target/test-reports/*.xml" + - name: Upload unit tests log files + if: failure() + uses: actions/upload-artifact@v2 + with: + name: unit-tests-log-tpcds--8-hadoop3.2-hive2.3 + path: "**/target/unit-tests.log" diff --git a/.github/workflows/cancel_duplicate_workflow_runs.yml b/.github/workflows/cancel_duplicate_workflow_runs.yml new file mode 100644 index 0000000000000..b20fc947f6f13 --- /dev/null +++ b/.github/workflows/cancel_duplicate_workflow_runs.yml @@ -0,0 +1,19 @@ +name: Cancelling Duplicates +on: + workflow_run: + workflows: + - 'Build and test' + types: ['requested'] + +jobs: + cancel-duplicate-workflow-runs: + name: "Cancel duplicate workflow runs" + runs-on: ubuntu-latest + steps: + - uses: potiuk/cancel-workflow-runs@953e057dc81d3458935a18d1184c386b0f6b5738 # @master + name: "Cancel duplicate workflow runs" + with: + cancelMode: allDuplicates + token: ${{ secrets.GITHUB_TOKEN }} + sourceRunId: ${{ github.event.workflow_run.id }} + skipEventTypes: '["push", "schedule"]' diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 0000000000000..98855f4668b45 --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,50 @@ +# +# 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. +# + +# Intentionally has a general name. +# because the test status check created in GitHub Actions +# currently randomly picks any associated workflow. +# So, the name was changed to make sense in that context too. +# See also https://github.community/t/specify-check-suite-when-creating-a-checkrun/118380/10 + +name: "On pull requests" +on: pull_request_target + +jobs: + label: + name: Label pull requests + runs-on: ubuntu-latest + steps: + # In order to get back the negated matches like in the old config, + # we need the actinons/labeler concept of `all` and `any` which matches + # all of the given constraints / glob patterns for either `all` + # files or `any` file in the change set. + # + # Github issue which requests a timeline for a release with any/all support: + # - https://github.com/actions/labeler/issues/111 + # This issue also references the issue that mentioned that any/all are only + # supported on main branch (previously called master): + # - https://github.com/actions/labeler/issues/73#issuecomment-639034278 + # + # However, these are not in a published release and the current `main` branch + # has some issues upon testing. + - uses: actions/labeler@2.2.0 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" + sync-labels: true diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml deleted file mode 100644 index 4282504cc3984..0000000000000 --- a/.github/workflows/master.yml +++ /dev/null @@ -1,156 +0,0 @@ -name: master - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - java: [ '1.8', '11' ] - hadoop: [ 'hadoop-2.7', 'hadoop-3.2' ] - hive: [ 'hive-1.2', 'hive-2.3' ] - exclude: - - java: '11' - hive: 'hive-1.2' - - hadoop: 'hadoop-3.2' - hive: 'hive-1.2' - name: Build Spark - JDK${{ matrix.java }}/${{ matrix.hadoop }}/${{ matrix.hive }} - - steps: - - uses: actions/checkout@master - # We split caches because GitHub Action Cache has a 400MB-size limit. - - uses: actions/cache@v1 - with: - path: build - key: build-${{ hashFiles('**/pom.xml') }} - restore-keys: | - build- - - uses: actions/cache@v1 - with: - path: ~/.m2/repository/com - key: ${{ matrix.java }}-${{ matrix.hadoop }}-maven-com-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ matrix.java }}-${{ matrix.hadoop }}-maven-com- - - uses: actions/cache@v1 - with: - path: ~/.m2/repository/org - key: ${{ matrix.java }}-${{ matrix.hadoop }}-maven-org-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ matrix.java }}-${{ matrix.hadoop }}-maven-org- - - uses: actions/cache@v1 - with: - path: ~/.m2/repository/net - key: ${{ matrix.java }}-${{ matrix.hadoop }}-maven-net-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ matrix.java }}-${{ matrix.hadoop }}-maven-net- - - uses: actions/cache@v1 - with: - path: ~/.m2/repository/io - key: ${{ matrix.java }}-${{ matrix.hadoop }}-maven-io-${{ hashFiles('**/pom.xml') }} - restore-keys: | - ${{ matrix.java }}-${{ matrix.hadoop }}-maven-io- - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - - name: Build with Maven - run: | - export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g -Dorg.slf4j.simpleLogger.defaultLogLevel=WARN" - export MAVEN_CLI_OPTS="--no-transfer-progress" - mkdir -p ~/.m2 - ./build/mvn $MAVEN_CLI_OPTS -DskipTests -Pyarn -Pmesos -Pkubernetes -Phive -P${{ matrix.hive }} -Phive-thriftserver -P${{ matrix.hadoop }} -Phadoop-cloud -Djava.version=${{ matrix.java }} install - rm -rf ~/.m2/repository/org/apache/spark - - - lint: - runs-on: ubuntu-latest - name: Linters (Java/Scala/Python), licenses, dependencies - steps: - - uses: actions/checkout@master - - uses: actions/setup-java@v1 - with: - java-version: '11' - - uses: actions/setup-python@v1 - with: - python-version: '3.x' - architecture: 'x64' - - name: Scala - run: ./dev/lint-scala - - name: Java - run: ./dev/lint-java - - name: Python - run: | - pip install flake8 sphinx numpy - ./dev/lint-python - - name: License - run: ./dev/check-license - - name: Dependencies - run: ./dev/test-dependencies.sh - - lintr: - runs-on: ubuntu-latest - name: Linter (R) - steps: - - uses: actions/checkout@master - - uses: actions/setup-java@v1 - with: - java-version: '11' - - uses: r-lib/actions/setup-r@v1 - with: - r-version: '3.6.2' - - name: Install lib - run: | - sudo apt-get install -y libcurl4-openssl-dev - - name: install R packages - run: | - sudo Rscript -e "install.packages(c('curl', 'xml2', 'httr', 'devtools', 'testthat', 'knitr', 'rmarkdown', 'roxygen2', 'e1071', 'survival'), repos='https://cloud.r-project.org/')" - sudo Rscript -e "devtools::install_github('jimhester/lintr@v2.0.0')" - - name: package and install SparkR - run: ./R/install-dev.sh - - name: lint-r - run: ./dev/lint-r - - docs: - runs-on: ubuntu-latest - name: Generate documents - steps: - - uses: actions/checkout@master - - uses: actions/cache@v1 - with: - path: ~/.m2/repository - key: docs-maven-repo-${{ hashFiles('**/pom.xml') }} - restore-keys: | - docs-maven-repo- - - uses: actions/setup-java@v1 - with: - java-version: '1.8' - - uses: actions/setup-python@v1 - with: - python-version: '3.x' - architecture: 'x64' - - uses: actions/setup-ruby@v1 - with: - ruby-version: '2.7' - - uses: r-lib/actions/setup-r@v1 - with: - r-version: '3.6.2' - - name: Install lib and pandoc - run: | - sudo apt-get install -y libcurl4-openssl-dev pandoc - - name: Install packages - run: | - pip install sphinx mkdocs numpy - gem install jekyll jekyll-redirect-from rouge - sudo Rscript -e "install.packages(c('curl', 'xml2', 'httr', 'devtools', 'testthat', 'knitr', 'rmarkdown', 'roxygen2', 'e1071', 'survival'), repos='https://cloud.r-project.org/')" - - name: Run jekyll build - run: | - cd docs - jekyll build diff --git a/.github/workflows/notify_test_workflow.yml b/.github/workflows/notify_test_workflow.yml new file mode 100644 index 0000000000000..cc2b7a254e3f5 --- /dev/null +++ b/.github/workflows/notify_test_workflow.yml @@ -0,0 +1,125 @@ +# +# 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. +# + +# Intentionally has a general name. +# because the test status check created in GitHub Actions +# currently randomly picks any associated workflow. +# So, the name was changed to make sense in that context too. +# See also https://github.community/t/specify-check-suite-when-creating-a-checkrun/118380/10 +name: On pull request update +on: + pull_request_target: + types: [opened, reopened, synchronize] + +jobs: + notify: + name: Notify test workflow + runs-on: ubuntu-20.04 + steps: + - name: "Notify test workflow" + uses: actions/github-script@v3 + if: ${{ github.base_ref == 'master' }} + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const endpoint = 'GET /repos/:owner/:repo/actions/workflows/:id/runs?&branch=:branch' + + // TODO: Should use pull_request.user and pull_request.user.repos_url? + // If a different person creates a commit to another forked repo, + // it wouldn't be able to detect. + const params = { + owner: context.payload.pull_request.head.repo.owner.login, + repo: context.payload.pull_request.head.repo.name, + id: 'build_and_test.yml', + branch: context.payload.pull_request.head.ref, + } + + console.log('Ref: ' + context.payload.pull_request.head.ref) + console.log('SHA: ' + context.payload.pull_request.head.sha) + + // Wait 3 seconds to make sure the fork repository triggered a workflow. + await new Promise(r => setTimeout(r, 3000)) + + let runs + try { + runs = await github.request(endpoint, params) + } catch (error) { + console.error(error) + // Assume that runs were not found. + } + + const name = 'Build and test' + const head_sha = context.payload.pull_request.head.sha + let status = 'queued' + + if (!runs || runs.data.workflow_runs.length === 0) { + status = 'completed' + const conclusion = 'action_required' + + github.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: name, + head_sha: head_sha, + status: status, + conclusion: conclusion, + output: { + title: 'Workflow run detection failed', + summary: ` + Unable to detect the workflow run for testing the changes in your PR. + + 1. If you did not enable GitHub Actions in your forked repository, please enable it. See also [Disabling or limiting GitHub Actions for a repository](https://docs.github.com/en/github/administering-a-repository/disabling-or-limiting-github-actions-for-a-repository) for more details. + 2. It is possible your branch is based on the old \`master\` branch in Apache Spark, please sync your branch to the latest master branch. For example as below: + \`\`\`bash + git fetch upstream + git rebase upstream/master + git push origin YOUR_BRANCH --force + \`\`\`` + } + }) + } else { + const runID = runs.data.workflow_runs[0].id + + if (runs.data.workflow_runs[0].head_sha != context.payload.pull_request.head.sha) { + throw new Error('There was a new unsynced commit pushed. Please retrigger the workflow.'); + } + + const runUrl = 'https://github.com/' + + context.payload.pull_request.head.repo.full_name + + '/actions/runs/' + + runID + + github.checks.create({ + owner: context.repo.owner, + repo: context.repo.repo, + name: name, + head_sha: head_sha, + status: status, + output: { + title: 'Test results', + summary: '[See test results](' + runUrl + ')', + text: JSON.stringify({ + owner: context.payload.pull_request.head.repo.owner.login, + repo: context.payload.pull_request.head.repo.name, + run_id: runID + }) + }, + details_url: runUrl, + }) + } diff --git a/.github/workflows/publish_snapshot.yml b/.github/workflows/publish_snapshot.yml new file mode 100644 index 0000000000000..c5dbc8d057964 --- /dev/null +++ b/.github/workflows/publish_snapshot.yml @@ -0,0 +1,40 @@ +name: Publish Snapshot + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + publish-snapshot: + if: github.repository == 'apache/spark' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + branch: + - master + - branch-3.1 + steps: + - name: Checkout Spark repository + uses: actions/checkout@master + with: + ref: ${{ matrix.branch }} + - name: Cache Maven local repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: snapshot-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + snapshot-maven- + - name: Install Java 8 + uses: actions/setup-java@v1 + with: + java-version: 8 + - name: Publish snapshot + env: + ASF_USERNAME: ${{ secrets.NEXUS_USER }} + ASF_PASSWORD: ${{ secrets.NEXUS_PW }} + GPG_KEY: "not_used" + GPG_PASSPHRASE: "not_used" + GIT_REF: ${{ matrix.branch }} + run: ./dev/create-release/release-build.sh publish-snapshot diff --git a/.github/workflows/test_report.yml b/.github/workflows/test_report.yml new file mode 100644 index 0000000000000..6d70f29b2efa2 --- /dev/null +++ b/.github/workflows/test_report.yml @@ -0,0 +1,25 @@ +name: Report test results +on: + workflow_run: + workflows: ["Build and test"] + types: + - completed + +jobs: + test_report: + runs-on: ubuntu-latest + steps: + - name: Download test results to report + uses: dawidd6/action-download-artifact@v2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + workflow: ${{ github.event.workflow_run.workflow_id }} + commit: ${{ github.event.workflow_run.head_commit.id }} + workflow_conclusion: completed + - name: Publish test report + uses: scacap/action-surefire-report@v1 + with: + check_name: Report test results + github_token: ${{ secrets.GITHUB_TOKEN }} + report_paths: "**/target/test-reports/*.xml" + commit: ${{ github.event.workflow_run.head_commit.id }} diff --git a/.github/workflows/update_build_status.yml b/.github/workflows/update_build_status.yml new file mode 100644 index 0000000000000..16fbe3a6f66c7 --- /dev/null +++ b/.github/workflows/update_build_status.yml @@ -0,0 +1,97 @@ +# +# 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: Update build status workflow + +on: + schedule: + - cron: "*/15 * * * *" + +jobs: + update: + name: Update build status + runs-on: ubuntu-20.04 + steps: + - name: "Update build status" + uses: actions/github-script@v3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const endpoint = 'GET /repos/:owner/:repo/pulls?state=:state' + const params = { + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open' + } + + // See https://docs.github.com/en/graphql/reference/enums#mergestatestatus + const maybeReady = ['behind', 'clean', 'draft', 'has_hooks', 'unknown', 'unstable']; + + // Iterate open PRs + for await (const prs of github.paginate.iterator(endpoint,params)) { + // Each page + for await (const pr of prs.data) { + console.log('SHA: ' + pr.head.sha) + console.log(' Mergeable status: ' + pr.mergeable_state) + if (pr.mergeable_state == null || maybeReady.includes(pr.mergeable_state)) { + const checkRuns = await github.request('GET /repos/{owner}/{repo}/commits/{ref}/check-runs', { + owner: context.repo.owner, + repo: context.repo.repo, + ref: pr.head.sha + }) + + // Iterator GitHub Checks in the PR + for await (const cr of checkRuns.data.check_runs) { + if (cr.name == 'Build and test' && cr.conclusion != "action_required") { + // text contains parameters to make request in JSON. + const params = JSON.parse(cr.output.text) + + // Get the workflow run in the forked repository + const run = await github.request('GET /repos/{owner}/{repo}/actions/runs/{run_id}', params) + + // Keep syncing the status of the checks + if (run.data.status == 'completed') { + console.log(' Run ' + cr.id + ': set status (' + run.data.status + ') and conclusion (' + run.data.conclusion + ')') + const response = await github.request('PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}', { + owner: context.repo.owner, + repo: context.repo.repo, + check_run_id: cr.id, + output: cr.output, + status: run.data.status, + conclusion: run.data.conclusion, + details_url: run.data.details_url + }) + } else { + console.log(' Run ' + cr.id + ': set status (' + run.data.status + ')') + const response = await github.request('PATCH /repos/{owner}/{repo}/check-runs/{check_run_id}', { + owner: context.repo.owner, + repo: context.repo.repo, + check_run_id: cr.id, + output: cr.output, + status: run.data.status, + details_url: run.data.details_url + }) + } + + break + } + } + } + } + } diff --git a/.gitignore b/.gitignore index 198fdee39be95..0411eb736c11b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,13 +8,17 @@ *.swp *~ .DS_Store +.bsp/ .cache .classpath .ensime .ensime_cache/ .ensime_lucene .generated-mima* -.idea/ +# The star is required for further !.idea/ to work, see https://git-scm.com/docs/gitignore +.idea/* +!.idea/vcs.xml +python/.idea .idea_modules/ .project .pydevproject @@ -29,7 +33,6 @@ R/pkg/tests/fulltests/Rplots.pdf build/*.jar build/apache-maven* build/scala* -build/zinc* cache checkpoint conf/*.cmd @@ -47,10 +50,12 @@ dev/pr-deps/ dist/ docs/_site/ docs/api +docs/.local_ruby_bundle sql/docs sql/site lib_managed/ lint-r-report.log +lint-js-report.log log/ logs/ out/ @@ -64,9 +69,11 @@ python/lib/pyspark.zip python/.eggs/ python/deps python/docs/_site/ +python/docs/source/reference/api/ python/test_coverage/coverage_data python/test_coverage/htmlcov python/pyspark/python +.mypy_cache/ reports/ scalastyle-on-compile.generated.xml scalastyle-output.xml @@ -79,6 +86,7 @@ target/ unit-tests.log work/ docs/.jekyll-metadata +docs/.jekyll-cache # For Hive TempStatsStore/ @@ -99,3 +107,6 @@ spark-warehouse/ # For SBT .jvmopts + +# For Node.js +node_modules diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000000..28fd3fcdf10ea --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,36 @@ + + + + + + + + + + diff --git a/LICENSE b/LICENSE index 6b169b1447f14..df6bed16f4471 100644 --- a/LICENSE +++ b/LICENSE @@ -222,14 +222,13 @@ external/spark-ganglia-lgpl/src/main/java/com/codahale/metrics/ganglia/GangliaRe Python Software Foundation License ---------------------------------- -pyspark/heapq3.py -python/docs/_static/copybutton.js +python/docs/source/_static/copybutton.js BSD 3-Clause ------------ python/lib/py4j-*-src.zip -python/pyspark/cloudpickle.py +python/pyspark/cloudpickle/*.py python/pyspark/join.py core/src/main/resources/org/apache/spark/ui/static/d3.min.js diff --git a/LICENSE-binary b/LICENSE-binary index b50da6be4e697..32c7fc315d1a3 100644 --- a/LICENSE-binary +++ b/LICENSE-binary @@ -218,7 +218,6 @@ javax.jdo:jdo-api joda-time:joda-time net.sf.opencsv:opencsv org.apache.derby:derby -org.ehcache:ehcache org.objenesis:objenesis org.roaringbitmap:RoaringBitmap org.scalanlp:breeze-macros_2.12 @@ -261,7 +260,6 @@ net.sf.supercsv:super-csv org.apache.arrow:arrow-format org.apache.arrow:arrow-memory org.apache.arrow:arrow-vector -org.apache.commons:commons-configuration2 org.apache.commons:commons-crypto org.apache.commons:commons-lang3 org.apache.hadoop:hadoop-annotations @@ -296,7 +294,6 @@ org.apache.kerby:kerby-config org.apache.kerby:kerby-pkix org.apache.kerby:kerby-util org.apache.kerby:kerby-xdr -org.apache.kerby:token-provider org.apache.orc:orc-core org.apache.orc:orc-mapreduce org.mortbay.jetty:jetty @@ -316,19 +313,15 @@ com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider com.fasterxml.jackson.module:jackson-module-jaxb-annotations com.fasterxml.jackson.module:jackson-module-paranamer com.fasterxml.jackson.module:jackson-module-scala_2.12 -com.fasterxml.woodstox:woodstox-core com.github.mifmif:generex -com.github.stephenc.jcip:jcip-annotations com.google.code.findbugs:jsr305 com.google.code.gson:gson com.google.flatbuffers:flatbuffers-java com.google.guava:guava com.google.inject:guice com.google.inject.extensions:guice-servlet -com.nimbusds:nimbus-jose-jwt com.twitter:parquet-hadoop-bundle commons-cli:commons-cli -commons-daemon:commons-daemon commons-dbcp:commons-dbcp commons-io:commons-io commons-lang:commons-lang @@ -340,8 +333,6 @@ javax.inject:javax.inject javax.validation:validation-api log4j:apache-log4j-extras log4j:log4j -net.minidev:accessors-smart -net.minidev:json-smart net.sf.jpam:jpam org.apache.avro:avro org.apache.avro:avro-ipc @@ -357,7 +348,6 @@ org.apache.directory.server:apacheds-i18n org.apache.directory.server:apacheds-kerberos-codec org.apache.htrace:htrace-core org.apache.ivy:ivy -org.apache.geronimo.specs:geronimo-jcache_1.0_spec org.apache.mesos:mesos org.apache.parquet:parquet-column org.apache.parquet:parquet-common @@ -432,7 +422,6 @@ BSD 2-Clause ------------ com.github.luben:zstd-jni -dnsjava:dnsjava javolution:javolution com.esotericsoftware:kryo-shaded com.esotericsoftware:minlog @@ -440,7 +429,6 @@ com.esotericsoftware:reflectasm com.google.protobuf:protobuf-java org.codehaus.janino:commons-compiler org.codehaus.janino:janino -org.codehaus.woodstox:stax2-api jline:jline org.jodd:jodd-core com.github.wendykierp:JTransforms @@ -456,8 +444,6 @@ org.antlr:ST4 org.antlr:stringtemplate org.antlr:antlr4-runtime antlr:antlr -com.github.fommil.netlib:core -com.google.re2j:re2j com.thoughtworks.paranamer:paranamer org.scala-lang:scala-compiler org.scala-lang:scala-library @@ -498,6 +484,9 @@ org.slf4j:jul-to-slf4j org.slf4j:slf4j-api org.slf4j:slf4j-log4j12 com.github.scopt:scopt_2.12 +dev.ludovic.netlib:blas +dev.ludovic.netlib:arpack +dev.ludovic.netlib:lapack core/src/main/resources/org/apache/spark/ui/static/dagre-d3.min.js core/src/main/resources/org/apache/spark/ui/static/*dataTables* @@ -521,7 +510,6 @@ Common Development and Distribution License (CDDL) 1.1 ------------------------------------------------------ javax.el:javax.el-api https://javaee.github.io/uel-ri/ -javax.servlet:javax.servlet-api https://javaee.github.io/servlet-spec/ javax.servlet.jsp:jsp-api javax.transaction:jta http://www.oracle.com/technetwork/java/index.html javax.xml.bind:jaxb-api https://github.com/javaee/jaxb-v2 @@ -553,16 +541,11 @@ Eclipse Public License (EPL) 2.0 -------------------------------- jakarta.annotation:jakarta-annotation-api https://projects.eclipse.org/projects/ee4j.ca +jakarta.servlet:jakarta.servlet-api https://projects.eclipse.org/projects/ee4j.servlet jakarta.ws.rs:jakarta.ws.rs-api https://github.com/eclipse-ee4j/jaxrs-api org.glassfish.hk2.external:jakarta.inject -Python Software Foundation License ----------------------------------- - -pyspark/heapq3.py - - Public Domain ------------- diff --git a/R/CRAN_RELEASE.md b/R/CRAN_RELEASE.md index 4d9b6416c01cb..2f410cf8bfd94 100644 --- a/R/CRAN_RELEASE.md +++ b/R/CRAN_RELEASE.md @@ -25,7 +25,7 @@ To release SparkR as a package to CRAN, we would use the `devtools` package. Ple First, check that the `Version:` field in the `pkg/DESCRIPTION` file is updated. Also, check for stale files not under source control. -Note that while `run-tests.sh` runs `check-cran.sh` (which runs `R CMD check`), it is doing so with `--no-manual --no-vignettes`, which skips a few vignettes or PDF checks - therefore it will be preferred to run `R CMD check` on the source package built manually before uploading a release. Also note that for CRAN checks for pdf vignettes to success, `qpdf` tool must be there (to install it, eg. `yum -q -y install qpdf`). +Note that while `run-tests.sh` runs `check-cran.sh` (which runs `R CMD check`), it is doing so with `--no-manual --no-vignettes`, which skips a few vignettes or PDF checks - therefore it will be preferred to run `R CMD check` on the source package built manually before uploading a release. Also note that for CRAN checks for pdf vignettes to success, `qpdf` tool must be there (to install it, e.g. `yum -q -y install qpdf`). To upload a release, we would need to update the `cran-comments.md`. This should generally contain the results from running the `check-cran.sh` script along with comments on status of all `WARNING` (should not be any) or `NOTE`. As a part of `check-cran.sh` and the release process, the vignettes is build - make sure `SPARK_HOME` is set and Spark jars are accessible. diff --git a/R/DOCUMENTATION.md b/R/DOCUMENTATION.md index fd0c7644189db..d4ff3f5f4875b 100644 --- a/R/DOCUMENTATION.md +++ b/R/DOCUMENTATION.md @@ -19,7 +19,7 @@ license: | # SparkR Documentation SparkR documentation is generated by using in-source comments and annotated by using -[`roxygen2`](https://cran.r-project.org/web/packages/roxygen2/index.html). After making changes to the documentation and generating man pages, +[`roxygen2`](https://cran.r-project.org/package=roxygen2). After making changes to the documentation and generating man pages, you can run the following from an R console in the SparkR home directory ```R library(devtools) diff --git a/R/README.md b/R/README.md index 31174c73526f2..da9f042b4fded 100644 --- a/R/README.md +++ b/R/README.md @@ -17,10 +17,14 @@ export R_HOME=/home/username/R #### Build Spark -Build Spark with [Maven](https://spark.apache.org/docs/latest/building-spark.html#buildmvn) and include the `-Psparkr` profile to build the R package. For example to use the default Hadoop versions you can run +Build Spark with [Maven](https://spark.apache.org/docs/latest/building-spark.html#buildmvn) or [SBT](https://spark.apache.org/docs/latest/building-spark.html#building-with-sbt), and include the `-Psparkr` profile to build the R package. For example to use the default Hadoop versions you can run ```bash +# Maven ./build/mvn -DskipTests -Psparkr package + +# SBT +./build/sbt -Psparkr package ``` #### Running sparkR diff --git a/R/WINDOWS.md b/R/WINDOWS.md index dbc27178bdb8c..9fe4a22bf22b2 100644 --- a/R/WINDOWS.md +++ b/R/WINDOWS.md @@ -22,8 +22,8 @@ To build SparkR on Windows, the following steps are required 1. Make sure `bash` is available and in `PATH` if you already have a built-in `bash` on Windows. If you do not have, install [Cygwin](https://www.cygwin.com/). -2. Install R (>= 3.1) and [Rtools](https://cloud.r-project.org/bin/windows/Rtools/). Make sure to -include Rtools and R in `PATH`. Note that support for R prior to version 3.4 is deprecated as of Spark 3.0.0. +2. Install R (>= 3.5) and [Rtools](https://cloud.r-project.org/bin/windows/Rtools/). Make sure to +include Rtools and R in `PATH`. 3. Install JDK that SparkR supports (see `R/pkg/DESCRIPTION`), and set `JAVA_HOME` in the system environment variables. diff --git a/R/install-dev.bat b/R/install-dev.bat index ed1c91ae3a0ff..ae5aa589a19d1 100644 --- a/R/install-dev.bat +++ b/R/install-dev.bat @@ -24,7 +24,13 @@ set SPARK_HOME=%~dp0.. MKDIR %SPARK_HOME%\R\lib -R.exe CMD INSTALL --library="%SPARK_HOME%\R\lib" %SPARK_HOME%\R\pkg\ +rem When you pass the package path directly as an argument to R CMD INSTALL, +rem it takes the path as 'C:\projects\spark\R\..\R\pkg"' as an example at +rem R 4.0. To work around this, directly go to the directory and install it. +rem See also SPARK-32074 +pushd %SPARK_HOME%\R\pkg\ +R.exe CMD INSTALL --library="%SPARK_HOME%\R\lib" . +popd rem Zip the SparkR package so that it can be distributed to worker nodes on YARN pushd %SPARK_HOME%\R\lib diff --git a/R/pkg/DESCRIPTION b/R/pkg/DESCRIPTION index 52d7e1f4daa53..f55286da25de1 100644 --- a/R/pkg/DESCRIPTION +++ b/R/pkg/DESCRIPTION @@ -1,6 +1,6 @@ Package: SparkR Type: Package -Version: 3.1.0 +Version: 3.2.0 Title: R Front End for 'Apache Spark' Description: Provides an R Front end for 'Apache Spark' . Authors@R: c(person("Shivaram", "Venkataraman", role = c("aut", "cre"), @@ -11,19 +11,20 @@ Authors@R: c(person("Shivaram", "Venkataraman", role = c("aut", "cre"), email = "felixcheung@apache.org"), person(family = "The Apache Software Foundation", role = c("aut", "cph"))) License: Apache License (== 2.0) -URL: https://www.apache.org/ https://spark.apache.org/ +URL: https://www.apache.org https://spark.apache.org BugReports: https://spark.apache.org/contributing.html SystemRequirements: Java (>= 8, < 12) Depends: - R (>= 3.1), + R (>= 3.5), methods Suggests: knitr, rmarkdown, + markdown, testthat, e1071, survival, - arrow (>= 0.15.1) + arrow (>= 1.0.0) Collate: 'schema.R' 'generics.R' @@ -59,7 +60,7 @@ Collate: 'types.R' 'utils.R' 'window.R' -RoxygenNote: 5.0.1 +RoxygenNote: 7.1.1 VignetteBuilder: knitr NeedsCompilation: no Encoding: UTF-8 diff --git a/R/pkg/NAMESPACE b/R/pkg/NAMESPACE index 53a0b7856567e..1f0b69db65151 100644 --- a/R/pkg/NAMESPACE +++ b/R/pkg/NAMESPACE @@ -202,6 +202,7 @@ exportMethods("%<=>%", "%in%", "abs", "acos", + "acosh", "add_months", "alias", "approx_count_distinct", @@ -222,20 +223,27 @@ exportMethods("%<=>%", "array_remove", "array_repeat", "array_sort", + "array_to_vector", "array_transform", "arrays_overlap", "array_union", "arrays_zip", "arrays_zip_with", "asc", + "asc_nulls_first", + "asc_nulls_last", "ascii", "asin", + "asinh", + "assert_true", "atan", + "atanh", "atan2", "avg", "base64", "between", "bin", + "bitwise_not", "bitwiseNOT", "bround", "cast", @@ -252,6 +260,7 @@ exportMethods("%<=>%", "cos", "cosh", "count", + "count_distinct", "countDistinct", "crc32", "create_array", @@ -272,6 +281,9 @@ exportMethods("%<=>%", "degrees", "dense_rank", "desc", + "desc_nulls_first", + "desc_nulls_last", + "dropFields", "element_at", "encode", "endsWith", @@ -286,6 +298,7 @@ exportMethods("%<=>%", "floor", "format_number", "format_string", + "from_avro", "from_csv", "from_json", "from_unixtime", @@ -348,6 +361,7 @@ exportMethods("%<=>%", "negate", "next_day", "not", + "nth_value", "ntile", "otherwise", "over", @@ -357,8 +371,10 @@ exportMethods("%<=>%", "pmod", "posexplode", "posexplode_outer", + "product", "quarter", "radians", + "raise_error", "rand", "randn", "rank", @@ -378,8 +394,11 @@ exportMethods("%<=>%", "sha1", "sha2", "shiftLeft", + "shiftleft", "shiftRight", + "shiftright", "shiftRightUnsigned", + "shiftrightunsigned", "shuffle", "sd", "sign", @@ -402,11 +421,14 @@ exportMethods("%<=>%", "substr", "substring_index", "sum", + "sum_distinct", "sumDistinct", "tan", "tanh", + "timestamp_seconds", "toDegrees", "toRadians", + "to_avro", "to_csv", "to_date", "to_json", @@ -425,9 +447,11 @@ exportMethods("%<=>%", "variance", "var_pop", "var_samp", + "vector_to_array", "weekofyear", "when", "window", + "withField", "xxhash64", "year") diff --git a/R/pkg/R/DataFrame.R b/R/pkg/R/DataFrame.R index 15b3ce2935427..72d96151f6371 100644 --- a/R/pkg/R/DataFrame.R +++ b/R/pkg/R/DataFrame.R @@ -880,7 +880,7 @@ setMethod("toJSON", #' Save the contents of SparkDataFrame as a JSON file #' -#' Save the contents of a SparkDataFrame as a JSON file (\href{http://jsonlines.org/}{ +#' Save the contents of a SparkDataFrame as a JSON file (\href{https://jsonlines.org/}{ #' JSON Lines text format or newline-delimited JSON}). Files written out #' with this method can be read back in as a SparkDataFrame using read.json(). #' @@ -1233,14 +1233,10 @@ setMethod("collect", port = port, blocking = TRUE, open = "wb", timeout = connectionTimeout) output <- tryCatch({ doServerAuth(conn, authSecret) - arrowTable <- arrow::read_arrow(readRaw(conn)) - # Arrow drops `as_tibble` since 0.14.0, see ARROW-5190. - if (exists("as_tibble", envir = asNamespace("arrow"))) { - as.data.frame(arrow::as_tibble(arrowTable), stringsAsFactors = stringsAsFactors) - } else { - as.data.frame(arrowTable, stringsAsFactors = stringsAsFactors) - } - }, finally = { + arrowTable <- arrow::read_ipc_stream(readRaw(conn)) + as.data.frame(arrowTable, stringsAsFactors = stringsAsFactors) + }, + finally = { close(conn) }) return(output) @@ -2281,16 +2277,17 @@ setMethod("mutate", # For named arguments, use the names for arguments as the column names # For unnamed arguments, use the argument symbols as the column names - args <- sapply(substitute(list(...))[-1], deparse) ns <- names(cols) - if (!is.null(ns)) { - lapply(seq_along(args), function(i) { - if (ns[[i]] != "") { - args[[i]] <<- ns[[i]] - } + if (is.null(ns)) ns <- rep("", length(cols)) + named_idx <- nzchar(ns) + if (!all(named_idx)) { + # SPARK-31517: deparse uses width.cutoff on wide input and the + # output is length>1, so need to collapse it to scalar + colsub <- substitute(list(...))[-1L] + ns[!named_idx] <- sapply(which(!named_idx), function(ii) { + paste(gsub("^\\s*|\\s*$", "", deparse(colsub[[ii]])), collapse = " ") }) } - ns <- args # The last column of the same name in the specific columns takes effect deDupCols <- list() @@ -2776,7 +2773,7 @@ setMethod("merge", #' Creates a list of columns by replacing the intersected ones with aliases #' #' Creates a list of columns by replacing the intersected ones with aliases. -#' The name of the alias column is formed by concatanating the original column name and a suffix. +#' The name of the alias column is formed by concatenating the original column name and a suffix. #' #' @param x a SparkDataFrame #' @param intersectedColNames a list of intersected column names of the SparkDataFrame @@ -2867,11 +2864,18 @@ setMethod("unionAll", #' \code{UNION ALL} and \code{UNION DISTINCT} in SQL as column positions are not taken #' into account. Input SparkDataFrames can have different data types in the schema. #' +#' When the parameter allowMissingColumns is `TRUE`, the set of column names +#' in x and y can differ; missing columns will be filled as null. +#' Further, the missing columns of x will be added at the end +#' in the schema of the union result. +#' #' Note: This does not remove duplicate rows across the two SparkDataFrames. #' This function resolves columns by name (not by position). #' #' @param x A SparkDataFrame #' @param y A SparkDataFrame +#' @param allowMissingColumns logical +#' @param ... further arguments to be passed to or from other methods. #' @return A SparkDataFrame containing the result of the union. #' @family SparkDataFrame functions #' @rdname unionByName @@ -2884,12 +2888,15 @@ setMethod("unionAll", #' df1 <- select(createDataFrame(mtcars), "carb", "am", "gear") #' df2 <- select(createDataFrame(mtcars), "am", "gear", "carb") #' head(unionByName(df1, df2)) +#' +#' df3 <- select(createDataFrame(mtcars), "carb") +#' head(unionByName(df1, df3, allowMissingColumns = TRUE)) #' } #' @note unionByName since 2.3.0 setMethod("unionByName", signature(x = "SparkDataFrame", y = "SparkDataFrame"), - function(x, y) { - unioned <- callJMethod(x@sdf, "unionByName", y@sdf) + function(x, y, allowMissingColumns=FALSE) { + unioned <- callJMethod(x@sdf, "unionByName", y@sdf, allowMissingColumns) dataFrame(unioned) }) @@ -3225,7 +3232,7 @@ setMethod("describe", #' \item stddev #' \item min #' \item max -#' \item arbitrary approximate percentiles specified as a percentage (eg, "75\%") +#' \item arbitrary approximate percentiles specified as a percentage (e.g., "75\%") #' } #' If no statistics are given, this function computes count, mean, stddev, min, #' approximate quartiles (percentiles at 25\%, 50\%, and 75\%), and max. @@ -3438,7 +3445,8 @@ setMethod("as.data.frame", #' @note attach since 1.6.0 setMethod("attach", signature(what = "SparkDataFrame"), - function(what, pos = 2L, name = deparse(substitute(what), backtick = FALSE), + function(what, pos = 2L, + name = paste(deparse(substitute(what), backtick = FALSE), collapse = " "), warn.conflicts = TRUE) { args <- as.list(environment()) # capture all parameters - this must be the first line newEnv <- assignNewEnv(args$what) @@ -3737,7 +3745,7 @@ setMethod("histogram", #' #' @param x a SparkDataFrame. #' @param url JDBC database url of the form \code{jdbc:subprotocol:subname}. -#' @param tableName yhe name of the table in the external database. +#' @param tableName the name of the table in the external database. #' @param mode one of 'append', 'overwrite', 'error', 'errorifexists', 'ignore' #' save mode (it is 'error' by default) #' @param ... additional JDBC database connection properties. diff --git a/R/pkg/R/RDD.R b/R/pkg/R/RDD.R index 7a1d157bb8a36..408a3ff25b2b2 100644 --- a/R/pkg/R/RDD.R +++ b/R/pkg/R/RDD.R @@ -970,7 +970,7 @@ setMethod("takeSample", signature(x = "RDD", withReplacement = "logical", MAXINT))))) # If the first sample didn't turn out large enough, keep trying to # take samples; this shouldn't happen often because we use a big - # multiplier for thei initial size + # multiplier for the initial size while (length(samples) < total) samples <- collectRDD(sampleRDD(x, withReplacement, fraction, as.integer(ceiling(stats::runif(1, @@ -1512,7 +1512,7 @@ setMethod("glom", #' #' @param x An RDD. #' @param y An RDD. -#' @return a new RDD created by performing the simple union (witout removing +#' @return a new RDD created by performing the simple union (without removing #' duplicates) of two input RDDs. #' @examples #'\dontrun{ diff --git a/R/pkg/R/SQLContext.R b/R/pkg/R/SQLContext.R index c0ac68332ec41..14262e1a74ab0 100644 --- a/R/pkg/R/SQLContext.R +++ b/R/pkg/R/SQLContext.R @@ -203,7 +203,7 @@ getSchema <- function(schema, firstRow = NULL, rdd = NULL) { }) } - # SPAKR-SQL does not support '.' in column name, so replace it with '_' + # SPARK-SQL does not support '.' in column name, so replace it with '_' # TODO(davies): remove this once SPARK-2775 is fixed names <- lapply(names, function(n) { nn <- gsub(".", "_", n, fixed = TRUE) @@ -374,7 +374,7 @@ setMethod("toDF", signature(x = "RDD"), #' Create a SparkDataFrame from a JSON file. #' #' Loads a JSON file, returning the result as a SparkDataFrame -#' By default, (\href{http://jsonlines.org/}{JSON Lines text format or newline-delimited JSON} +#' By default, (\href{https://jsonlines.org/}{JSON Lines text format or newline-delimited JSON} #' ) is supported. For JSON (one record per file), set a named property \code{multiLine} to #' \code{TRUE}. #' It goes through the entire dataset once to determine the schema. diff --git a/R/pkg/R/WindowSpec.R b/R/pkg/R/WindowSpec.R index 037809cd0923e..be47d0117ed7f 100644 --- a/R/pkg/R/WindowSpec.R +++ b/R/pkg/R/WindowSpec.R @@ -54,7 +54,7 @@ setMethod("show", "WindowSpec", #' Defines the partitioning columns in a WindowSpec. #' #' @param x a WindowSpec. -#' @param col a column to partition on (desribed by the name or Column). +#' @param col a column to partition on (described by the name or Column). #' @param ... additional column(s) to partition on. #' @return A WindowSpec. #' @rdname partitionBy @@ -231,7 +231,7 @@ setMethod("rangeBetween", #' @rdname over #' @name over #' @aliases over,Column,WindowSpec-method -#' @family colum_func +#' @family column_func #' @examples #' \dontrun{ #' df <- createDataFrame(mtcars) diff --git a/R/pkg/R/column.R b/R/pkg/R/column.R index 7926a9a2467ee..9fa117ccb6281 100644 --- a/R/pkg/R/column.R +++ b/R/pkg/R/column.R @@ -67,7 +67,11 @@ operators <- list( # we can not override `&&` and `||`, so use `&` and `|` instead "&" = "and", "|" = "or", "^" = "pow" ) -column_functions1 <- c("asc", "desc", "isNaN", "isNull", "isNotNull") +column_functions1 <- c( + "asc", "asc_nulls_first", "asc_nulls_last", + "desc", "desc_nulls_first", "desc_nulls_last", + "isNaN", "isNull", "isNotNull" +) column_functions2 <- c("like", "rlike", "getField", "getItem", "contains") createOperator <- function(op) { @@ -131,7 +135,7 @@ createMethods() #' @rdname alias #' @name alias #' @aliases alias,Column-method -#' @family colum_func +#' @family column_func #' @examples #' \dontrun{ #' df <- createDataFrame(iris) @@ -157,7 +161,7 @@ setMethod("alias", #' #' @rdname substr #' @name substr -#' @family colum_func +#' @family column_func #' @aliases substr,Column-method #' #' @param x a Column. @@ -183,7 +187,7 @@ setMethod("substr", signature(x = "Column"), #' #' @rdname startsWith #' @name startsWith -#' @family colum_func +#' @family column_func #' @aliases startsWith,Column-method #' #' @param x vector of character string whose "starts" are considered @@ -202,7 +206,7 @@ setMethod("startsWith", signature(x = "Column"), #' #' @rdname endsWith #' @name endsWith -#' @family colum_func +#' @family column_func #' @aliases endsWith,Column-method #' #' @param x vector of character string whose "ends" are considered @@ -220,7 +224,7 @@ setMethod("endsWith", signature(x = "Column"), #' #' @rdname between #' @name between -#' @family colum_func +#' @family column_func #' @aliases between,Column-method #' #' @param x a Column @@ -247,7 +251,7 @@ setMethod("between", signature(x = "Column"), # nolint end #' @rdname cast #' @name cast -#' @family colum_func +#' @family column_func #' @aliases cast,Column-method #' #' @examples @@ -296,7 +300,7 @@ setMethod("%in%", #' Can be a single value or a Column. #' @rdname otherwise #' @name otherwise -#' @family colum_func +#' @family column_func #' @aliases otherwise,Column-method #' @note otherwise since 1.5.0 setMethod("otherwise", @@ -356,3 +360,103 @@ setMethod("%<=>%", #' } #' @note ! since 2.3.0 setMethod("!", signature(x = "Column"), function(x) not(x)) + +#' withField +#' +#' Adds/replaces field in a struct \code{Column} by name. +#' +#' @param x a Column +#' @param fieldName a character +#' @param col a Column expression +#' +#' @rdname withField +#' @aliases withField withField,Column-method +#' @examples +#' \dontrun{ +#' df <- withColumn( +#' createDataFrame(iris), +#' "sepal", +#' struct(column("Sepal_Width"), column("Sepal_Length")) +#' ) +#' +#' head(select( +#' df, +#' withField(df$sepal, "product", df$Sepal_Length * df$Sepal_Width) +#' )) +#' } +#' @note withField since 3.1.0 +setMethod("withField", + signature(x = "Column", fieldName = "character", col = "Column"), + function(x, fieldName, col) { + jc <- callJMethod(x@jc, "withField", fieldName, col@jc) + column(jc) + }) + +#' dropFields +#' +#' Drops fields in a struct \code{Column} by name. +#' +#' @param x a Column +#' @param ... names of the fields to be dropped. +#' +#' @rdname dropFields +#' @aliases dropFields dropFields,Column-method +#' @examples +#' \dontrun{ +#' df <- select( +#' createDataFrame(iris), +#' alias( +#' struct( +#' column("Sepal_Width"), column("Sepal_Length"), +#' alias( +#' struct( +#' column("Petal_Width"), column("Petal_Length"), +#' alias( +#' column("Petal_Width") * column("Petal_Length"), +#' "Petal_Product" +#' ) +#' ), +#' "Petal" +#' ) +#' ), +#' "dimensions" +#' ) +#' ) +#' head(withColumn(df, "dimensions", dropFields(df$dimensions, "Petal"))) +#' +#' head( +#' withColumn( +#' df, "dimensions", +#' dropFields(df$dimensions, "Sepal_Width", "Sepal_Length") +#' ) +#' ) +#' +#' # This method supports dropping multiple nested fields directly e.g. +#' head( +#' withColumn( +#' df, "dimensions", +#' dropFields(df$dimensions, "Petal.Petal_Width", "Petal.Petal_Length") +#' ) +#' ) +#' +#' # However, if you are going to add/replace multiple nested fields, +#' # it is preferred to extract out the nested struct before +#' # adding/replacing multiple fields e.g. +#' head( +#' withColumn( +#' df, "dimensions", +#' withField( +#' column("dimensions"), +#' "Petal", +#' dropFields(column("dimensions.Petal"), "Petal_Width", "Petal_Length") +#' ) +#' ) +#' ) +#' } +#' @note dropFields since 3.1.0 +setMethod("dropFields", + signature(x = "Column"), + function(x, ...) { + jc <- callJMethod(x@jc, "dropFields", list(...)) + column(jc) + }) diff --git a/R/pkg/R/context.R b/R/pkg/R/context.R index e3c9d9f8793d6..cca6c2c817de9 100644 --- a/R/pkg/R/context.R +++ b/R/pkg/R/context.R @@ -86,7 +86,7 @@ makeSplits <- function(numSerializedSlices, length) { # For instance, for numSerializedSlices of 22, length of 50 # [1] 0 0 2 2 4 4 6 6 6 9 9 11 11 13 13 15 15 15 18 18 20 20 22 22 22 # [26] 25 25 27 27 29 29 31 31 31 34 34 36 36 38 38 40 40 40 43 43 45 45 47 47 47 - # Notice the slice group with 3 slices (ie. 6, 15, 22) are roughly evenly spaced. + # Notice the slice group with 3 slices (i.e. 6, 15, 22) are roughly evenly spaced. # We are trying to reimplement the calculation in the positions method in ParallelCollectionRDD if (numSerializedSlices > 0) { unlist(lapply(0: (numSerializedSlices - 1), function(x) { @@ -116,7 +116,7 @@ makeSplits <- function(numSerializedSlices, length) { #' This change affects both createDataFrame and spark.lapply. #' In the specific one case that it is used to convert R native object into SparkDataFrame, it has #' always been kept at the default of 1. In the case the object is large, we are explicitly setting -#' the parallism to numSlices (which is still 1). +#' the parallelism to numSlices (which is still 1). #' #' Specifically, we are changing to split positions to match the calculation in positions() of #' ParallelCollectionRDD in Spark. diff --git a/R/pkg/R/deserialize.R b/R/pkg/R/deserialize.R index 3e7c456bd548d..89a8fbecd36b0 100644 --- a/R/pkg/R/deserialize.R +++ b/R/pkg/R/deserialize.R @@ -233,24 +233,13 @@ readMultipleObjectsWithKeys <- function(inputCon) { readDeserializeInArrow <- function(inputCon) { if (requireNamespace("arrow", quietly = TRUE)) { - # Arrow drops `as_tibble` since 0.14.0, see ARROW-5190. - useAsTibble <- exists("as_tibble", envir = asNamespace("arrow")) - - # Currently, there looks no way to read batch by batch by socket connection in R side, # See ARROW-4512. Therefore, it reads the whole Arrow streaming-formatted binary at once # for now. dataLen <- readInt(inputCon) arrowData <- readBin(inputCon, raw(), as.integer(dataLen), endian = "big") batches <- arrow::RecordBatchStreamReader$create(arrowData)$batches() - - if (useAsTibble) { - as_tibble <- get("as_tibble", envir = asNamespace("arrow")) - # Read all groupped batches. Tibble -> data.frame is cheap. - lapply(batches, function(batch) as.data.frame(as_tibble(batch))) - } else { - lapply(batches, function(batch) as.data.frame(batch)) - } + lapply(batches, function(batch) as.data.frame(batch)) } else { stop("'arrow' package should be installed.") } @@ -261,7 +250,7 @@ readDeserializeWithKeysInArrow <- function(inputCon) { keys <- readMultipleObjects(inputCon) - # Read keys to map with each groupped batch later. + # Read keys to map with each grouped batch later. list(keys = keys, data = data) } diff --git a/R/pkg/R/functions.R b/R/pkg/R/functions.R index da9ef1d6674bd..3ee1cd5b50b48 100644 --- a/R/pkg/R/functions.R +++ b/R/pkg/R/functions.R @@ -144,7 +144,7 @@ NULL #' @param y Column to compute on. #' @param pos In \itemize{ #' \item \code{locate}: a start position of search. -#' \item \code{overlay}: a start postiton for replacement. +#' \item \code{overlay}: a start position for replacement. #' } #' @param len In \itemize{ #' \item \code{lpad} the maximum length of each output result. @@ -247,7 +247,7 @@ NULL #' used to transform the data. The first argument is the key, the second argument #' is the value. #' } -#' @param zero a \code{Column} used as the initial value in \code{array_aggregate} +#' @param initialValue a \code{Column} used as the initial value in \code{array_aggregate} #' @param merge a \code{function} a binary function \code{(Column, Column) -> Column} #' used in \code{array_aggregate}to merge values (the second argument) #' into accumulator (the first argument). @@ -338,12 +338,79 @@ NULL #' tmp <- mutate(df, dist = over(cume_dist(), ws), dense_rank = over(dense_rank(), ws), #' lag = over(lag(df$mpg), ws), lead = over(lead(df$mpg, 1), ws), #' percent_rank = over(percent_rank(), ws), -#' rank = over(rank(), ws), row_number = over(row_number(), ws)) +#' rank = over(rank(), ws), row_number = over(row_number(), ws), +#' nth_value = over(nth_value(df$mpg, 3), ws)) #' # Get ntile group id (1-4) for hp #' tmp <- mutate(tmp, ntile = over(ntile(4), ws)) #' head(tmp)} NULL +#' ML functions for Column operations +#' +#' ML functions defined for \code{Column}. +#' +#' @param x Column to compute on. +#' @param ... additional argument(s). +#' @name column_ml_functions +#' @rdname column_ml_functions +#' @family ml functions +#' @examples +#' \dontrun{ +#' df <- read.df("data/mllib/sample_libsvm_data.txt", source = "libsvm") +#' head( +#' withColumn( +#' withColumn(df, "array", vector_to_array(df$features)), +#' "vector", +#' array_to_vector(column("array")) +#' ) +#' ) +#' } +NULL + +#' Avro processing functions for Column operations +#' +#' Avro processing functions defined for \code{Column}. +#' +#' @param x Column to compute on. +#' @param jsonFormatSchema character Avro schema in JSON string format +#' @param ... additional argument(s) passed as parser options. +#' @name column_avro_functions +#' @rdname column_avro_functions +#' @family avro functions +#' @note Avro is built-in but external data source module since Spark 2.4. +#' Please deploy the application as per +#' \href{https://spark.apache.org/docs/latest/sql-data-sources-avro.html#deploying}{ +#' the deployment section +#' } of "Apache Avro Data Source Guide". +#' @examples +#' \dontrun{ +#' df <- createDataFrame(iris) +#' schema <- paste( +#' c( +#' '{"type": "record", "namespace": "example.avro", "name": "Iris", "fields": [', +#' '{"type": ["double", "null"], "name": "Sepal_Length"},', +#' '{"type": ["double", "null"], "name": "Sepal_Width"},', +#' '{"type": ["double", "null"], "name": "Petal_Length"},', +#' '{"type": ["double", "null"], "name": "Petal_Width"},', +#' '{"type": ["string", "null"], "name": "Species"}]}' +#' ), +#' collapse="\\n" +#' ) +#' +#' df_serialized <- select( +#' df, +#' alias(to_avro(alias(struct(column("*")), "fields")), "payload") +#' ) +#' +#' df_deserialized <- select( +#' df_serialized, +#' from_avro(df_serialized$payload, schema) +#' ) +#' +#' head(df_deserialized) +#' } +NULL + #' @details #' \code{lit}: A new Column is created to represent the literal value. #' If the parameter is a Column, it is returned unchanged. @@ -394,6 +461,19 @@ setMethod("acos", column(jc) }) +#' @details +#' \code{acosh}: Computes inverse hyperbolic cosine of the input column. +#' +#' @rdname column_math_functions +#' @aliases acosh acosh,Column-method +#' @note acosh since 3.1.0 +setMethod("acosh", + signature(x = "Column"), + function(x) { + jc <- callJStatic("org.apache.spark.sql.functions", "acosh", x@jc) + column(jc) + }) + #' @details #' \code{approx_count_distinct}: Returns the approximate number of distinct items in a group. #' @@ -404,7 +484,7 @@ setMethod("acos", #' \dontrun{ #' head(select(df, approx_count_distinct(df$gear))) #' head(select(df, approx_count_distinct(df$gear, 0.02))) -#' head(select(df, countDistinct(df$gear, df$cyl))) +#' head(select(df, count_distinct(df$gear, df$cyl))) #' head(select(df, n_distinct(df$gear))) #' head(distinct(select(df, "gear")))} #' @note approx_count_distinct(Column) since 3.0.0 @@ -461,6 +541,19 @@ setMethod("asin", column(jc) }) +#' @details +#' \code{asinh}: Computes inverse hyperbolic sine of the input column. +#' +#' @rdname column_math_functions +#' @aliases asinh asinh,Column-method +#' @note asinh since 3.1.0 +setMethod("asinh", + signature(x = "Column"), + function(x) { + jc <- callJStatic("org.apache.spark.sql.functions", "asinh", x@jc) + column(jc) + }) + #' @details #' \code{atan}: Returns the inverse tangent of the given value, #' as if computed by \code{java.lang.Math.atan()} @@ -475,6 +568,19 @@ setMethod("atan", column(jc) }) +#' @details +#' \code{atanh}: Computes inverse hyperbolic tangent of the input column. +#' +#' @rdname column_math_functions +#' @aliases atanh atanh,Column-method +#' @note atanh since 3.1.0 +setMethod("atanh", + signature(x = "Column"), + function(x) { + jc <- callJStatic("org.apache.spark.sql.functions", "atanh", x@jc) + column(jc) + }) + #' avg #' #' Aggregate function: returns the average of the values in a group. @@ -530,20 +636,33 @@ setMethod("bin", }) #' @details -#' \code{bitwiseNOT}: Computes bitwise NOT. +#' \code{bitwise_not}: Computes bitwise NOT. #' #' @rdname column_nonaggregate_functions -#' @aliases bitwiseNOT bitwiseNOT,Column-method +#' @aliases bitwise_not bitwise_not,Column-method #' @examples #' #' \dontrun{ -#' head(select(df, bitwiseNOT(cast(df$vs, "int"))))} +#' head(select(df, bitwise_not(cast(df$vs, "int"))))} +#' @note bitwise_not since 3.2.0 +setMethod("bitwise_not", + signature(x = "Column"), + function(x) { + jc <- callJStatic("org.apache.spark.sql.functions", "bitwise_not", x@jc) + column(jc) + }) + +#' @details +#' \code{bitwiseNOT}: Computes bitwise NOT. +#' +#' @rdname column_nonaggregate_functions +#' @aliases bitwiseNOT bitwiseNOT,Column-method #' @note bitwiseNOT since 1.5.0 setMethod("bitwiseNOT", signature(x = "Column"), function(x) { - jc <- callJStatic("org.apache.spark.sql.functions", "bitwiseNOT", x@jc) - column(jc) + .Deprecated("bitwise_not") + bitwise_not(x) }) #' @details @@ -809,6 +928,57 @@ setMethod("xxhash64", column(jc) }) +#' @details +#' \code{assert_true}: Returns null if the input column is true; throws an exception +#' with the provided error message otherwise. +#' +#' @param errMsg (optional) The error message to be thrown. +#' +#' @rdname column_misc_functions +#' @aliases assert_true assert_true,Column-method +#' @examples +#' \dontrun{ +#' tmp <- mutate(df, v1 = assert_true(df$vs < 2), +#' v2 = assert_true(df$vs < 2, "custom error message"), +#' v3 = assert_true(df$vs < 2, df$vs)) +#' head(tmp)} +#' @note assert_true since 3.1.0 +setMethod("assert_true", + signature(x = "Column"), + function(x, errMsg = NULL) { + jc <- if (is.null(errMsg)) { + callJStatic("org.apache.spark.sql.functions", "assert_true", x@jc) + } else { + if (is.character(errMsg)) { + stopifnot(length(errMsg) == 1) + errMsg <- lit(errMsg) + } + callJStatic("org.apache.spark.sql.functions", "assert_true", x@jc, errMsg@jc) + } + column(jc) + }) + +#' @details +#' \code{raise_error}: Throws an exception with the provided error message. +#' +#' @rdname column_misc_functions +#' @aliases raise_error raise_error,characterOrColumn-method +#' @examples +#' \dontrun{ +#' tmp <- mutate(df, v1 = raise_error("error message")) +#' head(tmp)} +#' @note raise_error since 3.1.0 +setMethod("raise_error", + signature(x = "characterOrColumn"), + function(x) { + if (is.character(x)) { + stopifnot(length(x) == 1) + x <- lit(x) + } + jc <- callJStatic("org.apache.spark.sql.functions", "raise_error", x@jc) + column(jc) + }) + #' @details #' \code{dayofmonth}: Extracts the day of the month as an integer from a #' given date/timestamp/string. @@ -1403,6 +1573,19 @@ setMethod("overlay", column(jc) }) +#' @details +#' \code{product}: Returns the product of the values in a group. +#' +#' @rdname column_aggregate_functions +#' @aliases product product,Column-method +#' @note product since 3.2.0 +setMethod("product", + signature(x = "Column"), + function(x) { + jc <- callJStatic("org.apache.spark.sql.functions", "product", x@jc) + column(jc) + }) + #' @details #' \code{quarter}: Extracts the quarter as an integer from a given date/timestamp/string. #' @@ -1417,8 +1600,10 @@ setMethod("quarter", }) #' @details -#' \code{percentile_approx} Returns the approximate percentile value of -#' numeric column at the given percentage. +#' \code{percentile_approx} Returns the approximate \code{percentile} of the numeric column +#' \code{col} which is the smallest value in the ordered \code{col} values (sorted from least to +#' greatest) such that no more than \code{percentage} of \code{col} values is less than the value +#' or equal to that value. #' #' @param percentage Numeric percentage at which percentile should be computed #' All values should be between 0 and 1. @@ -1778,21 +1963,34 @@ setMethod("sum", }) #' @details -#' \code{sumDistinct}: Returns the sum of distinct values in the expression. +#' \code{sum_distinct}: Returns the sum of distinct values in the expression. #' #' @rdname column_aggregate_functions -#' @aliases sumDistinct sumDistinct,Column-method +#' @aliases sum_distinct sum_distinct,Column-method #' @examples #' #' \dontrun{ -#' head(select(df, sumDistinct(df$gear))) +#' head(select(df, sum_distinct(df$gear))) #' head(distinct(select(df, "gear")))} +#' @note sum_distinct since 3.2.0 +setMethod("sum_distinct", + signature(x = "Column"), + function(x) { + jc <- callJStatic("org.apache.spark.sql.functions", "sum_distinct", x@jc) + column(jc) + }) + +#' @details +#' \code{sumDistinct}: Returns the sum of distinct values in the expression. +#' +#' @rdname column_aggregate_functions +#' @aliases sumDistinct sumDistinct,Column-method #' @note sumDistinct since 1.4.0 setMethod("sumDistinct", signature(x = "Column"), function(x) { - jc <- callJStatic("org.apache.spark.sql.functions", "sumDistinct", x@jc) - column(jc) + .Deprecated("sum_distinct") + sum_distinct(x) }) #' @details @@ -2286,7 +2484,7 @@ setMethod("pmod", signature(y = "Column"), column(jc) }) -#' @param rsd maximum estimation error allowed (default = 0.05). +#' @param rsd maximum relative standard deviation allowed (default = 0.05). #' #' @rdname column_aggregate_functions #' @aliases approx_count_distinct,Column-method @@ -2310,23 +2508,37 @@ setMethod("approxCountDistinct", }) #' @details -#' \code{countDistinct}: Returns the number of distinct items in a group. +#' \code{count_distinct}: Returns the number of distinct items in a group. #' #' @rdname column_aggregate_functions -#' @aliases countDistinct countDistinct,Column-method -#' @note countDistinct since 1.4.0 -setMethod("countDistinct", +#' @aliases count_distinct count_distinct,Column-method +#' @note count_distinct since 3.2.0 +setMethod("count_distinct", signature(x = "Column"), function(x, ...) { jcols <- lapply(list(...), function(x) { stopifnot(class(x) == "Column") x@jc }) - jc <- callJStatic("org.apache.spark.sql.functions", "countDistinct", x@jc, + jc <- callJStatic("org.apache.spark.sql.functions", "count_distinct", x@jc, jcols) column(jc) }) +#' @details +#' \code{countDistinct}: Returns the number of distinct items in a group. +#' +#' An alias of \code{count_distinct}, and it is encouraged to use \code{count_distinct} directly. +#' +#' @rdname column_aggregate_functions +#' @aliases countDistinct countDistinct,Column-method +#' @note countDistinct since 1.4.0 +setMethod("countDistinct", + signature(x = "Column"), + function(x, ...) { + count_distinct(x, ...) + }) + #' @details #' \code{concat}: Concatenates multiple input columns together into a single column. #' The function works with strings, binary and compatible array columns. @@ -2391,7 +2603,7 @@ setMethod("least", #' @note n_distinct since 1.4.0 setMethod("n_distinct", signature(x = "Column"), function(x, ...) { - countDistinct(x, ...) + count_distinct(x, ...) }) #' @rdname count @@ -2734,6 +2946,21 @@ setMethod("sha2", signature(y = "Column", x = "numeric"), column(jc) }) +#' @details +#' \code{shiftleft}: Shifts the given value numBits left. If the given value is a long value, +#' this function will return a long value else it will return an integer value. +#' +#' @rdname column_math_functions +#' @aliases shiftleft shiftleft,Column,numeric-method +#' @note shiftleft since 3.2.0 +setMethod("shiftleft", signature(y = "Column", x = "numeric"), + function(y, x) { + jc <- callJStatic("org.apache.spark.sql.functions", + "shiftleft", + y@jc, as.integer(x)) + column(jc) + }) + #' @details #' \code{shiftLeft}: Shifts the given value numBits left. If the given value is a long value, #' this function will return a long value else it will return an integer value. @@ -2742,9 +2969,22 @@ setMethod("sha2", signature(y = "Column", x = "numeric"), #' @aliases shiftLeft shiftLeft,Column,numeric-method #' @note shiftLeft since 1.5.0 setMethod("shiftLeft", signature(y = "Column", x = "numeric"), + function(y, x) { + .Deprecated("shiftleft") + shiftleft(y, x) + }) + +#' @details +#' \code{shiftright}: (Signed) shifts the given value numBits right. If the given value is a long +#' value, it will return a long value else it will return an integer value. +#' +#' @rdname column_math_functions +#' @aliases shiftright shiftright,Column,numeric-method +#' @note shiftright since 3.2.0 +setMethod("shiftright", signature(y = "Column", x = "numeric"), function(y, x) { jc <- callJStatic("org.apache.spark.sql.functions", - "shiftLeft", + "shiftright", y@jc, as.integer(x)) column(jc) }) @@ -2757,15 +2997,28 @@ setMethod("shiftLeft", signature(y = "Column", x = "numeric"), #' @aliases shiftRight shiftRight,Column,numeric-method #' @note shiftRight since 1.5.0 setMethod("shiftRight", signature(y = "Column", x = "numeric"), + function(y, x) { + .Deprecated("shiftright") + shiftright(y, x) + }) + +#' @details +#' \code{shiftrightunsigned}: (Unsigned) shifts the given value numBits right. If the given value is +#' a long value, it will return a long value else it will return an integer value. +#' +#' @rdname column_math_functions +#' @aliases shiftrightunsigned shiftrightunsigned,Column,numeric-method +#' @note shiftrightunsigned since 3.2.0 +setMethod("shiftrightunsigned", signature(y = "Column", x = "numeric"), function(y, x) { jc <- callJStatic("org.apache.spark.sql.functions", - "shiftRight", + "shiftrightunsigned", y@jc, as.integer(x)) column(jc) }) #' @details -#' \code{shiftRightUnsigned}: (Unigned) shifts the given value numBits right. If the given value is +#' \code{shiftRightUnsigned}: (Unsigned) shifts the given value numBits right. If the given value is #' a long value, it will return a long value else it will return an integer value. #' #' @rdname column_math_functions @@ -2773,10 +3026,8 @@ setMethod("shiftRight", signature(y = "Column", x = "numeric"), #' @note shiftRightUnsigned since 1.5.0 setMethod("shiftRightUnsigned", signature(y = "Column", x = "numeric"), function(y, x) { - jc <- callJStatic("org.apache.spark.sql.functions", - "shiftRightUnsigned", - y@jc, as.integer(x)) - column(jc) + .Deprecated("shiftrightunsigned") + shiftrightunsigned(y, x) }) #' @details @@ -3296,6 +3547,37 @@ setMethod("lead", column(jc) }) +#' @details +#' \code{nth_value}: Window function: returns the value that is the \code{offset}th +#' row of the window frame# (counting from 1), and \code{null} if the size of window +#' frame is less than \code{offset} rows. +#' +#' @param offset a numeric indicating number of row to use as the value +#' @param na.rm a logical which indicates that the Nth value should skip null in the +#' determination of which row to use +#' +#' @rdname column_window_functions +#' @aliases nth_value nth_value,characterOrColumn-method +#' @note nth_value since 3.1.0 +setMethod("nth_value", + signature(x = "characterOrColumn", offset = "numeric"), + function(x, offset, na.rm = FALSE) { + x <- if (is.character(x)) { + column(x) + } else { + x + } + offset <- as.integer(offset) + jc <- callJStatic( + "org.apache.spark.sql.functions", + "nth_value", + x@jc, + offset, + na.rm + ) + column(jc) + }) + #' @details #' \code{ntile}: Returns the ntile group id (from 1 to n inclusive) in an ordered window #' partition. For example, if n is 4, the first quarter of the rows will get value 1, the second @@ -3388,7 +3670,12 @@ unresolved_named_lambda_var <- function(...) { "org.apache.spark.sql.Column", newJObject( "org.apache.spark.sql.catalyst.expressions.UnresolvedNamedLambdaVariable", - list(...) + lapply(list(...), function(x) { + handledCallJStatic( + "org.apache.spark.sql.catalyst.expressions.UnresolvedNamedLambdaVariable", + "freshVarName", + x) + }) ) ) column(jc) @@ -3476,11 +3763,11 @@ invoke_higher_order_function <- function(name, cols, funs) { #' @aliases array_aggregate array_aggregate,characterOrColumn,Column,function-method #' @note array_aggregate since 3.1.0 setMethod("array_aggregate", - signature(x = "characterOrColumn", zero = "Column", merge = "function"), - function(x, zero, merge, finish = NULL) { + signature(x = "characterOrColumn", initialValue = "Column", merge = "function"), + function(x, initialValue, merge, finish = NULL) { invoke_higher_order_function( "ArrayAggregate", - cols = list(x, zero), + cols = list(x, initialValue), funs = if (is.null(finish)) { list(merge) } else { @@ -4380,7 +4667,8 @@ setMethod("date_trunc", }) #' @details -#' \code{current_date}: Returns the current date as a date column. +#' \code{current_date}: Returns the current date at the start of query evaluation as a date column. +#' All calls of current_date within the same query return the same value. #' #' @rdname column_datetime_functions #' @aliases current_date current_date,missing-method @@ -4396,7 +4684,8 @@ setMethod("current_date", }) #' @details -#' \code{current_timestamp}: Returns the current timestamp as a timestamp column. +#' \code{current_timestamp}: Returns the current timestamp at the start of query evaluation as +#' a timestamp column. All calls of current_timestamp within the same query return the same value. #' #' @rdname column_datetime_functions #' @aliases current_timestamp current_timestamp,missing-method @@ -4407,3 +4696,115 @@ setMethod("current_timestamp", jc <- callJStatic("org.apache.spark.sql.functions", "current_timestamp") column(jc) }) + +#' @details +#' \code{timestamp_seconds}: Creates timestamp from the number of seconds since UTC epoch. +#' +#' @rdname column_datetime_functions +#' @aliases timestamp_seconds timestamp_seconds,Column-method +#' @note timestamp_seconds since 3.1.0 +setMethod("timestamp_seconds", + signature(x = "Column"), + function(x) { + jc <- callJStatic( + "org.apache.spark.sql.functions", "timestamp_seconds", x@jc + ) + column(jc) + }) + +#' @details +#' \code{array_to_vector} Converts a column of array of numeric type into +#' a column of dense vectors in MLlib +#' +#' @rdname column_ml_functions +#' @aliases array_to_vector array_to_vector,Column-method +#' @note array_to_vector since 3.1.0 +setMethod("array_to_vector", + signature(x = "Column"), + function(x) { + jc <- callJStatic( + "org.apache.spark.ml.functions", + "array_to_vector", + x@jc + ) + column(jc) + }) + +#' @details +#' \code{vector_to_array} Converts a column of MLlib sparse/dense vectors into +#' a column of dense arrays. +#' +#' @param dtype The data type of the output array. Valid values: "float64" or "float32". +#' +#' @rdname column_ml_functions +#' @aliases vector_to_array vector_to_array,Column-method +#' @note vector_to_array since 3.1.0 +setMethod("vector_to_array", + signature(x = "Column"), + function(x, dtype = c("float64", "float32")) { + dtype <- match.arg(dtype) + jc <- callJStatic( + "org.apache.spark.ml.functions", + "vector_to_array", + x@jc, + dtype + ) + column(jc) + }) + +#' @details +#' \code{from_avro} Converts a binary column of Avro format into its corresponding catalyst value. +#' The specified schema must match the read data, otherwise the behavior is undefined: +#' it may fail or return arbitrary result. +#' To deserialize the data with a compatible and evolved schema, the expected Avro schema can be +#' set via the option avroSchema. +#' +#' @rdname column_avro_functions +#' @aliases from_avro from_avro,Column-method +#' @note from_avro since 3.1.0 +setMethod("from_avro", + signature(x = "characterOrColumn"), + function(x, jsonFormatSchema, ...) { + x <- if (is.character(x)) { + column(x) + } else { + x + } + + options <- varargsToStrEnv(...) + jc <- callJStatic( + "org.apache.spark.sql.avro.functions", "from_avro", + x@jc, + jsonFormatSchema, + options + ) + column(jc) + }) + +#' @details +#' \code{to_avro} Converts a column into binary of Avro format. +#' +#' @rdname column_avro_functions +#' @aliases to_avro to_avro,Column-method +#' @note to_avro since 3.1.0 +setMethod("to_avro", + signature(x = "characterOrColumn"), + function(x, jsonFormatSchema = NULL) { + x <- if (is.character(x)) { + column(x) + } else { + x + } + + jc <- if (is.null(jsonFormatSchema)) { + callJStatic("org.apache.spark.sql.avro.functions", "to_avro", x@jc) + } else { + callJStatic( + "org.apache.spark.sql.avro.functions", + "to_avro", + x@jc, + jsonFormatSchema + ) + } + column(jc) + }) diff --git a/R/pkg/R/generics.R b/R/pkg/R/generics.R index 839c00cf21aeb..38ad5f742ca68 100644 --- a/R/pkg/R/generics.R +++ b/R/pkg/R/generics.R @@ -638,7 +638,7 @@ setGeneric("union", function(x, y) { standardGeneric("union") }) setGeneric("unionAll", function(x, y) { standardGeneric("unionAll") }) #' @rdname unionByName -setGeneric("unionByName", function(x, y) { standardGeneric("unionByName") }) +setGeneric("unionByName", function(x, y, ...) { standardGeneric("unionByName") }) #' @rdname unpersist setGeneric("unpersist", function(x, ...) { standardGeneric("unpersist") }) @@ -675,6 +675,12 @@ setGeneric("broadcast", function(x) { standardGeneric("broadcast") }) #' @rdname columnfunctions setGeneric("asc", function(x) { standardGeneric("asc") }) +#' @rdname columnfunctions +setGeneric("asc_nulls_first", function(x) { standardGeneric("asc_nulls_first") }) + +#' @rdname columnfunctions +setGeneric("asc_nulls_last", function(x) { standardGeneric("asc_nulls_last") }) + #' @rdname between setGeneric("between", function(x, bounds) { standardGeneric("between") }) @@ -689,6 +695,12 @@ setGeneric("contains", function(x, ...) { standardGeneric("contains") }) #' @rdname columnfunctions setGeneric("desc", function(x) { standardGeneric("desc") }) +#' @rdname columnfunctions +setGeneric("desc_nulls_first", function(x) { standardGeneric("desc_nulls_first") }) + +#' @rdname columnfunctions +setGeneric("desc_nulls_last", function(x) { standardGeneric("desc_nulls_last") }) + #' @rdname endsWith setGeneric("endsWith", function(x, suffix) { standardGeneric("endsWith") }) @@ -729,6 +741,12 @@ setGeneric("over", function(x, window) { standardGeneric("over") }) #' @rdname eq_null_safe setGeneric("%<=>%", function(x, value) { standardGeneric("%<=>%") }) +#' @rdname withField +setGeneric("withField", function(x, fieldName, col) { standardGeneric("withField") }) + +#' @rdname dropFields +setGeneric("dropFields", function(x, ...) { standardGeneric("dropFields") }) + ###################### WindowSpec Methods ########################## #' @rdname partitionBy @@ -762,7 +780,8 @@ setGeneric("approxCountDistinct", function(x, ...) { standardGeneric("approxCoun #' @rdname column_collection_functions #' @name NULL -setGeneric("array_aggregate", function(x, zero, merge, ...) { standardGeneric("array_aggregate") }) +setGeneric("array_aggregate", + function(x, initialValue, merge, ...) { standardGeneric("array_aggregate") }) #' @rdname column_collection_functions #' @name NULL @@ -820,6 +839,10 @@ setGeneric("array_repeat", function(x, count) { standardGeneric("array_repeat") #' @name NULL setGeneric("array_sort", function(x) { standardGeneric("array_sort") }) +#' @rdname column_ml_functions +#' @name NULL +setGeneric("array_to_vector", function(x) { standardGeneric("array_to_vector") }) + #' @rdname column_collection_functions #' @name NULL setGeneric("array_transform", function(x, f) { standardGeneric("array_transform") }) @@ -844,6 +867,10 @@ setGeneric("arrays_zip_with", function(x, y, f) { standardGeneric("arrays_zip_wi #' @name NULL setGeneric("ascii", function(x) { standardGeneric("ascii") }) +#' @rdname column_misc_functions +#' @name NULL +setGeneric("assert_true", function(x, errMsg = NULL) { standardGeneric("assert_true") }) + #' @param x Column to compute on or a GroupedData object. #' @param ... additional argument(s) when \code{x} is a GroupedData object. #' @rdname avg @@ -857,6 +884,10 @@ setGeneric("base64", function(x) { standardGeneric("base64") }) #' @name NULL setGeneric("bin", function(x) { standardGeneric("bin") }) +#' @rdname column_nonaggregate_functions +#' @name NULL +setGeneric("bitwise_not", function(x) { standardGeneric("bitwise_not") }) + #' @rdname column_nonaggregate_functions #' @name NULL setGeneric("bitwiseNOT", function(x) { standardGeneric("bitwiseNOT") }) @@ -896,6 +927,10 @@ setGeneric("concat_ws", function(sep, x, ...) { standardGeneric("concat_ws") }) #' @name NULL setGeneric("conv", function(x, fromBase, toBase) { standardGeneric("conv") }) +#' @rdname column_aggregate_functions +#' @name NULL +setGeneric("count_distinct", function(x, ...) { standardGeneric("count_distinct") }) + #' @rdname column_aggregate_functions #' @name NULL setGeneric("countDistinct", function(x, ...) { standardGeneric("countDistinct") }) @@ -928,7 +963,6 @@ setGeneric("current_date", function(x = "missing") { standardGeneric("current_da #' @name NULL setGeneric("current_timestamp", function(x = "missing") { standardGeneric("current_timestamp") }) - #' @rdname column_datetime_diff_functions #' @name NULL setGeneric("datediff", function(y, x) { standardGeneric("datediff") }) @@ -993,6 +1027,10 @@ setGeneric("expr", function(x) { standardGeneric("expr") }) #' @name NULL setGeneric("flatten", function(x) { standardGeneric("flatten") }) +#' @rdname column_avro_functions +#' @name NULL +setGeneric("from_avro", function(x, ...) { standardGeneric("from_avro") }) + #' @rdname column_datetime_diff_functions #' @name NULL setGeneric("from_utc_timestamp", function(y, x) { standardGeneric("from_utc_timestamp") }) @@ -1161,6 +1199,10 @@ setGeneric("months_between", function(y, x, ...) { standardGeneric("months_betwe #' @rdname count setGeneric("n", function(x) { standardGeneric("n") }) +#' @rdname column_window_functions +#' @name NULL +setGeneric("nth_value", function(x, offset, ...) { standardGeneric("nth_value") }) + #' @rdname column_nonaggregate_functions #' @name NULL setGeneric("nanvl", function(y, x) { standardGeneric("nanvl") }) @@ -1209,10 +1251,18 @@ setGeneric("posexplode", function(x) { standardGeneric("posexplode") }) #' @name NULL setGeneric("posexplode_outer", function(x) { standardGeneric("posexplode_outer") }) +#' @rdname column_aggregate_functions +#' @name NULL +setGeneric("product", function(x) { standardGeneric("product") }) + #' @rdname column_datetime_functions #' @name NULL setGeneric("quarter", function(x) { standardGeneric("quarter") }) +#' @rdname column_misc_functions +#' @name NULL +setGeneric("raise_error", function(x) { standardGeneric("raise_error") }) + #' @rdname column_nonaggregate_functions #' @name NULL setGeneric("rand", function(seed) { standardGeneric("rand") }) @@ -1286,14 +1336,26 @@ setGeneric("sha2", function(y, x) { standardGeneric("sha2") }) #' @name NULL setGeneric("shiftLeft", function(y, x) { standardGeneric("shiftLeft") }) +#' @rdname column_math_functions +#' @name NULL +setGeneric("shiftleft", function(y, x) { standardGeneric("shiftleft") }) + #' @rdname column_math_functions #' @name NULL setGeneric("shiftRight", function(y, x) { standardGeneric("shiftRight") }) +#' @rdname column_math_functions +#' @name NULL +setGeneric("shiftright", function(y, x) { standardGeneric("shiftright") }) + #' @rdname column_math_functions #' @name NULL setGeneric("shiftRightUnsigned", function(y, x) { standardGeneric("shiftRightUnsigned") }) +#' @rdname column_math_functions +#' @name NULL +setGeneric("shiftrightunsigned", function(y, x) { standardGeneric("shiftrightunsigned") }) + #' @rdname column_collection_functions #' @name NULL setGeneric("shuffle", function(x) { standardGeneric("shuffle") }) @@ -1350,10 +1412,22 @@ setGeneric("struct", function(x, ...) { standardGeneric("struct") }) #' @name NULL setGeneric("substring_index", function(x, delim, count) { standardGeneric("substring_index") }) +#' @rdname column_aggregate_functions +#' @name NULL +setGeneric("sum_distinct", function(x) { standardGeneric("sum_distinct") }) + #' @rdname column_aggregate_functions #' @name NULL setGeneric("sumDistinct", function(x) { standardGeneric("sumDistinct") }) +#' @rdname column_datetime_functions +#' @name timestamp_seconds +setGeneric("timestamp_seconds", function(x) { standardGeneric("timestamp_seconds") }) + +#' @rdname column_avro_functions +#' @name NULL +setGeneric("to_avro", function(x, ...) { standardGeneric("to_avro") }) + #' @rdname column_collection_functions #' @name NULL setGeneric("transform_keys", function(x, f) { standardGeneric("transform_keys") }) @@ -1438,6 +1512,10 @@ setGeneric("var_pop", function(x) { standardGeneric("var_pop") }) #' @name NULL setGeneric("var_samp", function(x) { standardGeneric("var_samp") }) +#' @rdname column_ml_functions +#' @name NULL +setGeneric("vector_to_array", function(x, ...) { standardGeneric("vector_to_array") }) + #' @rdname column_datetime_functions #' @name NULL setGeneric("weekofyear", function(x) { standardGeneric("weekofyear") }) diff --git a/R/pkg/R/install.R b/R/pkg/R/install.R index ea2c0b4c0f42f..bbb9188cd083f 100644 --- a/R/pkg/R/install.R +++ b/R/pkg/R/install.R @@ -39,11 +39,11 @@ #' version number in the format of "x.y" where x and y are integer. #' If \code{hadoopVersion = "without"}, "Hadoop free" build is installed. #' See -#' \href{http://spark.apache.org/docs/latest/hadoop-provided.html}{ +#' \href{https://spark.apache.org/docs/latest/hadoop-provided.html}{ #' "Hadoop Free" Build} for more information. #' Other patched version names can also be used, e.g. \code{"cdh4"} #' @param mirrorUrl base URL of the repositories to use. The directory layout should follow -#' \href{http://www.apache.org/dyn/closer.lua/spark/}{Apache mirrors}. +#' \href{https://www.apache.org/dyn/closer.lua/spark/}{Apache mirrors}. #' @param localDir a local directory where Spark is installed. The directory contains #' version-specific folders of Spark packages. Default is path to #' the cache directory: @@ -64,7 +64,7 @@ #'} #' @note install.spark since 2.1.0 #' @seealso See available Hadoop versions: -#' \href{http://spark.apache.org/downloads.html}{Apache Spark} +#' \href{https://spark.apache.org/downloads.html}{Apache Spark} install.spark <- function(hadoopVersion = "2.7", mirrorUrl = NULL, localDir = NULL, overwrite = FALSE) { sparkHome <- Sys.getenv("SPARK_HOME") @@ -289,7 +289,7 @@ sparkCachePath <- function() { } # Length of the Spark cache specific relative path segments for each platform -# eg. "Apache\Spark\Cache" is 3 in Windows, or "spark" is 1 in unix +# e.g. "Apache\Spark\Cache" is 3 in Windows, or "spark" is 1 in unix # Must match sparkCachePath() exactly. sparkCacheRelPathLength <- function() { if (is_windows()) { diff --git a/R/pkg/R/mllib_classification.R b/R/pkg/R/mllib_classification.R index ec83b6bd406a7..093467ecf7d28 100644 --- a/R/pkg/R/mllib_classification.R +++ b/R/pkg/R/mllib_classification.R @@ -425,7 +425,7 @@ setMethod("write.ml", signature(object = "LogisticRegressionModel", path = "char #' predictions on new data, and \code{write.ml}/\code{read.ml} to save/load fitted models. #' Only categorical data is supported. #' For more details, see -#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html}{ +#' \href{https://spark.apache.org/docs/latest/ml-classification-regression.html}{ #' Multilayer Perceptron} #' #' @param data a \code{SparkDataFrame} of observations and labels for model fitting. diff --git a/R/pkg/R/mllib_fpm.R b/R/pkg/R/mllib_fpm.R index 0cc7a16c302dc..65a43514930f0 100644 --- a/R/pkg/R/mllib_fpm.R +++ b/R/pkg/R/mllib_fpm.R @@ -122,11 +122,12 @@ setMethod("spark.freqItemsets", signature(object = "FPGrowthModel"), # Get association rules. #' @return A \code{SparkDataFrame} with association rules. -#' The \code{SparkDataFrame} contains four columns: +#' The \code{SparkDataFrame} contains five columns: #' \code{antecedent} (an array of the same type as the input column), #' \code{consequent} (an array of the same type as the input column), -#' \code{condfidence} (confidence for the rule) -#' and \code{lift} (lift for the rule) +#' \code{confidence} (confidence for the rule) +#' \code{lift} (lift for the rule) +#' and \code{support} (support for the rule) #' @rdname spark.fpGrowth #' @aliases associationRules,FPGrowthModel-method #' @note spark.associationRules(FPGrowthModel) since 2.2.0 diff --git a/R/pkg/R/mllib_recommendation.R b/R/pkg/R/mllib_recommendation.R index d238ff93ed245..87a1bc991f812 100644 --- a/R/pkg/R/mllib_recommendation.R +++ b/R/pkg/R/mllib_recommendation.R @@ -30,7 +30,7 @@ setClass("ALSModel", representation(jobj = "jobj")) #' to make predictions on new data, and \code{write.ml}/\code{read.ml} to save/load fitted models. #' #' For more details, see -#' \href{http://spark.apache.org/docs/latest/ml-collaborative-filtering.html}{MLlib: +#' \href{https://spark.apache.org/docs/latest/ml-collaborative-filtering.html}{MLlib: #' Collaborative Filtering}. #' #' @param data a SparkDataFrame for training. diff --git a/R/pkg/R/mllib_stat.R b/R/pkg/R/mllib_stat.R index 6db4d5d4831dd..f82fb589bb5a5 100644 --- a/R/pkg/R/mllib_stat.R +++ b/R/pkg/R/mllib_stat.R @@ -49,7 +49,7 @@ setClass("KSTest", representation(jobj = "jobj")) #' @rdname spark.kstest #' @aliases spark.kstest,SparkDataFrame-method #' @name spark.kstest -#' @seealso \href{http://spark.apache.org/docs/latest/mllib-statistics.html#hypothesis-testing}{ +#' @seealso \href{https://spark.apache.org/docs/latest/mllib-statistics.html#hypothesis-testing}{ #' MLlib: Hypothesis Testing} #' @examples #' \dontrun{ diff --git a/R/pkg/R/mllib_tree.R b/R/pkg/R/mllib_tree.R index f6aa48f5fa04a..f3192ee9b1382 100644 --- a/R/pkg/R/mllib_tree.R +++ b/R/pkg/R/mllib_tree.R @@ -53,7 +53,7 @@ setClass("DecisionTreeRegressionModel", representation(jobj = "jobj")) #' @note DecisionTreeClassificationModel since 2.3.0 setClass("DecisionTreeClassificationModel", representation(jobj = "jobj")) -# Create the summary of a tree ensemble model (eg. Random Forest, GBT) +# Create the summary of a tree ensemble model (e.g. Random Forest, GBT) summary.treeEnsemble <- function(model) { jobj <- model@jobj formula <- callJMethod(jobj, "formula") @@ -73,7 +73,7 @@ summary.treeEnsemble <- function(model) { jobj = jobj) } -# Prints the summary of tree ensemble models (eg. Random Forest, GBT) +# Prints the summary of tree ensemble models (e.g. Random Forest, GBT) print.summary.treeEnsemble <- function(x) { jobj <- x$jobj cat("Formula: ", x$formula) @@ -127,9 +127,9 @@ print.summary.decisionTree <- function(x) { #' \code{write.ml}/\code{read.ml} to save/load fitted models. #' For more details, see # nolint start -#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html#gradient-boosted-tree-regression}{ +#' \href{https://spark.apache.org/docs/latest/ml-classification-regression.html#gradient-boosted-tree-regression}{ #' GBT Regression} and -#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html#gradient-boosted-tree-classifier}{ +#' \href{https://spark.apache.org/docs/latest/ml-classification-regression.html#gradient-boosted-tree-classifier}{ #' GBT Classification} # nolint end #' @@ -343,9 +343,9 @@ setMethod("write.ml", signature(object = "GBTClassificationModel", path = "chara #' save/load fitted models. #' For more details, see # nolint start -#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html#random-forest-regression}{ +#' \href{https://spark.apache.org/docs/latest/ml-classification-regression.html#random-forest-regression}{ #' Random Forest Regression} and -#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html#random-forest-classifier}{ +#' \href{https://spark.apache.org/docs/latest/ml-classification-regression.html#random-forest-classifier}{ #' Random Forest Classification} # nolint end #' @@ -568,9 +568,9 @@ setMethod("write.ml", signature(object = "RandomForestClassificationModel", path #' save/load fitted models. #' For more details, see # nolint start -#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html#decision-tree-regression}{ +#' \href{https://spark.apache.org/docs/latest/ml-classification-regression.html#decision-tree-regression}{ #' Decision Tree Regression} and -#' \href{http://spark.apache.org/docs/latest/ml-classification-regression.html#decision-tree-classifier}{ +#' \href{https://spark.apache.org/docs/latest/ml-classification-regression.html#decision-tree-classifier}{ #' Decision Tree Classification} # nolint end #' diff --git a/R/pkg/R/mllib_utils.R b/R/pkg/R/mllib_utils.R index f38f1ac3a6b4c..d943d8d0ab4c0 100644 --- a/R/pkg/R/mllib_utils.R +++ b/R/pkg/R/mllib_utils.R @@ -18,7 +18,7 @@ # mllib_utils.R: Utilities for MLlib integration # Integration with R's standard functions. -# Most of MLlib's argorithms are provided in two flavours: +# Most of MLlib's algorithms are provided in two flavours: # - a specialization of the default R methods (glm). These methods try to respect # the inputs and the outputs of R's method to the largest extent, but some small differences # may exist. diff --git a/R/pkg/R/pairRDD.R b/R/pkg/R/pairRDD.R index b29381bb900fb..41676be03e951 100644 --- a/R/pkg/R/pairRDD.R +++ b/R/pkg/R/pairRDD.R @@ -239,7 +239,7 @@ setMethod("partitionByRDD", javaPairRDD <- callJMethod(javaPairRDD, "partitionBy", rPartitioner) # Call .values() on the result to get back the final result, the - # shuffled acutal content key-val pairs. + # shuffled actual content key-val pairs. r <- callJMethod(javaPairRDD, "values") RDD(r, serializedMode = "byte") @@ -411,7 +411,7 @@ setMethod("reduceByKeyLocally", #' \itemize{ #' \item createCombiner, which turns a V into a C (e.g., creates a one-element list) #' \item mergeValue, to merge a V into a C (e.g., adds it to the end of a list) - -#' \item mergeCombiners, to combine two C's into a single one (e.g., concatentates +#' \item mergeCombiners, to combine two C's into a single one (e.g., concatenates #' two lists). #' } #' diff --git a/R/pkg/R/stats.R b/R/pkg/R/stats.R index 7252351ebebb2..0aabceef226e3 100644 --- a/R/pkg/R/stats.R +++ b/R/pkg/R/stats.R @@ -109,7 +109,8 @@ setMethod("corr", #' #' Finding frequent items for columns, possibly with false positives. #' Using the frequent element count algorithm described in -#' \url{https://doi.org/10.1145/762471.762473}, proposed by Karp, Schenker, and Papadimitriou. +#' \url{https://dl.acm.org/doi/10.1145/762471.762473}, proposed by Karp, Schenker, +#' and Papadimitriou. #' #' @param x A SparkDataFrame. #' @param cols A vector column names to search frequent items in. diff --git a/R/pkg/R/streaming.R b/R/pkg/R/streaming.R index 5eccbdc9d3818..2bcfb363f9d24 100644 --- a/R/pkg/R/streaming.R +++ b/R/pkg/R/streaming.R @@ -93,7 +93,7 @@ setMethod("explain", #' lastProgress #' -#' Prints the most recent progess update of this streaming query in JSON format. +#' Prints the most recent progress update of this streaming query in JSON format. #' #' @param x a StreamingQuery. #' @rdname lastProgress diff --git a/R/pkg/R/types.R b/R/pkg/R/types.R index 5d48a9eee2799..dfa83c35665ce 100644 --- a/R/pkg/R/types.R +++ b/R/pkg/R/types.R @@ -68,7 +68,7 @@ rToSQLTypes <- as.environment(list( "character" = "string", "logical" = "boolean")) -# Helper function of coverting decimal type. When backend returns column type in the +# Helper function of converting decimal type. When backend returns column type in the # format of decimal(,) (e.g., decimal(10, 0)), this function coverts the column type # as double type. This function converts backend returned types that are not the key # of PRIMITIVE_TYPES, but should be treated as PRIMITIVE_TYPES. diff --git a/R/pkg/R/utils.R b/R/pkg/R/utils.R index 65db9c21d9dbb..264cbfc9ba929 100644 --- a/R/pkg/R/utils.R +++ b/R/pkg/R/utils.R @@ -376,6 +376,7 @@ varargsToStrEnv <- function(...) { getStorageLevel <- function(newLevel = c("DISK_ONLY", "DISK_ONLY_2", + "DISK_ONLY_3", "MEMORY_AND_DISK", "MEMORY_AND_DISK_2", "MEMORY_AND_DISK_SER", @@ -390,6 +391,7 @@ getStorageLevel <- function(newLevel = c("DISK_ONLY", storageLevel <- switch(newLevel, "DISK_ONLY" = callJStatic(storageLevelClass, "DISK_ONLY"), "DISK_ONLY_2" = callJStatic(storageLevelClass, "DISK_ONLY_2"), + "DISK_ONLY_3" = callJStatic(storageLevelClass, "DISK_ONLY_3"), "MEMORY_AND_DISK" = callJStatic(storageLevelClass, "MEMORY_AND_DISK"), "MEMORY_AND_DISK_2" = callJStatic(storageLevelClass, "MEMORY_AND_DISK_2"), "MEMORY_AND_DISK_SER" = callJStatic(storageLevelClass, @@ -415,6 +417,8 @@ storageLevelToString <- function(levelObj) { "DISK_ONLY" } else if (useDisk && !useMemory && !useOffHeap && !deserialized && replication == 2) { "DISK_ONLY_2" + } else if (useDisk && !useMemory && !useOffHeap && !deserialized && replication == 3) { + "DISK_ONLY_3" } else if (!useDisk && useMemory && !useOffHeap && deserialized && replication == 1) { "MEMORY_ONLY" } else if (!useDisk && useMemory && !useOffHeap && deserialized && replication == 2) { @@ -529,7 +533,10 @@ processClosure <- function(node, oldEnv, defVars, checkedFuncs, newEnv) { # Namespaces other than "SparkR" will not be searched. if (!isNamespace(func.env) || (getNamespaceName(func.env) == "SparkR" && - !(nodeChar %in% getNamespaceExports("SparkR")))) { + !(nodeChar %in% getNamespaceExports("SparkR")) && + # Note that generic S4 methods should not be set to the environment of + # cleaned closure. It does not work with R 4.0.0+. See also SPARK-31918. + nodeChar != "" && !methods::isGeneric(nodeChar, func.env))) { # Only include SparkR internals. # Set parameter 'inherits' to FALSE since we do not need to search in @@ -923,7 +930,7 @@ getOne <- function(x, envir, inherits = TRUE, ifnotfound = NULL) { } # Returns a vector of parent directories, traversing up count times, starting with a full path -# eg. traverseParentDirs("/Users/user/Library/Caches/spark/spark2.2", 1) should return +# e.g. traverseParentDirs("/Users/user/Library/Caches/spark/spark2.2", 1) should return # this "/Users/user/Library/Caches/spark/spark2.2" # and "/Users/user/Library/Caches/spark" traverseParentDirs <- function(x, count) { diff --git a/R/pkg/inst/profile/general.R b/R/pkg/inst/profile/general.R index 3efb460846fc2..8c75c19ca7ac3 100644 --- a/R/pkg/inst/profile/general.R +++ b/R/pkg/inst/profile/general.R @@ -16,10 +16,6 @@ # .First <- function() { - if (utils::compareVersion(paste0(R.version$major, ".", R.version$minor), "3.4.0") == -1) { - warning("Support for R prior to version 3.4 is deprecated since Spark 3.0.0") - } - packageDir <- Sys.getenv("SPARKR_PACKAGE_DIR") dirs <- strsplit(packageDir, ",")[[1]] .libPaths(c(dirs, .libPaths())) diff --git a/R/pkg/inst/profile/shell.R b/R/pkg/inst/profile/shell.R index e4e0d032997de..ffedb3038fd53 100644 --- a/R/pkg/inst/profile/shell.R +++ b/R/pkg/inst/profile/shell.R @@ -16,10 +16,6 @@ # .First <- function() { - if (utils::compareVersion(paste0(R.version$major, ".", R.version$minor), "3.4.0") == -1) { - warning("Support for R prior to version 3.4 is deprecated since Spark 3.0.0") - } - home <- Sys.getenv("SPARK_HOME") .libPaths(c(file.path(home, "R", "lib"), .libPaths())) Sys.setenv(NOAWT = 1) @@ -47,5 +43,7 @@ cat(" /_/", "\n") cat("\n") - cat("\nSparkSession available as 'spark'.\n") + cat("\nSparkSession Web UI available at", SparkR::sparkR.uiWebUrl()) + cat("\nSparkSession available as 'spark'(master = ", unlist(SparkR::sparkR.conf("spark.master")), + ", app id = ", unlist(SparkR::sparkR.conf("spark.app.id")), ").", "\n", sep = "") } diff --git a/R/pkg/inst/worker/daemon.R b/R/pkg/inst/worker/daemon.R index fb9db63b07cd0..4589bb9c6ad1b 100644 --- a/R/pkg/inst/worker/daemon.R +++ b/R/pkg/inst/worker/daemon.R @@ -32,7 +32,7 @@ inputCon <- socketConnection( SparkR:::doServerAuth(inputCon, Sys.getenv("SPARKR_WORKER_SECRET")) -# Waits indefinitely for a socket connecion by default. +# Waits indefinitely for a socket connection by default. selectTimeout <- NULL while (TRUE) { @@ -72,7 +72,7 @@ while (TRUE) { } }) } else if (is.null(children)) { - # If it is NULL, there are no children. Waits indefinitely for a socket connecion. + # If it is NULL, there are no children. Waits indefinitely for a socket connection. selectTimeout <- NULL } diff --git a/R/pkg/inst/worker/worker.R b/R/pkg/inst/worker/worker.R index 1ef05ea621e83..7fc4680bad10e 100644 --- a/R/pkg/inst/worker/worker.R +++ b/R/pkg/inst/worker/worker.R @@ -85,7 +85,7 @@ outputResult <- function(serializer, output, outputCon) { } # Constants -specialLengths <- list(END_OF_STERAM = 0L, TIMING_DATA = -1L) +specialLengths <- list(END_OF_STREAM = 0L, TIMING_DATA = -1L) # Timing R process boot bootTime <- currentTimeSecs() @@ -180,7 +180,7 @@ if (isEmpty != 0) { } else if (deserializer == "arrow" && mode == 1) { data <- SparkR:::readDeserializeInArrow(inputCon) # See https://stat.ethz.ch/pipermail/r-help/2010-September/252046.html - # rbind.fill might be an anternative to make it faster if plyr is installed. + # rbind.fill might be an alternative to make it faster if plyr is installed. # Also, note that, 'dapply' applies a function to each partition. data <- do.call("rbind", data) } @@ -196,7 +196,7 @@ if (isEmpty != 0) { outputs <- list() for (i in seq_len(length(data))) { # Timing reading input data for execution - inputElap <- elapsedSecs() + computeStart <- elapsedSecs() output <- compute(mode, partition, serializer, deserializer, keys[[i]], colNames, computeFunc, data[[i]]) computeElap <- elapsedSecs() @@ -204,17 +204,18 @@ if (isEmpty != 0) { outputs[[length(outputs) + 1L]] <- output } else { outputResult(serializer, output, outputCon) + outputComputeElapsDiff <- outputComputeElapsDiff + (elapsedSecs() - computeElap) } - outputElap <- elapsedSecs() - computeInputElapsDiff <- computeInputElapsDiff + (computeElap - inputElap) - outputComputeElapsDiff <- outputComputeElapsDiff + (outputElap - computeElap) + computeInputElapsDiff <- computeInputElapsDiff + (computeElap - computeStart) } if (serializer == "arrow") { # See https://stat.ethz.ch/pipermail/r-help/2010-September/252046.html - # rbind.fill might be an anternative to make it faster if plyr is installed. + # rbind.fill might be an alternative to make it faster if plyr is installed. + outputStart <- elapsedSecs() combined <- do.call("rbind", outputs) SparkR:::writeSerializeInArrow(outputCon, combined) + outputComputeElapsDiff <- elapsedSecs() - outputStart } } } else { @@ -285,7 +286,7 @@ SparkR:::writeDouble(outputCon, computeInputElapsDiff) # compute SparkR:::writeDouble(outputCon, outputComputeElapsDiff) # output # End of output -SparkR:::writeInt(outputCon, specialLengths$END_OF_STERAM) +SparkR:::writeInt(outputCon, specialLengths$END_OF_STREAM) close(outputCon) close(inputCon) diff --git a/R/pkg/tests/fulltests/test_Serde.R b/R/pkg/tests/fulltests/test_Serde.R index e01f6ee005218..a52289e43ca5e 100644 --- a/R/pkg/tests/fulltests/test_Serde.R +++ b/R/pkg/tests/fulltests/test_Serde.R @@ -125,7 +125,7 @@ test_that("SerDe of list of lists", { sparkR.session.stop() -# Note that this test should be at the end of tests since the configruations used here are not +# Note that this test should be at the end of tests since the configurations used here are not # specific to sessions, and the Spark context is restarted. test_that("createDataFrame large objects", { for (encryptionEnabled in list("true", "false")) { diff --git a/R/pkg/tests/fulltests/test_context.R b/R/pkg/tests/fulltests/test_context.R index 6be04b321e985..1add5a9fdde44 100644 --- a/R/pkg/tests/fulltests/test_context.R +++ b/R/pkg/tests/fulltests/test_context.R @@ -26,7 +26,9 @@ test_that("Check masked functions", { "colnames", "colnames<-", "intersect", "rank", "rbind", "sample", "subset", "summary", "transform", "drop", "window", "as.data.frame", "union", "not") version <- packageVersion("base") - if (as.numeric(version$major) >= 3 && as.numeric(version$minor) >= 3) { + is33Above <- as.numeric(version$major) >= 3 && as.numeric(version$minor) >= 3 + is40Above <- as.numeric(version$major) >= 4 + if (is33Above || is40Above) { namesOfMasked <- c("endsWith", "startsWith", namesOfMasked) } masked <- conflicts(detail = TRUE)$`package:SparkR` @@ -137,7 +139,7 @@ test_that("utility function can be called", { expect_true(TRUE) }) -test_that("getClientModeSparkSubmitOpts() returns spark-submit args from whitelist", { +test_that("getClientModeSparkSubmitOpts() returns spark-submit args from allowList", { e <- new.env() e[["spark.driver.memory"]] <- "512m" ops <- getClientModeSparkSubmitOpts("sparkrmain", e) diff --git a/R/pkg/tests/fulltests/test_jvm_api.R b/R/pkg/tests/fulltests/test_jvm_api.R index 8b3b4f73de170..3bf6ae556c079 100644 --- a/R/pkg/tests/fulltests/test_jvm_api.R +++ b/R/pkg/tests/fulltests/test_jvm_api.R @@ -20,11 +20,11 @@ context("JVM API") sparkSession <- sparkR.session(master = sparkRTestMaster, enableHiveSupport = FALSE) test_that("Create and call methods on object", { - jarr <- sparkR.newJObject("java.util.ArrayList") + jarray <- sparkR.newJObject("java.util.ArrayList") # Add an element to the array - sparkR.callJMethod(jarr, "add", 1L) + sparkR.callJMethod(jarray, "add", 1L) # Check if get returns the same element - expect_equal(sparkR.callJMethod(jarr, "get", 0L), 1L) + expect_equal(sparkR.callJMethod(jarray, "get", 0L), 1L) }) test_that("Call static methods", { diff --git a/R/pkg/tests/fulltests/test_mllib_classification.R b/R/pkg/tests/fulltests/test_mllib_classification.R index 9dd275a173089..20339c947d7bf 100644 --- a/R/pkg/tests/fulltests/test_mllib_classification.R +++ b/R/pkg/tests/fulltests/test_mllib_classification.R @@ -34,18 +34,18 @@ test_that("spark.svmLinear", { summary <- summary(model) # test summary coefficients return matrix type - expect_true(class(summary$coefficients) == "matrix") + expect_true(any(class(summary$coefficients) == "matrix")) expect_true(class(summary$coefficients[, 1]) == "numeric") coefs <- summary$coefficients[, "Estimate"] - expected_coefs <- c(-0.06004978, -0.1563083, -0.460648, 0.2276626, 1.055085) + expected_coefs <- c(-6.8823988, -0.6154984, -1.5135447, 1.9694126, 3.3736856) expect_true(all(abs(coefs - expected_coefs) < 0.1)) # Test prediction with string label prediction <- predict(model, training) expect_equal(typeof(take(select(prediction, "prediction"), 1)$prediction), "character") - expected <- c("versicolor", "versicolor", "versicolor", "virginica", "virginica", - "virginica", "virginica", "virginica", "virginica", "virginica") + expected <- c("versicolor", "versicolor", "versicolor", "versicolor", "versicolor", + "versicolor", "versicolor", "versicolor", "versicolor", "versicolor") expect_equal(sort(as.list(take(select(prediction, "prediction"), 10))[[1]]), expected) # Test model save and load @@ -130,7 +130,7 @@ test_that("spark.logit", { summary <- summary(model) # test summary coefficients return matrix type - expect_true(class(summary$coefficients) == "matrix") + expect_true(any(class(summary$coefficients) == "matrix")) expect_true(class(summary$coefficients[, 1]) == "numeric") versicolorCoefsR <- c(1.52, 0.03, -0.53, 0.04, 0.00) @@ -242,8 +242,8 @@ test_that("spark.logit", { # Test binomial logistic regression against two classes with upperBoundsOnCoefficients # and upperBoundsOnIntercepts u <- matrix(c(1.0, 0.0, 1.0, 0.0), nrow = 1, ncol = 4) - model <- spark.logit(training, Species ~ ., upperBoundsOnCoefficients = u, - upperBoundsOnIntercepts = 1.0) + model <- suppressWarnings(spark.logit(training, Species ~ ., upperBoundsOnCoefficients = u, + upperBoundsOnIntercepts = 1.0)) summary <- summary(model) coefsR <- c(-11.13331, 1.00000, 0.00000, 1.00000, 0.00000) coefs <- summary$coefficients[, "Estimate"] @@ -255,8 +255,8 @@ test_that("spark.logit", { # Test binomial logistic regression against two classes with lowerBoundsOnCoefficients # and lowerBoundsOnIntercepts l <- matrix(c(0.0, -1.0, 0.0, -1.0), nrow = 1, ncol = 4) - model <- spark.logit(training, Species ~ ., lowerBoundsOnCoefficients = l, - lowerBoundsOnIntercepts = 0.0) + model <- suppressWarnings(spark.logit(training, Species ~ ., lowerBoundsOnCoefficients = l, + lowerBoundsOnIntercepts = 0.0)) summary <- summary(model) coefsR <- c(0, 0, -1, 0, 1.902192) coefs <- summary$coefficients[, "Estimate"] @@ -268,9 +268,9 @@ test_that("spark.logit", { # Test multinomial logistic regression with lowerBoundsOnCoefficients # and lowerBoundsOnIntercepts l <- matrix(c(0.0, -1.0, 0.0, -1.0, 0.0, -1.0, 0.0, -1.0), nrow = 2, ncol = 4) - model <- spark.logit(training, Species ~ ., family = "multinomial", - lowerBoundsOnCoefficients = l, - lowerBoundsOnIntercepts = as.array(c(0.0, 0.0))) + model <- suppressWarnings(spark.logit(training, Species ~ ., family = "multinomial", + lowerBoundsOnCoefficients = l, + lowerBoundsOnIntercepts = as.array(c(0.0, 0.0)))) summary <- summary(model) versicolorCoefsR <- c(42.639465, 7.258104, 14.330814, 16.298243, 11.716429) virginicaCoefsR <- c(0.0002970796, 4.79274, 7.65047, 25.72793, 30.0021) diff --git a/R/pkg/tests/fulltests/test_mllib_clustering.R b/R/pkg/tests/fulltests/test_mllib_clustering.R index 028ad574b8134..f180aeea28150 100644 --- a/R/pkg/tests/fulltests/test_mllib_clustering.R +++ b/R/pkg/tests/fulltests/test_mllib_clustering.R @@ -171,7 +171,7 @@ test_that("spark.kmeans", { expect_equal(sort(collect(distinct(select(cluster, "prediction")))$prediction), c(0, 1)) # test summary coefficients return matrix type - expect_true(class(summary.model$coefficients) == "matrix") + expect_true(any(class(summary.model$coefficients) == "matrix")) expect_true(class(summary.model$coefficients[1, ]) == "numeric") # Test model save/load diff --git a/R/pkg/tests/fulltests/test_mllib_fpm.R b/R/pkg/tests/fulltests/test_mllib_fpm.R index bc1e17538d41a..78d26d3324473 100644 --- a/R/pkg/tests/fulltests/test_mllib_fpm.R +++ b/R/pkg/tests/fulltests/test_mllib_fpm.R @@ -45,7 +45,8 @@ test_that("spark.fpGrowth", { antecedent = I(list(list("2"), list("3"))), consequent = I(list(list("1"), list("1"))), confidence = c(1, 1), - lift = c(1, 1) + lift = c(1, 1), + support = c(0.75, 0.5) ) expect_equivalent(expected_association_rules, collect(spark.associationRules(model))) diff --git a/R/pkg/tests/fulltests/test_mllib_regression.R b/R/pkg/tests/fulltests/test_mllib_regression.R index 0f2a62b7229ca..b281cd6235ef0 100644 --- a/R/pkg/tests/fulltests/test_mllib_regression.R +++ b/R/pkg/tests/fulltests/test_mllib_regression.R @@ -116,7 +116,7 @@ test_that("spark.glm summary", { rStats <- summary(glm(Sepal.Width ~ Sepal.Length + Species, data = dataset)) # test summary coefficients return matrix type - expect_true(class(stats$coefficients) == "matrix") + expect_true(any(class(stats$coefficients) == "matrix")) expect_true(class(stats$coefficients[, 1]) == "numeric") coefs <- stats$coefficients diff --git a/R/pkg/tests/fulltests/test_sparkSQL.R b/R/pkg/tests/fulltests/test_sparkSQL.R index 611d9057c0f13..30daa2064355d 100644 --- a/R/pkg/tests/fulltests/test_sparkSQL.R +++ b/R/pkg/tests/fulltests/test_sparkSQL.R @@ -1397,7 +1397,8 @@ test_that("column operators", { test_that("column functions", { c <- column("a") c1 <- abs(c) + acos(c) + approx_count_distinct(c) + ascii(c) + asin(c) + atan(c) - c2 <- avg(c) + base64(c) + bin(c) + bitwiseNOT(c) + cbrt(c) + ceil(c) + cos(c) + c2 <- avg(c) + base64(c) + bin(c) + suppressWarnings(bitwiseNOT(c)) + + bitwise_not(c) + cbrt(c) + ceil(c) + cos(c) c3 <- cosh(c) + count(c) + crc32(c) + hash(c) + exp(c) c4 <- explode(c) + expm1(c) + factorial(c) + first(c) + floor(c) + hex(c) c5 <- hour(c) + initcap(c) + last(c) + last_day(c) + length(c) @@ -1405,7 +1406,8 @@ test_that("column functions", { c7 <- mean(c) + min(c) + month(c) + negate(c) + posexplode(c) + quarter(c) c8 <- reverse(c) + rint(c) + round(c) + rtrim(c) + sha1(c) + monotonically_increasing_id() c9 <- signum(c) + sin(c) + sinh(c) + size(c) + stddev(c) + soundex(c) + sqrt(c) + sum(c) - c10 <- sumDistinct(c) + tan(c) + tanh(c) + degrees(c) + radians(c) + c10 <- suppressWarnings(sumDistinct(c)) + sum_distinct(c) + tan(c) + tanh(c) + + degrees(c) + radians(c) c11 <- to_date(c) + trim(c) + unbase64(c) + unhex(c) + upper(c) c12 <- variance(c) + xxhash64(c) + ltrim(c, "a") + rtrim(c, "b") + trim(c, "c") c13 <- lead("col", 1) + lead(c, 1) + lag("col", 1) + lag(c, 1) @@ -1424,6 +1426,15 @@ test_that("column functions", { date_trunc("quarter", c) + current_date() + current_timestamp() c25 <- overlay(c1, c2, c3, c3) + overlay(c1, c2, c3) + overlay(c1, c2, 1) + overlay(c1, c2, 3, 4) + c26 <- timestamp_seconds(c1) + vector_to_array(c) + + vector_to_array(c, "float32") + vector_to_array(c, "float64") + + array_to_vector(c) + c27 <- nth_value("x", 1L) + nth_value("y", 2, TRUE) + + nth_value(column("v"), 3) + nth_value(column("z"), 4L, FALSE) + c28 <- asc_nulls_first(c1) + asc_nulls_last(c1) + + desc_nulls_first(c1) + desc_nulls_last(c1) + c29 <- acosh(c1) + asinh(c1) + atanh(c1) + c30 <- product(c1) + product(c1 * 0.5) # Test if base::is.nan() is exposed expect_equal(is.nan(c("a", "b")), c(FALSE, FALSE)) @@ -1449,6 +1460,8 @@ test_that("column functions", { expect_equal(collect(df3)[[2, 1]], FALSE) expect_equal(collect(df3)[[3, 1]], TRUE) + df4 <- select(df, count_distinct(df$age, df$name)) + expect_equal(collect(df4)[[1, 1]], 2) df4 <- select(df, countDistinct(df$age, df$name)) expect_equal(collect(df4)[[1, 1]], 2) @@ -1676,9 +1689,9 @@ test_that("column functions", { df <- as.DataFrame(list(list("col" = "1"))) c <- collect(select(df, schema_of_csv("Amsterdam,2018"))) - expect_equal(c[[1]], "struct<_c0:string,_c1:int>") + expect_equal(c[[1]], "STRUCT<`_c0`: STRING, `_c1`: INT>") c <- collect(select(df, schema_of_csv(lit("Amsterdam,2018")))) - expect_equal(c[[1]], "struct<_c0:string,_c1:int>") + expect_equal(c[[1]], "STRUCT<`_c0`: STRING, `_c1`: INT>") # Test to_json(), from_json(), schema_of_json() df <- sql("SELECT array(named_struct('name', 'Bob'), named_struct('name', 'Alice')) as people") @@ -1711,9 +1724,9 @@ test_that("column functions", { df <- as.DataFrame(list(list("col" = "1"))) c <- collect(select(df, schema_of_json('{"name":"Bob"}'))) - expect_equal(c[[1]], "struct") + expect_equal(c[[1]], "STRUCT<`name`: STRING>") c <- collect(select(df, schema_of_json(lit('{"name":"Bob"}')))) - expect_equal(c[[1]], "struct") + expect_equal(c[[1]], "STRUCT<`name`: STRING>") # Test to_json() supports arrays of primitive types and arrays df <- sql("SELECT array(19, 42, 70) as age") @@ -1803,6 +1816,62 @@ test_that("column functions", { ) expect_equal(actual, expected) + + # Test withField + lines <- c("{\"Person\": {\"name\":\"Bob\", \"age\":24, \"height\": 170}}") + jsonPath <- tempfile(pattern = "sparkr-test", fileext = ".tmp") + writeLines(lines, jsonPath) + df <- read.df(jsonPath, "json") + result <- collect( + select( + select(df, alias(withField(df$Person, "dummy", lit(42)), "Person")), + "Person.dummy" + ) + ) + expect_equal(result, data.frame(dummy = 42)) + + # Test dropFields + expect_setequal( + colnames(select( + withColumn(df, "Person", dropFields(df$Person, "age")), + column("Person.*") + )), + c("name", "height") + ) + + expect_equal( + colnames(select( + withColumn(df, "Person", dropFields(df$Person, "height", "name")), + column("Person.*") + )), + "age" + ) +}) + +test_that("avro column functions", { + skip_if_not( + grepl("spark-avro", sparkR.conf("spark.jars", "")), + "spark-avro jar not present" + ) + + schema <- '{"namespace": "example.avro", + "type": "record", + "name": "User", + "fields": [ + {"name": "name", "type": "string"}, + {"name": "favorite_color", "type": ["string", "null"]} + ] + }' + + c0 <- column("foo") + c1 <- from_avro(c0, schema) + expect_s4_class(c1, "Column") + c2 <- from_avro("foo", schema) + expect_s4_class(c2, "Column") + c3 <- to_avro(c1) + expect_s4_class(c3, "Column") + c4 <- to_avro(c1, schema) + expect_s4_class(c4, "Column") }) test_that("column binary mathfunctions", { @@ -1823,9 +1892,12 @@ test_that("column binary mathfunctions", { expect_equal(collect(select(df, hypot(df$a, df$b)))[3, "HYPOT(a, b)"], sqrt(3^2 + 7^2)) expect_equal(collect(select(df, hypot(df$a, df$b)))[4, "HYPOT(a, b)"], sqrt(4^2 + 8^2)) ## nolint end - expect_equal(collect(select(df, shiftLeft(df$b, 1)))[4, 1], 16) - expect_equal(collect(select(df, shiftRight(df$b, 1)))[4, 1], 4) - expect_equal(collect(select(df, shiftRightUnsigned(df$b, 1)))[4, 1], 4) + expect_equal(collect(select(df, shiftleft(df$b, 1)))[4, 1], 16) + expect_equal(collect(select(df, shiftright(df$b, 1)))[4, 1], 4) + expect_equal(collect(select(df, shiftrightunsigned(df$b, 1)))[4, 1], 4) + expect_equal(collect(select(df, suppressWarnings(shiftLeft(df$b, 1))))[4, 1], 16) + expect_equal(collect(select(df, suppressWarnings(shiftRight(df$b, 1))))[4, 1], 4) + expect_equal(collect(select(df, suppressWarnings(shiftRightUnsigned(df$b, 1))))[4, 1], 4) expect_equal(class(collect(select(df, rand()))[2, 1]), "numeric") expect_equal(collect(select(df, rand(1)))[1, 1], 0.636, tolerance = 0.01) expect_equal(class(collect(select(df, randn()))[2, 1]), "numeric") @@ -2030,7 +2102,7 @@ test_that("higher order functions", { createDataFrame(data.frame(id = 1)), expr("CAST(array(1.0, 2.0, -3.0, -4.0) AS array) xs"), expr("CAST(array(0.0, 3.0, 48.0) AS array) ys"), - expr("array('FAILED', 'SUCCEDED') as vs"), + expr("array('FAILED', 'SUCCEEDED') as vs"), expr("map('foo', 1, 'bar', 2) as mx"), expr("map('foo', 42, 'bar', -1, 'baz', 0) as my") ) @@ -2089,6 +2161,20 @@ test_that("higher order functions", { expect_error(array_transform("xs", function(...) 42)) }) +test_that("SPARK-34794: lambda vars must be resolved properly in nested higher order functions", { + df <- sql("SELECT array(1, 2, 3) as numbers, array('a', 'b', 'c') as letters") + ret <- first(select( + df, + array_transform("numbers", function(number) { + array_transform("letters", function(latter) { + struct(alias(number, "n"), alias(latter, "l")) + }) + }) + )) + + expect_equal(1, ret[[1]][[1]][[1]][[1]]$n) +}) + test_that("group by, agg functions", { df <- read.json(jsonPath) df1 <- agg(df, name = "max", age = "sum") @@ -2113,7 +2199,7 @@ test_that("group by, agg functions", { df3 <- agg(gd, age = "stddev") expect_is(df3, "SparkDataFrame") df3_local <- collect(df3) - expect_true(is.nan(df3_local[df3_local$name == "Andy", ][1, 2])) + expect_true(is.na(df3_local[df3_local$name == "Andy", ][1, 2])) df4 <- agg(gd, sumAge = sum(df$age)) expect_is(df4, "SparkDataFrame") @@ -2144,7 +2230,7 @@ test_that("group by, agg functions", { df7 <- agg(gd2, value = "stddev") df7_local <- collect(df7) expect_true(abs(df7_local[df7_local$name == "ID1", ][1, 2] - 6.928203) < 1e-6) - expect_true(is.nan(df7_local[df7_local$name == "ID2", ][1, 2])) + expect_true(is.na(df7_local[df7_local$name == "ID2", ][1, 2])) mockLines3 <- c("{\"name\":\"Andy\", \"age\":30}", "{\"name\":\"Andy\", \"age\":30}", @@ -2696,6 +2782,19 @@ test_that("union(), unionByName(), rbind(), except(), and intersect() on a DataF expect_error(rbind(df, df2, df3), "Names of input data frames are different.") + + df4 <- unionByName(df2, select(df2, "age"), TRUE) + + expect_equal( + sum(collect( + select(df4, alias(isNull(df4$name), "missing_name") + ))$missing_name), + 3 + ) + + testthat::expect_error(unionByName(df2, select(df2, "age"), FALSE)) + testthat::expect_error(unionByName(df2, select(df2, "age"))) + excepted <- arrange(except(df, df2), desc(df$age)) expect_is(unioned, "SparkDataFrame") expect_equal(count(excepted), 2) @@ -2807,6 +2906,15 @@ test_that("mutate(), transform(), rename() and names()", { expect_equal(nrow(result), 153) expect_equal(ncol(result), 2) detach(airquality) + + # ensure long inferred names are handled without error (SPARK-26199) + # test implicitly assumes eval(formals(deparse)$width.cutoff) = 60 + # (which has always been true as of 2020-11-15) + newDF <- mutate( + df, + df$age + 12345678901234567890 + 12345678901234567890 + 12345678901234 + ) + expect_match(tail(columns(newDF), 1L), "234567890", fixed = TRUE) }) test_that("read/write ORC files", { @@ -3196,6 +3304,12 @@ test_that("attach() on a DataFrame", { stat3 <- summary(df[, "age", drop = F]) expect_equal(collect(stat3)[8, "age"], "30") expect_error(age) + + # attach method uses deparse(); ensure no errors from a very long input + abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop <- df # nolint + attach(abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop) + expect_true(any(grepl("abcdefghijklmnopqrstuvwxyz", search()))) + detach("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnop") }) test_that("with() on a DataFrame", { @@ -3591,7 +3705,7 @@ test_that("gapply() and gapplyCollect() on a DataFrame", { } # Computes the arithmetic mean of the second column by grouping - # on the first and third columns. Output the groupping value and the average. + # on the first and third columns. Output the grouping value and the average. schema <- structType(structField("a", "integer"), structField("c", "string"), structField("avg", "double")) df3 <- gapply( @@ -3889,15 +4003,34 @@ test_that("catalog APIs, listTables, listColumns, listFunctions", { paste("Error in listFunctions : analysis error - Database", "'zxwtyswklpf_db' does not exist")) - # recoverPartitions does not work with tempory view + # recoverPartitions does not work with temporary view expect_error(recoverPartitions("cars"), - "no such table - Table or view 'cars' not found in database 'default'") + paste("Error in recoverPartitions : analysis error - cars is a temp view.", + "'recoverPartitions()' expects a table"), fixed = TRUE) expect_error(refreshTable("cars"), NA) expect_error(refreshByPath("/"), NA) dropTempView("cars") }) +test_that("assert_true, raise_error", { + df <- read.json(jsonPath) + filtered <- filter(df, "age < 20") + + expect_equal(collect(select(filtered, assert_true(filtered$age < 20)))$age, c(NULL)) + expect_equal(collect(select(filtered, assert_true(filtered$age < 20, "error message")))$age, + c(NULL)) + expect_equal(collect(select(filtered, assert_true(filtered$age < 20, filtered$name)))$age, + c(NULL)) + expect_error(collect(select(df, assert_true(df$age < 20))), "is not true!") + expect_error(collect(select(df, assert_true(df$age < 20, "error message"))), + "error message") + expect_error(collect(select(df, assert_true(df$age < 20, df$name))), "Michael") + + expect_error(collect(select(filtered, raise_error("error message"))), "error message") + expect_error(collect(select(filtered, raise_error(filtered$name))), "Justin") +}) + compare_list <- function(list1, list2) { # get testthat to show the diff by first making the 2 lists equal in length expect_equal(length(list1), length(list2)) @@ -3921,14 +4054,14 @@ test_that("No extra files are created in SPARK_HOME by starting session and maki # before creating a SparkSession with enableHiveSupport = T at the top of this test file # (filesBefore). The test here is to compare that (filesBefore) against the list of files before # any test is run in run-all.R (sparkRFilesBefore). - # sparkRWhitelistSQLDirs is also defined in run-all.R, and should contain only 2 whitelisted dirs, + # sparkRAllowedSQLDirs is also defined in run-all.R, and should contain only 2 allowed dirs, # here allow the first value, spark-warehouse, in the diff, everything else should be exactly the # same as before any test is run. - compare_list(sparkRFilesBefore, setdiff(filesBefore, sparkRWhitelistSQLDirs[[1]])) + compare_list(sparkRFilesBefore, setdiff(filesBefore, sparkRAllowedSQLDirs[[1]])) # third, ensure only spark-warehouse and metastore_db are created when enableHiveSupport = T # note: as the note above, after running all tests in this file while enableHiveSupport = T, we - # check the list of files again. This time we allow both whitelisted dirs to be in the diff. - compare_list(sparkRFilesBefore, setdiff(filesAfter, sparkRWhitelistSQLDirs)) + # check the list of files again. This time we allow both dirs to be in the diff. + compare_list(sparkRFilesBefore, setdiff(filesAfter, sparkRAllowedSQLDirs)) }) unlink(parquetPath) diff --git a/R/pkg/tests/fulltests/test_sparkSQL_arrow.R b/R/pkg/tests/fulltests/test_sparkSQL_arrow.R index 97972753a78fa..06743488fdf11 100644 --- a/R/pkg/tests/fulltests/test_sparkSQL_arrow.R +++ b/R/pkg/tests/fulltests/test_sparkSQL_arrow.R @@ -19,7 +19,10 @@ library(testthat) context("SparkSQL Arrow optimization") -sparkSession <- sparkR.session(master = sparkRTestMaster, enableHiveSupport = FALSE) +sparkSession <- sparkR.session( + master = sparkRTestMaster, + enableHiveSupport = FALSE, + sparkConfig = list(spark.sql.execution.arrow.sparkr.enabled = "true")) test_that("createDataFrame/collect Arrow optimization", { skip_if_not_installed("arrow") @@ -35,29 +38,13 @@ test_that("createDataFrame/collect Arrow optimization", { callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) }) - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", "true") - tryCatch({ - expect_equal(collect(createDataFrame(mtcars)), expected) - }, - finally = { - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) - }) + expect_equal(collect(createDataFrame(mtcars)), expected) }) test_that("createDataFrame/collect Arrow optimization - many partitions (partition order test)", { skip_if_not_installed("arrow") - - conf <- callJMethod(sparkSession, "conf") - arrowEnabled <- sparkR.conf("spark.sql.execution.arrow.sparkr.enabled")[[1]] - - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", "true") - tryCatch({ - expect_equal(collect(createDataFrame(mtcars, numPartitions = 32)), - collect(createDataFrame(mtcars, numPartitions = 1))) - }, - finally = { - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) - }) + expect_equal(collect(createDataFrame(mtcars, numPartitions = 32)), + collect(createDataFrame(mtcars, numPartitions = 1))) }) test_that("createDataFrame/collect Arrow optimization - type specification", { @@ -81,13 +68,7 @@ test_that("createDataFrame/collect Arrow optimization - type specification", { callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) }) - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", "true") - tryCatch({ - expect_equal(collect(createDataFrame(rdf)), expected) - }, - finally = { - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) - }) + expect_equal(collect(createDataFrame(rdf)), expected) }) test_that("dapply() Arrow optimization", { @@ -98,36 +79,30 @@ test_that("dapply() Arrow optimization", { arrowEnabled <- sparkR.conf("spark.sql.execution.arrow.sparkr.enabled")[[1]] callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", "false") - tryCatch({ - ret <- dapply(df, - function(rdf) { - stopifnot(is.data.frame(rdf)) - rdf - }, - schema(df)) - expected <- collect(ret) - }, - finally = { - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) - }) - - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", "true") tryCatch({ ret <- dapply(df, function(rdf) { stopifnot(is.data.frame(rdf)) - # mtcars' hp is more then 50. - stopifnot(all(rdf$hp > 50)) rdf }, schema(df)) - actual <- collect(ret) - expect_equal(actual, expected) - expect_equal(count(ret), nrow(mtcars)) + expected <- collect(ret) }, finally = { callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) }) + + ret <- dapply(df, + function(rdf) { + stopifnot(is.data.frame(rdf)) + # mtcars' hp is more then 50. + stopifnot(all(rdf$hp > 50)) + rdf + }, + schema(df)) + actual <- collect(ret) + expect_equal(actual, expected) + expect_equal(count(ret), nrow(mtcars)) }) test_that("dapply() Arrow optimization - type specification", { @@ -154,15 +129,9 @@ test_that("dapply() Arrow optimization - type specification", { callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) }) - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", "true") - tryCatch({ - ret <- dapply(df, function(rdf) { rdf }, schema(df)) - actual <- collect(ret) - expect_equal(actual, expected) - }, - finally = { - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) - }) + ret <- dapply(df, function(rdf) { rdf }, schema(df)) + actual <- collect(ret) + expect_equal(actual, expected) }) test_that("dapply() Arrow optimization - type specification (date and timestamp)", { @@ -170,18 +139,8 @@ test_that("dapply() Arrow optimization - type specification (date and timestamp) rdf <- data.frame(list(list(a = as.Date("1990-02-24"), b = as.POSIXct("1990-02-24 12:34:56")))) df <- createDataFrame(rdf) - - conf <- callJMethod(sparkSession, "conf") - arrowEnabled <- sparkR.conf("spark.sql.execution.arrow.sparkr.enabled")[[1]] - - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", "true") - tryCatch({ - ret <- dapply(df, function(rdf) { rdf }, schema(df)) - expect_equal(collect(ret), rdf) - }, - finally = { - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) - }) + ret <- dapply(df, function(rdf) { rdf }, schema(df)) + expect_equal(collect(ret), rdf) }) test_that("gapply() Arrow optimization", { @@ -209,28 +168,22 @@ test_that("gapply() Arrow optimization", { callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) }) - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", "true") - tryCatch({ - ret <- gapply(df, - "gear", - function(key, grouped) { - if (length(key) > 0) { - stopifnot(is.numeric(key[[1]])) - } - stopifnot(is.data.frame(grouped)) - stopifnot(length(colnames(grouped)) == 11) - # mtcars' hp is more then 50. - stopifnot(all(grouped$hp > 50)) - grouped - }, - schema(df)) - actual <- collect(ret) - expect_equal(actual, expected) - expect_equal(count(ret), nrow(mtcars)) - }, - finally = { - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) - }) + ret <- gapply(df, + "gear", + function(key, grouped) { + if (length(key) > 0) { + stopifnot(is.numeric(key[[1]])) + } + stopifnot(is.data.frame(grouped)) + stopifnot(length(colnames(grouped)) == 11) + # mtcars' hp is more then 50. + stopifnot(all(grouped$hp > 50)) + grouped + }, + schema(df)) + actual <- collect(ret) + expect_equal(actual, expected) + expect_equal(count(ret), nrow(mtcars)) }) test_that("gapply() Arrow optimization - type specification", { @@ -250,26 +203,19 @@ test_that("gapply() Arrow optimization - type specification", { callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", "false") tryCatch({ ret <- gapply(df, - "a", - function(key, grouped) { grouped }, schema(df)) + "a", + function(key, grouped) { grouped }, schema(df)) expected <- collect(ret) }, finally = { callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) }) - - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", "true") - tryCatch({ - ret <- gapply(df, - "a", - function(key, grouped) { grouped }, schema(df)) - actual <- collect(ret) - expect_equal(actual, expected) - }, - finally = { - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) - }) + ret <- gapply(df, + "a", + function(key, grouped) { grouped }, schema(df)) + actual <- collect(ret) + expect_equal(actual, expected) }) test_that("gapply() Arrow optimization - type specification (date and timestamp)", { @@ -277,39 +223,30 @@ test_that("gapply() Arrow optimization - type specification (date and timestamp) rdf <- data.frame(list(list(a = as.Date("1990-02-24"), b = as.POSIXct("1990-02-24 12:34:56")))) df <- createDataFrame(rdf) + ret <- gapply(df, + "a", + function(key, grouped) { grouped }, schema(df)) + expect_equal(collect(ret), rdf) +}) - conf <- callJMethod(sparkSession, "conf") - arrowEnabled <- sparkR.conf("spark.sql.execution.arrow.sparkr.enabled")[[1]] +test_that("Arrow optimization - unsupported types", { + skip_if_not_installed("arrow") - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", "true") - tryCatch({ - ret <- gapply(df, - "a", - function(key, grouped) { grouped }, schema(df)) - expect_equal(collect(ret), rdf) - }, - finally = { - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) - }) + expect_error(checkSchemaInArrow(structType("a FLOAT")), "not support float type") + expect_error(checkSchemaInArrow(structType("a BINARY")), "not support binary type") + expect_error(checkSchemaInArrow(structType("a ARRAY")), "not support array type") + expect_error(checkSchemaInArrow(structType("a MAP")), "not support map type") + expect_error(checkSchemaInArrow(structType("a STRUCT")), + "not support nested struct type") }) -test_that("Arrow optimization - unsupported types", { +test_that("SPARK-32478: gapply() Arrow optimization - error message for schema mismatch", { skip_if_not_installed("arrow") + df <- createDataFrame(list(list(a = 1L, b = "a"))) - conf <- callJMethod(sparkSession, "conf") - arrowEnabled <- sparkR.conf("spark.sql.execution.arrow.sparkr.enabled")[[1]] - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", "true") - tryCatch({ - expect_error(checkSchemaInArrow(structType("a FLOAT")), "not support float type") - expect_error(checkSchemaInArrow(structType("a BINARY")), "not support binary type") - expect_error(checkSchemaInArrow(structType("a ARRAY")), "not support array type") - expect_error(checkSchemaInArrow(structType("a MAP")), "not support map type") - expect_error(checkSchemaInArrow(structType("a STRUCT")), - "not support nested struct type") - }, - finally = { - callJMethod(conf, "set", "spark.sql.execution.arrow.sparkr.enabled", arrowEnabled) - }) + expect_error( + count(gapply(df, "a", function(key, group) { group }, structType("a int, b int"))), + "expected IntegerType, IntegerType, got IntegerType, StringType") }) sparkR.session.stop() diff --git a/R/pkg/tests/fulltests/test_utils.R b/R/pkg/tests/fulltests/test_utils.R index c3fb9046fcda4..6c83a137cfb7b 100644 --- a/R/pkg/tests/fulltests/test_utils.R +++ b/R/pkg/tests/fulltests/test_utils.R @@ -116,7 +116,7 @@ test_that("cleanClosure on R functions", { actual <- get("y", envir = env, inherits = FALSE) expect_equal(actual, y) - # Test for combination for nested and sequenctial functions in a closure + # Test for combination for nested and sequential functions in a closure f1 <- function(x) x + 1 f2 <- function(x) f1(x) + 2 userFunc <- function(x) { f1(x); f2(x) } diff --git a/R/pkg/tests/run-all.R b/R/pkg/tests/run-all.R index bf02ecdad66ff..f9e266eb4e014 100644 --- a/R/pkg/tests/run-all.R +++ b/R/pkg/tests/run-all.R @@ -35,8 +35,8 @@ if (identical(Sys.getenv("NOT_CRAN"), "true")) { install.spark(overwrite = TRUE) sparkRDir <- file.path(Sys.getenv("SPARK_HOME"), "R") - sparkRWhitelistSQLDirs <- c("spark-warehouse", "metastore_db") - invisible(lapply(sparkRWhitelistSQLDirs, + sparkRAllowedSQLDirs <- c("spark-warehouse", "metastore_db") + invisible(lapply(sparkRAllowedSQLDirs, function(x) { unlink(file.path(sparkRDir, x), recursive = TRUE, force = TRUE)})) sparkRFilesBefore <- list.files(path = sparkRDir, all.files = TRUE) @@ -60,22 +60,37 @@ if (identical(Sys.getenv("NOT_CRAN"), "true")) { # set random seed for predictable results. mostly for base's sample() in tree and classification set.seed(42) - # TODO (SPARK-30663) To be removed once testthat 1.x is removed from all builds - if (grepl("^1\\..*", packageVersion("testthat"))) { - # testthat 1.x - test_runner <- testthat:::run_tests - reporter <- "summary" + if (packageVersion("testthat")$major <= 1) stop("testhat 1.x is not supported") + test_runner <- if (packageVersion("testthat")$major == 2) { + # testthat >= 2.0.0, < 3.0.0 + function(path, package, reporter, filter) { + testthat:::test_package_dir( + test_path = path, + package = package, + filter = filter, + reporter = reporter + ) + } } else { - # testthat >= 2.0.0 - test_runner <- testthat:::test_package_dir - reporter <- testthat::default_reporter() + # testthat >= 3.0.0 + testthat::test_dir } - test_runner("SparkR", - file.path(sparkRDir, "pkg", "tests", "fulltests"), - NULL, - reporter) + dir.create("target/test-reports", showWarnings = FALSE) + reporter <- MultiReporter$new(list( + SummaryReporter$new(), + JunitReporter$new( + file = file.path(getwd(), "target/test-reports/test-results.xml") + ) + )) + + test_runner( + path = file.path(sparkRDir, "pkg", "tests", "fulltests"), + package = "SparkR", + reporter = reporter, + filter = NULL + ) } SparkR:::uninstallDownloadedSpark() diff --git a/R/pkg/vignettes/sparkr-vignettes.Rmd b/R/pkg/vignettes/sparkr-vignettes.Rmd index 3713e6c784855..0ed0028eb5173 100644 --- a/R/pkg/vignettes/sparkr-vignettes.Rmd +++ b/R/pkg/vignettes/sparkr-vignettes.Rmd @@ -146,7 +146,7 @@ sparkR.session.stop() Different from many other R packages, to use SparkR, you need an additional installation of Apache Spark. The Spark installation will be used to run a backend process that will compile and execute SparkR programs. -After installing the SparkR package, you can call `sparkR.session` as explained in the previous section to start and it will check for the Spark installation. If you are working with SparkR from an interactive shell (eg. R, RStudio) then Spark is downloaded and cached automatically if it is not found. Alternatively, we provide an easy-to-use function `install.spark` for running this manually. If you don't have Spark installed on the computer, you may download it from [Apache Spark Website](https://spark.apache.org/downloads.html). +After installing the SparkR package, you can call `sparkR.session` as explained in the previous section to start and it will check for the Spark installation. If you are working with SparkR from an interactive shell (e.g. R, RStudio) then Spark is downloaded and cached automatically if it is not found. Alternatively, we provide an easy-to-use function `install.spark` for running this manually. If you don't have Spark installed on the computer, you may download it from [Apache Spark Website](https://spark.apache.org/downloads.html). ```{r, eval=FALSE} install.spark() @@ -331,7 +331,7 @@ A common flow of grouping and aggregation is 2. Feed the `GroupedData` object to `agg` or `summarize` functions, with some provided aggregation functions to compute a number within each group. -A number of widely used functions are supported to aggregate data after grouping, including `avg`, `countDistinct`, `count`, `first`, `kurtosis`, `last`, `max`, `mean`, `min`, `sd`, `skewness`, `stddev_pop`, `stddev_samp`, `sumDistinct`, `sum`, `var_pop`, `var_samp`, `var`. See the [API doc for aggregate functions](https://spark.apache.org/docs/latest/api/R/column_aggregate_functions.html) linked there. +A number of widely used functions are supported to aggregate data after grouping, including `avg`, `count_distinct`, `count`, `first`, `kurtosis`, `last`, `max`, `mean`, `min`, `sd`, `skewness`, `stddev_pop`, `stddev_samp`, `sum_distinct`, `sum`, `var_pop`, `var_samp`, `var`. See the [API doc for aggregate functions](https://spark.apache.org/docs/latest/api/R/column_aggregate_functions.html) linked there. For example we can compute a histogram of the number of cylinders in the `mtcars` dataset as shown below. @@ -1007,7 +1007,7 @@ perplexity #### Alternating Least Squares -`spark.als` learns latent factors in [collaborative filtering](https://en.wikipedia.org/wiki/Recommender_system#Collaborative_filtering) via [alternating least squares](https://dl.acm.org/citation.cfm?id=1608614). +`spark.als` learns latent factors in [collaborative filtering](https://en.wikipedia.org/wiki/Recommender_system#Collaborative_filtering) via [alternating least squares](https://dl.acm.org/doi/10.1109/MC.2009.263). There are multiple options that can be configured in `spark.als`, including `rank`, `reg`, and `nonnegative`. For a complete list, refer to the help file. diff --git a/R/run-tests.sh b/R/run-tests.sh index 51ca7d600caf0..edc2b2b60b60e 100755 --- a/R/run-tests.sh +++ b/R/run-tests.sh @@ -23,7 +23,18 @@ FAILED=0 LOGFILE=$FWDIR/unit-tests.out rm -f $LOGFILE -SPARK_TESTING=1 NOT_CRAN=true $FWDIR/../bin/spark-submit --driver-java-options "-Dlog4j.configuration=file:$FWDIR/log4j.properties" --conf spark.hadoop.fs.defaultFS="file:///" --conf spark.driver.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true" --conf spark.executor.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true" $FWDIR/pkg/tests/run-all.R 2>&1 | tee -a $LOGFILE +SPARK_AVRO_JAR_PATH=$(find $FWDIR/../external/avro/ -name "spark-avro*jar" -print | egrep -v "tests.jar|test-sources.jar|sources.jar|javadoc.jar") + +if [[ $(echo $SPARK_AVRO_JAR_PATH | wc -l) -eq 1 ]]; then + SPARK_JARS=$SPARK_AVRO_JAR_PATH +fi + +if [ -z "$SPARK_JARS" ]; then + SPARK_TESTING=1 NOT_CRAN=true $FWDIR/../bin/spark-submit --driver-java-options "-Dlog4j.configuration=file:$FWDIR/log4j.properties" --conf spark.hadoop.fs.defaultFS="file:///" --conf spark.driver.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true" --conf spark.executor.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true" $FWDIR/pkg/tests/run-all.R 2>&1 | tee -a $LOGFILE +else + SPARK_TESTING=1 NOT_CRAN=true $FWDIR/../bin/spark-submit --jars $SPARK_JARS --driver-java-options "-Dlog4j.configuration=file:$FWDIR/log4j.properties" --conf spark.hadoop.fs.defaultFS="file:///" --conf spark.driver.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true" --conf spark.executor.extraJavaOptions="-Dio.netty.tryReflectionSetAccessible=true" $FWDIR/pkg/tests/run-all.R 2>&1 | tee -a $LOGFILE +fi + FAILED=$((PIPESTATUS[0]||$FAILED)) NUM_TEST_WARNING="$(grep -c -e 'Warnings ----------------' $LOGFILE)" diff --git a/README.md b/README.md index d7931263b0fc7..aa7d1dd338be0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ and Structured Streaming for stream processing. -[![Jenkins Build](https://amplab.cs.berkeley.edu/jenkins/job/spark-master-test-sbt-hadoop-2.7-hive-2.3/badge/icon)](https://amplab.cs.berkeley.edu/jenkins/job/spark-master-test-sbt-hadoop-2.7-hive-2.3) +[![Jenkins Build](https://amplab.cs.berkeley.edu/jenkins/job/spark-master-test-sbt-hadoop-3.2/badge/icon)](https://amplab.cs.berkeley.edu/jenkins/job/spark-master-test-sbt-hadoop-3.2) [![AppVeyor Build](https://img.shields.io/appveyor/ci/ApacheSoftwareFoundation/spark/master.svg?style=plastic&logo=appveyor)](https://ci.appveyor.com/project/ApacheSoftwareFoundation/spark) [![PySpark Coverage](https://img.shields.io/badge/dynamic/xml.svg?label=pyspark%20coverage&url=https%3A%2F%2Fspark-test.github.io%2Fpyspark-coverage-site&query=%2Fhtml%2Fbody%2Fdiv%5B1%5D%2Fdiv%2Fh1%2Fspan&colorB=brightgreen&style=plastic)](https://spark-test.github.io/pyspark-coverage-site) diff --git a/appveyor.yml b/appveyor.yml index a4da5f9040ded..c40b23c8341eb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -41,9 +41,9 @@ cache: install: # Install maven and dependencies - ps: .\dev\appveyor-install-dependencies.ps1 - # Required package for R unit tests - - cmd: R -e "install.packages(c('knitr', 'rmarkdown', 'testthat', 'e1071', 'survival', 'arrow'), repos='https://cloud.r-project.org/')" - - cmd: R -e "packageVersion('knitr'); packageVersion('rmarkdown'); packageVersion('testthat'); packageVersion('e1071'); packageVersion('survival'); packageVersion('arrow')" + # Required package for R unit tests. xml2 is required to use jUnit reporter in testthat. + - cmd: Rscript -e "install.packages(c('knitr', 'rmarkdown', 'testthat', 'e1071', 'survival', 'arrow', 'xml2'), repos='https://cloud.r-project.org/')" + - cmd: Rscript -e "pkg_list <- as.data.frame(installed.packages()[,c(1, 3:4)]); pkg_list[is.na(pkg_list$Priority), 1:2, drop = FALSE]" build_script: # '-Djna.nosys=true' is required to avoid kernel32.dll load failure. diff --git a/assembly/pom.xml b/assembly/pom.xml index d17abe857ade5..d662aae96c4af 100644 --- a/assembly/pom.xml +++ b/assembly/pom.xml @@ -21,7 +21,7 @@ org.apache.spark spark-parent_2.12 - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml @@ -136,6 +136,10 @@ spark-yarn_${scala.binary.version} ${project.version} + + org.apache.hadoop + hadoop-yarn-server-web-proxy + diff --git a/bin/docker-image-tool.sh b/bin/docker-image-tool.sh index 57b86254ab424..83b13b83341d0 100755 --- a/bin/docker-image-tool.sh +++ b/bin/docker-image-tool.sh @@ -172,6 +172,7 @@ function build { local BASEDOCKERFILE=${BASEDOCKERFILE:-"kubernetes/dockerfiles/spark/Dockerfile"} local PYDOCKERFILE=${PYDOCKERFILE:-false} local RDOCKERFILE=${RDOCKERFILE:-false} + local ARCHS=${ARCHS:-"--platform linux/amd64,linux/arm64"} (cd $(img_ctx_dir base) && docker build $NOCACHEARG "${BUILD_ARGS[@]}" \ -t $(image_ref spark) \ @@ -179,6 +180,11 @@ function build { if [ $? -ne 0 ]; then error "Failed to build Spark JVM Docker image, please refer to Docker build output for details." fi + if [ "${CROSS_BUILD}" != "false" ]; then + (cd $(img_ctx_dir base) && docker buildx build $ARCHS $NOCACHEARG "${BUILD_ARGS[@]}" --push \ + -t $(image_ref spark) \ + -f "$BASEDOCKERFILE" .) + fi if [ "${PYDOCKERFILE}" != "false" ]; then (cd $(img_ctx_dir pyspark) && docker build $NOCACHEARG "${BINDING_BUILD_ARGS[@]}" \ @@ -187,6 +193,11 @@ function build { if [ $? -ne 0 ]; then error "Failed to build PySpark Docker image, please refer to Docker build output for details." fi + if [ "${CROSS_BUILD}" != "false" ]; then + (cd $(img_ctx_dir pyspark) && docker buildx build $ARCHS $NOCACHEARG "${BINDING_BUILD_ARGS[@]}" --push \ + -t $(image_ref spark-py) \ + -f "$PYDOCKERFILE" .) + fi fi if [ "${RDOCKERFILE}" != "false" ]; then @@ -196,6 +207,11 @@ function build { if [ $? -ne 0 ]; then error "Failed to build SparkR Docker image, please refer to Docker build output for details." fi + if [ "${CROSS_BUILD}" != "false" ]; then + (cd $(img_ctx_dir sparkr) && docker buildx build $ARCHS $NOCACHEARG "${BINDING_BUILD_ARGS[@]}" --push \ + -t $(image_ref spark-r) \ + -f "$RDOCKERFILE" .) + fi fi } @@ -227,6 +243,8 @@ Options: -n Build docker image with --no-cache -u uid UID to use in the USER directive to set the user the main Spark process runs as inside the resulting container + -X Use docker buildx to cross build. Automatically pushes. + See https://docs.docker.com/buildx/working-with-buildx/ for steps to setup buildx. -b arg Build arg to build or push the image. For multiple build args, this option needs to be used separately for each build arg. @@ -252,6 +270,12 @@ Examples: - Build and push JDK11-based image with tag "v3.0.0" to docker.io/myrepo $0 -r docker.io/myrepo -t v3.0.0 -b java_image_tag=11-jre-slim build $0 -r docker.io/myrepo -t v3.0.0 push + + - Build and push JDK11-based image for multiple archs to docker.io/myrepo + $0 -r docker.io/myrepo -t v3.0.0 -X -b java_image_tag=11-jre-slim build + # Note: buildx, which does cross building, needs to do the push during build + # So there is no separate push step with -X + EOF } @@ -268,7 +292,8 @@ RDOCKERFILE= NOCACHEARG= BUILD_PARAMS= SPARK_UID= -while getopts f:p:R:mr:t:nb:u: option +CROSS_BUILD="false" +while getopts f:p:R:mr:t:Xnb:u: option do case "${option}" in @@ -279,6 +304,7 @@ do t) TAG=${OPTARG};; n) NOCACHEARG="--no-cache";; b) BUILD_PARAMS=${BUILD_PARAMS}" --build-arg "${OPTARG};; + X) CROSS_BUILD=1;; m) if ! which minikube 1>/dev/null; then error "Cannot find minikube." diff --git a/bin/find-spark-home b/bin/find-spark-home index 617dbaa4fff86..462b538b00a04 100755 --- a/bin/find-spark-home +++ b/bin/find-spark-home @@ -33,9 +33,9 @@ elif [ ! -f "$FIND_SPARK_HOME_PYTHON_SCRIPT" ]; then export SPARK_HOME="$(cd "$(dirname "$0")"/..; pwd)" else # We are pip installed, use the Python script to resolve a reasonable SPARK_HOME - # Default to standard python interpreter unless told otherwise + # Default to standard python3 interpreter unless told otherwise if [[ -z "$PYSPARK_DRIVER_PYTHON" ]]; then - PYSPARK_DRIVER_PYTHON="${PYSPARK_PYTHON:-"python"}" + PYSPARK_DRIVER_PYTHON="${PYSPARK_PYTHON:-"python3"}" fi export SPARK_HOME=$($PYSPARK_DRIVER_PYTHON "$FIND_SPARK_HOME_PYTHON_SCRIPT") fi diff --git a/bin/find-spark-home.cmd b/bin/find-spark-home.cmd index 6025f67c38de4..3149d05039ba4 100644 --- a/bin/find-spark-home.cmd +++ b/bin/find-spark-home.cmd @@ -20,8 +20,8 @@ rem rem Path to Python script finding SPARK_HOME set FIND_SPARK_HOME_PYTHON_SCRIPT=%~dp0find_spark_home.py -rem Default to standard python interpreter unless told otherwise -set PYTHON_RUNNER=python +rem Default to standard python3 interpreter unless told otherwise +set PYTHON_RUNNER=python3 rem If PYSPARK_DRIVER_PYTHON is set, it overwrites the python version if not "x%PYSPARK_DRIVER_PYTHON%"=="x" ( set PYTHON_RUNNER=%PYSPARK_DRIVER_PYTHON% @@ -55,6 +55,6 @@ if "x%SPARK_HOME%"=="x" ( set SPARK_HOME=%~dp0.. ) else ( rem We are pip installed, use the Python script to resolve a reasonable SPARK_HOME - for /f "delims=" %%i in ('%PYTHON_RUNNER% %FIND_SPARK_HOME_PYTHON_SCRIPT%') do set SPARK_HOME=%%i + for /f "delims=" %%i in ('%PYTHON_RUNNER% "%FIND_SPARK_HOME_PYTHON_SCRIPT%"') do set SPARK_HOME=%%i ) ) diff --git a/bin/load-spark-env.cmd b/bin/load-spark-env.cmd index 5f98cc34b6bab..5692af529fb66 100644 --- a/bin/load-spark-env.cmd +++ b/bin/load-spark-env.cmd @@ -21,42 +21,42 @@ rem This script loads spark-env.cmd if it exists, and ensures it is only loaded rem spark-env.cmd is loaded from SPARK_CONF_DIR if set, or within the current directory's rem conf\ subdirectory. -set SPARK_ENV_CMD=spark-env.cmd -if [%SPARK_ENV_LOADED%] == [] ( +if not defined SPARK_ENV_LOADED ( set SPARK_ENV_LOADED=1 - if [%SPARK_CONF_DIR%] == [] ( + if not defined SPARK_CONF_DIR ( set SPARK_CONF_DIR=%~dp0..\conf ) - set SPARK_ENV_CMD=%SPARK_CONF_DIR%\%SPARK_ENV_CMD% - if exist %SPARK_ENV_CMD% ( - call %SPARK_ENV_CMD% - ) + call :LoadSparkEnv ) rem Setting SPARK_SCALA_VERSION if not already set. -rem TODO: revisit for Scala 2.13 support -set SPARK_SCALA_VERSION=2.12 -rem if [%SPARK_SCALA_VERSION%] == [] ( -rem set SCALA_VERSION_1=2.12 -rem set SCALA_VERSION_2=2.11 -rem -rem set ASSEMBLY_DIR1=%SPARK_HOME%\assembly\target\scala-%SCALA_VERSION_1% -rem set ASSEMBLY_DIR2=%SPARK_HOME%\assembly\target\scala-%SCALA_VERSION_2% -rem set ENV_VARIABLE_DOC=https://spark.apache.org/docs/latest/configuration.html#environment-variables -rem if exist %ASSEMBLY_DIR2% if exist %ASSEMBLY_DIR1% ( -rem echo "Presence of build for multiple Scala versions detected (%ASSEMBLY_DIR1% and %ASSEMBLY_DIR2%)." -rem echo "Remove one of them or, set SPARK_SCALA_VERSION=%SCALA_VERSION_1% in %SPARK_ENV_CMD%." -rem echo "Visit %ENV_VARIABLE_DOC% for more details about setting environment variables in spark-env.cmd." -rem echo "Either clean one of them or, set SPARK_SCALA_VERSION in spark-env.cmd." -rem exit 1 -rem ) -rem if exist %ASSEMBLY_DIR1% ( -rem set SPARK_SCALA_VERSION=%SCALA_VERSION_1% -rem ) else ( -rem set SPARK_SCALA_VERSION=%SCALA_VERSION_2% -rem ) -rem ) +set SCALA_VERSION_1=2.13 +set SCALA_VERSION_2=2.12 + +set ASSEMBLY_DIR1="%SPARK_HOME%\assembly\target\scala-%SCALA_VERSION_1%" +set ASSEMBLY_DIR2="%SPARK_HOME%\assembly\target\scala-%SCALA_VERSION_2%" +set ENV_VARIABLE_DOC=https://spark.apache.org/docs/latest/configuration.html#environment-variables + +if not defined SPARK_SCALA_VERSION ( + if exist %ASSEMBLY_DIR2% if exist %ASSEMBLY_DIR1% ( + echo Presence of build for multiple Scala versions detected ^(%ASSEMBLY_DIR1% and %ASSEMBLY_DIR2%^). + echo Remove one of them or, set SPARK_SCALA_VERSION=%SCALA_VERSION_1% in spark-env.cmd. + echo Visit %ENV_VARIABLE_DOC% for more details about setting environment variables in spark-env.cmd. + echo Either clean one of them or, set SPARK_SCALA_VERSION in spark-env.cmd. + exit 1 + ) + if exist %ASSEMBLY_DIR1% ( + set SPARK_SCALA_VERSION=%SCALA_VERSION_1% + ) else ( + set SPARK_SCALA_VERSION=%SCALA_VERSION_2% + ) +) exit /b 0 + +:LoadSparkEnv +if exist "%SPARK_CONF_DIR%\spark-env.cmd" ( + call "%SPARK_CONF_DIR%\spark-env.cmd" +) diff --git a/bin/load-spark-env.sh b/bin/load-spark-env.sh index 107e7991c28bc..04adaeed7ac61 100644 --- a/bin/load-spark-env.sh +++ b/bin/load-spark-env.sh @@ -43,25 +43,23 @@ fi # Setting SPARK_SCALA_VERSION if not already set. -# TODO: revisit for Scala 2.13 support -export SPARK_SCALA_VERSION=2.12 -#if [ -z "$SPARK_SCALA_VERSION" ]; then -# SCALA_VERSION_1=2.12 -# SCALA_VERSION_2=2.11 -# -# ASSEMBLY_DIR_1="${SPARK_HOME}/assembly/target/scala-${SCALA_VERSION_1}" -# ASSEMBLY_DIR_2="${SPARK_HOME}/assembly/target/scala-${SCALA_VERSION_2}" -# ENV_VARIABLE_DOC="https://spark.apache.org/docs/latest/configuration.html#environment-variables" -# if [[ -d "$ASSEMBLY_DIR_1" && -d "$ASSEMBLY_DIR_2" ]]; then -# echo "Presence of build for multiple Scala versions detected ($ASSEMBLY_DIR_1 and $ASSEMBLY_DIR_2)." 1>&2 -# echo "Remove one of them or, export SPARK_SCALA_VERSION=$SCALA_VERSION_1 in ${SPARK_ENV_SH}." 1>&2 -# echo "Visit ${ENV_VARIABLE_DOC} for more details about setting environment variables in spark-env.sh." 1>&2 -# exit 1 -# fi -# -# if [[ -d "$ASSEMBLY_DIR_1" ]]; then -# export SPARK_SCALA_VERSION=${SCALA_VERSION_1} -# else -# export SPARK_SCALA_VERSION=${SCALA_VERSION_2} -# fi -#fi +if [ -z "$SPARK_SCALA_VERSION" ]; then + SCALA_VERSION_1=2.13 + SCALA_VERSION_2=2.12 + + ASSEMBLY_DIR_1="${SPARK_HOME}/assembly/target/scala-${SCALA_VERSION_1}" + ASSEMBLY_DIR_2="${SPARK_HOME}/assembly/target/scala-${SCALA_VERSION_2}" + ENV_VARIABLE_DOC="https://spark.apache.org/docs/latest/configuration.html#environment-variables" + if [[ -d "$ASSEMBLY_DIR_1" && -d "$ASSEMBLY_DIR_2" ]]; then + echo "Presence of build for multiple Scala versions detected ($ASSEMBLY_DIR_1 and $ASSEMBLY_DIR_2)." 1>&2 + echo "Remove one of them or, export SPARK_SCALA_VERSION=$SCALA_VERSION_1 in ${SPARK_ENV_SH}." 1>&2 + echo "Visit ${ENV_VARIABLE_DOC} for more details about setting environment variables in spark-env.sh." 1>&2 + exit 1 + fi + + if [[ -d "$ASSEMBLY_DIR_1" ]]; then + export SPARK_SCALA_VERSION=${SCALA_VERSION_1} + else + export SPARK_SCALA_VERSION=${SCALA_VERSION_2} + fi +fi diff --git a/bin/pyspark b/bin/pyspark index ad4132fb59eb0..38ebe51c8d555 100755 --- a/bin/pyspark +++ b/bin/pyspark @@ -37,9 +37,9 @@ if [[ -n "$IPYTHON" || -n "$IPYTHON_OPTS" ]]; then exit 1 fi -# Default to standard python interpreter unless told otherwise +# Default to standard python3 interpreter unless told otherwise if [[ -z "$PYSPARK_PYTHON" ]]; then - PYSPARK_PYTHON=python + PYSPARK_PYTHON=python3 fi if [[ -z "$PYSPARK_DRIVER_PYTHON" ]]; then PYSPARK_DRIVER_PYTHON=$PYSPARK_PYTHON @@ -50,7 +50,7 @@ export PYSPARK_DRIVER_PYTHON_OPTS # Add the PySpark classes to the Python path: export PYTHONPATH="${SPARK_HOME}/python/:$PYTHONPATH" -export PYTHONPATH="${SPARK_HOME}/python/lib/py4j-0.10.9-src.zip:$PYTHONPATH" +export PYTHONPATH="${SPARK_HOME}/python/lib/py4j-0.10.9.2-src.zip:$PYTHONPATH" # Load the PySpark shell.py script when ./pyspark is used interactively: export OLD_PYTHONSTARTUP="$PYTHONSTARTUP" diff --git a/bin/pyspark2.cmd b/bin/pyspark2.cmd index dc34be1a41706..f5f9fad8dfb1b 100644 --- a/bin/pyspark2.cmd +++ b/bin/pyspark2.cmd @@ -30,7 +30,7 @@ if "x%PYSPARK_DRIVER_PYTHON%"=="x" ( ) set PYTHONPATH=%SPARK_HOME%\python;%PYTHONPATH% -set PYTHONPATH=%SPARK_HOME%\python\lib\py4j-0.10.9-src.zip;%PYTHONPATH% +set PYTHONPATH=%SPARK_HOME%\python\lib\py4j-0.10.9.2-src.zip;%PYTHONPATH% set OLD_PYTHONSTARTUP=%PYTHONSTARTUP% set PYTHONSTARTUP=%SPARK_HOME%\python\pyspark\shell.py diff --git a/bin/spark-class2.cmd b/bin/spark-class2.cmd old mode 100644 new mode 100755 index 34d04c9856d2c..68b271d1d05d9 --- a/bin/spark-class2.cmd +++ b/bin/spark-class2.cmd @@ -30,12 +30,12 @@ if "x%1"=="x" ( rem Find Spark jars. if exist "%SPARK_HOME%\jars" ( - set SPARK_JARS_DIR="%SPARK_HOME%\jars" + set SPARK_JARS_DIR=%SPARK_HOME%\jars ) else ( - set SPARK_JARS_DIR="%SPARK_HOME%\assembly\target\scala-%SPARK_SCALA_VERSION%\jars" + set SPARK_JARS_DIR=%SPARK_HOME%\assembly\target\scala-%SPARK_SCALA_VERSION%\jars ) -if not exist "%SPARK_JARS_DIR%"\ ( +if not exist "%SPARK_JARS_DIR%" ( echo Failed to find Spark jars directory. echo You need to build Spark before running this program. exit /b 1 diff --git a/binder/apt.txt b/binder/apt.txt new file mode 100644 index 0000000000000..385f5b0fba754 --- /dev/null +++ b/binder/apt.txt @@ -0,0 +1 @@ +openjdk-8-jre diff --git a/binder/postBuild b/binder/postBuild new file mode 100644 index 0000000000000..42bb3514c5a2e --- /dev/null +++ b/binder/postBuild @@ -0,0 +1,24 @@ +#!/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. +# + +# This file is used for Binder integration to install PySpark available in +# Jupyter notebook. + +VERSION=$(python -c "exec(open('python/pyspark/version.py').read()); print(__version__)") +pip install "pyspark[sql,ml,mllib]<=$VERSION" diff --git a/build/mvn b/build/mvn index 53a77f6e81f2b..9e63cc2ff9ca9 100755 --- a/build/mvn +++ b/build/mvn @@ -26,36 +26,67 @@ _COMPILE_JVM_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g" # Installs any application tarball given a URL, the expected tarball name, # and, optionally, a checkable binary path to determine if the binary has -# already been installed -## Arg1 - URL -## Arg2 - Tarball Name -## Arg3 - Checkable Binary +# already been installed. Arguments: +# 1 - Mirror host +# 2 - URL path on host +# 3 - URL query string +# 4 - checksum suffix +# 5 - Tarball Name +# 6 - Checkable Binary install_app() { - local remote_tarball="$1/$2" - local local_tarball="${_DIR}/$2" - local binary="${_DIR}/$3" + local mirror_host="$1" + local url_path="$2" + local url_query="$3" + local checksum_suffix="$4" + local local_tarball="${_DIR}/$5" + local binary="${_DIR}/$6" + local remote_tarball="${mirror_host}/${url_path}${url_query}" + local local_checksum="${local_tarball}.${checksum_suffix}" + local remote_checksum="https://archive.apache.org/dist/${url_path}.${checksum_suffix}" local curl_opts="--silent --show-error -L" local wget_opts="--no-verbose" - if [ -z "$3" -o ! -f "$binary" ]; then + if [ ! -f "$binary" ]; then # check if we already have the tarball # check if we have curl installed # download application - [ ! -f "${local_tarball}" ] && [ $(command -v curl) ] && \ - echo "exec: curl ${curl_opts} ${remote_tarball}" 1>&2 && \ + if [ ! -f "${local_tarball}" -a $(command -v curl) ]; then + echo "exec: curl ${curl_opts} ${remote_tarball}" 1>&2 curl ${curl_opts} "${remote_tarball}" > "${local_tarball}" + if [ ! -z "${checksum_suffix}" ]; then + echo "exec: curl ${curl_opts} ${remote_checksum}" 1>&2 + curl ${curl_opts} "${remote_checksum}" > "${local_checksum}" + fi + fi # if the file still doesn't exist, lets try `wget` and cross our fingers - [ ! -f "${local_tarball}" ] && [ $(command -v wget) ] && \ - echo "exec: wget ${wget_opts} ${remote_tarball}" 1>&2 && \ + if [ ! -f "${local_tarball}" -a $(command -v wget) ]; then + echo "exec: wget ${wget_opts} ${remote_tarball}" 1>&2 wget ${wget_opts} -O "${local_tarball}" "${remote_tarball}" + if [ ! -z "${checksum_suffix}" ]; then + echo "exec: wget ${wget_opts} ${remote_checksum}" 1>&2 + wget ${wget_opts} -O "${local_checksum}" "${remote_checksum}" + fi + fi # if both were unsuccessful, exit - [ ! -f "${local_tarball}" ] && \ - echo -n "ERROR: Cannot download $2 with cURL or wget; " && \ - echo "please install manually and try again." && \ + if [ ! -f "${local_tarball}" ]; then + echo -n "ERROR: Cannot download ${remote_tarball} with cURL or wget; please install manually and try again." exit 2 - cd "${_DIR}" && tar -xzf "$2" - rm -rf "$local_tarball" + fi + # Checksum may not have been specified; don't check if doesn't exist + if [ -f "${local_checksum}" ]; then + echo " ${local_tarball}" >> ${local_checksum} # two spaces + file are important! + # Assuming SHA512 here for now + echo "Veryfing checksum from ${local_checksum}" 1>&2 + if ! shasum -a 512 -q -c "${local_checksum}" ; then + echo "Bad checksum from ${remote_checksum}" + exit 2 + fi + fi + + cd "${_DIR}" && tar -xzf "${local_tarball}" + rm -rf "${local_tarball}" + rm -f "${local_checksum}" fi } @@ -71,47 +102,32 @@ install_mvn() { local MVN_DETECTED_VERSION="$(mvn --version | head -n1 | awk '{print $3}')" fi if [ $(version $MVN_DETECTED_VERSION) -lt $(version $MVN_VERSION) ]; then - local APACHE_MIRROR=${APACHE_MIRROR:-'https://www.apache.org/dyn/closer.lua?action=download&filename='} - + local MVN_TARBALL="apache-maven-${MVN_VERSION}-bin.tar.gz" + local FILE_PATH="maven/maven-3/${MVN_VERSION}/binaries/${MVN_TARBALL}" + local APACHE_MIRROR=${APACHE_MIRROR:-'https://www.apache.org/dyn/closer.lua'} + local MIRROR_URL_QUERY="?action=download" + if [ $(command -v curl) ]; then - local TEST_MIRROR_URL="${APACHE_MIRROR}/maven/maven-3/${MVN_VERSION}/binaries/apache-maven-${MVN_VERSION}-bin.tar.gz" - if ! curl -L --output /dev/null --silent --head --fail "$TEST_MIRROR_URL" ; then + if ! curl -L --output /dev/null --silent --head --fail "${APACHE_MIRROR}/${FILE_PATH}${MIRROR_URL_QUERY}" ; then # Fall back to archive.apache.org for older Maven echo "Falling back to archive.apache.org to download Maven" APACHE_MIRROR="https://archive.apache.org/dist" + MIRROR_URL_QUERY="" fi fi install_app \ - "${APACHE_MIRROR}/maven/maven-3/${MVN_VERSION}/binaries" \ - "apache-maven-${MVN_VERSION}-bin.tar.gz" \ + "${APACHE_MIRROR}" \ + "${FILE_PATH}" \ + "${MIRROR_URL_QUERY}" \ + "sha512" \ + "${MVN_TARBALL}" \ "apache-maven-${MVN_VERSION}/bin/mvn" MVN_BIN="${_DIR}/apache-maven-${MVN_VERSION}/bin/mvn" fi } -# Install zinc under the build/ folder -install_zinc() { - local ZINC_VERSION=0.3.15 - ZINC_BIN="$(command -v zinc)" - if [ "$ZINC_BIN" ]; then - local ZINC_DETECTED_VERSION="$(zinc -version | head -n1 | awk '{print $5}')" - fi - - if [ $(version $ZINC_DETECTED_VERSION) -lt $(version $ZINC_VERSION) ]; then - local zinc_path="zinc-${ZINC_VERSION}/bin/zinc" - [ ! -f "${_DIR}/${zinc_path}" ] && ZINC_INSTALL_FLAG=1 - local TYPESAFE_MIRROR=${TYPESAFE_MIRROR:-https://downloads.lightbend.com} - - install_app \ - "${TYPESAFE_MIRROR}/zinc/${ZINC_VERSION}" \ - "zinc-${ZINC_VERSION}.tgz" \ - "${zinc_path}" - ZINC_BIN="${_DIR}/${zinc_path}" - fi -} - # Determine the Scala version from the root pom.xml file, set the Scala URL, # and, with that, download the specific version of Scala necessary under # the build/ folder @@ -121,39 +137,26 @@ install_scala() { local scala_version=`grep "scala.version" "${_DIR}/../pom.xml" | grep ${scala_binary_version} | head -n1 | awk -F '[<>]' '{print $3}'` local scala_bin="${_DIR}/scala-${scala_version}/bin/scala" local TYPESAFE_MIRROR=${TYPESAFE_MIRROR:-https://downloads.lightbend.com} + local SCALA_TARBALL="scala-${scala_version}.tgz" install_app \ - "${TYPESAFE_MIRROR}/scala/${scala_version}" \ - "scala-${scala_version}.tgz" \ + "${TYPESAFE_MIRROR}" \ + "scala/${scala_version}/${SCALA_TARBALL}" \ + "" \ + "" \ + ${SCALA_TARBALL} \ "scala-${scala_version}/bin/scala" SCALA_COMPILER="$(cd "$(dirname "${scala_bin}")/../lib" && pwd)/scala-compiler.jar" SCALA_LIBRARY="$(cd "$(dirname "${scala_bin}")/../lib" && pwd)/scala-library.jar" } -# Setup healthy defaults for the Zinc port if none were provided from -# the environment -ZINC_PORT=${ZINC_PORT:-"3030"} - -# Install the proper version of Scala, Zinc and Maven for the build -install_zinc install_scala install_mvn # Reset the current working directory cd "${_CALLING_DIR}" -# Now that zinc is ensured to be installed, check its status and, if its -# not running or just installed, start it -if [ -n "${ZINC_INSTALL_FLAG}" -o -z "`"${ZINC_BIN}" -status -port ${ZINC_PORT}`" ]; then - export ZINC_OPTS=${ZINC_OPTS:-"$_COMPILE_JVM_OPTS"} - "${ZINC_BIN}" -shutdown -port ${ZINC_PORT} - "${ZINC_BIN}" -start -port ${ZINC_PORT} \ - -server 127.0.0.1 -idle-timeout 3h \ - -scala-compiler "${SCALA_COMPILER}" \ - -scala-library "${SCALA_LIBRARY}" &>/dev/null -fi - # Set any `mvn` options if not already present export MAVEN_OPTS=${MAVEN_OPTS:-"$_COMPILE_JVM_OPTS"} @@ -161,10 +164,7 @@ echo "Using \`mvn\` from path: $MVN_BIN" 1>&2 # call the `mvn` command as usual # SPARK-25854 -"${MVN_BIN}" -DzincPort=${ZINC_PORT} "$@" +"${MVN_BIN}" "$@" MVN_RETCODE=$? -# Try to shut down zinc explicitly if the server is still running. -"${ZINC_BIN}" -shutdown -port ${ZINC_PORT} - exit $MVN_RETCODE diff --git a/build/sbt b/build/sbt index 475dfd3b20b43..ae9ca93fc9ca9 100755 --- a/build/sbt +++ b/build/sbt @@ -53,6 +53,7 @@ realpath () { declare -r noshare_opts="-Dsbt.global.base=project/.sbtboot -Dsbt.boot.directory=project/.boot -Dsbt.ivy.home=project/.ivy" declare -r sbt_opts_file=".sbtopts" declare -r etc_sbt_opts_file="/etc/sbt/sbtopts" +declare -r default_sbt_opts="-Xss4m" usage() { cat < org.apache.spark spark-parent_2.12 - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../../pom.xml diff --git a/common/kvstore/src/main/java/org/apache/spark/util/kvstore/InMemoryStore.java b/common/kvstore/src/main/java/org/apache/spark/util/kvstore/InMemoryStore.java index 42e090bc83ed1..431c7e42774e4 100644 --- a/common/kvstore/src/main/java/org/apache/spark/util/kvstore/InMemoryStore.java +++ b/common/kvstore/src/main/java/org/apache/spark/util/kvstore/InMemoryStore.java @@ -164,8 +164,9 @@ public void clear() { } /** - * An alias class for the type "ConcurrentHashMap, Boolean>", which is used - * as a concurrent hashset for storing natural keys and the boolean value doesn't matter. + * An alias class for the type "{@literal ConcurrentHashMap, Boolean>}", + * which is used as a concurrent hashset for storing natural keys + * and the boolean value doesn't matter. */ private static class NaturalKeys extends ConcurrentHashMap, Boolean> {} diff --git a/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDB.java b/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDB.java index 2ca4b0b2cb9f9..121dfbd4f6838 100644 --- a/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDB.java +++ b/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDB.java @@ -19,10 +19,13 @@ import java.io.File; import java.io.IOException; +import java.lang.ref.SoftReference; import java.util.*; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; import static java.nio.charset.StandardCharsets.UTF_8; import com.google.common.annotations.VisibleForTesting; @@ -64,6 +67,13 @@ public class LevelDB implements KVStore { private final ConcurrentMap typeAliases; private final ConcurrentMap, LevelDBTypeInfo> types; + /** + * Trying to close a JNI LevelDB handle with a closed DB causes JVM crashes. This is used to + * ensure that all iterators are correctly closed before LevelDB is closed. Use soft reference + * to ensure that the iterator can be GCed, when it is only referenced here. + */ + private final ConcurrentLinkedQueue>> iteratorTracker; + public LevelDB(File path) throws Exception { this(path, new KVStoreSerializer()); } @@ -94,6 +104,8 @@ public LevelDB(File path, KVStoreSerializer serializer) throws Exception { aliases = new HashMap<>(); } typeAliases = new ConcurrentHashMap<>(aliases); + + iteratorTracker = new ConcurrentLinkedQueue<>(); } @Override @@ -142,24 +154,72 @@ public void write(Object value) throws Exception { try (WriteBatch batch = db().createWriteBatch()) { byte[] data = serializer.serialize(value); synchronized (ti) { - Object existing; - try { - existing = get(ti.naturalIndex().entityKey(null, value), value.getClass()); - } catch (NoSuchElementException e) { - existing = null; - } + updateBatch(batch, value, data, value.getClass(), ti.naturalIndex(), ti.indices()); + db().write(batch); + } + } + } + + public void writeAll(List values) throws Exception { + Preconditions.checkArgument(values != null && !values.isEmpty(), + "Non-empty values required."); + + // Group by class, in case there are values from different classes in the values + // Typical usecase is for this to be a single class. + // A NullPointerException will be thrown if values contain null object. + for (Map.Entry, ? extends List> entry : + values.stream().collect(Collectors.groupingBy(Object::getClass)).entrySet()) { + + final Iterator valueIter = entry.getValue().iterator(); + final Iterator serializedValueIter; + + // Deserialize outside synchronized block + List list = new ArrayList<>(entry.getValue().size()); + for (Object value : values) { + list.add(serializer.serialize(value)); + } + serializedValueIter = list.iterator(); + + final Class klass = entry.getKey(); + final LevelDBTypeInfo ti = getTypeInfo(klass); + + synchronized (ti) { + final LevelDBTypeInfo.Index naturalIndex = ti.naturalIndex(); + final Collection indices = ti.indices(); - PrefixCache cache = new PrefixCache(value); - byte[] naturalKey = ti.naturalIndex().toKey(ti.naturalIndex().getValue(value)); - for (LevelDBTypeInfo.Index idx : ti.indices()) { - byte[] prefix = cache.getPrefix(idx); - idx.add(batch, value, existing, data, naturalKey, prefix); + try (WriteBatch batch = db().createWriteBatch()) { + while (valueIter.hasNext()) { + updateBatch(batch, valueIter.next(), serializedValueIter.next(), klass, + naturalIndex, indices); + } + db().write(batch); } - db().write(batch); } } } + private void updateBatch( + WriteBatch batch, + Object value, + byte[] data, + Class klass, + LevelDBTypeInfo.Index naturalIndex, + Collection indices) throws Exception { + Object existing; + try { + existing = get(naturalIndex.entityKey(null, value), klass); + } catch (NoSuchElementException e) { + existing = null; + } + + PrefixCache cache = new PrefixCache(value); + byte[] naturalKey = naturalIndex.toKey(naturalIndex.getValue(value)); + for (LevelDBTypeInfo.Index idx : indices) { + byte[] prefix = cache.getPrefix(idx); + idx.add(batch, value, existing, data, naturalKey, prefix); + } + } + @Override public void delete(Class type, Object naturalKey) throws Exception { Preconditions.checkArgument(naturalKey != null, "Null keys are not allowed."); @@ -189,7 +249,9 @@ public KVStoreView view(Class type) throws Exception { @Override public Iterator iterator() { try { - return new LevelDBIterator<>(type, LevelDB.this, this); + LevelDBIterator it = new LevelDBIterator<>(type, LevelDB.this, this); + iteratorTracker.add(new SoftReference<>(it)); + return it; } catch (Exception e) { throw Throwables.propagate(e); } @@ -238,6 +300,14 @@ public void close() throws IOException { } try { + if (iteratorTracker != null) { + for (SoftReference> ref: iteratorTracker) { + LevelDBIterator it = ref.get(); + if (it != null) { + it.close(); + } + } + } _db.close(); } catch (IOException ioe) { throw ioe; @@ -252,6 +322,7 @@ public void close() throws IOException { * with a closed DB can cause JVM crashes, so this ensures that situation does not happen. */ void closeIterator(LevelDBIterator it) throws IOException { + notifyIteratorClosed(it); synchronized (this._db) { DB _db = this._db.get(); if (_db != null) { @@ -260,6 +331,14 @@ void closeIterator(LevelDBIterator it) throws IOException { } } + /** + * Remove iterator from iterator tracker. `LevelDBIterator` calls it to notify + * iterator is closed. + */ + void notifyIteratorClosed(LevelDBIterator it) { + iteratorTracker.removeIf(ref -> it.equals(ref.get())); + } + /** Returns metadata about indices for the given type. */ LevelDBTypeInfo getTypeInfo(Class type) throws Exception { LevelDBTypeInfo ti = types.get(type); diff --git a/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBIterator.java b/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBIterator.java index 94e8c9fc5796c..e8fb4fac5ba17 100644 --- a/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBIterator.java +++ b/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBIterator.java @@ -185,6 +185,7 @@ public boolean skip(long n) { @Override public synchronized void close() throws IOException { + db.notifyIteratorClosed(this); if (!closed) { it.close(); closed = true; diff --git a/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBTypeInfo.java b/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBTypeInfo.java index d7423537ddfcf..4d7f76f673865 100644 --- a/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBTypeInfo.java +++ b/common/kvstore/src/main/java/org/apache/spark/util/kvstore/LevelDBTypeInfo.java @@ -133,7 +133,7 @@ class LevelDBTypeInfo { // First create the parent indices, then the child indices. ti.indices().forEach(idx -> { - // In LevelDB, there is no parent index for the NUTURAL INDEX. + // In LevelDB, there is no parent index for the NATURAL INDEX. if (idx.parent().isEmpty() || idx.value().equals(KVIndex.NATURAL_INDEX_NAME)) { indices.put(idx.value(), new Index(idx, ti.getAccessor(idx.value()), null)); } diff --git a/common/kvstore/src/test/java/org/apache/spark/util/kvstore/LevelDBSuite.java b/common/kvstore/src/test/java/org/apache/spark/util/kvstore/LevelDBSuite.java index 0b755ba0e8000..f6566617765d4 100644 --- a/common/kvstore/src/test/java/org/apache/spark/util/kvstore/LevelDBSuite.java +++ b/common/kvstore/src/test/java/org/apache/spark/util/kvstore/LevelDBSuite.java @@ -19,6 +19,7 @@ import java.io.File; import java.util.Arrays; +import java.util.Iterator; import java.util.List; import java.util.NoSuchElementException; import java.util.stream.Collectors; @@ -276,6 +277,41 @@ public void testNegativeIndexValues() throws Exception { assertEquals(expected, results); } + @Test + public void testCloseLevelDBIterator() throws Exception { + // SPARK-31929: test when LevelDB.close() is called, related LevelDBIterators + // are closed. And files opened by iterators are also closed. + File dbPathForCloseTest = File + .createTempFile( + "test_db_close.", + ".ldb"); + dbPathForCloseTest.delete(); + LevelDB dbForCloseTest = new LevelDB(dbPathForCloseTest); + for (int i = 0; i < 8192; i++) { + dbForCloseTest.write(createCustomType1(i)); + } + String key = dbForCloseTest + .view(CustomType1.class).iterator().next().key; + assertEquals("key0", key); + Iterator it0 = dbForCloseTest + .view(CustomType1.class).max(1).iterator(); + while (it0.hasNext()) { + it0.next(); + } + System.gc(); + Iterator it1 = dbForCloseTest + .view(CustomType1.class).iterator(); + assertEquals("key0", it1.next().key); + try (KVStoreIterator it2 = dbForCloseTest + .view(CustomType1.class).closeableIterator()) { + assertEquals("key0", it2.next().key); + } + dbForCloseTest.close(); + assertTrue(dbPathForCloseTest.exists()); + FileUtils.deleteQuietly(dbPathForCloseTest); + assertTrue(!dbPathForCloseTest.exists()); + } + private CustomType1 createCustomType1(int i) { CustomType1 t = new CustomType1(); t.key = "key" + i; diff --git a/common/network-common/pom.xml b/common/network-common/pom.xml index 9d5bc9aae0719..0318f60d546e7 100644 --- a/common/network-common/pom.xml +++ b/common/network-common/pom.xml @@ -22,7 +22,7 @@ org.apache.spark spark-parent_2.12 - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../../pom.xml @@ -91,6 +91,10 @@ org.apache.commons commons-crypto + + org.roaringbitmap + RoaringBitmap + diff --git a/common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java b/common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java index 6dcc703e92669..eb2882074d7c7 100644 --- a/common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java +++ b/common/network-common/src/main/java/org/apache/spark/network/client/TransportClient.java @@ -303,7 +303,7 @@ public void close() { @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) - .append("remoteAdress", channel.remoteAddress()) + .append("remoteAddress", channel.remoteAddress()) .append("clientId", clientId) .append("isActive", isActive()) .toString(); diff --git a/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java b/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java index 24c436a504fa8..43408d43e577e 100644 --- a/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java +++ b/common/network-common/src/main/java/org/apache/spark/network/client/TransportClientFactory.java @@ -254,7 +254,7 @@ TransportClient createClient(InetSocketAddress address) // Disable Nagle's Algorithm since we don't want packets to wait .option(ChannelOption.TCP_NODELAY, true) .option(ChannelOption.SO_KEEPALIVE, true) - .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, conf.connectionTimeoutMs()) + .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, conf.connectionCreationTimeoutMs()) .option(ChannelOption.ALLOCATOR, pooledAllocator); if (conf.receiveBuf() > 0) { @@ -280,9 +280,10 @@ public void initChannel(SocketChannel ch) { // Connect to the remote server long preConnect = System.nanoTime(); ChannelFuture cf = bootstrap.connect(address); - if (!cf.await(conf.connectionTimeoutMs())) { + if (!cf.await(conf.connectionCreationTimeoutMs())) { throw new IOException( - String.format("Connecting to %s timed out (%s ms)", address, conf.connectionTimeoutMs())); + String.format("Connecting to %s timed out (%s ms)", + address, conf.connectionCreationTimeoutMs())); } else if (cf.cause() != null) { throw new IOException(String.format("Failed to connect to %s", address), cf.cause()); } diff --git a/common/network-common/src/main/java/org/apache/spark/network/client/TransportResponseHandler.java b/common/network-common/src/main/java/org/apache/spark/network/client/TransportResponseHandler.java index 2f143f77fa4ae..3aac2d2441d2a 100644 --- a/common/network-common/src/main/java/org/apache/spark/network/client/TransportResponseHandler.java +++ b/common/network-common/src/main/java/org/apache/spark/network/client/TransportResponseHandler.java @@ -188,6 +188,7 @@ public void handle(ResponseMessage message) throws Exception { if (listener == null) { logger.warn("Ignoring response for RPC {} from {} ({} bytes) since it is not outstanding", resp.requestId, getRemoteAddress(channel), resp.body().size()); + resp.body().release(); } else { outstandingRpcs.remove(resp.requestId); try { diff --git a/common/network-common/src/main/java/org/apache/spark/network/crypto/AuthEngine.java b/common/network-common/src/main/java/org/apache/spark/network/crypto/AuthEngine.java index 64fdb32a67ada..c2b2edc7f07d5 100644 --- a/common/network-common/src/main/java/org/apache/spark/network/crypto/AuthEngine.java +++ b/common/network-common/src/main/java/org/apache/spark/network/crypto/AuthEngine.java @@ -287,7 +287,7 @@ private byte[] doCipherOp(int mode, byte[] in, boolean isFinal) } } } catch (InternalError ie) { - // SPARK-25535. The commons-cryto library will throw InternalError if something goes wrong, + // SPARK-25535. The commons-crypto library will throw InternalError if something goes wrong, // and leave bad state behind in the Java wrappers, so it's not safe to use them afterwards. if (mode == Cipher.ENCRYPT_MODE) { this.encryptor = null; diff --git a/common/network-common/src/main/java/org/apache/spark/network/crypto/README.md b/common/network-common/src/main/java/org/apache/spark/network/crypto/README.md index 14df703270498..7a9fa3a91d143 100644 --- a/common/network-common/src/main/java/org/apache/spark/network/crypto/README.md +++ b/common/network-common/src/main/java/org/apache/spark/network/crypto/README.md @@ -155,4 +155,4 @@ server will be able to understand. This will cause the server to close the conne attacker tries to send any command to the server. The attacker can just hold the channel open for some time, which will be closed when the server times out the channel. These issues could be separately mitigated by adding a shorter timeout for the first message after authentication, and -potentially by adding host blacklists if a possible attack is detected from a particular host. +potentially by adding host reject-lists if a possible attack is detected from a particular host. diff --git a/common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java b/common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java index 490915f6de4b3..8bab808ad6864 100644 --- a/common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java +++ b/common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java @@ -17,9 +17,12 @@ package org.apache.spark.network.protocol; +import java.io.IOException; +import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import io.netty.buffer.ByteBuf; +import org.roaringbitmap.RoaringBitmap; /** Provides a canonical set of Encoders for simple types. */ public class Encoders { @@ -44,6 +47,51 @@ public static String decode(ByteBuf buf) { } } + /** + * Bitmaps are encoded with their serialization length followed by the serialization bytes. + * + * @since 3.1.0 + */ + public static class Bitmaps { + public static int encodedLength(RoaringBitmap b) { + // Compress the bitmap before serializing it. Note that since BlockTransferMessage + // needs to invoke encodedLength first to figure out the length for the ByteBuf, it + // guarantees that the bitmap will always be compressed before being serialized. + b.trim(); + b.runOptimize(); + return b.serializedSizeInBytes(); + } + + /** + * The input ByteBuf for this encoder should have enough write capacity to fit the serialized + * bitmap. Other encoders which use {@link io.netty.buffer.AbstractByteBuf#writeBytes(byte[])} + * to write can expand the buf as writeBytes calls {@link ByteBuf#ensureWritable} internally. + * However, this encoder doesn't rely on netty's writeBytes and will fail if the input buf + * doesn't have enough write capacity. + */ + public static void encode(ByteBuf buf, RoaringBitmap b) { + // RoaringBitmap requires nio ByteBuffer for serde. We expose the netty ByteBuf as a nio + // ByteBuffer. Here, we need to explicitly manage the index so we can write into the + // ByteBuffer, and the write is reflected in the underneath ByteBuf. + ByteBuffer byteBuffer = buf.nioBuffer(buf.writerIndex(), buf.writableBytes()); + b.serialize(byteBuffer); + buf.writerIndex(buf.writerIndex() + byteBuffer.position()); + } + + public static RoaringBitmap decode(ByteBuf buf) { + RoaringBitmap bitmap = new RoaringBitmap(); + try { + bitmap.deserialize(buf.nioBuffer()); + // RoaringBitmap deserialize does not advance the reader index of the underlying ByteBuf. + // Manually update the index here. + buf.readerIndex(buf.readerIndex() + bitmap.serializedSizeInBytes()); + } catch (IOException e) { + throw new RuntimeException("Exception while decoding bitmap", e); + } + return bitmap; + } + } + /** Byte arrays are encoded with their length followed by bytes. */ public static class ByteArrays { public static int encodedLength(byte[] arr) { @@ -135,4 +183,35 @@ public static long[] decode(ByteBuf buf) { return longs; } } + + /** + * Bitmap arrays are encoded with the number of bitmaps followed by per-Bitmap encoding. + * + * @since 3.1.0 + */ + public static class BitmapArrays { + public static int encodedLength(RoaringBitmap[] bitmaps) { + int totalLength = 4; + for (RoaringBitmap b : bitmaps) { + totalLength += Bitmaps.encodedLength(b); + } + return totalLength; + } + + public static void encode(ByteBuf buf, RoaringBitmap[] bitmaps) { + buf.writeInt(bitmaps.length); + for (RoaringBitmap b : bitmaps) { + Bitmaps.encode(buf, b); + } + } + + public static RoaringBitmap[] decode(ByteBuf buf) { + int numBitmaps = buf.readInt(); + RoaringBitmap[] bitmaps = new RoaringBitmap[numBitmaps]; + for (int i = 0; i < bitmaps.length; i ++) { + bitmaps[i] = Bitmaps.decode(buf); + } + return bitmaps; + } + } } diff --git a/common/network-common/src/main/java/org/apache/spark/network/server/ChunkFetchRequestHandler.java b/common/network-common/src/main/java/org/apache/spark/network/server/ChunkFetchRequestHandler.java index 82810dacdad84..9a71cf593e28c 100644 --- a/common/network-common/src/main/java/org/apache/spark/network/server/ChunkFetchRequestHandler.java +++ b/common/network-common/src/main/java/org/apache/spark/network/server/ChunkFetchRequestHandler.java @@ -88,12 +88,14 @@ public void processFetchRequest( logger.trace("Received req from {} to fetch block {}", getRemoteAddress(channel), msg.streamChunkId); } - long chunksBeingTransferred = streamManager.chunksBeingTransferred(); - if (chunksBeingTransferred >= maxChunksBeingTransferred) { - logger.warn("The number of chunks being transferred {} is above {}, close the connection.", - chunksBeingTransferred, maxChunksBeingTransferred); - channel.close(); - return; + if (maxChunksBeingTransferred < Long.MAX_VALUE) { + long chunksBeingTransferred = streamManager.chunksBeingTransferred(); + if (chunksBeingTransferred >= maxChunksBeingTransferred) { + logger.warn("The number of chunks being transferred {} is above {}, close the connection.", + chunksBeingTransferred, maxChunksBeingTransferred); + channel.close(); + return; + } } ManagedBuffer buf; try { diff --git a/common/network-common/src/main/java/org/apache/spark/network/server/TransportChannelHandler.java b/common/network-common/src/main/java/org/apache/spark/network/server/TransportChannelHandler.java index e53a0c1a0852e..2d439473bc226 100644 --- a/common/network-common/src/main/java/org/apache/spark/network/server/TransportChannelHandler.java +++ b/common/network-common/src/main/java/org/apache/spark/network/server/TransportChannelHandler.java @@ -165,8 +165,9 @@ public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exc if (hasInFlightRequests) { String address = getRemoteAddress(ctx.channel()); logger.error("Connection to {} has been quiet for {} ms while there are outstanding " + - "requests. Assuming connection is dead; please adjust spark.network.timeout if " + - "this is wrong.", address, requestTimeoutNs / 1000 / 1000); + "requests. Assuming connection is dead; please adjust" + + " spark.{}.io.connectionTimeout if this is wrong.", + address, requestTimeoutNs / 1000 / 1000, transportContext.getConf().getModuleName()); client.timeOut(); ctx.close(); } else if (closeIdleConnections) { diff --git a/common/network-common/src/main/java/org/apache/spark/network/server/TransportRequestHandler.java b/common/network-common/src/main/java/org/apache/spark/network/server/TransportRequestHandler.java index f178928006902..4a30f8de07827 100644 --- a/common/network-common/src/main/java/org/apache/spark/network/server/TransportRequestHandler.java +++ b/common/network-common/src/main/java/org/apache/spark/network/server/TransportRequestHandler.java @@ -124,12 +124,14 @@ private void processStreamRequest(final StreamRequest req) { req.streamId); } - long chunksBeingTransferred = streamManager.chunksBeingTransferred(); - if (chunksBeingTransferred >= maxChunksBeingTransferred) { - logger.warn("The number of chunks being transferred {} is above {}, close the connection.", - chunksBeingTransferred, maxChunksBeingTransferred); - channel.close(); - return; + if (maxChunksBeingTransferred < Long.MAX_VALUE) { + long chunksBeingTransferred = streamManager.chunksBeingTransferred(); + if (chunksBeingTransferred >= maxChunksBeingTransferred) { + logger.warn("The number of chunks being transferred {} is above {}, close the connection.", + chunksBeingTransferred, maxChunksBeingTransferred); + channel.close(); + return; + } } ManagedBuffer buf; try { diff --git a/common/network-common/src/main/java/org/apache/spark/network/util/NettyUtils.java b/common/network-common/src/main/java/org/apache/spark/network/util/NettyUtils.java index 423cc0c70ea02..ffbc54a0e0ad8 100644 --- a/common/network-common/src/main/java/org/apache/spark/network/util/NettyUtils.java +++ b/common/network-common/src/main/java/org/apache/spark/network/util/NettyUtils.java @@ -162,7 +162,6 @@ public static PooledByteBufAllocator createPooledByteBufAllocator( Math.min(PooledByteBufAllocator.defaultNumDirectArena(), allowDirectBufs ? numCores : 0), PooledByteBufAllocator.defaultPageSize(), PooledByteBufAllocator.defaultMaxOrder(), - allowCache ? PooledByteBufAllocator.defaultTinyCacheSize() : 0, allowCache ? PooledByteBufAllocator.defaultSmallCacheSize() : 0, allowCache ? PooledByteBufAllocator.defaultNormalCacheSize() : 0, allowCache ? PooledByteBufAllocator.defaultUseCacheForAllThreads() : false diff --git a/common/network-common/src/main/java/org/apache/spark/network/util/TransportConf.java b/common/network-common/src/main/java/org/apache/spark/network/util/TransportConf.java index 6c37f9a382376..f051042a7adb4 100644 --- a/common/network-common/src/main/java/org/apache/spark/network/util/TransportConf.java +++ b/common/network-common/src/main/java/org/apache/spark/network/util/TransportConf.java @@ -19,6 +19,7 @@ import java.util.Locale; import java.util.Properties; +import java.util.concurrent.TimeUnit; import com.google.common.primitives.Ints; import io.netty.util.NettyRuntime; @@ -31,6 +32,7 @@ public class TransportConf { private final String SPARK_NETWORK_IO_MODE_KEY; private final String SPARK_NETWORK_IO_PREFERDIRECTBUFS_KEY; private final String SPARK_NETWORK_IO_CONNECTIONTIMEOUT_KEY; + private final String SPARK_NETWORK_IO_CONNECTIONCREATIONTIMEOUT_KEY; private final String SPARK_NETWORK_IO_BACKLOG_KEY; private final String SPARK_NETWORK_IO_NUMCONNECTIONSPERPEER_KEY; private final String SPARK_NETWORK_IO_SERVERTHREADS_KEY; @@ -54,6 +56,7 @@ public TransportConf(String module, ConfigProvider conf) { SPARK_NETWORK_IO_MODE_KEY = getConfKey("io.mode"); SPARK_NETWORK_IO_PREFERDIRECTBUFS_KEY = getConfKey("io.preferDirectBufs"); SPARK_NETWORK_IO_CONNECTIONTIMEOUT_KEY = getConfKey("io.connectionTimeout"); + SPARK_NETWORK_IO_CONNECTIONCREATIONTIMEOUT_KEY = getConfKey("io.connectionCreationTimeout"); SPARK_NETWORK_IO_BACKLOG_KEY = getConfKey("io.backLog"); SPARK_NETWORK_IO_NUMCONNECTIONSPERPEER_KEY = getConfKey("io.numConnectionsPerPeer"); SPARK_NETWORK_IO_SERVERTHREADS_KEY = getConfKey("io.serverThreads"); @@ -94,7 +97,7 @@ public boolean preferDirectBufs() { return conf.getBoolean(SPARK_NETWORK_IO_PREFERDIRECTBUFS_KEY, true); } - /** Connect timeout in milliseconds. Default 120 secs. */ + /** Connection idle timeout in milliseconds. Default 120 secs. */ public int connectionTimeoutMs() { long defaultNetworkTimeoutS = JavaUtils.timeStringAsSec( conf.get("spark.network.timeout", "120s")); @@ -103,6 +106,14 @@ public int connectionTimeoutMs() { return (int) defaultTimeoutMs; } + /** Connect creation timeout in milliseconds. Default 30 secs. */ + public int connectionCreationTimeoutMs() { + long connectionTimeoutS = TimeUnit.MILLISECONDS.toSeconds(connectionTimeoutMs()); + long defaultTimeoutMs = JavaUtils.timeStringAsSec( + conf.get(SPARK_NETWORK_IO_CONNECTIONCREATIONTIMEOUT_KEY, connectionTimeoutS + "s")) * 1000; + return (int) defaultTimeoutMs; + } + /** Number of concurrent connections between two nodes for fetching data. */ public int numConnectionsPerPeer() { return conf.getInt(SPARK_NETWORK_IO_NUMCONNECTIONSPERPEER_KEY, 1); @@ -290,7 +301,7 @@ public boolean sharedByteBufAllocators() { } /** - * If enabled then off-heap byte buffers will be prefered for the shared ByteBuf allocators. + * If enabled then off-heap byte buffers will be preferred for the shared ByteBuf allocators. */ public boolean preferDirectBufsForSharedByteBufAllocators() { return conf.getBoolean("spark.network.io.preferDirectBufs", true); @@ -363,4 +374,49 @@ public boolean useOldFetchProtocol() { return conf.getBoolean("spark.shuffle.useOldFetchProtocol", false); } + /** + * Class name of the implementation of MergedShuffleFileManager that merges the blocks + * pushed to it when push-based shuffle is enabled. By default, push-based shuffle is disabled at + * a cluster level because this configuration is set to + * 'org.apache.spark.network.shuffle.ExternalBlockHandler$NoOpMergedShuffleFileManager'. + * To turn on push-based shuffle at a cluster level, set the configuration to + * 'org.apache.spark.network.shuffle.RemoteBlockPushResolver'. + */ + public String mergedShuffleFileManagerImpl() { + return conf.get("spark.shuffle.server.mergedShuffleFileManagerImpl", + "org.apache.spark.network.shuffle.ExternalBlockHandler$NoOpMergedShuffleFileManager"); + } + + /** + * The minimum size of a chunk when dividing a merged shuffle file into multiple chunks during + * push-based shuffle. + * A merged shuffle file consists of multiple small shuffle blocks. Fetching the + * complete merged shuffle file in a single response increases the memory requirements for the + * clients. Instead of serving the entire merged file, the shuffle service serves the + * merged file in `chunks`. A `chunk` constitutes few shuffle blocks in entirety and this + * configuration controls how big a chunk can get. A corresponding index file for each merged + * shuffle file will be generated indicating chunk boundaries. + */ + public int minChunkSizeInMergedShuffleFile() { + return Ints.checkedCast(JavaUtils.byteStringAsBytes( + conf.get("spark.shuffle.server.minChunkSizeInMergedShuffleFile", "2m"))); + } + + /** + * The size of cache in memory which is used in push-based shuffle for storing merged index files. + */ + public long mergedIndexCacheSize() { + return JavaUtils.byteStringAsBytes( + conf.get("spark.shuffle.server.mergedIndexCacheSize", "100m")); + } + + /** + * The threshold for number of IOExceptions while merging shuffle blocks to a shuffle partition. + * When the number of IOExceptions while writing to merged shuffle data/index/meta file exceed + * this threshold then the shuffle server will respond back to client to stop pushing shuffle + * blocks for this shuffle partition. + */ + public int ioExceptionsThresholdDuringMerge() { + return conf.getInt("spark.shuffle.server.ioExceptionsThresholdDuringMerge", 4); + } } diff --git a/common/network-common/src/test/java/org/apache/spark/network/TestUtils.java b/common/network-common/src/test/java/org/apache/spark/network/TestUtils.java index 56a2b805f154c..c2c5ffa43e0ed 100644 --- a/common/network-common/src/test/java/org/apache/spark/network/TestUtils.java +++ b/common/network-common/src/test/java/org/apache/spark/network/TestUtils.java @@ -22,7 +22,9 @@ public class TestUtils { public static String getLocalHost() { try { - return InetAddress.getLocalHost().getHostAddress(); + return (System.getenv().containsKey("SPARK_LOCAL_IP"))? + System.getenv("SPARK_LOCAL_IP"): + InetAddress.getLocalHost().getHostAddress(); } catch (Exception e) { throw new RuntimeException(e); } diff --git a/common/network-common/src/test/java/org/apache/spark/network/client/TransportClientFactorySuite.java b/common/network-common/src/test/java/org/apache/spark/network/client/TransportClientFactorySuite.java index ea0ac51589dc3..277ff85db7bf5 100644 --- a/common/network-common/src/test/java/org/apache/spark/network/client/TransportClientFactorySuite.java +++ b/common/network-common/src/test/java/org/apache/spark/network/client/TransportClientFactorySuite.java @@ -29,9 +29,7 @@ import org.junit.After; import org.junit.Assert; import org.junit.Before; -import org.junit.Rule; import org.junit.Test; -import org.junit.rules.ExpectedException; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotSame; @@ -227,11 +225,8 @@ public void closeFactoryBeforeCreateClient() throws IOException, InterruptedExce factory.createClient(TestUtils.getLocalHost(), server1.getPort()); } - @Rule - public ExpectedException expectedException = ExpectedException.none(); - @Test - public void fastFailConnectionInTimeWindow() throws IOException, InterruptedException { + public void fastFailConnectionInTimeWindow() { TransportClientFactory factory = context.createClientFactory(); TransportServer server = context.createServer(); int unreachablePort = server.getPort(); @@ -241,9 +236,7 @@ public void fastFailConnectionInTimeWindow() throws IOException, InterruptedExce } catch (Exception e) { assert(e instanceof IOException); } - expectedException.expect(IOException.class); - expectedException.expectMessage("fail this connection directly"); - factory.createClient(TestUtils.getLocalHost(), unreachablePort, true); - expectedException = ExpectedException.none(); + Assert.assertThrows("fail this connection directly", IOException.class, + () -> factory.createClient(TestUtils.getLocalHost(), unreachablePort, true)); } } diff --git a/common/network-common/src/test/java/org/apache/spark/network/crypto/AuthEngineSuite.java b/common/network-common/src/test/java/org/apache/spark/network/crypto/AuthEngineSuite.java index 0790f0079c2bd..1c2061699a128 100644 --- a/common/network-common/src/test/java/org/apache/spark/network/crypto/AuthEngineSuite.java +++ b/common/network-common/src/test/java/org/apache/spark/network/crypto/AuthEngineSuite.java @@ -150,8 +150,8 @@ public void testEncryptedMessage() throws Exception { ByteArrayWritableChannel channel = new ByteArrayWritableChannel(data.length); TransportCipher.EncryptedMessage emsg = handler.createEncryptedMessage(buf); - while (emsg.transfered() < emsg.count()) { - emsg.transferTo(channel, emsg.transfered()); + while (emsg.transferred() < emsg.count()) { + emsg.transferTo(channel, emsg.transferred()); } assertEquals(data.length, channel.length()); } finally { @@ -196,9 +196,9 @@ public Long answer(InvocationOnMock invocationOnMock) throws Throwable { TransportCipher.EncryptedMessage emsg = handler.createEncryptedMessage(region); ByteArrayWritableChannel channel = new ByteArrayWritableChannel(testDataLength); // "transferTo" should act correctly when the underlying FileRegion transfers 0 bytes. - assertEquals(0L, emsg.transferTo(channel, emsg.transfered())); - assertEquals(testDataLength, emsg.transferTo(channel, emsg.transfered())); - assertEquals(emsg.transfered(), emsg.count()); + assertEquals(0L, emsg.transferTo(channel, emsg.transferred())); + assertEquals(testDataLength, emsg.transferTo(channel, emsg.transferred())); + assertEquals(emsg.transferred(), emsg.count()); assertEquals(4, channel.length()); } finally { client.close(); diff --git a/common/network-common/src/test/java/org/apache/spark/network/crypto/TransportCipherSuite.java b/common/network-common/src/test/java/org/apache/spark/network/crypto/TransportCipherSuite.java index 6b2186f73cd0c..e62b8cb24e0ed 100644 --- a/common/network-common/src/test/java/org/apache/spark/network/crypto/TransportCipherSuite.java +++ b/common/network-common/src/test/java/org/apache/spark/network/crypto/TransportCipherSuite.java @@ -29,11 +29,11 @@ import org.apache.spark.network.util.MapConfigProvider; import org.apache.spark.network.util.TransportConf; import org.hamcrest.CoreMatchers; +import org.hamcrest.MatcherAssert; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.anyInt; @@ -81,7 +81,7 @@ CryptoInputStream createInputStream(ReadableByteChannel ch) throws IOException { channel.writeInbound(buffer2); fail("Should have raised an exception"); } catch (Throwable expected) { - assertThat(expected, CoreMatchers.instanceOf(IOException.class)); + MatcherAssert.assertThat(expected, CoreMatchers.instanceOf(IOException.class)); assertEquals(0, buffer2.refCnt()); } diff --git a/common/network-common/src/test/java/org/apache/spark/network/protocol/EncodersSuite.java b/common/network-common/src/test/java/org/apache/spark/network/protocol/EncodersSuite.java new file mode 100644 index 0000000000000..6e89702c04396 --- /dev/null +++ b/common/network-common/src/test/java/org/apache/spark/network/protocol/EncodersSuite.java @@ -0,0 +1,68 @@ +/* + * 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. + */ + +package org.apache.spark.network.protocol; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import org.junit.Test; +import org.roaringbitmap.RoaringBitmap; + +import static org.junit.Assert.*; + +/** + * Tests for {@link Encoders}. + */ +public class EncodersSuite { + + @Test + public void testRoaringBitmapEncodeDecode() { + RoaringBitmap bitmap = new RoaringBitmap(); + bitmap.add(1, 2, 3); + ByteBuf buf = Unpooled.buffer(Encoders.Bitmaps.encodedLength(bitmap)); + Encoders.Bitmaps.encode(buf, bitmap); + RoaringBitmap decodedBitmap = Encoders.Bitmaps.decode(buf); + assertEquals(bitmap, decodedBitmap); + } + + @Test (expected = java.nio.BufferOverflowException.class) + public void testRoaringBitmapEncodeShouldFailWhenBufferIsSmall() { + RoaringBitmap bitmap = new RoaringBitmap(); + bitmap.add(1, 2, 3); + ByteBuf buf = Unpooled.buffer(4); + Encoders.Bitmaps.encode(buf, bitmap); + } + + @Test + public void testBitmapArraysEncodeDecode() { + RoaringBitmap[] bitmaps = new RoaringBitmap[] { + new RoaringBitmap(), + new RoaringBitmap(), + new RoaringBitmap(), // empty + new RoaringBitmap(), + new RoaringBitmap() + }; + bitmaps[0].add(1, 2, 3); + bitmaps[1].add(1, 2, 4); + bitmaps[3].add(7L, 9L); + bitmaps[4].add(1L, 100L); + ByteBuf buf = Unpooled.buffer(Encoders.BitmapArrays.encodedLength(bitmaps)); + Encoders.BitmapArrays.encode(buf, bitmaps); + RoaringBitmap[] decodedBitmaps = Encoders.BitmapArrays.decode(buf); + assertArrayEquals(bitmaps, decodedBitmaps); + } +} diff --git a/common/network-common/src/test/java/org/apache/spark/network/protocol/MessageWithHeaderSuite.java b/common/network-common/src/test/java/org/apache/spark/network/protocol/MessageWithHeaderSuite.java index 3bff34e210e3c..af1c2878672c0 100644 --- a/common/network-common/src/test/java/org/apache/spark/network/protocol/MessageWithHeaderSuite.java +++ b/common/network-common/src/test/java/org/apache/spark/network/protocol/MessageWithHeaderSuite.java @@ -129,8 +129,8 @@ private void testFileRegionBody(int totalWrites, int writesPerCall) throws Excep private ByteBuf doWrite(MessageWithHeader msg, int minExpectedWrites) throws Exception { int writes = 0; ByteArrayWritableChannel channel = new ByteArrayWritableChannel((int) msg.count()); - while (msg.transfered() < msg.count()) { - msg.transferTo(channel, msg.transfered()); + while (msg.transferred() < msg.count()) { + msg.transferTo(channel, msg.transferred()); writes++; } assertTrue("Not enough writes!", minExpectedWrites <= writes); diff --git a/common/network-common/src/test/java/org/apache/spark/network/sasl/SparkSaslSuite.java b/common/network-common/src/test/java/org/apache/spark/network/sasl/SparkSaslSuite.java index ecaeec98da182..32c9acd327213 100644 --- a/common/network-common/src/test/java/org/apache/spark/network/sasl/SparkSaslSuite.java +++ b/common/network-common/src/test/java/org/apache/spark/network/sasl/SparkSaslSuite.java @@ -191,28 +191,28 @@ public void testEncryptedMessage() throws Exception { SaslEncryption.EncryptedMessage emsg = new SaslEncryption.EncryptedMessage(backend, msg, 1024); - long count = emsg.transferTo(channel, emsg.transfered()); + long count = emsg.transferTo(channel, emsg.transferred()); assertTrue(count < data.length); assertTrue(count > 0); // Here, the output buffer is full so nothing should be transferred. - assertEquals(0, emsg.transferTo(channel, emsg.transfered())); + assertEquals(0, emsg.transferTo(channel, emsg.transferred())); // Now there's room in the buffer, but not enough to transfer all the remaining data, // so the dummy count should be returned. channel.reset(); - assertEquals(1, emsg.transferTo(channel, emsg.transfered())); + assertEquals(1, emsg.transferTo(channel, emsg.transferred())); // Eventually, the whole message should be transferred. for (int i = 0; i < data.length / 32 - 2; i++) { channel.reset(); - assertEquals(1, emsg.transferTo(channel, emsg.transfered())); + assertEquals(1, emsg.transferTo(channel, emsg.transferred())); } channel.reset(); - count = emsg.transferTo(channel, emsg.transfered()); + count = emsg.transferTo(channel, emsg.transferred()); assertTrue("Unexpected count: " + count, count > 1 && count < data.length); - assertEquals(data.length, emsg.transfered()); + assertEquals(data.length, emsg.transferred()); } finally { msg.release(); } @@ -237,9 +237,9 @@ public void testEncryptedMessageChunking() throws Exception { new SaslEncryption.EncryptedMessage(backend, msg.convertToNetty(), data.length / 8); ByteArrayWritableChannel channel = new ByteArrayWritableChannel(data.length); - while (emsg.transfered() < emsg.count()) { + while (emsg.transferred() < emsg.count()) { channel.reset(); - emsg.transferTo(channel, emsg.transfered()); + emsg.transferTo(channel, emsg.transferred()); } verify(backend, times(8)).wrap(any(byte[].class), anyInt(), anyInt()); diff --git a/common/network-common/src/test/java/org/apache/spark/network/server/OneForOneStreamManagerSuite.java b/common/network-common/src/test/java/org/apache/spark/network/server/OneForOneStreamManagerSuite.java index 45e1836da641f..634b40ed450ee 100644 --- a/common/network-common/src/test/java/org/apache/spark/network/server/OneForOneStreamManagerSuite.java +++ b/common/network-common/src/test/java/org/apache/spark/network/server/OneForOneStreamManagerSuite.java @@ -72,7 +72,7 @@ public void testMissingChunk() { Assert.assertNotNull(getChunk(manager, streamId, 2)); manager.connectionTerminated(dummyChannel); - // loaded buffers are not released yet as in production a MangedBuffer returned by getChunk() + // loaded buffers are not released yet as in production a ManagedBuffer returned by getChunk() // would only be released by Netty after it is written to the network Mockito.verify(buffer1, Mockito.never()).release(); Mockito.verify(buffer2, Mockito.never()).release(); diff --git a/common/network-common/src/test/java/org/apache/spark/network/util/TransportFrameDecoderSuite.java b/common/network-common/src/test/java/org/apache/spark/network/util/TransportFrameDecoderSuite.java index 4b67aa80351d2..163c52b023822 100644 --- a/common/network-common/src/test/java/org/apache/spark/network/util/TransportFrameDecoderSuite.java +++ b/common/network-common/src/test/java/org/apache/spark/network/util/TransportFrameDecoderSuite.java @@ -98,7 +98,7 @@ public void testConsolidationPerf() throws Exception { writtenBytes += pieceBytes; } logger.info("Writing 300MiB frame buf with consolidation of threshold " + threshold - + " took " + totalTime + " milis"); + + " took " + totalTime + " millis"); } finally { for (ByteBuf buf : retained) { release(buf); diff --git a/common/network-shuffle/pom.xml b/common/network-shuffle/pom.xml index 00f1defbb0093..6be6df993478d 100644 --- a/common/network-shuffle/pom.xml +++ b/common/network-shuffle/pom.xml @@ -22,7 +22,7 @@ org.apache.spark spark-parent_2.12 - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../../pom.xml @@ -47,6 +47,11 @@ metrics-core + + org.apache.spark + spark-tags_${scala.binary.version} + + org.slf4j @@ -57,6 +62,10 @@ com.google.guava guava + + org.roaringbitmap + RoaringBitmap + @@ -66,11 +75,6 @@ test-jar test - - org.apache.spark - spark-tags_${scala.binary.version} - test - org.apache.hadoop - hadoop-client + ${hadoop-client-api.artifact} + ${hadoop.version} + + + org.apache.hadoop + ${hadoop-client-runtime.artifact} + ${hadoop.version} org.slf4j diff --git a/common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java b/common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java index 3d14318bf90f0..cb6d5d0ca2037 100644 --- a/common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java +++ b/common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleService.java @@ -19,6 +19,7 @@ import java.io.File; import java.io.IOException; +import java.net.URL; import java.nio.charset.StandardCharsets; import java.nio.ByteBuffer; import java.util.List; @@ -41,6 +42,7 @@ import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem; import org.apache.hadoop.yarn.api.records.ContainerId; import org.apache.hadoop.yarn.server.api.*; +import org.apache.spark.network.shuffle.MergedShuffleFileManager; import org.apache.spark.network.util.LevelDBProvider; import org.iq80.leveldb.DB; import org.iq80.leveldb.DBIterator; @@ -74,6 +76,20 @@ * is because an application running on the same Yarn cluster may choose to not use the external * shuffle service, in which case its setting of `spark.authenticate` should be independent of * the service's. + * + * The shuffle service will produce metrics via the YARN NodeManager's {@code metrics2} system + * under a namespace specified by the {@value SPARK_SHUFFLE_SERVICE_METRICS_NAMESPACE_KEY} config. + * + * By default, all configurations for the shuffle service will be taken directly from the + * Hadoop {@link Configuration} passed by the YARN NodeManager. It is also possible to configure + * the shuffle service by placing a resource named + * {@value SHUFFLE_SERVICE_CONF_OVERLAY_RESOURCE_NAME} into the classpath, which should be an + * XML file in the standard Hadoop Configuration resource format. Note that when the shuffle + * service is loaded in the default manner, without configuring + * {@code yarn.nodemanager.aux-services..classpath}, this file must be on the classpath + * of the NodeManager itself. When using the {@code classpath} configuration, it can be present + * either on the NodeManager's classpath, or specified in the classpath configuration. + * This {@code classpath} configuration is only supported on YARN versions >= 2.9.0. */ public class YarnShuffleService extends AuxiliaryService { private static final Logger logger = LoggerFactory.getLogger(YarnShuffleService.class); @@ -82,6 +98,14 @@ public class YarnShuffleService extends AuxiliaryService { private static final String SPARK_SHUFFLE_SERVICE_PORT_KEY = "spark.shuffle.service.port"; private static final int DEFAULT_SPARK_SHUFFLE_SERVICE_PORT = 7337; + /** + * The namespace to use for the metrics record which will contain all metrics produced by the + * shuffle service. + */ + static final String SPARK_SHUFFLE_SERVICE_METRICS_NAMESPACE_KEY = + "spark.yarn.shuffle.service.metrics.namespace"; + private static final String DEFAULT_SPARK_SHUFFLE_SERVICE_METRICS_NAME = "sparkShuffleService"; + // Whether the shuffle server should authenticate fetch requests private static final String SPARK_AUTHENTICATE_KEY = "spark.authenticate"; private static final boolean DEFAULT_SPARK_AUTHENTICATE = false; @@ -102,6 +126,13 @@ public class YarnShuffleService extends AuxiliaryService { private static final LevelDBProvider.StoreVersion CURRENT_VERSION = new LevelDBProvider .StoreVersion(1, 0); + /** + * The name of the resource to search for on the classpath to find a shuffle service-specific + * configuration overlay. If found, this will be parsed as a standard Hadoop + * {@link Configuration config} file and will override the configs passed from the NodeManager. + */ + static final String SHUFFLE_SERVICE_CONF_OVERLAY_RESOURCE_NAME = "spark-shuffle-site.xml"; + // just for integration tests that want to look at this file -- in general not sensible as // a static @VisibleForTesting @@ -138,6 +169,13 @@ public class YarnShuffleService extends AuxiliaryService { private DB db; public YarnShuffleService() { + // The name of the auxiliary service configured within the NodeManager + // (`yarn.nodemanager.aux-services`) is treated as the source-of-truth, so this one can be + // arbitrary. The NodeManager will log a warning if the configured name doesn't match this name, + // to inform operators of a potential misconfiguration, but this name is otherwise not used. + // It is hard-coded instead of using the value of the `spark.shuffle.service.name` configuration + // because at this point in instantiation there is no Configuration object; it is not passed + // until `serviceInit` is called, at which point it's too late to adjust the name. super("spark_shuffle"); logger.info("Initializing YARN shuffle service for Spark"); instance = this; @@ -156,10 +194,18 @@ private boolean isAuthenticationEnabled() { * Start the shuffle server with the given configuration. */ @Override - protected void serviceInit(Configuration conf) throws Exception { - _conf = conf; + protected void serviceInit(Configuration externalConf) throws Exception { + _conf = new Configuration(externalConf); + URL confOverlayUrl = Thread.currentThread().getContextClassLoader() + .getResource(SHUFFLE_SERVICE_CONF_OVERLAY_RESOURCE_NAME); + if (confOverlayUrl != null) { + logger.info("Initializing Spark YARN shuffle service with configuration overlay from {}", + confOverlayUrl); + _conf.addResource(confOverlayUrl); + } + super.serviceInit(_conf); - boolean stopOnFailure = conf.getBoolean(STOP_ON_FAILURE_KEY, DEFAULT_STOP_ON_FAILURE); + boolean stopOnFailure = _conf.getBoolean(STOP_ON_FAILURE_KEY, DEFAULT_STOP_ON_FAILURE); try { // In case this NM was killed while there were running spark applications, we need to restore @@ -171,13 +217,16 @@ protected void serviceInit(Configuration conf) throws Exception { registeredExecutorFile = initRecoveryDb(RECOVERY_FILE_NAME); } - TransportConf transportConf = new TransportConf("shuffle", new HadoopConfigProvider(conf)); - blockHandler = new ExternalBlockHandler(transportConf, registeredExecutorFile); + TransportConf transportConf = new TransportConf("shuffle", new HadoopConfigProvider(_conf)); + MergedShuffleFileManager shuffleMergeManager = newMergedShuffleFileManagerInstance( + transportConf); + blockHandler = new ExternalBlockHandler( + transportConf, registeredExecutorFile, shuffleMergeManager); // If authentication is enabled, set up the shuffle server to use a // special RPC handler that filters out unauthenticated fetch requests List bootstraps = Lists.newArrayList(); - boolean authEnabled = conf.getBoolean(SPARK_AUTHENTICATE_KEY, DEFAULT_SPARK_AUTHENTICATE); + boolean authEnabled = _conf.getBoolean(SPARK_AUTHENTICATE_KEY, DEFAULT_SPARK_AUTHENTICATE); if (authEnabled) { secretManager = new ShuffleSecretManager(); if (_recoveryPath != null) { @@ -186,7 +235,7 @@ protected void serviceInit(Configuration conf) throws Exception { bootstraps.add(new AuthServerBootstrap(transportConf, secretManager)); } - int port = conf.getInt( + int port = _conf.getInt( SPARK_SHUFFLE_SERVICE_PORT_KEY, DEFAULT_SPARK_SHUFFLE_SERVICE_PORT); transportContext = new TransportContext(transportConf, blockHandler, true); shuffleServer = transportContext.createServer(port, bootstraps); @@ -199,13 +248,16 @@ protected void serviceInit(Configuration conf) throws Exception { blockHandler.getAllMetrics().getMetrics().put("numRegisteredConnections", shuffleServer.getRegisteredConnections()); blockHandler.getAllMetrics().getMetrics().putAll(shuffleServer.getAllMetrics().getMetrics()); + String metricsNamespace = _conf.get(SPARK_SHUFFLE_SERVICE_METRICS_NAMESPACE_KEY, + DEFAULT_SPARK_SHUFFLE_SERVICE_METRICS_NAME); YarnShuffleServiceMetrics serviceMetrics = - new YarnShuffleServiceMetrics(blockHandler.getAllMetrics()); + new YarnShuffleServiceMetrics(metricsNamespace, blockHandler.getAllMetrics()); MetricsSystemImpl metricsSystem = (MetricsSystemImpl) DefaultMetricsSystem.instance(); metricsSystem.register( - "sparkShuffleService", "Metrics on the Spark Shuffle Service", serviceMetrics); - logger.info("Registered metrics with Hadoop's DefaultMetricsSystem"); + metricsNamespace, "Metrics on the Spark Shuffle Service", serviceMetrics); + logger.info("Registered metrics with Hadoop's DefaultMetricsSystem using namespace '{}'", + metricsNamespace); logger.info("Started YARN shuffle service for Spark on port {}. " + "Authentication is {}. Registered executor file is {}", port, authEnabledString, @@ -219,6 +271,23 @@ protected void serviceInit(Configuration conf) throws Exception { } } + @VisibleForTesting + static MergedShuffleFileManager newMergedShuffleFileManagerInstance(TransportConf conf) { + String mergeManagerImplClassName = conf.mergedShuffleFileManagerImpl(); + try { + Class mergeManagerImplClazz = Class.forName( + mergeManagerImplClassName, true, Thread.currentThread().getContextClassLoader()); + Class mergeManagerSubClazz = + mergeManagerImplClazz.asSubclass(MergedShuffleFileManager.class); + // The assumption is that all the custom implementations just like the RemoteBlockPushResolver + // will also need the transport configuration. + return mergeManagerSubClazz.getConstructor(TransportConf.class).newInstance(conf); + } catch (Exception e) { + logger.error("Unable to create an instance of {}", mergeManagerImplClassName); + return new ExternalBlockHandler.NoOpMergedShuffleFileManager(conf); + } + } + private void loadSecretsFromDb() throws IOException { secretsFile = initRecoveryDb(SECRETS_RECOVERY_FILE_NAME); diff --git a/common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleServiceMetrics.java b/common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleServiceMetrics.java index 81be6e8036ffe..f30abbd0f7fcd 100644 --- a/common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleServiceMetrics.java +++ b/common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleServiceMetrics.java @@ -32,9 +32,11 @@ */ class YarnShuffleServiceMetrics implements MetricsSource { + private final String metricsNamespace; private final MetricSet metricSet; - YarnShuffleServiceMetrics(MetricSet metricSet) { + YarnShuffleServiceMetrics(String metricsNamespace, MetricSet metricSet) { + this.metricsNamespace = metricsNamespace; this.metricSet = metricSet; } @@ -46,7 +48,7 @@ class YarnShuffleServiceMetrics implements MetricsSource { */ @Override public void getMetrics(MetricsCollector collector, boolean all) { - MetricsRecordBuilder metricsRecordBuilder = collector.addRecord("sparkShuffleService"); + MetricsRecordBuilder metricsRecordBuilder = collector.addRecord(metricsNamespace); for (Map.Entry entry : metricSet.getMetrics().entrySet()) { collectMetric(metricsRecordBuilder, entry.getKey(), entry.getValue()); diff --git a/common/sketch/pom.xml b/common/sketch/pom.xml index 72a2c4ceb43b6..b5a6775366a47 100644 --- a/common/sketch/pom.xml +++ b/common/sketch/pom.xml @@ -22,7 +22,7 @@ org.apache.spark spark-parent_2.12 - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../../pom.xml diff --git a/common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java b/common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java index e83b331391e39..61cd2cec1a34b 100644 --- a/common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java +++ b/common/sketch/src/main/java/org/apache/spark/util/sketch/Murmur3_x86_32.java @@ -17,12 +17,16 @@ package org.apache.spark.util.sketch; +import java.nio.ByteOrder; + /** * 32-bit Murmur3 hasher. This is based on Guava's Murmur3_32HashFunction. */ // This class is duplicated from `org.apache.spark.unsafe.hash.Murmur3_x86_32` to make sure // spark-sketch has no external dependencies. final class Murmur3_x86_32 { + private static final boolean isBigEndian = ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN); + private static final int C1 = 0xcc9e2d51; private static final int C2 = 0x1b873593; @@ -92,8 +96,10 @@ private static int hashBytesByInt(Object base, long offset, int lengthInBytes, i int h1 = seed; for (int i = 0; i < lengthInBytes; i += 4) { int halfWord = Platform.getInt(base, offset + i); - int k1 = mixK1(halfWord); - h1 = mixH1(h1, k1); + if (isBigEndian) { + halfWord = Integer.reverseBytes(halfWord); + } + h1 = mixH1(h1, mixK1(halfWord)); } return h1; } diff --git a/common/sketch/src/test/scala/org/apache/spark/util/sketch/BitArraySuite.scala b/common/sketch/src/test/scala/org/apache/spark/util/sketch/BitArraySuite.scala index ff728f0ebcb85..4c535a8dd0411 100644 --- a/common/sketch/src/test/scala/org/apache/spark/util/sketch/BitArraySuite.scala +++ b/common/sketch/src/test/scala/org/apache/spark/util/sketch/BitArraySuite.scala @@ -19,9 +19,9 @@ package org.apache.spark.util.sketch import scala.util.Random -import org.scalatest.FunSuite // scalastyle:ignore funsuite +import org.scalatest.funsuite.AnyFunSuite // scalastyle:ignore funsuite -class BitArraySuite extends FunSuite { // scalastyle:ignore funsuite +class BitArraySuite extends AnyFunSuite { // scalastyle:ignore funsuite test("error case when create BitArray") { intercept[IllegalArgumentException](new BitArray(0)) diff --git a/common/sketch/src/test/scala/org/apache/spark/util/sketch/BloomFilterSuite.scala b/common/sketch/src/test/scala/org/apache/spark/util/sketch/BloomFilterSuite.scala index a0408d2da4dff..8b289fc86af0f 100644 --- a/common/sketch/src/test/scala/org/apache/spark/util/sketch/BloomFilterSuite.scala +++ b/common/sketch/src/test/scala/org/apache/spark/util/sketch/BloomFilterSuite.scala @@ -22,9 +22,9 @@ import java.io.{ByteArrayInputStream, ByteArrayOutputStream} import scala.reflect.ClassTag import scala.util.Random -import org.scalatest.FunSuite // scalastyle:ignore funsuite +import org.scalatest.funsuite.AnyFunSuite // scalastyle:ignore funsuite -class BloomFilterSuite extends FunSuite { // scalastyle:ignore funsuite +class BloomFilterSuite extends AnyFunSuite { // scalastyle:ignore funsuite private final val EPSILON = 0.01 // Serializes and deserializes a given `BloomFilter`, then checks whether the deserialized diff --git a/common/sketch/src/test/scala/org/apache/spark/util/sketch/CountMinSketchSuite.scala b/common/sketch/src/test/scala/org/apache/spark/util/sketch/CountMinSketchSuite.scala index 174eb01986c4f..087dae26047ef 100644 --- a/common/sketch/src/test/scala/org/apache/spark/util/sketch/CountMinSketchSuite.scala +++ b/common/sketch/src/test/scala/org/apache/spark/util/sketch/CountMinSketchSuite.scala @@ -22,9 +22,9 @@ import java.io.{ByteArrayInputStream, ByteArrayOutputStream} import scala.reflect.ClassTag import scala.util.Random -import org.scalatest.FunSuite // scalastyle:ignore funsuite +import org.scalatest.funsuite.AnyFunSuite // scalastyle:ignore funsuite -class CountMinSketchSuite extends FunSuite { // scalastyle:ignore funsuite +class CountMinSketchSuite extends AnyFunSuite { // scalastyle:ignore funsuite private val epsOfTotalCount = 0.01 private val confidence = 0.9 diff --git a/common/tags/pom.xml b/common/tags/pom.xml index ea16dadca40cb..e51357d97faab 100644 --- a/common/tags/pom.xml +++ b/common/tags/pom.xml @@ -22,7 +22,7 @@ org.apache.spark spark-parent_2.12 - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../../pom.xml diff --git a/common/tags/src/test/java/org/apache/spark/tags/ChromeUITest.java b/common/tags/src/test/java/org/apache/spark/tags/ChromeUITest.java new file mode 100644 index 0000000000000..e3fed3d656d20 --- /dev/null +++ b/common/tags/src/test/java/org/apache/spark/tags/ChromeUITest.java @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package org.apache.spark.tags; + +import java.lang.annotation.*; + +import org.scalatest.TagAnnotation; + +@TagAnnotation +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE}) +public @interface ChromeUITest { } diff --git a/common/tags/src/test/java/org/apache/spark/tags/SlowHiveTest.java b/common/tags/src/test/java/org/apache/spark/tags/SlowHiveTest.java new file mode 100644 index 0000000000000..a7e6f352667d7 --- /dev/null +++ b/common/tags/src/test/java/org/apache/spark/tags/SlowHiveTest.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package org.apache.spark.tags; + +import org.scalatest.TagAnnotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@TagAnnotation +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.METHOD, ElementType.TYPE}) +public @interface SlowHiveTest { } diff --git a/common/unsafe/pom.xml b/common/unsafe/pom.xml index 769e2518b1fd4..b22400575dd02 100644 --- a/common/unsafe/pom.xml +++ b/common/unsafe/pom.xml @@ -22,7 +22,7 @@ org.apache.spark spark-parent_2.12 - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../../pom.xml diff --git a/common/unsafe/src/main/java/org/apache/spark/unsafe/hash/Murmur3_x86_32.java b/common/unsafe/src/main/java/org/apache/spark/unsafe/hash/Murmur3_x86_32.java index d239de6083ad0..0b9d9ced312a1 100644 --- a/common/unsafe/src/main/java/org/apache/spark/unsafe/hash/Murmur3_x86_32.java +++ b/common/unsafe/src/main/java/org/apache/spark/unsafe/hash/Murmur3_x86_32.java @@ -17,12 +17,16 @@ package org.apache.spark.unsafe.hash; +import java.nio.ByteOrder; + import org.apache.spark.unsafe.Platform; /** * 32-bit Murmur3 hasher. This is based on Guava's Murmur3_32HashFunction. */ public final class Murmur3_x86_32 { + private static final boolean isBigEndian = ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN); + private static final int C1 = 0xcc9e2d51; private static final int C2 = 0x1b873593; @@ -92,8 +96,10 @@ private static int hashBytesByInt(Object base, long offset, int lengthInBytes, i int h1 = seed; for (int i = 0; i < lengthInBytes; i += 4) { int halfWord = Platform.getInt(base, offset + i); - int k1 = mixK1(halfWord); - h1 = mixH1(h1, k1); + if (isBigEndian) { + halfWord = Integer.reverseBytes(halfWord); + } + h1 = mixH1(h1, mixK1(halfWord)); } return h1; } diff --git a/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java b/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java index 186597fa64780..db52f77481761 100644 --- a/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java +++ b/common/unsafe/src/main/java/org/apache/spark/unsafe/types/UTF8String.java @@ -29,7 +29,6 @@ import com.esotericsoftware.kryo.KryoSerializable; import com.esotericsoftware.kryo.io.Input; import com.esotericsoftware.kryo.io.Output; -import com.google.common.primitives.Ints; import org.apache.spark.unsafe.Platform; import org.apache.spark.unsafe.UTF8StringBuilder; @@ -341,8 +340,17 @@ public UTF8String substringSQL(int pos, int length) { // to the -ith element before the end of the sequence. If a start index i is 0, it // refers to the first element. int len = numChars(); + // `len + pos` does not overflow as `len >= 0`. int start = (pos > 0) ? pos -1 : ((pos < 0) ? len + pos : 0); - int end = (length == Integer.MAX_VALUE) ? len : start + length; + + int end; + if ((long) start + length > Integer.MAX_VALUE) { + end = Integer.MAX_VALUE; + } else if ((long) start + length < Integer.MIN_VALUE) { + end = Integer.MIN_VALUE; + } else { + end = start + length; + } return substring(start, end); } @@ -554,7 +562,7 @@ public UTF8String trim() { } /** - * Trims whitespaces (<= ASCII 32) from both ends of this string. + * Trims whitespaces ({@literal <=} ASCII 32) from both ends of this string. * * Note that, this method is the same as java's {@link String#trim}, and different from * {@link UTF8String#trim()} which remove only spaces(= ASCII 32) from both ends. @@ -566,14 +574,14 @@ public UTF8String trim() { public UTF8String trimAll() { int s = 0; // skip all of the whitespaces (<=0x20) in the left side - while (s < this.numBytes && getByte(s) <= ' ') s++; + while (s < this.numBytes && Character.isWhitespace(getByte(s))) s++; if (s == this.numBytes) { // Everything trimmed return EMPTY_UTF8; } // skip all of the whitespaces (<=0x20) in the right side int e = this.numBytes - 1; - while (e > s && getByte(e) <= ' ') e--; + while (e > s && Character.isWhitespace(getByte(e))) e--; if (s == 0 && e == numBytes - 1) { // Nothing trimmed return this; @@ -626,13 +634,13 @@ public UTF8String trimLeft() { public UTF8String trimLeft(UTF8String trimString) { if (trimString == null) return null; // the searching byte position in the source string - int srchIdx = 0; + int searchIdx = 0; // the first beginning byte position of a non-matching character int trimIdx = 0; - while (srchIdx < numBytes) { + while (searchIdx < numBytes) { UTF8String searchChar = copyUTF8String( - srchIdx, srchIdx + numBytesForFirstByte(this.getByte(srchIdx)) - 1); + searchIdx, searchIdx + numBytesForFirstByte(this.getByte(searchIdx)) - 1); int searchCharBytes = searchChar.numBytes; // try to find the matching for the searchChar in the trimString set if (trimString.find(searchChar, 0) >= 0) { @@ -641,9 +649,9 @@ public UTF8String trimLeft(UTF8String trimString) { // no matching, exit the search break; } - srchIdx += searchCharBytes; + searchIdx += searchCharBytes; } - if (srchIdx == 0) { + if (searchIdx == 0) { // Nothing trimmed return this; } @@ -674,6 +682,17 @@ public UTF8String trimRight() { return copyUTF8String(0, e); } + /** + * Trims at most `numSpaces` space characters (ASCII 32) from the end of this string. + */ + public UTF8String trimTrailingSpaces(int numSpaces) { + assert numSpaces > 0; + int endIdx = numBytes - 1; + int trimTo = numBytes - numSpaces; + while (endIdx >= trimTo && getByte(endIdx) == 0x20) endIdx--; + return copyUTF8String(0, endIdx); + } + /** * Trims instances of the given trim string from the end of this string. * @@ -744,7 +763,7 @@ public UTF8String repeat(int times) { return EMPTY_UTF8; } - byte[] newBytes = new byte[numBytes * times]; + byte[] newBytes = new byte[Math.multiplyExact(numBytes, times)]; copyMemory(this.base, this.offset, newBytes, BYTE_ARRAY_OFFSET, numBytes); int copied = 1; @@ -887,7 +906,8 @@ public UTF8String rpad(int len, UTF8String pad) { // the partial string of the padding UTF8String remain = pad.substring(0, spaces - padChars * count); - byte[] data = new byte[this.numBytes + pad.numBytes * count + remain.numBytes]; + int resultSize = Math.toIntExact((long)numBytes + pad.numBytes * count + remain.numBytes); + byte[] data = new byte[resultSize]; copyMemory(this.base, this.offset, data, BYTE_ARRAY_OFFSET, this.numBytes); int offset = this.numBytes; int idx = 0; @@ -919,7 +939,8 @@ public UTF8String lpad(int len, UTF8String pad) { // the partial string of the padding UTF8String remain = pad.substring(0, spaces - padChars * count); - byte[] data = new byte[this.numBytes + pad.numBytes * count + remain.numBytes]; + int resultSize = Math.toIntExact((long)numBytes + pad.numBytes * count + remain.numBytes); + byte[] data = new byte[resultSize]; int offset = 0; int idx = 0; @@ -951,7 +972,7 @@ public static UTF8String concat(UTF8String... inputs) { } // Allocate a new byte array, and copy the inputs one by one into it. - final byte[] result = new byte[Ints.checkedCast(totalLength)]; + final byte[] result = new byte[Math.toIntExact(totalLength)]; int offset = 0; for (int i = 0; i < inputs.length; i++) { int len = inputs[i].numBytes; @@ -973,7 +994,7 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) { return null; } - int numInputBytes = 0; // total number of bytes from the inputs + long numInputBytes = 0L; // total number of bytes from the inputs int numInputs = 0; // number of non-null inputs for (int i = 0; i < inputs.length; i++) { if (inputs[i] != null) { @@ -989,7 +1010,8 @@ public static UTF8String concatWs(UTF8String separator, UTF8String... inputs) { // Allocate a new byte array, and copy the inputs one by one into it. // The size of the new array is the size of all inputs, plus the separators. - final byte[] result = new byte[numInputBytes + (numInputs - 1) * separator.numBytes]; + int resultSize = Math.toIntExact(numInputBytes + (numInputs - 1) * (long)separator.numBytes); + final byte[] result = new byte[resultSize]; int offset = 0; for (int i = 0, j = 0; i < inputs.length; i++) { @@ -1056,16 +1078,20 @@ public UTF8String replace(UTF8String search, UTF8String replace) { return buf.build(); } - // TODO: Need to use `Code Point` here instead of Char in case the character longer than 2 bytes - public UTF8String translate(Map dict) { + public UTF8String translate(Map dict) { String srcStr = this.toString(); StringBuilder sb = new StringBuilder(); - for(int k = 0; k< srcStr.length(); k++) { - if (null == dict.get(srcStr.charAt(k))) { - sb.append(srcStr.charAt(k)); - } else if ('\0' != dict.get(srcStr.charAt(k))){ - sb.append(dict.get(srcStr.charAt(k))); + int charCount = 0; + for (int k = 0; k < srcStr.length(); k += charCount) { + int codePoint = srcStr.codePointAt(k); + charCount = Character.charCount(codePoint); + String subStr = srcStr.substring(k, k + charCount); + String translated = dict.get(subStr); + if (null == translated) { + sb.append(subStr); + } else if (!"\0".equals(translated)) { + sb.append(translated); } } return fromString(sb.toString()); @@ -1110,11 +1136,11 @@ public boolean toLong(LongWrapper toLongResult) { private boolean toLong(LongWrapper toLongResult, boolean allowDecimal) { int offset = 0; - while (offset < this.numBytes && getByte(offset) <= ' ') offset++; + while (offset < this.numBytes && Character.isWhitespace(getByte(offset))) offset++; if (offset == this.numBytes) return false; int end = this.numBytes - 1; - while (end > offset && getByte(end) <= ' ') end--; + while (end > offset && Character.isWhitespace(getByte(end))) end--; byte b = getByte(offset); final boolean negative = b == '-'; @@ -1207,11 +1233,11 @@ public boolean toInt(IntWrapper intWrapper) { private boolean toInt(IntWrapper intWrapper, boolean allowDecimal) { int offset = 0; - while (offset < this.numBytes && getByte(offset) <= ' ') offset++; + while (offset < this.numBytes && Character.isWhitespace(getByte(offset))) offset++; if (offset == this.numBytes) return false; int end = this.numBytes - 1; - while (end > offset && getByte(end) <= ' ') end--; + while (end > offset && Character.isWhitespace(getByte(end))) end--; byte b = getByte(offset); final boolean negative = b == '-'; diff --git a/common/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java b/common/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java index 8f933877f82e6..ba3e4269e9a46 100644 --- a/common/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java +++ b/common/unsafe/src/test/java/org/apache/spark/unsafe/types/UTF8StringSuite.java @@ -390,6 +390,10 @@ public void substringSQL() { assertEquals(fromString("example"), e.substringSQL(0, Integer.MAX_VALUE)); assertEquals(fromString("example"), e.substringSQL(1, Integer.MAX_VALUE)); assertEquals(fromString("xample"), e.substringSQL(2, Integer.MAX_VALUE)); + assertEquals(EMPTY_UTF8, e.substringSQL(-100, -100)); + assertEquals(EMPTY_UTF8, e.substringSQL(-1207959552, -1207959552)); + assertEquals(fromString("pl"), e.substringSQL(-3, 2)); + assertEquals(EMPTY_UTF8, e.substringSQL(Integer.MIN_VALUE, 6)); } @Test @@ -461,10 +465,10 @@ public void translate() { assertEquals( fromString("1a2s3ae"), fromString("translate").translate(ImmutableMap.of( - 'r', '1', - 'n', '2', - 'l', '3', - 't', '\0' + "r", "1", + "n", "2", + "l", "3", + "t", "\0" ))); assertEquals( fromString("translate"), @@ -472,16 +476,16 @@ public void translate() { assertEquals( fromString("asae"), fromString("translate").translate(ImmutableMap.of( - 'r', '\0', - 'n', '\0', - 'l', '\0', - 't', '\0' + "r", "\0", + "n", "\0", + "l", "\0", + "t", "\0" ))); assertEquals( fromString("aa世b"), fromString("花花世界").translate(ImmutableMap.of( - '花', 'a', - '界', 'b' + "花", "a", + "界", "b" ))); } diff --git a/common/unsafe/src/test/scala/org/apache/spark/unsafe/types/UTF8StringPropertyCheckSuite.scala b/common/unsafe/src/test/scala/org/apache/spark/unsafe/types/UTF8StringPropertyCheckSuite.scala index 72aa682bb95bc..ab488e18ba3f4 100644 --- a/common/unsafe/src/test/scala/org/apache/spark/unsafe/types/UTF8StringPropertyCheckSuite.scala +++ b/common/unsafe/src/test/scala/org/apache/spark/unsafe/types/UTF8StringPropertyCheckSuite.scala @@ -21,14 +21,15 @@ import org.apache.commons.text.similarity.LevenshteinDistance import org.scalacheck.{Arbitrary, Gen} import org.scalatestplus.scalacheck.ScalaCheckDrivenPropertyChecks // scalastyle:off -import org.scalatest.{FunSuite, Matchers} +import org.scalatest.funsuite.AnyFunSuite +import org.scalatest.matchers.must.Matchers import org.apache.spark.unsafe.types.UTF8String.{fromString => toUTF8} /** * This TestSuite utilize ScalaCheck to generate randomized inputs for UTF8String testing. */ -class UTF8StringPropertyCheckSuite extends FunSuite with ScalaCheckDrivenPropertyChecks with Matchers { +class UTF8StringPropertyCheckSuite extends AnyFunSuite with ScalaCheckDrivenPropertyChecks with Matchers { // scalastyle:on test("toString") { @@ -191,7 +192,7 @@ class UTF8StringPropertyCheckSuite extends FunSuite with ScalaCheckDrivenPropert } } - val nullalbeSeq = Gen.listOf(Gen.oneOf[String](null: String, randomString)) + val nullableSeq = Gen.listOf(Gen.oneOf[String](null: String, randomString)) test("concat") { def concat(origin: Seq[String]): String = @@ -200,7 +201,7 @@ class UTF8StringPropertyCheckSuite extends FunSuite with ScalaCheckDrivenPropert forAll { (inputs: Seq[String]) => assert(UTF8String.concat(inputs.map(toUTF8): _*) === toUTF8(inputs.mkString)) } - forAll (nullalbeSeq) { (inputs: Seq[String]) => + forAll (nullableSeq) { (inputs: Seq[String]) => assert(UTF8String.concat(inputs.map(toUTF8): _*) === toUTF8(concat(inputs))) } } @@ -215,7 +216,7 @@ class UTF8StringPropertyCheckSuite extends FunSuite with ScalaCheckDrivenPropert assert(UTF8String.concatWs(toUTF8(sep), inputs.map(toUTF8): _*) === toUTF8(inputs.mkString(sep))) } - forAll(randomString, nullalbeSeq) {(sep: String, inputs: Seq[String]) => + forAll(randomString, nullableSeq) {(sep: String, inputs: Seq[String]) => assert(UTF8String.concatWs(toUTF8(sep), inputs.map(toUTF8): _*) === toUTF8(concatWs(sep, inputs))) } diff --git a/conf/log4j.properties.template b/conf/log4j.properties.template index e91595dd324b0..5db8c5c295d84 100644 --- a/conf/log4j.properties.template +++ b/conf/log4j.properties.template @@ -22,10 +22,12 @@ log4j.appender.console.target=System.err log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{yy/MM/dd HH:mm:ss} %p %c{1}: %m%n -# Set the default spark-shell log level to WARN. When running the spark-shell, the -# log level for this class is used to overwrite the root logger's log level, so that -# the user can have different defaults for the shell and regular Spark apps. +# Set the default spark-shell/spark-sql log level to WARN. When running the +# spark-shell/spark-sql, the log level for these classes is used to overwrite +# the root logger's log level, so that the user can have different defaults +# for the shell and regular Spark apps. log4j.logger.org.apache.spark.repl.Main=WARN +log4j.logger.org.apache.spark.sql.hive.thriftserver.SparkSQLCLIDriver=WARN # Settings to quiet third party logs that are too verbose log4j.logger.org.sparkproject.jetty=WARN @@ -38,3 +40,9 @@ log4j.logger.parquet=ERROR # SPARK-9183: Settings to avoid annoying messages when looking up nonexistent UDFs in SparkSQL with Hive support log4j.logger.org.apache.hadoop.hive.metastore.RetryingHMSHandler=FATAL log4j.logger.org.apache.hadoop.hive.ql.exec.FunctionRegistry=ERROR + +# For deploying Spark ThriftServer +# SPARK-34128:Suppress undesirable TTransportException warnings involved in THRIFT-4805 +log4j.appender.console.filter.1=org.apache.log4j.varia.StringMatchFilter +log4j.appender.console.filter.1.StringToMatch=Thrift error occurred during processing of message +log4j.appender.console.filter.1.AcceptOnMatch=false diff --git a/conf/spark-env.sh.template b/conf/spark-env.sh.template index df39ad8b0dcc2..3c003f45ed27a 100755 --- a/conf/spark-env.sh.template +++ b/conf/spark-env.sh.template @@ -62,6 +62,7 @@ # Generic options for the daemons used in the standalone deploy mode # - SPARK_CONF_DIR Alternate conf dir. (Default: ${SPARK_HOME}/conf) # - SPARK_LOG_DIR Where log files are stored. (Default: ${SPARK_HOME}/logs) +# - SPARK_LOG_MAX_FILES Max log files of Spark daemons can rotate to. Default is 5. # - SPARK_PID_DIR Where the pid file is stored. (Default: /tmp) # - SPARK_IDENT_STRING A string representing this instance of spark. (Default: $USER) # - SPARK_NICENESS The scheduling priority for daemons. (Default: 0) diff --git a/conf/slaves.template b/conf/workers.template similarity index 100% rename from conf/slaves.template rename to conf/workers.template diff --git a/core/benchmarks/CoalescedRDDBenchmark-jdk11-results.txt b/core/benchmarks/CoalescedRDDBenchmark-jdk11-results.txt index e944111ff9e93..10ac28b46091c 100644 --- a/core/benchmarks/CoalescedRDDBenchmark-jdk11-results.txt +++ b/core/benchmarks/CoalescedRDDBenchmark-jdk11-results.txt @@ -2,39 +2,39 @@ Coalesced RDD , large scale ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz -Coalesced RDD: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Coalesce Num Partitions: 100 Num Hosts: 1 344 360 14 0.3 3441.4 1.0X -Coalesce Num Partitions: 100 Num Hosts: 5 283 301 22 0.4 2825.1 1.2X -Coalesce Num Partitions: 100 Num Hosts: 10 270 271 2 0.4 2700.5 1.3X -Coalesce Num Partitions: 100 Num Hosts: 20 272 273 1 0.4 2721.1 1.3X -Coalesce Num Partitions: 100 Num Hosts: 40 271 272 1 0.4 2710.0 1.3X -Coalesce Num Partitions: 100 Num Hosts: 80 266 267 2 0.4 2656.3 1.3X -Coalesce Num Partitions: 500 Num Hosts: 1 609 619 15 0.2 6089.0 0.6X -Coalesce Num Partitions: 500 Num Hosts: 5 338 343 6 0.3 3383.0 1.0X -Coalesce Num Partitions: 500 Num Hosts: 10 303 306 3 0.3 3029.4 1.1X -Coalesce Num Partitions: 500 Num Hosts: 20 286 288 2 0.4 2855.9 1.2X -Coalesce Num Partitions: 500 Num Hosts: 40 279 282 4 0.4 2793.3 1.2X -Coalesce Num Partitions: 500 Num Hosts: 80 273 275 3 0.4 2725.9 1.3X -Coalesce Num Partitions: 1000 Num Hosts: 1 951 955 4 0.1 9514.1 0.4X -Coalesce Num Partitions: 1000 Num Hosts: 5 421 429 8 0.2 4211.3 0.8X -Coalesce Num Partitions: 1000 Num Hosts: 10 347 352 4 0.3 3473.5 1.0X -Coalesce Num Partitions: 1000 Num Hosts: 20 309 312 5 0.3 3087.5 1.1X -Coalesce Num Partitions: 1000 Num Hosts: 40 290 294 6 0.3 2896.4 1.2X -Coalesce Num Partitions: 1000 Num Hosts: 80 281 286 5 0.4 2811.3 1.2X -Coalesce Num Partitions: 5000 Num Hosts: 1 3928 3950 27 0.0 39278.0 0.1X -Coalesce Num Partitions: 5000 Num Hosts: 5 1373 1389 27 0.1 13725.2 0.3X -Coalesce Num Partitions: 5000 Num Hosts: 10 812 827 13 0.1 8123.3 0.4X -Coalesce Num Partitions: 5000 Num Hosts: 20 530 540 9 0.2 5299.1 0.6X -Coalesce Num Partitions: 5000 Num Hosts: 40 421 425 5 0.2 4210.5 0.8X -Coalesce Num Partitions: 5000 Num Hosts: 80 335 344 12 0.3 3353.7 1.0X -Coalesce Num Partitions: 10000 Num Hosts: 1 7116 7120 4 0.0 71159.0 0.0X -Coalesce Num Partitions: 10000 Num Hosts: 5 2539 2598 51 0.0 25390.1 0.1X -Coalesce Num Partitions: 10000 Num Hosts: 10 1393 1432 34 0.1 13928.1 0.2X -Coalesce Num Partitions: 10000 Num Hosts: 20 833 1009 303 0.1 8329.2 0.4X -Coalesce Num Partitions: 10000 Num Hosts: 40 562 563 3 0.2 5615.2 0.6X -Coalesce Num Partitions: 10000 Num Hosts: 80 420 426 7 0.2 4204.0 0.8X +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz +Coalesced RDD: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative +---------------------------------------------------------------------------------------------------------------------------- +Coalesce Num Partitions: 100 Num Hosts: 1 365 454 104 0.3 3652.8 1.0X +Coalesce Num Partitions: 100 Num Hosts: 5 271 374 90 0.4 2708.0 1.3X +Coalesce Num Partitions: 100 Num Hosts: 10 265 337 88 0.4 2651.9 1.4X +Coalesce Num Partitions: 100 Num Hosts: 20 277 338 87 0.4 2772.8 1.3X +Coalesce Num Partitions: 100 Num Hosts: 40 313 320 6 0.3 3127.8 1.2X +Coalesce Num Partitions: 100 Num Hosts: 80 291 330 60 0.3 2909.5 1.3X +Coalesce Num Partitions: 500 Num Hosts: 1 974 1035 59 0.1 9741.6 0.4X +Coalesce Num Partitions: 500 Num Hosts: 5 443 450 6 0.2 4427.7 0.8X +Coalesce Num Partitions: 500 Num Hosts: 10 382 455 64 0.3 3816.6 1.0X +Coalesce Num Partitions: 500 Num Hosts: 20 359 402 39 0.3 3589.9 1.0X +Coalesce Num Partitions: 500 Num Hosts: 40 317 350 54 0.3 3165.5 1.2X +Coalesce Num Partitions: 500 Num Hosts: 80 267 337 81 0.4 2668.5 1.4X +Coalesce Num Partitions: 1000 Num Hosts: 1 1621 1712 84 0.1 16205.9 0.2X +Coalesce Num Partitions: 1000 Num Hosts: 5 582 638 85 0.2 5817.7 0.6X +Coalesce Num Partitions: 1000 Num Hosts: 10 398 446 74 0.3 3980.8 0.9X +Coalesce Num Partitions: 1000 Num Hosts: 20 332 410 108 0.3 3315.1 1.1X +Coalesce Num Partitions: 1000 Num Hosts: 40 345 377 54 0.3 3453.1 1.1X +Coalesce Num Partitions: 1000 Num Hosts: 80 294 353 69 0.3 2940.5 1.2X +Coalesce Num Partitions: 5000 Num Hosts: 1 6818 6906 151 0.0 68183.8 0.1X +Coalesce Num Partitions: 5000 Num Hosts: 5 1606 1719 138 0.1 16061.1 0.2X +Coalesce Num Partitions: 5000 Num Hosts: 10 965 1031 94 0.1 9653.8 0.4X +Coalesce Num Partitions: 5000 Num Hosts: 20 643 722 98 0.2 6427.4 0.6X +Coalesce Num Partitions: 5000 Num Hosts: 40 445 517 97 0.2 4448.8 0.8X +Coalesce Num Partitions: 5000 Num Hosts: 80 369 432 93 0.3 3688.6 1.0X +Coalesce Num Partitions: 10000 Num Hosts: 1 12850 12953 90 0.0 128503.9 0.0X +Coalesce Num Partitions: 10000 Num Hosts: 5 3431 3463 49 0.0 34307.1 0.1X +Coalesce Num Partitions: 10000 Num Hosts: 10 1687 1795 106 0.1 16874.8 0.2X +Coalesce Num Partitions: 10000 Num Hosts: 20 1084 1125 58 0.1 10844.2 0.3X +Coalesce Num Partitions: 10000 Num Hosts: 40 667 722 73 0.1 6674.4 0.5X +Coalesce Num Partitions: 10000 Num Hosts: 80 488 542 82 0.2 4883.9 0.7X diff --git a/core/benchmarks/CoalescedRDDBenchmark-results.txt b/core/benchmarks/CoalescedRDDBenchmark-results.txt index f1b867951a074..829e43530dd5f 100644 --- a/core/benchmarks/CoalescedRDDBenchmark-results.txt +++ b/core/benchmarks/CoalescedRDDBenchmark-results.txt @@ -2,39 +2,39 @@ Coalesced RDD , large scale ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz -Coalesced RDD: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Coalesce Num Partitions: 100 Num Hosts: 1 395 401 9 0.3 3952.3 1.0X -Coalesce Num Partitions: 100 Num Hosts: 5 296 344 42 0.3 2963.2 1.3X -Coalesce Num Partitions: 100 Num Hosts: 10 294 308 15 0.3 2941.7 1.3X -Coalesce Num Partitions: 100 Num Hosts: 20 316 328 13 0.3 3155.2 1.3X -Coalesce Num Partitions: 100 Num Hosts: 40 294 316 36 0.3 2940.3 1.3X -Coalesce Num Partitions: 100 Num Hosts: 80 292 324 30 0.3 2922.2 1.4X -Coalesce Num Partitions: 500 Num Hosts: 1 629 687 61 0.2 6292.4 0.6X -Coalesce Num Partitions: 500 Num Hosts: 5 354 378 42 0.3 3541.7 1.1X -Coalesce Num Partitions: 500 Num Hosts: 10 318 338 29 0.3 3179.8 1.2X -Coalesce Num Partitions: 500 Num Hosts: 20 306 317 11 0.3 3059.2 1.3X -Coalesce Num Partitions: 500 Num Hosts: 40 294 311 28 0.3 2941.6 1.3X -Coalesce Num Partitions: 500 Num Hosts: 80 288 309 34 0.3 2883.9 1.4X -Coalesce Num Partitions: 1000 Num Hosts: 1 956 978 20 0.1 9562.2 0.4X -Coalesce Num Partitions: 1000 Num Hosts: 5 431 452 36 0.2 4306.2 0.9X -Coalesce Num Partitions: 1000 Num Hosts: 10 358 379 23 0.3 3581.1 1.1X -Coalesce Num Partitions: 1000 Num Hosts: 20 324 347 20 0.3 3236.7 1.2X -Coalesce Num Partitions: 1000 Num Hosts: 40 312 333 20 0.3 3116.8 1.3X -Coalesce Num Partitions: 1000 Num Hosts: 80 307 342 32 0.3 3068.4 1.3X -Coalesce Num Partitions: 5000 Num Hosts: 1 3895 3906 12 0.0 38946.8 0.1X -Coalesce Num Partitions: 5000 Num Hosts: 5 1388 1401 19 0.1 13881.7 0.3X -Coalesce Num Partitions: 5000 Num Hosts: 10 806 839 57 0.1 8063.7 0.5X -Coalesce Num Partitions: 5000 Num Hosts: 20 546 573 44 0.2 5462.6 0.7X -Coalesce Num Partitions: 5000 Num Hosts: 40 413 418 5 0.2 4134.7 1.0X -Coalesce Num Partitions: 5000 Num Hosts: 80 345 365 23 0.3 3448.1 1.1X -Coalesce Num Partitions: 10000 Num Hosts: 1 6933 6966 55 0.0 69328.8 0.1X -Coalesce Num Partitions: 10000 Num Hosts: 5 2455 2499 69 0.0 24551.7 0.2X -Coalesce Num Partitions: 10000 Num Hosts: 10 1352 1392 34 0.1 13520.2 0.3X -Coalesce Num Partitions: 10000 Num Hosts: 20 815 853 50 0.1 8147.5 0.5X -Coalesce Num Partitions: 10000 Num Hosts: 40 558 581 28 0.2 5578.0 0.7X -Coalesce Num Partitions: 10000 Num Hosts: 80 416 423 5 0.2 4163.3 0.9X +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz +Coalesced RDD: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative +---------------------------------------------------------------------------------------------------------------------------- +Coalesce Num Partitions: 100 Num Hosts: 1 394 423 25 0.3 3942.7 1.0X +Coalesce Num Partitions: 100 Num Hosts: 5 317 339 23 0.3 3171.6 1.2X +Coalesce Num Partitions: 100 Num Hosts: 10 310 324 20 0.3 3095.9 1.3X +Coalesce Num Partitions: 100 Num Hosts: 20 285 292 8 0.4 2849.0 1.4X +Coalesce Num Partitions: 100 Num Hosts: 40 271 292 22 0.4 2712.7 1.5X +Coalesce Num Partitions: 100 Num Hosts: 80 287 300 18 0.3 2874.2 1.4X +Coalesce Num Partitions: 500 Num Hosts: 1 839 872 33 0.1 8388.1 0.5X +Coalesce Num Partitions: 500 Num Hosts: 5 389 395 5 0.3 3892.4 1.0X +Coalesce Num Partitions: 500 Num Hosts: 10 352 356 3 0.3 3522.0 1.1X +Coalesce Num Partitions: 500 Num Hosts: 20 315 322 11 0.3 3145.0 1.3X +Coalesce Num Partitions: 500 Num Hosts: 40 304 324 22 0.3 3036.4 1.3X +Coalesce Num Partitions: 500 Num Hosts: 80 286 301 23 0.4 2855.7 1.4X +Coalesce Num Partitions: 1000 Num Hosts: 1 1390 1422 28 0.1 13898.0 0.3X +Coalesce Num Partitions: 1000 Num Hosts: 5 535 562 26 0.2 5347.4 0.7X +Coalesce Num Partitions: 1000 Num Hosts: 10 419 425 8 0.2 4193.8 0.9X +Coalesce Num Partitions: 1000 Num Hosts: 20 358 364 9 0.3 3575.8 1.1X +Coalesce Num Partitions: 1000 Num Hosts: 40 323 329 5 0.3 3234.8 1.2X +Coalesce Num Partitions: 1000 Num Hosts: 80 306 316 11 0.3 3060.3 1.3X +Coalesce Num Partitions: 5000 Num Hosts: 1 5967 6744 1289 0.0 59666.6 0.1X +Coalesce Num Partitions: 5000 Num Hosts: 5 2010 2032 19 0.0 20104.1 0.2X +Coalesce Num Partitions: 5000 Num Hosts: 10 1132 1161 25 0.1 11324.9 0.3X +Coalesce Num Partitions: 5000 Num Hosts: 20 687 714 39 0.1 6874.2 0.6X +Coalesce Num Partitions: 5000 Num Hosts: 40 507 511 3 0.2 5070.1 0.8X +Coalesce Num Partitions: 5000 Num Hosts: 80 375 383 12 0.3 3749.7 1.1X +Coalesce Num Partitions: 10000 Num Hosts: 1 10782 10833 63 0.0 107816.6 0.0X +Coalesce Num Partitions: 10000 Num Hosts: 5 3819 3901 72 0.0 38185.3 0.1X +Coalesce Num Partitions: 10000 Num Hosts: 10 2021 2030 12 0.0 20212.9 0.2X +Coalesce Num Partitions: 10000 Num Hosts: 20 1138 1168 44 0.1 11378.0 0.3X +Coalesce Num Partitions: 10000 Num Hosts: 40 716 723 9 0.1 7157.2 0.6X +Coalesce Num Partitions: 10000 Num Hosts: 80 504 514 9 0.2 5039.9 0.8X diff --git a/core/benchmarks/KryoBenchmark-jdk11-results.txt b/core/benchmarks/KryoBenchmark-jdk11-results.txt index 27f0b8f59f47a..22b776c6808c8 100644 --- a/core/benchmarks/KryoBenchmark-jdk11-results.txt +++ b/core/benchmarks/KryoBenchmark-jdk11-results.txt @@ -2,27 +2,27 @@ Benchmark Kryo Unsafe vs safe Serialization ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz Benchmark Kryo Unsafe vs safe Serialization: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -basicTypes: Int with unsafe:true 275 288 14 3.6 275.2 1.0X -basicTypes: Long with unsafe:true 331 336 13 3.0 330.9 0.8X -basicTypes: Float with unsafe:true 304 305 1 3.3 304.4 0.9X -basicTypes: Double with unsafe:true 328 332 3 3.0 328.1 0.8X -Array: Int with unsafe:true 4 4 0 252.8 4.0 69.6X -Array: Long with unsafe:true 6 6 0 161.5 6.2 44.5X -Array: Float with unsafe:true 4 4 0 264.6 3.8 72.8X -Array: Double with unsafe:true 6 7 0 160.5 6.2 44.2X -Map of string->Double with unsafe:true 52 52 0 19.3 51.8 5.3X -basicTypes: Int with unsafe:false 344 345 1 2.9 344.3 0.8X -basicTypes: Long with unsafe:false 372 373 1 2.7 372.3 0.7X -basicTypes: Float with unsafe:false 333 334 1 3.0 333.4 0.8X -basicTypes: Double with unsafe:false 344 345 0 2.9 344.3 0.8X -Array: Int with unsafe:false 25 25 0 40.8 24.5 11.2X -Array: Long with unsafe:false 37 37 1 27.3 36.7 7.5X -Array: Float with unsafe:false 11 11 0 92.1 10.9 25.4X -Array: Double with unsafe:false 17 18 0 58.3 17.2 16.0X -Map of string->Double with unsafe:false 51 52 1 19.4 51.5 5.3X +--------------------------------------------------------------------------------------------------------------------------- +basicTypes: Int with unsafe:true 331 346 11 3.0 330.7 1.0X +basicTypes: Long with unsafe:true 392 401 9 2.6 392.0 0.8X +basicTypes: Float with unsafe:true 394 404 9 2.5 394.5 0.8X +basicTypes: Double with unsafe:true 404 414 7 2.5 404.0 0.8X +Array: Int with unsafe:true 5 6 1 195.3 5.1 64.6X +Array: Long with unsafe:true 8 9 1 124.1 8.1 41.0X +Array: Float with unsafe:true 5 6 1 186.1 5.4 61.5X +Array: Double with unsafe:true 8 9 1 126.1 7.9 41.7X +Map of string->Double with unsafe:true 54 59 4 18.4 54.4 6.1X +basicTypes: Int with unsafe:false 417 428 8 2.4 416.6 0.8X +basicTypes: Long with unsafe:false 452 466 9 2.2 451.8 0.7X +basicTypes: Float with unsafe:false 410 421 6 2.4 410.0 0.8X +basicTypes: Double with unsafe:false 429 444 10 2.3 429.2 0.8X +Array: Int with unsafe:false 25 27 2 39.2 25.5 13.0X +Array: Long with unsafe:false 40 43 2 25.0 40.0 8.3X +Array: Float with unsafe:false 11 12 1 90.7 11.0 30.0X +Array: Double with unsafe:false 18 20 1 54.2 18.5 17.9X +Map of string->Double with unsafe:false 55 59 2 18.0 55.5 6.0X diff --git a/core/benchmarks/KryoBenchmark-results.txt b/core/benchmarks/KryoBenchmark-results.txt index 49791e6e87e3a..5c38ff9cabe0e 100644 --- a/core/benchmarks/KryoBenchmark-results.txt +++ b/core/benchmarks/KryoBenchmark-results.txt @@ -2,27 +2,27 @@ Benchmark Kryo Unsafe vs safe Serialization ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz Benchmark Kryo Unsafe vs safe Serialization: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -basicTypes: Int with unsafe:true 269 290 23 3.7 269.0 1.0X -basicTypes: Long with unsafe:true 294 295 1 3.4 293.8 0.9X -basicTypes: Float with unsafe:true 300 301 1 3.3 300.4 0.9X -basicTypes: Double with unsafe:true 304 305 1 3.3 304.0 0.9X -Array: Int with unsafe:true 5 6 1 193.5 5.2 52.0X -Array: Long with unsafe:true 8 9 1 131.2 7.6 35.3X -Array: Float with unsafe:true 6 6 0 163.5 6.1 44.0X -Array: Double with unsafe:true 9 10 0 108.8 9.2 29.3X -Map of string->Double with unsafe:true 54 54 1 18.7 53.6 5.0X -basicTypes: Int with unsafe:false 326 327 1 3.1 326.2 0.8X -basicTypes: Long with unsafe:false 353 354 1 2.8 353.3 0.8X -basicTypes: Float with unsafe:false 325 327 1 3.1 325.1 0.8X -basicTypes: Double with unsafe:false 335 336 1 3.0 335.0 0.8X -Array: Int with unsafe:false 27 28 1 36.7 27.2 9.9X -Array: Long with unsafe:false 40 41 1 25.0 40.0 6.7X -Array: Float with unsafe:false 12 13 1 80.8 12.4 21.7X -Array: Double with unsafe:false 21 21 1 48.6 20.6 13.1X -Map of string->Double with unsafe:false 56 57 1 17.8 56.1 4.8X +--------------------------------------------------------------------------------------------------------------------------- +basicTypes: Int with unsafe:true 286 295 6 3.5 285.6 1.0X +basicTypes: Long with unsafe:true 320 327 5 3.1 319.8 0.9X +basicTypes: Float with unsafe:true 314 318 2 3.2 313.5 0.9X +basicTypes: Double with unsafe:true 310 319 6 3.2 309.9 0.9X +Array: Int with unsafe:true 5 6 1 217.9 4.6 62.2X +Array: Long with unsafe:true 8 9 1 121.5 8.2 34.7X +Array: Float with unsafe:true 5 6 0 217.5 4.6 62.1X +Array: Double with unsafe:true 9 9 1 117.3 8.5 33.5X +Map of string->Double with unsafe:true 51 52 1 19.7 50.9 5.6X +basicTypes: Int with unsafe:false 373 384 12 2.7 373.3 0.8X +basicTypes: Long with unsafe:false 373 391 9 2.7 372.6 0.8X +basicTypes: Float with unsafe:false 349 362 11 2.9 349.2 0.8X +basicTypes: Double with unsafe:false 358 372 10 2.8 358.0 0.8X +Array: Int with unsafe:false 25 29 1 40.0 25.0 11.4X +Array: Long with unsafe:false 35 39 1 28.2 35.5 8.1X +Array: Float with unsafe:false 10 12 1 100.2 10.0 28.6X +Array: Double with unsafe:false 17 20 1 58.3 17.1 16.7X +Map of string->Double with unsafe:false 48 53 2 20.6 48.5 5.9X diff --git a/core/benchmarks/KryoSerializerBenchmark-jdk11-results.txt b/core/benchmarks/KryoSerializerBenchmark-jdk11-results.txt index 6b148bde12d36..41ac5386754a4 100644 --- a/core/benchmarks/KryoSerializerBenchmark-jdk11-results.txt +++ b/core/benchmarks/KryoSerializerBenchmark-jdk11-results.txt @@ -2,11 +2,11 @@ Benchmark KryoPool vs old"pool of 1" implementation ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz Benchmark KryoPool vs old"pool of 1" implementation: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -KryoPool:true 6208 8374 NaN 0.0 12416876.6 1.0X -KryoPool:false 9084 11577 724 0.0 18168947.4 0.7X +----------------------------------------------------------------------------------------------------------------------------------- +KryoPool:true 10053 13422 983 0.0 20106810.4 1.0X +KryoPool:false 16854 19164 NaN 0.0 33708260.0 0.6X diff --git a/core/benchmarks/KryoSerializerBenchmark-results.txt b/core/benchmarks/KryoSerializerBenchmark-results.txt index 609f3298cbc00..c10f7dc415982 100644 --- a/core/benchmarks/KryoSerializerBenchmark-results.txt +++ b/core/benchmarks/KryoSerializerBenchmark-results.txt @@ -2,11 +2,11 @@ Benchmark KryoPool vs old"pool of 1" implementation ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz Benchmark KryoPool vs old"pool of 1" implementation: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -KryoPool:true 6012 7586 NaN 0.0 12023020.2 1.0X -KryoPool:false 9289 11566 909 0.0 18578683.1 0.6X +----------------------------------------------------------------------------------------------------------------------------------- +KryoPool:true 7893 10556 NaN 0.0 15785307.8 1.0X +KryoPool:false 12778 15741 426 0.0 25555753.8 0.6X diff --git a/core/benchmarks/MapStatusesSerDeserBenchmark-jdk11-results.txt b/core/benchmarks/MapStatusesSerDeserBenchmark-jdk11-results.txt index db23cf5c12ea7..29699a2fdcf2a 100644 --- a/core/benchmarks/MapStatusesSerDeserBenchmark-jdk11-results.txt +++ b/core/benchmarks/MapStatusesSerDeserBenchmark-jdk11-results.txt @@ -1,64 +1,64 @@ -OpenJDK 64-Bit Server VM 11.0.4+11-post-Ubuntu-1ubuntu218.04.3 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz 200000 MapOutputs, 10 blocks w/ broadcast: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Serialization 170 178 9 1.2 849.7 1.0X -Deserialization 530 535 9 0.4 2651.1 0.3X +------------------------------------------------------------------------------------------------------------------------- +Serialization 179 194 9 1.1 897.4 1.0X +Deserialization 254 321 74 0.8 1271.0 0.7X -Compressed Serialized MapStatus sizes: 411 bytes +Compressed Serialized MapStatus sizes: 409 bytes Compressed Serialized Broadcast MapStatus sizes: 2 MB -OpenJDK 64-Bit Server VM 11.0.4+11-post-Ubuntu-1ubuntu218.04.3 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz 200000 MapOutputs, 10 blocks w/o broadcast: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Serialization 157 165 7 1.3 785.4 1.0X -Deserialization 495 588 79 0.4 2476.7 0.3X +-------------------------------------------------------------------------------------------------------------------------- +Serialization 160 166 7 1.2 801.2 1.0X +Deserialization 256 323 69 0.8 1278.9 0.6X Compressed Serialized MapStatus sizes: 2 MB Compressed Serialized Broadcast MapStatus sizes: 0 bytes -OpenJDK 64-Bit Server VM 11.0.4+11-post-Ubuntu-1ubuntu218.04.3 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz 200000 MapOutputs, 100 blocks w/ broadcast: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Serialization 344 351 4 0.6 1720.4 1.0X -Deserialization 527 579 99 0.4 2635.9 0.7X +-------------------------------------------------------------------------------------------------------------------------- +Serialization 341 349 7 0.6 1707.3 1.0X +Deserialization 286 370 84 0.7 1431.4 1.2X -Compressed Serialized MapStatus sizes: 427 bytes +Compressed Serialized MapStatus sizes: 426 bytes Compressed Serialized Broadcast MapStatus sizes: 13 MB -OpenJDK 64-Bit Server VM 11.0.4+11-post-Ubuntu-1ubuntu218.04.3 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz 200000 MapOutputs, 100 blocks w/o broadcast: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Serialization 317 321 4 0.6 1583.8 1.0X -Deserialization 530 540 15 0.4 2648.3 0.6X +--------------------------------------------------------------------------------------------------------------------------- +Serialization 309 319 11 0.6 1543.6 1.0X +Deserialization 286 373 117 0.7 1429.5 1.1X Compressed Serialized MapStatus sizes: 13 MB Compressed Serialized Broadcast MapStatus sizes: 0 bytes -OpenJDK 64-Bit Server VM 11.0.4+11-post-Ubuntu-1ubuntu218.04.3 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz 200000 MapOutputs, 1000 blocks w/ broadcast: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Serialization 1738 1849 156 0.1 8692.0 1.0X -Deserialization 946 977 33 0.2 4730.2 1.8X +--------------------------------------------------------------------------------------------------------------------------- +Serialization 1619 1627 12 0.1 8092.6 1.0X +Deserialization 864 883 26 0.2 4319.9 1.9X -Compressed Serialized MapStatus sizes: 556 bytes +Compressed Serialized MapStatus sizes: 557 bytes Compressed Serialized Broadcast MapStatus sizes: 121 MB -OpenJDK 64-Bit Server VM 11.0.4+11-post-Ubuntu-1ubuntu218.04.3 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz 200000 MapOutputs, 1000 blocks w/o broadcast: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Serialization 1379 1432 76 0.1 6892.6 1.0X -Deserialization 929 941 19 0.2 4645.5 1.5X +---------------------------------------------------------------------------------------------------------------------------- +Serialization 1449 1456 9 0.1 7246.8 1.0X +Deserialization 853 888 46 0.2 4263.7 1.7X Compressed Serialized MapStatus sizes: 121 MB Compressed Serialized Broadcast MapStatus sizes: 0 bytes diff --git a/core/benchmarks/MapStatusesSerDeserBenchmark-results.txt b/core/benchmarks/MapStatusesSerDeserBenchmark-results.txt index 053f4bf771923..96fa3a01a8f6d 100644 --- a/core/benchmarks/MapStatusesSerDeserBenchmark-results.txt +++ b/core/benchmarks/MapStatusesSerDeserBenchmark-results.txt @@ -1,64 +1,64 @@ -OpenJDK 64-Bit Server VM 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz 200000 MapOutputs, 10 blocks w/ broadcast: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Serialization 178 187 15 1.1 887.5 1.0X -Deserialization 530 558 32 0.4 2647.5 0.3X +------------------------------------------------------------------------------------------------------------------------- +Serialization 135 161 56 1.5 673.9 1.0X +Deserialization 213 235 26 0.9 1065.6 0.6X -Compressed Serialized MapStatus sizes: 411 bytes +Compressed Serialized MapStatus sizes: 409 bytes Compressed Serialized Broadcast MapStatus sizes: 2 MB -OpenJDK 64-Bit Server VM 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz 200000 MapOutputs, 10 blocks w/o broadcast: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Serialization 167 175 7 1.2 835.7 1.0X -Deserialization 523 537 22 0.4 2616.2 0.3X +-------------------------------------------------------------------------------------------------------------------------- +Serialization 130 137 5 1.5 650.8 1.0X +Deserialization 211 230 20 0.9 1056.5 0.6X Compressed Serialized MapStatus sizes: 2 MB Compressed Serialized Broadcast MapStatus sizes: 0 bytes -OpenJDK 64-Bit Server VM 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz 200000 MapOutputs, 100 blocks w/ broadcast: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Serialization 351 416 147 0.6 1754.4 1.0X -Deserialization 546 551 8 0.4 2727.6 0.6X +-------------------------------------------------------------------------------------------------------------------------- +Serialization 281 324 86 0.7 1406.7 1.0X +Deserialization 240 267 32 0.8 1200.5 1.2X -Compressed Serialized MapStatus sizes: 427 bytes +Compressed Serialized MapStatus sizes: 426 bytes Compressed Serialized Broadcast MapStatus sizes: 13 MB -OpenJDK 64-Bit Server VM 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz 200000 MapOutputs, 100 blocks w/o broadcast: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Serialization 320 321 1 0.6 1598.0 1.0X -Deserialization 542 549 7 0.4 2709.0 0.6X +--------------------------------------------------------------------------------------------------------------------------- +Serialization 265 273 6 0.8 1324.5 1.0X +Deserialization 247 276 33 0.8 1236.1 1.1X Compressed Serialized MapStatus sizes: 13 MB Compressed Serialized Broadcast MapStatus sizes: 0 bytes -OpenJDK 64-Bit Server VM 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz 200000 MapOutputs, 1000 blocks w/ broadcast: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Serialization 1671 1877 290 0.1 8357.3 1.0X -Deserialization 943 970 32 0.2 4715.8 1.8X +--------------------------------------------------------------------------------------------------------------------------- +Serialization 1333 1592 366 0.2 6666.0 1.0X +Deserialization 560 585 22 0.4 2799.1 2.4X -Compressed Serialized MapStatus sizes: 556 bytes +Compressed Serialized MapStatus sizes: 558 bytes Compressed Serialized Broadcast MapStatus sizes: 121 MB -OpenJDK 64-Bit Server VM 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz 200000 MapOutputs, 1000 blocks w/o broadcast: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------- -Serialization 1373 1436 89 0.1 6865.0 1.0X -Deserialization 940 970 37 0.2 4699.1 1.5X +---------------------------------------------------------------------------------------------------------------------------- +Serialization 1222 1260 54 0.2 6111.7 1.0X +Deserialization 539 568 42 0.4 2695.3 2.3X Compressed Serialized MapStatus sizes: 121 MB Compressed Serialized Broadcast MapStatus sizes: 0 bytes diff --git a/core/benchmarks/PropertiesCloneBenchmark-jdk11-results.txt b/core/benchmarks/PropertiesCloneBenchmark-jdk11-results.txt index 605b856d53382..f1d6b1ff372bc 100644 --- a/core/benchmarks/PropertiesCloneBenchmark-jdk11-results.txt +++ b/core/benchmarks/PropertiesCloneBenchmark-jdk11-results.txt @@ -2,39 +2,39 @@ Properties Cloning ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz Empty Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -SerializationUtils.clone 0 0 0 0.1 11539.0 1.0X -Utils.cloneProperties 0 0 0 1.7 572.0 20.2X +SerializationUtils.clone 0 0 0 0.2 4800.0 1.0X +Utils.cloneProperties 0 0 0 Infinity 0.0 InfinityX -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz System Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -SerializationUtils.clone 0 0 0 0.0 217514.0 1.0X -Utils.cloneProperties 0 0 0 0.2 5387.0 40.4X +SerializationUtils.clone 0 0 0 0.0 202203.0 1.0X +Utils.cloneProperties 0 0 0 0.1 6700.0 30.2X -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz Small Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -SerializationUtils.clone 1 1 0 0.0 634574.0 1.0X -Utils.cloneProperties 0 0 0 0.3 3082.0 205.9X +SerializationUtils.clone 1 1 0 0.0 588099.0 1.0X +Utils.cloneProperties 0 0 0 0.2 5699.0 103.2X -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz Medium Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -SerializationUtils.clone 3 3 0 0.0 2576565.0 1.0X -Utils.cloneProperties 0 0 0 0.1 16071.0 160.3X +SerializationUtils.clone 2 3 0 0.0 2357927.0 1.0X +Utils.cloneProperties 0 0 0 0.0 31901.0 73.9X -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz Large Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -SerializationUtils.clone 5 5 0 0.0 5027248.0 1.0X -Utils.cloneProperties 0 0 0 0.0 31842.0 157.9X +SerializationUtils.clone 5 5 0 0.0 4636068.0 1.0X +Utils.cloneProperties 0 0 0 0.0 64701.0 71.7X diff --git a/core/benchmarks/PropertiesCloneBenchmark-results.txt b/core/benchmarks/PropertiesCloneBenchmark-results.txt index 5d332a147c698..81ccff6e638c8 100644 --- a/core/benchmarks/PropertiesCloneBenchmark-results.txt +++ b/core/benchmarks/PropertiesCloneBenchmark-results.txt @@ -2,39 +2,39 @@ Properties Cloning ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz Empty Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -SerializationUtils.clone 0 0 0 0.1 13640.0 1.0X -Utils.cloneProperties 0 0 0 1.6 608.0 22.4X +SerializationUtils.clone 0 0 0 0.2 5599.0 1.0X +Utils.cloneProperties 0 0 0 Infinity 0.0 InfinityX -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz System Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -SerializationUtils.clone 0 0 0 0.0 238968.0 1.0X -Utils.cloneProperties 0 0 0 0.4 2318.0 103.1X +SerializationUtils.clone 0 0 0 0.0 339506.0 1.0X +Utils.cloneProperties 0 0 0 0.5 1900.0 178.7X -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz Small Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -SerializationUtils.clone 1 1 0 0.0 725849.0 1.0X -Utils.cloneProperties 0 0 0 0.3 2900.0 250.3X +SerializationUtils.clone 1 1 0 0.0 604411.0 1.0X +Utils.cloneProperties 0 0 0 0.2 5100.0 118.5X -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz Medium Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -SerializationUtils.clone 3 3 0 0.0 2999676.0 1.0X -Utils.cloneProperties 0 0 0 0.1 11734.0 255.6X +SerializationUtils.clone 2 2 0 0.0 2378345.0 1.0X +Utils.cloneProperties 0 0 0 0.0 25100.0 94.8X -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz Large Properties: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -SerializationUtils.clone 6 6 1 0.0 5846410.0 1.0X -Utils.cloneProperties 0 0 0 0.0 22405.0 260.9X +SerializationUtils.clone 4 4 0 0.0 4035677.0 1.0X +Utils.cloneProperties 0 0 0 0.0 43300.0 93.2X diff --git a/core/benchmarks/XORShiftRandomBenchmark-jdk11-results.txt b/core/benchmarks/XORShiftRandomBenchmark-jdk11-results.txt index 9aa10e4835a2f..0b13462c59b51 100644 --- a/core/benchmarks/XORShiftRandomBenchmark-jdk11-results.txt +++ b/core/benchmarks/XORShiftRandomBenchmark-jdk11-results.txt @@ -2,43 +2,43 @@ Pseudo random ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz nextInt: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -java.util.Random 1362 1362 0 73.4 13.6 1.0X -XORShiftRandom 227 227 0 440.6 2.3 6.0X +java.util.Random 1414 1423 10 70.7 14.1 1.0X +XORShiftRandom 234 238 3 426.9 2.3 6.0X -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz nextLong: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -java.util.Random 2725 2726 1 36.7 27.3 1.0X -XORShiftRandom 694 694 1 144.1 6.9 3.9X +java.util.Random 2669 2699 26 37.5 26.7 1.0X +XORShiftRandom 622 633 12 160.7 6.2 4.3X -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz nextDouble: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -java.util.Random 2727 2728 0 36.7 27.3 1.0X -XORShiftRandom 693 694 0 144.2 6.9 3.9X +java.util.Random 2613 2712 98 38.3 26.1 1.0X +XORShiftRandom 667 675 7 149.9 6.7 3.9X -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz nextGaussian: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -java.util.Random 7012 7016 4 14.3 70.1 1.0X -XORShiftRandom 6065 6067 1 16.5 60.7 1.2X +java.util.Random 6687 6757 61 15.0 66.9 1.0X +XORShiftRandom 4882 4892 9 20.5 48.8 1.4X ================================================================================================ hash seed ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.4+11-LTS on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz Hash seed: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -XORShiftRandom.hashSeed 36 37 1 276.5 3.6 1.0X +XORShiftRandom.hashSeed 40 42 3 247.4 4.0 1.0X diff --git a/core/benchmarks/XORShiftRandomBenchmark-results.txt b/core/benchmarks/XORShiftRandomBenchmark-results.txt index 4b069878b2e9b..87093eaabd7ea 100644 --- a/core/benchmarks/XORShiftRandomBenchmark-results.txt +++ b/core/benchmarks/XORShiftRandomBenchmark-results.txt @@ -2,43 +2,43 @@ Pseudo random ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz nextInt: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -java.util.Random 1362 1396 59 73.4 13.6 1.0X -XORShiftRandom 227 227 0 440.7 2.3 6.0X +java.util.Random 1192 1217 24 83.9 11.9 1.0X +XORShiftRandom 193 196 4 518.9 1.9 6.2X -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz nextLong: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -java.util.Random 2732 2732 1 36.6 27.3 1.0X -XORShiftRandom 630 630 1 158.7 6.3 4.3X +java.util.Random 2391 2402 10 41.8 23.9 1.0X +XORShiftRandom 518 528 11 193.1 5.2 4.6X -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz nextDouble: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -java.util.Random 2731 2732 1 36.6 27.3 1.0X -XORShiftRandom 630 630 0 158.8 6.3 4.3X +java.util.Random 2318 2363 39 43.1 23.2 1.0X +XORShiftRandom 488 496 13 205.0 4.9 4.8X -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz nextGaussian: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -java.util.Random 8895 8899 4 11.2 88.9 1.0X -XORShiftRandom 5049 5052 5 19.8 50.5 1.8X +java.util.Random 6102 6156 77 16.4 61.0 1.0X +XORShiftRandom 3685 3758 84 27.1 36.9 1.7X ================================================================================================ hash seed ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_222-b10 on Linux 3.10.0-862.3.2.el7.x86_64 -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz Hash seed: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -XORShiftRandom.hashSeed 67 68 1 148.8 6.7 1.0X +XORShiftRandom.hashSeed 65 66 2 155.0 6.5 1.0X diff --git a/core/benchmarks/ZStandardBenchmark-jdk11-results.txt b/core/benchmarks/ZStandardBenchmark-jdk11-results.txt new file mode 100644 index 0000000000000..3895e7bb6f27d --- /dev/null +++ b/core/benchmarks/ZStandardBenchmark-jdk11-results.txt @@ -0,0 +1,27 @@ +================================================================================================ +Benchmark ZStandardCompressionCodec +================================================================================================ + +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz +Benchmark ZStandardCompressionCodec: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative +-------------------------------------------------------------------------------------------------------------------------------------- +Compression 10000 times at level 1 without buffer pool 606 614 6 0.0 60645.3 1.0X +Compression 10000 times at level 2 without buffer pool 686 693 7 0.0 68594.9 0.9X +Compression 10000 times at level 3 without buffer pool 906 920 14 0.0 90642.7 0.7X +Compression 10000 times at level 1 with buffer pool 389 403 20 0.0 38901.4 1.6X +Compression 10000 times at level 2 with buffer pool 450 466 13 0.0 45032.0 1.3X +Compression 10000 times at level 3 with buffer pool 680 682 2 0.0 68004.2 0.9X + +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz +Benchmark ZStandardCompressionCodec: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative +------------------------------------------------------------------------------------------------------------------------------------------ +Decompression 10000 times from level 1 without buffer pool 1209 1226 25 0.0 120862.8 1.0X +Decompression 10000 times from level 2 without buffer pool 1191 1193 3 0.0 119064.9 1.0X +Decompression 10000 times from level 3 without buffer pool 1188 1193 6 0.0 118843.3 1.0X +Decompression 10000 times from level 1 with buffer pool 998 1004 9 0.0 99754.7 1.2X +Decompression 10000 times from level 2 with buffer pool 990 1001 11 0.0 99043.8 1.2X +Decompression 10000 times from level 3 with buffer pool 983 999 20 0.0 98269.5 1.2X + + diff --git a/core/benchmarks/ZStandardBenchmark-results.txt b/core/benchmarks/ZStandardBenchmark-results.txt new file mode 100644 index 0000000000000..6990c28690072 --- /dev/null +++ b/core/benchmarks/ZStandardBenchmark-results.txt @@ -0,0 +1,27 @@ +================================================================================================ +Benchmark ZStandardCompressionCodec +================================================================================================ + +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz +Benchmark ZStandardCompressionCodec: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative +-------------------------------------------------------------------------------------------------------------------------------------- +Compression 10000 times at level 1 without buffer pool 670 681 9 0.0 67011.0 1.0X +Compression 10000 times at level 2 without buffer pool 569 571 2 0.0 56932.0 1.2X +Compression 10000 times at level 3 without buffer pool 748 751 2 0.0 74813.8 0.9X +Compression 10000 times at level 1 with buffer pool 336 337 1 0.0 33630.6 2.0X +Compression 10000 times at level 2 with buffer pool 395 397 2 0.0 39472.6 1.7X +Compression 10000 times at level 3 with buffer pool 563 567 4 0.0 56272.8 1.2X + +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz +Benchmark ZStandardCompressionCodec: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative +------------------------------------------------------------------------------------------------------------------------------------------ +Decompression 10000 times from level 1 without buffer pool 1029 1031 3 0.0 102887.4 1.0X +Decompression 10000 times from level 2 without buffer pool 1028 1031 4 0.0 102847.8 1.0X +Decompression 10000 times from level 3 without buffer pool 1029 1029 0 0.0 102941.0 1.0X +Decompression 10000 times from level 1 with buffer pool 798 799 0 0.0 79838.0 1.3X +Decompression 10000 times from level 2 with buffer pool 799 799 0 0.0 79852.9 1.3X +Decompression 10000 times from level 3 with buffer pool 796 798 2 0.0 79630.5 1.3X + + diff --git a/core/pom.xml b/core/pom.xml index b0f68880f1d8a..ec80807f880e2 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -21,7 +21,7 @@ org.apache.spark spark-parent_2.12 - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml @@ -35,10 +35,6 @@ - - com.thoughtworks.paranamer - paranamer - org.apache.avro avro @@ -46,7 +42,6 @@ org.apache.avro avro-mapred - ${avro.mapred.classifier} com.google.guava @@ -66,7 +61,13 @@ org.apache.hadoop - hadoop-client + ${hadoop-client-api.artifact} + ${hadoop.version} + + + org.apache.hadoop + ${hadoop-client-runtime.artifact} + ${hadoop.version} org.apache.spark @@ -161,9 +162,13 @@ compile - javax.servlet - javax.servlet-api - ${javaxservlet.version} + jakarta.servlet + jakarta.servlet-api + ${jakartaservlet.version} + + + commons-codec + commons-codec org.apache.commons @@ -177,6 +182,14 @@ org.apache.commons commons-text + + commons-io + commons-io + + + commons-collections + commons-collections + com.google.code.findbugs jsr305 @@ -334,7 +347,7 @@ org.seleniumhq.selenium - selenium-htmlunit-driver + htmlunit-driver test @@ -414,7 +427,7 @@ net.sf.py4j py4j - 0.10.9 + 0.10.9.2 org.apache.spark @@ -447,6 +460,47 @@ test + + org.apache.hadoop + hadoop-aws + ${hadoop.version} + test + + + org.apache.hadoop + hadoop-common + + + commons-logging + commons-logging + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-core-asl + + + com.fasterxml.jackson.core + jackson-core + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.core + jackson-annotations + + + + com.amazonaws + aws-java-sdk + + + org.apache.commons commons-crypto diff --git a/core/src/main/java/org/apache/spark/SparkFirehoseListener.java b/core/src/main/java/org/apache/spark/SparkFirehoseListener.java index 731f6fc767dfd..7cb2455affe48 100644 --- a/core/src/main/java/org/apache/spark/SparkFirehoseListener.java +++ b/core/src/main/java/org/apache/spark/SparkFirehoseListener.java @@ -17,6 +17,7 @@ package org.apache.spark; +import org.apache.spark.annotation.DeveloperApi; import org.apache.spark.scheduler.*; /** @@ -27,7 +28,11 @@ * new methods to SparkListener: forgetting to add a method will result in a compilation error (if * this was a concrete Scala class, default implementations of new event handlers would be inherited * from the SparkListener trait). + * + * Please note until Spark 3.1.0 this was missing the DevelopApi annotation, this needs to be + * taken into account if changing this API before a major release. */ +@DeveloperApi public class SparkFirehoseListener implements SparkListenerInterface { public void onEvent(SparkListenerEvent event) { } @@ -124,34 +129,67 @@ public final void onExecutorBlacklisted(SparkListenerExecutorBlacklisted executo onEvent(executorBlacklisted); } + @Override + public final void onExecutorExcluded(SparkListenerExecutorExcluded executorExcluded) { + onEvent(executorExcluded); + } + @Override public void onExecutorBlacklistedForStage( SparkListenerExecutorBlacklistedForStage executorBlacklistedForStage) { onEvent(executorBlacklistedForStage); } + @Override + public void onExecutorExcludedForStage( + SparkListenerExecutorExcludedForStage executorExcludedForStage) { + onEvent(executorExcludedForStage); + } + @Override public void onNodeBlacklistedForStage( SparkListenerNodeBlacklistedForStage nodeBlacklistedForStage) { onEvent(nodeBlacklistedForStage); } + @Override + public void onNodeExcludedForStage( + SparkListenerNodeExcludedForStage nodeExcludedForStage) { + onEvent(nodeExcludedForStage); + } + @Override public final void onExecutorUnblacklisted( SparkListenerExecutorUnblacklisted executorUnblacklisted) { onEvent(executorUnblacklisted); } + @Override + public final void onExecutorUnexcluded( + SparkListenerExecutorUnexcluded executorUnexcluded) { + onEvent(executorUnexcluded); + } + @Override public final void onNodeBlacklisted(SparkListenerNodeBlacklisted nodeBlacklisted) { onEvent(nodeBlacklisted); } + @Override + public final void onNodeExcluded(SparkListenerNodeExcluded nodeExcluded) { + onEvent(nodeExcluded); + } + @Override public final void onNodeUnblacklisted(SparkListenerNodeUnblacklisted nodeUnblacklisted) { onEvent(nodeUnblacklisted); } + @Override + public final void onNodeUnexcluded(SparkListenerNodeUnexcluded nodeUnexcluded) { + onEvent(nodeUnexcluded); + } + @Override public void onBlockUpdated(SparkListenerBlockUpdated blockUpdated) { onEvent(blockUpdated); @@ -162,6 +200,21 @@ public void onSpeculativeTaskSubmitted(SparkListenerSpeculativeTaskSubmitted spe onEvent(speculativeTask); } + public void onUnschedulableTaskSetAdded( + SparkListenerUnschedulableTaskSetAdded unschedulableTaskSetAdded) { + onEvent(unschedulableTaskSetAdded); + } + + public void onUnschedulableTaskSetRemoved( + SparkListenerUnschedulableTaskSetRemoved unschedulableTaskSetRemoved) { + onEvent(unschedulableTaskSetRemoved); + } + + @Override + public void onResourceProfileAdded(SparkListenerResourceProfileAdded event) { + onEvent(event); + } + @Override public void onOtherEvent(SparkListenerEvent event) { onEvent(event); diff --git a/core/src/main/java/org/apache/spark/api/java/StorageLevels.java b/core/src/main/java/org/apache/spark/api/java/StorageLevels.java index 3fcb52f615834..b51cde48e632b 100644 --- a/core/src/main/java/org/apache/spark/api/java/StorageLevels.java +++ b/core/src/main/java/org/apache/spark/api/java/StorageLevels.java @@ -26,6 +26,7 @@ public class StorageLevels { public static final StorageLevel NONE = create(false, false, false, false, 1); public static final StorageLevel DISK_ONLY = create(true, false, false, false, 1); public static final StorageLevel DISK_ONLY_2 = create(true, false, false, false, 2); + public static final StorageLevel DISK_ONLY_3 = create(true, false, false, false, 3); public static final StorageLevel MEMORY_ONLY = create(false, true, false, true, 1); public static final StorageLevel MEMORY_ONLY_2 = create(false, true, false, true, 2); public static final StorageLevel MEMORY_ONLY_SER = create(false, true, false, false, 1); diff --git a/core/src/main/java/org/apache/spark/api/plugin/DriverPlugin.java b/core/src/main/java/org/apache/spark/api/plugin/DriverPlugin.java index 0c0d0df8ae682..1d676ff781c70 100644 --- a/core/src/main/java/org/apache/spark/api/plugin/DriverPlugin.java +++ b/core/src/main/java/org/apache/spark/api/plugin/DriverPlugin.java @@ -41,7 +41,7 @@ public interface DriverPlugin { * initialization. *

* It's recommended that plugins be careful about what operations are performed in this call, - * preferrably performing expensive operations in a separate thread, or postponing them until + * preferably performing expensive operations in a separate thread, or postponing them until * the application has fully started. * * @param sc The SparkContext loading the plugin. diff --git a/core/src/main/java/org/apache/spark/api/plugin/ExecutorPlugin.java b/core/src/main/java/org/apache/spark/api/plugin/ExecutorPlugin.java index 4961308035163..481bf985f1c6c 100644 --- a/core/src/main/java/org/apache/spark/api/plugin/ExecutorPlugin.java +++ b/core/src/main/java/org/apache/spark/api/plugin/ExecutorPlugin.java @@ -19,6 +19,7 @@ import java.util.Map; +import org.apache.spark.TaskFailedReason; import org.apache.spark.annotation.DeveloperApi; /** @@ -54,4 +55,45 @@ default void init(PluginContext ctx, Map extraConf) {} */ default void shutdown() {} + /** + * Perform any action before the task is run. + *

+ * This method is invoked from the same thread the task will be executed. + * Task-specific information can be accessed via {@link org.apache.spark.TaskContext#get}. + *

+ * Plugin authors should avoid expensive operations here, as this method will be called + * on every task, and doing something expensive can significantly slow down a job. + * It is not recommended for a user to call a remote service, for example. + *

+ * Exceptions thrown from this method do not propagate - they're caught, + * logged, and suppressed. Therefore exceptions when executing this method won't + * make the job fail. + * + * @since 3.1.0 + */ + default void onTaskStart() {} + + /** + * Perform an action after tasks completes without exceptions. + *

+ * As {@link #onTaskStart() onTaskStart} exceptions are suppressed, this method + * will still be invoked even if the corresponding {@link #onTaskStart} call for this + * task failed. + *

+ * Same warnings of {@link #onTaskStart() onTaskStart} apply here. + * + * @since 3.1.0 + */ + default void onTaskSucceeded() {} + + /** + * Perform an action after tasks completes with exceptions. + *

+ * Same warnings of {@link #onTaskStart() onTaskStart} apply here. + * + * @param failureReason the exception thrown from the failed task. + * + * @since 3.1.0 + */ + default void onTaskFailed(TaskFailedReason failureReason) {} } diff --git a/core/src/main/java/org/apache/spark/memory/MemoryConsumer.java b/core/src/main/java/org/apache/spark/memory/MemoryConsumer.java index 9a9d0c7946549..1d361aeb24efc 100644 --- a/core/src/main/java/org/apache/spark/memory/MemoryConsumer.java +++ b/core/src/main/java/org/apache/spark/memory/MemoryConsumer.java @@ -40,8 +40,8 @@ protected MemoryConsumer(TaskMemoryManager taskMemoryManager, long pageSize, Mem this.mode = mode; } - protected MemoryConsumer(TaskMemoryManager taskMemoryManager) { - this(taskMemoryManager, taskMemoryManager.pageSizeBytes(), MemoryMode.ON_HEAP); + protected MemoryConsumer(TaskMemoryManager taskMemoryManager, MemoryMode mode) { + this(taskMemoryManager, taskMemoryManager.pageSizeBytes(), mode); } /** diff --git a/core/src/main/java/org/apache/spark/shuffle/api/ShuffleMapOutputWriter.java b/core/src/main/java/org/apache/spark/shuffle/api/ShuffleMapOutputWriter.java index 21abe9a57cd25..0167002ceedb8 100644 --- a/core/src/main/java/org/apache/spark/shuffle/api/ShuffleMapOutputWriter.java +++ b/core/src/main/java/org/apache/spark/shuffle/api/ShuffleMapOutputWriter.java @@ -20,6 +20,7 @@ import java.io.IOException; import org.apache.spark.annotation.Private; +import org.apache.spark.shuffle.api.metadata.MapOutputCommitMessage; /** * :: Private :: @@ -60,10 +61,15 @@ public interface ShuffleMapOutputWriter { *

* This can also close any resources and clean up temporary state if necessary. *

- * The returned array should contain, for each partition from (0) to (numPartitions - 1), the - * number of bytes written by the partition writer for that partition id. + * The returned commit message is a structure with two components: + *

+ * 1) An array of longs, which should contain, for each partition from (0) to + * (numPartitions - 1), the number of bytes written by the partition writer + * for that partition id. + *

+ * 2) An optional metadata blob that can be used by shuffle readers. */ - long[] commitAllPartitions() throws IOException; + MapOutputCommitMessage commitAllPartitions() throws IOException; /** * Abort all of the writes done by any writers returned by {@link #getPartitionWriter(int)}. diff --git a/core/src/main/java/org/apache/spark/shuffle/api/WritableByteChannelWrapper.java b/core/src/main/java/org/apache/spark/shuffle/api/WritableByteChannelWrapper.java index a204903008a51..04a75dde97cb4 100644 --- a/core/src/main/java/org/apache/spark/shuffle/api/WritableByteChannelWrapper.java +++ b/core/src/main/java/org/apache/spark/shuffle/api/WritableByteChannelWrapper.java @@ -24,7 +24,6 @@ /** * :: Private :: - * * A thin wrapper around a {@link WritableByteChannel}. *

* This is primarily provided for the local disk shuffle implementation to provide a diff --git a/core/src/main/java/org/apache/spark/shuffle/api/metadata/MapOutputCommitMessage.java b/core/src/main/java/org/apache/spark/shuffle/api/metadata/MapOutputCommitMessage.java new file mode 100644 index 0000000000000..c5ded5e75a2d7 --- /dev/null +++ b/core/src/main/java/org/apache/spark/shuffle/api/metadata/MapOutputCommitMessage.java @@ -0,0 +1,63 @@ +/* + * 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. + */ + +package org.apache.spark.shuffle.api.metadata; + +import java.util.Optional; + +import org.apache.spark.annotation.Private; + +/** + * :: Private :: + * Represents the result of writing map outputs for a shuffle map task. + *

+ * Partition lengths represents the length of each block written in the map task. This can + * be used for downstream readers to allocate resources, such as in-memory buffers. + *

+ * Map output writers can choose to attach arbitrary metadata tags to register with a + * shuffle output tracker (a module that is currently yet to be built in a future + * iteration of the shuffle storage APIs). + */ +@Private +public final class MapOutputCommitMessage { + + private final long[] partitionLengths; + private final Optional mapOutputMetadata; + + private MapOutputCommitMessage( + long[] partitionLengths, Optional mapOutputMetadata) { + this.partitionLengths = partitionLengths; + this.mapOutputMetadata = mapOutputMetadata; + } + + public static MapOutputCommitMessage of(long[] partitionLengths) { + return new MapOutputCommitMessage(partitionLengths, Optional.empty()); + } + + public static MapOutputCommitMessage of( + long[] partitionLengths, MapOutputMetadata mapOutputMetadata) { + return new MapOutputCommitMessage(partitionLengths, Optional.of(mapOutputMetadata)); + } + + public long[] getPartitionLengths() { + return partitionLengths; + } + + public Optional getMapOutputMetadata() { + return mapOutputMetadata; + } +} diff --git a/core/src/main/java/org/apache/spark/shuffle/api/metadata/MapOutputMetadata.java b/core/src/main/java/org/apache/spark/shuffle/api/metadata/MapOutputMetadata.java new file mode 100644 index 0000000000000..f509686621602 --- /dev/null +++ b/core/src/main/java/org/apache/spark/shuffle/api/metadata/MapOutputMetadata.java @@ -0,0 +1,30 @@ +/* + * 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. + */ + +package org.apache.spark.shuffle.api.metadata; + +import java.io.Serializable; + +/** + * :: Private :: + * An opaque metadata tag for registering the result of committing the output of a + * shuffle map task. + *

+ * All implementations must be serializable since this is sent from the executors to + * the driver. + */ +public interface MapOutputMetadata extends Serializable {} diff --git a/core/src/main/java/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriter.java b/core/src/main/java/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriter.java index dc157eaa3b253..3dbee1b13d287 100644 --- a/core/src/main/java/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriter.java +++ b/core/src/main/java/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriter.java @@ -31,7 +31,6 @@ import scala.Tuple2; import scala.collection.Iterator; -import com.google.common.annotations.VisibleForTesting; import com.google.common.io.Closeables; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -130,7 +129,7 @@ public void write(Iterator> records) throws IOException { .createMapOutputWriter(shuffleId, mapId, numPartitions); try { if (!records.hasNext()) { - partitionLengths = mapOutputWriter.commitAllPartitions(); + partitionLengths = mapOutputWriter.commitAllPartitions().getPartitionLengths(); mapStatus = MapStatus$.MODULE$.apply( blockManager.shuffleServerId(), partitionLengths, mapId); return; @@ -178,8 +177,8 @@ public void write(Iterator> records) throws IOException { } } - @VisibleForTesting - long[] getPartitionLengths() { + @Override + public long[] getPartitionLengths() { return partitionLengths; } @@ -219,7 +218,7 @@ private long[] writePartitionedData(ShuffleMapOutputWriter mapOutputWriter) thro } partitionWriters = null; } - return mapOutputWriter.commitAllPartitions(); + return mapOutputWriter.commitAllPartitions().getPartitionLengths(); } private void writePartitionedDataWithChannel( diff --git a/core/src/main/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriter.java b/core/src/main/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriter.java index d09282e61a9c7..e8f94ba8ffeee 100644 --- a/core/src/main/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriter.java +++ b/core/src/main/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriter.java @@ -18,6 +18,7 @@ package org.apache.spark.shuffle.sort; import java.nio.channels.Channels; +import java.util.Arrays; import java.util.Optional; import javax.annotation.Nullable; import java.io.*; @@ -87,6 +88,7 @@ public class UnsafeShuffleWriter extends ShuffleWriter { @Nullable private MapStatus mapStatus; @Nullable private ShuffleExternalSorter sorter; + @Nullable private long[] partitionLengths; private long peakMemoryUsedBytes = 0; /** Subclass of ByteArrayOutputStream that exposes `buf` directly. */ @@ -218,7 +220,6 @@ void closeAndWriteOutput() throws IOException { serOutputStream = null; final SpillInfo[] spills = sorter.closeAndGetSpills(); sorter = null; - final long[] partitionLengths; try { partitionLengths = mergeSpills(spills); } finally { @@ -266,7 +267,7 @@ private long[] mergeSpills(SpillInfo[] spills) throws IOException { if (spills.length == 0) { final ShuffleMapOutputWriter mapWriter = shuffleExecutorComponents .createMapOutputWriter(shuffleId, mapId, partitioner.numPartitions()); - return mapWriter.commitAllPartitions(); + return mapWriter.commitAllPartitions().getPartitionLengths(); } else if (spills.length == 1) { Optional maybeSingleFileWriter = shuffleExecutorComponents.createSingleFileMapOutputWriter(shuffleId, mapId); @@ -274,6 +275,8 @@ private long[] mergeSpills(SpillInfo[] spills) throws IOException { // Here, we don't need to perform any metrics updates because the bytes written to this // output file would have already been counted as shuffle bytes written. partitionLengths = spills[0].partitionLengths; + logger.debug("Merge shuffle spills for mapId {} with length {}", mapId, + partitionLengths.length); maybeSingleFileWriter.get().transferMapSpillFile(spills[0].file, partitionLengths); } else { partitionLengths = mergeSpillsUsingStandardWriter(spills); @@ -327,7 +330,7 @@ private long[] mergeSpillsUsingStandardWriter(SpillInfo[] spills) throws IOExcep // to be counted as shuffle write, but this will lead to double-counting of the final // SpillInfo's bytes. writeMetrics.decBytesWritten(spills[spills.length - 1].file.length()); - partitionLengths = mapWriter.commitAllPartitions(); + partitionLengths = mapWriter.commitAllPartitions().getPartitionLengths(); } catch (Exception e) { try { mapWriter.abort(e); @@ -360,6 +363,7 @@ private void mergeSpillsWithFileStream( SpillInfo[] spills, ShuffleMapOutputWriter mapWriter, @Nullable CompressionCodec compressionCodec) throws IOException { + logger.debug("Merge shuffle spills with FileStream for mapId {}", mapId); final int numPartitions = partitioner.numPartitions(); final InputStream[] spillInputStreams = new InputStream[spills.length]; @@ -369,6 +373,11 @@ private void mergeSpillsWithFileStream( spillInputStreams[i] = new NioBufferedFileInputStream( spills[i].file, inputBufferSizeInBytes); + // Only convert the partitionLengths when debug level is enabled. + if (logger.isDebugEnabled()) { + logger.debug("Partition lengths for mapId {} in Spill {}: {}", mapId, i, + Arrays.toString(spills[i].partitionLengths)); + } } for (int partition = 0; partition < numPartitions; partition++) { boolean copyThrewException = true; @@ -431,6 +440,7 @@ private void mergeSpillsWithFileStream( private void mergeSpillsWithTransferTo( SpillInfo[] spills, ShuffleMapOutputWriter mapWriter) throws IOException { + logger.debug("Merge shuffle spills with TransferTo for mapId {}", mapId); final int numPartitions = partitioner.numPartitions(); final FileChannel[] spillInputChannels = new FileChannel[spills.length]; final long[] spillInputChannelPositions = new long[spills.length]; @@ -439,6 +449,11 @@ private void mergeSpillsWithTransferTo( try { for (int i = 0; i < spills.length; i++) { spillInputChannels[i] = new FileInputStream(spills[i].file).getChannel(); + // Only convert the partitionLengths when debug level is enabled. + if (logger.isDebugEnabled()) { + logger.debug("Partition lengths for mapId {} in Spill {}: {}", mapId, i, + Arrays.toString(spills[i].partitionLengths)); + } } for (int partition = 0; partition < numPartitions; partition++) { boolean copyThrewException = true; @@ -528,4 +543,9 @@ public void close() throws IOException { channel.close(); } } + + @Override + public long[] getPartitionLengths() { + return partitionLengths; + } } diff --git a/core/src/main/java/org/apache/spark/shuffle/sort/io/LocalDiskShuffleMapOutputWriter.java b/core/src/main/java/org/apache/spark/shuffle/sort/io/LocalDiskShuffleMapOutputWriter.java index a6529fd76188a..0b286264be43d 100644 --- a/core/src/main/java/org/apache/spark/shuffle/sort/io/LocalDiskShuffleMapOutputWriter.java +++ b/core/src/main/java/org/apache/spark/shuffle/sort/io/LocalDiskShuffleMapOutputWriter.java @@ -35,6 +35,7 @@ import org.apache.spark.shuffle.api.WritableByteChannelWrapper; import org.apache.spark.internal.config.package$; import org.apache.spark.shuffle.IndexShuffleBlockResolver; +import org.apache.spark.shuffle.api.metadata.MapOutputCommitMessage; import org.apache.spark.util.Utils; /** @@ -97,7 +98,7 @@ public ShufflePartitionWriter getPartitionWriter(int reducePartitionId) throws I } @Override - public long[] commitAllPartitions() throws IOException { + public MapOutputCommitMessage commitAllPartitions() throws IOException { // Check the position after transferTo loop to see if it is in the right position and raise a // exception if it is incorrect. The position will not be increased to the expected length // after calling transferTo in kernel version 2.6.32. This issue is described at @@ -112,8 +113,10 @@ public long[] commitAllPartitions() throws IOException { } cleanUp(); File resolvedTmp = outputTempFile != null && outputTempFile.isFile() ? outputTempFile : null; + log.debug("Writing shuffle index file for mapId {} with length {}", mapId, + partitionLengths.length); blockResolver.writeIndexFileAndCommit(shuffleId, mapId, partitionLengths, resolvedTmp); - return partitionLengths; + return MapOutputCommitMessage.of(partitionLengths); } @Override @@ -210,14 +213,14 @@ public long getNumBytesWritten() { private class PartitionWriterStream extends OutputStream { private final int partitionId; - private int count = 0; + private long count = 0; private boolean isClosed = false; PartitionWriterStream(int partitionId) { this.partitionId = partitionId; } - public int getCount() { + public long getCount() { return count; } diff --git a/core/src/main/java/org/apache/spark/status/api/v1/TaskStatus.java b/core/src/main/java/org/apache/spark/status/api/v1/TaskStatus.java new file mode 100644 index 0000000000000..dec9c31321839 --- /dev/null +++ b/core/src/main/java/org/apache/spark/status/api/v1/TaskStatus.java @@ -0,0 +1,32 @@ +/* + * 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. + */ + +package org.apache.spark.status.api.v1; + +import org.apache.spark.util.EnumUtil; + +public enum TaskStatus { + RUNNING, + KILLED, + FAILED, + SUCCESS, + UNKNOWN; + + public static TaskStatus fromString(String str) { + return EnumUtil.parseIgnoreCase(TaskStatus.class, str); + } +} diff --git a/core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java b/core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java index 6e028886f2318..f474c30b8b3d8 100644 --- a/core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java +++ b/core/src/main/java/org/apache/spark/unsafe/map/BytesToBytesMap.java @@ -393,10 +393,12 @@ public void remove() { } private void handleFailedDelete() { - // remove the spill file from disk - File file = spillWriters.removeFirst().getFile(); - if (file != null && file.exists() && !file.delete()) { - logger.error("Was unable to delete spill file {}", file.getAbsolutePath()); + if (spillWriters.size() > 0) { + // remove the spill file from disk + File file = spillWriters.removeFirst().getFile(); + if (file != null && file.exists() && !file.delete()) { + logger.error("Was unable to delete spill file {}", file.getAbsolutePath()); + } } } } @@ -428,6 +430,68 @@ public MapIterator destructiveIterator() { return new MapIterator(numValues, new Location(), true); } + /** + * Iterator for the entries of this map. This is to first iterate over key indices in + * `longArray` then accessing values in `dataPages`. NOTE: this is different from `MapIterator` + * in the sense that key index is preserved here + * (See `UnsafeHashedRelation` for example of usage). + */ + public final class MapIteratorWithKeyIndex implements Iterator { + + /** + * The index in `longArray` where the key is stored. + */ + private int keyIndex = 0; + + private int numRecords; + private final Location loc; + + private MapIteratorWithKeyIndex() { + this.numRecords = numValues; + this.loc = new Location(); + } + + @Override + public boolean hasNext() { + return numRecords > 0; + } + + @Override + public Location next() { + if (!loc.isDefined() || !loc.nextValue()) { + while (longArray.get(keyIndex * 2) == 0) { + keyIndex++; + } + loc.with(keyIndex, 0, true); + keyIndex++; + } + numRecords--; + return loc; + } + } + + /** + * Returns an iterator for iterating over the entries of this map, + * by first iterating over the key index inside hash map's `longArray`. + * + * For efficiency, all calls to `next()` will return the same {@link Location} object. + * + * The returned iterator is NOT thread-safe. If the map is modified while iterating over it, + * the behavior of the returned iterator is undefined. + */ + public MapIteratorWithKeyIndex iteratorWithKeyIndex() { + return new MapIteratorWithKeyIndex(); + } + + /** + * The maximum number of allowed keys index. + * + * The value of allowed keys index is in the range of [0, maxNumKeysIndex - 1]. + */ + public int maxNumKeysIndex() { + return (int) (longArray.size() / 2); + } + /** * Looks up a key, and return a {@link Location} handle that can be used to test existence * and read/write values. @@ -601,6 +665,14 @@ public boolean isDefined() { return isDefined; } + /** + * Returns index for key. + */ + public int getKeyIndex() { + assert (isDefined); + return pos; + } + /** * Returns the base object for key. */ @@ -738,12 +810,21 @@ public boolean append(Object kbase, long koff, int klen, Object vbase, long voff longArray.set(pos * 2 + 1, keyHashcode); isDefined = true; - // We use two array entries per key, so the array size is twice the capacity. - // We should compare the current capacity of the array, instead of its size. - if (numKeys >= growthThreshold && longArray.size() / 2 < MAX_CAPACITY) { - try { - growAndRehash(); - } catch (SparkOutOfMemoryError oom) { + // If the map has reached its growth threshold, try to grow it. + if (numKeys >= growthThreshold) { + // We use two array entries per key, so the array size is twice the capacity. + // We should compare the current capacity of the array, instead of its size. + if (longArray.size() / 2 < MAX_CAPACITY) { + try { + growAndRehash(); + } catch (SparkOutOfMemoryError oom) { + canGrowArray = false; + } + } else { + // The map is already at MAX_CAPACITY and cannot grow. Instead, we prevent it from + // accepting any more new elements to make sure we don't exceed the load factor. If we + // need to spill later, this allows UnsafeKVExternalSorter to reuse the array for + // sorting. canGrowArray = false; } } diff --git a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java index 55e4e609c3c7b..c38327cae8ce3 100644 --- a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java +++ b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorter.java @@ -104,11 +104,14 @@ public static UnsafeExternalSorter createWithExistingInMemorySorter( int initialSize, long pageSizeBytes, int numElementsForSpillThreshold, - UnsafeInMemorySorter inMemorySorter) throws IOException { + UnsafeInMemorySorter inMemorySorter, + long existingMemoryConsumption) throws IOException { UnsafeExternalSorter sorter = new UnsafeExternalSorter(taskMemoryManager, blockManager, serializerManager, taskContext, recordComparatorSupplier, prefixComparator, initialSize, pageSizeBytes, numElementsForSpillThreshold, inMemorySorter, false /* ignored */); sorter.spill(Long.MAX_VALUE, sorter); + taskContext.taskMetrics().incMemoryBytesSpilled(existingMemoryConsumption); + sorter.totalSpillBytes += existingMemoryConsumption; // The external sorter will be used to insert records, in-memory sorter is not needed. sorter.inMemSorter = null; return sorter; @@ -203,6 +206,10 @@ public long spill(long size, MemoryConsumer trigger) throws IOException { } if (inMemSorter == null || inMemSorter.numRecords() <= 0) { + // There could still be some memory allocated when there are no records in the in-memory + // sorter. We will not spill it however, to ensure that we can always process at least one + // record before spilling. See the comments in `allocateMemoryForRecordIfNecessary` for why + // this is necessary. return 0L; } @@ -224,7 +231,7 @@ public long spill(long size, MemoryConsumer trigger) throws IOException { // Note that this is more-or-less going to be a multiple of the page size, so wasted space in // pages will currently be counted as memory spilled even though that space isn't actually // written to disk. This also counts the space needed to store the sorter's pointer array. - inMemSorter.reset(); + inMemSorter.freeMemory(); // Reset the in-memory sorter's pointer array only after freeing up the memory pages holding the // records. Otherwise, if the task is over allocated memory, then without freeing the memory // pages, we might not be able to get memory for the pointer array. @@ -325,7 +332,7 @@ public void cleanupResources() { deleteSpillFiles(); freeMemory(); if (inMemSorter != null) { - inMemSorter.free(); + inMemSorter.freeMemory(); inMemSorter = null; } } @@ -339,40 +346,53 @@ public void cleanupResources() { private void growPointerArrayIfNecessary() throws IOException { assert(inMemSorter != null); if (!inMemSorter.hasSpaceForAnotherRecord()) { + if (inMemSorter.numRecords() <= 0) { + // Spilling was triggered just before this method was called. The pointer array was freed + // during the spill, so a new pointer array needs to be allocated here. + LongArray array = allocateArray(inMemSorter.getInitialSize()); + inMemSorter.expandPointerArray(array); + return; + } + long used = inMemSorter.getMemoryUsage(); - LongArray array; + LongArray array = null; try { // could trigger spilling array = allocateArray(used / 8 * 2); } catch (TooLargePageException e) { // The pointer array is too big to fix in a single page, spill. spill(); - return; } catch (SparkOutOfMemoryError e) { - // should have trigger spilling - if (!inMemSorter.hasSpaceForAnotherRecord()) { + if (inMemSorter.numRecords() > 0) { logger.error("Unable to grow the pointer array"); throw e; } - return; + // The new array could not be allocated, but that is not an issue as it is longer needed, + // as all records were spilled. } - // check if spilling is triggered or not - if (inMemSorter.hasSpaceForAnotherRecord()) { - freeArray(array); - } else { - inMemSorter.expandPointerArray(array); + + if (inMemSorter.numRecords() <= 0) { + // Spilling was triggered while trying to allocate the new array. + if (array != null) { + // We succeeded in allocating the new array, but, since all records were spilled, a + // smaller array would also suffice. + freeArray(array); + } + // The pointer array was freed during the spill, so a new pointer array needs to be + // allocated here. + array = allocateArray(inMemSorter.getInitialSize()); } + inMemSorter.expandPointerArray(array); } } /** - * Allocates more memory in order to insert an additional record. This will request additional - * memory from the memory manager and spill if the requested memory can not be obtained. + * Allocates an additional page in order to insert an additional record. This will request + * additional memory from the memory manager and spill if the requested memory can not be + * obtained. * * @param required the required space in the data page, in bytes, including space for storing - * the record size. This must be less than or equal to the page size (records - * that exceed the page size are handled via a different code path which uses - * special overflow pages). + * the record size. */ private void acquireNewPageIfNecessary(int required) { if (currentPage == null || @@ -384,6 +404,37 @@ private void acquireNewPageIfNecessary(int required) { } } + /** + * Allocates more memory in order to insert an additional record. This will request additional + * memory from the memory manager and spill if the requested memory can not be obtained. + * + * @param required the required space in the data page, in bytes, including space for storing + * the record size. + */ + private void allocateMemoryForRecordIfNecessary(int required) throws IOException { + // Step 1: + // Ensure that the pointer array has space for another record. This may cause a spill. + growPointerArrayIfNecessary(); + // Step 2: + // Ensure that the last page has space for another record. This may cause a spill. + acquireNewPageIfNecessary(required); + // Step 3: + // The allocation in step 2 could have caused a spill, which would have freed the pointer + // array allocated in step 1. Therefore we need to check again whether we have to allocate + // a new pointer array. + // + // If the allocation in this step causes a spill event then it will not cause the page + // allocated in the previous step to be freed. The function `spill` only frees memory if at + // least one record has been inserted in the in-memory sorter. This will not be the case if + // we have spilled in the previous step. + // + // If we did not spill in the previous step then `growPointerArrayIfNecessary` will be a + // no-op that does not allocate any memory, and therefore can't cause a spill event. + // + // Thus there is no need to call `acquireNewPageIfNecessary` again after this step. + growPointerArrayIfNecessary(); + } + /** * Write a record to the sorter. */ @@ -398,11 +449,10 @@ public void insertRecord( spill(); } - growPointerArrayIfNecessary(); - int uaoSize = UnsafeAlignedOffset.getUaoSize(); + final int uaoSize = UnsafeAlignedOffset.getUaoSize(); // Need 4 or 8 bytes to store the record length. final int required = length + uaoSize; - acquireNewPageIfNecessary(required); + allocateMemoryForRecordIfNecessary(required); final Object base = currentPage.getBaseObject(); final long recordAddress = taskMemoryManager.encodePageNumberAndOffset(currentPage, pageCursor); @@ -425,10 +475,9 @@ public void insertKVRecord(Object keyBase, long keyOffset, int keyLen, Object valueBase, long valueOffset, int valueLen, long prefix, boolean prefixIsNull) throws IOException { - growPointerArrayIfNecessary(); - int uaoSize = UnsafeAlignedOffset.getUaoSize(); + final int uaoSize = UnsafeAlignedOffset.getUaoSize(); final int required = keyLen + valueLen + (2 * uaoSize); - acquireNewPageIfNecessary(required); + allocateMemoryForRecordIfNecessary(required); final Object base = currentPage.getBaseObject(); final long recordAddress = taskMemoryManager.encodePageNumberAndOffset(currentPage, pageCursor); @@ -450,6 +499,7 @@ public void insertKVRecord(Object keyBase, long keyOffset, int keyLen, */ public void merge(UnsafeExternalSorter other) throws IOException { other.spill(); + totalSpillBytes += other.totalSpillBytes; spillWriters.addAll(other.spillWriters); // remove them from `spillWriters`, or the files will be deleted in `cleanupResources`. other.spillWriters.clear(); @@ -501,10 +551,14 @@ private static void spillIterator(UnsafeSorterIterator inMemIterator, */ class SpillableIterator extends UnsafeSorterIterator { private UnsafeSorterIterator upstream; - private UnsafeSorterIterator nextUpstream = null; private MemoryBlock lastPage = null; private boolean loaded = false; - private int numRecords = 0; + private int numRecords; + + private Object currentBaseObject; + private long currentBaseOffset; + private int currentRecordLength; + private long currentKeyPrefix; SpillableIterator(UnsafeSorterIterator inMemIterator) { this.upstream = inMemIterator; @@ -516,23 +570,32 @@ public int getNumRecords() { return numRecords; } + @Override + public long getCurrentPageNumber() { + throw new UnsupportedOperationException(); + } + public long spill() throws IOException { synchronized (this) { - if (!(upstream instanceof UnsafeInMemorySorter.SortedIterator && nextUpstream == null - && numRecords > 0)) { + if (inMemSorter == null) { return 0L; } - UnsafeInMemorySorter.SortedIterator inMemIterator = - ((UnsafeInMemorySorter.SortedIterator) upstream).clone(); + long currentPageNumber = upstream.getCurrentPageNumber(); - ShuffleWriteMetrics writeMetrics = new ShuffleWriteMetrics(); - // Iterate over the records that have not been returned and spill them. - final UnsafeSorterSpillWriter spillWriter = - new UnsafeSorterSpillWriter(blockManager, fileBufferSizeBytes, writeMetrics, numRecords); - spillIterator(inMemIterator, spillWriter); - spillWriters.add(spillWriter); - nextUpstream = spillWriter.getReader(serializerManager); + ShuffleWriteMetrics writeMetrics = new ShuffleWriteMetrics(); + if (numRecords > 0) { + // Iterate over the records that have not been returned and spill them. + final UnsafeSorterSpillWriter spillWriter = new UnsafeSorterSpillWriter( + blockManager, fileBufferSizeBytes, writeMetrics, numRecords); + spillIterator(upstream, spillWriter); + spillWriters.add(spillWriter); + upstream = spillWriter.getReader(serializerManager); + } else { + // Nothing to spill as all records have been read already, but do not return yet, as the + // memory still has to be freed. + upstream = null; + } long released = 0L; synchronized (UnsafeExternalSorter.this) { @@ -540,8 +603,7 @@ public long spill() throws IOException { // is accessing the current record. We free this page in that caller's next loadNext() // call. for (MemoryBlock page : allocatedPages) { - if (!loaded || page.pageNumber != - ((UnsafeInMemorySorter.SortedIterator)upstream).getCurrentPageNumber()) { + if (!loaded || page.pageNumber != currentPageNumber) { released += page.size(); freePage(page); } else { @@ -549,13 +611,18 @@ public long spill() throws IOException { } } allocatedPages.clear(); + if (lastPage != null) { + // Add the last page back to the list of allocated pages to make sure it gets freed in + // case loadNext() never gets called again. + allocatedPages.add(lastPage); + } } // in-memory sorter will not be used after spilling assert(inMemSorter != null); released += inMemSorter.getMemoryUsage(); totalSortTimeNanos += inMemSorter.getSortTimeNanos(); - inMemSorter.free(); + inMemSorter.freeMemory(); inMemSorter = null; taskContext.taskMetrics().incMemoryBytesSpilled(released); taskContext.taskMetrics().incDiskBytesSpilled(writeMetrics.bytesWritten()); @@ -571,26 +638,32 @@ public boolean hasNext() { @Override public void loadNext() throws IOException { + assert upstream != null; MemoryBlock pageToFree = null; try { synchronized (this) { loaded = true; - if (nextUpstream != null) { - // Just consumed the last record from in memory iterator - if(lastPage != null) { - // Do not free the page here, while we are locking `SpillableIterator`. The `freePage` - // method locks the `TaskMemoryManager`, and it's a bad idea to lock 2 objects in - // sequence. We may hit dead lock if another thread locks `TaskMemoryManager` and - // `SpillableIterator` in sequence, which may happen in - // `TaskMemoryManager.acquireExecutionMemory`. - pageToFree = lastPage; - lastPage = null; - } - upstream = nextUpstream; - nextUpstream = null; + // Just consumed the last record from the in-memory iterator. + if (lastPage != null) { + // Do not free the page here, while we are locking `SpillableIterator`. The `freePage` + // method locks the `TaskMemoryManager`, and it's a bad idea to lock 2 objects in + // sequence. We may hit dead lock if another thread locks `TaskMemoryManager` and + // `SpillableIterator` in sequence, which may happen in + // `TaskMemoryManager.acquireExecutionMemory`. + pageToFree = lastPage; + allocatedPages.clear(); + lastPage = null; } numRecords--; upstream.loadNext(); + + // Keep track of the current base object, base offset, record length, and key prefix, + // so that the current record can still be read in case a spill is triggered and we + // switch to the spill writer's iterator. + currentBaseObject = upstream.getBaseObject(); + currentBaseOffset = upstream.getBaseOffset(); + currentRecordLength = upstream.getRecordLength(); + currentKeyPrefix = upstream.getKeyPrefix(); } } finally { if (pageToFree != null) { @@ -601,22 +674,22 @@ public void loadNext() throws IOException { @Override public Object getBaseObject() { - return upstream.getBaseObject(); + return currentBaseObject; } @Override public long getBaseOffset() { - return upstream.getBaseOffset(); + return currentBaseOffset; } @Override public int getRecordLength() { - return upstream.getRecordLength(); + return currentRecordLength; } @Override public long getKeyPrefix() { - return upstream.getKeyPrefix(); + return currentKeyPrefix; } } @@ -646,7 +719,7 @@ public UnsafeSorterIterator getIterator(int startIndex) throws IOException { } i += spillWriter.recordsSpilled(); } - if (inMemSorter != null) { + if (inMemSorter != null && inMemSorter.numRecords() > 0) { UnsafeSorterIterator iter = inMemSorter.getSortedIterator(); moveOver(iter, startIndex - i); queue.add(iter); @@ -693,6 +766,11 @@ public int getNumRecords() { return numRecords; } + @Override + public long getCurrentPageNumber() { + return current.getCurrentPageNumber(); + } + @Override public boolean hasNext() { while (!current.hasNext() && !iterators.isEmpty()) { diff --git a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java index 660eb790a550b..765ee035855d6 100644 --- a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java +++ b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorter.java @@ -20,7 +20,7 @@ import java.util.Comparator; import java.util.LinkedList; -import org.apache.avro.reflect.Nullable; +import javax.annotation.Nullable; import org.apache.spark.TaskContext; import org.apache.spark.memory.MemoryConsumer; @@ -159,32 +159,26 @@ private int getUsableCapacity() { return (int) (array.size() / (radixSortSupport != null ? 2 : 1.5)); } + public long getInitialSize() { + return initialSize; + } + /** * Free the memory used by pointer array. */ - public void free() { + public void freeMemory() { if (consumer != null) { if (array != null) { consumer.freeArray(array); } - array = null; - } - } - public void reset() { - if (consumer != null) { - consumer.freeArray(array); - // the call to consumer.allocateArray may trigger a spill which in turn access this instance - // and eventually re-enter this method and try to free the array again. by setting the array - // to null and its length to 0 we effectively make the spill code-path a no-op. setting the - // array to null also indicates that it has already been de-allocated which prevents a double - // de-allocation in free(). + // Set the array to null instead of allocating a new array. Allocating an array could have + // triggered another spill and this method already is called from UnsafeExternalSorter when + // spilling. Attempting to allocate while spilling is dangerous, as we could be holding onto + // a large partially complete allocation, which may prevent other memory from being allocated. + // Instead we will allocate the new array when it is necessary. array = null; usableCapacity = 0; - pos = 0; - nullBoundaryPos = 0; - array = consumer.allocateArray(initialSize); - usableCapacity = getUsableCapacity(); } pos = 0; nullBoundaryPos = 0; @@ -217,18 +211,20 @@ public boolean hasSpaceForAnotherRecord() { } public void expandPointerArray(LongArray newArray) { - if (newArray.size() < array.size()) { - // checkstyle.off: RegexpSinglelineJava - throw new SparkOutOfMemoryError("Not enough memory to grow pointer array"); - // checkstyle.on: RegexpSinglelineJava + if (array != null) { + if (newArray.size() < array.size()) { + // checkstyle.off: RegexpSinglelineJava + throw new SparkOutOfMemoryError("Not enough memory to grow pointer array"); + // checkstyle.on: RegexpSinglelineJava + } + Platform.copyMemory( + array.getBaseObject(), + array.getBaseOffset(), + newArray.getBaseObject(), + newArray.getBaseOffset(), + pos * 8L); + consumer.freeArray(array); } - Platform.copyMemory( - array.getBaseObject(), - array.getBaseOffset(), - newArray.getBaseObject(), - newArray.getBaseOffset(), - pos * 8L); - consumer.freeArray(array); array = newArray; usableCapacity = getUsableCapacity(); } @@ -330,6 +326,7 @@ public void loadNext() { @Override public long getBaseOffset() { return baseOffset; } + @Override public long getCurrentPageNumber() { return currentPageNumber; } @@ -346,6 +343,11 @@ public long getCurrentPageNumber() { * {@code next()} will return the same mutable object. */ public UnsafeSorterIterator getSortedIterator() { + if (numRecords() == 0) { + // `array` might be null, so make sure that it is not accessed by returning early. + return new SortedIterator(0, 0); + } + int offset = 0; long start = System.nanoTime(); if (sortComparator != null) { diff --git a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterIterator.java b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterIterator.java index 1b3167fcc250c..d9f22311d07c2 100644 --- a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterIterator.java +++ b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterIterator.java @@ -34,4 +34,6 @@ public abstract class UnsafeSorterIterator { public abstract long getKeyPrefix(); public abstract int getNumRecords(); + + public abstract long getCurrentPageNumber(); } diff --git a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterSpillMerger.java b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterSpillMerger.java index ab800288dcb43..f8603c5799e9b 100644 --- a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterSpillMerger.java +++ b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterSpillMerger.java @@ -70,6 +70,11 @@ public int getNumRecords() { return numRecords; } + @Override + public long getCurrentPageNumber() { + throw new UnsupportedOperationException(); + } + @Override public boolean hasNext() { return !priorityQueue.isEmpty() || (spillReader != null && spillReader.hasNext()); diff --git a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterSpillReader.java b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterSpillReader.java index a524c4790407d..db79efd008530 100644 --- a/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterSpillReader.java +++ b/core/src/main/java/org/apache/spark/util/collection/unsafe/sort/UnsafeSorterSpillReader.java @@ -89,6 +89,11 @@ public int getNumRecords() { return numRecords; } + @Override + public long getCurrentPageNumber() { + throw new UnsupportedOperationException(); + } + @Override public boolean hasNext() { return (numRecordsRemaining > 0); diff --git a/core/src/main/resources/org/apache/spark/ui/static/executorspage-template.html b/core/src/main/resources/org/apache/spark/ui/static/executorspage-template.html index 0b26bfc5b2d82..37d56a06ded7f 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/executorspage-template.html +++ b/core/src/main/resources/org/apache/spark/ui/static/executorspage-template.html @@ -56,8 +56,8 @@

Summary

- Blacklisted + title="Number of executors excluded by the scheduler due to task failures."> + Excluded @@ -86,9 +86,26 @@

Executors

Off Heap Storage Memory + + + Peak JVM Memory OnHeap / OffHeap + + + Peak Execution Memory OnHeap / OffHeap + + + Peak Storage Memory OnHeap / OffHeap + + + Peak Pool Memory Direct / Mapped Disk Used Cores - Resources + Resources + Resource Profile Id Active Tasks Failed Tasks Complete Tasks @@ -111,10 +128,28 @@

Executors

Shuffle Write Logs Thread Dump + Exec Loss Reason + +
+

Miscellaneous Process

+ + + + + + + + + + + + +
Process IDAddressStatusCoresLogs
+
diff --git a/core/src/main/resources/org/apache/spark/ui/static/executorspage.js b/core/src/main/resources/org/apache/spark/ui/static/executorspage.js index ec57797ba0909..ab412a8589a28 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/executorspage.js +++ b/core/src/main/resources/org/apache/spark/ui/static/executorspage.js @@ -15,607 +15,759 @@ * limitations under the License. */ +/* global $, Mustache, createRESTEndPointForExecutorsPage, createRESTEndPointForMiscellaneousProcess, */ +/* global createTemplateURI, formatBytes, formatDuration, formatLogsCells, getStandAloneAppId, */ +/* global jQuery, setDataTableDefaults */ + var threadDumpEnabled = false; +/* eslint-disable no-unused-vars */ function setThreadDumpEnabled(val) { - threadDumpEnabled = val; + threadDumpEnabled = val; } +/* eslint-enable no-unused-vars */ function getThreadDumpEnabled() { - return threadDumpEnabled; + return threadDumpEnabled; +} + +function formatLossReason(removeReason) { + if (removeReason) { + return removeReason + } else { + return "" + } } function formatStatus(status, type, row) { - if (row.isBlacklisted) { - return "Blacklisted"; - } + if (row.isExcluded) { + return "Excluded"; + } - if (status) { - if (row.blacklistedInStages.length == 0) { - return "Active" - } - return "Active (Blacklisted in Stages: [" + row.blacklistedInStages.join(", ") + "])"; + if (status) { + if (row.excludedInStages.length == 0) { + return "Active" } - return "Dead" + return "Active (Excluded in Stages: [" + row.excludedInStages.join(", ") + "])"; + } + return "Dead" +} + +function formatProcessStatus(activeStatus) { + if (activeStatus) { + return "Active" + } + return "Dead" } function formatResourceCells(resources) { - var result = "" - var count = 0 - $.each(resources, function (name, resInfo) { - if (count > 0) { - result += ", " - } - result += name + ': [' + resInfo.addresses.join(", ") + ']' - count += 1 - }); - return result + var result = "" + var count = 0 + $.each(resources, function (name, resInfo) { + if (count > 0) { + result += ", " + } + result += name + ': [' + resInfo.addresses.join(", ") + ']'; + count += 1 + }); + return result } jQuery.extend(jQuery.fn.dataTableExt.oSort, { - "title-numeric-pre": function (a) { - var x = a.match(/title="*(-?[0-9\.]+)/)[1]; - return parseFloat(x); - }, - - "title-numeric-asc": function (a, b) { - return ((a < b) ? -1 : ((a > b) ? 1 : 0)); - }, - - "title-numeric-desc": function (a, b) { - return ((a < b) ? 1 : ((a > b) ? -1 : 0)); - } + "title-numeric-pre": function (a) { + var x = a.match(/title="*(-?[0-9.]+)/)[1]; + return parseFloat(x); + }, + + "title-numeric-asc": function (a, b) { + return ((a < b) ? -1 : ((a > b) ? 1 : 0)); + }, + + "title-numeric-desc": function (a, b) { + return ((a < b) ? 1 : ((a > b) ? -1 : 0)); + } }); $(document).ajaxStop($.unblockUI); $(document).ajaxStart(function () { - $.blockUI({message: '

Loading Executors Page...

'}); + $.blockUI({message: '

Loading Executors Page...

'}); }); function logsExist(execs) { - return execs.some(function(exec) { - return !($.isEmptyObject(exec["executorLogs"])); - }); + return execs.some(function(exec) { + return !($.isEmptyObject(exec["executorLogs"])); + }); } // Determine Color Opacity from 0.5-1 // activeTasks range from 0 to maxTasks function activeTasksAlpha(activeTasks, maxTasks) { - return maxTasks > 0 ? ((activeTasks / maxTasks) * 0.5 + 0.5) : 1; + return maxTasks > 0 ? ((activeTasks / maxTasks) * 0.5 + 0.5) : 1; } function activeTasksStyle(activeTasks, maxTasks) { - return activeTasks > 0 ? ("hsla(240, 100%, 50%, " + activeTasksAlpha(activeTasks, maxTasks) + ")") : ""; + return activeTasks > 0 ? ("hsla(240, 100%, 50%, " + activeTasksAlpha(activeTasks, maxTasks) + ")") : ""; } // failedTasks range max at 10% failure, alpha max = 1 function failedTasksAlpha(failedTasks, totalTasks) { - return totalTasks > 0 ? - (Math.min(10 * failedTasks / totalTasks, 1) * 0.5 + 0.5) : 1; + return totalTasks > 0 ? + (Math.min(10 * failedTasks / totalTasks, 1) * 0.5 + 0.5) : 1; } function failedTasksStyle(failedTasks, totalTasks) { - return failedTasks > 0 ? - ("hsla(0, 100%, 50%, " + failedTasksAlpha(failedTasks, totalTasks) + ")") : ""; + return failedTasks > 0 ? + ("hsla(0, 100%, 50%, " + failedTasksAlpha(failedTasks, totalTasks) + ")") : ""; } // totalDuration range from 0 to 50% GC time, alpha max = 1 function totalDurationAlpha(totalGCTime, totalDuration) { - return totalDuration > 0 ? - (Math.min(totalGCTime / totalDuration + 0.5, 1)) : 1; + return totalDuration > 0 ? + (Math.min(totalGCTime / totalDuration + 0.5, 1)) : 1; } // When GCTimePercent is edited change ToolTips.TASK_TIME to match var GCTimePercent = 0.1; function totalDurationStyle(totalGCTime, totalDuration) { - // Red if GC time over GCTimePercent of total time - return (totalGCTime > GCTimePercent * totalDuration) ? - ("hsla(0, 100%, 50%, " + totalDurationAlpha(totalGCTime, totalDuration) + ")") : ""; + // Red if GC time over GCTimePercent of total time + return (totalGCTime > GCTimePercent * totalDuration) ? + ("hsla(0, 100%, 50%, " + totalDurationAlpha(totalGCTime, totalDuration) + ")") : ""; } function totalDurationColor(totalGCTime, totalDuration) { - return (totalGCTime > GCTimePercent * totalDuration) ? "white" : "black"; + return (totalGCTime > GCTimePercent * totalDuration) ? "white" : "black"; } var sumOptionalColumns = [3, 4]; -var execOptionalColumns = [5, 6, 9]; +var execOptionalColumns = [5, 6, 7, 8, 9, 10, 13, 14, 15]; var execDataTable; var sumDataTable; function reselectCheckboxesBasedOnTaskTableState() { - var allChecked = true; - if (typeof execDataTable !== "undefined") { - for (var k = 0; k < execOptionalColumns.length; k++) { - if (execDataTable.column(execOptionalColumns[k]).visible()) { - $("[data-exec-col-idx=" + execOptionalColumns[k] + "]").prop("checked", true); - } else { - allChecked = false; - } - } - } - if (allChecked) { - $("#select-all-box").prop("checked", true); + var allChecked = true; + if (typeof execDataTable !== "undefined") { + for (var k = 0; k < execOptionalColumns.length; k++) { + if (execDataTable.column(execOptionalColumns[k]).visible()) { + $("[data-exec-col-idx=" + execOptionalColumns[k] + "]").prop("checked", true); + } else { + allChecked = false; + } } + } + if (allChecked) { + $("#select-all-box").prop("checked", true); + } } $(document).ready(function () { - setDataTableDefaults(); - - var executorsSummary = $("#active-executors"); - - getStandAloneAppId(function (appId) { - - var endPoint = createRESTEndPointForExecutorsPage(appId); - $.getJSON(endPoint, function (response, status, jqXHR) { - var allExecCnt = 0; - var allRDDBlocks = 0; - var allMemoryUsed = 0; - var allMaxMemory = 0; - var allOnHeapMemoryUsed = 0; - var allOnHeapMaxMemory = 0; - var allOffHeapMemoryUsed = 0; - var allOffHeapMaxMemory = 0; - var allDiskUsed = 0; - var allTotalCores = 0; - var allMaxTasks = 0; - var allActiveTasks = 0; - var allFailedTasks = 0; - var allCompletedTasks = 0; - var allTotalTasks = 0; - var allTotalDuration = 0; - var allTotalGCTime = 0; - var allTotalInputBytes = 0; - var allTotalShuffleRead = 0; - var allTotalShuffleWrite = 0; - var allTotalBlacklisted = 0; - - var activeExecCnt = 0; - var activeRDDBlocks = 0; - var activeMemoryUsed = 0; - var activeMaxMemory = 0; - var activeOnHeapMemoryUsed = 0; - var activeOnHeapMaxMemory = 0; - var activeOffHeapMemoryUsed = 0; - var activeOffHeapMaxMemory = 0; - var activeDiskUsed = 0; - var activeTotalCores = 0; - var activeMaxTasks = 0; - var activeActiveTasks = 0; - var activeFailedTasks = 0; - var activeCompletedTasks = 0; - var activeTotalTasks = 0; - var activeTotalDuration = 0; - var activeTotalGCTime = 0; - var activeTotalInputBytes = 0; - var activeTotalShuffleRead = 0; - var activeTotalShuffleWrite = 0; - var activeTotalBlacklisted = 0; - - var deadExecCnt = 0; - var deadRDDBlocks = 0; - var deadMemoryUsed = 0; - var deadMaxMemory = 0; - var deadOnHeapMemoryUsed = 0; - var deadOnHeapMaxMemory = 0; - var deadOffHeapMemoryUsed = 0; - var deadOffHeapMaxMemory = 0; - var deadDiskUsed = 0; - var deadTotalCores = 0; - var deadMaxTasks = 0; - var deadActiveTasks = 0; - var deadFailedTasks = 0; - var deadCompletedTasks = 0; - var deadTotalTasks = 0; - var deadTotalDuration = 0; - var deadTotalGCTime = 0; - var deadTotalInputBytes = 0; - var deadTotalShuffleRead = 0; - var deadTotalShuffleWrite = 0; - var deadTotalBlacklisted = 0; - - response.forEach(function (exec) { - var memoryMetrics = { - usedOnHeapStorageMemory: 0, - usedOffHeapStorageMemory: 0, - totalOnHeapStorageMemory: 0, - totalOffHeapStorageMemory: 0 - }; - - exec.memoryMetrics = exec.hasOwnProperty('memoryMetrics') ? exec.memoryMetrics : memoryMetrics; - }); - - response.forEach(function (exec) { - allExecCnt += 1; - allRDDBlocks += exec.rddBlocks; - allMemoryUsed += exec.memoryUsed; - allMaxMemory += exec.maxMemory; - allOnHeapMemoryUsed += exec.memoryMetrics.usedOnHeapStorageMemory; - allOnHeapMaxMemory += exec.memoryMetrics.totalOnHeapStorageMemory; - allOffHeapMemoryUsed += exec.memoryMetrics.usedOffHeapStorageMemory; - allOffHeapMaxMemory += exec.memoryMetrics.totalOffHeapStorageMemory; - allDiskUsed += exec.diskUsed; - allTotalCores += exec.totalCores; - allMaxTasks += exec.maxTasks; - allActiveTasks += exec.activeTasks; - allFailedTasks += exec.failedTasks; - allCompletedTasks += exec.completedTasks; - allTotalTasks += exec.totalTasks; - allTotalDuration += exec.totalDuration; - allTotalGCTime += exec.totalGCTime; - allTotalInputBytes += exec.totalInputBytes; - allTotalShuffleRead += exec.totalShuffleRead; - allTotalShuffleWrite += exec.totalShuffleWrite; - allTotalBlacklisted += exec.isBlacklisted ? 1 : 0; - if (exec.isActive) { - activeExecCnt += 1; - activeRDDBlocks += exec.rddBlocks; - activeMemoryUsed += exec.memoryUsed; - activeMaxMemory += exec.maxMemory; - activeOnHeapMemoryUsed += exec.memoryMetrics.usedOnHeapStorageMemory; - activeOnHeapMaxMemory += exec.memoryMetrics.totalOnHeapStorageMemory; - activeOffHeapMemoryUsed += exec.memoryMetrics.usedOffHeapStorageMemory; - activeOffHeapMaxMemory += exec.memoryMetrics.totalOffHeapStorageMemory; - activeDiskUsed += exec.diskUsed; - activeTotalCores += exec.totalCores; - activeMaxTasks += exec.maxTasks; - activeActiveTasks += exec.activeTasks; - activeFailedTasks += exec.failedTasks; - activeCompletedTasks += exec.completedTasks; - activeTotalTasks += exec.totalTasks; - activeTotalDuration += exec.totalDuration; - activeTotalGCTime += exec.totalGCTime; - activeTotalInputBytes += exec.totalInputBytes; - activeTotalShuffleRead += exec.totalShuffleRead; - activeTotalShuffleWrite += exec.totalShuffleWrite; - activeTotalBlacklisted += exec.isBlacklisted ? 1 : 0; + setDataTableDefaults(); + + var executorsSummary = $("#active-executors"); + + getStandAloneAppId(function (appId) { + + var endPoint = createRESTEndPointForExecutorsPage(appId); + $.getJSON(endPoint, function (response, _ignored_status, _ignored_jqXHR) { + var allExecCnt = 0; + var allRDDBlocks = 0; + var allMemoryUsed = 0; + var allMaxMemory = 0; + var allOnHeapMemoryUsed = 0; + var allOnHeapMaxMemory = 0; + var allOffHeapMemoryUsed = 0; + var allOffHeapMaxMemory = 0; + var allDiskUsed = 0; + var allTotalCores = 0; + var allMaxTasks = 0; + var allActiveTasks = 0; + var allFailedTasks = 0; + var allCompletedTasks = 0; + var allTotalTasks = 0; + var allTotalDuration = 0; + var allTotalGCTime = 0; + var allTotalInputBytes = 0; + var allTotalShuffleRead = 0; + var allTotalShuffleWrite = 0; + var allTotalExcluded = 0; + + var activeExecCnt = 0; + var activeRDDBlocks = 0; + var activeMemoryUsed = 0; + var activeMaxMemory = 0; + var activeOnHeapMemoryUsed = 0; + var activeOnHeapMaxMemory = 0; + var activeOffHeapMemoryUsed = 0; + var activeOffHeapMaxMemory = 0; + var activeDiskUsed = 0; + var activeTotalCores = 0; + var activeMaxTasks = 0; + var activeActiveTasks = 0; + var activeFailedTasks = 0; + var activeCompletedTasks = 0; + var activeTotalTasks = 0; + var activeTotalDuration = 0; + var activeTotalGCTime = 0; + var activeTotalInputBytes = 0; + var activeTotalShuffleRead = 0; + var activeTotalShuffleWrite = 0; + var activeTotalExcluded = 0; + + var deadExecCnt = 0; + var deadRDDBlocks = 0; + var deadMemoryUsed = 0; + var deadMaxMemory = 0; + var deadOnHeapMemoryUsed = 0; + var deadOnHeapMaxMemory = 0; + var deadOffHeapMemoryUsed = 0; + var deadOffHeapMaxMemory = 0; + var deadDiskUsed = 0; + var deadTotalCores = 0; + var deadMaxTasks = 0; + var deadActiveTasks = 0; + var deadFailedTasks = 0; + var deadCompletedTasks = 0; + var deadTotalTasks = 0; + var deadTotalDuration = 0; + var deadTotalGCTime = 0; + var deadTotalInputBytes = 0; + var deadTotalShuffleRead = 0; + var deadTotalShuffleWrite = 0; + var deadTotalExcluded = 0; + + response.forEach(function (exec) { + var memoryMetrics = { + usedOnHeapStorageMemory: 0, + usedOffHeapStorageMemory: 0, + totalOnHeapStorageMemory: 0, + totalOffHeapStorageMemory: 0 + }; + + // TODO: Replace hasOwnProperty with prototype.hasOwnProperty after we find it's safe to do. + /* eslint-disable no-prototype-builtins */ + exec.memoryMetrics = exec.hasOwnProperty('memoryMetrics') ? exec.memoryMetrics : memoryMetrics; + }); + + response.forEach(function (exec) { + allExecCnt += 1; + allRDDBlocks += exec.rddBlocks; + allMemoryUsed += exec.memoryUsed; + allMaxMemory += exec.maxMemory; + allOnHeapMemoryUsed += exec.memoryMetrics.usedOnHeapStorageMemory; + allOnHeapMaxMemory += exec.memoryMetrics.totalOnHeapStorageMemory; + allOffHeapMemoryUsed += exec.memoryMetrics.usedOffHeapStorageMemory; + allOffHeapMaxMemory += exec.memoryMetrics.totalOffHeapStorageMemory; + allDiskUsed += exec.diskUsed; + allTotalCores += exec.totalCores; + allMaxTasks += exec.maxTasks; + allActiveTasks += exec.activeTasks; + allFailedTasks += exec.failedTasks; + allCompletedTasks += exec.completedTasks; + allTotalTasks += exec.totalTasks; + allTotalDuration += exec.totalDuration; + allTotalGCTime += exec.totalGCTime; + allTotalInputBytes += exec.totalInputBytes; + allTotalShuffleRead += exec.totalShuffleRead; + allTotalShuffleWrite += exec.totalShuffleWrite; + allTotalExcluded += exec.isExcluded ? 1 : 0; + if (exec.isActive) { + activeExecCnt += 1; + activeRDDBlocks += exec.rddBlocks; + activeMemoryUsed += exec.memoryUsed; + activeMaxMemory += exec.maxMemory; + activeOnHeapMemoryUsed += exec.memoryMetrics.usedOnHeapStorageMemory; + activeOnHeapMaxMemory += exec.memoryMetrics.totalOnHeapStorageMemory; + activeOffHeapMemoryUsed += exec.memoryMetrics.usedOffHeapStorageMemory; + activeOffHeapMaxMemory += exec.memoryMetrics.totalOffHeapStorageMemory; + activeDiskUsed += exec.diskUsed; + activeTotalCores += exec.totalCores; + activeMaxTasks += exec.maxTasks; + activeActiveTasks += exec.activeTasks; + activeFailedTasks += exec.failedTasks; + activeCompletedTasks += exec.completedTasks; + activeTotalTasks += exec.totalTasks; + activeTotalDuration += exec.totalDuration; + activeTotalGCTime += exec.totalGCTime; + activeTotalInputBytes += exec.totalInputBytes; + activeTotalShuffleRead += exec.totalShuffleRead; + activeTotalShuffleWrite += exec.totalShuffleWrite; + activeTotalExcluded += exec.isExcluded ? 1 : 0; + } else { + deadExecCnt += 1; + deadRDDBlocks += exec.rddBlocks; + deadMemoryUsed += exec.memoryUsed; + deadMaxMemory += exec.maxMemory; + deadOnHeapMemoryUsed += exec.memoryMetrics.usedOnHeapStorageMemory; + deadOnHeapMaxMemory += exec.memoryMetrics.totalOnHeapStorageMemory; + deadOffHeapMemoryUsed += exec.memoryMetrics.usedOffHeapStorageMemory; + deadOffHeapMaxMemory += exec.memoryMetrics.totalOffHeapStorageMemory; + deadDiskUsed += exec.diskUsed; + deadTotalCores += exec.totalCores; + deadMaxTasks += exec.maxTasks; + deadActiveTasks += exec.activeTasks; + deadFailedTasks += exec.failedTasks; + deadCompletedTasks += exec.completedTasks; + deadTotalTasks += exec.totalTasks; + deadTotalDuration += exec.totalDuration; + deadTotalGCTime += exec.totalGCTime; + deadTotalInputBytes += exec.totalInputBytes; + deadTotalShuffleRead += exec.totalShuffleRead; + deadTotalShuffleWrite += exec.totalShuffleWrite; + deadTotalExcluded += exec.isExcluded ? 1 : 0; // todo - TEST BACKWARDS compatibility history? + } + }); + + var totalSummary = { + "execCnt": ( "Total(" + allExecCnt + ")"), + "allRDDBlocks": allRDDBlocks, + "allMemoryUsed": allMemoryUsed, + "allMaxMemory": allMaxMemory, + "allOnHeapMemoryUsed": allOnHeapMemoryUsed, + "allOnHeapMaxMemory": allOnHeapMaxMemory, + "allOffHeapMemoryUsed": allOffHeapMemoryUsed, + "allOffHeapMaxMemory": allOffHeapMaxMemory, + "allDiskUsed": allDiskUsed, + "allTotalCores": allTotalCores, + "allMaxTasks": allMaxTasks, + "allActiveTasks": allActiveTasks, + "allFailedTasks": allFailedTasks, + "allCompletedTasks": allCompletedTasks, + "allTotalTasks": allTotalTasks, + "allTotalDuration": allTotalDuration, + "allTotalGCTime": allTotalGCTime, + "allTotalInputBytes": allTotalInputBytes, + "allTotalShuffleRead": allTotalShuffleRead, + "allTotalShuffleWrite": allTotalShuffleWrite, + "allTotalExcluded": allTotalExcluded + }; + var activeSummary = { + "execCnt": ( "Active(" + activeExecCnt + ")"), + "allRDDBlocks": activeRDDBlocks, + "allMemoryUsed": activeMemoryUsed, + "allMaxMemory": activeMaxMemory, + "allOnHeapMemoryUsed": activeOnHeapMemoryUsed, + "allOnHeapMaxMemory": activeOnHeapMaxMemory, + "allOffHeapMemoryUsed": activeOffHeapMemoryUsed, + "allOffHeapMaxMemory": activeOffHeapMaxMemory, + "allDiskUsed": activeDiskUsed, + "allTotalCores": activeTotalCores, + "allMaxTasks": activeMaxTasks, + "allActiveTasks": activeActiveTasks, + "allFailedTasks": activeFailedTasks, + "allCompletedTasks": activeCompletedTasks, + "allTotalTasks": activeTotalTasks, + "allTotalDuration": activeTotalDuration, + "allTotalGCTime": activeTotalGCTime, + "allTotalInputBytes": activeTotalInputBytes, + "allTotalShuffleRead": activeTotalShuffleRead, + "allTotalShuffleWrite": activeTotalShuffleWrite, + "allTotalExcluded": activeTotalExcluded + }; + var deadSummary = { + "execCnt": ( "Dead(" + deadExecCnt + ")" ), + "allRDDBlocks": deadRDDBlocks, + "allMemoryUsed": deadMemoryUsed, + "allMaxMemory": deadMaxMemory, + "allOnHeapMemoryUsed": deadOnHeapMemoryUsed, + "allOnHeapMaxMemory": deadOnHeapMaxMemory, + "allOffHeapMemoryUsed": deadOffHeapMemoryUsed, + "allOffHeapMaxMemory": deadOffHeapMaxMemory, + "allDiskUsed": deadDiskUsed, + "allTotalCores": deadTotalCores, + "allMaxTasks": deadMaxTasks, + "allActiveTasks": deadActiveTasks, + "allFailedTasks": deadFailedTasks, + "allCompletedTasks": deadCompletedTasks, + "allTotalTasks": deadTotalTasks, + "allTotalDuration": deadTotalDuration, + "allTotalGCTime": deadTotalGCTime, + "allTotalInputBytes": deadTotalInputBytes, + "allTotalShuffleRead": deadTotalShuffleRead, + "allTotalShuffleWrite": deadTotalShuffleWrite, + "allTotalExcluded": deadTotalExcluded + }; + + var data = {executors: response, "execSummary": [activeSummary, deadSummary, totalSummary]}; + $.get(createTemplateURI(appId, "executorspage"), function (template) { + + executorsSummary.append(Mustache.render($(template).filter("#executors-summary-template").html(), data)); + var selector = "#active-executors-table"; + var conf = { + "data": response, + "columns": [ + { + data: function (row, type) { + return type !== 'display' ? (isNaN(row.id) ? 0 : row.id ) : row.id; + } + }, + {data: 'hostPort'}, + { + data: 'isActive', + render: function (data, type, row) { + return formatStatus (data, type, row); + } + }, + {data: 'rddBlocks'}, + { + data: function (row, type) { + if (type !== 'display') + return row.memoryUsed; + else + return (formatBytes(row.memoryUsed, type) + ' / ' + + formatBytes(row.maxMemory, type)); + } + }, + { + data: function (row, type) { + if (type !== 'display') + return row.memoryMetrics.usedOnHeapStorageMemory; + else + return (formatBytes(row.memoryMetrics.usedOnHeapStorageMemory, type) + ' / ' + + formatBytes(row.memoryMetrics.totalOnHeapStorageMemory, type)); + } + }, + { + data: function (row, type) { + if (type !== 'display') + return row.memoryMetrics.usedOffHeapStorageMemory; + else + return (formatBytes(row.memoryMetrics.usedOffHeapStorageMemory, type) + ' / ' + + formatBytes(row.memoryMetrics.totalOffHeapStorageMemory, type)); + } + }, + { + data: function (row, type) { + var peakMemoryMetrics = row.peakMemoryMetrics; + if (typeof peakMemoryMetrics !== 'undefined') { + if (type !== 'display') + return peakMemoryMetrics.JVMHeapMemory; + else + return (formatBytes(peakMemoryMetrics.JVMHeapMemory, type) + ' / ' + + formatBytes(peakMemoryMetrics.JVMOffHeapMemory, type)); } else { - deadExecCnt += 1; - deadRDDBlocks += exec.rddBlocks; - deadMemoryUsed += exec.memoryUsed; - deadMaxMemory += exec.maxMemory; - deadOnHeapMemoryUsed += exec.memoryMetrics.usedOnHeapStorageMemory; - deadOnHeapMaxMemory += exec.memoryMetrics.totalOnHeapStorageMemory; - deadOffHeapMemoryUsed += exec.memoryMetrics.usedOffHeapStorageMemory; - deadOffHeapMaxMemory += exec.memoryMetrics.totalOffHeapStorageMemory; - deadDiskUsed += exec.diskUsed; - deadTotalCores += exec.totalCores; - deadMaxTasks += exec.maxTasks; - deadActiveTasks += exec.activeTasks; - deadFailedTasks += exec.failedTasks; - deadCompletedTasks += exec.completedTasks; - deadTotalTasks += exec.totalTasks; - deadTotalDuration += exec.totalDuration; - deadTotalGCTime += exec.totalGCTime; - deadTotalInputBytes += exec.totalInputBytes; - deadTotalShuffleRead += exec.totalShuffleRead; - deadTotalShuffleWrite += exec.totalShuffleWrite; - deadTotalBlacklisted += exec.isBlacklisted ? 1 : 0; + if (type !== 'display') { + return 0; + } else { + return '0.0 B / 0.0 B'; + } } - }); - - var totalSummary = { - "execCnt": ( "Total(" + allExecCnt + ")"), - "allRDDBlocks": allRDDBlocks, - "allMemoryUsed": allMemoryUsed, - "allMaxMemory": allMaxMemory, - "allOnHeapMemoryUsed": allOnHeapMemoryUsed, - "allOnHeapMaxMemory": allOnHeapMaxMemory, - "allOffHeapMemoryUsed": allOffHeapMemoryUsed, - "allOffHeapMaxMemory": allOffHeapMaxMemory, - "allDiskUsed": allDiskUsed, - "allTotalCores": allTotalCores, - "allMaxTasks": allMaxTasks, - "allActiveTasks": allActiveTasks, - "allFailedTasks": allFailedTasks, - "allCompletedTasks": allCompletedTasks, - "allTotalTasks": allTotalTasks, - "allTotalDuration": allTotalDuration, - "allTotalGCTime": allTotalGCTime, - "allTotalInputBytes": allTotalInputBytes, - "allTotalShuffleRead": allTotalShuffleRead, - "allTotalShuffleWrite": allTotalShuffleWrite, - "allTotalBlacklisted": allTotalBlacklisted - }; - var activeSummary = { - "execCnt": ( "Active(" + activeExecCnt + ")"), - "allRDDBlocks": activeRDDBlocks, - "allMemoryUsed": activeMemoryUsed, - "allMaxMemory": activeMaxMemory, - "allOnHeapMemoryUsed": activeOnHeapMemoryUsed, - "allOnHeapMaxMemory": activeOnHeapMaxMemory, - "allOffHeapMemoryUsed": activeOffHeapMemoryUsed, - "allOffHeapMaxMemory": activeOffHeapMaxMemory, - "allDiskUsed": activeDiskUsed, - "allTotalCores": activeTotalCores, - "allMaxTasks": activeMaxTasks, - "allActiveTasks": activeActiveTasks, - "allFailedTasks": activeFailedTasks, - "allCompletedTasks": activeCompletedTasks, - "allTotalTasks": activeTotalTasks, - "allTotalDuration": activeTotalDuration, - "allTotalGCTime": activeTotalGCTime, - "allTotalInputBytes": activeTotalInputBytes, - "allTotalShuffleRead": activeTotalShuffleRead, - "allTotalShuffleWrite": activeTotalShuffleWrite, - "allTotalBlacklisted": activeTotalBlacklisted - }; - var deadSummary = { - "execCnt": ( "Dead(" + deadExecCnt + ")" ), - "allRDDBlocks": deadRDDBlocks, - "allMemoryUsed": deadMemoryUsed, - "allMaxMemory": deadMaxMemory, - "allOnHeapMemoryUsed": deadOnHeapMemoryUsed, - "allOnHeapMaxMemory": deadOnHeapMaxMemory, - "allOffHeapMemoryUsed": deadOffHeapMemoryUsed, - "allOffHeapMaxMemory": deadOffHeapMaxMemory, - "allDiskUsed": deadDiskUsed, - "allTotalCores": deadTotalCores, - "allMaxTasks": deadMaxTasks, - "allActiveTasks": deadActiveTasks, - "allFailedTasks": deadFailedTasks, - "allCompletedTasks": deadCompletedTasks, - "allTotalTasks": deadTotalTasks, - "allTotalDuration": deadTotalDuration, - "allTotalGCTime": deadTotalGCTime, - "allTotalInputBytes": deadTotalInputBytes, - "allTotalShuffleRead": deadTotalShuffleRead, - "allTotalShuffleWrite": deadTotalShuffleWrite, - "allTotalBlacklisted": deadTotalBlacklisted + } + }, + { + data: function (row, type) { + var peakMemoryMetrics = row.peakMemoryMetrics; + if (typeof peakMemoryMetrics !== 'undefined') { + if (type !== 'display') + return peakMemoryMetrics.OnHeapExecutionMemory; + else + return (formatBytes(peakMemoryMetrics.OnHeapExecutionMemory, type) + ' / ' + + formatBytes(peakMemoryMetrics.OffHeapExecutionMemory, type)); + } else { + if (type !== 'display') { + return 0; + } else { + return '0.0 B / 0.0 B'; + } + } + } + }, + { + data: function (row, type) { + var peakMemoryMetrics = row.peakMemoryMetrics; + if (typeof peakMemoryMetrics !== 'undefined') { + if (type !== 'display') + return peakMemoryMetrics.OnHeapStorageMemory; + else + return (formatBytes(peakMemoryMetrics.OnHeapStorageMemory, type) + ' / ' + + formatBytes(peakMemoryMetrics.OffHeapStorageMemory, type)); + } else { + if (type !== 'display') { + return 0; + } else { + return '0.0 B / 0.0 B'; + } + } + } + }, + { + data: function (row, type) { + var peakMemoryMetrics = row.peakMemoryMetrics; + if (typeof peakMemoryMetrics !== 'undefined') { + if (type !== 'display') + return peakMemoryMetrics.DirectPoolMemory; + else + return (formatBytes(peakMemoryMetrics.DirectPoolMemory, type) + ' / ' + + formatBytes(peakMemoryMetrics.MappedPoolMemory, type)); + } else { + if (type !== 'display') { + return 0; + } else { + return '0.0 B / 0.0 B'; + } + } + } + }, + {data: 'diskUsed', render: formatBytes}, + {data: 'totalCores'}, + {name: 'resourcesCol', data: 'resources', render: formatResourceCells, orderable: false}, + {name: 'resourceProfileIdCol', data: 'resourceProfileId'}, + { + data: 'activeTasks', + "fnCreatedCell": function (nTd, sData, oData, _ignored_iRow, _ignored_iCol) { + if (sData > 0) { + $(nTd).css('color', 'white'); + $(nTd).css('background', activeTasksStyle(oData.activeTasks, oData.maxTasks)); + } + } + }, + { + data: 'failedTasks', + "fnCreatedCell": function (nTd, sData, oData, _ignored_iRow, _ignored_iCol) { + if (sData > 0) { + $(nTd).css('color', 'white'); + $(nTd).css('background', failedTasksStyle(oData.failedTasks, oData.totalTasks)); + } + } + }, + {data: 'completedTasks'}, + {data: 'totalTasks'}, + { + data: function (row, type) { + return type === 'display' ? (formatDuration(row.totalDuration) + ' (' + formatDuration(row.totalGCTime) + ')') : row.totalDuration + }, + "fnCreatedCell": function (nTd, sData, oData, _ignored_iRow, _ignored_iCol) { + if (oData.totalDuration > 0) { + $(nTd).css('color', totalDurationColor(oData.totalGCTime, oData.totalDuration)); + $(nTd).css('background', totalDurationStyle(oData.totalGCTime, oData.totalDuration)); + } + } + }, + {data: 'totalInputBytes', render: formatBytes}, + {data: 'totalShuffleRead', render: formatBytes}, + {data: 'totalShuffleWrite', render: formatBytes}, + {name: 'executorLogsCol', data: 'executorLogs', render: formatLogsCells}, + { + name: 'threadDumpCol', + data: 'id', render: function (data, type) { + return type === 'display' ? ("Thread Dump" ) : data; + } + }, + { + data: 'removeReason', + render: formatLossReason + } + ], + "order": [[0, "asc"]], + "columnDefs": [ + {"visible": false, "targets": 5}, + {"visible": false, "targets": 6}, + {"visible": false, "targets": 7}, + {"visible": false, "targets": 8}, + {"visible": false, "targets": 9}, + {"visible": false, "targets": 10}, + {"visible": false, "targets": 13}, + {"visible": false, "targets": 14} + ], + "deferRender": true + }; + + execDataTable = $(selector).DataTable(conf); + execDataTable.column('executorLogsCol:name').visible(logsExist(response)); + execDataTable.column('threadDumpCol:name').visible(getThreadDumpEnabled()); + $('#active-executors [data-toggle="tooltip"]').tooltip(); + + // This section should be visible once API gives the response. + $('.active-process-container').hide(); + var endPoint = createRESTEndPointForMiscellaneousProcess(appId); + $.getJSON(endPoint, function( response, _ignored_status, _ignored_jqXHR ) { + if (response.length) { + var processSummaryResponse = response; + var processSummaryConf = { + "data": processSummaryResponse, + "columns": [{ + data: "id" + }, + { + data: "hostPort" + }, + { + data: function(row) { + return formatProcessStatus(row.isActive); + } + }, + { + data: "totalCores" + }, + { + data: "processLogs", + render: formatLogsCells + }, + ], + "deferRender": true, + "order": [ + [0, "asc"] + ], + "bAutoWidth": false, + "oLanguage": { + "sEmptyTable": "No data to show yet" + } }; + $("#active-process-table").DataTable(processSummaryConf); + $('.active-process-container').show() + } + }); - var data = {executors: response, "execSummary": [activeSummary, deadSummary, totalSummary]}; - $.get(createTemplateURI(appId, "executorspage"), function (template) { - - executorsSummary.append(Mustache.render($(template).filter("#executors-summary-template").html(), data)); - var selector = "#active-executors-table"; - var conf = { - "data": response, - "columns": [ - { - data: function (row, type) { - return type !== 'display' ? (isNaN(row.id) ? 0 : row.id ) : row.id; - } - }, - {data: 'hostPort'}, - { - data: 'isActive', - render: function (data, type, row) { - return formatStatus (data, type, row); - } - }, - {data: 'rddBlocks'}, - { - data: function (row, type) { - if (type !== 'display') - return row.memoryUsed; - else - return (formatBytes(row.memoryUsed, type) + ' / ' + - formatBytes(row.maxMemory, type)); - } - }, - { - data: function (row, type) { - if (type !== 'display') - return row.memoryMetrics.usedOnHeapStorageMemory; - else - return (formatBytes(row.memoryMetrics.usedOnHeapStorageMemory, type) + ' / ' + - formatBytes(row.memoryMetrics.totalOnHeapStorageMemory, type)); - } - }, - { - data: function (row, type) { - if (type !== 'display') - return row.memoryMetrics.usedOffHeapStorageMemory; - else - return (formatBytes(row.memoryMetrics.usedOffHeapStorageMemory, type) + ' / ' + - formatBytes(row.memoryMetrics.totalOffHeapStorageMemory, type)); - } - }, - {data: 'diskUsed', render: formatBytes}, - {data: 'totalCores'}, - {name: 'resourcesCol', data: 'resources', render: formatResourceCells, orderable: false}, - { - data: 'activeTasks', - "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { - if (sData > 0) { - $(nTd).css('color', 'white'); - $(nTd).css('background', activeTasksStyle(oData.activeTasks, oData.maxTasks)); - } - } - }, - { - data: 'failedTasks', - "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { - if (sData > 0) { - $(nTd).css('color', 'white'); - $(nTd).css('background', failedTasksStyle(oData.failedTasks, oData.totalTasks)); - } - } - }, - {data: 'completedTasks'}, - {data: 'totalTasks'}, - { - data: function (row, type) { - return type === 'display' ? (formatDuration(row.totalDuration) + ' (' + formatDuration(row.totalGCTime) + ')') : row.totalDuration - }, - "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { - if (oData.totalDuration > 0) { - $(nTd).css('color', totalDurationColor(oData.totalGCTime, oData.totalDuration)); - $(nTd).css('background', totalDurationStyle(oData.totalGCTime, oData.totalDuration)); - } - } - }, - {data: 'totalInputBytes', render: formatBytes}, - {data: 'totalShuffleRead', render: formatBytes}, - {data: 'totalShuffleWrite', render: formatBytes}, - {name: 'executorLogsCol', data: 'executorLogs', render: formatLogsCells}, - { - name: 'threadDumpCol', - data: 'id', render: function (data, type) { - return type === 'display' ? ("Thread Dump" ) : data; - } - } - ], - "order": [[0, "asc"]], - "columnDefs": [ - {"visible": false, "targets": 5}, - {"visible": false, "targets": 6}, - {"visible": false, "targets": 9} - ], - "deferRender": true - }; - - execDataTable = $(selector).DataTable(conf); - execDataTable.column('executorLogsCol:name').visible(logsExist(response)); - execDataTable.column('threadDumpCol:name').visible(getThreadDumpEnabled()); - $('#active-executors [data-toggle="tooltip"]').tooltip(); - - var sumSelector = "#summary-execs-table"; - var sumConf = { - "data": [activeSummary, deadSummary, totalSummary], - "columns": [ - { - data: 'execCnt', - "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { - $(nTd).css('font-weight', 'bold'); - } - }, - {data: 'allRDDBlocks'}, - { - data: function (row, type) { - if (type !== 'display') - return row.allMemoryUsed - else - return (formatBytes(row.allMemoryUsed, type) + ' / ' + - formatBytes(row.allMaxMemory, type)); - } - }, - { - data: function (row, type) { - if (type !== 'display') - return row.allOnHeapMemoryUsed; - else - return (formatBytes(row.allOnHeapMemoryUsed, type) + ' / ' + - formatBytes(row.allOnHeapMaxMemory, type)); - } - }, - { - data: function (row, type) { - if (type !== 'display') - return row.allOffHeapMemoryUsed; - else - return (formatBytes(row.allOffHeapMemoryUsed, type) + ' / ' + - formatBytes(row.allOffHeapMaxMemory, type)); - } - }, - {data: 'allDiskUsed', render: formatBytes}, - {data: 'allTotalCores'}, - { - data: 'allActiveTasks', - "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { - if (sData > 0) { - $(nTd).css('color', 'white'); - $(nTd).css('background', activeTasksStyle(oData.allActiveTasks, oData.allMaxTasks)); - } - } - }, - { - data: 'allFailedTasks', - "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { - if (sData > 0) { - $(nTd).css('color', 'white'); - $(nTd).css('background', failedTasksStyle(oData.allFailedTasks, oData.allTotalTasks)); - } - } - }, - {data: 'allCompletedTasks'}, - {data: 'allTotalTasks'}, - { - data: function (row, type) { - return type === 'display' ? (formatDuration(row.allTotalDuration) + ' (' + formatDuration(row.allTotalGCTime) + ')') : row.allTotalDuration - }, - "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) { - if (oData.allTotalDuration > 0) { - $(nTd).css('color', totalDurationColor(oData.allTotalGCTime, oData.allTotalDuration)); - $(nTd).css('background', totalDurationStyle(oData.allTotalGCTime, oData.allTotalDuration)); - } - } - }, - {data: 'allTotalInputBytes', render: formatBytes}, - {data: 'allTotalShuffleRead', render: formatBytes}, - {data: 'allTotalShuffleWrite', render: formatBytes}, - {data: 'allTotalBlacklisted'} - ], - "paging": false, - "searching": false, - "info": false, - "columnDefs": [ - {"visible": false, "targets": 3}, - {"visible": false, "targets": 4} - ] - - }; - - sumDataTable = $(sumSelector).DataTable(sumConf); - $('#execSummary [data-toggle="tooltip"]').tooltip(); - - $("#showAdditionalMetrics").append( - "" + - "
" + - "
Select All
" + - "
On Heap Memory
" + - "
Off Heap Memory
" + - "
Resources
" + - "
"); - - reselectCheckboxesBasedOnTaskTableState(); - - $("#additionalMetrics").click(function() { - $("#arrowtoggle-optional-metrics").toggleClass("arrow-open arrow-closed"); - $("#toggle-metrics").toggleClass("d-none"); - if (window.localStorage) { - window.localStorage.setItem("arrowtoggle-optional-metrics-class", $("#arrowtoggle-optional-metrics").attr('class')); - } - }); - - $(".toggle-vis").on("click", function() { - var thisBox = $(this); - if (thisBox.is("#select-all-box")) { - var sumColumn = sumDataTable.columns(sumOptionalColumns); - var execColumn = execDataTable.columns(execOptionalColumns); - if (thisBox.is(":checked")) { - $(".toggle-vis").prop("checked", true); - sumColumn.visible(true); - execColumn.visible(true); - } else { - $(".toggle-vis").prop("checked", false); - sumColumn.visible(false); - execColumn.visible(false); - } - } else { - var execColIdx = thisBox.attr("data-exec-col-idx"); - var execCol = execDataTable.column(execColIdx); - execCol.visible(!execCol.visible()); - var sumColIdx = thisBox.attr("data-sum-col-idx"); - if (sumColIdx) { - var sumCol = sumDataTable.column(sumColIdx); - sumCol.visible(!sumCol.visible()); - } - } - }); - - if (window.localStorage) { - if (window.localStorage.getItem("arrowtoggle-optional-metrics-class") != null && - window.localStorage.getItem("arrowtoggle-optional-metrics-class").includes("arrow-open")) { - $("#arrowtoggle-optional-metrics").toggleClass("arrow-open arrow-closed"); - $("#toggle-metrics").toggleClass("d-none"); - } + var sumSelector = "#summary-execs-table"; + var sumConf = { + "data": [activeSummary, deadSummary, totalSummary], + "columns": [ + { + data: 'execCnt', + "fnCreatedCell": function (nTd, _ignored_sData, _ignored_oData, _ignored_iRow, _ignored_iCol) { + $(nTd).css('font-weight', 'bold'); + } + }, + {data: 'allRDDBlocks'}, + { + data: function (row, type) { + if (type !== 'display') + return row.allMemoryUsed; + else + return (formatBytes(row.allMemoryUsed, type) + ' / ' + + formatBytes(row.allMaxMemory, type)); + } + }, + { + data: function (row, type) { + if (type !== 'display') + return row.allOnHeapMemoryUsed; + else + return (formatBytes(row.allOnHeapMemoryUsed, type) + ' / ' + + formatBytes(row.allOnHeapMaxMemory, type)); + } + }, + { + data: function (row, type) { + if (type !== 'display') + return row.allOffHeapMemoryUsed; + else + return (formatBytes(row.allOffHeapMemoryUsed, type) + ' / ' + + formatBytes(row.allOffHeapMaxMemory, type)); + } + }, + {data: 'allDiskUsed', render: formatBytes}, + {data: 'allTotalCores'}, + { + data: 'allActiveTasks', + "fnCreatedCell": function (nTd, sData, oData, _ignored_iRow, _ignored_iCol) { + if (sData > 0) { + $(nTd).css('color', 'white'); + $(nTd).css('background', activeTasksStyle(oData.allActiveTasks, oData.allMaxTasks)); + } + } + }, + { + data: 'allFailedTasks', + "fnCreatedCell": function (nTd, sData, oData, _ignored_iRow, _ignored_iCol) { + if (sData > 0) { + $(nTd).css('color', 'white'); + $(nTd).css('background', failedTasksStyle(oData.allFailedTasks, oData.allTotalTasks)); } - }); + } + }, + {data: 'allCompletedTasks'}, + {data: 'allTotalTasks'}, + { + data: function (row, type) { + return type === 'display' ? (formatDuration(row.allTotalDuration) + ' (' + formatDuration(row.allTotalGCTime) + ')') : row.allTotalDuration + }, + "fnCreatedCell": function (nTd, sData, oData, _ignored_iRow, _ignored_iCol) { + if (oData.allTotalDuration > 0) { + $(nTd).css('color', totalDurationColor(oData.allTotalGCTime, oData.allTotalDuration)); + $(nTd).css('background', totalDurationStyle(oData.allTotalGCTime, oData.allTotalDuration)); + } + } + }, + {data: 'allTotalInputBytes', render: formatBytes}, + {data: 'allTotalShuffleRead', render: formatBytes}, + {data: 'allTotalShuffleWrite', render: formatBytes}, + {data: 'allTotalExcluded'} + ], + "paging": false, + "searching": false, + "info": false, + "columnDefs": [ + {"visible": false, "targets": 3}, + {"visible": false, "targets": 4} + ] + + }; + + sumDataTable = $(sumSelector).DataTable(sumConf); + $('#execSummary [data-toggle="tooltip"]').tooltip(); + + $("#showAdditionalMetrics").append( + "" + + "
" + + "
Select All
" + + "
On Heap Memory
" + + "
Off Heap Memory
" + + "
Peak JVM Memory OnHeap / OffHeap
" + + "
Peak Execution Memory OnHeap / OffHeap
" + + "
Peak Storage Memory OnHeap / OffHeap
" + + "
Peak Pool Memory Direct / Mapped
" + + "
Resources
" + + "
Resource Profile Id
" + + "
Exec Loss Reason
" + + "
"); + + reselectCheckboxesBasedOnTaskTableState(); + + $("#additionalMetrics").click(function() { + $("#arrowtoggle-optional-metrics").toggleClass("arrow-open arrow-closed"); + $("#toggle-metrics").toggleClass("d-none"); + if (window.localStorage) { + window.localStorage.setItem("arrowtoggle-optional-metrics-class", $("#arrowtoggle-optional-metrics").attr('class')); + } }); + + $(".toggle-vis").on("click", function() { + var thisBox = $(this); + if (thisBox.is("#select-all-box")) { + var sumColumn = sumDataTable.columns(sumOptionalColumns); + var execColumn = execDataTable.columns(execOptionalColumns); + if (thisBox.is(":checked")) { + $(".toggle-vis").prop("checked", true); + sumColumn.visible(true); + execColumn.visible(true); + } else { + $(".toggle-vis").prop("checked", false); + sumColumn.visible(false); + execColumn.visible(false); + } + } else { + var execColIdx = thisBox.attr("data-exec-col-idx"); + var execCol = execDataTable.column(execColIdx); + execCol.visible(!execCol.visible()); + var sumColIdx = thisBox.attr("data-sum-col-idx"); + if (sumColIdx) { + var sumCol = sumDataTable.column(sumColIdx); + sumCol.visible(!sumCol.visible()); + } + } + }); + + if (window.localStorage) { + if (window.localStorage.getItem("arrowtoggle-optional-metrics-class") != null && + window.localStorage.getItem("arrowtoggle-optional-metrics-class").includes("arrow-open")) { + $("#arrowtoggle-optional-metrics").toggleClass("arrow-open arrow-closed"); + $("#toggle-metrics").toggleClass("d-none"); + } + } + }); }); + }); }); diff --git a/core/src/main/resources/org/apache/spark/ui/static/historypage-common.js b/core/src/main/resources/org/apache/spark/ui/static/historypage-common.js index 4cfe46ec914ae..cd8cf098ef1c0 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/historypage-common.js +++ b/core/src/main/resources/org/apache/spark/ui/static/historypage-common.js @@ -15,6 +15,8 @@ * limitations under the License. */ +/* global $, formatTimeMillis, getTimeZone */ + $(document).ready(function() { if ($('#last-updated').length) { var lastUpdatedMillis = Number($('#last-updated').text()); diff --git a/core/src/main/resources/org/apache/spark/ui/static/historypage-template.html b/core/src/main/resources/org/apache/spark/ui/static/historypage-template.html index 33eb7bfa671bc..5427125cb3b54 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/historypage-template.html +++ b/core/src/main/resources/org/apache/spark/ui/static/historypage-template.html @@ -75,26 +75,6 @@ - {{#applications}} - - {{version}} - {{id}} - {{name}} - {{#attempts}} - {{#hasMultipleAttempts}} - {{attemptId}} - {{/hasMultipleAttempts}} - {{startTime}} - {{#showCompletedColumns}} - {{endTime}} - {{duration}} - {{/showCompletedColumns}} - {{sparkUser}} - {{lastUpdated}} - Download - {{/attempts}} - - {{/applications}} diff --git a/core/src/main/resources/org/apache/spark/ui/static/historypage.js b/core/src/main/resources/org/apache/spark/ui/static/historypage.js index 4df5f07f077d7..b334bceb5a039 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/historypage.js +++ b/core/src/main/resources/org/apache/spark/ui/static/historypage.js @@ -15,11 +15,15 @@ * limitations under the License. */ +/* global $, Mustache, formatDuration, formatTimeMillis, jQuery, uiRoot */ + var appLimit = -1; +/* eslint-disable no-unused-vars */ function setAppLimit(val) { - appLimit = val; + appLimit = val; } +/* eslint-enable no-unused-vars*/ function makeIdNumeric(id) { var strs = id.split("_"); @@ -30,8 +34,8 @@ function makeIdNumeric(id) { var resl = strs[0] + "_" + strs[1] + "_"; var diff = 10 - appSeqNum.length; while (diff > 0) { - resl += "0"; // padding 0 before the app sequence number to make sure it has 10 characters - diff--; + resl += "0"; // padding 0 before the app sequence number to make sure it has 10 characters + diff--; } resl += appSeqNum; return resl; @@ -39,7 +43,7 @@ function makeIdNumeric(id) { function getParameterByName(name, searchString) { var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), - results = regex.exec(searchString); + results = regex.exec(searchString); return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); } @@ -56,154 +60,185 @@ function getColumnIndex(columns, columnName) { } jQuery.extend( jQuery.fn.dataTableExt.oSort, { - "title-numeric-pre": function ( a ) { - var x = a.match(/title="*(-?[0-9\.]+)/)[1]; - return parseFloat( x ); - }, + "title-numeric-pre": function ( a ) { + var x = a.match(/title="*(-?[0-9.]+)/)[1]; + return parseFloat( x ); + }, - "title-numeric-asc": function ( a, b ) { - return ((a < b) ? -1 : ((a > b) ? 1 : 0)); - }, + "title-numeric-asc": function ( a, b ) { + return ((a < b) ? -1 : ((a > b) ? 1 : 0)); + }, - "title-numeric-desc": function ( a, b ) { - return ((a < b) ? 1 : ((a > b) ? -1 : 0)); - } -} ); + "title-numeric-desc": function ( a, b ) { + return ((a < b) ? 1 : ((a > b) ? -1 : 0)); + } +}); jQuery.extend( jQuery.fn.dataTableExt.oSort, { - "appid-numeric-pre": function ( a ) { - var x = a.match(/title="*(-?[0-9a-zA-Z\-\_]+)/)[1]; - return makeIdNumeric(x); - }, + "appid-numeric-pre": function ( a ) { + var x = a.match(/title="*(-?[0-9a-zA-Z\-_]+)/)[1]; + return makeIdNumeric(x); + }, - "appid-numeric-asc": function ( a, b ) { - return ((a < b) ? -1 : ((a > b) ? 1 : 0)); - }, + "appid-numeric-asc": function ( a, b ) { + return ((a < b) ? -1 : ((a > b) ? 1 : 0)); + }, - "appid-numeric-desc": function ( a, b ) { - return ((a < b) ? 1 : ((a > b) ? -1 : 0)); - } -} ); + "appid-numeric-desc": function ( a, b ) { + return ((a < b) ? 1 : ((a > b) ? -1 : 0)); + } +}); jQuery.extend( jQuery.fn.dataTableExt.ofnSearch, { - "appid-numeric": function ( a ) { - return a.replace(/[\r\n]/g, " ").replace(/<.*?>/g, ""); - } -} ); + "appid-numeric": function ( a ) { + return a.replace(/[\r\n]/g, " ").replace(/<.*?>/g, ""); + } +}); $(document).ajaxStop($.unblockUI); $(document).ajaxStart(function(){ - $.blockUI({ message: '

Loading history summary...

'}); + $.blockUI({ message: '

Loading history summary...

'}); }); $(document).ready(function() { - $.extend( $.fn.dataTable.defaults, { - stateSave: true, - lengthMenu: [[20,40,60,100,-1], [20, 40, 60, 100, "All"]], - pageLength: 20 - }); + $.extend( $.fn.dataTable.defaults, { + stateSave: true, + lengthMenu: [[20,40,60,100,-1], [20, 40, 60, 100, "All"]], + pageLength: 20 + }); + + var historySummary = $("#history-summary"); + var searchString = window.location.search; + var requestedIncomplete = getParameterByName("showIncomplete", searchString); + requestedIncomplete = (requestedIncomplete == "true" ? true : false); + + var appParams = { + limit: appLimit, + status: (requestedIncomplete ? "running" : "completed") + }; + + $.getJSON(uiRoot + "/api/v1/applications", appParams, function(response, _ignored_status, _ignored_jqXHR) { + var array = []; + var hasMultipleAttempts = false; + for (var i in response) { + var app = response[i]; + if (app["attempts"][0]["completed"] == requestedIncomplete) { + continue; // if we want to show for Incomplete, we skip the completed apps; otherwise skip incomplete ones. + } + var version = "Unknown" + if (app["attempts"].length > 0) { + version = app["attempts"][0]["appSparkVersion"] + } + var id = app["id"]; + var name = app["name"]; + if (app["attempts"].length > 1) { + hasMultipleAttempts = true; + } - var historySummary = $("#history-summary"); - var searchString = window.location.search; - var requestedIncomplete = getParameterByName("showIncomplete", searchString); - requestedIncomplete = (requestedIncomplete == "true" ? true : false); + // TODO: Replace hasOwnProperty with prototype.hasOwnProperty after we find it's safe to do. + /* eslint-disable no-prototype-builtins */ + for (var j in app["attempts"]) { + var attempt = app["attempts"][j]; + attempt["startTime"] = formatTimeMillis(attempt["startTimeEpoch"]); + attempt["endTime"] = formatTimeMillis(attempt["endTimeEpoch"]); + attempt["lastUpdated"] = formatTimeMillis(attempt["lastUpdatedEpoch"]); + attempt["log"] = uiRoot + "/api/v1/applications/" + id + "/" + + (attempt.hasOwnProperty("attemptId") ? attempt["attemptId"] + "/" : "") + "logs"; + attempt["durationMillisec"] = attempt["duration"]; + attempt["duration"] = formatDuration(attempt["duration"]); + attempt["id"] = id; + attempt["name"] = name; + attempt["version"] = version; + attempt["attemptUrl"] = uiRoot + "/history/" + id + "/" + + (attempt.hasOwnProperty("attemptId") ? attempt["attemptId"] + "/" : "") + "jobs/"; + array.push(attempt); + } + /* eslint-enable no-prototype-builtins */ + } + if(array.length < 20) { + $.fn.dataTable.defaults.paging = false; + } - var appParams = { - limit: appLimit, - status: (requestedIncomplete ? "running" : "completed") + var data = { + "uiroot": uiRoot, + "applications": array, + "hasMultipleAttempts": hasMultipleAttempts, + "showCompletedColumns": !requestedIncomplete, }; - $.getJSON(uiRoot + "/api/v1/applications", appParams, function(response,status,jqXHR) { - var array = []; - var hasMultipleAttempts = false; - for (var i in response) { - var app = response[i]; - if (app["attempts"][0]["completed"] == requestedIncomplete) { - continue; // if we want to show for Incomplete, we skip the completed apps; otherwise skip incomplete ones. - } - var version = "Unknown" - if (app["attempts"].length > 0) { - version = app["attempts"][0]["appSparkVersion"] - } - var id = app["id"]; - var name = app["name"]; - if (app["attempts"].length > 1) { - hasMultipleAttempts = true; - } - var num = app["attempts"].length; - for (var j in app["attempts"]) { - var attempt = app["attempts"][j]; - attempt["startTime"] = formatTimeMillis(attempt["startTimeEpoch"]); - attempt["endTime"] = formatTimeMillis(attempt["endTimeEpoch"]); - attempt["lastUpdated"] = formatTimeMillis(attempt["lastUpdatedEpoch"]); - attempt["log"] = uiRoot + "/api/v1/applications/" + id + "/" + - (attempt.hasOwnProperty("attemptId") ? attempt["attemptId"] + "/" : "") + "logs"; - attempt["durationMillisec"] = attempt["duration"]; - attempt["duration"] = formatDuration(attempt["duration"]); - var app_clone = {"id" : id, "name" : name, "version": version, "num" : num, "attempts" : [attempt]}; - array.push(app_clone); - } - } - if(array.length < 20) { - $.fn.dataTable.defaults.paging = false; - } - - var data = { - "uiroot": uiRoot, - "applications": array, - "hasMultipleAttempts": hasMultipleAttempts, - "showCompletedColumns": !requestedIncomplete, + $.get(uiRoot + "/static/historypage-template.html", function(template) { + var sibling = historySummary.prev(); + historySummary.detach(); + var apps = $(Mustache.render($(template).filter("#history-summary-template").html(),data)); + var attemptIdColumnName = 'attemptId'; + var startedColumnName = 'started'; + var completedColumnName = 'completed'; + var durationColumnName = 'duration'; + var conf = { + "data": array, + "columns": [ + {name: 'version', data: 'version' }, + { + name: 'appId', + type: "appid-numeric", + data: 'id', + render: (id, type, row) => `${id}` + }, + {name: 'appName', data: 'name' }, + { + name: attemptIdColumnName, + data: 'attemptId', + render: (attemptId, type, row) => (attemptId ? `${attemptId}` : '') + }, + {name: startedColumnName, data: 'startTime' }, + {name: completedColumnName, data: 'endTime' }, + {name: durationColumnName, type: "title-numeric", data: 'duration' }, + {name: 'user', data: 'sparkUser' }, + {name: 'lastUpdated', data: 'lastUpdated' }, + { + name: 'eventLog', + data: 'log', + render: (log, _ignored_type, _ignored_row) => `Download` + }, + ], + "aoColumnDefs": [ + { + aTargets: [0, 1, 2], + fnCreatedCell: (nTd, _ignored_sData, _ignored_oData, _ignored_iRow, _ignored_iCol) => { + if (hasMultipleAttempts) { + $(nTd).css('background-color', '#fff'); + } + } + }, + ], + "autoWidth": false, + "deferRender": true }; - $.get(uiRoot + "/static/historypage-template.html", function(template) { - var sibling = historySummary.prev(); - historySummary.detach(); - var apps = $(Mustache.render($(template).filter("#history-summary-template").html(),data)); - var attemptIdColumnName = 'attemptId'; - var startedColumnName = 'started'; - var completedColumnName = 'completed'; - var durationColumnName = 'duration'; - var conf = { - "columns": [ - {name: 'version'}, - {name: 'appId', type: "appid-numeric"}, - {name: 'appName'}, - {name: attemptIdColumnName}, - {name: startedColumnName}, - {name: completedColumnName}, - {name: durationColumnName, type: "title-numeric"}, - {name: 'user'}, - {name: 'lastUpdated'}, - {name: 'eventLog'}, - ], - "autoWidth": false, - "deferRender": true - }; - - if (hasMultipleAttempts) { - conf.rowsGroup = [ - 'appId:name', - 'version:name', - 'appName:name' - ]; - } else { - conf.columns = removeColumnByName(conf.columns, attemptIdColumnName); - } - - var defaultSortColumn = completedColumnName; - if (requestedIncomplete) { - defaultSortColumn = startedColumnName; - conf.columns = removeColumnByName(conf.columns, completedColumnName); - conf.columns = removeColumnByName(conf.columns, durationColumnName); - } - conf.order = [[ getColumnIndex(conf.columns, defaultSortColumn), "desc" ]]; - conf.columnDefs = [ - {"searchable": false, "targets": [getColumnIndex(conf.columns, durationColumnName)]} + if (hasMultipleAttempts) { + conf.rowsGroup = [ + 'appId:name', + 'version:name', + 'appName:name' ]; - historySummary.append(apps); - apps.DataTable(conf); - sibling.after(historySummary); - $('#history-summary [data-toggle="tooltip"]').tooltip(); - }); + } else { + conf.columns = removeColumnByName(conf.columns, attemptIdColumnName); + } + + var defaultSortColumn = completedColumnName; + if (requestedIncomplete) { + defaultSortColumn = startedColumnName; + conf.columns = removeColumnByName(conf.columns, completedColumnName); + conf.columns = removeColumnByName(conf.columns, durationColumnName); + } + conf.order = [[ getColumnIndex(conf.columns, defaultSortColumn), "desc" ]]; + conf.columnDefs = [ + {"searchable": false, "targets": [getColumnIndex(conf.columns, durationColumnName)]} + ]; + historySummary.append(apps); + apps.DataTable(conf); + sibling.after(historySummary); + $('#history-summary [data-toggle="tooltip"]').tooltip(); }); + }); }); diff --git a/core/src/main/resources/org/apache/spark/ui/static/initialize-tooltips.js b/core/src/main/resources/org/apache/spark/ui/static/initialize-tooltips.js index 70f355dfb49cb..b273a19783f8f 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/initialize-tooltips.js +++ b/core/src/main/resources/org/apache/spark/ui/static/initialize-tooltips.js @@ -15,7 +15,9 @@ * limitations under the License. */ +/* global $ */ + $(document).ready(function(){ - $("[data-toggle=tooltip]").tooltip({container: 'body'}); + $("[data-toggle=tooltip]").tooltip({container: 'body'}); }); diff --git a/core/src/main/resources/org/apache/spark/ui/static/jquery-3.4.1.min.js b/core/src/main/resources/org/apache/spark/ui/static/jquery-3.4.1.min.js deleted file mode 100644 index 07c00cd227da0..0000000000000 --- a/core/src/main/resources/org/apache/spark/ui/static/jquery-3.4.1.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll(":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push("\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function D(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function qe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function Le(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function He(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Oe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Ut,Xt=[],Vt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Xt.pop()||S.expando+"_"+Ct.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Vt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Vt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Vt,"$1"+r):!1!==e.jsonp&&(e.url+=(Et.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Xt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Ut=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Ut.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):("number"==typeof f.top&&(f.top+="px"),"number"==typeof f.left&&(f.left+="px"),c.css(f))}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=Be(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 0) { - return words.slice(0, ind + 2).join('/') + "/log"; + return words.slice(0, ind + 2).join('/') + "/log"; } return "/log" } +/* eslint-disable no-unused-vars */ function loadMore() { var offset = Math.max(startByte - byteLength, 0); var moreByteLength = Math.min(byteLength, startByte); @@ -139,4 +142,5 @@ function initLogPage(params, logLen, start, end, totLogLen, defaultLen) { if (startByte == 0) { disableMoreButton(); } -} \ No newline at end of file +} +/* eslint-enable no-unused-vars */ \ No newline at end of file diff --git a/core/src/main/resources/org/apache/spark/ui/static/sorttable.js b/core/src/main/resources/org/apache/spark/ui/static/sorttable.js index ecd580e5c64aa..3f98a0379dc3c 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/sorttable.js +++ b/core/src/main/resources/org/apache/spark/ui/static/sorttable.js @@ -99,12 +99,12 @@ sorttable = { 'sorttable_sorted_reverse'); rowlists = this.parentNode.getElementsByTagName("span"); for (var j=0; j < rowlists.length; j++) { - if (rowlists[j].className.search(/\bsorttable_sortfwdind\b/)) { + if (rowlists[j].className.search(/\bsorttable_sortfwdind\b/) != -1) { rowlists[j].parentNode.removeChild(rowlists[j]); } } sortrevind = document.createElement('span'); - sortrevind.class = "sorttable_sortrevind"; + sortrevind.className = "sorttable_sortrevind"; sortrevind.innerHTML = stIsIE ? ' 5' : ' ▾'; this.appendChild(sortrevind); return; @@ -117,12 +117,12 @@ sorttable = { 'sorttable_sorted'); rowlists = this.parentNode.getElementsByTagName("span"); for (var j=0; j < rowlists.length; j++) { - if (rowlists[j].className.search(/\sorttable_sortrevind\b/)) { + if (rowlists[j].className.search(/\bsorttable_sortrevind\b/) != -1) { rowlists[j].parentNode.removeChild(rowlists[j]); } } sortfwdind = document.createElement('span'); - sortfwdind.class = "sorttable_sortfwdind"; + sortfwdind.className = "sorttable_sortfwdind"; sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▴'; this.appendChild(sortfwdind); return; @@ -138,15 +138,15 @@ sorttable = { }); rowlists = this.parentNode.getElementsByTagName("span"); for (var j=0; j < rowlists.length; j++) { - if (rowlists[j].className.search(/\bsorttable_sortfwdind\b/) - || rowlists[j].className.search(/\sorttable_sortrevind\b/) ) { + if (rowlists[j].className.search(/\bsorttable_sortfwdind\b/) != -1 + || rowlists[j].className.search(/\bsorttable_sortrevind\b/) != -1) { rowlists[j].parentNode.removeChild(rowlists[j]); } } this.className += ' sorttable_sorted'; sortfwdind = document.createElement('span'); - sortfwdind.class = "sorttable_sortfwdind"; + sortfwdind.className = "sorttable_sortfwdind"; sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▴'; this.appendChild(sortfwdind); diff --git a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.css b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.css index e44a724c202f7..d6ddb860389be 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.css +++ b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.css @@ -96,6 +96,12 @@ stroke-width: 2px; } +#dag-viz-graph svg.job g.node.indeterminate circle { + fill: #f6b187; + stroke: #D97536; + stroke-width: 2px; +} + /* Stage page specific styles */ #dag-viz-graph svg.stage g.cluster rect { @@ -136,6 +142,12 @@ stroke-width: 2px; } +#dag-viz-graph svg.stage g.node.indeterminate rect { + fill: #F09c67; + stroke: #D97536; + stroke-width: 2px; +} + .tooltip-inner { white-space: pre-wrap; } diff --git a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js index ae02defd9bb9c..6a0cd012146ec 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js +++ b/core/src/main/resources/org/apache/spark/ui/static/spark-dag-viz.js @@ -51,6 +51,8 @@ * since it was forked (commit 101503833a8ce5fe369547f6addf3e71172ce10b). */ +/* global $, appBasePath, d3, dagreD3, graphlibDot, uiRoot */ + var VizConstants = { svgMarginX: 16, svgMarginY: 16, @@ -166,16 +168,24 @@ function renderDagViz(forJob) { } // Find cached RDDs and mark them as such - metadataContainer().selectAll(".cached-rdd").each(function(v) { + metadataContainer().selectAll(".cached-rdd").each(function(_ignored_v) { var rddId = d3.select(this).text().trim(); var nodeId = VizConstants.nodePrefix + rddId; svg.selectAll("g." + nodeId).classed("cached", true); }); metadataContainer().selectAll(".barrier-rdd").each(function() { + var opId = d3.select(this).text().trim(); + var opClusterId = VizConstants.clusterPrefix + opId; + var stageId = $(this).parents(".stage-metadata").attr("stage-id"); + var stageClusterId = VizConstants.graphPrefix + stageId; + svg.selectAll("g[id=" + stageClusterId + "] g." + opClusterId).classed("barrier", true) + }); + + metadataContainer().selectAll(".indeterminate-rdd").each(function(_ignored_v) { var rddId = d3.select(this).text().trim(); - var clusterId = VizConstants.clusterPrefix + rddId; - svg.selectAll("g." + clusterId).classed("barrier", true) + var nodeId = VizConstants.nodePrefix + rddId; + svg.selectAll("g." + nodeId).classed("indeterminate", true); }); resizeSvg(svg); @@ -216,7 +226,7 @@ function renderDagVizForJob(svgContainer) { var dot = metadata.select(".dot-file").text(); var stageId = metadata.attr("stage-id"); var containerId = VizConstants.graphPrefix + stageId; - var isSkipped = metadata.attr("skipped") == "true"; + var isSkipped = metadata.attr("skipped") === "true"; var container; if (isSkipped) { container = svgContainer @@ -225,11 +235,8 @@ function renderDagVizForJob(svgContainer) { .attr("skipped", "true"); } else { // Link each graph to the corresponding stage page (TODO: handle stage attempts) - // Use the link from the stage table so it also works for the history server var attemptId = 0; - var stageLink = d3.select("#stage-" + stageId + "-" + attemptId) - .select("a.name-link") - .attr("href"); + var stageLink = uiRoot + appBasePath + "/stages/stage/?id=" + stageId + "&attempt=" + attemptId; container = svgContainer .append("a") .attr("xlink:href", stageLink) @@ -270,7 +277,7 @@ function renderDagVizForJob(svgContainer) { // If there are any incoming edges into this graph, keep track of them to render // them separately later. Note that we cannot draw them now because we need to // put these edges in a separate container that is on top of all stage graphs. - metadata.selectAll(".incoming-edge").each(function(v) { + metadata.selectAll(".incoming-edge").each(function(_ignored_v) { var edge = d3.select(this).text().trim().split(","); // e.g. 3,4 => [3, 4] crossStageEdges.push(edge); }); @@ -335,7 +342,7 @@ function preprocessGraphLayout(g, forJob) { } /* - * Helper function to size the SVG appropriately such that all elements are displyed. + * Helper function to size the SVG appropriately such that all elements are displayed. * This assumes that all outermost elements are clusters (rectangles). */ function resizeSvg(svg) { diff --git a/core/src/main/resources/org/apache/spark/ui/static/stagepage.js b/core/src/main/resources/org/apache/spark/ui/static/stagepage.js index 93b37c296271b..fea595d0a6216 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/stagepage.js +++ b/core/src/main/resources/org/apache/spark/ui/static/stagepage.js @@ -15,251 +15,291 @@ * limitations under the License. */ +/* global $, ConvertDurationString, Mustache, createRESTEndPointForExecutorsPage */ +/* global createTemplateURI, formatBytes, formatDate, formatDuration, formatLogsCells */ +/* global getStandAloneAppId, setDataTableDefaults, uiRoot */ + var shouldBlockUI = true; $(document).ajaxStop(function () { - if (shouldBlockUI) { - $.unblockUI(); - shouldBlockUI = false; - } + if (shouldBlockUI) { + $.unblockUI(); + shouldBlockUI = false; + } }); $(document).ajaxStart(function () { - if (shouldBlockUI) { - $.blockUI({message: '

Loading Stage Page...

'}); - } + if (shouldBlockUI) { + $.blockUI({message: '

Loading Stage Page...

'}); + } }); $.extend( $.fn.dataTable.ext.type.order, { - "duration-pre": ConvertDurationString, - - "duration-asc": function ( a, b ) { - a = ConvertDurationString( a ); - b = ConvertDurationString( b ); - return ((a < b) ? -1 : ((a > b) ? 1 : 0)); - }, - - "duration-desc": function ( a, b ) { - a = ConvertDurationString( a ); - b = ConvertDurationString( b ); - return ((a < b) ? 1 : ((a > b) ? -1 : 0)); - } -} ); + "duration-pre": ConvertDurationString, + + "duration-asc": function ( a, b ) { + a = ConvertDurationString( a ); + b = ConvertDurationString( b ); + return ((a < b) ? -1 : ((a > b) ? 1 : 0)); + }, + + "duration-desc": function ( a, b ) { + a = ConvertDurationString( a ); + b = ConvertDurationString( b ); + return ((a < b) ? 1 : ((a > b) ? -1 : 0)); + }, + + "size-pre": function (data) { + var floatValue = parseFloat(data) + return isNaN(floatValue) ? 0 : floatValue; + }, + + "size-asc": function (a, b) { + a = parseFloat(a); + b = parseFloat(b); + return ((a < b) ? -1 : ((a > b) ? 1 : 0)); + }, + + "size-desc": function (a, b) { + a = parseFloat(a); + b = parseFloat(b); + return ((a < b) ? 1 : ((a > b) ? -1 : 0)); + } +}); // This function will only parse the URL under certain format // e.g. (history) https://domain:50509/history/application_1536254569791_3806251/1/stages/stage/?id=4&attempt=1 // e.g. (proxy) https://domain:50505/proxy/application_1502220952225_59143/stages/stage?id=4&attempt=1 function stageEndPoint(appId) { - var queryString = document.baseURI.split('?'); - var words = document.baseURI.split('/'); - var indexOfProxy = words.indexOf("proxy"); - var stageId = queryString[1].split("&").filter(word => word.includes("id="))[0].split("=")[1]; - if (indexOfProxy > 0) { - var appId = words[indexOfProxy + 1]; - var newBaseURI = words.slice(0, words.indexOf("proxy") + 2).join('/'); - return newBaseURI + "/api/v1/applications/" + appId + "/stages/" + stageId; - } - var indexOfHistory = words.indexOf("history"); - if (indexOfHistory > 0) { - var appId = words[indexOfHistory + 1]; - var appAttemptId = words[indexOfHistory + 2]; - var newBaseURI = words.slice(0, words.indexOf("history")).join('/'); - if (isNaN(appAttemptId) || appAttemptId == "0") { - return newBaseURI + "/api/v1/applications/" + appId + "/stages/" + stageId; - } else { - return newBaseURI + "/api/v1/applications/" + appId + "/" + appAttemptId + "/stages/" + stageId; - } + var queryString = document.baseURI.split('?'); + var words = document.baseURI.split('/'); + var indexOfProxy = words.indexOf("proxy"); + var stageId = queryString[1].split("&").filter(word => word.includes("id="))[0].split("=")[1]; + var newBaseURI; + if (indexOfProxy > 0) { + appId = words[indexOfProxy + 1]; + newBaseURI = words.slice(0, words.indexOf("proxy") + 2).join('/'); + return newBaseURI + "/api/v1/applications/" + appId + "/stages/" + stageId; + } + var indexOfHistory = words.indexOf("history"); + if (indexOfHistory > 0) { + appId = words[indexOfHistory + 1]; + var appAttemptId = words[indexOfHistory + 2]; + newBaseURI = words.slice(0, words.indexOf("history")).join('/'); + if (isNaN(appAttemptId) || appAttemptId == "0") { + return newBaseURI + "/api/v1/applications/" + appId + "/stages/" + stageId; + } else { + return newBaseURI + "/api/v1/applications/" + appId + "/" + appAttemptId + "/stages/" + stageId; } - return location.origin + "/api/v1/applications/" + appId + "/stages/" + stageId; + } + return uiRoot + "/api/v1/applications/" + appId + "/stages/" + stageId; } function getColumnNameForTaskMetricSummary(columnKey) { - switch(columnKey) { - case "executorRunTime": - return "Duration"; + switch(columnKey) { + case "executorRunTime": + return "Duration"; - case "jvmGcTime": - return "GC Time"; + case "jvmGcTime": + return "GC Time"; - case "gettingResultTime": - return "Getting Result Time"; + case "gettingResultTime": + return "Getting Result Time"; - case "inputMetrics": - return "Input Size / Records"; + case "inputMetrics": + return "Input Size / Records"; - case "outputMetrics": - return "Output Size / Records"; + case "outputMetrics": + return "Output Size / Records"; - case "peakExecutionMemory": - return "Peak Execution Memory"; + case "peakExecutionMemory": + return "Peak Execution Memory"; - case "resultSerializationTime": - return "Result Serialization Time"; + case "resultSerializationTime": + return "Result Serialization Time"; - case "schedulerDelay": - return "Scheduler Delay"; + case "schedulerDelay": + return "Scheduler Delay"; - case "diskBytesSpilled": - return "Spill (disk)"; + case "diskBytesSpilled": + return "Spill (disk)"; - case "memoryBytesSpilled": - return "Spill (memory)"; + case "memoryBytesSpilled": + return "Spill (memory)"; - case "shuffleReadMetrics": - return "Shuffle Read Size / Records"; + case "shuffleReadMetrics": + return "Shuffle Read Size / Records"; - case "shuffleWriteMetrics": - return "Shuffle Write Size / Records"; + case "shuffleWriteMetrics": + return "Shuffle Write Size / Records"; - case "executorDeserializeTime": - return "Task Deserialization Time"; + case "executorDeserializeTime": + return "Task Deserialization Time"; - case "shuffleReadBlockedTime": - return "Shuffle Read Blocked Time"; + case "shuffleReadBlockedTime": + return "Shuffle Read Blocked Time"; - case "shuffleRemoteReads": - return "Shuffle Remote Reads"; + case "shuffleRemoteReads": + return "Shuffle Remote Reads"; - case "shuffleWriteTime": - return "Shuffle Write Time"; + case "shuffleWriteTime": + return "Shuffle Write Time"; - default: - return "NA"; - } + default: + return "NA"; + } } function displayRowsForSummaryMetricsTable(row, type, columnIndex) { - switch(row.columnKey) { - case 'inputMetrics': - var str = formatBytes(row.data.bytesRead[columnIndex], type) + " / " + - row.data.recordsRead[columnIndex]; - return str; - - case 'outputMetrics': - var str = formatBytes(row.data.bytesWritten[columnIndex], type) + " / " + - row.data.recordsWritten[columnIndex]; - return str; - - case 'shuffleReadMetrics': - var str = formatBytes(row.data.readBytes[columnIndex], type) + " / " + - row.data.readRecords[columnIndex]; - return str; - - case 'shuffleReadBlockedTime': - var str = formatDuration(row.data.fetchWaitTime[columnIndex]); - return str; - - case 'shuffleRemoteReads': - var str = formatBytes(row.data.remoteBytesRead[columnIndex], type); - return str; - - case 'shuffleWriteMetrics': - var str = formatBytes(row.data.writeBytes[columnIndex], type) + " / " + - row.data.writeRecords[columnIndex]; - return str; - - case 'shuffleWriteTime': - var str = formatDuration(row.data.writeTime[columnIndex] / 1000000.0); - return str; - - default: - return (row.columnKey == 'peakExecutionMemory' || row.columnKey == 'memoryBytesSpilled' - || row.columnKey == 'diskBytesSpilled') ? formatBytes( - row.data[columnIndex], type) : (formatDuration(row.data[columnIndex])); - - } + var str; + switch(row.columnKey) { + case 'inputMetrics': + str = formatBytes(row.data.bytesRead[columnIndex], type) + " / " + + row.data.recordsRead[columnIndex]; + return str; + + case 'outputMetrics': + str = formatBytes(row.data.bytesWritten[columnIndex], type) + " / " + + row.data.recordsWritten[columnIndex]; + return str; + + case 'shuffleReadMetrics': + str = formatBytes(row.data.readBytes[columnIndex], type) + " / " + + row.data.readRecords[columnIndex]; + return str; + + case 'shuffleReadBlockedTime': + str = formatDuration(row.data.fetchWaitTime[columnIndex]); + return str; + + case 'shuffleRemoteReads': + str = formatBytes(row.data.remoteBytesRead[columnIndex], type); + return str; + + case 'shuffleWriteMetrics': + str = formatBytes(row.data.writeBytes[columnIndex], type) + " / " + + row.data.writeRecords[columnIndex]; + return str; + + case 'shuffleWriteTime': + str = formatDuration(row.data.writeTime[columnIndex] / 1000000.0); + return str; + + default: + return (row.columnKey == 'peakExecutionMemory' || row.columnKey == 'memoryBytesSpilled' + || row.columnKey == 'diskBytesSpilled') ? formatBytes( + row.data[columnIndex], type) : (formatDuration(row.data[columnIndex])); + + } } function createDataTableForTaskSummaryMetricsTable(taskSummaryMetricsTable) { - var taskMetricsTable = "#summary-metrics-table"; - if ($.fn.dataTable.isDataTable(taskMetricsTable)) { - taskSummaryMetricsDataTable.clear().draw(); - taskSummaryMetricsDataTable.rows.add(taskSummaryMetricsTable).draw(); - } else { - var taskConf = { - "data": taskSummaryMetricsTable, - "columns": [ - {data : 'metric'}, - // Min - { - data: function (row, type) { - return displayRowsForSummaryMetricsTable(row, type, 0); - } - }, - // 25th percentile - { - data: function (row, type) { - return displayRowsForSummaryMetricsTable(row, type, 1); - } - }, - // Median - { - data: function (row, type) { - return displayRowsForSummaryMetricsTable(row, type, 2); - } - }, - // 75th percentile - { - data: function (row, type) { - return displayRowsForSummaryMetricsTable(row, type, 3); - } - }, - // Max - { - data: function (row, type) { - return displayRowsForSummaryMetricsTable(row, type, 4); - } - } - ], - "columnDefs": [ - { "type": "duration", "targets": 1 }, - { "type": "duration", "targets": 2 }, - { "type": "duration", "targets": 3 }, - { "type": "duration", "targets": 4 }, - { "type": "duration", "targets": 5 } - ], - "paging": false, - "searching": false, - "order": [[0, "asc"]], - "bSort": false, - "bAutoWidth": false, - "oLanguage": { - "sEmptyTable": "No tasks have reported metrics yet" - } - }; - taskSummaryMetricsDataTable = $(taskMetricsTable).DataTable(taskConf); - } - taskSummaryMetricsTableCurrentStateArray = taskSummaryMetricsTable.slice(); + var taskMetricsTable = "#summary-metrics-table"; + if ($.fn.dataTable.isDataTable(taskMetricsTable)) { + taskSummaryMetricsDataTable.clear().draw(); + taskSummaryMetricsDataTable.rows.add(taskSummaryMetricsTable).draw(); + } else { + var taskConf = { + "data": taskSummaryMetricsTable, + "columns": [ + {data : 'metric'}, + // Min + { + data: function (row, type) { + return displayRowsForSummaryMetricsTable(row, type, 0); + } + }, + // 25th percentile + { + data: function (row, type) { + return displayRowsForSummaryMetricsTable(row, type, 1); + } + }, + // Median + { + data: function (row, type) { + return displayRowsForSummaryMetricsTable(row, type, 2); + } + }, + // 75th percentile + { + data: function (row, type) { + return displayRowsForSummaryMetricsTable(row, type, 3); + } + }, + // Max + { + data: function (row, type) { + return displayRowsForSummaryMetricsTable(row, type, 4); + } + } + ], + "columnDefs": [ + { "type": "duration", "targets": 1 }, + { "type": "duration", "targets": 2 }, + { "type": "duration", "targets": 3 }, + { "type": "duration", "targets": 4 }, + { "type": "duration", "targets": 5 } + ], + "paging": false, + "searching": false, + "order": [[0, "asc"]], + "bSort": false, + "bAutoWidth": false, + "oLanguage": { + "sEmptyTable": "No tasks have reported metrics yet" + } + }; + taskSummaryMetricsDataTable = $(taskMetricsTable).DataTable(taskConf); + } + taskSummaryMetricsTableCurrentStateArray = taskSummaryMetricsTable.slice(); } function createRowMetadataForColumn(colKey, data, checkboxId) { var row = { - "metric": getColumnNameForTaskMetricSummary(colKey), - "data": data, - "checkboxId": checkboxId, - "columnKey": colKey + "metric": getColumnNameForTaskMetricSummary(colKey), + "data": data, + "checkboxId": checkboxId, + "columnKey": colKey }; return row; } function reselectCheckboxesBasedOnTaskTableState() { - var allChecked = true; - var taskSummaryMetricsTableCurrentFilteredArray = taskSummaryMetricsTableCurrentStateArray.slice(); - if (typeof taskTableSelector !== 'undefined' && taskSummaryMetricsTableCurrentStateArray.length > 0) { - for (var k = 0; k < optionalColumns.length; k++) { - if (taskTableSelector.column(optionalColumns[k]).visible()) { - $("#box-"+optionalColumns[k]).prop('checked', true); - taskSummaryMetricsTableCurrentStateArray.push(taskSummaryMetricsTableArray.filter(row => (row.checkboxId).toString() == optionalColumns[k])[0]); - taskSummaryMetricsTableCurrentFilteredArray = taskSummaryMetricsTableCurrentStateArray.slice(); - } else { - allChecked = false; - } - } - if (allChecked) { - $("#box-0").prop('checked', true); - } - createDataTableForTaskSummaryMetricsTable(taskSummaryMetricsTableCurrentFilteredArray); + var taskSummaryHasSelected = false; + var executorSummaryHasSelected = false; + var allTaskSummaryChecked = true; + var allExecutorSummaryChecked = true; + var taskSummaryMetricsTableCurrentFilteredArray = taskSummaryMetricsTableCurrentStateArray.slice(); + var k; + if (typeof taskTableSelector !== 'undefined' && taskSummaryMetricsTableCurrentStateArray.length > 0) { + for (k = 0; k < optionalColumns.length; k++) { + if (taskTableSelector.column(optionalColumns[k]).visible()) { + taskSummaryHasSelected = true; + $("#box-"+optionalColumns[k]).prop('checked', true); + taskSummaryMetricsTableCurrentStateArray.push(taskSummaryMetricsTableArray.filter(row => (row.checkboxId).toString() == optionalColumns[k])[0]); + taskSummaryMetricsTableCurrentFilteredArray = taskSummaryMetricsTableCurrentStateArray.slice(); + } else { + allTaskSummaryChecked = false; + } } + createDataTableForTaskSummaryMetricsTable(taskSummaryMetricsTableCurrentFilteredArray); + } + + if (typeof executorSummaryTableSelector !== 'undefined') { + for (k = 0; k < executorOptionalColumns.length; k++) { + if (executorSummaryTableSelector.column(executorOptionalColumns[k]).visible()) { + executorSummaryHasSelected = true; + $("#executor-box-"+executorOptionalColumns[k]).prop('checked', true); + } else { + allExecutorSummaryChecked = false; + } + } + } + + if ((taskSummaryHasSelected || executorSummaryHasSelected) && allTaskSummaryChecked && allExecutorSummaryChecked) { + $("#box-0").prop('checked', true); + } } function getStageAttemptId() { @@ -268,7 +308,7 @@ function getStageAttemptId() { // We are using regex here to extract the stage attempt id as there might be certain url's with format // like /proxy/application_1539986433979_27115/stages/stage/?id=0&attempt=0#tasksTitle var stgAttemptId = words[1].split("&").filter( - word => word.includes("attempt="))[0].split("=")[1].match(digitsRegex); + word => word.includes("attempt="))[0].split("=")[1].match(digitsRegex); return stgAttemptId; } @@ -278,711 +318,837 @@ var taskSummaryMetricsDataTable; var optionalColumns = [11, 12, 13, 14, 15, 16, 17, 21]; var taskTableSelector; +var executorOptionalColumns = [15, 16, 17, 18]; +var executorSummaryTableSelector; + $(document).ready(function () { - setDataTableDefaults(); - - $("#showAdditionalMetrics").append( - "" + - "
" + - "
Select All
" + - "
Scheduler Delay
" + - "
Task Deserialization Time
" + - "
Shuffle Read Blocked Time
" + - "
Shuffle Remote Reads
" + - "
Shuffle Write Time
" + - "
Result Serialization Time
" + - "
Getting Result Time
" + - "
Peak Execution Memory
" + - "
"); - - $('#scheduler_delay').attr("data-toggle", "tooltip") - .attr("data-placement", "top") - .attr("title", "Scheduler delay includes time to ship the task from the scheduler to the executor, and time to send " + - "the task result from the executor to the scheduler. If scheduler delay is large, consider decreasing the size of tasks or decreasing the size of task results."); - $('#task_deserialization_time').attr("data-toggle", "tooltip") - .attr("data-placement", "top") - .attr("title", "Time spent deserializing the task closure on the executor, including the time to read the broadcasted task."); - $('#shuffle_read_blocked_time').attr("data-toggle", "tooltip") - .attr("data-placement", "top") - .attr("title", "Time that the task spent blocked waiting for shuffle data to be read from remote machines."); - $('#shuffle_remote_reads').attr("data-toggle", "tooltip") - .attr("data-placement", "top") - .attr("title", "Total shuffle bytes read from remote executors. This is a subset of the shuffle read bytes; the remaining shuffle data is read locally. "); - $('#shuffle_write_time').attr("data-toggle", "tooltip") - .attr("data-placement", "top") - .attr("title", "Time that the task spent writing shuffle data."); - $('#result_serialization_time').attr("data-toggle", "tooltip") - .attr("data-placement", "top") - .attr("title", "Time spent serializing the task result on the executor before sending it back to the driver."); - $('#getting_result_time').attr("data-toggle", "tooltip") - .attr("data-placement", "top") - .attr("title", "Time that the driver spends fetching task results from workers. If this is large, consider decreasing the amount of data returned from each task."); - $('#peak_execution_memory').attr("data-toggle", "tooltip") - .attr("data-placement", "top") - .attr("title", "Execution memory refers to the memory used by internal data structures created during " + - "shuffles, aggregations and joins when Tungsten is enabled. The value of this accumulator " + - "should be approximately the sum of the peak sizes across all such data structures created " + - "in this task. For SQL jobs, this only tracks all unsafe operators, broadcast joins, and " + - "external sort."); - $('[data-toggle="tooltip"]').tooltip(); - var tasksSummary = $("#parent-container"); - getStandAloneAppId(function (appId) { - // rendering the UI page - $.get(createTemplateURI(appId, "stagespage"), function(template) { - tasksSummary.append(Mustache.render($(template).filter("#stages-summary-template").html())); - - $("#additionalMetrics").click(function(){ - $("#arrowtoggle1").toggleClass("arrow-open arrow-closed"); - $("#toggle-metrics").toggleClass("d-none"); - if (window.localStorage) { - window.localStorage.setItem("arrowtoggle1class", $("#arrowtoggle1").attr('class')); - } + setDataTableDefaults(); + + $("#showAdditionalMetrics").append( + "" + + "
" + + "
Select All
" + + "
Scheduler Delay
" + + "
Task Deserialization Time
" + + "
Shuffle Read Blocked Time
" + + "
Shuffle Remote Reads
" + + "
Shuffle Write Time
" + + "
Result Serialization Time
" + + "
Getting Result Time
" + + "
Peak Execution Memory
" + + "
Peak JVM Memory OnHeap / OffHeap
" + + "
Peak Execution Memory OnHeap / OffHeap
" + + "
Peak Storage Memory OnHeap / OffHeap
" + + "
Peak Pool Memory Direct / Mapped
" + + "
"); + + $('#scheduler_delay').attr("data-toggle", "tooltip") + .attr("data-placement", "top") + .attr("title", "Scheduler delay includes time to ship the task from the scheduler to the executor, and time to send " + + "the task result from the executor to the scheduler. If scheduler delay is large, consider decreasing the size of tasks or decreasing the size of task results."); + $('#task_deserialization_time').attr("data-toggle", "tooltip") + .attr("data-placement", "top") + .attr("title", "Time spent deserializing the task closure on the executor, including the time to read the broadcasted task."); + $('#shuffle_read_blocked_time').attr("data-toggle", "tooltip") + .attr("data-placement", "top") + .attr("title", "Time that the task spent blocked waiting for shuffle data to be read from remote machines."); + $('#shuffle_remote_reads').attr("data-toggle", "tooltip") + .attr("data-placement", "top") + .attr("title", "Total shuffle bytes read from remote executors. This is a subset of the shuffle read bytes; the remaining shuffle data is read locally. "); + $('#shuffle_write_time').attr("data-toggle", "tooltip") + .attr("data-placement", "top") + .attr("title", "Time that the task spent writing shuffle data."); + $('#result_serialization_time').attr("data-toggle", "tooltip") + .attr("data-placement", "top") + .attr("title", "Time spent serializing the task result on the executor before sending it back to the driver."); + $('#getting_result_time').attr("data-toggle", "tooltip") + .attr("data-placement", "top") + .attr("title", "Time that the driver spends fetching task results from workers. If this is large, consider decreasing the amount of data returned from each task."); + $('#peak_execution_memory').attr("data-toggle", "tooltip") + .attr("data-placement", "top") + .attr("title", "Execution memory refers to the memory used by internal data structures created during " + + "shuffles, aggregations and joins when Tungsten is enabled. The value of this accumulator " + + "should be approximately the sum of the peak sizes across all such data structures created " + + "in this task. For SQL jobs, this only tracks all unsafe operators, broadcast joins, and " + + "external sort."); + $('[data-toggle="tooltip"]').tooltip(); + var tasksSummary = $("#parent-container"); + getStandAloneAppId(function (appId) { + // rendering the UI page + $.get(createTemplateURI(appId, "stagespage"), function(template) { + tasksSummary.append(Mustache.render($(template).filter("#stages-summary-template").html())); + + $("#additionalMetrics").click(function(){ + $("#arrowtoggle1").toggleClass("arrow-open arrow-closed"); + $("#toggle-metrics").toggleClass("d-none"); + if (window.localStorage) { + window.localStorage.setItem("arrowtoggle1class", $("#arrowtoggle1").attr('class')); + } + }); + + $("#aggregatedMetrics").click(function(){ + $("#arrowtoggle2").toggleClass("arrow-open arrow-closed"); + $("#toggle-aggregatedMetrics").toggleClass("d-none"); + if (window.localStorage) { + window.localStorage.setItem("arrowtoggle2class", $("#arrowtoggle2").attr('class')); + } + }); + + var endPoint = stageEndPoint(appId); + var stageAttemptId = getStageAttemptId(); + $.getJSON(endPoint + "/" + stageAttemptId, function(response, _ignored_status, _ignored_jqXHR) { + + var responseBody = response; + var dataToShow = {}; + dataToShow.showInputData = responseBody.inputBytes > 0; + dataToShow.showOutputData = responseBody.outputBytes > 0; + dataToShow.showShuffleReadData = responseBody.shuffleReadBytes > 0; + dataToShow.showShuffleWriteData = responseBody.shuffleWriteBytes > 0; + dataToShow.showBytesSpilledData = + (responseBody.diskBytesSpilled > 0 || responseBody.memoryBytesSpilled > 0); + + var columnIndicesToRemove = []; + if (!dataToShow.showShuffleReadData) { + $('#shuffle_read_blocked_time').remove(); + $('#shuffle_remote_reads').remove(); + columnIndicesToRemove.push(2); + columnIndicesToRemove.push(3); + } + + if (!dataToShow.showShuffleWriteData) { + $('#shuffle_write_time').remove(); + columnIndicesToRemove.push(7); + } + + if (columnIndicesToRemove.length > 0) { + columnIndicesToRemove.sort(function(a, b) { return b - a; }); + columnIndicesToRemove.forEach(function(idx) { + optionalColumns.splice(idx, 1); }); + } + + // prepare data for executor summary table + var stageExecutorSummaryInfoKeys = Object.keys(responseBody.executorSummary); + $.getJSON(createRESTEndPointForExecutorsPage(appId), + function(executorSummaryResponse, _ignored_status, _ignored_jqXHR) { + var executorDetailsMap = {}; + executorSummaryResponse.forEach(function (executorDetail) { + executorDetailsMap[executorDetail.id] = executorDetail; + }); + + var executorSummaryTable = []; + stageExecutorSummaryInfoKeys.forEach(function (columnKeyIndex) { + var executorSummary = responseBody.executorSummary[columnKeyIndex]; + var executorDetail = executorDetailsMap[columnKeyIndex.toString()]; + executorSummary.id = columnKeyIndex; + executorSummary.executorLogs = {}; + executorSummary.hostPort = "CANNOT FIND ADDRESS"; + + if (executorDetail) { + if (executorDetail["executorLogs"]) { + responseBody.executorSummary[columnKeyIndex].executorLogs = + executorDetail["executorLogs"]; + } + if (executorDetail["hostPort"]) { + responseBody.executorSummary[columnKeyIndex].hostPort = + executorDetail["hostPort"]; + } + } + executorSummaryTable.push(responseBody.executorSummary[columnKeyIndex]); + }); + // building task aggregated metrics by executor table + var executorSummaryConf = { + "data": executorSummaryTable, + "columns": [ + {data : "id"}, + {data : "executorLogs", render: formatLogsCells}, + {data : "hostPort"}, + { + data : function (row, type) { + return type === 'display' ? formatDuration(row.taskTime) : row.taskTime; + } + }, + { + data : function (row, type) { + var totaltasks = row.succeededTasks + row.failedTasks + row.killedTasks; + return type === 'display' ? totaltasks : totaltasks.toString(); + } + }, + {data : "failedTasks"}, + {data : "killedTasks"}, + {data : "succeededTasks"}, + {data : "isExcludedForStage"}, + { + data : function (row, type) { + return row.inputRecords != 0 ? formatBytes(row.inputBytes, type) + " / " + row.inputRecords : ""; + } + }, + { + data : function (row, type) { + return row.outputRecords != 0 ? formatBytes(row.outputBytes, type) + " / " + row.outputRecords : ""; + } + }, + { + data : function (row, type) { + return row.shuffleReadRecords != 0 ? formatBytes(row.shuffleRead, type) + " / " + row.shuffleReadRecords : ""; + } + }, + { + data : function (row, type) { + return row.shuffleWriteRecords != 0 ? formatBytes(row.shuffleWrite, type) + " / " + row.shuffleWriteRecords : ""; + } + }, + { + data : function (row, type) { + return typeof row.memoryBytesSpilled != 'undefined' ? formatBytes(row.memoryBytesSpilled, type) : ""; + } + }, + { + data : function (row, type) { + return typeof row.diskBytesSpilled != 'undefined' ? formatBytes(row.diskBytesSpilled, type) : ""; + } + }, + { + data : function (row, type) { + var peakMemoryMetrics = row.peakMemoryMetrics; + if (typeof peakMemoryMetrics !== 'undefined') { + if (type !== 'display') + return peakMemoryMetrics.JVMHeapMemory; + else + return (formatBytes(peakMemoryMetrics.JVMHeapMemory, type) + ' / ' + + formatBytes(peakMemoryMetrics.JVMOffHeapMemory, type)); + } else { + if (type !== 'display') { + return 0; + } else { + return '0.0 B / 0.0 B'; + } + } - $("#aggregatedMetrics").click(function(){ - $("#arrowtoggle2").toggleClass("arrow-open arrow-closed"); - $("#toggle-aggregatedMetrics").toggleClass("d-none"); - if (window.localStorage) { - window.localStorage.setItem("arrowtoggle2class", $("#arrowtoggle2").attr('class')); + } + }, + { + data : function (row, type) { + var peakMemoryMetrics = row.peakMemoryMetrics + if (typeof peakMemoryMetrics !== 'undefined') { + if (type !== 'display') + return peakMemoryMetrics.OnHeapExecutionMemory; + else + return (formatBytes(peakMemoryMetrics.OnHeapExecutionMemory, type) + ' / ' + + formatBytes(peakMemoryMetrics.OffHeapExecutionMemory, type)); + } else { + if (type !== 'display') { + return 0; + } else { + return '0.0 B / 0.0 B'; + } + } + } + }, + { + data : function (row, type) { + var peakMemoryMetrics = row.peakMemoryMetrics + if (typeof peakMemoryMetrics !== 'undefined') { + if (type !== 'display') + return peakMemoryMetrics.OnHeapStorageMemory; + else + return (formatBytes(peakMemoryMetrics.OnHeapStorageMemory, type) + ' / ' + + formatBytes(peakMemoryMetrics.OffHeapStorageMemory, type)); + } else { + if (type !== 'display') { + return 0; + } else { + return '0.0 B / 0.0 B'; + } + } + } + }, + { + data : function (row, type) { + var peakMemoryMetrics = row.peakMemoryMetrics + if (typeof peakMemoryMetrics !== 'undefined') { + if (type !== 'display') + return peakMemoryMetrics.DirectPoolMemory; + else + return (formatBytes(peakMemoryMetrics.DirectPoolMemory, type) + ' / ' + + formatBytes(peakMemoryMetrics.MappedPoolMemory, type)); + } else { + if (type !== 'display') { + return 0; + } else { + return '0.0 B / 0.0 B'; + } + } + } + } + ], + "columnDefs": [ + // SPARK-35087 [type:size] means String with structures like : 'size / records', + // they should be sorted as numerical-order instead of lexicographical-order by default. + // The targets: $id represents column id which comes from stagespage-template.html + // #summary-executor-table.If the relative position of the columns in the table + // #summary-executor-table has changed,please be careful to adjust the column index here + // Input Size / Records + {"type": "size", "targets": 9}, + // Output Size / Records + {"type": "size", "targets": 10}, + // Shuffle Read Size / Records + {"type": "size", "targets": 11}, + // Shuffle Write Size / Records + {"type": "size", "targets": 12}, + // Peak JVM Memory OnHeap / OffHeap + {"visible": false, "targets": 15}, + // Peak Execution Memory OnHeap / OffHeap + {"visible": false, "targets": 16}, + // Peak Storage Memory OnHeap / OffHeap + {"visible": false, "targets": 17}, + // Peak Pool Memory Direct / Mapped + {"visible": false, "targets": 18} + ], + "deferRender": true, + "order": [[0, "asc"]], + "bAutoWidth": false, + "oLanguage": { + "sEmptyTable": "No data to show yet" } + }; + executorSummaryTableSelector = + $("#summary-executor-table").DataTable(executorSummaryConf); + $('#parent-container [data-toggle="tooltip"]').tooltip(); + + executorSummaryTableSelector.column(9).visible(dataToShow.showInputData); + if (dataToShow.showInputData) { + $('#executor-summary-input').attr("data-toggle", "tooltip") + .attr("data-placement", "top") + .attr("title", "Bytes and records read from Hadoop or from Spark storage."); + $('#executor-summary-input').tooltip(true); + } + executorSummaryTableSelector.column(10).visible(dataToShow.showOutputData); + if (dataToShow.showOutputData) { + $('#executor-summary-output').attr("data-toggle", "tooltip") + .attr("data-placement", "top") + .attr("title", "Bytes and records written to Hadoop."); + $('#executor-summary-output').tooltip(true); + } + executorSummaryTableSelector.column(11).visible(dataToShow.showShuffleReadData); + if (dataToShow.showShuffleReadData) { + $('#executor-summary-shuffle-read').attr("data-toggle", "tooltip") + .attr("data-placement", "top") + .attr("title", "Total shuffle bytes and records read (includes both data read locally and data read from remote executors)."); + $('#executor-summary-shuffle-read').tooltip(true); + } + executorSummaryTableSelector.column(12).visible(dataToShow.showShuffleWriteData); + if (dataToShow.showShuffleWriteData) { + $('#executor-summary-shuffle-write').attr("data-toggle", "tooltip") + .attr("data-placement", "top") + .attr("title", "Bytes and records written to disk in order to be read by a shuffle in a future stage."); + $('#executor-summary-shuffle-write').tooltip(true); + } + executorSummaryTableSelector.column(13).visible(dataToShow.showBytesSpilledData); + executorSummaryTableSelector.column(14).visible(dataToShow.showBytesSpilledData); }); - var endPoint = stageEndPoint(appId); - var stageAttemptId = getStageAttemptId(); - $.getJSON(endPoint + "/" + stageAttemptId, function(response, status, jqXHR) { - - var responseBody = response; - var dataToShow = {}; - dataToShow.showInputData = responseBody.inputBytes > 0; - dataToShow.showOutputData = responseBody.outputBytes > 0; - dataToShow.showShuffleReadData = responseBody.shuffleReadBytes > 0; - dataToShow.showShuffleWriteData = responseBody.shuffleWriteBytes > 0; - dataToShow.showBytesSpilledData = - (responseBody.diskBytesSpilled > 0 || responseBody.memoryBytesSpilled > 0); - - var columnIndicesToRemove = []; - if (!dataToShow.showShuffleReadData) { - $('#shuffle_read_blocked_time').remove(); - $('#shuffle_remote_reads').remove(); - columnIndicesToRemove.push(2); - columnIndicesToRemove.push(3); - } + // prepare data for accumulatorUpdates + var accumulatorTable = responseBody.accumulatorUpdates.filter(accumUpdate => + !(accumUpdate.name).toString().includes("internal.")); + + var quantiles = "0,0.25,0.5,0.75,1.0"; + $.getJSON(endPoint + "/" + stageAttemptId + "/taskSummary?quantiles=" + quantiles, + function(taskMetricsResponse, _ignored_status, _ignored_jqXHR) { + var taskMetricKeys = Object.keys(taskMetricsResponse); + taskMetricKeys.forEach(function (columnKey) { + var row; + var row1; + var row2; + var row3; + switch(columnKey) { + case "shuffleReadMetrics": + row1 = createRowMetadataForColumn( + columnKey, taskMetricsResponse[columnKey], 3); + row2 = createRowMetadataForColumn( + "shuffleReadBlockedTime", taskMetricsResponse[columnKey], 13); + row3 = createRowMetadataForColumn( + "shuffleRemoteReads", taskMetricsResponse[columnKey], 14); + if (dataToShow.showShuffleReadData) { + taskSummaryMetricsTableArray.push(row1); + taskSummaryMetricsTableArray.push(row2); + taskSummaryMetricsTableArray.push(row3); + } + break; + + case "schedulerDelay": + row = createRowMetadataForColumn( + columnKey, taskMetricsResponse[columnKey], 11); + taskSummaryMetricsTableArray.push(row); + break; + + case "executorDeserializeTime": + row = createRowMetadataForColumn( + columnKey, taskMetricsResponse[columnKey], 12); + taskSummaryMetricsTableArray.push(row); + break; + + case "resultSerializationTime": + row = createRowMetadataForColumn( + columnKey, taskMetricsResponse[columnKey], 15); + taskSummaryMetricsTableArray.push(row); + break; + + case "gettingResultTime": + row = createRowMetadataForColumn( + columnKey, taskMetricsResponse[columnKey], 16); + taskSummaryMetricsTableArray.push(row); + break; + + case "peakExecutionMemory": + row = createRowMetadataForColumn( + columnKey, taskMetricsResponse[columnKey], 17); + taskSummaryMetricsTableArray.push(row); + break; + + case "inputMetrics": + row = createRowMetadataForColumn( + columnKey, taskMetricsResponse[columnKey], 1); + if (dataToShow.showInputData) { + taskSummaryMetricsTableArray.push(row); + } + break; - if (!dataToShow.showShuffleWriteData) { - $('#shuffle_write_time').remove(); - columnIndicesToRemove.push(7); - } + case "outputMetrics": + row = createRowMetadataForColumn( + columnKey, taskMetricsResponse[columnKey], 2); + if (dataToShow.showOutputData) { + taskSummaryMetricsTableArray.push(row); + } + break; + + case "shuffleWriteMetrics": + row1 = createRowMetadataForColumn( + columnKey, taskMetricsResponse[columnKey], 4); + row2 = createRowMetadataForColumn( + "shuffleWriteTime", taskMetricsResponse[columnKey], 21); + if (dataToShow.showShuffleWriteData) { + taskSummaryMetricsTableArray.push(row1); + taskSummaryMetricsTableArray.push(row2); + } + break; - if (columnIndicesToRemove.length > 0) { - columnIndicesToRemove.sort(function(a, b) { return b - a; }); - columnIndicesToRemove.forEach(function(idx) { - optionalColumns.splice(idx, 1); - }); - } + case "diskBytesSpilled": + row = createRowMetadataForColumn( + columnKey, taskMetricsResponse[columnKey], 5); + if (dataToShow.showBytesSpilledData) { + taskSummaryMetricsTableArray.push(row); + } + break; - // prepare data for executor summary table - var stageExecutorSummaryInfoKeys = Object.keys(responseBody.executorSummary); - $.getJSON(createRESTEndPointForExecutorsPage(appId), - function(executorSummaryResponse, status, jqXHR) { - var executorDetailsMap = {}; - executorSummaryResponse.forEach(function (executorDetail) { - executorDetailsMap[executorDetail.id] = executorDetail; - }); - - var executorSummaryTable = []; - stageExecutorSummaryInfoKeys.forEach(function (columnKeyIndex) { - var executorSummary = responseBody.executorSummary[columnKeyIndex]; - var executorDetail = executorDetailsMap[columnKeyIndex.toString()]; - executorSummary.id = columnKeyIndex; - executorSummary.executorLogs = {}; - executorSummary.hostPort = "CANNOT FIND ADDRESS"; - - if (executorDetail) { - if (executorDetail["executorLogs"]) { - responseBody.executorSummary[columnKeyIndex].executorLogs = - executorDetail["executorLogs"]; - } - if (executorDetail["hostPort"]) { - responseBody.executorSummary[columnKeyIndex].hostPort = - executorDetail["hostPort"]; - } - } - executorSummaryTable.push(responseBody.executorSummary[columnKeyIndex]); - }); - // building task aggregated metrics by executor table - var executorSummaryConf = { - "data": executorSummaryTable, - "columns": [ - {data : "id"}, - {data : "executorLogs", render: formatLogsCells}, - {data : "hostPort"}, - { - data : function (row, type) { - return type === 'display' ? formatDuration(row.taskTime) : row.taskTime; - } - }, - { - data : function (row, type) { - var totaltasks = row.succeededTasks + row.failedTasks + row.killedTasks; - return type === 'display' ? totaltasks : totaltasks.toString(); - } - }, - {data : "failedTasks"}, - {data : "killedTasks"}, - {data : "succeededTasks"}, - {data : "isBlacklistedForStage"}, - { - data : function (row, type) { - return row.inputRecords != 0 ? formatBytes(row.inputBytes, type) + " / " + row.inputRecords : ""; - } - }, - { - data : function (row, type) { - return row.outputRecords != 0 ? formatBytes(row.outputBytes, type) + " / " + row.outputRecords : ""; - } - }, - { - data : function (row, type) { - return row.shuffleReadRecords != 0 ? formatBytes(row.shuffleRead, type) + " / " + row.shuffleReadRecords : ""; - } - }, - { - data : function (row, type) { - return row.shuffleWriteRecords != 0 ? formatBytes(row.shuffleWrite, type) + " / " + row.shuffleWriteRecords : ""; - } - }, - { - data : function (row, type) { - return typeof row.memoryBytesSpilled != 'undefined' ? formatBytes(row.memoryBytesSpilled, type) : ""; - } - }, - { - data : function (row, type) { - return typeof row.diskBytesSpilled != 'undefined' ? formatBytes(row.diskBytesSpilled, type) : ""; - } - } - ], - "order": [[0, "asc"]], - "bAutoWidth": false, - "oLanguage": { - "sEmptyTable": "No data to show yet" - } - }; - var executorSummaryTableSelector = - $("#summary-executor-table").DataTable(executorSummaryConf); - $('#parent-container [data-toggle="tooltip"]').tooltip(); - - executorSummaryTableSelector.column(9).visible(dataToShow.showInputData); - if (dataToShow.showInputData) { - $('#executor-summary-input').attr("data-toggle", "tooltip") - .attr("data-placement", "top") - .attr("title", "Bytes and records read from Hadoop or from Spark storage."); - $('#executor-summary-input').tooltip(true); + case "memoryBytesSpilled": + row = createRowMetadataForColumn( + columnKey, taskMetricsResponse[columnKey], 6); + if (dataToShow.showBytesSpilledData) { + taskSummaryMetricsTableArray.push(row); + } + break; + + default: + if (getColumnNameForTaskMetricSummary(columnKey) != "NA") { + row = createRowMetadataForColumn( + columnKey, taskMetricsResponse[columnKey], 0); + taskSummaryMetricsTableArray.push(row); + } + break; + } + }); + var taskSummaryMetricsTableFilteredArray = + taskSummaryMetricsTableArray.filter(row => row.checkboxId < 11); + taskSummaryMetricsTableCurrentStateArray = taskSummaryMetricsTableFilteredArray.slice(); + reselectCheckboxesBasedOnTaskTableState(); + }); + + // building accumulator update table + var accumulatorConf = { + "data": accumulatorTable, + "columns": [ + {data : "id"}, + {data : "name"}, + {data : "value"} + ], + "paging": false, + "searching": false, + "order": [[0, "asc"]], + "bAutoWidth": false + }; + $("#accumulator-table").DataTable(accumulatorConf); + + // building tasks table that uses server side functionality + var totalTasksToShow = responseBody.numCompleteTasks + responseBody.numActiveTasks + + responseBody.numKilledTasks + responseBody.numFailedTasks; + var taskTable = "#active-tasks-table"; + var taskConf = { + "serverSide": true, + "paging": true, + "info": true, + "processing": true, + "lengthMenu": [[20, 40, 60, 100, -1], [20, 40, 60, 100, "All"]], + "orderMulti": false, + "bAutoWidth": false, + "ajax": { + "url": endPoint + "/" + stageAttemptId + "/taskTable", + "data": function (data) { + var columnIndexToSort = 0; + var columnNameToSort = "Index"; + if (data.order[0].column && data.order[0].column != "") { + columnIndexToSort = parseInt(data.order[0].column); + columnNameToSort = data.columns[columnIndexToSort].name; + } + delete data.columns; + data.numTasks = totalTasksToShow; + data.columnIndexToSort = columnIndexToSort; + data.columnNameToSort = columnNameToSort; + if (data.length === -1) { + data.length = totalTasksToShow; + } + }, + "dataSrc": function (jsons) { + var jsonStr = JSON.stringify(jsons); + var tasksToShow = JSON.parse(jsonStr); + return tasksToShow.aaData; + }, + "error": function (_ignored_jqXHR, _ignored_textStatus, _ignored_errorThrown) { + alert("Unable to connect to the server. Looks like the Spark " + + "application must have ended. Please Switch to the history UI."); + $("#active-tasks-table_processing").css("display","none"); + } + }, + "columns": [ + { + data: function (row, type) { + return type !== 'display' ? (isNaN(row.index) ? 0 : row.index ) : row.index; + }, + name: "Index" + }, + {data : "taskId", name: "ID"}, + {data : "attempt", name: "Attempt"}, + {data : "status", name: "Status"}, + {data : "taskLocality", name: "Locality Level"}, + {data : "executorId", name: "Executor ID"}, + {data : "host", name: "Host"}, + {data : "executorLogs", name: "Logs", render: formatLogsCells}, + {data : "launchTime", name: "Launch Time", render: formatDate}, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.executorRunTime) { + return type === 'display' ? formatDuration(row.taskMetrics.executorRunTime) : row.taskMetrics.executorRunTime; + } else { + return ""; } - executorSummaryTableSelector.column(10).visible(dataToShow.showOutputData); - if (dataToShow.showOutputData) { - $('#executor-summary-output').attr("data-toggle", "tooltip") - .attr("data-placement", "top") - .attr("title", "Bytes and records written to Hadoop."); - $('#executor-summary-output').tooltip(true); + }, + name: "Duration" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.jvmGcTime) { + return type === 'display' ? formatDuration(row.taskMetrics.jvmGcTime) : row.taskMetrics.jvmGcTime; + } else { + return ""; } - executorSummaryTableSelector.column(11).visible(dataToShow.showShuffleReadData); - if (dataToShow.showShuffleReadData) { - $('#executor-summary-shuffle-read').attr("data-toggle", "tooltip") - .attr("data-placement", "top") - .attr("title", "Total shuffle bytes and records read (includes both data read locally and data read from remote executors)."); - $('#executor-summary-shuffle-read').tooltip(true); + }, + name: "GC Time" + }, + { + data : function (row, type) { + if (row.schedulerDelay) { + return type === 'display' ? formatDuration(row.schedulerDelay) : row.schedulerDelay; + } else { + return ""; } - executorSummaryTableSelector.column(12).visible(dataToShow.showShuffleWriteData); - if (dataToShow.showShuffleWriteData) { - $('#executor-summary-shuffle-write').attr("data-toggle", "tooltip") - .attr("data-placement", "top") - .attr("title", "Bytes and records written to disk in order to be read by a shuffle in a future stage."); - $('#executor-summary-shuffle-write').tooltip(true); + }, + name: "Scheduler Delay" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.executorDeserializeTime) { + return type === 'display' ? formatDuration(row.taskMetrics.executorDeserializeTime) : row.taskMetrics.executorDeserializeTime; + } else { + return ""; } - executorSummaryTableSelector.column(13).visible(dataToShow.showBytesSpilledData); - executorSummaryTableSelector.column(14).visible(dataToShow.showBytesSpilledData); - }); - - // prepare data for accumulatorUpdates - var accumulatorTable = responseBody.accumulatorUpdates.filter(accumUpdate => - !(accumUpdate.name).toString().includes("internal.")); - - var quantiles = "0,0.25,0.5,0.75,1.0"; - $.getJSON(endPoint + "/" + stageAttemptId + "/taskSummary?quantiles=" + quantiles, - function(taskMetricsResponse, status, jqXHR) { - var taskMetricKeys = Object.keys(taskMetricsResponse); - taskMetricKeys.forEach(function (columnKey) { - switch(columnKey) { - case "shuffleReadMetrics": - var row1 = createRowMetadataForColumn( - columnKey, taskMetricsResponse[columnKey], 3); - var row2 = createRowMetadataForColumn( - "shuffleReadBlockedTime", taskMetricsResponse[columnKey], 13); - var row3 = createRowMetadataForColumn( - "shuffleRemoteReads", taskMetricsResponse[columnKey], 14); - if (dataToShow.showShuffleReadData) { - taskSummaryMetricsTableArray.push(row1); - taskSummaryMetricsTableArray.push(row2); - taskSummaryMetricsTableArray.push(row3); - } - break; - - case "schedulerDelay": - var row = createRowMetadataForColumn( - columnKey, taskMetricsResponse[columnKey], 11); - taskSummaryMetricsTableArray.push(row); - break; - - case "executorDeserializeTime": - var row = createRowMetadataForColumn( - columnKey, taskMetricsResponse[columnKey], 12); - taskSummaryMetricsTableArray.push(row); - break; - - case "resultSerializationTime": - var row = createRowMetadataForColumn( - columnKey, taskMetricsResponse[columnKey], 15); - taskSummaryMetricsTableArray.push(row); - break; - - case "gettingResultTime": - var row = createRowMetadataForColumn( - columnKey, taskMetricsResponse[columnKey], 16); - taskSummaryMetricsTableArray.push(row); - break; - - case "peakExecutionMemory": - var row = createRowMetadataForColumn( - columnKey, taskMetricsResponse[columnKey], 17); - taskSummaryMetricsTableArray.push(row); - break; - - case "inputMetrics": - var row = createRowMetadataForColumn( - columnKey, taskMetricsResponse[columnKey], 1); - if (dataToShow.showInputData) { - taskSummaryMetricsTableArray.push(row); - } - break; - - case "outputMetrics": - var row = createRowMetadataForColumn( - columnKey, taskMetricsResponse[columnKey], 2); - if (dataToShow.showOutputData) { - taskSummaryMetricsTableArray.push(row); - } - break; - - case "shuffleWriteMetrics": - var row1 = createRowMetadataForColumn( - columnKey, taskMetricsResponse[columnKey], 4); - var row2 = createRowMetadataForColumn( - "shuffleWriteTime", taskMetricsResponse[columnKey], 21); - if (dataToShow.showShuffleWriteData) { - taskSummaryMetricsTableArray.push(row1); - taskSummaryMetricsTableArray.push(row2); - } - break; - - case "diskBytesSpilled": - var row = createRowMetadataForColumn( - columnKey, taskMetricsResponse[columnKey], 5); - if (dataToShow.showBytesSpilledData) { - taskSummaryMetricsTableArray.push(row); - } - break; - - case "memoryBytesSpilled": - var row = createRowMetadataForColumn( - columnKey, taskMetricsResponse[columnKey], 6); - if (dataToShow.showBytesSpilledData) { - taskSummaryMetricsTableArray.push(row); - } - break; - - default: - if (getColumnNameForTaskMetricSummary(columnKey) != "NA") { - var row = createRowMetadataForColumn( - columnKey, taskMetricsResponse[columnKey], 0); - taskSummaryMetricsTableArray.push(row); - } - break; - } - }); - var taskSummaryMetricsTableFilteredArray = - taskSummaryMetricsTableArray.filter(row => row.checkboxId < 11); - taskSummaryMetricsTableCurrentStateArray = taskSummaryMetricsTableFilteredArray.slice(); - reselectCheckboxesBasedOnTaskTableState(); - }); - - // building accumulator update table - var accumulatorConf = { - "data": accumulatorTable, - "columns": [ - {data : "id"}, - {data : "name"}, - {data : "value"} - ], - "paging": false, - "searching": false, - "order": [[0, "asc"]], - "bAutoWidth": false - }; - $("#accumulator-table").DataTable(accumulatorConf); - - // building tasks table that uses server side functionality - var totalTasksToShow = responseBody.numCompleteTasks + responseBody.numActiveTasks + - responseBody.numKilledTasks + responseBody.numFailedTasks; - var taskTable = "#active-tasks-table"; - var taskConf = { - "serverSide": true, - "paging": true, - "info": true, - "processing": true, - "lengthMenu": [[20, 40, 60, 100, totalTasksToShow], [20, 40, 60, 100, "All"]], - "orderMulti": false, - "bAutoWidth": false, - "ajax": { - "url": endPoint + "/" + stageAttemptId + "/taskTable", - "data": function (data) { - var columnIndexToSort = 0; - var columnNameToSort = "Index"; - if (data.order[0].column && data.order[0].column != "") { - columnIndexToSort = parseInt(data.order[0].column); - columnNameToSort = data.columns[columnIndexToSort].name; - } - delete data.columns; - data.numTasks = totalTasksToShow; - data.columnIndexToSort = columnIndexToSort; - data.columnNameToSort = columnNameToSort; - }, - "dataSrc": function (jsons) { - var jsonStr = JSON.stringify(jsons); - var tasksToShow = JSON.parse(jsonStr); - return tasksToShow.aaData; - }, - "error": function (jqXHR, textStatus, errorThrown) { - alert("Unable to connect to the server. Looks like the Spark " + - "application must have ended. Please Switch to the history UI."); - $("#active-tasks-table_processing").css("display","none"); - } - }, - "columns": [ - {data: function (row, type) { - return type !== 'display' ? (isNaN(row.index) ? 0 : row.index ) : row.index; - }, - name: "Index" - }, - {data : "taskId", name: "ID"}, - {data : "attempt", name: "Attempt"}, - {data : "status", name: "Status"}, - {data : "taskLocality", name: "Locality Level"}, - {data : "executorId", name: "Executor ID"}, - {data : "host", name: "Host"}, - {data : "executorLogs", name: "Logs", render: formatLogsCells}, - {data : "launchTime", name: "Launch Time", render: formatDate}, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.executorRunTime) { - return type === 'display' ? formatDuration(row.taskMetrics.executorRunTime) : row.taskMetrics.executorRunTime; - } else { - return ""; - } - }, - name: "Duration" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.jvmGcTime) { - return type === 'display' ? formatDuration(row.taskMetrics.jvmGcTime) : row.taskMetrics.jvmGcTime; - } else { - return ""; - } - }, - name: "GC Time" - }, - { - data : function (row, type) { - if (row.schedulerDelay) { - return type === 'display' ? formatDuration(row.schedulerDelay) : row.schedulerDelay; - } else { - return ""; - } - }, - name: "Scheduler Delay" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.executorDeserializeTime) { - return type === 'display' ? formatDuration(row.taskMetrics.executorDeserializeTime) : row.taskMetrics.executorDeserializeTime; - } else { - return ""; - } - }, - name: "Task Deserialization Time" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.shuffleReadMetrics) { - return type === 'display' ? formatDuration(row.taskMetrics.shuffleReadMetrics.fetchWaitTime) : row.taskMetrics.shuffleReadMetrics.fetchWaitTime; - } else { - return ""; - } - }, - name: "Shuffle Read Blocked Time" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.shuffleReadMetrics) { - return type === 'display' ? formatBytes(row.taskMetrics.shuffleReadMetrics.remoteBytesRead, type) : row.taskMetrics.shuffleReadMetrics.remoteBytesRead; - } else { - return ""; - } - }, - name: "Shuffle Remote Reads" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.resultSerializationTime) { - return type === 'display' ? formatDuration(row.taskMetrics.resultSerializationTime) : row.taskMetrics.resultSerializationTime; - } else { - return ""; - } - }, - name: "Result Serialization Time" - }, - { - data : function (row, type) { - if (row.gettingResultTime) { - return type === 'display' ? formatDuration(row.gettingResultTime) : row.gettingResultTime; - } else { - return ""; - } - }, - name: "Getting Result Time" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.peakExecutionMemory) { - return type === 'display' ? formatBytes(row.taskMetrics.peakExecutionMemory, type) : row.taskMetrics.peakExecutionMemory; - } else { - return ""; - } - }, - name: "Peak Execution Memory" - }, - { - data : function (row, type) { - if (accumulatorTable.length > 0 && row.accumulatorUpdates.length > 0) { - var allAccums = ""; - row.accumulatorUpdates.forEach(function(accumulator) { - allAccums += accumulator.name + ': ' + accumulator.update + "
"; - }); - return allAccums; - } else { - return ""; - } - }, - name: "Accumulators" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.inputMetrics && row.taskMetrics.inputMetrics.bytesRead > 0) { - if (type === 'display') { - return formatBytes(row.taskMetrics.inputMetrics.bytesRead, type) + " / " + row.taskMetrics.inputMetrics.recordsRead; - } else { - return row.taskMetrics.inputMetrics.bytesRead + " / " + row.taskMetrics.inputMetrics.recordsRead; - } - } else { - return ""; - } - }, - name: "Input Size / Records" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.outputMetrics && row.taskMetrics.outputMetrics.bytesWritten > 0) { - if (type === 'display') { - return formatBytes(row.taskMetrics.outputMetrics.bytesWritten, type) + " / " + row.taskMetrics.outputMetrics.recordsWritten; - } else { - return row.taskMetrics.outputMetrics.bytesWritten + " / " + row.taskMetrics.outputMetrics.recordsWritten; - } - } else { - return ""; - } - }, - name: "Output Size / Records" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.shuffleWriteMetrics && row.taskMetrics.shuffleWriteMetrics.writeTime > 0) { - return type === 'display' ? formatDuration(parseInt(row.taskMetrics.shuffleWriteMetrics.writeTime) / 1000000.0) : row.taskMetrics.shuffleWriteMetrics.writeTime; - } else { - return ""; - } - }, - name: "Shuffle Write Time" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.shuffleWriteMetrics && row.taskMetrics.shuffleWriteMetrics.bytesWritten > 0) { - if (type === 'display') { - return formatBytes(row.taskMetrics.shuffleWriteMetrics.bytesWritten, type) + " / " + row.taskMetrics.shuffleWriteMetrics.recordsWritten; - } else { - return row.taskMetrics.shuffleWriteMetrics.bytesWritten + " / " + row.taskMetrics.shuffleWriteMetrics.recordsWritten; - } - } else { - return ""; - } - }, - name: "Shuffle Write Size / Records" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.shuffleReadMetrics && row.taskMetrics.shuffleReadMetrics.localBytesRead > 0) { - var totalBytesRead = parseInt(row.taskMetrics.shuffleReadMetrics.localBytesRead) + parseInt(row.taskMetrics.shuffleReadMetrics.remoteBytesRead); - if (type === 'display') { - return formatBytes(totalBytesRead, type) + " / " + row.taskMetrics.shuffleReadMetrics.recordsRead; - } else { - return totalBytesRead + " / " + row.taskMetrics.shuffleReadMetrics.recordsRead; - } - } else { - return ""; - } - }, - name: "Shuffle Read Size / Records" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.memoryBytesSpilled && row.taskMetrics.memoryBytesSpilled > 0) { - return type === 'display' ? formatBytes(row.taskMetrics.memoryBytesSpilled, type) : row.taskMetrics.memoryBytesSpilled; - } else { - return ""; - } - }, - name: "Spill (Memory)" - }, - { - data : function (row, type) { - if (row.taskMetrics && row.taskMetrics.diskBytesSpilled && row.taskMetrics.diskBytesSpilled > 0) { - return type === 'display' ? formatBytes(row.taskMetrics.diskBytesSpilled, type) : row.taskMetrics.diskBytesSpilled; - } else { - return ""; - } - }, - name: "Spill (Disk)" - }, - { - data : function (row, type) { - var msg = row.errorMessage; - if (typeof msg === 'undefined') { - return ""; - } else { - var formHead = msg.substring(0, msg.indexOf("at")); - var form = "+details"; - var formMsg = "
" + row.errorMessage + "
"; - return formHead + form + formMsg; - } - }, - name: "Errors" - } - ], - "columnDefs": [ - { "visible": false, "targets": 11 }, - { "visible": false, "targets": 12 }, - { "visible": false, "targets": 13 }, - { "visible": false, "targets": 14 }, - { "visible": false, "targets": 15 }, - { "visible": false, "targets": 16 }, - { "visible": false, "targets": 17 }, - { "visible": false, "targets": 18 }, - { "visible": false, "targets": 21 } - ], - "deferRender": true - }; - taskTableSelector = $(taskTable).DataTable(taskConf); - $('#active-tasks-table_filter input').unbind(); - var searchEvent; - $('#active-tasks-table_filter input').bind('keyup', function(e) { - if (typeof searchEvent !== 'undefined') { - window.clearTimeout(searchEvent); + }, + name: "Task Deserialization Time" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.shuffleReadMetrics) { + return type === 'display' ? formatDuration(row.taskMetrics.shuffleReadMetrics.fetchWaitTime) : row.taskMetrics.shuffleReadMetrics.fetchWaitTime; + } else { + return ""; + } + }, + name: "Shuffle Read Blocked Time" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.shuffleReadMetrics) { + return type === 'display' ? formatBytes(row.taskMetrics.shuffleReadMetrics.remoteBytesRead, type) : row.taskMetrics.shuffleReadMetrics.remoteBytesRead; + } else { + return ""; + } + }, + name: "Shuffle Remote Reads" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.resultSerializationTime) { + return type === 'display' ? formatDuration(row.taskMetrics.resultSerializationTime) : row.taskMetrics.resultSerializationTime; + } else { + return ""; + } + }, + name: "Result Serialization Time" + }, + { + data : function (row, type) { + if (row.gettingResultTime) { + return type === 'display' ? formatDuration(row.gettingResultTime) : row.gettingResultTime; + } else { + return ""; + } + }, + name: "Getting Result Time" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.peakExecutionMemory) { + return type === 'display' ? formatBytes(row.taskMetrics.peakExecutionMemory, type) : row.taskMetrics.peakExecutionMemory; + } else { + return ""; + } + }, + name: "Peak Execution Memory" + }, + { + data : function (row, _ignored_type) { + if (accumulatorTable.length > 0 && row.accumulatorUpdates.length > 0) { + var allAccums = ""; + row.accumulatorUpdates.forEach(function(accumulator) { + allAccums += accumulator.name + ': ' + accumulator.update + "
"; + }); + return allAccums; + } else { + return ""; + } + }, + name: "Accumulators" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.inputMetrics && row.taskMetrics.inputMetrics.bytesRead > 0) { + if (type === 'display') { + return formatBytes(row.taskMetrics.inputMetrics.bytesRead, type) + " / " + row.taskMetrics.inputMetrics.recordsRead; + } else { + return row.taskMetrics.inputMetrics.bytesRead + " / " + row.taskMetrics.inputMetrics.recordsRead; } - var value = this.value; - searchEvent = window.setTimeout(function(){ - taskTableSelector.search( value ).draw();}, 500); - }); - reselectCheckboxesBasedOnTaskTableState(); - - // hide or show columns dynamically event - $('input.toggle-vis').on('click', function(e){ - // Get the column - var para = $(this).attr('data-column'); - if (para == "0") { - var allColumns = taskTableSelector.columns(optionalColumns); - if ($(this).is(":checked")) { - $(".toggle-vis").prop('checked', true); - allColumns.visible(true); - createDataTableForTaskSummaryMetricsTable(taskSummaryMetricsTableArray); - } else { - $(".toggle-vis").prop('checked', false); - allColumns.visible(false); - var taskSummaryMetricsTableFilteredArray = - taskSummaryMetricsTableArray.filter(row => row.checkboxId < 11); - createDataTableForTaskSummaryMetricsTable(taskSummaryMetricsTableFilteredArray); - } - } else { - var column = taskTableSelector.column(para); - // Toggle the visibility - column.visible(!column.visible()); - var taskSummaryMetricsTableFilteredArray = []; - if ($(this).is(":checked")) { - taskSummaryMetricsTableCurrentStateArray.push(taskSummaryMetricsTableArray.filter(row => (row.checkboxId).toString() == para)[0]); - taskSummaryMetricsTableFilteredArray = taskSummaryMetricsTableCurrentStateArray.slice(); - } else { - taskSummaryMetricsTableFilteredArray = - taskSummaryMetricsTableCurrentStateArray.filter(row => (row.checkboxId).toString() != para); - } - createDataTableForTaskSummaryMetricsTable(taskSummaryMetricsTableFilteredArray); - } - }); - - // title number and toggle list - $("#summaryMetricsTitle").html("Summary Metrics for " + "" + responseBody.numCompleteTasks + " Completed Tasks" + ""); - $("#tasksTitle").html("Tasks (" + totalTasksToShow + ")"); - - // hide or show the accumulate update table - if (accumulatorTable.length == 0) { - $("#accumulator-update-table").hide(); } else { - taskTableSelector.column(18).visible(true); - $("#accumulator-update-table").show(); + return ""; } - // Showing relevant stage data depending on stage type for task table and executor - // summary table - taskTableSelector.column(19).visible(dataToShow.showInputData); - taskTableSelector.column(20).visible(dataToShow.showOutputData); - taskTableSelector.column(22).visible(dataToShow.showShuffleWriteData); - taskTableSelector.column(23).visible(dataToShow.showShuffleReadData); - taskTableSelector.column(24).visible(dataToShow.showBytesSpilledData); - taskTableSelector.column(25).visible(dataToShow.showBytesSpilledData); - - if (window.localStorage) { - if (window.localStorage.getItem("arrowtoggle1class") !== null && - window.localStorage.getItem("arrowtoggle1class").includes("arrow-open")) { - $("#arrowtoggle1").toggleClass("arrow-open arrow-closed"); - $("#toggle-metrics").toggleClass("d-none"); - } - if (window.localStorage.getItem("arrowtoggle2class") !== null && - window.localStorage.getItem("arrowtoggle2class").includes("arrow-open")) { - $("#arrowtoggle2").toggleClass("arrow-open arrow-closed"); - $("#toggle-aggregatedMetrics").toggleClass("d-none"); - } + }, + name: "Input Size / Records" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.outputMetrics && row.taskMetrics.outputMetrics.bytesWritten > 0) { + if (type === 'display') { + return formatBytes(row.taskMetrics.outputMetrics.bytesWritten, type) + " / " + row.taskMetrics.outputMetrics.recordsWritten; + } else { + return row.taskMetrics.outputMetrics.bytesWritten + " / " + row.taskMetrics.outputMetrics.recordsWritten; + } + } else { + return ""; } - }); + }, + name: "Output Size / Records" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.shuffleWriteMetrics && row.taskMetrics.shuffleWriteMetrics.writeTime > 0) { + return type === 'display' ? formatDuration(parseInt(row.taskMetrics.shuffleWriteMetrics.writeTime) / 1000000.0) : row.taskMetrics.shuffleWriteMetrics.writeTime; + } else { + return ""; + } + }, + name: "Shuffle Write Time" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.shuffleWriteMetrics && row.taskMetrics.shuffleWriteMetrics.bytesWritten > 0) { + if (type === 'display') { + return formatBytes(row.taskMetrics.shuffleWriteMetrics.bytesWritten, type) + " / " + row.taskMetrics.shuffleWriteMetrics.recordsWritten; + } else { + return row.taskMetrics.shuffleWriteMetrics.bytesWritten + " / " + row.taskMetrics.shuffleWriteMetrics.recordsWritten; + } + } else { + return ""; + } + }, + name: "Shuffle Write Size / Records" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.shuffleReadMetrics && + (row.taskMetrics.shuffleReadMetrics.localBytesRead > 0 || row.taskMetrics.shuffleReadMetrics.remoteBytesRead > 0)) { + var totalBytesRead = parseInt(row.taskMetrics.shuffleReadMetrics.localBytesRead) + parseInt(row.taskMetrics.shuffleReadMetrics.remoteBytesRead); + if (type === 'display') { + return formatBytes(totalBytesRead, type) + " / " + row.taskMetrics.shuffleReadMetrics.recordsRead; + } else { + return totalBytesRead + " / " + row.taskMetrics.shuffleReadMetrics.recordsRead; + } + } else { + return ""; + } + }, + name: "Shuffle Read Size / Records" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.memoryBytesSpilled && row.taskMetrics.memoryBytesSpilled > 0) { + return type === 'display' ? formatBytes(row.taskMetrics.memoryBytesSpilled, type) : row.taskMetrics.memoryBytesSpilled; + } else { + return ""; + } + }, + name: "Spill (Memory)" + }, + { + data : function (row, type) { + if (row.taskMetrics && row.taskMetrics.diskBytesSpilled && row.taskMetrics.diskBytesSpilled > 0) { + return type === 'display' ? formatBytes(row.taskMetrics.diskBytesSpilled, type) : row.taskMetrics.diskBytesSpilled; + } else { + return ""; + } + }, + name: "Spill (Disk)" + }, + { + data : function (row, _ignored_type) { + var msg = row.errorMessage; + if (typeof msg === 'undefined') { + return ""; + } else { + var indexOfLineSeparator = msg.indexOf("\n"); + var formHead = indexOfLineSeparator > 0 ? msg.substring(0, indexOfLineSeparator) : (msg.length > 100 ? msg.substring(0, 100) : msg); + var form = "+details"; + var formMsg = "
" + row.errorMessage + "
"; + return formHead + form + formMsg; + } + }, + name: "Errors" + } + ], + "columnDefs": [ + { "visible": false, "targets": 11 }, + { "visible": false, "targets": 12 }, + { "visible": false, "targets": 13 }, + { "visible": false, "targets": 14 }, + { "visible": false, "targets": 15 }, + { "visible": false, "targets": 16 }, + { "visible": false, "targets": 17 }, + { "visible": false, "targets": 18 }, + { "visible": false, "targets": 21 } + ], + "deferRender": true + }; + taskTableSelector = $(taskTable).DataTable(taskConf); + $('#active-tasks-table_filter input').unbind(); + var searchEvent; + $('#active-tasks-table_filter input').bind('keyup', function(_ignored_e) { + if (typeof searchEvent !== 'undefined') { + window.clearTimeout(searchEvent); + } + var value = this.value; + searchEvent = window.setTimeout(function(){ + taskTableSelector.search( value ).draw();}, 500); }); + reselectCheckboxesBasedOnTaskTableState(); + + // hide or show columns dynamically event + $('input.toggle-vis').on('click', function(_ignored_e){ + var taskSummaryMetricsTableFilteredArray; + // Get the column + var para = $(this).attr('data-column'); + if (para == "0") { + var allColumns = taskTableSelector.columns(optionalColumns); + var executorAllColumns = executorSummaryTableSelector.columns(executorOptionalColumns); + if ($(this).is(":checked")) { + $(".toggle-vis").prop('checked', true); + allColumns.visible(true); + executorAllColumns.visible(true); + createDataTableForTaskSummaryMetricsTable(taskSummaryMetricsTableArray); + } else { + $(".toggle-vis").prop('checked', false); + allColumns.visible(false); + executorAllColumns.visible(false); + taskSummaryMetricsTableFilteredArray = + taskSummaryMetricsTableArray.filter(row => row.checkboxId < 11); + createDataTableForTaskSummaryMetricsTable(taskSummaryMetricsTableFilteredArray); + } + } else { + var dataMetricsType = $(this).attr("data-metrics-type"); + var column; + if (dataMetricsType === 'task') { + column = taskTableSelector.column(para); + // Toggle the visibility + column.visible(!column.visible()); + taskSummaryMetricsTableFilteredArray = []; + if ($(this).is(":checked")) { + taskSummaryMetricsTableCurrentStateArray.push(taskSummaryMetricsTableArray.filter(row => (row.checkboxId).toString() == para)[0]); + taskSummaryMetricsTableFilteredArray = taskSummaryMetricsTableCurrentStateArray.slice(); + } else { + taskSummaryMetricsTableFilteredArray = + taskSummaryMetricsTableCurrentStateArray.filter(row => (row.checkboxId).toString() != para); + } + createDataTableForTaskSummaryMetricsTable(taskSummaryMetricsTableFilteredArray); + } + if (dataMetricsType === "executor") { + column = executorSummaryTableSelector.column(para); + column.visible(!column.visible()); + } + } + }); + + // title number and toggle list + $("#summaryMetricsTitle").html("Summary Metrics for " + "" + responseBody.numCompleteTasks + " Completed Tasks" + ""); + $("#tasksTitle").html("Tasks (" + totalTasksToShow + ")"); + + // hide or show the accumulate update table + if (accumulatorTable.length == 0) { + $("#accumulator-update-table").hide(); + } else { + taskTableSelector.column(18).visible(true); + $("#accumulator-update-table").show(); + } + // Showing relevant stage data depending on stage type for task table and executor + // summary table + taskTableSelector.column(19).visible(dataToShow.showInputData); + taskTableSelector.column(20).visible(dataToShow.showOutputData); + taskTableSelector.column(22).visible(dataToShow.showShuffleWriteData); + taskTableSelector.column(23).visible(dataToShow.showShuffleReadData); + taskTableSelector.column(24).visible(dataToShow.showBytesSpilledData); + taskTableSelector.column(25).visible(dataToShow.showBytesSpilledData); + + if (window.localStorage) { + if (window.localStorage.getItem("arrowtoggle1class") !== null && + window.localStorage.getItem("arrowtoggle1class").includes("arrow-open")) { + $("#arrowtoggle1").toggleClass("arrow-open arrow-closed"); + $("#toggle-metrics").toggleClass("d-none"); + } + if (window.localStorage.getItem("arrowtoggle2class") !== null && + window.localStorage.getItem("arrowtoggle2class").includes("arrow-open")) { + $("#arrowtoggle2").toggleClass("arrow-open arrow-closed"); + $("#toggle-aggregatedMetrics").toggleClass("d-none"); + } + } + }); }); + }); }); diff --git a/core/src/main/resources/org/apache/spark/ui/static/stagespage-template.html b/core/src/main/resources/org/apache/spark/ui/static/stagespage-template.html index 77ea70e4ad966..b938158b77027 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/stagespage-template.html +++ b/core/src/main/resources/org/apache/spark/ui/static/stagespage-template.html @@ -50,8 +50,8 @@

Aggregated Metrics by Executor

Succeeded Tasks - Blacklisted + title="Shows if this executor has been excluded by the scheduler due to task failures."> + Excluded Input Size / Records Output Size / Records @@ -59,6 +59,10 @@

Aggregated Metrics by Executor

Shuffle Write Size / Records Spill (Memory) Spill (Disk) + Peak JVM Memory OnHeap / OffHeap + Peak Execution Memory OnHeap / OffHeap + Peak Storage Memory OnHeap / OffHeap + Peak Pool Memory Direct / Mapped diff --git a/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js b/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js index 6d4c8d94b4288..9f366025a8b55 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js +++ b/core/src/main/resources/org/apache/spark/ui/static/streaming-page.js @@ -15,6 +15,7 @@ * limitations under the License. */ +/* global $, d3, timeFormat, timeTipStrings */ // timeFormat: StreamingPage.scala will generate a global "timeFormat" dictionary to store the time // and its formatted string. Because we cannot specify a timezone in JavaScript, to make sure the @@ -37,87 +38,90 @@ var onClickTimeline = function() {}; // Show a tooltip "text" for "node" function showBootstrapTooltip(node, text) { - $(node).tooltip({title: text, trigger: "manual", container: "body"}); - $(node).tooltip("show"); + $(node).tooltip({title: text, trigger: "manual", container: "body"}); + $(node).tooltip("show"); } // Hide the tooltip for "node" function hideBootstrapTooltip(node) { - $(node).tooltip("dispose"); + $(node).tooltip("dispose"); } +/* eslint-disable no-unused-vars */ // Return the function to scroll to the corresponding // row on clicking a point of batch in the timeline. function getOnClickTimelineFunction() { - // If the user click one point in the graphs, jump to the batch row and highlight it. And - // recovery the batch row after 3 seconds if necessary. - // We need to remember the last clicked batch so that we can recovery it. - var lastClickedBatch = null; - var lastTimeout = null; - - return function(d) { - var batchSelector = $("#batch-" + d.x); - // If there is a corresponding batch row, scroll down to it and highlight it. - if (batchSelector.length > 0) { - if (lastTimeout != null) { - window.clearTimeout(lastTimeout); - } - if (lastClickedBatch != null) { - clearBatchRow(lastClickedBatch); - lastClickedBatch = null; - } - lastClickedBatch = d.x; - highlightBatchRow(lastClickedBatch); - lastTimeout = window.setTimeout(function () { - lastTimeout = null; - if (lastClickedBatch != null) { - clearBatchRow(lastClickedBatch); - lastClickedBatch = null; - } - }, 3000); // Clean up after 3 seconds - - var topOffset = batchSelector.offset().top - 15; - if (topOffset < 0) { - topOffset = 0; - } - $('html,body').animate({scrollTop: topOffset}, 200); + // If the user click one point in the graphs, jump to the batch row and highlight it. And + // recovery the batch row after 3 seconds if necessary. + // We need to remember the last clicked batch so that we can recovery it. + var lastClickedBatch = null; + var lastTimeout = null; + + return function(d) { + var batchSelector = $("#batch-" + d.x); + // If there is a corresponding batch row, scroll down to it and highlight it. + if (batchSelector.length > 0) { + if (lastTimeout != null) { + window.clearTimeout(lastTimeout); + } + if (lastClickedBatch != null) { + clearBatchRow(lastClickedBatch); + lastClickedBatch = null; + } + lastClickedBatch = d.x; + highlightBatchRow(lastClickedBatch); + lastTimeout = window.setTimeout(function () { + lastTimeout = null; + if (lastClickedBatch != null) { + clearBatchRow(lastClickedBatch); + lastClickedBatch = null; } + }, 3000); // Clean up after 3 seconds + + var topOffset = batchSelector.offset().top - 15; + if (topOffset < 0) { + topOffset = 0; + } + $('html,body').animate({scrollTop: topOffset}, 200); } + } } // Register a timeline graph. All timeline graphs should be register before calling any // "drawTimeline" so that we can determine the max margin left for all timeline graphs. function registerTimeline(minY, maxY) { - var numOfChars = yValueFormat(maxY).length; - // A least width for "maxY" in the graph - var pxForMaxY = numOfChars * 8 + 10; - // Make sure we have enough space to show the ticks in the y axis of timeline - maxMarginLeftForTimeline = pxForMaxY > maxMarginLeftForTimeline? pxForMaxY : maxMarginLeftForTimeline; + var numOfChars = yValueFormat(maxY).length; + // A least width for "maxY" in the graph + var pxForMaxY = numOfChars * 8 + 10; + // Make sure we have enough space to show the ticks in the y axis of timeline + maxMarginLeftForTimeline = pxForMaxY > maxMarginLeftForTimeline? pxForMaxY : maxMarginLeftForTimeline; } // Register a histogram graph. All histogram graphs should be register before calling any // "drawHistogram" so that we can determine the max X value for histograms. function registerHistogram(values, minY, maxY) { - var data = d3.layout.histogram().range([minY, maxY]).bins(histogramBinCount)(values); - // d.x is the y values while d.y is the x values - var maxX = d3.max(data, function(d) { return d.y; }); - maxXForHistogram = maxX > maxXForHistogram ? maxX : maxXForHistogram; + var data = d3.layout.histogram().range([minY, maxY]).bins(histogramBinCount)(values); + // d.x is the y values while d.y is the x values + var maxX = d3.max(data, function(d) { return d.y; }); + maxXForHistogram = maxX > maxXForHistogram ? maxX : maxXForHistogram; } +/* eslint-enable no-unused-vars */ // Draw a line between (x1, y1) and (x2, y2) function drawLine(svg, xFunc, yFunc, x1, y1, x2, y2) { - var line = d3.svg.line() - .x(function(d) { return xFunc(d.x); }) - .y(function(d) { return yFunc(d.y); }); - var data = [{x: x1, y: y1}, {x: x2, y: y2}]; - svg.append("path") - .datum(data) - .style("stroke-dasharray", ("6, 6")) - .style("stroke", "lightblue") - .attr("class", "line") - .attr("d", line); + var line = d3.svg.line() + .x(function(d) { return xFunc(d.x); }) + .y(function(d) { return yFunc(d.y); }); + var data = [{x: x1, y: y1}, {x: x2, y: y2}]; + svg.append("path") + .datum(data) + .style("stroke-dasharray", ("6, 6")) + .style("stroke", "lightblue") + .attr("class", "line") + .attr("d", line); } +/* eslint-disable no-unused-vars */ /** * @param id the `id` used in the html `div` tag * @param data the data for the timeline graph @@ -129,108 +133,105 @@ function drawLine(svg, xFunc, yFunc, x1, y1, x2, y2) { * @param batchInterval if "batchInterval" is specified, we will draw a line for "batchInterval" in the graph */ function drawTimeline(id, data, minX, maxX, minY, maxY, unitY, batchInterval) { - // Hide the right border of "". We cannot use "css" directly, or "sorttable.js" will override them. - d3.select(d3.select(id).node().parentNode) - .style("padding", "8px 0 8px 8px") - .style("border-right", "0px solid white"); - - var margin = {top: 20, right: 27, bottom: 30, left: maxMarginLeftForTimeline}; - var width = 500 - margin.left - margin.right; - var height = 150 - margin.top - margin.bottom; - - var x = d3.scale.linear().domain([minX, maxX]).range([0, width]); - var y = d3.scale.linear().domain([minY, maxY]).range([height, 0]); - - var xAxis = d3.svg.axis().scale(x).orient("bottom").tickFormat(function(d) { - var formattedDate = timeFormat[d]; - var dotIndex = formattedDate.indexOf('.'); - if (dotIndex >= 0) { - // Remove milliseconds - return formattedDate.substring(0, dotIndex); - } else { - return formattedDate; - } - }); - var formatYValue = d3.format(",.2f"); - var yAxis = d3.svg.axis().scale(y).orient("left").ticks(5).tickFormat(formatYValue); - - var line = d3.svg.line() - .x(function(d) { return x(d.x); }) - .y(function(d) { return y(d.y); }); - - var svg = d3.select(id).append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - // Only show the first and last time in the graph - xAxis.tickValues(x.domain()); - - svg.append("g") - .attr("class", "x axis") - .attr("transform", "translate(0," + height + ")") - .call(xAxis); - - svg.append("g") - .attr("class", "y axis") - .call(yAxis) - .append("text") - .attr("transform", "translate(0," + unitLabelYOffset + ")") - .text(unitY); - - - if (batchInterval && batchInterval <= maxY) { - drawLine(svg, x, y, minX, batchInterval, maxX, batchInterval); - } - - svg.append("path") - .datum(data) - .attr("class", "line") - .attr("d", line); - - // If the user click one point in the graphs, jump to the batch row and highlight it. And - // recovery the batch row after 3 seconds if necessary. - // We need to remember the last clicked batch so that we can recovery it. - var lastClickedBatch = null; - var lastTimeout = null; - - function isFailedBatch(batchTime) { - return $("#batch-" + batchTime).attr("isFailed") == "true"; + // Hide the right border of "". We cannot use "css" directly, or "sorttable.js" will override them. + d3.select(d3.select(id).node().parentNode) + .style("padding", "8px 0 8px 8px") + .style("border-right", "0px solid white"); + var margin = {top: 20, right: 27, bottom: 30, left: maxMarginLeftForTimeline}; + var width = 500 - margin.left - margin.right; + var height = 150 - margin.top - margin.bottom; + + var x = d3.scale.linear().domain([minX, maxX]).range([0, width]); + var y = d3.scale.linear().domain([minY, maxY]).range([height, 0]); + + var xAxis = d3.svg.axis().scale(x).orient("bottom").tickFormat(function(d) { + var formattedDate = timeFormat[d]; + var dotIndex = formattedDate.indexOf('.'); + if (dotIndex >= 0) { + // Remove milliseconds + return formattedDate.substring(0, dotIndex); + } else { + return formattedDate; } - - // Add points to the line. However, we make it invisible at first. But when the user moves mouse - // over a point, it will be displayed with its detail. - svg.selectAll(".point") - .data(data) - .enter().append("circle") - .attr("stroke", function(d) { return isFailedBatch(d.x) ? "red" : "white";}) // white and opacity = 0 make it invisible - .attr("fill", function(d) { return isFailedBatch(d.x) ? "red" : "white";}) - .attr("opacity", function(d) { return isFailedBatch(d.x) ? "1" : "0";}) - .style("cursor", "pointer") - .attr("cx", function(d) { return x(d.x); }) - .attr("cy", function(d) { return y(d.y); }) - .attr("r", function(d) { return isFailedBatch(d.x) ? "2" : "3";}) - .on('mouseover', function(d) { - var tip = formatYValue(d.y) + " " + unitY + " at " + timeTipStrings[d.x]; - showBootstrapTooltip(d3.select(this).node(), tip); - // show the point - d3.select(this) - .attr("stroke", function(d) { return isFailedBatch(d.x) ? "red" : "steelblue";}) - .attr("fill", function(d) { return isFailedBatch(d.x) ? "red" : "steelblue";}) - .attr("opacity", "1") - .attr("r", "3"); - }) - .on('mouseout', function() { - hideBootstrapTooltip(d3.select(this).node()); - // hide the point - d3.select(this) - .attr("stroke", function(d) { return isFailedBatch(d.x) ? "red" : "white";}) - .attr("fill", function(d) { return isFailedBatch(d.x) ? "red" : "white";}) - .attr("opacity", function(d) { return isFailedBatch(d.x) ? "1" : "0";}) - .attr("r", function(d) { return isFailedBatch(d.x) ? "2" : "3";}); - }) - .on("click", onClickTimeline); + }); + var formatYValue = d3.format(",.2f"); + var yAxis = d3.svg.axis().scale(y).orient("left").ticks(5).tickFormat(formatYValue); + + var line = d3.svg.line() + .x(function(d) { return x(d.x); }) + .y(function(d) { return y(d.y); }); + + var svg = d3.select(id).append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + // Only show the first and last time in the graph + xAxis.tickValues(x.domain()); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("transform", "translate(0," + unitLabelYOffset + ")") + .text(unitY); + + if (batchInterval && batchInterval <= maxY) { + drawLine(svg, x, y, minX, batchInterval, maxX, batchInterval); + } + + svg.append("path") + .datum(data) + .attr("class", "line") + .attr("d", line); + // If the user click one point in the graphs, jump to the batch row and highlight it. And + // recovery the batch row after 3 seconds if necessary. + // We need to remember the last clicked batch so that we can recovery it. + var lastClickedBatch = null; + var lastTimeout = null; + + function isFailedBatch(batchTime) { + return $("#batch-" + batchTime).attr("isFailed") == "true"; + } + + // Add points to the line. However, we make it invisible at first. But when the user moves mouse + // over a point, it will be displayed with its detail. + svg.selectAll(".point") + .data(data) + .enter().append("circle") + .attr("stroke", function(d) { return isFailedBatch(d.x) ? "red" : "white";}) // white and opacity = 0 make it invisible + .attr("fill", function(d) { return isFailedBatch(d.x) ? "red" : "white";}) + .attr("opacity", function(d) { return isFailedBatch(d.x) ? "1" : "0";}) + .style("cursor", "pointer") + .attr("cx", function(d) { return x(d.x); }) + .attr("cy", function(d) { return y(d.y); }) + .attr("r", function(d) { return isFailedBatch(d.x) ? "2" : "3";}) + .on('mouseover', function(d) { + var tip = formatYValue(d.y) + " " + unitY + " at " + timeTipStrings[d.x]; + showBootstrapTooltip(d3.select(this).node(), tip); + // show the point + d3.select(this) + .attr("stroke", function(d) { return isFailedBatch(d.x) ? "red" : "steelblue";}) + .attr("fill", function(d) { return isFailedBatch(d.x) ? "red" : "steelblue";}) + .attr("opacity", "1") + .attr("r", "3"); + }) + .on('mouseout', function() { + hideBootstrapTooltip(d3.select(this).node()); + // hide the point + d3.select(this) + .attr("stroke", function(d) { return isFailedBatch(d.x) ? "red" : "white";}) + .attr("fill", function(d) { return isFailedBatch(d.x) ? "red" : "white";}) + .attr("opacity", function(d) { return isFailedBatch(d.x) ? "1" : "0";}) + .attr("r", function(d) { return isFailedBatch(d.x) ? "2" : "3";}); + }) + .on("click", onClickTimeline); } /** @@ -242,105 +243,106 @@ function drawTimeline(id, data, minX, maxX, minY, maxY, unitY, batchInterval) { * @param batchInterval if "batchInterval" is specified, we will draw a line for "batchInterval" in the graph */ function drawHistogram(id, values, minY, maxY, unitY, batchInterval) { - // Hide the left border of "". We cannot use "css" directly, or "sorttable.js" will override them. - d3.select(d3.select(id).node().parentNode) - .style("padding", "8px 8px 8px 0") - .style("border-left", "0px solid white"); - - var margin = {top: 20, right: 30, bottom: 30, left: 10}; - var width = 350 - margin.left - margin.right; - var height = 150 - margin.top - margin.bottom; - - var x = d3.scale.linear().domain([0, maxXForHistogram]).range([0, width - 50]); - var y = d3.scale.linear().domain([minY, maxY]).range([height, 0]); - - var xAxis = d3.svg.axis().scale(x).orient("top").ticks(5); - var yAxis = d3.svg.axis().scale(y).orient("left").ticks(0).tickFormat(function(d) { return ""; }); - - var data = d3.layout.histogram().range([minY, maxY]).bins(histogramBinCount)(values); - - var svg = d3.select(id).append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - if (batchInterval && batchInterval <= maxY) { - drawLine(svg, x, y, 0, batchInterval, maxXForHistogram, batchInterval); - } + // Hide the left border of "". We cannot use "css" directly, or "sorttable.js" will override them. + d3.select(d3.select(id).node().parentNode) + .style("padding", "8px 8px 8px 0") + .style("border-left", "0px solid white"); + + var margin = {top: 20, right: 30, bottom: 30, left: 10}; + var width = 350 - margin.left - margin.right; + var height = 150 - margin.top - margin.bottom; + + var x = d3.scale.linear().domain([0, maxXForHistogram]).range([0, width - 50]); + var y = d3.scale.linear().domain([minY, maxY]).range([height, 0]); + + var xAxis = d3.svg.axis().scale(x).orient("top").ticks(5); + var yAxis = d3.svg.axis().scale(y).orient("left").ticks(0).tickFormat(function(d) { return ""; }); + + var data = d3.layout.histogram().range([minY, maxY]).bins(histogramBinCount)(values); + + var svg = d3.select(id).append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + if (batchInterval && batchInterval <= maxY) { + drawLine(svg, x, y, 0, batchInterval, maxXForHistogram, batchInterval); + } + + svg.append("g") + .attr("class", "x axis") + .call(xAxis) + .append("text") + .attr("transform", "translate(" + (margin.left + width - 45) + ", " + unitLabelYOffset + ")") + .text("#batches"); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis); + + svg.selectAll(".bar") + .data(data) + .enter() + .append("g") + .attr("transform", function(d) { return "translate(0," + (y(d.x) - height + y(d.dx)) + ")";}) + .attr("class", "bar").append("rect") + .attr("width", function(d) { return x(d.y); }) + .attr("height", function(d) { return height - y(d.dx); }) + .on('mouseover', function(d) { + var percent = yValueFormat(d.y * 100.0 / values.length) + "%"; + var tip = d.y + " batches (" + percent + ") between " + yValueFormat(d.x) + " and " + yValueFormat(d.x + d.dx) + " " + unitY; + showBootstrapTooltip(d3.select(this).node(), tip); + }) + .on('mouseout', function() { + hideBootstrapTooltip(d3.select(this).node()); + }); - svg.append("g") - .attr("class", "x axis") - .call(xAxis) - .append("text") - .attr("transform", "translate(" + (margin.left + width - 45) + ", " + unitLabelYOffset + ")") - .text("#batches"); - - svg.append("g") - .attr("class", "y axis") - .call(yAxis); - - svg.selectAll(".bar") - .data(data) - .enter() - .append("g") - .attr("transform", function(d) { return "translate(0," + (y(d.x) - height + y(d.dx)) + ")";}) - .attr("class", "bar").append("rect") - .attr("width", function(d) { return x(d.y); }) - .attr("height", function(d) { return height - y(d.dx); }) - .on('mouseover', function(d) { - var percent = yValueFormat(d.y * 100.0 / values.length) + "%"; - var tip = d.y + " batches (" + percent + ") between " + yValueFormat(d.x) + " and " + yValueFormat(d.x + d.dx) + " " + unitY; - showBootstrapTooltip(d3.select(this).node(), tip); - }) - .on('mouseout', function() { - hideBootstrapTooltip(d3.select(this).node()); - }); - - if (batchInterval && batchInterval <= maxY) { - // Add the "stable" text to the graph below the batch interval line. - var stableXOffset = x(maxXForHistogram) - 20; - var stableYOffset = y(batchInterval) + 15; - svg.append("text") - .style("fill", "lightblue") - .attr("class", "stable-text") - .attr("text-anchor", "middle") - .attr("transform", "translate(" + stableXOffset + "," + stableYOffset + ")") - .text("stable") - .on('mouseover', function(d) { - var tip = "Processing Time <= Batch Interval (" + yValueFormat(batchInterval) +" " + unitY +")"; - showBootstrapTooltip(d3.select(this).node(), tip); - }) - .on('mouseout', function() { - hideBootstrapTooltip(d3.select(this).node()); - }); - } + if (batchInterval && batchInterval <= maxY) { + // Add the "stable" text to the graph below the batch interval line. + var stableXOffset = x(maxXForHistogram) - 20; + var stableYOffset = y(batchInterval) + 15; + svg.append("text") + .style("fill", "lightblue") + .attr("class", "stable-text") + .attr("text-anchor", "middle") + .attr("transform", "translate(" + stableXOffset + "," + stableYOffset + ")") + .text("stable") + .on('mouseover', function(d) { + var tip = "Processing Time <= Batch Interval (" + yValueFormat(batchInterval) +" " + unitY +")"; + showBootstrapTooltip(d3.select(this).node(), tip); + }) + .on('mouseout', function() { + hideBootstrapTooltip(d3.select(this).node()); + }); + } } +/* eslint-enable no-unused-vars */ $(function() { - var status = window.localStorage && window.localStorage.getItem("show-streams-detail") == "true"; - - $("span.expand-input-rate").click(function() { - status = !status; - $("#inputs-table").toggle('collapsed'); - // Toggle the class of the arrow between open and closed - $(this).find('.expand-input-rate-arrow').toggleClass('arrow-open').toggleClass('arrow-closed'); - if (window.localStorage) { - window.localStorage.setItem("show-streams-detail", "" + status); - } - }); - - if (status) { - $("#inputs-table").toggle('collapsed'); - // Toggle the class of the arrow between open and closed - $(this).find('.expand-input-rate-arrow').toggleClass('arrow-open').toggleClass('arrow-closed'); + var status = window.localStorage && window.localStorage.getItem("show-streams-detail") == "true"; + + $("span.expand-input-rate").click(function() { + status = !status; + $("#inputs-table").toggle('collapsed'); + // Toggle the class of the arrow between open and closed + $(this).find('.expand-input-rate-arrow').toggleClass('arrow-open').toggleClass('arrow-closed'); + if (window.localStorage) { + window.localStorage.setItem("show-streams-detail", "" + status); } + }); + + if (status) { + $("#inputs-table").toggle('collapsed'); + // Toggle the class of the arrow between open and closed + $(this).find('.expand-input-rate-arrow').toggleClass('arrow-open').toggleClass('arrow-closed'); + } }); function highlightBatchRow(batch) { - $("#batch-" + batch).parent().addClass("batch-table-cell-highlight"); + $("#batch-" + batch).parent().addClass("batch-table-cell-highlight"); } function clearBatchRow(batch) { - $("#batch-" + batch).parent().removeClass("batch-table-cell-highlight"); + $("#batch-" + batch).parent().removeClass("batch-table-cell-highlight"); } diff --git a/core/src/main/resources/org/apache/spark/ui/static/structured-streaming-page.js b/core/src/main/resources/org/apache/spark/ui/static/structured-streaming-page.js index c92226b408b6c..9701f5a57e170 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/structured-streaming-page.js +++ b/core/src/main/resources/org/apache/spark/ui/static/structured-streaming-page.js @@ -15,157 +15,158 @@ * limitations under the License. */ +/* global d3, formattedTimeTipStrings, formattedTimeToValues, hideBootstrapTooltip, maxMarginLeftForTimeline, showBootstrapTooltip, unitLabelYOffset */ // pre-define some colors for legends. var colorPool = ["#F8C471", "#F39C12", "#B9770E", "#73C6B6", "#16A085", "#117A65", "#B2BABB", "#7F8C8D", "#616A6B"]; +/* eslint-disable no-unused-vars */ function drawAreaStack(id, labels, values, minX, maxX, minY, maxY) { - d3.select(d3.select(id).node().parentNode) - .style("padding", "8px 0 8px 8px") - .style("border-right", "0px solid white"); - - // Setup svg using Bostock's margin convention - var margin = {top: 20, right: 40, bottom: 30, left: maxMarginLeftForTimeline}; - var width = 850 - margin.left - margin.right; - var height = 300 - margin.top - margin.bottom; - - var svg = d3.select(id) - .append("svg") - .attr("width", width + margin.left + margin.right) - .attr("height", height + margin.top + margin.bottom) - .append("g") - .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); - - var data = values; - - var parse = d3.time.format("%H:%M:%S.%L").parse; - - // Transpose the data into layers - var dataset = d3.layout.stack()(labels.map(function(fruit) { - return data.map(function(d) { - return {_x: d.x, x: parse(d.x), y: +d[fruit]}; - }); - })); - - - // Set x, y and colors - var x = d3.scale.ordinal() - .domain(dataset[0].map(function(d) { return d.x; })) - .rangeRoundBands([10, width-10], 0.02); - - var y = d3.scale.linear() - .domain([0, d3.max(dataset, function(d) { return d3.max(d, function(d) { return d.y0 + d.y; }); })]) - .range([height, 0]); - - var colors = colorPool.slice(0, labels.length) - - // Define and draw axes - var yAxis = d3.svg.axis() - .scale(y) - .orient("left") - .ticks(7) - .tickFormat( function(d) { return d } ); - - var xAxis = d3.svg.axis() - .scale(x) - .orient("bottom") - .tickFormat(d3.time.format("%H:%M:%S.%L")); - - // Only show the first and last time in the graph - var xline = [] - xline.push(x.domain()[0]) - xline.push(x.domain()[x.domain().length - 1]) - xAxis.tickValues(xline); - - svg.append("g") - .attr("class", "y axis") - .call(yAxis) - .append("text") - .attr("transform", "translate(0," + unitLabelYOffset + ")") - .text("ms"); - - svg.append("g") - .attr("class", "x axis") - .attr("transform", "translate(0," + height + ")") - .call(xAxis); - - // Create groups for each series, rects for each segment - var groups = svg.selectAll("g.cost") - .data(dataset) - .enter().append("g") - .attr("class", "cost") - .style("fill", function(d, i) { return colors[i]; }); - - var rect = groups.selectAll("rect") - .data(function(d) { return d; }) - .enter() - .append("rect") - .attr("x", function(d) { return x(d.x); }) - .attr("y", function(d) { return y(d.y0 + d.y); }) - .attr("height", function(d) { return y(d.y0) - y(d.y0 + d.y); }) - .attr("width", x.rangeBand()) - .on('mouseover', function(d) { - var tip = ''; - var idx = 0; - var _values = formattedTimeToValues[d._x]; - _values.forEach(function (k) { - tip += labels[idx] + ': ' + k + ' '; - idx += 1; - }); - tip += " at " + formattedTimeTipStrings[d._x]; - showBootstrapTooltip(d3.select(this).node(), tip); - }) - .on('mouseout', function() { - hideBootstrapTooltip(d3.select(this).node()); - }) - .on("mousemove", function(d) { - var xPosition = d3.mouse(this)[0] - 15; - var yPosition = d3.mouse(this)[1] - 25; - tooltip.attr("transform", "translate(" + xPosition + "," + yPosition + ")"); - tooltip.select("text").text(d.y); - }); - - - // Draw legend - var legend = svg.selectAll(".legend") - .data(colors) - .enter().append("g") - .attr("class", "legend") - .attr("transform", function(d, i) { return "translate(30," + i * 19 + ")"; }); - - legend.append("rect") - .attr("x", width - 20) - .attr("width", 18) - .attr("height", 18) - .style("fill", function(d, i) {return colors.slice().reverse()[i];}) - .on('mouseover', function(d, i) { - var len = labels.length - showBootstrapTooltip(d3.select(this).node(), labels[len - 1 - i]); - }) - .on('mouseout', function() { - hideBootstrapTooltip(d3.select(this).node()); - }) - .on("mousemove", function(d) { - var xPosition = d3.mouse(this)[0] - 15; - var yPosition = d3.mouse(this)[1] - 25; - tooltip.attr("transform", "translate(" + xPosition + "," + yPosition + ")"); - tooltip.select("text").text(d.y); - }); - - // Prep the tooltip bits, initial display is hidden - var tooltip = svg.append("g") - .attr("class", "tooltip") - .style("display", "none"); - - tooltip.append("rect") - .attr("width", 30) - .attr("height", 20) - .attr("fill", "white") - .style("opacity", 0.5); - - tooltip.append("text") - .attr("x", 15) - .attr("dy", "1.2em") - .style("text-anchor", "middle") - .attr("font-size", "12px") - .attr("font-weight", "bold"); + d3.select(d3.select(id).node().parentNode) + .style("padding", "8px 0 8px 8px") + .style("border-right", "0px solid white"); + + // Setup svg using Bostock's margin convention + var margin = {top: 20, right: 40, bottom: 30, left: maxMarginLeftForTimeline}; + var width = 850 - margin.left - margin.right; + var height = 300 - margin.top - margin.bottom; + + var svg = d3.select(id) + .append("svg") + .attr("width", width + margin.left + margin.right) + .attr("height", height + margin.top + margin.bottom) + .append("g") + .attr("transform", "translate(" + margin.left + "," + margin.top + ")"); + + var data = values; + + var parse = d3.time.format("%H:%M:%S.%L").parse; + + // Transpose the data into layers + var dataset = d3.layout.stack()(labels.map(function(fruit) { + return data.map(function(d) { + return {_x: d.x, x: parse(d.x), y: +d[fruit]}; + }); + })); + + // Set x, y and colors + var x = d3.scale.ordinal() + .domain(dataset[0].map(function(d) { return d.x; })) + .rangeRoundBands([10, width-10], 0.02); + + var y = d3.scale.linear() + .domain([0, d3.max(dataset, function(d) { return d3.max(d, function(d) { return d.y0 + d.y; }); })]) + .range([height, 0]); + + var colors = colorPool.slice(0, labels.length); + + // Define and draw axes + var yAxis = d3.svg.axis() + .scale(y) + .orient("left") + .ticks(7) + .tickFormat( function(d) { return d } ); + + var xAxis = d3.svg.axis() + .scale(x) + .orient("bottom") + .tickFormat(d3.time.format("%H:%M:%S.%L")); + + // Only show the first and last time in the graph + var xline = []; + xline.push(x.domain()[0]); + xline.push(x.domain()[x.domain().length - 1]); + xAxis.tickValues(xline); + + svg.append("g") + .attr("class", "y axis") + .call(yAxis) + .append("text") + .attr("transform", "translate(0," + unitLabelYOffset + ")") + .text("ms"); + + svg.append("g") + .attr("class", "x axis") + .attr("transform", "translate(0," + height + ")") + .call(xAxis); + + // Create groups for each series, rects for each segment + var groups = svg.selectAll("g.cost") + .data(dataset) + .enter().append("g") + .attr("class", "cost") + .style("fill", function(d, i) { return colors[i]; }); + + var rect = groups.selectAll("rect") + .data(function(d) { return d; }) + .enter() + .append("rect") + .attr("x", function(d) { return x(d.x); }) + .attr("y", function(d) { return y(d.y0 + d.y); }) + .attr("height", function(d) { return y(d.y0) - y(d.y0 + d.y); }) + .attr("width", x.rangeBand()) + .on('mouseover', function(d) { + var tip = ''; + var idx = 0; + var _values = formattedTimeToValues[d._x]; + _values.forEach(function (k) { + tip += labels[idx] + ': ' + k + ' '; + idx += 1; + }); + tip += " at " + formattedTimeTipStrings[d._x]; + showBootstrapTooltip(d3.select(this).node(), tip); + }) + .on('mouseout', function() { + hideBootstrapTooltip(d3.select(this).node()); + }) + .on("mousemove", function(d) { + var xPosition = d3.mouse(this)[0] - 15; + var yPosition = d3.mouse(this)[1] - 25; + tooltip.attr("transform", "translate(" + xPosition + "," + yPosition + ")"); + tooltip.select("text").text(d.y); + }); + + // Draw legend + var legend = svg.selectAll(".legend") + .data(colors) + .enter().append("g") + .attr("class", "legend") + .attr("transform", function(d, i) { return "translate(30," + i * 19 + ")"; }); + + legend.append("rect") + .attr("x", width - 20) + .attr("width", 18) + .attr("height", 18) + .style("fill", function(d, i) {return colors.slice().reverse()[i];}) + .on('mouseover', function(d, i) { + var len = labels.length; + showBootstrapTooltip(d3.select(this).node(), labels[len - 1 - i]); + }) + .on('mouseout', function() { + hideBootstrapTooltip(d3.select(this).node()); + }) + .on("mousemove", function(d) { + var xPosition = d3.mouse(this)[0] - 15; + var yPosition = d3.mouse(this)[1] - 25; + tooltip.attr("transform", "translate(" + xPosition + "," + yPosition + ")"); + tooltip.select("text").text(d.y); + }); + + // Prep the tooltip bits, initial display is hidden + var tooltip = svg.append("g") + .attr("class", "tooltip") + .style("display", "none"); + + tooltip.append("rect") + .attr("width", 30) + .attr("height", 20) + .attr("fill", "white") + .style("opacity", 0.5); + + tooltip.append("text") + .attr("x", 15) + .attr("dy", "1.2em") + .style("text-anchor", "middle") + .attr("font-size", "12px") + .attr("font-weight", "bold"); } +/* eslint-enable no-unused-vars */ \ No newline at end of file diff --git a/core/src/main/resources/org/apache/spark/ui/static/table.js b/core/src/main/resources/org/apache/spark/ui/static/table.js index 32b7a6522d050..0203748cf7dbc 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/table.js +++ b/core/src/main/resources/org/apache/spark/ui/static/table.js @@ -15,6 +15,8 @@ * limitations under the License. */ +/* global $ */ +/* eslint-disable no-unused-vars */ /* Adds background colors to stripe table rows in the summary table (on the stage page). This is * necessary (instead of using css or the table striping provided by bootstrap) because the summary * table has hidden rows. @@ -22,84 +24,88 @@ * An ID selector (rather than a class selector) is used to ensure this runs quickly even on pages * with thousands of task rows (ID selectors are much faster than class selectors). */ function stripeSummaryTable() { - $("#task-summary-table").find("tr:not(:hidden)").each(function (index) { - if (index % 2 == 1) { - $(this).css("background-color", "#f9f9f9"); - } else { - $(this).css("background-color", "#ffffff"); - } - }); + $("#task-summary-table").find("tr:not(:hidden)").each(function (index) { + if (index % 2 == 1) { + $(this).css("background-color", "#f9f9f9"); + } else { + $(this).css("background-color", "#ffffff"); + } + }); } +/* eslint-enable no-unused-vars */ function toggleThreadStackTrace(threadId, forceAdd) { - var stackTrace = $("#" + threadId + "_stacktrace") - if (stackTrace.length == 0) { - var stackTraceText = $('#' + threadId + "_td_stacktrace").html() - var threadCell = $("#thread_" + threadId + "_tr") - threadCell.after("
" +
-            stackTraceText +  "
") - } else { - if (!forceAdd) { - stackTrace.remove() - } + var stackTrace = $("#" + threadId + "_stacktrace"); + if (stackTrace.length == 0) { + var stackTraceText = $('#' + threadId + "_td_stacktrace").html(); + var threadCell = $("#thread_" + threadId + "_tr"); + threadCell.after("
" +
+      stackTraceText +  "
") + } else { + if (!forceAdd) { + stackTrace.remove() } + } } +/* eslint-disable no-unused-vars */ function expandAllThreadStackTrace(toggleButton) { - $('.accordion-heading').each(function() { - //get thread ID - if (!$(this).hasClass("d-none")) { - var trId = $(this).attr('id').match(/thread_([0-9]+)_tr/m)[1] - toggleThreadStackTrace(trId, true) - } - }) - if (toggleButton) { - $('.expandbutton').toggleClass('d-none') + $('.accordion-heading').each(function() { + //get thread ID + if (!$(this).hasClass("d-none")) { + var trId = $(this).attr('id').match(/thread_([0-9]+)_tr/m)[1]; + toggleThreadStackTrace(trId, true) } + }); + if (toggleButton) { + $('.expandbutton').toggleClass('d-none') + } } +/* eslint-enable no-unused-vars */ function collapseAllThreadStackTrace(toggleButton) { - $('.accordion-body').each(function() { - $(this).remove() - }) - if (toggleButton) { - $('.expandbutton').toggleClass('d-none'); - } + $('.accordion-body').each(function() { + $(this).remove() + }); + if (toggleButton) { + $('.expandbutton').toggleClass('d-none'); + } } - +/* eslint-disable no-unused-vars */ // inOrOut - true: over, false: out function onMouseOverAndOut(threadId) { - $("#" + threadId + "_td_id").toggleClass("threaddump-td-mouseover"); - $("#" + threadId + "_td_name").toggleClass("threaddump-td-mouseover"); - $("#" + threadId + "_td_state").toggleClass("threaddump-td-mouseover"); - $("#" + threadId + "_td_locking").toggleClass("threaddump-td-mouseover"); + $("#" + threadId + "_td_id").toggleClass("threaddump-td-mouseover"); + $("#" + threadId + "_td_name").toggleClass("threaddump-td-mouseover"); + $("#" + threadId + "_td_state").toggleClass("threaddump-td-mouseover"); + $("#" + threadId + "_td_locking").toggleClass("threaddump-td-mouseover"); } function onSearchStringChange() { - var searchString = $('#search').val().toLowerCase(); - //remove the stacktrace - collapseAllThreadStackTrace(false) - if (searchString.length == 0) { - $('tr').each(function() { - $(this).removeClass('d-none') - }) - } else { - $('tr').each(function(){ - if($(this).attr('id') && $(this).attr('id').match(/thread_[0-9]+_tr/) ) { - var children = $(this).children() - var found = false - for (var i = 0; i < children.length; i++) { - if (children.eq(i).text().toLowerCase().indexOf(searchString) >= 0) { - found = true - } - } - if (found) { - $(this).removeClass('d-none') - } else { - $(this).addClass('d-none') - } - } - }); - } + var searchString = $('#search').val().toLowerCase(); + //remove the stacktrace + collapseAllThreadStackTrace(false); + if (searchString.length == 0) { + $('tr').each(function() { + $(this).removeClass('d-none') + }) + } else { + $('tr').each(function(){ + if($(this).attr('id') && $(this).attr('id').match(/thread_[0-9]+_tr/) ) { + var children = $(this).children(); + var found = false; + for (var i = 0; i < children.length; i++) { + if (children.eq(i).text().toLowerCase().indexOf(searchString) >= 0) { + found = true; + } + } + if (found) { + $(this).removeClass('d-none') + } else { + $(this).addClass('d-none') + } + } + }); + } } +/* eslint-enable no-unused-vars */ diff --git a/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js b/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js index 5be8cffd1f8db..274848d5e62b5 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js +++ b/core/src/main/resources/org/apache/spark/ui/static/timeline-view.js @@ -15,6 +15,8 @@ * limitations under the License. */ +/* global $, vis, uiRoot, appBasePath */ +/* eslint-disable no-unused-vars */ function drawApplicationTimeline(groupArray, eventObjArray, startTime, offset) { var groups = new vis.DataSet(groupArray); var items = new vis.DataSet(eventObjArray); @@ -42,26 +44,31 @@ function drawApplicationTimeline(groupArray, eventObjArray, startTime, offset) { setupZoomable("#application-timeline-zoom-lock", applicationTimeline); setupExecutorEventAction(); + function getIdForJobEntry(baseElem) { + var jobIdText = $($(baseElem).find(".application-timeline-content")[0]).text(); + var jobId = jobIdText.match("\\(Job (\\d+)\\)$")[1]; + return jobId; + } + + function getSelectorForJobEntry(jobId) { + return "#job-" + jobId; + } + function setupJobEventAction() { $(".vis-item.vis-range.job.application-timeline-object").each(function() { - var getSelectorForJobEntry = function(baseElem) { - var jobIdText = $($(baseElem).find(".application-timeline-content")[0]).text(); - var jobId = jobIdText.match("\\(Job (\\d+)\\)$")[1]; - return "#job-" + jobId; - }; - $(this).click(function() { - var jobPagePath = $(getSelectorForJobEntry(this)).find("a.name-link").attr("href"); - window.location.href = jobPagePath + var jobId = getIdForJobEntry(this); + var jobPagePath = uiRoot + appBasePath + "/jobs/job/?id=" + jobId; + window.location.href = jobPagePath; }); $(this).hover( function() { - $(getSelectorForJobEntry(this)).addClass("corresponding-item-hover"); + $(getSelectorForJobEntry(getIdForJobEntry(this))).addClass("corresponding-item-hover"); $($(this).find("div.application-timeline-content")[0]).tooltip("show"); }, function() { - $(getSelectorForJobEntry(this)).removeClass("corresponding-item-hover"); + $(getSelectorForJobEntry(getIdForJobEntry(this))).removeClass("corresponding-item-hover"); $($(this).find("div.application-timeline-content")[0]).tooltip("hide"); } ); @@ -125,26 +132,34 @@ function drawJobTimeline(groupArray, eventObjArray, startTime, offset) { setupZoomable("#job-timeline-zoom-lock", jobTimeline); setupExecutorEventAction(); + function getStageIdAndAttemptForStageEntry(baseElem) { + var stageIdText = $($(baseElem).find(".job-timeline-content")[0]).text(); + var stageIdAndAttempt = stageIdText.match("\\(Stage (\\d+\\.\\d+)\\)$")[1].split("."); + return stageIdAndAttempt; + } + + function getSelectorForStageEntry(stageIdAndAttempt) { + return "#stage-" + stageIdAndAttempt[0] + "-" + stageIdAndAttempt[1]; + } + function setupStageEventAction() { $(".vis-item.vis-range.stage.job-timeline-object").each(function() { - var getSelectorForStageEntry = function(baseElem) { - var stageIdText = $($(baseElem).find(".job-timeline-content")[0]).text(); - var stageIdAndAttempt = stageIdText.match("\\(Stage (\\d+\\.\\d+)\\)$")[1].split("."); - return "#stage-" + stageIdAndAttempt[0] + "-" + stageIdAndAttempt[1]; - }; - $(this).click(function() { - var stagePagePath = $(getSelectorForStageEntry(this)).find("a.name-link").attr("href") - window.location.href = stagePagePath + var stageIdAndAttempt = getStageIdAndAttemptForStageEntry(this); + var stagePagePath = uiRoot + appBasePath + + "/stages/stage/?id=" + stageIdAndAttempt[0] + "&attempt=" + stageIdAndAttempt[1]; + window.location.href = stagePagePath; }); $(this).hover( function() { - $(getSelectorForStageEntry(this)).addClass("corresponding-item-hover"); + $(getSelectorForStageEntry(getStageIdAndAttemptForStageEntry(this))) + .addClass("corresponding-item-hover"); $($(this).find("div.job-timeline-content")[0]).tooltip("show"); }, function() { - $(getSelectorForStageEntry(this)).removeClass("corresponding-item-hover"); + $(getSelectorForStageEntry(getStageIdAndAttemptForStageEntry(this))) + .removeClass("corresponding-item-hover"); $($(this).find("div.job-timeline-content")[0]).tooltip("hide"); } ); @@ -236,7 +251,7 @@ function drawTaskAssignmentTimeline(groupArray, eventObjArray, minLaunchTime, ma var visibilityState = status ? "" : "none"; $("#task-assignment-timeline").css("display", visibilityState); - // Switch the class of the arrow from open to closed. + // Switch the class of the arrow from open to closed. $(this).find(".expand-task-assignment-timeline-arrow").toggleClass("arrow-open"); $(this).find(".expand-task-assignment-timeline-arrow").toggleClass("arrow-closed"); @@ -267,6 +282,7 @@ function setupExecutorEventAction() { ); }); } +/* eslint-enable no-unused-vars */ function setupZoomable(id, timeline) { $(id + ' > input[type="checkbox"]').click(function() { diff --git a/core/src/main/resources/org/apache/spark/ui/static/utils.js b/core/src/main/resources/org/apache/spark/ui/static/utils.js index 6fc34a9e1f7ea..a2d4f5568cb26 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/utils.js +++ b/core/src/main/resources/org/apache/spark/ui/static/utils.js @@ -15,62 +15,72 @@ * limitations under the License. */ +/* global $, uiRoot */ +/* eslint-disable no-unused-vars */ // this function works exactly the same as UIUtils.formatDuration function formatDuration(milliseconds) { - if (milliseconds < 100) { - return parseInt(milliseconds).toFixed(1) + " ms"; - } - var seconds = milliseconds * 1.0 / 1000; - if (seconds < 1) { - return seconds.toFixed(1) + " s"; - } - if (seconds < 60) { - return seconds.toFixed(0) + " s"; - } - var minutes = seconds / 60; - if (minutes < 10) { - return minutes.toFixed(1) + " min"; - } else if (minutes < 60) { - return minutes.toFixed(0) + " min"; - } - var hours = minutes / 60; - return hours.toFixed(1) + " h"; + if (milliseconds < 100) { + return parseInt(milliseconds).toFixed(1) + " ms"; + } + var seconds = milliseconds * 1.0 / 1000; + if (seconds < 1) { + return seconds.toFixed(1) + " s"; + } + if (seconds < 60) { + return seconds.toFixed(0) + " s"; + } + var minutes = seconds / 60; + if (minutes < 10) { + return minutes.toFixed(1) + " min"; + } else if (minutes < 60) { + return minutes.toFixed(0) + " min"; + } + var hours = minutes / 60; + return hours.toFixed(1) + " h"; } function formatBytes(bytes, type) { - if (type !== 'display') return bytes; - if (bytes == 0) return '0.0 B'; - var k = 1024; - var dm = 1; - var sizes = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']; - var i = Math.floor(Math.log(bytes) / Math.log(k)); - return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; + if (type !== 'display') return bytes; + if (bytes <= 0) return '0.0 B'; + var k = 1024; + var dm = 1; + var sizes = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']; + var i = Math.floor(Math.log(bytes) / Math.log(k)); + return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i]; } +/* eslint-enable no-unused-vars */ function padZeroes(num) { return ("0" + num).slice(-2); } +/* eslint-disable no-unused-vars */ function formatTimeMillis(timeMillis) { if (timeMillis <= 0) { return "-"; } else { var dt = new Date(timeMillis); - return dt.getFullYear() + "-" + - padZeroes(dt.getMonth() + 1) + "-" + - padZeroes(dt.getDate()) + " " + - padZeroes(dt.getHours()) + ":" + - padZeroes(dt.getMinutes()) + ":" + - padZeroes(dt.getSeconds()); + return formatDateString(dt); } } +/* eslint-enable no-unused-vars */ + +function formatDateString(dt) { + return dt.getFullYear() + "-" + + padZeroes(dt.getMonth() + 1) + "-" + + padZeroes(dt.getDate()) + " " + + padZeroes(dt.getHours()) + ":" + + padZeroes(dt.getMinutes()) + ":" + + padZeroes(dt.getSeconds()); +} +/* eslint-disable no-unused-vars */ function getTimeZone() { try { return Intl.DateTimeFormat().resolvedOptions().timeZone; } catch(ex) { // Get time zone from a string representing the date, - // eg. "Thu Nov 16 2017 01:13:32 GMT+0800 (CST)" -> "CST" + // e.g. "Thu Nov 16 2017 01:13:32 GMT+0800 (CST)" -> "CST" return new Date().toString().match(/\((.*)\)/)[1]; } } @@ -88,20 +98,21 @@ function formatLogsCells(execLogs, type) { function getStandAloneAppId(cb) { var words = document.baseURI.split('/'); var ind = words.indexOf("proxy"); + var appId; if (ind > 0) { - var appId = words[ind + 1]; + appId = words[ind + 1]; cb(appId); return; } ind = words.indexOf("history"); if (ind > 0) { - var appId = words[ind + 1]; + appId = words[ind + 1]; cb(appId); return; } // Looks like Web UI is running in standalone mode // Let's get application-id using REST End Point - $.getJSON(location.origin + "/api/v1/applications", function(response, status, jqXHR) { + $.getJSON(uiRoot + "/api/v1/applications", function(response, status, jqXHR) { if (response && response.length > 0) { var appId = response[0].id; cb(appId); @@ -115,7 +126,7 @@ function getStandAloneAppId(cb) { // It will convert the string into integer for correct ordering function ConvertDurationString(data) { data = data.toString(); - var units = data.replace(/[\d\.]/g, '' ) + var units = data.replace(/[\d.]/g, '' ) .replace(' ', '') .toLowerCase(); var multiplier = 1; @@ -139,21 +150,25 @@ function ConvertDurationString(data) { function createTemplateURI(appId, templateName) { var words = document.baseURI.split('/'); var ind = words.indexOf("proxy"); + var baseURI; if (ind > 0) { - var baseURI = words.slice(0, ind + 1).join('/') + '/' + appId + '/static/' + templateName + '-template.html'; + baseURI = words.slice(0, ind + 1).join('/') + '/' + appId + '/static/' + templateName + '-template.html'; return baseURI; } ind = words.indexOf("history"); if(ind > 0) { - var baseURI = words.slice(0, ind).join('/') + '/static/' + templateName + '-template.html'; + baseURI = words.slice(0, ind).join('/') + '/static/' + templateName + '-template.html'; return baseURI; } - return location.origin + "/static/" + templateName + "-template.html"; + return uiRoot + "/static/" + templateName + "-template.html"; } function setDataTableDefaults() { $.extend($.fn.dataTable.defaults, { stateSave: true, + stateSaveParams: function(_, data) { + data.search.search = ""; + }, lengthMenu: [[20, 40, 60, 100, -1], [20, 40, 60, 100, "All"]], pageLength: 20 }); @@ -161,27 +176,55 @@ function setDataTableDefaults() { function formatDate(date) { if (date <= 0) return "-"; - else return date.split(".")[0].replace("T", " "); + else { + var dt = new Date(date.replace("GMT", "Z")); + return formatDateString(dt); + } } function createRESTEndPointForExecutorsPage(appId) { - var words = document.baseURI.split('/'); - var ind = words.indexOf("proxy"); - if (ind > 0) { - var appId = words[ind + 1]; - var newBaseURI = words.slice(0, ind + 2).join('/'); - return newBaseURI + "/api/v1/applications/" + appId + "/allexecutors"; + var words = document.baseURI.split('/'); + var ind = words.indexOf("proxy"); + var newBaseURI; + if (ind > 0) { + appId = words[ind + 1]; + newBaseURI = words.slice(0, ind + 2).join('/'); + return newBaseURI + "/api/v1/applications/" + appId + "/allexecutors"; + } + ind = words.indexOf("history"); + if (ind > 0) { + appId = words[ind + 1]; + var attemptId = words[ind + 2]; + newBaseURI = words.slice(0, ind).join('/'); + if (isNaN(attemptId)) { + return newBaseURI + "/api/v1/applications/" + appId + "/allexecutors"; + } else { + return newBaseURI + "/api/v1/applications/" + appId + "/" + attemptId + "/allexecutors"; } - ind = words.indexOf("history"); - if (ind > 0) { - var appId = words[ind + 1]; - var attemptId = words[ind + 2]; - var newBaseURI = words.slice(0, ind).join('/'); - if (isNaN(attemptId)) { - return newBaseURI + "/api/v1/applications/" + appId + "/allexecutors"; - } else { - return newBaseURI + "/api/v1/applications/" + appId + "/" + attemptId + "/allexecutors"; - } + } + return uiRoot + "/api/v1/applications/" + appId + "/allexecutors"; +} + +function createRESTEndPointForMiscellaneousProcess(appId) { + var words = document.baseURI.split('/'); + var ind = words.indexOf("proxy"); + var newBaseURI; + if (ind > 0) { + appId = words[ind + 1]; + newBaseURI = words.slice(0, ind + 2).join('/'); + return newBaseURI + "/api/v1/applications/" + appId + "/allmiscellaneousprocess"; + } + ind = words.indexOf("history"); + if (ind > 0) { + appId = words[ind + 1]; + var attemptId = words[ind + 2]; + newBaseURI = words.slice(0, ind).join('/'); + if (isNaN(attemptId)) { + return newBaseURI + "/api/v1/applications/" + appId + "/allmiscellaneousprocess"; + } else { + return newBaseURI + "/api/v1/applications/" + appId + "/" + attemptId + "/allmiscellaneousprocess"; } - return location.origin + "/api/v1/applications/" + appId + "/allexecutors"; + } + return uiRoot + "/api/v1/applications/" + appId + "/allmiscellaneousprocess"; } +/* eslint-enable no-unused-vars */ \ No newline at end of file diff --git a/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css index d22a9ac801891..eeacbd802d305 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css +++ b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css @@ -1,2 +1 @@ -.vis [class*=span]{min-height:0;width:auto}.vis .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}div.vis-configuration{position:relative;display:block;float:left;font-size:12px}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper:after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{display:block;width:495px;background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;margin-top:20px;left:10px;padding-left:5px}div.vis-configuration.vis-config-button{display:block;width:495px;height:25px;vertical-align:middle;line-height:25px;background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;margin-top:20px;left:10px;padding-left:5px;cursor:pointer;margin-bottom:30px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;width:495px;height:25px;vertical-align:middle;line-height:25px}div.vis-configuration.vis-config-item.vis-config-s2{left:10px;background-color:#f7f8fa;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s3{left:20px;background-color:#e4e9f0;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s4{left:30px;background-color:#cfd8e6;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{width:120px;height:25px;line-height:25px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{top:1px;width:30px;height:19px;border:1px solid #444;border-radius:2px;padding:0;margin:0;cursor:pointer}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{position:relative;top:-5px;width:60px;padding:1px;margin:0;pointer-events:none}input.vis-configuration.vis-config-range{-webkit-appearance:none;border:0 solid #fff;background-color:transparent;width:300px;height:20px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{width:300px;height:5px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#dedede",endColorstr="#c8c8c8",GradientType=0);border:1px solid #999;box-shadow:0 0 3px 0 #aaa;border-radius:3px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;border:1px solid #14334b;height:17px;width:17px;border-radius:50%;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2,#385380);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(180deg,#3876c2 0,#385380);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#3876c2",endColorstr="#385380",GradientType=0);box-shadow:0 0 1px 0 #111927;margin-top:-7px}input.vis-configuration.vis-config-range:focus{outline:none}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(180deg,#9d9d9d 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#9d9d9d",endColorstr="#c8c8c8",GradientType=0)}input.vis-configuration.vis-config-range::-moz-range-track{width:300px;height:10px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(180deg,#dedede 0,#c8c8c8 99%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr="#dedede",endColorstr="#c8c8c8",GradientType=0);border:1px solid #999;box-shadow:0 0 3px 0 #aaa;border-radius:3px}input.vis-configuration.vis-config-range::-moz-range-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:-moz-focusring{outline:1px solid #fff;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{width:300px;height:5px;background:transparent;border-color:transparent;border-width:6px 0;color:transparent}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{position:absolute;background:rgba(57,76,89,.85);border:2px solid #f2faff;line-height:30px;height:30px;width:150px;text-align:center;color:#fff;font-size:14px;border-radius:4px;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.vis-configuration-popup:after,.vis-configuration-popup:before{left:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.vis-configuration-popup:after{border-color:rgba(136,183,213,0) rgba(136,183,213,0) rgba(136,183,213,0) rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0) rgba(194,225,245,0) rgba(194,225,245,0) #f2faff;border-width:12px;margin-top:-12px}div.vis-tooltip{position:absolute;visibility:hidden;padding:5px;white-space:nowrap;font-family:verdana;font-size:14px;color:#000;background-color:#f5f4ed;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #808074;box-shadow:3px 3px 10px rgba(0,0,0,.2);pointer-events:none;z-index:5}.vis-panel{position:absolute;padding:0;margin:0;box-sizing:border-box}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right,.vis-panel.vis-top{border:1px #bfbfbf}.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right{border-top-style:solid;border-bottom-style:solid;overflow:hidden}.vis-left.vis-panel.vis-vertical-scroll,.vis-right.vis-panel.vis-vertical-scroll{height:100%;overflow-x:hidden;overflow-y:scroll}.vis-left.vis-panel.vis-vertical-scroll{direction:rtl}.vis-left.vis-panel.vis-vertical-scroll .vis-content,.vis-right.vis-panel.vis-vertical-scroll{direction:ltr}.vis-right.vis-panel.vis-vertical-scroll .vis-content{direction:rtl}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-top{border-left-style:solid;border-right-style:solid}.vis-background{overflow:hidden}.vis-panel>.vis-content{position:relative}.vis-panel .vis-shadow{position:absolute;width:100%;height:1px;box-shadow:0 0 10px rgba(0,0,0,.8)}.vis-panel .vis-shadow.vis-top{top:-1px;left:0}.vis-panel .vis-shadow.vis-bottom{bottom:-1px;left:0}.vis-current-time{background-color:#ff7f6e;width:2px;z-index:1;pointer-events:none}.vis-rolling-mode-btn{height:40px;width:40px;position:absolute;top:7px;right:20px;border-radius:50%;font-size:28px;cursor:pointer;opacity:.8;color:#fff;font-weight:700;text-align:center;background:#3876c2}.vis-rolling-mode-btn:before{content:"\26F6"}.vis-rolling-mode-btn:hover{opacity:1}.vis-custom-time{background-color:#6e94ff;width:2px;cursor:move;z-index:1}.vis-custom-time>.vis-custom-time-marker{background-color:inherit;color:#fff;font-size:12px;white-space:nowrap;padding:3px 5px;top:0;cursor:auto;z-index:inherit}.vis-timeline{position:relative;border:1px solid #bfbfbf;overflow:hidden;padding:0;margin:0;box-sizing:border-box}.vis-loading-screen{width:100%;height:100%;position:absolute;top:0;left:0}.vis-graph-group0{fill:#4f81bd;fill-opacity:0;stroke-width:2px;stroke:#4f81bd}.vis-graph-group1{fill:#f79646;fill-opacity:0;stroke-width:2px;stroke:#f79646}.vis-graph-group2{fill:#8c51cf;fill-opacity:0;stroke-width:2px;stroke:#8c51cf}.vis-graph-group3{fill:#75c841;fill-opacity:0;stroke-width:2px;stroke:#75c841}.vis-graph-group4{fill:#ff0100;fill-opacity:0;stroke-width:2px;stroke:#ff0100}.vis-graph-group5{fill:#37d8e6;fill-opacity:0;stroke-width:2px;stroke:#37d8e6}.vis-graph-group6{fill:#042662;fill-opacity:0;stroke-width:2px;stroke:#042662}.vis-graph-group7{fill:#00ff26;fill-opacity:0;stroke-width:2px;stroke:#00ff26}.vis-graph-group8{fill:#f0f;fill-opacity:0;stroke-width:2px;stroke:#f0f}.vis-graph-group9{fill:#8f3938;fill-opacity:0;stroke-width:2px;stroke:#8f3938}.vis-timeline .vis-fill{fill-opacity:.1;stroke:none}.vis-timeline .vis-bar{fill-opacity:.5;stroke-width:1px}.vis-timeline .vis-point{stroke-width:2px;fill-opacity:1}.vis-timeline .vis-legend-background{stroke-width:1px;fill-opacity:.9;fill:#fff;stroke:#c2c2c2}.vis-timeline .vis-outline{stroke-width:1px;fill-opacity:1;fill:#fff;stroke:#e5e5e5}.vis-timeline .vis-icon-fill{fill-opacity:.3;stroke:none}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-horizontal{position:absolute;width:100%;height:0;border-bottom:1px solid}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-minor{border-color:#e5e5e5}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-major{border-color:#bfbfbf}.vis-data-axis .vis-y-axis.vis-major{width:100%;position:absolute;color:#4d4d4d;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-major.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-minor{position:absolute;width:100%;color:#bebebe;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-minor.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title{position:absolute;color:#4d4d4d;white-space:nowrap;bottom:20px;text-align:center}.vis-data-axis .vis-y-axis.vis-title.vis-measure{padding:0;margin:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title.vis-left{bottom:0;-webkit-transform-origin:left top;-moz-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;transform-origin:left bottom;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.vis-data-axis .vis-y-axis.vis-title.vis-right{bottom:0;-webkit-transform-origin:right bottom;-moz-transform-origin:right bottom;-ms-transform-origin:right bottom;-o-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.vis-legend{background-color:rgba(247,252,255,.65);padding:5px;border:1px solid #b3b3b3;box-shadow:2px 2px 10px hsla(0,0%,60.4%,.55)}.vis-legend-text{white-space:nowrap;display:inline-block}.vis-itemset{position:relative;padding:0;margin:0;box-sizing:border-box}.vis-itemset .vis-background,.vis-itemset .vis-foreground{position:absolute;width:100%;height:100%;overflow:visible}.vis-axis{position:absolute;width:100%;height:0;left:0;z-index:1}.vis-foreground .vis-group{position:relative;box-sizing:border-box;border-bottom:1px solid #bfbfbf}.vis-foreground .vis-group:last-child{border-bottom:none}.vis-nesting-group{cursor:pointer}.vis-label.vis-nested-group.vis-group-level-unknown-but-gte1{background:#f5f5f5}.vis-label.vis-nested-group.vis-group-level-0{background-color:#fff}.vis-ltr .vis-label.vis-nested-group.vis-group-level-0 .vis-inner{padding-left:0}.vis-rtl .vis-label.vis-nested-group.vis-group-level-0 .vis-inner{padding-right:0}.vis-label.vis-nested-group.vis-group-level-1{background-color:rgba(0,0,0,.05)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-1 .vis-inner{padding-left:15px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-1 .vis-inner{padding-right:15px}.vis-label.vis-nested-group.vis-group-level-2{background-color:rgba(0,0,0,.1)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-2 .vis-inner{padding-left:30px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-2 .vis-inner{padding-right:30px}.vis-label.vis-nested-group.vis-group-level-3{background-color:rgba(0,0,0,.15)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-3 .vis-inner{padding-left:45px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-3 .vis-inner{padding-right:45px}.vis-label.vis-nested-group.vis-group-level-4{background-color:rgba(0,0,0,.2)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-4 .vis-inner{padding-left:60px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-4 .vis-inner{padding-right:60px}.vis-label.vis-nested-group.vis-group-level-5{background-color:rgba(0,0,0,.25)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-5 .vis-inner{padding-left:75px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-5 .vis-inner{padding-right:75px}.vis-label.vis-nested-group.vis-group-level-6{background-color:rgba(0,0,0,.3)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-6 .vis-inner{padding-left:90px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-6 .vis-inner{padding-right:90px}.vis-label.vis-nested-group.vis-group-level-7{background-color:rgba(0,0,0,.35)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-7 .vis-inner{padding-left:105px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-7 .vis-inner{padding-right:105px}.vis-label.vis-nested-group.vis-group-level-8{background-color:rgba(0,0,0,.4)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-8 .vis-inner{padding-left:120px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-8 .vis-inner{padding-right:120px}.vis-label.vis-nested-group.vis-group-level-9{background-color:rgba(0,0,0,.45)}.vis-ltr .vis-label.vis-nested-group.vis-group-level-9 .vis-inner{padding-left:135px}.vis-rtl .vis-label.vis-nested-group.vis-group-level-9 .vis-inner{padding-right:135px}.vis-label.vis-nested-group{background-color:rgba(0,0,0,.5)}.vis-ltr .vis-label.vis-nested-group .vis-inner{padding-left:150px}.vis-rtl .vis-label.vis-nested-group .vis-inner{padding-right:150px}.vis-group-level-unknown-but-gte1{border:1px solid red}.vis-label.vis-nesting-group:before{display:inline-block;width:15px}.vis-label.vis-nesting-group.expanded:before{content:"\25BC"}.vis-label.vis-nesting-group.collapsed:before{content:"\25B6"}.vis-rtl .vis-label.vis-nesting-group.collapsed:before{content:"\25C0"}.vis-ltr .vis-label:not(.vis-nesting-group):not(.vis-group-level-0){padding-left:15px}.vis-rtl .vis-label:not(.vis-nesting-group):not(.vis-group-level-0){padding-right:15px}.vis-overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-labelset{overflow:hidden}.vis-labelset,.vis-labelset .vis-label{position:relative;box-sizing:border-box}.vis-labelset .vis-label{left:0;top:0;width:100%;color:#4d4d4d;border-bottom:1px solid #bfbfbf}.vis-labelset .vis-label.draggable{cursor:pointer}.vis-group-is-dragging{background:rgba(0,0,0,.1)}.vis-labelset .vis-label:last-child{border-bottom:none}.vis-labelset .vis-label .vis-inner{display:inline-block;padding:5px}.vis-labelset .vis-label .vis-inner.vis-hidden{padding:0}.vis-time-axis{position:relative;overflow:hidden}.vis-time-axis.vis-foreground{top:0;left:0;width:100%}.vis-time-axis.vis-background{position:absolute;top:0;left:0;width:100%;height:100%}.vis-time-axis .vis-text{position:absolute;color:#4d4d4d;padding:3px;overflow:hidden;box-sizing:border-box;white-space:nowrap}.vis-time-axis .vis-text.vis-measure{position:absolute;padding-left:0;padding-right:0;margin-left:0;margin-right:0;visibility:hidden}.vis-time-axis .vis-grid.vis-vertical{position:absolute;border-left:1px solid}.vis-time-axis .vis-grid.vis-vertical-rtl{position:absolute;border-right:1px solid}.vis-time-axis .vis-grid.vis-minor{border-color:#e5e5e5}.vis-time-axis .vis-grid.vis-major{border-color:#bfbfbf}.vis-item{position:absolute;color:#1a1a1a;border-color:#97b0f8;border-width:1px;background-color:#d5ddf6;display:inline-block;z-index:1}.vis-item.vis-selected{border-color:#ffc200;background-color:#fff785;z-index:2}.vis-editable.vis-selected{cursor:move}.vis-item.vis-point.vis-selected{background-color:#fff785}.vis-item.vis-box{text-align:center;border-style:solid;border-radius:2px}.vis-item.vis-point{background:none}.vis-item.vis-dot{position:absolute;padding:0;border-width:4px;border-style:solid;border-radius:4px}.vis-item.vis-range{border-style:solid;border-radius:2px;box-sizing:border-box}.vis-item.vis-background{border:none;background-color:rgba(213,221,246,.4);box-sizing:border-box;padding:0;margin:0}.vis-item .vis-item-overflow{position:relative;width:100%;height:100%;padding:0;margin:0;overflow:hidden}.vis-item-visible-frame{white-space:nowrap}.vis-item.vis-range .vis-item-content{position:relative;display:inline-block}.vis-item.vis-background .vis-item-content{position:absolute;display:inline-block}.vis-item.vis-line{padding:0;position:absolute;width:0;border-left-width:1px;border-left-style:solid}.vis-item .vis-item-content{white-space:nowrap;box-sizing:border-box;padding:5px}.vis-item .vis-onUpdateTime-tooltip{position:absolute;background:#4f81bd;color:#fff;width:200px;text-align:center;white-space:nowrap;padding:5px;border-radius:1px;transition:.4s;-o-transition:.4s;-moz-transition:.4s;-webkit-transition:.4s}.vis-item .vis-delete,.vis-item .vis-delete-rtl{position:absolute;top:0;width:24px;height:24px;box-sizing:border-box;padding:0 5px;cursor:pointer;-webkit-transition:background .2s linear;-moz-transition:background .2s linear;-ms-transition:background .2s linear;-o-transition:background .2s linear;transition:background .2s linear}.vis-item .vis-delete{right:-24px}.vis-item .vis-delete-rtl{left:-24px}.vis-item .vis-delete-rtl:after,.vis-item .vis-delete:after{content:"\00D7";color:red;font-family:arial,sans-serif;font-size:22px;font-weight:700;-webkit-transition:color .2s linear;-moz-transition:color .2s linear;-ms-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear}.vis-item .vis-delete-rtl:hover,.vis-item .vis-delete:hover{background:red}.vis-item .vis-delete-rtl:hover:after,.vis-item .vis-delete:hover:after{color:#fff}.vis-item .vis-drag-center{position:absolute;width:100%;height:100%;top:0;left:0;cursor:move}.vis-item.vis-range .vis-drag-left{left:-4px;cursor:w-resize}.vis-item.vis-range .vis-drag-left,.vis-item.vis-range .vis-drag-right{position:absolute;width:24px;max-width:20%;min-width:2px;height:100%;top:0}.vis-item.vis-range .vis-drag-right{right:-4px;cursor:e-resize}.vis-range.vis-item.vis-readonly .vis-drag-left,.vis-range.vis-item.vis-readonly .vis-drag-right{cursor:auto}.vis-item.vis-cluster{vertical-align:center;text-align:center;border-style:solid;border-radius:2px}.vis-item.vis-cluster-line{padding:0;position:absolute;width:0;border-left-width:1px;border-left-style:solid}.vis-item.vis-cluster-dot{position:absolute;padding:0;border-width:4px;border-style:solid;border-radius:4px} -/*# sourceMappingURL=vis-timeline-graph2d.min.css.map */ \ No newline at end of file +.vis .overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-active{box-shadow:0 0 10px #86d5f8}.vis [class*=span]{min-height:0;width:auto}div.vis-configuration{position:relative;display:block;float:left;font-size:12px}div.vis-configuration-wrapper{display:block;width:700px}div.vis-configuration-wrapper::after{clear:both;content:"";display:block}div.vis-configuration.vis-config-option-container{display:block;width:495px;background-color:#fff;border:2px solid #f7f8fa;border-radius:4px;margin-top:20px;left:10px;padding-left:5px}div.vis-configuration.vis-config-button{display:block;width:495px;height:25px;vertical-align:middle;line-height:25px;background-color:#f7f8fa;border:2px solid #ceced0;border-radius:4px;margin-top:20px;left:10px;padding-left:5px;cursor:pointer;margin-bottom:30px}div.vis-configuration.vis-config-button.hover{background-color:#4588e6;border:2px solid #214373;color:#fff}div.vis-configuration.vis-config-item{display:block;float:left;width:495px;height:25px;vertical-align:middle;line-height:25px}div.vis-configuration.vis-config-item.vis-config-s2{left:10px;background-color:#f7f8fa;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s3{left:20px;background-color:#e4e9f0;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-item.vis-config-s4{left:30px;background-color:#cfd8e6;padding-left:5px;border-radius:3px}div.vis-configuration.vis-config-header{font-size:18px;font-weight:700}div.vis-configuration.vis-config-label{width:120px;height:25px;line-height:25px}div.vis-configuration.vis-config-label.vis-config-s3{width:110px}div.vis-configuration.vis-config-label.vis-config-s4{width:100px}div.vis-configuration.vis-config-colorBlock{top:1px;width:30px;height:19px;border:1px solid #444;border-radius:2px;padding:0;margin:0;cursor:pointer}input.vis-configuration.vis-config-checkbox{left:-5px}input.vis-configuration.vis-config-rangeinput{position:relative;top:-5px;width:60px;padding:1px;margin:0;pointer-events:none}input.vis-configuration.vis-config-range{-webkit-appearance:none;border:0 solid #fff;background-color:rgba(0,0,0,0);width:300px;height:20px}input.vis-configuration.vis-config-range::-webkit-slider-runnable-track{width:300px;height:5px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-webkit-slider-thumb{-webkit-appearance:none;border:1px solid #14334b;height:17px;width:17px;border-radius:50%;background:#3876c2;background:-moz-linear-gradient(top,#3876c2 0,#385380 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#3876c2),color-stop(100%,#385380));background:-webkit-linear-gradient(top,#3876c2 0,#385380 100%);background:-o-linear-gradient(top,#3876c2 0,#385380 100%);background:-ms-linear-gradient(top,#3876c2 0,#385380 100%);background:linear-gradient(to bottom,#3876c2 0,#385380 100%);box-shadow:#111927 0 0 1px 0;margin-top:-7px}input.vis-configuration.vis-config-range:focus{outline:0}input.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track{background:#9d9d9d;background:-moz-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#9d9d9d),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-o-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#9d9d9d 0,#c8c8c8 99%);background:linear-gradient(to bottom,#9d9d9d 0,#c8c8c8 99%)}input.vis-configuration.vis-config-range::-moz-range-track{width:300px;height:10px;background:#dedede;background:-moz-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,#dedede),color-stop(99%,#c8c8c8));background:-webkit-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-o-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:-ms-linear-gradient(top,#dedede 0,#c8c8c8 99%);background:linear-gradient(to bottom,#dedede 0,#c8c8c8 99%);border:1px solid #999;box-shadow:#aaa 0 0 3px 0;border-radius:3px}input.vis-configuration.vis-config-range::-moz-range-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:-moz-focusring{outline:1px solid #fff;outline-offset:-1px}input.vis-configuration.vis-config-range::-ms-track{width:300px;height:5px;background:0 0;border-color:transparent;border-width:6px 0;color:transparent}input.vis-configuration.vis-config-range::-ms-fill-lower{background:#777;border-radius:10px}input.vis-configuration.vis-config-range::-ms-fill-upper{background:#ddd;border-radius:10px}input.vis-configuration.vis-config-range::-ms-thumb{border:none;height:16px;width:16px;border-radius:50%;background:#385380}input.vis-configuration.vis-config-range:focus::-ms-fill-lower{background:#888}input.vis-configuration.vis-config-range:focus::-ms-fill-upper{background:#ccc}.vis-configuration-popup{position:absolute;background:rgba(57,76,89,.85);border:2px solid #f2faff;line-height:30px;height:30px;width:150px;text-align:center;color:#fff;font-size:14px;border-radius:4px;-webkit-transition:opacity .3s ease-in-out;-moz-transition:opacity .3s ease-in-out;transition:opacity .3s ease-in-out}.vis-configuration-popup:after,.vis-configuration-popup:before{left:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.vis-configuration-popup:after{border-color:rgba(136,183,213,0);border-left-color:rgba(57,76,89,.85);border-width:8px;margin-top:-8px}.vis-configuration-popup:before{border-color:rgba(194,225,245,0);border-left-color:#f2faff;border-width:12px;margin-top:-12px}div.vis-tooltip{position:absolute;visibility:hidden;padding:5px;white-space:nowrap;font-family:verdana;font-size:14px;color:#000;background-color:#f5f4ed;-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;border:1px solid #808074;box-shadow:3px 3px 10px rgba(0,0,0,.2);pointer-events:none;z-index:5}.vis-current-time{background-color:#ff7f6e;width:2px;z-index:1;pointer-events:none}.vis-rolling-mode-btn{height:40px;width:40px;position:absolute;top:7px;right:20px;border-radius:50%;font-size:28px;cursor:pointer;opacity:.8;color:#fff;font-weight:700;text-align:center;background:#3876c2}.vis-rolling-mode-btn:before{content:"\26F6"}.vis-rolling-mode-btn:hover{opacity:1}.vis-custom-time{background-color:#6e94ff;width:2px;cursor:move;z-index:1}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-horizontal{position:absolute;width:100%;height:0;border-bottom:1px solid}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-minor{border-color:#e5e5e5}.vis-panel.vis-background.vis-horizontal .vis-grid.vis-major{border-color:#bfbfbf}.vis-data-axis .vis-y-axis.vis-major{width:100%;position:absolute;color:#4d4d4d;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-major.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-minor{position:absolute;width:100%;color:#bebebe;white-space:nowrap}.vis-data-axis .vis-y-axis.vis-minor.vis-measure{padding:0;margin:0;border:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title{position:absolute;color:#4d4d4d;white-space:nowrap;bottom:20px;text-align:center}.vis-data-axis .vis-y-axis.vis-title.vis-measure{padding:0;margin:0;visibility:hidden;width:auto}.vis-data-axis .vis-y-axis.vis-title.vis-left{bottom:0;-webkit-transform-origin:left top;-moz-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;transform-origin:left bottom;-webkit-transform:rotate(-90deg);-moz-transform:rotate(-90deg);-ms-transform:rotate(-90deg);-o-transform:rotate(-90deg);transform:rotate(-90deg)}.vis-data-axis .vis-y-axis.vis-title.vis-right{bottom:0;-webkit-transform-origin:right bottom;-moz-transform-origin:right bottom;-ms-transform-origin:right bottom;-o-transform-origin:right bottom;transform-origin:right bottom;-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.vis-legend{background-color:rgba(247,252,255,.65);padding:5px;border:1px solid #b3b3b3;box-shadow:2px 2px 10px rgba(154,154,154,.55)}.vis-legend-text{white-space:nowrap;display:inline-block}.vis-item{position:absolute;color:#1a1a1a;border-color:#97b0f8;border-width:1px;background-color:#d5ddf6;display:inline-block;z-index:1}.vis-item.vis-selected{border-color:#ffc200;background-color:#fff785;z-index:2}.vis-editable.vis-selected{cursor:move}.vis-item.vis-point.vis-selected{background-color:#fff785}.vis-item.vis-box{text-align:center;border-style:solid;border-radius:2px}.vis-item.vis-point{background:0 0}.vis-item.vis-dot{position:absolute;padding:0;border-width:4px;border-style:solid;border-radius:4px}.vis-item.vis-range{border-style:solid;border-radius:2px;box-sizing:border-box}.vis-item.vis-background{border:none;background-color:rgba(213,221,246,.4);box-sizing:border-box;padding:0;margin:0}.vis-item .vis-item-overflow{position:relative;width:100%;height:100%;padding:0;margin:0;overflow:hidden}.vis-item-visible-frame{white-space:nowrap}.vis-item.vis-range .vis-item-content{position:relative;display:inline-block}.vis-item.vis-background .vis-item-content{position:absolute;display:inline-block}.vis-item.vis-line{padding:0;position:absolute;width:0;border-left-width:1px;border-left-style:solid}.vis-item .vis-item-content{white-space:nowrap;box-sizing:border-box;padding:5px}.vis-item .vis-onUpdateTime-tooltip{position:absolute;background:#4f81bd;color:#fff;width:200px;text-align:center;white-space:nowrap;padding:5px;border-radius:1px;transition:.4s;-o-transition:.4s;-moz-transition:.4s;-webkit-transition:.4s}.vis-item .vis-delete,.vis-item .vis-delete-rtl{position:absolute;top:0;width:24px;height:24px;box-sizing:border-box;padding:0 5px;cursor:pointer;-webkit-transition:background .2s linear;-moz-transition:background .2s linear;-ms-transition:background .2s linear;-o-transition:background .2s linear;transition:background .2s linear}.vis-item .vis-delete{right:-24px}.vis-item .vis-delete-rtl{left:-24px}.vis-item .vis-delete-rtl:after,.vis-item .vis-delete:after{content:"\00D7";color:red;font-family:arial,sans-serif;font-size:22px;font-weight:700;-webkit-transition:color .2s linear;-moz-transition:color .2s linear;-ms-transition:color .2s linear;-o-transition:color .2s linear;transition:color .2s linear}.vis-item .vis-delete-rtl:hover,.vis-item .vis-delete:hover{background:red}.vis-item .vis-delete-rtl:hover:after,.vis-item .vis-delete:hover:after{color:#fff}.vis-item .vis-drag-center{position:absolute;width:100%;height:100%;top:0;left:0;cursor:move}.vis-item.vis-range .vis-drag-left{position:absolute;width:24px;max-width:20%;min-width:2px;height:100%;top:0;left:-4px;cursor:w-resize}.vis-item.vis-range .vis-drag-right{position:absolute;width:24px;max-width:20%;min-width:2px;height:100%;top:0;right:-4px;cursor:e-resize}.vis-range.vis-item.vis-readonly .vis-drag-left,.vis-range.vis-item.vis-readonly .vis-drag-right{cursor:auto}.vis-itemset{position:relative;padding:0;margin:0;box-sizing:border-box}.vis-itemset .vis-background,.vis-itemset .vis-foreground{position:absolute;width:100%;height:100%;overflow:visible}.vis-axis{position:absolute;width:100%;height:0;left:0;z-index:1}.vis-foreground .vis-group{position:relative;box-sizing:border-box;border-bottom:1px solid #bfbfbf}.vis-foreground .vis-group:last-child{border-bottom:none}.vis-nesting-group{cursor:pointer}.vis-nested-group{background:#f5f5f5}.vis-label.vis-nesting-group.expanded:before{content:"\25BC"}.vis-label.vis-nesting-group.collapsed-rtl:before{content:"\25C0"}.vis-label.vis-nesting-group.collapsed:before{content:"\25B6"}.vis-overlay{position:absolute;top:0;left:0;width:100%;height:100%;z-index:10}.vis-labelset{position:relative;overflow:hidden;box-sizing:border-box}.vis-labelset .vis-label{position:relative;left:0;top:0;width:100%;color:#4d4d4d;box-sizing:border-box}.vis-labelset .vis-label{border-bottom:1px solid #bfbfbf}.vis-labelset .vis-label.draggable{cursor:pointer}.vis-labelset .vis-label:last-child{border-bottom:none}.vis-labelset .vis-label .vis-inner{display:inline-block;padding:5px}.vis-labelset .vis-label .vis-inner.vis-hidden{padding:0}.vis-panel{position:absolute;padding:0;margin:0;box-sizing:border-box}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right,.vis-panel.vis-top{border:1px #bfbfbf}.vis-panel.vis-center,.vis-panel.vis-left,.vis-panel.vis-right{border-top-style:solid;border-bottom-style:solid;overflow:hidden}.vis-left.vis-panel.vis-vertical-scroll,.vis-right.vis-panel.vis-vertical-scroll{height:100%;overflow-x:hidden;overflow-y:scroll}.vis-left.vis-panel.vis-vertical-scroll{direction:rtl}.vis-left.vis-panel.vis-vertical-scroll .vis-content{direction:ltr}.vis-right.vis-panel.vis-vertical-scroll{direction:ltr}.vis-right.vis-panel.vis-vertical-scroll .vis-content{direction:rtl}.vis-panel.vis-bottom,.vis-panel.vis-center,.vis-panel.vis-top{border-left-style:solid;border-right-style:solid}.vis-background{overflow:hidden}.vis-panel>.vis-content{position:relative}.vis-panel .vis-shadow{position:absolute;width:100%;height:1px;box-shadow:0 0 10px rgba(0,0,0,.8)}.vis-panel .vis-shadow.vis-top{top:-1px;left:0}.vis-panel .vis-shadow.vis-bottom{bottom:-1px;left:0}.vis-graph-group0{fill:#4f81bd;fill-opacity:0;stroke-width:2px;stroke:#4f81bd}.vis-graph-group1{fill:#f79646;fill-opacity:0;stroke-width:2px;stroke:#f79646}.vis-graph-group2{fill:#8c51cf;fill-opacity:0;stroke-width:2px;stroke:#8c51cf}.vis-graph-group3{fill:#75c841;fill-opacity:0;stroke-width:2px;stroke:#75c841}.vis-graph-group4{fill:#ff0100;fill-opacity:0;stroke-width:2px;stroke:#ff0100}.vis-graph-group5{fill:#37d8e6;fill-opacity:0;stroke-width:2px;stroke:#37d8e6}.vis-graph-group6{fill:#042662;fill-opacity:0;stroke-width:2px;stroke:#042662}.vis-graph-group7{fill:#00ff26;fill-opacity:0;stroke-width:2px;stroke:#00ff26}.vis-graph-group8{fill:#f0f;fill-opacity:0;stroke-width:2px;stroke:#f0f}.vis-graph-group9{fill:#8f3938;fill-opacity:0;stroke-width:2px;stroke:#8f3938}.vis-timeline .vis-fill{fill-opacity:.1;stroke:none}.vis-timeline .vis-bar{fill-opacity:.5;stroke-width:1px}.vis-timeline .vis-point{stroke-width:2px;fill-opacity:1}.vis-timeline .vis-legend-background{stroke-width:1px;fill-opacity:.9;fill:#fff;stroke:#c2c2c2}.vis-timeline .vis-outline{stroke-width:1px;fill-opacity:1;fill:#fff;stroke:#e5e5e5}.vis-timeline .vis-icon-fill{fill-opacity:.3;stroke:none}.vis-time-axis{position:relative;overflow:hidden}.vis-time-axis.vis-foreground{top:0;left:0;width:100%}.vis-time-axis.vis-background{position:absolute;top:0;left:0;width:100%;height:100%}.vis-time-axis .vis-text{position:absolute;color:#4d4d4d;padding:3px;overflow:hidden;box-sizing:border-box;white-space:nowrap}.vis-time-axis .vis-text.vis-measure{position:absolute;padding-left:0;padding-right:0;margin-left:0;margin-right:0;visibility:hidden}.vis-time-axis .vis-grid.vis-vertical{position:absolute;border-left:1px solid}.vis-time-axis .vis-grid.vis-vertical-rtl{position:absolute;border-right:1px solid}.vis-time-axis .vis-grid.vis-minor{border-color:#e5e5e5}.vis-time-axis .vis-grid.vis-major{border-color:#bfbfbf}.vis-timeline{position:relative;border:1px solid #bfbfbf;overflow:hidden;padding:0;margin:0;box-sizing:border-box} \ No newline at end of file diff --git a/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css.map b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css.map deleted file mode 100644 index 3c165a792d0f3..0000000000000 --- a/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["bootstrap.css","activator.css","configuration.css","tooltip.css","panel.css","currenttime.css","customtime.css","timeline.css","pathStyles.css","dataaxis.css","itemset.css","labelset.css","timeaxis.css","item.css"],"names":[],"mappings":"AAEA,mBACE,YAAa,CACb,UACF,CCLA,cACE,iBAAkB,CAClB,KAAM,CACN,MAAO,CACP,UAAW,CACX,WAAY,CAGZ,UACF,CAEA,YACE,2BACF,CCbA,sBACI,iBAAiB,CACjB,aAAa,CACb,UAAU,CACV,cACJ,CAEA,8BACI,aAAa,CACb,WACJ,CAEA,oCACE,UAAW,CACX,UAAW,CACX,aACF,CAEA,kDACI,aAAa,CACb,WAAW,CACX,qBAAyB,CACzB,wBAAwB,CACxB,iBAAiB,CACjB,eAAe,CACf,SAAS,CACT,gBACJ,CAEA,wCACI,aAAa,CACb,WAAW,CACX,WAAW,CACX,qBAAsB,CACtB,gBAAgB,CAChB,wBAAyB,CACzB,wBAAwB,CACxB,iBAAiB,CACjB,eAAe,CACf,SAAS,CACT,gBAAgB,CAChB,cAAe,CACf,kBACJ,CAEA,8CACI,wBAAyB,CACzB,wBAAwB,CACxB,UACJ,CAEA,sCACI,aAAa,CACb,UAAU,CACV,WAAW,CACX,WAAW,CACX,qBAAsB,CACtB,gBACJ,CAGA,oDACI,SAAS,CACT,wBAAyB,CACzB,gBAAgB,CAChB,iBACJ,CACA,oDACI,SAAS,CACT,wBAAyB,CACzB,gBAAgB,CAChB,iBACJ,CACA,oDACI,SAAS,CACT,wBAAyB,CACzB,gBAAgB,CAChB,iBACJ,CAEA,wCACI,cAAc,CACd,eACJ,CAEA,uCACI,WAAW,CACX,WAAW,CACX,gBACJ,CAEA,qDACI,WACJ,CACA,qDACI,WACJ,CAEA,4CACI,OAAO,CACP,UAAU,CACV,WAAW,CACX,qBAAwB,CACxB,iBAAiB,CACjB,SAAW,CACX,QAAU,CACV,cACJ,CAEA,4CACI,SACJ,CAGA,8CACI,iBAAiB,CACjB,QAAQ,CACR,UAAU,CAEV,WAAW,CACX,QAAQ,CACR,mBACJ,CAEA,yCAEI,uBAAwB,CAGxB,mBAAuB,CACvB,4BAA8B,CAG9B,WAAY,CACZ,WACJ,CACA,wEACI,WAAY,CACZ,UAAW,CACX,kBAAmB,CACnB,0DAA+D,CAC/D,sGAA4G,CAC5G,2DAAiE,CACjE,wDAA4D,CAC5D,yDAA6D,CAC7D,wDAA+D,CAC/D,+GAAmH,CAEnH,qBAAyB,CACzB,yBAAmC,CACnC,iBACJ,CACA,+DACI,uBAAwB,CACxB,wBAAyB,CACzB,WAAY,CACZ,UAAW,CACX,iBAAkB,CAClB,kBAAmB,CACnB,2DAAgE,CAChE,uGAA6G,CAC7G,uDAAkE,CAClE,yDAA6D,CAC7D,0DAA8D,CAC9D,oDAAgE,CAChE,+GAAmH,CACnH,4BAAmC,CACnC,eACJ,CACA,+CACI,YACJ,CACA,8EACI,kBAAmB,CACnB,0DAA8D,CAC9D,sGAA4G,CAC5G,2DAAiE,CACjE,wDAA4D,CAC5D,yDAA6D,CAC7D,wDAA+D,CAC/D,+GACJ,CAEA,2DACI,WAAY,CACZ,WAAY,CACZ,kBAAmB,CACnB,0DAA+D,CAC/D,sGAA4G,CAC5G,2DAAiE,CACjE,wDAA4D,CAC5D,yDAA6D,CAC7D,wDAA+D,CAC/D,+GAAmH,CAEnH,qBAAyB,CACzB,yBAAmC,CACnC,iBACJ,CACA,2DACI,WAAY,CACZ,WAAY,CACZ,UAAW,CAEX,iBAAkB,CAClB,kBACJ,CAGA,wDACI,sBAAwB,CACxB,mBACJ,CAEA,oDACI,WAAY,CACZ,UAAW,CAGX,sBAAuB,CAGvB,wBAAyB,CACzB,kBAAmB,CAGnB,iBACJ,CACA,yDACI,eAAgB,CAChB,kBACJ,CACA,yDACI,eAAgB,CAChB,kBACJ,CACA,oDACI,WAAY,CACZ,WAAY,CACZ,UAAW,CACX,iBAAkB,CAClB,kBACJ,CACA,+DACI,eACJ,CACA,+DACI,eACJ,CAEA,yBACI,iBAAkB,CAClB,6BAAkC,CAClC,wBAAyB,CACzB,gBAAgB,CAChB,WAAW,CACX,WAAW,CACX,iBAAiB,CACjB,UAAc,CACd,cAAc,CACd,iBAAiB,CACjB,0CAA4C,CAC5C,uCAAyC,CACzC,kCACJ,CACA,+DACI,SAAU,CACV,OAAQ,CACR,wBAAyB,CACzB,WAAY,CACZ,QAAS,CACT,OAAQ,CACR,iBAAkB,CAClB,mBACJ,CAEA,+BAEI,2FAAyC,CACzC,gBAAiB,CACjB,eACJ,CACA,gCAEI,gFAA0B,CAC1B,iBAAkB,CAClB,gBACJ,CC/RA,gBACE,iBAAkB,CAClB,iBAAkB,CAClB,WAAY,CACZ,kBAAmB,CAEnB,mBAAoB,CACpB,cAAc,CACd,UAAa,CACb,wBAAyB,CAEzB,sBAAuB,CACvB,yBAA0B,CAC1B,iBAAkB,CAClB,wBAAyB,CAEzB,sCAA2C,CAC3C,mBAAoB,CAEpB,SACF,CCpBA,WACE,iBAAkB,CAElB,SAAU,CACV,QAAS,CAET,qBACF,CAEA,wGAKE,kBACF,CAEA,+DAGE,sBAAuB,CACvB,yBAA0B,CAC1B,eACF,CAEA,iFACE,WAAY,CACZ,iBAAkB,CAClB,iBACF,CAEA,wCACE,aACF,CAMA,8FACE,aACF,CAEA,sDACE,aACF,CAEA,+DAGE,uBAAwB,CACxB,wBACF,CAEA,gBACE,eACF,CAEA,wBACE,iBACF,CAEA,uBACE,iBAAkB,CAClB,UAAW,CACX,UAAW,CACX,kCAIF,CAEA,+BACE,QAAS,CACT,MACF,CAEA,kCACE,WAAY,CACZ,MACF,CChFA,kBACE,wBAAyB,CACzB,SAAU,CACV,SAAU,CACV,mBACF,CAEA,sBACE,WAAY,CACZ,UAAW,CACX,iBAAkB,CAClB,OAAQ,CACR,UAAW,CACX,iBAAkB,CAClB,cAAe,CACf,cAAe,CACf,UAAY,CACZ,UAAY,CACZ,eAAiB,CACjB,iBAAkB,CAClB,kBACF,CACA,6BACE,eACF,CAEA,4BACE,SACF,CC5BA,iBACE,wBAAyB,CACzB,SAAU,CACV,WAAY,CACZ,SACF,CAEA,yCACE,wBAAyB,CACzB,UAAY,CACZ,cAAe,CACf,kBAAmB,CACnB,eAAgB,CAChB,KAAQ,CACR,WAAe,CACf,eACF,CCfA,cACE,iBAAkB,CAClB,wBAAyB,CACzB,eAAgB,CAChB,SAAU,CACV,QAAS,CACT,qBACF,CAEA,oBACE,UAAW,CACX,WAAY,CACZ,iBAAkB,CAClB,KAAM,CACN,MACF,CChBA,kBACI,YAAY,CACZ,cAAc,CACd,gBAAgB,CAChB,cACJ,CAEA,kBACI,YAAY,CACZ,cAAc,CACd,gBAAgB,CAChB,cACJ,CAEA,kBACI,YAAa,CACb,cAAc,CACd,gBAAgB,CAChB,cACJ,CAEA,kBACI,YAAa,CACb,cAAc,CACd,gBAAgB,CAChB,cACJ,CAEA,kBACI,YAAa,CACb,cAAc,CACd,gBAAgB,CAChB,cACJ,CAEA,kBACI,YAAa,CACb,cAAc,CACd,gBAAgB,CAChB,cACJ,CAEA,kBACI,YAAa,CACb,cAAc,CACd,gBAAgB,CAChB,cACJ,CAEA,kBACI,YAAY,CACZ,cAAc,CACd,gBAAgB,CAChB,cACJ,CAEA,kBACI,SAAY,CACZ,cAAc,CACd,gBAAgB,CAChB,WACJ,CAEA,kBACI,YAAa,CACb,cAAc,CACd,gBAAgB,CAChB,cACJ,CAEA,wBACI,eAAgB,CAChB,WACJ,CAGA,uBACI,eAAgB,CAChB,gBACJ,CAEA,yBACI,gBAAgB,CAChB,cACJ,CAGA,qCACI,gBAAgB,CAChB,eAAgB,CAChB,SAAa,CACb,cACJ,CAGA,2BACI,gBAAgB,CAChB,cAAc,CACd,SAAa,CACb,cACJ,CAEA,6BACI,eAAgB,CAChB,WACJ,CCxGA,kEACE,iBAAkB,CAClB,UAAW,CACX,QAAS,CACT,uBACF,CAEA,6DACE,oBACF,CAEA,6DACE,oBACF,CAGA,qCACE,UAAW,CACX,iBAAkB,CAClB,aAAc,CACd,kBACF,CAEA,iDACE,SAAU,CACV,QAAS,CACT,QAAS,CACT,iBAAkB,CAClB,UACF,CAGA,qCACE,iBAAkB,CAClB,UAAW,CACX,aAAc,CACd,kBACF,CAEA,iDACE,SAAU,CACV,QAAS,CACT,QAAS,CACT,iBAAkB,CAClB,UACF,CAEA,qCACE,iBAAkB,CAClB,aAAc,CACd,kBAAmB,CACnB,WAAY,CACZ,iBACF,CAEA,iDACE,SAAU,CACV,QAAS,CACT,iBAAkB,CAClB,UACF,CAEA,8CACE,QAAS,CACT,iCAAkC,CAClC,8BAA+B,CAC/B,6BAA8B,CAC9B,4BAA6B,CAC7B,4BAA6B,CAC7B,gCAAiC,CACjC,6BAA8B,CAC9B,4BAA6B,CAC7B,2BAA4B,CAC5B,wBACF,CAEA,+CACE,QAAS,CACT,qCAAsC,CACtC,kCAAmC,CACnC,iCAAkC,CAClC,gCAAiC,CACjC,6BAA8B,CAC9B,+BAAgC,CAChC,4BAA6B,CAC7B,2BAA4B,CAC5B,0BAA2B,CAC3B,uBACF,CAEA,YACE,sCAA2C,CAC3C,WAAY,CACZ,wBAAyB,CACzB,4CACF,CAEA,iBAEE,kBAAmB,CACnB,oBACF,CCrGA,aACE,iBAAkB,CAClB,SAAU,CACV,QAAS,CAET,qBACF,CAEA,0DAEE,iBAAkB,CAClB,UAAW,CACX,WAAY,CACZ,gBACF,CAEA,UACE,iBAAkB,CAClB,UAAW,CACX,QAAS,CACT,MAAO,CACP,SACF,CAEA,2BACE,iBAAkB,CAClB,qBAAsB,CACtB,+BACF,CAEA,sCACE,kBACF,CAEA,mBACE,cACF,CAEA,6DACE,kBACF,CACA,8CACE,qBACF,CACA,kEACE,cACF,CACA,kEACE,eACF,CACA,8CACE,gCACF,CACA,kEACE,iBACF,CACA,kEACE,kBACF,CACA,8CACE,+BACF,CACA,kEACE,iBACF,CACA,kEACE,kBACF,CACA,8CACE,gCACF,CACA,kEACE,iBACF,CACA,kEACE,kBACF,CACA,8CACE,+BACF,CACA,kEACE,iBACF,CACA,kEACE,kBACF,CACA,8CACE,gCACF,CACA,kEACE,iBACF,CACA,kEACE,kBACF,CACA,8CACE,+BACF,CACA,kEACE,iBACF,CACA,kEACE,kBACF,CACA,8CACE,gCACF,CACA,kEACE,kBACF,CACA,kEACE,mBACF,CACA,8CACE,+BACF,CACA,kEACE,kBACF,CACA,kEACE,mBACF,CACA,8CACE,gCACF,CACA,kEACE,kBACF,CACA,kEACE,mBACF,CAGA,4BACE,+BACF,CACA,gDACE,kBACF,CACA,gDACE,mBACF,CAEA,kCACE,oBACF,CAGA,oCAEE,oBAAqB,CACrB,UACF,CACA,6CACE,eACF,CACA,8CACE,eACF,CACA,uDACE,eACF,CAEA,oEACE,iBACF,CACA,oEACE,kBACF,CAEA,aACE,iBAAkB,CAClB,KAAM,CACN,MAAO,CACP,UAAW,CACX,WAAY,CACZ,UACF,CCjLA,cAGE,eAGF,CAEA,uCAPE,iBAAkB,CAIlB,qBAWF,CARA,yBAEE,MAAO,CACP,KAAM,CACN,UAAW,CACX,aAAc,CAMd,+BAHF,CAMA,mCACE,cACF,CAEA,uBACE,yBACF,CAEA,oCACE,kBACF,CAEA,oCACE,oBAAqB,CACrB,WACF,CAEA,+CACE,SACF,CC1CA,eACE,iBAAkB,CAClB,eACF,CAEA,8BACE,KAAM,CACN,MAAO,CACP,UACF,CAEA,8BACE,iBAAkB,CAClB,KAAM,CACN,MAAO,CACP,UAAW,CACX,WACF,CAEA,yBACE,iBAAkB,CAClB,aAAc,CACd,WAAY,CACZ,eAAgB,CAChB,qBAAsB,CAEtB,kBACF,CAEA,qCACE,iBAAkB,CAClB,cAAe,CACf,eAAgB,CAChB,aAAc,CACd,cAAe,CACf,iBACF,CAEA,sCACE,iBAAkB,CAClB,qBACF,CAEA,0CACE,iBAAkB,CAClB,sBACF,CAEA,mCACE,oBACF,CAEA,mCACE,oBACF,CCrDA,UACE,iBAAkB,CAClB,aAAc,CACd,oBAAqB,CACrB,gBAAiB,CACjB,wBAAyB,CACzB,oBAAqB,CACrB,SAEF,CAEA,uBACE,oBAAqB,CACrB,wBAAyB,CAGzB,SACF,CAEA,2BACE,WACF,CAEA,iCACE,wBACF,CAEA,kBACE,iBAAkB,CAClB,kBAAmB,CACnB,iBACF,CAEA,oBACE,eACF,CAEA,kBACE,iBAAkB,CAClB,SAAU,CACV,gBAAiB,CACjB,kBAAmB,CACnB,iBACF,CAEA,oBACE,kBAAmB,CACnB,iBAAkB,CAClB,qBACF,CAEA,yBACE,WAAY,CACZ,qCAA0C,CAC1C,qBAAsB,CACtB,SAAU,CACV,QACF,CAEA,6BACE,iBAAkB,CAClB,UAAW,CACX,WAAY,CACZ,SAAU,CACV,QAAS,CACT,eACF,CAEA,wBACE,kBACF,CAEA,sCACE,iBAAkB,CAClB,oBACF,CAEA,2CACE,iBAAkB,CAClB,oBACF,CAEA,mBACE,SAAU,CACV,iBAAkB,CAClB,OAAQ,CACR,qBAAsB,CACtB,uBACF,CAEA,4BACE,kBAAmB,CACnB,qBAAsB,CACtB,WACF,CAEA,oCACE,iBAAkB,CAClB,kBAAmB,CACnB,UAAY,CACZ,WAAY,CACZ,iBAAkB,CAClB,kBAAmB,CACnB,WAAY,CACZ,iBAAkB,CAClB,cAAgB,CAChB,iBAAmB,CACnB,mBAAqB,CACrB,sBACF,CAEA,gDACE,iBAAkB,CAClB,KAAQ,CACR,UAAW,CACX,WAAY,CACZ,qBAAsB,CACtB,aAAgB,CAChB,cAAe,CAEf,wCAA0C,CAC1C,qCAAuC,CACvC,oCAAsC,CACtC,mCAAqC,CACrC,gCACF,CAEA,sBACE,WACF,CAEA,0BACE,UACF,CAEA,4DACE,eAAgB,CAChB,SAAU,CACV,4BAA8B,CAC9B,cAAe,CACf,eAAiB,CAEjB,mCAAqC,CACrC,gCAAkC,CAClC,+BAAiC,CACjC,8BAAgC,CAChC,2BACF,CAEA,4DACE,cACF,CAEA,wEACE,UACF,CAEA,2BACE,iBAAkB,CAClB,UAAW,CACX,WAAY,CACZ,KAAM,CACN,MAAS,CACT,WACF,CAEA,mCAOE,SAAU,CAEV,eACF,CAEA,uEAXE,iBAAkB,CAClB,UAAW,CACX,aAAc,CACd,aAAc,CACd,WAAY,CACZ,KAgBF,CAVA,oCAOE,UAAW,CAEX,eACF,CAEA,iGAEE,WACF,CAEA,sBACE,qBAAsB,CACtB,iBAAkB,CAClB,kBAAmB,CACnB,iBACF,CAEA,2BACE,SAAU,CACV,iBAAkB,CAClB,OAAQ,CACR,qBAAsB,CACtB,uBACF,CAEA,0BACE,iBAAkB,CAClB,SAAU,CACV,gBAAiB,CACjB,kBAAmB,CACnB,iBACF","file":"vis-timeline-graph2d.min.css","sourcesContent":["/* override some bootstrap styles screwing up the timelines css */\n\n.vis [class*=\"span\"] {\n min-height: 0;\n width: auto;\n}\n",".vis .overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n\n /* Must be displayed above for example selected Timeline items */\n z-index: 10;\n}\n\n.vis-active {\n box-shadow: 0 0 10px #86d5f8;\n}\n","div.vis-configuration {\n position:relative;\n display:block;\n float:left;\n font-size:12px;\n}\n\ndiv.vis-configuration-wrapper {\n display:block;\n width:700px;\n}\n\ndiv.vis-configuration-wrapper::after {\n clear: both;\n content: \"\";\n display: block;\n}\n\ndiv.vis-configuration.vis-config-option-container{\n display:block;\n width:495px;\n background-color: #ffffff;\n border:2px solid #f7f8fa;\n border-radius:4px;\n margin-top:20px;\n left:10px;\n padding-left:5px;\n}\n\ndiv.vis-configuration.vis-config-button{\n display:block;\n width:495px;\n height:25px;\n vertical-align: middle;\n line-height:25px;\n background-color: #f7f8fa;\n border:2px solid #ceced0;\n border-radius:4px;\n margin-top:20px;\n left:10px;\n padding-left:5px;\n cursor: pointer;\n margin-bottom:30px;\n}\n\ndiv.vis-configuration.vis-config-button.hover{\n background-color: #4588e6;\n border:2px solid #214373;\n color:#ffffff;\n}\n\ndiv.vis-configuration.vis-config-item{\n display:block;\n float:left;\n width:495px;\n height:25px;\n vertical-align: middle;\n line-height:25px;\n}\n\n\ndiv.vis-configuration.vis-config-item.vis-config-s2{\n left:10px;\n background-color: #f7f8fa;\n padding-left:5px;\n border-radius:3px;\n}\ndiv.vis-configuration.vis-config-item.vis-config-s3{\n left:20px;\n background-color: #e4e9f0;\n padding-left:5px;\n border-radius:3px;\n}\ndiv.vis-configuration.vis-config-item.vis-config-s4{\n left:30px;\n background-color: #cfd8e6;\n padding-left:5px;\n border-radius:3px;\n}\n\ndiv.vis-configuration.vis-config-header{\n font-size:18px;\n font-weight: bold;\n}\n\ndiv.vis-configuration.vis-config-label{\n width:120px;\n height:25px;\n line-height: 25px;\n}\n\ndiv.vis-configuration.vis-config-label.vis-config-s3{\n width:110px;\n}\ndiv.vis-configuration.vis-config-label.vis-config-s4{\n width:100px;\n}\n\ndiv.vis-configuration.vis-config-colorBlock{\n top:1px;\n width:30px;\n height:19px;\n border:1px solid #444444;\n border-radius:2px;\n padding:0px;\n margin:0px;\n cursor:pointer;\n}\n\ninput.vis-configuration.vis-config-checkbox {\n left:-5px;\n}\n\n\ninput.vis-configuration.vis-config-rangeinput{\n position:relative;\n top:-5px;\n width:60px;\n /*height:13px;*/\n padding:1px;\n margin:0;\n pointer-events:none;\n}\n\ninput.vis-configuration.vis-config-range{\n /*removes default webkit styles*/\n -webkit-appearance: none;\n\n /*fix for FF unable to apply focus style bug */\n border: 0px solid white;\n background-color:rgba(0,0,0,0);\n\n /*required for proper track sizing in FF*/\n width: 300px;\n height:20px;\n}\ninput.vis-configuration.vis-config-range::-webkit-slider-runnable-track {\n width: 300px;\n height: 5px;\n background: #dedede; /* Old browsers */\n background: -moz-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* FF3.6+ */\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dedede), color-stop(99%,#c8c8c8)); /* Chrome,Safari4+ */\n background: -webkit-linear-gradient(top, #dedede 0%,#c8c8c8 99%); /* Chrome10+,Safari5.1+ */\n background: -o-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* Opera 11.10+ */\n background: -ms-linear-gradient(top, #dedede 0%,#c8c8c8 99%); /* IE10+ */\n background: linear-gradient(to bottom, #dedede 0%,#c8c8c8 99%); /* W3C */\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8',GradientType=0 ); /* IE6-9 */\n\n border: 1px solid #999999;\n box-shadow: #aaaaaa 0px 0px 3px 0px;\n border-radius: 3px;\n}\ninput.vis-configuration.vis-config-range::-webkit-slider-thumb {\n -webkit-appearance: none;\n border: 1px solid #14334b;\n height: 17px;\n width: 17px;\n border-radius: 50%;\n background: #3876c2; /* Old browsers */\n background: -moz-linear-gradient(top, #3876c2 0%, #385380 100%); /* FF3.6+ */\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#3876c2), color-stop(100%,#385380)); /* Chrome,Safari4+ */\n background: -webkit-linear-gradient(top, #3876c2 0%,#385380 100%); /* Chrome10+,Safari5.1+ */\n background: -o-linear-gradient(top, #3876c2 0%,#385380 100%); /* Opera 11.10+ */\n background: -ms-linear-gradient(top, #3876c2 0%,#385380 100%); /* IE10+ */\n background: linear-gradient(to bottom, #3876c2 0%,#385380 100%); /* W3C */\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3876c2', endColorstr='#385380',GradientType=0 ); /* IE6-9 */\n box-shadow: #111927 0px 0px 1px 0px;\n margin-top: -7px;\n}\ninput.vis-configuration.vis-config-range:focus {\n outline: none;\n}\ninput.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track {\n background: #9d9d9d; /* Old browsers */\n background: -moz-linear-gradient(top, #9d9d9d 0%, #c8c8c8 99%); /* FF3.6+ */\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#9d9d9d), color-stop(99%,#c8c8c8)); /* Chrome,Safari4+ */\n background: -webkit-linear-gradient(top, #9d9d9d 0%,#c8c8c8 99%); /* Chrome10+,Safari5.1+ */\n background: -o-linear-gradient(top, #9d9d9d 0%,#c8c8c8 99%); /* Opera 11.10+ */\n background: -ms-linear-gradient(top, #9d9d9d 0%,#c8c8c8 99%); /* IE10+ */\n background: linear-gradient(to bottom, #9d9d9d 0%,#c8c8c8 99%); /* W3C */\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#9d9d9d', endColorstr='#c8c8c8',GradientType=0 ); /* IE6-9 */\n}\n\ninput.vis-configuration.vis-config-range::-moz-range-track {\n width: 300px;\n height: 10px;\n background: #dedede; /* Old browsers */\n background: -moz-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* FF3.6+ */\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#dedede), color-stop(99%,#c8c8c8)); /* Chrome,Safari4+ */\n background: -webkit-linear-gradient(top, #dedede 0%,#c8c8c8 99%); /* Chrome10+,Safari5.1+ */\n background: -o-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* Opera 11.10+ */\n background: -ms-linear-gradient(top, #dedede 0%,#c8c8c8 99%); /* IE10+ */\n background: linear-gradient(to bottom, #dedede 0%,#c8c8c8 99%); /* W3C */\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#dedede', endColorstr='#c8c8c8',GradientType=0 ); /* IE6-9 */\n\n border: 1px solid #999999;\n box-shadow: #aaaaaa 0px 0px 3px 0px;\n border-radius: 3px;\n}\ninput.vis-configuration.vis-config-range::-moz-range-thumb {\n border: none;\n height: 16px;\n width: 16px;\n\n border-radius: 50%;\n background: #385380;\n}\n\n/*hide the outline behind the border*/\ninput.vis-configuration.vis-config-range:-moz-focusring{\n outline: 1px solid white;\n outline-offset: -1px;\n}\n\ninput.vis-configuration.vis-config-range::-ms-track {\n width: 300px;\n height: 5px;\n\n /*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */\n background: transparent;\n\n /*leave room for the larger thumb to overflow with a transparent border */\n border-color: transparent;\n border-width: 6px 0;\n\n /*remove default tick marks*/\n color: transparent;\n}\ninput.vis-configuration.vis-config-range::-ms-fill-lower {\n background: #777;\n border-radius: 10px;\n}\ninput.vis-configuration.vis-config-range::-ms-fill-upper {\n background: #ddd;\n border-radius: 10px;\n}\ninput.vis-configuration.vis-config-range::-ms-thumb {\n border: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #385380;\n}\ninput.vis-configuration.vis-config-range:focus::-ms-fill-lower {\n background: #888;\n}\ninput.vis-configuration.vis-config-range:focus::-ms-fill-upper {\n background: #ccc;\n}\n\n.vis-configuration-popup {\n position: absolute;\n background: rgba(57, 76, 89, 0.85);\n border: 2px solid #f2faff;\n line-height:30px;\n height:30px;\n width:150px;\n text-align:center;\n color: #ffffff;\n font-size:14px;\n border-radius:4px;\n -webkit-transition: opacity 0.3s ease-in-out;\n -moz-transition: opacity 0.3s ease-in-out;\n transition: opacity 0.3s ease-in-out;\n}\n.vis-configuration-popup:after, .vis-configuration-popup:before {\n left: 100%;\n top: 50%;\n border: solid transparent;\n content: \" \";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n\n.vis-configuration-popup:after {\n border-color: rgba(136, 183, 213, 0);\n border-left-color: rgba(57, 76, 89, 0.85);\n border-width: 8px;\n margin-top: -8px;\n}\n.vis-configuration-popup:before {\n border-color: rgba(194, 225, 245, 0);\n border-left-color: #f2faff;\n border-width: 12px;\n margin-top: -12px;\n}","div.vis-tooltip {\n position: absolute;\n visibility: hidden;\n padding: 5px;\n white-space: nowrap;\n\n font-family: verdana;\n font-size:14px;\n color:#000000;\n background-color: #f5f4ed;\n\n -moz-border-radius: 3px;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n border: 1px solid #808074;\n\n box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);\n pointer-events: none;\n\n z-index: 5;\n}\n",".vis-panel {\n position: absolute;\n\n padding: 0;\n margin: 0;\n\n box-sizing: border-box;\n}\n\n.vis-panel.vis-center,\n.vis-panel.vis-left,\n.vis-panel.vis-right,\n.vis-panel.vis-top,\n.vis-panel.vis-bottom {\n border: 1px #bfbfbf;\n}\n\n.vis-panel.vis-center,\n.vis-panel.vis-left,\n.vis-panel.vis-right {\n border-top-style: solid;\n border-bottom-style: solid;\n overflow: hidden;\n}\n\n.vis-left.vis-panel.vis-vertical-scroll, .vis-right.vis-panel.vis-vertical-scroll {\n height: 100%;\n overflow-x: hidden;\n overflow-y: scroll;\n} \n\n.vis-left.vis-panel.vis-vertical-scroll {\n direction: rtl;\n}\n\n.vis-left.vis-panel.vis-vertical-scroll .vis-content {\n direction: ltr;\n}\n\n.vis-right.vis-panel.vis-vertical-scroll {\n direction: ltr;\n}\n\n.vis-right.vis-panel.vis-vertical-scroll .vis-content {\n direction: rtl;\n}\n\n.vis-panel.vis-center,\n.vis-panel.vis-top,\n.vis-panel.vis-bottom {\n border-left-style: solid;\n border-right-style: solid;\n}\n\n.vis-background {\n overflow: hidden;\n}\n\n.vis-panel > .vis-content {\n position: relative;\n}\n\n.vis-panel .vis-shadow {\n position: absolute;\n width: 100%;\n height: 1px;\n box-shadow: 0 0 10px rgba(0,0,0,0.8);\n /* TODO: find a nice way to ensure vis-shadows are drawn on top of items\n z-index: 1;\n */\n}\n\n.vis-panel .vis-shadow.vis-top {\n top: -1px;\n left: 0;\n}\n\n.vis-panel .vis-shadow.vis-bottom {\n bottom: -1px;\n left: 0;\n}",".vis-current-time {\n background-color: #FF7F6E;\n width: 2px;\n z-index: 1;\n pointer-events: none;\n}\n\n.vis-rolling-mode-btn {\n height: 40px;\n width: 40px;\n position: absolute;\n top: 7px;\n right: 20px;\n border-radius: 50%;\n font-size: 28px;\n cursor: pointer;\n opacity: 0.8;\n color: white;\n font-weight: bold;\n text-align: center;\n background: #3876c2;\n}\n.vis-rolling-mode-btn:before {\n content: \"\\26F6\";\n}\n\n.vis-rolling-mode-btn:hover {\n opacity: 1;\n}",".vis-custom-time {\n background-color: #6E94FF;\n width: 2px;\n cursor: move;\n z-index: 1;\n}\n\n.vis-custom-time > .vis-custom-time-marker {\n background-color: inherit;\n color: white;\n font-size: 12px;\n white-space: nowrap;\n padding: 3px 5px;\n top: 0px;\n cursor: initial;\n z-index: inherit;\n}","\n.vis-timeline {\n position: relative;\n border: 1px solid #bfbfbf;\n overflow: hidden;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n}\n\n.vis-loading-screen {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n}",".vis-graph-group0 {\n fill:#4f81bd;\n fill-opacity:0;\n stroke-width:2px;\n stroke: #4f81bd;\n}\n\n.vis-graph-group1 {\n fill:#f79646;\n fill-opacity:0;\n stroke-width:2px;\n stroke: #f79646;\n}\n\n.vis-graph-group2 {\n fill: #8c51cf;\n fill-opacity:0;\n stroke-width:2px;\n stroke: #8c51cf;\n}\n\n.vis-graph-group3 {\n fill: #75c841;\n fill-opacity:0;\n stroke-width:2px;\n stroke: #75c841;\n}\n\n.vis-graph-group4 {\n fill: #ff0100;\n fill-opacity:0;\n stroke-width:2px;\n stroke: #ff0100;\n}\n\n.vis-graph-group5 {\n fill: #37d8e6;\n fill-opacity:0;\n stroke-width:2px;\n stroke: #37d8e6;\n}\n\n.vis-graph-group6 {\n fill: #042662;\n fill-opacity:0;\n stroke-width:2px;\n stroke: #042662;\n}\n\n.vis-graph-group7 {\n fill:#00ff26;\n fill-opacity:0;\n stroke-width:2px;\n stroke: #00ff26;\n}\n\n.vis-graph-group8 {\n fill:#ff00ff;\n fill-opacity:0;\n stroke-width:2px;\n stroke: #ff00ff;\n}\n\n.vis-graph-group9 {\n fill: #8f3938;\n fill-opacity:0;\n stroke-width:2px;\n stroke: #8f3938;\n}\n\n.vis-timeline .vis-fill {\n fill-opacity:0.1;\n stroke: none;\n}\n\n\n.vis-timeline .vis-bar {\n fill-opacity:0.5;\n stroke-width:1px;\n}\n\n.vis-timeline .vis-point {\n stroke-width:2px;\n fill-opacity:1.0;\n}\n\n\n.vis-timeline .vis-legend-background {\n stroke-width:1px;\n fill-opacity:0.9;\n fill: #ffffff;\n stroke: #c2c2c2;\n}\n\n\n.vis-timeline .vis-outline {\n stroke-width:1px;\n fill-opacity:1;\n fill: #ffffff;\n stroke: #e5e5e5;\n}\n\n.vis-timeline .vis-icon-fill {\n fill-opacity:0.3;\n stroke: none;\n}\n","\n.vis-panel.vis-background.vis-horizontal .vis-grid.vis-horizontal {\n position: absolute;\n width: 100%;\n height: 0;\n border-bottom: 1px solid;\n}\n\n.vis-panel.vis-background.vis-horizontal .vis-grid.vis-minor {\n border-color: #e5e5e5;\n}\n\n.vis-panel.vis-background.vis-horizontal .vis-grid.vis-major {\n border-color: #bfbfbf;\n}\n\n\n.vis-data-axis .vis-y-axis.vis-major {\n width: 100%;\n position: absolute;\n color: #4d4d4d;\n white-space: nowrap;\n}\n\n.vis-data-axis .vis-y-axis.vis-major.vis-measure {\n padding: 0;\n margin: 0;\n border: 0;\n visibility: hidden;\n width: auto;\n}\n\n\n.vis-data-axis .vis-y-axis.vis-minor {\n position: absolute;\n width: 100%;\n color: #bebebe;\n white-space: nowrap;\n}\n\n.vis-data-axis .vis-y-axis.vis-minor.vis-measure {\n padding: 0;\n margin: 0;\n border: 0;\n visibility: hidden;\n width: auto;\n}\n\n.vis-data-axis .vis-y-axis.vis-title {\n position: absolute;\n color: #4d4d4d;\n white-space: nowrap;\n bottom: 20px;\n text-align: center;\n}\n\n.vis-data-axis .vis-y-axis.vis-title.vis-measure {\n padding: 0;\n margin: 0;\n visibility: hidden;\n width: auto;\n}\n\n.vis-data-axis .vis-y-axis.vis-title.vis-left {\n bottom: 0;\n -webkit-transform-origin: left top;\n -moz-transform-origin: left top;\n -ms-transform-origin: left top;\n -o-transform-origin: left top;\n transform-origin: left bottom;\n -webkit-transform: rotate(-90deg);\n -moz-transform: rotate(-90deg);\n -ms-transform: rotate(-90deg);\n -o-transform: rotate(-90deg);\n transform: rotate(-90deg);\n}\n\n.vis-data-axis .vis-y-axis.vis-title.vis-right {\n bottom: 0;\n -webkit-transform-origin: right bottom;\n -moz-transform-origin: right bottom;\n -ms-transform-origin: right bottom;\n -o-transform-origin: right bottom;\n transform-origin: right bottom;\n -webkit-transform: rotate(90deg);\n -moz-transform: rotate(90deg);\n -ms-transform: rotate(90deg);\n -o-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.vis-legend {\n background-color: rgba(247, 252, 255, 0.65);\n padding: 5px;\n border: 1px solid #b3b3b3;\n box-shadow: 2px 2px 10px rgba(154, 154, 154, 0.55);\n}\n\n.vis-legend-text {\n /*font-size: 10px;*/\n white-space: nowrap;\n display: inline-block\n}","\n.vis-itemset {\n position: relative;\n padding: 0;\n margin: 0;\n\n box-sizing: border-box;\n}\n\n.vis-itemset .vis-background,\n.vis-itemset .vis-foreground {\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n.vis-axis {\n position: absolute;\n width: 100%;\n height: 0;\n left: 0;\n z-index: 1;\n}\n\n.vis-foreground .vis-group {\n position: relative;\n box-sizing: border-box;\n border-bottom: 1px solid #bfbfbf;\n}\n\n.vis-foreground .vis-group:last-child {\n border-bottom: none;\n}\n\n.vis-nesting-group {\n cursor: pointer;\n}\n\n.vis-label.vis-nested-group.vis-group-level-unknown-but-gte1 {\n background: #f5f5f5;\n}\n.vis-label.vis-nested-group.vis-group-level-0 {\n background-color: #ffffff;\n}\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-0 .vis-inner {\n padding-left: 0;\n}\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-0 .vis-inner {\n padding-right: 0;\n}\n.vis-label.vis-nested-group.vis-group-level-1 {\n background-color: rgba(0, 0, 0, 0.05);\n}\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-1 .vis-inner {\n padding-left: 15px;\n}\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-1 .vis-inner {\n padding-right: 15px;\n}\n.vis-label.vis-nested-group.vis-group-level-2 {\n background-color: rgba(0, 0, 0, 0.1);\n}\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-2 .vis-inner {\n padding-left: 30px;\n}\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-2 .vis-inner {\n padding-right: 30px;\n}\n.vis-label.vis-nested-group.vis-group-level-3 {\n background-color: rgba(0, 0, 0, 0.15);\n}\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-3 .vis-inner {\n padding-left: 45px;\n}\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-3 .vis-inner {\n padding-right: 45px;\n}\n.vis-label.vis-nested-group.vis-group-level-4 {\n background-color: rgba(0, 0, 0, 0.2);\n}\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-4 .vis-inner {\n padding-left: 60px;\n}\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-4 .vis-inner {\n padding-right: 60px;\n}\n.vis-label.vis-nested-group.vis-group-level-5 {\n background-color: rgba(0, 0, 0, 0.25);\n}\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-5 .vis-inner {\n padding-left: 75px;\n}\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-5 .vis-inner {\n padding-right: 75px;\n}\n.vis-label.vis-nested-group.vis-group-level-6 {\n background-color: rgba(0, 0, 0, 0.3);\n}\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-6 .vis-inner {\n padding-left: 90px;\n}\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-6 .vis-inner {\n padding-right: 90px;\n}\n.vis-label.vis-nested-group.vis-group-level-7 {\n background-color: rgba(0, 0, 0, 0.35);\n}\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-7 .vis-inner {\n padding-left: 105px;\n}\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-7 .vis-inner {\n padding-right: 105px;\n}\n.vis-label.vis-nested-group.vis-group-level-8 {\n background-color: rgba(0, 0, 0, 0.4);\n}\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-8 .vis-inner {\n padding-left: 120px;\n}\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-8 .vis-inner {\n padding-right: 120px;\n}\n.vis-label.vis-nested-group.vis-group-level-9 {\n background-color: rgba(0, 0, 0, 0.45);\n}\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-9 .vis-inner {\n padding-left: 135px;\n}\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-9 .vis-inner {\n padding-right: 135px;\n}\n/* default takes over beginning with level-10 (thats why we add .vis-nested-group\n to the selectors above, to have higher specifity than these rules for the defaults) */\n.vis-label.vis-nested-group {\n background-color: rgba(0, 0, 0, 0.5);\n}\n.vis-ltr .vis-label.vis-nested-group .vis-inner {\n padding-left: 150px;\n}\n.vis-rtl .vis-label.vis-nested-group .vis-inner {\n padding-right: 150px;\n}\n\n.vis-group-level-unknown-but-gte1 {\n border: 1px solid red;\n}\n\n/* expanded/collapsed indicators */\n.vis-label.vis-nesting-group:before,\n.vis-label.vis-nesting-group:before {\n display: inline-block;\n width: 15px;\n}\n.vis-label.vis-nesting-group.expanded:before {\n content: \"\\25BC\";\n}\n.vis-label.vis-nesting-group.collapsed:before {\n content: \"\\25B6\";\n}\n.vis-rtl .vis-label.vis-nesting-group.collapsed:before {\n content: \"\\25C0\";\n}\n/* compensate missing expanded/collapsed indicator, but only at levels > 0 */\n.vis-ltr .vis-label:not(.vis-nesting-group):not(.vis-group-level-0) {\n padding-left: 15px;\n}\n.vis-rtl .vis-label:not(.vis-nesting-group):not(.vis-group-level-0) {\n padding-right: 15px;\n}\n\n.vis-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 10;\n}","\n.vis-labelset {\n position: relative;\n\n overflow: hidden;\n\n box-sizing: border-box;\n}\n\n.vis-labelset .vis-label {\n position: relative;\n left: 0;\n top: 0;\n width: 100%;\n color: #4d4d4d;\n\n box-sizing: border-box;\n}\n\n.vis-labelset .vis-label {\n border-bottom: 1px solid #bfbfbf;\n}\n\n.vis-labelset .vis-label.draggable {\n cursor: pointer;\n}\n\n.vis-group-is-dragging {\n background: rgba(0, 0, 0, .1);\n}\n\n.vis-labelset .vis-label:last-child {\n border-bottom: none;\n}\n\n.vis-labelset .vis-label .vis-inner {\n display: inline-block;\n padding: 5px;\n}\n\n.vis-labelset .vis-label .vis-inner.vis-hidden {\n padding: 0;\n}\n",".vis-time-axis {\n position: relative;\n overflow: hidden;\n}\n\n.vis-time-axis.vis-foreground {\n top: 0;\n left: 0;\n width: 100%;\n}\n\n.vis-time-axis.vis-background {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.vis-time-axis .vis-text {\n position: absolute;\n color: #4d4d4d;\n padding: 3px;\n overflow: hidden;\n box-sizing: border-box;\n\n white-space: nowrap;\n}\n\n.vis-time-axis .vis-text.vis-measure {\n position: absolute;\n padding-left: 0;\n padding-right: 0;\n margin-left: 0;\n margin-right: 0;\n visibility: hidden;\n}\n\n.vis-time-axis .vis-grid.vis-vertical {\n position: absolute;\n border-left: 1px solid;\n}\n\n.vis-time-axis .vis-grid.vis-vertical-rtl {\n position: absolute;\n border-right: 1px solid;\n}\n\n.vis-time-axis .vis-grid.vis-minor {\n border-color: #e5e5e5;\n}\n\n.vis-time-axis .vis-grid.vis-major {\n border-color: #bfbfbf;\n}\n","\n.vis-item {\n position: absolute;\n color: #1A1A1A;\n border-color: #97B0F8;\n border-width: 1px;\n background-color: #D5DDF6;\n display: inline-block;\n z-index: 1;\n /*overflow: hidden;*/\n}\n\n.vis-item.vis-selected {\n border-color: #FFC200;\n background-color: #FFF785;\n\n /* z-index must be higher than the z-index of custom time bar and current time bar */\n z-index: 2;\n}\n\n.vis-editable.vis-selected {\n cursor: move;\n}\n\n.vis-item.vis-point.vis-selected {\n background-color: #FFF785;\n}\n\n.vis-item.vis-box {\n text-align: center;\n border-style: solid;\n border-radius: 2px;\n}\n\n.vis-item.vis-point {\n background: none;\n}\n\n.vis-item.vis-dot {\n position: absolute;\n padding: 0;\n border-width: 4px;\n border-style: solid;\n border-radius: 4px;\n}\n\n.vis-item.vis-range {\n border-style: solid;\n border-radius: 2px;\n box-sizing: border-box;\n}\n\n.vis-item.vis-background {\n border: none;\n background-color: rgba(213, 221, 246, 0.4);\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n}\n\n.vis-item .vis-item-overflow {\n position: relative;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n overflow: hidden;\n}\n\n.vis-item-visible-frame {\n white-space: nowrap;\n}\n\n.vis-item.vis-range .vis-item-content {\n position: relative;\n display: inline-block;\n}\n\n.vis-item.vis-background .vis-item-content {\n position: absolute;\n display: inline-block;\n}\n\n.vis-item.vis-line {\n padding: 0;\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n}\n\n.vis-item .vis-item-content {\n white-space: nowrap;\n box-sizing: border-box;\n padding: 5px;\n}\n\n.vis-item .vis-onUpdateTime-tooltip {\n position: absolute;\n background: #4f81bd;\n color: white;\n width: 200px;\n text-align: center;\n white-space: nowrap;\n padding: 5px;\n border-radius: 1px;\n transition: 0.4s;\n -o-transition: 0.4s;\n -moz-transition: 0.4s;\n -webkit-transition: 0.4s;\n}\n\n.vis-item .vis-delete, .vis-item .vis-delete-rtl {\n position: absolute;\n top: 0px;\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n padding: 0px 5px;\n cursor: pointer;\n\n -webkit-transition: background 0.2s linear;\n -moz-transition: background 0.2s linear;\n -ms-transition: background 0.2s linear;\n -o-transition: background 0.2s linear;\n transition: background 0.2s linear;\n}\n\n.vis-item .vis-delete {\n right: -24px;\n}\n\n.vis-item .vis-delete-rtl {\n left: -24px;\n}\n\n.vis-item .vis-delete:after, .vis-item .vis-delete-rtl:after {\n content: \"\\00D7\"; /* MULTIPLICATION SIGN */\n color: red;\n font-family: arial, sans-serif;\n font-size: 22px;\n font-weight: bold;\n\n -webkit-transition: color 0.2s linear;\n -moz-transition: color 0.2s linear;\n -ms-transition: color 0.2s linear;\n -o-transition: color 0.2s linear;\n transition: color 0.2s linear;\n}\n\n.vis-item .vis-delete:hover, .vis-item .vis-delete-rtl:hover {\n background: red;\n}\n\n.vis-item .vis-delete:hover:after, .vis-item .vis-delete-rtl:hover:after {\n color: white;\n}\n\n.vis-item .vis-drag-center {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0px;\n cursor: move;\n}\n\n.vis-item.vis-range .vis-drag-left {\n position: absolute;\n width: 24px;\n max-width: 20%;\n min-width: 2px;\n height: 100%;\n top: 0;\n left: -4px;\n\n cursor: w-resize;\n}\n\n.vis-item.vis-range .vis-drag-right {\n position: absolute;\n width: 24px;\n max-width: 20%;\n min-width: 2px;\n height: 100%;\n top: 0;\n right: -4px;\n\n cursor: e-resize;\n}\n\n.vis-range.vis-item.vis-readonly .vis-drag-left,\n.vis-range.vis-item.vis-readonly .vis-drag-right {\n cursor: auto;\n}\n\n.vis-item.vis-cluster {\n vertical-align: center;\n text-align: center;\n border-style: solid;\n border-radius: 2px;\n}\n\n.vis-item.vis-cluster-line {\n padding: 0;\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n}\n\n.vis-item.vis-cluster-dot {\n position: absolute;\n padding: 0;\n border-width: 4px;\n border-style: solid;\n border-radius: 4px;\n}"]} \ No newline at end of file diff --git a/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.js b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.js index df730409ee491..5cfa0da3d4f38 100644 --- a/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.js +++ b/core/src/main/resources/org/apache/spark/ui/static/vis-timeline-graph2d.min.js @@ -1,60 +1,30 @@ /** - * vis-timeline and vis-graph2d - * https://visjs.github.io/vis-timeline/ + * vis.js + * https://github.com/almende/vis * - * Create a fully customizable, interactive timeline with items and ranges. + * A dynamic, browser-based visualization library. * - * @version 7.3.4 - * @date 2020-03-18T17:03:58.105Z - * - * @copyright (c) 2011-2017 Almende B.V, http://almende.com - * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs + * @version 4.21.0 + * @date 2017-10-12 * * @license - * vis.js is dual licensed under both + * Copyright (C) 2011-2017 Almende B.V, http://almende.com + * + * Vis.js is dual licensed under both * - * 1. The Apache 2.0 License - * http://www.apache.org/licenses/LICENSE-2.0 + * * The Apache 2.0 License + * http://www.apache.org/licenses/LICENSE-2.0 * - * and + * and * - * 2. The MIT License - * http://opensource.org/licenses/MIT + * * The MIT License + * http://opensource.org/licenses/MIT * - * vis.js may be distributed under either license. + * Vis.js may be distributed under either license. */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).vis=t.vis||{})}(this,(function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}function n(t,e){return t(e={exports:{}},e.exports),e.exports}function o(t){return t&&t.default||t}var s=n((function(t,e){t.exports=function(){var e,n;function o(){return e.apply(null,arguments)}function s(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function r(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function a(t){return void 0===t}function l(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function h(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function d(t,e){var i,n=[];for(i=0;i>>0,n=0;n0)for(i=0;i=0?i?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}var T=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Y=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,E={},R={};function U(t,e,i,n){var o=n;"string"==typeof n&&(o=function(){return this[n]()}),t&&(R[t]=o),e&&(R[e[0]]=function(){return X(o.apply(this,arguments),e[1],e[2])}),i&&(R[i]=function(){return this.localeData().ordinal(o.apply(this,arguments),t)})}function z(t,e){return t.isValid()?(e=V(e,t.localeData()),E[e]=E[e]||function(t){var e,i,n,o=t.match(T);for(e=0,i=o.length;e=0&&Y.test(t);)t=t.replace(Y,n),Y.lastIndex=0,i-=1;return t}var j=/\d/,H=/\d\d/,P=/\d{3}/,J=/\d{4}/,K=/[+-]?\d{6}/,q=/\d\d?/,$=/\d\d\d\d?/,tt=/\d\d\d\d\d\d?/,et=/\d{1,3}/,it=/\d{1,4}/,nt=/[+-]?\d{1,6}/,ot=/\d+/,st=/[+-]?\d+/,rt=/Z|[+-]\d\d:?\d\d/gi,at=/Z|[+-]\d\d(?::?\d\d)?/gi,lt=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,ht={};function dt(t,e,i){ht[t]=S(e)?e:function(t,n){return t&&i?i:e}}function ut(t,e){return u(ht,t)?ht[t](e._strict,e._locale):new RegExp(ct(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,i,n,o){return e||i||n||o}))))}function ct(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var pt={};function mt(t,e){var i,n=e;for("string"==typeof t&&(t=[t]),l(e)&&(n=function(t,i){i[e]=k(t)}),i=0;i68?1900:2e3)};var yt,xt=wt("FullYear",!0);function wt(t,e){return function(i){return null!=i?(kt(this,t,i),o.updateOffset(this,e),this):_t(this,t)}}function _t(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function kt(t,e,i){t.isValid()&&!isNaN(i)&&("FullYear"===e&&bt(t.year())&&1===t.month()&&29===t.date()?t._d["set"+(t._isUTC?"UTC":"")+e](i,t.month(),Dt(i,t.month())):t._d["set"+(t._isUTC?"UTC":"")+e](i))}function Dt(t,e){if(isNaN(t)||isNaN(e))return NaN;var i,n=(e%(i=12)+i)%i;return t+=(e-n)/12,1===n?bt(t)?29:28:31-n%7%2}yt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e=0?(a=new Date(t+400,e,i,n,o,s,r),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,i,n,o,s,r),a}function Bt(t){var e;if(t<100&&t>=0){var i=Array.prototype.slice.call(arguments);i[0]=t+400,e=new Date(Date.UTC.apply(null,i)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)}else e=new Date(Date.UTC.apply(null,arguments));return e}function Ot(t,e,i){var n=7+e-i;return-(7+Bt(t,0,n).getUTCDay()-e)%7+n-1}function Wt(t,e,i,n,o){var s,r,a=1+7*(e-1)+(7+i-n)%7+Ot(t,n,o);return a<=0?r=vt(s=t-1)+a:a>vt(t)?(s=t+1,r=a-vt(t)):(s=t,r=a),{year:s,dayOfYear:r}}function At(t,e,i){var n,o,s=Ot(t.year(),e,i),r=Math.floor((t.dayOfYear()-s-1)/7)+1;return r<1?n=r+Xt(o=t.year()-1,e,i):r>Xt(t.year(),e,i)?(n=r-Xt(t.year(),e,i),o=t.year()+1):(o=t.year(),n=r),{week:n,year:o}}function Xt(t,e,i){var n=Ot(t,e,i),o=Ot(t+1,e,i);return(vt(t)-n+o)/7}function Tt(t,e){return t.slice(e,7).concat(t.slice(0,e))}U("w",["ww",2],"wo","week"),U("W",["WW",2],"Wo","isoWeek"),Z("week","w"),Z("isoWeek","W"),A("week",5),A("isoWeek",5),dt("w",q),dt("ww",q,H),dt("W",q),dt("WW",q,H),ft(["w","ww","W","WW"],(function(t,e,i,n){e[n.substr(0,1)]=k(t)})),U("d",0,"do","day"),U("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),U("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),U("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),U("e",0,0,"weekday"),U("E",0,0,"isoWeekday"),Z("day","d"),Z("weekday","e"),Z("isoWeekday","E"),A("day",11),A("weekday",11),A("isoWeekday",11),dt("d",q),dt("e",q),dt("E",q),dt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),dt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),dt("dddd",(function(t,e){return e.weekdaysRegex(t)})),ft(["dd","ddd","dddd"],(function(t,e,i,n){var o=i._locale.weekdaysParse(t,n,i._strict);null!=o?e.d=o:m(i).invalidWeekday=t})),ft(["d","e","E"],(function(t,e,i,n){e[n]=k(t)}));var Yt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Et="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Rt="Su_Mo_Tu_We_Th_Fr_Sa".split("_");function Ut(t,e,i){var n,o,s,r=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)s=p([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(o=yt.call(this._weekdaysParse,r))?o:null:"ddd"===e?-1!==(o=yt.call(this._shortWeekdaysParse,r))?o:null:-1!==(o=yt.call(this._minWeekdaysParse,r))?o:null:"dddd"===e?-1!==(o=yt.call(this._weekdaysParse,r))||-1!==(o=yt.call(this._shortWeekdaysParse,r))||-1!==(o=yt.call(this._minWeekdaysParse,r))?o:null:"ddd"===e?-1!==(o=yt.call(this._shortWeekdaysParse,r))||-1!==(o=yt.call(this._weekdaysParse,r))||-1!==(o=yt.call(this._minWeekdaysParse,r))?o:null:-1!==(o=yt.call(this._minWeekdaysParse,r))||-1!==(o=yt.call(this._weekdaysParse,r))||-1!==(o=yt.call(this._shortWeekdaysParse,r))?o:null}var zt=lt,Vt=lt,jt=lt;function Ht(){function t(t,e){return e.length-t.length}var e,i,n,o,s,r=[],a=[],l=[],h=[];for(e=0;e<7;e++)i=p([2e3,1]).day(e),n=this.weekdaysMin(i,""),o=this.weekdaysShort(i,""),s=this.weekdays(i,""),r.push(n),a.push(o),l.push(s),h.push(n),h.push(o),h.push(s);for(r.sort(t),a.sort(t),l.sort(t),h.sort(t),e=0;e<7;e++)a[e]=ct(a[e]),l[e]=ct(l[e]),h[e]=ct(h[e]);this._weekdaysRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Pt(){return this.hours()%12||12}function Jt(t,e){U(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function Kt(t,e){return e._meridiemParse}U("H",["HH",2],0,"hour"),U("h",["hh",2],0,Pt),U("k",["kk",2],0,(function(){return this.hours()||24})),U("hmm",0,0,(function(){return""+Pt.apply(this)+X(this.minutes(),2)})),U("hmmss",0,0,(function(){return""+Pt.apply(this)+X(this.minutes(),2)+X(this.seconds(),2)})),U("Hmm",0,0,(function(){return""+this.hours()+X(this.minutes(),2)})),U("Hmmss",0,0,(function(){return""+this.hours()+X(this.minutes(),2)+X(this.seconds(),2)})),Jt("a",!0),Jt("A",!1),Z("hour","h"),A("hour",13),dt("a",Kt),dt("A",Kt),dt("H",q),dt("h",q),dt("k",q),dt("HH",q,H),dt("hh",q,H),dt("kk",q,H),dt("hmm",$),dt("hmmss",tt),dt("Hmm",$),dt("Hmmss",tt),mt(["H","HH"],3),mt(["k","kk"],(function(t,e,i){var n=k(t);e[3]=24===n?0:n})),mt(["a","A"],(function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t})),mt(["h","hh"],(function(t,e,i){e[3]=k(t),m(i).bigHour=!0})),mt("hmm",(function(t,e,i){var n=t.length-2;e[3]=k(t.substr(0,n)),e[4]=k(t.substr(n)),m(i).bigHour=!0})),mt("hmmss",(function(t,e,i){var n=t.length-4,o=t.length-2;e[3]=k(t.substr(0,n)),e[4]=k(t.substr(n,2)),e[5]=k(t.substr(o)),m(i).bigHour=!0})),mt("Hmm",(function(t,e,i){var n=t.length-2;e[3]=k(t.substr(0,n)),e[4]=k(t.substr(n))})),mt("Hmmss",(function(t,e,i){var n=t.length-4,o=t.length-2;e[3]=k(t.substr(0,n)),e[4]=k(t.substr(n,2)),e[5]=k(t.substr(o))}));var qt,$t=wt("Hours",!0),te={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ct,monthsShort:Lt,week:{dow:0,doy:6},weekdays:Yt,weekdaysMin:Rt,weekdaysShort:Et,meridiemParse:/[ap]\.?m?\.?/i},ee={},ie={};function ne(t){return t?t.toLowerCase().replace("_","-"):t}function oe(e){var n=null;if(!ee[e]&&t&&t.exports)try{n=qt._abbr,i(),se(n)}catch(t){}return ee[e]}function se(t,e){var i;return t&&((i=a(e)?ae(t):re(t,e))?qt=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),qt._abbr}function re(t,e){if(null!==e){var i,n=te;if(e.abbr=t,null!=ee[t])M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ee[t]._config;else if(null!=e.parentLocale)if(null!=ee[e.parentLocale])n=ee[e.parentLocale]._config;else{if(null==(i=oe(e.parentLocale)))return ie[e.parentLocale]||(ie[e.parentLocale]=[]),ie[e.parentLocale].push({name:t,config:e}),null;n=i._config}return ee[t]=new N(Q(n,e)),ie[t]&&ie[t].forEach((function(t){re(t.name,t.config)})),se(t),ee[t]}return delete ee[t],null}function ae(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return qt;if(!s(t)){if(e=oe(t))return e;t=[t]}return function(t){for(var e,i,n,o,s=0;s0;){if(n=oe(o.slice(0,e).join("-")))return n;if(i&&i.length>=e&&D(o,i,!0)>=e-1)break;e--}s++}return qt}(t)}function le(t){var e,i=t._a;return i&&-2===m(t).overflow&&(e=i[1]<0||i[1]>11?1:i[2]<1||i[2]>Dt(i[0],i[1])?2:i[3]<0||i[3]>24||24===i[3]&&(0!==i[4]||0!==i[5]||0!==i[6])?3:i[4]<0||i[4]>59?4:i[5]<0||i[5]>59?5:i[6]<0||i[6]>999?6:-1,m(t)._overflowDayOfYear&&(e<0||e>2)&&(e=2),m(t)._overflowWeeks&&-1===e&&(e=7),m(t)._overflowWeekday&&-1===e&&(e=8),m(t).overflow=e),t}function he(t,e,i){return null!=t?t:null!=e?e:i}function de(t){var e,i,n,s,r,a=[];if(!t._d){for(n=function(t){var e=new Date(o.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}(t),t._w&&null==t._a[2]&&null==t._a[1]&&function(t){var e,i,n,o,s,r,a,l;if(null!=(e=t._w).GG||null!=e.W||null!=e.E)s=1,r=4,i=he(e.GG,t._a[0],At(Ie(),1,4).year),n=he(e.W,1),((o=he(e.E,1))<1||o>7)&&(l=!0);else{s=t._locale._week.dow,r=t._locale._week.doy;var h=At(Ie(),s,r);i=he(e.gg,t._a[0],h.year),n=he(e.w,h.week),null!=e.d?((o=e.d)<0||o>6)&&(l=!0):null!=e.e?(o=e.e+s,(e.e<0||e.e>6)&&(l=!0)):o=s}n<1||n>Xt(i,s,r)?m(t)._overflowWeeks=!0:null!=l?m(t)._overflowWeekday=!0:(a=Wt(i,n,o,s,r),t._a[0]=a.year,t._dayOfYear=a.dayOfYear)}(t),null!=t._dayOfYear&&(r=he(t._a[0],n[0]),(t._dayOfYear>vt(r)||0===t._dayOfYear)&&(m(t)._overflowDayOfYear=!0),i=Bt(r,0,t._dayOfYear),t._a[1]=i.getUTCMonth(),t._a[2]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=n[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[3]&&0===t._a[4]&&0===t._a[5]&&0===t._a[6]&&(t._nextDay=!0,t._a[3]=0),t._d=(t._useUTC?Bt:Zt).apply(null,a),s=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[3]=24),t._w&&void 0!==t._w.d&&t._w.d!==s&&(m(t).weekdayMismatch=!0)}}var ue=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ce=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,pe=/Z|[+-]\d\d(?::?\d\d)?/,me=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],fe=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ge=/^\/?Date\((\-?\d+)/i;function ve(t){var e,i,n,o,s,r,a=t._i,l=ue.exec(a)||ce.exec(a);if(l){for(m(t).iso=!0,e=0,i=me.length;e0&&m(t).unusedInput.push(r),a=a.slice(a.indexOf(i)+i.length),h+=i.length),R[s]?(i?m(t).empty=!1:m(t).unusedTokens.push(s),gt(s,i,t)):t._strict&&!i&&m(t).unusedTokens.push(s);m(t).charsLeftOver=l-h,a.length>0&&m(t).unusedInput.push(a),t._a[3]<=12&&!0===m(t).bigHour&&t._a[3]>0&&(m(t).bigHour=void 0),m(t).parsedDateParts=t._a.slice(0),m(t).meridiem=t._meridiem,t._a[3]=function(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?((n=t.isPM(i))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}(t._locale,t._a[3],t._meridiem),de(t),le(t)}else we(t);else ve(t)}function ke(t){var e=t._i,i=t._f;return t._locale=t._locale||ae(t._l),null===e||void 0===i&&""===e?g({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),w(e)?new x(le(e)):(h(e)?t._d=e:s(i)?function(t){var e,i,n,o,s;if(0===t._f.length)return m(t).invalidFormat=!0,void(t._d=new Date(NaN));for(o=0;othis?this:t:g()}));function Ge(t,e){var i,n;if(1===e.length&&s(e[0])&&(e=e[0]),!e.length)return Ie();for(i=e[0],n=1;n=0?new Date(t+400,e,i)-126227808e5:new Date(t,e,i).valueOf()}function ti(t,e,i){return t<100&&t>=0?Date.UTC(t+400,e,i)-126227808e5:Date.UTC(t,e,i)}function ei(t,e){U(0,[t,t.length],0,e)}function ii(t,e,i,n,o){var s;return null==t?At(this,n,o).year:(e>(s=Xt(t,n,o))&&(e=s),ni.call(this,t,e,i,n,o))}function ni(t,e,i,n,o){var s=Wt(t,e,i,n,o),r=Bt(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}U(0,["gg",2],0,(function(){return this.weekYear()%100})),U(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),ei("gggg","weekYear"),ei("ggggg","weekYear"),ei("GGGG","isoWeekYear"),ei("GGGGG","isoWeekYear"),Z("weekYear","gg"),Z("isoWeekYear","GG"),A("weekYear",1),A("isoWeekYear",1),dt("G",st),dt("g",st),dt("GG",q,H),dt("gg",q,H),dt("GGGG",it,J),dt("gggg",it,J),dt("GGGGG",nt,K),dt("ggggg",nt,K),ft(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,i,n){e[n.substr(0,2)]=k(t)})),ft(["gg","GG"],(function(t,e,i,n){e[n]=o.parseTwoDigitYear(t)})),U("Q",0,"Qo","quarter"),Z("quarter","Q"),A("quarter",7),dt("Q",j),mt("Q",(function(t,e){e[1]=3*(k(t)-1)})),U("D",["DD",2],"Do","date"),Z("date","D"),A("date",9),dt("D",q),dt("DD",q,H),dt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),mt(["D","DD"],2),mt("Do",(function(t,e){e[2]=k(t.match(q)[0])}));var oi=wt("Date",!0);U("DDD",["DDDD",3],"DDDo","dayOfYear"),Z("dayOfYear","DDD"),A("dayOfYear",4),dt("DDD",et),dt("DDDD",P),mt(["DDD","DDDD"],(function(t,e,i){i._dayOfYear=k(t)})),U("m",["mm",2],0,"minute"),Z("minute","m"),A("minute",14),dt("m",q),dt("mm",q,H),mt(["m","mm"],4);var si=wt("Minutes",!1);U("s",["ss",2],0,"second"),Z("second","s"),A("second",15),dt("s",q),dt("ss",q,H),mt(["s","ss"],5);var ri,ai=wt("Seconds",!1);for(U("S",0,0,(function(){return~~(this.millisecond()/100)})),U(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),U(0,["SSS",3],0,"millisecond"),U(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),U(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),U(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),U(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),U(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),U(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),Z("millisecond","ms"),A("millisecond",16),dt("S",et,j),dt("SS",et,H),dt("SSS",et,P),ri="SSSS";ri.length<=9;ri+="S")dt(ri,ot);function li(t,e){e[6]=k(1e3*("0."+t))}for(ri="S";ri.length<=9;ri+="S")mt(ri,li);var hi=wt("Milliseconds",!1);U("z",0,0,"zoneAbbr"),U("zz",0,0,"zoneName");var di=x.prototype;function ui(t){return t}di.add=Ve,di.calendar=function(t,e){var i=t||Ie(),n=Oe(i,this).startOf("day"),s=o.calendarFormat(this,n)||"sameElse",r=e&&(S(e[s])?e[s].call(this,i):e[s]);return this.format(r||this.localeData().calendar(s,this,Ie(i)))},di.clone=function(){return new x(this)},di.diff=function(t,e,i){var n,o,s;if(!this.isValid())return NaN;if(!(n=Oe(t,this)).isValid())return NaN;switch(o=6e4*(n.utcOffset()-this.utcOffset()),e=B(e)){case"year":s=He(this,n)/12;break;case"month":s=He(this,n);break;case"quarter":s=He(this,n)/3;break;case"second":s=(this-n)/1e3;break;case"minute":s=(this-n)/6e4;break;case"hour":s=(this-n)/36e5;break;case"day":s=(this-n-o)/864e5;break;case"week":s=(this-n-o)/6048e5;break;default:s=this-n}return i?s:_(s)},di.endOf=function(t){var e;if(void 0===(t=B(t))||"millisecond"===t||!this.isValid())return this;var i=this._isUTC?ti:$e;switch(t){case"year":e=i(this.year()+1,0,1)-1;break;case"quarter":e=i(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=i(this.year(),this.month()+1,1)-1;break;case"week":e=i(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=i(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=i(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=36e5-qe(e+(this._isUTC?0:6e4*this.utcOffset()),36e5)-1;break;case"minute":e=this._d.valueOf(),e+=6e4-qe(e,6e4)-1;break;case"second":e=this._d.valueOf(),e+=1e3-qe(e,1e3)-1}return this._d.setTime(e),o.updateOffset(this,!0),this},di.format=function(t){t||(t=this.isUtc()?o.defaultFormatUtc:o.defaultFormat);var e=z(this,t);return this.localeData().postformat(e)},di.from=function(t,e){return this.isValid()&&(w(t)&&t.isValid()||Ie(t).isValid())?Ye({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},di.fromNow=function(t){return this.from(Ie(),t)},di.to=function(t,e){return this.isValid()&&(w(t)&&t.isValid()||Ie(t).isValid())?Ye({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()},di.toNow=function(t){return this.to(Ie(),t)},di.get=function(t){return S(this[t=B(t)])?this[t]():this},di.invalidAt=function(){return m(this).overflow},di.isAfter=function(t,e){var i=w(t)?t:Ie(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=B(e)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()9999?z(i,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):S(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",z(i,"Z")):z(i,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},di.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t="moment",e="";this.isLocal()||(t=0===this.utcOffset()?"moment.utc":"moment.parseZone",e="Z");var i="["+t+'("]',n=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",o=e+'[")]';return this.format(i+n+"-MM-DD[T]HH:mm:ss.SSS"+o)},di.toJSON=function(){return this.isValid()?this.toISOString():null},di.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},di.unix=function(){return Math.floor(this.valueOf()/1e3)},di.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},di.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},di.year=xt,di.isLeapYear=function(){return bt(this.year())},di.weekYear=function(t){return ii.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},di.isoWeekYear=function(t){return ii.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)},di.quarter=di.quarters=function(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)},di.month=St,di.daysInMonth=function(){return Dt(this.year(),this.month())},di.week=di.weeks=function(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")},di.isoWeek=di.isoWeeks=function(t){var e=At(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")},di.weeksInYear=function(){var t=this.localeData()._week;return Xt(this.year(),t.dow,t.doy)},di.isoWeeksInYear=function(){return Xt(this.year(),1,4)},di.date=oi,di.day=di.days=function(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=function(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}(t,this.localeData()),this.add(t-e,"d")):e},di.weekday=function(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")},di.isoWeekday=function(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=function(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7},di.dayOfYear=function(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")},di.hour=di.hours=$t,di.minute=di.minutes=si,di.second=di.seconds=ai,di.millisecond=di.milliseconds=hi,di.utcOffset=function(t,e,i){var n,s=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=Be(at,t)))return this}else Math.abs(t)<16&&!i&&(t*=60);return!this._isUTC&&e&&(n=We(this)),this._offset=t,this._isUTC=!0,null!=n&&this.add(n,"m"),s!==t&&(!e||this._changeInProgress?ze(this,Ye(t-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,o.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:We(this)},di.utc=function(t){return this.utcOffset(0,t)},di.local=function(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(We(this),"m")),this},di.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=Be(rt,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this},di.hasAlignedHourOffset=function(t){return!!this.isValid()&&(t=t?Ie(t).utcOffset():0,(this.utcOffset()-t)%60==0)},di.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},di.isLocal=function(){return!!this.isValid()&&!this._isUTC},di.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},di.isUtc=Ae,di.isUTC=Ae,di.zoneAbbr=function(){return this._isUTC?"UTC":""},di.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},di.dates=C("dates accessor is deprecated. Use date instead.",oi),di.months=C("months accessor is deprecated. Use month instead",St),di.years=C("years accessor is deprecated. Use year instead",xt),di.zone=C("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",(function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()})),di.isDSTShifted=C("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",(function(){if(!a(this._isDSTShifted))return this._isDSTShifted;var t={};if(b(t,this),(t=ke(t))._a){var e=t._isUTC?p(t._a):Ie(t._a);this._isDSTShifted=this.isValid()&&D(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}));var ci=N.prototype;function pi(t,e,i,n){var o=ae(),s=p().set(n,e);return o[i](s,t)}function mi(t,e,i){if(l(t)&&(e=t,t=void 0),t=t||"",null!=e)return pi(t,e,i,"month");var n,o=[];for(n=0;n<12;n++)o[n]=pi(t,n,i,"month");return o}function fi(t,e,i,n){"boolean"==typeof t?(l(e)&&(i=e,e=void 0),e=e||""):(i=e=t,t=!1,l(e)&&(i=e,e=void 0),e=e||"");var o,s=ae(),r=t?s._week.dow:0;if(null!=i)return pi(e,(i+r)%7,n,"day");var a=[];for(o=0;o<7;o++)a[o]=pi(e,(o+r)%7,n,"day");return a}ci.calendar=function(t,e,i){var n=this._calendar[t]||this._calendar.sameElse;return S(n)?n.call(e,i):n},ci.longDateFormat=function(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.replace(/MMMM|MM|DD|dddd/g,(function(t){return t.slice(1)})),this._longDateFormat[t])},ci.invalidDate=function(){return this._invalidDate},ci.ordinal=function(t){return this._ordinal.replace("%d",t)},ci.preparse=ui,ci.postformat=ui,ci.relativeTime=function(t,e,i,n){var o=this._relativeTime[i];return S(o)?o(t,e,i,n):o.replace(/%d/i,t)},ci.pastFuture=function(t,e){var i=this._relativeTime[t>0?"future":"past"];return S(i)?i(e):i.replace(/%s/i,e)},ci.set=function(t){var e,i;for(i in t)S(e=t[i])?this[i]=e:this["_"+i]=e;this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},ci.months=function(t,e){return t?s(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||It).test(e)?"format":"standalone"][t.month()]:s(this._months)?this._months:this._months.standalone},ci.monthsShort=function(t,e){return t?s(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[It.test(e)?"format":"standalone"][t.month()]:s(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},ci.monthsParse=function(t,e,i){var n,o,s;if(this._monthsParseExact)return Gt.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(o=p([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(s="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[n]=new RegExp(s.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(i&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!i&&this._monthsParse[n].test(t))return n}},ci.monthsRegex=function(t){return this._monthsParseExact?(u(this,"_monthsRegex")||Ft.call(this),t?this._monthsStrictRegex:this._monthsRegex):(u(this,"_monthsRegex")||(this._monthsRegex=Nt),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)},ci.monthsShortRegex=function(t){return this._monthsParseExact?(u(this,"_monthsRegex")||Ft.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(u(this,"_monthsShortRegex")||(this._monthsShortRegex=Qt),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)},ci.week=function(t){return At(t,this._week.dow,this._week.doy).week},ci.firstDayOfYear=function(){return this._week.doy},ci.firstDayOfWeek=function(){return this._week.dow},ci.weekdays=function(t,e){var i=s(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Tt(i,this._week.dow):t?i[t.day()]:i},ci.weekdaysMin=function(t){return!0===t?Tt(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin},ci.weekdaysShort=function(t){return!0===t?Tt(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort},ci.weekdaysParse=function(t,e,i){var n,o,s;if(this._weekdaysParseExact)return Ut.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(o=p([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(s="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[n]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(i&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(i&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!i&&this._weekdaysParse[n].test(t))return n}},ci.weekdaysRegex=function(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Ht.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=zt),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)},ci.weekdaysShortRegex=function(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Ht.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Vt),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},ci.weekdaysMinRegex=function(t){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Ht.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=jt),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},ci.isPM=function(t){return"p"===(t+"").toLowerCase().charAt(0)},ci.meridiem=function(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"},se("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===k(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),o.lang=C("moment.lang is deprecated. Use moment.locale instead.",se),o.langData=C("moment.langData is deprecated. Use moment.localeData instead.",ae);var gi=Math.abs;function vi(t,e,i,n){var o=Ye(e,i);return t._milliseconds+=n*o._milliseconds,t._days+=n*o._days,t._months+=n*o._months,t._bubble()}function bi(t){return t<0?Math.floor(t):Math.ceil(t)}function yi(t){return 4800*t/146097}function xi(t){return 146097*t/4800}function wi(t){return function(){return this.as(t)}}var _i=wi("ms"),ki=wi("s"),Di=wi("m"),Ii=wi("h"),Ci=wi("d"),Li=wi("w"),Gi=wi("M"),Mi=wi("Q"),Si=wi("y");function Qi(t){return function(){return this.isValid()?this._data[t]:NaN}}var Ni=Qi("milliseconds"),Fi=Qi("seconds"),Zi=Qi("minutes"),Bi=Qi("hours"),Oi=Qi("days"),Wi=Qi("months"),Ai=Qi("years"),Xi=Math.round,Ti={ss:44,s:45,m:45,h:22,d:26,M:11};function Yi(t,e,i,n,o){return o.relativeTime(e||1,!!i,t,n)}function Ei(t,e,i){var n=Ye(t).abs(),o=Xi(n.as("s")),s=Xi(n.as("m")),r=Xi(n.as("h")),a=Xi(n.as("d")),l=Xi(n.as("M")),h=Xi(n.as("y")),d=o<=Ti.ss&&["s",o]||o0,d[4]=i,Yi.apply(null,d)}var Ri=Math.abs;function Ui(t){return(t>0)-(t<0)||+t}function zi(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i=Ri(this._milliseconds)/1e3,n=Ri(this._days),o=Ri(this._months);t=_(i/60),e=_(t/60),i%=60,t%=60;var s=_(o/12),r=o%=12,a=n,l=e,h=t,d=i?i.toFixed(3).replace(/\.?0+$/,""):"",u=this.asSeconds();if(!u)return"P0D";var c=u<0?"-":"",p=Ui(this._months)!==Ui(u)?"-":"",m=Ui(this._days)!==Ui(u)?"-":"",f=Ui(this._milliseconds)!==Ui(u)?"-":"";return c+"P"+(s?p+s+"Y":"")+(r?p+r+"M":"")+(a?m+a+"D":"")+(l||h||d?"T":"")+(l?f+l+"H":"")+(h?f+h+"M":"")+(d?f+d+"S":"")}var Vi=Se.prototype;return Vi.isValid=function(){return this._isValid},Vi.abs=function(){var t=this._data;return this._milliseconds=gi(this._milliseconds),this._days=gi(this._days),this._months=gi(this._months),t.milliseconds=gi(t.milliseconds),t.seconds=gi(t.seconds),t.minutes=gi(t.minutes),t.hours=gi(t.hours),t.months=gi(t.months),t.years=gi(t.years),this},Vi.add=function(t,e){return vi(this,t,e,1)},Vi.subtract=function(t,e){return vi(this,t,e,-1)},Vi.as=function(t){if(!this.isValid())return NaN;var e,i,n=this._milliseconds;if("month"===(t=B(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,i=this._months+yi(e),t){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(e=this._days+Math.round(xi(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}},Vi.asMilliseconds=_i,Vi.asSeconds=ki,Vi.asMinutes=Di,Vi.asHours=Ii,Vi.asDays=Ci,Vi.asWeeks=Li,Vi.asMonths=Gi,Vi.asQuarters=Mi,Vi.asYears=Si,Vi.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*k(this._months/12):NaN},Vi._bubble=function(){var t,e,i,n,o,s=this._milliseconds,r=this._days,a=this._months,l=this._data;return s>=0&&r>=0&&a>=0||s<=0&&r<=0&&a<=0||(s+=864e5*bi(xi(a)+r),r=0,a=0),l.milliseconds=s%1e3,t=_(s/1e3),l.seconds=t%60,e=_(t/60),l.minutes=e%60,i=_(e/60),l.hours=i%24,r+=_(i/24),o=_(yi(r)),a+=o,r-=bi(xi(o)),n=_(a/12),a%=12,l.days=r,l.months=a,l.years=n,this},Vi.clone=function(){return Ye(this)},Vi.get=function(t){return t=B(t),this.isValid()?this[t+"s"]():NaN},Vi.milliseconds=Ni,Vi.seconds=Fi,Vi.minutes=Zi,Vi.hours=Bi,Vi.days=Oi,Vi.weeks=function(){return _(this.days()/7)},Vi.months=Wi,Vi.years=Ai,Vi.humanize=function(t){if(!this.isValid())return this.localeData().invalidDate();var e=this.localeData(),i=Ei(this,!t,e);return t&&(i=e.pastFuture(+this,i)),e.postformat(i)},Vi.toISOString=zi,Vi.toString=zi,Vi.toJSON=zi,Vi.locale=Pe,Vi.localeData=Ke,Vi.toIsoString=C("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",zi),Vi.lang=Je,U("X",0,0,"unix"),U("x",0,0,"valueOf"),dt("x",st),dt("X",/[+-]?\d+(\.\d{1,3})?/),mt("X",(function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))})),mt("x",(function(t,e,i){i._d=new Date(k(t))})),o.version="2.24.0",e=Ie,o.fn=di,o.min=function(){var t=[].slice.call(arguments,0);return Ge("isBefore",t)},o.max=function(){var t=[].slice.call(arguments,0);return Ge("isAfter",t)},o.now=function(){return Date.now?Date.now():+new Date},o.utc=p,o.unix=function(t){return Ie(1e3*t)},o.months=function(t,e){return mi(t,e,"months")},o.isDate=h,o.locale=se,o.invalid=g,o.duration=Ye,o.isMoment=w,o.weekdays=function(t,e,i){return fi(t,e,i,"weekdays")},o.parseZone=function(){return Ie.apply(null,arguments).parseZone()},o.localeData=ae,o.isDuration=Qe,o.monthsShort=function(t,e){return mi(t,e,"monthsShort")},o.weekdaysMin=function(t,e,i){return fi(t,e,i,"weekdaysMin")},o.defineLocale=re,o.updateLocale=function(t,e){if(null!=e){var i,n,o=te;null!=(n=oe(t))&&(o=n._config),(i=new N(e=Q(o,e))).parentLocale=ee[t],ee[t]=i,se(t)}else null!=ee[t]&&(null!=ee[t].parentLocale?ee[t]=ee[t].parentLocale:null!=ee[t]&&delete ee[t]);return ee[t]},o.locales=function(){return L(ee)},o.weekdaysShort=function(t,e,i){return fi(t,e,i,"weekdaysShort")},o.normalizeUnits=B,o.relativeTimeRounding=function(t){return void 0===t?Xi:"function"==typeof t&&(Xi=t,!0)},o.relativeTimeThreshold=function(t,e){return void 0!==Ti[t]&&(void 0===e?Ti[t]:(Ti[t]=e,"s"===t&&(Ti.ss=e-1),!0))},o.calendarFormat=function(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"},o.prototype=di,o.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},o}()})),r=(n((function(t,e){(function(t){function e(t,e,i,n){var o={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[t+" Tage",t+" Tagen"],M:["ein Monat","einem Monat"],MM:[t+" Monate",t+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[t+" Jahre",t+" Jahren"]};return e?o[i][0]:o[i][1]}t.defineLocale("de",{months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),monthsParseExact:!0,weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},calendar:{sameDay:"[heute um] LT [Uhr]",sameElse:"L",nextDay:"[morgen um] LT [Uhr]",nextWeek:"dddd [um] LT [Uhr]",lastDay:"[gestern um] LT [Uhr]",lastWeek:"[letzten] dddd [um] LT [Uhr]"},relativeTime:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",ss:"%d Sekunden",m:e,mm:"%d Minuten",h:e,hh:"%d Stunden",d:e,dd:e,M:e,MM:e,y:e,yy:e},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(s)})),n((function(t,e){(function(t){var e="ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.".split("_"),i="ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),n=[/^ene/i,/^feb/i,/^mar/i,/^abr/i,/^may/i,/^jun/i,/^jul/i,/^ago/i,/^sep/i,/^oct/i,/^nov/i,/^dic/i],o=/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre|ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i;t.defineLocale("es",{months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:function(t,n){return t?/-MMM-/.test(n)?i[t.month()]:e[t.month()]:e},monthsRegex:o,monthsShortRegex:o,monthsStrictRegex:/^(enero|febrero|marzo|abril|mayo|junio|julio|agosto|septiembre|octubre|noviembre|diciembre)/i,monthsShortStrictRegex:/^(ene\.?|feb\.?|mar\.?|abr\.?|may\.?|jun\.?|jul\.?|ago\.?|sep\.?|oct\.?|nov\.?|dic\.?)/i,monthsParse:n,longMonthsParse:n,shortMonthsParse:n,weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},calendar:{sameDay:function(){return"[hoy a la"+(1!==this.hours()?"s":"")+"] LT"},nextDay:function(){return"[mañana a la"+(1!==this.hours()?"s":"")+"] LT"},nextWeek:function(){return"dddd [a la"+(1!==this.hours()?"s":"")+"] LT"},lastDay:function(){return"[ayer a la"+(1!==this.hours()?"s":"")+"] LT"},lastWeek:function(){return"[el] dddd [pasado a la"+(1!==this.hours()?"s":"")+"] LT"},sameElse:"L"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})(s)})),n((function(t,e){(function(t){t.defineLocale("fr",{months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),monthsParseExact:!0,weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Aujourd’hui à] LT",nextDay:"[Demain à] LT",nextWeek:"dddd [à] LT",lastDay:"[Hier à] LT",lastWeek:"dddd [dernier à] LT",sameElse:"L"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},dayOfMonthOrdinalParse:/\d{1,2}(er|)/,ordinal:function(t,e){switch(e){case"D":return t+(1===t?"er":"");default:case"M":case"Q":case"DDD":case"d":return t+(1===t?"er":"e");case"w":case"W":return t+(1===t?"re":"e")}},week:{dow:1,doy:4}})})(s)})),n((function(t,e){(function(t){t.defineLocale("it",{months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},calendar:{sameDay:"[Oggi alle] LT",nextDay:"[Domani alle] LT",nextWeek:"dddd [alle] LT",lastDay:"[Ieri alle] LT",lastWeek:function(){switch(this.day()){case 0:return"[la scorsa] dddd [alle] LT";default:return"[lo scorso] dddd [alle] LT"}},sameElse:"L"},relativeTime:{future:function(t){return(/^[0-9].+$/.test(t)?"tra":"in")+" "+t},past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},dayOfMonthOrdinalParse:/\d{1,2}º/,ordinal:"%dº",week:{dow:1,doy:4}})})(s)})),n((function(t,e){(function(t){t.defineLocale("ja",{months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiemParse:/午前|午後/i,isPM:function(t){return"午後"===t},meridiem:function(t,e,i){return t<12?"午前":"午後"},calendar:{sameDay:"[今日] LT",nextDay:"[明日] LT",nextWeek:function(t){return t.week()=20?"ste":"de")},week:{dow:1,doy:4}})})(s)})),n((function(t,e){(function(t){var e="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),i="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_");function n(t){return t%10<5&&t%10>1&&~~(t/10)%10!=1}function o(t,e,i){var o=t+" ";switch(i){case"ss":return o+(n(t)?"sekundy":"sekund");case"m":return e?"minuta":"minutę";case"mm":return o+(n(t)?"minuty":"minut");case"h":return e?"godzina":"godzinę";case"hh":return o+(n(t)?"godziny":"godzin");case"MM":return o+(n(t)?"miesiące":"miesięcy");case"yy":return o+(n(t)?"lata":"lat")}}t.defineLocale("pl",{months:function(t,n){return t?""===n?"("+i[t.month()]+"|"+e[t.month()]+")":/D MMMM/.test(n)?i[t.month()]:e[t.month()]:e},monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},calendar:{sameDay:"[Dziś o] LT",nextDay:"[Jutro o] LT",nextWeek:function(){switch(this.day()){case 0:return"[W niedzielę o] LT";case 2:return"[We wtorek o] LT";case 3:return"[W środę o] LT";case 6:return"[W sobotę o] LT";default:return"[W] dddd [o] LT"}},lastDay:"[Wczoraj o] LT",lastWeek:function(){switch(this.day()){case 0:return"[W zeszłą niedzielę o] LT";case 3:return"[W zeszłą środę o] LT";case 6:return"[W zeszłą sobotę o] LT";default:return"[W zeszły] dddd [o] LT"}},sameElse:"L"},relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",ss:o,m:o,mm:o,h:o,hh:o,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:o,y:"rok",yy:o},dayOfMonthOrdinalParse:/\d{1,2}\./,ordinal:"%d.",week:{dow:1,doy:4}})})(s)})),n((function(t,e){(function(t){function e(t,e,i){var n,o;return"m"===i?e?"минута":"минуту":t+" "+(n=+t,o={ss:e?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:e?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[i].split("_"),n%10==1&&n%100!=11?o[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?o[1]:o[2])}var i=[/^янв/i,/^фев/i,/^мар/i,/^апр/i,/^ма[йя]/i,/^июн/i,/^июл/i,/^авг/i,/^сен/i,/^окт/i,/^ноя/i,/^дек/i];t.defineLocale("ru",{months:{format:"января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),standalone:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_")},monthsShort:{format:"янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),standalone:"янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_")},weekdays:{standalone:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),format:"воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу".split("_"),isFormat:/\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/},weekdaysShort:"вс_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),monthsParse:i,longMonthsParse:i,shortMonthsParse:i,monthsRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsShortRegex:/^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i,monthsStrictRegex:/^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i,monthsShortStrictRegex:/^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i,longDateFormat:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},calendar:{sameDay:"[Сегодня, в] LT",nextDay:"[Завтра, в] LT",lastDay:"[Вчера, в] LT",nextWeek:function(t){if(t.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В следующее] dddd, [в] LT";case 1:case 2:case 4:return"[В следующий] dddd, [в] LT";case 3:case 5:case 6:return"[В следующую] dddd, [в] LT"}},lastWeek:function(t){if(t.week()===this.week())return 2===this.day()?"[Во] dddd, [в] LT":"[В] dddd, [в] LT";switch(this.day()){case 0:return"[В прошлое] dddd, [в] LT";case 1:case 2:case 4:return"[В прошлый] dddd, [в] LT";case 3:case 5:case 6:return"[В прошлую] dddd, [в] LT"}},sameElse:"L"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:e,m:e,mm:e,h:"час",hh:e,d:"день",dd:e,M:"месяц",MM:e,y:"год",yy:e},meridiemParse:/ночи|утра|дня|вечера/i,isPM:function(t){return/^(дня|вечера)$/.test(t)},meridiem:function(t,e,i){return t<4?"ночи":t<12?"утра":t<17?"дня":"вечера"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го|я)/,ordinal:function(t,e){switch(e){case"M":case"d":case"DDD":return t+"-й";case"D":return t+"-го";case"w":case"W":return t+"-я";default:return t}},week:{dow:1,doy:4}})})(s)})),n((function(t,e){(function(t){function e(t,e,i){var n,o;return"m"===i?e?"хвилина":"хвилину":"h"===i?e?"година":"годину":t+" "+(n=+t,o={ss:e?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:e?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:e?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[i].split("_"),n%10==1&&n%100!=11?o[0]:n%10>=2&&n%10<=4&&(n%100<10||n%100>=20)?o[1]:o[2])}function i(t){return function(){return t+"о"+(11===this.hours()?"б":"")+"] LT"}}t.defineLocale("uk",{months:{format:"січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),standalone:"січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_")},monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekdays:function(t,e){var i={nominative:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),accusative:"неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу".split("_"),genitive:"неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи".split("_")};return!0===t?i.nominative.slice(1,7).concat(i.nominative.slice(0,1)):t?i[/(\[[ВвУу]\]) ?dddd/.test(e)?"accusative":/\[?(?:минулої|наступної)? ?\] ?dddd/.test(e)?"genitive":"nominative"][t.day()]:i.nominative},weekdaysShort:"нд_пн_вт_ср_чт_пт_сб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"},calendar:{sameDay:i("[Сьогодні "),nextDay:i("[Завтра "),lastDay:i("[Вчора "),nextWeek:i("[У] dddd ["),lastWeek:function(){switch(this.day()){case 0:case 3:case 5:case 6:return i("[Минулої] dddd [").call(this);case 1:case 2:case 4:return i("[Минулого] dddd [").call(this)}},sameElse:"L"},relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",ss:e,m:e,mm:e,h:"годину",hh:e,d:"день",dd:e,M:"місяць",MM:e,y:"рік",yy:e},meridiemParse:/ночі|ранку|дня|вечора/,isPM:function(t){return/^(дня|вечора)$/.test(t)},meridiem:function(t,e,i){return t<4?"ночі":t<12?"ранку":t<17?"дня":"вечора"},dayOfMonthOrdinalParse:/\d{1,2}-(й|го)/,ordinal:function(t,e){switch(e){case"M":case"d":case"DDD":case"w":case"W":return t+"-й";case"D":return t+"-го";default:return t}},week:{dow:1,doy:7}})})(s)})),function(t){return t&&t.Math==Math&&t}),a=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||Function("return this")(),l=function(t){try{return!!t()}catch(t){return!0}},h=!l((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),d={}.propertyIsEnumerable,u=Object.getOwnPropertyDescriptor,c={f:u&&!d.call({1:2},1)?function(t){var e=u(this,t);return!!e&&e.enumerable}:d},p=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},m={}.toString,f=function(t){return m.call(t).slice(8,-1)},g="".split,v=l((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==f(t)?g.call(t,""):Object(t)}:Object,b=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},y=function(t){return v(b(t))},x=function(t){return"object"==typeof t?null!==t:"function"==typeof t},w=function(t,e){if(!x(t))return t;var i,n;if(e&&"function"==typeof(i=t.toString)&&!x(n=i.call(t)))return n;if("function"==typeof(i=t.valueOf)&&!x(n=i.call(t)))return n;if(!e&&"function"==typeof(i=t.toString)&&!x(n=i.call(t)))return n;throw TypeError("Can't convert object to primitive value")},_={}.hasOwnProperty,k=function(t,e){return _.call(t,e)},D=a.document,I=x(D)&&x(D.createElement),C=function(t){return I?D.createElement(t):{}},L=!h&&!l((function(){return 7!=Object.defineProperty(C("div"),"a",{get:function(){return 7}}).a})),G=Object.getOwnPropertyDescriptor,M={f:h?G:function(t,e){if(t=y(t),e=w(e,!0),L)try{return G(t,e)}catch(t){}if(k(t,e))return p(!c.f.call(t,e),t[e])}},S=/#|\.prototype\./,Q=function(t,e){var i=F[N(t)];return i==B||i!=Z&&("function"==typeof e?l(e):!!e)},N=Q.normalize=function(t){return String(t).replace(S,".").toLowerCase()},F=Q.data={},Z=Q.NATIVE="N",B=Q.POLYFILL="P",O=Q,W={},A=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},X=function(t,e,i){if(A(t),void 0===e)return t;switch(i){case 0:return function(){return t.call(e)};case 1:return function(i){return t.call(e,i)};case 2:return function(i,n){return t.call(e,i,n)};case 3:return function(i,n,o){return t.call(e,i,n,o)}}return function(){return t.apply(e,arguments)}},T=function(t){if(!x(t))throw TypeError(String(t)+" is not an object");return t},Y=Object.defineProperty,E={f:h?Y:function(t,e,i){if(T(t),e=w(e,!0),T(i),L)try{return Y(t,e,i)}catch(t){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},R=h?function(t,e,i){return E.f(t,e,p(1,i))}:function(t,e,i){return t[e]=i,t},U=M.f,z=function(t){var e=function(e,i,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,i)}return new t(e,i,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e},V=function(t,e){var i,n,o,s,r,l,h,d,u=t.target,c=t.global,p=t.stat,m=t.proto,f=c?a:p?a[u]:(a[u]||{}).prototype,g=c?W:W[u]||(W[u]={}),v=g.prototype;for(o in e)i=!O(c?o:u+(p?".":"#")+o,t.forced)&&f&&k(f,o),r=g[o],i&&(l=t.noTargetGet?(d=U(f,o))&&d.value:f[o]),s=i&&l?l:e[o],i&&typeof r==typeof s||(h=t.bind&&i?X(s,a):t.wrap&&i?z(s):m&&"function"==typeof s?X(Function.call,s):s,(t.sham||s&&s.sham||r&&r.sham)&&R(h,"sham",!0),g[o]=h,m&&(k(W,n=u+"Prototype")||R(W,n,{}),W[n][o]=s,t.real&&v&&!v[o]&&R(v,o,s)))};V({target:"Object",stat:!0,forced:!h,sham:!h},{defineProperty:E.f});var j=n((function(t){var e=W.Object,i=t.exports=function(t,i,n){return e.defineProperty(t,i,n)};e.defineProperty.sham&&(i.sham=!0)})),H=j,P=Math.ceil,J=Math.floor,K=function(t){return isNaN(t=+t)?0:(t>0?J:P)(t)},q=Math.min,$=function(t){return t>0?q(K(t),9007199254740991):0},tt=Math.max,et=Math.min,it=function(t,e){var i=K(t);return i<0?tt(i+e,0):et(i,e)},nt=function(t){return function(e,i,n){var o,s=y(e),r=$(s.length),a=it(n,r);if(t&&i!=i){for(;r>a;)if((o=s[a++])!=o)return!0}else for(;r>a;a++)if((t||a in s)&&s[a]===i)return t||a||0;return!t&&-1}},ot={includes:nt(!0),indexOf:nt(!1)},st={},rt=ot.indexOf,at=function(t,e){var i,n=y(t),o=0,s=[];for(i in n)!k(st,i)&&k(n,i)&&s.push(i);for(;e.length>o;)k(n,i=e[o++])&&(~rt(s,i)||s.push(i));return s},lt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ht=Object.keys||function(t){return at(t,lt)},dt=h?Object.defineProperties:function(t,e){T(t);for(var i,n=ht(e),o=n.length,s=0;o>s;)E.f(t,i=n[s++],e[i]);return t};V({target:"Object",stat:!0,forced:!h,sham:!h},{defineProperties:dt});var ut=n((function(t){var e=W.Object,i=t.exports=function(t,i){return e.defineProperties(t,i)};e.defineProperties.sham&&(i.sham=!0)})),ct=function(t){return"function"==typeof t?t:void 0},pt=function(t,e){return arguments.length<2?ct(W[t])||ct(a[t]):W[t]&&W[t][e]||a[t]&&a[t][e]},mt=lt.concat("length","prototype"),ft={f:Object.getOwnPropertyNames||function(t){return at(t,mt)}},gt={f:Object.getOwnPropertySymbols},vt=pt("Reflect","ownKeys")||function(t){var e=ft.f(T(t)),i=gt.f;return i?e.concat(i(t)):e},bt=function(t,e,i){var n=w(e);n in t?E.f(t,n,p(0,i)):t[n]=i};V({target:"Object",stat:!0,sham:!h},{getOwnPropertyDescriptors:function(t){for(var e,i,n=y(t),o=M.f,s=vt(n),r={},a=0;s.length>a;)void 0!==(i=o(n,e=s[a++]))&&bt(r,e,i);return r}});var yt=W.Object.getOwnPropertyDescriptors,xt=M.f,wt=l((function(){xt(1)}));V({target:"Object",stat:!0,forced:!h||wt,sham:!h},{getOwnPropertyDescriptor:function(t,e){return xt(y(t),e)}});var _t,kt=n((function(t){var e=W.Object,i=t.exports=function(t,i){return e.getOwnPropertyDescriptor(t,i)};e.getOwnPropertyDescriptor.sham&&(i.sham=!0)})),Dt=!!Object.getOwnPropertySymbols&&!l((function(){return!String(Symbol())})),It=Dt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,Ct=Array.isArray||function(t){return"Array"==f(t)},Lt=function(t){return Object(b(t))},Gt=pt("document","documentElement"),Mt=a["__core-js_shared__"]||function(t,e){try{R(a,t,e)}catch(i){a[t]=e}return e}("__core-js_shared__",{}),St=n((function(t){(t.exports=function(t,e){return Mt[t]||(Mt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.4",mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),Qt=0,Nt=Math.random(),Ft=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++Qt+Nt).toString(36)},Zt=St("keys"),Bt=function(t){return Zt[t]||(Zt[t]=Ft(t))},Ot=Bt("IE_PROTO"),Wt=function(){},At=function(t){return" - + @@ -292,6 +292,7 @@ private[spark] object UIUtils extends Logging { {commonHeaderNodes(request)} + {if (showVisualization) vizHeaderNodes(request) else Seq.empty} {if (useDataTables) dataTablesHeaderNodes(request) else Seq.empty}
-

+

{title} {helpButton}

@@ -442,7 +444,7 @@ private[spark] object UIUtils extends Logging { case None => {getHeaderContent(x._1)} } - } + }.toSeq } {headerRow} @@ -459,13 +461,14 @@ private[spark] object UIUtils extends Logging { skipped: Int, reasonToNumKilled: Map[String, Int], total: Int): Seq[Node] = { - val ratio = if (total == 0) 100.0 else (completed.toDouble/total)*100 + val ratio = if (total == 0) 100.0 else (completed.toDouble / total) * 100 val completeWidth = "width: %s%%".format(ratio) // started + completed can be > total when there are speculative tasks val boundedStarted = math.min(started, total - completed) - val startWidth = "width: %s%%".format((boundedStarted.toDouble/total)*100) + val startRatio = if (total == 0) 0.0 else (boundedStarted.toDouble / total) * 100 + val startWidth = "width: %s%%".format(startRatio) -
0) s"progress progress-started" else s"progress" }> +
{completed}/{total} { if (failed == 0 && skipped == 0 && started > 0) s"($started running)" } @@ -476,7 +479,8 @@ private[spark] object UIUtils extends Logging { } } -
+
+
} @@ -523,6 +527,9 @@ private[spark] object UIUtils extends Logging { } ++ g.rootCluster.getBarrierClusters.map { c =>
{c.id}
+ } ++ + g.rootCluster.getIndeterminateNodes.map { n => +
{n.id}
} }
@@ -638,7 +645,8 @@ private[spark] object UIUtils extends Logging { */ def makeHref(proxy: Boolean, id: String, origHref: String): String = { if (proxy) { - s"/proxy/$id" + val proxyPrefix = sys.props.getOrElse("spark.ui.proxyBase", "") + proxyPrefix + "/proxy/" + id } else { origHref } diff --git a/core/src/main/scala/org/apache/spark/ui/WebUI.scala b/core/src/main/scala/org/apache/spark/ui/WebUI.scala index 9faa3dcf2cdf2..a4e87704927c6 100644 --- a/core/src/main/scala/org/apache/spark/ui/WebUI.scala +++ b/core/src/main/scala/org/apache/spark/ui/WebUI.scala @@ -58,11 +58,11 @@ private[spark] abstract class WebUI( private val className = Utils.getFormattedClassName(this) def getBasePath: String = basePath - def getTabs: Seq[WebUITab] = tabs - def getHandlers: Seq[ServletContextHandler] = handlers + def getTabs: Seq[WebUITab] = tabs.toSeq + def getHandlers: Seq[ServletContextHandler] = handlers.toSeq def getDelegatingHandlers: Seq[DelegatingServletContextHandler] = { - handlers.map(new DelegatingServletContextHandler(_)) + handlers.map(new DelegatingServletContextHandler(_)).toSeq } /** Attaches a tab to this UI, along with all of its attached pages. */ diff --git a/core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala b/core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala index c6eb461ad601c..2f5b73118927b 100644 --- a/core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala +++ b/core/src/main/scala/org/apache/spark/ui/env/EnvironmentPage.scala @@ -19,9 +19,11 @@ package org.apache.spark.ui.env import javax.servlet.http.HttpServletRequest +import scala.collection.mutable.StringBuilder import scala.xml.Node import org.apache.spark.SparkConf +import org.apache.spark.resource.{ExecutorResourceRequest, TaskResourceRequest} import org.apache.spark.status.AppStatusStore import org.apache.spark.ui._ import org.apache.spark.util.Utils @@ -38,6 +40,37 @@ private[ui] class EnvironmentPage( "Java Home" -> appEnv.runtime.javaHome, "Scala Version" -> appEnv.runtime.scalaVersion) + def constructExecutorRequestString(execReqs: Map[String, ExecutorResourceRequest]): String = { + execReqs.map { + case (_, execReq) => + val execStr = new StringBuilder(s"\t${execReq.resourceName}: [amount: ${execReq.amount}") + if (execReq.discoveryScript.nonEmpty) { + execStr ++= s", discovery: ${execReq.discoveryScript}" + } + if (execReq.vendor.nonEmpty) { + execStr ++= s", vendor: ${execReq.vendor}" + } + execStr ++= "]" + execStr.toString() + }.mkString("\n") + } + + def constructTaskRequestString(taskReqs: Map[String, TaskResourceRequest]): String = { + taskReqs.map { + case (_, taskReq) => s"\t${taskReq.resourceName}: [amount: ${taskReq.amount}]" + }.mkString("\n") + } + + val resourceProfileInfo = store.resourceProfileInfo().map { rinfo => + val einfo = constructExecutorRequestString(rinfo.executorResources) + val tinfo = constructTaskRequestString(rinfo.taskResources) + val res = s"Executor Reqs:\n$einfo\nTask Reqs:\n$tinfo" + (rinfo.id.toString, res) + }.toMap + + val resourceProfileInformationTable = UIUtils.listingTable(resourceProfileHeader, + jvmRowDataPre, resourceProfileInfo.toSeq.sortWith(_._1.toInt < _._1.toInt), + fixedWidth = true, headerClasses = headerClassesNoSortValues) val runtimeInformationTable = UIUtils.listingTable( propertyHeader, jvmRow, jvmInformation.toSeq.sorted, fixedWidth = true, headerClasses = headerClasses) @@ -77,6 +110,17 @@ private[ui] class EnvironmentPage(
{sparkPropertiesTable}
+ +

+ + Resource Profiles +

+
+
+ {resourceProfileInformationTable} +
@@ -115,10 +159,14 @@ private[ui] class EnvironmentPage( UIUtils.headerSparkPage(request, "Environment", content, parent) } + private def resourceProfileHeader = Seq("Resource Profile Id", "Resource Profile Contents") private def propertyHeader = Seq("Name", "Value") private def classPathHeader = Seq("Resource", "Source") private def headerClasses = Seq("sorttable_alpha", "sorttable_alpha") + private def headerClassesNoSortValues = Seq("sorttable_numeric", "sorttable_nosort") + private def jvmRowDataPre(kv: (String, String)) = + private def jvmRow(kv: (String, String)) = private def propertyRow(kv: (String, String)) = private def classPathRow(data: (String, String)) = diff --git a/core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala b/core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala index 2c7aeeabb3601..c3246dc90976c 100644 --- a/core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala +++ b/core/src/main/scala/org/apache/spark/ui/exec/ExecutorThreadDumpPage.scala @@ -41,10 +41,10 @@ private[ui] class ExecutorThreadDumpPage( val dumpRows = threadDump.map { thread => val threadId = thread.threadId val blockedBy = thread.blockedByThreadId match { - case Some(_) => + case Some(blockingThreadId) => case None => Text("") } diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala b/core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala index 0b362201a7846..ae0e4728a9edf 100644 --- a/core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala +++ b/core/src/main/scala/org/apache/spark/ui/jobs/AllJobsPage.scala @@ -19,10 +19,9 @@ package org.apache.spark.ui.jobs import java.net.URLEncoder import java.nio.charset.StandardCharsets.UTF_8 -import java.util.Date +import java.util.{Date, Locale} import javax.servlet.http.HttpServletRequest -import scala.collection.JavaConverters._ import scala.collection.mutable.ListBuffer import scala.xml._ @@ -30,6 +29,7 @@ import org.apache.commons.text.StringEscapeUtils import org.apache.spark.JobExecutionStatus import org.apache.spark.internal.config.SCHEDULER_MODE +import org.apache.spark.internal.config.UI._ import org.apache.spark.scheduler._ import org.apache.spark.status.AppStatusStore import org.apache.spark.status.api.v1 @@ -41,6 +41,9 @@ private[ui] class AllJobsPage(parent: JobsTab, store: AppStatusStore) extends We import ApiHelper._ + private val MAX_TIMELINE_JOBS = parent.conf.get(UI_TIMELINE_JOBS_MAXIMUM) + private val MAX_TIMELINE_EXECUTORS = parent.conf.get(UI_TIMELINE_EXECUTORS_MAXIMUM) + private val JOBS_LEGEND =
.toString.filter(_ != '\n') private def makeJobEvent(jobs: Seq[v1.JobData]): Seq[String] = { + val now = System.currentTimeMillis() jobs.filter { job => job.status != JobExecutionStatus.UNKNOWN && job.submissionTime.isDefined - }.map { job => + }.sortBy { j => + (j.completionTime.map(_.getTime).getOrElse(now), j.submissionTime.get.getTime) + }.takeRight(MAX_TIMELINE_JOBS).map { job => val jobId = job.jobId val status = job.status val (_, lastStageDescription) = lastStageNameAndDescription(store, job) @@ -77,7 +83,7 @@ private[ui] class AllJobsPage(parent: JobsTab, store: AppStatusStore) extends We plainText = true).text val submissionTime = job.submissionTime.get.getTime() - val completionTime = job.completionTime.map(_.getTime()).getOrElse(System.currentTimeMillis()) + val completionTime = job.completionTime.map(_.getTime()).getOrElse(now) val classNameByStatus = status match { case JobExecutionStatus.SUCCEEDED => "succeeded" case JobExecutionStatus.FAILED => "failed" @@ -86,7 +92,7 @@ private[ui] class AllJobsPage(parent: JobsTab, store: AppStatusStore) extends We } // The timeline library treats contents as HTML, so we have to escape them. We need to add - // extra layers of escaping in order to embed this in a Javascript string literal. + // extra layers of escaping in order to embed this in a JavaScript string literal. val escapedDesc = Utility.escape(jobDescription) val jsEscapedDescForTooltip = StringEscapeUtils.escapeEcmaScript(Utility.escape(escapedDesc)) val jsEscapedDescForLabel = StringEscapeUtils.escapeEcmaScript(escapedDesc) @@ -119,7 +125,9 @@ private[ui] class AllJobsPage(parent: JobsTab, store: AppStatusStore) extends We private def makeExecutorEvent(executors: Seq[v1.ExecutorSummary]): Seq[String] = { val events = ListBuffer[String]() - executors.foreach { e => + executors.sortBy { e => + e.removeTime.map(_.getTime).getOrElse(e.addTime.getTime) + }.takeRight(MAX_TIMELINE_EXECUTORS).foreach { e => val addedEvent = s""" |{ @@ -148,7 +156,8 @@ private[ui] class AllJobsPage(parent: JobsTab, store: AppStatusStore) extends We | 'Removed at ${UIUtils.formatDate(removeTime)}' + | '${ e.removeReason.map { reason => - s"""
Reason: ${reason.replace("\n", " ")}""" + s"""
Reason: ${StringEscapeUtils.escapeEcmaScript( + reason.replace("\n", " "))}""" }.getOrElse("") }"' + | 'data-html="true">Executor ${e.id} removed' @@ -192,6 +201,30 @@ private[ui] class AllJobsPage(parent: JobsTab, store: AppStatusStore) extends We ++ - } else { - if (sortable) { - val headerLink = Unparsed( - parameterPath + - s"&$jobTag.sort=${URLEncoder.encode(header, UTF_8.name())}" + - s"&$jobTag.pageSize=$pageSize" + - s"#$tableHeaderId") - - - } else { - - } - } - } - } - {headerRow} + headerRow(jobHeadersAndCssClasses, desc, pageSize, sortColumn, parameterPath, + jobTag, tableHeaderId) } override def row(jobTableRow: JobTableRowData): Seq[Node] = { diff --git a/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala b/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala index 9be7124adcf7b..08e86524b0821 100644 --- a/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala +++ b/core/src/main/scala/org/apache/spark/ui/jobs/JobPage.scala @@ -26,6 +26,8 @@ import scala.xml.{Node, NodeSeq, Unparsed, Utility} import org.apache.commons.text.StringEscapeUtils import org.apache.spark.JobExecutionStatus +import org.apache.spark.internal.config.UI._ +import org.apache.spark.resource.ResourceProfile import org.apache.spark.status.AppStatusStore import org.apache.spark.status.api.v1 import org.apache.spark.ui._ @@ -33,6 +35,9 @@ import org.apache.spark.ui._ /** Page showing statistics and stage list for a given job */ private[ui] class JobPage(parent: JobsTab, store: AppStatusStore) extends WebUIPage("job") { + private val MAX_TIMELINE_STAGES = parent.conf.get(UI_TIMELINE_STAGES_MAXIMUM) + private val MAX_TIMELINE_EXECUTORS = parent.conf.get(UI_TIMELINE_EXECUTORS_MAXIMUM) + private val STAGES_LEGEND =
.toString.filter(_ != '\n') private def makeStageEvent(stageInfos: Seq[v1.StageData]): Seq[String] = { - stageInfos.map { stage => + val now = System.currentTimeMillis() + stageInfos.sortBy { s => + (s.completionTime.map(_.getTime).getOrElse(now), s.submissionTime.get.getTime) + }.takeRight(MAX_TIMELINE_STAGES).map { stage => val stageId = stage.stageId val attemptId = stage.attemptId val name = stage.name val status = stage.status.toString.toLowerCase(Locale.ROOT) val submissionTime = stage.submissionTime.get.getTime() val completionTime = stage.completionTime.map(_.getTime()) - .getOrElse(System.currentTimeMillis()) + .getOrElse(now) // The timeline library treats contents as HTML, so we have to escape them. We need to add - // extra layers of escaping in order to embed this in a Javascript string literal. + // extra layers of escaping in order to embed this in a JavaScript string literal. val escapedName = Utility.escape(name) val jsEscapedNameForTooltip = StringEscapeUtils.escapeEcmaScript(Utility.escape(escapedName)) val jsEscapedNameForLabel = StringEscapeUtils.escapeEcmaScript(escapedName) @@ -97,7 +105,9 @@ private[ui] class JobPage(parent: JobsTab, store: AppStatusStore) extends WebUIP def makeExecutorEvent(executors: Seq[v1.ExecutorSummary]): Seq[String] = { val events = ListBuffer[String]() - executors.foreach { e => + executors.sortBy { e => + e.removeTime.map(_.getTime).getOrElse(e.addTime.getTime) + }.takeRight(MAX_TIMELINE_EXECUTORS).foreach { e => val addedEvent = s""" |{ @@ -126,7 +136,8 @@ private[ui] class JobPage(parent: JobsTab, store: AppStatusStore) extends WebUIP | 'Removed at ${UIUtils.formatDate(removeTime)}' + | '${ e.removeReason.map { reason => - s"""
Reason: ${reason.replace("\n", " ")}""" + s"""
Reason: ${StringEscapeUtils.escapeEcmaScript( + reason.replace("\n", " "))}""" }.getOrElse("") }"' + | 'data-html="true">Executor ${e.id} removed' @@ -170,6 +181,30 @@ private[ui] class JobPage(parent: JobsTab, store: AppStatusStore) extends WebUIP ++ - } else { - if (sortable) { - val headerLink = Unparsed( - parameterPath + - s"&$stageTag.sort=${URLEncoder.encode(header, UTF_8.name())}" + - s"&$stageTag.pageSize=$pageSize") + - s"#$tableHeaderId" - - - } else { - - } - } - } - } - {headerRow} + headerRow(stageHeadersAndCssClasses, desc, pageSize, sortColumn, parameterPath, + stageTag, tableHeaderId) } override def row(data: StageTableRowData): Seq[Node] = { @@ -383,15 +309,9 @@ private[ui] class StageDataSource( // table so that we can avoid creating duplicate contents during sorting the data private val data = stages.map(stageRow).sorted(ordering(sortColumn, desc)) - private var _slicedStageIds: Set[Int] = _ - override def dataSize: Int = data.size - override def sliceData(from: Int, to: Int): Seq[StageTableRowData] = { - val r = data.slice(from, to) - _slicedStageIds = r.map(_.stageId).toSet - r - } + override def sliceData(from: Int, to: Int): Seq[StageTableRowData] = data.slice(from, to) private def stageRow(stageData: v1.StageData): StageTableRowData = { val formattedSubmissionTime = stageData.submissionTime match { @@ -422,7 +342,6 @@ private[ui] class StageDataSource( val shuffleWrite = stageData.shuffleWriteBytes val shuffleWriteWithUnit = if (shuffleWrite > 0) Utils.bytesToString(shuffleWrite) else "" - new StageTableRowData( stageData, Some(stageData), diff --git a/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala b/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala index 842ee7aaf49bf..e1f7609dfc7f8 100644 --- a/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala +++ b/core/src/main/scala/org/apache/spark/ui/scope/RDDOperationGraph.scala @@ -26,6 +26,7 @@ import scala.xml.Utility import org.apache.commons.text.StringEscapeUtils import org.apache.spark.internal.Logging +import org.apache.spark.rdd.DeterministicLevel import org.apache.spark.scheduler.StageInfo import org.apache.spark.storage.StorageLevel @@ -48,7 +49,8 @@ private[spark] case class RDDOperationNode( name: String, cached: Boolean, barrier: Boolean, - callsite: String) + callsite: String, + outputDeterministicLevel: DeterministicLevel.Value) /** * A directed edge connecting two nodes in an RDDOperationGraph. @@ -81,11 +83,16 @@ private[spark] class RDDOperationCluster( /** Return all the nodes which are cached. */ def getCachedNodes: Seq[RDDOperationNode] = { - _childNodes.filter(_.cached) ++ _childClusters.flatMap(_.getCachedNodes) + (_childNodes.filter(_.cached) ++ _childClusters.flatMap(_.getCachedNodes)).toSeq } def getBarrierClusters: Seq[RDDOperationCluster] = { - _childClusters.filter(_.barrier) ++ _childClusters.flatMap(_.getBarrierClusters) + (_childClusters.filter(_.barrier) ++ _childClusters.flatMap(_.getBarrierClusters)).toSeq + } + + def getIndeterminateNodes: Seq[RDDOperationNode] = { + (_childNodes.filter(_.outputDeterministicLevel == DeterministicLevel.INDETERMINATE) ++ + _childClusters.flatMap(_.getIndeterminateNodes)).toSeq } def canEqual(other: Any): Boolean = other.isInstanceOf[RDDOperationCluster] @@ -156,7 +163,8 @@ private[spark] object RDDOperationGraph extends Logging { // TODO: differentiate between the intention to cache an RDD and whether it's actually cached val node = nodes.getOrElseUpdate(rdd.id, RDDOperationNode( - rdd.id, rdd.name, rdd.storageLevel != StorageLevel.NONE, rdd.isBarrier, rdd.callSite)) + rdd.id, rdd.name, rdd.storageLevel != StorageLevel.NONE, rdd.isBarrier, rdd.callSite, + rdd.outputDeterministicLevel)) if (rdd.scope.isEmpty) { // This RDD has no encompassing scope, so we put it directly in the root cluster // This should happen only if an RDD is instantiated outside of a public RDD API @@ -210,7 +218,7 @@ private[spark] object RDDOperationGraph extends Logging { } } - RDDOperationGraph(internalEdges, outgoingEdges, incomingEdges, rootCluster) + RDDOperationGraph(internalEdges.toSeq, outgoingEdges.toSeq, incomingEdges.toSeq, rootCluster) } /** @@ -246,8 +254,14 @@ private[spark] object RDDOperationGraph extends Logging { } else { "" } + val outputDeterministicLevel = node.outputDeterministicLevel match { + case DeterministicLevel.DETERMINATE => "" + case DeterministicLevel.INDETERMINATE => " [Indeterminate]" + case DeterministicLevel.UNORDERED => " [Unordered]" + } val escapedCallsite = Utility.escape(node.callsite) - val label = s"${node.name} [${node.id}]$isCached$isBarrier
${escapedCallsite}" + val label = s"${node.name} [${node.id}]$isCached$isBarrier$outputDeterministicLevel" + + s"
${escapedCallsite}" s"""${node.id} [labelType="html" label="${StringEscapeUtils.escapeJava(label)}"]""" } diff --git a/core/src/main/scala/org/apache/spark/ui/storage/RDDPage.scala b/core/src/main/scala/org/apache/spark/ui/storage/RDDPage.scala index 04f8d8edd4d50..97f3cf534fb2c 100644 --- a/core/src/main/scala/org/apache/spark/ui/storage/RDDPage.scala +++ b/core/src/main/scala/org/apache/spark/ui/storage/RDDPage.scala @@ -35,15 +35,7 @@ private[ui] class RDDPage(parent: SparkUITab, store: AppStatusStore) extends Web val parameterId = request.getParameter("id") require(parameterId != null && parameterId.nonEmpty, "Missing id parameter") - val parameterBlockPage = request.getParameter("block.page") - val parameterBlockSortColumn = request.getParameter("block.sort") - val parameterBlockSortDesc = request.getParameter("block.desc") - val parameterBlockPageSize = request.getParameter("block.pageSize") - - val blockPage = Option(parameterBlockPage).map(_.toInt).getOrElse(1) - val blockSortColumn = Option(parameterBlockSortColumn).getOrElse("Block Name") - val blockSortDesc = Option(parameterBlockSortDesc).map(_.toBoolean).getOrElse(false) - val blockPageSize = Option(parameterBlockPageSize).map(_.toInt).getOrElse(100) + val blockPage = Option(request.getParameter("block.page")).map(_.toInt).getOrElse(1) val rddId = parameterId.toInt val rddStorageInfo = try { @@ -60,11 +52,10 @@ private[ui] class RDDPage(parent: SparkUITab, store: AppStatusStore) extends Web val blockTableHTML = try { val _blockTable = new BlockPagedTable( + request, + "block", UIUtils.prependBaseUri(request, parent.basePath) + s"/storage/rdd/?id=${rddId}", rddStorageInfo.partitions.get, - blockPageSize, - blockSortColumn, - blockSortDesc, store.executorList(true)) _blockTable.table(blockPage) } catch { @@ -216,21 +207,22 @@ private[ui] class BlockDataSource( } private[ui] class BlockPagedTable( + request: HttpServletRequest, + rddTag: String, basePath: String, rddPartitions: Seq[RDDPartitionInfo], - pageSize: Int, - sortColumn: String, - desc: Boolean, executorSummaries: Seq[ExecutorSummary]) extends PagedTable[BlockTableRowData] { + private val (sortColumn, desc, pageSize) = getTableParameters(request, rddTag, "Block Name") + override def tableId: String = "rdd-storage-by-block-table" override def tableCssClass: String = "table table-bordered table-sm table-striped table-head-clickable" - override def pageSizeFormField: String = "block.pageSize" + override def pageSizeFormField: String = s"$rddTag.pageSize" - override def pageNumberFormField: String = "block.page" + override def pageNumberFormField: String = s"$rddTag.page" override val dataSource: BlockDataSource = new BlockDataSource( rddPartitions, @@ -254,46 +246,16 @@ private[ui] class BlockPagedTable( } override def headers: Seq[Node] = { - val blockHeaders = Seq( + val blockHeaders: Seq[(String, Boolean, Option[String])] = Seq( "Block Name", "Storage Level", "Size in Memory", "Size on Disk", - "Executors") + "Executors").map(x => (x, true, None)) - if (!blockHeaders.contains(sortColumn)) { - throw new IllegalArgumentException(s"Unknown column: $sortColumn") - } + isSortColumnValid(blockHeaders, sortColumn) - val headerRow: Seq[Node] = { - blockHeaders.map { header => - if (header == sortColumn) { - val headerLink = Unparsed( - basePath + - s"&block.sort=${URLEncoder.encode(header, UTF_8.name())}" + - s"&block.desc=${!desc}" + - s"&block.pageSize=$pageSize") - val arrow = if (desc) "▾" else "▴" // UP or DOWN - - } else { - val headerLink = Unparsed( - basePath + - s"&block.sort=${URLEncoder.encode(header, UTF_8.name())}" + - s"&block.pageSize=$pageSize") - - } - } - } - {headerRow} + headerRow(blockHeaders, desc, pageSize, sortColumn, basePath, rddTag, "block") } override def row(block: BlockTableRowData): Seq[Node] = { diff --git a/core/src/main/scala/org/apache/spark/util/AccumulatorV2.scala b/core/src/main/scala/org/apache/spark/util/AccumulatorV2.scala index d5b3ce36e742a..1453840b834f2 100644 --- a/core/src/main/scala/org/apache/spark/util/AccumulatorV2.scala +++ b/core/src/main/scala/org/apache/spark/util/AccumulatorV2.scala @@ -19,7 +19,7 @@ package org.apache.spark.util import java.{lang => jl} import java.io.ObjectInputStream -import java.util.{ArrayList, Collections} +import java.util.ArrayList import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.atomic.AtomicLong @@ -449,39 +449,46 @@ class DoubleAccumulator extends AccumulatorV2[jl.Double, jl.Double] { * @since 2.0.0 */ class CollectionAccumulator[T] extends AccumulatorV2[T, java.util.List[T]] { - private val _list: java.util.List[T] = Collections.synchronizedList(new ArrayList[T]()) + private var _list: java.util.List[T] = _ + + private def getOrCreate = { + _list = Option(_list).getOrElse(new java.util.ArrayList[T]()) + _list + } /** * Returns false if this accumulator instance has any values in it. */ - override def isZero: Boolean = _list.isEmpty + override def isZero: Boolean = this.synchronized(getOrCreate.isEmpty) override def copyAndReset(): CollectionAccumulator[T] = new CollectionAccumulator override def copy(): CollectionAccumulator[T] = { val newAcc = new CollectionAccumulator[T] - _list.synchronized { - newAcc._list.addAll(_list) + this.synchronized { + newAcc.getOrCreate.addAll(getOrCreate) } newAcc } - override def reset(): Unit = _list.clear() + override def reset(): Unit = this.synchronized { + _list = null + } - override def add(v: T): Unit = _list.add(v) + override def add(v: T): Unit = this.synchronized(getOrCreate.add(v)) override def merge(other: AccumulatorV2[T, java.util.List[T]]): Unit = other match { - case o: CollectionAccumulator[T] => _list.addAll(o.value) + case o: CollectionAccumulator[T] => this.synchronized(getOrCreate.addAll(o.value)) case _ => throw new UnsupportedOperationException( s"Cannot merge ${this.getClass.getName} with ${other.getClass.getName}") } - override def value: java.util.List[T] = _list.synchronized { - java.util.Collections.unmodifiableList(new ArrayList[T](_list)) + override def value: java.util.List[T] = this.synchronized { + java.util.Collections.unmodifiableList(new ArrayList[T](getOrCreate)) } - private[spark] def setValue(newValue: java.util.List[T]): Unit = { - _list.clear() - _list.addAll(newValue) + private[spark] def setValue(newValue: java.util.List[T]): Unit = this.synchronized { + _list = null + getOrCreate.addAll(newValue) } } diff --git a/core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala b/core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala index 6ffd6605f75b8..7e2b9c72ad91b 100644 --- a/core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala +++ b/core/src/main/scala/org/apache/spark/util/ClosureCleaner.scala @@ -285,7 +285,7 @@ private[spark] object ClosureCleaner extends Logging { logDebug(s" + outermost object is a closure, so we clone it: ${outermostClass}") } else if (outermostClass.getName.startsWith("$line")) { // SPARK-14558: if the outermost object is a REPL line object, we should clone - // and clean it as it may carray a lot of unnecessary information, + // and clean it as it may carry a lot of unnecessary information, // e.g. hadoop conf, spark conf, etc. logDebug(s" + outermost object is a REPL line object, so we clone it:" + s" ${outermostClass}") diff --git a/core/src/main/scala/org/apache/spark/util/DependencyUtils.scala b/core/src/main/scala/org/apache/spark/util/DependencyUtils.scala new file mode 100644 index 0000000000000..f7135edd2129d --- /dev/null +++ b/core/src/main/scala/org/apache/spark/util/DependencyUtils.scala @@ -0,0 +1,323 @@ +/* + * 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. + */ + +package org.apache.spark.util + +import java.io.File +import java.net.URI + +import org.apache.commons.lang3.StringUtils +import org.apache.hadoop.conf.Configuration +import org.apache.hadoop.fs.{FileSystem, Path} + +import org.apache.spark.{SparkConf, SparkException} +import org.apache.spark.deploy.SparkSubmitUtils +import org.apache.spark.internal.Logging + +case class IvyProperties( + packagesExclusions: String, + packages: String, + repositories: String, + ivyRepoPath: String, + ivySettingsPath: String) + +private[spark] object DependencyUtils extends Logging { + + def getIvyProperties(): IvyProperties = { + val Seq(packagesExclusions, packages, repositories, ivyRepoPath, ivySettingsPath) = Seq( + "spark.jars.excludes", + "spark.jars.packages", + "spark.jars.repositories", + "spark.jars.ivy", + "spark.jars.ivySettings" + ).map(sys.props.get(_).orNull) + IvyProperties(packagesExclusions, packages, repositories, ivyRepoPath, ivySettingsPath) + } + + private def isInvalidQueryString(tokens: Array[String]): Boolean = { + tokens.length != 2 || StringUtils.isBlank(tokens(0)) || StringUtils.isBlank(tokens(1)) + } + + /** + * Parse URI query string's parameter value of `transitive` and `exclude`. + * Other invalid parameters will be ignored. + * + * @param uri Ivy URI need to be downloaded. + * @return Tuple value of parameter `transitive` and `exclude` value. + * + * 1. transitive: whether to download dependency jar of Ivy URI, default value is true + * and this parameter value is case-insensitive. This mimics Hive's behaviour for + * parsing the transitive parameter. Invalid value will be treat as false. + * Example: Input: exclude=org.mortbay.jetty:jetty&transitive=true + * Output: true + * + * 2. exclude: comma separated exclusions to apply when resolving transitive dependencies, + * consists of `group:module` pairs separated by commas. + * Example: Input: excludeorg.mortbay.jetty:jetty,org.eclipse.jetty:jetty-http + * Output: [org.mortbay.jetty:jetty,org.eclipse.jetty:jetty-http] + */ + private def parseQueryParams(uri: URI): (Boolean, String) = { + val uriQuery = uri.getQuery + if (uriQuery == null) { + (true, "") + } else { + val mapTokens = uriQuery.split("&").map(_.split("=")) + if (mapTokens.exists(isInvalidQueryString)) { + throw new IllegalArgumentException( + s"Invalid query string in Ivy URI ${uri.toString}: $uriQuery") + } + val groupedParams = mapTokens.map(kv => (kv(0), kv(1))).groupBy(_._1) + + // Parse transitive parameters (e.g., transitive=true) in an Ivy URI, default value is true + val transitiveParams = groupedParams.get("transitive") + if (transitiveParams.map(_.size).getOrElse(0) > 1) { + logWarning("It's best to specify `transitive` parameter in ivy URI query only once." + + " If there are multiple `transitive` parameter, we will select the last one") + } + val transitive = + transitiveParams.flatMap(_.takeRight(1).map(_._2.equalsIgnoreCase("true")).headOption) + .getOrElse(true) + + // Parse an excluded list (e.g., exclude=org.mortbay.jetty:jetty,org.eclipse.jetty:jetty-http) + // in an Ivy URI. When download Ivy URI jar, Spark won't download transitive jar + // in a excluded list. + val exclusionList = groupedParams.get("exclude").map { params => + params.map(_._2).flatMap { excludeString => + val excludes = excludeString.split(",") + if (excludes.map(_.split(":")).exists(isInvalidQueryString)) { + throw new IllegalArgumentException( + s"Invalid exclude string in Ivy URI ${uri.toString}:" + + " expected 'org:module,org:module,..', found " + excludeString) + } + excludes + }.mkString(",") + }.getOrElse("") + + val validParams = Set("transitive", "exclude") + val invalidParams = groupedParams.keys.filterNot(validParams.contains).toSeq + if (invalidParams.nonEmpty) { + logWarning(s"Invalid parameters `${invalidParams.sorted.mkString(",")}` found " + + s"in Ivy URI query `$uriQuery`.") + } + + (transitive, exclusionList) + } + } + + /** + * Download Ivy URI's dependency jars. + * + * @param uri Ivy URI need to be downloaded. The URI format should be: + * `ivy://group:module:version[?query]` + * Ivy URI query part format should be: + * `parameter=value¶meter=value...` + * Note that currently Ivy URI query part support two parameters: + * 1. transitive: whether to download dependent jars related to your Ivy URI. + * transitive=false or `transitive=true`, if not set, the default value is true. + * 2. exclude: exclusion list when download Ivy URI jar and dependency jars. + * The `exclude` parameter content is a ',' separated `group:module` pair string : + * `exclude=group:module,group:module...` + * @return List of jars downloaded. + */ + def resolveMavenDependencies(uri: URI): Seq[String] = { + val ivyProperties = DependencyUtils.getIvyProperties() + val authority = uri.getAuthority + if (authority == null) { + throw new IllegalArgumentException( + s"Invalid Ivy URI authority in uri ${uri.toString}:" + + " Expected 'org:module:version', found null.") + } + if (authority.split(":").length != 3) { + throw new IllegalArgumentException( + s"Invalid Ivy URI authority in uri ${uri.toString}:" + + s" Expected 'org:module:version', found $authority.") + } + + val (transitive, exclusionList) = parseQueryParams(uri) + + resolveMavenDependencies( + transitive, + exclusionList, + authority, + ivyProperties.repositories, + ivyProperties.ivyRepoPath, + Option(ivyProperties.ivySettingsPath) + ) + } + + def resolveMavenDependencies( + packagesTransitive: Boolean, + packagesExclusions: String, + packages: String, + repositories: String, + ivyRepoPath: String, + ivySettingsPath: Option[String]): Seq[String] = { + val exclusions: Seq[String] = + if (!StringUtils.isBlank(packagesExclusions)) { + packagesExclusions.split(",") + } else { + Nil + } + // Create the IvySettings, either load from file or build defaults + val ivySettings = ivySettingsPath match { + case Some(path) => + SparkSubmitUtils.loadIvySettings(path, Option(repositories), Option(ivyRepoPath)) + + case None => + SparkSubmitUtils.buildIvySettings(Option(repositories), Option(ivyRepoPath)) + } + + SparkSubmitUtils.resolveMavenCoordinates(packages, ivySettings, + transitive = packagesTransitive, exclusions = exclusions) + } + + def resolveAndDownloadJars( + jars: String, + userJar: String, + sparkConf: SparkConf, + hadoopConf: Configuration): String = { + val targetDir = Utils.createTempDir() + val userJarName = userJar.split(File.separatorChar).last + Option(jars) + .map { + resolveGlobPaths(_, hadoopConf) + .split(",") + .filterNot(_.contains(userJarName)) + .mkString(",") + } + .filterNot(_ == "") + .map(downloadFileList(_, targetDir, sparkConf, hadoopConf)) + .orNull + } + + def addJarsToClassPath(jars: String, loader: MutableURLClassLoader): Unit = { + if (jars != null) { + for (jar <- jars.split(",")) { + addJarToClasspath(jar, loader) + } + } + } + + /** + * Download a list of remote files to temp local files. If the file is local, the original file + * will be returned. + * + * @param fileList A comma separated file list. + * @param targetDir A temporary directory for which downloaded files. + * @param sparkConf Spark configuration. + * @param hadoopConf Hadoop configuration. + * @return A comma separated local files list. + */ + def downloadFileList( + fileList: String, + targetDir: File, + sparkConf: SparkConf, + hadoopConf: Configuration): String = { + require(fileList != null, "fileList cannot be null.") + Utils.stringToSeq(fileList) + .map(downloadFile(_, targetDir, sparkConf, hadoopConf)) + .mkString(",") + } + + /** + * Download a file from the remote to a local temporary directory. If the input path points to + * a local path, returns it with no operation. + * + * @param path A file path from where the files will be downloaded. + * @param targetDir A temporary directory for which downloaded files. + * @param sparkConf Spark configuration. + * @param hadoopConf Hadoop configuration. + * @return Path to the local file. + */ + def downloadFile( + path: String, + targetDir: File, + sparkConf: SparkConf, + hadoopConf: Configuration): String = { + require(path != null, "path cannot be null.") + val uri = Utils.resolveURI(path) + + uri.getScheme match { + case "file" | "local" => path + case "http" | "https" | "ftp" if Utils.isTesting => + // This is only used for SparkSubmitSuite unit test. Instead of downloading file remotely, + // return a dummy local path instead. + val file = new File(uri.getPath) + new File(targetDir, file.getName).toURI.toString + case _ => + val fname = new Path(uri).getName() + val localFile = Utils.doFetchFile(uri.toString(), targetDir, fname, sparkConf, hadoopConf) + localFile.toURI().toString() + } + } + + def resolveGlobPaths(paths: String, hadoopConf: Configuration): String = { + require(paths != null, "paths cannot be null.") + Utils.stringToSeq(paths).flatMap { path => + val (base, fragment) = splitOnFragment(path) + (resolveGlobPath(base, hadoopConf), fragment) match { + case (resolved, Some(_)) if resolved.length > 1 => throw new SparkException( + s"${base.toString} resolves ambiguously to multiple files: ${resolved.mkString(",")}") + case (resolved, Some(namedAs)) => resolved.map(_ + "#" + namedAs) + case (resolved, _) => resolved + } + }.mkString(",") + } + + def addJarToClasspath(localJar: String, loader: MutableURLClassLoader): Unit = { + val uri = Utils.resolveURI(localJar) + uri.getScheme match { + case "file" | "local" => + val file = new File(uri.getPath) + if (file.exists()) { + loader.addURL(file.toURI.toURL) + } else { + logWarning(s"Local jar $file does not exist, skipping.") + } + case _ => + logWarning(s"Skip remote jar $uri.") + } + } + + /** + * Merge a sequence of comma-separated file lists, some of which may be null to indicate + * no files, into a single comma-separated string. + */ + def mergeFileLists(lists: String*): String = { + val merged = lists.filterNot(StringUtils.isBlank) + .flatMap(Utils.stringToSeq) + if (merged.nonEmpty) merged.mkString(",") else null + } + + private def splitOnFragment(path: String): (URI, Option[String]) = { + val uri = Utils.resolveURI(path) + val withoutFragment = new URI(uri.getScheme, uri.getSchemeSpecificPart, null) + (withoutFragment, Option(uri.getFragment)) + } + + private def resolveGlobPath(uri: URI, hadoopConf: Configuration): Array[String] = { + uri.getScheme match { + case "local" | "http" | "https" | "ftp" => Array(uri.toString) + case _ => + val fs = FileSystem.get(uri, hadoopConf) + Option(fs.globStatus(new Path(uri))).map { status => + status.filter(_.isFile).map(_.getPath.toUri.toString) + }.getOrElse(Array(uri.toString)) + } + } + +} diff --git a/core/src/main/scala/org/apache/spark/util/HadoopFSUtils.scala b/core/src/main/scala/org/apache/spark/util/HadoopFSUtils.scala new file mode 100644 index 0000000000000..60a73adc8582e --- /dev/null +++ b/core/src/main/scala/org/apache/spark/util/HadoopFSUtils.scala @@ -0,0 +1,370 @@ +/* + * 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. + */ + +package org.apache.spark.util + +import java.io.FileNotFoundException + +import scala.collection.mutable + +import org.apache.hadoop.conf.Configuration +import org.apache.hadoop.fs._ +import org.apache.hadoop.fs.viewfs.ViewFileSystem +import org.apache.hadoop.hdfs.DistributedFileSystem + +import org.apache.spark._ +import org.apache.spark.internal.Logging +import org.apache.spark.metrics.source.HiveCatalogMetrics + +/** + * Utility functions to simplify and speed-up file listing. + */ +private[spark] object HadoopFSUtils extends Logging { + /** + * Lists a collection of paths recursively. Picks the listing strategy adaptively depending + * on the number of paths to list. + * + * This may only be called on the driver. + * + * @param sc Spark context used to run parallel listing. + * @param paths Input paths to list + * @param hadoopConf Hadoop configuration + * @param filter Path filter used to exclude leaf files from result + * @param ignoreMissingFiles Ignore missing files that happen during recursive listing + * (e.g., due to race conditions) + * @param ignoreLocality Whether to fetch data locality info when listing leaf files. If false, + * this will return `FileStatus` without `BlockLocation` info. + * @param parallelismThreshold The threshold to enable parallelism. If the number of input paths + * is smaller than this value, this will fallback to use + * sequential listing. + * @param parallelismMax The maximum parallelism for listing. If the number of input paths is + * larger than this value, parallelism will be throttled to this value + * to avoid generating too many tasks. + * @return for each input path, the set of discovered files for the path + */ + def parallelListLeafFiles( + sc: SparkContext, + paths: Seq[Path], + hadoopConf: Configuration, + filter: PathFilter, + ignoreMissingFiles: Boolean, + ignoreLocality: Boolean, + parallelismThreshold: Int, + parallelismMax: Int): Seq[(Path, Seq[FileStatus])] = { + parallelListLeafFilesInternal(sc, paths, hadoopConf, filter, isRootLevel = true, + ignoreMissingFiles, ignoreLocality, parallelismThreshold, parallelismMax) + } + + private def parallelListLeafFilesInternal( + sc: SparkContext, + paths: Seq[Path], + hadoopConf: Configuration, + filter: PathFilter, + isRootLevel: Boolean, + ignoreMissingFiles: Boolean, + ignoreLocality: Boolean, + parallelismThreshold: Int, + parallelismMax: Int): Seq[(Path, Seq[FileStatus])] = { + + // Short-circuits parallel listing when serial listing is likely to be faster. + if (paths.size <= parallelismThreshold) { + return paths.map { path => + val leafFiles = listLeafFiles( + path, + hadoopConf, + filter, + Some(sc), + ignoreMissingFiles = ignoreMissingFiles, + ignoreLocality = ignoreLocality, + isRootPath = isRootLevel, + parallelismThreshold = parallelismThreshold, + parallelismMax = parallelismMax) + (path, leafFiles) + } + } + + logInfo(s"Listing leaf files and directories in parallel under ${paths.length} paths." + + s" The first several paths are: ${paths.take(10).mkString(", ")}.") + HiveCatalogMetrics.incrementParallelListingJobCount(1) + + val serializableConfiguration = new SerializableConfiguration(hadoopConf) + val serializedPaths = paths.map(_.toString) + + // Set the number of parallelism to prevent following file listing from generating many tasks + // in case of large #defaultParallelism. + val numParallelism = Math.min(paths.size, parallelismMax) + + val previousJobDescription = sc.getLocalProperty(SparkContext.SPARK_JOB_DESCRIPTION) + val statusMap = try { + val description = paths.size match { + case 0 => + "Listing leaf files and directories 0 paths" + case 1 => + s"Listing leaf files and directories for 1 path:
${paths(0)}" + case s => + s"Listing leaf files and directories for $s paths:
${paths(0)}, ..." + } + sc.setJobDescription(description) + sc + .parallelize(serializedPaths, numParallelism) + .mapPartitions { pathStrings => + val hadoopConf = serializableConfiguration.value + pathStrings.map(new Path(_)).toSeq.map { path => + val leafFiles = listLeafFiles( + path = path, + hadoopConf = hadoopConf, + filter = filter, + contextOpt = None, // Can't execute parallel scans on workers + ignoreMissingFiles = ignoreMissingFiles, + ignoreLocality = ignoreLocality, + isRootPath = isRootLevel, + parallelismThreshold = Int.MaxValue, + parallelismMax = 0) + (path, leafFiles) + }.iterator + }.map { case (path, statuses) => + val serializableStatuses = statuses.map { status => + // Turn FileStatus into SerializableFileStatus so we can send it back to the driver + val blockLocations = status match { + case f: LocatedFileStatus => + f.getBlockLocations.map { loc => + SerializableBlockLocation( + loc.getNames, + loc.getHosts, + loc.getOffset, + loc.getLength) + } + + case _ => + Array.empty[SerializableBlockLocation] + } + + SerializableFileStatus( + status.getPath.toString, + status.getLen, + status.isDirectory, + status.getReplication, + status.getBlockSize, + status.getModificationTime, + status.getAccessTime, + blockLocations) + } + (path.toString, serializableStatuses) + }.collect() + } finally { + sc.setJobDescription(previousJobDescription) + } + + // turn SerializableFileStatus back to Status + statusMap.map { case (path, serializableStatuses) => + val statuses = serializableStatuses.map { f => + val blockLocations = f.blockLocations.map { loc => + new BlockLocation(loc.names, loc.hosts, loc.offset, loc.length) + } + new LocatedFileStatus( + new FileStatus( + f.length, f.isDir, f.blockReplication, f.blockSize, f.modificationTime, + new Path(f.path)), + blockLocations) + } + (new Path(path), statuses) + } + } + + // scalastyle:off argcount + /** + * Lists a single filesystem path recursively. If a `SparkContext` object is specified, this + * function may launch Spark jobs to parallelize listing based on `parallelismThreshold`. + * + * If sessionOpt is None, this may be called on executors. + * + * @return all children of path that match the specified filter. + */ + private def listLeafFiles( + path: Path, + hadoopConf: Configuration, + filter: PathFilter, + contextOpt: Option[SparkContext], + ignoreMissingFiles: Boolean, + ignoreLocality: Boolean, + isRootPath: Boolean, + parallelismThreshold: Int, + parallelismMax: Int): Seq[FileStatus] = { + + logTrace(s"Listing $path") + val fs = path.getFileSystem(hadoopConf) + + // Note that statuses only include FileStatus for the files and dirs directly under path, + // and does not include anything else recursively. + val statuses: Array[FileStatus] = try { + fs match { + // DistributedFileSystem overrides listLocatedStatus to make 1 single call to namenode + // to retrieve the file status with the file block location. The reason to still fallback + // to listStatus is because the default implementation would potentially throw a + // FileNotFoundException which is better handled by doing the lookups manually below. + case (_: DistributedFileSystem | _: ViewFileSystem) if !ignoreLocality => + val remoteIter = fs.listLocatedStatus(path) + new Iterator[LocatedFileStatus]() { + def next(): LocatedFileStatus = remoteIter.next + def hasNext(): Boolean = remoteIter.hasNext + }.toArray + case _ => fs.listStatus(path) + } + } catch { + // If we are listing a root path for SQL (e.g. a top level directory of a table), we need to + // ignore FileNotFoundExceptions during this root level of the listing because + // + // (a) certain code paths might construct an InMemoryFileIndex with root paths that + // might not exist (i.e. not all callers are guaranteed to have checked + // path existence prior to constructing InMemoryFileIndex) and, + // (b) we need to ignore deleted root paths during REFRESH TABLE, otherwise we break + // existing behavior and break the ability drop SessionCatalog tables when tables' + // root directories have been deleted (which breaks a number of Spark's own tests). + // + // If we are NOT listing a root path then a FileNotFoundException here means that the + // directory was present in a previous level of file listing but is absent in this + // listing, likely indicating a race condition (e.g. concurrent table overwrite or S3 + // list inconsistency). + // + // The trade-off in supporting existing behaviors / use-cases is that we won't be + // able to detect race conditions involving root paths being deleted during + // InMemoryFileIndex construction. However, it's still a net improvement to detect and + // fail-fast on the non-root cases. For more info see the SPARK-27676 review discussion. + case _: FileNotFoundException if isRootPath || ignoreMissingFiles => + logWarning(s"The directory $path was not found. Was it deleted very recently?") + Array.empty[FileStatus] + } + + val filteredStatuses = + statuses.filterNot(status => shouldFilterOutPathName(status.getPath.getName)) + + val allLeafStatuses = { + val (dirs, topLevelFiles) = filteredStatuses.partition(_.isDirectory) + val nestedFiles: Seq[FileStatus] = contextOpt match { + case Some(context) if dirs.size > parallelismThreshold => + parallelListLeafFilesInternal( + context, + dirs.map(_.getPath), + hadoopConf = hadoopConf, + filter = filter, + isRootLevel = false, + ignoreMissingFiles = ignoreMissingFiles, + ignoreLocality = ignoreLocality, + parallelismThreshold = parallelismThreshold, + parallelismMax = parallelismMax + ).flatMap(_._2) + case _ => + dirs.flatMap { dir => + listLeafFiles( + path = dir.getPath, + hadoopConf = hadoopConf, + filter = filter, + contextOpt = contextOpt, + ignoreMissingFiles = ignoreMissingFiles, + ignoreLocality = ignoreLocality, + isRootPath = false, + parallelismThreshold = parallelismThreshold, + parallelismMax = parallelismMax) + } + } + val allFiles = topLevelFiles ++ nestedFiles + if (filter != null) allFiles.filter(f => filter.accept(f.getPath)) else allFiles + } + + val missingFiles = mutable.ArrayBuffer.empty[String] + val resolvedLeafStatuses = allLeafStatuses.flatMap { + case f: LocatedFileStatus => + Some(f) + + // NOTE: + // + // - Although S3/S3A/S3N file system can be quite slow for remote file metadata + // operations, calling `getFileBlockLocations` does no harm here since these file system + // implementations don't actually issue RPC for this method. + // + // - Here we are calling `getFileBlockLocations` in a sequential manner, but it should not + // be a big deal since we always use to `parallelListLeafFiles` when the number of + // paths exceeds threshold. + case f if !ignoreLocality => + // The other constructor of LocatedFileStatus will call FileStatus.getPermission(), + // which is very slow on some file system (RawLocalFileSystem, which is launch a + // subprocess and parse the stdout). + try { + val locations = fs.getFileBlockLocations(f, 0, f.getLen).map { loc => + // Store BlockLocation objects to consume less memory + if (loc.getClass == classOf[BlockLocation]) { + loc + } else { + new BlockLocation(loc.getNames, loc.getHosts, loc.getOffset, loc.getLength) + } + } + val lfs = new LocatedFileStatus(f.getLen, f.isDirectory, f.getReplication, f.getBlockSize, + f.getModificationTime, 0, null, null, null, null, f.getPath, locations) + if (f.isSymlink) { + lfs.setSymlink(f.getSymlink) + } + Some(lfs) + } catch { + case _: FileNotFoundException if ignoreMissingFiles => + missingFiles += f.getPath.toString + None + } + + case f => Some(f) + } + + if (missingFiles.nonEmpty) { + logWarning( + s"the following files were missing during file scan:\n ${missingFiles.mkString("\n ")}") + } + + resolvedLeafStatuses + } + // scalastyle:on argcount + + /** A serializable variant of HDFS's BlockLocation. This is required by Hadoop 2.7. */ + private case class SerializableBlockLocation( + names: Array[String], + hosts: Array[String], + offset: Long, + length: Long) + + /** A serializable variant of HDFS's FileStatus. This is required by Hadoop 2.7. */ + private case class SerializableFileStatus( + path: String, + length: Long, + isDir: Boolean, + blockReplication: Short, + blockSize: Long, + modificationTime: Long, + accessTime: Long, + blockLocations: Array[SerializableBlockLocation]) + + /** Checks if we should filter out this path name. */ + def shouldFilterOutPathName(pathName: String): Boolean = { + // We filter follow paths: + // 1. everything that starts with _ and ., except _common_metadata and _metadata + // because Parquet needs to find those metadata files from leaf files returned by this method. + // We should refactor this logic to not mix metadata files with data files. + // 2. everything that ends with `._COPYING_`, because this is a intermediate state of file. we + // should skip this file in case of double reading. + val exclude = (pathName.startsWith("_") && !pathName.contains("=")) || + pathName.startsWith(".") || pathName.endsWith("._COPYING_") + val include = pathName.startsWith("_common_metadata") || pathName.startsWith("_metadata") + exclude && !include + } +} diff --git a/core/src/main/scala/org/apache/spark/util/JsonProtocol.scala b/core/src/main/scala/org/apache/spark/util/JsonProtocol.scala index 9254ac94005f1..c74cca9b93b89 100644 --- a/core/src/main/scala/org/apache/spark/util/JsonProtocol.scala +++ b/core/src/main/scala/org/apache/spark/util/JsonProtocol.scala @@ -32,8 +32,8 @@ import org.json4s.jackson.JsonMethods._ import org.apache.spark._ import org.apache.spark.executor._ import org.apache.spark.metrics.ExecutorMetricType -import org.apache.spark.rdd.RDDOperationScope -import org.apache.spark.resource.{ResourceInformation, ResourceProfile} +import org.apache.spark.rdd.{DeterministicLevel, RDDOperationScope} +import org.apache.spark.resource.{ExecutorResourceRequest, ResourceInformation, ResourceProfile, TaskResourceRequest} import org.apache.spark.scheduler._ import org.apache.spark.scheduler.cluster.ExecutorInfo import org.apache.spark.storage._ @@ -105,6 +105,8 @@ private[spark] object JsonProtocol { stageExecutorMetricsToJson(stageExecutorMetrics) case blockUpdate: SparkListenerBlockUpdated => blockUpdateToJson(blockUpdate) + case resourceProfileAdded: SparkListenerResourceProfileAdded => + resourceProfileAddedToJson(resourceProfileAdded) case _ => parse(mapper.writeValueAsString(event)) } } @@ -224,6 +226,15 @@ private[spark] object JsonProtocol { ("Timestamp" -> applicationEnd.time) } + def resourceProfileAddedToJson(profileAdded: SparkListenerResourceProfileAdded): JValue = { + ("Event" -> SPARK_LISTENER_EVENT_FORMATTED_CLASS_NAMES.resourceProfileAdded) ~ + ("Resource Profile Id" -> profileAdded.resourceProfile.id) ~ + ("Executor Resource Requests" -> + executorResourceRequestMapToJson(profileAdded.resourceProfile.executorResources)) ~ + ("Task Resource Requests" -> + taskResourceRequestMapToJson(profileAdded.resourceProfile.taskResources)) + } + def executorAddedToJson(executorAdded: SparkListenerExecutorAdded): JValue = { ("Event" -> SPARK_LISTENER_EVENT_FORMATTED_CLASS_NAMES.executorAdded) ~ ("Timestamp" -> executorAdded.time) ~ @@ -297,7 +308,8 @@ private[spark] object JsonProtocol { ("Submission Time" -> submissionTime) ~ ("Completion Time" -> completionTime) ~ ("Failure Reason" -> failureReason) ~ - ("Accumulables" -> accumulablesToJson(stageInfo.accumulables.values)) + ("Accumulables" -> accumulablesToJson(stageInfo.accumulables.values)) ~ + ("Resource Profile Id" -> stageInfo.resourceProfileId) } def taskInfoToJson(taskInfo: TaskInfo): JValue = { @@ -316,12 +328,12 @@ private[spark] object JsonProtocol { ("Accumulables" -> accumulablesToJson(taskInfo.accumulables)) } - private lazy val accumulableBlacklist = Set("internal.metrics.updatedBlockStatuses") + private lazy val accumulableExcludeList = Set("internal.metrics.updatedBlockStatuses") def accumulablesToJson(accumulables: Iterable[AccumulableInfo]): JArray = { JArray(accumulables - .filterNot(_.name.exists(accumulableBlacklist.contains)) - .toList.map(accumulableInfoToJson)) + .filterNot(_.name.exists(accumulableExcludeList.contains)) + .toList.sortBy(_.id).map(accumulableInfoToJson)) } def accumulableInfoToJson(accumulableInfo: AccumulableInfo): JValue = { @@ -351,12 +363,22 @@ private[spark] object JsonProtocol { case v: Long => JInt(v) // We only have 3 kind of internal accumulator types, so if it's not int or long, it must be // the blocks accumulator, whose type is `java.util.List[(BlockId, BlockStatus)]` - case v => - JArray(v.asInstanceOf[java.util.List[(BlockId, BlockStatus)]].asScala.toList.map { - case (id, status) => - ("Block ID" -> id.toString) ~ - ("Status" -> blockStatusToJson(status)) + case v: java.util.List[_] => + JArray(v.asScala.toList.flatMap { + case (id: BlockId, status: BlockStatus) => + Some( + ("Block ID" -> id.toString) ~ + ("Status" -> blockStatusToJson(status)) + ) + case _ => + // Ignore unsupported types. A user may put `METRICS_PREFIX` in the name. We should + // not crash. + None }) + case _ => + // Ignore unsupported types. A user may put `METRICS_PREFIX` in the name. We should not + // crash. + JNothing } } else { // For all external accumulators, just use strings @@ -475,6 +497,8 @@ private[spark] object JsonProtocol { ("Callsite" -> rddInfo.callSite) ~ ("Parent IDs" -> parentIds) ~ ("Storage Level" -> storageLevel) ~ + ("Barrier" -> rddInfo.isBarrier) ~ + ("DeterministicLevel" -> rddInfo.outputDeterministicLevel.toString) ~ ("Number of Partitions" -> rddInfo.numPartitions) ~ ("Number of Cached Partitions" -> rddInfo.numCachedPartitions) ~ ("Memory Size" -> rddInfo.memSize) ~ @@ -500,7 +524,8 @@ private[spark] object JsonProtocol { ("Total Cores" -> executorInfo.totalCores) ~ ("Log Urls" -> mapToJson(executorInfo.logUrlMap)) ~ ("Attributes" -> mapToJson(executorInfo.attributes)) ~ - ("Resources" -> resourcesMapToJson(executorInfo.resourcesInfo)) + ("Resources" -> resourcesMapToJson(executorInfo.resourcesInfo)) ~ + ("Resource Profile Id" -> executorInfo.resourceProfileId) } def resourcesMapToJson(m: Map[String, ResourceInformation]): JValue = { @@ -518,6 +543,34 @@ private[spark] object JsonProtocol { ("Disk Size" -> blockUpdatedInfo.diskSize) } + def executorResourceRequestToJson(execReq: ExecutorResourceRequest): JValue = { + ("Resource Name" -> execReq.resourceName) ~ + ("Amount" -> execReq.amount) ~ + ("Discovery Script" -> execReq.discoveryScript) ~ + ("Vendor" -> execReq.vendor) + } + + def executorResourceRequestMapToJson(m: Map[String, ExecutorResourceRequest]): JValue = { + val jsonFields = m.map { + case (k, execReq) => + JField(k, executorResourceRequestToJson(execReq)) + } + JObject(jsonFields.toList) + } + + def taskResourceRequestToJson(taskReq: TaskResourceRequest): JValue = { + ("Resource Name" -> taskReq.resourceName) ~ + ("Amount" -> taskReq.amount) + } + + def taskResourceRequestMapToJson(m: Map[String, TaskResourceRequest]): JValue = { + val jsonFields = m.map { + case (k, taskReq) => + JField(k, taskResourceRequestToJson(taskReq)) + } + JObject(jsonFields.toList) + } + /** ------------------------------ * * Util JSON serialization methods | * ------------------------------- */ @@ -577,6 +630,7 @@ private[spark] object JsonProtocol { val metricsUpdate = Utils.getFormattedClassName(SparkListenerExecutorMetricsUpdate) val stageExecutorMetrics = Utils.getFormattedClassName(SparkListenerStageExecutorMetrics) val blockUpdate = Utils.getFormattedClassName(SparkListenerBlockUpdated) + val resourceProfileAdded = Utils.getFormattedClassName(SparkListenerResourceProfileAdded) } def sparkEventFromJson(json: JValue): SparkListenerEvent = { @@ -602,6 +656,7 @@ private[spark] object JsonProtocol { case `metricsUpdate` => executorMetricsUpdateFromJson(json) case `stageExecutorMetrics` => stageExecutorMetricsFromJson(json) case `blockUpdate` => blockUpdateFromJson(json) + case `resourceProfileAdded` => resourceProfileAddedFromJson(json) case other => mapper.readValue(compact(render(json)), Utils.classForName(other)) .asInstanceOf[SparkListenerEvent] } @@ -678,6 +733,45 @@ private[spark] object JsonProtocol { SparkListenerJobEnd(jobId, completionTime, jobResult) } + def resourceProfileAddedFromJson(json: JValue): SparkListenerResourceProfileAdded = { + val profId = (json \ "Resource Profile Id").extract[Int] + val executorReqs = executorResourceRequestMapFromJson(json \ "Executor Resource Requests") + val taskReqs = taskResourceRequestMapFromJson(json \ "Task Resource Requests") + val rp = new ResourceProfile(executorReqs.toMap, taskReqs.toMap) + rp.setResourceProfileId(profId) + SparkListenerResourceProfileAdded(rp) + } + + def executorResourceRequestFromJson(json: JValue): ExecutorResourceRequest = { + val rName = (json \ "Resource Name").extract[String] + val amount = (json \ "Amount").extract[Int] + val discoveryScript = (json \ "Discovery Script").extract[String] + val vendor = (json \ "Vendor").extract[String] + new ExecutorResourceRequest(rName, amount, discoveryScript, vendor) + } + + def taskResourceRequestFromJson(json: JValue): TaskResourceRequest = { + val rName = (json \ "Resource Name").extract[String] + val amount = (json \ "Amount").extract[Int] + new TaskResourceRequest(rName, amount) + } + + def taskResourceRequestMapFromJson(json: JValue): Map[String, TaskResourceRequest] = { + val jsonFields = json.asInstanceOf[JObject].obj + jsonFields.collect { case JField(k, v) => + val req = taskResourceRequestFromJson(v) + (k, req) + }.toMap + } + + def executorResourceRequestMapFromJson(json: JValue): Map[String, ExecutorResourceRequest] = { + val jsonFields = json.asInstanceOf[JObject].obj + jsonFields.collect { case JField(k, v) => + val req = executorResourceRequestFromJson(v) + (k, req) + }.toMap + } + def environmentUpdateFromJson(json: JValue): SparkListenerEnvironmentUpdate = { // For compatible with previous event logs val hadoopProperties = jsonOption(json \ "Hadoop Properties").map(mapFromJson(_).toSeq) @@ -804,9 +898,10 @@ private[spark] object JsonProtocol { } } - val stageInfo = new StageInfo( - stageId, attemptId, stageName, numTasks, rddInfos, parentIds, details, - resourceProfileId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) + val rpId = jsonOption(json \ "Resource Profile Id").map(_.extract[Int]) + val stageProf = rpId.getOrElse(ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) + val stageInfo = new StageInfo(stageId, attemptId, stageName, numTasks, rddInfos, + parentIds, details, resourceProfileId = stageProf) stageInfo.submissionTime = submissionTime stageInfo.completionTime = completionTime stageInfo.failureReason = failureReason @@ -984,7 +1079,14 @@ private[spark] object JsonProtocol { val blockManagerAddress = blockManagerIdFromJson(json \ "Block Manager Address") val shuffleId = (json \ "Shuffle ID").extract[Int] val mapId = (json \ "Map ID").extract[Long] - val mapIndex = (json \ "Map Index").extract[Int] + val mapIndex = json \ "Map Index" match { + case JNothing => + // Note, we use the invalid value Int.MinValue here to fill the map index for backward + // compatibility. Otherwise, the fetch failed event will be dropped when the history + // server loads the event log written by the Spark version before 3.0. + Int.MinValue + case x => x.extract[Int] + } val reduceId = (json \ "Reduce ID").extract[Int] val message = jsonOption(json \ "Message").map(_.extract[String]) new FetchFailed(blockManagerAddress, shuffleId, mapId, mapIndex, reduceId, @@ -1074,8 +1176,12 @@ private[spark] object JsonProtocol { val memSize = (json \ "Memory Size").extract[Long] val diskSize = (json \ "Disk Size").extract[Long] + val outputDeterministicLevel = DeterministicLevel.withName( + jsonOption(json \ "DeterministicLevel").map(_.extract[String]).getOrElse("DETERMINATE")) + val rddInfo = - new RDDInfo(rddId, name, numPartitions, storageLevel, isBarrier, parentIds, callsite, scope) + new RDDInfo(rddId, name, numPartitions, storageLevel, isBarrier, parentIds, callsite, scope, + outputDeterministicLevel) rddInfo.numCachedPartitions = numCachedPartitions rddInfo.memSize = memSize rddInfo.diskSize = diskSize @@ -1109,7 +1215,12 @@ private[spark] object JsonProtocol { case Some(resources) => resourcesMapFromJson(resources).toMap case None => Map.empty[String, ResourceInformation] } - new ExecutorInfo(executorHost, totalCores, logUrls, attributes, resources) + val resourceProfileId = jsonOption(json \ "Resource Profile Id") match { + case Some(id) => id.extract[Int] + case None => ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID + } + new ExecutorInfo(executorHost, totalCores, logUrls, attributes.toMap, resources.toMap, + resourceProfileId) } def blockUpdatedInfoFromJson(json: JValue): BlockUpdatedInfo = { @@ -1123,7 +1234,7 @@ private[spark] object JsonProtocol { def resourcesMapFromJson(json: JValue): Map[String, ResourceInformation] = { val jsonFields = json.asInstanceOf[JObject].obj - jsonFields.map { case JField(k, v) => + jsonFields.collect { case JField(k, v) => val resourceInfo = ResourceInformation.parseJson(v) (k, resourceInfo) }.toMap @@ -1135,7 +1246,7 @@ private[spark] object JsonProtocol { def mapFromJson(json: JValue): Map[String, String] = { val jsonFields = json.asInstanceOf[JObject].obj - jsonFields.map { case JField(k, JString(v)) => (k, v) }.toMap + jsonFields.collect { case JField(k, JString(v)) => (k, v) }.toMap } def propertiesFromJson(json: JValue): Properties = { diff --git a/core/src/main/scala/org/apache/spark/util/ListenerBus.scala b/core/src/main/scala/org/apache/spark/util/ListenerBus.scala index 51cd7d1284ff3..3520fa870c91b 100644 --- a/core/src/main/scala/org/apache/spark/util/ListenerBus.scala +++ b/core/src/main/scala/org/apache/spark/util/ListenerBus.scala @@ -27,6 +27,8 @@ import com.codahale.metrics.Timer import org.apache.spark.SparkEnv import org.apache.spark.internal.{config, Logging} +import org.apache.spark.scheduler.EventLoggingListener +import org.apache.spark.scheduler.SparkListenerEnvironmentUpdate /** * An event bus which posts events to its listeners. @@ -128,7 +130,7 @@ private[spark] trait ListenerBus[L <: AnyRef, E] extends Logging { if (maybeTimerContext != null) { val elapsed = maybeTimerContext.stop() if (logSlowEventEnabled && elapsed > logSlowEventThreshold) { - logInfo(s"Process of event ${event} by listener ${listenerName} took " + + logInfo(s"Process of event ${redactEvent(event)} by listener ${listenerName} took " + s"${elapsed / 1000000000d}s.") } } @@ -150,4 +152,12 @@ private[spark] trait ListenerBus[L <: AnyRef, E] extends Logging { listeners.asScala.filter(_.getClass == c).map(_.asInstanceOf[T]).toSeq } + private def redactEvent(e: E): E = { + e match { + case event: SparkListenerEnvironmentUpdate => + EventLoggingListener.redactEvent(env.conf, event).asInstanceOf[E] + case _ => e + } + } + } diff --git a/core/src/main/scala/org/apache/spark/util/RpcUtils.scala b/core/src/main/scala/org/apache/spark/util/RpcUtils.scala index 7272b375e5388..0e4debc595345 100644 --- a/core/src/main/scala/org/apache/spark/util/RpcUtils.scala +++ b/core/src/main/scala/org/apache/spark/util/RpcUtils.scala @@ -17,6 +17,8 @@ package org.apache.spark.util +import scala.concurrent.duration._ + import org.apache.spark.SparkConf import org.apache.spark.internal.config import org.apache.spark.internal.config.Network._ @@ -54,6 +56,14 @@ private[spark] object RpcUtils { RpcTimeout(conf, Seq(RPC_LOOKUP_TIMEOUT.key, NETWORK_TIMEOUT.key), "120s") } + /** + * Infinite timeout is used internally, so there's no timeout configuration property that + * controls it. Therefore, we use "infinite" without any specific reason as its timeout + * configuration property. And its timeout property should never be accessed since infinite + * means we never timeout. + */ + val INFINITE_TIMEOUT = new RpcTimeout(Long.MaxValue.nanos, "infinite") + private val MAX_MESSAGE_SIZE_IN_MB = Int.MaxValue / 1024 / 1024 /** Returns the configured max message size for messages in bytes. */ diff --git a/core/src/main/scala/org/apache/spark/util/ThreadUtils.scala b/core/src/main/scala/org/apache/spark/util/ThreadUtils.scala index 78206c51c1028..d45dc937910d9 100644 --- a/core/src/main/scala/org/apache/spark/util/ThreadUtils.scala +++ b/core/src/main/scala/org/apache/spark/util/ThreadUtils.scala @@ -23,7 +23,6 @@ import java.util.concurrent.locks.ReentrantLock import scala.concurrent.{Awaitable, ExecutionContext, ExecutionContextExecutor, Future} import scala.concurrent.duration.{Duration, FiniteDuration} -import scala.language.higherKinds import scala.util.control.NonFatal import com.google.common.util.concurrent.ThreadFactoryBuilder diff --git a/core/src/main/scala/org/apache/spark/util/UninterruptibleThread.scala b/core/src/main/scala/org/apache/spark/util/UninterruptibleThread.scala index 6a58ec142dd7f..24788d69121b2 100644 --- a/core/src/main/scala/org/apache/spark/util/UninterruptibleThread.scala +++ b/core/src/main/scala/org/apache/spark/util/UninterruptibleThread.scala @@ -31,7 +31,7 @@ private[spark] class UninterruptibleThread( target: Runnable, name: String) extends Thread(target, name) { - def this(name: String) { + def this(name: String) = { this(null, name) } diff --git a/core/src/main/scala/org/apache/spark/util/UninterruptibleThreadRunner.scala b/core/src/main/scala/org/apache/spark/util/UninterruptibleThreadRunner.scala new file mode 100644 index 0000000000000..18108aa819db9 --- /dev/null +++ b/core/src/main/scala/org/apache/spark/util/UninterruptibleThreadRunner.scala @@ -0,0 +1,55 @@ +/* + * 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. + */ + +package org.apache.spark.util + +import java.util.concurrent.Executors + +import scala.concurrent.{ExecutionContext, Future} +import scala.concurrent.duration.Duration + +/** + * [[UninterruptibleThreadRunner]] ensures that all tasks are running in an + * [[UninterruptibleThread]]. A good example is Kafka consumer usage. + */ +private[spark] class UninterruptibleThreadRunner(threadName: String) { + private val thread = Executors.newSingleThreadExecutor((r: Runnable) => { + val t = new UninterruptibleThread(threadName) { + override def run(): Unit = { + r.run() + } + } + t.setDaemon(true) + t + }) + private val execContext = ExecutionContext.fromExecutorService(thread) + + def runUninterruptibly[T](body: => T): T = { + if (!Thread.currentThread.isInstanceOf[UninterruptibleThread]) { + val future = Future { + body + }(execContext) + ThreadUtils.awaitResult(future, Duration.Inf) + } else { + body + } + } + + def shutdown(): Unit = { + thread.shutdown() + } +} diff --git a/core/src/main/scala/org/apache/spark/util/Utils.scala b/core/src/main/scala/org/apache/spark/util/Utils.scala index c7db2127a6f04..e27666b284b53 100644 --- a/core/src/main/scala/org/apache/spark/util/Utils.scala +++ b/core/src/main/scala/org/apache/spark/util/Utils.scala @@ -28,7 +28,7 @@ import java.nio.channels.{Channels, FileChannel, WritableByteChannel} import java.nio.charset.StandardCharsets import java.nio.file.Files import java.security.SecureRandom -import java.util.{Arrays, Locale, Properties, Random, UUID} +import java.util.{Locale, Properties, Random, UUID} import java.util.concurrent._ import java.util.concurrent.TimeUnit.NANOSECONDS import java.util.zip.GZIPInputStream @@ -53,6 +53,7 @@ import org.apache.hadoop.conf.Configuration import org.apache.hadoop.fs.{FileSystem, FileUtil, Path} import org.apache.hadoop.io.compress.{CompressionCodecFactory, SplittableCompressionCodec} import org.apache.hadoop.security.UserGroupInformation +import org.apache.hadoop.util.{RunJar, StringUtils} import org.apache.hadoop.yarn.conf.YarnConfiguration import org.eclipse.jetty.util.MultiException import org.slf4j.Logger @@ -376,7 +377,7 @@ private[spark] object Utils extends Logging { * This returns a new InputStream which contains the same data as the original input stream. * It may be entirely on in-memory buffer, or it may be a combination of in-memory data, and then * continue to read from the original stream. The only real use of this is if the original input - * stream will potentially detect corruption while the data is being read (eg. from compression). + * stream will potentially detect corruption while the data is being read (e.g. from compression). * This allows for an eager check of corruption in the first maxSize bytes of data. * * @return An InputStream which includes all data from the original stream (combining buffered @@ -486,15 +487,19 @@ private[spark] object Utils extends Logging { * * Throws SparkException if the target file already exists and has different contents than * the requested file. + * + * If `shouldUntar` is true, it untars the given url if it is a tar.gz or tgz into `targetDir`. + * This is a legacy behavior, and users should better use `spark.archives` configuration or + * `SparkContext.addArchive` */ def fetchFile( url: String, targetDir: File, conf: SparkConf, - securityMgr: SecurityManager, hadoopConf: Configuration, timestamp: Long, - useCache: Boolean): File = { + useCache: Boolean, + shouldUntar: Boolean = true): File = { val fileName = decodeFileNameInURI(new URI(url)) val targetFile = new File(targetDir, fileName) val fetchCacheEnabled = conf.getBoolean("spark.files.useFetchCache", defaultValue = true) @@ -519,7 +524,7 @@ private[spark] object Utils extends Logging { val cachedFile = new File(localDir, cachedFileName) try { if (!cachedFile.exists()) { - doFetchFile(url, localDir, cachedFileName, conf, securityMgr, hadoopConf) + doFetchFile(url, localDir, cachedFileName, conf, hadoopConf) } } finally { lock.release() @@ -532,16 +537,26 @@ private[spark] object Utils extends Logging { conf.getBoolean("spark.files.overwrite", false) ) } else { - doFetchFile(url, targetDir, fileName, conf, securityMgr, hadoopConf) - } - - // Decompress the file if it's a .tar or .tar.gz - if (fileName.endsWith(".tar.gz") || fileName.endsWith(".tgz")) { - logInfo("Untarring " + fileName) - executeAndGetOutput(Seq("tar", "-xzf", fileName), targetDir) - } else if (fileName.endsWith(".tar")) { - logInfo("Untarring " + fileName) - executeAndGetOutput(Seq("tar", "-xf", fileName), targetDir) + doFetchFile(url, targetDir, fileName, conf, hadoopConf) + } + + if (shouldUntar) { + // Decompress the file if it's a .tar or .tar.gz + if (fileName.endsWith(".tar.gz") || fileName.endsWith(".tgz")) { + logWarning( + "Untarring behavior will be deprecated at spark.files and " + + "SparkContext.addFile. Consider using spark.archives or SparkContext.addArchive " + + "instead.") + logInfo("Untarring " + fileName) + executeAndGetOutput(Seq("tar", "-xzf", fileName), targetDir) + } else if (fileName.endsWith(".tar")) { + logWarning( + "Untarring behavior will be deprecated at spark.files and " + + "SparkContext.addFile. Consider using spark.archives or SparkContext.addArchive " + + "instead.") + logInfo("Untarring " + fileName) + executeAndGetOutput(Seq("tar", "-xf", fileName), targetDir) + } } // Make the file executable - That's necessary for scripts FileUtil.chmod(targetFile.getAbsolutePath, "a+x") @@ -555,6 +570,26 @@ private[spark] object Utils extends Logging { targetFile } + /** + * Unpacks an archive file into the specified directory. It expects .jar, .zip, .tar.gz, .tgz + * and .tar files. This behaves same as Hadoop's archive in distributed cache. This method is + * basically copied from `org.apache.hadoop.yarn.util.FSDownload.unpack`. + */ + def unpack(source: File, dest: File): Unit = { + val lowerSrc = StringUtils.toLowerCase(source.getName) + if (lowerSrc.endsWith(".jar")) { + RunJar.unJar(source, dest, RunJar.MATCH_ANY) + } else if (lowerSrc.endsWith(".zip")) { + FileUtil.unZip(source, dest) + } else if ( + lowerSrc.endsWith(".tar.gz") || lowerSrc.endsWith(".tgz") || lowerSrc.endsWith(".tar")) { + FileUtil.unTar(source, dest) + } else { + logWarning(s"Cannot unpack $source, just copying it to $dest.") + copyRecursive(source, dest) + } + } + /** Records the duration of running `body`. */ def timeTakenMs[T](body: => T): (T, Long) = { val startTime = System.nanoTime() @@ -705,7 +740,6 @@ private[spark] object Utils extends Logging { targetDir: File, filename: String, conf: SparkConf, - securityMgr: SecurityManager, hadoopConf: Configuration): File = { val targetFile = new File(targetDir, filename) val uri = new URI(url) @@ -1026,13 +1060,27 @@ private[spark] object Utils extends Logging { customHostname.getOrElse(InetAddresses.toUriString(localIpAddress)) } + /** + * Checks if the host contains only valid hostname/ip without port + * NOTE: Incase of IPV6 ip it should be enclosed inside [] + */ def checkHost(host: String): Unit = { - assert(host != null && host.indexOf(':') == -1, s"Expected hostname (not IP) but got $host") + if (host != null && host.split(":").length > 2) { + assert(host.startsWith("[") && host.endsWith("]"), + s"Expected hostname or IPv6 IP enclosed in [] but got $host") + } else { + assert(host != null && host.indexOf(':') == -1, s"Expected hostname or IP but got $host") + } } def checkHostPort(hostPort: String): Unit = { - assert(hostPort != null && hostPort.indexOf(':') != -1, - s"Expected host and port but got $hostPort") + if (hostPort != null && hostPort.split(":").length > 2) { + assert(hostPort != null && hostPort.indexOf("]:") != -1, + s"Expected host and port but got $hostPort") + } else { + assert(hostPort != null && hostPort.indexOf(':') != -1, + s"Expected host and port but got $hostPort") + } } // Typically, this will be of order of number of nodes in cluster @@ -1046,18 +1094,30 @@ private[spark] object Utils extends Logging { return cached } - val indx: Int = hostPort.lastIndexOf(':') - // This is potentially broken - when dealing with ipv6 addresses for example, sigh ... - // but then hadoop does not support ipv6 right now. - // For now, we assume that if port exists, then it is valid - not check if it is an int > 0 - if (-1 == indx) { + def setDefaultPortValue: (String, Int) = { val retval = (hostPort, 0) hostPortParseResults.put(hostPort, retval) - return retval + retval + } + // checks if the hostport contains IPV6 ip and parses the host, port + if (hostPort != null && hostPort.split(":").length > 2) { + val index: Int = hostPort.lastIndexOf("]:") + if (-1 == index) { + return setDefaultPortValue + } + val port = hostPort.substring(index + 2).trim() + val retval = (hostPort.substring(0, index + 1).trim(), if (port.isEmpty) 0 else port.toInt) + hostPortParseResults.putIfAbsent(hostPort, retval) + } else { + val index: Int = hostPort.lastIndexOf(':') + if (-1 == index) { + return setDefaultPortValue + } + val port = hostPort.substring(index + 1).trim() + val retval = (hostPort.substring(0, index).trim(), if (port.isEmpty) 0 else port.toInt) + hostPortParseResults.putIfAbsent(hostPort, retval) } - val retval = (hostPort.substring(0, indx).trim(), hostPort.substring(indx + 1).trim().toInt) - hostPortParseResults.putIfAbsent(hostPort, retval) hostPortParseResults.get(hostPort) } @@ -1716,7 +1776,7 @@ private[spark] object Utils extends Logging { if (inWord || inDoubleQuote || inSingleQuote) { endWord() } - buf + buf.toSeq } /* Calculates 'x' modulo 'mod', takes to consideration sign of x, @@ -1879,7 +1939,9 @@ private[spark] object Utils extends Logging { * Indicates whether Spark is currently running unit tests. */ def isTesting: Boolean = { - sys.env.contains("SPARK_TESTING") || sys.props.contains(IS_TESTING.key) + // Scala's `sys.env` creates a ton of garbage by constructing Scala immutable maps, so + // we directly use the Java APIs instead. + System.getenv("SPARK_TESTING") != null || System.getProperty(IS_TESTING.key) != null } /** @@ -2001,6 +2063,17 @@ private[spark] object Utils extends Logging { } } + /** Check whether a path is an absolute URI. */ + def isAbsoluteURI(path: String): Boolean = { + try { + val uri = new URI(path: String) + uri.isAbsolute + } catch { + case _: URISyntaxException => + false + } + } + /** Return all non-local paths from a comma-separated list of paths. */ def nonLocalPaths(paths: String, testWindows: Boolean = false): Array[String] = { val windows = isWindows || testWindows @@ -2492,6 +2565,14 @@ private[spark] object Utils extends Logging { master == "local" || master.startsWith("local[") } + /** + * Push based shuffle can only be enabled when external shuffle service is enabled. + */ + def isPushBasedShuffleEnabled(conf: SparkConf): Boolean = { + conf.get(PUSH_BASED_SHUFFLE_ENABLED) && + (conf.get(IS_TESTING).getOrElse(false) || conf.get(SHUFFLE_SERVICE_ENABLED)) + } + /** * Return whether dynamic allocation is enabled in the given conf. */ @@ -2788,6 +2869,34 @@ private[spark] object Utils extends Logging { Hex.encodeHexString(secretBytes) } + /** + * Returns true if and only if the underlying class is a member class. + * + * Note: jdk8u throws a "Malformed class name" error if a given class is a deeply-nested + * inner class (See SPARK-34607 for details). This issue has already been fixed in jdk9+, so + * we can remove this helper method safely if we drop the support of jdk8u. + */ + def isMemberClass(cls: Class[_]): Boolean = { + try { + cls.isMemberClass + } catch { + case _: InternalError => + // We emulate jdk8u `Class.isMemberClass` below: + // public boolean isMemberClass() { + // return getSimpleBinaryName() != null && !isLocalOrAnonymousClass(); + // } + // `getSimpleBinaryName()` returns null if a given class is a top-level class, + // so we replace it with `cls.getEnclosingClass != null`. The second condition checks + // if a given class is not a local or an anonymous class, so we replace it with + // `cls.getEnclosingMethod == null` because `cls.getEnclosingMethod()` return a value + // only in either case (JVM Spec 4.8.6). + // + // Note: The newer jdk evaluates `!isLocalOrAnonymousClass()` first, + // we reorder the conditions to follow it. + cls.getEnclosingMethod == null && cls.getEnclosingClass != null + } + } + /** * Safer than Class obj's getSimpleName which may throw Malformed class name error in scala. * This method mimics scalatest's getSimpleNameOfAnObjectsClass. @@ -2820,11 +2929,11 @@ private[spark] object Utils extends Logging { if (lastDollarIndex < s.length - 1) { // The last char is not a dollar sign if (lastDollarIndex == -1 || !s.contains("$iw")) { - // The name does not have dollar sign or is not an intepreter + // The name does not have dollar sign or is not an interpreter // generated class, so we should return the full string s } else { - // The class name is intepreter generated, + // The class name is interpreter generated, // return the part after the last dollar sign // This is the same behavior as getClass.getSimpleName s.substring(lastDollarIndex + 1) @@ -2857,14 +2966,14 @@ private[spark] object Utils extends Logging { */ private val fullWidthRegex = ("""[""" + // scalastyle:off nonascii - """\u1100-\u115F""" + - """\u2E80-\uA4CF""" + - """\uAC00-\uD7A3""" + - """\uF900-\uFAFF""" + - """\uFE10-\uFE19""" + - """\uFE30-\uFE6F""" + - """\uFF00-\uFF60""" + - """\uFFE0-\uFFE6""" + + "\u1100-\u115F" + + "\u2E80-\uA4CF" + + "\uAC00-\uD7A3" + + "\uF900-\uFAFF" + + "\uFE10-\uFE19" + + "\uFE30-\uFE6F" + + "\uFF00-\uFF60" + + "\uFFE0-\uFFE6" + // scalastyle:on nonascii """]""").r @@ -2900,10 +3009,58 @@ private[spark] object Utils extends Logging { /** Create a new properties object with the same values as `props` */ def cloneProperties(props: Properties): Properties = { + if (props == null) { + return props + } val resultProps = new Properties() props.forEach((k, v) => resultProps.put(k, v)) resultProps } + + /** + * Convert a sequence of `Path`s to a metadata string. When the length of metadata string + * exceeds `stopAppendingThreshold`, stop appending paths for saving memory. + */ + def buildLocationMetadata(paths: Seq[Path], stopAppendingThreshold: Int): String = { + val metadata = new StringBuilder(s"(${paths.length} paths)[") + var index: Int = 0 + while (index < paths.length && metadata.length < stopAppendingThreshold) { + if (index > 0) { + metadata.append(", ") + } + metadata.append(paths(index).toString) + index += 1 + } + if (paths.length > index) { + if (index > 0) { + metadata.append(", ") + } + metadata.append("...") + } + metadata.append("]") + metadata.toString + } + + /** + * Convert MEMORY_OFFHEAP_SIZE to MB Unit, return 0 if MEMORY_OFFHEAP_ENABLED is false. + */ + def executorOffHeapMemorySizeAsMb(sparkConf: SparkConf): Int = { + val sizeInMB = Utils.memoryStringToMb(sparkConf.get(MEMORY_OFFHEAP_SIZE).toString) + checkOffHeapEnabled(sparkConf, sizeInMB).toInt + } + + /** + * return 0 if MEMORY_OFFHEAP_ENABLED is false. + */ + def checkOffHeapEnabled(sparkConf: SparkConf, offHeapSize: Long): Long = { + if (sparkConf.get(MEMORY_OFFHEAP_ENABLED)) { + require(offHeapSize > 0, + s"${MEMORY_OFFHEAP_SIZE.key} must be > 0 when ${MEMORY_OFFHEAP_ENABLED.key} == true") + offHeapSize + } else { + 0 + } + } } private[util] object CallerContext extends Logging { diff --git a/core/src/main/scala/org/apache/spark/util/VersionUtils.scala b/core/src/main/scala/org/apache/spark/util/VersionUtils.scala index c0f8866dd58dc..e97d1c9393701 100644 --- a/core/src/main/scala/org/apache/spark/util/VersionUtils.scala +++ b/core/src/main/scala/org/apache/spark/util/VersionUtils.scala @@ -24,6 +24,7 @@ private[spark] object VersionUtils { private val majorMinorRegex = """^(\d+)\.(\d+)(\..*)?$""".r private val shortVersionRegex = """^(\d+\.\d+\.\d+)(.*)?$""".r + private val majorMinorPatchRegex = """^(\d+)(?:\.(\d+)(?:\.(\d+)(?:[.-].*)?)?)?$""".r /** * Given a Spark version string, return the major version number. @@ -63,4 +64,36 @@ private[spark] object VersionUtils { s" version string, but it could not find the major and minor version numbers.") } } + + /** + * Extracts the major, minor and patch parts from the input `version`. Note that if minor or patch + * version is missing from the input, this will return 0 for these parts. Returns `None` if the + * input is not of a valid format. + * + * Examples of valid version: + * - 1 (extracts to (1, 0, 0)) + * - 2.4 (extracts to (2, 4, 0)) + * - 3.2.2 (extracts to (3, 2, 2)) + * - 3.2.2.4 (extracts to 3, 2, 2)) + * - 3.3.1-SNAPSHOT (extracts to (3, 3, 1)) + * - 3.2.2.4SNAPSHOT (extracts to (3, 2, 2), only the first 3 components) + * + * Examples of invalid version: + * - ABC + * - 1X + * - 2.4XYZ + * - 2.4-SNAPSHOT + * - 3.4.5ABC + * + * @return A non-empty option containing a 3-value tuple (major, minor, patch) iff the + * input is a valid version. `None` otherwise. + */ + def majorMinorPatchVersion(version: String): Option[(Int, Int, Int)] = { + majorMinorPatchRegex.findFirstMatchIn(version).map { m => + val major = m.group(1).toInt + val minor = Option(m.group(2)).map(_.toInt).getOrElse(0) + val patch = Option(m.group(3)).map(_.toInt).getOrElse(0) + (major, minor, patch) + } + } } diff --git a/core/src/main/scala/org/apache/spark/util/collection/BitSet.scala b/core/src/main/scala/org/apache/spark/util/collection/BitSet.scala index 098f389829ec5..61386114997f6 100644 --- a/core/src/main/scala/org/apache/spark/util/collection/BitSet.scala +++ b/core/src/main/scala/org/apache/spark/util/collection/BitSet.scala @@ -236,6 +236,18 @@ class BitSet(numBits: Int) extends Serializable { -1 } + /** + * Compute bit-wise union with another BitSet and overwrite bits in this BitSet with the result. + */ + def union(other: BitSet): Unit = { + require(this.numWords <= other.numWords) + var ind = 0 + while( ind < this.numWords ) { + this.words(ind) = this.words(ind) | other.words(ind) + ind += 1 + } + } + /** Return the number of longs it would take to hold numBits. */ private def bit2words(numBits: Int) = ((numBits - 1) >> 6) + 1 } diff --git a/core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala b/core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala index 7f40b469a95e9..731131b688ca7 100644 --- a/core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala +++ b/core/src/main/scala/org/apache/spark/util/collection/ExternalAppendOnlyMap.scala @@ -76,7 +76,7 @@ class ExternalAppendOnlyMap[K, V, C]( mergeValue: (C, V) => C, mergeCombiners: (C, C) => C, serializer: Serializer, - blockManager: BlockManager) { + blockManager: BlockManager) = { this(createCombiner, mergeValue, mergeCombiners, serializer, blockManager, TaskContext.get()) } diff --git a/core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala b/core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala index cc97bbfa7201f..1913637371e31 100644 --- a/core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala +++ b/core/src/main/scala/org/apache/spark/util/collection/ExternalSorter.scala @@ -32,7 +32,7 @@ import org.apache.spark.serializer._ import org.apache.spark.shuffle.ShufflePartitionPairsWriter import org.apache.spark.shuffle.api.{ShuffleMapOutputWriter, ShufflePartitionWriter} import org.apache.spark.storage.{BlockId, DiskBlockObjectWriter, ShuffleBlockId} -import org.apache.spark.util.{Utils => TryUtils} +import org.apache.spark.util.{CompletionIterator, Utils => TryUtils} /** * Sorts and potentially merges a number of key-value pairs of type (K, V) to produce key-combiner @@ -263,7 +263,7 @@ private[spark] class ExternalSorter[K, V, C]( /** * Spill contents of in-memory iterator to a temporary file on disk. */ - private[this] def spillMemoryIteratorToDisk(inMemoryIterator: WritablePartitionedIterator) + private[this] def spillMemoryIteratorToDisk(inMemoryIterator: WritablePartitionedIterator[K, C]) : SpilledFile = { // Because these files may be read during shuffle, their compression must be controlled by // spark.shuffle.compress instead of spark.shuffle.spill.compress, so we need to use @@ -659,7 +659,7 @@ private[spark] class ExternalSorter[K, V, C]( } } else { // Merge spilled and in-memory data - merge(spills, destructiveIterator( + merge(spills.toSeq, destructiveIterator( collection.partitionedDestructiveSortedIterator(comparator))) } } @@ -672,6 +672,22 @@ private[spark] class ExternalSorter[K, V, C]( partitionedIterator.flatMap(pair => pair._2) } + /** + * Insert all records, updates related task metrics, and return a completion iterator + * over all the data written to this object, aggregated by our aggregator. + * On task completion (success, failure, or cancellation), it releases resources by + * calling `stop()`. + */ + def insertAllAndUpdateMetrics(records: Iterator[Product2[K, V]]): Iterator[Product2[K, C]] = { + insertAll(records) + context.taskMetrics().incMemoryBytesSpilled(memoryBytesSpilled) + context.taskMetrics().incDiskBytesSpilled(diskBytesSpilled) + context.taskMetrics().incPeakExecutionMemory(peakMemoryUsedBytes) + // Use completion callback to stop sorter if task was finished/cancelled. + context.addTaskCompletionListener[Unit](_ => stop()) + CompletionIterator[Product2[K, C], Iterator[Product2[K, C]]](iterator, stop()) + } + /** * TODO(SPARK-28764): remove this, as this is only used by UnsafeRowSerializerSuite in the SQL * project. We should figure out an alternative way to test that so that we can remove this @@ -734,7 +750,7 @@ private[spark] class ExternalSorter[K, V, C]( // Case where we only have in-memory data val collection = if (aggregator.isDefined) map else buffer val it = collection.destructiveSortedWritablePartitionedIterator(comparator) - while (it.hasNext()) { + while (it.hasNext) { val partitionId = it.nextPartition() var partitionWriter: ShufflePartitionWriter = null var partitionPairsWriter: ShufflePartitionPairsWriter = null @@ -850,18 +866,7 @@ private[spark] class ExternalSorter[K, V, C]( if (hasSpilled) { false } else { - val inMemoryIterator = new WritablePartitionedIterator { - private[this] var cur = if (upstream.hasNext) upstream.next() else null - - def writeNext(writer: PairsWriter): Unit = { - writer.write(cur._1._2, cur._2) - cur = if (upstream.hasNext) upstream.next() else null - } - - def hasNext(): Boolean = cur != null - - def nextPartition(): Int = cur._1._1 - } + val inMemoryIterator = new WritablePartitionedIterator[K, C](upstream) logInfo(s"Task ${TaskContext.get().taskAttemptId} force spilling in-memory map to disk " + s"and it will release ${org.apache.spark.util.Utils.bytesToString(getUsed())} memory") val spillFile = spillMemoryIteratorToDisk(inMemoryIterator) diff --git a/core/src/main/scala/org/apache/spark/util/collection/ImmutableBitSet.scala b/core/src/main/scala/org/apache/spark/util/collection/ImmutableBitSet.scala new file mode 100644 index 0000000000000..82413f4317d62 --- /dev/null +++ b/core/src/main/scala/org/apache/spark/util/collection/ImmutableBitSet.scala @@ -0,0 +1,58 @@ +/* + * 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. + */ + +package org.apache.spark.util.collection + +private object ErrorMessage { + final val msg: String = "mutable operation is not supported" +} + +// An immutable BitSet that initializes set bits in its constructor. +class ImmutableBitSet(val numBits: Int, val bitsToSet: Int*) extends BitSet(numBits) { + + // Initialize the set bits. + { + val bitsIterator = bitsToSet.iterator + while (bitsIterator.hasNext) { + super.set(bitsIterator.next) + } + } + + override def clear(): Unit = { + throw new UnsupportedOperationException(ErrorMessage.msg) + } + + override def clearUntil(bitIndex: Int): Unit = { + throw new UnsupportedOperationException(ErrorMessage.msg) + } + + override def set(index: Int): Unit = { + throw new UnsupportedOperationException(ErrorMessage.msg) + } + + override def setUntil(bitIndex: Int): Unit = { + throw new UnsupportedOperationException(ErrorMessage.msg) + } + + override def unset(index: Int): Unit = { + throw new UnsupportedOperationException(ErrorMessage.msg) + } + + override def union(other: BitSet): Unit = { + throw new UnsupportedOperationException(ErrorMessage.msg) + } +} diff --git a/core/src/main/scala/org/apache/spark/util/collection/MedianHeap.scala b/core/src/main/scala/org/apache/spark/util/collection/MedianHeap.scala index 6e57c3c5bee8c..f1a3932bb0e25 100644 --- a/core/src/main/scala/org/apache/spark/util/collection/MedianHeap.scala +++ b/core/src/main/scala/org/apache/spark/util/collection/MedianHeap.scala @@ -37,13 +37,13 @@ private[spark] class MedianHeap(implicit val ord: Ordering[Double]) { * Stores all the numbers less than the current median in a smallerHalf, * i.e median is the maximum, at the root. */ - private[this] var smallerHalf = PriorityQueue.empty[Double](ord) + private[this] val smallerHalf = PriorityQueue.empty[Double](ord) /** * Stores all the numbers greater than the current median in a largerHalf, * i.e median is the minimum, at the root. */ - private[this] var largerHalf = PriorityQueue.empty[Double](ord.reverse) + private[this] val largerHalf = PriorityQueue.empty[Double](ord.reverse) def isEmpty(): Boolean = { smallerHalf.isEmpty && largerHalf.isEmpty diff --git a/core/src/main/scala/org/apache/spark/util/collection/Spillable.scala b/core/src/main/scala/org/apache/spark/util/collection/Spillable.scala index 1983b0002853d..fe488f9cf0daf 100644 --- a/core/src/main/scala/org/apache/spark/util/collection/Spillable.scala +++ b/core/src/main/scala/org/apache/spark/util/collection/Spillable.scala @@ -27,7 +27,7 @@ import org.apache.spark.memory.{MemoryConsumer, MemoryMode, TaskMemoryManager} * has been exceeded. */ private[spark] abstract class Spillable[C](taskMemoryManager: TaskMemoryManager) - extends MemoryConsumer(taskMemoryManager) with Logging { + extends MemoryConsumer(taskMemoryManager, MemoryMode.ON_HEAP) with Logging { /** * Spills the current in-memory collection to disk, and releases the memory. * diff --git a/core/src/main/scala/org/apache/spark/util/collection/WritablePartitionedPairCollection.scala b/core/src/main/scala/org/apache/spark/util/collection/WritablePartitionedPairCollection.scala index 9624b02cb407c..3472a08cc329c 100644 --- a/core/src/main/scala/org/apache/spark/util/collection/WritablePartitionedPairCollection.scala +++ b/core/src/main/scala/org/apache/spark/util/collection/WritablePartitionedPairCollection.scala @@ -46,20 +46,9 @@ private[spark] trait WritablePartitionedPairCollection[K, V] { * This may destroy the underlying collection. */ def destructiveSortedWritablePartitionedIterator(keyComparator: Option[Comparator[K]]) - : WritablePartitionedIterator = { + : WritablePartitionedIterator[K, V] = { val it = partitionedDestructiveSortedIterator(keyComparator) - new WritablePartitionedIterator { - private[this] var cur = if (it.hasNext) it.next() else null - - def writeNext(writer: PairsWriter): Unit = { - writer.write(cur._1._2, cur._2) - cur = if (it.hasNext) it.next() else null - } - - def hasNext(): Boolean = cur != null - - def nextPartition(): Int = cur._1._1 - } + new WritablePartitionedIterator[K, V](it) } } @@ -87,10 +76,15 @@ private[spark] object WritablePartitionedPairCollection { * Iterator that writes elements to a DiskBlockObjectWriter instead of returning them. Each element * has an associated partition. */ -private[spark] trait WritablePartitionedIterator { - def writeNext(writer: PairsWriter): Unit +private[spark] class WritablePartitionedIterator[K, V](it: Iterator[((Int, K), V)]) { + private[this] var cur = if (it.hasNext) it.next() else null + + def writeNext(writer: PairsWriter): Unit = { + writer.write(cur._1._2, cur._2) + cur = if (it.hasNext) it.next() else null + } - def hasNext(): Boolean + def hasNext: Boolean = cur != null - def nextPartition(): Int + def nextPartition(): Int = cur._1._1 } diff --git a/core/src/main/scala/org/apache/spark/util/io/ChunkedByteBuffer.scala b/core/src/main/scala/org/apache/spark/util/io/ChunkedByteBuffer.scala index 2c3730de08b5b..8635f1a3d702e 100644 --- a/core/src/main/scala/org/apache/spark/util/io/ChunkedByteBuffer.scala +++ b/core/src/main/scala/org/apache/spark/util/io/ChunkedByteBuffer.scala @@ -193,7 +193,7 @@ private[spark] object ChunkedByteBuffer { length: Long): ChunkedByteBuffer = { // We do *not* memory map the file, because we may end up putting this into the memory store, // and spark currently is not expecting memory-mapped buffers in the memory store, it conflicts - // with other parts that manage the lifecyle of buffers and dispose them. See SPARK-25422. + // with other parts that manage the lifecycle of buffers and dispose them. See SPARK-25422. val is = new FileInputStream(file) ByteStreams.skipFully(is, offset) val in = new LimitedInputStream(is, length) diff --git a/core/src/test/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriterSuite.java b/core/src/test/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriterSuite.java index ee8e38c24b47f..5666bb3e5f140 100644 --- a/core/src/test/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriterSuite.java +++ b/core/src/test/java/org/apache/spark/shuffle/sort/UnsafeShuffleWriterSuite.java @@ -68,10 +68,10 @@ public class UnsafeShuffleWriterSuite { static final int DEFAULT_INITIAL_SORT_BUFFER_SIZE = 4096; - static final int NUM_PARTITITONS = 4; + static final int NUM_PARTITIONS = 4; TestMemoryManager memoryManager; TaskMemoryManager taskMemoryManager; - final HashPartitioner hashPartitioner = new HashPartitioner(NUM_PARTITITONS); + final HashPartitioner hashPartitioner = new HashPartitioner(NUM_PARTITIONS); File mergedOutputFile; File tempDir; long[] partitionSizesInMergedFile; @@ -97,8 +97,8 @@ public void tearDown() { @Before @SuppressWarnings("unchecked") - public void setUp() throws IOException { - MockitoAnnotations.initMocks(this); + public void setUp() throws Exception { + MockitoAnnotations.openMocks(this).close(); tempDir = Utils.createTempDir(null, "test"); mergedOutputFile = File.createTempFile("mergedoutput", "", tempDir); partitionSizesInMergedFile = null; @@ -194,7 +194,7 @@ private void assertSpillFilesWereCleanedUp() { private List> readRecordsFromFile() throws IOException { final ArrayList> recordsList = new ArrayList<>(); long startOffset = 0; - for (int i = 0; i < NUM_PARTITITONS; i++) { + for (int i = 0; i < NUM_PARTITIONS; i++) { final long partitionSize = partitionSizesInMergedFile[i]; if (partitionSize > 0) { FileInputStream fin = new FileInputStream(mergedOutputFile); @@ -253,7 +253,7 @@ public void writeEmptyIterator() throws Exception { assertTrue(mapStatus.isDefined()); assertTrue(mergedOutputFile.exists()); assertEquals(0, spillFilesCreated.size()); - assertArrayEquals(new long[NUM_PARTITITONS], partitionSizesInMergedFile); + assertArrayEquals(new long[NUM_PARTITIONS], partitionSizesInMergedFile); assertEquals(0, taskMetrics.shuffleWriteMetrics().recordsWritten()); assertEquals(0, taskMetrics.shuffleWriteMetrics().bytesWritten()); assertEquals(0, taskMetrics.diskBytesSpilled()); @@ -264,7 +264,7 @@ public void writeEmptyIterator() throws Exception { public void writeWithoutSpilling() throws Exception { // In this example, each partition should have exactly one record: final ArrayList> dataToWrite = new ArrayList<>(); - for (int i = 0; i < NUM_PARTITITONS; i++) { + for (int i = 0; i < NUM_PARTITIONS; i++) { dataToWrite.add(new Tuple2<>(i, i)); } final UnsafeShuffleWriter writer = createWriter(true); diff --git a/core/src/test/java/org/apache/spark/unsafe/map/AbstractBytesToBytesMapSuite.java b/core/src/test/java/org/apache/spark/unsafe/map/AbstractBytesToBytesMapSuite.java index 6e995a3929a75..fec205924938a 100644 --- a/core/src/test/java/org/apache/spark/unsafe/map/AbstractBytesToBytesMapSuite.java +++ b/core/src/test/java/org/apache/spark/unsafe/map/AbstractBytesToBytesMapSuite.java @@ -24,6 +24,7 @@ import scala.Tuple2$; +import org.hamcrest.MatcherAssert; import org.junit.After; import org.junit.Assert; import org.junit.Before; @@ -75,7 +76,7 @@ public abstract class AbstractBytesToBytesMapSuite { @Mock(answer = RETURNS_SMART_NULLS) DiskBlockManager diskBlockManager; @Before - public void setup() { + public void setup() throws Exception { memoryManager = new TestMemoryManager( new SparkConf() @@ -87,7 +88,7 @@ public void setup() { tempDir = Utils.createTempDir(System.getProperty("java.io.tmpdir"), "unsafe-test"); spillFilesCreated.clear(); - MockitoAnnotations.initMocks(this); + MockitoAnnotations.openMocks(this).close(); when(blockManager.diskBlockManager()).thenReturn(diskBlockManager); when(diskBlockManager.createTempLocalBlock()).thenAnswer(invocationOnMock -> { TempLocalBlockId blockId = new TempLocalBlockId(UUID.randomUUID()); @@ -172,6 +173,7 @@ public void emptyMap() { final byte[] key = getRandomByteArray(keyLengthInWords); Assert.assertFalse(map.lookup(key, Platform.BYTE_ARRAY_OFFSET, keyLengthInBytes).isDefined()); Assert.assertFalse(map.iterator().hasNext()); + Assert.assertFalse(map.iteratorWithKeyIndex().hasNext()); } finally { map.free(); } @@ -233,9 +235,10 @@ public void setAndRetrieveAKey() { } } - private void iteratorTestBase(boolean destructive) throws Exception { + private void iteratorTestBase(boolean destructive, boolean isWithKeyIndex) throws Exception { final int size = 4096; BytesToBytesMap map = new BytesToBytesMap(taskMemoryManager, size / 2, PAGE_SIZE_BYTES); + Assert.assertEquals(size / 2, map.maxNumKeysIndex()); try { for (long i = 0; i < size; i++) { final long[] value = new long[] { i }; @@ -267,6 +270,8 @@ private void iteratorTestBase(boolean destructive) throws Exception { final Iterator iter; if (destructive) { iter = map.destructiveIterator(); + } else if (isWithKeyIndex) { + iter = map.iteratorWithKeyIndex(); } else { iter = map.iterator(); } @@ -291,6 +296,12 @@ private void iteratorTestBase(boolean destructive) throws Exception { countFreedPages++; } } + if (keyLength != 0 && isWithKeyIndex) { + final BytesToBytesMap.Location expectedLoc = map.lookup( + loc.getKeyBase(), loc.getKeyOffset(), loc.getKeyLength()); + Assert.assertTrue(expectedLoc.isDefined() && + expectedLoc.getKeyIndex() == loc.getKeyIndex()); + } } if (destructive) { // Latest page is not freed by iterator but by map itself @@ -304,12 +315,17 @@ private void iteratorTestBase(boolean destructive) throws Exception { @Test public void iteratorTest() throws Exception { - iteratorTestBase(false); + iteratorTestBase(false, false); } @Test public void destructiveIteratorTest() throws Exception { - iteratorTestBase(true); + iteratorTestBase(true, false); + } + + @Test + public void iteratorWithKeyIndexTest() throws Exception { + iteratorTestBase(false, true); } @Test @@ -524,7 +540,7 @@ public void failureToGrow() { break; } } - Assert.assertThat(i, greaterThan(0)); + MatcherAssert.assertThat(i, greaterThan(0)); Assert.assertFalse(success); } finally { map.free(); @@ -561,6 +577,8 @@ public void spillInIterator() throws IOException { iter2.next(); } assertFalse(iter2.hasNext()); + // calls hasNext twice deliberately, make sure it's idempotent + assertFalse(iter2.hasNext()); } finally { map.free(); for (File spillFile : spillFilesCreated) { @@ -603,6 +621,12 @@ public void multipleValuesForSameKey() { final BytesToBytesMap.Location loc = iter.next(); assert loc.isDefined(); } + BytesToBytesMap.MapIteratorWithKeyIndex iterWithKeyIndex = map.iteratorWithKeyIndex(); + for (i = 0; i < 2048; i++) { + assert iterWithKeyIndex.hasNext(); + final BytesToBytesMap.Location loc = iterWithKeyIndex.next(); + assert loc.isDefined() && loc.getKeyIndex() >= 0; + } } finally { map.free(); } diff --git a/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorterSuite.java b/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorterSuite.java index 43977717f6c97..b96f2cc0d7159 100644 --- a/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorterSuite.java +++ b/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeExternalSorterSuite.java @@ -23,9 +23,9 @@ import java.util.LinkedList; import java.util.UUID; -import org.hamcrest.Matchers; import scala.Tuple2$; +import org.hamcrest.MatcherAssert; import org.junit.After; import org.junit.Before; import org.junit.Test; @@ -38,7 +38,6 @@ import org.apache.spark.executor.TaskMetrics; import org.apache.spark.internal.config.package$; import org.apache.spark.memory.TestMemoryManager; -import org.apache.spark.memory.SparkOutOfMemoryError; import org.apache.spark.memory.TaskMemoryManager; import org.apache.spark.serializer.JavaSerializer; import org.apache.spark.serializer.SerializerInstance; @@ -95,8 +94,8 @@ public int compare( (int) conf.get(package$.MODULE$.SHUFFLE_SPILL_NUM_ELEMENTS_FORCE_SPILL_THRESHOLD()); @Before - public void setUp() { - MockitoAnnotations.initMocks(this); + public void setUp() throws Exception { + MockitoAnnotations.openMocks(this).close(); tempDir = Utils.createTempDir(System.getProperty("java.io.tmpdir"), "unsafe-test"); spillFilesCreated.clear(); taskContext = mock(TaskContext.class); @@ -226,7 +225,7 @@ public void testSortTimeMetric() throws Exception { sorter.insertRecord(null, 0, 0, 0, false); sorter.spill(); - assertThat(sorter.getSortTimeNanos(), greaterThan(prevSortTime)); + MatcherAssert.assertThat(sorter.getSortTimeNanos(), greaterThan(prevSortTime)); prevSortTime = sorter.getSortTimeNanos(); sorter.spill(); // no sort needed @@ -234,7 +233,7 @@ public void testSortTimeMetric() throws Exception { sorter.insertRecord(null, 0, 0, 0, false); UnsafeSorterIterator iter = sorter.getSortedIterator(); - assertThat(sorter.getSortTimeNanos(), greaterThan(prevSortTime)); + MatcherAssert.assertThat(sorter.getSortTimeNanos(), greaterThan(prevSortTime)); sorter.cleanupResources(); assertSpillFilesWereCleanedUp(); @@ -253,7 +252,7 @@ public void spillingOccursInResponseToMemoryPressure() throws Exception { // The insertion of this record should trigger a spill: insertNumber(sorter, 0); // Ensure that spill files were created - assertThat(tempDir.listFiles().length, greaterThanOrEqualTo(1)); + MatcherAssert.assertThat(tempDir.listFiles().length, greaterThanOrEqualTo(1)); // Read back the sorted data: UnsafeSorterIterator iter = sorter.getSortedIterator(); @@ -359,6 +358,69 @@ public void forcedSpillingWithReadIterator() throws Exception { assertSpillFilesWereCleanedUp(); } + @Test + public void forcedSpillingNullsWithReadIterator() throws Exception { + final UnsafeExternalSorter sorter = newSorter(); + long[] record = new long[100]; + final int recordSize = record.length * 8; + final int n = (int) pageSizeBytes / recordSize * 3; + for (int i = 0; i < n; i++) { + boolean isNull = i % 2 == 0; + sorter.insertRecord(record, Platform.LONG_ARRAY_OFFSET, recordSize, 0, isNull); + } + assertTrue(sorter.getNumberOfAllocatedPages() >= 2); + + UnsafeExternalSorter.SpillableIterator iter = + (UnsafeExternalSorter.SpillableIterator) sorter.getSortedIterator(); + final int numRecordsToReadBeforeSpilling = n / 3; + for (int i = 0; i < numRecordsToReadBeforeSpilling; i++) { + assertTrue(iter.hasNext()); + iter.loadNext(); + } + + assertTrue(iter.spill() > 0); + assertEquals(0, iter.spill()); + + for (int i = numRecordsToReadBeforeSpilling; i < n; i++) { + assertTrue(iter.hasNext()); + iter.loadNext(); + } + assertFalse(iter.hasNext()); + + sorter.cleanupResources(); + assertSpillFilesWereCleanedUp(); + } + + @Test + public void forcedSpillingWithFullyReadIterator() throws Exception { + final UnsafeExternalSorter sorter = newSorter(); + long[] record = new long[100]; + final int recordSize = record.length * 8; + final int n = (int) pageSizeBytes / recordSize * 3; + for (int i = 0; i < n; i++) { + record[0] = i; + sorter.insertRecord(record, Platform.LONG_ARRAY_OFFSET, recordSize, 0, false); + } + assertTrue(sorter.getNumberOfAllocatedPages() >= 2); + + UnsafeExternalSorter.SpillableIterator iter = + (UnsafeExternalSorter.SpillableIterator) sorter.getSortedIterator(); + for (int i = 0; i < n; i++) { + assertTrue(iter.hasNext()); + iter.loadNext(); + assertEquals(i, Platform.getLong(iter.getBaseObject(), iter.getBaseOffset())); + } + assertFalse(iter.hasNext()); + + assertTrue(iter.spill() > 0); + assertEquals(0, iter.spill()); + assertEquals(n - 1, Platform.getLong(iter.getBaseObject(), iter.getBaseOffset())); + assertFalse(iter.hasNext()); + + sorter.cleanupResources(); + assertSpillFilesWereCleanedUp(); + } + @Test public void forcedSpillingWithNotReadIterator() throws Exception { final UnsafeExternalSorter sorter = newSorter(); @@ -518,40 +580,28 @@ public void testGetIterator() throws Exception { } @Test - public void testOOMDuringSpill() throws Exception { + public void testNoOOMDuringSpill() throws Exception { final UnsafeExternalSorter sorter = newSorter(); - // we assume that given default configuration, - // the size of the data we insert to the sorter (ints) - // and assuming we shouldn't spill before pointers array is exhausted - // (memory manager is not configured to throw at this point) - // - so this loop runs a reasonable number of iterations (<2000). - // test indeed completed within <30ms (on a quad i7 laptop). - for (int i = 0; sorter.hasSpaceForAnotherRecord(); ++i) { + for (int i = 0; i < 100; i++) { insertNumber(sorter, i); } - // we expect the next insert to attempt growing the pointerssArray first - // allocation is expected to fail, then a spill is triggered which - // attempts another allocation which also fails and we expect to see this - // OOM here. the original code messed with a released array within the - // spill code and ended up with a failed assertion. we also expect the - // location of the OOM to be - // org.apache.spark.util.collection.unsafe.sort.UnsafeInMemorySorter.reset - memoryManager.markconsequentOOM(2); - try { - insertNumber(sorter, 1024); - fail("expected OutOfMmoryError but it seems operation surprisingly succeeded"); - } - // we expect an SparkOutOfMemoryError here, anything else (i.e the original NPE is a failure) - catch (SparkOutOfMemoryError oom){ - String oomStackTrace = Utils.exceptionString(oom); - assertThat("expected SparkOutOfMemoryError in " + - "org.apache.spark.util.collection.unsafe.sort.UnsafeInMemorySorter.reset", - oomStackTrace, - Matchers.containsString( - "org.apache.spark.util.collection.unsafe.sort.UnsafeInMemorySorter.reset")); + + // Check that spilling still succeeds when the task is starved for memory. + memoryManager.markconsequentOOM(Integer.MAX_VALUE); + sorter.spill(); + memoryManager.resetConsequentOOM(); + + // Ensure that records can be appended after spilling, i.e. check that the sorter will allocate + // the new pointer array that it could not allocate while spilling. + for (int i = 0; i < 100; ++i) { + insertNumber(sorter, i); } + + sorter.cleanupResources(); + assertSpillFilesWereCleanedUp(); } + private void verifyIntIterator(UnsafeSorterIterator iter, int start, int end) throws IOException { for (int i = start; i < end; i++) { diff --git a/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java b/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java index 2b8a0602730e1..9d4909ddce792 100644 --- a/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java +++ b/core/src/test/java/org/apache/spark/util/collection/unsafe/sort/UnsafeInMemorySorterSuite.java @@ -20,6 +20,7 @@ import java.nio.charset.StandardCharsets; import java.util.Arrays; +import org.apache.spark.unsafe.array.LongArray; import org.junit.Assert; import org.junit.Test; @@ -27,7 +28,6 @@ import org.apache.spark.SparkConf; import org.apache.spark.memory.TestMemoryConsumer; import org.apache.spark.memory.TestMemoryManager; -import org.apache.spark.memory.SparkOutOfMemoryError; import org.apache.spark.memory.TaskMemoryManager; import org.apache.spark.unsafe.Platform; import org.apache.spark.unsafe.memory.MemoryBlock; @@ -37,7 +37,6 @@ import static org.hamcrest.Matchers.greaterThanOrEqualTo; import static org.hamcrest.Matchers.isIn; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; public class UnsafeInMemorySorterSuite { @@ -147,7 +146,7 @@ public int compare( } @Test - public void freeAfterOOM() { + public void testNoOOMDuringReset() { final SparkConf sparkConf = new SparkConf(); sparkConf.set(package$.MODULE$.MEMORY_OFFHEAP_ENABLED(), false); @@ -156,12 +155,7 @@ public void freeAfterOOM() { final TaskMemoryManager memoryManager = new TaskMemoryManager( testMemoryManager, 0); final TestMemoryConsumer consumer = new TestMemoryConsumer(memoryManager); - final MemoryBlock dataPage = memoryManager.allocatePage(2048, consumer); - final Object baseObject = dataPage.getBaseObject(); - // Write the records into the data page: - long position = dataPage.getBaseOffset(); - final HashPartitioner hashPartitioner = new HashPartitioner(4); // Use integer comparison for comparing prefixes (which are partition ids, in this case) final PrefixComparator prefixComparator = PrefixComparators.LONG; final RecordComparator recordComparator = new RecordComparator() { @@ -179,18 +173,24 @@ public int compare( UnsafeInMemorySorter sorter = new UnsafeInMemorySorter(consumer, memoryManager, recordComparator, prefixComparator, 100, shouldUseRadixSort()); - testMemoryManager.markExecutionAsOutOfMemoryOnce(); - try { - sorter.reset(); - fail("expected SparkOutOfMemoryError but it seems operation surprisingly succeeded"); - } catch (SparkOutOfMemoryError oom) { - // as expected - } - // [SPARK-21907] this failed on NPE at - // org.apache.spark.memory.MemoryConsumer.freeArray(MemoryConsumer.java:108) - sorter.free(); - // simulate a 'back to back' free. - sorter.free(); + // Ensure that the sorter does not OOM while freeing its memory. + testMemoryManager.markconsequentOOM(Integer.MAX_VALUE); + sorter.freeMemory(); + testMemoryManager.resetConsequentOOM(); + Assert.assertFalse(sorter.hasSpaceForAnotherRecord()); + + // Get the sorter in an usable state again by allocating a new pointer array. + LongArray array = consumer.allocateArray(1000); + sorter.expandPointerArray(array); + + // Ensure that it is safe to call freeMemory() multiple times. + testMemoryManager.markconsequentOOM(Integer.MAX_VALUE); + sorter.freeMemory(); + sorter.freeMemory(); + testMemoryManager.resetConsequentOOM(); + Assert.assertFalse(sorter.hasSpaceForAnotherRecord()); + + assertEquals(0L, memoryManager.cleanUpAllAllocatedMemory()); } } diff --git a/core/src/test/java/test/org/apache/spark/JavaAPISuite.java b/core/src/test/java/test/org/apache/spark/JavaAPISuite.java index dbaca71c5fdc3..e73ac0e9fb7a6 100644 --- a/core/src/test/java/test/org/apache/spark/JavaAPISuite.java +++ b/core/src/test/java/test/org/apache/spark/JavaAPISuite.java @@ -1518,7 +1518,7 @@ public void testAsyncActionErrorWrapping() throws Exception { JavaFutureAction future = rdd.map(new BuggyMapFunction<>()).countAsync(); try { future.get(2, TimeUnit.SECONDS); - fail("Expected future.get() for failed job to throw ExcecutionException"); + fail("Expected future.get() for failed job to throw ExecutionException"); } catch (ExecutionException ee) { assertTrue(Throwables.getStackTraceAsString(ee).contains("Custom exception!")); } diff --git a/core/src/test/java/test/org/apache/spark/JavaSparkContextSuite.java b/core/src/test/java/test/org/apache/spark/JavaSparkContextSuite.java index 0f489fb219010..b188ee16b97d0 100644 --- a/core/src/test/java/test/org/apache/spark/JavaSparkContextSuite.java +++ b/core/src/test/java/test/org/apache/spark/JavaSparkContextSuite.java @@ -28,6 +28,7 @@ import org.apache.spark.api.java.*; import org.apache.spark.*; +import org.apache.spark.util.Utils; /** * Java apps can use both Java-friendly JavaSparkContext and Scala SparkContext. @@ -35,14 +36,16 @@ public class JavaSparkContextSuite implements Serializable { @Test - public void javaSparkContext() { + public void javaSparkContext() throws IOException { + File tempDir = Utils.createTempDir(System.getProperty("java.io.tmpdir"), "spark"); + String dummyJarFile = File.createTempFile(tempDir.toString(), "jarFile").toString(); String[] jars = new String[] {}; java.util.Map environment = new java.util.HashMap<>(); new JavaSparkContext(new SparkConf().setMaster("local").setAppName("name")).stop(); new JavaSparkContext("local", "name", new SparkConf()).stop(); new JavaSparkContext("local", "name").stop(); - new JavaSparkContext("local", "name", "sparkHome", "jarFile").stop(); + new JavaSparkContext("local", "name", "sparkHome", dummyJarFile).stop(); new JavaSparkContext("local", "name", "sparkHome", jars).stop(); new JavaSparkContext("local", "name", "sparkHome", jars, environment).stop(); } diff --git a/core/src/test/resources/HistoryServerExpectations/app_environment_expectation.json b/core/src/test/resources/HistoryServerExpectations/app_environment_expectation.json index a64617256d63a..c2616129de954 100644 --- a/core/src/test/resources/HistoryServerExpectations/app_environment_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/app_environment_expectation.json @@ -5,282 +5,283 @@ "scalaVersion" : "version 2.11.8" }, "sparkProperties" : [ - [ "spark.blacklist.task.maxTaskAttemptsPerExecutor", "3" ], + [ "spark.app.id", "app-20161116163331-0000" ], + [ "spark.app.name", "Spark shell" ], + [ "spark.blacklist.application.maxFailedExecutorsPerNode", "2" ], + [ "spark.blacklist.application.maxFailedTasksPerExecutor", "1" ], [ "spark.blacklist.enabled", "TRUE" ], - [ "spark.driver.host", "172.22.0.167" ], + [ "spark.blacklist.stage.maxFailedExecutorsPerNode", "3" ], + [ "spark.blacklist.stage.maxFailedTasksPerExecutor", "3" ], + [ "spark.blacklist.task.maxTaskAttemptsPerExecutor", "3" ], [ "spark.blacklist.task.maxTaskAttemptsPerNode", "3" ], - [ "spark.eventLog.enabled", "TRUE" ], + [ "spark.blacklist.timeout", "1000000" ], + [ "spark.driver.host", "172.22.0.167" ], [ "spark.driver.port", "51459" ], - [ "spark.repl.class.uri", "spark://172.22.0.167:51459/classes" ], - [ "spark.jars", "" ], - [ "spark.repl.class.outputDir", "/private/var/folders/l4/d46wlzj16593f3d812vk49tw0000gp/T/spark-1cbc97d0-7fe6-4c9f-8c2c-f6fe51ee3cf2/repl-39929169-ac4c-4c6d-b116-f648e4dd62ed" ], - [ "spark.app.name", "Spark shell" ], - [ "spark.blacklist.stage.maxFailedExecutorsPerNode", "3" ], - [ "spark.scheduler.mode", "FIFO" ], + [ "spark.eventLog.compress", "FALSE" ], + [ "spark.eventLog.dir", "/Users/jose/logs" ], + [ "spark.eventLog.enabled", "TRUE" ], [ "spark.eventLog.overwrite", "TRUE" ], - [ "spark.blacklist.stage.maxFailedTasksPerExecutor", "3" ], [ "spark.executor.id", "driver" ], - [ "spark.blacklist.application.maxFailedExecutorsPerNode", "2" ], - [ "spark.submit.deployMode", "client" ], - [ "spark.master", "local-cluster[4,4,1024]" ], [ "spark.home", "/Users/Jose/IdeaProjects/spark" ], - [ "spark.eventLog.dir", "/Users/jose/logs" ], + [ "spark.jars", "" ], + [ "spark.master", "local-cluster[4,4,1024]" ], + [ "spark.repl.class.outputDir", "/private/var/folders/l4/d46wlzj16593f3d812vk49tw0000gp/T/spark-1cbc97d0-7fe6-4c9f-8c2c-f6fe51ee3cf2/repl-39929169-ac4c-4c6d-b116-f648e4dd62ed" ], + [ "spark.repl.class.uri", "spark://172.22.0.167:51459/classes" ], + [ "spark.scheduler.mode", "FIFO" ], [ "spark.sql.catalogImplementation", "in-memory" ], - [ "spark.eventLog.compress", "FALSE" ], - [ "spark.blacklist.application.maxFailedTasksPerExecutor", "1" ], - [ "spark.blacklist.timeout", "1000000" ], - [ "spark.app.id", "app-20161116163331-0000" ], + [ "spark.submit.deployMode", "client" ], [ "spark.task.maxFailures", "4" ] ], "hadoopProperties" : [ + [ "mapreduce.jobhistory.client.thread-count", "10" ], [ "mapreduce.jobtracker.address", "local" ], - [ "yarn.resourcemanager.scheduler.monitor.policies", "org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicy" ], - [ "mapreduce.jobhistory.client.thread-count", "10" ] + [ "yarn.resourcemanager.scheduler.monitor.policies", "org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicy" ] ], "systemProperties" : [ - [ "java.io.tmpdir", "/var/folders/l4/d46wlzj16593f3d812vk49tw0000gp/T/" ], - [ "line.separator", "\n" ], - [ "path.separator", ":" ], - [ "sun.management.compiler", "HotSpot 64-Bit Tiered Compilers" ], [ "SPARK_SUBMIT", "true" ], - [ "sun.cpu.endian", "little" ], - [ "java.specification.version", "1.8" ], - [ "java.vm.specification.name", "Java Virtual Machine Specification" ], - [ "java.vendor", "Oracle Corporation" ], - [ "java.vm.specification.version", "1.8" ], - [ "user.home", "/Users/Jose" ], + [ "awt.toolkit", "sun.lwawt.macosx.LWCToolkit" ], + [ "file.encoding", "UTF-8" ], [ "file.encoding.pkg", "sun.io" ], - [ "sun.nio.ch.bugLevel", "" ], + [ "file.separator", "/" ], [ "ftp.nonProxyHosts", "local|*.local|169.254/16|*.169.254/16" ], - [ "sun.arch.data.model", "64" ], - [ "sun.boot.library.path", "/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib" ], - [ "user.dir", "/Users/Jose/IdeaProjects/spark" ], - [ "java.library.path", "/Users/Jose/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:." ], - [ "sun.cpu.isalist", "" ], - [ "os.arch", "x86_64" ], - [ "java.vm.version", "25.92-b14" ], + [ "gopherProxySet", "false" ], + [ "http.nonProxyHosts", "local|*.local|169.254/16|*.169.254/16" ], + [ "io.netty.maxDirectMemory", "0" ], + [ "java.awt.graphicsenv", "sun.awt.CGraphicsEnvironment" ], + [ "java.awt.printerjob", "sun.lwawt.macosx.CPrinterJob" ], + [ "java.class.version", "52.0" ], [ "java.endorsed.dirs", "/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/endorsed" ], - [ "java.runtime.version", "1.8.0_92-b14" ], - [ "java.vm.info", "mixed mode" ], [ "java.ext.dirs", "/Users/Jose/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java" ], + [ "java.home", "/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre" ], + [ "java.io.tmpdir", "/var/folders/l4/d46wlzj16593f3d812vk49tw0000gp/T/" ], + [ "java.library.path", "/Users/Jose/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:." ], [ "java.runtime.name", "Java(TM) SE Runtime Environment" ], - [ "file.separator", "/" ], - [ "io.netty.maxDirectMemory", "0" ], - [ "java.class.version", "52.0" ], - [ "scala.usejavacp", "true" ], + [ "java.runtime.version", "1.8.0_92-b14" ], [ "java.specification.name", "Java Platform API Specification" ], - [ "sun.boot.class.path", "/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/classes" ], - [ "file.encoding", "UTF-8" ], - [ "user.timezone", "America/Chicago" ], [ "java.specification.vendor", "Oracle Corporation" ], - [ "sun.java.launcher", "SUN_STANDARD" ], + [ "java.specification.version", "1.8" ], + [ "java.vendor", "Oracle Corporation" ], + [ "java.vendor.url", "http://java.oracle.com/" ], + [ "java.vendor.url.bug", "http://bugreport.sun.com/bugreport/" ], + [ "java.version", "1.8.0_92" ], + [ "java.vm.info", "mixed mode" ], + [ "java.vm.name", "Java HotSpot(TM) 64-Bit Server VM" ], + [ "java.vm.specification.name", "Java Virtual Machine Specification" ], + [ "java.vm.specification.vendor", "Oracle Corporation" ], + [ "java.vm.specification.version", "1.8" ], + [ "java.vm.vendor", "Oracle Corporation" ], + [ "java.vm.version", "25.92-b14" ], + [ "line.separator", "\n" ], + [ "os.arch", "x86_64" ], + [ "os.name", "Mac OS X" ], [ "os.version", "10.11.6" ], + [ "path.separator", ":" ], + [ "scala.usejavacp", "true" ], + [ "socksNonProxyHosts", "local|*.local|169.254/16|*.169.254/16" ], + [ "sun.arch.data.model", "64" ], + [ "sun.boot.class.path", "/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/classes" ], + [ "sun.boot.library.path", "/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre/lib" ], + [ "sun.cpu.endian", "little" ], + [ "sun.cpu.isalist", "" ], + [ "sun.io.unicode.encoding", "UnicodeBig" ], + [ "sun.java.command", "org.apache.spark.deploy.SparkSubmit --master local-cluster[4,4,1024] --conf spark.blacklist.enabled=TRUE --conf spark.blacklist.timeout=1000000 --conf spark.blacklist.application.maxFailedTasksPerExecutor=1 --conf spark.eventLog.overwrite=TRUE --conf spark.blacklist.task.maxTaskAttemptsPerNode=3 --conf spark.blacklist.stage.maxFailedTasksPerExecutor=3 --conf spark.blacklist.task.maxTaskAttemptsPerExecutor=3 --conf spark.eventLog.compress=FALSE --conf spark.blacklist.stage.maxFailedExecutorsPerNode=3 --conf spark.eventLog.enabled=TRUE --conf spark.eventLog.dir=/Users/jose/logs --conf spark.blacklist.application.maxFailedExecutorsPerNode=2 --conf spark.task.maxFailures=4 --class org.apache.spark.repl.Main --name Spark shell spark-shell -i /Users/Jose/dev/jose-utils/blacklist/test-blacklist.scala" ], + [ "sun.java.launcher", "SUN_STANDARD" ], + [ "sun.jnu.encoding", "UTF-8" ], + [ "sun.management.compiler", "HotSpot 64-Bit Tiered Compilers" ], + [ "sun.nio.ch.bugLevel", "" ], [ "sun.os.patch.level", "unknown" ], - [ "gopherProxySet", "false" ], - [ "java.vm.specification.vendor", "Oracle Corporation" ], [ "user.country", "US" ], - [ "sun.jnu.encoding", "UTF-8" ], - [ "http.nonProxyHosts", "local|*.local|169.254/16|*.169.254/16" ], + [ "user.dir", "/Users/Jose/IdeaProjects/spark" ], + [ "user.home", "/Users/Jose" ], [ "user.language", "en" ], - [ "socksNonProxyHosts", "local|*.local|169.254/16|*.169.254/16" ], - [ "java.vendor.url", "http://java.oracle.com/" ], - [ "java.awt.printerjob", "sun.lwawt.macosx.CPrinterJob" ], - [ "java.awt.graphicsenv", "sun.awt.CGraphicsEnvironment" ], - [ "awt.toolkit", "sun.lwawt.macosx.LWCToolkit" ], - [ "os.name", "Mac OS X" ], - [ "java.vm.vendor", "Oracle Corporation" ], - [ "java.vendor.url.bug", "http://bugreport.sun.com/bugreport/" ], [ "user.name", "jose" ], - [ "java.vm.name", "Java HotSpot(TM) 64-Bit Server VM" ], - [ "sun.java.command", "org.apache.spark.deploy.SparkSubmit --master local-cluster[4,4,1024] --conf spark.blacklist.enabled=TRUE --conf spark.blacklist.timeout=1000000 --conf spark.blacklist.application.maxFailedTasksPerExecutor=1 --conf spark.eventLog.overwrite=TRUE --conf spark.blacklist.task.maxTaskAttemptsPerNode=3 --conf spark.blacklist.stage.maxFailedTasksPerExecutor=3 --conf spark.blacklist.task.maxTaskAttemptsPerExecutor=3 --conf spark.eventLog.compress=FALSE --conf spark.blacklist.stage.maxFailedExecutorsPerNode=3 --conf spark.eventLog.enabled=TRUE --conf spark.eventLog.dir=/Users/jose/logs --conf spark.blacklist.application.maxFailedExecutorsPerNode=2 --conf spark.task.maxFailures=4 --class org.apache.spark.repl.Main --name Spark shell spark-shell -i /Users/Jose/dev/jose-utils/blacklist/test-blacklist.scala" ], - [ "java.home", "/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/jre" ], - [ "java.version", "1.8.0_92" ], - [ "sun.io.unicode.encoding", "UnicodeBig" ] + [ "user.timezone", "America/Chicago" ] ], "classpathEntries" : [ - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/avro-mapred-1.7.7-hadoop2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-mapreduce-client-core-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-servlet-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/parquet-column-1.8.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/snappy-java-1.1.2.6.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/oro-2.0.8.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/RoaringBitmap-0.5.11.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/antlr4-runtime-4.5.3.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/aopalliance-1.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/aopalliance-repackaged-2.4.0-b34.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/arpack_combined_all-0.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/pmml-schema-1.2.15.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-assembly_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/javassist-3.18.1-GA.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-tags_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-launcher_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/avro-1.7.7.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/avro-ipc-1.7.7-tests.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/avro-ipc-1.7.7.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/avro-mapred-1.7.7-hadoop2.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/breeze-macros_2.11-0.12.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/breeze_2.11-0.12.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/cglib-2.2.1-v20090111.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/chill-java-0.8.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/chill_2.11-0.8.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-beanutils-1.7.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-beanutils-core-1.8.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-cli-1.2.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-codec-1.10.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-collections-3.2.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-compiler-3.0.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-compress-1.4.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-configuration-1.6.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-crypto-1.0.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-digester-1.8.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-httpclient-3.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-io-2.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-lang-2.5.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-lang3-3.5.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-math-2.1.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-math3-3.4.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-net-3.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/compress-lzf-1.0.3.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/core-1.1.2.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/curator-client-2.4.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/curator-framework-2.4.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/curator-recipes-2.4.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/guava-14.0.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/guice-3.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-annotations-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-auth-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-client-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-common-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-hdfs-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-mapreduce-client-app-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-mapreduce-client-common-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-mapreduce-client-core-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-mapreduce-client-jobclient-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-mapreduce-client-shuffle-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-yarn-api-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-yarn-client-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-yarn-common-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-yarn-server-common-2.2.0.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hk2-api-2.4.0-b34.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scala-xml_2.11-1.0.4.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/objenesis-2.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spire-macros_2.11-0.7.4.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scala-reflect-2.11.8.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-mllib-local_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-mllib_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-server-2.22.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/core/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hk2-locator-2.4.0-b34.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hk2-utils-2.4.0-b34.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/ivy-2.4.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jackson-annotations-2.6.5.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jackson-core-2.6.5.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jackson-core-asl-1.9.13.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jackson-databind-2.6.5.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jackson-mapper-asl-1.9.13.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jackson-module-paranamer-2.6.5.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jackson-module-scala_2.11-2.6.5.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/curator-framework-2.4.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/janino-3.0.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/javassist-3.18.1-GA.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/javax.annotation-api-1.2.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/javax.inject-1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/curator-client-2.4.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jackson-core-asl-1.9.13.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/common/network-common/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/zookeeper-3.4.5.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-auth-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/repl/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jul-to-slf4j-1.7.16.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-media-jaxb-2.22.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-io-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/RoaringBitmap-0.5.11.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/javax.inject-2.4.0-b34.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/javax.servlet-api-3.1.0.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/javax.ws.rs-api-2.0.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/sql/catalyst/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-unsafe_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-repl_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-continuation-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-yarn-client-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/sql/hive-thriftserver/target/scala-2.11/classes", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-annotations-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/metrics-graphite-3.1.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-yarn-api-2.2.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jcl-over-slf4j-1.7.16.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-client-2.22.2.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-common-2.22.2.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-container-servlet-2.22.2.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-container-servlet-core-2.22.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/streaming/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-net-3.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-guava-2.22.2.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-media-jaxb-2.22.2.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-server-2.22.2.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jets3t-0.7.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-client-9.2.16.v20160414.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-continuation-9.2.16.v20160414.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-http-9.2.16.v20160414.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-io-9.2.16.v20160414.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-jndi-9.2.16.v20160414.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-plus-9.2.16.v20160414.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-proxy-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-catalyst_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/lz4-1.3.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-crypto-1.0.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/common/network-yarn/target/scala-2.11/classes", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/javax.annotation-api-1.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-sql_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/guava-14.0.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/javax.servlet-api-3.1.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-collections-3.2.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/conf/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/unused-1.0.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/aopalliance-1.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/parquet-encoding-1.8.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/common/tags/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/json4s-jackson_2.11-3.2.11.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-cli-1.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-yarn-server-common-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/cglib-2.2.1-v20090111.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/pyrolite-4.13.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scala-library-2.11.8.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scala-parser-combinators_2.11-1.0.4.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-security-9.2.16.v20160414.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-server-9.2.16.v20160414.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-servlet-9.2.16.v20160414.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-servlets-9.2.16.v20160414.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-util-6.1.26.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/py4j-0.10.4.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-configuration-1.6.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/core-1.1.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/core/target/jars/*", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/common/network-shuffle/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/parquet-format-2.3.0-incubating.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-util-9.2.16.v20160414.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-webapp-9.2.16.v20160414.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-xml-9.2.16.v20160414.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jline-2.12.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/json4s-ast_2.11-3.2.11.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/json4s-core_2.11-3.2.11.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/json4s-jackson_2.11-3.2.11.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jsr305-1.3.9.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jtransforms-2.4.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jul-to-slf4j-1.7.16.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/kryo-shaded-3.0.3.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/sql/core/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/chill-java-0.8.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jackson-annotations-2.6.5.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/parquet-hadoop-1.8.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/sql/hive/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/avro-ipc-1.7.7.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/xz-1.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/parquet-jackson-1.8.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/aopalliance-repackaged-2.4.0-b34.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-common-2.22.2.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/leveldbjni-all-1.8.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/log4j-1.2.17.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/lz4-1.3.0.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/metrics-core-3.1.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-util-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scalap-2.11.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/osgi-resource-locator-1.0.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-beanutils-1.7.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-compress-1.4.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jcl-over-slf4j-1.7.16.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/yarn/target/scala-2.11/classes", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-plus-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/protobuf-java-2.5.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/common/unsafe/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jackson-module-paranamer-2.6.5.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/leveldbjni-all-1.8.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jackson-core-2.6.5.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/slf4j-api-1.7.16.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/compress-lzf-1.0.3.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/stream-2.7.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-mapreduce-client-shuffle-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-codec-1.10.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-yarn-common-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/common/sketch/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/breeze_2.11-0.12.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-mapreduce-client-common-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-core_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-container-servlet-2.22.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-network-shuffle_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-lang-2.5.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/ivy-2.4.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-common-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-math-2.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-hdfs-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scala-compiler-2.11.8.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/metrics-graphite-3.1.2.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/metrics-json-3.1.2.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/metrics-jvm-3.1.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-lang3-3.5.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jsr305-1.3.9.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/minlog-1.3.0.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/netty-3.8.0.Final.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-webapp-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/json4s-ast_2.11-3.2.11.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/xbean-asm5-shaded-4.4.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-io-2.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/slf4j-log4j12-1.7.16.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hk2-locator-2.4.0-b34.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/netty-all-4.0.41.Final.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/objenesis-2.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/opencsv-2.3.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/oro-2.0.8.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/osgi-resource-locator-1.0.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/paranamer-2.6.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/parquet-column-1.8.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/parquet-common-1.8.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/parquet-encoding-1.8.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/parquet-format-2.3.0-incubating.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/parquet-hadoop-1.8.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/parquet-jackson-1.8.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/pmml-model-1.2.15.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/pmml-schema-1.2.15.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/protobuf-java-2.5.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/py4j-0.10.4.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/pyrolite-4.13.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scala-compiler-2.11.8.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scala-library-2.11.8.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scala-parser-combinators_2.11-1.0.4.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scala-reflect-2.11.8.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scala-xml_2.11-1.0.4.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scalap-2.11.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scalatest_2.11-2.2.6.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/shapeless_2.11-2.0.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/slf4j-api-1.7.16.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/slf4j-log4j12-1.7.16.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/snappy-java-1.1.2.6.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-assembly_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-catalyst_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-core_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-graphx_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-launcher_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-mllib-local_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-mllib_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-network-common_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-xml-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-httpclient-3.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/javax.inject-2.4.0-b34.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/mllib/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/scalatest_2.11-2.2.6.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hk2-utils-2.4.0-b34.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-client-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-guava-2.22.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-jndi-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/graphx/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-mapreduce-client-app-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/examples/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/xmlenc-0.52.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jets3t-0.7.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/curator-recipes-2.4.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/opencsv-2.3.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jtransforms-2.4.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/antlr4-runtime-4.5.3.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/chill_2.11-0.8.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-digester-1.8.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/univocity-parsers-2.2.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jline-2.12.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-network-shuffle_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-repl_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-sketch_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-sql_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-streaming_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/launcher/target/scala-2.11/classes/", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/breeze-macros_2.11-0.12.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jersey-client-2.22.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jackson-databind-2.6.5.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-servlets-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/paranamer-2.6.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-security-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/avro-ipc-1.7.7-tests.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/avro-1.7.7.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-tags_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-unsafe_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spire-macros_2.11-0.7.4.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spire_2.11-0.7.4.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-client-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/metrics-json-3.1.2.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-beanutils-core-1.8.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/stream-2.7.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/univocity-parsers-2.2.1.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/unused-1.0.0.jar", "System Classpath" ], [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/validation-api-1.1.0.Final.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-graphx_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/netty-all-4.0.41.Final.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/janino-3.0.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/json4s-core_2.11-3.2.11.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/commons-compiler-3.0.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/guice-3.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-server-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/jetty-http-9.2.16.v20160414.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/parquet-common-1.8.1.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/hadoop-mapreduce-client-jobclient-2.2.0.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/spark-sketch_2.11-2.1.0-SNAPSHOT.jar", "System Classpath" ], - [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/pmml-model-1.2.15.jar", "System Classpath" ] - ] + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/xbean-asm5-shaded-4.4.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/xmlenc-0.52.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/xz-1.0.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/assembly/target/scala-2.11/jars/zookeeper-3.4.5.jar", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/common/network-common/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/common/network-shuffle/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/common/network-yarn/target/scala-2.11/classes", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/common/sketch/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/common/tags/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/common/unsafe/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/conf/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/core/target/jars/*", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/core/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/examples/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/graphx/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/launcher/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/mllib/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/repl/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/sql/catalyst/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/sql/core/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/sql/hive-thriftserver/target/scala-2.11/classes", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/sql/hive/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/streaming/target/scala-2.11/classes/", "System Classpath" ], + [ "/Users/Jose/IdeaProjects/spark/yarn/target/scala-2.11/classes", "System Classpath" ] + ], + "resourceProfiles" : [ ] } diff --git a/core/src/test/resources/HistoryServerExpectations/application_list_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/application_list_json_expectation.json index 6e6d28b6a57ec..06015ec46e44d 100644 --- a/core/src/test/resources/HistoryServerExpectations/application_list_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/application_list_json_expectation.json @@ -1,4 +1,34 @@ [ { + "id" : "app-20200706201101-0003", + "name" : "Spark shell", + "attempts" : [ { + "startTime" : "2020-07-07T03:11:00.235GMT", + "endTime" : "2020-07-07T03:17:04.231GMT", + "lastUpdated" : "", + "duration" : 363996, + "sparkUser" : "terryk", + "completed" : true, + "appSparkVersion" : "3.1.0-SNAPSHOT", + "endTimeEpoch" : 1594091824231, + "startTimeEpoch" : 1594091460235, + "lastUpdatedEpoch" : 0 + } ] +}, { + "id" : "application_1578436911597_0052", + "name" : "Spark shell", + "attempts" : [ { + "startTime" : "2020-01-11T17:44:22.851GMT", + "endTime" : "2020-01-11T17:46:42.615GMT", + "lastUpdated" : "", + "duration" : 139764, + "sparkUser" : "tgraves", + "completed" : true, + "appSparkVersion" : "3.0.0-SNAPSHOT", + "endTimeEpoch" : 1578764802615, + "startTimeEpoch" : 1578764662851, + "lastUpdatedEpoch" : 0 + } ] +}, { "id" : "application_1555004656427_0144", "name" : "Spark shell", "attempts" : [ { diff --git a/core/src/test/resources/HistoryServerExpectations/blacklisting_for_stage_expectation.json b/core/src/test/resources/HistoryServerExpectations/blacklisting_for_stage_expectation.json deleted file mode 100644 index b18b19f7eeffb..0000000000000 --- a/core/src/test/resources/HistoryServerExpectations/blacklisting_for_stage_expectation.json +++ /dev/null @@ -1,721 +0,0 @@ -{ - "status" : "COMPLETE", - "stageId" : 0, - "attemptId" : 0, - "numTasks" : 10, - "numActiveTasks" : 0, - "numCompleteTasks" : 10, - "numFailedTasks" : 2, - "numKilledTasks" : 0, - "numCompletedIndices" : 10, - "submissionTime" : "2018-01-09T10:21:18.152GMT", - "firstTaskLaunchedTime" : "2018-01-09T10:21:18.347GMT", - "completionTime" : "2018-01-09T10:21:19.062GMT", - "executorDeserializeTime" : 327, - "executorDeserializeCpuTime" : 225900000, - "executorRunTime" : 761, - "executorCpuTime" : 269916000, - "resultSize" : 10376, - "jvmGcTime" : 27, - "resultSerializationTime" : 1, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputBytes" : 0, - "inputRecords" : 0, - "outputBytes" : 0, - "outputRecords" : 0, - "shuffleRemoteBlocksFetched" : 0, - "shuffleLocalBlocksFetched" : 0, - "shuffleFetchWaitTime" : 0, - "shuffleRemoteBytesRead" : 0, - "shuffleRemoteBytesReadToDisk" : 0, - "shuffleLocalBytesRead" : 0, - "shuffleReadBytes" : 0, - "shuffleReadRecords" : 0, - "shuffleWriteBytes" : 460, - "shuffleWriteTime" : 8711515, - "shuffleWriteRecords" : 10, - "name" : "map at :26", - "details" : "org.apache.spark.rdd.RDD.map(RDD.scala:370)\n$line17.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:26)\n$line17.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:34)\n$line17.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:36)\n$line17.$read$$iw$$iw$$iw$$iw$$iw.(:38)\n$line17.$read$$iw$$iw$$iw$$iw.(:40)\n$line17.$read$$iw$$iw$$iw.(:42)\n$line17.$read$$iw$$iw.(:44)\n$line17.$read$$iw.(:46)\n$line17.$read.(:48)\n$line17.$read$.(:52)\n$line17.$read$.()\n$line17.$eval$.$print$lzycompute(:7)\n$line17.$eval$.$print(:6)\n$line17.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\nscala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:786)", - "schedulingPool" : "default", - "rddIds" : [ 1, 0 ], - "accumulatorUpdates" : [ ], - "tasks" : { - "0" : { - "taskId" : 0, - "index" : 0, - "attempt" : 0, - "launchTime" : "2018-01-09T10:21:18.347GMT", - "duration" : 562, - "executorId" : "0", - "host" : "172.30.65.138", - "status" : "FAILED", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "errorMessage" : "java.lang.RuntimeException: Bad executor\n\tat $line17.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:27)\n\tat $line17.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:193)\n\tat org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:109)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n", - "taskMetrics" : { - "executorDeserializeTime" : 0, - "executorDeserializeCpuTime" : 0, - "executorRunTime" : 460, - "executorCpuTime" : 0, - "resultSize" : 0, - "jvmGcTime" : 14, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 0, - "writeTime" : 3873006, - "recordsWritten" : 0 - } - }, - "executorLogs" : { - "stdout" : "http://172.30.65.138:64279/logPage/?appId=app-20180109111548-0000&executorId=0&logType=stdout", - "stderr" : "http://172.30.65.138:64279/logPage/?appId=app-20180109111548-0000&executorId=0&logType=stderr" - }, - "schedulerDelay" : 102, - "gettingResultTime" : 0 - }, - "5" : { - "taskId" : 5, - "index" : 3, - "attempt" : 0, - "launchTime" : "2018-01-09T10:21:18.958GMT", - "duration" : 22, - "executorId" : "1", - "host" : "172.30.65.138", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 3, - "executorDeserializeCpuTime" : 2586000, - "executorRunTime" : 9, - "executorCpuTime" : 9635000, - "resultSize" : 1029, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 46, - "writeTime" : 262919, - "recordsWritten" : 1 - } - }, - "executorLogs" : { - "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", - "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" - }, - "schedulerDelay" : 10, - "gettingResultTime" : 0 - }, - "10" : { - "taskId" : 10, - "index" : 8, - "attempt" : 0, - "launchTime" : "2018-01-09T10:21:19.034GMT", - "duration" : 12, - "executorId" : "1", - "host" : "172.30.65.138", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 2, - "executorDeserializeCpuTime" : 1803000, - "executorRunTime" : 6, - "executorCpuTime" : 6157000, - "resultSize" : 1029, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 46, - "writeTime" : 243647, - "recordsWritten" : 1 - } - }, - "executorLogs" : { - "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", - "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" - }, - "schedulerDelay" : 4, - "gettingResultTime" : 0 - }, - "1" : { - "taskId" : 1, - "index" : 1, - "attempt" : 0, - "launchTime" : "2018-01-09T10:21:18.364GMT", - "duration" : 565, - "executorId" : "1", - "host" : "172.30.65.138", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 301, - "executorDeserializeCpuTime" : 200029000, - "executorRunTime" : 212, - "executorCpuTime" : 198479000, - "resultSize" : 1115, - "jvmGcTime" : 13, - "resultSerializationTime" : 1, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 46, - "writeTime" : 2409488, - "recordsWritten" : 1 - } - }, - "executorLogs" : { - "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", - "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" - }, - "schedulerDelay" : 51, - "gettingResultTime" : 0 - }, - "6" : { - "taskId" : 6, - "index" : 4, - "attempt" : 0, - "launchTime" : "2018-01-09T10:21:18.980GMT", - "duration" : 16, - "executorId" : "1", - "host" : "172.30.65.138", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 3, - "executorDeserializeCpuTime" : 2610000, - "executorRunTime" : 10, - "executorCpuTime" : 9622000, - "resultSize" : 1029, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 46, - "writeTime" : 385110, - "recordsWritten" : 1 - } - }, - "executorLogs" : { - "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", - "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" - }, - "schedulerDelay" : 3, - "gettingResultTime" : 0 - }, - "9" : { - "taskId" : 9, - "index" : 7, - "attempt" : 0, - "launchTime" : "2018-01-09T10:21:19.022GMT", - "duration" : 12, - "executorId" : "1", - "host" : "172.30.65.138", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 2, - "executorDeserializeCpuTime" : 1981000, - "executorRunTime" : 7, - "executorCpuTime" : 6335000, - "resultSize" : 1029, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 46, - "writeTime" : 259354, - "recordsWritten" : 1 - } - }, - "executorLogs" : { - "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", - "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" - }, - "schedulerDelay" : 3, - "gettingResultTime" : 0 - }, - "2" : { - "taskId" : 2, - "index" : 2, - "attempt" : 0, - "launchTime" : "2018-01-09T10:21:18.899GMT", - "duration" : 27, - "executorId" : "0", - "host" : "172.30.65.138", - "status" : "FAILED", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "errorMessage" : "java.lang.RuntimeException: Bad executor\n\tat $line17.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:27)\n\tat $line17.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:193)\n\tat org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:109)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n", - "taskMetrics" : { - "executorDeserializeTime" : 0, - "executorDeserializeCpuTime" : 0, - "executorRunTime" : 16, - "executorCpuTime" : 0, - "resultSize" : 0, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 0, - "writeTime" : 126128, - "recordsWritten" : 0 - } - }, - "executorLogs" : { - "stdout" : "http://172.30.65.138:64279/logPage/?appId=app-20180109111548-0000&executorId=0&logType=stdout", - "stderr" : "http://172.30.65.138:64279/logPage/?appId=app-20180109111548-0000&executorId=0&logType=stderr" - }, - "schedulerDelay" : 11, - "gettingResultTime" : 0 - }, - "7" : { - "taskId" : 7, - "index" : 5, - "attempt" : 0, - "launchTime" : "2018-01-09T10:21:18.996GMT", - "duration" : 15, - "executorId" : "1", - "host" : "172.30.65.138", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 2, - "executorDeserializeCpuTime" : 2231000, - "executorRunTime" : 9, - "executorCpuTime" : 8407000, - "resultSize" : 1029, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 46, - "writeTime" : 205520, - "recordsWritten" : 1 - } - }, - "executorLogs" : { - "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", - "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" - }, - "schedulerDelay" : 4, - "gettingResultTime" : 0 - }, - "3" : { - "taskId" : 3, - "index" : 0, - "attempt" : 1, - "launchTime" : "2018-01-09T10:21:18.919GMT", - "duration" : 24, - "executorId" : "1", - "host" : "172.30.65.138", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 8, - "executorDeserializeCpuTime" : 8878000, - "executorRunTime" : 10, - "executorCpuTime" : 9364000, - "resultSize" : 1029, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 46, - "writeTime" : 207014, - "recordsWritten" : 1 - } - }, - "executorLogs" : { - "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", - "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" - }, - "schedulerDelay" : 6, - "gettingResultTime" : 0 - }, - "11" : { - "taskId" : 11, - "index" : 9, - "attempt" : 0, - "launchTime" : "2018-01-09T10:21:19.045GMT", - "duration" : 15, - "executorId" : "1", - "host" : "172.30.65.138", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 3, - "executorDeserializeCpuTime" : 2017000, - "executorRunTime" : 6, - "executorCpuTime" : 6676000, - "resultSize" : 1029, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 46, - "writeTime" : 233652, - "recordsWritten" : 1 - } - }, - "executorLogs" : { - "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", - "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" - }, - "schedulerDelay" : 6, - "gettingResultTime" : 0 - }, - "8" : { - "taskId" : 8, - "index" : 6, - "attempt" : 0, - "launchTime" : "2018-01-09T10:21:19.011GMT", - "duration" : 11, - "executorId" : "1", - "host" : "172.30.65.138", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 1, - "executorDeserializeCpuTime" : 1554000, - "executorRunTime" : 7, - "executorCpuTime" : 6034000, - "resultSize" : 1029, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 46, - "writeTime" : 213296, - "recordsWritten" : 1 - } - }, - "executorLogs" : { - "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", - "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" - }, - "schedulerDelay" : 3, - "gettingResultTime" : 0 - }, - "4" : { - "taskId" : 4, - "index" : 2, - "attempt" : 1, - "launchTime" : "2018-01-09T10:21:18.943GMT", - "duration" : 16, - "executorId" : "1", - "host" : "172.30.65.138", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 2, - "executorDeserializeCpuTime" : 2211000, - "executorRunTime" : 9, - "executorCpuTime" : 9207000, - "resultSize" : 1029, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 46, - "writeTime" : 292381, - "recordsWritten" : 1 - } - }, - "executorLogs" : { - "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", - "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" - }, - "schedulerDelay" : 5, - "gettingResultTime" : 0 - } - }, - "executorSummary" : { - "0" : { - "taskTime" : 589, - "failedTasks" : 2, - "succeededTasks" : 0, - "killedTasks" : 0, - "inputBytes" : 0, - "inputRecords" : 0, - "outputBytes" : 0, - "outputRecords" : 0, - "shuffleRead" : 0, - "shuffleReadRecords" : 0, - "shuffleWrite" : 0, - "shuffleWriteRecords" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "isBlacklistedForStage" : true - }, - "1" : { - "taskTime" : 708, - "failedTasks" : 0, - "succeededTasks" : 10, - "killedTasks" : 0, - "inputBytes" : 0, - "inputRecords" : 0, - "outputBytes" : 0, - "outputRecords" : 0, - "shuffleRead" : 0, - "shuffleReadRecords" : 0, - "shuffleWrite" : 460, - "shuffleWriteRecords" : 10, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "isBlacklistedForStage" : false - } - }, - "killedTasksSummary" : { } -} diff --git a/core/src/test/resources/HistoryServerExpectations/blacklisting_node_for_stage_expectation.json b/core/src/test/resources/HistoryServerExpectations/blacklisting_node_for_stage_expectation.json deleted file mode 100644 index 8d11081247913..0000000000000 --- a/core/src/test/resources/HistoryServerExpectations/blacklisting_node_for_stage_expectation.json +++ /dev/null @@ -1,880 +0,0 @@ -{ - "status" : "COMPLETE", - "stageId" : 0, - "attemptId" : 0, - "numTasks" : 10, - "numActiveTasks" : 0, - "numCompleteTasks" : 10, - "numFailedTasks" : 4, - "numKilledTasks" : 0, - "numCompletedIndices" : 10, - "submissionTime" : "2018-01-18T18:33:12.658GMT", - "firstTaskLaunchedTime" : "2018-01-18T18:33:12.816GMT", - "completionTime" : "2018-01-18T18:33:15.279GMT", - "executorDeserializeTime" : 3679, - "executorDeserializeCpuTime" : 1029819716, - "executorRunTime" : 5080, - "executorCpuTime" : 1163210819, - "resultSize" : 10824, - "jvmGcTime" : 370, - "resultSerializationTime" : 5, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputBytes" : 0, - "inputRecords" : 0, - "outputBytes" : 0, - "outputRecords" : 0, - "shuffleRemoteBlocksFetched" : 0, - "shuffleLocalBlocksFetched" : 0, - "shuffleFetchWaitTime" : 0, - "shuffleRemoteBytesRead" : 0, - "shuffleRemoteBytesReadToDisk" : 0, - "shuffleLocalBytesRead" : 0, - "shuffleReadBytes" : 0, - "shuffleReadRecords" : 0, - "shuffleWriteBytes" : 1461, - "shuffleWriteTime" : 33251697, - "shuffleWriteRecords" : 30, - "name" : "map at :27", - "details" : "org.apache.spark.rdd.RDD.map(RDD.scala:370)\n$line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:27)\n$line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:35)\n$line15.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:37)\n$line15.$read$$iw$$iw$$iw$$iw$$iw.(:39)\n$line15.$read$$iw$$iw$$iw$$iw.(:41)\n$line15.$read$$iw$$iw$$iw.(:43)\n$line15.$read$$iw$$iw.(:45)\n$line15.$read$$iw.(:47)\n$line15.$read.(:49)\n$line15.$read$.(:53)\n$line15.$read$.()\n$line15.$eval$.$print$lzycompute(:7)\n$line15.$eval$.$print(:6)\n$line15.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\nscala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:786)", - "schedulingPool" : "default", - "rddIds" : [ 1, 0 ], - "accumulatorUpdates" : [ ], - "tasks" : { - "0" : { - "taskId" : 0, - "index" : 0, - "attempt" : 0, - "launchTime" : "2018-01-18T18:33:12.816GMT", - "duration" : 2064, - "executorId" : "1", - "host" : "apiros-3.gce.test.com", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 1081, - "executorDeserializeCpuTime" : 353981050, - "executorRunTime" : 914, - "executorCpuTime" : 368865439, - "resultSize" : 1134, - "jvmGcTime" : 75, - "resultSerializationTime" : 1, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 144, - "writeTime" : 3662221, - "recordsWritten" : 3 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 68, - "gettingResultTime" : 0 - }, - "5" : { - "taskId" : 5, - "index" : 5, - "attempt" : 0, - "launchTime" : "2018-01-18T18:33:14.320GMT", - "duration" : 73, - "executorId" : "5", - "host" : "apiros-2.gce.test.com", - "status" : "FAILED", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "errorMessage" : "java.lang.RuntimeException: Bad executor\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:28)\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:27)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:193)\n\tat org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:109)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n", - "taskMetrics" : { - "executorDeserializeTime" : 0, - "executorDeserializeCpuTime" : 0, - "executorRunTime" : 27, - "executorCpuTime" : 0, - "resultSize" : 0, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 0, - "writeTime" : 191901, - "recordsWritten" : 0 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000007/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000007/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 46, - "gettingResultTime" : 0 - }, - "10" : { - "taskId" : 10, - "index" : 1, - "attempt" : 1, - "launchTime" : "2018-01-18T18:33:15.069GMT", - "duration" : 132, - "executorId" : "2", - "host" : "apiros-3.gce.test.com", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 5, - "executorDeserializeCpuTime" : 4598966, - "executorRunTime" : 76, - "executorCpuTime" : 20826337, - "resultSize" : 1091, - "jvmGcTime" : 0, - "resultSerializationTime" : 1, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 144, - "writeTime" : 301705, - "recordsWritten" : 3 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 50, - "gettingResultTime" : 0 - }, - "1" : { - "taskId" : 1, - "index" : 1, - "attempt" : 0, - "launchTime" : "2018-01-18T18:33:12.832GMT", - "duration" : 1506, - "executorId" : "5", - "host" : "apiros-2.gce.test.com", - "status" : "FAILED", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "errorMessage" : "java.lang.RuntimeException: Bad executor\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:28)\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:27)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:193)\n\tat org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:109)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n", - "taskMetrics" : { - "executorDeserializeTime" : 0, - "executorDeserializeCpuTime" : 0, - "executorRunTime" : 1332, - "executorCpuTime" : 0, - "resultSize" : 0, - "jvmGcTime" : 33, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 0, - "writeTime" : 3075188, - "recordsWritten" : 0 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000007/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000007/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 174, - "gettingResultTime" : 0 - }, - "6" : { - "taskId" : 6, - "index" : 6, - "attempt" : 0, - "launchTime" : "2018-01-18T18:33:14.323GMT", - "duration" : 67, - "executorId" : "4", - "host" : "apiros-2.gce.test.com", - "status" : "FAILED", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "errorMessage" : "java.lang.RuntimeException: Bad executor\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:28)\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:27)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:193)\n\tat org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:109)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n", - "taskMetrics" : { - "executorDeserializeTime" : 0, - "executorDeserializeCpuTime" : 0, - "executorRunTime" : 51, - "executorCpuTime" : 0, - "resultSize" : 0, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 0, - "writeTime" : 183718, - "recordsWritten" : 0 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000005/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000005/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 16, - "gettingResultTime" : 0 - }, - "9" : { - "taskId" : 9, - "index" : 4, - "attempt" : 1, - "launchTime" : "2018-01-18T18:33:14.973GMT", - "duration" : 96, - "executorId" : "2", - "host" : "apiros-3.gce.test.com", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 5, - "executorDeserializeCpuTime" : 4793905, - "executorRunTime" : 48, - "executorCpuTime" : 25678331, - "resultSize" : 1091, - "jvmGcTime" : 0, - "resultSerializationTime" : 1, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 147, - "writeTime" : 366050, - "recordsWritten" : 3 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 42, - "gettingResultTime" : 0 - }, - "13" : { - "taskId" : 13, - "index" : 9, - "attempt" : 0, - "launchTime" : "2018-01-18T18:33:15.200GMT", - "duration" : 76, - "executorId" : "2", - "host" : "apiros-3.gce.test.com", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 25, - "executorDeserializeCpuTime" : 5860574, - "executorRunTime" : 25, - "executorCpuTime" : 20585619, - "resultSize" : 1048, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 147, - "writeTime" : 369513, - "recordsWritten" : 3 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 26, - "gettingResultTime" : 0 - }, - "2" : { - "taskId" : 2, - "index" : 2, - "attempt" : 0, - "launchTime" : "2018-01-18T18:33:12.832GMT", - "duration" : 1774, - "executorId" : "3", - "host" : "apiros-2.gce.test.com", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 1206, - "executorDeserializeCpuTime" : 263386625, - "executorRunTime" : 493, - "executorCpuTime" : 278399617, - "resultSize" : 1134, - "jvmGcTime" : 78, - "resultSerializationTime" : 1, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 144, - "writeTime" : 3322956, - "recordsWritten" : 3 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000004/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000004/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 74, - "gettingResultTime" : 0 - }, - "12" : { - "taskId" : 12, - "index" : 8, - "attempt" : 0, - "launchTime" : "2018-01-18T18:33:15.165GMT", - "duration" : 60, - "executorId" : "1", - "host" : "apiros-3.gce.test.com", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 4, - "executorDeserializeCpuTime" : 4010338, - "executorRunTime" : 34, - "executorCpuTime" : 21657558, - "resultSize" : 1048, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 147, - "writeTime" : 319101, - "recordsWritten" : 3 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 22, - "gettingResultTime" : 0 - }, - "7" : { - "taskId" : 7, - "index" : 5, - "attempt" : 1, - "launchTime" : "2018-01-18T18:33:14.859GMT", - "duration" : 115, - "executorId" : "2", - "host" : "apiros-3.gce.test.com", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 11, - "executorDeserializeCpuTime" : 10894331, - "executorRunTime" : 84, - "executorCpuTime" : 28283110, - "resultSize" : 1048, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 147, - "writeTime" : 377601, - "recordsWritten" : 3 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 20, - "gettingResultTime" : 0 - }, - "3" : { - "taskId" : 3, - "index" : 3, - "attempt" : 0, - "launchTime" : "2018-01-18T18:33:12.833GMT", - "duration" : 2027, - "executorId" : "2", - "host" : "apiros-3.gce.test.com", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 1282, - "executorDeserializeCpuTime" : 365807898, - "executorRunTime" : 681, - "executorCpuTime" : 349920830, - "resultSize" : 1134, - "jvmGcTime" : 102, - "resultSerializationTime" : 1, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 147, - "writeTime" : 3587839, - "recordsWritten" : 3 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 63, - "gettingResultTime" : 0 - }, - "11" : { - "taskId" : 11, - "index" : 7, - "attempt" : 0, - "launchTime" : "2018-01-18T18:33:15.072GMT", - "duration" : 93, - "executorId" : "1", - "host" : "apiros-3.gce.test.com", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 4, - "executorDeserializeCpuTime" : 4239884, - "executorRunTime" : 77, - "executorCpuTime" : 21689428, - "resultSize" : 1048, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 147, - "writeTime" : 323898, - "recordsWritten" : 3 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 12, - "gettingResultTime" : 0 - }, - "8" : { - "taskId" : 8, - "index" : 6, - "attempt" : 1, - "launchTime" : "2018-01-18T18:33:14.879GMT", - "duration" : 194, - "executorId" : "1", - "host" : "apiros-3.gce.test.com", - "status" : "SUCCESS", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "taskMetrics" : { - "executorDeserializeTime" : 56, - "executorDeserializeCpuTime" : 12246145, - "executorRunTime" : 54, - "executorCpuTime" : 27304550, - "resultSize" : 1048, - "jvmGcTime" : 0, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 147, - "writeTime" : 311940, - "recordsWritten" : 3 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 84, - "gettingResultTime" : 0 - }, - "4" : { - "taskId" : 4, - "index" : 4, - "attempt" : 0, - "launchTime" : "2018-01-18T18:33:12.833GMT", - "duration" : 1522, - "executorId" : "4", - "host" : "apiros-2.gce.test.com", - "status" : "FAILED", - "taskLocality" : "PROCESS_LOCAL", - "speculative" : false, - "accumulatorUpdates" : [ ], - "errorMessage" : "java.lang.RuntimeException: Bad executor\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:28)\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:27)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:193)\n\tat org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:109)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n", - "taskMetrics" : { - "executorDeserializeTime" : 0, - "executorDeserializeCpuTime" : 0, - "executorRunTime" : 1184, - "executorCpuTime" : 0, - "resultSize" : 0, - "jvmGcTime" : 82, - "resultSerializationTime" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "peakExecutionMemory" : 0, - "inputMetrics" : { - "bytesRead" : 0, - "recordsRead" : 0 - }, - "outputMetrics" : { - "bytesWritten" : 0, - "recordsWritten" : 0 - }, - "shuffleReadMetrics" : { - "remoteBlocksFetched" : 0, - "localBlocksFetched" : 0, - "fetchWaitTime" : 0, - "remoteBytesRead" : 0, - "remoteBytesReadToDisk" : 0, - "localBytesRead" : 0, - "recordsRead" : 0 - }, - "shuffleWriteMetrics" : { - "bytesWritten" : 0, - "writeTime" : 16858066, - "recordsWritten" : 0 - } - }, - "executorLogs" : { - "stdout" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000005/attilapiros/stdout?start=-4096", - "stderr" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000005/attilapiros/stderr?start=-4096" - }, - "schedulerDelay" : 338, - "gettingResultTime" : 0 - } - }, - "executorSummary" : { - "4" : { - "taskTime" : 1589, - "failedTasks" : 2, - "succeededTasks" : 0, - "killedTasks" : 0, - "inputBytes" : 0, - "inputRecords" : 0, - "outputBytes" : 0, - "outputRecords" : 0, - "shuffleRead" : 0, - "shuffleReadRecords" : 0, - "shuffleWrite" : 0, - "shuffleWriteRecords" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "isBlacklistedForStage" : true - }, - "5" : { - "taskTime" : 1579, - "failedTasks" : 2, - "succeededTasks" : 0, - "killedTasks" : 0, - "inputBytes" : 0, - "inputRecords" : 0, - "outputBytes" : 0, - "outputRecords" : 0, - "shuffleRead" : 0, - "shuffleReadRecords" : 0, - "shuffleWrite" : 0, - "shuffleWriteRecords" : 0, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "isBlacklistedForStage" : true - }, - "1" : { - "taskTime" : 2411, - "failedTasks" : 0, - "succeededTasks" : 4, - "killedTasks" : 0, - "inputBytes" : 0, - "inputRecords" : 0, - "outputBytes" : 0, - "outputRecords" : 0, - "shuffleRead" : 0, - "shuffleReadRecords" : 0, - "shuffleWrite" : 585, - "shuffleWriteRecords" : 12, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "isBlacklistedForStage" : false - }, - "2" : { - "taskTime" : 2446, - "failedTasks" : 0, - "succeededTasks" : 5, - "killedTasks" : 0, - "inputBytes" : 0, - "inputRecords" : 0, - "outputBytes" : 0, - "outputRecords" : 0, - "shuffleRead" : 0, - "shuffleReadRecords" : 0, - "shuffleWrite" : 732, - "shuffleWriteRecords" : 15, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "isBlacklistedForStage" : false - }, - "3" : { - "taskTime" : 1774, - "failedTasks" : 0, - "succeededTasks" : 1, - "killedTasks" : 0, - "inputBytes" : 0, - "inputRecords" : 0, - "outputBytes" : 0, - "outputRecords" : 0, - "shuffleRead" : 0, - "shuffleReadRecords" : 0, - "shuffleWrite" : 144, - "shuffleWriteRecords" : 3, - "memoryBytesSpilled" : 0, - "diskBytesSpilled" : 0, - "isBlacklistedForStage" : true - } - }, - "killedTasksSummary" : { } -} diff --git a/core/src/test/resources/HistoryServerExpectations/complete_stage_list_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/complete_stage_list_json_expectation.json index a47cd26ed102b..f04543e037c48 100644 --- a/core/src/test/resources/HistoryServerExpectations/complete_stage_list_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/complete_stage_list_json_expectation.json @@ -41,7 +41,30 @@ "schedulingPool" : "default", "rddIds" : [ 6, 5 ], "accumulatorUpdates" : [ ], - "killedTasksSummary" : { } + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } }, { "status" : "COMPLETE", "stageId" : 1, @@ -85,7 +108,30 @@ "schedulingPool" : "default", "rddIds" : [ 1, 0 ], "accumulatorUpdates" : [ ], - "killedTasksSummary" : { } + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } }, { "status" : "COMPLETE", "stageId" : 0, @@ -129,5 +175,28 @@ "schedulingPool" : "default", "rddIds" : [ 0 ], "accumulatorUpdates" : [ ], - "killedTasksSummary" : { } + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } } ] diff --git a/core/src/test/resources/HistoryServerExpectations/completed_app_list_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/completed_app_list_json_expectation.json index 6e6d28b6a57ec..06015ec46e44d 100644 --- a/core/src/test/resources/HistoryServerExpectations/completed_app_list_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/completed_app_list_json_expectation.json @@ -1,4 +1,34 @@ [ { + "id" : "app-20200706201101-0003", + "name" : "Spark shell", + "attempts" : [ { + "startTime" : "2020-07-07T03:11:00.235GMT", + "endTime" : "2020-07-07T03:17:04.231GMT", + "lastUpdated" : "", + "duration" : 363996, + "sparkUser" : "terryk", + "completed" : true, + "appSparkVersion" : "3.1.0-SNAPSHOT", + "endTimeEpoch" : 1594091824231, + "startTimeEpoch" : 1594091460235, + "lastUpdatedEpoch" : 0 + } ] +}, { + "id" : "application_1578436911597_0052", + "name" : "Spark shell", + "attempts" : [ { + "startTime" : "2020-01-11T17:44:22.851GMT", + "endTime" : "2020-01-11T17:46:42.615GMT", + "lastUpdated" : "", + "duration" : 139764, + "sparkUser" : "tgraves", + "completed" : true, + "appSparkVersion" : "3.0.0-SNAPSHOT", + "endTimeEpoch" : 1578764802615, + "startTimeEpoch" : 1578764662851, + "lastUpdatedEpoch" : 0 + } ] +}, { "id" : "application_1555004656427_0144", "name" : "Spark shell", "attempts" : [ { diff --git a/core/src/test/resources/HistoryServerExpectations/excludeOnFailure_for_stage_expectation.json b/core/src/test/resources/HistoryServerExpectations/excludeOnFailure_for_stage_expectation.json new file mode 100644 index 0000000000000..dcad8a6895ed8 --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/excludeOnFailure_for_stage_expectation.json @@ -0,0 +1,790 @@ +{ + "status" : "COMPLETE", + "stageId" : 0, + "attemptId" : 0, + "numTasks" : 10, + "numActiveTasks" : 0, + "numCompleteTasks" : 10, + "numFailedTasks" : 2, + "numKilledTasks" : 0, + "numCompletedIndices" : 10, + "submissionTime" : "2018-01-09T10:21:18.152GMT", + "firstTaskLaunchedTime" : "2018-01-09T10:21:18.347GMT", + "completionTime" : "2018-01-09T10:21:19.062GMT", + "executorDeserializeTime" : 327, + "executorDeserializeCpuTime" : 225900000, + "executorRunTime" : 761, + "executorCpuTime" : 269916000, + "resultSize" : 10376, + "jvmGcTime" : 27, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRemoteBlocksFetched" : 0, + "shuffleLocalBlocksFetched" : 0, + "shuffleFetchWaitTime" : 0, + "shuffleRemoteBytesRead" : 0, + "shuffleRemoteBytesReadToDisk" : 0, + "shuffleLocalBytesRead" : 0, + "shuffleReadBytes" : 0, + "shuffleReadRecords" : 0, + "shuffleWriteBytes" : 460, + "shuffleWriteTime" : 8711515, + "shuffleWriteRecords" : 10, + "name" : "map at :26", + "details" : "org.apache.spark.rdd.RDD.map(RDD.scala:370)\n$line17.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:26)\n$line17.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:34)\n$line17.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:36)\n$line17.$read$$iw$$iw$$iw$$iw$$iw.(:38)\n$line17.$read$$iw$$iw$$iw$$iw.(:40)\n$line17.$read$$iw$$iw$$iw.(:42)\n$line17.$read$$iw$$iw.(:44)\n$line17.$read$$iw.(:46)\n$line17.$read.(:48)\n$line17.$read$.(:52)\n$line17.$read$.()\n$line17.$eval$.$print$lzycompute(:7)\n$line17.$eval$.$print(:6)\n$line17.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\nscala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:786)", + "schedulingPool" : "default", + "rddIds" : [ 1, 0 ], + "accumulatorUpdates" : [ ], + "tasks" : { + "0" : { + "taskId" : 0, + "index" : 0, + "attempt" : 0, + "launchTime" : "2018-01-09T10:21:18.347GMT", + "duration" : 562, + "executorId" : "0", + "host" : "172.30.65.138", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: Bad executor\n\tat $line17.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:27)\n\tat $line17.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:193)\n\tat org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:109)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 460, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 14, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 3873006, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://172.30.65.138:64279/logPage/?appId=app-20180109111548-0000&executorId=0&logType=stdout", + "stderr" : "http://172.30.65.138:64279/logPage/?appId=app-20180109111548-0000&executorId=0&logType=stderr" + }, + "schedulerDelay" : 102, + "gettingResultTime" : 0 + }, + "5" : { + "taskId" : 5, + "index" : 3, + "attempt" : 0, + "launchTime" : "2018-01-09T10:21:18.958GMT", + "duration" : 22, + "executorId" : "1", + "host" : "172.30.65.138", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 3, + "executorDeserializeCpuTime" : 2586000, + "executorRunTime" : 9, + "executorCpuTime" : 9635000, + "resultSize" : 1029, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 46, + "writeTime" : 262919, + "recordsWritten" : 1 + } + }, + "executorLogs" : { + "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", + "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" + }, + "schedulerDelay" : 10, + "gettingResultTime" : 0 + }, + "10" : { + "taskId" : 10, + "index" : 8, + "attempt" : 0, + "launchTime" : "2018-01-09T10:21:19.034GMT", + "duration" : 12, + "executorId" : "1", + "host" : "172.30.65.138", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 1803000, + "executorRunTime" : 6, + "executorCpuTime" : 6157000, + "resultSize" : 1029, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 46, + "writeTime" : 243647, + "recordsWritten" : 1 + } + }, + "executorLogs" : { + "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", + "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" + }, + "schedulerDelay" : 4, + "gettingResultTime" : 0 + }, + "1" : { + "taskId" : 1, + "index" : 1, + "attempt" : 0, + "launchTime" : "2018-01-09T10:21:18.364GMT", + "duration" : 565, + "executorId" : "1", + "host" : "172.30.65.138", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 301, + "executorDeserializeCpuTime" : 200029000, + "executorRunTime" : 212, + "executorCpuTime" : 198479000, + "resultSize" : 1115, + "jvmGcTime" : 13, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 46, + "writeTime" : 2409488, + "recordsWritten" : 1 + } + }, + "executorLogs" : { + "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", + "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" + }, + "schedulerDelay" : 51, + "gettingResultTime" : 0 + }, + "6" : { + "taskId" : 6, + "index" : 4, + "attempt" : 0, + "launchTime" : "2018-01-09T10:21:18.980GMT", + "duration" : 16, + "executorId" : "1", + "host" : "172.30.65.138", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 3, + "executorDeserializeCpuTime" : 2610000, + "executorRunTime" : 10, + "executorCpuTime" : 9622000, + "resultSize" : 1029, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 46, + "writeTime" : 385110, + "recordsWritten" : 1 + } + }, + "executorLogs" : { + "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", + "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" + }, + "schedulerDelay" : 3, + "gettingResultTime" : 0 + }, + "9" : { + "taskId" : 9, + "index" : 7, + "attempt" : 0, + "launchTime" : "2018-01-09T10:21:19.022GMT", + "duration" : 12, + "executorId" : "1", + "host" : "172.30.65.138", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 1981000, + "executorRunTime" : 7, + "executorCpuTime" : 6335000, + "resultSize" : 1029, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 46, + "writeTime" : 259354, + "recordsWritten" : 1 + } + }, + "executorLogs" : { + "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", + "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" + }, + "schedulerDelay" : 3, + "gettingResultTime" : 0 + }, + "2" : { + "taskId" : 2, + "index" : 2, + "attempt" : 0, + "launchTime" : "2018-01-09T10:21:18.899GMT", + "duration" : 27, + "executorId" : "0", + "host" : "172.30.65.138", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: Bad executor\n\tat $line17.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:27)\n\tat $line17.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:193)\n\tat org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:109)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 16, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 126128, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://172.30.65.138:64279/logPage/?appId=app-20180109111548-0000&executorId=0&logType=stdout", + "stderr" : "http://172.30.65.138:64279/logPage/?appId=app-20180109111548-0000&executorId=0&logType=stderr" + }, + "schedulerDelay" : 11, + "gettingResultTime" : 0 + }, + "7" : { + "taskId" : 7, + "index" : 5, + "attempt" : 0, + "launchTime" : "2018-01-09T10:21:18.996GMT", + "duration" : 15, + "executorId" : "1", + "host" : "172.30.65.138", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 2231000, + "executorRunTime" : 9, + "executorCpuTime" : 8407000, + "resultSize" : 1029, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 46, + "writeTime" : 205520, + "recordsWritten" : 1 + } + }, + "executorLogs" : { + "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", + "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" + }, + "schedulerDelay" : 4, + "gettingResultTime" : 0 + }, + "3" : { + "taskId" : 3, + "index" : 0, + "attempt" : 1, + "launchTime" : "2018-01-09T10:21:18.919GMT", + "duration" : 24, + "executorId" : "1", + "host" : "172.30.65.138", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 8, + "executorDeserializeCpuTime" : 8878000, + "executorRunTime" : 10, + "executorCpuTime" : 9364000, + "resultSize" : 1029, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 46, + "writeTime" : 207014, + "recordsWritten" : 1 + } + }, + "executorLogs" : { + "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", + "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" + }, + "schedulerDelay" : 6, + "gettingResultTime" : 0 + }, + "11" : { + "taskId" : 11, + "index" : 9, + "attempt" : 0, + "launchTime" : "2018-01-09T10:21:19.045GMT", + "duration" : 15, + "executorId" : "1", + "host" : "172.30.65.138", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 3, + "executorDeserializeCpuTime" : 2017000, + "executorRunTime" : 6, + "executorCpuTime" : 6676000, + "resultSize" : 1029, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 46, + "writeTime" : 233652, + "recordsWritten" : 1 + } + }, + "executorLogs" : { + "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", + "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" + }, + "schedulerDelay" : 6, + "gettingResultTime" : 0 + }, + "8" : { + "taskId" : 8, + "index" : 6, + "attempt" : 0, + "launchTime" : "2018-01-09T10:21:19.011GMT", + "duration" : 11, + "executorId" : "1", + "host" : "172.30.65.138", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 1, + "executorDeserializeCpuTime" : 1554000, + "executorRunTime" : 7, + "executorCpuTime" : 6034000, + "resultSize" : 1029, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 46, + "writeTime" : 213296, + "recordsWritten" : 1 + } + }, + "executorLogs" : { + "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", + "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" + }, + "schedulerDelay" : 3, + "gettingResultTime" : 0 + }, + "4" : { + "taskId" : 4, + "index" : 2, + "attempt" : 1, + "launchTime" : "2018-01-09T10:21:18.943GMT", + "duration" : 16, + "executorId" : "1", + "host" : "172.30.65.138", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 2211000, + "executorRunTime" : 9, + "executorCpuTime" : 9207000, + "resultSize" : 1029, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 46, + "writeTime" : 292381, + "recordsWritten" : 1 + } + }, + "executorLogs" : { + "stdout" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stdout", + "stderr" : "http://172.30.65.138:64278/logPage/?appId=app-20180109111548-0000&executorId=1&logType=stderr" + }, + "schedulerDelay" : 5, + "gettingResultTime" : 0 + } + }, + "executorSummary" : { + "0" : { + "taskTime" : 589, + "failedTasks" : 2, + "succeededTasks" : 0, + "killedTasks" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 0, + "shuffleWriteRecords" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : true, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : true + }, + "1" : { + "taskTime" : 708, + "failedTasks" : 0, + "succeededTasks" : 10, + "killedTasks" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 460, + "shuffleWriteRecords" : 10, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : false, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : false + } + }, + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } +} diff --git a/core/src/test/resources/HistoryServerExpectations/excludeOnFailure_node_for_stage_expectation.json b/core/src/test/resources/HistoryServerExpectations/excludeOnFailure_node_for_stage_expectation.json new file mode 100644 index 0000000000000..2ab1546bd4a86 --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/excludeOnFailure_node_for_stage_expectation.json @@ -0,0 +1,1018 @@ +{ + "status" : "COMPLETE", + "stageId" : 0, + "attemptId" : 0, + "numTasks" : 10, + "numActiveTasks" : 0, + "numCompleteTasks" : 10, + "numFailedTasks" : 4, + "numKilledTasks" : 0, + "numCompletedIndices" : 10, + "submissionTime" : "2018-01-18T18:33:12.658GMT", + "firstTaskLaunchedTime" : "2018-01-18T18:33:12.816GMT", + "completionTime" : "2018-01-18T18:33:15.279GMT", + "executorDeserializeTime" : 3679, + "executorDeserializeCpuTime" : 1029819716, + "executorRunTime" : 5080, + "executorCpuTime" : 1163210819, + "resultSize" : 10824, + "jvmGcTime" : 370, + "resultSerializationTime" : 5, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRemoteBlocksFetched" : 0, + "shuffleLocalBlocksFetched" : 0, + "shuffleFetchWaitTime" : 0, + "shuffleRemoteBytesRead" : 0, + "shuffleRemoteBytesReadToDisk" : 0, + "shuffleLocalBytesRead" : 0, + "shuffleReadBytes" : 0, + "shuffleReadRecords" : 0, + "shuffleWriteBytes" : 1461, + "shuffleWriteTime" : 33251697, + "shuffleWriteRecords" : 30, + "name" : "map at :27", + "details" : "org.apache.spark.rdd.RDD.map(RDD.scala:370)\n$line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:27)\n$line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:35)\n$line15.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:37)\n$line15.$read$$iw$$iw$$iw$$iw$$iw.(:39)\n$line15.$read$$iw$$iw$$iw$$iw.(:41)\n$line15.$read$$iw$$iw$$iw.(:43)\n$line15.$read$$iw$$iw.(:45)\n$line15.$read$$iw.(:47)\n$line15.$read.(:49)\n$line15.$read$.(:53)\n$line15.$read$.()\n$line15.$eval$.$print$lzycompute(:7)\n$line15.$eval$.$print(:6)\n$line15.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\nscala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:786)", + "schedulingPool" : "default", + "rddIds" : [ 1, 0 ], + "accumulatorUpdates" : [ ], + "tasks" : { + "0" : { + "taskId" : 0, + "index" : 0, + "attempt" : 0, + "launchTime" : "2018-01-18T18:33:12.816GMT", + "duration" : 2064, + "executorId" : "1", + "host" : "apiros-3.gce.test.com", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 1081, + "executorDeserializeCpuTime" : 353981050, + "executorRunTime" : 914, + "executorCpuTime" : 368865439, + "resultSize" : 1134, + "jvmGcTime" : 75, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 144, + "writeTime" : 3662221, + "recordsWritten" : 3 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 68, + "gettingResultTime" : 0 + }, + "5" : { + "taskId" : 5, + "index" : 5, + "attempt" : 0, + "launchTime" : "2018-01-18T18:33:14.320GMT", + "duration" : 73, + "executorId" : "5", + "host" : "apiros-2.gce.test.com", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: Bad executor\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:28)\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:27)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:193)\n\tat org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:109)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 27, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 191901, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000007/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000007/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 46, + "gettingResultTime" : 0 + }, + "10" : { + "taskId" : 10, + "index" : 1, + "attempt" : 1, + "launchTime" : "2018-01-18T18:33:15.069GMT", + "duration" : 132, + "executorId" : "2", + "host" : "apiros-3.gce.test.com", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 5, + "executorDeserializeCpuTime" : 4598966, + "executorRunTime" : 76, + "executorCpuTime" : 20826337, + "resultSize" : 1091, + "jvmGcTime" : 0, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 144, + "writeTime" : 301705, + "recordsWritten" : 3 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 50, + "gettingResultTime" : 0 + }, + "1" : { + "taskId" : 1, + "index" : 1, + "attempt" : 0, + "launchTime" : "2018-01-18T18:33:12.832GMT", + "duration" : 1506, + "executorId" : "5", + "host" : "apiros-2.gce.test.com", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: Bad executor\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:28)\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:27)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:193)\n\tat org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:109)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 1332, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 33, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 3075188, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000007/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000007/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 174, + "gettingResultTime" : 0 + }, + "6" : { + "taskId" : 6, + "index" : 6, + "attempt" : 0, + "launchTime" : "2018-01-18T18:33:14.323GMT", + "duration" : 67, + "executorId" : "4", + "host" : "apiros-2.gce.test.com", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: Bad executor\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:28)\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:27)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:193)\n\tat org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:109)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 51, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 183718, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000005/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000005/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 16, + "gettingResultTime" : 0 + }, + "9" : { + "taskId" : 9, + "index" : 4, + "attempt" : 1, + "launchTime" : "2018-01-18T18:33:14.973GMT", + "duration" : 96, + "executorId" : "2", + "host" : "apiros-3.gce.test.com", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 5, + "executorDeserializeCpuTime" : 4793905, + "executorRunTime" : 48, + "executorCpuTime" : 25678331, + "resultSize" : 1091, + "jvmGcTime" : 0, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 147, + "writeTime" : 366050, + "recordsWritten" : 3 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 42, + "gettingResultTime" : 0 + }, + "13" : { + "taskId" : 13, + "index" : 9, + "attempt" : 0, + "launchTime" : "2018-01-18T18:33:15.200GMT", + "duration" : 76, + "executorId" : "2", + "host" : "apiros-3.gce.test.com", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 25, + "executorDeserializeCpuTime" : 5860574, + "executorRunTime" : 25, + "executorCpuTime" : 20585619, + "resultSize" : 1048, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 147, + "writeTime" : 369513, + "recordsWritten" : 3 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 26, + "gettingResultTime" : 0 + }, + "2" : { + "taskId" : 2, + "index" : 2, + "attempt" : 0, + "launchTime" : "2018-01-18T18:33:12.832GMT", + "duration" : 1774, + "executorId" : "3", + "host" : "apiros-2.gce.test.com", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 1206, + "executorDeserializeCpuTime" : 263386625, + "executorRunTime" : 493, + "executorCpuTime" : 278399617, + "resultSize" : 1134, + "jvmGcTime" : 78, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 144, + "writeTime" : 3322956, + "recordsWritten" : 3 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000004/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000004/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 74, + "gettingResultTime" : 0 + }, + "12" : { + "taskId" : 12, + "index" : 8, + "attempt" : 0, + "launchTime" : "2018-01-18T18:33:15.165GMT", + "duration" : 60, + "executorId" : "1", + "host" : "apiros-3.gce.test.com", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 4, + "executorDeserializeCpuTime" : 4010338, + "executorRunTime" : 34, + "executorCpuTime" : 21657558, + "resultSize" : 1048, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 147, + "writeTime" : 319101, + "recordsWritten" : 3 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 22, + "gettingResultTime" : 0 + }, + "7" : { + "taskId" : 7, + "index" : 5, + "attempt" : 1, + "launchTime" : "2018-01-18T18:33:14.859GMT", + "duration" : 115, + "executorId" : "2", + "host" : "apiros-3.gce.test.com", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 11, + "executorDeserializeCpuTime" : 10894331, + "executorRunTime" : 84, + "executorCpuTime" : 28283110, + "resultSize" : 1048, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 147, + "writeTime" : 377601, + "recordsWritten" : 3 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 20, + "gettingResultTime" : 0 + }, + "3" : { + "taskId" : 3, + "index" : 3, + "attempt" : 0, + "launchTime" : "2018-01-18T18:33:12.833GMT", + "duration" : 2027, + "executorId" : "2", + "host" : "apiros-3.gce.test.com", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 1282, + "executorDeserializeCpuTime" : 365807898, + "executorRunTime" : 681, + "executorCpuTime" : 349920830, + "resultSize" : 1134, + "jvmGcTime" : 102, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 147, + "writeTime" : 3587839, + "recordsWritten" : 3 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000003/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 63, + "gettingResultTime" : 0 + }, + "11" : { + "taskId" : 11, + "index" : 7, + "attempt" : 0, + "launchTime" : "2018-01-18T18:33:15.072GMT", + "duration" : 93, + "executorId" : "1", + "host" : "apiros-3.gce.test.com", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 4, + "executorDeserializeCpuTime" : 4239884, + "executorRunTime" : 77, + "executorCpuTime" : 21689428, + "resultSize" : 1048, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 147, + "writeTime" : 323898, + "recordsWritten" : 3 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 12, + "gettingResultTime" : 0 + }, + "8" : { + "taskId" : 8, + "index" : 6, + "attempt" : 1, + "launchTime" : "2018-01-18T18:33:14.879GMT", + "duration" : 194, + "executorId" : "1", + "host" : "apiros-3.gce.test.com", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 56, + "executorDeserializeCpuTime" : 12246145, + "executorRunTime" : 54, + "executorCpuTime" : 27304550, + "resultSize" : 1048, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 147, + "writeTime" : 311940, + "recordsWritten" : 3 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-3.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000002/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 84, + "gettingResultTime" : 0 + }, + "4" : { + "taskId" : 4, + "index" : 4, + "attempt" : 0, + "launchTime" : "2018-01-18T18:33:12.833GMT", + "duration" : 1522, + "executorId" : "4", + "host" : "apiros-2.gce.test.com", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: Bad executor\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:28)\n\tat $line15.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$2.apply(:27)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.collection.ExternalSorter.insertAll(ExternalSorter.scala:193)\n\tat org.apache.spark.shuffle.sort.SortShuffleWriter.write(SortShuffleWriter.scala:63)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:96)\n\tat org.apache.spark.scheduler.ShuffleMapTask.runTask(ShuffleMapTask.scala:53)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:109)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:345)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 1184, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 82, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 16858066, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000005/attilapiros/stdout?start=-4096", + "stderr" : "http://apiros-2.gce.test.com:8042/node/containerlogs/container_1516285256255_0012_01_000005/attilapiros/stderr?start=-4096" + }, + "schedulerDelay" : 338, + "gettingResultTime" : 0 + } + }, + "executorSummary" : { + "4" : { + "taskTime" : 1589, + "failedTasks" : 2, + "succeededTasks" : 0, + "killedTasks" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 0, + "shuffleWriteRecords" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : true, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : true + }, + "5" : { + "taskTime" : 1579, + "failedTasks" : 2, + "succeededTasks" : 0, + "killedTasks" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 0, + "shuffleWriteRecords" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : true, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : true + }, + "1" : { + "taskTime" : 2411, + "failedTasks" : 0, + "succeededTasks" : 4, + "killedTasks" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 585, + "shuffleWriteRecords" : 12, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : false, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : false + }, + "2" : { + "taskTime" : 2446, + "failedTasks" : 0, + "succeededTasks" : 5, + "killedTasks" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 732, + "shuffleWriteRecords" : 15, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : false, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : false + }, + "3" : { + "taskTime" : 1774, + "failedTasks" : 0, + "succeededTasks" : 1, + "killedTasks" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 144, + "shuffleWriteRecords" : 3, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : true, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : true + } + }, + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } +} diff --git a/core/src/test/resources/HistoryServerExpectations/executor_list_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/executor_list_json_expectation.json index eadf27164c814..be125075874a2 100644 --- a/core/src/test/resources/HistoryServerExpectations/executor_list_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/executor_list_json_expectation.json @@ -21,6 +21,31 @@ "addTime" : "2015-02-03T16:43:00.906GMT", "executorLogs" : { }, "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, "attributes" : { }, - "resources" : { } + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] } ] diff --git a/core/src/test/resources/HistoryServerExpectations/executor_list_with_executor_metrics_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/executor_list_with_executor_metrics_json_expectation.json index d322485baa8de..bf3e93f3d3783 100644 --- a/core/src/test/resources/HistoryServerExpectations/executor_list_with_executor_metrics_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/executor_list_with_executor_metrics_json_expectation.json @@ -50,7 +50,10 @@ "MajorGCTime" : 144 }, "attributes" : { }, - "resources" : { } + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] }, { "id" : "3", "hostPort" : "test-3.vpc.company.com:37641", @@ -116,7 +119,10 @@ "NM_HOST" : "test-3.vpc.company.com", "CONTAINER_ID" : "container_1553914137147_0018_01_000004" }, - "resources" : { } + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] }, { "id" : "2", "hostPort" : "test-4.vpc.company.com:33179", @@ -182,7 +188,10 @@ "NM_HOST" : "test-4.vpc.company.com", "CONTAINER_ID" : "container_1553914137147_0018_01_000003" }, - "resources" : { } + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] }, { "id" : "1", "hostPort" : "test-2.vpc.company.com:43764", @@ -248,5 +257,8 @@ "NM_HOST" : "test-2.vpc.company.com", "CONTAINER_ID" : "container_1553914137147_0018_01_000002" }, - "resources" : { } + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] } ] diff --git a/core/src/test/resources/HistoryServerExpectations/executor_memory_usage_expectation.json b/core/src/test/resources/HistoryServerExpectations/executor_memory_usage_expectation.json index 7c3f77d8c10cf..0a3eb81140cdb 100644 --- a/core/src/test/resources/HistoryServerExpectations/executor_memory_usage_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/executor_memory_usage_expectation.json @@ -16,7 +16,7 @@ "totalInputBytes" : 0, "totalShuffleRead" : 0, "totalShuffleWrite" : 0, - "isBlacklisted" : true, + "isBlacklisted" : false, "maxMemory" : 908381388, "addTime" : "2016-11-16T22:33:31.477GMT", "executorLogs" : { }, @@ -28,7 +28,10 @@ }, "blacklistedInStages" : [ ], "attributes" : { }, - "resources" : { } + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] }, { "id" : "3", "hostPort" : "172.22.0.167:51485", @@ -61,8 +64,33 @@ "totalOffHeapStorageMemory" : 524288000 }, "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, "attributes" : { }, - "resources" : { } + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : true, + "excludedInStages" : [ ] } ,{ "id" : "2", "hostPort" : "172.22.0.167:51487", @@ -95,8 +123,33 @@ "totalOffHeapStorageMemory" : 524288000 }, "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, "attributes" : { }, - "resources" : { } + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : true, + "excludedInStages" : [ ] }, { "id" : "1", "hostPort" : "172.22.0.167:51490", @@ -129,8 +182,33 @@ "totalOffHeapStorageMemory": 524288000 }, "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, "attributes" : { }, - "resources" : { } + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : true, + "excludedInStages" : [ ] }, { "id" : "0", "hostPort" : "172.22.0.167:51491", @@ -163,6 +241,31 @@ "totalOffHeapStorageMemory" : 524288000 }, "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, "attributes" : { }, - "resources" : { } + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : true, + "excludedInStages" : [ ] } ] diff --git a/core/src/test/resources/HistoryServerExpectations/executor_node_blacklisting_expectation.json b/core/src/test/resources/HistoryServerExpectations/executor_node_blacklisting_expectation.json deleted file mode 100644 index 0986e85f16b3e..0000000000000 --- a/core/src/test/resources/HistoryServerExpectations/executor_node_blacklisting_expectation.json +++ /dev/null @@ -1,168 +0,0 @@ -[ { - "id" : "driver", - "hostPort" : "172.22.0.167:51475", - "isActive" : true, - "rddBlocks" : 0, - "memoryUsed" : 0, - "diskUsed" : 0, - "totalCores" : 0, - "maxTasks" : 0, - "activeTasks" : 0, - "failedTasks" : 0, - "completedTasks" : 0, - "totalTasks" : 0, - "totalDuration" : 0, - "totalGCTime" : 0, - "totalInputBytes" : 0, - "totalShuffleRead" : 0, - "totalShuffleWrite" : 0, - "isBlacklisted" : true, - "maxMemory" : 908381388, - "addTime" : "2016-11-16T22:33:31.477GMT", - "executorLogs" : { }, - "memoryMetrics": { - "usedOnHeapStorageMemory" : 0, - "usedOffHeapStorageMemory" : 0, - "totalOnHeapStorageMemory" : 384093388, - "totalOffHeapStorageMemory" : 524288000 - }, - "blacklistedInStages" : [ ], - "attributes" : { }, - "resources" : { } -}, { - "id" : "3", - "hostPort" : "172.22.0.167:51485", - "isActive" : true, - "rddBlocks" : 0, - "memoryUsed" : 0, - "diskUsed" : 0, - "totalCores" : 4, - "maxTasks" : 4, - "activeTasks" : 0, - "failedTasks" : 0, - "completedTasks" : 12, - "totalTasks" : 12, - "totalDuration" : 2453, - "totalGCTime" : 72, - "totalInputBytes" : 0, - "totalShuffleRead" : 0, - "totalShuffleWrite" : 0, - "isBlacklisted" : true, - "maxMemory" : 908381388, - "addTime" : "2016-11-16T22:33:35.320GMT", - "executorLogs" : { - "stdout" : "http://172.22.0.167:51466/logPage/?appId=app-20161116163331-0000&executorId=3&logType=stdout", - "stderr" : "http://172.22.0.167:51466/logPage/?appId=app-20161116163331-0000&executorId=3&logType=stderr" - }, - "memoryMetrics": { - "usedOnHeapStorageMemory" : 0, - "usedOffHeapStorageMemory" : 0, - "totalOnHeapStorageMemory" : 384093388, - "totalOffHeapStorageMemory" : 524288000 - }, - "blacklistedInStages" : [ ], - "attributes" : { }, - "resources" : { } -}, { - "id" : "2", - "hostPort" : "172.22.0.167:51487", - "isActive" : true, - "rddBlocks" : 0, - "memoryUsed" : 0, - "diskUsed" : 0, - "totalCores" : 4, - "maxTasks" : 4, - "activeTasks" : 0, - "failedTasks" : 4, - "completedTasks" : 0, - "totalTasks" : 4, - "totalDuration" : 2537, - "totalGCTime" : 88, - "totalInputBytes" : 0, - "totalShuffleRead" : 0, - "totalShuffleWrite" : 0, - "isBlacklisted" : true, - "maxMemory" : 908381388, - "addTime" : "2016-11-16T22:33:35.393GMT", - "executorLogs" : { - "stdout" : "http://172.22.0.167:51469/logPage/?appId=app-20161116163331-0000&executorId=2&logType=stdout", - "stderr" : "http://172.22.0.167:51469/logPage/?appId=app-20161116163331-0000&executorId=2&logType=stderr" - }, - "memoryMetrics": { - "usedOnHeapStorageMemory" : 0, - "usedOffHeapStorageMemory" : 0, - "totalOnHeapStorageMemory" : 384093388, - "totalOffHeapStorageMemory" : 524288000 - }, - "blacklistedInStages" : [ ], - "attributes" : { }, - "resources" : { } -}, { - "id" : "1", - "hostPort" : "172.22.0.167:51490", - "isActive" : true, - "rddBlocks" : 0, - "memoryUsed" : 0, - "diskUsed" : 0, - "totalCores" : 4, - "maxTasks" : 4, - "activeTasks" : 0, - "failedTasks" : 0, - "completedTasks" : 4, - "totalTasks" : 4, - "totalDuration" : 3152, - "totalGCTime" : 68, - "totalInputBytes" : 0, - "totalShuffleRead" : 0, - "totalShuffleWrite" : 0, - "isBlacklisted" : true, - "maxMemory" : 908381388, - "addTime" : "2016-11-16T22:33:35.443GMT", - "executorLogs" : { - "stdout" : "http://172.22.0.167:51467/logPage/?appId=app-20161116163331-0000&executorId=1&logType=stdout", - "stderr" : "http://172.22.0.167:51467/logPage/?appId=app-20161116163331-0000&executorId=1&logType=stderr" - }, - "memoryMetrics": { - "usedOnHeapStorageMemory": 0, - "usedOffHeapStorageMemory": 0, - "totalOnHeapStorageMemory": 384093388, - "totalOffHeapStorageMemory": 524288000 - }, - "blacklistedInStages" : [ ], - "attributes" : { }, - "resources" : { } -}, { - "id" : "0", - "hostPort" : "172.22.0.167:51491", - "isActive" : true, - "rddBlocks" : 0, - "memoryUsed" : 0, - "diskUsed" : 0, - "totalCores" : 4, - "maxTasks" : 4, - "activeTasks" : 0, - "failedTasks" : 4, - "completedTasks" : 0, - "totalTasks" : 4, - "totalDuration" : 2551, - "totalGCTime" : 116, - "totalInputBytes" : 0, - "totalShuffleRead" : 0, - "totalShuffleWrite" : 0, - "isBlacklisted" : true, - "maxMemory" : 908381388, - "addTime" : "2016-11-16T22:33:35.462GMT", - "executorLogs" : { - "stdout" : "http://172.22.0.167:51465/logPage/?appId=app-20161116163331-0000&executorId=0&logType=stdout", - "stderr" : "http://172.22.0.167:51465/logPage/?appId=app-20161116163331-0000&executorId=0&logType=stderr" - }, - "memoryMetrics": { - "usedOnHeapStorageMemory": 0, - "usedOffHeapStorageMemory": 0, - "totalOnHeapStorageMemory": 384093388, - "totalOffHeapStorageMemory": 524288000 - }, - "blacklistedInStages" : [ ], - "attributes" : { }, - "resources" : { } -} ] diff --git a/core/src/test/resources/HistoryServerExpectations/executor_node_blacklisting_unblacklisting_expectation.json b/core/src/test/resources/HistoryServerExpectations/executor_node_blacklisting_unblacklisting_expectation.json deleted file mode 100644 index 26d665151a52d..0000000000000 --- a/core/src/test/resources/HistoryServerExpectations/executor_node_blacklisting_unblacklisting_expectation.json +++ /dev/null @@ -1,138 +0,0 @@ -[ { - "id" : "driver", - "hostPort" : "172.22.0.111:64527", - "isActive" : true, - "rddBlocks" : 0, - "memoryUsed" : 0, - "diskUsed" : 0, - "totalCores" : 0, - "maxTasks" : 0, - "activeTasks" : 0, - "failedTasks" : 0, - "completedTasks" : 0, - "totalTasks" : 0, - "totalDuration" : 0, - "totalGCTime" : 0, - "totalInputBytes" : 0, - "totalShuffleRead" : 0, - "totalShuffleWrite" : 0, - "isBlacklisted" : false, - "maxMemory" : 384093388, - "addTime" : "2016-11-15T23:20:38.836GMT", - "executorLogs" : { }, - "blacklistedInStages" : [ ], - "attributes" : { }, - "resources" : { } -}, { - "id" : "3", - "hostPort" : "172.22.0.111:64543", - "isActive" : true, - "rddBlocks" : 0, - "memoryUsed" : 0, - "diskUsed" : 0, - "totalCores" : 4, - "maxTasks" : 4, - "activeTasks" : 0, - "failedTasks" : 0, - "completedTasks" : 4, - "totalTasks" : 4, - "totalDuration" : 3457, - "totalGCTime" : 72, - "totalInputBytes" : 0, - "totalShuffleRead" : 0, - "totalShuffleWrite" : 0, - "isBlacklisted" : false, - "maxMemory" : 384093388, - "addTime" : "2016-11-15T23:20:42.711GMT", - "executorLogs" : { - "stdout" : "http://172.22.0.111:64521/logPage/?appId=app-20161115172038-0000&executorId=3&logType=stdout", - "stderr" : "http://172.22.0.111:64521/logPage/?appId=app-20161115172038-0000&executorId=3&logType=stderr" - }, - "blacklistedInStages" : [ ], - "attributes" : { }, - "resources" : { } -}, { - "id" : "2", - "hostPort" : "172.22.0.111:64539", - "isActive" : true, - "rddBlocks" : 0, - "memoryUsed" : 0, - "diskUsed" : 0, - "totalCores" : 4, - "maxTasks" : 4, - "activeTasks" : 0, - "failedTasks" : 6, - "completedTasks" : 0, - "totalTasks" : 6, - "totalDuration" : 2792, - "totalGCTime" : 128, - "totalInputBytes" : 0, - "totalShuffleRead" : 0, - "totalShuffleWrite" : 0, - "isBlacklisted" : false, - "maxMemory" : 384093388, - "addTime" : "2016-11-15T23:20:42.589GMT", - "executorLogs" : { - "stdout" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stdout", - "stderr" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stderr" - }, - "blacklistedInStages" : [ ], - "attributes" : { }, - "resources" : { } -}, { - "id" : "1", - "hostPort" : "172.22.0.111:64541", - "isActive" : true, - "rddBlocks" : 0, - "memoryUsed" : 0, - "diskUsed" : 0, - "totalCores" : 4, - "maxTasks" : 4, - "activeTasks" : 0, - "failedTasks" : 0, - "completedTasks" : 12, - "totalTasks" : 12, - "totalDuration" : 2613, - "totalGCTime" : 84, - "totalInputBytes" : 0, - "totalShuffleRead" : 0, - "totalShuffleWrite" : 0, - "isBlacklisted" : false, - "maxMemory" : 384093388, - "addTime" : "2016-11-15T23:20:42.629GMT", - "executorLogs" : { - "stdout" : "http://172.22.0.111:64518/logPage/?appId=app-20161115172038-0000&executorId=1&logType=stdout", - "stderr" : "http://172.22.0.111:64518/logPage/?appId=app-20161115172038-0000&executorId=1&logType=stderr" - }, - "blacklistedInStages" : [ ], - "attributes" : { }, - "resources" : { } -}, { - "id" : "0", - "hostPort" : "172.22.0.111:64540", - "isActive" : true, - "rddBlocks" : 0, - "memoryUsed" : 0, - "diskUsed" : 0, - "totalCores" : 4, - "maxTasks" : 4, - "activeTasks" : 0, - "failedTasks" : 4, - "completedTasks" : 0, - "totalTasks" : 4, - "totalDuration" : 2741, - "totalGCTime" : 120, - "totalInputBytes" : 0, - "totalShuffleRead" : 0, - "totalShuffleWrite" : 0, - "isBlacklisted" : false, - "maxMemory" : 384093388, - "addTime" : "2016-11-15T23:20:42.593GMT", - "executorLogs" : { - "stdout" : "http://172.22.0.111:64517/logPage/?appId=app-20161115172038-0000&executorId=0&logType=stdout", - "stderr" : "http://172.22.0.111:64517/logPage/?appId=app-20161115172038-0000&executorId=0&logType=stderr" - }, - "blacklistedInStages" : [ ], - "attributes" : { }, - "resources" : { } -} ] diff --git a/core/src/test/resources/HistoryServerExpectations/executor_node_excludeOnFailure_expectation.json b/core/src/test/resources/HistoryServerExpectations/executor_node_excludeOnFailure_expectation.json new file mode 100644 index 0000000000000..8869fb4e296e6 --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/executor_node_excludeOnFailure_expectation.json @@ -0,0 +1,271 @@ +[ { + "id" : "driver", + "hostPort" : "172.22.0.167:51475", + "isActive" : true, + "rddBlocks" : 0, + "memoryUsed" : 0, + "diskUsed" : 0, + "totalCores" : 0, + "maxTasks" : 0, + "activeTasks" : 0, + "failedTasks" : 0, + "completedTasks" : 0, + "totalTasks" : 0, + "totalDuration" : 0, + "totalGCTime" : 0, + "totalInputBytes" : 0, + "totalShuffleRead" : 0, + "totalShuffleWrite" : 0, + "isBlacklisted" : false, + "maxMemory" : 908381388, + "addTime" : "2016-11-16T22:33:31.477GMT", + "executorLogs" : { }, + "memoryMetrics": { + "usedOnHeapStorageMemory" : 0, + "usedOffHeapStorageMemory" : 0, + "totalOnHeapStorageMemory" : 384093388, + "totalOffHeapStorageMemory" : 524288000 + }, + "blacklistedInStages" : [ ], + "attributes" : { }, + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] +}, { + "id" : "3", + "hostPort" : "172.22.0.167:51485", + "isActive" : true, + "rddBlocks" : 0, + "memoryUsed" : 0, + "diskUsed" : 0, + "totalCores" : 4, + "maxTasks" : 4, + "activeTasks" : 0, + "failedTasks" : 0, + "completedTasks" : 12, + "totalTasks" : 12, + "totalDuration" : 2453, + "totalGCTime" : 72, + "totalInputBytes" : 0, + "totalShuffleRead" : 0, + "totalShuffleWrite" : 0, + "isBlacklisted" : true, + "maxMemory" : 908381388, + "addTime" : "2016-11-16T22:33:35.320GMT", + "executorLogs" : { + "stdout" : "http://172.22.0.167:51466/logPage/?appId=app-20161116163331-0000&executorId=3&logType=stdout", + "stderr" : "http://172.22.0.167:51466/logPage/?appId=app-20161116163331-0000&executorId=3&logType=stderr" + }, + "memoryMetrics": { + "usedOnHeapStorageMemory" : 0, + "usedOffHeapStorageMemory" : 0, + "totalOnHeapStorageMemory" : 384093388, + "totalOffHeapStorageMemory" : 524288000 + }, + "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "attributes" : { }, + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : true, + "excludedInStages" : [ ] +}, { + "id" : "2", + "hostPort" : "172.22.0.167:51487", + "isActive" : true, + "rddBlocks" : 0, + "memoryUsed" : 0, + "diskUsed" : 0, + "totalCores" : 4, + "maxTasks" : 4, + "activeTasks" : 0, + "failedTasks" : 4, + "completedTasks" : 0, + "totalTasks" : 4, + "totalDuration" : 2537, + "totalGCTime" : 88, + "totalInputBytes" : 0, + "totalShuffleRead" : 0, + "totalShuffleWrite" : 0, + "isBlacklisted" : true, + "maxMemory" : 908381388, + "addTime" : "2016-11-16T22:33:35.393GMT", + "executorLogs" : { + "stdout" : "http://172.22.0.167:51469/logPage/?appId=app-20161116163331-0000&executorId=2&logType=stdout", + "stderr" : "http://172.22.0.167:51469/logPage/?appId=app-20161116163331-0000&executorId=2&logType=stderr" + }, + "memoryMetrics": { + "usedOnHeapStorageMemory" : 0, + "usedOffHeapStorageMemory" : 0, + "totalOnHeapStorageMemory" : 384093388, + "totalOffHeapStorageMemory" : 524288000 + }, + "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "attributes" : { }, + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : true, + "excludedInStages" : [ ] +}, { + "id" : "1", + "hostPort" : "172.22.0.167:51490", + "isActive" : true, + "rddBlocks" : 0, + "memoryUsed" : 0, + "diskUsed" : 0, + "totalCores" : 4, + "maxTasks" : 4, + "activeTasks" : 0, + "failedTasks" : 0, + "completedTasks" : 4, + "totalTasks" : 4, + "totalDuration" : 3152, + "totalGCTime" : 68, + "totalInputBytes" : 0, + "totalShuffleRead" : 0, + "totalShuffleWrite" : 0, + "isBlacklisted" : true, + "maxMemory" : 908381388, + "addTime" : "2016-11-16T22:33:35.443GMT", + "executorLogs" : { + "stdout" : "http://172.22.0.167:51467/logPage/?appId=app-20161116163331-0000&executorId=1&logType=stdout", + "stderr" : "http://172.22.0.167:51467/logPage/?appId=app-20161116163331-0000&executorId=1&logType=stderr" + }, + "memoryMetrics": { + "usedOnHeapStorageMemory": 0, + "usedOffHeapStorageMemory": 0, + "totalOnHeapStorageMemory": 384093388, + "totalOffHeapStorageMemory": 524288000 + }, + "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "attributes" : { }, + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : true, + "excludedInStages" : [ ] +}, { + "id" : "0", + "hostPort" : "172.22.0.167:51491", + "isActive" : true, + "rddBlocks" : 0, + "memoryUsed" : 0, + "diskUsed" : 0, + "totalCores" : 4, + "maxTasks" : 4, + "activeTasks" : 0, + "failedTasks" : 4, + "completedTasks" : 0, + "totalTasks" : 4, + "totalDuration" : 2551, + "totalGCTime" : 116, + "totalInputBytes" : 0, + "totalShuffleRead" : 0, + "totalShuffleWrite" : 0, + "isBlacklisted" : true, + "maxMemory" : 908381388, + "addTime" : "2016-11-16T22:33:35.462GMT", + "executorLogs" : { + "stdout" : "http://172.22.0.167:51465/logPage/?appId=app-20161116163331-0000&executorId=0&logType=stdout", + "stderr" : "http://172.22.0.167:51465/logPage/?appId=app-20161116163331-0000&executorId=0&logType=stderr" + }, + "memoryMetrics": { + "usedOnHeapStorageMemory": 0, + "usedOffHeapStorageMemory": 0, + "totalOnHeapStorageMemory": 384093388, + "totalOffHeapStorageMemory": 524288000 + }, + "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "attributes" : { }, + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : true, + "excludedInStages" : [ ] +} ] diff --git a/core/src/test/resources/HistoryServerExpectations/executor_node_excludeOnFailure_unexcluding_expectation.json b/core/src/test/resources/HistoryServerExpectations/executor_node_excludeOnFailure_unexcluding_expectation.json new file mode 100644 index 0000000000000..21cc9d0812990 --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/executor_node_excludeOnFailure_unexcluding_expectation.json @@ -0,0 +1,241 @@ +[ { + "id" : "driver", + "hostPort" : "172.22.0.111:64527", + "isActive" : true, + "rddBlocks" : 0, + "memoryUsed" : 0, + "diskUsed" : 0, + "totalCores" : 0, + "maxTasks" : 0, + "activeTasks" : 0, + "failedTasks" : 0, + "completedTasks" : 0, + "totalTasks" : 0, + "totalDuration" : 0, + "totalGCTime" : 0, + "totalInputBytes" : 0, + "totalShuffleRead" : 0, + "totalShuffleWrite" : 0, + "isBlacklisted" : false, + "maxMemory" : 384093388, + "addTime" : "2016-11-15T23:20:38.836GMT", + "executorLogs" : { }, + "blacklistedInStages" : [ ], + "attributes" : { }, + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] +}, { + "id" : "3", + "hostPort" : "172.22.0.111:64543", + "isActive" : true, + "rddBlocks" : 0, + "memoryUsed" : 0, + "diskUsed" : 0, + "totalCores" : 4, + "maxTasks" : 4, + "activeTasks" : 0, + "failedTasks" : 0, + "completedTasks" : 4, + "totalTasks" : 4, + "totalDuration" : 3457, + "totalGCTime" : 72, + "totalInputBytes" : 0, + "totalShuffleRead" : 0, + "totalShuffleWrite" : 0, + "isBlacklisted" : false, + "maxMemory" : 384093388, + "addTime" : "2016-11-15T23:20:42.711GMT", + "executorLogs" : { + "stdout" : "http://172.22.0.111:64521/logPage/?appId=app-20161115172038-0000&executorId=3&logType=stdout", + "stderr" : "http://172.22.0.111:64521/logPage/?appId=app-20161115172038-0000&executorId=3&logType=stderr" + }, + "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "attributes" : { }, + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] +}, { + "id" : "2", + "hostPort" : "172.22.0.111:64539", + "isActive" : true, + "rddBlocks" : 0, + "memoryUsed" : 0, + "diskUsed" : 0, + "totalCores" : 4, + "maxTasks" : 4, + "activeTasks" : 0, + "failedTasks" : 6, + "completedTasks" : 0, + "totalTasks" : 6, + "totalDuration" : 2792, + "totalGCTime" : 128, + "totalInputBytes" : 0, + "totalShuffleRead" : 0, + "totalShuffleWrite" : 0, + "isBlacklisted" : false, + "maxMemory" : 384093388, + "addTime" : "2016-11-15T23:20:42.589GMT", + "executorLogs" : { + "stdout" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stdout", + "stderr" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stderr" + }, + "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "attributes" : { }, + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] +}, { + "id" : "1", + "hostPort" : "172.22.0.111:64541", + "isActive" : true, + "rddBlocks" : 0, + "memoryUsed" : 0, + "diskUsed" : 0, + "totalCores" : 4, + "maxTasks" : 4, + "activeTasks" : 0, + "failedTasks" : 0, + "completedTasks" : 12, + "totalTasks" : 12, + "totalDuration" : 2613, + "totalGCTime" : 84, + "totalInputBytes" : 0, + "totalShuffleRead" : 0, + "totalShuffleWrite" : 0, + "isBlacklisted" : false, + "maxMemory" : 384093388, + "addTime" : "2016-11-15T23:20:42.629GMT", + "executorLogs" : { + "stdout" : "http://172.22.0.111:64518/logPage/?appId=app-20161115172038-0000&executorId=1&logType=stdout", + "stderr" : "http://172.22.0.111:64518/logPage/?appId=app-20161115172038-0000&executorId=1&logType=stderr" + }, + "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "attributes" : { }, + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] +}, { + "id" : "0", + "hostPort" : "172.22.0.111:64540", + "isActive" : true, + "rddBlocks" : 0, + "memoryUsed" : 0, + "diskUsed" : 0, + "totalCores" : 4, + "maxTasks" : 4, + "activeTasks" : 0, + "failedTasks" : 4, + "completedTasks" : 0, + "totalTasks" : 4, + "totalDuration" : 2741, + "totalGCTime" : 120, + "totalInputBytes" : 0, + "totalShuffleRead" : 0, + "totalShuffleWrite" : 0, + "isBlacklisted" : false, + "maxMemory" : 384093388, + "addTime" : "2016-11-15T23:20:42.593GMT", + "executorLogs" : { + "stdout" : "http://172.22.0.111:64517/logPage/?appId=app-20161115172038-0000&executorId=0&logType=stdout", + "stderr" : "http://172.22.0.111:64517/logPage/?appId=app-20161115172038-0000&executorId=0&logType=stderr" + }, + "blacklistedInStages" : [ ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "attributes" : { }, + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] +} ] diff --git a/core/src/test/resources/HistoryServerExpectations/executor_resource_information_expectation.json b/core/src/test/resources/HistoryServerExpectations/executor_resource_information_expectation.json index e69ab3b49d455..53ae9a0c7909e 100644 --- a/core/src/test/resources/HistoryServerExpectations/executor_resource_information_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/executor_resource_information_expectation.json @@ -28,7 +28,10 @@ }, "blacklistedInStages" : [ ], "attributes" : { }, - "resources" : { } + "resources" : { }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] }, { "id" : "2", "hostPort" : "tomg-test:46005", @@ -77,7 +80,10 @@ "name" : "gpu", "addresses" : [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ] } - } + }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] }, { "id" : "1", "hostPort" : "tomg-test:44873", @@ -126,5 +132,8 @@ "name" : "gpu", "addresses" : [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12" ] } - } + }, + "resourceProfileId" : 0, + "isExcluded" : false, + "excludedInStages" : [ ] } ] diff --git a/core/src/test/resources/HistoryServerExpectations/failed_stage_list_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/failed_stage_list_json_expectation.json index da26271e66bc4..5573cf98db26a 100644 --- a/core/src/test/resources/HistoryServerExpectations/failed_stage_list_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/failed_stage_list_json_expectation.json @@ -42,5 +42,28 @@ "schedulingPool" : "default", "rddIds" : [ 3, 2 ], "accumulatorUpdates" : [ ], - "killedTasksSummary" : { } + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } } ] diff --git a/core/src/test/resources/HistoryServerExpectations/limit_app_list_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/limit_app_list_json_expectation.json index 3102909f81116..8e6be68b4670c 100644 --- a/core/src/test/resources/HistoryServerExpectations/limit_app_list_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/limit_app_list_json_expectation.json @@ -1,46 +1,46 @@ [ { - "id" : "application_1555004656427_0144", + "id" : "app-20200706201101-0003", "name" : "Spark shell", "attempts" : [ { - "startTime" : "2019-07-02T21:02:17.180GMT", - "endTime" : "2019-07-02T21:02:35.974GMT", + "startTime" : "2020-07-07T03:11:00.235GMT", + "endTime" : "2020-07-07T03:17:04.231GMT", "lastUpdated" : "", - "duration" : 18794, - "sparkUser" : "tgraves", + "duration" : 363996, + "sparkUser" : "terryk", "completed" : true, - "appSparkVersion" : "3.0.0-SNAPSHOT", - "startTimeEpoch" : 1562101337180, + "appSparkVersion" : "3.1.0-SNAPSHOT", "lastUpdatedEpoch" : 0, - "endTimeEpoch" : 1562101355974 + "endTimeEpoch" : 1594091824231, + "startTimeEpoch" : 1594091460235 } ] }, { - "id" : "application_1553914137147_0018", - "name" : "LargeBlocks", + "id" : "application_1578436911597_0052", + "name" : "Spark shell", "attempts" : [ { - "startTime" : "2019-04-08T20:39:44.286GMT", - "endTime" : "2019-04-08T20:40:46.454GMT", + "startTime" : "2020-01-11T17:44:22.851GMT", + "endTime" : "2020-01-11T17:46:42.615GMT", "lastUpdated" : "", - "duration" : 62168, - "sparkUser" : "systest", + "duration" : 139764, + "sparkUser" : "tgraves", "completed" : true, "appSparkVersion" : "3.0.0-SNAPSHOT", - "startTimeEpoch" : 1554755984286, - "endTimeEpoch" : 1554756046454, + "endTimeEpoch" : 1578764802615, + "startTimeEpoch" : 1578764662851, "lastUpdatedEpoch" : 0 } ] }, { - "id" : "application_1516285256255_0012", + "id" : "application_1555004656427_0144", "name" : "Spark shell", "attempts" : [ { - "startTime" : "2018-01-18T18:30:35.119GMT", - "endTime" : "2018-01-18T18:38:27.938GMT", + "startTime" : "2019-07-02T21:02:17.180GMT", + "endTime" : "2019-07-02T21:02:35.974GMT", "lastUpdated" : "", - "duration" : 472819, - "sparkUser" : "attilapiros", + "duration" : 18794, + "sparkUser" : "tgraves", "completed" : true, - "appSparkVersion" : "2.3.0-SNAPSHOT", + "appSparkVersion" : "3.0.0-SNAPSHOT", + "startTimeEpoch" : 1562101337180, "lastUpdatedEpoch" : 0, - "startTimeEpoch" : 1516300235119, - "endTimeEpoch" : 1516300707938 + "endTimeEpoch" : 1562101355974 } ] } ] diff --git a/core/src/test/resources/HistoryServerExpectations/minDate_app_list_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/minDate_app_list_json_expectation.json index 794f1514a6708..35d71f9d4409b 100644 --- a/core/src/test/resources/HistoryServerExpectations/minDate_app_list_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/minDate_app_list_json_expectation.json @@ -1,21 +1,48 @@ -[ - { - "id": "application_1555004656427_0144", - "name": "Spark shell", - "attempts": [ - { - "startTime": "2019-07-02T21:02:17.180GMT", - "endTime": "2019-07-02T21:02:35.974GMT", - "lastUpdated": "", - "duration": 18794, - "sparkUser": "tgraves", - "completed": true, - "appSparkVersion": "3.0.0-SNAPSHOT", - "startTimeEpoch": 1562101337180, - "lastUpdatedEpoch": 0, - "endTimeEpoch": 1562101355974 - } - ] +[ { + "id" : "app-20200706201101-0003", + "name" : "Spark shell", + "attempts" : [ { + "startTime" : "2020-07-07T03:11:00.235GMT", + "endTime" : "2020-07-07T03:17:04.231GMT", + "lastUpdated" : "", + "duration" : 363996, + "sparkUser" : "terryk", + "completed" : true, + "appSparkVersion" : "3.1.0-SNAPSHOT", + "endTimeEpoch" : 1594091824231, + "startTimeEpoch" : 1594091460235, + "lastUpdatedEpoch" : 0 + } ] +}, { + "id" : "application_1578436911597_0052", + "name" : "Spark shell", + "attempts" : [ { + "startTime" : "2020-01-11T17:44:22.851GMT", + "endTime" : "2020-01-11T17:46:42.615GMT", + "lastUpdated" : "", + "duration" : 139764, + "sparkUser" : "tgraves", + "completed" : true, + "appSparkVersion" : "3.0.0-SNAPSHOT", + "endTimeEpoch" : 1578764802615, + "startTimeEpoch" : 1578764662851, + "lastUpdatedEpoch" : 0 + } ] +}, { + "id" : "application_1555004656427_0144", + "name" : "Spark shell", + "attempts" : [ { + "startTime" : "2019-07-02T21:02:17.180GMT", + "endTime" : "2019-07-02T21:02:35.974GMT", + "lastUpdated" : "", + "duration" : 18794, + "sparkUser" : "tgraves", + "completed" : true, + "appSparkVersion" : "3.0.0-SNAPSHOT", + "endTimeEpoch" : 1562101355974, + "startTimeEpoch" : 1562101337180, + "lastUpdatedEpoch" : 0 + } ] }, { "id" : "application_1553914137147_0018", "name" : "LargeBlocks", diff --git a/core/src/test/resources/HistoryServerExpectations/minEndDate_app_list_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/minEndDate_app_list_json_expectation.json index adcdccef48450..c6530b14bf271 100644 --- a/core/src/test/resources/HistoryServerExpectations/minEndDate_app_list_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/minEndDate_app_list_json_expectation.json @@ -1,4 +1,34 @@ [ { + "id" : "app-20200706201101-0003", + "name" : "Spark shell", + "attempts" : [ { + "startTime" : "2020-07-07T03:11:00.235GMT", + "endTime" : "2020-07-07T03:17:04.231GMT", + "lastUpdated" : "", + "duration" : 363996, + "sparkUser" : "terryk", + "completed" : true, + "appSparkVersion" : "3.1.0-SNAPSHOT", + "endTimeEpoch" : 1594091824231, + "startTimeEpoch" : 1594091460235, + "lastUpdatedEpoch" : 0 + } ] +}, { + "id" : "application_1578436911597_0052", + "name" : "Spark shell", + "attempts" : [ { + "startTime" : "2020-01-11T17:44:22.851GMT", + "endTime" : "2020-01-11T17:46:42.615GMT", + "lastUpdated" : "", + "duration" : 139764, + "sparkUser" : "tgraves", + "completed" : true, + "appSparkVersion" : "3.0.0-SNAPSHOT", + "endTimeEpoch" : 1578764802615, + "startTimeEpoch" : 1578764662851, + "lastUpdatedEpoch" : 0 + } ] +}, { "id" : "application_1555004656427_0144", "name" : "Spark shell", "attempts" : [ { diff --git a/core/src/test/resources/HistoryServerExpectations/miscellaneous_process_expectation.json b/core/src/test/resources/HistoryServerExpectations/miscellaneous_process_expectation.json new file mode 100644 index 0000000000000..93d674a1f9210 --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/miscellaneous_process_expectation.json @@ -0,0 +1,11 @@ +[ { + "id" : "yarn-am", + "hostPort" : "192.168.1.19:8042", + "isActive" : true, + "totalCores" : 1, + "addTime" : "2021-04-19T15:35:50.218GMT", + "processLogs" : { + "stdout" : "http://192.168.1.19:8042/node/containerlogs/container_1555004656427_0144_01_000001/test/stdout?start=-4096", + "stderr" : "http://192.168.1.19:8042/node/containerlogs/container_1555004656427_0144_01_000001/test/stderr?start=-4096" + } +} ] diff --git a/core/src/test/resources/HistoryServerExpectations/multiple_resource_profiles_expectation.json b/core/src/test/resources/HistoryServerExpectations/multiple_resource_profiles_expectation.json new file mode 100644 index 0000000000000..5c1e4cc2337be --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/multiple_resource_profiles_expectation.json @@ -0,0 +1,112 @@ +{ + "runtime" : { + "javaVersion" : "1.8.0_232 (Private Build)", + "javaHome" : "/usr/lib/jvm/java-8-openjdk-amd64/jre", + "scalaVersion" : "version 2.12.10" + }, + "sparkProperties" : [ ], + "hadoopProperties" : [ ], + "systemProperties" : [ ], + "classpathEntries" : [ ], + "resourceProfiles" : [ { + "id" : 0, + "executorResources" : { + "cores" : { + "resourceName" : "cores", + "amount" : 1, + "discoveryScript" : "", + "vendor" : "" + }, + "memory" : { + "resourceName" : "memory", + "amount" : 1024, + "discoveryScript" : "", + "vendor" : "" + }, + "gpu" : { + "resourceName" : "gpu", + "amount" : 1, + "discoveryScript" : "/home/tgraves/getGpus", + "vendor" : "" + } + }, + "taskResources" : { + "cpus" : { + "resourceName" : "cpus", + "amount" : 1.0 + }, + "gpu" : { + "resourceName" : "gpu", + "amount" : 1.0 + } + } + }, { + "id" : 1, + "executorResources" : { + "cores" : { + "resourceName" : "cores", + "amount" : 4, + "discoveryScript" : "", + "vendor" : "" + }, + "gpu" : { + "resourceName" : "gpu", + "amount" : 1, + "discoveryScript" : "./getGpus", + "vendor" : "" + } + }, + "taskResources" : { + "cpus" : { + "resourceName" : "cpus", + "amount" : 1.0 + }, + "gpu" : { + "resourceName" : "gpu", + "amount" : 1.0 + } + } + }, { + "id" : 2, + "executorResources" : { + "cores" : { + "resourceName" : "cores", + "amount" : 2, + "discoveryScript" : "", + "vendor" : "" + } + }, + "taskResources" : { + "cpus" : { + "resourceName" : "cpus", + "amount" : 2.0 + } + } + }, { + "id" : 3, + "executorResources" : { + "cores" : { + "resourceName" : "cores", + "amount" : 4, + "discoveryScript" : "", + "vendor" : "" + }, + "gpu" : { + "resourceName" : "gpu", + "amount" : 1, + "discoveryScript" : "./getGpus", + "vendor" : "" + } + }, + "taskResources" : { + "cpus" : { + "resourceName" : "cpus", + "amount" : 2.0 + }, + "gpu" : { + "resourceName" : "gpu", + "amount" : 1.0 + } + } + } ] +} diff --git a/core/src/test/resources/HistoryServerExpectations/one_stage_attempt_json_details_with_failed_task_expectation.json b/core/src/test/resources/HistoryServerExpectations/one_stage_attempt_json_details_with_failed_task_expectation.json new file mode 100644 index 0000000000000..4579d3b9a84d4 --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/one_stage_attempt_json_details_with_failed_task_expectation.json @@ -0,0 +1,111 @@ +{ + "status" : "COMPLETE", + "stageId" : 1, + "attemptId" : 0, + "numTasks" : 8, + "numActiveTasks" : 0, + "numCompleteTasks" : 8, + "numFailedTasks" : 0, + "numKilledTasks" : 0, + "numCompletedIndices" : 8, + "submissionTime" : "2015-02-03T16:43:05.829GMT", + "firstTaskLaunchedTime" : "2015-02-03T16:43:05.829GMT", + "completionTime" : "2015-02-03T16:43:06.286GMT", + "executorDeserializeTime" : 13, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 3476, + "executorCpuTime" : 0, + "resultSize" : 15216, + "jvmGcTime" : 152, + "resultSerializationTime" : 9, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputBytes" : 28000128, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRemoteBlocksFetched" : 0, + "shuffleLocalBlocksFetched" : 0, + "shuffleFetchWaitTime" : 0, + "shuffleRemoteBytesRead" : 0, + "shuffleRemoteBytesReadToDisk" : 0, + "shuffleLocalBytesRead" : 0, + "shuffleReadBytes" : 0, + "shuffleReadRecords" : 0, + "shuffleWriteBytes" : 13180, + "shuffleWriteTime" : 692000, + "shuffleWriteRecords" : 0, + "name" : "map at :14", + "details" : "org.apache.spark.rdd.RDD.map(RDD.scala:271)\n$line10.$read$$iwC$$iwC$$iwC$$iwC.(:14)\n$line10.$read$$iwC$$iwC$$iwC.(:19)\n$line10.$read$$iwC$$iwC.(:21)\n$line10.$read$$iwC.(:23)\n$line10.$read.(:25)\n$line10.$read$.(:29)\n$line10.$read$.()\n$line10.$eval$.(:7)\n$line10.$eval$.()\n$line10.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:606)\norg.apache.spark.repl.SparkIMain$ReadEvalPrint.call(SparkIMain.scala:852)\norg.apache.spark.repl.SparkIMain$Request.loadAndRun(SparkIMain.scala:1125)\norg.apache.spark.repl.SparkIMain.loadAndRunReq$1(SparkIMain.scala:674)\norg.apache.spark.repl.SparkIMain.interpret(SparkIMain.scala:705)\norg.apache.spark.repl.SparkIMain.interpret(SparkIMain.scala:669)", + "schedulingPool" : "default", + "rddIds" : [ 1, 0 ], + "accumulatorUpdates" : [ ], + "tasks" : { }, + "executorSummary" : { + "driver" : { + "taskTime" : 3624, + "failedTasks" : 0, + "succeededTasks" : 8, + "killedTasks" : 0, + "inputBytes" : 28000128, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 13180, + "shuffleWriteRecords" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : false, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : false + } + }, + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } +} diff --git a/core/src/test/resources/HistoryServerExpectations/one_stage_attempt_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/one_stage_attempt_json_expectation.json index 791907045e500..9edb518132e87 100644 --- a/core/src/test/resources/HistoryServerExpectations/one_stage_attempt_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/one_stage_attempt_json_expectation.json @@ -459,8 +459,54 @@ "shuffleWriteRecords" : 0, "memoryBytesSpilled" : 0, "diskBytesSpilled" : 0, - "isBlacklistedForStage" : false + "isBlacklistedForStage" : false, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : false } }, - "killedTasksSummary" : { } + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } } diff --git a/core/src/test/resources/HistoryServerExpectations/one_stage_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/one_stage_json_expectation.json index 50d3f74ae775f..9e661bdf8a034 100644 --- a/core/src/test/resources/HistoryServerExpectations/one_stage_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/one_stage_json_expectation.json @@ -459,8 +459,54 @@ "shuffleWriteRecords" : 0, "memoryBytesSpilled" : 0, "diskBytesSpilled" : 0, - "isBlacklistedForStage" : false + "isBlacklistedForStage" : false, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : false } }, - "killedTasksSummary" : { } + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } } ] diff --git a/core/src/test/resources/HistoryServerExpectations/one_stage_json_with_details_expectation.json b/core/src/test/resources/HistoryServerExpectations/one_stage_json_with_details_expectation.json new file mode 100644 index 0000000000000..9e661bdf8a034 --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/one_stage_json_with_details_expectation.json @@ -0,0 +1,512 @@ +[ { + "status" : "COMPLETE", + "stageId" : 1, + "attemptId" : 0, + "numTasks" : 8, + "numActiveTasks" : 0, + "numCompleteTasks" : 8, + "numFailedTasks" : 0, + "numKilledTasks" : 0, + "numCompletedIndices" : 8, + "submissionTime" : "2015-02-03T16:43:05.829GMT", + "firstTaskLaunchedTime" : "2015-02-03T16:43:05.829GMT", + "completionTime" : "2015-02-03T16:43:06.286GMT", + "executorDeserializeTime" : 13, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 3476, + "executorCpuTime" : 0, + "resultSize" : 15216, + "jvmGcTime" : 152, + "resultSerializationTime" : 9, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputBytes" : 28000128, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRemoteBlocksFetched" : 0, + "shuffleLocalBlocksFetched" : 0, + "shuffleFetchWaitTime" : 0, + "shuffleRemoteBytesRead" : 0, + "shuffleRemoteBytesReadToDisk" : 0, + "shuffleLocalBytesRead" : 0, + "shuffleReadBytes" : 0, + "shuffleReadRecords" : 0, + "shuffleWriteBytes" : 13180, + "shuffleWriteTime" : 692000, + "shuffleWriteRecords" : 0, + "name" : "map at :14", + "details" : "org.apache.spark.rdd.RDD.map(RDD.scala:271)\n$line10.$read$$iwC$$iwC$$iwC$$iwC.(:14)\n$line10.$read$$iwC$$iwC$$iwC.(:19)\n$line10.$read$$iwC$$iwC.(:21)\n$line10.$read$$iwC.(:23)\n$line10.$read.(:25)\n$line10.$read$.(:29)\n$line10.$read$.()\n$line10.$eval$.(:7)\n$line10.$eval$.()\n$line10.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:606)\norg.apache.spark.repl.SparkIMain$ReadEvalPrint.call(SparkIMain.scala:852)\norg.apache.spark.repl.SparkIMain$Request.loadAndRun(SparkIMain.scala:1125)\norg.apache.spark.repl.SparkIMain.loadAndRunReq$1(SparkIMain.scala:674)\norg.apache.spark.repl.SparkIMain.interpret(SparkIMain.scala:705)\norg.apache.spark.repl.SparkIMain.interpret(SparkIMain.scala:669)", + "schedulingPool" : "default", + "rddIds" : [ 1, 0 ], + "accumulatorUpdates" : [ ], + "tasks" : { + "10" : { + "taskId" : 10, + "index" : 2, + "attempt" : 0, + "launchTime" : "2015-02-03T16:43:05.830GMT", + "duration" : 456, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 434, + "executorCpuTime" : 0, + "resultSize" : 1902, + "jvmGcTime" : 19, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 3500016, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1648, + "writeTime" : 76000, + "recordsWritten" : 0 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 19, + "gettingResultTime" : 0 + }, + "14" : { + "taskId" : 14, + "index" : 6, + "attempt" : 0, + "launchTime" : "2015-02-03T16:43:05.832GMT", + "duration" : 450, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 434, + "executorCpuTime" : 0, + "resultSize" : 1902, + "jvmGcTime" : 19, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 3500016, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1648, + "writeTime" : 88000, + "recordsWritten" : 0 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 13, + "gettingResultTime" : 0 + }, + "9" : { + "taskId" : 9, + "index" : 1, + "attempt" : 0, + "launchTime" : "2015-02-03T16:43:05.830GMT", + "duration" : 454, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 1, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 436, + "executorCpuTime" : 0, + "resultSize" : 1902, + "jvmGcTime" : 19, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 3500016, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1648, + "writeTime" : 98000, + "recordsWritten" : 0 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 17, + "gettingResultTime" : 0 + }, + "13" : { + "taskId" : 13, + "index" : 5, + "attempt" : 0, + "launchTime" : "2015-02-03T16:43:05.831GMT", + "duration" : 452, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 434, + "executorCpuTime" : 0, + "resultSize" : 1902, + "jvmGcTime" : 19, + "resultSerializationTime" : 2, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 3500016, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1648, + "writeTime" : 73000, + "recordsWritten" : 0 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 14, + "gettingResultTime" : 0 + }, + "12" : { + "taskId" : 12, + "index" : 4, + "attempt" : 0, + "launchTime" : "2015-02-03T16:43:05.831GMT", + "duration" : 454, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 434, + "executorCpuTime" : 0, + "resultSize" : 1902, + "jvmGcTime" : 19, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 3500016, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1645, + "writeTime" : 101000, + "recordsWritten" : 0 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 17, + "gettingResultTime" : 0 + }, + "11" : { + "taskId" : 11, + "index" : 3, + "attempt" : 0, + "launchTime" : "2015-02-03T16:43:05.830GMT", + "duration" : 454, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 434, + "executorCpuTime" : 0, + "resultSize" : 1902, + "jvmGcTime" : 19, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 3500016, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1647, + "writeTime" : 83000, + "recordsWritten" : 0 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 17, + "gettingResultTime" : 0 + }, + "8" : { + "taskId" : 8, + "index" : 0, + "attempt" : 0, + "launchTime" : "2015-02-03T16:43:05.829GMT", + "duration" : 454, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 1, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 435, + "executorCpuTime" : 0, + "resultSize" : 1902, + "jvmGcTime" : 19, + "resultSerializationTime" : 2, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 3500016, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1648, + "writeTime" : 94000, + "recordsWritten" : 0 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 16, + "gettingResultTime" : 0 + }, + "15" : { + "taskId" : 15, + "index" : 7, + "attempt" : 0, + "launchTime" : "2015-02-03T16:43:05.833GMT", + "duration" : 450, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 1, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 435, + "executorCpuTime" : 0, + "resultSize" : 1902, + "jvmGcTime" : 19, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 3500016, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1648, + "writeTime" : 79000, + "recordsWritten" : 0 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 13, + "gettingResultTime" : 0 + } + }, + "executorSummary" : { + "driver" : { + "taskTime" : 3624, + "failedTasks" : 0, + "succeededTasks" : 8, + "killedTasks" : 0, + "inputBytes" : 28000128, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 13180, + "shuffleWriteRecords" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : false, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : false + } + }, + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } +} ] diff --git a/core/src/test/resources/HistoryServerExpectations/stage_list_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/stage_list_json_expectation.json index edbac7127039d..d109c73b46133 100644 --- a/core/src/test/resources/HistoryServerExpectations/stage_list_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/stage_list_json_expectation.json @@ -41,7 +41,30 @@ "schedulingPool" : "default", "rddIds" : [ 6, 5 ], "accumulatorUpdates" : [ ], - "killedTasksSummary" : { } + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } }, { "status" : "FAILED", "stageId" : 2, @@ -86,7 +109,30 @@ "schedulingPool" : "default", "rddIds" : [ 3, 2 ], "accumulatorUpdates" : [ ], - "killedTasksSummary" : { } + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } }, { "status" : "COMPLETE", "stageId" : 1, @@ -130,7 +176,30 @@ "schedulingPool" : "default", "rddIds" : [ 1, 0 ], "accumulatorUpdates" : [ ], - "killedTasksSummary" : { } + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } }, { "status" : "COMPLETE", "stageId" : 0, @@ -174,5 +243,28 @@ "schedulingPool" : "default", "rddIds" : [ 0 ], "accumulatorUpdates" : [ ], - "killedTasksSummary" : { } + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } } ] diff --git a/core/src/test/resources/HistoryServerExpectations/stage_list_with_accumulable_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/stage_list_with_accumulable_json_expectation.json index 836f2cb095097..7901c4f93367b 100644 --- a/core/src/test/resources/HistoryServerExpectations/stage_list_with_accumulable_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/stage_list_with_accumulable_json_expectation.json @@ -45,5 +45,28 @@ "name" : "my counter", "value" : "5050" } ], - "killedTasksSummary" : { } + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } } ] diff --git a/core/src/test/resources/HistoryServerExpectations/stage_list_with_peak_metrics_expectation.json b/core/src/test/resources/HistoryServerExpectations/stage_list_with_peak_metrics_expectation.json new file mode 100644 index 0000000000000..d455b97fdafa4 --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/stage_list_with_peak_metrics_expectation.json @@ -0,0 +1,204 @@ +[ { + "status" : "COMPLETE", + "stageId" : 2, + "attemptId" : 0, + "numTasks" : 16, + "numActiveTasks" : 0, + "numCompleteTasks" : 16, + "numFailedTasks" : 0, + "numKilledTasks" : 0, + "numCompletedIndices" : 16, + "submissionTime" : "2020-07-07T03:11:21.040GMT", + "firstTaskLaunchedTime" : "2020-07-07T03:11:21.077GMT", + "completionTime" : "2020-07-07T03:11:23.044GMT", + "executorDeserializeTime" : 3905, + "executorDeserializeCpuTime" : 979900000, + "executorRunTime" : 25579, + "executorCpuTime" : 8810338000, + "resultSize" : 33883, + "jvmGcTime" : 1010, + "resultSerializationTime" : 11, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 384640, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRemoteBlocksFetched" : 0, + "shuffleLocalBlocksFetched" : 0, + "shuffleFetchWaitTime" : 0, + "shuffleRemoteBytesRead" : 0, + "shuffleRemoteBytesReadToDisk" : 0, + "shuffleLocalBytesRead" : 0, + "shuffleReadBytes" : 0, + "shuffleReadRecords" : 0, + "shuffleWriteBytes" : 0, + "shuffleWriteTime" : 0, + "shuffleWriteRecords" : 0, + "name" : "foreach at :26", + "details" : "org.apache.spark.sql.Dataset.foreach(Dataset.scala:2862)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:26)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:30)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:32)\n$line19.$read$$iw$$iw$$iw$$iw$$iw.(:34)\n$line19.$read$$iw$$iw$$iw$$iw.(:36)\n$line19.$read$$iw$$iw$$iw.(:38)\n$line19.$read$$iw$$iw.(:40)\n$line19.$read$$iw.(:42)\n$line19.$read.(:44)\n$line19.$read$.(:48)\n$line19.$read$.()\n$line19.$eval$.$print$lzycompute(:7)\n$line19.$eval$.$print(:6)\n$line19.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\nscala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:745)", + "schedulingPool" : "default", + "rddIds" : [ 10, 8, 6, 7, 9 ], + "accumulatorUpdates" : [ ], + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 213367864, + "JVMOffHeapMemory" : 189011656, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 2133349, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 2133349, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 282024, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 13, + "MinorGCTime" : 115, + "MajorGCCount" : 4, + "MajorGCTime" : 339 + } +}, { + "status" : "COMPLETE", + "stageId" : 1, + "attemptId" : 0, + "numTasks" : 16, + "numActiveTasks" : 0, + "numCompleteTasks" : 16, + "numFailedTasks" : 0, + "numKilledTasks" : 0, + "numCompletedIndices" : 16, + "submissionTime" : "2020-07-07T03:11:20.499GMT", + "firstTaskLaunchedTime" : "2020-07-07T03:11:20.502GMT", + "completionTime" : "2020-07-07T03:11:20.930GMT", + "executorDeserializeTime" : 424, + "executorDeserializeCpuTime" : 63666000, + "executorRunTime" : 6105, + "executorCpuTime" : 426449000, + "resultSize" : 31546, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 16256, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRemoteBlocksFetched" : 0, + "shuffleLocalBlocksFetched" : 0, + "shuffleFetchWaitTime" : 0, + "shuffleRemoteBytesRead" : 0, + "shuffleRemoteBytesReadToDisk" : 0, + "shuffleLocalBytesRead" : 0, + "shuffleReadBytes" : 0, + "shuffleReadRecords" : 0, + "shuffleWriteBytes" : 0, + "shuffleWriteTime" : 0, + "shuffleWriteRecords" : 0, + "name" : "$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266", + "description" : "broadcast exchange (runId bac7289a-c1d8-4966-a6a3-d9f347e13a5d)", + "details" : "org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$1(SQLExecution.scala:185)\njava.util.concurrent.FutureTask.run(FutureTask.java:266)\njava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\njava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\njava.lang.Thread.run(Thread.java:748)", + "schedulingPool" : "default", + "rddIds" : [ 5, 3, 4 ], + "accumulatorUpdates" : [ ], + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } +}, { + "status" : "COMPLETE", + "stageId" : 0, + "attemptId" : 0, + "numTasks" : 16, + "numActiveTasks" : 0, + "numCompleteTasks" : 16, + "numFailedTasks" : 0, + "numKilledTasks" : 0, + "numCompletedIndices" : 16, + "submissionTime" : "2020-07-07T03:11:18.860GMT", + "firstTaskLaunchedTime" : "2020-07-07T03:11:19.253GMT", + "completionTime" : "2020-07-07T03:11:20.381GMT", + "executorDeserializeTime" : 15399, + "executorDeserializeCpuTime" : 3668889000, + "executorRunTime" : 1292, + "executorCpuTime" : 172863000, + "resultSize" : 22375, + "jvmGcTime" : 1744, + "resultSerializationTime" : 3, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRemoteBlocksFetched" : 0, + "shuffleLocalBlocksFetched" : 0, + "shuffleFetchWaitTime" : 0, + "shuffleRemoteBytesRead" : 0, + "shuffleRemoteBytesReadToDisk" : 0, + "shuffleLocalBytesRead" : 0, + "shuffleReadBytes" : 0, + "shuffleReadRecords" : 0, + "shuffleWriteBytes" : 0, + "shuffleWriteTime" : 0, + "shuffleWriteRecords" : 0, + "name" : "$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266", + "description" : "broadcast exchange (runId bb0234e5-4157-49a4-b40c-6d538d9f2ec8)", + "details" : "org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$1(SQLExecution.scala:185)\njava.util.concurrent.FutureTask.run(FutureTask.java:266)\njava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\njava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\njava.lang.Thread.run(Thread.java:748)", + "schedulingPool" : "default", + "rddIds" : [ 2, 0, 1 ], + "accumulatorUpdates" : [ ], + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 155100856, + "JVMOffHeapMemory" : 64239224, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 6964, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 6964, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 1852, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 7, + "MinorGCTime" : 33, + "MajorGCCount" : 3, + "MajorGCTime" : 110 + } +} ] diff --git a/core/src/test/resources/HistoryServerExpectations/stage_task_list_w__status___offset___length_expectation.json b/core/src/test/resources/HistoryServerExpectations/stage_task_list_w__status___offset___length_expectation.json new file mode 100644 index 0000000000000..28509e33c5dcc --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/stage_task_list_w__status___offset___length_expectation.json @@ -0,0 +1,99 @@ +[ { + "taskId" : 1, + "index" : 1, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:06.502GMT", + "duration" : 421, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 31, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 350, + "executorCpuTime" : 0, + "resultSize" : 2010, + "jvmGcTime" : 7, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 60488, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 3934399, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 40, + "gettingResultTime" : 0 +}, { + "taskId" : 2, + "index" : 2, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:06.503GMT", + "duration" : 419, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 32, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 348, + "executorCpuTime" : 0, + "resultSize" : 2010, + "jvmGcTime" : 7, + "resultSerializationTime" : 2, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 60488, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 89885, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 37, + "gettingResultTime" : 0 +} ] diff --git a/core/src/test/resources/HistoryServerExpectations/stage_task_list_w__status___sortBy_short_names__runtime_expectation.json b/core/src/test/resources/HistoryServerExpectations/stage_task_list_w__status___sortBy_short_names__runtime_expectation.json new file mode 100644 index 0000000000000..01eef1b565bf6 --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/stage_task_list_w__status___sortBy_short_names__runtime_expectation.json @@ -0,0 +1,981 @@ +[ { + "taskId" : 40, + "index" : 40, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.197GMT", + "duration" : 24, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 4, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 14, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 94792, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 6, + "gettingResultTime" : 0 +}, { + "taskId" : 41, + "index" : 41, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.200GMT", + "duration" : 24, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 16, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 90765, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 6, + "gettingResultTime" : 0 +}, { + "taskId" : 43, + "index" : 43, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.204GMT", + "duration" : 39, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 16, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 171516, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 21, + "gettingResultTime" : 0 +}, { + "taskId" : 57, + "index" : 57, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.257GMT", + "duration" : 21, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 3, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 16, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 96849, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 2, + "gettingResultTime" : 0 +}, { + "taskId" : 58, + "index" : 58, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.263GMT", + "duration" : 23, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 3, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 16, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 97521, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 4, + "gettingResultTime" : 0 +}, { + "taskId" : 68, + "index" : 68, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.306GMT", + "duration" : 22, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 16, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 101750, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 4, + "gettingResultTime" : 0 +}, { + "taskId" : 86, + "index" : 86, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.374GMT", + "duration" : 28, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 3, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 16, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 1, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 95848, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 8, + "gettingResultTime" : 0 +}, { + "taskId" : 32, + "index" : 32, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.148GMT", + "duration" : 33, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 3, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 17, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 89603, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 13, + "gettingResultTime" : 0 +}, { + "taskId" : 39, + "index" : 39, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.180GMT", + "duration" : 32, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 17, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 98748, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 13, + "gettingResultTime" : 0 +}, { + "taskId" : 42, + "index" : 42, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.203GMT", + "duration" : 42, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 10, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 17, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 103713, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 15, + "gettingResultTime" : 0 +}, { + "taskId" : 51, + "index" : 51, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.242GMT", + "duration" : 21, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 17, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 96013, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 2, + "gettingResultTime" : 0 +}, { + "taskId" : 59, + "index" : 59, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.265GMT", + "duration" : 23, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 3, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 17, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 100753, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 3, + "gettingResultTime" : 0 +}, { + "taskId" : 63, + "index" : 63, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.276GMT", + "duration" : 40, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 20, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 17, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 5, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 102779, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 3, + "gettingResultTime" : 0 +}, { + "taskId" : 87, + "index" : 87, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.374GMT", + "duration" : 36, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 12, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 17, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 102159, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 7, + "gettingResultTime" : 0 +}, { + "taskId" : 90, + "index" : 90, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.385GMT", + "duration" : 23, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 17, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 98472, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 4, + "gettingResultTime" : 0 +}, { + "taskId" : 99, + "index" : 99, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.426GMT", + "duration" : 22, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 17, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70565, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 133964, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 3, + "gettingResultTime" : 0 +}, { + "taskId" : 44, + "index" : 44, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.205GMT", + "duration" : 37, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 3, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 18, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 98293, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 16, + "gettingResultTime" : 0 +}, { + "taskId" : 47, + "index" : 47, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.212GMT", + "duration" : 33, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 2, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 18, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 103015, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 13, + "gettingResultTime" : 0 +}, { + "taskId" : 50, + "index" : 50, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.240GMT", + "duration" : 26, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 4, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 18, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 90836, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 4, + "gettingResultTime" : 0 +}, { + "taskId" : 52, + "index" : 52, + "attempt" : 0, + "launchTime" : "2015-05-06T13:03:07.243GMT", + "duration" : 28, + "executorId" : "driver", + "host" : "localhost", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 5, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 18, + "executorCpuTime" : 0, + "resultSize" : 2065, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 70564, + "recordsRead" : 10000 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 1710, + "writeTime" : 89664, + "recordsWritten" : 10 + } + }, + "executorLogs" : { }, + "schedulerDelay" : 5, + "gettingResultTime" : 0 +} ] diff --git a/core/src/test/resources/HistoryServerExpectations/stage_task_list_w__status_expectation.json b/core/src/test/resources/HistoryServerExpectations/stage_task_list_w__status_expectation.json new file mode 100644 index 0000000000000..9896aceb275de --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/stage_task_list_w__status_expectation.json @@ -0,0 +1,531 @@ +[ { + "taskId" : 1, + "index" : 1, + "attempt" : 0, + "launchTime" : "2016-11-15T23:20:44.052GMT", + "duration" : 675, + "executorId" : "0", + "host" : "172.22.0.111", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: bad exec\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcII$sp(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1757)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:99)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 494, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 30, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://172.22.0.111:64517/logPage/?appId=app-20161115172038-0000&executorId=0&logType=stdout", + "stderr" : "http://172.22.0.111:64517/logPage/?appId=app-20161115172038-0000&executorId=0&logType=stderr" + }, + "schedulerDelay" : 181, + "gettingResultTime" : 0 +}, { + "taskId" : 3, + "index" : 3, + "attempt" : 0, + "launchTime" : "2016-11-15T23:20:44.053GMT", + "duration" : 725, + "executorId" : "2", + "host" : "172.22.0.111", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: bad exec\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcII$sp(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1757)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:99)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 456, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 32, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stdout", + "stderr" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stderr" + }, + "schedulerDelay" : 269, + "gettingResultTime" : 0 +}, { + "taskId" : 5, + "index" : 5, + "attempt" : 0, + "launchTime" : "2016-11-15T23:20:44.055GMT", + "duration" : 665, + "executorId" : "0", + "host" : "172.22.0.111", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: bad exec\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcII$sp(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1757)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:99)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 495, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 30, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://172.22.0.111:64517/logPage/?appId=app-20161115172038-0000&executorId=0&logType=stdout", + "stderr" : "http://172.22.0.111:64517/logPage/?appId=app-20161115172038-0000&executorId=0&logType=stderr" + }, + "schedulerDelay" : 170, + "gettingResultTime" : 0 +}, { + "taskId" : 7, + "index" : 7, + "attempt" : 0, + "launchTime" : "2016-11-15T23:20:44.056GMT", + "duration" : 685, + "executorId" : "2", + "host" : "172.22.0.111", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: bad exec\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcII$sp(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1757)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:99)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 448, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 32, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stdout", + "stderr" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stderr" + }, + "schedulerDelay" : 237, + "gettingResultTime" : 0 +}, { + "taskId" : 9, + "index" : 9, + "attempt" : 0, + "launchTime" : "2016-11-15T23:20:44.057GMT", + "duration" : 732, + "executorId" : "0", + "host" : "172.22.0.111", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: bad exec\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcII$sp(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1757)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:99)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 503, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 30, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://172.22.0.111:64517/logPage/?appId=app-20161115172038-0000&executorId=0&logType=stdout", + "stderr" : "http://172.22.0.111:64517/logPage/?appId=app-20161115172038-0000&executorId=0&logType=stderr" + }, + "schedulerDelay" : 229, + "gettingResultTime" : 0 +}, { + "taskId" : 11, + "index" : 11, + "attempt" : 0, + "launchTime" : "2016-11-15T23:20:44.058GMT", + "duration" : 678, + "executorId" : "2", + "host" : "172.22.0.111", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: bad exec\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcII$sp(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1757)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:99)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 451, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 32, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stdout", + "stderr" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stderr" + }, + "schedulerDelay" : 227, + "gettingResultTime" : 0 +}, { + "taskId" : 13, + "index" : 13, + "attempt" : 0, + "launchTime" : "2016-11-15T23:20:44.060GMT", + "duration" : 669, + "executorId" : "0", + "host" : "172.22.0.111", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: bad exec\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcII$sp(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1757)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:99)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 494, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 30, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://172.22.0.111:64517/logPage/?appId=app-20161115172038-0000&executorId=0&logType=stdout", + "stderr" : "http://172.22.0.111:64517/logPage/?appId=app-20161115172038-0000&executorId=0&logType=stderr" + }, + "schedulerDelay" : 175, + "gettingResultTime" : 0 +}, { + "taskId" : 15, + "index" : 15, + "attempt" : 0, + "launchTime" : "2016-11-15T23:20:44.065GMT", + "duration" : 672, + "executorId" : "2", + "host" : "172.22.0.111", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: bad exec\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcII$sp(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1757)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:99)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 446, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 32, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stdout", + "stderr" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stderr" + }, + "schedulerDelay" : 226, + "gettingResultTime" : 0 +}, { + "taskId" : 19, + "index" : 11, + "attempt" : 1, + "launchTime" : "2016-11-15T23:20:44.736GMT", + "duration" : 13, + "executorId" : "2", + "host" : "172.22.0.111", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: bad exec\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcII$sp(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1757)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:99)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 2, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stdout", + "stderr" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stderr" + }, + "schedulerDelay" : 11, + "gettingResultTime" : 0 +}, { + "taskId" : 20, + "index" : 15, + "attempt" : 1, + "launchTime" : "2016-11-15T23:20:44.737GMT", + "duration" : 19, + "executorId" : "2", + "host" : "172.22.0.111", + "status" : "FAILED", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "errorMessage" : "java.lang.RuntimeException: bad exec\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply$mcII$sp(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat $line16.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$1.apply(:26)\n\tat scala.collection.Iterator$$anon$11.next(Iterator.scala:409)\n\tat org.apache.spark.util.Utils$.getIteratorSize(Utils.scala:1757)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.rdd.RDD$$anonfun$count$1.apply(RDD.scala:1135)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.SparkContext$$anonfun$runJob$5.apply(SparkContext.scala:1927)\n\tat org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)\n\tat org.apache.spark.scheduler.Task.run(Task.scala:99)\n\tat org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\n\tat java.lang.Thread.run(Thread.java:745)\n", + "taskMetrics" : { + "executorDeserializeTime" : 0, + "executorDeserializeCpuTime" : 0, + "executorRunTime" : 10, + "executorCpuTime" : 0, + "resultSize" : 0, + "jvmGcTime" : 0, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 0, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stdout", + "stderr" : "http://172.22.0.111:64519/logPage/?appId=app-20161115172038-0000&executorId=2&logType=stderr" + }, + "schedulerDelay" : 9, + "gettingResultTime" : 0 +} ] diff --git a/core/src/test/resources/HistoryServerExpectations/stage_task_summary_w__custom_quantiles_expectation.json b/core/src/test/resources/HistoryServerExpectations/stage_task_summary_w__custom_quantiles_expectation.json index 5c42ac1d87f4c..51af1f3b82c7a 100644 --- a/core/src/test/resources/HistoryServerExpectations/stage_task_summary_w__custom_quantiles_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/stage_task_summary_w__custom_quantiles_expectation.json @@ -1,5 +1,6 @@ { "quantiles" : [ 0.01, 0.5, 0.99 ], + "duration" : [ 21.0, 40.0, 435.0 ], "executorDeserializeTime" : [ 1.0, 3.0, 36.0 ], "executorDeserializeCpuTime" : [ 0.0, 0.0, 0.0 ], "executorRunTime" : [ 16.0, 28.0, 351.0 ], diff --git a/core/src/test/resources/HistoryServerExpectations/stage_task_summary_w_shuffle_read_expectation.json b/core/src/test/resources/HistoryServerExpectations/stage_task_summary_w_shuffle_read_expectation.json index e6b705989cc97..a2ac950753258 100644 --- a/core/src/test/resources/HistoryServerExpectations/stage_task_summary_w_shuffle_read_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/stage_task_summary_w_shuffle_read_expectation.json @@ -1,5 +1,6 @@ { "quantiles" : [ 0.05, 0.25, 0.5, 0.75, 0.95 ], + "duration" : [ 37.0, 81.0, 83.0, 84.0, 86.0 ], "executorDeserializeTime" : [ 1.0, 2.0, 2.0, 2.0, 3.0 ], "executorDeserializeCpuTime" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], "executorRunTime" : [ 30.0, 74.0, 75.0, 76.0, 79.0 ], diff --git a/core/src/test/resources/HistoryServerExpectations/stage_task_summary_w_shuffle_write_expectation.json b/core/src/test/resources/HistoryServerExpectations/stage_task_summary_w_shuffle_write_expectation.json index 788f28cf7b365..78aa1b1fa809d 100644 --- a/core/src/test/resources/HistoryServerExpectations/stage_task_summary_w_shuffle_write_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/stage_task_summary_w_shuffle_write_expectation.json @@ -1,5 +1,6 @@ { "quantiles" : [ 0.05, 0.25, 0.5, 0.75, 0.95 ], + "duration" : [ 23.0, 33.0, 40.0, 74.0, 419.0 ], "executorDeserializeTime" : [ 2.0, 2.0, 3.0, 7.0, 31.0 ], "executorDeserializeCpuTime" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], "executorRunTime" : [ 16.0, 18.0, 28.0, 49.0, 349.0 ], diff --git a/core/src/test/resources/HistoryServerExpectations/stage_with_accumulable_json_expectation.json b/core/src/test/resources/HistoryServerExpectations/stage_with_accumulable_json_expectation.json index 735a8257fc343..a5958e0a093f1 100644 --- a/core/src/test/resources/HistoryServerExpectations/stage_with_accumulable_json_expectation.json +++ b/core/src/test/resources/HistoryServerExpectations/stage_with_accumulable_json_expectation.json @@ -503,8 +503,54 @@ "shuffleWriteRecords" : 0, "memoryBytesSpilled" : 0, "diskBytesSpilled" : 0, - "isBlacklistedForStage" : false + "isBlacklistedForStage" : false, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : false } }, - "killedTasksSummary" : { } + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + } } diff --git a/core/src/test/resources/HistoryServerExpectations/stage_with_peak_metrics_expectation.json b/core/src/test/resources/HistoryServerExpectations/stage_with_peak_metrics_expectation.json new file mode 100644 index 0000000000000..20a958073245a --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/stage_with_peak_metrics_expectation.json @@ -0,0 +1,1000 @@ +{ + "status" : "COMPLETE", + "stageId" : 2, + "attemptId" : 0, + "numTasks" : 16, + "numActiveTasks" : 0, + "numCompleteTasks" : 16, + "numFailedTasks" : 0, + "numKilledTasks" : 0, + "numCompletedIndices" : 16, + "submissionTime" : "2020-07-07T03:11:21.040GMT", + "firstTaskLaunchedTime" : "2020-07-07T03:11:21.077GMT", + "completionTime" : "2020-07-07T03:11:23.044GMT", + "executorDeserializeTime" : 3905, + "executorDeserializeCpuTime" : 979900000, + "executorRunTime" : 25579, + "executorCpuTime" : 8810338000, + "resultSize" : 33883, + "jvmGcTime" : 1010, + "resultSerializationTime" : 11, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 384640, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRemoteBlocksFetched" : 0, + "shuffleLocalBlocksFetched" : 0, + "shuffleFetchWaitTime" : 0, + "shuffleRemoteBytesRead" : 0, + "shuffleRemoteBytesReadToDisk" : 0, + "shuffleLocalBytesRead" : 0, + "shuffleReadBytes" : 0, + "shuffleReadRecords" : 0, + "shuffleWriteBytes" : 0, + "shuffleWriteTime" : 0, + "shuffleWriteRecords" : 0, + "name" : "foreach at :26", + "details" : "org.apache.spark.sql.Dataset.foreach(Dataset.scala:2862)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:26)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:30)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:32)\n$line19.$read$$iw$$iw$$iw$$iw$$iw.(:34)\n$line19.$read$$iw$$iw$$iw$$iw.(:36)\n$line19.$read$$iw$$iw$$iw.(:38)\n$line19.$read$$iw$$iw.(:40)\n$line19.$read$$iw.(:42)\n$line19.$read.(:44)\n$line19.$read$.(:48)\n$line19.$read$.()\n$line19.$eval$.$print$lzycompute(:7)\n$line19.$eval$.$print(:6)\n$line19.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\nscala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:745)", + "schedulingPool" : "default", + "rddIds" : [ 10, 8, 6, 7, 9 ], + "accumulatorUpdates" : [ ], + "tasks" : { + "42" : { + "taskId" : 42, + "index" : 10, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.120GMT", + "duration" : 1923, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 229, + "executorDeserializeCpuTime" : 58152000, + "executorRunTime" : 1624, + "executorCpuTime" : 508230000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 70, + "gettingResultTime" : 0 + }, + "37" : { + "taskId" : 37, + "index" : 5, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.100GMT", + "duration" : 1915, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 256, + "executorDeserializeCpuTime" : 60890000, + "executorRunTime" : 1596, + "executorCpuTime" : 507192000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 63, + "gettingResultTime" : 0 + }, + "46" : { + "taskId" : 46, + "index" : 14, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.132GMT", + "duration" : 1905, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 218, + "executorDeserializeCpuTime" : 51464000, + "executorRunTime" : 1618, + "executorCpuTime" : 490927000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 69, + "gettingResultTime" : 0 + }, + "38" : { + "taskId" : 38, + "index" : 6, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.104GMT", + "duration" : 1835, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 255, + "executorDeserializeCpuTime" : 60358000, + "executorRunTime" : 1498, + "executorCpuTime" : 414110000, + "resultSize" : 2158, + "jvmGcTime" : 62, + "resultSerializationTime" : 11, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 71, + "gettingResultTime" : 0 + }, + "33" : { + "taskId" : 33, + "index" : 1, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.082GMT", + "duration" : 1943, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 267, + "executorDeserializeCpuTime" : 54442000, + "executorRunTime" : 1597, + "executorCpuTime" : 519178000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 79, + "gettingResultTime" : 0 + }, + "41" : { + "taskId" : 41, + "index" : 9, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.116GMT", + "duration" : 1916, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 240, + "executorDeserializeCpuTime" : 55787000, + "executorRunTime" : 1614, + "executorCpuTime" : 489923000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 62, + "gettingResultTime" : 0 + }, + "32" : { + "taskId" : 32, + "index" : 0, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.077GMT", + "duration" : 1960, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 271, + "executorDeserializeCpuTime" : 56827000, + "executorRunTime" : 1619, + "executorCpuTime" : 496683000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 70, + "gettingResultTime" : 0 + }, + "34" : { + "taskId" : 34, + "index" : 2, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.087GMT", + "duration" : 1939, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 265, + "executorDeserializeCpuTime" : 69492000, + "executorRunTime" : 1606, + "executorCpuTime" : 508433000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 68, + "gettingResultTime" : 0 + }, + "45" : { + "taskId" : 45, + "index" : 13, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.129GMT", + "duration" : 1895, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 221, + "executorDeserializeCpuTime" : 54222000, + "executorRunTime" : 1595, + "executorCpuTime" : 495138000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 79, + "gettingResultTime" : 0 + }, + "44" : { + "taskId" : 44, + "index" : 12, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.126GMT", + "duration" : 1917, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 222, + "executorDeserializeCpuTime" : 51988000, + "executorRunTime" : 1624, + "executorCpuTime" : 498187000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 71, + "gettingResultTime" : 0 + }, + "39" : { + "taskId" : 39, + "index" : 7, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.109GMT", + "duration" : 1915, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 254, + "executorDeserializeCpuTime" : 64380000, + "executorRunTime" : 1596, + "executorCpuTime" : 539451000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 65, + "gettingResultTime" : 0 + }, + "35" : { + "taskId" : 35, + "index" : 3, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.091GMT", + "duration" : 1925, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 263, + "executorDeserializeCpuTime" : 62944000, + "executorRunTime" : 1598, + "executorCpuTime" : 502908000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 64, + "gettingResultTime" : 0 + }, + "43" : { + "taskId" : 43, + "index" : 11, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.123GMT", + "duration" : 1906, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 225, + "executorDeserializeCpuTime" : 48849000, + "executorRunTime" : 1609, + "executorCpuTime" : 502120000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 72, + "gettingResultTime" : 0 + }, + "40" : { + "taskId" : 40, + "index" : 8, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.112GMT", + "duration" : 1904, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 246, + "executorDeserializeCpuTime" : 69760000, + "executorRunTime" : 1595, + "executorCpuTime" : 510597000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 63, + "gettingResultTime" : 0 + }, + "36" : { + "taskId" : 36, + "index" : 4, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.095GMT", + "duration" : 1920, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 260, + "executorDeserializeCpuTime" : 112849000, + "executorRunTime" : 1596, + "executorCpuTime" : 503010000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 64, + "gettingResultTime" : 0 + }, + "47" : { + "taskId" : 47, + "index" : 15, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.136GMT", + "duration" : 1878, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 213, + "executorDeserializeCpuTime" : 47496000, + "executorRunTime" : 1594, + "executorCpuTime" : 1324251000, + "resultSize" : 2115, + "jvmGcTime" : 52, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 71, + "gettingResultTime" : 0 + } + }, + "executorSummary" : { + "0" : { + "taskTime" : 30596, + "failedTasks" : 0, + "succeededTasks" : 16, + "killedTasks" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 0, + "shuffleWriteRecords" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : false, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : false + }, + "driver" : { + "taskTime" : 0, + "failedTasks" : 0, + "succeededTasks" : 0, + "killedTasks" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 0, + "shuffleWriteRecords" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : false, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 213367864, + "JVMOffHeapMemory" : 189011656, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 2133349, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 2133349, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 282024, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 13, + "MinorGCTime" : 115, + "MajorGCCount" : 4, + "MajorGCTime" : 339 + }, + "isExcludedForStage" : false + } + }, + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 213367864, + "JVMOffHeapMemory" : 189011656, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 2133349, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 2133349, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 282024, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 13, + "MinorGCTime" : 115, + "MajorGCCount" : 4, + "MajorGCTime" : 339 + } +} diff --git a/core/src/test/resources/HistoryServerExpectations/stage_with_summaries_expectation.json b/core/src/test/resources/HistoryServerExpectations/stage_with_summaries_expectation.json new file mode 100644 index 0000000000000..f200da37e860e --- /dev/null +++ b/core/src/test/resources/HistoryServerExpectations/stage_with_summaries_expectation.json @@ -0,0 +1,1078 @@ +{ + "status" : "COMPLETE", + "stageId" : 2, + "attemptId" : 0, + "numTasks" : 16, + "numActiveTasks" : 0, + "numCompleteTasks" : 16, + "numFailedTasks" : 0, + "numKilledTasks" : 0, + "numCompletedIndices" : 16, + "submissionTime" : "2020-07-07T03:11:21.040GMT", + "firstTaskLaunchedTime" : "2020-07-07T03:11:21.077GMT", + "completionTime" : "2020-07-07T03:11:23.044GMT", + "executorDeserializeTime" : 3905, + "executorDeserializeCpuTime" : 979900000, + "executorRunTime" : 25579, + "executorCpuTime" : 8810338000, + "resultSize" : 33883, + "jvmGcTime" : 1010, + "resultSerializationTime" : 11, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 384640, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRemoteBlocksFetched" : 0, + "shuffleLocalBlocksFetched" : 0, + "shuffleFetchWaitTime" : 0, + "shuffleRemoteBytesRead" : 0, + "shuffleRemoteBytesReadToDisk" : 0, + "shuffleLocalBytesRead" : 0, + "shuffleReadBytes" : 0, + "shuffleReadRecords" : 0, + "shuffleWriteBytes" : 0, + "shuffleWriteTime" : 0, + "shuffleWriteRecords" : 0, + "name" : "foreach at :26", + "details" : "org.apache.spark.sql.Dataset.foreach(Dataset.scala:2862)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:26)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:30)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:32)\n$line19.$read$$iw$$iw$$iw$$iw$$iw.(:34)\n$line19.$read$$iw$$iw$$iw$$iw.(:36)\n$line19.$read$$iw$$iw$$iw.(:38)\n$line19.$read$$iw$$iw.(:40)\n$line19.$read$$iw.(:42)\n$line19.$read.(:44)\n$line19.$read$.(:48)\n$line19.$read$.()\n$line19.$eval$.$print$lzycompute(:7)\n$line19.$eval$.$print(:6)\n$line19.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\nscala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:745)", + "schedulingPool" : "default", + "rddIds" : [ 10, 8, 6, 7, 9 ], + "accumulatorUpdates" : [ ], + "tasks" : { + "42" : { + "taskId" : 42, + "index" : 10, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.120GMT", + "duration" : 1923, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 229, + "executorDeserializeCpuTime" : 58152000, + "executorRunTime" : 1624, + "executorCpuTime" : 508230000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 70, + "gettingResultTime" : 0 + }, + "37" : { + "taskId" : 37, + "index" : 5, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.100GMT", + "duration" : 1915, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 256, + "executorDeserializeCpuTime" : 60890000, + "executorRunTime" : 1596, + "executorCpuTime" : 507192000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 63, + "gettingResultTime" : 0 + }, + "46" : { + "taskId" : 46, + "index" : 14, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.132GMT", + "duration" : 1905, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 218, + "executorDeserializeCpuTime" : 51464000, + "executorRunTime" : 1618, + "executorCpuTime" : 490927000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 69, + "gettingResultTime" : 0 + }, + "38" : { + "taskId" : 38, + "index" : 6, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.104GMT", + "duration" : 1835, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 255, + "executorDeserializeCpuTime" : 60358000, + "executorRunTime" : 1498, + "executorCpuTime" : 414110000, + "resultSize" : 2158, + "jvmGcTime" : 62, + "resultSerializationTime" : 11, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 71, + "gettingResultTime" : 0 + }, + "33" : { + "taskId" : 33, + "index" : 1, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.082GMT", + "duration" : 1943, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 267, + "executorDeserializeCpuTime" : 54442000, + "executorRunTime" : 1597, + "executorCpuTime" : 519178000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 79, + "gettingResultTime" : 0 + }, + "41" : { + "taskId" : 41, + "index" : 9, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.116GMT", + "duration" : 1916, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 240, + "executorDeserializeCpuTime" : 55787000, + "executorRunTime" : 1614, + "executorCpuTime" : 489923000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 62, + "gettingResultTime" : 0 + }, + "32" : { + "taskId" : 32, + "index" : 0, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.077GMT", + "duration" : 1960, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 271, + "executorDeserializeCpuTime" : 56827000, + "executorRunTime" : 1619, + "executorCpuTime" : 496683000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 70, + "gettingResultTime" : 0 + }, + "34" : { + "taskId" : 34, + "index" : 2, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.087GMT", + "duration" : 1939, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 265, + "executorDeserializeCpuTime" : 69492000, + "executorRunTime" : 1606, + "executorCpuTime" : 508433000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 68, + "gettingResultTime" : 0 + }, + "45" : { + "taskId" : 45, + "index" : 13, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.129GMT", + "duration" : 1895, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 221, + "executorDeserializeCpuTime" : 54222000, + "executorRunTime" : 1595, + "executorCpuTime" : 495138000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 79, + "gettingResultTime" : 0 + }, + "44" : { + "taskId" : 44, + "index" : 12, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.126GMT", + "duration" : 1917, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 222, + "executorDeserializeCpuTime" : 51988000, + "executorRunTime" : 1624, + "executorCpuTime" : 498187000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 71, + "gettingResultTime" : 0 + }, + "39" : { + "taskId" : 39, + "index" : 7, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.109GMT", + "duration" : 1915, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 254, + "executorDeserializeCpuTime" : 64380000, + "executorRunTime" : 1596, + "executorCpuTime" : 539451000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 65, + "gettingResultTime" : 0 + }, + "35" : { + "taskId" : 35, + "index" : 3, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.091GMT", + "duration" : 1925, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 263, + "executorDeserializeCpuTime" : 62944000, + "executorRunTime" : 1598, + "executorCpuTime" : 502908000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 64, + "gettingResultTime" : 0 + }, + "43" : { + "taskId" : 43, + "index" : 11, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.123GMT", + "duration" : 1906, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 225, + "executorDeserializeCpuTime" : 48849000, + "executorRunTime" : 1609, + "executorCpuTime" : 502120000, + "resultSize" : 2115, + "jvmGcTime" : 66, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 72, + "gettingResultTime" : 0 + }, + "40" : { + "taskId" : 40, + "index" : 8, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.112GMT", + "duration" : 1904, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 246, + "executorDeserializeCpuTime" : 69760000, + "executorRunTime" : 1595, + "executorCpuTime" : 510597000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 63, + "gettingResultTime" : 0 + }, + "36" : { + "taskId" : 36, + "index" : 4, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.095GMT", + "duration" : 1920, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 260, + "executorDeserializeCpuTime" : 112849000, + "executorRunTime" : 1596, + "executorCpuTime" : 503010000, + "resultSize" : 2115, + "jvmGcTime" : 62, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 64, + "gettingResultTime" : 0 + }, + "47" : { + "taskId" : 47, + "index" : 15, + "attempt" : 0, + "launchTime" : "2020-07-07T03:11:21.136GMT", + "duration" : 1878, + "executorId" : "0", + "host" : "127.0.0.1", + "status" : "SUCCESS", + "taskLocality" : "PROCESS_LOCAL", + "speculative" : false, + "accumulatorUpdates" : [ ], + "taskMetrics" : { + "executorDeserializeTime" : 213, + "executorDeserializeCpuTime" : 47496000, + "executorRunTime" : 1594, + "executorCpuTime" : 1324251000, + "resultSize" : 2115, + "jvmGcTime" : 52, + "resultSerializationTime" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "peakExecutionMemory" : 24040, + "inputMetrics" : { + "bytesRead" : 0, + "recordsRead" : 0 + }, + "outputMetrics" : { + "bytesWritten" : 0, + "recordsWritten" : 0 + }, + "shuffleReadMetrics" : { + "remoteBlocksFetched" : 0, + "localBlocksFetched" : 0, + "fetchWaitTime" : 0, + "remoteBytesRead" : 0, + "remoteBytesReadToDisk" : 0, + "localBytesRead" : 0, + "recordsRead" : 0 + }, + "shuffleWriteMetrics" : { + "bytesWritten" : 0, + "writeTime" : 0, + "recordsWritten" : 0 + } + }, + "executorLogs" : { + "stdout" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout", + "stderr" : "http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr" + }, + "schedulerDelay" : 71, + "gettingResultTime" : 0 + } + }, + "executorSummary" : { + "0" : { + "taskTime" : 30596, + "failedTasks" : 0, + "succeededTasks" : 16, + "killedTasks" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 0, + "shuffleWriteRecords" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : false, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 0, + "JVMOffHeapMemory" : 0, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 0, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 0, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 0, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 0, + "MinorGCTime" : 0, + "MajorGCCount" : 0, + "MajorGCTime" : 0 + }, + "isExcludedForStage" : false + }, + "driver" : { + "taskTime" : 0, + "failedTasks" : 0, + "succeededTasks" : 0, + "killedTasks" : 0, + "inputBytes" : 0, + "inputRecords" : 0, + "outputBytes" : 0, + "outputRecords" : 0, + "shuffleRead" : 0, + "shuffleReadRecords" : 0, + "shuffleWrite" : 0, + "shuffleWriteRecords" : 0, + "memoryBytesSpilled" : 0, + "diskBytesSpilled" : 0, + "isBlacklistedForStage" : false, + "peakMemoryMetrics" : { + "JVMHeapMemory" : 213367864, + "JVMOffHeapMemory" : 189011656, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 2133349, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 2133349, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 282024, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 13, + "MinorGCTime" : 115, + "MajorGCCount" : 4, + "MajorGCTime" : 339 + }, + "isExcludedForStage" : false + } + }, + "killedTasksSummary" : { }, + "resourceProfileId" : 0, + "peakExecutorMetrics" : { + "JVMHeapMemory" : 213367864, + "JVMOffHeapMemory" : 189011656, + "OnHeapExecutionMemory" : 0, + "OffHeapExecutionMemory" : 0, + "OnHeapStorageMemory" : 2133349, + "OffHeapStorageMemory" : 0, + "OnHeapUnifiedMemory" : 2133349, + "OffHeapUnifiedMemory" : 0, + "DirectPoolMemory" : 282024, + "MappedPoolMemory" : 0, + "ProcessTreeJVMVMemory" : 0, + "ProcessTreeJVMRSSMemory" : 0, + "ProcessTreePythonVMemory" : 0, + "ProcessTreePythonRSSMemory" : 0, + "ProcessTreeOtherVMemory" : 0, + "ProcessTreeOtherRSSMemory" : 0, + "MinorGCCount" : 13, + "MinorGCTime" : 115, + "MajorGCCount" : 4, + "MajorGCTime" : 339 + }, + "taskMetricsDistributions" : { + "quantiles" : [ 0.0, 0.25, 0.5, 0.75, 1.0 ], + "duration" : [ 1835.0, 1905.0, 1916.0, 1925.0, 1960.0 ], + "executorDeserializeTime" : [ 213.0, 225.0, 254.0, 263.0, 271.0 ], + "executorDeserializeCpuTime" : [ 4.7496E7, 5.4222E7, 5.8152E7, 6.438E7, 1.12849E8 ], + "executorRunTime" : [ 1498.0, 1596.0, 1598.0, 1618.0, 1624.0 ], + "executorCpuTime" : [ 4.1411E8, 4.96683E8, 5.0301E8, 5.10597E8, 1.324251E9 ], + "resultSize" : [ 2115.0, 2115.0, 2115.0, 2115.0, 2158.0 ], + "jvmGcTime" : [ 52.0, 62.0, 62.0, 66.0, 66.0 ], + "resultSerializationTime" : [ 0.0, 0.0, 0.0, 0.0, 11.0 ], + "gettingResultTime" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "schedulerDelay" : [ 62.0, 64.0, 70.0, 71.0, 79.0 ], + "peakExecutionMemory" : [ 24040.0, 24040.0, 24040.0, 24040.0, 24040.0 ], + "memoryBytesSpilled" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "diskBytesSpilled" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "inputMetrics" : { + "bytesRead" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "recordsRead" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ] + }, + "outputMetrics" : { + "bytesWritten" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "recordsWritten" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ] + }, + "shuffleReadMetrics" : { + "readBytes" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "readRecords" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "remoteBlocksFetched" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "localBlocksFetched" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "fetchWaitTime" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "remoteBytesRead" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "remoteBytesReadToDisk" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "totalBlocksFetched" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ] + }, + "shuffleWriteMetrics" : { + "writeBytes" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "writeRecords" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "writeTime" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ] + } + }, + "executorMetricsDistributions" : { + "quantiles" : [ 0.0, 0.25, 0.5, 0.75, 1.0 ], + "taskTime" : [ 0.0, 0.0, 30596.0, 30596.0, 30596.0 ], + "failedTasks" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "succeededTasks" : [ 0.0, 0.0, 16.0, 16.0, 16.0 ], + "killedTasks" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "inputBytes" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "inputRecords" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "outputBytes" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "outputRecords" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "shuffleRead" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "shuffleReadRecords" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "shuffleWrite" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "shuffleWriteRecords" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "memoryBytesSpilled" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "diskBytesSpilled" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "peakMemoryMetrics" : { + "JVMHeapMemory" : [ 0.0, 0.0, 2.13367864E8, 2.13367864E8, 2.13367864E8 ], + "JVMOffHeapMemory" : [ 0.0, 0.0, 1.89011656E8, 1.89011656E8, 1.89011656E8 ], + "OnHeapExecutionMemory" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "OffHeapExecutionMemory" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "OnHeapStorageMemory" : [ 0.0, 0.0, 2133349.0, 2133349.0, 2133349.0 ], + "OffHeapStorageMemory" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "OnHeapUnifiedMemory" : [ 0.0, 0.0, 2133349.0, 2133349.0, 2133349.0 ], + "OffHeapUnifiedMemory" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "DirectPoolMemory" : [ 0.0, 0.0, 282024.0, 282024.0, 282024.0 ], + "MappedPoolMemory" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "ProcessTreeJVMVMemory" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "ProcessTreeJVMRSSMemory" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "ProcessTreePythonVMemory" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "ProcessTreePythonRSSMemory" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "ProcessTreeOtherVMemory" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "ProcessTreeOtherRSSMemory" : [ 0.0, 0.0, 0.0, 0.0, 0.0 ], + "MinorGCCount" : [ 0.0, 0.0, 13.0, 13.0, 13.0 ], + "MinorGCTime" : [ 0.0, 0.0, 115.0, 115.0, 115.0 ], + "MajorGCCount" : [ 0.0, 0.0, 4.0, 4.0, 4.0 ], + "MajorGCTime" : [ 0.0, 0.0, 339.0, 339.0, 339.0 ] + } + } +} diff --git a/core/src/test/resources/hive-site.xml b/core/src/test/resources/hive-site.xml new file mode 100644 index 0000000000000..d7117c3f20248 --- /dev/null +++ b/core/src/test/resources/hive-site.xml @@ -0,0 +1,34 @@ + + + + + hive.in.test + true + Internal marker for test. + + + hadoop.tmp.dir + /tmp/hive_one + default is /tmp/hadoop-${user.name} and will be overridden + + + + io.file.buffer.size + 201811 + + diff --git a/core/src/test/resources/spark-events/app-20200706201101-0003 b/core/src/test/resources/spark-events/app-20200706201101-0003 new file mode 100644 index 0000000000000..b2923ca0f001f --- /dev/null +++ b/core/src/test/resources/spark-events/app-20200706201101-0003 @@ -0,0 +1,124 @@ +{"Event":"SparkListenerLogStart","Spark Version":"3.1.0-SNAPSHOT"} +{"Event":"SparkListenerResourceProfileAdded","Resource Profile Id":0,"Executor Resource Requests":{"cores":{"Resource Name":"cores","Amount":1,"Discovery Script":"","Vendor":""},"memory":{"Resource Name":"memory","Amount":1024,"Discovery Script":"","Vendor":""}},"Task Resource Requests":{"cpus":{"Resource Name":"cpus","Amount":1.0}}} +{"Event":"SparkListenerBlockManagerAdded","Block Manager ID":{"Executor ID":"driver","Host":"localhost","Port":64415},"Maximum Memory":384093388,"Timestamp":1594091461118,"Maximum Onheap Memory":384093388,"Maximum Offheap Memory":0} +{"Event":"SparkListenerEnvironmentUpdate","JVM Information":{"Java Home":"/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre","Java Version":"1.8.0_231 (Oracle Corporation)","Scala Version":"version 2.12.10"},"Spark Properties":{"spark.driver.host":"localhost","spark.eventLog.enabled":"true","spark.driver.port":"64413","spark.repl.class.uri":"spark://localhost:64413/classes","spark.jars":"","spark.repl.class.outputDir":"/private/var/folders/p_/5j1mtw1x0579b34vy4ztcbs40000gn/T/spark-0c713088-21d7-4b35-9b52-7a4dd4d15ae1/repl-361cef81-42cd-4875-a8a6-ce9dfe55682a","spark.app.name":"Spark shell","spark.scheduler.mode":"FIFO","spark.submit.pyFiles":"","spark.ui.showConsoleProgress":"true","spark.executor.id":"driver","spark.eventLog.logStageExecutorMetrics":"true","spark.submit.deployMode":"client","spark.master":"*********(redacted)","spark.home":"*********(redacted)","spark.sql.catalogImplementation":"in-memory","spark.app.id":"app-20200706201101-0003"},"Hadoop Properties":{"hadoop.service.shutdown.timeout":"30s","yarn.resourcemanager.amlauncher.thread-count":"50","yarn.sharedcache.enabled":"false","fs.s3a.connection.maximum":"15","yarn.nodemanager.numa-awareness.numactl.cmd":"/usr/bin/numactl","fs.s3a.impl":"org.apache.hadoop.fs.s3a.S3AFileSystem","yarn.app.mapreduce.am.scheduler.heartbeat.interval-ms":"1000","yarn.timeline-service.timeline-client.number-of-async-entities-to-merge":"10","hadoop.security.kms.client.timeout":"60","hadoop.http.authentication.kerberos.principal":"HTTP/_HOST@LOCALHOST","mapreduce.jobhistory.loadedjob.tasks.max":"-1","mapreduce.framework.name":"local","yarn.sharedcache.uploader.server.thread-count":"50","yarn.nodemanager.linux-container-executor.nonsecure-mode.user-pattern":"^[_.A-Za-z0-9][-@_.A-Za-z0-9]{0,255}?[$]?$","tfile.fs.output.buffer.size":"262144","yarn.app.mapreduce.am.job.task.listener.thread-count":"30","hadoop.security.groups.cache.background.reload.threads":"3","yarn.resourcemanager.webapp.cross-origin.enabled":"false","fs.AbstractFileSystem.ftp.impl":"org.apache.hadoop.fs.ftp.FtpFs","hadoop.registry.secure":"false","hadoop.shell.safely.delete.limit.num.files":"100","dfs.bytes-per-checksum":"512","mapreduce.job.acl-view-job":" ","fs.s3a.s3guard.ddb.background.sleep":"25ms","fs.s3a.retry.limit":"${fs.s3a.attempts.maximum}","mapreduce.jobhistory.loadedjobs.cache.size":"5","fs.s3a.s3guard.ddb.table.create":"false","yarn.nodemanager.amrmproxy.enabled":"false","yarn.timeline-service.entity-group-fs-store.with-user-dir":"false","mapreduce.input.fileinputformat.split.minsize":"0","yarn.resourcemanager.container.liveness-monitor.interval-ms":"600000","yarn.resourcemanager.client.thread-count":"50","io.seqfile.compress.blocksize":"1000000","yarn.sharedcache.checksum.algo.impl":"org.apache.hadoop.yarn.sharedcache.ChecksumSHA256Impl","yarn.nodemanager.amrmproxy.interceptor-class.pipeline":"org.apache.hadoop.yarn.server.nodemanager.amrmproxy.DefaultRequestInterceptor","yarn.timeline-service.entity-group-fs-store.leveldb-cache-read-cache-size":"10485760","mapreduce.reduce.shuffle.fetch.retry.interval-ms":"1000","mapreduce.task.profile.maps":"0-2","yarn.scheduler.include-port-in-node-name":"false","yarn.nodemanager.admin-env":"MALLOC_ARENA_MAX=$MALLOC_ARENA_MAX","yarn.resourcemanager.node-removal-untracked.timeout-ms":"60000","mapreduce.am.max-attempts":"2","hadoop.security.kms.client.failover.sleep.base.millis":"100","mapreduce.jobhistory.webapp.https.address":"0.0.0.0:19890","yarn.node-labels.fs-store.impl.class":"org.apache.hadoop.yarn.nodelabels.FileSystemNodeLabelsStore","yarn.nodemanager.collector-service.address":"${yarn.nodemanager.hostname}:8048","fs.trash.checkpoint.interval":"0","mapreduce.job.map.output.collector.class":"org.apache.hadoop.mapred.MapTask$MapOutputBuffer","yarn.resourcemanager.node-ip-cache.expiry-interval-secs":"-1","hadoop.http.authentication.signature.secret.file":"*********(redacted)","hadoop.jetty.logs.serve.aliases":"true","yarn.resourcemanager.placement-constraints.handler":"disabled","yarn.timeline-service.handler-thread-count":"10","yarn.resourcemanager.max-completed-applications":"1000","yarn.resourcemanager.system-metrics-publisher.enabled":"false","yarn.resourcemanager.placement-constraints.algorithm.class":"org.apache.hadoop.yarn.server.resourcemanager.scheduler.constraint.algorithm.DefaultPlacementAlgorithm","yarn.sharedcache.webapp.address":"0.0.0.0:8788","yarn.resourcemanager.delegation.token.renew-interval":"*********(redacted)","yarn.sharedcache.nm.uploader.replication.factor":"10","hadoop.security.groups.negative-cache.secs":"30","yarn.app.mapreduce.task.container.log.backups":"0","mapreduce.reduce.skip.proc-count.auto-incr":"true","hadoop.security.group.mapping.ldap.posix.attr.gid.name":"gidNumber","ipc.client.fallback-to-simple-auth-allowed":"false","yarn.nodemanager.resource.memory.enforced":"true","yarn.client.failover-proxy-provider":"org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider","yarn.timeline-service.http-authentication.simple.anonymous.allowed":"true","ha.health-monitor.check-interval.ms":"1000","yarn.acl.reservation-enable":"false","yarn.resourcemanager.store.class":"org.apache.hadoop.yarn.server.resourcemanager.recovery.FileSystemRMStateStore","yarn.app.mapreduce.am.hard-kill-timeout-ms":"10000","fs.s3a.etag.checksum.enabled":"false","yarn.nodemanager.container-metrics.enable":"true","yarn.timeline-service.client.fd-clean-interval-secs":"60","yarn.resourcemanager.nodemanagers.heartbeat-interval-ms":"1000","hadoop.common.configuration.version":"3.0.0","fs.s3a.s3guard.ddb.table.capacity.read":"500","yarn.nodemanager.remote-app-log-dir-suffix":"logs","yarn.nodemanager.windows-container.cpu-limit.enabled":"false","yarn.nodemanager.runtime.linux.docker.privileged-containers.allowed":"false","file.blocksize":"67108864","hadoop.registry.zk.retry.ceiling.ms":"60000","yarn.scheduler.configuration.leveldb-store.path":"${hadoop.tmp.dir}/yarn/system/confstore","yarn.sharedcache.store.in-memory.initial-delay-mins":"10","mapreduce.jobhistory.principal":"jhs/_HOST@REALM.TLD","mapreduce.map.skip.proc-count.auto-incr":"true","fs.s3a.committer.name":"file","mapreduce.task.profile.reduces":"0-2","hadoop.zk.num-retries":"1000","yarn.webapp.xfs-filter.enabled":"true","seq.io.sort.mb":"100","yarn.scheduler.configuration.max.version":"100","yarn.timeline-service.webapp.https.address":"${yarn.timeline-service.hostname}:8190","yarn.resourcemanager.scheduler.address":"${yarn.resourcemanager.hostname}:8030","yarn.node-labels.enabled":"false","yarn.resourcemanager.webapp.ui-actions.enabled":"true","mapreduce.task.timeout":"600000","yarn.sharedcache.client-server.thread-count":"50","hadoop.security.groups.shell.command.timeout":"0s","hadoop.security.crypto.cipher.suite":"AES/CTR/NoPadding","yarn.nodemanager.elastic-memory-control.oom-handler":"org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.DefaultOOMHandler","yarn.resourcemanager.connect.max-wait.ms":"900000","fs.defaultFS":"file:///","yarn.minicluster.use-rpc":"false","fs.har.impl.disable.cache":"true","yarn.webapp.ui2.enable":"false","io.compression.codec.bzip2.library":"system-native","yarn.nodemanager.distributed-scheduling.enabled":"false","mapreduce.shuffle.connection-keep-alive.timeout":"5","yarn.resourcemanager.webapp.https.address":"${yarn.resourcemanager.hostname}:8090","mapreduce.jobhistory.address":"0.0.0.0:10020","yarn.resourcemanager.nm-tokens.master-key-rolling-interval-secs":"*********(redacted)","yarn.is.minicluster":"false","yarn.nodemanager.address":"${yarn.nodemanager.hostname}:0","fs.abfss.impl":"org.apache.hadoop.fs.azurebfs.SecureAzureBlobFileSystem","fs.AbstractFileSystem.s3a.impl":"org.apache.hadoop.fs.s3a.S3A","mapreduce.task.combine.progress.records":"10000","yarn.resourcemanager.epoch.range":"0","yarn.resourcemanager.am.max-attempts":"2","yarn.nodemanager.linux-container-executor.cgroups.hierarchy":"/hadoop-yarn","fs.AbstractFileSystem.wasbs.impl":"org.apache.hadoop.fs.azure.Wasbs","yarn.timeline-service.entity-group-fs-store.cache-store-class":"org.apache.hadoop.yarn.server.timeline.MemoryTimelineStore","fs.ftp.transfer.mode":"BLOCK_TRANSFER_MODE","ipc.server.log.slow.rpc":"false","yarn.resourcemanager.node-labels.provider.fetch-interval-ms":"1800000","yarn.router.webapp.https.address":"0.0.0.0:8091","yarn.nodemanager.webapp.cross-origin.enabled":"false","fs.wasb.impl":"org.apache.hadoop.fs.azure.NativeAzureFileSystem","yarn.resourcemanager.auto-update.containers":"false","yarn.app.mapreduce.am.job.committer.cancel-timeout":"60000","yarn.scheduler.configuration.zk-store.parent-path":"/confstore","yarn.nodemanager.default-container-executor.log-dirs.permissions":"710","yarn.app.attempt.diagnostics.limit.kc":"64","ftp.bytes-per-checksum":"512","yarn.nodemanager.resource.memory-mb":"-1","fs.AbstractFileSystem.abfs.impl":"org.apache.hadoop.fs.azurebfs.Abfs","yarn.timeline-service.writer.flush-interval-seconds":"60","fs.s3a.fast.upload.active.blocks":"4","hadoop.security.credential.clear-text-fallback":"true","yarn.nodemanager.collector-service.thread-count":"5","fs.azure.secure.mode":"false","mapreduce.jobhistory.joblist.cache.size":"20000","fs.ftp.host":"0.0.0.0","yarn.resourcemanager.fs.state-store.num-retries":"0","yarn.resourcemanager.nodemanager-connect-retries":"10","yarn.nodemanager.log-aggregation.num-log-files-per-app":"30","hadoop.security.kms.client.encrypted.key.cache.low-watermark":"0.3f","fs.s3a.committer.magic.enabled":"false","yarn.timeline-service.client.max-retries":"30","dfs.ha.fencing.ssh.connect-timeout":"30000","yarn.log-aggregation-enable":"false","yarn.system-metrics-publisher.enabled":"false","mapreduce.reduce.markreset.buffer.percent":"0.0","fs.AbstractFileSystem.viewfs.impl":"org.apache.hadoop.fs.viewfs.ViewFs","mapreduce.task.io.sort.factor":"10","yarn.nodemanager.amrmproxy.client.thread-count":"25","ha.failover-controller.new-active.rpc-timeout.ms":"60000","yarn.nodemanager.container-localizer.java.opts":"-Xmx256m","mapreduce.jobhistory.datestring.cache.size":"200000","mapreduce.job.acl-modify-job":" ","yarn.nodemanager.windows-container.memory-limit.enabled":"false","yarn.timeline-service.webapp.address":"${yarn.timeline-service.hostname}:8188","yarn.app.mapreduce.am.job.committer.commit-window":"10000","yarn.nodemanager.container-manager.thread-count":"20","yarn.minicluster.fixed.ports":"false","hadoop.tags.system":"YARN,HDFS,NAMENODE,DATANODE,REQUIRED,SECURITY,KERBEROS,PERFORMANCE,CLIENT\n ,SERVER,DEBUG,DEPRECATED,COMMON,OPTIONAL","yarn.cluster.max-application-priority":"0","yarn.timeline-service.ttl-enable":"true","mapreduce.jobhistory.recovery.store.fs.uri":"${hadoop.tmp.dir}/mapred/history/recoverystore","hadoop.caller.context.signature.max.size":"40","yarn.client.load.resource-types.from-server":"false","ha.zookeeper.session-timeout.ms":"10000","tfile.io.chunk.size":"1048576","fs.s3a.s3guard.ddb.table.capacity.write":"100","mapreduce.job.speculative.slowtaskthreshold":"1.0","io.serializations":"org.apache.hadoop.io.serializer.WritableSerialization, org.apache.hadoop.io.serializer.avro.AvroSpecificSerialization, org.apache.hadoop.io.serializer.avro.AvroReflectSerialization","hadoop.security.kms.client.failover.sleep.max.millis":"2000","hadoop.security.group.mapping.ldap.directory.search.timeout":"10000","yarn.scheduler.configuration.store.max-logs":"1000","yarn.nodemanager.node-attributes.provider.fetch-interval-ms":"600000","fs.swift.impl":"org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem","yarn.nodemanager.local-cache.max-files-per-directory":"8192","hadoop.http.cross-origin.enabled":"false","hadoop.zk.acl":"world:anyone:rwcda","mapreduce.map.sort.spill.percent":"0.80","yarn.timeline-service.entity-group-fs-store.scan-interval-seconds":"60","yarn.node-attribute.fs-store.impl.class":"org.apache.hadoop.yarn.server.resourcemanager.nodelabels.FileSystemNodeAttributeStore","fs.s3a.retry.interval":"500ms","yarn.timeline-service.client.best-effort":"false","yarn.resourcemanager.webapp.delegation-token-auth-filter.enabled":"*********(redacted)","hadoop.security.group.mapping.ldap.posix.attr.uid.name":"uidNumber","fs.AbstractFileSystem.swebhdfs.impl":"org.apache.hadoop.fs.SWebHdfs","yarn.nodemanager.elastic-memory-control.timeout-sec":"5","mapreduce.ifile.readahead":"true","yarn.timeline-service.leveldb-timeline-store.ttl-interval-ms":"300000","yarn.timeline-service.reader.webapp.address":"${yarn.timeline-service.webapp.address}","yarn.resourcemanager.placement-constraints.algorithm.pool-size":"1","yarn.timeline-service.hbase.coprocessor.jar.hdfs.location":"/hbase/coprocessor/hadoop-yarn-server-timelineservice.jar","hadoop.security.kms.client.encrypted.key.cache.num.refill.threads":"2","yarn.resourcemanager.scheduler.class":"org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler","yarn.app.mapreduce.am.command-opts":"-Xmx1024m","mapreduce.cluster.local.dir":"${hadoop.tmp.dir}/mapred/local","io.mapfile.bloom.error.rate":"0.005","fs.client.resolve.topology.enabled":"false","yarn.nodemanager.runtime.linux.allowed-runtimes":"default","yarn.sharedcache.store.class":"org.apache.hadoop.yarn.server.sharedcachemanager.store.InMemorySCMStore","ha.failover-controller.graceful-fence.rpc-timeout.ms":"5000","ftp.replication":"3","hadoop.security.uid.cache.secs":"14400","mapreduce.job.maxtaskfailures.per.tracker":"3","fs.s3a.metadatastore.impl":"org.apache.hadoop.fs.s3a.s3guard.NullMetadataStore","io.skip.checksum.errors":"false","yarn.app.mapreduce.client-am.ipc.max-retries-on-timeouts":"3","yarn.timeline-service.webapp.xfs-filter.xframe-options":"SAMEORIGIN","fs.s3a.connection.timeout":"200000","mapreduce.job.max.split.locations":"15","yarn.resourcemanager.nm-container-queuing.max-queue-length":"15","hadoop.registry.zk.session.timeout.ms":"60000","yarn.federation.cache-ttl.secs":"300","mapreduce.jvm.system-properties-to-log":"os.name,os.version,java.home,java.runtime.version,java.vendor,java.version,java.vm.name,java.class.path,java.io.tmpdir,user.dir,user.name","yarn.resourcemanager.opportunistic-container-allocation.nodes-used":"10","yarn.timeline-service.entity-group-fs-store.active-dir":"/tmp/entity-file-history/active","mapreduce.shuffle.transfer.buffer.size":"131072","yarn.timeline-service.client.retry-interval-ms":"1000","yarn.http.policy":"HTTP_ONLY","fs.s3a.socket.send.buffer":"8192","fs.AbstractFileSystem.abfss.impl":"org.apache.hadoop.fs.azurebfs.Abfss","yarn.sharedcache.uploader.server.address":"0.0.0.0:8046","yarn.resourcemanager.delegation-token.max-conf-size-bytes":"*********(redacted)","hadoop.http.authentication.token.validity":"*********(redacted)","mapreduce.shuffle.max.connections":"0","yarn.minicluster.yarn.nodemanager.resource.memory-mb":"4096","mapreduce.job.emit-timeline-data":"false","yarn.nodemanager.resource.system-reserved-memory-mb":"-1","hadoop.kerberos.min.seconds.before.relogin":"60","mapreduce.jobhistory.move.thread-count":"3","yarn.resourcemanager.admin.client.thread-count":"1","yarn.dispatcher.drain-events.timeout":"300000","fs.s3a.buffer.dir":"${hadoop.tmp.dir}/s3a","hadoop.ssl.enabled.protocols":"TLSv1,SSLv2Hello,TLSv1.1,TLSv1.2","mapreduce.jobhistory.admin.address":"0.0.0.0:10033","yarn.log-aggregation-status.time-out.ms":"600000","fs.s3a.assumed.role.sts.endpoint.region":"us-west-1","mapreduce.shuffle.port":"13562","yarn.resourcemanager.max-log-aggregation-diagnostics-in-memory":"10","yarn.nodemanager.health-checker.interval-ms":"600000","yarn.router.clientrm.interceptor-class.pipeline":"org.apache.hadoop.yarn.server.router.clientrm.DefaultClientRequestInterceptor","yarn.resourcemanager.zk-appid-node.split-index":"0","ftp.blocksize":"67108864","yarn.nodemanager.runtime.linux.sandbox-mode.local-dirs.permissions":"read","yarn.router.rmadmin.interceptor-class.pipeline":"org.apache.hadoop.yarn.server.router.rmadmin.DefaultRMAdminRequestInterceptor","yarn.nodemanager.log-container-debug-info.enabled":"true","yarn.client.max-cached-nodemanagers-proxies":"0","yarn.nodemanager.linux-container-executor.cgroups.delete-delay-ms":"20","yarn.nodemanager.delete.debug-delay-sec":"0","yarn.nodemanager.pmem-check-enabled":"true","yarn.nodemanager.disk-health-checker.max-disk-utilization-per-disk-percentage":"90.0","mapreduce.app-submission.cross-platform":"false","yarn.resourcemanager.work-preserving-recovery.scheduling-wait-ms":"10000","yarn.nodemanager.container-retry-minimum-interval-ms":"1000","hadoop.security.groups.cache.secs":"300","yarn.federation.enabled":"false","fs.azure.local.sas.key.mode":"false","ipc.maximum.data.length":"67108864","mapreduce.shuffle.max.threads":"0","yarn.router.pipeline.cache-max-size":"25","yarn.resourcemanager.nm-container-queuing.load-comparator":"QUEUE_LENGTH","hadoop.security.authorization":"false","mapreduce.job.complete.cancel.delegation.tokens":"*********(redacted)","fs.s3a.paging.maximum":"5000","nfs.exports.allowed.hosts":"* rw","yarn.nodemanager.amrmproxy.ha.enable":"false","mapreduce.jobhistory.http.policy":"HTTP_ONLY","yarn.sharedcache.store.in-memory.check-period-mins":"720","hadoop.security.group.mapping.ldap.ssl":"false","yarn.client.application-client-protocol.poll-interval-ms":"200","yarn.scheduler.configuration.leveldb-store.compaction-interval-secs":"86400","yarn.timeline-service.writer.class":"org.apache.hadoop.yarn.server.timelineservice.storage.HBaseTimelineWriterImpl","ha.zookeeper.parent-znode":"/hadoop-ha","yarn.nodemanager.log-aggregation.policy.class":"org.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation.AllContainerLogAggregationPolicy","mapreduce.reduce.shuffle.merge.percent":"0.66","hadoop.security.group.mapping.ldap.search.filter.group":"(objectClass=group)","yarn.resourcemanager.placement-constraints.scheduler.pool-size":"1","yarn.nodemanager.resourcemanager.minimum.version":"NONE","mapreduce.job.speculative.speculative-cap-running-tasks":"0.1","yarn.admin.acl":"*","yarn.nodemanager.recovery.supervised":"false","yarn.sharedcache.admin.thread-count":"1","yarn.resourcemanager.ha.automatic-failover.enabled":"true","mapreduce.reduce.skip.maxgroups":"0","mapreduce.reduce.shuffle.connect.timeout":"180000","yarn.resourcemanager.address":"${yarn.resourcemanager.hostname}:8032","ipc.client.ping":"true","mapreduce.task.local-fs.write-limit.bytes":"-1","fs.adl.oauth2.access.token.provider.type":"*********(redacted)","mapreduce.shuffle.ssl.file.buffer.size":"65536","yarn.resourcemanager.ha.automatic-failover.embedded":"true","yarn.nodemanager.resource-plugins.gpu.docker-plugin":"nvidia-docker-v1","hadoop.ssl.enabled":"false","fs.s3a.multipart.purge":"false","yarn.scheduler.configuration.store.class":"file","yarn.resourcemanager.nm-container-queuing.queue-limit-stdev":"1.0f","mapreduce.job.end-notification.max.attempts":"5","mapreduce.output.fileoutputformat.compress.codec":"org.apache.hadoop.io.compress.DefaultCodec","yarn.nodemanager.container-monitor.procfs-tree.smaps-based-rss.enabled":"false","ipc.client.bind.wildcard.addr":"false","yarn.resourcemanager.webapp.rest-csrf.enabled":"false","ha.health-monitor.connect-retry-interval.ms":"1000","yarn.nodemanager.keytab":"/etc/krb5.keytab","mapreduce.jobhistory.keytab":"/etc/security/keytab/jhs.service.keytab","fs.s3a.threads.max":"10","mapreduce.reduce.shuffle.input.buffer.percent":"0.70","yarn.nodemanager.runtime.linux.docker.allowed-container-networks":"host,none,bridge","yarn.nodemanager.node-labels.resync-interval-ms":"120000","hadoop.tmp.dir":"/tmp/hadoop-${user.name}","mapreduce.job.maps":"2","mapreduce.jobhistory.webapp.rest-csrf.custom-header":"X-XSRF-Header","mapreduce.job.end-notification.max.retry.interval":"5000","yarn.log-aggregation.retain-check-interval-seconds":"-1","yarn.resourcemanager.resource-tracker.client.thread-count":"50","yarn.rm.system-metrics-publisher.emit-container-events":"false","yarn.timeline-service.leveldb-timeline-store.start-time-read-cache-size":"10000","yarn.resourcemanager.ha.automatic-failover.zk-base-path":"/yarn-leader-election","io.seqfile.local.dir":"${hadoop.tmp.dir}/io/local","fs.s3a.s3guard.ddb.throttle.retry.interval":"100ms","fs.AbstractFileSystem.wasb.impl":"org.apache.hadoop.fs.azure.Wasb","mapreduce.client.submit.file.replication":"10","mapreduce.jobhistory.minicluster.fixed.ports":"false","fs.s3a.multipart.threshold":"2147483647","yarn.resourcemanager.webapp.xfs-filter.xframe-options":"SAMEORIGIN","mapreduce.jobhistory.done-dir":"${yarn.app.mapreduce.am.staging-dir}/history/done","ipc.client.idlethreshold":"4000","yarn.nodemanager.linux-container-executor.cgroups.strict-resource-usage":"false","mapreduce.reduce.input.buffer.percent":"0.0","yarn.nodemanager.runtime.linux.docker.userremapping-gid-threshold":"1","yarn.nodemanager.webapp.rest-csrf.enabled":"false","fs.ftp.host.port":"21","ipc.ping.interval":"60000","yarn.resourcemanager.history-writer.multi-threaded-dispatcher.pool-size":"10","yarn.resourcemanager.admin.address":"${yarn.resourcemanager.hostname}:8033","file.client-write-packet-size":"65536","ipc.client.kill.max":"10","mapreduce.reduce.speculative":"true","hadoop.security.key.default.bitlength":"128","mapreduce.job.reducer.unconditional-preempt.delay.sec":"300","yarn.nodemanager.disk-health-checker.interval-ms":"120000","yarn.nodemanager.log.deletion-threads-count":"4","yarn.webapp.filter-entity-list-by-user":"false","ipc.client.connection.maxidletime":"10000","mapreduce.task.io.sort.mb":"100","yarn.nodemanager.localizer.client.thread-count":"5","io.erasurecode.codec.rs.rawcoders":"rs_native,rs_java","io.erasurecode.codec.rs-legacy.rawcoders":"rs-legacy_java","yarn.sharedcache.admin.address":"0.0.0.0:8047","yarn.resourcemanager.placement-constraints.algorithm.iterator":"SERIAL","yarn.nodemanager.localizer.cache.cleanup.interval-ms":"600000","hadoop.security.crypto.codec.classes.aes.ctr.nopadding":"org.apache.hadoop.crypto.OpensslAesCtrCryptoCodec, org.apache.hadoop.crypto.JceAesCtrCryptoCodec","mapreduce.job.cache.limit.max-resources-mb":"0","fs.s3a.connection.ssl.enabled":"true","yarn.nodemanager.process-kill-wait.ms":"5000","mapreduce.job.hdfs-servers":"${fs.defaultFS}","hadoop.workaround.non.threadsafe.getpwuid":"true","fs.df.interval":"60000","fs.s3a.multiobjectdelete.enable":"true","yarn.sharedcache.cleaner.resource-sleep-ms":"0","yarn.nodemanager.disk-health-checker.min-healthy-disks":"0.25","hadoop.shell.missing.defaultFs.warning":"false","io.file.buffer.size":"65536","hadoop.security.group.mapping.ldap.search.attr.member":"member","hadoop.security.random.device.file.path":"/dev/urandom","hadoop.security.sensitive-config-keys":"*********(redacted)","fs.s3a.s3guard.ddb.max.retries":"9","hadoop.rpc.socket.factory.class.default":"org.apache.hadoop.net.StandardSocketFactory","yarn.intermediate-data-encryption.enable":"false","yarn.resourcemanager.connect.retry-interval.ms":"30000","yarn.nodemanager.container.stderr.pattern":"{*stderr*,*STDERR*}","yarn.scheduler.minimum-allocation-mb":"1024","yarn.app.mapreduce.am.staging-dir":"/tmp/hadoop-yarn/staging","mapreduce.reduce.shuffle.read.timeout":"180000","hadoop.http.cross-origin.max-age":"1800","io.erasurecode.codec.xor.rawcoders":"xor_native,xor_java","fs.s3a.connection.establish.timeout":"5000","mapreduce.job.running.map.limit":"0","yarn.minicluster.control-resource-monitoring":"false","hadoop.ssl.require.client.cert":"false","hadoop.kerberos.kinit.command":"kinit","yarn.federation.state-store.class":"org.apache.hadoop.yarn.server.federation.store.impl.MemoryFederationStateStore","mapreduce.reduce.log.level":"INFO","hadoop.security.dns.log-slow-lookups.threshold.ms":"1000","mapreduce.job.ubertask.enable":"false","adl.http.timeout":"-1","yarn.resourcemanager.placement-constraints.retry-attempts":"3","hadoop.caller.context.enabled":"false","yarn.nodemanager.vmem-pmem-ratio":"2.1","hadoop.rpc.protection":"authentication","ha.health-monitor.rpc-timeout.ms":"45000","yarn.nodemanager.remote-app-log-dir":"/tmp/logs","hadoop.zk.timeout-ms":"10000","fs.s3a.s3guard.cli.prune.age":"86400000","yarn.nodemanager.resource.pcores-vcores-multiplier":"1.0","yarn.nodemanager.runtime.linux.sandbox-mode":"disabled","yarn.app.mapreduce.am.containerlauncher.threadpool-initial-size":"10","fs.s3a.committer.threads":"8","hadoop.zk.retry-interval-ms":"1000","hadoop.security.crypto.buffer.size":"8192","yarn.nodemanager.node-labels.provider.fetch-interval-ms":"600000","mapreduce.jobhistory.recovery.store.leveldb.path":"${hadoop.tmp.dir}/mapred/history/recoverystore","yarn.client.failover-retries-on-socket-timeouts":"0","yarn.nodemanager.resource.memory.enabled":"false","fs.azure.authorization.caching.enable":"true","hadoop.security.instrumentation.requires.admin":"false","yarn.nodemanager.delete.thread-count":"4","mapreduce.job.finish-when-all-reducers-done":"true","hadoop.registry.jaas.context":"Client","yarn.timeline-service.leveldb-timeline-store.path":"${hadoop.tmp.dir}/yarn/timeline","io.map.index.interval":"128","yarn.resourcemanager.nm-container-queuing.max-queue-wait-time-ms":"100","fs.abfs.impl":"org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem","mapreduce.job.counters.max":"120","mapreduce.jobhistory.webapp.rest-csrf.enabled":"false","yarn.timeline-service.store-class":"org.apache.hadoop.yarn.server.timeline.LeveldbTimelineStore","mapreduce.jobhistory.move.interval-ms":"180000","yarn.nodemanager.localizer.fetch.thread-count":"4","yarn.resourcemanager.scheduler.client.thread-count":"50","hadoop.ssl.hostname.verifier":"DEFAULT","yarn.timeline-service.leveldb-state-store.path":"${hadoop.tmp.dir}/yarn/timeline","mapreduce.job.classloader":"false","mapreduce.task.profile.map.params":"${mapreduce.task.profile.params}","ipc.client.connect.timeout":"20000","hadoop.security.auth_to_local.mechanism":"hadoop","yarn.timeline-service.app-collector.linger-period.ms":"60000","yarn.nm.liveness-monitor.expiry-interval-ms":"600000","yarn.resourcemanager.reservation-system.planfollower.time-step":"1000","yarn.nodemanager.runtime.linux.docker.enable-userremapping.allowed":"true","yarn.webapp.api-service.enable":"false","yarn.nodemanager.recovery.enabled":"false","mapreduce.job.end-notification.retry.interval":"1000","fs.du.interval":"600000","fs.ftp.impl":"org.apache.hadoop.fs.ftp.FTPFileSystem","yarn.nodemanager.container.stderr.tail.bytes":"4096","hadoop.security.group.mapping.ldap.read.timeout.ms":"60000","hadoop.security.groups.cache.warn.after.ms":"5000","file.bytes-per-checksum":"512","mapreduce.outputcommitter.factory.scheme.s3a":"org.apache.hadoop.fs.s3a.commit.S3ACommitterFactory","hadoop.security.groups.cache.background.reload":"false","yarn.nodemanager.container-monitor.enabled":"true","yarn.nodemanager.elastic-memory-control.enabled":"false","net.topology.script.number.args":"100","mapreduce.task.merge.progress.records":"10000","yarn.nodemanager.localizer.address":"${yarn.nodemanager.hostname}:8040","yarn.timeline-service.keytab":"/etc/krb5.keytab","mapreduce.reduce.shuffle.fetch.retry.timeout-ms":"30000","yarn.resourcemanager.rm.container-allocation.expiry-interval-ms":"600000","mapreduce.fileoutputcommitter.algorithm.version":"2","yarn.resourcemanager.work-preserving-recovery.enabled":"true","mapreduce.map.skip.maxrecords":"0","yarn.sharedcache.root-dir":"/sharedcache","fs.s3a.retry.throttle.limit":"${fs.s3a.attempts.maximum}","hadoop.http.authentication.type":"simple","mapreduce.job.cache.limit.max-resources":"0","mapreduce.task.userlog.limit.kb":"0","yarn.resourcemanager.scheduler.monitor.enable":"false","ipc.client.connect.max.retries":"10","hadoop.registry.zk.retry.times":"5","yarn.nodemanager.resource-monitor.interval-ms":"3000","yarn.nodemanager.resource-plugins.gpu.allowed-gpu-devices":"auto","mapreduce.job.sharedcache.mode":"disabled","yarn.nodemanager.webapp.rest-csrf.custom-header":"X-XSRF-Header","mapreduce.shuffle.listen.queue.size":"128","yarn.scheduler.configuration.mutation.acl-policy.class":"org.apache.hadoop.yarn.server.resourcemanager.scheduler.DefaultConfigurationMutationACLPolicy","mapreduce.map.cpu.vcores":"1","yarn.log-aggregation.file-formats":"TFile","yarn.timeline-service.client.fd-retain-secs":"300","hadoop.user.group.static.mapping.overrides":"dr.who=;","fs.azure.sas.expiry.period":"90d","mapreduce.jobhistory.recovery.store.class":"org.apache.hadoop.mapreduce.v2.hs.HistoryServerFileSystemStateStoreService","yarn.resourcemanager.fail-fast":"${yarn.fail-fast}","yarn.resourcemanager.proxy-user-privileges.enabled":"false","yarn.router.webapp.interceptor-class.pipeline":"org.apache.hadoop.yarn.server.router.webapp.DefaultRequestInterceptorREST","yarn.nodemanager.resource.memory.cgroups.soft-limit-percentage":"90.0","mapreduce.job.reducer.preempt.delay.sec":"0","hadoop.util.hash.type":"murmur","yarn.nodemanager.disk-validator":"basic","yarn.app.mapreduce.client.job.max-retries":"3","mapreduce.reduce.shuffle.retry-delay.max.ms":"60000","hadoop.security.group.mapping.ldap.connection.timeout.ms":"60000","mapreduce.task.profile.params":"-agentlib:hprof=cpu=samples,heap=sites,force=n,thread=y,verbose=n,file=%s","yarn.app.mapreduce.shuffle.log.backups":"0","yarn.nodemanager.container-diagnostics-maximum-size":"10000","hadoop.registry.zk.retry.interval.ms":"1000","yarn.nodemanager.linux-container-executor.cgroups.delete-timeout-ms":"1000","fs.AbstractFileSystem.file.impl":"org.apache.hadoop.fs.local.LocalFs","yarn.nodemanager.log-aggregation.roll-monitoring-interval-seconds":"-1","mapreduce.jobhistory.cleaner.interval-ms":"86400000","hadoop.registry.zk.quorum":"localhost:2181","mapreduce.output.fileoutputformat.compress":"false","yarn.resourcemanager.am-rm-tokens.master-key-rolling-interval-secs":"*********(redacted)","fs.s3a.assumed.role.session.duration":"30m","hadoop.security.group.mapping.ldap.conversion.rule":"none","hadoop.ssl.server.conf":"ssl-server.xml","fs.s3a.retry.throttle.interval":"1000ms","seq.io.sort.factor":"100","yarn.sharedcache.cleaner.initial-delay-mins":"10","mapreduce.client.completion.pollinterval":"5000","hadoop.ssl.keystores.factory.class":"org.apache.hadoop.security.ssl.FileBasedKeyStoresFactory","yarn.app.mapreduce.am.resource.cpu-vcores":"1","yarn.timeline-service.enabled":"false","yarn.nodemanager.runtime.linux.docker.capabilities":"CHOWN,DAC_OVERRIDE,FSETID,FOWNER,MKNOD,NET_RAW,SETGID,SETUID,SETFCAP,SETPCAP,NET_BIND_SERVICE,SYS_CHROOT,KILL,AUDIT_WRITE","yarn.acl.enable":"false","yarn.timeline-service.entity-group-fs-store.done-dir":"/tmp/entity-file-history/done/","mapreduce.task.profile":"false","yarn.resourcemanager.fs.state-store.uri":"${hadoop.tmp.dir}/yarn/system/rmstore","mapreduce.jobhistory.always-scan-user-dir":"false","yarn.nodemanager.opportunistic-containers-use-pause-for-preemption":"false","yarn.nodemanager.linux-container-executor.nonsecure-mode.local-user":"nobody","yarn.timeline-service.reader.class":"org.apache.hadoop.yarn.server.timelineservice.storage.HBaseTimelineReaderImpl","yarn.resourcemanager.configuration.provider-class":"org.apache.hadoop.yarn.LocalConfigurationProvider","yarn.nodemanager.runtime.linux.docker.userremapping-uid-threshold":"1","yarn.resourcemanager.configuration.file-system-based-store":"/yarn/conf","mapreduce.job.cache.limit.max-single-resource-mb":"0","yarn.nodemanager.runtime.linux.docker.stop.grace-period":"10","yarn.resourcemanager.resource-profiles.source-file":"resource-profiles.json","yarn.nodemanager.resource.percentage-physical-cpu-limit":"100","mapreduce.jobhistory.client.thread-count":"10","tfile.fs.input.buffer.size":"262144","mapreduce.client.progressmonitor.pollinterval":"1000","yarn.nodemanager.log-dirs":"${yarn.log.dir}/userlogs","fs.automatic.close":"true","yarn.nodemanager.hostname":"0.0.0.0","yarn.nodemanager.resource.memory.cgroups.swappiness":"0","ftp.stream-buffer-size":"4096","yarn.fail-fast":"false","yarn.timeline-service.app-aggregation-interval-secs":"15","hadoop.security.group.mapping.ldap.search.filter.user":"(&(objectClass=user)(sAMAccountName={0}))","yarn.nodemanager.container-localizer.log.level":"INFO","yarn.timeline-service.address":"${yarn.timeline-service.hostname}:10200","mapreduce.job.ubertask.maxmaps":"9","fs.s3a.threads.keepalivetime":"60","mapreduce.jobhistory.webapp.rest-csrf.methods-to-ignore":"GET,OPTIONS,HEAD","mapreduce.task.files.preserve.failedtasks":"false","yarn.app.mapreduce.client.job.retry-interval":"2000","ha.failover-controller.graceful-fence.connection.retries":"1","yarn.resourcemanager.delegation.token.max-lifetime":"*********(redacted)","yarn.timeline-service.client.drain-entities.timeout.ms":"2000","yarn.nodemanager.resource-plugins.fpga.vendor-plugin.class":"org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.fpga.IntelFpgaOpenclPlugin","yarn.timeline-service.entity-group-fs-store.summary-store":"org.apache.hadoop.yarn.server.timeline.LeveldbTimelineStore","mapreduce.reduce.cpu.vcores":"1","mapreduce.job.encrypted-intermediate-data.buffer.kb":"128","fs.client.resolve.remote.symlinks":"true","yarn.nodemanager.webapp.https.address":"0.0.0.0:8044","hadoop.http.cross-origin.allowed-origins":"*","mapreduce.job.encrypted-intermediate-data":"false","yarn.timeline-service.entity-group-fs-store.retain-seconds":"604800","yarn.resourcemanager.metrics.runtime.buckets":"60,300,1440","yarn.timeline-service.generic-application-history.max-applications":"10000","yarn.nodemanager.local-dirs":"${hadoop.tmp.dir}/nm-local-dir","mapreduce.shuffle.connection-keep-alive.enable":"false","yarn.node-labels.configuration-type":"centralized","fs.s3a.path.style.access":"false","yarn.nodemanager.aux-services.mapreduce_shuffle.class":"org.apache.hadoop.mapred.ShuffleHandler","yarn.sharedcache.store.in-memory.staleness-period-mins":"10080","fs.adl.impl":"org.apache.hadoop.fs.adl.AdlFileSystem","yarn.resourcemanager.nodemanager.minimum.version":"NONE","mapreduce.jobhistory.webapp.xfs-filter.xframe-options":"SAMEORIGIN","yarn.app.mapreduce.am.staging-dir.erasurecoding.enabled":"false","net.topology.impl":"org.apache.hadoop.net.NetworkTopology","io.map.index.skip":"0","yarn.timeline-service.reader.webapp.https.address":"${yarn.timeline-service.webapp.https.address}","fs.ftp.data.connection.mode":"ACTIVE_LOCAL_DATA_CONNECTION_MODE","mapreduce.job.local-fs.single-disk-limit.check.kill-limit-exceed":"true","yarn.scheduler.maximum-allocation-vcores":"4","hadoop.http.cross-origin.allowed-headers":"X-Requested-With,Content-Type,Accept,Origin","yarn.nodemanager.log-aggregation.compression-type":"none","yarn.timeline-service.version":"1.0f","yarn.ipc.rpc.class":"org.apache.hadoop.yarn.ipc.HadoopYarnProtoRPC","mapreduce.reduce.maxattempts":"4","hadoop.security.dns.log-slow-lookups.enabled":"false","mapreduce.job.committer.setup.cleanup.needed":"true","mapreduce.job.running.reduce.limit":"0","ipc.maximum.response.length":"134217728","yarn.resourcemanager.webapp.rest-csrf.methods-to-ignore":"GET,OPTIONS,HEAD","mapreduce.job.token.tracking.ids.enabled":"*********(redacted)","hadoop.caller.context.max.size":"128","yarn.nodemanager.runtime.linux.docker.host-pid-namespace.allowed":"false","yarn.nodemanager.runtime.linux.docker.delayed-removal.allowed":"false","hadoop.registry.system.acls":"sasl:yarn@, sasl:mapred@, sasl:hdfs@","yarn.nodemanager.recovery.dir":"${hadoop.tmp.dir}/yarn-nm-recovery","fs.s3a.fast.upload.buffer":"disk","mapreduce.jobhistory.intermediate-done-dir":"${yarn.app.mapreduce.am.staging-dir}/history/done_intermediate","yarn.app.mapreduce.shuffle.log.separate":"true","fs.s3a.max.total.tasks":"5","fs.s3a.readahead.range":"64K","hadoop.http.authentication.simple.anonymous.allowed":"true","fs.s3a.attempts.maximum":"20","hadoop.registry.zk.connection.timeout.ms":"15000","yarn.resourcemanager.delegation-token-renewer.thread-count":"*********(redacted)","yarn.nodemanager.health-checker.script.timeout-ms":"1200000","yarn.timeline-service.leveldb-timeline-store.start-time-write-cache-size":"10000","yarn.resourcemanager.resource-profiles.enabled":"false","yarn.timeline-service.hbase-schema.prefix":"prod.","fs.azure.authorization":"false","mapreduce.map.log.level":"INFO","yarn.resourcemanager.decommissioning-nodes-watcher.poll-interval-secs":"20","mapreduce.output.fileoutputformat.compress.type":"RECORD","yarn.resourcemanager.leveldb-state-store.path":"${hadoop.tmp.dir}/yarn/system/rmstore","yarn.timeline-service.webapp.rest-csrf.custom-header":"X-XSRF-Header","mapreduce.ifile.readahead.bytes":"4194304","yarn.sharedcache.app-checker.class":"org.apache.hadoop.yarn.server.sharedcachemanager.RemoteAppChecker","yarn.nodemanager.linux-container-executor.nonsecure-mode.limit-users":"true","yarn.nodemanager.resource.detect-hardware-capabilities":"false","mapreduce.cluster.acls.enabled":"false","mapreduce.job.speculative.retry-after-no-speculate":"1000","hadoop.security.group.mapping.ldap.search.group.hierarchy.levels":"0","yarn.resourcemanager.fs.state-store.retry-interval-ms":"1000","file.stream-buffer-size":"4096","yarn.resourcemanager.application-timeouts.monitor.interval-ms":"3000","mapreduce.map.output.compress.codec":"org.apache.hadoop.io.compress.DefaultCodec","mapreduce.map.speculative":"true","mapreduce.job.speculative.retry-after-speculate":"15000","yarn.nodemanager.linux-container-executor.cgroups.mount":"false","yarn.app.mapreduce.am.container.log.backups":"0","yarn.app.mapreduce.am.log.level":"INFO","mapreduce.job.reduce.slowstart.completedmaps":"0.05","yarn.timeline-service.http-authentication.type":"simple","hadoop.security.group.mapping.ldap.search.attr.group.name":"cn","yarn.nodemanager.resource-plugins.fpga.allowed-fpga-devices":"0,1","yarn.timeline-service.client.internal-timers-ttl-secs":"420","hadoop.http.logs.enabled":"true","fs.s3a.block.size":"32M","yarn.sharedcache.client-server.address":"0.0.0.0:8045","yarn.nodemanager.logaggregation.threadpool-size-max":"100","yarn.resourcemanager.hostname":"0.0.0.0","yarn.resourcemanager.delegation.key.update-interval":"86400000","mapreduce.reduce.shuffle.fetch.retry.enabled":"${yarn.nodemanager.recovery.enabled}","mapreduce.map.memory.mb":"-1","mapreduce.task.skip.start.attempts":"2","fs.AbstractFileSystem.hdfs.impl":"org.apache.hadoop.fs.Hdfs","yarn.nodemanager.disk-health-checker.enable":"true","ipc.client.tcpnodelay":"true","ipc.client.rpc-timeout.ms":"0","yarn.nodemanager.webapp.rest-csrf.methods-to-ignore":"GET,OPTIONS,HEAD","ipc.client.low-latency":"false","mapreduce.input.lineinputformat.linespermap":"1","yarn.router.interceptor.user.threadpool-size":"5","ipc.client.connect.max.retries.on.timeouts":"45","yarn.timeline-service.leveldb-timeline-store.read-cache-size":"104857600","fs.AbstractFileSystem.har.impl":"org.apache.hadoop.fs.HarFs","mapreduce.job.split.metainfo.maxsize":"10000000","yarn.am.liveness-monitor.expiry-interval-ms":"600000","yarn.resourcemanager.container-tokens.master-key-rolling-interval-secs":"*********(redacted)","yarn.timeline-service.entity-group-fs-store.app-cache-size":"10","fs.s3a.socket.recv.buffer":"8192","yarn.resourcemanager.resource-tracker.address":"${yarn.resourcemanager.hostname}:8031","yarn.nodemanager.node-labels.provider.fetch-timeout-ms":"1200000","mapreduce.job.heap.memory-mb.ratio":"0.8","yarn.resourcemanager.leveldb-state-store.compaction-interval-secs":"3600","yarn.resourcemanager.webapp.rest-csrf.custom-header":"X-XSRF-Header","yarn.scheduler.configuration.fs.path":"file://${hadoop.tmp.dir}/yarn/system/schedconf","mapreduce.client.output.filter":"FAILED","hadoop.http.filter.initializers":"org.apache.hadoop.http.lib.StaticUserWebFilter","mapreduce.reduce.memory.mb":"-1","yarn.timeline-service.hostname":"0.0.0.0","file.replication":"1","yarn.nodemanager.container-metrics.unregister-delay-ms":"10000","yarn.nodemanager.container-metrics.period-ms":"-1","mapreduce.fileoutputcommitter.task.cleanup.enabled":"false","yarn.nodemanager.log.retain-seconds":"10800","yarn.timeline-service.entity-group-fs-store.cleaner-interval-seconds":"3600","yarn.resourcemanager.keytab":"/etc/krb5.keytab","hadoop.security.group.mapping.providers.combined":"true","mapreduce.reduce.merge.inmem.threshold":"1000","yarn.timeline-service.recovery.enabled":"false","fs.azure.saskey.usecontainersaskeyforallaccess":"true","yarn.sharedcache.nm.uploader.thread-count":"20","yarn.resourcemanager.nodemanager-graceful-decommission-timeout-secs":"3600","mapreduce.shuffle.ssl.enabled":"false","yarn.timeline-service.hbase.coprocessor.app-final-value-retention-milliseconds":"259200000","fs.s3a.committer.staging.abort.pending.uploads":"true","yarn.nodemanager.opportunistic-containers-max-queue-length":"0","yarn.resourcemanager.state-store.max-completed-applications":"${yarn.resourcemanager.max-completed-applications}","mapreduce.job.speculative.minimum-allowed-tasks":"10","yarn.log-aggregation.retain-seconds":"-1","yarn.nodemanager.disk-health-checker.min-free-space-per-disk-mb":"0","mapreduce.jobhistory.max-age-ms":"604800000","hadoop.http.cross-origin.allowed-methods":"GET,POST,HEAD","yarn.resourcemanager.opportunistic-container-allocation.enabled":"false","mapreduce.jobhistory.webapp.address":"0.0.0.0:19888","hadoop.system.tags":"YARN,HDFS,NAMENODE,DATANODE,REQUIRED,SECURITY,KERBEROS,PERFORMANCE,CLIENT\n ,SERVER,DEBUG,DEPRECATED,COMMON,OPTIONAL","yarn.log-aggregation.file-controller.TFile.class":"org.apache.hadoop.yarn.logaggregation.filecontroller.tfile.LogAggregationTFileController","yarn.client.nodemanager-connect.max-wait-ms":"180000","yarn.resourcemanager.webapp.address":"${yarn.resourcemanager.hostname}:8088","mapreduce.jobhistory.recovery.enable":"false","mapreduce.reduce.shuffle.parallelcopies":"5","fs.AbstractFileSystem.webhdfs.impl":"org.apache.hadoop.fs.WebHdfs","fs.trash.interval":"0","yarn.app.mapreduce.client.max-retries":"3","hadoop.security.authentication":"simple","mapreduce.task.profile.reduce.params":"${mapreduce.task.profile.params}","yarn.app.mapreduce.am.resource.mb":"1536","mapreduce.input.fileinputformat.list-status.num-threads":"1","yarn.nodemanager.container-executor.class":"org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor","io.mapfile.bloom.size":"1048576","yarn.timeline-service.ttl-ms":"604800000","yarn.resourcemanager.nm-container-queuing.min-queue-length":"5","yarn.nodemanager.resource.cpu-vcores":"-1","mapreduce.job.reduces":"1","fs.s3a.multipart.size":"100M","yarn.scheduler.minimum-allocation-vcores":"1","mapreduce.job.speculative.speculative-cap-total-tasks":"0.01","hadoop.ssl.client.conf":"ssl-client.xml","mapreduce.job.queuename":"default","mapreduce.job.encrypted-intermediate-data-key-size-bits":"128","fs.s3a.metadatastore.authoritative":"false","yarn.nodemanager.webapp.xfs-filter.xframe-options":"SAMEORIGIN","ha.health-monitor.sleep-after-disconnect.ms":"1000","yarn.app.mapreduce.shuffle.log.limit.kb":"0","hadoop.security.group.mapping":"org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback","yarn.client.application-client-protocol.poll-timeout-ms":"-1","mapreduce.jobhistory.jhist.format":"binary","yarn.resourcemanager.ha.enabled":"false","hadoop.http.staticuser.user":"dr.who","mapreduce.task.exit.timeout.check-interval-ms":"20000","mapreduce.jobhistory.intermediate-user-done-dir.permissions":"770","mapreduce.task.exit.timeout":"60000","yarn.nodemanager.linux-container-executor.resources-handler.class":"org.apache.hadoop.yarn.server.nodemanager.util.DefaultLCEResourcesHandler","mapreduce.reduce.shuffle.memory.limit.percent":"0.25","yarn.resourcemanager.reservation-system.enable":"false","mapreduce.map.output.compress":"false","ha.zookeeper.acl":"world:anyone:rwcda","ipc.server.max.connections":"0","yarn.nodemanager.runtime.linux.docker.default-container-network":"host","yarn.router.webapp.address":"0.0.0.0:8089","yarn.scheduler.maximum-allocation-mb":"8192","yarn.resourcemanager.scheduler.monitor.policies":"org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicy","yarn.sharedcache.cleaner.period-mins":"1440","yarn.nodemanager.resource-plugins.gpu.docker-plugin.nvidia-docker-v1.endpoint":"http://localhost:3476/v1.0/docker/cli","yarn.app.mapreduce.am.container.log.limit.kb":"0","ipc.client.connect.retry.interval":"1000","yarn.timeline-service.http-cross-origin.enabled":"false","fs.wasbs.impl":"org.apache.hadoop.fs.azure.NativeAzureFileSystem$Secure","yarn.federation.subcluster-resolver.class":"org.apache.hadoop.yarn.server.federation.resolver.DefaultSubClusterResolverImpl","yarn.resourcemanager.zk-state-store.parent-path":"/rmstore","mapreduce.jobhistory.cleaner.enable":"true","yarn.timeline-service.client.fd-flush-interval-secs":"10","hadoop.security.kms.client.encrypted.key.cache.expiry":"43200000","yarn.client.nodemanager-client-async.thread-pool-max-size":"500","mapreduce.map.maxattempts":"4","yarn.resourcemanager.nm-container-queuing.sorting-nodes-interval-ms":"1000","fs.s3a.committer.staging.tmp.path":"tmp/staging","yarn.nodemanager.sleep-delay-before-sigkill.ms":"250","yarn.resourcemanager.nm-container-queuing.min-queue-wait-time-ms":"10","mapreduce.job.end-notification.retry.attempts":"0","yarn.nodemanager.resource.count-logical-processors-as-cores":"false","hadoop.registry.zk.root":"/registry","adl.feature.ownerandgroup.enableupn":"false","yarn.resourcemanager.zk-max-znode-size.bytes":"1048576","mapreduce.job.reduce.shuffle.consumer.plugin.class":"org.apache.hadoop.mapreduce.task.reduce.Shuffle","yarn.resourcemanager.delayed.delegation-token.removal-interval-ms":"*********(redacted)","yarn.nodemanager.localizer.cache.target-size-mb":"10240","fs.s3a.committer.staging.conflict-mode":"fail","mapreduce.client.libjars.wildcard":"true","fs.s3a.committer.staging.unique-filenames":"true","yarn.nodemanager.node-attributes.provider.fetch-timeout-ms":"1200000","fs.s3a.list.version":"2","ftp.client-write-packet-size":"65536","fs.AbstractFileSystem.adl.impl":"org.apache.hadoop.fs.adl.Adl","hadoop.security.key.default.cipher":"AES/CTR/NoPadding","yarn.client.failover-retries":"0","fs.s3a.multipart.purge.age":"86400","mapreduce.job.local-fs.single-disk-limit.check.interval-ms":"5000","net.topology.node.switch.mapping.impl":"org.apache.hadoop.net.ScriptBasedMapping","yarn.nodemanager.amrmproxy.address":"0.0.0.0:8049","ipc.server.listen.queue.size":"128","map.sort.class":"org.apache.hadoop.util.QuickSort","fs.viewfs.rename.strategy":"SAME_MOUNTPOINT","hadoop.security.kms.client.authentication.retry-count":"1","fs.permissions.umask-mode":"022","fs.s3a.assumed.role.credentials.provider":"org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider","yarn.nodemanager.vmem-check-enabled":"true","yarn.nodemanager.numa-awareness.enabled":"false","yarn.nodemanager.recovery.compaction-interval-secs":"3600","yarn.app.mapreduce.client-am.ipc.max-retries":"3","yarn.federation.registry.base-dir":"yarnfederation/","mapreduce.job.max.map":"-1","mapreduce.job.local-fs.single-disk-limit.bytes":"-1","mapreduce.job.ubertask.maxreduces":"1","hadoop.security.kms.client.encrypted.key.cache.size":"500","hadoop.security.java.secure.random.algorithm":"SHA1PRNG","ha.failover-controller.cli-check.rpc-timeout.ms":"20000","mapreduce.jobhistory.jobname.limit":"50","yarn.client.nodemanager-connect.retry-interval-ms":"10000","yarn.timeline-service.state-store-class":"org.apache.hadoop.yarn.server.timeline.recovery.LeveldbTimelineStateStore","yarn.nodemanager.env-whitelist":"JAVA_HOME,HADOOP_COMMON_HOME,HADOOP_HDFS_HOME,HADOOP_CONF_DIR,CLASSPATH_PREPEND_DISTCACHE,HADOOP_YARN_HOME,HADOOP_HOME,PATH,LANG,TZ","yarn.sharedcache.nested-level":"3","yarn.timeline-service.webapp.rest-csrf.methods-to-ignore":"GET,OPTIONS,HEAD","fs.azure.user.agent.prefix":"unknown","yarn.resourcemanager.zk-delegation-token-node.split-index":"*********(redacted)","yarn.nodemanager.numa-awareness.read-topology":"false","yarn.nodemanager.webapp.address":"${yarn.nodemanager.hostname}:8042","rpc.metrics.quantile.enable":"false","yarn.registry.class":"org.apache.hadoop.registry.client.impl.FSRegistryOperationsService","mapreduce.jobhistory.admin.acl":"*","yarn.resourcemanager.system-metrics-publisher.dispatcher.pool-size":"10","yarn.scheduler.queue-placement-rules":"user-group","hadoop.http.authentication.kerberos.keytab":"${user.home}/hadoop.keytab","yarn.resourcemanager.recovery.enabled":"false","yarn.timeline-service.webapp.rest-csrf.enabled":"false"},"System Properties":{"java.io.tmpdir":"/var/folders/p_/5j1mtw1x0579b34vy4ztcbs40000gn/T/","line.separator":"\n","path.separator":":","sun.management.compiler":"HotSpot 64-Bit Tiered Compilers","SPARK_SUBMIT":"true","sun.cpu.endian":"little","java.specification.version":"1.8","java.vm.specification.name":"Java Virtual Machine Specification","java.vendor":"Oracle Corporation","java.vm.specification.version":"1.8","user.home":"*********(redacted)","file.encoding.pkg":"sun.io","sun.nio.ch.bugLevel":"","sun.arch.data.model":"64","sun.boot.library.path":"/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib","user.dir":"*********(redacted)","java.library.path":"*********(redacted)/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.","sun.cpu.isalist":"","os.arch":"x86_64","java.vm.version":"25.231-b11","jetty.git.hash":"ab228fde9e55e9164c738d7fa121f8ac5acd51c9","java.endorsed.dirs":"/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/endorsed","java.runtime.version":"1.8.0_231-b11","java.vm.info":"mixed mode","java.ext.dirs":"*********(redacted)/Library/Java/Extensions:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java","java.runtime.name":"Java(TM) SE Runtime Environment","file.separator":"/","java.class.version":"52.0","scala.usejavacp":"true","java.specification.name":"Java Platform API Specification","sun.boot.class.path":"/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/rt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/sunrsasign.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre/classes","file.encoding":"UTF-8","user.timezone":"America/Los_Angeles","java.specification.vendor":"Oracle Corporation","sun.java.launcher":"SUN_STANDARD","os.version":"10.15.5","sun.os.patch.level":"unknown","gopherProxySet":"false","java.vm.specification.vendor":"Oracle Corporation","jdk.lang.Process.launchMechanism":"POSIX_SPAWN","user.country":"US","sun.jnu.encoding":"UTF-8","user.language":"en","java.vendor.url":"http://java.oracle.com/","java.awt.printerjob":"sun.lwawt.macosx.CPrinterJob","java.awt.graphicsenv":"sun.awt.CGraphicsEnvironment","awt.toolkit":"sun.lwawt.macosx.LWCToolkit","os.name":"Mac OS X","java.vm.vendor":"Oracle Corporation","java.vendor.url.bug":"http://bugreport.sun.com/bugreport/","user.name":"terryk","java.vm.name":"Java HotSpot(TM) 64-Bit Server VM","sun.java.command":"org.apache.spark.deploy.SparkSubmit --master spark://*********(redacted) --conf spark.eventLog.logStageExecutorMetrics=true --conf spark.eventLog.enabled=true --class org.apache.spark.repl.Main --name Spark shell spark-shell","java.home":"/Library/Java/JavaVirtualMachines/jdk1.8.0_231.jdk/Contents/Home/jre","java.version":"1.8.0_231","sun.io.unicode.encoding":"UnicodeBig"},"Classpath Entries":{"*********(redacted)/audience-annotations-0.5.0.jar":"System Classpath","*********(redacted)/zstd-jni-1.4.5-2.jar":"System Classpath","*********(redacted)/hadoop-yarn-common-3.2.0.jar":"System Classpath","*********(redacted)/apache-spark/common/unsafe/target/scala-2.12/classes/":"System Classpath","*********(redacted)/kerb-identity-1.0.1.jar":"System Classpath","*********(redacted)/jersey-hk2-2.30.jar":"System Classpath","*********(redacted)/apache-spark/mllib/target/jars/*":"System Classpath","*********(redacted)/slf4j-log4j12-1.7.30.jar":"System Classpath","*********(redacted)/kerby-pkix-1.0.1.jar":"System Classpath","*********(redacted)/metrics-jmx-4.1.1.jar":"System Classpath","*********(redacted)/xz-1.5.jar":"System Classpath","*********(redacted)/jakarta.validation-api-2.0.2.jar":"System Classpath","*********(redacted)/jetty-webapp-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/metrics-core-4.1.1.jar":"System Classpath","*********(redacted)/apache-spark/graphx/target/scala-2.12/classes/":"System Classpath","*********(redacted)/metrics-graphite-4.1.1.jar":"System Classpath","*********(redacted)/jersey-server-2.30.jar":"System Classpath","*********(redacted)/jetty-jndi-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/jetty-proxy-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/parquet-jackson-1.10.1.jar":"System Classpath","*********(redacted)/commons-crypto-1.0.0.jar":"System Classpath","*********(redacted)/xbean-asm7-shaded-4.15.jar":"System Classpath","*********(redacted)/spark-kvstore_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/netty-3.10.6.Final.jar":"System Classpath","*********(redacted)/jsr305-3.0.2.jar":"System Classpath","*********(redacted)/osgi-resource-locator-1.0.3.jar":"System Classpath","*********(redacted)/kerb-server-1.0.1.jar":"System Classpath","*********(redacted)/avro-1.8.2.jar":"System Classpath","*********(redacted)/jersey-media-jaxb-2.30.jar":"System Classpath","*********(redacted)/accessors-smart-1.2.jar":"System Classpath","*********(redacted)/spark-network-shuffle_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/protobuf-java-2.5.0.jar":"System Classpath","*********(redacted)/minlog-1.3.0.jar":"System Classpath","*********(redacted)/scala-parser-combinators_2.12-1.1.2.jar":"System Classpath","*********(redacted)/jetty-continuation-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/apache-spark/sql/hive/target/scala-2.12/classes/":"System Classpath","*********(redacted)/commons-net-3.6.jar":"System Classpath","*********(redacted)/apache-spark/core/target/jars/*":"System Classpath","*********(redacted)/istack-commons-runtime-3.0.8.jar":"System Classpath","*********(redacted)/jsp-api-2.1.jar":"System Classpath","*********(redacted)/hadoop-annotations-3.2.0.jar":"System Classpath","*********(redacted)/spark-launcher_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/jetty-servlets-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/hadoop-hdfs-client-3.2.0.jar":"System Classpath","*********(redacted)/hive-storage-api-2.7.1.jar":"System Classpath","*********(redacted)/aopalliance-repackaged-2.6.1.jar":"System Classpath","*********(redacted)/kerby-xdr-1.0.1.jar":"System Classpath","*********(redacted)/orc-mapreduce-1.5.10.jar":"System Classpath","*********(redacted)/jackson-databind-2.10.0.jar":"System Classpath","*********(redacted)/spark-mllib_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/hadoop-mapreduce-client-jobclient-3.2.0.jar":"System Classpath","*********(redacted)/hk2-utils-2.6.1.jar":"System Classpath","*********(redacted)/jetty-security-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/hadoop-client-3.2.0.jar":"System Classpath","*********(redacted)/hadoop-auth-3.2.0.jar":"System Classpath","*********(redacted)/gson-2.2.4.jar":"System Classpath","*********(redacted)/htrace-core4-4.1.0-incubating.jar":"System Classpath","*********(redacted)/curator-client-2.12.0.jar":"System Classpath","*********(redacted)/kerby-util-1.0.1.jar":"System Classpath","*********(redacted)/jackson-jaxrs-base-2.9.5.jar":"System Classpath","*********(redacted)/jackson-module-paranamer-2.10.0.jar":"System Classpath","*********(redacted)/commons-beanutils-1.9.3.jar":"System Classpath","*********(redacted)/woodstox-core-5.0.3.jar":"System Classpath","*********(redacted)/arrow-memory-0.15.1.jar":"System Classpath","*********(redacted)/activation-1.1.1.jar":"System Classpath","*********(redacted)/okhttp-2.7.5.jar":"System Classpath","*********(redacted)/jackson-mapper-asl-1.9.13.jar":"System Classpath","*********(redacted)/core-1.1.2.jar":"System Classpath","*********(redacted)/jetty-plus-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/apache-spark/resource-managers/yarn/target/scala-2.12/classes/":"System Classpath","*********(redacted)/antlr4-runtime-4.7.1.jar":"System Classpath","*********(redacted)/commons-compress-1.8.1.jar":"System Classpath","*********(redacted)/spark-tags_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/orc-shims-1.5.10.jar":"System Classpath","*********(redacted)/opencsv-2.3.jar":"System Classpath","*********(redacted)/compress-lzf-1.0.3.jar":"System Classpath","*********(redacted)/jackson-core-asl-1.9.13.jar":"System Classpath","*********(redacted)/objenesis-2.5.1.jar":"System Classpath","*********(redacted)/apache-spark/conf/":"System Classpath","*********(redacted)/apache-spark/common/network-common/target/scala-2.12/classes/":"System Classpath","*********(redacted)/httpcore-4.4.4.jar":"System Classpath","*********(redacted)/jcip-annotations-1.0-1.jar":"System Classpath","*********(redacted)/apache-spark/launcher/target/scala-2.12/classes/":"System Classpath","*********(redacted)/apache-spark/resource-managers/mesos/target/scala-2.12/classes":"System Classpath","*********(redacted)/apache-spark/sql/hive-thriftserver/target/scala-2.12/classes/":"System Classpath","*********(redacted)/jetty-util-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/jetty-server-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/jetty-xml-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/scala-collection-compat_2.12-2.1.1.jar":"System Classpath","*********(redacted)/javax.servlet-api-3.1.0.jar":"System Classpath","*********(redacted)/jackson-core-2.10.0.jar":"System Classpath","*********(redacted)/jetty-client-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/netty-all-4.1.47.Final.jar":"System Classpath","*********(redacted)/arpack_combined_all-0.1.jar":"System Classpath","*********(redacted)/jersey-container-servlet-core-2.30.jar":"System Classpath","*********(redacted)/paranamer-2.8.jar":"System Classpath","*********(redacted)/spark-sql_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/hadoop-common-3.2.0.jar":"System Classpath","*********(redacted)/jersey-common-2.30.jar":"System Classpath","*********(redacted)/hk2-locator-2.6.1.jar":"System Classpath","*********(redacted)/okio-1.6.0.jar":"System Classpath","*********(redacted)/jetty-http-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/jakarta.xml.bind-api-2.3.2.jar":"System Classpath","*********(redacted)/ivy-2.4.0.jar":"System Classpath","*********(redacted)/apache-spark/mllib/target/scala-2.12/classes/":"System Classpath","*********(redacted)/scala-library-2.12.10.jar":"System Classpath","*********(redacted)/scala-xml_2.12-1.2.0.jar":"System Classpath","*********(redacted)/apache-spark/streaming/target/scala-2.12/classes/":"System Classpath","*********(redacted)/spark-repl_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/apache-spark/common/tags/target/scala-2.12/classes/":"System Classpath","*********(redacted)/kerby-config-1.0.1.jar":"System Classpath","*********(redacted)/zookeeper-3.4.14.jar":"System Classpath","*********(redacted)/janino-3.1.2.jar":"System Classpath","*********(redacted)/breeze_2.12-1.0.jar":"System Classpath","*********(redacted)/hk2-api-2.6.1.jar":"System Classpath","*********(redacted)/hadoop-mapreduce-client-common-3.2.0.jar":"System Classpath","*********(redacted)/flatbuffers-java-1.9.0.jar":"System Classpath","*********(redacted)/curator-framework-2.13.0.jar":"System Classpath","*********(redacted)/metrics-jvm-4.1.1.jar":"System Classpath","*********(redacted)/stax2-api-3.1.4.jar":"System Classpath","*********(redacted)/json-smart-2.3.jar":"System Classpath","*********(redacted)/parquet-hadoop-1.10.1.jar":"System Classpath","*********(redacted)/kerb-common-1.0.1.jar":"System Classpath","*********(redacted)/breeze-macros_2.12-1.0.jar":"System Classpath","*********(redacted)/scala-compiler-2.12.10.jar":"System Classpath","*********(redacted)/guava-14.0.1.jar":"System Classpath","*********(redacted)/jul-to-slf4j-1.7.30.jar":"System Classpath","*********(redacted)/spark-assembly_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/spark-core_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/spark-graphx_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/jakarta.ws.rs-api-2.1.6.jar":"System Classpath","*********(redacted)/spark-unsafe_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/jetty-io-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/JTransforms-3.1.jar":"System Classpath","*********(redacted)/commons-io-2.5.jar":"System Classpath","*********(redacted)/spark-catalyst_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/spire_2.12-0.17.0-M1.jar":"System Classpath","*********(redacted)/commons-cli-1.2.jar":"System Classpath","*********(redacted)/shims-0.7.45.jar":"System Classpath","*********(redacted)/spotbugs-annotations-3.1.9.jar":"System Classpath","*********(redacted)/kerb-simplekdc-1.0.1.jar":"System Classpath","*********(redacted)/commons-codec-1.11.jar":"System Classpath","*********(redacted)/jcl-over-slf4j-1.7.30.jar":"System Classpath","*********(redacted)/lz4-java-1.7.1.jar":"System Classpath","*********(redacted)/aopalliance-1.0.jar":"System Classpath","*********(redacted)/jackson-jaxrs-json-provider-2.9.5.jar":"System Classpath","*********(redacted)/json4s-jackson_2.12-3.6.6.jar":"System Classpath","*********(redacted)/commons-math3-3.4.1.jar":"System Classpath","*********(redacted)/shapeless_2.12-2.3.3.jar":"System Classpath","*********(redacted)/spark-mllib-local_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/dnsjava-2.1.7.jar":"System Classpath","*********(redacted)/unused-1.0.0.jar":"System Classpath","*********(redacted)/log4j-1.2.17.jar":"System Classpath","*********(redacted)/kerb-client-1.0.1.jar":"System Classpath","*********(redacted)/commons-lang-2.6.jar":"System Classpath","*********(redacted)/apache-spark/repl/target/scala-2.12/classes/":"System Classpath","*********(redacted)/kerb-util-1.0.1.jar":"System Classpath","*********(redacted)/slf4j-api-1.7.30.jar":"System Classpath","*********(redacted)/jackson-annotations-2.10.0.jar":"System Classpath","*********(redacted)/kerb-core-1.0.1.jar":"System Classpath","*********(redacted)/apache-spark/sql/catalyst/target/scala-2.12/classes/":"System Classpath","*********(redacted)/spire-macros_2.12-0.17.0-M1.jar":"System Classpath","*********(redacted)/apache-spark/examples/target/scala-2.12/classes/":"System Classpath","*********(redacted)/jakarta.annotation-api-1.3.5.jar":"System Classpath","*********(redacted)/json4s-scalap_2.12-3.6.6.jar":"System Classpath","*********(redacted)/apache-spark/core/target/scala-2.12/classes/":"System Classpath","*********(redacted)/arrow-format-0.15.1.jar":"System Classpath","*********(redacted)/kryo-shaded-4.0.2.jar":"System Classpath","*********(redacted)/scala-reflect-2.12.10.jar":"System Classpath","*********(redacted)/kerb-admin-1.0.1.jar":"System Classpath","*********(redacted)/hadoop-yarn-client-3.2.0.jar":"System Classpath","*********(redacted)/nimbus-jose-jwt-4.41.1.jar":"System Classpath","*********(redacted)/apache-spark/common/kvstore/target/scala-2.12/classes/":"System Classpath","*********(redacted)/oro-2.0.8.jar":"System Classpath","*********(redacted)/jakarta.inject-2.6.1.jar":"System Classpath","*********(redacted)/chill-java-0.9.5.jar":"System Classpath","*********(redacted)/cats-kernel_2.12-2.0.0-M4.jar":"System Classpath","*********(redacted)/jersey-container-servlet-2.30.jar":"System Classpath","*********(redacted)/py4j-0.10.9.jar":"System Classpath","*********(redacted)/parquet-format-2.4.0.jar":"System Classpath","*********(redacted)/apache-spark/sql/core/target/scala-2.12/classes/":"System Classpath","*********(redacted)/jline-2.14.6.jar":"System Classpath","*********(redacted)/JLargeArrays-1.5.jar":"System Classpath","*********(redacted)/kerby-asn1-1.0.1.jar":"System Classpath","*********(redacted)/jaxb-runtime-2.3.2.jar":"System Classpath","*********(redacted)/pmml-model-1.4.8.jar":"System Classpath","*********(redacted)/parquet-encoding-1.10.1.jar":"System Classpath","*********(redacted)/machinist_2.12-0.6.8.jar":"System Classpath","*********(redacted)/commons-compiler-3.1.2.jar":"System Classpath","*********(redacted)/kerb-crypto-1.0.1.jar":"System Classpath","*********(redacted)/aircompressor-0.10.jar":"System Classpath","*********(redacted)/leveldbjni-all-1.8.jar":"System Classpath","*********(redacted)/metrics-json-4.1.1.jar":"System Classpath","*********(redacted)/jackson-module-jaxb-annotations-2.9.5.jar":"System Classpath","*********(redacted)/jaxb-api-2.2.11.jar":"System Classpath","*********(redacted)/spire-util_2.12-0.17.0-M1.jar":"System Classpath","*********(redacted)/jetty-servlet-9.4.28.v20200408.jar":"System Classpath","*********(redacted)/spark-network-common_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/spark-streaming_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/json4s-core_2.12-3.6.6.jar":"System Classpath","*********(redacted)/stream-2.9.6.jar":"System Classpath","*********(redacted)/spark-sketch_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","*********(redacted)/chill_2.12-0.9.5.jar":"System Classpath","*********(redacted)/commons-configuration2-2.1.1.jar":"System Classpath","*********(redacted)/univocity-parsers-2.8.3.jar":"System Classpath","*********(redacted)/parquet-common-1.10.1.jar":"System Classpath","*********(redacted)/threeten-extra-1.5.0.jar":"System Classpath","*********(redacted)/token-provider-1.0.1.jar":"System Classpath","*********(redacted)/commons-text-1.6.jar":"System Classpath","*********(redacted)/apache-spark/common/sketch/target/scala-2.12/classes/":"System Classpath","*********(redacted)/javax.inject-1.jar":"System Classpath","*********(redacted)/httpclient-4.5.2.jar":"System Classpath","*********(redacted)/avro-ipc-1.8.2.jar":"System Classpath","*********(redacted)/curator-recipes-2.13.0.jar":"System Classpath","*********(redacted)/commons-collections-3.2.2.jar":"System Classpath","*********(redacted)/jersey-client-2.30.jar":"System Classpath","*********(redacted)/snappy-java-1.1.7.5.jar":"System Classpath","*********(redacted)/algebra_2.12-2.0.0-M2.jar":"System Classpath","*********(redacted)/javassist-3.25.0-GA.jar":"System Classpath","*********(redacted)/arrow-vector-0.15.1.jar":"System Classpath","*********(redacted)/avro-mapred-1.8.2-hadoop2.jar":"System Classpath","*********(redacted)/re2j-1.1.jar":"System Classpath","*********(redacted)/parquet-column-1.10.1.jar":"System Classpath","*********(redacted)/pyrolite-4.30.jar":"System Classpath","*********(redacted)/apache-spark/common/network-shuffle/target/scala-2.12/classes/":"System Classpath","*********(redacted)/apache-spark/common/network-yarn/target/scala-2.12/classes":"System Classpath","*********(redacted)/hadoop-yarn-api-3.2.0.jar":"System Classpath","*********(redacted)/macro-compat_2.12-1.1.1.jar":"System Classpath","*********(redacted)/spire-platform_2.12-0.17.0-M1.jar":"System Classpath","*********(redacted)/commons-lang3-3.10.jar":"System Classpath","*********(redacted)/json4s-ast_2.12-3.6.6.jar":"System Classpath","*********(redacted)/RoaringBitmap-0.7.45.jar":"System Classpath","*********(redacted)/orc-core-1.5.10.jar":"System Classpath","*********(redacted)/jackson-module-scala_2.12-2.10.0.jar":"System Classpath","*********(redacted)/hadoop-mapreduce-client-core-3.2.0.jar":"System Classpath"}} +{"Event":"SparkListenerApplicationStart","App Name":"Spark shell","App ID":"app-20200706201101-0003","Timestamp":1594091460235,"User":"terryk"} +{"Event":"SparkListenerExecutorAdded","Timestamp":1594091463318,"Executor ID":"0","Executor Info":{"Host":"127.0.0.1","Total Cores":16,"Log Urls":{"stdout":"http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stdout","stderr":"http://127.0.0.1:8081/logPage/?appId=app-20200706201101-0003&executorId=0&logType=stderr"},"Attributes":{},"Resources":{},"Resource Profile Id":0}} +{"Event":"SparkListenerBlockManagerAdded","Block Manager ID":{"Executor ID":"0","Host":"127.0.0.1","Port":64419},"Maximum Memory":384093388,"Timestamp":1594091463413,"Maximum Onheap Memory":384093388,"Maximum Offheap Memory":0} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":0,"description":"foreach at :26","details":"org.apache.spark.sql.Dataset.foreach(Dataset.scala:2862)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:26)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:30)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:32)\n$line19.$read$$iw$$iw$$iw$$iw$$iw.(:34)\n$line19.$read$$iw$$iw$$iw$$iw.(:36)\n$line19.$read$$iw$$iw$$iw.(:38)\n$line19.$read$$iw$$iw.(:40)\n$line19.$read$$iw.(:42)\n$line19.$read.(:44)\n$line19.$read$.(:48)\n$line19.$read$.()\n$line19.$eval$.$print$lzycompute(:7)\n$line19.$eval$.$print(:6)\n$line19.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\nscala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:745)","physicalPlanDescription":"== Physical Plan ==\nDeserializeToObject (8)\n+- * BroadcastHashJoin Inner BuildLeft (7)\n :- BroadcastExchange (5)\n : +- * BroadcastHashJoin Inner BuildRight (4)\n : :- * LocalTableScan (1)\n : +- BroadcastExchange (3)\n : +- LocalTableScan (2)\n +- * LocalTableScan (6)\n\n\n(1) LocalTableScan [codegen id : 1]\nOutput [3]: [i1#10, j1#11, k1#12]\nArguments: [i1#10, j1#11, k1#12]\n\n(2) LocalTableScan\nOutput [3]: [i2#26, j2#27, k2#28]\nArguments: [i2#26, j2#27, k2#28]\n\n(3) BroadcastExchange\nInput [3]: [i2#26, j2#27, k2#28]\nArguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint))), [id=#23]\n\n(4) BroadcastHashJoin [codegen id : 1]\nLeft keys [1]: [i1#10]\nRight keys [1]: [i2#26]\nJoin condition: None\n\n(5) BroadcastExchange\nInput [6]: [i1#10, j1#11, k1#12, i2#26, j2#27, k2#28]\nArguments: HashedRelationBroadcastMode(List(cast(input[3, int, false] as bigint))), [id=#32]\n\n(6) LocalTableScan\nOutput [3]: [i3#42, j3#43, k3#44]\nArguments: [i3#42, j3#43, k3#44]\n\n(7) BroadcastHashJoin [codegen id : 2]\nLeft keys [1]: [i2#26]\nRight keys [1]: [i3#42]\nJoin condition: None\n\n(8) DeserializeToObject\nInput [9]: [i1#10, j1#11, k1#12, i2#26, j2#27, k2#28, i3#42, j3#43, k3#44]\nArguments: createexternalrow(i1#10, j1#11, k1#12.toString, i2#26, j2#27, k2#28.toString, i3#42, j3#43, k3#44.toString, StructField(i1,IntegerType,false), StructField(j1,IntegerType,false), StructField(k1,StringType,true), StructField(i2,IntegerType,false), StructField(j2,IntegerType,false), StructField(k2,StringType,true), StructField(i3,IntegerType,false), StructField(j3,IntegerType,false), StructField(k3,StringType,true)), obj#93: org.apache.spark.sql.Row\n\n","sparkPlanInfo":{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject createexternalrow(i1#10, j1#11, k1#12.toString, i2#26, j2#27, k2#28.toString, i3#42, j3#43, k3#44.toString, StructField(i1,IntegerType,false), StructField(j1,IntegerType,false), StructField(k1,StringType,true), StructField(i2,IntegerType,false), StructField(j2,IntegerType,false), StructField(k2,StringType,true), StructField(i3,IntegerType,false), StructField(j3,IntegerType,false), StructField(k3,StringType,true)), obj#93: org.apache.spark.sql.Row","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"BroadcastHashJoin","simpleString":"BroadcastHashJoin [i2#26], [i3#42], Inner, BuildLeft","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"BroadcastExchange","simpleString":"BroadcastExchange HashedRelationBroadcastMode(List(cast(input[3, int, false] as bigint))), [id=#32]","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"BroadcastHashJoin","simpleString":"BroadcastHashJoin [i1#10], [i2#26], Inner, BuildRight","children":[{"nodeName":"LocalTableScan","simpleString":"LocalTableScan [i1#10, j1#11, k1#12]","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":8,"metricType":"sum"}]},{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"BroadcastExchange","simpleString":"BroadcastExchange HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint))), [id=#23]","children":[{"nodeName":"LocalTableScan","simpleString":"LocalTableScan [i2#26, j2#27, k2#28]","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":13,"metricType":"sum"}]}],"metadata":{},"metrics":[{"name":"data size","accumulatorId":9,"metricType":"size"},{"name":"time to collect","accumulatorId":10,"metricType":"timing"},{"name":"time to build","accumulatorId":11,"metricType":"timing"},{"name":"time to broadcast","accumulatorId":12,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":7,"metricType":"sum"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":6,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"data size","accumulatorId":2,"metricType":"size"},{"name":"time to collect","accumulatorId":3,"metricType":"timing"},{"name":"time to build","accumulatorId":4,"metricType":"timing"},{"name":"time to broadcast","accumulatorId":5,"metricType":"timing"}]}],"metadata":{},"metrics":[]},{"nodeName":"LocalTableScan","simpleString":"LocalTableScan [i3#42, j3#43, k3#44]","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":14,"metricType":"sum"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":1,"metricType":"sum"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":0,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1594091478577} +{"Event":"SparkListenerJobStart","Job ID":0,"Submission Time":1594091478844,"Stage Infos":[{"Stage ID":0,"Stage Attempt ID":0,"Stage Name":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Number of Tasks":16,"RDD Info":[{"RDD ID":2,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[1],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":0,"Name":"ParallelCollectionRDD","Scope":"{\"id\":\"3\",\"name\":\"LocalTableScan\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":1,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"3\",\"name\":\"LocalTableScan\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[0],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$1(SQLExecution.scala:185)\njava.util.concurrent.FutureTask.run(FutureTask.java:266)\njava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\njava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\njava.lang.Thread.run(Thread.java:748)","Accumulables":[],"Resource Profile Id":0}],"Stage IDs":[0],"Properties":{"spark.driver.host":"localhost","spark.eventLog.enabled":"true","spark.job.interruptOnCancel":"true","spark.driver.port":"64413","spark.repl.class.uri":"spark://localhost:64413/classes","spark.jars":"","spark.repl.class.outputDir":"/private/var/folders/p_/5j1mtw1x0579b34vy4ztcbs40000gn/T/spark-0c713088-21d7-4b35-9b52-7a4dd4d15ae1/repl-361cef81-42cd-4875-a8a6-ce9dfe55682a","spark.app.name":"Spark shell","spark.rdd.scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","spark.rdd.scope.noOverride":"true","spark.submit.pyFiles":"","spark.ui.showConsoleProgress":"true","spark.job.description":"broadcast exchange (runId bb0234e5-4157-49a4-b40c-6d538d9f2ec8)","spark.executor.id":"driver","spark.jobGroup.id":"bb0234e5-4157-49a4-b40c-6d538d9f2ec8","spark.eventLog.logStageExecutorMetrics":"true","spark.submit.deployMode":"client","spark.master":"*********(redacted)","spark.home":"*********(redacted)","spark.sql.execution.id":"0","spark.sql.catalogImplementation":"in-memory","spark.app.id":"app-20200706201101-0003"}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":0,"Stage Attempt ID":0,"Stage Name":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Number of Tasks":16,"RDD Info":[{"RDD ID":2,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[1],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":0,"Name":"ParallelCollectionRDD","Scope":"{\"id\":\"3\",\"name\":\"LocalTableScan\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":1,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"3\",\"name\":\"LocalTableScan\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[0],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$1(SQLExecution.scala:185)\njava.util.concurrent.FutureTask.run(FutureTask.java:266)\njava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\njava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\njava.lang.Thread.run(Thread.java:748)","Submission Time":1594091478860,"Accumulables":[],"Resource Profile Id":0},"Properties":{"spark.driver.host":"localhost","spark.eventLog.enabled":"true","spark.job.interruptOnCancel":"true","spark.driver.port":"64413","spark.repl.class.uri":"spark://localhost:64413/classes","spark.jars":"","spark.repl.class.outputDir":"/private/var/folders/p_/5j1mtw1x0579b34vy4ztcbs40000gn/T/spark-0c713088-21d7-4b35-9b52-7a4dd4d15ae1/repl-361cef81-42cd-4875-a8a6-ce9dfe55682a","spark.app.name":"Spark shell","spark.rdd.scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","spark.rdd.scope.noOverride":"true","spark.submit.pyFiles":"","spark.ui.showConsoleProgress":"true","spark.job.description":"broadcast exchange (runId bb0234e5-4157-49a4-b40c-6d538d9f2ec8)","spark.executor.id":"driver","spark.jobGroup.id":"bb0234e5-4157-49a4-b40c-6d538d9f2ec8","spark.eventLog.logStageExecutorMetrics":"true","spark.submit.deployMode":"client","spark.master":"*********(redacted)","spark.home":"*********(redacted)","spark.sql.execution.id":"0","spark.sql.catalogImplementation":"in-memory","spark.app.id":"app-20200706201101-0003"}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":0,"Index":0,"Attempt":0,"Launch Time":1594091479253,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":1,"Index":1,"Attempt":0,"Launch Time":1594091479269,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":2,"Index":2,"Attempt":0,"Launch Time":1594091479269,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":3,"Index":3,"Attempt":0,"Launch Time":1594091479270,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":4,"Index":4,"Attempt":0,"Launch Time":1594091479270,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":5,"Index":5,"Attempt":0,"Launch Time":1594091479270,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":6,"Index":6,"Attempt":0,"Launch Time":1594091479271,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":7,"Index":7,"Attempt":0,"Launch Time":1594091479272,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":8,"Index":8,"Attempt":0,"Launch Time":1594091479272,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":9,"Index":9,"Attempt":0,"Launch Time":1594091479273,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":10,"Index":10,"Attempt":0,"Launch Time":1594091479273,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":11,"Index":11,"Attempt":0,"Launch Time":1594091479273,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":12,"Index":12,"Attempt":0,"Launch Time":1594091479274,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":13,"Index":13,"Attempt":0,"Launch Time":1594091479274,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":14,"Index":14,"Attempt":0,"Launch Time":1594091479274,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":15,"Index":15,"Attempt":0,"Launch Time":1594091479274,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":6,"Index":6,"Attempt":0,"Launch Time":1594091479271,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480364,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":109,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1387,"Value":1387,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":8922000,"Value":8922000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":80,"Value":80,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":235295000,"Value":235295000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":962,"Value":962,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":962,"Executor Deserialize CPU Time":235295000,"Executor Run Time":80,"Executor CPU Time":8922000,"Peak Execution Memory":0,"Result Size":1387,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":8,"Index":8,"Attempt":0,"Launch Time":1594091479272,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480367,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"1","Value":"2","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":218,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1391,"Value":2778,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":8860000,"Value":17782000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":81,"Value":161,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":213308000,"Value":448603000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":963,"Value":1925,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":963,"Executor Deserialize CPU Time":213308000,"Executor Run Time":81,"Executor CPU Time":8860000,"Peak Execution Memory":0,"Result Size":1391,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":2,"Index":2,"Attempt":0,"Launch Time":1594091479269,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480367,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"1","Value":"3","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":327,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1387,"Value":4165,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":10463000,"Value":28245000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":79,"Value":240,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":228677000,"Value":677280000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":962,"Value":2887,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":962,"Executor Deserialize CPU Time":228677000,"Executor Run Time":79,"Executor CPU Time":10463000,"Peak Execution Memory":0,"Result Size":1387,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":13,"Index":13,"Attempt":0,"Launch Time":1594091479274,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480367,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"1","Value":"4","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":436,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1390,"Value":5555,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":8782000,"Value":37027000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":83,"Value":323,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":196368000,"Value":873648000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":962,"Value":3849,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":962,"Executor Deserialize CPU Time":196368000,"Executor Run Time":83,"Executor CPU Time":8782000,"Peak Execution Memory":0,"Result Size":1390,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":0,"Index":0,"Attempt":0,"Launch Time":1594091479253,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480368,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"1","Value":"5","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":545,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1384,"Value":6939,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":10820000,"Value":47847000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":77,"Value":400,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":221708000,"Value":1095356000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":962,"Value":4811,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":962,"Executor Deserialize CPU Time":221708000,"Executor Run Time":77,"Executor CPU Time":10820000,"Peak Execution Memory":0,"Result Size":1384,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":11,"Index":11,"Attempt":0,"Launch Time":1594091479273,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480368,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"2","Value":"7","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":654,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1406,"Value":8345,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":13213000,"Value":61060000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":78,"Value":478,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":260380000,"Value":1355736000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":963,"Value":5774,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":963,"Executor Deserialize CPU Time":260380000,"Executor Run Time":78,"Executor CPU Time":13213000,"Peak Execution Memory":0,"Result Size":1406,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":10,"Index":10,"Attempt":0,"Launch Time":1594091479273,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480368,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"1","Value":"8","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":763,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1391,"Value":9736,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":9913000,"Value":70973000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":76,"Value":554,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":210788000,"Value":1566524000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":962,"Value":6736,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":962,"Executor Deserialize CPU Time":210788000,"Executor Run Time":76,"Executor CPU Time":9913000,"Peak Execution Memory":0,"Result Size":1391,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":14,"Index":14,"Attempt":0,"Launch Time":1594091479274,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480368,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"1","Value":"9","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":872,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1391,"Value":11127,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":8784000,"Value":79757000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":79,"Value":633,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":235620000,"Value":1802144000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":964,"Value":7700,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":964,"Executor Deserialize CPU Time":235620000,"Executor Run Time":79,"Executor CPU Time":8784000,"Peak Execution Memory":0,"Result Size":1391,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":12,"Index":12,"Attempt":0,"Launch Time":1594091479274,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480369,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"1","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":981,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1391,"Value":12518,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":12053000,"Value":91810000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":86,"Value":719,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":215398000,"Value":2017542000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":963,"Value":8663,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":963,"Executor Deserialize CPU Time":215398000,"Executor Run Time":86,"Executor CPU Time":12053000,"Peak Execution Memory":0,"Result Size":1391,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":3,"Index":3,"Attempt":0,"Launch Time":1594091479270,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480369,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"2","Value":"12","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":1090,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1403,"Value":13921,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":9030000,"Value":100840000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":79,"Value":798,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":196266000,"Value":2213808000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":962,"Value":9625,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":962,"Executor Deserialize CPU Time":196266000,"Executor Run Time":79,"Executor CPU Time":9030000,"Peak Execution Memory":0,"Result Size":1403,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":9,"Index":9,"Attempt":0,"Launch Time":1594091479273,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480369,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"1","Value":"13","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":1199,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1390,"Value":15311,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":10087000,"Value":110927000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":79,"Value":877,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":195342000,"Value":2409150000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":962,"Value":10587,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":962,"Executor Deserialize CPU Time":195342000,"Executor Run Time":79,"Executor CPU Time":10087000,"Peak Execution Memory":0,"Result Size":1390,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":15,"Index":15,"Attempt":0,"Launch Time":1594091479274,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480369,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"2","Value":"15","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":1308,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1411,"Value":16722,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":12920000,"Value":123847000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":86,"Value":963,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":236044000,"Value":2645194000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":961,"Value":11548,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":961,"Executor Deserialize CPU Time":236044000,"Executor Run Time":86,"Executor CPU Time":12920000,"Peak Execution Memory":0,"Result Size":1411,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":5,"Index":5,"Attempt":0,"Launch Time":1594091479270,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480370,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"1","Value":"16","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":21,"Name":"internal.metrics.resultSerializationTime","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":1417,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1430,"Value":18152,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":10478000,"Value":134325000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":77,"Value":1040,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":205925000,"Value":2851119000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":962,"Value":12510,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":962,"Executor Deserialize CPU Time":205925000,"Executor Run Time":77,"Executor CPU Time":10478000,"Peak Execution Memory":0,"Result Size":1430,"JVM GC Time":109,"Result Serialization Time":1,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":4,"Index":4,"Attempt":0,"Launch Time":1594091479270,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480370,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"1","Value":"17","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":1526,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1387,"Value":19539,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":8972000,"Value":143297000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":87,"Value":1127,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":206247000,"Value":3057366000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":963,"Value":13473,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":963,"Executor Deserialize CPU Time":206247000,"Executor Run Time":87,"Executor CPU Time":8972000,"Peak Execution Memory":0,"Result Size":1387,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":7,"Index":7,"Attempt":0,"Launch Time":1594091479272,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480370,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"2","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":21,"Name":"internal.metrics.resultSerializationTime","Update":2,"Value":3,"Internal":true,"Count Failed Values":true},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":1635,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1452,"Value":20991,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":20898000,"Value":164195000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":83,"Value":1210,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":389356000,"Value":3446722000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":963,"Value":14436,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":963,"Executor Deserialize CPU Time":389356000,"Executor Run Time":83,"Executor CPU Time":20898000,"Peak Execution Memory":0,"Result Size":1452,"JVM GC Time":109,"Result Serialization Time":2,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":1,"Index":1,"Attempt":0,"Launch Time":1594091479269,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480370,"Failed":false,"Killed":false,"Accumulables":[{"ID":13,"Name":"number of output rows","Update":"1","Value":"20","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"internal.metrics.jvmGCTime","Update":109,"Value":1744,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Update":1384,"Value":22375,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Update":8668000,"Value":172863000,"Internal":true,"Count Failed Values":true},{"ID":17,"Name":"internal.metrics.executorRunTime","Update":82,"Value":1292,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Update":222167000,"Value":3668889000,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Update":963,"Value":15399,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110},"Task Metrics":{"Executor Deserialize Time":963,"Executor Deserialize CPU Time":222167000,"Executor Run Time":82,"Executor CPU Time":8668000,"Peak Execution Memory":0,"Result Size":1384,"JVM GC Time":109,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageExecutorMetrics","Executor ID":"0","Stage ID":0,"Stage Attempt ID":0,"Executor Metrics":{"JVMHeapMemory":155100856,"JVMOffHeapMemory":64239224,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":6964,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":6964,"OffHeapUnifiedMemory":0,"DirectPoolMemory":1852,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":7,"MinorGCTime":33,"MajorGCCount":3,"MajorGCTime":110}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":0,"Stage Attempt ID":0,"Stage Name":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Number of Tasks":16,"RDD Info":[{"RDD ID":2,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[1],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":0,"Name":"ParallelCollectionRDD","Scope":"{\"id\":\"3\",\"name\":\"LocalTableScan\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":1,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"3\",\"name\":\"LocalTableScan\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[0],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$1(SQLExecution.scala:185)\njava.util.concurrent.FutureTask.run(FutureTask.java:266)\njava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\njava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\njava.lang.Thread.run(Thread.java:748)","Submission Time":1594091478860,"Completion Time":1594091480381,"Accumulables":[{"ID":17,"Name":"internal.metrics.executorRunTime","Value":1292,"Internal":true,"Count Failed Values":true},{"ID":20,"Name":"internal.metrics.jvmGCTime","Value":1744,"Internal":true,"Count Failed Values":true},{"ID":13,"Name":"number of output rows","Value":"20","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":16,"Name":"internal.metrics.executorDeserializeCpuTime","Value":3668889000,"Internal":true,"Count Failed Values":true},{"ID":19,"Name":"internal.metrics.resultSize","Value":22375,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"internal.metrics.executorCpuTime","Value":172863000,"Internal":true,"Count Failed Values":true},{"ID":21,"Name":"internal.metrics.resultSerializationTime","Value":3,"Internal":true,"Count Failed Values":true},{"ID":15,"Name":"internal.metrics.executorDeserializeTime","Value":15399,"Internal":true,"Count Failed Values":true}],"Resource Profile Id":0}} +{"Event":"SparkListenerJobEnd","Job ID":0,"Completion Time":1594091480385,"Job Result":{"Result":"JobSucceeded"}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerDriverAccumUpdates","executionId":0,"accumUpdates":[[9,1048632],[10,1736],[11,37],[12,5]]} +{"Event":"SparkListenerJobStart","Job ID":1,"Submission Time":1594091480498,"Stage Infos":[{"Stage ID":1,"Stage Attempt ID":0,"Stage Name":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Number of Tasks":16,"RDD Info":[{"RDD ID":5,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[4],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":3,"Name":"ParallelCollectionRDD","Scope":"{\"id\":\"2\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":4,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"2\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[3],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$1(SQLExecution.scala:185)\njava.util.concurrent.FutureTask.run(FutureTask.java:266)\njava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\njava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\njava.lang.Thread.run(Thread.java:748)","Accumulables":[],"Resource Profile Id":0}],"Stage IDs":[1],"Properties":{"spark.driver.host":"localhost","spark.eventLog.enabled":"true","spark.job.interruptOnCancel":"true","spark.driver.port":"64413","spark.repl.class.uri":"spark://localhost:64413/classes","spark.jars":"","spark.repl.class.outputDir":"/private/var/folders/p_/5j1mtw1x0579b34vy4ztcbs40000gn/T/spark-0c713088-21d7-4b35-9b52-7a4dd4d15ae1/repl-361cef81-42cd-4875-a8a6-ce9dfe55682a","spark.app.name":"Spark shell","spark.rdd.scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","spark.rdd.scope.noOverride":"true","spark.submit.pyFiles":"","spark.ui.showConsoleProgress":"true","spark.job.description":"broadcast exchange (runId bac7289a-c1d8-4966-a6a3-d9f347e13a5d)","spark.executor.id":"driver","spark.jobGroup.id":"bac7289a-c1d8-4966-a6a3-d9f347e13a5d","spark.eventLog.logStageExecutorMetrics":"true","spark.submit.deployMode":"client","spark.master":"*********(redacted)","spark.home":"*********(redacted)","spark.sql.execution.id":"0","spark.sql.catalogImplementation":"in-memory","spark.app.id":"app-20200706201101-0003"}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":1,"Stage Attempt ID":0,"Stage Name":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Number of Tasks":16,"RDD Info":[{"RDD ID":5,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[4],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":3,"Name":"ParallelCollectionRDD","Scope":"{\"id\":\"2\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":4,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"2\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[3],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$1(SQLExecution.scala:185)\njava.util.concurrent.FutureTask.run(FutureTask.java:266)\njava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\njava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\njava.lang.Thread.run(Thread.java:748)","Submission Time":1594091480499,"Accumulables":[],"Resource Profile Id":0},"Properties":{"spark.driver.host":"localhost","spark.eventLog.enabled":"true","spark.job.interruptOnCancel":"true","spark.driver.port":"64413","spark.repl.class.uri":"spark://localhost:64413/classes","spark.jars":"","spark.repl.class.outputDir":"/private/var/folders/p_/5j1mtw1x0579b34vy4ztcbs40000gn/T/spark-0c713088-21d7-4b35-9b52-7a4dd4d15ae1/repl-361cef81-42cd-4875-a8a6-ce9dfe55682a","spark.app.name":"Spark shell","spark.rdd.scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","spark.rdd.scope.noOverride":"true","spark.submit.pyFiles":"","spark.ui.showConsoleProgress":"true","spark.job.description":"broadcast exchange (runId bac7289a-c1d8-4966-a6a3-d9f347e13a5d)","spark.executor.id":"driver","spark.jobGroup.id":"bac7289a-c1d8-4966-a6a3-d9f347e13a5d","spark.eventLog.logStageExecutorMetrics":"true","spark.submit.deployMode":"client","spark.master":"*********(redacted)","spark.home":"*********(redacted)","spark.sql.execution.id":"0","spark.sql.catalogImplementation":"in-memory","spark.app.id":"app-20200706201101-0003"}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":16,"Index":0,"Attempt":0,"Launch Time":1594091480502,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":17,"Index":1,"Attempt":0,"Launch Time":1594091480503,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":18,"Index":2,"Attempt":0,"Launch Time":1594091480503,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":19,"Index":3,"Attempt":0,"Launch Time":1594091480503,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":20,"Index":4,"Attempt":0,"Launch Time":1594091480503,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":21,"Index":5,"Attempt":0,"Launch Time":1594091480504,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":22,"Index":6,"Attempt":0,"Launch Time":1594091480504,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":23,"Index":7,"Attempt":0,"Launch Time":1594091480504,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":24,"Index":8,"Attempt":0,"Launch Time":1594091480504,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":25,"Index":9,"Attempt":0,"Launch Time":1594091480504,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":26,"Index":10,"Attempt":0,"Launch Time":1594091480505,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":27,"Index":11,"Attempt":0,"Launch Time":1594091480505,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":28,"Index":12,"Attempt":0,"Launch Time":1594091480506,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":29,"Index":13,"Attempt":0,"Launch Time":1594091480506,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":30,"Index":14,"Attempt":0,"Launch Time":1594091480506,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":31,"Index":15,"Attempt":0,"Launch Time":1594091480507,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":20,"Index":4,"Attempt":0,"Launch Time":1594091480503,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480921,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"20","Value":"20","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"18","Value":"18","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"6","Value":"6","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":1016,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1966,"Value":1966,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":3116000,"Value":3116000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":378,"Value":378,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":4258000,"Value":4258000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":29,"Value":29,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":29,"Executor Deserialize CPU Time":4258000,"Executor Run Time":378,"Executor CPU Time":3116000,"Peak Execution Memory":1016,"Result Size":1966,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":17,"Index":1,"Attempt":0,"Launch Time":1594091480503,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480921,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"20","Value":"40","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"18","Value":"36","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"6","Value":"12","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":2032,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1951,"Value":3917,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":2895000,"Value":6011000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":379,"Value":757,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":2641000,"Value":6899000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":29,"Value":58,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":29,"Executor Deserialize CPU Time":2641000,"Executor Run Time":379,"Executor CPU Time":2895000,"Peak Execution Memory":1016,"Result Size":1951,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":21,"Index":5,"Attempt":0,"Launch Time":1594091480504,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480923,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"20","Value":"60","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"18","Value":"54","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"6","Value":"18","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":3048,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1957,"Value":5874,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":4164000,"Value":10175000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":380,"Value":1137,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":2012000,"Value":8911000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":28,"Value":86,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":28,"Executor Deserialize CPU Time":2012000,"Executor Run Time":380,"Executor CPU Time":4164000,"Peak Execution Memory":1016,"Result Size":1957,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":25,"Index":9,"Attempt":0,"Launch Time":1594091480504,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480923,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"20","Value":"80","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"18","Value":"72","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"6","Value":"24","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":4064,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1957,"Value":7831,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":4285000,"Value":14460000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":380,"Value":1517,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":2749000,"Value":11660000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":26,"Value":112,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":26,"Executor Deserialize CPU Time":2749000,"Executor Run Time":380,"Executor CPU Time":4285000,"Peak Execution Memory":1016,"Result Size":1957,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":23,"Index":7,"Attempt":0,"Launch Time":1594091480504,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480924,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"20","Value":"100","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"21","Value":"93","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"7","Value":"31","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":5080,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":2007,"Value":9838,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":16921000,"Value":31381000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":383,"Value":1900,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3854000,"Value":15514000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":26,"Value":138,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":26,"Executor Deserialize CPU Time":3854000,"Executor Run Time":383,"Executor CPU Time":16921000,"Peak Execution Memory":1016,"Result Size":2007,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":30,"Index":14,"Attempt":0,"Launch Time":1594091480506,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480925,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"20","Value":"120","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"18","Value":"111","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"6","Value":"37","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":6096,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1955,"Value":11793,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":4798000,"Value":36179000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":382,"Value":2282,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":2959000,"Value":18473000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":24,"Value":162,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":24,"Executor Deserialize CPU Time":2959000,"Executor Run Time":382,"Executor CPU Time":4798000,"Peak Execution Memory":1016,"Result Size":1955,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":27,"Index":11,"Attempt":0,"Launch Time":1594091480505,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480926,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"20","Value":"140","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"21","Value":"132","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"7","Value":"44","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":7112,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":2015,"Value":13808,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":4850000,"Value":41029000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":382,"Value":2664,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":4278000,"Value":22751000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":25,"Value":187,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":25,"Executor Deserialize CPU Time":4278000,"Executor Run Time":382,"Executor CPU Time":4850000,"Peak Execution Memory":1016,"Result Size":2015,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":19,"Index":3,"Attempt":0,"Launch Time":1594091480503,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480927,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"21","Value":"161","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"21","Value":"153","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"7","Value":"51","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":8128,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1998,"Value":15806,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":4100000,"Value":45129000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":383,"Value":3047,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3622000,"Value":26373000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":28,"Value":215,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":28,"Executor Deserialize CPU Time":3622000,"Executor Run Time":383,"Executor CPU Time":4100000,"Peak Execution Memory":1016,"Result Size":1998,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":26,"Index":10,"Attempt":0,"Launch Time":1594091480505,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480927,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"21","Value":"182","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"18","Value":"171","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"6","Value":"57","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":9144,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1973,"Value":17779,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":4350000,"Value":49479000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":383,"Value":3430,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3471000,"Value":29844000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":25,"Value":240,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":25,"Executor Deserialize CPU Time":3471000,"Executor Run Time":383,"Executor CPU Time":4350000,"Peak Execution Memory":1016,"Result Size":1973,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":28,"Index":12,"Attempt":0,"Launch Time":1594091480506,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480927,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"20","Value":"202","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"18","Value":"189","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"6","Value":"63","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":10160,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1966,"Value":19745,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":4682000,"Value":54161000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":384,"Value":3814,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":2652000,"Value":32496000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":23,"Value":263,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":23,"Executor Deserialize CPU Time":2652000,"Executor Run Time":384,"Executor CPU Time":4682000,"Peak Execution Memory":1016,"Result Size":1966,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":31,"Index":15,"Attempt":0,"Launch Time":1594091480507,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480928,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"21","Value":"223","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"21","Value":"210","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"7","Value":"70","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":11176,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":2008,"Value":21753,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":3954000,"Value":58115000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":382,"Value":4196,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":4289000,"Value":36785000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":25,"Value":288,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":25,"Executor Deserialize CPU Time":4289000,"Executor Run Time":382,"Executor CPU Time":3954000,"Peak Execution Memory":1016,"Result Size":2008,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":18,"Index":2,"Attempt":0,"Launch Time":1594091480503,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480928,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"20","Value":"243","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"18","Value":"228","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"6","Value":"76","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":12192,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1978,"Value":23731,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":349926000,"Value":408041000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":385,"Value":4581,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":14543000,"Value":51328000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":27,"Value":315,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":27,"Executor Deserialize CPU Time":14543000,"Executor Run Time":385,"Executor CPU Time":349926000,"Peak Execution Memory":1016,"Result Size":1978,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":22,"Index":6,"Attempt":0,"Launch Time":1594091480504,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480928,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"20","Value":"263","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"18","Value":"246","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"6","Value":"82","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":13208,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1965,"Value":25696,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":4473000,"Value":412514000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":381,"Value":4962,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3906000,"Value":55234000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":27,"Value":342,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":27,"Executor Deserialize CPU Time":3906000,"Executor Run Time":381,"Executor CPU Time":4473000,"Peak Execution Memory":1016,"Result Size":1965,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":29,"Index":13,"Attempt":0,"Launch Time":1594091480506,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480929,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"20","Value":"283","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"18","Value":"264","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"6","Value":"88","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":14224,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1955,"Value":27651,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":6459000,"Value":418973000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":381,"Value":5343,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3298000,"Value":58532000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":24,"Value":366,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":24,"Executor Deserialize CPU Time":3298000,"Executor Run Time":381,"Executor CPU Time":6459000,"Peak Execution Memory":1016,"Result Size":1955,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":24,"Index":8,"Attempt":0,"Launch Time":1594091480504,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480929,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"21","Value":"304","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"18","Value":"282","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"6","Value":"94","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":15240,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1954,"Value":29605,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":4365000,"Value":423338000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":380,"Value":5723,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":2411000,"Value":60943000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":28,"Value":394,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":28,"Executor Deserialize CPU Time":2411000,"Executor Run Time":380,"Executor CPU Time":4365000,"Peak Execution Memory":1016,"Result Size":1954,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":16,"Index":0,"Attempt":0,"Launch Time":1594091480502,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091480930,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"duration","Update":"20","Value":"324","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":7,"Name":"number of output rows","Update":"18","Value":"300","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":8,"Name":"number of output rows","Update":"6","Value":"100","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Update":1016,"Value":16256,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"internal.metrics.resultSize","Update":1941,"Value":31546,"Internal":true,"Count Failed Values":true},{"ID":43,"Name":"internal.metrics.executorCpuTime","Update":3111000,"Value":426449000,"Internal":true,"Count Failed Values":true},{"ID":42,"Name":"internal.metrics.executorRunTime","Update":382,"Value":6105,"Internal":true,"Count Failed Values":true},{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Update":2723000,"Value":63666000,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Update":30,"Value":424,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":30,"Executor Deserialize CPU Time":2723000,"Executor Run Time":382,"Executor CPU Time":3111000,"Peak Execution Memory":1016,"Result Size":1941,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageExecutorMetrics","Executor ID":"0","Stage ID":1,"Stage Attempt ID":0,"Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":1,"Stage Attempt ID":0,"Stage Name":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Number of Tasks":16,"RDD Info":[{"RDD ID":5,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[4],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":3,"Name":"ParallelCollectionRDD","Scope":"{\"id\":\"2\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":4,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"2\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"$anonfun$withThreadLocalCaptured$1 at FutureTask.java:266","Parent IDs":[3],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.execution.SQLExecution$.$anonfun$withThreadLocalCaptured$1(SQLExecution.scala:185)\njava.util.concurrent.FutureTask.run(FutureTask.java:266)\njava.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\njava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\njava.lang.Thread.run(Thread.java:748)","Submission Time":1594091480499,"Completion Time":1594091480930,"Accumulables":[{"ID":41,"Name":"internal.metrics.executorDeserializeCpuTime","Value":63666000,"Internal":true,"Count Failed Values":true},{"ID":8,"Name":"number of output rows","Value":"100","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":44,"Name":"internal.metrics.resultSize","Value":31546,"Internal":true,"Count Failed Values":true},{"ID":49,"Name":"internal.metrics.peakExecutionMemory","Value":16256,"Internal":true,"Count Failed Values":true},{"ID":40,"Name":"internal.metrics.executorDeserializeTime","Value":424,"Internal":true,"Count Failed Values":true},{"ID":7,"Name":"number of output rows","Value":"300","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":43,"Name":"internal.metrics.executorCpuTime","Value":426449000,"Internal":true,"Count Failed Values":true},{"ID":6,"Name":"duration","Value":"324","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":42,"Name":"internal.metrics.executorRunTime","Value":6105,"Internal":true,"Count Failed Values":true}],"Resource Profile Id":0}} +{"Event":"SparkListenerJobEnd","Job ID":1,"Completion Time":1594091480930,"Job Result":{"Result":"JobSucceeded"}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerDriverAccumUpdates","executionId":0,"accumUpdates":[[2,1048616],[3,2276],[4,13],[5,2]]} +{"Event":"SparkListenerJobStart","Job ID":2,"Submission Time":1594091481039,"Stage Infos":[{"Stage ID":2,"Stage Attempt ID":0,"Stage Name":"foreach at :26","Number of Tasks":16,"RDD Info":[{"RDD ID":10,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"18\",\"name\":\"mapPartitions\"}","Callsite":"foreach at :26","Parent IDs":[9],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":8,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","Callsite":"foreach at :26","Parent IDs":[7],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":6,"Name":"ParallelCollectionRDD","Scope":"{\"id\":\"1\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"foreach at :26","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":7,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"1\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"foreach at :26","Parent IDs":[6],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":9,"Name":"SQLExecutionRDD","Callsite":"foreach at :26","Parent IDs":[8],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.Dataset.foreach(Dataset.scala:2862)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:26)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:30)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:32)\n$line19.$read$$iw$$iw$$iw$$iw$$iw.(:34)\n$line19.$read$$iw$$iw$$iw$$iw.(:36)\n$line19.$read$$iw$$iw$$iw.(:38)\n$line19.$read$$iw$$iw.(:40)\n$line19.$read$$iw.(:42)\n$line19.$read.(:44)\n$line19.$read$.(:48)\n$line19.$read$.()\n$line19.$eval$.$print$lzycompute(:7)\n$line19.$eval$.$print(:6)\n$line19.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\nscala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:745)","Accumulables":[],"Resource Profile Id":0}],"Stage IDs":[2],"Properties":{"spark.driver.host":"localhost","spark.eventLog.enabled":"true","spark.driver.port":"64413","spark.repl.class.uri":"spark://localhost:64413/classes","spark.jars":"","spark.repl.class.outputDir":"/private/var/folders/p_/5j1mtw1x0579b34vy4ztcbs40000gn/T/spark-0c713088-21d7-4b35-9b52-7a4dd4d15ae1/repl-361cef81-42cd-4875-a8a6-ce9dfe55682a","spark.app.name":"Spark shell","spark.rdd.scope":"{\"id\":\"19\",\"name\":\"foreach\"}","spark.rdd.scope.noOverride":"true","spark.submit.pyFiles":"","spark.ui.showConsoleProgress":"true","spark.executor.id":"driver","spark.eventLog.logStageExecutorMetrics":"true","spark.submit.deployMode":"client","spark.master":"*********(redacted)","spark.home":"*********(redacted)","spark.sql.execution.id":"0","spark.sql.catalogImplementation":"in-memory","spark.app.id":"app-20200706201101-0003"}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":2,"Stage Attempt ID":0,"Stage Name":"foreach at :26","Number of Tasks":16,"RDD Info":[{"RDD ID":10,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"18\",\"name\":\"mapPartitions\"}","Callsite":"foreach at :26","Parent IDs":[9],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":8,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","Callsite":"foreach at :26","Parent IDs":[7],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":6,"Name":"ParallelCollectionRDD","Scope":"{\"id\":\"1\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"foreach at :26","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":7,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"1\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"foreach at :26","Parent IDs":[6],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":9,"Name":"SQLExecutionRDD","Callsite":"foreach at :26","Parent IDs":[8],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.Dataset.foreach(Dataset.scala:2862)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:26)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:30)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:32)\n$line19.$read$$iw$$iw$$iw$$iw$$iw.(:34)\n$line19.$read$$iw$$iw$$iw$$iw.(:36)\n$line19.$read$$iw$$iw$$iw.(:38)\n$line19.$read$$iw$$iw.(:40)\n$line19.$read$$iw.(:42)\n$line19.$read.(:44)\n$line19.$read$.(:48)\n$line19.$read$.()\n$line19.$eval$.$print$lzycompute(:7)\n$line19.$eval$.$print(:6)\n$line19.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\nscala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:745)","Submission Time":1594091481040,"Accumulables":[],"Resource Profile Id":0},"Properties":{"spark.driver.host":"localhost","spark.eventLog.enabled":"true","spark.driver.port":"64413","spark.repl.class.uri":"spark://localhost:64413/classes","spark.jars":"","spark.repl.class.outputDir":"/private/var/folders/p_/5j1mtw1x0579b34vy4ztcbs40000gn/T/spark-0c713088-21d7-4b35-9b52-7a4dd4d15ae1/repl-361cef81-42cd-4875-a8a6-ce9dfe55682a","spark.app.name":"Spark shell","spark.rdd.scope":"{\"id\":\"19\",\"name\":\"foreach\"}","spark.rdd.scope.noOverride":"true","spark.submit.pyFiles":"","spark.ui.showConsoleProgress":"true","spark.executor.id":"driver","spark.eventLog.logStageExecutorMetrics":"true","spark.submit.deployMode":"client","spark.master":"*********(redacted)","spark.home":"*********(redacted)","spark.sql.execution.id":"0","spark.sql.catalogImplementation":"in-memory","spark.app.id":"app-20200706201101-0003"}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":32,"Index":0,"Attempt":0,"Launch Time":1594091481077,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":33,"Index":1,"Attempt":0,"Launch Time":1594091481082,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":34,"Index":2,"Attempt":0,"Launch Time":1594091481087,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":35,"Index":3,"Attempt":0,"Launch Time":1594091481091,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":36,"Index":4,"Attempt":0,"Launch Time":1594091481095,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":37,"Index":5,"Attempt":0,"Launch Time":1594091481100,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":38,"Index":6,"Attempt":0,"Launch Time":1594091481104,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":39,"Index":7,"Attempt":0,"Launch Time":1594091481109,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":40,"Index":8,"Attempt":0,"Launch Time":1594091481112,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":41,"Index":9,"Attempt":0,"Launch Time":1594091481116,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":42,"Index":10,"Attempt":0,"Launch Time":1594091481120,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":43,"Index":11,"Attempt":0,"Launch Time":1594091481123,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":44,"Index":12,"Attempt":0,"Launch Time":1594091481126,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":45,"Index":13,"Attempt":0,"Launch Time":1594091481129,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":46,"Index":14,"Attempt":0,"Launch Time":1594091481132,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":47,"Index":15,"Attempt":0,"Launch Time":1594091481136,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":38,"Index":6,"Attempt":0,"Launch Time":1594091481104,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091482939,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1467","Value":"1467","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"375000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"6250","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":24040,"Internal":true,"Count Failed Values":true},{"ID":71,"Name":"internal.metrics.resultSerializationTime","Update":11,"Value":11,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":62,"Value":62,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2158,"Value":2158,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":414110000,"Value":414110000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1498,"Value":1498,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":60358000,"Value":60358000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":255,"Value":255,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":255,"Executor Deserialize CPU Time":60358000,"Executor Run Time":1498,"Executor CPU Time":414110000,"Peak Execution Memory":24040,"Result Size":2158,"JVM GC Time":62,"Result Serialization Time":11,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":47,"Index":15,"Attempt":0,"Launch Time":1594091481136,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483014,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1563","Value":"3030","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"750000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"12500","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":48080,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":52,"Value":114,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":4273,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":1324251000,"Value":1738361000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1594,"Value":3092,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":47496000,"Value":107854000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":213,"Value":468,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":213,"Executor Deserialize CPU Time":47496000,"Executor Run Time":1594,"Executor CPU Time":1324251000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":52,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":37,"Index":5,"Attempt":0,"Launch Time":1594091481100,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483015,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1563","Value":"4593","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"1125000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"18750","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":72120,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":62,"Value":176,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":6388,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":507192000,"Value":2245553000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1596,"Value":4688,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":60890000,"Value":168744000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":256,"Value":724,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":256,"Executor Deserialize CPU Time":60890000,"Executor Run Time":1596,"Executor CPU Time":507192000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":62,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":36,"Index":4,"Attempt":0,"Launch Time":1594091481095,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483015,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1564","Value":"6157","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"1500000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"25000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":96160,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":62,"Value":238,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":8503,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":503010000,"Value":2748563000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1596,"Value":6284,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":112849000,"Value":281593000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":260,"Value":984,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":260,"Executor Deserialize CPU Time":112849000,"Executor Run Time":1596,"Executor CPU Time":503010000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":62,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":35,"Index":3,"Attempt":0,"Launch Time":1594091481091,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483016,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1566","Value":"7723","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"1875000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"31250","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":120200,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":62,"Value":300,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":10618,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":502908000,"Value":3251471000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1598,"Value":7882,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":62944000,"Value":344537000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":263,"Value":1247,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":263,"Executor Deserialize CPU Time":62944000,"Executor Run Time":1598,"Executor CPU Time":502908000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":62,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":40,"Index":8,"Attempt":0,"Launch Time":1594091481112,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483016,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1562","Value":"9285","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"2250000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"37500","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":144240,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":62,"Value":362,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":12733,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":510597000,"Value":3762068000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1595,"Value":9477,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":69760000,"Value":414297000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":246,"Value":1493,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":246,"Executor Deserialize CPU Time":69760000,"Executor Run Time":1595,"Executor CPU Time":510597000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":62,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":45,"Index":13,"Attempt":0,"Launch Time":1594091481129,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483024,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1564","Value":"10849","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"2625000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"43750","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":168280,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":62,"Value":424,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":14848,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":495138000,"Value":4257206000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1595,"Value":11072,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":54222000,"Value":468519000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":221,"Value":1714,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":221,"Executor Deserialize CPU Time":54222000,"Executor Run Time":1595,"Executor CPU Time":495138000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":62,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":39,"Index":7,"Attempt":0,"Launch Time":1594091481109,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483024,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1566","Value":"12415","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"3000000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"50000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":192320,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":62,"Value":486,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":16963,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":539451000,"Value":4796657000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1596,"Value":12668,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":64380000,"Value":532899000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":254,"Value":1968,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":254,"Executor Deserialize CPU Time":64380000,"Executor Run Time":1596,"Executor CPU Time":539451000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":62,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":33,"Index":1,"Attempt":0,"Launch Time":1594091481082,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483025,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1566","Value":"13981","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"3375000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"56250","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":216360,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":62,"Value":548,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":19078,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":519178000,"Value":5315835000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1597,"Value":14265,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":54442000,"Value":587341000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":267,"Value":2235,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":267,"Executor Deserialize CPU Time":54442000,"Executor Run Time":1597,"Executor CPU Time":519178000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":62,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":34,"Index":2,"Attempt":0,"Launch Time":1594091481087,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483026,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1574","Value":"15555","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"3750000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"62500","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":240400,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":66,"Value":614,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":21193,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":508433000,"Value":5824268000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1606,"Value":15871,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":69492000,"Value":656833000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":265,"Value":2500,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":265,"Executor Deserialize CPU Time":69492000,"Executor Run Time":1606,"Executor CPU Time":508433000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":66,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":43,"Index":11,"Attempt":0,"Launch Time":1594091481123,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483029,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1578","Value":"17133","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"4125000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"68750","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":264440,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":66,"Value":680,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":23308,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":502120000,"Value":6326388000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1609,"Value":17480,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":48849000,"Value":705682000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":225,"Value":2725,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":225,"Executor Deserialize CPU Time":48849000,"Executor Run Time":1609,"Executor CPU Time":502120000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":66,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":41,"Index":9,"Attempt":0,"Launch Time":1594091481116,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483032,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1583","Value":"18716","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"4500000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"75000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":288480,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":66,"Value":746,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":25423,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":489923000,"Value":6816311000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1614,"Value":19094,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":55787000,"Value":761469000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":240,"Value":2965,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":240,"Executor Deserialize CPU Time":55787000,"Executor Run Time":1614,"Executor CPU Time":489923000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":66,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":46,"Index":14,"Attempt":0,"Launch Time":1594091481132,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483037,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1587","Value":"20303","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"4875000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"81250","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":312520,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":66,"Value":812,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":27538,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":490927000,"Value":7307238000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1618,"Value":20712,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":51464000,"Value":812933000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":218,"Value":3183,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":218,"Executor Deserialize CPU Time":51464000,"Executor Run Time":1618,"Executor CPU Time":490927000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":66,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":32,"Index":0,"Attempt":0,"Launch Time":1594091481077,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483037,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1587","Value":"21890","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"5250000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"87500","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":336560,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":66,"Value":878,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":29653,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":496683000,"Value":7803921000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1619,"Value":22331,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":56827000,"Value":869760000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":271,"Value":3454,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":271,"Executor Deserialize CPU Time":56827000,"Executor Run Time":1619,"Executor CPU Time":496683000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":66,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":42,"Index":10,"Attempt":0,"Launch Time":1594091481120,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483043,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1593","Value":"23483","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"5625000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"93750","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":360600,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":66,"Value":944,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":31768,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":508230000,"Value":8312151000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1624,"Value":23955,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":58152000,"Value":927912000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":229,"Value":3683,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":229,"Executor Deserialize CPU Time":58152000,"Executor Run Time":1624,"Executor CPU Time":508230000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":66,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":44,"Index":12,"Attempt":0,"Launch Time":1594091481126,"Executor ID":"0","Host":"127.0.0.1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1594091483043,"Failed":false,"Killed":false,"Accumulables":[{"ID":0,"Name":"duration","Update":"1593","Value":"25076","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1,"Name":"number of output rows","Update":"375000","Value":"6000000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":14,"Name":"number of output rows","Update":"6250","Value":"100000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Update":24040,"Value":384640,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Update":66,"Value":1010,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"internal.metrics.resultSize","Update":2115,"Value":33883,"Internal":true,"Count Failed Values":true},{"ID":68,"Name":"internal.metrics.executorCpuTime","Update":498187000,"Value":8810338000,"Internal":true,"Count Failed Values":true},{"ID":67,"Name":"internal.metrics.executorRunTime","Update":1624,"Value":25579,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Update":51988000,"Value":979900000,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Update":222,"Value":3905,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":222,"Executor Deserialize CPU Time":51988000,"Executor Run Time":1624,"Executor CPU Time":498187000,"Peak Execution Memory":24040,"Result Size":2115,"JVM GC Time":66,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageExecutorMetrics","Executor ID":"driver","Stage ID":2,"Stage Attempt ID":0,"Executor Metrics":{"JVMHeapMemory":213367864,"JVMOffHeapMemory":189011656,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":2133349,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":2133349,"OffHeapUnifiedMemory":0,"DirectPoolMemory":282024,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":13,"MinorGCTime":115,"MajorGCCount":4,"MajorGCTime":339}} +{"Event":"SparkListenerStageExecutorMetrics","Executor ID":"0","Stage ID":2,"Stage Attempt ID":0,"Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":2,"Stage Attempt ID":0,"Stage Name":"foreach at :26","Number of Tasks":16,"RDD Info":[{"RDD ID":10,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"18\",\"name\":\"mapPartitions\"}","Callsite":"foreach at :26","Parent IDs":[9],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":8,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"0\",\"name\":\"DeserializeToObject\"}","Callsite":"foreach at :26","Parent IDs":[7],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":6,"Name":"ParallelCollectionRDD","Scope":"{\"id\":\"1\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"foreach at :26","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":7,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"1\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"foreach at :26","Parent IDs":[6],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":9,"Name":"SQLExecutionRDD","Callsite":"foreach at :26","Parent IDs":[8],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":16,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.Dataset.foreach(Dataset.scala:2862)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:26)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:30)\n$line19.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:32)\n$line19.$read$$iw$$iw$$iw$$iw$$iw.(:34)\n$line19.$read$$iw$$iw$$iw$$iw.(:36)\n$line19.$read$$iw$$iw$$iw.(:38)\n$line19.$read$$iw$$iw.(:40)\n$line19.$read$$iw.(:42)\n$line19.$read.(:44)\n$line19.$read$.(:48)\n$line19.$read$.()\n$line19.$eval$.$print$lzycompute(:7)\n$line19.$eval$.$print(:6)\n$line19.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\nscala.tools.nsc.interpreter.IMain$ReadEvalPrint.call(IMain.scala:745)","Submission Time":1594091481040,"Completion Time":1594091483044,"Accumulables":[{"ID":68,"Name":"internal.metrics.executorCpuTime","Value":8810338000,"Internal":true,"Count Failed Values":true},{"ID":71,"Name":"internal.metrics.resultSerializationTime","Value":11,"Internal":true,"Count Failed Values":true},{"ID":74,"Name":"internal.metrics.peakExecutionMemory","Value":384640,"Internal":true,"Count Failed Values":true},{"ID":65,"Name":"internal.metrics.executorDeserializeTime","Value":3905,"Internal":true,"Count Failed Values":true},{"ID":14,"Name":"number of output rows","Value":"100000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":67,"Name":"internal.metrics.executorRunTime","Value":25579,"Internal":true,"Count Failed Values":true},{"ID":70,"Name":"internal.metrics.jvmGCTime","Value":1010,"Internal":true,"Count Failed Values":true},{"ID":1,"Name":"number of output rows","Value":"6000000","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":69,"Name":"internal.metrics.resultSize","Value":33883,"Internal":true,"Count Failed Values":true},{"ID":66,"Name":"internal.metrics.executorDeserializeCpuTime","Value":979900000,"Internal":true,"Count Failed Values":true},{"ID":0,"Name":"duration","Value":"25076","Internal":true,"Count Failed Values":true,"Metadata":"sql"}],"Resource Profile Id":0}} +{"Event":"SparkListenerJobEnd","Job ID":2,"Completion Time":1594091483044,"Job Result":{"Result":"JobSucceeded"}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":0,"time":1594091483045} +{"Event":"SparkListenerApplicationEnd","Timestamp":1594091824231} diff --git a/core/src/test/resources/spark-events/application_1555004656427_0144 b/core/src/test/resources/spark-events/application_1555004656427_0144 index 91dae7e09ee94..6868fe68b3540 100644 --- a/core/src/test/resources/spark-events/application_1555004656427_0144 +++ b/core/src/test/resources/spark-events/application_1555004656427_0144 @@ -2,6 +2,7 @@ {"Event":"SparkListenerBlockManagerAdded","Block Manager ID":{"Executor ID":"driver","Host":"10.28.9.112","Port":37319},"Maximum Memory":384093388,"Timestamp":1562101345595,"Maximum Onheap Memory":384093388,"Maximum Offheap Memory":0} {"Event":"SparkListenerEnvironmentUpdate","JVM Information":{"Java Home":"/usr/lib/jvm/java-8-openjdk-amd64/jre","Java Version":"1.8.0_212 (Oracle Corporation)","Scala Version":"version 2.12.8"},"Spark Properties":{"spark.executor.resource.gpu.amount":"1","spark.yarn.dist.files":"file:///home/tgraves/getGpus","spark.driver.host":"10.28.9.112","spark.executor.resource.gpu.discoveryScript":"./getGpus","spark.eventLog.enabled":"true","spark.driver.port":"38895","spark.repl.class.uri":"spark://10.28.9.112:38895/classes","spark.jars":"","spark.repl.class.outputDir":"/tmp/spark-f3ed6acc-96b8-420c-9974-b5be5e562fc6/repl-16ea2b82-f737-4619-8f9c-0dada7cab190","spark.driver.resource.gpu.amount":"1","spark.app.name":"Spark shell","spark.scheduler.mode":"FIFO","spark.executor.instances":"2","spark.submit.pyFiles":"","spark.ui.showConsoleProgress":"true","spark.driver.resource.gpu.discoveryScript":"/home/tgraves/getGpus","spark.executor.id":"driver","spark.task.resource.gpu.amount":"1","spark.submit.deployMode":"client","spark.master":"yarn","spark.ui.filters":"org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter","spark.home":"/home/tgraves/workspace/tgravescs-spark","spark.eventLog.dir":"hdfs:///user/tgraves/eventlogdir","spark.sql.catalogImplementation":"in-memory","spark.driver.appUIAddress":"http://10.28.9.112:4040","spark.org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter.param.PROXY_HOSTS":"tomg-test","spark.org.apache.hadoop.yarn.server.webproxy.amfilter.AmIpFilter.param.PROXY_URI_BASES":"http://tomg-test:8088/proxy/application_1555004656427_0144","spark.app.id":"application_1555004656427_0144"},"Hadoop Properties":{"hadoop.service.shutdown.timeout":"30s","yarn.resourcemanager.amlauncher.thread-count":"50","yarn.sharedcache.enabled":"false","fs.s3a.connection.maximum":"15","yarn.nodemanager.numa-awareness.numactl.cmd":"/usr/bin/numactl","fs.s3a.impl":"org.apache.hadoop.fs.s3a.S3AFileSystem","yarn.app.mapreduce.am.scheduler.heartbeat.interval-ms":"1000","yarn.timeline-service.timeline-client.number-of-async-entities-to-merge":"10","hadoop.security.kms.client.timeout":"60","hadoop.http.authentication.kerberos.principal":"HTTP/_HOST@LOCALHOST","mapreduce.jobhistory.loadedjob.tasks.max":"-1","mapreduce.framework.name":"yarn","yarn.sharedcache.uploader.server.thread-count":"50","yarn.nodemanager.linux-container-executor.nonsecure-mode.user-pattern":"^[_.A-Za-z0-9][-@_.A-Za-z0-9]{0,255}?[$]?$","tfile.fs.output.buffer.size":"262144","yarn.app.mapreduce.am.job.task.listener.thread-count":"30","hadoop.security.groups.cache.background.reload.threads":"3","yarn.resourcemanager.webapp.cross-origin.enabled":"false","fs.AbstractFileSystem.ftp.impl":"org.apache.hadoop.fs.ftp.FtpFs","hadoop.registry.secure":"false","hadoop.shell.safely.delete.limit.num.files":"100","dfs.bytes-per-checksum":"512","mapreduce.job.acl-view-job":" ","fs.s3a.s3guard.ddb.background.sleep":"25ms","fs.s3a.retry.limit":"${fs.s3a.attempts.maximum}","mapreduce.jobhistory.loadedjobs.cache.size":"5","fs.s3a.s3guard.ddb.table.create":"false","yarn.nodemanager.amrmproxy.enabled":"false","yarn.timeline-service.entity-group-fs-store.with-user-dir":"false","mapreduce.input.fileinputformat.split.minsize":"0","yarn.resourcemanager.container.liveness-monitor.interval-ms":"600000","yarn.resourcemanager.client.thread-count":"50","io.seqfile.compress.blocksize":"1000000","yarn.sharedcache.checksum.algo.impl":"org.apache.hadoop.yarn.sharedcache.ChecksumSHA256Impl","yarn.nodemanager.amrmproxy.interceptor-class.pipeline":"org.apache.hadoop.yarn.server.nodemanager.amrmproxy.DefaultRequestInterceptor","dfs.replication":"1","yarn.timeline-service.entity-group-fs-store.leveldb-cache-read-cache-size":"10485760","mapreduce.reduce.shuffle.fetch.retry.interval-ms":"1000","mapreduce.task.profile.maps":"0-2","yarn.scheduler.include-port-in-node-name":"false","yarn.nodemanager.admin-env":"MALLOC_ARENA_MAX=$MALLOC_ARENA_MAX","yarn.resourcemanager.node-removal-untracked.timeout-ms":"60000","mapreduce.am.max-attempts":"2","hadoop.security.kms.client.failover.sleep.base.millis":"100","mapreduce.jobhistory.webapp.https.address":"0.0.0.0:19890","yarn.node-labels.fs-store.impl.class":"org.apache.hadoop.yarn.nodelabels.FileSystemNodeLabelsStore","yarn.nodemanager.collector-service.address":"${yarn.nodemanager.hostname}:8048","fs.trash.checkpoint.interval":"0","mapreduce.job.map.output.collector.class":"org.apache.hadoop.mapred.MapTask$MapOutputBuffer","yarn.resourcemanager.node-ip-cache.expiry-interval-secs":"-1","hadoop.http.authentication.signature.secret.file":"*********(redacted)","hadoop.jetty.logs.serve.aliases":"true","yarn.resourcemanager.placement-constraints.handler":"disabled","yarn.timeline-service.handler-thread-count":"10","yarn.resourcemanager.max-completed-applications":"1000","yarn.resourcemanager.placement-constraints.algorithm.class":"org.apache.hadoop.yarn.server.resourcemanager.scheduler.constraint.algorithm.DefaultPlacementAlgorithm","yarn.sharedcache.webapp.address":"0.0.0.0:8788","yarn.resourcemanager.delegation.token.renew-interval":"*********(redacted)","yarn.sharedcache.nm.uploader.replication.factor":"10","hadoop.security.groups.negative-cache.secs":"30","yarn.app.mapreduce.task.container.log.backups":"0","mapreduce.reduce.skip.proc-count.auto-incr":"true","hadoop.security.group.mapping.ldap.posix.attr.gid.name":"gidNumber","ipc.client.fallback-to-simple-auth-allowed":"false","yarn.nodemanager.resource.memory.enforced":"true","yarn.client.failover-proxy-provider":"org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider","yarn.timeline-service.http-authentication.simple.anonymous.allowed":"true","ha.health-monitor.check-interval.ms":"1000","yarn.acl.reservation-enable":"false","yarn.resourcemanager.store.class":"org.apache.hadoop.yarn.server.resourcemanager.recovery.FileSystemRMStateStore","yarn.app.mapreduce.am.hard-kill-timeout-ms":"10000","fs.s3a.etag.checksum.enabled":"false","yarn.nodemanager.container-metrics.enable":"true","yarn.timeline-service.client.fd-clean-interval-secs":"60","yarn.resourcemanager.nodemanagers.heartbeat-interval-ms":"1000","hadoop.common.configuration.version":"3.0.0","fs.s3a.s3guard.ddb.table.capacity.read":"500","yarn.nodemanager.remote-app-log-dir-suffix":"logs","yarn.nodemanager.windows-container.cpu-limit.enabled":"false","yarn.nodemanager.runtime.linux.docker.privileged-containers.allowed":"false","file.blocksize":"67108864","hadoop.registry.zk.retry.ceiling.ms":"60000","mapreduce.reduce.env":"HADOOP_MAPRED_HOME=/home/tgraves/runspace/hadoop/lce/hadoop-3.1.2","yarn.scheduler.configuration.leveldb-store.path":"${hadoop.tmp.dir}/yarn/system/confstore","yarn.sharedcache.store.in-memory.initial-delay-mins":"10","mapreduce.jobhistory.principal":"jhs/_HOST@REALM.TLD","mapreduce.map.skip.proc-count.auto-incr":"true","fs.s3a.committer.name":"file","mapreduce.task.profile.reduces":"0-2","hadoop.zk.num-retries":"1000","yarn.webapp.xfs-filter.enabled":"true","seq.io.sort.mb":"100","yarn.scheduler.configuration.max.version":"100","yarn.timeline-service.webapp.https.address":"${yarn.timeline-service.hostname}:8190","yarn.resourcemanager.scheduler.address":"${yarn.resourcemanager.hostname}:8030","yarn.node-labels.enabled":"false","yarn.resourcemanager.webapp.ui-actions.enabled":"true","mapreduce.task.timeout":"600000","yarn.sharedcache.client-server.thread-count":"50","hadoop.security.groups.shell.command.timeout":"0s","hadoop.security.crypto.cipher.suite":"AES/CTR/NoPadding","yarn.nodemanager.elastic-memory-control.oom-handler":"org.apache.hadoop.yarn.server.nodemanager.containermanager.linux.resources.DefaultOOMHandler","yarn.resourcemanager.connect.max-wait.ms":"900000","fs.defaultFS":"hdfs://localhost:9000","yarn.minicluster.use-rpc":"false","yarn.app.mapreduce.am.env":"HADOOP_MAPRED_HOME=/home/tgraves/runspace/hadoop/lce/hadoop-3.1.2","fs.har.impl.disable.cache":"true","yarn.webapp.ui2.enable":"false","io.compression.codec.bzip2.library":"system-native","yarn.nodemanager.distributed-scheduling.enabled":"false","mapreduce.shuffle.connection-keep-alive.timeout":"5","yarn.resourcemanager.webapp.https.address":"${yarn.resourcemanager.hostname}:8090","mapreduce.jobhistory.address":"0.0.0.0:10020","yarn.resourcemanager.nm-tokens.master-key-rolling-interval-secs":"*********(redacted)","yarn.is.minicluster":"false","yarn.nodemanager.address":"${yarn.nodemanager.hostname}:0","fs.abfss.impl":"org.apache.hadoop.fs.azurebfs.SecureAzureBlobFileSystem","fs.AbstractFileSystem.s3a.impl":"org.apache.hadoop.fs.s3a.S3A","mapreduce.task.combine.progress.records":"10000","yarn.resourcemanager.epoch.range":"0","yarn.resourcemanager.am.max-attempts":"2","yarn.nodemanager.linux-container-executor.cgroups.hierarchy":"/hadoop-yarn","fs.AbstractFileSystem.wasbs.impl":"org.apache.hadoop.fs.azure.Wasbs","yarn.timeline-service.entity-group-fs-store.cache-store-class":"org.apache.hadoop.yarn.server.timeline.MemoryTimelineStore","fs.ftp.transfer.mode":"BLOCK_TRANSFER_MODE","ipc.server.log.slow.rpc":"false","yarn.resourcemanager.node-labels.provider.fetch-interval-ms":"1800000","yarn.router.webapp.https.address":"0.0.0.0:8091","yarn.nodemanager.webapp.cross-origin.enabled":"false","fs.wasb.impl":"org.apache.hadoop.fs.azure.NativeAzureFileSystem","yarn.resourcemanager.auto-update.containers":"false","yarn.app.mapreduce.am.job.committer.cancel-timeout":"60000","yarn.scheduler.configuration.zk-store.parent-path":"/confstore","yarn.nodemanager.default-container-executor.log-dirs.permissions":"710","yarn.app.attempt.diagnostics.limit.kc":"64","ftp.bytes-per-checksum":"512","yarn.nodemanager.resource.memory-mb":"-1","fs.AbstractFileSystem.abfs.impl":"org.apache.hadoop.fs.azurebfs.Abfs","yarn.timeline-service.writer.flush-interval-seconds":"60","fs.s3a.fast.upload.active.blocks":"4","hadoop.security.credential.clear-text-fallback":"true","yarn.nodemanager.collector-service.thread-count":"5","fs.azure.secure.mode":"false","mapreduce.jobhistory.joblist.cache.size":"20000","fs.ftp.host":"0.0.0.0","yarn.resourcemanager.fs.state-store.num-retries":"0","yarn.resourcemanager.nodemanager-connect-retries":"10","yarn.nodemanager.log-aggregation.num-log-files-per-app":"30","hadoop.security.kms.client.encrypted.key.cache.low-watermark":"0.3f","fs.s3a.committer.magic.enabled":"false","yarn.timeline-service.client.max-retries":"30","dfs.ha.fencing.ssh.connect-timeout":"30000","yarn.log-aggregation-enable":"false","yarn.system-metrics-publisher.enabled":"false","mapreduce.reduce.markreset.buffer.percent":"0.0","fs.AbstractFileSystem.viewfs.impl":"org.apache.hadoop.fs.viewfs.ViewFs","mapreduce.task.io.sort.factor":"10","yarn.nodemanager.amrmproxy.client.thread-count":"25","ha.failover-controller.new-active.rpc-timeout.ms":"60000","yarn.nodemanager.container-localizer.java.opts":"-Xmx256m","mapreduce.jobhistory.datestring.cache.size":"200000","mapreduce.job.acl-modify-job":" ","yarn.nodemanager.windows-container.memory-limit.enabled":"false","yarn.timeline-service.webapp.address":"${yarn.timeline-service.hostname}:8188","yarn.app.mapreduce.am.job.committer.commit-window":"10000","yarn.nodemanager.container-manager.thread-count":"20","yarn.minicluster.fixed.ports":"false","hadoop.tags.system":"YARN,HDFS,NAMENODE,DATANODE,REQUIRED,SECURITY,KERBEROS,PERFORMANCE,CLIENT\n ,SERVER,DEBUG,DEPRECATED,COMMON,OPTIONAL","yarn.cluster.max-application-priority":"0","yarn.timeline-service.ttl-enable":"true","mapreduce.jobhistory.recovery.store.fs.uri":"${hadoop.tmp.dir}/mapred/history/recoverystore","hadoop.caller.context.signature.max.size":"40","yarn.client.load.resource-types.from-server":"false","ha.zookeeper.session-timeout.ms":"10000","tfile.io.chunk.size":"1048576","fs.s3a.s3guard.ddb.table.capacity.write":"100","mapreduce.job.speculative.slowtaskthreshold":"1.0","io.serializations":"org.apache.hadoop.io.serializer.WritableSerialization, org.apache.hadoop.io.serializer.avro.AvroSpecificSerialization, org.apache.hadoop.io.serializer.avro.AvroReflectSerialization","hadoop.security.kms.client.failover.sleep.max.millis":"2000","hadoop.security.group.mapping.ldap.directory.search.timeout":"10000","yarn.scheduler.configuration.store.max-logs":"1000","yarn.nodemanager.node-attributes.provider.fetch-interval-ms":"600000","fs.swift.impl":"org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem","yarn.nodemanager.local-cache.max-files-per-directory":"8192","hadoop.http.cross-origin.enabled":"false","hadoop.zk.acl":"world:anyone:rwcda","mapreduce.map.sort.spill.percent":"0.80","yarn.timeline-service.entity-group-fs-store.scan-interval-seconds":"60","yarn.node-attribute.fs-store.impl.class":"org.apache.hadoop.yarn.server.resourcemanager.nodelabels.FileSystemNodeAttributeStore","fs.s3a.retry.interval":"500ms","yarn.timeline-service.client.best-effort":"false","yarn.resourcemanager.webapp.delegation-token-auth-filter.enabled":"*********(redacted)","hadoop.security.group.mapping.ldap.posix.attr.uid.name":"uidNumber","fs.AbstractFileSystem.swebhdfs.impl":"org.apache.hadoop.fs.SWebHdfs","yarn.nodemanager.elastic-memory-control.timeout-sec":"5","mapreduce.ifile.readahead":"true","yarn.timeline-service.leveldb-timeline-store.ttl-interval-ms":"300000","yarn.timeline-service.reader.webapp.address":"${yarn.timeline-service.webapp.address}","yarn.resourcemanager.placement-constraints.algorithm.pool-size":"1","yarn.timeline-service.hbase.coprocessor.jar.hdfs.location":"/hbase/coprocessor/hadoop-yarn-server-timelineservice.jar","hadoop.security.kms.client.encrypted.key.cache.num.refill.threads":"2","yarn.resourcemanager.scheduler.class":"org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler","yarn.app.mapreduce.am.command-opts":"-Xmx1024m","mapreduce.cluster.local.dir":"${hadoop.tmp.dir}/mapred/local","io.mapfile.bloom.error.rate":"0.005","fs.client.resolve.topology.enabled":"false","yarn.nodemanager.runtime.linux.allowed-runtimes":"default","yarn.sharedcache.store.class":"org.apache.hadoop.yarn.server.sharedcachemanager.store.InMemorySCMStore","ha.failover-controller.graceful-fence.rpc-timeout.ms":"5000","ftp.replication":"3","hadoop.security.uid.cache.secs":"14400","mapreduce.job.maxtaskfailures.per.tracker":"3","fs.s3a.metadatastore.impl":"org.apache.hadoop.fs.s3a.s3guard.NullMetadataStore","io.skip.checksum.errors":"false","yarn.app.mapreduce.client-am.ipc.max-retries-on-timeouts":"3","yarn.timeline-service.webapp.xfs-filter.xframe-options":"SAMEORIGIN","fs.s3a.connection.timeout":"200000","yarn.nodemanager.linux-container-executor.group":"tgraves","mapreduce.job.max.split.locations":"15","yarn.resourcemanager.nm-container-queuing.max-queue-length":"15","hadoop.registry.zk.session.timeout.ms":"60000","yarn.federation.cache-ttl.secs":"300","mapreduce.jvm.system-properties-to-log":"os.name,os.version,java.home,java.runtime.version,java.vendor,java.version,java.vm.name,java.class.path,java.io.tmpdir,user.dir,user.name","yarn.resourcemanager.opportunistic-container-allocation.nodes-used":"10","yarn.timeline-service.entity-group-fs-store.active-dir":"/tmp/entity-file-history/active","mapreduce.shuffle.transfer.buffer.size":"131072","yarn.timeline-service.client.retry-interval-ms":"1000","yarn.http.policy":"HTTP_ONLY","fs.s3a.socket.send.buffer":"8192","fs.AbstractFileSystem.abfss.impl":"org.apache.hadoop.fs.azurebfs.Abfss","yarn.sharedcache.uploader.server.address":"0.0.0.0:8046","yarn.resourcemanager.delegation-token.max-conf-size-bytes":"*********(redacted)","hadoop.http.authentication.token.validity":"*********(redacted)","mapreduce.shuffle.max.connections":"0","yarn.minicluster.yarn.nodemanager.resource.memory-mb":"4096","mapreduce.job.emit-timeline-data":"false","yarn.nodemanager.resource.system-reserved-memory-mb":"-1","hadoop.kerberos.min.seconds.before.relogin":"60","mapreduce.jobhistory.move.thread-count":"3","yarn.resourcemanager.admin.client.thread-count":"1","yarn.dispatcher.drain-events.timeout":"300000","fs.s3a.buffer.dir":"${hadoop.tmp.dir}/s3a","hadoop.ssl.enabled.protocols":"TLSv1,SSLv2Hello,TLSv1.1,TLSv1.2","mapreduce.jobhistory.admin.address":"0.0.0.0:10033","yarn.log-aggregation-status.time-out.ms":"600000","fs.s3a.assumed.role.sts.endpoint.region":"us-west-1","mapreduce.shuffle.port":"13562","yarn.resourcemanager.max-log-aggregation-diagnostics-in-memory":"10","yarn.nodemanager.health-checker.interval-ms":"600000","yarn.router.clientrm.interceptor-class.pipeline":"org.apache.hadoop.yarn.server.router.clientrm.DefaultClientRequestInterceptor","yarn.resourcemanager.zk-appid-node.split-index":"0","ftp.blocksize":"67108864","yarn.nodemanager.runtime.linux.sandbox-mode.local-dirs.permissions":"read","yarn.router.rmadmin.interceptor-class.pipeline":"org.apache.hadoop.yarn.server.router.rmadmin.DefaultRMAdminRequestInterceptor","yarn.nodemanager.log-container-debug-info.enabled":"true","yarn.client.max-cached-nodemanagers-proxies":"0","yarn.nodemanager.linux-container-executor.cgroups.delete-delay-ms":"20","yarn.nodemanager.delete.debug-delay-sec":"0","yarn.nodemanager.pmem-check-enabled":"true","yarn.nodemanager.disk-health-checker.max-disk-utilization-per-disk-percentage":"90.0","mapreduce.app-submission.cross-platform":"false","yarn.resourcemanager.work-preserving-recovery.scheduling-wait-ms":"10000","yarn.nodemanager.container-retry-minimum-interval-ms":"1000","hadoop.security.groups.cache.secs":"300","yarn.federation.enabled":"false","fs.azure.local.sas.key.mode":"false","ipc.maximum.data.length":"67108864","mapreduce.shuffle.max.threads":"0","yarn.router.pipeline.cache-max-size":"25","yarn.resourcemanager.nm-container-queuing.load-comparator":"QUEUE_LENGTH","hadoop.security.authorization":"false","mapreduce.job.complete.cancel.delegation.tokens":"*********(redacted)","fs.s3a.paging.maximum":"5000","nfs.exports.allowed.hosts":"* rw","yarn.nodemanager.amrmproxy.ha.enable":"false","mapreduce.jobhistory.http.policy":"HTTP_ONLY","yarn.sharedcache.store.in-memory.check-period-mins":"720","hadoop.security.group.mapping.ldap.ssl":"false","yarn.client.application-client-protocol.poll-interval-ms":"200","yarn.scheduler.configuration.leveldb-store.compaction-interval-secs":"86400","yarn.timeline-service.writer.class":"org.apache.hadoop.yarn.server.timelineservice.storage.HBaseTimelineWriterImpl","ha.zookeeper.parent-znode":"/hadoop-ha","yarn.nodemanager.log-aggregation.policy.class":"org.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation.AllContainerLogAggregationPolicy","mapreduce.reduce.shuffle.merge.percent":"0.66","hadoop.security.group.mapping.ldap.search.filter.group":"(objectClass=group)","yarn.resourcemanager.placement-constraints.scheduler.pool-size":"1","yarn.nodemanager.resourcemanager.minimum.version":"NONE","mapreduce.job.speculative.speculative-cap-running-tasks":"0.1","yarn.admin.acl":"*","yarn.nodemanager.recovery.supervised":"false","yarn.sharedcache.admin.thread-count":"1","yarn.resourcemanager.ha.automatic-failover.enabled":"true","mapreduce.reduce.skip.maxgroups":"0","mapreduce.reduce.shuffle.connect.timeout":"180000","yarn.resourcemanager.address":"${yarn.resourcemanager.hostname}:8032","ipc.client.ping":"true","mapreduce.task.local-fs.write-limit.bytes":"-1","fs.adl.oauth2.access.token.provider.type":"*********(redacted)","mapreduce.shuffle.ssl.file.buffer.size":"65536","yarn.resourcemanager.ha.automatic-failover.embedded":"true","yarn.nodemanager.resource-plugins.gpu.docker-plugin":"nvidia-docker-v1","hadoop.ssl.enabled":"false","fs.s3a.multipart.purge":"false","yarn.scheduler.configuration.store.class":"file","yarn.resourcemanager.nm-container-queuing.queue-limit-stdev":"1.0f","mapreduce.job.end-notification.max.attempts":"5","mapreduce.output.fileoutputformat.compress.codec":"org.apache.hadoop.io.compress.DefaultCodec","yarn.nodemanager.container-monitor.procfs-tree.smaps-based-rss.enabled":"false","ipc.client.bind.wildcard.addr":"false","yarn.resourcemanager.webapp.rest-csrf.enabled":"false","ha.health-monitor.connect-retry-interval.ms":"1000","yarn.nodemanager.keytab":"/etc/krb5.keytab","mapreduce.jobhistory.keytab":"/etc/security/keytab/jhs.service.keytab","fs.s3a.threads.max":"10","mapreduce.reduce.shuffle.input.buffer.percent":"0.70","yarn.nodemanager.runtime.linux.docker.allowed-container-networks":"host,none,bridge","yarn.nodemanager.node-labels.resync-interval-ms":"120000","hadoop.tmp.dir":"/tmp/hadoop-${user.name}","mapreduce.job.maps":"2","mapreduce.jobhistory.webapp.rest-csrf.custom-header":"X-XSRF-Header","mapreduce.job.end-notification.max.retry.interval":"5000","yarn.log-aggregation.retain-check-interval-seconds":"-1","yarn.resourcemanager.resource-tracker.client.thread-count":"50","yarn.rm.system-metrics-publisher.emit-container-events":"false","yarn.timeline-service.leveldb-timeline-store.start-time-read-cache-size":"10000","yarn.resourcemanager.ha.automatic-failover.zk-base-path":"/yarn-leader-election","io.seqfile.local.dir":"${hadoop.tmp.dir}/io/local","fs.s3a.s3guard.ddb.throttle.retry.interval":"100ms","fs.AbstractFileSystem.wasb.impl":"org.apache.hadoop.fs.azure.Wasb","mapreduce.client.submit.file.replication":"10","mapreduce.jobhistory.minicluster.fixed.ports":"false","fs.s3a.multipart.threshold":"2147483647","yarn.resourcemanager.webapp.xfs-filter.xframe-options":"SAMEORIGIN","mapreduce.jobhistory.done-dir":"${yarn.app.mapreduce.am.staging-dir}/history/done","ipc.client.idlethreshold":"4000","yarn.nodemanager.linux-container-executor.cgroups.strict-resource-usage":"false","mapreduce.reduce.input.buffer.percent":"0.0","yarn.nodemanager.runtime.linux.docker.userremapping-gid-threshold":"1","yarn.nodemanager.webapp.rest-csrf.enabled":"false","fs.ftp.host.port":"21","ipc.ping.interval":"60000","yarn.resourcemanager.history-writer.multi-threaded-dispatcher.pool-size":"10","yarn.resourcemanager.admin.address":"${yarn.resourcemanager.hostname}:8033","file.client-write-packet-size":"65536","ipc.client.kill.max":"10","mapreduce.reduce.speculative":"true","hadoop.security.key.default.bitlength":"128","mapreduce.job.reducer.unconditional-preempt.delay.sec":"300","yarn.nodemanager.disk-health-checker.interval-ms":"120000","yarn.nodemanager.log.deletion-threads-count":"4","yarn.webapp.filter-entity-list-by-user":"false","ipc.client.connection.maxidletime":"10000","mapreduce.task.io.sort.mb":"100","yarn.nodemanager.localizer.client.thread-count":"5","io.erasurecode.codec.rs.rawcoders":"rs_native,rs_java","io.erasurecode.codec.rs-legacy.rawcoders":"rs-legacy_java","yarn.sharedcache.admin.address":"0.0.0.0:8047","yarn.resourcemanager.placement-constraints.algorithm.iterator":"SERIAL","yarn.nodemanager.localizer.cache.cleanup.interval-ms":"600000","hadoop.security.crypto.codec.classes.aes.ctr.nopadding":"org.apache.hadoop.crypto.OpensslAesCtrCryptoCodec, org.apache.hadoop.crypto.JceAesCtrCryptoCodec","mapreduce.job.cache.limit.max-resources-mb":"0","fs.s3a.connection.ssl.enabled":"true","yarn.nodemanager.process-kill-wait.ms":"5000","mapreduce.job.hdfs-servers":"${fs.defaultFS}","hadoop.workaround.non.threadsafe.getpwuid":"true","fs.df.interval":"60000","yarn.scheduler.capacity.resource-calculator":"org.apache.hadoop.yarn.util.resource.DominantResourceCalculator","fs.s3a.multiobjectdelete.enable":"true","yarn.sharedcache.cleaner.resource-sleep-ms":"0","yarn.nodemanager.disk-health-checker.min-healthy-disks":"0.25","hadoop.shell.missing.defaultFs.warning":"false","io.file.buffer.size":"65536","hadoop.security.group.mapping.ldap.search.attr.member":"member","hadoop.security.random.device.file.path":"/dev/urandom","hadoop.security.sensitive-config-keys":"*********(redacted)","fs.s3a.s3guard.ddb.max.retries":"9","hadoop.rpc.socket.factory.class.default":"org.apache.hadoop.net.StandardSocketFactory","yarn.intermediate-data-encryption.enable":"false","yarn.resourcemanager.connect.retry-interval.ms":"30000","yarn.nodemanager.container.stderr.pattern":"{*stderr*,*STDERR*}","yarn.scheduler.minimum-allocation-mb":"1024","yarn.app.mapreduce.am.staging-dir":"/tmp/hadoop-yarn/staging","mapreduce.reduce.shuffle.read.timeout":"180000","hadoop.http.cross-origin.max-age":"1800","io.erasurecode.codec.xor.rawcoders":"xor_native,xor_java","fs.s3a.connection.establish.timeout":"5000","mapreduce.job.running.map.limit":"0","yarn.minicluster.control-resource-monitoring":"false","hadoop.ssl.require.client.cert":"false","hadoop.kerberos.kinit.command":"kinit","yarn.federation.state-store.class":"org.apache.hadoop.yarn.server.federation.store.impl.MemoryFederationStateStore","mapreduce.reduce.log.level":"INFO","hadoop.security.dns.log-slow-lookups.threshold.ms":"1000","mapreduce.job.ubertask.enable":"false","adl.http.timeout":"-1","yarn.resourcemanager.placement-constraints.retry-attempts":"3","hadoop.caller.context.enabled":"false","yarn.nodemanager.vmem-pmem-ratio":"2.1","hadoop.rpc.protection":"authentication","ha.health-monitor.rpc-timeout.ms":"45000","yarn.nodemanager.remote-app-log-dir":"/tmp/logs","hadoop.zk.timeout-ms":"10000","fs.s3a.s3guard.cli.prune.age":"86400000","yarn.nodemanager.resource.pcores-vcores-multiplier":"1.0","yarn.nodemanager.runtime.linux.sandbox-mode":"disabled","yarn.app.mapreduce.am.containerlauncher.threadpool-initial-size":"10","fs.s3a.committer.threads":"8","hadoop.zk.retry-interval-ms":"1000","hadoop.security.crypto.buffer.size":"8192","yarn.nodemanager.node-labels.provider.fetch-interval-ms":"600000","mapreduce.jobhistory.recovery.store.leveldb.path":"${hadoop.tmp.dir}/mapred/history/recoverystore","yarn.client.failover-retries-on-socket-timeouts":"0","yarn.nodemanager.resource.memory.enabled":"false","fs.azure.authorization.caching.enable":"true","hadoop.security.instrumentation.requires.admin":"false","yarn.nodemanager.delete.thread-count":"4","mapreduce.job.finish-when-all-reducers-done":"true","hadoop.registry.jaas.context":"Client","yarn.timeline-service.leveldb-timeline-store.path":"${hadoop.tmp.dir}/yarn/timeline","io.map.index.interval":"128","yarn.resourcemanager.nm-container-queuing.max-queue-wait-time-ms":"100","fs.abfs.impl":"org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem","mapreduce.job.counters.max":"120","mapreduce.jobhistory.webapp.rest-csrf.enabled":"false","yarn.timeline-service.store-class":"org.apache.hadoop.yarn.server.timeline.LeveldbTimelineStore","mapreduce.jobhistory.move.interval-ms":"180000","yarn.nodemanager.localizer.fetch.thread-count":"4","yarn.resourcemanager.scheduler.client.thread-count":"50","hadoop.ssl.hostname.verifier":"DEFAULT","yarn.timeline-service.leveldb-state-store.path":"${hadoop.tmp.dir}/yarn/timeline","mapreduce.job.classloader":"false","mapreduce.task.profile.map.params":"${mapreduce.task.profile.params}","ipc.client.connect.timeout":"20000","hadoop.security.auth_to_local.mechanism":"hadoop","yarn.timeline-service.app-collector.linger-period.ms":"60000","yarn.nm.liveness-monitor.expiry-interval-ms":"600000","yarn.resourcemanager.reservation-system.planfollower.time-step":"1000","yarn.nodemanager.runtime.linux.docker.enable-userremapping.allowed":"true","yarn.webapp.api-service.enable":"false","yarn.nodemanager.recovery.enabled":"false","mapreduce.job.end-notification.retry.interval":"1000","fs.du.interval":"600000","fs.ftp.impl":"org.apache.hadoop.fs.ftp.FTPFileSystem","yarn.nodemanager.container.stderr.tail.bytes":"4096","hadoop.security.group.mapping.ldap.read.timeout.ms":"60000","mapreduce.map.env":"HADOOP_MAPRED_HOME=/home/tgraves/runspace/hadoop/lce/hadoop-3.1.2","hadoop.security.groups.cache.warn.after.ms":"5000","file.bytes-per-checksum":"512","mapreduce.outputcommitter.factory.scheme.s3a":"org.apache.hadoop.fs.s3a.commit.S3ACommitterFactory","hadoop.security.groups.cache.background.reload":"false","yarn.nodemanager.container-monitor.enabled":"true","yarn.nodemanager.elastic-memory-control.enabled":"false","net.topology.script.number.args":"100","mapreduce.task.merge.progress.records":"10000","yarn.nodemanager.localizer.address":"${yarn.nodemanager.hostname}:8040","yarn.timeline-service.keytab":"/etc/krb5.keytab","mapreduce.reduce.shuffle.fetch.retry.timeout-ms":"30000","yarn.resourcemanager.rm.container-allocation.expiry-interval-ms":"600000","mapreduce.fileoutputcommitter.algorithm.version":"2","yarn.resourcemanager.work-preserving-recovery.enabled":"true","mapreduce.map.skip.maxrecords":"0","yarn.sharedcache.root-dir":"/sharedcache","fs.s3a.retry.throttle.limit":"${fs.s3a.attempts.maximum}","hadoop.http.authentication.type":"simple","mapreduce.job.cache.limit.max-resources":"0","mapreduce.task.userlog.limit.kb":"0","yarn.resourcemanager.scheduler.monitor.enable":"false","ipc.client.connect.max.retries":"10","hadoop.registry.zk.retry.times":"5","yarn.nodemanager.resource-monitor.interval-ms":"3000","yarn.nodemanager.resource-plugins.gpu.allowed-gpu-devices":"auto","mapreduce.job.sharedcache.mode":"disabled","yarn.nodemanager.webapp.rest-csrf.custom-header":"X-XSRF-Header","mapreduce.shuffle.listen.queue.size":"128","yarn.scheduler.configuration.mutation.acl-policy.class":"org.apache.hadoop.yarn.server.resourcemanager.scheduler.DefaultConfigurationMutationACLPolicy","mapreduce.map.cpu.vcores":"1","yarn.log-aggregation.file-formats":"TFile","yarn.timeline-service.client.fd-retain-secs":"300","hadoop.user.group.static.mapping.overrides":"dr.who=;","fs.azure.sas.expiry.period":"90d","mapreduce.jobhistory.recovery.store.class":"org.apache.hadoop.mapreduce.v2.hs.HistoryServerFileSystemStateStoreService","yarn.resourcemanager.fail-fast":"${yarn.fail-fast}","yarn.resourcemanager.proxy-user-privileges.enabled":"false","yarn.router.webapp.interceptor-class.pipeline":"org.apache.hadoop.yarn.server.router.webapp.DefaultRequestInterceptorREST","yarn.nodemanager.resource.memory.cgroups.soft-limit-percentage":"90.0","mapreduce.job.reducer.preempt.delay.sec":"0","hadoop.util.hash.type":"murmur","yarn.nodemanager.disk-validator":"basic","yarn.app.mapreduce.client.job.max-retries":"3","mapreduce.reduce.shuffle.retry-delay.max.ms":"60000","hadoop.security.group.mapping.ldap.connection.timeout.ms":"60000","mapreduce.task.profile.params":"-agentlib:hprof=cpu=samples,heap=sites,force=n,thread=y,verbose=n,file=%s","yarn.app.mapreduce.shuffle.log.backups":"0","yarn.nodemanager.container-diagnostics-maximum-size":"10000","hadoop.registry.zk.retry.interval.ms":"1000","yarn.nodemanager.linux-container-executor.cgroups.delete-timeout-ms":"1000","fs.AbstractFileSystem.file.impl":"org.apache.hadoop.fs.local.LocalFs","yarn.nodemanager.log-aggregation.roll-monitoring-interval-seconds":"-1","mapreduce.jobhistory.cleaner.interval-ms":"86400000","hadoop.registry.zk.quorum":"localhost:2181","mapreduce.output.fileoutputformat.compress":"false","yarn.resourcemanager.am-rm-tokens.master-key-rolling-interval-secs":"*********(redacted)","fs.s3a.assumed.role.session.duration":"30m","hadoop.security.group.mapping.ldap.conversion.rule":"none","hadoop.ssl.server.conf":"ssl-server.xml","fs.s3a.retry.throttle.interval":"1000ms","seq.io.sort.factor":"100","yarn.sharedcache.cleaner.initial-delay-mins":"10","mapreduce.client.completion.pollinterval":"5000","hadoop.ssl.keystores.factory.class":"org.apache.hadoop.security.ssl.FileBasedKeyStoresFactory","yarn.app.mapreduce.am.resource.cpu-vcores":"1","yarn.timeline-service.enabled":"false","yarn.nodemanager.runtime.linux.docker.capabilities":"CHOWN,DAC_OVERRIDE,FSETID,FOWNER,MKNOD,NET_RAW,SETGID,SETUID,SETFCAP,SETPCAP,NET_BIND_SERVICE,SYS_CHROOT,KILL,AUDIT_WRITE","yarn.acl.enable":"false","yarn.timeline-service.entity-group-fs-store.done-dir":"/tmp/entity-file-history/done/","mapreduce.task.profile":"false","yarn.resourcemanager.fs.state-store.uri":"${hadoop.tmp.dir}/yarn/system/rmstore","mapreduce.jobhistory.always-scan-user-dir":"false","yarn.nodemanager.opportunistic-containers-use-pause-for-preemption":"false","yarn.nodemanager.linux-container-executor.nonsecure-mode.local-user":"nobody","yarn.timeline-service.reader.class":"org.apache.hadoop.yarn.server.timelineservice.storage.HBaseTimelineReaderImpl","yarn.resourcemanager.configuration.provider-class":"org.apache.hadoop.yarn.LocalConfigurationProvider","yarn.nodemanager.runtime.linux.docker.userremapping-uid-threshold":"1","yarn.resourcemanager.configuration.file-system-based-store":"/yarn/conf","mapreduce.job.cache.limit.max-single-resource-mb":"0","yarn.nodemanager.runtime.linux.docker.stop.grace-period":"10","yarn.resourcemanager.resource-profiles.source-file":"resource-profiles.json","yarn.nodemanager.resource.percentage-physical-cpu-limit":"100","mapreduce.jobhistory.client.thread-count":"10","tfile.fs.input.buffer.size":"262144","mapreduce.client.progressmonitor.pollinterval":"1000","yarn.nodemanager.log-dirs":"${yarn.log.dir}/userlogs","fs.automatic.close":"true","yarn.nodemanager.hostname":"0.0.0.0","yarn.nodemanager.resource.memory.cgroups.swappiness":"0","ftp.stream-buffer-size":"4096","yarn.fail-fast":"false","yarn.timeline-service.app-aggregation-interval-secs":"15","hadoop.security.group.mapping.ldap.search.filter.user":"(&(objectClass=user)(sAMAccountName={0}))","yarn.nodemanager.container-localizer.log.level":"INFO","yarn.timeline-service.address":"${yarn.timeline-service.hostname}:10200","mapreduce.job.ubertask.maxmaps":"9","fs.s3a.threads.keepalivetime":"60","mapreduce.jobhistory.webapp.rest-csrf.methods-to-ignore":"GET,OPTIONS,HEAD","mapreduce.task.files.preserve.failedtasks":"false","yarn.app.mapreduce.client.job.retry-interval":"2000","ha.failover-controller.graceful-fence.connection.retries":"1","yarn.resourcemanager.delegation.token.max-lifetime":"*********(redacted)","yarn.timeline-service.client.drain-entities.timeout.ms":"2000","yarn.nodemanager.resource-plugins.fpga.vendor-plugin.class":"org.apache.hadoop.yarn.server.nodemanager.containermanager.resourceplugin.fpga.IntelFpgaOpenclPlugin","yarn.timeline-service.entity-group-fs-store.summary-store":"org.apache.hadoop.yarn.server.timeline.LeveldbTimelineStore","mapreduce.reduce.cpu.vcores":"1","mapreduce.job.encrypted-intermediate-data.buffer.kb":"128","fs.client.resolve.remote.symlinks":"true","yarn.nodemanager.webapp.https.address":"0.0.0.0:8044","hadoop.http.cross-origin.allowed-origins":"*","mapreduce.job.encrypted-intermediate-data":"false","yarn.timeline-service.entity-group-fs-store.retain-seconds":"604800","yarn.resourcemanager.metrics.runtime.buckets":"60,300,1440","yarn.timeline-service.generic-application-history.max-applications":"10000","yarn.nodemanager.local-dirs":"${hadoop.tmp.dir}/nm-local-dir","mapreduce.shuffle.connection-keep-alive.enable":"false","yarn.node-labels.configuration-type":"centralized","fs.s3a.path.style.access":"false","yarn.nodemanager.aux-services.mapreduce_shuffle.class":"org.apache.hadoop.mapred.ShuffleHandler","yarn.sharedcache.store.in-memory.staleness-period-mins":"10080","fs.adl.impl":"org.apache.hadoop.fs.adl.AdlFileSystem","yarn.resourcemanager.nodemanager.minimum.version":"NONE","mapreduce.jobhistory.webapp.xfs-filter.xframe-options":"SAMEORIGIN","yarn.app.mapreduce.am.staging-dir.erasurecoding.enabled":"false","net.topology.impl":"org.apache.hadoop.net.NetworkTopology","io.map.index.skip":"0","yarn.timeline-service.reader.webapp.https.address":"${yarn.timeline-service.webapp.https.address}","fs.ftp.data.connection.mode":"ACTIVE_LOCAL_DATA_CONNECTION_MODE","mapreduce.job.local-fs.single-disk-limit.check.kill-limit-exceed":"true","yarn.scheduler.maximum-allocation-vcores":"4","hadoop.http.cross-origin.allowed-headers":"X-Requested-With,Content-Type,Accept,Origin","yarn.nodemanager.log-aggregation.compression-type":"none","yarn.timeline-service.version":"1.0f","yarn.ipc.rpc.class":"org.apache.hadoop.yarn.ipc.HadoopYarnProtoRPC","mapreduce.reduce.maxattempts":"4","hadoop.security.dns.log-slow-lookups.enabled":"false","mapreduce.job.committer.setup.cleanup.needed":"true","mapreduce.job.running.reduce.limit":"0","ipc.maximum.response.length":"134217728","yarn.resourcemanager.webapp.rest-csrf.methods-to-ignore":"GET,OPTIONS,HEAD","mapreduce.job.token.tracking.ids.enabled":"*********(redacted)","hadoop.caller.context.max.size":"128","yarn.nodemanager.runtime.linux.docker.host-pid-namespace.allowed":"false","yarn.nodemanager.runtime.linux.docker.delayed-removal.allowed":"false","hadoop.registry.system.acls":"sasl:yarn@, sasl:mapred@, sasl:hdfs@","yarn.nodemanager.recovery.dir":"${hadoop.tmp.dir}/yarn-nm-recovery","fs.s3a.fast.upload.buffer":"disk","mapreduce.jobhistory.intermediate-done-dir":"${yarn.app.mapreduce.am.staging-dir}/history/done_intermediate","yarn.app.mapreduce.shuffle.log.separate":"true","fs.s3a.max.total.tasks":"5","fs.s3a.readahead.range":"64K","hadoop.http.authentication.simple.anonymous.allowed":"true","yarn.nodemanager.aux-services.spark_shuffle.class":"org.apache.spark.network.yarn.YarnShuffleService","fs.s3a.attempts.maximum":"20","hadoop.registry.zk.connection.timeout.ms":"15000","yarn.resourcemanager.delegation-token-renewer.thread-count":"*********(redacted)","yarn.nodemanager.health-checker.script.timeout-ms":"1200000","yarn.timeline-service.leveldb-timeline-store.start-time-write-cache-size":"10000","yarn.resourcemanager.resource-profiles.enabled":"false","yarn.timeline-service.hbase-schema.prefix":"prod.","fs.azure.authorization":"false","mapreduce.map.log.level":"INFO","yarn.resourcemanager.decommissioning-nodes-watcher.poll-interval-secs":"20","mapreduce.output.fileoutputformat.compress.type":"RECORD","yarn.resourcemanager.leveldb-state-store.path":"${hadoop.tmp.dir}/yarn/system/rmstore","yarn.timeline-service.webapp.rest-csrf.custom-header":"X-XSRF-Header","mapreduce.ifile.readahead.bytes":"4194304","yarn.sharedcache.app-checker.class":"org.apache.hadoop.yarn.server.sharedcachemanager.RemoteAppChecker","yarn.nodemanager.linux-container-executor.nonsecure-mode.limit-users":"false","yarn.nodemanager.resource.detect-hardware-capabilities":"false","mapreduce.cluster.acls.enabled":"false","mapreduce.job.speculative.retry-after-no-speculate":"1000","hadoop.security.group.mapping.ldap.search.group.hierarchy.levels":"0","yarn.resourcemanager.fs.state-store.retry-interval-ms":"1000","file.stream-buffer-size":"4096","yarn.resourcemanager.application-timeouts.monitor.interval-ms":"3000","mapreduce.map.output.compress.codec":"org.apache.hadoop.io.compress.DefaultCodec","mapreduce.map.speculative":"true","mapreduce.job.speculative.retry-after-speculate":"15000","yarn.nodemanager.linux-container-executor.cgroups.mount":"true","yarn.app.mapreduce.am.container.log.backups":"0","yarn.app.mapreduce.am.log.level":"INFO","mapreduce.job.reduce.slowstart.completedmaps":"0.05","yarn.timeline-service.http-authentication.type":"simple","hadoop.security.group.mapping.ldap.search.attr.group.name":"cn","yarn.nodemanager.resource-plugins.fpga.allowed-fpga-devices":"0,1","yarn.timeline-service.client.internal-timers-ttl-secs":"420","hadoop.http.logs.enabled":"true","fs.s3a.block.size":"32M","yarn.sharedcache.client-server.address":"0.0.0.0:8045","yarn.nodemanager.logaggregation.threadpool-size-max":"100","yarn.resourcemanager.hostname":"0.0.0.0","yarn.resourcemanager.delegation.key.update-interval":"86400000","mapreduce.reduce.shuffle.fetch.retry.enabled":"${yarn.nodemanager.recovery.enabled}","mapreduce.map.memory.mb":"-1","mapreduce.task.skip.start.attempts":"2","fs.AbstractFileSystem.hdfs.impl":"org.apache.hadoop.fs.Hdfs","yarn.nodemanager.disk-health-checker.enable":"true","ipc.client.tcpnodelay":"true","ipc.client.rpc-timeout.ms":"0","yarn.nodemanager.webapp.rest-csrf.methods-to-ignore":"GET,OPTIONS,HEAD","ipc.client.low-latency":"false","mapreduce.input.lineinputformat.linespermap":"1","yarn.router.interceptor.user.threadpool-size":"5","ipc.client.connect.max.retries.on.timeouts":"45","yarn.timeline-service.leveldb-timeline-store.read-cache-size":"104857600","fs.AbstractFileSystem.har.impl":"org.apache.hadoop.fs.HarFs","mapreduce.job.split.metainfo.maxsize":"10000000","yarn.am.liveness-monitor.expiry-interval-ms":"600000","yarn.resourcemanager.container-tokens.master-key-rolling-interval-secs":"*********(redacted)","yarn.timeline-service.entity-group-fs-store.app-cache-size":"10","fs.s3a.socket.recv.buffer":"8192","yarn.resourcemanager.resource-tracker.address":"${yarn.resourcemanager.hostname}:8031","yarn.nodemanager.node-labels.provider.fetch-timeout-ms":"1200000","mapreduce.job.heap.memory-mb.ratio":"0.8","yarn.resourcemanager.leveldb-state-store.compaction-interval-secs":"3600","yarn.resourcemanager.webapp.rest-csrf.custom-header":"X-XSRF-Header","yarn.scheduler.configuration.fs.path":"file://${hadoop.tmp.dir}/yarn/system/schedconf","mapreduce.client.output.filter":"FAILED","hadoop.http.filter.initializers":"org.apache.hadoop.http.lib.StaticUserWebFilter","mapreduce.reduce.memory.mb":"-1","yarn.timeline-service.hostname":"0.0.0.0","file.replication":"1","yarn.nodemanager.container-metrics.unregister-delay-ms":"10000","yarn.nodemanager.container-metrics.period-ms":"-1","mapreduce.fileoutputcommitter.task.cleanup.enabled":"false","yarn.nodemanager.log.retain-seconds":"10800","yarn.timeline-service.entity-group-fs-store.cleaner-interval-seconds":"3600","yarn.resourcemanager.keytab":"/etc/krb5.keytab","hadoop.security.group.mapping.providers.combined":"true","mapreduce.reduce.merge.inmem.threshold":"1000","yarn.timeline-service.recovery.enabled":"false","fs.azure.saskey.usecontainersaskeyforallaccess":"true","yarn.sharedcache.nm.uploader.thread-count":"20","yarn.resourcemanager.nodemanager-graceful-decommission-timeout-secs":"3600","mapreduce.shuffle.ssl.enabled":"false","yarn.timeline-service.hbase.coprocessor.app-final-value-retention-milliseconds":"259200000","fs.s3a.committer.staging.abort.pending.uploads":"true","yarn.nodemanager.opportunistic-containers-max-queue-length":"0","yarn.resourcemanager.state-store.max-completed-applications":"${yarn.resourcemanager.max-completed-applications}","mapreduce.job.speculative.minimum-allowed-tasks":"10","yarn.log-aggregation.retain-seconds":"-1","yarn.nodemanager.disk-health-checker.min-free-space-per-disk-mb":"0","mapreduce.jobhistory.max-age-ms":"604800000","hadoop.http.cross-origin.allowed-methods":"GET,POST,HEAD","yarn.resourcemanager.opportunistic-container-allocation.enabled":"false","mapreduce.jobhistory.webapp.address":"0.0.0.0:19888","hadoop.system.tags":"YARN,HDFS,NAMENODE,DATANODE,REQUIRED,SECURITY,KERBEROS,PERFORMANCE,CLIENT\n ,SERVER,DEBUG,DEPRECATED,COMMON,OPTIONAL","yarn.log-aggregation.file-controller.TFile.class":"org.apache.hadoop.yarn.logaggregation.filecontroller.tfile.LogAggregationTFileController","yarn.client.nodemanager-connect.max-wait-ms":"180000","yarn.resourcemanager.webapp.address":"${yarn.resourcemanager.hostname}:8088","mapreduce.jobhistory.recovery.enable":"false","mapreduce.reduce.shuffle.parallelcopies":"5","fs.AbstractFileSystem.webhdfs.impl":"org.apache.hadoop.fs.WebHdfs","fs.trash.interval":"0","yarn.app.mapreduce.client.max-retries":"3","hadoop.security.authentication":"simple","mapreduce.task.profile.reduce.params":"${mapreduce.task.profile.params}","yarn.app.mapreduce.am.resource.mb":"1536","mapreduce.input.fileinputformat.list-status.num-threads":"1","yarn.nodemanager.container-executor.class":"org.apache.hadoop.yarn.server.nodemanager.LinuxContainerExecutor","io.mapfile.bloom.size":"1048576","yarn.timeline-service.ttl-ms":"604800000","yarn.resourcemanager.nm-container-queuing.min-queue-length":"5","yarn.nodemanager.resource.cpu-vcores":"-1","mapreduce.job.reduces":"1","fs.s3a.multipart.size":"100M","yarn.scheduler.minimum-allocation-vcores":"1","mapreduce.job.speculative.speculative-cap-total-tasks":"0.01","hadoop.ssl.client.conf":"ssl-client.xml","mapreduce.job.queuename":"default","mapreduce.job.encrypted-intermediate-data-key-size-bits":"128","fs.s3a.metadatastore.authoritative":"false","yarn.nodemanager.webapp.xfs-filter.xframe-options":"SAMEORIGIN","ha.health-monitor.sleep-after-disconnect.ms":"1000","yarn.app.mapreduce.shuffle.log.limit.kb":"0","hadoop.security.group.mapping":"org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback","yarn.client.application-client-protocol.poll-timeout-ms":"-1","mapreduce.jobhistory.jhist.format":"binary","yarn.resourcemanager.ha.enabled":"false","hadoop.http.staticuser.user":"dr.who","mapreduce.task.exit.timeout.check-interval-ms":"20000","mapreduce.jobhistory.intermediate-user-done-dir.permissions":"770","mapreduce.task.exit.timeout":"60000","yarn.nodemanager.linux-container-executor.resources-handler.class":"org.apache.hadoop.yarn.server.nodemanager.util.DefaultLCEResourcesHandler","mapreduce.reduce.shuffle.memory.limit.percent":"0.25","yarn.resourcemanager.reservation-system.enable":"false","mapreduce.map.output.compress":"false","ha.zookeeper.acl":"world:anyone:rwcda","ipc.server.max.connections":"0","yarn.nodemanager.aux-services":"mapreduce_shuffle,spark_shuffle","yarn.nodemanager.runtime.linux.docker.default-container-network":"host","yarn.router.webapp.address":"0.0.0.0:8089","yarn.scheduler.maximum-allocation-mb":"8192","yarn.resourcemanager.scheduler.monitor.policies":"org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicy","yarn.sharedcache.cleaner.period-mins":"1440","yarn.nodemanager.resource-plugins.gpu.docker-plugin.nvidia-docker-v1.endpoint":"http://localhost:3476/v1.0/docker/cli","yarn.app.mapreduce.am.container.log.limit.kb":"0","ipc.client.connect.retry.interval":"1000","yarn.timeline-service.http-cross-origin.enabled":"false","fs.wasbs.impl":"org.apache.hadoop.fs.azure.NativeAzureFileSystem$Secure","yarn.federation.subcluster-resolver.class":"org.apache.hadoop.yarn.server.federation.resolver.DefaultSubClusterResolverImpl","yarn.resourcemanager.zk-state-store.parent-path":"/rmstore","mapreduce.jobhistory.cleaner.enable":"true","yarn.timeline-service.client.fd-flush-interval-secs":"10","hadoop.security.kms.client.encrypted.key.cache.expiry":"43200000","yarn.client.nodemanager-client-async.thread-pool-max-size":"500","mapreduce.map.maxattempts":"4","yarn.resourcemanager.nm-container-queuing.sorting-nodes-interval-ms":"1000","fs.s3a.committer.staging.tmp.path":"tmp/staging","yarn.nodemanager.sleep-delay-before-sigkill.ms":"250","yarn.resourcemanager.nm-container-queuing.min-queue-wait-time-ms":"10","mapreduce.job.end-notification.retry.attempts":"0","yarn.nodemanager.resource.count-logical-processors-as-cores":"false","hadoop.registry.zk.root":"/registry","adl.feature.ownerandgroup.enableupn":"false","yarn.resourcemanager.zk-max-znode-size.bytes":"1048576","mapreduce.job.reduce.shuffle.consumer.plugin.class":"org.apache.hadoop.mapreduce.task.reduce.Shuffle","yarn.resourcemanager.delayed.delegation-token.removal-interval-ms":"*********(redacted)","yarn.nodemanager.localizer.cache.target-size-mb":"10240","fs.s3a.committer.staging.conflict-mode":"fail","mapreduce.client.libjars.wildcard":"true","fs.s3a.committer.staging.unique-filenames":"true","yarn.nodemanager.node-attributes.provider.fetch-timeout-ms":"1200000","fs.s3a.list.version":"2","ftp.client-write-packet-size":"65536","fs.AbstractFileSystem.adl.impl":"org.apache.hadoop.fs.adl.Adl","hadoop.security.key.default.cipher":"AES/CTR/NoPadding","yarn.client.failover-retries":"0","fs.s3a.multipart.purge.age":"86400","mapreduce.job.local-fs.single-disk-limit.check.interval-ms":"5000","net.topology.node.switch.mapping.impl":"org.apache.hadoop.net.ScriptBasedMapping","yarn.nodemanager.amrmproxy.address":"0.0.0.0:8049","ipc.server.listen.queue.size":"128","map.sort.class":"org.apache.hadoop.util.QuickSort","fs.viewfs.rename.strategy":"SAME_MOUNTPOINT","hadoop.security.kms.client.authentication.retry-count":"1","fs.permissions.umask-mode":"022","fs.s3a.assumed.role.credentials.provider":"org.apache.hadoop.fs.s3a.SimpleAWSCredentialsProvider","yarn.nodemanager.vmem-check-enabled":"false","yarn.nodemanager.numa-awareness.enabled":"false","yarn.nodemanager.recovery.compaction-interval-secs":"3600","yarn.app.mapreduce.client-am.ipc.max-retries":"3","yarn.federation.registry.base-dir":"yarnfederation/","mapreduce.job.max.map":"-1","mapreduce.job.local-fs.single-disk-limit.bytes":"-1","mapreduce.job.ubertask.maxreduces":"1","hadoop.security.kms.client.encrypted.key.cache.size":"500","hadoop.security.java.secure.random.algorithm":"SHA1PRNG","ha.failover-controller.cli-check.rpc-timeout.ms":"20000","mapreduce.jobhistory.jobname.limit":"50","mapreduce.application.classpath":"$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/*:$HADOOP_MAPRED_HOME/share/hadoop/mapreduce/lib/*","yarn.client.nodemanager-connect.retry-interval-ms":"10000","yarn.timeline-service.state-store-class":"org.apache.hadoop.yarn.server.timeline.recovery.LeveldbTimelineStateStore","yarn.nodemanager.env-whitelist":"JAVA_HOME,HADOOP_COMMON_HOME,HADOOP_HDFS_HOME,HADOOP_CONF_DIR,CLASSPATH_PREPEND_DISTCACHE,HADOOP_YARN_HOME,HADOOP_HOME,PATH,LANG,TZ","yarn.sharedcache.nested-level":"3","yarn.timeline-service.webapp.rest-csrf.methods-to-ignore":"GET,OPTIONS,HEAD","fs.azure.user.agent.prefix":"unknown","yarn.resourcemanager.zk-delegation-token-node.split-index":"*********(redacted)","yarn.nodemanager.numa-awareness.read-topology":"false","yarn.nodemanager.webapp.address":"${yarn.nodemanager.hostname}:8042","rpc.metrics.quantile.enable":"false","yarn.registry.class":"org.apache.hadoop.registry.client.impl.FSRegistryOperationsService","mapreduce.jobhistory.admin.acl":"*","yarn.resourcemanager.system-metrics-publisher.dispatcher.pool-size":"10","yarn.scheduler.queue-placement-rules":"user-group","hadoop.http.authentication.kerberos.keytab":"${user.home}/hadoop.keytab","yarn.resourcemanager.recovery.enabled":"false","yarn.timeline-service.webapp.rest-csrf.enabled":"false"},"System Properties":{"java.io.tmpdir":"/tmp","line.separator":"\n","path.separator":":","sun.management.compiler":"HotSpot 64-Bit Tiered Compilers","SPARK_SUBMIT":"true","sun.cpu.endian":"little","java.specification.version":"1.8","java.vm.specification.name":"Java Virtual Machine Specification","java.vendor":"Oracle Corporation","java.vm.specification.version":"1.8","user.home":"/home/tgraves","file.encoding.pkg":"sun.io","sun.nio.ch.bugLevel":"","sun.arch.data.model":"64","sun.boot.library.path":"/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64","user.dir":"/home/tgraves/workspace/tgravescs-spark","java.library.path":"/usr/java/packages/lib/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib","sun.cpu.isalist":"","sun.desktop":"gnome","os.arch":"amd64","java.vm.version":"25.212-b03","jetty.git.hash":"e1bc35120a6617ee3df052294e433f3a25ce7097","java.endorsed.dirs":"/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/endorsed","java.runtime.version":"1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03","java.vm.info":"mixed mode","java.ext.dirs":"/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/usr/java/packages/lib/ext","java.runtime.name":"OpenJDK Runtime Environment","file.separator":"/","java.class.version":"52.0","scala.usejavacp":"true","java.specification.name":"Java Platform API Specification","sun.boot.class.path":"/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/resources.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/rt.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jsse.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jce.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/charsets.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jfr.jar:/usr/lib/jvm/java-8-openjdk-amd64/jre/classes","file.encoding":"UTF-8","user.timezone":"America/Chicago","java.specification.vendor":"Oracle Corporation","sun.java.launcher":"SUN_STANDARD","os.version":"4.15.0-46-generic","sun.os.patch.level":"unknown","java.vm.specification.vendor":"Oracle Corporation","user.country":"US","sun.jnu.encoding":"UTF-8","user.language":"en","java.vendor.url":"http://java.oracle.com/","java.awt.printerjob":"sun.print.PSPrinterJob","java.awt.graphicsenv":"sun.awt.X11GraphicsEnvironment","awt.toolkit":"sun.awt.X11.XToolkit","os.name":"Linux","java.vm.vendor":"Oracle Corporation","java.vendor.url.bug":"http://bugreport.sun.com/bugreport/","user.name":"tgraves","java.vm.name":"OpenJDK 64-Bit Server VM","sun.java.command":"org.apache.spark.deploy.SparkSubmit --master yarn --conf spark.executor.resource.gpu.amount=1 --conf spark.driver.resource.gpu.amount=1 --conf spark.eventLog.enabled=true --conf spark.eventLog.dir=hdfs:///user/tgraves/eventlogdir --conf spark.executor.resource.gpu.discoveryScript=./getGpus --conf spark.driver.resource.gpu.discoveryScript=/home/tgraves/getGpus --conf spark.task.resource.gpu.amount=1 --class org.apache.spark.repl.Main --name Spark shell --driver-cores 2 --num-executors 2 --files file:/home/tgraves/getGpus spark-shell","java.home":"/usr/lib/jvm/java-8-openjdk-amd64/jre","java.version":"1.8.0_212","sun.io.unicode.encoding":"UnicodeLittle"},"Classpath Entries":{"/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/stream-2.9.6.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-repl_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-yarn-registry-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerb-crypto-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-tags_2.12-3.0.0-SNAPSHOT-tests.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerby-asn1-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/aircompressor-0.10.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jersey-container-servlet-2.22.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jersey-server-2.22.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jackson-jaxrs-base-2.9.5.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/guava-14.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/zjsonpatch-0.3.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/slf4j-log4j12-1.7.16.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/parquet-jackson-1.10.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerb-core-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/token-provider-1.0.1.jar":"*********(redacted)","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-beanutils-1.9.3.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/metrics-graphite-3.1.5.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/metrics-jvm-3.1.5.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/istack-commons-runtime-3.0.8.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/minlog-1.3.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/dnsjava-2.1.7.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-yarn-client-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-net-3.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/macro-compat_2.12-1.1.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/shapeless_2.12-2.3.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-streaming_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jackson-databind-2.9.9.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jetty-xml-9.4.18.v20190429.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/json-smart-2.3.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/guice-servlet-4.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/orc-shims-1.5.5.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/scala-xml_2.12-1.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jersey-common-2.22.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/parquet-format-2.4.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-catalyst_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jackson-module-paranamer-2.9.9.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/aopalliance-repackaged-2.4.0-b34.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jtransforms-2.4.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerb-util-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-codec-1.10.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/netty-all-4.1.30.Final.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/javax.ws.rs-api-2.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-launcher_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-client-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/xz-1.5.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-yarn_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kubernetes-model-4.1.2.jar":"System Classpath","/hadoopconfs/":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/ivy-2.4.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/avro-mapred-1.8.2-hadoop2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/parquet-column-1.10.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/geronimo-jcache_1.0_spec-1.0-alpha-1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hk2-api-2.4.0-b34.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/slf4j-api-1.7.16.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-graph-api_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/leveldbjni-all-1.8.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-lang-2.6.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/compress-lzf-1.0.3.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/nimbus-jose-jwt-4.41.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/re2j-1.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-mapreduce-client-common-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/chill-java-0.9.3.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kubernetes-model-common-4.1.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerb-client-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/automaton-1.11-8.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/joda-time-2.9.3.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-yarn-api-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jersey-media-jaxb-2.22.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/conf/":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-lang3-3.8.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/arpack_combined_all-0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-kvstore_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/core-1.1.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/arrow-format-0.12.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/accessors-smart-1.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-crypto-1.0.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/okhttp-3.8.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/snakeyaml-1.23.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/breeze_2.12-0.13.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/orc-core-1.5.5.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/curator-client-2.13.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-graphx_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-core_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/antlr4-runtime-4.7.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-text-1.6.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/activation-1.1.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerb-simplekdc-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jsr305-3.0.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/paranamer-2.8.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-math3-3.4.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jackson-core-2.9.9.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-mapreduce-client-jobclient-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerb-common-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-hdfs-client-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jackson-module-scala_2.12-2.9.9.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/lz4-java-1.6.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/httpcore-4.4.10.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerb-server-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-cli-1.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/parquet-hadoop-1.10.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/curator-recipes-2.13.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/logging-interceptor-3.12.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerby-pkix-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/woodstox-core-5.0.3.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-annotations-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/json4s-ast_2.12-3.6.6.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/univocity-parsers-2.7.3.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/xbean-asm7-shaded-4.14.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/parquet-encoding-1.10.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-sketch_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jersey-container-servlet-core-2.22.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-graph_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/osgi-resource-locator-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hk2-locator-2.4.0-b34.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jackson-dataformat-yaml-2.9.9.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/javax.inject-2.4.0-b34.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/aopalliance-1.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-compiler-3.0.11.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/netty-3.9.9.Final.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-mllib_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/scala-library-2.12.8.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/javax.inject-1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-auth-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jackson-mapper-asl-1.9.13.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-network-common_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/okio-1.13.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spire-macros_2.12-0.13.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/arrow-memory-0.12.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-sql_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hppc-0.7.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spire_2.12-0.13.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/arrow-vector-0.12.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/opencsv-2.3.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-configuration2-2.1.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jackson-annotations-2.9.9.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-mllib-local_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/pyrolite-4.23.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/json4s-jackson_2.12-3.6.6.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jersey-client-2.22.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/ehcache-3.3.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-tags_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/machinist_2.12-0.6.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-yarn-server-web-proxy-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/javassist-3.18.1-GA.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/orc-mapreduce-1.5.5.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hive-storage-api-2.6.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-mapreduce-client-core-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/log4j-1.2.17.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/htrace-core4-4.1.0-incubating.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/avro-ipc-1.8.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jcl-over-slf4j-1.7.16.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-kubernetes_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/snappy-java-1.1.7.3.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/oro-2.0.8.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kubernetes-client-4.1.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/generex-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-cypher_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/RoaringBitmap-0.7.45.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-io-2.4.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-daemon-1.0.13.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/avro-1.8.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/chill_2.12-0.9.3.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/janino-3.0.11.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-yarn-server-common-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/stax2-api-3.1.4.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/zookeeper-3.4.13.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/breeze-macros_2.12-0.13.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-network-shuffle_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jaxb-api-2.2.11.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/spark-unsafe_2.12-3.0.0-SNAPSHOT.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/guice-4.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/scala-compiler-2.12.8.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jsp-api-2.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/metrics-json-3.1.5.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerby-xdr-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/httpclient-4.5.6.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/shims-0.7.45.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/py4j-0.10.8.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jackson-module-jaxb-annotations-2.9.9.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/validation-api-1.1.0.Final.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerb-identity-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/scala-parser-combinators_2.12-1.1.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/audience-annotations-0.5.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jul-to-slf4j-1.7.16.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jcip-annotations-1.0-1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/objenesis-2.5.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-compress-1.8.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerb-admin-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/okhttp-2.7.5.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/metrics-core-3.1.5.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kryo-shaded-4.0.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jaxb-runtime-2.3.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/json4s-scalap_2.12-3.6.6.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jackson-core-asl-1.9.13.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/javax.servlet-api-3.1.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerby-config-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/flatbuffers-java-1.9.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/curator-framework-2.13.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jetty-webapp-9.4.18.v20190429.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-yarn-common-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/gson-2.2.4.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/scala-reflect-2.12.8.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hk2-utils-2.4.0-b34.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/hadoop-common-3.2.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/kerby-util-1.0.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jackson-jaxrs-json-provider-2.9.5.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/javax.annotation-api-1.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jakarta.xml.bind-api-2.3.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/parquet-common-1.10.1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/zstd-jni-1.4.0-1.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/jersey-guava-2.22.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/commons-collections-3.2.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/json4s-core_2.12-3.6.6.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/protobuf-java-2.5.0.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/okapi-shade-0.4.2.jar":"System Classpath","/home/tgraves/workspace/tgravescs-spark/assembly/target/scala-2.12/jars/mssql-jdbc-6.2.1.jre7.jar":"System Classpath"}} {"Event":"SparkListenerApplicationStart","App Name":"Spark shell","App ID":"application_1555004656427_0144","Timestamp":1562101337180,"User":"tgraves"} +{"Event":"org.apache.spark.scheduler.SparkListenerMiscellaneousProcessAdded","time":1618846550218,"processId":"yarn-am","info":{"hostPort":"192.168.1.19:8042","cores":1,"logUrlInfo":{"stdout":"http://192.168.1.19:8042/node/containerlogs/container_1555004656427_0144_01_000001/test/stdout?start=-4096","stderr":"http://192.168.1.19:8042/node/containerlogs/container_1555004656427_0144_01_000001/test/stderr?start=-4096"}}} {"Event":"SparkListenerExecutorAdded","Timestamp":1562101348551,"Executor ID":"1","Executor Info":{"Host":"tomg-test","Total Cores":1,"Log Urls":{"stdout":"http://tomg-test:8042/node/containerlogs/container_1555004656427_0144_01_000002/tgraves/stdout?start=-4096","stderr":"http://tomg-test:8042/node/containerlogs/container_1555004656427_0144_01_000002/tgraves/stderr?start=-4096"},"Attributes":{"NM_HTTP_ADDRESS":"tomg-test:8042","USER":"tgraves","LOG_FILES":"stderr,stdout","NM_HTTP_PORT":"8042","CLUSTER_ID":"","NM_PORT":"43125","HTTP_SCHEME":"http://","NM_HOST":"tomg-test","CONTAINER_ID":"container_1555004656427_0144_01_000002"},"Resources":{"gpu":{"name":"gpu","addresses":["0","1","2","3","4","5","6","7","8","9","10","11","12"]}}}} {"Event":"SparkListenerBlockManagerAdded","Block Manager ID":{"Executor ID":"1","Host":"tomg-test","Port":44873},"Maximum Memory":384093388,"Timestamp":1562101348609,"Maximum Onheap Memory":384093388,"Maximum Offheap Memory":0} {"Event":"SparkListenerExecutorAdded","Timestamp":1562101349256,"Executor ID":"2","Executor Info":{"Host":"tomg-test","Total Cores":1,"Log Urls":{"stdout":"http://tomg-test:8042/node/containerlogs/container_1555004656427_0144_01_000003/tgraves/stdout?start=-4096","stderr":"http://tomg-test:8042/node/containerlogs/container_1555004656427_0144_01_000003/tgraves/stderr?start=-4096"},"Attributes":{"NM_HTTP_ADDRESS":"tomg-test:8042","USER":"tgraves","LOG_FILES":"stderr,stdout","NM_HTTP_PORT":"8042","CLUSTER_ID":"","NM_PORT":"43125","HTTP_SCHEME":"http://","NM_HOST":"tomg-test","CONTAINER_ID":"container_1555004656427_0144_01_000003"},"Resources":{"gpu":{"name":"gpu","addresses":["0","1","2","3","4","5","6","7","8","9","10","11","12"]}}}} diff --git a/core/src/test/resources/spark-events/application_1578436911597_0052 b/core/src/test/resources/spark-events/application_1578436911597_0052 new file mode 100644 index 0000000000000..c57481a348a89 --- /dev/null +++ b/core/src/test/resources/spark-events/application_1578436911597_0052 @@ -0,0 +1,27 @@ +{"Event":"SparkListenerLogStart","Spark Version":"3.0.0-SNAPSHOT"} +{"Event":"SparkListenerResourceProfileAdded","Resource Profile Id":0,"Executor Resource Requests":{"cores":{"Resource Name":"cores","Amount":1,"Discovery Script":"","Vendor":""},"memory":{"Resource Name":"memory","Amount":1024,"Discovery Script":"","Vendor":""},"gpu":{"Resource Name":"gpu","Amount":1,"Discovery Script":"/home/tgraves/getGpus","Vendor":""}},"Task Resource Requests":{"cpus":{"Resource Name":"cpus","Amount":1.0},"gpu":{"Resource Name":"gpu","Amount":1.0}}} +{"Event":"SparkListenerBlockManagerAdded","Block Manager ID":{"Executor ID":"driver","Host":"10.10.10.10","Port":32957},"Maximum Memory":428762726,"Timestamp":1578764671818,"Maximum Onheap Memory":428762726,"Maximum Offheap Memory":0} +{"Event":"SparkListenerEnvironmentUpdate","JVM Information":{"Java Home":"/usr/lib/jvm/java-8-openjdk-amd64/jre","Java Version":"1.8.0_232 (Private Build)","Scala Version":"version 2.12.10"},"Spark Properties":{},"Hadoop Properties":{},"System Properties":{}, "Classpath Entries": {}} +{"Event":"SparkListenerApplicationStart","App Name":"Spark shell","App ID":"application_1578436911597_0052","Timestamp":1578764662851,"User":"tgraves"} +{"Event":"SparkListenerResourceProfileAdded","Resource Profile Id":1,"Executor Resource Requests":{"cores":{"Resource Name":"cores","Amount":4,"Discovery Script":"","Vendor":""},"gpu":{"Resource Name":"gpu","Amount":1,"Discovery Script":"./getGpus","Vendor":""}},"Task Resource Requests":{"cpus":{"Resource Name":"cpus","Amount":1.0},"gpu":{"Resource Name":"gpu","Amount":1.0}}} +{"Event":"SparkListenerResourceProfileAdded","Resource Profile Id":2,"Executor Resource Requests":{"cores":{"Resource Name":"cores","Amount":2,"Discovery Script":"","Vendor":""}},"Task Resource Requests":{"cpus":{"Resource Name":"cpus","Amount":2.0}}} +{"Event":"SparkListenerResourceProfileAdded","Resource Profile Id":3,"Executor Resource Requests":{"cores":{"Resource Name":"cores","Amount":4,"Discovery Script":"","Vendor":""},"gpu":{"Resource Name":"gpu","Amount":1,"Discovery Script":"./getGpus","Vendor":""}},"Task Resource Requests":{"cpus":{"Resource Name":"cpus","Amount":2.0},"gpu":{"Resource Name":"gpu","Amount":1.0}}} +{"Event":"SparkListenerJobStart","Job ID":0,"Submission Time":1578764765274,"Stage Infos":[{"Stage ID":0,"Stage Attempt ID":0,"Stage Name":"collect at :29","Number of Tasks":6,"RDD Info":[{"RDD ID":1,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"1\",\"name\":\"map\"}","Callsite":"map at :31","Parent IDs":[0],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Number of Partitions":6,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":0,"Name":"ParallelCollectionRDD","Scope":"{\"id\":\"0\",\"name\":\"parallelize\"}","Callsite":"parallelize at :31","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Number of Partitions":6,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.rdd.RDD.collect(RDD.scala:1004)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:29)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:33)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:35)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:37)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:39)\n$line37.$read$$iw$$iw$$iw$$iw$$iw.(:41)\n$line37.$read$$iw$$iw$$iw$$iw.(:43)\n$line37.$read$$iw$$iw$$iw.(:45)\n$line37.$read$$iw$$iw.(:47)\n$line37.$read$$iw.(:49)\n$line37.$read.(:51)\n$line37.$read$.(:55)\n$line37.$read$.()\n$line37.$eval$.$print$lzycompute(:7)\n$line37.$eval$.$print(:6)\n$line37.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)","Accumulables":[],"Resource Profile Id":3}],"Stage IDs":[0],"Properties":{"spark.rdd.scope":"{\"id\":\"2\",\"name\":\"collect\"}","spark.rdd.scope.noOverride":"true"}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":0,"Stage Attempt ID":0,"Stage Name":"collect at :29","Number of Tasks":6,"RDD Info":[{"RDD ID":1,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"1\",\"name\":\"map\"}","Callsite":"map at :31","Parent IDs":[0],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Number of Partitions":6,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":0,"Name":"ParallelCollectionRDD","Scope":"{\"id\":\"0\",\"name\":\"parallelize\"}","Callsite":"parallelize at :31","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Number of Partitions":6,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.rdd.RDD.collect(RDD.scala:1004)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:29)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:33)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:35)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:37)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:39)\n$line37.$read$$iw$$iw$$iw$$iw$$iw.(:41)\n$line37.$read$$iw$$iw$$iw$$iw.(:43)\n$line37.$read$$iw$$iw$$iw.(:45)\n$line37.$read$$iw$$iw.(:47)\n$line37.$read$$iw.(:49)\n$line37.$read.(:51)\n$line37.$read$.(:55)\n$line37.$read$.()\n$line37.$eval$.$print$lzycompute(:7)\n$line37.$eval$.$print(:6)\n$line37.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)","Submission Time":1578764765293,"Accumulables":[],"Resource Profile Id":3},"Properties":{"spark.rdd.scope":"{\"id\":\"2\",\"name\":\"collect\"}","spark.rdd.scope.noOverride":"true"}} +{"Event":"SparkListenerExecutorAdded","Timestamp":1578764769706,"Executor ID":"1","Executor Info":{"Host":"host1","Total Cores":4,"Log Urls":{"stdout":"http://host1:8042/node/containerlogs/container_1578436911597_0052_01_000002/tgraves/stdout?start=-4096","stderr":"http://host1:8042/node/containerlogs/container_1578436911597_0052_01_000002/tgraves/stderr?start=-4096"},"Attributes":{"NM_HTTP_ADDRESS":"host1:8042","USER":"tgraves","LOG_FILES":"stderr,stdout","NM_HTTP_PORT":"8042","CLUSTER_ID":"","NM_PORT":"37783","HTTP_SCHEME":"http://","NM_HOST":"host1","CONTAINER_ID":"container_1578436911597_0052_01_000002"},"Resources":{"gpu":{"name":"gpu","addresses":["0","1","2"]}},"Resource Profile Id":3}} +{"Event":"SparkListenerBlockManagerAdded","Block Manager ID":{"Executor ID":"1","Host":"host1","Port":40787},"Maximum Memory":384093388,"Timestamp":1578764769796,"Maximum Onheap Memory":384093388,"Maximum Offheap Memory":0} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":0,"Index":0,"Attempt":0,"Launch Time":1578764769858,"Executor ID":"1","Host":"host1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":1,"Index":1,"Attempt":0,"Launch Time":1578764769877,"Executor ID":"1","Host":"host1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":2,"Index":2,"Attempt":0,"Launch Time":1578764770507,"Executor ID":"1","Host":"host1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":3,"Index":3,"Attempt":0,"Launch Time":1578764770509,"Executor ID":"1","Host":"host1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":0,"Index":0,"Attempt":0,"Launch Time":1578764769858,"Executor ID":"1","Host":"host1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1578764770512,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"internal.metrics.resultSerializationTime","Update":2,"Value":2,"Internal":true,"Count Failed Values":true},{"ID":5,"Name":"internal.metrics.jvmGCTime","Update":49,"Value":49,"Internal":true,"Count Failed Values":true},{"ID":4,"Name":"internal.metrics.resultSize","Update":3706,"Value":3706,"Internal":true,"Count Failed Values":true},{"ID":3,"Name":"internal.metrics.executorCpuTime","Update":20740892,"Value":20740892,"Internal":true,"Count Failed Values":true},{"ID":2,"Name":"internal.metrics.executorRunTime","Update":32,"Value":32,"Internal":true,"Count Failed Values":true},{"ID":1,"Name":"internal.metrics.executorDeserializeCpuTime","Update":250921658,"Value":250921658,"Internal":true,"Count Failed Values":true},{"ID":0,"Name":"internal.metrics.executorDeserializeTime","Update":555,"Value":555,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":555,"Executor Deserialize CPU Time":250921658,"Executor Run Time":32,"Executor CPU Time":20740892,"Peak Execution Memory":0,"Result Size":3706,"JVM GC Time":49,"Result Serialization Time":2,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":1,"Index":1,"Attempt":0,"Launch Time":1578764769877,"Executor ID":"1","Host":"host1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1578764770515,"Failed":false,"Killed":false,"Accumulables":[{"ID":6,"Name":"internal.metrics.resultSerializationTime","Update":2,"Value":4,"Internal":true,"Count Failed Values":true},{"ID":5,"Name":"internal.metrics.jvmGCTime","Update":49,"Value":98,"Internal":true,"Count Failed Values":true},{"ID":4,"Name":"internal.metrics.resultSize","Update":3722,"Value":7428,"Internal":true,"Count Failed Values":true},{"ID":3,"Name":"internal.metrics.executorCpuTime","Update":25185125,"Value":45926017,"Internal":true,"Count Failed Values":true},{"ID":2,"Name":"internal.metrics.executorRunTime","Update":32,"Value":64,"Internal":true,"Count Failed Values":true},{"ID":1,"Name":"internal.metrics.executorDeserializeCpuTime","Update":416274503,"Value":667196161,"Internal":true,"Count Failed Values":true},{"ID":0,"Name":"internal.metrics.executorDeserializeTime","Update":555,"Value":1110,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":555,"Executor Deserialize CPU Time":416274503,"Executor Run Time":32,"Executor CPU Time":25185125,"Peak Execution Memory":0,"Result Size":3722,"JVM GC Time":49,"Result Serialization Time":2,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":4,"Index":4,"Attempt":0,"Launch Time":1578764770525,"Executor ID":"1","Host":"host1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":2,"Index":2,"Attempt":0,"Launch Time":1578764770507,"Executor ID":"1","Host":"host1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1578764770526,"Failed":false,"Killed":false,"Accumulables":[{"ID":4,"Name":"internal.metrics.resultSize","Update":3636,"Value":11064,"Internal":true,"Count Failed Values":true},{"ID":3,"Name":"internal.metrics.executorCpuTime","Update":2203515,"Value":48129532,"Internal":true,"Count Failed Values":true},{"ID":2,"Name":"internal.metrics.executorRunTime","Update":2,"Value":66,"Internal":true,"Count Failed Values":true},{"ID":1,"Name":"internal.metrics.executorDeserializeCpuTime","Update":2733237,"Value":669929398,"Internal":true,"Count Failed Values":true},{"ID":0,"Name":"internal.metrics.executorDeserializeTime","Update":2,"Value":1112,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":2,"Executor Deserialize CPU Time":2733237,"Executor Run Time":2,"Executor CPU Time":2203515,"Peak Execution Memory":0,"Result Size":3636,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":5,"Index":5,"Attempt":0,"Launch Time":1578764770527,"Executor ID":"1","Host":"host1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":3,"Index":3,"Attempt":0,"Launch Time":1578764770509,"Executor ID":"1","Host":"host1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1578764770529,"Failed":false,"Killed":false,"Accumulables":[{"ID":4,"Name":"internal.metrics.resultSize","Update":3620,"Value":14684,"Internal":true,"Count Failed Values":true},{"ID":3,"Name":"internal.metrics.executorCpuTime","Update":2365599,"Value":50495131,"Internal":true,"Count Failed Values":true},{"ID":2,"Name":"internal.metrics.executorRunTime","Update":2,"Value":68,"Internal":true,"Count Failed Values":true},{"ID":1,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3387884,"Value":673317282,"Internal":true,"Count Failed Values":true},{"ID":0,"Name":"internal.metrics.executorDeserializeTime","Update":3,"Value":1115,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":3,"Executor Deserialize CPU Time":3387884,"Executor Run Time":2,"Executor CPU Time":2365599,"Peak Execution Memory":0,"Result Size":3620,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":4,"Index":4,"Attempt":0,"Launch Time":1578764770525,"Executor ID":"1","Host":"host1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1578764770542,"Failed":false,"Killed":false,"Accumulables":[{"ID":4,"Name":"internal.metrics.resultSize","Update":3636,"Value":18320,"Internal":true,"Count Failed Values":true},{"ID":3,"Name":"internal.metrics.executorCpuTime","Update":2456346,"Value":52951477,"Internal":true,"Count Failed Values":true},{"ID":2,"Name":"internal.metrics.executorRunTime","Update":2,"Value":70,"Internal":true,"Count Failed Values":true},{"ID":1,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3502860,"Value":676820142,"Internal":true,"Count Failed Values":true},{"ID":0,"Name":"internal.metrics.executorDeserializeTime","Update":3,"Value":1118,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":3,"Executor Deserialize CPU Time":3502860,"Executor Run Time":2,"Executor CPU Time":2456346,"Peak Execution Memory":0,"Result Size":3636,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":5,"Index":5,"Attempt":0,"Launch Time":1578764770527,"Executor ID":"1","Host":"host1","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1578764770542,"Failed":false,"Killed":false,"Accumulables":[{"ID":4,"Name":"internal.metrics.resultSize","Update":3636,"Value":21956,"Internal":true,"Count Failed Values":true},{"ID":3,"Name":"internal.metrics.executorCpuTime","Update":2162370,"Value":55113847,"Internal":true,"Count Failed Values":true},{"ID":2,"Name":"internal.metrics.executorRunTime","Update":2,"Value":72,"Internal":true,"Count Failed Values":true},{"ID":1,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3622437,"Value":680442579,"Internal":true,"Count Failed Values":true},{"ID":0,"Name":"internal.metrics.executorDeserializeTime","Update":3,"Value":1121,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":3,"Executor Deserialize CPU Time":3622437,"Executor Run Time":2,"Executor CPU Time":2162370,"Peak Execution Memory":0,"Result Size":3636,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":0,"Stage Attempt ID":0,"Stage Name":"collect at :29","Number of Tasks":6,"RDD Info":[{"RDD ID":1,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"1\",\"name\":\"map\"}","Callsite":"map at :31","Parent IDs":[0],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Number of Partitions":6,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":0,"Name":"ParallelCollectionRDD","Scope":"{\"id\":\"0\",\"name\":\"parallelize\"}","Callsite":"parallelize at :31","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Number of Partitions":6,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.rdd.RDD.collect(RDD.scala:1004)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:29)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:33)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:35)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw.(:37)\n$line37.$read$$iw$$iw$$iw$$iw$$iw$$iw.(:39)\n$line37.$read$$iw$$iw$$iw$$iw$$iw.(:41)\n$line37.$read$$iw$$iw$$iw$$iw.(:43)\n$line37.$read$$iw$$iw$$iw.(:45)\n$line37.$read$$iw$$iw.(:47)\n$line37.$read$$iw.(:49)\n$line37.$read.(:51)\n$line37.$read$.(:55)\n$line37.$read$.()\n$line37.$eval$.$print$lzycompute(:7)\n$line37.$eval$.$print(:6)\n$line37.$eval.$print()\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)","Submission Time":1578764765293,"Completion Time":1578764770543,"Accumulables":[{"ID":2,"Name":"internal.metrics.executorRunTime","Value":72,"Internal":true,"Count Failed Values":true},{"ID":5,"Name":"internal.metrics.jvmGCTime","Value":98,"Internal":true,"Count Failed Values":true},{"ID":4,"Name":"internal.metrics.resultSize","Value":21956,"Internal":true,"Count Failed Values":true},{"ID":1,"Name":"internal.metrics.executorDeserializeCpuTime","Value":680442579,"Internal":true,"Count Failed Values":true},{"ID":3,"Name":"internal.metrics.executorCpuTime","Value":55113847,"Internal":true,"Count Failed Values":true},{"ID":6,"Name":"internal.metrics.resultSerializationTime","Value":4,"Internal":true,"Count Failed Values":true},{"ID":0,"Name":"internal.metrics.executorDeserializeTime","Value":1121,"Internal":true,"Count Failed Values":true}],"Resource Profile Id":3}} +{"Event":"SparkListenerJobEnd","Job ID":0,"Completion Time":1578764770546,"Job Result":{"Result":"JobSucceeded"}} +{"Event":"SparkListenerApplicationEnd","Timestamp":1578764802615} diff --git a/core/src/test/scala/org/apache/spark/AccumulatorSuite.scala b/core/src/test/scala/org/apache/spark/AccumulatorSuite.scala index a75cf3f0381df..e4dfa149a7d20 100644 --- a/core/src/test/scala/org/apache/spark/AccumulatorSuite.scala +++ b/core/src/test/scala/org/apache/spark/AccumulatorSuite.scala @@ -25,8 +25,8 @@ import scala.collection.mutable.ArrayBuffer import scala.ref.WeakReference import scala.util.control.NonFatal -import org.scalatest.Matchers import org.scalatest.exceptions.TestFailedException +import org.scalatest.matchers.must.Matchers import org.apache.spark.scheduler._ import org.apache.spark.serializer.JavaSerializer @@ -157,7 +157,7 @@ private class SaveInfoListener extends SparkListener { def getCompletedStageInfos: Seq[StageInfo] = completedStageInfos.toArray.toSeq def getCompletedTaskInfos: Seq[TaskInfo] = completedTaskInfos.values.flatten.toSeq def getCompletedTaskInfos(stageId: StageId, stageAttemptId: StageAttemptId): Seq[TaskInfo] = - completedTaskInfos.getOrElse((stageId, stageAttemptId), Seq.empty[TaskInfo]) + completedTaskInfos.getOrElse((stageId, stageAttemptId), Seq.empty[TaskInfo]).toSeq /** * If `jobCompletionCallback` is set, block until the next call has finished. diff --git a/core/src/test/scala/org/apache/spark/BarrierStageOnSubmittedSuite.scala b/core/src/test/scala/org/apache/spark/BarrierStageOnSubmittedSuite.scala index 435b927068e60..1ba13c2ef1897 100644 --- a/core/src/test/scala/org/apache/spark/BarrierStageOnSubmittedSuite.scala +++ b/core/src/test/scala/org/apache/spark/BarrierStageOnSubmittedSuite.scala @@ -19,9 +19,12 @@ package org.apache.spark import scala.concurrent.duration._ +import org.apache.spark.TestUtils.createTempScriptWithExpectedOutput import org.apache.spark.internal.config._ import org.apache.spark.rdd.{PartitionPruningRDD, RDD} +import org.apache.spark.resource.TestResourceIDs.{EXECUTOR_GPU_ID, TASK_GPU_ID, WORKER_GPU_ID} import org.apache.spark.scheduler.BarrierJobAllocationFailed._ +import org.apache.spark.scheduler.BarrierJobSlotsNumberCheckFailed import org.apache.spark.util.ThreadUtils /** @@ -259,4 +262,37 @@ class BarrierStageOnSubmittedSuite extends SparkFunSuite with LocalSparkContext testSubmitJob(sc, rdd, message = ERROR_MESSAGE_BARRIER_REQUIRE_MORE_SLOTS_THAN_CURRENT_TOTAL_NUMBER) } + + test("SPARK-32518: CoarseGrainedSchedulerBackend.maxNumConcurrentTasks should " + + "consider all kinds of resources for the barrier stage") { + withTempDir { dir => + val discoveryScript = createTempScriptWithExpectedOutput( + dir, "gpuDiscoveryScript", """{"name": "gpu","addresses":["0"]}""") + + val conf = new SparkConf() + // Setup a local cluster which would only has one executor with 2 CPUs and 1 GPU. + .setMaster("local-cluster[1, 2, 1024]") + .setAppName("test-cluster") + .set(WORKER_GPU_ID.amountConf, "1") + .set(WORKER_GPU_ID.discoveryScriptConf, discoveryScript) + .set(EXECUTOR_GPU_ID.amountConf, "1") + .set(TASK_GPU_ID.amountConf, "1") + // disable barrier stage retry to fail the application as soon as possible + .set(BARRIER_MAX_CONCURRENT_TASKS_CHECK_MAX_FAILURES, 1) + sc = new SparkContext(conf) + TestUtils.waitUntilExecutorsUp(sc, 1, 60000) + + val exception = intercept[BarrierJobSlotsNumberCheckFailed] { + // Setup a barrier stage which contains 2 tasks and each task requires 1 CPU and 1 GPU. + // Therefore, the total resources requirement (2 CPUs and 2 GPUs) of this barrier stage + // can not be satisfied since the cluster only has 2 CPUs and 1 GPU in total. + sc.parallelize(Range(1, 10), 2) + .barrier() + .mapPartitions { iter => iter } + .collect() + } + assert(exception.getMessage.contains("[SPARK-24819]: Barrier execution " + + "mode does not allow run a barrier stage that requires more slots")) + } + } } diff --git a/core/src/test/scala/org/apache/spark/CheckpointSuite.scala b/core/src/test/scala/org/apache/spark/CheckpointSuite.scala index a69381d18e3b6..e42df0821589b 100644 --- a/core/src/test/scala/org/apache/spark/CheckpointSuite.scala +++ b/core/src/test/scala/org/apache/spark/CheckpointSuite.scala @@ -194,7 +194,7 @@ trait RDDCheckpointTester { self: SparkFunSuite => /** * Serialize and deserialize an object. This is useful to verify the objects * contents after deserialization (e.g., the contents of an RDD split after - * it is sent to a slave along with a task) + * it is sent to an executor along with a task) */ protected def serializeDeserialize[T](obj: T): T = { val bytes = Utils.serialize(obj) @@ -635,12 +635,12 @@ class CheckpointStorageSuite extends SparkFunSuite with LocalSparkContext { // Verify that RDD is checkpointed assert(rdd.firstParent.isInstanceOf[ReliableCheckpointRDD[_]]) val checkpointedRDD = rdd.firstParent.asInstanceOf[ReliableCheckpointRDD[_]] - val partiton = checkpointedRDD.partitions(0) - assert(!checkpointedRDD.cachedPreferredLocations.asMap.containsKey(partiton)) + val partition = checkpointedRDD.partitions(0) + assert(!checkpointedRDD.cachedPreferredLocations.asMap.containsKey(partition)) - val preferredLoc = checkpointedRDD.preferredLocations(partiton) - assert(checkpointedRDD.cachedPreferredLocations.asMap.containsKey(partiton)) - assert(preferredLoc == checkpointedRDD.cachedPreferredLocations.get(partiton)) + val preferredLoc = checkpointedRDD.preferredLocations(partition) + assert(checkpointedRDD.cachedPreferredLocations.asMap.containsKey(partition)) + assert(preferredLoc == checkpointedRDD.cachedPreferredLocations.get(partition)) } } @@ -653,7 +653,7 @@ class CheckpointStorageSuite extends SparkFunSuite with LocalSparkContext { val rdd = sc.makeRDD(1 to 200, numSlices = 4).repartition(1).mapPartitions { iter => iter.map { i => if (i > 100 && TaskContext.get().stageAttemptNumber() == 0) { - // throw new SparkException("Make first attemp failed.") + // throw new SparkException("Make first attempt failed.") // Throw FetchFailedException to explicitly trigger stage resubmission. // A normal exception will only trigger task resubmission in the same stage. throw new FetchFailedException(null, 0, 0L, 0, 0, "Fake") diff --git a/core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala b/core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala index 92ed24408384f..5434e82c95b1b 100644 --- a/core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala +++ b/core/src/test/scala/org/apache/spark/ContextCleanerSuite.scala @@ -291,14 +291,14 @@ class ContextCleanerSuite extends ContextCleanerSuiteBase { val shuffleIds = 0 until sc.newShuffleId val broadcastIds = broadcastBuffer.map(_.id) - val preGCTester = new CleanerTester(sc, rddIds, shuffleIds, broadcastIds) + val preGCTester = new CleanerTester(sc, rddIds, shuffleIds, broadcastIds.toSeq) runGC() intercept[Exception] { preGCTester.assertCleanup()(timeout(1.second)) } // Test that GC triggers the cleanup of all variables after the dereferencing them - val postGCTester = new CleanerTester(sc, rddIds, shuffleIds, broadcastIds) + val postGCTester = new CleanerTester(sc, rddIds, shuffleIds, broadcastIds.toSeq) broadcastBuffer.clear() rddBuffer.clear() runGC() @@ -309,7 +309,7 @@ class ContextCleanerSuite extends ContextCleanerSuiteBase { assert(sc.env.blockManager.master.getMatchingBlockIds({ case BroadcastBlockId(`taskClosureBroadcastId`, _) => true case _ => false - }, askSlaves = true).isEmpty) + }, askStorageEndpoints = true).isEmpty) } test("automatically cleanup RDD + shuffle + broadcast in distributed mode") { @@ -331,14 +331,14 @@ class ContextCleanerSuite extends ContextCleanerSuiteBase { val shuffleIds = 0 until sc.newShuffleId val broadcastIds = broadcastBuffer.map(_.id) - val preGCTester = new CleanerTester(sc, rddIds, shuffleIds, broadcastIds) + val preGCTester = new CleanerTester(sc, rddIds, shuffleIds, broadcastIds.toSeq) runGC() intercept[Exception] { preGCTester.assertCleanup()(timeout(1.second)) } // Test that GC triggers the cleanup of all variables after the dereferencing them - val postGCTester = new CleanerTester(sc, rddIds, shuffleIds, broadcastIds) + val postGCTester = new CleanerTester(sc, rddIds, shuffleIds, broadcastIds.toSeq) broadcastBuffer.clear() rddBuffer.clear() runGC() @@ -349,7 +349,7 @@ class ContextCleanerSuite extends ContextCleanerSuiteBase { assert(sc.env.blockManager.master.getMatchingBlockIds({ case BroadcastBlockId(`taskClosureBroadcastId`, _) => true case _ => false - }, askSlaves = true).isEmpty) + }, askStorageEndpoints = true).isEmpty) } } @@ -368,7 +368,7 @@ class CleanerTester( val toBeCleanedRDDIds = new HashSet[Int] ++= rddIds val toBeCleanedShuffleIds = new HashSet[Int] ++= shuffleIds - val toBeCleanedBroadcstIds = new HashSet[Long] ++= broadcastIds + val toBeCleanedBroadcastIds = new HashSet[Long] ++= broadcastIds val toBeCheckpointIds = new HashSet[Long] ++= checkpointIds val isDistributed = !sc.isLocal @@ -384,7 +384,7 @@ class CleanerTester( } def broadcastCleaned(broadcastId: Long): Unit = { - toBeCleanedBroadcstIds.synchronized { toBeCleanedBroadcstIds -= broadcastId } + toBeCleanedBroadcastIds.synchronized { toBeCleanedBroadcastIds -= broadcastId } logInfo("Broadcast " + broadcastId + " cleaned") } @@ -508,8 +508,8 @@ class CleanerTester( val s2 = toBeCleanedShuffleIds.synchronized { toBeCleanedShuffleIds.toSeq.sorted.mkString("[", ", ", "]") } - val s3 = toBeCleanedBroadcstIds.synchronized { - toBeCleanedBroadcstIds.toSeq.sorted.mkString("[", ", ", "]") + val s3 = toBeCleanedBroadcastIds.synchronized { + toBeCleanedBroadcastIds.toSeq.sorted.mkString("[", ", ", "]") } s""" |\tRDDs = $s1 @@ -521,14 +521,14 @@ class CleanerTester( private def isAllCleanedUp = toBeCleanedRDDIds.synchronized { toBeCleanedRDDIds.isEmpty } && toBeCleanedShuffleIds.synchronized { toBeCleanedShuffleIds.isEmpty } && - toBeCleanedBroadcstIds.synchronized { toBeCleanedBroadcstIds.isEmpty } && + toBeCleanedBroadcastIds.synchronized { toBeCleanedBroadcastIds.isEmpty } && toBeCheckpointIds.synchronized { toBeCheckpointIds.isEmpty } private def getRDDBlocks(rddId: Int): Seq[BlockId] = { blockManager.master.getMatchingBlockIds( _ match { case RDDBlockId(`rddId`, _) => true case _ => false - }, askSlaves = true) + }, askStorageEndpoints = true) } private def getShuffleBlocks(shuffleId: Int): Seq[BlockId] = { @@ -536,14 +536,14 @@ class CleanerTester( case ShuffleBlockId(`shuffleId`, _, _) => true case ShuffleIndexBlockId(`shuffleId`, _, _) => true case _ => false - }, askSlaves = true) + }, askStorageEndpoints = true) } private def getBroadcastBlocks(broadcastId: Long): Seq[BlockId] = { blockManager.master.getMatchingBlockIds( _ match { case BroadcastBlockId(`broadcastId`, _) => true case _ => false - }, askSlaves = true) + }, askStorageEndpoints = true) } private def blockManager = sc.env.blockManager diff --git a/core/src/test/scala/org/apache/spark/DistributedSuite.scala b/core/src/test/scala/org/apache/spark/DistributedSuite.scala index 4d157b9607000..ce1df3adf6352 100644 --- a/core/src/test/scala/org/apache/spark/DistributedSuite.scala +++ b/core/src/test/scala/org/apache/spark/DistributedSuite.scala @@ -18,8 +18,8 @@ package org.apache.spark import org.scalatest.Assertions._ -import org.scalatest.Matchers import org.scalatest.concurrent.{Signaler, ThreadSignaler, TimeLimits} +import org.scalatest.matchers.must.Matchers import org.scalatest.time.{Millis, Span} import org.apache.spark.internal.config @@ -38,18 +38,18 @@ class DistributedSuite extends SparkFunSuite with Matchers with LocalSparkContex // Necessary to make ScalaTest 3.x interrupt a thread on the JVM like ScalaTest 2.2.x implicit val defaultSignaler: Signaler = ThreadSignaler - val clusterUrl = "local-cluster[2,1,1024]" + val clusterUrl = "local-cluster[3,1,1024]" test("task throws not serializable exception") { // Ensures that executors do not crash when an exn is not serializable. If executors crash, // this test will hang. Correct behavior is that executors don't crash but fail tasks // and the scheduler throws a SparkException. - // numSlaves must be less than numPartitions - val numSlaves = 3 + // numWorkers must be less than numPartitions + val numWorkers = 3 val numPartitions = 10 - sc = new SparkContext("local-cluster[%s,1,1024]".format(numSlaves), "test") + sc = new SparkContext("local-cluster[%s,1,1024]".format(numWorkers), "test") val data = sc.parallelize(1 to 100, numPartitions). map(x => throw new NotSerializableExn(new NotSerializableClass)) intercept[SparkException] { @@ -69,10 +69,10 @@ class DistributedSuite extends SparkFunSuite with Matchers with LocalSparkContex ) masterStrings.foreach { - case LOCAL_CLUSTER_REGEX(numSlaves, coresPerSlave, memoryPerSlave) => - assert(numSlaves.toInt == 2) - assert(coresPerSlave.toInt == 1) - assert(memoryPerSlave.toInt == 1024) + case LOCAL_CLUSTER_REGEX(numWorkers, coresPerWorker, memoryPerWorker) => + assert(numWorkers.toInt == 2) + assert(coresPerWorker.toInt == 1) + assert(memoryPerWorker.toInt == 1024) } } @@ -174,7 +174,7 @@ class DistributedSuite extends SparkFunSuite with Matchers with LocalSparkContex private def testCaching(conf: SparkConf, storageLevel: StorageLevel): Unit = { sc = new SparkContext(conf.setMaster(clusterUrl).setAppName("test")) - TestUtils.waitUntilExecutorsUp(sc, 2, 60000) + TestUtils.waitUntilExecutorsUp(sc, 3, 60000) val data = sc.parallelize(1 to 1000, 10) val cachedData = data.persist(storageLevel) assert(cachedData.count === 1000) @@ -206,7 +206,8 @@ class DistributedSuite extends SparkFunSuite with Matchers with LocalSparkContex "caching on disk" -> StorageLevel.DISK_ONLY, "caching in memory, replicated" -> StorageLevel.MEMORY_ONLY_2, "caching in memory, serialized, replicated" -> StorageLevel.MEMORY_ONLY_SER_2, - "caching on disk, replicated" -> StorageLevel.DISK_ONLY_2, + "caching on disk, replicated 2" -> StorageLevel.DISK_ONLY_2, + "caching on disk, replicated 3" -> StorageLevel.DISK_ONLY_3, "caching in memory and disk, replicated" -> StorageLevel.MEMORY_AND_DISK_2, "caching in memory and disk, serialized, replicated" -> StorageLevel.MEMORY_AND_DISK_SER_2 ).foreach { case (testName, storageLevel) => @@ -227,7 +228,8 @@ class DistributedSuite extends SparkFunSuite with Matchers with LocalSparkContex assert(data.count() === size) assert(data.count() === size) // ensure only a subset of partitions were cached - val rddBlocks = sc.env.blockManager.master.getMatchingBlockIds(_.isRDD, askSlaves = true) + val rddBlocks = sc.env.blockManager.master.getMatchingBlockIds(_.isRDD, + askStorageEndpoints = true) assert(rddBlocks.size === 0, s"expected no RDD blocks, found ${rddBlocks.size}") } @@ -244,7 +246,8 @@ class DistributedSuite extends SparkFunSuite with Matchers with LocalSparkContex assert(data.count() === size) assert(data.count() === size) // ensure only a subset of partitions were cached - val rddBlocks = sc.env.blockManager.master.getMatchingBlockIds(_.isRDD, askSlaves = true) + val rddBlocks = sc.env.blockManager.master.getMatchingBlockIds(_.isRDD, + askStorageEndpoints = true) assert(rddBlocks.size > 0, "no RDD blocks found") assert(rddBlocks.size < numPartitions, s"too many RDD blocks found, expected <$numPartitions") } diff --git a/core/src/test/scala/org/apache/spark/ExecutorAllocationManagerSuite.scala b/core/src/test/scala/org/apache/spark/ExecutorAllocationManagerSuite.scala index 807f0eb808f9b..2fb5140d38b2c 100644 --- a/core/src/test/scala/org/apache/spark/ExecutorAllocationManagerSuite.scala +++ b/core/src/test/scala/org/apache/spark/ExecutorAllocationManagerSuite.scala @@ -21,15 +21,16 @@ import java.util.concurrent.TimeUnit import scala.collection.mutable -import org.mockito.ArgumentMatchers.{any, eq => meq} -import org.mockito.Mockito.{mock, never, times, verify, when} +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito._ import org.scalatest.PrivateMethodTester import org.apache.spark.executor.ExecutorMetrics import org.apache.spark.internal.config -import org.apache.spark.internal.config.Tests.TEST_SCHEDULE_INTERVAL +import org.apache.spark.internal.config.DECOMMISSION_ENABLED +import org.apache.spark.internal.config.Tests.TEST_DYNAMIC_ALLOCATION_SCHEDULE_ENABLED import org.apache.spark.metrics.MetricsSystem -import org.apache.spark.resource.{ExecutorResourceRequests, ResourceProfile, ResourceProfileBuilder, ResourceProfileManager, TaskResourceRequests} +import org.apache.spark.resource._ import org.apache.spark.resource.ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID import org.apache.spark.scheduler._ import org.apache.spark.scheduler.cluster.ExecutorInfo @@ -267,7 +268,7 @@ class ExecutorAllocationManagerSuite extends SparkFunSuite { test("add executors multiple profiles initial num same as needed") { // test when the initial number of executors equals the number needed for the first - // stage using a non default profile to make sure we request the intitial number + // stage using a non default profile to make sure we request the initial number // properly. Here initial is 2, each executor in ResourceProfile 1 can have 2 tasks // per executor, and start a stage with 4 tasks, which would need 2 executors. val clock = new ManualClock(8888L) @@ -501,6 +502,175 @@ class ExecutorAllocationManagerSuite extends SparkFunSuite { assert(numExecutorsToAddForDefaultProfile(manager) === 1) } + test("SPARK-31418: one stage being unschedulable") { + val clock = new ManualClock() + val conf = createConf(0, 5, 0).set(config.EXECUTOR_CORES, 2) + val manager = createManager(conf, clock = clock) + val updatesNeeded = + new mutable.HashMap[ResourceProfile, ExecutorAllocationManager.TargetNumUpdates] + + post(SparkListenerStageSubmitted(createStageInfo(0, 2))) + + assert(addExecutorsToTargetForDefaultProfile(manager, updatesNeeded) === 1) + doUpdateRequest(manager, updatesNeeded.toMap, clock.getTimeMillis()) + assert(addExecutorsToTargetForDefaultProfile(manager, updatesNeeded) === 0) + + onExecutorAddedDefaultProfile(manager, "0") + val t1 = createTaskInfo(0, 0, executorId = s"0") + val t2 = createTaskInfo(1, 1, executorId = s"0") + post(SparkListenerTaskStart(0, 0, t1)) + post(SparkListenerTaskStart(0, 0, t2)) + + assert(numExecutorsTarget(manager, defaultProfile.id) === 1) + assert(maxNumExecutorsNeededPerResourceProfile(manager, defaultProfile) == 1) + + // Stage 0 becomes unschedulable due to excludeOnFailure + post(SparkListenerUnschedulableTaskSetAdded(0, 0)) + clock.advance(1000) + manager invokePrivate _updateAndSyncNumExecutorsTarget(clock.nanoTime()) + // Assert that we are getting additional executor to schedule unschedulable tasks + assert(numExecutorsTarget(manager, defaultProfile.id) === 2) + assert(maxNumExecutorsNeededPerResourceProfile(manager, defaultProfile) == 2) + + // Add a new executor + onExecutorAddedDefaultProfile(manager, "1") + // Now once the task becomes schedulable, clear the unschedulableTaskSets + post(SparkListenerUnschedulableTaskSetRemoved(0, 0)) + clock.advance(1000) + manager invokePrivate _updateAndSyncNumExecutorsTarget(clock.nanoTime()) + assert(numExecutorsTarget(manager, defaultProfile.id) === 1) + assert(maxNumExecutorsNeededPerResourceProfile(manager, defaultProfile) == 1) + } + + test("SPARK-31418: multiple stages being unschedulable") { + val clock = new ManualClock() + val conf = createConf(0, 10, 0).set(config.EXECUTOR_CORES, 2) + val manager = createManager(conf, clock = clock) + val updatesNeeded = + new mutable.HashMap[ResourceProfile, ExecutorAllocationManager.TargetNumUpdates] + + post(SparkListenerStageSubmitted(createStageInfo(0, 2))) + post(SparkListenerStageSubmitted(createStageInfo(1, 2))) + post(SparkListenerStageSubmitted(createStageInfo(2, 2))) + + assert(addExecutorsToTargetForDefaultProfile(manager, updatesNeeded) === 1) + doUpdateRequest(manager, updatesNeeded.toMap, clock.getTimeMillis()) + assert(addExecutorsToTargetForDefaultProfile(manager, updatesNeeded) === 2) + doUpdateRequest(manager, updatesNeeded.toMap, clock.getTimeMillis()) + assert(addExecutorsToTargetForDefaultProfile(manager, updatesNeeded) === 0) + + // Add necessary executors + (0 to 2).foreach(execId => onExecutorAddedDefaultProfile(manager, execId.toString)) + + // Start all the tasks + (0 to 2).foreach { + i => + val t1Info = createTaskInfo(0, (i * 2) + 1, executorId = s"${i / 2}") + val t2Info = createTaskInfo(1, (i * 2) + 2, executorId = s"${i / 2}") + post(SparkListenerTaskStart(i, 0, t1Info)) + post(SparkListenerTaskStart(i, 0, t2Info)) + } + assert(numExecutorsTarget(manager, defaultProfile.id) === 3) + assert(maxNumExecutorsNeededPerResourceProfile(manager, defaultProfile) == 3) + + // Complete the stage 0 tasks. + val t1Info = createTaskInfo(0, 0, executorId = s"0") + val t2Info = createTaskInfo(1, 1, executorId = s"0") + post(SparkListenerTaskEnd(0, 0, null, Success, t1Info, new ExecutorMetrics, null)) + post(SparkListenerTaskEnd(0, 0, null, Success, t2Info, new ExecutorMetrics, null)) + post(SparkListenerStageCompleted(createStageInfo(0, 2))) + + // Stage 1 and 2 becomes unschedulable now due to excludeOnFailure + post(SparkListenerUnschedulableTaskSetAdded(1, 0)) + post(SparkListenerUnschedulableTaskSetAdded(2, 0)) + + clock.advance(1000) + manager invokePrivate _updateAndSyncNumExecutorsTarget(clock.nanoTime()) + // Assert that we are getting additional executor to schedule unschedulable tasks + assert(numExecutorsTarget(manager, defaultProfile.id) === 4) + assert(maxNumExecutorsNeededPerResourceProfile(manager, defaultProfile) == 4) + + // Add a new executor + onExecutorAddedDefaultProfile(manager, "3") + + // Now once the task becomes schedulable, clear the unschedulableTaskSets + post(SparkListenerUnschedulableTaskSetRemoved(1, 0)) + clock.advance(1000) + manager invokePrivate _updateAndSyncNumExecutorsTarget(clock.nanoTime()) + assert(numExecutorsTarget(manager, defaultProfile.id) === 4) + assert(maxNumExecutorsNeededPerResourceProfile(manager, defaultProfile) == 5) + } + + test("SPARK-31418: remove executors after unschedulable tasks end") { + val clock = new ManualClock() + val stage = createStageInfo(0, 10) + val conf = createConf(0, 6, 0).set(config.EXECUTOR_CORES, 2) + val manager = createManager(conf, clock = clock) + val updatesNeeded = + new mutable.HashMap[ResourceProfile, ExecutorAllocationManager.TargetNumUpdates] + + post(SparkListenerStageSubmitted(stage)) + assert(addExecutorsToTargetForDefaultProfile(manager, updatesNeeded) === 1) + doUpdateRequest(manager, updatesNeeded.toMap, clock.getTimeMillis()) + assert(addExecutorsToTargetForDefaultProfile(manager, updatesNeeded) === 2) + doUpdateRequest(manager, updatesNeeded.toMap, clock.getTimeMillis()) + assert(addExecutorsToTargetForDefaultProfile(manager, updatesNeeded) === 2) + doUpdateRequest(manager, updatesNeeded.toMap, clock.getTimeMillis()) + assert(addExecutorsToTargetForDefaultProfile(manager, updatesNeeded) === 0) + doUpdateRequest(manager, updatesNeeded.toMap, clock.getTimeMillis()) + + (0 to 4).foreach(execId => onExecutorAddedDefaultProfile(manager, execId.toString)) + (0 to 9).map { i => createTaskInfo(i, i, executorId = s"${i / 2}") }.foreach { + info => post(SparkListenerTaskStart(0, 0, info)) + } + assert(numExecutorsTarget(manager, defaultProfile.id) === 5) + assert(maxNumExecutorsNeededPerResourceProfile(manager, defaultProfile) == 5) + + // 8 tasks (0 - 7) finished + (0 to 7).map { i => createTaskInfo(i, i, executorId = s"${i / 2}") }.foreach { + info => post(SparkListenerTaskEnd(0, 0, null, Success, info, new ExecutorMetrics, null)) + } + clock.advance(1000) + manager invokePrivate _updateAndSyncNumExecutorsTarget(clock.nanoTime()) + assert(numExecutorsTarget(manager, defaultProfile.id) === 1) + assert(maxNumExecutorsNeededPerResourceProfile(manager, defaultProfile) == 1) + (0 to 3).foreach { i => assert(removeExecutorDefaultProfile(manager, i.toString)) } + (0 to 3).foreach { i => onExecutorRemoved(manager, i.toString) } + + // Now due to executor being excluded, the task becomes unschedulable + post(SparkListenerUnschedulableTaskSetAdded(0, 0)) + clock.advance(1000) + manager invokePrivate _updateAndSyncNumExecutorsTarget(clock.nanoTime()) + assert(numExecutorsTarget(manager, defaultProfile.id) === 2) + assert(maxNumExecutorsNeededPerResourceProfile(manager, defaultProfile) == 2) + + // New executor got added + onExecutorAddedDefaultProfile(manager, "5") + + // Now once the task becomes schedulable, clear the unschedulableTaskSets + post(SparkListenerUnschedulableTaskSetRemoved(0, 0)) + clock.advance(1000) + manager invokePrivate _updateAndSyncNumExecutorsTarget(clock.nanoTime()) + assert(numExecutorsTarget(manager, defaultProfile.id) === 1) + assert(maxNumExecutorsNeededPerResourceProfile(manager, defaultProfile) == 1) + post(SparkListenerTaskEnd(0, 0, null, Success, + createTaskInfo(9, 9, "4"), new ExecutorMetrics, null)) + // Unschedulable task successfully ran on the new executor provisioned + post(SparkListenerTaskEnd(0, 0, null, Success, + createTaskInfo(8, 8, "5"), new ExecutorMetrics, null)) + clock.advance(1000) + manager invokePrivate _updateAndSyncNumExecutorsTarget(clock.nanoTime()) + post(SparkListenerStageCompleted(stage)) + clock.advance(1000) + manager invokePrivate _updateAndSyncNumExecutorsTarget(clock.nanoTime()) + assert(numExecutorsTarget(manager, defaultProfile.id) === 0) + assert(maxNumExecutorsNeededPerResourceProfile(manager, defaultProfile) == 0) + assert(removeExecutorDefaultProfile(manager, "4")) + onExecutorRemoved(manager, "4") + assert(removeExecutorDefaultProfile(manager, "5")) + onExecutorRemoved(manager, "5") + } + test("SPARK-30511 remove executors when speculative tasks end") { val clock = new ManualClock() val stage = createStageInfo(0, 40) @@ -766,6 +936,53 @@ class ExecutorAllocationManagerSuite extends SparkFunSuite { assert(executorsPendingToRemove(manager).isEmpty) } + test("SPARK-33763: metrics to track dynamic allocation (decommissionEnabled=false)") { + val manager = createManager(createConf(3, 5, 3)) + (1 to 5).map(_.toString).foreach { id => onExecutorAddedDefaultProfile(manager, id) } + + assert(executorsPendingToRemove(manager).isEmpty) + assert(removeExecutorsDefaultProfile(manager, Seq("1", "2")) === Seq("1", "2")) + assert(executorsPendingToRemove(manager).contains("1")) + assert(executorsPendingToRemove(manager).contains("2")) + + onExecutorRemoved(manager, "1", "driver requested exit") + assert(manager.executorAllocationManagerSource.driverKilled.getCount() === 1) + assert(manager.executorAllocationManagerSource.exitedUnexpectedly.getCount() === 0) + + onExecutorRemoved(manager, "2", "another driver requested exit") + assert(manager.executorAllocationManagerSource.driverKilled.getCount() === 2) + assert(manager.executorAllocationManagerSource.exitedUnexpectedly.getCount() === 0) + + onExecutorRemoved(manager, "3", "this will be an unexpected exit") + assert(manager.executorAllocationManagerSource.driverKilled.getCount() === 2) + assert(manager.executorAllocationManagerSource.exitedUnexpectedly.getCount() === 1) + } + + test("SPARK-33763: metrics to track dynamic allocation (decommissionEnabled = true)") { + val manager = createManager(createConf(3, 5, 3, decommissioningEnabled = true)) + (1 to 5).map(_.toString).foreach { id => onExecutorAddedDefaultProfile(manager, id) } + + assert(executorsPendingToRemove(manager).isEmpty) + assert(removeExecutorsDefaultProfile(manager, Seq("1", "2")) === Seq("1", "2")) + assert(executorsDecommissioning(manager).contains("1")) + assert(executorsDecommissioning(manager).contains("2")) + + onExecutorRemoved(manager, "1", ExecutorLossMessage.decommissionFinished) + assert(manager.executorAllocationManagerSource.gracefullyDecommissioned.getCount() === 1) + assert(manager.executorAllocationManagerSource.decommissionUnfinished.getCount() === 0) + assert(manager.executorAllocationManagerSource.exitedUnexpectedly.getCount() === 0) + + onExecutorRemoved(manager, "2", "stopped before gracefully finished") + assert(manager.executorAllocationManagerSource.gracefullyDecommissioned.getCount() === 1) + assert(manager.executorAllocationManagerSource.decommissionUnfinished.getCount() === 1) + assert(manager.executorAllocationManagerSource.exitedUnexpectedly.getCount() === 0) + + onExecutorRemoved(manager, "3", "this will be an unexpected exit") + assert(manager.executorAllocationManagerSource.gracefullyDecommissioned.getCount() === 1) + assert(manager.executorAllocationManagerSource.decommissionUnfinished.getCount() === 1) + assert(manager.executorAllocationManagerSource.exitedUnexpectedly.getCount() === 1) + } + test("remove multiple executors") { val manager = createManager(createConf(5, 10, 5)) (1 to 10).map(_.toString).foreach { id => onExecutorAddedDefaultProfile(manager, id) } @@ -1101,6 +1318,68 @@ class ExecutorAllocationManagerSuite extends SparkFunSuite { assert(executorsPendingToRemove(manager).size === 6) // limit reached (1 executor remaining) } + test("mock polling loop remove with decommissioning") { + val clock = new ManualClock(2020L) + val manager = createManager(createConf(1, 20, 1, true), clock = clock) + + // Remove idle executors on timeout + onExecutorAddedDefaultProfile(manager, "executor-1") + onExecutorAddedDefaultProfile(manager, "executor-2") + onExecutorAddedDefaultProfile(manager, "executor-3") + assert(executorsDecommissioning(manager).isEmpty) + assert(executorsPendingToRemove(manager).isEmpty) + + // idle threshold not reached yet + clock.advance(executorIdleTimeout * 1000 / 2) + schedule(manager) + assert(manager.executorMonitor.timedOutExecutors().isEmpty) + assert(executorsPendingToRemove(manager).isEmpty) + assert(executorsDecommissioning(manager).isEmpty) + + // idle threshold exceeded + clock.advance(executorIdleTimeout * 1000) + assert(manager.executorMonitor.timedOutExecutors().size === 3) + schedule(manager) + assert(executorsPendingToRemove(manager).isEmpty) // limit reached (1 executor remaining) + assert(executorsDecommissioning(manager).size === 2) // limit reached (1 executor remaining) + + // Mark a subset as busy - only idle executors should be removed + onExecutorAddedDefaultProfile(manager, "executor-4") + onExecutorAddedDefaultProfile(manager, "executor-5") + onExecutorAddedDefaultProfile(manager, "executor-6") + onExecutorAddedDefaultProfile(manager, "executor-7") + assert(manager.executorMonitor.executorCount === 7) + assert(executorsPendingToRemove(manager).isEmpty) // no pending to be removed + assert(executorsDecommissioning(manager).size === 2) // 2 decommissioning + onExecutorBusy(manager, "executor-4") + onExecutorBusy(manager, "executor-5") + onExecutorBusy(manager, "executor-6") // 3 busy and 2 idle (of the 5 active ones) + + // after scheduling, the previously timed out executor should be removed, since + // there are new active ones. + schedule(manager) + assert(executorsDecommissioning(manager).size === 3) + + // advance the clock so that idle executors should time out and move to the pending list + clock.advance(executorIdleTimeout * 1000) + schedule(manager) + assert(executorsPendingToRemove(manager).size === 0) + assert(executorsDecommissioning(manager).size === 4) + assert(!executorsDecommissioning(manager).contains("executor-4")) + assert(!executorsDecommissioning(manager).contains("executor-5")) + assert(!executorsDecommissioning(manager).contains("executor-6")) + + // Busy executors are now idle and should be removed + onExecutorIdle(manager, "executor-4") + onExecutorIdle(manager, "executor-5") + onExecutorIdle(manager, "executor-6") + schedule(manager) + assert(executorsDecommissioning(manager).size === 4) + clock.advance(executorIdleTimeout * 1000) + schedule(manager) + assert(executorsDecommissioning(manager).size === 6) // limit reached (1 executor remaining) + } + test("listeners trigger add executors correctly") { val manager = createManager(createConf(1, 20, 1)) assert(addTime(manager) === NOT_SET) @@ -1356,7 +1635,7 @@ class ExecutorAllocationManagerSuite extends SparkFunSuite { test("SPARK-23365 Don't update target num executors when killing idle executors") { val clock = new ManualClock() val manager = createManager( - createConf(1, 2, 1).set(config.DYN_ALLOCATION_TESTING, false), + createConf(1, 2, 1), clock = clock) when(client.requestTotalExecutors(any(), any(), any())).thenReturn(true) @@ -1384,19 +1663,17 @@ class ExecutorAllocationManagerSuite extends SparkFunSuite { clock.advance(1000) manager invokePrivate _updateAndSyncNumExecutorsTarget(clock.nanoTime()) assert(numExecutorsTargetForDefaultProfileId(manager) === 1) - verify(client, never).killExecutors(any(), any(), any(), any()) + assert(manager.executorMonitor.executorsPendingToRemove().isEmpty) // now we cross the idle timeout for executor-1, so we kill it. the really important // thing here is that we do *not* ask the executor allocation client to adjust the target // number of executors down - when(client.killExecutors(Seq("executor-1"), false, false, false)) - .thenReturn(Seq("executor-1")) clock.advance(3000) schedule(manager) assert(maxNumExecutorsNeededPerResourceProfile(manager, defaultProfile) === 1) assert(numExecutorsTargetForDefaultProfileId(manager) === 1) // here's the important verify -- we did kill the executors, but did not adjust the target count - verify(client).killExecutors(Seq("executor-1"), false, false, false) + assert(manager.executorMonitor.executorsPendingToRemove() === Set("executor-1")) } test("SPARK-26758 check executor target number after idle time out ") { @@ -1419,7 +1696,8 @@ class ExecutorAllocationManagerSuite extends SparkFunSuite { private def createConf( minExecutors: Int = 1, maxExecutors: Int = 5, - initialExecutors: Int = 1): SparkConf = { + initialExecutors: Int = 1, + decommissioningEnabled: Boolean = false): SparkConf = { val sparkConf = new SparkConf() .set(config.DYN_ALLOCATION_ENABLED, true) .set(config.DYN_ALLOCATION_MIN_EXECUTORS, minExecutors) @@ -1432,9 +1710,11 @@ class ExecutorAllocationManagerSuite extends SparkFunSuite { .set(config.DYN_ALLOCATION_EXECUTOR_IDLE_TIMEOUT.key, s"${executorIdleTimeout.toString}s") .set(config.SHUFFLE_SERVICE_ENABLED, true) .set(config.DYN_ALLOCATION_TESTING, true) - // SPARK-22864: effectively disable the allocation schedule by setting the period to a - // really long value. - .set(TEST_SCHEDULE_INTERVAL, 10000L) + // SPARK-22864/SPARK-32287: effectively disable the allocation schedule for the tests so that + // we won't result in the race condition between thread "spark-dynamic-executor-allocation" + // and thread "pool-1-thread-1-ScalaTest-running". + .set(TEST_DYNAMIC_ALLOCATION_SCHEDULE_ENABLED, false) + .set(DECOMMISSION_ENABLED, decommissioningEnabled) sparkConf } @@ -1442,7 +1722,7 @@ class ExecutorAllocationManagerSuite extends SparkFunSuite { conf: SparkConf, clock: Clock = new SystemClock()): ExecutorAllocationManager = { ResourceProfile.reInitDefaultProfile(conf) - rpManager = new ResourceProfileManager(conf) + rpManager = new ResourceProfileManager(conf, listenerBus) val manager = new ExecutorAllocationManager(client, listenerBus, conf, clock = clock, resourceProfileManager = rpManager) managers += manager @@ -1468,8 +1748,11 @@ class ExecutorAllocationManagerSuite extends SparkFunSuite { post(SparkListenerExecutorAdded(0L, id, execInfo)) } - private def onExecutorRemoved(manager: ExecutorAllocationManager, id: String): Unit = { - post(SparkListenerExecutorRemoved(0L, id, null)) + private def onExecutorRemoved( + manager: ExecutorAllocationManager, + id: String, + reason: String = null): Unit = { + post(SparkListenerExecutorRemoved(0L, id, reason)) } private def onExecutorBusy(manager: ExecutorAllocationManager, id: String): Unit = { @@ -1501,6 +1784,10 @@ class ExecutorAllocationManagerSuite extends SparkFunSuite { private def executorsPendingToRemove(manager: ExecutorAllocationManager): Set[String] = { manager.executorMonitor.executorsPendingToRemove() } + + private def executorsDecommissioning(manager: ExecutorAllocationManager): Set[String] = { + manager.executorMonitor.executorsDecommissioning() + } } /** diff --git a/core/src/test/scala/org/apache/spark/ExternalShuffleServiceSuite.scala b/core/src/test/scala/org/apache/spark/ExternalShuffleServiceSuite.scala index c217419f4092e..48c1cc5906f30 100644 --- a/core/src/test/scala/org/apache/spark/ExternalShuffleServiceSuite.scala +++ b/core/src/test/scala/org/apache/spark/ExternalShuffleServiceSuite.scala @@ -19,6 +19,7 @@ package org.apache.spark import org.scalatest.BeforeAndAfterAll import org.scalatest.concurrent.Eventually +import org.scalatest.matchers.should.Matchers._ import org.scalatest.time.SpanSugar._ import org.apache.spark.internal.config @@ -72,12 +73,12 @@ class ExternalShuffleServiceSuite extends ShuffleSuite with BeforeAndAfterAll wi sc.env.blockManager.externalShuffleServiceEnabled should equal(true) sc.env.blockManager.blockStoreClient.getClass should equal(classOf[ExternalBlockStoreClient]) - // In a slow machine, one slave may register hundreds of milliseconds ahead of the other one. - // If we don't wait for all slaves, it's possible that only one executor runs all jobs. Then + // In a slow machine, one executor may register hundreds of milliseconds ahead of the other one. + // If we don't wait for all executors, it's possible that only one executor runs all jobs. Then // all shuffle blocks will be in this executor, ShuffleBlockFetcherIterator will directly fetch // local blocks from the local BlockManager and won't send requests to ExternalShuffleService. // In this case, we won't receive FetchFailed. And it will make this test fail. - // Therefore, we should wait until all slaves are up + // Therefore, we should wait until all executors are up TestUtils.waitUntilExecutorsUp(sc, 2, 60000) val rdd = sc.parallelize(0 until 1000, 10) @@ -99,50 +100,6 @@ class ExternalShuffleServiceSuite extends ShuffleSuite with BeforeAndAfterAll wi e.getMessage should include ("Fetch failure will not retry stage due to testing config") } - test("SPARK-27651: read host local shuffle blocks from disk and avoid network remote fetches") { - val confWithHostLocalRead = - conf.clone.set(config.SHUFFLE_HOST_LOCAL_DISK_READING_ENABLED, true) - confWithHostLocalRead.set(config.STORAGE_LOCAL_DISK_BY_EXECUTORS_CACHE_SIZE, 5) - sc = new SparkContext("local-cluster[2,1,1024]", "test", confWithHostLocalRead) - sc.getConf.get(config.SHUFFLE_HOST_LOCAL_DISK_READING_ENABLED) should equal(true) - sc.env.blockManager.externalShuffleServiceEnabled should equal(true) - sc.env.blockManager.hostLocalDirManager.isDefined should equal(true) - sc.env.blockManager.blockStoreClient.getClass should equal(classOf[ExternalBlockStoreClient]) - - // In a slow machine, one slave may register hundreds of milliseconds ahead of the other one. - // If we don't wait for all slaves, it's possible that only one executor runs all jobs. Then - // all shuffle blocks will be in this executor, ShuffleBlockFetcherIterator will directly fetch - // local blocks from the local BlockManager and won't send requests to ExternalShuffleService. - // In this case, we won't receive FetchFailed. And it will make this test fail. - // Therefore, we should wait until all slaves are up - TestUtils.waitUntilExecutorsUp(sc, 2, 60000) - - val rdd = sc.parallelize(0 until 1000, 10) - .map { i => (i, 1) } - .reduceByKey(_ + _) - - rdd.count() - rdd.count() - - val cachedExecutors = rdd.mapPartitions { _ => - SparkEnv.get.blockManager.hostLocalDirManager.map { localDirManager => - localDirManager.getCachedHostLocalDirs().keySet.iterator - }.getOrElse(Iterator.empty) - }.collect().toSet - - // both executors are caching the dirs of the other one - cachedExecutors should equal(sc.getExecutorIds().toSet) - - // Invalidate the registered executors, disallowing access to their shuffle blocks (without - // deleting the actual shuffle files, so we could access them without the shuffle service). - // As directories are already cached there is no request to external shuffle service. - rpcHandler.applicationRemoved(sc.conf.getAppId, false /* cleanupLocalDirs */) - - // Now Spark will not receive FetchFailed as host local blocks are read from the cached local - // disk directly - rdd.collect().map(_._2).sum should equal(1000) - } - test("SPARK-25888: using external shuffle service fetching disk persisted blocks") { val confWithRddFetchEnabled = conf.clone.set(config.SHUFFLE_SERVICE_FETCH_RDD_ENABLED, true) sc = new SparkContext("local-cluster[1,1,1024]", "test", confWithRddFetchEnabled) diff --git a/core/src/test/scala/org/apache/spark/FileSuite.scala b/core/src/test/scala/org/apache/spark/FileSuite.scala index e9ee6b5dfb665..f953bf4043f33 100644 --- a/core/src/test/scala/org/apache/spark/FileSuite.scala +++ b/core/src/test/scala/org/apache/spark/FileSuite.scala @@ -170,7 +170,7 @@ class FileSuite extends SparkFunSuite with LocalSparkContext { val nums = sc.makeRDD(1 to 3).map(x => (x, "a" * x)) // (1,a), (2,aa), (3,aaa) nums.saveAsSequenceFile(outputDir) // Similar to the tests above, we read a SequenceFile, but this time we pass type params - // that are convertable to Writable instead of calling sequenceFile[IntWritable, Text] + // that are convertible to Writable instead of calling sequenceFile[IntWritable, Text] val output1 = sc.sequenceFile[Int, String](outputDir) assert(output1.collect().toList === List((1, "a"), (2, "aa"), (3, "aaa"))) // Also try having one type be a subclass of Writable and one not diff --git a/core/src/test/scala/org/apache/spark/FutureActionSuite.scala b/core/src/test/scala/org/apache/spark/FutureActionSuite.scala index 70b6309be7d53..737a856ba13f1 100644 --- a/core/src/test/scala/org/apache/spark/FutureActionSuite.scala +++ b/core/src/test/scala/org/apache/spark/FutureActionSuite.scala @@ -19,7 +19,9 @@ package org.apache.spark import scala.concurrent.duration.Duration -import org.scalatest.{BeforeAndAfter, Matchers} +import org.scalatest.BeforeAndAfter +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.util.ThreadUtils diff --git a/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala b/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala index 312691302b064..879ce5584061e 100644 --- a/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala +++ b/core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala @@ -76,7 +76,7 @@ class HeartbeatReceiverSuite sc = spy(new SparkContext(conf)) scheduler = mock(classOf[TaskSchedulerImpl]) when(sc.taskScheduler).thenReturn(scheduler) - when(scheduler.nodeBlacklist).thenReturn(Predef.Set[String]()) + when(scheduler.excludedNodes).thenReturn(Predef.Set[String]()) when(scheduler.sc).thenReturn(sc) heartbeatReceiverClock = new ManualClock heartbeatReceiver = new HeartbeatReceiver(sc, heartbeatReceiverClock) @@ -219,6 +219,24 @@ class HeartbeatReceiverSuite fakeSchedulerBackend.stop() } + test("SPARK-34273: Do not reregister BlockManager when SparkContext is stopped") { + val blockManagerId = BlockManagerId(executorId1, "localhost", 12345) + + heartbeatReceiverRef.askSync[Boolean](TaskSchedulerIsSet) + val response = heartbeatReceiverRef.askSync[HeartbeatResponse]( + Heartbeat(executorId1, Array.empty, blockManagerId, mutable.Map.empty)) + assert(response.reregisterBlockManager) + + try { + sc.stopped.set(true) + val response = heartbeatReceiverRef.askSync[HeartbeatResponse]( + Heartbeat(executorId1, Array.empty, blockManagerId, mutable.Map.empty)) + assert(!response.reregisterBlockManager) + } finally { + sc.stopped.set(false) + } + } + /** Manually send a heartbeat and return the response. */ private def triggerHeartbeat( executorId: String, @@ -261,7 +279,7 @@ class HeartbeatReceiverSuite // We may receive undesired SparkListenerExecutorAdded from LocalSchedulerBackend, // so exclude it from the map. See SPARK-10800. heartbeatReceiver.invokePrivate(_executorLastSeen()). - filterKeys(_ != SparkContext.DRIVER_IDENTIFIER) + filterKeys(_ != SparkContext.DRIVER_IDENTIFIER).toMap } } @@ -287,6 +305,8 @@ private class FakeSchedulerBackend( resourceProfileManager: ResourceProfileManager) extends CoarseGrainedSchedulerBackend(scheduler, rpcEnv) { + def this() = this(null, null, null, null) + protected override def doRequestTotalExecutors( resourceProfileToTotalExecs: Map[ResourceProfile, Int]): Future[Boolean] = { clusterManagerEndpoint.ask[Boolean]( diff --git a/core/src/test/scala/org/apache/spark/InternalAccumulatorSuite.scala b/core/src/test/scala/org/apache/spark/InternalAccumulatorSuite.scala index 5399d868f46f1..f2b81e5153ae4 100644 --- a/core/src/test/scala/org/apache/spark/InternalAccumulatorSuite.scala +++ b/core/src/test/scala/org/apache/spark/InternalAccumulatorSuite.scala @@ -220,7 +220,7 @@ class InternalAccumulatorSuite extends SparkFunSuite with LocalSparkContext { super.registerAccumulatorForCleanup(a) } - def accumsRegisteredForCleanup: Seq[Long] = accumsRegistered.toArray + def accumsRegisteredForCleanup: Seq[Long] = accumsRegistered.toSeq } } diff --git a/core/src/test/scala/org/apache/spark/JobCancellationSuite.scala b/core/src/test/scala/org/apache/spark/JobCancellationSuite.scala index 94ad8d8880027..082a92ef41d3b 100644 --- a/core/src/test/scala/org/apache/spark/JobCancellationSuite.scala +++ b/core/src/test/scala/org/apache/spark/JobCancellationSuite.scala @@ -25,7 +25,7 @@ import scala.concurrent.Future import scala.concurrent.duration._ import org.scalatest.BeforeAndAfter -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers import org.apache.spark.internal.config._ import org.apache.spark.internal.config.Deploy._ diff --git a/core/src/test/scala/org/apache/spark/MapOutputTrackerSuite.scala b/core/src/test/scala/org/apache/spark/MapOutputTrackerSuite.scala index d5ee19bde8edf..f4b47e2bb0cdc 100644 --- a/core/src/test/scala/org/apache/spark/MapOutputTrackerSuite.scala +++ b/core/src/test/scala/org/apache/spark/MapOutputTrackerSuite.scala @@ -21,22 +21,23 @@ import scala.collection.mutable.ArrayBuffer import org.mockito.ArgumentMatchers.any import org.mockito.Mockito._ +import org.roaringbitmap.RoaringBitmap import org.apache.spark.LocalSparkContext._ import org.apache.spark.broadcast.BroadcastManager import org.apache.spark.internal.config._ import org.apache.spark.internal.config.Network.{RPC_ASK_TIMEOUT, RPC_MESSAGE_MAX_SIZE} +import org.apache.spark.internal.config.Tests.IS_TESTING import org.apache.spark.rpc.{RpcAddress, RpcCallContext, RpcEnv} -import org.apache.spark.scheduler.{CompressedMapStatus, MapStatus} +import org.apache.spark.scheduler.{CompressedMapStatus, MapStatus, MergeStatus} import org.apache.spark.shuffle.FetchFailedException import org.apache.spark.storage.{BlockManagerId, ShuffleBlockId} -class MapOutputTrackerSuite extends SparkFunSuite { +class MapOutputTrackerSuite extends SparkFunSuite with LocalSparkContext { private val conf = new SparkConf private def newTrackerMaster(sparkConf: SparkConf = conf) = { - val broadcastManager = new BroadcastManager(true, sparkConf, - new SecurityManager(sparkConf)) + val broadcastManager = new BroadcastManager(true, sparkConf) new MapOutputTrackerMaster(sparkConf, broadcastManager, true) } @@ -59,7 +60,7 @@ class MapOutputTrackerSuite extends SparkFunSuite { val tracker = newTrackerMaster() tracker.trackerEndpoint = rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, new MapOutputTrackerMasterEndpoint(rpcEnv, tracker, conf)) - tracker.registerShuffle(10, 2) + tracker.registerShuffle(10, 2, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) assert(tracker.containsShuffle(10)) val size1000 = MapStatus.decompressSize(MapStatus.compressSize(1000L)) val size10000 = MapStatus.decompressSize(MapStatus.compressSize(10000L)) @@ -83,7 +84,7 @@ class MapOutputTrackerSuite extends SparkFunSuite { val tracker = newTrackerMaster() tracker.trackerEndpoint = rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, new MapOutputTrackerMasterEndpoint(rpcEnv, tracker, conf)) - tracker.registerShuffle(10, 2) + tracker.registerShuffle(10, 2, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) val compressedSize1000 = MapStatus.compressSize(1000L) val compressedSize10000 = MapStatus.compressSize(10000L) tracker.registerMapOutput(10, 0, MapStatus(BlockManagerId("a", "hostA", 1000), @@ -106,7 +107,7 @@ class MapOutputTrackerSuite extends SparkFunSuite { val tracker = newTrackerMaster() tracker.trackerEndpoint = rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, new MapOutputTrackerMasterEndpoint(rpcEnv, tracker, conf)) - tracker.registerShuffle(10, 2) + tracker.registerShuffle(10, 2, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) val compressedSize1000 = MapStatus.compressSize(1000L) val compressedSize10000 = MapStatus.compressSize(10000L) tracker.registerMapOutput(10, 0, MapStatus(BlockManagerId("a", "hostA", 1000), @@ -136,21 +137,21 @@ class MapOutputTrackerSuite extends SparkFunSuite { masterTracker.trackerEndpoint = rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, new MapOutputTrackerMasterEndpoint(rpcEnv, masterTracker, conf)) - val slaveRpcEnv = createRpcEnv("spark-slave", hostname, 0, new SecurityManager(conf)) - val slaveTracker = new MapOutputTrackerWorker(conf) - slaveTracker.trackerEndpoint = - slaveRpcEnv.setupEndpointRef(rpcEnv.address, MapOutputTracker.ENDPOINT_NAME) + val mapWorkerRpcEnv = createRpcEnv("spark-worker", hostname, 0, new SecurityManager(conf)) + val mapWorkerTracker = new MapOutputTrackerWorker(conf) + mapWorkerTracker.trackerEndpoint = + mapWorkerRpcEnv.setupEndpointRef(rpcEnv.address, MapOutputTracker.ENDPOINT_NAME) - masterTracker.registerShuffle(10, 1) - slaveTracker.updateEpoch(masterTracker.getEpoch) + masterTracker.registerShuffle(10, 1, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) + mapWorkerTracker.updateEpoch(masterTracker.getEpoch) // This is expected to fail because no outputs have been registered for the shuffle. - intercept[FetchFailedException] { slaveTracker.getMapSizesByExecutorId(10, 0) } + intercept[FetchFailedException] { mapWorkerTracker.getMapSizesByExecutorId(10, 0) } val size1000 = MapStatus.decompressSize(MapStatus.compressSize(1000L)) masterTracker.registerMapOutput(10, 0, MapStatus( BlockManagerId("a", "hostA", 1000), Array(1000L), 5)) - slaveTracker.updateEpoch(masterTracker.getEpoch) - assert(slaveTracker.getMapSizesByExecutorId(10, 0).toSeq === + mapWorkerTracker.updateEpoch(masterTracker.getEpoch) + assert(mapWorkerTracker.getMapSizesByExecutorId(10, 0).toSeq === Seq((BlockManagerId("a", "hostA", 1000), ArrayBuffer((ShuffleBlockId(10, 5, 0), size1000, 0))))) assert(0 == masterTracker.getNumCachedSerializedBroadcast) @@ -158,17 +159,17 @@ class MapOutputTrackerSuite extends SparkFunSuite { val masterTrackerEpochBeforeLossOfMapOutput = masterTracker.getEpoch masterTracker.unregisterMapOutput(10, 0, BlockManagerId("a", "hostA", 1000)) assert(masterTracker.getEpoch > masterTrackerEpochBeforeLossOfMapOutput) - slaveTracker.updateEpoch(masterTracker.getEpoch) - intercept[FetchFailedException] { slaveTracker.getMapSizesByExecutorId(10, 0) } + mapWorkerTracker.updateEpoch(masterTracker.getEpoch) + intercept[FetchFailedException] { mapWorkerTracker.getMapSizesByExecutorId(10, 0) } // failure should be cached - intercept[FetchFailedException] { slaveTracker.getMapSizesByExecutorId(10, 0) } + intercept[FetchFailedException] { mapWorkerTracker.getMapSizesByExecutorId(10, 0) } assert(0 == masterTracker.getNumCachedSerializedBroadcast) masterTracker.stop() - slaveTracker.stop() + mapWorkerTracker.stop() rpcEnv.shutdown() - slaveRpcEnv.shutdown() + mapWorkerRpcEnv.shutdown() } test("remote fetch below max RPC message size") { @@ -184,7 +185,7 @@ class MapOutputTrackerSuite extends SparkFunSuite { rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, masterEndpoint) // Message size should be ~123B, and no exception should be thrown - masterTracker.registerShuffle(10, 1) + masterTracker.registerShuffle(10, 1, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) masterTracker.registerMapOutput(10, 0, MapStatus( BlockManagerId("88", "mph", 1000), Array.fill[Long](10)(0), 5)) val senderAddress = RpcAddress("localhost", 12345) @@ -218,7 +219,7 @@ class MapOutputTrackerSuite extends SparkFunSuite { // on hostA with output size 2 // on hostA with output size 2 // on hostB with output size 3 - tracker.registerShuffle(10, 3) + tracker.registerShuffle(10, 3, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) tracker.registerMapOutput(10, 0, MapStatus(BlockManagerId("a", "hostA", 1000), Array(2L), 5)) tracker.registerMapOutput(10, 1, MapStatus(BlockManagerId("a", "hostA", 1000), @@ -261,7 +262,7 @@ class MapOutputTrackerSuite extends SparkFunSuite { // Frame size should be ~1.1MB, and MapOutputTrackerMasterEndpoint should throw exception. // Note that the size is hand-selected here because map output statuses are compressed before // being sent. - masterTracker.registerShuffle(20, 100) + masterTracker.registerShuffle(20, 100, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) (0 until 100).foreach { i => masterTracker.registerMapOutput(20, i, new CompressedMapStatus( BlockManagerId("999", "mps", 1000), Array.fill[Long](4000000)(0), 5)) @@ -307,7 +308,7 @@ class MapOutputTrackerSuite extends SparkFunSuite { val tracker = newTrackerMaster() tracker.trackerEndpoint = rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, new MapOutputTrackerMasterEndpoint(rpcEnv, tracker, conf)) - tracker.registerShuffle(10, 2) + tracker.registerShuffle(10, 2, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) val size0 = MapStatus.decompressSize(MapStatus.compressSize(0L)) val size1000 = MapStatus.decompressSize(MapStatus.compressSize(1000L)) @@ -317,7 +318,7 @@ class MapOutputTrackerSuite extends SparkFunSuite { tracker.registerMapOutput(10, 1, MapStatus(BlockManagerId("b", "hostB", 1000), Array(size10000, size0, size1000, size0), 6)) assert(tracker.containsShuffle(10)) - assert(tracker.getMapSizesByExecutorId(10, 0, 4).toSeq === + assert(tracker.getMapSizesByExecutorId(10, 0, 2, 0, 4).toSeq === Seq( (BlockManagerId("a", "hostA", 1000), Seq((ShuffleBlockId(10, 5, 1), size1000, 0), @@ -333,4 +334,334 @@ class MapOutputTrackerSuite extends SparkFunSuite { rpcEnv.shutdown() } + test("SPARK-32921: master register and unregister merge result") { + conf.set(PUSH_BASED_SHUFFLE_ENABLED, true) + conf.set(IS_TESTING, true) + val rpcEnv = createRpcEnv("test") + val tracker = newTrackerMaster() + tracker.trackerEndpoint = rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, + new MapOutputTrackerMasterEndpoint(rpcEnv, tracker, conf)) + tracker.registerShuffle(10, 4, 2) + assert(tracker.containsShuffle(10)) + val bitmap = new RoaringBitmap() + bitmap.add(0) + bitmap.add(1) + + tracker.registerMergeResult(10, 0, MergeStatus(BlockManagerId("a", "hostA", 1000), + bitmap, 1000L)) + tracker.registerMergeResult(10, 1, MergeStatus(BlockManagerId("b", "hostB", 1000), + bitmap, 1000L)) + assert(tracker.getNumAvailableMergeResults(10) == 2) + tracker.unregisterMergeResult(10, 0, BlockManagerId("a", "hostA", 1000)) + assert(tracker.getNumAvailableMergeResults(10) == 1) + tracker.stop() + rpcEnv.shutdown() + } + + test("SPARK-32921: get map sizes with merged shuffle") { + conf.set(PUSH_BASED_SHUFFLE_ENABLED, true) + conf.set(IS_TESTING, true) + val hostname = "localhost" + val rpcEnv = createRpcEnv("spark", hostname, 0, new SecurityManager(conf)) + + val masterTracker = newTrackerMaster() + masterTracker.trackerEndpoint = rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, + new MapOutputTrackerMasterEndpoint(rpcEnv, masterTracker, conf)) + + val slaveRpcEnv = createRpcEnv("spark-slave", hostname, 0, new SecurityManager(conf)) + val slaveTracker = new MapOutputTrackerWorker(conf) + slaveTracker.trackerEndpoint = + slaveRpcEnv.setupEndpointRef(rpcEnv.address, MapOutputTracker.ENDPOINT_NAME) + + masterTracker.registerShuffle(10, 4, 1) + slaveTracker.updateEpoch(masterTracker.getEpoch) + val bitmap = new RoaringBitmap() + bitmap.add(0) + bitmap.add(1) + bitmap.add(3) + + val blockMgrId = BlockManagerId("a", "hostA", 1000) + masterTracker.registerMapOutput(10, 0, MapStatus(blockMgrId, Array(1000L), 0)) + masterTracker.registerMapOutput(10, 1, MapStatus(blockMgrId, Array(1000L), 1)) + masterTracker.registerMapOutput(10, 2, MapStatus(blockMgrId, Array(1000L), 2)) + masterTracker.registerMapOutput(10, 3, MapStatus(blockMgrId, Array(1000L), 3)) + + masterTracker.registerMergeResult(10, 0, MergeStatus(blockMgrId, + bitmap, 3000L)) + slaveTracker.updateEpoch(masterTracker.getEpoch) + val size1000 = MapStatus.decompressSize(MapStatus.compressSize(1000L)) + assert(slaveTracker.getMapSizesByExecutorId(10, 0).toSeq === + Seq((blockMgrId, ArrayBuffer((ShuffleBlockId(10, -1, 0), 3000, -1), + (ShuffleBlockId(10, 2, 0), size1000, 2))))) + + masterTracker.stop() + slaveTracker.stop() + rpcEnv.shutdown() + slaveRpcEnv.shutdown() + } + + test("SPARK-32921: get map statuses from merged shuffle") { + conf.set(PUSH_BASED_SHUFFLE_ENABLED, true) + conf.set(IS_TESTING, true) + val hostname = "localhost" + val rpcEnv = createRpcEnv("spark", hostname, 0, new SecurityManager(conf)) + + val masterTracker = newTrackerMaster() + masterTracker.trackerEndpoint = rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, + new MapOutputTrackerMasterEndpoint(rpcEnv, masterTracker, conf)) + + val slaveRpcEnv = createRpcEnv("spark-slave", hostname, 0, new SecurityManager(conf)) + val slaveTracker = new MapOutputTrackerWorker(conf) + slaveTracker.trackerEndpoint = + slaveRpcEnv.setupEndpointRef(rpcEnv.address, MapOutputTracker.ENDPOINT_NAME) + + masterTracker.registerShuffle(10, 4, 1) + slaveTracker.updateEpoch(masterTracker.getEpoch) + // This is expected to fail because no outputs have been registered for the shuffle. + intercept[FetchFailedException] { slaveTracker.getMapSizesByExecutorId(10, 0) } + val bitmap = new RoaringBitmap() + bitmap.add(0) + bitmap.add(1) + bitmap.add(2) + bitmap.add(3) + + val blockMgrId = BlockManagerId("a", "hostA", 1000) + masterTracker.registerMapOutput(10, 0, MapStatus(blockMgrId, Array(1000L), 0)) + masterTracker.registerMapOutput(10, 1, MapStatus(blockMgrId, Array(1000L), 1)) + masterTracker.registerMapOutput(10, 2, MapStatus(blockMgrId, Array(1000L), 2)) + masterTracker.registerMapOutput(10, 3, MapStatus(blockMgrId, Array(1000L), 3)) + + masterTracker.registerMergeResult(10, 0, MergeStatus(blockMgrId, + bitmap, 4000L)) + slaveTracker.updateEpoch(masterTracker.getEpoch) + val size1000 = MapStatus.decompressSize(MapStatus.compressSize(1000L)) + assert(slaveTracker.getMapSizesForMergeResult(10, 0).toSeq === + Seq((blockMgrId, ArrayBuffer((ShuffleBlockId(10, 0, 0), size1000, 0), + (ShuffleBlockId(10, 1, 0), size1000, 1), (ShuffleBlockId(10, 2, 0), size1000, 2), + (ShuffleBlockId(10, 3, 0), size1000, 3))))) + masterTracker.stop() + slaveTracker.stop() + rpcEnv.shutdown() + slaveRpcEnv.shutdown() + } + + test("SPARK-32921: get map statuses for merged shuffle block chunks") { + conf.set(PUSH_BASED_SHUFFLE_ENABLED, true) + conf.set(IS_TESTING, true) + val hostname = "localhost" + val rpcEnv = createRpcEnv("spark", hostname, 0, new SecurityManager(conf)) + + val masterTracker = newTrackerMaster() + masterTracker.trackerEndpoint = rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, + new MapOutputTrackerMasterEndpoint(rpcEnv, masterTracker, conf)) + + val slaveRpcEnv = createRpcEnv("spark-slave", hostname, 0, new SecurityManager(conf)) + val slaveTracker = new MapOutputTrackerWorker(conf) + slaveTracker.trackerEndpoint = + slaveRpcEnv.setupEndpointRef(rpcEnv.address, MapOutputTracker.ENDPOINT_NAME) + + masterTracker.registerShuffle(10, 4, 1) + slaveTracker.updateEpoch(masterTracker.getEpoch) + + val blockMgrId = BlockManagerId("a", "hostA", 1000) + masterTracker.registerMapOutput(10, 0, MapStatus(blockMgrId, Array(1000L), 0)) + masterTracker.registerMapOutput(10, 1, MapStatus(blockMgrId, Array(1000L), 1)) + masterTracker.registerMapOutput(10, 2, MapStatus(blockMgrId, Array(1000L), 2)) + masterTracker.registerMapOutput(10, 3, MapStatus(blockMgrId, Array(1000L), 3)) + + val chunkBitmap = new RoaringBitmap() + chunkBitmap.add(0) + chunkBitmap.add(2) + val size1000 = MapStatus.decompressSize(MapStatus.compressSize(1000L)) + assert(slaveTracker.getMapSizesForMergeResult(10, 0, chunkBitmap).toSeq === + Seq((blockMgrId, ArrayBuffer((ShuffleBlockId(10, 0, 0), size1000, 0), + (ShuffleBlockId(10, 2, 0), size1000, 2)))) + ) + masterTracker.stop() + slaveTracker.stop() + rpcEnv.shutdown() + slaveRpcEnv.shutdown() + } + + test("SPARK-32921: getPreferredLocationsForShuffle with MergeStatus") { + val rpcEnv = createRpcEnv("test") + val tracker = newTrackerMaster() + sc = new SparkContext("local", "test", conf.clone()) + tracker.trackerEndpoint = rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, + new MapOutputTrackerMasterEndpoint(rpcEnv, tracker, conf)) + // Setup 5 map tasks + // on hostA with output size 2 + // on hostA with output size 2 + // on hostB with output size 3 + // on hostB with output size 3 + // on hostC with output size 1 + // on hostC with output size 1 + tracker.registerShuffle(10, 6, 1) + tracker.registerMapOutput(10, 0, MapStatus(BlockManagerId("a", "hostA", 1000), + Array(2L), 5)) + tracker.registerMapOutput(10, 1, MapStatus(BlockManagerId("a", "hostA", 1000), + Array(2L), 6)) + tracker.registerMapOutput(10, 2, MapStatus(BlockManagerId("b", "hostB", 1000), + Array(3L), 7)) + tracker.registerMapOutput(10, 3, MapStatus(BlockManagerId("b", "hostB", 1000), + Array(3L), 8)) + tracker.registerMapOutput(10, 4, MapStatus(BlockManagerId("c", "hostC", 1000), + Array(1L), 9)) + tracker.registerMapOutput(10, 5, MapStatus(BlockManagerId("c", "hostC", 1000), + Array(1L), 10)) + + val rdd = sc.parallelize(1 to 6, 6).map(num => (num, num).asInstanceOf[Product2[Int, Int]]) + val mockShuffleDep = mock(classOf[ShuffleDependency[Int, Int, _]]) + when(mockShuffleDep.shuffleId).thenReturn(10) + when(mockShuffleDep.partitioner).thenReturn(new HashPartitioner(1)) + when(mockShuffleDep.rdd).thenReturn(rdd) + + // Prepare a MergeStatus that merges 4 out of 5 blocks + val bitmap80 = new RoaringBitmap() + bitmap80.add(0) + bitmap80.add(1) + bitmap80.add(2) + bitmap80.add(3) + bitmap80.add(4) + tracker.registerMergeResult(10, 0, MergeStatus(BlockManagerId("a", "hostA", 1000), + bitmap80, 11)) + + val preferredLocs1 = tracker.getPreferredLocationsForShuffle(mockShuffleDep, 0) + assert(preferredLocs1.nonEmpty) + assert(preferredLocs1.length === 1) + assert(preferredLocs1.head === "hostA") + + tracker.unregisterMergeResult(10, 0, BlockManagerId("a", "hostA", 1000)) + // Prepare another MergeStatus that merges only 1 out of 5 blocks + val bitmap20 = new RoaringBitmap() + bitmap20.add(0) + tracker.registerMergeResult(10, 0, MergeStatus(BlockManagerId("a", "hostA", 1000), + bitmap20, 2)) + + val preferredLocs2 = tracker.getPreferredLocationsForShuffle(mockShuffleDep, 0) + assert(preferredLocs2.nonEmpty) + assert(preferredLocs2.length === 2) + assert(preferredLocs2 === Seq("hostA", "hostB")) + + tracker.stop() + rpcEnv.shutdown() + } + + test("SPARK-34939: remote fetch using broadcast if broadcasted value is destroyed") { + val newConf = new SparkConf + newConf.set(RPC_MESSAGE_MAX_SIZE, 1) + newConf.set(RPC_ASK_TIMEOUT, "1") // Fail fast + newConf.set(SHUFFLE_MAPOUTPUT_MIN_SIZE_FOR_BROADCAST, 10240L) // 10 KiB << 1MiB framesize + + // needs TorrentBroadcast so need a SparkContext + withSpark(new SparkContext("local", "MapOutputTrackerSuite", newConf)) { sc => + val masterTracker = sc.env.mapOutputTracker.asInstanceOf[MapOutputTrackerMaster] + val rpcEnv = sc.env.rpcEnv + val masterEndpoint = new MapOutputTrackerMasterEndpoint(rpcEnv, masterTracker, newConf) + rpcEnv.stop(masterTracker.trackerEndpoint) + rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, masterEndpoint) + + masterTracker.registerShuffle(20, 100, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) + (0 until 100).foreach { i => + masterTracker.registerMapOutput(20, i, new CompressedMapStatus( + BlockManagerId("999", "mps", 1000), Array.fill[Long](4000000)(0), 5)) + } + + val mapWorkerRpcEnv = createRpcEnv("spark-worker", "localhost", 0, new SecurityManager(conf)) + val mapWorkerTracker = new MapOutputTrackerWorker(conf) + mapWorkerTracker.trackerEndpoint = + mapWorkerRpcEnv.setupEndpointRef(rpcEnv.address, MapOutputTracker.ENDPOINT_NAME) + + val fetchedBytes = mapWorkerTracker.trackerEndpoint + .askSync[Array[Byte]](GetMapOutputStatuses(20)) + assert(fetchedBytes(0) == 1) + + // Normally `unregisterMapOutput` triggers the destroy of broadcasted value. + // But the timing of destroying broadcasted value is indeterminate, we manually destroy + // it by blocking. + masterTracker.shuffleStatuses.get(20).foreach { shuffleStatus => + shuffleStatus.cachedSerializedBroadcast.destroy(true) + } + val err = intercept[SparkException] { + MapOutputTracker.deserializeOutputStatuses[MapStatus](fetchedBytes, conf) + } + assert(err.getMessage.contains("Unable to deserialize broadcasted output statuses")) + } + } + + test("SPARK-32921: test new protocol changes fetching both Map and Merge status in single RPC") { + val newConf = new SparkConf + newConf.set(RPC_MESSAGE_MAX_SIZE, 1) + newConf.set(RPC_ASK_TIMEOUT, "1") // Fail fast + newConf.set(SHUFFLE_MAPOUTPUT_MIN_SIZE_FOR_BROADCAST, 10240L) // 10 KiB << 1MiB framesize + newConf.set(PUSH_BASED_SHUFFLE_ENABLED, true) + newConf.set(IS_TESTING, true) + + // needs TorrentBroadcast so need a SparkContext + withSpark(new SparkContext("local", "MapOutputTrackerSuite", newConf)) { sc => + val masterTracker = sc.env.mapOutputTracker.asInstanceOf[MapOutputTrackerMaster] + val rpcEnv = sc.env.rpcEnv + val masterEndpoint = new MapOutputTrackerMasterEndpoint(rpcEnv, masterTracker, newConf) + rpcEnv.stop(masterTracker.trackerEndpoint) + rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, masterEndpoint) + val bitmap1 = new RoaringBitmap() + bitmap1.add(1) + + masterTracker.registerShuffle(20, 100, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) + (0 until 100).foreach { i => + masterTracker.registerMapOutput(20, i, new CompressedMapStatus( + BlockManagerId("999", "mps", 1000), Array.fill[Long](4000000)(0), 5)) + } + masterTracker.registerMergeResult(20, 0, MergeStatus(BlockManagerId("999", "mps", 1000), + bitmap1, 1000L)) + + val mapWorkerRpcEnv = createRpcEnv("spark-worker", "localhost", 0, new SecurityManager(conf)) + val mapWorkerTracker = new MapOutputTrackerWorker(conf) + mapWorkerTracker.trackerEndpoint = + mapWorkerRpcEnv.setupEndpointRef(rpcEnv.address, MapOutputTracker.ENDPOINT_NAME) + + val fetchedBytes = mapWorkerTracker.trackerEndpoint + .askSync[(Array[Byte], Array[Byte])](GetMapAndMergeResultStatuses(20)) + assert(masterTracker.getNumAvailableMergeResults(20) == 1) + assert(masterTracker.getNumAvailableOutputs(20) == 100) + + val mapOutput = + MapOutputTracker.deserializeOutputStatuses[MapStatus](fetchedBytes._1, newConf) + val mergeOutput = + MapOutputTracker.deserializeOutputStatuses[MergeStatus](fetchedBytes._2, newConf) + assert(mapOutput.length == 100) + assert(mergeOutput.length == 1) + mapWorkerTracker.stop() + masterTracker.stop() + } + } + + test("SPARK-32921: unregister merge result if it is present and contains the map Id") { + val rpcEnv = createRpcEnv("test") + val tracker = newTrackerMaster() + tracker.trackerEndpoint = rpcEnv.setupEndpoint(MapOutputTracker.ENDPOINT_NAME, + new MapOutputTrackerMasterEndpoint(rpcEnv, tracker, conf)) + tracker.registerShuffle(10, 4, 2) + assert(tracker.containsShuffle(10)) + val bitmap1 = new RoaringBitmap() + bitmap1.add(0) + bitmap1.add(1) + tracker.registerMergeResult(10, 0, MergeStatus(BlockManagerId("a", "hostA", 1000), + bitmap1, 1000L)) + + val bitmap2 = new RoaringBitmap() + bitmap2.add(5) + bitmap2.add(6) + tracker.registerMergeResult(10, 1, MergeStatus(BlockManagerId("b", "hostB", 1000), + bitmap2, 1000L)) + assert(tracker.getNumAvailableMergeResults(10) == 2) + tracker.unregisterMergeResult(10, 0, BlockManagerId("a", "hostA", 1000), Option(0)) + assert(tracker.getNumAvailableMergeResults(10) == 1) + tracker.unregisterMergeResult(10, 1, BlockManagerId("b", "hostB", 1000), Option(1)) + assert(tracker.getNumAvailableMergeResults(10) == 1) + tracker.unregisterMergeResult(10, 1, BlockManagerId("b", "hostB", 1000), Option(5)) + assert(tracker.getNumAvailableMergeResults(10) == 0) + tracker.stop() + rpcEnv.shutdown() + } } diff --git a/core/src/test/scala/org/apache/spark/MapStatusesSerDeserBenchmark.scala b/core/src/test/scala/org/apache/spark/MapStatusesSerDeserBenchmark.scala index 78f1246295bf8..d8088239870ba 100644 --- a/core/src/test/scala/org/apache/spark/MapStatusesSerDeserBenchmark.scala +++ b/core/src/test/scala/org/apache/spark/MapStatusesSerDeserBenchmark.scala @@ -17,18 +17,16 @@ package org.apache.spark -import org.scalatest.Assertions._ - import org.apache.spark.benchmark.Benchmark import org.apache.spark.benchmark.BenchmarkBase -import org.apache.spark.scheduler.CompressedMapStatus +import org.apache.spark.scheduler.{CompressedMapStatus, MergeStatus} import org.apache.spark.storage.BlockManagerId /** * Benchmark for MapStatuses serialization & deserialization performance. * {{{ * To run this benchmark: - * 1. without sbt: bin/spark-submit --class --jars + * 1. without sbt: bin/spark-submit --class * 2. build/sbt "core/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "core/test:runMain " * Results will be written to "benchmarks/MapStatusesSerDeserBenchmark-results.txt". @@ -52,7 +50,7 @@ object MapStatusesSerDeserBenchmark extends BenchmarkBase { val shuffleId = 10 - tracker.registerShuffle(shuffleId, numMaps) + tracker.registerShuffle(shuffleId, numMaps, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) val r = new scala.util.Random(912) (0 until numMaps).foreach { i => tracker.registerMapOutput(shuffleId, i, @@ -68,7 +66,7 @@ object MapStatusesSerDeserBenchmark extends BenchmarkBase { var serializedMapStatusSizes = 0 var serializedBroadcastSizes = 0 - val (serializedMapStatus, serializedBroadcast) = MapOutputTracker.serializeMapStatuses( + val (serializedMapStatus, serializedBroadcast) = MapOutputTracker.serializeOutputStatuses( shuffleStatus.mapStatuses, tracker.broadcastManager, tracker.isLocal, minBroadcastSize, sc.getConf) serializedMapStatusSizes = serializedMapStatus.length @@ -77,12 +75,12 @@ object MapStatusesSerDeserBenchmark extends BenchmarkBase { } benchmark.addCase("Serialization") { _ => - MapOutputTracker.serializeMapStatuses(shuffleStatus.mapStatuses, tracker.broadcastManager, + MapOutputTracker.serializeOutputStatuses(shuffleStatus.mapStatuses, tracker.broadcastManager, tracker.isLocal, minBroadcastSize, sc.getConf) } benchmark.addCase("Deserialization") { _ => - val result = MapOutputTracker.deserializeMapStatuses(serializedMapStatus, sc.getConf) + val result = MapOutputTracker.deserializeOutputStatuses(serializedMapStatus, sc.getConf) assert(result.length == numMaps) } diff --git a/core/src/test/scala/org/apache/spark/SharedSparkContext.scala b/core/src/test/scala/org/apache/spark/SharedSparkContext.scala index bdeb631878350..7106a780b3256 100644 --- a/core/src/test/scala/org/apache/spark/SharedSparkContext.scala +++ b/core/src/test/scala/org/apache/spark/SharedSparkContext.scala @@ -27,7 +27,7 @@ trait SharedSparkContext extends BeforeAndAfterAll with BeforeAndAfterEach { sel def sc: SparkContext = _sc - var conf = new SparkConf(false) + val conf = new SparkConf(false) /** * Initialize the [[SparkContext]]. Generally, this is just called from beforeAll; however, in diff --git a/core/src/test/scala/org/apache/spark/ShuffleSuite.scala b/core/src/test/scala/org/apache/spark/ShuffleSuite.scala index 9e39271bdf9ee..126faec334e77 100644 --- a/core/src/test/scala/org/apache/spark/ShuffleSuite.scala +++ b/core/src/test/scala/org/apache/spark/ShuffleSuite.scala @@ -17,18 +17,24 @@ package org.apache.spark +import java.io.File import java.util.{Locale, Properties} -import java.util.concurrent.{Callable, CyclicBarrier, Executors, ExecutorService} +import java.util.concurrent.{Callable, CyclicBarrier, Executors, ExecutorService } -import org.scalatest.Matchers +import scala.collection.JavaConverters._ + +import org.apache.commons.io.FileUtils +import org.apache.commons.io.filefilter.TrueFileFilter +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.ShuffleSuite.NonJavaSerializableClass import org.apache.spark.internal.config import org.apache.spark.internal.config.Tests.TEST_NO_STAGE_RETRY import org.apache.spark.memory.TaskMemoryManager import org.apache.spark.rdd.{CoGroupedRDD, OrderedRDDFunctions, RDD, ShuffledRDD, SubtractedRDD} -import org.apache.spark.scheduler.{MapStatus, MyRDD, SparkListener, SparkListenerTaskEnd} -import org.apache.spark.serializer.KryoSerializer +import org.apache.spark.scheduler.{MapStatus, MergeStatus, MyRDD, SparkListener, SparkListenerTaskEnd} +import org.apache.spark.serializer.{JavaSerializer, KryoSerializer} import org.apache.spark.shuffle.ShuffleWriter import org.apache.spark.storage.{ShuffleBlockId, ShuffleDataBlockId, ShuffleIndexBlockId} import org.apache.spark.util.MutablePair @@ -182,7 +188,7 @@ abstract class ShuffleSuite extends SparkFunSuite with Matchers with LocalSparkC val pairs1: RDD[MutablePair[Int, Int]] = sc.parallelize(data1, 2) val pairs2: RDD[MutablePair[Int, String]] = sc.parallelize(data2, 2) val results = new CoGroupedRDD[Int](Seq(pairs1, pairs2), new HashPartitioner(2)) - .map(p => (p._1, p._2.map(_.toArray))) + .map(p => (p._1, p._2.map(_.toSeq))) .collectAsMap() assert(results(1)(0).length === 3) @@ -361,7 +367,7 @@ abstract class ShuffleSuite extends SparkFunSuite with Matchers with LocalSparkC val shuffleMapRdd = new MyRDD(sc, 1, Nil) val shuffleDep = new ShuffleDependency(shuffleMapRdd, new HashPartitioner(1)) val shuffleHandle = manager.registerShuffle(0, shuffleDep) - mapTrackerMaster.registerShuffle(0, 1) + mapTrackerMaster.registerShuffle(0, 1, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) // first attempt -- its successful val context1 = @@ -418,6 +424,31 @@ abstract class ShuffleSuite extends SparkFunSuite with Matchers with LocalSparkC manager.unregisterShuffle(0) } + + test("SPARK-34541: shuffle can be removed") { + withTempDir { tmpDir => + def getAllFiles: Set[File] = + FileUtils.listFiles(tmpDir, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE).asScala.toSet + conf.set("spark.local.dir", tmpDir.getAbsolutePath) + sc = new SparkContext("local", "test", conf) + // For making the taskAttemptId starts from 1. + sc.parallelize(1 to 10).count() + val rdd = sc.parallelize(1 to 10, 1).map(x => (x, x)) + // Create a shuffleRdd + val shuffledRdd = new ShuffledRDD[Int, Int, Int](rdd, new HashPartitioner(4)) + .setSerializer(new JavaSerializer(conf)) + val filesBeforeShuffle = getAllFiles + // Force the shuffle to be performed + shuffledRdd.count() + // Ensure that the shuffle actually created files that will need to be cleaned up + val filesCreatedByShuffle = getAllFiles -- filesBeforeShuffle + // Check that the cleanup actually removes the files + sc.env.blockManager.master.removeShuffle(0, blocking = true) + for (file <- filesCreatedByShuffle) { + assert (!file.exists(), s"Shuffle file $file was not cleaned up") + } + } + } } /** diff --git a/core/src/test/scala/org/apache/spark/SortShuffleSuite.scala b/core/src/test/scala/org/apache/spark/SortShuffleSuite.scala index 1a563621a5179..3d853ff4294be 100644 --- a/core/src/test/scala/org/apache/spark/SortShuffleSuite.scala +++ b/core/src/test/scala/org/apache/spark/SortShuffleSuite.scala @@ -24,6 +24,7 @@ import scala.collection.JavaConverters._ import org.apache.commons.io.FileUtils import org.apache.commons.io.filefilter.TrueFileFilter import org.scalatest.BeforeAndAfterAll +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.internal.config import org.apache.spark.rdd.ShuffledRDD diff --git a/core/src/test/scala/org/apache/spark/SparkConfSuite.scala b/core/src/test/scala/org/apache/spark/SparkConfSuite.scala index 3bc2061c4f2ad..7779fb2aeaf07 100644 --- a/core/src/test/scala/org/apache/spark/SparkConfSuite.scala +++ b/core/src/test/scala/org/apache/spark/SparkConfSuite.scala @@ -221,7 +221,7 @@ class SparkConfSuite extends SparkFunSuite with LocalSparkContext with ResetSyst conf.registerKryoClasses(Array(classOf[Class1])) assert(conf.get(KRYO_CLASSES_TO_REGISTER).toSet === Seq(classOf[Class1].getName).toSet) - conf.set(KRYO_USER_REGISTRATORS, classOf[CustomRegistrator].getName) + conf.set(KRYO_USER_REGISTRATORS, Seq(classOf[CustomRegistrator].getName)) // Kryo doesn't expose a way to discover registered classes, but at least make sure this doesn't // blow up. @@ -461,7 +461,7 @@ class SparkConfSuite extends SparkFunSuite with LocalSparkContext with ResetSyst val conf = new SparkConf() conf.set(TASK_GPU_ID.amountConf, "2") conf.set(TASK_FPGA_ID.amountConf, "0") - var taskResourceRequirement = + val taskResourceRequirement = parseResourceRequirements(conf, SPARK_TASK_PREFIX) .map(req => (req.resourceName, req.amount)).toMap diff --git a/core/src/test/scala/org/apache/spark/SparkContextSuite.scala b/core/src/test/scala/org/apache/spark/SparkContextSuite.scala index 30237fd576830..b663d1a77ce58 100644 --- a/core/src/test/scala/org/apache/spark/SparkContextSuite.scala +++ b/core/src/test/scala/org/apache/spark/SparkContextSuite.scala @@ -23,6 +23,7 @@ import java.nio.charset.StandardCharsets import java.util.concurrent.{CountDownLatch, Semaphore, TimeUnit} import scala.concurrent.duration._ +import scala.io.Source import com.google.common.io.Files import org.apache.hadoop.conf.Configuration @@ -31,8 +32,9 @@ import org.apache.hadoop.io.{BytesWritable, LongWritable, Text} import org.apache.hadoop.mapred.TextInputFormat import org.apache.hadoop.mapreduce.lib.input.{TextInputFormat => NewTextInputFormat} import org.json4s.{DefaultFormats, Extraction} -import org.scalatest.Matchers._ +import org.junit.Assert.{assertEquals, assertFalse} import org.scalatest.concurrent.Eventually +import org.scalatest.matchers.must.Matchers._ import org.apache.spark.TestUtils._ import org.apache.spark.internal.config._ @@ -45,7 +47,6 @@ import org.apache.spark.scheduler.{SparkListener, SparkListenerExecutorMetricsUp import org.apache.spark.shuffle.FetchFailedException import org.apache.spark.util.{ThreadUtils, Utils} - class SparkContextSuite extends SparkFunSuite with LocalSparkContext with Eventually { test("Only one SparkContext may be active at a time") { @@ -153,7 +154,86 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext with Eventu } x }).count() - assert(sc.listFiles().filter(_.contains("somesuffix1")).size == 1) + assert(sc.listFiles().count(_.contains("somesuffix1")) == 1) + } finally { + sc.stop() + } + } + } + + test("SPARK-33530: basic case for addArchive and listArchives") { + withTempDir { dir => + val file1 = File.createTempFile("someprefix1", "somesuffix1", dir) + val file2 = File.createTempFile("someprefix2", "somesuffix2", dir) + val file3 = File.createTempFile("someprefix3", "somesuffix3", dir) + val file4 = File.createTempFile("someprefix4", "somesuffix4", dir) + + val jarFile = new File(dir, "test!@$jar.jar") + val zipFile = new File(dir, "test-zip.zip") + val relativePath1 = + s"${zipFile.getParent}/../${zipFile.getParentFile.getName}/${zipFile.getName}" + val relativePath2 = + s"${jarFile.getParent}/../${jarFile.getParentFile.getName}/${jarFile.getName}#zoo" + + try { + Files.write("somewords1", file1, StandardCharsets.UTF_8) + Files.write("somewords22", file2, StandardCharsets.UTF_8) + Files.write("somewords333", file3, StandardCharsets.UTF_8) + Files.write("somewords4444", file4, StandardCharsets.UTF_8) + val length1 = file1.length() + val length2 = file2.length() + val length3 = file1.length() + val length4 = file2.length() + + createJar(Seq(file1, file2), jarFile) + createJar(Seq(file3, file4), zipFile) + + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local")) + sc.addArchive(jarFile.getAbsolutePath) + sc.addArchive(relativePath1) + sc.addArchive(s"${jarFile.getAbsolutePath}#foo") + sc.addArchive(s"${zipFile.getAbsolutePath}#bar") + sc.addArchive(relativePath2) + + sc.parallelize(Array(1), 1).map { x => + val gotten1 = new File(SparkFiles.get(jarFile.getName)) + val gotten2 = new File(SparkFiles.get(zipFile.getName)) + val gotten3 = new File(SparkFiles.get("foo")) + val gotten4 = new File(SparkFiles.get("bar")) + val gotten5 = new File(SparkFiles.get("zoo")) + + Seq(gotten1, gotten2, gotten3, gotten4, gotten5).foreach { gotten => + if (!gotten.exists()) { + throw new SparkException(s"The archive doesn't exist: ${gotten.getAbsolutePath}") + } + if (!gotten.isDirectory) { + throw new SparkException(s"The archive was not unpacked: ${gotten.getAbsolutePath}") + } + } + + // Jars + Seq(gotten1, gotten3, gotten5).foreach { gotten => + val actualLength1 = new File(gotten, file1.getName).length() + val actualLength2 = new File(gotten, file2.getName).length() + if (actualLength1 != length1 || actualLength2 != length2) { + s"Unpacked files have different lengths $actualLength1 and $actualLength2. at " + + s"${gotten.getAbsolutePath}. They should be $length1 and $length2." + } + } + + // Zip + Seq(gotten2, gotten4).foreach { gotten => + val actualLength3 = new File(gotten, file1.getName).length() + val actualLength4 = new File(gotten, file2.getName).length() + if (actualLength3 != length3 || actualLength4 != length4) { + s"Unpacked files have different lengths $actualLength3 and $actualLength4. at " + + s"${gotten.getAbsolutePath}. They should be $length3 and $length4." + } + } + x + }.count() + assert(sc.listArchives().count(_.endsWith("test!@$jar.jar")) == 1) + assert(sc.listArchives().count(_.contains("test-zip.zip")) == 2) } finally { sc.stop() } @@ -165,7 +245,7 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext with Eventu try { sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local")) sc.addJar(jarPath.toString) - assert(sc.listJars().filter(_.contains("TestUDTF.jar")).size == 1) + assert(sc.listJars().count(_.contains("TestUDTF.jar")) == 1) } finally { sc.stop() } @@ -297,7 +377,7 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext with Eventu sc.addFile(file1.getAbsolutePath) def getAddedFileContents(): String = { sc.parallelize(Seq(0)).map { _ => - scala.io.Source.fromFile(SparkFiles.get("file")).mkString + Utils.tryWithResource(Source.fromFile(SparkFiles.get("file")))(_.mkString) }.first() } assert(getAddedFileContents() === "old") @@ -860,7 +940,7 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext with Eventu .setAppName("test-cluster") conf.set(TASK_GPU_ID.amountConf, "1") - var error = intercept[SparkException] { + val error = intercept[SparkException] { sc = new SparkContext(conf) }.getMessage() @@ -875,7 +955,7 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext with Eventu conf.set(TASK_GPU_ID.amountConf, "2") conf.set(EXECUTOR_GPU_ID.amountConf, "1") - var error = intercept[SparkException] { + val error = intercept[SparkException] { sc = new SparkContext(conf) }.getMessage() @@ -891,7 +971,7 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext with Eventu conf.set(TASK_GPU_ID.amountConf, "2") conf.set(EXECUTOR_GPU_ID.amountConf, "4") - var error = intercept[SparkException] { + val error = intercept[SparkException] { sc = new SparkContext(conf) }.getMessage() @@ -934,6 +1014,277 @@ class SparkContextSuite extends SparkFunSuite with LocalSparkContext with Eventu } } } + + test("SPARK-32160: Disallow to create SparkContext in executors") { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + + val error = intercept[SparkException] { + sc.range(0, 1).foreach { _ => + new SparkContext(new SparkConf().setAppName("test").setMaster("local")) + } + }.getMessage() + + assert(error.contains("SparkContext should only be created and accessed on the driver.")) + } + + test("SPARK-32160: Allow to create SparkContext in executors if the config is set") { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + + sc.range(0, 1).foreach { _ => + new SparkContext(new SparkConf().setAppName("test").setMaster("local") + .set(EXECUTOR_ALLOW_SPARK_CONTEXT, true)).stop() + } + } + + test("SPARK-33084: Add jar support Ivy URI -- default transitive = true") { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(sc.listJars().exists(_.contains("commons-lang_commons-lang-2.6.jar"))) + } + + test("SPARK-33084: Add jar support Ivy URI -- invalid transitive use default false") { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0?transitive=foo") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(!sc.listJars().exists(_.contains("org.slf4j_slf4j-api-1.7.10.jar"))) + assert(!sc.listJars().exists(_.contains("commons-lang_commons-lang-2.6.jar"))) + } + + test("SPARK-33084: Add jar support Ivy URI -- transitive=true will download dependency jars") { + val logAppender = new LogAppender("transitive=true will download dependency jars") + withLogAppender(logAppender) { + sc = new SparkContext( + new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0?transitive=true") + val dependencyJars = Array( + "org.apache.hive_hive-storage-api-2.7.0.jar", + "org.slf4j_slf4j-api-1.7.10.jar", + "commons-lang_commons-lang-2.6.jar") + + dependencyJars.foreach(jar => assert(sc.listJars().exists(_.contains(jar)))) + + assert(logAppender.loggingEvents.count(_.getRenderedMessage.contains( + "Added dependency jars of Ivy URI " + + "ivy://org.apache.hive:hive-storage-api:2.7.0?transitive=true")) == 1) + + // test dependency jars exist + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0?transitive=true") + assert(logAppender.loggingEvents.count(_.getRenderedMessage.contains( + "The dependency jars of Ivy URI " + + "ivy://org.apache.hive:hive-storage-api:2.7.0?transitive=true")) == 1) + val existMsg = logAppender.loggingEvents.filter(_.getRenderedMessage.contains( + "The dependency jars of Ivy URI " + + "ivy://org.apache.hive:hive-storage-api:2.7.0?transitive=true")) + .head.getRenderedMessage + dependencyJars.foreach(jar => assert(existMsg.contains(jar))) + } + } + + test("SPARK-34506: Add jar support Ivy URI -- transitive=false will not download " + + "dependency jars") { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0?transitive=false") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(!sc.listJars().exists(_.contains("commons-lang_commons-lang-2.6.jar"))) + } + + test("SPARK-34506: Add jar support Ivy URI -- test exclude param when transitive unspecified") { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0?exclude=commons-lang:commons-lang") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(sc.listJars().exists(_.contains("org.slf4j_slf4j-api-1.7.10.jar"))) + assert(!sc.listJars().exists(_.contains("commons-lang_commons-lang-2.6.jar"))) + } + + test("SPARK-33084: Add jar support Ivy URI -- test exclude param when transitive=true") { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0" + + "?exclude=commons-lang:commons-lang&transitive=true") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(sc.listJars().exists(_.contains("org.slf4j_slf4j-api-1.7.10.jar"))) + assert(!sc.listJars().exists(_.contains("commons-lang_commons-lang-2.6.jar"))) + } + + test("SPARK-33084: Add jar support Ivy URI -- test different version") { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0") + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.6.0") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.6.0.jar"))) + } + + test("SPARK-33084: Add jar support Ivy URI -- test invalid param") { + val logAppender = new LogAppender("test log when have invalid parameter") + withLogAppender(logAppender) { + sc = new SparkContext( + new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0?" + + "invalidParam1=foo&invalidParam2=boo") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(logAppender.loggingEvents.exists(_.getRenderedMessage.contains( + "Invalid parameters `invalidParam1,invalidParam2` found in Ivy URI query " + + "`invalidParam1=foo&invalidParam2=boo`."))) + } + } + + test("SPARK-33084: Add jar support Ivy URI -- test multiple transitive params") { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + // transitive=invalidValue will win and treated as false + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0?" + + "transitive=true&transitive=invalidValue") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(!sc.listJars().exists(_.contains("commons-lang_commons-lang-2.6.jar"))) + + // transitive=true will win + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0?" + + "transitive=false&transitive=invalidValue&transitive=true") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(sc.listJars().exists(_.contains("commons-lang_commons-lang-2.6.jar"))) + } + + test("SPARK-33084: Add jar support Ivy URI -- test param key case sensitive") { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0?transitive=false") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(!sc.listJars().exists(_.contains("commons-lang_commons-lang-2.6.jar"))) + + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0?TRANSITIVE=false") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(sc.listJars().exists(_.contains("commons-lang_commons-lang-2.6.jar"))) + } + + test("SPARK-33084: Add jar support Ivy URI -- test transitive value case insensitive") { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local-cluster[3, 1, 1024]")) + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0?transitive=FALSE") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(!sc.listJars().exists(_.contains("commons-lang_commons-lang-2.6.jar"))) + + sc.addJar("ivy://org.apache.hive:hive-storage-api:2.7.0?transitive=false") + assert(sc.listJars().exists(_.contains("org.apache.hive_hive-storage-api-2.7.0.jar"))) + assert(!sc.listJars().exists(_.contains("commons-lang_commons-lang-2.6.jar"))) + } + + test("SPARK-34346: hadoop configuration priority for spark/hive/hadoop configs") { + val testKey = "hadoop.tmp.dir" + val bufferKey = "io.file.buffer.size" + val hadoopConf0 = new Configuration() + hadoopConf0.set(testKey, "/tmp/hive_zero") + + val hiveConfFile = Utils.getContextOrSparkClassLoader.getResource("hive-site.xml") + assert(hiveConfFile != null) + hadoopConf0.addResource(hiveConfFile) + assert(hadoopConf0.get(testKey) === "/tmp/hive_zero") + assert(hadoopConf0.get(bufferKey) === "201811") + + val sparkConf = new SparkConf() + .setAppName("test") + .setMaster("local") + .set(BUFFER_SIZE, 65536) + sc = new SparkContext(sparkConf) + assert(sc.hadoopConfiguration.get(testKey) === "/tmp/hive_one", + "hive configs have higher priority than hadoop ones ") + assert(sc.hadoopConfiguration.get(bufferKey).toInt === 65536, + "spark configs have higher priority than hive ones") + + resetSparkContext() + + sparkConf + .set("spark.hadoop.hadoop.tmp.dir", "/tmp/hive_two") + .set(s"spark.hadoop.$bufferKey", "20181117") + sc = new SparkContext(sparkConf) + assert(sc.hadoopConfiguration.get(testKey) === "/tmp/hive_two", + "spark.hadoop configs have higher priority than hive/hadoop ones") + assert(sc.hadoopConfiguration.get(bufferKey).toInt === 65536, + "spark configs have higher priority than spark.hadoop configs") + } + + test("SPARK-34225: addFile/addJar shouldn't further encode URI if a URI form string is passed") { + withTempDir { dir => + val jar1 = File.createTempFile("testprefix", "test jar.jar", dir) + val jarUrl1 = jar1.toURI.toString + val file1 = File.createTempFile("testprefix", "test file.txt", dir) + val fileUrl1 = file1.toURI.toString + val jar2 = File.createTempFile("testprefix", "test %20jar.jar", dir) + val file2 = File.createTempFile("testprefix", "test %20file.txt", dir) + + try { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local")) + sc.addJar(jarUrl1) + sc.addFile(fileUrl1) + sc.addJar(jar2.toString) + sc.addFile(file2.toString) + sc.parallelize(Array(1), 1).map { x => + val gottenJar1 = new File(SparkFiles.get(jar1.getName)) + if (!gottenJar1.exists()) { + throw new SparkException("file doesn't exist : " + jar1) + } + val gottenFile1 = new File(SparkFiles.get(file1.getName)) + if (!gottenFile1.exists()) { + throw new SparkException("file doesn't exist : " + file1) + } + val gottenJar2 = new File(SparkFiles.get(jar2.getName)) + if (!gottenJar2.exists()) { + throw new SparkException("file doesn't exist : " + jar2) + } + val gottenFile2 = new File(SparkFiles.get(file2.getName)) + if (!gottenFile2.exists()) { + throw new SparkException("file doesn't exist : " + file2) + } + x + }.collect() + } finally { + sc.stop() + } + } + } + + test("SPARK-35383: Fill missing S3A magic committer configs if needed") { + val c1 = new SparkConf().setAppName("s3a-test").setMaster("local") + sc = new SparkContext(c1) + assertFalse(sc.getConf.contains("spark.hadoop.fs.s3a.committer.name")) + + resetSparkContext() + val c2 = c1.clone.set("spark.hadoop.fs.s3a.bucket.mybucket.committer.magic.enabled", "false") + sc = new SparkContext(c2) + assertFalse(sc.getConf.contains("spark.hadoop.fs.s3a.committer.name")) + + resetSparkContext() + val c3 = c1.clone.set("spark.hadoop.fs.s3a.bucket.mybucket.committer.magic.enabled", "true") + sc = new SparkContext(c3) + Seq( + "spark.hadoop.fs.s3a.committer.magic.enabled" -> "true", + "spark.hadoop.fs.s3a.committer.name" -> "magic", + "spark.hadoop.mapreduce.outputcommitter.factory.scheme.s3a" -> + "org.apache.hadoop.fs.s3a.commit.S3ACommitterFactory", + "spark.sql.parquet.output.committer.class" -> + "org.apache.spark.internal.io.cloud.BindingParquetOutputCommitter", + "spark.sql.sources.commitProtocolClass" -> + "org.apache.spark.internal.io.cloud.PathOutputCommitProtocol" + ).foreach { case (k, v) => + assertEquals(v, sc.getConf.get(k)) + } + + // Respect a user configuration + resetSparkContext() + val c4 = c1.clone + .set("spark.hadoop.fs.s3a.committer.magic.enabled", "false") + .set("spark.hadoop.fs.s3a.bucket.mybucket.committer.magic.enabled", "true") + sc = new SparkContext(c4) + Seq( + "spark.hadoop.fs.s3a.committer.magic.enabled" -> "false", + "spark.hadoop.fs.s3a.committer.name" -> null, + "spark.hadoop.mapreduce.outputcommitter.factory.scheme.s3a" -> null, + "spark.sql.parquet.output.committer.class" -> null, + "spark.sql.sources.commitProtocolClass" -> null + ).foreach { case (k, v) => + if (v == null) { + assertFalse(sc.getConf.contains(k)) + } else { + assertEquals(v, sc.getConf.get(k)) + } + } + } } object SparkContextSuite { diff --git a/core/src/test/scala/org/apache/spark/SparkFunSuite.scala b/core/src/test/scala/org/apache/spark/SparkFunSuite.scala index ec641f8294b29..939e64d8e1767 100644 --- a/core/src/test/scala/org/apache/spark/SparkFunSuite.scala +++ b/core/src/test/scala/org/apache/spark/SparkFunSuite.scala @@ -19,19 +19,22 @@ package org.apache.spark // scalastyle:off import java.io.File +import java.nio.file.Path import java.util.{Locale, TimeZone} -import org.apache.log4j.spi.LoggingEvent - import scala.annotation.tailrec +import scala.collection.mutable.ArrayBuffer + +import org.apache.commons.io.FileUtils import org.apache.log4j.{Appender, AppenderSkeleton, Level, Logger} -import org.scalatest.{BeforeAndAfter, BeforeAndAfterAll, BeforeAndAfterEach, FunSuite, Outcome} +import org.apache.log4j.spi.LoggingEvent +import org.scalatest.{BeforeAndAfter, BeforeAndAfterAll, BeforeAndAfterEach, Failed, Outcome} +import org.scalatest.funsuite.AnyFunSuite + import org.apache.spark.internal.Logging import org.apache.spark.internal.config.Tests.IS_TESTING import org.apache.spark.util.{AccumulatorContext, Utils} -import scala.collection.mutable.ArrayBuffer - /** * Base abstract class for all unit tests in Spark for handling common functionality. * @@ -57,13 +60,19 @@ import scala.collection.mutable.ArrayBuffer * } */ abstract class SparkFunSuite - extends FunSuite + extends AnyFunSuite with BeforeAndAfterAll with BeforeAndAfterEach with ThreadAudit with Logging { // scalastyle:on + // Initialize the logger forcibly to let the logger log timestamp + // based on the local time zone depending on environments. + // The default time zone will be set to America/Los_Angeles later + // so this initialization is necessary here. + log + // Timezone is fixed to America/Los_Angeles for those timezone sensitive tests (timestamp_*) TimeZone.setDefault(TimeZone.getTimeZone("America/Los_Angeles")) // Add Locale setting @@ -100,6 +109,28 @@ abstract class SparkFunSuite getTestResourceFile(file).getCanonicalPath } + protected final def copyAndGetResourceFile(fileName: String, suffix: String): File = { + val url = Thread.currentThread().getContextClassLoader.getResource(fileName) + // To avoid illegal accesses to a resource file inside jar + // (URISyntaxException might be thrown when accessing it), + // copy it into a temporary one for accessing it from the dependent module. + val file = File.createTempFile("test-resource", suffix) + file.deleteOnExit() + FileUtils.copyURLToFile(url, file) + file + } + + /** + * Get a Path relative to the root project. It is assumed that a spark home is set. + */ + protected final def getWorkspaceFilePath(first: String, more: String*): Path = { + if (!(sys.props.contains("spark.test.home") || sys.env.contains("SPARK_HOME"))) { + fail("spark.test.home or SPARK_HOME is not set.") + } + val sparkHome = sys.props.getOrElse("spark.test.home", sys.env("SPARK_HOME")) + java.nio.file.Paths.get(sparkHome, first +: more: _*) + } + /** * Note: this method doesn't support `BeforeAndAfter`. You must use `BeforeAndAfterEach` to * set up and tear down resources. @@ -141,6 +172,8 @@ abstract class SparkFunSuite } } + protected def logForFailedTest(): Unit = {} + /** * Log the suite name and the test name before and after each test. * @@ -154,7 +187,13 @@ abstract class SparkFunSuite val shortSuiteName = suiteName.replaceAll("org.apache.spark", "o.a.s") try { logInfo(s"\n\n===== TEST OUTPUT FOR $shortSuiteName: '$testName' =====\n") - test() + val outcome = test() + outcome match { + case _: Failed => + logForFailedTest() + case _ => + } + outcome } finally { logInfo(s"\n\n===== FINISHED $shortSuiteName: '$testName' =====\n") } diff --git a/core/src/test/scala/org/apache/spark/StatusTrackerSuite.scala b/core/src/test/scala/org/apache/spark/StatusTrackerSuite.scala index f527bbe718524..e6d3377120e56 100644 --- a/core/src/test/scala/org/apache/spark/StatusTrackerSuite.scala +++ b/core/src/test/scala/org/apache/spark/StatusTrackerSuite.scala @@ -18,10 +18,10 @@ package org.apache.spark import scala.concurrent.duration._ -import scala.language.implicitConversions -import org.scalatest.Matchers import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.JobExecutionStatus._ diff --git a/core/src/test/scala/org/apache/spark/TempLocalSparkContext.scala b/core/src/test/scala/org/apache/spark/TempLocalSparkContext.scala new file mode 100644 index 0000000000000..6d5fcd1edfb03 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/TempLocalSparkContext.scala @@ -0,0 +1,100 @@ +/* + * 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. + */ + +package org.apache.spark + +import _root_.io.netty.util.internal.logging.{InternalLoggerFactory, Slf4JLoggerFactory} +import org.scalatest.BeforeAndAfterAll +import org.scalatest.BeforeAndAfterEach +import org.scalatest.Suite + +import org.apache.spark.internal.Logging +import org.apache.spark.resource.ResourceProfile + +/** + * Manages a local `sc` `SparkContext` variable, correctly stopping it after each test. + * + * Note: this class is a copy of [[LocalSparkContext]]. Why copy it? Reduce conflict. Because + * many test suites use [[LocalSparkContext]] and overwrite some variable or function (e.g. + * sc of LocalSparkContext), there occurs conflict when we refactor the `sc` as a new function. + * After migrating all test suites that use [[LocalSparkContext]] to use + * [[TempLocalSparkContext]], we will delete the original [[LocalSparkContext]] and rename + * [[TempLocalSparkContext]] to [[LocalSparkContext]]. + */ +trait TempLocalSparkContext extends BeforeAndAfterEach + with BeforeAndAfterAll with Logging { self: Suite => + + private var _conf: SparkConf = defaultSparkConf + + @transient private var _sc: SparkContext = _ + + def conf: SparkConf = _conf + + /** + * Currently, we are focusing on the reconstruction of LocalSparkContext, so this method + * was created temporarily. When the migration work is completed, this method will be + * renamed to `sc` and the variable `sc` will be deleted. + */ + def sc: SparkContext = { + if (_sc == null) { + _sc = new SparkContext(_conf) + } + _sc + } + + override def beforeAll(): Unit = { + super.beforeAll() + InternalLoggerFactory.setDefaultFactory(Slf4JLoggerFactory.INSTANCE) + } + + override def afterEach(): Unit = { + try { + resetSparkContext() + } finally { + super.afterEach() + } + } + + def resetSparkContext(): Unit = { + TempLocalSparkContext.stop(_sc) + ResourceProfile.clearDefaultProfile() + _sc = null + _conf = defaultSparkConf + } + + private def defaultSparkConf: SparkConf = new SparkConf() + .setMaster("local[2]").setAppName(s"${this.getClass.getSimpleName}") +} + +object TempLocalSparkContext { + def stop(sc: SparkContext): Unit = { + if (sc != null) { + sc.stop() + } + // To avoid RPC rebinding to the same port, since it doesn't unbind immediately on shutdown + System.clearProperty("spark.driver.port") + } + + /** Runs `f` by passing in `sc` and ensures that `sc` is stopped. */ + def withSpark[T](sc: SparkContext)(f: SparkContext => T): T = { + try { + f(sc) + } finally { + stop(sc) + } + } +} diff --git a/core/src/test/scala/org/apache/spark/ThreadAudit.scala b/core/src/test/scala/org/apache/spark/ThreadAudit.scala index 44d1f220bf6b1..1e2917621fa79 100644 --- a/core/src/test/scala/org/apache/spark/ThreadAudit.scala +++ b/core/src/test/scala/org/apache/spark/ThreadAudit.scala @@ -26,7 +26,7 @@ import org.apache.spark.internal.Logging */ trait ThreadAudit extends Logging { - val threadWhiteList = Set( + val threadExcludeList = Set( /** * Netty related internal threads. * These are excluded because their lifecycle is handled by the netty itself @@ -108,7 +108,7 @@ trait ThreadAudit extends Logging { if (threadNamesSnapshot.nonEmpty) { val remainingThreadNames = runningThreadNames().diff(threadNamesSnapshot) - .filterNot { s => threadWhiteList.exists(s.matches(_)) } + .filterNot { s => threadExcludeList.exists(s.matches(_)) } if (remainingThreadNames.nonEmpty) { logWarning(s"\n\n===== POSSIBLE THREAD LEAK IN SUITE $shortSuiteName, " + s"thread names: ${remainingThreadNames.mkString(", ")} =====\n") diff --git a/core/src/test/scala/org/apache/spark/api/python/PythonBroadcastSuite.scala b/core/src/test/scala/org/apache/spark/api/python/PythonBroadcastSuite.scala index dffdd96cd2dcc..daf0151ad65a7 100644 --- a/core/src/test/scala/org/apache/spark/api/python/PythonBroadcastSuite.scala +++ b/core/src/test/scala/org/apache/spark/api/python/PythonBroadcastSuite.scala @@ -21,7 +21,8 @@ import java.io.{File, PrintWriter} import scala.io.Source -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.{SharedSparkContext, SparkConf, SparkFunSuite} import org.apache.spark.internal.config.Kryo._ diff --git a/core/src/test/scala/org/apache/spark/benchmark/Benchmark.scala b/core/src/test/scala/org/apache/spark/benchmark/Benchmark.scala index 9629f5ab1a3dd..5511852ca176e 100644 --- a/core/src/test/scala/org/apache/spark/benchmark/Benchmark.scala +++ b/core/src/test/scala/org/apache/spark/benchmark/Benchmark.scala @@ -26,7 +26,6 @@ import scala.util.Try import org.apache.commons.io.output.TeeOutputStream import org.apache.commons.lang3.SystemUtils -import org.scalatest.Assertions._ import org.apache.spark.util.Utils @@ -112,11 +111,12 @@ private[spark] class Benchmark( // The results are going to be processor specific so it is useful to include that. out.println(Benchmark.getJVMOSInfo()) out.println(Benchmark.getProcessorName()) - out.printf("%-40s %14s %14s %11s %12s %13s %10s\n", name + ":", "Best Time(ms)", "Avg Time(ms)", "Stdev(ms)", "Rate(M/s)", - "Per Row(ns)", "Relative") - out.println("-" * 120) + val nameLen = Math.max(40, Math.max(name.length, benchmarks.map(_.name.length).max)) + out.printf(s"%-${nameLen}s %14s %14s %11s %12s %13s %10s\n", + name + ":", "Best Time(ms)", "Avg Time(ms)", "Stdev(ms)", "Rate(M/s)", "Per Row(ns)", "Relative") + out.println("-" * (nameLen + 80)) results.zip(benchmarks).foreach { case (result, benchmark) => - out.printf("%-40s %14s %14s %11s %12s %13s %10s\n", + out.printf(s"%-${nameLen}s %14s %14s %11s %12s %13s %10s\n", benchmark.name, "%5.0f" format result.bestMs, "%4.0f" format result.avgMs, diff --git a/core/src/test/scala/org/apache/spark/benchmark/BenchmarkBase.scala b/core/src/test/scala/org/apache/spark/benchmark/BenchmarkBase.scala index 55e34b32fe0d4..9ba2f0d04c901 100644 --- a/core/src/test/scala/org/apache/spark/benchmark/BenchmarkBase.scala +++ b/core/src/test/scala/org/apache/spark/benchmark/BenchmarkBase.scala @@ -19,9 +19,11 @@ package org.apache.spark.benchmark import java.io.{File, FileOutputStream, OutputStream} +import org.apache.spark.internal.config.Tests.IS_TESTING + /** * A base class for generate benchmark results to a file. - * For JDK9+, JDK major version number is added to the file names to distingush the results. + * For JDK9+, JDK major version number is added to the file names to distinguish the results. */ abstract class BenchmarkBase { var output: Option[OutputStream] = None @@ -42,12 +44,25 @@ abstract class BenchmarkBase { } def main(args: Array[String]): Unit = { + // turning this on so the behavior between running benchmark via `spark-submit` or SBT will + // be consistent, also allow users to turn on/off certain behavior such as + // `spark.sql.codegen.factoryMode` + System.setProperty(IS_TESTING.key, "true") val regenerateBenchmarkFiles: Boolean = System.getenv("SPARK_GENERATE_BENCHMARK_FILES") == "1" if (regenerateBenchmarkFiles) { val version = System.getProperty("java.version").split("\\D+")(0).toInt val jdkString = if (version > 8) s"-jdk$version" else "" - val resultFileName = s"${this.getClass.getSimpleName.replace("$", "")}$jdkString-results.txt" - val file = new File(s"benchmarks/$resultFileName") + val resultFileName = + s"${this.getClass.getSimpleName.replace("$", "")}$jdkString$suffix-results.txt" + val prefix = Benchmarks.currentProjectRoot.map(_ + "/").getOrElse("") + val dir = new File(s"${prefix}benchmarks/") + if (!dir.exists()) { + // scalastyle:off println + println(s"Creating ${dir.getAbsolutePath} for benchmark results.") + // scalastyle:on println + dir.mkdirs() + } + val file = new File(dir, resultFileName) if (!file.exists()) { file.createNewFile() } @@ -65,6 +80,8 @@ abstract class BenchmarkBase { afterAll() } + def suffix: String = "" + /** * Any shutdown code to ensure a clean shutdown */ diff --git a/core/src/test/scala/org/apache/spark/benchmark/Benchmarks.scala b/core/src/test/scala/org/apache/spark/benchmark/Benchmarks.scala new file mode 100644 index 0000000000000..2bb70bc75f6bb --- /dev/null +++ b/core/src/test/scala/org/apache/spark/benchmark/Benchmarks.scala @@ -0,0 +1,144 @@ +/* + * 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. + */ +package org.apache.spark.benchmark + +import java.io.File +import java.lang.reflect.Modifier +import java.nio.file.{FileSystems, Paths} +import java.util.Locale + +import scala.collection.JavaConverters._ +import scala.util.Try + +import com.google.common.reflect.ClassPath + +/** + * Run all benchmarks. To run this benchmark, you should build Spark with either Maven or SBT. + * After that, you can run as below: + * + * {{{ + * 1. with spark-submit + * bin/spark-submit --class + * --jars , + * + * 2. generate result: + * SPARK_GENERATE_BENCHMARK_FILES=1 bin/spark-submit --class + * --jars , + * + * Results will be written to all corresponding files under "benchmarks/". + * Notice that it detects the sub-project's directories from jar's paths so the provided jars + * should be properly placed under target (Maven build) or target/scala-* (SBT) when you + * generate the files. + * }}} + * + * You can use a command as below to find all the test jars. + * Make sure to do not select duplicated jars created by different versions of builds or tools. + * {{{ + * find . -name '*-SNAPSHOT-tests.jar' | paste -sd ',' - + * }}} + * + * The example below runs all benchmarks and generates the results: + * {{{ + * SPARK_GENERATE_BENCHMARK_FILES=1 bin/spark-submit --class \ + * org.apache.spark.benchmark.Benchmarks --jars \ + * "`find . -name '*-SNAPSHOT-tests.jar' -o -name '*avro*-SNAPSHOT.jar' | paste -sd ',' -`" \ + * "`find . -name 'spark-core*-SNAPSHOT-tests.jar'`" \ + * "*" + * }}} + * + * The example below runs all benchmarks under "org.apache.spark.sql.execution.datasources" + * {{{ + * bin/spark-submit --class \ + * org.apache.spark.benchmark.Benchmarks --jars \ + * "`find . -name '*-SNAPSHOT-tests.jar' -o -name '*avro*-SNAPSHOT.jar' | paste -sd ',' -`" \ + * "`find . -name 'spark-core*-SNAPSHOT-tests.jar'`" \ + * "org.apache.spark.sql.execution.datasources.*" + * }}} + */ + +object Benchmarks { + var currentProjectRoot: Option[String] = None + + def main(args: Array[String]): Unit = { + val isFailFast = sys.env.get( + "SPARK_BENCHMARK_FAILFAST").map(_.toLowerCase(Locale.ROOT).trim.toBoolean).getOrElse(true) + val numOfSplits = sys.env.get( + "SPARK_BENCHMARK_NUM_SPLITS").map(_.toLowerCase(Locale.ROOT).trim.toInt).getOrElse(1) + val currentSplit = sys.env.get( + "SPARK_BENCHMARK_CUR_SPLIT").map(_.toLowerCase(Locale.ROOT).trim.toInt - 1).getOrElse(0) + var numBenchmark = 0 + + var isBenchmarkFound = false + val benchmarkClasses = ClassPath.from( + Thread.currentThread.getContextClassLoader + ).getTopLevelClassesRecursive("org.apache.spark").asScala.toArray + val matcher = FileSystems.getDefault.getPathMatcher(s"glob:${args.head}") + + benchmarkClasses.foreach { info => + lazy val clazz = info.load + lazy val runBenchmark = clazz.getMethod("main", classOf[Array[String]]) + // isAssignableFrom seems not working with the reflected class from Guava's + // getTopLevelClassesRecursive. + require(args.length > 0, "Benchmark class to run should be specified.") + if ( + info.getName.endsWith("Benchmark") && + // TODO(SPARK-34927): Support TPCDSQueryBenchmark in Benchmarks + !info.getName.endsWith("TPCDSQueryBenchmark") && + matcher.matches(Paths.get(info.getName)) && + Try(runBenchmark).isSuccess && // Does this has a main method? + !Modifier.isAbstract(clazz.getModifiers) // Is this a regular class? + ) { + numBenchmark += 1 + if (numBenchmark % numOfSplits == currentSplit) { + isBenchmarkFound = true + + val targetDirOrProjDir = + new File(clazz.getProtectionDomain.getCodeSource.getLocation.toURI) + .getParentFile.getParentFile + + // The root path to be referred in each benchmark. + currentProjectRoot = Some { + if (targetDirOrProjDir.getName == "target") { + // SBT build + targetDirOrProjDir.getParentFile.getCanonicalPath + } else { + // Maven build + targetDirOrProjDir.getCanonicalPath + } + } + + // scalastyle:off println + println(s"Running ${clazz.getName}:") + // scalastyle:on println + // Force GC to minimize the side effect. + System.gc() + try { + runBenchmark.invoke(null, args.tail.toArray) + } catch { + case e: Throwable if !isFailFast => + // scalastyle:off println + println(s"${clazz.getName} failed with the exception below:") + // scalastyle:on println + e.printStackTrace() + } + } + } + } + + if (!isBenchmarkFound) throw new RuntimeException("No benchmark found to run.") + } +} diff --git a/core/src/test/scala/org/apache/spark/broadcast/BroadcastSuite.scala b/core/src/test/scala/org/apache/spark/broadcast/BroadcastSuite.scala index a6776ee077894..5e8b25f425166 100644 --- a/core/src/test/scala/org/apache/spark/broadcast/BroadcastSuite.scala +++ b/core/src/test/scala/org/apache/spark/broadcast/BroadcastSuite.scala @@ -68,14 +68,14 @@ class BroadcastSuite extends SparkFunSuite with LocalSparkContext with Encryptio } encryptionTest("Accessing TorrentBroadcast variables in a local cluster") { conf => - val numSlaves = 4 + val numWorkers = 4 conf.set(SERIALIZER, "org.apache.spark.serializer.KryoSerializer") conf.set(config.BROADCAST_COMPRESS, true) - sc = new SparkContext("local-cluster[%d, 1, 1024]".format(numSlaves), "test", conf) + sc = new SparkContext("local-cluster[%d, 1, 1024]".format(numWorkers), "test", conf) val list = List[Int](1, 2, 3, 4) val broadcast = sc.broadcast(list) - val results = sc.parallelize(1 to numSlaves).map(x => (x, broadcast.value.sum)) - assert(results.collect().toSet === (1 to numSlaves).map(x => (x, 10)).toSet) + val results = sc.parallelize(1 to numWorkers).map(x => (x, broadcast.value.sum)) + assert(results.collect().toSet === (1 to numWorkers).map(x => (x, 10)).toSet) } test("TorrentBroadcast's blockifyObject and unblockifyObject are inverses") { @@ -99,12 +99,12 @@ class BroadcastSuite extends SparkFunSuite with LocalSparkContext with Encryptio } test("Test Lazy Broadcast variables with TorrentBroadcast") { - val numSlaves = 2 - sc = new SparkContext("local-cluster[%d, 1, 1024]".format(numSlaves), "test") - val rdd = sc.parallelize(1 to numSlaves) + val numWorkers = 2 + sc = new SparkContext("local-cluster[%d, 1, 1024]".format(numWorkers), "test") + val rdd = sc.parallelize(1 to numWorkers) val results = new DummyBroadcastClass(rdd).doSomething() - assert(results.toSet === (1 to numSlaves).map(x => (x, false)).toSet) + assert(results.toSet === (1 to numWorkers).map(x => (x, false)).toSet) } test("Unpersisting TorrentBroadcast on executors only in local mode") { @@ -196,27 +196,27 @@ class BroadcastSuite extends SparkFunSuite with LocalSparkContext with Encryptio */ private def testUnpersistTorrentBroadcast(distributed: Boolean, removeFromDriver: Boolean): Unit = { - val numSlaves = if (distributed) 2 else 0 + val numWorkers = if (distributed) 2 else 0 // Verify that blocks are persisted only on the driver def afterCreation(broadcastId: Long, bmm: BlockManagerMaster): Unit = { var blockId = BroadcastBlockId(broadcastId) - var statuses = bmm.getBlockStatus(blockId, askSlaves = true) + var statuses = bmm.getBlockStatus(blockId, askStorageEndpoints = true) assert(statuses.size === 1) blockId = BroadcastBlockId(broadcastId, "piece0") - statuses = bmm.getBlockStatus(blockId, askSlaves = true) + statuses = bmm.getBlockStatus(blockId, askStorageEndpoints = true) assert(statuses.size === 1) } // Verify that blocks are persisted in both the executors and the driver def afterUsingBroadcast(broadcastId: Long, bmm: BlockManagerMaster): Unit = { var blockId = BroadcastBlockId(broadcastId) - val statuses = bmm.getBlockStatus(blockId, askSlaves = true) - assert(statuses.size === numSlaves + 1) + val statuses = bmm.getBlockStatus(blockId, askStorageEndpoints = true) + assert(statuses.size === numWorkers + 1) blockId = BroadcastBlockId(broadcastId, "piece0") - assert(statuses.size === numSlaves + 1) + assert(statuses.size === numWorkers + 1) } // Verify that blocks are unpersisted on all executors, and on all nodes if removeFromDriver @@ -224,16 +224,16 @@ class BroadcastSuite extends SparkFunSuite with LocalSparkContext with Encryptio def afterUnpersist(broadcastId: Long, bmm: BlockManagerMaster): Unit = { var blockId = BroadcastBlockId(broadcastId) var expectedNumBlocks = if (removeFromDriver) 0 else 1 - var statuses = bmm.getBlockStatus(blockId, askSlaves = true) + var statuses = bmm.getBlockStatus(blockId, askStorageEndpoints = true) assert(statuses.size === expectedNumBlocks) blockId = BroadcastBlockId(broadcastId, "piece0") expectedNumBlocks = if (removeFromDriver) 0 else 1 - statuses = bmm.getBlockStatus(blockId, askSlaves = true) + statuses = bmm.getBlockStatus(blockId, askStorageEndpoints = true) assert(statuses.size === expectedNumBlocks) } - testUnpersistBroadcast(distributed, numSlaves, afterCreation, + testUnpersistBroadcast(distributed, numWorkers, afterCreation, afterUsingBroadcast, afterUnpersist, removeFromDriver) } @@ -248,7 +248,7 @@ class BroadcastSuite extends SparkFunSuite with LocalSparkContext with Encryptio */ private def testUnpersistBroadcast( distributed: Boolean, - numSlaves: Int, // used only when distributed = true + numWorkers: Int, // used only when distributed = true afterCreation: (Long, BlockManagerMaster) => Unit, afterUsingBroadcast: (Long, BlockManagerMaster) => Unit, afterUnpersist: (Long, BlockManagerMaster) => Unit, @@ -256,10 +256,10 @@ class BroadcastSuite extends SparkFunSuite with LocalSparkContext with Encryptio sc = if (distributed) { val _sc = - new SparkContext("local-cluster[%d, 1, 1024]".format(numSlaves), "test") + new SparkContext("local-cluster[%d, 1, 1024]".format(numWorkers), "test") // Wait until all salves are up try { - TestUtils.waitUntilExecutorsUp(_sc, numSlaves, 60000) + TestUtils.waitUntilExecutorsUp(_sc, numWorkers, 60000) _sc } catch { case e: Throwable => @@ -278,7 +278,7 @@ class BroadcastSuite extends SparkFunSuite with LocalSparkContext with Encryptio // Use broadcast variable on all executors val partitions = 10 - assert(partitions > numSlaves) + assert(partitions > numWorkers) val results = sc.parallelize(1 to partitions, partitions).map(x => (x, broadcast.value.sum)) assert(results.collect().toSet === (1 to partitions).map(x => (x, list.sum)).toSet) afterUsingBroadcast(broadcast.id, blockManagerMaster) diff --git a/core/src/test/scala/org/apache/spark/deploy/ClientSuite.scala b/core/src/test/scala/org/apache/spark/deploy/ClientSuite.scala index 6a99dbca64f4b..792168834dea2 100644 --- a/core/src/test/scala/org/apache/spark/deploy/ClientSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/ClientSuite.scala @@ -17,7 +17,8 @@ package org.apache.spark.deploy -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.SparkFunSuite diff --git a/core/src/test/scala/org/apache/spark/deploy/DecommissionWorkerSuite.scala b/core/src/test/scala/org/apache/spark/deploy/DecommissionWorkerSuite.scala new file mode 100644 index 0000000000000..c2486b9650d5c --- /dev/null +++ b/core/src/test/scala/org/apache/spark/deploy/DecommissionWorkerSuite.scala @@ -0,0 +1,469 @@ +/* + * 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. + */ + +package org.apache.spark.deploy + +import java.util.concurrent.{ConcurrentHashMap, ConcurrentLinkedQueue} +import java.util.concurrent.atomic.AtomicBoolean + +import scala.collection.JavaConverters._ +import scala.collection.mutable +import scala.concurrent.duration._ + +import org.scalatest.BeforeAndAfterEach +import org.scalatest.concurrent.Eventually._ + +import org.apache.spark._ +import org.apache.spark.deploy.DeployMessages.{DecommissionWorkers, MasterStateResponse, RequestMasterState} +import org.apache.spark.deploy.master.{ApplicationInfo, Master, WorkerInfo} +import org.apache.spark.deploy.worker.Worker +import org.apache.spark.internal.{config, Logging} +import org.apache.spark.network.TransportContext +import org.apache.spark.network.netty.SparkTransportConf +import org.apache.spark.network.shuffle.ExternalBlockHandler +import org.apache.spark.rpc.{RpcAddress, RpcEnv} +import org.apache.spark.scheduler._ +import org.apache.spark.shuffle.FetchFailedException +import org.apache.spark.storage.BlockManagerId +import org.apache.spark.util.Utils + +class DecommissionWorkerSuite + extends SparkFunSuite + with Logging + with LocalSparkContext + with BeforeAndAfterEach { + + private var masterAndWorkerConf: SparkConf = null + private var masterAndWorkerSecurityManager: SecurityManager = null + private var masterRpcEnv: RpcEnv = null + private var master: Master = null + private var workerIdToRpcEnvs: mutable.HashMap[String, RpcEnv] = null + private var workers: mutable.ArrayBuffer[Worker] = null + + override def beforeEach(): Unit = { + super.beforeEach() + masterAndWorkerConf = new SparkConf() + .set(config.DECOMMISSION_ENABLED, true) + masterAndWorkerSecurityManager = new SecurityManager(masterAndWorkerConf) + masterRpcEnv = RpcEnv.create( + Master.SYSTEM_NAME, + "localhost", + 0, + masterAndWorkerConf, + masterAndWorkerSecurityManager) + master = makeMaster() + workerIdToRpcEnvs = mutable.HashMap.empty + workers = mutable.ArrayBuffer.empty + } + + override def afterEach(): Unit = { + try { + masterRpcEnv.shutdown() + workerIdToRpcEnvs.values.foreach(_.shutdown()) + workerIdToRpcEnvs.clear() + master.stop() + workers.foreach(_.stop()) + workers.clear() + masterRpcEnv = null + } finally { + super.afterEach() + } + } + + // Unlike TestUtils.withListener, it also waits for the job to be done + def withListener(sc: SparkContext, listener: RootStageAwareListener) + (body: SparkListener => Unit): Unit = { + sc.addSparkListener(listener) + try { + body(listener) + sc.listenerBus.waitUntilEmpty() + listener.waitForJobDone() + } finally { + sc.listenerBus.removeListener(listener) + } + } + + test("decommission workers should not result in job failure") { + val maxTaskFailures = 2 + val numTimesToKillWorkers = maxTaskFailures + 1 + val numWorkers = numTimesToKillWorkers + 1 + createWorkers(numWorkers) + + // Here we will have a single task job and we will keep decommissioning (and killing) the + // worker running that task K times. Where K is more than the maxTaskFailures. Since the worker + // is notified of the decommissioning, the task failures can be ignored and not fail + // the job. + + sc = createSparkContext(config.TASK_MAX_FAILURES.key -> maxTaskFailures.toString) + val executorIdToWorkerInfo = getExecutorToWorkerAssignments + val taskIdsKilled = new ConcurrentHashMap[Long, Boolean] + val listener = new RootStageAwareListener { + override def handleRootTaskStart(taskStart: SparkListenerTaskStart): Unit = { + val taskInfo = taskStart.taskInfo + if (taskIdsKilled.size() < numTimesToKillWorkers) { + val workerInfo = executorIdToWorkerInfo(taskInfo.executorId) + decommissionWorkerOnMaster(workerInfo, "partition 0 must die") + killWorkerAfterTimeout(workerInfo, 1) + taskIdsKilled.put(taskInfo.taskId, true) + } + } + } + withListener(sc, listener) { _ => + val jobResult = sc.parallelize(1 to 1, 1).map { _ => + Thread.sleep(5 * 1000L); 1 + }.count() + assert(jobResult === 1) + } + // single task job that gets to run numTimesToKillWorkers + 1 times. + assert(listener.getTasksFinished().size === numTimesToKillWorkers + 1) + listener.rootTasksStarted.asScala.foreach { taskInfo => + assert(taskInfo.index == 0, s"Unknown task index ${taskInfo.index}") + } + listener.rootTasksEnded.asScala.foreach { taskInfo => + assert(taskInfo.index === 0, s"Expected task index ${taskInfo.index} to be 0") + // If a task has been killed then it shouldn't be successful + val taskSuccessExpected = !taskIdsKilled.getOrDefault(taskInfo.taskId, false) + val taskSuccessActual = taskInfo.successful + assert(taskSuccessActual === taskSuccessExpected, + s"Expected task success $taskSuccessActual == $taskSuccessExpected") + } + } + + test("decommission workers ensure that shuffle output is regenerated even with shuffle service") { + createWorkers(2) + val ss = new ExternalShuffleServiceHolder() + + sc = createSparkContext( + config.Tests.TEST_NO_STAGE_RETRY.key -> "true", + config.SHUFFLE_MANAGER.key -> "sort", + config.SHUFFLE_SERVICE_ENABLED.key -> "true", + config.SHUFFLE_SERVICE_PORT.key -> ss.getPort.toString + ) + TestUtils.waitUntilExecutorsUp(sc, 2, 60000) + + // Here we will create a 2 stage job: The first stage will have two tasks and the second stage + // will have one task. The two tasks in the first stage will be long and short. We decommission + // and kill the worker after the short task is done. Eventually the driver should get the + // executor lost signal for the short task executor. This should trigger regenerating + // the shuffle output since we cleanly decommissioned the executor, despite running with an + // external shuffle service. + try { + val executorIdToWorkerInfo = getExecutorToWorkerAssignments + val workerForTask0Decommissioned = new AtomicBoolean(false) + // single task job + val listener = new RootStageAwareListener { + override def handleRootTaskEnd(taskEnd: SparkListenerTaskEnd): Unit = { + val taskInfo = taskEnd.taskInfo + if (taskInfo.index == 0) { + if (workerForTask0Decommissioned.compareAndSet(false, true)) { + val workerInfo = executorIdToWorkerInfo(taskInfo.executorId) + decommissionWorkerOnMaster(workerInfo, "Kill early done map worker") + killWorkerAfterTimeout(workerInfo, 0) + logInfo(s"Killed the node ${workerInfo.hostPort} that was running the early task") + } + } + } + } + withListener(sc, listener) { _ => + val jobResult = sc.parallelize(1 to 2, 2).mapPartitionsWithIndex((pid, _) => { + val sleepTimeSeconds = if (pid == 0) 1 else 10 + Thread.sleep(sleepTimeSeconds * 1000L) + List(1).iterator + }, preservesPartitioning = true).repartition(1).sum() + assert(jobResult === 2) + } + val tasksSeen = listener.getTasksFinished() + // 4 tasks: 2 from first stage, one retry due to decom, one more from the second stage. + assert(tasksSeen.size === 4, s"Expected 4 tasks but got $tasksSeen") + listener.rootTasksStarted.asScala.foreach { taskInfo => + assert(taskInfo.index <= 1, s"Expected ${taskInfo.index} <= 1") + assert(taskInfo.successful, s"Task ${taskInfo.index} should be successful") + } + val tasksEnded = listener.rootTasksEnded.asScala + tasksEnded.filter(_.index != 0).foreach { taskInfo => + assert(taskInfo.attemptNumber === 0, "2nd task should succeed on 1st attempt") + } + val firstTaskAttempts = tasksEnded.filter(_.index == 0) + assert(firstTaskAttempts.size > 1, s"Task 0 should have multiple attempts") + } finally { + ss.close() + } + } + + def testFetchFailures(initialSleepMillis: Int): Unit = { + createWorkers(2) + sc = createSparkContext( + config.Tests.TEST_NO_STAGE_RETRY.key -> "false", + "spark.test.executor.decommission.initial.sleep.millis" -> initialSleepMillis.toString, + config.UNREGISTER_OUTPUT_ON_HOST_ON_FETCH_FAILURE.key -> "true") + TestUtils.waitUntilExecutorsUp(sc, 2, 60000) + + val executorIdToWorkerInfo = getExecutorToWorkerAssignments + val executorToDecom = executorIdToWorkerInfo.keysIterator.next + + // The task code below cannot call executorIdToWorkerInfo, so we need to pre-compute + // the worker to decom to force it to be serialized into the task. + val workerToDecom = executorIdToWorkerInfo(executorToDecom) + + // The setup of this job is similar to the one above: 2 stage job with first stage having + // long and short tasks. Except that we want the shuffle output to be regenerated on a + // fetch failure instead of an executor lost. Since it is hard to "trigger a fetch failure", + // we manually raise the FetchFailed exception when the 2nd stage's task runs and require that + // fetch failure to trigger a recomputation. + logInfo(s"Will try to decommission the task running on executor $executorToDecom") + val listener = new RootStageAwareListener { + override def handleRootTaskEnd(taskEnd: SparkListenerTaskEnd): Unit = { + val taskInfo = taskEnd.taskInfo + if (taskInfo.executorId == executorToDecom && taskInfo.attemptNumber == 0 && + taskEnd.stageAttemptId == 0 && taskEnd.stageId == 0) { + decommissionWorkerOnMaster(workerToDecom, + "decommission worker after task on it is done") + } + } + } + withListener(sc, listener) { _ => + val jobResult = sc.parallelize(1 to 2, 2).mapPartitionsWithIndex((_, _) => { + val executorId = SparkEnv.get.executorId + val context = TaskContext.get() + // Only sleep in the first attempt to create the required window for decommissioning. + // Subsequent attempts don't need to be delayed to speed up the test. + if (context.attemptNumber() == 0 && context.stageAttemptNumber() == 0) { + val sleepTimeSeconds = if (executorId == executorToDecom) 10 else 1 + Thread.sleep(sleepTimeSeconds * 1000L) + } + List(1).iterator + }, preservesPartitioning = true) + .repartition(1).mapPartitions(iter => { + val context = TaskContext.get() + if (context.attemptNumber == 0 && context.stageAttemptNumber() == 0) { + // Wait a bit for the decommissioning to be triggered in the listener + Thread.sleep(5000) + // MapIndex is explicitly -1 to force the entire host to be decommissioned + // However, this will cause both the tasks in the preceding stage since the host here is + // "localhost" (shortcoming of this single-machine unit test in that all the workers + // are actually on the same host) + throw new FetchFailedException(BlockManagerId(executorToDecom, + workerToDecom.host, workerToDecom.port), 0, 0, -1, 0, "Forcing fetch failure") + } + val sumVal: List[Int] = List(iter.sum) + sumVal.iterator + }, preservesPartitioning = true) + .sum() + assert(jobResult === 2) + } + // 6 tasks: 2 from first stage, 2 rerun again from first stage, 2nd stage attempt 1 and 2. + val tasksSeen = listener.getTasksFinished() + assert(tasksSeen.size === 6, s"Expected 6 tasks but got $tasksSeen") + } + + test("decommission stalled workers ensure that fetch failures lead to rerun") { + testFetchFailures(3600 * 1000) + } + + test("decommission eager workers ensure that fetch failures lead to rerun") { + testFetchFailures(0) + } + + private abstract class RootStageAwareListener extends SparkListener { + private var rootStageId: Option[Int] = None + private val tasksFinished = new ConcurrentLinkedQueue[String]() + private val jobDone = new AtomicBoolean(false) + val rootTasksStarted = new ConcurrentLinkedQueue[TaskInfo]() + val rootTasksEnded = new ConcurrentLinkedQueue[TaskInfo]() + + protected def isRootStageId(stageId: Int): Boolean = + (rootStageId.isDefined && rootStageId.get == stageId) + + override def onStageSubmitted(stageSubmitted: SparkListenerStageSubmitted): Unit = { + if (stageSubmitted.stageInfo.parentIds.isEmpty && rootStageId.isEmpty) { + rootStageId = Some(stageSubmitted.stageInfo.stageId) + } + } + + override def onJobEnd(jobEnd: SparkListenerJobEnd): Unit = { + jobEnd.jobResult match { + case JobSucceeded => jobDone.set(true) + case JobFailed(exception) => logError(s"Job failed", exception) + } + } + + protected def handleRootTaskEnd(end: SparkListenerTaskEnd) = {} + + protected def handleRootTaskStart(start: SparkListenerTaskStart) = {} + + private def getSignature(taskInfo: TaskInfo, stageId: Int, stageAttemptId: Int): + String = { + s"${stageId}:${stageAttemptId}:" + + s"${taskInfo.index}:${taskInfo.attemptNumber}-${taskInfo.status}" + } + + override def onTaskStart(taskStart: SparkListenerTaskStart): Unit = { + val signature = getSignature(taskStart.taskInfo, taskStart.stageId, taskStart.stageAttemptId) + logInfo(s"Task started: $signature") + if (isRootStageId(taskStart.stageId)) { + rootTasksStarted.add(taskStart.taskInfo) + handleRootTaskStart(taskStart) + } + } + + override def onTaskEnd(taskEnd: SparkListenerTaskEnd): Unit = { + val taskSignature = getSignature(taskEnd.taskInfo, taskEnd.stageId, taskEnd.stageAttemptId) + logInfo(s"Task End $taskSignature") + tasksFinished.add(taskSignature) + if (isRootStageId(taskEnd.stageId)) { + rootTasksEnded.add(taskEnd.taskInfo) + handleRootTaskEnd(taskEnd) + } + } + + def getTasksFinished(): Seq[String] = { + tasksFinished.asScala.toList + } + + def waitForJobDone(): Unit = { + eventually(timeout(10.seconds), interval(100.milliseconds)) { + assert(jobDone.get(), "Job isn't successfully done yet") + } + } + } + + private def getExecutorToWorkerAssignments: Map[String, WorkerInfo] = { + val executorIdToWorkerInfo = mutable.HashMap[String, WorkerInfo]() + master.workers.foreach { wi => + assert(wi.executors.size <= 1, "There should be at most one executor per worker") + // Cast the executorId to string since the TaskInfo.executorId is a string + wi.executors.values.foreach { e => + val executorIdString = e.id.toString + val oldWorkerInfo = executorIdToWorkerInfo.put(executorIdString, wi) + assert(oldWorkerInfo.isEmpty, + s"Executor $executorIdString already present on another worker ${oldWorkerInfo}") + } + } + executorIdToWorkerInfo.toMap + } + + private def makeMaster(): Master = { + val master = new Master( + masterRpcEnv, + masterRpcEnv.address, + 0, + masterAndWorkerSecurityManager, + masterAndWorkerConf) + masterRpcEnv.setupEndpoint(Master.ENDPOINT_NAME, master) + master + } + + private def createWorkers(numWorkers: Int, cores: Int = 1, memory: Int = 1024): Unit = { + val workerRpcEnvs = (0 until numWorkers).map { i => + RpcEnv.create( + Worker.SYSTEM_NAME + i, + "localhost", + 0, + masterAndWorkerConf, + masterAndWorkerSecurityManager) + } + workers.clear() + val rpcAddressToRpcEnv: mutable.HashMap[RpcAddress, RpcEnv] = mutable.HashMap.empty + workerRpcEnvs.foreach { rpcEnv => + val workDir = Utils.createTempDir(namePrefix = this.getClass.getSimpleName()).toString + val worker = new Worker(rpcEnv, 0, cores, memory, Array(masterRpcEnv.address), + Worker.ENDPOINT_NAME, workDir, masterAndWorkerConf, masterAndWorkerSecurityManager) + rpcEnv.setupEndpoint(Worker.ENDPOINT_NAME, worker) + workers.append(worker) + val oldRpcEnv = rpcAddressToRpcEnv.put(rpcEnv.address, rpcEnv) + logInfo(s"Created a worker at ${rpcEnv.address} with workdir $workDir") + assert(oldRpcEnv.isEmpty, s"Detected duplicate rpcEnv ${oldRpcEnv} for ${rpcEnv.address}") + } + workerIdToRpcEnvs.clear() + // Wait until all workers register with master successfully + eventually(timeout(1.minute), interval(1.seconds)) { + val workersOnMaster = getMasterState.workers + val numWorkersCurrently = workersOnMaster.length + logInfo(s"Waiting for $numWorkers workers to come up: So far $numWorkersCurrently") + assert(numWorkersCurrently === numWorkers) + workersOnMaster.foreach { workerInfo => + val rpcAddress = RpcAddress(workerInfo.host, workerInfo.port) + val rpcEnv = rpcAddressToRpcEnv(rpcAddress) + assert(rpcEnv != null, s"Cannot find the worker for $rpcAddress") + val oldRpcEnv = workerIdToRpcEnvs.put(workerInfo.id, rpcEnv) + assert(oldRpcEnv.isEmpty, s"Detected duplicate rpcEnv ${oldRpcEnv} for worker " + + s"${workerInfo.id}") + } + } + logInfo(s"Created ${workers.size} workers") + } + + private def getMasterState: MasterStateResponse = { + master.self.askSync[MasterStateResponse](RequestMasterState) + } + + private def getApplications(): Seq[ApplicationInfo] = { + getMasterState.activeApps + } + + def decommissionWorkerOnMaster(workerInfo: WorkerInfo, reason: String): Unit = { + logInfo(s"Trying to decommission worker ${workerInfo.id} for reason `$reason`") + master.self.send(DecommissionWorkers(Seq(workerInfo.id))) + } + + def killWorkerAfterTimeout(workerInfo: WorkerInfo, secondsToWait: Int): Unit = { + val env = workerIdToRpcEnvs(workerInfo.id) + Thread.sleep(secondsToWait * 1000L) + env.shutdown() + env.awaitTermination() + } + + def createSparkContext(extraConfs: (String, String)*): SparkContext = { + val conf = new SparkConf() + .setMaster(masterRpcEnv.address.toSparkURL) + .setAppName("test") + .setAll(extraConfs) + sc = new SparkContext(conf) + val appId = sc.applicationId + eventually(timeout(1.minute), interval(1.seconds)) { + val apps = getApplications() + assert(apps.size === 1) + assert(apps.head.id === appId) + assert(apps.head.getExecutorLimit === Int.MaxValue) + } + sc + } + + private class ExternalShuffleServiceHolder() { + // The external shuffle service can start with default configs and not get polluted by the + // other configs used in this test. + private val transportConf = SparkTransportConf.fromSparkConf(new SparkConf(), + "shuffle", numUsableCores = 2) + private val rpcHandler = new ExternalBlockHandler(transportConf, null) + private val transportContext = new TransportContext(transportConf, rpcHandler) + private val server = transportContext.createServer() + + def getPort: Int = server.getPort + + def close(): Unit = { + Utils.tryLogNonFatalError { + server.close() + } + Utils.tryLogNonFatalError { + rpcHandler.close() + } + Utils.tryLogNonFatalError { + transportContext.close() + } + } + } +} diff --git a/core/src/test/scala/org/apache/spark/deploy/DeployTestUtils.scala b/core/src/test/scala/org/apache/spark/deploy/DeployTestUtils.scala index 31f065ec55749..b182b11a0e85e 100644 --- a/core/src/test/scala/org/apache/spark/deploy/DeployTestUtils.scala +++ b/core/src/test/scala/org/apache/spark/deploy/DeployTestUtils.scala @@ -102,6 +102,7 @@ private[deploy] object DeployTestUtils { createDriverDesc(), null, "spark://worker", + "http://publicAddress:80", new SecurityManager(conf)) } diff --git a/core/src/test/scala/org/apache/spark/deploy/ExternalShuffleServiceMetricsSuite.scala b/core/src/test/scala/org/apache/spark/deploy/ExternalShuffleServiceMetricsSuite.scala index d681c13337e0d..ea4d252f0dbae 100644 --- a/core/src/test/scala/org/apache/spark/deploy/ExternalShuffleServiceMetricsSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/ExternalShuffleServiceMetricsSuite.scala @@ -61,7 +61,8 @@ class ExternalShuffleServiceMetricsSuite extends SparkFunSuite { "registeredExecutorsSize", "registerExecutorRequestLatencyMillis", "shuffle-server.usedDirectMemory", - "shuffle-server.usedHeapMemory") + "shuffle-server.usedHeapMemory", + "finalizeShuffleMergeLatencyMillis") ) } } diff --git a/core/src/test/scala/org/apache/spark/deploy/IvyTestUtils.scala b/core/src/test/scala/org/apache/spark/deploy/IvyTestUtils.scala index 42b8cde650390..b986be03e965c 100644 --- a/core/src/test/scala/org/apache/spark/deploy/IvyTestUtils.scala +++ b/core/src/test/scala/org/apache/spark/deploy/IvyTestUtils.scala @@ -317,7 +317,7 @@ private[deploy] object IvyTestUtils { val rFiles = createRFiles(root, className, artifact.groupId) allFiles.append(rFiles: _*) } - val jarFile = packJar(jarPath, artifact, allFiles, useIvyLayout, withR) + val jarFile = packJar(jarPath, artifact, allFiles.toSeq, useIvyLayout, withR) assert(jarFile.exists(), "Problem creating Jar file") val descriptor = createDescriptor(tempPath, artifact, dependencies, useIvyLayout) assert(descriptor.exists(), "Problem creating Pom file") diff --git a/core/src/test/scala/org/apache/spark/deploy/JsonProtocolSuite.scala b/core/src/test/scala/org/apache/spark/deploy/JsonProtocolSuite.scala index eeccf56cbf02e..7d3eb7c6b0f6e 100644 --- a/core/src/test/scala/org/apache/spark/deploy/JsonProtocolSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/JsonProtocolSuite.scala @@ -106,6 +106,9 @@ object JsonConstants { """ |{"id":"id","starttime":3,"name":"name", |"cores":0,"user":"%s", + |"memoryperexecutor":1234, + |"resourcesperexecutor":[{"name":"gpu", + |"amount":3},{"name":"fpga","amount":3}], |"memoryperslave":1234, |"resourcesperslave":[{"name":"gpu", |"amount":3},{"name":"fpga","amount":3}], @@ -125,14 +128,15 @@ object JsonConstants { |:["3","4","5"]}},"resourcesused":{"gpu": |{"name":"gpu","addresses":[]},"fpga": |{"name":"fpga","addresses":[]}},"resourcesfree": - |{"gpu":{"name":"gpu","addresses":["2","1","0"]}, - |"fpga":{"name":"fpga","addresses":["5","4","3"]}}, + |{"gpu":{"name":"gpu","addresses":["0","1","2"]}, + |"fpga":{"name":"fpga","addresses":["3","4","5"]}}, |"state":"ALIVE","lastheartbeat":%d} """.format(currTimeInMillis).stripMargin val appDescJsonStr = """ - |{"name":"name","cores":4,"memoryperslave":1234,"resourcesperslave":[], + |{"name":"name","cores":4,"memoryperexecutor":1234,"resourcesperexecutor":[], + |"memoryperslave":1234,"resourcesperslave":[], |"user":"%s","command":"Command(mainClass,List(arg1, arg2),Map(),List(),List(),List())"} """.format(System.getProperty("user.name", "")).stripMargin diff --git a/core/src/test/scala/org/apache/spark/deploy/LogUrlsStandaloneSuite.scala b/core/src/test/scala/org/apache/spark/deploy/LogUrlsStandaloneSuite.scala index 84fc16979925b..5d60aad615583 100644 --- a/core/src/test/scala/org/apache/spark/deploy/LogUrlsStandaloneSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/LogUrlsStandaloneSuite.scala @@ -25,7 +25,7 @@ import scala.io.Source import org.apache.spark.{LocalSparkContext, SparkContext, SparkFunSuite} import org.apache.spark.scheduler.{SparkListener, SparkListenerExecutorAdded} import org.apache.spark.scheduler.cluster.ExecutorInfo -import org.apache.spark.util.SparkConfWithEnv +import org.apache.spark.util.{SparkConfWithEnv, Utils} class LogUrlsStandaloneSuite extends SparkFunSuite with LocalSparkContext { @@ -43,7 +43,7 @@ class LogUrlsStandaloneSuite extends SparkFunSuite with LocalSparkContext { assert(info.logUrlMap.nonEmpty) // Browse to each URL to check that it's valid info.logUrlMap.foreach { case (logType, logUrl) => - val html = Source.fromURL(logUrl).mkString + val html = Utils.tryWithResource(Source.fromURL(logUrl))(_.mkString) assert(html.contains(s"$logType log page")) } } diff --git a/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala b/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala index fd2d1f56ed9b6..02efcaedd6c33 100644 --- a/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/SparkSubmitSuite.scala @@ -29,8 +29,10 @@ import com.google.common.io.ByteStreams import org.apache.commons.io.FileUtils import org.apache.hadoop.conf.Configuration import org.apache.hadoop.fs.{FileStatus, FSDataInputStream, Path} -import org.scalatest.{BeforeAndAfterEach, Matchers} +import org.scalatest.BeforeAndAfterEach import org.scalatest.concurrent.{Signaler, ThreadSignaler, TimeLimits} +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.scalatest.time.Span import org.scalatest.time.SpanSugar._ @@ -45,7 +47,7 @@ import org.apache.spark.internal.Logging import org.apache.spark.internal.config._ import org.apache.spark.internal.config.UI._ import org.apache.spark.launcher.SparkLauncher -import org.apache.spark.util.{CommandLineUtils, ResetSystemProperties, Utils} +import org.apache.spark.util.{CommandLineUtils, DependencyUtils, ResetSystemProperties, Utils} trait TestPrematureExit { suite: SparkFunSuite => @@ -333,6 +335,43 @@ class SparkSubmitSuite sys.props("SPARK_SUBMIT") should be ("true") } + test("SPARK-33530: handles standalone mode with archives") { + val clArgs = Seq( + "--master", "spark://localhost:1234", + "--executor-memory", "5g", + "--executor-cores", "5", + "--class", "org.SomeClass", + "--jars", "one.jar,two.jar,three.jar", + "--driver-memory", "4g", + "--files", "file1.txt,file2.txt", + "--archives", "archive1.zip,archive2.jar", + "--num-executors", "6", + "--name", "beauty", + "--conf", "spark.ui.enabled=false", + "thejar.jar", + "arg1", "arg2") + val appArgs = new SparkSubmitArguments(clArgs) + val (childArgs, classpath, conf, mainClass) = submit.prepareSubmitEnvironment(appArgs) + val childArgsStr = childArgs.mkString(" ") + childArgsStr should include ("arg1 arg2") + mainClass should be ("org.SomeClass") + + classpath(0) should endWith ("thejar.jar") + classpath(1) should endWith ("one.jar") + classpath(2) should endWith ("two.jar") + classpath(3) should endWith ("three.jar") + + conf.get("spark.executor.memory") should be ("5g") + conf.get("spark.driver.memory") should be ("4g") + conf.get("spark.executor.cores") should be ("5") + conf.get("spark.jars") should include regex (".*one.jar,.*two.jar,.*three.jar") + conf.get("spark.files") should include regex (".*file1.txt,.*file2.txt") + conf.get("spark.archives") should include regex (".*archive1.zip,.*archive2.jar") + conf.get("spark.app.name") should be ("beauty") + conf.get(UI_ENABLED) should be (false) + sys.props("SPARK_SUBMIT") should be ("true") + } + test("handles standalone cluster mode") { testStandaloneCluster(useRest = true) } @@ -568,7 +607,8 @@ class SparkSubmitSuite } } - val clArgs2 = Seq("--class", "org.SomeClass", "thejar.jar") + val dummyJarFile = TestUtils.createJarWithClasses(Seq.empty) + val clArgs2 = Seq("--class", "org.SomeClass", dummyJarFile.toString) val appArgs2 = new SparkSubmitArguments(clArgs2) val (_, _, conf2, _) = submit.prepareSubmitEnvironment(appArgs2) assert(!conf2.contains(UI_SHOW_CONSOLE_PROGRESS)) @@ -1066,8 +1106,8 @@ class SparkSubmitSuite // The path and filename are preserved. assert(outputUri.getPath.endsWith(new Path(sourceUri).getName)) - assert(FileUtils.readFileToString(new File(outputUri.getPath)) === - FileUtils.readFileToString(new File(sourceUri.getPath))) + assert(FileUtils.readFileToString(new File(outputUri.getPath), StandardCharsets.UTF_8) === + FileUtils.readFileToString(new File(sourceUri.getPath), StandardCharsets.UTF_8)) } private def deleteTempOutputFile(outputPath: String): Unit = { @@ -1081,8 +1121,7 @@ class SparkSubmitSuite val sparkConf = new SparkConf(false) intercept[IOException] { DependencyUtils.downloadFile( - "abc:/my/file", Utils.createTempDir(), sparkConf, new Configuration(), - new SecurityManager(sparkConf)) + "abc:/my/file", Utils.createTempDir(), sparkConf, new Configuration()) } } @@ -1092,19 +1131,17 @@ class SparkSubmitSuite val tmpDir = Utils.createTempDir() updateConfWithFakeS3Fs(hadoopConf) intercept[FileNotFoundException] { - DependencyUtils.downloadFile("s3a:/no/such/file", tmpDir, sparkConf, hadoopConf, - new SecurityManager(sparkConf)) + DependencyUtils.downloadFile("s3a:/no/such/file", tmpDir, sparkConf, hadoopConf) } } test("downloadFile does not download local file") { val sparkConf = new SparkConf(false) - val secMgr = new SecurityManager(sparkConf) // empty path is considered as local file. val tmpDir = Files.createTempDirectory("tmp").toFile - assert(DependencyUtils.downloadFile("", tmpDir, sparkConf, new Configuration(), secMgr) === "") - assert(DependencyUtils.downloadFile("/local/file", tmpDir, sparkConf, new Configuration(), - secMgr) === "/local/file") + assert(DependencyUtils.downloadFile("", tmpDir, sparkConf, new Configuration()) === "") + assert(DependencyUtils.downloadFile( + "/local/file", tmpDir, sparkConf, new Configuration()) === "/local/file") } test("download one file to local") { @@ -1112,13 +1149,12 @@ class SparkSubmitSuite val jarFile = File.createTempFile("test", ".jar") jarFile.deleteOnExit() val content = "hello, world" - FileUtils.write(jarFile, content) + FileUtils.write(jarFile, content, StandardCharsets.UTF_8) val hadoopConf = new Configuration() val tmpDir = Files.createTempDirectory("tmp").toFile updateConfWithFakeS3Fs(hadoopConf) val sourcePath = s"s3a://${jarFile.toURI.getPath}" - val outputPath = DependencyUtils.downloadFile(sourcePath, tmpDir, sparkConf, hadoopConf, - new SecurityManager(sparkConf)) + val outputPath = DependencyUtils.downloadFile(sourcePath, tmpDir, sparkConf, hadoopConf) checkDownloadedFile(sourcePath, outputPath) deleteTempOutputFile(outputPath) } @@ -1128,14 +1164,13 @@ class SparkSubmitSuite val jarFile = File.createTempFile("test", ".jar") jarFile.deleteOnExit() val content = "hello, world" - FileUtils.write(jarFile, content) + FileUtils.write(jarFile, content, StandardCharsets.UTF_8) val hadoopConf = new Configuration() val tmpDir = Files.createTempDirectory("tmp").toFile updateConfWithFakeS3Fs(hadoopConf) val sourcePaths = Seq("/local/file", s"s3a://${jarFile.toURI.getPath}") val outputPaths = DependencyUtils - .downloadFileList(sourcePaths.mkString(","), tmpDir, sparkConf, hadoopConf, - new SecurityManager(sparkConf)) + .downloadFileList(sourcePaths.mkString(","), tmpDir, sparkConf, hadoopConf) .split(",") assert(outputPaths.length === sourcePaths.length) @@ -1149,7 +1184,6 @@ class SparkSubmitSuite val fs = File.separator val sparkConf = new SparkConf(false) val hadoopConf = new Configuration() - val secMgr = new SecurityManager(sparkConf) val appJarName = "myApp.jar" val jar1Name = "myJar1.jar" @@ -1157,8 +1191,7 @@ class SparkSubmitSuite val userJar = s"file:/path${fs}to${fs}app${fs}jar$fs$appJarName" val jars = s"file:/$jar1Name,file:/$appJarName,file:/$jar2Name" - val resolvedJars = DependencyUtils - .resolveAndDownloadJars(jars, userJar, sparkConf, hadoopConf, secMgr) + val resolvedJars = DependencyUtils.resolveAndDownloadJars(jars, userJar, sparkConf, hadoopConf) assert(!resolvedJars.contains(appJarName)) assert(resolvedJars.contains(jar1Name) && resolvedJars.contains(jar2Name)) @@ -1210,17 +1243,97 @@ class SparkSubmitSuite testRemoteResources(enableHttpFs = true) } - test("force download from blacklisted schemes") { - testRemoteResources(enableHttpFs = true, blacklistSchemes = Seq("http")) + test("force download from forced schemes") { + testRemoteResources(enableHttpFs = true, forceDownloadSchemes = Seq("http")) } test("force download for all the schemes") { - testRemoteResources(enableHttpFs = true, blacklistSchemes = Seq("*")) + testRemoteResources(enableHttpFs = true, forceDownloadSchemes = Seq("*")) + } + + test("SPARK-32119: Jars and files should be loaded when Executors launch for plugins") { + val tempDir = Utils.createTempDir() + val tempFileName = "test.txt" + val tempFile = new File(tempDir, tempFileName) + + // scalastyle:off println + Utils.tryWithResource { + new PrintWriter(tempFile) + } { writer => + writer.println("SparkPluginTest") + } + // scalastyle:on println + + val sparkPluginCodeBody = + """ + |@Override + |public org.apache.spark.api.plugin.ExecutorPlugin executorPlugin() { + | return new TestExecutorPlugin(); + |} + | + |@Override + |public org.apache.spark.api.plugin.DriverPlugin driverPlugin() { return null; } + """.stripMargin + val executorPluginCodeBody = + s""" + |@Override + |public void init( + | org.apache.spark.api.plugin.PluginContext ctx, + | java.util.Map extraConf) { + | String str = null; + | try (java.io.BufferedReader reader = + | new java.io.BufferedReader(new java.io.InputStreamReader( + | new java.io.FileInputStream("$tempFileName")))) { + | str = reader.readLine(); + | } catch (java.io.IOException e) { + | throw new RuntimeException(e); + | } finally { + | assert str == "SparkPluginTest"; + | } + |} + """.stripMargin + + val compiledExecutorPlugin = TestUtils.createCompiledClass( + "TestExecutorPlugin", + tempDir, + "", + null, + Seq.empty, + Seq("org.apache.spark.api.plugin.ExecutorPlugin"), + executorPluginCodeBody) + + val thisClassPath = + sys.props("java.class.path").split(File.pathSeparator).map(p => new File(p).toURI.toURL) + val compiledSparkPlugin = TestUtils.createCompiledClass( + "TestSparkPlugin", + tempDir, + "", + null, + Seq(tempDir.toURI.toURL) ++ thisClassPath, + Seq("org.apache.spark.api.plugin.SparkPlugin"), + sparkPluginCodeBody) + + val jarUrl = TestUtils.createJar( + Seq(compiledSparkPlugin, compiledExecutorPlugin), + new File(tempDir, "testplugin.jar")) + + val unusedJar = TestUtils.createJarWithClasses(Seq.empty) + val unusedFile = Files.createTempFile(tempDir.toPath, "unused", null) + val args = Seq( + "--class", SimpleApplicationTest.getClass.getName.stripSuffix("$"), + "--name", "testApp", + "--master", "local-cluster[1,1,1024]", + "--conf", "spark.plugins=TestSparkPlugin", + "--conf", "spark.ui.enabled=false", + "--jars", jarUrl.toString + "," + unusedJar.toString, + "--files", tempFile.toString + "," + unusedFile.toString, + unusedJar.toString) + runSparkSubmit(args) } private def testRemoteResources( enableHttpFs: Boolean, - blacklistSchemes: Seq[String] = Nil): Unit = { + forceDownloadSchemes: Seq[String] = Nil): Unit = { val hadoopConf = new Configuration() updateConfWithFakeS3Fs(hadoopConf) if (enableHttpFs) { @@ -1237,8 +1350,8 @@ class SparkSubmitSuite val tmpHttpJar = TestUtils.createJarWithFiles(Map("test.resource" -> "USER"), tmpDir) val tmpHttpJarPath = s"http://${new File(tmpHttpJar.toURI).getAbsolutePath}" - val forceDownloadArgs = if (blacklistSchemes.nonEmpty) { - Seq("--conf", s"spark.yarn.dist.forceDownloadSchemes=${blacklistSchemes.mkString(",")}") + val forceDownloadArgs = if (forceDownloadSchemes.nonEmpty) { + Seq("--conf", s"spark.yarn.dist.forceDownloadSchemes=${forceDownloadSchemes.mkString(",")}") } else { Nil } @@ -1256,19 +1369,19 @@ class SparkSubmitSuite val jars = conf.get("spark.yarn.dist.jars").split(",").toSet - def isSchemeBlacklisted(scheme: String) = { - blacklistSchemes.contains("*") || blacklistSchemes.contains(scheme) + def isSchemeForcedDownload(scheme: String) = { + forceDownloadSchemes.contains("*") || forceDownloadSchemes.contains(scheme) } - if (!isSchemeBlacklisted("s3")) { + if (!isSchemeForcedDownload("s3")) { assert(jars.contains(tmpS3JarPath)) } - if (enableHttpFs && blacklistSchemes.isEmpty) { + if (enableHttpFs && forceDownloadSchemes.isEmpty) { // If Http FS is supported by yarn service, the URI of remote http resource should // still be remote. assert(jars.contains(tmpHttpJarPath)) - } else if (!enableHttpFs || isSchemeBlacklisted("http")) { + } else if (!enableHttpFs || isSchemeForcedDownload("http")) { // If Http FS is not supported by yarn service, or http scheme is configured to be force // downloading, the URI of remote http resource should be changed to a local one. val jarName = new File(tmpHttpJar.toURI).getName diff --git a/core/src/test/scala/org/apache/spark/deploy/SparkSubmitUtilsSuite.scala b/core/src/test/scala/org/apache/spark/deploy/SparkSubmitUtilsSuite.scala index 31e6c730eadc0..b8ad85b4b953b 100644 --- a/core/src/test/scala/org/apache/spark/deploy/SparkSubmitUtilsSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/SparkSubmitUtilsSuite.scala @@ -18,11 +18,13 @@ package org.apache.spark.deploy import java.io.{File, OutputStream, PrintStream} +import java.net.URI import java.nio.charset.StandardCharsets +import java.nio.file.{Files, Paths} +import scala.collection.JavaConverters._ import scala.collection.mutable.ArrayBuffer -import com.google.common.io.Files import org.apache.ivy.core.module.descriptor.MDArtifact import org.apache.ivy.core.settings.IvySettings import org.apache.ivy.plugins.resolver.{AbstractResolver, ChainResolver, FileSystemResolver, IBiblioResolver} @@ -79,7 +81,7 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with BeforeAndAfterAll { test("create additional resolvers") { val repos = "a/1,b/2,c/3" - val settings = SparkSubmitUtils.buildIvySettings(Option(repos), None) + val settings = SparkSubmitUtils.buildIvySettings(Option(repos), Some(tempIvyPath)) val resolver = settings.getDefaultResolver.asInstanceOf[ChainResolver] assert(resolver.getResolvers.size() === 4) val expected = repos.split(",").map(r => s"$r/") @@ -123,20 +125,17 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with BeforeAndAfterAll { test("ivy path works correctly") { val md = SparkSubmitUtils.getModuleDescriptor val artifacts = for (i <- 0 until 3) yield new MDArtifact(md, s"jar-$i", "jar", "jar") - var jPaths = SparkSubmitUtils.resolveDependencyPaths(artifacts.toArray, new File(tempIvyPath)) - for (i <- 0 until 3) { - val index = jPaths.indexOf(tempIvyPath) - assert(index >= 0) - jPaths = jPaths.substring(index + tempIvyPath.length) - } + val jPaths = SparkSubmitUtils.resolveDependencyPaths(artifacts.toArray, new File(tempIvyPath)) + assert(jPaths.count(_.startsWith(tempIvyPath)) >= 3) val main = MavenCoordinate("my.awesome.lib", "mylib", "0.1") IvyTestUtils.withRepository(main, None, None) { repo => // end to end val jarPath = SparkSubmitUtils.resolveMavenCoordinates( main.toString, - SparkSubmitUtils.buildIvySettings(Option(repo), Option(tempIvyPath)), + SparkSubmitUtils.buildIvySettings(Option(repo), Some(tempIvyPath)), + transitive = true, isTest = true) - assert(jarPath.indexOf(tempIvyPath) >= 0, "should use non-default ivy path") + assert(jarPath.forall(_.indexOf(tempIvyPath) >= 0), "should use non-default ivy path") } } @@ -147,10 +146,11 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with BeforeAndAfterAll { IvyTestUtils.withRepository(main, Some(dep), Some(SparkSubmitUtils.m2Path)) { repo => val jarPath = SparkSubmitUtils.resolveMavenCoordinates( main.toString, - SparkSubmitUtils.buildIvySettings(None, None), + SparkSubmitUtils.buildIvySettings(None, Some(tempIvyPath)), + transitive = true, isTest = true) - assert(jarPath.indexOf("mylib") >= 0, "should find artifact") - assert(jarPath.indexOf("mydep") >= 0, "should find dependency") + assert(jarPath.exists(_.indexOf("mylib") >= 0), "should find artifact") + assert(jarPath.exists(_.indexOf("mydep") >= 0), "should find dependency") } // Local Ivy Repository val settings = new IvySettings @@ -158,10 +158,11 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with BeforeAndAfterAll { IvyTestUtils.withRepository(main, Some(dep), Some(ivyLocal), useIvyLayout = true) { repo => val jarPath = SparkSubmitUtils.resolveMavenCoordinates( main.toString, - SparkSubmitUtils.buildIvySettings(None, None), + SparkSubmitUtils.buildIvySettings(None, Some(tempIvyPath)), + transitive = true, isTest = true) - assert(jarPath.indexOf("mylib") >= 0, "should find artifact") - assert(jarPath.indexOf("mydep") >= 0, "should find dependency") + assert(jarPath.exists(_.indexOf("mylib") >= 0), "should find artifact") + assert(jarPath.exists(_.indexOf("mydep") >= 0), "should find dependency") } // Local ivy repository with modified home val dummyIvyLocal = new File(tempIvyPath, "local" + File.separator) @@ -171,10 +172,11 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with BeforeAndAfterAll { val jarPath = SparkSubmitUtils.resolveMavenCoordinates( main.toString, SparkSubmitUtils.buildIvySettings(None, Some(tempIvyPath)), + transitive = true, isTest = true) - assert(jarPath.indexOf("mylib") >= 0, "should find artifact") - assert(jarPath.indexOf(tempIvyPath) >= 0, "should be in new ivy path") - assert(jarPath.indexOf("mydep") >= 0, "should find dependency") + assert(jarPath.exists(_.indexOf("mylib") >= 0), "should find artifact") + assert(jarPath.forall(_.indexOf(tempIvyPath) >= 0), "should be in new ivy path") + assert(jarPath.exists(_.indexOf("mydep") >= 0), "should find dependency") } } @@ -182,7 +184,8 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with BeforeAndAfterAll { intercept[RuntimeException] { SparkSubmitUtils.resolveMavenCoordinates( "a:b:c", - SparkSubmitUtils.buildIvySettings(None, None), + SparkSubmitUtils.buildIvySettings(None, Some(tempIvyPath)), + transitive = true, isTest = true) } } @@ -194,16 +197,18 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with BeforeAndAfterAll { val path = SparkSubmitUtils.resolveMavenCoordinates( coordinates, - SparkSubmitUtils.buildIvySettings(None, None), + SparkSubmitUtils.buildIvySettings(None, Some(tempIvyPath)), + transitive = true, isTest = true) - assert(path === "", "should return empty path") + assert(path.isEmpty, "should return empty path") val main = MavenCoordinate("org.apache.spark", "spark-streaming-kafka-assembly_2.12", "1.2.0") IvyTestUtils.withRepository(main, None, None) { repo => val files = SparkSubmitUtils.resolveMavenCoordinates( coordinates + "," + main.toString, - SparkSubmitUtils.buildIvySettings(Some(repo), None), + SparkSubmitUtils.buildIvySettings(Some(repo), Some(tempIvyPath)), + transitive = true, isTest = true) - assert(files.indexOf(main.artifactId) >= 0, "Did not return artifact") + assert(files.forall(_.indexOf(main.artifactId) >= 0), "Did not return artifact") } } @@ -213,11 +218,12 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with BeforeAndAfterAll { IvyTestUtils.withRepository(main, Some(dep), None) { repo => val files = SparkSubmitUtils.resolveMavenCoordinates( main.toString, - SparkSubmitUtils.buildIvySettings(Some(repo), None), - Seq("my.great.dep:mydep"), + SparkSubmitUtils.buildIvySettings(Some(repo), Some(tempIvyPath)), + exclusions = Seq("my.great.dep:mydep"), + transitive = true, isTest = true) - assert(files.indexOf(main.artifactId) >= 0, "Did not return artifact") - assert(files.indexOf("my.great.dep") < 0, "Returned excluded artifact") + assert(files.forall(_.indexOf(main.artifactId) >= 0), "Did not return artifact") + assert(files.forall(_.indexOf("my.great.dep") < 0), "Returned excluded artifact") } } @@ -241,8 +247,8 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with BeforeAndAfterAll { | |""".stripMargin - val settingsFile = new File(tempIvyPath, "ivysettings.xml") - Files.write(settingsText, settingsFile, StandardCharsets.UTF_8) + val settingsFile = Paths.get(tempIvyPath, "ivysettings.xml") + Files.write(settingsFile, settingsText.getBytes(StandardCharsets.UTF_8)) val settings = SparkSubmitUtils.loadIvySettings(settingsFile.toString, None, None) settings.setDefaultIvyUserDir(new File(tempIvyPath)) // NOTE - can't set this through file @@ -250,10 +256,11 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with BeforeAndAfterAll { testUtilSettings.setDefaultIvyUserDir(new File(tempIvyPath)) IvyTestUtils.withRepository(main, Some(dep), Some(dummyIvyLocal), useIvyLayout = true, ivySettings = testUtilSettings) { repo => - val jarPath = SparkSubmitUtils.resolveMavenCoordinates(main.toString, settings, isTest = true) - assert(jarPath.indexOf("mylib") >= 0, "should find artifact") - assert(jarPath.indexOf(tempIvyPath) >= 0, "should be in new ivy path") - assert(jarPath.indexOf("mydep") >= 0, "should find dependency") + val jarPath = SparkSubmitUtils.resolveMavenCoordinates(main.toString, settings, + transitive = true, isTest = true) + assert(jarPath.exists(_.indexOf("mylib") >= 0), "should find artifact") + assert(jarPath.forall(_.indexOf(tempIvyPath) >= 0), "should be in new ivy path") + assert(jarPath.exists(_.indexOf("mydep") >= 0), "should find dependency") } } @@ -265,10 +272,36 @@ class SparkSubmitUtilsSuite extends SparkFunSuite with BeforeAndAfterAll { val jarPath = SparkSubmitUtils.resolveMavenCoordinates( main.toString, ivySettings, + transitive = true, isTest = true) val r = """.*org.apache.spark-spark-submit-parent-.*""".r assert(!ivySettings.getDefaultCache.listFiles.map(_.getName) .exists(r.findFirstIn(_).isDefined), "resolution files should be cleaned") } } + + test("SPARK-34624: should ignore non-jar dependencies") { + val main = MavenCoordinate("my.great.lib", "mylib", "0.1") + val dep = "my.great.dep:mydep:0.1" + + IvyTestUtils.withRepository(main, Some(dep), None) { repo => + // IvyTestUtils.withRepository does not have an easy way for creating non-jar dependencies + // So we let it create the jar dependency in `mylib-0.1.pom`, and then modify the pom + // to change the type of the transitive to `pom` + val mainPom = Paths.get(URI.create(repo)).resolve("my/great/lib/mylib/0.1/mylib-0.1.pom") + val lines = Files.lines(mainPom).iterator.asScala + .map(l => if (l.trim == "mydep") s"$lpom" else l) + .toList + Files.write(mainPom, lines.asJava) + + val ivySettings = SparkSubmitUtils.buildIvySettings(Some(repo), Some(tempIvyPath)) + val jarPath = SparkSubmitUtils.resolveMavenCoordinates( + main.toString, + ivySettings, + transitive = true, + isTest = true) + assert(!jarPath.exists(_.indexOf("mydep") >= 0), "should not find pom dependency." + + s" Resolved jars are: $jarPath") + } + } } diff --git a/core/src/test/scala/org/apache/spark/deploy/StandaloneDynamicAllocationSuite.scala b/core/src/test/scala/org/apache/spark/deploy/StandaloneDynamicAllocationSuite.scala index 57cbda3c0620d..e47181719a9db 100644 --- a/core/src/test/scala/org/apache/spark/deploy/StandaloneDynamicAllocationSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/StandaloneDynamicAllocationSuite.scala @@ -21,7 +21,7 @@ import scala.collection.mutable import scala.concurrent.duration._ import org.mockito.ArgumentMatchers.any -import org.mockito.Mockito.{mock, verify, when} +import org.mockito.Mockito.{mock, when} import org.scalatest.{BeforeAndAfterAll, PrivateMethodTester} import org.scalatest.concurrent.Eventually._ @@ -497,19 +497,19 @@ class StandaloneDynamicAllocationSuite } } - test("executor registration on a blacklisted host must fail") { + test("executor registration on a excluded host must fail") { // The context isn't really used by the test, but it helps with creating a test scheduler, // since CoarseGrainedSchedulerBackend makes a lot of calls to the context instance. - sc = new SparkContext(appConf.set(config.BLACKLIST_ENABLED.key, "true")) + sc = new SparkContext(appConf.set(config.EXCLUDE_ON_FAILURE_ENABLED.key, "true")) val endpointRef = mock(classOf[RpcEndpointRef]) val mockAddress = mock(classOf[RpcAddress]) when(endpointRef.address).thenReturn(mockAddress) - val message = RegisterExecutor("one", endpointRef, "blacklisted-host", 10, Map.empty, + val message = RegisterExecutor("one", endpointRef, "excluded-host", 10, Map.empty, Map.empty, Map.empty, ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) val taskScheduler = mock(classOf[TaskSchedulerImpl]) - when(taskScheduler.nodeBlacklist()).thenReturn(Set("blacklisted-host")) + when(taskScheduler.excludedNodes()).thenReturn(Set("excluded-host")) when(taskScheduler.resourceOffers(any(), any[Boolean])).thenReturn(Nil) when(taskScheduler.sc).thenReturn(sc) @@ -545,7 +545,7 @@ class StandaloneDynamicAllocationSuite // will not timeout anything related to executors. .set(config.Network.NETWORK_TIMEOUT.key, "2h") .set(config.EXECUTOR_HEARTBEAT_INTERVAL.key, "1h") - .set(config.STORAGE_BLOCKMANAGER_SLAVE_TIMEOUT.key, "1h") + .set(config.STORAGE_BLOCKMANAGER_HEARTBEAT_TIMEOUT.key, "1h") } /** Make a master to which our application will send executor requests. */ diff --git a/core/src/test/scala/org/apache/spark/deploy/client/AppClientSuite.scala b/core/src/test/scala/org/apache/spark/deploy/client/AppClientSuite.scala index a3e39d7f53728..93c0aa000e207 100644 --- a/core/src/test/scala/org/apache/spark/deploy/client/AppClientSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/client/AppClientSuite.scala @@ -18,7 +18,7 @@ package org.apache.spark.deploy.client import java.io.Closeable -import java.util.concurrent.ConcurrentLinkedQueue +import java.util.concurrent.{ConcurrentHashMap, ConcurrentLinkedQueue} import scala.concurrent.duration._ @@ -27,11 +27,12 @@ import org.scalatest.concurrent.{Eventually, ScalaFutures} import org.apache.spark._ import org.apache.spark.deploy.{ApplicationDescription, Command} -import org.apache.spark.deploy.DeployMessages.{MasterStateResponse, RequestMasterState} +import org.apache.spark.deploy.DeployMessages.{MasterStateResponse, RequestMasterState, WorkerDecommissioning} import org.apache.spark.deploy.master.{ApplicationInfo, Master} import org.apache.spark.deploy.worker.Worker import org.apache.spark.internal.{config, Logging} import org.apache.spark.rpc.RpcEnv +import org.apache.spark.scheduler.ExecutorDecommissionInfo import org.apache.spark.util.Utils /** @@ -58,7 +59,7 @@ class AppClientSuite */ override def beforeAll(): Unit = { super.beforeAll() - conf = new SparkConf().set(config.Worker.WORKER_DECOMMISSION_ENABLED.key, "true") + conf = new SparkConf().set(config.DECOMMISSION_ENABLED.key, "true") securityManager = new SecurityManager(conf) masterRpcEnv = RpcEnv.create(Master.SYSTEM_NAME, "localhost", 0, conf, securityManager) workerRpcEnvs = (0 until numWorkers).map { i => @@ -121,12 +122,19 @@ class AppClientSuite // Send a decommission self to all the workers // Note: normally the worker would send this on their own. - workers.foreach(worker => worker.decommissionSelf()) + workers.foreach { worker => + worker.decommissionSelf() + // send the notice to Master to tell the decommission of Workers + master.self.send(WorkerDecommissioning(worker.workerId, worker.self)) + } // Decommissioning is async. eventually(timeout(1.seconds), interval(10.millis)) { // We only record decommissioning for the executor we've requested - assert(ci.listener.execDecommissionedList.size === 1) + assert(ci.listener.execDecommissionedMap.size === 1) + val decommissionInfo = ci.listener.execDecommissionedMap.get(executorId) + assert(decommissionInfo != null && decommissionInfo.workerHost.isDefined, + s"$executorId should have been decommissioned along with its worker") } // Send request to kill executor, verify request was made @@ -215,7 +223,7 @@ class AppClientSuite val deadReasonList = new ConcurrentLinkedQueue[String]() val execAddedList = new ConcurrentLinkedQueue[String]() val execRemovedList = new ConcurrentLinkedQueue[String]() - val execDecommissionedList = new ConcurrentLinkedQueue[String]() + val execDecommissionedMap = new ConcurrentHashMap[String, ExecutorDecommissionInfo]() def connected(id: String): Unit = { connectedIdList.add(id) @@ -241,12 +249,13 @@ class AppClientSuite } def executorRemoved( - id: String, message: String, exitStatus: Option[Int], workerLost: Boolean): Unit = { + id: String, message: String, exitStatus: Option[Int], workerHost: Option[String]): Unit = { execRemovedList.add(id) } - def executorDecommissioned(id: String, message: String): Unit = { - execDecommissionedList.add(id) + def executorDecommissioned(id: String, decommissionInfo: ExecutorDecommissionInfo): Unit = { + val previousDecommissionInfo = execDecommissionedMap.putIfAbsent(id, decommissionInfo) + assert(previousDecommissionInfo === null, s"Expected no previous decommission info for $id") } def workerRemoved(workerId: String, host: String, message: String): Unit = {} diff --git a/core/src/test/scala/org/apache/spark/deploy/history/ApplicationCacheSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/ApplicationCacheSuite.scala index 48bd088d07ff9..7cf533e58b658 100644 --- a/core/src/test/scala/org/apache/spark/deploy/history/ApplicationCacheSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/history/ApplicationCacheSuite.scala @@ -27,7 +27,8 @@ import org.eclipse.jetty.servlet.ServletContextHandler import org.mockito.ArgumentMatchers.any import org.mockito.Mockito._ import org.mockito.invocation.InvocationOnMock -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.scalatestplus.mockito.MockitoSugar import org.apache.spark.SparkFunSuite @@ -54,7 +55,7 @@ class ApplicationCacheSuite extends SparkFunSuite with Logging with MockitoSugar var getAppUICount = 0L var attachCount = 0L var detachCount = 0L - var updateProbeCount = 0L + val updateProbeCount = 0L override def getAppUI(appId: String, attemptId: Option[String]): Option[LoadedAppUI] = { logDebug(s"getAppUI($appId, $attemptId)") diff --git a/core/src/test/scala/org/apache/spark/deploy/history/BasicEventFilterSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/BasicEventFilterSuite.scala index 2da40dccba53e..5d40a0610eb6c 100644 --- a/core/src/test/scala/org/apache/spark/deploy/history/BasicEventFilterSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/history/BasicEventFilterSuite.scala @@ -135,6 +135,8 @@ class BasicEventFilterSuite extends SparkFunSuite { SparkListenerStageExecutorMetrics(1.toString, 0, 0, new ExecutorMetrics))) assert(Some(false) === acceptFn(SparkListenerExecutorBlacklisted(0, 1.toString, 1))) assert(Some(false) === acceptFn(SparkListenerExecutorUnblacklisted(0, 1.toString))) + assert(Some(false) === acceptFn(SparkListenerExecutorExcluded(0, 1.toString, 1))) + assert(Some(false) === acceptFn(SparkListenerExecutorUnexcluded(0, 1.toString))) assert(Some(false) === acceptFn(createExecutorRemovedEvent(1))) val bmId = BlockManagerId(1.toString, "host1", 1) assert(Some(false) === acceptFn(SparkListenerBlockManagerAdded(0, bmId, 1))) @@ -148,6 +150,10 @@ class BasicEventFilterSuite extends SparkFunSuite { SparkListenerStageExecutorMetrics(2.toString, 0, 0, new ExecutorMetrics))) assert(Some(true) === acceptFn(SparkListenerExecutorBlacklisted(0, 2.toString, 1))) assert(Some(true) === acceptFn(SparkListenerExecutorUnblacklisted(0, 2.toString))) + assert(None === acceptFn(SparkListenerNodeBlacklisted(0, "host1", 1))) + assert(None === acceptFn(SparkListenerNodeUnblacklisted(0, "host1"))) + assert(Some(true) === acceptFn(SparkListenerExecutorExcluded(0, 2.toString, 1))) + assert(Some(true) === acceptFn(SparkListenerExecutorUnexcluded(0, 2.toString))) assert(Some(true) === acceptFn(createExecutorRemovedEvent(2))) val bmId2 = BlockManagerId(2.toString, "host1", 1) assert(Some(true) === acceptFn(SparkListenerBlockManagerAdded(0, bmId2, 1))) @@ -164,8 +170,8 @@ class BasicEventFilterSuite extends SparkFunSuite { assert(None === acceptFn(SparkListenerEnvironmentUpdate(Map.empty))) assert(None === acceptFn(SparkListenerApplicationStart("1", Some("1"), 0, "user", None))) assert(None === acceptFn(SparkListenerApplicationEnd(1))) - assert(None === acceptFn(SparkListenerNodeBlacklisted(0, "host1", 1))) - assert(None === acceptFn(SparkListenerNodeUnblacklisted(0, "host1"))) + assert(None === acceptFn(SparkListenerNodeExcluded(0, "host1", 1))) + assert(None === acceptFn(SparkListenerNodeUnexcluded(0, "host1"))) assert(None === acceptFn(SparkListenerLogStart("testVersion"))) } diff --git a/core/src/test/scala/org/apache/spark/deploy/history/ChromeUIHistoryServerSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/ChromeUIHistoryServerSuite.scala new file mode 100644 index 0000000000000..1fa2d0ab882c9 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/deploy/history/ChromeUIHistoryServerSuite.scala @@ -0,0 +1,50 @@ +/* + * 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. + */ + +package org.apache.spark.deploy.history + +import org.openqa.selenium.WebDriver +import org.openqa.selenium.chrome.{ChromeDriver, ChromeOptions} + +import org.apache.spark.tags.ChromeUITest + +/** + * Tests for HistoryServer with Chrome. + */ +@ChromeUITest +class ChromeUIHistoryServerSuite + extends RealBrowserUIHistoryServerSuite("webdriver.chrome.driver") { + + override var webDriver: WebDriver = _ + + override def beforeAll(): Unit = { + super.beforeAll() + val chromeOptions = new ChromeOptions + chromeOptions.addArguments("--headless", "--disable-gpu") + webDriver = new ChromeDriver(chromeOptions) + } + + override def afterAll(): Unit = { + try { + if (webDriver != null) { + webDriver.quit() + } + } finally { + super.afterAll() + } + } +} diff --git a/core/src/test/scala/org/apache/spark/deploy/history/EventLogFileCompactorSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/EventLogFileCompactorSuite.scala index 2a914023ec821..7d07af4d7246b 100644 --- a/core/src/test/scala/org/apache/spark/deploy/history/EventLogFileCompactorSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/history/EventLogFileCompactorSuite.scala @@ -23,10 +23,9 @@ import scala.io.{Codec, Source} import org.apache.hadoop.fs.{FileStatus, FileSystem, Path} import org.json4s.jackson.JsonMethods.parse -import org.apache.spark.{SparkConf, SparkFunSuite, Success} +import org.apache.spark.{SparkConf, SparkFunSuite} import org.apache.spark.deploy.SparkHadoopUtil import org.apache.spark.deploy.history.EventLogTestHelper.writeEventsToRollingWriter -import org.apache.spark.executor.ExecutorMetrics import org.apache.spark.scheduler._ import org.apache.spark.scheduler.cluster.ExecutorInfo import org.apache.spark.status.ListenerEventsTestHelper._ @@ -219,10 +218,10 @@ class EventLogFileCompactorSuite extends SparkFunSuite { override def acceptFn(): PartialFunction[SparkListenerEvent, Boolean] = { case _: SparkListenerApplicationEnd => true case _: SparkListenerEnvironmentUpdate => true - case _: SparkListenerNodeBlacklisted => true + case _: SparkListenerNodeExcluded => true case _: SparkListenerBlockManagerAdded => false case _: SparkListenerApplicationStart => false - case _: SparkListenerNodeUnblacklisted => false + case _: SparkListenerNodeUnexcluded => false } override def statistics(): Option[EventFilter.FilterStatistics] = None @@ -254,11 +253,11 @@ class EventLogFileCompactorSuite extends SparkFunSuite { // filterApplicationStart: Some(false) & Some(false) => filter out writeEventToWriter(writer, SparkListenerApplicationStart("app", None, 0, "user", None)) - // filterNodeBlacklisted: None & Some(true) => filter in - expectedLines += writeEventToWriter(writer, SparkListenerNodeBlacklisted(0, "host1", 1)) + // filterNodeExcluded: None & Some(true) => filter in + expectedLines += writeEventToWriter(writer, SparkListenerNodeExcluded(0, "host1", 1)) - // filterNodeUnblacklisted: None & Some(false) => filter out - writeEventToWriter(writer, SparkListenerNodeUnblacklisted(0, "host1")) + // filterNodeUnexcluded: None & Some(false) => filter out + writeEventToWriter(writer, SparkListenerNodeUnexcluded(0, "host1")) // other events: None & None => filter in expectedLines += writeEventToWriter(writer, SparkListenerUnpersistRDD(0)) diff --git a/core/src/test/scala/org/apache/spark/deploy/history/EventLogFileReadersSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/EventLogFileReadersSuite.scala index 8eab2da1a37b7..7db30548fd668 100644 --- a/core/src/test/scala/org/apache/spark/deploy/history/EventLogFileReadersSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/history/EventLogFileReadersSuite.scala @@ -216,7 +216,7 @@ class SingleFileEventLogFileReaderSuite extends EventLogFileReadersSuite { Utils.tryWithResource(new ZipInputStream( new ByteArrayInputStream(underlyingStream.toByteArray))) { is => - var entry = is.getNextEntry + val entry = is.getNextEntry assert(entry != null) val actual = new String(ByteStreams.toByteArray(is), StandardCharsets.UTF_8) val expected = Files.toString(new File(logPath.toString), StandardCharsets.UTF_8) diff --git a/core/src/test/scala/org/apache/spark/deploy/history/EventLogFileWritersSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/EventLogFileWritersSuite.scala index 060b878fb8ef2..e6dd9ae4224d9 100644 --- a/core/src/test/scala/org/apache/spark/deploy/history/EventLogFileWritersSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/history/EventLogFileWritersSuite.scala @@ -99,7 +99,7 @@ abstract class EventLogFileWritersSuite extends SparkFunSuite with LocalSparkCon } } - test("spark.eventLog.compression.codec overrides spark.io.compression.codec") { + test("Use the defalut value of spark.eventLog.compression.codec") { val conf = new SparkConf conf.set(EVENT_LOG_COMPRESS, true) val hadoopConf = SparkHadoopUtil.get.newConfiguration(conf) @@ -107,14 +107,8 @@ abstract class EventLogFileWritersSuite extends SparkFunSuite with LocalSparkCon val appId = "test" val appAttemptId = None - // The default value is `spark.io.compression.codec`. val writer = createWriter(appId, appAttemptId, testDirPath.toUri, conf, hadoopConf) - assert(writer.compressionCodecName.contains("lz4")) - - // `spark.eventLog.compression.codec` overrides `spark.io.compression.codec`. - conf.set(EVENT_LOG_COMPRESSION_CODEC, "zstd") - val writer2 = createWriter(appId, appAttemptId, testDirPath.toUri, conf, hadoopConf) - assert(writer2.compressionCodecName.contains("zstd")) + assert(writer.compressionCodecName === EVENT_LOG_COMPRESSION_CODEC.defaultValue) } protected def readLinesFromEventLogFile(log: Path, fs: FileSystem): List[String] = { @@ -213,7 +207,7 @@ class SingleEventLogFileWriterSuite extends EventLogFileWritersSuite { compressionCodecShortName) val finalLogPath = new Path(logPath) - assert(fileSystem.exists(finalLogPath) && fileSystem.isFile(finalLogPath)) + assert(fileSystem.exists(finalLogPath) && fileSystem.getFileStatus(finalLogPath).isFile) assert(expectedLines === readLinesFromEventLogFile(finalLogPath, fileSystem)) } } @@ -357,10 +351,10 @@ class RollingEventLogFilesWriterSuite extends EventLogFileWritersSuite { expectedLines: Seq[String]): Unit = { val logDirPath = getAppEventLogDirPath(logBaseDir, appId, appAttemptId) - assert(fileSystem.exists(logDirPath) && fileSystem.isDirectory(logDirPath)) + assert(fileSystem.exists(logDirPath) && fileSystem.getFileStatus(logDirPath).isDirectory) val appStatusFile = getAppStatusFilePath(logDirPath, appId, appAttemptId, inProgress = false) - assert(fileSystem.exists(appStatusFile) && fileSystem.isFile(appStatusFile)) + assert(fileSystem.exists(appStatusFile) && fileSystem.getFileStatus(appStatusFile).isFile) val eventLogFiles = listEventLogFiles(logDirPath) val allLines = mutable.ArrayBuffer[String]() diff --git a/core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala index c2f34fc3a95ed..3b8677742ca16 100644 --- a/core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/history/FsHistoryProviderSuite.scala @@ -34,8 +34,9 @@ import org.apache.hadoop.security.AccessControlException import org.json4s.jackson.JsonMethods._ import org.mockito.ArgumentMatchers.{any, argThat} import org.mockito.Mockito.{doThrow, mock, spy, verify, when} -import org.scalatest.Matchers import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.{JobExecutionStatus, SecurityManager, SPARK_VERSION, SparkConf, SparkFunSuite} import org.apache.spark.deploy.SparkHadoopUtil @@ -43,7 +44,7 @@ import org.apache.spark.deploy.history.EventLogTestHelper._ import org.apache.spark.internal.Logging import org.apache.spark.internal.config.DRIVER_LOG_DFS_DIR import org.apache.spark.internal.config.History._ -import org.apache.spark.internal.config.UI.{ADMIN_ACLS, ADMIN_ACLS_GROUPS, USER_GROUPS_MAPPING} +import org.apache.spark.internal.config.UI.{ADMIN_ACLS, ADMIN_ACLS_GROUPS, UI_VIEW_ACLS, UI_VIEW_ACLS_GROUPS, USER_GROUPS_MAPPING} import org.apache.spark.io._ import org.apache.spark.scheduler._ import org.apache.spark.scheduler.cluster.ExecutorInfo @@ -89,9 +90,13 @@ class FsHistoryProviderSuite extends SparkFunSuite with Matchers with Logging { } } - private def testAppLogParsing(inMemory: Boolean): Unit = { + test("SPARK-31608: parse application logs with HybridStore") { + testAppLogParsing(false, true) + } + + private def testAppLogParsing(inMemory: Boolean, useHybridStore: Boolean = false): Unit = { val clock = new ManualClock(12345678) - val conf = createTestConf(inMemory = inMemory) + val conf = createTestConf(inMemory = inMemory, useHybridStore = useHybridStore) val provider = new FsHistoryProvider(conf, clock) // Write a new-style application log. @@ -921,8 +926,8 @@ class FsHistoryProviderSuite extends SparkFunSuite with Matchers with Logging { oldProvider.listing.setMetadata(meta) oldProvider.stop() - val mistatchedVersionProvider = new FsHistoryProvider(conf) - assert(mistatchedVersionProvider.listing.count(classOf[ApplicationInfoWrapper]) === 0) + val mismatchedVersionProvider = new FsHistoryProvider(conf) + assert(mismatchedVersionProvider.listing.count(classOf[ApplicationInfoWrapper]) === 0) } test("invalidate cached UI") { @@ -1117,7 +1122,7 @@ class FsHistoryProviderSuite extends SparkFunSuite with Matchers with Logging { } } - test("SPARK-24948: blacklist files we don't have read permission on") { + test("SPARK-24948: ignore files we don't have read permission on") { val clock = new ManualClock(1533132471) val provider = new FsHistoryProvider(createTestConf(), clock) val accessDenied = newLogFile("accessDenied", None, inProgress = false) @@ -1137,17 +1142,17 @@ class FsHistoryProviderSuite extends SparkFunSuite with Matchers with Logging { updateAndCheck(mockedProvider) { list => list.size should be(1) } - // Doing 2 times in order to check the blacklist filter too + // Doing 2 times in order to check the inaccessibleList filter too updateAndCheck(mockedProvider) { list => list.size should be(1) } val accessDeniedPath = new Path(accessDenied.getPath) - assert(mockedProvider.isBlacklisted(accessDeniedPath)) + assert(!mockedProvider.isAccessible(accessDeniedPath)) clock.advance(24 * 60 * 60 * 1000 + 1) // add a bit more than 1d isReadable = true mockedProvider.cleanLogs() updateAndCheck(mockedProvider) { list => - assert(!mockedProvider.isBlacklisted(accessDeniedPath)) + assert(mockedProvider.isAccessible(accessDeniedPath)) assert(list.exists(_.name == "accessDenied")) assert(list.exists(_.name == "accessGranted")) list.size should be(2) @@ -1470,6 +1475,107 @@ class FsHistoryProviderSuite extends SparkFunSuite with Matchers with Logging { } } + test("SPARK-33146: don't let one bad rolling log folder prevent loading other applications") { + withTempDir { dir => + val conf = createTestConf(true) + conf.set(HISTORY_LOG_DIR, dir.getAbsolutePath) + val hadoopConf = SparkHadoopUtil.newConfiguration(conf) + val fs = new Path(dir.getAbsolutePath).getFileSystem(hadoopConf) + + val provider = new FsHistoryProvider(conf) + + val writer = new RollingEventLogFilesWriter("app", None, dir.toURI, conf, hadoopConf) + writer.start() + + writeEventsToRollingWriter(writer, Seq( + SparkListenerApplicationStart("app", Some("app"), 0, "user", None), + SparkListenerJobStart(1, 0, Seq.empty)), rollFile = false) + provider.checkForLogs() + provider.cleanLogs() + assert(dir.listFiles().size === 1) + assert(provider.getListing.length === 1) + + // Manually delete the appstatus file to make an invalid rolling event log + val appStatusPath = RollingEventLogFilesWriter.getAppStatusFilePath(new Path(writer.logPath), + "app", None, true) + fs.delete(appStatusPath, false) + provider.checkForLogs() + provider.cleanLogs() + assert(provider.getListing.length === 0) + + // Create a new application + val writer2 = new RollingEventLogFilesWriter("app2", None, dir.toURI, conf, hadoopConf) + writer2.start() + writeEventsToRollingWriter(writer2, Seq( + SparkListenerApplicationStart("app2", Some("app2"), 0, "user", None), + SparkListenerJobStart(1, 0, Seq.empty)), rollFile = false) + + // Both folders exist but only one application found + provider.checkForLogs() + provider.cleanLogs() + assert(provider.getListing.length === 1) + assert(dir.listFiles().size === 2) + + // Make sure a new provider sees the valid application + provider.stop() + val newProvider = new FsHistoryProvider(conf) + newProvider.checkForLogs() + assert(newProvider.getListing.length === 1) + } + } + + test("SPARK-33215: check ui view permissions without retrieving ui") { + val conf = createTestConf() + .set(HISTORY_SERVER_UI_ACLS_ENABLE, true) + .set(HISTORY_SERVER_UI_ADMIN_ACLS, Seq("user1", "user2")) + .set(HISTORY_SERVER_UI_ADMIN_ACLS_GROUPS, Seq("group1")) + .set(USER_GROUPS_MAPPING, classOf[TestGroupsMappingProvider].getName) + + val provider = new FsHistoryProvider(conf) + val log = newLogFile("app1", Some("attempt1"), inProgress = false) + writeFile(log, None, + SparkListenerApplicationStart("app1", Some("app1"), System.currentTimeMillis(), + "test", Some("attempt1")), + SparkListenerEnvironmentUpdate(Map( + "Spark Properties" -> List((UI_VIEW_ACLS.key, "user"), (UI_VIEW_ACLS_GROUPS.key, "group")), + "Hadoop Properties" -> Seq.empty, + "JVM Information" -> Seq.empty, + "System Properties" -> Seq.empty, + "Classpath Entries" -> Seq.empty + )), + SparkListenerApplicationEnd(System.currentTimeMillis())) + + provider.checkForLogs() + + // attempt2 doesn't exist + intercept[NoSuchElementException] { + provider.checkUIViewPermissions("app1", Some("attempt2"), "user1") + } + // app2 doesn't exist + intercept[NoSuchElementException] { + provider.checkUIViewPermissions("app2", Some("attempt1"), "user1") + } + + // user1 and user2 are admins + assert(provider.checkUIViewPermissions("app1", Some("attempt1"), "user1")) + assert(provider.checkUIViewPermissions("app1", Some("attempt1"), "user2")) + // user3 is a member of admin group "group1" + assert(provider.checkUIViewPermissions("app1", Some("attempt1"), "user3")) + // test is the app owner + assert(provider.checkUIViewPermissions("app1", Some("attempt1"), "test")) + // user is in the app's view acls + assert(provider.checkUIViewPermissions("app1", Some("attempt1"), "user")) + // user5 is a member of the app's view acls group "group" + assert(provider.checkUIViewPermissions("app1", Some("attempt1"), "user5")) + + // abc, user6, user7 don't have permissions + assert(!provider.checkUIViewPermissions("app1", Some("attempt1"), "abc")) + assert(!provider.checkUIViewPermissions("app1", Some("attempt1"), "user6")) + assert(!provider.checkUIViewPermissions("app1", Some("attempt1"), "user7")) + + provider.stop() + } + /** * Asks the provider to check for logs and calls a function to perform checks on the updated * app list. Example: @@ -1508,7 +1614,9 @@ class FsHistoryProviderSuite extends SparkFunSuite with Matchers with Logging { new FileOutputStream(file).close() } - private def createTestConf(inMemory: Boolean = false): SparkConf = { + private def createTestConf( + inMemory: Boolean = false, + useHybridStore: Boolean = false): SparkConf = { val conf = new SparkConf() .set(HISTORY_LOG_DIR, testDir.getAbsolutePath()) .set(FAST_IN_PROGRESS_PARSING, true) @@ -1516,6 +1624,7 @@ class FsHistoryProviderSuite extends SparkFunSuite with Matchers with Logging { if (!inMemory) { conf.set(LOCAL_STORE_DIR, Utils.createTempDir().getAbsolutePath()) } + conf.set(HYBRID_STORE_ENABLED, useHybridStore) conf } diff --git a/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerDiskManagerSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerDiskManagerSuite.scala index f78469e132490..9004e86323691 100644 --- a/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerDiskManagerSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerDiskManagerSuite.scala @@ -158,4 +158,56 @@ class HistoryServerDiskManagerSuite extends SparkFunSuite with BeforeAndAfter { assert(manager.approximateSize(50L, true) > 50L) } + test("SPARK-32024: update ApplicationStoreInfo.size during initializing") { + val manager = mockManager() + val leaseA = manager.lease(2) + doReturn(3L).when(manager).sizeOf(meq(leaseA.tmpPath)) + val dstPathA = manager.appStorePath("app1", None) + doReturn(3L).when(manager).sizeOf(meq(dstPathA)) + val dstA = leaseA.commit("app1", None) + assert(manager.free() === 0) + assert(manager.committed() === 3) + // Listing store tracks dstA now. + assert(store.read(classOf[ApplicationStoreInfo], dstA.getAbsolutePath).size === 3) + + // Simulate: service restarts, new disk manager (manager1) is initialized. + val manager1 = mockManager() + // Simulate: event KVstore compaction before restart, directory size reduces. + doReturn(2L).when(manager1).sizeOf(meq(dstA)) + doReturn(2L).when(manager1).sizeOf(meq(new File(testDir, "apps"))) + manager1.initialize() + // "ApplicationStoreInfo.size" is updated for dstA. + assert(store.read(classOf[ApplicationStoreInfo], dstA.getAbsolutePath).size === 2) + assert(manager1.free() === 1) + // If "ApplicationStoreInfo.size" is not correctly updated, "IllegalStateException" + // would be thrown. + val leaseB = manager1.lease(2) + assert(manager1.free() === 1) + doReturn(2L).when(manager1).sizeOf(meq(leaseB.tmpPath)) + val dstPathB = manager.appStorePath("app2", None) + doReturn(2L).when(manager1).sizeOf(meq(dstPathB)) + val dstB = leaseB.commit("app2", None) + assert(manager1.committed() === 2) + // Listing store tracks dstB only, dstA is evicted by "makeRoom()". + assert(store.read(classOf[ApplicationStoreInfo], dstB.getAbsolutePath).size === 2) + + val manager2 = mockManager() + // Simulate: cache entities are written after replaying, directory size increases. + doReturn(3L).when(manager2).sizeOf(meq(dstB)) + doReturn(3L).when(manager2).sizeOf(meq(new File(testDir, "apps"))) + manager2.initialize() + // "ApplicationStoreInfo.size" is updated for dstB. + assert(store.read(classOf[ApplicationStoreInfo], dstB.getAbsolutePath).size === 3) + assert(manager2.free() === 0) + val leaseC = manager2.lease(2) + doReturn(2L).when(manager2).sizeOf(meq(leaseC.tmpPath)) + val dstPathC = manager.appStorePath("app3", None) + doReturn(2L).when(manager2).sizeOf(meq(dstPathC)) + val dstC = leaseC.commit("app3", None) + assert(manager2.free() === 1) + assert(manager2.committed() === 2) + // Listing store tracks dstC only, dstB is evicted by "makeRoom()". + assert(store.read(classOf[ApplicationStoreInfo], dstC.getAbsolutePath).size === 2) + } + } diff --git a/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerMemoryManagerSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerMemoryManagerSuite.scala new file mode 100644 index 0000000000000..697f8f72624e5 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerMemoryManagerSuite.scala @@ -0,0 +1,55 @@ +/* + * 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. + */ + +package org.apache.spark.deploy.history + +import org.apache.spark.{SparkConf, SparkFunSuite} +import org.apache.spark.internal.config.History._ + +class HistoryServerMemoryManagerSuite extends SparkFunSuite { + + private val MAX_USAGE = 3L + + test("lease and release memory") { + val conf = new SparkConf().set(MAX_IN_MEMORY_STORE_USAGE, MAX_USAGE) + val manager = new HistoryServerMemoryManager(conf) + + // Memory usage estimation for non-compressed log file is filesize / 2 + manager.lease("app1", None, 2L, None) + manager.lease("app2", None, 2L, None) + manager.lease("app3", None, 2L, None) + assert(manager.currentUsage.get === 3L) + assert(manager.active.size === 3) + assert(manager.active.get(("app1", None)) === Some(1L)) + + intercept[RuntimeException] { + manager.lease("app4", None, 2L, None) + } + + // Releasing a non-existent app is a no-op + manager.release("app4", None) + assert(manager.currentUsage.get === 3L) + + manager.release("app1", None) + assert(manager.currentUsage.get === 2L) + assert(manager.active.size === 2) + + manager.lease("app4", None, 2L, None) + assert(manager.currentUsage.get === 3L) + assert(manager.active.size === 3) + } +} diff --git a/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala index c55b29b15051d..5da5835054e9f 100644 --- a/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/history/HistoryServerSuite.scala @@ -29,16 +29,16 @@ import scala.concurrent.duration._ import com.google.common.io.{ByteStreams, Files} import org.apache.commons.io.{FileUtils, IOUtils} import org.apache.hadoop.fs.{FileStatus, FileSystem, Path} -import org.eclipse.jetty.proxy.ProxyServlet -import org.eclipse.jetty.servlet.{ServletContextHandler, ServletHolder} import org.json4s.JsonAST._ import org.json4s.jackson.JsonMethods import org.json4s.jackson.JsonMethods._ import org.mockito.Mockito._ import org.openqa.selenium.WebDriver import org.openqa.selenium.htmlunit.HtmlUnitDriver -import org.scalatest.{BeforeAndAfter, Matchers} +import org.scalatest.BeforeAndAfter import org.scalatest.concurrent.Eventually +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.scalatestplus.mockito.MockitoSugar import org.scalatestplus.selenium.WebBrowser @@ -138,7 +138,11 @@ class HistoryServerSuite extends SparkFunSuite with BeforeAndAfter with Matchers "complete stage list json" -> "applications/local-1422981780767/stages?status=complete", "failed stage list json" -> "applications/local-1422981780767/stages?status=failed", "one stage json" -> "applications/local-1422981780767/stages/1", + "one stage json with details" -> + "applications/local-1422981780767/stages/1?details=true&taskStatus=success", "one stage attempt json" -> "applications/local-1422981780767/stages/1/0", + "one stage attempt json details with failed task" -> + "applications/local-1422981780767/stages/1/0?details=true&taskStatus=failed", "stage task summary w shuffle write" -> "applications/local-1430917381534/stages/0/0/taskSummary", @@ -156,6 +160,12 @@ class HistoryServerSuite extends SparkFunSuite with BeforeAndAfter with Matchers "applications/local-1430917381534/stages/0/0/taskList?sortBy=-runtime", "stage task list w/ sortBy short names: runtime" -> "applications/local-1430917381534/stages/0/0/taskList?sortBy=runtime", + "stage task list w/ status" -> + "applications/app-20161115172038-0000/stages/0/0/taskList?status=failed", + "stage task list w/ status & offset & length" -> + "applications/local-1430917381534/stages/0/0/taskList?status=success&offset=1&length=2", + "stage task list w/ status & sortBy short names: runtime" -> + "applications/local-1430917381534/stages/0/0/taskList?status=success&sortBy=runtime", "stage list with accumulable json" -> "applications/local-1426533911241/1/stages", "stage with accumulable json" -> "applications/local-1426533911241/1/stages/0/0", @@ -163,20 +173,26 @@ class HistoryServerSuite extends SparkFunSuite with BeforeAndAfter with Matchers "applications/local-1426533911241/1/stages/0/0/taskList", "stage task list from multi-attempt app json(2)" -> "applications/local-1426533911241/2/stages/0/0/taskList", - "blacklisting for stage" -> "applications/app-20180109111548-0000/stages/0/0", - "blacklisting node for stage" -> "applications/application_1516285256255_0012/stages/0/0", + "excludeOnFailure for stage" -> "applications/app-20180109111548-0000/stages/0/0", + "excludeOnFailure node for stage" -> "applications/application_1516285256255_0012/stages/0/0", "rdd list storage json" -> "applications/local-1422981780767/storage/rdd", - "executor node blacklisting" -> "applications/app-20161116163331-0000/executors", - "executor node blacklisting unblacklisting" -> "applications/app-20161115172038-0000/executors", + "executor node excludeOnFailure" -> "applications/app-20161116163331-0000/executors", + "executor node excludeOnFailure unexcluding" -> + "applications/app-20161115172038-0000/executors", "executor memory usage" -> "applications/app-20161116163331-0000/executors", "executor resource information" -> "applications/application_1555004656427_0144/executors", + "multiple resource profiles" -> "applications/application_1578436911597_0052/environment", + "stage list with peak metrics" -> "applications/app-20200706201101-0003/stages", + "stage with peak metrics" -> "applications/app-20200706201101-0003/stages/2/0", + "stage with summaries" -> "applications/app-20200706201101-0003/stages/2/0?withSummaries=true", "app environment" -> "applications/app-20161116163331-0000/environment", // Enable "spark.eventLog.logBlockUpdates.enabled", to get the storage information // in the history server. - "one rdd storage json" -> "applications/local-1422981780767/storage/rdd/0" + "one rdd storage json" -> "applications/local-1422981780767/storage/rdd/0", + "miscellaneous process" -> "applications/application_1555004656427_0144/allmiscellaneousprocess" ) // run a bunch of characterization tests -- just verify the behavior is the same as what is saved @@ -189,7 +205,8 @@ class HistoryServerSuite extends SparkFunSuite with BeforeAndAfter with Matchers errOpt should be (None) val exp = IOUtils.toString(new FileInputStream( - new File(expRoot, HistoryServerSuite.sanitizePath(name) + "_expectation.json"))) + new File(expRoot, HistoryServerSuite.sanitizePath(name) + "_expectation.json")), + StandardCharsets.UTF_8) // compare the ASTs so formatting differences don't cause failures import org.json4s._ import org.json4s.jackson.JsonMethods._ @@ -304,18 +321,21 @@ class HistoryServerSuite extends SparkFunSuite with BeforeAndAfter with Matchers val urlsThroughKnox = responseThroughKnox \\ "@href" map (_.toString) val siteRelativeLinksThroughKnox = urlsThroughKnox filter (_.startsWith("/")) - all (siteRelativeLinksThroughKnox) should startWith (knoxBaseUrl) + for (link <- siteRelativeLinksThroughKnox) { + link should startWith (knoxBaseUrl) + } val directRequest = mock[HttpServletRequest] val directResponse = page.render(directRequest) val directUrls = directResponse \\ "@href" map (_.toString) val directSiteRelativeLinks = directUrls filter (_.startsWith("/")) - all (directSiteRelativeLinks) should not startWith (knoxBaseUrl) + for (link <- directSiteRelativeLinks) { + link should not startWith (knoxBaseUrl) + } } - // TODO (SPARK-31723): re-enable it - ignore("static relative links are prefixed with uiRoot (spark.ui.proxyBase)") { + test("static relative links are prefixed with uiRoot (spark.ui.proxyBase)") { val uiRoot = Option(System.getenv("APPLICATION_WEB_PROXY_BASE")).getOrElse("/testwebproxybase") val page = new HistoryPage(server) val request = mock[HttpServletRequest] @@ -327,7 +347,9 @@ class HistoryServerSuite extends SparkFunSuite with BeforeAndAfter with Matchers // then val urls = response \\ "@href" map (_.toString) val siteRelativeLinks = urls filter (_.startsWith("/")) - all (siteRelativeLinks) should startWith (uiRoot) + for (link <- siteRelativeLinks) { + link should startWith (uiRoot) + } } test("/version api endpoint") { @@ -335,66 +357,6 @@ class HistoryServerSuite extends SparkFunSuite with BeforeAndAfter with Matchers assert(response.contains(SPARK_VERSION)) } - test("ajax rendered relative links are prefixed with uiRoot (spark.ui.proxyBase)") { - val uiRoot = "/testwebproxybase" - System.setProperty("spark.ui.proxyBase", uiRoot) - - stop() - init() - - val port = server.boundPort - - val servlet = new ProxyServlet { - override def rewriteTarget(request: HttpServletRequest): String = { - // servlet acts like a proxy that redirects calls made on - // spark.ui.proxyBase context path to the normal servlet handlers operating off "/" - val sb = request.getRequestURL() - - if (request.getQueryString() != null) { - sb.append(s"?${request.getQueryString()}") - } - - val proxyidx = sb.indexOf(uiRoot) - sb.delete(proxyidx, proxyidx + uiRoot.length).toString - } - } - - val contextHandler = new ServletContextHandler - val holder = new ServletHolder(servlet) - contextHandler.setContextPath(uiRoot) - contextHandler.addServlet(holder, "/") - server.attachHandler(contextHandler) - - implicit val webDriver: WebDriver = new HtmlUnitDriver(true) - - try { - val url = s"http://localhost:$port" - - go to s"$url$uiRoot" - - // expect the ajax call to finish in 5 seconds - implicitlyWait(org.scalatest.time.Span(5, org.scalatest.time.Seconds)) - - // once this findAll call returns, we know the ajax load of the table completed - findAll(ClassNameQuery("odd")) - - val links = findAll(TagNameQuery("a")) - .map(_.attribute("href")) - .filter(_.isDefined) - .map(_.get) - .filter(_.startsWith(url)).toList - - // there are at least some URL links that were generated via javascript, - // and they all contain the spark.ui.proxyBase (uiRoot) - links.length should be > 4 - all(links) should startWith(url + uiRoot) - } finally { - contextHandler.stop() - quit() - } - - } - /** * Verify that the security manager needed for the history server can be instantiated * when `spark.authenticate` is `true`, rather than raise an `IllegalArgumentException`. @@ -630,6 +592,24 @@ class HistoryServerSuite extends SparkFunSuite with BeforeAndAfter with Matchers } } + test("SPARK-33215: speed up event log download by skipping UI rebuild") { + val appId = "local-1430917381535" + + stop() + init() + + val port = server.boundPort + val testUrls = Seq( + s"http://localhost:$port/api/v1/applications/$appId/logs", + s"http://localhost:$port/api/v1/applications/$appId/1/logs", + s"http://localhost:$port/api/v1/applications/$appId/2/logs") + + testUrls.foreach { url => + TestUtils.httpResponseCode(new URL(url)) + } + assert(server.cacheMetrics.loadCount.getCount === 0, "downloading event log shouldn't load ui") + } + test("access history application defaults to the last attempt id") { def getRedirectUrl(url: URL): (Int, String) = { @@ -705,6 +685,19 @@ class HistoryServerSuite extends SparkFunSuite with BeforeAndAfter with Matchers val actualContentType = conn.getContentType assert(actualContentType === expectedContentType) } + + test("Redirect to the root page when accessed to /history/") { + val port = server.boundPort + val url = new URL(s"http://localhost:$port/history/") + val conn = url.openConnection().asInstanceOf[HttpURLConnection] + conn.setRequestMethod("GET") + conn.setUseCaches(false) + conn.setDefaultUseCaches(false) + conn.setInstanceFollowRedirects(false) + conn.connect() + assert(conn.getResponseCode === 302) + assert(conn.getHeaderField("Location") === s"http://localhost:$port/") + } } object HistoryServerSuite { @@ -727,7 +720,7 @@ object HistoryServerSuite { def getContentAndCode(url: URL): (Int, Option[String], Option[String]) = { val (code, in, errString) = connectAndGetInputStream(url) - val inString = in.map(IOUtils.toString) + val inString = in.map(IOUtils.toString(_, StandardCharsets.UTF_8)) (code, inString, errString) } @@ -743,7 +736,7 @@ object HistoryServerSuite { } val errString = try { val err = Option(connection.getErrorStream()) - err.map(IOUtils.toString) + err.map(IOUtils.toString(_, StandardCharsets.UTF_8)) } catch { case io: IOException => None } diff --git a/core/src/test/scala/org/apache/spark/deploy/history/HybridStoreSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/HybridStoreSuite.scala new file mode 100644 index 0000000000000..fa57049b1a770 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/deploy/history/HybridStoreSuite.scala @@ -0,0 +1,232 @@ +/* + * 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. + */ + +package org.apache.spark.deploy.history + +import java.io.File +import java.util.NoSuchElementException +import java.util.concurrent.LinkedBlockingQueue + +import org.apache.commons.io.FileUtils +import org.scalatest.BeforeAndAfter +import org.scalatest.concurrent.TimeLimits +import org.scalatest.time.SpanSugar._ + +import org.apache.spark.SparkFunSuite +import org.apache.spark.status.KVUtils._ +import org.apache.spark.util.kvstore._ + +class HybridStoreSuite extends SparkFunSuite with BeforeAndAfter with TimeLimits { + + private var db: LevelDB = _ + private var dbpath: File = _ + + before { + dbpath = File.createTempFile("test.", ".ldb") + dbpath.delete() + db = new LevelDB(dbpath, new KVStoreScalaSerializer()) + } + + after { + if (db != null) { + db.close() + } + if (dbpath != null) { + FileUtils.deleteQuietly(dbpath) + } + } + + test("test multiple objects write read delete") { + val store = createHybridStore() + + val t1 = createCustomType1(1) + val t2 = createCustomType1(2) + + intercept[NoSuchElementException] { + store.read(t1.getClass(), t1.key) + } + + store.write(t1) + store.write(t2) + store.delete(t2.getClass(), t2.key) + + Seq(false, true).foreach { switch => + if (switch) switchHybridStore(store) + + intercept[NoSuchElementException] { + store.read(t2.getClass(), t2.key) + } + assert(store.read(t1.getClass(), t1.key) === t1) + assert(store.count(t1.getClass()) === 1L) + } + } + + test("test metadata") { + val store = createHybridStore() + assert(store.getMetadata(classOf[CustomType1]) === null) + + val t1 = createCustomType1(1) + store.setMetadata(t1) + assert(store.getMetadata(classOf[CustomType1]) === t1) + + // Switch to LevelDB and set a new metadata + switchHybridStore(store) + + val t2 = createCustomType1(2) + store.setMetadata(t2) + assert(store.getMetadata(classOf[CustomType1]) === t2) + } + + test("test update") { + val store = createHybridStore() + val t = createCustomType1(1) + + store.write(t) + t.name = "name2" + store.write(t) + + Seq(false, true).foreach { switch => + if (switch) switchHybridStore(store) + + assert(store.count(t.getClass()) === 1L) + assert(store.read(t.getClass(), t.key) === t) + } + } + + test("test basic iteration") { + val store = createHybridStore() + + val t1 = createCustomType1(1) + store.write(t1) + val t2 = createCustomType1(2) + store.write(t2) + + Seq(false, true).foreach { switch => + if (switch) switchHybridStore(store) + + assert(store.view(t1.getClass()).iterator().next().id === t1.id) + assert(store.view(t1.getClass()).skip(1).iterator().next().id === t2.id) + assert(store.view(t1.getClass()).skip(1).max(1).iterator().next().id === t2.id) + assert(store.view(t1.getClass()).first(t1.key).max(1).iterator().next().id === t1.id) + assert(store.view(t1.getClass()).first(t2.key).max(1).iterator().next().id === t2.id) + } + } + + test("test delete after switch") { + val store = createHybridStore() + val t = createCustomType1(1) + store.write(t) + switchHybridStore(store) + intercept[IllegalStateException] { + store.delete(t.getClass(), t.key) + } + } + + test("test klassMap") { + val store = createHybridStore() + val t1 = createCustomType1(1) + store.write(t1) + assert(store.klassMap.size === 1) + val t2 = new CustomType2("key2") + store.write(t2) + assert(store.klassMap.size === 2) + + switchHybridStore(store) + val t3 = new CustomType3("key3") + store.write(t3) + // Cannot put new klass to klassMap after the switching starts + assert(store.klassMap.size === 2) + } + + private def createHybridStore(): HybridStore = { + val store = new HybridStore() + store.setLevelDB(db) + store + } + + private def createCustomType1(i: Int): CustomType1 = { + new CustomType1("key" + i, "id" + i, "name" + i, i, "child" + i) + } + + private def switchHybridStore(store: HybridStore): Unit = { + assert(store.getStore().isInstanceOf[InMemoryStore]) + val listener = new SwitchListener() + store.switchToLevelDB(listener, "test", None) + failAfter(2.seconds) { + assert(listener.waitUntilDone()) + } + while (!store.getStore().isInstanceOf[LevelDB]) { + Thread.sleep(10) + } + } + + private class SwitchListener extends HybridStore.SwitchToLevelDBListener { + + // Put true to the queue when switch succeeds, and false when fails. + private val results = new LinkedBlockingQueue[Boolean]() + + override def onSwitchToLevelDBSuccess(): Unit = { + try { + results.put(true) + } catch { + case _: InterruptedException => + // no-op + } + } + + override def onSwitchToLevelDBFail(e: Exception): Unit = { + try { + results.put(false) + } catch { + case _: InterruptedException => + // no-op + } + } + + def waitUntilDone(): Boolean = { + results.take() + } + } +} + +class CustomType1( + @KVIndexParam var key: String, + @KVIndexParam("id") var id: String, + @KVIndexParam(value = "name", copy = true) var name: String, + @KVIndexParam("int") var num: Int, + @KVIndexParam(value = "child", parent = "id") var child: String) { + + override def equals(o: Any): Boolean = { + o match { + case t: CustomType1 => + id.equals(t.id) && name.equals(t.name) + case _ => false + } + } + + override def hashCode: Int = { + id.hashCode + } + + override def toString: String = { + "CustomType1[key=" + key + ",id=" + id + ",name=" + name + ",num=" + num; + } +} + +class CustomType2(@KVIndexParam var key: String) {} + +class CustomType3(@KVIndexParam var key: String) {} diff --git a/core/src/test/scala/org/apache/spark/deploy/history/RealBrowserUIHistoryServerSuite.scala b/core/src/test/scala/org/apache/spark/deploy/history/RealBrowserUIHistoryServerSuite.scala new file mode 100644 index 0000000000000..4a5c34f86753c --- /dev/null +++ b/core/src/test/scala/org/apache/spark/deploy/history/RealBrowserUIHistoryServerSuite.scala @@ -0,0 +1,159 @@ +/* + * 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. + */ + +package org.apache.spark.deploy.history + +import javax.servlet.http.HttpServletRequest + +import org.eclipse.jetty.proxy.ProxyServlet +import org.eclipse.jetty.servlet.{ServletContextHandler, ServletHolder} +import org.openqa.selenium.WebDriver +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ +import org.scalatestplus.selenium.WebBrowser + +import org.apache.spark._ +import org.apache.spark.internal.config.{EVENT_LOG_STAGE_EXECUTOR_METRICS, EXECUTOR_PROCESS_TREE_METRICS_ENABLED} +import org.apache.spark.internal.config.History.{HISTORY_LOG_DIR, LOCAL_STORE_DIR, UPDATE_INTERVAL_S} +import org.apache.spark.internal.config.Tests.IS_TESTING +import org.apache.spark.util.{ResetSystemProperties, Utils} + +/** + * Tests for HistoryServer with real web browsers. + */ +abstract class RealBrowserUIHistoryServerSuite(val driverProp: String) + extends SparkFunSuite with WebBrowser with Matchers with BeforeAndAfterAll + with BeforeAndAfterEach with ResetSystemProperties { + + implicit var webDriver: WebDriver + + private val driverPropPrefix = "spark.test." + private val logDir = getTestResourcePath("spark-events") + private val storeDir = Utils.createTempDir(namePrefix = "history") + + private var provider: FsHistoryProvider = null + private var server: HistoryServer = null + private var port: Int = -1 + + override def beforeAll(): Unit = { + super.beforeAll() + assume( + sys.props(driverPropPrefix + driverProp) !== null, + "System property " + driverPropPrefix + driverProp + + " should be set to the corresponding driver path.") + sys.props(driverProp) = sys.props(driverPropPrefix + driverProp) + } + + override def beforeEach(): Unit = { + super.beforeEach() + if (server == null) { + init() + } + } + + override def afterAll(): Unit = { + sys.props.remove(driverProp) + super.afterAll() + } + + def init(extraConf: (String, String)*): Unit = { + Utils.deleteRecursively(storeDir) + assert(storeDir.mkdir()) + val conf = new SparkConf() + .set(HISTORY_LOG_DIR, logDir) + .set(UPDATE_INTERVAL_S.key, "0") + .set(IS_TESTING, true) + .set(LOCAL_STORE_DIR, storeDir.getAbsolutePath()) + .set(EVENT_LOG_STAGE_EXECUTOR_METRICS, true) + .set(EXECUTOR_PROCESS_TREE_METRICS_ENABLED, true) + conf.setAll(extraConf) + provider = new FsHistoryProvider(conf) + provider.checkForLogs() + val securityManager = HistoryServer.createSecurityManager(conf) + + server = new HistoryServer(conf, provider, securityManager, 18080) + server.initialize() + server.bind() + provider.start() + port = server.boundPort + } + + def stop(): Unit = { + server.stop() + server = null + } + + test("ajax rendered relative links are prefixed with uiRoot (spark.ui.proxyBase)") { + val uiRoot = "/testwebproxybase" + System.setProperty("spark.ui.proxyBase", uiRoot) + + stop() + init() + + val port = server.boundPort + + val servlet = new ProxyServlet { + override def rewriteTarget(request: HttpServletRequest): String = { + // servlet acts like a proxy that redirects calls made on + // spark.ui.proxyBase context path to the normal servlet handlers operating off "/" + val sb = request.getRequestURL() + + if (request.getQueryString() != null) { + sb.append(s"?${request.getQueryString()}") + } + + val proxyidx = sb.indexOf(uiRoot) + sb.delete(proxyidx, proxyidx + uiRoot.length).toString + } + } + + val contextHandler = new ServletContextHandler + val holder = new ServletHolder(servlet) + contextHandler.setContextPath(uiRoot) + contextHandler.addServlet(holder, "/") + server.attachHandler(contextHandler) + + try { + val url = s"http://localhost:$port" + + go to s"$url$uiRoot" + + // expect the ajax call to finish in 5 seconds + implicitlyWait(org.scalatest.time.Span(5, org.scalatest.time.Seconds)) + + // once this findAll call returns, we know the ajax load of the table completed + findAll(ClassNameQuery("odd")) + + val links = findAll(TagNameQuery("a")) + .map(_.attribute("href")) + .filter(_.isDefined) + .map(_.get) + .filter(_.startsWith(url)).toList + + // there are at least some URL links that were generated via javascript, + // and they all contain the spark.ui.proxyBase (uiRoot) + links.length should be > 4 + for (link <- links) { + link should startWith(url + uiRoot) + } + } finally { + contextHandler.stop() + quit() + } + } +} diff --git a/core/src/test/scala/org/apache/spark/deploy/master/MasterSuite.scala b/core/src/test/scala/org/apache/spark/deploy/master/MasterSuite.scala index 0cf573c2490b3..7fd9af1389cb4 100644 --- a/core/src/test/scala/org/apache/spark/deploy/master/MasterSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/master/MasterSuite.scala @@ -23,7 +23,7 @@ import java.util.concurrent.atomic.AtomicInteger import scala.collection.JavaConverters._ import scala.collection.mutable -import scala.collection.mutable.{ArrayBuffer, HashMap, HashSet} +import scala.collection.mutable.{HashMap, HashSet} import scala.concurrent.duration._ import scala.io.Source import scala.reflect.ClassTag @@ -31,8 +31,10 @@ import scala.reflect.ClassTag import org.json4s._ import org.json4s.jackson.JsonMethods._ import org.mockito.Mockito.{mock, when} -import org.scalatest.{BeforeAndAfter, Matchers, PrivateMethodTester} +import org.scalatest.{BeforeAndAfter, PrivateMethodTester} import org.scalatest.concurrent.Eventually +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import other.supplier.{CustomPersistenceEngine, CustomRecoveryModeFactory} import org.apache.spark.{SecurityManager, SparkConf, SparkFunSuite} @@ -46,6 +48,7 @@ import org.apache.spark.resource.{ResourceInformation, ResourceRequirement} import org.apache.spark.resource.ResourceUtils.{FPGA, GPU} import org.apache.spark.rpc.{RpcAddress, RpcEndpoint, RpcEndpointRef, RpcEnv} import org.apache.spark.serializer +import org.apache.spark.util.Utils object MockWorker { val counter = new AtomicInteger(10000) @@ -56,7 +59,7 @@ class MockWorker(master: RpcEndpointRef, conf: SparkConf = new SparkConf) extend val id = seq.toString override val rpcEnv: RpcEnv = RpcEnv.create("worker", "localhost", seq, conf, new SecurityManager(conf)) - var apps = new mutable.HashMap[String, String]() + val apps = new mutable.HashMap[String, String]() val driverIdToAppId = new mutable.HashMap[String, String]() def newDriver(driverId: String): RpcEndpointRef = { val name = s"driver_${drivers.size}" @@ -70,6 +73,7 @@ class MockWorker(master: RpcEndpointRef, conf: SparkConf = new SparkConf) extend }) } + var decommissioned = false var appDesc = DeployTestUtils.createAppDesc() val drivers = mutable.HashSet[String]() val driverResources = new mutable.HashMap[String, Map[String, Set[String]]] @@ -94,6 +98,8 @@ class MockWorker(master: RpcEndpointRef, conf: SparkConf = new SparkConf) extend case None => } driverIdToAppId.remove(driverId) + case DecommissionWorker => + decommissioned = true } } @@ -129,7 +135,7 @@ class MockExecutorLaunchFailWorker(master: Master, conf: SparkConf = new SparkCo assert(master.idToApp.contains(appId)) appIdsToLaunchExecutor += appId failedCnt += 1 - master.self.send(ExecutorStateChanged(appId, execId, ExecutorState.FAILED, None, None)) + master.self.askSync(ExecutorStateChanged(appId, execId, ExecutorState.FAILED, None, None)) case otherMsg => super.receive(otherMsg) } @@ -138,6 +144,10 @@ class MockExecutorLaunchFailWorker(master: Master, conf: SparkConf = new SparkCo class MasterSuite extends SparkFunSuite with Matchers with Eventually with PrivateMethodTester with BeforeAndAfter { + // regex to extract worker links from the master webui HTML + // groups represent URL and worker ID + val WORKER_LINK_RE = """\s*(worker-.+?)\s*""".r + private var _master: Master = _ after { @@ -315,18 +325,31 @@ class MasterSuite extends SparkFunSuite val conf = new SparkConf() val localCluster = new LocalSparkCluster(2, 2, 512, conf) localCluster.start() + val masterUrl = s"http://localhost:${localCluster.masterWebUIPort}" try { eventually(timeout(5.seconds), interval(100.milliseconds)) { - val json = Source.fromURL(s"http://localhost:${localCluster.masterWebUIPort}/json") - .getLines().mkString("\n") + val json = Utils + .tryWithResource(Source.fromURL(s"$masterUrl/json"))(_.getLines().mkString("\n")) val JArray(workers) = (parse(json) \ "workers") workers.size should be (2) workers.foreach { workerSummaryJson => val JString(workerWebUi) = workerSummaryJson \ "webuiaddress" - val workerResponse = parse(Source.fromURL(s"${workerWebUi}/json") - .getLines().mkString("\n")) + val workerResponse = parse(Utils + .tryWithResource(Source.fromURL(s"$workerWebUi/json"))(_.getLines().mkString("\n"))) (workerResponse \ "cores").extract[Int] should be (2) } + + val html = Utils + .tryWithResource(Source.fromURL(s"$masterUrl/"))(_.getLines().mkString("\n")) + html should include ("Spark Master at spark://") + val workerLinks = (WORKER_LINK_RE findAllMatchIn html).toList + workerLinks.size should be (2) + workerLinks foreach { case WORKER_LINK_RE(workerUrl, workerId) => + val workerHtml = Utils + .tryWithResource(Source.fromURL(workerUrl))(_.getLines().mkString("\n")) + workerHtml should include ("Spark Worker at") + workerHtml should include ("Running Executors (0)") + } } } finally { localCluster.stop() @@ -335,31 +358,106 @@ class MasterSuite extends SparkFunSuite test("master/worker web ui available with reverseProxy") { implicit val formats = org.json4s.DefaultFormats - val reverseProxyUrl = "http://localhost:8080" + val conf = new SparkConf() + conf.set(UI_REVERSE_PROXY, true) + val localCluster = new LocalSparkCluster(2, 2, 512, conf) + localCluster.start() + val masterUrl = s"http://localhost:${localCluster.masterWebUIPort}" + try { + eventually(timeout(5.seconds), interval(100.milliseconds)) { + val json = Utils + .tryWithResource(Source.fromURL(s"$masterUrl/json"))(_.getLines().mkString("\n")) + val JArray(workers) = (parse(json) \ "workers") + workers.size should be (2) + workers.foreach { workerSummaryJson => + // the webuiaddress intentionally points to the local web ui. + // explicitly construct reverse proxy url targeting the master + val JString(workerId) = workerSummaryJson \ "id" + val url = s"$masterUrl/proxy/${workerId}/json" + val workerResponse = parse( + Utils.tryWithResource(Source.fromURL(url))(_.getLines().mkString("\n"))) + (workerResponse \ "cores").extract[Int] should be (2) + } + + val html = Utils + .tryWithResource(Source.fromURL(s"$masterUrl/"))(_.getLines().mkString("\n")) + html should include ("Spark Master at spark://") + html should include ("""href="/static""") + html should include ("""src="/static""") + verifyWorkerUI(html, masterUrl) + } + } finally { + localCluster.stop() + System.getProperties().remove("spark.ui.proxyBase") + } + } + + test("master/worker web ui available behind front-end reverseProxy") { + implicit val formats = org.json4s.DefaultFormats + val reverseProxyUrl = "http://proxyhost:8080/path/to/spark" val conf = new SparkConf() conf.set(UI_REVERSE_PROXY, true) conf.set(UI_REVERSE_PROXY_URL, reverseProxyUrl) val localCluster = new LocalSparkCluster(2, 2, 512, conf) localCluster.start() + val masterUrl = s"http://localhost:${localCluster.masterWebUIPort}" try { eventually(timeout(5.seconds), interval(100.milliseconds)) { - val json = Source.fromURL(s"http://localhost:${localCluster.masterWebUIPort}/json") - .getLines().mkString("\n") + val json = Utils + .tryWithResource(Source.fromURL(s"$masterUrl/json"))(_.getLines().mkString("\n")) val JArray(workers) = (parse(json) \ "workers") workers.size should be (2) workers.foreach { workerSummaryJson => + // the webuiaddress intentionally points to the local web ui. + // explicitly construct reverse proxy url targeting the master val JString(workerId) = workerSummaryJson \ "id" - val url = s"http://localhost:${localCluster.masterWebUIPort}/proxy/${workerId}/json" - val workerResponse = parse(Source.fromURL(url).getLines().mkString("\n")) + val url = s"$masterUrl/proxy/${workerId}/json" + val workerResponse = parse(Utils + .tryWithResource(Source.fromURL(url))(_.getLines().mkString("\n"))) (workerResponse \ "cores").extract[Int] should be (2) - (workerResponse \ "masterwebuiurl").extract[String] should be (reverseProxyUrl) + (workerResponse \ "masterwebuiurl").extract[String] should be (reverseProxyUrl + "/") } + + System.getProperty("spark.ui.proxyBase") should be (reverseProxyUrl) + val html = Utils + .tryWithResource(Source.fromURL(s"$masterUrl/"))(_.getLines().mkString("\n")) + html should include ("Spark Master at spark://") + verifyStaticResourcesServedByProxy(html, reverseProxyUrl) + verifyWorkerUI(html, masterUrl, reverseProxyUrl) } } finally { localCluster.stop() + System.getProperties().remove("spark.ui.proxyBase") } } + private def verifyWorkerUI(masterHtml: String, masterUrl: String, + reverseProxyUrl: String = ""): Unit = { + val workerLinks = (WORKER_LINK_RE findAllMatchIn masterHtml).toList + workerLinks.size should be (2) + workerLinks foreach { + case WORKER_LINK_RE(workerUrl, workerId) => + workerUrl should be (s"$reverseProxyUrl/proxy/$workerId") + // there is no real front-end proxy as defined in $reverseProxyUrl + // construct url directly targeting the master + val url = s"$masterUrl/proxy/$workerId/" + System.setProperty("spark.ui.proxyBase", workerUrl) + val workerHtml = Utils + .tryWithResource(Source.fromURL(url))(_.getLines().mkString("\n")) + workerHtml should include ("Spark Worker at") + workerHtml should include ("Running Executors (0)") + verifyStaticResourcesServedByProxy(workerHtml, workerUrl) + case _ => fail // make sure we don't accidentially skip the tests + } + } + + private def verifyStaticResourcesServedByProxy(html: String, proxyUrl: String): Unit = { + html should not include ("""href="/static""") + html should include (s"""href="$proxyUrl/static""") + html should not include ("""src="/static""") + html should include (s"""src="$proxyUrl/static""") + } + test("basic scheduling - spread out") { basicScheduling(spreadOut = true) } @@ -689,7 +787,16 @@ class MasterSuite extends SparkFunSuite val master = makeAliveMaster() var worker: MockExecutorLaunchFailWorker = null try { - worker = new MockExecutorLaunchFailWorker(master) + val conf = new SparkConf() + // SPARK-32250: When running test on GitHub Action machine, the available processors in JVM + // is only 2, while on Jenkins it's 32. For this specific test, 2 available processors, which + // also decides number of threads in Dispatcher, is not enough to consume the messages. In + // the worst situation, MockExecutorLaunchFailWorker would occupy these 2 threads for + // handling messages LaunchDriver, LaunchExecutor at the same time but leave no thread for + // the driver to handle the message RegisteredApplication. At the end, it results in the dead + // lock situation. Therefore, we need to set more threads to avoid the dead lock. + conf.set(Network.RPC_NETTY_DISPATCHER_NUM_THREADS, 6) + worker = new MockExecutorLaunchFailWorker(master, conf) worker.rpcEnv.setupEndpoint("worker", worker) val workerRegMsg = RegisterWorker( worker.id, @@ -725,6 +832,68 @@ class MasterSuite extends SparkFunSuite } } + def testWorkerDecommissioning( + numWorkers: Int, + numWorkersExpectedToDecom: Int, + hostnames: Seq[String]): Unit = { + val conf = new SparkConf() + val master = makeAliveMaster(conf) + val workers = (1 to numWorkers).map { idx => + val worker = new MockWorker(master.self, conf) + worker.rpcEnv.setupEndpoint(s"worker-$idx", worker) + val workerReg = RegisterWorker( + worker.id, + "localhost", + worker.self.address.port, + worker.self, + 10, + 1024, + "http://localhost:8080", + RpcAddress("localhost", 10000)) + master.self.send(workerReg) + worker + } + + eventually(timeout(10.seconds)) { + val masterState = master.self.askSync[MasterStateResponse](RequestMasterState) + assert(masterState.workers.length === numWorkers) + assert(masterState.workers.forall(_.state == WorkerState.ALIVE)) + assert(masterState.workers.map(_.id).toSet == workers.map(_.id).toSet) + } + + val decomWorkersCount = master.self.askSync[Integer](DecommissionWorkersOnHosts(hostnames)) + assert(decomWorkersCount === numWorkersExpectedToDecom) + + // Decommissioning is actually async ... wait for the workers to actually be decommissioned by + // polling the master's state. + eventually(timeout(30.seconds)) { + val masterState = master.self.askSync[MasterStateResponse](RequestMasterState) + assert(masterState.workers.length === numWorkers) + val workersActuallyDecomed = masterState.workers + .filter(_.state == WorkerState.DECOMMISSIONED).map(_.id) + val decommissionedWorkers = workers.filter(w => workersActuallyDecomed.contains(w.id)) + assert(workersActuallyDecomed.length === numWorkersExpectedToDecom) + assert(decommissionedWorkers.forall(_.decommissioned)) + } + + // Decommissioning a worker again should return the same answer since we want this call to be + // idempotent. + val decomWorkersCountAgain = master.self.askSync[Integer](DecommissionWorkersOnHosts(hostnames)) + assert(decomWorkersCountAgain === numWorkersExpectedToDecom) + } + + test("All workers on a host should be decommissioned") { + testWorkerDecommissioning(2, 2, Seq("LoCalHost", "localHOST")) + } + + test("No workers should be decommissioned with invalid host") { + testWorkerDecommissioning(2, 0, Seq("NoSuchHost1", "NoSuchHost2")) + } + + test("Only worker on host should be decommissioned") { + testWorkerDecommissioning(1, 1, Seq("lOcalHost", "NoSuchHost")) + } + test("SPARK-19900: there should be a corresponding driver for the app after relaunching driver") { val conf = new SparkConf().set(WORKER_TIMEOUT, 1L) val master = makeAliveMaster(conf) diff --git a/core/src/test/scala/org/apache/spark/deploy/master/ui/MasterWebUISuite.scala b/core/src/test/scala/org/apache/spark/deploy/master/ui/MasterWebUISuite.scala index e2d7facdd77e0..be83ec12f92f5 100644 --- a/core/src/test/scala/org/apache/spark/deploy/master/ui/MasterWebUISuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/master/ui/MasterWebUISuite.scala @@ -28,7 +28,7 @@ import org.mockito.Mockito.{mock, times, verify, when} import org.scalatest.BeforeAndAfterAll import org.apache.spark.{SecurityManager, SparkConf, SparkFunSuite} -import org.apache.spark.deploy.DeployMessages.{KillDriverResponse, RequestKillDriver} +import org.apache.spark.deploy.DeployMessages.{DecommissionWorkersOnHosts, KillDriverResponse, RequestKillDriver} import org.apache.spark.deploy.DeployTestUtils._ import org.apache.spark.deploy.master._ import org.apache.spark.rpc.{RpcEndpointRef, RpcEnv} @@ -36,7 +36,7 @@ import org.apache.spark.rpc.{RpcEndpointRef, RpcEnv} class MasterWebUISuite extends SparkFunSuite with BeforeAndAfterAll { - val conf = new SparkConf + val conf = new SparkConf() val securityMgr = new SecurityManager(conf) val rpcEnv = mock(classOf[RpcEnv]) val master = mock(classOf[Master]) @@ -88,10 +88,32 @@ class MasterWebUISuite extends SparkFunSuite with BeforeAndAfterAll { verify(masterEndpointRef, times(1)).ask[KillDriverResponse](RequestKillDriver(activeDriverId)) } - private def convPostDataToString(data: Map[String, String]): String = { + private def testKillWorkers(hostnames: Seq[String]): Unit = { + val url = s"http://localhost:${masterWebUI.boundPort}/workers/kill/" + val body = convPostDataToString(hostnames.map(("host", _))) + val conn = sendHttpRequest(url, "POST", body) + // The master is mocked here, so cannot assert on the response code + conn.getResponseCode + // Verify that master was asked to kill driver with the correct id + verify(masterEndpointRef).askSync[Integer](DecommissionWorkersOnHosts(hostnames)) + } + + test("Kill one host") { + testKillWorkers(Seq("localhost")) + } + + test("Kill multiple hosts") { + testKillWorkers(Seq("noSuchHost", "LocalHost")) + } + + private def convPostDataToString(data: Seq[(String, String)]): String = { (for ((name, value) <- data) yield s"$name=$value").mkString("&") } + private def convPostDataToString(data: Map[String, String]): String = { + convPostDataToString(data.toSeq) + } + /** * Send an HTTP request to the given URL using the method and the body specified. * Return the connection object. diff --git a/core/src/test/scala/org/apache/spark/deploy/rest/SubmitRestProtocolSuite.scala b/core/src/test/scala/org/apache/spark/deploy/rest/SubmitRestProtocolSuite.scala index 03102fd8c696c..9fdbf485e17d3 100644 --- a/core/src/test/scala/org/apache/spark/deploy/rest/SubmitRestProtocolSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/rest/SubmitRestProtocolSuite.scala @@ -19,6 +19,8 @@ package org.apache.spark.deploy.rest import java.lang.Boolean +import scala.util.Properties.versionNumberString + import org.json4s.jackson.JsonMethods._ import org.apache.spark.{SparkConf, SparkFunSuite} @@ -96,6 +98,7 @@ class SubmitRestProtocolSuite extends SparkFunSuite { // optional fields conf.set(JARS, Seq("mayonnaise.jar", "ketchup.jar")) conf.set(FILES.key, "fireball.png") + conf.set(ARCHIVES.key, "fireballs.zip") conf.set("spark.driver.memory", s"${Utils.DEFAULT_DRIVER_MEM_MB}m") conf.set(DRIVER_CORES, 180) conf.set("spark.driver.extraJavaOptions", " -Dslices=5 -Dcolor=mostly_red") @@ -232,7 +235,7 @@ class SubmitRestProtocolSuite extends SparkFunSuite { |} """.stripMargin - private val submitDriverRequestJson = + private lazy val submitDriverRequestJson = if (versionNumberString.startsWith("2.12")) { s""" |{ | "action" : "CreateSubmissionRequest", @@ -244,6 +247,7 @@ class SubmitRestProtocolSuite extends SparkFunSuite { | }, | "mainClass" : "org.apache.spark.examples.SparkPie", | "sparkProperties" : { + | "spark.archives" : "fireballs.zip", | "spark.driver.extraLibraryPath" : "pickle.jar", | "spark.jars" : "mayonnaise.jar,ketchup.jar", | "spark.driver.supervise" : "false", @@ -258,6 +262,34 @@ class SubmitRestProtocolSuite extends SparkFunSuite { | } |} """.stripMargin + } else { + s""" + |{ + | "action" : "CreateSubmissionRequest", + | "appArgs" : [ "two slices", "a hint of cinnamon" ], + | "appResource" : "honey-walnut-cherry.jar", + | "clientSparkVersion" : "1.2.3", + | "environmentVariables" : { + | "PATH" : "/dev/null" + | }, + | "mainClass" : "org.apache.spark.examples.SparkPie", + | "sparkProperties" : { + | "spark.archives" : "fireballs.zip", + | "spark.driver.extraLibraryPath" : "pickle.jar", + | "spark.jars" : "mayonnaise.jar,ketchup.jar", + | "spark.driver.supervise" : "false", + | "spark.driver.memory" : "${Utils.DEFAULT_DRIVER_MEM_MB}m", + | "spark.files" : "fireball.png", + | "spark.driver.cores" : "180", + | "spark.driver.extraJavaOptions" : " -Dslices=5 -Dcolor=mostly_red", + | "spark.app.name" : "SparkPie", + | "spark.cores.max" : "10000", + | "spark.executor.memory" : "256m", + | "spark.driver.extraClassPath" : "food-coloring.jar" + | } + |} + """.stripMargin + } private val submitDriverResponseJson = """ diff --git a/core/src/test/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProviderSuite.scala b/core/src/test/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProviderSuite.scala index 44f38e7043dcd..2cfc60f927e1c 100644 --- a/core/src/test/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProviderSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/security/HadoopFSDelegationTokenProviderSuite.scala @@ -19,7 +19,8 @@ package org.apache.spark.deploy.security import org.apache.hadoop.conf.Configuration import org.apache.hadoop.fs.Path -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.{SparkConf, SparkFunSuite} import org.apache.spark.internal.config.{STAGING_DIR, SUBMIT_DEPLOY_MODE} diff --git a/core/src/test/scala/org/apache/spark/deploy/worker/CommandUtilsSuite.scala b/core/src/test/scala/org/apache/spark/deploy/worker/CommandUtilsSuite.scala index 2d3cc5d3abd65..28e35bc8183ba 100644 --- a/core/src/test/scala/org/apache/spark/deploy/worker/CommandUtilsSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/worker/CommandUtilsSuite.scala @@ -17,7 +17,9 @@ package org.apache.spark.deploy.worker -import org.scalatest.{Matchers, PrivateMethodTester} +import org.scalatest.PrivateMethodTester +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.{SecurityManager, SparkConf, SparkFunSuite} import org.apache.spark.deploy.Command diff --git a/core/src/test/scala/org/apache/spark/deploy/worker/DriverRunnerTest.scala b/core/src/test/scala/org/apache/spark/deploy/worker/DriverRunnerTest.scala index c3b580e7ccac4..e429ddfd570de 100644 --- a/core/src/test/scala/org/apache/spark/deploy/worker/DriverRunnerTest.scala +++ b/core/src/test/scala/org/apache/spark/deploy/worker/DriverRunnerTest.scala @@ -40,7 +40,8 @@ class DriverRunnerTest extends SparkFunSuite { val worker = mock(classOf[RpcEndpointRef]) doNothing().when(worker).send(any()) spy(new DriverRunner(conf, "driverId", new File("workDir"), new File("sparkHome"), - driverDescription, worker, "spark://1.2.3.4/worker/", new SecurityManager(conf))) + driverDescription, worker, "spark://1.2.3.4/worker/", "http://publicAddress:80", + new SecurityManager(conf))) } private def createProcessBuilderAndProcess(): (ProcessBuilderLike, Process) = { diff --git a/core/src/test/scala/org/apache/spark/deploy/worker/WorkerSuite.scala b/core/src/test/scala/org/apache/spark/deploy/worker/WorkerSuite.scala index 2d3d0afe3f80c..e24ff051ee339 100644 --- a/core/src/test/scala/org/apache/spark/deploy/worker/WorkerSuite.scala +++ b/core/src/test/scala/org/apache/spark/deploy/worker/WorkerSuite.scala @@ -29,8 +29,10 @@ import org.mockito.Answers.RETURNS_SMART_NULLS import org.mockito.ArgumentMatchers.any import org.mockito.Mockito._ import org.mockito.invocation.InvocationOnMock -import org.scalatest.{BeforeAndAfter, Matchers} +import org.scalatest.BeforeAndAfter import org.scalatest.concurrent.Eventually.{eventually, interval, timeout} +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.{SecurityManager, SparkConf, SparkFunSuite} import org.apache.spark.TestUtils.{createTempJsonFile, createTempScriptWithExpectedOutput} @@ -80,7 +82,7 @@ class WorkerSuite extends SparkFunSuite with Matchers with BeforeAndAfter { } before { - MockitoAnnotations.initMocks(this) + MockitoAnnotations.openMocks(this).close() } after { @@ -340,7 +342,7 @@ class WorkerSuite extends SparkFunSuite with Matchers with BeforeAndAfter { testWorkDirCleanupAndRemoveMetadataWithConfig(true) } - test("WorkdDirCleanup cleans only app dirs when" + + test("WorkDirCleanup cleans only app dirs when" + "spark.shuffle.service.db.enabled=false") { testWorkDirCleanupAndRemoveMetadataWithConfig(false) } diff --git a/core/src/test/scala/org/apache/spark/executor/CoarseGrainedExecutorBackendSuite.scala b/core/src/test/scala/org/apache/spark/executor/CoarseGrainedExecutorBackendSuite.scala index e0b586074b89e..4909a586d31ae 100644 --- a/core/src/test/scala/org/apache/spark/executor/CoarseGrainedExecutorBackendSuite.scala +++ b/core/src/test/scala/org/apache/spark/executor/CoarseGrainedExecutorBackendSuite.scala @@ -61,7 +61,7 @@ class CoarseGrainedExecutorBackendSuite extends SparkFunSuite val testResourceArgs: JObject = ("" -> "") val ja = JArray(List(testResourceArgs)) val f1 = createTempJsonFile(tmpDir, "resources", ja) - var error = intercept[SparkException] { + val error = intercept[SparkException] { val parsedResources = backend.parseOrFindResources(Some(f1)) }.getMessage() @@ -106,7 +106,7 @@ class CoarseGrainedExecutorBackendSuite extends SparkFunSuite testParsingMultipleResources(conf, ResourceProfile.getOrCreateDefaultProfile(conf)) } - def testParsingMultipleResources(conf: SparkConf, resourceProfile: ResourceProfile) { + def testParsingMultipleResources(conf: SparkConf, resourceProfile: ResourceProfile): Unit = { val serializer = new JavaSerializer(conf) val env = createMockEnv(conf, serializer) // we don't really use this, just need it to get at the parser function @@ -146,7 +146,7 @@ class CoarseGrainedExecutorBackendSuite extends SparkFunSuite val ja = Extraction.decompose(Seq(gpuArgs)) val f1 = createTempJsonFile(tmpDir, "resources", ja) - var error = intercept[IllegalArgumentException] { + val error = intercept[IllegalArgumentException] { val parsedResources = backend.parseOrFindResources(Some(f1)) }.getMessage() @@ -160,7 +160,7 @@ class CoarseGrainedExecutorBackendSuite extends SparkFunSuite val ja = Extraction.decompose(Seq(fpga)) val f1 = createTempJsonFile(tmpDir, "resources", ja) - var error = intercept[SparkException] { + val error = intercept[SparkException] { val parsedResources = backend.parseOrFindResources(Some(f1)) }.getMessage() @@ -199,7 +199,7 @@ class CoarseGrainedExecutorBackendSuite extends SparkFunSuite val ja = Extraction.decompose(Seq(gpuArgs)) val f1 = createTempJsonFile(tmpDir, "resources", ja) - var error = intercept[IllegalArgumentException] { + val error = intercept[IllegalArgumentException] { val parsedResources = backend.parseOrFindResources(Some(f1)) }.getMessage() @@ -302,7 +302,7 @@ class CoarseGrainedExecutorBackendSuite extends SparkFunSuite // We don't really verify the data, just pass it around. val data = ByteBuffer.wrap(Array[Byte](1, 2, 3, 4)) val taskDescription = new TaskDescription(taskId, 2, "1", "TASK 1000000", 19, - 1, mutable.Map.empty, mutable.Map.empty, new Properties, + 1, mutable.Map.empty, mutable.Map.empty, mutable.Map.empty, new Properties, Map(GPU -> new ResourceInformation(GPU, Array("0", "1"))), data) val serializedTaskDescription = TaskDescription.encode(taskDescription) backend.executor = mock[Executor] diff --git a/core/src/test/scala/org/apache/spark/executor/ExecutorMetricsPollerSuite.scala b/core/src/test/scala/org/apache/spark/executor/ExecutorMetricsPollerSuite.scala new file mode 100644 index 0000000000000..e471864ae240f --- /dev/null +++ b/core/src/test/scala/org/apache/spark/executor/ExecutorMetricsPollerSuite.scala @@ -0,0 +1,48 @@ +/* + * 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. + */ + +package org.apache.spark.executor + +import org.apache.spark.{SparkConf, SparkFunSuite} +import org.apache.spark.memory.TestMemoryManager + +class ExecutorMetricsPollerSuite extends SparkFunSuite { + + test("SPARK-34779: stage entry shouldn't be removed before a heartbeat occurs") { + val testMemoryManager = new TestMemoryManager(new SparkConf()) + val poller = new ExecutorMetricsPoller(testMemoryManager, 1000, None) + + poller.onTaskStart(0L, 0, 0) + // stage (0, 0) has an active task, so it remains on stageTCMP after heartbeat. + assert(poller.getExecutorUpdates.size === 1) + assert(poller.stageTCMP.size === 1) + assert(poller.stageTCMP.get((0, 0)).count.get === 1) + + poller.onTaskCompletion(0L, 0, 0) + // stage (0, 0) doesn't have active tasks, but its entry will be kept until next + // heartbeat. + assert(poller.stageTCMP.size === 1) + assert(poller.stageTCMP.get((0, 0)).count.get === 0) + + // the next heartbeat will report the peak metrics of stage (0, 0) during the + // previous heartbeat interval, then remove it from stageTCMP. + assert(poller.getExecutorUpdates.size === 1) + assert(poller.stageTCMP.size === 0) + + poller.stop + } +} diff --git a/core/src/test/scala/org/apache/spark/executor/ExecutorSuite.scala b/core/src/test/scala/org/apache/spark/executor/ExecutorSuite.scala index 31049d104e63d..a237447b0fa2d 100644 --- a/core/src/test/scala/org/apache/spark/executor/ExecutorSuite.scala +++ b/core/src/test/scala/org/apache/spark/executor/ExecutorSuite.scala @@ -19,6 +19,7 @@ package org.apache.spark.executor import java.io.{Externalizable, ObjectInput, ObjectOutput} import java.lang.Thread.UncaughtExceptionHandler +import java.net.URL import java.nio.ByteBuffer import java.util.Properties import java.util.concurrent.{ConcurrentHashMap, CountDownLatch, TimeUnit} @@ -28,6 +29,7 @@ import scala.collection.immutable import scala.collection.mutable.{ArrayBuffer, Map} import scala.concurrent.duration._ +import com.google.common.cache.{CacheBuilder, CacheLoader} import org.mockito.ArgumentCaptor import org.mockito.ArgumentMatchers.{any, eq => meq} import org.mockito.Mockito.{inOrder, verify, when} @@ -43,7 +45,7 @@ import org.apache.spark.TaskState.TaskState import org.apache.spark.broadcast.Broadcast import org.apache.spark.internal.config._ import org.apache.spark.internal.config.UI._ -import org.apache.spark.memory.TestMemoryManager +import org.apache.spark.memory.{SparkOutOfMemoryError, TestMemoryManager} import org.apache.spark.metrics.MetricsSystem import org.apache.spark.rdd.RDD import org.apache.spark.resource.ResourceInformation @@ -52,7 +54,7 @@ import org.apache.spark.scheduler.{DirectTaskResult, FakeTask, ResultTask, Task, import org.apache.spark.serializer.{JavaSerializer, SerializerInstance, SerializerManager} import org.apache.spark.shuffle.FetchFailedException import org.apache.spark.storage.{BlockManager, BlockManagerId} -import org.apache.spark.util.{LongAccumulator, UninterruptibleThread} +import org.apache.spark.util.{LongAccumulator, SparkUncaughtExceptionHandler, ThreadUtils, UninterruptibleThread} class ExecutorSuite extends SparkFunSuite with LocalSparkContext with MockitoSugar with Eventually with PrivateMethodTester { @@ -63,6 +65,33 @@ class ExecutorSuite extends SparkFunSuite super.afterEach() } + /** + * Creates an Executor with the provided arguments, is then passed to `f` + * and will be stopped after `f` returns. + */ + def withExecutor( + executorId: String, + executorHostname: String, + env: SparkEnv, + userClassPath: Seq[URL] = Nil, + isLocal: Boolean = true, + uncaughtExceptionHandler: UncaughtExceptionHandler + = new SparkUncaughtExceptionHandler, + resources: immutable.Map[String, ResourceInformation] + = immutable.Map.empty[String, ResourceInformation])(f: Executor => Unit): Unit = { + var executor: Executor = null + try { + executor = new Executor(executorId, executorHostname, env, userClassPath, isLocal, + uncaughtExceptionHandler, resources) + + f(executor) + } finally { + if (executor != null) { + executor.stop() + } + } + } + test("SPARK-15963: Catch `TaskKilledException` correctly in Executor.TaskRunner") { // mock some objects to make Executor.launchTask() happy val conf = new SparkConf @@ -115,10 +144,8 @@ class ExecutorSuite extends SparkFunSuite } }) - var executor: Executor = null - try { - executor = new Executor("id", "localhost", env, userClassPath = Nil, isLocal = true, - resources = immutable.Map.empty[String, ResourceInformation]) + withExecutor("id", "localhost", env) { executor => + // the task will be launched in a dedicated worker thread executor.launchTask(mockExecutorBackend, taskDescription) @@ -138,11 +165,6 @@ class ExecutorSuite extends SparkFunSuite assert(executorSuiteHelper.testFailedReason.toErrorString === "TaskKilled (test)") assert(executorSuiteHelper.taskState === TaskState.KILLED) } - finally { - if (executor != null) { - executor.stop() - } - } } test("SPARK-19276: Handle FetchFailedExceptions that are hidden by user exceptions") { @@ -248,31 +270,37 @@ class ExecutorSuite extends SparkFunSuite heartbeatZeroAccumulatorUpdateTest(false) } + private def withMockHeartbeatReceiverRef(executor: Executor) + (func: RpcEndpointRef => Unit): Unit = { + val executorClass = classOf[Executor] + val mockReceiverRef = mock[RpcEndpointRef] + val receiverRef = executorClass.getDeclaredField("heartbeatReceiverRef") + receiverRef.setAccessible(true) + receiverRef.set(executor, mockReceiverRef) + + func(mockReceiverRef) + } + private def withHeartbeatExecutor(confs: (String, String)*) (f: (Executor, ArrayBuffer[Heartbeat]) => Unit): Unit = { val conf = new SparkConf confs.foreach { case (k, v) => conf.set(k, v) } val serializer = new JavaSerializer(conf) val env = createMockEnv(conf, serializer) - val executor = - new Executor("id", "localhost", SparkEnv.get, userClassPath = Nil, isLocal = true, - resources = immutable.Map.empty[String, ResourceInformation]) - val executorClass = classOf[Executor] - - // Save all heartbeats sent into an ArrayBuffer for verification - val heartbeats = ArrayBuffer[Heartbeat]() - val mockReceiver = mock[RpcEndpointRef] - when(mockReceiver.askSync(any[Heartbeat], any[RpcTimeout])(any)) - .thenAnswer((invocation: InvocationOnMock) => { - val args = invocation.getArguments() - heartbeats += args(0).asInstanceOf[Heartbeat] - HeartbeatResponse(false) - }) - val receiverRef = executorClass.getDeclaredField("heartbeatReceiverRef") - receiverRef.setAccessible(true) - receiverRef.set(executor, mockReceiver) - - f(executor, heartbeats) + withExecutor("id", "localhost", SparkEnv.get) { executor => + withMockHeartbeatReceiverRef(executor) { mockReceiverRef => + // Save all heartbeats sent into an ArrayBuffer for verification + val heartbeats = ArrayBuffer[Heartbeat]() + when(mockReceiverRef.askSync(any[Heartbeat], any[RpcTimeout])(any)) + .thenAnswer((invocation: InvocationOnMock) => { + val args = invocation.getArguments() + heartbeats += args(0).asInstanceOf[Heartbeat] + HeartbeatResponse(false) + }) + + f(executor, heartbeats) + } + } } private def heartbeatZeroAccumulatorUpdateTest(dropZeroMetrics: Boolean): Unit = { @@ -353,10 +381,7 @@ class ExecutorSuite extends SparkFunSuite val taskDescription = createResultTaskDescription(serializer, taskBinary, rdd, 0) val mockBackend = mock[ExecutorBackend] - var executor: Executor = null - try { - executor = new Executor("id", "localhost", SparkEnv.get, userClassPath = Nil, isLocal = true, - resources = immutable.Map.empty[String, ResourceInformation]) + withExecutor("id", "localhost", SparkEnv.get) { executor => executor.launchTask(mockBackend, taskDescription) // Ensure that the executor's metricsPoller is polled so that values are recorded for @@ -367,10 +392,6 @@ class ExecutorSuite extends SparkFunSuite eventually(timeout(5.seconds), interval(10.milliseconds)) { assert(executor.numRunningTasks === 0) } - } finally { - if (executor != null) { - executor.stop() - } } // Verify that peak values for task metrics get sent in the TaskResult @@ -402,6 +423,103 @@ class ExecutorSuite extends SparkFunSuite assert(taskMetrics.getMetricValue("JVMHeapMemory") > 0) } + test("SPARK-34949: do not re-register BlockManager when executor is shutting down") { + val reregisterInvoked = new AtomicBoolean(false) + val mockBlockManager = mock[BlockManager] + when(mockBlockManager.reregister()).thenAnswer { (_: InvocationOnMock) => + reregisterInvoked.getAndSet(true) + } + val conf = new SparkConf(false).setAppName("test").setMaster("local[2]") + val mockEnv = createMockEnv(conf, new JavaSerializer(conf)) + when(mockEnv.blockManager).thenReturn(mockBlockManager) + + withExecutor("id", "localhost", mockEnv) { executor => + withMockHeartbeatReceiverRef(executor) { mockReceiverRef => + when(mockReceiverRef.askSync(any[Heartbeat], any[RpcTimeout])(any)).thenAnswer { + (_: InvocationOnMock) => HeartbeatResponse(reregisterBlockManager = true) + } + val reportHeartbeat = PrivateMethod[Unit](Symbol("reportHeartBeat")) + executor.invokePrivate(reportHeartbeat()) + assert(reregisterInvoked.get(), "BlockManager.reregister should be invoked " + + "on HeartbeatResponse(reregisterBlockManager = true) when executor is not shutting down") + + reregisterInvoked.getAndSet(false) + executor.stop() + executor.invokePrivate(reportHeartbeat()) + assert(!reregisterInvoked.get(), + "BlockManager.reregister should not be invoked when executor is shutting down") + } + } + } + + test("SPARK-33587: isFatalError") { + def errorInThreadPool(e: => Throwable): Throwable = { + intercept[Throwable] { + val taskPool = ThreadUtils.newDaemonFixedThreadPool(1, "test") + try { + val f = taskPool.submit(new java.util.concurrent.Callable[String] { + override def call(): String = throw e + }) + f.get() + } finally { + taskPool.shutdown() + } + } + } + + def errorInGuavaCache(e: => Throwable): Throwable = { + val cache = CacheBuilder.newBuilder() + .build(new CacheLoader[String, String] { + override def load(key: String): String = throw e + }) + intercept[Throwable] { + cache.get("test") + } + } + + def testThrowable( + e: => Throwable, + depthToCheck: Int, + isFatal: Boolean): Unit = { + import Executor.isFatalError + // `e`'s depth is 1 so `depthToCheck` needs to be at least 3 to detect fatal errors. + assert(isFatalError(e, depthToCheck) == (depthToCheck >= 1 && isFatal)) + // `e`'s depth is 2 so `depthToCheck` needs to be at least 3 to detect fatal errors. + assert(isFatalError(errorInThreadPool(e), depthToCheck) == (depthToCheck >= 2 && isFatal)) + assert(isFatalError(errorInGuavaCache(e), depthToCheck) == (depthToCheck >= 2 && isFatal)) + assert(isFatalError( + new SparkException("foo", e), + depthToCheck) == (depthToCheck >= 2 && isFatal)) + // `e`'s depth is 3 so `depthToCheck` needs to be at least 3 to detect fatal errors. + assert(isFatalError( + errorInThreadPool(errorInGuavaCache(e)), + depthToCheck) == (depthToCheck >= 3 && isFatal)) + assert(isFatalError( + errorInGuavaCache(errorInThreadPool(e)), + depthToCheck) == (depthToCheck >= 3 && isFatal)) + assert(isFatalError( + new SparkException("foo", new SparkException("foo", e)), + depthToCheck) == (depthToCheck >= 3 && isFatal)) + } + + for (depthToCheck <- 0 to 5) { + testThrowable(new OutOfMemoryError(), depthToCheck, isFatal = true) + testThrowable(new InterruptedException(), depthToCheck, isFatal = false) + testThrowable(new RuntimeException("test"), depthToCheck, isFatal = false) + testThrowable(new SparkOutOfMemoryError("test"), depthToCheck, isFatal = false) + } + + // Verify we can handle the cycle in the exception chain + val e1 = new Exception("test1") + val e2 = new Exception("test2") + e1.initCause(e2) + e2.initCause(e1) + for (depthToCheck <- 0 to 5) { + testThrowable(e1, depthToCheck, isFatal = false) + testThrowable(e2, depthToCheck, isFatal = false) + } + } + private def createMockEnv(conf: SparkConf, serializer: JavaSerializer): SparkEnv = { val mockEnv = mock[SparkEnv] val mockRpcEnv = mock[RpcEnv] @@ -450,6 +568,7 @@ class ExecutorSuite extends SparkFunSuite partitionId = 0, addedFiles = Map[String, Long](), addedJars = Map[String, Long](), + addedArchives = Map[String, Long](), properties = new Properties, resources = immutable.Map[String, ResourceInformation](), serializedTask) @@ -465,12 +584,11 @@ class ExecutorSuite extends SparkFunSuite poll: Boolean = false): (TaskFailedReason, UncaughtExceptionHandler) = { val mockBackend = mock[ExecutorBackend] val mockUncaughtExceptionHandler = mock[UncaughtExceptionHandler] - var executor: Executor = null val timedOut = new AtomicBoolean(false) - try { - executor = new Executor("id", "localhost", SparkEnv.get, userClassPath = Nil, isLocal = true, - uncaughtExceptionHandler = mockUncaughtExceptionHandler, - resources = immutable.Map.empty[String, ResourceInformation]) + + withExecutor("id", "localhost", SparkEnv.get, + uncaughtExceptionHandler = mockUncaughtExceptionHandler) { executor => + // the task will be launched in a dedicated worker thread executor.launchTask(mockBackend, taskDescription) if (killTask) { @@ -483,7 +601,7 @@ class ExecutorSuite extends SparkFunSuite if (poll) { executor.metricsPoller.poll() } - executor.killAllTasks(true, "Killed task, eg. because of speculative execution") + executor.killAllTasks(true, "Killed task, e.g. because of speculative execution") } else { timedOut.set(true) } @@ -503,11 +621,8 @@ class ExecutorSuite extends SparkFunSuite assert(executor.numRunningTasks === 0) } assert(!timedOut.get(), "timed out waiting to be ready to kill tasks") - } finally { - if (executor != null) { - executor.stop() - } } + val orderedMock = inOrder(mockBackend) val statusCaptor = ArgumentCaptor.forClass(classOf[ByteBuffer]) orderedMock.verify(mockBackend) diff --git a/core/src/test/scala/org/apache/spark/executor/ProcfsMetricsGetterSuite.scala b/core/src/test/scala/org/apache/spark/executor/ProcfsMetricsGetterSuite.scala index 9836697e1647c..ff0374da1bcfe 100644 --- a/core/src/test/scala/org/apache/spark/executor/ProcfsMetricsGetterSuite.scala +++ b/core/src/test/scala/org/apache/spark/executor/ProcfsMetricsGetterSuite.scala @@ -17,6 +17,8 @@ package org.apache.spark.executor +import org.mockito.Mockito.{spy, when} + import org.apache.spark.SparkFunSuite @@ -38,4 +40,26 @@ class ProcfsMetricsGetterSuite extends SparkFunSuite { assert(r.jvmVmemTotal == 4769947648L) assert(r.jvmRSSTotal == 262610944) } + + test("SPARK-34845: partial metrics shouldn't be returned") { + val p = new ProcfsMetricsGetter(getTestResourcePath("ProcfsMetrics")) + val mockedP = spy(p) + + var ptree: Set[Int] = Set(26109, 22763) + when(mockedP.computeProcessTree).thenReturn(ptree) + var r = mockedP.computeAllMetrics + assert(r.jvmVmemTotal == 4769947648L) + assert(r.jvmRSSTotal == 262610944) + assert(r.pythonVmemTotal == 360595456) + assert(r.pythonRSSTotal == 7831552) + + // proc file of pid 22764 doesn't exist, so partial metrics shouldn't be returned + ptree = Set(26109, 22764, 22763) + when(mockedP.computeProcessTree).thenReturn(ptree) + r = mockedP.computeAllMetrics + assert(r.jvmVmemTotal == 0) + assert(r.jvmRSSTotal == 0) + assert(r.pythonVmemTotal == 0) + assert(r.pythonRSSTotal == 0) + } } diff --git a/core/src/test/scala/org/apache/spark/input/WholeTextFileRecordReaderSuite.scala b/core/src/test/scala/org/apache/spark/input/WholeTextFileRecordReaderSuite.scala index fab7aea6c47aa..f1d7053c34594 100644 --- a/core/src/test/scala/org/apache/spark/input/WholeTextFileRecordReaderSuite.scala +++ b/core/src/test/scala/org/apache/spark/input/WholeTextFileRecordReaderSuite.scala @@ -29,7 +29,6 @@ import org.scalatest.BeforeAndAfterAll import org.apache.spark.{SparkConf, SparkContext, SparkFunSuite} import org.apache.spark.internal.Logging -import org.apache.spark.util.Utils /** * Tests the correctness of diff --git a/core/src/test/scala/org/apache/spark/internal/io/FileCommitProtocolInstantiationSuite.scala b/core/src/test/scala/org/apache/spark/internal/io/FileCommitProtocolInstantiationSuite.scala index 2bd32fc927e21..778f748f83950 100644 --- a/core/src/test/scala/org/apache/spark/internal/io/FileCommitProtocolInstantiationSuite.scala +++ b/core/src/test/scala/org/apache/spark/internal/io/FileCommitProtocolInstantiationSuite.scala @@ -75,7 +75,7 @@ class FileCommitProtocolInstantiationSuite extends SparkFunSuite { /** * Create a classic two-arg protocol instance. - * @param dynamic dyanmic partitioning mode + * @param dynamic dynamic partitioning mode * @return the instance */ private def instantiateClassic(dynamic: Boolean): ClassicConstructorCommitProtocol = { @@ -88,7 +88,7 @@ class FileCommitProtocolInstantiationSuite extends SparkFunSuite { /** * Create a three-arg protocol instance. - * @param dynamic dyanmic partitioning mode + * @param dynamic dynamic partitioning mode * @return the instance */ private def instantiateNew( diff --git a/core/src/test/scala/org/apache/spark/internal/io/SparkHadoopWriterUtilsSuite.scala b/core/src/test/scala/org/apache/spark/internal/io/SparkHadoopWriterUtilsSuite.scala new file mode 100644 index 0000000000000..33b58ec9e6665 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/internal/io/SparkHadoopWriterUtilsSuite.scala @@ -0,0 +1,102 @@ +/* + * 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. + */ + +package org.apache.spark.internal.io + +import java.util.Date + +import org.apache.hadoop.mapreduce.JobID + +import org.apache.spark.SparkFunSuite +import org.apache.spark.internal.io.SparkHadoopWriterUtils.createJobID + +/** + * Unit tests for functions in SparkHadoopWriterUtils. + */ +class SparkHadoopWriterUtilsSuite extends SparkFunSuite { + + /** + * Core test of JobID generation: + * They are created. + * The job number is converted to the job ID. + * They round trip to string and back + * (which implies that the full string matches the regexp + * in the JobID class). + */ + test("JobID Generation") { + val jobNumber = 1010 + val j1 = createJobID(new Date(), jobNumber) + assert(jobNumber == j1.getId, + s"Job number mismatch in $j1") + + val jobStr = j1.toString + // the string value begins with job_ + assert(jobStr.startsWith("job_"), + s"wrong prefix of $jobStr") + // and the hadoop code can parse it + val j2 = roundTrip(j1) + assert(j1.getId == j2.getId, "Job ID mismatch") + assert(j1.getJtIdentifier == j2.getJtIdentifier, "Job identifier mismatch") + } + + /** + * This is the problem surfacing in situations where committers expect + * Job IDs to be unique: if the timestamp is (exclusively) used + * then there will conflict in directories created. + */ + test("JobIDs generated at same time are different") { + val now = new Date() + val j1 = createJobID(now, 1) + val j2 = createJobID(now, 1) + assert(j1.toString != j2.toString) + } + + /** + * There's nothing explicitly in the Hadoop classes to stop + * job numbers being negative. + * There's some big assumptions in the FileOutputCommitter about attempt IDs + * being positive during any recovery operations; for safety the ID + * job number is validated. + */ + test("JobIDs with negative job number") { + intercept[IllegalArgumentException] { + createJobID(new Date(), -1) + } + } + + /** + * If someone ever does reinstate use of timestamps, + * make sure that the case of timestamp == 0 is handled. + */ + test("JobIDs on Epoch are different") { + val j1 = createJobID(new Date(0), 0) + val j2 = createJobID(new Date(0), 0) + assert (j1.toString != j2.toString) + } + + /** + * Do a round trip as a string and back again. + * This uses the JobID parser. + * @param jobID job ID + * @return the returned jobID + */ + private def roundTrip(jobID: JobID): JobID = { + val parsedJobId = JobID.forName(jobID.toString) + assert(jobID == parsedJobId, "Round trip was inconsistent") + parsedJobId + } +} diff --git a/core/src/test/scala/org/apache/spark/internal/plugin/PluginContainerSuite.scala b/core/src/test/scala/org/apache/spark/internal/plugin/PluginContainerSuite.scala index 7888796dd55e6..9ef81d30ff196 100644 --- a/core/src/test/scala/org/apache/spark/internal/plugin/PluginContainerSuite.scala +++ b/core/src/test/scala/org/apache/spark/internal/plugin/PluginContainerSuite.scala @@ -20,6 +20,7 @@ package org.apache.spark.internal.plugin import java.io.File import java.nio.charset.StandardCharsets import java.util.{Map => JMap} +import java.util.concurrent.atomic.AtomicInteger import scala.collection.JavaConverters._ import scala.concurrent.duration._ @@ -129,6 +130,40 @@ class PluginContainerSuite extends SparkFunSuite with BeforeAndAfterEach with Lo assert(TestSparkPlugin.driverPlugin != null) } + test("SPARK-33088: executor tasks trigger plugin calls") { + val conf = new SparkConf() + .setAppName(getClass().getName()) + .set(SparkLauncher.SPARK_MASTER, "local[1]") + .set(PLUGINS, Seq(classOf[TestSparkPlugin].getName())) + + sc = new SparkContext(conf) + sc.parallelize(1 to 10, 2).count() + + assert(TestSparkPlugin.executorPlugin.numOnTaskStart.get() == 2) + assert(TestSparkPlugin.executorPlugin.numOnTaskSucceeded.get() == 2) + assert(TestSparkPlugin.executorPlugin.numOnTaskFailed.get() == 0) + } + + test("SPARK-33088: executor failed tasks trigger plugin calls") { + val conf = new SparkConf() + .setAppName(getClass().getName()) + .set(SparkLauncher.SPARK_MASTER, "local[2]") + .set(PLUGINS, Seq(classOf[TestSparkPlugin].getName())) + + sc = new SparkContext(conf) + try { + sc.parallelize(1 to 10, 2).foreach(i => throw new RuntimeException) + } catch { + case t: Throwable => // ignore exception + } + + eventually(timeout(10.seconds), interval(100.millis)) { + assert(TestSparkPlugin.executorPlugin.numOnTaskStart.get() == 2) + assert(TestSparkPlugin.executorPlugin.numOnTaskSucceeded.get() == 0) + assert(TestSparkPlugin.executorPlugin.numOnTaskFailed.get() == 2) + } + } + test("plugin initialization in non-local mode") { val path = Utils.createTempDir() @@ -309,6 +344,10 @@ private class TestDriverPlugin extends DriverPlugin { private class TestExecutorPlugin extends ExecutorPlugin { + val numOnTaskStart = new AtomicInteger(0) + val numOnTaskSucceeded = new AtomicInteger(0) + val numOnTaskFailed = new AtomicInteger(0) + override def init(ctx: PluginContext, extraConf: JMap[String, String]): Unit = { ctx.metricRegistry().register("executorMetric", new Gauge[Int] { override def getValue(): Int = 84 @@ -316,6 +355,17 @@ private class TestExecutorPlugin extends ExecutorPlugin { TestSparkPlugin.executorContext = ctx } + override def onTaskStart(): Unit = { + numOnTaskStart.incrementAndGet() + } + + override def onTaskSucceeded(): Unit = { + numOnTaskSucceeded.incrementAndGet() + } + + override def onTaskFailed(failureReason: TaskFailedReason): Unit = { + numOnTaskFailed.incrementAndGet() + } } private object TestSparkPlugin { diff --git a/core/src/test/scala/org/apache/spark/io/CompressionCodecSuite.scala b/core/src/test/scala/org/apache/spark/io/CompressionCodecSuite.scala index 4b27396e6ae05..18520ff96a599 100644 --- a/core/src/test/scala/org/apache/spark/io/CompressionCodecSuite.scala +++ b/core/src/test/scala/org/apache/spark/io/CompressionCodecSuite.scala @@ -22,6 +22,7 @@ import java.io.{ByteArrayInputStream, ByteArrayOutputStream} import com.google.common.io.ByteStreams import org.apache.spark.{SparkConf, SparkFunSuite} +import org.apache.spark.internal.config.IO_COMPRESSION_ZSTD_BUFFERPOOL_ENABLED class CompressionCodecSuite extends SparkFunSuite { val conf = new SparkConf(false) @@ -105,9 +106,12 @@ class CompressionCodecSuite extends SparkFunSuite { } test("zstd compression codec") { - val codec = CompressionCodec.createCodec(conf, classOf[ZStdCompressionCodec].getName) - assert(codec.getClass === classOf[ZStdCompressionCodec]) - testCodec(codec) + Seq("true", "false").foreach { flag => + val conf = new SparkConf(false).set(IO_COMPRESSION_ZSTD_BUFFERPOOL_ENABLED.key, flag) + val codec = CompressionCodec.createCodec(conf, classOf[ZStdCompressionCodec].getName) + assert(codec.getClass === classOf[ZStdCompressionCodec]) + testCodec(codec) + } } test("zstd compression codec short form") { diff --git a/core/src/test/scala/org/apache/spark/io/ZStandardBenchmark.scala b/core/src/test/scala/org/apache/spark/io/ZStandardBenchmark.scala new file mode 100644 index 0000000000000..62a3d48d2ec16 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/io/ZStandardBenchmark.scala @@ -0,0 +1,104 @@ +/* + * 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. + */ + +package org.apache.spark.io + +import java.io.{ByteArrayInputStream, ByteArrayOutputStream} + +import org.apache.spark.SparkConf +import org.apache.spark.benchmark.{Benchmark, BenchmarkBase} +import org.apache.spark.internal.config.{IO_COMPRESSION_ZSTD_BUFFERPOOL_ENABLED, IO_COMPRESSION_ZSTD_BUFFERSIZE, IO_COMPRESSION_ZSTD_LEVEL} + + +/** + * Benchmark for ZStandard codec performance. + * {{{ + * To run this benchmark: + * 1. without sbt: bin/spark-submit --class + * 2. build/sbt "core/test:runMain " + * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "core/test:runMain " + * Results will be written to "benchmarks/ZStandardBenchmark-results.txt". + * }}} + */ +object ZStandardBenchmark extends BenchmarkBase { + + val N = 10000 + val numInteger = IO_COMPRESSION_ZSTD_BUFFERSIZE.defaultValue.get.toInt / 4 + + override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { + val name = "Benchmark ZStandardCompressionCodec" + runBenchmark(name) { + val benchmark1 = new Benchmark(name, N, output = output) + compressionBenchmark(benchmark1, N) + benchmark1.run() + + val benchmark2 = new Benchmark(name, N, output = output) + decompressionBenchmark(benchmark2, N) + benchmark2.run() + } + } + + private def compressionBenchmark(benchmark: Benchmark, N: Int): Unit = { + Seq(false, true).foreach { enablePool => + Seq(1, 2, 3).foreach { level => + val conf = new SparkConf(false) + .set(IO_COMPRESSION_ZSTD_BUFFERPOOL_ENABLED, enablePool) + .set(IO_COMPRESSION_ZSTD_LEVEL, level) + val condition = if (enablePool) "with" else "without" + benchmark.addCase(s"Compression $N times at level $level $condition buffer pool") { _ => + (1 until N).foreach { _ => + val os = new ZStdCompressionCodec(conf) + .compressedOutputStream(new ByteArrayOutputStream()) + for (i <- 1 until numInteger) { + os.write(i) + } + os.close() + } + } + } + } + } + + private def decompressionBenchmark(benchmark: Benchmark, N: Int): Unit = { + Seq(false, true).foreach { enablePool => + Seq(1, 2, 3).foreach { level => + val conf = new SparkConf(false) + .set(IO_COMPRESSION_ZSTD_BUFFERPOOL_ENABLED, enablePool) + .set(IO_COMPRESSION_ZSTD_LEVEL, level) + val outputStream = new ByteArrayOutputStream() + val out = new ZStdCompressionCodec(conf).compressedOutputStream(outputStream) + for (i <- 1 until numInteger) { + out.write(i) + } + out.close() + val bytes = outputStream.toByteArray + + val condition = if (enablePool) "with" else "without" + benchmark.addCase(s"Decompression $N times from level $level $condition buffer pool") { _ => + (1 until N).foreach { _ => + val bais = new ByteArrayInputStream(bytes) + val is = new ZStdCompressionCodec(conf).compressedInputStream(bais) + for (i <- 1 until numInteger) { + is.read() + } + is.close() + } + } + } + } + } +} diff --git a/core/src/test/scala/org/apache/spark/launcher/LauncherBackendSuite.scala b/core/src/test/scala/org/apache/spark/launcher/LauncherBackendSuite.scala index edec968d0745a..473782ee28d1c 100644 --- a/core/src/test/scala/org/apache/spark/launcher/LauncherBackendSuite.scala +++ b/core/src/test/scala/org/apache/spark/launcher/LauncherBackendSuite.scala @@ -21,8 +21,9 @@ import java.util.concurrent.TimeUnit import scala.concurrent.duration._ -import org.scalatest.Matchers import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark._ import org.apache.spark.internal.config.UI.UI_ENABLED diff --git a/core/src/test/scala/org/apache/spark/memory/TestMemoryManager.scala b/core/src/test/scala/org/apache/spark/memory/TestMemoryManager.scala index 60f67699f81be..987f383c9c4fa 100644 --- a/core/src/test/scala/org/apache/spark/memory/TestMemoryManager.scala +++ b/core/src/test/scala/org/apache/spark/memory/TestMemoryManager.scala @@ -119,6 +119,14 @@ class TestMemoryManager(conf: SparkConf) consequentOOM += n } + /** + * Undos the effects of [[markExecutionAsOutOfMemoryOnce]] and [[markconsequentOOM]] and lets + * calls to [[acquireExecutionMemory()]] (if there is enough memory available). + */ + def resetConsequentOOM(): Unit = synchronized { + consequentOOM = 0 + } + def limit(avail: Long): Unit = synchronized { require(avail >= 0) available = avail diff --git a/core/src/test/scala/org/apache/spark/metrics/InputOutputMetricsSuite.scala b/core/src/test/scala/org/apache/spark/metrics/InputOutputMetricsSuite.scala index 330347299ab56..905bb8110736d 100644 --- a/core/src/test/scala/org/apache/spark/metrics/InputOutputMetricsSuite.scala +++ b/core/src/test/scala/org/apache/spark/metrics/InputOutputMetricsSuite.scala @@ -213,7 +213,7 @@ class InputOutputMetricsSuite extends SparkFunSuite with SharedSparkContext } // Computing the amount of bytes read for a cartesian operation is a little involved. - // Cartesian interleaves reads between two partitions eg. p1 and p2. + // Cartesian interleaves reads between two partitions e.g. p1 and p2. // Here are the steps: // 1) First it creates an iterator for p1 // 2) Creates an iterator for p2 diff --git a/core/src/test/scala/org/apache/spark/metrics/MetricsSystemSuite.scala b/core/src/test/scala/org/apache/spark/metrics/MetricsSystemSuite.scala index 70b6c9a112142..31d8492510f06 100644 --- a/core/src/test/scala/org/apache/spark/metrics/MetricsSystemSuite.scala +++ b/core/src/test/scala/org/apache/spark/metrics/MetricsSystemSuite.scala @@ -40,7 +40,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM } test("MetricsSystem with default config") { - val metricsSystem = MetricsSystem.createMetricsSystem("default", conf, securityMgr) + val metricsSystem = MetricsSystem.createMetricsSystem("default", conf) metricsSystem.start() val sources = PrivateMethod[ArrayBuffer[Source]](Symbol("sources")) val sinks = PrivateMethod[ArrayBuffer[Sink]](Symbol("sinks")) @@ -51,7 +51,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM } test("MetricsSystem with sources add") { - val metricsSystem = MetricsSystem.createMetricsSystem("test", conf, securityMgr) + val metricsSystem = MetricsSystem.createMetricsSystem("test", conf) metricsSystem.start() val sources = PrivateMethod[ArrayBuffer[Source]](Symbol("sources")) val sinks = PrivateMethod[ArrayBuffer[Sink]](Symbol("sinks")) @@ -77,7 +77,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM conf.set("spark.executor.id", executorId) val instanceName = MetricsSystemInstances.DRIVER - val driverMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf, securityMgr) + val driverMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf) val metricName = driverMetricsSystem.buildRegistryName(source) assert(metricName === s"$appId.$executorId.${source.sourceName}") @@ -93,7 +93,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM conf.set("spark.executor.id", executorId) val instanceName = MetricsSystemInstances.DRIVER - val driverMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf, securityMgr) + val driverMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf) val metricName = driverMetricsSystem.buildRegistryName(source) assert(metricName === source.sourceName) @@ -109,7 +109,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM conf.set("spark.app.id", appId) val instanceName = MetricsSystemInstances.DRIVER - val driverMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf, securityMgr) + val driverMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf) val metricName = driverMetricsSystem.buildRegistryName(source) assert(metricName === source.sourceName) @@ -127,7 +127,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM conf.set("spark.executor.id", executorId) val instanceName = MetricsSystemInstances.EXECUTOR - val executorMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf, securityMgr) + val executorMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf) val metricName = executorMetricsSystem.buildRegistryName(source) assert(metricName === s"$appId.$executorId.${source.sourceName}") @@ -143,7 +143,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM conf.set("spark.executor.id", executorId) val instanceName = MetricsSystemInstances.EXECUTOR - val executorMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf, securityMgr) + val executorMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf) val metricName = executorMetricsSystem.buildRegistryName(source) assert(metricName === source.sourceName) @@ -159,7 +159,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM conf.set("spark.app.id", appId) val instanceName = MetricsSystemInstances.EXECUTOR - val executorMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf, securityMgr) + val executorMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf) val metricName = executorMetricsSystem.buildRegistryName(source) assert(metricName === source.sourceName) @@ -177,7 +177,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM conf.set("spark.executor.id", executorId) val instanceName = "testInstance" - val testMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf, securityMgr) + val testMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf) val metricName = testMetricsSystem.buildRegistryName(source) @@ -201,7 +201,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM conf.set(METRICS_NAMESPACE, "${spark.app.name}") val instanceName = MetricsSystemInstances.EXECUTOR - val executorMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf, securityMgr) + val executorMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf) val metricName = executorMetricsSystem.buildRegistryName(source) assert(metricName === s"$appName.$executorId.${source.sourceName}") @@ -219,7 +219,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM conf.set(METRICS_NAMESPACE, namespaceToResolve) val instanceName = MetricsSystemInstances.EXECUTOR - val executorMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf, securityMgr) + val executorMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf) val metricName = executorMetricsSystem.buildRegistryName(source) // If the user set the spark.metrics.namespace property to an expansion of another property @@ -239,7 +239,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM conf.set(METRICS_NAMESPACE, "${spark.app.name}") val instanceName = MetricsSystemInstances.EXECUTOR - val executorMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf, securityMgr) + val executorMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf) val metricName = executorMetricsSystem.buildRegistryName(source) assert(metricName === source.sourceName) @@ -260,7 +260,7 @@ class MetricsSystemSuite extends SparkFunSuite with BeforeAndAfter with PrivateM conf.set("spark.executor.id", executorId) val instanceName = "testInstance" - val testMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf, securityMgr) + val testMetricsSystem = MetricsSystem.createMetricsSystem(instanceName, conf) val metricName = testMetricsSystem.buildRegistryName(source) diff --git a/core/src/test/scala/org/apache/spark/metrics/sink/GraphiteSinkSuite.scala b/core/src/test/scala/org/apache/spark/metrics/sink/GraphiteSinkSuite.scala index 2369218830215..cf34121fe73dc 100644 --- a/core/src/test/scala/org/apache/spark/metrics/sink/GraphiteSinkSuite.scala +++ b/core/src/test/scala/org/apache/spark/metrics/sink/GraphiteSinkSuite.scala @@ -23,7 +23,7 @@ import scala.collection.JavaConverters._ import com.codahale.metrics._ -import org.apache.spark.{SecurityManager, SparkConf, SparkFunSuite} +import org.apache.spark.SparkFunSuite class GraphiteSinkSuite extends SparkFunSuite { @@ -32,9 +32,8 @@ class GraphiteSinkSuite extends SparkFunSuite { props.put("host", "127.0.0.1") props.put("port", "54321") val registry = new MetricRegistry - val securityMgr = new SecurityManager(new SparkConf(false)) - val sink = new GraphiteSink(props, registry, securityMgr) + val sink = new GraphiteSink(props, registry) val gauge = new Gauge[Double] { override def getValue: Double = 1.23 @@ -55,9 +54,8 @@ class GraphiteSinkSuite extends SparkFunSuite { props.put("port", "54321") props.put("regex", "local-[0-9]+.driver.(CodeGenerator|BlockManager)") val registry = new MetricRegistry - val securityMgr = new SecurityManager(new SparkConf(false)) - val sink = new GraphiteSink(props, registry, securityMgr) + val sink = new GraphiteSink(props, registry) val gauge = new Gauge[Double] { override def getValue: Double = 1.23 diff --git a/core/src/test/scala/org/apache/spark/metrics/sink/PrometheusServletSuite.scala b/core/src/test/scala/org/apache/spark/metrics/sink/PrometheusServletSuite.scala new file mode 100644 index 0000000000000..4b5b41c14a21e --- /dev/null +++ b/core/src/test/scala/org/apache/spark/metrics/sink/PrometheusServletSuite.scala @@ -0,0 +1,73 @@ +/* + * 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. + */ + +package org.apache.spark.metrics.sink + +import java.util.Properties + +import scala.collection.JavaConverters._ + +import com.codahale.metrics.{Counter, Gauge, MetricRegistry} +import org.scalatest.PrivateMethodTester + +import org.apache.spark.SparkFunSuite + +class PrometheusServletSuite extends SparkFunSuite with PrivateMethodTester { + + test("register metrics") { + val sink = createPrometheusServlet() + + val gauge = new Gauge[Double] { + override def getValue: Double = 5.0 + } + + val counter = new Counter + counter.inc(10) + + sink.registry.register("gauge1", gauge) + sink.registry.register("gauge2", gauge) + sink.registry.register("counter1", counter) + + val metricGaugeKeys = sink.registry.getGauges.keySet.asScala + assert(metricGaugeKeys.equals(Set("gauge1", "gauge2")), + "Should contain 2 gauges metrics registered") + + val metricCounterKeys = sink.registry.getCounters.keySet.asScala + assert(metricCounterKeys.equals(Set("counter1")), + "Should contain 1 counter metric registered") + + val gaugeValues = sink.registry.getGauges.values.asScala + assert(gaugeValues.size == 2) + gaugeValues.foreach(gauge => assert(gauge.getValue == 5.0)) + + val counterValues = sink.registry.getCounters.values.asScala + assert(counterValues.size == 1) + counterValues.foreach(counter => assert(counter.getCount == 10)) + } + + test("normalize key") { + val key = "local-1592132938718.driver.LiveListenerBus." + + "listenerProcessingTime.org.apache.spark.HeartbeatReceiver" + val sink = createPrometheusServlet() + val suffix = sink invokePrivate PrivateMethod[String]('normalizeKey)(key) + assert(suffix == "metrics_local_1592132938718_driver_LiveListenerBus_" + + "listenerProcessingTime_org_apache_spark_HeartbeatReceiver_") + } + + private def createPrometheusServlet(): PrometheusServlet = + new PrometheusServlet(new Properties, new MetricRegistry) +} diff --git a/core/src/test/scala/org/apache/spark/metrics/sink/StatsdSinkSuite.scala b/core/src/test/scala/org/apache/spark/metrics/sink/StatsdSinkSuite.scala index 0e21a36071c42..ff883633d5e7a 100644 --- a/core/src/test/scala/org/apache/spark/metrics/sink/StatsdSinkSuite.scala +++ b/core/src/test/scala/org/apache/spark/metrics/sink/StatsdSinkSuite.scala @@ -24,29 +24,43 @@ import java.util.concurrent.TimeUnit._ import com.codahale.metrics._ -import org.apache.spark.{SecurityManager, SparkConf, SparkFunSuite} +import org.apache.spark.SparkFunSuite import org.apache.spark.metrics.sink.StatsdSink._ class StatsdSinkSuite extends SparkFunSuite { - private val securityMgr = new SecurityManager(new SparkConf(false)) private val defaultProps = Map( STATSD_KEY_PREFIX -> "spark", STATSD_KEY_PERIOD -> "1", STATSD_KEY_UNIT -> "seconds", STATSD_KEY_HOST -> "127.0.0.1" ) - private val socketTimeout = 30000 // milliseconds - private val socketBufferSize = 8192 + // The maximum size of a single datagram packet payload. Payloads + // larger than this will be truncated. + private val maxPayloadSize = 256 // bytes + + // The receive buffer must be large enough to hold all inflight + // packets. This includes any kernel and protocol overhead. + // This value was determined experimentally and should be + // increased if timeouts are seen. + private val socketMinRecvBufferSize = 16384 // bytes + private val socketTimeout = 30000 // milliseconds private def withSocketAndSink(testCode: (DatagramSocket, StatsdSink) => Any): Unit = { val socket = new DatagramSocket - socket.setReceiveBufferSize(socketBufferSize) + + // Leave the receive buffer size untouched unless it is too + // small. If the receive buffer is too small packets will be + // silently dropped and receive operations will timeout. + if (socket.getReceiveBufferSize() < socketMinRecvBufferSize) { + socket.setReceiveBufferSize(socketMinRecvBufferSize) + } + socket.setSoTimeout(socketTimeout) val props = new Properties defaultProps.foreach(e => props.put(e._1, e._2)) props.put(STATSD_KEY_PORT, socket.getLocalPort.toString) val registry = new MetricRegistry - val sink = new StatsdSink(props, registry, securityMgr) + val sink = new StatsdSink(props, registry) try { testCode(socket, sink) } finally { @@ -61,7 +75,7 @@ class StatsdSinkSuite extends SparkFunSuite { sink.registry.register("counter", counter) sink.report() - val p = new DatagramPacket(new Array[Byte](socketBufferSize), socketBufferSize) + val p = new DatagramPacket(new Array[Byte](maxPayloadSize), maxPayloadSize) socket.receive(p) val result = new String(p.getData, 0, p.getLength, UTF_8) @@ -77,7 +91,7 @@ class StatsdSinkSuite extends SparkFunSuite { sink.registry.register("gauge", gauge) sink.report() - val p = new DatagramPacket(new Array[Byte](socketBufferSize), socketBufferSize) + val p = new DatagramPacket(new Array[Byte](maxPayloadSize), maxPayloadSize) socket.receive(p) val result = new String(p.getData, 0, p.getLength, UTF_8) @@ -87,7 +101,7 @@ class StatsdSinkSuite extends SparkFunSuite { test("metrics StatsD sink with Histogram") { withSocketAndSink { (socket, sink) => - val p = new DatagramPacket(new Array[Byte](socketBufferSize), socketBufferSize) + val p = new DatagramPacket(new Array[Byte](maxPayloadSize), maxPayloadSize) val histogram = new Histogram(new UniformReservoir) histogram.update(10) histogram.update(20) @@ -121,7 +135,7 @@ class StatsdSinkSuite extends SparkFunSuite { test("metrics StatsD sink with Timer") { withSocketAndSink { (socket, sink) => - val p = new DatagramPacket(new Array[Byte](socketBufferSize), socketBufferSize) + val p = new DatagramPacket(new Array[Byte](maxPayloadSize), maxPayloadSize) val timer = new Timer() timer.update(1, SECONDS) timer.update(2, SECONDS) diff --git a/core/src/test/scala/org/apache/spark/metrics/source/SourceConfigSuite.scala b/core/src/test/scala/org/apache/spark/metrics/source/SourceConfigSuite.scala index 8f5ab7419d4f7..7da1403ecd4b5 100644 --- a/core/src/test/scala/org/apache/spark/metrics/source/SourceConfigSuite.scala +++ b/core/src/test/scala/org/apache/spark/metrics/source/SourceConfigSuite.scala @@ -80,4 +80,16 @@ class SourceConfigSuite extends SparkFunSuite with LocalSparkContext { } } + test("SPARK-31711: Test executor source registration in local mode") { + val conf = new SparkConf() + val sc = new SparkContext("local", "test", conf) + try { + val metricsSystem = sc.env.metricsSystem + + // Executor source should be registered + assert (metricsSystem.getSourcesByName("executor").nonEmpty) + } finally { + sc.stop() + } + } } diff --git a/core/src/test/scala/org/apache/spark/network/netty/NettyBlockTransferSecuritySuite.scala b/core/src/test/scala/org/apache/spark/network/netty/NettyBlockTransferSecuritySuite.scala index c726329ce8a84..13bb811b840d5 100644 --- a/core/src/test/scala/org/apache/spark/network/netty/NettyBlockTransferSecuritySuite.scala +++ b/core/src/test/scala/org/apache/spark/network/netty/NettyBlockTransferSecuritySuite.scala @@ -28,7 +28,8 @@ import scala.util.{Failure, Success, Try} import com.google.common.io.CharStreams import org.mockito.Mockito._ -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.scalatestplus.mockito.MockitoSugar import org.apache.spark.{SecurityManager, SparkConf, SparkFunSuite} diff --git a/core/src/test/scala/org/apache/spark/network/netty/NettyBlockTransferServiceSuite.scala b/core/src/test/scala/org/apache/spark/network/netty/NettyBlockTransferServiceSuite.scala index c804102e4ab2c..c8a8f37212a82 100644 --- a/core/src/test/scala/org/apache/spark/network/netty/NettyBlockTransferServiceSuite.scala +++ b/core/src/test/scala/org/apache/spark/network/netty/NettyBlockTransferServiceSuite.scala @@ -24,8 +24,10 @@ import scala.reflect.ClassTag import scala.util.Random import org.mockito.ArgumentMatchers.any -import org.mockito.Mockito.{mock, times, verify, when} -import org.scalatest._ +import org.mockito.Mockito.{mock, when} +import org.scalatest.BeforeAndAfterEach +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.{ExecutorDeadException, SecurityManager, SparkConf, SparkFunSuite} import org.apache.spark.network.BlockDataManager @@ -86,7 +88,7 @@ class NettyBlockTransferServiceSuite } test("SPARK-27637: test fetch block with executor dead") { - implicit val exectionContext = ExecutionContext.global + implicit val executionContext = ExecutionContext.global val port = 17634 + Random.nextInt(10000) logInfo("random port for test: " + port) @@ -116,8 +118,8 @@ class NettyBlockTransferServiceSuite .thenAnswer(_ => {hitExecutorDeadException = true}) service0 = createService(port, driverEndpointRef) - val clientFactoryField = service0.getClass.getField( - "org$apache$spark$network$netty$NettyBlockTransferService$$clientFactory") + val clientFactoryField = service0.getClass + .getSuperclass.getSuperclass.getDeclaredField("clientFactory") clientFactoryField.setAccessible(true) clientFactoryField.set(service0, clientFactory) diff --git a/core/src/test/scala/org/apache/spark/rdd/CoalescedRDDBenchmark.scala b/core/src/test/scala/org/apache/spark/rdd/CoalescedRDDBenchmark.scala index 617ca5a1a8bc4..b622e0b1d6e1c 100644 --- a/core/src/test/scala/org/apache/spark/rdd/CoalescedRDDBenchmark.scala +++ b/core/src/test/scala/org/apache/spark/rdd/CoalescedRDDBenchmark.scala @@ -29,7 +29,7 @@ import org.apache.spark.benchmark.{Benchmark, BenchmarkBase} * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class * 2. build/sbt "core/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "core/test:runMain " @@ -78,4 +78,10 @@ object CoalescedRDDBenchmark extends BenchmarkBase { coalescedRDD(numIters) } } + + override def afterAll(): Unit = { + if (sc != null) { + sc.stop() + } + } } diff --git a/core/src/test/scala/org/apache/spark/rdd/JdbcRDDSuite.scala b/core/src/test/scala/org/apache/spark/rdd/JdbcRDDSuite.scala index 05013fbc49b8e..a204502be74b6 100644 --- a/core/src/test/scala/org/apache/spark/rdd/JdbcRDDSuite.scala +++ b/core/src/test/scala/org/apache/spark/rdd/JdbcRDDSuite.scala @@ -26,7 +26,8 @@ import org.apache.spark.util.Utils class JdbcRDDSuite extends SparkFunSuite with BeforeAndAfter with LocalSparkContext { - before { + override def beforeAll(): Unit = { + super.beforeAll() Utils.classForName("org.apache.derby.jdbc.EmbeddedDriver") val conn = DriverManager.getConnection("jdbc:derby:target/JdbcRDDSuiteDb;create=true") try { @@ -96,7 +97,7 @@ class JdbcRDDSuite extends SparkFunSuite with BeforeAndAfter with LocalSparkCont assert(rdd.reduce(_ + _) === 5050) } - after { + override def afterAll(): Unit = { try { DriverManager.getConnection("jdbc:derby:target/JdbcRDDSuiteDb;shutdown=true") } catch { @@ -104,5 +105,6 @@ class JdbcRDDSuite extends SparkFunSuite with BeforeAndAfter with LocalSparkCont // Normal single database shutdown // https://db.apache.org/derby/docs/10.2/ref/rrefexcept71493.html } + super.afterAll() } } diff --git a/core/src/test/scala/org/apache/spark/rdd/LocalCheckpointSuite.scala b/core/src/test/scala/org/apache/spark/rdd/LocalCheckpointSuite.scala index c942328acc8c1..9e3f27911019c 100644 --- a/core/src/test/scala/org/apache/spark/rdd/LocalCheckpointSuite.scala +++ b/core/src/test/scala/org/apache/spark/rdd/LocalCheckpointSuite.scala @@ -44,6 +44,7 @@ class LocalCheckpointSuite extends SparkFunSuite with LocalSparkContext { assert(transform(StorageLevel.MEMORY_ONLY_SER_2) === StorageLevel.MEMORY_AND_DISK_SER_2) assert(transform(StorageLevel.DISK_ONLY) === StorageLevel.DISK_ONLY) assert(transform(StorageLevel.DISK_ONLY_2) === StorageLevel.DISK_ONLY_2) + assert(transform(StorageLevel.DISK_ONLY_3) === StorageLevel.DISK_ONLY_3) assert(transform(StorageLevel.MEMORY_AND_DISK) === StorageLevel.MEMORY_AND_DISK) assert(transform(StorageLevel.MEMORY_AND_DISK_SER) === StorageLevel.MEMORY_AND_DISK_SER) assert(transform(StorageLevel.MEMORY_AND_DISK_2) === StorageLevel.MEMORY_AND_DISK_2) diff --git a/core/src/test/scala/org/apache/spark/rdd/PairRDDFunctionsSuite.scala b/core/src/test/scala/org/apache/spark/rdd/PairRDDFunctionsSuite.scala index 2de4b109e40e9..a669993352fe7 100644 --- a/core/src/test/scala/org/apache/spark/rdd/PairRDDFunctionsSuite.scala +++ b/core/src/test/scala/org/apache/spark/rdd/PairRDDFunctionsSuite.scala @@ -28,7 +28,7 @@ import org.apache.hadoop.fs.FileSystem import org.apache.hadoop.mapred._ import org.apache.hadoop.mapreduce.{Job => NewJob, JobContext => NewJobContext, OutputCommitter => NewOutputCommitter, OutputFormat => NewOutputFormat, - RecordWriter => NewRecordWriter, TaskAttemptContext => NewTaskAttempContext} + RecordWriter => NewRecordWriter, TaskAttemptContext => NewTaskAttemptContext} import org.apache.hadoop.util.Progressable import org.scalatest.Assertions @@ -892,7 +892,7 @@ class FakeOutputFormat() extends OutputFormat[Integer, Integer]() { */ class NewFakeWriter extends NewRecordWriter[Integer, Integer] { - def close(p1: NewTaskAttempContext): Unit = () + def close(p1: NewTaskAttemptContext): Unit = () def write(p1: Integer, p2: Integer): Unit = () @@ -901,24 +901,24 @@ class NewFakeWriter extends NewRecordWriter[Integer, Integer] { class NewFakeCommitter extends NewOutputCommitter { def setupJob(p1: NewJobContext): Unit = () - def needsTaskCommit(p1: NewTaskAttempContext): Boolean = false + def needsTaskCommit(p1: NewTaskAttemptContext): Boolean = false - def setupTask(p1: NewTaskAttempContext): Unit = () + def setupTask(p1: NewTaskAttemptContext): Unit = () - def commitTask(p1: NewTaskAttempContext): Unit = () + def commitTask(p1: NewTaskAttemptContext): Unit = () - def abortTask(p1: NewTaskAttempContext): Unit = () + def abortTask(p1: NewTaskAttemptContext): Unit = () } class NewFakeFormat() extends NewOutputFormat[Integer, Integer]() { def checkOutputSpecs(p1: NewJobContext): Unit = () - def getRecordWriter(p1: NewTaskAttempContext): NewRecordWriter[Integer, Integer] = { + def getRecordWriter(p1: NewTaskAttemptContext): NewRecordWriter[Integer, Integer] = { new NewFakeWriter() } - def getOutputCommitter(p1: NewTaskAttempContext): NewOutputCommitter = { + def getOutputCommitter(p1: NewTaskAttemptContext): NewOutputCommitter = { new NewFakeCommitter() } } @@ -958,7 +958,7 @@ class FakeFormatWithCallback() extends FakeOutputFormat { } class NewFakeWriterWithCallback extends NewFakeWriter { - override def close(p1: NewTaskAttempContext): Unit = { + override def close(p1: NewTaskAttemptContext): Unit = { FakeWriterWithCallback.calledBy += "close" } @@ -972,7 +972,7 @@ class NewFakeWriterWithCallback extends NewFakeWriter { } class NewFakeFormatWithCallback() extends NewFakeFormat { - override def getRecordWriter(p1: NewTaskAttempContext): NewRecordWriter[Integer, Integer] = { + override def getRecordWriter(p1: NewTaskAttemptContext): NewRecordWriter[Integer, Integer] = { new NewFakeWriterWithCallback() } } @@ -982,27 +982,27 @@ class YetAnotherFakeCommitter extends NewOutputCommitter with Assertions { JobID.jobid = j.getJobID().getId } - def needsTaskCommit(t: NewTaskAttempContext): Boolean = false + def needsTaskCommit(t: NewTaskAttemptContext): Boolean = false - def setupTask(t: NewTaskAttempContext): Unit = { + def setupTask(t: NewTaskAttemptContext): Unit = { val jobId = t.getTaskAttemptID().getJobID().getId assert(jobId === JobID.jobid) } - def commitTask(t: NewTaskAttempContext): Unit = {} + def commitTask(t: NewTaskAttemptContext): Unit = {} - def abortTask(t: NewTaskAttempContext): Unit = {} + def abortTask(t: NewTaskAttemptContext): Unit = {} } class YetAnotherFakeFormat() extends NewOutputFormat[Integer, Integer]() { def checkOutputSpecs(j: NewJobContext): Unit = {} - def getRecordWriter(t: NewTaskAttempContext): NewRecordWriter[Integer, Integer] = { + def getRecordWriter(t: NewTaskAttemptContext): NewRecordWriter[Integer, Integer] = { new NewFakeWriter() } - def getOutputCommitter(t: NewTaskAttempContext): NewOutputCommitter = { + def getOutputCommitter(t: NewTaskAttemptContext): NewOutputCommitter = { new YetAnotherFakeCommitter() } } @@ -1021,7 +1021,7 @@ class ConfigTestFormat() extends NewFakeFormat() with Configurable { def getConf: Configuration = null - override def getRecordWriter(p1: NewTaskAttempContext): NewRecordWriter[Integer, Integer] = { + override def getRecordWriter(p1: NewTaskAttemptContext): NewRecordWriter[Integer, Integer] = { assert(setConfCalled, "setConf was never called") super.getRecordWriter(p1) } diff --git a/core/src/test/scala/org/apache/spark/rdd/ParallelCollectionSplitSuite.scala b/core/src/test/scala/org/apache/spark/rdd/ParallelCollectionSplitSuite.scala index 10f4bbcf7f48b..879107350bb52 100644 --- a/core/src/test/scala/org/apache/spark/rdd/ParallelCollectionSplitSuite.scala +++ b/core/src/test/scala/org/apache/spark/rdd/ParallelCollectionSplitSuite.scala @@ -140,7 +140,7 @@ class ParallelCollectionSplitSuite extends SparkFunSuite with Checkers { assert(slices(i).isInstanceOf[Range]) val range = slices(i).asInstanceOf[Range] assert(range.start === i * (N / 40), "slice " + i + " start") - assert(range.end === (i + 1) * (N / 40), "slice " + i + " end") + assert(range.last === (i + 1) * (N / 40) - 1, "slice " + i + " end") assert(range.step === 1, "slice " + i + " step") } } diff --git a/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala b/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala index 2da2854dfbcb9..5000011b3c5ee 100644 --- a/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala +++ b/core/src/test/scala/org/apache/spark/rdd/PipedRDDSuite.scala @@ -176,7 +176,8 @@ class PipedRDDSuite extends SparkFunSuite with SharedSparkContext with Eventuall } test("pipe with env variable") { - assume(TestUtils.testCommandAvailable(envCommand)) + val executable = envCommand.split("\\s+", 2)(0) + assume(TestUtils.testCommandAvailable(executable)) val nums = sc.makeRDD(Array(1, 2, 3, 4), 2) val piped = nums.pipe(s"$envCommand MY_TEST_ENV", Map("MY_TEST_ENV" -> "LALALA")) val c = piped.collect() @@ -238,7 +239,8 @@ class PipedRDDSuite extends SparkFunSuite with SharedSparkContext with Eventuall } def testExportInputFile(varName: String): Unit = { - assume(TestUtils.testCommandAvailable(envCommand)) + val executable = envCommand.split("\\s+", 2)(0) + assume(TestUtils.testCommandAvailable(executable)) val nums = new HadoopRDD(sc, new JobConf(), classOf[TextInputFormat], classOf[LongWritable], classOf[Text], 2) { override def getPartitions: Array[Partition] = Array(generateFakeHadoopPartition()) diff --git a/core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala b/core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala index 18154d861a731..6f49e108aea2e 100644 --- a/core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala +++ b/core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala @@ -237,10 +237,8 @@ class RDDSuite extends SparkFunSuite with SharedSparkContext with Eventually { test("aggregate") { val pairs = sc.makeRDD(Seq(("a", 1), ("b", 2), ("a", 2), ("c", 5), ("a", 3))) - type StringMap = HashMap[String, Int] - val emptyMap = new StringMap { - override def default(key: String): Int = 0 - } + type StringMap = scala.collection.mutable.Map[String, Int] + val emptyMap = HashMap[String, Int]().withDefaultValue(0).asInstanceOf[StringMap] val mergeElement: (StringMap, (String, Int)) => StringMap = (map, pair) => { map(pair._1) += pair._2 map @@ -656,7 +654,7 @@ class RDDSuite extends SparkFunSuite with SharedSparkContext with Eventually { } test("top with predefined ordering") { - val nums = Array.range(1, 100000) + val nums = Seq.range(1, 100000) val ints = sc.makeRDD(scala.util.Random.shuffle(nums), 2) val topK = ints.top(5) assert(topK.size === 5) @@ -862,6 +860,20 @@ class RDDSuite extends SparkFunSuite with SharedSparkContext with Eventually { assert(partitions(1) === Seq((1, 3), (3, 8), (3, 8))) } + test("SPARK-32384: repartitionAndSortWithinPartitions without shuffle") { + val data = sc.parallelize(Seq((0, 5), (3, 8), (2, 6), (0, 8), (3, 8), (1, 3)), 2) + + val partitioner = new HashPartitioner(2) + val agged = data.reduceByKey(_ + _, 2) + assert(agged.partitioner == Some(partitioner)) + + val sorted = agged.repartitionAndSortWithinPartitions(partitioner) + assert(sorted.partitioner == Some(partitioner)) + + assert(sorted.dependencies.nonEmpty && + sorted.dependencies.forall(_.isInstanceOf[OneToOneDependency[_]])) + } + test("cartesian on empty RDD") { val a = sc.emptyRDD[Int] val b = sc.parallelize(1 to 3) @@ -1098,13 +1110,13 @@ class RDDSuite extends SparkFunSuite with SharedSparkContext with Eventually { override def getPartitions: Array[Partition] = Array(new Partition { override def index: Int = 0 }) - override def getDependencies: Seq[Dependency[_]] = mutableDependencies + override def getDependencies: Seq[Dependency[_]] = mutableDependencies.toSeq def addDependency(dep: Dependency[_]): Unit = { mutableDependencies += dep } } - test("RDD.partitions() fails fast when partitions indicies are incorrect (SPARK-13021)") { + test("RDD.partitions() fails fast when partitions indices are incorrect (SPARK-13021)") { class BadRDD[T: ClassTag](prev: RDD[T]) extends RDD[T](prev) { override def compute(part: Partition, context: TaskContext): Iterator[T] = { @@ -1298,19 +1310,15 @@ class SizeBasedCoalescer(val maxSize: Int) extends PartitionCoalescer with Seria val splitSize = fileSplit.getLength if (currentSum + splitSize < maxSize) { addPartition(partition, splitSize) - index += 1 - if (index == partitions.size) { - updateGroups - } } else { - if (currentGroup.partitions.size == 0) { - addPartition(partition, splitSize) - index += 1 - } else { - updateGroups + if (currentGroup.partitions.nonEmpty) { + updateGroups() } + addPartition(partition, splitSize) } + index += 1 } + updateGroups() groups.toArray } } diff --git a/core/src/test/scala/org/apache/spark/rdd/SortingSuite.scala b/core/src/test/scala/org/apache/spark/rdd/SortingSuite.scala index d5f7d30a253fe..5b01b54a0a9f4 100644 --- a/core/src/test/scala/org/apache/spark/rdd/SortingSuite.scala +++ b/core/src/test/scala/org/apache/spark/rdd/SortingSuite.scala @@ -17,7 +17,8 @@ package org.apache.spark.rdd -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.{SharedSparkContext, SparkFunSuite} import org.apache.spark.internal.Logging diff --git a/core/src/test/scala/org/apache/spark/resource/ResourceProfileManagerSuite.scala b/core/src/test/scala/org/apache/spark/resource/ResourceProfileManagerSuite.scala index 004618a161b44..65e41986ff31f 100644 --- a/core/src/test/scala/org/apache/spark/resource/ResourceProfileManagerSuite.scala +++ b/core/src/test/scala/org/apache/spark/resource/ResourceProfileManagerSuite.scala @@ -20,10 +20,11 @@ package org.apache.spark.resource import org.apache.spark.{SparkConf, SparkException, SparkFunSuite} import org.apache.spark.internal.config._ import org.apache.spark.internal.config.Tests._ +import org.apache.spark.scheduler.LiveListenerBus class ResourceProfileManagerSuite extends SparkFunSuite { - override def beforeAll() { + override def beforeAll(): Unit = { try { ResourceProfile.clearDefaultProfile() } finally { @@ -31,7 +32,7 @@ class ResourceProfileManagerSuite extends SparkFunSuite { } } - override def afterEach() { + override def afterEach(): Unit = { try { ResourceProfile.clearDefaultProfile() } finally { @@ -39,13 +40,15 @@ class ResourceProfileManagerSuite extends SparkFunSuite { } } + val listenerBus = new LiveListenerBus(new SparkConf()) + test("ResourceProfileManager") { val conf = new SparkConf().set(EXECUTOR_CORES, 4) - val rpmanager = new ResourceProfileManager(conf) + val rpmanager = new ResourceProfileManager(conf, listenerBus) val defaultProf = rpmanager.defaultResourceProfile assert(defaultProf.id === ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) - assert(defaultProf.executorResources.size === 2, - "Executor resources should contain cores and memory by default") + assert(defaultProf.executorResources.size === 3, + "Executor resources should contain cores, heap and offheap memory by default") assert(defaultProf.executorResources(ResourceProfile.CORES).amount === 4, s"Executor resources should have 4 cores") } @@ -53,7 +56,7 @@ class ResourceProfileManagerSuite extends SparkFunSuite { test("isSupported yarn no dynamic allocation") { val conf = new SparkConf().setMaster("yarn").set(EXECUTOR_CORES, 4) conf.set(RESOURCE_PROFILE_MANAGER_TESTING.key, "true") - val rpmanager = new ResourceProfileManager(conf) + val rpmanager = new ResourceProfileManager(conf, listenerBus) // default profile should always work val defaultProf = rpmanager.defaultResourceProfile val rprof = new ResourceProfileBuilder() @@ -64,14 +67,15 @@ class ResourceProfileManagerSuite extends SparkFunSuite { rpmanager.isSupported(immrprof) }.getMessage() - assert(error.contains("ResourceProfiles are only supported on YARN with dynamic allocation")) + assert(error.contains( + "ResourceProfiles are only supported on YARN and Kubernetes with dynamic allocation")) } test("isSupported yarn with dynamic allocation") { val conf = new SparkConf().setMaster("yarn").set(EXECUTOR_CORES, 4) conf.set(DYN_ALLOCATION_ENABLED, true) conf.set(RESOURCE_PROFILE_MANAGER_TESTING.key, "true") - val rpmanager = new ResourceProfileManager(conf) + val rpmanager = new ResourceProfileManager(conf, listenerBus) // default profile should always work val defaultProf = rpmanager.defaultResourceProfile val rprof = new ResourceProfileBuilder() @@ -81,26 +85,42 @@ class ResourceProfileManagerSuite extends SparkFunSuite { assert(rpmanager.isSupported(immrprof) == true) } - test("isSupported yarn with local mode") { + test("isSupported k8s with dynamic allocation") { + val conf = new SparkConf().setMaster("k8s://foo").set(EXECUTOR_CORES, 4) + conf.set(DYN_ALLOCATION_ENABLED, true) + conf.set(DYN_ALLOCATION_SHUFFLE_TRACKING_ENABLED, true) + conf.set(RESOURCE_PROFILE_MANAGER_TESTING.key, "true") + val rpmanager = new ResourceProfileManager(conf, listenerBus) + // default profile should always work + val defaultProf = rpmanager.defaultResourceProfile + val rprof = new ResourceProfileBuilder() + val gpuExecReq = + new ExecutorResourceRequests().resource("gpu", 2, "someScript", "nvidia") + val immrprof = rprof.require(gpuExecReq).build + assert(rpmanager.isSupported(immrprof) == true) + } + + test("isSupported with local mode") { val conf = new SparkConf().setMaster("local").set(EXECUTOR_CORES, 4) conf.set(RESOURCE_PROFILE_MANAGER_TESTING.key, "true") - val rpmanager = new ResourceProfileManager(conf) + val rpmanager = new ResourceProfileManager(conf, listenerBus) // default profile should always work val defaultProf = rpmanager.defaultResourceProfile val rprof = new ResourceProfileBuilder() val gpuExecReq = new ExecutorResourceRequests().resource("gpu", 2, "someScript") val immrprof = rprof.require(gpuExecReq).build - var error = intercept[SparkException] { + val error = intercept[SparkException] { rpmanager.isSupported(immrprof) }.getMessage() - assert(error.contains("ResourceProfiles are only supported on YARN with dynamic allocation")) + assert(error.contains( + "ResourceProfiles are only supported on YARN and Kubernetes with dynamic allocation")) } test("ResourceProfileManager has equivalent profile") { val conf = new SparkConf().set(EXECUTOR_CORES, 4) - val rpmanager = new ResourceProfileManager(conf) + val rpmanager = new ResourceProfileManager(conf, listenerBus) var rpAlreadyExist: Option[ResourceProfile] = None val checkId = 500 for (i <- 1 to 1000) { diff --git a/core/src/test/scala/org/apache/spark/resource/ResourceProfileSuite.scala b/core/src/test/scala/org/apache/spark/resource/ResourceProfileSuite.scala index 29d3ef130ce57..27cc44a099de1 100644 --- a/core/src/test/scala/org/apache/spark/resource/ResourceProfileSuite.scala +++ b/core/src/test/scala/org/apache/spark/resource/ResourceProfileSuite.scala @@ -18,13 +18,13 @@ package org.apache.spark.resource import org.apache.spark.{SparkConf, SparkFunSuite} -import org.apache.spark.internal.config.{EXECUTOR_CORES, EXECUTOR_MEMORY, EXECUTOR_MEMORY_OVERHEAD} +import org.apache.spark.internal.config._ import org.apache.spark.internal.config.Python.PYSPARK_EXECUTOR_MEMORY import org.apache.spark.resource.TestResourceIDs._ class ResourceProfileSuite extends SparkFunSuite { - override def beforeAll() { + override def beforeAll(): Unit = { try { ResourceProfile.clearDefaultProfile() } finally { @@ -32,7 +32,7 @@ class ResourceProfileSuite extends SparkFunSuite { } } - override def afterEach() { + override def afterEach(): Unit = { try { ResourceProfile.clearDefaultProfile() } finally { @@ -43,8 +43,8 @@ class ResourceProfileSuite extends SparkFunSuite { test("Default ResourceProfile") { val rprof = ResourceProfile.getOrCreateDefaultProfile(new SparkConf) assert(rprof.id === ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) - assert(rprof.executorResources.size === 2, - "Executor resources should contain cores and memory by default") + assert(rprof.executorResources.size === 3, + "Executor resources should contain cores, heap and offheap memory by default") assert(rprof.executorResources(ResourceProfile.CORES).amount === 1, "Executor resources should have 1 core") assert(rprof.getExecutorCores.get === 1, @@ -55,6 +55,8 @@ class ResourceProfileSuite extends SparkFunSuite { "pyspark memory empty if not specified") assert(rprof.executorResources.get(ResourceProfile.OVERHEAD_MEM) == None, "overhead memory empty if not specified") + assert(rprof.executorResources(ResourceProfile.OFFHEAP_MEM).amount === 0, + "Executor resources should have 0 offheap memory") assert(rprof.taskResources.size === 1, "Task resources should just contain cpus by default") assert(rprof.taskResources(ResourceProfile.CPUS).amount === 1, @@ -69,14 +71,16 @@ class ResourceProfileSuite extends SparkFunSuite { conf.set(EXECUTOR_MEMORY_OVERHEAD.key, "1g") conf.set(EXECUTOR_MEMORY.key, "4g") conf.set(EXECUTOR_CORES.key, "4") + conf.set(MEMORY_OFFHEAP_ENABLED.key, "true") + conf.set(MEMORY_OFFHEAP_SIZE.key, "3m") conf.set(TASK_GPU_ID.amountConf, "1") conf.set(EXECUTOR_GPU_ID.amountConf, "1") conf.set(EXECUTOR_GPU_ID.discoveryScriptConf, "nameOfScript") val rprof = ResourceProfile.getOrCreateDefaultProfile(conf) assert(rprof.id === ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) val execResources = rprof.executorResources - assert(execResources.size === 5, s"Executor resources should contain cores, pyspark " + - s"memory, memory overhead, memory, and gpu $execResources") + assert(execResources.size === 6, s"Executor resources should contain cores, pyspark " + + s"memory, memory overhead, memory, offHeap memory and gpu $execResources") assert(execResources.contains("gpu"), "Executor resources should have gpu") assert(rprof.executorResources(ResourceProfile.CORES).amount === 4, "Executor resources should have 4 core") @@ -88,6 +92,8 @@ class ResourceProfileSuite extends SparkFunSuite { "pyspark memory empty if not specified") assert(rprof.executorResources(ResourceProfile.OVERHEAD_MEM).amount == 1024, "overhead memory empty if not specified") + assert(rprof.executorResources(ResourceProfile.OFFHEAP_MEM).amount == 3, + "Executor resources should have 3 offHeap memory") assert(rprof.taskResources.size === 2, "Task resources should just contain cpus and gpu") assert(rprof.taskResources.contains("gpu"), "Task resources should have gpu") @@ -172,14 +178,14 @@ class ResourceProfileSuite extends SparkFunSuite { val ereqs = new ExecutorResourceRequests() ereqs.cores(2).memory("4096") - ereqs.memoryOverhead("2048").pysparkMemory("1024") + ereqs.memoryOverhead("2048").pysparkMemory("1024").offHeapMemory("3072") val treqs = new TaskResourceRequests() treqs.cpus(1) rprof.require(treqs) rprof.require(ereqs) - assert(rprof.executorResources.size === 5) + assert(rprof.executorResources.size === 6) assert(rprof.executorResources(ResourceProfile.CORES).amount === 2, "Executor resources should have 2 cores") assert(rprof.executorResources(ResourceProfile.MEMORY).amount === 4096, @@ -188,6 +194,8 @@ class ResourceProfileSuite extends SparkFunSuite { "Executor resources should have 2048 overhead memory") assert(rprof.executorResources(ResourceProfile.PYSPARK_MEM).amount === 1024, "Executor resources should have 1024 pyspark memory") + assert(rprof.executorResources(ResourceProfile.OFFHEAP_MEM).amount === 3072, + "Executor resources should have 3072 offHeap memory") assert(rprof.taskResources.size === 2) assert(rprof.taskResources("cpus").amount === 1, "Task resources should have cpu") @@ -217,7 +225,7 @@ class ResourceProfileSuite extends SparkFunSuite { val rprof = new ResourceProfileBuilder() val ereqs = new ExecutorResourceRequests() ereqs.memory("4g") - ereqs.memoryOverhead("2000m").pysparkMemory("512000k") + ereqs.memoryOverhead("2000m").pysparkMemory("512000k").offHeapMemory("1g") rprof.require(ereqs) assert(rprof.executorResources(ResourceProfile.MEMORY).amount === 4096, @@ -226,6 +234,8 @@ class ResourceProfileSuite extends SparkFunSuite { "Executor resources should have 2000 overhead memory") assert(rprof.executorResources(ResourceProfile.PYSPARK_MEM).amount === 500, "Executor resources should have 512 pyspark memory") + assert(rprof.executorResources(ResourceProfile.OFFHEAP_MEM).amount === 1024, + "Executor resources should have 1024 offHeap memory") } test("Test TaskResourceRequest fractional") { @@ -256,4 +266,32 @@ class ResourceProfileSuite extends SparkFunSuite { }.getMessage() assert(taskError.contains("The resource amount 0.7 must be either <= 0.5, or a whole number.")) } + + test("ResourceProfile has correct custom executor resources") { + val rprof = new ResourceProfileBuilder() + val eReq = new ExecutorResourceRequests() + .cores(2).memory("4096") + .memoryOverhead("2048").pysparkMemory("1024").offHeapMemory("3072") + .resource("gpu", 2) + rprof.require(eReq) + + // Update this if new resource type added + assert(ResourceProfile.allSupportedExecutorResources.size === 5, + "Executor resources should have 5 supported resources") + assert(ResourceProfile.getCustomExecutorResources(rprof.build).size === 1, + "Executor resources should have 1 custom resource") + } + + test("ResourceProfile has correct custom task resources") { + val rprof = new ResourceProfileBuilder() + val taskReq = new TaskResourceRequests() + .resource("gpu", 1) + val eReq = new ExecutorResourceRequests() + .cores(2).memory("4096") + .memoryOverhead("2048").pysparkMemory("1024").offHeapMemory("3072") + rprof.require(taskReq).require(eReq) + + assert(ResourceProfile.getCustomTaskResources(rprof.build).size === 1, + "Task resources should have 1 custom resource") + } } diff --git a/core/src/test/scala/org/apache/spark/resource/ResourceUtilsSuite.scala b/core/src/test/scala/org/apache/spark/resource/ResourceUtilsSuite.scala index 278a72a7192d8..ffe5ff5787102 100644 --- a/core/src/test/scala/org/apache/spark/resource/ResourceUtilsSuite.scala +++ b/core/src/test/scala/org/apache/spark/resource/ResourceUtilsSuite.scala @@ -26,10 +26,8 @@ import org.json4s.{DefaultFormats, Extraction} import org.apache.spark.{LocalSparkContext, SparkConf, SparkException, SparkFunSuite} import org.apache.spark.TestUtils._ import org.apache.spark.internal.config._ -import org.apache.spark.internal.config.Tests._ import org.apache.spark.resource.ResourceUtils._ import org.apache.spark.resource.TestResourceIDs._ -import org.apache.spark.scheduler.LiveListenerBus import org.apache.spark.util.Utils class ResourceUtilsSuite extends SparkFunSuite @@ -180,7 +178,7 @@ class ResourceUtilsSuite extends SparkFunSuite test("list resource ids") { val conf = new SparkConf conf.set(DRIVER_GPU_ID.amountConf, "2") - var resources = listResourceIds(conf, SPARK_DRIVER_PREFIX) + val resources = listResourceIds(conf, SPARK_DRIVER_PREFIX) assert(resources.size === 1, "should only have GPU for resource") assert(resources(0).resourceName == GPU, "name should be gpu") @@ -223,7 +221,7 @@ class ResourceUtilsSuite extends SparkFunSuite val conf = new SparkConf assume(!(Utils.isWindows)) withTempDir { dir => - val gpuDiscovery = createTempScriptWithExpectedOutput(dir, "gpuDisocveryScript", + val gpuDiscovery = createTempScriptWithExpectedOutput(dir, "gpuDiscoveryScript", """{"name": "gpu", "addresses": ["0", "1"]}""") conf.set(DRIVER_GPU_ID.amountConf, "2") conf.set(DRIVER_GPU_ID.discoveryScriptConf, gpuDiscovery) diff --git a/core/src/test/scala/org/apache/spark/rpc/RpcEnvSuite.scala b/core/src/test/scala/org/apache/spark/rpc/RpcEnvSuite.scala index d25fd20340d48..bec96e523e9e5 100644 --- a/core/src/test/scala/org/apache/spark/rpc/RpcEnvSuite.scala +++ b/core/src/test/scala/org/apache/spark/rpc/RpcEnvSuite.scala @@ -33,7 +33,7 @@ import org.mockito.Mockito.{mock, never, verify, when} import org.scalatest.BeforeAndAfterAll import org.scalatest.concurrent.Eventually._ -import org.apache.spark.{SecurityManager, SparkConf, SparkEnv, SparkException, SparkFunSuite} +import org.apache.spark.{SparkConf, SparkEnv, SparkException, SparkFunSuite} import org.apache.spark.deploy.SparkHadoopUtil import org.apache.spark.internal.config._ import org.apache.spark.util.{ThreadUtils, Utils} @@ -901,7 +901,6 @@ abstract class RpcEnvSuite extends SparkFunSuite with BeforeAndAfterAll { } } - val sm = new SecurityManager(conf) val hc = SparkHadoopUtil.get.conf val files = Seq( @@ -913,7 +912,7 @@ abstract class RpcEnvSuite extends SparkFunSuite with BeforeAndAfterAll { (subFile2, dir2Uri + "/file2")) files.foreach { case (f, uri) => val destFile = new File(destDir, f.getName()) - Utils.fetchFile(uri, destDir, conf, sm, hc, 0L, false) + Utils.fetchFile(uri, destDir, conf, hc, 0L, false) assert(Files.equal(f, destFile)) } @@ -921,7 +920,7 @@ abstract class RpcEnvSuite extends SparkFunSuite with BeforeAndAfterAll { Seq("files", "jars", "dir1").foreach { root => intercept[Exception] { val uri = env.address.toSparkURL + s"/$root/doesNotExist" - Utils.fetchFile(uri, destDir, conf, sm, hc, 0L, false) + Utils.fetchFile(uri, destDir, conf, hc, 0L, false) } } } diff --git a/core/src/test/scala/org/apache/spark/rpc/netty/InboxSuite.scala b/core/src/test/scala/org/apache/spark/rpc/netty/InboxSuite.scala index c74c728b3e3f3..8b1c602cd8e58 100644 --- a/core/src/test/scala/org/apache/spark/rpc/netty/InboxSuite.scala +++ b/core/src/test/scala/org/apache/spark/rpc/netty/InboxSuite.scala @@ -136,4 +136,17 @@ class InboxSuite extends SparkFunSuite { endpoint.verifySingleOnNetworkErrorMessage(cause, remoteAddress) } + + test("SPARK-32738: should reduce the number of active threads when fatal error happens") { + val endpoint = mock(classOf[TestRpcEndpoint]) + when(endpoint.receive).thenThrow(new OutOfMemoryError()) + + val dispatcher = mock(classOf[Dispatcher]) + val inbox = new Inbox("name", endpoint) + inbox.post(OneWayMessage(null, "hi")) + intercept[OutOfMemoryError] { + inbox.process(dispatcher) + } + assert(inbox.getNumActiveThreads == 0) + } } diff --git a/core/src/test/scala/org/apache/spark/rpc/netty/NettyRpcEnvSuite.scala b/core/src/test/scala/org/apache/spark/rpc/netty/NettyRpcEnvSuite.scala index c2730f90ed982..fe6d0db837bda 100644 --- a/core/src/test/scala/org/apache/spark/rpc/netty/NettyRpcEnvSuite.scala +++ b/core/src/test/scala/org/apache/spark/rpc/netty/NettyRpcEnvSuite.scala @@ -73,7 +73,7 @@ class NettyRpcEnvSuite extends RpcEnvSuite with MockitoSugar with TimeLimits { val nettyEnv = env.asInstanceOf[NettyRpcEnv] val client = mock[TransportClient] - val senderAddress = RpcAddress("locahost", 12345) + val senderAddress = RpcAddress("localhost", 12345) val receiverAddress = RpcEndpointAddress("localhost", 54321, "test") val receiver = new NettyRpcEndpointRef(nettyEnv.conf, receiverAddress, nettyEnv) diff --git a/core/src/test/scala/org/apache/spark/scheduler/BarrierTaskContextSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/BarrierTaskContextSuite.scala index b5614b263ca94..4f97003e2ed59 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/BarrierTaskContextSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/BarrierTaskContextSuite.scala @@ -19,28 +19,30 @@ package org.apache.spark.scheduler import java.io.File +import scala.collection.mutable import scala.util.Random import org.scalatest.concurrent.Eventually import org.scalatest.time.SpanSugar._ import org.apache.spark._ +import org.apache.spark.internal.config.LEGACY_LOCALITY_WAIT_RESET import org.apache.spark.internal.config.Tests.TEST_NO_STAGE_RETRY class BarrierTaskContextSuite extends SparkFunSuite with LocalSparkContext with Eventually { - def initLocalClusterSparkContext(numWorker: Int = 4): Unit = { - val conf = new SparkConf() + def initLocalClusterSparkContext(numWorker: Int = 4, conf: SparkConf = new SparkConf()): Unit = { + conf // Init local cluster here so each barrier task runs in a separated process, thus `barrier()` // call is actually useful. .setMaster(s"local-cluster[$numWorker, 1, 1024]") .setAppName("test-cluster") .set(TEST_NO_STAGE_RETRY, true) sc = new SparkContext(conf) + TestUtils.waitUntilExecutorsUp(sc, numWorker, 60000) } - // TODO (SPARK-31730): re-enable it - ignore("global sync by barrier() call") { + test("global sync by barrier() call") { initLocalClusterSparkContext() val rdd = sc.makeRDD(1 to 10, 4) val rdd2 = rdd.barrier().mapPartitions { it => @@ -57,10 +59,7 @@ class BarrierTaskContextSuite extends SparkFunSuite with LocalSparkContext with } test("share messages with allGather() call") { - val conf = new SparkConf() - .setMaster("local-cluster[4, 1, 1024]") - .setAppName("test-cluster") - sc = new SparkContext(conf) + initLocalClusterSparkContext() val rdd = sc.makeRDD(1 to 10, 4) val rdd2 = rdd.barrier().mapPartitions { it => val context = BarrierTaskContext.get() @@ -69,19 +68,16 @@ class BarrierTaskContextSuite extends SparkFunSuite with LocalSparkContext with // Pass partitionId message in val message: String = context.partitionId().toString val messages: Array[String] = context.allGather(message) - messages.toList.iterator + Iterator.single(messages.toList) } - // Take a sorted list of all the partitionId messages - val messages = rdd2.collect().head - // All the task partitionIds are shared - for((x, i) <- messages.view.zipWithIndex) assert(x.toString == i.toString) + val messages = rdd2.collect() + // All the task partitionIds are shared across all tasks + assert(messages.length === 4) + assert(messages.forall(_ == List("0", "1", "2", "3"))) } test("throw exception if we attempt to synchronize with different blocking calls") { - val conf = new SparkConf() - .setMaster("local-cluster[4, 1, 1024]") - .setAppName("test-cluster") - sc = new SparkContext(conf) + initLocalClusterSparkContext() val rdd = sc.makeRDD(1 to 10, 4) val rdd2 = rdd.barrier().mapPartitions { it => val context = BarrierTaskContext.get() @@ -100,10 +96,7 @@ class BarrierTaskContextSuite extends SparkFunSuite with LocalSparkContext with } test("successively sync with allGather and barrier") { - val conf = new SparkConf() - .setMaster("local-cluster[4, 1, 1024]") - .setAppName("test-cluster") - sc = new SparkContext(conf) + initLocalClusterSparkContext() val rdd = sc.makeRDD(1 to 10, 4) val rdd2 = rdd.barrier().mapPartitions { it => val context = BarrierTaskContext.get() @@ -129,8 +122,7 @@ class BarrierTaskContextSuite extends SparkFunSuite with LocalSparkContext with assert(times2.max - times2.min <= 1000) } - // TODO (SPARK-31730): re-enable it - ignore("support multiple barrier() call within a single task") { + test("support multiple barrier() call within a single task") { initLocalClusterSparkContext() val rdd = sc.makeRDD(1 to 10, 4) val rdd2 = rdd.barrier().mapPartitions { it => @@ -198,7 +190,7 @@ class BarrierTaskContextSuite extends SparkFunSuite with LocalSparkContext with test("throw exception if the number of barrier() calls are not the same on every task") { initLocalClusterSparkContext() - sc.conf.set("spark.barrier.sync.timeout", "1") + sc.conf.set("spark.barrier.sync.timeout", "5") val rdd = sc.makeRDD(1 to 10, 4) val rdd2 = rdd.barrier().mapPartitions { it => val context = BarrierTaskContext.get() @@ -221,7 +213,7 @@ class BarrierTaskContextSuite extends SparkFunSuite with LocalSparkContext with rdd2.collect() }.getMessage assert(error.contains("The coordinator didn't get all barrier sync requests")) - assert(error.contains("within 1 second(s)")) + assert(error.contains("within 5 second(s)")) } def testBarrierTaskKilled(interruptOnKill: Boolean): Unit = { @@ -283,19 +275,96 @@ class BarrierTaskContextSuite extends SparkFunSuite with LocalSparkContext with testBarrierTaskKilled(interruptOnKill = true) } - test("SPARK-31485: barrier stage should fail if only partial tasks are launched") { - initLocalClusterSparkContext(2) - val rdd0 = sc.parallelize(Seq(0, 1, 2, 3), 2) - val dep = new OneToOneDependency[Int](rdd0) - // set up a barrier stage with 2 tasks and both tasks prefer executor 0 (only 1 core) for - // scheduling. So, one of tasks won't be scheduled in one round of resource offer. - val rdd = new MyRDD(sc, 2, List(dep), Seq(Seq("executor_h_0"), Seq("executor_h_0"))) - val errorMsg = intercept[SparkException] { + test("SPARK-24818: disable legacy delay scheduling for barrier stage") { + val conf = new SparkConf().set(LEGACY_LOCALITY_WAIT_RESET, true) + initLocalClusterSparkContext(2, conf) + val taskLocality = new mutable.ArrayBuffer[TaskLocality.TaskLocality]() + val listener = new SparkListener { + override def onTaskStart(taskStart: SparkListenerTaskStart): Unit = { + taskLocality += taskStart.taskInfo.taskLocality + } + } + + try { + sc.addSparkListener(listener) + val id = sc.getExecutorIds().head + val rdd0 = sc.parallelize(Seq(0, 1, 2, 3), 2) + val dep = new OneToOneDependency[Int](rdd0) + // set up a stage with 2 tasks and both tasks prefer the same executor (only 1 core) + // for scheduling. So, the first task can always get the best locality (PROCESS_LOCAL), + // but the second task may not get the best locality depends whether it's a barrier stage + // or not. + val rdd = new MyRDD(sc, 2, List(dep), Seq(Seq(s"executor_h_$id"), Seq(s"executor_h_$id"))) { + override def compute(split: Partition, context: TaskContext): Iterator[(Int, Int)] = { + Iterator.single((split.index, split.index + 1)) + } + } + + // run a barrier stage rdd.barrier().mapPartitions { iter => BarrierTaskContext.get().barrier() iter }.collect() - }.getMessage - assert(errorMsg.contains("Fail resource offers for barrier stage")) + + // The delay scheduling for barrier TaskSetManager has been disabled. So, the second task + // would not wait for any time but just launch at ANY locality level. + assert(taskLocality.sorted === Seq(TaskLocality.PROCESS_LOCAL, TaskLocality.ANY)) + taskLocality.clear() + + // run a common stage + rdd.mapPartitions { iter => + iter + }.collect() + // The delay scheduling works for the common stage. So, the second task would be delayed + // in order to get the better locality. + assert(taskLocality.sorted === Seq(TaskLocality.PROCESS_LOCAL, TaskLocality.PROCESS_LOCAL)) + + } finally { + taskLocality.clear() + sc.removeSparkListener(listener) + } + } + + test("SPARK-34069: Kill barrier tasks should respect SPARK_JOB_INTERRUPT_ON_CANCEL") { + sc = new SparkContext(new SparkConf().setAppName("test").setMaster("local[2]")) + var index = 0 + var checkDone = false + var startTime = 0L + val listener = new SparkListener { + override def onTaskStart(taskStart: SparkListenerTaskStart): Unit = { + if (startTime == 0) { + startTime = taskStart.taskInfo.launchTime + } + } + + override def onTaskEnd(taskEnd: SparkListenerTaskEnd): Unit = { + if (index == 0) { + assert(taskEnd.reason.isInstanceOf[ExceptionFailure]) + assert(System.currentTimeMillis() - taskEnd.taskInfo.launchTime < 1000) + index = 1 + } else if (index == 1) { + assert(taskEnd.reason.isInstanceOf[TaskKilled]) + assert(System.currentTimeMillis() - taskEnd.taskInfo.launchTime < 1000) + index = 2 + checkDone = true + } + } + } + sc.addSparkListener(listener) + sc.setJobGroup("test", "", true) + sc.parallelize(Seq(1, 2), 2).barrier().mapPartitions { it => + if (TaskContext.get().stageAttemptNumber() == 0) { + if (it.hasNext && it.next() == 1) { + throw new RuntimeException("failed") + } else { + Thread.sleep(5000) + } + } + it + }.groupBy(x => x).collect() + sc.listenerBus.waitUntilEmpty() + assert(checkDone) + // double check we kill task success + assert(System.currentTimeMillis() - startTime < 5000) } } diff --git a/core/src/test/scala/org/apache/spark/scheduler/BlacklistIntegrationSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/BlacklistIntegrationSuite.scala deleted file mode 100644 index 246d4b2f56ec9..0000000000000 --- a/core/src/test/scala/org/apache/spark/scheduler/BlacklistIntegrationSuite.scala +++ /dev/null @@ -1,157 +0,0 @@ -/* - * 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. - */ -package org.apache.spark.scheduler - -import org.apache.spark._ -import org.apache.spark.internal.config -import org.apache.spark.internal.config.Tests._ - -class BlacklistIntegrationSuite extends SchedulerIntegrationSuite[MultiExecutorMockBackend]{ - - val badHost = "host-0" - - /** - * This backend just always fails if the task is executed on a bad host, but otherwise succeeds - * all tasks. - */ - def badHostBackend(): Unit = { - val (taskDescription, _) = backend.beginTask() - val host = backend.executorIdToExecutor(taskDescription.executorId).host - if (host == badHost) { - backend.taskFailed(taskDescription, new RuntimeException("I'm a bad host!")) - } else { - backend.taskSuccess(taskDescription, 42) - } - } - - // Test demonstrating the issue -- without a config change, the scheduler keeps scheduling - // according to locality preferences, and so the job fails - testScheduler("If preferred node is bad, without blacklist job will fail", - extraConfs = Seq( - config.BLACKLIST_ENABLED.key -> "false" - )) { - val rdd = new MockRDDWithLocalityPrefs(sc, 10, Nil, badHost) - withBackend(badHostBackend _) { - val jobFuture = submit(rdd, (0 until 10).toArray) - awaitJobTermination(jobFuture, duration) - } - assertDataStructuresEmpty(noFailure = false) - } - - testScheduler( - "With default settings, job can succeed despite multiple bad executors on node", - extraConfs = Seq( - config.BLACKLIST_ENABLED.key -> "true", - config.TASK_MAX_FAILURES.key -> "4", - TEST_N_HOSTS.key -> "2", - TEST_N_EXECUTORS_HOST.key -> "5", - TEST_N_CORES_EXECUTOR.key -> "10" - ) - ) { - // To reliably reproduce the failure that would occur without blacklisting, we have to use 1 - // task. That way, we ensure this 1 task gets rotated through enough bad executors on the host - // to fail the taskSet, before we have a bunch of different tasks fail in the executors so we - // blacklist them. - // But the point here is -- without blacklisting, we would never schedule anything on the good - // host-1 before we hit too many failures trying our preferred host-0. - val rdd = new MockRDDWithLocalityPrefs(sc, 1, Nil, badHost) - withBackend(badHostBackend _) { - val jobFuture = submit(rdd, (0 until 1).toArray) - awaitJobTermination(jobFuture, duration) - } - assertDataStructuresEmpty(noFailure = true) - } - - // Here we run with the blacklist on, and the default config takes care of having this - // robust to one bad node. - testScheduler( - "Bad node with multiple executors, job will still succeed with the right confs", - extraConfs = Seq( - config.BLACKLIST_ENABLED.key -> "true", - // just to avoid this test taking too long - config.LOCALITY_WAIT.key -> "10ms" - ) - ) { - val rdd = new MockRDDWithLocalityPrefs(sc, 10, Nil, badHost) - withBackend(badHostBackend _) { - val jobFuture = submit(rdd, (0 until 10).toArray) - awaitJobTermination(jobFuture, duration) - } - assert(results === (0 until 10).map { _ -> 42 }.toMap) - assertDataStructuresEmpty(noFailure = true) - } - - // Make sure that if we've failed on all executors, but haven't hit task.maxFailures yet, we try - // to acquire a new executor and if we aren't able to get one, the job doesn't hang and we abort - testScheduler( - "SPARK-15865 Progress with fewer executors than maxTaskFailures", - extraConfs = Seq( - config.BLACKLIST_ENABLED.key -> "true", - TEST_N_HOSTS.key -> "2", - TEST_N_EXECUTORS_HOST.key -> "1", - TEST_N_CORES_EXECUTOR.key -> "1", - config.UNSCHEDULABLE_TASKSET_TIMEOUT.key -> "0s" - ) - ) { - def runBackend(): Unit = { - val (taskDescription, _) = backend.beginTask() - backend.taskFailed(taskDescription, new RuntimeException("test task failure")) - } - withBackend(runBackend _) { - val jobFuture = submit(new MockRDD(sc, 10, Nil), (0 until 10).toArray) - awaitJobTermination(jobFuture, duration) - val pattern = ( - s"""|Aborting TaskSet 0.0 because task .* - |cannot run anywhere due to node and executor blacklist""".stripMargin).r - assert(pattern.findFirstIn(failure.getMessage).isDefined, - s"Couldn't find $pattern in ${failure.getMessage()}") - } - assertDataStructuresEmpty(noFailure = false) - } -} - -class MultiExecutorMockBackend( - conf: SparkConf, - taskScheduler: TaskSchedulerImpl) extends MockBackend(conf, taskScheduler) { - - val nHosts = conf.get(TEST_N_HOSTS) - val nExecutorsPerHost = conf.get(TEST_N_EXECUTORS_HOST) - val nCoresPerExecutor = conf.get(TEST_N_CORES_EXECUTOR) - - override val executorIdToExecutor: Map[String, ExecutorTaskStatus] = { - (0 until nHosts).flatMap { hostIdx => - val hostName = "host-" + hostIdx - (0 until nExecutorsPerHost).map { subIdx => - val executorId = (hostIdx * nExecutorsPerHost + subIdx).toString - executorId -> - ExecutorTaskStatus(host = hostName, executorId = executorId, nCoresPerExecutor) - } - }.toMap - } - - override def defaultParallelism(): Int = nHosts * nExecutorsPerHost * nCoresPerExecutor -} - -class MockRDDWithLocalityPrefs( - sc: SparkContext, - numPartitions: Int, - shuffleDeps: Seq[ShuffleDependency[Int, Int, Nothing]], - val preferredLoc: String) extends MockRDD(sc, numPartitions, shuffleDeps) { - override def getPreferredLocations(split: Partition): Seq[String] = { - Seq(preferredLoc) - } -} diff --git a/core/src/test/scala/org/apache/spark/scheduler/BlacklistTrackerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/BlacklistTrackerSuite.scala deleted file mode 100644 index a1671a58f0d9b..0000000000000 --- a/core/src/test/scala/org/apache/spark/scheduler/BlacklistTrackerSuite.scala +++ /dev/null @@ -1,608 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.scheduler - -import org.mockito.ArgumentMatchers.any -import org.mockito.Mockito.{never, verify, when} -import org.mockito.invocation.InvocationOnMock -import org.scalatest.BeforeAndAfterEach -import org.scalatestplus.mockito.MockitoSugar - -import org.apache.spark._ -import org.apache.spark.internal.config -import org.apache.spark.util.ManualClock - -class BlacklistTrackerSuite extends SparkFunSuite with BeforeAndAfterEach with MockitoSugar - with LocalSparkContext { - - private val clock = new ManualClock(0) - - private var blacklist: BlacklistTracker = _ - private var listenerBusMock: LiveListenerBus = _ - private var scheduler: TaskSchedulerImpl = _ - private var conf: SparkConf = _ - - override def beforeEach(): Unit = { - conf = new SparkConf().setAppName("test").setMaster("local") - .set(config.BLACKLIST_ENABLED.key, "true") - scheduler = mockTaskSchedWithConf(conf) - - clock.setTime(0) - - listenerBusMock = mock[LiveListenerBus] - blacklist = new BlacklistTracker(listenerBusMock, conf, None, clock) - } - - override def afterEach(): Unit = { - if (blacklist != null) { - blacklist = null - } - if (scheduler != null) { - scheduler.stop() - scheduler = null - } - super.afterEach() - } - - // All executors and hosts used in tests should be in this set, so that [[assertEquivalentToSet]] - // works. Its OK if its got extraneous entries - val allExecutorAndHostIds = { - (('A' to 'Z')++ (1 to 100).map(_.toString)) - .flatMap{ suffix => - Seq(s"host$suffix", s"host-$suffix") - } - }.toSet - - /** - * Its easier to write our tests as if we could directly look at the sets of nodes & executors in - * the blacklist. However the api doesn't expose a set, so this is a simple way to test - * something similar, since we know the universe of values that might appear in these sets. - */ - def assertEquivalentToSet(f: String => Boolean, expected: Set[String]): Unit = { - allExecutorAndHostIds.foreach { id => - val actual = f(id) - val exp = expected.contains(id) - assert(actual === exp, raw"""for string "$id" """) - } - } - - def mockTaskSchedWithConf(conf: SparkConf): TaskSchedulerImpl = { - sc = new SparkContext(conf) - val scheduler = mock[TaskSchedulerImpl] - when(scheduler.sc).thenReturn(sc) - when(scheduler.mapOutputTracker).thenReturn( - SparkEnv.get.mapOutputTracker.asInstanceOf[MapOutputTrackerMaster]) - scheduler - } - - def createTaskSetBlacklist(stageId: Int = 0): TaskSetBlacklist = { - new TaskSetBlacklist(listenerBusMock, conf, stageId, stageAttemptId = 0, clock = clock) - } - - test("executors can be blacklisted with only a few failures per stage") { - // For many different stages, executor 1 fails a task, then executor 2 succeeds the task, - // and then the task set is done. Not enough failures to blacklist the executor *within* - // any particular taskset, but we still blacklist the executor overall eventually. - // Also, we intentionally have a mix of task successes and failures -- there are even some - // successes after the executor is blacklisted. The idea here is those tasks get scheduled - // before the executor is blacklisted. We might get successes after blacklisting (because the - // executor might be flaky but not totally broken). But successes should not unblacklist the - // executor. - val failuresUntilBlacklisted = conf.get(config.MAX_FAILURES_PER_EXEC) - var failuresSoFar = 0 - (0 until failuresUntilBlacklisted * 10).foreach { stageId => - val taskSetBlacklist = createTaskSetBlacklist(stageId) - if (stageId % 2 == 0) { - // fail one task in every other taskset - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "1", index = 0, failureReason = "testing") - failuresSoFar += 1 - } - blacklist.updateBlacklistForSuccessfulTaskSet(stageId, 0, taskSetBlacklist.execToFailures) - assert(failuresSoFar == stageId / 2 + 1) - if (failuresSoFar < failuresUntilBlacklisted) { - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set()) - } else { - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set("1")) - verify(listenerBusMock).post( - SparkListenerExecutorBlacklisted(0, "1", failuresUntilBlacklisted)) - } - } - } - - // If an executor has many task failures, but the task set ends up failing, it shouldn't be - // counted against the executor. - test("executors aren't blacklisted as a result of tasks in failed task sets") { - val failuresUntilBlacklisted = conf.get(config.MAX_FAILURES_PER_EXEC) - // for many different stages, executor 1 fails a task, and then the taskSet fails. - (0 until failuresUntilBlacklisted * 10).foreach { stage => - val taskSetBlacklist = createTaskSetBlacklist(stage) - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "1", index = 0, failureReason = "testing") - } - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set()) - } - - Seq(true, false).foreach { succeedTaskSet => - val label = if (succeedTaskSet) "success" else "failure" - test(s"stage blacklist updates correctly on stage $label") { - // Within one taskset, an executor fails a few times, so it's blacklisted for the taskset. - // But if the taskset fails, we shouldn't blacklist the executor after the stage. - val taskSetBlacklist = createTaskSetBlacklist(0) - // We trigger enough failures for both the taskset blacklist, and the application blacklist. - val numFailures = math.max(conf.get(config.MAX_FAILURES_PER_EXEC), - conf.get(config.MAX_FAILURES_PER_EXEC_STAGE)) - (0 until numFailures).foreach { index => - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "1", index = index, failureReason = "testing") - } - assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet("1")) - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set()) - if (succeedTaskSet) { - // The task set succeeded elsewhere, so we should count those failures against our executor, - // and it should be blacklisted for the entire application. - blacklist.updateBlacklistForSuccessfulTaskSet(0, 0, taskSetBlacklist.execToFailures) - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set("1")) - verify(listenerBusMock).post(SparkListenerExecutorBlacklisted(0, "1", numFailures)) - } else { - // The task set failed, so we don't count these failures against the executor for other - // stages. - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set()) - } - } - } - - test("blacklisted executors and nodes get recovered with time") { - val taskSetBlacklist0 = createTaskSetBlacklist(stageId = 0) - // Fail 4 tasks in one task set on executor 1, so that executor gets blacklisted for the whole - // application. - (0 until 4).foreach { partition => - taskSetBlacklist0.updateBlacklistForFailedTask( - "hostA", exec = "1", index = partition, failureReason = "testing") - } - blacklist.updateBlacklistForSuccessfulTaskSet(0, 0, taskSetBlacklist0.execToFailures) - assert(blacklist.nodeBlacklist() === Set()) - assertEquivalentToSet(blacklist.isNodeBlacklisted(_), Set()) - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set("1")) - verify(listenerBusMock).post(SparkListenerExecutorBlacklisted(0, "1", 4)) - - val taskSetBlacklist1 = createTaskSetBlacklist(stageId = 1) - // Fail 4 tasks in one task set on executor 2, so that executor gets blacklisted for the whole - // application. Since that's the second executor that is blacklisted on the same node, we also - // blacklist that node. - (0 until 4).foreach { partition => - taskSetBlacklist1.updateBlacklistForFailedTask( - "hostA", exec = "2", index = partition, failureReason = "testing") - } - blacklist.updateBlacklistForSuccessfulTaskSet(0, 0, taskSetBlacklist1.execToFailures) - assert(blacklist.nodeBlacklist() === Set("hostA")) - assertEquivalentToSet(blacklist.isNodeBlacklisted(_), Set("hostA")) - verify(listenerBusMock).post(SparkListenerNodeBlacklisted(0, "hostA", 2)) - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set("1", "2")) - verify(listenerBusMock).post(SparkListenerExecutorBlacklisted(0, "2", 4)) - - // Advance the clock and then make sure hostA and executors 1 and 2 have been removed from the - // blacklist. - val timeout = blacklist.BLACKLIST_TIMEOUT_MILLIS + 1 - clock.advance(timeout) - blacklist.applyBlacklistTimeout() - assert(blacklist.nodeBlacklist() === Set()) - assertEquivalentToSet(blacklist.isNodeBlacklisted(_), Set()) - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set()) - verify(listenerBusMock).post(SparkListenerExecutorUnblacklisted(timeout, "2")) - verify(listenerBusMock).post(SparkListenerExecutorUnblacklisted(timeout, "1")) - verify(listenerBusMock).post(SparkListenerNodeUnblacklisted(timeout, "hostA")) - - // Fail one more task, but executor isn't put back into blacklist since the count of failures - // on that executor should have been reset to 0. - val taskSetBlacklist2 = createTaskSetBlacklist(stageId = 2) - taskSetBlacklist2.updateBlacklistForFailedTask( - "hostA", exec = "1", index = 0, failureReason = "testing") - blacklist.updateBlacklistForSuccessfulTaskSet(2, 0, taskSetBlacklist2.execToFailures) - assert(blacklist.nodeBlacklist() === Set()) - assertEquivalentToSet(blacklist.isNodeBlacklisted(_), Set()) - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set()) - } - - test("blacklist can handle lost executors") { - // The blacklist should still work if an executor is killed completely. We should still - // be able to blacklist the entire node. - val taskSetBlacklist0 = createTaskSetBlacklist(stageId = 0) - // Lets say that executor 1 dies completely. We get some task failures, but - // the taskset then finishes successfully (elsewhere). - (0 until 4).foreach { partition => - taskSetBlacklist0.updateBlacklistForFailedTask( - "hostA", exec = "1", index = partition, failureReason = "testing") - } - blacklist.handleRemovedExecutor("1") - blacklist.updateBlacklistForSuccessfulTaskSet( - stageId = 0, - stageAttemptId = 0, - taskSetBlacklist0.execToFailures) - assert(blacklist.isExecutorBlacklisted("1")) - verify(listenerBusMock).post(SparkListenerExecutorBlacklisted(0, "1", 4)) - val t1 = blacklist.BLACKLIST_TIMEOUT_MILLIS / 2 - clock.advance(t1) - - // Now another executor gets spun up on that host, but it also dies. - val taskSetBlacklist1 = createTaskSetBlacklist(stageId = 1) - (0 until 4).foreach { partition => - taskSetBlacklist1.updateBlacklistForFailedTask( - "hostA", exec = "2", index = partition, failureReason = "testing") - } - blacklist.handleRemovedExecutor("2") - blacklist.updateBlacklistForSuccessfulTaskSet( - stageId = 1, - stageAttemptId = 0, - taskSetBlacklist1.execToFailures) - // We've now had two bad executors on the hostA, so we should blacklist the entire node. - assert(blacklist.isExecutorBlacklisted("1")) - assert(blacklist.isExecutorBlacklisted("2")) - verify(listenerBusMock).post(SparkListenerExecutorBlacklisted(t1, "2", 4)) - assert(blacklist.isNodeBlacklisted("hostA")) - verify(listenerBusMock).post(SparkListenerNodeBlacklisted(t1, "hostA", 2)) - - // Advance the clock so that executor 1 should no longer be explicitly blacklisted, but - // everything else should still be blacklisted. - val t2 = blacklist.BLACKLIST_TIMEOUT_MILLIS / 2 + 1 - clock.advance(t2) - blacklist.applyBlacklistTimeout() - assert(!blacklist.isExecutorBlacklisted("1")) - verify(listenerBusMock).post(SparkListenerExecutorUnblacklisted(t1 + t2, "1")) - assert(blacklist.isExecutorBlacklisted("2")) - assert(blacklist.isNodeBlacklisted("hostA")) - // make sure we don't leak memory - assert(!blacklist.executorIdToBlacklistStatus.contains("1")) - assert(!blacklist.nodeToBlacklistedExecs("hostA").contains("1")) - // Advance the timeout again so now hostA should be removed from the blacklist. - clock.advance(t1) - blacklist.applyBlacklistTimeout() - assert(!blacklist.nodeIdToBlacklistExpiryTime.contains("hostA")) - verify(listenerBusMock).post(SparkListenerNodeUnblacklisted(t1 + t2 + t1, "hostA")) - // Even though unblacklisting a node implicitly unblacklists all of its executors, - // there will be no SparkListenerExecutorUnblacklisted sent here. - } - - test("task failures expire with time") { - // Verifies that 2 failures within the timeout period cause an executor to be blacklisted, but - // if task failures are spaced out by more than the timeout period, the first failure is timed - // out, and the executor isn't blacklisted. - var stageId = 0 - - def failOneTaskInTaskSet(exec: String): Unit = { - val taskSetBlacklist = createTaskSetBlacklist(stageId = stageId) - taskSetBlacklist.updateBlacklistForFailedTask("host-" + exec, exec, 0, "testing") - blacklist.updateBlacklistForSuccessfulTaskSet(stageId, 0, taskSetBlacklist.execToFailures) - stageId += 1 - } - - failOneTaskInTaskSet(exec = "1") - // We have one sporadic failure on exec 2, but that's it. Later checks ensure that we never - // blacklist executor 2 despite this one failure. - failOneTaskInTaskSet(exec = "2") - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set()) - assert(blacklist.nextExpiryTime === Long.MaxValue) - - // We advance the clock past the expiry time. - clock.advance(blacklist.BLACKLIST_TIMEOUT_MILLIS + 1) - val t0 = clock.getTimeMillis() - blacklist.applyBlacklistTimeout() - assert(blacklist.nextExpiryTime === Long.MaxValue) - failOneTaskInTaskSet(exec = "1") - - // Because the 2nd failure on executor 1 happened past the expiry time, nothing should have been - // blacklisted. - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set()) - - // Now we add one more failure, within the timeout, and it should be counted. - clock.setTime(t0 + blacklist.BLACKLIST_TIMEOUT_MILLIS - 1) - val t1 = clock.getTimeMillis() - failOneTaskInTaskSet(exec = "1") - blacklist.applyBlacklistTimeout() - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set("1")) - verify(listenerBusMock).post(SparkListenerExecutorBlacklisted(t1, "1", 2)) - assert(blacklist.nextExpiryTime === t1 + blacklist.BLACKLIST_TIMEOUT_MILLIS) - - // Add failures on executor 3, make sure it gets put on the blacklist. - clock.setTime(t1 + blacklist.BLACKLIST_TIMEOUT_MILLIS - 1) - val t2 = clock.getTimeMillis() - failOneTaskInTaskSet(exec = "3") - failOneTaskInTaskSet(exec = "3") - blacklist.applyBlacklistTimeout() - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set("1", "3")) - verify(listenerBusMock).post(SparkListenerExecutorBlacklisted(t2, "3", 2)) - assert(blacklist.nextExpiryTime === t1 + blacklist.BLACKLIST_TIMEOUT_MILLIS) - - // Now we go past the timeout for executor 1, so it should be dropped from the blacklist. - clock.setTime(t1 + blacklist.BLACKLIST_TIMEOUT_MILLIS + 1) - blacklist.applyBlacklistTimeout() - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set("3")) - verify(listenerBusMock).post(SparkListenerExecutorUnblacklisted(clock.getTimeMillis(), "1")) - assert(blacklist.nextExpiryTime === t2 + blacklist.BLACKLIST_TIMEOUT_MILLIS) - - // Make sure that we update correctly when we go from having blacklisted executors to - // just having tasks with timeouts. - clock.setTime(t2 + blacklist.BLACKLIST_TIMEOUT_MILLIS - 1) - failOneTaskInTaskSet(exec = "4") - blacklist.applyBlacklistTimeout() - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set("3")) - assert(blacklist.nextExpiryTime === t2 + blacklist.BLACKLIST_TIMEOUT_MILLIS) - - clock.setTime(t2 + blacklist.BLACKLIST_TIMEOUT_MILLIS + 1) - blacklist.applyBlacklistTimeout() - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set()) - verify(listenerBusMock).post(SparkListenerExecutorUnblacklisted(clock.getTimeMillis(), "3")) - // we've got one task failure still, but we don't bother setting nextExpiryTime to it, to - // avoid wasting time checking for expiry of individual task failures. - assert(blacklist.nextExpiryTime === Long.MaxValue) - } - - test("task failure timeout works as expected for long-running tasksets") { - // This ensures that we don't trigger spurious blacklisting for long tasksets, when the taskset - // finishes long after the task failures. We create two tasksets, each with one failure. - // Individually they shouldn't cause any blacklisting since there is only one failure. - // Furthermore, we space the failures out so far that even when both tasksets have completed, - // we still don't trigger any blacklisting. - val taskSetBlacklist1 = createTaskSetBlacklist(stageId = 1) - val taskSetBlacklist2 = createTaskSetBlacklist(stageId = 2) - // Taskset1 has one failure immediately - taskSetBlacklist1.updateBlacklistForFailedTask("host-1", "1", 0, "testing") - // Then we have a *long* delay, much longer than the timeout, before any other failures or - // taskset completion - clock.advance(blacklist.BLACKLIST_TIMEOUT_MILLIS * 5) - // After the long delay, we have one failure on taskset 2, on the same executor - taskSetBlacklist2.updateBlacklistForFailedTask("host-1", "1", 0, "testing") - // Finally, we complete both tasksets. Its important here to complete taskset2 *first*. We - // want to make sure that when taskset 1 finishes, even though we've now got two task failures, - // we realize that the task failure we just added was well before the timeout. - clock.advance(1) - blacklist.updateBlacklistForSuccessfulTaskSet(stageId = 2, 0, taskSetBlacklist2.execToFailures) - clock.advance(1) - blacklist.updateBlacklistForSuccessfulTaskSet(stageId = 1, 0, taskSetBlacklist1.execToFailures) - - // Make sure nothing was blacklisted - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set()) - } - - test("only blacklist nodes for the application when enough executors have failed on that " + - "specific host") { - // we blacklist executors on two different hosts -- make sure that doesn't lead to any - // node blacklisting - val taskSetBlacklist0 = createTaskSetBlacklist(stageId = 0) - taskSetBlacklist0.updateBlacklistForFailedTask( - "hostA", exec = "1", index = 0, failureReason = "testing") - taskSetBlacklist0.updateBlacklistForFailedTask( - "hostA", exec = "1", index = 1, failureReason = "testing") - blacklist.updateBlacklistForSuccessfulTaskSet(0, 0, taskSetBlacklist0.execToFailures) - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set("1")) - verify(listenerBusMock).post(SparkListenerExecutorBlacklisted(0, "1", 2)) - assertEquivalentToSet(blacklist.isNodeBlacklisted(_), Set()) - - val taskSetBlacklist1 = createTaskSetBlacklist(stageId = 1) - taskSetBlacklist1.updateBlacklistForFailedTask( - "hostB", exec = "2", index = 0, failureReason = "testing") - taskSetBlacklist1.updateBlacklistForFailedTask( - "hostB", exec = "2", index = 1, failureReason = "testing") - blacklist.updateBlacklistForSuccessfulTaskSet(1, 0, taskSetBlacklist1.execToFailures) - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set("1", "2")) - verify(listenerBusMock).post(SparkListenerExecutorBlacklisted(0, "2", 2)) - assertEquivalentToSet(blacklist.isNodeBlacklisted(_), Set()) - - // Finally, blacklist another executor on the same node as the original blacklisted executor, - // and make sure this time we *do* blacklist the node. - val taskSetBlacklist2 = createTaskSetBlacklist(stageId = 0) - taskSetBlacklist2.updateBlacklistForFailedTask( - "hostA", exec = "3", index = 0, failureReason = "testing") - taskSetBlacklist2.updateBlacklistForFailedTask( - "hostA", exec = "3", index = 1, failureReason = "testing") - blacklist.updateBlacklistForSuccessfulTaskSet(0, 0, taskSetBlacklist2.execToFailures) - assertEquivalentToSet(blacklist.isExecutorBlacklisted(_), Set("1", "2", "3")) - verify(listenerBusMock).post(SparkListenerExecutorBlacklisted(0, "3", 2)) - assertEquivalentToSet(blacklist.isNodeBlacklisted(_), Set("hostA")) - verify(listenerBusMock).post(SparkListenerNodeBlacklisted(0, "hostA", 2)) - } - - test("blacklist still respects legacy configs") { - val conf = new SparkConf().setMaster("local") - assert(!BlacklistTracker.isBlacklistEnabled(conf)) - conf.set(config.BLACKLIST_LEGACY_TIMEOUT_CONF, 5000L) - assert(BlacklistTracker.isBlacklistEnabled(conf)) - assert(5000 === BlacklistTracker.getBlacklistTimeout(conf)) - // the new conf takes precedence, though - conf.set(config.BLACKLIST_TIMEOUT_CONF, 1000L) - assert(1000 === BlacklistTracker.getBlacklistTimeout(conf)) - - // if you explicitly set the legacy conf to 0, that also would disable blacklisting - conf.set(config.BLACKLIST_LEGACY_TIMEOUT_CONF, 0L) - assert(!BlacklistTracker.isBlacklistEnabled(conf)) - // but again, the new conf takes precedence - conf.set(config.BLACKLIST_ENABLED, true) - assert(BlacklistTracker.isBlacklistEnabled(conf)) - assert(1000 === BlacklistTracker.getBlacklistTimeout(conf)) - } - - test("check blacklist configuration invariants") { - val conf = new SparkConf().setMaster("yarn").set(config.SUBMIT_DEPLOY_MODE, "cluster") - Seq( - (2, 2), - (2, 3) - ).foreach { case (maxTaskFailures, maxNodeAttempts) => - conf.set(config.TASK_MAX_FAILURES, maxTaskFailures) - conf.set(config.MAX_TASK_ATTEMPTS_PER_NODE.key, maxNodeAttempts.toString) - val excMsg = intercept[IllegalArgumentException] { - BlacklistTracker.validateBlacklistConfs(conf) - }.getMessage() - assert(excMsg === s"${config.MAX_TASK_ATTEMPTS_PER_NODE.key} " + - s"( = ${maxNodeAttempts}) was >= ${config.TASK_MAX_FAILURES.key} " + - s"( = ${maxTaskFailures} ). Though blacklisting is enabled, with this configuration, " + - s"Spark will not be robust to one bad node. Decrease " + - s"${config.MAX_TASK_ATTEMPTS_PER_NODE.key}, increase ${config.TASK_MAX_FAILURES.key}, " + - s"or disable blacklisting with ${config.BLACKLIST_ENABLED.key}") - } - - conf.remove(config.TASK_MAX_FAILURES) - conf.remove(config.MAX_TASK_ATTEMPTS_PER_NODE) - - Seq( - config.MAX_TASK_ATTEMPTS_PER_EXECUTOR, - config.MAX_TASK_ATTEMPTS_PER_NODE, - config.MAX_FAILURES_PER_EXEC_STAGE, - config.MAX_FAILED_EXEC_PER_NODE_STAGE, - config.MAX_FAILURES_PER_EXEC, - config.MAX_FAILED_EXEC_PER_NODE, - config.BLACKLIST_TIMEOUT_CONF - ).foreach { config => - conf.set(config.key, "0") - val excMsg = intercept[IllegalArgumentException] { - BlacklistTracker.validateBlacklistConfs(conf) - }.getMessage() - assert(excMsg.contains(s"${config.key} was 0, but must be > 0.")) - conf.remove(config) - } - } - - test("blacklisting kills executors, configured by BLACKLIST_KILL_ENABLED") { - val allocationClientMock = mock[ExecutorAllocationClient] - when(allocationClientMock.killExecutors(any(), any(), any(), any())).thenReturn(Seq("called")) - when(allocationClientMock.killExecutorsOnHost("hostA")).thenAnswer { (_: InvocationOnMock) => - // To avoid a race between blacklisting and killing, it is important that the nodeBlacklist - // is updated before we ask the executor allocation client to kill all the executors - // on a particular host. - if (blacklist.nodeBlacklist.contains("hostA")) { - true - } else { - throw new IllegalStateException("hostA should be on the blacklist") - } - } - blacklist = new BlacklistTracker(listenerBusMock, conf, Some(allocationClientMock), clock) - - // Disable auto-kill. Blacklist an executor and make sure killExecutors is not called. - conf.set(config.BLACKLIST_KILL_ENABLED, false) - - val taskSetBlacklist0 = createTaskSetBlacklist(stageId = 0) - // Fail 4 tasks in one task set on executor 1, so that executor gets blacklisted for the whole - // application. - (0 until 4).foreach { partition => - taskSetBlacklist0.updateBlacklistForFailedTask( - "hostA", exec = "1", index = partition, failureReason = "testing") - } - blacklist.updateBlacklistForSuccessfulTaskSet(0, 0, taskSetBlacklist0.execToFailures) - - verify(allocationClientMock, never).killExecutor(any()) - - val taskSetBlacklist1 = createTaskSetBlacklist(stageId = 1) - // Fail 4 tasks in one task set on executor 2, so that executor gets blacklisted for the whole - // application. Since that's the second executor that is blacklisted on the same node, we also - // blacklist that node. - (0 until 4).foreach { partition => - taskSetBlacklist1.updateBlacklistForFailedTask( - "hostA", exec = "2", index = partition, failureReason = "testing") - } - blacklist.updateBlacklistForSuccessfulTaskSet(0, 0, taskSetBlacklist1.execToFailures) - - verify(allocationClientMock, never).killExecutors(any(), any(), any(), any()) - verify(allocationClientMock, never).killExecutorsOnHost(any()) - - // Enable auto-kill. Blacklist an executor and make sure killExecutors is called. - conf.set(config.BLACKLIST_KILL_ENABLED, true) - blacklist = new BlacklistTracker(listenerBusMock, conf, Some(allocationClientMock), clock) - - val taskSetBlacklist2 = createTaskSetBlacklist(stageId = 0) - // Fail 4 tasks in one task set on executor 1, so that executor gets blacklisted for the whole - // application. - (0 until 4).foreach { partition => - taskSetBlacklist2.updateBlacklistForFailedTask( - "hostA", exec = "1", index = partition, failureReason = "testing") - } - blacklist.updateBlacklistForSuccessfulTaskSet(0, 0, taskSetBlacklist2.execToFailures) - - verify(allocationClientMock).killExecutors(Seq("1"), false, false, true) - - val taskSetBlacklist3 = createTaskSetBlacklist(stageId = 1) - // Fail 4 tasks in one task set on executor 2, so that executor gets blacklisted for the whole - // application. Since that's the second executor that is blacklisted on the same node, we also - // blacklist that node. - (0 until 4).foreach { partition => - taskSetBlacklist3.updateBlacklistForFailedTask( - "hostA", exec = "2", index = partition, failureReason = "testing") - } - blacklist.updateBlacklistForSuccessfulTaskSet(0, 0, taskSetBlacklist3.execToFailures) - - verify(allocationClientMock).killExecutors(Seq("2"), false, false, true) - verify(allocationClientMock).killExecutorsOnHost("hostA") - } - - test("fetch failure blacklisting kills executors, configured by BLACKLIST_KILL_ENABLED") { - val allocationClientMock = mock[ExecutorAllocationClient] - when(allocationClientMock.killExecutors(any(), any(), any(), any())).thenReturn(Seq("called")) - when(allocationClientMock.killExecutorsOnHost("hostA")).thenAnswer { (_: InvocationOnMock) => - // To avoid a race between blacklisting and killing, it is important that the nodeBlacklist - // is updated before we ask the executor allocation client to kill all the executors - // on a particular host. - if (blacklist.nodeBlacklist.contains("hostA")) { - true - } else { - throw new IllegalStateException("hostA should be on the blacklist") - } - } - - conf.set(config.BLACKLIST_FETCH_FAILURE_ENABLED, true) - blacklist = new BlacklistTracker(listenerBusMock, conf, Some(allocationClientMock), clock) - - // Disable auto-kill. Blacklist an executor and make sure killExecutors is not called. - conf.set(config.BLACKLIST_KILL_ENABLED, false) - blacklist.updateBlacklistForFetchFailure("hostA", exec = "1") - - verify(allocationClientMock, never).killExecutors(any(), any(), any(), any()) - verify(allocationClientMock, never).killExecutorsOnHost(any()) - - assert(blacklist.nodeToBlacklistedExecs.contains("hostA")) - assert(blacklist.nodeToBlacklistedExecs("hostA").contains("1")) - - // Enable auto-kill. Blacklist an executor and make sure killExecutors is called. - conf.set(config.BLACKLIST_KILL_ENABLED, true) - blacklist = new BlacklistTracker(listenerBusMock, conf, Some(allocationClientMock), clock) - clock.advance(1000) - blacklist.updateBlacklistForFetchFailure("hostA", exec = "1") - - verify(allocationClientMock).killExecutors(Seq("1"), false, false, true) - verify(allocationClientMock, never).killExecutorsOnHost(any()) - - assert(blacklist.executorIdToBlacklistStatus.contains("1")) - assert(blacklist.executorIdToBlacklistStatus("1").node === "hostA") - assert(blacklist.executorIdToBlacklistStatus("1").expiryTime === - 1000 + blacklist.BLACKLIST_TIMEOUT_MILLIS) - assert(blacklist.nextExpiryTime === 1000 + blacklist.BLACKLIST_TIMEOUT_MILLIS) - assert(blacklist.nodeIdToBlacklistExpiryTime.isEmpty) - assert(blacklist.nodeToBlacklistedExecs.contains("hostA")) - assert(blacklist.nodeToBlacklistedExecs("hostA").contains("1")) - - // Enable external shuffle service to see if all the executors on this node will be killed. - conf.set(config.SHUFFLE_SERVICE_ENABLED, true) - clock.advance(1000) - blacklist.updateBlacklistForFetchFailure("hostA", exec = "2") - - verify(allocationClientMock, never).killExecutors(Seq("2"), true, true) - verify(allocationClientMock).killExecutorsOnHost("hostA") - - assert(blacklist.nodeIdToBlacklistExpiryTime.contains("hostA")) - assert(blacklist.nodeIdToBlacklistExpiryTime("hostA") === - 2000 + blacklist.BLACKLIST_TIMEOUT_MILLIS) - assert(blacklist.nextExpiryTime === 1000 + blacklist.BLACKLIST_TIMEOUT_MILLIS) - } -} diff --git a/core/src/test/scala/org/apache/spark/scheduler/CoarseGrainedSchedulerBackendSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/CoarseGrainedSchedulerBackendSuite.scala index d648293fdbe06..3ce4ccf8d632e 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/CoarseGrainedSchedulerBackendSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/CoarseGrainedSchedulerBackendSuite.scala @@ -99,8 +99,8 @@ class CoarseGrainedSchedulerBackendSuite extends SparkFunSuite with LocalSparkCo Thread.sleep(5000) iter } - var taskStarted = new AtomicBoolean(false) - var taskEnded = new AtomicBoolean(false) + val taskStarted = new AtomicBoolean(false) + val taskEnded = new AtomicBoolean(false) val listener = new SparkListener() { override def onTaskStart(taskStart: SparkListenerTaskStart): Unit = { taskStarted.set(true) @@ -188,7 +188,6 @@ class CoarseGrainedSchedulerBackendSuite extends SparkFunSuite with LocalSparkCo } test("extra resources from executor") { - import TestUtils._ val execCores = 3 val conf = new SparkConf() @@ -240,12 +239,13 @@ class CoarseGrainedSchedulerBackendSuite extends SparkFunSuite with LocalSparkCo var execResources = backend.getExecutorAvailableResources("1") assert(execResources(GPU).availableAddrs.sorted === Array("0", "1", "3")) - var exec3ResourceProfileId = backend.getExecutorResourceProfileId("3") + val exec3ResourceProfileId = backend.getExecutorResourceProfileId("3") assert(exec3ResourceProfileId === rp.id) val taskResources = Map(GPU -> new ResourceInformation(GPU, Array("0"))) - var taskDescs: Seq[Seq[TaskDescription]] = Seq(Seq(new TaskDescription(1, 0, "1", - "t1", 0, 1, mutable.Map.empty[String, Long], mutable.Map.empty[String, Long], + val taskDescs: Seq[Seq[TaskDescription]] = Seq(Seq(new TaskDescription(1, 0, "1", + "t1", 0, 1, mutable.Map.empty[String, Long], + mutable.Map.empty[String, Long], mutable.Map.empty[String, Long], new Properties(), taskResources, bytebuffer))) val ts = backend.getTaskSchedulerImpl() when(ts.resourceOffers(any[IndexedSeq[WorkerOffer]], any[Boolean])).thenReturn(taskDescs) @@ -300,7 +300,7 @@ private class CSMockExternalClusterManager extends ExternalClusterManager { when(ts.applicationId()).thenReturn("appid1") when(ts.applicationAttemptId()).thenReturn(Some("attempt1")) when(ts.schedulingMode).thenReturn(SchedulingMode.FIFO) - when(ts.nodeBlacklist()).thenReturn(Set.empty[String]) + when(ts.excludedNodes()).thenReturn(Set.empty[String]) ts } diff --git a/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala index 4c6033edff247..4c74e4fbb3728 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/DAGSchedulerSuite.scala @@ -19,12 +19,15 @@ package org.apache.spark.scheduler import java.util.Properties import java.util.concurrent.{CountDownLatch, TimeUnit} -import java.util.concurrent.atomic.{AtomicBoolean, AtomicInteger, AtomicLong, AtomicReference} +import java.util.concurrent.atomic.{AtomicBoolean, AtomicLong, AtomicReference} import scala.annotation.meta.param import scala.collection.mutable.{ArrayBuffer, HashMap, HashSet, Map} import scala.util.control.NonFatal +import org.mockito.Mockito.spy +import org.mockito.Mockito.times +import org.mockito.Mockito.verify import org.scalatest.concurrent.{Signaler, ThreadSignaler, TimeLimits} import org.scalatest.exceptions.TestFailedException import org.scalatest.time.SpanSugar._ @@ -39,7 +42,7 @@ import org.apache.spark.resource.ResourceUtils.{FPGA, GPU} import org.apache.spark.scheduler.SchedulingMode.SchedulingMode import org.apache.spark.shuffle.{FetchFailedException, MetadataFetchFailedException} import org.apache.spark.storage.{BlockId, BlockManagerId, BlockManagerMaster} -import org.apache.spark.util.{AccumulatorContext, AccumulatorV2, CallSite, LongAccumulator, ThreadUtils, Utils} +import org.apache.spark.util.{AccumulatorContext, AccumulatorV2, CallSite, LongAccumulator, Utils} class DAGSchedulerEventProcessLoopTester(dagScheduler: DAGScheduler) extends DAGSchedulerEventProcessLoop(dagScheduler) { @@ -122,14 +125,14 @@ class MyRDD( class DAGSchedulerSuiteDummyException extends Exception -class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLimits { +class DAGSchedulerSuite extends SparkFunSuite with TempLocalSparkContext with TimeLimits { import DAGSchedulerSuite._ // Necessary to make ScalaTest 3.x interrupt a thread on the JVM like ScalaTest 2.2.x implicit val defaultSignaler: Signaler = ThreadSignaler - val conf = new SparkConf + private var firstInit: Boolean = _ /** Set of TaskSets the DAGScheduler has requested executed. */ val taskSets = scala.collection.mutable.Buffer[TaskSet]() @@ -169,10 +172,14 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi } override def setDAGScheduler(dagScheduler: DAGScheduler) = {} override def defaultParallelism() = 2 - override def executorDecommission(executorId: String) = {} override def executorLost(executorId: String, reason: ExecutorLossReason): Unit = {} override def workerRemoved(workerId: String, host: String, message: String): Unit = {} override def applicationAttemptId(): Option[String] = None + override def executorDecommission( + executorId: String, + decommissionInfo: ExecutorDecommissionInfo): Unit = {} + override def getExecutorDecommissionState( + executorId: String): Option[ExecutorDecommissionState] = None } /** @@ -235,6 +242,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi var sparkListener: EventInfoRecordingListener = null + var blockManagerMaster: BlockManagerMaster = null var mapOutputTracker: MapOutputTrackerMaster = null var broadcastManager: BroadcastManager = null var securityMgr: SecurityManager = null @@ -248,17 +256,18 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi */ val cacheLocations = new HashMap[(Int, Int), Seq[BlockManagerId]] // stub out BlockManagerMaster.getLocations to use our cacheLocations - val blockManagerMaster = new BlockManagerMaster(null, null, conf, true) { - override def getLocations(blockIds: Array[BlockId]): IndexedSeq[Seq[BlockManagerId]] = { - blockIds.map { - _.asRDDId.map(id => (id.rddId -> id.splitIndex)).flatMap(key => cacheLocations.get(key)). - getOrElse(Seq()) - }.toIndexedSeq - } - override def removeExecutor(execId: String): Unit = { - // don't need to propagate to the driver, which we don't have - } + class MyBlockManagerMaster(conf: SparkConf) extends BlockManagerMaster(null, null, conf, true) { + override def getLocations(blockIds: Array[BlockId]): IndexedSeq[Seq[BlockManagerId]] = { + blockIds.map { + _.asRDDId.map { id => (id.rddId -> id.splitIndex) + }.flatMap { key => cacheLocations.get(key) + }.getOrElse(Seq()) + }.toIndexedSeq } + override def removeExecutor(execId: String): Unit = { + // don't need to propagate to the driver, which we don't have + } + } /** The list of results that DAGScheduler has collected. */ val results = new HashMap[Int, Any]() @@ -276,13 +285,31 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi override def jobFailed(exception: Exception): Unit = { failure = exception } } + class MyMapOutputTrackerMaster( + conf: SparkConf, + broadcastManager: BroadcastManager) + extends MapOutputTrackerMaster(conf, broadcastManager, true) { + + override def sendTracker(message: Any): Unit = { + // no-op, just so we can stop this to avoid leaking threads + } + } + override def beforeEach(): Unit = { super.beforeEach() - init(new SparkConf()) + firstInit = true + } + + override def sc: SparkContext = { + val sc = super.sc + if (firstInit) { + init(sc) + firstInit = false + } + sc } - private def init(testConf: SparkConf): Unit = { - sc = new SparkContext("local[2]", "DAGSchedulerSuite", testConf) + private def init(sc: SparkContext): Unit = { sparkListener = new EventInfoRecordingListener failure = null sc.addSparkListener(sparkListener) @@ -291,13 +318,10 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi cancelledStages.clear() cacheLocations.clear() results.clear() - securityMgr = new SecurityManager(conf) - broadcastManager = new BroadcastManager(true, conf, securityMgr) - mapOutputTracker = new MapOutputTrackerMaster(conf, broadcastManager, true) { - override def sendTracker(message: Any): Unit = { - // no-op, just so we can stop this to avoid leaking threads - } - } + securityMgr = new SecurityManager(sc.getConf) + broadcastManager = new BroadcastManager(true, sc.getConf) + mapOutputTracker = spy(new MyMapOutputTrackerMaster(sc.getConf, broadcastManager)) + blockManagerMaster = spy(new MyBlockManagerMaster(sc.getConf)) scheduler = new DAGScheduler( sc, taskScheduler, @@ -337,6 +361,8 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi * DAGScheduler event loop. */ private def runEvent(event: DAGSchedulerEvent): Unit = { + // Ensure the initialization of various components + sc dagEventProcessLoopTester.post(event) } @@ -349,9 +375,9 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi it.next.asInstanceOf[Tuple2[_, _]]._1 /** Send the given CompletionEvent messages for the tasks in the TaskSet. */ - private def complete(taskSet: TaskSet, results: Seq[(TaskEndReason, Any)]): Unit = { - assert(taskSet.tasks.size >= results.size) - for ((result, i) <- results.zipWithIndex) { + private def complete(taskSet: TaskSet, taskEndInfos: Seq[(TaskEndReason, Any)]): Unit = { + assert(taskSet.tasks.size >= taskEndInfos.size) + for ((result, i) <- taskEndInfos.zipWithIndex) { if (i < taskSet.tasks.size) { runEvent(makeCompletionEvent(taskSet.tasks(i), result._1, result._2)) } @@ -405,6 +431,15 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi runEvent(JobCancelled(jobId, None)) } + /** Make some tasks in task set success and check results. */ + private def completeAndCheckAnswer( + taskSet: TaskSet, + taskEndInfos: Seq[(TaskEndReason, Any)], + expected: Map[Int, Any]): Unit = { + complete(taskSet, taskEndInfos) + assert(this.results === expected) + } + test("[SPARK-3353] parent stage should have lower stage id") { sc.parallelize(1 to 10).map(x => (x, x)).reduceByKey(_ + _, 4).count() val stageByOrderOfExecution = sparkListener.stageByOrderOfExecution @@ -458,24 +493,19 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi assert(mapStageC.parents === List(mapStageA, mapStageB)) assert(finalStage.parents === List(mapStageC)) - complete(taskSets(0), Seq((Success, makeMapStatus("hostA", 1)))) - complete(taskSets(1), Seq((Success, makeMapStatus("hostA", 1)))) - complete(taskSets(2), Seq((Success, makeMapStatus("hostA", 1)))) - complete(taskSets(3), Seq((Success, 42))) - assert(results === Map(0 -> 42)) + completeShuffleMapStageSuccessfully(0, 0, 1) + completeShuffleMapStageSuccessfully(1, 0, 1) + completeShuffleMapStageSuccessfully(2, 0, 1) + completeAndCheckAnswer(taskSets(3), Seq((Success, 42)), Map(0 -> 42)) assertDataStructuresEmpty() } - test("All shuffle files on the slave should be cleaned up when slave lost") { - // reset the test context with the right shuffle service config - afterEach() - val conf = new SparkConf() + test("All shuffle files on the storage endpoint should be cleaned up when it is lost") { conf.set(config.SHUFFLE_SERVICE_ENABLED.key, "true") conf.set("spark.files.fetchFailure.unRegisterOutputOnHost", "true") - init(conf) - runEvent(ExecutorAdded("exec-hostA1", "hostA")) - runEvent(ExecutorAdded("exec-hostA2", "hostA")) - runEvent(ExecutorAdded("exec-hostB", "hostB")) + runEvent(ExecutorAdded("hostA-exec1", "hostA")) + runEvent(ExecutorAdded("hostA-exec2", "hostA")) + runEvent(ExecutorAdded("hostB-exec", "hostB")) val firstRDD = new MyRDD(sc, 3, Nil) val firstShuffleDep = new ShuffleDependency(firstRDD, new HashPartitioner(3)) val firstShuffleId = firstShuffleDep.shuffleId @@ -488,20 +518,20 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi complete(taskSets(0), Seq( (Success, MapStatus( - BlockManagerId("exec-hostA1", "hostA", 12345), Array.fill[Long](1)(2), mapTaskId = 5)), + BlockManagerId("hostA-exec1", "hostA", 12345), Array.fill[Long](1)(2), mapTaskId = 5)), (Success, MapStatus( - BlockManagerId("exec-hostA2", "hostA", 12345), Array.fill[Long](1)(2), mapTaskId = 6)), + BlockManagerId("hostA-exec2", "hostA", 12345), Array.fill[Long](1)(2), mapTaskId = 6)), (Success, makeMapStatus("hostB", 1, mapTaskId = 7)) )) // map stage2 completes successfully, with one task on each executor complete(taskSets(1), Seq( (Success, MapStatus( - BlockManagerId("exec-hostA1", "hostA", 12345), Array.fill[Long](1)(2), mapTaskId = 8)), + BlockManagerId("hostA-exec1", "hostA", 12345), Array.fill[Long](1)(2), mapTaskId = 8)), (Success, MapStatus( - BlockManagerId("exec-hostA2", "hostA", 12345), Array.fill[Long](1)(2), mapTaskId = 9)), + BlockManagerId("hostA-exec2", "hostA", 12345), Array.fill[Long](1)(2), mapTaskId = 9)), (Success, makeMapStatus("hostB", 1, mapTaskId = 10)) )) // make sure our test setup is correct @@ -509,19 +539,19 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi // val initialMapStatus1 = mapOutputTracker.mapStatuses.get(0).get assert(initialMapStatus1.count(_ != null) === 3) assert(initialMapStatus1.map{_.location.executorId}.toSet === - Set("exec-hostA1", "exec-hostA2", "exec-hostB")) + Set("hostA-exec1", "hostA-exec2", "hostB-exec")) assert(initialMapStatus1.map{_.mapId}.toSet === Set(5, 6, 7)) val initialMapStatus2 = mapOutputTracker.shuffleStatuses(secondShuffleId).mapStatuses // val initialMapStatus1 = mapOutputTracker.mapStatuses.get(0).get assert(initialMapStatus2.count(_ != null) === 3) assert(initialMapStatus2.map{_.location.executorId}.toSet === - Set("exec-hostA1", "exec-hostA2", "exec-hostB")) + Set("hostA-exec1", "hostA-exec2", "hostB-exec")) assert(initialMapStatus2.map{_.mapId}.toSet === Set(8, 9, 10)) // reduce stage fails with a fetch failure from one host complete(taskSets(2), Seq( - (FetchFailed(BlockManagerId("exec-hostA2", "hostA", 12345), + (FetchFailed(BlockManagerId("hostA-exec2", "hostA", 12345), firstShuffleId, 0L, 0, 0, "ignored"), null) )) @@ -531,15 +561,61 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val mapStatus1 = mapOutputTracker.shuffleStatuses(firstShuffleId).mapStatuses assert(mapStatus1.count(_ != null) === 1) - assert(mapStatus1(2).location.executorId === "exec-hostB") + assert(mapStatus1(2).location.executorId === "hostB-exec") assert(mapStatus1(2).location.host === "hostB") val mapStatus2 = mapOutputTracker.shuffleStatuses(secondShuffleId).mapStatuses assert(mapStatus2.count(_ != null) === 1) - assert(mapStatus2(2).location.executorId === "exec-hostB") + assert(mapStatus2(2).location.executorId === "hostB-exec") assert(mapStatus2(2).location.host === "hostB") } + test("SPARK-32003: All shuffle files for executor should be cleaned up on fetch failure") { + conf.set(config.SHUFFLE_SERVICE_ENABLED.key, "true") + + val shuffleMapRdd = new MyRDD(sc, 3, Nil) + val shuffleDep = new ShuffleDependency(shuffleMapRdd, new HashPartitioner(3)) + val shuffleId = shuffleDep.shuffleId + val reduceRdd = new MyRDD(sc, 3, List(shuffleDep), tracker = mapOutputTracker) + + submit(reduceRdd, Array(0, 1, 2)) + // Map stage completes successfully, + // two tasks are run on an executor on hostA and one on an executor on hostB + completeShuffleMapStageSuccessfully(0, 0, 3, Seq("hostA", "hostA", "hostB")) + // Now the executor on hostA is lost + runEvent(ExecutorLost("hostA-exec", ExecutorExited(-100, false, "Container marked as failed"))) + // Executor is removed but shuffle files are not unregistered + verify(blockManagerMaster, times(1)).removeExecutor("hostA-exec") + verify(mapOutputTracker, times(0)).removeOutputsOnExecutor("hostA-exec") + + // The MapOutputTracker has all the shuffle files + val mapStatuses = mapOutputTracker.shuffleStatuses(shuffleId).mapStatuses + assert(mapStatuses.count(_ != null) === 3) + assert(mapStatuses.count(s => s != null && s.location.executorId == "hostA-exec") === 2) + assert(mapStatuses.count(s => s != null && s.location.executorId == "hostB-exec") === 1) + + // Now a fetch failure from the lost executor occurs + complete(taskSets(1), Seq( + (FetchFailed(makeBlockManagerId("hostA"), shuffleId, 0L, 0, 0, "ignored"), null) + )) + // blockManagerMaster.removeExecutor is not called again + // but shuffle files are unregistered + verify(blockManagerMaster, times(1)).removeExecutor("hostA-exec") + verify(mapOutputTracker, times(1)).removeOutputsOnExecutor("hostA-exec") + + // Shuffle files for hostA-exec should be lost + assert(mapStatuses.count(_ != null) === 1) + assert(mapStatuses.count(s => s != null && s.location.executorId == "hostA-exec") === 0) + assert(mapStatuses.count(s => s != null && s.location.executorId == "hostB-exec") === 1) + + // Additional fetch failure from the executor does not result in further call to + // mapOutputTracker.removeOutputsOnExecutor + complete(taskSets(1), Seq( + (FetchFailed(makeBlockManagerId("hostA"), shuffleId, 0L, 1, 0, "ignored"), null) + )) + verify(mapOutputTracker, times(1)).removeOutputsOnExecutor("hostA-exec") + } + test("zero split job") { var numResults = 0 var failureReason: Option[Exception] = None @@ -558,8 +634,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi test("run trivial job") { submit(new MyRDD(sc, 1, Nil), Array(0)) - complete(taskSets(0), List((Success, 42))) - assert(results === Map(0 -> 42)) + completeAndCheckAnswer(taskSets(0), Seq((Success, 42)), Map(0 -> 42)) assertDataStructuresEmpty() } @@ -567,8 +642,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val baseRdd = new MyRDD(sc, 1, Nil) val finalRdd = new MyRDD(sc, 1, List(new OneToOneDependency(baseRdd))) submit(finalRdd, Array(0)) - complete(taskSets(0), Seq((Success, 42))) - assert(results === Map(0 -> 42)) + completeAndCheckAnswer(taskSets(0), Seq((Success, 42)), Map(0 -> 42)) assertDataStructuresEmpty() } @@ -592,8 +666,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi submit(finalRdd, Array(0)) val taskSet = taskSets(0) assertLocations(taskSet, Seq(Seq("hostA", "hostB"))) - complete(taskSet, Seq((Success, 42))) - assert(results === Map(0 -> 42)) + completeAndCheckAnswer(taskSet, Seq((Success, 42)), Map(0 -> 42)) assertDataStructuresEmpty() } @@ -710,10 +783,14 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi accumUpdates: Array[(Long, Seq[AccumulatorV2[_, _]])], blockManagerId: BlockManagerId, executorUpdates: Map[(Int, Int), ExecutorMetrics]): Boolean = true - override def executorDecommission(executorId: String): Unit = {} override def executorLost(executorId: String, reason: ExecutorLossReason): Unit = {} override def workerRemoved(workerId: String, host: String, message: String): Unit = {} override def applicationAttemptId(): Option[String] = None + override def executorDecommission( + executorId: String, + decommissionInfo: ExecutorDecommissionInfo): Unit = {} + override def getExecutorDecommissionState( + executorId: String): Option[ExecutorDecommissionState] = None } val noKillScheduler = new DAGScheduler( sc, @@ -729,8 +806,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi assert(failure === null) // When the task set completes normally, state should be correctly updated. - complete(taskSets(0), Seq((Success, 42))) - assert(results === Map(0 -> 42)) + completeAndCheckAnswer(taskSets(0), Seq((Success, 42)), Map(0 -> 42)) assertDataStructuresEmpty() assert(sparkListener.failedStages.isEmpty) @@ -743,13 +819,10 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val shuffleId = shuffleDep.shuffleId val reduceRdd = new MyRDD(sc, 1, List(shuffleDep), tracker = mapOutputTracker) submit(reduceRdd, Array(0)) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 1)), - (Success, makeMapStatus("hostB", 1)))) + completeShuffleMapStageSuccessfully(0, 0, 1) assert(mapOutputTracker.getMapSizesByExecutorId(shuffleId, 0).map(_._1).toSet === HashSet(makeBlockManagerId("hostA"), makeBlockManagerId("hostB"))) - complete(taskSets(1), Seq((Success, 42))) - assert(results === Map(0 -> 42)) + completeAndCheckAnswer(taskSets(1), Seq((Success, 42)), Map(0 -> 42)) assertDataStructuresEmpty() } @@ -759,15 +832,12 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val shuffleId = shuffleDep.shuffleId val reduceRdd = new MyRDD(sc, 2, List(shuffleDep), tracker = mapOutputTracker) submit(reduceRdd, Array(0, 1)) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", reduceRdd.partitions.length)), - (Success, makeMapStatus("hostB", reduceRdd.partitions.length)))) + completeShuffleMapStageSuccessfully(0, 0, reduceRdd.partitions.length) // the 2nd ResultTask failed complete(taskSets(1), Seq( (Success, 42), (FetchFailed(makeBlockManagerId("hostA"), shuffleId, 0L, 0, 0, "ignored"), null))) - // this will get called - // blockManagerMaster.removeExecutor("exec-hostA") + verify(blockManagerMaster, times(1)).removeExecutor("hostA-exec") // ask the scheduler to try it again scheduler.resubmitFailedStages() // have the 2nd attempt pass @@ -775,15 +845,14 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi // we can see both result blocks now assert(mapOutputTracker.getMapSizesByExecutorId(shuffleId, 0).map(_._1.host).toSet === HashSet("hostA", "hostB")) - complete(taskSets(3), Seq((Success, 43))) - assert(results === Map(0 -> 42, 1 -> 43)) + completeAndCheckAnswer(taskSets(3), Seq((Success, 43)), Map(0 -> 42, 1 -> 43)) assertDataStructuresEmpty() } private val shuffleFileLossTests = Seq( - ("slave lost with shuffle service", SlaveLost("", false), true, false), - ("worker lost with shuffle service", SlaveLost("", true), true, true), - ("worker lost without shuffle service", SlaveLost("", true), false, true), + ("executor process lost with shuffle service", ExecutorProcessLost("", None), true, false), + ("worker lost with shuffle service", ExecutorProcessLost("", Some("hostA")), true, true), + ("worker lost without shuffle service", ExecutorProcessLost("", Some("hostA")), false, true), ("executor failure with shuffle service", ExecutorKilled, true, false), ("executor failure without shuffle service", ExecutorKilled, false, true)) @@ -794,11 +863,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi "not lost" } test(s"shuffle files $maybeLost when $eventDescription") { - // reset the test context with the right shuffle service config - afterEach() - val conf = new SparkConf() conf.set(config.SHUFFLE_SERVICE_ENABLED.key, shuffleServiceOn.toString) - init(conf) assert(sc.env.blockManager.externalShuffleServiceEnabled == shuffleServiceOn) val shuffleMapRdd = new MyRDD(sc, 2, Nil) @@ -806,15 +871,24 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val shuffleId = shuffleDep.shuffleId val reduceRdd = new MyRDD(sc, 1, List(shuffleDep), tracker = mapOutputTracker) submit(reduceRdd, Array(0)) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 1)), - (Success, makeMapStatus("hostB", 1)))) - runEvent(ExecutorLost("exec-hostA", event)) + completeShuffleMapStageSuccessfully(0, 0, 1) + val expectHostFileLoss = event match { + case ExecutorProcessLost(_, workerHost, _) => workerHost.isDefined + case _ => false + } + runEvent(ExecutorLost("hostA-exec", event)) + verify(blockManagerMaster, times(1)).removeExecutor("hostA-exec") if (expectFileLoss) { + if (expectHostFileLoss) { + verify(mapOutputTracker, times(1)).removeOutputsOnHost("hostA") + } else { + verify(mapOutputTracker, times(1)).removeOutputsOnExecutor("hostA-exec") + } intercept[MetadataFetchFailedException] { mapOutputTracker.getMapSizesByExecutorId(shuffleId, 0) } } else { + verify(mapOutputTracker, times(0)).removeOutputsOnExecutor("hostA-exec") assert(mapOutputTracker.getMapSizesByExecutorId(shuffleId, 0).map(_._1).toSet === HashSet(makeBlockManagerId("hostA"), makeBlockManagerId("hostB"))) } @@ -889,16 +963,28 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi * @param stageId - The current stageId * @param attemptIdx - The current attempt count * @param numShufflePartitions - The number of partitions in the next stage + * @param hostNames - Host on which each task in the task set is executed */ private def completeShuffleMapStageSuccessfully( stageId: Int, attemptIdx: Int, - numShufflePartitions: Int): Unit = { - val stageAttempt = taskSets.last - checkStageId(stageId, attemptIdx, stageAttempt) + numShufflePartitions: Int, + hostNames: Seq[String] = Seq.empty[String]): Unit = { + def compareStageAttempt(taskSet: TaskSet): Boolean = { + taskSet.stageId == stageId && taskSet.stageAttemptId == attemptIdx + } + + val stageAttemptOpt = taskSets.find(compareStageAttempt(_)) + assert(stageAttemptOpt.isDefined) + val stageAttempt = stageAttemptOpt.get complete(stageAttempt, stageAttempt.tasks.zipWithIndex.map { case (task, idx) => - (Success, makeMapStatus("host" + ('A' + idx).toChar, numShufflePartitions)) + val hostName = if (idx < hostNames.size) { + hostNames(idx) + } else { + s"host${('A' + idx).toChar}" + } + (Success, makeMapStatus(hostName, numShufflePartitions)) }.toSeq) } @@ -1140,9 +1226,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val shuffleId = shuffleDep.shuffleId val reduceRdd = new MyRDD(sc, 2, List(shuffleDep), tracker = mapOutputTracker) submit(reduceRdd, Array(0, 1)) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", reduceRdd.partitions.length)), - (Success, makeMapStatus("hostB", reduceRdd.partitions.length)))) + completeShuffleMapStageSuccessfully(0, 0, reduceRdd.partitions.length) // The MapOutputTracker should know about both map output locations. assert(mapOutputTracker.getMapSizesByExecutorId(shuffleId, 0).map(_._1.host).toSet === HashSet("hostA", "hostB")) @@ -1169,9 +1253,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val shuffleId = shuffleDep.shuffleId val reduceRdd = new MyRDD(sc, 2, List(shuffleDep), tracker = mapOutputTracker) submit(reduceRdd, Array(0, 1)) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", reduceRdd.partitions.length)), - (Success, makeMapStatus("hostB", reduceRdd.partitions.length)))) + completeShuffleMapStageSuccessfully(0, 0, reduceRdd.partitions.length) assert(mapOutputTracker.findMissingPartitions(shuffleId) === Some(Seq.empty)) // The first result task fails, with a fetch failure for the output from the first mapper. @@ -1231,9 +1313,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi submit(reduceRdd, Array(0, 1)) // Complete the map stage. - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 2)), - (Success, makeMapStatus("hostA", 2)))) + completeShuffleMapStageSuccessfully(0, 0, 2, hostNames = Seq("hostA", "hostA")) assert(mapOutputTracker.findMissingPartitions(shuffleId) === Some(Seq.empty)) // The first ResultTask fails @@ -1267,9 +1347,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi // The map stage should have been submitted. assert(countSubmittedMapStageAttempts() === 1) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 2)), - (Success, makeMapStatus("hostB", 2)))) + completeShuffleMapStageSuccessfully(0, 0, 2) // The MapOutputTracker should know about both map output locations. assert(mapOutputTracker.getMapSizesByExecutorId(shuffleId, 0).map(_._1.host).toSet === HashSet("hostA", "hostB")) @@ -1328,9 +1406,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi assert(countSubmittedMapStageAttempts() === 1) // Complete the map stage. - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 2)), - (Success, makeMapStatus("hostB", 2)))) + completeShuffleMapStageSuccessfully(0, 0, 2) // The reduce stage should have been submitted. assert(countSubmittedReduceStageAttempts() === 1) @@ -1415,7 +1491,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi // pretend we were told hostA went away val oldEpoch = mapOutputTracker.getEpoch - runEvent(ExecutorLost("exec-hostA", ExecutorKilled)) + runEvent(ExecutorLost("hostA-exec", ExecutorKilled)) val newEpoch = mapOutputTracker.getEpoch assert(newEpoch > oldEpoch) @@ -1458,8 +1534,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi HashSet(makeBlockManagerId("hostB"), makeBlockManagerId("hostA"))) // finish the next stage normally, which completes the job - complete(taskSets(1), Seq((Success, 42), (Success, 43))) - assert(results === Map(0 -> 42, 1 -> 43)) + completeAndCheckAnswer(taskSets(1), Seq((Success, 42), (Success, 43)), Map(0 -> 42, 1 -> 43)) assertDataStructuresEmpty() } @@ -1538,14 +1613,11 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi submit(reduceRdd, Array(0)) // things start out smoothly, stage 0 completes with no issues - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostB", shuffleMapRdd.partitions.length)), - (Success, makeMapStatus("hostB", shuffleMapRdd.partitions.length)), - (Success, makeMapStatus("hostA", shuffleMapRdd.partitions.length)) - )) + completeShuffleMapStageSuccessfully( + 0, 0, shuffleMapRdd.partitions.length, Seq("hostB", "hostB", "hostA")) // then one executor dies, and a task fails in stage 1 - runEvent(ExecutorLost("exec-hostA", ExecutorKilled)) + runEvent(ExecutorLost("hostA-exec", ExecutorKilled)) runEvent(makeCompletionEvent( taskSets(1).tasks(0), FetchFailed(null, firstShuffleId, 2L, 2, 0, "Fetch failed"), @@ -1643,18 +1715,15 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi makeMapStatus("hostA", reduceRdd.partitions.length))) // now that host goes down - runEvent(ExecutorLost("exec-hostA", ExecutorKilled)) + runEvent(ExecutorLost("hostA-exec", ExecutorKilled)) // so we resubmit those tasks runEvent(makeCompletionEvent(taskSets(0).tasks(0), Resubmitted, null)) runEvent(makeCompletionEvent(taskSets(0).tasks(1), Resubmitted, null)) // now complete everything on a different host - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostB", reduceRdd.partitions.length)), - (Success, makeMapStatus("hostB", reduceRdd.partitions.length)), - (Success, makeMapStatus("hostB", reduceRdd.partitions.length)) - )) + completeShuffleMapStageSuccessfully( + 0, 0, reduceRdd.partitions.length, Seq("hostB", "hostB", "hostB")) // now we should submit stage 1, and the map output from stage 0 should be registered @@ -1768,7 +1837,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi // correct behavior. val job1Id = 0 // TaskSet priority for Stages run with "job1" as the ActiveJob checkJobPropertiesAndPriority(taskSets(0), "job1", job1Id) - complete(taskSets(0), Seq((Success, makeMapStatus("hostA", 1)))) + completeShuffleMapStageSuccessfully(0, 0, 1) shuffleDep1 } @@ -1785,7 +1854,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi // the stage. checkJobPropertiesAndPriority(taskSets(1), "job2", 1) - complete(taskSets(1), Seq((Success, makeMapStatus("hostA", 1)))) + completeShuffleMapStageSuccessfully(1, 0, 1) assert(taskSets(2).properties != null) complete(taskSets(2), Seq((Success, 42))) assert(results === Map(0 -> 42)) @@ -1806,9 +1875,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi // lets say there is a fetch failure in this task set, which makes us go back and // run stage 0, attempt 1 - complete(taskSets(1), Seq( - (FetchFailed(makeBlockManagerId("hostA"), - shuffleDep1.shuffleId, 0L, 0, 0, "ignored"), null))) + completeNextStageWithFetchFailure(1, 0, shuffleDep1) scheduler.resubmitFailedStages() // stage 0, attempt 1 should have the properties of job2 @@ -1817,9 +1884,9 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi checkJobPropertiesAndPriority(taskSets(2), "job2", job2Id) // run the rest of the stages normally, checking that they have the correct properties - complete(taskSets(2), Seq((Success, makeMapStatus("hostA", 1)))) + completeShuffleMapStageSuccessfully(0, 1, 1) checkJobPropertiesAndPriority(taskSets(3), "job2", job2Id) - complete(taskSets(3), Seq((Success, makeMapStatus("hostA", 1)))) + completeShuffleMapStageSuccessfully(1, 1, 1) checkJobPropertiesAndPriority(taskSets(4), "job2", job2Id) complete(taskSets(4), Seq((Success, 42))) assert(results === Map(0 -> 42)) @@ -1841,10 +1908,8 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val reduceRdd = new MyRDD(sc, 1, List(shuffleDep), tracker = mapOutputTracker) submit(reduceRdd, Array(0)) // Tell the DAGScheduler that hostA was lost. - runEvent(ExecutorLost("exec-hostA", ExecutorKilled)) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 1)), - (Success, makeMapStatus("hostB", 1)))) + runEvent(ExecutorLost("hostA-exec", ExecutorKilled)) + completeShuffleMapStageSuccessfully(0, 0, 1) // At this point, no more tasks are running for the stage (and the TaskSetManager considers the // stage complete), but the tasks that ran on HostA need to be re-run, so the DAGScheduler @@ -1880,19 +1945,13 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val finalRdd = new MyRDD(sc, 1, List(shuffleDepTwo), tracker = mapOutputTracker) submit(finalRdd, Array(0)) // have the first stage complete normally - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 2)), - (Success, makeMapStatus("hostB", 2)))) + completeShuffleMapStageSuccessfully(0, 0, 2) // have the second stage complete normally - complete(taskSets(1), Seq( - (Success, makeMapStatus("hostA", 1)), - (Success, makeMapStatus("hostC", 1)))) + completeShuffleMapStageSuccessfully(1, 0, 1, Seq("hostA", "hostC")) // fail the third stage because hostA went down - complete(taskSets(2), Seq( - (FetchFailed(makeBlockManagerId("hostA"), - shuffleDepTwo.shuffleId, 0L, 0, 0, "ignored"), null))) + completeNextStageWithFetchFailure(2, 0, shuffleDepTwo) // TODO assert this: - // blockManagerMaster.removeExecutor("exec-hostA") + // blockManagerMaster.removeExecutor("hostA-exec") // have DAGScheduler try again scheduler.resubmitFailedStages() complete(taskSets(3), Seq((Success, makeMapStatus("hostA", 2)))) @@ -1912,19 +1971,13 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi cacheLocations(shuffleTwoRdd.id -> 0) = Seq(makeBlockManagerId("hostD")) cacheLocations(shuffleTwoRdd.id -> 1) = Seq(makeBlockManagerId("hostC")) // complete stage 0 - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 2)), - (Success, makeMapStatus("hostB", 2)))) + completeShuffleMapStageSuccessfully(0, 0, 2) // complete stage 1 - complete(taskSets(1), Seq( - (Success, makeMapStatus("hostA", 1)), - (Success, makeMapStatus("hostB", 1)))) + completeShuffleMapStageSuccessfully(1, 0, 1) // pretend stage 2 failed because hostA went down - complete(taskSets(2), Seq( - (FetchFailed(makeBlockManagerId("hostA"), - shuffleDepTwo.shuffleId, 0L, 0, 0, "ignored"), null))) + completeNextStageWithFetchFailure(2, 0, shuffleDepTwo) // TODO assert this: - // blockManagerMaster.removeExecutor("exec-hostA") + // blockManagerMaster.removeExecutor("hostA-exec") // DAGScheduler should notice the cached copy of the second shuffle and try to get it rerun. scheduler.resubmitFailedStages() assertLocations(taskSets(3), Seq(Seq("hostD"))) @@ -2169,8 +2222,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val shuffleId = shuffleDep.shuffleId val reduceRdd = new MyRDD(sc, 1, List(shuffleDep), tracker = mapOutputTracker) submit(reduceRdd, Array(0)) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 1)))) + completeShuffleMapStageSuccessfully(0, 0, 1) assert(mapOutputTracker.getMapSizesByExecutorId(shuffleId, 0).map(_._1).toSet === HashSet(makeBlockManagerId("hostA"))) @@ -2215,8 +2267,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val shuffleId = shuffleDep.shuffleId val reduceRdd = new MyRDD(sc, 1, List(shuffleDep, narrowDep), tracker = mapOutputTracker) submit(reduceRdd, Array(0)) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 1)))) + completeShuffleMapStageSuccessfully(0, 0, 1) assert(mapOutputTracker.getMapSizesByExecutorId(shuffleId, 0).map(_._1).toSet === HashSet(makeBlockManagerId("hostA"))) @@ -2240,7 +2291,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi assert(stackTraceString.contains("org.apache.spark.rdd.RDD.count")) // should include the FunSuite setup: - assert(stackTraceString.contains("org.scalatest.FunSuite")) + assert(stackTraceString.contains("org.scalatest.funsuite.AnyFunSuite")) } test("catch errors in event loop") { @@ -2319,9 +2370,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi // Submit a map stage by itself submitMapStage(shuffleDep) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", reduceRdd.partitions.length)), - (Success, makeMapStatus("hostB", reduceRdd.partitions.length)))) + completeShuffleMapStageSuccessfully(0, 0, reduceRdd.partitions.length) assert(results.size === 1) results.clear() assertDataStructuresEmpty() @@ -2378,9 +2427,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi // Complete the first stage assert(taskSets(0).stageId === 0) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", rdd1.partitions.length)), - (Success, makeMapStatus("hostB", rdd1.partitions.length)))) + completeShuffleMapStageSuccessfully(0, 0, rdd1.partitions.length) assert(mapOutputTracker.getMapSizesByExecutorId(dep1.shuffleId, 0).map(_._1).toSet === HashSet(makeBlockManagerId("hostA"), makeBlockManagerId("hostB"))) assert(listener1.results.size === 1) @@ -2442,9 +2489,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi // Complete the stage0. assert(taskSets(0).stageId === 0) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", rdd1.partitions.length)), - (Success, makeMapStatus("hostB", rdd1.partitions.length)))) + completeShuffleMapStageSuccessfully(0, 0, rdd1.partitions.length) assert(mapOutputTracker.getMapSizesByExecutorId(dep1.shuffleId, 0).map(_._1).toSet === HashSet(makeBlockManagerId("hostA"), makeBlockManagerId("hostB"))) assert(listener1.results.size === 1) @@ -2503,7 +2548,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi // Pretend host A was lost. This will cause the TaskSetManager to resubmit task 0, because it // completed on hostA. val oldEpoch = mapOutputTracker.getEpoch - runEvent(ExecutorLost("exec-hostA", ExecutorKilled)) + runEvent(ExecutorLost("hostA-exec", ExecutorKilled)) val newEpoch = mapOutputTracker.getEpoch assert(newEpoch > oldEpoch) @@ -2524,7 +2569,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val newTaskSet = taskSets(1) // 2 tasks should have been re-submitted, for tasks 0 and 1 (which ran on hostA). assert(newTaskSet.tasks.size === 2) - // Complete task 0 from the original task set (i.e., not hte one that's currently active). + // Complete task 0 from the original task set (i.e., not the one that's currently active). // This should still be counted towards the job being complete (but there's still one // outstanding task). runEvent(makeCompletionEvent(newTaskSet.tasks(0), Success, makeMapStatus("hostB", 2))) @@ -2651,9 +2696,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi // Complete both tasks in rddA. assert(taskSets(0).stageId === 0 && taskSets(0).stageAttemptId === 0) - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 2)), - (Success, makeMapStatus("hostA", 2)))) + completeShuffleMapStageSuccessfully(0, 0, 2, Seq("hostA", "hostA")) // Fetch failed for task(stageId=1, stageAttemptId=0, partitionId=0) running on hostA // and task(stageId=1, stageAttemptId=0, partitionId=1) is still running. @@ -2827,15 +2870,11 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi submit(finalRdd, Array(0, 1)) // Finish the first shuffle map stage. - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 2)), - (Success, makeMapStatus("hostB", 2)))) + completeShuffleMapStageSuccessfully(0, 0, 2) assert(mapOutputTracker.findMissingPartitions(shuffleId1) === Some(Seq.empty)) // Finish the second shuffle map stage. - complete(taskSets(1), Seq( - (Success, makeMapStatus("hostC", 2)), - (Success, makeMapStatus("hostD", 2)))) + completeShuffleMapStageSuccessfully(1, 0, 2, Seq("hostC", "hostD")) assert(mapOutputTracker.findMissingPartitions(shuffleId2) === Some(Seq.empty)) // The first task of the final stage failed with fetch failure @@ -2847,11 +2886,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi } test("SPARK-25341: abort stage while using old fetch protocol") { - // reset the test context with using old fetch protocol - afterEach() - val conf = new SparkConf() conf.set(config.SHUFFLE_USE_OLD_FETCH_PROTOCOL.key, "true") - init(conf) // Construct the scenario of indeterminate stage fetch failed. constructIndeterminateStageFetchFailed() // The job should fail because Spark can't rollback the shuffle map stage while @@ -2894,14 +2929,10 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi assert(taskSets(4).tasks.length == 2) // Finish all stage. - complete(taskSets(4), Seq( - (Success, makeMapStatus("hostA", 2)), - (Success, makeMapStatus("hostB", 2)))) + completeShuffleMapStageSuccessfully(0, 1, 2) assert(mapOutputTracker.findMissingPartitions(shuffleId1) === Some(Seq.empty)) - complete(taskSets(5), Seq( - (Success, makeMapStatus("hostC", 2)), - (Success, makeMapStatus("hostD", 2)))) + completeShuffleMapStageSuccessfully(1, 2, 2, Seq("hostC", "hostD")) assert(mapOutputTracker.findMissingPartitions(shuffleId2) === Some(Seq.empty)) complete(taskSets(6), Seq((Success, 11), (Success, 12))) @@ -2932,14 +2963,10 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi submit(finalRdd, Array(0, 1), properties = new Properties()) // Finish the first 2 shuffle map stages. - complete(taskSets(0), Seq( - (Success, makeMapStatus("hostA", 2)), - (Success, makeMapStatus("hostB", 2)))) + completeShuffleMapStageSuccessfully(0, 0, 2) assert(mapOutputTracker.findMissingPartitions(shuffleId1) === Some(Seq.empty)) - complete(taskSets(1), Seq( - (Success, makeMapStatus("hostB", 2)), - (Success, makeMapStatus("hostD", 2)))) + completeShuffleMapStageSuccessfully(1, 0, 2, Seq("hostB", "hostD")) assert(mapOutputTracker.findMissingPartitions(shuffleId2) === Some(Seq.empty)) // Executor lost on hostB, both of stage 0 and 1 should be reran. @@ -2959,9 +2986,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi assert(taskSets(taskSetIndex).stageId == stageId) assert(taskSets(taskSetIndex).stageAttemptId == 1) assert(taskSets(taskSetIndex).tasks.length == 2) - complete(taskSets(taskSetIndex), Seq( - (Success, makeMapStatus("hostA", 2)), - (Success, makeMapStatus("hostB", 2)))) + completeShuffleMapStageSuccessfully(stageId, 1, 2) assert(mapOutputTracker.findMissingPartitions(shuffleId) === Some(Seq.empty)) } @@ -3032,7 +3057,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi assertResultStageFailToRollback(shuffleMapRdd) } - private def assertResultStageNotRollbacked(mapRdd: MyRDD): Unit = { + private def assertResultStageNotRolledBack(mapRdd: MyRDD): Unit = { val shuffleDep = new ShuffleDependency(mapRdd, new HashPartitioner(2)) val shuffleId = shuffleDep.shuffleId val finalRdd = new MyRDD(sc, 2, List(shuffleDep), tracker = mapOutputTracker) @@ -3072,7 +3097,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val shuffleMapRdd = new MyCheckpointRDD(sc, 2, Nil, indeterminate = true) shuffleMapRdd.checkpoint() shuffleMapRdd.doCheckpoint() - assertResultStageNotRollbacked(shuffleMapRdd) + assertResultStageNotRolledBack(shuffleMapRdd) } } @@ -3189,10 +3214,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi } test("test 2 resource profile with merge conflict config true") { - afterEach() - val conf = new SparkConf() conf.set(config.RESOURCE_PROFILE_MERGE_CONFLICTS.key, "true") - init(conf) val ereqs = new ExecutorResourceRequests().cores(4) val treqs = new TaskResourceRequests().cpus(1) @@ -3210,10 +3232,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi } test("test multiple resource profiles created from merging use same rp") { - afterEach() - val conf = new SparkConf() conf.set(config.RESOURCE_PROFILE_MERGE_CONFLICTS.key, "true") - init(conf) val ereqs = new ExecutorResourceRequests().cores(4) val treqs = new TaskResourceRequests().cpus(1) @@ -3267,7 +3286,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi assert(mergedRp.taskResources.get(GPU).get.amount == 1) val ereqs5 = new ExecutorResourceRequests().cores(1).memory("3g") - .memoryOverhead("1g").pysparkMemory("2g").resource(GPU, 1, "disc") + .memoryOverhead("1g").pysparkMemory("2g").offHeapMemory("4g").resource(GPU, 1, "disc") val treqs5 = new TaskResourceRequests().cpus(1).resource(GPU, 1) val rp5 = new ResourceProfile(ereqs5.requests, treqs5.requests) val ereqs6 = new ExecutorResourceRequests().cores(8).resource(FPGA, 2, "fdisc") @@ -3277,7 +3296,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi assert(mergedRp.getTaskCpus.get == 2) assert(mergedRp.getExecutorCores.get == 8) - assert(mergedRp.executorResources.size == 6) + assert(mergedRp.executorResources.size == 7) assert(mergedRp.taskResources.size == 3) assert(mergedRp.executorResources.get(GPU).get.amount == 1) assert(mergedRp.executorResources.get(GPU).get.discoveryScript == "disc") @@ -3288,6 +3307,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi assert(mergedRp.executorResources.get(ResourceProfile.MEMORY).get.amount == 3072) assert(mergedRp.executorResources.get(ResourceProfile.PYSPARK_MEM).get.amount == 2048) assert(mergedRp.executorResources.get(ResourceProfile.OVERHEAD_MEM).get.amount == 1024) + assert(mergedRp.executorResources.get(ResourceProfile.OFFHEAP_MEM).get.amount == 4096) val ereqs7 = new ExecutorResourceRequests().cores(1).memory("3g") .resource(GPU, 4, "disc") @@ -3306,10 +3326,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi } test("test merge 3 resource profiles") { - afterEach() - val conf = new SparkConf() conf.set(config.RESOURCE_PROFILE_MERGE_CONFLICTS.key, "true") - init(conf) val ereqs = new ExecutorResourceRequests().cores(4) val treqs = new TaskResourceRequests().cpus(1) val rp1 = new ResourceProfile(ereqs.requests, treqs.requests) @@ -3319,7 +3336,7 @@ class DAGSchedulerSuite extends SparkFunSuite with LocalSparkContext with TimeLi val ereqs3 = new ExecutorResourceRequests().cores(3) val treqs3 = new TaskResourceRequests().cpus(2) val rp3 = new ResourceProfile(ereqs3.requests, treqs3.requests) - var mergedRp = scheduler.mergeResourceProfilesForStage(HashSet(rp1, rp2, rp3)) + val mergedRp = scheduler.mergeResourceProfilesForStage(HashSet(rp1, rp2, rp3)) assert(mergedRp.getTaskCpus.get == 2) assert(mergedRp.getExecutorCores.get == 4) @@ -3434,8 +3451,9 @@ object DAGSchedulerSuite { def makeMapStatus(host: String, reduces: Int, sizes: Byte = 2, mapTaskId: Long = -1): MapStatus = MapStatus(makeBlockManagerId(host), Array.fill[Long](reduces)(sizes), mapTaskId) - def makeBlockManagerId(host: String): BlockManagerId = - BlockManagerId("exec-" + host, host, 12345) + def makeBlockManagerId(host: String): BlockManagerId = { + BlockManagerId(host + "-exec", host, 12345) + } } object FailThisAttempt { diff --git a/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala index 61ea21fa86c5a..240774d854c92 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/EventLoggingListenerSuite.scala @@ -18,7 +18,7 @@ package org.apache.spark.scheduler import java.io.{File, InputStream} -import java.util.Arrays +import java.util.{Arrays, Properties} import scala.collection.immutable.Map import scala.collection.mutable @@ -36,6 +36,7 @@ import org.apache.spark.deploy.history.{EventLogFileReader, SingleEventLogFileWr import org.apache.spark.deploy.history.EventLogTestHelper._ import org.apache.spark.executor.{ExecutorMetrics, TaskMetrics} import org.apache.spark.internal.Logging +import org.apache.spark.internal.config.{EVENT_LOG_DIR, EVENT_LOG_ENABLED} import org.apache.spark.io._ import org.apache.spark.metrics.{ExecutorMetricType, MetricsSystem} import org.apache.spark.resource.ResourceProfile @@ -89,17 +90,123 @@ class EventLoggingListenerSuite extends SparkFunSuite with LocalSparkContext wit val conf = getLoggingConf(testDirPath, None) .set(key, secretPassword) val hadoopconf = SparkHadoopUtil.get.newConfiguration(new SparkConf()) - val eventLogger = new EventLoggingListener("test", None, testDirPath.toUri(), conf) - val envDetails = SparkEnv.environmentDetails(conf, hadoopconf, "FIFO", Seq.empty, Seq.empty) + val envDetails = SparkEnv.environmentDetails( + conf, hadoopconf, "FIFO", Seq.empty, Seq.empty, Seq.empty) val event = SparkListenerEnvironmentUpdate(envDetails) - val redactedProps = eventLogger.redactEvent(event).environmentDetails("Spark Properties").toMap + val redactedProps = EventLoggingListener + .redactEvent(conf, event).environmentDetails("Spark Properties").toMap assert(redactedProps(key) == "*********(redacted)") } + test("Spark-33504 sensitive attributes redaction in properties") { + val (secretKey, secretPassword) = ("spark.executorEnv.HADOOP_CREDSTORE_PASSWORD", + "secret_password") + val (customKey, customValue) = ("parse_token", "secret_password") + + val conf = getLoggingConf(testDirPath, None).set(secretKey, secretPassword) + + val properties = new Properties() + properties.setProperty(secretKey, secretPassword) + properties.setProperty(customKey, customValue) + + val logName = "properties-reaction-test" + val eventLogger = new EventLoggingListener(logName, None, testDirPath.toUri(), conf) + val listenerBus = new LiveListenerBus(conf) + + val stageId = 1 + val jobId = 1 + val stageInfo = new StageInfo(stageId, 0, stageId.toString, 0, + Seq.empty, Seq.empty, "details", + resourceProfileId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) + + val events = Array(SparkListenerStageSubmitted(stageInfo, properties), + SparkListenerJobStart(jobId, 0, Seq(stageInfo), properties)) + + eventLogger.start() + listenerBus.start(Mockito.mock(classOf[SparkContext]), Mockito.mock(classOf[MetricsSystem])) + listenerBus.addToEventLogQueue(eventLogger) + events.foreach(event => listenerBus.post(event)) + listenerBus.stop() + eventLogger.stop() + + val logData = EventLogFileReader.openEventLog(new Path(eventLogger.logWriter.logPath), + fileSystem) + try { + val lines = readLines(logData) + val logStart = SparkListenerLogStart(SPARK_VERSION) + assert(lines.size === 3) + assert(lines(0).contains("SparkListenerLogStart")) + assert(lines(1).contains("SparkListenerStageSubmitted")) + assert(lines(2).contains("SparkListenerJobStart")) + + lines.foreach{ + line => JsonProtocol.sparkEventFromJson(parse(line)) match { + case logStartEvent: SparkListenerLogStart => + assert(logStartEvent == logStart) + + case stageSubmittedEvent: SparkListenerStageSubmitted => + assert(stageSubmittedEvent.properties.getProperty(secretKey) == "*********(redacted)") + assert(stageSubmittedEvent.properties.getProperty(customKey) == customValue) + + case jobStartEvent : SparkListenerJobStart => + assert(jobStartEvent.properties.getProperty(secretKey) == "*********(redacted)") + assert(jobStartEvent.properties.getProperty(customKey) == customValue) + + case _ => assert(false) + } + } + } finally { + logData.close() + } + } + test("Executor metrics update") { testStageExecutorMetricsEventLogging() } + test("SPARK-31764: isBarrier should be logged in event log") { + val conf = new SparkConf() + conf.set(EVENT_LOG_ENABLED, true) + conf.set(EVENT_LOG_DIR, testDirPath.toString) + val sc = new SparkContext("local", "test-SPARK-31764", conf) + val appId = sc.applicationId + + sc.parallelize(1 to 10) + .barrier() + .mapPartitions(_.map(elem => (elem, elem))) + .filter(elem => elem._1 % 2 == 0) + .reduceByKey(_ + _) + .collect + sc.stop() + + val eventLogStream = EventLogFileReader.openEventLog(new Path(testDirPath, appId), fileSystem) + val events = readLines(eventLogStream).map(line => JsonProtocol.sparkEventFromJson(parse(line))) + val jobStartEvents = events + .filter(event => event.isInstanceOf[SparkListenerJobStart]) + .map(_.asInstanceOf[SparkListenerJobStart]) + + assert(jobStartEvents.size === 1) + val stageInfos = jobStartEvents.head.stageInfos + assert(stageInfos.size === 2) + + val stage0 = stageInfos(0) + val rddInfosInStage0 = stage0.rddInfos + assert(rddInfosInStage0.size === 3) + val sortedRddInfosInStage0 = rddInfosInStage0.sortBy(_.scope.get.name) + assert(sortedRddInfosInStage0(0).scope.get.name === "filter") + assert(sortedRddInfosInStage0(0).isBarrier === true) + assert(sortedRddInfosInStage0(1).scope.get.name === "mapPartitions") + assert(sortedRddInfosInStage0(1).isBarrier === true) + assert(sortedRddInfosInStage0(2).scope.get.name === "parallelize") + assert(sortedRddInfosInStage0(2).isBarrier === false) + + val stage1 = stageInfos(1) + val rddInfosInStage1 = stage1.rddInfos + assert(rddInfosInStage1.size === 1) + assert(rddInfosInStage1(0).scope.get.name === "reduceByKey") + assert(rddInfosInStage1(0).isBarrier === false) // reduceByKey + } + /* ----------------- * * Actual test logic * * ----------------- */ @@ -281,7 +388,7 @@ class EventLoggingListenerSuite extends SparkFunSuite with LocalSparkContext wit 8000L, 5000L, 7000L, 4000L, 6000L, 3000L, 10L, 90L, 2L, 20L) def max(a: Array[Long], b: Array[Long]): Array[Long] = - (a, b).zipped.map(Math.max) + (a, b).zipped.map(Math.max).toArray // calculated metric peaks per stage per executor // metrics sent during stage 0 for each executor diff --git a/core/src/test/scala/org/apache/spark/scheduler/ExecutorResourceInfoSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/ExecutorResourceInfoSuite.scala index 388d4e25a06cf..e392ff53e02c9 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/ExecutorResourceInfoSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/ExecutorResourceInfoSuite.scala @@ -26,7 +26,7 @@ class ExecutorResourceInfoSuite extends SparkFunSuite { test("Track Executor Resource information") { // Init Executor Resource. - val info = new ExecutorResourceInfo(GPU, ArrayBuffer("0", "1", "2", "3"), 1) + val info = new ExecutorResourceInfo(GPU, Seq("0", "1", "2", "3"), 1) assert(info.availableAddrs.sorted sameElements Seq("0", "1", "2", "3")) assert(info.assignedAddrs.isEmpty) @@ -43,7 +43,7 @@ class ExecutorResourceInfoSuite extends SparkFunSuite { test("Don't allow acquire address that is not available") { // Init Executor Resource. - val info = new ExecutorResourceInfo(GPU, ArrayBuffer("0", "1", "2", "3"), 1) + val info = new ExecutorResourceInfo(GPU, Seq("0", "1", "2", "3"), 1) // Acquire some addresses. info.acquire(Seq("0", "1")) assert(!info.availableAddrs.contains("1")) @@ -56,7 +56,7 @@ class ExecutorResourceInfoSuite extends SparkFunSuite { test("Don't allow acquire address that doesn't exist") { // Init Executor Resource. - val info = new ExecutorResourceInfo(GPU, ArrayBuffer("0", "1", "2", "3"), 1) + val info = new ExecutorResourceInfo(GPU, Seq("0", "1", "2", "3"), 1) assert(!info.availableAddrs.contains("4")) // Acquire an address that doesn't exist val e = intercept[SparkException] { @@ -67,7 +67,7 @@ class ExecutorResourceInfoSuite extends SparkFunSuite { test("Don't allow release address that is not assigned") { // Init Executor Resource. - val info = new ExecutorResourceInfo(GPU, ArrayBuffer("0", "1", "2", "3"), 1) + val info = new ExecutorResourceInfo(GPU, Seq("0", "1", "2", "3"), 1) // Acquire addresses info.acquire(Array("0", "1")) assert(!info.assignedAddrs.contains("2")) @@ -80,7 +80,7 @@ class ExecutorResourceInfoSuite extends SparkFunSuite { test("Don't allow release address that doesn't exist") { // Init Executor Resource. - val info = new ExecutorResourceInfo(GPU, ArrayBuffer("0", "1", "2", "3"), 1) + val info = new ExecutorResourceInfo(GPU, Seq("0", "1", "2", "3"), 1) assert(!info.assignedAddrs.contains("4")) // Release an address that doesn't exist val e = intercept[SparkException] { @@ -93,7 +93,7 @@ class ExecutorResourceInfoSuite extends SparkFunSuite { val slotSeq = Seq(10, 9, 8, 7, 6, 5, 4, 3, 2, 1) val addresses = ArrayBuffer("0", "1", "2", "3") slotSeq.foreach { slots => - val info = new ExecutorResourceInfo(GPU, addresses, slots) + val info = new ExecutorResourceInfo(GPU, addresses.toSeq, slots) for (_ <- 0 until slots) { addresses.foreach(addr => info.acquire(Seq(addr))) } diff --git a/core/src/test/scala/org/apache/spark/scheduler/ExternalClusterManagerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/ExternalClusterManagerSuite.scala index 7ead51bc691fb..08191d09a9f2d 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/ExternalClusterManagerSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/ExternalClusterManagerSuite.scala @@ -90,7 +90,6 @@ private class DummyTaskScheduler extends TaskScheduler { override def notifyPartitionCompletion(stageId: Int, partitionId: Int): Unit = {} override def setDAGScheduler(dagScheduler: DAGScheduler): Unit = {} override def defaultParallelism(): Int = 2 - override def executorDecommission(executorId: String): Unit = {} override def executorLost(executorId: String, reason: ExecutorLossReason): Unit = {} override def workerRemoved(workerId: String, host: String, message: String): Unit = {} override def applicationAttemptId(): Option[String] = None @@ -99,4 +98,9 @@ private class DummyTaskScheduler extends TaskScheduler { accumUpdates: Array[(Long, Seq[AccumulatorV2[_, _]])], blockManagerId: BlockManagerId, executorMetrics: Map[(Int, Int), ExecutorMetrics]): Boolean = true + override def executorDecommission( + executorId: String, + decommissionInfo: ExecutorDecommissionInfo): Unit = {} + override def getExecutorDecommissionState( + executorId: String): Option[ExecutorDecommissionState] = None } diff --git a/core/src/test/scala/org/apache/spark/scheduler/HealthTrackerIntegrationSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/HealthTrackerIntegrationSuite.scala new file mode 100644 index 0000000000000..29a8f4be8b72b --- /dev/null +++ b/core/src/test/scala/org/apache/spark/scheduler/HealthTrackerIntegrationSuite.scala @@ -0,0 +1,157 @@ +/* + * 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. + */ +package org.apache.spark.scheduler + +import org.apache.spark._ +import org.apache.spark.internal.config +import org.apache.spark.internal.config.Tests._ + +class HealthTrackerIntegrationSuite extends SchedulerIntegrationSuite[MultiExecutorMockBackend]{ + + val badHost = "host-0" + + /** + * This backend just always fails if the task is executed on a bad host, but otherwise succeeds + * all tasks. + */ + def badHostBackend(): Unit = { + val (taskDescription, _) = backend.beginTask() + val host = backend.executorIdToExecutor(taskDescription.executorId).host + if (host == badHost) { + backend.taskFailed(taskDescription, new RuntimeException("I'm a bad host!")) + } else { + backend.taskSuccess(taskDescription, 42) + } + } + + // Test demonstrating the issue -- without a config change, the scheduler keeps scheduling + // according to locality preferences, and so the job fails + testScheduler("If preferred node is bad, without excludeOnFailure job will fail", + extraConfs = Seq( + config.EXCLUDE_ON_FAILURE_ENABLED.key -> "false" + )) { + val rdd = new MockRDDWithLocalityPrefs(sc, 10, Nil, badHost) + withBackend(badHostBackend _) { + val jobFuture = submit(rdd, (0 until 10).toArray) + awaitJobTermination(jobFuture, duration) + } + assertDataStructuresEmpty(noFailure = false) + } + + testScheduler( + "With default settings, job can succeed despite multiple bad executors on node", + extraConfs = Seq( + config.EXCLUDE_ON_FAILURE_ENABLED.key -> "true", + config.TASK_MAX_FAILURES.key -> "4", + TEST_N_HOSTS.key -> "2", + TEST_N_EXECUTORS_HOST.key -> "5", + TEST_N_CORES_EXECUTOR.key -> "10" + ) + ) { + // To reliably reproduce the failure that would occur without exludeOnFailure, we have to use 1 + // task. That way, we ensure this 1 task gets rotated through enough bad executors on the host + // to fail the taskSet, before we have a bunch of different tasks fail in the executors so we + // exclude them. + // But the point here is -- without excludeOnFailure, we would never schedule anything on the + // good host-1 before we hit too many failures trying our preferred host-0. + val rdd = new MockRDDWithLocalityPrefs(sc, 1, Nil, badHost) + withBackend(badHostBackend _) { + val jobFuture = submit(rdd, (0 until 1).toArray) + awaitJobTermination(jobFuture, duration) + } + assertDataStructuresEmpty(noFailure = true) + } + + // Here we run with the excludeOnFailure on, and the default config takes care of having this + // robust to one bad node. + testScheduler( + "Bad node with multiple executors, job will still succeed with the right confs", + extraConfs = Seq( + config.EXCLUDE_ON_FAILURE_ENABLED.key -> "true", + // just to avoid this test taking too long + config.LOCALITY_WAIT.key -> "10ms" + ) + ) { + val rdd = new MockRDDWithLocalityPrefs(sc, 10, Nil, badHost) + withBackend(badHostBackend _) { + val jobFuture = submit(rdd, (0 until 10).toArray) + awaitJobTermination(jobFuture, duration) + } + assert(results === (0 until 10).map { _ -> 42 }.toMap) + assertDataStructuresEmpty(noFailure = true) + } + + // Make sure that if we've failed on all executors, but haven't hit task.maxFailures yet, we try + // to acquire a new executor and if we aren't able to get one, the job doesn't hang and we abort + testScheduler( + "SPARK-15865 Progress with fewer executors than maxTaskFailures", + extraConfs = Seq( + config.EXCLUDE_ON_FAILURE_ENABLED.key -> "true", + TEST_N_HOSTS.key -> "2", + TEST_N_EXECUTORS_HOST.key -> "1", + TEST_N_CORES_EXECUTOR.key -> "1", + config.UNSCHEDULABLE_TASKSET_TIMEOUT.key -> "0s" + ) + ) { + def runBackend(): Unit = { + val (taskDescription, _) = backend.beginTask() + backend.taskFailed(taskDescription, new RuntimeException("test task failure")) + } + withBackend(runBackend _) { + val jobFuture = submit(new MockRDD(sc, 10, Nil), (0 until 10).toArray) + awaitJobTermination(jobFuture, duration) + val pattern = ( + s"""|Aborting TaskSet 0.0 because task .* + |cannot run anywhere due to node and executor excludeOnFailure""".stripMargin).r + assert(pattern.findFirstIn(failure.getMessage).isDefined, + s"Couldn't find $pattern in ${failure.getMessage()}") + } + assertDataStructuresEmpty(noFailure = false) + } +} + +class MultiExecutorMockBackend( + conf: SparkConf, + taskScheduler: TaskSchedulerImpl) extends MockBackend(conf, taskScheduler) { + + val nHosts = conf.get(TEST_N_HOSTS) + val nExecutorsPerHost = conf.get(TEST_N_EXECUTORS_HOST) + val nCoresPerExecutor = conf.get(TEST_N_CORES_EXECUTOR) + + override val executorIdToExecutor: Map[String, ExecutorTaskStatus] = { + (0 until nHosts).flatMap { hostIdx => + val hostName = "host-" + hostIdx + (0 until nExecutorsPerHost).map { subIdx => + val executorId = (hostIdx * nExecutorsPerHost + subIdx).toString + executorId -> + ExecutorTaskStatus(host = hostName, executorId = executorId, nCoresPerExecutor) + } + }.toMap + } + + override def defaultParallelism(): Int = nHosts * nExecutorsPerHost * nCoresPerExecutor +} + +class MockRDDWithLocalityPrefs( + sc: SparkContext, + numPartitions: Int, + shuffleDeps: Seq[ShuffleDependency[Int, Int, Nothing]], + val preferredLoc: String) extends MockRDD(sc, numPartitions, shuffleDeps) { + override def getPreferredLocations(split: Partition): Seq[String] = { + Seq(preferredLoc) + } +} diff --git a/core/src/test/scala/org/apache/spark/scheduler/HealthTrackerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/HealthTrackerSuite.scala new file mode 100644 index 0000000000000..5710be1a97174 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/scheduler/HealthTrackerSuite.scala @@ -0,0 +1,660 @@ +/* + * 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. + */ + +package org.apache.spark.scheduler + +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito.{never, verify, when} +import org.mockito.invocation.InvocationOnMock +import org.scalatest.BeforeAndAfterEach +import org.scalatestplus.mockito.MockitoSugar + +import org.apache.spark._ +import org.apache.spark.internal.config +import org.apache.spark.util.ManualClock + +class HealthTrackerSuite extends SparkFunSuite with BeforeAndAfterEach with MockitoSugar + with LocalSparkContext { + + private val clock = new ManualClock(0) + + private var healthTracker: HealthTracker = _ + private var listenerBusMock: LiveListenerBus = _ + private var scheduler: TaskSchedulerImpl = _ + private var conf: SparkConf = _ + + override def beforeEach(): Unit = { + conf = new SparkConf().setAppName("test").setMaster("local") + .set(config.EXCLUDE_ON_FAILURE_ENABLED.key, "true") + scheduler = mockTaskSchedWithConf(conf) + + clock.setTime(0) + + listenerBusMock = mock[LiveListenerBus] + healthTracker = new HealthTracker(listenerBusMock, conf, None, clock) + } + + override def afterEach(): Unit = { + if (healthTracker != null) { + healthTracker = null + } + if (scheduler != null) { + scheduler.stop() + scheduler = null + } + super.afterEach() + } + + // All executors and hosts used in tests should be in this set, so that [[assertEquivalentToSet]] + // works. Its OK if its got extraneous entries + val allExecutorAndHostIds = { + (('A' to 'Z')++ (1 to 100).map(_.toString)) + .flatMap{ suffix => + Seq(s"host$suffix", s"host-$suffix") + } + }.toSet + + /** + * Its easier to write our tests as if we could directly look at the sets of nodes & executors in + * the exclude. However the api doesn't expose a set, so this is a simple way to test + * something similar, since we know the universe of values that might appear in these sets. + */ + def assertEquivalentToSet(f: String => Boolean, expected: Set[String]): Unit = { + allExecutorAndHostIds.foreach { id => + val actual = f(id) + val exp = expected.contains(id) + assert(actual === exp, raw"""for string "$id" """) + } + } + + def mockTaskSchedWithConf(conf: SparkConf): TaskSchedulerImpl = { + sc = new SparkContext(conf) + val scheduler = mock[TaskSchedulerImpl] + when(scheduler.sc).thenReturn(sc) + when(scheduler.mapOutputTracker).thenReturn( + SparkEnv.get.mapOutputTracker.asInstanceOf[MapOutputTrackerMaster]) + scheduler + } + + def createTaskSetExcludelist(stageId: Int = 0): TaskSetExcludelist = { + new TaskSetExcludelist(listenerBusMock, conf, stageId, stageAttemptId = 0, clock = clock) + } + + test("executors can be excluded with only a few failures per stage") { + // For many different stages, executor 1 fails a task, then executor 2 succeeds the task, + // and then the task set is done. Not enough failures to exclude the executor *within* + // any particular taskset, but we still exclude the executor overall eventually. + // Also, we intentionally have a mix of task successes and failures -- there are even some + // successes after the executor is excluded. The idea here is those tasks get scheduled + // before the executor is excluded. We might get successes after excluding (because the + // executor might be flaky but not totally broken). But successes should not unexclude the + // executor. + val failuresUntilExcludeed = conf.get(config.MAX_FAILURES_PER_EXEC) + var failuresSoFar = 0 + (0 until failuresUntilExcludeed * 10).foreach { stageId => + val taskSetExclude = createTaskSetExcludelist(stageId) + if (stageId % 2 == 0) { + // fail one task in every other taskset + taskSetExclude.updateExcludedForFailedTask( + "hostA", exec = "1", index = 0, failureReason = "testing") + failuresSoFar += 1 + } + healthTracker.updateExcludedForSuccessfulTaskSet(stageId, 0, taskSetExclude.execToFailures) + assert(failuresSoFar == stageId / 2 + 1) + if (failuresSoFar < failuresUntilExcludeed) { + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set()) + } else { + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set("1")) + verify(listenerBusMock).post( + SparkListenerExecutorExcluded(0, "1", failuresUntilExcludeed)) + verify(listenerBusMock).post( + SparkListenerExecutorBlacklisted(0, "1", failuresUntilExcludeed)) + } + } + } + + // If an executor has many task failures, but the task set ends up failing, it shouldn't be + // counted against the executor. + test("executors aren't excluded as a result of tasks in failed task sets") { + val failuresUntilExcludeed = conf.get(config.MAX_FAILURES_PER_EXEC) + // for many different stages, executor 1 fails a task, and then the taskSet fails. + (0 until failuresUntilExcludeed * 10).foreach { stage => + val taskSetExclude = createTaskSetExcludelist(stage) + taskSetExclude.updateExcludedForFailedTask( + "hostA", exec = "1", index = 0, failureReason = "testing") + } + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set()) + } + + Seq(true, false).foreach { succeedTaskSet => + val label = if (succeedTaskSet) "success" else "failure" + test(s"stage exclude updates correctly on stage $label") { + // Within one taskset, an executor fails a few times, so it's excluded for the taskset. + // But if the taskset fails, we shouldn't exclude the executor after the stage. + val taskSetExclude = createTaskSetExcludelist(0) + // We trigger enough failures for both the taskset exclude, and the application exclude. + val numFailures = math.max(conf.get(config.MAX_FAILURES_PER_EXEC), + conf.get(config.MAX_FAILURES_PER_EXEC_STAGE)) + (0 until numFailures).foreach { index => + taskSetExclude.updateExcludedForFailedTask( + "hostA", exec = "1", index = index, failureReason = "testing") + } + assert(taskSetExclude.isExecutorExcludedForTaskSet("1")) + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set()) + if (succeedTaskSet) { + // The task set succeeded elsewhere, so we should count those failures against our executor, + // and it should be excluded for the entire application. + healthTracker.updateExcludedForSuccessfulTaskSet(0, 0, taskSetExclude.execToFailures) + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set("1")) + verify(listenerBusMock).post(SparkListenerExecutorExcluded(0, "1", numFailures)) + } else { + // The task set failed, so we don't count these failures against the executor for other + // stages. + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set()) + } + } + } + + test("excluded executors and nodes get recovered with time") { + val taskSetExclude0 = createTaskSetExcludelist(stageId = 0) + // Fail 4 tasks in one task set on executor 1, so that executor gets excluded for the whole + // application. + (0 until 4).foreach { partition => + taskSetExclude0.updateExcludedForFailedTask( + "hostA", exec = "1", index = partition, failureReason = "testing") + } + healthTracker.updateExcludedForSuccessfulTaskSet(0, 0, taskSetExclude0.execToFailures) + assert(healthTracker.excludedNodeList() === Set()) + assertEquivalentToSet(healthTracker.isNodeExcluded(_), Set()) + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set("1")) + verify(listenerBusMock).post(SparkListenerExecutorExcluded(0, "1", 4)) + verify(listenerBusMock).post(SparkListenerExecutorBlacklisted(0, "1", 4)) + + val taskSetExclude1 = createTaskSetExcludelist(stageId = 1) + // Fail 4 tasks in one task set on executor 2, so that executor gets excluded for the whole + // application. Since that's the second executor that is excluded on the same node, we also + // exclude that node. + (0 until 4).foreach { partition => + taskSetExclude1.updateExcludedForFailedTask( + "hostA", exec = "2", index = partition, failureReason = "testing") + } + healthTracker.updateExcludedForSuccessfulTaskSet(0, 0, taskSetExclude1.execToFailures) + assert(healthTracker.excludedNodeList() === Set("hostA")) + assertEquivalentToSet(healthTracker.isNodeExcluded(_), Set("hostA")) + verify(listenerBusMock).post(SparkListenerNodeExcluded(0, "hostA", 2)) + verify(listenerBusMock).post(SparkListenerNodeBlacklisted(0, "hostA", 2)) + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set("1", "2")) + verify(listenerBusMock).post(SparkListenerExecutorExcluded(0, "2", 4)) + verify(listenerBusMock).post(SparkListenerExecutorBlacklisted(0, "2", 4)) + + // Advance the clock and then make sure hostA and executors 1 and 2 have been removed from the + // exclude. + val timeout = healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS + 1 + clock.advance(timeout) + healthTracker.applyExcludeOnFailureTimeout() + assert(healthTracker.excludedNodeList() === Set()) + assertEquivalentToSet(healthTracker.isNodeExcluded(_), Set()) + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set()) + verify(listenerBusMock).post(SparkListenerExecutorUnexcluded(timeout, "2")) + verify(listenerBusMock).post(SparkListenerExecutorUnexcluded(timeout, "1")) + verify(listenerBusMock).post(SparkListenerExecutorUnblacklisted(timeout, "2")) + verify(listenerBusMock).post(SparkListenerExecutorUnblacklisted(timeout, "1")) + verify(listenerBusMock).post(SparkListenerNodeUnexcluded(timeout, "hostA")) + + // Fail one more task, but executor isn't put back into exclude since the count of failures + // on that executor should have been reset to 0. + val taskSetExclude2 = createTaskSetExcludelist(stageId = 2) + taskSetExclude2.updateExcludedForFailedTask( + "hostA", exec = "1", index = 0, failureReason = "testing") + healthTracker.updateExcludedForSuccessfulTaskSet(2, 0, taskSetExclude2.execToFailures) + assert(healthTracker.excludedNodeList() === Set()) + assertEquivalentToSet(healthTracker.isNodeExcluded(_), Set()) + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set()) + } + + test("exclude can handle lost executors") { + // The exclude should still work if an executor is killed completely. We should still + // be able to exclude the entire node. + val taskSetExclude0 = createTaskSetExcludelist(stageId = 0) + // Lets say that executor 1 dies completely. We get some task failures, but + // the taskset then finishes successfully (elsewhere). + (0 until 4).foreach { partition => + taskSetExclude0.updateExcludedForFailedTask( + "hostA", exec = "1", index = partition, failureReason = "testing") + } + healthTracker.handleRemovedExecutor("1") + healthTracker.updateExcludedForSuccessfulTaskSet( + stageId = 0, + stageAttemptId = 0, + taskSetExclude0.execToFailures) + assert(healthTracker.isExecutorExcluded("1")) + verify(listenerBusMock).post(SparkListenerExecutorExcluded(0, "1", 4)) + val t1 = healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS / 2 + clock.advance(t1) + + // Now another executor gets spun up on that host, but it also dies. + val taskSetExclude1 = createTaskSetExcludelist(stageId = 1) + (0 until 4).foreach { partition => + taskSetExclude1.updateExcludedForFailedTask( + "hostA", exec = "2", index = partition, failureReason = "testing") + } + healthTracker.handleRemovedExecutor("2") + healthTracker.updateExcludedForSuccessfulTaskSet( + stageId = 1, + stageAttemptId = 0, + taskSetExclude1.execToFailures) + // We've now had two bad executors on the hostA, so we should exclude the entire node. + assert(healthTracker.isExecutorExcluded("1")) + assert(healthTracker.isExecutorExcluded("2")) + verify(listenerBusMock).post(SparkListenerExecutorExcluded(t1, "2", 4)) + assert(healthTracker.isNodeExcluded("hostA")) + verify(listenerBusMock).post(SparkListenerNodeExcluded(t1, "hostA", 2)) + + // Advance the clock so that executor 1 should no longer be explicitly excluded, but + // everything else should still be excluded. + val t2 = healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS / 2 + 1 + clock.advance(t2) + healthTracker.applyExcludeOnFailureTimeout() + assert(!healthTracker.isExecutorExcluded("1")) + verify(listenerBusMock).post(SparkListenerExecutorUnexcluded(t1 + t2, "1")) + assert(healthTracker.isExecutorExcluded("2")) + assert(healthTracker.isNodeExcluded("hostA")) + // make sure we don't leak memory + assert(!healthTracker.executorIdToExcludedStatus.contains("1")) + assert(!healthTracker.nodeToExcludedExecs("hostA").contains("1")) + // Advance the timeout again so now hostA should be removed from the exclude. + clock.advance(t1) + healthTracker.applyExcludeOnFailureTimeout() + assert(!healthTracker.nodeIdToExcludedExpiryTime.contains("hostA")) + verify(listenerBusMock).post(SparkListenerNodeUnexcluded(t1 + t2 + t1, "hostA")) + // Even though unexcluding a node implicitly unexcludes all of its executors, + // there will be no SparkListenerExecutorUnexcluded sent here. + } + + test("task failures expire with time") { + // Verifies that 2 failures within the timeout period cause an executor to be excluded, but + // if task failures are spaced out by more than the timeout period, the first failure is timed + // out, and the executor isn't excluded. + var stageId = 0 + + def failOneTaskInTaskSet(exec: String): Unit = { + val taskSetExclude = createTaskSetExcludelist(stageId = stageId) + taskSetExclude.updateExcludedForFailedTask("host-" + exec, exec, 0, "testing") + healthTracker.updateExcludedForSuccessfulTaskSet(stageId, 0, taskSetExclude.execToFailures) + stageId += 1 + } + + failOneTaskInTaskSet(exec = "1") + // We have one sporadic failure on exec 2, but that's it. Later checks ensure that we never + // exclude executor 2 despite this one failure. + failOneTaskInTaskSet(exec = "2") + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set()) + assert(healthTracker.nextExpiryTime === Long.MaxValue) + + // We advance the clock past the expiry time. + clock.advance(healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS + 1) + val t0 = clock.getTimeMillis() + healthTracker.applyExcludeOnFailureTimeout() + assert(healthTracker.nextExpiryTime === Long.MaxValue) + failOneTaskInTaskSet(exec = "1") + + // Because the 2nd failure on executor 1 happened past the expiry time, nothing should have been + // excluded. + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set()) + + // Now we add one more failure, within the timeout, and it should be counted. + clock.setTime(t0 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS - 1) + val t1 = clock.getTimeMillis() + failOneTaskInTaskSet(exec = "1") + healthTracker.applyExcludeOnFailureTimeout() + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set("1")) + verify(listenerBusMock).post(SparkListenerExecutorExcluded(t1, "1", 2)) + assert(healthTracker.nextExpiryTime === t1 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS) + + // Add failures on executor 3, make sure it gets put on the exclude. + clock.setTime(t1 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS - 1) + val t2 = clock.getTimeMillis() + failOneTaskInTaskSet(exec = "3") + failOneTaskInTaskSet(exec = "3") + healthTracker.applyExcludeOnFailureTimeout() + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set("1", "3")) + verify(listenerBusMock).post(SparkListenerExecutorExcluded(t2, "3", 2)) + assert(healthTracker.nextExpiryTime === t1 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS) + + // Now we go past the timeout for executor 1, so it should be dropped from the exclude. + clock.setTime(t1 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS + 1) + healthTracker.applyExcludeOnFailureTimeout() + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set("3")) + verify(listenerBusMock).post(SparkListenerExecutorUnexcluded(clock.getTimeMillis(), "1")) + assert(healthTracker.nextExpiryTime === t2 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS) + + // Make sure that we update correctly when we go from having excluded executors to + // just having tasks with timeouts. + clock.setTime(t2 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS - 1) + failOneTaskInTaskSet(exec = "4") + healthTracker.applyExcludeOnFailureTimeout() + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set("3")) + assert(healthTracker.nextExpiryTime === t2 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS) + + clock.setTime(t2 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS + 1) + healthTracker.applyExcludeOnFailureTimeout() + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set()) + verify(listenerBusMock).post(SparkListenerExecutorUnexcluded(clock.getTimeMillis(), "3")) + // we've got one task failure still, but we don't bother setting nextExpiryTime to it, to + // avoid wasting time checking for expiry of individual task failures. + assert(healthTracker.nextExpiryTime === Long.MaxValue) + } + + test("task failure timeout works as expected for long-running tasksets") { + // This ensures that we don't trigger spurious excluding for long tasksets, when the taskset + // finishes long after the task failures. We create two tasksets, each with one failure. + // Individually they shouldn't cause any excluding since there is only one failure. + // Furthermore, we space the failures out so far that even when both tasksets have completed, + // we still don't trigger any excluding. + val taskSetExclude1 = createTaskSetExcludelist(stageId = 1) + val taskSetExclude2 = createTaskSetExcludelist(stageId = 2) + // Taskset1 has one failure immediately + taskSetExclude1.updateExcludedForFailedTask("host-1", "1", 0, "testing") + // Then we have a *long* delay, much longer than the timeout, before any other failures or + // taskset completion + clock.advance(healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS * 5) + // After the long delay, we have one failure on taskset 2, on the same executor + taskSetExclude2.updateExcludedForFailedTask("host-1", "1", 0, "testing") + // Finally, we complete both tasksets. Its important here to complete taskset2 *first*. We + // want to make sure that when taskset 1 finishes, even though we've now got two task failures, + // we realize that the task failure we just added was well before the timeout. + clock.advance(1) + healthTracker.updateExcludedForSuccessfulTaskSet(stageId = 2, 0, taskSetExclude2.execToFailures) + clock.advance(1) + healthTracker.updateExcludedForSuccessfulTaskSet(stageId = 1, 0, taskSetExclude1.execToFailures) + + // Make sure nothing was excluded + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set()) + } + + test("only exclude nodes for the application when enough executors have failed on that " + + "specific host") { + // we exclude executors on two different hosts -- make sure that doesn't lead to any + // node excluding + val taskSetExclude0 = createTaskSetExcludelist(stageId = 0) + taskSetExclude0.updateExcludedForFailedTask( + "hostA", exec = "1", index = 0, failureReason = "testing") + taskSetExclude0.updateExcludedForFailedTask( + "hostA", exec = "1", index = 1, failureReason = "testing") + healthTracker.updateExcludedForSuccessfulTaskSet(0, 0, taskSetExclude0.execToFailures) + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set("1")) + verify(listenerBusMock).post(SparkListenerExecutorExcluded(0, "1", 2)) + assertEquivalentToSet(healthTracker.isNodeExcluded(_), Set()) + + val taskSetExclude1 = createTaskSetExcludelist(stageId = 1) + taskSetExclude1.updateExcludedForFailedTask( + "hostB", exec = "2", index = 0, failureReason = "testing") + taskSetExclude1.updateExcludedForFailedTask( + "hostB", exec = "2", index = 1, failureReason = "testing") + healthTracker.updateExcludedForSuccessfulTaskSet(1, 0, taskSetExclude1.execToFailures) + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set("1", "2")) + verify(listenerBusMock).post(SparkListenerExecutorExcluded(0, "2", 2)) + assertEquivalentToSet(healthTracker.isNodeExcluded(_), Set()) + + // Finally, exclude another executor on the same node as the original excluded executor, + // and make sure this time we *do* exclude the node. + val taskSetExclude2 = createTaskSetExcludelist(stageId = 0) + taskSetExclude2.updateExcludedForFailedTask( + "hostA", exec = "3", index = 0, failureReason = "testing") + taskSetExclude2.updateExcludedForFailedTask( + "hostA", exec = "3", index = 1, failureReason = "testing") + healthTracker.updateExcludedForSuccessfulTaskSet(0, 0, taskSetExclude2.execToFailures) + assertEquivalentToSet(healthTracker.isExecutorExcluded(_), Set("1", "2", "3")) + verify(listenerBusMock).post(SparkListenerExecutorExcluded(0, "3", 2)) + assertEquivalentToSet(healthTracker.isNodeExcluded(_), Set("hostA")) + verify(listenerBusMock).post(SparkListenerNodeExcluded(0, "hostA", 2)) + } + + test("exclude still respects legacy configs") { + val conf = new SparkConf().setMaster("local") + assert(!HealthTracker.isExcludeOnFailureEnabled(conf)) + conf.set(config.EXCLUDE_ON_FAILURE_LEGACY_TIMEOUT_CONF, 5000L) + assert(HealthTracker.isExcludeOnFailureEnabled(conf)) + assert(5000 === HealthTracker.getExludeOnFailureTimeout(conf)) + // the new conf takes precedence, though + conf.set(config.EXCLUDE_ON_FAILURE_TIMEOUT_CONF, 1000L) + assert(1000 === HealthTracker.getExludeOnFailureTimeout(conf)) + + // if you explicitly set the legacy conf to 0, that also would disable excluding + conf.set(config.EXCLUDE_ON_FAILURE_LEGACY_TIMEOUT_CONF, 0L) + assert(!HealthTracker.isExcludeOnFailureEnabled(conf)) + // but again, the new conf takes precedence + conf.set(config.EXCLUDE_ON_FAILURE_ENABLED, true) + assert(HealthTracker.isExcludeOnFailureEnabled(conf)) + assert(1000 === HealthTracker.getExludeOnFailureTimeout(conf)) + } + + test("check exclude configuration invariants") { + val conf = new SparkConf().setMaster("yarn").set(config.SUBMIT_DEPLOY_MODE, "cluster") + Seq( + (2, 2), + (2, 3) + ).foreach { case (maxTaskFailures, maxNodeAttempts) => + conf.set(config.TASK_MAX_FAILURES, maxTaskFailures) + conf.set(config.MAX_TASK_ATTEMPTS_PER_NODE.key, maxNodeAttempts.toString) + val excMsg = intercept[IllegalArgumentException] { + HealthTracker.validateExcludeOnFailureConfs(conf) + }.getMessage() + assert(excMsg === s"${config.MAX_TASK_ATTEMPTS_PER_NODE.key} " + + s"( = ${maxNodeAttempts}) was >= ${config.TASK_MAX_FAILURES.key} " + + s"( = ${maxTaskFailures} ). Though excludeOnFailure is enabled, with this " + + s"configuration, Spark will not be robust to one bad node. Decrease " + + s"${config.MAX_TASK_ATTEMPTS_PER_NODE.key}, increase ${config.TASK_MAX_FAILURES.key}, " + + s"or disable excludeOnFailure with ${config.EXCLUDE_ON_FAILURE_ENABLED.key}") + } + + conf.remove(config.TASK_MAX_FAILURES) + conf.remove(config.MAX_TASK_ATTEMPTS_PER_NODE) + + Seq( + config.MAX_TASK_ATTEMPTS_PER_EXECUTOR, + config.MAX_TASK_ATTEMPTS_PER_NODE, + config.MAX_FAILURES_PER_EXEC_STAGE, + config.MAX_FAILED_EXEC_PER_NODE_STAGE, + config.MAX_FAILURES_PER_EXEC, + config.MAX_FAILED_EXEC_PER_NODE, + config.EXCLUDE_ON_FAILURE_TIMEOUT_CONF + ).foreach { config => + conf.set(config.key, "0") + val excMsg = intercept[IllegalArgumentException] { + HealthTracker.validateExcludeOnFailureConfs(conf) + }.getMessage() + assert(excMsg.contains(s"${config.key} was 0, but must be > 0.")) + conf.remove(config) + } + } + + test("excluding kills executors, configured by EXCLUDE_ON_FAILURE_KILL_ENABLED") { + val allocationClientMock = mock[ExecutorAllocationClient] + when(allocationClientMock.killExecutors(any(), any(), any(), any())).thenReturn(Seq("called")) + when(allocationClientMock.killExecutorsOnHost("hostA")).thenAnswer { (_: InvocationOnMock) => + // To avoid a race between excluding and killing, it is important that the nodeExclude + // is updated before we ask the executor allocation client to kill all the executors + // on a particular host. + if (healthTracker.excludedNodeList().contains("hostA")) { + true + } else { + throw new IllegalStateException("hostA should be on the exclude") + } + } + healthTracker = new HealthTracker(listenerBusMock, conf, Some(allocationClientMock), clock) + + // Disable auto-kill. Exclude an executor and make sure killExecutors is not called. + conf.set(config.EXCLUDE_ON_FAILURE_KILL_ENABLED, false) + + val taskSetExclude0 = createTaskSetExcludelist(stageId = 0) + // Fail 4 tasks in one task set on executor 1, so that executor gets excluded for the whole + // application. + (0 until 4).foreach { partition => + taskSetExclude0.updateExcludedForFailedTask( + "hostA", exec = "1", index = partition, failureReason = "testing") + } + healthTracker.updateExcludedForSuccessfulTaskSet(0, 0, taskSetExclude0.execToFailures) + + verify(allocationClientMock, never).killExecutor(any()) + + val taskSetExclude1 = createTaskSetExcludelist(stageId = 1) + // Fail 4 tasks in one task set on executor 2, so that executor gets excluded for the whole + // application. Since that's the second executor that is excluded on the same node, we also + // exclude that node. + (0 until 4).foreach { partition => + taskSetExclude1.updateExcludedForFailedTask( + "hostA", exec = "2", index = partition, failureReason = "testing") + } + healthTracker.updateExcludedForSuccessfulTaskSet(0, 0, taskSetExclude1.execToFailures) + + verify(allocationClientMock, never).killExecutors(any(), any(), any(), any()) + verify(allocationClientMock, never).killExecutorsOnHost(any()) + + // Enable auto-kill. Exclude an executor and make sure killExecutors is called. + conf.set(config.EXCLUDE_ON_FAILURE_KILL_ENABLED, true) + healthTracker = new HealthTracker(listenerBusMock, conf, Some(allocationClientMock), clock) + + val taskSetExclude2 = createTaskSetExcludelist(stageId = 0) + // Fail 4 tasks in one task set on executor 1, so that executor gets excluded for the whole + // application. + (0 until 4).foreach { partition => + taskSetExclude2.updateExcludedForFailedTask( + "hostA", exec = "1", index = partition, failureReason = "testing") + } + healthTracker.updateExcludedForSuccessfulTaskSet(0, 0, taskSetExclude2.execToFailures) + + verify(allocationClientMock).killExecutors(Seq("1"), false, false, true) + + val taskSetExclude3 = createTaskSetExcludelist(stageId = 1) + // Fail 4 tasks in one task set on executor 2, so that executor gets excluded for the whole + // application. Since that's the second executor that is excluded on the same node, we also + // exclude that node. + (0 until 4).foreach { partition => + taskSetExclude3.updateExcludedForFailedTask( + "hostA", exec = "2", index = partition, failureReason = "testing") + } + healthTracker.updateExcludedForSuccessfulTaskSet(0, 0, taskSetExclude3.execToFailures) + + verify(allocationClientMock).killExecutors(Seq("2"), false, false, true) + verify(allocationClientMock).killExecutorsOnHost("hostA") + } + + test("excluding decommission and kills executors when enabled") { + val allocationClientMock = mock[ExecutorAllocationClient] + + // verify we decommission when configured + conf.set(config.EXCLUDE_ON_FAILURE_KILL_ENABLED, true) + conf.set(config.DECOMMISSION_ENABLED.key, "true") + conf.set(config.EXCLUDE_ON_FAILURE_DECOMMISSION_ENABLED.key, "true") + conf.set(config.MAX_FAILURES_PER_EXEC.key, "1") + conf.set(config.MAX_FAILED_EXEC_PER_NODE.key, "2") + healthTracker = new HealthTracker(listenerBusMock, conf, Some(allocationClientMock), clock) + + // Fail 4 tasks in one task set on executor 1, so that executor gets excluded for the whole + // application. + val taskSetExclude2 = createTaskSetExcludelist(stageId = 0) + (0 until 4).foreach { partition => + taskSetExclude2.updateExcludedForFailedTask( + "hostA", exec = "1", index = partition, failureReason = "testing") + } + healthTracker.updateExcludedForSuccessfulTaskSet(0, 0, taskSetExclude2.execToFailures) + + val msg1 = + "Killing excluded executor id 1 since spark.excludeOnFailure.killExcludedExecutors is set." + + " (actually decommissioning)" + + verify(allocationClientMock).decommissionExecutor( + "1", ExecutorDecommissionInfo(msg1), false) + + val taskSetExclude3 = createTaskSetExcludelist(stageId = 1) + // Fail 4 tasks in one task set on executor 2, so that executor gets excluded for the whole + // application. Since that's the second executor that is excluded on the same node, we also + // exclude that node. + (0 until 4).foreach { partition => + taskSetExclude3.updateExcludedForFailedTask( + "hostA", exec = "2", index = partition, failureReason = "testing") + } + healthTracker.updateExcludedForSuccessfulTaskSet(0, 0, taskSetExclude3.execToFailures) + + val msg2 = + "Killing excluded executor id 2 since spark.excludeOnFailure.killExcludedExecutors is set." + + " (actually decommissioning)" + verify(allocationClientMock).decommissionExecutor( + "2", ExecutorDecommissionInfo(msg2), false, false) + verify(allocationClientMock).decommissionExecutorsOnHost("hostA") + } + + test("fetch failure excluding kills executors, configured by EXCLUDE_ON_FAILURE_KILL_ENABLED") { + val allocationClientMock = mock[ExecutorAllocationClient] + when(allocationClientMock.killExecutors(any(), any(), any(), any())).thenReturn(Seq("called")) + when(allocationClientMock.killExecutorsOnHost("hostA")).thenAnswer { (_: InvocationOnMock) => + // To avoid a race between excluding and killing, it is important that the nodeExclude + // is updated before we ask the executor allocation client to kill all the executors + // on a particular host. + if (healthTracker.excludedNodeList().contains("hostA")) { + true + } else { + throw new IllegalStateException("hostA should be on the exclude") + } + } + + conf.set(config.EXCLUDE_ON_FAILURE_FETCH_FAILURE_ENABLED, true) + healthTracker = new HealthTracker(listenerBusMock, conf, Some(allocationClientMock), clock) + + // Disable auto-kill. Exclude an executor and make sure killExecutors is not called. + conf.set(config.EXCLUDE_ON_FAILURE_KILL_ENABLED, false) + healthTracker.updateExcludedForFetchFailure("hostA", exec = "1") + + verify(allocationClientMock, never).killExecutors(any(), any(), any(), any()) + verify(allocationClientMock, never).killExecutorsOnHost(any()) + + assert(healthTracker.nodeToExcludedExecs.contains("hostA")) + assert(healthTracker.nodeToExcludedExecs("hostA").contains("1")) + + // Enable auto-kill. Exclude an executor and make sure killExecutors is called. + conf.set(config.EXCLUDE_ON_FAILURE_KILL_ENABLED, true) + healthTracker = new HealthTracker(listenerBusMock, conf, Some(allocationClientMock), clock) + clock.advance(1000) + healthTracker.updateExcludedForFetchFailure("hostA", exec = "1") + + verify(allocationClientMock).killExecutors(Seq("1"), false, false, true) + verify(allocationClientMock, never).killExecutorsOnHost(any()) + + assert(healthTracker.executorIdToExcludedStatus.contains("1")) + assert(healthTracker.executorIdToExcludedStatus("1").node === "hostA") + assert(healthTracker.executorIdToExcludedStatus("1").expiryTime === + 1000 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS) + assert(healthTracker.nextExpiryTime === 1000 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS) + assert(healthTracker.nodeIdToExcludedExpiryTime.isEmpty) + assert(healthTracker.nodeToExcludedExecs.contains("hostA")) + assert(healthTracker.nodeToExcludedExecs("hostA").contains("1")) + + // Enable external shuffle service to see if all the executors on this node will be killed. + conf.set(config.SHUFFLE_SERVICE_ENABLED, true) + clock.advance(1000) + healthTracker.updateExcludedForFetchFailure("hostA", exec = "2") + + verify(allocationClientMock, never).killExecutors(Seq("2"), true, true) + verify(allocationClientMock).killExecutorsOnHost("hostA") + + assert(healthTracker.nodeIdToExcludedExpiryTime.contains("hostA")) + assert(healthTracker.nodeIdToExcludedExpiryTime("hostA") === + 2000 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS) + assert(healthTracker.nextExpiryTime === 1000 + healthTracker.EXCLUDE_ON_FAILURE_TIMEOUT_MILLIS) + } +} diff --git a/core/src/test/scala/org/apache/spark/scheduler/PoolSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/PoolSuite.scala index d9de976c789d4..fa2c5eaee8baf 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/PoolSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/PoolSuite.scala @@ -20,10 +20,14 @@ package org.apache.spark.scheduler import java.io.FileNotFoundException import java.util.Properties -import org.apache.spark.{LocalSparkContext, SparkConf, SparkContext, SparkFunSuite} +import org.apache.hadoop.fs.Path +import org.apache.hadoop.util.VersionInfo + +import org.apache.spark.{LocalSparkContext, SparkConf, SparkContext, SparkFunSuite, TestUtils} import org.apache.spark.internal.config.SCHEDULER_ALLOCATION_FILE import org.apache.spark.resource.ResourceProfile import org.apache.spark.scheduler.SchedulingMode._ +import org.apache.spark.util.Utils /** * Tests that pools and the associated scheduling algorithms for FIFO and fair scheduling work @@ -87,7 +91,7 @@ class PoolSuite extends SparkFunSuite with LocalSparkContext { val taskScheduler = new TaskSchedulerImpl(sc) val rootPool = new Pool("", FAIR, 0, 0) - val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc.conf) + val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc) schedulableBuilder.buildPools() // Ensure that the XML file was read in correctly. @@ -185,9 +189,10 @@ class PoolSuite extends SparkFunSuite with LocalSparkContext { val xmlPath = getClass.getClassLoader.getResource("fairscheduler-with-invalid-data.xml") .getFile() val conf = new SparkConf().set(SCHEDULER_ALLOCATION_FILE, xmlPath) + sc = new SparkContext(LOCAL, APP_NAME, conf) val rootPool = new Pool("", FAIR, 0, 0) - val schedulableBuilder = new FairSchedulableBuilder(rootPool, conf) + val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc) schedulableBuilder.buildPools() verifyPool(rootPool, schedulableBuilder.DEFAULT_POOL_NAME, 0, 1, FIFO) @@ -239,7 +244,7 @@ class PoolSuite extends SparkFunSuite with LocalSparkContext { val taskScheduler = new TaskSchedulerImpl(sc) val rootPool = new Pool("", SchedulingMode.FAIR, initMinShare = 0, initWeight = 0) - val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc.conf) + val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc) schedulableBuilder.buildPools() // Submit a new task set manager with pool properties set to null. This should result @@ -267,7 +272,7 @@ class PoolSuite extends SparkFunSuite with LocalSparkContext { val taskScheduler = new TaskSchedulerImpl(sc) val rootPool = new Pool("", SchedulingMode.FAIR, initMinShare = 0, initWeight = 0) - val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc.conf) + val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc) schedulableBuilder.buildPools() assert(rootPool.getSchedulableByName(TEST_POOL) === null) @@ -302,7 +307,7 @@ class PoolSuite extends SparkFunSuite with LocalSparkContext { sc = new SparkContext(LOCAL, APP_NAME, conf) val rootPool = new Pool("", SchedulingMode.FAIR, 0, 0) - val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc.conf) + val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc) schedulableBuilder.buildPools() verifyPool(rootPool, schedulableBuilder.DEFAULT_POOL_NAME, 0, 1, FIFO) @@ -317,7 +322,7 @@ class PoolSuite extends SparkFunSuite with LocalSparkContext { sc = new SparkContext(LOCAL, APP_NAME, conf) val rootPool = new Pool("", SchedulingMode.FAIR, 0, 0) - val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc.conf) + val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc) schedulableBuilder.buildPools() verifyPool(rootPool, schedulableBuilder.DEFAULT_POOL_NAME, 0, 1, FIFO) @@ -332,12 +337,36 @@ class PoolSuite extends SparkFunSuite with LocalSparkContext { sc = new SparkContext(LOCAL, APP_NAME, conf) val rootPool = new Pool("", SchedulingMode.FAIR, 0, 0) - val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc.conf) + val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc) intercept[FileNotFoundException] { schedulableBuilder.buildPools() } } + test("SPARK-35083: Support remote scheduler pool file") { + val hadoopVersion = VersionInfo.getVersion.split("\\.") + // HttpFileSystem supported since hadoop 2.9 + assume(hadoopVersion.head.toInt >= 3 || + (hadoopVersion.head.toInt == 2 && hadoopVersion(1).toInt >= 9)) + + val xmlPath = new Path( + Utils.getSparkClassLoader.getResource("fairscheduler-with-valid-data.xml").getFile) + TestUtils.withHttpServer(xmlPath.getParent.toUri.getPath) { baseURL => + val conf = new SparkConf().set(SCHEDULER_ALLOCATION_FILE, + baseURL + "fairscheduler-with-valid-data.xml") + sc = new SparkContext(LOCAL, APP_NAME, conf) + + val rootPool = new Pool("", SchedulingMode.FAIR, 0, 0) + val schedulableBuilder = new FairSchedulableBuilder(rootPool, sc) + schedulableBuilder.buildPools() + + verifyPool(rootPool, schedulableBuilder.DEFAULT_POOL_NAME, 0, 1, FIFO) + verifyPool(rootPool, "pool1", 3, 1, FIFO) + verifyPool(rootPool, "pool2", 4, 2, FAIR) + verifyPool(rootPool, "pool3", 2, 3, FAIR) + } + } + private def verifyPool(rootPool: Pool, poolName: String, expectedInitMinShare: Int, expectedInitWeight: Int, expectedSchedulingMode: SchedulingMode): Unit = { val selectedPool = rootPool.getSchedulableByName(poolName) diff --git a/core/src/test/scala/org/apache/spark/scheduler/ReplayListenerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/ReplayListenerSuite.scala index e6fbf9b09d43d..cb50c7c959754 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/ReplayListenerSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/ReplayListenerSuite.scala @@ -255,7 +255,7 @@ class ReplayListenerSuite extends SparkFunSuite with BeforeAndAfter with LocalSp /* * This is a dummy input stream that wraps another input stream but ends prematurely when - * reading at the specified position, throwing an EOFExeption. + * reading at the specified position, throwing an EOFException. */ private class EarlyEOFInputStream(in: InputStream, failAtPos: Int) extends InputStream { private val countDown = new AtomicInteger(failAtPos) diff --git a/core/src/test/scala/org/apache/spark/scheduler/SchedulerIntegrationSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/SchedulerIntegrationSuite.scala index 0874163b0e946..88d2868b957f9 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/SchedulerIntegrationSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/SchedulerIntegrationSuite.scala @@ -44,7 +44,7 @@ import org.apache.spark.util.{CallSite, ThreadUtils, Utils} * TaskSetManagers. * * Test cases are configured by providing a set of jobs to submit, and then simulating interaction - * with spark's executors via a mocked backend (eg., task completion, task failure, executors + * with spark's executors via a mocked backend (e.g., task completion, task failure, executors * disconnecting, etc.). */ abstract class SchedulerIntegrationSuite[T <: MockBackend: ClassTag] extends SparkFunSuite @@ -372,7 +372,7 @@ private[spark] abstract class MockBackend( /** * Accessed by both scheduling and backend thread, so should be protected by this. - * Most likely the only thing that needs to be protected are the inidividual ExecutorTaskStatus, + * Most likely the only thing that needs to be protected are the individual ExecutorTaskStatus, * but for simplicity in this mock just lock the whole backend. */ def executorIdToExecutor: Map[String, ExecutorTaskStatus] @@ -535,8 +535,8 @@ class BasicSchedulerIntegrationSuite extends SchedulerIntegrationSuite[SingleCor */ testScheduler("super simple job") { def runBackend(): Unit = { - val (taskDescripition, _) = backend.beginTask() - backend.taskSuccess(taskDescripition, 42) + val (taskDescription, _) = backend.beginTask() + backend.taskSuccess(taskDescription, 42) } withBackend(runBackend _) { val jobFuture = submit(new MockRDD(sc, 10, Nil), (0 until 10).toArray) diff --git a/core/src/test/scala/org/apache/spark/scheduler/SparkListenerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/SparkListenerSuite.scala index d4e8d63b54e5f..d72744c5cc348 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/SparkListenerSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/SparkListenerSuite.scala @@ -24,7 +24,8 @@ import scala.collection.JavaConverters._ import scala.collection.mutable import org.mockito.Mockito -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark._ import org.apache.spark.executor.TaskMetrics @@ -570,9 +571,9 @@ class SparkListenerSuite extends SparkFunSuite with LocalSparkContext with Match } } - test("event queue size can be configued through spark conf") { + test("event queue size can be configured through spark conf") { // configure the shared queue size to be 1, event log queue size to be 2, - // and listner bus event queue size to be 5 + // and listener bus event queue size to be 5 val conf = new SparkConf(false) .set(LISTENER_BUS_EVENT_QUEUE_CAPACITY, 5) .set(s"spark.scheduler.listenerbus.eventqueue.${SHARED_QUEUE}.capacity", "1") @@ -592,7 +593,7 @@ class SparkListenerSuite extends SparkFunSuite with LocalSparkContext with Match // check the size of shared queue is 1 as configured assert(bus.getQueueCapacity(SHARED_QUEUE) == Some(1)) // no specific size of status queue is configured, - // it shoud use the LISTENER_BUS_EVENT_QUEUE_CAPACITY + // it should use the LISTENER_BUS_EVENT_QUEUE_CAPACITY assert(bus.getQueueCapacity(APP_STATUS_QUEUE) == Some(5)) // check the size of event log queue is 5 as configured assert(bus.getQueueCapacity(EVENT_LOG_QUEUE) == Some(2)) @@ -621,7 +622,7 @@ class SparkListenerSuite extends SparkFunSuite with LocalSparkContext with Match } override def onStageCompleted(stage: SparkListenerStageCompleted): Unit = { - stageInfos(stage.stageInfo) = taskInfoMetrics + stageInfos(stage.stageInfo) = taskInfoMetrics.toSeq taskInfoMetrics = mutable.Buffer.empty } } diff --git a/core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala index 394a2a9fbf7cb..8a7ff9eb6dcd3 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/TaskContextSuite.scala @@ -70,7 +70,7 @@ class TaskContextSuite extends SparkFunSuite with BeforeAndAfter with LocalSpark 0, 0, taskBinary, rdd.partitions(0), Seq.empty, 0, new Properties, closureSerializer.serialize(TaskMetrics.registered).array()) intercept[RuntimeException] { - task.run(0, 0, null, null) + task.run(0, 0, null, null, Option.empty) } assert(TaskContextSuite.completed) } @@ -92,7 +92,7 @@ class TaskContextSuite extends SparkFunSuite with BeforeAndAfter with LocalSpark 0, 0, taskBinary, rdd.partitions(0), Seq.empty, 0, new Properties, closureSerializer.serialize(TaskMetrics.registered).array()) intercept[RuntimeException] { - task.run(0, 0, null, null) + task.run(0, 0, null, null, Option.empty) } assert(TaskContextSuite.lastError.getMessage == "damn error") } diff --git a/core/src/test/scala/org/apache/spark/scheduler/TaskDescriptionSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/TaskDescriptionSuite.scala index 5839532f11666..98b5bada27646 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/TaskDescriptionSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/TaskDescriptionSuite.scala @@ -33,6 +33,10 @@ class TaskDescriptionSuite extends SparkFunSuite { originalFiles.put("fileUrl1", 1824) originalFiles.put("fileUrl2", 2) + val originalArchives = new HashMap[String, Long]() + originalArchives.put("archiveUrl1", 1824) + originalArchives.put("archiveUrl2", 2) + val originalJars = new HashMap[String, Long]() originalJars.put("jar1", 3) @@ -70,6 +74,7 @@ class TaskDescriptionSuite extends SparkFunSuite { partitionId = 1, originalFiles, originalJars, + originalArchives, originalProperties, originalResources, taskBuffer @@ -87,6 +92,7 @@ class TaskDescriptionSuite extends SparkFunSuite { assert(decodedTaskDescription.partitionId === originalTaskDescription.partitionId) assert(decodedTaskDescription.addedFiles.equals(originalFiles)) assert(decodedTaskDescription.addedJars.equals(originalJars)) + assert(decodedTaskDescription.addedArchives.equals(originalArchives)) assert(decodedTaskDescription.properties.equals(originalTaskDescription.properties)) assert(equalResources(decodedTaskDescription.resources, originalTaskDescription.resources)) assert(decodedTaskDescription.serializedTask.equals(taskBuffer)) diff --git a/core/src/test/scala/org/apache/spark/scheduler/TaskResultGetterSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/TaskResultGetterSuite.scala index 2efe6da5e986f..ea44a2d948ca9 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/TaskResultGetterSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/TaskResultGetterSuite.scala @@ -103,7 +103,7 @@ private class MyTaskResultGetter(env: SparkEnv, scheduler: TaskSchedulerImpl) // DirectTaskResults that we receive from the executors private val _taskResults = new ArrayBuffer[DirectTaskResult[_]] - def taskResults: Seq[DirectTaskResult[_]] = _taskResults + def taskResults: Seq[DirectTaskResult[_]] = _taskResults.toSeq override def enqueueSuccessfulTask(tsm: TaskSetManager, tid: Long, data: ByteBuffer): Unit = { // work on a copy since the super class still needs to use the buffer diff --git a/core/src/test/scala/org/apache/spark/scheduler/TaskSchedulerImplSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/TaskSchedulerImplSuite.scala index a8541cb863478..53dc14cc12a6b 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/TaskSchedulerImplSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/TaskSchedulerImplSuite.scala @@ -34,7 +34,7 @@ import org.apache.spark.internal.config import org.apache.spark.resource.{ExecutorResourceRequests, ResourceProfile, TaskResourceRequests} import org.apache.spark.resource.ResourceUtils._ import org.apache.spark.resource.TestResourceIDs._ -import org.apache.spark.util.ManualClock +import org.apache.spark.util.{Clock, ManualClock} class FakeSchedulerBackend extends SchedulerBackend { def start(): Unit = {} @@ -51,11 +51,11 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B var failedTaskSetReason: String = null var failedTaskSet = false - var blacklist: BlacklistTracker = null + var healthTracker: HealthTracker = null var taskScheduler: TaskSchedulerImpl = null var dagScheduler: DAGScheduler = null - val stageToMockTaskSetBlacklist = new HashMap[Int, TaskSetBlacklist]() + val stageToMockTaskSetExcludelist = new HashMap[Int, TaskSetExcludelist]() val stageToMockTaskSetManager = new HashMap[Int, TaskSetManager]() override def beforeEach(): Unit = { @@ -63,7 +63,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B failedTaskSet = false failedTaskSetException = None failedTaskSetReason = null - stageToMockTaskSetBlacklist.clear() + stageToMockTaskSetExcludelist.clear() stageToMockTaskSetManager.clear() } @@ -91,14 +91,14 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B val conf = new SparkConf().setMaster(master).setAppName("TaskSchedulerImplSuite") confs.foreach { case (k, v) => conf.set(k, v) } sc = new SparkContext(conf) - taskScheduler = new TaskSchedulerImpl(sc) + taskScheduler = new TaskSchedulerImpl(sc, sc.conf.get(config.TASK_MAX_FAILURES)) setupHelper() } - def setupSchedulerWithMockTaskSetBlacklist(confs: (String, String)*): TaskSchedulerImpl = { - blacklist = mock[BlacklistTracker] + def setupSchedulerWithMockTaskSetExcludelist(confs: (String, String)*): TaskSchedulerImpl = { + healthTracker = mock[HealthTracker] val conf = new SparkConf().setMaster("local").setAppName("TaskSchedulerImplSuite") - conf.set(config.BLACKLIST_ENABLED, true) + conf.set(config.EXCLUDE_ON_FAILURE_ENABLED, true) confs.foreach { case (k, v) => conf.set(k, v) } sc = new SparkContext(conf) @@ -106,16 +106,16 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B new TaskSchedulerImpl(sc, sc.conf.get(config.TASK_MAX_FAILURES)) { override def createTaskSetManager(taskSet: TaskSet, maxFailures: Int): TaskSetManager = { val tsm = super.createTaskSetManager(taskSet, maxFailures) - // we need to create a spied tsm just so we can set the TaskSetBlacklist + // we need to create a spied tsm just so we can set the TaskSetExcludelist val tsmSpy = spy(tsm) - val taskSetBlacklist = mock[TaskSetBlacklist] - when(tsmSpy.taskSetBlacklistHelperOpt).thenReturn(Some(taskSetBlacklist)) + val taskSetExcludelist = mock[TaskSetExcludelist] + when(tsmSpy.taskSetExcludelistHelperOpt).thenReturn(Some(taskSetExcludelist)) stageToMockTaskSetManager(taskSet.stageId) = tsmSpy - stageToMockTaskSetBlacklist(taskSet.stageId) = taskSetBlacklist + stageToMockTaskSetExcludelist(taskSet.stageId) = taskSetExcludelist tsmSpy } - override private[scheduler] lazy val blacklistTrackerOpt = Some(blacklist) + override private[scheduler] lazy val healthTrackerOpt = Some(healthTracker) } setupHelper() } @@ -140,6 +140,33 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B taskScheduler } + test("SPARK-32653: Decommissioned host/executor should be considered as inactive") { + val scheduler = setupScheduler() + val exec0 = "exec0" + val exec1 = "exec1" + val exec2 = "exec2" + val host0 = "host0" + val host1 = "host1" + val workerOffers = IndexedSeq( + WorkerOffer(exec0, host0, 1), + WorkerOffer(exec1, host0, 1), + WorkerOffer(exec2, host1, 1)) + scheduler.resourceOffers(workerOffers) + assert(Seq(exec0, exec1, exec2).forall(scheduler.isExecutorAlive)) + assert(Seq(host0, host1).forall(scheduler.hasExecutorsAliveOnHost)) + assert(scheduler.getExecutorsAliveOnHost(host0) + .exists(s => s.contains(exec0) && s.contains(exec1))) + assert(scheduler.getExecutorsAliveOnHost(host1).exists(_.contains(exec2))) + + scheduler.executorDecommission(exec1, ExecutorDecommissionInfo("test", None)) + scheduler.executorDecommission(exec2, ExecutorDecommissionInfo("test", Some(host1))) + + assert(scheduler.isExecutorAlive(exec0)) + assert(!Seq(exec1, exec2).exists(scheduler.isExecutorAlive)) + assert(scheduler.hasExecutorsAliveOnHost(host0)) + assert(!scheduler.hasExecutorsAliveOnHost(host1)) + } + test("Scheduler does not always schedule tasks on the same workers") { val taskScheduler = setupScheduler() val numFreeCores = 1 @@ -196,14 +223,15 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B assert(!failedTaskSet) } - private def setupTaskSchedulerForLocalityTests(clock: ManualClock): TaskSchedulerImpl = { - val conf = new SparkConf() + private def setupTaskSchedulerForLocalityTests( + clock: ManualClock, + conf: SparkConf = new SparkConf()): TaskSchedulerImpl = { sc = new SparkContext("local", "TaskSchedulerImplSuite", conf) val taskScheduler = new TaskSchedulerImpl(sc, sc.conf.get(config.TASK_MAX_FAILURES), clock = clock) { override def createTaskSetManager(taskSet: TaskSet, maxTaskFailures: Int): TaskSetManager = { - new TaskSetManager(this, taskSet, maxTaskFailures, blacklistTrackerOpt, clock) + new TaskSetManager(this, taskSet, maxTaskFailures, healthTrackerOpt, clock) } override def shuffleOffers(offers: IndexedSeq[WorkerOffer]): IndexedSeq[WorkerOffer] = { // Don't shuffle the offers around for this test. Instead, we'll just pass in all @@ -641,7 +669,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B assert(0 === taskDescriptions2.length) // provide the actual loss reason for executor0 - taskScheduler.executorLost("executor0", SlaveLost("oops")) + taskScheduler.executorLost("executor0", ExecutorProcessLost("oops")) // executor0's tasks should have failed now that the loss reason is known, so offering more // resources should make them be scheduled on the new executor. @@ -651,22 +679,22 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B assert(!failedTaskSet) } - test("scheduled tasks obey task and stage blacklists") { - taskScheduler = setupSchedulerWithMockTaskSetBlacklist() + test("scheduled tasks obey task and stage excludelist") { + taskScheduler = setupSchedulerWithMockTaskSetExcludelist() (0 to 2).foreach {stageId => val taskSet = FakeTask.createTaskSet(numTasks = 2, stageId = stageId, stageAttemptId = 0) taskScheduler.submitTasks(taskSet) } - // Setup our mock blacklist: - // * stage 0 is blacklisted on node "host1" - // * stage 1 is blacklisted on executor "executor3" - // * stage 0, partition 0 is blacklisted on executor 0 - // (mocked methods default to returning false, ie. no blacklisting) - when(stageToMockTaskSetBlacklist(0).isNodeBlacklistedForTaskSet("host1")).thenReturn(true) - when(stageToMockTaskSetBlacklist(1).isExecutorBlacklistedForTaskSet("executor3")) + // Setup our mock excludelist: + // * stage 0 is excluded on node "host1" + // * stage 1 is excluded on executor "executor3" + // * stage 0, partition 0 is excluded on executor 0 + // (mocked methods default to returning false, ie. no excluding) + when(stageToMockTaskSetExcludelist(0).isNodeExcludedForTaskSet("host1")).thenReturn(true) + when(stageToMockTaskSetExcludelist(1).isExecutorExcludedForTaskSet("executor3")) .thenReturn(true) - when(stageToMockTaskSetBlacklist(0).isExecutorBlacklistedForTask("executor0", 0)) + when(stageToMockTaskSetExcludelist(0).isExecutorExcludedForTask("executor0", 0)) .thenReturn(true) val offers = IndexedSeq( @@ -678,21 +706,21 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B val firstTaskAttempts = taskScheduler.resourceOffers(offers).flatten // We should schedule all tasks. assert(firstTaskAttempts.size === 6) - // Whenever we schedule a task, we must consult the node and executor blacklist. (The test + // Whenever we schedule a task, we must consult the node and executor excludelist. (The test // doesn't check exactly what checks are made because the offers get shuffled.) (0 to 2).foreach { stageId => - verify(stageToMockTaskSetBlacklist(stageId), atLeast(1)) - .isNodeBlacklistedForTaskSet(anyString()) - verify(stageToMockTaskSetBlacklist(stageId), atLeast(1)) - .isExecutorBlacklistedForTaskSet(anyString()) + verify(stageToMockTaskSetExcludelist(stageId), atLeast(1)) + .isNodeExcludedForTaskSet(anyString()) + verify(stageToMockTaskSetExcludelist(stageId), atLeast(1)) + .isExecutorExcludedForTaskSet(anyString()) } def tasksForStage(stageId: Int): Seq[TaskDescription] = { firstTaskAttempts.filter{_.name.contains(s"stage $stageId")} } tasksForStage(0).foreach { task => - // executors 1 & 2 blacklisted for node - // executor 0 blacklisted just for partition 0 + // executors 1 & 2 excluded for node + // executor 0 excluded just for partition 0 if (task.index == 0) { assert(task.executorId === "executor3") } else { @@ -700,12 +728,12 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B } } tasksForStage(1).foreach { task => - // executor 3 blacklisted + // executor 3 excluded assert("executor3" != task.executorId) } // no restrictions on stage 2 - // Finally, just make sure that we can still complete tasks as usual with blacklisting + // Finally, just make sure that we can still complete tasks as usual with exclusion // in effect. Finish each of the tasksets -- taskset 0 & 1 complete successfully, taskset 2 // fails. (0 to 2).foreach { stageId => @@ -743,23 +771,23 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B } // the tasksSets complete, so the tracker should be notified of the successful ones - verify(blacklist, times(1)).updateBlacklistForSuccessfulTaskSet( + verify(healthTracker, times(1)).updateExcludedForSuccessfulTaskSet( stageId = 0, stageAttemptId = 0, - failuresByExec = stageToMockTaskSetBlacklist(0).execToFailures) - verify(blacklist, times(1)).updateBlacklistForSuccessfulTaskSet( + failuresByExec = stageToMockTaskSetExcludelist(0).execToFailures) + verify(healthTracker, times(1)).updateExcludedForSuccessfulTaskSet( stageId = 1, stageAttemptId = 0, - failuresByExec = stageToMockTaskSetBlacklist(1).execToFailures) + failuresByExec = stageToMockTaskSetExcludelist(1).execToFailures) // but we shouldn't update for the failed taskset - verify(blacklist, never).updateBlacklistForSuccessfulTaskSet( + verify(healthTracker, never).updateExcludedForSuccessfulTaskSet( stageId = meq(2), stageAttemptId = anyInt(), failuresByExec = any()) } - test("scheduled tasks obey node and executor blacklists") { - taskScheduler = setupSchedulerWithMockTaskSetBlacklist() + test("scheduled tasks obey node and executor excludelists") { + taskScheduler = setupSchedulerWithMockTaskSetExcludelist() (0 to 2).foreach { stageId => val taskSet = FakeTask.createTaskSet(numTasks = 2, stageId = stageId, stageAttemptId = 0) taskScheduler.submitTasks(taskSet) @@ -773,13 +801,13 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B new WorkerOffer("executor4", "host3", 1) ) - // setup our mock blacklist: - // host1, executor0 & executor3 are completely blacklisted + // setup our mock excludelist: + // host1, executor0 & executor3 are completely excluded // This covers everything *except* one core on executor4 / host3, so that everything is still // schedulable. - when(blacklist.isNodeBlacklisted("host1")).thenReturn(true) - when(blacklist.isExecutorBlacklisted("executor0")).thenReturn(true) - when(blacklist.isExecutorBlacklisted("executor3")).thenReturn(true) + when(healthTracker.isNodeExcluded("host1")).thenReturn(true) + when(healthTracker.isExecutorExcluded("executor0")).thenReturn(true) + when(healthTracker.isExecutorExcluded("executor3")).thenReturn(true) val stageToTsm = (0 to 2).map { stageId => val tsm = taskScheduler.taskSetManagerForAttempt(stageId, 0).get @@ -791,12 +819,12 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B assert(firstTaskAttempts.size === 1) assert(firstTaskAttempts.head.executorId === "executor4") ('0' until '2').foreach { hostNum => - verify(blacklist, atLeast(1)).isNodeBlacklisted("host" + hostNum) + verify(healthTracker, atLeast(1)).isNodeExcluded("host" + hostNum) } } - test("abort stage when all executors are blacklisted and we cannot acquire new executor") { - taskScheduler = setupSchedulerWithMockTaskSetBlacklist() + test("abort stage when all executors are excluded and we cannot acquire new executor") { + taskScheduler = setupSchedulerWithMockTaskSetExcludelist() val taskSet = FakeTask.createTaskSet(numTasks = 10) taskScheduler.submitTasks(taskSet) val tsm = stageToMockTaskSetManager(0) @@ -809,11 +837,11 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B WorkerOffer("executor3", "host1", 2) )) - // now say our blacklist updates to blacklist a bunch of resources, but *not* everything - when(blacklist.isNodeBlacklisted("host1")).thenReturn(true) - when(blacklist.isExecutorBlacklisted("executor0")).thenReturn(true) + // now say our health tracker updates to exclude a bunch of resources, but *not* everything + when(healthTracker.isNodeExcluded("host1")).thenReturn(true) + when(healthTracker.isExecutorExcluded("executor0")).thenReturn(true) - // make an offer on the blacklisted resources. We won't schedule anything, but also won't + // make an offer on the excluded resources. We won't schedule anything, but also won't // abort yet, since we know of other resources that work assert(taskScheduler.resourceOffers(IndexedSeq( WorkerOffer("executor0", "host0", 2), @@ -821,9 +849,9 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B )).flatten.size === 0) assert(!tsm.isZombie) - // now update the blacklist so that everything really is blacklisted - when(blacklist.isExecutorBlacklisted("executor1")).thenReturn(true) - when(blacklist.isExecutorBlacklisted("executor2")).thenReturn(true) + // now update the health tracker so that everything really is excluded + when(healthTracker.isExecutorExcluded("executor1")).thenReturn(true) + when(healthTracker.isExecutorExcluded("executor2")).thenReturn(true) assert(taskScheduler.resourceOffers(IndexedSeq( WorkerOffer("executor0", "host0", 2), WorkerOffer("executor3", "host1", 2) @@ -832,10 +860,10 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B verify(tsm).abort(anyString(), any()) } - test("SPARK-22148 abort timer should kick in when task is completely blacklisted & no new " + + test("SPARK-22148 abort timer should kick in when task is completely excluded & no new " + "executor can be acquired") { // set the abort timer to fail immediately - taskScheduler = setupSchedulerWithMockTaskSetBlacklist( + taskScheduler = setupSchedulerWithMockTaskSetExcludelist( config.UNSCHEDULABLE_TASKSET_TIMEOUT.key -> "0") // We have only 1 task remaining with 1 executor @@ -851,10 +879,10 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B // Fail the running task val failedTask = firstTaskAttempts.find(_.executorId == "executor0").get failTask(failedTask.taskId, TaskState.FAILED, UnknownReason, tsm) - when(tsm.taskSetBlacklistHelperOpt.get.isExecutorBlacklistedForTask( + when(tsm.taskSetExcludelistHelperOpt.get.isExecutorExcludedForTask( "executor0", failedTask.index)).thenReturn(true) - // make an offer on the blacklisted executor. We won't schedule anything, and set the abort + // make an offer on the excluded executor. We won't schedule anything, and set the abort // timer to kick in immediately assert(taskScheduler.resourceOffers(IndexedSeq( WorkerOffer("executor0", "host0", 1) @@ -867,7 +895,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B } test("SPARK-22148 try to acquire a new executor when task is unschedulable with 1 executor") { - taskScheduler = setupSchedulerWithMockTaskSetBlacklist( + taskScheduler = setupSchedulerWithMockTaskSetExcludelist( config.UNSCHEDULABLE_TASKSET_TIMEOUT.key -> "10") // We have only 1 task remaining with 1 executor @@ -883,11 +911,11 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B // Fail the running task val failedTask = firstTaskAttempts.head failTask(failedTask.taskId, TaskState.FAILED, UnknownReason, tsm) - when(tsm.taskSetBlacklistHelperOpt.get.isExecutorBlacklistedForTask( + when(tsm.taskSetExcludelistHelperOpt.get.isExecutorExcludedForTask( "executor0", failedTask.index)).thenReturn(true) - // make an offer on the blacklisted executor. We won't schedule anything, and set the abort - // timer to expire if no new executors could be acquired. We kill the existing idle blacklisted + // make an offer on the excluded executor. We won't schedule anything, and set the abort + // timer to expire if no new executors could be acquired. We kill the existing idle excluded // executor and try to acquire a new one. assert(taskScheduler.resourceOffers(IndexedSeq( WorkerOffer("executor0", "host0", 1) @@ -903,12 +931,12 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B assert(!tsm.isZombie) } - // This is to test a scenario where we have two taskSets completely blacklisted and on acquiring + // This is to test a scenario where we have two taskSets completely excluded and on acquiring // a new executor we don't want the abort timer for the second taskSet to expire and abort the job test("SPARK-22148 abort timer should clear unschedulableTaskSetToExpiryTime for all TaskSets") { - taskScheduler = setupSchedulerWithMockTaskSetBlacklist() + taskScheduler = setupSchedulerWithMockTaskSetExcludelist() - // We have 2 taskSets with 1 task remaining in each with 1 executor completely blacklisted + // We have 2 taskSets with 1 task remaining in each with 1 executor completely excluded val taskSet1 = FakeTask.createTaskSet(numTasks = 1, stageId = 0, stageAttemptId = 0) taskScheduler.submitTasks(taskSet1) val taskSet2 = FakeTask.createTaskSet(numTasks = 1, stageId = 1, stageAttemptId = 0) @@ -925,7 +953,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B // Fail the running task val failedTask = firstTaskAttempts.head failTask(failedTask.taskId, TaskState.FAILED, UnknownReason, tsm) - when(tsm.taskSetBlacklistHelperOpt.get.isExecutorBlacklistedForTask( + when(tsm.taskSetExcludelistHelperOpt.get.isExecutorExcludedForTask( "executor0", failedTask.index)).thenReturn(true) // make an offer. We will schedule the task from the second taskSet. Since a task was scheduled @@ -939,10 +967,10 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B val tsm2 = stageToMockTaskSetManager(1) val failedTask2 = secondTaskAttempts.head failTask(failedTask2.taskId, TaskState.FAILED, UnknownReason, tsm2) - when(tsm2.taskSetBlacklistHelperOpt.get.isExecutorBlacklistedForTask( + when(tsm2.taskSetExcludelistHelperOpt.get.isExecutorExcludedForTask( "executor0", failedTask2.index)).thenReturn(true) - // make an offer on the blacklisted executor. We won't schedule anything, and set the abort + // make an offer on the excluded executor. We won't schedule anything, and set the abort // timer for taskSet1 and taskSet2 assert(taskScheduler.resourceOffers(IndexedSeq( WorkerOffer("executor0", "host0", 1) @@ -964,9 +992,9 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B // this test is to check that we don't abort a taskSet which is not being scheduled on other // executors as it is waiting on locality timeout and not being aborted because it is still not - // completely blacklisted. - test("SPARK-22148 Ensure we don't abort the taskSet if we haven't been completely blacklisted") { - taskScheduler = setupSchedulerWithMockTaskSetBlacklist( + // completely excluded. + test("SPARK-22148 Ensure we don't abort the taskSet if we haven't been completely excluded") { + taskScheduler = setupSchedulerWithMockTaskSetExcludelist( config.UNSCHEDULABLE_TASKSET_TIMEOUT.key -> "0", // This is to avoid any potential flakiness in the test because of large pauses in jenkins config.LOCALITY_WAIT.key -> "30s" @@ -980,14 +1008,14 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B val tsm = stageToMockTaskSetManager(0) // submit an offer with one executor - var taskAttempts = taskScheduler.resourceOffers(IndexedSeq( + val taskAttempts = taskScheduler.resourceOffers(IndexedSeq( WorkerOffer("executor0", "host0", 1) )).flatten // Fail the running task val failedTask = taskAttempts.head failTask(failedTask.taskId, TaskState.FAILED, UnknownReason, tsm) - when(tsm.taskSetBlacklistHelperOpt.get.isExecutorBlacklistedForTask( + when(tsm.taskSetExcludelistHelperOpt.get.isExecutorExcludedForTask( "executor0", failedTask.index)).thenReturn(true) // make an offer but we won't schedule anything yet as scheduler locality is still PROCESS_LOCAL @@ -1000,32 +1028,68 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B assert(!tsm.isZombie) } + test("SPARK-31418 abort timer should kick in when task is completely excluded &" + + "allocation manager could not acquire a new executor before the timeout") { + // set the abort timer to fail immediately + taskScheduler = setupSchedulerWithMockTaskSetExcludelist( + config.UNSCHEDULABLE_TASKSET_TIMEOUT.key -> "0", + config.DYN_ALLOCATION_ENABLED.key -> "true") + + // We have 2 tasks remaining with 1 executor + val taskSet = FakeTask.createTaskSet(numTasks = 2) + taskScheduler.submitTasks(taskSet) + val tsm = stageToMockTaskSetManager(0) + + // submit an offer with one executor + taskScheduler.resourceOffers(IndexedSeq(WorkerOffer("executor0", "host0", 2))).flatten + + // Fail the running task + failTask(0, TaskState.FAILED, UnknownReason, tsm) + when(tsm.taskSetExcludelistHelperOpt.get.isExecutorExcludedForTask( + "executor0", 0)).thenReturn(true) + + // If the executor is busy, then dynamic allocation should kick in and try + // to acquire additional executors to schedule the excluded task + assert(taskScheduler.isExecutorBusy("executor0")) + + // make an offer on the excluded executor. We won't schedule anything, and set the abort + // timer to kick in immediately + assert(taskScheduler.resourceOffers(IndexedSeq( + WorkerOffer("executor0", "host0", 1) + )).flatten.size === 0) + // Wait for the abort timer to kick in. Even though we configure the timeout to be 0, there is a + // slight delay as the abort timer is launched in a separate thread. + eventually(timeout(500.milliseconds)) { + assert(tsm.isZombie) + } + } + /** - * Helper for performance tests. Takes the explicitly blacklisted nodes and executors; verifies - * that the blacklists are used efficiently to ensure scheduling is not O(numPendingTasks). + * Helper for performance tests. Takes the explicitly excluded nodes and executors; verifies + * that the excluded are used efficiently to ensure scheduling is not O(numPendingTasks). * Creates 1 offer on executor[1-3]. Executor1 & 2 are on host1, executor3 is on host2. Passed * in nodes and executors should be on that list. */ - private def testBlacklistPerformance( + private def testExcludelistPerformance( testName: String, - nodeBlacklist: Seq[String], - execBlacklist: Seq[String]): Unit = { + nodeExcludelist: Seq[String], + execExcludelist: Seq[String]): Unit = { // Because scheduling involves shuffling the order of offers around, we run this test a few // times to cover more possibilities. There are only 3 offers, which means 6 permutations, // so 10 iterations is pretty good. (0 until 10).foreach { testItr => test(s"$testName: iteration $testItr") { - // When an executor or node is blacklisted, we want to make sure that we don't try - // scheduling each pending task, one by one, to discover they are all blacklisted. This is + // When an executor or node is excluded, we want to make sure that we don't try + // scheduling each pending task, one by one, to discover they are all excluded. This is // important for performance -- if we did check each task one-by-one, then responding to a // resource offer (which is usually O(1)-ish) would become O(numPendingTasks), which would // slow down scheduler throughput and slow down scheduling even on healthy executors. // Here, we check a proxy for the runtime -- we make sure the scheduling is short-circuited - // at the node or executor blacklist, so we never check the per-task blacklist. We also - // make sure we don't check the node & executor blacklist for the entire taskset + // at the node or executor excludelist, so we never check the per-task excludelist. We also + // make sure we don't check the node & executor excludelist for the entire taskset // O(numPendingTasks) times. - taskScheduler = setupSchedulerWithMockTaskSetBlacklist() + taskScheduler = setupSchedulerWithMockTaskSetExcludelist() // we schedule 500 tasks so we can clearly distinguish anything that is O(numPendingTasks) val taskSet = FakeTask.createTaskSet(numTasks = 500, stageId = 0, stageAttemptId = 0) taskScheduler.submitTasks(taskSet) @@ -1035,91 +1099,92 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B new WorkerOffer("executor2", "host1", 1), new WorkerOffer("executor3", "host2", 1) ) - // We should check the node & exec blacklists, but only O(numOffers), not O(numPendingTasks) - // times. In the worst case, after shuffling, we offer our blacklisted resource first, and - // then offer other resources which do get used. The taskset blacklist is consulted - // repeatedly as we offer resources to the taskset -- each iteration either schedules - // something, or it terminates that locality level, so the maximum number of checks is - // numCores + numLocalityLevels + // We should check the node & exec excludelists, but only O(numOffers), + // not O(numPendingTasks) times. In the worst case, after shuffling, + // we offer our excluded resource first, and then offer other resources + // which do get used. The taskset excludelist is consulted repeatedly + // as we offer resources to the taskset -- each iteration either schedules + // something, or it terminates that locality level, so the maximum number of + // checks is numCores + numLocalityLevels val numCoresOnAllOffers = offers.map(_.cores).sum val numLocalityLevels = TaskLocality.values.size - val maxBlacklistChecks = numCoresOnAllOffers + numLocalityLevels + val maxExcludelistChecks = numCoresOnAllOffers + numLocalityLevels - // Setup the blacklist - nodeBlacklist.foreach { node => - when(stageToMockTaskSetBlacklist(0).isNodeBlacklistedForTaskSet(node)).thenReturn(true) + // Setup the excludelist + nodeExcludelist.foreach { node => + when(stageToMockTaskSetExcludelist(0).isNodeExcludedForTaskSet(node)).thenReturn(true) } - execBlacklist.foreach { exec => - when(stageToMockTaskSetBlacklist(0).isExecutorBlacklistedForTaskSet(exec)) + execExcludelist.foreach { exec => + when(stageToMockTaskSetExcludelist(0).isExecutorExcludedForTaskSet(exec)) .thenReturn(true) } - // Figure out which nodes have any effective blacklisting on them. This means all nodes - // that are explicitly blacklisted, plus those that have *any* executors blacklisted. - val nodesForBlacklistedExecutors = offers.filter { offer => - execBlacklist.contains(offer.executorId) + // Figure out which nodes have any effective exclusions on them. This means all nodes + // that are explicitly excluded, plus those that have *any* executors excluded. + val nodesForExcludedExecutors = offers.filter { offer => + execExcludelist.contains(offer.executorId) }.map(_.host).distinct - val nodesWithAnyBlacklisting = (nodeBlacklist ++ nodesForBlacklistedExecutors).toSet - // Similarly, figure out which executors have any blacklisting. This means all executors - // that are explicitly blacklisted, plus all executors on nodes that are blacklisted. - val execsForBlacklistedNodes = offers.filter { offer => - nodeBlacklist.contains(offer.host) + val nodesWithAnyExclusions = (nodeExcludelist ++ nodesForExcludedExecutors).toSet + // Similarly, figure out which executors have any exclusions. This means all executors + // that are explicitly excluded, plus all executors on nodes that are excluded. + val execsForExcludedNodes = offers.filter { offer => + nodeExcludelist.contains(offer.host) }.map(_.executorId).toSeq - val executorsWithAnyBlacklisting = (execBlacklist ++ execsForBlacklistedNodes).toSet + val executorsWithAnyExclusions = (execExcludelist ++ execsForExcludedNodes).toSet // Schedule a taskset, and make sure our test setup is correct -- we are able to schedule - // a task on all executors that aren't blacklisted (whether that executor is a explicitly - // blacklisted, or implicitly blacklisted via the node blacklist). + // a task on all executors that aren't excluded (whether that executor is a explicitly + // excluded, or implicitly excluded via the node excludeOnFailures). val firstTaskAttempts = taskScheduler.resourceOffers(offers).flatten - assert(firstTaskAttempts.size === offers.size - executorsWithAnyBlacklisting.size) + assert(firstTaskAttempts.size === offers.size - executorsWithAnyExclusions.size) - // Now check that we haven't made too many calls to any of the blacklist methods. - // We should be checking our node blacklist, but it should be within the bound we defined + // Now check that we haven't made too many calls to any of the excludelist methods. + // We should be checking our node excludelist, but it should be within the bound we defined // above. - verify(stageToMockTaskSetBlacklist(0), atMost(maxBlacklistChecks)) - .isNodeBlacklistedForTaskSet(anyString()) - // We shouldn't ever consult the per-task blacklist for the nodes that have been blacklisted - // for the entire taskset, since the taskset level blacklisting should prevent scheduling + verify(stageToMockTaskSetExcludelist(0), atMost(maxExcludelistChecks)) + .isNodeExcludedForTaskSet(anyString()) + // We shouldn't ever consult the per-task excludelist for the nodes that have been excluded + // for the entire taskset, since the taskset level exclusions should prevent scheduling // from ever looking at specific tasks. - nodesWithAnyBlacklisting.foreach { node => - verify(stageToMockTaskSetBlacklist(0), never) - .isNodeBlacklistedForTask(meq(node), anyInt()) + nodesWithAnyExclusions.foreach { node => + verify(stageToMockTaskSetExcludelist(0), never) + .isNodeExcludedForTask(meq(node), anyInt()) } - executorsWithAnyBlacklisting.foreach { exec => - // We should be checking our executor blacklist, but it should be within the bound defined - // above. Its possible that this will be significantly fewer calls, maybe even 0, if - // there is also a node-blacklist which takes effect first. But this assert is all we - // need to avoid an O(numPendingTask) slowdown. - verify(stageToMockTaskSetBlacklist(0), atMost(maxBlacklistChecks)) - .isExecutorBlacklistedForTaskSet(exec) - // We shouldn't ever consult the per-task blacklist for executors that have been - // blacklisted for the entire taskset, since the taskset level blacklisting should prevent + executorsWithAnyExclusions.foreach { exec => + // We should be checking our executor excludelist, but it should be within the bound + // defined above. Its possible that this will be significantly fewer calls, maybe even + // 0, if there is also a node-excludelist which takes effect first. But this assert is + // all we need to avoid an O(numPendingTask) slowdown. + verify(stageToMockTaskSetExcludelist(0), atMost(maxExcludelistChecks)) + .isExecutorExcludedForTaskSet(exec) + // We shouldn't ever consult the per-task excludelist for executors that have been + // excluded for the entire taskset, since the taskset level exclusions should prevent // scheduling from ever looking at specific tasks. - verify(stageToMockTaskSetBlacklist(0), never) - .isExecutorBlacklistedForTask(meq(exec), anyInt()) + verify(stageToMockTaskSetExcludelist(0), never) + .isExecutorExcludedForTask(meq(exec), anyInt()) } } } } - testBlacklistPerformance( - testName = "Blacklisted node for entire task set prevents per-task blacklist checks", - nodeBlacklist = Seq("host1"), - execBlacklist = Seq()) + testExcludelistPerformance( + testName = "Excluded node for entire task set prevents per-task exclusion checks", + nodeExcludelist = Seq("host1"), + execExcludelist = Seq()) - testBlacklistPerformance( - testName = "Blacklisted executor for entire task set prevents per-task blacklist checks", - nodeBlacklist = Seq(), - execBlacklist = Seq("executor3") + testExcludelistPerformance( + testName = "Excluded executor for entire task set prevents per-task exclusion checks", + nodeExcludelist = Seq(), + execExcludelist = Seq("executor3") ) test("abort stage if executor loss results in unschedulability from previously failed tasks") { - // Make sure we can detect when a taskset becomes unschedulable from a blacklisting. This + // Make sure we can detect when a taskset becomes unschedulable from excludeOnFailure. This // test explores a particular corner case -- you may have one task fail, but still be // schedulable on another executor. However, that executor may fail later on, leaving the // first task with no place to run. val taskScheduler = setupScheduler( - config.BLACKLIST_ENABLED.key -> "true" + config.EXCLUDE_ON_FAILURE_ENABLED.key -> "true" ) val taskSet = FakeTask.createTaskSet(2) @@ -1141,7 +1206,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B // Now we fail our second executor. The other task can still run on executor1, so make an offer // on that executor, and make sure that the other task (not the failed one) is assigned there. - taskScheduler.executorLost("executor1", SlaveLost("oops")) + taskScheduler.executorLost("executor1", ExecutorProcessLost("oops")) val nextTaskAttempts = taskScheduler.resourceOffers(IndexedSeq(new WorkerOffer("executor0", "host0", 1))).flatten // Note: Its OK if some future change makes this already realize the taskset has become @@ -1152,7 +1217,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B assert(nextTaskAttempts.head.index != failedTask.index) // Now we should definitely realize that our task set is unschedulable, because the only - // task left can't be scheduled on any executors due to the blacklist. + // task left can't be scheduled on any executors due to the excludelist. taskScheduler.resourceOffers(IndexedSeq(new WorkerOffer("executor0", "host0", 1))) sc.listenerBus.waitUntilEmpty(100000) assert(tsm.isZombie) @@ -1160,11 +1225,11 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B val idx = failedTask.index assert(failedTaskSetReason === s""" |Aborting $taskSet because task $idx (partition $idx) - |cannot run anywhere due to node and executor blacklist. + |cannot run anywhere due to node and executor excludeOnFailure. |Most recent failure: - |${tsm.taskSetBlacklistHelperOpt.get.getLatestFailureReason} + |${tsm.taskSetExcludelistHelperOpt.get.getLatestFailureReason} | - |Blacklisting behavior can be configured via spark.blacklist.*. + |ExcludeOnFailure behavior can be configured via spark.excludeOnFailure.*. |""".stripMargin) } @@ -1175,7 +1240,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B // available and not bail on the job val taskScheduler = setupScheduler( - config.BLACKLIST_ENABLED.key -> "true" + config.EXCLUDE_ON_FAILURE_ENABLED.key -> "true" ) val taskSet = FakeTask.createTaskSet(2, (0 until 2).map { _ => Seq(TaskLocation("host0")) }: _*) @@ -1208,7 +1273,6 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B test("SPARK-16106 locality levels updated if executor added to existing host") { val taskScheduler = setupScheduler() - taskScheduler.resourceOffers(IndexedSeq(new WorkerOffer("executor0", "host0", 1))) taskScheduler.submitTasks(FakeTask.createTaskSet(2, stageId = 0, stageAttemptId = 0, (0 until 2).map { _ => Seq(TaskLocation("host0", "executor2")) }: _* )) @@ -1244,7 +1308,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B assert(taskScheduler.getExecutorsAliveOnHost("host1") === Some(Set("executor1", "executor3"))) } - test("scheduler checks for executors that can be expired from blacklist") { + test("scheduler checks for executors that can be expired from excludeOnFailure") { taskScheduler = setupScheduler() taskScheduler.submitTasks(FakeTask.createTaskSet(1, stageId = 0, stageAttemptId = 0)) @@ -1252,7 +1316,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B new WorkerOffer("executor0", "host0", 1) )).flatten - verify(blacklist).applyBlacklistTimeout() + verify(healthTracker).applyExcludeOnFailureTimeout() } test("if an executor is lost then the state for its running tasks is cleaned up (SPARK-18553)") { @@ -1274,7 +1338,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B assert(1 === taskDescriptions.length) // mark executor0 as dead - taskScheduler.executorLost("executor0", SlaveLost()) + taskScheduler.executorLost("executor0", ExecutorProcessLost()) assert(!taskScheduler.isExecutorAlive("executor0")) assert(!taskScheduler.hasExecutorsAliveOnHost("host0")) assert(taskScheduler.getExecutorsAliveOnHost("host0").isEmpty) @@ -1338,7 +1402,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B offers } override def createTaskSetManager(taskSet: TaskSet, maxTaskFailures: Int): TaskSetManager = { - new TaskSetManager(this, taskSet, maxTaskFailures, blacklistTrackerOpt, clock) + new TaskSetManager(this, taskSet, maxTaskFailures, healthTrackerOpt, clock) } } // Need to initialize a DAGScheduler for the taskScheduler to use for callbacks. @@ -1378,7 +1442,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B val clock = new ManualClock() val taskScheduler = new TaskSchedulerImpl(sc) { override def createTaskSetManager(taskSet: TaskSet, maxTaskFailures: Int): TaskSetManager = { - new TaskSetManager(this, taskSet, maxTaskFailures, blacklistTrackerOpt, clock) + new TaskSetManager(this, taskSet, maxTaskFailures, healthTrackerOpt, clock) } } // Need to initialize a DAGScheduler for the taskScheduler to use for callbacks. @@ -1700,7 +1764,7 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B taskScheduler.submitTasks(taskSet) // Launch tasks on executor that satisfies resource requirements. - var taskDescriptions = taskScheduler.resourceOffers(singleCoreWorkerOffers).flatten + val taskDescriptions = taskScheduler.resourceOffers(singleCoreWorkerOffers).flatten assert(3 === taskDescriptions.length) assert(!failedTaskSet) assert(ArrayBuffer("0") === taskDescriptions(0).resources.get(GPU).get.addresses) @@ -1767,6 +1831,170 @@ class TaskSchedulerImplSuite extends SparkFunSuite with LocalSparkContext with B assert(2 == taskDescriptions.head.resources(GPU).addresses.size) } + private def setupSchedulerForDecommissionTests(clock: Clock, numTasks: Int): TaskSchedulerImpl = { + // one task per host + val numHosts = numTasks + val conf = new SparkConf() + .setMaster(s"local[$numHosts]") + .setAppName("TaskSchedulerImplSuite") + .set(config.CPUS_PER_TASK.key, "1") + sc = new SparkContext(conf) + val maxTaskFailures = sc.conf.get(config.TASK_MAX_FAILURES) + taskScheduler = new TaskSchedulerImpl(sc, maxTaskFailures, clock = clock) { + override def createTaskSetManager(taskSet: TaskSet, maxFailures: Int): TaskSetManager = { + val tsm = super.createTaskSetManager(taskSet, maxFailures) + // we need to create a spied tsm so that we can see the copies running + val tsmSpy = spy(tsm) + stageToMockTaskSetManager(taskSet.stageId) = tsmSpy + tsmSpy + } + } + setupHelper() + // Spawn the tasks on different executors/hosts + taskScheduler.submitTasks(FakeTask.createTaskSet(numTasks)) + for (i <- 0 until numTasks) { + val executorId = s"executor$i" + val taskDescriptions = taskScheduler.resourceOffers(IndexedSeq(WorkerOffer( + executorId, s"host$i", 1))).flatten + assert(taskDescriptions.size === 1) + assert(taskDescriptions(0).executorId == executorId) + assert(taskDescriptions(0).index === i) + } + taskScheduler + } + + test("scheduler should keep the decommission state where host was decommissioned") { + val clock = new ManualClock(10000L) + val scheduler = setupSchedulerForDecommissionTests(clock, 2) + val decomTime = clock.getTimeMillis() + scheduler.executorDecommission("executor0", ExecutorDecommissionInfo("0", None)) + scheduler.executorDecommission("executor1", ExecutorDecommissionInfo("1", Some("host1"))) + + assert(scheduler.getExecutorDecommissionState("executor0") + === Some(ExecutorDecommissionState(decomTime, None))) + assert(scheduler.getExecutorDecommissionState("executor1") + === Some(ExecutorDecommissionState(decomTime, Some("host1")))) + assert(scheduler.getExecutorDecommissionState("executor2").isEmpty) + } + + test("test full decommissioning flow") { + val clock = new ManualClock(10000L) + val scheduler = setupSchedulerForDecommissionTests(clock, 2) + val manager = stageToMockTaskSetManager(0) + // The task started should be running. + assert(manager.copiesRunning.take(2) === Array(1, 1)) + + // executor 0 is decommissioned after loosing + assert(scheduler.getExecutorDecommissionState("executor0").isEmpty) + scheduler.executorLost("executor0", ExecutorExited(0, false, "normal")) + assert(scheduler.getExecutorDecommissionState("executor0").isEmpty) + scheduler.executorDecommission("executor0", ExecutorDecommissionInfo("", None)) + assert(scheduler.getExecutorDecommissionState("executor0").isEmpty) + + // 0th task just died above + assert(manager.copiesRunning.take(2) === Array(0, 1)) + + assert(scheduler.executorsPendingDecommission.isEmpty) + clock.advance(5000) + + // executor1 hasn't been decommissioned yet + assert(scheduler.getExecutorDecommissionState("executor1").isEmpty) + + // executor 1 is decommissioned before loosing + scheduler.executorDecommission("executor1", ExecutorDecommissionInfo("", None)) + assert(scheduler.getExecutorDecommissionState("executor1").isDefined) + clock.advance(2000) + + // executor1 is eventually lost + scheduler.executorLost("executor1", ExecutorExited(0, false, "normal")) + assert(scheduler.executorsPendingDecommission.isEmpty) + // So now both the tasks are no longer running + assert(manager.copiesRunning.take(2) === Array(0, 0)) + clock.advance(2000) + + // Now give it some resources and both tasks should be rerun + val taskDescriptions = taskScheduler.resourceOffers(IndexedSeq( + WorkerOffer("executor2", "host2", 1), WorkerOffer("executor3", "host3", 1))).flatten + assert(taskDescriptions.size === 2) + assert(taskDescriptions.map(_.index).sorted == Seq(0, 1)) + assert(manager.copiesRunning.take(2) === Array(1, 1)) + } + + test("SPARK-24818: test delay scheduling for barrier TaskSetManager") { + val clock = new ManualClock() + val conf = new SparkConf().set(config.LEGACY_LOCALITY_WAIT_RESET, false) + val sched = setupTaskSchedulerForLocalityTests(clock, conf) + + // Call resourceOffers() first, so executor-0 can be used + // to calculate the locality levels of the TaskSetManager later + sched.resourceOffers(Seq(WorkerOffer("executor-0", "host1", 1, Some("host1"))).toIndexedSeq) + + val prefLocs = Seq(TaskLocation("host1", "executor-0")) + val barrierTaskSet = FakeTask.createBarrierTaskSet(1, prefLocs) + sched.submitTasks(barrierTaskSet) + + val tsm = sched.taskSetManagerForAttempt(0, 0).get + assert(tsm.myLocalityLevels === + Array(TaskLocality.PROCESS_LOCAL, TaskLocality.NODE_LOCAL, TaskLocality.ANY)) + val offers = Seq(WorkerOffer("executor-1", "host1", 1, Some("host1"))).toIndexedSeq + var tasks = sched.resourceOffers(offers).flatten + // The TaskSetManager prefers executor-0 for the PROCESS_LOCAL location but there's no + // available offer of executor-0 in this round, so task scheduling will be delayed first. + assert(tasks.length === 0) + // Advance the clock so the TaskSetManager can move to next locality level(NODE_LOCAL) + clock.advance(4000) + tasks = sched.resourceOffers(offers).flatten + assert(tasks.length === 1) + assert(tsm.taskInfos(tasks.head.taskId).taskLocality === TaskLocality.NODE_LOCAL) + } + + test("SPARK-24818: test resource revert of barrier TaskSetManager") { + val clock = new ManualClock() + val conf = new SparkConf().set(config.LEGACY_LOCALITY_WAIT_RESET, false) + val sched = setupTaskSchedulerForLocalityTests(clock, conf) + + // Call resourceOffers() first, so executors can be used + // to calculate the locality levels of the TaskSetManager later + sched.resourceOffers(Seq(WorkerOffer("executor-0", "host1", 1, Some("host1"))).toIndexedSeq) + + val barrierTaskSet = + FakeTask.createBarrierTaskSet(2, 0, 0, 0, 0, + Seq(TaskLocation("host1", "executor-0")), Seq(TaskLocation("host1", "executor-1"))) + val normalTaskSet = FakeTask.createTaskSet(2, 1, 0, 0, 0) + + // Submit barrier task set first, so we can schedule it before the normal task set in order to + // test the resource revert behaviour of the barrier TaskSetManager + sched.submitTasks(barrierTaskSet) + sched.submitTasks(normalTaskSet) + + val barrierTSM = sched.taskSetManagerForAttempt(0, 0).get + val normalTSM = sched.taskSetManagerForAttempt(1, 0).get + assert(barrierTSM.myLocalityLevels === + Array(TaskLocality.PROCESS_LOCAL, TaskLocality.NODE_LOCAL, TaskLocality.ANY)) + assert(normalTSM.myLocalityLevels === Array(TaskLocality.NO_PREF, TaskLocality.ANY)) + + // The barrier TaskSetManager can not launch all tasks because of delay scheduling. + // So it will revert assigned resources and let the normal TaskSetManager to schedule first. + var tasks = sched.resourceOffers( + Seq(WorkerOffer("executor-0", "host1", 1, Some("host1")), + WorkerOffer("executor-2", "host1", 1, Some("host1"))).toIndexedSeq).flatten + assert(tasks.length === 2) + var taskId = tasks.head.taskId + assert(!barrierTSM.runningTasksSet.contains(taskId)) + assert(normalTSM.runningTasksSet.contains(taskId)) + + // Advance the clock so the TaskSetManager can move to next locality level(NODE_LOCAL) + // and launch all tasks. + clock.advance(4000) + tasks = sched.resourceOffers( + Seq(WorkerOffer("executor-0", "host1", 1, Some("host1")), + WorkerOffer("executor-2", "host1", 1, Some("host1"))).toIndexedSeq).flatten + assert(tasks.length === 2) + taskId = tasks.head.taskId + assert(barrierTSM.runningTasksSet.contains(taskId)) + assert(!normalTSM.runningTasksSet.contains(taskId)) + } + /** * Used by tests to simulate a task failure. This calls the failure handler explicitly, to ensure * that all the state is updated when this method returns. Otherwise, there's no way to know when diff --git a/core/src/test/scala/org/apache/spark/scheduler/TaskSetBlacklistSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/TaskSetBlacklistSuite.scala deleted file mode 100644 index ed97a4c206ca3..0000000000000 --- a/core/src/test/scala/org/apache/spark/scheduler/TaskSetBlacklistSuite.scala +++ /dev/null @@ -1,287 +0,0 @@ -/* - * 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. - */ -package org.apache.spark.scheduler - -import org.mockito.ArgumentMatchers.isA -import org.mockito.Mockito.{never, verify} -import org.scalatest.BeforeAndAfterEach -import org.scalatestplus.mockito.MockitoSugar - -import org.apache.spark.{SparkConf, SparkFunSuite} -import org.apache.spark.internal.config -import org.apache.spark.util.ManualClock - -class TaskSetBlacklistSuite extends SparkFunSuite with BeforeAndAfterEach with MockitoSugar { - - private var listenerBusMock: LiveListenerBus = _ - - override def beforeEach(): Unit = { - listenerBusMock = mock[LiveListenerBus] - super.beforeEach() - } - - test("Blacklisting tasks, executors, and nodes") { - val conf = new SparkConf().setAppName("test").setMaster("local") - .set(config.BLACKLIST_ENABLED.key, "true") - val clock = new ManualClock - val attemptId = 0 - val taskSetBlacklist = new TaskSetBlacklist( - listenerBusMock, conf, stageId = 0, stageAttemptId = attemptId, clock = clock) - - clock.setTime(0) - // We will mark task 0 & 1 failed on both executor 1 & 2. - // We should blacklist all executors on that host, for all tasks for the stage. Note the API - // will return false for isExecutorBacklistedForTaskSet even when the node is blacklisted, so - // the executor is implicitly blacklisted (this makes sense with how the scheduler uses the - // blacklist) - - // First, mark task 0 as failed on exec1. - // task 0 should be blacklisted on exec1, and nowhere else - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "exec1", index = 0, failureReason = "testing") - for { - executor <- (1 to 4).map(_.toString) - index <- 0 until 10 - } { - val shouldBeBlacklisted = (executor == "exec1" && index == 0) - assert(taskSetBlacklist.isExecutorBlacklistedForTask(executor, index) === shouldBeBlacklisted) - } - - assert(!taskSetBlacklist.isExecutorBlacklistedForTaskSet("exec1")) - verify(listenerBusMock, never()) - .post(isA(classOf[SparkListenerExecutorBlacklistedForStage])) - - assert(!taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA")) - verify(listenerBusMock, never()) - .post(isA(classOf[SparkListenerNodeBlacklistedForStage])) - - // Mark task 1 failed on exec1 -- this pushes the executor into the blacklist - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "exec1", index = 1, failureReason = "testing") - - assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet("exec1")) - verify(listenerBusMock).post( - SparkListenerExecutorBlacklistedForStage(0, "exec1", 2, 0, attemptId)) - - assert(!taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA")) - verify(listenerBusMock, never()) - .post(isA(classOf[SparkListenerNodeBlacklistedForStage])) - - // Mark one task as failed on exec2 -- not enough for any further blacklisting yet. - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "exec2", index = 0, failureReason = "testing") - assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet("exec1")) - - assert(!taskSetBlacklist.isExecutorBlacklistedForTaskSet("exec2")) - - assert(!taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA")) - verify(listenerBusMock, never()) - .post(isA(classOf[SparkListenerNodeBlacklistedForStage])) - - // Mark another task as failed on exec2 -- now we blacklist exec2, which also leads to - // blacklisting the entire node. - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "exec2", index = 1, failureReason = "testing") - - assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet("exec1")) - - assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet("exec2")) - verify(listenerBusMock).post( - SparkListenerExecutorBlacklistedForStage(0, "exec2", 2, 0, attemptId)) - - assert(taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA")) - verify(listenerBusMock).post( - SparkListenerNodeBlacklistedForStage(0, "hostA", 2, 0, attemptId)) - - // Make sure the blacklist has the correct per-task && per-executor responses, over a wider - // range of inputs. - for { - executor <- (1 to 4).map(e => s"exec$e") - index <- 0 until 10 - } { - withClue(s"exec = $executor; index = $index") { - val badExec = (executor == "exec1" || executor == "exec2") - val badIndex = (index == 0 || index == 1) - assert( - // this ignores whether the executor is blacklisted entirely for the taskset -- that is - // intentional, it keeps it fast and is sufficient for usage in the scheduler. - taskSetBlacklist.isExecutorBlacklistedForTask(executor, index) === (badExec && badIndex)) - assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet(executor) === badExec) - if (badExec) { - verify(listenerBusMock).post( - SparkListenerExecutorBlacklistedForStage(0, executor, 2, 0, attemptId)) - } - } - } - assert(taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA")) - val execToFailures = taskSetBlacklist.execToFailures - assert(execToFailures.keySet === Set("exec1", "exec2")) - - Seq("exec1", "exec2").foreach { exec => - assert( - execToFailures(exec).taskToFailureCountAndFailureTime === Map( - 0 -> ((1, 0)), - 1 -> ((1, 0)) - ) - ) - } - } - - test("multiple attempts for the same task count once") { - // Make sure that for blacklisting tasks, the node counts task attempts, not executors. But for - // stage-level blacklisting, we count unique tasks. The reason for this difference is, with - // task-attempt blacklisting, we want to make it easy to configure so that you ensure a node - // is blacklisted before the taskset is completely aborted because of spark.task.maxFailures. - // But with stage-blacklisting, we want to make sure we're not just counting one bad task - // that has failed many times. - - val conf = new SparkConf().setMaster("local").setAppName("test") - .set(config.MAX_TASK_ATTEMPTS_PER_EXECUTOR, 2) - .set(config.MAX_TASK_ATTEMPTS_PER_NODE, 3) - .set(config.MAX_FAILURES_PER_EXEC_STAGE, 2) - .set(config.MAX_FAILED_EXEC_PER_NODE_STAGE, 3) - val clock = new ManualClock - - val attemptId = 0 - val taskSetBlacklist = new TaskSetBlacklist( - listenerBusMock, conf, stageId = 0, stageAttemptId = attemptId, clock = clock) - - var time = 0 - clock.setTime(time) - // Fail a task twice on hostA, exec:1 - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "1", index = 0, failureReason = "testing") - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "1", index = 0, failureReason = "testing") - assert(taskSetBlacklist.isExecutorBlacklistedForTask("1", 0)) - assert(!taskSetBlacklist.isNodeBlacklistedForTask("hostA", 0)) - - assert(!taskSetBlacklist.isExecutorBlacklistedForTaskSet("1")) - verify(listenerBusMock, never()).post( - SparkListenerExecutorBlacklistedForStage(time, "1", 2, 0, attemptId)) - - assert(!taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA")) - verify(listenerBusMock, never()).post( - SparkListenerNodeBlacklistedForStage(time, "hostA", 2, 0, attemptId)) - - // Fail the same task once more on hostA, exec:2 - time += 1 - clock.setTime(time) - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "2", index = 0, failureReason = "testing") - assert(taskSetBlacklist.isNodeBlacklistedForTask("hostA", 0)) - - assert(!taskSetBlacklist.isExecutorBlacklistedForTaskSet("2")) - verify(listenerBusMock, never()).post( - SparkListenerExecutorBlacklistedForStage(time, "2", 2, 0, attemptId)) - - assert(!taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA")) - verify(listenerBusMock, never()).post( - SparkListenerNodeBlacklistedForStage(time, "hostA", 2, 0, attemptId)) - - // Fail another task on hostA, exec:1. Now that executor has failures on two different tasks, - // so its blacklisted - time += 1 - clock.setTime(time) - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "1", index = 1, failureReason = "testing") - - assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet("1")) - verify(listenerBusMock) - .post(SparkListenerExecutorBlacklistedForStage(time, "1", 2, 0, attemptId)) - - assert(!taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA")) - verify(listenerBusMock, never()) - .post(isA(classOf[SparkListenerNodeBlacklistedForStage])) - - // Fail a third task on hostA, exec:2, so that exec is blacklisted for the whole task set - time += 1 - clock.setTime(time) - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "2", index = 2, failureReason = "testing") - - assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet("2")) - verify(listenerBusMock) - .post(SparkListenerExecutorBlacklistedForStage(time, "2", 2, 0, attemptId)) - - assert(!taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA")) - verify(listenerBusMock, never()) - .post(isA(classOf[SparkListenerNodeBlacklistedForStage])) - - // Fail a fourth & fifth task on hostA, exec:3. Now we've got three executors that are - // blacklisted for the taskset, so blacklist the whole node. - time += 1 - clock.setTime(time) - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "3", index = 3, failureReason = "testing") - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "3", index = 4, failureReason = "testing") - - assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet("3")) - verify(listenerBusMock) - .post(SparkListenerExecutorBlacklistedForStage(time, "3", 2, 0, attemptId)) - - assert(taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA")) - verify(listenerBusMock).post( - SparkListenerNodeBlacklistedForStage(time, "hostA", 3, 0, attemptId)) - } - - test("only blacklist nodes for the task set when all the blacklisted executors are all on " + - "same host") { - // we blacklist executors on two different hosts within one taskSet -- make sure that doesn't - // lead to any node blacklisting - val conf = new SparkConf().setAppName("test").setMaster("local") - .set(config.BLACKLIST_ENABLED.key, "true") - val clock = new ManualClock - - val attemptId = 0 - val taskSetBlacklist = new TaskSetBlacklist( - listenerBusMock, conf, stageId = 0, stageAttemptId = attemptId, clock = clock) - var time = 0 - clock.setTime(time) - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "1", index = 0, failureReason = "testing") - taskSetBlacklist.updateBlacklistForFailedTask( - "hostA", exec = "1", index = 1, failureReason = "testing") - - assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet("1")) - verify(listenerBusMock) - .post(SparkListenerExecutorBlacklistedForStage(time, "1", 2, 0, attemptId)) - - assert(!taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA")) - verify(listenerBusMock, never()).post( - SparkListenerNodeBlacklistedForStage(time, "hostA", 2, 0, attemptId)) - - time += 1 - clock.setTime(time) - taskSetBlacklist.updateBlacklistForFailedTask( - "hostB", exec = "2", index = 0, failureReason = "testing") - taskSetBlacklist.updateBlacklistForFailedTask( - "hostB", exec = "2", index = 1, failureReason = "testing") - assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet("1")) - - assert(taskSetBlacklist.isExecutorBlacklistedForTaskSet("2")) - verify(listenerBusMock) - .post(SparkListenerExecutorBlacklistedForStage(time, "2", 2, 0, attemptId)) - - assert(!taskSetBlacklist.isNodeBlacklistedForTaskSet("hostA")) - assert(!taskSetBlacklist.isNodeBlacklistedForTaskSet("hostB")) - verify(listenerBusMock, never()) - .post(isA(classOf[SparkListenerNodeBlacklistedForStage])) - } - -} diff --git a/core/src/test/scala/org/apache/spark/scheduler/TaskSetExcludelistSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/TaskSetExcludelistSuite.scala new file mode 100644 index 0000000000000..d20768d7cd12b --- /dev/null +++ b/core/src/test/scala/org/apache/spark/scheduler/TaskSetExcludelistSuite.scala @@ -0,0 +1,310 @@ +/* + * 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. + */ +package org.apache.spark.scheduler + +import org.mockito.ArgumentMatchers.isA +import org.mockito.Mockito.{never, verify} +import org.scalatest.BeforeAndAfterEach +import org.scalatestplus.mockito.MockitoSugar + +import org.apache.spark.{SparkConf, SparkFunSuite} +import org.apache.spark.internal.config +import org.apache.spark.util.ManualClock + +class TaskSetExcludelistSuite extends SparkFunSuite with BeforeAndAfterEach with MockitoSugar { + + private var listenerBusMock: LiveListenerBus = _ + + override def beforeEach(): Unit = { + listenerBusMock = mock[LiveListenerBus] + super.beforeEach() + } + + test("Excluding tasks, executors, and nodes") { + val conf = new SparkConf().setAppName("test").setMaster("local") + .set(config.EXCLUDE_ON_FAILURE_ENABLED.key, "true") + val clock = new ManualClock + val attemptId = 0 + val taskSetExcludelist = new TaskSetExcludelist( + listenerBusMock, conf, stageId = 0, stageAttemptId = attemptId, clock = clock) + + clock.setTime(0) + // We will mark task 0 & 1 failed on both executor 1 & 2. + // We should exclude all executors on that host, for all tasks for the stage. Note the API + // will return false for isExecutorBacklistedForTaskSet even when the node is excluded, so + // the executor is implicitly excluded (this makes sense with how the scheduler uses the + // exclude) + + // First, mark task 0 as failed on exec1. + // task 0 should be excluded on exec1, and nowhere else + taskSetExcludelist.updateExcludedForFailedTask( + "hostA", exec = "exec1", index = 0, failureReason = "testing") + for { + executor <- (1 to 4).map(_.toString) + index <- 0 until 10 + } { + val shouldBeExcluded = (executor == "exec1" && index == 0) + assert(taskSetExcludelist.isExecutorExcludedForTask(executor, index) === shouldBeExcluded) + } + + assert(!taskSetExcludelist.isExecutorExcludedForTaskSet("exec1")) + verify(listenerBusMock, never()) + .post(isA(classOf[SparkListenerExecutorExcludedForStage])) + verify(listenerBusMock, never()) + .post(isA(classOf[SparkListenerExecutorBlacklistedForStage])) + + assert(!taskSetExcludelist.isNodeExcludedForTaskSet("hostA")) + verify(listenerBusMock, never()) + .post(isA(classOf[SparkListenerNodeExcludedForStage])) + + // Mark task 1 failed on exec1 -- this pushes the executor into the exclude + taskSetExcludelist.updateExcludedForFailedTask( + "hostA", exec = "exec1", index = 1, failureReason = "testing") + + assert(taskSetExcludelist.isExecutorExcludedForTaskSet("exec1")) + verify(listenerBusMock).post( + SparkListenerExecutorExcludedForStage(0, "exec1", 2, 0, attemptId)) + verify(listenerBusMock).post( + SparkListenerExecutorBlacklistedForStage(0, "exec1", 2, 0, attemptId)) + + + assert(!taskSetExcludelist.isNodeExcludedForTaskSet("hostA")) + verify(listenerBusMock, never()) + .post(isA(classOf[SparkListenerNodeExcludedForStage])) + verify(listenerBusMock, never()) + .post(isA(classOf[SparkListenerNodeBlacklistedForStage])) + + // Mark one task as failed on exec2 -- not enough for any further excluding yet. + taskSetExcludelist.updateExcludedForFailedTask( + "hostA", exec = "exec2", index = 0, failureReason = "testing") + assert(taskSetExcludelist.isExecutorExcludedForTaskSet("exec1")) + + assert(!taskSetExcludelist.isExecutorExcludedForTaskSet("exec2")) + + assert(!taskSetExcludelist.isNodeExcludedForTaskSet("hostA")) + verify(listenerBusMock, never()) + .post(isA(classOf[SparkListenerNodeExcludedForStage])) + verify(listenerBusMock, never()) + .post(isA(classOf[SparkListenerNodeBlacklistedForStage])) + + // Mark another task as failed on exec2 -- now we exclude exec2, which also leads to + // excluding the entire node. + taskSetExcludelist.updateExcludedForFailedTask( + "hostA", exec = "exec2", index = 1, failureReason = "testing") + + assert(taskSetExcludelist.isExecutorExcludedForTaskSet("exec1")) + + assert(taskSetExcludelist.isExecutorExcludedForTaskSet("exec2")) + verify(listenerBusMock).post( + SparkListenerExecutorExcludedForStage(0, "exec2", 2, 0, attemptId)) + verify(listenerBusMock).post( + SparkListenerExecutorBlacklistedForStage(0, "exec2", 2, 0, attemptId)) + + assert(taskSetExcludelist.isNodeExcludedForTaskSet("hostA")) + verify(listenerBusMock).post( + SparkListenerNodeExcludedForStage(0, "hostA", 2, 0, attemptId)) + verify(listenerBusMock).post( + SparkListenerNodeBlacklistedForStage(0, "hostA", 2, 0, attemptId)) + + // Make sure the exclude has the correct per-task && per-executor responses, over a wider + // range of inputs. + for { + executor <- (1 to 4).map(e => s"exec$e") + index <- 0 until 10 + } { + withClue(s"exec = $executor; index = $index") { + val badExec = (executor == "exec1" || executor == "exec2") + val badIndex = (index == 0 || index == 1) + assert( + // this ignores whether the executor is excluded entirely for the taskset -- that is + // intentional, it keeps it fast and is sufficient for usage in the scheduler. + taskSetExcludelist.isExecutorExcludedForTask(executor, index) === (badExec && badIndex)) + assert(taskSetExcludelist.isExecutorExcludedForTaskSet(executor) === badExec) + if (badExec) { + verify(listenerBusMock).post( + SparkListenerExecutorExcludedForStage(0, executor, 2, 0, attemptId)) + verify(listenerBusMock).post( + SparkListenerExecutorBlacklistedForStage(0, executor, 2, 0, attemptId)) + } + } + } + assert(taskSetExcludelist.isNodeExcludedForTaskSet("hostA")) + val execToFailures = taskSetExcludelist.execToFailures + assert(execToFailures.keySet === Set("exec1", "exec2")) + + Seq("exec1", "exec2").foreach { exec => + assert( + execToFailures(exec).taskToFailureCountAndFailureTime === Map( + 0 -> ((1, 0)), + 1 -> ((1, 0)) + ) + ) + } + } + + test("multiple attempts for the same task count once") { + // Make sure that for excluding tasks, the node counts task attempts, not executors. But for + // stage-level excluding, we count unique tasks. The reason for this difference is, with + // task-attempt excluding, we want to make it easy to configure so that you ensure a node + // is excluded before the taskset is completely aborted because of spark.task.maxFailures. + // But with stage-excluding, we want to make sure we're not just counting one bad task + // that has failed many times. + + val conf = new SparkConf().setMaster("local").setAppName("test") + .set(config.MAX_TASK_ATTEMPTS_PER_EXECUTOR, 2) + .set(config.MAX_TASK_ATTEMPTS_PER_NODE, 3) + .set(config.MAX_FAILURES_PER_EXEC_STAGE, 2) + .set(config.MAX_FAILED_EXEC_PER_NODE_STAGE, 3) + val clock = new ManualClock + + val attemptId = 0 + val taskSetExcludlist = new TaskSetExcludelist( + listenerBusMock, conf, stageId = 0, stageAttemptId = attemptId, clock = clock) + + var time = 0 + clock.setTime(time) + // Fail a task twice on hostA, exec:1 + taskSetExcludlist.updateExcludedForFailedTask( + "hostA", exec = "1", index = 0, failureReason = "testing") + taskSetExcludlist.updateExcludedForFailedTask( + "hostA", exec = "1", index = 0, failureReason = "testing") + assert(taskSetExcludlist.isExecutorExcludedForTask("1", 0)) + assert(!taskSetExcludlist.isNodeExcludedForTask("hostA", 0)) + + assert(!taskSetExcludlist.isExecutorExcludedForTaskSet("1")) + verify(listenerBusMock, never()).post( + SparkListenerExecutorExcludedForStage(time, "1", 2, 0, attemptId)) + + assert(!taskSetExcludlist.isNodeExcludedForTaskSet("hostA")) + verify(listenerBusMock, never()).post( + SparkListenerNodeExcludedForStage(time, "hostA", 2, 0, attemptId)) + + // Fail the same task once more on hostA, exec:2 + time += 1 + clock.setTime(time) + taskSetExcludlist.updateExcludedForFailedTask( + "hostA", exec = "2", index = 0, failureReason = "testing") + assert(taskSetExcludlist.isNodeExcludedForTask("hostA", 0)) + + assert(!taskSetExcludlist.isExecutorExcludedForTaskSet("2")) + verify(listenerBusMock, never()).post( + SparkListenerExecutorExcludedForStage(time, "2", 2, 0, attemptId)) + + assert(!taskSetExcludlist.isNodeExcludedForTaskSet("hostA")) + verify(listenerBusMock, never()).post( + SparkListenerNodeExcludedForStage(time, "hostA", 2, 0, attemptId)) + + // Fail another task on hostA, exec:1. Now that executor has failures on two different tasks, + // so its excluded + time += 1 + clock.setTime(time) + taskSetExcludlist.updateExcludedForFailedTask( + "hostA", exec = "1", index = 1, failureReason = "testing") + + assert(taskSetExcludlist.isExecutorExcludedForTaskSet("1")) + verify(listenerBusMock) + .post(SparkListenerExecutorExcludedForStage(time, "1", 2, 0, attemptId)) + + assert(!taskSetExcludlist.isNodeExcludedForTaskSet("hostA")) + verify(listenerBusMock, never()) + .post(isA(classOf[SparkListenerNodeExcludedForStage])) + + // Fail a third task on hostA, exec:2, so that exec is excluded for the whole task set + time += 1 + clock.setTime(time) + taskSetExcludlist.updateExcludedForFailedTask( + "hostA", exec = "2", index = 2, failureReason = "testing") + + assert(taskSetExcludlist.isExecutorExcludedForTaskSet("2")) + verify(listenerBusMock) + .post(SparkListenerExecutorExcludedForStage(time, "2", 2, 0, attemptId)) + + assert(!taskSetExcludlist.isNodeExcludedForTaskSet("hostA")) + verify(listenerBusMock, never()) + .post(isA(classOf[SparkListenerNodeExcludedForStage])) + + // Fail a fourth & fifth task on hostA, exec:3. Now we've got three executors that are + // excluded for the taskset, so exclude the whole node. + time += 1 + clock.setTime(time) + taskSetExcludlist.updateExcludedForFailedTask( + "hostA", exec = "3", index = 3, failureReason = "testing") + taskSetExcludlist.updateExcludedForFailedTask( + "hostA", exec = "3", index = 4, failureReason = "testing") + + assert(taskSetExcludlist.isExecutorExcludedForTaskSet("3")) + verify(listenerBusMock) + .post(SparkListenerExecutorExcludedForStage(time, "3", 2, 0, attemptId)) + + assert(taskSetExcludlist.isNodeExcludedForTaskSet("hostA")) + verify(listenerBusMock).post( + SparkListenerNodeExcludedForStage(time, "hostA", 3, 0, attemptId)) + } + + test("only exclude nodes for the task set when all the excluded executors are all on " + + "same host") { + // we exclude executors on two different hosts within one taskSet -- make sure that doesn't + // lead to any node excluding + val conf = new SparkConf().setAppName("test").setMaster("local") + .set(config.EXCLUDE_ON_FAILURE_ENABLED.key, "true") + val clock = new ManualClock + + val attemptId = 0 + val taskSetExcludlist = new TaskSetExcludelist( + listenerBusMock, conf, stageId = 0, stageAttemptId = attemptId, clock = clock) + var time = 0 + clock.setTime(time) + taskSetExcludlist.updateExcludedForFailedTask( + "hostA", exec = "1", index = 0, failureReason = "testing") + taskSetExcludlist.updateExcludedForFailedTask( + "hostA", exec = "1", index = 1, failureReason = "testing") + + assert(taskSetExcludlist.isExecutorExcludedForTaskSet("1")) + verify(listenerBusMock) + .post(SparkListenerExecutorExcludedForStage(time, "1", 2, 0, attemptId)) + verify(listenerBusMock) + .post(SparkListenerExecutorBlacklistedForStage(time, "1", 2, 0, attemptId)) + + assert(!taskSetExcludlist.isNodeExcludedForTaskSet("hostA")) + verify(listenerBusMock, never()).post( + SparkListenerNodeExcludedForStage(time, "hostA", 2, 0, attemptId)) + verify(listenerBusMock, never()).post( + SparkListenerNodeBlacklistedForStage(time, "hostA", 2, 0, attemptId)) + + time += 1 + clock.setTime(time) + taskSetExcludlist.updateExcludedForFailedTask( + "hostB", exec = "2", index = 0, failureReason = "testing") + taskSetExcludlist.updateExcludedForFailedTask( + "hostB", exec = "2", index = 1, failureReason = "testing") + assert(taskSetExcludlist.isExecutorExcludedForTaskSet("1")) + + assert(taskSetExcludlist.isExecutorExcludedForTaskSet("2")) + verify(listenerBusMock) + .post(SparkListenerExecutorExcludedForStage(time, "2", 2, 0, attemptId)) + verify(listenerBusMock) + .post(SparkListenerExecutorBlacklistedForStage(time, "2", 2, 0, attemptId)) + + assert(!taskSetExcludlist.isNodeExcludedForTaskSet("hostA")) + assert(!taskSetExcludlist.isNodeExcludedForTaskSet("hostB")) + verify(listenerBusMock, never()) + .post(isA(classOf[SparkListenerNodeExcludedForStage])) + verify(listenerBusMock, never()) + .post(isA(classOf[SparkListenerNodeBlacklistedForStage])) + } + +} diff --git a/core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala index 4978be3e04c1e..3841425fa5ae2 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/TaskSetManagerSuite.scala @@ -31,7 +31,7 @@ import org.scalatest.Assertions._ import org.scalatest.PrivateMethodTester import org.scalatest.concurrent.Eventually -import org.apache.spark._ +import org.apache.spark.{FakeSchedulerBackend => _, _} import org.apache.spark.internal.Logging import org.apache.spark.internal.config import org.apache.spark.internal.config.Tests.SKIP_VALIDATE_CORES_TESTING @@ -41,7 +41,7 @@ import org.apache.spark.resource.TestResourceIDs._ import org.apache.spark.scheduler.cluster.CoarseGrainedSchedulerBackend import org.apache.spark.serializer.SerializerInstance import org.apache.spark.storage.BlockManagerId -import org.apache.spark.util.{AccumulatorV2, ManualClock} +import org.apache.spark.util.{AccumulatorV2, Clock, ManualClock, SystemClock} class FakeDAGScheduler(sc: SparkContext, taskScheduler: FakeTaskScheduler) extends DAGScheduler(sc) { @@ -109,8 +109,11 @@ object FakeRackUtil { * a list of "live" executors and their hostnames for isExecutorAlive and hasExecutorsAliveOnHost * to work, and these are required for locality in TaskSetManager. */ -class FakeTaskScheduler(sc: SparkContext, liveExecutors: (String, String)* /* execId, host */) - extends TaskSchedulerImpl(sc) +class FakeTaskScheduler( + sc: SparkContext, + clock: Clock, + liveExecutors: (String, String)* /* execId, host */) + extends TaskSchedulerImpl(sc, sc.conf.get(config.TASK_MAX_FAILURES), clock = clock) { val startedTasks = new ArrayBuffer[Long] val endedTasks = new mutable.HashMap[Long, TaskEndReason] @@ -120,6 +123,10 @@ class FakeTaskScheduler(sc: SparkContext, liveExecutors: (String, String)* /* ex val executors = new mutable.HashMap[String, String] + def this(sc: SparkContext, liveExecutors: (String, String)*) = { + this(sc, new SystemClock, liveExecutors: _*) + } + // this must be initialized before addExecutor override val defaultRackValue: Option[String] = Some("default") for ((execId, host) <- liveExecutors) { @@ -149,13 +156,12 @@ class FakeTaskScheduler(sc: SparkContext, liveExecutors: (String, String)* /* ex override def taskSetFinished(manager: TaskSetManager): Unit = finishedManagers += manager - override def isExecutorAlive(execId: String): Boolean = executors.contains(execId) + override def isExecutorAlive(execId: String): Boolean = + executors.contains(execId) && !isExecutorDecommissioned(execId) - override def hasExecutorsAliveOnHost(host: String): Boolean = executors.values.exists(_ == host) - - override def hasHostAliveOnRack(rack: String): Boolean = { - hostsByRack.get(rack) != None - } + override def hasExecutorsAliveOnHost(host: String): Boolean = + !isHostDecommissioned(host) && executors + .exists { case (e, h) => h == host && !isExecutorDecommissioned(e) } def addExecutor(execId: String, host: String): Unit = { executors.put(execId, host) @@ -371,25 +377,25 @@ class TaskSetManagerSuite // offers not accepted due to task set zombies are not delay schedule rejects manager.isZombie = true - val (taskDesciption, delayReject) = manager.resourceOffer("exec2", "host2", ANY) - assert(taskDesciption.isEmpty) + val (taskDescription, delayReject, _) = manager.resourceOffer("exec2", "host2", ANY) + assert(taskDescription.isEmpty) assert(delayReject === false) manager.isZombie = false - // offers not accepted due to blacklisting are not delay schedule rejects + // offers not accepted due to excludelist are not delay schedule rejects val tsmSpy = spy(manager) - val blacklist = mock(classOf[TaskSetBlacklist]) - when(tsmSpy.taskSetBlacklistHelperOpt).thenReturn(Some(blacklist)) - when(blacklist.isNodeBlacklistedForTaskSet(any())).thenReturn(true) - val (blacklistTask, blackListReject) = tsmSpy.resourceOffer("exec2", "host2", ANY) - assert(blacklistTask.isEmpty) - assert(blackListReject === false) + val excludelist = mock(classOf[TaskSetExcludelist]) + when(tsmSpy.taskSetExcludelistHelperOpt).thenReturn(Some(excludelist)) + when(excludelist.isNodeExcludedForTaskSet(any())).thenReturn(true) + val (task, taskReject, _) = tsmSpy.resourceOffer("exec2", "host2", ANY) + assert(task.isEmpty) + assert(taskReject === false) // After another delay, we can go ahead and launch that task non-locally assert(manager.resourceOffer("exec2", "host2", ANY)._1.get.index === 3) // offers not accepted due to no pending tasks are not delay schedule rejects - val (noPendingTask, noPendingReject) = manager.resourceOffer("exec2", "host2", ANY) + val (noPendingTask, noPendingReject, _) = manager.resourceOffer("exec2", "host2", ANY) assert(noPendingTask.isEmpty) assert(noPendingReject === false) } @@ -415,7 +421,7 @@ class TaskSetManagerSuite // Now mark host2 as dead sched.removeExecutor("exec2") - manager.executorLost("exec2", "host2", SlaveLost()) + manager.executorLost("exec2", "host2", ExecutorProcessLost()) // nothing should be chosen assert(manager.resourceOffer("exec1", "host1", ANY)._1 === None) @@ -473,11 +479,11 @@ class TaskSetManagerSuite } } - test("executors should be blacklisted after task failure, in spite of locality preferences") { + test("executors should be excluded after task failure, in spite of locality preferences") { val rescheduleDelay = 300L val conf = new SparkConf(). - set(config.BLACKLIST_ENABLED, true). - set(config.BLACKLIST_TIMEOUT_CONF, rescheduleDelay). + set(config.EXCLUDE_ON_FAILURE_ENABLED, true). + set(config.EXCLUDE_ON_FAILURE_TIMEOUT_CONF, rescheduleDelay). // don't wait to jump locality levels in this test set(config.LOCALITY_WAIT.key, "0") @@ -489,11 +495,11 @@ class TaskSetManagerSuite val taskSet = FakeTask.createTaskSet(1, Seq(TaskLocation("host1", "exec1"))) val clock = new ManualClock clock.advance(1) - // We don't directly use the application blacklist, but its presence triggers blacklisting + // We don't directly use the application excludelist, but its presence triggers exclusion // within the taskset. val mockListenerBus = mock(classOf[LiveListenerBus]) - val blacklistTrackerOpt = Some(new BlacklistTracker(mockListenerBus, conf, None, clock)) - val manager = new TaskSetManager(sched, taskSet, 4, blacklistTrackerOpt, clock) + val healthTrackerOpt = Some(new HealthTracker(mockListenerBus, conf, None, clock)) + val manager = new TaskSetManager(sched, taskSet, 4, healthTrackerOpt, clock) { val offerResult = manager.resourceOffer("exec1", "host1", PROCESS_LOCAL)._1 @@ -506,7 +512,7 @@ class TaskSetManagerSuite manager.handleFailedTask(offerResult.get.taskId, TaskState.FINISHED, TaskResultLost) assert(!sched.taskSetsFailed.contains(taskSet.id)) - // Ensure scheduling on exec1 fails after failure 1 due to blacklist + // Ensure scheduling on exec1 fails after failure 1 due to executor being excluded assert(manager.resourceOffer("exec1", "host1", PROCESS_LOCAL)._1.isEmpty) assert(manager.resourceOffer("exec1", "host1", NODE_LOCAL)._1.isEmpty) assert(manager.resourceOffer("exec1", "host1", RACK_LOCAL)._1.isEmpty) @@ -526,7 +532,7 @@ class TaskSetManagerSuite manager.handleFailedTask(offerResult.get.taskId, TaskState.FINISHED, TaskResultLost) assert(!sched.taskSetsFailed.contains(taskSet.id)) - // Ensure scheduling on exec1.1 fails after failure 2 due to blacklist + // Ensure scheduling on exec1.1 fails after failure 2 due to executor being excluded assert(manager.resourceOffer("exec1.1", "host1", NODE_LOCAL)._1.isEmpty) } @@ -542,12 +548,12 @@ class TaskSetManagerSuite manager.handleFailedTask(offerResult.get.taskId, TaskState.FINISHED, TaskResultLost) assert(!sched.taskSetsFailed.contains(taskSet.id)) - // Ensure scheduling on exec2 fails after failure 3 due to blacklist + // Ensure scheduling on exec2 fails after failure 3 due to executor being excluded assert(manager.resourceOffer("exec2", "host2", ANY)._1.isEmpty) } - // Despite advancing beyond the time for expiring executors from within the blacklist, - // we *never* expire from *within* the stage blacklist + // Despite advancing beyond the time for expiring executors from within the excludelist, + // we *never* expire from *within* the stage excludelist clock.advance(rescheduleDelay) { @@ -598,10 +604,10 @@ class TaskSetManagerSuite Array(PROCESS_LOCAL, NODE_LOCAL, NO_PREF, RACK_LOCAL, ANY))) // test if the valid locality is recomputed when the executor is lost sched.removeExecutor("execC") - manager.executorLost("execC", "host2", SlaveLost()) + manager.executorLost("execC", "host2", ExecutorProcessLost()) assert(manager.myLocalityLevels.sameElements(Array(NODE_LOCAL, NO_PREF, ANY))) sched.removeExecutor("execD") - manager.executorLost("execD", "host1", SlaveLost()) + manager.executorLost("execD", "host1", ExecutorProcessLost()) assert(manager.myLocalityLevels.sameElements(Array(NO_PREF, ANY))) } @@ -620,7 +626,7 @@ class TaskSetManagerSuite manager.executorAdded() sched.addExecutor("execC", "host2") manager.executorAdded() - assert(manager.resourceOffer("exec1", "host1", ANY)._1.isDefined) + assert(manager.resourceOffer("execB", "host1", ANY)._1.isDefined) sched.removeExecutor("execA") manager.executorLost( "execA", @@ -634,6 +640,78 @@ class TaskSetManagerSuite assert(sched.taskSetsFailed.contains(taskSet.id)) } + test("SPARK-31837: Shift to the new highest locality level if there is when recomputeLocality") { + sc = new SparkContext("local", "test") + sched = new FakeTaskScheduler(sc) + val taskSet = FakeTask.createTaskSet(2, + Seq(TaskLocation("host1", "execA")), + Seq(TaskLocation("host1", "execA"))) + val clock = new ManualClock() + val manager = new TaskSetManager(sched, taskSet, 1, clock = clock) + // before any executors are added to TaskScheduler, the manager's + // locality level only has ANY, so tasks can be scheduled anyway. + assert(manager.resourceOffer("execB", "host2", ANY)._1.isDefined) + sched.addExecutor("execA", "host1") + manager.executorAdded() + // after adding a new executor, the manager locality has PROCESS_LOCAL, NODE_LOCAL, ANY. + // And we'll shift to the new highest locality level, which is PROCESS_LOCAL in this case. + assert(manager.resourceOffer("execC", "host3", ANY)._1.isEmpty) + assert(manager.resourceOffer("execA", "host1", ANY)._1.isDefined) + } + + test("SPARK-32653: Decommissioned host should not be used to calculate locality levels") { + sc = new SparkContext("local", "test") + sched = new FakeTaskScheduler(sc) + val backend = mock(classOf[SchedulerBackend]) + doNothing().when(backend).reviveOffers() + sched.initialize(backend) + + val exec0 = "exec0" + val exec1 = "exec1" + val host0 = "host0" + sched.addExecutor(exec0, host0) + sched.addExecutor(exec1, host0) + + val taskSet = FakeTask.createTaskSet(2, + Seq(ExecutorCacheTaskLocation(host0, exec0)), + Seq(ExecutorCacheTaskLocation(host0, exec1))) + sched.submitTasks(taskSet) + val manager = sched.taskSetManagerForAttempt(0, 0).get + + assert(manager.myLocalityLevels === Array(PROCESS_LOCAL, NODE_LOCAL, ANY)) + + // Decommission all executors on host0, to mimic CoarseGrainedSchedulerBackend. + sched.executorDecommission(exec0, ExecutorDecommissionInfo("test", Some(host0))) + sched.executorDecommission(exec1, ExecutorDecommissionInfo("test", Some(host0))) + + assert(manager.myLocalityLevels === Array(ANY)) + } + + test("SPARK-32653: Decommissioned executor should not be used to calculate locality levels") { + sc = new SparkContext("local", "test") + sched = new FakeTaskScheduler(sc) + val backend = mock(classOf[SchedulerBackend]) + doNothing().when(backend).reviveOffers() + sched.initialize(backend) + + val exec0 = "exec0" + val exec1 = "exec1" + val host0 = "host0" + sched.addExecutor(exec0, host0) + sched.addExecutor(exec1, host0) + + val taskSet = FakeTask.createTaskSet(1, Seq(ExecutorCacheTaskLocation(host0, exec0))) + sched.submitTasks(taskSet) + val manager = sched.taskSetManagerForAttempt(0, 0).get + + assert(manager.myLocalityLevels === Array(PROCESS_LOCAL, NODE_LOCAL, ANY)) + + // Decommission the only executor (without the host) that the task is interested in running on. + sched.executorDecommission(exec0, ExecutorDecommissionInfo("test", None)) + + assert(manager.myLocalityLevels === Array(NODE_LOCAL, ANY)) + } + test("test RACK_LOCAL tasks") { // Assign host1 to rack1 FakeRackUtil.assignHostToRack("host1", "rack1") @@ -731,6 +809,14 @@ class TaskSetManagerSuite assert(thrown2.getMessage().contains("bigger than spark.driver.maxResultSize")) } + test("SPARK-32470: do not check total size of intermediate stages") { + val conf = new SparkConf().set(config.MAX_RESULT_SIZE.key, "20k") + sc = new SparkContext("local", "test", conf) + // final result is below limit. + val r = sc.makeRDD(0 until 2000, 2000).distinct(10).filter(_ == 0).collect() + assert(1 === r.size) + } + test("[SPARK-13931] taskSetManager should not send Resubmitted tasks after being a zombie") { val conf = new SparkConf().set(config.SPECULATION_ENABLED, true) sc = new SparkContext("local", "test", conf) @@ -795,7 +881,7 @@ class TaskSetManagerSuite assert(resubmittedTasks === 0) assert(manager.runningTasks === 1) - manager.executorLost("execB", "host2", new SlaveLost()) + manager.executorLost("execB", "host2", new ExecutorProcessLost()) assert(manager.runningTasks === 0) assert(resubmittedTasks === 0) } @@ -904,7 +990,7 @@ class TaskSetManagerSuite // Make sure schedBackend.killTask(2, "exec3", true, "another attempt succeeded") gets called assert(killTaskCalled) // Host 3 Losts, there's only task 2.0 on it, which killed by task 2.1 - manager.executorLost("exec3", "host3", SlaveLost()) + manager.executorLost("exec3", "host3", ExecutorProcessLost()) // Check the resubmittedTasks assert(resubmittedTasks === 0) } @@ -1025,8 +1111,8 @@ class TaskSetManagerSuite assert(manager.resourceOffer("execB.2", "host2", ANY) !== None) sched.removeExecutor("execA") sched.removeExecutor("execB.2") - manager.executorLost("execA", "host1", SlaveLost()) - manager.executorLost("execB.2", "host2", SlaveLost()) + manager.executorLost("execA", "host1", ExecutorProcessLost()) + manager.executorLost("execB.2", "host2", ExecutorProcessLost()) clock.advance(LOCALITY_WAIT_MS * 4) sched.addExecutor("execC", "host3") manager.executorAdded() @@ -1236,7 +1322,7 @@ class TaskSetManagerSuite test("SPARK-19868: DagScheduler only notified of taskEnd when state is ready") { // dagScheduler.taskEnded() is async, so it may *seem* ok to call it before we've set all - // appropriate state, eg. isZombie. However, this sets up a race that could go the wrong way. + // appropriate state, e.g. isZombie. However, this sets up a race that could go the wrong way. // This is a super-focused regression test which checks the zombie state as soon as // dagScheduler.taskEnded() is called, to ensure we haven't introduced a race. sc = new SparkContext("local", "test") @@ -1272,20 +1358,20 @@ class TaskSetManagerSuite assert(manager3.name === "TaskSet_1.1") } - test("don't update blacklist for shuffle-fetch failures, preemption, denied commits, " + + test("don't update excludelist for shuffle-fetch failures, preemption, denied commits, " + "or killed tasks") { // Setup a taskset, and fail some tasks for a fetch failure, preemption, denied commit, // and killed task. val conf = new SparkConf(). - set(config.BLACKLIST_ENABLED, true) + set(config.EXCLUDE_ON_FAILURE_ENABLED, true) sc = new SparkContext("local", "test", conf) sched = new FakeTaskScheduler(sc, ("exec1", "host1"), ("exec2", "host2")) val taskSet = FakeTask.createTaskSet(4) val tsm = new TaskSetManager(sched, taskSet, 4) - // we need a spy so we can attach our mock blacklist + // we need a spy so we can attach our mock excludelist val tsmSpy = spy(tsm) - val blacklist = mock(classOf[TaskSetBlacklist]) - when(tsmSpy.taskSetBlacklistHelperOpt).thenReturn(Some(blacklist)) + val excludelist = mock(classOf[TaskSetExcludelist]) + when(tsmSpy.taskSetExcludelistHelperOpt).thenReturn(Some(excludelist)) // make some offers to our taskset, to get tasks we will fail val taskDescs = Seq( @@ -1306,23 +1392,23 @@ class TaskSetManagerSuite TaskCommitDenied(0, 2, 0)) tsmSpy.handleFailedTask(taskDescs(3).taskId, TaskState.KILLED, TaskKilled("test")) - // Make sure that the blacklist ignored all of the task failures above, since they aren't + // Make sure that the excludelist ignored all of the task failures above, since they aren't // the fault of the executor where the task was running. - verify(blacklist, never()) - .updateBlacklistForFailedTask(anyString(), anyString(), anyInt(), anyString()) + verify(excludelist, never()) + .updateExcludedForFailedTask(anyString(), anyString(), anyInt(), anyString()) } - test("update application blacklist for shuffle-fetch") { + test("update application healthTracker for shuffle-fetch") { // Setup a taskset, and fail some one task for fetch failure. val conf = new SparkConf() - .set(config.BLACKLIST_ENABLED, true) + .set(config.EXCLUDE_ON_FAILURE_ENABLED, true) .set(config.SHUFFLE_SERVICE_ENABLED, true) - .set(config.BLACKLIST_FETCH_FAILURE_ENABLED, true) + .set(config.EXCLUDE_ON_FAILURE_FETCH_FAILURE_ENABLED, true) sc = new SparkContext("local", "test", conf) sched = new FakeTaskScheduler(sc, ("exec1", "host1"), ("exec2", "host2")) val taskSet = FakeTask.createTaskSet(4) - val blacklistTracker = new BlacklistTracker(sc, None) - val tsm = new TaskSetManager(sched, taskSet, 4, Some(blacklistTracker)) + val healthTracker = new HealthTracker(sc, None) + val tsm = new TaskSetManager(sched, taskSet, 4, Some(healthTracker)) // make some offers to our taskset, to get tasks we will fail val taskDescs = Seq( @@ -1334,22 +1420,22 @@ class TaskSetManagerSuite } assert(taskDescs.size === 4) - assert(!blacklistTracker.isExecutorBlacklisted(taskDescs(0).executorId)) - assert(!blacklistTracker.isNodeBlacklisted("host1")) + assert(!healthTracker.isExecutorExcluded(taskDescs(0).executorId)) + assert(!healthTracker.isNodeExcluded("host1")) // Fail the task with fetch failure tsm.handleFailedTask(taskDescs(0).taskId, TaskState.FAILED, FetchFailed(BlockManagerId(taskDescs(0).executorId, "host1", 12345), 0, 0L, 0, 0, "ignored")) - assert(blacklistTracker.isNodeBlacklisted("host1")) + assert(healthTracker.isNodeExcluded("host1")) } - test("update blacklist before adding pending task to avoid race condition") { - // When a task fails, it should apply the blacklist policy prior to + test("update healthTracker before adding pending task to avoid race condition") { + // When a task fails, it should apply the excludeOnFailure policy prior to // retrying the task otherwise there's a race condition where run on // the same executor that it was intended to be black listed from. val conf = new SparkConf(). - set(config.BLACKLIST_ENABLED, true) + set(config.EXCLUDE_ON_FAILURE_ENABLED, true) // Create a task with two executors. sc = new SparkContext("local", "test", conf) @@ -1362,8 +1448,8 @@ class TaskSetManagerSuite val clock = new ManualClock val mockListenerBus = mock(classOf[LiveListenerBus]) - val blacklistTracker = new BlacklistTracker(mockListenerBus, conf, None, clock) - val taskSetManager = new TaskSetManager(sched, taskSet, 1, Some(blacklistTracker)) + val healthTracker = new HealthTracker(mockListenerBus, conf, None, clock) + val taskSetManager = new TaskSetManager(sched, taskSet, 1, Some(healthTracker)) val taskSetManagerSpy = spy(taskSetManager) val taskDesc = taskSetManagerSpy.resourceOffer(exec, host, TaskLocality.ANY)._1 @@ -1372,8 +1458,8 @@ class TaskSetManagerSuite when(taskSetManagerSpy.addPendingTask(anyInt(), anyBoolean(), anyBoolean())).thenAnswer( (invocationOnMock: InvocationOnMock) => { val task: Int = invocationOnMock.getArgument(0) - assert(taskSetManager.taskSetBlacklistHelperOpt.get. - isExecutorBlacklistedForTask(exec, task)) + assert(taskSetManager.taskSetExcludelistHelperOpt.get. + isExecutorExcludedForTask(exec, task)) } ) @@ -1550,7 +1636,7 @@ class TaskSetManagerSuite assert(resubmittedTasks.isEmpty) // Host 2 Losts, meaning we lost the map output task4 - manager.executorLost("exec2", "host2", SlaveLost()) + manager.executorLost("exec2", "host2", ExecutorProcessLost()) // Make sure that task with index 2 is re-submitted assert(resubmittedTasks.contains(2)) @@ -1651,7 +1737,7 @@ class TaskSetManagerSuite for (i <- 0 to 99) { locations += Seq(TaskLocation("host" + i)) } - val taskSet = FakeTask.createTaskSet(100, locations: _*) + val taskSet = FakeTask.createTaskSet(100, locations.toSeq: _*) val clock = new ManualClock // make sure we only do one rack resolution call, for the entire batch of hosts, as this // can be expensive. The FakeTaskScheduler calls rack resolution more than the real one @@ -1682,7 +1768,6 @@ class TaskSetManagerSuite } test("TaskSetManager passes task resource along") { - import TestUtils._ sc = new SparkContext("local", "test") sc.conf.set(TASK_GPU_ID.amountConf, "2") @@ -1816,7 +1901,8 @@ class TaskSetManagerSuite speculationQuantile: Double, numTasks: Int, numExecutorCores: Int, - numCoresPerTask: Int): (TaskSetManager, ManualClock) = { + numCoresPerTask: Int, + speculationMinimumThreshold: Option[String]): (TaskSetManager, ManualClock) = { val conf = new SparkConf() conf.set(config.SPECULATION_ENABLED, true) conf.set(config.SPECULATION_QUANTILE.key, speculationQuantile.toString) @@ -1826,6 +1912,9 @@ class TaskSetManagerSuite if (speculationThresholdOpt.isDefined) { conf.set(config.SPECULATION_TASK_DURATION_THRESHOLD.key, speculationThresholdOpt.get) } + if (speculationMinimumThreshold.isDefined) { + conf.set(config.SPECULATION_MIN_THRESHOLD.key, speculationMinimumThreshold.get) + } sc = new SparkContext("local", "test", conf) sched = new FakeTaskScheduler(sc, ("exec1", "host1"), ("exec2", "host2")) // Create a task set with the given number of tasks @@ -1852,7 +1941,8 @@ class TaskSetManagerSuite speculationQuantile = 1.0, numTasks, numSlots, - numCoresPerTask = 1 + numCoresPerTask = 1, + None ) // if the time threshold has not been exceeded, no speculative run should be triggered @@ -1892,6 +1982,113 @@ class TaskSetManagerSuite testSpeculationDurationThreshold(true, 2, 1) } + test("SPARK-21040: Check speculative tasks are launched when an executor is decommissioned" + + " and the tasks running on it cannot finish within EXECUTOR_DECOMMISSION_KILL_INTERVAL") { + sc = new SparkContext("local", "test") + val clock = new ManualClock() + sched = new FakeTaskScheduler(sc, clock, + ("exec1", "host1"), ("exec2", "host2"), ("exec3", "host3")) + sched.backend = mock(classOf[SchedulerBackend]) + val taskSet = FakeTask.createTaskSet(4) + sc.conf.set(config.SPECULATION_ENABLED, true) + sc.conf.set(config.SPECULATION_MULTIPLIER, 1.5) + sc.conf.set(config.SPECULATION_QUANTILE, 0.5) + sc.conf.set(config.EXECUTOR_DECOMMISSION_KILL_INTERVAL.key, "5s") + val manager = sched.createTaskSetManager(taskSet, MAX_TASK_FAILURES) + val accumUpdatesByTask: Array[Seq[AccumulatorV2[_, _]]] = taskSet.tasks.map { task => + task.metrics.internalAccums + } + + // Start TASK 0,1 on exec1, TASK 2 on exec2 + (0 until 2).foreach { _ => + val taskOption = manager.resourceOffer("exec1", "host1", NO_PREF)._1 + assert(taskOption.isDefined) + assert(taskOption.get.executorId === "exec1") + } + val taskOption2 = manager.resourceOffer("exec2", "host2", NO_PREF)._1 + assert(taskOption2.isDefined) + assert(taskOption2.get.executorId === "exec2") + + clock.advance(6*1000) // time = 6s + // Start TASK 3 on exec2 after some delay + val taskOption3 = manager.resourceOffer("exec2", "host2", NO_PREF)._1 + assert(taskOption3.isDefined) + assert(taskOption3.get.executorId === "exec2") + + assert(sched.startedTasks.toSet === Set(0, 1, 2, 3)) + + clock.advance(4*1000) // time = 10s + // Complete the first 2 tasks and leave the other 2 tasks in running + for (id <- Set(0, 1)) { + manager.handleSuccessfulTask(id, createTaskResult(id, accumUpdatesByTask(id))) + assert(sched.endedTasks(id) === Success) + } + + // checkSpeculatableTasks checks that the task runtime is greater than the threshold for + // speculating. Since we use a SPECULATION_MULTIPLIER of 1.5, So tasks need to be running for + // > 15s for speculation + assert(!manager.checkSpeculatableTasks(0)) + assert(sched.speculativeTasks.toSet === Set()) + + // decommission exec-2. All tasks running on exec-2 (i.e. TASK 2,3) will be now + // checked if they should be speculated. + // (TASK 2 -> 15, TASK 3 -> 15) + sched.executorDecommission("exec2", ExecutorDecommissionInfo("decom", None)) + assert(sched.getExecutorDecommissionState("exec2").map(_.startTime) === + Some(clock.getTimeMillis())) + + assert(manager.checkSpeculatableTasks(0)) + // TASK 2 started at t=0s, so it can still finish before t=15s (Median task runtime = 10s) + // TASK 3 started at t=6s, so it might not finish before t=15s. So TASK 3 should be part + // of speculativeTasks + assert(sched.speculativeTasks.toSet === Set(3)) + assert(manager.copiesRunning(3) === 1) + + // Offer resource to start the speculative attempt for the running task + val taskOption3New = manager.resourceOffer("exec3", "host3", NO_PREF)._1 + // Offer more resources. Nothing should get scheduled now. + assert(manager.resourceOffer("exec3", "host3", NO_PREF)._1.isEmpty) + assert(taskOption3New.isDefined) + + // Assert info about the newly launched speculative task + val speculativeTask3 = taskOption3New.get + assert(speculativeTask3.index === 3) + assert(speculativeTask3.taskId === 4) + assert(speculativeTask3.executorId === "exec3") + assert(speculativeTask3.attemptNumber === 1) + + clock.advance(1*1000) // time = 11s + // Running checkSpeculatableTasks again should return false + assert(!manager.checkSpeculatableTasks(0)) + assert(manager.copiesRunning(2) === 1) + assert(manager.copiesRunning(3) === 2) + + clock.advance(5*1000) // time = 16s + // At t=16s, TASK 2 has been running for 16s. It is more than the + // SPECULATION_MULTIPLIER * medianRuntime = 1.5 * 10 = 15s. So now TASK 2 will + // be selected for speculation. Here we are verifying that regular speculation configs + // should still take effect even when a EXECUTOR_DECOMMISSION_KILL_INTERVAL is provided and + // corresponding executor is decommissioned + assert(manager.checkSpeculatableTasks(0)) + assert(sched.speculativeTasks.toSet === Set(2, 3)) + assert(manager.copiesRunning(2) === 1) + assert(manager.copiesRunning(3) === 2) + val taskOption2New = manager.resourceOffer("exec3", "host3", NO_PREF)._1 + assert(taskOption2New.isDefined) + val speculativeTask2 = taskOption2New.get + // Ensure that TASK 2 is re-launched on exec3, host3 + assert(speculativeTask2.index === 2) + assert(speculativeTask2.taskId === 5) + assert(speculativeTask2.executorId === "exec3") + assert(speculativeTask2.attemptNumber === 1) + + assert(manager.copiesRunning(2) === 2) + assert(manager.copiesRunning(3) === 2) + + // Offering additional resources should not lead to any speculative tasks being respawned + assert(manager.resourceOffer("exec1", "host1", ANY)._1.isEmpty) + } + test("SPARK-29976 Regular speculation configs should still take effect even when a " + "threshold is provided") { val (manager, clock) = testSpeculationDurationSetup( @@ -1899,7 +2096,8 @@ class TaskSetManagerSuite speculationQuantile = 0.5, numTasks = 2, numExecutorCores = 2, - numCoresPerTask = 1 + numCoresPerTask = 1, + None ) // Task duration can't be 0, advance 1 sec @@ -2019,6 +2217,31 @@ class TaskSetManagerSuite assert(manager.invokePrivate(numFailures())(index1) === 1) } } + + test("SPARK-33741 Test minimum amount of time a task runs " + + "before being considered for speculation") { + val (manager, clock) = testSpeculationDurationSetup( + None, + speculationQuantile = 0.5, + numTasks = 2, + numExecutorCores = 2, + numCoresPerTask = 1, + Some("3000") // spark.speculation.min.threshold + ) + // Task duration can't be 0, advance 1 sec + clock.advance(1000) + // Mark one of the task succeeded, which should satisfy the quantile + manager.handleSuccessfulTask(0, createTaskResult(0)) + // Advance 1 more second so the remaining task takes longer + clock.advance(1000) + manager.checkSpeculatableTasks(sched.MIN_TIME_TO_SPECULATION) + // The task is not considered as speculative task due to minimum threshold interval of 3s + assert(sched.speculativeTasks.size == 0) + clock.advance(2000) + manager.checkSpeculatableTasks(sched.MIN_TIME_TO_SPECULATION) + // After 3s have elapsed now the task is marked as speculative task + assert(sched.speculativeTasks.size == 1) + } } class FakeLongTasks(stageId: Int, partitionId: Int) extends FakeTask(stageId, partitionId) { diff --git a/core/src/test/scala/org/apache/spark/scheduler/WorkerDecommissionExtendedSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/WorkerDecommissionExtendedSuite.scala new file mode 100644 index 0000000000000..129eb8bf91051 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/scheduler/WorkerDecommissionExtendedSuite.scala @@ -0,0 +1,73 @@ +/* + * 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. + */ + +package org.apache.spark.scheduler + +import scala.concurrent.duration._ + +import org.scalatest.concurrent.Eventually.{eventually, interval, timeout} + +import org.apache.spark.{LocalSparkContext, SparkContext, SparkFunSuite, TestUtils} +import org.apache.spark.LocalSparkContext.withSpark +import org.apache.spark.internal.config.{DECOMMISSION_ENABLED, DYN_ALLOCATION_ENABLED, DYN_ALLOCATION_EXECUTOR_IDLE_TIMEOUT, DYN_ALLOCATION_INITIAL_EXECUTORS, DYN_ALLOCATION_SHUFFLE_TRACKING_ENABLED} +import org.apache.spark.launcher.SparkLauncher.{EXECUTOR_MEMORY, SPARK_MASTER} +import org.apache.spark.scheduler.cluster.StandaloneSchedulerBackend + +/** This test suite aims to test worker decommission with various configurations. */ +class WorkerDecommissionExtendedSuite extends SparkFunSuite with LocalSparkContext { + private val conf = new org.apache.spark.SparkConf() + .setAppName(getClass.getName) + .set(SPARK_MASTER, "local-cluster[5,1,512]") + .set(EXECUTOR_MEMORY, "512m") + .set(DYN_ALLOCATION_ENABLED, true) + .set(DYN_ALLOCATION_SHUFFLE_TRACKING_ENABLED, true) + .set(DYN_ALLOCATION_INITIAL_EXECUTORS, 5) + .set(DECOMMISSION_ENABLED, true) + + test("Worker decommission and executor idle timeout") { + sc = new SparkContext(conf.set(DYN_ALLOCATION_EXECUTOR_IDLE_TIMEOUT.key, "10s")) + withSpark(sc) { sc => + TestUtils.waitUntilExecutorsUp(sc, 5, 60000) + val rdd1 = sc.parallelize(1 to 10, 2) + val rdd2 = rdd1.map(x => (1, x)) + val rdd3 = rdd2.reduceByKey(_ + _) + val rdd4 = rdd3.sortByKey() + assert(rdd4.count() === 1) + eventually(timeout(20.seconds), interval(1.seconds)) { + assert(sc.getExecutorIds().length < 5) + } + } + } + + test("Decommission 4 executors from 5 executors in total") { + sc = new SparkContext(conf) + withSpark(sc) { sc => + TestUtils.waitUntilExecutorsUp(sc, 5, 60000) + val rdd1 = sc.parallelize(1 to 100000, 200) + val rdd2 = rdd1.map(x => (x % 100, x)) + val rdd3 = rdd2.reduceByKey(_ + _) + assert(rdd3.count() === 100) + + val sched = sc.schedulerBackend.asInstanceOf[StandaloneSchedulerBackend] + sc.getExecutorIds().tail.foreach { id => + sched.decommissionExecutor(id, ExecutorDecommissionInfo("", None), + adjustTargetNumExecutors = false) + assert(rdd3.sortByKey().collect().length === 100) + } + } + } +} diff --git a/core/src/test/scala/org/apache/spark/scheduler/WorkerDecommissionSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/WorkerDecommissionSuite.scala index 8c6f86a6c0e88..1c2326db6dc99 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/WorkerDecommissionSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/WorkerDecommissionSuite.scala @@ -19,19 +19,18 @@ package org.apache.spark.scheduler import java.util.concurrent.Semaphore -import scala.concurrent.TimeoutException import scala.concurrent.duration._ -import org.apache.spark.{LocalSparkContext, SparkConf, SparkContext, SparkException, SparkFunSuite} +import org.apache.spark.{LocalSparkContext, SparkConf, SparkContext, SparkFunSuite, TestUtils} import org.apache.spark.internal.config import org.apache.spark.scheduler.cluster.StandaloneSchedulerBackend -import org.apache.spark.util.{RpcUtils, SerializableBuffer, ThreadUtils} +import org.apache.spark.util.ThreadUtils class WorkerDecommissionSuite extends SparkFunSuite with LocalSparkContext { override def beforeEach(): Unit = { - val conf = new SparkConf().setAppName("test").setMaster("local") - .set(config.Worker.WORKER_DECOMMISSION_ENABLED, true) + val conf = new SparkConf().setAppName("test") + .set(config.DECOMMISSION_ENABLED, true) sc = new SparkContext("local-cluster[2, 1, 1024]", "test", conf) } @@ -46,14 +45,13 @@ class WorkerDecommissionSuite extends SparkFunSuite with LocalSparkContext { assert(sleepyRdd.count() === 10) } - test("verify a task with all workers decommissioned succeeds") { + test("verify a running task with all workers decommissioned succeeds") { + // Wait for the executors to come up + TestUtils.waitUntilExecutorsUp(sc = sc, + numExecutors = 2, + timeout = 30000) // 30s + val input = sc.parallelize(1 to 10) - // Do a count to wait for the executors to be registered. - input.count() - val sleepyRdd = input.mapPartitions{ x => - Thread.sleep(50) - x - } // Listen for the job val sem = new Semaphore(0) sc.addSparkListener(new SparkListener { @@ -61,24 +59,28 @@ class WorkerDecommissionSuite extends SparkFunSuite with LocalSparkContext { sem.release() } }) + + val sleepyRdd = input.mapPartitions{ x => + Thread.sleep(5000) // 5s + x + } // Start the task. val asyncCount = sleepyRdd.countAsync() // Wait for the job to have started sem.acquire(1) + // Give it time to make it to the worker otherwise we'll block + Thread.sleep(2000) // 2s // Decommission all the executors, this should not halt the current task. // decom.sh message passing is tested manually. val sched = sc.schedulerBackend.asInstanceOf[StandaloneSchedulerBackend] val execs = sched.getExecutorIds() - execs.foreach(execId => sched.decommissionExecutor(execId)) - val asyncCountResult = ThreadUtils.awaitResult(asyncCount, 10.seconds) + // Make the executors decommission, finish, exit, and not be replaced. + val execsAndDecomInfo = execs.map((_, ExecutorDecommissionInfo("", None))).toArray + sched.decommissionExecutors( + execsAndDecomInfo, + adjustTargetNumExecutors = true, + triggeredByExecutor = false) + val asyncCountResult = ThreadUtils.awaitResult(asyncCount, 20.seconds) assert(asyncCountResult === 10) - // Try and launch task after decommissioning, this should fail - val postDecommissioned = input.map(x => x) - val postDecomAsyncCount = postDecommissioned.countAsync() - val thrown = intercept[java.util.concurrent.TimeoutException]{ - val result = ThreadUtils.awaitResult(postDecomAsyncCount, 10.seconds) - } - assert(postDecomAsyncCount.isCompleted === false, - "After exec decommission new task could not launch") } } diff --git a/core/src/test/scala/org/apache/spark/scheduler/dynalloc/ExecutorMonitorSuite.scala b/core/src/test/scala/org/apache/spark/scheduler/dynalloc/ExecutorMonitorSuite.scala index 6d494796d5a26..69afdb57ef404 100644 --- a/core/src/test/scala/org/apache/spark/scheduler/dynalloc/ExecutorMonitorSuite.scala +++ b/core/src/test/scala/org/apache/spark/scheduler/dynalloc/ExecutorMonitorSuite.scala @@ -21,6 +21,7 @@ import java.util.concurrent.TimeUnit import scala.collection.mutable +import com.codahale.metrics.Counter import org.mockito.ArgumentMatchers.any import org.mockito.Mockito.{doAnswer, mock, when} @@ -57,6 +58,15 @@ class ExecutorMonitorSuite extends SparkFunSuite { // having to use mockito APIs directly in each test. private val knownExecs = mutable.HashSet[String]() + private def allocationManagerSource(): ExecutorAllocationManagerSource = { + val metricSource = mock(classOf[ExecutorAllocationManagerSource]) + when(metricSource.driverKilled).thenReturn(new Counter) + when(metricSource.decommissionUnfinished).thenReturn(new Counter) + when(metricSource.gracefullyDecommissioned).thenReturn(new Counter) + when(metricSource.exitedUnexpectedly).thenReturn(new Counter) + metricSource + } + override def beforeEach(): Unit = { super.beforeEach() knownExecs.clear() @@ -65,7 +75,7 @@ class ExecutorMonitorSuite extends SparkFunSuite { when(client.isExecutorActive(any())).thenAnswer { invocation => knownExecs.contains(invocation.getArguments()(0).asInstanceOf[String]) } - monitor = new ExecutorMonitor(conf, client, null, clock) + monitor = new ExecutorMonitor(conf, client, null, clock, allocationManagerSource()) } test("basic executor timeout") { @@ -231,7 +241,7 @@ class ExecutorMonitorSuite extends SparkFunSuite { assert(monitor.timedOutExecutors(storageDeadline) === Seq("1")) conf.set(SHUFFLE_SERVICE_ENABLED, true).set(SHUFFLE_SERVICE_FETCH_RDD_ENABLED, true) - monitor = new ExecutorMonitor(conf, client, null, clock) + monitor = new ExecutorMonitor(conf, client, null, clock, allocationManagerSource()) monitor.onExecutorAdded(SparkListenerExecutorAdded(clock.getTimeMillis(), "1", execInfo)) monitor.onBlockUpdated(rddUpdate(1, 0, "1", level = StorageLevel.MEMORY_ONLY)) @@ -292,7 +302,7 @@ class ExecutorMonitorSuite extends SparkFunSuite { test("shuffle block tracking") { val bus = mockListenerBus() conf.set(DYN_ALLOCATION_SHUFFLE_TRACKING_ENABLED, true).set(SHUFFLE_SERVICE_ENABLED, false) - monitor = new ExecutorMonitor(conf, client, bus, clock) + monitor = new ExecutorMonitor(conf, client, bus, clock, allocationManagerSource()) // 3 jobs: 2 and 3 share a shuffle, 1 has a separate shuffle. val stage1 = stageInfo(1, shuffleId = 0) @@ -360,7 +370,7 @@ class ExecutorMonitorSuite extends SparkFunSuite { test("SPARK-28839: Avoids NPE in context cleaner when shuffle service is on") { val bus = mockListenerBus() conf.set(DYN_ALLOCATION_SHUFFLE_TRACKING_ENABLED, true).set(SHUFFLE_SERVICE_ENABLED, true) - monitor = new ExecutorMonitor(conf, client, bus, clock) { + monitor = new ExecutorMonitor(conf, client, bus, clock, allocationManagerSource()) { override def onOtherEvent(event: SparkListenerEvent): Unit = { throw new IllegalStateException("No event should be sent.") } @@ -372,7 +382,7 @@ class ExecutorMonitorSuite extends SparkFunSuite { test("shuffle tracking with multiple executors and concurrent jobs") { val bus = mockListenerBus() conf.set(DYN_ALLOCATION_SHUFFLE_TRACKING_ENABLED, true).set(SHUFFLE_SERVICE_ENABLED, false) - monitor = new ExecutorMonitor(conf, client, bus, clock) + monitor = new ExecutorMonitor(conf, client, bus, clock, allocationManagerSource()) monitor.onExecutorAdded(SparkListenerExecutorAdded(clock.getTimeMillis(), "1", execInfo)) monitor.onExecutorAdded(SparkListenerExecutorAdded(clock.getTimeMillis(), "2", execInfo)) @@ -417,7 +427,7 @@ class ExecutorMonitorSuite extends SparkFunSuite { .set(DYN_ALLOCATION_SHUFFLE_TRACKING_TIMEOUT, Long.MaxValue) .set(DYN_ALLOCATION_SHUFFLE_TRACKING_ENABLED, true) .set(SHUFFLE_SERVICE_ENABLED, false) - monitor = new ExecutorMonitor(conf, client, null, clock) + monitor = new ExecutorMonitor(conf, client, null, clock, allocationManagerSource()) // Generate events that will make executor 1 be idle, while still holding shuffle data. // The executor should not be eligible for removal since the timeout is basically "infinite". diff --git a/core/src/test/scala/org/apache/spark/security/CryptoStreamUtilsSuite.scala b/core/src/test/scala/org/apache/spark/security/CryptoStreamUtilsSuite.scala index abccb8e9bbf28..c3d96e7c42af8 100644 --- a/core/src/test/scala/org/apache/spark/security/CryptoStreamUtilsSuite.scala +++ b/core/src/test/scala/org/apache/spark/security/CryptoStreamUtilsSuite.scala @@ -54,14 +54,14 @@ class CryptoStreamUtilsSuite extends SparkFunSuite { test("shuffle encryption key length should be 128 by default") { val conf = createConf() - var key = CryptoStreamUtils.createKey(conf) + val key = CryptoStreamUtils.createKey(conf) val actual = key.length * (java.lang.Byte.SIZE) assert(actual === 128) } test("create 256-bit key") { val conf = createConf(IO_ENCRYPTION_KEY_SIZE_BITS.key -> "256") - var key = CryptoStreamUtils.createKey(conf) + val key = CryptoStreamUtils.createKey(conf) val actual = key.length * (java.lang.Byte.SIZE) assert(actual === 256) } diff --git a/core/src/test/scala/org/apache/spark/serializer/GenericAvroSerializerSuite.scala b/core/src/test/scala/org/apache/spark/serializer/GenericAvroSerializerSuite.scala index 8610b18702ec0..54e4aebe54430 100644 --- a/core/src/test/scala/org/apache/spark/serializer/GenericAvroSerializerSuite.scala +++ b/core/src/test/scala/org/apache/spark/serializer/GenericAvroSerializerSuite.scala @@ -22,53 +22,55 @@ import java.nio.ByteBuffer import com.esotericsoftware.kryo.io.{Input, Output} import org.apache.avro.{Schema, SchemaBuilder} -import org.apache.avro.generic.GenericData.Record +import org.apache.avro.generic.GenericData.{Array => AvroArray, EnumSymbol, Fixed, Record} import org.apache.spark.{SharedSparkContext, SparkFunSuite} import org.apache.spark.internal.config.SERIALIZER class GenericAvroSerializerSuite extends SparkFunSuite with SharedSparkContext { - conf.set(SERIALIZER, "org.apache.spark.serializer.KryoSerializer") - val schema : Schema = SchemaBuilder + override def beforeAll(): Unit = { + conf.set(SERIALIZER, "org.apache.spark.serializer.KryoSerializer") + super.beforeAll() + } + + val recordSchema : Schema = SchemaBuilder .record("testRecord").fields() .requiredString("data") .endRecord() - val record = new Record(schema) - record.put("data", "test data") + val recordDatum = new Record(recordSchema) + recordDatum.put("data", "test data") - test("schema compression and decompression") { - val genericSer = new GenericAvroSerializer(conf.getAvroSchema) - assert(schema === genericSer.decompress(ByteBuffer.wrap(genericSer.compress(schema)))) - } + val arraySchema = SchemaBuilder.array().items().`type`(recordSchema) + val arrayDatum = new AvroArray[Record](1, arraySchema) + arrayDatum.add(recordDatum) - test("record serialization and deserialization") { - val genericSer = new GenericAvroSerializer(conf.getAvroSchema) + val enumSchema = SchemaBuilder.enumeration("enum").symbols("A", "B") + val enumDatum = new EnumSymbol(enumSchema, "A") - val outputStream = new ByteArrayOutputStream() - val output = new Output(outputStream) - genericSer.serializeDatum(record, output) - output.flush() - output.close() + val fixedSchema = SchemaBuilder.fixed("fixed").size(4) + val fixedDatum = new Fixed(fixedSchema, "ABCD".getBytes) - val input = new Input(new ByteArrayInputStream(outputStream.toByteArray)) - assert(genericSer.deserializeDatum(input) === record) + test("schema compression and decompression") { + val genericSer = new GenericAvroSerializer(conf.getAvroSchema) + assert(recordSchema === + genericSer.decompress(ByteBuffer.wrap(genericSer.compress(recordSchema)))) } test("uses schema fingerprint to decrease message size") { - val genericSerFull = new GenericAvroSerializer(conf.getAvroSchema) + val genericSerFull = new GenericAvroSerializer[Record](conf.getAvroSchema) val output = new Output(new ByteArrayOutputStream()) val beginningNormalPosition = output.total() - genericSerFull.serializeDatum(record, output) + genericSerFull.serializeDatum(recordDatum, output) output.flush() val normalLength = output.total - beginningNormalPosition - conf.registerAvroSchemas(schema) - val genericSerFinger = new GenericAvroSerializer(conf.getAvroSchema) + conf.registerAvroSchemas(recordSchema) + val genericSerFinger = new GenericAvroSerializer[Record](conf.getAvroSchema) val beginningFingerprintPosition = output.total() - genericSerFinger.serializeDatum(record, output) + genericSerFinger.serializeDatum(recordDatum, output) val fingerprintLength = output.total - beginningFingerprintPosition assert(fingerprintLength < normalLength) @@ -76,10 +78,36 @@ class GenericAvroSerializerSuite extends SparkFunSuite with SharedSparkContext { test("caches previously seen schemas") { val genericSer = new GenericAvroSerializer(conf.getAvroSchema) - val compressedSchema = genericSer.compress(schema) + val compressedSchema = genericSer.compress(recordSchema) val decompressedSchema = genericSer.decompress(ByteBuffer.wrap(compressedSchema)) - assert(compressedSchema.eq(genericSer.compress(schema))) + assert(compressedSchema.eq(genericSer.compress(recordSchema))) assert(decompressedSchema.eq(genericSer.decompress(ByteBuffer.wrap(compressedSchema)))) } + + Seq( + ("Record", recordDatum), + ("Array", arrayDatum), + ("EnumSymbol", enumDatum), + ("Fixed", fixedDatum) + ).foreach { case (name, datum) => + test(s"SPARK-34477: GenericData.$name serialization and deserialization") { + val genericSer = new GenericAvroSerializer[datum.type](conf.getAvroSchema) + + val outputStream = new ByteArrayOutputStream() + val output = new Output(outputStream) + genericSer.serializeDatum(datum, output) + output.flush() + output.close() + + val input = new Input(new ByteArrayInputStream(outputStream.toByteArray)) + assert(genericSer.deserializeDatum(input) === datum) + } + + test(s"SPARK-34477: GenericData.$name serialization and deserialization" + + " through KryoSerializer ") { + val rdd = sc.parallelize((0 until 10).map(_ => datum), 2) + assert(rdd.collect() sameElements Array.fill(10)(datum)) + } + } } diff --git a/core/src/test/scala/org/apache/spark/serializer/KryoBenchmark.scala b/core/src/test/scala/org/apache/spark/serializer/KryoBenchmark.scala index fd228cded783a..1c17d7b1392ab 100644 --- a/core/src/test/scala/org/apache/spark/serializer/KryoBenchmark.scala +++ b/core/src/test/scala/org/apache/spark/serializer/KryoBenchmark.scala @@ -31,7 +31,7 @@ import org.apache.spark.serializer.KryoTest._ * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class * 2. build/sbt "core/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "core/test:runMain " @@ -125,7 +125,7 @@ object KryoBenchmark extends BenchmarkBase { def createSerializer(useUnsafe: Boolean): SerializerInstance = { val conf = new SparkConf() conf.set(SERIALIZER, "org.apache.spark.serializer.KryoSerializer") - conf.set(KRYO_USER_REGISTRATORS, classOf[MyRegistrator].getName) + conf.set(KRYO_USER_REGISTRATORS, Seq(classOf[MyRegistrator].getName)) conf.set(KRYO_USE_UNSAFE, useUnsafe) new KryoSerializer(conf).newInstance() diff --git a/core/src/test/scala/org/apache/spark/serializer/KryoSerializerBenchmark.scala b/core/src/test/scala/org/apache/spark/serializer/KryoSerializerBenchmark.scala index 953b651c72a83..7f5dbff46b776 100644 --- a/core/src/test/scala/org/apache/spark/serializer/KryoSerializerBenchmark.scala +++ b/core/src/test/scala/org/apache/spark/serializer/KryoSerializerBenchmark.scala @@ -34,7 +34,7 @@ import org.apache.spark.util.ThreadUtils * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class * 2. build/sbt "core/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "core/test:runMain " @@ -76,7 +76,7 @@ object KryoSerializerBenchmark extends BenchmarkBase { conf.set(EXECUTOR_EXTRA_JAVA_OPTIONS, "-XX:+UseParallelGC -XX:-UseDynamicNumberOfGCThreads") conf.set(SERIALIZER, "org.apache.spark.serializer.KryoSerializer") - conf.set(KRYO_USER_REGISTRATORS, classOf[MyRegistrator].getName) + conf.set(KRYO_USER_REGISTRATORS, Seq(classOf[MyRegistrator].getName)) conf.set(KRYO_USE_POOL, usePool) if (sc != null) { diff --git a/core/src/test/scala/org/apache/spark/serializer/KryoSerializerDistributedSuite.scala b/core/src/test/scala/org/apache/spark/serializer/KryoSerializerDistributedSuite.scala index d4fafab4a5d64..4acb4bbc779c3 100644 --- a/core/src/test/scala/org/apache/spark/serializer/KryoSerializerDistributedSuite.scala +++ b/core/src/test/scala/org/apache/spark/serializer/KryoSerializerDistributedSuite.scala @@ -29,9 +29,9 @@ class KryoSerializerDistributedSuite extends SparkFunSuite with LocalSparkContex test("kryo objects are serialised consistently in different processes") { val conf = new SparkConf(false) .set(config.SERIALIZER, "org.apache.spark.serializer.KryoSerializer") - .set(config.Kryo.KRYO_USER_REGISTRATORS, classOf[AppJarRegistrator].getName) + .set(config.Kryo.KRYO_USER_REGISTRATORS, Seq(classOf[AppJarRegistrator].getName)) .set(config.TASK_MAX_FAILURES, 1) - .set(config.BLACKLIST_ENABLED, false) + .set(config.EXCLUDE_ON_FAILURE_ENABLED, false) val jar = TestUtils.createJarWithClasses(List(AppJarRegistrator.customClassName)) conf.setJars(List(jar.getPath)) diff --git a/core/src/test/scala/org/apache/spark/serializer/KryoSerializerSuite.scala b/core/src/test/scala/org/apache/spark/serializer/KryoSerializerSuite.scala index 4c47a67ee9ffc..229ef69973775 100644 --- a/core/src/test/scala/org/apache/spark/serializer/KryoSerializerSuite.scala +++ b/core/src/test/scala/org/apache/spark/serializer/KryoSerializerSuite.scala @@ -42,7 +42,7 @@ import org.apache.spark.util.ThreadUtils class KryoSerializerSuite extends SparkFunSuite with SharedSparkContext { conf.set(SERIALIZER, "org.apache.spark.serializer.KryoSerializer") - conf.set(KRYO_USER_REGISTRATORS, classOf[MyRegistrator].getName) + conf.set(KRYO_USER_REGISTRATORS, Seq(classOf[MyRegistrator].getName)) conf.set(KRYO_USE_UNSAFE, false) test("SPARK-7392 configuration limits") { @@ -313,7 +313,7 @@ class KryoSerializerSuite extends SparkFunSuite with SharedSparkContext { import org.apache.spark.SparkException val conf = new SparkConf(false) - conf.set(KRYO_USER_REGISTRATORS, "this.class.does.not.exist") + conf.set(KRYO_USER_REGISTRATORS, Seq("this.class.does.not.exist")) val thrown = intercept[SparkException](new KryoSerializer(conf).newInstance().serialize(1)) assert(thrown.getMessage.contains("Failed to register classes with Kryo")) @@ -412,7 +412,7 @@ class KryoSerializerSuite extends SparkFunSuite with SharedSparkContext { val ser = new KryoSerializer(new SparkConf).newInstance().asInstanceOf[KryoSerializerInstance] assert(ser.getAutoReset) val conf = new SparkConf().set(KRYO_USER_REGISTRATORS, - classOf[RegistratorWithoutAutoReset].getName) + Seq(classOf[RegistratorWithoutAutoReset].getName)) val ser2 = new KryoSerializer(conf).newInstance().asInstanceOf[KryoSerializerInstance] assert(!ser2.getAutoReset) } @@ -443,7 +443,7 @@ class KryoSerializerSuite extends SparkFunSuite with SharedSparkContext { .set(KRYO_REFERENCE_TRACKING, referenceTracking) .set(KRYO_USE_POOL, usePool) if (!autoReset) { - conf.set(KRYO_USER_REGISTRATORS, classOf[RegistratorWithoutAutoReset].getName) + conf.set(KRYO_USER_REGISTRATORS, Seq(classOf[RegistratorWithoutAutoReset].getName)) } val ser = new KryoSerializer(conf) val serInstance = ser.newInstance().asInstanceOf[KryoSerializerInstance] @@ -530,7 +530,7 @@ class KryoSerializerSuite extends SparkFunSuite with SharedSparkContext { class KryoSerializerAutoResetDisabledSuite extends SparkFunSuite with SharedSparkContext { conf.set(SERIALIZER, classOf[KryoSerializer].getName) - conf.set(KRYO_USER_REGISTRATORS, classOf[RegistratorWithoutAutoReset].getName) + conf.set(KRYO_USER_REGISTRATORS, Seq(classOf[RegistratorWithoutAutoReset].getName)) conf.set(KRYO_REFERENCE_TRACKING, true) conf.set(SHUFFLE_MANAGER, "sort") conf.set(SHUFFLE_SORT_BYPASS_MERGE_THRESHOLD, 200) diff --git a/core/src/test/scala/org/apache/spark/serializer/SerializerPropertiesSuite.scala b/core/src/test/scala/org/apache/spark/serializer/SerializerPropertiesSuite.scala index dad080c5fc161..9747f5780dd1e 100644 --- a/core/src/test/scala/org/apache/spark/serializer/SerializerPropertiesSuite.scala +++ b/core/src/test/scala/org/apache/spark/serializer/SerializerPropertiesSuite.scala @@ -52,7 +52,7 @@ class SerializerPropertiesSuite extends SparkFunSuite { test("KryoSerializer does not support relocation when auto-reset is disabled") { val conf = new SparkConf().set(KRYO_USER_REGISTRATORS, - classOf[RegistratorWithoutAutoReset].getName) + Seq(classOf[RegistratorWithoutAutoReset].getName)) val ser = new KryoSerializer(conf) assert(!ser.newInstance().asInstanceOf[KryoSerializerInstance].getAutoReset()) testSupportsRelocationOfSerializedObjects(ser, generateRandomItem) diff --git a/core/src/test/scala/org/apache/spark/shuffle/BlockStoreShuffleReaderSuite.scala b/core/src/test/scala/org/apache/spark/shuffle/BlockStoreShuffleReaderSuite.scala index a82f86a11c77e..d964b28df2983 100644 --- a/core/src/test/scala/org/apache/spark/shuffle/BlockStoreShuffleReaderSuite.scala +++ b/core/src/test/scala/org/apache/spark/shuffle/BlockStoreShuffleReaderSuite.scala @@ -104,7 +104,7 @@ class BlockStoreShuffleReaderSuite extends SparkFunSuite with LocalSparkContext // shuffle data to read. val mapOutputTracker = mock(classOf[MapOutputTracker]) when(mapOutputTracker.getMapSizesByExecutorId( - shuffleId, reduceId, reduceId + 1)).thenReturn { + shuffleId, 0, numMaps, reduceId, reduceId + 1)).thenReturn { // Test a scenario where all data is local, to avoid creating a bunch of additional mocks // for the code to read data over the network. val shuffleBlockIdsAndSizes = (0 until numMaps).map { mapId => @@ -132,7 +132,7 @@ class BlockStoreShuffleReaderSuite extends SparkFunSuite with LocalSparkContext val taskContext = TaskContext.empty() val metrics = taskContext.taskMetrics.createTempShuffleReadMetrics() val blocksByAddress = mapOutputTracker.getMapSizesByExecutorId( - shuffleId, reduceId, reduceId + 1) + shuffleId, 0, numMaps, reduceId, reduceId + 1) val shuffleReader = new BlockStoreShuffleReader( shuffleHandle, blocksByAddress, diff --git a/core/src/test/scala/org/apache/spark/shuffle/HostLocalShuffleReadingSuite.scala b/core/src/test/scala/org/apache/spark/shuffle/HostLocalShuffleReadingSuite.scala new file mode 100644 index 0000000000000..8f0c4da88feb2 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/shuffle/HostLocalShuffleReadingSuite.scala @@ -0,0 +1,136 @@ +/* + * 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. + */ + +package org.apache.spark.shuffle + +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ + +import org.apache.spark._ +import org.apache.spark.internal.config._ +import org.apache.spark.network.TransportContext +import org.apache.spark.network.netty.{NettyBlockTransferService, SparkTransportConf} +import org.apache.spark.network.server.TransportServer +import org.apache.spark.network.shuffle.{ExternalBlockHandler, ExternalBlockStoreClient} +import org.apache.spark.util.Utils + +/** + * This's an end to end test suite used to test the host local shuffle reading. + */ +class HostLocalShuffleReadingSuite extends SparkFunSuite with Matchers with LocalSparkContext { + var rpcHandler: ExternalBlockHandler = _ + var server: TransportServer = _ + var transportContext: TransportContext = _ + + override def afterEach(): Unit = { + Option(rpcHandler).foreach { handler => + Utils.tryLogNonFatalError{ + server.close() + } + Utils.tryLogNonFatalError{ + handler.close() + } + Utils.tryLogNonFatalError{ + transportContext.close() + } + server = null + rpcHandler = null + transportContext = null + } + super.afterEach() + } + + Seq(true, false).foreach { isESSEnabled => /* ESS: external shuffle service */ + val conf = new SparkConf() + .set(SHUFFLE_HOST_LOCAL_DISK_READING_ENABLED, true) + + import scala.language.existentials + val (essStatus, blockStoreClientClass) = if (isESSEnabled) { + // LocalSparkCluster will disable the ExternalShuffleService by default. Therefore, + // we have to manually setup an server which embedded with ExternalBlockHandler to + // mimic a ExternalShuffleService. Then, executors on the Worker can successfully + // find a ExternalShuffleService to connect. + val transportConf = SparkTransportConf.fromSparkConf(conf, "shuffle", numUsableCores = 2) + rpcHandler = new ExternalBlockHandler(transportConf, null) + transportContext = new TransportContext(transportConf, rpcHandler) + server = transportContext.createServer() + conf.set(SHUFFLE_SERVICE_PORT, server.getPort) + + ("enabled (SPARK-27651)", classOf[ExternalBlockStoreClient]) + } else { + ("disabled (SPARK-32077)", classOf[NettyBlockTransferService]) + } + + test(s"host local shuffle reading with external shuffle service $essStatus") { + conf.set(SHUFFLE_SERVICE_ENABLED, isESSEnabled) + .set(STORAGE_LOCAL_DISK_BY_EXECUTORS_CACHE_SIZE, 5) + sc = new SparkContext("local-cluster[2,1,1024]", "test-host-local-shuffle-reading", conf) + // In a slow machine, one executor may register hundreds of milliseconds ahead of the other + // one. If we don't wait for all executors, it's possible that only one executor runs all + // jobs. Then all shuffle blocks will be in this executor, ShuffleBlockFetcherIterator will + // directly fetch local blocks from the local BlockManager and won't send requests to + // BlockStoreClient. In this case, we won't receive FetchFailed. And it will make this + // test fail. Therefore, we should wait until all executors are up + TestUtils.waitUntilExecutorsUp(sc, 2, 60000) + + sc.getConf.get(SHUFFLE_HOST_LOCAL_DISK_READING_ENABLED) should equal(true) + sc.env.blockManager.externalShuffleServiceEnabled should equal(isESSEnabled) + sc.env.blockManager.hostLocalDirManager.isDefined should equal(true) + sc.env.blockManager.blockStoreClient.getClass should equal(blockStoreClientClass) + + val rdd = sc.parallelize(0 until 1000, 10) + .map { i => + SparkEnv.get.blockManager.hostLocalDirManager.map { localDirManager => + // No shuffle fetch yet. So the cache must be empty + assert(localDirManager.getCachedHostLocalDirs.isEmpty) + } + (i, 1) + }.reduceByKey(_ + _) + + // raise a job and trigger the shuffle fetching during the job + assert(rdd.count() === 1000) + + val cachedExecutors = rdd.mapPartitions { _ => + SparkEnv.get.blockManager.hostLocalDirManager.map { localDirManager => + localDirManager.getCachedHostLocalDirs.keySet.iterator + }.getOrElse(Iterator.empty) + }.collect().toSet + + // both executors are caching the dirs of the other one + cachedExecutors should equal(sc.getExecutorIds().toSet) + + Option(rpcHandler).foreach { handler => + // Invalidate the registered executors, disallowing access to their shuffle blocks (without + // deleting the actual shuffle files, so we could access them without the shuffle service). + // As directories are already cached there is no request to external shuffle service. + handler.applicationRemoved(sc.conf.getAppId, false /* cleanupLocalDirs */) + } + + val (local, remote) = rdd.map { case (_, _) => + val shuffleReadMetrics = TaskContext.get().taskMetrics().shuffleReadMetrics + ((shuffleReadMetrics.localBytesRead, shuffleReadMetrics.localBlocksFetched), + (shuffleReadMetrics.remoteBytesRead, shuffleReadMetrics.remoteBlocksFetched)) + }.collect().unzip + // Spark should read the shuffle data locally from the cached directories on the same host, + // so there's no remote fetching at all. + val (localBytesRead, localBlocksFetched) = local.unzip + val (remoteBytesRead, remoteBlocksFetched) = remote.unzip + assert(localBytesRead.sum > 0 && localBlocksFetched.sum > 0) + assert(remoteBytesRead.sum === 0 && remoteBlocksFetched.sum === 0) + } + } +} diff --git a/core/src/test/scala/org/apache/spark/shuffle/ShuffleBlockPusherSuite.scala b/core/src/test/scala/org/apache/spark/shuffle/ShuffleBlockPusherSuite.scala new file mode 100644 index 0000000000000..4e51ba4b3a2a5 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/shuffle/ShuffleBlockPusherSuite.scala @@ -0,0 +1,355 @@ +/* + * 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. + */ + +package org.apache.spark.shuffle + +import java.io.File +import java.net.ConnectException +import java.nio.ByteBuffer +import java.util.concurrent.LinkedBlockingQueue + +import scala.collection.mutable.ArrayBuffer + +import org.mockito.{Mock, MockitoAnnotations} +import org.mockito.Answers.RETURNS_SMART_NULLS +import org.mockito.ArgumentMatchers.any +import org.mockito.Mockito._ +import org.mockito.invocation.InvocationOnMock +import org.scalatest.BeforeAndAfterEach + +import org.apache.spark._ +import org.apache.spark.network.buffer.ManagedBuffer +import org.apache.spark.network.shuffle.{BlockFetchingListener, BlockStoreClient} +import org.apache.spark.network.shuffle.ErrorHandler.BlockPushErrorHandler +import org.apache.spark.network.util.TransportConf +import org.apache.spark.serializer.JavaSerializer +import org.apache.spark.shuffle.ShuffleBlockPusher.PushRequest +import org.apache.spark.storage._ + +class ShuffleBlockPusherSuite extends SparkFunSuite with BeforeAndAfterEach { + + @Mock(answer = RETURNS_SMART_NULLS) private var blockManager: BlockManager = _ + @Mock(answer = RETURNS_SMART_NULLS) private var dependency: ShuffleDependency[Int, Int, Int] = _ + @Mock(answer = RETURNS_SMART_NULLS) private var shuffleClient: BlockStoreClient = _ + + private var conf: SparkConf = _ + private var pushedBlocks = new ArrayBuffer[String] + + override def beforeEach(): Unit = { + super.beforeEach() + conf = new SparkConf(loadDefaults = false) + MockitoAnnotations.openMocks(this).close() + when(dependency.partitioner).thenReturn(new HashPartitioner(8)) + when(dependency.serializer).thenReturn(new JavaSerializer(conf)) + when(dependency.getMergerLocs).thenReturn(Seq(BlockManagerId("test-client", "test-client", 1))) + conf.set("spark.shuffle.push.based.enabled", "true") + conf.set("spark.shuffle.service.enabled", "true") + // Set the env because the shuffler writer gets the shuffle client instance from the env. + val mockEnv = mock(classOf[SparkEnv]) + when(mockEnv.conf).thenReturn(conf) + when(mockEnv.blockManager).thenReturn(blockManager) + SparkEnv.set(mockEnv) + when(blockManager.blockStoreClient).thenReturn(shuffleClient) + } + + override def afterEach(): Unit = { + pushedBlocks.clear() + super.afterEach() + } + + private def interceptPushedBlocksForSuccess(): Unit = { + when(shuffleClient.pushBlocks(any(), any(), any(), any(), any())) + .thenAnswer((invocation: InvocationOnMock) => { + val blocks = invocation.getArguments()(2).asInstanceOf[Array[String]] + pushedBlocks ++= blocks + val managedBuffers = invocation.getArguments()(3).asInstanceOf[Array[ManagedBuffer]] + val blockFetchListener = invocation.getArguments()(4).asInstanceOf[BlockFetchingListener] + (blocks, managedBuffers).zipped.foreach((blockId, buffer) => { + blockFetchListener.onBlockFetchSuccess(blockId, buffer) + }) + }) + } + + private def verifyPushRequests( + pushRequests: Seq[PushRequest], + expectedSizes: Seq[Int]): Unit = { + (pushRequests, expectedSizes).zipped.foreach((req, size) => { + assert(req.size == size) + }) + } + + test("A batch of blocks is limited by maxBlocksBatchSize") { + conf.set("spark.shuffle.push.maxBlockBatchSize", "1m") + conf.set("spark.shuffle.push.maxBlockSizeToPush", "2048k") + val blockPusher = new TestShuffleBlockPusher(conf) + val mergerLocs = dependency.getMergerLocs.map(loc => BlockManagerId("", loc.host, loc.port)) + val largeBlockSize = 2 * 1024 * 1024 + val pushRequests = blockPusher.prepareBlockPushRequests(5, 0, 0, + mock(classOf[File]), Array(2, 2, 2, largeBlockSize, largeBlockSize), mergerLocs, + mock(classOf[TransportConf])) + assert(pushRequests.length == 3) + verifyPushRequests(pushRequests, Seq(6, largeBlockSize, largeBlockSize)) + } + + test("Large blocks are excluded in the preparation") { + conf.set("spark.shuffle.push.maxBlockSizeToPush", "1k") + val blockPusher = new TestShuffleBlockPusher(conf) + val mergerLocs = dependency.getMergerLocs.map(loc => BlockManagerId("", loc.host, loc.port)) + val pushRequests = blockPusher.prepareBlockPushRequests(5, 0, 0, + mock(classOf[File]), Array(2, 2, 2, 1028, 1024), mergerLocs, mock(classOf[TransportConf])) + assert(pushRequests.length == 2) + verifyPushRequests(pushRequests, Seq(6, 1024)) + } + + test("Number of blocks in a push request are limited by maxBlocksInFlightPerAddress ") { + conf.set("spark.reducer.maxBlocksInFlightPerAddress", "1") + val blockPusher = new TestShuffleBlockPusher(conf) + val mergerLocs = dependency.getMergerLocs.map(loc => BlockManagerId("", loc.host, loc.port)) + val pushRequests = blockPusher.prepareBlockPushRequests(5, 0, 0, + mock(classOf[File]), Array(2, 2, 2, 2, 2), mergerLocs, mock(classOf[TransportConf])) + assert(pushRequests.length == 5) + verifyPushRequests(pushRequests, Seq(2, 2, 2, 2, 2)) + } + + test("Basic block push") { + interceptPushedBlocksForSuccess() + val blockPusher = new TestShuffleBlockPusher(conf) + blockPusher.initiateBlockPush(mock(classOf[File]), + Array.fill(dependency.partitioner.numPartitions) { 2 }, dependency, 0) + blockPusher.runPendingTasks() + verify(shuffleClient, times(1)) + .pushBlocks(any(), any(), any(), any(), any()) + assert(pushedBlocks.length == dependency.partitioner.numPartitions) + ShuffleBlockPusher.stop() + } + + test("Large blocks are skipped for push") { + conf.set("spark.shuffle.push.maxBlockSizeToPush", "1k") + interceptPushedBlocksForSuccess() + val pusher = new TestShuffleBlockPusher(conf) + pusher.initiateBlockPush( + mock(classOf[File]), Array(2, 2, 2, 2, 2, 2, 2, 1100), dependency, 0) + pusher.runPendingTasks() + verify(shuffleClient, times(1)) + .pushBlocks(any(), any(), any(), any(), any()) + assert(pushedBlocks.length == dependency.partitioner.numPartitions - 1) + ShuffleBlockPusher.stop() + } + + test("Number of blocks in flight per address are limited by maxBlocksInFlightPerAddress") { + conf.set("spark.reducer.maxBlocksInFlightPerAddress", "1") + interceptPushedBlocksForSuccess() + val pusher = new TestShuffleBlockPusher(conf) + pusher.initiateBlockPush( + mock(classOf[File]), Array.fill(dependency.partitioner.numPartitions) { 2 }, dependency, 0) + pusher.runPendingTasks() + verify(shuffleClient, times(8)) + .pushBlocks(any(), any(), any(), any(), any()) + assert(pushedBlocks.length == dependency.partitioner.numPartitions) + ShuffleBlockPusher.stop() + } + + test("Hit maxBlocksInFlightPerAddress limit so that the blocks are deferred") { + conf.set("spark.reducer.maxBlocksInFlightPerAddress", "2") + var blockPendingResponse : String = null + var listener : BlockFetchingListener = null + when(shuffleClient.pushBlocks(any(), any(), any(), any(), any())) + .thenAnswer((invocation: InvocationOnMock) => { + val blocks = invocation.getArguments()(2).asInstanceOf[Array[String]] + pushedBlocks ++= blocks + val managedBuffers = invocation.getArguments()(3).asInstanceOf[Array[ManagedBuffer]] + val blockFetchListener = invocation.getArguments()(4).asInstanceOf[BlockFetchingListener] + // Expecting 2 blocks + assert(blocks.length == 2) + if (blockPendingResponse == null) { + blockPendingResponse = blocks(1) + listener = blockFetchListener + // Respond with success only for the first block which will cause all the rest of the + // blocks to be deferred + blockFetchListener.onBlockFetchSuccess(blocks(0), managedBuffers(0)) + } else { + (blocks, managedBuffers).zipped.foreach((blockId, buffer) => { + blockFetchListener.onBlockFetchSuccess(blockId, buffer) + }) + } + }) + val pusher = new TestShuffleBlockPusher(conf) + pusher.initiateBlockPush( + mock(classOf[File]), Array.fill(dependency.partitioner.numPartitions) { 2 }, dependency, 0) + pusher.runPendingTasks() + verify(shuffleClient, times(1)) + .pushBlocks(any(), any(), any(), any(), any()) + assert(pushedBlocks.length == 2) + // this will trigger push of deferred blocks + listener.onBlockFetchSuccess(blockPendingResponse, mock(classOf[ManagedBuffer])) + pusher.runPendingTasks() + verify(shuffleClient, times(4)) + .pushBlocks(any(), any(), any(), any(), any()) + assert(pushedBlocks.length == 8) + ShuffleBlockPusher.stop() + } + + test("Number of shuffle blocks grouped in a single push request is limited by " + + "maxBlockBatchSize") { + conf.set("spark.shuffle.push.maxBlockBatchSize", "1m") + interceptPushedBlocksForSuccess() + val pusher = new TestShuffleBlockPusher(conf) + pusher.initiateBlockPush(mock(classOf[File]), + Array.fill(dependency.partitioner.numPartitions) { 512 * 1024 }, dependency, 0) + pusher.runPendingTasks() + verify(shuffleClient, times(4)) + .pushBlocks(any(), any(), any(), any(), any()) + assert(pushedBlocks.length == dependency.partitioner.numPartitions) + ShuffleBlockPusher.stop() + } + + test("Error retries") { + val pusher = new ShuffleBlockPusher(conf) + val errorHandler = pusher.createErrorHandler() + assert( + !errorHandler.shouldRetryError(new RuntimeException( + new IllegalArgumentException(BlockPushErrorHandler.TOO_LATE_MESSAGE_SUFFIX)))) + assert(errorHandler.shouldRetryError(new RuntimeException(new ConnectException()))) + assert( + errorHandler.shouldRetryError(new RuntimeException(new IllegalArgumentException( + BlockPushErrorHandler.BLOCK_APPEND_COLLISION_DETECTED_MSG_PREFIX)))) + assert (errorHandler.shouldRetryError(new Throwable())) + } + + test("Error logging") { + val pusher = new ShuffleBlockPusher(conf) + val errorHandler = pusher.createErrorHandler() + assert( + !errorHandler.shouldLogError(new RuntimeException( + new IllegalArgumentException(BlockPushErrorHandler.TOO_LATE_MESSAGE_SUFFIX)))) + assert(!errorHandler.shouldLogError(new RuntimeException( + new IllegalArgumentException( + BlockPushErrorHandler.BLOCK_APPEND_COLLISION_DETECTED_MSG_PREFIX)))) + assert(errorHandler.shouldLogError(new Throwable())) + } + + test("Blocks are continued to push even when a block push fails with collision " + + "exception") { + conf.set("spark.reducer.maxBlocksInFlightPerAddress", "1") + val pusher = new TestShuffleBlockPusher(conf) + var failBlock: Boolean = true + when(shuffleClient.pushBlocks(any(), any(), any(), any(), any())) + .thenAnswer((invocation: InvocationOnMock) => { + val blocks = invocation.getArguments()(2).asInstanceOf[Array[String]] + val blockFetchListener = invocation.getArguments()(4).asInstanceOf[BlockFetchingListener] + blocks.foreach(blockId => { + if (failBlock) { + failBlock = false + // Fail the first block with the collision exception. + blockFetchListener.onBlockFetchFailure(blockId, new RuntimeException( + new IllegalArgumentException( + BlockPushErrorHandler.BLOCK_APPEND_COLLISION_DETECTED_MSG_PREFIX))) + } else { + pushedBlocks += blockId + blockFetchListener.onBlockFetchSuccess(blockId, mock(classOf[ManagedBuffer])) + } + }) + }) + pusher.initiateBlockPush( + mock(classOf[File]), Array.fill(dependency.partitioner.numPartitions) { 2 }, dependency, 0) + pusher.runPendingTasks() + verify(shuffleClient, times(8)) + .pushBlocks(any(), any(), any(), any(), any()) + assert(pushedBlocks.length == 7) + } + + test("More blocks are not pushed when a block push fails with too late " + + "exception") { + conf.set("spark.reducer.maxBlocksInFlightPerAddress", "1") + val pusher = new TestShuffleBlockPusher(conf) + var failBlock: Boolean = true + when(shuffleClient.pushBlocks(any(), any(), any(), any(), any())) + .thenAnswer((invocation: InvocationOnMock) => { + val blocks = invocation.getArguments()(2).asInstanceOf[Array[String]] + val blockFetchListener = invocation.getArguments()(4).asInstanceOf[BlockFetchingListener] + blocks.foreach(blockId => { + if (failBlock) { + failBlock = false + // Fail the first block with the too late exception. + blockFetchListener.onBlockFetchFailure(blockId, new RuntimeException( + new IllegalArgumentException(BlockPushErrorHandler.TOO_LATE_MESSAGE_SUFFIX))) + } else { + pushedBlocks += blockId + blockFetchListener.onBlockFetchSuccess(blockId, mock(classOf[ManagedBuffer])) + } + }) + }) + pusher.initiateBlockPush( + mock(classOf[File]), Array.fill(dependency.partitioner.numPartitions) { 2 }, dependency, 0) + pusher.runPendingTasks() + verify(shuffleClient, times(1)) + .pushBlocks(any(), any(), any(), any(), any()) + assert(pushedBlocks.isEmpty) + } + + test("Connect exceptions remove all the push requests for that host") { + when(dependency.getMergerLocs).thenReturn( + Seq(BlockManagerId("client1", "client1", 1), BlockManagerId("client2", "client2", 2))) + conf.set("spark.reducer.maxBlocksInFlightPerAddress", "2") + when(shuffleClient.pushBlocks(any(), any(), any(), any(), any())) + .thenAnswer((invocation: InvocationOnMock) => { + val blocks = invocation.getArguments()(2).asInstanceOf[Array[String]] + pushedBlocks ++= blocks + val blockFetchListener = invocation.getArguments()(4).asInstanceOf[BlockFetchingListener] + blocks.foreach(blockId => { + blockFetchListener.onBlockFetchFailure( + blockId, new RuntimeException(new ConnectException())) + }) + }) + val pusher = new TestShuffleBlockPusher(conf) + pusher.initiateBlockPush( + mock(classOf[File]), Array.fill(dependency.partitioner.numPartitions) { 2 }, dependency, 0) + pusher.runPendingTasks() + verify(shuffleClient, times(2)) + .pushBlocks(any(), any(), any(), any(), any()) + // 2 blocks for each merger locations + assert(pushedBlocks.length == 4) + assert(pusher.unreachableBlockMgrs.size == 2) + } + + private class TestShuffleBlockPusher(conf: SparkConf) extends ShuffleBlockPusher(conf) { + private[this] val tasks = new LinkedBlockingQueue[Runnable] + + override protected def submitTask(task: Runnable): Unit = { + tasks.add(task) + } + + def runPendingTasks(): Unit = { + // This ensures that all the submitted tasks - updateStateAndCheckIfPushMore and pushUpToMax + // are run synchronously. + while (!tasks.isEmpty) { + tasks.take().run() + } + } + + override protected def createRequestBuffer( + conf: TransportConf, + dataFile: File, + offset: Long, + length: Long): ManagedBuffer = { + val managedBuffer = mock(classOf[ManagedBuffer]) + val byteBuffer = new Array[Byte](length.toInt) + when(managedBuffer.nioByteBuffer()).thenReturn(ByteBuffer.wrap(byteBuffer)) + managedBuffer + } + } +} diff --git a/core/src/test/scala/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriterSuite.scala b/core/src/test/scala/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriterSuite.scala index f8474022867f4..7fd0bf626fda1 100644 --- a/core/src/test/scala/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriterSuite.scala +++ b/core/src/test/scala/org/apache/spark/shuffle/sort/BypassMergeSortShuffleWriterSuite.scala @@ -59,7 +59,7 @@ class BypassMergeSortShuffleWriterSuite extends SparkFunSuite with BeforeAndAfte override def beforeEach(): Unit = { super.beforeEach() - MockitoAnnotations.initMocks(this) + MockitoAnnotations.openMocks(this).close() tempDir = Utils.createTempDir() outputFile = File.createTempFile("shuffle", null, tempDir) taskMetrics = new TaskMetrics diff --git a/core/src/test/scala/org/apache/spark/shuffle/sort/IndexShuffleBlockResolverSuite.scala b/core/src/test/scala/org/apache/spark/shuffle/sort/IndexShuffleBlockResolverSuite.scala index 27bb06b4e0636..da98ad3d1c982 100644 --- a/core/src/test/scala/org/apache/spark/shuffle/sort/IndexShuffleBlockResolverSuite.scala +++ b/core/src/test/scala/org/apache/spark/shuffle/sort/IndexShuffleBlockResolverSuite.scala @@ -27,7 +27,7 @@ import org.mockito.invocation.InvocationOnMock import org.scalatest.BeforeAndAfterEach import org.apache.spark.{SparkConf, SparkFunSuite} -import org.apache.spark.shuffle.IndexShuffleBlockResolver +import org.apache.spark.shuffle.{IndexShuffleBlockResolver, ShuffleBlockInfo} import org.apache.spark.storage._ import org.apache.spark.util.Utils @@ -43,11 +43,12 @@ class IndexShuffleBlockResolverSuite extends SparkFunSuite with BeforeAndAfterEa override def beforeEach(): Unit = { super.beforeEach() tempDir = Utils.createTempDir() - MockitoAnnotations.initMocks(this) + MockitoAnnotations.openMocks(this).close() when(blockManager.diskBlockManager).thenReturn(diskBlockManager) when(diskBlockManager.getFile(any[BlockId])).thenAnswer( (invocation: InvocationOnMock) => new File(tempDir, invocation.getArguments.head.toString)) + when(diskBlockManager.localDirs).thenReturn(Array(tempDir)) } override def afterEach(): Unit = { @@ -155,4 +156,9 @@ class IndexShuffleBlockResolverSuite extends SparkFunSuite with BeforeAndAfterEa indexIn2.close() } } + + test("SPARK-33198 getMigrationBlocks should not fail at missing files") { + val resolver = new IndexShuffleBlockResolver(conf, blockManager) + assert(resolver.getMigrationBlocks(ShuffleBlockInfo(Int.MaxValue, Long.MaxValue)).isEmpty) + } } diff --git a/core/src/test/scala/org/apache/spark/shuffle/sort/SortShuffleManagerSuite.scala b/core/src/test/scala/org/apache/spark/shuffle/sort/SortShuffleManagerSuite.scala index e5f3aab6a6a1a..f75db20808bee 100644 --- a/core/src/test/scala/org/apache/spark/shuffle/sort/SortShuffleManagerSuite.scala +++ b/core/src/test/scala/org/apache/spark/shuffle/sort/SortShuffleManagerSuite.scala @@ -20,7 +20,7 @@ package org.apache.spark.shuffle.sort import org.mockito.Mockito.{mock, when} import org.mockito.invocation.InvocationOnMock import org.mockito.stubbing.Answer -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers import org.apache.spark._ import org.apache.spark.serializer.{JavaSerializer, KryoSerializer, Serializer} diff --git a/core/src/test/scala/org/apache/spark/shuffle/sort/SortShuffleWriterSuite.scala b/core/src/test/scala/org/apache/spark/shuffle/sort/SortShuffleWriterSuite.scala index 4c5694fcf0305..4c679fd874c9b 100644 --- a/core/src/test/scala/org/apache/spark/shuffle/sort/SortShuffleWriterSuite.scala +++ b/core/src/test/scala/org/apache/spark/shuffle/sort/SortShuffleWriterSuite.scala @@ -20,7 +20,7 @@ package org.apache.spark.shuffle.sort import org.mockito.{Mock, MockitoAnnotations} import org.mockito.Answers.RETURNS_SMART_NULLS import org.mockito.Mockito._ -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers import org.apache.spark.{Partitioner, SharedSparkContext, ShuffleDependency, SparkFunSuite} import org.apache.spark.memory.MemoryTestingUtils @@ -46,7 +46,7 @@ class SortShuffleWriterSuite extends SparkFunSuite with SharedSparkContext with override def beforeEach(): Unit = { super.beforeEach() - MockitoAnnotations.initMocks(this) + MockitoAnnotations.openMocks(this).close() val partitioner = new Partitioner() { def numPartitions = numMaps def getPartition(key: Any) = Utils.nonNegativeMod(key.hashCode, numPartitions) @@ -74,7 +74,6 @@ class SortShuffleWriterSuite extends SparkFunSuite with SharedSparkContext with test("write empty iterator") { val context = MemoryTestingUtils.fakeTaskContext(sc.env) val writer = new SortShuffleWriter[Int, Int, Int]( - shuffleBlockResolver, shuffleHandle, mapId = 1, context, @@ -92,7 +91,6 @@ class SortShuffleWriterSuite extends SparkFunSuite with SharedSparkContext with val context = MemoryTestingUtils.fakeTaskContext(sc.env) val records = List[(Int, Int)]((1, 2), (2, 3), (4, 4), (6, 5)) val writer = new SortShuffleWriter[Int, Int, Int]( - shuffleBlockResolver, shuffleHandle, mapId = 2, context, diff --git a/core/src/test/scala/org/apache/spark/shuffle/sort/io/LocalDiskShuffleMapOutputWriterSuite.scala b/core/src/test/scala/org/apache/spark/shuffle/sort/io/LocalDiskShuffleMapOutputWriterSuite.scala index f92455912f510..ef5c615bf7591 100644 --- a/core/src/test/scala/org/apache/spark/shuffle/sort/io/LocalDiskShuffleMapOutputWriterSuite.scala +++ b/core/src/test/scala/org/apache/spark/shuffle/sort/io/LocalDiskShuffleMapOutputWriterSuite.scala @@ -65,7 +65,7 @@ class LocalDiskShuffleMapOutputWriterSuite extends SparkFunSuite with BeforeAndA } override def beforeEach(): Unit = { - MockitoAnnotations.initMocks(this) + MockitoAnnotations.openMocks(this).close() tempDir = Utils.createTempDir() mergedOutputFile = File.createTempFile("mergedoutput", "", tempDir) tempFile = File.createTempFile("tempfile", "", tempDir) @@ -136,7 +136,7 @@ class LocalDiskShuffleMapOutputWriterSuite extends SparkFunSuite with BeforeAndA } private def verifyWrittenRecords(): Unit = { - val committedLengths = mapOutputWriter.commitAllPartitions() + val committedLengths = mapOutputWriter.commitAllPartitions().getPartitionLengths assert(partitionSizesInMergedFile === partitionLengths) assert(committedLengths === partitionLengths) assert(mergedOutputFile.length() === partitionLengths.sum) diff --git a/core/src/test/scala/org/apache/spark/status/AppStatusListenerSuite.scala b/core/src/test/scala/org/apache/spark/status/AppStatusListenerSuite.scala index 24eb1685f577a..424b328ce3106 100644 --- a/core/src/test/scala/org/apache/spark/status/AppStatusListenerSuite.scala +++ b/core/src/test/scala/org/apache/spark/status/AppStatusListenerSuite.scala @@ -234,7 +234,7 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter { // Send two executor metrics update. Only update one metric to avoid a lot of boilerplate code. // The tasks are distributed among the two executors, so the executor-level metrics should - // hold half of the cummulative value of the metric being updated. + // hold half of the cumulative value of the metric being updated. Seq(1L, 2L).foreach { value => s1Tasks.foreach { task => val accum = new AccumulableInfo(1L, Some(InternalAccumulator.MEMORY_BYTES_SPILLED), @@ -256,9 +256,9 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter { } } - // Blacklisting executor for stage + // Excluding executor for stage time += 1 - listener.onExecutorBlacklistedForStage(SparkListenerExecutorBlacklistedForStage( + listener.onExecutorExcludedForStage(SparkListenerExecutorExcludedForStage( time = time, executorId = execIds.head, taskFailures = 2, @@ -273,18 +273,21 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter { assert(executorStageSummaryWrappers.nonEmpty) executorStageSummaryWrappers.foreach { exec => - // only the first executor is expected to be blacklisted - val expectedBlacklistedFlag = exec.executorId == execIds.head - assert(exec.info.isBlacklistedForStage === expectedBlacklistedFlag) + // only the first executor is expected to be excluded + val expectedExcludedFlag = exec.executorId == execIds.head + assert(exec.info.isBlacklistedForStage === expectedExcludedFlag) + assert(exec.info.isExcludedForStage === expectedExcludedFlag) } check[ExecutorSummaryWrapper](execIds.head) { exec => assert(exec.info.blacklistedInStages === Set(stages.head.stageId)) + assert(exec.info.excludedInStages === Set(stages.head.stageId)) + } - // Blacklisting node for stage + // Excluding node for stage time += 1 - listener.onNodeBlacklistedForStage(SparkListenerNodeBlacklistedForStage( + listener.onNodeExcludedForStage(SparkListenerNodeExcludedForStage( time = time, hostId = "2.example.com", // this is where the second executor is hosted executorFailures = 1, @@ -299,8 +302,10 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter { assert(executorStageSummaryWrappersForNode.nonEmpty) executorStageSummaryWrappersForNode.foreach { exec => - // both executor is expected to be blacklisted + // both executor is expected to be excluded assert(exec.info.isBlacklistedForStage) + assert(exec.info.isExcludedForStage) + } // Fail one of the tasks, re-start it. @@ -450,6 +455,7 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter { check[ExecutorSummaryWrapper](execIds.head) { exec => assert(exec.info.blacklistedInStages === Set()) + assert(exec.info.excludedInStages === Set()) } // Submit stage 2. @@ -466,9 +472,9 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter { assert(stage.info.submissionTime === Some(new Date(stages.last.submissionTime.get))) } - // Blacklisting node for stage + // Excluding node for stage time += 1 - listener.onNodeBlacklistedForStage(SparkListenerNodeBlacklistedForStage( + listener.onNodeExcludedForStage(SparkListenerNodeExcludedForStage( time = time, hostId = "1.example.com", executorFailures = 1, @@ -477,6 +483,7 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter { check[ExecutorSummaryWrapper](execIds.head) { exec => assert(exec.info.blacklistedInStages === Set(stages.last.stageId)) + assert(exec.info.excludedInStages === Set(stages.last.stageId)) } // Start and fail all tasks of stage 2. @@ -628,30 +635,34 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter { assert(job.info.numSkippedTasks === s1Tasks.size) } - // Blacklist an executor. + // Exclude an executor. time += 1 - listener.onExecutorBlacklisted(SparkListenerExecutorBlacklisted(time, "1", 42)) + listener.onExecutorExcluded(SparkListenerExecutorExcluded(time, "1", 42)) check[ExecutorSummaryWrapper]("1") { exec => assert(exec.info.isBlacklisted) + assert(exec.info.isExcluded) } time += 1 - listener.onExecutorUnblacklisted(SparkListenerExecutorUnblacklisted(time, "1")) + listener.onExecutorUnexcluded(SparkListenerExecutorUnexcluded(time, "1")) check[ExecutorSummaryWrapper]("1") { exec => assert(!exec.info.isBlacklisted) + assert(!exec.info.isExcluded) } - // Blacklist a node. + // Exclude a node. time += 1 - listener.onNodeBlacklisted(SparkListenerNodeBlacklisted(time, "1.example.com", 2)) + listener.onNodeExcluded(SparkListenerNodeExcluded(time, "1.example.com", 2)) check[ExecutorSummaryWrapper]("1") { exec => assert(exec.info.isBlacklisted) + assert(exec.info.isExcluded) } time += 1 - listener.onNodeUnblacklisted(SparkListenerNodeUnblacklisted(time, "1.example.com")) + listener.onNodeUnexcluded(SparkListenerNodeUnexcluded(time, "1.example.com")) check[ExecutorSummaryWrapper]("1") { exec => assert(!exec.info.isBlacklisted) + assert(!exec.info.isExcluded) } // Stop executors. @@ -1523,14 +1534,32 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter { assert(exec.info.id === id) exec.info.peakMemoryMetrics match { case Some(actual) => - ExecutorMetricType.metricToOffset.foreach { metric => - assert(actual.getMetricValue(metric._1) === metrics.getMetricValue(metric._1)) - } + checkExecutorMetrics(metrics, actual) case _ => assert(false) } } } + + // check stage level executor metrics + val expectedStageValues = Map( + 0 -> StageExecutorMetrics( + new ExecutorMetrics(Array(7000L, 80L, 50L, 20L, 50L, 10L, 100L, 30L, + 80L, 40L, 9000L, 4000L, 8000L, 3000L, 7000L, 2000L)), + Map( + "1" -> new ExecutorMetrics(Array(5000L, 50L, 50L, 20L, 50L, 10L, 100L, 30L, + 70L, 20L, 8000L, 4000L, 7000L, 3000L, 6000L, 2000L)), + "2" -> new ExecutorMetrics(Array(7000L, 80L, 50L, 20L, 10L, 10L, 50L, 30L, + 80L, 40L, 9000L, 4000L, 8000L, 3000L, 7000L, 2000L)))), + 1 -> StageExecutorMetrics( + new ExecutorMetrics(Array(7000L, 70L, 25L, 40L, 60L, 30L, 70L, 60L, + 40L, 20L, 8000L, 5000L, 7000L, 4000L, 6000L, 3000L)), + Map( + "1" -> new ExecutorMetrics(Array(7000L, 70L, 20L, 30L, 60L, 30L, 70L, 55L, + 30L, 0L, 5000L, 3000L, 4000L, 2000L, 3000L, 1000L)), + "2" -> new ExecutorMetrics(Array(5500L, 40L, 25L, 40L, 10L, 30L, 35L, 60L, + 40L, 20L, 8000L, 5000L, 7000L, 4000L, 6000L, 3000L))))) + checkStageExecutorMetrics(expectedStageValues) } test("stage executor metrics") { @@ -1573,14 +1602,74 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter { assert(exec.info.id === id) exec.info.peakMemoryMetrics match { case Some(actual) => - ExecutorMetricType.metricToOffset.foreach { metric => - assert(actual.getMetricValue(metric._1) === metrics.getMetricValue(metric._1)) - } + checkExecutorMetrics(metrics, actual) case _ => assert(false) } } } + + // check stage level executor metrics + val expectedStageValues = Map( + 0 -> StageExecutorMetrics( + new ExecutorMetrics(Array(7000L, 70L, 50L, 20L, 50L, 10L, 100L, 30L, + 80L, 40L, 9000L, 4000L, 8000L, 3000L, 7000L, 2000L)), + Map( + "1" -> new ExecutorMetrics(Array(5000L, 50L, 50L, 20L, 50L, 10L, 100L, 30L, + 70L, 20L, 8000L, 4000L, 7000L, 3000L, 6000L, 2000L)), + "2" -> new ExecutorMetrics(Array(7000L, 70L, 50L, 20L, 10L, 10L, 50L, 30L, + 80L, 40L, 9000L, 4000L, 8000L, 3000L, 7000L, 2000L)))), + 1 -> StageExecutorMetrics( + new ExecutorMetrics(Array(7000L, 80L, 50L, 40L, 60L, 30L, 80L, 60L, + 50L, 40L, 8000L, 5000L, 7000L, 4000L, 6000L, 3000L)), + Map( + "1" -> new ExecutorMetrics(Array(7000L, 70L, 50L, 30L, 60L, 30L, 80L, 55L, + 50L, 0L, 5000L, 3000L, 4000L, 2000L, 3000L, 1000L)), + "2" -> new ExecutorMetrics(Array(7000L, 80L, 50L, 40L, 10L, 30L, 50L, 60L, + 40L, 40L, 8000L, 5000L, 7000L, 4000L, 6000L, 3000L))))) + checkStageExecutorMetrics(expectedStageValues) + } + + /** expected stage executor metrics */ + private case class StageExecutorMetrics( + peakExecutorMetrics: ExecutorMetrics, + executorMetrics: Map[String, ExecutorMetrics]) + + private def checkExecutorMetrics(expected: ExecutorMetrics, actual: ExecutorMetrics): Unit = { + ExecutorMetricType.metricToOffset.foreach { metric => + assert(actual.getMetricValue(metric._1) === expected.getMetricValue(metric._1)) + } + } + + /** check stage level peak executor metric values, and executor peak values for each stage */ + private def checkStageExecutorMetrics(expectedStageValues: Map[Int, StageExecutorMetrics]) = { + // check stage level peak executor metric values for each stage + for ((stageId, expectedMetrics) <- expectedStageValues) { + check[StageDataWrapper](Array(stageId, 0)) { stage => + stage.info.peakExecutorMetrics match { + case Some(actual) => + checkExecutorMetrics(expectedMetrics.peakExecutorMetrics, actual) + case None => + assert(false) + } + } + } + + // check peak executor metric values for each stage and executor + val stageExecSummaries = store.view(classOf[ExecutorStageSummaryWrapper]).asScala.toSeq + stageExecSummaries.foreach { exec => + expectedStageValues.get(exec.stageId) match { + case Some(stageValue) => + (stageValue.executorMetrics.get(exec.executorId), exec.info.peakMemoryMetrics) match { + case (Some(expected), Some(actual)) => + checkExecutorMetrics(expected, actual) + case _ => + assert(false) + } + case None => + assert(false) + } + } } test("storage information on executor lost/down") { @@ -1707,6 +1796,44 @@ class AppStatusListenerSuite extends SparkFunSuite with BeforeAndAfter { } } + test("SPARK-34877 - check YarnAmInfoEvent is populated correctly") { + def checkInfoPopulated(listener: AppStatusListener, + logUrlMap: Map[String, String], processId: String): Unit = { + val yarnAmInfo = listener.liveMiscellaneousProcess.get(processId) + assert(yarnAmInfo.isDefined) + yarnAmInfo.foreach { info => + assert(info.processId == processId) + assert(info.isActive) + assert(info.processLogs == logUrlMap) + } + check[ProcessSummaryWrapper](processId) { process => + assert(process.info.id === processId) + assert(process.info.isActive) + assert(process.info.processLogs == logUrlMap) + } + } + val processId = "yarn-am" + val listener = new AppStatusListener(store, conf, true) + var stdout = "http:yarnAmHost:2453/con1/stdout" + var stderr = "http:yarnAmHost:2453/con2/stderr" + var logUrlMap: Map[String, String] = Map("stdout" -> stdout, + "stderr" -> stderr) + var hostport = "yarnAmHost:2453" + var info = new MiscellaneousProcessDetails(hostport, 1, logUrlMap) + listener.onOtherEvent(SparkListenerMiscellaneousProcessAdded(123678L, processId, info)) + checkInfoPopulated(listener, logUrlMap, processId) + + // Launch new AM in case of failure + // New container entry will be updated in this scenario + stdout = "http:yarnAmHost:2451/con1/stdout" + stderr = "http:yarnAmHost:2451/con2/stderr" + logUrlMap = Map("stdout" -> stdout, + "stderr" -> stderr) + hostport = "yarnAmHost:2451" + info = new MiscellaneousProcessDetails(hostport, 1, logUrlMap) + listener.onOtherEvent(SparkListenerMiscellaneousProcessAdded(123678L, processId, info)) + checkInfoPopulated(listener, logUrlMap, processId) + } private def key(stage: StageInfo): Array[Int] = Array(stage.stageId, stage.attemptNumber) diff --git a/core/src/test/scala/org/apache/spark/status/ElementTrackingStoreSuite.scala b/core/src/test/scala/org/apache/spark/status/ElementTrackingStoreSuite.scala index 38e88e6a012c4..98d528b621605 100644 --- a/core/src/test/scala/org/apache/spark/status/ElementTrackingStoreSuite.scala +++ b/core/src/test/scala/org/apache/spark/status/ElementTrackingStoreSuite.scala @@ -20,8 +20,8 @@ package org.apache.spark.status import java.util.concurrent.atomic.{AtomicBoolean, AtomicInteger} import org.mockito.Mockito._ -import org.scalatest.Matchers._ import org.scalatest.concurrent.Eventually +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.{SparkConf, SparkFunSuite} import org.apache.spark.internal.config.Status._ @@ -35,8 +35,8 @@ class ElementTrackingStoreSuite extends SparkFunSuite with Eventually { val tracking = new ElementTrackingStore(store, new SparkConf() .set(ASYNC_TRACKING_ENABLED, true)) - var done = new AtomicBoolean(false) - var type1 = new AtomicInteger(0) + val done = new AtomicBoolean(false) + val type1 = new AtomicInteger(0) var queued0: WriteQueueResult = null var queued1: WriteQueueResult = null var queued2: WriteQueueResult = null diff --git a/core/src/test/scala/org/apache/spark/status/api/v1/ExecutorSummarySuite.scala b/core/src/test/scala/org/apache/spark/status/api/v1/ExecutorSummarySuite.scala new file mode 100644 index 0000000000000..541a7821a51fb --- /dev/null +++ b/core/src/test/scala/org/apache/spark/status/api/v1/ExecutorSummarySuite.scala @@ -0,0 +1,53 @@ +/* + * 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. + */ +package org.apache.spark.status.api.v1 + +import java.util.Date + +import com.fasterxml.jackson.core.`type`.TypeReference +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.module.scala.DefaultScalaModule + +import org.apache.spark.SparkFunSuite + +class ExecutorSummarySuite extends SparkFunSuite { + + test("Check ExecutorSummary serialize and deserialize with empty peakMemoryMetrics") { + val mapper = new ObjectMapper().registerModule(DefaultScalaModule) + val executorSummary = new ExecutorSummary("id", "host:port", true, 1, + 10, 10, 1, 1, 1, + 0, 0, 1, 100, + 1, 100, 100, + 10, false, 20, new Date(1600984336352L), + Option.empty, Option.empty, Map(), Option.empty, Set(), Option.empty, Map(), Map(), 1, + false, Set()) + val expectedJson = "{\"id\":\"id\",\"hostPort\":\"host:port\",\"isActive\":true," + + "\"rddBlocks\":1,\"memoryUsed\":10,\"diskUsed\":10,\"totalCores\":1,\"maxTasks\":1," + + "\"activeTasks\":1,\"failedTasks\":0,\"completedTasks\":0,\"totalTasks\":1," + + "\"totalDuration\":100,\"totalGCTime\":1,\"totalInputBytes\":100," + + "\"totalShuffleRead\":100,\"totalShuffleWrite\":10,\"isBlacklisted\":false," + + "\"maxMemory\":20,\"addTime\":1600984336352,\"removeTime\":null,\"removeReason\":null," + + "\"executorLogs\":{},\"memoryMetrics\":null,\"blacklistedInStages\":[]," + + "\"peakMemoryMetrics\":null,\"attributes\":{},\"resources\":{},\"resourceProfileId\":1," + + "\"isExcluded\":false,\"excludedInStages\":[]}" + val json = mapper.writeValueAsString(executorSummary) + assert(expectedJson.equals(json)) + val deserializeExecutorSummary = mapper.readValue(json, new TypeReference[ExecutorSummary] {}) + assert(deserializeExecutorSummary.peakMemoryMetrics == None) + } + +} diff --git a/core/src/test/scala/org/apache/spark/status/api/v1/SimpleDateParamSuite.scala b/core/src/test/scala/org/apache/spark/status/api/v1/SimpleDateParamSuite.scala index 18baeb1cb9c71..ff2060e278465 100644 --- a/core/src/test/scala/org/apache/spark/status/api/v1/SimpleDateParamSuite.scala +++ b/core/src/test/scala/org/apache/spark/status/api/v1/SimpleDateParamSuite.scala @@ -18,7 +18,8 @@ package org.apache.spark.status.api.v1 import javax.ws.rs.WebApplicationException -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.SparkFunSuite diff --git a/core/src/test/scala/org/apache/spark/storage/BlockIdSuite.scala b/core/src/test/scala/org/apache/spark/storage/BlockIdSuite.scala index ef7b13875540f..d7009e6ed5799 100644 --- a/core/src/test/scala/org/apache/spark/storage/BlockIdSuite.scala +++ b/core/src/test/scala/org/apache/spark/storage/BlockIdSuite.scala @@ -87,7 +87,7 @@ class BlockIdSuite extends SparkFunSuite { assert(id.shuffleId === 4) assert(id.mapId === 5) assert(id.reduceId === 6) - assert(!id.isShuffle) + assert(id.isShuffle) assertSame(id, BlockId(id.toString)) } @@ -100,7 +100,7 @@ class BlockIdSuite extends SparkFunSuite { assert(id.shuffleId === 7) assert(id.mapId === 8) assert(id.reduceId === 9) - assert(!id.isShuffle) + assert(id.isShuffle) assertSame(id, BlockId(id.toString)) } diff --git a/core/src/test/scala/org/apache/spark/storage/BlockInfoManagerSuite.scala b/core/src/test/scala/org/apache/spark/storage/BlockInfoManagerSuite.scala index 9c0699bc981f8..d2bf385e10796 100644 --- a/core/src/test/scala/org/apache/spark/storage/BlockInfoManagerSuite.scala +++ b/core/src/test/scala/org/apache/spark/storage/BlockInfoManagerSuite.scala @@ -19,7 +19,7 @@ package org.apache.spark.storage import java.util.Properties -import scala.concurrent.{Await, ExecutionContext, Future} +import scala.concurrent.{ExecutionContext, Future} import scala.language.implicitConversions import scala.reflect.ClassTag diff --git a/core/src/test/scala/org/apache/spark/storage/BlockManagerDecommissionIntegrationSuite.scala b/core/src/test/scala/org/apache/spark/storage/BlockManagerDecommissionIntegrationSuite.scala new file mode 100644 index 0000000000000..e461474294f38 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/storage/BlockManagerDecommissionIntegrationSuite.scala @@ -0,0 +1,334 @@ +/* + * 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. + */ + +package org.apache.spark.storage + +import java.util.concurrent.{ConcurrentHashMap, ConcurrentLinkedQueue, Semaphore, TimeUnit} + +import scala.collection.JavaConverters._ +import scala.collection.mutable.ArrayBuffer +import scala.concurrent.duration._ + +import org.scalatest.concurrent.Eventually + +import org.apache.spark._ +import org.apache.spark.internal.config +import org.apache.spark.scheduler._ +import org.apache.spark.scheduler.cluster.StandaloneSchedulerBackend +import org.apache.spark.util.{ResetSystemProperties, SystemClock, ThreadUtils} + +class BlockManagerDecommissionIntegrationSuite extends SparkFunSuite with LocalSparkContext + with ResetSystemProperties with Eventually { + + val numExecs = 3 + val numParts = 3 + val TaskStarted = "TASK_STARTED" + val TaskEnded = "TASK_ENDED" + val JobEnded = "JOB_ENDED" + + Seq(false, true).foreach { isEnabled => + test(s"SPARK-32850: BlockManager decommission should respect the configuration " + + s"(enabled=${isEnabled})") { + val conf = new SparkConf() + .setAppName("test-blockmanager-decommissioner") + .setMaster("local-cluster[2, 1, 1024]") + .set(config.DECOMMISSION_ENABLED, true) + .set(config.STORAGE_DECOMMISSION_ENABLED, isEnabled) + sc = new SparkContext(conf) + TestUtils.waitUntilExecutorsUp(sc, 2, 60000) + val executors = sc.getExecutorIds().toArray + val decommissionListener = new SparkListener { + override def onTaskStart(taskStart: SparkListenerTaskStart): Unit = { + // ensure Tasks launched at executors before they're marked as decommissioned by driver + Thread.sleep(3000) + sc.schedulerBackend.asInstanceOf[StandaloneSchedulerBackend] + .decommissionExecutors( + executors.map { id => (id, ExecutorDecommissionInfo("test")) }, + true, + false) + } + } + sc.addSparkListener(decommissionListener) + + val decommissionStatus: Seq[Boolean] = sc.parallelize(1 to 100, 2).mapPartitions { _ => + val startTime = System.currentTimeMillis() + while (SparkEnv.get.blockManager.decommissioner.isEmpty && + // wait at most 6 seconds for BlockManager to start to decommission (if enabled) + System.currentTimeMillis() - startTime < 6000) { + Thread.sleep(300) + } + val blockManagerDecommissionStatus = + if (SparkEnv.get.blockManager.decommissioner.isEmpty) false else true + Iterator.single(blockManagerDecommissionStatus) + }.collect() + assert(decommissionStatus.forall(_ == isEnabled)) + sc.removeSparkListener(decommissionListener) + } + } + + testRetry(s"verify that an already running task which is going to cache data succeeds " + + s"on a decommissioned executor after task start") { + runDecomTest(true, false, TaskStarted) + } + + test(s"verify that an already running task which is going to cache data succeeds " + + s"on a decommissioned executor after one task ends but before job ends") { + runDecomTest(true, false, TaskEnded) + } + + test(s"verify that shuffle blocks are migrated") { + runDecomTest(false, true, JobEnded) + } + + test(s"verify that both migrations can work at the same time") { + runDecomTest(true, true, JobEnded) + } + + private def runDecomTest( + persist: Boolean, + shuffle: Boolean, + whenToDecom: String): Unit = { + val migrateDuring = whenToDecom != JobEnded + val master = s"local-cluster[${numExecs}, 1, 1024]" + val conf = new SparkConf().setAppName("test").setMaster(master) + .set(config.DECOMMISSION_ENABLED, true) + .set(config.STORAGE_DECOMMISSION_ENABLED, true) + .set(config.STORAGE_DECOMMISSION_RDD_BLOCKS_ENABLED, persist) + .set(config.STORAGE_DECOMMISSION_SHUFFLE_BLOCKS_ENABLED, shuffle) + // Since we use the bus for testing we don't want to drop any messages + .set(config.LISTENER_BUS_EVENT_QUEUE_CAPACITY, 1000000) + // Just replicate blocks quickly during testing, there isn't another + // workload we need to worry about. + .set(config.STORAGE_DECOMMISSION_REPLICATION_REATTEMPT_INTERVAL, 10L) + + if (whenToDecom == TaskStarted) { + // We are using accumulators below, make sure those are reported frequently. + conf.set(config.EXECUTOR_HEARTBEAT_INTERVAL.key, "10ms") + } + sc = new SparkContext(master, "test", conf) + + // Wait for the executors to start + TestUtils.waitUntilExecutorsUp(sc = sc, + numExecutors = numExecs, + timeout = 60000) // 60s + + val input = sc.parallelize(1 to numParts, numParts) + val accum = sc.longAccumulator("mapperRunAccumulator") + + val sleepIntervalMs = whenToDecom match { + // Increase the window of time b/w task started and ended so that we can decom within that. + case TaskStarted => 10000 + // Make one task take a really short time so that we can decommission right after it is + // done but before its peers are done. + case TaskEnded => + if (TaskContext.getPartitionId() == 0) { + 100 + } else { + 1000 + } + // No sleep otherwise + case _ => 0 + } + + // Create a new RDD where we have sleep in each partition, we are also increasing + // the value of accumulator in each partition + val baseRdd = input.mapPartitions { x => + accum.add(1) + if (sleepIntervalMs > 0) { + Thread.sleep(sleepIntervalMs) + } + x.map(y => (y, y)) + } + val testRdd = shuffle match { + case true => baseRdd.reduceByKey(_ + _) + case false => baseRdd + } + + // Listen for the job & block updates + val executorRemovedSem = new Semaphore(0) + val taskEndEvents = new ConcurrentLinkedQueue[SparkListenerTaskEnd]() + val executorsActuallyStarted = new ConcurrentHashMap[String, Boolean]() + val blocksUpdated = ArrayBuffer.empty[SparkListenerBlockUpdated] + + def getCandidateExecutorToDecom: Option[String] = if (whenToDecom == TaskStarted) { + executorsActuallyStarted.keySet().asScala.headOption + } else { + taskEndEvents.asScala.filter(_.taskInfo.successful).map(_.taskInfo.executorId).headOption + } + + sc.addSparkListener(new SparkListener { + override def onExecutorRemoved(execRemoved: SparkListenerExecutorRemoved): Unit = { + executorRemovedSem.release() + } + + override def onTaskEnd(taskEnd: SparkListenerTaskEnd): Unit = { + taskEndEvents.add(taskEnd) + } + + override def onBlockUpdated(blockUpdated: SparkListenerBlockUpdated): Unit = synchronized { + blocksUpdated.append(blockUpdated) + } + + override def onExecutorMetricsUpdate( + executorMetricsUpdate: SparkListenerExecutorMetricsUpdate): Unit = { + val executorId = executorMetricsUpdate.execId + if (executorId != SparkContext.DRIVER_IDENTIFIER) { + val validUpdate = executorMetricsUpdate + .accumUpdates + .flatMap(_._4) + .exists { accumInfo => + accumInfo.name == accum.name && accumInfo.update.exists(_.asInstanceOf[Long] >= 1) + } + if (validUpdate) { + executorsActuallyStarted.put(executorId, java.lang.Boolean.TRUE) + } + } + } + }) + + // Cache the RDD lazily + if (persist) { + testRdd.persist() + } + + // Start the computation of RDD - this step will also cache the RDD + val asyncCount = testRdd.countAsync() + + // Make sure the job is either mid run or otherwise has data to migrate. + if (migrateDuring) { + // Wait for one of the tasks to succeed and finish writing its blocks. + // This way we know that this executor had real data to migrate when it is subsequently + // decommissioned below. + val intervalMs = if (whenToDecom == TaskStarted) { + 3.milliseconds + } else { + 10.milliseconds + } + eventually(timeout(20.seconds), interval(intervalMs)) { + assert(getCandidateExecutorToDecom.isDefined) + } + } else { + ThreadUtils.awaitResult(asyncCount, 1.minute) + } + + // Decommission one of the executors. + val sched = sc.schedulerBackend.asInstanceOf[StandaloneSchedulerBackend] + + val execToDecommission = getCandidateExecutorToDecom.get + logInfo(s"Decommissioning executor ${execToDecommission}") + + // Decommission executor and ensure it is not relaunched by setting adjustTargetNumExecutors + sched.decommissionExecutor( + execToDecommission, + ExecutorDecommissionInfo("", None), + adjustTargetNumExecutors = true) + val decomTime = new SystemClock().getTimeMillis() + + // Wait for job to finish. + val asyncCountResult = ThreadUtils.awaitResult(asyncCount, 1.minute) + assert(asyncCountResult === numParts) + // All tasks finished, so accum should have been increased numParts times. + assert(accum.value === numParts) + + sc.listenerBus.waitUntilEmpty() + val taskEndEventsCopy = taskEndEvents.asScala + if (shuffle) { + // mappers & reducers which succeeded + assert(taskEndEventsCopy.count(_.reason == Success) === 2 * numParts, + s"Expected ${2 * numParts} tasks got ${taskEndEvents.size} (${taskEndEvents})") + } else { + // only mappers which executed successfully + assert(taskEndEventsCopy.count(_.reason == Success) === numParts, + s"Expected ${numParts} tasks got ${taskEndEvents.size} (${taskEndEvents})") + } + + val minTaskEndTime = taskEndEventsCopy.map(_.taskInfo.finishTime).min + val maxTaskEndTime = taskEndEventsCopy.map(_.taskInfo.finishTime).max + + // Verify that the decom time matched our expectations + val decomAssertMsg = s"$whenToDecom: decomTime: $decomTime, minTaskEnd: $minTaskEndTime," + + s" maxTaskEnd: $maxTaskEndTime" + assert(minTaskEndTime <= maxTaskEndTime, decomAssertMsg) + whenToDecom match { + case TaskStarted => assert(minTaskEndTime > decomTime, decomAssertMsg) + case TaskEnded => assert(minTaskEndTime <= decomTime && + decomTime < maxTaskEndTime, decomAssertMsg) + case JobEnded => assert(maxTaskEndTime <= decomTime, decomAssertMsg) + } + + // Wait for our respective blocks to have migrated + eventually(timeout(1.minute), interval(10.milliseconds)) { + if (persist) { + // One of our blocks should have moved. + val rddUpdates = blocksUpdated.filter { update => + val blockId = update.blockUpdatedInfo.blockId + blockId.isRDD} + val blockLocs = rddUpdates.map { update => + (update.blockUpdatedInfo.blockId.name, + update.blockUpdatedInfo.blockManagerId)} + val blocksToManagers = blockLocs.groupBy(_._1).mapValues(_.size) + assert(blocksToManagers.exists(_._2 > 1), + s"We should have a block that has been on multiple BMs in rdds:\n ${rddUpdates} from:\n" + + s"${blocksUpdated}\n but instead we got:\n ${blocksToManagers}") + } + // If we're migrating shuffles we look for any shuffle block updates + // as there is no block update on the initial shuffle block write. + if (shuffle) { + val numDataLocs = blocksUpdated.count { update => + val blockId = update.blockUpdatedInfo.blockId + blockId.isInstanceOf[ShuffleDataBlockId] + } + val numIndexLocs = blocksUpdated.count { update => + val blockId = update.blockUpdatedInfo.blockId + blockId.isInstanceOf[ShuffleIndexBlockId] + } + assert(numDataLocs === 1, s"Expect shuffle data block updates in ${blocksUpdated}") + assert(numIndexLocs === 1, s"Expect shuffle index block updates in ${blocksUpdated}") + } + } + + // Since the RDD is cached or shuffled so further usage of same RDD should use the + // cached data. Original RDD partitions should not be recomputed i.e. accum + // should have same value like before + assert(testRdd.count() === numParts) + assert(accum.value === numParts) + + val storageStatus = sc.env.blockManager.master.getStorageStatus + val execIdToBlocksMapping = storageStatus.map( + status => (status.blockManagerId.executorId, status.blocks)).toMap + // No cached blocks should be present on executor which was decommissioned + assert( + !execIdToBlocksMapping.contains(execToDecommission) || + execIdToBlocksMapping(execToDecommission).keys.filter(_.isRDD).toSeq === Seq(), + "Cache blocks should be migrated") + if (persist) { + // There should still be all the RDD blocks cached + assert(execIdToBlocksMapping.values.flatMap(_.keys).count(_.isRDD) === numParts) + } + + // Wait for the executor to be removed automatically after migration. + // This is set to a high value since github actions is sometimes high latency + // but I've never seen this go for more than a minute. + assert(executorRemovedSem.tryAcquire(1, 5L, TimeUnit.MINUTES)) + + // Since the RDD is cached or shuffled so further usage of same RDD should use the + // cached data. Original RDD partitions should not be recomputed i.e. accum + // should have same value like before + assert(testRdd.count() === numParts) + assert(accum.value === numParts) + } +} diff --git a/core/src/test/scala/org/apache/spark/storage/BlockManagerDecommissionSuite.scala b/core/src/test/scala/org/apache/spark/storage/BlockManagerDecommissionSuite.scala deleted file mode 100644 index 7456ca7f02a2e..0000000000000 --- a/core/src/test/scala/org/apache/spark/storage/BlockManagerDecommissionSuite.scala +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.storage - -import java.util.concurrent.Semaphore - -import scala.collection.mutable.ArrayBuffer -import scala.concurrent.duration._ - -import org.apache.spark.{LocalSparkContext, SparkConf, SparkContext, SparkFunSuite, Success} -import org.apache.spark.internal.config -import org.apache.spark.scheduler.{SparkListener, SparkListenerTaskEnd, SparkListenerTaskStart} -import org.apache.spark.scheduler.cluster.StandaloneSchedulerBackend -import org.apache.spark.util.{ResetSystemProperties, ThreadUtils} - -class BlockManagerDecommissionSuite extends SparkFunSuite with LocalSparkContext - with ResetSystemProperties { - - override def beforeEach(): Unit = { - val conf = new SparkConf().setAppName("test") - .set(config.Worker.WORKER_DECOMMISSION_ENABLED, true) - .set(config.STORAGE_DECOMMISSION_ENABLED, true) - - sc = new SparkContext("local-cluster[2, 1, 1024]", "test", conf) - } - - test(s"verify that an already running task which is going to cache data succeeds " + - s"on a decommissioned executor") { - // Create input RDD with 10 partitions - val input = sc.parallelize(1 to 10, 10) - val accum = sc.longAccumulator("mapperRunAccumulator") - // Do a count to wait for the executors to be registered. - input.count() - - // Create a new RDD where we have sleep in each partition, we are also increasing - // the value of accumulator in each partition - val sleepyRdd = input.mapPartitions { x => - Thread.sleep(500) - accum.add(1) - x - } - - // Listen for the job - val sem = new Semaphore(0) - val taskEndEvents = ArrayBuffer.empty[SparkListenerTaskEnd] - sc.addSparkListener(new SparkListener { - override def onTaskStart(taskStart: SparkListenerTaskStart): Unit = { - sem.release() - } - - override def onTaskEnd(taskEnd: SparkListenerTaskEnd): Unit = { - taskEndEvents.append(taskEnd) - } - }) - - // Cache the RDD lazily - sleepyRdd.persist() - - // Start the computation of RDD - this step will also cache the RDD - val asyncCount = sleepyRdd.countAsync() - - // Wait for the job to have started - sem.acquire(1) - - // Give Spark a tiny bit to start the tasks after the listener says hello - Thread.sleep(100) - // Decommission one of the executor - val sched = sc.schedulerBackend.asInstanceOf[StandaloneSchedulerBackend] - val execs = sched.getExecutorIds() - assert(execs.size == 2, s"Expected 2 executors but found ${execs.size}") - val execToDecommission = execs.head - sched.decommissionExecutor(execToDecommission) - - // Wait for job to finish - val asyncCountResult = ThreadUtils.awaitResult(asyncCount, 6.seconds) - assert(asyncCountResult === 10) - // All 10 tasks finished, so accum should have been increased 10 times - assert(accum.value === 10) - - // All tasks should be successful, nothing should have failed - sc.listenerBus.waitUntilEmpty() - assert(taskEndEvents.size === 10) // 10 mappers - assert(taskEndEvents.map(_.reason).toSet === Set(Success)) - - // Since the RDD is cached, so further usage of same RDD should use the - // cached data. Original RDD partitions should not be recomputed i.e. accum - // should have same value like before - assert(sleepyRdd.count() === 10) - assert(accum.value === 10) - } -} diff --git a/core/src/test/scala/org/apache/spark/storage/BlockManagerDecommissionUnitSuite.scala b/core/src/test/scala/org/apache/spark/storage/BlockManagerDecommissionUnitSuite.scala new file mode 100644 index 0000000000000..b7ac378b4c6cd --- /dev/null +++ b/core/src/test/scala/org/apache/spark/storage/BlockManagerDecommissionUnitSuite.scala @@ -0,0 +1,308 @@ +/* + * 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. + */ + +package org.apache.spark.storage + +import scala.concurrent.duration._ + +import org.mockito.{ArgumentMatchers => mc} +import org.mockito.Mockito.{atLeast => least, mock, times, verify, when} +import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers + +import org.apache.spark._ +import org.apache.spark.internal.config +import org.apache.spark.network.BlockTransferService +import org.apache.spark.network.buffer.ManagedBuffer +import org.apache.spark.shuffle.{MigratableResolver, ShuffleBlockInfo} +import org.apache.spark.storage.BlockManagerMessages.ReplicateBlock + +class BlockManagerDecommissionUnitSuite extends SparkFunSuite with Matchers { + + private val bmPort = 12345 + + private val sparkConf = new SparkConf(false) + .set(config.STORAGE_DECOMMISSION_SHUFFLE_BLOCKS_ENABLED, true) + .set(config.STORAGE_DECOMMISSION_RDD_BLOCKS_ENABLED, true) + // Just replicate blocks quickly during testing, as there isn't another + // workload we need to worry about. + .set(config.STORAGE_DECOMMISSION_REPLICATION_REATTEMPT_INTERVAL, 10L) + + private def registerShuffleBlocks( + mockMigratableShuffleResolver: MigratableResolver, + ids: Set[(Int, Long, Int)]): Unit = { + + when(mockMigratableShuffleResolver.getStoredShuffles()) + .thenReturn(ids.map(triple => ShuffleBlockInfo(triple._1, triple._2)).toSeq) + + ids.foreach { case (shuffleId: Int, mapId: Long, reduceId: Int) => + when(mockMigratableShuffleResolver.getMigrationBlocks(mc.any())) + .thenReturn(List( + (ShuffleIndexBlockId(shuffleId, mapId, reduceId), mock(classOf[ManagedBuffer])), + (ShuffleDataBlockId(shuffleId, mapId, reduceId), mock(classOf[ManagedBuffer])))) + } + } + + /** + * Validate a given configuration with the mocks. + * The fail variable controls if we expect migration to fail, in which case we expect + * a constant Long.MaxValue timestamp. + */ + private def validateDecommissionTimestamps(conf: SparkConf, bm: BlockManager, + fail: Boolean = false, assertDone: Boolean = true) = { + // Verify the decommissioning manager timestamps and status + val bmDecomManager = new BlockManagerDecommissioner(conf, bm) + validateDecommissionTimestampsOnManager(bmDecomManager, fail, assertDone) + } + + private def validateDecommissionTimestampsOnManager(bmDecomManager: BlockManagerDecommissioner, + fail: Boolean = false, assertDone: Boolean = true, numShuffles: Option[Int] = None) = { + var previousTime: Option[Long] = None + try { + bmDecomManager.start() + eventually(timeout(100.second), interval(10.milliseconds)) { + val (currentTime, done) = bmDecomManager.lastMigrationInfo() + assert(!assertDone || done) + // Make sure the time stamp starts moving forward. + if (!fail) { + previousTime match { + case None => + previousTime = Some(currentTime) + assert(false) + case Some(t) => + assert(t < currentTime) + } + } else { + // If we expect migration to fail we should get the max value quickly. + assert(currentTime === Long.MaxValue) + } + numShuffles.foreach { s => + assert(bmDecomManager.numMigratedShuffles.get() === s) + } + } + if (!fail) { + // Wait 5 seconds and assert times keep moving forward. + Thread.sleep(5000) + val (currentTime, done) = bmDecomManager.lastMigrationInfo() + assert((!assertDone || done) && currentTime > previousTime.get) + } + } finally { + bmDecomManager.stop() + } + } + + test("test that with no blocks we finish migration") { + // Set up the mocks so we return empty + val bm = mock(classOf[BlockManager]) + val migratableShuffleBlockResolver = mock(classOf[MigratableResolver]) + when(migratableShuffleBlockResolver.getStoredShuffles()) + .thenReturn(Seq()) + when(bm.migratableResolver).thenReturn(migratableShuffleBlockResolver) + when(bm.getMigratableRDDBlocks()) + .thenReturn(Seq()) + when(bm.getPeers(mc.any())) + .thenReturn(Seq(BlockManagerId("exec2", "host2", 12345))) + + // Verify the decom manager handles this correctly + validateDecommissionTimestamps(sparkConf, bm) + } + + test("block decom manager with no migrations configured") { + val bm = mock(classOf[BlockManager]) + val migratableShuffleBlockResolver = mock(classOf[MigratableResolver]) + registerShuffleBlocks(migratableShuffleBlockResolver, Set((1, 1L, 1))) + when(bm.migratableResolver).thenReturn(migratableShuffleBlockResolver) + when(bm.getMigratableRDDBlocks()) + .thenReturn(Seq()) + when(bm.getPeers(mc.any())) + .thenReturn(Seq(BlockManagerId("exec2", "host2", 12345))) + + val badConf = new SparkConf(false) + .set(config.STORAGE_DECOMMISSION_SHUFFLE_BLOCKS_ENABLED, false) + .set(config.STORAGE_DECOMMISSION_RDD_BLOCKS_ENABLED, false) + .set(config.STORAGE_DECOMMISSION_REPLICATION_REATTEMPT_INTERVAL, 10L) + // Verify the decom manager handles this correctly + validateDecommissionTimestamps(badConf, bm, fail = true) + } + + test("block decom manager with no peers") { + // Set up the mocks so we return one shuffle block + val bm = mock(classOf[BlockManager]) + val migratableShuffleBlockResolver = mock(classOf[MigratableResolver]) + registerShuffleBlocks(migratableShuffleBlockResolver, Set((1, 1L, 1))) + when(bm.migratableResolver).thenReturn(migratableShuffleBlockResolver) + when(bm.getMigratableRDDBlocks()) + .thenReturn(Seq()) + when(bm.getPeers(mc.any())) + .thenReturn(Seq()) + + // Verify the decom manager handles this correctly + validateDecommissionTimestamps(sparkConf, bm, fail = true) + } + + + test("block decom manager with only shuffle files time moves forward") { + // Set up the mocks so we return one shuffle block + val bm = mock(classOf[BlockManager]) + val migratableShuffleBlockResolver = mock(classOf[MigratableResolver]) + registerShuffleBlocks(migratableShuffleBlockResolver, Set((1, 1L, 1))) + when(bm.migratableResolver).thenReturn(migratableShuffleBlockResolver) + when(bm.getMigratableRDDBlocks()) + .thenReturn(Seq()) + when(bm.getPeers(mc.any())) + .thenReturn(Seq(BlockManagerId("exec2", "host2", 12345))) + + // Verify the decom manager handles this correctly + validateDecommissionTimestamps(sparkConf, bm) + } + + test("block decom manager does not re-add removed shuffle files") { + // Set up the mocks so we return one shuffle block + val bm = mock(classOf[BlockManager]) + val migratableShuffleBlockResolver = mock(classOf[MigratableResolver]) + registerShuffleBlocks(migratableShuffleBlockResolver, Set()) + when(bm.migratableResolver).thenReturn(migratableShuffleBlockResolver) + when(bm.getMigratableRDDBlocks()) + .thenReturn(Seq()) + when(bm.getPeers(mc.any())) + .thenReturn(Seq(BlockManagerId("exec2", "host2", 12345))) + val bmDecomManager = new BlockManagerDecommissioner(sparkConf, bm) + bmDecomManager.migratingShuffles += ShuffleBlockInfo(10, 10) + + validateDecommissionTimestampsOnManager(bmDecomManager, fail = false, assertDone = false) + } + + test("block decom manager handles IO failures") { + // Set up the mocks so we return one shuffle block + val bm = mock(classOf[BlockManager]) + val migratableShuffleBlockResolver = mock(classOf[MigratableResolver]) + registerShuffleBlocks(migratableShuffleBlockResolver, Set((1, 1L, 1))) + when(bm.migratableResolver).thenReturn(migratableShuffleBlockResolver) + when(bm.getMigratableRDDBlocks()) + .thenReturn(Seq()) + when(bm.getPeers(mc.any())) + .thenReturn(Seq(BlockManagerId("exec2", "host2", 12345))) + + val blockTransferService = mock(classOf[BlockTransferService]) + // Simulate an ambiguous IO error (e.g. block could be gone, connection failed, etc.) + when(blockTransferService.uploadBlockSync( + mc.any(), mc.any(), mc.any(), mc.any(), mc.any(), mc.any(), mc.isNull())).thenThrow( + new java.io.IOException("boop") + ) + + when(bm.blockTransferService).thenReturn(blockTransferService) + + // Verify the decom manager handles this correctly + val bmDecomManager = new BlockManagerDecommissioner(sparkConf, bm) + validateDecommissionTimestampsOnManager(bmDecomManager, fail = false) + } + + test("block decom manager short circuits removed blocks") { + // Set up the mocks so we return one shuffle block + val bm = mock(classOf[BlockManager]) + val migratableShuffleBlockResolver = mock(classOf[MigratableResolver]) + // First call get blocks, then empty list simulating a delete. + when(migratableShuffleBlockResolver.getStoredShuffles()) + .thenReturn(Seq(ShuffleBlockInfo(1, 1))) + .thenReturn(Seq()) + when(migratableShuffleBlockResolver.getMigrationBlocks(mc.any())) + .thenReturn(List( + (ShuffleIndexBlockId(1, 1, 1), mock(classOf[ManagedBuffer])), + (ShuffleDataBlockId(1, 1, 1), mock(classOf[ManagedBuffer])))) + .thenReturn(List()) + + when(bm.migratableResolver).thenReturn(migratableShuffleBlockResolver) + when(bm.getMigratableRDDBlocks()) + .thenReturn(Seq()) + when(bm.getPeers(mc.any())) + .thenReturn(Seq(BlockManagerId("exec2", "host2", 12345))) + + val blockTransferService = mock(classOf[BlockTransferService]) + // Simulate an ambiguous IO error (e.g. block could be gone, connection failed, etc.) + when(blockTransferService.uploadBlockSync( + mc.any(), mc.any(), mc.any(), mc.any(), mc.any(), mc.any(), mc.isNull())).thenThrow( + new java.io.IOException("boop") + ) + + when(bm.blockTransferService).thenReturn(blockTransferService) + + // Verify the decom manager handles this correctly + val bmDecomManager = new BlockManagerDecommissioner(sparkConf, bm) + validateDecommissionTimestampsOnManager(bmDecomManager, fail = false, + numShuffles = Some(1)) + } + + test("test shuffle and cached rdd migration without any error") { + val blockTransferService = mock(classOf[BlockTransferService]) + val bm = mock(classOf[BlockManager]) + + val storedBlockId1 = RDDBlockId(0, 0) + val storedBlock1 = + new ReplicateBlock(storedBlockId1, Seq(BlockManagerId("replicaHolder", "host1", bmPort)), 1) + + val migratableShuffleBlockResolver = mock(classOf[MigratableResolver]) + registerShuffleBlocks(migratableShuffleBlockResolver, Set((1, 1L, 1))) + when(bm.getPeers(mc.any())) + .thenReturn(Seq(BlockManagerId("exec2", "host2", 12345))) + + when(bm.blockTransferService).thenReturn(blockTransferService) + when(bm.migratableResolver).thenReturn(migratableShuffleBlockResolver) + when(bm.getMigratableRDDBlocks()) + .thenReturn(Seq(storedBlock1)) + + val bmDecomManager = new BlockManagerDecommissioner(sparkConf, bm) + + try { + bmDecomManager.start() + + var previousRDDTime: Option[Long] = None + var previousShuffleTime: Option[Long] = None + + // We don't check that all blocks are migrated because out mock is always returning an RDD. + eventually(timeout(100.second), interval(10.milliseconds)) { + assert(bmDecomManager.shufflesToMigrate.isEmpty === true) + assert(bmDecomManager.numMigratedShuffles.get() === 1) + verify(bm, least(1)).replicateBlock( + mc.eq(storedBlockId1), mc.any(), mc.any(), mc.eq(Some(3))) + verify(blockTransferService, times(2)) + .uploadBlockSync(mc.eq("host2"), mc.eq(bmPort), mc.eq("exec2"), mc.any(), mc.any(), + mc.eq(StorageLevel.DISK_ONLY), mc.isNull()) + // Since we never "finish" the RDD blocks, make sure the time is always moving forward. + assert(bmDecomManager.rddBlocksLeft) + previousRDDTime match { + case None => + previousRDDTime = Some(bmDecomManager.lastRDDMigrationTime) + assert(false) + case Some(t) => + assert(bmDecomManager.lastRDDMigrationTime > t) + } + // Since we do eventually finish the shuffle blocks make sure the shuffle blocks complete + // and that the time keeps moving forward. + assert(!bmDecomManager.shuffleBlocksLeft) + previousShuffleTime match { + case None => + previousShuffleTime = Some(bmDecomManager.lastShuffleMigrationTime) + assert(false) + case Some(t) => + assert(bmDecomManager.lastShuffleMigrationTime > t) + } + } + } finally { + bmDecomManager.stop() + } + } +} diff --git a/core/src/test/scala/org/apache/spark/storage/BlockManagerInfoSuite.scala b/core/src/test/scala/org/apache/spark/storage/BlockManagerInfoSuite.scala index 01e3d6a46e709..3f5ffaa732f25 100644 --- a/core/src/test/scala/org/apache/spark/storage/BlockManagerInfoSuite.scala +++ b/core/src/test/scala/org/apache/spark/storage/BlockManagerInfoSuite.scala @@ -33,7 +33,7 @@ class BlockManagerInfoSuite extends SparkFunSuite { timeMs = 300, maxOnHeapMem = 10000, maxOffHeapMem = 20000, - slaveEndpoint = null, + storageEndpoint = null, if (svcEnabled) Some(new JHashMap[BlockId, BlockStatus]) else None) test(s"$testName externalShuffleServiceEnabled=$svcEnabled") { f(svcEnabled, bmInfo) diff --git a/core/src/test/scala/org/apache/spark/storage/BlockManagerReplicationSuite.scala b/core/src/test/scala/org/apache/spark/storage/BlockManagerReplicationSuite.scala index 660bfcfc48267..495747b2c7c11 100644 --- a/core/src/test/scala/org/apache/spark/storage/BlockManagerReplicationSuite.scala +++ b/core/src/test/scala/org/apache/spark/storage/BlockManagerReplicationSuite.scala @@ -26,8 +26,9 @@ import scala.language.implicitConversions import org.mockito.ArgumentMatchers.any import org.mockito.Mockito.{doAnswer, mock, spy, when} -import org.scalatest.{BeforeAndAfter, Matchers} +import org.scalatest.BeforeAndAfter import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers import org.apache.spark._ import org.apache.spark.broadcast.BroadcastManager @@ -54,7 +55,7 @@ trait BlockManagerReplicationBehavior extends SparkFunSuite protected var rpcEnv: RpcEnv = null protected var master: BlockManagerMaster = null protected lazy val securityMgr = new SecurityManager(conf) - protected lazy val bcastManager = new BroadcastManager(true, conf, securityMgr) + protected lazy val bcastManager = new BroadcastManager(true, conf) protected lazy val mapOutputTracker = new MapOutputTrackerMaster(conf, bcastManager, true) protected lazy val shuffleManager = new SortShuffleManager(conf) @@ -94,8 +95,6 @@ trait BlockManagerReplicationBehavior extends SparkFunSuite conf.set(MEMORY_STORAGE_FRACTION, 0.999) conf.set(STORAGE_UNROLL_MEMORY_THRESHOLD, 512L) - // to make a replication attempt to inactive store fail fast - conf.set("spark.core.connection.ack.wait.timeout", "1s") // to make cached peers refresh frequently conf.set(STORAGE_CACHED_PEERS_TTL, 10) @@ -103,7 +102,7 @@ trait BlockManagerReplicationBehavior extends SparkFunSuite val blockManagerInfo = new mutable.HashMap[BlockManagerId, BlockManagerInfo]() master = new BlockManagerMaster(rpcEnv.setupEndpoint("blockmanager", new BlockManagerMasterEndpoint(rpcEnv, true, conf, - new LiveListenerBus(conf), None, blockManagerInfo)), + new LiveListenerBus(conf), None, blockManagerInfo, mapOutputTracker)), rpcEnv.setupEndpoint("blockmanagerHeartbeat", new BlockManagerMasterHeartbeatEndpoint(rpcEnv, true, blockManagerInfo)), conf, true) allStores.clear() diff --git a/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala b/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala index bfef8f1ab29d8..707e1684f78fd 100644 --- a/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala +++ b/core/src/test/scala/org/apache/spark/storage/BlockManagerSuite.scala @@ -19,11 +19,12 @@ package org.apache.spark.storage import java.io.File import java.nio.ByteBuffer +import java.nio.file.Files import scala.collection.JavaConverters._ import scala.collection.mutable import scala.collection.mutable.ArrayBuffer -import scala.concurrent.Future +import scala.concurrent.{Future, TimeoutException} import scala.concurrent.duration._ import scala.language.implicitConversions import scala.reflect.ClassTag @@ -31,9 +32,11 @@ import scala.reflect.ClassTag import org.apache.commons.lang3.RandomUtils import org.mockito.{ArgumentCaptor, ArgumentMatchers => mc} import org.mockito.Mockito.{doAnswer, mock, never, spy, times, verify, when} -import org.scalatest._ +import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach, PrivateMethodTester} import org.scalatest.concurrent.{Signaler, ThreadSignaler, TimeLimits} import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark._ import org.apache.spark.broadcast.BroadcastManager @@ -49,10 +52,12 @@ import org.apache.spark.network.netty.{NettyBlockTransferService, SparkTransport import org.apache.spark.network.server.{NoOpRpcHandler, TransportServer, TransportServerBootstrap} import org.apache.spark.network.shuffle.{BlockFetchingListener, DownloadFileManager, ExecutorDiskUtils, ExternalBlockStoreClient} import org.apache.spark.network.shuffle.protocol.{BlockTransferMessage, RegisterExecutor} -import org.apache.spark.rpc.RpcEnv -import org.apache.spark.scheduler.{LiveListenerBus, SparkListenerBlockUpdated} +import org.apache.spark.rpc.{RpcCallContext, RpcEndpoint, RpcEnv} +import org.apache.spark.scheduler.{LiveListenerBus, MapStatus, MergeStatus, SparkListenerBlockUpdated} +import org.apache.spark.scheduler.cluster.{CoarseGrainedClusterMessages, CoarseGrainedSchedulerBackend} import org.apache.spark.security.{CryptoStreamUtils, EncryptionFunSuite} import org.apache.spark.serializer.{JavaSerializer, KryoSerializer, SerializerManager} +import org.apache.spark.shuffle.{MigratableResolver, ShuffleBlockInfo, ShuffleBlockResolver, ShuffleManager} import org.apache.spark.shuffle.sort.SortShuffleManager import org.apache.spark.storage.BlockManagerMessages._ import org.apache.spark.util._ @@ -60,7 +65,7 @@ import org.apache.spark.util.io.ChunkedByteBuffer class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterEach with PrivateMethodTester with LocalSparkContext with ResetSystemProperties - with EncryptionFunSuite with TimeLimits { + with EncryptionFunSuite with TimeLimits with BeforeAndAfterAll { import BlockManagerSuite._ @@ -69,11 +74,12 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE var conf: SparkConf = null val allStores = ArrayBuffer[BlockManager]() + val sortShuffleManagers = ArrayBuffer[SortShuffleManager]() var rpcEnv: RpcEnv = null var master: BlockManagerMaster = null var liveListenerBus: LiveListenerBus = null val securityMgr = new SecurityManager(new SparkConf(false)) - val bcastManager = new BroadcastManager(true, new SparkConf(false), securityMgr) + val bcastManager = new BroadcastManager(true, new SparkConf(false)) val mapOutputTracker = new MapOutputTrackerMaster(new SparkConf(false), bcastManager, true) val shuffleManager = new SortShuffleManager(new SparkConf(false)) @@ -93,6 +99,14 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE .set(MEMORY_STORAGE_FRACTION, 0.999) .set(Kryo.KRYO_SERIALIZER_BUFFER_SIZE.key, "1m") .set(STORAGE_UNROLL_MEMORY_THRESHOLD, 512L) + .set(Network.RPC_ASK_TIMEOUT, "5s") + .set(PUSH_BASED_SHUFFLE_ENABLED, true) + } + + private def makeSortShuffleManager(conf: Option[SparkConf] = None): SortShuffleManager = { + val newMgr = new SortShuffleManager(conf.getOrElse(new SparkConf(false))) + sortShuffleManagers += newMgr + newMgr } private def makeBlockManager( @@ -100,7 +114,8 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE name: String = SparkContext.DRIVER_IDENTIFIER, master: BlockManagerMaster = this.master, transferService: Option[BlockTransferService] = Option.empty, - testConf: Option[SparkConf] = None): BlockManager = { + testConf: Option[SparkConf] = None, + shuffleManager: ShuffleManager = shuffleManager): BlockManager = { val bmConf = testConf.map(_.setAll(conf.getAll)).getOrElse(conf) bmConf.set(TEST_MEMORY, maxMem) bmConf.set(MEMORY_OFFHEAP_SIZE, maxMem) @@ -130,15 +145,35 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE blockManager } + // Save modified system properties so that we can restore them after tests. + val originalArch = System.getProperty("os.arch") + val originalCompressedOops = System.getProperty(TEST_USE_COMPRESSED_OOPS_KEY) + + def reinitializeSizeEstimator(arch: String, useCompressedOops: String): Unit = { + def set(k: String, v: String): Unit = { + if (v == null) { + System.clearProperty(k) + } else { + System.setProperty(k, v) + } + } + set("os.arch", arch) + set(TEST_USE_COMPRESSED_OOPS_KEY, useCompressedOops) + val initialize = PrivateMethod[Unit](Symbol("initialize")) + SizeEstimator invokePrivate initialize() + } + override def beforeEach(): Unit = { super.beforeEach() // Set the arch to 64-bit and compressedOops to true to get a deterministic test-case - System.setProperty("os.arch", "amd64") + reinitializeSizeEstimator("amd64", "true") conf = new SparkConf(false) init(conf) - rpcEnv = RpcEnv.create("test", "localhost", 0, conf, securityMgr) + rpcEnv = RpcEnv.create("test", conf.get(config.DRIVER_HOST_ADDRESS), + conf.get(config.DRIVER_PORT), conf, securityMgr) conf.set(DRIVER_PORT, rpcEnv.address.port) + conf.set(DRIVER_HOST_ADDRESS, rpcEnv.address.host) // Mock SparkContext to reduce the memory usage of tests. It's fine since the only reason we // need to create a SparkContext is to initialize LiveListenerBus. @@ -149,19 +184,21 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE liveListenerBus = spy(new LiveListenerBus(conf)) master = spy(new BlockManagerMaster(rpcEnv.setupEndpoint("blockmanager", new BlockManagerMasterEndpoint(rpcEnv, true, conf, - liveListenerBus, None, blockManagerInfo)), + liveListenerBus, None, blockManagerInfo, mapOutputTracker)), rpcEnv.setupEndpoint("blockmanagerHeartbeat", new BlockManagerMasterHeartbeatEndpoint(rpcEnv, true, blockManagerInfo)), conf, true)) - - val initialize = PrivateMethod[Unit](Symbol("initialize")) - SizeEstimator invokePrivate initialize() } override def afterEach(): Unit = { + // Restore system properties and SizeEstimator to their original states. + reinitializeSizeEstimator(originalArch, originalCompressedOops) + try { conf = null allStores.foreach(_.stop()) allStores.clear() + sortShuffleManagers.foreach(_.stop()) + sortShuffleManagers.clear() rpcEnv.shutdown() rpcEnv.awaitTermination() rpcEnv = null @@ -172,11 +209,121 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE } } + override def afterAll(): Unit = { + try { + // Cleanup the reused items. + Option(bcastManager).foreach(_.stop()) + Option(mapOutputTracker).foreach(_.stop()) + Option(shuffleManager).foreach(_.stop()) + } finally { + super.afterAll() + } + } + private def stopBlockManager(blockManager: BlockManager): Unit = { allStores -= blockManager blockManager.stop() } + /** + * Setup driverEndpoint, executor-1(BlockManager), executor-2(BlockManager) to simulate + * the real cluster before the tests. Any requests from driver to executor-1 will be responded + * in time. However, any requests from driver to executor-2 will be timeouted, in order to test + * the specific handling of `TimeoutException`, which is raised at driver side. + * + * And, when `withLost` is true, we will not register the executor-2 to the driver. Therefore, + * it behaves like a lost executor in terms of driver's view. When `withLost` is false, we'll + * register the executor-2 normally. + */ + private def setupBlockManagerMasterWithBlocks(withLost: Boolean): Unit = { + // set up a simple DriverEndpoint which simply adds executorIds and + // checks whether a certain executorId has been added before. + val driverEndpoint = rpcEnv.setupEndpoint(CoarseGrainedSchedulerBackend.ENDPOINT_NAME, + new RpcEndpoint { + private val executorSet = mutable.HashSet[String]() + override val rpcEnv: RpcEnv = BlockManagerSuite.this.rpcEnv + override def receiveAndReply(context: RpcCallContext): PartialFunction[Any, Unit] = { + case CoarseGrainedClusterMessages.RegisterExecutor(executorId, _, _, _, _, _, _, _) => + executorSet += executorId + context.reply(true) + case CoarseGrainedClusterMessages.IsExecutorAlive(executorId) => + context.reply(executorSet.contains(executorId)) + } + } + ) + + def createAndRegisterBlockManager(timeout: Boolean): BlockManagerId = { + val id = if (timeout) "timeout" else "normal" + val bmRef = rpcEnv.setupEndpoint(s"bm-$id", new RpcEndpoint { + override val rpcEnv: RpcEnv = BlockManagerSuite.this.rpcEnv + private def reply[T](context: RpcCallContext, response: T): Unit = { + if (timeout) { + Thread.sleep(conf.getTimeAsMs(Network.RPC_ASK_TIMEOUT.key) + 1000) + } + context.reply(response) + } + + override def receiveAndReply(context: RpcCallContext): PartialFunction[Any, Unit] = { + case RemoveRdd(_) => reply(context, 1) + case RemoveBroadcast(_, _) => reply(context, 1) + case RemoveShuffle(_) => reply(context, true) + } + }) + val bmId = BlockManagerId(s"exec-$id", "localhost", 1234, None) + master.registerBlockManager(bmId, Array.empty, 2000, 0, bmRef) + } + + // set up normal bm1 + val bm1Id = createAndRegisterBlockManager(false) + // set up bm2, which intentionally takes more time than RPC_ASK_TIMEOUT to + // remove rdd/broadcast/shuffle in order to raise timeout error + val bm2Id = createAndRegisterBlockManager(true) + + driverEndpoint.askSync[Boolean](CoarseGrainedClusterMessages.RegisterExecutor( + bm1Id.executorId, null, bm1Id.host, 1, Map.empty, Map.empty, + Map.empty, 0)) + + if (!withLost) { + driverEndpoint.askSync[Boolean](CoarseGrainedClusterMessages.RegisterExecutor( + bm2Id.executorId, null, bm1Id.host, 1, Map.empty, Map.empty, Map.empty, 0)) + } + + eventually(timeout(5.seconds)) { + // make sure both bm1 and bm2 are registered at driver side BlockManagerMaster + verify(master, times(2)) + .registerBlockManager(mc.any(), mc.any(), mc.any(), mc.any(), mc.any()) + assert(driverEndpoint.askSync[Boolean]( + CoarseGrainedClusterMessages.IsExecutorAlive(bm1Id.executorId))) + assert(driverEndpoint.askSync[Boolean]( + CoarseGrainedClusterMessages.IsExecutorAlive(bm2Id.executorId)) === !withLost) + } + + // update RDD block info for bm1 and bm2 (Broadcast and shuffle don't report block + // locations to BlockManagerMaster) + master.updateBlockInfo(bm1Id, RDDBlockId(0, 0), StorageLevel.MEMORY_ONLY, 100, 0) + master.updateBlockInfo(bm2Id, RDDBlockId(0, 1), StorageLevel.MEMORY_ONLY, 100, 0) + } + + test("SPARK-32091: count failures from active executors when remove rdd/broadcast/shuffle") { + setupBlockManagerMasterWithBlocks(false) + // fail because bm2 will timeout and it's not lost anymore + assert(intercept[Exception](master.removeRdd(0, true)) + .getCause.isInstanceOf[TimeoutException]) + assert(intercept[Exception](master.removeBroadcast(0, true, true)) + .getCause.isInstanceOf[TimeoutException]) + assert(intercept[Exception](master.removeShuffle(0, true)) + .getCause.isInstanceOf[TimeoutException]) + } + + test("SPARK-32091: ignore failures from lost executors when remove rdd/broadcast/shuffle") { + setupBlockManagerMasterWithBlocks(true) + // succeed because bm1 will remove rdd/broadcast successfully and bm2 will + // timeout but ignored as it's lost + master.removeRdd(0, true) + master.removeBroadcast(0, true, true) + master.removeShuffle(0, true) + } + test("StorageLevel object caching") { val level1 = StorageLevel(false, false, false, 3) // this should return the same object as level1 @@ -1271,12 +1418,12 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE assert(store.master.getLocations("list1").size === 0) assert(store.master.getLocations("list2").size === 1) assert(store.master.getLocations("list3").size === 1) - assert(store.master.getBlockStatus("list1", askSlaves = false).size === 0) - assert(store.master.getBlockStatus("list2", askSlaves = false).size === 1) - assert(store.master.getBlockStatus("list3", askSlaves = false).size === 1) - assert(store.master.getBlockStatus("list1", askSlaves = true).size === 0) - assert(store.master.getBlockStatus("list2", askSlaves = true).size === 1) - assert(store.master.getBlockStatus("list3", askSlaves = true).size === 1) + assert(store.master.getBlockStatus("list1", askStorageEndpoints = false).size === 0) + assert(store.master.getBlockStatus("list2", askStorageEndpoints = false).size === 1) + assert(store.master.getBlockStatus("list3", askStorageEndpoints = false).size === 1) + assert(store.master.getBlockStatus("list1", askStorageEndpoints = true).size === 0) + assert(store.master.getBlockStatus("list2", askStorageEndpoints = true).size === 1) + assert(store.master.getBlockStatus("list3", askStorageEndpoints = true).size === 1) // This time don't tell master and see what happens. By LRU, only list5 and list6 remains. store.putIterator( @@ -1287,17 +1434,17 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE "list6", list.iterator, StorageLevel.MEMORY_ONLY, tellMaster = false) // getLocations should return nothing because the master is not informed - // getBlockStatus without asking slaves should have the same result - // getBlockStatus with asking slaves, however, should return the actual block statuses + // getBlockStatus without asking storage endpoints should have the same result + // getBlockStatus with asking storage endpoints, however, should return the actual statuses assert(store.master.getLocations("list4").size === 0) assert(store.master.getLocations("list5").size === 0) assert(store.master.getLocations("list6").size === 0) - assert(store.master.getBlockStatus("list4", askSlaves = false).size === 0) - assert(store.master.getBlockStatus("list5", askSlaves = false).size === 0) - assert(store.master.getBlockStatus("list6", askSlaves = false).size === 0) - assert(store.master.getBlockStatus("list4", askSlaves = true).size === 0) - assert(store.master.getBlockStatus("list5", askSlaves = true).size === 1) - assert(store.master.getBlockStatus("list6", askSlaves = true).size === 1) + assert(store.master.getBlockStatus("list4", askStorageEndpoints = false).size === 0) + assert(store.master.getBlockStatus("list5", askStorageEndpoints = false).size === 0) + assert(store.master.getBlockStatus("list6", askStorageEndpoints = false).size === 0) + assert(store.master.getBlockStatus("list4", askStorageEndpoints = true).size === 0) + assert(store.master.getBlockStatus("list5", askStorageEndpoints = true).size === 1) + assert(store.master.getBlockStatus("list6", askStorageEndpoints = true).size === 1) } test("get matching blocks") { @@ -1313,9 +1460,11 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE "list3", list.iterator, StorageLevel.MEMORY_AND_DISK, tellMaster = true) // getLocations and getBlockStatus should yield the same locations - assert(store.master.getMatchingBlockIds(_.toString.contains("list"), askSlaves = false).size + assert(store.master.getMatchingBlockIds( + _.toString.contains("list"), askStorageEndpoints = false).size === 3) - assert(store.master.getMatchingBlockIds(_.toString.contains("list1"), askSlaves = false).size + assert(store.master.getMatchingBlockIds( + _.toString.contains("list1"), askStorageEndpoints = false).size === 1) // insert some more blocks @@ -1327,9 +1476,13 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE "newlist3", list.iterator, StorageLevel.MEMORY_AND_DISK, tellMaster = false) // getLocations and getBlockStatus should yield the same locations - assert(store.master.getMatchingBlockIds(_.toString.contains("newlist"), askSlaves = false).size + assert( + store.master.getMatchingBlockIds( + _.toString.contains("newlist"), askStorageEndpoints = false).size === 1) - assert(store.master.getMatchingBlockIds(_.toString.contains("newlist"), askSlaves = true).size + assert( + store.master.getMatchingBlockIds( + _.toString.contains("newlist"), askStorageEndpoints = true).size === 3) val blockIds = Seq(RDDBlockId(1, 0), RDDBlockId(1, 1), RDDBlockId(2, 0)) @@ -1340,7 +1493,7 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE val matchedBlockIds = store.master.getMatchingBlockIds(_ match { case RDDBlockId(1, _) => true case _ => false - }, askSlaves = true) + }, askStorageEndpoints = true) assert(matchedBlockIds.toSet === Set(RDDBlockId(1, 0), RDDBlockId(1, 1))) } @@ -1559,12 +1712,12 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE val externalShuffleServicePort = StorageUtils.externalShuffleServicePort(conf) val port = store.blockTransferService.port val rack = Some("rack") - val blockManagerWithTopolgyInfo = BlockManagerId( + val blockManagerWithTopologyInfo = BlockManagerId( store.blockManagerId.executorId, store.blockManagerId.host, store.blockManagerId.port, rack) - store.blockManagerId = blockManagerWithTopolgyInfo + store.blockManagerId = blockManagerWithTopologyInfo val locations = Seq( BlockManagerId("executor4", otherHost, externalShuffleServicePort, rack), BlockManagerId("executor3", otherHost, port, rack), @@ -1706,13 +1859,26 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE verify(liveListenerBus, never()).post(SparkListenerBlockUpdated(BlockUpdatedInfo(updateInfo))) } + test("we reject putting blocks when we have the wrong shuffle resolver") { + val badShuffleManager = mock(classOf[ShuffleManager]) + val badShuffleResolver = mock(classOf[ShuffleBlockResolver]) + when(badShuffleManager.shuffleBlockResolver).thenReturn(badShuffleResolver) + val shuffleBlockId = ShuffleDataBlockId(0, 0, 0) + val bm = makeBlockManager(100, "exec1", shuffleManager = badShuffleManager) + val message = "message" + val exception = intercept[SparkException] { + bm.putBlockDataAsStream(shuffleBlockId, StorageLevel.DISK_ONLY, ClassTag(message.getClass)) + } + assert(exception.getMessage.contains("unsupported shuffle resolver")) + } + test("test decommission block manager should not be part of peers") { val exec1 = "exec1" val exec2 = "exec2" val exec3 = "exec3" - val store1 = makeBlockManager(800, exec1) - val store2 = makeBlockManager(800, exec2) - val store3 = makeBlockManager(800, exec3) + val store1 = makeBlockManager(1000, exec1) + val store2 = makeBlockManager(1000, exec2) + val store3 = makeBlockManager(1000, exec3) assert(master.getPeers(store3.blockManagerId).map(_.executorId).toSet === Set(exec1, exec2)) @@ -1727,9 +1893,9 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE } test("test decommissionRddCacheBlocks should offload all cached blocks") { - val store1 = makeBlockManager(800, "exec1") - val store2 = makeBlockManager(800, "exec2") - val store3 = makeBlockManager(800, "exec3") + val store1 = makeBlockManager(1000, "exec1") + val store2 = makeBlockManager(1000, "exec2") + val store3 = makeBlockManager(1000, "exec3") val data = new Array[Byte](4) val blockId = rdd(0, 0) @@ -1737,7 +1903,8 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE assert(master.getLocations(blockId).size === 2) assert(master.getLocations(blockId).contains(store1.blockManagerId)) - store1.decommissionRddCacheBlocks() + val decomManager = new BlockManagerDecommissioner(conf, store1) + decomManager.decommissionRddCacheBlocks() assert(master.getLocations(blockId).size === 2) assert(master.getLocations(blockId).toSet === Set(store2.blockManagerId, store3.blockManagerId)) @@ -1757,14 +1924,159 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE assert(master.getLocations(blockIdLarge) === Seq(store1.blockManagerId)) assert(master.getLocations(blockIdSmall) === Seq(store1.blockManagerId)) - store1.decommissionRddCacheBlocks() + val decomManager = new BlockManagerDecommissioner(conf, store1) + decomManager.decommissionRddCacheBlocks() // Smaller block offloaded to store2 assert(master.getLocations(blockIdSmall) === Seq(store2.blockManagerId)) // Larger block still present in store1 as it can't be offloaded assert(master.getLocations(blockIdLarge) === Seq(store1.blockManagerId)) } - class MockBlockTransferService(val maxFailures: Int) extends BlockTransferService { + private def testShuffleBlockDecommissioning(maxShuffleSize: Option[Int], willReject: Boolean) = { + maxShuffleSize.foreach{ size => + conf.set(STORAGE_DECOMMISSION_SHUFFLE_MAX_DISK_SIZE.key, s"${size}b") + } + val shuffleManager1 = makeSortShuffleManager(Some(conf)) + val bm1 = makeBlockManager(3500, "exec1", shuffleManager = shuffleManager1) + shuffleManager1.shuffleBlockResolver._blockManager = bm1 + + val shuffleManager2 = makeSortShuffleManager(Some(conf)) + val bm2 = makeBlockManager(3500, "exec2", shuffleManager = shuffleManager2) + shuffleManager2.shuffleBlockResolver._blockManager = bm2 + + val blockSize = 5 + val shuffleDataBlockContent = Array[Byte](0, 1, 2, 3, 4) + val shuffleData = ShuffleDataBlockId(0, 0, 0) + val shuffleData2 = ShuffleDataBlockId(1, 0, 0) + Files.write(bm1.diskBlockManager.getFile(shuffleData).toPath(), shuffleDataBlockContent) + Files.write(bm2.diskBlockManager.getFile(shuffleData2).toPath(), shuffleDataBlockContent) + val shuffleIndexBlockContent = Array[Byte](5, 6, 7, 8, 9) + val shuffleIndex = ShuffleIndexBlockId(0, 0, 0) + val shuffleIndex2 = ShuffleIndexBlockId(1, 0, 0) + Files.write(bm1.diskBlockManager.getFile(shuffleIndex).toPath(), shuffleIndexBlockContent) + Files.write(bm2.diskBlockManager.getFile(shuffleIndex2).toPath(), shuffleIndexBlockContent) + + mapOutputTracker.registerShuffle(0, 1, MergeStatus.SHUFFLE_PUSH_DUMMY_NUM_REDUCES) + val decomManager = new BlockManagerDecommissioner(conf, bm1) + try { + mapOutputTracker.registerMapOutput(0, 0, MapStatus(bm1.blockManagerId, Array(blockSize), 0)) + assert(mapOutputTracker.shuffleStatuses(0).mapStatuses(0).location === bm1.blockManagerId) + + val env = mock(classOf[SparkEnv]) + when(env.conf).thenReturn(conf) + SparkEnv.set(env) + + decomManager.refreshOffloadingShuffleBlocks() + + if (willReject) { + eventually(timeout(1.second), interval(10.milliseconds)) { + assert(mapOutputTracker.shuffleStatuses(0).mapStatuses(0).location === bm2.blockManagerId) + } + assert(Files.readAllBytes(bm2.diskBlockManager.getFile(shuffleData).toPath()) + === shuffleDataBlockContent) + assert(Files.readAllBytes(bm2.diskBlockManager.getFile(shuffleIndex).toPath()) + === shuffleIndexBlockContent) + } else { + Thread.sleep(1000) + assert(mapOutputTracker.shuffleStatuses(0).mapStatuses(0).location === bm1.blockManagerId) + } + } finally { + mapOutputTracker.unregisterShuffle(0) + // Avoid thread leak + decomManager.stopOffloadingShuffleBlocks() + } + } + + test("test migration of shuffle blocks during decommissioning - no limit") { + testShuffleBlockDecommissioning(None, true) + } + + test("test migration of shuffle blocks during decommissioning - larger limit") { + testShuffleBlockDecommissioning(Some(10000), true) + } + + test("[SPARK-34363]test migration of shuffle blocks during decommissioning - small limit") { + testShuffleBlockDecommissioning(Some(1), false) + } + + test("SPARK-32919: Shuffle push merger locations should be bounded with in" + + " spark.shuffle.push.retainedMergerLocations") { + assert(master.getShufflePushMergerLocations(10, Set.empty).isEmpty) + makeBlockManager(100, "execA", + transferService = Some(new MockBlockTransferService(10, "hostA"))) + makeBlockManager(100, "execB", + transferService = Some(new MockBlockTransferService(10, "hostB"))) + makeBlockManager(100, "execC", + transferService = Some(new MockBlockTransferService(10, "hostC"))) + makeBlockManager(100, "execD", + transferService = Some(new MockBlockTransferService(10, "hostD"))) + makeBlockManager(100, "execE", + transferService = Some(new MockBlockTransferService(10, "hostA"))) + assert(master.getShufflePushMergerLocations(10, Set.empty).size == 4) + assert(master.getShufflePushMergerLocations(10, Set.empty).map(_.host).sorted === + Seq("hostC", "hostD", "hostA", "hostB").sorted) + assert(master.getShufflePushMergerLocations(10, Set("hostB")).size == 3) + } + + test("SPARK-32919: Prefer active executor locations for shuffle push mergers") { + makeBlockManager(100, "execA", + transferService = Some(new MockBlockTransferService(10, "hostA"))) + makeBlockManager(100, "execB", + transferService = Some(new MockBlockTransferService(10, "hostB"))) + makeBlockManager(100, "execC", + transferService = Some(new MockBlockTransferService(10, "hostC"))) + makeBlockManager(100, "execD", + transferService = Some(new MockBlockTransferService(10, "hostD"))) + makeBlockManager(100, "execE", + transferService = Some(new MockBlockTransferService(10, "hostA"))) + assert(master.getShufflePushMergerLocations(5, Set.empty).size == 4) + + master.removeExecutor("execA") + master.removeExecutor("execE") + + assert(master.getShufflePushMergerLocations(3, Set.empty).size == 3) + assert(master.getShufflePushMergerLocations(3, Set.empty).map(_.host).sorted === + Seq("hostC", "hostB", "hostD").sorted) + assert(master.getShufflePushMergerLocations(4, Set.empty).map(_.host).sorted === + Seq("hostB", "hostA", "hostC", "hostD").sorted) + } + + test("SPARK-33387 Support ordered shuffle block migration") { + val blocks: Seq[ShuffleBlockInfo] = Seq( + ShuffleBlockInfo(1, 0L), + ShuffleBlockInfo(0, 1L), + ShuffleBlockInfo(0, 0L), + ShuffleBlockInfo(1, 1L)) + val sortedBlocks = blocks.sortBy(b => (b.shuffleId, b.mapId)) + + val resolver = mock(classOf[MigratableResolver]) + when(resolver.getStoredShuffles).thenReturn(blocks) + + val bm = mock(classOf[BlockManager]) + when(bm.migratableResolver).thenReturn(resolver) + when(bm.getPeers(mc.any())).thenReturn(Seq.empty) + + val decomManager = new BlockManagerDecommissioner(conf, bm) + decomManager.refreshOffloadingShuffleBlocks() + + assert(sortedBlocks.sameElements(decomManager.shufflesToMigrate.asScala.map(_._1))) + } + + test("SPARK-34193: Potential race condition during decommissioning with TorrentBroadcast") { + // Validate that we allow putting of broadcast blocks during decommissioning + val exec1 = "exec1" + + val store = makeBlockManager(1000, exec1) + master.decommissionBlockManagers(Seq(exec1)) + val a = new Array[Byte](1) + // Put a broadcast block, no exception + val broadcast0BlockId = BroadcastBlockId(0) + store.putSingle(broadcast0BlockId, a, StorageLevel.DISK_ONLY) + } + + class MockBlockTransferService( + val maxFailures: Int, + override val hostName: String = "MockBlockTransferServiceHost") extends BlockTransferService { var numCalls = 0 var tempFileManager: DownloadFileManager = null @@ -1782,8 +2094,6 @@ class BlockManagerSuite extends SparkFunSuite with Matchers with BeforeAndAfterE override def close(): Unit = {} - override def hostName: String = { "MockBlockTransferServiceHost" } - override def port: Int = { 63332 } override def uploadBlock( diff --git a/core/src/test/scala/org/apache/spark/storage/BlockReplicationPolicySuite.scala b/core/src/test/scala/org/apache/spark/storage/BlockReplicationPolicySuite.scala index 4000218e71a8b..9ce4acc75ec43 100644 --- a/core/src/test/scala/org/apache/spark/storage/BlockReplicationPolicySuite.scala +++ b/core/src/test/scala/org/apache/spark/storage/BlockReplicationPolicySuite.scala @@ -21,7 +21,8 @@ import scala.collection.mutable import scala.language.implicitConversions import scala.util.Random -import org.scalatest.{BeforeAndAfter, Matchers} +import org.scalatest.BeforeAndAfter +import org.scalatest.matchers.must.Matchers import org.apache.spark.{LocalSparkContext, SparkFunSuite} diff --git a/core/src/test/scala/org/apache/spark/storage/FallbackStorageSuite.scala b/core/src/test/scala/org/apache/spark/storage/FallbackStorageSuite.scala new file mode 100644 index 0000000000000..3e225fe7d2470 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/storage/FallbackStorageSuite.scala @@ -0,0 +1,291 @@ +/* + * 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. + */ +package org.apache.spark.storage + +import java.io.{DataOutputStream, File, FileOutputStream, IOException} +import java.nio.file.Files + +import scala.concurrent.duration._ + +import org.apache.hadoop.conf.Configuration +import org.mockito.{ArgumentMatchers => mc} +import org.mockito.Mockito.{mock, times, verify, when} +import org.scalatest.concurrent.Eventually.{eventually, interval, timeout} + +import org.apache.spark.{LocalSparkContext, SparkConf, SparkContext, SparkFunSuite, TestUtils} +import org.apache.spark.LocalSparkContext.withSpark +import org.apache.spark.internal.config._ +import org.apache.spark.launcher.SparkLauncher.{EXECUTOR_MEMORY, SPARK_MASTER} +import org.apache.spark.network.BlockTransferService +import org.apache.spark.network.buffer.ManagedBuffer +import org.apache.spark.scheduler.ExecutorDecommissionInfo +import org.apache.spark.scheduler.cluster.StandaloneSchedulerBackend +import org.apache.spark.shuffle.{IndexShuffleBlockResolver, ShuffleBlockInfo} +import org.apache.spark.shuffle.IndexShuffleBlockResolver.NOOP_REDUCE_ID +import org.apache.spark.util.Utils.tryWithResource + +class FallbackStorageSuite extends SparkFunSuite with LocalSparkContext { + + def getSparkConf(initialExecutor: Int = 1, minExecutor: Int = 1): SparkConf = { + new SparkConf(false) + .setAppName(getClass.getName) + .set(SPARK_MASTER, s"local-cluster[$initialExecutor,1,1024]") + .set(EXECUTOR_MEMORY, "1g") + .set(UI.UI_ENABLED, false) + .set(DYN_ALLOCATION_ENABLED, true) + .set(DYN_ALLOCATION_SHUFFLE_TRACKING_ENABLED, true) + .set(DYN_ALLOCATION_INITIAL_EXECUTORS, initialExecutor) + .set(DYN_ALLOCATION_MIN_EXECUTORS, minExecutor) + .set(DECOMMISSION_ENABLED, true) + .set(STORAGE_DECOMMISSION_ENABLED, true) + .set(STORAGE_DECOMMISSION_SHUFFLE_BLOCKS_ENABLED, true) + .set(STORAGE_DECOMMISSION_FALLBACK_STORAGE_PATH, + Files.createTempDirectory("tmp").toFile.getAbsolutePath + "/") + } + + test("fallback storage APIs - copy/exists") { + val conf = new SparkConf(false) + .set("spark.app.id", "testId") + .set(SHUFFLE_COMPRESS, false) + .set(STORAGE_DECOMMISSION_SHUFFLE_BLOCKS_ENABLED, true) + .set(STORAGE_DECOMMISSION_FALLBACK_STORAGE_PATH, + Files.createTempDirectory("tmp").toFile.getAbsolutePath + "/") + val fallbackStorage = new FallbackStorage(conf) + val bmm = new BlockManagerMaster(new NoopRpcEndpointRef(conf), null, conf, false) + + val bm = mock(classOf[BlockManager]) + val dbm = new DiskBlockManager(conf, false) + when(bm.diskBlockManager).thenReturn(dbm) + when(bm.master).thenReturn(bmm) + val resolver = new IndexShuffleBlockResolver(conf, bm) + when(bm.migratableResolver).thenReturn(resolver) + + resolver.getIndexFile(1, 1L).createNewFile() + resolver.getDataFile(1, 1L).createNewFile() + + val indexFile = resolver.getIndexFile(1, 2L) + tryWithResource(new FileOutputStream(indexFile)) { fos => + tryWithResource(new DataOutputStream(fos)) { dos => + dos.writeLong(0) + dos.writeLong(4) + } + } + + val dataFile = resolver.getDataFile(1, 2L) + tryWithResource(new FileOutputStream(dataFile)) { fos => + tryWithResource(new DataOutputStream(fos)) { dos => + dos.writeLong(0) + } + } + + fallbackStorage.copy(ShuffleBlockInfo(1, 1L), bm) + fallbackStorage.copy(ShuffleBlockInfo(1, 2L), bm) + + assert(fallbackStorage.exists(1, ShuffleIndexBlockId(1, 1L, NOOP_REDUCE_ID).name)) + assert(fallbackStorage.exists(1, ShuffleDataBlockId(1, 1L, NOOP_REDUCE_ID).name)) + assert(fallbackStorage.exists(1, ShuffleIndexBlockId(1, 2L, NOOP_REDUCE_ID).name)) + assert(fallbackStorage.exists(1, ShuffleDataBlockId(1, 2L, NOOP_REDUCE_ID).name)) + + // The files for shuffle 1 and map 1 are empty intentionally. + intercept[java.io.EOFException] { + FallbackStorage.read(conf, ShuffleBlockId(1, 1L, 0)) + } + FallbackStorage.read(conf, ShuffleBlockId(1, 2L, 0)) + } + + test("SPARK-34142: fallback storage API - cleanUp") { + withTempDir { dir => + Seq(true, false).foreach { cleanUp => + val appId = s"test$cleanUp" + val conf = new SparkConf(false) + .set("spark.app.id", appId) + .set(STORAGE_DECOMMISSION_FALLBACK_STORAGE_PATH, dir.getAbsolutePath + "/") + .set(STORAGE_DECOMMISSION_FALLBACK_STORAGE_CLEANUP, cleanUp) + + val location = new File(dir, appId) + assert(location.mkdir()) + assert(location.exists()) + FallbackStorage.cleanUp(conf, new Configuration()) + assert(location.exists() != cleanUp) + } + } + } + + test("migrate shuffle data to fallback storage") { + val conf = new SparkConf(false) + .set("spark.app.id", "testId") + .set(STORAGE_DECOMMISSION_SHUFFLE_BLOCKS_ENABLED, true) + .set(STORAGE_DECOMMISSION_FALLBACK_STORAGE_PATH, + Files.createTempDirectory("tmp").toFile.getAbsolutePath + "/") + + val ids = Set((1, 1L, 1)) + val bm = mock(classOf[BlockManager]) + val dbm = new DiskBlockManager(conf, false) + when(bm.diskBlockManager).thenReturn(dbm) + val indexShuffleBlockResolver = new IndexShuffleBlockResolver(conf, bm) + val indexFile = indexShuffleBlockResolver.getIndexFile(1, 1L) + val dataFile = indexShuffleBlockResolver.getDataFile(1, 1L) + indexFile.createNewFile() + dataFile.createNewFile() + + val resolver = mock(classOf[IndexShuffleBlockResolver]) + when(resolver.getStoredShuffles()) + .thenReturn(ids.map(triple => ShuffleBlockInfo(triple._1, triple._2)).toSeq) + ids.foreach { case (shuffleId: Int, mapId: Long, reduceId: Int) => + when(resolver.getMigrationBlocks(mc.any())) + .thenReturn(List( + (ShuffleIndexBlockId(shuffleId, mapId, reduceId), mock(classOf[ManagedBuffer])), + (ShuffleDataBlockId(shuffleId, mapId, reduceId), mock(classOf[ManagedBuffer])))) + when(resolver.getIndexFile(shuffleId, mapId)).thenReturn(indexFile) + when(resolver.getDataFile(shuffleId, mapId)).thenReturn(dataFile) + } + + when(bm.getPeers(mc.any())) + .thenReturn(Seq(FallbackStorage.FALLBACK_BLOCK_MANAGER_ID)) + val bmm = new BlockManagerMaster(new NoopRpcEndpointRef(conf), null, conf, false) + when(bm.master).thenReturn(bmm) + val blockTransferService = mock(classOf[BlockTransferService]) + when(blockTransferService.uploadBlockSync(mc.any(), mc.any(), mc.any(), mc.any(), mc.any(), + mc.any(), mc.any())).thenThrow(new IOException) + when(bm.blockTransferService).thenReturn(blockTransferService) + when(bm.migratableResolver).thenReturn(resolver) + when(bm.getMigratableRDDBlocks()).thenReturn(Seq()) + + val decommissioner = new BlockManagerDecommissioner(conf, bm) + + try { + decommissioner.start() + val fallbackStorage = new FallbackStorage(conf) + eventually(timeout(10.second), interval(1.seconds)) { + // uploadBlockSync is not used + verify(blockTransferService, times(1)) + .uploadBlockSync(mc.any(), mc.any(), mc.any(), mc.any(), mc.any(), mc.any(), mc.any()) + + Seq("shuffle_1_1_0.index", "shuffle_1_1_0.data").foreach { filename => + assert(fallbackStorage.exists(shuffleId = 1, filename)) + } + } + } finally { + decommissioner.stop() + } + } + + test("Upload from all decommissioned executors") { + sc = new SparkContext(getSparkConf(2, 2)) + withSpark(sc) { sc => + TestUtils.waitUntilExecutorsUp(sc, 2, 60000) + val rdd1 = sc.parallelize(1 to 10, 10) + val rdd2 = rdd1.map(x => (x % 2, 1)) + val rdd3 = rdd2.reduceByKey(_ + _) + assert(rdd3.count() === 2) + + // Decommission all + val sched = sc.schedulerBackend.asInstanceOf[StandaloneSchedulerBackend] + sc.getExecutorIds().foreach { + sched.decommissionExecutor(_, ExecutorDecommissionInfo(""), false) + } + + val files = Seq("shuffle_0_0_0.index", "shuffle_0_0_0.data") + val fallbackStorage = new FallbackStorage(sc.getConf) + // Uploading is not started yet. + files.foreach { file => assert(!fallbackStorage.exists(0, file)) } + + // Uploading is completed on decommissioned executors + eventually(timeout(20.seconds), interval(1.seconds)) { + files.foreach { file => assert(fallbackStorage.exists(0, file)) } + } + + // All executors are still alive. + assert(sc.getExecutorIds().size == 2) + } + } + + test("Upload multi stages") { + sc = new SparkContext(getSparkConf()) + withSpark(sc) { sc => + TestUtils.waitUntilExecutorsUp(sc, 1, 60000) + val rdd1 = sc.parallelize(1 to 10, 2) + val rdd2 = rdd1.map(x => (x % 2, 1)) + val rdd3 = rdd2.reduceByKey(_ + _) + val rdd4 = rdd3.sortByKey() + assert(rdd4.count() === 2) + + val shuffle0_files = Seq( + "shuffle_0_0_0.index", "shuffle_0_0_0.data", + "shuffle_0_1_0.index", "shuffle_0_1_0.data") + val shuffle1_files = Seq( + "shuffle_1_4_0.index", "shuffle_1_4_0.data", + "shuffle_1_5_0.index", "shuffle_1_5_0.data") + val fallbackStorage = new FallbackStorage(sc.getConf) + shuffle0_files.foreach { file => assert(!fallbackStorage.exists(0, file)) } + shuffle1_files.foreach { file => assert(!fallbackStorage.exists(1, file)) } + + // Decommission all + val sched = sc.schedulerBackend.asInstanceOf[StandaloneSchedulerBackend] + sc.getExecutorIds().foreach { + sched.decommissionExecutor(_, ExecutorDecommissionInfo(""), false) + } + + eventually(timeout(10.seconds), interval(1.seconds)) { + shuffle0_files.foreach { file => assert(fallbackStorage.exists(0, file)) } + shuffle1_files.foreach { file => assert(fallbackStorage.exists(1, file)) } + } + } + } + + Seq("lz4", "lzf", "snappy", "zstd").foreach { codec => + test(s"$codec - Newly added executors should access old data from remote storage") { + sc = new SparkContext(getSparkConf(2, 0).set(IO_COMPRESSION_CODEC, codec)) + withSpark(sc) { sc => + TestUtils.waitUntilExecutorsUp(sc, 2, 60000) + val rdd1 = sc.parallelize(1 to 10, 2) + val rdd2 = rdd1.map(x => (x % 2, 1)) + val rdd3 = rdd2.reduceByKey(_ + _) + assert(rdd3.collect() === Array((0, 5), (1, 5))) + + // Decommission all + val sched = sc.schedulerBackend.asInstanceOf[StandaloneSchedulerBackend] + sc.getExecutorIds().foreach { + sched.decommissionExecutor(_, ExecutorDecommissionInfo(""), false) + } + + // Make it sure that fallback storage are ready + val fallbackStorage = new FallbackStorage(sc.getConf) + eventually(timeout(10.seconds), interval(1.seconds)) { + Seq( + "shuffle_0_0_0.index", "shuffle_0_0_0.data", + "shuffle_0_1_0.index", "shuffle_0_1_0.data").foreach { file => + assert(fallbackStorage.exists(0, file)) + } + } + + // Since the data is safe, force to shrink down to zero executor + sc.getExecutorIds().foreach { id => + sched.killExecutor(id) + } + eventually(timeout(20.seconds), interval(1.seconds)) { + assert(sc.getExecutorIds().isEmpty) + } + + // Dynamic allocation will start new executors + assert(rdd3.collect() === Array((0, 5), (1, 5))) + assert(rdd3.sortByKey().count() == 2) + assert(sc.getExecutorIds().nonEmpty) + } + } + } +} diff --git a/core/src/test/scala/org/apache/spark/storage/FlatmapIteratorSuite.scala b/core/src/test/scala/org/apache/spark/storage/FlatmapIteratorSuite.scala index fc16fe362882c..e719c722d01d3 100644 --- a/core/src/test/scala/org/apache/spark/storage/FlatmapIteratorSuite.scala +++ b/core/src/test/scala/org/apache/spark/storage/FlatmapIteratorSuite.scala @@ -37,7 +37,7 @@ class FlatmapIteratorSuite extends SparkFunSuite with LocalSparkContext { val expand_size = 100 val data = sc.parallelize((1 to 5).toSeq). flatMap( x => Stream.range(0, expand_size)) - var persisted = data.persist(StorageLevel.DISK_ONLY) + val persisted = data.persist(StorageLevel.DISK_ONLY) assert(persisted.count()===500) assert(persisted.filter(_==1).count()===5) } @@ -48,7 +48,7 @@ class FlatmapIteratorSuite extends SparkFunSuite with LocalSparkContext { val expand_size = 100 val data = sc.parallelize((1 to 5).toSeq). flatMap(x => Stream.range(0, expand_size)) - var persisted = data.persist(StorageLevel.MEMORY_ONLY) + val persisted = data.persist(StorageLevel.MEMORY_ONLY) assert(persisted.count()===500) assert(persisted.filter(_==1).count()===5) } diff --git a/core/src/test/scala/org/apache/spark/storage/MemoryStoreSuite.scala b/core/src/test/scala/org/apache/spark/storage/MemoryStoreSuite.scala index ccd7e4b62ad9e..d6a4e5bb2b930 100644 --- a/core/src/test/scala/org/apache/spark/storage/MemoryStoreSuite.scala +++ b/core/src/test/scala/org/apache/spark/storage/MemoryStoreSuite.scala @@ -26,6 +26,7 @@ import org.scalatest._ import org.apache.spark._ import org.apache.spark.internal.config._ +import org.apache.spark.internal.config.Tests.TEST_USE_COMPRESSED_OOPS_KEY import org.apache.spark.memory.{MemoryMode, UnifiedMemoryManager} import org.apache.spark.serializer.{KryoSerializer, SerializerManager} import org.apache.spark.storage.memory.{BlockEvictionHandler, MemoryStore, PartiallySerializedBlock, PartiallyUnrolledIterator} @@ -38,7 +39,7 @@ class MemoryStoreSuite with BeforeAndAfterEach with ResetSystemProperties { - var conf: SparkConf = new SparkConf(false) + val conf: SparkConf = new SparkConf(false) .set(STORAGE_UNROLL_MEMORY_THRESHOLD, 512L) // Reuse a serializer across tests to avoid creating a new thread-local buffer on each test @@ -51,12 +52,34 @@ class MemoryStoreSuite implicit def StringToBlockId(value: String): BlockId = new TestBlockId(value) def rdd(rddId: Int, splitId: Int): RDDBlockId = RDDBlockId(rddId, splitId) + // Save modified system properties so that we can restore them after tests. + val originalArch = System.getProperty("os.arch") + val originalCompressedOops = System.getProperty(TEST_USE_COMPRESSED_OOPS_KEY) + + def reinitializeSizeEstimator(arch: String, useCompressedOops: String): Unit = { + def set(k: String, v: String): Unit = { + if (v == null) { + System.clearProperty(k) + } else { + System.setProperty(k, v) + } + } + set("os.arch", arch) + set(TEST_USE_COMPRESSED_OOPS_KEY, useCompressedOops) + val initialize = PrivateMethod[Unit](Symbol("initialize")) + SizeEstimator invokePrivate initialize() + } + override def beforeEach(): Unit = { super.beforeEach() // Set the arch to 64-bit and compressedOops to true to get a deterministic test-case - System.setProperty("os.arch", "amd64") - val initialize = PrivateMethod[Unit](Symbol("initialize")) - SizeEstimator invokePrivate initialize() + reinitializeSizeEstimator("amd64", "true") + } + + override def afterEach(): Unit = { + super.afterEach() + // Restore system properties and SizeEstimator to their original states. + reinitializeSizeEstimator(originalArch, originalCompressedOops) } def makeMemoryStore(maxMem: Long): (MemoryStore, BlockInfoManager) = { diff --git a/core/src/test/scala/org/apache/spark/storage/ShuffleBlockFetcherIteratorSuite.scala b/core/src/test/scala/org/apache/spark/storage/ShuffleBlockFetcherIteratorSuite.scala index 43917a5b83bb0..99c43b12d6553 100644 --- a/core/src/test/scala/org/apache/spark/storage/ShuffleBlockFetcherIteratorSuite.scala +++ b/core/src/test/scala/org/apache/spark/storage/ShuffleBlockFetcherIteratorSuite.scala @@ -66,6 +66,16 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT transfer } + private def createMockBlockManager(): BlockManager = { + val blockManager = mock(classOf[BlockManager]) + val localBmId = BlockManagerId("test-client", "test-local-host", 1) + doReturn(localBmId).when(blockManager).blockManagerId + // By default, the mock BlockManager returns None for hostLocalDirManager. One could + // still use initHostLocalDirManager() to specify a custom hostLocalDirManager. + doReturn(None).when(blockManager).hostLocalDirManager + blockManager + } + private def initHostLocalDirManager( blockManager: BlockManager, hostLocalDirs: Map[String, Array[String]]): Unit = { @@ -73,9 +83,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT val hostLocalDirManager = new HostLocalDirManager( futureExecutionContext = global, cacheSize = 1, - externalBlockStoreClient = mockExternalBlockStoreClient, - host = "localhost", - externalShuffleServicePort = 7337) + blockStoreClient = mockExternalBlockStoreClient) when(blockManager.hostLocalDirManager).thenReturn(Some(hostLocalDirManager)) when(mockExternalBlockStoreClient.getHostLocalDirs(any(), any(), any(), any())) @@ -116,9 +124,8 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT } test("successful 3 local + 4 host local + 2 remote reads") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-local-client", "test-local-host", 1) - doReturn(localBmId).when(blockManager).blockManagerId + val blockManager = createMockBlockManager() + val localBmId = blockManager.blockManagerId // Make sure blockManager.getBlockData would return the blocks val localBlocks = Map[BlockId, ManagedBuffer]( @@ -197,13 +204,11 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT // 2 remote blocks are read from the same block manager verify(transfer, times(1)).fetchBlocks(any(), any(), any(), any(), any(), any()) - assert(blockManager.hostLocalDirManager.get.getCachedHostLocalDirs().size === 1) + assert(blockManager.hostLocalDirManager.get.getCachedHostLocalDirs.size === 1) } test("error during accessing host local dirs for executors") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-local-client", "test-local-host", 1) - doReturn(localBmId).when(blockManager).blockManagerId + val blockManager = createMockBlockManager() val hostLocalBlocks = Map[BlockId, ManagedBuffer]( ShuffleBlockId(0, 1, 0) -> createMockManagedBuffer()) @@ -218,9 +223,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT val hostLocalDirManager = new HostLocalDirManager( futureExecutionContext = global, cacheSize = 1, - externalBlockStoreClient = mockExternalBlockStoreClient, - host = "localhost", - externalShuffleServicePort = 7337) + blockStoreClient = mockExternalBlockStoreClient) when(blockManager.hostLocalDirManager).thenReturn(Some(hostLocalDirManager)) when(mockExternalBlockStoreClient.getHostLocalDirs(any(), any(), any(), any())) @@ -256,10 +259,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT } test("Hit maxBytesInFlight limitation before maxBlocksInFlightPerAddress") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-client", "test-local-host", 1) - doReturn(localBmId).when(blockManager).blockManagerId - + val blockManager = createMockBlockManager() val remoteBmId1 = BlockManagerId("test-remote-client-1", "test-remote-host1", 1) val remoteBmId2 = BlockManagerId("test-remote-client-2", "test-remote-host2", 2) val blockId1 = ShuffleBlockId(0, 1, 0) @@ -301,10 +301,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT } test("Hit maxBlocksInFlightPerAddress limitation before maxBytesInFlight") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-client", "test-local-host", 1) - doReturn(localBmId).when(blockManager).blockManagerId - + val blockManager = createMockBlockManager() val remoteBmId = BlockManagerId("test-remote-client-1", "test-remote-host", 2) val blockId1 = ShuffleBlockId(0, 1, 0) val blockId2 = ShuffleBlockId(0, 2, 0) @@ -348,10 +345,8 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT } test("fetch continuous blocks in batch successful 3 local + 4 host local + 2 remote reads") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-client", "test-local-host", 1) - doReturn(localBmId).when(blockManager).blockManagerId - + val blockManager = createMockBlockManager() + val localBmId = blockManager.blockManagerId // Make sure blockManager.getBlockData would return the merged block val localBlocks = Seq[BlockId]( ShuffleBlockId(0, 0, 0), @@ -431,14 +426,11 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT verify(blockManager, times(1)) .getHostLocalShuffleData(any(), meq(Array("local-dir"))) - assert(blockManager.hostLocalDirManager.get.getCachedHostLocalDirs().size === 1) + assert(blockManager.hostLocalDirManager.get.getCachedHostLocalDirs.size === 1) } test("fetch continuous blocks in batch should respect maxBytesInFlight") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-client", "test-local-host", 1) - doReturn(localBmId).when(blockManager).blockManagerId - + val blockManager = createMockBlockManager() // Make sure remote blocks would return the merged block val remoteBmId1 = BlockManagerId("test-client-1", "test-client-1", 1) val remoteBmId2 = BlockManagerId("test-client-2", "test-client-2", 2) @@ -494,10 +486,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT } test("fetch continuous blocks in batch should respect maxBlocksInFlightPerAddress") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-client", "test-local-host", 1) - doReturn(localBmId).when(blockManager).blockManagerId - + val blockManager = createMockBlockManager() // Make sure remote blocks would return the merged block val remoteBmId = BlockManagerId("test-client-1", "test-client-1", 1) val remoteBlocks = Seq( @@ -549,10 +538,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT } test("release current unexhausted buffer in case the task completes early") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-client", "test-client", 1) - doReturn(localBmId).when(blockManager).blockManagerId - + val blockManager = createMockBlockManager() // Make sure remote blocks would return val remoteBmId = BlockManagerId("test-client-1", "test-client-1", 2) val blocks = Map[BlockId, ManagedBuffer]( @@ -617,10 +603,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT } test("fail all blocks if any of the remote request fails") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-client", "test-client", 1) - doReturn(localBmId).when(blockManager).blockManagerId - + val blockManager = createMockBlockManager() // Make sure remote blocks would return val remoteBmId = BlockManagerId("test-client-1", "test-client-1", 2) val blocks = Map[BlockId, ManagedBuffer]( @@ -707,10 +690,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT } test("retry corrupt blocks") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-client", "test-client", 1) - doReturn(localBmId).when(blockManager).blockManagerId - + val blockManager = createMockBlockManager() // Make sure remote blocks would return val remoteBmId = BlockManagerId("test-client-1", "test-client-1", 2) val blocks = Map[BlockId, ManagedBuffer]( @@ -785,9 +765,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT test("big blocks are also checked for corruption") { val streamLength = 10000L - val blockManager = mock(classOf[BlockManager]) - val localBlockManagerId = BlockManagerId("local-client", "local-client", 1) - doReturn(localBlockManagerId).when(blockManager).blockManagerId + val blockManager = createMockBlockManager() // This stream will throw IOException when the first byte is read val corruptBuffer1 = mockCorruptBuffer(streamLength, 0) @@ -906,10 +884,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT } test("retry corrupt blocks (disabled)") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-client", "test-client", 1) - doReturn(localBmId).when(blockManager).blockManagerId - + val blockManager = createMockBlockManager() // Make sure remote blocks would return val remoteBmId = BlockManagerId("test-client-1", "test-client-1", 2) val blocks = Map[BlockId, ManagedBuffer]( @@ -971,10 +946,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT test("Blocks should be shuffled to disk when size of the request is above the" + " threshold(maxReqSizeShuffleToMem).") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-client", "test-client", 1) - doReturn(localBmId).when(blockManager).blockManagerId - + val blockManager = createMockBlockManager() val diskBlockManager = mock(classOf[DiskBlockManager]) val tmpDir = Utils.createTempDir() doReturn{ @@ -1036,10 +1008,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT } test("fail zero-size blocks") { - val blockManager = mock(classOf[BlockManager]) - val localBmId = BlockManagerId("test-client", "test-client", 1) - doReturn(localBmId).when(blockManager).blockManagerId - + val blockManager = createMockBlockManager() // Make sure remote blocks would return val remoteBmId = BlockManagerId("test-client-1", "test-client-1", 2) val blocks = Map[BlockId, ManagedBuffer]( @@ -1047,7 +1016,7 @@ class ShuffleBlockFetcherIteratorSuite extends SparkFunSuite with PrivateMethodT ShuffleBlockId(0, 1, 0) -> createMockManagedBuffer() ) - val transfer = createMockTransfer(blocks.mapValues(_ => createMockManagedBuffer(0))) + val transfer = createMockTransfer(blocks.mapValues(_ => createMockManagedBuffer(0)).toMap) val blocksByAddress = Seq[(BlockManagerId, Seq[(BlockId, Long, Int)])]( (remoteBmId, blocks.keys.map(blockId => (blockId, 1L, 0)).toSeq)) diff --git a/core/src/test/scala/org/apache/spark/storage/TopologyMapperSuite.scala b/core/src/test/scala/org/apache/spark/storage/TopologyMapperSuite.scala index 0bc26adeeb443..03e27bfaf2d45 100644 --- a/core/src/test/scala/org/apache/spark/storage/TopologyMapperSuite.scala +++ b/core/src/test/scala/org/apache/spark/storage/TopologyMapperSuite.scala @@ -19,7 +19,8 @@ package org.apache.spark.storage import java.io.{File, FileOutputStream} -import org.scalatest.{BeforeAndAfter, Matchers} +import org.scalatest.BeforeAndAfter +import org.scalatest.matchers.must.Matchers import org.apache.spark._ import org.apache.spark.internal.config.STORAGE_REPLICATION_TOPOLOGY_FILE diff --git a/core/src/test/scala/org/apache/spark/ui/ChromeUISeleniumSuite.scala b/core/src/test/scala/org/apache/spark/ui/ChromeUISeleniumSuite.scala new file mode 100644 index 0000000000000..459af6748e0e0 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/ui/ChromeUISeleniumSuite.scala @@ -0,0 +1,49 @@ +/* + * 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. + */ + +package org.apache.spark.ui + +import org.openqa.selenium.{JavascriptExecutor, WebDriver} +import org.openqa.selenium.chrome.{ChromeDriver, ChromeOptions} + +import org.apache.spark.tags.ChromeUITest + +/** + * Selenium tests for the Spark Web UI with Chrome. + */ +@ChromeUITest +class ChromeUISeleniumSuite extends RealBrowserUISeleniumSuite("webdriver.chrome.driver") { + + override var webDriver: WebDriver with JavascriptExecutor = _ + + override def beforeAll(): Unit = { + super.beforeAll() + val chromeOptions = new ChromeOptions + chromeOptions.addArguments("--headless", "--disable-gpu") + webDriver = new ChromeDriver(chromeOptions) + } + + override def afterAll(): Unit = { + try { + if (webDriver != null) { + webDriver.quit() + } + } finally { + super.afterAll() + } + } +} diff --git a/core/src/test/scala/org/apache/spark/ui/RealBrowserUISeleniumSuite.scala b/core/src/test/scala/org/apache/spark/ui/RealBrowserUISeleniumSuite.scala new file mode 100644 index 0000000000000..3f296acdeb326 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/ui/RealBrowserUISeleniumSuite.scala @@ -0,0 +1,213 @@ +/* + * 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. + */ + +package org.apache.spark.ui + +import org.openqa.selenium.{By, JavascriptExecutor, WebDriver} +import org.scalatest.BeforeAndAfterAll +import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ +import org.scalatest.time.SpanSugar._ +import org.scalatestplus.selenium.WebBrowser + +import org.apache.spark._ +import org.apache.spark.LocalSparkContext.withSpark +import org.apache.spark.internal.config.MEMORY_OFFHEAP_SIZE +import org.apache.spark.internal.config.UI.{UI_ENABLED, UI_KILL_ENABLED, UI_PORT} +import org.apache.spark.util.CallSite + +/** + * Selenium tests for the Spark Web UI with real web browsers. + */ +abstract class RealBrowserUISeleniumSuite(val driverProp: String) + extends SparkFunSuite with WebBrowser with Matchers with BeforeAndAfterAll { + + implicit var webDriver: WebDriver with JavascriptExecutor + private val driverPropPrefix = "spark.test." + + override def beforeAll(): Unit = { + super.beforeAll() + assume( + sys.props(driverPropPrefix + driverProp) !== null, + "System property " + driverPropPrefix + driverProp + + " should be set to the corresponding driver path.") + sys.props(driverProp) = sys.props(driverPropPrefix + driverProp) + } + + override def afterAll(): Unit = { + sys.props.remove(driverProp) + super.afterAll() + } + + test("SPARK-31534: text for tooltip should be escaped") { + withSpark(newSparkContext()) { sc => + sc.setLocalProperty(CallSite.LONG_FORM, "collect at :25") + sc.setLocalProperty(CallSite.SHORT_FORM, "collect at :25") + sc.parallelize(1 to 10).collect + + eventually(timeout(10.seconds), interval(50.milliseconds)) { + goToUi(sc, "/jobs") + + val jobDesc = + webDriver.findElement(By.cssSelector("div[class='application-timeline-content']")) + jobDesc.getAttribute("data-title") should include ("collect at <console>:25") + + goToUi(sc, "/jobs/job/?id=0") + webDriver.get(sc.ui.get.webUrl.stripSuffix("/") + "/jobs/job/?id=0") + val stageDesc = webDriver.findElement(By.cssSelector("div[class='job-timeline-content']")) + stageDesc.getAttribute("data-title") should include ("collect at <console>:25") + + // Open DAG Viz. + webDriver.findElement(By.id("job-dag-viz")).click() + val nodeDesc = webDriver.findElement(By.cssSelector("g[class='node_0 node']")) + nodeDesc.getAttribute("name") should include ("collect at <console>:25") + } + } + } + + test("SPARK-31882: Link URL for Stage DAGs should not depend on paged table.") { + withSpark(newSparkContext()) { sc => + sc.parallelize(1 to 100).map(v => (v, v)).repartition(10).reduceByKey(_ + _).collect + + eventually(timeout(10.seconds), interval(50.microseconds)) { + val pathWithPagedTable = + "/jobs/job/?id=0&completedStage.page=2&completedStage.sort=Stage+Id&" + + "completedStage.desc=true&completedStage.pageSize=1#completed" + goToUi(sc, pathWithPagedTable) + + // Open DAG Viz. + webDriver.findElement(By.id("job-dag-viz")).click() + val stages = webDriver.findElements(By.cssSelector("svg[class='job'] > a")) + stages.size() should be (3) + + stages.get(0).getAttribute("href") should include ("/stages/stage/?id=0&attempt=0") + stages.get(1).getAttribute("href") should include ("/stages/stage/?id=1&attempt=0") + stages.get(2).getAttribute("href") should include ("/stages/stage/?id=2&attempt=0") + } + } + } + + test("SPARK-31886: Color barrier execution mode RDD correctly") { + withSpark(newSparkContext()) { sc => + sc.parallelize(1 to 10).barrier.mapPartitions(identity).repartition(1).collect() + + eventually(timeout(10.seconds), interval(50.milliseconds)) { + goToUi(sc, "/jobs/job/?id=0") + webDriver.findElement(By.id("job-dag-viz")).click() + + val stage0 = webDriver.findElement(By.cssSelector("g[id='graph_0']")) + val stage1 = webDriver.findElement(By.cssSelector("g[id='graph_1']")) + val barrieredOps = webDriver.findElements(By.className("barrier-rdd")).iterator() + + while (barrieredOps.hasNext) { + val barrieredOpId = barrieredOps.next().getAttribute("innerHTML") + val foundInStage0 = + stage0.findElements( + By.cssSelector("g.barrier.cluster.cluster_" + barrieredOpId)) + assert(foundInStage0.size === 1) + + val foundInStage1 = + stage1.findElements( + By.cssSelector("g.barrier.cluster.cluster_" + barrieredOpId)) + assert(foundInStage1.size === 0) + } + } + } + } + + test("Search text for paged tables should not be saved") { + withSpark(newSparkContext()) { sc => + sc.parallelize(1 to 10).collect + + eventually(timeout(10.seconds), interval(1.seconds)) { + val taskSearchBox = "$(\"input[aria-controls='active-tasks-table']\")" + goToUi(sc, "/stages/stage/?id=0&attempt=0") + // Wait for ajax loading done. + Thread.sleep(20) + setValueToSearchBox(taskSearchBox, "task1") + val taskSearchText = getTextFromSearchBox(taskSearchBox) + assert(taskSearchText === "task1") + + val executorSearchBox = "$(\"input[aria-controls='active-executors-table']\")" + goToUi(sc, "/executors") + Thread.sleep(20) + setValueToSearchBox(executorSearchBox, "executor1") + val executorSearchText = getTextFromSearchBox(executorSearchBox) + assert(executorSearchText === "executor1") + + goToUi(sc, "/stages/stage/?id=0&attempt=0") + Thread.sleep(20) + val revisitTaskSearchText = getTextFromSearchBox(taskSearchBox) + assert(revisitTaskSearchText === "") + + goToUi(sc, "/executors") + Thread.sleep(20) + val revisitExecutorSearchText = getTextFromSearchBox(executorSearchBox) + assert(revisitExecutorSearchText === "") + } + } + + def setValueToSearchBox(searchBox: String, text: String): Unit = { + webDriver.executeScript(s"$searchBox.val('$text');") + fireDataTable(searchBox) + } + + def getTextFromSearchBox(searchBox: String): String = { + webDriver.executeScript(s"return $searchBox.val();").toString + } + + def fireDataTable(searchBox: String): Unit = { + webDriver.executeScript( + s""" + |var keyEvent = $$.Event('keyup'); + |// 13 means enter key. + |keyEvent.keyCode = keyEvent.which = 13; + |$searchBox.trigger(keyEvent); + """.stripMargin) + } + } + + /** + * Create a test SparkContext with the SparkUI enabled. + * It is safe to `get` the SparkUI directly from the SparkContext returned here. + */ + private def newSparkContext( + killEnabled: Boolean = true, + master: String = "local", + additionalConfs: Map[String, String] = Map.empty): SparkContext = { + val conf = new SparkConf() + .setMaster(master) + .setAppName("test") + .set(UI_ENABLED, true) + .set(UI_PORT, 0) + .set(UI_KILL_ENABLED, killEnabled) + .set(MEMORY_OFFHEAP_SIZE.key, "64m") + additionalConfs.foreach { case (k, v) => conf.set(k, v) } + val sc = new SparkContext(conf) + assert(sc.ui.isDefined) + sc + } + + def goToUi(sc: SparkContext, path: String): Unit = { + goToUi(sc.ui.get, path) + } + + def goToUi(ui: SparkUI, path: String): Unit = { + go to (ui.webUrl.stripSuffix("/") + path) + } +} diff --git a/core/src/test/scala/org/apache/spark/ui/StagePageSuite.scala b/core/src/test/scala/org/apache/spark/ui/StagePageSuite.scala index 7711934cbe8a6..9f0b73f8132f8 100644 --- a/core/src/test/scala/org/apache/spark/ui/StagePageSuite.scala +++ b/core/src/test/scala/org/apache/spark/ui/StagePageSuite.scala @@ -17,7 +17,6 @@ package org.apache.spark.ui -import java.util.Locale import javax.servlet.http.HttpServletRequest import scala.xml.Node @@ -92,12 +91,15 @@ class StagePageSuite extends SparkFunSuite with LocalSparkContext { accumulatorUpdates = Seq(new UIAccumulableInfo(0L, "acc", None, "value")), tasks = None, executorSummary = None, - killedTasksSummary = Map.empty + killedTasksSummary = Map.empty, + ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID, + peakExecutorMetrics = None, + taskMetricsDistributions = None, + executorMetricsDistributions = None ) val taskTable = new TaskPagedTable( stageData, basePath = "/a/b/c", - currentTime = 0, pageSize = 10, sortColumn = "Index", desc = false, diff --git a/core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala b/core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala index 3ec9385116408..015f299fc6bdf 100644 --- a/core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala +++ b/core/src/test/scala/org/apache/spark/ui/UISeleniumSuite.scala @@ -24,16 +24,18 @@ import javax.servlet.http.{HttpServletRequest, HttpServletResponse} import scala.io.Source import scala.xml.Node +import com.gargoylesoftware.css.parser.CSSParseException import com.gargoylesoftware.htmlunit.DefaultCssErrorHandler import org.json4s._ import org.json4s.jackson.JsonMethods import org.openqa.selenium.{By, WebDriver} import org.openqa.selenium.htmlunit.HtmlUnitDriver -import org.scalatest._ +import org.scalatest.BeforeAndAfterAll import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.scalatest.time.SpanSugar._ import org.scalatestplus.selenium.WebBrowser -import org.w3c.css.sac.CSSParseException import org.apache.spark._ import org.apache.spark.LocalSparkContext._ @@ -44,28 +46,32 @@ import org.apache.spark.internal.config.Status._ import org.apache.spark.internal.config.UI._ import org.apache.spark.shuffle.FetchFailedException import org.apache.spark.status.api.v1.{JacksonMessageWriter, RDDDataDistribution, StageStatus} -import org.apache.spark.util.CallSite +import org.apache.spark.util.Utils private[spark] class SparkUICssErrorHandler extends DefaultCssErrorHandler { - private val cssWhiteList = List("bootstrap.min.css", "vis-timeline-graph2d.min.css") + /** + * Some libraries have warn/error messages that are too noisy for the tests; exclude them from + * normal error handling to avoid logging these. + */ + private val cssExcludeList = List("bootstrap.min.css", "vis-timeline-graph2d.min.css") - private def isInWhileList(uri: String): Boolean = cssWhiteList.exists(uri.endsWith) + private def isInExcludeList(uri: String): Boolean = cssExcludeList.exists(uri.endsWith) override def warning(e: CSSParseException): Unit = { - if (!isInWhileList(e.getURI)) { + if (!isInExcludeList(e.getURI)) { super.warning(e) } } override def fatalError(e: CSSParseException): Unit = { - if (!isInWhileList(e.getURI)) { + if (!isInExcludeList(e.getURI)) { super.fatalError(e) } } override def error(e: CSSParseException): Unit = { - if (!isInWhileList(e.getURI)) { + if (!isInExcludeList(e.getURI)) { super.error(e) } } @@ -118,6 +124,27 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser with Matchers with B sc } + test("all jobs page should be rendered even though we configure the scheduling mode to fair") { + // Regression test for SPARK-33991 + val conf = Map("spark.scheduler.mode" -> "fair") + withSpark(newSparkContext(additionalConfs = conf)) { sc => + val rdd = sc.parallelize(0 to 100, 100).repartition(10).cache() + rdd.count() + + eventually(timeout(5.seconds), interval(50.milliseconds)) { + goToUi(sc, "/jobs") + // The completed jobs table should have one row. The first row will be the most recent job: + val firstRow = find(cssSelector("tbody tr")).get.underlying + val firstRowColumns = firstRow.findElements(By.tagName("td")) + // if first row can get the id 0, then the page is rendered and the scheduling mode is + // displayed with no error when we visit http://localhost:4040/jobs/ even though + // we configure the scheduling mode like spark.scheduler.mode=fair + // instead of spark.scheculer.mode=FAIR + firstRowColumns.get(0).getText should be ("0") + } + } + } + test("effects of unpersist() / persist() should be reflected") { // Regression test for SPARK-2527 withSpark(newSparkContext()) { sc => @@ -683,8 +710,8 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser with Matchers with B rdd.count() eventually(timeout(5.seconds), interval(100.milliseconds)) { - val stage0 = Source.fromURL(sc.ui.get.webUrl + - "/stages/stage/?id=0&attempt=0&expandDagViz=true").mkString + val stage0 = Utils.tryWithResource(Source.fromURL(sc.ui.get.webUrl + + "/stages/stage/?id=0&attempt=0&expandDagViz=true"))(_.mkString) assert(stage0.contains("digraph G {\n subgraph clusterstage_0 {\n " + "label="Stage 0";\n subgraph ")) assert(stage0.contains("{\n label="parallelize";\n " + @@ -694,8 +721,8 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser with Matchers with B assert(stage0.contains("{\n label="groupBy";\n " + "2 [labelType="html" label="MapPartitionsRDD [2]")) - val stage1 = Source.fromURL(sc.ui.get.webUrl + - "/stages/stage/?id=1&attempt=0&expandDagViz=true").mkString + val stage1 = Utils.tryWithResource(Source.fromURL(sc.ui.get.webUrl + + "/stages/stage/?id=1&attempt=0&expandDagViz=true"))(_.mkString) assert(stage1.contains("digraph G {\n subgraph clusterstage_1 {\n " + "label="Stage 1";\n subgraph ")) assert(stage1.contains("{\n label="groupBy";\n " + @@ -705,8 +732,8 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser with Matchers with B assert(stage1.contains("{\n label="groupBy";\n " + "5 [labelType="html" label="MapPartitionsRDD [5]")) - val stage2 = Source.fromURL(sc.ui.get.webUrl + - "/stages/stage/?id=2&attempt=0&expandDagViz=true").mkString + val stage2 = Utils.tryWithResource(Source.fromURL(sc.ui.get.webUrl + + "/stages/stage/?id=2&attempt=0&expandDagViz=true"))(_.mkString) assert(stage2.contains("digraph G {\n subgraph clusterstage_2 {\n " + "label="Stage 2";\n subgraph ")) assert(stage2.contains("{\n label="groupBy";\n " + @@ -773,33 +800,6 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser with Matchers with B } } - test("SPARK-31534: text for tooltip should be escaped") { - withSpark(newSparkContext()) { sc => - sc.setLocalProperty(CallSite.LONG_FORM, "collect at :25") - sc.setLocalProperty(CallSite.SHORT_FORM, "collect at :25") - sc.parallelize(1 to 10).collect - - val driver = webDriver.asInstanceOf[HtmlUnitDriver] - driver.setJavascriptEnabled(true) - - eventually(timeout(10.seconds), interval(50.milliseconds)) { - goToUi(sc, "/jobs") - val jobDesc = - driver.findElement(By.cssSelector("div[class='application-timeline-content']")) - jobDesc.getAttribute("data-title") should include ("collect at <console>:25") - - goToUi(sc, "/jobs/job/?id=0") - val stageDesc = driver.findElement(By.cssSelector("div[class='job-timeline-content']")) - stageDesc.getAttribute("data-title") should include ("collect at <console>:25") - - // Open DAG Viz. - driver.findElement(By.id("job-dag-viz")).click() - val nodeDesc = driver.findElement(By.cssSelector("g[class='node_0 node']")) - nodeDesc.getAttribute("name") should include ("collect at <console>:25") - } - } - } - def goToUi(sc: SparkContext, path: String): Unit = { goToUi(sc.ui.get, path) } diff --git a/core/src/test/scala/org/apache/spark/ui/UISuite.scala b/core/src/test/scala/org/apache/spark/ui/UISuite.scala index 2ad4a634cd9a7..45a2ce03eef8a 100644 --- a/core/src/test/scala/org/apache/spark/ui/UISuite.scala +++ b/core/src/test/scala/org/apache/spark/ui/UISuite.scala @@ -76,7 +76,7 @@ class UISuite extends SparkFunSuite { withSpark(newSparkContext()) { sc => // test if the ui is visible, and all the expected tabs are visible eventually(timeout(10.seconds), interval(50.milliseconds)) { - val html = Source.fromURL(sc.ui.get.webUrl).mkString + val html = Utils.tryWithResource(Source.fromURL(sc.ui.get.webUrl))(_.mkString) assert(!html.contains("random data that should not be present")) assert(html.toLowerCase(Locale.ROOT).contains("stages")) assert(html.toLowerCase(Locale.ROOT).contains("storage")) @@ -90,7 +90,7 @@ class UISuite extends SparkFunSuite { withSpark(newSparkContext()) { sc => // test if visible from http://localhost:4040 eventually(timeout(10.seconds), interval(50.milliseconds)) { - val html = Source.fromURL("http://localhost:4040").mkString + val html = Utils.tryWithResource(Source.fromURL("http://localhost:4040"))(_.mkString) assert(html.toLowerCase(Locale.ROOT).contains("stages")) } } @@ -216,6 +216,15 @@ class UISuite extends SparkFunSuite { assert(rewrittenURI === null) } + test("SPARK-33611: Avoid encoding twice on the query parameter of proxy rewrittenURI") { + val prefix = "/worker-id" + val target = "http://localhost:8081" + val path = "/worker-id/json" + val rewrittenURI = + JettyUtils.createProxyURI(prefix, target, path, "order%5B0%5D%5Bcolumn%5D=0") + assert(rewrittenURI.toString === "http://localhost:8081/json?order%5B0%5D%5Bcolumn%5D=0") + } + test("verify rewriting location header for reverse proxy") { val clientRequest = mock(classOf[HttpServletRequest]) var headerValue = "http://localhost:4040/jobs" @@ -262,6 +271,27 @@ class UISuite extends SparkFunSuite { } } + test("SPARK-32467: Avoid encoding URL twice on https redirect") { + val (conf, securityMgr, sslOptions) = sslEnabledConf() + val serverInfo = JettyUtils.startJettyServer("0.0.0.0", 0, sslOptions, conf) + try { + val serverAddr = s"http://localhost:${serverInfo.boundPort}" + + val (_, ctx) = newContext("/ctx1") + serverInfo.addHandler(ctx, securityMgr) + + TestUtils.withHttpConnection(new URL(s"$serverAddr/ctx%281%29?a%5B0%5D=b")) { conn => + assert(conn.getResponseCode() === HttpServletResponse.SC_FOUND) + val location = Option(conn.getHeaderFields().get("Location")) + .map(_.get(0)).orNull + val expectedLocation = s"https://localhost:${serverInfo.securePort.get}/ctx(1)?a[0]=b" + assert(location == expectedLocation) + } + } finally { + stopServer(serverInfo) + } + } + test("http -> https redirect applies to all URIs") { val (conf, securityMgr, sslOptions) = sslEnabledConf() val serverInfo = JettyUtils.startJettyServer("0.0.0.0", 0, sslOptions, conf) @@ -326,20 +356,9 @@ class UISuite extends SparkFunSuite { try { val serverAddr = s"http://localhost:${serverInfo.boundPort}" - val (_, ctx) = newContext("/ctx1") - serverInfo.addHandler(ctx, securityMgr) - val redirect = JettyUtils.createRedirectHandler("/src", "/dst") serverInfo.addHandler(redirect, securityMgr) - // Test Jetty's built-in redirect to add the trailing slash to the context path. - TestUtils.withHttpConnection(new URL(s"$serverAddr/ctx1")) { conn => - assert(conn.getResponseCode() === HttpServletResponse.SC_FOUND) - val location = Option(conn.getHeaderFields().get("Location")) - .map(_.get(0)).orNull - assert(location === s"$proxyRoot/ctx1/") - } - // Test with a URL handled by the added redirect handler, and also including a path prefix. val headers = Seq("X-Forwarded-Context" -> "/prefix") TestUtils.withHttpConnection( @@ -365,6 +384,28 @@ class UISuite extends SparkFunSuite { } } + test("SPARK-34449: Jetty 9.4.35.v20201120 and later no longer return status code 302 " + + " and handle internally when request URL ends with a context path without trailing '/'") { + val proxyRoot = "https://proxy.example.com:443/prefix" + val (conf, securityMgr, sslOptions) = sslDisabledConf() + conf.set(UI.PROXY_REDIRECT_URI, proxyRoot) + val serverInfo = JettyUtils.startJettyServer("0.0.0.0", 0, sslOptions, conf) + + try { + val (_, ctx) = newContext("/ctx") + serverInfo.addHandler(ctx, securityMgr) + val urlStr = s"http://localhost:${serverInfo.boundPort}/ctx" + + assert(TestUtils.httpResponseCode(new URL(urlStr + "/")) === HttpServletResponse.SC_OK) + + // If the following assertion fails when we upgrade Jetty, it seems to change the behavior of + // handling context path which doesn't have the trailing slash. + assert(TestUtils.httpResponseCode(new URL(urlStr)) === HttpServletResponse.SC_OK) + } finally { + stopServer(serverInfo) + } + } + /** * Create a new context handler for the given path, with a single servlet that responds to * requests in `$path/root`. @@ -373,7 +414,9 @@ class UISuite extends SparkFunSuite { val servlet = new CapturingServlet() val ctx = new ServletContextHandler() ctx.setContextPath(path) - ctx.addServlet(new ServletHolder(servlet), "/root") + val servletHolder = new ServletHolder(servlet) + ctx.addServlet(servletHolder, "/root") + ctx.addServlet(servletHolder, "/") (servlet, ctx) } diff --git a/core/src/test/scala/org/apache/spark/ui/UIUtilsSuite.scala b/core/src/test/scala/org/apache/spark/ui/UIUtilsSuite.scala index d4368c882d660..9d040bb4e1ec7 100644 --- a/core/src/test/scala/org/apache/spark/ui/UIUtilsSuite.scala +++ b/core/src/test/scala/org/apache/spark/ui/UIUtilsSuite.scala @@ -113,7 +113,8 @@ class UIUtilsSuite extends SparkFunSuite { test("SPARK-11906: Progress bar should not overflow because of speculative tasks") { val generated = makeProgressBar(2, 3, 0, 0, Map.empty, 4).head.child.filter(_.label == "div") val expected = Seq( -
+
, +
) assert(generated.sameElements(expected), s"\nRunning progress bar should round down\n\nExpected:\n$expected\nGenerated:\n$generated") diff --git a/core/src/test/scala/org/apache/spark/ui/scope/RDDOperationGraphSuite.scala b/core/src/test/scala/org/apache/spark/ui/scope/RDDOperationGraphSuite.scala index e335451f1e484..ba83bfe9554f7 100644 --- a/core/src/test/scala/org/apache/spark/ui/scope/RDDOperationGraphSuite.scala +++ b/core/src/test/scala/org/apache/spark/ui/scope/RDDOperationGraphSuite.scala @@ -18,6 +18,7 @@ package org.apache.spark.ui.scope import org.apache.spark.SparkFunSuite +import org.apache.spark.rdd.DeterministicLevel class RDDOperationGraphSuite extends SparkFunSuite { test("Test simple cluster equals") { @@ -25,7 +26,8 @@ class RDDOperationGraphSuite extends SparkFunSuite { val c1 = new RDDOperationCluster("1", false, "Bender") val c2 = new RDDOperationCluster("2", false, "Hal") c1.attachChildCluster(c2) - c1.attachChildNode(new RDDOperationNode(3, "Marvin", false, false, "collect!")) + c1.attachChildNode(new RDDOperationNode(3, "Marvin", false, false, "collect!", + DeterministicLevel.DETERMINATE)) // create an equal cluster, but without the child node val c1copy = new RDDOperationCluster("1", false, "Bender") diff --git a/core/src/test/scala/org/apache/spark/util/ClosureCleanerSuite.scala b/core/src/test/scala/org/apache/spark/util/ClosureCleanerSuite.scala index b0520c7ab1b1f..cef0d8c1de02b 100644 --- a/core/src/test/scala/org/apache/spark/util/ClosureCleanerSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/ClosureCleanerSuite.scala @@ -147,7 +147,7 @@ object TestObject { } class TestClass extends Serializable { - var x = 5 + val x = 5 def getX: Int = x @@ -179,7 +179,7 @@ class TestClassWithoutFieldAccess { def run(): Int = { var nonSer2 = new NonSerializable - var x = 5 + val x = 5 withSpark(new SparkContext("local", "test")) { sc => val nums = sc.parallelize(Array(1, 2, 3, 4)) nums.map(_ + x).reduce(_ + _) @@ -218,10 +218,10 @@ object TestObjectWithNesting { var answer = 0 withSpark(new SparkContext("local", "test")) { sc => val nums = sc.parallelize(Array(1, 2, 3, 4)) - var y = 1 + val y = 1 for (i <- 1 to 4) { var nonSer2 = new NonSerializable - var x = i + val x = i answer += nums.map(_ + x + y).reduce(_ + _) } answer @@ -239,7 +239,7 @@ class TestClassWithNesting(val y: Int) extends Serializable { val nums = sc.parallelize(Array(1, 2, 3, 4)) for (i <- 1 to 4) { var nonSer2 = new NonSerializable - var x = i + val x = i answer += nums.map(_ + x + getY).reduce(_ + _) } answer @@ -339,7 +339,7 @@ private object TestUserClosuresActuallyCleaned { class TestCreateNullValue { - var x = 5 + val x = 5 def getX: Int = x diff --git a/core/src/test/scala/org/apache/spark/util/DependencyUtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/DependencyUtilsSuite.scala new file mode 100644 index 0000000000000..bf8edeff37c25 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/util/DependencyUtilsSuite.scala @@ -0,0 +1,60 @@ +/* + * 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. + */ + +package org.apache.spark.util + +import java.net.URI + +import org.apache.spark.SparkFunSuite + +class DependencyUtilsSuite extends SparkFunSuite { + + test("SPARK-33084: Add jar support Ivy URI -- test invalid ivy uri") { + val e1 = intercept[IllegalArgumentException] { + DependencyUtils.resolveMavenDependencies(URI.create("ivy://")) + }.getMessage + assert(e1.contains("Expected authority at index 6: ivy://")) + + val e2 = intercept[IllegalArgumentException] { + DependencyUtils.resolveMavenDependencies(URI.create("ivy://org.apache.test:test-test")) + }.getMessage + assert(e2.contains("Invalid Ivy URI authority in uri ivy://org.apache.test:test-test: " + + "Expected 'org:module:version', found org.apache.test:test-test.")) + + val e3 = intercept[IllegalArgumentException] { + DependencyUtils.resolveMavenDependencies( + URI.create("ivy://org.apache.test:test-test:1.0.0?foo=")) + }.getMessage + assert(e3.contains("Invalid query string in Ivy URI " + + "ivy://org.apache.test:test-test:1.0.0?foo=:")) + + val e4 = intercept[IllegalArgumentException] { + DependencyUtils.resolveMavenDependencies( + URI.create("ivy://org.apache.test:test-test:1.0.0?bar=&baz=foo")) + }.getMessage + assert(e4.contains("Invalid query string in Ivy URI " + + "ivy://org.apache.test:test-test:1.0.0?bar=&baz=foo: bar=&baz=foo")) + + val e5 = intercept[IllegalArgumentException] { + DependencyUtils.resolveMavenDependencies( + URI.create("ivy://org.apache.test:test-test:1.0.0?exclude=org.apache")) + }.getMessage + assert(e5.contains("Invalid exclude string in Ivy URI " + + "ivy://org.apache.test:test-test:1.0.0?exclude=org.apache: " + + "expected 'org:module,org:module,..', found org.apache")) + } +} diff --git a/core/src/test/scala/org/apache/spark/util/DistributionSuite.scala b/core/src/test/scala/org/apache/spark/util/DistributionSuite.scala index d3a95e399c289..0ffa9842e16f5 100644 --- a/core/src/test/scala/org/apache/spark/util/DistributionSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/DistributionSuite.scala @@ -17,7 +17,8 @@ package org.apache.spark.util -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.SparkFunSuite diff --git a/core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala b/core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala index 21e69550785a4..12d97573ff6ee 100644 --- a/core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala @@ -337,7 +337,7 @@ class FileAppenderSuite extends SparkFunSuite with BeforeAndAfter with Logging { assert(generatedFiles.size > 1) if (isCompressed) { assert( - generatedFiles.filter(_.getName.endsWith(RollingFileAppender.GZIP_LOG_SUFFIX)).size > 0) + generatedFiles.exists(_.getName.endsWith(RollingFileAppender.GZIP_LOG_SUFFIX))) } val allText = generatedFiles.map { file => if (file.getName.endsWith(RollingFileAppender.GZIP_LOG_SUFFIX)) { diff --git a/core/src/test/scala/org/apache/spark/util/HadoopFSUtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/HadoopFSUtilsSuite.scala new file mode 100644 index 0000000000000..ba91eabc1cab1 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/util/HadoopFSUtilsSuite.scala @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package org.apache.spark.util + +import org.apache.spark.SparkFunSuite + +class HadoopFSUtilsSuite extends SparkFunSuite { + test("HadoopFSUtils - file filtering") { + assert(!HadoopFSUtils.shouldFilterOutPathName("abcd")) + assert(HadoopFSUtils.shouldFilterOutPathName(".ab")) + assert(HadoopFSUtils.shouldFilterOutPathName("_cd")) + assert(!HadoopFSUtils.shouldFilterOutPathName("_metadata")) + assert(!HadoopFSUtils.shouldFilterOutPathName("_common_metadata")) + assert(HadoopFSUtils.shouldFilterOutPathName("_ab_metadata")) + assert(HadoopFSUtils.shouldFilterOutPathName("_cd_common_metadata")) + assert(HadoopFSUtils.shouldFilterOutPathName("a._COPYING_")) + } +} diff --git a/core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala b/core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala index eb7f3079bee36..8dbfe53db6271 100644 --- a/core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/JsonProtocolSuite.scala @@ -31,8 +31,8 @@ import org.scalatest.exceptions.TestFailedException import org.apache.spark._ import org.apache.spark.executor._ import org.apache.spark.metrics.ExecutorMetricType -import org.apache.spark.rdd.RDDOperationScope -import org.apache.spark.resource.{ResourceInformation, ResourceProfile, ResourceUtils} +import org.apache.spark.rdd.{DeterministicLevel, RDDOperationScope} +import org.apache.spark.resource._ import org.apache.spark.scheduler._ import org.apache.spark.scheduler.cluster.ExecutorInfo import org.apache.spark.shuffle.MetadataFetchFailedException @@ -92,14 +92,20 @@ class JsonProtocolSuite extends SparkFunSuite { 42L, "Garfield", Some("appAttempt"), Some(logUrlMap)) val applicationEnd = SparkListenerApplicationEnd(42L) val executorAdded = SparkListenerExecutorAdded(executorAddedTime, "exec1", - new ExecutorInfo("Hostee.awesome.com", 11, logUrlMap, attributes, resources.toMap)) + new ExecutorInfo("Hostee.awesome.com", 11, logUrlMap, attributes, resources.toMap, 4)) val executorRemoved = SparkListenerExecutorRemoved(executorRemovedTime, "exec2", "test reason") - val executorBlacklisted = SparkListenerExecutorBlacklisted(executorBlacklistedTime, "exec1", 22) + val executorBlacklisted = SparkListenerExecutorBlacklisted(executorExcludedTime, "exec1", 22) val executorUnblacklisted = - SparkListenerExecutorUnblacklisted(executorUnblacklistedTime, "exec1") - val nodeBlacklisted = SparkListenerNodeBlacklisted(nodeBlacklistedTime, "node1", 33) + SparkListenerExecutorUnblacklisted(executorUnexcludedTime, "exec1") + val nodeBlacklisted = SparkListenerNodeBlacklisted(nodeExcludedTime, "node1", 33) + val executorExcluded = SparkListenerExecutorExcluded(executorExcludedTime, "exec1", 22) + val executorUnexcluded = + SparkListenerExecutorUnexcluded(executorUnexcludedTime, "exec1") + val nodeExcluded = SparkListenerNodeExcluded(nodeExcludedTime, "node1", 33) val nodeUnblacklisted = - SparkListenerNodeUnblacklisted(nodeUnblacklistedTime, "node1") + SparkListenerNodeUnblacklisted(nodeUnexcludedTime, "node1") + val nodeUnexcluded = + SparkListenerNodeUnexcluded(nodeUnexcludedTime, "node1") val executorMetricsUpdate = { // Use custom accum ID for determinism val accumUpdates = @@ -119,6 +125,14 @@ class JsonProtocolSuite extends SparkFunSuite { SparkListenerStageExecutorMetrics("1", 2, 3, new ExecutorMetrics(Array(543L, 123456L, 12345L, 1234L, 123L, 12L, 432L, 321L, 654L, 765L, 256912L, 123456L, 123456L, 61728L, 30364L, 15182L, 10L, 90L, 2L, 20L))) + val rprofBuilder = new ResourceProfileBuilder() + val taskReq = new TaskResourceRequests().cpus(1).resource("gpu", 1) + val execReq = + new ExecutorResourceRequests().cores(2).resource("gpu", 2, "myscript") + rprofBuilder.require(taskReq).require(execReq) + val resourceProfile = rprofBuilder.build + resourceProfile.setResourceProfileId(21) + val resourceProfileAdded = SparkListenerResourceProfileAdded(resourceProfile) testEvent(stageSubmitted, stageSubmittedJsonString) testEvent(stageCompleted, stageCompletedJsonString) testEvent(taskStart, taskStartJsonString) @@ -139,17 +153,22 @@ class JsonProtocolSuite extends SparkFunSuite { testEvent(executorRemoved, executorRemovedJsonString) testEvent(executorBlacklisted, executorBlacklistedJsonString) testEvent(executorUnblacklisted, executorUnblacklistedJsonString) + testEvent(executorExcluded, executorExcludedJsonString) + testEvent(executorUnexcluded, executorUnexcludedJsonString) testEvent(nodeBlacklisted, nodeBlacklistedJsonString) testEvent(nodeUnblacklisted, nodeUnblacklistedJsonString) + testEvent(nodeExcluded, nodeExcludedJsonString) + testEvent(nodeUnexcluded, nodeUnexcludedJsonString) testEvent(executorMetricsUpdate, executorMetricsUpdateJsonString) testEvent(blockUpdated, blockUpdatedJsonString) testEvent(stageExecutorMetrics, stageExecutorMetricsJsonString) + testEvent(resourceProfileAdded, resourceProfileJsonString) } test("Dependent Classes") { val logUrlMap = Map("stderr" -> "mystderr", "stdout" -> "mystdout").toMap val attributes = Map("ContainerId" -> "ct1", "User" -> "spark").toMap - testRDDInfo(makeRddInfo(2, 3, 4, 5L, 6L)) + testRDDInfo(makeRddInfo(2, 3, 4, 5L, 6L, DeterministicLevel.DETERMINATE)) testStageInfo(makeStageInfo(10, 20, 30, 40L, 50L)) testTaskInfo(makeTaskInfo(999L, 888, 55, 777L, false)) testTaskMetrics(makeTaskMetrics( @@ -161,6 +180,7 @@ class JsonProtocolSuite extends SparkFunSuite { testStorageLevel(StorageLevel.NONE) testStorageLevel(StorageLevel.DISK_ONLY) testStorageLevel(StorageLevel.DISK_ONLY_2) + testStorageLevel(StorageLevel.DISK_ONLY_3) testStorageLevel(StorageLevel.MEMORY_ONLY) testStorageLevel(StorageLevel.MEMORY_ONLY_2) testStorageLevel(StorageLevel.MEMORY_ONLY_SER) @@ -231,6 +251,20 @@ class JsonProtocolSuite extends SparkFunSuite { assert(0 === newInfo.accumulables.size) } + test("StageInfo resourceProfileId") { + val info = makeStageInfo(1, 2, 3, 4L, 5L, 5) + val json = JsonProtocol.stageInfoToJson(info) + + // Fields added after 1.0.0. + assert(info.details.nonEmpty) + assert(info.resourceProfileId === 5) + + val newInfo = JsonProtocol.stageInfoFromJson(json) + + assert(info.name === newInfo.name) + assert(5 === newInfo.resourceProfileId) + } + test("InputMetrics backward compatibility") { // InputMetrics were added after 1.0.1. val metrics = makeTaskMetrics(1L, 2L, 3L, 4L, 5, 6, hasHadoopInput = true, hasOutput = false) @@ -304,6 +338,17 @@ class JsonProtocolSuite extends SparkFunSuite { assert(expectedFetchFailed === JsonProtocol.taskEndReasonFromJson(oldEvent)) } + test("SPARK-32124: FetchFailed Map Index backwards compatibility") { + // FetchFailed in Spark 2.4.0 does not have "Map Index" property. + val fetchFailed = FetchFailed(BlockManagerId("With or", "without you", 15), 17, 16L, 18, 19, + "ignored") + val oldEvent = JsonProtocol.taskEndReasonToJson(fetchFailed) + .removeField({ _._1 == "Map Index" }) + val expectedFetchFailed = FetchFailed(BlockManagerId("With or", "without you", 15), 17, 16L, + Int.MinValue, 19, "ignored") + assert(expectedFetchFailed === JsonProtocol.taskEndReasonFromJson(oldEvent)) + } + test("ShuffleReadMetrics: Local bytes read backwards compatibility") { // Metrics about local shuffle bytes read were added in 1.3.1. val metrics = makeTaskMetrics(1L, 2L, 3L, 4L, 5, 6, @@ -461,9 +506,9 @@ class JsonProtocolSuite extends SparkFunSuite { val oldExecutorMetricsJson = JsonProtocol.executorMetricsToJson(executorMetrics) .removeField( _._1 == "MappedPoolMemory") - val exepectedExecutorMetrics = new ExecutorMetrics(Array(12L, 23L, 45L, 67L, + val expectedExecutorMetrics = new ExecutorMetrics(Array(12L, 23L, 45L, 67L, 78L, 89L, 90L, 123L, 456L, 0L, 40L, 20L, 20L, 10L, 20L, 10L)) - assertEquals(exepectedExecutorMetrics, + assertEquals(expectedExecutorMetrics, JsonProtocol.executorMetricsFromJson(oldExecutorMetricsJson)) } @@ -484,6 +529,54 @@ class JsonProtocolSuite extends SparkFunSuite { testAccumValue(Some("anything"), 123, JString("123")) } + /** Create an AccumulableInfo and verify we can serialize and deserialize it. */ + private def testAccumulableInfo( + name: String, + value: Option[Any], + expectedValue: Option[Any]): Unit = { + val isInternal = name.startsWith(InternalAccumulator.METRICS_PREFIX) + val accum = AccumulableInfo( + 123L, + Some(name), + update = value, + value = value, + internal = isInternal, + countFailedValues = false) + val json = JsonProtocol.accumulableInfoToJson(accum) + val newAccum = JsonProtocol.accumulableInfoFromJson(json) + assert(newAccum == accum.copy(update = expectedValue, value = expectedValue)) + } + + test("SPARK-31923: unexpected value type of internal accumulator") { + // Because a user may use `METRICS_PREFIX` in an accumulator name, we should test unexpected + // types to make sure we don't crash. + import InternalAccumulator.METRICS_PREFIX + testAccumulableInfo( + METRICS_PREFIX + "fooString", + value = Some("foo"), + expectedValue = None) + testAccumulableInfo( + METRICS_PREFIX + "fooList", + value = Some(java.util.Arrays.asList("string")), + expectedValue = Some(java.util.Collections.emptyList()) + ) + val blocks = Seq( + (TestBlockId("block1"), BlockStatus(StorageLevel.MEMORY_ONLY, 1L, 2L)), + (TestBlockId("block2"), BlockStatus(StorageLevel.DISK_ONLY, 3L, 4L))) + testAccumulableInfo( + METRICS_PREFIX + "fooList", + value = Some(java.util.Arrays.asList( + "string", + blocks(0), + blocks(1))), + expectedValue = Some(blocks.asJava) + ) + testAccumulableInfo( + METRICS_PREFIX + "fooSet", + value = Some(Set("foo")), + expectedValue = None) + } + test("SPARK-30936: forwards compatibility - ignore unknown fields") { val expected = TestListenerEvent("foo", 123) val unknownFieldsJson = @@ -515,10 +608,10 @@ private[spark] object JsonProtocolSuite extends Assertions { private val jobCompletionTime = 1421191296660L private val executorAddedTime = 1421458410000L private val executorRemovedTime = 1421458922000L - private val executorBlacklistedTime = 1421458932000L - private val executorUnblacklistedTime = 1421458942000L - private val nodeBlacklistedTime = 1421458952000L - private val nodeUnblacklistedTime = 1421458962000L + private val executorExcludedTime = 1421458932000L + private val executorUnexcludedTime = 1421458942000L + private val nodeExcludedTime = 1421458952000L + private val nodeUnexcludedTime = 1421458962000L private def testEvent(event: SparkListenerEvent, jsonString: String): Unit = { val actualJsonString = compact(render(JsonProtocol.sparkEventToJson(event))) @@ -865,6 +958,10 @@ private[spark] object JsonProtocolSuite extends Assertions { assert(ste1.getFileName === ste2.getFileName) } + private def assertEquals(rp1: ResourceProfile, rp2: ResourceProfile): Unit = { + assert(rp1 === rp2) + } + /** ----------------------------------- * | Util methods for constructing events | * ------------------------------------ */ @@ -881,24 +978,38 @@ private[spark] object JsonProtocolSuite extends Assertions { private val stackTrace = { Array[StackTraceElement]( new StackTraceElement("Apollo", "Venus", "Mercury", 42), - new StackTraceElement("Afollo", "Vemus", "Mercurry", 420), - new StackTraceElement("Ayollo", "Vesus", "Blackberry", 4200) + new StackTraceElement("Afollo", "Vemus", "Mercurry", 420), /* odd spellings intentional */ + new StackTraceElement("Ayollo", "Vesus", "Blackberry", 4200) /* odd spellings intentional */ ) } - private def makeRddInfo(a: Int, b: Int, c: Int, d: Long, e: Long) = { + private def makeRddInfo(a: Int, b: Int, c: Int, d: Long, e: Long, + deterministic: DeterministicLevel.Value) = { val r = - new RDDInfo(a, "mayor", b, StorageLevel.MEMORY_AND_DISK, false, Seq(1, 4, 7), a.toString) + new RDDInfo(a, "mayor", b, StorageLevel.MEMORY_AND_DISK, false, Seq(1, 4, 7), a.toString, + outputDeterministicLevel = deterministic) r.numCachedPartitions = c r.memSize = d r.diskSize = e r } - private def makeStageInfo(a: Int, b: Int, c: Int, d: Long, e: Long) = { - val rddInfos = (0 until a % 5).map { i => makeRddInfo(a + i, b + i, c + i, d + i, e + i) } + private def makeStageInfo( + a: Int, + b: Int, + c: Int, + d: Long, + e: Long, + rpId: Int = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) = { + val rddInfos = (0 until a % 5).map { i => + if (i == (a % 5) - 1) { + makeRddInfo(a + i, b + i, c + i, d + i, e + i, DeterministicLevel.INDETERMINATE) + } else { + makeRddInfo(a + i, b + i, c + i, d + i, e + i, DeterministicLevel.DETERMINATE) + } + } val stageInfo = new StageInfo(a, 0, "greetings", b, rddInfos, Seq(100, 200, 300), "details", - resourceProfileId = ResourceProfile.DEFAULT_RESOURCE_PROFILE_ID) + resourceProfileId = rpId) val (acc1, acc2) = (makeAccumulableInfo(1), makeAccumulableInfo(2)) stageInfo.accumulables(acc1.id) = acc1 stageInfo.accumulables(acc2.id) = acc2 @@ -1019,22 +1130,23 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Details": "details", | "Accumulables": [ | { - | "ID": 2, - | "Name": "Accumulable2", - | "Update": "delta2", - | "Value": "val2", - | "Internal": false, - | "Count Failed Values": false - | }, - | { | "ID": 1, | "Name": "Accumulable1", | "Update": "delta1", | "Value": "val1", | "Internal": false, | "Count Failed Values": false + | }, + | { + | "ID": 2, + | "Name": "Accumulable2", + | "Update": "delta2", + | "Value": "val2", + | "Internal": false, + | "Count Failed Values": false | } - | ] + | ], + | "Resource Profile Id" : 0 | }, | "Properties": { | "France": "Paris", @@ -1066,6 +1178,8 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Deserialized": true, | "Replication": 1 | }, + | "Barrier" : false, + | "DeterministicLevel" : "INDETERMINATE", | "Number of Partitions": 201, | "Number of Cached Partitions": 301, | "Memory Size": 401, @@ -1076,22 +1190,23 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Details": "details", | "Accumulables": [ | { - | "ID": 2, - | "Name": "Accumulable2", - | "Update": "delta2", - | "Value": "val2", - | "Internal": false, - | "Count Failed Values": false - | }, - | { | "ID": 1, | "Name": "Accumulable1", | "Update": "delta1", | "Value": "val1", | "Internal": false, | "Count Failed Values": false + | }, + | { + | "ID": 2, + | "Name": "Accumulable2", + | "Update": "delta2", + | "Value": "val2", + | "Internal": false, + | "Count Failed Values": false | } - | ] + | ], + | "Resource Profile Id" : 0 | } |} """.stripMargin @@ -1588,6 +1703,8 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Deserialized": true, | "Replication": 1 | }, + | "Barrier" : false, + | "DeterministicLevel" : "INDETERMINATE", | "Number of Partitions": 200, | "Number of Cached Partitions": 300, | "Memory Size": 400, @@ -1598,22 +1715,23 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Details": "details", | "Accumulables": [ | { - | "ID": 2, - | "Name": "Accumulable2", - | "Update": "delta2", - | "Value": "val2", - | "Internal": false, - | "Count Failed Values": false - | }, - | { | "ID": 1, | "Name": "Accumulable1", | "Update": "delta1", | "Value": "val1", | "Internal": false, | "Count Failed Values": false + | }, + | { + | "ID": 2, + | "Name": "Accumulable2", + | "Update": "delta2", + | "Value": "val2", + | "Internal": false, + | "Count Failed Values": false | } - | ] + | ], + | "Resource Profile Id" : 0 | }, | { | "Stage ID": 2, @@ -1632,6 +1750,8 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Deserialized": true, | "Replication": 1 | }, + | "Barrier" : false, + | "DeterministicLevel" : "DETERMINATE", | "Number of Partitions": 400, | "Number of Cached Partitions": 600, | "Memory Size": 800, @@ -1648,6 +1768,8 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Deserialized": true, | "Replication": 1 | }, + | "Barrier" : false, + | "DeterministicLevel" : "INDETERMINATE", | "Number of Partitions": 401, | "Number of Cached Partitions": 601, | "Memory Size": 801, @@ -1658,22 +1780,23 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Details": "details", | "Accumulables": [ | { - | "ID": 2, - | "Name": "Accumulable2", - | "Update": "delta2", - | "Value": "val2", - | "Internal": false, - | "Count Failed Values": false - | }, - | { | "ID": 1, | "Name": "Accumulable1", | "Update": "delta1", | "Value": "val1", | "Internal": false, | "Count Failed Values": false + | }, + | { + | "ID": 2, + | "Name": "Accumulable2", + | "Update": "delta2", + | "Value": "val2", + | "Internal": false, + | "Count Failed Values": false | } - | ] + | ], + | "Resource Profile Id" : 0 | }, | { | "Stage ID": 3, @@ -1692,6 +1815,8 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Deserialized": true, | "Replication": 1 | }, + | "Barrier" : false, + | "DeterministicLevel" : "DETERMINATE", | "Number of Partitions": 600, | "Number of Cached Partitions": 900, | "Memory Size": 1200, @@ -1708,6 +1833,8 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Deserialized": true, | "Replication": 1 | }, + | "Barrier" : false, + | "DeterministicLevel" : "DETERMINATE", | "Number of Partitions": 601, | "Number of Cached Partitions": 901, | "Memory Size": 1201, @@ -1724,6 +1851,8 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Deserialized": true, | "Replication": 1 | }, + | "Barrier" : false, + | "DeterministicLevel" : "INDETERMINATE", | "Number of Partitions": 602, | "Number of Cached Partitions": 902, | "Memory Size": 1202, @@ -1734,22 +1863,23 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Details": "details", | "Accumulables": [ | { - | "ID": 2, - | "Name": "Accumulable2", - | "Update": "delta2", - | "Value": "val2", - | "Internal": false, - | "Count Failed Values": false - | }, - | { | "ID": 1, | "Name": "Accumulable1", | "Update": "delta1", | "Value": "val1", | "Internal": false, | "Count Failed Values": false + | }, + | { + | "ID": 2, + | "Name": "Accumulable2", + | "Update": "delta2", + | "Value": "val2", + | "Internal": false, + | "Count Failed Values": false | } - | ] + | ], + | "Resource Profile Id" : 0 | }, | { | "Stage ID": 4, @@ -1768,6 +1898,8 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Deserialized": true, | "Replication": 1 | }, + | "Barrier" : false, + | "DeterministicLevel" : "DETERMINATE", | "Number of Partitions": 800, | "Number of Cached Partitions": 1200, | "Memory Size": 1600, @@ -1784,6 +1916,8 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Deserialized": true, | "Replication": 1 | }, + | "Barrier" : false, + | "DeterministicLevel" : "DETERMINATE", | "Number of Partitions": 801, | "Number of Cached Partitions": 1201, | "Memory Size": 1601, @@ -1800,6 +1934,8 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Deserialized": true, | "Replication": 1 | }, + | "Barrier" : false, + | "DeterministicLevel" : "DETERMINATE", | "Number of Partitions": 802, | "Number of Cached Partitions": 1202, | "Memory Size": 1602, @@ -1816,6 +1952,8 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Deserialized": true, | "Replication": 1 | }, + | "Barrier" : false, + | "DeterministicLevel" : "INDETERMINATE", | "Number of Partitions": 803, | "Number of Cached Partitions": 1203, | "Memory Size": 1603, @@ -1826,22 +1964,23 @@ private[spark] object JsonProtocolSuite extends Assertions { | "Details": "details", | "Accumulables": [ | { - | "ID": 2, - | "Name": "Accumulable2", - | "Update": "delta2", - | "Value": "val2", - | "Internal": false, - | "Count Failed Values": false - | }, - | { | "ID": 1, | "Name": "Accumulable1", | "Update": "delta1", | "Value": "val1", | "Internal": false, | "Count Failed Values": false + | }, + | { + | "ID": 2, + | "Name": "Accumulable2", + | "Update": "delta2", + | "Value": "val2", + | "Internal": false, + | "Count Failed Values": false | } - | ] + | ], + | "Resource Profile Id" : 0 | } | ], | "Stage IDs": [ @@ -1988,7 +2127,8 @@ private[spark] object JsonProtocolSuite extends Assertions { | "name" : "gpu", | "addresses" : [ "0", "1" ] | } - | } + | }, + | "Resource Profile Id": 4 | } |} """.stripMargin @@ -2304,36 +2444,102 @@ private[spark] object JsonProtocolSuite extends Assertions { s""" |{ | "Event" : "org.apache.spark.scheduler.SparkListenerExecutorBlacklisted", - | "time" : ${executorBlacklistedTime}, + | "time" : ${executorExcludedTime}, | "executorId" : "exec1", | "taskFailures" : 22 |} """.stripMargin + private val executorExcludedJsonString = + s""" + |{ + | "Event" : "org.apache.spark.scheduler.SparkListenerExecutorExcluded", + | "time" : ${executorExcludedTime}, + | "executorId" : "exec1", + | "taskFailures" : 22 + |} + """.stripMargin private val executorUnblacklistedJsonString = s""" |{ | "Event" : "org.apache.spark.scheduler.SparkListenerExecutorUnblacklisted", - | "time" : ${executorUnblacklistedTime}, + | "time" : ${executorUnexcludedTime}, | "executorId" : "exec1" |} """.stripMargin + private val executorUnexcludedJsonString = + s""" + |{ + | "Event" : "org.apache.spark.scheduler.SparkListenerExecutorUnexcluded", + | "time" : ${executorUnexcludedTime}, + | "executorId" : "exec1" + |} + """.stripMargin private val nodeBlacklistedJsonString = s""" |{ | "Event" : "org.apache.spark.scheduler.SparkListenerNodeBlacklisted", - | "time" : ${nodeBlacklistedTime}, + | "time" : ${nodeExcludedTime}, | "hostId" : "node1", | "executorFailures" : 33 |} """.stripMargin + private val nodeExcludedJsonString = + s""" + |{ + | "Event" : "org.apache.spark.scheduler.SparkListenerNodeExcluded", + | "time" : ${nodeExcludedTime}, + | "hostId" : "node1", + | "executorFailures" : 33 + |} + """.stripMargin private val nodeUnblacklistedJsonString = s""" |{ | "Event" : "org.apache.spark.scheduler.SparkListenerNodeUnblacklisted", - | "time" : ${nodeUnblacklistedTime}, + | "time" : ${nodeUnexcludedTime}, | "hostId" : "node1" |} """.stripMargin + private val nodeUnexcludedJsonString = + s""" + |{ + | "Event" : "org.apache.spark.scheduler.SparkListenerNodeUnexcluded", + | "time" : ${nodeUnexcludedTime}, + | "hostId" : "node1" + |} + """.stripMargin + private val resourceProfileJsonString = + """ + |{ + | "Event":"SparkListenerResourceProfileAdded", + | "Resource Profile Id":21, + | "Executor Resource Requests":{ + | "cores" : { + | "Resource Name":"cores", + | "Amount":2, + | "Discovery Script":"", + | "Vendor":"" + | }, + | "gpu":{ + | "Resource Name":"gpu", + | "Amount":2, + | "Discovery Script":"myscript", + | "Vendor":"" + | } + | }, + | "Task Resource Requests":{ + | "cpus":{ + | "Resource Name":"cpus", + | "Amount":1.0 + | }, + | "gpu":{ + | "Resource Name":"gpu", + | "Amount":1.0 + | } + | } + |} + """.stripMargin + } case class TestListenerEvent(foo: String, bar: Int) extends SparkListenerEvent diff --git a/core/src/test/scala/org/apache/spark/util/MutableURLClassLoaderSuite.scala b/core/src/test/scala/org/apache/spark/util/MutableURLClassLoaderSuite.scala index 597e0b9597c38..9435b5acd2224 100644 --- a/core/src/test/scala/org/apache/spark/util/MutableURLClassLoaderSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/MutableURLClassLoaderSuite.scala @@ -21,7 +21,8 @@ import java.net.URLClassLoader import scala.collection.JavaConverters._ -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.{SparkContext, SparkException, SparkFunSuite, TestUtils} @@ -111,9 +112,9 @@ class MutableURLClassLoaderSuite extends SparkFunSuite with Matchers { val res1 = classLoader.getResources("resource1").asScala.toList assert(res1.size === 2) assert(classLoader.getResources("resource2").asScala.size === 1) - - res1.map(scala.io.Source.fromURL(_).mkString) should contain inOrderOnly - ("resource1Contents-child", "resource1Contents-parent") + res1.map { res => + Utils.tryWithResource(scala.io.Source.fromURL(res))(_.mkString) + } should contain inOrderOnly("resource1Contents-child", "resource1Contents-parent") classLoader.close() parentLoader.close() } diff --git a/core/src/test/scala/org/apache/spark/util/NextIteratorSuite.scala b/core/src/test/scala/org/apache/spark/util/NextIteratorSuite.scala index 1efd399b5db68..4909d5f8325cc 100644 --- a/core/src/test/scala/org/apache/spark/util/NextIteratorSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/NextIteratorSuite.scala @@ -21,7 +21,8 @@ import java.util.NoSuchElementException import scala.collection.mutable.Buffer -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.SparkFunSuite diff --git a/core/src/test/scala/org/apache/spark/util/PropertiesCloneBenchmark.scala b/core/src/test/scala/org/apache/spark/util/PropertiesCloneBenchmark.scala index baacc7527a806..ff4a4941b6b9e 100644 --- a/core/src/test/scala/org/apache/spark/util/PropertiesCloneBenchmark.scala +++ b/core/src/test/scala/org/apache/spark/util/PropertiesCloneBenchmark.scala @@ -26,11 +26,11 @@ import org.apache.spark.benchmark.{Benchmark, BenchmarkBase} /** - * Benchmark for Kryo Unsafe vs safe Serialization. + * Benchmark for SerializationUtils.clone vs Utils.cloneProperties. * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class * 2. build/sbt "core/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "core/test:runMain " diff --git a/core/src/test/scala/org/apache/spark/util/SizeEstimatorSuite.scala b/core/src/test/scala/org/apache/spark/util/SizeEstimatorSuite.scala index d4f2053e0b2f4..d669f2c655abb 100644 --- a/core/src/test/scala/org/apache/spark/util/SizeEstimatorSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/SizeEstimatorSuite.scala @@ -73,15 +73,35 @@ class SizeEstimatorSuite with PrivateMethodTester with ResetSystemProperties { + // Save modified system properties so that we can restore them after tests. + val originalArch = System.getProperty("os.arch") + val originalCompressedOops = System.getProperty(TEST_USE_COMPRESSED_OOPS_KEY) + + def reinitializeSizeEstimator(arch: String, useCompressedOops: String): Unit = { + def set(k: String, v: String): Unit = { + if (v == null) { + System.clearProperty(k) + } else { + System.setProperty(k, v) + } + } + set("os.arch", arch) + set(TEST_USE_COMPRESSED_OOPS_KEY, useCompressedOops) + val initialize = PrivateMethod[Unit](Symbol("initialize")) + SizeEstimator invokePrivate initialize() + } + override def beforeEach(): Unit = { - // Set the arch to 64-bit and compressedOops to true to get a deterministic test-case super.beforeEach() - System.setProperty("os.arch", "amd64") - System.setProperty(TEST_USE_COMPRESSED_OOPS_KEY, "true") + // Set the arch to 64-bit and compressedOops to true so that SizeEstimator + // provides identical results across all systems in these tests. + reinitializeSizeEstimator("amd64", "true") } override def afterEach(): Unit = { super.afterEach() + // Restore system properties and SizeEstimator to their original states. + reinitializeSizeEstimator(originalArch, originalCompressedOops) } test("simple classes") { @@ -178,11 +198,7 @@ class SizeEstimatorSuite } test("32-bit arch") { - System.setProperty("os.arch", "x86") - - val initialize = PrivateMethod[Unit](Symbol("initialize")) - SizeEstimator invokePrivate initialize() - + reinitializeSizeEstimator("x86", "true") assertResult(40)(SizeEstimator.estimate(DummyString(""))) assertResult(48)(SizeEstimator.estimate(DummyString("a"))) assertResult(48)(SizeEstimator.estimate(DummyString("ab"))) @@ -192,11 +208,7 @@ class SizeEstimatorSuite // NOTE: The String class definition varies across JDK versions (1.6 vs. 1.7) and vendors // (Sun vs IBM). Use a DummyString class to make tests deterministic. test("64-bit arch with no compressed oops") { - System.setProperty("os.arch", "amd64") - System.setProperty(TEST_USE_COMPRESSED_OOPS_KEY, "false") - val initialize = PrivateMethod[Unit](Symbol("initialize")) - SizeEstimator invokePrivate initialize() - + reinitializeSizeEstimator("amd64", "false") assertResult(56)(SizeEstimator.estimate(DummyString(""))) assertResult(64)(SizeEstimator.estimate(DummyString("a"))) assertResult(64)(SizeEstimator.estimate(DummyString("ab"))) @@ -214,14 +226,13 @@ class SizeEstimatorSuite } test("class field blocks rounding on 64-bit VM without useCompressedOops") { + reinitializeSizeEstimator("amd64", "false") assertResult(24)(SizeEstimator.estimate(new DummyClass5)) assertResult(32)(SizeEstimator.estimate(new DummyClass6)) } test("check 64-bit detection for s390x arch") { - System.setProperty("os.arch", "s390x") - val initialize = PrivateMethod[Unit](Symbol("initialize")) - SizeEstimator invokePrivate initialize() + reinitializeSizeEstimator("s390x", "true") // Class should be 32 bytes on s390x if recognised as 64 bit platform assertResult(32)(SizeEstimator.estimate(new DummyClass7)) } diff --git a/core/src/test/scala/org/apache/spark/util/SparkUncaughtExceptionHandlerSuite.scala b/core/src/test/scala/org/apache/spark/util/SparkUncaughtExceptionHandlerSuite.scala index 90741a6bde7f0..9e23b25493dfe 100644 --- a/core/src/test/scala/org/apache/spark/util/SparkUncaughtExceptionHandlerSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/SparkUncaughtExceptionHandlerSuite.scala @@ -80,7 +80,7 @@ object ThrowableThrower { // a thread that uses SparkUncaughtExceptionHandler and throws a Throwable by name class ThrowerThread(name: String, exitOnUncaughtException: Boolean) extends Thread { - override def run() { + override def run(): Unit = { Thread.setDefaultUncaughtExceptionHandler( new SparkUncaughtExceptionHandler(exitOnUncaughtException)) throw ThrowableTypes.getThrowableByName(name) diff --git a/core/src/test/scala/org/apache/spark/util/UninterruptibleThreadRunnerSuite.scala b/core/src/test/scala/org/apache/spark/util/UninterruptibleThreadRunnerSuite.scala new file mode 100644 index 0000000000000..40312beacdff6 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/util/UninterruptibleThreadRunnerSuite.scala @@ -0,0 +1,64 @@ +/* + * 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. + */ + +package org.apache.spark.util + +import org.apache.spark.SparkFunSuite + +class UninterruptibleThreadRunnerSuite extends SparkFunSuite { + private var runner: UninterruptibleThreadRunner = null + + override def beforeEach(): Unit = { + runner = new UninterruptibleThreadRunner("ThreadName") + } + + override def afterEach(): Unit = { + runner.shutdown() + } + + test("runUninterruptibly should switch to UninterruptibleThread") { + assert(!Thread.currentThread().isInstanceOf[UninterruptibleThread]) + var isUninterruptibleThread = false + runner.runUninterruptibly { + isUninterruptibleThread = Thread.currentThread().isInstanceOf[UninterruptibleThread] + } + assert(isUninterruptibleThread, "The runner task must run in UninterruptibleThread") + } + + test("runUninterruptibly should not add new UninterruptibleThread") { + var isInitialUninterruptibleThread = false + var isRunnerUninterruptibleThread = false + val t = new UninterruptibleThread("test") { + override def run(): Unit = { + runUninterruptibly { + val initialThread = Thread.currentThread() + isInitialUninterruptibleThread = initialThread.isInstanceOf[UninterruptibleThread] + runner.runUninterruptibly { + val runnerThread = Thread.currentThread() + isRunnerUninterruptibleThread = runnerThread.isInstanceOf[UninterruptibleThread] + assert(runnerThread.eq(initialThread)) + } + } + } + } + t.start() + t.join() + assert(isInitialUninterruptibleThread, + "The initiator must already run in UninterruptibleThread") + assert(isRunnerUninterruptibleThread, "The runner task must run in UninterruptibleThread") + } +} diff --git a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala index 931eb6b5413f7..404cc343c8d9c 100644 --- a/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/UtilsSuite.scala @@ -18,8 +18,7 @@ package org.apache.spark.util import java.io.{ByteArrayInputStream, ByteArrayOutputStream, DataOutput, DataOutputStream, File, - FileOutputStream, InputStream, PrintStream, SequenceInputStream} -import java.lang.{Double => JDouble, Float => JFloat} + FileOutputStream, PrintStream, SequenceInputStream} import java.lang.reflect.Field import java.net.{BindException, ServerSocket, URI} import java.nio.{ByteBuffer, ByteOrder} @@ -42,6 +41,7 @@ import org.apache.hadoop.fs.Path import org.apache.spark.{SparkConf, SparkException, SparkFunSuite, TaskContext} import org.apache.spark.internal.Logging import org.apache.spark.internal.config._ +import org.apache.spark.internal.config.Tests.IS_TESTING import org.apache.spark.network.util.ByteUnit import org.apache.spark.scheduler.SparkListener import org.apache.spark.util.io.ChunkedByteBufferInputStream @@ -1024,11 +1024,13 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging { // Set some secret keys val secretKeys = Seq( "spark.executorEnv.HADOOP_CREDSTORE_PASSWORD", + "spark.hadoop.fs.s3a.access.key", "spark.my.password", "spark.my.sECreT") secretKeys.foreach { key => sparkConf.set(key, "sensitive_value") } // Set a non-secret key sparkConf.set("spark.regular.property", "regular_value") + sparkConf.set("spark.hadoop.fs.s3a.access_key", "regular_value") // Set a property with a regular key but secret in the value sparkConf.set("spark.sensitive.property", "has_secret_in_value") @@ -1039,7 +1041,8 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging { secretKeys.foreach { key => assert(redactedConf(key) === Utils.REDACTION_REPLACEMENT_TEXT) } assert(redactedConf("spark.regular.property") === "regular_value") assert(redactedConf("spark.sensitive.property") === Utils.REDACTION_REPLACEMENT_TEXT) - + assert(redactedConf("spark.hadoop.fs.s3a.access.key") === Utils.REDACTION_REPLACEMENT_TEXT) + assert(redactedConf("spark.hadoop.fs.s3a.access_key") === "regular_value") } test("redact sensitive information in command line args") { @@ -1301,6 +1304,150 @@ class UtilsSuite extends SparkFunSuite with ResetSystemProperties with Logging { assert(Utils.trimExceptCRLF(s"b${s}b") === s"b${s}b") } } + + test("pathsToMetadata") { + val paths = (0 to 4).map(i => new Path(s"path$i")) + assert(Utils.buildLocationMetadata(paths, 10) == "(5 paths)[...]") + // 11 is the minimum threshold to print at least one path + assert(Utils.buildLocationMetadata(paths, 11) == "(5 paths)[path0, ...]") + // 11 + 5 + 2 = 18 is the minimum threshold to print two paths + assert(Utils.buildLocationMetadata(paths, 18) == "(5 paths)[path0, path1, ...]") + } + + test("checkHost supports both IPV4 and IPV6") { + // IPV4 ips + Utils.checkHost("0.0.0.0") + var e: AssertionError = intercept[AssertionError] { + Utils.checkHost("0.0.0.0:0") + } + assert(e.getMessage.contains("Expected hostname or IP but got 0.0.0.0:0")) + e = intercept[AssertionError] { + Utils.checkHost("0.0.0.0:") + } + assert(e.getMessage.contains("Expected hostname or IP but got 0.0.0.0:")) + // IPV6 ips + Utils.checkHost("[::1]") + e = intercept[AssertionError] { + Utils.checkHost("[::1]:0") + } + assert(e.getMessage.contains("Expected hostname or IPv6 IP enclosed in [] but got [::1]:0")) + e = intercept[AssertionError] { + Utils.checkHost("[::1]:") + } + assert(e.getMessage.contains("Expected hostname or IPv6 IP enclosed in [] but got [::1]:")) + // hostname + Utils.checkHost("localhost") + e = intercept[AssertionError] { + Utils.checkHost("localhost:0") + } + assert(e.getMessage.contains("Expected hostname or IP but got localhost:0")) + e = intercept[AssertionError] { + Utils.checkHost("localhost:") + } + assert(e.getMessage.contains("Expected hostname or IP but got localhost:")) + } + + test("checkHostPort support IPV6 and IPV4") { + // IPV4 ips + Utils.checkHostPort("0.0.0.0:0") + var e: AssertionError = intercept[AssertionError] { + Utils.checkHostPort("0.0.0.0") + } + assert(e.getMessage.contains("Expected host and port but got 0.0.0.0")) + + // IPV6 ips + Utils.checkHostPort("[::1]:0") + e = intercept[AssertionError] { + Utils.checkHostPort("[::1]") + } + assert(e.getMessage.contains("Expected host and port but got [::1]")) + + // hostname + Utils.checkHostPort("localhost:0") + e = intercept[AssertionError] { + Utils.checkHostPort("localhost") + } + assert(e.getMessage.contains("Expected host and port but got localhost")) + } + + test("parseHostPort support IPV6 and IPV4") { + // IPV4 ips + var hostnamePort = Utils.parseHostPort("0.0.0.0:80") + assert(hostnamePort._1.equals("0.0.0.0")) + assert(hostnamePort._2 === 80) + + hostnamePort = Utils.parseHostPort("0.0.0.0") + assert(hostnamePort._1.equals("0.0.0.0")) + assert(hostnamePort._2 === 0) + + hostnamePort = Utils.parseHostPort("0.0.0.0:") + assert(hostnamePort._1.equals("0.0.0.0")) + assert(hostnamePort._2 === 0) + + // IPV6 ips + hostnamePort = Utils.parseHostPort("[::1]:80") + assert(hostnamePort._1.equals("[::1]")) + assert(hostnamePort._2 === 80) + + hostnamePort = Utils.parseHostPort("[::1]") + assert(hostnamePort._1.equals("[::1]")) + assert(hostnamePort._2 === 0) + + hostnamePort = Utils.parseHostPort("[::1]:") + assert(hostnamePort._1.equals("[::1]")) + assert(hostnamePort._2 === 0) + + // hostname + hostnamePort = Utils.parseHostPort("localhost:80") + assert(hostnamePort._1.equals("localhost")) + assert(hostnamePort._2 === 80) + + hostnamePort = Utils.parseHostPort("localhost") + assert(hostnamePort._1.equals("localhost")) + assert(hostnamePort._2 === 0) + + hostnamePort = Utils.parseHostPort("localhost:") + assert(hostnamePort._1.equals("localhost")) + assert(hostnamePort._2 === 0) + } + + test("executorOffHeapMemorySizeAsMb when MEMORY_OFFHEAP_ENABLED is false") { + val executorOffHeapMemory = Utils.executorOffHeapMemorySizeAsMb(new SparkConf()) + assert(executorOffHeapMemory == 0) + } + + test("executorOffHeapMemorySizeAsMb when MEMORY_OFFHEAP_ENABLED is true") { + val offHeapMemoryInMB = 50 + val offHeapMemory: Long = offHeapMemoryInMB * 1024 * 1024 + val sparkConf = new SparkConf() + .set(MEMORY_OFFHEAP_ENABLED, true) + .set(MEMORY_OFFHEAP_SIZE, offHeapMemory) + val executorOffHeapMemory = Utils.executorOffHeapMemorySizeAsMb(sparkConf) + assert(executorOffHeapMemory == offHeapMemoryInMB) + } + + test("executorMemoryOverhead when MEMORY_OFFHEAP_ENABLED is true, " + + "but MEMORY_OFFHEAP_SIZE not config scene") { + val sparkConf = new SparkConf() + .set(MEMORY_OFFHEAP_ENABLED, true) + val expected = + s"${MEMORY_OFFHEAP_SIZE.key} must be > 0 when ${MEMORY_OFFHEAP_ENABLED.key} == true" + val message = intercept[IllegalArgumentException] { + Utils.executorOffHeapMemorySizeAsMb(sparkConf) + }.getMessage + assert(message.contains(expected)) + } + + test("isPushBasedShuffleEnabled when both PUSH_BASED_SHUFFLE_ENABLED" + + " and SHUFFLE_SERVICE_ENABLED are true") { + val conf = new SparkConf() + assert(Utils.isPushBasedShuffleEnabled(conf) === false) + conf.set(PUSH_BASED_SHUFFLE_ENABLED, true) + conf.set(IS_TESTING, false) + assert(Utils.isPushBasedShuffleEnabled(conf) === false) + conf.set(SHUFFLE_SERVICE_ENABLED, true) + assert(Utils.isPushBasedShuffleEnabled(conf) === true) + } } private class SimpleExtension diff --git a/core/src/test/scala/org/apache/spark/util/VersionUtilsSuite.scala b/core/src/test/scala/org/apache/spark/util/VersionUtilsSuite.scala index 56623ebea1651..ff68dd150973d 100644 --- a/core/src/test/scala/org/apache/spark/util/VersionUtilsSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/VersionUtilsSuite.scala @@ -98,4 +98,18 @@ class VersionUtilsSuite extends SparkFunSuite { } } } + + test("SPARK-33212: retrieve major/minor/patch version parts") { + assert(VersionUtils.majorMinorPatchVersion("3.2.2").contains((3, 2, 2))) + assert(VersionUtils.majorMinorPatchVersion("3.2.2.4").contains((3, 2, 2))) + assert(VersionUtils.majorMinorPatchVersion("3.2.2-SNAPSHOT").contains((3, 2, 2))) + assert(VersionUtils.majorMinorPatchVersion("3.2.2.4XXX").contains((3, 2, 2))) + assert(VersionUtils.majorMinorPatchVersion("3.2").contains((3, 2, 0))) + assert(VersionUtils.majorMinorPatchVersion("3").contains((3, 0, 0))) + + // illegal cases + Seq("ABC", "3X", "3.2-SNAPSHOT", "3.2ABC", "3-ABC", "3.2.4XYZ").foreach { version => + assert(VersionUtils.majorMinorPatchVersion(version).isEmpty, s"version $version") + } + } } diff --git a/core/src/test/scala/org/apache/spark/util/collection/ExternalAppendOnlyMapSuite.scala b/core/src/test/scala/org/apache/spark/util/collection/ExternalAppendOnlyMapSuite.scala index 0b4e1494bf300..81a145906d33c 100644 --- a/core/src/test/scala/org/apache/spark/util/collection/ExternalAppendOnlyMapSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/collection/ExternalAppendOnlyMapSuite.scala @@ -21,8 +21,8 @@ import scala.collection.mutable.ArrayBuffer import scala.concurrent.duration._ import scala.ref.WeakReference -import org.scalatest.Matchers import org.scalatest.concurrent.Eventually +import org.scalatest.matchers.must.Matchers import org.apache.spark._ import org.apache.spark.internal.config._ @@ -220,13 +220,13 @@ class ExternalAppendOnlyMapSuite extends SparkFunSuite testSimpleSpilling() } - test("spilling with compression") { + private def testSimpleSpillingForAllCodecs(encrypt: Boolean) { // Keep track of which compression codec we're using to report in test failure messages var lastCompressionCodec: Option[String] = None try { allCompressionCodecs.foreach { c => lastCompressionCodec = Some(c) - testSimpleSpilling(Some(c)) + testSimpleSpilling(Some(c), encrypt) } } catch { // Include compression codec used in test failure message @@ -241,8 +241,12 @@ class ExternalAppendOnlyMapSuite extends SparkFunSuite } } + test("spilling with compression") { + testSimpleSpillingForAllCodecs(encrypt = false) + } + test("spilling with compression and encryption") { - testSimpleSpilling(Some(CompressionCodec.DEFAULT_COMPRESSION_CODEC), encrypt = true) + testSimpleSpillingForAllCodecs(encrypt = true) } /** diff --git a/core/src/test/scala/org/apache/spark/util/collection/ImmutableBitSetSuite.scala b/core/src/test/scala/org/apache/spark/util/collection/ImmutableBitSetSuite.scala new file mode 100644 index 0000000000000..333d5cb431221 --- /dev/null +++ b/core/src/test/scala/org/apache/spark/util/collection/ImmutableBitSetSuite.scala @@ -0,0 +1,140 @@ +/* + * 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. + */ + +package org.apache.spark.util.collection + +import org.apache.spark.SparkFunSuite + +class ImmutableBitSetSuite extends SparkFunSuite { + + test("basic get") { + val bitset = new ImmutableBitSet(100, 0, 9, 1, 10, 90, 96) + val setBits = Seq(0, 9, 1, 10, 90, 96) + for (i <- 0 until 100) { + if (setBits.contains(i)) { + assert(bitset.get(i)) + } else { + assert(!bitset.get(i)) + } + } + assert(bitset.cardinality() === setBits.size) + } + + test("nextSetBit") { + val bitset = new ImmutableBitSet(100, 0, 9, 1, 10, 90, 96) + + assert(bitset.nextSetBit(0) === 0) + assert(bitset.nextSetBit(1) === 1) + assert(bitset.nextSetBit(2) === 9) + assert(bitset.nextSetBit(9) === 9) + assert(bitset.nextSetBit(10) === 10) + assert(bitset.nextSetBit(11) === 90) + assert(bitset.nextSetBit(80) === 90) + assert(bitset.nextSetBit(91) === 96) + assert(bitset.nextSetBit(96) === 96) + assert(bitset.nextSetBit(97) === -1) + } + + test( "xor len(bitsetX) < len(bitsetY)" ) { + val bitsetX = new ImmutableBitSet(60, 0, 2, 3, 37, 41) + val bitsetY = new ImmutableBitSet(100, 0, 1, 3, 37, 38, 41, 85) + + val bitsetXor = bitsetX ^ bitsetY + + assert(bitsetXor.nextSetBit(0) === 1) + assert(bitsetXor.nextSetBit(1) === 1) + assert(bitsetXor.nextSetBit(2) === 2) + assert(bitsetXor.nextSetBit(3) === 38) + assert(bitsetXor.nextSetBit(38) === 38) + assert(bitsetXor.nextSetBit(39) === 85) + assert(bitsetXor.nextSetBit(42) === 85) + assert(bitsetXor.nextSetBit(85) === 85) + assert(bitsetXor.nextSetBit(86) === -1) + + } + + test( "xor len(bitsetX) > len(bitsetY)" ) { + val bitsetX = new ImmutableBitSet(100, 0, 1, 3, 37, 38, 41, 85) + val bitsetY = new ImmutableBitSet(60, 0, 2, 3, 37, 41) + + val bitsetXor = bitsetX ^ bitsetY + + assert(bitsetXor.nextSetBit(0) === 1) + assert(bitsetXor.nextSetBit(1) === 1) + assert(bitsetXor.nextSetBit(2) === 2) + assert(bitsetXor.nextSetBit(3) === 38) + assert(bitsetXor.nextSetBit(38) === 38) + assert(bitsetXor.nextSetBit(39) === 85) + assert(bitsetXor.nextSetBit(42) === 85) + assert(bitsetXor.nextSetBit(85) === 85) + assert(bitsetXor.nextSetBit(86) === -1) + + } + + test( "andNot len(bitsetX) < len(bitsetY)" ) { + val bitsetX = new ImmutableBitSet(60, 0, 2, 3, 37, 41, 48) + val bitsetY = new ImmutableBitSet(100, 0, 1, 3, 37, 38, 41, 85) + + val bitsetDiff = bitsetX.andNot( bitsetY ) + + assert(bitsetDiff.nextSetBit(0) === 2) + assert(bitsetDiff.nextSetBit(1) === 2) + assert(bitsetDiff.nextSetBit(2) === 2) + assert(bitsetDiff.nextSetBit(3) === 48) + assert(bitsetDiff.nextSetBit(48) === 48) + assert(bitsetDiff.nextSetBit(49) === -1) + assert(bitsetDiff.nextSetBit(65) === -1) + } + + test( "andNot len(bitsetX) > len(bitsetY)" ) { + val bitsetX = new ImmutableBitSet(100, 0, 1, 3, 37, 38, 41, 85) + val bitsetY = new ImmutableBitSet(60, 0, 2, 3, 37, 41, 48) + + val bitsetDiff = bitsetX.andNot( bitsetY ) + + assert(bitsetDiff.nextSetBit(0) === 1) + assert(bitsetDiff.nextSetBit(1) === 1) + assert(bitsetDiff.nextSetBit(2) === 38) + assert(bitsetDiff.nextSetBit(3) === 38) + assert(bitsetDiff.nextSetBit(38) === 38) + assert(bitsetDiff.nextSetBit(39) === 85) + assert(bitsetDiff.nextSetBit(85) === 85) + assert(bitsetDiff.nextSetBit(86) === -1) + } + + test( "immutability" ) { + val bitset = new ImmutableBitSet(100) + intercept[UnsupportedOperationException] { + bitset.set(1) + } + intercept[UnsupportedOperationException] { + bitset.setUntil(10) + } + intercept[UnsupportedOperationException] { + bitset.unset(1) + } + intercept[UnsupportedOperationException] { + bitset.clear() + } + intercept[UnsupportedOperationException] { + bitset.clearUntil(10) + } + intercept[UnsupportedOperationException] { + bitset.union(new ImmutableBitSet(100)) + } + } +} diff --git a/core/src/test/scala/org/apache/spark/util/collection/OpenHashMapSuite.scala b/core/src/test/scala/org/apache/spark/util/collection/OpenHashMapSuite.scala index 68bcc5e5a5092..08fed93364060 100644 --- a/core/src/test/scala/org/apache/spark/util/collection/OpenHashMapSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/collection/OpenHashMapSuite.scala @@ -19,7 +19,8 @@ package org.apache.spark.util.collection import scala.collection.mutable.HashSet -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.SparkFunSuite import org.apache.spark.util.SizeEstimator diff --git a/core/src/test/scala/org/apache/spark/util/collection/OpenHashSetSuite.scala b/core/src/test/scala/org/apache/spark/util/collection/OpenHashSetSuite.scala index 44d2118d77945..89a308556d5df 100644 --- a/core/src/test/scala/org/apache/spark/util/collection/OpenHashSetSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/collection/OpenHashSetSuite.scala @@ -17,7 +17,8 @@ package org.apache.spark.util.collection -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.SparkFunSuite import org.apache.spark.util.SizeEstimator diff --git a/core/src/test/scala/org/apache/spark/util/collection/PrimitiveKeyOpenHashMapSuite.scala b/core/src/test/scala/org/apache/spark/util/collection/PrimitiveKeyOpenHashMapSuite.scala index f5ee428020fd4..3b42300ccdd6a 100644 --- a/core/src/test/scala/org/apache/spark/util/collection/PrimitiveKeyOpenHashMapSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/collection/PrimitiveKeyOpenHashMapSuite.scala @@ -19,7 +19,8 @@ package org.apache.spark.util.collection import scala.collection.mutable.HashSet -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.SparkFunSuite import org.apache.spark.util.SizeEstimator diff --git a/core/src/test/scala/org/apache/spark/util/collection/SorterSuite.scala b/core/src/test/scala/org/apache/spark/util/collection/SorterSuite.scala index bb03f0d3cdc20..82b4f2eac6248 100644 --- a/core/src/test/scala/org/apache/spark/util/collection/SorterSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/collection/SorterSuite.scala @@ -39,8 +39,8 @@ class SorterSuite extends SparkFunSuite with Logging { new Sorter(new KeyReuseIntArraySortDataFormat) .sort(data2, 0, data2.length, Ordering[IntWrapper]) - assert(data0.view === data1.view) - assert(data0.view === data2.view) + assert(data0 === data1) + assert(data0 === data2) } test("KVArraySorter") { diff --git a/core/src/test/scala/org/apache/spark/util/collection/unsafe/sort/RadixSortSuite.scala b/core/src/test/scala/org/apache/spark/util/collection/unsafe/sort/RadixSortSuite.scala index 9ae6a8ef879f3..b3e5e0a73dd9f 100644 --- a/core/src/test/scala/org/apache/spark/util/collection/unsafe/sort/RadixSortSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/collection/unsafe/sort/RadixSortSuite.scala @@ -157,7 +157,7 @@ class RadixSortSuite extends SparkFunSuite with Logging { buffer, N, sortType.startByteIdx, sortType.endByteIdx, sortType.descending, sortType.signed) val result = collectToArray(buffer, outOffset, N) - assert(ref.view == result.view) + assert(ref === result) } test("sort key prefix " + sortType.name) { @@ -169,7 +169,7 @@ class RadixSortSuite extends SparkFunSuite with Logging { sortType.descending, sortType.signed) val res1 = collectToArray(buf1, 0, N * 2) val res2 = collectToArray(buf2, outOffset, N * 2) - assert(res1.view == res2.view) + assert(res1 === res2) } fuzzTest(s"fuzz test ${sortType.name} with random bitmasks") { seed => @@ -181,7 +181,7 @@ class RadixSortSuite extends SparkFunSuite with Logging { buffer, N, sortType.startByteIdx, sortType.endByteIdx, sortType.descending, sortType.signed) val result = collectToArray(buffer, outOffset, N) - assert(ref.view == result.view) + assert(ref === result) } fuzzTest(s"fuzz test key prefix ${sortType.name} with random bitmasks") { seed => @@ -194,7 +194,7 @@ class RadixSortSuite extends SparkFunSuite with Logging { sortType.descending, sortType.signed) val res1 = collectToArray(buf1, 0, N * 2) val res2 = collectToArray(buf2, outOffset, N * 2) - assert(res1.view == res2.view) + assert(res1 ===res2) } } } diff --git a/core/src/test/scala/org/apache/spark/util/random/RandomSamplerSuite.scala b/core/src/test/scala/org/apache/spark/util/random/RandomSamplerSuite.scala index fef514e0c4e37..eb1aab645f66e 100644 --- a/core/src/test/scala/org/apache/spark/util/random/RandomSamplerSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/random/RandomSamplerSuite.scala @@ -22,7 +22,8 @@ import java.util.Random import scala.collection.mutable.ArrayBuffer import org.apache.commons.math3.distribution.PoissonDistribution -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.SparkFunSuite @@ -322,7 +323,7 @@ class RandomSamplerSuite extends SparkFunSuite with Matchers { RandomSampler.defaultMaxGapSamplingFraction should be (0.4) var d: Double = 0.0 - var sampler = new BernoulliSampler[Int](0.1) + val sampler = new BernoulliSampler[Int](0.1) sampler.setSeed(rngSeed.nextLong) // Array iterator (indexable type) @@ -546,7 +547,7 @@ class RandomSamplerSuite extends SparkFunSuite with Matchers { RandomSampler.defaultMaxGapSamplingFraction should be (0.4) var d: Double = 0.0 - var sampler = new PoissonSampler[Int](0.1) + val sampler = new PoissonSampler[Int](0.1) sampler.setSeed(rngSeed.nextLong) // Array iterator (indexable type) diff --git a/core/src/test/scala/org/apache/spark/util/random/XORShiftRandomBenchmark.scala b/core/src/test/scala/org/apache/spark/util/random/XORShiftRandomBenchmark.scala index b0563fdb2badb..7fd63a2c3518f 100644 --- a/core/src/test/scala/org/apache/spark/util/random/XORShiftRandomBenchmark.scala +++ b/core/src/test/scala/org/apache/spark/util/random/XORShiftRandomBenchmark.scala @@ -27,7 +27,7 @@ import org.apache.spark.util.Utils.times * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class * 2. build/sbt "core/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "core/test:runMain " diff --git a/core/src/test/scala/org/apache/spark/util/random/XORShiftRandomSuite.scala b/core/src/test/scala/org/apache/spark/util/random/XORShiftRandomSuite.scala index df3483830ca9c..267ab1020a185 100644 --- a/core/src/test/scala/org/apache/spark/util/random/XORShiftRandomSuite.scala +++ b/core/src/test/scala/org/apache/spark/util/random/XORShiftRandomSuite.scala @@ -18,7 +18,8 @@ package org.apache.spark.util.random import org.apache.commons.math3.stat.inference.ChiSquareTest -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.SparkFunSuite import org.apache.spark.util.Utils.times diff --git a/dev/.rat-excludes b/dev/.rat-excludes index f997c9b3f9f24..6c809f43418cd 100644 --- a/dev/.rat-excludes +++ b/dev/.rat-excludes @@ -25,15 +25,13 @@ bootstrap.bundle.min.js bootstrap.bundle.min.js.map bootstrap.min.css bootstrap.min.css.map -jquery-3.4.1.min.js +jquery-3.5.1.min.js d3.min.js dagre-d3.min.js graphlib-dot.min.js sorttable.js vis-timeline-graph2d.min.js -vis-timeline-graph2d.min.js.map vis-timeline-graph2d.min.css -vis-timeline-graph2d.min.css.map dataTables.bootstrap4.1.10.20.min.css dataTables.bootstrap4.1.10.20.min.js dataTables.rowsGroup.js @@ -44,14 +42,13 @@ jquery.dataTables.1.10.20.min.js jquery.mustache.js jsonFormatter.min.css jsonFormatter.min.js -.*avsc -.*txt -.*json -.*data -.*log -pyspark-coverage-site/ -cloudpickle.py -heapq3.py +.*\.avsc +.*\.txt +.*\.json +.*\.data +.*\.log +pyspark-coverage-site/* +cloudpickle/* join.py SparkExprTyper.scala SparkILoop.scala @@ -101,17 +98,17 @@ local-1430917381535_2 DESCRIPTION NAMESPACE test_support/* -.*Rd +.*\.Rd help/* html/* INDEX .lintr gen-java.* -.*avpr -.*parquet +.*\.avpr +.*\.parquet spark-deps-.* -.*csv -.*tsv +.*\.csv +.*\.tsv .*\.sql .Rbuildignore META-INF/* @@ -124,3 +121,17 @@ vote.tmpl SessionManager.java SessionHandler.java GangliaReporter.java +application_1578436911597_0052 +config.properties +local-1596020211915 +app-20200706201101-0003 +py.typed +_metadata +_SUCCESS +part-00000 +.*\.res +flights_tiny.txt.1 +over1k +over10k +exported_table/* +node_modules \ No newline at end of file diff --git a/dev/.scalafmt.conf b/dev/.scalafmt.conf index 9a8813e3b3eed..9598540752ebd 100644 --- a/dev/.scalafmt.conf +++ b/dev/.scalafmt.conf @@ -25,4 +25,4 @@ optIn = { danglingParentheses = false docstrings = JavaDoc maxColumn = 98 - +newlines.topLevelStatements = [before,after] diff --git a/dev/appveyor-guide.md b/dev/appveyor-guide.md index a8c0c1ef23ac3..c68b5de9e61d0 100644 --- a/dev/appveyor-guide.md +++ b/dev/appveyor-guide.md @@ -33,22 +33,22 @@ Currently, SparkR on Windows is being tested with [AppVeyor](https://ci.appveyor 2016-09-04 11 07 58 -- Click "Github". +- Click "GitHub". 2016-09-04 11 08 10 -#### After signing up, go to profile to link Github and AppVeyor. +#### After signing up, go to profile to link GitHub and AppVeyor. - Click your account and then click "Profile". 2016-09-04 11 09 43 -- Enable the link with GitHub via clicking "Link Github account". +- Enable the link with GitHub via clicking "Link GitHub account". 2016-09-04 11 09 52 -- Click "Authorize application" in Github site. +- Click "Authorize application" in GitHub site. 2016-09-04 11 10 05 @@ -63,11 +63,11 @@ Currently, SparkR on Windows is being tested with [AppVeyor](https://ci.appveyor 2016-08-30 12 16 35 -- Since we will use Github here, click the "GITHUB" button and then click "Authorize Github" so that AppVeyor can access the Github logs (e.g. commits). +- Since we will use GitHub here, click the "GITHUB" button and then click "Authorize GitHub" so that AppVeyor can access the GitHub logs (e.g. commits). 2016-09-04 11 10 22 -- Click "Authorize application" from Github (the above step will pop up this page). +- Click "Authorize application" from GitHub (the above step will pop up this page). 2016-09-04 11 10 27 diff --git a/dev/appveyor-install-dependencies.ps1 b/dev/appveyor-install-dependencies.ps1 index 4be420b4e8594..fb4cc22de35f4 100644 --- a/dev/appveyor-install-dependencies.ps1 +++ b/dev/appveyor-install-dependencies.ps1 @@ -19,7 +19,7 @@ $CRAN = "https://cloud.r-project.org" Function InstallR { if ( -not(Test-Path Env:\R_ARCH) ) { - $arch = "i386" + $arch = "x64" } Else { $arch = $env:R_ARCH @@ -67,7 +67,7 @@ Function InstallRtools { Else { $gccPath = $env:GCC_PATH } - $env:PATH = $RtoolsDrive + '\Rtools40\bin;' + $RtoolsDrive + '\Rtools40\MinGW$(WIN)\bin;' + $RtoolsDrive + '\Rtools40\' + $gccPath + '\bin;' + $env:PATH + $env:PATH = $RtoolsDrive + '\Rtools40\bin;' + $RtoolsDrive + '\Rtools40\mingw64\bin;' + $RtoolsDrive + '\Rtools40\' + $gccPath + '\bin;' + $env:PATH $env:BINPREF=$RtoolsDrive + '/Rtools40/mingw$(WIN)/bin/' } @@ -95,28 +95,28 @@ $env:MAVEN_OPTS = "-Xmx2g -XX:ReservedCodeCacheSize=1g" Pop-Location # ========================== Hadoop bin package -# This must match the version at https://github.com/steveloughran/winutils/tree/master/hadoop-2.7.1 -$hadoopVer = "2.7.1" +# This must match the version at https://github.com/cdarlint/winutils/tree/master/hadoop-3.2.0 +$hadoopVer = "3.2.0" $hadoopPath = "$tools\hadoop" if (!(Test-Path $hadoopPath)) { New-Item -ItemType Directory -Force -Path $hadoopPath | Out-Null } Push-Location $hadoopPath -Start-FileDownload "https://github.com/steveloughran/winutils/archive/master.zip" "winutils-master.zip" +Start-FileDownload "https://codeload.github.com/cdarlint/winutils/zip/master" "winutils-master.zip" # extract Invoke-Expression "7z.exe x winutils-master.zip" # add hadoop bin to environment variables -$env:HADOOP_HOME = "$hadoopPath/winutils-master/hadoop-$hadoopVer" -$env:Path += ";$env:HADOOP_HOME\bin" +$env:HADOOP_HOME = "$hadoopPath\winutils-master\hadoop-$hadoopVer" +$env:PATH = "$env:HADOOP_HOME\bin;" + $env:PATH Pop-Location # ========================== R -$rVer = "3.6.2" -$rToolsVer = "4.0.0" +$rVer = "4.0.2" +$rToolsVer = "4.0.2" InstallR InstallRtools diff --git a/dev/change-scala-version.sh b/dev/change-scala-version.sh index 06411b9b12a0d..48b7f6475117a 100755 --- a/dev/change-scala-version.sh +++ b/dev/change-scala-version.sh @@ -60,6 +60,17 @@ BASEDIR=$(dirname $0)/.. find "$BASEDIR" -name 'pom.xml' -not -path '*target*' -print \ -exec bash -c "sed_i 's/\(artifactId.*\)_'$FROM_VERSION'/\1_'$TO_VERSION'/g' {}" \; +# dependency:get is workaround for SPARK-34762 to download the JAR file of commons-cli. +# Without this, build with Scala 2.13 using SBT will fail because the help plugin used below downloads only the POM file. +COMMONS_CLI_VERSION=`build/mvn help:evaluate -Dexpression=commons-cli.version -q -DforceStdout` +build/mvn dependency:get -Dartifact=commons-cli:commons-cli:${COMMONS_CLI_VERSION} -q + +# Update in parent POM +# First find the right full version from the profile's build +SCALA_VERSION=`build/mvn help:evaluate -Pscala-${TO_VERSION} -Dexpression=scala.version -q -DforceStdout` +sed_i '1,/[0-9]*\.[0-9]*\.[0-9]*[0-9]*\.[0-9]*\.[0-9]*'$SCALA_VERSION' in parent POM # Match any scala binary version to ensure idempotency sed_i '1,/[0-9]*\.[0-9]*[0-9]*\.[0-9]*'$TO_VERSION'[0-9]*\.[0-9]*[0-9 # Update source of scaladocs echo "$BASEDIR/docs/_plugins/copy_api_dirs.rb" +if [ $TO_VERSION = "2.13" ]; then + sed_i '/\-Pscala-'$TO_VERSION'/!s:build/sbt:build/sbt \-Pscala\-'$TO_VERSION':' "$BASEDIR/docs/_plugins/copy_api_dirs.rb" +else + sed_i 's:build/sbt \-Pscala\-'$FROM_VERSION':build/sbt:' "$BASEDIR/docs/_plugins/copy_api_dirs.rb" +fi sed_i 's/scala\-'$FROM_VERSION'/scala\-'$TO_VERSION'/' "$BASEDIR/docs/_plugins/copy_api_dirs.rb" diff --git a/dev/check-license b/dev/check-license index 0cc17ffe55c67..bd255954d6db4 100755 --- a/dev/check-license +++ b/dev/check-license @@ -67,7 +67,7 @@ mkdir -p "$FWDIR"/lib exit 1 } -mkdir target +mkdir -p target $java_cmd -jar "$rat_jar" -E "$FWDIR"/dev/.rat-excludes -d "$FWDIR" > target/rat-results.txt if [ $? -ne 0 ]; then diff --git a/dev/create-release/do-release-docker.sh b/dev/create-release/do-release-docker.sh index 2f794c0e0a174..f1632f01686c7 100755 --- a/dev/create-release/do-release-docker.sh +++ b/dev/create-release/do-release-docker.sh @@ -91,6 +91,11 @@ for f in "$SELF"/*; do fi done +# Add the fallback version of Gemfile, Gemfile.lock and .bundle/config to the local directory. +cp "$SELF/../../docs/Gemfile" "$WORKDIR" +cp "$SELF/../../docs/Gemfile.lock" "$WORKDIR" +cp -r "$SELF/../../docs/.bundle" "$WORKDIR" + GPG_KEY_FILE="$WORKDIR/gpg.key" fcreate_secure "$GPG_KEY_FILE" $GPG --export-secret-key --armor --pinentry-mode loopback --passphrase "$GPG_PASSPHRASE" "$GPG_KEY" > "$GPG_KEY_FILE" diff --git a/dev/create-release/generate-contributors.py b/dev/create-release/generate-contributors.py index d9135173419ae..75965a6a26201 100755 --- a/dev/create-release/generate-contributors.py +++ b/dev/create-release/generate-contributors.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Licensed to the Apache Software Foundation (ASF) under one or more @@ -22,7 +22,9 @@ import re import sys -from releaseutils import * +from releaseutils import tag_exists, get_commits, yesOrNoPrompt, get_date, \ + is_valid_author, capitalize_author, JIRA, find_components, translate_issue_type, \ + translate_component, CORE_COMPONENT, contributors_file_name, nice_join # You must set the following before use! JIRA_API_BASE = os.environ.get("JIRA_API_BASE", "https://issues.apache.org/jira") @@ -31,10 +33,10 @@ # If the release tags are not provided, prompt the user to provide them while not tag_exists(RELEASE_TAG): - RELEASE_TAG = raw_input("Please provide a valid release tag: ") + RELEASE_TAG = input("Please provide a valid release tag: ") while not tag_exists(PREVIOUS_RELEASE_TAG): print("Please specify the previous release tag.") - PREVIOUS_RELEASE_TAG = raw_input( + PREVIOUS_RELEASE_TAG = input( "For instance, if you are releasing v1.2.0, you should specify v1.1.0: ") # Gather commits found in the new tag but not in the old tag. @@ -234,7 +236,7 @@ def populate(issue_type, components): # e.g. * Andrew Or -- Bug fixes in Windows, Core, and Web UI; improvements in Core # e.g. * Tathagata Das -- Bug fixes and new features in Streaming contributors_file = open(contributors_file_name, "w") -authors = author_info.keys() +authors = list(author_info.keys()) authors.sort() for author in authors: contribution = "" diff --git a/dev/create-release/known_translations b/dev/create-release/known_translations index 65c00cce8c9c6..3b599b98c199c 100644 --- a/dev/create-release/known_translations +++ b/dev/create-release/known_translations @@ -1,263 +1,418 @@ # This is a mapping of names to be translated through translate-contributors.py -# The format expected on each line should be: - +# The format expected on each line should be: - +012huang - Weiyi Huang +07ARB - Ankit Raj Boudh +10110346 - Xian Liu +979969786 - Yuming Wang +Achuth17 - Achuth Narayan Rajagopal +Adamyuanyuan - Adam Wang +AiHe - Ai He +Andrew-Crosby - Andrew Crosby +AngersZhuuuu - Yi Zhu +BenFradet - Ben Fradet +Bilna - Bilna P +ClassNotFoundExp - Fu Xing CodingCat - Nan Zhu CrazyJvm - Chao Chen +Deegue - Yizhong Zhang +DoingDone9 - Doing Done +DylanGuedes - Dylan Guedes +Earne - Ernest EugenCepoi - Eugen Cepoi +FavioVazquez - Favio Vazquez +FlytxtRnD - Meethu Mathew +GenTang - Gen TANG GraceH - Jie Huang +Gschiavon - German Schiavon Matteo +GuoPhilipse - Philipse Guo +HeartSaVioR - Jungtaek Lim +Hellsen83 - Erik Christiansen +HyukjinKwon - Hyukjin Kwon +Icysandwich - Icysandwich +JDrit - Joseph Batchik +JasonWayne - Wenjie Wu +JaysonSunshine - Jayson Sunshine JerryLead - Lijie Xu +JiahuiJiang - Jiahui Jiang +JkSelf - Ke Jia +JoanFM - Joan Fontanals +JoshRosen - Josh Rosen +JuhongPark - Juhong Park +JulienPeloton - Julien Peloton +KaiXinXiaoLei - KaiXinXIaoLei +KevinGrealish - Kevin Grealish +KevinZwx - Kevin Zhang +Koraseg - Artem Kupchinskiy +KyleLi1985 - Liang Li +LantaoJin - Lantao Jin +Lemonjing - Rann Tao Leolh - Liu Hao Lewuathe - Kai Sasaki +LiShuMing - Shuming Li +LinhongLiu - Linhong Liu +Liuchang0812 - Liu Chang +LucaCanali - Luca Canali +LuciferYang - Yang Jie +MasterDDT - Mitesh Patel +MaxGekk - Maxim Gekk +MechCoder - Manoj Kumar +NamelessAnalyst - NamelessAnalyst +Ngone51 - Yi Wu +OopsOutOfMemory - Sheng Li +PavithraRamachandran - Pavithra Ramachandran +Peishen-Jia - Peishen Jia RongGu - Rong Gu +Rosstin - Rosstin Murphy +SaintBacchus - Huang Zhaowei +Sephiroth-Lin - Sephiroth Lin Shiti - Shiti Saxena +SongYadong - Yadong Song +TJX2014 - Jinxin Tang +TigerYang414 - David Yang +TomokoKomiyama - Tomoko Komiyama +TopGunViper - TopGunViper +Udbhav30 - Udbhav Agrawal Victsm - Min Shen +VinceShieh - Vincent Xie +WangGuangxin - Guangxin Wang WangTaoTheTonic - Wang Tao +WeichenXu123 - Weichen Xu +William1104 - William Wong +XD-DENG - Xiaodong Deng XuTingjun - Tingjun Xu YanTangZhai - Yantang Zhai +YongjinZhou - Yongjin Zhou +Yunni - Yun Ni +aai95 - Aleksei Izmalkin +aaruna - Aaruna Godthi +actuaryzhang - Wayne Zhang +adrian555 - Weiqiang Zhuang +ajithme - Ajith S +akonopko - Alexander Konopko alexdebrie - Alex DeBrie +alicegugu - Gu Huiqin Alice +allisonwang-db - Allison Wang alokito - Alok Saldanha +alyaxey - Alex Slusarenko +amanomer - Aman Omer +ameyc - Amey Chaugule +anabranch - Bill Chambers anantasty - Anant Asthana +ancasarb - Anca Sarb +anchovYu - Xinyi Yu andrewor14 - Andrew Or aniketbhatnagar - Aniket Bhatnagar +animeshbaranawal - Animesh Baranawal +ankuriitg - Ankur Gupta +aokolnychyi - Anton Okolnychyi arahuja - Arun Ahuja +arucard21 - Riaas Mokiem +ashangit - Nicolas Fraison +attilapiros - Attila Zsolt Piros +avkgh - Aleksandr Kashkirov +avulanov - Alexander Ulanov +ayudovin - Artsiom Yudovin +azagrebin - Andrey Zagrebin +baishuo - Shuo Bai +bartosz25 - Bartosz Konieczny +beliefer - Jiaan Geng +bettermouse - Chen Hao +biglobster - Liang Ke +bravo-zhang - Bravo Zhang brkyvz - Burak Yavuz +bscan - Brian Scannell +bzz - Alexander Bezzubov +cafreeman - Chris Freeman +caneGuy - Kang Zhou +cchung100m - Neo Chien +cclauss - Christian Clauss +cenyuhai - Yuhai Cen +chakravarthiT - Chakravarthi +chandulal - Chandu Kavar +chaoslawful - Xiaozhe Wang chesterxgchen - Chester Chen chiragaggarwal - Chirag Aggarwal +chitralverma - Chitral Verma chouqin - Qiping Li +cjn082030 - Juanni Chen +cloud-fan - Wenchen Fan +cluo512 - Chuan Luo cocoatomo - Tomohiko K. +codeatri - Neha Patil +codeborui - codeborui coderfi - Fairiz Azizi coderxiang - Shuo Xiang +codlife - Jianfei Wang +colinmjj - Colin Ma +crafty-coder - Carlos Pena +cxzl25 - Shaoyun Chen +cyq89051127 - Yongqiang Chai +darrentirto - Darren Tirto +david-weiluo-ren - Weiluo (David) Ren +daviddingly - Xiaoyuan Ding +davidvrba - David Vrba davies - Davies Liu +dding3 - Ding Ding +debugger87 - Chaozhong Yang +deepyaman - Deepyaman Datta +denglingang - Lingang Deng +dengziming - dengziming +deshanxiao - deshanxiao +dima-asana - Dima Kamalov +dlindelof - David Lindelof +dobashim - Masaru Dobashi +dongjoon-hyun - Dongjoon Hyun +e-dorigatti - Emilio Dorigatti +eatoncys - Yanshan Chen +ehnalis - Zoltan Zvara +emres - Emre Sevinc epahomov - Egor Pahomov +eric-maynard - Eric Maynard falaki - Hossein Falaki -freeman-lab - Jeremy Freeman -industrial-sloth - Jascha Swisher -jackylk - Jacky Li -jayunit100 - Jay Vyas -jerryshao - Saisai Shao -jkbradley - Joseph Bradley -lianhuiwang - Lianhui Wang -lirui-intel - Rui Li -luluorta - Lu Lu -luogankun - Gankun Luo -maji2014 - Derek Ma -mccheah - Matthew Cheah -mengxr - Xiangrui Meng -nartz - Nathan Artz -odedz - Oded Zimerman -ravipesala - Ravindra Pesala -roxchkplusony - Victor Tso -scwf - Wang Fei -shimingfei - Shiming Fei -surq - Surong Quan -suyanNone - Su Yan -tedyu - Ted Yu -tigerquoll - Dale Richardson -wangxiaojing - Xiaojing Wang -watermen - Yadong Qi -witgo - Guoqiang Li -xinyunh - Xinyun Huang -zsxwing - Shixiong Zhu -Bilna - Bilna P -DoingDone9 - Doing Done -Earne - Ernest -FlytxtRnD - Meethu Mathew -GenTang - Gen TANG -JoshRosen - Josh Rosen -MechCoder - Manoj Kumar -OopsOutOfMemory - Sheng Li -Peishen-Jia - Peishen Jia -SaintBacchus - Huang Zhaowei -azagrebin - Andrey Zagrebin -bzz - Alexander Bezzubov +fan31415 - Yijie Fan +fe2s - Oleksiy Dyagilev +felixalbani - Felix Albani +felixcheung - Felix Cheung +feynmanliang - Feynman Liang +fidato13 - Tarun Kumar +fitermay - Yuli Fiterman +fjh100456 - Jinhua Fu fjiang6 - Fan Jiang +francis0407 - Mingcong Han +freeman-lab - Jeremy Freeman +frreiss - Fred Reiss +fuwhu - Fuwang Hu gasparms - Gaspar Munoz +gatorsmile - Xiao Li +gchen - Guancheng Chen +gss2002 - Greg Senia guowei2 - Guo Wei +guoxiaolongzte - Xiaolong Guo +haiyangsea - Haiyang Sea +hayashidac - Chie Hayashida +hddong - Dongdong Hong +heary-cao - Xuewen Cao +hehuiyuan - hehuiyuan +helenyugithub - Helen Yu hhbyyh - Yuhao Yang +highmoutain - highmoutain +hlin09 - Hao Lin +hqzizania - Qian Huang hseagle - Peng Xu +httfighter - Tiantian Han +huangtianhua - huangtianhua +huangweizhe123 - Weizhe Huang +hvanhovell - Herman Van Hovell +iRakson - Rakesh Raushan +igorcalabria - Igor Calabria +imback82 - Terry Kim +industrial-sloth - Jascha Swisher +invkrh - Hao Ren +itholic - Haejoon Lee +ivoson - Tengfei Huang +jackylk - Jacky Li +jagadeesanas2 - Jagadeesan A S javadba - Stephen Boesch +javierivanov - Javier Fuentes +jayunit100 - Jay Vyas jbencook - Ben Cook -kul - Kuldeep -ligangty - Gang Li -marsishandsome - Liangliang Gu -medale - Markus Dale -nemccarthy - Nathan McCarthy -nxwhite-str - Nate Crosswhite -seayi - Xiaohua Yi -tianyi - Yi Tian -uncleGen - Uncle Gen -viper-kun - Xu Kun -x1- - Yuri Saito -zapletal-martin - Martin Zapletal -zuxqoj - Shekhar Bansal -mingyukim - Mingyu Kim -sigmoidanalytics - Mayur Rustagi -AiHe - Ai He -BenFradet - Ben Fradet -FavioVazquez - Favio Vazquez -JaysonSunshine - Jayson Sunshine -Liuchang0812 - Liu Chang -Sephiroth-Lin - Sephiroth Lin -dobashim - Masaru Dobashi -ehnalis - Zoltan Zvara -emres - Emre Sevinc -gchen - Guancheng Chen -haiyangsea - Haiyang Sea -hlin09 - Hao Lin -hqzizania - Qian Huang jeanlyn - Jean Lyn jerluc - Jeremy A. Lucas +jerryshao - Saisai Shao +jiangxb1987 - Jiang Xingbo +jinxing64 - Jin Xing +jisookim0513 - Jisoo Kim +jkbradley - Joseph Bradley +joelgenter - Joel Genter +josepablocam - Jose Cambronero jrabary - Jaonary Rabarisoa judynash - Judy Nash +junyangq - Junyang Qian +kai-zeng - Kai Zeng kaka1992 - Chen Song +ketank-new - Ketan Kunde +krishnakalyan3 - Krishna Kalyan ksonj - Kalle Jepsen +kul - Kuldeep kuromatsu-nobuyuki - Nobuyuki Kuromatsu +laskfla - Keith Sun lazyman500 - Dong Xu +lcqzte10192193 - Chaoqun Li leahmcguire - Leah McGuire -mbittmann - Mark Bittmann -mbonaci - Marko Bonaci -meawoppl - Matthew Goodman -nyaapa - Arsenii Krasikov -phatak-dev - Madhukara Phatak -prabeesh - Prabeesh K -rakeshchalasani - Rakesh Chalasani -rekhajoshm - Rekha Joshi -sisihj - June He -szheng79 - Shuai Zheng -texasmichelle - Michelle Casbon -vinodkc - Vinod KC -yongtang - Yong Tang -ypcat - Pei-Lun Lee -zhichao-li - Zhichao Li -zzcclp - Zhichao Zhang -979969786 - Yuming Wang -Rosstin - Rosstin Murphy -ameyc - Amey Chaugule -animeshbaranawal - Animesh Baranawal -cafreeman - Chris Freeman +leanken - Leanken Lin lee19 - Lee -lockwobr - Brian Lockwood -navis - Navis Ryu -pparkkin - Paavo Parkkinen -HyukjinKwon - Hyukjin Kwon -JDrit - Joseph Batchik -JuhongPark - Juhong Park -KaiXinXiaoLei - KaiXinXIaoLei -NamelessAnalyst - NamelessAnalyst -alyaxey - Alex Slusarenko -baishuo - Shuo Bai -fe2s - Oleksiy Dyagilev -felixcheung - Felix Cheung -feynmanliang - Feynman Liang -josepablocam - Jose Cambronero -kai-zeng - Kai Zeng -mosessky - mosessky -msannell - Michael Sannella -nishkamravi2 - Nishkam Ravi -noel-smith - Noel Smith -petz2000 - Patrick Baier -qiansl127 - Shilei Qian -rahulpalamuttam - Rahul Palamuttam -rowan000 - Rowan Chattaway -sarutak - Kousuke Saruta -sethah - Seth Hendrickson -small-wang - Wang Wei -stanzhai - Stan Zhai -tien-dungle - Tien-Dung Le -xuchenCN - Xu Chen -zhangjiajin - Zhang JiaJin -ClassNotFoundExp - Fu Xing -KevinGrealish - Kevin Grealish -MasterDDT - Mitesh Patel -VinceShieh - Vincent Xie -WeichenXu123 - Weichen Xu -Yunni - Yun Ni -actuaryzhang - Wayne Zhang -alicegugu - Gu Huiqin Alice -anabranch - Bill Chambers -ashangit - Nicolas Fraison -avulanov - Alexander Ulanov -biglobster - Liang Ke -cenyuhai - Yuhai Cen -codlife - Jianfei Wang -david-weiluo-ren - Weiluo (David) Ren -dding3 - Ding Ding -fidato13 - Tarun Kumar -frreiss - Fred Reiss -gatorsmile - Xiao Li -hayashidac - Chie Hayashida -invkrh - Hao Ren -jagadeesanas2 - Jagadeesan A S -jiangxb1987 - Jiang Xingbo -jisookim0513 - Jisoo Kim -junyangq - Junyang Qian -krishnakalyan3 - Krishna Kalyan -linbojin - Linbo Jin -mpjlu - Peng Meng -neggert - Nic Eggert -petermaxlee - Peter Lee -phalodi - Sandeep Purohit -pkch - pkch -priyankagargnitk - Priyanka Garg -sharkdtu - Xiaogang Tu -shenh062326 - Shen Hong -aokolnychyi - Anton Okolnychyi +leoluan2009 - Xuedong Luan +liangxs - Xuesen Liang +lianhuiwang - Lianhui Wang +lidinghao - Li Hao +ligangty - Gang Li linbojin - Linbo Jin -lw-lin - Liwei Lin -10110346 - Xian Liu -Achuth17 - Achuth Narayan Rajagopal -Adamyuanyuan - Adam Wang -DylanGuedes - Dylan Guedes -JiahuiJiang - Jiahui Jiang -KevinZwx - Kevin Zhang -LantaoJin - Lantao Jin -Lemonjing - Rann Tao -LucaCanali - Luca Canali -XD-DENG - Xiaodong Deng -aai95 - Aleksei Izmalkin -akonopko - Alexander Konopko -ankuriitg - Ankur Gupta -arucard21 - Riaas Mokiem -attilapiros - Attila Zsolt Piros -bravo-zhang - Bravo Zhang -caneGuy - Kang Zhou -chaoslawful - Xiaozhe Wang -cluo512 - Chuan Luo -codeatri - Neha Patil -crafty-coder - Carlos Pena -debugger87 - Chaozhong Yang -e-dorigatti - Emilio Dorigatti -eric-maynard - Eric Maynard -felixalbani - Felix Albani -fjh100456 - Jinhua Fu -guoxiaolongzte - Xiaolong Guo -heary-cao - Xuewen Cao -huangweizhe123 - Weizhe Huang -ivoson - Tengfei Huang -jinxing64 - Jin Xing +linehrr - Ryne Yang +linzebing - Zebing Lin +lipzhu - Lipeng Zhu +lirui-intel - Rui Li liu-zhaokun - Zhaokun Liu +liucht-inspur - liucht-inspur +liupc - Pengcheng Liu liutang123 - Lijia Liu +liwensun - Liwen Sun +lockwobr - Brian Lockwood +luluorta - Lu Lu +luogankun - Gankun Luo +lw-lin - Liwei Lin +maji2014 - Derek Ma +manuzhang - Manu Zhang +mareksimunek - Marek Simunek maropu - Takeshi Yamamuro +marsishandsome - Liangliang Gu maryannxue - Maryann Xue +masa3141 - Masahiro Kazama +mbittmann - Mark Bittmann +mbonaci - Marko Bonaci +mccheah - Matthew Cheah mcteo - Thomas Dunne +mdianjun - Dianjun Ma +meawoppl - Matthew Goodman +medale - Markus Dale +mengxr - Xiangrui Meng +merrily01 - Ruilei Ma +mingyukim - Mingyu Kim mn-mikke - Marek Novotny +mob-ai - mob-ai +mosessky - mosessky +mpjlu - Peng Meng +msannell - Michael Sannella +mu5358271 - Shuheng Dai +mwlon - Martin Loncaric myroslavlisniak - Myroslav Lisniak +nandorKollar - Nandor Kollar +nartz - Nathan Artz +navis - Navis Ryu +neggert - Nic Eggert +nemccarthy - Nathan McCarthy +nishkamravi2 - Nishkam Ravi +noel-smith - Noel Smith +nooberfsh - nooberfsh npoggi - Nicolas Poggi +nxwhite-str - Nate Crosswhite +nyaapa - Arsenii Krasikov +odedz - Oded Zimerman +oleg-smith - Oleg Kuznetsov +ozancicek - Ozan Cicekci +pengbo - Peng Bo +petermaxlee - Peter Lee +petz2000 - Patrick Baier pgandhi999 - Parth Gandhi +phalodi - Sandeep Purohit +phatak-dev - Madhukara Phatak +pkch - pkch +planga82 - Pablo Langa Blanco +pparkkin - Paavo Parkkinen +prabeesh - Prabeesh K +praneetsharma - Praneet Sharma +priyankagargnitk - Priyanka Garg +ptkool - Michael Styles +qb-tarushg - Tarush Grover +qiansl127 - Shilei Qian +rahulpalamuttam - Rahul Palamuttam +rakeshchalasani - Rakesh Chalasani +ravipesala - Ravindra Pesala +redsanket - Sanket Reddy +redsk - Nicola Bova +rekhajoshm - Rekha Joshi rimolive - Ricardo Martinelli De Oliveira +roland1982 - Roland Pogonyi +rongma1997 - Rong Ma +rowan000 - Rowan Chattaway +roxchkplusony - Victor Tso +rrusso2007 - Rob Russo sadhen - Darcy Shen +samsetegne - Samuel L. Setegne sandeep-katta - Sandeep Katta +sangramga - Sangram Gaikwad +sarthfrey - Sarth Frey +sarutak - Kousuke Saruta +scwf - Wang Fei seancxmao - Chenxiao Mao +seayi - Xiaohua Yi +seayoun - Haiyang Yu sel - Steve Larkin +sethah - Seth Hendrickson +sev7e0 - Jiaqi Li +shahidki31 - Shahid K I +sharangk - Sharanabasappa G Keriwaddi +sharkdtu - Xiaogang Tu +sheepstop - Ting Yang +shenh062326 - Shen Hong shimamoto - Takako Shimamoto +shimingfei - Shiming Fei +shivsood - Shiv Prashant Sood shivusondur - Shivakumar Sondur +sigmoidanalytics - Mayur Rustagi +sisihj - June He +sitegui - Guilherme Souza skonto - Stavros Kontopoulos +slamke - Sun Ke +small-wang - Wang Wei +southernriver - Liang Chen +squito - Imran Rashid +stanzhai - Stan Zhai +stczwd - Jackey Lee +sujith71955 - Sujith Chacko +surq - Surong Quan +suxingfate - Xinglong Wang +suyanNone - Su Yan +szheng79 - Shuai Zheng +tanelk - Tanel Kiis +tedyu - Ted Yu +teeyog - Yong Tian +texasmichelle - Michelle Casbon +tianyi - Yi Tian +tien-dungle - Tien-Dung Le +tigerquoll - Dale Richardson +tinhto-000 - Tin Hang To +tools4origins - tools4origins +triplesheep - triplesheep trystanleftwich - Trystan Leftwich +turboFei - Fei Wang ueshin - Takuya Ueshin +ulysses-you - Xiduo You +uncleGen - Uncle Gen +uzadude - Ohad Raviv uzmijnlm - Weizhe Huang +vinodkc - Vinod KC +viper-kun - Xu Kun +wackxu - Shiwei Xu +wangjiaochun - Jiaochun Wang +wangshisan - wangshisan +wangxiaojing - Xiaojing Wang +watermen - Yadong Qi +weixiuli - XiuLi Wei +wenfang6 - wenfang6 +wenxuanguan - wenxuanguan +williamhyun - William Hyun +windpiger - Song Jun +witgo - Guoqiang Li +woudygao - Woudy Gao +x1- - Yuri Saito +xianyinxin - Xianyin Xin +xinyunh - Xinyun Huang xuanyuanking - Yuanjian Li xubo245 - Bo Xu +xuchenCN - Xu Chen xueyumusic - Xue Yu yanlin-Lynn - Yanlin Wang +yongtang - Yong Tang +ypcat - Pei-Lun Lee yucai - Yucai Yu +yunzoud - Yun Zou +zapletal-martin - Martin Zapletal +zero323 - Maciej Szymkiewicz +zhangjiajin - Zhang JiaJin zhengruifeng - Ruifeng Zheng +zhichao-li - Zhichao Li +zjf2012 - Jiafu Zhang +zsxwing - Shixiong Zhu zuotingbing - Tingbing Zuo +zuxqoj - Shekhar Bansal +zzcclp - Zhichao Zhang diff --git a/dev/create-release/release-build.sh b/dev/create-release/release-build.sh index 655b079ac28bf..f406be9548c31 100755 --- a/dev/create-release/release-build.sh +++ b/dev/create-release/release-build.sh @@ -97,6 +97,7 @@ git clone "$ASF_REPO" cd spark git checkout $GIT_REF git_hash=`git rev-parse --short HEAD` +export GIT_HASH=$git_hash echo "Checked out Spark git hash $git_hash" if [ -z "$SPARK_VERSION" ]; then @@ -114,16 +115,10 @@ if [[ $SPARK_VERSION > "2.3" ]]; then BASE_PROFILES="$BASE_PROFILES -Pkubernetes" fi -# TODO: revisit for Scala 2.13 - -PUBLISH_SCALA_2_11=1 -SCALA_2_11_PROFILES="-Pscala-2.11" -if [[ $SPARK_VERSION > "2.3" ]]; then - if [[ $SPARK_VERSION < "3.0." ]]; then - SCALA_2_11_PROFILES="-Pkafka-0-8 -Pflume $SCALA_2_11_PROFILES" - else - PUBLISH_SCALA_2_11=0 - fi +PUBLISH_SCALA_2_13=1 +SCALA_2_13_PROFILES="-Pscala-2.13" +if [[ $SPARK_VERSION < "3.2" ]]; then + PUBLISH_SCALA_2_13=0 fi PUBLISH_SCALA_2_12=0 @@ -164,9 +159,11 @@ fi DEST_DIR_NAME="$SPARK_PACKAGE_VERSION" git clean -d -f -x -rm .gitignore +rm -f .gitignore cd .. +export MAVEN_OPTS="-Xmx12g" + if [[ "$1" == "package" ]]; then # Source and binary tarballs echo "Packaging release source tarballs" @@ -174,20 +171,17 @@ if [[ "$1" == "package" ]]; then # For source release in v2.4+, exclude copy of binary license/notice if [[ $SPARK_VERSION > "2.4" ]]; then - rm spark-$SPARK_VERSION/LICENSE-binary - rm spark-$SPARK_VERSION/NOTICE-binary - rm -r spark-$SPARK_VERSION/licenses-binary + rm -f spark-$SPARK_VERSION/LICENSE-binary + rm -f spark-$SPARK_VERSION/NOTICE-binary + rm -rf spark-$SPARK_VERSION/licenses-binary fi tar cvzf spark-$SPARK_VERSION.tgz --exclude spark-$SPARK_VERSION/.git spark-$SPARK_VERSION echo $GPG_PASSPHRASE | $GPG --passphrase-fd 0 --armour --output spark-$SPARK_VERSION.tgz.asc \ --detach-sig spark-$SPARK_VERSION.tgz - echo $GPG_PASSPHRASE | $GPG --passphrase-fd 0 --print-md \ - SHA512 spark-$SPARK_VERSION.tgz > spark-$SPARK_VERSION.tgz.sha512 + shasum -a 512 spark-$SPARK_VERSION.tgz > spark-$SPARK_VERSION.tgz.sha512 rm -rf spark-$SPARK_VERSION - ZINC_PORT=3035 - # Updated for each binary build make_binary_release() { NAME=$1 @@ -205,17 +199,12 @@ if [[ "$1" == "package" ]]; then R_FLAG="--r" fi - # We increment the Zinc port each time to avoid OOM's and other craziness if multiple builds - # share the same Zinc server. - ZINC_PORT=$((ZINC_PORT + 1)) - echo "Building binary dist $NAME" cp -r spark spark-$SPARK_VERSION-bin-$NAME cd spark-$SPARK_VERSION-bin-$NAME ./dev/change-scala-version.sh $SCALA_VERSION - export ZINC_PORT=$ZINC_PORT echo "Creating distribution: $NAME ($FLAGS)" # Write out the VERSION to PySpark version info we rewrite the - into a . and SNAPSHOT @@ -228,8 +217,7 @@ if [[ "$1" == "package" ]]; then echo "Creating distribution" ./dev/make-distribution.sh --name $NAME --mvn $MVN_HOME/bin/mvn --tgz \ - $PIP_FLAG $R_FLAG $FLAGS \ - -DzincPort=$ZINC_PORT 2>&1 > ../binary-release-$NAME.log + $PIP_FLAG $R_FLAG $FLAGS 2>&1 > ../binary-release-$NAME.log cd .. if [[ -n $R_FLAG ]]; then @@ -275,26 +263,28 @@ if [[ "$1" == "package" ]]; then # In dry run mode, only build the first one. The keys in BINARY_PKGS_ARGS are used as the # list of packages to be built, so it's ok for things to be missing in BINARY_PKGS_EXTRA. + # NOTE: Don't forget to update the valid combinations of distributions at + # 'python/pyspark/install.py' and 'python/docs/source/getting_started/install.rst' + # if you're changing them. declare -A BINARY_PKGS_ARGS - BINARY_PKGS_ARGS["hadoop2.7"]="-Phadoop-2.7 $HIVE_PROFILES" + BINARY_PKGS_ARGS["hadoop3.2"]="-Phadoop-3.2 $HIVE_PROFILES" if ! is_dry_run; then BINARY_PKGS_ARGS["without-hadoop"]="-Phadoop-provided" if [[ $SPARK_VERSION < "3.0." ]]; then BINARY_PKGS_ARGS["hadoop2.6"]="-Phadoop-2.6 $HIVE_PROFILES" else - BINARY_PKGS_ARGS["hadoop2.7-hive1.2"]="-Phadoop-2.7 -Phive-1.2 $HIVE_PROFILES" - BINARY_PKGS_ARGS["hadoop3.2"]="-Phadoop-3.2 $HIVE_PROFILES" + BINARY_PKGS_ARGS["hadoop2.7"]="-Phadoop-2.7 $HIVE_PROFILES" fi fi declare -A BINARY_PKGS_EXTRA - BINARY_PKGS_EXTRA["hadoop2.7"]="withpip,withr" + BINARY_PKGS_EXTRA["hadoop3.2"]="withpip,withr" - if [[ $PUBLISH_SCALA_2_11 = 1 ]]; then - key="without-hadoop-scala-2.11" - args="-Phadoop-provided" + if [[ $PUBLISH_SCALA_2_13 = 1 ]]; then + key="hadoop3.2-scala2.13" + args="-Phadoop-3.2 $HIVE_PROFILES" extra="" - if ! make_binary_release "$key" "$SCALA_2_11_PROFILES $args" "$extra" "2.11"; then + if ! make_binary_release "$key" "$SCALA_2_13_PROFILES $args" "$extra" "2.13"; then error "Failed to build $key package. Check logs for details." fi fi @@ -338,7 +328,13 @@ if [[ "$1" == "docs" ]]; then echo "Building Spark docs" cd docs # TODO: Make configurable to add this: PRODUCTION=1 - PRODUCTION=1 RELEASE_VERSION="$SPARK_VERSION" jekyll build + if [ ! -f "Gemfile" ]; then + cp "$SELF/Gemfile" . + cp "$SELF/Gemfile.lock" . + cp -r "$SELF/.bundle" . + fi + bundle install + PRODUCTION=1 RELEASE_VERSION="$SPARK_VERSION" bundle exec jekyll build cd .. cd .. @@ -379,10 +375,12 @@ if [[ "$1" == "publish-snapshot" ]]; then echo "$ASF_PASSWORD" >> $tmp_settings echo "" >> $tmp_settings - # Generate random point for Zinc - export ZINC_PORT=$(python -S -c "import random; print random.randrange(3030,4030)") + $MVN --settings $tmp_settings -DskipTests $SCALA_2_12_PROFILES $PUBLISH_PROFILES clean deploy - $MVN -DzincPort=$ZINC_PORT --settings $tmp_settings -DskipTests $SCALA_2_12_PROFILES $PUBLISH_PROFILES deploy + if [[ $PUBLISH_SCALA_2_13 = 1 ]]; then + ./dev/change-scala-version.sh 2.13 + $MVN --settings $tmp_settings -DskipTests $SCALA_2_13_PROFILES $PUBLISH_PROFILES clean deploy + fi rm $tmp_settings cd .. @@ -411,21 +409,16 @@ if [[ "$1" == "publish-release" ]]; then tmp_repo=$(mktemp -d spark-repo-XXXXX) - # Generate random point for Zinc - export ZINC_PORT=$(python -S -c "import random; print random.randrange(3030,4030)") - - # TODO: revisit for Scala 2.13 support - - if [[ $PUBLISH_SCALA_2_11 = 1 ]]; then - ./dev/change-scala-version.sh 2.11 - $MVN -DzincPort=$ZINC_PORT -Dmaven.repo.local=$tmp_repo -DskipTests \ - $SCALA_2_11_PROFILES $PUBLISH_PROFILES clean install + if [[ $PUBLISH_SCALA_2_13 = 1 ]]; then + ./dev/change-scala-version.sh 2.13 + $MVN -Dmaven.repo.local=$tmp_repo -DskipTests \ + $SCALA_2_13_PROFILES $PUBLISH_PROFILES clean install fi if [[ $PUBLISH_SCALA_2_12 = 1 ]]; then ./dev/change-scala-version.sh 2.12 - $MVN -DzincPort=$((ZINC_PORT + 2)) -Dmaven.repo.local=$tmp_repo -DskipTests \ - $SCALA_2_11_PROFILES $PUBLISH_PROFILES clean install + $MVN -Dmaven.repo.local=$tmp_repo -DskipTests \ + $SCALA_2_12_PROFILES $PUBLISH_PROFILES clean install fi pushd $tmp_repo/org/apache/spark @@ -451,7 +444,7 @@ if [[ "$1" == "publish-release" ]]; then if ! is_dry_run; then nexus_upload=$NEXUS_ROOT/deployByRepositoryId/$staged_repo_id - echo "Uplading files to $nexus_upload" + echo "Uploading files to $nexus_upload" for file in $(find . -type f) do # strip leading ./ diff --git a/dev/create-release/release-tag.sh b/dev/create-release/release-tag.sh index 39856a9955955..a9a518f9e10d7 100755 --- a/dev/create-release/release-tag.sh +++ b/dev/create-release/release-tag.sh @@ -64,8 +64,12 @@ init_maven_sbt ASF_SPARK_REPO="gitbox.apache.org/repos/asf/spark.git" +function uriencode { jq -nSRr --arg v "$1" '$v|@uri'; } + +declare -r ENCODED_ASF_PASSWORD=$(uriencode "$ASF_PASSWORD") + rm -rf spark -git clone "https://$ASF_USERNAME:$ASF_PASSWORD@$ASF_SPARK_REPO" -b $GIT_BRANCH +git clone "https://$ASF_USERNAME:$ENCODED_ASF_PASSWORD@$ASF_SPARK_REPO" -b $GIT_BRANCH cd spark git config user.name "$GIT_NAME" diff --git a/dev/create-release/release-util.sh b/dev/create-release/release-util.sh index af9ed201b3b47..7961eed850891 100755 --- a/dev/create-release/release-util.sh +++ b/dev/create-release/release-util.sh @@ -228,7 +228,7 @@ function init_maven_sbt { if [[ $JAVA_VERSION < "1.8." ]]; then # Needed for maven central when using Java 7. SBT_OPTS="-Dhttps.protocols=TLSv1.1,TLSv1.2" - MVN_EXTRA_OPTS="-Dhttps.protocols=TLSv1.1,TLSv1.2" + MVN_EXTRA_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g -Dhttps.protocols=TLSv1.1,TLSv1.2" MVN="$MVN $MVN_EXTRA_OPTS" fi export MVN MVN_EXTRA_OPTS SBT_OPTS diff --git a/dev/create-release/releaseutils.py b/dev/create-release/releaseutils.py index a5a26ae8f5354..94e255bd440b8 100755 --- a/dev/create-release/releaseutils.py +++ b/dev/create-release/releaseutils.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Licensed to the Apache Software Foundation (ASF) under one or more @@ -23,7 +23,7 @@ from subprocess import Popen, PIPE try: - from jira.client import JIRA + from jira.client import JIRA # noqa: F401 # Old versions have JIRAError in exceptions package, new (0.5+) in utils. try: from jira.exceptions import JIRAError @@ -31,26 +31,17 @@ from jira.utils import JIRAError except ImportError: print("This tool requires the jira-python library") - print("Install using 'sudo pip install jira'") + print("Install using 'sudo pip3 install jira'") sys.exit(-1) try: - from github import Github + from github import Github # noqa: F401 from github import GithubException except ImportError: print("This tool requires the PyGithub library") print("Install using 'sudo pip install PyGithub'") sys.exit(-1) -try: - import unidecode -except ImportError: - print("This tool requires the unidecode library to decode obscure github usernames") - print("Install using 'sudo pip install unidecode'") - sys.exit(-1) - -if sys.version < '3': - input = raw_input # noqa # Contributors list file name contributors_file_name = "contributors.txt" @@ -66,11 +57,11 @@ def yesOrNoPrompt(msg): # Utility functions run git commands (written with Git 1.8.5) def run_cmd(cmd): - return Popen(cmd, stdout=PIPE).communicate()[0] + return Popen(cmd, stdout=PIPE).communicate()[0].decode("utf8") def run_cmd_error(cmd): - return Popen(cmd, stdout=PIPE, stderr=PIPE).communicate()[1] + return Popen(cmd, stdout=PIPE, stderr=PIPE).communicate()[1].decode("utf8") def get_date(commit_hash): @@ -112,7 +103,7 @@ def __str__(self): # Under the hood, this runs a `git log` on that tag and parses the fields # from the command output to construct a list of Commit objects. Note that # because certain fields reside in the commit description and cannot be parsed -# through the Github API itself, we need to do some intelligent regex parsing +# through the GitHub API itself, we need to do some intelligent regex parsing # to extract those fields. # # This is written using Git 1.8.5. @@ -142,7 +133,7 @@ def get_commits(tag): sys.exit("Unexpected format in commit: %s" % commit_digest) [_hash, author, title] = commit_digest.split(field_end_marker) # The PR number and github username is in the commit message - # itself and cannot be accessed through any Github API + # itself and cannot be accessed through any GitHub API pr_number = None match = re.search("Closes #([0-9]+) from ([^/\\s]+)/", commit_body) if match: @@ -151,12 +142,7 @@ def get_commits(tag): # username so we can translate it properly later if not is_valid_author(author): author = github_username - # Guard against special characters - try: # Python 2 - author = unicode(author, "UTF-8") - except NameError: # Python 3 - author = str(author) - author = unidecode.unidecode(author).strip() + author = author.strip() commit = Commit(_hash, author, title, pr_number) commits.append(commit) return commits @@ -257,7 +243,7 @@ def nice_join(str_list): return ", ".join(str_list[:-1]) + ", and " + str_list[-1] -# Return the full name of the specified user on Github +# Return the full name of the specified user on GitHub # If the user doesn't exist, return None def get_github_name(author, github_client): if github_client: diff --git a/dev/create-release/spark-rm/Dockerfile b/dev/create-release/spark-rm/Dockerfile index 540dc90f42817..2751f3a1800bd 100644 --- a/dev/create-release/spark-rm/Dockerfile +++ b/dev/create-release/spark-rm/Dockerfile @@ -15,16 +15,20 @@ # limitations under the License. # -# Image for building Spark releases. Based on Ubuntu 18.04. +# Image for building Spark releases. Based on Ubuntu 20.04. # # Includes: # * Java 8 # * Ivy -# * Python (2.7.15/3.6.7) -# * R-base/R-base-dev (3.6.1) -# * Ruby 2.3 build utilities +# * Python (3.8.5) +# * R-base/R-base-dev (4.0.3) +# * Ruby (2.7.0) +# +# You can test it as below: +# cd dev/create-release/spark-rm +# docker build -t spark-rm --build-arg UID=$UID . -FROM ubuntu:18.04 +FROM ubuntu:20.04 # For apt to be noninteractive ENV DEBIAN_FRONTEND noninteractive @@ -33,8 +37,11 @@ ENV DEBCONF_NONINTERACTIVE_SEEN true # These arguments are just for reuse and not really meant to be customized. ARG APT_INSTALL="apt-get install --no-install-recommends -y" -ARG PIP_PKGS="sphinx==2.3.1 mkdocs==1.0.4 numpy==1.18.1" -ARG GEM_PKGS="jekyll:4.0.0 jekyll-redirect-from:0.16.0 rouge:3.15.0" +# TODO(SPARK-32407): Sphinx 3.1+ does not correctly index nested classes. +# See also https://github.com/sphinx-doc/sphinx/issues/7551. +# We should use the latest Sphinx version once this is fixed. +ARG PIP_PKGS="sphinx==3.0.4 mkdocs==1.1.2 numpy==1.19.4 pydata_sphinx_theme==0.4.1 ipython==7.19.0 nbsphinx==0.8.0 numpydoc==1.1.0" +ARG GEM_PKGS="bundler:2.2.9" # Install extra needed repos and refresh. # - CRAN repo @@ -43,7 +50,7 @@ ARG GEM_PKGS="jekyll:4.0.0 jekyll-redirect-from:0.16.0 rouge:3.15.0" # This is all in a single "RUN" command so that if anything changes, "apt update" is run to fetch # the most current package versions (instead of potentially using old versions cached by docker). RUN apt-get clean && apt-get update && $APT_INSTALL gnupg ca-certificates && \ - echo 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/' >> /etc/apt/sources.list && \ + echo 'deb https://cloud.r-project.org/bin/linux/ubuntu focal-cran40/' >> /etc/apt/sources.list && \ gpg --keyserver keyserver.ubuntu.com --recv-key E298A3A825C0D65DFD57CBB651716619E084DAB9 && \ gpg -a --export E084DAB9 | apt-key add - && \ apt-get clean && \ @@ -51,7 +58,6 @@ RUN apt-get clean && apt-get update && $APT_INSTALL gnupg ca-certificates && \ apt-get clean && \ apt-get update && \ $APT_INSTALL software-properties-common && \ - apt-add-repository -y ppa:brightbox/ruby-ng && \ apt-get update && \ # Install openjdk 8. $APT_INSTALL openjdk-8-jdk && \ @@ -59,23 +65,23 @@ RUN apt-get clean && apt-get update && $APT_INSTALL gnupg ca-certificates && \ # Install build / source control tools $APT_INSTALL curl wget git maven ivy subversion make gcc lsof libffi-dev \ pandoc pandoc-citeproc libssl-dev libcurl4-openssl-dev libxml2-dev && \ - curl -sL https://deb.nodesource.com/setup_11.x | bash && \ + curl -sL https://deb.nodesource.com/setup_12.x | bash && \ $APT_INSTALL nodejs && \ # Install needed python packages. Use pip for installing packages (for consistency). - $APT_INSTALL libpython3-dev python3-pip python3-setuptools && \ - # Change default python version to python3. - update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 && \ - update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2 && \ - update-alternatives --set python /usr/bin/python3.6 && \ + $APT_INSTALL python3-pip python3-setuptools && \ + # qpdf is required for CRAN checks to pass. + $APT_INSTALL qpdf jq && \ pip3 install $PIP_PKGS && \ # Install R packages and dependencies used when building. # R depends on pandoc*, libssl (which are installed above). + # Note that PySpark doc generation also needs pandoc due to nbsphinx $APT_INSTALL r-base r-base-dev && \ + $APT_INSTALL libcurl4-openssl-dev libgit2-dev libssl-dev libxml2-dev && \ $APT_INSTALL texlive-latex-base texlive texlive-fonts-extra texinfo qpdf && \ Rscript -e "install.packages(c('curl', 'xml2', 'httr', 'devtools', 'testthat', 'knitr', 'rmarkdown', 'roxygen2', 'e1071', 'survival'), repos='https://cloud.r-project.org/')" && \ Rscript -e "devtools::install_github('jimhester/lintr')" && \ # Install tools needed to build the documentation. - $APT_INSTALL ruby2.5 ruby2.5-dev && \ + $APT_INSTALL ruby2.7 ruby2.7-dev && \ gem install --no-document $GEM_PKGS WORKDIR /opt/spark-rm/output diff --git a/dev/create-release/translate-contributors.py b/dev/create-release/translate-contributors.py index be30e6ad30b24..6af975916ec49 100755 --- a/dev/create-release/translate-contributors.py +++ b/dev/create-release/translate-contributors.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -17,7 +17,7 @@ # This script translates invalid authors in the contributors list generated # by generate-contributors.py. When the script encounters an author name that -# is considered invalid, it searches Github and JIRA in an attempt to search +# is considered invalid, it searches GitHub and JIRA in an attempt to search # for replacements. This tool runs in two modes: # # (1) Interactive mode: For each invalid author name, this script presents @@ -31,17 +31,18 @@ import os import sys -from releaseutils import * +from releaseutils import JIRA, JIRAError, get_jira_name, Github, get_github_name, \ + contributors_file_name, is_valid_author, capitalize_author, yesOrNoPrompt # You must set the following before use! JIRA_API_BASE = os.environ.get("JIRA_API_BASE", "https://issues.apache.org/jira") JIRA_USERNAME = os.environ.get("JIRA_USERNAME", None) JIRA_PASSWORD = os.environ.get("JIRA_PASSWORD", None) -GITHUB_API_TOKEN = os.environ.get("GITHUB_API_TOKEN", None) +GITHUB_OAUTH_KEY = os.environ.get("GITHUB_OAUTH_KEY", os.environ.get("GITHUB_API_TOKEN", None)) if not JIRA_USERNAME or not JIRA_PASSWORD: sys.exit("Both JIRA_USERNAME and JIRA_PASSWORD must be set") -if not GITHUB_API_TOKEN: - sys.exit("GITHUB_API_TOKEN must be set") +if not GITHUB_OAUTH_KEY: + sys.exit("GITHUB_OAUTH_KEY must be set") # Write new contributors list to .final if not os.path.isfile(contributors_file_name): @@ -60,10 +61,10 @@ if INTERACTIVE_MODE: print("Running in interactive mode. To disable this, provide the --non-interactive flag.") -# Setup Github and JIRA clients +# Setup GitHub and JIRA clients jira_options = {"server": JIRA_API_BASE} jira_client = JIRA(options=jira_options, basic_auth=(JIRA_USERNAME, JIRA_PASSWORD)) -github_client = Github(GITHUB_API_TOKEN) +github_client = Github(GITHUB_OAUTH_KEY) # Load known author translations that are cached locally known_translations = {} @@ -81,11 +82,11 @@ # Generate candidates for the given author. This should only be called if the given author # name does not represent a full name as this operation is somewhat expensive. Under the -# hood, it makes several calls to the Github and JIRA API servers to find the candidates. +# hood, it makes several calls to the GitHub and JIRA API servers to find the candidates. # # This returns a list of (candidate name, source) 2-tuples. E.g. # [ -# (NOT_FOUND, "No full name found for Github user andrewor14"), +# (NOT_FOUND, "No full name found for GitHub user andrewor14"), # ("Andrew Or", "Full name of JIRA user andrewor14"), # ("Andrew Orso", "Full name of SPARK-1444 assignee andrewor14"), # ("Andrew Ordall", "Full name of SPARK-1663 assignee andrewor14"), @@ -96,12 +97,12 @@ def generate_candidates(author, issues): candidates = [] - # First check for full name of Github user + # First check for full name of GitHub user github_name = get_github_name(author, github_client) if github_name: - candidates.append((github_name, "Full name of Github user %s" % author)) + candidates.append((github_name, "Full name of GitHub user %s" % author)) else: - candidates.append((NOT_FOUND, "No full name found for Github user %s" % author)) + candidates.append((NOT_FOUND, "No full name found for GitHub user %s" % author)) # Then do the same for JIRA user jira_name = get_jira_name(author, jira_client) if jira_name: @@ -131,19 +132,12 @@ def generate_candidates(author, issues): (NOT_FOUND, "No full name found for %s assignee %s" % (issue, user_name))) else: candidates.append((NOT_FOUND, "No assignee found for %s" % issue)) - # Guard against special characters in candidate names - # Note that the candidate name may already be in unicode (JIRA returns this) for i, (candidate, source) in enumerate(candidates): - try: - candidate = unicode(candidate, "UTF-8") - except TypeError: - # already in unicode - pass - candidate = unidecode.unidecode(candidate).strip() + candidate = candidate.strip() candidates[i] = (candidate, source) return candidates -# Translate each invalid author by searching for possible candidates from Github and JIRA +# Translate each invalid author by searching for possible candidates from GitHub and JIRA # In interactive mode, this script presents the user with a list of choices and have the user # select from this list. Additionally, the user may also choose to enter a custom name. # In non-interactive mode, this script picks the first valid author name from the candidates @@ -172,12 +166,12 @@ def generate_candidates(author, issues): issues = temp_author.split("/")[1:] candidates = generate_candidates(author, issues) # Print out potential replacement candidates along with the sources, e.g. - # [X] No full name found for Github user andrewor14 + # [X] No full name found for GitHub user andrewor14 # [X] No assignee found for SPARK-1763 # [0] Andrew Or - Full name of JIRA user andrewor14 # [1] Andrew Orso - Full name of SPARK-1444 assignee andrewor14 # [2] Andrew Ordall - Full name of SPARK-1663 assignee andrewor14 - # [3] andrewor14 - Raw Github username + # [3] andrewor14 - Raw GitHub username # [4] Custom candidate_names = [] bad_prompts = [] # Prompts that can't actually be selected; print these first. @@ -199,15 +193,15 @@ def generate_candidates(author, issues): print(p) # In interactive mode, additionally provide "custom" option and await user response if INTERACTIVE_MODE: - print(" [%d] %s - Raw Github username" % (raw_index, author)) + print(" [%d] %s - Raw GitHub username" % (raw_index, author)) print(" [%d] Custom" % custom_index) - response = raw_input(" Your choice: ") + response = input(" Your choice: ") last_index = custom_index while not response.isdigit() or int(response) > last_index: - response = raw_input(" Please enter an integer between 0 and %d: " % last_index) + response = input(" Please enter an integer between 0 and %d: " % last_index) response = int(response) if response == custom_index: - new_author = raw_input(" Please type a custom name for this author: ") + new_author = input(" Please type a custom name for this author: ") elif response != raw_index: new_author = candidate_names[response] # In non-interactive mode, just pick the first candidate diff --git a/dev/create-release/vote.tmpl b/dev/create-release/vote.tmpl index aa22a9c516535..b5e53345f27b1 100644 --- a/dev/create-release/vote.tmpl +++ b/dev/create-release/vote.tmpl @@ -37,8 +37,9 @@ an existing Spark workload and running on this release candidate, then reporting any regressions. If you're working in PySpark you can set up a virtual env and install -the current RC and see if anything important breaks, in the Java/Scala -you can add the staging repository to your projects resolvers and test +the current RC via "pip install https://dist.apache.org/repos/dist/dev/spark/{tag}-bin/pyspark-{version}.tar.gz" +and see if anything important breaks. +In the Java/Scala, you can add the staging repository to your projects resolvers and test with the RC (make sure to clean up the artifact cache before/after so you don't end up building with a out of date RC going forward). @@ -62,4 +63,4 @@ In order to make timely releases, we will typically not hold the release unless the bug in question is a regression from the previous release. That being said, if there is something which is a regression that has not been correctly targeted please ping me or a committer to -help target the issue. \ No newline at end of file +help target the issue. diff --git a/dev/deps/spark-deps-hadoop-2.7-hive-1.2 b/dev/deps/spark-deps-hadoop-2.7-hive-1.2 deleted file mode 100644 index b375629c37433..0000000000000 --- a/dev/deps/spark-deps-hadoop-2.7-hive-1.2 +++ /dev/null @@ -1,210 +0,0 @@ -JLargeArrays/1.5//JLargeArrays-1.5.jar -JTransforms/3.1//JTransforms-3.1.jar -JavaEWAH/0.3.2//JavaEWAH-0.3.2.jar -RoaringBitmap/0.7.45//RoaringBitmap-0.7.45.jar -ST4/4.0.4//ST4-4.0.4.jar -activation/1.1.1//activation-1.1.1.jar -aircompressor/0.10//aircompressor-0.10.jar -algebra_2.12/2.0.0-M2//algebra_2.12-2.0.0-M2.jar -antlr-runtime/3.4//antlr-runtime-3.4.jar -antlr/2.7.7//antlr-2.7.7.jar -antlr4-runtime/4.7.1//antlr4-runtime-4.7.1.jar -aopalliance-repackaged/2.6.1//aopalliance-repackaged-2.6.1.jar -aopalliance/1.0//aopalliance-1.0.jar -apache-log4j-extras/1.2.17//apache-log4j-extras-1.2.17.jar -apacheds-i18n/2.0.0-M15//apacheds-i18n-2.0.0-M15.jar -apacheds-kerberos-codec/2.0.0-M15//apacheds-kerberos-codec-2.0.0-M15.jar -api-asn1-api/1.0.0-M20//api-asn1-api-1.0.0-M20.jar -api-util/1.0.0-M20//api-util-1.0.0-M20.jar -arpack_combined_all/0.1//arpack_combined_all-0.1.jar -arrow-format/0.15.1//arrow-format-0.15.1.jar -arrow-memory/0.15.1//arrow-memory-0.15.1.jar -arrow-vector/0.15.1//arrow-vector-0.15.1.jar -audience-annotations/0.5.0//audience-annotations-0.5.0.jar -automaton/1.11-8//automaton-1.11-8.jar -avro-ipc/1.8.2//avro-ipc-1.8.2.jar -avro-mapred/1.8.2/hadoop2/avro-mapred-1.8.2-hadoop2.jar -avro/1.8.2//avro-1.8.2.jar -bonecp/0.8.0.RELEASE//bonecp-0.8.0.RELEASE.jar -breeze-macros_2.12/1.0//breeze-macros_2.12-1.0.jar -breeze_2.12/1.0//breeze_2.12-1.0.jar -cats-kernel_2.12/2.0.0-M4//cats-kernel_2.12-2.0.0-M4.jar -chill-java/0.9.5//chill-java-0.9.5.jar -chill_2.12/0.9.5//chill_2.12-0.9.5.jar -commons-beanutils/1.9.4//commons-beanutils-1.9.4.jar -commons-cli/1.2//commons-cli-1.2.jar -commons-codec/1.10//commons-codec-1.10.jar -commons-collections/3.2.2//commons-collections-3.2.2.jar -commons-compiler/3.0.16//commons-compiler-3.0.16.jar -commons-compress/1.8.1//commons-compress-1.8.1.jar -commons-configuration/1.6//commons-configuration-1.6.jar -commons-crypto/1.0.0//commons-crypto-1.0.0.jar -commons-dbcp/1.4//commons-dbcp-1.4.jar -commons-digester/1.8//commons-digester-1.8.jar -commons-httpclient/3.1//commons-httpclient-3.1.jar -commons-io/2.4//commons-io-2.4.jar -commons-lang/2.6//commons-lang-2.6.jar -commons-lang3/3.9//commons-lang3-3.9.jar -commons-logging/1.1.3//commons-logging-1.1.3.jar -commons-math3/3.4.1//commons-math3-3.4.1.jar -commons-net/3.1//commons-net-3.1.jar -commons-pool/1.5.4//commons-pool-1.5.4.jar -commons-text/1.6//commons-text-1.6.jar -compress-lzf/1.0.3//compress-lzf-1.0.3.jar -core/1.1.2//core-1.1.2.jar -curator-client/2.7.1//curator-client-2.7.1.jar -curator-framework/2.7.1//curator-framework-2.7.1.jar -curator-recipes/2.7.1//curator-recipes-2.7.1.jar -datanucleus-api-jdo/3.2.6//datanucleus-api-jdo-3.2.6.jar -datanucleus-core/3.2.10//datanucleus-core-3.2.10.jar -datanucleus-rdbms/3.2.9//datanucleus-rdbms-3.2.9.jar -derby/10.12.1.1//derby-10.12.1.1.jar -flatbuffers-java/1.9.0//flatbuffers-java-1.9.0.jar -generex/1.0.2//generex-1.0.2.jar -gson/2.2.4//gson-2.2.4.jar -guava/14.0.1//guava-14.0.1.jar -guice-servlet/3.0//guice-servlet-3.0.jar -guice/3.0//guice-3.0.jar -hadoop-annotations/2.7.4//hadoop-annotations-2.7.4.jar -hadoop-auth/2.7.4//hadoop-auth-2.7.4.jar -hadoop-client/2.7.4//hadoop-client-2.7.4.jar -hadoop-common/2.7.4//hadoop-common-2.7.4.jar -hadoop-hdfs/2.7.4//hadoop-hdfs-2.7.4.jar -hadoop-mapreduce-client-app/2.7.4//hadoop-mapreduce-client-app-2.7.4.jar -hadoop-mapreduce-client-common/2.7.4//hadoop-mapreduce-client-common-2.7.4.jar -hadoop-mapreduce-client-core/2.7.4//hadoop-mapreduce-client-core-2.7.4.jar -hadoop-mapreduce-client-jobclient/2.7.4//hadoop-mapreduce-client-jobclient-2.7.4.jar -hadoop-mapreduce-client-shuffle/2.7.4//hadoop-mapreduce-client-shuffle-2.7.4.jar -hadoop-yarn-api/2.7.4//hadoop-yarn-api-2.7.4.jar -hadoop-yarn-client/2.7.4//hadoop-yarn-client-2.7.4.jar -hadoop-yarn-common/2.7.4//hadoop-yarn-common-2.7.4.jar -hadoop-yarn-server-common/2.7.4//hadoop-yarn-server-common-2.7.4.jar -hadoop-yarn-server-web-proxy/2.7.4//hadoop-yarn-server-web-proxy-2.7.4.jar -hk2-api/2.6.1//hk2-api-2.6.1.jar -hk2-locator/2.6.1//hk2-locator-2.6.1.jar -hk2-utils/2.6.1//hk2-utils-2.6.1.jar -htrace-core/3.1.0-incubating//htrace-core-3.1.0-incubating.jar -httpclient/4.5.6//httpclient-4.5.6.jar -httpcore/4.4.12//httpcore-4.4.12.jar -istack-commons-runtime/3.0.8//istack-commons-runtime-3.0.8.jar -ivy/2.4.0//ivy-2.4.0.jar -jackson-annotations/2.10.0//jackson-annotations-2.10.0.jar -jackson-core-asl/1.9.13//jackson-core-asl-1.9.13.jar -jackson-core/2.10.0//jackson-core-2.10.0.jar -jackson-databind/2.10.0//jackson-databind-2.10.0.jar -jackson-dataformat-yaml/2.10.0//jackson-dataformat-yaml-2.10.0.jar -jackson-jaxrs/1.9.13//jackson-jaxrs-1.9.13.jar -jackson-mapper-asl/1.9.13//jackson-mapper-asl-1.9.13.jar -jackson-module-jaxb-annotations/2.10.0//jackson-module-jaxb-annotations-2.10.0.jar -jackson-module-paranamer/2.10.0//jackson-module-paranamer-2.10.0.jar -jackson-module-scala_2.12/2.10.0//jackson-module-scala_2.12-2.10.0.jar -jackson-xc/1.9.13//jackson-xc-1.9.13.jar -jakarta.activation-api/1.2.1//jakarta.activation-api-1.2.1.jar -jakarta.annotation-api/1.3.5//jakarta.annotation-api-1.3.5.jar -jakarta.inject/2.6.1//jakarta.inject-2.6.1.jar -jakarta.validation-api/2.0.2//jakarta.validation-api-2.0.2.jar -jakarta.ws.rs-api/2.1.6//jakarta.ws.rs-api-2.1.6.jar -jakarta.xml.bind-api/2.3.2//jakarta.xml.bind-api-2.3.2.jar -janino/3.0.16//janino-3.0.16.jar -javassist/3.25.0-GA//javassist-3.25.0-GA.jar -javax.inject/1//javax.inject-1.jar -javax.servlet-api/3.1.0//javax.servlet-api-3.1.0.jar -javolution/5.5.1//javolution-5.5.1.jar -jaxb-api/2.2.2//jaxb-api-2.2.2.jar -jaxb-runtime/2.3.2//jaxb-runtime-2.3.2.jar -jcl-over-slf4j/1.7.30//jcl-over-slf4j-1.7.30.jar -jdo-api/3.0.1//jdo-api-3.0.1.jar -jersey-client/2.30//jersey-client-2.30.jar -jersey-common/2.30//jersey-common-2.30.jar -jersey-container-servlet-core/2.30//jersey-container-servlet-core-2.30.jar -jersey-container-servlet/2.30//jersey-container-servlet-2.30.jar -jersey-hk2/2.30//jersey-hk2-2.30.jar -jersey-media-jaxb/2.30//jersey-media-jaxb-2.30.jar -jersey-server/2.30//jersey-server-2.30.jar -jetty-sslengine/6.1.26//jetty-sslengine-6.1.26.jar -jetty-util/6.1.26//jetty-util-6.1.26.jar -jetty/6.1.26//jetty-6.1.26.jar -jline/2.14.6//jline-2.14.6.jar -joda-time/2.10.5//joda-time-2.10.5.jar -jodd-core/3.5.2//jodd-core-3.5.2.jar -jpam/1.1//jpam-1.1.jar -json4s-ast_2.12/3.6.6//json4s-ast_2.12-3.6.6.jar -json4s-core_2.12/3.6.6//json4s-core_2.12-3.6.6.jar -json4s-jackson_2.12/3.6.6//json4s-jackson_2.12-3.6.6.jar -json4s-scalap_2.12/3.6.6//json4s-scalap_2.12-3.6.6.jar -jsp-api/2.1//jsp-api-2.1.jar -jsr305/3.0.0//jsr305-3.0.0.jar -jta/1.1//jta-1.1.jar -jul-to-slf4j/1.7.30//jul-to-slf4j-1.7.30.jar -kryo-shaded/4.0.2//kryo-shaded-4.0.2.jar -kubernetes-client/4.7.1//kubernetes-client-4.7.1.jar -kubernetes-model-common/4.7.1//kubernetes-model-common-4.7.1.jar -kubernetes-model/4.7.1//kubernetes-model-4.7.1.jar -leveldbjni-all/1.8//leveldbjni-all-1.8.jar -libfb303/0.9.3//libfb303-0.9.3.jar -libthrift/0.12.0//libthrift-0.12.0.jar -log4j/1.2.17//log4j-1.2.17.jar -logging-interceptor/3.12.6//logging-interceptor-3.12.6.jar -lz4-java/1.7.1//lz4-java-1.7.1.jar -machinist_2.12/0.6.8//machinist_2.12-0.6.8.jar -macro-compat_2.12/1.1.1//macro-compat_2.12-1.1.1.jar -mesos/1.4.0/shaded-protobuf/mesos-1.4.0-shaded-protobuf.jar -metrics-core/4.1.1//metrics-core-4.1.1.jar -metrics-graphite/4.1.1//metrics-graphite-4.1.1.jar -metrics-jmx/4.1.1//metrics-jmx-4.1.1.jar -metrics-json/4.1.1//metrics-json-4.1.1.jar -metrics-jvm/4.1.1//metrics-jvm-4.1.1.jar -minlog/1.3.0//minlog-1.3.0.jar -netty-all/4.1.47.Final//netty-all-4.1.47.Final.jar -objenesis/2.5.1//objenesis-2.5.1.jar -okhttp/3.12.6//okhttp-3.12.6.jar -okio/1.15.0//okio-1.15.0.jar -opencsv/2.3//opencsv-2.3.jar -orc-core/1.5.10/nohive/orc-core-1.5.10-nohive.jar -orc-mapreduce/1.5.10/nohive/orc-mapreduce-1.5.10-nohive.jar -orc-shims/1.5.10//orc-shims-1.5.10.jar -oro/2.0.8//oro-2.0.8.jar -osgi-resource-locator/1.0.3//osgi-resource-locator-1.0.3.jar -paranamer/2.8//paranamer-2.8.jar -parquet-column/1.10.1//parquet-column-1.10.1.jar -parquet-common/1.10.1//parquet-common-1.10.1.jar -parquet-encoding/1.10.1//parquet-encoding-1.10.1.jar -parquet-format/2.4.0//parquet-format-2.4.0.jar -parquet-hadoop-bundle/1.6.0//parquet-hadoop-bundle-1.6.0.jar -parquet-hadoop/1.10.1//parquet-hadoop-1.10.1.jar -parquet-jackson/1.10.1//parquet-jackson-1.10.1.jar -protobuf-java/2.5.0//protobuf-java-2.5.0.jar -py4j/0.10.9//py4j-0.10.9.jar -pyrolite/4.30//pyrolite-4.30.jar -scala-collection-compat_2.12/2.1.1//scala-collection-compat_2.12-2.1.1.jar -scala-compiler/2.12.10//scala-compiler-2.12.10.jar -scala-library/2.12.10//scala-library-2.12.10.jar -scala-parser-combinators_2.12/1.1.2//scala-parser-combinators_2.12-1.1.2.jar -scala-reflect/2.12.10//scala-reflect-2.12.10.jar -scala-xml_2.12/1.2.0//scala-xml_2.12-1.2.0.jar -shapeless_2.12/2.3.3//shapeless_2.12-2.3.3.jar -shims/0.7.45//shims-0.7.45.jar -slf4j-api/1.7.30//slf4j-api-1.7.30.jar -slf4j-log4j12/1.7.30//slf4j-log4j12-1.7.30.jar -snakeyaml/1.24//snakeyaml-1.24.jar -snappy-java/1.1.7.5//snappy-java-1.1.7.5.jar -snappy/0.2//snappy-0.2.jar -spire-macros_2.12/0.17.0-M1//spire-macros_2.12-0.17.0-M1.jar -spire-platform_2.12/0.17.0-M1//spire-platform_2.12-0.17.0-M1.jar -spire-util_2.12/0.17.0-M1//spire-util_2.12-0.17.0-M1.jar -spire_2.12/0.17.0-M1//spire_2.12-0.17.0-M1.jar -stax-api/1.0-2//stax-api-1.0-2.jar -stax-api/1.0.1//stax-api-1.0.1.jar -stream/2.9.6//stream-2.9.6.jar -stringtemplate/3.2.1//stringtemplate-3.2.1.jar -super-csv/2.2.0//super-csv-2.2.0.jar -threeten-extra/1.5.0//threeten-extra-1.5.0.jar -univocity-parsers/2.8.3//univocity-parsers-2.8.3.jar -xbean-asm7-shaded/4.15//xbean-asm7-shaded-4.15.jar -xercesImpl/2.12.0//xercesImpl-2.12.0.jar -xml-apis/1.4.01//xml-apis-1.4.01.jar -xmlenc/0.52//xmlenc-0.52.jar -xz/1.5//xz-1.5.jar -zjsonpatch/0.3.0//zjsonpatch-0.3.0.jar -zookeeper/3.4.14//zookeeper-3.4.14.jar -zstd-jni/1.4.4-3//zstd-jni-1.4.4-3.jar diff --git a/dev/deps/spark-deps-hadoop-2.7-hive-2.3 b/dev/deps/spark-deps-hadoop-2.7-hive-2.3 index 093924f58cb20..d7c64af0c54e4 100644 --- a/dev/deps/spark-deps-hadoop-2.7-hive-2.3 +++ b/dev/deps/spark-deps-hadoop-2.7-hive-2.3 @@ -1,28 +1,32 @@ HikariCP/2.5.1//HikariCP-2.5.1.jar JLargeArrays/1.5//JLargeArrays-1.5.jar JTransforms/3.1//JTransforms-3.1.jar -RoaringBitmap/0.7.45//RoaringBitmap-0.7.45.jar +RoaringBitmap/0.9.0//RoaringBitmap-0.9.0.jar ST4/4.0.4//ST4-4.0.4.jar activation/1.1.1//activation-1.1.1.jar -aircompressor/0.10//aircompressor-0.10.jar +aircompressor/0.16//aircompressor-0.16.jar algebra_2.12/2.0.0-M2//algebra_2.12-2.0.0-M2.jar +annotations/17.0.0//annotations-17.0.0.jar antlr-runtime/3.5.2//antlr-runtime-3.5.2.jar -antlr4-runtime/4.7.1//antlr4-runtime-4.7.1.jar +antlr4-runtime/4.8-1//antlr4-runtime-4.8-1.jar aopalliance-repackaged/2.6.1//aopalliance-repackaged-2.6.1.jar aopalliance/1.0//aopalliance-1.0.jar apacheds-i18n/2.0.0-M15//apacheds-i18n-2.0.0-M15.jar apacheds-kerberos-codec/2.0.0-M15//apacheds-kerberos-codec-2.0.0-M15.jar api-asn1-api/1.0.0-M20//api-asn1-api-1.0.0-M20.jar api-util/1.0.0-M20//api-util-1.0.0-M20.jar +arpack/2.2.0//arpack-2.2.0.jar arpack_combined_all/0.1//arpack_combined_all-0.1.jar -arrow-format/0.15.1//arrow-format-0.15.1.jar -arrow-memory/0.15.1//arrow-memory-0.15.1.jar -arrow-vector/0.15.1//arrow-vector-0.15.1.jar +arrow-format/2.0.0//arrow-format-2.0.0.jar +arrow-memory-core/2.0.0//arrow-memory-core-2.0.0.jar +arrow-memory-netty/2.0.0//arrow-memory-netty-2.0.0.jar +arrow-vector/2.0.0//arrow-vector-2.0.0.jar audience-annotations/0.5.0//audience-annotations-0.5.0.jar automaton/1.11-8//automaton-1.11-8.jar -avro-ipc/1.8.2//avro-ipc-1.8.2.jar -avro-mapred/1.8.2/hadoop2/avro-mapred-1.8.2-hadoop2.jar -avro/1.8.2//avro-1.8.2.jar +avro-ipc/1.10.2//avro-ipc-1.10.2.jar +avro-mapred/1.10.2//avro-mapred-1.10.2.jar +avro/1.10.2//avro-1.10.2.jar +blas/2.2.0//blas-2.2.0.jar bonecp/0.8.0.RELEASE//bonecp-0.8.0.RELEASE.jar breeze-macros_2.12/1.0//breeze-macros_2.12-1.0.jar breeze_2.12/1.0//breeze_2.12-1.0.jar @@ -31,18 +35,18 @@ chill-java/0.9.5//chill-java-0.9.5.jar chill_2.12/0.9.5//chill_2.12-0.9.5.jar commons-beanutils/1.9.4//commons-beanutils-1.9.4.jar commons-cli/1.2//commons-cli-1.2.jar -commons-codec/1.10//commons-codec-1.10.jar +commons-codec/1.15//commons-codec-1.15.jar commons-collections/3.2.2//commons-collections-3.2.2.jar -commons-compiler/3.0.16//commons-compiler-3.0.16.jar -commons-compress/1.8.1//commons-compress-1.8.1.jar +commons-compiler/3.1.4//commons-compiler-3.1.4.jar +commons-compress/1.20//commons-compress-1.20.jar commons-configuration/1.6//commons-configuration-1.6.jar -commons-crypto/1.0.0//commons-crypto-1.0.0.jar +commons-crypto/1.1.0//commons-crypto-1.1.0.jar commons-dbcp/1.4//commons-dbcp-1.4.jar commons-digester/1.8//commons-digester-1.8.jar commons-httpclient/3.1//commons-httpclient-3.1.jar commons-io/2.4//commons-io-2.4.jar commons-lang/2.6//commons-lang-2.6.jar -commons-lang3/3.9//commons-lang3-3.9.jar +commons-lang3/3.12.0//commons-lang3-3.12.0.jar commons-logging/1.1.3//commons-logging-1.1.3.jar commons-math3/3.4.1//commons-math3-3.4.1.jar commons-net/3.1//commons-net-3.1.jar @@ -56,7 +60,7 @@ curator-recipes/2.7.1//curator-recipes-2.7.1.jar datanucleus-api-jdo/4.2.4//datanucleus-api-jdo-4.2.4.jar datanucleus-core/4.1.17//datanucleus-core-4.1.17.jar datanucleus-rdbms/4.1.19//datanucleus-rdbms-4.1.19.jar -derby/10.12.1.1//derby-10.12.1.1.jar +derby/10.14.2.0//derby-10.14.2.0.jar dropwizard-metrics-hadoop-metrics2-reporter/0.1.2//dropwizard-metrics-hadoop-metrics2-reporter-0.1.2.jar flatbuffers-java/1.9.0//flatbuffers-java-1.9.0.jar generex/1.0.2//generex-1.0.2.jar @@ -79,62 +83,60 @@ hadoop-yarn-client/2.7.4//hadoop-yarn-client-2.7.4.jar hadoop-yarn-common/2.7.4//hadoop-yarn-common-2.7.4.jar hadoop-yarn-server-common/2.7.4//hadoop-yarn-server-common-2.7.4.jar hadoop-yarn-server-web-proxy/2.7.4//hadoop-yarn-server-web-proxy-2.7.4.jar -hive-beeline/2.3.7//hive-beeline-2.3.7.jar -hive-cli/2.3.7//hive-cli-2.3.7.jar -hive-common/2.3.7//hive-common-2.3.7.jar -hive-exec/2.3.7/core/hive-exec-2.3.7-core.jar -hive-jdbc/2.3.7//hive-jdbc-2.3.7.jar -hive-llap-common/2.3.7//hive-llap-common-2.3.7.jar -hive-metastore/2.3.7//hive-metastore-2.3.7.jar -hive-serde/2.3.7//hive-serde-2.3.7.jar -hive-shims-0.23/2.3.7//hive-shims-0.23-2.3.7.jar -hive-shims-common/2.3.7//hive-shims-common-2.3.7.jar -hive-shims-scheduler/2.3.7//hive-shims-scheduler-2.3.7.jar -hive-shims/2.3.7//hive-shims-2.3.7.jar -hive-storage-api/2.7.1//hive-storage-api-2.7.1.jar -hive-vector-code-gen/2.3.7//hive-vector-code-gen-2.3.7.jar +hive-beeline/2.3.8//hive-beeline-2.3.8.jar +hive-cli/2.3.8//hive-cli-2.3.8.jar +hive-common/2.3.8//hive-common-2.3.8.jar +hive-exec/2.3.8/core/hive-exec-2.3.8-core.jar +hive-jdbc/2.3.8//hive-jdbc-2.3.8.jar +hive-llap-common/2.3.8//hive-llap-common-2.3.8.jar +hive-metastore/2.3.8//hive-metastore-2.3.8.jar +hive-serde/2.3.8//hive-serde-2.3.8.jar +hive-service-rpc/3.1.2//hive-service-rpc-3.1.2.jar +hive-shims-0.23/2.3.8//hive-shims-0.23-2.3.8.jar +hive-shims-common/2.3.8//hive-shims-common-2.3.8.jar +hive-shims-scheduler/2.3.8//hive-shims-scheduler-2.3.8.jar +hive-shims/2.3.8//hive-shims-2.3.8.jar +hive-storage-api/2.7.2//hive-storage-api-2.7.2.jar +hive-vector-code-gen/2.3.8//hive-vector-code-gen-2.3.8.jar hk2-api/2.6.1//hk2-api-2.6.1.jar hk2-locator/2.6.1//hk2-locator-2.6.1.jar hk2-utils/2.6.1//hk2-utils-2.6.1.jar htrace-core/3.1.0-incubating//htrace-core-3.1.0-incubating.jar -httpclient/4.5.6//httpclient-4.5.6.jar +httpclient/4.5.13//httpclient-4.5.13.jar httpcore/4.4.12//httpcore-4.4.12.jar istack-commons-runtime/3.0.8//istack-commons-runtime-3.0.8.jar ivy/2.4.0//ivy-2.4.0.jar -jackson-annotations/2.10.0//jackson-annotations-2.10.0.jar +jackson-annotations/2.12.2//jackson-annotations-2.12.2.jar jackson-core-asl/1.9.13//jackson-core-asl-1.9.13.jar -jackson-core/2.10.0//jackson-core-2.10.0.jar -jackson-databind/2.10.0//jackson-databind-2.10.0.jar -jackson-dataformat-yaml/2.10.0//jackson-dataformat-yaml-2.10.0.jar +jackson-core/2.12.2//jackson-core-2.12.2.jar +jackson-databind/2.12.2//jackson-databind-2.12.2.jar +jackson-dataformat-yaml/2.12.2//jackson-dataformat-yaml-2.12.2.jar +jackson-datatype-jsr310/2.11.2//jackson-datatype-jsr310-2.11.2.jar jackson-jaxrs/1.9.13//jackson-jaxrs-1.9.13.jar jackson-mapper-asl/1.9.13//jackson-mapper-asl-1.9.13.jar -jackson-module-jaxb-annotations/2.10.0//jackson-module-jaxb-annotations-2.10.0.jar -jackson-module-paranamer/2.10.0//jackson-module-paranamer-2.10.0.jar -jackson-module-scala_2.12/2.10.0//jackson-module-scala_2.12-2.10.0.jar +jackson-module-scala_2.12/2.12.2//jackson-module-scala_2.12-2.12.2.jar jackson-xc/1.9.13//jackson-xc-1.9.13.jar -jakarta.activation-api/1.2.1//jakarta.activation-api-1.2.1.jar jakarta.annotation-api/1.3.5//jakarta.annotation-api-1.3.5.jar jakarta.inject/2.6.1//jakarta.inject-2.6.1.jar +jakarta.servlet-api/4.0.3//jakarta.servlet-api-4.0.3.jar jakarta.validation-api/2.0.2//jakarta.validation-api-2.0.2.jar jakarta.ws.rs-api/2.1.6//jakarta.ws.rs-api-2.1.6.jar jakarta.xml.bind-api/2.3.2//jakarta.xml.bind-api-2.3.2.jar -janino/3.0.16//janino-3.0.16.jar +janino/3.1.4//janino-3.1.4.jar javassist/3.25.0-GA//javassist-3.25.0-GA.jar javax.inject/1//javax.inject-1.jar javax.jdo/3.2.0-m3//javax.jdo-3.2.0-m3.jar -javax.servlet-api/3.1.0//javax.servlet-api-3.1.0.jar javolution/5.5.1//javolution-5.5.1.jar -jaxb-api/2.2.2//jaxb-api-2.2.2.jar +jaxb-api/2.2.11//jaxb-api-2.2.11.jar jaxb-runtime/2.3.2//jaxb-runtime-2.3.2.jar jcl-over-slf4j/1.7.30//jcl-over-slf4j-1.7.30.jar jdo-api/3.0.1//jdo-api-3.0.1.jar -jersey-client/2.30//jersey-client-2.30.jar -jersey-common/2.30//jersey-common-2.30.jar -jersey-container-servlet-core/2.30//jersey-container-servlet-core-2.30.jar -jersey-container-servlet/2.30//jersey-container-servlet-2.30.jar -jersey-hk2/2.30//jersey-hk2-2.30.jar -jersey-media-jaxb/2.30//jersey-media-jaxb-2.30.jar -jersey-server/2.30//jersey-server-2.30.jar +jersey-client/2.34//jersey-client-2.34.jar +jersey-common/2.34//jersey-common-2.34.jar +jersey-container-servlet-core/2.34//jersey-container-servlet-core-2.34.jar +jersey-container-servlet/2.34//jersey-container-servlet-2.34.jar +jersey-hk2/2.34//jersey-hk2-2.34.jar +jersey-server/2.34//jersey-server-2.34.jar jetty-sslengine/6.1.26//jetty-sslengine-6.1.26.jar jetty-util/6.1.26//jetty-util-6.1.26.jar jetty/6.1.26//jetty-6.1.26.jar @@ -143,23 +145,41 @@ joda-time/2.10.5//joda-time-2.10.5.jar jodd-core/3.5.2//jodd-core-3.5.2.jar jpam/1.1//jpam-1.1.jar json/1.8//json-1.8.jar -json4s-ast_2.12/3.6.6//json4s-ast_2.12-3.6.6.jar -json4s-core_2.12/3.6.6//json4s-core_2.12-3.6.6.jar -json4s-jackson_2.12/3.6.6//json4s-jackson_2.12-3.6.6.jar -json4s-scalap_2.12/3.6.6//json4s-scalap_2.12-3.6.6.jar +json4s-ast_2.12/3.7.0-M5//json4s-ast_2.12-3.7.0-M5.jar +json4s-core_2.12/3.7.0-M5//json4s-core_2.12-3.7.0-M5.jar +json4s-jackson_2.12/3.7.0-M5//json4s-jackson_2.12-3.7.0-M5.jar +json4s-scalap_2.12/3.7.0-M5//json4s-scalap_2.12-3.7.0-M5.jar jsp-api/2.1//jsp-api-2.1.jar jsr305/3.0.0//jsr305-3.0.0.jar jta/1.1//jta-1.1.jar jul-to-slf4j/1.7.30//jul-to-slf4j-1.7.30.jar kryo-shaded/4.0.2//kryo-shaded-4.0.2.jar -kubernetes-client/4.7.1//kubernetes-client-4.7.1.jar -kubernetes-model-common/4.7.1//kubernetes-model-common-4.7.1.jar -kubernetes-model/4.7.1//kubernetes-model-4.7.1.jar +kubernetes-client/5.3.1//kubernetes-client-5.3.1.jar +kubernetes-model-admissionregistration/5.3.1//kubernetes-model-admissionregistration-5.3.1.jar +kubernetes-model-apiextensions/5.3.1//kubernetes-model-apiextensions-5.3.1.jar +kubernetes-model-apps/5.3.1//kubernetes-model-apps-5.3.1.jar +kubernetes-model-autoscaling/5.3.1//kubernetes-model-autoscaling-5.3.1.jar +kubernetes-model-batch/5.3.1//kubernetes-model-batch-5.3.1.jar +kubernetes-model-certificates/5.3.1//kubernetes-model-certificates-5.3.1.jar +kubernetes-model-common/5.3.1//kubernetes-model-common-5.3.1.jar +kubernetes-model-coordination/5.3.1//kubernetes-model-coordination-5.3.1.jar +kubernetes-model-core/5.3.1//kubernetes-model-core-5.3.1.jar +kubernetes-model-discovery/5.3.1//kubernetes-model-discovery-5.3.1.jar +kubernetes-model-events/5.3.1//kubernetes-model-events-5.3.1.jar +kubernetes-model-extensions/5.3.1//kubernetes-model-extensions-5.3.1.jar +kubernetes-model-metrics/5.3.1//kubernetes-model-metrics-5.3.1.jar +kubernetes-model-networking/5.3.1//kubernetes-model-networking-5.3.1.jar +kubernetes-model-node/5.3.1//kubernetes-model-node-5.3.1.jar +kubernetes-model-policy/5.3.1//kubernetes-model-policy-5.3.1.jar +kubernetes-model-rbac/5.3.1//kubernetes-model-rbac-5.3.1.jar +kubernetes-model-scheduling/5.3.1//kubernetes-model-scheduling-5.3.1.jar +kubernetes-model-storageclass/5.3.1//kubernetes-model-storageclass-5.3.1.jar +lapack/2.2.0//lapack-2.2.0.jar leveldbjni-all/1.8//leveldbjni-all-1.8.jar libfb303/0.9.3//libfb303-0.9.3.jar libthrift/0.12.0//libthrift-0.12.0.jar log4j/1.2.17//log4j-1.2.17.jar -logging-interceptor/3.12.6//logging-interceptor-3.12.6.jar +logging-interceptor/3.12.12//logging-interceptor-3.12.12.jar lz4-java/1.7.1//lz4-java-1.7.1.jar machinist_2.12/0.6.8//machinist_2.12-0.6.8.jar macro-compat_2.12/1.1.1//macro-compat_2.12-1.1.1.jar @@ -170,25 +190,25 @@ metrics-jmx/4.1.1//metrics-jmx-4.1.1.jar metrics-json/4.1.1//metrics-json-4.1.1.jar metrics-jvm/4.1.1//metrics-jvm-4.1.1.jar minlog/1.3.0//minlog-1.3.0.jar -netty-all/4.1.47.Final//netty-all-4.1.47.Final.jar -objenesis/2.5.1//objenesis-2.5.1.jar -okhttp/3.12.6//okhttp-3.12.6.jar -okio/1.15.0//okio-1.15.0.jar +netty-all/4.1.63.Final//netty-all-4.1.63.Final.jar +objenesis/2.6//objenesis-2.6.jar +okhttp/3.12.12//okhttp-3.12.12.jar +okio/1.14.0//okio-1.14.0.jar opencsv/2.3//opencsv-2.3.jar -orc-core/1.5.10//orc-core-1.5.10.jar -orc-mapreduce/1.5.10//orc-mapreduce-1.5.10.jar -orc-shims/1.5.10//orc-shims-1.5.10.jar +orc-core/1.6.7//orc-core-1.6.7.jar +orc-mapreduce/1.6.7//orc-mapreduce-1.6.7.jar +orc-shims/1.6.7//orc-shims-1.6.7.jar oro/2.0.8//oro-2.0.8.jar osgi-resource-locator/1.0.3//osgi-resource-locator-1.0.3.jar paranamer/2.8//paranamer-2.8.jar -parquet-column/1.10.1//parquet-column-1.10.1.jar -parquet-common/1.10.1//parquet-common-1.10.1.jar -parquet-encoding/1.10.1//parquet-encoding-1.10.1.jar -parquet-format/2.4.0//parquet-format-2.4.0.jar -parquet-hadoop/1.10.1//parquet-hadoop-1.10.1.jar -parquet-jackson/1.10.1//parquet-jackson-1.10.1.jar +parquet-column/1.12.0//parquet-column-1.12.0.jar +parquet-common/1.12.0//parquet-common-1.12.0.jar +parquet-encoding/1.12.0//parquet-encoding-1.12.0.jar +parquet-format-structures/1.12.0//parquet-format-structures-1.12.0.jar +parquet-hadoop/1.12.0//parquet-hadoop-1.12.0.jar +parquet-jackson/1.12.0//parquet-jackson-1.12.0.jar protobuf-java/2.5.0//protobuf-java-2.5.0.jar -py4j/0.10.9//py4j-0.10.9.jar +py4j/0.10.9.2//py4j-0.10.9.2.jar pyrolite/4.30//pyrolite-4.30.jar scala-collection-compat_2.12/2.1.1//scala-collection-compat_2.12-2.1.1.jar scala-compiler/2.12.10//scala-compiler-2.12.10.jar @@ -197,28 +217,28 @@ scala-parser-combinators_2.12/1.1.2//scala-parser-combinators_2.12-1.1.2.jar scala-reflect/2.12.10//scala-reflect-2.12.10.jar scala-xml_2.12/1.2.0//scala-xml_2.12-1.2.0.jar shapeless_2.12/2.3.3//shapeless_2.12-2.3.3.jar -shims/0.7.45//shims-0.7.45.jar +shims/0.9.0//shims-0.9.0.jar slf4j-api/1.7.30//slf4j-api-1.7.30.jar slf4j-log4j12/1.7.30//slf4j-log4j12-1.7.30.jar -snakeyaml/1.24//snakeyaml-1.24.jar -snappy-java/1.1.7.5//snappy-java-1.1.7.5.jar +snakeyaml/1.27//snakeyaml-1.27.jar +snappy-java/1.1.8.4//snappy-java-1.1.8.4.jar spire-macros_2.12/0.17.0-M1//spire-macros_2.12-0.17.0-M1.jar spire-platform_2.12/0.17.0-M1//spire-platform_2.12-0.17.0-M1.jar spire-util_2.12/0.17.0-M1//spire-util_2.12-0.17.0-M1.jar spire_2.12/0.17.0-M1//spire_2.12-0.17.0-M1.jar -stax-api/1.0-2//stax-api-1.0-2.jar stax-api/1.0.1//stax-api-1.0.1.jar stream/2.9.6//stream-2.9.6.jar super-csv/2.2.0//super-csv-2.2.0.jar threeten-extra/1.5.0//threeten-extra-1.5.0.jar transaction-api/1.1//transaction-api-1.1.jar -univocity-parsers/2.8.3//univocity-parsers-2.8.3.jar +univocity-parsers/2.9.1//univocity-parsers-2.9.1.jar velocity/1.5//velocity-1.5.jar xbean-asm7-shaded/4.15//xbean-asm7-shaded-4.15.jar xercesImpl/2.12.0//xercesImpl-2.12.0.jar xml-apis/1.4.01//xml-apis-1.4.01.jar xmlenc/0.52//xmlenc-0.52.jar -xz/1.5//xz-1.5.jar +xz/1.8//xz-1.8.jar zjsonpatch/0.3.0//zjsonpatch-0.3.0.jar -zookeeper/3.4.14//zookeeper-3.4.14.jar -zstd-jni/1.4.4-3//zstd-jni-1.4.4-3.jar +zookeeper-jute/3.6.2//zookeeper-jute-3.6.2.jar +zookeeper/3.6.2//zookeeper-3.6.2.jar +zstd-jni/1.4.9-1//zstd-jni-1.4.9-1.jar diff --git a/dev/deps/spark-deps-hadoop-3.2-hive-2.3 b/dev/deps/spark-deps-hadoop-3.2-hive-2.3 index 2db8d3e74d0e6..eda1a0b24e2af 100644 --- a/dev/deps/spark-deps-hadoop-3.2-hive-2.3 +++ b/dev/deps/spark-deps-hadoop-3.2-hive-2.3 @@ -1,45 +1,44 @@ HikariCP/2.5.1//HikariCP-2.5.1.jar JLargeArrays/1.5//JLargeArrays-1.5.jar JTransforms/3.1//JTransforms-3.1.jar -RoaringBitmap/0.7.45//RoaringBitmap-0.7.45.jar +RoaringBitmap/0.9.0//RoaringBitmap-0.9.0.jar ST4/4.0.4//ST4-4.0.4.jar -accessors-smart/1.2//accessors-smart-1.2.jar activation/1.1.1//activation-1.1.1.jar -aircompressor/0.10//aircompressor-0.10.jar +aircompressor/0.16//aircompressor-0.16.jar algebra_2.12/2.0.0-M2//algebra_2.12-2.0.0-M2.jar +annotations/17.0.0//annotations-17.0.0.jar antlr-runtime/3.5.2//antlr-runtime-3.5.2.jar -antlr4-runtime/4.7.1//antlr4-runtime-4.7.1.jar +antlr4-runtime/4.8-1//antlr4-runtime-4.8-1.jar aopalliance-repackaged/2.6.1//aopalliance-repackaged-2.6.1.jar -aopalliance/1.0//aopalliance-1.0.jar +arpack/2.2.0//arpack-2.2.0.jar arpack_combined_all/0.1//arpack_combined_all-0.1.jar -arrow-format/0.15.1//arrow-format-0.15.1.jar -arrow-memory/0.15.1//arrow-memory-0.15.1.jar -arrow-vector/0.15.1//arrow-vector-0.15.1.jar +arrow-format/2.0.0//arrow-format-2.0.0.jar +arrow-memory-core/2.0.0//arrow-memory-core-2.0.0.jar +arrow-memory-netty/2.0.0//arrow-memory-netty-2.0.0.jar +arrow-vector/2.0.0//arrow-vector-2.0.0.jar audience-annotations/0.5.0//audience-annotations-0.5.0.jar automaton/1.11-8//automaton-1.11-8.jar -avro-ipc/1.8.2//avro-ipc-1.8.2.jar -avro-mapred/1.8.2/hadoop2/avro-mapred-1.8.2-hadoop2.jar -avro/1.8.2//avro-1.8.2.jar +avro-ipc/1.10.2//avro-ipc-1.10.2.jar +avro-mapred/1.10.2//avro-mapred-1.10.2.jar +avro/1.10.2//avro-1.10.2.jar +blas/2.2.0//blas-2.2.0.jar bonecp/0.8.0.RELEASE//bonecp-0.8.0.RELEASE.jar breeze-macros_2.12/1.0//breeze-macros_2.12-1.0.jar breeze_2.12/1.0//breeze_2.12-1.0.jar cats-kernel_2.12/2.0.0-M4//cats-kernel_2.12-2.0.0-M4.jar chill-java/0.9.5//chill-java-0.9.5.jar chill_2.12/0.9.5//chill_2.12-0.9.5.jar -commons-beanutils/1.9.4//commons-beanutils-1.9.4.jar commons-cli/1.2//commons-cli-1.2.jar -commons-codec/1.10//commons-codec-1.10.jar +commons-codec/1.15//commons-codec-1.15.jar commons-collections/3.2.2//commons-collections-3.2.2.jar -commons-compiler/3.0.16//commons-compiler-3.0.16.jar -commons-compress/1.8.1//commons-compress-1.8.1.jar -commons-configuration2/2.1.1//commons-configuration2-2.1.1.jar -commons-crypto/1.0.0//commons-crypto-1.0.0.jar -commons-daemon/1.0.13//commons-daemon-1.0.13.jar +commons-compiler/3.1.4//commons-compiler-3.1.4.jar +commons-compress/1.20//commons-compress-1.20.jar +commons-crypto/1.1.0//commons-crypto-1.1.0.jar commons-dbcp/1.4//commons-dbcp-1.4.jar commons-httpclient/3.1//commons-httpclient-3.1.jar -commons-io/2.4//commons-io-2.4.jar +commons-io/2.8.0//commons-io-2.8.0.jar commons-lang/2.6//commons-lang-2.6.jar -commons-lang3/3.9//commons-lang3-3.9.jar +commons-lang3/3.12.0//commons-lang3-3.12.0.jar commons-logging/1.1.3//commons-logging-1.1.3.jar commons-math3/3.4.1//commons-math3-3.4.1.jar commons-net/3.1//commons-net-3.1.jar @@ -53,125 +52,105 @@ curator-recipes/2.13.0//curator-recipes-2.13.0.jar datanucleus-api-jdo/4.2.4//datanucleus-api-jdo-4.2.4.jar datanucleus-core/4.1.17//datanucleus-core-4.1.17.jar datanucleus-rdbms/4.1.19//datanucleus-rdbms-4.1.19.jar -derby/10.12.1.1//derby-10.12.1.1.jar -dnsjava/2.1.7//dnsjava-2.1.7.jar +derby/10.14.2.0//derby-10.14.2.0.jar dropwizard-metrics-hadoop-metrics2-reporter/0.1.2//dropwizard-metrics-hadoop-metrics2-reporter-0.1.2.jar -ehcache/3.3.1//ehcache-3.3.1.jar flatbuffers-java/1.9.0//flatbuffers-java-1.9.0.jar generex/1.0.2//generex-1.0.2.jar -geronimo-jcache_1.0_spec/1.0-alpha-1//geronimo-jcache_1.0_spec-1.0-alpha-1.jar gson/2.2.4//gson-2.2.4.jar guava/14.0.1//guava-14.0.1.jar -guice-servlet/4.0//guice-servlet-4.0.jar -guice/4.0//guice-4.0.jar -hadoop-annotations/3.2.0//hadoop-annotations-3.2.0.jar -hadoop-auth/3.2.0//hadoop-auth-3.2.0.jar -hadoop-client/3.2.0//hadoop-client-3.2.0.jar -hadoop-common/3.2.0//hadoop-common-3.2.0.jar -hadoop-hdfs-client/3.2.0//hadoop-hdfs-client-3.2.0.jar -hadoop-mapreduce-client-common/3.2.0//hadoop-mapreduce-client-common-3.2.0.jar -hadoop-mapreduce-client-core/3.2.0//hadoop-mapreduce-client-core-3.2.0.jar -hadoop-mapreduce-client-jobclient/3.2.0//hadoop-mapreduce-client-jobclient-3.2.0.jar -hadoop-yarn-api/3.2.0//hadoop-yarn-api-3.2.0.jar -hadoop-yarn-client/3.2.0//hadoop-yarn-client-3.2.0.jar -hadoop-yarn-common/3.2.0//hadoop-yarn-common-3.2.0.jar -hadoop-yarn-registry/3.2.0//hadoop-yarn-registry-3.2.0.jar -hadoop-yarn-server-common/3.2.0//hadoop-yarn-server-common-3.2.0.jar -hadoop-yarn-server-web-proxy/3.2.0//hadoop-yarn-server-web-proxy-3.2.0.jar -hive-beeline/2.3.7//hive-beeline-2.3.7.jar -hive-cli/2.3.7//hive-cli-2.3.7.jar -hive-common/2.3.7//hive-common-2.3.7.jar -hive-exec/2.3.7/core/hive-exec-2.3.7-core.jar -hive-jdbc/2.3.7//hive-jdbc-2.3.7.jar -hive-llap-common/2.3.7//hive-llap-common-2.3.7.jar -hive-metastore/2.3.7//hive-metastore-2.3.7.jar -hive-serde/2.3.7//hive-serde-2.3.7.jar -hive-shims-0.23/2.3.7//hive-shims-0.23-2.3.7.jar -hive-shims-common/2.3.7//hive-shims-common-2.3.7.jar -hive-shims-scheduler/2.3.7//hive-shims-scheduler-2.3.7.jar -hive-shims/2.3.7//hive-shims-2.3.7.jar -hive-storage-api/2.7.1//hive-storage-api-2.7.1.jar -hive-vector-code-gen/2.3.7//hive-vector-code-gen-2.3.7.jar +hadoop-client-api/3.2.2//hadoop-client-api-3.2.2.jar +hadoop-client-runtime/3.2.2//hadoop-client-runtime-3.2.2.jar +hadoop-yarn-server-web-proxy/3.2.2//hadoop-yarn-server-web-proxy-3.2.2.jar +hive-beeline/2.3.8//hive-beeline-2.3.8.jar +hive-cli/2.3.8//hive-cli-2.3.8.jar +hive-common/2.3.8//hive-common-2.3.8.jar +hive-exec/2.3.8/core/hive-exec-2.3.8-core.jar +hive-jdbc/2.3.8//hive-jdbc-2.3.8.jar +hive-llap-common/2.3.8//hive-llap-common-2.3.8.jar +hive-metastore/2.3.8//hive-metastore-2.3.8.jar +hive-serde/2.3.8//hive-serde-2.3.8.jar +hive-service-rpc/3.1.2//hive-service-rpc-3.1.2.jar +hive-shims-0.23/2.3.8//hive-shims-0.23-2.3.8.jar +hive-shims-common/2.3.8//hive-shims-common-2.3.8.jar +hive-shims-scheduler/2.3.8//hive-shims-scheduler-2.3.8.jar +hive-shims/2.3.8//hive-shims-2.3.8.jar +hive-storage-api/2.7.2//hive-storage-api-2.7.2.jar +hive-vector-code-gen/2.3.8//hive-vector-code-gen-2.3.8.jar hk2-api/2.6.1//hk2-api-2.6.1.jar hk2-locator/2.6.1//hk2-locator-2.6.1.jar hk2-utils/2.6.1//hk2-utils-2.6.1.jar htrace-core4/4.1.0-incubating//htrace-core4-4.1.0-incubating.jar -httpclient/4.5.6//httpclient-4.5.6.jar +httpclient/4.5.13//httpclient-4.5.13.jar httpcore/4.4.12//httpcore-4.4.12.jar istack-commons-runtime/3.0.8//istack-commons-runtime-3.0.8.jar ivy/2.4.0//ivy-2.4.0.jar -jackson-annotations/2.10.0//jackson-annotations-2.10.0.jar +jackson-annotations/2.12.2//jackson-annotations-2.12.2.jar jackson-core-asl/1.9.13//jackson-core-asl-1.9.13.jar -jackson-core/2.10.0//jackson-core-2.10.0.jar -jackson-databind/2.10.0//jackson-databind-2.10.0.jar -jackson-dataformat-yaml/2.10.0//jackson-dataformat-yaml-2.10.0.jar -jackson-jaxrs-base/2.9.5//jackson-jaxrs-base-2.9.5.jar -jackson-jaxrs-json-provider/2.9.5//jackson-jaxrs-json-provider-2.9.5.jar +jackson-core/2.12.2//jackson-core-2.12.2.jar +jackson-databind/2.12.2//jackson-databind-2.12.2.jar +jackson-dataformat-yaml/2.12.2//jackson-dataformat-yaml-2.12.2.jar +jackson-datatype-jsr310/2.11.2//jackson-datatype-jsr310-2.11.2.jar jackson-mapper-asl/1.9.13//jackson-mapper-asl-1.9.13.jar -jackson-module-jaxb-annotations/2.10.0//jackson-module-jaxb-annotations-2.10.0.jar -jackson-module-paranamer/2.10.0//jackson-module-paranamer-2.10.0.jar -jackson-module-scala_2.12/2.10.0//jackson-module-scala_2.12-2.10.0.jar -jakarta.activation-api/1.2.1//jakarta.activation-api-1.2.1.jar +jackson-module-scala_2.12/2.12.2//jackson-module-scala_2.12-2.12.2.jar jakarta.annotation-api/1.3.5//jakarta.annotation-api-1.3.5.jar jakarta.inject/2.6.1//jakarta.inject-2.6.1.jar +jakarta.servlet-api/4.0.3//jakarta.servlet-api-4.0.3.jar jakarta.validation-api/2.0.2//jakarta.validation-api-2.0.2.jar jakarta.ws.rs-api/2.1.6//jakarta.ws.rs-api-2.1.6.jar jakarta.xml.bind-api/2.3.2//jakarta.xml.bind-api-2.3.2.jar -janino/3.0.16//janino-3.0.16.jar +janino/3.1.4//janino-3.1.4.jar javassist/3.25.0-GA//javassist-3.25.0-GA.jar -javax.inject/1//javax.inject-1.jar javax.jdo/3.2.0-m3//javax.jdo-3.2.0-m3.jar -javax.servlet-api/3.1.0//javax.servlet-api-3.1.0.jar javolution/5.5.1//javolution-5.5.1.jar jaxb-api/2.2.11//jaxb-api-2.2.11.jar jaxb-runtime/2.3.2//jaxb-runtime-2.3.2.jar -jcip-annotations/1.0-1//jcip-annotations-1.0-1.jar jcl-over-slf4j/1.7.30//jcl-over-slf4j-1.7.30.jar jdo-api/3.0.1//jdo-api-3.0.1.jar -jersey-client/2.30//jersey-client-2.30.jar -jersey-common/2.30//jersey-common-2.30.jar -jersey-container-servlet-core/2.30//jersey-container-servlet-core-2.30.jar -jersey-container-servlet/2.30//jersey-container-servlet-2.30.jar -jersey-hk2/2.30//jersey-hk2-2.30.jar -jersey-media-jaxb/2.30//jersey-media-jaxb-2.30.jar -jersey-server/2.30//jersey-server-2.30.jar +jersey-client/2.34//jersey-client-2.34.jar +jersey-common/2.34//jersey-common-2.34.jar +jersey-container-servlet-core/2.34//jersey-container-servlet-core-2.34.jar +jersey-container-servlet/2.34//jersey-container-servlet-2.34.jar +jersey-hk2/2.34//jersey-hk2-2.34.jar +jersey-server/2.34//jersey-server-2.34.jar jline/2.14.6//jline-2.14.6.jar joda-time/2.10.5//joda-time-2.10.5.jar jodd-core/3.5.2//jodd-core-3.5.2.jar jpam/1.1//jpam-1.1.jar -json-smart/2.3//json-smart-2.3.jar json/1.8//json-1.8.jar -json4s-ast_2.12/3.6.6//json4s-ast_2.12-3.6.6.jar -json4s-core_2.12/3.6.6//json4s-core_2.12-3.6.6.jar -json4s-jackson_2.12/3.6.6//json4s-jackson_2.12-3.6.6.jar -json4s-scalap_2.12/3.6.6//json4s-scalap_2.12-3.6.6.jar -jsp-api/2.1//jsp-api-2.1.jar +json4s-ast_2.12/3.7.0-M5//json4s-ast_2.12-3.7.0-M5.jar +json4s-core_2.12/3.7.0-M5//json4s-core_2.12-3.7.0-M5.jar +json4s-jackson_2.12/3.7.0-M5//json4s-jackson_2.12-3.7.0-M5.jar +json4s-scalap_2.12/3.7.0-M5//json4s-scalap_2.12-3.7.0-M5.jar jsr305/3.0.0//jsr305-3.0.0.jar jta/1.1//jta-1.1.jar jul-to-slf4j/1.7.30//jul-to-slf4j-1.7.30.jar -kerb-admin/1.0.1//kerb-admin-1.0.1.jar -kerb-client/1.0.1//kerb-client-1.0.1.jar -kerb-common/1.0.1//kerb-common-1.0.1.jar -kerb-core/1.0.1//kerb-core-1.0.1.jar -kerb-crypto/1.0.1//kerb-crypto-1.0.1.jar -kerb-identity/1.0.1//kerb-identity-1.0.1.jar -kerb-server/1.0.1//kerb-server-1.0.1.jar -kerb-simplekdc/1.0.1//kerb-simplekdc-1.0.1.jar -kerb-util/1.0.1//kerb-util-1.0.1.jar -kerby-asn1/1.0.1//kerby-asn1-1.0.1.jar -kerby-config/1.0.1//kerby-config-1.0.1.jar -kerby-pkix/1.0.1//kerby-pkix-1.0.1.jar -kerby-util/1.0.1//kerby-util-1.0.1.jar -kerby-xdr/1.0.1//kerby-xdr-1.0.1.jar kryo-shaded/4.0.2//kryo-shaded-4.0.2.jar -kubernetes-client/4.7.1//kubernetes-client-4.7.1.jar -kubernetes-model-common/4.7.1//kubernetes-model-common-4.7.1.jar -kubernetes-model/4.7.1//kubernetes-model-4.7.1.jar +kubernetes-client/5.3.1//kubernetes-client-5.3.1.jar +kubernetes-model-admissionregistration/5.3.1//kubernetes-model-admissionregistration-5.3.1.jar +kubernetes-model-apiextensions/5.3.1//kubernetes-model-apiextensions-5.3.1.jar +kubernetes-model-apps/5.3.1//kubernetes-model-apps-5.3.1.jar +kubernetes-model-autoscaling/5.3.1//kubernetes-model-autoscaling-5.3.1.jar +kubernetes-model-batch/5.3.1//kubernetes-model-batch-5.3.1.jar +kubernetes-model-certificates/5.3.1//kubernetes-model-certificates-5.3.1.jar +kubernetes-model-common/5.3.1//kubernetes-model-common-5.3.1.jar +kubernetes-model-coordination/5.3.1//kubernetes-model-coordination-5.3.1.jar +kubernetes-model-core/5.3.1//kubernetes-model-core-5.3.1.jar +kubernetes-model-discovery/5.3.1//kubernetes-model-discovery-5.3.1.jar +kubernetes-model-events/5.3.1//kubernetes-model-events-5.3.1.jar +kubernetes-model-extensions/5.3.1//kubernetes-model-extensions-5.3.1.jar +kubernetes-model-metrics/5.3.1//kubernetes-model-metrics-5.3.1.jar +kubernetes-model-networking/5.3.1//kubernetes-model-networking-5.3.1.jar +kubernetes-model-node/5.3.1//kubernetes-model-node-5.3.1.jar +kubernetes-model-policy/5.3.1//kubernetes-model-policy-5.3.1.jar +kubernetes-model-rbac/5.3.1//kubernetes-model-rbac-5.3.1.jar +kubernetes-model-scheduling/5.3.1//kubernetes-model-scheduling-5.3.1.jar +kubernetes-model-storageclass/5.3.1//kubernetes-model-storageclass-5.3.1.jar +lapack/2.2.0//lapack-2.2.0.jar leveldbjni-all/1.8//leveldbjni-all-1.8.jar libfb303/0.9.3//libfb303-0.9.3.jar libthrift/0.12.0//libthrift-0.12.0.jar log4j/1.2.17//log4j-1.2.17.jar -logging-interceptor/3.12.6//logging-interceptor-3.12.6.jar +logging-interceptor/3.12.12//logging-interceptor-3.12.12.jar lz4-java/1.7.1//lz4-java-1.7.1.jar machinist_2.12/0.6.8//machinist_2.12-0.6.8.jar macro-compat_2.12/1.1.1//macro-compat_2.12-1.1.1.jar @@ -182,30 +161,26 @@ metrics-jmx/4.1.1//metrics-jmx-4.1.1.jar metrics-json/4.1.1//metrics-json-4.1.1.jar metrics-jvm/4.1.1//metrics-jvm-4.1.1.jar minlog/1.3.0//minlog-1.3.0.jar -mssql-jdbc/6.2.1.jre7//mssql-jdbc-6.2.1.jre7.jar -netty-all/4.1.47.Final//netty-all-4.1.47.Final.jar -nimbus-jose-jwt/4.41.1//nimbus-jose-jwt-4.41.1.jar -objenesis/2.5.1//objenesis-2.5.1.jar -okhttp/2.7.5//okhttp-2.7.5.jar -okhttp/3.12.6//okhttp-3.12.6.jar -okio/1.15.0//okio-1.15.0.jar +netty-all/4.1.63.Final//netty-all-4.1.63.Final.jar +objenesis/2.6//objenesis-2.6.jar +okhttp/3.12.12//okhttp-3.12.12.jar +okio/1.14.0//okio-1.14.0.jar opencsv/2.3//opencsv-2.3.jar -orc-core/1.5.10//orc-core-1.5.10.jar -orc-mapreduce/1.5.10//orc-mapreduce-1.5.10.jar -orc-shims/1.5.10//orc-shims-1.5.10.jar +orc-core/1.6.7//orc-core-1.6.7.jar +orc-mapreduce/1.6.7//orc-mapreduce-1.6.7.jar +orc-shims/1.6.7//orc-shims-1.6.7.jar oro/2.0.8//oro-2.0.8.jar osgi-resource-locator/1.0.3//osgi-resource-locator-1.0.3.jar paranamer/2.8//paranamer-2.8.jar -parquet-column/1.10.1//parquet-column-1.10.1.jar -parquet-common/1.10.1//parquet-common-1.10.1.jar -parquet-encoding/1.10.1//parquet-encoding-1.10.1.jar -parquet-format/2.4.0//parquet-format-2.4.0.jar -parquet-hadoop/1.10.1//parquet-hadoop-1.10.1.jar -parquet-jackson/1.10.1//parquet-jackson-1.10.1.jar +parquet-column/1.12.0//parquet-column-1.12.0.jar +parquet-common/1.12.0//parquet-common-1.12.0.jar +parquet-encoding/1.12.0//parquet-encoding-1.12.0.jar +parquet-format-structures/1.12.0//parquet-format-structures-1.12.0.jar +parquet-hadoop/1.12.0//parquet-hadoop-1.12.0.jar +parquet-jackson/1.12.0//parquet-jackson-1.12.0.jar protobuf-java/2.5.0//protobuf-java-2.5.0.jar -py4j/0.10.9//py4j-0.10.9.jar +py4j/0.10.9.2//py4j-0.10.9.2.jar pyrolite/4.30//pyrolite-4.30.jar -re2j/1.1//re2j-1.1.jar scala-collection-compat_2.12/2.1.1//scala-collection-compat_2.12-2.1.1.jar scala-compiler/2.12.10//scala-compiler-2.12.10.jar scala-library/2.12.10//scala-library-2.12.10.jar @@ -213,27 +188,25 @@ scala-parser-combinators_2.12/1.1.2//scala-parser-combinators_2.12-1.1.2.jar scala-reflect/2.12.10//scala-reflect-2.12.10.jar scala-xml_2.12/1.2.0//scala-xml_2.12-1.2.0.jar shapeless_2.12/2.3.3//shapeless_2.12-2.3.3.jar -shims/0.7.45//shims-0.7.45.jar +shims/0.9.0//shims-0.9.0.jar slf4j-api/1.7.30//slf4j-api-1.7.30.jar slf4j-log4j12/1.7.30//slf4j-log4j12-1.7.30.jar -snakeyaml/1.24//snakeyaml-1.24.jar -snappy-java/1.1.7.5//snappy-java-1.1.7.5.jar +snakeyaml/1.27//snakeyaml-1.27.jar +snappy-java/1.1.8.4//snappy-java-1.1.8.4.jar spire-macros_2.12/0.17.0-M1//spire-macros_2.12-0.17.0-M1.jar spire-platform_2.12/0.17.0-M1//spire-platform_2.12-0.17.0-M1.jar spire-util_2.12/0.17.0-M1//spire-util_2.12-0.17.0-M1.jar spire_2.12/0.17.0-M1//spire_2.12-0.17.0-M1.jar stax-api/1.0.1//stax-api-1.0.1.jar -stax2-api/3.1.4//stax2-api-3.1.4.jar stream/2.9.6//stream-2.9.6.jar super-csv/2.2.0//super-csv-2.2.0.jar threeten-extra/1.5.0//threeten-extra-1.5.0.jar -token-provider/1.0.1//token-provider-1.0.1.jar transaction-api/1.1//transaction-api-1.1.jar -univocity-parsers/2.8.3//univocity-parsers-2.8.3.jar +univocity-parsers/2.9.1//univocity-parsers-2.9.1.jar velocity/1.5//velocity-1.5.jar -woodstox-core/5.0.3//woodstox-core-5.0.3.jar xbean-asm7-shaded/4.15//xbean-asm7-shaded-4.15.jar -xz/1.5//xz-1.5.jar +xz/1.8//xz-1.8.jar zjsonpatch/0.3.0//zjsonpatch-0.3.0.jar -zookeeper/3.4.14//zookeeper-3.4.14.jar -zstd-jni/1.4.4-3//zstd-jni-1.4.4-3.jar +zookeeper-jute/3.6.2//zookeeper-jute-3.6.2.jar +zookeeper/3.6.2//zookeeper-3.6.2.jar +zstd-jni/1.4.9-1//zstd-jni-1.4.9-1.jar diff --git a/dev/eslint.json b/dev/eslint.json new file mode 100644 index 0000000000000..ee1fd3dcc6e71 --- /dev/null +++ b/dev/eslint.json @@ -0,0 +1,24 @@ +{ + "env": { + "browser": true, + "es6": true + }, + "extends": "eslint:recommended", + "rules": { + "indent": [ + "error", + 2, + { + "SwitchCase": 1, + "MemberExpression": "off" + } + ], + "no-unused-vars": ["error", {"argsIgnorePattern": "^_ignored_.*"}] + }, + "ignorePatterns": [ + "*.min.js", + "sorttable.js", + "jquery.mustache.js", + "dataTables.rowsGroup.js" + ] +} diff --git a/dev/github_jira_sync.py b/dev/github_jira_sync.py index b444b74d4027c..27451bba905dd 100755 --- a/dev/github_jira_sync.py +++ b/dev/github_jira_sync.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Licensed to the Apache Software Foundation (ASF) under one or more @@ -16,26 +16,21 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# Utility for updating JIRA's with information about Github pull requests +# Utility for updating JIRA's with information about GitHub pull requests import json import os import re import sys -if sys.version < '3': - from urllib2 import urlopen - from urllib2 import Request - from urllib2 import HTTPError -else: - from urllib.request import urlopen - from urllib.request import Request - from urllib.error import HTTPError +from urllib.request import urlopen +from urllib.request import Request +from urllib.error import HTTPError try: import jira.client except ImportError: print("This tool requires the jira-python library") - print("Install using 'sudo pip install jira'") + print("Install using 'sudo pip3 install jira'") sys.exit(-1) # User facing configs @@ -147,9 +142,9 @@ def reset_pr_labels(pr_num, jira_components): jira_prs = get_jira_prs() previous_max = get_max_pr() -print("Retrieved %s JIRA PR's from Github" % len(jira_prs)) +print("Retrieved %s JIRA PR's from GitHub" % len(jira_prs)) jira_prs = [(k, v) for k, v in jira_prs if int(v['number']) > previous_max] -print("%s PR's remain after excluding visted ones" % len(jira_prs)) +print("%s PR's remain after excluding visited ones" % len(jira_prs)) num_updates = 0 considered = [] @@ -162,7 +157,7 @@ def reset_pr_labels(pr_num, jira_components): considered = considered + [pr_num] url = pr['html_url'] - title = "[Github] Pull Request #%s (%s)" % (pr['number'], pr['user']['login']) + title = "[GitHub] Pull Request #%s (%s)" % (pr['number'], pr['user']['login']) try: page = get_json(get_url(JIRA_API_BASE + "/rest/api/2/issue/" + issue + "/remotelink")) existing_links = map(lambda l: l['object']['url'], page) @@ -179,7 +174,7 @@ def reset_pr_labels(pr_num, jira_components): destination = {"title": title, "url": url, "icon": icon} # For all possible fields see: # https://developer.atlassian.com/display/JIRADEV/Fields+in+Remote+Issue+Links - # application = {"name": "Github pull requests", "type": "org.apache.spark.jira.github"} + # application = {"name": "GitHub pull requests", "type": "org.apache.spark.jira.github"} jira_client.add_remote_link(issue, destination) comment = "User '%s' has created a pull request for this issue:" % pr['user']['login'] diff --git a/dev/lint-js b/dev/lint-js new file mode 100755 index 0000000000000..ce06e282192a0 --- /dev/null +++ b/dev/lint-js @@ -0,0 +1,56 @@ +#!/usr/bin/env 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 -o pipefail + +SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" +SPARK_ROOT_DIR="$(dirname $SCRIPT_DIR)" +LINT_JS_REPORT_FILE_NAME="$SPARK_ROOT_DIR/dev/lint-js-report.log" +LINT_TARGET_FILES=( + "$SPARK_ROOT_DIR/core/src/main/resources/org/apache/spark/ui/static/" + "$SPARK_ROOT_DIR/sql/core/src/main/resources/org/apache/spark/sql/execution/ui/static/" + "$SPARK_ROOT_DIR/docs/js" +) + +if ! type "npm" > /dev/null; then + echo "ERROR: You should install npm" + exit 1 +fi + +if ! type "npx" > /dev/null; then + echo "ERROR: You should install npx" + exit 1 +fi + +cd $SCRIPT_DIR + +if ! npm ls eslint > /dev/null; then + npm ci eslint +fi + +npx eslint -c "$SPARK_ROOT_DIR/dev/eslint.json" $LINT_TARGET_FILES | tee "$LINT_JS_REPORT_FILE_NAME" +lint_status=$? + +if [ "$lint_status" = "0" ] ; then + echo "lint-js checks passed." +else + echo "lint-js checks failed." +fi + +exit "$lint_status" diff --git a/dev/lint-python b/dev/lint-python index d5491f2447176..28df2a02ae25b 100755 --- a/dev/lint-python +++ b/dev/lint-python @@ -17,10 +17,11 @@ # # define test binaries + versions FLAKE8_BUILD="flake8" +# TODO(SPARK-34943): minimum version should be 3.8+ MINIMUM_FLAKE8="3.5.0" - +MYPY_BUILD="mypy" PYCODESTYLE_BUILD="pycodestyle" -MINIMUM_PYCODESTYLE="2.4.0" +MINIMUM_PYCODESTYLE="2.7.0" SPHINX_BUILD="sphinx-build" @@ -122,6 +123,31 @@ function pycodestyle_test { fi } +function mypy_test { + local MYPY_REPORT= + local MYPY_STATUS= + + # TODO(SPARK-32797): Install mypy on the Jenkins CI workers + if ! hash "$MYPY_BUILD" 2> /dev/null; then + echo "The $MYPY_BUILD command was not found. Skipping for now." + return + fi + + echo "starting $MYPY_BUILD test..." + MYPY_REPORT=$( ($MYPY_BUILD --config-file python/mypy.ini python/pyspark) 2>&1) + MYPY_STATUS=$? + + if [ "$MYPY_STATUS" -ne 0 ]; then + echo "mypy checks failed:" + echo "$MYPY_REPORT" + echo "$MYPY_STATUS" + exit "$MYPY_STATUS" + else + echo "mypy checks passed." + echo + fi +} + function flake8_test { local FLAKE8_VERSION= local EXPECTED_FLAKE8= @@ -147,8 +173,7 @@ flake8 checks failed." fi echo "starting $FLAKE8_BUILD test..." - FLAKE8_REPORT=$( ($FLAKE8_BUILD . --count --select=E901,E999,F821,F822,F823 \ - --max-line-length=100 --show-source --statistics) 2>&1) + FLAKE8_REPORT=$( ($FLAKE8_BUILD --append-config dev/tox.ini --count --show-source --statistics .) 2>&1) FLAKE8_STATUS=$? if [ "$FLAKE8_STATUS" -ne 0 ]; then @@ -168,7 +193,55 @@ function sphinx_test { # Check that the documentation builds acceptably, skip check if sphinx is not installed. if ! hash "$SPHINX_BUILD" 2> /dev/null; then - echo "The $SPHINX_BUILD command was not found. Skipping pydoc checks for now." + echo "The $SPHINX_BUILD command was not found. Skipping Sphinx build for now." + echo + return + fi + + PYTHON_HAS_SPHINX=$("$PYTHON_EXECUTABLE" -c 'import importlib.util; print(importlib.util.find_spec("sphinx") is not None)') + if [[ "$PYTHON_HAS_SPHINX" == "False" ]]; then + echo "$PYTHON_EXECUTABLE does not have Sphinx installed. Skipping Sphinx build for now." + echo + return + fi + + # TODO(SPARK-32407): Sphinx 3.1+ does not correctly index nested classes. + # See also https://github.com/sphinx-doc/sphinx/issues/7551. + PYTHON_HAS_SPHINX_3_0=$("$PYTHON_EXECUTABLE" -c 'from distutils.version import LooseVersion; import sphinx; print(LooseVersion(sphinx.__version__) < LooseVersion("3.1.0"))') + if [[ "$PYTHON_HAS_SPHINX_3_0" == "False" ]]; then + echo "$PYTHON_EXECUTABLE has Sphinx 3.1+ installed but it requires lower than 3.1. Skipping Sphinx build for now." + echo + return + fi + + # TODO(SPARK-32391): Install pydata_sphinx_theme in Jenkins machines + PYTHON_HAS_THEME=$("$PYTHON_EXECUTABLE" -c 'import importlib.util; print(importlib.util.find_spec("pydata_sphinx_theme") is not None)') + if [[ "$PYTHON_HAS_THEME" == "False" ]]; then + echo "$PYTHON_EXECUTABLE does not have pydata_sphinx_theme installed. Skipping Sphinx build for now." + echo + return + fi + + # TODO(SPARK-32666): Install nbsphinx in Jenkins machines + PYTHON_HAS_NBSPHINX=$("$PYTHON_EXECUTABLE" -c 'import importlib.util; print(importlib.util.find_spec("nbsphinx") is not None)') + if [[ "$PYTHON_HAS_NBSPHINX" == "False" ]]; then + echo "$PYTHON_EXECUTABLE does not have nbsphinx installed. Skipping Sphinx build for now." + echo + return + fi + + # TODO(SPARK-32666): Install ipython in Jenkins machines + PYTHON_HAS_IPYTHON=$("$PYTHON_EXECUTABLE" -c 'import importlib.util; print(importlib.util.find_spec("IPython") is not None)') + if [[ "$PYTHON_HAS_IPYTHON" == "False" ]]; then + echo "$PYTHON_EXECUTABLE does not have ipython installed. Skipping Sphinx build for now." + echo + return + fi + + # TODO(SPARK-33242): Install numpydoc in Jenkins machines + PYTHON_HAS_NUMPYDOC=$("$PYTHON_EXECUTABLE" -c 'import importlib.util; print(importlib.util.find_spec("numpydoc") is not None)') + if [[ "$PYTHON_HAS_NUMPYDOC" == "False" ]]; then + echo "$PYTHON_EXECUTABLE does not have numpydoc installed. Skipping Sphinx build for now." echo return fi @@ -202,11 +275,13 @@ SPARK_ROOT_DIR="$(dirname "${SCRIPT_DIR}")" pushd "$SPARK_ROOT_DIR" &> /dev/null -PYTHON_SOURCE="$(find . -name "*.py")" +# skipping local ruby bundle directory from the search +PYTHON_SOURCE="$(find . -path ./docs/.local_ruby_bundle -prune -false -o -name "*.py")" compile_python_test "$PYTHON_SOURCE" pycodestyle_test "$PYTHON_SOURCE" flake8_test +mypy_test sphinx_test echo diff --git a/dev/merge_spark_pr.py b/dev/merge_spark_pr.py index 967cdace60dc9..2a40618228c5f 100755 --- a/dev/merge_spark_pr.py +++ b/dev/merge_spark_pr.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # # Licensed to the Apache Software Foundation (ASF) under one or more @@ -31,15 +31,9 @@ import subprocess import sys import traceback -if sys.version < '3': - input = raw_input # noqa - from urllib2 import urlopen - from urllib2 import Request - from urllib2 import HTTPError -else: - from urllib.request import urlopen - from urllib.request import Request - from urllib.error import HTTPError +from urllib.request import urlopen +from urllib.request import Request +from urllib.error import HTTPError try: import jira.client @@ -565,7 +559,7 @@ def main(): print("JIRA_USERNAME and JIRA_PASSWORD not set") print("Exiting without trying to close the associated JIRA.") else: - print("Could not find jira-python library. Run 'sudo pip install jira' to install.") + print("Could not find jira-python library. Run 'sudo pip3 install jira' to install.") print("Exiting without trying to close the associated JIRA.") if __name__ == "__main__": diff --git a/dev/mima b/dev/mima index f324c5c00a45c..d214bb96e09a3 100755 --- a/dev/mima +++ b/dev/mima @@ -25,8 +25,8 @@ FWDIR="$(cd "`dirname "$0"`"/..; pwd)" cd "$FWDIR" SPARK_PROFILES=${1:-"-Pmesos -Pkubernetes -Pyarn -Pspark-ganglia-lgpl -Pkinesis-asl -Phive-thriftserver -Phive"} -TOOLS_CLASSPATH="$(build/sbt -DcopyDependencies=false "export tools/fullClasspath" | tail -n1)" -OLD_DEPS_CLASSPATH="$(build/sbt -DcopyDependencies=false $SPARK_PROFILES "export oldDeps/fullClasspath" | tail -n1)" +TOOLS_CLASSPATH="$(build/sbt -DcopyDependencies=false "export tools/fullClasspath" | grep jar | tail -n1)" +OLD_DEPS_CLASSPATH="$(build/sbt -DcopyDependencies=false $SPARK_PROFILES "export oldDeps/fullClasspath" | grep jar | tail -n1)" rm -f .generated-mima* diff --git a/dev/package-lock.json b/dev/package-lock.json new file mode 100644 index 0000000000000..a57f45bcf7184 --- /dev/null +++ b/dev/package-lock.json @@ -0,0 +1,979 @@ +{ + "requires": true, + "lockfileVersion": 1, + "dependencies": { + "@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz", + "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==", + "dev": true + }, + "@babel/highlight": { + "version": "7.14.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz", + "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.14.0", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + } + } + }, + "@eslint/eslintrc": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.0.tgz", + "integrity": "sha512-2ZPCc+uNbjV5ERJr+aKSPRwZgKd2z11x0EgLvb1PURmUrn9QNRXFqje0Ldq454PfAVyaJYyrDvvIKSFP4NnBog==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + } + } + }, + "acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "dev": true + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "chalk": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", + "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.25.0.tgz", + "integrity": "sha512-TVpSovpvCNpLURIScDRB6g5CYu/ZFq9GfX2hLNIV4dSBKxIWojeDODvYl3t0k0VtMxYeR8OXPCFE5+oHMlGfhw==", + "dev": true, + "requires": { + "@babel/code-frame": "7.12.11", + "@eslint/eslintrc": "^0.4.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "enquirer": "^2.3.5", + "eslint-scope": "^5.1.1", + "eslint-utils": "^2.1.0", + "eslint-visitor-keys": "^2.0.0", + "espree": "^7.3.1", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "file-entry-cache": "^6.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^13.6.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.21", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^6.0.4", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + }, + "espree": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", + "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", + "dev": true, + "requires": { + "acorn": "^7.4.0", + "acorn-jsx": "^5.3.1", + "eslint-visitor-keys": "^1.3.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true + } + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", + "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "13.8.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.8.0.tgz", + "integrity": "sha512-rHtdA6+PDBIjeEvA91rpqzEvk/k3/i7EeNQiryiWuJH0Hw9cpyJMAt2jtbAwUaRdhD+573X4vWw6IcjKPasi9Q==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + }, + "dependencies": { + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + } + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.flatten": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flatten/-/lodash.flatten-4.4.0.tgz", + "integrity": "sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=", + "dev": true + }, + "lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", + "dev": true + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "requires": { + "yallist": "^4.0.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "dev": true + }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + } + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "string-width": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", + "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "table": { + "version": "6.6.0", + "resolved": "https://registry.npmjs.org/table/-/table-6.6.0.tgz", + "integrity": "sha512-iZMtp5tUvcnAdtHpZTWLPF0M7AgiQsURR2DwmxnJwSy8I3+cY+ozzVvYha3BOLG2TB+L0CqjIz+91htuj6yCXg==", + "dev": true, + "requires": { + "ajv": "^8.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ajv": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.2.0.tgz", + "integrity": "sha512-WSNGFuyWd//XO8n/m/EaOlNLtO0yL8EXT/74LqT4khdhpZjP7lkj/kT5uwRmGitKEVp/Oj7ZUHeGfPtgHhQ5CA==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "v8-compile-cache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + } + } +} diff --git a/dev/package.json b/dev/package.json new file mode 100644 index 0000000000000..0391a3983f78f --- /dev/null +++ b/dev/package.json @@ -0,0 +1,5 @@ +{ + "devDependencies": { + "eslint": "^7.25.0" + } +} diff --git a/dev/pip-sanity-check.py b/dev/pip-sanity-check.py index e9f10233b12b7..469e27b78b40d 100644 --- a/dev/pip-sanity-check.py +++ b/dev/pip-sanity-check.py @@ -16,7 +16,6 @@ # from pyspark.sql import SparkSession -from pyspark.mllib.linalg import * import sys if __name__ == "__main__": diff --git a/dev/requirements.txt b/dev/requirements.txt index baea9213dbc97..f0bdc797b7033 100644 --- a/dev/requirements.txt +++ b/dev/requirements.txt @@ -1,5 +1,8 @@ flake8==3.5.0 -jira==1.0.3 +jira==2.0.0 PyGithub==1.26.0 -Unidecode==0.04.19 sphinx +pydata_sphinx_theme +ipython +nbsphinx +numpydoc diff --git a/dev/run-pip-tests b/dev/run-pip-tests index 470f21e69d46a..cb64e88318a89 100755 --- a/dev/run-pip-tests +++ b/dev/run-pip-tests @@ -63,11 +63,15 @@ fi PYSPARK_VERSION=$(python3 -c "exec(open('python/pyspark/version.py').read());print(__version__)") PYSPARK_DIST="$FWDIR/python/dist/pyspark-$PYSPARK_VERSION.tar.gz" # The pip install options we use for all the pip commands -PIP_OPTIONS="--upgrade --no-cache-dir --force-reinstall " +PIP_OPTIONS="--upgrade --no-cache-dir --force-reinstall" # Test both regular user and edit/dev install modes. PIP_COMMANDS=("pip install $PIP_OPTIONS $PYSPARK_DIST" "pip install $PIP_OPTIONS -e python/") +# Jenkins has PySpark installed under user sitepackages shared for some reasons. +# In this test, explicitly exclude user sitepackages to prevent side effects +export PYTHONNOUSERSITE=1 + for python in "${PYTHON_EXECS[@]}"; do for install_command in "${PIP_COMMANDS[@]}"; do echo "Testing pip installation with python $python" @@ -77,7 +81,7 @@ for python in "${PYTHON_EXECS[@]}"; do rm -rf "$VIRTUALENV_PATH" if [ -n "$USE_CONDA" ]; then conda create -y -p "$VIRTUALENV_PATH" python=$python numpy pandas pip setuptools - source activate "$VIRTUALENV_PATH" + source activate "$VIRTUALENV_PATH" || conda activate "$VIRTUALENV_PATH" else mkdir -p "$VIRTUALENV_PATH" virtualenv --python=$python "$VIRTUALENV_PATH" @@ -120,7 +124,7 @@ for python in "${PYTHON_EXECS[@]}"; do # conda / virtualenv environments need to be deactivated differently if [ -n "$USE_CONDA" ]; then - source deactivate + source deactivate || conda deactivate else deactivate fi diff --git a/dev/run-tests-jenkins b/dev/run-tests-jenkins index c3adc696a5122..c155d4ea3f076 100755 --- a/dev/run-tests-jenkins +++ b/dev/run-tests-jenkins @@ -26,6 +26,7 @@ FWDIR="$( cd "$( dirname "$0" )/.." && pwd )" cd "$FWDIR" export PATH=/home/anaconda/envs/py36/bin:$PATH +export LANG="en_US.UTF-8" PYTHON_VERSION_CHECK=$(python3 -c 'import sys; print(sys.version_info < (3, 6, 0))') if [[ "$PYTHON_VERSION_CHECK" == "True" ]]; then diff --git a/dev/run-tests-jenkins.py b/dev/run-tests-jenkins.py index 72e32d4e16e14..4309a74773e89 100755 --- a/dev/run-tests-jenkins.py +++ b/dev/run-tests-jenkins.py @@ -22,15 +22,9 @@ import json import functools import subprocess -if sys.version < '3': - from urllib2 import urlopen - from urllib2 import Request - from urllib2 import HTTPError, URLError -else: - from urllib.request import urlopen - from urllib.request import Request - from urllib.error import HTTPError, URLError - +from urllib.request import urlopen +from urllib.request import Request +from urllib.error import HTTPError, URLError from sparktestsupport import SPARK_HOME, ERROR_CODES from sparktestsupport.shellutils import run_cmd @@ -44,7 +38,7 @@ def print_err(msg): def post_message_to_github(msg, ghprb_pull_id): - print("Attempting to post to Github...") + print("Attempting to post to GitHub...") api_url = os.getenv("GITHUB_API_BASE", "https://api.github.com/repos/apache/spark") url = api_url + "/issues/" + ghprb_pull_id + "/comments" @@ -63,12 +57,12 @@ def post_message_to_github(msg, ghprb_pull_id): if response.getcode() == 201: print(" > Post successful.") except HTTPError as http_e: - print_err("Failed to post message to Github.") + print_err("Failed to post message to GitHub.") print_err(" > http_code: %s" % http_e.code) print_err(" > api_response: %s" % http_e.read()) print_err(" > data: %s" % posted_message) except URLError as url_e: - print_err("Failed to post message to Github.") + print_err("Failed to post message to GitHub.") print_err(" > urllib_status: %s" % url_e.reason[1]) print_err(" > data: %s" % posted_message) @@ -95,7 +89,7 @@ def run_pr_checks(pr_tests, ghprb_actual_commit, sha1): """ Executes a set of pull request checks to ease development and report issues with various components such as style, linting, dependencies, compatibilities, etc. - @return a list of messages to post back to Github + @return a list of messages to post back to GitHub """ # Ensure we save off the current HEAD to revert to current_pr_head = run_cmd(['git', 'rev-parse', 'HEAD'], return_output=True).strip() @@ -115,7 +109,7 @@ def run_tests(tests_timeout): """ Runs the `dev/run-tests` script and responds with the correct error message under the various failure scenarios. - @return a tuple containing the test result code and the result note to post to Github + @return a tuple containing the test result code and the result note to post to GitHub """ test_result_code = subprocess.Popen(['timeout', @@ -181,8 +175,6 @@ def main(): if "test-hadoop3.2" in ghprb_pull_title: os.environ["AMPLAB_JENKINS_BUILD_PROFILE"] = "hadoop3.2" # Switch the Hive profile based on the PR title: - if "test-hive1.2" in ghprb_pull_title: - os.environ["AMPLAB_JENKINS_BUILD_HIVE_PROFILE"] = "hive1.2" if "test-hive2.3" in ghprb_pull_title: os.environ["AMPLAB_JENKINS_BUILD_HIVE_PROFILE"] = "hive2.3" @@ -198,7 +190,7 @@ def main(): # format: http://linux.die.net/man/1/timeout # must be less than the timeout configured on Jenkins. Usually Jenkins's timeout is higher # then this. Please consult with the build manager or a committer when it should be increased. - tests_timeout = "400m" + tests_timeout = "500m" # Array to capture all test names to run on the pull request. These tests are represented # by their file equivalents in the dev/tests/ directory. @@ -206,16 +198,16 @@ def main(): # To write a PR test: # * the file must reside within the dev/tests directory # * be an executable bash script - # * accept three arguments on the command line, the first being the Github PR long commit - # hash, the second the Github SHA1 hash, and the final the current PR hash + # * accept three arguments on the command line, the first being the GitHub PR long commit + # hash, the second the GitHub SHA1 hash, and the final the current PR hash # * and, lastly, return string output to be included in the pr message output that will - # be posted to Github + # be posted to GitHub pr_tests = [ "pr_merge_ability", "pr_public_classes" ] - # `bind_message_base` returns a function to generate messages for Github posting + # `bind_message_base` returns a function to generate messages for GitHub posting github_message = functools.partial(pr_message, build_display_name, build_url, diff --git a/dev/run-tests.py b/dev/run-tests.py index 5255a77ec2081..d5d3445bd6125 100755 --- a/dev/run-tests.py +++ b/dev/run-tests.py @@ -20,13 +20,11 @@ import itertools from argparse import ArgumentParser import os -import random import re import sys import subprocess import glob import shutil -from collections import namedtuple from sparktestsupport import SPARK_HOME, USER_HOME, ERROR_CODES from sparktestsupport.shellutils import exit_from_command_with_retcode, run_cmd, rm_r, which @@ -43,19 +41,21 @@ def determine_modules_for_files(filenames): """ Given a list of filenames, return the set of modules that contain those files. If a file is not associated with a more specific submodule, then this method will consider that - file to belong to the 'root' module. GitHub Action and Appveyor files are ignored. + file to belong to the 'root' module. `.github` directory is counted only in GitHub Actions, + and `appveyor.yml` is always ignored because this file is dedicated only to AppVeyor builds. >>> sorted(x.name for x in determine_modules_for_files(["python/pyspark/a.py", "sql/core/foo"])) ['pyspark-core', 'sql'] >>> [x.name for x in determine_modules_for_files(["file_not_matched_by_any_subproject"])] ['root'] - >>> [x.name for x in determine_modules_for_files( \ - [".github/workflows/master.yml", "appveyor.yml"])] + >>> [x.name for x in determine_modules_for_files(["appveyor.yml"])] [] """ changed_modules = set() for filename in filenames: - if filename in (".github/workflows/master.yml", "appveyor.yml"): + if filename in ("appveyor.yml",): + continue + if ("GITHUB_ACTIONS" not in os.environ) and filename.startswith(".github"): continue matched_at_least_one_module = False for module in modules.all_modules: @@ -101,28 +101,52 @@ def setup_test_environ(environ): os.environ[k] = v -def determine_modules_to_test(changed_modules): +def determine_modules_to_test(changed_modules, deduplicated=True): """ Given a set of modules that have changed, compute the transitive closure of those modules' dependent modules in order to determine the set of modules that should be tested. Returns a topologically-sorted list of modules (ties are broken by sorting on module names). + If ``deduplicated`` is disabled, the modules are returned without tacking the deduplication + by dependencies into account. >>> [x.name for x in determine_modules_to_test([modules.root])] ['root'] >>> [x.name for x in determine_modules_to_test([modules.build])] ['root'] + >>> [x.name for x in determine_modules_to_test([modules.core])] + ['root'] + >>> [x.name for x in determine_modules_to_test([modules.launcher])] + ['root'] >>> [x.name for x in determine_modules_to_test([modules.graphx])] ['graphx', 'examples'] - >>> x = [x.name for x in determine_modules_to_test([modules.sql])] - >>> x # doctest: +NORMALIZE_WHITESPACE + >>> [x.name for x in determine_modules_to_test([modules.sql])] + ... # doctest: +NORMALIZE_WHITESPACE ['sql', 'avro', 'hive', 'mllib', 'sql-kafka-0-10', 'examples', 'hive-thriftserver', - 'pyspark-sql', 'repl', 'sparkr', 'pyspark-mllib', 'pyspark-ml'] + 'pyspark-sql', 'repl', 'sparkr', 'pyspark-mllib', 'pyspark-pandas', 'pyspark-ml'] + >>> sorted([x.name for x in determine_modules_to_test( + ... [modules.sparkr, modules.sql], deduplicated=False)]) + ... # doctest: +NORMALIZE_WHITESPACE + ['avro', 'examples', 'hive', 'hive-thriftserver', 'mllib', 'pyspark-ml', + 'pyspark-mllib', 'pyspark-pandas', 'pyspark-sql', 'repl', 'sparkr', 'sql', 'sql-kafka-0-10'] + >>> sorted([x.name for x in determine_modules_to_test( + ... [modules.sql, modules.core], deduplicated=False)]) + ... # doctest: +NORMALIZE_WHITESPACE + ['avro', 'catalyst', 'core', 'examples', 'graphx', 'hive', 'hive-thriftserver', + 'mllib', 'mllib-local', 'pyspark-core', 'pyspark-ml', 'pyspark-mllib', 'pyspark-pandas', + 'pyspark-resource', 'pyspark-sql', 'pyspark-streaming', 'repl', 'root', + 'sparkr', 'sql', 'sql-kafka-0-10', 'streaming', 'streaming-kafka-0-10', + 'streaming-kinesis-asl'] """ modules_to_test = set() for module in changed_modules: - modules_to_test = modules_to_test.union(determine_modules_to_test(module.dependent_modules)) + modules_to_test = modules_to_test.union( + determine_modules_to_test(module.dependent_modules, deduplicated)) modules_to_test = modules_to_test.union(set(changed_modules)) + + if not deduplicated: + return modules_to_test + # If we need to run all of the tests, then we should short-circuit and return 'root' if modules.root in modules_to_test: return [modules.root] @@ -215,37 +239,28 @@ def run_sparkr_style_checks(): def build_spark_documentation(): set_title_and_block("Building Spark Documentation", "BLOCK_DOCUMENTATION") - os.environ["PRODUCTION"] = "1 jekyll build" + os.environ["PRODUCTION"] = "1" os.chdir(os.path.join(SPARK_HOME, "docs")) - jekyll_bin = which("jekyll") + bundle_bin = which("bundle") - if not jekyll_bin: - print("[error] Cannot find a version of `jekyll` on the system; please", - " install one and retry to build documentation.") + if not bundle_bin: + print("[error] Cannot find a version of `bundle` on the system; please", + " install one with `gem install bundler` and retry to build documentation.") sys.exit(int(os.environ.get("CURRENT_BLOCK", 255))) else: - run_cmd([jekyll_bin, "build"]) + run_cmd([bundle_bin, "install"]) + run_cmd([bundle_bin, "exec", "jekyll", "build"]) os.chdir(SPARK_HOME) -def get_zinc_port(): - """ - Get a randomized port on which to start Zinc - """ - return random.randrange(3030, 4030) - - def exec_maven(mvn_args=()): """Will call Maven in the current directory with the list of mvn_args passed in and returns the subprocess for any further processing""" - zinc_port = get_zinc_port() - os.environ["ZINC_PORT"] = "%s" % zinc_port - zinc_flag = "-DzincPort=%s" % zinc_port - flags = [os.path.join(SPARK_HOME, "build", "mvn"), zinc_flag] + flags = [os.path.join(SPARK_HOME, "build", "mvn")] run_cmd(flags + mvn_args) @@ -303,7 +318,6 @@ def get_hive_profiles(hive_version): """ sbt_maven_hive_profiles = { - "hive1.2": ["-Phive-1.2"], "hive2.3": ["-Phive-2.3"], } @@ -363,7 +377,8 @@ def build_spark_assembly_sbt(extra_profiles, checkstyle=False): if checkstyle: run_java_style_checks(build_profiles) - build_spark_unidoc_sbt(extra_profiles) + if not os.environ.get("AMPLAB_JENKINS"): + build_spark_unidoc_sbt(extra_profiles) def build_apache_spark(build_tool, extra_profiles): @@ -415,7 +430,7 @@ def run_scala_tests_sbt(test_modules, test_profiles): exec_sbt(profiles_and_goals) -def run_scala_tests(build_tool, extra_profiles, test_modules, excluded_tags): +def run_scala_tests(build_tool, extra_profiles, test_modules, excluded_tags, included_tags): """Function to properly execute all tests passed in as a set from the `determine_test_suites` function""" set_title_and_block("Running Spark unit tests", "BLOCK_SPARK_UNIT_TESTS") @@ -425,6 +440,8 @@ def run_scala_tests(build_tool, extra_profiles, test_modules, excluded_tags): test_profiles = extra_profiles + \ list(set(itertools.chain.from_iterable(m.build_profile_flags for m in test_modules))) + if included_tags: + test_profiles += ['-Dtest.include.tags=' + ",".join(included_tags)] if excluded_tags: test_profiles += ['-Dtest.exclude.tags=' + ",".join(excluded_tags)] @@ -456,6 +473,12 @@ def run_python_tests(test_modules, parallelism, with_coverage=False): if test_modules != [modules.root]: command.append("--modules=%s" % ','.join(m.name for m in test_modules)) command.append("--parallelism=%i" % parallelism) + if "GITHUB_ACTIONS" in os.environ: + # See SPARK-33565. Python 3.8 was temporarily removed as its default Python executables + # to test because of Jenkins environment issue. Once Jenkins has Python 3.8 to test, + # we should remove this change back and add python3.8 into python/run-tests.py script. + command.append("--python-executable=%s" % ','.join( + x for x in ["python3.6", "python3.8", "pypy3"] if which(x))) run_cmd(command) if with_coverage: @@ -488,10 +511,13 @@ def post_python_tests_results(): # 6. Commit current HTMLs. run_cmd([ "git", + "-c", + "user.name='Apache Spark Test Account'", + "-c", + "user.email='sparktestacc@gmail.com'", "commit", "-am", - "Coverage report at latest commit in Apache Spark", - '--author="Apache Spark Test Account "']) + "Coverage report at latest commit in Apache Spark"]) # 7. Delete the old branch. run_cmd(["git", "branch", "-D", "gh-pages"]) # 8. Rename the temporary branch to master. @@ -532,6 +558,24 @@ def parse_opts(): "-p", "--parallelism", type=int, default=8, help="The number of suites to test in parallel (default %(default)d)" ) + parser.add_argument( + "-m", "--modules", type=str, + default=None, + help="A comma-separated list of modules to test " + "(default: %s)" % ",".join(sorted([m.name for m in modules.all_modules])) + ) + parser.add_argument( + "-e", "--excluded-tags", type=str, + default=None, + help="A comma-separated list of tags to exclude in the tests, " + "e.g., org.apache.spark.tags.ExtendedHiveTest " + ) + parser.add_argument( + "-i", "--included-tags", type=str, + default=None, + help="A comma-separated list of tags to include in the tests, " + "e.g., org.apache.spark.tags.ExtendedHiveTest " + ) args, unknown = parser.parse_known_args() if unknown: @@ -564,17 +608,26 @@ def main(): " install one and retry.") sys.exit(2) - # install SparkR - if which("R"): - run_cmd([os.path.join(SPARK_HOME, "R", "install-dev.sh")]) - else: - print("Cannot install SparkR as R was not found in PATH") + # Install SparkR + should_only_test_modules = opts.modules is not None + test_modules = [] + if should_only_test_modules: + str_test_modules = [m.strip() for m in opts.modules.split(",")] + test_modules = [m for m in modules.all_modules if m.name in str_test_modules] + + if not should_only_test_modules or modules.sparkr in test_modules: + # If tests modules are specified, we will not run R linter. + # SparkR needs the manual SparkR installation. + if which("R"): + run_cmd([os.path.join(SPARK_HOME, "R", "install-dev.sh")]) + else: + print("Cannot install SparkR as R was not found in PATH") if os.environ.get("AMPLAB_JENKINS"): # if we're on the Amplab Jenkins build servers setup variables # to reflect the environment settings build_tool = os.environ.get("AMPLAB_JENKINS_BUILD_TOOL", "sbt") - hadoop_version = os.environ.get("AMPLAB_JENKINS_BUILD_PROFILE", "hadoop2.7") + hadoop_version = os.environ.get("AMPLAB_JENKINS_BUILD_PROFILE", "hadoop3.2") hive_version = os.environ.get("AMPLAB_JENKINS_BUILD_HIVE_PROFILE", "hive2.3") test_env = "amplab_jenkins" # add path for Python3 in Jenkins if we're calling from a Jenkins machine @@ -582,27 +635,69 @@ def main(): # /home/jenkins/anaconda2/envs/py36/bin os.environ["PATH"] = "/home/anaconda/envs/py36/bin:" + os.environ.get("PATH") else: - # else we're running locally and can use local settings + # else we're running locally or GitHub Actions. build_tool = "sbt" - hadoop_version = os.environ.get("HADOOP_PROFILE", "hadoop2.7") + hadoop_version = os.environ.get("HADOOP_PROFILE", "hadoop3.2") hive_version = os.environ.get("HIVE_PROFILE", "hive2.3") - test_env = "local" + if "GITHUB_ACTIONS" in os.environ: + test_env = "github_actions" + else: + test_env = "local" print("[info] Using build tool", build_tool, "with Hadoop profile", hadoop_version, "and Hive profile", hive_version, "under environment", test_env) extra_profiles = get_hadoop_profiles(hadoop_version) + get_hive_profiles(hive_version) - changed_modules = None - changed_files = None - if test_env == "amplab_jenkins" and os.environ.get("AMP_JENKINS_PRB"): + changed_modules = [] + changed_files = [] + included_tags = [] + excluded_tags = [] + if should_only_test_modules: + # If we're running the tests in GitHub Actions, attempt to detect and test + # only the affected modules. + if test_env == "github_actions": + if os.environ["APACHE_SPARK_REF"] != "": + # Fork repository + changed_files = identify_changed_files_from_git_commits( + "HEAD", target_ref=os.environ["APACHE_SPARK_REF"]) + else: + # Build for each commit. + changed_files = identify_changed_files_from_git_commits( + os.environ["GITHUB_SHA"], target_ref=os.environ["GITHUB_PREV_SHA"]) + + modules_to_test = determine_modules_to_test( + determine_modules_for_files(changed_files), deduplicated=False) + + if modules.root not in modules_to_test: + # If root module is not found, only test the intersected modules. + # If root module is found, just run the modules as specified initially. + test_modules = list(set(modules_to_test).intersection(test_modules)) + + changed_modules = test_modules + if len(changed_modules) == 0: + print("[info] There are no modules to test, exiting without testing.") + return + + # If we're running the tests in AMPLab Jenkins, calculate the diff from the targeted branch, and + # detect modules to test. + elif test_env == "amplab_jenkins" and os.environ.get("AMP_JENKINS_PRB"): target_branch = os.environ["ghprbTargetBranch"] changed_files = identify_changed_files_from_git_commits("HEAD", target_branch=target_branch) changed_modules = determine_modules_for_files(changed_files) + test_modules = determine_modules_to_test(changed_modules) excluded_tags = determine_tags_to_exclude(changed_modules) + # If there is no changed module found, tests all. if not changed_modules: changed_modules = [modules.root] - excluded_tags = [] + if not test_modules: + test_modules = determine_modules_to_test(changed_modules) + + if opts.excluded_tags: + excluded_tags.extend([t.strip() for t in opts.excluded_tags.split(",")]) + if opts.included_tags: + included_tags.extend([t.strip() for t in opts.included_tags.split(",")]) + print("[info] Found the following changed modules:", ", ".join(x.name for x in changed_modules)) @@ -615,40 +710,39 @@ def main(): test_environ.update(m.environ) setup_test_environ(test_environ) - test_modules = determine_modules_to_test(changed_modules) - - # license checks - run_apache_rat_checks() - - # style checks - if not changed_files or any(f.endswith(".scala") - or f.endswith("scalastyle-config.xml") - for f in changed_files): - run_scala_style_checks(extra_profiles) should_run_java_style_checks = False - if not changed_files or any(f.endswith(".java") - or f.endswith("checkstyle.xml") - or f.endswith("checkstyle-suppressions.xml") - for f in changed_files): - # Run SBT Checkstyle after the build to prevent a side-effect to the build. - should_run_java_style_checks = True - if not changed_files or any(f.endswith("lint-python") - or f.endswith("tox.ini") - or f.endswith(".py") - for f in changed_files): - run_python_style_checks() - if not changed_files or any(f.endswith(".R") - or f.endswith("lint-r") - or f.endswith(".lintr") - for f in changed_files): - run_sparkr_style_checks() + if not should_only_test_modules: + # license checks + run_apache_rat_checks() + + # style checks + if not changed_files or any(f.endswith(".scala") + or f.endswith("scalastyle-config.xml") + for f in changed_files): + run_scala_style_checks(extra_profiles) + if not changed_files or any(f.endswith(".java") + or f.endswith("checkstyle.xml") + or f.endswith("checkstyle-suppressions.xml") + for f in changed_files): + # Run SBT Checkstyle after the build to prevent a side-effect to the build. + should_run_java_style_checks = True + if not changed_files or any(f.endswith("lint-python") + or f.endswith("tox.ini") + or f.endswith(".py") + for f in changed_files): + run_python_style_checks() + if not changed_files or any(f.endswith(".R") + or f.endswith("lint-r") + or f.endswith(".lintr") + for f in changed_files): + run_sparkr_style_checks() # determine if docs were changed and if we're inside the amplab environment - # note - the below commented out until *all* Jenkins workers can get `jekyll` installed + # note - the below commented out until *all* Jenkins workers can get the Bundler gem installed # if "DOCS" in changed_modules and test_env == "amplab_jenkins": # build_spark_documentation() - if any(m.should_run_build_tests for m in test_modules): + if any(m.should_run_build_tests for m in test_modules) and test_env != "amplab_jenkins": run_build_tests() # spark build @@ -663,7 +757,7 @@ def main(): build_spark_assembly_sbt(extra_profiles, should_run_java_style_checks) # run the test suites - run_scala_tests(build_tool, extra_profiles, test_modules, excluded_tags) + run_scala_tests(build_tool, extra_profiles, test_modules, excluded_tags, included_tags) modules_with_python_tests = [m for m in test_modules if m.python_test_goals] if modules_with_python_tests: diff --git a/dev/sparktestsupport/modules.py b/dev/sparktestsupport/modules.py index 85e6a1e9fadac..ab65ccd7d3d11 100644 --- a/dev/sparktestsupport/modules.py +++ b/dev/sparktestsupport/modules.py @@ -31,9 +31,10 @@ class Module(object): files have changed. """ - def __init__(self, name, dependencies, source_file_regexes, build_profile_flags=(), environ={}, - sbt_test_goals=(), python_test_goals=(), blacklisted_python_implementations=(), - test_tags=(), should_run_r_tests=False, should_run_build_tests=False): + def __init__(self, name, dependencies, source_file_regexes, build_profile_flags=(), + environ=None, sbt_test_goals=(), python_test_goals=(), + excluded_python_implementations=(), test_tags=(), should_run_r_tests=False, + should_run_build_tests=False): """ Define a new module. @@ -49,7 +50,7 @@ def __init__(self, name, dependencies, source_file_regexes, build_profile_flags= module are changed. :param sbt_test_goals: A set of SBT test goals for testing this module. :param python_test_goals: A set of Python test goals for testing this module. - :param blacklisted_python_implementations: A set of Python implementations that are not + :param excluded_python_implementations: A set of Python implementations that are not supported by this module's Python components. The values in this set should match strings returned by Python's `platform.python_implementation()`. :param test_tags A set of tags that will be excluded when running unit tests if the module @@ -62,9 +63,9 @@ def __init__(self, name, dependencies, source_file_regexes, build_profile_flags= self.source_file_prefixes = source_file_regexes self.sbt_test_goals = sbt_test_goals self.build_profile_flags = build_profile_flags - self.environ = environ + self.environ = environ or {} self.python_test_goals = python_test_goals - self.blacklisted_python_implementations = blacklisted_python_implementations + self.excluded_python_implementations = excluded_python_implementations self.test_tags = test_tags self.should_run_r_tests = should_run_r_tests self.should_run_build_tests = should_run_build_tests @@ -100,9 +101,75 @@ def __hash__(self): ] ) +kvstore = Module( + name="kvstore", + dependencies=[tags], + source_file_regexes=[ + "common/kvstore/", + ], + sbt_test_goals=[ + "kvstore/test", + ], +) + +network_common = Module( + name="network-common", + dependencies=[tags], + source_file_regexes=[ + "common/network-common/", + ], + sbt_test_goals=[ + "network-common/test", + ], +) + +network_shuffle = Module( + name="network-shuffle", + dependencies=[tags], + source_file_regexes=[ + "common/network-shuffle/", + ], + sbt_test_goals=[ + "network-shuffle/test", + ], +) + +unsafe = Module( + name="unsafe", + dependencies=[tags], + source_file_regexes=[ + "common/unsafe", + ], + sbt_test_goals=[ + "unsafe/test", + ], +) + +launcher = Module( + name="launcher", + dependencies=[tags], + source_file_regexes=[ + "launcher/", + ], + sbt_test_goals=[ + "launcher/test", + ], +) + +core = Module( + name="core", + dependencies=[kvstore, network_common, network_shuffle, unsafe, launcher], + source_file_regexes=[ + "core/", + ], + sbt_test_goals=[ + "core/test", + ], +) + catalyst = Module( name="catalyst", - dependencies=[tags], + dependencies=[tags, core], source_file_regexes=[ "sql/catalyst/", ], @@ -111,7 +178,6 @@ def __hash__(self): ], ) - sql = Module( name="sql", dependencies=[catalyst], @@ -123,7 +189,6 @@ def __hash__(self): ], ) - hive = Module( name="hive", dependencies=[sql], @@ -142,7 +207,6 @@ def __hash__(self): ] ) - repl = Module( name="repl", dependencies=[hive], @@ -154,7 +218,6 @@ def __hash__(self): ], ) - hive_thriftserver = Module( name="hive-thriftserver", dependencies=[hive], @@ -192,7 +255,6 @@ def __hash__(self): ] ) - sketch = Module( name="sketch", dependencies=[tags], @@ -204,10 +266,9 @@ def __hash__(self): ] ) - graphx = Module( name="graphx", - dependencies=[tags], + dependencies=[tags, core], source_file_regexes=[ "graphx/", ], @@ -216,10 +277,9 @@ def __hash__(self): ] ) - streaming = Module( name="streaming", - dependencies=[tags], + dependencies=[tags, core], source_file_regexes=[ "streaming", ], @@ -235,7 +295,7 @@ def __hash__(self): # fail other PRs. streaming_kinesis_asl = Module( name="streaming-kinesis-asl", - dependencies=[tags], + dependencies=[tags, core], source_file_regexes=[ "external/kinesis-asl/", "external/kinesis-asl-assembly/", @@ -254,21 +314,23 @@ def __hash__(self): streaming_kafka_0_10 = Module( name="streaming-kafka-0-10", - dependencies=[streaming], + dependencies=[streaming, core], source_file_regexes=[ # The ending "/" is necessary otherwise it will include "sql-kafka" codes "external/kafka-0-10/", "external/kafka-0-10-assembly", + "external/kafka-0-10-token-provider", ], sbt_test_goals=[ "streaming-kafka-0-10/test", + "token-provider-kafka-0-10/test" ] ) mllib_local = Module( name="mllib-local", - dependencies=[tags], + dependencies=[tags, core], source_file_regexes=[ "mllib-local", ], @@ -302,10 +364,9 @@ def __hash__(self): ] ) - pyspark_core = Module( name="pyspark-core", - dependencies=[], + dependencies=[core], source_file_regexes=[ "python/(?!pyspark/(ml|mllib|sql|streaming))" ], @@ -326,6 +387,7 @@ def __hash__(self): "pyspark.tests.test_conf", "pyspark.tests.test_context", "pyspark.tests.test_daemon", + "pyspark.tests.test_install_spark", "pyspark.tests.test_join", "pyspark.tests.test_profiler", "pyspark.tests.test_rdd", @@ -339,7 +401,6 @@ def __hash__(self): ] ) - pyspark_sql = Module( name="pyspark-sql", dependencies=[pyspark_core, hive, avro], @@ -465,7 +526,7 @@ def __hash__(self): "pyspark.mllib.tests.test_streaming_algorithms", "pyspark.mllib.tests.test_util", ], - blacklisted_python_implementations=[ + excluded_python_implementations=[ "PyPy" # Skip these tests under PyPy since they require numpy and it isn't available there ] ) @@ -504,13 +565,100 @@ def __hash__(self): "pyspark.ml.tests.test_stat", "pyspark.ml.tests.test_training_summary", "pyspark.ml.tests.test_tuning", + "pyspark.ml.tests.test_util", "pyspark.ml.tests.test_wrapper", ], - blacklisted_python_implementations=[ + excluded_python_implementations=[ "PyPy" # Skip these tests under PyPy since they require numpy and it isn't available there ] ) +pyspark_pandas = Module( + name="pyspark-pandas", + dependencies=[pyspark_core, pyspark_sql], + source_file_regexes=[ + "python/pyspark/pandas/" + ], + python_test_goals=[ + # doctests + "pyspark.pandas.accessors", + "pyspark.pandas.base", + "pyspark.pandas.categorical", + "pyspark.pandas.config", + "pyspark.pandas.datetimes", + "pyspark.pandas.exceptions", + "pyspark.pandas.extensions", + "pyspark.pandas.frame", + "pyspark.pandas.generic", + "pyspark.pandas.groupby", + "pyspark.pandas.indexing", + "pyspark.pandas.internal", + "pyspark.pandas.ml", + "pyspark.pandas.mlflow", + "pyspark.pandas.namespace", + "pyspark.pandas.numpy_compat", + "pyspark.pandas.series", + "pyspark.pandas.sql_processor", + "pyspark.pandas.strings", + "pyspark.pandas.utils", + "pyspark.pandas.window", + "pyspark.pandas.indexes.base", + "pyspark.pandas.indexes.category", + "pyspark.pandas.indexes.datetimes", + "pyspark.pandas.indexes.multi", + "pyspark.pandas.indexes.numeric", + "pyspark.pandas.spark.accessors", + "pyspark.pandas.spark.utils", + "pyspark.pandas.typedef.typehints", + # unittests + "pyspark.pandas.tests.indexes.test_base", + "pyspark.pandas.tests.indexes.test_category", + "pyspark.pandas.tests.indexes.test_datetime", + "pyspark.pandas.tests.plot.test_frame_plot", + "pyspark.pandas.tests.plot.test_frame_plot_matplotlib", + "pyspark.pandas.tests.plot.test_frame_plot_plotly", + "pyspark.pandas.tests.plot.test_series_plot", + "pyspark.pandas.tests.plot.test_series_plot_matplotlib", + "pyspark.pandas.tests.plot.test_series_plot_plotly", + "pyspark.pandas.tests.test_categorical", + "pyspark.pandas.tests.test_config", + "pyspark.pandas.tests.test_csv", + "pyspark.pandas.tests.test_dataframe", + "pyspark.pandas.tests.test_dataframe_conversion", + "pyspark.pandas.tests.test_dataframe_spark_io", + "pyspark.pandas.tests.test_default_index", + "pyspark.pandas.tests.test_expanding", + "pyspark.pandas.tests.test_extension", + "pyspark.pandas.tests.test_frame_spark", + "pyspark.pandas.tests.test_groupby", + "pyspark.pandas.tests.test_indexing", + "pyspark.pandas.tests.test_indexops_spark", + "pyspark.pandas.tests.test_internal", + "pyspark.pandas.tests.test_namespace", + "pyspark.pandas.tests.test_numpy_compat", + "pyspark.pandas.tests.test_ops_on_diff_frames", + "pyspark.pandas.tests.test_ops_on_diff_frames_groupby", + "pyspark.pandas.tests.test_ops_on_diff_frames_groupby_expanding", + "pyspark.pandas.tests.test_ops_on_diff_frames_groupby_rolling", + "pyspark.pandas.tests.test_repr", + "pyspark.pandas.tests.test_reshape", + "pyspark.pandas.tests.test_rolling", + "pyspark.pandas.tests.test_series", + "pyspark.pandas.tests.test_series_conversion", + "pyspark.pandas.tests.test_series_datetime", + "pyspark.pandas.tests.test_series_string", + "pyspark.pandas.tests.test_sql", + "pyspark.pandas.tests.test_stats", + "pyspark.pandas.tests.test_typedef", + "pyspark.pandas.tests.test_utils", + "pyspark.pandas.tests.test_window", + ], + excluded_python_implementations=[ + "PyPy" # Skip these tests under PyPy since they require numpy, pandas, and pyarrow and + # they aren't available there + ] +) + sparkr = Module( name="sparkr", dependencies=[hive, mllib], @@ -593,7 +741,7 @@ def __hash__(self): # No other modules should directly depend on this module. root = Module( name="root", - dependencies=[build], # Changes to build should trigger all tests. + dependencies=[build, core], # Changes to build should trigger all tests. source_file_regexes=[], # In order to run all of the tests, enable every test profile: build_profile_flags=list(set( diff --git a/dev/sparktestsupport/toposort.py b/dev/sparktestsupport/toposort.py index 8b2688d20039f..6785e481b56b5 100644 --- a/dev/sparktestsupport/toposort.py +++ b/dev/sparktestsupport/toposort.py @@ -24,8 +24,7 @@ # Moved functools import to the top of the file. # Changed assert to a ValueError. # Changed iter[items|keys] to [items|keys], for python 3 -# compatibility. I don't think it matters for python 2 these are -# now lists instead of iterables. +# compatibility. # Copy the input so as to leave it unmodified. # Renamed function from toposort2 to toposort. # Handle empty input. diff --git a/dev/test-dependencies.sh b/dev/test-dependencies.sh index b3e68bed1d1e7..e9e9227d239e1 100755 --- a/dev/test-dependencies.sh +++ b/dev/test-dependencies.sh @@ -29,10 +29,9 @@ export LC_ALL=C # TODO: This would be much nicer to do in SBT, once SBT supports Maven-style resolution. # NOTE: These should match those in the release publishing script -HADOOP2_MODULE_PROFILES="-Phive-thriftserver -Pmesos -Pkubernetes -Pyarn -Phive" +HADOOP_MODULE_PROFILES="-Phive-thriftserver -Pmesos -Pkubernetes -Pyarn -Phive" MVN="build/mvn" HADOOP_HIVE_PROFILES=( - hadoop-2.7-hive-1.2 hadoop-2.7-hive-2.3 hadoop-3.2-hive-2.3 ) @@ -71,22 +70,19 @@ for HADOOP_HIVE_PROFILE in "${HADOOP_HIVE_PROFILES[@]}"; do if [[ $HADOOP_HIVE_PROFILE == **hadoop-3.2-hive-2.3** ]]; then HADOOP_PROFILE=hadoop-3.2 HIVE_PROFILE=hive-2.3 - elif [[ $HADOOP_HIVE_PROFILE == **hadoop-2.7-hive-2.3** ]]; then - HADOOP_PROFILE=hadoop-2.7 - HIVE_PROFILE=hive-2.3 else HADOOP_PROFILE=hadoop-2.7 - HIVE_PROFILE=hive-1.2 + HIVE_PROFILE=hive-2.3 fi echo "Performing Maven install for $HADOOP_HIVE_PROFILE" - $MVN $HADOOP2_MODULE_PROFILES -P$HADOOP_PROFILE -P$HIVE_PROFILE jar:jar jar:test-jar install:install clean -q + $MVN $HADOOP_MODULE_PROFILES -P$HADOOP_PROFILE -P$HIVE_PROFILE jar:jar jar:test-jar install:install clean -q echo "Performing Maven validate for $HADOOP_HIVE_PROFILE" - $MVN $HADOOP2_MODULE_PROFILES -P$HADOOP_PROFILE -P$HIVE_PROFILE validate -q + $MVN $HADOOP_MODULE_PROFILES -P$HADOOP_PROFILE -P$HIVE_PROFILE validate -q echo "Generating dependency manifest for $HADOOP_HIVE_PROFILE" mkdir -p dev/pr-deps - $MVN $HADOOP2_MODULE_PROFILES -P$HADOOP_PROFILE -P$HIVE_PROFILE dependency:build-classpath -pl assembly -am \ + $MVN $HADOOP_MODULE_PROFILES -P$HADOOP_PROFILE -P$HIVE_PROFILE dependency:build-classpath -pl assembly -am \ | grep "Dependencies classpath:" -A 1 \ | tail -n 1 | tr ":" "\n" | awk -F '/' '{ # For each dependency classpath, we fetch the last three parts split by "/": artifact id, version, and jar name. diff --git a/dev/tests/pr_merge_ability.sh b/dev/tests/pr_merge_ability.sh index 25fdbccac4dd8..a32667730f76c 100755 --- a/dev/tests/pr_merge_ability.sh +++ b/dev/tests/pr_merge_ability.sh @@ -22,7 +22,7 @@ # another branch and returning results to be published. More details can be # found at dev/run-tests-jenkins. # -# Arg1: The Github Pull Request Actual Commit +# Arg1: The GitHub Pull Request Actual Commit # known as `ghprbActualCommit` in `run-tests-jenkins` # Arg2: The SHA1 hash # known as `sha1` in `run-tests-jenkins` diff --git a/dev/tests/pr_public_classes.sh b/dev/tests/pr_public_classes.sh index 479d1851fe0b8..ad1ad5e736594 100755 --- a/dev/tests/pr_public_classes.sh +++ b/dev/tests/pr_public_classes.sh @@ -22,7 +22,7 @@ # another branch and returning results to be published. More details can be # found at dev/run-tests-jenkins. # -# Arg1: The Github Pull Request Actual Commit +# Arg1: The GitHub Pull Request Actual Commit # known as `ghprbActualCommit` in `run-tests-jenkins` ghprbActualCommit="$1" diff --git a/dev/tox.ini b/dev/tox.ini index 3ee13c09b5de7..68e875f4c54ed 100644 --- a/dev/tox.ini +++ b/dev/tox.ini @@ -16,4 +16,9 @@ [pycodestyle] ignore=E226,E241,E305,E402,E722,E731,E741,W503,W504 max-line-length=100 -exclude=cloudpickle.py,heapq3.py,shared.py,python/docs/conf.py,work/*/*.py,python/.eggs/*,dist/*,.git/* +exclude=*/target/*,python/pyspark/cloudpickle/*.py,shared.py,python/docs/source/conf.py,work/*/*.py,python/.eggs/*,dist/*,.git/* + +[flake8] +select = E901,E999,F821,F822,F823,F401,F405,B006 +exclude = */target/*,python/pyspark/cloudpickle/*.py,shared.py*,python/docs/source/conf.py,work/*/*.py,python/.eggs/*,dist/*,.git/*,python/out,python/pyspark/sql/pandas/functions.pyi,python/pyspark/sql/column.pyi,python/pyspark/worker.pyi,python/pyspark/java_gateway.pyi +max-line-length = 100 diff --git a/docs/.bundle/config b/docs/.bundle/config new file mode 100644 index 0000000000000..b13821f801858 --- /dev/null +++ b/docs/.bundle/config @@ -0,0 +1,2 @@ +--- +BUNDLE_PATH: ".local_ruby_bundle" diff --git a/docs/Gemfile b/docs/Gemfile new file mode 100644 index 0000000000000..fa2f23d71cd77 --- /dev/null +++ b/docs/Gemfile @@ -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. +# + +source "https://rubygems.org" + +gem "jekyll", "4.2.0" +gem "rouge", "3.26.0" +gem "jekyll-redirect-from", "0.16.0" +gem "webrick", "1.7" diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock new file mode 100644 index 0000000000000..54722d6351bf4 --- /dev/null +++ b/docs/Gemfile.lock @@ -0,0 +1,73 @@ +GEM + remote: https://rubygems.org/ + specs: + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + colorator (1.1.0) + concurrent-ruby (1.1.8) + em-websocket (0.5.2) + eventmachine (>= 0.12.9) + http_parser.rb (~> 0.6.0) + eventmachine (1.2.7) + ffi (1.14.2) + forwardable-extended (2.6.0) + http_parser.rb (0.6.0) + i18n (1.8.9) + concurrent-ruby (~> 1.0) + jekyll (4.2.0) + addressable (~> 2.4) + colorator (~> 1.0) + em-websocket (~> 0.5) + i18n (~> 1.0) + jekyll-sass-converter (~> 2.0) + jekyll-watch (~> 2.0) + kramdown (~> 2.3) + kramdown-parser-gfm (~> 1.0) + liquid (~> 4.0) + mercenary (~> 0.4.0) + pathutil (~> 0.9) + rouge (~> 3.0) + safe_yaml (~> 1.0) + terminal-table (~> 2.0) + jekyll-redirect-from (0.16.0) + jekyll (>= 3.3, < 5.0) + jekyll-sass-converter (2.1.0) + sassc (> 2.0.1, < 3.0) + jekyll-watch (2.2.1) + listen (~> 3.0) + kramdown (2.3.0) + rexml + kramdown-parser-gfm (1.1.0) + kramdown (~> 2.0) + liquid (4.0.3) + listen (3.4.1) + rb-fsevent (~> 0.10, >= 0.10.3) + rb-inotify (~> 0.9, >= 0.9.10) + mercenary (0.4.0) + pathutil (0.16.2) + forwardable-extended (~> 2.6) + public_suffix (4.0.6) + rb-fsevent (0.10.4) + rb-inotify (0.10.1) + ffi (~> 1.0) + rexml (3.2.4) + rouge (3.26.0) + safe_yaml (1.0.5) + sassc (2.4.0) + ffi (~> 1.9) + terminal-table (2.0.0) + unicode-display_width (~> 1.1, >= 1.1.1) + unicode-display_width (1.7.0) + webrick (1.7.0) + +PLATFORMS + ruby + +DEPENDENCIES + jekyll (= 4.2.0) + jekyll-redirect-from (= 0.16.0) + rouge (= 3.26.0) + webrick (= 1.7) + +BUNDLED WITH + 2.2.9 diff --git a/docs/README.md b/docs/README.md index 22039871cf63d..410a415b2882d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -33,10 +33,17 @@ Python, R and SQL. You need to have [Ruby](https://www.ruby-lang.org/en/documentation/installation/) and [Python](https://docs.python.org/2/using/unix.html#getting-and-installing-the-latest-version-of-python) -installed. Also install the following libraries: +installed. Make sure the `bundle` command is available, if not install the Gem containing it: ```sh -$ sudo gem install jekyll jekyll-redirect-from rouge +$ sudo gem install bundler +``` + +After this all the required ruby dependencies can be installed from the `docs/` directory via the Bundler: + +```sh +$ cd docs +$ bundle install ``` Note: If you are on a system with both Ruby 1.9 and Ruby 2.0 you may need to replace gem with gem2.0. @@ -48,17 +55,22 @@ and install these libraries: ```sh $ sudo Rscript -e 'install.packages(c("knitr", "devtools", "testthat", "rmarkdown"), repos="https://cloud.r-project.org/")' -$ sudo Rscript -e 'devtools::install_version("roxygen2", version = "5.0.1", repos="https://cloud.r-project.org/")' +$ sudo Rscript -e 'devtools::install_version("roxygen2", version = "7.1.1", repos="https://cloud.r-project.org/")' ``` -Note: Other versions of roxygen2 might work in SparkR documentation generation but `RoxygenNote` field in `$SPARK_HOME/R/pkg/DESCRIPTION` is 5.0.1, which is updated if the version is mismatched. +Note: Other versions of roxygen2 might work in SparkR documentation generation but `RoxygenNote` field in `$SPARK_HOME/R/pkg/DESCRIPTION` is 7.1.1, which is updated if the version is mismatched. ### API Documentation To generate API docs for any language, you'll need to install these libraries: + + ```sh -$ sudo pip install sphinx mkdocs numpy +$ sudo pip install 'sphinx<3.1.0' mkdocs numpy pydata_sphinx_theme ipython nbsphinx numpydoc ``` ## Generating the Documentation HTML @@ -72,26 +84,26 @@ you have checked out or downloaded. In this directory you will find text files formatted using Markdown, with an ".md" suffix. You can read those text files directly if you want. Start with `index.md`. -Execute `jekyll build` from the `docs/` directory to compile the site. Compiling the site with +Execute `bundle exec jekyll build` from the `docs/` directory to compile the site. Compiling the site with Jekyll will create a directory called `_site` containing `index.html` as well as the rest of the compiled files. ```sh $ cd docs -$ jekyll build +$ bundle exec jekyll build ``` You can modify the default Jekyll build as follows: ```sh # Skip generating API docs (which takes a while) -$ SKIP_API=1 jekyll build +$ SKIP_API=1 bundle exec jekyll build # Serve content locally on port 4000 -$ jekyll serve --watch +$ bundle exec jekyll serve --watch # Build the site with extra features used on the live page -$ PRODUCTION=1 jekyll build +$ PRODUCTION=1 bundle exec jekyll build ``` ## API Docs (Scaladoc, Javadoc, Sphinx, roxygen2, MkDocs) @@ -104,7 +116,7 @@ public in `__init__.py`. The SparkR docs can be built by running `$SPARK_HOME/R/ the SQL docs can be built by running `$SPARK_HOME/sql/create-docs.sh` after [building Spark](https://github.com/apache/spark#building-spark) first. -When you run `jekyll build` in the `docs` directory, it will also copy over the scaladoc and javadoc for the various +When you run `bundle exec jekyll build` in the `docs` directory, it will also copy over the scaladoc and javadoc for the various Spark subprojects into the `docs` directory (and then also into the `_site` directory). We use a jekyll plugin to run `./build/sbt unidoc` before building the site so if you haven't run it (recently) it may take some time as it generates all of the scaladoc and javadoc using [Unidoc](https://github.com/sbt/sbt-unidoc). @@ -113,12 +125,12 @@ using [roxygen2](https://cran.r-project.org/web/packages/roxygen2/index.html) an using [MkDocs](https://www.mkdocs.org/). NOTE: To skip the step of building and copying over the Scala, Java, Python, R and SQL API docs, run `SKIP_API=1 -jekyll build`. In addition, `SKIP_SCALADOC=1`, `SKIP_PYTHONDOC=1`, `SKIP_RDOC=1` and `SKIP_SQLDOC=1` can be used +bundle exec jekyll build`. In addition, `SKIP_SCALADOC=1`, `SKIP_PYTHONDOC=1`, `SKIP_RDOC=1` and `SKIP_SQLDOC=1` can be used to skip a single step of the corresponding language. `SKIP_SCALADOC` indicates skipping both the Scala and Java docs. ### Automatically Rebuilding API Docs -`jekyll serve --watch` will only watch what's in `docs/`, and it won't follow symlinks. That means it won't monitor your API docs under `python/docs` or elsewhere. +`bundle exec jekyll serve --watch` will only watch what's in `docs/`, and it won't follow symlinks. That means it won't monitor your API docs under `python/docs` or elsewhere. To work around this limitation for Python, install [`entr`](http://eradman.com/entrproject/) and run the following in a separate shell: diff --git a/docs/_config.yml b/docs/_config.yml index f82394ed63694..a8d42e483d17d 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -8,16 +8,38 @@ gems: kramdown: entity_output: numeric +plugins: + - jekyll-redirect-from + include: - _static - _modules + - _images + - _sources # These allow the documentation to be updated with newer releases # of Spark, Scala, and Mesos. -SPARK_VERSION: 3.1.0-SNAPSHOT -SPARK_VERSION_SHORT: 3.1.0 +SPARK_VERSION: 3.2.0-SNAPSHOT +SPARK_VERSION_SHORT: 3.2.0 SCALA_BINARY_VERSION: "2.12" SCALA_VERSION: "2.12.10" MESOS_VERSION: 1.0.0 SPARK_ISSUE_TRACKER_URL: https://issues.apache.org/jira/browse/SPARK SPARK_GITHUB_URL: https://github.com/apache/spark +# Before a new release, we should: +# 1. update the `version` array for the new Spark documentation +# on https://github.com/algolia/docsearch-configs/blob/master/configs/apache_spark.json. +# 2. update the value of `facetFilters.version` in `algoliaOptions` on the new release branch. +# Otherwise, after release, the search results are always based on the latest documentation +# (https://spark.apache.org/docs/latest/) even when visiting the documentation of previous releases. +DOCSEARCH_SCRIPT: | + docsearch({ + apiKey: 'b18ca3732c502995563043aa17bc6ecb', + indexName: 'apache_spark', + inputSelector: '#docsearch-input', + enhancedSearchInput: true, + algoliaOptions: { + 'facetFilters': ["version:latest"] + }, + debug: false // Set debug to true if you want to inspect the dropdown + }); diff --git a/docs/_data/menu-sql.yaml b/docs/_data/menu-sql.yaml index 57fc493dad2f2..e7b22c43e732c 100644 --- a/docs/_data/menu-sql.yaml +++ b/docs/_data/menu-sql.yaml @@ -32,6 +32,10 @@ url: sql-data-sources-orc.html - text: JSON Files url: sql-data-sources-json.html + - text: CSV Files + url: sql-data-sources-csv.html + - text: Text Files + url: sql-data-sources-text.html - text: Hive Tables url: sql-data-sources-hive-tables.html - text: JDBC To Other Databases @@ -51,6 +55,10 @@ url: sql-performance-tuning.html#other-configuration-options - text: Join Strategy Hints for SQL Queries url: sql-performance-tuning.html#join-strategy-hints-for-sql-queries + - text: Coalesce Hints for SQL Queries + url: sql-performance-tuning.html#coalesce-hints-for-sql-queries + - text: Adaptive Query Execution + url: sql-performance-tuning.html#adaptive-query-execution - text: Distributed SQL Engine url: sql-distributed-sql-engine.html subitems: @@ -60,30 +68,11 @@ url: sql-distributed-sql-engine.html#running-the-spark-sql-cli - text: PySpark Usage Guide for Pandas with Apache Arrow url: sql-pyspark-pandas-with-arrow.html - subitems: - - text: Apache Arrow in Spark - url: sql-pyspark-pandas-with-arrow.html#apache-arrow-in-spark - - text: "Enabling for Conversion to/from Pandas" - url: sql-pyspark-pandas-with-arrow.html#enabling-for-conversion-tofrom-pandas - - text: "Pandas UDFs (a.k.a. Vectorized UDFs)" - url: sql-pyspark-pandas-with-arrow.html#pandas-udfs-aka-vectorized-udfs - - text: "Pandas Function APIs" - url: sql-pyspark-pandas-with-arrow.html#pandas-function-apis - - text: Usage Notes - url: sql-pyspark-pandas-with-arrow.html#usage-notes - text: Migration Guide url: sql-migration-old.html - text: SQL Reference url: sql-ref.html subitems: - - text: Data Types - url: sql-ref-datatypes.html - - text: Identifiers - url: sql-ref-identifier.html - - text: Literals - url: sql-ref-literals.html - - text: Null Semantics - url: sql-ref-null-semantics.html - text: ANSI Compliance url: sql-ref-ansi-compliance.html subitems: @@ -93,6 +82,27 @@ url: sql-ref-ansi-compliance.html#type-conversion - text: SQL Keywords url: sql-ref-ansi-compliance.html#sql-keywords + - text: Data Types + url: sql-ref-datatypes.html + - text: Datetime Pattern + url: sql-ref-datetime-pattern.html + - text: Functions + url: sql-ref-functions.html + subitems: + - text: Built-in Functions + url: sql-ref-functions-builtin.html + - text: Scalar UDFs (User-Defined Functions) + url: sql-ref-functions-udf-scalar.html + - text: UDAFs (User-Defined Aggregate Functions) + url: sql-ref-functions-udf-aggregate.html + - text: Integration with Hive UDFs/UDAFs/UDTFs + url: sql-ref-functions-udf-hive.html + - text: Identifiers + url: sql-ref-identifier.html + - text: Literals + url: sql-ref-literals.html + - text: Null Semantics + url: sql-ref-null-semantics.html - text: SQL Syntax url: sql-ref-syntax.html subitems: @@ -126,7 +136,7 @@ - text: REPAIR TABLE url: sql-ref-syntax-ddl-repair-table.html - text: USE DATABASE - url: sql-ref-syntax-qry-select-usedb.html + url: sql-ref-syntax-ddl-usedb.html - text: Data Manipulation Statements url: sql-ref-syntax-dml.html subitems: @@ -158,22 +168,32 @@ url: sql-ref-syntax-qry-select-limit.html - text: Common Table Expression url: sql-ref-syntax-qry-select-cte.html + - text: Hints + url: sql-ref-syntax-qry-select-hints.html - text: Inline Table url: sql-ref-syntax-qry-select-inline-table.html + - text: File + url: sql-ref-syntax-qry-select-file.html - text: JOIN url: sql-ref-syntax-qry-select-join.html - - text: Join Hints - url: sql-ref-syntax-qry-select-hints.html - text: LIKE Predicate url: sql-ref-syntax-qry-select-like.html - text: Set Operators url: sql-ref-syntax-qry-select-setops.html - text: TABLESAMPLE - url: sql-ref-syntax-qry-sampling.html + url: sql-ref-syntax-qry-select-sampling.html - text: Table-valued Function url: sql-ref-syntax-qry-select-tvf.html - text: Window Function - url: sql-ref-syntax-qry-window.html + url: sql-ref-syntax-qry-select-window.html + - text: CASE Clause + url: sql-ref-syntax-qry-select-case.html + - text: LATERAL VIEW Clause + url: sql-ref-syntax-qry-select-lateral-view.html + - text: PIVOT Clause + url: sql-ref-syntax-qry-select-pivot.html + - text: TRANSFORM Clause + url: sql-ref-syntax-qry-select-transform.html - text: EXPLAIN url: sql-ref-syntax-qry-explain.html - text: Auxiliary Statements @@ -184,6 +204,8 @@ subitems: - text: ANALYZE TABLE url: sql-ref-syntax-aux-analyze-table.html + - text: ANALYZE TABLES + url: sql-ref-syntax-aux-analyze-tables.html - text: CACHE url: sql-ref-syntax-aux-cache.html subitems: @@ -194,7 +216,9 @@ - text: CLEAR CACHE url: sql-ref-syntax-aux-cache-clear-cache.html - text: REFRESH TABLE - url: sql-ref-syntax-aux-refresh-table.html + url: sql-ref-syntax-aux-cache-refresh-table.html + - text: REFRESH FUNCTION + url: sql-ref-syntax-aux-cache-refresh-function.html - text: REFRESH url: sql-ref-syntax-aux-cache-refresh.html - text: DESCRIBE @@ -236,6 +260,8 @@ url: sql-ref-syntax-aux-conf-mgmt-set.html - text: RESET url: sql-ref-syntax-aux-conf-mgmt-reset.html + - text: SET TIME ZONE + url: sql-ref-syntax-aux-conf-mgmt-set-timezone.html - text: RESOURCE MANAGEMENT url: sql-ref-syntax-aux-resource-mgmt.html subitems: @@ -243,20 +269,11 @@ url: sql-ref-syntax-aux-resource-mgmt-add-file.html - text: ADD JAR url: sql-ref-syntax-aux-resource-mgmt-add-jar.html + - text: ADD ARCHIVE + url: sql-ref-syntax-aux-resource-mgmt-add-archive.html - text: LIST FILE url: sql-ref-syntax-aux-resource-mgmt-list-file.html - text: LIST JAR url: sql-ref-syntax-aux-resource-mgmt-list-jar.html - - text: Functions - url: sql-ref-functions.html - subitems: - - text: Built-in Functions - url: sql-ref-functions-builtin.html - - text: Scalar UDFs (User-Defined Functions) - url: sql-ref-functions-udf-scalar.html - - text: UDAFs (User-Defined Aggregate Functions) - url: sql-ref-functions-udf-aggregate.html - - text: Integration with Hive UDFs/UDAFs/UDTFs - url: sql-ref-functions-udf-hive.html - - text: Datetime Pattern - url: sql-ref-datetime-pattern.html + - text: LIST ARCHIVE + url: sql-ref-syntax-aux-resource-mgmt-list-archive.html diff --git a/docs/_layouts/global.html b/docs/_layouts/global.html index d05ac6bbe129d..f10d46763cf76 100755 --- a/docs/_layouts/global.html +++ b/docs/_layouts/global.html @@ -25,12 +25,13 @@ } - + + {% production %} @@ -55,75 +56,87 @@ -
+ + + + + // scalastyle:on + } else { + Seq.empty[Node] + } + } else { + Seq.empty[Node] + } + } + + def generateAggregatedStateOperators( + query: StreamingQueryUIData, + minBatchTime: Long, + maxBatchTime: Long, + jsCollector: JsCollector): NodeBuffer = { + // This is made sure on caller side but put it here to be defensive + require(query.lastProgress != null) + if (query.lastProgress.stateOperators.nonEmpty) { + val numRowsTotalData = query.recentProgress.map(p => (parseProgressTimestamp(p.timestamp), + p.stateOperators.map(_.numRowsTotal).sum.toDouble)) + val maxNumRowsTotal = numRowsTotalData.maxBy(_._2)._2 + + val numRowsUpdatedData = query.recentProgress.map(p => (parseProgressTimestamp(p.timestamp), + p.stateOperators.map(_.numRowsUpdated).sum.toDouble)) + val maxNumRowsUpdated = numRowsUpdatedData.maxBy(_._2)._2 + + val memoryUsedBytesData = query.recentProgress.map(p => (parseProgressTimestamp(p.timestamp), + p.stateOperators.map(_.memoryUsedBytes).sum.toDouble)) + val maxMemoryUsedBytes = memoryUsedBytesData.maxBy(_._2)._2 + + val numRowsDroppedByWatermarkData = query.recentProgress + .map(p => (parseProgressTimestamp(p.timestamp), + p.stateOperators.map(_.numRowsDroppedByWatermark).sum.toDouble)) + val maxNumRowsDroppedByWatermark = numRowsDroppedByWatermarkData.maxBy(_._2)._2 + + val graphUIDataForNumberTotalRows = + new GraphUIData( + "aggregated-num-total-state-rows-timeline", + "aggregated-num-total-state-rows-histogram", + numRowsTotalData, + minBatchTime, + maxBatchTime, + 0, + maxNumRowsTotal, + "records") + graphUIDataForNumberTotalRows.generateDataJs(jsCollector) + + val graphUIDataForNumberUpdatedRows = + new GraphUIData( + "aggregated-num-updated-state-rows-timeline", + "aggregated-num-updated-state-rows-histogram", + numRowsUpdatedData, + minBatchTime, + maxBatchTime, + 0, + maxNumRowsUpdated, + "records") + graphUIDataForNumberUpdatedRows.generateDataJs(jsCollector) + + val graphUIDataForMemoryUsedBytes = + new GraphUIData( + "aggregated-state-memory-used-bytes-timeline", + "aggregated-state-memory-used-bytes-histogram", + memoryUsedBytesData, + minBatchTime, + maxBatchTime, + 0, + maxMemoryUsedBytes, + "bytes") + graphUIDataForMemoryUsedBytes.generateDataJs(jsCollector) + + val graphUIDataForNumRowsDroppedByWatermark = + new GraphUIData( + "aggregated-num-rows-dropped-by-watermark-timeline", + "aggregated-num-rows-dropped-by-watermark-histogram", + numRowsDroppedByWatermarkData, + minBatchTime, + maxBatchTime, + 0, + maxNumRowsDroppedByWatermark, + "records") + graphUIDataForNumRowsDroppedByWatermark.generateDataJs(jsCollector) + + val result = + // scalastyle:off + + + + + + + + + + + + + + + + + + + + + // scalastyle:on + + if (enabledCustomMetrics.nonEmpty) { + result ++= generateAggregatedCustomMetrics(query, minBatchTime, maxBatchTime, jsCollector) + } + result + } else { + new NodeBuffer() + } + } + + def generateAggregatedCustomMetrics( + query: StreamingQueryUIData, + minBatchTime: Long, + maxBatchTime: Long, + jsCollector: JsCollector): NodeBuffer = { + val result: NodeBuffer = new NodeBuffer + + // This is made sure on caller side but put it here to be defensive + require(query.lastProgress.stateOperators.nonEmpty) + query.lastProgress.stateOperators.head.customMetrics.keySet().asScala + .filter(m => enabledCustomMetrics.contains(m.toLowerCase(Locale.ROOT))).map { metricName => + val data = query.recentProgress.map(p => (parseProgressTimestamp(p.timestamp), + p.stateOperators.map(_.customMetrics.get(metricName).toDouble).sum)) + val max = data.maxBy(_._2)._2 + val metric = supportedCustomMetrics.find(_.name.equalsIgnoreCase(metricName)).get + + val graphUIData = + new GraphUIData( + s"aggregated-$metricName-timeline", + s"aggregated-$metricName-histogram", + data, + minBatchTime, + maxBatchTime, + 0, + max, + "") + graphUIData.generateDataJs(jsCollector) + + result ++= + // scalastyle:off + + + + + + // scalastyle:on + } + + result + } + def generateStatTable(query: StreamingQueryUIData): Seq[Node] = { val batchToTimestamps = withNoProgress(query, query.recentProgress.map(p => (p.batchId, parseProgressTimestamp(p.timestamp))), @@ -284,6 +518,8 @@ private[ui] class StreamingQueryStatisticsPage(parent: StreamingQueryTab) + {generateWatermark(query, minBatchTime, maxBatchTime, jsCollector)} + {generateAggregatedStateOperators(query, minBatchTime, maxBatchTime, jsCollector)}
{kv._1}
{kv._2}
{kv._1}{kv._2}
{kv._1}{kv._2}
{data._1}{data._2}
- - { - if (tooltip.nonEmpty) { - - {header} {Unparsed(arrow)} - - } else { - - {header} {Unparsed(arrow)} - - } - } - - - - { - if (tooltip.nonEmpty) { - - {header} - - } else { - - {header} - - } - } - - - { - if (tooltip.nonEmpty) { - - {header} - - } else { - - {header} - - } - } -
- - {headerSpan} -  {Unparsed(arrow)} - - - - - {headerSpan} - - - {headerSpan} -
- - {header} -  {Unparsed(arrow)} - - - - {header} - -
+
+
Global Watermark Gap {SparkUIUtils.tooltip("The gap between batch timestamp and global watermark for the batch.", "right")}
+
+
{graphUIDataForWatermark.generateTimelineHtml(jsCollector)}{graphUIDataForWatermark.generateHistogramHtml(jsCollector)}
+
+
Aggregated Number Of Total State Rows {SparkUIUtils.tooltip("Aggregated number of total state rows.", "right")}
+
+
{graphUIDataForNumberTotalRows.generateTimelineHtml(jsCollector)}{graphUIDataForNumberTotalRows.generateHistogramHtml(jsCollector)}
+
+
Aggregated Number Of Updated State Rows {SparkUIUtils.tooltip("Aggregated number of updated state rows.", "right")}
+
+
{graphUIDataForNumberUpdatedRows.generateTimelineHtml(jsCollector)}{graphUIDataForNumberUpdatedRows.generateHistogramHtml(jsCollector)}
+
+
Aggregated State Memory Used In Bytes {SparkUIUtils.tooltip("Aggregated state memory used in bytes.", "right")}
+
+
{graphUIDataForMemoryUsedBytes.generateTimelineHtml(jsCollector)}{graphUIDataForMemoryUsedBytes.generateHistogramHtml(jsCollector)}
+
+
Aggregated Number Of Rows Dropped By Watermark {SparkUIUtils.tooltip("Accumulates all input rows being dropped in stateful operators by watermark. 'Inputs' are relative to operators.", "right")}
+
+
{graphUIDataForNumRowsDroppedByWatermark.generateTimelineHtml(jsCollector)}{graphUIDataForNumRowsDroppedByWatermark.generateHistogramHtml(jsCollector)}
+
+
Aggregated Custom Metric {s"$metricName"} {SparkUIUtils.tooltip(metric.desc, "right")}
+
+
{graphUIData.generateTimelineHtml(jsCollector)}{graphUIData.generateHistogramHtml(jsCollector)}
{graphUIDataForDuration.generateAreaStackHtmlWithData(jsCollector, operationDurationData)}
} else { diff --git a/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryStatusListener.scala b/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryStatusListener.scala index e331083b30024..fdd3754344108 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryStatusListener.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryStatusListener.scala @@ -20,102 +20,144 @@ package org.apache.spark.sql.streaming.ui import java.util.UUID import java.util.concurrent.ConcurrentHashMap -import scala.collection.JavaConverters._ import scala.collection.mutable +import com.fasterxml.jackson.annotation.JsonIgnore + import org.apache.spark.SparkConf import org.apache.spark.sql.internal.StaticSQLConf import org.apache.spark.sql.streaming.{StreamingQueryListener, StreamingQueryProgress} +import org.apache.spark.sql.streaming.ui.StreamingQueryProgressWrapper._ import org.apache.spark.sql.streaming.ui.UIUtils.parseProgressTimestamp +import org.apache.spark.status.{ElementTrackingStore, KVUtils} +import org.apache.spark.status.KVUtils.KVIndexParam +import org.apache.spark.util.kvstore.KVIndex /** * A customized StreamingQueryListener used in structured streaming UI, which contains all * UI data for both active and inactive query. - * TODO: Add support for history server. */ -private[sql] class StreamingQueryStatusListener(conf: SparkConf) extends StreamingQueryListener { - - /** - * We use runId as the key here instead of id in active query status map, - * because the runId is unique for every started query, even it its a restart. - */ - private[ui] val activeQueryStatus = new ConcurrentHashMap[UUID, StreamingQueryUIData]() - private[ui] val inactiveQueryStatus = new mutable.Queue[StreamingQueryUIData]() +private[sql] class StreamingQueryStatusListener( + conf: SparkConf, + store: ElementTrackingStore) extends StreamingQueryListener { private val streamingProgressRetention = conf.get(StaticSQLConf.STREAMING_UI_RETAINED_PROGRESS_UPDATES) private val inactiveQueryStatusRetention = conf.get(StaticSQLConf.STREAMING_UI_RETAINED_QUERIES) + store.addTrigger(classOf[StreamingQueryData], inactiveQueryStatusRetention) { count => + cleanupInactiveQueries(count) + } + + // Events from the same query run will never be processed concurrently, so it's safe to + // access `progressIds` without any protection. + private val queryToProgress = new ConcurrentHashMap[UUID, mutable.Queue[String]]() + + private def cleanupInactiveQueries(count: Long): Unit = { + val view = store.view(classOf[StreamingQueryData]).index("active").first(false).last(false) + val inactiveQueries = KVUtils.viewToSeq(view, Int.MaxValue)(_ => true) + val numInactiveQueries = inactiveQueries.size + if (numInactiveQueries <= inactiveQueryStatusRetention) { + return + } + val toDelete = inactiveQueries.sortBy(_.endTimestamp.get) + .take(numInactiveQueries - inactiveQueryStatusRetention) + val runIds = toDelete.map { e => + store.delete(e.getClass, e.runId) + e.runId.toString + } + // Delete wrappers in one pass, as deleting them for each summary is slow + store.removeAllByIndexValues(classOf[StreamingQueryProgressWrapper], "runId", runIds) + } + override def onQueryStarted(event: StreamingQueryListener.QueryStartedEvent): Unit = { val startTimestamp = parseProgressTimestamp(event.timestamp) - activeQueryStatus.putIfAbsent(event.runId, - new StreamingQueryUIData(event.name, event.id, event.runId, startTimestamp)) + store.write(new StreamingQueryData( + event.name, + event.id, + event.runId, + isActive = true, + None, + startTimestamp + ), checkTriggers = true) } override def onQueryProgress(event: StreamingQueryListener.QueryProgressEvent): Unit = { - val batchTimestamp = parseProgressTimestamp(event.progress.timestamp) - val queryStatus = activeQueryStatus.getOrDefault( - event.progress.runId, - new StreamingQueryUIData(event.progress.name, event.progress.id, event.progress.runId, - batchTimestamp)) - queryStatus.updateProcess(event.progress, streamingProgressRetention) - } - - override def onQueryTerminated( - event: StreamingQueryListener.QueryTerminatedEvent): Unit = synchronized { - val queryStatus = activeQueryStatus.remove(event.runId) - if (queryStatus != null) { - queryStatus.queryTerminated(event) - inactiveQueryStatus += queryStatus - while (inactiveQueryStatus.length >= inactiveQueryStatusRetention) { - inactiveQueryStatus.dequeue() - } + val runId = event.progress.runId + val batchId = event.progress.batchId + val timestamp = event.progress.timestamp + if (!queryToProgress.containsKey(runId)) { + queryToProgress.put(runId, mutable.Queue.empty[String]) + } + val progressIds = queryToProgress.get(runId) + progressIds.enqueue(getUniqueId(runId, batchId, timestamp)) + store.write(new StreamingQueryProgressWrapper(event.progress)) + while (progressIds.length > streamingProgressRetention) { + val uniqueId = progressIds.dequeue + store.delete(classOf[StreamingQueryProgressWrapper], uniqueId) } } - def allQueryStatus: Seq[StreamingQueryUIData] = synchronized { - activeQueryStatus.values().asScala.toSeq ++ inactiveQueryStatus + override def onQueryTerminated( + event: StreamingQueryListener.QueryTerminatedEvent): Unit = { + val querySummary = store.read(classOf[StreamingQueryData], event.runId) + val curTime = System.currentTimeMillis() + store.write(new StreamingQueryData( + querySummary.name, + querySummary.id, + querySummary.runId, + isActive = false, + querySummary.exception, + querySummary.startTimestamp, + Some(curTime) + ), checkTriggers = true) + queryToProgress.remove(event.runId) } } +private[sql] class StreamingQueryData( + val name: String, + val id: UUID, + @KVIndexParam val runId: UUID, + @KVIndexParam("active") val isActive: Boolean, + val exception: Option[String], + @KVIndexParam("startTimestamp") val startTimestamp: Long, + val endTimestamp: Option[Long] = None) + /** * This class contains all message related to UI display, each instance corresponds to a single * [[org.apache.spark.sql.streaming.StreamingQuery]]. */ -private[ui] class StreamingQueryUIData( - val name: String, - val id: UUID, - val runId: UUID, - val startTimestamp: Long) { - - /** Holds the most recent query progress updates. */ - private val progressBuffer = new mutable.Queue[StreamingQueryProgress]() - - private var _isActive = true - private var _exception: Option[String] = None - - def isActive: Boolean = synchronized { _isActive } - - def exception: Option[String] = synchronized { _exception } - - def queryTerminated(event: StreamingQueryListener.QueryTerminatedEvent): Unit = synchronized { - _isActive = false - _exception = event.exception - } - - def updateProcess( - newProgress: StreamingQueryProgress, retentionNum: Int): Unit = progressBuffer.synchronized { - progressBuffer += newProgress - while (progressBuffer.length >= retentionNum) { - progressBuffer.dequeue() +private[sql] case class StreamingQueryUIData( + summary: StreamingQueryData, + recentProgress: Array[StreamingQueryProgress]) { + + def lastProgress: StreamingQueryProgress = { + if (recentProgress.nonEmpty) { + recentProgress.last + } else { + null } } +} - def recentProgress: Array[StreamingQueryProgress] = progressBuffer.synchronized { - progressBuffer.toArray - } +private[sql] class StreamingQueryProgressWrapper(val progress: StreamingQueryProgress) { + @JsonIgnore @KVIndex + private val uniqueId: String = getUniqueId(progress.runId, progress.batchId, progress.timestamp) - def lastProgress: StreamingQueryProgress = progressBuffer.synchronized { - progressBuffer.lastOption.orNull + @JsonIgnore @KVIndex("runId") + private def runIdIndex: String = progress.runId.toString +} + +private[sql] object StreamingQueryProgressWrapper { + /** + * Adding `timestamp` into unique id to support reporting `empty` query progress + * in which no data comes but with the same batchId. + */ + def getUniqueId( + runId: UUID, + batchId: Long, + timestamp: String): String = { + s"${runId}_${batchId}_$timestamp" } } diff --git a/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryTab.scala b/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryTab.scala index bb097ffc06912..65cad8f06cc1c 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryTab.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/StreamingQueryTab.scala @@ -17,10 +17,11 @@ package org.apache.spark.sql.streaming.ui import org.apache.spark.internal.Logging +import org.apache.spark.sql.execution.ui.StreamingQueryStatusStore import org.apache.spark.ui.{SparkUI, SparkUITab} private[sql] class StreamingQueryTab( - val statusListener: StreamingQueryStatusListener, + val store: StreamingQueryStatusStore, sparkUI: SparkUI) extends SparkUITab(sparkUI, "StreamingQuery") with Logging { override val name = "Structured Streaming" diff --git a/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/UIUtils.scala b/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/UIUtils.scala index cdad5ed9942b5..88a110fa9a329 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/UIUtils.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/streaming/ui/UIUtils.scala @@ -18,7 +18,6 @@ package org.apache.spark.sql.streaming.ui import java.text.SimpleDateFormat -import java.util.Locale import org.apache.spark.sql.catalyst.util.DateTimeUtils.getTimeZone @@ -47,19 +46,19 @@ private[ui] object UIUtils { } } - def getQueryName(query: StreamingQueryUIData): String = { - if (query.name == null || query.name.isEmpty) { + def getQueryName(uiData: StreamingQueryUIData): String = { + if (uiData.summary.name == null || uiData.summary.name.isEmpty) { "" } else { - query.name + uiData.summary.name } } - def getQueryStatus(query: StreamingQueryUIData): String = { - if (query.isActive) { + def getQueryStatus(uiData: StreamingQueryUIData): String = { + if (uiData.summary.isActive) { "RUNNING" } else { - query.exception.map(_ => "FAILED").getOrElse("FINISHED") + uiData.summary.exception.map(_ => "FAILED").getOrElse("FINISHED") } } diff --git a/sql/core/src/main/scala/org/apache/spark/sql/util/QueryExecutionListener.scala b/sql/core/src/main/scala/org/apache/spark/sql/util/QueryExecutionListener.scala index 0b5951ec2ac97..b1742078cc125 100644 --- a/sql/core/src/main/scala/org/apache/spark/sql/util/QueryExecutionListener.scala +++ b/sql/core/src/main/scala/org/apache/spark/sql/util/QueryExecutionListener.scala @@ -76,7 +76,7 @@ trait QueryExecutionListener { class ExecutionListenerManager private[sql](session: SparkSession, loadExtensions: Boolean) extends Logging { - private val listenerBus = new ExecutionListenerBus(session) + private val listenerBus = new ExecutionListenerBus(this, session) if (loadExtensions) { val conf = session.sparkContext.conf @@ -124,10 +124,16 @@ class ExecutionListenerManager private[sql](session: SparkSession, loadExtension } } -private[sql] class ExecutionListenerBus(session: SparkSession) +private[sql] class ExecutionListenerBus private(sessionUUID: String) extends SparkListener with ListenerBus[QueryExecutionListener, SparkListenerSQLExecutionEnd] { - session.sparkContext.listenerBus.addToSharedQueue(this) + def this(manager: ExecutionListenerManager, session: SparkSession) = { + this(session.sessionUUID) + session.sparkContext.listenerBus.addToSharedQueue(this) + session.sparkContext.cleaner.foreach { cleaner => + cleaner.registerSparkListenerForCleanup(manager, this) + } + } override def onOtherEvent(event: SparkListenerEvent): Unit = event match { case e: SparkListenerSQLExecutionEnd => postToAll(e) @@ -158,6 +164,6 @@ private[sql] class ExecutionListenerBus(session: SparkSession) private def shouldReport(e: SparkListenerSQLExecutionEnd): Boolean = { // Only catch SQL execution with a name, and triggered by the same spark session that this // listener manager belongs. - e.executionName.isDefined && e.qe.sparkSession.eq(this.session) + e.executionName.isDefined && e.qe.sparkSession.sessionUUID == sessionUUID } } diff --git a/sql/core/src/main/scala/org/apache/spark/status/api/v1/sql/ApiSqlRootResource.scala b/sql/core/src/main/scala/org/apache/spark/status/api/v1/sql/ApiSqlRootResource.scala index 5fc7123c9097b..747c05b9b0626 100644 --- a/sql/core/src/main/scala/org/apache/spark/status/api/v1/sql/ApiSqlRootResource.scala +++ b/sql/core/src/main/scala/org/apache/spark/status/api/v1/sql/ApiSqlRootResource.scala @@ -17,7 +17,7 @@ package org.apache.spark.status.api.v1.sql -import javax.ws.rs.Path +import javax.ws.rs.{Path, PathParam} import org.apache.spark.status.api.v1.ApiRequestContext @@ -25,5 +25,10 @@ import org.apache.spark.status.api.v1.ApiRequestContext private[v1] class ApiSqlRootResource extends ApiRequestContext { @Path("applications/{appId}/sql") - def sqlList(): Class[SqlResource] = classOf[SqlResource] + def sqlList(@PathParam("appId") appId: String): Class[SqlResource] = classOf[SqlResource] + + @Path("applications/{appId}/{attemptId}/sql") + def sqlList( + @PathParam("appId") appId: String, + @PathParam("attemptId") attemptId: String): Class[SqlResource] = classOf[SqlResource] } diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/Java8DatasetAggregatorSuite.java b/sql/core/src/test/java/test/org/apache/spark/sql/Java8DatasetAggregatorSuite.java index dd3755d3f904e..de88f80eb53b8 100644 --- a/sql/core/src/test/java/test/org/apache/spark/sql/Java8DatasetAggregatorSuite.java +++ b/sql/core/src/test/java/test/org/apache/spark/sql/Java8DatasetAggregatorSuite.java @@ -34,43 +34,43 @@ public class Java8DatasetAggregatorSuite extends JavaDatasetAggregatorSuiteBase @Test public void testTypedAggregationAverage() { KeyValueGroupedDataset> grouped = generateGroupedDataset(); - Dataset> agged = grouped.agg( + Dataset> aggregated = grouped.agg( org.apache.spark.sql.expressions.javalang.typed.avg(v -> (double)(v._2() * 2))); Assert.assertEquals( Arrays.asList(new Tuple2<>("a", 3.0), new Tuple2<>("b", 6.0)), - agged.collectAsList()); + aggregated.collectAsList()); } @SuppressWarnings("deprecation") @Test public void testTypedAggregationCount() { KeyValueGroupedDataset> grouped = generateGroupedDataset(); - Dataset> agged = grouped.agg( + Dataset> aggregated = grouped.agg( org.apache.spark.sql.expressions.javalang.typed.count(v -> v)); Assert.assertEquals( Arrays.asList(new Tuple2<>("a", 2L), new Tuple2<>("b", 1L)), - agged.collectAsList()); + aggregated.collectAsList()); } @SuppressWarnings("deprecation") @Test public void testTypedAggregationSumDouble() { KeyValueGroupedDataset> grouped = generateGroupedDataset(); - Dataset> agged = grouped.agg( + Dataset> aggregated = grouped.agg( org.apache.spark.sql.expressions.javalang.typed.sum(v -> (double)v._2())); Assert.assertEquals( Arrays.asList(new Tuple2<>("a", 3.0), new Tuple2<>("b", 3.0)), - agged.collectAsList()); + aggregated.collectAsList()); } @SuppressWarnings("deprecation") @Test public void testTypedAggregationSumLong() { KeyValueGroupedDataset> grouped = generateGroupedDataset(); - Dataset> agged = grouped.agg( + Dataset> aggregated = grouped.agg( org.apache.spark.sql.expressions.javalang.typed.sumLong(v -> (long)v._2())); Assert.assertEquals( Arrays.asList(new Tuple2<>("a", 3L), new Tuple2<>("b", 3L)), - agged.collectAsList()); + aggregated.collectAsList()); } } diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/JavaBeanDeserializationSuite.java b/sql/core/src/test/java/test/org/apache/spark/sql/JavaBeanDeserializationSuite.java index 5603cb988b8e7..af0a22b036030 100644 --- a/sql/core/src/test/java/test/org/apache/spark/sql/JavaBeanDeserializationSuite.java +++ b/sql/core/src/test/java/test/org/apache/spark/sql/JavaBeanDeserializationSuite.java @@ -18,6 +18,8 @@ package test.org.apache.spark.sql; import java.io.Serializable; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; import java.time.Instant; import java.time.LocalDate; import java.util.*; @@ -210,6 +212,17 @@ private static Row createRecordSpark22000Row(Long index) { return new GenericRow(values); } + private static String timestampToString(Timestamp ts) { + String timestampString = String.valueOf(ts); + String formatted = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(ts); + + if (timestampString.length() > 19 && !timestampString.substring(19).equals(".0")) { + return formatted + timestampString.substring(19); + } else { + return formatted; + } + } + private static RecordSpark22000 createRecordSpark22000(Row recordRow) { RecordSpark22000 record = new RecordSpark22000(); record.setShortField(String.valueOf(recordRow.getShort(0))); @@ -219,7 +232,7 @@ private static RecordSpark22000 createRecordSpark22000(Row recordRow) { record.setDoubleField(String.valueOf(recordRow.getDouble(4))); record.setStringField(recordRow.getString(5)); record.setBooleanField(String.valueOf(recordRow.getBoolean(6))); - record.setTimestampField(String.valueOf(recordRow.getTimestamp(7))); + record.setTimestampField(timestampToString(recordRow.getTimestamp(7))); // This would figure out that null value will not become "null". record.setNullIntField(null); return record; diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/JavaDataFrameSuite.java b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDataFrameSuite.java index f4bffd9d79828..da7c62251b385 100644 --- a/sql/core/src/test/java/test/org/apache/spark/sql/JavaDataFrameSuite.java +++ b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDataFrameSuite.java @@ -105,7 +105,7 @@ public void testVarargMethods() { // Varargs in column expressions df.groupBy().agg(countDistinct("key", "value")); - df.groupBy().agg(countDistinct(col("key"), col("value"))); + df.groupBy().agg(count_distinct(col("key"), col("value"))); df.select(coalesce(col("key"))); // Varargs with mathfunctions diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/JavaDataFrameWriterV2Suite.java b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDataFrameWriterV2Suite.java index e418958bef94d..59c5263563b27 100644 --- a/sql/core/src/test/java/test/org/apache/spark/sql/JavaDataFrameWriterV2Suite.java +++ b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDataFrameWriterV2Suite.java @@ -23,7 +23,7 @@ import org.apache.spark.sql.catalyst.analysis.CannotReplaceMissingTableException; import org.apache.spark.sql.catalyst.analysis.NoSuchTableException; import org.apache.spark.sql.catalyst.analysis.TableAlreadyExistsException; -import org.apache.spark.sql.connector.InMemoryTableCatalog; +import org.apache.spark.sql.connector.catalog.InMemoryTableCatalog; import org.apache.spark.sql.test.TestSparkSession; import org.apache.spark.sql.types.StructType; import org.junit.After; diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetAggregatorSuite.java b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetAggregatorSuite.java index 8a90624f2070b..979b7751fa9a8 100644 --- a/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetAggregatorSuite.java +++ b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetAggregatorSuite.java @@ -38,18 +38,18 @@ public class JavaDatasetAggregatorSuite extends JavaDatasetAggregatorSuiteBase { public void testTypedAggregationAnonClass() { KeyValueGroupedDataset> grouped = generateGroupedDataset(); - Dataset> agged = grouped.agg(new IntSumOf().toColumn()); + Dataset> aggregated = grouped.agg(new IntSumOf().toColumn()); Assert.assertEquals( Arrays.asList(new Tuple2<>("a", 3), new Tuple2<>("b", 3)), - agged.collectAsList()); + aggregated.collectAsList()); - Dataset> agged2 = grouped.agg(new IntSumOf().toColumn()) + Dataset> aggregated2 = grouped.agg(new IntSumOf().toColumn()) .as(Encoders.tuple(Encoders.STRING(), Encoders.INT())); Assert.assertEquals( Arrays.asList( new Tuple2<>("a", 3), new Tuple2<>("b", 3)), - agged2.collectAsList()); + aggregated2.collectAsList()); } static class IntSumOf extends Aggregator, Integer, Integer> { @@ -88,43 +88,43 @@ public Encoder outputEncoder() { @Test public void testTypedAggregationAverage() { KeyValueGroupedDataset> grouped = generateGroupedDataset(); - Dataset> agged = grouped.agg( + Dataset> aggregated = grouped.agg( org.apache.spark.sql.expressions.javalang.typed.avg(value -> value._2() * 2.0)); Assert.assertEquals( Arrays.asList(new Tuple2<>("a", 3.0), new Tuple2<>("b", 6.0)), - agged.collectAsList()); + aggregated.collectAsList()); } @SuppressWarnings("deprecation") @Test public void testTypedAggregationCount() { KeyValueGroupedDataset> grouped = generateGroupedDataset(); - Dataset> agged = grouped.agg( + Dataset> aggregated = grouped.agg( org.apache.spark.sql.expressions.javalang.typed.count(value -> value)); Assert.assertEquals( Arrays.asList(new Tuple2<>("a", 2L), new Tuple2<>("b", 1L)), - agged.collectAsList()); + aggregated.collectAsList()); } @SuppressWarnings("deprecation") @Test public void testTypedAggregationSumDouble() { KeyValueGroupedDataset> grouped = generateGroupedDataset(); - Dataset> agged = grouped.agg( + Dataset> aggregated = grouped.agg( org.apache.spark.sql.expressions.javalang.typed.sum(value -> (double) value._2())); Assert.assertEquals( Arrays.asList(new Tuple2<>("a", 3.0), new Tuple2<>("b", 3.0)), - agged.collectAsList()); + aggregated.collectAsList()); } @SuppressWarnings("deprecation") @Test public void testTypedAggregationSumLong() { KeyValueGroupedDataset> grouped = generateGroupedDataset(); - Dataset> agged = grouped.agg( + Dataset> aggregated = grouped.agg( org.apache.spark.sql.expressions.javalang.typed.sumLong(value -> (long) value._2())); Assert.assertEquals( Arrays.asList(new Tuple2<>("a", 3L), new Tuple2<>("b", 3L)), - agged.collectAsList()); + aggregated.collectAsList()); } } diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java index 05c4a04b20b17..3e988c2a2390e 100644 --- a/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java +++ b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDatasetSuite.java @@ -21,8 +21,10 @@ import java.math.BigDecimal; import java.sql.Date; import java.sql.Timestamp; +import java.time.Duration; import java.time.Instant; import java.time.LocalDate; +import java.time.Period; import java.util.*; import javax.annotation.Nonnull; @@ -35,7 +37,6 @@ import com.google.common.base.Objects; import org.junit.*; -import org.junit.rules.ExpectedException; import org.apache.spark.api.java.JavaPairRDD; import org.apache.spark.api.java.JavaSparkContext; @@ -412,6 +413,22 @@ public void testLocalDateAndInstantEncoders() { Assert.assertEquals(data, ds.collectAsList()); } + @Test + public void testDurationEncoder() { + Encoder encoder = Encoders.DURATION(); + List data = Arrays.asList(Duration.ofDays(0)); + Dataset ds = spark.createDataset(data, encoder); + Assert.assertEquals(data, ds.collectAsList()); + } + + @Test + public void testPeriodEncoder() { + Encoder encoder = Encoders.PERIOD(); + List data = Arrays.asList(Period.ofYears(10)); + Dataset ds = spark.createDataset(data, encoder); + Assert.assertEquals(data, ds.collectAsList()); + } + public static class KryoSerializable { String value; @@ -893,9 +910,6 @@ public int hashCode() { } } - @Rule - public transient ExpectedException nullabilityCheck = ExpectedException.none(); - @Test public void testRuntimeNullabilityCheck() { OuterScopes.addOuterScope(this); @@ -937,9 +951,6 @@ public void testRuntimeNullabilityCheck() { Assert.assertEquals(Collections.singletonList(nestedSmallBean), ds.collectAsList()); } - nullabilityCheck.expect(RuntimeException.class); - nullabilityCheck.expectMessage("Null value appeared in non-nullable field"); - { Row row = new GenericRow(new Object[] { new GenericRow(new Object[] { @@ -950,7 +961,8 @@ public void testRuntimeNullabilityCheck() { Dataset df = spark.createDataFrame(Collections.singletonList(row), schema); Dataset ds = df.as(Encoders.bean(NestedSmallBean.class)); - ds.collect(); + Assert.assertThrows("Null value appeared in non-nullable field", RuntimeException.class, + ds::collect); } } diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/JavaDateFunctionsSuite.java b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDateFunctionsSuite.java new file mode 100644 index 0000000000000..2d1de77699508 --- /dev/null +++ b/sql/core/src/test/java/test/org/apache/spark/sql/JavaDateFunctionsSuite.java @@ -0,0 +1,68 @@ +/* + * 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. + */ + +package test.org.apache.spark.sql; + +import org.apache.spark.sql.Column; +import org.apache.spark.sql.Dataset; +import org.apache.spark.sql.Row; +import org.apache.spark.sql.RowFactory; +import org.apache.spark.sql.test.TestSparkSession; +import org.apache.spark.sql.types.StructType; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.sql.Date; +import java.util.*; + +import static org.apache.spark.sql.types.DataTypes.*; +import static org.apache.spark.sql.functions.*; + +public class JavaDateFunctionsSuite { + private transient TestSparkSession spark; + + @Before + public void setUp() { + spark = new TestSparkSession(); + } + + @After + public void tearDown() { + spark.stop(); + spark = null; + } + + @Test + public void makeIntervalWorksWithJava() { + Column twoYears = make_interval(lit(2), lit(0), lit(0), lit(0), lit(0), lit(0), lit(0)); + List rows = Arrays.asList( + RowFactory.create(Date.valueOf("2014-06-30"), Date.valueOf("2016-06-30")), + RowFactory.create(Date.valueOf("2015-05-01"), Date.valueOf("2017-05-01")), + RowFactory.create(Date.valueOf("2018-12-30"), Date.valueOf("2020-12-30"))); + StructType schema = createStructType(Arrays.asList( + createStructField("some_date", DateType, false), + createStructField("expected", DateType, false))); + Dataset df = spark.createDataFrame(rows, schema) + .withColumn("plus_two_years", col("some_date").plus(twoYears)); + Assert.assertTrue(Arrays.equals( + (Row[]) df.select(df.col("plus_two_years")).collect(), + (Row[]) df.select(df.col("expected")).collect())); + } + +} diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/connector/JavaSimpleBatchTable.java b/sql/core/src/test/java/test/org/apache/spark/sql/connector/JavaSimpleBatchTable.java index 71cf97b56fe54..4d147ac14a522 100644 --- a/sql/core/src/test/java/test/org/apache/spark/sql/connector/JavaSimpleBatchTable.java +++ b/sql/core/src/test/java/test/org/apache/spark/sql/connector/JavaSimpleBatchTable.java @@ -17,7 +17,7 @@ package test.org.apache.spark.sql.connector; -import java.util.Arrays; +import java.util.Collections; import java.util.HashSet; import java.util.Set; @@ -28,11 +28,8 @@ import org.apache.spark.sql.types.StructType; abstract class JavaSimpleBatchTable implements Table, SupportsRead { - private static final Set CAPABILITIES = new HashSet<>(Arrays.asList( - TableCapability.BATCH_READ, - TableCapability.BATCH_WRITE, - TableCapability.TRUNCATE)); - + private static final Set CAPABILITIES = + new HashSet<>(Collections.singletonList(TableCapability.BATCH_READ)); @Override public StructType schema() { return TestingV2Source.schema(); diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/connector/JavaSimpleWritableDataSource.java b/sql/core/src/test/java/test/org/apache/spark/sql/connector/JavaSimpleWritableDataSource.java new file mode 100644 index 0000000000000..74140d707c25a --- /dev/null +++ b/sql/core/src/test/java/test/org/apache/spark/sql/connector/JavaSimpleWritableDataSource.java @@ -0,0 +1,365 @@ +/* + * 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. + */ + +package test.org.apache.spark.sql.connector; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.*; + +import org.apache.spark.deploy.SparkHadoopUtil; +import org.apache.spark.sql.catalyst.InternalRow; +import org.apache.spark.sql.catalyst.expressions.GenericInternalRow; +import org.apache.spark.sql.connector.SimpleCounter; +import org.apache.spark.sql.connector.TestingV2Source; +import org.apache.spark.sql.connector.catalog.SupportsWrite; +import org.apache.spark.sql.connector.catalog.Table; +import org.apache.spark.sql.connector.catalog.TableCapability; +import org.apache.spark.sql.connector.read.InputPartition; +import org.apache.spark.sql.connector.read.PartitionReader; +import org.apache.spark.sql.connector.read.PartitionReaderFactory; +import org.apache.spark.sql.connector.read.ScanBuilder; +import org.apache.spark.sql.connector.write.*; +import org.apache.spark.sql.util.CaseInsensitiveStringMap; +import org.apache.spark.util.SerializableConfiguration; + +/** + * A HDFS based transactional writable data source which is implemented by java. + * Each task writes data to `target/_temporary/uniqueId/$jobId-$partitionId-$attemptNumber`. + * Each job moves files from `target/_temporary/uniqueId/` to `target`. + */ +public class JavaSimpleWritableDataSource implements TestingV2Source { + + static class MyScanBuilder extends JavaSimpleScanBuilder { + + private final String path; + private final Configuration conf; + + MyScanBuilder(String path, Configuration conf) { + this.path = path; + this.conf = conf; + } + + @Override + public InputPartition[] planInputPartitions() { + Path dataPath = new Path(this.path); + try { + FileSystem fs = dataPath.getFileSystem(conf); + if (fs.exists(dataPath)) { + return Arrays.stream(fs.listStatus(dataPath)) + .filter( + status -> { + String name = status.getPath().getName(); + return !name.startsWith("_") && !name.startsWith("."); + }) + .map(f -> new JavaCSVInputPartitionReader(f.getPath().toUri().toString())) + .toArray(InputPartition[]::new); + } else { + return new InputPartition[0]; + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + public PartitionReaderFactory createReaderFactory() { + SerializableConfiguration serializableConf = new SerializableConfiguration(conf); + return new JavaCSVReaderFactory(serializableConf); + } + } + + static class MyWriteBuilder implements WriteBuilder, SupportsTruncate { + + private final String path; + private final String queryId; + private boolean needTruncate = false; + + MyWriteBuilder(String path, LogicalWriteInfo info) { + this.path = path; + this.queryId = info.queryId(); + } + + @Override + public WriteBuilder truncate() { + this.needTruncate = true; + return this; + } + + @Override + public Write build() { + return new MyWrite(path, queryId, needTruncate); + } + } + + static class MyWrite implements Write { + + private final String path; + private final String queryId; + private final boolean needTruncate; + + MyWrite(String path, String queryId, boolean needTruncate) { + this.path = path; + this.queryId = queryId; + this.needTruncate = needTruncate; + } + + @Override + public BatchWrite toBatch() { + Path hadoopPath = new Path(path); + Configuration hadoopConf = SparkHadoopUtil.get().conf(); + try { + FileSystem fs = hadoopPath.getFileSystem(hadoopConf); + if (needTruncate) { + fs.delete(hadoopPath, true); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + String pathStr = hadoopPath.toUri().toString(); + return new MyBatchWrite(queryId, pathStr, hadoopConf); + } + } + + static class MyBatchWrite implements BatchWrite { + + private final String queryId; + private final String path; + private final Configuration conf; + + MyBatchWrite(String queryId, String path, Configuration conf) { + this.queryId = queryId; + this.path = path; + this.conf = conf; + } + + @Override + public DataWriterFactory createBatchWriterFactory(PhysicalWriteInfo info) { + SimpleCounter.resetCounter(); + return new JavaCSVDataWriterFactory(path, queryId, new SerializableConfiguration(conf)); + } + + @Override + public void onDataWriterCommit(WriterCommitMessage message) { + SimpleCounter.increaseCounter(); + } + + @Override + public void commit(WriterCommitMessage[] messages) { + Path finalPath = new Path(this.path); + Path jobPath = new Path(new Path(finalPath, "_temporary"), queryId); + try { + FileSystem fs = jobPath.getFileSystem(conf); + FileStatus[] fileStatuses = fs.listStatus(jobPath); + try { + for (FileStatus status : fileStatuses) { + Path file = status.getPath(); + Path dest = new Path(finalPath, file.getName()); + if (!fs.rename(file, dest)) { + throw new IOException(String.format("failed to rename(%s, %s)", file, dest)); + } + } + } finally { + fs.delete(jobPath, true); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + @Override + public void abort(WriterCommitMessage[] messages) { + try { + Path jobPath = new Path(new Path(this.path, "_temporary"), queryId); + FileSystem fs = jobPath.getFileSystem(conf); + fs.delete(jobPath, true); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + + static class MyTable extends JavaSimpleBatchTable implements SupportsWrite { + + private final String path; + private final Configuration conf = SparkHadoopUtil.get().conf(); + + MyTable(CaseInsensitiveStringMap options) { + this.path = options.get("path"); + } + + @Override + public ScanBuilder newScanBuilder(CaseInsensitiveStringMap options) { + return new MyScanBuilder(new Path(path).toUri().toString(), conf); + } + + @Override + public WriteBuilder newWriteBuilder(LogicalWriteInfo info) { + return new MyWriteBuilder(path, info); + } + + @Override + public Set capabilities() { + return new HashSet<>(Arrays.asList( + TableCapability.BATCH_READ, + TableCapability.BATCH_WRITE, + TableCapability.TRUNCATE)); + } + } + + @Override + public Table getTable(CaseInsensitiveStringMap options) { + return new MyTable(options); + } + + static class JavaCSVInputPartitionReader implements InputPartition { + + private String path; + + JavaCSVInputPartitionReader(String path) { + this.path = path; + } + + public String getPath() { + return path; + } + + public void setPath(String path) { + this.path = path; + } + } + + static class JavaCSVReaderFactory implements PartitionReaderFactory { + + private final SerializableConfiguration conf; + + JavaCSVReaderFactory(SerializableConfiguration conf) { + this.conf = conf; + } + + @Override + public PartitionReader createReader(InputPartition partition) { + String path = ((JavaCSVInputPartitionReader) partition).getPath(); + Path filePath = new Path(path); + try { + FileSystem fs = filePath.getFileSystem(conf.value()); + return new PartitionReader() { + private final FSDataInputStream inputStream = fs.open(filePath); + private final Iterator lines = + new BufferedReader(new InputStreamReader(inputStream)).lines().iterator(); + private String currentLine = ""; + + @Override + public boolean next() { + if (lines.hasNext()) { + currentLine = lines.next(); + return true; + } else { + return false; + } + } + + @Override + public InternalRow get() { + Object[] objects = + Arrays.stream(currentLine.split(",")) + .map(String::trim) + .map(Integer::parseInt) + .toArray(); + return new GenericInternalRow(objects); + } + + @Override + public void close() throws IOException { + inputStream.close(); + } + }; + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + + static class JavaCSVDataWriterFactory implements DataWriterFactory { + + private final String path; + private final String jobId; + private final SerializableConfiguration conf; + + JavaCSVDataWriterFactory(String path, String jobId, SerializableConfiguration conf) { + this.path = path; + this.jobId = jobId; + this.conf = conf; + } + + @Override + public DataWriter createWriter(int partitionId, long taskId) { + try { + Path jobPath = new Path(new Path(path, "_temporary"), jobId); + Path filePath = new Path(jobPath, String.format("%s-%d-%d", jobId, partitionId, taskId)); + FileSystem fs = filePath.getFileSystem(conf.value()); + return new JavaCSVDataWriter(fs, filePath); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + + static class JavaCSVDataWriter implements DataWriter { + + private final FileSystem fs; + private final Path file; + private final FSDataOutputStream out; + + JavaCSVDataWriter(FileSystem fs, Path file) throws IOException { + this.fs = fs; + this.file = file; + out = fs.create(file); + } + + @Override + public void write(InternalRow record) throws IOException { + out.writeBytes(String.format("%d,%d\n", record.getInt(0), record.getInt(1))); + } + + @Override + public WriterCommitMessage commit() throws IOException { + out.close(); + return null; + } + + @Override + public void abort() throws IOException { + try { + out.close(); + } finally { + fs.delete(file, false); + } + } + + @Override + public void close() { + } + } +} diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/connector/catalog/functions/JavaAverage.java b/sql/core/src/test/java/test/org/apache/spark/sql/connector/catalog/functions/JavaAverage.java new file mode 100644 index 0000000000000..4e783fdd439b6 --- /dev/null +++ b/sql/core/src/test/java/test/org/apache/spark/sql/connector/catalog/functions/JavaAverage.java @@ -0,0 +1,102 @@ +/* + * 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. + */ + +package test.org.apache.spark.sql.connector.catalog.functions; + +import org.apache.spark.sql.catalyst.InternalRow; +import org.apache.spark.sql.connector.catalog.functions.AggregateFunction; +import org.apache.spark.sql.connector.catalog.functions.BoundFunction; +import org.apache.spark.sql.connector.catalog.functions.UnboundFunction; +import org.apache.spark.sql.types.DataType; +import org.apache.spark.sql.types.DataTypes; +import org.apache.spark.sql.types.DoubleType; +import org.apache.spark.sql.types.StructType; + +import java.io.Serializable; + +public class JavaAverage implements UnboundFunction { + @Override + public String name() { + return "avg"; + } + + @Override + public BoundFunction bind(StructType inputType) { + if (inputType.fields().length != 1) { + throw new UnsupportedOperationException("Expect exactly one argument"); + } + if (inputType.fields()[0].dataType() instanceof DoubleType) { + return new JavaDoubleAverage(); + } + throw new UnsupportedOperationException("Unsupported non-integral type: " + + inputType.fields()[0].dataType()); + } + + @Override + public String description() { + return null; + } + + public static class JavaDoubleAverage implements AggregateFunction, Double> { + @Override + public State newAggregationState() { + return new State<>(0.0, 0.0); + } + + @Override + public State update(State state, InternalRow input) { + if (input.isNullAt(0)) { + return state; + } + return new State<>(state.sum + input.getDouble(0), state.count + 1); + } + + @Override + public Double produceResult(State state) { + return state.sum / state.count; + } + + @Override + public State merge(State leftState, State rightState) { + return new State<>(leftState.sum + rightState.sum, leftState.count + rightState.count); + } + + @Override + public DataType[] inputTypes() { + return new DataType[] { DataTypes.DoubleType }; + } + + @Override + public DataType resultType() { + return DataTypes.DoubleType; + } + + @Override + public String name() { + return "davg"; + } + } + + public static class State implements Serializable { + T sum, count; + + State(T sum, T count) { + this.sum = sum; + this.count = count; + } + } +} diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/connector/catalog/functions/JavaLongAdd.java b/sql/core/src/test/java/test/org/apache/spark/sql/connector/catalog/functions/JavaLongAdd.java new file mode 100644 index 0000000000000..e2e7136d6f44c --- /dev/null +++ b/sql/core/src/test/java/test/org/apache/spark/sql/connector/catalog/functions/JavaLongAdd.java @@ -0,0 +1,130 @@ +/* + * 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. + */ + +package test.org.apache.spark.sql.connector.catalog.functions; + +import org.apache.spark.sql.catalyst.InternalRow; +import org.apache.spark.sql.connector.catalog.functions.BoundFunction; +import org.apache.spark.sql.connector.catalog.functions.ScalarFunction; +import org.apache.spark.sql.connector.catalog.functions.UnboundFunction; +import org.apache.spark.sql.types.DataType; +import org.apache.spark.sql.types.DataTypes; +import org.apache.spark.sql.types.LongType; +import org.apache.spark.sql.types.StructField; +import org.apache.spark.sql.types.StructType; + +public class JavaLongAdd implements UnboundFunction { + private final ScalarFunction impl; + + public JavaLongAdd(ScalarFunction impl) { + this.impl = impl; + } + + @Override + public String name() { + return "long_add"; + } + + @Override + public BoundFunction bind(StructType inputType) { + if (inputType.fields().length != 2) { + throw new UnsupportedOperationException("Expect two arguments"); + } + StructField[] fields = inputType.fields(); + if (!(fields[0].dataType() instanceof LongType)) { + throw new UnsupportedOperationException("Expect first argument to be LongType"); + } + if (!(fields[1].dataType() instanceof LongType)) { + throw new UnsupportedOperationException("Expect second argument to be LongType"); + } + return impl; + } + + @Override + public String description() { + return "long_add"; + } + + private abstract static class JavaLongAddBase implements ScalarFunction { + private final boolean isResultNullable; + + JavaLongAddBase(boolean isResultNullable) { + this.isResultNullable = isResultNullable; + } + + @Override + public DataType[] inputTypes() { + return new DataType[] { DataTypes.LongType, DataTypes.LongType }; + } + + @Override + public DataType resultType() { + return DataTypes.LongType; + } + + @Override + public boolean isResultNullable() { + return isResultNullable; + } + } + + public static class JavaLongAddDefault extends JavaLongAddBase { + public JavaLongAddDefault(boolean isResultNullable) { + super(isResultNullable); + } + + @Override + public String name() { + return "long_add_default"; + } + + @Override + public Long produceResult(InternalRow input) { + return input.getLong(0) + input.getLong(1); + } + } + + public static class JavaLongAddMagic extends JavaLongAddBase { + public JavaLongAddMagic(boolean isResultNullable) { + super(isResultNullable); + } + + @Override + public String name() { + return "long_add_magic"; + } + + public long invoke(long left, long right) { + return left + right; + } + } + + public static class JavaLongAddStaticMagic extends JavaLongAddBase { + public JavaLongAddStaticMagic(boolean isResultNullable) { + super(isResultNullable); + } + + @Override + public String name() { + return "long_add_static_magic"; + } + + public static long invoke(long left, long right) { + return left + right; + } + } +} diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/connector/catalog/functions/JavaStrLen.java b/sql/core/src/test/java/test/org/apache/spark/sql/connector/catalog/functions/JavaStrLen.java new file mode 100644 index 0000000000000..7cd010b9365bb --- /dev/null +++ b/sql/core/src/test/java/test/org/apache/spark/sql/connector/catalog/functions/JavaStrLen.java @@ -0,0 +1,124 @@ +/* + * 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. + */ + +package test.org.apache.spark.sql.connector.catalog.functions; + +import org.apache.spark.sql.catalyst.InternalRow; +import org.apache.spark.sql.connector.catalog.functions.BoundFunction; +import org.apache.spark.sql.connector.catalog.functions.ScalarFunction; +import org.apache.spark.sql.connector.catalog.functions.UnboundFunction; +import org.apache.spark.sql.types.DataType; +import org.apache.spark.sql.types.DataTypes; +import org.apache.spark.sql.types.StringType; +import org.apache.spark.sql.types.StructType; +import org.apache.spark.unsafe.types.UTF8String; + +public class JavaStrLen implements UnboundFunction { + private final BoundFunction fn; + + public JavaStrLen(BoundFunction fn) { + this.fn = fn; + } + + @Override + public String name() { + return "strlen"; + } + + @Override + public BoundFunction bind(StructType inputType) { + if (inputType.fields().length != 1) { + throw new UnsupportedOperationException("Expect exactly one argument"); + } + + if (inputType.fields()[0].dataType() instanceof StringType) { + return fn; + } + + throw new UnsupportedOperationException("Except StringType"); + } + + @Override + public String description() { + return "strlen: returns the length of the input string\n" + + " strlen(string) -> int"; + } + + private abstract static class JavaStrLenBase implements ScalarFunction { + @Override + public DataType[] inputTypes() { + return new DataType[] { DataTypes.StringType }; + } + + @Override + public DataType resultType() { + return DataTypes.IntegerType; + } + + @Override + public String name() { + return "strlen"; + } + } + + public static class JavaStrLenDefault extends JavaStrLenBase { + @Override + public Integer produceResult(InternalRow input) { + String str = input.getString(0); + return str.length(); + } + } + + public static class JavaStrLenMagic extends JavaStrLenBase { + public int invoke(UTF8String str) { + return str.toString().length(); + } + } + + public static class JavaStrLenStaticMagic extends JavaStrLenBase { + public static int invoke(UTF8String str) { + return str.toString().length(); + } + } + + public static class JavaStrLenBoth extends JavaStrLenBase { + @Override + public Integer produceResult(InternalRow input) { + String str = input.getString(0); + return str.length(); + } + public int invoke(UTF8String str) { + return str.toString().length() + 100; + } + } + + // even though the static magic method is present, it has incorrect parameter type and so Spark + // should fallback to the non-static magic method + public static class JavaStrLenBadStaticMagic extends JavaStrLenBase { + public static int invoke(String str) { + return str.length(); + } + + public int invoke(UTF8String str) { + return str.toString().length() + 100; + } + } + + public static class JavaStrLenNoImpl extends JavaStrLenBase { + } +} + diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/execution/datasources/orc/FakeKeyProvider.java b/sql/core/src/test/java/test/org/apache/spark/sql/execution/datasources/orc/FakeKeyProvider.java new file mode 100644 index 0000000000000..70c9269962089 --- /dev/null +++ b/sql/core/src/test/java/test/org/apache/spark/sql/execution/datasources/orc/FakeKeyProvider.java @@ -0,0 +1,144 @@ +/* + * 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. + */ + +package test.org.apache.spark.sql.execution.datasources.orc; + +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.crypto.key.KeyProvider; +import org.apache.hadoop.crypto.key.KeyProviderCryptoExtension; +import org.apache.hadoop.crypto.key.KeyProviderFactory; +import org.apache.hadoop.crypto.key.kms.KMSClientProvider; + +/** + * A Hadoop KeyProvider that lets us test the interaction + * with the Hadoop code. + * + * https://github.com/apache/orc/blob/rel/release-1.6.7/java/tools/src/test/org/apache/orc/impl/FakeKeyProvider.java + * + * This file intentionally keeps the original file except + * (1) package name, (2) import order, (3) a few indentation + */ +public class FakeKeyProvider extends KeyProvider { + // map from key name to metadata + private final Map keyMetdata = new HashMap<>(); + // map from key version name to material + private final Map keyVersions = new HashMap<>(); + + public FakeKeyProvider(Configuration conf) { + super(conf); + } + + @Override + public KeyVersion getKeyVersion(String name) { + return keyVersions.get(name); + } + + @Override + public List getKeys() { + return new ArrayList<>(keyMetdata.keySet()); + } + + @Override + public List getKeyVersions(String name) { + List result = new ArrayList<>(); + Metadata meta = getMetadata(name); + for(int v=0; v < meta.getVersions(); ++v) { + String versionName = buildVersionName(name, v); + KeyVersion material = keyVersions.get(versionName); + if (material != null) { + result.add(material); + } + } + return result; + } + + @Override + public Metadata getMetadata(String name) { + return keyMetdata.get(name); + } + + @Override + public KeyVersion createKey(String name, byte[] bytes, Options options) { + String versionName = buildVersionName(name, 0); + keyMetdata.put(name, new TestMetadata(options.getCipher(), + options.getBitLength(), 1)); + KeyVersion result = new KMSClientProvider.KMSKeyVersion(name, versionName, bytes); + keyVersions.put(versionName, result); + return result; + } + + @Override + public void deleteKey(String name) { + throw new UnsupportedOperationException("Can't delete keys"); + } + + @Override + public KeyVersion rollNewVersion(String name, byte[] bytes) { + TestMetadata key = keyMetdata.get(name); + String versionName = buildVersionName(name, key.addVersion()); + KeyVersion result = new KMSClientProvider.KMSKeyVersion(name, versionName, + bytes); + keyVersions.put(versionName, result); + return result; + } + + @Override + public void flush() { + // Nothing + } + + static class TestMetadata extends KeyProvider.Metadata { + + TestMetadata(String cipher, int bitLength, int versions) { + super(cipher, bitLength, null, null, null, versions); + } + + public int addVersion() { + return super.addVersion(); + } + } + + public static class Factory extends KeyProviderFactory { + + @Override + public KeyProvider createProvider(URI uri, Configuration conf) throws IOException { + if ("test".equals(uri.getScheme())) { + KeyProvider provider = new FakeKeyProvider(conf); + // populate a couple keys into the provider + byte[] piiKey = new byte[]{0,1,2,3,4,5,6,7,8,9,0xa,0xb,0xc,0xd,0xe,0xf}; + org.apache.hadoop.crypto.key.KeyProvider.Options aes128 = new KeyProvider.Options(conf); + provider.createKey("pii", piiKey, aes128); + byte[] piiKey2 = new byte[]{0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17, + 0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f}; + provider.rollNewVersion("pii", piiKey2); + byte[] secretKey = new byte[]{0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27, + 0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f}; + provider.createKey("secret", secretKey, aes128); + return KeyProviderCryptoExtension.createKeyProviderCryptoExtension(provider); + } + return null; + } + } +} diff --git a/sql/core/src/test/java/test/org/apache/spark/sql/execution/sort/RecordBinaryComparatorSuite.java b/sql/core/src/test/java/test/org/apache/spark/sql/execution/sort/RecordBinaryComparatorSuite.java index 564e76737ecde..6cb7c40e3332b 100644 --- a/sql/core/src/test/java/test/org/apache/spark/sql/execution/sort/RecordBinaryComparatorSuite.java +++ b/sql/core/src/test/java/test/org/apache/spark/sql/execution/sort/RecordBinaryComparatorSuite.java @@ -37,6 +37,8 @@ import org.junit.Before; import org.junit.Test; +import java.nio.ByteOrder; + /** * Test the RecordBinaryComparator, which compares two UnsafeRows by their binary form. */ @@ -261,40 +263,74 @@ public void testBinaryComparatorForNullColumns() throws Exception { public void testBinaryComparatorWhenSubtractionIsDivisibleByMaxIntValue() throws Exception { int numFields = 1; + // Place the following bytes (hex) into UnsafeRows for the comparison: + // + // index | 00 01 02 03 04 05 06 07 + // ------+------------------------ + // row1 | 00 00 00 00 00 00 00 0b + // row2 | 00 00 00 00 80 00 00 0a + // + // The byte layout needs to be identical on all platforms regardless of + // of endianness. To achieve this the bytes in each value are reversed + // on little-endian platforms. + long row1Data = 11L; + long row2Data = 11L + Integer.MAX_VALUE; + if (ByteOrder.nativeOrder().equals(ByteOrder.LITTLE_ENDIAN)) { + row1Data = Long.reverseBytes(row1Data); + row2Data = Long.reverseBytes(row2Data); + } + UnsafeRow row1 = new UnsafeRow(numFields); byte[] data1 = new byte[100]; row1.pointTo(data1, computeSizeInBytes(numFields * 8)); - row1.setLong(0, 11); + row1.setLong(0, row1Data); UnsafeRow row2 = new UnsafeRow(numFields); byte[] data2 = new byte[100]; row2.pointTo(data2, computeSizeInBytes(numFields * 8)); - row2.setLong(0, 11L + Integer.MAX_VALUE); + row2.setLong(0, row2Data); insertRow(row1); insertRow(row2); - Assert.assertTrue(compare(0, 1) > 0); + Assert.assertTrue(compare(0, 1) < 0); } @Test public void testBinaryComparatorWhenSubtractionCanOverflowLongValue() throws Exception { int numFields = 1; + // Place the following bytes (hex) into UnsafeRows for the comparison: + // + // index | 00 01 02 03 04 05 06 07 + // ------+------------------------ + // row1 | 80 00 00 00 00 00 00 00 + // row2 | 00 00 00 00 00 00 00 01 + // + // The byte layout needs to be identical on all platforms regardless of + // of endianness. To achieve this the bytes in each value are reversed + // on little-endian platforms. + long row1Data = Long.MIN_VALUE; + long row2Data = 1L; + if (ByteOrder.nativeOrder().equals(ByteOrder.LITTLE_ENDIAN)) { + row1Data = Long.reverseBytes(row1Data); + row2Data = Long.reverseBytes(row2Data); + } + UnsafeRow row1 = new UnsafeRow(numFields); byte[] data1 = new byte[100]; row1.pointTo(data1, computeSizeInBytes(numFields * 8)); - row1.setLong(0, Long.MIN_VALUE); + row1.setLong(0, row1Data); UnsafeRow row2 = new UnsafeRow(numFields); byte[] data2 = new byte[100]; row2.pointTo(data2, computeSizeInBytes(numFields * 8)); - row2.setLong(0, 1); + row2.setLong(0, row2Data); insertRow(row1); insertRow(row2); - Assert.assertTrue(compare(0, 1) < 0); + Assert.assertTrue(compare(0, 1) > 0); } @Test diff --git a/sql/core/src/test/resources/META-INF/services/org.apache.hadoop.crypto.key.KeyProviderFactory b/sql/core/src/test/resources/META-INF/services/org.apache.hadoop.crypto.key.KeyProviderFactory new file mode 100644 index 0000000000000..f436622b5fb42 --- /dev/null +++ b/sql/core/src/test/resources/META-INF/services/org.apache.hadoop.crypto.key.KeyProviderFactory @@ -0,0 +1,16 @@ +# 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. + +test.org.apache.spark.sql.execution.datasources.orc.FakeKeyProvider$Factory diff --git a/sql/core/src/test/resources/META-INF/services/org.apache.spark.sql.SparkSessionExtensionsProvider b/sql/core/src/test/resources/META-INF/services/org.apache.spark.sql.SparkSessionExtensionsProvider new file mode 100644 index 0000000000000..b5b01a09e6995 --- /dev/null +++ b/sql/core/src/test/resources/META-INF/services/org.apache.spark.sql.SparkSessionExtensionsProvider @@ -0,0 +1 @@ +org.apache.spark.sql.YourExtensions diff --git a/sql/core/src/test/resources/META-INF/services/org.apache.spark.sql.jdbc.JdbcConnectionProvider b/sql/core/src/test/resources/META-INF/services/org.apache.spark.sql.jdbc.JdbcConnectionProvider new file mode 100644 index 0000000000000..afb48e1a3511f --- /dev/null +++ b/sql/core/src/test/resources/META-INF/services/org.apache.spark.sql.jdbc.JdbcConnectionProvider @@ -0,0 +1 @@ +org.apache.spark.sql.execution.datasources.jdbc.connection.IntentionallyFaultyConnectionProvider \ No newline at end of file diff --git a/sql/core/src/test/resources/META-INF/services/org.apache.spark.sql.sources.DataSourceRegister b/sql/core/src/test/resources/META-INF/services/org.apache.spark.sql.sources.DataSourceRegister index 914af589384df..dd22970203b3c 100644 --- a/sql/core/src/test/resources/META-INF/services/org.apache.spark.sql.sources.DataSourceRegister +++ b/sql/core/src/test/resources/META-INF/services/org.apache.spark.sql.sources.DataSourceRegister @@ -11,4 +11,5 @@ org.apache.spark.sql.streaming.sources.FakeReadBothModes org.apache.spark.sql.streaming.sources.FakeReadNeitherMode org.apache.spark.sql.streaming.sources.FakeWriteOnly org.apache.spark.sql.streaming.sources.FakeNoWrite +org.apache.spark.sql.streaming.sources.FakeWriteSupportingExternalMetadata org.apache.spark.sql.streaming.sources.FakeWriteSupportProviderV1Fallback diff --git a/sql/core/src/test/resources/SPARK-33084.jar b/sql/core/src/test/resources/SPARK-33084.jar new file mode 100644 index 0000000000000..61e1663ad3a28 Binary files /dev/null and b/sql/core/src/test/resources/SPARK-33084.jar differ diff --git a/sql/core/src/test/resources/hive-site.xml b/sql/core/src/test/resources/hive-site.xml index 17297b3e22a7e..0d1072f832765 100644 --- a/sql/core/src/test/resources/hive-site.xml +++ b/sql/core/src/test/resources/hive-site.xml @@ -23,4 +23,13 @@ true Internal marker for test. + + hadoop.tmp.dir + /tmp/hive_one + default is /tmp/hadoop-${user.name} and will be overridden + + + hadoop.this.is.a.test.key + 2018-11-17 13:33:33.333 + diff --git a/sql/core/src/test/resources/spark-events/local-1596020211915 b/sql/core/src/test/resources/spark-events/local-1596020211915 new file mode 100644 index 0000000000000..ff34bbc16ef3a --- /dev/null +++ b/sql/core/src/test/resources/spark-events/local-1596020211915 @@ -0,0 +1,160 @@ +{"Event":"SparkListenerLogStart","Spark Version":"3.1.0-SNAPSHOT"} +{"Event":"SparkListenerResourceProfileAdded","Resource Profile Id":0,"Executor Resource Requests":{"cores":{"Resource Name":"cores","Amount":1,"Discovery Script":"","Vendor":""},"memory":{"Resource Name":"memory","Amount":1024,"Discovery Script":"","Vendor":""}},"Task Resource Requests":{"cpus":{"Resource Name":"cpus","Amount":1.0}}} +{"Event":"SparkListenerExecutorAdded","Timestamp":1596020212090,"Executor ID":"driver","Executor Info":{"Host":"iZbp19vpr16ix621sdw476Z","Total Cores":4,"Log Urls":{},"Attributes":{},"Resources":{},"Resource Profile Id":0}} +{"Event":"SparkListenerBlockManagerAdded","Block Manager ID":{"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Port":39845},"Maximum Memory":384093388,"Timestamp":1596020212109,"Maximum Onheap Memory":384093388,"Maximum Offheap Memory":0} +{"Event":"SparkListenerEnvironmentUpdate","JVM Information":{"Java Home":"/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre","Java Version":"1.8.0_252 (Oracle Corporation)","Scala Version":"version 2.12.10"},"Spark Properties":{"spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.driver.port":"46309","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","spark.app.name":"StructuredKafkaWordCount","spark.scheduler.mode":"FIFO","spark.submit.pyFiles":"","spark.executor.id":"driver","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"},"Hadoop Properties":{"yarn.resourcemanager.amlauncher.thread-count":"50","yarn.sharedcache.enabled":"false","fs.s3a.connection.maximum":"15","fs.s3a.impl":"org.apache.hadoop.fs.s3a.S3AFileSystem","yarn.app.mapreduce.am.scheduler.heartbeat.interval-ms":"1000","hadoop.security.kms.client.timeout":"60","hadoop.http.authentication.kerberos.principal":"HTTP/_HOST@LOCALHOST","mapreduce.framework.name":"local","yarn.sharedcache.uploader.server.thread-count":"50","yarn.nodemanager.linux-container-executor.nonsecure-mode.user-pattern":"^[_.A-Za-z0-9][-@_.A-Za-z0-9]{0,255}?[$]?$","tfile.fs.output.buffer.size":"262144","yarn.app.mapreduce.am.job.task.listener.thread-count":"30","hadoop.security.groups.cache.background.reload.threads":"3","yarn.resourcemanager.webapp.cross-origin.enabled":"false","fs.AbstractFileSystem.ftp.impl":"org.apache.hadoop.fs.ftp.FtpFs","fs.s3.block.size":"67108864","hadoop.registry.secure":"false","hadoop.shell.safely.delete.limit.num.files":"100","dfs.bytes-per-checksum":"512","fs.s3.buffer.dir":"${hadoop.tmp.dir}/s3","mapreduce.job.acl-view-job":" ","mapreduce.jobhistory.loadedjobs.cache.size":"5","mapreduce.input.fileinputformat.split.minsize":"0","yarn.resourcemanager.container.liveness-monitor.interval-ms":"600000","yarn.resourcemanager.client.thread-count":"50","io.seqfile.compress.blocksize":"1000000","yarn.sharedcache.checksum.algo.impl":"org.apache.hadoop.yarn.sharedcache.ChecksumSHA256Impl","yarn.nodemanager.amrmproxy.interceptor-class.pipeline":"org.apache.hadoop.yarn.server.nodemanager.amrmproxy.DefaultRequestInterceptor","yarn.timeline-service.entity-group-fs-store.leveldb-cache-read-cache-size":"10485760","mapreduce.reduce.shuffle.fetch.retry.interval-ms":"1000","mapreduce.task.profile.maps":"0-2","yarn.scheduler.include-port-in-node-name":"false","yarn.nodemanager.admin-env":"MALLOC_ARENA_MAX=$MALLOC_ARENA_MAX","yarn.resourcemanager.node-removal-untracked.timeout-ms":"60000","mapreduce.am.max-attempts":"2","hadoop.security.kms.client.failover.sleep.base.millis":"100","mapreduce.jobhistory.webapp.https.address":"0.0.0.0:19890","yarn.node-labels.fs-store.impl.class":"org.apache.hadoop.yarn.nodelabels.FileSystemNodeLabelsStore","fs.trash.checkpoint.interval":"0","mapreduce.job.map.output.collector.class":"org.apache.hadoop.mapred.MapTask$MapOutputBuffer","yarn.resourcemanager.node-ip-cache.expiry-interval-secs":"-1","hadoop.http.authentication.signature.secret.file":"*********(redacted)","hadoop.jetty.logs.serve.aliases":"true","yarn.timeline-service.handler-thread-count":"10","yarn.resourcemanager.max-completed-applications":"10000","yarn.resourcemanager.system-metrics-publisher.enabled":"false","yarn.sharedcache.webapp.address":"0.0.0.0:8788","yarn.resourcemanager.delegation.token.renew-interval":"*********(redacted)","yarn.sharedcache.nm.uploader.replication.factor":"10","hadoop.security.groups.negative-cache.secs":"30","yarn.app.mapreduce.task.container.log.backups":"0","mapreduce.reduce.skip.proc-count.auto-incr":"true","hadoop.security.group.mapping.ldap.posix.attr.gid.name":"gidNumber","ipc.client.fallback-to-simple-auth-allowed":"false","yarn.client.failover-proxy-provider":"org.apache.hadoop.yarn.client.ConfiguredRMFailoverProxyProvider","yarn.timeline-service.http-authentication.simple.anonymous.allowed":"true","ha.health-monitor.check-interval.ms":"1000","yarn.acl.reservation-enable":"false","yarn.resourcemanager.store.class":"org.apache.hadoop.yarn.server.resourcemanager.recovery.FileSystemRMStateStore","yarn.app.mapreduce.am.hard-kill-timeout-ms":"10000","yarn.nodemanager.container-metrics.enable":"true","yarn.timeline-service.client.fd-clean-interval-secs":"60","yarn.nodemanager.docker-container-executor.exec-name":"/usr/bin/docker","yarn.resourcemanager.nodemanagers.heartbeat-interval-ms":"1000","mapred.child.java.opts":"-Xmx200m","hadoop.common.configuration.version":"0.23.0","yarn.nodemanager.remote-app-log-dir-suffix":"logs","yarn.nodemanager.windows-container.cpu-limit.enabled":"false","yarn.nodemanager.runtime.linux.docker.privileged-containers.allowed":"false","file.blocksize":"67108864","hadoop.registry.zk.retry.ceiling.ms":"60000","yarn.sharedcache.store.in-memory.initial-delay-mins":"10","mapreduce.jobhistory.principal":"jhs/_HOST@REALM.TLD","mapreduce.map.skip.proc-count.auto-incr":"true","mapreduce.task.profile.reduces":"0-2","yarn.timeline-service.webapp.https.address":"${yarn.timeline-service.hostname}:8190","yarn.resourcemanager.scheduler.address":"${yarn.resourcemanager.hostname}:8030","yarn.node-labels.enabled":"false","yarn.resourcemanager.webapp.ui-actions.enabled":"true","mapreduce.task.timeout":"600000","yarn.sharedcache.client-server.thread-count":"50","hadoop.security.crypto.cipher.suite":"AES/CTR/NoPadding","yarn.resourcemanager.connect.max-wait.ms":"900000","fs.defaultFS":"file:///","yarn.minicluster.use-rpc":"false","fs.har.impl.disable.cache":"true","io.compression.codec.bzip2.library":"system-native","mapreduce.shuffle.connection-keep-alive.timeout":"5","yarn.resourcemanager.webapp.https.address":"${yarn.resourcemanager.hostname}:8090","mapreduce.jobhistory.address":"0.0.0.0:10020","yarn.resourcemanager.nm-tokens.master-key-rolling-interval-secs":"*********(redacted)","yarn.is.minicluster":"false","yarn.nodemanager.address":"${yarn.nodemanager.hostname}:0","fs.AbstractFileSystem.s3a.impl":"org.apache.hadoop.fs.s3a.S3A","mapreduce.task.combine.progress.records":"10000","yarn.resourcemanager.am.max-attempts":"2","yarn.nodemanager.linux-container-executor.cgroups.hierarchy":"/hadoop-yarn","ipc.server.log.slow.rpc":"false","yarn.resourcemanager.node-labels.provider.fetch-interval-ms":"1800000","yarn.nodemanager.webapp.cross-origin.enabled":"false","yarn.app.mapreduce.am.job.committer.cancel-timeout":"60000","ftp.bytes-per-checksum":"512","yarn.nodemanager.resource.memory-mb":"-1","fs.s3a.fast.upload.active.blocks":"4","mapreduce.jobhistory.joblist.cache.size":"20000","fs.ftp.host":"0.0.0.0","yarn.resourcemanager.fs.state-store.num-retries":"0","yarn.resourcemanager.nodemanager-connect-retries":"10","hadoop.security.kms.client.encrypted.key.cache.low-watermark":"0.3f","yarn.timeline-service.client.max-retries":"30","dfs.ha.fencing.ssh.connect-timeout":"30000","yarn.log-aggregation-enable":"false","mapreduce.reduce.markreset.buffer.percent":"0.0","fs.AbstractFileSystem.viewfs.impl":"org.apache.hadoop.fs.viewfs.ViewFs","mapreduce.task.io.sort.factor":"10","yarn.nodemanager.amrmproxy.client.thread-count":"25","ha.failover-controller.new-active.rpc-timeout.ms":"60000","yarn.nodemanager.container-localizer.java.opts":"-Xmx256m","mapreduce.jobhistory.datestring.cache.size":"200000","mapreduce.job.acl-modify-job":" ","yarn.nodemanager.windows-container.memory-limit.enabled":"false","yarn.timeline-service.webapp.address":"${yarn.timeline-service.hostname}:8188","yarn.app.mapreduce.am.job.committer.commit-window":"10000","yarn.nodemanager.container-manager.thread-count":"20","yarn.minicluster.fixed.ports":"false","yarn.cluster.max-application-priority":"0","yarn.timeline-service.ttl-enable":"true","mapreduce.jobhistory.recovery.store.fs.uri":"${hadoop.tmp.dir}/mapred/history/recoverystore","hadoop.caller.context.signature.max.size":"40","ha.zookeeper.session-timeout.ms":"10000","tfile.io.chunk.size":"1048576","mapreduce.job.speculative.slowtaskthreshold":"1.0","io.serializations":"org.apache.hadoop.io.serializer.WritableSerialization, org.apache.hadoop.io.serializer.avro.AvroSpecificSerialization, org.apache.hadoop.io.serializer.avro.AvroReflectSerialization","hadoop.security.kms.client.failover.sleep.max.millis":"2000","hadoop.security.group.mapping.ldap.directory.search.timeout":"10000","fs.swift.impl":"org.apache.hadoop.fs.swift.snative.SwiftNativeFileSystem","yarn.nodemanager.local-cache.max-files-per-directory":"8192","hadoop.http.cross-origin.enabled":"false","mapreduce.map.sort.spill.percent":"0.80","yarn.timeline-service.entity-group-fs-store.scan-interval-seconds":"60","yarn.timeline-service.client.best-effort":"false","yarn.resourcemanager.webapp.delegation-token-auth-filter.enabled":"*********(redacted)","hadoop.security.group.mapping.ldap.posix.attr.uid.name":"uidNumber","fs.AbstractFileSystem.swebhdfs.impl":"org.apache.hadoop.fs.SWebHdfs","mapreduce.ifile.readahead":"true","yarn.timeline-service.leveldb-timeline-store.ttl-interval-ms":"300000","hadoop.security.kms.client.encrypted.key.cache.num.refill.threads":"2","yarn.resourcemanager.scheduler.class":"org.apache.hadoop.yarn.server.resourcemanager.scheduler.capacity.CapacityScheduler","yarn.app.mapreduce.am.command-opts":"-Xmx1024m","mapreduce.cluster.local.dir":"${hadoop.tmp.dir}/mapred/local","io.mapfile.bloom.error.rate":"0.005","yarn.nodemanager.runtime.linux.allowed-runtimes":"default","yarn.sharedcache.store.class":"org.apache.hadoop.yarn.server.sharedcachemanager.store.InMemorySCMStore","ha.failover-controller.graceful-fence.rpc-timeout.ms":"5000","ftp.replication":"3","hadoop.security.uid.cache.secs":"14400","mapreduce.job.maxtaskfailures.per.tracker":"3","io.skip.checksum.errors":"false","yarn.app.mapreduce.client-am.ipc.max-retries-on-timeouts":"3","fs.s3a.connection.timeout":"200000","mapreduce.job.max.split.locations":"10","hadoop.registry.zk.session.timeout.ms":"60000","mapreduce.jvm.system-properties-to-log":"os.name,os.version,java.home,java.runtime.version,java.vendor,java.version,java.vm.name,java.class.path,java.io.tmpdir,user.dir,user.name","yarn.timeline-service.entity-group-fs-store.active-dir":"/tmp/entity-file-history/active","mapreduce.shuffle.transfer.buffer.size":"131072","yarn.timeline-service.client.retry-interval-ms":"1000","yarn.http.policy":"HTTP_ONLY","fs.s3a.socket.send.buffer":"8192","yarn.sharedcache.uploader.server.address":"0.0.0.0:8046","hadoop.http.authentication.token.validity":"*********(redacted)","mapreduce.shuffle.max.connections":"0","yarn.minicluster.yarn.nodemanager.resource.memory-mb":"4096","mapreduce.job.emit-timeline-data":"false","yarn.nodemanager.resource.system-reserved-memory-mb":"-1","hadoop.kerberos.min.seconds.before.relogin":"60","mapreduce.jobhistory.move.thread-count":"3","yarn.resourcemanager.admin.client.thread-count":"1","yarn.dispatcher.drain-events.timeout":"300000","fs.s3a.buffer.dir":"${hadoop.tmp.dir}/s3a","hadoop.ssl.enabled.protocols":"TLSv1,SSLv2Hello,TLSv1.1,TLSv1.2","mapreduce.jobhistory.admin.address":"0.0.0.0:10033","yarn.log-aggregation-status.time-out.ms":"600000","mapreduce.shuffle.port":"13562","yarn.resourcemanager.max-log-aggregation-diagnostics-in-memory":"10","yarn.nodemanager.health-checker.interval-ms":"600000","ftp.blocksize":"67108864","yarn.nodemanager.log-container-debug-info.enabled":"false","yarn.client.max-cached-nodemanagers-proxies":"0","yarn.nodemanager.linux-container-executor.cgroups.delete-delay-ms":"20","yarn.nodemanager.delete.debug-delay-sec":"0","yarn.nodemanager.pmem-check-enabled":"true","yarn.nodemanager.disk-health-checker.max-disk-utilization-per-disk-percentage":"90.0","mapreduce.app-submission.cross-platform":"false","yarn.resourcemanager.work-preserving-recovery.scheduling-wait-ms":"10000","hadoop.security.groups.cache.secs":"300","yarn.resourcemanager.zk-retry-interval-ms":"1000","ipc.maximum.data.length":"67108864","mapreduce.shuffle.max.threads":"0","hadoop.security.authorization":"false","mapreduce.job.complete.cancel.delegation.tokens":"*********(redacted)","fs.s3a.paging.maximum":"5000","nfs.exports.allowed.hosts":"* rw","mapreduce.jobhistory.http.policy":"HTTP_ONLY","yarn.sharedcache.store.in-memory.check-period-mins":"720","s3native.replication":"3","hadoop.security.group.mapping.ldap.ssl":"false","yarn.client.application-client-protocol.poll-interval-ms":"200","ha.zookeeper.parent-znode":"/hadoop-ha","yarn.nodemanager.log-aggregation.policy.class":"org.apache.hadoop.yarn.server.nodemanager.containermanager.logaggregation.AllContainerLogAggregationPolicy","mapreduce.reduce.shuffle.merge.percent":"0.66","hadoop.security.group.mapping.ldap.search.filter.group":"(objectClass=group)","yarn.nodemanager.resourcemanager.minimum.version":"NONE","mapreduce.job.speculative.speculative-cap-running-tasks":"0.1","yarn.admin.acl":"*","yarn.nodemanager.recovery.supervised":"false","yarn.sharedcache.admin.thread-count":"1","yarn.resourcemanager.ha.automatic-failover.enabled":"true","mapreduce.reduce.skip.maxgroups":"0","mapreduce.reduce.shuffle.connect.timeout":"180000","yarn.resourcemanager.address":"${yarn.resourcemanager.hostname}:8032","ipc.client.ping":"true","mapreduce.task.local-fs.write-limit.bytes":"-1","fs.adl.oauth2.access.token.provider.type":"*********(redacted)","mapreduce.shuffle.ssl.file.buffer.size":"65536","yarn.resourcemanager.ha.automatic-failover.embedded":"true","hadoop.ssl.enabled":"false","fs.s3a.multipart.purge":"false","mapreduce.job.end-notification.max.attempts":"5","mapreduce.output.fileoutputformat.compress.codec":"org.apache.hadoop.io.compress.DefaultCodec","yarn.nodemanager.container-monitor.procfs-tree.smaps-based-rss.enabled":"false","ha.health-monitor.connect-retry-interval.ms":"1000","yarn.nodemanager.keytab":"/etc/krb5.keytab","mapreduce.jobhistory.keytab":"/etc/security/keytab/jhs.service.keytab","fs.s3a.threads.max":"10","mapreduce.reduce.shuffle.input.buffer.percent":"0.70","mapreduce.cluster.temp.dir":"${hadoop.tmp.dir}/mapred/temp","s3.replication":"3","yarn.nodemanager.node-labels.resync-interval-ms":"120000","hadoop.tmp.dir":"/tmp/hadoop-${user.name}","mapreduce.job.maps":"2","mapreduce.job.end-notification.max.retry.interval":"5000","yarn.log-aggregation.retain-check-interval-seconds":"-1","yarn.resourcemanager.resource-tracker.client.thread-count":"50","yarn.timeline-service.leveldb-timeline-store.start-time-read-cache-size":"10000","yarn.resourcemanager.ha.automatic-failover.zk-base-path":"/yarn-leader-election","io.seqfile.local.dir":"${hadoop.tmp.dir}/io/local","mapreduce.client.submit.file.replication":"10","mapreduce.jobhistory.minicluster.fixed.ports":"false","fs.s3a.multipart.threshold":"2147483647","mapreduce.jobhistory.done-dir":"${yarn.app.mapreduce.am.staging-dir}/history/done","yarn.resourcemanager.zk-acl":"world:anyone:rwcda","ipc.client.idlethreshold":"4000","yarn.nodemanager.linux-container-executor.cgroups.strict-resource-usage":"false","mapreduce.reduce.input.buffer.percent":"0.0","yarn.nodemanager.amrmproxy.enable":"false","fs.ftp.host.port":"21","ipc.ping.interval":"60000","yarn.resourcemanager.history-writer.multi-threaded-dispatcher.pool-size":"10","yarn.resourcemanager.admin.address":"${yarn.resourcemanager.hostname}:8033","file.client-write-packet-size":"65536","ipc.client.kill.max":"10","mapreduce.reduce.speculative":"true","mapreduce.local.clientfactory.class.name":"org.apache.hadoop.mapred.LocalClientFactory","mapreduce.job.reducer.unconditional-preempt.delay.sec":"300","yarn.nodemanager.disk-health-checker.interval-ms":"120000","yarn.nodemanager.log.deletion-threads-count":"4","ipc.client.connection.maxidletime":"10000","mapreduce.task.io.sort.mb":"100","yarn.nodemanager.localizer.client.thread-count":"5","yarn.sharedcache.admin.address":"0.0.0.0:8047","yarn.nodemanager.localizer.cache.cleanup.interval-ms":"600000","hadoop.security.crypto.codec.classes.aes.ctr.nopadding":"org.apache.hadoop.crypto.OpensslAesCtrCryptoCodec, org.apache.hadoop.crypto.JceAesCtrCryptoCodec","fs.s3a.connection.ssl.enabled":"true","yarn.nodemanager.process-kill-wait.ms":"2000","mapreduce.job.hdfs-servers":"${fs.defaultFS}","hadoop.workaround.non.threadsafe.getpwuid":"true","fs.df.interval":"60000","fs.s3.sleepTimeSeconds":"10","fs.s3a.multiobjectdelete.enable":"true","yarn.sharedcache.cleaner.resource-sleep-ms":"0","yarn.nodemanager.disk-health-checker.min-healthy-disks":"0.25","hadoop.shell.missing.defaultFs.warning":"false","io.file.buffer.size":"65536","hadoop.security.group.mapping.ldap.search.attr.member":"member","hadoop.security.random.device.file.path":"/dev/urandom","hadoop.security.sensitive-config-keys":"*********(redacted)","hadoop.rpc.socket.factory.class.default":"org.apache.hadoop.net.StandardSocketFactory","yarn.intermediate-data-encryption.enable":"false","yarn.resourcemanager.connect.retry-interval.ms":"30000","yarn.scheduler.minimum-allocation-mb":"1024","yarn.app.mapreduce.am.staging-dir":"/tmp/hadoop-yarn/staging","mapreduce.reduce.shuffle.read.timeout":"180000","hadoop.http.cross-origin.max-age":"1800","fs.s3a.connection.establish.timeout":"5000","mapreduce.job.running.map.limit":"0","yarn.minicluster.control-resource-monitoring":"false","hadoop.ssl.require.client.cert":"false","hadoop.kerberos.kinit.command":"kinit","mapreduce.reduce.log.level":"INFO","hadoop.security.dns.log-slow-lookups.threshold.ms":"1000","mapreduce.job.ubertask.enable":"false","hadoop.caller.context.enabled":"false","yarn.nodemanager.vmem-pmem-ratio":"2.1","hadoop.rpc.protection":"authentication","ha.health-monitor.rpc-timeout.ms":"45000","s3native.stream-buffer-size":"4096","yarn.nodemanager.remote-app-log-dir":"/tmp/logs","yarn.nodemanager.resource.pcores-vcores-multiplier":"1.0","yarn.app.mapreduce.am.containerlauncher.threadpool-initial-size":"10","fs.s3n.multipart.uploads.enabled":"false","hadoop.security.crypto.buffer.size":"8192","yarn.nodemanager.node-labels.provider.fetch-interval-ms":"600000","mapreduce.jobhistory.recovery.store.leveldb.path":"${hadoop.tmp.dir}/mapred/history/recoverystore","yarn.client.failover-retries-on-socket-timeouts":"0","hadoop.security.instrumentation.requires.admin":"false","yarn.nodemanager.delete.thread-count":"4","mapreduce.job.finish-when-all-reducers-done":"false","hadoop.registry.jaas.context":"Client","yarn.timeline-service.leveldb-timeline-store.path":"${hadoop.tmp.dir}/yarn/timeline","s3.blocksize":"67108864","io.map.index.interval":"128","mapreduce.job.counters.max":"120","yarn.timeline-service.store-class":"org.apache.hadoop.yarn.server.timeline.LeveldbTimelineStore","mapreduce.jobhistory.move.interval-ms":"180000","yarn.nodemanager.localizer.fetch.thread-count":"4","yarn.resourcemanager.scheduler.client.thread-count":"50","hadoop.ssl.hostname.verifier":"DEFAULT","yarn.timeline-service.leveldb-state-store.path":"${hadoop.tmp.dir}/yarn/timeline","mapreduce.job.classloader":"false","mapreduce.task.profile.map.params":"${mapreduce.task.profile.params}","ipc.client.connect.timeout":"20000","s3.stream-buffer-size":"4096","yarn.nm.liveness-monitor.expiry-interval-ms":"600000","yarn.resourcemanager.reservation-system.planfollower.time-step":"1000","s3native.bytes-per-checksum":"512","mapreduce.jobtracker.address":"local","yarn.nodemanager.recovery.enabled":"false","mapreduce.job.end-notification.retry.interval":"1000","fs.du.interval":"600000","hadoop.security.group.mapping.ldap.read.timeout.ms":"60000","hadoop.security.groups.cache.warn.after.ms":"5000","file.bytes-per-checksum":"512","yarn.node-labels.fs-store.retry-policy-spec":"2000, 500","hadoop.security.groups.cache.background.reload":"false","net.topology.script.number.args":"100","mapreduce.task.merge.progress.records":"10000","yarn.nodemanager.localizer.address":"${yarn.nodemanager.hostname}:8040","yarn.timeline-service.keytab":"/etc/krb5.keytab","mapreduce.reduce.shuffle.fetch.retry.timeout-ms":"30000","yarn.resourcemanager.rm.container-allocation.expiry-interval-ms":"600000","mapreduce.fileoutputcommitter.algorithm.version":"1","yarn.resourcemanager.work-preserving-recovery.enabled":"true","mapreduce.map.skip.maxrecords":"0","yarn.sharedcache.root-dir":"/sharedcache","hadoop.http.authentication.type":"simple","mapreduce.task.userlog.limit.kb":"0","yarn.resourcemanager.scheduler.monitor.enable":"false","fs.s3n.block.size":"67108864","ipc.client.connect.max.retries":"10","hadoop.registry.zk.retry.times":"5","mapreduce.jobtracker.staging.root.dir":"${hadoop.tmp.dir}/mapred/staging","yarn.nodemanager.resource-monitor.interval-ms":"3000","mapreduce.shuffle.listen.queue.size":"128","mapreduce.map.cpu.vcores":"1","yarn.timeline-service.client.fd-retain-secs":"300","hadoop.user.group.static.mapping.overrides":"dr.who=;","mapreduce.jobhistory.recovery.store.class":"org.apache.hadoop.mapreduce.v2.hs.HistoryServerFileSystemStateStoreService","yarn.resourcemanager.fail-fast":"${yarn.fail-fast}","yarn.resourcemanager.proxy-user-privileges.enabled":"false","mapreduce.job.reducer.preempt.delay.sec":"0","hadoop.util.hash.type":"murmur","yarn.app.mapreduce.client.job.max-retries":"0","mapreduce.reduce.shuffle.retry-delay.max.ms":"60000","hadoop.security.group.mapping.ldap.connection.timeout.ms":"60000","mapreduce.task.profile.params":"-agentlib:hprof=cpu=samples,heap=sites,force=n,thread=y,verbose=n,file=%s","yarn.app.mapreduce.shuffle.log.backups":"0","hadoop.registry.zk.retry.interval.ms":"1000","yarn.nodemanager.linux-container-executor.cgroups.delete-timeout-ms":"1000","fs.AbstractFileSystem.file.impl":"org.apache.hadoop.fs.local.LocalFs","yarn.nodemanager.log-aggregation.roll-monitoring-interval-seconds":"-1","mapreduce.jobhistory.cleaner.interval-ms":"86400000","hadoop.registry.zk.quorum":"localhost:2181","mapreduce.output.fileoutputformat.compress":"false","yarn.resourcemanager.am-rm-tokens.master-key-rolling-interval-secs":"*********(redacted)","hadoop.ssl.server.conf":"ssl-server.xml","yarn.sharedcache.cleaner.initial-delay-mins":"10","mapreduce.client.completion.pollinterval":"5000","hadoop.ssl.keystores.factory.class":"org.apache.hadoop.security.ssl.FileBasedKeyStoresFactory","yarn.app.mapreduce.am.resource.cpu-vcores":"1","yarn.timeline-service.enabled":"false","yarn.nodemanager.runtime.linux.docker.capabilities":"CHOWN,DAC_OVERRIDE,FSETID,FOWNER,MKNOD,NET_RAW,SETGID,SETUID,SETFCAP,SETPCAP,NET_BIND_SERVICE,SYS_CHROOT,KILL,AUDIT_WRITE","yarn.acl.enable":"false","yarn.timeline-service.entity-group-fs-store.done-dir":"/tmp/entity-file-history/done/","mapreduce.task.profile":"false","yarn.resourcemanager.fs.state-store.uri":"${hadoop.tmp.dir}/yarn/system/rmstore","yarn.nodemanager.linux-container-executor.nonsecure-mode.local-user":"nobody","yarn.resourcemanager.configuration.provider-class":"org.apache.hadoop.yarn.LocalConfigurationProvider","yarn.resourcemanager.configuration.file-system-based-store":"/yarn/conf","yarn.nodemanager.resource.percentage-physical-cpu-limit":"100","mapreduce.jobhistory.client.thread-count":"10","tfile.fs.input.buffer.size":"262144","mapreduce.client.progressmonitor.pollinterval":"1000","yarn.nodemanager.log-dirs":"${yarn.log.dir}/userlogs","fs.automatic.close":"true","fs.s3n.multipart.copy.block.size":"5368709120","yarn.nodemanager.hostname":"0.0.0.0","yarn.resourcemanager.zk-timeout-ms":"10000","ftp.stream-buffer-size":"4096","yarn.fail-fast":"false","hadoop.security.group.mapping.ldap.search.filter.user":"(&(objectClass=user)(sAMAccountName={0}))","yarn.timeline-service.address":"${yarn.timeline-service.hostname}:10200","mapreduce.job.ubertask.maxmaps":"9","fs.s3a.threads.keepalivetime":"60","mapreduce.task.files.preserve.failedtasks":"false","yarn.app.mapreduce.client.job.retry-interval":"2000","ha.failover-controller.graceful-fence.connection.retries":"1","yarn.resourcemanager.delegation.token.max-lifetime":"*********(redacted)","yarn.timeline-service.entity-group-fs-store.summary-store":"org.apache.hadoop.yarn.server.timeline.LeveldbTimelineStore","mapreduce.reduce.cpu.vcores":"1","fs.client.resolve.remote.symlinks":"true","yarn.nodemanager.webapp.https.address":"0.0.0.0:8044","hadoop.http.cross-origin.allowed-origins":"*","yarn.timeline-service.entity-group-fs-store.retain-seconds":"604800","yarn.resourcemanager.metrics.runtime.buckets":"60,300,1440","yarn.timeline-service.generic-application-history.max-applications":"10000","yarn.nodemanager.local-dirs":"${hadoop.tmp.dir}/nm-local-dir","mapreduce.shuffle.connection-keep-alive.enable":"false","yarn.node-labels.configuration-type":"centralized","fs.s3a.path.style.access":"false","yarn.nodemanager.aux-services.mapreduce_shuffle.class":"org.apache.hadoop.mapred.ShuffleHandler","yarn.sharedcache.store.in-memory.staleness-period-mins":"10080","fs.adl.impl":"org.apache.hadoop.fs.adl.AdlFileSystem","yarn.resourcemanager.nodemanager.minimum.version":"NONE","net.topology.impl":"org.apache.hadoop.net.NetworkTopology","io.map.index.skip":"0","yarn.scheduler.maximum-allocation-vcores":"4","hadoop.http.cross-origin.allowed-headers":"X-Requested-With,Content-Type,Accept,Origin","yarn.nodemanager.log-aggregation.compression-type":"none","yarn.timeline-service.version":"1.0f","yarn.ipc.rpc.class":"org.apache.hadoop.yarn.ipc.HadoopYarnProtoRPC","mapreduce.reduce.maxattempts":"4","hadoop.security.dns.log-slow-lookups.enabled":"false","mapreduce.job.committer.setup.cleanup.needed":"true","mapreduce.job.running.reduce.limit":"0","ipc.maximum.response.length":"134217728","mapreduce.job.token.tracking.ids.enabled":"*********(redacted)","hadoop.caller.context.max.size":"128","hadoop.registry.system.acls":"sasl:yarn@, sasl:mapred@, sasl:hdfs@","yarn.nodemanager.recovery.dir":"${hadoop.tmp.dir}/yarn-nm-recovery","fs.s3a.fast.upload.buffer":"disk","mapreduce.jobhistory.intermediate-done-dir":"${yarn.app.mapreduce.am.staging-dir}/history/done_intermediate","yarn.app.mapreduce.shuffle.log.separate":"true","fs.s3a.max.total.tasks":"5","fs.s3a.readahead.range":"64K","hadoop.http.authentication.simple.anonymous.allowed":"true","fs.s3a.fast.upload":"false","fs.s3a.attempts.maximum":"20","hadoop.registry.zk.connection.timeout.ms":"15000","yarn.resourcemanager.delegation-token-renewer.thread-count":"*********(redacted)","yarn.nodemanager.health-checker.script.timeout-ms":"1200000","yarn.timeline-service.leveldb-timeline-store.start-time-write-cache-size":"10000","mapreduce.map.log.level":"INFO","mapreduce.output.fileoutputformat.compress.type":"RECORD","yarn.resourcemanager.leveldb-state-store.path":"${hadoop.tmp.dir}/yarn/system/rmstore","hadoop.registry.rm.enabled":"false","mapreduce.ifile.readahead.bytes":"4194304","yarn.resourcemanager.fs.state-store.retry-policy-spec":"2000, 500","yarn.sharedcache.app-checker.class":"org.apache.hadoop.yarn.server.sharedcachemanager.RemoteAppChecker","yarn.nodemanager.linux-container-executor.nonsecure-mode.limit-users":"true","yarn.nodemanager.resource.detect-hardware-capabilities":"false","mapreduce.cluster.acls.enabled":"false","mapreduce.job.speculative.retry-after-no-speculate":"1000","yarn.resourcemanager.fs.state-store.retry-interval-ms":"1000","file.stream-buffer-size":"4096","mapreduce.map.output.compress.codec":"org.apache.hadoop.io.compress.DefaultCodec","mapreduce.map.speculative":"true","mapreduce.job.speculative.retry-after-speculate":"15000","yarn.nodemanager.linux-container-executor.cgroups.mount":"false","yarn.app.mapreduce.am.container.log.backups":"0","yarn.app.mapreduce.am.log.level":"INFO","mapreduce.job.reduce.slowstart.completedmaps":"0.05","yarn.timeline-service.http-authentication.type":"simple","hadoop.security.group.mapping.ldap.search.attr.group.name":"cn","yarn.timeline-service.client.internal-timers-ttl-secs":"420","fs.s3a.block.size":"32M","yarn.sharedcache.client-server.address":"0.0.0.0:8045","yarn.resourcemanager.hostname":"0.0.0.0","yarn.resourcemanager.delegation.key.update-interval":"86400000","mapreduce.reduce.shuffle.fetch.retry.enabled":"${yarn.nodemanager.recovery.enabled}","mapreduce.map.memory.mb":"1024","mapreduce.task.skip.start.attempts":"2","fs.AbstractFileSystem.hdfs.impl":"org.apache.hadoop.fs.Hdfs","yarn.nodemanager.disk-health-checker.enable":"true","ipc.client.tcpnodelay":"true","ipc.client.rpc-timeout.ms":"0","fs.s3.maxRetries":"4","ipc.client.low-latency":"false","mapreduce.input.lineinputformat.linespermap":"1","ipc.client.connect.max.retries.on.timeouts":"45","yarn.timeline-service.leveldb-timeline-store.read-cache-size":"104857600","fs.AbstractFileSystem.har.impl":"org.apache.hadoop.fs.HarFs","mapreduce.job.split.metainfo.maxsize":"10000000","yarn.am.liveness-monitor.expiry-interval-ms":"600000","yarn.resourcemanager.container-tokens.master-key-rolling-interval-secs":"*********(redacted)","yarn.timeline-service.entity-group-fs-store.app-cache-size":"10","fs.s3a.socket.recv.buffer":"8192","fs.s3n.multipart.uploads.block.size":"67108864","yarn.resourcemanager.resource-tracker.address":"${yarn.resourcemanager.hostname}:8031","yarn.nodemanager.node-labels.provider.fetch-timeout-ms":"1200000","yarn.resourcemanager.leveldb-state-store.compaction-interval-secs":"3600","mapreduce.client.output.filter":"FAILED","hadoop.http.filter.initializers":"org.apache.hadoop.http.lib.StaticUserWebFilter","mapreduce.reduce.memory.mb":"1024","s3native.client-write-packet-size":"65536","yarn.timeline-service.hostname":"0.0.0.0","file.replication":"1","yarn.nodemanager.container-metrics.unregister-delay-ms":"10000","yarn.nodemanager.container-metrics.period-ms":"-1","yarn.nodemanager.log.retain-seconds":"10800","yarn.timeline-service.entity-group-fs-store.cleaner-interval-seconds":"3600","yarn.resourcemanager.keytab":"/etc/krb5.keytab","hadoop.security.group.mapping.providers.combined":"true","mapreduce.reduce.merge.inmem.threshold":"1000","yarn.timeline-service.recovery.enabled":"false","yarn.sharedcache.nm.uploader.thread-count":"20","mapreduce.shuffle.ssl.enabled":"false","yarn.resourcemanager.state-store.max-completed-applications":"${yarn.resourcemanager.max-completed-applications}","mapreduce.job.speculative.minimum-allowed-tasks":"10","yarn.log-aggregation.retain-seconds":"-1","yarn.nodemanager.disk-health-checker.min-free-space-per-disk-mb":"0","mapreduce.jobhistory.max-age-ms":"604800000","hadoop.http.cross-origin.allowed-methods":"GET,POST,HEAD","mapreduce.jobhistory.webapp.address":"0.0.0.0:19888","mapreduce.jobtracker.system.dir":"${hadoop.tmp.dir}/mapred/system","yarn.client.nodemanager-connect.max-wait-ms":"180000","yarn.resourcemanager.webapp.address":"${yarn.resourcemanager.hostname}:8088","mapreduce.jobhistory.recovery.enable":"false","mapreduce.reduce.shuffle.parallelcopies":"5","fs.AbstractFileSystem.webhdfs.impl":"org.apache.hadoop.fs.WebHdfs","fs.trash.interval":"0","yarn.app.mapreduce.client.max-retries":"3","hadoop.security.authentication":"simple","mapreduce.task.profile.reduce.params":"${mapreduce.task.profile.params}","yarn.app.mapreduce.am.resource.mb":"1536","mapreduce.input.fileinputformat.list-status.num-threads":"1","yarn.nodemanager.container-executor.class":"org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor","io.mapfile.bloom.size":"1048576","yarn.timeline-service.ttl-ms":"604800000","yarn.nodemanager.resource.cpu-vcores":"-1","mapreduce.job.reduces":"1","fs.s3a.multipart.size":"100M","yarn.scheduler.minimum-allocation-vcores":"1","mapreduce.job.speculative.speculative-cap-total-tasks":"0.01","hadoop.ssl.client.conf":"ssl-client.xml","mapreduce.job.queuename":"default","ha.health-monitor.sleep-after-disconnect.ms":"1000","s3.bytes-per-checksum":"512","yarn.app.mapreduce.shuffle.log.limit.kb":"0","hadoop.security.group.mapping":"org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback","yarn.client.application-client-protocol.poll-timeout-ms":"-1","mapreduce.jobhistory.jhist.format":"json","yarn.resourcemanager.ha.enabled":"false","hadoop.http.staticuser.user":"dr.who","mapreduce.task.exit.timeout.check-interval-ms":"20000","mapreduce.task.exit.timeout":"60000","yarn.nodemanager.linux-container-executor.resources-handler.class":"org.apache.hadoop.yarn.server.nodemanager.util.DefaultLCEResourcesHandler","mapreduce.reduce.shuffle.memory.limit.percent":"0.25","yarn.resourcemanager.reservation-system.enable":"false","s3.client-write-packet-size":"65536","mapreduce.map.output.compress":"false","ha.zookeeper.acl":"world:anyone:rwcda","ipc.server.max.connections":"0","yarn.scheduler.maximum-allocation-mb":"8192","yarn.resourcemanager.scheduler.monitor.policies":"org.apache.hadoop.yarn.server.resourcemanager.monitor.capacity.ProportionalCapacityPreemptionPolicy","yarn.sharedcache.cleaner.period-mins":"1440","yarn.app.mapreduce.am.container.log.limit.kb":"0","s3native.blocksize":"67108864","ipc.client.connect.retry.interval":"1000","yarn.resourcemanager.zk-state-store.parent-path":"/rmstore","mapreduce.jobhistory.cleaner.enable":"true","yarn.timeline-service.client.fd-flush-interval-secs":"10","hadoop.security.kms.client.encrypted.key.cache.expiry":"43200000","yarn.client.nodemanager-client-async.thread-pool-max-size":"500","mapreduce.map.maxattempts":"4","yarn.nodemanager.sleep-delay-before-sigkill.ms":"250","mapreduce.job.end-notification.retry.attempts":"0","yarn.nodemanager.resource.count-logical-processors-as-cores":"false","yarn.resourcemanager.zk-num-retries":"1000","hadoop.registry.zk.root":"/registry","adl.feature.ownerandgroup.enableupn":"false","mapreduce.job.reduce.shuffle.consumer.plugin.class":"org.apache.hadoop.mapreduce.task.reduce.Shuffle","yarn.resourcemanager.delayed.delegation-token.removal-interval-ms":"*********(redacted)","yarn.nodemanager.localizer.cache.target-size-mb":"10240","ftp.client-write-packet-size":"65536","fs.AbstractFileSystem.adl.impl":"org.apache.hadoop.fs.adl.Adl","yarn.client.failover-retries":"0","fs.s3a.multipart.purge.age":"86400","io.native.lib.available":"true","net.topology.node.switch.mapping.impl":"org.apache.hadoop.net.ScriptBasedMapping","yarn.nodemanager.amrmproxy.address":"0.0.0.0:8048","ipc.server.listen.queue.size":"128","map.sort.class":"org.apache.hadoop.util.QuickSort","fs.viewfs.rename.strategy":"SAME_MOUNTPOINT","hadoop.security.kms.client.authentication.retry-count":"1","fs.permissions.umask-mode":"022","yarn.nodemanager.vmem-check-enabled":"true","yarn.nodemanager.recovery.compaction-interval-secs":"3600","yarn.app.mapreduce.client-am.ipc.max-retries":"3","mapreduce.job.ubertask.maxreduces":"1","hadoop.security.kms.client.encrypted.key.cache.size":"500","hadoop.security.java.secure.random.algorithm":"SHA1PRNG","ha.failover-controller.cli-check.rpc-timeout.ms":"20000","mapreduce.jobhistory.jobname.limit":"50","yarn.client.nodemanager-connect.retry-interval-ms":"10000","yarn.timeline-service.state-store-class":"org.apache.hadoop.yarn.server.timeline.recovery.LeveldbTimelineStateStore","yarn.nodemanager.env-whitelist":"JAVA_HOME,HADOOP_COMMON_HOME,HADOOP_HDFS_HOME,HADOOP_CONF_DIR,CLASSPATH_PREPEND_DISTCACHE,HADOOP_YARN_HOME","yarn.sharedcache.nested-level":"3","yarn.nodemanager.webapp.address":"${yarn.nodemanager.hostname}:8042","rpc.metrics.quantile.enable":"false","mapreduce.jobhistory.admin.acl":"*","yarn.resourcemanager.system-metrics-publisher.dispatcher.pool-size":"10","hadoop.http.authentication.kerberos.keytab":"${user.home}/hadoop.keytab","yarn.resourcemanager.recovery.enabled":"false"},"System Properties":{"java.io.tmpdir":"/tmp","line.separator":"\n","path.separator":":","sun.management.compiler":"HotSpot 64-Bit Tiered Compilers","SPARK_SUBMIT":"true","sun.cpu.endian":"little","java.specification.version":"1.8","java.vm.specification.name":"Java Virtual Machine Specification","java.vendor":"Oracle Corporation","java.vm.specification.version":"1.8","user.home":"/root","file.encoding.pkg":"sun.io","sun.nio.ch.bugLevel":"","sun.arch.data.model":"64","sun.boot.library.path":"/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/lib/amd64","user.dir":"/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8","java.library.path":"/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib","sun.cpu.isalist":"","os.arch":"amd64","java.vm.version":"25.252-b09","jetty.git.hash":"ab228fde9e55e9164c738d7fa121f8ac5acd51c9","java.endorsed.dirs":"/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/lib/endorsed","java.runtime.version":"1.8.0_252-b09","java.vm.info":"mixed mode","java.ext.dirs":"/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/lib/ext:/usr/java/packages/lib/ext","java.runtime.name":"OpenJDK Runtime Environment","file.separator":"/","java.class.version":"52.0","java.specification.name":"Java Platform API Specification","sun.boot.class.path":"/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/lib/resources.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/lib/rt.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/lib/jsse.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/lib/jce.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/lib/charsets.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/lib/jfr.jar:/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/classes","file.encoding":"UTF-8","user.timezone":"Asia/Shanghai","java.specification.vendor":"Oracle Corporation","sun.java.launcher":"SUN_STANDARD","os.version":"3.10.0-1127.10.1.el7.x86_64","sun.os.patch.level":"unknown","java.vm.specification.vendor":"Oracle Corporation","user.country":"US","sun.jnu.encoding":"UTF-8","user.language":"en","java.vendor.url":"http://java.oracle.com/","java.awt.printerjob":"sun.print.PSPrinterJob","java.awt.graphicsenv":"sun.awt.X11GraphicsEnvironment","awt.toolkit":"sun.awt.X11.XToolkit","os.name":"Linux","java.vm.vendor":"Oracle Corporation","java.vendor.url.bug":"http://bugreport.sun.com/bugreport/","user.name":"root","java.vm.name":"OpenJDK 64-Bit Server VM","sun.java.command":"org.apache.spark.deploy.SparkSubmit --master local[*] --conf spark.eventLog.dir=/tmp/spark-history --conf spark.eventLog.enabled=true --conf spark.sql.shuffle.partitions=2 --class org.apache.spark.examples.sql.streaming.StructuredKafkaWordCount ./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar 192.168.130.97:9092 subscribe test5","java.home":"/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre","java.version":"1.8.0_252","sun.io.unicode.encoding":"UnicodeLittle"},"Classpath Entries":{"/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/metrics-graphite-4.1.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/nimbus-jose-jwt-4.41.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-vector-code-gen-2.3.7.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jackson-jaxrs-1.9.13.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jersey-server-2.30.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/pyrolite-4.30.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/conf/":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/json-smart-2.3.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/objenesis-2.5.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-auth-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jsp-api-2.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-unsafe_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-codec-1.10.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/protobuf-java-2.5.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/avro-1.8.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/guice-3.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/aopalliance-repackaged-2.6.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/transaction-api-1.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spire_2.12-0.17.0-M1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/gson-2.2.4.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/datanucleus-rdbms-4.1.19.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jackson-module-paranamer-2.10.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/libfb303-0.9.3.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-cli-1.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-tags_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/scala-library-2.12.10.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/xbean-asm7-shaded-4.15.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jersey-container-servlet-2.30.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hk2-api-2.6.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jakarta.xml.bind-api-2.3.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/okhttp-2.4.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/derby-10.12.1.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jackson-core-asl-1.9.13.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-collections-3.2.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/httpcore-4.4.12.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-beanutils-1.9.4.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spire-util_2.12-0.17.0-M1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-crypto-1.0.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-launcher_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/stax-api-1.0-2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/json4s-ast_2.12-3.6.6.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/lz4-java-1.7.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/scala-parser-combinators_2.12-1.1.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/parquet-format-2.4.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/parquet-column-1.10.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-logging-1.1.3.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/audience-annotations-0.5.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-jdbc-2.3.7.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-hive-thriftserver_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-cli-2.3.7.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/javolution-5.5.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/JLargeArrays-1.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-yarn-api-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/algebra_2.12-2.0.0-M2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-dbcp-1.4.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jakarta.ws.rs-api-2.1.6.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/threeten-extra-1.5.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-io-2.4.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/metrics-json-4.1.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/libthrift-0.12.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/compress-lzf-1.0.3.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/metrics-jmx-4.1.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jakarta.inject-2.6.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/stax-api-1.0.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-shims-common-2.3.7.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/curator-recipes-2.7.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/antlr4-runtime-4.7.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/slf4j-api-1.7.30.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/oro-2.0.8.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/arrow-memory-0.15.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jpam-1.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/velocity-1.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/orc-core-1.5.10.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-sql_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jackson-databind-2.10.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-text-1.6.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jersey-client-2.30.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/htrace-core4-4.0.1-incubating.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/json-1.8.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-graphx_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/avro-ipc-1.8.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/macro-compat_2.12-1.1.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jetty-util-6.1.26.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/core-1.1.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-shims-2.3.7.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/joda-time-2.10.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/parquet-encoding-1.10.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-llap-common-2.3.7.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-network-common_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/datanucleus-api-jdo-4.2.4.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/paranamer-2.8.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-shims-0.23-2.3.7.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/activation-1.1.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/curator-framework-2.7.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-compress-1.8.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-mapreduce-client-common-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/RoaringBitmap-0.7.45.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/ivy-2.4.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jackson-core-2.10.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-yarn-client-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-httpclient-3.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-yarn_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/parquet-common-1.10.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/zstd-jni-1.4.5-2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jersey-container-servlet-core-2.30.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/snappy-java-1.1.7.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/shapeless_2.12-2.3.3.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-pool-1.5.4.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/json4s-core_2.12-3.6.6.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/httpclient-4.5.6.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/api-util-1.0.0-M20.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/aircompressor-0.10.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-repl_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-yarn-common-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/leveldbjni-all-1.8.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jersey-hk2-2.30.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jta-1.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jetty-sslengine-6.1.26.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-net-3.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/datanucleus-core-4.1.17.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-yarn-server-web-proxy-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/breeze_2.12-1.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/orc-mapreduce-1.5.10.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jetty-6.1.26.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-core_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/xz-1.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/javax.inject-1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/scala-compiler-2.12.10.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/metrics-jvm-4.1.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/orc-shims-1.5.10.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jaxb-api-2.2.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jakarta.validation-api-2.0.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spire-macros_2.12-0.17.0-M1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/janino-3.1.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/osgi-resource-locator-1.0.3.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jcl-over-slf4j-1.7.30.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-mapreduce-client-app-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hk2-utils-2.6.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-sketch_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/JTransforms-3.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/kafka-clients-2.4.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/guice-servlet-3.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/okio-1.4.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-annotations-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-math3-3.4.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/json4s-scalap_2.12-3.6.6.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/bonecp-0.8.0.RELEASE.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-streaming_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/accessors-smart-1.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/guava-14.0.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/shims-0.7.45.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/ST4-4.0.4.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jackson-module-scala_2.12-2.10.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/scala-xml_2.12-1.2.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/chill-java-0.9.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-mapreduce-client-shuffle-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/cats-kernel_2.12-2.0.0-M4.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/stream-2.9.6.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-configuration-1.6.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jodd-core-3.5.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/scala-collection-compat_2.12-2.1.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-pool2-2.6.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jul-to-slf4j-1.7.30.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/xmlenc-0.52.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/flatbuffers-java-1.9.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-token-provider-kafka-0-10_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/json4s-jackson_2.12-3.6.6.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-compiler-3.1.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jline-2.14.6.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/breeze-macros_2.12-1.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/kryo-shaded-4.0.2.jar":"System Classpath","spark://iZbp19vpr16ix621sdw476Z:46309/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar":"Added By User","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-common-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-hive_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jersey-common-2.30.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/istack-commons-runtime-3.0.8.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/curator-client-2.7.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jackson-xc-1.9.13.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/zookeeper-3.4.14.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/parquet-hadoop-1.10.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jakarta.annotation-api-1.3.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-shims-scheduler-2.3.7.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/univocity-parsers-2.8.3.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-digester-1.8.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-mllib_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/arpack_combined_all-0.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-sql-kafka-0-10_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jackson-annotations-2.10.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hk2-locator-2.6.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-mapreduce-client-core-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/avro-mapred-1.8.2-hadoop2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-yarn-server-common-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/scala-reflect-2.12.10.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/super-csv-2.2.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-mapreduce-client-jobclient-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-client-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-common-2.3.7.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/apacheds-kerberos-codec-2.0.0-M15.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-exec-2.3.7-core.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/opencsv-2.3.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/api-asn1-api-1.0.0-M20.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-storage-api-2.7.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spire-platform_2.12-0.17.0-M1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/aopalliance-1.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/HikariCP-2.5.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-metastore-2.3.7.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/minlog-1.3.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/arrow-format-0.15.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jsr305-3.0.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-lang-2.6.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/commons-lang3-3.9.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/javax.jdo-3.2.0-m3.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/apacheds-i18n-2.0.0-M15.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/javassist-3.25.0-GA.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jackson-mapper-asl-1.9.13.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/antlr-runtime-3.5.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/log4j-1.2.17.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-beeline-2.3.7.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/chill_2.12-0.9.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jdo-api-3.0.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-kvstore_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/metrics-core-4.1.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jaxb-runtime-2.3.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-mllib-local_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/py4j-0.10.9.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/javax.servlet-api-3.1.0.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hive-serde-2.3.7.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/hadoop-hdfs-client-2.8.5.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-network-shuffle_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jcip-annotations-1.0-1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/jersey-media-jaxb-2.30.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/parquet-jackson-1.10.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/slf4j-log4j12-1.7.30.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/netty-all-4.1.47.Final.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/dropwizard-metrics-hadoop-metrics2-reporter-0.1.2.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/arrow-vector-0.15.1.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/spark-catalyst_2.12-3.1.0-SNAPSHOT.jar":"System Classpath","/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/jars/machinist_2.12-0.6.8.jar":"System Classpath"}} +{"Event":"SparkListenerApplicationStart","App Name":"StructuredKafkaWordCount","App ID":"local-1596020211915","Timestamp":1596020210919,"User":"root"} +{"Event":"org.apache.spark.sql.streaming.StreamingQueryListener$QueryStartedEvent","id":"8d268dc2-bc9c-4be8-97a9-b135d2943028","runId":"e225d92f-2545-48f8-87a2-9c0309580f8a","name":null,"timestamp":"2020-07-29T10:56:55.947Z"} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":0,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 0","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48276}}, {\"test5\":{\"0\":48279}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#142]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = f7faa1e9-69d9-41b4-9d77-919795af2413, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = f7faa1e9-69d9-41b4-9d77-919795af2413, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@27fafcca\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@27fafcca","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 0, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 0, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#66]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":80,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":79,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":76,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":77,"metricType":"timing"},{"name":"peak memory","accumulatorId":75,"metricType":"size"},{"name":"number of output rows","accumulatorId":74,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":78,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":71,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":72,"metricType":"timing"},{"name":"peak memory","accumulatorId":70,"metricType":"size"},{"name":"number of output rows","accumulatorId":69,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":73,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":68,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":20,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":21,"metricType":"nsTiming"},{"name":"records read","accumulatorId":18,"metricType":"sum"},{"name":"local bytes read","accumulatorId":16,"metricType":"size"},{"name":"fetch wait time","accumulatorId":17,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":14,"metricType":"size"},{"name":"local blocks read","accumulatorId":13,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":12,"metricType":"sum"},{"name":"data size","accumulatorId":11,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":15,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":19,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":67,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":64,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":65,"metricType":"timing"},{"name":"peak memory","accumulatorId":63,"metricType":"size"},{"name":"number of output rows","accumulatorId":62,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":66,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":61,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":51,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":52,"metricType":"sum"},{"name":"memory used by state","accumulatorId":57,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":59,"metricType":"sum"},{"name":"number of output rows","accumulatorId":50,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":58,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":60,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":56,"metricType":"timing"},{"name":"time to remove","accumulatorId":55,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":53,"metricType":"sum"},{"name":"time to update","accumulatorId":54,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":47,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":48,"metricType":"timing"},{"name":"peak memory","accumulatorId":46,"metricType":"size"},{"name":"number of output rows","accumulatorId":45,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":49,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":44,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020220179} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":1,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 0","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48276}}, {\"test5\":{\"0\":48279}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#218]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 64a4779b-846a-4f20-9f5c-899a8dbf68d8, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 64a4779b-846a-4f20-9f5c-899a8dbf68d8, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@27fafcca\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@27fafcca","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 0, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 0, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#66]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":80,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":79,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":76,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":77,"metricType":"timing"},{"name":"peak memory","accumulatorId":75,"metricType":"size"},{"name":"number of output rows","accumulatorId":74,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":78,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":71,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":72,"metricType":"timing"},{"name":"peak memory","accumulatorId":70,"metricType":"size"},{"name":"number of output rows","accumulatorId":69,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":73,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":68,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":20,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":21,"metricType":"nsTiming"},{"name":"records read","accumulatorId":18,"metricType":"sum"},{"name":"local bytes read","accumulatorId":16,"metricType":"size"},{"name":"fetch wait time","accumulatorId":17,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":14,"metricType":"size"},{"name":"local blocks read","accumulatorId":13,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":12,"metricType":"sum"},{"name":"data size","accumulatorId":11,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":15,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":19,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":67,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":64,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":65,"metricType":"timing"},{"name":"peak memory","accumulatorId":63,"metricType":"size"},{"name":"number of output rows","accumulatorId":62,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":66,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":61,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":51,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":52,"metricType":"sum"},{"name":"memory used by state","accumulatorId":57,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":59,"metricType":"sum"},{"name":"number of output rows","accumulatorId":50,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":58,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":60,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":56,"metricType":"timing"},{"name":"time to remove","accumulatorId":55,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":53,"metricType":"sum"},{"name":"time to update","accumulatorId":54,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":47,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":48,"metricType":"timing"},{"name":"peak memory","accumulatorId":46,"metricType":"size"},{"name":"number of output rows","accumulatorId":45,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":49,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":44,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020220258} +{"Event":"SparkListenerJobStart","Job ID":0,"Submission Time":1596020221633,"Stage Infos":[{"Stage ID":0,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":6,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"8\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[5],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":3,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"15\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[2],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":1,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"20\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[0],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":2,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"16\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[1],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":5,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"9\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[4],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":4,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"14\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[3],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":0,"Name":"DataSourceRDD","Scope":"{\"id\":\"20\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0},{"Stage ID":1,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":11,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"0\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[10],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":7,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"8\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[6],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":9,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"4\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[8],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":10,"Name":"StateStoreRDD","Scope":"{\"id\":\"3\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[9],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":8,"Name":"StateStoreRDD","Scope":"{\"id\":\"7\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[7],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[0],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0}],"Stage IDs":[0,1],"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 0","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"0","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"1","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":0,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":6,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"8\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[5],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":3,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"15\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[2],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":1,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"20\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[0],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":2,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"16\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[1],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":5,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"9\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[4],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":4,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"14\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[3],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":0,"Name":"DataSourceRDD","Scope":"{\"id\":\"20\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020221656,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 0","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"0","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"1","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":0,"Stage Attempt ID":0,"Task Info":{"Task ID":0,"Index":0,"Attempt":0,"Launch Time":1596020221738,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":0,"Stage Attempt ID":0,"Task Type":"ShuffleMapTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":0,"Index":0,"Attempt":0,"Launch Time":1596020221738,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020222649,"Failed":false,"Killed":false,"Accumulables":[{"ID":21,"Name":"shuffle write time","Update":"9599308","Value":"9599308","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"shuffle records written","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":19,"Name":"shuffle bytes written","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":11,"Name":"data size","Update":"128","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":68,"Name":"duration","Update":"296","Value":"296","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":69,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":70,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":72,"Name":"time in aggregation build","Update":"200","Value":"200","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":74,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":75,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":77,"Name":"time in aggregation build","Update":"190","Value":"190","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":79,"Name":"duration","Update":"336","Value":"336","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":80,"Name":"number of output rows","Update":"3","Value":"3","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":125,"Name":"internal.metrics.input.recordsRead","Update":3,"Value":3,"Internal":true,"Count Failed Values":true},{"ID":123,"Name":"internal.metrics.shuffle.write.writeTime","Update":9599308,"Value":9599308,"Internal":true,"Count Failed Values":true},{"ID":122,"Name":"internal.metrics.shuffle.write.recordsWritten","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":121,"Name":"internal.metrics.shuffle.write.bytesWritten","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":112,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":109,"Name":"internal.metrics.resultSerializationTime","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":108,"Name":"internal.metrics.jvmGCTime","Update":17,"Value":17,"Internal":true,"Count Failed Values":true},{"ID":107,"Name":"internal.metrics.resultSize","Update":2630,"Value":2630,"Internal":true,"Count Failed Values":true},{"ID":106,"Name":"internal.metrics.executorCpuTime","Update":466139164,"Value":466139164,"Internal":true,"Count Failed Values":true},{"ID":105,"Name":"internal.metrics.executorRunTime","Update":503,"Value":503,"Internal":true,"Count Failed Values":true},{"ID":104,"Name":"internal.metrics.executorDeserializeCpuTime","Update":301869581,"Value":301869581,"Internal":true,"Count Failed Values":true},{"ID":103,"Name":"internal.metrics.executorDeserializeTime","Update":361,"Value":361,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":361,"Executor Deserialize CPU Time":301869581,"Executor Run Time":503,"Executor CPU Time":466139164,"Peak Execution Memory":524288,"Result Size":2630,"JVM GC Time":17,"Result Serialization Time":1,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":168,"Shuffle Write Time":9599308,"Shuffle Records Written":1},"Input Metrics":{"Bytes Read":0,"Records Read":3},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":0,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":6,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"8\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[5],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":3,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"15\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[2],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":1,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"20\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[0],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":2,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"16\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[1],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":5,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"9\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[4],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":4,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"14\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[3],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":0,"Name":"DataSourceRDD","Scope":"{\"id\":\"20\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020221656,"Completion Time":1596020222661,"Accumulables":[{"ID":104,"Name":"internal.metrics.executorDeserializeCpuTime","Value":301869581,"Internal":true,"Count Failed Values":true},{"ID":122,"Name":"internal.metrics.shuffle.write.recordsWritten","Value":1,"Internal":true,"Count Failed Values":true},{"ID":77,"Name":"time in aggregation build","Value":"190","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":68,"Name":"duration","Value":"296","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":80,"Name":"number of output rows","Value":"3","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":125,"Name":"internal.metrics.input.recordsRead","Value":3,"Internal":true,"Count Failed Values":true},{"ID":107,"Name":"internal.metrics.resultSize","Value":2630,"Internal":true,"Count Failed Values":true},{"ID":74,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":11,"Name":"data size","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":20,"Name":"shuffle records written","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":106,"Name":"internal.metrics.executorCpuTime","Value":466139164,"Internal":true,"Count Failed Values":true},{"ID":109,"Name":"internal.metrics.resultSerializationTime","Value":1,"Internal":true,"Count Failed Values":true},{"ID":121,"Name":"internal.metrics.shuffle.write.bytesWritten","Value":168,"Internal":true,"Count Failed Values":true},{"ID":112,"Name":"internal.metrics.peakExecutionMemory","Value":524288,"Internal":true,"Count Failed Values":true},{"ID":103,"Name":"internal.metrics.executorDeserializeTime","Value":361,"Internal":true,"Count Failed Values":true},{"ID":79,"Name":"duration","Value":"336","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":70,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":19,"Name":"shuffle bytes written","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":123,"Name":"internal.metrics.shuffle.write.writeTime","Value":9599308,"Internal":true,"Count Failed Values":true},{"ID":105,"Name":"internal.metrics.executorRunTime","Value":503,"Internal":true,"Count Failed Values":true},{"ID":69,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":72,"Name":"time in aggregation build","Value":"200","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":108,"Name":"internal.metrics.jvmGCTime","Value":17,"Internal":true,"Count Failed Values":true},{"ID":21,"Name":"shuffle write time","Value":"9599308","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":75,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"}],"Resource Profile Id":0}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":1,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":11,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"0\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[10],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":7,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"8\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[6],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":9,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"4\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[8],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":10,"Name":"StateStoreRDD","Scope":"{\"id\":\"3\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[9],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":8,"Name":"StateStoreRDD","Scope":"{\"id\":\"7\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[7],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[0],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020222688,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 0","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"0","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"1","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":1,"Index":1,"Attempt":0,"Launch Time":1596020222709,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"NODE_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":1,"Stage Attempt ID":0,"Task Info":{"Task ID":2,"Index":0,"Attempt":0,"Launch Time":1596020222713,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":2,"Index":0,"Attempt":0,"Launch Time":1596020222713,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020222954,"Failed":false,"Killed":false,"Accumulables":[{"ID":44,"Name":"duration","Update":"19","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":46,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":48,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":54,"Name":"time to update","Update":"14","Value":"14","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":55,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":56,"Name":"time to commit changes","Update":"50","Value":"50","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":58,"Name":"estimated size of state only on current version","Update":"64","Value":"64","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":57,"Name":"memory used by state","Update":"208","Value":"208","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":61,"Name":"duration","Update":"14","Value":"14","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":63,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":65,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":145,"Name":"internal.metrics.shuffle.read.recordsRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":144,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":143,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":142,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":141,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":140,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":139,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":137,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":134,"Name":"internal.metrics.resultSerializationTime","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":132,"Name":"internal.metrics.resultSize","Update":5354,"Value":5354,"Internal":true,"Count Failed Values":true},{"ID":131,"Name":"internal.metrics.executorCpuTime","Update":93367533,"Value":93367533,"Internal":true,"Count Failed Values":true},{"ID":130,"Name":"internal.metrics.executorRunTime","Update":203,"Value":203,"Internal":true,"Count Failed Values":true},{"ID":129,"Name":"internal.metrics.executorDeserializeCpuTime","Update":10308753,"Value":10308753,"Internal":true,"Count Failed Values":true},{"ID":128,"Name":"internal.metrics.executorDeserializeTime","Update":23,"Value":23,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":23,"Executor Deserialize CPU Time":10308753,"Executor Run Time":203,"Executor CPU Time":93367533,"Peak Execution Memory":524288,"Result Size":5354,"JVM GC Time":0,"Result Serialization Time":1,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":1,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":1,"Index":1,"Attempt":0,"Launch Time":1596020222709,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"NODE_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020222965,"Failed":false,"Killed":false,"Accumulables":[{"ID":44,"Name":"duration","Update":"33","Value":"52","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"avg hash probe bucket list iters","Update":"10","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":45,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":46,"Name":"peak memory","Update":"4456448","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":48,"Name":"time in aggregation build","Update":"19","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":54,"Name":"time to update","Update":"28","Value":"42","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":53,"Name":"number of updated state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":55,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":56,"Name":"time to commit changes","Update":"31","Value":"81","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":58,"Name":"estimated size of state only on current version","Update":"424","Value":"488","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":50,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":57,"Name":"memory used by state","Update":"568","Value":"776","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":52,"Name":"number of total state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":61,"Name":"duration","Update":"28","Value":"42","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":62,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":63,"Name":"peak memory","Update":"262144","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":65,"Name":"time in aggregation build","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":67,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":13,"Name":"local blocks read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":17,"Name":"fetch wait time","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":16,"Name":"local bytes read","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":18,"Name":"records read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":145,"Name":"internal.metrics.shuffle.read.recordsRead","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":144,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":143,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":142,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":141,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":140,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":139,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":137,"Name":"internal.metrics.peakExecutionMemory","Update":4718592,"Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":132,"Name":"internal.metrics.resultSize","Update":5574,"Value":10928,"Internal":true,"Count Failed Values":true},{"ID":131,"Name":"internal.metrics.executorCpuTime","Update":91355172,"Value":184722705,"Internal":true,"Count Failed Values":true},{"ID":130,"Name":"internal.metrics.executorRunTime","Update":205,"Value":408,"Internal":true,"Count Failed Values":true},{"ID":129,"Name":"internal.metrics.executorDeserializeCpuTime","Update":21029530,"Value":31338283,"Internal":true,"Count Failed Values":true},{"ID":128,"Name":"internal.metrics.executorDeserializeTime","Update":34,"Value":57,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":34,"Executor Deserialize CPU Time":21029530,"Executor Run Time":205,"Executor CPU Time":91355172,"Peak Execution Memory":4718592,"Result Size":5574,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":1,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":168,"Total Records Read":1},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":1,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":11,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"0\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[10],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":7,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"8\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[6],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":9,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"4\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[8],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":10,"Name":"StateStoreRDD","Scope":"{\"id\":\"3\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[9],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":8,"Name":"StateStoreRDD","Scope":"{\"id\":\"7\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[7],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[0],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020222688,"Completion Time":1596020222967,"Accumulables":[{"ID":137,"Name":"internal.metrics.peakExecutionMemory","Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":128,"Name":"internal.metrics.executorDeserializeTime","Value":57,"Internal":true,"Count Failed Values":true},{"ID":131,"Name":"internal.metrics.executorCpuTime","Value":184722705,"Internal":true,"Count Failed Values":true},{"ID":50,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":140,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Value":1,"Internal":true,"Count Failed Values":true},{"ID":53,"Name":"number of updated state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":62,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":17,"Name":"fetch wait time","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":134,"Name":"internal.metrics.resultSerializationTime","Value":1,"Internal":true,"Count Failed Values":true},{"ID":44,"Name":"duration","Value":"52","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":56,"Name":"time to commit changes","Value":"81","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":65,"Name":"time in aggregation build","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":142,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Value":0,"Internal":true,"Count Failed Values":true},{"ID":46,"Name":"peak memory","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":145,"Name":"internal.metrics.shuffle.read.recordsRead","Value":1,"Internal":true,"Count Failed Values":true},{"ID":55,"Name":"time to remove","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":49,"Name":"avg hash probe bucket list iters","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":67,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":139,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Value":0,"Internal":true,"Count Failed Values":true},{"ID":58,"Name":"estimated size of state only on current version","Value":"488","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":13,"Name":"local blocks read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":130,"Name":"internal.metrics.executorRunTime","Value":408,"Internal":true,"Count Failed Values":true},{"ID":16,"Name":"local bytes read","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":52,"Name":"number of total state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":61,"Name":"duration","Value":"42","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":129,"Name":"internal.metrics.executorDeserializeCpuTime","Value":31338283,"Internal":true,"Count Failed Values":true},{"ID":132,"Name":"internal.metrics.resultSize","Value":10928,"Internal":true,"Count Failed Values":true},{"ID":141,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Value":0,"Internal":true,"Count Failed Values":true},{"ID":45,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":63,"Name":"peak memory","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":54,"Name":"time to update","Value":"42","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":144,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Value":0,"Internal":true,"Count Failed Values":true},{"ID":18,"Name":"records read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":57,"Name":"memory used by state","Value":"776","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":48,"Name":"time in aggregation build","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":143,"Name":"internal.metrics.shuffle.read.localBytesRead","Value":168,"Internal":true,"Count Failed Values":true}],"Resource Profile Id":0}} +{"Event":"SparkListenerJobEnd","Job ID":0,"Completion Time":1596020222973,"Job Result":{"Result":"JobSucceeded"}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":2,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 0","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nLocalTableScan (1)\n\n\n(1) LocalTableScan\nOutput [2]: [value#46, count#47]\nArguments: [value#46, count#47]\n\n","sparkPlanInfo":{"nodeName":"LocalTableScan","simpleString":"LocalTableScan [value#46, count#47]","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":153,"metricType":"sum"}]},"time":1596020223028} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":2,"time":1596020223062} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":1,"time":1596020223069} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":0,"time":1596020223069} +{"Event":"org.apache.spark.sql.streaming.StreamingQueryListener$QueryProgressEvent","progress":{"id":"8d268dc2-bc9c-4be8-97a9-b135d2943028","runId":"e225d92f-2545-48f8-87a2-9c0309580f8a","name":null,"timestamp":"2020-07-29T10:56:56.015Z","batchId":0,"batchDuration":7110,"durationMs":{"triggerExecution":7109,"queryPlanning":439,"getBatch":21,"latestOffset":3524,"addBatch":3011,"walCommit":35},"eventTime":{},"stateOperators":[{"numRowsTotal":1,"numRowsUpdated":1,"memoryUsedBytes":776,"numLateInputs":0,"customMetrics":{"stateOnCurrentVersionSizeBytes":488,"loadedMapCacheHitCount":0,"loadedMapCacheMissCount":0}}],"sources":[{"description":"KafkaV2[Subscribe[test5]]","startOffset":null,"endOffset":"{\"test5\":{\"0\":48279}}","numInputRows":3,"inputRowsPerSecond":"NaN","processedRowsPerSecond":0.42194092827004215}],"sink":{"description":"org.apache.spark.sql.execution.streaming.ConsoleTable$@514ba885","numOutputRows":1},"observedMetrics":{}}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":3,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 1","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48279}}, {\"test5\":{\"0\":48642}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#373]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 1fb6b6c6-ced8-4f85-80af-1f3f4c424457, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 1fb6b6c6-ced8-4f85-80af-1f3f4c424457, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@3a1eb73c\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@3a1eb73c","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 1, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 1, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#297]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":237,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":236,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":233,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":234,"metricType":"timing"},{"name":"peak memory","accumulatorId":232,"metricType":"size"},{"name":"number of output rows","accumulatorId":231,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":235,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":228,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":229,"metricType":"timing"},{"name":"peak memory","accumulatorId":227,"metricType":"size"},{"name":"number of output rows","accumulatorId":226,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":230,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":225,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":177,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":178,"metricType":"nsTiming"},{"name":"records read","accumulatorId":175,"metricType":"sum"},{"name":"local bytes read","accumulatorId":173,"metricType":"size"},{"name":"fetch wait time","accumulatorId":174,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":171,"metricType":"size"},{"name":"local blocks read","accumulatorId":170,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":169,"metricType":"sum"},{"name":"data size","accumulatorId":168,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":172,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":176,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":224,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":221,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":222,"metricType":"timing"},{"name":"peak memory","accumulatorId":220,"metricType":"size"},{"name":"number of output rows","accumulatorId":219,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":223,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":218,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":208,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":209,"metricType":"sum"},{"name":"memory used by state","accumulatorId":214,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":216,"metricType":"sum"},{"name":"number of output rows","accumulatorId":207,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":215,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":217,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":213,"metricType":"timing"},{"name":"time to remove","accumulatorId":212,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":210,"metricType":"sum"},{"name":"time to update","accumulatorId":211,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":204,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":205,"metricType":"timing"},{"name":"peak memory","accumulatorId":203,"metricType":"size"},{"name":"number of output rows","accumulatorId":202,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":206,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":201,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020223333} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":4,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 1","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48279}}, {\"test5\":{\"0\":48642}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#449]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 7992c0a8-0641-440d-aaf7-ad453fe25c0a, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 7992c0a8-0641-440d-aaf7-ad453fe25c0a, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@3a1eb73c\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@3a1eb73c","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 1, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 1, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#297]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":237,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":236,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":233,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":234,"metricType":"timing"},{"name":"peak memory","accumulatorId":232,"metricType":"size"},{"name":"number of output rows","accumulatorId":231,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":235,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":228,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":229,"metricType":"timing"},{"name":"peak memory","accumulatorId":227,"metricType":"size"},{"name":"number of output rows","accumulatorId":226,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":230,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":225,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":177,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":178,"metricType":"nsTiming"},{"name":"records read","accumulatorId":175,"metricType":"sum"},{"name":"local bytes read","accumulatorId":173,"metricType":"size"},{"name":"fetch wait time","accumulatorId":174,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":171,"metricType":"size"},{"name":"local blocks read","accumulatorId":170,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":169,"metricType":"sum"},{"name":"data size","accumulatorId":168,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":172,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":176,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":224,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":221,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":222,"metricType":"timing"},{"name":"peak memory","accumulatorId":220,"metricType":"size"},{"name":"number of output rows","accumulatorId":219,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":223,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":218,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":208,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":209,"metricType":"sum"},{"name":"memory used by state","accumulatorId":214,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":216,"metricType":"sum"},{"name":"number of output rows","accumulatorId":207,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":215,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":217,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":213,"metricType":"timing"},{"name":"time to remove","accumulatorId":212,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":210,"metricType":"sum"},{"name":"time to update","accumulatorId":211,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":204,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":205,"metricType":"timing"},{"name":"peak memory","accumulatorId":203,"metricType":"size"},{"name":"number of output rows","accumulatorId":202,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":206,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":201,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020223382} +{"Event":"SparkListenerJobStart","Job ID":1,"Submission Time":1596020223482,"Stage Infos":[{"Stage ID":2,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":18,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"41\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[17],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":12,"Name":"DataSourceRDD","Scope":"{\"id\":\"53\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":13,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"53\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[12],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":15,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"48\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[14],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":14,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"49\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[13],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":16,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"47\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[15],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":17,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"42\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[16],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0},{"Stage ID":3,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":23,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"33\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[22],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":22,"Name":"StateStoreRDD","Scope":"{\"id\":\"36\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[21],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":19,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"41\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[18],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":21,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"37\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[20],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":20,"Name":"StateStoreRDD","Scope":"{\"id\":\"40\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[19],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[2],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0}],"Stage IDs":[2,3],"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 1","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"1","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"4","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":2,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":18,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"41\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[17],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":12,"Name":"DataSourceRDD","Scope":"{\"id\":\"53\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":13,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"53\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[12],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":15,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"48\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[14],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":14,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"49\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[13],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":16,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"47\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[15],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":17,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"42\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[16],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020223485,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 1","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"1","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"4","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":2,"Stage Attempt ID":0,"Task Info":{"Task ID":3,"Index":0,"Attempt":0,"Launch Time":1596020223493,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":2,"Stage Attempt ID":0,"Task Type":"ShuffleMapTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":3,"Index":0,"Attempt":0,"Launch Time":1596020223493,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020223601,"Failed":false,"Killed":false,"Accumulables":[{"ID":178,"Name":"shuffle write time","Update":"837580","Value":"837580","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":177,"Name":"shuffle records written","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":176,"Name":"shuffle bytes written","Update":"169","Value":"169","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":168,"Name":"data size","Update":"128","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":225,"Name":"duration","Update":"84","Value":"84","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":226,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":227,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":229,"Name":"time in aggregation build","Update":"74","Value":"74","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":231,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":232,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":234,"Name":"time in aggregation build","Update":"68","Value":"68","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":236,"Name":"duration","Update":"84","Value":"84","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":237,"Name":"number of output rows","Update":"363","Value":"363","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":282,"Name":"internal.metrics.input.recordsRead","Update":363,"Value":363,"Internal":true,"Count Failed Values":true},{"ID":280,"Name":"internal.metrics.shuffle.write.writeTime","Update":837580,"Value":837580,"Internal":true,"Count Failed Values":true},{"ID":279,"Name":"internal.metrics.shuffle.write.recordsWritten","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":278,"Name":"internal.metrics.shuffle.write.bytesWritten","Update":169,"Value":169,"Internal":true,"Count Failed Values":true},{"ID":269,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":264,"Name":"internal.metrics.resultSize","Update":2544,"Value":2544,"Internal":true,"Count Failed Values":true},{"ID":263,"Name":"internal.metrics.executorCpuTime","Update":95945587,"Value":95945587,"Internal":true,"Count Failed Values":true},{"ID":262,"Name":"internal.metrics.executorRunTime","Update":96,"Value":96,"Internal":true,"Count Failed Values":true},{"ID":261,"Name":"internal.metrics.executorDeserializeCpuTime","Update":7437557,"Value":7437557,"Internal":true,"Count Failed Values":true},{"ID":260,"Name":"internal.metrics.executorDeserializeTime","Update":7,"Value":7,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":7,"Executor Deserialize CPU Time":7437557,"Executor Run Time":96,"Executor CPU Time":95945587,"Peak Execution Memory":524288,"Result Size":2544,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":169,"Shuffle Write Time":837580,"Shuffle Records Written":1},"Input Metrics":{"Bytes Read":0,"Records Read":363},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":2,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":18,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"41\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[17],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":12,"Name":"DataSourceRDD","Scope":"{\"id\":\"53\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":13,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"53\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[12],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":15,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"48\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[14],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":14,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"49\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[13],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":16,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"47\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[15],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":17,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"42\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[16],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020223485,"Completion Time":1596020223603,"Accumulables":[{"ID":227,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":236,"Name":"duration","Value":"84","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":176,"Name":"shuffle bytes written","Value":"169","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":262,"Name":"internal.metrics.executorRunTime","Value":96,"Internal":true,"Count Failed Values":true},{"ID":226,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":280,"Name":"internal.metrics.shuffle.write.writeTime","Value":837580,"Internal":true,"Count Failed Values":true},{"ID":229,"Name":"time in aggregation build","Value":"74","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":232,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":178,"Name":"shuffle write time","Value":"837580","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":225,"Name":"duration","Value":"84","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":261,"Name":"internal.metrics.executorDeserializeCpuTime","Value":7437557,"Internal":true,"Count Failed Values":true},{"ID":279,"Name":"internal.metrics.shuffle.write.recordsWritten","Value":1,"Internal":true,"Count Failed Values":true},{"ID":234,"Name":"time in aggregation build","Value":"68","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":264,"Name":"internal.metrics.resultSize","Value":2544,"Internal":true,"Count Failed Values":true},{"ID":282,"Name":"internal.metrics.input.recordsRead","Value":363,"Internal":true,"Count Failed Values":true},{"ID":237,"Name":"number of output rows","Value":"363","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":177,"Name":"shuffle records written","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":168,"Name":"data size","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":231,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":263,"Name":"internal.metrics.executorCpuTime","Value":95945587,"Internal":true,"Count Failed Values":true},{"ID":260,"Name":"internal.metrics.executorDeserializeTime","Value":7,"Internal":true,"Count Failed Values":true},{"ID":269,"Name":"internal.metrics.peakExecutionMemory","Value":524288,"Internal":true,"Count Failed Values":true},{"ID":278,"Name":"internal.metrics.shuffle.write.bytesWritten","Value":169,"Internal":true,"Count Failed Values":true}],"Resource Profile Id":0}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":3,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":23,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"33\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[22],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":22,"Name":"StateStoreRDD","Scope":"{\"id\":\"36\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[21],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":19,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"41\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[18],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":21,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"37\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[20],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":20,"Name":"StateStoreRDD","Scope":"{\"id\":\"40\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[19],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[2],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020223613,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 1","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"1","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"4","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":3,"Stage Attempt ID":0,"Task Info":{"Task ID":4,"Index":0,"Attempt":0,"Launch Time":1596020223625,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":3,"Stage Attempt ID":0,"Task Info":{"Task ID":5,"Index":1,"Attempt":0,"Launch Time":1596020223626,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":3,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":4,"Index":0,"Attempt":0,"Launch Time":1596020223625,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020223717,"Failed":false,"Killed":false,"Accumulables":[{"ID":201,"Name":"duration","Update":"4","Value":"4","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":203,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":205,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":211,"Name":"time to update","Update":"6","Value":"6","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":212,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":213,"Name":"time to commit changes","Update":"38","Value":"38","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":215,"Name":"estimated size of state only on current version","Update":"88","Value":"88","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":216,"Name":"count of cache hit on states cache in provider","Update":"2","Value":"2","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":214,"Name":"memory used by state","Update":"376","Value":"376","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":218,"Name":"duration","Update":"6","Value":"6","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":220,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":222,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":302,"Name":"internal.metrics.shuffle.read.recordsRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":301,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":300,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":299,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":298,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":297,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":296,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":294,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":289,"Name":"internal.metrics.resultSize","Update":5311,"Value":5311,"Internal":true,"Count Failed Values":true},{"ID":288,"Name":"internal.metrics.executorCpuTime","Update":22954307,"Value":22954307,"Internal":true,"Count Failed Values":true},{"ID":287,"Name":"internal.metrics.executorRunTime","Update":77,"Value":77,"Internal":true,"Count Failed Values":true},{"ID":286,"Name":"internal.metrics.executorDeserializeCpuTime","Update":6627382,"Value":6627382,"Internal":true,"Count Failed Values":true},{"ID":285,"Name":"internal.metrics.executorDeserializeTime","Update":6,"Value":6,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":6,"Executor Deserialize CPU Time":6627382,"Executor Run Time":77,"Executor CPU Time":22954307,"Peak Execution Memory":524288,"Result Size":5311,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":3,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":5,"Index":1,"Attempt":0,"Launch Time":1596020223626,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020223720,"Failed":false,"Killed":false,"Accumulables":[{"ID":201,"Name":"duration","Update":"4","Value":"8","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":206,"Name":"avg hash probe bucket list iters","Update":"10","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":202,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":203,"Name":"peak memory","Update":"4456448","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":205,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":211,"Name":"time to update","Update":"18","Value":"24","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":210,"Name":"number of updated state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":212,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":213,"Name":"time to commit changes","Update":"30","Value":"68","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":215,"Name":"estimated size of state only on current version","Update":"368","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":207,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":216,"Name":"count of cache hit on states cache in provider","Update":"2","Value":"4","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":214,"Name":"memory used by state","Update":"840","Value":"1216","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":209,"Name":"number of total state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":218,"Name":"duration","Update":"19","Value":"25","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":219,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":220,"Name":"peak memory","Update":"262144","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":222,"Name":"time in aggregation build","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":224,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":170,"Name":"local blocks read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":174,"Name":"fetch wait time","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":173,"Name":"local bytes read","Update":"169","Value":"169","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":175,"Name":"records read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":302,"Name":"internal.metrics.shuffle.read.recordsRead","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":301,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":300,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":169,"Value":169,"Internal":true,"Count Failed Values":true},{"ID":299,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":298,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":297,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":296,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":294,"Name":"internal.metrics.peakExecutionMemory","Update":4718592,"Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":289,"Name":"internal.metrics.resultSize","Update":5574,"Value":10885,"Internal":true,"Count Failed Values":true},{"ID":288,"Name":"internal.metrics.executorCpuTime","Update":25907369,"Value":48861676,"Internal":true,"Count Failed Values":true},{"ID":287,"Name":"internal.metrics.executorRunTime","Update":82,"Value":159,"Internal":true,"Count Failed Values":true},{"ID":286,"Name":"internal.metrics.executorDeserializeCpuTime","Update":7573630,"Value":14201012,"Internal":true,"Count Failed Values":true},{"ID":285,"Name":"internal.metrics.executorDeserializeTime","Update":7,"Value":13,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":7,"Executor Deserialize CPU Time":7573630,"Executor Run Time":82,"Executor CPU Time":25907369,"Peak Execution Memory":4718592,"Result Size":5574,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":1,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":169,"Total Records Read":1},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":3,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":23,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"33\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[22],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":22,"Name":"StateStoreRDD","Scope":"{\"id\":\"36\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[21],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":19,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"41\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[18],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":21,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"37\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[20],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":20,"Name":"StateStoreRDD","Scope":"{\"id\":\"40\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[19],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[2],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020223613,"Completion Time":1596020223724,"Accumulables":[{"ID":218,"Name":"duration","Value":"25","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":209,"Name":"number of total state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":173,"Name":"local bytes read","Value":"169","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":286,"Name":"internal.metrics.executorDeserializeCpuTime","Value":14201012,"Internal":true,"Count Failed Values":true},{"ID":298,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Value":0,"Internal":true,"Count Failed Values":true},{"ID":289,"Name":"internal.metrics.resultSize","Value":10885,"Internal":true,"Count Failed Values":true},{"ID":301,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Value":0,"Internal":true,"Count Failed Values":true},{"ID":175,"Name":"records read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":211,"Name":"time to update","Value":"24","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":202,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":220,"Name":"peak memory","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":214,"Name":"memory used by state","Value":"1216","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":205,"Name":"time in aggregation build","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":300,"Name":"internal.metrics.shuffle.read.localBytesRead","Value":169,"Internal":true,"Count Failed Values":true},{"ID":294,"Name":"internal.metrics.peakExecutionMemory","Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":285,"Name":"internal.metrics.executorDeserializeTime","Value":13,"Internal":true,"Count Failed Values":true},{"ID":207,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":297,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Value":1,"Internal":true,"Count Failed Values":true},{"ID":288,"Name":"internal.metrics.executorCpuTime","Value":48861676,"Internal":true,"Count Failed Values":true},{"ID":216,"Name":"count of cache hit on states cache in provider","Value":"4","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":174,"Name":"fetch wait time","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":210,"Name":"number of updated state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":219,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":201,"Name":"duration","Value":"8","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":222,"Name":"time in aggregation build","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":213,"Name":"time to commit changes","Value":"68","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":299,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Value":0,"Internal":true,"Count Failed Values":true},{"ID":302,"Name":"internal.metrics.shuffle.read.recordsRead","Value":1,"Internal":true,"Count Failed Values":true},{"ID":212,"Name":"time to remove","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":203,"Name":"peak memory","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":170,"Name":"local blocks read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":215,"Name":"estimated size of state only on current version","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":287,"Name":"internal.metrics.executorRunTime","Value":159,"Internal":true,"Count Failed Values":true},{"ID":206,"Name":"avg hash probe bucket list iters","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":224,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":296,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Value":0,"Internal":true,"Count Failed Values":true}],"Resource Profile Id":0}} +{"Event":"SparkListenerJobEnd","Job ID":1,"Completion Time":1596020223725,"Job Result":{"Result":"JobSucceeded"}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":5,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 1","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nLocalTableScan (1)\n\n\n(1) LocalTableScan\nOutput [2]: [value#60, count#61]\nArguments: [value#60, count#61]\n\n","sparkPlanInfo":{"nodeName":"LocalTableScan","simpleString":"LocalTableScan [value#60, count#61]","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":310,"metricType":"sum"}]},"time":1596020223752} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":5,"time":1596020223761} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":4,"time":1596020223762} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":3,"time":1596020223762} +{"Event":"org.apache.spark.sql.streaming.StreamingQueryListener$QueryProgressEvent","progress":{"id":"8d268dc2-bc9c-4be8-97a9-b135d2943028","runId":"e225d92f-2545-48f8-87a2-9c0309580f8a","name":null,"timestamp":"2020-07-29T10:57:03.168Z","batchId":1,"batchDuration":622,"durationMs":{"triggerExecution":622,"queryPlanning":47,"getBatch":0,"latestOffset":7,"addBatch":478,"walCommit":59},"eventTime":{},"stateOperators":[{"numRowsTotal":1,"numRowsUpdated":1,"memoryUsedBytes":1216,"numLateInputs":0,"customMetrics":{"stateOnCurrentVersionSizeBytes":456,"loadedMapCacheHitCount":4,"loadedMapCacheMissCount":0}}],"sources":[{"description":"KafkaV2[Subscribe[test5]]","startOffset":"{\"test5\":{\"0\":48279}}","endOffset":"{\"test5\":{\"0\":48642}}","numInputRows":363,"inputRowsPerSecond":50.74793792814204,"processedRowsPerSecond":583.6012861736334}],"sink":{"description":"org.apache.spark.sql.execution.streaming.ConsoleTable$@514ba885","numOutputRows":1},"observedMetrics":{}}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":6,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 2","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48642}}, {\"test5\":{\"0\":48705}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#604]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 39c861a0-0e30-4ca2-b363-495aff0f3f93, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 39c861a0-0e30-4ca2-b363-495aff0f3f93, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@52d6c50a\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@52d6c50a","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 2, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 2, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#528]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":394,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":393,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":390,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":391,"metricType":"timing"},{"name":"peak memory","accumulatorId":389,"metricType":"size"},{"name":"number of output rows","accumulatorId":388,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":392,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":385,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":386,"metricType":"timing"},{"name":"peak memory","accumulatorId":384,"metricType":"size"},{"name":"number of output rows","accumulatorId":383,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":387,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":382,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":334,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":335,"metricType":"nsTiming"},{"name":"records read","accumulatorId":332,"metricType":"sum"},{"name":"local bytes read","accumulatorId":330,"metricType":"size"},{"name":"fetch wait time","accumulatorId":331,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":328,"metricType":"size"},{"name":"local blocks read","accumulatorId":327,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":326,"metricType":"sum"},{"name":"data size","accumulatorId":325,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":329,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":333,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":381,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":378,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":379,"metricType":"timing"},{"name":"peak memory","accumulatorId":377,"metricType":"size"},{"name":"number of output rows","accumulatorId":376,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":380,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":375,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":365,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":366,"metricType":"sum"},{"name":"memory used by state","accumulatorId":371,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":373,"metricType":"sum"},{"name":"number of output rows","accumulatorId":364,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":372,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":374,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":370,"metricType":"timing"},{"name":"time to remove","accumulatorId":369,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":367,"metricType":"sum"},{"name":"time to update","accumulatorId":368,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":361,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":362,"metricType":"timing"},{"name":"peak memory","accumulatorId":360,"metricType":"size"},{"name":"number of output rows","accumulatorId":359,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":363,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":358,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020223909} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":7,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 2","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48642}}, {\"test5\":{\"0\":48705}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#680]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = c2fd3b95-1ba6-4d3e-8b9c-0256dfd90973, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = c2fd3b95-1ba6-4d3e-8b9c-0256dfd90973, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@52d6c50a\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@52d6c50a","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 2, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 2, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#528]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":394,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":393,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":390,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":391,"metricType":"timing"},{"name":"peak memory","accumulatorId":389,"metricType":"size"},{"name":"number of output rows","accumulatorId":388,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":392,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":385,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":386,"metricType":"timing"},{"name":"peak memory","accumulatorId":384,"metricType":"size"},{"name":"number of output rows","accumulatorId":383,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":387,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":382,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":334,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":335,"metricType":"nsTiming"},{"name":"records read","accumulatorId":332,"metricType":"sum"},{"name":"local bytes read","accumulatorId":330,"metricType":"size"},{"name":"fetch wait time","accumulatorId":331,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":328,"metricType":"size"},{"name":"local blocks read","accumulatorId":327,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":326,"metricType":"sum"},{"name":"data size","accumulatorId":325,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":329,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":333,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":381,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":378,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":379,"metricType":"timing"},{"name":"peak memory","accumulatorId":377,"metricType":"size"},{"name":"number of output rows","accumulatorId":376,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":380,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":375,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":365,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":366,"metricType":"sum"},{"name":"memory used by state","accumulatorId":371,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":373,"metricType":"sum"},{"name":"number of output rows","accumulatorId":364,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":372,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":374,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":370,"metricType":"timing"},{"name":"time to remove","accumulatorId":369,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":367,"metricType":"sum"},{"name":"time to update","accumulatorId":368,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":361,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":362,"metricType":"timing"},{"name":"peak memory","accumulatorId":360,"metricType":"size"},{"name":"number of output rows","accumulatorId":359,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":363,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":358,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020224006} +{"Event":"SparkListenerJobStart","Job ID":2,"Submission Time":1596020224100,"Stage Infos":[{"Stage ID":5,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":35,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"66\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[34],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":32,"Name":"StateStoreRDD","Scope":"{\"id\":\"73\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[31],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":34,"Name":"StateStoreRDD","Scope":"{\"id\":\"69\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[33],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":33,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"70\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[32],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":31,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"74\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[30],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[4],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0},{"Stage ID":4,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":30,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"74\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[29],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":27,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"81\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[26],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":29,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"75\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[28],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":28,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"80\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[27],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":26,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"82\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[25],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":24,"Name":"DataSourceRDD","Scope":"{\"id\":\"86\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":25,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"86\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[24],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0}],"Stage IDs":[5,4],"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 2","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"2","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"7","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":4,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":30,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"74\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[29],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":27,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"81\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[26],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":29,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"75\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[28],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":28,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"80\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[27],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":26,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"82\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[25],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":24,"Name":"DataSourceRDD","Scope":"{\"id\":\"86\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":25,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"86\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[24],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020224103,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 2","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"2","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"7","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":4,"Stage Attempt ID":0,"Task Info":{"Task ID":6,"Index":0,"Attempt":0,"Launch Time":1596020224113,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":4,"Stage Attempt ID":0,"Task Type":"ShuffleMapTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":6,"Index":0,"Attempt":0,"Launch Time":1596020224113,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020224174,"Failed":false,"Killed":false,"Accumulables":[{"ID":335,"Name":"shuffle write time","Update":"686296","Value":"686296","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":334,"Name":"shuffle records written","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":333,"Name":"shuffle bytes written","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":325,"Name":"data size","Update":"128","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":382,"Name":"duration","Update":"39","Value":"39","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":383,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":384,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":386,"Name":"time in aggregation build","Update":"32","Value":"32","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":388,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":389,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":391,"Name":"time in aggregation build","Update":"26","Value":"26","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":393,"Name":"duration","Update":"40","Value":"40","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":394,"Name":"number of output rows","Update":"63","Value":"63","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":439,"Name":"internal.metrics.input.recordsRead","Update":63,"Value":63,"Internal":true,"Count Failed Values":true},{"ID":437,"Name":"internal.metrics.shuffle.write.writeTime","Update":686296,"Value":686296,"Internal":true,"Count Failed Values":true},{"ID":436,"Name":"internal.metrics.shuffle.write.recordsWritten","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":435,"Name":"internal.metrics.shuffle.write.bytesWritten","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":426,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":421,"Name":"internal.metrics.resultSize","Update":2544,"Value":2544,"Internal":true,"Count Failed Values":true},{"ID":420,"Name":"internal.metrics.executorCpuTime","Update":33390843,"Value":33390843,"Internal":true,"Count Failed Values":true},{"ID":419,"Name":"internal.metrics.executorRunTime","Update":49,"Value":49,"Internal":true,"Count Failed Values":true},{"ID":418,"Name":"internal.metrics.executorDeserializeCpuTime","Update":4867521,"Value":4867521,"Internal":true,"Count Failed Values":true},{"ID":417,"Name":"internal.metrics.executorDeserializeTime","Update":8,"Value":8,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":8,"Executor Deserialize CPU Time":4867521,"Executor Run Time":49,"Executor CPU Time":33390843,"Peak Execution Memory":524288,"Result Size":2544,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":168,"Shuffle Write Time":686296,"Shuffle Records Written":1},"Input Metrics":{"Bytes Read":0,"Records Read":63},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":4,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":30,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"74\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[29],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":27,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"81\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[26],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":29,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"75\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[28],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":28,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"80\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[27],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":26,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"82\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[25],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":24,"Name":"DataSourceRDD","Scope":"{\"id\":\"86\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":25,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"86\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[24],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020224103,"Completion Time":1596020224175,"Accumulables":[{"ID":436,"Name":"internal.metrics.shuffle.write.recordsWritten","Value":1,"Internal":true,"Count Failed Values":true},{"ID":391,"Name":"time in aggregation build","Value":"26","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":382,"Name":"duration","Value":"39","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":418,"Name":"internal.metrics.executorDeserializeCpuTime","Value":4867521,"Internal":true,"Count Failed Values":true},{"ID":421,"Name":"internal.metrics.resultSize","Value":2544,"Internal":true,"Count Failed Values":true},{"ID":394,"Name":"number of output rows","Value":"63","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":439,"Name":"internal.metrics.input.recordsRead","Value":63,"Internal":true,"Count Failed Values":true},{"ID":388,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":334,"Name":"shuffle records written","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":325,"Name":"data size","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":420,"Name":"internal.metrics.executorCpuTime","Value":33390843,"Internal":true,"Count Failed Values":true},{"ID":426,"Name":"internal.metrics.peakExecutionMemory","Value":524288,"Internal":true,"Count Failed Values":true},{"ID":417,"Name":"internal.metrics.executorDeserializeTime","Value":8,"Internal":true,"Count Failed Values":true},{"ID":435,"Name":"internal.metrics.shuffle.write.bytesWritten","Value":168,"Internal":true,"Count Failed Values":true},{"ID":384,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":393,"Name":"duration","Value":"40","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":333,"Name":"shuffle bytes written","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":383,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":437,"Name":"internal.metrics.shuffle.write.writeTime","Value":686296,"Internal":true,"Count Failed Values":true},{"ID":419,"Name":"internal.metrics.executorRunTime","Value":49,"Internal":true,"Count Failed Values":true},{"ID":386,"Name":"time in aggregation build","Value":"32","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":335,"Name":"shuffle write time","Value":"686296","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":389,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"}],"Resource Profile Id":0}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":5,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":35,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"66\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[34],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":32,"Name":"StateStoreRDD","Scope":"{\"id\":\"73\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[31],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":34,"Name":"StateStoreRDD","Scope":"{\"id\":\"69\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[33],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":33,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"70\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[32],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":31,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"74\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[30],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[4],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020224179,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 2","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"2","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"7","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":5,"Stage Attempt ID":0,"Task Info":{"Task ID":7,"Index":0,"Attempt":0,"Launch Time":1596020224187,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":5,"Stage Attempt ID":0,"Task Info":{"Task ID":8,"Index":1,"Attempt":0,"Launch Time":1596020224187,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":5,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":7,"Index":0,"Attempt":0,"Launch Time":1596020224187,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020224256,"Failed":false,"Killed":false,"Accumulables":[{"ID":358,"Name":"duration","Update":"3","Value":"3","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":360,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":362,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":368,"Name":"time to update","Update":"3","Value":"3","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":369,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":370,"Name":"time to commit changes","Update":"32","Value":"32","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":372,"Name":"estimated size of state only on current version","Update":"88","Value":"88","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":373,"Name":"count of cache hit on states cache in provider","Update":"4","Value":"4","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":371,"Name":"memory used by state","Update":"400","Value":"400","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":375,"Name":"duration","Update":"3","Value":"3","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":377,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":379,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":459,"Name":"internal.metrics.shuffle.read.recordsRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":458,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":457,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":456,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":455,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":454,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":453,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":451,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":446,"Name":"internal.metrics.resultSize","Update":5311,"Value":5311,"Internal":true,"Count Failed Values":true},{"ID":445,"Name":"internal.metrics.executorCpuTime","Update":17230622,"Value":17230622,"Internal":true,"Count Failed Values":true},{"ID":444,"Name":"internal.metrics.executorRunTime","Update":56,"Value":56,"Internal":true,"Count Failed Values":true},{"ID":443,"Name":"internal.metrics.executorDeserializeCpuTime","Update":5948051,"Value":5948051,"Internal":true,"Count Failed Values":true},{"ID":442,"Name":"internal.metrics.executorDeserializeTime","Update":6,"Value":6,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":6,"Executor Deserialize CPU Time":5948051,"Executor Run Time":56,"Executor CPU Time":17230622,"Peak Execution Memory":524288,"Result Size":5311,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":5,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":8,"Index":1,"Attempt":0,"Launch Time":1596020224187,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020224257,"Failed":false,"Killed":false,"Accumulables":[{"ID":358,"Name":"duration","Update":"4","Value":"7","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":363,"Name":"avg hash probe bucket list iters","Update":"10","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":359,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":360,"Name":"peak memory","Update":"4456448","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":362,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":368,"Name":"time to update","Update":"21","Value":"24","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":367,"Name":"number of updated state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":369,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":370,"Name":"time to commit changes","Update":"18","Value":"50","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":372,"Name":"estimated size of state only on current version","Update":"368","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":364,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":373,"Name":"count of cache hit on states cache in provider","Update":"4","Value":"8","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":371,"Name":"memory used by state","Update":"784","Value":"1184","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":366,"Name":"number of total state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":375,"Name":"duration","Update":"22","Value":"25","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":376,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":377,"Name":"peak memory","Update":"262144","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":379,"Name":"time in aggregation build","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":381,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":327,"Name":"local blocks read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":331,"Name":"fetch wait time","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":330,"Name":"local bytes read","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":332,"Name":"records read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":459,"Name":"internal.metrics.shuffle.read.recordsRead","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":458,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":457,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":456,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":455,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":454,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":453,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":451,"Name":"internal.metrics.peakExecutionMemory","Update":4718592,"Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":446,"Name":"internal.metrics.resultSize","Update":5574,"Value":10885,"Internal":true,"Count Failed Values":true},{"ID":445,"Name":"internal.metrics.executorCpuTime","Update":23808555,"Value":41039177,"Internal":true,"Count Failed Values":true},{"ID":444,"Name":"internal.metrics.executorRunTime","Update":56,"Value":112,"Internal":true,"Count Failed Values":true},{"ID":443,"Name":"internal.metrics.executorDeserializeCpuTime","Update":6247106,"Value":12195157,"Internal":true,"Count Failed Values":true},{"ID":442,"Name":"internal.metrics.executorDeserializeTime","Update":6,"Value":12,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":6,"Executor Deserialize CPU Time":6247106,"Executor Run Time":56,"Executor CPU Time":23808555,"Peak Execution Memory":4718592,"Result Size":5574,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":1,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":168,"Total Records Read":1},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":5,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":35,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"66\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[34],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":32,"Name":"StateStoreRDD","Scope":"{\"id\":\"73\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[31],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":34,"Name":"StateStoreRDD","Scope":"{\"id\":\"69\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[33],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":33,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"70\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[32],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":31,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"74\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[30],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[4],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020224179,"Completion Time":1596020224259,"Accumulables":[{"ID":442,"Name":"internal.metrics.executorDeserializeTime","Value":12,"Internal":true,"Count Failed Values":true},{"ID":451,"Name":"internal.metrics.peakExecutionMemory","Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":445,"Name":"internal.metrics.executorCpuTime","Value":41039177,"Internal":true,"Count Failed Values":true},{"ID":364,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":454,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Value":1,"Internal":true,"Count Failed Values":true},{"ID":373,"Name":"count of cache hit on states cache in provider","Value":"8","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":367,"Name":"number of updated state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":376,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":358,"Name":"duration","Value":"7","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":331,"Name":"fetch wait time","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":457,"Name":"internal.metrics.shuffle.read.localBytesRead","Value":168,"Internal":true,"Count Failed Values":true},{"ID":379,"Name":"time in aggregation build","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":370,"Name":"time to commit changes","Value":"50","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":456,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Value":0,"Internal":true,"Count Failed Values":true},{"ID":369,"Name":"time to remove","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":459,"Name":"internal.metrics.shuffle.read.recordsRead","Value":1,"Internal":true,"Count Failed Values":true},{"ID":360,"Name":"peak memory","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":381,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":453,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Value":0,"Internal":true,"Count Failed Values":true},{"ID":372,"Name":"estimated size of state only on current version","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":363,"Name":"avg hash probe bucket list iters","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":327,"Name":"local blocks read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":444,"Name":"internal.metrics.executorRunTime","Value":112,"Internal":true,"Count Failed Values":true},{"ID":375,"Name":"duration","Value":"25","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":366,"Name":"number of total state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":330,"Name":"local bytes read","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":443,"Name":"internal.metrics.executorDeserializeCpuTime","Value":12195157,"Internal":true,"Count Failed Values":true},{"ID":455,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Value":0,"Internal":true,"Count Failed Values":true},{"ID":446,"Name":"internal.metrics.resultSize","Value":10885,"Internal":true,"Count Failed Values":true},{"ID":332,"Name":"records read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":377,"Name":"peak memory","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":359,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":458,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Value":0,"Internal":true,"Count Failed Values":true},{"ID":368,"Name":"time to update","Value":"24","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":362,"Name":"time in aggregation build","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":371,"Name":"memory used by state","Value":"1184","Internal":true,"Count Failed Values":true,"Metadata":"sql"}],"Resource Profile Id":0}} +{"Event":"SparkListenerJobEnd","Job ID":2,"Completion Time":1596020224259,"Job Result":{"Result":"JobSucceeded"}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":8,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 2","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nLocalTableScan (1)\n\n\n(1) LocalTableScan\nOutput [2]: [value#74, count#75]\nArguments: [value#74, count#75]\n\n","sparkPlanInfo":{"nodeName":"LocalTableScan","simpleString":"LocalTableScan [value#74, count#75]","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":467,"metricType":"sum"}]},"time":1596020224278} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":8,"time":1596020224287} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":7,"time":1596020224287} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":6,"time":1596020224288} +{"Event":"org.apache.spark.sql.streaming.StreamingQueryListener$QueryProgressEvent","progress":{"id":"8d268dc2-bc9c-4be8-97a9-b135d2943028","runId":"e225d92f-2545-48f8-87a2-9c0309580f8a","name":null,"timestamp":"2020-07-29T10:57:03.793Z","batchId":2,"batchDuration":522,"durationMs":{"triggerExecution":522,"queryPlanning":41,"getBatch":1,"latestOffset":3,"addBatch":421,"walCommit":27},"eventTime":{},"stateOperators":[{"numRowsTotal":1,"numRowsUpdated":1,"memoryUsedBytes":1184,"numLateInputs":0,"customMetrics":{"stateOnCurrentVersionSizeBytes":456,"loadedMapCacheHitCount":8,"loadedMapCacheMissCount":0}}],"sources":[{"description":"KafkaV2[Subscribe[test5]]","startOffset":"{\"test5\":{\"0\":48642}}","endOffset":"{\"test5\":{\"0\":48705}}","numInputRows":63,"inputRowsPerSecond":100.8,"processedRowsPerSecond":120.6896551724138}],"sink":{"description":"org.apache.spark.sql.execution.streaming.ConsoleTable$@514ba885","numOutputRows":1},"observedMetrics":{}}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":9,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 3","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48705}}, {\"test5\":{\"0\":48757}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#835]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 8bb5d8a6-42f8-4141-8f25-e1b98f81aac4, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 8bb5d8a6-42f8-4141-8f25-e1b98f81aac4, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@59b7c509\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@59b7c509","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 3, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 3, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#759]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":551,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":550,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":547,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":548,"metricType":"timing"},{"name":"peak memory","accumulatorId":546,"metricType":"size"},{"name":"number of output rows","accumulatorId":545,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":549,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":542,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":543,"metricType":"timing"},{"name":"peak memory","accumulatorId":541,"metricType":"size"},{"name":"number of output rows","accumulatorId":540,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":544,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":539,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":491,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":492,"metricType":"nsTiming"},{"name":"records read","accumulatorId":489,"metricType":"sum"},{"name":"local bytes read","accumulatorId":487,"metricType":"size"},{"name":"fetch wait time","accumulatorId":488,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":485,"metricType":"size"},{"name":"local blocks read","accumulatorId":484,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":483,"metricType":"sum"},{"name":"data size","accumulatorId":482,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":486,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":490,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":538,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":535,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":536,"metricType":"timing"},{"name":"peak memory","accumulatorId":534,"metricType":"size"},{"name":"number of output rows","accumulatorId":533,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":537,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":532,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":522,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":523,"metricType":"sum"},{"name":"memory used by state","accumulatorId":528,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":530,"metricType":"sum"},{"name":"number of output rows","accumulatorId":521,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":529,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":531,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":527,"metricType":"timing"},{"name":"time to remove","accumulatorId":526,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":524,"metricType":"sum"},{"name":"time to update","accumulatorId":525,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":518,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":519,"metricType":"timing"},{"name":"peak memory","accumulatorId":517,"metricType":"size"},{"name":"number of output rows","accumulatorId":516,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":520,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":515,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020224419} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":10,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 3","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48705}}, {\"test5\":{\"0\":48757}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#911]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 29402d2a-a5da-4bb1-8d1a-c6d1c2d998d5, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 29402d2a-a5da-4bb1-8d1a-c6d1c2d998d5, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@59b7c509\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@59b7c509","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 3, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 3, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#759]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":551,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":550,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":547,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":548,"metricType":"timing"},{"name":"peak memory","accumulatorId":546,"metricType":"size"},{"name":"number of output rows","accumulatorId":545,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":549,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":542,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":543,"metricType":"timing"},{"name":"peak memory","accumulatorId":541,"metricType":"size"},{"name":"number of output rows","accumulatorId":540,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":544,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":539,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":491,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":492,"metricType":"nsTiming"},{"name":"records read","accumulatorId":489,"metricType":"sum"},{"name":"local bytes read","accumulatorId":487,"metricType":"size"},{"name":"fetch wait time","accumulatorId":488,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":485,"metricType":"size"},{"name":"local blocks read","accumulatorId":484,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":483,"metricType":"sum"},{"name":"data size","accumulatorId":482,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":486,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":490,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":538,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":535,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":536,"metricType":"timing"},{"name":"peak memory","accumulatorId":534,"metricType":"size"},{"name":"number of output rows","accumulatorId":533,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":537,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":532,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":522,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":523,"metricType":"sum"},{"name":"memory used by state","accumulatorId":528,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":530,"metricType":"sum"},{"name":"number of output rows","accumulatorId":521,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":529,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":531,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":527,"metricType":"timing"},{"name":"time to remove","accumulatorId":526,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":524,"metricType":"sum"},{"name":"time to update","accumulatorId":525,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":518,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":519,"metricType":"timing"},{"name":"peak memory","accumulatorId":517,"metricType":"size"},{"name":"number of output rows","accumulatorId":516,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":520,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":515,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020224452} +{"Event":"SparkListenerJobStart","Job ID":3,"Submission Time":1596020224533,"Stage Infos":[{"Stage ID":6,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":42,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"107\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[41],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":38,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"115\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[37],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":36,"Name":"DataSourceRDD","Scope":"{\"id\":\"119\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":41,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"108\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[40],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":37,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"119\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[36],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":40,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"113\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[39],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":39,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"114\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[38],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0},{"Stage ID":7,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":47,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"99\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[46],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":46,"Name":"StateStoreRDD","Scope":"{\"id\":\"102\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[45],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":45,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"103\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[44],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":44,"Name":"StateStoreRDD","Scope":"{\"id\":\"106\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[43],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":43,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"107\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[42],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[6],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0}],"Stage IDs":[6,7],"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 3","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"3","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"10","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":6,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":42,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"107\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[41],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":38,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"115\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[37],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":36,"Name":"DataSourceRDD","Scope":"{\"id\":\"119\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":41,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"108\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[40],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":37,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"119\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[36],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":40,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"113\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[39],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":39,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"114\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[38],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020224535,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 3","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"3","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"10","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":6,"Stage Attempt ID":0,"Task Info":{"Task ID":9,"Index":0,"Attempt":0,"Launch Time":1596020224541,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":6,"Stage Attempt ID":0,"Task Type":"ShuffleMapTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":9,"Index":0,"Attempt":0,"Launch Time":1596020224541,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020224581,"Failed":false,"Killed":false,"Accumulables":[{"ID":492,"Name":"shuffle write time","Update":"643278","Value":"643278","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":491,"Name":"shuffle records written","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":490,"Name":"shuffle bytes written","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":482,"Name":"data size","Update":"128","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":539,"Name":"duration","Update":"20","Value":"20","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":540,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":541,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":543,"Name":"time in aggregation build","Update":"13","Value":"13","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":545,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":546,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":548,"Name":"time in aggregation build","Update":"9","Value":"9","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":550,"Name":"duration","Update":"20","Value":"20","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":551,"Name":"number of output rows","Update":"52","Value":"52","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":596,"Name":"internal.metrics.input.recordsRead","Update":52,"Value":52,"Internal":true,"Count Failed Values":true},{"ID":594,"Name":"internal.metrics.shuffle.write.writeTime","Update":643278,"Value":643278,"Internal":true,"Count Failed Values":true},{"ID":593,"Name":"internal.metrics.shuffle.write.recordsWritten","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":592,"Name":"internal.metrics.shuffle.write.bytesWritten","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":583,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":578,"Name":"internal.metrics.resultSize","Update":2544,"Value":2544,"Internal":true,"Count Failed Values":true},{"ID":577,"Name":"internal.metrics.executorCpuTime","Update":29099071,"Value":29099071,"Internal":true,"Count Failed Values":true},{"ID":576,"Name":"internal.metrics.executorRunTime","Update":29,"Value":29,"Internal":true,"Count Failed Values":true},{"ID":575,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3091128,"Value":3091128,"Internal":true,"Count Failed Values":true},{"ID":574,"Name":"internal.metrics.executorDeserializeTime","Update":3,"Value":3,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":3,"Executor Deserialize CPU Time":3091128,"Executor Run Time":29,"Executor CPU Time":29099071,"Peak Execution Memory":524288,"Result Size":2544,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":168,"Shuffle Write Time":643278,"Shuffle Records Written":1},"Input Metrics":{"Bytes Read":0,"Records Read":52},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":6,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":42,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"107\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[41],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":38,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"115\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[37],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":36,"Name":"DataSourceRDD","Scope":"{\"id\":\"119\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":41,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"108\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[40],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":37,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"119\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[36],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":40,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"113\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[39],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":39,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"114\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[38],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020224535,"Completion Time":1596020224582,"Accumulables":[{"ID":550,"Name":"duration","Value":"20","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":541,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":577,"Name":"internal.metrics.executorCpuTime","Value":29099071,"Internal":true,"Count Failed Values":true},{"ID":490,"Name":"shuffle bytes written","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":576,"Name":"internal.metrics.executorRunTime","Value":29,"Internal":true,"Count Failed Values":true},{"ID":540,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":594,"Name":"internal.metrics.shuffle.write.writeTime","Value":643278,"Internal":true,"Count Failed Values":true},{"ID":543,"Name":"time in aggregation build","Value":"13","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":492,"Name":"shuffle write time","Value":"643278","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":546,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":539,"Name":"duration","Value":"20","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":575,"Name":"internal.metrics.executorDeserializeCpuTime","Value":3091128,"Internal":true,"Count Failed Values":true},{"ID":593,"Name":"internal.metrics.shuffle.write.recordsWritten","Value":1,"Internal":true,"Count Failed Values":true},{"ID":548,"Name":"time in aggregation build","Value":"9","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":578,"Name":"internal.metrics.resultSize","Value":2544,"Internal":true,"Count Failed Values":true},{"ID":596,"Name":"internal.metrics.input.recordsRead","Value":52,"Internal":true,"Count Failed Values":true},{"ID":551,"Name":"number of output rows","Value":"52","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":482,"Name":"data size","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":491,"Name":"shuffle records written","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":545,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":592,"Name":"internal.metrics.shuffle.write.bytesWritten","Value":168,"Internal":true,"Count Failed Values":true},{"ID":574,"Name":"internal.metrics.executorDeserializeTime","Value":3,"Internal":true,"Count Failed Values":true},{"ID":583,"Name":"internal.metrics.peakExecutionMemory","Value":524288,"Internal":true,"Count Failed Values":true}],"Resource Profile Id":0}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":7,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":47,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"99\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[46],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":46,"Name":"StateStoreRDD","Scope":"{\"id\":\"102\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[45],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":45,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"103\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[44],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":44,"Name":"StateStoreRDD","Scope":"{\"id\":\"106\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[43],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":43,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"107\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[42],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[6],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020224588,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 3","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"3","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"10","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":7,"Stage Attempt ID":0,"Task Info":{"Task ID":10,"Index":0,"Attempt":0,"Launch Time":1596020224596,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":7,"Stage Attempt ID":0,"Task Info":{"Task ID":11,"Index":1,"Attempt":0,"Launch Time":1596020224597,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":7,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":10,"Index":0,"Attempt":0,"Launch Time":1596020224596,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020224670,"Failed":false,"Killed":false,"Accumulables":[{"ID":515,"Name":"duration","Update":"3","Value":"3","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":517,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":519,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":525,"Name":"time to update","Update":"5","Value":"5","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":526,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":527,"Name":"time to commit changes","Update":"27","Value":"27","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":529,"Name":"estimated size of state only on current version","Update":"88","Value":"88","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":530,"Name":"count of cache hit on states cache in provider","Update":"6","Value":"6","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":528,"Name":"memory used by state","Update":"400","Value":"400","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":532,"Name":"duration","Update":"5","Value":"5","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":534,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":536,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":616,"Name":"internal.metrics.shuffle.read.recordsRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":615,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":614,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":613,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":612,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":611,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":610,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":608,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":603,"Name":"internal.metrics.resultSize","Update":5311,"Value":5311,"Internal":true,"Count Failed Values":true},{"ID":602,"Name":"internal.metrics.executorCpuTime","Update":19967906,"Value":19967906,"Internal":true,"Count Failed Values":true},{"ID":601,"Name":"internal.metrics.executorRunTime","Update":62,"Value":62,"Internal":true,"Count Failed Values":true},{"ID":600,"Name":"internal.metrics.executorDeserializeCpuTime","Update":4899567,"Value":4899567,"Internal":true,"Count Failed Values":true},{"ID":599,"Name":"internal.metrics.executorDeserializeTime","Update":4,"Value":4,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":4,"Executor Deserialize CPU Time":4899567,"Executor Run Time":62,"Executor CPU Time":19967906,"Peak Execution Memory":524288,"Result Size":5311,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":7,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":11,"Index":1,"Attempt":0,"Launch Time":1596020224597,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020224687,"Failed":false,"Killed":false,"Accumulables":[{"ID":515,"Name":"duration","Update":"4","Value":"7","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":520,"Name":"avg hash probe bucket list iters","Update":"10","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":516,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":517,"Name":"peak memory","Update":"4456448","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":519,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":525,"Name":"time to update","Update":"17","Value":"22","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":524,"Name":"number of updated state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":526,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":527,"Name":"time to commit changes","Update":"26","Value":"53","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":529,"Name":"estimated size of state only on current version","Update":"368","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":521,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":530,"Name":"count of cache hit on states cache in provider","Update":"6","Value":"12","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":528,"Name":"memory used by state","Update":"784","Value":"1184","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":523,"Name":"number of total state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":532,"Name":"duration","Update":"17","Value":"22","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":533,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":534,"Name":"peak memory","Update":"262144","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":536,"Name":"time in aggregation build","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":538,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":484,"Name":"local blocks read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":488,"Name":"fetch wait time","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":487,"Name":"local bytes read","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":489,"Name":"records read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":616,"Name":"internal.metrics.shuffle.read.recordsRead","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":615,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":614,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":613,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":612,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":611,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":610,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":608,"Name":"internal.metrics.peakExecutionMemory","Update":4718592,"Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":603,"Name":"internal.metrics.resultSize","Update":5574,"Value":10885,"Internal":true,"Count Failed Values":true},{"ID":602,"Name":"internal.metrics.executorCpuTime","Update":22402538,"Value":42370444,"Internal":true,"Count Failed Values":true},{"ID":601,"Name":"internal.metrics.executorRunTime","Update":79,"Value":141,"Internal":true,"Count Failed Values":true},{"ID":600,"Name":"internal.metrics.executorDeserializeCpuTime","Update":4671511,"Value":9571078,"Internal":true,"Count Failed Values":true},{"ID":599,"Name":"internal.metrics.executorDeserializeTime","Update":4,"Value":8,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":4,"Executor Deserialize CPU Time":4671511,"Executor Run Time":79,"Executor CPU Time":22402538,"Peak Execution Memory":4718592,"Result Size":5574,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":1,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":168,"Total Records Read":1},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":7,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":47,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"99\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[46],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":46,"Name":"StateStoreRDD","Scope":"{\"id\":\"102\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[45],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":45,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"103\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[44],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":44,"Name":"StateStoreRDD","Scope":"{\"id\":\"106\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[43],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":43,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"107\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[42],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[6],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020224588,"Completion Time":1596020224688,"Accumulables":[{"ID":523,"Name":"number of total state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":532,"Name":"duration","Value":"22","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":487,"Name":"local bytes read","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":517,"Name":"peak memory","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":600,"Name":"internal.metrics.executorDeserializeCpuTime","Value":9571078,"Internal":true,"Count Failed Values":true},{"ID":603,"Name":"internal.metrics.resultSize","Value":10885,"Internal":true,"Count Failed Values":true},{"ID":612,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Value":0,"Internal":true,"Count Failed Values":true},{"ID":516,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":615,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Value":0,"Internal":true,"Count Failed Values":true},{"ID":534,"Name":"peak memory","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":525,"Name":"time to update","Value":"22","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":489,"Name":"records read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":528,"Name":"memory used by state","Value":"1184","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":519,"Name":"time in aggregation build","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":608,"Name":"internal.metrics.peakExecutionMemory","Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":599,"Name":"internal.metrics.executorDeserializeTime","Value":8,"Internal":true,"Count Failed Values":true},{"ID":521,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":530,"Name":"count of cache hit on states cache in provider","Value":"12","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":611,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Value":1,"Internal":true,"Count Failed Values":true},{"ID":602,"Name":"internal.metrics.executorCpuTime","Value":42370444,"Internal":true,"Count Failed Values":true},{"ID":488,"Name":"fetch wait time","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":515,"Name":"duration","Value":"7","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":524,"Name":"number of updated state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":533,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":614,"Name":"internal.metrics.shuffle.read.localBytesRead","Value":168,"Internal":true,"Count Failed Values":true},{"ID":536,"Name":"time in aggregation build","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":527,"Name":"time to commit changes","Value":"53","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":613,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Value":0,"Internal":true,"Count Failed Values":true},{"ID":616,"Name":"internal.metrics.shuffle.read.recordsRead","Value":1,"Internal":true,"Count Failed Values":true},{"ID":526,"Name":"time to remove","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":520,"Name":"avg hash probe bucket list iters","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":610,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Value":0,"Internal":true,"Count Failed Values":true},{"ID":601,"Name":"internal.metrics.executorRunTime","Value":141,"Internal":true,"Count Failed Values":true},{"ID":484,"Name":"local blocks read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":538,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":529,"Name":"estimated size of state only on current version","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"}],"Resource Profile Id":0}} +{"Event":"SparkListenerJobEnd","Job ID":3,"Completion Time":1596020224689,"Job Result":{"Result":"JobSucceeded"}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":11,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 3","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nLocalTableScan (1)\n\n\n(1) LocalTableScan\nOutput [2]: [value#88, count#89]\nArguments: [value#88, count#89]\n\n","sparkPlanInfo":{"nodeName":"LocalTableScan","simpleString":"LocalTableScan [value#88, count#89]","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":624,"metricType":"sum"}]},"time":1596020224709} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":11,"time":1596020224713} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":10,"time":1596020224714} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":9,"time":1596020224714} +{"Event":"org.apache.spark.sql.streaming.StreamingQueryListener$QueryProgressEvent","progress":{"id":"8d268dc2-bc9c-4be8-97a9-b135d2943028","runId":"e225d92f-2545-48f8-87a2-9c0309580f8a","name":null,"timestamp":"2020-07-29T10:57:04.317Z","batchId":3,"batchDuration":415,"durationMs":{"triggerExecution":415,"queryPlanning":38,"getBatch":1,"latestOffset":3,"addBatch":332,"walCommit":21},"eventTime":{},"stateOperators":[{"numRowsTotal":1,"numRowsUpdated":1,"memoryUsedBytes":1184,"numLateInputs":0,"customMetrics":{"stateOnCurrentVersionSizeBytes":456,"loadedMapCacheHitCount":12,"loadedMapCacheMissCount":0}}],"sources":[{"description":"KafkaV2[Subscribe[test5]]","startOffset":"{\"test5\":{\"0\":48705}}","endOffset":"{\"test5\":{\"0\":48757}}","numInputRows":52,"inputRowsPerSecond":99.23664122137404,"processedRowsPerSecond":125.30120481927712}],"sink":{"description":"org.apache.spark.sql.execution.streaming.ConsoleTable$@514ba885","numOutputRows":1},"observedMetrics":{}}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":12,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 4","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48757}}, {\"test5\":{\"0\":48799}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#1066]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 42efe357-12ef-4061-9b83-20bf4c29a257, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 42efe357-12ef-4061-9b83-20bf4c29a257, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@1717338b\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@1717338b","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 4, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 4, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#990]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":708,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":707,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":704,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":705,"metricType":"timing"},{"name":"peak memory","accumulatorId":703,"metricType":"size"},{"name":"number of output rows","accumulatorId":702,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":706,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":699,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":700,"metricType":"timing"},{"name":"peak memory","accumulatorId":698,"metricType":"size"},{"name":"number of output rows","accumulatorId":697,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":701,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":696,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":648,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":649,"metricType":"nsTiming"},{"name":"records read","accumulatorId":646,"metricType":"sum"},{"name":"local bytes read","accumulatorId":644,"metricType":"size"},{"name":"fetch wait time","accumulatorId":645,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":642,"metricType":"size"},{"name":"local blocks read","accumulatorId":641,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":640,"metricType":"sum"},{"name":"data size","accumulatorId":639,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":643,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":647,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":695,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":692,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":693,"metricType":"timing"},{"name":"peak memory","accumulatorId":691,"metricType":"size"},{"name":"number of output rows","accumulatorId":690,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":694,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":689,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":679,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":680,"metricType":"sum"},{"name":"memory used by state","accumulatorId":685,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":687,"metricType":"sum"},{"name":"number of output rows","accumulatorId":678,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":686,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":688,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":684,"metricType":"timing"},{"name":"time to remove","accumulatorId":683,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":681,"metricType":"sum"},{"name":"time to update","accumulatorId":682,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":675,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":676,"metricType":"timing"},{"name":"peak memory","accumulatorId":674,"metricType":"size"},{"name":"number of output rows","accumulatorId":673,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":677,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":672,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020224817} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":13,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 4","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48757}}, {\"test5\":{\"0\":48799}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#1142]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 6fa28bd2-2924-4e01-8bbe-128888d2669b, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 6fa28bd2-2924-4e01-8bbe-128888d2669b, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@1717338b\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@1717338b","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 4, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 4, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#990]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":708,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":707,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":704,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":705,"metricType":"timing"},{"name":"peak memory","accumulatorId":703,"metricType":"size"},{"name":"number of output rows","accumulatorId":702,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":706,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":699,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":700,"metricType":"timing"},{"name":"peak memory","accumulatorId":698,"metricType":"size"},{"name":"number of output rows","accumulatorId":697,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":701,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":696,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":648,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":649,"metricType":"nsTiming"},{"name":"records read","accumulatorId":646,"metricType":"sum"},{"name":"local bytes read","accumulatorId":644,"metricType":"size"},{"name":"fetch wait time","accumulatorId":645,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":642,"metricType":"size"},{"name":"local blocks read","accumulatorId":641,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":640,"metricType":"sum"},{"name":"data size","accumulatorId":639,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":643,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":647,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":695,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":692,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":693,"metricType":"timing"},{"name":"peak memory","accumulatorId":691,"metricType":"size"},{"name":"number of output rows","accumulatorId":690,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":694,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":689,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":679,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":680,"metricType":"sum"},{"name":"memory used by state","accumulatorId":685,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":687,"metricType":"sum"},{"name":"number of output rows","accumulatorId":678,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":686,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":688,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":684,"metricType":"timing"},{"name":"time to remove","accumulatorId":683,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":681,"metricType":"sum"},{"name":"time to update","accumulatorId":682,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":675,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":676,"metricType":"timing"},{"name":"peak memory","accumulatorId":674,"metricType":"size"},{"name":"number of output rows","accumulatorId":673,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":677,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":672,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020224849} +{"Event":"SparkListenerJobStart","Job ID":4,"Submission Time":1596020224928,"Stage Infos":[{"Stage ID":9,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":59,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"132\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[58],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":55,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"140\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[54],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":56,"Name":"StateStoreRDD","Scope":"{\"id\":\"139\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[55],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":57,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"136\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[56],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":58,"Name":"StateStoreRDD","Scope":"{\"id\":\"135\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[57],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[8],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0},{"Stage ID":8,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":54,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"140\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[53],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":53,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"141\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[52],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":51,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"147\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[50],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":49,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"152\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[48],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":52,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"146\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[51],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":50,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"148\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[49],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":48,"Name":"DataSourceRDD","Scope":"{\"id\":\"152\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0}],"Stage IDs":[9,8],"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 4","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"4","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"13","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":8,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":54,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"140\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[53],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":53,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"141\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[52],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":51,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"147\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[50],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":49,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"152\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[48],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":52,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"146\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[51],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":50,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"148\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[49],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":48,"Name":"DataSourceRDD","Scope":"{\"id\":\"152\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020224929,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 4","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"4","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"13","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":8,"Stage Attempt ID":0,"Task Info":{"Task ID":12,"Index":0,"Attempt":0,"Launch Time":1596020224941,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":8,"Stage Attempt ID":0,"Task Type":"ShuffleMapTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":12,"Index":0,"Attempt":0,"Launch Time":1596020224941,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020224979,"Failed":false,"Killed":false,"Accumulables":[{"ID":649,"Name":"shuffle write time","Update":"572754","Value":"572754","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":648,"Name":"shuffle records written","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":647,"Name":"shuffle bytes written","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":639,"Name":"data size","Update":"128","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":696,"Name":"duration","Update":"19","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":697,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":698,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":700,"Name":"time in aggregation build","Update":"13","Value":"13","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":702,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":703,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":705,"Name":"time in aggregation build","Update":"9","Value":"9","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":707,"Name":"duration","Update":"19","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":708,"Name":"number of output rows","Update":"42","Value":"42","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":753,"Name":"internal.metrics.input.recordsRead","Update":42,"Value":42,"Internal":true,"Count Failed Values":true},{"ID":751,"Name":"internal.metrics.shuffle.write.writeTime","Update":572754,"Value":572754,"Internal":true,"Count Failed Values":true},{"ID":750,"Name":"internal.metrics.shuffle.write.recordsWritten","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":749,"Name":"internal.metrics.shuffle.write.bytesWritten","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":740,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":735,"Name":"internal.metrics.resultSize","Update":2544,"Value":2544,"Internal":true,"Count Failed Values":true},{"ID":734,"Name":"internal.metrics.executorCpuTime","Update":27800373,"Value":27800373,"Internal":true,"Count Failed Values":true},{"ID":733,"Name":"internal.metrics.executorRunTime","Update":28,"Value":28,"Internal":true,"Count Failed Values":true},{"ID":732,"Name":"internal.metrics.executorDeserializeCpuTime","Update":4768103,"Value":4768103,"Internal":true,"Count Failed Values":true},{"ID":731,"Name":"internal.metrics.executorDeserializeTime","Update":4,"Value":4,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":4,"Executor Deserialize CPU Time":4768103,"Executor Run Time":28,"Executor CPU Time":27800373,"Peak Execution Memory":524288,"Result Size":2544,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":168,"Shuffle Write Time":572754,"Shuffle Records Written":1},"Input Metrics":{"Bytes Read":0,"Records Read":42},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":8,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":54,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"140\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[53],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":53,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"141\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[52],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":51,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"147\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[50],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":49,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"152\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[48],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":52,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"146\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[51],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":50,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"148\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[49],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":48,"Name":"DataSourceRDD","Scope":"{\"id\":\"152\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020224929,"Completion Time":1596020224979,"Accumulables":[{"ID":732,"Name":"internal.metrics.executorDeserializeCpuTime","Value":4768103,"Internal":true,"Count Failed Values":true},{"ID":696,"Name":"duration","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":750,"Name":"internal.metrics.shuffle.write.recordsWritten","Value":1,"Internal":true,"Count Failed Values":true},{"ID":705,"Name":"time in aggregation build","Value":"9","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":735,"Name":"internal.metrics.resultSize","Value":2544,"Internal":true,"Count Failed Values":true},{"ID":708,"Name":"number of output rows","Value":"42","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":753,"Name":"internal.metrics.input.recordsRead","Value":42,"Internal":true,"Count Failed Values":true},{"ID":648,"Name":"shuffle records written","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":639,"Name":"data size","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":702,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":740,"Name":"internal.metrics.peakExecutionMemory","Value":524288,"Internal":true,"Count Failed Values":true},{"ID":731,"Name":"internal.metrics.executorDeserializeTime","Value":4,"Internal":true,"Count Failed Values":true},{"ID":749,"Name":"internal.metrics.shuffle.write.bytesWritten","Value":168,"Internal":true,"Count Failed Values":true},{"ID":698,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":734,"Name":"internal.metrics.executorCpuTime","Value":27800373,"Internal":true,"Count Failed Values":true},{"ID":707,"Name":"duration","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":647,"Name":"shuffle bytes written","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":733,"Name":"internal.metrics.executorRunTime","Value":28,"Internal":true,"Count Failed Values":true},{"ID":697,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":751,"Name":"internal.metrics.shuffle.write.writeTime","Value":572754,"Internal":true,"Count Failed Values":true},{"ID":700,"Name":"time in aggregation build","Value":"13","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":649,"Name":"shuffle write time","Value":"572754","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":703,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"}],"Resource Profile Id":0}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":9,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":59,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"132\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[58],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":55,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"140\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[54],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":56,"Name":"StateStoreRDD","Scope":"{\"id\":\"139\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[55],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":57,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"136\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[56],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":58,"Name":"StateStoreRDD","Scope":"{\"id\":\"135\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[57],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[8],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020224987,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 4","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"4","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"13","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":9,"Stage Attempt ID":0,"Task Info":{"Task ID":13,"Index":0,"Attempt":0,"Launch Time":1596020224994,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":9,"Stage Attempt ID":0,"Task Info":{"Task ID":14,"Index":1,"Attempt":0,"Launch Time":1596020224994,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":9,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":14,"Index":1,"Attempt":0,"Launch Time":1596020224994,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020225056,"Failed":false,"Killed":false,"Accumulables":[{"ID":672,"Name":"duration","Update":"3","Value":"3","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":677,"Name":"avg hash probe bucket list iters","Update":"10","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":673,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":674,"Name":"peak memory","Update":"4456448","Value":"4456448","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":676,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":682,"Name":"time to update","Update":"19","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":681,"Name":"number of updated state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":683,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":684,"Name":"time to commit changes","Update":"11","Value":"11","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":686,"Name":"estimated size of state only on current version","Update":"368","Value":"368","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":678,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":687,"Name":"count of cache hit on states cache in provider","Update":"8","Value":"8","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":685,"Name":"memory used by state","Update":"784","Value":"784","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":680,"Name":"number of total state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":689,"Name":"duration","Update":"19","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":690,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":691,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":693,"Name":"time in aggregation build","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":695,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":641,"Name":"local blocks read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":645,"Name":"fetch wait time","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":644,"Name":"local bytes read","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":646,"Name":"records read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":773,"Name":"internal.metrics.shuffle.read.recordsRead","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":772,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":771,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":770,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":769,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":768,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":767,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":765,"Name":"internal.metrics.peakExecutionMemory","Update":4718592,"Value":4718592,"Internal":true,"Count Failed Values":true},{"ID":760,"Name":"internal.metrics.resultSize","Update":5574,"Value":5574,"Internal":true,"Count Failed Values":true},{"ID":759,"Name":"internal.metrics.executorCpuTime","Update":19548688,"Value":19548688,"Internal":true,"Count Failed Values":true},{"ID":758,"Name":"internal.metrics.executorRunTime","Update":52,"Value":52,"Internal":true,"Count Failed Values":true},{"ID":757,"Name":"internal.metrics.executorDeserializeCpuTime","Update":5622533,"Value":5622533,"Internal":true,"Count Failed Values":true},{"ID":756,"Name":"internal.metrics.executorDeserializeTime","Update":5,"Value":5,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":5,"Executor Deserialize CPU Time":5622533,"Executor Run Time":52,"Executor CPU Time":19548688,"Peak Execution Memory":4718592,"Result Size":5574,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":1,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":168,"Total Records Read":1},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":9,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":13,"Index":0,"Attempt":0,"Launch Time":1596020224994,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020225058,"Failed":false,"Killed":false,"Accumulables":[{"ID":672,"Name":"duration","Update":"2","Value":"5","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":674,"Name":"peak memory","Update":"262144","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":676,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":682,"Name":"time to update","Update":"4","Value":"23","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":683,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":684,"Name":"time to commit changes","Update":"35","Value":"46","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":686,"Name":"estimated size of state only on current version","Update":"88","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":687,"Name":"count of cache hit on states cache in provider","Update":"8","Value":"16","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":685,"Name":"memory used by state","Update":"400","Value":"1184","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":689,"Name":"duration","Update":"4","Value":"23","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":691,"Name":"peak memory","Update":"262144","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":693,"Name":"time in aggregation build","Update":"0","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":773,"Name":"internal.metrics.shuffle.read.recordsRead","Update":0,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":772,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":771,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":0,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":770,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":769,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":768,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":0,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":767,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":765,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":760,"Name":"internal.metrics.resultSize","Update":5311,"Value":10885,"Internal":true,"Count Failed Values":true},{"ID":759,"Name":"internal.metrics.executorCpuTime","Update":16813539,"Value":36362227,"Internal":true,"Count Failed Values":true},{"ID":758,"Name":"internal.metrics.executorRunTime","Update":55,"Value":107,"Internal":true,"Count Failed Values":true},{"ID":757,"Name":"internal.metrics.executorDeserializeCpuTime","Update":4322992,"Value":9945525,"Internal":true,"Count Failed Values":true},{"ID":756,"Name":"internal.metrics.executorDeserializeTime","Update":4,"Value":9,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":4,"Executor Deserialize CPU Time":4322992,"Executor Run Time":55,"Executor CPU Time":16813539,"Peak Execution Memory":524288,"Result Size":5311,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":9,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":59,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"132\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[58],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":55,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"140\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[54],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":56,"Name":"StateStoreRDD","Scope":"{\"id\":\"139\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[55],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":57,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"136\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[56],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":58,"Name":"StateStoreRDD","Scope":"{\"id\":\"135\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[57],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[8],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020224987,"Completion Time":1596020225059,"Accumulables":[{"ID":765,"Name":"internal.metrics.peakExecutionMemory","Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":756,"Name":"internal.metrics.executorDeserializeTime","Value":9,"Internal":true,"Count Failed Values":true},{"ID":678,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":759,"Name":"internal.metrics.executorCpuTime","Value":36362227,"Internal":true,"Count Failed Values":true},{"ID":768,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Value":1,"Internal":true,"Count Failed Values":true},{"ID":687,"Name":"count of cache hit on states cache in provider","Value":"16","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":681,"Name":"number of updated state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":771,"Name":"internal.metrics.shuffle.read.localBytesRead","Value":168,"Internal":true,"Count Failed Values":true},{"ID":690,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":672,"Name":"duration","Value":"5","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":645,"Name":"fetch wait time","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":684,"Name":"time to commit changes","Value":"46","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":693,"Name":"time in aggregation build","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":770,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Value":0,"Internal":true,"Count Failed Values":true},{"ID":683,"Name":"time to remove","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":773,"Name":"internal.metrics.shuffle.read.recordsRead","Value":1,"Internal":true,"Count Failed Values":true},{"ID":686,"Name":"estimated size of state only on current version","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":695,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":677,"Name":"avg hash probe bucket list iters","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":767,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Value":0,"Internal":true,"Count Failed Values":true},{"ID":641,"Name":"local blocks read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":758,"Name":"internal.metrics.executorRunTime","Value":107,"Internal":true,"Count Failed Values":true},{"ID":644,"Name":"local bytes read","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":680,"Name":"number of total state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":689,"Name":"duration","Value":"23","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":674,"Name":"peak memory","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":757,"Name":"internal.metrics.executorDeserializeCpuTime","Value":9945525,"Internal":true,"Count Failed Values":true},{"ID":769,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Value":0,"Internal":true,"Count Failed Values":true},{"ID":760,"Name":"internal.metrics.resultSize","Value":10885,"Internal":true,"Count Failed Values":true},{"ID":772,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Value":0,"Internal":true,"Count Failed Values":true},{"ID":646,"Name":"records read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":682,"Name":"time to update","Value":"23","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":691,"Name":"peak memory","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":673,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":676,"Name":"time in aggregation build","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":685,"Name":"memory used by state","Value":"1184","Internal":true,"Count Failed Values":true,"Metadata":"sql"}],"Resource Profile Id":0}} +{"Event":"SparkListenerJobEnd","Job ID":4,"Completion Time":1596020225059,"Job Result":{"Result":"JobSucceeded"}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":14,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 4","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nLocalTableScan (1)\n\n\n(1) LocalTableScan\nOutput [2]: [value#102, count#103]\nArguments: [value#102, count#103]\n\n","sparkPlanInfo":{"nodeName":"LocalTableScan","simpleString":"LocalTableScan [value#102, count#103]","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":781,"metricType":"sum"}]},"time":1596020225079} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":14,"time":1596020225087} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":13,"time":1596020225087} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":12,"time":1596020225087} +{"Event":"org.apache.spark.sql.streaming.StreamingQueryListener$QueryProgressEvent","progress":{"id":"8d268dc2-bc9c-4be8-97a9-b135d2943028","runId":"e225d92f-2545-48f8-87a2-9c0309580f8a","name":null,"timestamp":"2020-07-29T10:57:04.734Z","batchId":4,"batchDuration":387,"durationMs":{"triggerExecution":387,"queryPlanning":30,"getBatch":1,"latestOffset":3,"addBatch":306,"walCommit":12},"eventTime":{},"stateOperators":[{"numRowsTotal":1,"numRowsUpdated":1,"memoryUsedBytes":1184,"numLateInputs":0,"customMetrics":{"stateOnCurrentVersionSizeBytes":456,"loadedMapCacheHitCount":16,"loadedMapCacheMissCount":0}}],"sources":[{"description":"KafkaV2[Subscribe[test5]]","startOffset":"{\"test5\":{\"0\":48757}}","endOffset":"{\"test5\":{\"0\":48799}}","numInputRows":42,"inputRowsPerSecond":100.71942446043165,"processedRowsPerSecond":108.52713178294573}],"sink":{"description":"org.apache.spark.sql.execution.streaming.ConsoleTable$@514ba885","numOutputRows":1},"observedMetrics":{}}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":15,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 5","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48799}}, {\"test5\":{\"0\":48837}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#1297]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 9579cc6c-8827-43f7-9678-7747602e493e, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 9579cc6c-8827-43f7-9678-7747602e493e, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@2c214312\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@2c214312","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 5, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 5, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#1221]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":865,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":864,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":861,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":862,"metricType":"timing"},{"name":"peak memory","accumulatorId":860,"metricType":"size"},{"name":"number of output rows","accumulatorId":859,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":863,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":856,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":857,"metricType":"timing"},{"name":"peak memory","accumulatorId":855,"metricType":"size"},{"name":"number of output rows","accumulatorId":854,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":858,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":853,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":805,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":806,"metricType":"nsTiming"},{"name":"records read","accumulatorId":803,"metricType":"sum"},{"name":"local bytes read","accumulatorId":801,"metricType":"size"},{"name":"fetch wait time","accumulatorId":802,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":799,"metricType":"size"},{"name":"local blocks read","accumulatorId":798,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":797,"metricType":"sum"},{"name":"data size","accumulatorId":796,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":800,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":804,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":852,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":849,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":850,"metricType":"timing"},{"name":"peak memory","accumulatorId":848,"metricType":"size"},{"name":"number of output rows","accumulatorId":847,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":851,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":846,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":836,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":837,"metricType":"sum"},{"name":"memory used by state","accumulatorId":842,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":844,"metricType":"sum"},{"name":"number of output rows","accumulatorId":835,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":843,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":845,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":841,"metricType":"timing"},{"name":"time to remove","accumulatorId":840,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":838,"metricType":"sum"},{"name":"time to update","accumulatorId":839,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":832,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":833,"metricType":"timing"},{"name":"peak memory","accumulatorId":831,"metricType":"size"},{"name":"number of output rows","accumulatorId":830,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":834,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":829,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020225211} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":16,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 5","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48799}}, {\"test5\":{\"0\":48837}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#1373]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = b800d96e-7584-4e8d-8df8-c9b901b7f2e2, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = b800d96e-7584-4e8d-8df8-c9b901b7f2e2, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@2c214312\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@2c214312","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 5, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 5, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#1221]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":865,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":864,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":861,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":862,"metricType":"timing"},{"name":"peak memory","accumulatorId":860,"metricType":"size"},{"name":"number of output rows","accumulatorId":859,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":863,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":856,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":857,"metricType":"timing"},{"name":"peak memory","accumulatorId":855,"metricType":"size"},{"name":"number of output rows","accumulatorId":854,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":858,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":853,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":805,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":806,"metricType":"nsTiming"},{"name":"records read","accumulatorId":803,"metricType":"sum"},{"name":"local bytes read","accumulatorId":801,"metricType":"size"},{"name":"fetch wait time","accumulatorId":802,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":799,"metricType":"size"},{"name":"local blocks read","accumulatorId":798,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":797,"metricType":"sum"},{"name":"data size","accumulatorId":796,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":800,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":804,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":852,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":849,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":850,"metricType":"timing"},{"name":"peak memory","accumulatorId":848,"metricType":"size"},{"name":"number of output rows","accumulatorId":847,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":851,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":846,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":836,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":837,"metricType":"sum"},{"name":"memory used by state","accumulatorId":842,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":844,"metricType":"sum"},{"name":"number of output rows","accumulatorId":835,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":843,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":845,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":841,"metricType":"timing"},{"name":"time to remove","accumulatorId":840,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":838,"metricType":"sum"},{"name":"time to update","accumulatorId":839,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":832,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":833,"metricType":"timing"},{"name":"peak memory","accumulatorId":831,"metricType":"size"},{"name":"number of output rows","accumulatorId":830,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":834,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":829,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020225270} +{"Event":"SparkListenerJobStart","Job ID":5,"Submission Time":1596020225342,"Stage Infos":[{"Stage ID":10,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":66,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"173\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[65],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":62,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"181\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[61],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":64,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"179\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[63],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":61,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"185\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[60],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":65,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"174\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[64],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":60,"Name":"DataSourceRDD","Scope":"{\"id\":\"185\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":63,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"180\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[62],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0},{"Stage ID":11,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":71,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"165\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[70],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":70,"Name":"StateStoreRDD","Scope":"{\"id\":\"168\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[69],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":69,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"169\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[68],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":67,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"173\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[66],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":68,"Name":"StateStoreRDD","Scope":"{\"id\":\"172\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[67],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[10],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0}],"Stage IDs":[10,11],"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 5","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"5","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"16","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":10,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":66,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"173\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[65],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":62,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"181\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[61],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":64,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"179\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[63],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":61,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"185\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[60],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":65,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"174\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[64],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":60,"Name":"DataSourceRDD","Scope":"{\"id\":\"185\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":63,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"180\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[62],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020225343,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 5","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"5","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"16","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":10,"Stage Attempt ID":0,"Task Info":{"Task ID":15,"Index":0,"Attempt":0,"Launch Time":1596020225359,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":10,"Stage Attempt ID":0,"Task Type":"ShuffleMapTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":15,"Index":0,"Attempt":0,"Launch Time":1596020225359,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020225400,"Failed":false,"Killed":false,"Accumulables":[{"ID":806,"Name":"shuffle write time","Update":"530930","Value":"530930","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":805,"Name":"shuffle records written","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":804,"Name":"shuffle bytes written","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":796,"Name":"data size","Update":"128","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":853,"Name":"duration","Update":"21","Value":"21","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":854,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":855,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":857,"Name":"time in aggregation build","Update":"14","Value":"14","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":859,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":860,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":862,"Name":"time in aggregation build","Update":"9","Value":"9","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":864,"Name":"duration","Update":"21","Value":"21","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":865,"Name":"number of output rows","Update":"38","Value":"38","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":910,"Name":"internal.metrics.input.recordsRead","Update":38,"Value":38,"Internal":true,"Count Failed Values":true},{"ID":908,"Name":"internal.metrics.shuffle.write.writeTime","Update":530930,"Value":530930,"Internal":true,"Count Failed Values":true},{"ID":907,"Name":"internal.metrics.shuffle.write.recordsWritten","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":906,"Name":"internal.metrics.shuffle.write.bytesWritten","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":897,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":892,"Name":"internal.metrics.resultSize","Update":2544,"Value":2544,"Internal":true,"Count Failed Values":true},{"ID":891,"Name":"internal.metrics.executorCpuTime","Update":22440089,"Value":22440089,"Internal":true,"Count Failed Values":true},{"ID":890,"Name":"internal.metrics.executorRunTime","Update":29,"Value":29,"Internal":true,"Count Failed Values":true},{"ID":889,"Name":"internal.metrics.executorDeserializeCpuTime","Update":6808170,"Value":6808170,"Internal":true,"Count Failed Values":true},{"ID":888,"Name":"internal.metrics.executorDeserializeTime","Update":6,"Value":6,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":6,"Executor Deserialize CPU Time":6808170,"Executor Run Time":29,"Executor CPU Time":22440089,"Peak Execution Memory":524288,"Result Size":2544,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":168,"Shuffle Write Time":530930,"Shuffle Records Written":1},"Input Metrics":{"Bytes Read":0,"Records Read":38},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":10,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":66,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"173\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[65],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":62,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"181\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[61],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":64,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"179\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[63],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":61,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"185\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[60],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":65,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"174\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[64],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":60,"Name":"DataSourceRDD","Scope":"{\"id\":\"185\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":63,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"180\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[62],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020225343,"Completion Time":1596020225401,"Accumulables":[{"ID":855,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":891,"Name":"internal.metrics.executorCpuTime","Value":22440089,"Internal":true,"Count Failed Values":true},{"ID":864,"Name":"duration","Value":"21","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":804,"Name":"shuffle bytes written","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":908,"Name":"internal.metrics.shuffle.write.writeTime","Value":530930,"Internal":true,"Count Failed Values":true},{"ID":890,"Name":"internal.metrics.executorRunTime","Value":29,"Internal":true,"Count Failed Values":true},{"ID":857,"Name":"time in aggregation build","Value":"14","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":860,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":806,"Name":"shuffle write time","Value":"530930","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":854,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":853,"Name":"duration","Value":"21","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":862,"Name":"time in aggregation build","Value":"9","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":889,"Name":"internal.metrics.executorDeserializeCpuTime","Value":6808170,"Internal":true,"Count Failed Values":true},{"ID":907,"Name":"internal.metrics.shuffle.write.recordsWritten","Value":1,"Internal":true,"Count Failed Values":true},{"ID":892,"Name":"internal.metrics.resultSize","Value":2544,"Internal":true,"Count Failed Values":true},{"ID":910,"Name":"internal.metrics.input.recordsRead","Value":38,"Internal":true,"Count Failed Values":true},{"ID":865,"Name":"number of output rows","Value":"38","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":805,"Name":"shuffle records written","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":796,"Name":"data size","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":859,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":888,"Name":"internal.metrics.executorDeserializeTime","Value":6,"Internal":true,"Count Failed Values":true},{"ID":897,"Name":"internal.metrics.peakExecutionMemory","Value":524288,"Internal":true,"Count Failed Values":true},{"ID":906,"Name":"internal.metrics.shuffle.write.bytesWritten","Value":168,"Internal":true,"Count Failed Values":true}],"Resource Profile Id":0}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":11,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":71,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"165\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[70],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":70,"Name":"StateStoreRDD","Scope":"{\"id\":\"168\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[69],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":69,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"169\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[68],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":67,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"173\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[66],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":68,"Name":"StateStoreRDD","Scope":"{\"id\":\"172\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[67],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[10],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020225410,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 5","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"5","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"16","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":11,"Stage Attempt ID":0,"Task Info":{"Task ID":16,"Index":0,"Attempt":0,"Launch Time":1596020225417,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":11,"Stage Attempt ID":0,"Task Info":{"Task ID":17,"Index":1,"Attempt":0,"Launch Time":1596020225417,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":11,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":17,"Index":1,"Attempt":0,"Launch Time":1596020225417,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020225498,"Failed":false,"Killed":false,"Accumulables":[{"ID":829,"Name":"duration","Update":"3","Value":"3","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":834,"Name":"avg hash probe bucket list iters","Update":"10","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":830,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":831,"Name":"peak memory","Update":"4456448","Value":"4456448","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":833,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":839,"Name":"time to update","Update":"11","Value":"11","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":838,"Name":"number of updated state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":840,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":841,"Name":"time to commit changes","Update":"37","Value":"37","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":843,"Name":"estimated size of state only on current version","Update":"368","Value":"368","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":835,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":844,"Name":"count of cache hit on states cache in provider","Update":"10","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":842,"Name":"memory used by state","Update":"784","Value":"784","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":837,"Name":"number of total state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":846,"Name":"duration","Update":"11","Value":"11","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":847,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":848,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":850,"Name":"time in aggregation build","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":852,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":798,"Name":"local blocks read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":802,"Name":"fetch wait time","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":801,"Name":"local bytes read","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":803,"Name":"records read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":930,"Name":"internal.metrics.shuffle.read.recordsRead","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":929,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":928,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":927,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":926,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":925,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":924,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":922,"Name":"internal.metrics.peakExecutionMemory","Update":4718592,"Value":4718592,"Internal":true,"Count Failed Values":true},{"ID":917,"Name":"internal.metrics.resultSize","Update":5574,"Value":5574,"Internal":true,"Count Failed Values":true},{"ID":916,"Name":"internal.metrics.executorCpuTime","Update":17945299,"Value":17945299,"Internal":true,"Count Failed Values":true},{"ID":915,"Name":"internal.metrics.executorRunTime","Update":68,"Value":68,"Internal":true,"Count Failed Values":true},{"ID":914,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3451032,"Value":3451032,"Internal":true,"Count Failed Values":true},{"ID":913,"Name":"internal.metrics.executorDeserializeTime","Update":3,"Value":3,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":3,"Executor Deserialize CPU Time":3451032,"Executor Run Time":68,"Executor CPU Time":17945299,"Peak Execution Memory":4718592,"Result Size":5574,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":1,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":168,"Total Records Read":1},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":11,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":16,"Index":0,"Attempt":0,"Launch Time":1596020225417,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020225509,"Failed":false,"Killed":false,"Accumulables":[{"ID":829,"Name":"duration","Update":"2","Value":"5","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":831,"Name":"peak memory","Update":"262144","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":833,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":839,"Name":"time to update","Update":"4","Value":"15","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":840,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":841,"Name":"time to commit changes","Update":"50","Value":"87","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":843,"Name":"estimated size of state only on current version","Update":"88","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":844,"Name":"count of cache hit on states cache in provider","Update":"10","Value":"20","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":842,"Name":"memory used by state","Update":"400","Value":"1184","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":846,"Name":"duration","Update":"4","Value":"15","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":848,"Name":"peak memory","Update":"262144","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":850,"Name":"time in aggregation build","Update":"0","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":930,"Name":"internal.metrics.shuffle.read.recordsRead","Update":0,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":929,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":928,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":0,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":927,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":926,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":925,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":0,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":924,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":922,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":917,"Name":"internal.metrics.resultSize","Update":5311,"Value":10885,"Internal":true,"Count Failed Values":true},{"ID":916,"Name":"internal.metrics.executorCpuTime","Update":15599091,"Value":33544390,"Internal":true,"Count Failed Values":true},{"ID":915,"Name":"internal.metrics.executorRunTime","Update":84,"Value":152,"Internal":true,"Count Failed Values":true},{"ID":914,"Name":"internal.metrics.executorDeserializeCpuTime","Update":4357806,"Value":7808838,"Internal":true,"Count Failed Values":true},{"ID":913,"Name":"internal.metrics.executorDeserializeTime","Update":4,"Value":7,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":4,"Executor Deserialize CPU Time":4357806,"Executor Run Time":84,"Executor CPU Time":15599091,"Peak Execution Memory":524288,"Result Size":5311,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":11,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":71,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"165\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[70],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":70,"Name":"StateStoreRDD","Scope":"{\"id\":\"168\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[69],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":69,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"169\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[68],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":67,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"173\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[66],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":68,"Name":"StateStoreRDD","Scope":"{\"id\":\"172\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[67],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[10],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020225410,"Completion Time":1596020225514,"Accumulables":[{"ID":846,"Name":"duration","Value":"15","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":837,"Name":"number of total state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":801,"Name":"local bytes read","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":831,"Name":"peak memory","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":926,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Value":0,"Internal":true,"Count Failed Values":true},{"ID":917,"Name":"internal.metrics.resultSize","Value":10885,"Internal":true,"Count Failed Values":true},{"ID":830,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":848,"Name":"peak memory","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":803,"Name":"records read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":839,"Name":"time to update","Value":"15","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":929,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Value":0,"Internal":true,"Count Failed Values":true},{"ID":833,"Name":"time in aggregation build","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":842,"Name":"memory used by state","Value":"1184","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":914,"Name":"internal.metrics.executorDeserializeCpuTime","Value":7808838,"Internal":true,"Count Failed Values":true},{"ID":922,"Name":"internal.metrics.peakExecutionMemory","Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":913,"Name":"internal.metrics.executorDeserializeTime","Value":7,"Internal":true,"Count Failed Values":true},{"ID":925,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Value":1,"Internal":true,"Count Failed Values":true},{"ID":844,"Name":"count of cache hit on states cache in provider","Value":"20","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":835,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":916,"Name":"internal.metrics.executorCpuTime","Value":33544390,"Internal":true,"Count Failed Values":true},{"ID":829,"Name":"duration","Value":"5","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":928,"Name":"internal.metrics.shuffle.read.localBytesRead","Value":168,"Internal":true,"Count Failed Values":true},{"ID":802,"Name":"fetch wait time","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":838,"Name":"number of updated state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":847,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":850,"Name":"time in aggregation build","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":841,"Name":"time to commit changes","Value":"87","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":927,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Value":0,"Internal":true,"Count Failed Values":true},{"ID":930,"Name":"internal.metrics.shuffle.read.recordsRead","Value":1,"Internal":true,"Count Failed Values":true},{"ID":840,"Name":"time to remove","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":834,"Name":"avg hash probe bucket list iters","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":852,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":798,"Name":"local blocks read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":843,"Name":"estimated size of state only on current version","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":915,"Name":"internal.metrics.executorRunTime","Value":152,"Internal":true,"Count Failed Values":true},{"ID":924,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Value":0,"Internal":true,"Count Failed Values":true}],"Resource Profile Id":0}} +{"Event":"SparkListenerJobEnd","Job ID":5,"Completion Time":1596020225514,"Job Result":{"Result":"JobSucceeded"}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":17,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 5","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nLocalTableScan (1)\n\n\n(1) LocalTableScan\nOutput [2]: [value#116, count#117]\nArguments: [value#116, count#117]\n\n","sparkPlanInfo":{"nodeName":"LocalTableScan","simpleString":"LocalTableScan [value#116, count#117]","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":938,"metricType":"sum"}]},"time":1596020225536} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":17,"time":1596020225541} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":16,"time":1596020225542} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":15,"time":1596020225542} +{"Event":"org.apache.spark.sql.streaming.StreamingQueryListener$QueryProgressEvent","progress":{"id":"8d268dc2-bc9c-4be8-97a9-b135d2943028","runId":"e225d92f-2545-48f8-87a2-9c0309580f8a","name":null,"timestamp":"2020-07-29T10:57:05.123Z","batchId":5,"batchDuration":437,"durationMs":{"triggerExecution":437,"queryPlanning":35,"getBatch":1,"latestOffset":3,"addBatch":361,"walCommit":18},"eventTime":{},"stateOperators":[{"numRowsTotal":1,"numRowsUpdated":1,"memoryUsedBytes":1184,"numLateInputs":0,"customMetrics":{"stateOnCurrentVersionSizeBytes":456,"loadedMapCacheHitCount":20,"loadedMapCacheMissCount":0}}],"sources":[{"description":"KafkaV2[Subscribe[test5]]","startOffset":"{\"test5\":{\"0\":48799}}","endOffset":"{\"test5\":{\"0\":48837}}","numInputRows":38,"inputRowsPerSecond":97.68637532133675,"processedRowsPerSecond":86.95652173913044}],"sink":{"description":"org.apache.spark.sql.execution.streaming.ConsoleTable$@514ba885","numOutputRows":1},"observedMetrics":{}}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":18,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 6","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48837}}, {\"test5\":{\"0\":48881}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#1528]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 6a12c2d9-8d02-4241-93fc-f53da01bb454, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 6a12c2d9-8d02-4241-93fc-f53da01bb454, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@27ec018d\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@27ec018d","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 6, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 6, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#1452]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":1022,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1021,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1018,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1019,"metricType":"timing"},{"name":"peak memory","accumulatorId":1017,"metricType":"size"},{"name":"number of output rows","accumulatorId":1016,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1020,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1013,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1014,"metricType":"timing"},{"name":"peak memory","accumulatorId":1012,"metricType":"size"},{"name":"number of output rows","accumulatorId":1011,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1015,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1010,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":962,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":963,"metricType":"nsTiming"},{"name":"records read","accumulatorId":960,"metricType":"sum"},{"name":"local bytes read","accumulatorId":958,"metricType":"size"},{"name":"fetch wait time","accumulatorId":959,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":956,"metricType":"size"},{"name":"local blocks read","accumulatorId":955,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":954,"metricType":"sum"},{"name":"data size","accumulatorId":953,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":957,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":961,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":1009,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1006,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1007,"metricType":"timing"},{"name":"peak memory","accumulatorId":1005,"metricType":"size"},{"name":"number of output rows","accumulatorId":1004,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1008,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1003,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":993,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":994,"metricType":"sum"},{"name":"memory used by state","accumulatorId":999,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":1001,"metricType":"sum"},{"name":"number of output rows","accumulatorId":992,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":1000,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":1002,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":998,"metricType":"timing"},{"name":"time to remove","accumulatorId":997,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":995,"metricType":"sum"},{"name":"time to update","accumulatorId":996,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":989,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":990,"metricType":"timing"},{"name":"peak memory","accumulatorId":988,"metricType":"size"},{"name":"number of output rows","accumulatorId":987,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":991,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":986,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020225657} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":19,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 6","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48837}}, {\"test5\":{\"0\":48881}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#1604]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 96456757-8d0b-46da-a006-9fe2cb6fc936, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = 96456757-8d0b-46da-a006-9fe2cb6fc936, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@27ec018d\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@27ec018d","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 6, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 6, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#1452]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":1022,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1021,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1018,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1019,"metricType":"timing"},{"name":"peak memory","accumulatorId":1017,"metricType":"size"},{"name":"number of output rows","accumulatorId":1016,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1020,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1013,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1014,"metricType":"timing"},{"name":"peak memory","accumulatorId":1012,"metricType":"size"},{"name":"number of output rows","accumulatorId":1011,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1015,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1010,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":962,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":963,"metricType":"nsTiming"},{"name":"records read","accumulatorId":960,"metricType":"sum"},{"name":"local bytes read","accumulatorId":958,"metricType":"size"},{"name":"fetch wait time","accumulatorId":959,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":956,"metricType":"size"},{"name":"local blocks read","accumulatorId":955,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":954,"metricType":"sum"},{"name":"data size","accumulatorId":953,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":957,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":961,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":1009,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1006,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1007,"metricType":"timing"},{"name":"peak memory","accumulatorId":1005,"metricType":"size"},{"name":"number of output rows","accumulatorId":1004,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1008,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1003,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":993,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":994,"metricType":"sum"},{"name":"memory used by state","accumulatorId":999,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":1001,"metricType":"sum"},{"name":"number of output rows","accumulatorId":992,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":1000,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":1002,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":998,"metricType":"timing"},{"name":"time to remove","accumulatorId":997,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":995,"metricType":"sum"},{"name":"time to update","accumulatorId":996,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":989,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":990,"metricType":"timing"},{"name":"peak memory","accumulatorId":988,"metricType":"size"},{"name":"number of output rows","accumulatorId":987,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":991,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":986,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020225687} +{"Event":"SparkListenerJobStart","Job ID":6,"Submission Time":1596020225759,"Stage Infos":[{"Stage ID":12,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":78,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"206\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[77],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":75,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"213\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[74],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":74,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"214\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[73],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":77,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"207\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[76],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":72,"Name":"DataSourceRDD","Scope":"{\"id\":\"218\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":73,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"218\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[72],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":76,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"212\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[75],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0},{"Stage ID":13,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":83,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"198\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[82],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":81,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"202\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[80],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":79,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"206\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[78],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":80,"Name":"StateStoreRDD","Scope":"{\"id\":\"205\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[79],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":82,"Name":"StateStoreRDD","Scope":"{\"id\":\"201\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[81],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[12],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0}],"Stage IDs":[12,13],"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 6","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"6","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"19","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":12,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":78,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"206\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[77],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":75,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"213\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[74],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":74,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"214\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[73],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":77,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"207\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[76],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":72,"Name":"DataSourceRDD","Scope":"{\"id\":\"218\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":73,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"218\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[72],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":76,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"212\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[75],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020225760,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 6","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"6","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"19","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":12,"Stage Attempt ID":0,"Task Info":{"Task ID":18,"Index":0,"Attempt":0,"Launch Time":1596020225766,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":12,"Stage Attempt ID":0,"Task Type":"ShuffleMapTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":18,"Index":0,"Attempt":0,"Launch Time":1596020225766,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020225796,"Failed":false,"Killed":false,"Accumulables":[{"ID":963,"Name":"shuffle write time","Update":"543836","Value":"543836","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":962,"Name":"shuffle records written","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":961,"Name":"shuffle bytes written","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":953,"Name":"data size","Update":"128","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1010,"Name":"duration","Update":"17","Value":"17","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1011,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1012,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1014,"Name":"time in aggregation build","Update":"11","Value":"11","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1016,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1017,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1019,"Name":"time in aggregation build","Update":"8","Value":"8","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1021,"Name":"duration","Update":"17","Value":"17","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1022,"Name":"number of output rows","Update":"44","Value":"44","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1067,"Name":"internal.metrics.input.recordsRead","Update":44,"Value":44,"Internal":true,"Count Failed Values":true},{"ID":1065,"Name":"internal.metrics.shuffle.write.writeTime","Update":543836,"Value":543836,"Internal":true,"Count Failed Values":true},{"ID":1064,"Name":"internal.metrics.shuffle.write.recordsWritten","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":1063,"Name":"internal.metrics.shuffle.write.bytesWritten","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":1054,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":1049,"Name":"internal.metrics.resultSize","Update":2544,"Value":2544,"Internal":true,"Count Failed Values":true},{"ID":1048,"Name":"internal.metrics.executorCpuTime","Update":23733439,"Value":23733439,"Internal":true,"Count Failed Values":true},{"ID":1047,"Name":"internal.metrics.executorRunTime","Update":23,"Value":23,"Internal":true,"Count Failed Values":true},{"ID":1046,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3714406,"Value":3714406,"Internal":true,"Count Failed Values":true},{"ID":1045,"Name":"internal.metrics.executorDeserializeTime","Update":3,"Value":3,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":3,"Executor Deserialize CPU Time":3714406,"Executor Run Time":23,"Executor CPU Time":23733439,"Peak Execution Memory":524288,"Result Size":2544,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":168,"Shuffle Write Time":543836,"Shuffle Records Written":1},"Input Metrics":{"Bytes Read":0,"Records Read":44},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":12,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":78,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"206\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[77],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":75,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"213\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[74],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":74,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"214\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[73],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":77,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"207\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[76],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":72,"Name":"DataSourceRDD","Scope":"{\"id\":\"218\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":73,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"218\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[72],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":76,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"212\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[75],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020225760,"Completion Time":1596020225797,"Accumulables":[{"ID":1064,"Name":"internal.metrics.shuffle.write.recordsWritten","Value":1,"Internal":true,"Count Failed Values":true},{"ID":1010,"Name":"duration","Value":"17","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1046,"Name":"internal.metrics.executorDeserializeCpuTime","Value":3714406,"Internal":true,"Count Failed Values":true},{"ID":1019,"Name":"time in aggregation build","Value":"8","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1067,"Name":"internal.metrics.input.recordsRead","Value":44,"Internal":true,"Count Failed Values":true},{"ID":1022,"Name":"number of output rows","Value":"44","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1049,"Name":"internal.metrics.resultSize","Value":2544,"Internal":true,"Count Failed Values":true},{"ID":1016,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":962,"Name":"shuffle records written","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":953,"Name":"data size","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1054,"Name":"internal.metrics.peakExecutionMemory","Value":524288,"Internal":true,"Count Failed Values":true},{"ID":1045,"Name":"internal.metrics.executorDeserializeTime","Value":3,"Internal":true,"Count Failed Values":true},{"ID":1063,"Name":"internal.metrics.shuffle.write.bytesWritten","Value":168,"Internal":true,"Count Failed Values":true},{"ID":1048,"Name":"internal.metrics.executorCpuTime","Value":23733439,"Internal":true,"Count Failed Values":true},{"ID":1012,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1021,"Name":"duration","Value":"17","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":961,"Name":"shuffle bytes written","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1065,"Name":"internal.metrics.shuffle.write.writeTime","Value":543836,"Internal":true,"Count Failed Values":true},{"ID":1047,"Name":"internal.metrics.executorRunTime","Value":23,"Internal":true,"Count Failed Values":true},{"ID":1014,"Name":"time in aggregation build","Value":"11","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":963,"Name":"shuffle write time","Value":"543836","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1017,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1011,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"}],"Resource Profile Id":0}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":13,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":83,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"198\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[82],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":81,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"202\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[80],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":79,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"206\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[78],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":80,"Name":"StateStoreRDD","Scope":"{\"id\":\"205\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[79],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":82,"Name":"StateStoreRDD","Scope":"{\"id\":\"201\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[81],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[12],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020225801,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 6","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"6","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"19","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":13,"Stage Attempt ID":0,"Task Info":{"Task ID":19,"Index":0,"Attempt":0,"Launch Time":1596020225808,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":13,"Stage Attempt ID":0,"Task Info":{"Task ID":20,"Index":1,"Attempt":0,"Launch Time":1596020225809,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":13,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":19,"Index":0,"Attempt":0,"Launch Time":1596020225808,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020225868,"Failed":false,"Killed":false,"Accumulables":[{"ID":986,"Name":"duration","Update":"3","Value":"3","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":988,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":990,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":996,"Name":"time to update","Update":"4","Value":"4","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":997,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":998,"Name":"time to commit changes","Update":"26","Value":"26","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1000,"Name":"estimated size of state only on current version","Update":"88","Value":"88","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1001,"Name":"count of cache hit on states cache in provider","Update":"12","Value":"12","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":999,"Name":"memory used by state","Update":"400","Value":"400","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1003,"Name":"duration","Update":"4","Value":"4","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1005,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1007,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1087,"Name":"internal.metrics.shuffle.read.recordsRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1086,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1085,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1084,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1083,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1082,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1081,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1079,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":1074,"Name":"internal.metrics.resultSize","Update":5311,"Value":5311,"Internal":true,"Count Failed Values":true},{"ID":1073,"Name":"internal.metrics.executorCpuTime","Update":17503528,"Value":17503528,"Internal":true,"Count Failed Values":true},{"ID":1072,"Name":"internal.metrics.executorRunTime","Update":50,"Value":50,"Internal":true,"Count Failed Values":true},{"ID":1071,"Name":"internal.metrics.executorDeserializeCpuTime","Update":4255703,"Value":4255703,"Internal":true,"Count Failed Values":true},{"ID":1070,"Name":"internal.metrics.executorDeserializeTime","Update":4,"Value":4,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":4,"Executor Deserialize CPU Time":4255703,"Executor Run Time":50,"Executor CPU Time":17503528,"Peak Execution Memory":524288,"Result Size":5311,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":13,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":20,"Index":1,"Attempt":0,"Launch Time":1596020225809,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020225874,"Failed":false,"Killed":false,"Accumulables":[{"ID":986,"Name":"duration","Update":"2","Value":"5","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":991,"Name":"avg hash probe bucket list iters","Update":"10","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":987,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":988,"Name":"peak memory","Update":"4456448","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":990,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":996,"Name":"time to update","Update":"15","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":995,"Name":"number of updated state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":997,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":998,"Name":"time to commit changes","Update":"23","Value":"49","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1000,"Name":"estimated size of state only on current version","Update":"368","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":992,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1001,"Name":"count of cache hit on states cache in provider","Update":"12","Value":"24","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":999,"Name":"memory used by state","Update":"784","Value":"1184","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":994,"Name":"number of total state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1003,"Name":"duration","Update":"15","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1004,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1005,"Name":"peak memory","Update":"262144","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1007,"Name":"time in aggregation build","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1009,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":955,"Name":"local blocks read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":959,"Name":"fetch wait time","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":958,"Name":"local bytes read","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":960,"Name":"records read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1087,"Name":"internal.metrics.shuffle.read.recordsRead","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":1086,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1085,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":1084,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1083,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1082,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":1081,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1079,"Name":"internal.metrics.peakExecutionMemory","Update":4718592,"Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":1074,"Name":"internal.metrics.resultSize","Update":5574,"Value":10885,"Internal":true,"Count Failed Values":true},{"ID":1073,"Name":"internal.metrics.executorCpuTime","Update":17516707,"Value":35020235,"Internal":true,"Count Failed Values":true},{"ID":1072,"Name":"internal.metrics.executorRunTime","Update":56,"Value":106,"Internal":true,"Count Failed Values":true},{"ID":1071,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3750230,"Value":8005933,"Internal":true,"Count Failed Values":true},{"ID":1070,"Name":"internal.metrics.executorDeserializeTime","Update":3,"Value":7,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":3,"Executor Deserialize CPU Time":3750230,"Executor Run Time":56,"Executor CPU Time":17516707,"Peak Execution Memory":4718592,"Result Size":5574,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":1,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":168,"Total Records Read":1},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":13,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":83,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"198\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[82],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":81,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"202\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[80],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":79,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"206\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[78],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":80,"Name":"StateStoreRDD","Scope":"{\"id\":\"205\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[79],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":82,"Name":"StateStoreRDD","Scope":"{\"id\":\"201\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[81],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[12],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020225801,"Completion Time":1596020225874,"Accumulables":[{"ID":1070,"Name":"internal.metrics.executorDeserializeTime","Value":7,"Internal":true,"Count Failed Values":true},{"ID":1079,"Name":"internal.metrics.peakExecutionMemory","Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":992,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1073,"Name":"internal.metrics.executorCpuTime","Value":35020235,"Internal":true,"Count Failed Values":true},{"ID":1082,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Value":1,"Internal":true,"Count Failed Values":true},{"ID":1001,"Name":"count of cache hit on states cache in provider","Value":"24","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":995,"Name":"number of updated state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1004,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":986,"Name":"duration","Value":"5","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":959,"Name":"fetch wait time","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1085,"Name":"internal.metrics.shuffle.read.localBytesRead","Value":168,"Internal":true,"Count Failed Values":true},{"ID":1007,"Name":"time in aggregation build","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":998,"Name":"time to commit changes","Value":"49","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1084,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Value":0,"Internal":true,"Count Failed Values":true},{"ID":997,"Name":"time to remove","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1087,"Name":"internal.metrics.shuffle.read.recordsRead","Value":1,"Internal":true,"Count Failed Values":true},{"ID":955,"Name":"local blocks read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1081,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Value":0,"Internal":true,"Count Failed Values":true},{"ID":991,"Name":"avg hash probe bucket list iters","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1009,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1072,"Name":"internal.metrics.executorRunTime","Value":106,"Internal":true,"Count Failed Values":true},{"ID":1000,"Name":"estimated size of state only on current version","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":994,"Name":"number of total state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1003,"Name":"duration","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":958,"Name":"local bytes read","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":988,"Name":"peak memory","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1074,"Name":"internal.metrics.resultSize","Value":10885,"Internal":true,"Count Failed Values":true},{"ID":1083,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Value":0,"Internal":true,"Count Failed Values":true},{"ID":960,"Name":"records read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1086,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Value":0,"Internal":true,"Count Failed Values":true},{"ID":987,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1005,"Name":"peak memory","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":996,"Name":"time to update","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1071,"Name":"internal.metrics.executorDeserializeCpuTime","Value":8005933,"Internal":true,"Count Failed Values":true},{"ID":999,"Name":"memory used by state","Value":"1184","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":990,"Name":"time in aggregation build","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"}],"Resource Profile Id":0}} +{"Event":"SparkListenerJobEnd","Job ID":6,"Completion Time":1596020225875,"Job Result":{"Result":"JobSucceeded"}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":20,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 6","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nLocalTableScan (1)\n\n\n(1) LocalTableScan\nOutput [2]: [value#130, count#131]\nArguments: [value#130, count#131]\n\n","sparkPlanInfo":{"nodeName":"LocalTableScan","simpleString":"LocalTableScan [value#130, count#131]","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":1095,"metricType":"sum"}]},"time":1596020225891} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":20,"time":1596020225896} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":19,"time":1596020225897} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":18,"time":1596020225897} +{"Event":"org.apache.spark.sql.streaming.StreamingQueryListener$QueryProgressEvent","progress":{"id":"8d268dc2-bc9c-4be8-97a9-b135d2943028","runId":"e225d92f-2545-48f8-87a2-9c0309580f8a","name":null,"timestamp":"2020-07-29T10:57:05.562Z","batchId":6,"batchDuration":351,"durationMs":{"triggerExecution":351,"queryPlanning":28,"getBatch":1,"latestOffset":6,"addBatch":273,"walCommit":25},"eventTime":{},"stateOperators":[{"numRowsTotal":1,"numRowsUpdated":1,"memoryUsedBytes":1184,"numLateInputs":0,"customMetrics":{"stateOnCurrentVersionSizeBytes":456,"loadedMapCacheHitCount":24,"loadedMapCacheMissCount":0}}],"sources":[{"description":"KafkaV2[Subscribe[test5]]","startOffset":"{\"test5\":{\"0\":48837}}","endOffset":"{\"test5\":{\"0\":48881}}","numInputRows":44,"inputRowsPerSecond":100.22779043280183,"processedRowsPerSecond":125.35612535612536}],"sink":{"description":"org.apache.spark.sql.execution.streaming.ConsoleTable$@514ba885","numOutputRows":1},"observedMetrics":{}}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":21,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 7","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48881}}, {\"test5\":{\"0\":48917}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#1759]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = c0968891-bf48-4112-a19b-444014085d1d, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = c0968891-bf48-4112-a19b-444014085d1d, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@6313b68e\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@6313b68e","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 7, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 7, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#1683]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":1179,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1178,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1175,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1176,"metricType":"timing"},{"name":"peak memory","accumulatorId":1174,"metricType":"size"},{"name":"number of output rows","accumulatorId":1173,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1177,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1170,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1171,"metricType":"timing"},{"name":"peak memory","accumulatorId":1169,"metricType":"size"},{"name":"number of output rows","accumulatorId":1168,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1172,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1167,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":1119,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":1120,"metricType":"nsTiming"},{"name":"records read","accumulatorId":1117,"metricType":"sum"},{"name":"local bytes read","accumulatorId":1115,"metricType":"size"},{"name":"fetch wait time","accumulatorId":1116,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":1113,"metricType":"size"},{"name":"local blocks read","accumulatorId":1112,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":1111,"metricType":"sum"},{"name":"data size","accumulatorId":1110,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":1114,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":1118,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":1166,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1163,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1164,"metricType":"timing"},{"name":"peak memory","accumulatorId":1162,"metricType":"size"},{"name":"number of output rows","accumulatorId":1161,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1165,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1160,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":1150,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":1151,"metricType":"sum"},{"name":"memory used by state","accumulatorId":1156,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":1158,"metricType":"sum"},{"name":"number of output rows","accumulatorId":1149,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":1157,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":1159,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":1155,"metricType":"timing"},{"name":"time to remove","accumulatorId":1154,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":1152,"metricType":"sum"},{"name":"time to update","accumulatorId":1153,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1146,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1147,"metricType":"timing"},{"name":"peak memory","accumulatorId":1145,"metricType":"size"},{"name":"number of output rows","accumulatorId":1144,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1148,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1143,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020225988} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":22,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 7","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nWriteToDataSourceV2 (14)\n+- * HashAggregate (13)\n +- StateStoreSave (12)\n +- * HashAggregate (11)\n +- StateStoreRestore (10)\n +- Exchange (9)\n +- * HashAggregate (8)\n +- * HashAggregate (7)\n +- * SerializeFromObject (6)\n +- MapPartitions (5)\n +- DeserializeToObject (4)\n +- * Project (3)\n +- * Project (2)\n +- MicroBatchScan (1)\n\n\n(1) MicroBatchScan\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nArguments: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13], org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan@7e7b182c, KafkaV2[Subscribe[test5]], {\"test5\":{\"0\":48881}}, {\"test5\":{\"0\":48917}}\n\n(2) Project [codegen id : 1]\nOutput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(3) Project [codegen id : 1]\nOutput [1]: [cast(value#8 as string) AS value#21]\nInput [7]: [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]\n\n(4) DeserializeToObject\nInput [1]: [value#21]\nArguments: value#21.toString, obj#27: java.lang.String\n\n(5) MapPartitions\nInput [1]: [obj#27]\nArguments: org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String\n\n(6) SerializeFromObject [codegen id : 2]\nInput [1]: [obj#28]\nArguments: [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]\n\n(7) HashAggregate [codegen id : 2]\nInput [1]: [value#29]\nKeys [1]: [value#29]\nFunctions [1]: [partial_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(8) HashAggregate [codegen id : 2]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(9) Exchange\nInput [2]: [value#29, count#38L]\nArguments: hashpartitioning(value#29, 2), true, [id=#1835]\n\n(10) StateStoreRestore\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = e165b23b-1a6f-459f-9c51-288922bb2647, opId = 0, ver = 0, numPartitions = 2], 2\n\n(11) HashAggregate [codegen id : 3]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [merge_count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count#38L]\n\n(12) StateStoreSave\nInput [2]: [value#29, count#38L]\nArguments: [value#29], state info [ checkpoint = , runId = e165b23b-1a6f-459f-9c51-288922bb2647, opId = 0, ver = 0, numPartitions = 2], Append, 0, 2\n\n(13) HashAggregate [codegen id : 4]\nInput [2]: [value#29, count#38L]\nKeys [1]: [value#29]\nFunctions [1]: [count(1)]\nAggregate Attributes [1]: [count(1)#31L]\nResults [2]: [value#29, count(1)#31L AS count#32L]\n\n(14) WriteToDataSourceV2\nInput [2]: [value#29, count#32L]\nArguments: org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@6313b68e\n\n","sparkPlanInfo":{"nodeName":"WriteToDataSourceV2","simpleString":"WriteToDataSourceV2 org.apache.spark.sql.execution.streaming.sources.MicroBatchWrite@6313b68e","children":[{"nodeName":"WholeStageCodegen (4)","simpleString":"WholeStageCodegen (4)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreSave","simpleString":"StateStoreSave [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 7, numPartitions = 2], Complete, 0, 2","children":[{"nodeName":"WholeStageCodegen (3)","simpleString":"WholeStageCodegen (3)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"StateStoreRestore","simpleString":"StateStoreRestore [value#29], state info [ checkpoint = file:/tmp/temporary-025d7997-5b66-4def-abbf-bdcca57312b9/state, runId = e225d92f-2545-48f8-87a2-9c0309580f8a, opId = 0, ver = 7, numPartitions = 2], 2","children":[{"nodeName":"Exchange","simpleString":"Exchange hashpartitioning(value#29, 2), true, [id=#1683]","children":[{"nodeName":"WholeStageCodegen (2)","simpleString":"WholeStageCodegen (2)","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[merge_count(1)])","children":[{"nodeName":"HashAggregate","simpleString":"HashAggregate(keys=[value#29], functions=[partial_count(1)])","children":[{"nodeName":"SerializeFromObject","simpleString":"SerializeFromObject [staticinvoke(class org.apache.spark.unsafe.types.UTF8String, StringType, fromString, input[0, java.lang.String, true], true, false) AS value#29]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MapPartitions","simpleString":"MapPartitions org.apache.spark.sql.Dataset$$Lambda$1321/872917583@67b99068, obj#28: java.lang.String","children":[{"nodeName":"DeserializeToObject","simpleString":"DeserializeToObject value#21.toString, obj#27: java.lang.String","children":[{"nodeName":"WholeStageCodegen (1)","simpleString":"WholeStageCodegen (1)","children":[{"nodeName":"Project","simpleString":"Project [cast(value#8 as string) AS value#21]","children":[{"nodeName":"Project","simpleString":"Project [key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13]","children":[{"nodeName":"InputAdapter","simpleString":"InputAdapter","children":[{"nodeName":"MicroBatchScan","simpleString":"MicroBatchScan[key#7, value#8, topic#9, partition#10, offset#11L, timestamp#12, timestampType#13] class org.apache.spark.sql.kafka010.KafkaSourceProvider$KafkaScan","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":1179,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1178,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1175,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1176,"metricType":"timing"},{"name":"peak memory","accumulatorId":1174,"metricType":"size"},{"name":"number of output rows","accumulatorId":1173,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1177,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1170,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1171,"metricType":"timing"},{"name":"peak memory","accumulatorId":1169,"metricType":"size"},{"name":"number of output rows","accumulatorId":1168,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1172,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1167,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"shuffle records written","accumulatorId":1119,"metricType":"sum"},{"name":"shuffle write time","accumulatorId":1120,"metricType":"nsTiming"},{"name":"records read","accumulatorId":1117,"metricType":"sum"},{"name":"local bytes read","accumulatorId":1115,"metricType":"size"},{"name":"fetch wait time","accumulatorId":1116,"metricType":"timing"},{"name":"remote bytes read","accumulatorId":1113,"metricType":"size"},{"name":"local blocks read","accumulatorId":1112,"metricType":"sum"},{"name":"remote blocks read","accumulatorId":1111,"metricType":"sum"},{"name":"data size","accumulatorId":1110,"metricType":"size"},{"name":"remote bytes read to disk","accumulatorId":1114,"metricType":"size"},{"name":"shuffle bytes written","accumulatorId":1118,"metricType":"size"}]}],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":1166,"metricType":"sum"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1163,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1164,"metricType":"timing"},{"name":"peak memory","accumulatorId":1162,"metricType":"size"},{"name":"number of output rows","accumulatorId":1161,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1165,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1160,"metricType":"timing"}]}],"metadata":{},"metrics":[{"name":"number of inputs which are later than watermark ('inputs' are relative to operators)","accumulatorId":1150,"metricType":"sum"},{"name":"number of total state rows","accumulatorId":1151,"metricType":"sum"},{"name":"memory used by state","accumulatorId":1156,"metricType":"size"},{"name":"count of cache hit on states cache in provider","accumulatorId":1158,"metricType":"sum"},{"name":"number of output rows","accumulatorId":1149,"metricType":"sum"},{"name":"estimated size of state only on current version","accumulatorId":1157,"metricType":"size"},{"name":"count of cache miss on states cache in provider","accumulatorId":1159,"metricType":"sum"},{"name":"time to commit changes","accumulatorId":1155,"metricType":"timing"},{"name":"time to remove","accumulatorId":1154,"metricType":"timing"},{"name":"number of updated state rows","accumulatorId":1152,"metricType":"sum"},{"name":"time to update","accumulatorId":1153,"metricType":"timing"}]}],"metadata":{},"metrics":[]}],"metadata":{},"metrics":[{"name":"spill size","accumulatorId":1146,"metricType":"size"},{"name":"time in aggregation build","accumulatorId":1147,"metricType":"timing"},{"name":"peak memory","accumulatorId":1145,"metricType":"size"},{"name":"number of output rows","accumulatorId":1144,"metricType":"sum"},{"name":"avg hash probe bucket list iters","accumulatorId":1148,"metricType":"average"}]}],"metadata":{},"metrics":[{"name":"duration","accumulatorId":1143,"metricType":"timing"}]}],"metadata":{},"metrics":[]},"time":1596020226019} +{"Event":"SparkListenerJobStart","Job ID":7,"Submission Time":1596020226076,"Stage Infos":[{"Stage ID":15,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":95,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"231\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[94],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":93,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"235\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[92],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":91,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"239\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[90],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":94,"Name":"StateStoreRDD","Scope":"{\"id\":\"234\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[93],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":92,"Name":"StateStoreRDD","Scope":"{\"id\":\"238\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[91],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[14],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0},{"Stage ID":14,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":90,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"239\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[89],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":88,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"245\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[87],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":84,"Name":"DataSourceRDD","Scope":"{\"id\":\"251\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":85,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"251\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[84],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":89,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"240\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[88],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":86,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"247\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[85],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":87,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"246\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[86],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Accumulables":[],"Resource Profile Id":0}],"Stage IDs":[15,14],"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 7","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"7","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"22","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":14,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":90,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"239\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[89],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":88,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"245\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[87],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":84,"Name":"DataSourceRDD","Scope":"{\"id\":\"251\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":85,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"251\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[84],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":89,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"240\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[88],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":86,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"247\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[85],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":87,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"246\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[86],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020226077,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 7","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"7","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"22","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":14,"Stage Attempt ID":0,"Task Info":{"Task ID":21,"Index":0,"Attempt":0,"Launch Time":1596020226086,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":14,"Stage Attempt ID":0,"Task Type":"ShuffleMapTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":21,"Index":0,"Attempt":0,"Launch Time":1596020226086,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020226116,"Failed":false,"Killed":false,"Accumulables":[{"ID":1120,"Name":"shuffle write time","Update":"543034","Value":"543034","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1119,"Name":"shuffle records written","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1118,"Name":"shuffle bytes written","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1110,"Name":"data size","Update":"128","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1167,"Name":"duration","Update":"13","Value":"13","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1168,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1169,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1171,"Name":"time in aggregation build","Update":"8","Value":"8","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1173,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1174,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1176,"Name":"time in aggregation build","Update":"6","Value":"6","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1178,"Name":"duration","Update":"13","Value":"13","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1179,"Name":"number of output rows","Update":"36","Value":"36","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1224,"Name":"internal.metrics.input.recordsRead","Update":36,"Value":36,"Internal":true,"Count Failed Values":true},{"ID":1222,"Name":"internal.metrics.shuffle.write.writeTime","Update":543034,"Value":543034,"Internal":true,"Count Failed Values":true},{"ID":1221,"Name":"internal.metrics.shuffle.write.recordsWritten","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":1220,"Name":"internal.metrics.shuffle.write.bytesWritten","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":1211,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":524288,"Internal":true,"Count Failed Values":true},{"ID":1206,"Name":"internal.metrics.resultSize","Update":2544,"Value":2544,"Internal":true,"Count Failed Values":true},{"ID":1205,"Name":"internal.metrics.executorCpuTime","Update":19652237,"Value":19652237,"Internal":true,"Count Failed Values":true},{"ID":1204,"Name":"internal.metrics.executorRunTime","Update":19,"Value":19,"Internal":true,"Count Failed Values":true},{"ID":1203,"Name":"internal.metrics.executorDeserializeCpuTime","Update":2829254,"Value":2829254,"Internal":true,"Count Failed Values":true},{"ID":1202,"Name":"internal.metrics.executorDeserializeTime","Update":2,"Value":2,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":2,"Executor Deserialize CPU Time":2829254,"Executor Run Time":19,"Executor CPU Time":19652237,"Peak Execution Memory":524288,"Result Size":2544,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":168,"Shuffle Write Time":543034,"Shuffle Records Written":1},"Input Metrics":{"Bytes Read":0,"Records Read":36},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":14,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":1,"RDD Info":[{"RDD ID":90,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"239\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[89],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":88,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"245\",\"name\":\"MapPartitions\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[87],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":84,"Name":"DataSourceRDD","Scope":"{\"id\":\"251\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":85,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"251\",\"name\":\"MicroBatchScan\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[84],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":89,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"240\",\"name\":\"WholeStageCodegen (2)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[88],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":86,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"247\",\"name\":\"WholeStageCodegen (1)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[85],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":87,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"246\",\"name\":\"DeserializeToObject\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[86],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":1,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020226077,"Completion Time":1596020226117,"Accumulables":[{"ID":1205,"Name":"internal.metrics.executorCpuTime","Value":19652237,"Internal":true,"Count Failed Values":true},{"ID":1178,"Name":"duration","Value":"13","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1169,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1118,"Name":"shuffle bytes written","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1204,"Name":"internal.metrics.executorRunTime","Value":19,"Internal":true,"Count Failed Values":true},{"ID":1222,"Name":"internal.metrics.shuffle.write.writeTime","Value":543034,"Internal":true,"Count Failed Values":true},{"ID":1171,"Name":"time in aggregation build","Value":"8","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1120,"Name":"shuffle write time","Value":"543034","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1174,"Name":"peak memory","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1168,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1203,"Name":"internal.metrics.executorDeserializeCpuTime","Value":2829254,"Internal":true,"Count Failed Values":true},{"ID":1167,"Name":"duration","Value":"13","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1221,"Name":"internal.metrics.shuffle.write.recordsWritten","Value":1,"Internal":true,"Count Failed Values":true},{"ID":1176,"Name":"time in aggregation build","Value":"6","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1206,"Name":"internal.metrics.resultSize","Value":2544,"Internal":true,"Count Failed Values":true},{"ID":1224,"Name":"internal.metrics.input.recordsRead","Value":36,"Internal":true,"Count Failed Values":true},{"ID":1179,"Name":"number of output rows","Value":"36","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1119,"Name":"shuffle records written","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1110,"Name":"data size","Value":"128","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1173,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1202,"Name":"internal.metrics.executorDeserializeTime","Value":2,"Internal":true,"Count Failed Values":true},{"ID":1211,"Name":"internal.metrics.peakExecutionMemory","Value":524288,"Internal":true,"Count Failed Values":true},{"ID":1220,"Name":"internal.metrics.shuffle.write.bytesWritten","Value":168,"Internal":true,"Count Failed Values":true}],"Resource Profile Id":0}} +{"Event":"SparkListenerStageSubmitted","Stage Info":{"Stage ID":15,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":95,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"231\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[94],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":93,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"235\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[92],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":91,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"239\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[90],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":94,"Name":"StateStoreRDD","Scope":"{\"id\":\"234\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[93],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":92,"Name":"StateStoreRDD","Scope":"{\"id\":\"238\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[91],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[14],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020226120,"Accumulables":[],"Resource Profile Id":0},"Properties":{"sql.streaming.queryId":"8d268dc2-bc9c-4be8-97a9-b135d2943028","spark.driver.host":"iZbp19vpr16ix621sdw476Z","spark.eventLog.enabled":"true","spark.sql.adaptive.enabled":"false","spark.job.interruptOnCancel":"true","spark.driver.port":"46309","__fetch_continuous_blocks_in_batch_enabled":"true","spark.jars":"file:/root/spark-3.1.0-SNAPSHOT-bin-hadoop2.8/./examples/jars/spark-examples_2.12-3.1.0-SNAPSHOT.jar","__is_continuous_processing":"false","spark.app.name":"StructuredKafkaWordCount","callSite.long":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","callSite.short":"start at StructuredKafkaWordCount.scala:86","spark.submit.pyFiles":"","spark.job.description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 7","spark.executor.id":"driver","spark.sql.cbo.enabled":"false","streaming.sql.batchId":"7","spark.jobGroup.id":"e225d92f-2545-48f8-87a2-9c0309580f8a","spark.submit.deployMode":"client","spark.master":"local[*]","spark.eventLog.dir":"/tmp/spark-history","spark.sql.execution.id":"22","spark.app.id":"local-1596020211915","spark.sql.shuffle.partitions":"2"}} +{"Event":"SparkListenerTaskStart","Stage ID":15,"Stage Attempt ID":0,"Task Info":{"Task ID":22,"Index":0,"Attempt":0,"Launch Time":1596020226128,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskStart","Stage ID":15,"Stage Attempt ID":0,"Task Info":{"Task ID":23,"Index":1,"Attempt":0,"Launch Time":1596020226129,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":0,"Failed":false,"Killed":false,"Accumulables":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":15,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":23,"Index":1,"Attempt":0,"Launch Time":1596020226129,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020226196,"Failed":false,"Killed":false,"Accumulables":[{"ID":1143,"Name":"duration","Update":"3","Value":"3","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1148,"Name":"avg hash probe bucket list iters","Update":"10","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1144,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1145,"Name":"peak memory","Update":"4456448","Value":"4456448","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1147,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1153,"Name":"time to update","Update":"21","Value":"21","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1152,"Name":"number of updated state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1154,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1155,"Name":"time to commit changes","Update":"19","Value":"19","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1157,"Name":"estimated size of state only on current version","Update":"368","Value":"368","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1149,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1158,"Name":"count of cache hit on states cache in provider","Update":"14","Value":"14","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1156,"Name":"memory used by state","Update":"784","Value":"784","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1151,"Name":"number of total state rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1160,"Name":"duration","Update":"21","Value":"21","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1161,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1162,"Name":"peak memory","Update":"262144","Value":"262144","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1164,"Name":"time in aggregation build","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1166,"Name":"number of output rows","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1112,"Name":"local blocks read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1116,"Name":"fetch wait time","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1115,"Name":"local bytes read","Update":"168","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1117,"Name":"records read","Update":"1","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1244,"Name":"internal.metrics.shuffle.read.recordsRead","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":1243,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1242,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":168,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":1241,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1240,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1239,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":1,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":1238,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1236,"Name":"internal.metrics.peakExecutionMemory","Update":4718592,"Value":4718592,"Internal":true,"Count Failed Values":true},{"ID":1231,"Name":"internal.metrics.resultSize","Update":5574,"Value":5574,"Internal":true,"Count Failed Values":true},{"ID":1230,"Name":"internal.metrics.executorCpuTime","Update":19415818,"Value":19415818,"Internal":true,"Count Failed Values":true},{"ID":1229,"Name":"internal.metrics.executorRunTime","Update":60,"Value":60,"Internal":true,"Count Failed Values":true},{"ID":1228,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3845429,"Value":3845429,"Internal":true,"Count Failed Values":true},{"ID":1227,"Name":"internal.metrics.executorDeserializeTime","Update":3,"Value":3,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":3,"Executor Deserialize CPU Time":3845429,"Executor Run Time":60,"Executor CPU Time":19415818,"Peak Execution Memory":4718592,"Result Size":5574,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":1,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":168,"Total Records Read":1},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerTaskEnd","Stage ID":15,"Stage Attempt ID":0,"Task Type":"ResultTask","Task End Reason":{"Reason":"Success"},"Task Info":{"Task ID":22,"Index":0,"Attempt":0,"Launch Time":1596020226128,"Executor ID":"driver","Host":"iZbp19vpr16ix621sdw476Z","Locality":"PROCESS_LOCAL","Speculative":false,"Getting Result Time":0,"Finish Time":1596020226204,"Failed":false,"Killed":false,"Accumulables":[{"ID":1143,"Name":"duration","Update":"2","Value":"5","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1145,"Name":"peak memory","Update":"262144","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1147,"Name":"time in aggregation build","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1153,"Name":"time to update","Update":"3","Value":"24","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1154,"Name":"time to remove","Update":"0","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1155,"Name":"time to commit changes","Update":"48","Value":"67","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1157,"Name":"estimated size of state only on current version","Update":"88","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1158,"Name":"count of cache hit on states cache in provider","Update":"14","Value":"28","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1156,"Name":"memory used by state","Update":"400","Value":"1184","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1160,"Name":"duration","Update":"3","Value":"24","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1162,"Name":"peak memory","Update":"262144","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1164,"Name":"time in aggregation build","Update":"0","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1244,"Name":"internal.metrics.shuffle.read.recordsRead","Update":0,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":1243,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1242,"Name":"internal.metrics.shuffle.read.localBytesRead","Update":0,"Value":168,"Internal":true,"Count Failed Values":true},{"ID":1241,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1240,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1239,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Update":0,"Value":1,"Internal":true,"Count Failed Values":true},{"ID":1238,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Update":0,"Value":0,"Internal":true,"Count Failed Values":true},{"ID":1236,"Name":"internal.metrics.peakExecutionMemory","Update":524288,"Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":1231,"Name":"internal.metrics.resultSize","Update":5311,"Value":10885,"Internal":true,"Count Failed Values":true},{"ID":1230,"Name":"internal.metrics.executorCpuTime","Update":14652861,"Value":34068679,"Internal":true,"Count Failed Values":true},{"ID":1229,"Name":"internal.metrics.executorRunTime","Update":65,"Value":125,"Internal":true,"Count Failed Values":true},{"ID":1228,"Name":"internal.metrics.executorDeserializeCpuTime","Update":3933877,"Value":7779306,"Internal":true,"Count Failed Values":true},{"ID":1227,"Name":"internal.metrics.executorDeserializeTime","Update":3,"Value":6,"Internal":true,"Count Failed Values":true}]},"Task Executor Metrics":{"JVMHeapMemory":0,"JVMOffHeapMemory":0,"OnHeapExecutionMemory":0,"OffHeapExecutionMemory":0,"OnHeapStorageMemory":0,"OffHeapStorageMemory":0,"OnHeapUnifiedMemory":0,"OffHeapUnifiedMemory":0,"DirectPoolMemory":0,"MappedPoolMemory":0,"ProcessTreeJVMVMemory":0,"ProcessTreeJVMRSSMemory":0,"ProcessTreePythonVMemory":0,"ProcessTreePythonRSSMemory":0,"ProcessTreeOtherVMemory":0,"ProcessTreeOtherRSSMemory":0,"MinorGCCount":0,"MinorGCTime":0,"MajorGCCount":0,"MajorGCTime":0},"Task Metrics":{"Executor Deserialize Time":3,"Executor Deserialize CPU Time":3933877,"Executor Run Time":65,"Executor CPU Time":14652861,"Peak Execution Memory":524288,"Result Size":5311,"JVM GC Time":0,"Result Serialization Time":0,"Memory Bytes Spilled":0,"Disk Bytes Spilled":0,"Shuffle Read Metrics":{"Remote Blocks Fetched":0,"Local Blocks Fetched":0,"Fetch Wait Time":0,"Remote Bytes Read":0,"Remote Bytes Read To Disk":0,"Local Bytes Read":0,"Total Records Read":0},"Shuffle Write Metrics":{"Shuffle Bytes Written":0,"Shuffle Write Time":0,"Shuffle Records Written":0},"Input Metrics":{"Bytes Read":0,"Records Read":0},"Output Metrics":{"Bytes Written":0,"Records Written":0},"Updated Blocks":[]}} +{"Event":"SparkListenerStageCompleted","Stage Info":{"Stage ID":15,"Stage Attempt ID":0,"Stage Name":"start at StructuredKafkaWordCount.scala:86","Number of Tasks":2,"RDD Info":[{"RDD ID":95,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"231\",\"name\":\"WholeStageCodegen (4)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[94],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":93,"Name":"MapPartitionsRDD","Scope":"{\"id\":\"235\",\"name\":\"WholeStageCodegen (3)\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[92],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":91,"Name":"ShuffledRowRDD","Scope":"{\"id\":\"239\",\"name\":\"Exchange\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[90],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":94,"Name":"StateStoreRDD","Scope":"{\"id\":\"234\",\"name\":\"StateStoreSave\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[93],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0},{"RDD ID":92,"Name":"StateStoreRDD","Scope":"{\"id\":\"238\",\"name\":\"StateStoreRestore\"}","Callsite":"start at StructuredKafkaWordCount.scala:86","Parent IDs":[91],"Storage Level":{"Use Disk":false,"Use Memory":false,"Deserialized":false,"Replication":1},"Barrier":false,"Number of Partitions":2,"Number of Cached Partitions":0,"Memory Size":0,"Disk Size":0}],"Parent IDs":[14],"Details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","Submission Time":1596020226120,"Completion Time":1596020226204,"Accumulables":[{"ID":1115,"Name":"local bytes read","Value":"168","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1160,"Name":"duration","Value":"24","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1151,"Name":"number of total state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1145,"Name":"peak memory","Value":"4718592","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1154,"Name":"time to remove","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1231,"Name":"internal.metrics.resultSize","Value":10885,"Internal":true,"Count Failed Values":true},{"ID":1240,"Name":"internal.metrics.shuffle.read.remoteBytesRead","Value":0,"Internal":true,"Count Failed Values":true},{"ID":1153,"Name":"time to update","Value":"24","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1162,"Name":"peak memory","Value":"524288","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1144,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1243,"Name":"internal.metrics.shuffle.read.fetchWaitTime","Value":0,"Internal":true,"Count Failed Values":true},{"ID":1117,"Name":"records read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1228,"Name":"internal.metrics.executorDeserializeCpuTime","Value":7779306,"Internal":true,"Count Failed Values":true},{"ID":1147,"Name":"time in aggregation build","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1156,"Name":"memory used by state","Value":"1184","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1236,"Name":"internal.metrics.peakExecutionMemory","Value":5242880,"Internal":true,"Count Failed Values":true},{"ID":1227,"Name":"internal.metrics.executorDeserializeTime","Value":6,"Internal":true,"Count Failed Values":true},{"ID":1158,"Name":"count of cache hit on states cache in provider","Value":"28","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1149,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1239,"Name":"internal.metrics.shuffle.read.localBlocksFetched","Value":1,"Internal":true,"Count Failed Values":true},{"ID":1230,"Name":"internal.metrics.executorCpuTime","Value":34068679,"Internal":true,"Count Failed Values":true},{"ID":1152,"Name":"number of updated state rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1242,"Name":"internal.metrics.shuffle.read.localBytesRead","Value":168,"Internal":true,"Count Failed Values":true},{"ID":1116,"Name":"fetch wait time","Value":"0","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1161,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1143,"Name":"duration","Value":"5","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1155,"Name":"time to commit changes","Value":"67","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1164,"Name":"time in aggregation build","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1241,"Name":"internal.metrics.shuffle.read.remoteBytesReadToDisk","Value":0,"Internal":true,"Count Failed Values":true},{"ID":1244,"Name":"internal.metrics.shuffle.read.recordsRead","Value":1,"Internal":true,"Count Failed Values":true},{"ID":1148,"Name":"avg hash probe bucket list iters","Value":"10","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1157,"Name":"estimated size of state only on current version","Value":"456","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1166,"Name":"number of output rows","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"},{"ID":1238,"Name":"internal.metrics.shuffle.read.remoteBlocksFetched","Value":0,"Internal":true,"Count Failed Values":true},{"ID":1229,"Name":"internal.metrics.executorRunTime","Value":125,"Internal":true,"Count Failed Values":true},{"ID":1112,"Name":"local blocks read","Value":"1","Internal":true,"Count Failed Values":true,"Metadata":"sql"}],"Resource Profile Id":0}} +{"Event":"SparkListenerJobEnd","Job ID":7,"Completion Time":1596020226204,"Job Result":{"Result":"JobSucceeded"}} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionStart","executionId":23,"description":"\nid = 8d268dc2-bc9c-4be8-97a9-b135d2943028\nrunId = e225d92f-2545-48f8-87a2-9c0309580f8a\nbatch = 7","details":"org.apache.spark.sql.streaming.DataStreamWriter.start(DataStreamWriter.scala:366)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount$.main(StructuredKafkaWordCount.scala:86)\norg.apache.spark.examples.sql.streaming.StructuredKafkaWordCount.main(StructuredKafkaWordCount.scala)\nsun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\nsun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\nsun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\njava.lang.reflect.Method.invoke(Method.java:498)\norg.apache.spark.deploy.JavaMainApplication.start(SparkApplication.scala:52)\norg.apache.spark.deploy.SparkSubmit.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:934)\norg.apache.spark.deploy.SparkSubmit.doRunMain$1(SparkSubmit.scala:180)\norg.apache.spark.deploy.SparkSubmit.submit(SparkSubmit.scala:203)\norg.apache.spark.deploy.SparkSubmit.doSubmit(SparkSubmit.scala:90)\norg.apache.spark.deploy.SparkSubmit$$anon$2.doSubmit(SparkSubmit.scala:1013)\norg.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:1022)\norg.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)","physicalPlanDescription":"== Physical Plan ==\nLocalTableScan (1)\n\n\n(1) LocalTableScan\nOutput [2]: [value#144, count#145]\nArguments: [value#144, count#145]\n\n","sparkPlanInfo":{"nodeName":"LocalTableScan","simpleString":"LocalTableScan [value#144, count#145]","children":[],"metadata":{},"metrics":[{"name":"number of output rows","accumulatorId":1252,"metricType":"sum"}]},"time":1596020226221} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":23,"time":1596020226230} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":22,"time":1596020226231} +{"Event":"org.apache.spark.sql.execution.ui.SparkListenerSQLExecutionEnd","executionId":21,"time":1596020226231} +{"Event":"org.apache.spark.sql.streaming.StreamingQueryListener$QueryProgressEvent","progress":{"id":"8d268dc2-bc9c-4be8-97a9-b135d2943028","runId":"e225d92f-2545-48f8-87a2-9c0309580f8a","name":null,"timestamp":"2020-07-29T10:57:05.916Z","batchId":7,"batchDuration":341,"durationMs":{"triggerExecution":341,"queryPlanning":24,"getBatch":0,"latestOffset":3,"addBatch":271,"walCommit":14},"eventTime":{},"stateOperators":[{"numRowsTotal":1,"numRowsUpdated":1,"memoryUsedBytes":1184,"numLateInputs":0,"customMetrics":{"stateOnCurrentVersionSizeBytes":456,"loadedMapCacheHitCount":28,"loadedMapCacheMissCount":0}}],"sources":[{"description":"KafkaV2[Subscribe[test5]]","startOffset":"{\"test5\":{\"0\":48881}}","endOffset":"{\"test5\":{\"0\":48917}}","numInputRows":36,"inputRowsPerSecond":101.69491525423729,"processedRowsPerSecond":105.57184750733137}],"sink":{"description":"org.apache.spark.sql.execution.streaming.ConsoleTable$@514ba885","numOutputRows":1},"observedMetrics":{}}} +{"Event":"SparkListenerApplicationEnd","Timestamp":1596020226301} diff --git a/sql/core/src/test/resources/sql-functions/sql-expression-schema.md b/sql/core/src/test/resources/sql-functions/sql-expression-schema.md index 3570fb61e2880..87cabb29cbbeb 100644 --- a/sql/core/src/test/resources/sql-functions/sql-expression-schema.md +++ b/sql/core/src/test/resources/sql-functions/sql-expression-schema.md @@ -1,30 +1,30 @@ ## Summary - - Number of queries: 333 - - Number of expressions that missing example: 34 - - Expressions missing examples: and,string,tinyint,double,smallint,date,decimal,boolean,float,binary,bigint,int,timestamp,cume_dist,dense_rank,input_file_block_length,input_file_block_start,input_file_name,lag,lead,monotonically_increasing_id,ntile,struct,!,not,or,percent_rank,rank,row_number,spark_partition_id,version,window,positive,count_min_sketch + - Number of queries: 352 + - Number of expressions that missing example: 13 + - Expressions missing examples: bigint,binary,boolean,date,decimal,double,float,int,smallint,string,timestamp,tinyint,window ## Schema of Built-in Functions | Class name | Function name or alias | Query example | Output schema | | ---------- | ---------------------- | ------------- | ------------- | | org.apache.spark.sql.catalyst.expressions.Abs | abs | SELECT abs(-1) | struct | -| org.apache.spark.sql.catalyst.expressions.Acos | acos | SELECT acos(1) | struct | -| org.apache.spark.sql.catalyst.expressions.Acosh | acosh | SELECT acosh(1) | struct | +| org.apache.spark.sql.catalyst.expressions.Acos | acos | SELECT acos(1) | struct | +| org.apache.spark.sql.catalyst.expressions.Acosh | acosh | SELECT acosh(1) | struct | | org.apache.spark.sql.catalyst.expressions.Add | + | SELECT 1 + 2 | struct<(1 + 2):int> | -| org.apache.spark.sql.catalyst.expressions.AddMonths | add_months | SELECT add_months('2016-08-31', 1) | struct | -| org.apache.spark.sql.catalyst.expressions.And | and | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.AddMonths | add_months | SELECT add_months('2016-08-31', 1) | struct | +| org.apache.spark.sql.catalyst.expressions.And | and | SELECT true and true | struct<(true AND true):boolean> | | org.apache.spark.sql.catalyst.expressions.ArrayAggregate | aggregate | SELECT aggregate(array(1, 2, 3), 0, (acc, x) -> acc + x) | struct | | org.apache.spark.sql.catalyst.expressions.ArrayContains | array_contains | SELECT array_contains(array(1, 2, 3), 2) | struct | -| org.apache.spark.sql.catalyst.expressions.ArrayDistinct | array_distinct | SELECT array_distinct(array(1, 2, 3, null, 3)) | struct> | +| org.apache.spark.sql.catalyst.expressions.ArrayDistinct | array_distinct | SELECT array_distinct(array(1, 2, 3, null, 3)) | struct> | | org.apache.spark.sql.catalyst.expressions.ArrayExcept | array_except | SELECT array_except(array(1, 2, 3), array(1, 3, 5)) | struct> | | org.apache.spark.sql.catalyst.expressions.ArrayExists | exists | SELECT exists(array(1, 2, 3), x -> x % 2 == 0) | struct | | org.apache.spark.sql.catalyst.expressions.ArrayFilter | filter | SELECT filter(array(1, 2, 3), x -> x % 2 == 1) | struct> | | org.apache.spark.sql.catalyst.expressions.ArrayForAll | forall | SELECT forall(array(1, 2, 3), x -> x % 2 == 0) | struct | | org.apache.spark.sql.catalyst.expressions.ArrayIntersect | array_intersect | SELECT array_intersect(array(1, 2, 3), array(1, 3, 5)) | struct> | | org.apache.spark.sql.catalyst.expressions.ArrayJoin | array_join | SELECT array_join(array('hello', 'world'), ' ') | struct | -| org.apache.spark.sql.catalyst.expressions.ArrayMax | array_max | SELECT array_max(array(1, 20, null, 3)) | struct | -| org.apache.spark.sql.catalyst.expressions.ArrayMin | array_min | SELECT array_min(array(1, 20, null, 3)) | struct | +| org.apache.spark.sql.catalyst.expressions.ArrayMax | array_max | SELECT array_max(array(1, 20, null, 3)) | struct | +| org.apache.spark.sql.catalyst.expressions.ArrayMin | array_min | SELECT array_min(array(1, 20, null, 3)) | struct | | org.apache.spark.sql.catalyst.expressions.ArrayPosition | array_position | SELECT array_position(array(3, 2, 1), 1) | struct | -| org.apache.spark.sql.catalyst.expressions.ArrayRemove | array_remove | SELECT array_remove(array(1, 2, 3, null, 3), 3) | struct> | +| org.apache.spark.sql.catalyst.expressions.ArrayRemove | array_remove | SELECT array_remove(array(1, 2, 3, null, 3), 3) | struct> | | org.apache.spark.sql.catalyst.expressions.ArrayRepeat | array_repeat | SELECT array_repeat('123', 2) | struct> | | org.apache.spark.sql.catalyst.expressions.ArraySort | array_sort | SELECT array_sort(array(5, 6, 1), (left, right) -> case when left < right then -1 when left > right then 1 else 0 end) | struct namedlambdavariable()) THEN 1 ELSE 0 END, namedlambdavariable(), namedlambdavariable())):array> | | org.apache.spark.sql.catalyst.expressions.ArrayTransform | transform | SELECT transform(array(1, 2, 3), x -> x + 1) | struct> | @@ -32,71 +32,76 @@ | org.apache.spark.sql.catalyst.expressions.ArraysOverlap | arrays_overlap | SELECT arrays_overlap(array(1, 2, 3), array(3, 4, 5)) | struct | | org.apache.spark.sql.catalyst.expressions.ArraysZip | arrays_zip | SELECT arrays_zip(array(1, 2, 3), array(2, 3, 4)) | struct>> | | org.apache.spark.sql.catalyst.expressions.Ascii | ascii | SELECT ascii('222') | struct | -| org.apache.spark.sql.catalyst.expressions.Asin | asin | SELECT asin(0) | struct | -| org.apache.spark.sql.catalyst.expressions.Asinh | asinh | SELECT asinh(0) | struct | -| org.apache.spark.sql.catalyst.expressions.AssertTrue | assert_true | SELECT assert_true(0 < 1) | struct | -| org.apache.spark.sql.catalyst.expressions.Atan | atan | SELECT atan(0) | struct | -| org.apache.spark.sql.catalyst.expressions.Atan2 | atan2 | SELECT atan2(0, 0) | struct | -| org.apache.spark.sql.catalyst.expressions.Atanh | atanh | SELECT atanh(0) | struct | +| org.apache.spark.sql.catalyst.expressions.Asin | asin | SELECT asin(0) | struct | +| org.apache.spark.sql.catalyst.expressions.Asinh | asinh | SELECT asinh(0) | struct | +| org.apache.spark.sql.catalyst.expressions.AssertTrue | assert_true | SELECT assert_true(0 < 1) | struct | +| org.apache.spark.sql.catalyst.expressions.Atan | atan | SELECT atan(0) | struct | +| org.apache.spark.sql.catalyst.expressions.Atan2 | atan2 | SELECT atan2(0, 0) | struct | +| org.apache.spark.sql.catalyst.expressions.Atanh | atanh | SELECT atanh(0) | struct | | org.apache.spark.sql.catalyst.expressions.BRound | bround | SELECT bround(2.5, 0) | struct | -| org.apache.spark.sql.catalyst.expressions.Base64 | base64 | SELECT base64('Spark SQL') | struct | -| org.apache.spark.sql.catalyst.expressions.Bin | bin | SELECT bin(13) | struct | +| org.apache.spark.sql.catalyst.expressions.Base64 | base64 | SELECT base64('Spark SQL') | struct | +| org.apache.spark.sql.catalyst.expressions.Bin | bin | SELECT bin(13) | struct | | org.apache.spark.sql.catalyst.expressions.BitLength | bit_length | SELECT bit_length('Spark SQL') | struct | | org.apache.spark.sql.catalyst.expressions.BitwiseAnd | & | SELECT 3 & 5 | struct<(3 & 5):int> | | org.apache.spark.sql.catalyst.expressions.BitwiseCount | bit_count | SELECT bit_count(0) | struct | +| org.apache.spark.sql.catalyst.expressions.BitwiseGet | bit_get | SELECT bit_get(11, 0) | struct | +| org.apache.spark.sql.catalyst.expressions.BitwiseGet | getbit | SELECT getbit(11, 0) | struct | | org.apache.spark.sql.catalyst.expressions.BitwiseNot | ~ | SELECT ~ 0 | struct<~0:int> | | org.apache.spark.sql.catalyst.expressions.BitwiseOr | | | SELECT 3 | 5 | struct<(3 | 5):int> | | org.apache.spark.sql.catalyst.expressions.BitwiseXor | ^ | SELECT 3 ^ 5 | struct<(3 ^ 5):int> | | org.apache.spark.sql.catalyst.expressions.CallMethodViaReflection | java_method | SELECT java_method('java.util.UUID', 'randomUUID') | struct | | org.apache.spark.sql.catalyst.expressions.CallMethodViaReflection | reflect | SELECT reflect('java.util.UUID', 'randomUUID') | struct | -| org.apache.spark.sql.catalyst.expressions.CaseWhen | when | SELECT CASE WHEN 1 > 0 THEN 1 WHEN 2 > 0 THEN 2.0 ELSE 1.2 END | struct 0) THEN CAST(1 AS DECIMAL(11,1)) WHEN (2 > 0) THEN CAST(2.0 AS DECIMAL(11,1)) ELSE CAST(1.2 AS DECIMAL(11,1)) END:decimal(11,1)> | -| org.apache.spark.sql.catalyst.expressions.Cast | string | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.CaseWhen | when | SELECT CASE WHEN 1 > 0 THEN 1 WHEN 2 > 0 THEN 2.0 ELSE 1.2 END | struct 0) THEN 1 WHEN (2 > 0) THEN 2.0 ELSE 1.2 END:decimal(11,1)> | +| org.apache.spark.sql.catalyst.expressions.Cast | bigint | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.Cast | binary | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.Cast | boolean | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | cast | SELECT cast('10' as int) | struct | -| org.apache.spark.sql.catalyst.expressions.Cast | tinyint | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.Cast | double | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.Cast | smallint | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | date | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | decimal | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.Cast | boolean | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.Cast | double | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | float | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.Cast | binary | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.Cast | bigint | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | int | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.Cast | smallint | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.Cast | string | N/A | N/A | | org.apache.spark.sql.catalyst.expressions.Cast | timestamp | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.Cbrt | cbrt | SELECT cbrt(27.0) | struct | +| org.apache.spark.sql.catalyst.expressions.Cast | tinyint | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.Cbrt | cbrt | SELECT cbrt(27.0) | struct | | org.apache.spark.sql.catalyst.expressions.Ceil | ceil | SELECT ceil(-0.1) | struct | | org.apache.spark.sql.catalyst.expressions.Ceil | ceiling | SELECT ceiling(-0.1) | struct | -| org.apache.spark.sql.catalyst.expressions.Chr | char | SELECT char(65) | struct | -| org.apache.spark.sql.catalyst.expressions.Chr | chr | SELECT chr(65) | struct | -| org.apache.spark.sql.catalyst.expressions.Coalesce | coalesce | SELECT coalesce(NULL, 1, NULL) | struct | +| org.apache.spark.sql.catalyst.expressions.Chr | char | SELECT char(65) | struct | +| org.apache.spark.sql.catalyst.expressions.Chr | chr | SELECT chr(65) | struct | +| org.apache.spark.sql.catalyst.expressions.Coalesce | coalesce | SELECT coalesce(NULL, 1, NULL) | struct | | org.apache.spark.sql.catalyst.expressions.Concat | concat | SELECT concat('Spark', 'SQL') | struct | | org.apache.spark.sql.catalyst.expressions.ConcatWs | concat_ws | SELECT concat_ws(' ', 'Spark', 'SQL') | struct | | org.apache.spark.sql.catalyst.expressions.Conv | conv | SELECT conv('100', 2, 10) | struct | -| org.apache.spark.sql.catalyst.expressions.Cos | cos | SELECT cos(0) | struct | -| org.apache.spark.sql.catalyst.expressions.Cosh | cosh | SELECT cosh(0) | struct | -| org.apache.spark.sql.catalyst.expressions.Cot | cot | SELECT cot(1) | struct | -| org.apache.spark.sql.catalyst.expressions.Crc32 | crc32 | SELECT crc32('Spark') | struct | +| org.apache.spark.sql.catalyst.expressions.Cos | cos | SELECT cos(0) | struct | +| org.apache.spark.sql.catalyst.expressions.Cosh | cosh | SELECT cosh(0) | struct | +| org.apache.spark.sql.catalyst.expressions.Cot | cot | SELECT cot(1) | struct | +| org.apache.spark.sql.catalyst.expressions.Crc32 | crc32 | SELECT crc32('Spark') | struct | | org.apache.spark.sql.catalyst.expressions.CreateArray | array | SELECT array(1, 2, 3) | struct> | | org.apache.spark.sql.catalyst.expressions.CreateMap | map | SELECT map(1.0, '2', 3.0, '4') | struct> | | org.apache.spark.sql.catalyst.expressions.CreateNamedStruct | named_struct | SELECT named_struct("a", 1, "b", 2, "c", 3) | struct> | +| org.apache.spark.sql.catalyst.expressions.CreateNamedStruct | struct | SELECT struct(1, 2, 3) | struct> | | org.apache.spark.sql.catalyst.expressions.CsvToStructs | from_csv | SELECT from_csv('1, 0.8', 'a INT, b DOUBLE') | struct> | -| org.apache.spark.sql.catalyst.expressions.Cube | cube | SELECT name, age, count(*) FROM VALUES (2, 'Alice'), (5, 'Bob') people(age, name) GROUP BY cube(name, age) | struct | -| org.apache.spark.sql.catalyst.expressions.CumeDist | cume_dist | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.CumeDist | cume_dist | SELECT a, b, cume_dist() OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct | +| org.apache.spark.sql.catalyst.expressions.CurrentCatalog | current_catalog | SELECT current_catalog() | struct | | org.apache.spark.sql.catalyst.expressions.CurrentDatabase | current_database | SELECT current_database() | struct | | org.apache.spark.sql.catalyst.expressions.CurrentDate | current_date | SELECT current_date() | struct | +| org.apache.spark.sql.catalyst.expressions.CurrentTimeZone | current_timezone | SELECT current_timezone() | struct | | org.apache.spark.sql.catalyst.expressions.CurrentTimestamp | current_timestamp | SELECT current_timestamp() | struct | -| org.apache.spark.sql.catalyst.expressions.DateAdd | date_add | SELECT date_add('2016-07-30', 1) | struct | -| org.apache.spark.sql.catalyst.expressions.DateDiff | datediff | SELECT datediff('2009-07-31', '2009-07-30') | struct | -| org.apache.spark.sql.catalyst.expressions.DateFormatClass | date_format | SELECT date_format('2016-04-08', 'y') | struct | +| org.apache.spark.sql.catalyst.expressions.DateAdd | date_add | SELECT date_add('2016-07-30', 1) | struct | +| org.apache.spark.sql.catalyst.expressions.DateDiff | datediff | SELECT datediff('2009-07-31', '2009-07-30') | struct | +| org.apache.spark.sql.catalyst.expressions.DateFormatClass | date_format | SELECT date_format('2016-04-08', 'y') | struct | +| org.apache.spark.sql.catalyst.expressions.DateFromUnixDate | date_from_unix_date | SELECT date_from_unix_date(1) | struct | | org.apache.spark.sql.catalyst.expressions.DatePart | date_part | SELECT date_part('YEAR', TIMESTAMP '2019-08-12 01:00:00.123456') | struct | -| org.apache.spark.sql.catalyst.expressions.DateSub | date_sub | SELECT date_sub('2016-07-30', 1) | struct | -| org.apache.spark.sql.catalyst.expressions.DayOfMonth | day | SELECT day('2009-07-30') | struct | -| org.apache.spark.sql.catalyst.expressions.DayOfMonth | dayofmonth | SELECT dayofmonth('2009-07-30') | struct | -| org.apache.spark.sql.catalyst.expressions.DayOfWeek | dayofweek | SELECT dayofweek('2009-07-30') | struct | -| org.apache.spark.sql.catalyst.expressions.DayOfYear | dayofyear | SELECT dayofyear('2016-04-09') | struct | +| org.apache.spark.sql.catalyst.expressions.DateSub | date_sub | SELECT date_sub('2016-07-30', 1) | struct | +| org.apache.spark.sql.catalyst.expressions.DayOfMonth | day | SELECT day('2009-07-30') | struct | +| org.apache.spark.sql.catalyst.expressions.DayOfMonth | dayofmonth | SELECT dayofmonth('2009-07-30') | struct | +| org.apache.spark.sql.catalyst.expressions.DayOfWeek | dayofweek | SELECT dayofweek('2009-07-30') | struct | +| org.apache.spark.sql.catalyst.expressions.DayOfYear | dayofyear | SELECT dayofyear('2016-04-09') | struct | | org.apache.spark.sql.catalyst.expressions.Decode | decode | SELECT decode(encode('abc', 'utf-8'), 'utf-8') | struct | -| org.apache.spark.sql.catalyst.expressions.DenseRank | dense_rank | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.Divide | / | SELECT 3 / 2 | struct<(CAST(3 AS DOUBLE) / CAST(2 AS DOUBLE)):double> | +| org.apache.spark.sql.catalyst.expressions.DenseRank | dense_rank | SELECT a, b, dense_rank(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct | +| org.apache.spark.sql.catalyst.expressions.Divide | / | SELECT 3 / 2 | struct<(3 / 2):double> | | org.apache.spark.sql.catalyst.expressions.ElementAt | element_at | SELECT element_at(array(1, 2, 3), 2) | struct | | org.apache.spark.sql.catalyst.expressions.Elt | elt | SELECT elt(1, 'scala', 'java') | struct | | org.apache.spark.sql.catalyst.expressions.Encode | encode | SELECT encode('abc', 'utf-8') | struct | @@ -104,38 +109,38 @@ | org.apache.spark.sql.catalyst.expressions.EqualTo | = | SELECT 2 = 2 | struct<(2 = 2):boolean> | | org.apache.spark.sql.catalyst.expressions.EqualTo | == | SELECT 2 == 2 | struct<(2 = 2):boolean> | | org.apache.spark.sql.catalyst.expressions.EulerNumber | e | SELECT e() | struct | -| org.apache.spark.sql.catalyst.expressions.Exp | exp | SELECT exp(0) | struct | +| org.apache.spark.sql.catalyst.expressions.Exp | exp | SELECT exp(0) | struct | | org.apache.spark.sql.catalyst.expressions.Explode | explode | SELECT explode(array(10, 20)) | struct | | org.apache.spark.sql.catalyst.expressions.Explode | explode_outer | SELECT explode_outer(array(10, 20)) | struct | -| org.apache.spark.sql.catalyst.expressions.Expm1 | expm1 | SELECT expm1(0) | struct | +| org.apache.spark.sql.catalyst.expressions.Expm1 | expm1 | SELECT expm1(0) | struct | | org.apache.spark.sql.catalyst.expressions.Extract | extract | SELECT extract(YEAR FROM TIMESTAMP '2019-08-12 01:00:00.123456') | struct | | org.apache.spark.sql.catalyst.expressions.Factorial | factorial | SELECT factorial(5) | struct | | org.apache.spark.sql.catalyst.expressions.FindInSet | find_in_set | SELECT find_in_set('ab','abc,b,ab,c,def') | struct | | org.apache.spark.sql.catalyst.expressions.Flatten | flatten | SELECT flatten(array(array(1, 2), array(3, 4))) | struct> | | org.apache.spark.sql.catalyst.expressions.Floor | floor | SELECT floor(-0.1) | struct | | org.apache.spark.sql.catalyst.expressions.FormatNumber | format_number | SELECT format_number(12332.123456, 4) | struct | -| org.apache.spark.sql.catalyst.expressions.FormatString | printf | SELECT printf("Hello World %d %s", 100, "days") | struct | | org.apache.spark.sql.catalyst.expressions.FormatString | format_string | SELECT format_string("Hello World %d %s", 100, "days") | struct | -| org.apache.spark.sql.catalyst.expressions.FromUTCTimestamp | from_utc_timestamp | SELECT from_utc_timestamp('2016-08-31', 'Asia/Seoul') | struct | -| org.apache.spark.sql.catalyst.expressions.FromUnixTime | from_unixtime | SELECT from_unixtime(0, 'yyyy-MM-dd HH:mm:ss') | struct | +| org.apache.spark.sql.catalyst.expressions.FormatString | printf | SELECT printf("Hello World %d %s", 100, "days") | struct | +| org.apache.spark.sql.catalyst.expressions.FromUTCTimestamp | from_utc_timestamp | SELECT from_utc_timestamp('2016-08-31', 'Asia/Seoul') | struct | +| org.apache.spark.sql.catalyst.expressions.FromUnixTime | from_unixtime | SELECT from_unixtime(0, 'yyyy-MM-dd HH:mm:ss') | struct | | org.apache.spark.sql.catalyst.expressions.GetJsonObject | get_json_object | SELECT get_json_object('{"a":"b"}', '$.a') | struct | | org.apache.spark.sql.catalyst.expressions.GreaterThan | > | SELECT 2 > 1 | struct<(2 > 1):boolean> | | org.apache.spark.sql.catalyst.expressions.GreaterThanOrEqual | >= | SELECT 2 >= 1 | struct<(2 >= 1):boolean> | | org.apache.spark.sql.catalyst.expressions.Greatest | greatest | SELECT greatest(10, 9, 2, 4, 3) | struct | | org.apache.spark.sql.catalyst.expressions.Grouping | grouping | SELECT name, grouping(name), sum(age) FROM VALUES (2, 'Alice'), (5, 'Bob') people(age, name) GROUP BY cube(name) | struct | | org.apache.spark.sql.catalyst.expressions.GroupingID | grouping_id | SELECT name, grouping_id(), sum(age), avg(height) FROM VALUES (2, 'Alice', 165), (5, 'Bob', 180) people(age, name, height) GROUP BY cube(name, height) | struct | -| org.apache.spark.sql.catalyst.expressions.Hex | hex | SELECT hex(17) | struct | -| org.apache.spark.sql.catalyst.expressions.Hour | hour | SELECT hour('2009-07-30 12:58:59') | struct | -| org.apache.spark.sql.catalyst.expressions.Hypot | hypot | SELECT hypot(3, 4) | struct | +| org.apache.spark.sql.catalyst.expressions.Hex | hex | SELECT hex(17) | struct | +| org.apache.spark.sql.catalyst.expressions.Hour | hour | SELECT hour('2009-07-30 12:58:59') | struct | +| org.apache.spark.sql.catalyst.expressions.Hypot | hypot | SELECT hypot(3, 4) | struct | | org.apache.spark.sql.catalyst.expressions.If | if | SELECT if(1 < 2, 'a', 'b') | struct<(IF((1 < 2), a, b)):string> | | org.apache.spark.sql.catalyst.expressions.IfNull | ifnull | SELECT ifnull(NULL, array('2')) | struct> | | org.apache.spark.sql.catalyst.expressions.In | in | SELECT 1 in(1, 2, 3) | struct<(1 IN (1, 2, 3)):boolean> | | org.apache.spark.sql.catalyst.expressions.InitCap | initcap | SELECT initcap('sPark sql') | struct | | org.apache.spark.sql.catalyst.expressions.Inline | inline | SELECT inline(array(struct(1, 'a'), struct(2, 'b'))) | struct | | org.apache.spark.sql.catalyst.expressions.Inline | inline_outer | SELECT inline_outer(array(struct(1, 'a'), struct(2, 'b'))) | struct | -| org.apache.spark.sql.catalyst.expressions.InputFileBlockLength | input_file_block_length | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.InputFileBlockStart | input_file_block_start | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.InputFileName | input_file_name | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.InputFileBlockLength | input_file_block_length | SELECT input_file_block_length() | struct | +| org.apache.spark.sql.catalyst.expressions.InputFileBlockStart | input_file_block_start | SELECT input_file_block_start() | struct | +| org.apache.spark.sql.catalyst.expressions.InputFileName | input_file_name | SELECT input_file_name() | struct | | org.apache.spark.sql.catalyst.expressions.IntegralDivide | div | SELECT 3 div 2 | struct<(3 div 2):bigint> | | org.apache.spark.sql.catalyst.expressions.IsNaN | isnan | SELECT isnan(cast('NaN' as double)) | struct | | org.apache.spark.sql.catalyst.expressions.IsNotNull | isnotnull | SELECT isnotnull(1) | struct<(1 IS NOT NULL):boolean> | @@ -143,112 +148,118 @@ | org.apache.spark.sql.catalyst.expressions.JsonObjectKeys | json_object_keys | SELECT json_object_keys('{}') | struct> | | org.apache.spark.sql.catalyst.expressions.JsonToStructs | from_json | SELECT from_json('{"a":1, "b":0.8}', 'a INT, b DOUBLE') | struct> | | org.apache.spark.sql.catalyst.expressions.JsonTuple | json_tuple | SELECT json_tuple('{"a":1, "b":2}', 'a', 'b') | struct | -| org.apache.spark.sql.catalyst.expressions.Lag | lag | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.LastDay | last_day | SELECT last_day('2009-01-12') | struct | -| org.apache.spark.sql.catalyst.expressions.Lead | lead | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.Lag | lag | SELECT a, b, lag(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct | +| org.apache.spark.sql.catalyst.expressions.LastDay | last_day | SELECT last_day('2009-01-12') | struct | +| org.apache.spark.sql.catalyst.expressions.Lead | lead | SELECT a, b, lead(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct | | org.apache.spark.sql.catalyst.expressions.Least | least | SELECT least(10, 9, 2, 4, 3) | struct | | org.apache.spark.sql.catalyst.expressions.Left | left | SELECT left('Spark SQL', 3) | struct | -| org.apache.spark.sql.catalyst.expressions.Length | character_length | SELECT character_length('Spark SQL ') | struct | | org.apache.spark.sql.catalyst.expressions.Length | char_length | SELECT char_length('Spark SQL ') | struct | +| org.apache.spark.sql.catalyst.expressions.Length | character_length | SELECT character_length('Spark SQL ') | struct | | org.apache.spark.sql.catalyst.expressions.Length | length | SELECT length('Spark SQL ') | struct | | org.apache.spark.sql.catalyst.expressions.LengthOfJsonArray | json_array_length | SELECT json_array_length('[1,2,3,4]') | struct | | org.apache.spark.sql.catalyst.expressions.LessThan | < | SELECT 1 < 2 | struct<(1 < 2):boolean> | | org.apache.spark.sql.catalyst.expressions.LessThanOrEqual | <= | SELECT 2 <= 2 | struct<(2 <= 2):boolean> | | org.apache.spark.sql.catalyst.expressions.Levenshtein | levenshtein | SELECT levenshtein('kitten', 'sitting') | struct | | org.apache.spark.sql.catalyst.expressions.Like | like | SELECT like('Spark', '_park') | struct | -| org.apache.spark.sql.catalyst.expressions.Log | ln | SELECT ln(1) | struct | -| org.apache.spark.sql.catalyst.expressions.Log10 | log10 | SELECT log10(10) | struct | -| org.apache.spark.sql.catalyst.expressions.Log1p | log1p | SELECT log1p(0) | struct | -| org.apache.spark.sql.catalyst.expressions.Log2 | log2 | SELECT log2(2) | struct | -| org.apache.spark.sql.catalyst.expressions.Logarithm | log | SELECT log(10, 100) | struct | -| org.apache.spark.sql.catalyst.expressions.Lower | lcase | SELECT lcase('SparkSql') | struct | +| org.apache.spark.sql.catalyst.expressions.Log | ln | SELECT ln(1) | struct | +| org.apache.spark.sql.catalyst.expressions.Log10 | log10 | SELECT log10(10) | struct | +| org.apache.spark.sql.catalyst.expressions.Log1p | log1p | SELECT log1p(0) | struct | +| org.apache.spark.sql.catalyst.expressions.Log2 | log2 | SELECT log2(2) | struct | +| org.apache.spark.sql.catalyst.expressions.Logarithm | log | SELECT log(10, 100) | struct | +| org.apache.spark.sql.catalyst.expressions.Lower | lcase | SELECT lcase('SparkSql') | struct | | org.apache.spark.sql.catalyst.expressions.Lower | lower | SELECT lower('SparkSql') | struct | | org.apache.spark.sql.catalyst.expressions.MakeDate | make_date | SELECT make_date(2013, 7, 15) | struct | -| org.apache.spark.sql.catalyst.expressions.MakeInterval | make_interval | SELECT make_interval(100, 11, 1, 1, 12, 30, 01.001001) | struct | -| org.apache.spark.sql.catalyst.expressions.MakeTimestamp | make_timestamp | SELECT make_timestamp(2014, 12, 28, 6, 30, 45.887) | struct | +| org.apache.spark.sql.catalyst.expressions.MakeInterval | make_interval | SELECT make_interval(100, 11, 1, 1, 12, 30, 01.001001) | struct | +| org.apache.spark.sql.catalyst.expressions.MakeTimestamp | make_timestamp | SELECT make_timestamp(2014, 12, 28, 6, 30, 45.887) | struct | | org.apache.spark.sql.catalyst.expressions.MapConcat | map_concat | SELECT map_concat(map(1, 'a', 2, 'b'), map(3, 'c')) | struct> | | org.apache.spark.sql.catalyst.expressions.MapEntries | map_entries | SELECT map_entries(map(1, 'a', 2, 'b')) | struct>> | | org.apache.spark.sql.catalyst.expressions.MapFilter | map_filter | SELECT map_filter(map(1, 0, 2, 2, 3, -1), (k, v) -> k > v) | struct namedlambdavariable()), namedlambdavariable(), namedlambdavariable())):map> | | org.apache.spark.sql.catalyst.expressions.MapFromArrays | map_from_arrays | SELECT map_from_arrays(array(1.0, 3.0), array('2', '4')) | struct> | -| org.apache.spark.sql.catalyst.expressions.MapFromEntries | map_from_entries | SELECT map_from_entries(array(struct(1, 'a'), struct(2, 'b'))) | struct> | +| org.apache.spark.sql.catalyst.expressions.MapFromEntries | map_from_entries | SELECT map_from_entries(array(struct(1, 'a'), struct(2, 'b'))) | struct> | | org.apache.spark.sql.catalyst.expressions.MapKeys | map_keys | SELECT map_keys(map(1, 'a', 2, 'b')) | struct> | | org.apache.spark.sql.catalyst.expressions.MapValues | map_values | SELECT map_values(map(1, 'a', 2, 'b')) | struct> | | org.apache.spark.sql.catalyst.expressions.MapZipWith | map_zip_with | SELECT map_zip_with(map(1, 'a', 2, 'b'), map(1, 'x', 2, 'y'), (k, v1, v2) -> concat(v1, v2)) | struct> | -| org.apache.spark.sql.catalyst.expressions.Md5 | md5 | SELECT md5('Spark') | struct | -| org.apache.spark.sql.catalyst.expressions.Minute | minute | SELECT minute('2009-07-30 12:58:59') | struct | -| org.apache.spark.sql.catalyst.expressions.MonotonicallyIncreasingID | monotonically_increasing_id | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.Month | month | SELECT month('2016-07-30') | struct | -| org.apache.spark.sql.catalyst.expressions.MonthsBetween | months_between | SELECT months_between('1997-02-28 10:30:00', '1996-10-30') | struct | +| org.apache.spark.sql.catalyst.expressions.Md5 | md5 | SELECT md5('Spark') | struct | +| org.apache.spark.sql.catalyst.expressions.MicrosToTimestamp | timestamp_micros | SELECT timestamp_micros(1230219000123123) | struct | +| org.apache.spark.sql.catalyst.expressions.MillisToTimestamp | timestamp_millis | SELECT timestamp_millis(1230219000123) | struct | +| org.apache.spark.sql.catalyst.expressions.Minute | minute | SELECT minute('2009-07-30 12:58:59') | struct | +| org.apache.spark.sql.catalyst.expressions.MonotonicallyIncreasingID | monotonically_increasing_id | SELECT monotonically_increasing_id() | struct | +| org.apache.spark.sql.catalyst.expressions.Month | month | SELECT month('2016-07-30') | struct | +| org.apache.spark.sql.catalyst.expressions.MonthsBetween | months_between | SELECT months_between('1997-02-28 10:30:00', '1996-10-30') | struct | | org.apache.spark.sql.catalyst.expressions.Multiply | * | SELECT 2 * 3 | struct<(2 * 3):int> | | org.apache.spark.sql.catalyst.expressions.Murmur3Hash | hash | SELECT hash('Spark', array(123), 2) | struct | -| org.apache.spark.sql.catalyst.expressions.NTile | ntile | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.NaNvl | nanvl | SELECT nanvl(cast('NaN' as double), 123) | struct | -| org.apache.spark.sql.catalyst.expressions.NamedStruct | struct | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.NextDay | next_day | SELECT next_day('2015-01-14', 'TU') | struct | -| org.apache.spark.sql.catalyst.expressions.Not | ! | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.Not | not | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.NTile | ntile | SELECT a, b, ntile(2) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct | +| org.apache.spark.sql.catalyst.expressions.NaNvl | nanvl | SELECT nanvl(cast('NaN' as double), 123) | struct | +| org.apache.spark.sql.catalyst.expressions.NextDay | next_day | SELECT next_day('2015-01-14', 'TU') | struct | +| org.apache.spark.sql.catalyst.expressions.Not | ! | SELECT ! true | struct<(NOT true):boolean> | +| org.apache.spark.sql.catalyst.expressions.Not | not | SELECT not true | struct<(NOT true):boolean> | | org.apache.spark.sql.catalyst.expressions.Now | now | SELECT now() | struct | +| org.apache.spark.sql.catalyst.expressions.NthValue | nth_value | SELECT a, b, nth_value(b, 2) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct | | org.apache.spark.sql.catalyst.expressions.NullIf | nullif | SELECT nullif(2, 2) | struct | | org.apache.spark.sql.catalyst.expressions.Nvl | nvl | SELECT nvl(NULL, array('2')) | struct> | | org.apache.spark.sql.catalyst.expressions.Nvl2 | nvl2 | SELECT nvl2(NULL, 2, 1) | struct | | org.apache.spark.sql.catalyst.expressions.OctetLength | octet_length | SELECT octet_length('Spark SQL') | struct | -| org.apache.spark.sql.catalyst.expressions.Or | or | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.Or | or | SELECT true or false | struct<(true OR false):boolean> | | org.apache.spark.sql.catalyst.expressions.Overlay | overlay | SELECT overlay('Spark SQL' PLACING '_' FROM 6) | struct | | org.apache.spark.sql.catalyst.expressions.ParseToDate | to_date | SELECT to_date('2009-07-30 04:17:52') | struct | | org.apache.spark.sql.catalyst.expressions.ParseToTimestamp | to_timestamp | SELECT to_timestamp('2016-12-31 00:12:00') | struct | | org.apache.spark.sql.catalyst.expressions.ParseUrl | parse_url | SELECT parse_url('http://spark.apache.org/path?query=1', 'HOST') | struct | -| org.apache.spark.sql.catalyst.expressions.PercentRank | percent_rank | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.PercentRank | percent_rank | SELECT a, b, percent_rank(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct | | org.apache.spark.sql.catalyst.expressions.Pi | pi | SELECT pi() | struct | | org.apache.spark.sql.catalyst.expressions.Pmod | pmod | SELECT pmod(10, 3) | struct | -| org.apache.spark.sql.catalyst.expressions.PosExplode | posexplode_outer | SELECT posexplode_outer(array(10,20)) | struct | | org.apache.spark.sql.catalyst.expressions.PosExplode | posexplode | SELECT posexplode(array(10,20)) | struct | -| org.apache.spark.sql.catalyst.expressions.Pow | pow | SELECT pow(2, 3) | struct | -| org.apache.spark.sql.catalyst.expressions.Pow | power | SELECT power(2, 3) | struct | -| org.apache.spark.sql.catalyst.expressions.Quarter | quarter | SELECT quarter('2016-08-31') | struct | -| org.apache.spark.sql.catalyst.expressions.RLike | rlike | SELECT '%SystemDrive%\Users\John' rlike '%SystemDrive%\\Users.*' | struct<%SystemDrive%UsersJohn RLIKE %SystemDrive%\Users.*:boolean> | -| org.apache.spark.sql.catalyst.expressions.Rand | random | SELECT random() | struct | +| org.apache.spark.sql.catalyst.expressions.PosExplode | posexplode_outer | SELECT posexplode_outer(array(10,20)) | struct | +| org.apache.spark.sql.catalyst.expressions.Pow | pow | SELECT pow(2, 3) | struct | +| org.apache.spark.sql.catalyst.expressions.Pow | power | SELECT power(2, 3) | struct | +| org.apache.spark.sql.catalyst.expressions.Quarter | quarter | SELECT quarter('2016-08-31') | struct | +| org.apache.spark.sql.catalyst.expressions.RLike | regexp | SELECT regexp('%SystemDrive%\Users\John', '%SystemDrive%\\Users.*') | struct | +| org.apache.spark.sql.catalyst.expressions.RLike | regexp_like | SELECT regexp_like('%SystemDrive%\Users\John', '%SystemDrive%\\Users.*') | struct | +| org.apache.spark.sql.catalyst.expressions.RLike | rlike | SELECT rlike('%SystemDrive%\Users\John', '%SystemDrive%\\Users.*') | struct | +| org.apache.spark.sql.catalyst.expressions.RaiseError | raise_error | SELECT raise_error('custom error message') | struct | | org.apache.spark.sql.catalyst.expressions.Rand | rand | SELECT rand() | struct | +| org.apache.spark.sql.catalyst.expressions.Rand | random | SELECT random() | struct | | org.apache.spark.sql.catalyst.expressions.Randn | randn | SELECT randn() | struct | -| org.apache.spark.sql.catalyst.expressions.Rank | rank | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.Rank | rank | SELECT a, b, rank(b) OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct | | org.apache.spark.sql.catalyst.expressions.RegExpExtract | regexp_extract | SELECT regexp_extract('100-200', '(\\d+)-(\\d+)', 1) | struct | -| org.apache.spark.sql.catalyst.expressions.RegExpReplace | regexp_replace | SELECT regexp_replace('100-200', '(\\d+)', 'num') | struct | -| org.apache.spark.sql.catalyst.expressions.Remainder | % | SELECT 2 % 1.8 | struct<(CAST(CAST(2 AS DECIMAL(1,0)) AS DECIMAL(2,1)) % CAST(1.8 AS DECIMAL(2,1))):decimal(2,1)> | -| org.apache.spark.sql.catalyst.expressions.Remainder | mod | SELECT 2 % 1.8 | struct<(CAST(CAST(2 AS DECIMAL(1,0)) AS DECIMAL(2,1)) % CAST(1.8 AS DECIMAL(2,1))):decimal(2,1)> | +| org.apache.spark.sql.catalyst.expressions.RegExpExtractAll | regexp_extract_all | SELECT regexp_extract_all('100-200, 300-400', '(\\d+)-(\\d+)', 1) | struct> | +| org.apache.spark.sql.catalyst.expressions.RegExpReplace | regexp_replace | SELECT regexp_replace('100-200', '(\\d+)', 'num') | struct | +| org.apache.spark.sql.catalyst.expressions.Remainder | % | SELECT 2 % 1.8 | struct<(2 % 1.8):decimal(2,1)> | +| org.apache.spark.sql.catalyst.expressions.Remainder | mod | SELECT 2 % 1.8 | struct<(2 % 1.8):decimal(2,1)> | | org.apache.spark.sql.catalyst.expressions.Reverse | reverse | SELECT reverse('Spark SQL') | struct | | org.apache.spark.sql.catalyst.expressions.Right | right | SELECT right('Spark SQL', 3) | struct | -| org.apache.spark.sql.catalyst.expressions.Rint | rint | SELECT rint(12.3456) | struct | -| org.apache.spark.sql.catalyst.expressions.Rollup | rollup | SELECT name, age, count(*) FROM VALUES (2, 'Alice'), (5, 'Bob') people(age, name) GROUP BY rollup(name, age) | struct | +| org.apache.spark.sql.catalyst.expressions.Rint | rint | SELECT rint(12.3456) | struct | | org.apache.spark.sql.catalyst.expressions.Round | round | SELECT round(2.5, 0) | struct | -| org.apache.spark.sql.catalyst.expressions.RowNumber | row_number | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.RowNumber | row_number | SELECT a, b, row_number() OVER (PARTITION BY a ORDER BY b) FROM VALUES ('A1', 2), ('A1', 1), ('A2', 3), ('A1', 1) tab(a, b) | struct | | org.apache.spark.sql.catalyst.expressions.SchemaOfCsv | schema_of_csv | SELECT schema_of_csv('1,abc') | struct | | org.apache.spark.sql.catalyst.expressions.SchemaOfJson | schema_of_json | SELECT schema_of_json('[{"col":0}]') | struct | -| org.apache.spark.sql.catalyst.expressions.Second | second | SELECT second('2009-07-30 12:58:59') | struct | +| org.apache.spark.sql.catalyst.expressions.Second | second | SELECT second('2009-07-30 12:58:59') | struct | +| org.apache.spark.sql.catalyst.expressions.SecondsToTimestamp | timestamp_seconds | SELECT timestamp_seconds(1230219000) | struct | | org.apache.spark.sql.catalyst.expressions.Sentences | sentences | SELECT sentences('Hi there! Good morning.') | struct>> | | org.apache.spark.sql.catalyst.expressions.Sequence | sequence | SELECT sequence(1, 5) | struct> | -| org.apache.spark.sql.catalyst.expressions.Sha1 | sha1 | SELECT sha1('Spark') | struct | -| org.apache.spark.sql.catalyst.expressions.Sha1 | sha | SELECT sha('Spark') | struct | -| org.apache.spark.sql.catalyst.expressions.Sha2 | sha2 | SELECT sha2('Spark', 256) | struct | +| org.apache.spark.sql.catalyst.expressions.Sha1 | sha | SELECT sha('Spark') | struct | +| org.apache.spark.sql.catalyst.expressions.Sha1 | sha1 | SELECT sha1('Spark') | struct | +| org.apache.spark.sql.catalyst.expressions.Sha2 | sha2 | SELECT sha2('Spark', 256) | struct | | org.apache.spark.sql.catalyst.expressions.ShiftLeft | shiftleft | SELECT shiftleft(2, 1) | struct | | org.apache.spark.sql.catalyst.expressions.ShiftRight | shiftright | SELECT shiftright(4, 1) | struct | | org.apache.spark.sql.catalyst.expressions.ShiftRightUnsigned | shiftrightunsigned | SELECT shiftrightunsigned(4, 1) | struct | | org.apache.spark.sql.catalyst.expressions.Shuffle | shuffle | SELECT shuffle(array(1, 20, 3, 5)) | struct> | -| org.apache.spark.sql.catalyst.expressions.Signum | signum | SELECT signum(40) | struct | -| org.apache.spark.sql.catalyst.expressions.Signum | sign | SELECT sign(40) | struct | -| org.apache.spark.sql.catalyst.expressions.Sin | sin | SELECT sin(0) | struct | -| org.apache.spark.sql.catalyst.expressions.Sinh | sinh | SELECT sinh(0) | struct | -| org.apache.spark.sql.catalyst.expressions.Size | size | SELECT size(array('b', 'd', 'c', 'a')) | struct | +| org.apache.spark.sql.catalyst.expressions.Signum | sign | SELECT sign(40) | struct | +| org.apache.spark.sql.catalyst.expressions.Signum | signum | SELECT signum(40) | struct | +| org.apache.spark.sql.catalyst.expressions.Sin | sin | SELECT sin(0) | struct | +| org.apache.spark.sql.catalyst.expressions.Sinh | sinh | SELECT sinh(0) | struct | | org.apache.spark.sql.catalyst.expressions.Size | cardinality | SELECT cardinality(array('b', 'd', 'c', 'a')) | struct | +| org.apache.spark.sql.catalyst.expressions.Size | size | SELECT size(array('b', 'd', 'c', 'a')) | struct | | org.apache.spark.sql.catalyst.expressions.Slice | slice | SELECT slice(array(1, 2, 3, 4), 2, 2) | struct> | -| org.apache.spark.sql.catalyst.expressions.SortArray | sort_array | SELECT sort_array(array('b', 'd', null, 'c', 'a'), true) | struct> | +| org.apache.spark.sql.catalyst.expressions.SortArray | sort_array | SELECT sort_array(array('b', 'd', null, 'c', 'a'), true) | struct> | | org.apache.spark.sql.catalyst.expressions.SoundEx | soundex | SELECT soundex('Miller') | struct | -| org.apache.spark.sql.catalyst.expressions.SparkPartitionID | spark_partition_id | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.SparkVersion | version | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.Sqrt | sqrt | SELECT sqrt(4) | struct | +| org.apache.spark.sql.catalyst.expressions.SparkPartitionID | spark_partition_id | SELECT spark_partition_id() | struct | +| org.apache.spark.sql.catalyst.expressions.SparkVersion | version | SELECT version() | struct | +| org.apache.spark.sql.catalyst.expressions.Sqrt | sqrt | SELECT sqrt(4) | struct | | org.apache.spark.sql.catalyst.expressions.Stack | stack | SELECT stack(2, 1, 2, 3) | struct | | org.apache.spark.sql.catalyst.expressions.StringInstr | instr | SELECT instr('SparkSQL', 'SQL') | struct | | org.apache.spark.sql.catalyst.expressions.StringLPad | lpad | SELECT lpad('hi', 5, '??') | struct | -| org.apache.spark.sql.catalyst.expressions.StringLocate | position | SELECT position('bar', 'foobarbar') | struct | | org.apache.spark.sql.catalyst.expressions.StringLocate | locate | SELECT locate('bar', 'foobarbar') | struct | +| org.apache.spark.sql.catalyst.expressions.StringLocate | position | SELECT position('bar', 'foobarbar') | struct | | org.apache.spark.sql.catalyst.expressions.StringRPad | rpad | SELECT rpad('hi', 5, '??') | struct | | org.apache.spark.sql.catalyst.expressions.StringRepeat | repeat | SELECT repeat('123', 2) | struct | | org.apache.spark.sql.catalyst.expressions.StringReplace | replace | SELECT replace('ABCabc', 'abc', 'DEF') | struct | @@ -257,6 +268,7 @@ | org.apache.spark.sql.catalyst.expressions.StringToMap | str_to_map | SELECT str_to_map('a:1,b:2,c:3', ',', ':') | struct> | | org.apache.spark.sql.catalyst.expressions.StringTranslate | translate | SELECT translate('AaBbCc', 'abc', '123') | struct | | org.apache.spark.sql.catalyst.expressions.StringTrim | trim | SELECT trim(' SparkSQL ') | struct | +| org.apache.spark.sql.catalyst.expressions.StringTrimBoth | btrim | SELECT btrim(' SparkSQL ') | struct | | org.apache.spark.sql.catalyst.expressions.StringTrimLeft | ltrim | SELECT ltrim(' SparkSQL ') | struct | | org.apache.spark.sql.catalyst.expressions.StringTrimRight | rtrim | SELECT rtrim(' SparkSQL ') | struct | | org.apache.spark.sql.catalyst.expressions.StructsToCsv | to_csv | SELECT to_csv(named_struct('a', 1, 'b', 2)) | struct | @@ -265,74 +277,81 @@ | org.apache.spark.sql.catalyst.expressions.Substring | substring | SELECT substring('Spark SQL', 5) | struct | | org.apache.spark.sql.catalyst.expressions.SubstringIndex | substring_index | SELECT substring_index('www.apache.org', '.', 2) | struct | | org.apache.spark.sql.catalyst.expressions.Subtract | - | SELECT 2 - 1 | struct<(2 - 1):int> | -| org.apache.spark.sql.catalyst.expressions.Tan | tan | SELECT tan(0) | struct | -| org.apache.spark.sql.catalyst.expressions.Tanh | tanh | SELECT tanh(0) | struct | +| org.apache.spark.sql.catalyst.expressions.Tan | tan | SELECT tan(0) | struct | +| org.apache.spark.sql.catalyst.expressions.Tanh | tanh | SELECT tanh(0) | struct | | org.apache.spark.sql.catalyst.expressions.TimeWindow | window | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.ToDegrees | degrees | SELECT degrees(3.141592653589793) | struct | -| org.apache.spark.sql.catalyst.expressions.ToRadians | radians | SELECT radians(180) | struct | -| org.apache.spark.sql.catalyst.expressions.ToUTCTimestamp | to_utc_timestamp | SELECT to_utc_timestamp('2016-08-31', 'Asia/Seoul') | struct | +| org.apache.spark.sql.catalyst.expressions.ToDegrees | degrees | SELECT degrees(3.141592653589793) | struct | +| org.apache.spark.sql.catalyst.expressions.ToRadians | radians | SELECT radians(180) | struct | +| org.apache.spark.sql.catalyst.expressions.ToUTCTimestamp | to_utc_timestamp | SELECT to_utc_timestamp('2016-08-31', 'Asia/Seoul') | struct | | org.apache.spark.sql.catalyst.expressions.ToUnixTimestamp | to_unix_timestamp | SELECT to_unix_timestamp('2016-04-08', 'yyyy-MM-dd') | struct | | org.apache.spark.sql.catalyst.expressions.TransformKeys | transform_keys | SELECT transform_keys(map_from_arrays(array(1, 2, 3), array(1, 2, 3)), (k, v) -> k + 1) | struct> | | org.apache.spark.sql.catalyst.expressions.TransformValues | transform_values | SELECT transform_values(map_from_arrays(array(1, 2, 3), array(1, 2, 3)), (k, v) -> v + 1) | struct> | -| org.apache.spark.sql.catalyst.expressions.TruncDate | trunc | SELECT trunc('2019-08-04', 'week') | struct | -| org.apache.spark.sql.catalyst.expressions.TruncTimestamp | date_trunc | SELECT date_trunc('YEAR', '2015-03-05T09:32:05.359') | struct | +| org.apache.spark.sql.catalyst.expressions.TruncDate | trunc | SELECT trunc('2019-08-04', 'week') | struct | +| org.apache.spark.sql.catalyst.expressions.TruncTimestamp | date_trunc | SELECT date_trunc('YEAR', '2015-03-05T09:32:05.359') | struct | +| org.apache.spark.sql.catalyst.expressions.TryAdd | try_add | SELECT try_add(1, 2) | struct | +| org.apache.spark.sql.catalyst.expressions.TryDivide | try_divide | SELECT try_divide(3, 2) | struct | | org.apache.spark.sql.catalyst.expressions.TypeOf | typeof | SELECT typeof(1) | struct | | org.apache.spark.sql.catalyst.expressions.UnBase64 | unbase64 | SELECT unbase64('U3BhcmsgU1FM') | struct | | org.apache.spark.sql.catalyst.expressions.UnaryMinus | negative | SELECT negative(1) | struct | -| org.apache.spark.sql.catalyst.expressions.UnaryPositive | positive | N/A | N/A | +| org.apache.spark.sql.catalyst.expressions.UnaryPositive | positive | SELECT positive(1) | struct<(+ 1):int> | | org.apache.spark.sql.catalyst.expressions.Unhex | unhex | SELECT decode(unhex('537061726B2053514C'), 'UTF-8') | struct | +| org.apache.spark.sql.catalyst.expressions.UnixDate | unix_date | SELECT unix_date(DATE("1970-01-02")) | struct | +| org.apache.spark.sql.catalyst.expressions.UnixMicros | unix_micros | SELECT unix_micros(TIMESTAMP('1970-01-01 00:00:01Z')) | struct | +| org.apache.spark.sql.catalyst.expressions.UnixMillis | unix_millis | SELECT unix_millis(TIMESTAMP('1970-01-01 00:00:01Z')) | struct | +| org.apache.spark.sql.catalyst.expressions.UnixSeconds | unix_seconds | SELECT unix_seconds(TIMESTAMP('1970-01-01 00:00:01Z')) | struct | | org.apache.spark.sql.catalyst.expressions.UnixTimestamp | unix_timestamp | SELECT unix_timestamp() | struct | | org.apache.spark.sql.catalyst.expressions.Upper | ucase | SELECT ucase('SparkSql') | struct | | org.apache.spark.sql.catalyst.expressions.Upper | upper | SELECT upper('SparkSql') | struct | | org.apache.spark.sql.catalyst.expressions.Uuid | uuid | SELECT uuid() | struct | -| org.apache.spark.sql.catalyst.expressions.WeekDay | weekday | SELECT weekday('2009-07-30') | struct | -| org.apache.spark.sql.catalyst.expressions.WeekOfYear | weekofyear | SELECT weekofyear('2008-02-20') | struct | +| org.apache.spark.sql.catalyst.expressions.WeekDay | weekday | SELECT weekday('2009-07-30') | struct | +| org.apache.spark.sql.catalyst.expressions.WeekOfYear | weekofyear | SELECT weekofyear('2008-02-20') | struct | +| org.apache.spark.sql.catalyst.expressions.WidthBucket | width_bucket | SELECT width_bucket(5.3, 0.2, 10.6, 5) | struct | | org.apache.spark.sql.catalyst.expressions.XxHash64 | xxhash64 | SELECT xxhash64('Spark', array(123), 2) | struct | -| org.apache.spark.sql.catalyst.expressions.Year | year | SELECT year('2016-07-30') | struct | +| org.apache.spark.sql.catalyst.expressions.Year | year | SELECT year('2016-07-30') | struct | | org.apache.spark.sql.catalyst.expressions.ZipWith | zip_with | SELECT zip_with(array(1, 2, 3), array('a', 'b', 'c'), (x, y) -> (y, x)) | struct>> | -| org.apache.spark.sql.catalyst.expressions.aggregate.ApproximatePercentile | approx_percentile | SELECT approx_percentile(10.0, array(0.5, 0.4, 0.1), 100) | struct> | -| org.apache.spark.sql.catalyst.expressions.aggregate.ApproximatePercentile | percentile_approx | SELECT percentile_approx(10.0, array(0.5, 0.4, 0.1), 100) | struct> | +| org.apache.spark.sql.catalyst.expressions.aggregate.ApproximatePercentile | approx_percentile | SELECT approx_percentile(col, array(0.5, 0.4, 0.1), 100) FROM VALUES (0), (1), (2), (10) AS tab(col) | struct> | +| org.apache.spark.sql.catalyst.expressions.aggregate.ApproximatePercentile | percentile_approx | SELECT percentile_approx(col, array(0.5, 0.4, 0.1), 100) FROM VALUES (0), (1), (2), (10) AS tab(col) | struct> | | org.apache.spark.sql.catalyst.expressions.aggregate.Average | avg | SELECT avg(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.Average | mean | SELECT mean(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.BitAndAgg | bit_and | SELECT bit_and(col) FROM VALUES (3), (5) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.BitOrAgg | bit_or | SELECT bit_or(col) FROM VALUES (3), (5) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.BitXorAgg | bit_xor | SELECT bit_xor(col) FROM VALUES (3), (5) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.BoolAnd | every | SELECT every(col) FROM VALUES (true), (true), (true) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.BoolAnd | bool_and | SELECT bool_and(col) FROM VALUES (true), (true), (true) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.BoolAnd | every | SELECT every(col) FROM VALUES (true), (true), (true) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.BoolOr | any | SELECT any(col) FROM VALUES (true), (false), (false) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.BoolOr | bool_or | SELECT bool_or(col) FROM VALUES (true), (false), (false) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.BoolOr | some | SELECT some(col) FROM VALUES (true), (false), (false) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.BoolOr | any | SELECT any(col) FROM VALUES (true), (false), (false) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.CollectList | collect_list | SELECT collect_list(col) FROM VALUES (1), (2), (1) AS tab(col) | struct> | | org.apache.spark.sql.catalyst.expressions.aggregate.CollectSet | collect_set | SELECT collect_set(col) FROM VALUES (1), (2), (1) AS tab(col) | struct> | -| org.apache.spark.sql.catalyst.expressions.aggregate.Corr | corr | SELECT corr(c1, c2) FROM VALUES (3, 2), (3, 3), (6, 4) as tab(c1, c2) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.Corr | corr | SELECT corr(c1, c2) FROM VALUES (3, 2), (3, 3), (6, 4) as tab(c1, c2) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.Count | count | SELECT count(*) FROM VALUES (NULL), (5), (5), (20) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.CountIf | count_if | SELECT count_if(col % 2 = 0) FROM VALUES (NULL), (0), (1), (2), (3) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.CountMinSketchAgg | count_min_sketch | N/A | N/A | -| org.apache.spark.sql.catalyst.expressions.aggregate.CovPopulation | covar_pop | SELECT covar_pop(c1, c2) FROM VALUES (1,1), (2,2), (3,3) AS tab(c1, c2) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.CovSample | covar_samp | SELECT covar_samp(c1, c2) FROM VALUES (1,1), (2,2), (3,3) AS tab(c1, c2) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.First | first_value | SELECT first_value(col) FROM VALUES (10), (5), (20) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.First | first | SELECT first(col) FROM VALUES (10), (5), (20) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.CountMinSketchAgg | count_min_sketch | SELECT hex(count_min_sketch(col, 0.5d, 0.5d, 1)) FROM VALUES (1), (2), (1) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.CovPopulation | covar_pop | SELECT covar_pop(c1, c2) FROM VALUES (1,1), (2,2), (3,3) AS tab(c1, c2) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.CovSample | covar_samp | SELECT covar_samp(c1, c2) FROM VALUES (1,1), (2,2), (3,3) AS tab(c1, c2) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.First | first | SELECT first(col) FROM VALUES (10), (5), (20) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.First | first_value | SELECT first_value(col) FROM VALUES (10), (5), (20) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.HyperLogLogPlusPlus | approx_count_distinct | SELECT approx_count_distinct(col1) FROM VALUES (1), (1), (2), (2), (3) tab(col1) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.Kurtosis | kurtosis | SELECT kurtosis(col) FROM VALUES (-10), (-20), (100), (1000) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.Last | last_value | SELECT last_value(col) FROM VALUES (10), (5), (20) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.Last | last | SELECT last(col) FROM VALUES (10), (5), (20) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.Kurtosis | kurtosis | SELECT kurtosis(col) FROM VALUES (-10), (-20), (100), (1000) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.Last | last | SELECT last(col) FROM VALUES (10), (5), (20) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.Last | last_value | SELECT last_value(col) FROM VALUES (10), (5), (20) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.Max | max | SELECT max(col) FROM VALUES (10), (50), (20) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.MaxBy | max_by | SELECT max_by(x, y) FROM VALUES (('a', 10)), (('b', 50)), (('c', 20)) AS tab(x, y) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.Min | min | SELECT min(col) FROM VALUES (10), (-1), (20) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.MinBy | min_by | SELECT min_by(x, y) FROM VALUES (('a', 10)), (('b', 50)), (('c', 20)) AS tab(x, y) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.Percentile | percentile | SELECT percentile(col, 0.3) FROM VALUES (0), (10) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.Skewness | skewness | SELECT skewness(col) FROM VALUES (-10), (-20), (100), (1000) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.StddevPop | stddev_pop | SELECT stddev_pop(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.StddevSamp | stddev_samp | SELECT stddev_samp(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.StddevSamp | stddev | SELECT stddev(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.StddevSamp | std | SELECT std(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.Percentile | percentile | SELECT percentile(col, 0.3) FROM VALUES (0), (10) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.Skewness | skewness | SELECT skewness(col) FROM VALUES (-10), (-20), (100), (1000) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.StddevPop | stddev_pop | SELECT stddev_pop(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.StddevSamp | std | SELECT std(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.StddevSamp | stddev | SELECT stddev(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.StddevSamp | stddev_samp | SELECT stddev_samp(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.aggregate.Sum | sum | SELECT sum(col) FROM VALUES (5), (10), (15) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.VariancePop | var_pop | SELECT var_pop(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.VarianceSamp | var_samp | SELECT var_samp(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | -| org.apache.spark.sql.catalyst.expressions.aggregate.VarianceSamp | variance | SELECT variance(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.VariancePop | var_pop | SELECT var_pop(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.VarianceSamp | var_samp | SELECT var_samp(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | +| org.apache.spark.sql.catalyst.expressions.aggregate.VarianceSamp | variance | SELECT variance(col) FROM VALUES (1), (2), (3) AS tab(col) | struct | | org.apache.spark.sql.catalyst.expressions.xml.XPathBoolean | xpath_boolean | SELECT xpath_boolean('1','a/b') | struct1, a/b):boolean> | -| org.apache.spark.sql.catalyst.expressions.xml.XPathDouble | xpath_number | SELECT xpath_number('12', 'sum(a/b)') | struct12, sum(a/b)):double> | | org.apache.spark.sql.catalyst.expressions.xml.XPathDouble | xpath_double | SELECT xpath_double('12', 'sum(a/b)') | struct12, sum(a/b)):double> | +| org.apache.spark.sql.catalyst.expressions.xml.XPathDouble | xpath_number | SELECT xpath_number('12', 'sum(a/b)') | struct12, sum(a/b)):double> | | org.apache.spark.sql.catalyst.expressions.xml.XPathFloat | xpath_float | SELECT xpath_float('12', 'sum(a/b)') | struct12, sum(a/b)):float> | | org.apache.spark.sql.catalyst.expressions.xml.XPathInt | xpath_int | SELECT xpath_int('12', 'sum(a/b)') | struct12, sum(a/b)):int> | | org.apache.spark.sql.catalyst.expressions.xml.XPathList | xpath | SELECT xpath('b1b2b3c1c2','a/b/text()') | structb1b2b3c1c2, a/b/text()):array> | diff --git a/sql/core/src/test/resources/sql-tests/inputs/ansi/array.sql b/sql/core/src/test/resources/sql-tests/inputs/ansi/array.sql new file mode 100644 index 0000000000000..662756cbfb0b0 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/ansi/array.sql @@ -0,0 +1 @@ +--IMPORT array.sql diff --git a/sql/core/src/test/resources/sql-tests/inputs/ansi/decimalArithmeticOperations.sql b/sql/core/src/test/resources/sql-tests/inputs/ansi/decimalArithmeticOperations.sql index d190f38345d6b..d843847e6a149 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/ansi/decimalArithmeticOperations.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/ansi/decimalArithmeticOperations.sql @@ -1,6 +1,6 @@ -- SPARK-23179: SQL ANSI 2011 states that in case of overflow during arithmetic operations, -- an exception should be thrown instead of returning NULL. --- This is what most of the SQL DBs do (eg. SQLServer, DB2). +-- This is what most of the SQL DBs do (e.g. SQLServer, DB2). -- tests for decimals handling in operations create table decimals_test(id int, a decimal(38,18), b decimal(38,18)) using parquet; diff --git a/sql/core/src/test/resources/sql-tests/inputs/ansi/group-analytics.sql b/sql/core/src/test/resources/sql-tests/inputs/ansi/group-analytics.sql new file mode 100644 index 0000000000000..d78689233ddf9 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/ansi/group-analytics.sql @@ -0,0 +1 @@ +--IMPORT group-analytics.sql \ No newline at end of file diff --git a/sql/core/src/test/resources/sql-tests/inputs/ansi/map.sql b/sql/core/src/test/resources/sql-tests/inputs/ansi/map.sql new file mode 100644 index 0000000000000..23e5b9562973b --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/ansi/map.sql @@ -0,0 +1 @@ +--IMPORT map.sql diff --git a/sql/core/src/test/resources/sql-tests/inputs/ansi/parse-schema-string.sql b/sql/core/src/test/resources/sql-tests/inputs/ansi/parse-schema-string.sql new file mode 100644 index 0000000000000..42775102e650e --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/ansi/parse-schema-string.sql @@ -0,0 +1 @@ +--IMPORT parse-schema-string.sql diff --git a/sql/core/src/test/resources/sql-tests/inputs/ansi/string-functions.sql b/sql/core/src/test/resources/sql-tests/inputs/ansi/string-functions.sql new file mode 100644 index 0000000000000..dd28e9b97fb20 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/ansi/string-functions.sql @@ -0,0 +1 @@ +--IMPORT string-functions.sql diff --git a/sql/core/src/test/resources/sql-tests/inputs/array.sql b/sql/core/src/test/resources/sql-tests/inputs/array.sql index 984321ab795fc..f73b653659eb4 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/array.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/array.sql @@ -90,3 +90,15 @@ select size(date_array), size(timestamp_array) from primitive_arrays; + +-- index out of range for array elements +select element_at(array(1, 2, 3), 5); +select element_at(array(1, 2, 3), -5); +select element_at(array(1, 2, 3), 0); + +select elt(4, '123', '456'); +select elt(0, '123', '456'); +select elt(-1, '123', '456'); + +select array(1, 2, 3)[5]; +select array(1, 2, 3)[-1]; diff --git a/sql/core/src/test/resources/sql-tests/inputs/bitwise.sql b/sql/core/src/test/resources/sql-tests/inputs/bitwise.sql index 5e665e4c0c384..f9dfd161d0c07 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/bitwise.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/bitwise.sql @@ -68,3 +68,10 @@ SELECT b1, bit_xor(b2) FROM bitwise_test GROUP BY b1 HAVING bit_and(b2) < 7; -- window SELECT b1, b2, bit_xor(b2) OVER (PARTITION BY b1 ORDER BY b2) FROM bitwise_test; + +-- getbit +select getbit(11L, 3), getbit(11L, 2), getbit(11L, 1), getbit(11L, 0); +select getbit(11L, 2 + 1), getbit(11L, 3 - 1), getbit(10L + 1, 1 * 1), getbit(cast(11L / 1 AS long), 1 - 1); +select getbit(11L, 63); +select getbit(11L, -1); +select getbit(11L, 64); diff --git a/sql/core/src/test/resources/sql-tests/inputs/blacklist.sql b/sql/core/src/test/resources/sql-tests/inputs/blacklist.sql deleted file mode 100644 index d69f8147a5264..0000000000000 --- a/sql/core/src/test/resources/sql-tests/inputs/blacklist.sql +++ /dev/null @@ -1,4 +0,0 @@ --- This is a query file that has been blacklisted. --- It includes a query that should crash Spark. --- If the test case is run, the whole suite would fail. -some random not working query that should crash Spark. diff --git a/sql/core/src/test/resources/sql-tests/inputs/cast.sql b/sql/core/src/test/resources/sql-tests/inputs/cast.sql index 972ebdd01f61e..81c741a5ca8e9 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/cast.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/cast.sql @@ -70,6 +70,11 @@ select cast(' 1' as bigint); select cast(' 1' as float); select cast(' 1 ' as DOUBLE); select cast('1.0 ' as DEC); +select cast('1中文' as tinyint); +select cast('1中文' as smallint); +select cast('1中文' as INT); +select cast('中文1' as bigint); +select cast('1中文' as bigint); -- trim string before cast to boolean select cast('\t\t true \n\r ' as boolean); diff --git a/sql/core/src/test/resources/sql-tests/inputs/charvarchar.sql b/sql/core/src/test/resources/sql-tests/inputs/charvarchar.sql new file mode 100644 index 0000000000000..098d09d98218d --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/charvarchar.sql @@ -0,0 +1,115 @@ +create table char_tbl(c char(5), v varchar(6)) using parquet; +desc formatted char_tbl; +desc formatted char_tbl c; +show create table char_tbl; + +create table char_tbl2 using parquet as select * from char_tbl; +show create table char_tbl2; +desc formatted char_tbl2; +desc formatted char_tbl2 c; + +create table char_tbl3 like char_tbl; +desc formatted char_tbl3; +desc formatted char_tbl3 c; +show create table char_tbl3; + +create view char_view as select * from char_tbl; +desc formatted char_view; +desc formatted char_view c; +show create table char_view; + +alter table char_tbl rename to char_tbl1; +desc formatted char_tbl1; + +alter table char_tbl1 change column c type char(6); +alter table char_tbl1 change column c type char(5); +desc formatted char_tbl1; + +alter table char_tbl1 add columns (d char(5)); +desc formatted char_tbl1; + +alter view char_view as select * from char_tbl2; +desc formatted char_view; + +alter table char_tbl1 SET TBLPROPERTIES('yes'='no'); +desc formatted char_tbl1; + +alter view char_view SET TBLPROPERTIES('yes'='no'); +desc formatted char_view; + +alter table char_tbl1 UNSET TBLPROPERTIES('yes'); +desc formatted char_tbl1; + +alter view char_view UNSET TBLPROPERTIES('yes'); +desc formatted char_view; + +alter table char_tbl1 SET SERDEPROPERTIES('yes'='no'); +desc formatted char_tbl1; + +create table char_part(c1 char(5), c2 char(2), v1 varchar(6), v2 varchar(2)) using parquet partitioned by (v2, c2); +desc formatted char_part; + +alter table char_part add partition (v2='ke', c2='nt') location 'loc1'; +desc formatted char_part; + +alter table char_part partition (v2='ke') rename to partition (v2='nt'); +desc formatted char_part; + +alter table char_part partition (v2='ke', c2='nt') set location 'loc2'; +desc formatted char_part; + +MSCK REPAIR TABLE char_part; +desc formatted char_part; + +create temporary view str_view as select c, v from values + (null, null), + (null, 'S'), + ('N', 'N '), + ('Ne', 'Sp'), + ('Net ', 'Spa '), + ('NetE', 'Spar'), + ('NetEa ', 'Spark '), + ('NetEas ', 'Spark'), + ('NetEase', 'Spark-') t(c, v); + +create table char_tbl4(c7 char(7), c8 char(8), v varchar(6), s string) using parquet; +insert into char_tbl4 select c, c, v, c from str_view; + +select c7, c8, v, s from char_tbl4; +select c7, c8, v, s from char_tbl4 where c7 = c8; +select c7, c8, v, s from char_tbl4 where c7 = v; +select c7, c8, v, s from char_tbl4 where c7 = s; +select c7, c8, v, s from char_tbl4 where c7 = 'NetEase '; +select c7, c8, v, s from char_tbl4 where v = 'Spark '; +select c7, c8, v, s from char_tbl4 order by c7; +select c7, c8, v, s from char_tbl4 order by v; + +select ascii(c7), ascii(c8), ascii(v), ascii(s) from char_tbl4; +select base64(c7), base64(c8), base64(v), ascii(s) from char_tbl4; +select bit_length(c7), bit_length(c8), bit_length(v), bit_length(s) from char_tbl4; +select char_length(c7), char_length(c8), char_length(v), char_length(s) from char_tbl4; +select octet_length(c7), octet_length(c8), octet_length(v), octet_length(s) from char_tbl4; +select concat_ws('|', c7, c8), concat_ws('|', c7, v), concat_ws('|', c7, s), concat_ws('|', v, s) from char_tbl4; +select concat(c7, c8), concat(c7, v), concat(c7, s), concat(v, s) from char_tbl4; +select like(c7, 'Ne _'), like(c8, 'Ne _') from char_tbl4; +select like(v, 'Spark_') from char_tbl4; +select c7 = c8, upper(c7) = upper(c8), lower(c7) = lower(c8) from char_tbl4 where s = 'NetEase'; +select c7 = s, upper(c7) = upper(s), lower(c7) = lower(s) from char_tbl4 where s = 'NetEase'; +select c7 = 'NetEase', upper(c7) = upper('NetEase'), lower(c7) = lower('NetEase') from char_tbl4 where s = 'NetEase'; +select printf('Hey, %s%s%s%s', c7, c8, v, s) from char_tbl4; +select repeat(c7, 2), repeat(c8, 2), repeat(v, 2), repeat(s, 2) from char_tbl4; +select replace(c7, 'Net', 'Apache'), replace(c8, 'Net', 'Apache'), replace(v, 'Spark', 'Kyuubi'), replace(s, 'Net', 'Apache') from char_tbl4; +select rpad(c7, 10), rpad(c8, 5), rpad(v, 5), rpad(s, 5) from char_tbl4; +select rtrim(c7), rtrim(c8), rtrim(v), rtrim(s) from char_tbl4; +select split(c7, 'e'), split(c8, 'e'), split(v, 'a'), split(s, 'e') from char_tbl4; +select substring(c7, 2), substring(c8, 2), substring(v, 3), substring(s, 2) from char_tbl4; +select left(c7, 2), left(c8, 2), left(v, 3), left(s, 2) from char_tbl4; +select right(c7, 2), right(c8, 2), right(v, 3), right(s, 2) from char_tbl4; +select typeof(c7), typeof(c8), typeof(v), typeof(s) from char_tbl4 limit 1; +select cast(c7 as char(1)), cast(c8 as char(10)), cast(v as char(1)), cast(v as varchar(1)), cast(s as char(5)) from char_tbl4; + +-- char_tbl has renamed to char_tbl1 +drop table char_tbl1; +drop table char_tbl2; +drop table char_tbl3; +drop table char_tbl4; diff --git a/sql/core/src/test/resources/sql-tests/inputs/count.sql b/sql/core/src/test/resources/sql-tests/inputs/count.sql index 9f9ee4a873d4f..ae27c1cae33b5 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/count.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/count.sql @@ -19,9 +19,35 @@ SELECT FROM testData; -- count with multiple expressions -SELECT count(a, b), count(b, a), count(testData.*) FROM testData; +SELECT count(a, b), count(b, a), count(testData.*, testData.*) FROM testData; -- distinct count with multiple expressions SELECT - count(DISTINCT a, b), count(DISTINCT b, a), count(DISTINCT *), count(DISTINCT testData.*) + count(DISTINCT a, b), count(DISTINCT b, a), count(DISTINCT *), count(DISTINCT testData.*, testData.*) FROM testData; + +-- distinct count with multiple literals +SELECT count(DISTINCT 3,2); +SELECT count(DISTINCT 2), count(DISTINCT 2,3); +SELECT count(DISTINCT 2), count(DISTINCT 3,2); +SELECT count(DISTINCT a), count(DISTINCT 2,3) FROM testData; +SELECT count(DISTINCT a), count(DISTINCT 3,2) FROM testData; +SELECT count(DISTINCT a), count(DISTINCT 2), count(DISTINCT 2,3) FROM testData; +SELECT count(DISTINCT a), count(DISTINCT 2), count(DISTINCT 3,2) FROM testData; +SELECT count(distinct 0.8), percentile_approx(distinct a, 0.8) FROM testData; + +-- legacy behavior: allow calling function count without parameters +set spark.sql.legacy.allowParameterlessCount=true; +SELECT count() FROM testData; + +-- count without expressions +set spark.sql.legacy.allowParameterlessCount=false; +SELECT count() FROM testData; + +-- legacy behavior: allow count(testData.*) +set spark.sql.legacy.allowStarWithSingleTableIdentifierInCount=true; +SELECT count(testData.*) FROM testData; + +-- count with a single tblName.* as parameter +set spark.sql.legacy.allowStarWithSingleTableIdentifierInCount=false; +SELECT count(testData.*) FROM testData; diff --git a/sql/core/src/test/resources/sql-tests/inputs/current_database_catalog.sql b/sql/core/src/test/resources/sql-tests/inputs/current_database_catalog.sql new file mode 100644 index 0000000000000..4406f1bc2e6e3 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/current_database_catalog.sql @@ -0,0 +1,2 @@ +-- get current_datebase and current_catalog +select current_database(), current_catalog(); diff --git a/sql/core/src/test/resources/sql-tests/inputs/datetime-formatting-invalid.sql b/sql/core/src/test/resources/sql-tests/inputs/datetime-formatting-invalid.sql new file mode 100644 index 0000000000000..11bba00e91abf --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/datetime-formatting-invalid.sql @@ -0,0 +1,53 @@ +--- TESTS FOR DATETIME FORMATTING FUNCTIONS WITH INVALID PATTERNS --- + +-- separating this from datetime-formatting.sql, because the text form +-- for patterns with 5 letters in SimpleDateFormat varies from different JDKs +select date_format('2018-11-17 13:33:33.333', 'GGGGG'); +-- pattern letter count can not be greater than 6 +select date_format('2018-11-17 13:33:33.333', 'yyyyyyy'); +-- q/L in JDK 8 will fail when the count is more than 2 +select date_format('2018-11-17 13:33:33.333', 'qqqqq'); +select date_format('2018-11-17 13:33:33.333', 'QQQQQ'); +select date_format('2018-11-17 13:33:33.333', 'MMMMM'); +select date_format('2018-11-17 13:33:33.333', 'LLLLL'); + +select date_format('2018-11-17 13:33:33.333', 'EEEEE'); +select date_format('2018-11-17 13:33:33.333', 'FF'); +select date_format('2018-11-17 13:33:33.333', 'ddd'); +-- DD is invalid if the day-of-year exceeds 100, but it becomes valid in Java 11 +-- select date_format('2018-11-17 13:33:33.333', 'DD'); +select date_format('2018-11-17 13:33:33.333', 'DDDD'); +select date_format('2018-11-17 13:33:33.333', 'HHH'); +select date_format('2018-11-17 13:33:33.333', 'hhh'); +select date_format('2018-11-17 13:33:33.333', 'kkk'); +select date_format('2018-11-17 13:33:33.333', 'KKK'); +select date_format('2018-11-17 13:33:33.333', 'mmm'); +select date_format('2018-11-17 13:33:33.333', 'sss'); +select date_format('2018-11-17 13:33:33.333', 'SSSSSSSSSS'); +select date_format('2018-11-17 13:33:33.333', 'aa'); +select date_format('2018-11-17 13:33:33.333', 'V'); +select date_format('2018-11-17 13:33:33.333', 'zzzzz'); +select date_format('2018-11-17 13:33:33.333', 'XXXXXX'); +select date_format('2018-11-17 13:33:33.333', 'ZZZZZZ'); +select date_format('2018-11-17 13:33:33.333', 'OO'); +select date_format('2018-11-17 13:33:33.333', 'xxxxxx'); + +select date_format('2018-11-17 13:33:33.333', 'A'); +select date_format('2018-11-17 13:33:33.333', 'n'); +select date_format('2018-11-17 13:33:33.333', 'N'); +select date_format('2018-11-17 13:33:33.333', 'p'); + +-- disabled week-based patterns +select date_format('2018-11-17 13:33:33.333', 'Y'); +select date_format('2018-11-17 13:33:33.333', 'w'); +select date_format('2018-11-17 13:33:33.333', 'W'); +select date_format('2018-11-17 13:33:33.333', 'u'); +select date_format('2018-11-17 13:33:33.333', 'e'); +select date_format('2018-11-17 13:33:33.333', 'c'); + +-- others +select date_format('2018-11-17 13:33:33.333', 'B'); +select date_format('2018-11-17 13:33:33.333', 'C'); +select date_format('2018-11-17 13:33:33.333', 'I'); + + diff --git a/sql/core/src/test/resources/sql-tests/inputs/datetime-formatting-legacy.sql b/sql/core/src/test/resources/sql-tests/inputs/datetime-formatting-legacy.sql new file mode 100644 index 0000000000000..19cab61a7ee56 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/datetime-formatting-legacy.sql @@ -0,0 +1,2 @@ +--SET spark.sql.legacy.timeParserPolicy=LEGACY +--IMPORT datetime-formatting.sql \ No newline at end of file diff --git a/sql/core/src/test/resources/sql-tests/inputs/datetime-formatting.sql b/sql/core/src/test/resources/sql-tests/inputs/datetime-formatting.sql new file mode 100644 index 0000000000000..2d70326f4f3c0 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/datetime-formatting.sql @@ -0,0 +1,68 @@ +--- TESTS FOR DATETIME FORMATTING FUNCTIONS --- + +create temporary view v as select col from values + (timestamp '1582-06-01 11:33:33.123UTC+080000'), + (timestamp '1970-01-01 00:00:00.000Europe/Paris'), + (timestamp '1970-12-31 23:59:59.999Asia/Srednekolymsk'), + (timestamp '1996-04-01 00:33:33.123Australia/Darwin'), + (timestamp '2018-11-17 13:33:33.123Z'), + (timestamp '2020-01-01 01:33:33.123Asia/Shanghai'), + (timestamp '2100-01-01 01:33:33.123America/Los_Angeles') t(col); + +select col, date_format(col, 'G GG GGG GGGG') from v; + +select col, date_format(col, 'y yy yyy yyyy yyyyy yyyyyy') from v; + +select col, date_format(col, 'q qq') from v; + +select col, date_format(col, 'Q QQ QQQ QQQQ') from v; + +select col, date_format(col, 'M MM MMM MMMM') from v; + +select col, date_format(col, 'L LL') from v; + +select col, date_format(col, 'E EE EEE EEEE') from v; + +select col, date_format(col, 'F') from v; + +select col, date_format(col, 'd dd') from v; + +select col, date_format(col, 'DD') from v where col = timestamp '2100-01-01 01:33:33.123America/Los_Angeles'; +select col, date_format(col, 'D DDD') from v; + +select col, date_format(col, 'H HH') from v; + +select col, date_format(col, 'h hh') from v; + +select col, date_format(col, 'k kk') from v; + +select col, date_format(col, 'K KK') from v; + +select col, date_format(col, 'm mm') from v; + +select col, date_format(col, 's ss') from v; + +select col, date_format(col, 'S SS SSS SSSS SSSSS SSSSSS SSSSSSS SSSSSSSS SSSSSSSSS') from v; + +select col, date_format(col, 'a') from v; + +select col, date_format(col, 'VV') from v; + +select col, date_format(col, 'z zz zzz zzzz') from v; + +select col, date_format(col, 'X XX XXX') from v; +select col, date_format(col, 'XXXX XXXXX') from v; + +select col, date_format(col, 'Z ZZ ZZZ ZZZZ ZZZZZ') from v; + +select col, date_format(col, 'O OOOO') from v; + +select col, date_format(col, 'x xx xxx xxxx xxxx xxxxx') from v; + +-- optional pattern, but the results won't be optional for formatting +select col, date_format(col, '[yyyy-MM-dd HH:mm:ss]') from v; + +-- literals +select col, date_format(col, "姚123'GyYqQMLwWuEFDdhHmsSaVzZxXOV'") from v; +select col, date_format(col, "''") from v; +select col, date_format(col, '') from v; diff --git a/sql/core/src/test/resources/sql-tests/inputs/datetime-legacy.sql b/sql/core/src/test/resources/sql-tests/inputs/datetime-legacy.sql new file mode 100644 index 0000000000000..daec2b40a620b --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/datetime-legacy.sql @@ -0,0 +1,2 @@ +--SET spark.sql.legacy.timeParserPolicy=LEGACY +--IMPORT datetime.sql diff --git a/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing-invalid.sql b/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing-invalid.sql new file mode 100644 index 0000000000000..a1c02eaa3b0a0 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing-invalid.sql @@ -0,0 +1,29 @@ +--- TESTS FOR DATETIME PARSING FUNCTIONS WITH INVALID VALUES --- + +-- parsing invalid value with pattern 'y' +select to_timestamp('294248', 'y'); -- out of year value range [0, 294247] +select to_timestamp('1', 'yy'); -- the number of digits must be 2 for 'yy'. +select to_timestamp('-12', 'yy'); -- out of year value range [0, 99] for reduced two digit form +select to_timestamp('123', 'yy'); -- the number of digits must be 2 for 'yy'. +select to_timestamp('1', 'yyy'); -- the number of digits must be in [3, 6] for 'yyy' + +select to_timestamp('1234567', 'yyyyyyy'); -- the length of 'y' pattern must be less than 7 + +-- parsing invalid values with pattern 'D' +select to_timestamp('366', 'D'); +select to_timestamp('9', 'DD'); +-- in java 8 this case is invalid, but valid in java 11, disabled for jenkins +-- select to_timestamp('100', 'DD'); +select to_timestamp('366', 'DD'); +select to_timestamp('9', 'DDD'); +select to_timestamp('99', 'DDD'); +select to_timestamp('30-365', 'dd-DDD'); +select to_timestamp('11-365', 'MM-DDD'); +select to_timestamp('2019-366', 'yyyy-DDD'); +select to_timestamp('12-30-365', 'MM-dd-DDD'); +select to_timestamp('2020-01-365', 'yyyy-dd-DDD'); +select to_timestamp('2020-10-350', 'yyyy-MM-DDD'); +select to_timestamp('2020-11-31-366', 'yyyy-MM-dd-DDD'); +-- add a special case to test csv, because the legacy formatter it uses is lenient then Spark should +-- throw SparkUpgradeException +select from_csv('2018-366', 'date Date', map('dateFormat', 'yyyy-DDD')) diff --git a/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing-legacy.sql b/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing-legacy.sql new file mode 100644 index 0000000000000..ee1afe502ab79 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing-legacy.sql @@ -0,0 +1,2 @@ +--SET spark.sql.legacy.timeParserPolicy=LEGACY +--IMPORT datetime-parsing.sql diff --git a/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing.sql b/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing.sql new file mode 100644 index 0000000000000..e058bd675c375 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/datetime-parsing.sql @@ -0,0 +1,44 @@ +--- TESTS FOR DATETIME PARSING FUNCTIONS --- + +-- parsing with pattern 'y'. +-- the range of valid year is [-290307, 294247], +-- but particularly, some thrift client use java.sql.Timestamp to parse timestamp, which allows +-- only positive year values less or equal than 9999. So the cases bellow only use [1, 9999] to pass +-- ThriftServerQueryTestSuite +select to_timestamp('1', 'y'); +select to_timestamp('009999', 'y'); + +-- reduced two digit form is used, the range of valid year is 20-[01, 99] +select to_timestamp('00', 'yy'); +select to_timestamp('99', 'yy'); + +-- the range of valid year is [-290307, 294247], the number of digits must be in [3, 6] for 'yyy' +select to_timestamp('001', 'yyy'); +select to_timestamp('009999', 'yyy'); + +-- the range of valid year is [-9999, 9999], the number of digits must be 4 for 'yyyy'. +select to_timestamp('0001', 'yyyy'); +select to_timestamp('9999', 'yyyy'); + +-- the range of valid year is [-99999, 99999], the number of digits must be 5 for 'yyyyy'. +select to_timestamp('00001', 'yyyyy'); +select to_timestamp('09999', 'yyyyy'); + +-- the range of valid year is [-290307, 294247], the number of digits must be 6 for 'yyyyyy'. +select to_timestamp('000001', 'yyyyyy'); +select to_timestamp('009999', 'yyyyyy'); + +-- parsing with pattern 'D' +select to_timestamp('9', 'D'); +select to_timestamp('300', 'D'); +select to_timestamp('09', 'DD'); +select to_timestamp('99', 'DD'); +select to_timestamp('009', 'DDD'); +select to_timestamp('365', 'DDD'); +select to_timestamp('31-365', 'dd-DDD'); +select to_timestamp('12-365', 'MM-DDD'); +select to_timestamp('2020-365', 'yyyy-DDD'); +select to_timestamp('12-31-365', 'MM-dd-DDD'); +select to_timestamp('2020-30-365', 'yyyy-dd-DDD'); +select to_timestamp('2020-12-350', 'yyyy-MM-DDD'); +select to_timestamp('2020-12-31-366', 'yyyy-MM-dd-DDD'); diff --git a/sql/core/src/test/resources/sql-tests/inputs/datetime.sql b/sql/core/src/test/resources/sql-tests/inputs/datetime.sql index fd3325085df96..0493d8653c01f 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/datetime.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/datetime.sql @@ -1,5 +1,27 @@ -- date time functions +-- [SPARK-31710] TIMESTAMP_SECONDS, TIMESTAMP_MILLISECONDS and TIMESTAMP_MICROSECONDS to timestamp transfer +select TIMESTAMP_SECONDS(1230219000),TIMESTAMP_SECONDS(-1230219000),TIMESTAMP_SECONDS(null); +select TIMESTAMP_SECONDS(1.23), TIMESTAMP_SECONDS(1.23d), TIMESTAMP_SECONDS(FLOAT(1.23)); +select TIMESTAMP_MILLIS(1230219000123),TIMESTAMP_MILLIS(-1230219000123),TIMESTAMP_MILLIS(null); +select TIMESTAMP_MICROS(1230219000123123),TIMESTAMP_MICROS(-1230219000123123),TIMESTAMP_MICROS(null); +-- overflow exception +select TIMESTAMP_SECONDS(1230219000123123); +select TIMESTAMP_SECONDS(-1230219000123123); +select TIMESTAMP_MILLIS(92233720368547758); +select TIMESTAMP_MILLIS(-92233720368547758); +-- truncate exception +select TIMESTAMP_SECONDS(0.1234567); +-- truncation is OK for float/double +select TIMESTAMP_SECONDS(0.1234567d), TIMESTAMP_SECONDS(FLOAT(0.1234567)); +-- UNIX_SECONDS, UNIX_MILLISECONDS and UNIX_MICROSECONDS +select UNIX_SECONDS(TIMESTAMP('2020-12-01 14:30:08Z')), UNIX_SECONDS(TIMESTAMP('2020-12-01 14:30:08.999999Z')), UNIX_SECONDS(null); +select UNIX_MILLIS(TIMESTAMP('2020-12-01 14:30:08Z')), UNIX_MILLIS(TIMESTAMP('2020-12-01 14:30:08.999999Z')), UNIX_MILLIS(null); +select UNIX_MICROS(TIMESTAMP('2020-12-01 14:30:08Z')), UNIX_MICROS(TIMESTAMP('2020-12-01 14:30:08.999999Z')), UNIX_MICROS(null); +-- DATE_FROM_UNIX_DATE +select DATE_FROM_UNIX_DATE(0), DATE_FROM_UNIX_DATE(1000), DATE_FROM_UNIX_DATE(null); +-- UNIX_DATE +select UNIX_DATE(DATE('1970-01-01')), UNIX_DATE(DATE('2020-12-04')), UNIX_DATE(null); -- [SPARK-16836] current_date and current_timestamp literals select current_date = current_date(), current_timestamp = current_timestamp(); @@ -33,6 +55,8 @@ select year('1500-01-01'), month('1500-01-01'), dayOfYear('1500-01-01'); select date '2019-01-01\t'; select timestamp '2019-01-01\t'; +select date '2020-01-01中文'; +select timestamp '2019-01-01中文'; -- time add/sub select timestamp'2011-11-11 11:11:11' + interval '2' day; @@ -86,7 +110,7 @@ select date_sub('2011-11-11', str) from v; select null - date '2019-10-06'; select date '2001-10-01' - date '2001-09-28'; --- variable-length tests +-- variable-length second fraction tests select to_timestamp('2019-10-06 10:11:12.', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]'); select to_timestamp('2019-10-06 10:11:12.0', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]'); select to_timestamp('2019-10-06 10:11:12.1', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]'); @@ -95,7 +119,7 @@ select to_timestamp('2019-10-06 10:11:12.123UTC', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zz select to_timestamp('2019-10-06 10:11:12.1234', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]'); select to_timestamp('2019-10-06 10:11:12.12345CST', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]'); select to_timestamp('2019-10-06 10:11:12.123456PST', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]'); --- exceeded max variable length +-- second fraction exceeded max variable length select to_timestamp('2019-10-06 10:11:12.1234567PST', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]'); -- special cases select to_timestamp('123456 2019-10-06 10:11:12.123456PST', 'SSSSSS yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]'); @@ -114,11 +138,44 @@ select to_timestamp("12.1234019-10-06S10:11", "ss.SSSSy-MM-dd'S'HH:mm"); select to_timestamp("2019-10-06S", "yyyy-MM-dd'S'"); select to_timestamp("S2019-10-06", "'S'yyyy-MM-dd"); -select date_format(timestamp '2019-10-06', 'yyyy-MM-dd uuee'); -select date_format(timestamp '2019-10-06', 'yyyy-MM-dd uucc'); -select date_format(timestamp '2019-10-06', 'yyyy-MM-dd uuuu'); - select to_timestamp("2019-10-06T10:11:12'12", "yyyy-MM-dd'T'HH:mm:ss''SSSS"); -- middle select to_timestamp("2019-10-06T10:11:12'", "yyyy-MM-dd'T'HH:mm:ss''"); -- tail select to_timestamp("'2019-10-06T10:11:12", "''yyyy-MM-dd'T'HH:mm:ss"); -- head select to_timestamp("P2019-10-06T10:11:12", "'P'yyyy-MM-dd'T'HH:mm:ss"); -- head but as single quote + +-- missing fields +select to_timestamp("16", "dd"); +select to_timestamp("02-29", "MM-dd"); +select to_date("16", "dd"); +select to_date("02-29", "MM-dd"); +select to_timestamp("2019 40", "yyyy mm"); +select to_timestamp("2019 10:10:10", "yyyy hh:mm:ss"); + +-- Unsupported narrow text style +select to_timestamp('2019-10-06 A', 'yyyy-MM-dd GGGGG'); +select to_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEEE'); +select to_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEE'); +select unix_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEE'); +select from_json('{"t":"26/October/2015"}', 't Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy')); +select from_json('{"d":"26/October/2015"}', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy')); +select from_csv('26/October/2015', 't Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy')); +select from_csv('26/October/2015', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy')); + +-- Datetime types parse error +select to_date("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS"); +select to_date("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS"); +select to_timestamp("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS"); +select to_timestamp("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS"); +select unix_timestamp("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS"); +select unix_timestamp("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS"); +select to_unix_timestamp("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS"); +select to_unix_timestamp("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS"); +select cast("Unparseable" as timestamp); +select cast("Unparseable" as date); + +-- next_day +select next_day("2015-07-23", "Mon"); +select next_day("2015-07-23", "xx"); +select next_day("xx", "Mon"); +select next_day(null, "Mon"); +select next_day(null, "xx"); diff --git a/sql/core/src/test/resources/sql-tests/inputs/describe-table-column.sql b/sql/core/src/test/resources/sql-tests/inputs/describe-table-column.sql index d55e398329b76..146977c806182 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/describe-table-column.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/describe-table-column.sql @@ -1,5 +1,5 @@ -- Test temp table -CREATE TEMPORARY VIEW desc_col_temp_view (key int COMMENT 'column_comment') USING PARQUET; +CREATE TEMPORARY VIEW desc_col_temp_view (key int COMMENT 'column_comment', col struct) USING PARQUET; DESC desc_col_temp_view key; @@ -13,6 +13,9 @@ DESC FORMATTED desc_col_temp_view desc_col_temp_view.key; -- Describe a non-existent column DESC desc_col_temp_view key1; +-- Describe a nested column +DESC desc_col_temp_view col.x; + -- Test persistent table CREATE TABLE desc_col_table (key int COMMENT 'column_comment') USING PARQUET; @@ -24,6 +27,9 @@ DESC EXTENDED desc_col_table key; DESC FORMATTED desc_col_table key; +-- Describe a non-existent column +DESC desc_col_table key1; + -- Test complex columns CREATE TABLE desc_complex_col_table (`a.b` int, col struct) USING PARQUET; diff --git a/sql/core/src/test/resources/sql-tests/inputs/except.sql b/sql/core/src/test/resources/sql-tests/inputs/except.sql index 1d579e65f3473..ffdf1f4f3d24d 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/except.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/except.sql @@ -55,3 +55,22 @@ FROM t1 WHERE t1.v >= (SELECT min(t2.v) FROM t2 WHERE t2.k = t1.k); + +-- SPARK-32638: corrects references when adding aliases in WidenSetOperationTypes +CREATE OR REPLACE TEMPORARY VIEW t3 AS VALUES (decimal(1)) tbl(v); +SELECT t.v FROM ( + SELECT v FROM t3 + EXCEPT + SELECT v + v AS v FROM t3 +) t; + +SELECT SUM(t.v) FROM ( + SELECT v FROM t3 + EXCEPT + SELECT v + v AS v FROM t3 +) t; + +-- Clean-up +DROP VIEW IF EXISTS t1; +DROP VIEW IF EXISTS t2; +DROP VIEW IF EXISTS t3; diff --git a/sql/core/src/test/resources/sql-tests/inputs/explain-aqe.sql b/sql/core/src/test/resources/sql-tests/inputs/explain-aqe.sql index f4afa2b77a9d7..7aef901da4fb5 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/explain-aqe.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/explain-aqe.sql @@ -1,3 +1,4 @@ --IMPORT explain.sql --SET spark.sql.adaptive.enabled=true +--SET spark.sql.maxMetadataStringLength = 500 diff --git a/sql/core/src/test/resources/sql-tests/inputs/explain-cbo.sql b/sql/core/src/test/resources/sql-tests/inputs/explain-cbo.sql new file mode 100644 index 0000000000000..eeb2180f7a542 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/explain-cbo.sql @@ -0,0 +1,27 @@ +--SET spark.sql.cbo.enabled=true +--SET spark.sql.maxMetadataStringLength = 500 + +CREATE TABLE explain_temp1(a INT, b INT) USING PARQUET; +CREATE TABLE explain_temp2(c INT, d INT) USING PARQUET; + +ANALYZE TABLE explain_temp1 COMPUTE STATISTICS FOR ALL COLUMNS; +ANALYZE TABLE explain_temp2 COMPUTE STATISTICS FOR ALL COLUMNS; + +EXPLAIN COST WITH max_store_sales AS +( + SELECT max(csales) tpcds_cmax + FROM ( + SELECT sum(b) csales + FROM explain_temp1 WHERE a < 100 + ) x +), +best_ss_customer AS +( + SELECT c + FROM explain_temp2 + WHERE d > (SELECT * FROM max_store_sales) +) +SELECT c FROM best_ss_customer; + +DROP TABLE explain_temp1; +DROP TABLE explain_temp2; diff --git a/sql/core/src/test/resources/sql-tests/inputs/explain.sql b/sql/core/src/test/resources/sql-tests/inputs/explain.sql index 80bf258704c70..736084597eb79 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/explain.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/explain.sql @@ -1,5 +1,6 @@ --SET spark.sql.codegen.wholeStage = true --SET spark.sql.adaptive.enabled = false +--SET spark.sql.maxMetadataStringLength = 500 -- Test tables CREATE table explain_temp1 (key int, val int) USING PARQUET; @@ -9,6 +10,11 @@ CREATE table explain_temp4 (key int, val string) USING PARQUET; SET spark.sql.codegen.wholeStage = true; +-- distinct func +EXPLAIN EXTENDED + SELECT sum(distinct val) + FROM explain_temp1; + -- single table EXPLAIN FORMATTED SELECT key, max(val) @@ -28,7 +34,7 @@ EXPLAIN FORMATTED EXPLAIN FORMATTED SELECT key, val FROM explain_temp1 WHERE key > 0 UNION - SELECT key, val FROM explain_temp1 WHERE key > 0; + SELECT key, val FROM explain_temp1 WHERE key > 1; -- Join EXPLAIN FORMATTED diff --git a/sql/core/src/test/resources/sql-tests/inputs/extract.sql b/sql/core/src/test/resources/sql-tests/inputs/extract.sql index 0f1fd5bbcca0b..31603fba99f3d 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/extract.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/extract.sql @@ -128,3 +128,34 @@ select c - i from t; select year(c - i) from t; select extract(year from c - i) from t; select extract(month from to_timestamp(c) - i) from t; + +-- extract fields from year-month/day-time intervals +select extract(YEAR from interval '2-1' YEAR TO MONTH); +select date_part('YEAR', interval '2-1' YEAR TO MONTH); +select extract(YEAR from -interval '2-1' YEAR TO MONTH); +select extract(MONTH from interval '2-1' YEAR TO MONTH); +select date_part('MONTH', interval '2-1' YEAR TO MONTH); +select extract(MONTH from -interval '2-1' YEAR TO MONTH); +select date_part(NULL, interval '2-1' YEAR TO MONTH); + +-- invalid +select extract(DAY from interval '2-1' YEAR TO MONTH); +select date_part('DAY', interval '2-1' YEAR TO MONTH); +select date_part('not_supported', interval '2-1' YEAR TO MONTH); + +select extract(DAY from interval '123 12:34:56.789123123' DAY TO SECOND); +select date_part('DAY', interval '123 12:34:56.789123123' DAY TO SECOND); +select extract(DAY from -interval '123 12:34:56.789123123' DAY TO SECOND); +select extract(HOUR from interval '123 12:34:56.789123123' DAY TO SECOND); +select date_part('HOUR', interval '123 12:34:56.789123123' DAY TO SECOND); +select extract(HOUR from -interval '123 12:34:56.789123123' DAY TO SECOND); +select extract(MINUTE from interval '123 12:34:56.789123123' DAY TO SECOND); +select date_part('MINUTE', interval '123 12:34:56.789123123' DAY TO SECOND); +select extract(MINUTE from -interval '123 12:34:56.789123123' DAY TO SECOND); +select extract(SECOND from interval '123 12:34:56.789123123' DAY TO SECOND); +select date_part('SECOND', interval '123 12:34:56.789123123' DAY TO SECOND); +select extract(SECOND from -interval '123 12:34:56.789123123' DAY TO SECOND); +select date_part(NULL, interval '123 12:34:56.789123123' DAY TO SECOND); + +select extract(MONTH from interval '123 12:34:56.789123123' DAY TO SECOND); +select date_part('not_supported', interval '123 12:34:56.789123123' DAY TO SECOND); diff --git a/sql/core/src/test/resources/sql-tests/inputs/group-analytics.sql b/sql/core/src/test/resources/sql-tests/inputs/group-analytics.sql index 9721f8c60ebce..d6381e59e0d84 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/group-analytics.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/group-analytics.sql @@ -18,15 +18,25 @@ AS courseSales(course, year, earnings); -- ROLLUP SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP(course, year) ORDER BY course, year; +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP(course, year, (course, year)) ORDER BY course, year; +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP(course, year, (course, year), ()) ORDER BY course, year; -- CUBE SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year) ORDER BY course, year; +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year, (course, year)) ORDER BY course, year; +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year, (course, year), ()) ORDER BY course, year; -- GROUPING SETS SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(course, year); +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(course, year, ()); SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(course); SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(year); +-- Partial ROLLUP/CUBE/GROUPING SETS +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, CUBE(course, year) ORDER BY course, year; +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year), ROLLUP(course, year) ORDER BY course, year; +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year), ROLLUP(course, year), GROUPING SETS(course, year) ORDER BY course, year; + -- GROUPING SETS with aggregate functions containing groupBy columns SELECT course, SUM(earnings) AS sum FROM courseSales GROUP BY course, earnings GROUPING SETS((), (course), (course, earnings)) ORDER BY course, sum; @@ -59,4 +69,25 @@ SELECT course, year FROM courseSales GROUP BY CUBE(course, year) ORDER BY groupi -- Aliases in SELECT could be used in ROLLUP/CUBE/GROUPING SETS SELECT a + b AS k1, b AS k2, SUM(a - b) FROM testData GROUP BY CUBE(k1, k2); SELECT a + b AS k, b, SUM(a - b) FROM testData GROUP BY ROLLUP(k, b); -SELECT a + b, b AS k, SUM(a - b) FROM testData GROUP BY a + b, k GROUPING SETS(k) +SELECT a + b, b AS k, SUM(a - b) FROM testData GROUP BY a + b, k GROUPING SETS(k); + +-- GROUP BY use mixed Separate columns and CUBE/ROLLUP/Gr +SELECT a, b, count(1) FROM testData GROUP BY a, b, CUBE(a, b); +SELECT a, b, count(1) FROM testData GROUP BY a, b, ROLLUP(a, b); +SELECT a, b, count(1) FROM testData GROUP BY CUBE(a, b), ROLLUP(a, b); +SELECT a, b, count(1) FROM testData GROUP BY a, CUBE(a, b), ROLLUP(b); +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b), (a), ()); +SELECT a, b, count(1) FROM testData GROUP BY a, CUBE(a, b), GROUPING SETS((a, b), (a), ()); +SELECT a, b, count(1) FROM testData GROUP BY a, CUBE(a, b), ROLLUP(a, b), GROUPING SETS((a, b), (a), ()); + +-- Support nested CUBE/ROLLUP/GROUPING SETS in GROUPING SETS +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(ROLLUP(a, b)); +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(GROUPING SETS((a, b), (a), ())); + +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b), GROUPING SETS(ROLLUP(a, b))); +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b, a, b), (a, b, a), (a, b)); +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(GROUPING SETS((a, b, a, b), (a, b, a), (a, b))); + +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(ROLLUP(a, b), CUBE(a, b)); +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(GROUPING SETS((a, b), (a), ()), GROUPING SETS((a, b), (a), (b), ())); +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b), (a), (), (a, b), (a), (b), ()); diff --git a/sql/core/src/test/resources/sql-tests/inputs/group-by-filter.sql b/sql/core/src/test/resources/sql-tests/inputs/group-by-filter.sql index beb5b9e5fe516..c1ccb654ee085 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/group-by-filter.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/group-by-filter.sql @@ -1,4 +1,10 @@ --- Test filter clause for aggregate expression. +-- Test filter clause for aggregate expression with codegen on and off. +--CONFIG_DIM1 spark.sql.codegen.wholeStage=true +--CONFIG_DIM1 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=CODEGEN_ONLY +--CONFIG_DIM1 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=NO_CODEGEN + +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false -- Test data. CREATE OR REPLACE TEMPORARY VIEW testData AS SELECT * FROM VALUES @@ -33,8 +39,21 @@ SELECT COUNT(id) FILTER (WHERE hiredate = date "2001-01-01") FROM emp; SELECT COUNT(id) FILTER (WHERE hiredate = to_date('2001-01-01 00:00:00')) FROM emp; SELECT COUNT(id) FILTER (WHERE hiredate = to_timestamp("2001-01-01 00:00:00")) FROM emp; SELECT COUNT(id) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd") = "2001-01-01") FROM emp; --- [SPARK-30276] Support Filter expression allows simultaneous use of DISTINCT --- SELECT COUNT(DISTINCT id) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd HH:mm:ss") = "2001-01-01 00:00:00") FROM emp; +SELECT COUNT(DISTINCT id) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd HH:mm:ss") = "2001-01-01 00:00:00") FROM emp; +SELECT COUNT(DISTINCT id), COUNT(DISTINCT id) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd HH:mm:ss") = "2001-01-01 00:00:00") FROM emp; +SELECT COUNT(DISTINCT id) FILTER (WHERE hiredate = to_timestamp("2001-01-01 00:00:00")), COUNT(DISTINCT id) FILTER (WHERE hiredate = to_date('2001-01-01 00:00:00')) FROM emp; +SELECT SUM(salary), COUNT(DISTINCT id), COUNT(DISTINCT id) FILTER (WHERE hiredate = date "2001-01-01") FROM emp; +SELECT COUNT(DISTINCT 1) FILTER (WHERE a = 1) FROM testData; +SELECT COUNT(DISTINCT id) FILTER (WHERE true) FROM emp; +SELECT COUNT(DISTINCT id) FILTER (WHERE false) FROM emp; +SELECT COUNT(DISTINCT 2), COUNT(DISTINCT 2,3) FILTER (WHERE dept_id = 40) FROM emp; +SELECT COUNT(DISTINCT 2), COUNT(DISTINCT 3,2) FILTER (WHERE dept_id = 40) FROM emp; +SELECT COUNT(DISTINCT 2), COUNT(DISTINCT 2,3) FILTER (WHERE dept_id > 0) FROM emp; +SELECT COUNT(DISTINCT 2), COUNT(DISTINCT 3,2) FILTER (WHERE dept_id > 0) FROM emp; +SELECT COUNT(DISTINCT id), COUNT(DISTINCT 2,3) FILTER (WHERE dept_id = 40) FROM emp; +SELECT COUNT(DISTINCT id), COUNT(DISTINCT 3,2) FILTER (WHERE dept_id = 40) FROM emp; +SELECT COUNT(DISTINCT id), COUNT(DISTINCT 2,3) FILTER (WHERE dept_id > 0) FROM emp; +SELECT COUNT(DISTINCT id), COUNT(DISTINCT 3,2) FILTER (WHERE dept_id > 0) FROM emp; -- Aggregate with filter and non-empty GroupBy expressions. SELECT a, COUNT(b) FILTER (WHERE a >= 2) FROM testData GROUP BY a; @@ -44,8 +63,11 @@ SELECT dept_id, SUM(salary) FILTER (WHERE hiredate > date "2003-01-01") FROM emp SELECT dept_id, SUM(salary) FILTER (WHERE hiredate > to_date("2003-01-01")) FROM emp GROUP BY dept_id; SELECT dept_id, SUM(salary) FILTER (WHERE hiredate > to_timestamp("2003-01-01 00:00:00")) FROM emp GROUP BY dept_id; SELECT dept_id, SUM(salary) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd") > "2003-01-01") FROM emp GROUP BY dept_id; --- [SPARK-30276] Support Filter expression allows simultaneous use of DISTINCT --- SELECT dept_id, SUM(DISTINCT salary) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd HH:mm:ss") > "2001-01-01 00:00:00") FROM emp GROUP BY dept_id; +SELECT dept_id, SUM(DISTINCT salary) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd HH:mm:ss") > "2001-01-01 00:00:00") FROM emp GROUP BY dept_id; +SELECT dept_id, SUM(DISTINCT salary), SUM(DISTINCT salary) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd HH:mm:ss") > "2001-01-01 00:00:00") FROM emp GROUP BY dept_id; +SELECT dept_id, SUM(DISTINCT salary) FILTER (WHERE hiredate > date "2001-01-01"), SUM(DISTINCT salary) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd HH:mm:ss") > "2001-01-01 00:00:00") FROM emp GROUP BY dept_id; +SELECT dept_id, COUNT(id), SUM(DISTINCT salary), SUM(DISTINCT salary) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd") > "2001-01-01") FROM emp GROUP BY dept_id; +SELECT b, COUNT(DISTINCT 1) FILTER (WHERE a = 1) FROM testData GROUP BY b; -- Aggregate with filter and grouped by literals. SELECT 'foo', COUNT(a) FILTER (WHERE b <= 2) FROM testData GROUP BY 1; @@ -58,13 +80,24 @@ select dept_id, count(distinct emp_name), count(distinct hiredate), sum(salary), select dept_id, count(distinct emp_name), count(distinct hiredate), sum(salary), sum(salary) filter (where id + dept_id > 500) from emp group by dept_id; select dept_id, count(distinct emp_name), count(distinct hiredate), sum(salary) filter (where salary < 400.00D), sum(salary) filter (where id > 200) from emp group by dept_id; select dept_id, count(distinct emp_name), count(distinct hiredate), sum(salary) filter (where salary < 400.00D), sum(salary) filter (where id + dept_id > 500) from emp group by dept_id; --- [SPARK-30276] Support Filter expression allows simultaneous use of DISTINCT --- select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct hiredate), sum(salary) from emp group by dept_id; --- select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) from emp group by dept_id; --- select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) filter (where salary < 400.00D) from emp group by dept_id; --- select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) filter (where salary < 400.00D), sum(salary) filter (where id > 200) from emp group by dept_id; --- select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct emp_name), sum(salary) from emp group by dept_id; --- select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct emp_name) filter (where hiredate > date "2003-01-01"), sum(salary) from emp group by dept_id; +select dept_id, count(distinct emp_name) filter (where id > 200), sum(salary) from emp group by dept_id; +select dept_id, count(distinct emp_name) filter (where id + dept_id > 500), sum(salary) from emp group by dept_id; +select dept_id, count(distinct emp_name), count(distinct emp_name) filter (where id > 200), sum(salary) from emp group by dept_id; +select dept_id, count(distinct emp_name), count(distinct emp_name) filter (where id + dept_id > 500), sum(salary) from emp group by dept_id; +select dept_id, count(distinct emp_name), count(distinct emp_name) filter (where id > 200), sum(salary), sum(salary) filter (where id > 200) from emp group by dept_id; +select dept_id, count(distinct emp_name), count(distinct emp_name) filter (where id + dept_id > 500), sum(salary), sum(salary) filter (where id > 200) from emp group by dept_id; +select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct hiredate), sum(salary) from emp group by dept_id; +select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) from emp group by dept_id; +select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) filter (where salary < 400.00D) from emp group by dept_id; +select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) filter (where salary < 400.00D), sum(salary) filter (where id > 200) from emp group by dept_id; +select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct emp_name), sum(salary) from emp group by dept_id; +select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct emp_name) filter (where hiredate > date "2003-01-01"), sum(salary) from emp group by dept_id; +select dept_id, sum(distinct (id + dept_id)) filter (where id > 200), count(distinct hiredate), sum(salary) from emp group by dept_id; +select dept_id, sum(distinct (id + dept_id)) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) from emp group by dept_id; +select dept_id, avg(distinct (id + dept_id)) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) filter (where salary < 400.00D) from emp group by dept_id; +select dept_id, count(distinct emp_name, hiredate) filter (where id > 200), sum(salary) from emp group by dept_id; +select dept_id, count(distinct emp_name, hiredate) filter (where id > 0), sum(salary) from emp group by dept_id; +select dept_id, count(distinct 1), count(distinct 1) filter (where id > 200), sum(salary) from emp group by dept_id; -- Aggregate with filter and grouped by literals (hash aggregate), here the input table is filtered using WHERE. SELECT 'foo', APPROX_COUNT_DISTINCT(a) FILTER (WHERE b >= 0) FROM testData WHERE a = 0 GROUP BY 1; @@ -78,9 +111,8 @@ SELECT a + 2, COUNT(b) FILTER (WHERE b IN (1, 2)) FROM testData GROUP BY a + 1; SELECT a + 1 + 1, COUNT(b) FILTER (WHERE b > 0) FROM testData GROUP BY a + 1; -- Aggregate with filter, foldable input and multiple distinct groups. --- [SPARK-30276] Support Filter expression allows simultaneous use of DISTINCT --- SELECT COUNT(DISTINCT b) FILTER (WHERE b > 0), COUNT(DISTINCT b, c) FILTER (WHERE b > 0 AND c > 2) --- FROM (SELECT 1 AS a, 2 AS b, 3 AS c) GROUP BY a; +SELECT COUNT(DISTINCT b) FILTER (WHERE b > 0), COUNT(DISTINCT b, c) FILTER (WHERE b > 0 AND c > 2) +FROM (SELECT 1 AS a, 2 AS b, 3 AS c) GROUP BY a; -- Check analysis exceptions SELECT a AS k, COUNT(b) FILTER (WHERE b > 0) FROM testData GROUP BY k; diff --git a/sql/core/src/test/resources/sql-tests/inputs/group-by-ordinal.sql b/sql/core/src/test/resources/sql-tests/inputs/group-by-ordinal.sql index 3144833b608be..b773396c050d2 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/group-by-ordinal.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/group-by-ordinal.sql @@ -54,6 +54,41 @@ select count(a), a from (select 1 as a) tmp group by 2 having a > 0; -- mixed cases: group-by ordinals and aliases select a, a AS k, count(b) from data group by k, 1; +-- can use ordinal in CUBE +select a, b, count(1) from data group by cube(1, 2); + +-- mixed cases: can use ordinal in CUBE +select a, b, count(1) from data group by cube(1, b); + +-- can use ordinal with cube +select a, b, count(1) from data group by 1, 2 with cube; + +-- can use ordinal in ROLLUP +select a, b, count(1) from data group by rollup(1, 2); + +-- mixed cases: can use ordinal in ROLLUP +select a, b, count(1) from data group by rollup(1, b); + +-- can use ordinal with rollup +select a, b, count(1) from data group by 1, 2 with rollup; + +-- can use ordinal in GROUPING SETS +select a, b, count(1) from data group by grouping sets((1), (2), (1, 2)); + +-- mixed cases: can use ordinal in GROUPING SETS +select a, b, count(1) from data group by grouping sets((1), (b), (a, 2)); + +select a, b, count(1) from data group by a, 2 grouping sets((1), (b), (a, 2)); + +-- range error +select a, b, count(1) from data group by a, -1; + +select a, b, count(1) from data group by a, 3; + +select a, b, count(1) from data group by cube(-1, 2); + +select a, b, count(1) from data group by cube(1, 3); + -- turn off group by ordinal set spark.sql.groupByOrdinal=false; diff --git a/sql/core/src/test/resources/sql-tests/inputs/group-by.sql b/sql/core/src/test/resources/sql-tests/inputs/group-by.sql index fedf03d774e42..e2c3672a24dcb 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/group-by.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/group-by.sql @@ -86,6 +86,16 @@ SELECT 1 FROM range(10) HAVING MAX(id) > 0; SELECT id FROM range(10) HAVING id > 0; +SET spark.sql.legacy.parser.havingWithoutGroupByAsWhere=true; + +SELECT 1 FROM range(10) HAVING true; + +SELECT 1 FROM range(10) HAVING MAX(id) > 0; + +SELECT id FROM range(10) HAVING id > 0; + +SET spark.sql.legacy.parser.havingWithoutGroupByAsWhere=false; + -- Test data CREATE OR REPLACE TEMPORARY VIEW test_agg AS SELECT * FROM VALUES (1, true), (1, false), @@ -166,3 +176,16 @@ SELECT * FROM (SELECT COUNT(*) AS cnt FROM test_agg) WHERE cnt > 1L; SELECT count(*) FROM test_agg WHERE count(*) > 1L; SELECT count(*) FROM test_agg WHERE count(*) + 1L > 1L; SELECT count(*) FROM test_agg WHERE k = 1 or k = 2 or count(*) + 1L > 1L or max(k) > 1; + +-- Aggregate with multiple distinct decimal columns +SELECT AVG(DISTINCT decimal_col), SUM(DISTINCT decimal_col) FROM VALUES (CAST(1 AS DECIMAL(9, 0))) t(decimal_col); + +-- SPARK-34581: Don't optimize out grouping expressions from aggregate expressions without aggregate function +SELECT not(a IS NULL), count(*) AS c +FROM testData +GROUP BY a IS NULL; + +SELECT if(not(a IS NULL), rand(0), 1), count(*) AS c +FROM testData +GROUP BY a IS NULL; + diff --git a/sql/core/src/test/resources/sql-tests/inputs/having.sql b/sql/core/src/test/resources/sql-tests/inputs/having.sql index 3b75be19b5677..2799b1a94d085 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/having.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/having.sql @@ -24,3 +24,9 @@ SELECT SUM(a) AS b, CAST('2020-01-01' AS DATE) AS fake FROM VALUES (1, 10), (2, SELECT SUM(a) AS b FROM VALUES (1, 10), (2, 20) AS T(a, b) GROUP BY GROUPING SETS ((b), (a, b)) HAVING b > 10; SELECT SUM(a) AS b FROM VALUES (1, 10), (2, 20) AS T(a, b) GROUP BY CUBE(a, b) HAVING b > 10; SELECT SUM(a) AS b FROM VALUES (1, 10), (2, 20) AS T(a, b) GROUP BY ROLLUP(a, b) HAVING b > 10; + +-- SPARK-33131: Grouping sets with having clause can not resolve qualified col name. +SELECT c1 FROM VALUES (1, 2) as t(c1, c2) GROUP BY GROUPING SETS(t.c1) HAVING t.c1 = 1; +SELECT c1 FROM VALUES (1, 2) as t(c1, c2) GROUP BY CUBE(t.c1) HAVING t.c1 = 1; +SELECT c1 FROM VALUES (1, 2) as t(c1, c2) GROUP BY ROLLUP(t.c1) HAVING t.c1 = 1; +SELECT c1 FROM VALUES (1, 2) as t(c1, c2) GROUP BY t.c1 HAVING t.c1 = 1; diff --git a/sql/core/src/test/resources/sql-tests/inputs/higher-order-functions.sql b/sql/core/src/test/resources/sql-tests/inputs/higher-order-functions.sql index cfa06aea82b04..0b7bf517f916b 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/higher-order-functions.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/higher-order-functions.sql @@ -92,3 +92,6 @@ select transform_values(ys, (k, v) -> k + v) as v from nested; -- use non reversed keywords: all is non reversed only if !ansi select transform(ys, all -> all * all) as v from values (array(32, 97)) as t(ys); select transform(ys, (all, i) -> all + i) as v from values (array(32, 97)) as t(ys); + +-- SPARK-32819: Aggregate on nested string arrays +select aggregate(split('abcdefgh',''), array(array('')), (acc, x) -> array(array(x))); \ No newline at end of file diff --git a/sql/core/src/test/resources/sql-tests/inputs/ignored.sql b/sql/core/src/test/resources/sql-tests/inputs/ignored.sql new file mode 100644 index 0000000000000..0b5331a1d0229 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/ignored.sql @@ -0,0 +1,4 @@ +-- This is a query file that has been ignored. +-- It includes a query that should crash Spark. +-- If the test case is run, the whole suite would fail. +some random not working query that should crash Spark. diff --git a/sql/core/src/test/resources/sql-tests/inputs/intersect-all.sql b/sql/core/src/test/resources/sql-tests/inputs/intersect-all.sql index b0b2244048caa..077caa5dd44a0 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/intersect-all.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/intersect-all.sql @@ -155,6 +155,21 @@ SELECT * FROM tab2; -- Restore the property SET spark.sql.legacy.setopsPrecedence.enabled = false; +-- SPARK-32638: corrects references when adding aliases in WidenSetOperationTypes +CREATE OR REPLACE TEMPORARY VIEW tab3 AS VALUES (decimal(1)), (decimal(2)) tbl3(v); +SELECT t.v FROM ( + SELECT v FROM tab3 + INTERSECT + SELECT v + v AS v FROM tab3 +) t; + +SELECT SUM(t.v) FROM ( + SELECT v FROM tab3 + INTERSECT + SELECT v + v AS v FROM tab3 +) t; + -- Clean-up DROP VIEW IF EXISTS tab1; DROP VIEW IF EXISTS tab2; +DROP VIEW IF EXISTS tab3; diff --git a/sql/core/src/test/resources/sql-tests/inputs/interval.sql b/sql/core/src/test/resources/sql-tests/inputs/interval.sql index 76d4a8c87eef5..063727a76ea6b 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/interval.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/interval.sql @@ -20,6 +20,12 @@ select -interval '-1 month 1 day -1 second'; select -interval -1 month 1 day -1 second; select +interval '-1 month 1 day -1 second'; select +interval -1 month 1 day -1 second; +select interval -'1-1' year to month; +select interval -'-1-1' year to month; +select interval +'-1-1' year to month; +select interval - '1 2:3:4.001' day to second; +select interval +'1 2:3:4.001' day to second; +select interval -'-1 2:3:4.001' day to second; -- make intervals select make_interval(1); @@ -29,6 +35,8 @@ select make_interval(1, 2, 3, 4); select make_interval(1, 2, 3, 4, 5); select make_interval(1, 2, 3, 4, 5, 6); select make_interval(1, 2, 3, 4, 5, 6, 7.008009); +select make_interval(1, 2, 3, 4, 0, 0, 123456789012.123456); +select make_interval(0, 0, 0, 0, 0, 0, 1234567890123456789); -- cast string to intervals select cast('1 second' as interval); @@ -43,6 +51,8 @@ select cast('- +1 second' as interval); select interval 13.123456789 seconds, interval -13.123456789 second; select interval 1 year 2 month 3 week 4 day 5 hour 6 minute 7 seconds 8 millisecond 9 microsecond; select interval '30' year '25' month '-100' day '40' hour '80' minute '299.889987299' second; +select interval '0-0' year to month; +select interval '0 0:0:0' day to second; select interval '0 0:0:0.1' day to second; select interval '10-9' year to month; select interval '20 15' day to hour; @@ -53,6 +63,7 @@ select interval '15:40:32.99899999' hour to second; select interval '40:32.99899999' minute to second; select interval '40:32' minute to second; select interval 30 day day; +select interval 30 days days; -- invalid day-time string intervals select interval '20 15:40:32.99899999' day to hour; @@ -88,6 +99,13 @@ select interval '12:11:10' hour to second '1' year; select interval (-30) day; select interval (a + 1) day; select interval 30 day day day; +select interval (-30) days; +select interval (a + 1) days; +select interval 30 days days days; +SELECT INTERVAL '178956970-7' YEAR TO MONTH; +SELECT INTERVAL '178956970-8' YEAR TO MONTH; +SELECT INTERVAL '-178956970-8' YEAR TO MONTH; +SELECT INTERVAL -'178956970-8' YEAR TO MONTH; -- Interval year-month arithmetic @@ -169,6 +187,10 @@ select interval '2-2\t' year to month; select interval '-\t2-2\t' year to month; select interval '\n0 12:34:46.789\t' day to second; select interval '\n-\t10\t 12:34:46.789\t' day to second; +select interval '中文 interval 1 day'; +select interval 'interval中文 1 day'; +select interval 'interval 1中文day'; + -- interval overflow if (ansi) exception else NULL select -(a) from values (interval '-2147483648 months', interval '2147483647 months') t(a, b); @@ -188,3 +210,29 @@ SELECT to_json(from_json('{"a":"1 days"}', 'a interval')), to_json(map('a', interval 25 month 100 day 130 minute)), from_json(to_json(map('a', interval 25 month 100 day 130 minute)), 'a interval'); + +select interval '+'; +select interval '+.'; +select interval '1'; +select interval '1.2'; +select interval '- 2'; +select interval '1 day -'; +select interval '1 day 1'; + +select interval '1 day 2' day; +select interval 'interval 1' day; +select interval '-\t 1' day; + +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / 2; +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / 5; +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / -1; +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / -1L; +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / -1.0; +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / -1.0D; + +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / 2; +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / 5; +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / -1; +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / -1L; +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / -1.0; +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / -1.0D; diff --git a/sql/core/src/test/resources/sql-tests/inputs/json-functions.sql b/sql/core/src/test/resources/sql-tests/inputs/json-functions.sql index 131890fddb0db..f6fa44161a771 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/json-functions.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/json-functions.sql @@ -48,6 +48,21 @@ select from_json('[null, {"a":2}]', 'array>'); select from_json('[{"a": 1}, {"b":2}]', 'array>'); select from_json('[{"a": 1}, 2]', 'array>'); +-- from_json - datetime type +select from_json('{"d": "2012-12-15", "t": "2012-12-15 15:15:15"}', 'd date, t timestamp'); +select from_json( + '{"d": "12/15 2012", "t": "12/15 2012 15:15:15"}', + 'd date, t timestamp', + map('dateFormat', 'MM/dd yyyy', 'timestampFormat', 'MM/dd yyyy HH:mm:ss')); +select from_json( + '{"d": "02-29"}', + 'd date', + map('dateFormat', 'MM-dd')); +select from_json( + '{"t": "02-29"}', + 't timestamp', + map('timestampFormat', 'MM-dd')); + -- to_json - array type select to_json(array('1', '2', '3')); select to_json(array(array(1, 2, 3), array(4))); diff --git a/sql/core/src/test/resources/sql-tests/inputs/like-all.sql b/sql/core/src/test/resources/sql-tests/inputs/like-all.sql index a084dbef61a0c..51b689607e8e3 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/like-all.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/like-all.sql @@ -1,3 +1,5 @@ +-- test cases for like all + CREATE OR REPLACE TEMPORARY VIEW like_all_table AS SELECT * FROM (VALUES ('google', '%oo%'), ('facebook', '%oo%'), diff --git a/sql/core/src/test/resources/sql-tests/inputs/like-any.sql b/sql/core/src/test/resources/sql-tests/inputs/like-any.sql index 5758a2a494944..a6e9827d58d94 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/like-any.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/like-any.sql @@ -1,3 +1,5 @@ +-- test cases for like any + CREATE OR REPLACE TEMPORARY VIEW like_any_table AS SELECT * FROM (VALUES ('google', '%oo%'), ('facebook', '%oo%'), diff --git a/sql/core/src/test/resources/sql-tests/inputs/literals.sql b/sql/core/src/test/resources/sql-tests/inputs/literals.sql index 108cfd766af2c..9f0eefc16a8cd 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/literals.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/literals.sql @@ -45,6 +45,11 @@ select 9223372036854775808, -9223372036854775809; select 1234567890123456789012345678901234567890; select 1234567890123456789012345678901234567890.0; +-- float +select 1F, 1.2F, .10f, 0.10f; +select -1F, -1.2F, -.10F, -0.10F; +select -3.4028235E39f; + -- double select 1D, 1.2D, 1e10, 1.5e5, .10D, 0.10D, .1e5, .9e+2, 0.9e+2, 900e-1, 9.e+1; select -1D, -1.2D, -1e10, -1.5e5, -.10D, -0.10D, -.1e5; @@ -55,6 +60,7 @@ select 1E309, -1E309; -- decimal parsing select 0.3, -0.8, .5, -.18, 0.1111, .1111; +select 0.3 F, 0.4 D, 0.5 BD; -- super large scientific notation double literals should still be valid doubles select 123456789012345678901234567890123456789e10d, 123456789012345678901234567890123456789.1e10d; diff --git a/sql/core/src/test/resources/sql-tests/inputs/map.sql b/sql/core/src/test/resources/sql-tests/inputs/map.sql new file mode 100644 index 0000000000000..e2d855fba154e --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/map.sql @@ -0,0 +1,5 @@ +-- test cases for map functions + +-- key does not exist +select element_at(map(1, 'a', 2, 'b'), 5); +select map(1, 'a', 2, 'b')[5]; diff --git a/sql/core/src/test/resources/sql-tests/inputs/misc-functions.sql b/sql/core/src/test/resources/sql-tests/inputs/misc-functions.sql index 95f71925e9294..907ff33000d8e 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/misc-functions.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/misc-functions.sql @@ -8,3 +8,15 @@ select typeof(cast(1.0 as float)), typeof(1.0D), typeof(1.2); select typeof(date '1986-05-23'), typeof(timestamp '1986-05-23'), typeof(interval '23 days'); select typeof(x'ABCD'), typeof('SPARK'); select typeof(array(1, 2)), typeof(map(1, 2)), typeof(named_struct('a', 1, 'b', 'spark')); + +-- Spark-32793: Rewrite AssertTrue with RaiseError +SELECT assert_true(true), assert_true(boolean(1)); +SELECT assert_true(false); +SELECT assert_true(boolean(0)); +SELECT assert_true(null); +SELECT assert_true(boolean(null)); +SELECT assert_true(false, 'custom error message'); + +CREATE TEMPORARY VIEW tbl_misc AS SELECT * FROM (VALUES (1), (8), (2)) AS T(v); +SELECT raise_error('error message'); +SELECT if(v > 5, raise_error('too big: ' || v), v + 1) FROM tbl_misc; diff --git a/sql/core/src/test/resources/sql-tests/inputs/natural-join.sql b/sql/core/src/test/resources/sql-tests/inputs/natural-join.sql index 71a50157b766c..060f15e3d2e87 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/natural-join.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/natural-join.sql @@ -10,6 +10,19 @@ create temporary view nt2 as select * from values ("one", 5) as nt2(k, v2); +create temporary view nt3 as select * from values + ("one", 4), + ("two", 5), + ("one", 6) + as nt3(k, v3); + +create temporary view nt4 as select * from values + ("one", 7), + ("two", 8), + ("one", 9) + as nt4(k, v4); + +SELECT * FROM nt1 natural join nt2; SELECT * FROM nt1 natural join nt2 where k = "one"; @@ -18,3 +31,43 @@ SELECT * FROM nt1 natural left join nt2 order by v1, v2; SELECT * FROM nt1 natural right join nt2 order by v1, v2; SELECT count(*) FROM nt1 natural full outer join nt2; + +SELECT k FROM nt1 natural join nt2; + +SELECT k FROM nt1 natural join nt2 where k = "one"; + +SELECT nt1.* FROM nt1 natural join nt2; + +SELECT nt2.* FROM nt1 natural join nt2; + +SELECT sbq.* from (SELECT * FROM nt1 natural join nt2) sbq; + +SELECT sbq.k from (SELECT * FROM nt1 natural join nt2) sbq; + +SELECT nt1.*, nt2.* FROM nt1 natural join nt2; + +SELECT *, nt2.k FROM nt1 natural join nt2; + +SELECT nt1.k, nt2.k FROM nt1 natural join nt2; + +SELECT nt1.k, nt2.k FROM nt1 natural join nt2 where k = "one"; + +SELECT * FROM (SELECT * FROM nt1 natural join nt2); + +SELECT * FROM (SELECT nt1.*, nt2.* FROM nt1 natural join nt2); + +SELECT * FROM (SELECT nt1.v1, nt2.k FROM nt1 natural join nt2); + +SELECT nt2.k FROM (SELECT * FROM nt1 natural join nt2); + +SELECT * FROM nt1 natural join nt2 natural join nt3; + +SELECT nt1.*, nt2.*, nt3.* FROM nt1 natural join nt2 natural join nt3; + +SELECT nt1.*, nt2.*, nt3.* FROM nt1 natural join nt2 join nt3 on nt2.k = nt3.k; + +SELECT * FROM nt1 natural join nt2 join nt3 on nt1.k = nt3.k; + +SELECT * FROM nt1 natural join nt2 join nt3 on nt2.k = nt3.k; + +SELECT nt1.*, nt2.*, nt3.*, nt4.* FROM nt1 natural join nt2 natural join nt3 natural join nt4; diff --git a/sql/core/src/test/resources/sql-tests/inputs/operators.sql b/sql/core/src/test/resources/sql-tests/inputs/operators.sql index 20bf0eb15c5b2..c296fa5f7e87e 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/operators.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/operators.sql @@ -81,3 +81,17 @@ select positive('-1.11'), positive(-1.11), negative('-1.11'), negative(-1.11); -- pmod select pmod(-7, 2), pmod(0, 2), pmod(7, 0), pmod(7, null), pmod(null, 2), pmod(null, null); select pmod(cast(3.13 as decimal), cast(0 as decimal)), pmod(cast(2 as smallint), cast(0 as smallint)); + +-- width_bucket +select width_bucket(5.35, 0.024, 10.06, 5); +select width_bucket(5.35, 0.024, 10.06, 3 + 2); +select width_bucket('5.35', '0.024', '10.06', '5'); +select width_bucket(5.35, 0.024, 10.06, 2.5); +select width_bucket(5.35, 0.024, 10.06, 0.5); +select width_bucket(null, 0.024, 10.06, 5); +select width_bucket(5.35, null, 10.06, 5); +select width_bucket(5.35, 0.024, null, -5); +select width_bucket(5.35, 0.024, 10.06, null); +select width_bucket(5.35, 0.024, 10.06, -5); +select width_bucket(5.35, 0.024, 10.06, 9223372036854775807L); -- long max value +select width_bucket(5.35, 0.024, 10.06, 9223372036854775807L - 1); diff --git a/sql/core/src/test/resources/sql-tests/inputs/parse-schema-string.sql b/sql/core/src/test/resources/sql-tests/inputs/parse-schema-string.sql new file mode 100644 index 0000000000000..c67d45139fd6c --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/parse-schema-string.sql @@ -0,0 +1,5 @@ +-- Use keywords as attribute names +select from_csv('1', 'create INT'); +select from_csv('1', 'cube INT'); +select from_json('{"create":1}', 'create INT'); +select from_json('{"cube":1}', 'cube INT'); diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/aggregates_part3.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/aggregates_part3.sql index 746b677234832..657ea59ec8f11 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/aggregates_part3.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/aggregates_part3.sql @@ -241,10 +241,9 @@ select sum(1/ten) filter (where ten > 0) from tenk1; -- select ten, sum(distinct four) filter (where four::text ~ '123') from onek a -- group by ten; --- [SPARK-30276] Support Filter expression allows simultaneous use of DISTINCT --- select ten, sum(distinct four) filter (where four > 10) from onek a --- group by ten --- having exists (select 1 from onek b where sum(distinct a.four) = b.four); +select ten, sum(distinct four) filter (where four > 10) from onek a +group by ten +having exists (select 1 from onek b where sum(distinct a.four) = b.four); -- [SPARK-28682] ANSI SQL: Collation Support -- select max(foo COLLATE "C") filter (where (bar collate "POSIX") > '0') diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/case.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/case.sql index 6d9c44c67a96b..b39ccb85fb366 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/case.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/case.sql @@ -65,11 +65,11 @@ SELECT '7' AS `None`, CASE WHEN rand() < 0 THEN 1 END AS `NULL on no matches`; +-- [SPARK-33008] Spark SQL throws an exception -- Constant-expression folding shouldn't evaluate unreachable subexpressions SELECT CASE WHEN 1=0 THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END; SELECT CASE 1 WHEN 0 THEN 1/0 WHEN 1 THEN 1 ELSE 2/0 END; --- [SPARK-27923] PostgreSQL throws an exception but Spark SQL is NULL -- However we do not currently suppress folding of potentially -- reachable subexpressions SELECT CASE WHEN i > 100 THEN 1/0 ELSE 0 END FROM case_tbl; diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/create_view.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/create_view.sql index 21ffd85f7d01f..2889941c1fcc1 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/create_view.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/create_view.sql @@ -636,7 +636,7 @@ DESC TABLE vv6; -- Check cases involving dropped/altered columns in a function's rowtype result -- --- Skip the tests below because Spark does't support PostgreSQL-specific UDFs/transactions +-- Skip the tests below because Spark doesn't support PostgreSQL-specific UDFs/transactions -- create table tt14t (f1 text, f2 text, f3 text, f4 text); -- insert into tt14t values('foo', 'bar', 'baz', '42'); -- diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/groupingsets.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/groupingsets.sql index fc54d179f742c..45617c53166aa 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/groupingsets.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/groupingsets.sql @@ -336,9 +336,8 @@ order by 2,1; -- order by 2,1; -- FILTER queries --- [SPARK-30276] Support Filter expression allows simultaneous use of DISTINCT --- select ten, sum(distinct four) filter (where string(four) like '123') from onek a --- group by rollup(ten); +select ten, sum(distinct four) filter (where string(four) like '123') from onek a +group by rollup(ten); -- More rescan tests -- [SPARK-27877] ANSI SQL: LATERAL derived table(T491) diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/join.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/join.sql index cc07b00cc3670..9d6d296ce4a5a 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/join.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/join.sql @@ -743,20 +743,25 @@ select * from a left join b on i = x and i = y and x = i; -- -- test NULL behavior of whole-row Vars, per bug #5025 -- -select t1.q2, count(t2.*) +--- [SPARK-34199] changed the `count(t2.*)` to `count(t2.q1, t2.q2)` since we have +--- blocked `count(tblName.*)`. Besides this, in pgsql, `count(t2.*)` of outter join +--- means how many matching rows produced by t2 while Spark SQL doesn't have this semantic. +--- So here we use `count(t2.q1, t2.q2)` instead of `count(1)` to keep the query output +--- unchanged. +select t1.q2, count(t2.q1, t2.q2) from int8_tbl t1 left join int8_tbl t2 on (t1.q2 = t2.q1) group by t1.q2 order by 1; -select t1.q2, count(t2.*) +select t1.q2, count(t2.q1, t2.q2) from int8_tbl t1 left join (select * from int8_tbl) t2 on (t1.q2 = t2.q1) group by t1.q2 order by 1; -- [SPARK-28330] Enhance query limit --- select t1.q2, count(t2.*) +-- select t1.q2, count(t2.q1, t2.q2) -- from int8_tbl t1 left join (select * from int8_tbl offset 0) t2 on (t1.q2 = t2.q1) -- group by t1.q2 order by 1; -select t1.q2, count(t2.*) +select t1.q2, count(t2.q1, t2.q2) from int8_tbl t1 left join (select q1, case when q2=1 then 1 else q2 end as q2 from int8_tbl) t2 on (t1.q2 = t2.q1) @@ -884,7 +889,7 @@ from nt3 as nt3 on ss2.id = nt3.nt2_id where nt3.id = 1 and ss2.b3; --- [SPARK-28379] Correlated scalar subqueries must be aggregated +-- Accessing outer query column is not allowed in LocalLimit -- -- test case where a PlaceHolderVar is propagated into a subquery -- diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/numeric.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/numeric.sql index dbdb2cace0e0c..53f2aa41ae3fa 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/numeric.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/numeric.sql @@ -754,22 +754,22 @@ DROP TABLE ceil_floor_round; -- round((2.5 * 10 ^ i)::numeric, -i) -- FROM generate_series(-5,5) AS t(i); --- [SPARK-21117] Built-in SQL Function Support - WIDTH_BUCKET -- Testing for width_bucket(). For convenience, we test both the -- numeric and float8 versions of the function in this file. -- errors --- SELECT width_bucket(5.0, 3.0, 4.0, 0); --- SELECT width_bucket(5.0, 3.0, 4.0, -5); --- SELECT width_bucket(3.5, 3.0, 3.0, 888); --- SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, 0); --- SELECT width_bucket(5.0::float8, 3.0::float8, 4.0::float8, -5); --- SELECT width_bucket(3.5::float8, 3.0::float8, 3.0::float8, 888); --- SELECT width_bucket('NaN', 3.0, 4.0, 888); --- SELECT width_bucket(0::float8, 'NaN', 4.0::float8, 888); +SELECT width_bucket(5.0, 3.0, 4.0, 0); +SELECT width_bucket(5.0, 3.0, 4.0, -5); +SELECT width_bucket(3.5, 3.0, 3.0, 888); +SELECT width_bucket(double(5.0), double(3.0), double(4.0), 0); +SELECT width_bucket(double(5.0), double(3.0), double(4.0), -5); +SELECT width_bucket(double(3.5), double(3.0), double(3.0), 888); +SELECT width_bucket('NaN', 3.0, 4.0, 888); +SELECT width_bucket(double(0), 'NaN', double(4.0), 888); -- normal operation -- CREATE TABLE width_bucket_test (operand_num numeric, operand_f8 float8); +CREATE TABLE width_bucket_test (operand_num decimal(30,15), operand_f8 double) USING parquet; -- COPY width_bucket_test (operand_num) FROM stdin; -- -5.2 @@ -795,28 +795,50 @@ DROP TABLE ceil_floor_round; -- UPDATE width_bucket_test SET operand_f8 = operand_num::float8; --- SELECT --- operand_num, --- width_bucket(operand_num, 0, 10, 5) AS wb_1, --- width_bucket(operand_f8, 0, 10, 5) AS wb_1f, --- width_bucket(operand_num, 10, 0, 5) AS wb_2, --- width_bucket(operand_f8, 10, 0, 5) AS wb_2f, --- width_bucket(operand_num, 2, 8, 4) AS wb_3, --- width_bucket(operand_f8, 2, 8, 4) AS wb_3f, --- width_bucket(operand_num, 5.0, 5.5, 20) AS wb_4, --- width_bucket(operand_f8, 5.0, 5.5, 20) AS wb_4f, --- width_bucket(operand_num, -25, 25, 10) AS wb_5, --- width_bucket(operand_f8, -25, 25, 10) AS wb_5f --- FROM width_bucket_test; +INSERT INTO width_bucket_test VALUES + (-5.2, -5.2), + (-0.0000000001, -0.0000000001), + (0.000000000001, 0.000000000001), + (1, 1), + (1.99999999999999, 1.99999999999999), + (2, 2), + (2.00000000000001, 2.00000000000001), + (3, 3), + (4, 4), + (4.5, 4.5), + (5, 5), + (5.5, 5.5), + (6, 6), + (7, 7), + (8, 8), + (9, 9), + (9.99999999999999, 9.99999999999999), + (10, 10), + (10.0000000000001, 10.0000000000001); + +SELECT + operand_num, + width_bucket(operand_num, 0, 10, 5) AS wb_1, + width_bucket(operand_f8, 0, 10, 5) AS wb_1f, + width_bucket(operand_num, 10, 0, 5) AS wb_2, + width_bucket(operand_f8, 10, 0, 5) AS wb_2f, + width_bucket(operand_num, 2, 8, 4) AS wb_3, + width_bucket(operand_f8, 2, 8, 4) AS wb_3f, + width_bucket(operand_num, 5.0, 5.5, 20) AS wb_4, + width_bucket(operand_f8, 5.0, 5.5, 20) AS wb_4f, + width_bucket(operand_num, -25, 25, 10) AS wb_5, + width_bucket(operand_f8, -25, 25, 10) AS wb_5f + FROM width_bucket_test + ORDER BY operand_num ASC; -- for float8 only, check positive and negative infinity: we require -- finite bucket bounds, but allow an infinite operand --- SELECT width_bucket(0.0::float8, 'Infinity'::float8, 5, 10); -- error --- SELECT width_bucket(0.0::float8, 5, '-Infinity'::float8, 20); -- error --- SELECT width_bucket('Infinity'::float8, 1, 10, 10), --- width_bucket('-Infinity'::float8, 1, 10, 10); +SELECT width_bucket(double(0.0), double('Infinity'), 5, 10); -- error +SELECT width_bucket(double(0.0), 5, double('-Infinity'), 20); -- error +SELECT width_bucket(double('Infinity'), 1, 10, 10), + width_bucket(double('-Infinity'), 1, 10, 10); --- DROP TABLE width_bucket_test; +DROP TABLE width_bucket_test; -- [SPARK-28137] Missing Data Type Formatting Functions: TO_CHAR -- TO_CHAR() diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/select_having.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/select_having.sql index 2edde8df08047..0efe0877e9b3e 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/select_having.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/select_having.sql @@ -49,6 +49,7 @@ SELECT 1 AS one FROM test_having HAVING a > 1; SELECT 1 AS one FROM test_having HAVING 1 > 2; SELECT 1 AS one FROM test_having HAVING 1 < 2; +-- [SPARK-33008] Spark SQL throws an exception -- and just to prove that we aren't scanning the table: SELECT 1 AS one FROM test_having WHERE 1/a = 1 HAVING 1 < 2; diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/strings.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/strings.sql index e2a94404395bc..c252db7d3a8ae 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/strings.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/strings.sql @@ -647,10 +647,9 @@ SELECT repeat('Pg', 4); SELECT repeat('Pg', -4); SELECT trim(binary('\\000') from binary('\\000Tom\\000')); --- [SPARK-28123] Add support btrim --- SELECT btrim(E'\\000trim\\000'::bytea, E'\\000'::bytea); --- SELECT btrim(''::bytea, E'\\000'::bytea); --- SELECT btrim(E'\\000trim\\000'::bytea, ''::bytea); +SELECT btrim(binary('\\000trim\\000'), binary('\\000')); +SELECT btrim(binary(''), binary('\\000')); +SELECT btrim(binary('\\000trim\\000'), binary('')); -- [SPARK-28121] decode can not accept 'escape' as charset -- [SPARK-28412][SQL] ANSI SQL: OVERLAY function support byte array -- SELECT encode(overlay(E'Th\\000omas'::bytea placing E'Th\\001omas'::bytea from 2),'escape'); diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part1.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part1.sql index 087d7a5befd19..3ebe9f91b2a08 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part1.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part1.sql @@ -95,7 +95,7 @@ SELECT last(ten) OVER (PARTITION BY four), ten, four FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s ORDER BY four, ten; --- [SPARK-27951] ANSI SQL: NTH_VALUE function +-- [SPARK-30707] Lead/Lag window function throws AnalysisException without ORDER BY clause -- SELECT nth_value(ten, four + 1) OVER (PARTITION BY four), ten, four -- FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s; @@ -135,7 +135,7 @@ FROM tenk1 GROUP BY ten, two WINDOW win AS (PARTITION BY two ORDER BY ten); -- FROM empsalary WINDOW w1 AS (ORDER BY salary), w2 AS (ORDER BY salary); -- subplan --- [SPARK-28379] Correlated scalar subqueries must be aggregated +-- Cannot specify window frame for lead function -- SELECT lead(ten, (SELECT two FROM tenk1 WHERE s.unique2 = unique2)) OVER (PARTITION BY four ORDER BY ten) -- FROM tenk1 s WHERE unique2 < 10; @@ -146,7 +146,7 @@ SELECT count(*) OVER (PARTITION BY four) FROM (SELECT * FROM tenk1 WHERE FALSE)s -- mixture of agg/wfunc in the same window -- SELECT sum(salary) OVER w, rank() OVER w FROM empsalary WINDOW w AS (PARTITION BY depname ORDER BY salary DESC); --- Cannot safely cast 'enroll_date': StringType to DateType; +-- Cannot safely cast 'enroll_date': string to date; -- SELECT empno, depname, salary, bonus, depadj, MIN(bonus) OVER (ORDER BY empno), MAX(depadj) OVER () FROM( -- SELECT *, -- CASE WHEN enroll_date < '2008-01-01' THEN 2008 - extract(year FROM enroll_date) END * 500 AS bonus, @@ -301,7 +301,7 @@ FROM tenk1 WHERE unique1 < 10; -- unique1, four -- FROM tenk1 WHERE unique1 < 10 WINDOW w AS (order by four); --- [SPARK-27951] ANSI SQL: NTH_VALUE function +-- [SPARK-30707] Lead/Lag window function throws AnalysisException without ORDER BY clause -- SELECT first_value(unique1) over w, -- nth_value(unique1, 2) over w AS nth_2, -- last_value(unique1) over w, unique1, four diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part2.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part2.sql index ba1acc9f56b4a..50c0bc3410312 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part2.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part2.sql @@ -105,7 +105,7 @@ FROM tenk1 WHERE unique1 < 10; -- select sum(salary) over (order by enroll_date range between '1 year' preceding and '1 year' following -- exclude ties), salary, enroll_date from empsalary; --- [SPARK-27951] ANSI SQL: NTH_VALUE function +-- [SPARK-28310] ANSI SQL grammar support: first_value/last_value(expression, [RESPECT NULLS | IGNORE NULLS]) -- select first_value(salary) over(order by salary range between 1000 preceding and 1000 following), -- lead(salary) over(order by salary range between 1000 preceding and 1000 following), -- nth_value(salary, 1) over(order by salary range between 1000 preceding and 1000 following), @@ -116,7 +116,7 @@ FROM tenk1 WHERE unique1 < 10; -- lag(salary) over(order by salary range between 1000 preceding and 1000 following), -- salary from empsalary; --- [SPARK-27951] ANSI SQL: NTH_VALUE function +-- [SPARK-28310] ANSI SQL grammar support: first_value/last_value(expression, [RESPECT NULLS | IGNORE NULLS]) -- select first_value(salary) over(order by salary range between 1000 following and 3000 following -- exclude current row), -- lead(salary) over(order by salary range between 1000 following and 3000 following exclude ties), diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part3.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part3.sql index cd3b74b3aa03f..6f33a07631f7a 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part3.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/window_part3.sql @@ -42,7 +42,7 @@ create table datetimes ( f_timestamp timestamp ) using parquet; --- Spark cannot safely cast StringType to TimestampType +-- Spark cannot safely cast string to timestamp -- [SPARK-29636] Spark can't parse '11:00 BST' or '2000-10-19 10:23:54+01' signatures to timestamp insert into datetimes values (1, timestamp '11:00', cast ('11:00 BST' as timestamp), cast ('1 year' as timestamp), cast ('2000-10-19 10:23:54+01' as timestamp), timestamp '2000-10-19 10:23:54'), @@ -399,8 +399,7 @@ SELECT range(1, 100) OVER () FROM empsalary; SELECT ntile(0) OVER (ORDER BY ten), ten, four FROM tenk1; --- [SPARK-27951] ANSI SQL: NTH_VALUE function --- SELECT nth_value(four, 0) OVER (ORDER BY ten), ten, four FROM tenk1; +SELECT nth_value(four, 0) OVER (ORDER BY ten), ten, four FROM tenk1; -- filter diff --git a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/with.sql b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/with.sql index 83c6fd8cbac91..a3e0b15b582f5 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/with.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/postgreSQL/with.sql @@ -931,7 +931,7 @@ SELECT * FROM outermost ORDER BY 1; -- data-modifying WITH containing INSERT...ON CONFLICT DO UPDATE -- [ORIGINAL SQL] --CREATE TABLE withz AS SELECT i AS k, (i || ' v')::text v FROM generate_series(1, 16, 3) i; -CREATE TABLE withz USING parquet AS SELECT i AS k, CAST(i || ' v' AS string) v FROM (SELECT EXPLODE(SEQUENCE(1, 16, 3)) i); +CREATE TABLE withz USING parquet AS SELECT i AS k, CAST(i AS string) || ' v' AS v FROM (SELECT EXPLODE(SEQUENCE(1, 16, 3)) i); -- [NOTE] Spark SQL doesn't support UNIQUE constraints --ALTER TABLE withz ADD UNIQUE (k); diff --git a/sql/core/src/test/resources/sql-tests/inputs/predicate-functions.sql b/sql/core/src/test/resources/sql-tests/inputs/predicate-functions.sql index fadb4bb27fa13..d19120cfbdc56 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/predicate-functions.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/predicate-functions.sql @@ -46,3 +46,23 @@ select to_timestamp('2017-03-01 00:00:01') > to_date('2017-03-01'); select to_timestamp('2017-03-01 00:00:01') >= to_date('2017-03-01'); select to_date('2017-03-01') < to_timestamp('2017-03-01 00:00:01'); select to_date('2017-03-01') <= to_timestamp('2017-03-01 00:00:01'); + +-- In +select 1 in (1, 2, 3); +select 1 in (1, 2, 3, null); +select 1 in (1.0, 2.0, 3.0); +select 1 in (1.0, 2.0, 3.0, null); +select 1 in ('2', '3', '4'); +select 1 in ('2', '3', '4', null); +select null in (1, 2, 3); +select null in (1, 2, null); + +-- Not(In) +select 1 not in (1, 2, 3); +select 1 not in (1, 2, 3, null); +select 1 not in (1.0, 2.0, 3.0); +select 1 not in (1.0, 2.0, 3.0, null); +select 1 not in ('2', '3', '4'); +select 1 not in ('2', '3', '4', null); +select null not in (1, 2, 3); +select null not in (1, 2, null); diff --git a/sql/core/src/test/resources/sql-tests/inputs/regexp-functions.sql b/sql/core/src/test/resources/sql-tests/inputs/regexp-functions.sql index c0827a3cba39b..efe5c278730a6 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/regexp-functions.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/regexp-functions.sql @@ -3,7 +3,51 @@ SELECT regexp_extract('1a 2b 14m', '\\d+'); SELECT regexp_extract('1a 2b 14m', '\\d+', 0); SELECT regexp_extract('1a 2b 14m', '\\d+', 1); SELECT regexp_extract('1a 2b 14m', '\\d+', 2); +SELECT regexp_extract('1a 2b 14m', '\\d+', -1); +SELECT regexp_extract('1a 2b 14m', '(\\d+)?', 1); +SELECT regexp_extract('a b m', '(\\d+)?', 1); SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)'); SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)', 0); SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)', 1); SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)', 2); +SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)', 3); +SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)', -1); +SELECT regexp_extract('1a 2b 14m', '(\\d+)?([a-z]+)', 1); +SELECT regexp_extract('a b m', '(\\d+)?([a-z]+)', 1); + +-- regexp_extract_all +SELECT regexp_extract_all('1a 2b 14m', '\\d+'); +SELECT regexp_extract_all('1a 2b 14m', '\\d+', 0); +SELECT regexp_extract_all('1a 2b 14m', '\\d+', 1); +SELECT regexp_extract_all('1a 2b 14m', '\\d+', 2); +SELECT regexp_extract_all('1a 2b 14m', '\\d+', -1); +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)?', 1); +SELECT regexp_extract_all('a 2b 14m', '(\\d+)?', 1); +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)([a-z]+)'); +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)([a-z]+)', 0); +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)([a-z]+)', 1); +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)([a-z]+)', 2); +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)([a-z]+)', 3); +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)([a-z]+)', -1); +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)?([a-z]+)', 1); +SELECT regexp_extract_all('a 2b 14m', '(\\d+)?([a-z]+)', 1); + +-- regexp_replace +SELECT regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something'); +SELECT regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something', -2); +SELECT regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something', 0); +SELECT regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something', 1); +SELECT regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something', 2); +SELECT regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something', 8); +SELECT regexp_replace('healthy, wealthy, and wise', '\\w', 'something', 26); +SELECT regexp_replace('healthy, wealthy, and wise', '\\w', 'something', 27); +SELECT regexp_replace('healthy, wealthy, and wise', '\\w', 'something', 30); +SELECT regexp_replace('healthy, wealthy, and wise', '\\w', 'something', null); + +-- regexp_like +SELECT regexp_like('1a 2b 14m', '\\d+b'); +SELECT regexp_like('1a 2b 14m', '[a-z]+b'); +SELECT regexp('1a 2b 14m', '\\d+b'); +SELECT regexp('1a 2b 14m', '[a-z]+b'); +SELECT rlike('1a 2b 14m', '\\d+b'); +SELECT rlike('1a 2b 14m', '[a-z]+b'); diff --git a/sql/core/src/test/resources/sql-tests/inputs/show-tblproperties.sql b/sql/core/src/test/resources/sql-tests/inputs/show-tblproperties.sql index 2861b2b43a113..0ba936dcad741 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/show-tblproperties.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/show-tblproperties.sql @@ -17,8 +17,8 @@ SHOW TBLPROPERTIES view("p3"); DROP VIEW view; --- create a temporary view with properties -CREATE TEMPORARY VIEW tv TBLPROPERTIES('p1'='v1') AS SELECT 1 AS c1; +-- create a temporary view +CREATE TEMPORARY VIEW tv AS SELECT 1 AS c1; -- Properties for a temporary view should be empty SHOW TBLPROPERTIES tv; diff --git a/sql/core/src/test/resources/sql-tests/inputs/string-functions.sql b/sql/core/src/test/resources/sql-tests/inputs/string-functions.sql index 8e33471e8b129..d44055d72e3bc 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/string-functions.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/string-functions.sql @@ -17,9 +17,11 @@ select position('bar' in 'foobarbar'), position(null, 'foobarbar'), position('aa -- left && right select left("abcd", 2), left("abcd", 5), left("abcd", '2'), left("abcd", null); -select left(null, -2), left("abcd", -2), left("abcd", 0), left("abcd", 'a'); +select left(null, -2); +select left("abcd", -2), left("abcd", 0), left("abcd", 'a'); select right("abcd", 2), right("abcd", 5), right("abcd", '2'), right("abcd", null); -select right(null, -2), right("abcd", -2), right("abcd", 0), right("abcd", 'a'); +select right(null, -2); +select right("abcd", -2), right("abcd", 0), right("abcd", 'a'); -- split function SELECT split('aa1cc2ee3', '[1-9]+'); @@ -48,4 +50,24 @@ SELECT trim(LEADING 'xyz' FROM 'zzzytestxyz'); SELECT trim(LEADING 'xy' FROM 'xyxXxyLAST WORD'); SELECT trim(TRAILING 'xyz' FROM 'testxxzx'); SELECT trim(TRAILING 'xyz' FROM 'xyztestxxzx'); -SELECT trim(TRAILING 'xy' FROM 'TURNERyxXxy'); \ No newline at end of file +SELECT trim(TRAILING 'xy' FROM 'TURNERyxXxy'); + +-- btrim +SELECT btrim('xyxtrimyyx', 'xy'); +SELECT btrim(encode(" xyz ", 'utf-8')); +SELECT btrim(encode('yxTomxx', 'utf-8'), encode('xyz', 'utf-8')); +SELECT btrim(encode('xxxbarxxx', 'utf-8'), encode('x', 'utf-8')); + +-- Check lpad/rpad with invalid length parameter +SELECT lpad('hi', 'invalid_length'); +SELECT rpad('hi', 'invalid_length'); + +-- decode +select decode(); +select decode(encode('abc', 'utf-8')); +select decode(encode('abc', 'utf-8'), 'utf-8'); +select decode(1, 1, 'Southlake'); +select decode(2, 1, 'Southlake'); +select decode(2, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle', 'Non domestic'); +select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle', 'Non domestic'); +select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle'); \ No newline at end of file diff --git a/sql/core/src/test/resources/sql-tests/inputs/subexp-elimination.sql b/sql/core/src/test/resources/sql-tests/inputs/subexp-elimination.sql new file mode 100644 index 0000000000000..9a594e0928ddc --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/subexp-elimination.sql @@ -0,0 +1,37 @@ +-- Test for subexpression elimination. + +--SET spark.sql.optimizer.enableJsonExpressionOptimization=false + +--CONFIG_DIM1 spark.sql.codegen.wholeStage=true +--CONFIG_DIM1 spark.sql.codegen.wholeStage=false + +--CONFIG_DIM2 spark.sql.codegen.factoryMode=CODEGEN_ONLY +--CONFIG_DIM2 spark.sql.codegen.factoryMode=NO_CODEGEN + +--CONFIG_DIM3 spark.sql.subexpressionElimination.enabled=true +--CONFIG_DIM3 spark.sql.subexpressionElimination.enabled=false + +-- Test data. +CREATE OR REPLACE TEMPORARY VIEW testData AS SELECT * FROM VALUES +('{"a":1, "b":"2"}', '[{"a": 1, "b":2}, {"a":2, "b":2}]'), ('{"a":1, "b":"2"}', null), ('{"a":2, "b":"3"}', '[{"a": 3, "b":4}, {"a":4, "b":5}]'), ('{"a":5, "b":"6"}', '[{"a": 6, "b":7}, {"a":8, "b":9}]'), (null, '[{"a": 1, "b":2}, {"a":2, "b":2}]') +AS testData(a, b); + +SELECT from_json(a, 'struct').a, from_json(a, 'struct').b, from_json(b, 'array>')[0].a, from_json(b, 'array>')[0].b FROM testData; + +SELECT if(from_json(a, 'struct').a > 1, from_json(b, 'array>')[0].a, from_json(b, 'array>')[0].a + 1) FROM testData; + +SELECT if(isnull(from_json(a, 'struct').a), from_json(b, 'array>')[0].b + 1, from_json(b, 'array>')[0].b) FROM testData; + +SELECT case when from_json(a, 'struct').a > 5 then from_json(a, 'struct').b when from_json(a, 'struct').a > 4 then from_json(a, 'struct').b + 1 else from_json(a, 'struct').b + 2 end FROM testData; + +SELECT case when from_json(a, 'struct').a > 5 then from_json(b, 'array>')[0].b when from_json(a, 'struct').a > 4 then from_json(b, 'array>')[0].b + 1 else from_json(b, 'array>')[0].b + 2 end FROM testData; + +-- With non-deterministic expressions. +SELECT from_json(a, 'struct').a + random() > 2, from_json(a, 'struct').b, from_json(b, 'array>')[0].a, from_json(b, 'array>')[0].b + + random() > 2 FROM testData; + +SELECT if(from_json(a, 'struct').a + random() > 5, from_json(b, 'array>')[0].a, from_json(b, 'array>')[0].a + 1) FROM testData; + +SELECT case when from_json(a, 'struct').a > 5 then from_json(a, 'struct').b + random() > 5 when from_json(a, 'struct').a > 4 then from_json(a, 'struct').b + 1 + random() > 2 else from_json(a, 'struct').b + 2 + random() > 5 end FROM testData; + +-- Clean up +DROP VIEW IF EXISTS testData; \ No newline at end of file diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-basic.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-basic.sql index f4ffc20086386..5669423148f80 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-basic.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-basic.sql @@ -1,3 +1,6 @@ +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false + create temporary view tab_a as select * from values (1, 1) as tab_a(a1, b1); create temporary view tab_b as select * from values (1, 1) as tab_b(a2, b2); create temporary view struct_tab as select struct(col1 as a, col2 as b) as record from diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-having.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-having.sql index 8f98ae1155062..750cc42b8641c 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-having.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-having.sql @@ -1,6 +1,9 @@ -- A test suite for IN HAVING in parent side, subquery, and both predicate subquery -- It includes correlated cases. +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false + create temporary view t1 as select * from values ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-joins.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-joins.sql index 200a71ebbb622..2353560137d21 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-joins.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-joins.sql @@ -13,6 +13,9 @@ --CONFIG_DIM2 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=CODEGEN_ONLY --CONFIG_DIM2 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=NO_CODEGEN +--CONFIG_DIM3 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM3 spark.sql.optimizeNullAwareAntiJoin=false + create temporary view t1 as select * from values ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-limit.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-limit.sql index 481b5e8cc7700..53fc2b8be7501 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-limit.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-limit.sql @@ -1,6 +1,9 @@ -- A test suite for IN LIMIT in parent side, subquery, and both predicate subquery -- It includes correlated cases. +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false + create temporary view t1 as select * from values ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), @@ -72,7 +75,7 @@ SELECT Count(DISTINCT( t1a )), FROM t1 WHERE t1d IN (SELECT t2d FROM t2 - ORDER BY t2c + ORDER BY t2c, t2d LIMIT 2) GROUP BY t1b ORDER BY t1b DESC NULLS FIRST @@ -93,7 +96,7 @@ SELECT Count(DISTINCT( t1a )), FROM t1 WHERE t1d NOT IN (SELECT t2d FROM t2 - ORDER BY t2b DESC nulls first + ORDER BY t2b DESC nulls first, t2d LIMIT 1) GROUP BY t1b ORDER BY t1b NULLS last diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-multiple-columns.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-multiple-columns.sql index 4643605148a0c..1a6c06f9dad49 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-multiple-columns.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-multiple-columns.sql @@ -1,6 +1,9 @@ -- A test suite for multiple columns in predicate in parent side, subquery, and both predicate subquery -- It includes correlated cases. +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false + create temporary view t1 as select * from values ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-order-by.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-order-by.sql index 001c49c460b06..568854ebe2d9b 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-order-by.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-order-by.sql @@ -6,6 +6,9 @@ --CONFIG_DIM1 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=CODEGEN_ONLY --CONFIG_DIM1 spark.sql.codegen.wholeStage=false,spark.sql.codegen.factoryMode=NO_CODEGEN +--CONFIG_DIM2 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM2 spark.sql.optimizeNullAwareAntiJoin=false + create temporary view t1 as select * from values ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-with-cte.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-with-cte.sql index e65cb9106c1d4..fa4ae87f041cf 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-with-cte.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/in-with-cte.sql @@ -1,6 +1,9 @@ -- A test suite for in with cte in parent side, subquery, and both predicate subquery -- It includes correlated cases. +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false + create temporary view t1 as select * from values ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/nested-not-in.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/nested-not-in.sql index 2f6835b59fdd5..e2d4ad522d446 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/nested-not-in.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/nested-not-in.sql @@ -1,5 +1,8 @@ -- Tests NOT-IN subqueries nested inside OR expression(s). +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false + CREATE TEMPORARY VIEW EMP AS SELECT * FROM VALUES (100, "emp 1", 10), (200, "emp 2", NULL), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-joins.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-joins.sql index fcdb667ad4523..2d11c5da20633 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-joins.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-joins.sql @@ -1,6 +1,9 @@ -- A test suite for not-in-joins in parent side, subquery, and both predicate subquery -- It includes correlated cases. +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false + create temporary view t1 as select * from values ("val1a", 6S, 8, 10L, float(15.0), 20D, 20E2, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), ("val1b", 8S, 16, 19L, float(17.0), 25D, 26E2, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql index 8eea84f4f5272..a061e495f51b8 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column-literal.sql @@ -4,6 +4,9 @@ -- This file has the same test cases as not-in-unit-tests-multi-column.sql with literals instead of -- subqueries. Small changes have been made to the literals to make them typecheck. +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false + CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES (null, null), (null, 1.0), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column.sql index 9f8dc7fca3b94..28ab75121573a 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-multi-column.sql @@ -15,6 +15,9 @@ -- This can be generalized to include more tests for more columns, but it covers the main cases -- when there is more than one column. +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false + CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES (null, null), (null, 1.0), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql index b261363d1dde7..79747022eb1e8 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column-literal.sql @@ -4,6 +4,9 @@ -- This file has the same test cases as not-in-unit-tests-single-column.sql with literals instead of -- subqueries. +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false + CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES (null, 1.0), (2, 3.0), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column.sql index 2cc08e10acf67..8060246bf3a3f 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/not-in-unit-tests-single-column.sql @@ -31,6 +31,9 @@ -- cause cases 2, 3, or 4 to be reduced to case 1 by limiting the number of rows returned by the -- subquery, so the row from the parent table should always be included in the output. +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false + CREATE TEMPORARY VIEW m AS SELECT * FROM VALUES (null, 1.0), (2, 3.0), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/simple-in.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/simple-in.sql index 2748a959cbef8..d8a58afa344db 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/simple-in.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/in-subquery/simple-in.sql @@ -1,6 +1,9 @@ -- A test suite for simple IN predicate subquery -- It includes correlated cases. +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=true +--CONFIG_DIM1 spark.sql.optimizeNullAwareAntiJoin=false + create temporary view t1 as select * from values ("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, timestamp '2014-04-04 01:00:00.000', date '2014-04-04'), ("t1b", 8S, 16, 19L, float(17.0), 25D, 26E2BD, timestamp '2014-05-04 01:01:00.000', date '2014-05-04'), diff --git a/sql/core/src/test/resources/sql-tests/inputs/subquery/scalar-subquery/scalar-subquery-select.sql b/sql/core/src/test/resources/sql-tests/inputs/subquery/scalar-subquery/scalar-subquery-select.sql index eabbd0a932253..81712bfac239a 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/subquery/scalar-subquery/scalar-subquery-select.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/subquery/scalar-subquery/scalar-subquery-select.sql @@ -128,3 +128,13 @@ WHERE NOT EXISTS (SELECT (SELECT max(t2b) ON t2a = t1a WHERE t2c = t3c) AND t3a = t1a); + +-- SPARK-34876: Non-nullable aggregates should not return NULL in a correlated subquery +SELECT t1a, + (SELECT count(t2d) FROM t2 WHERE t2a = t1a) count_t2, + (SELECT count_if(t2d > 0) FROM t2 WHERE t2a = t1a) count_if_t2, + (SELECT approx_count_distinct(t2d) FROM t2 WHERE t2a = t1a) approx_count_distinct_t2, + (SELECT collect_list(t2d) FROM t2 WHERE t2a = t1a) collect_list_t2, + (SELECT collect_set(t2d) FROM t2 WHERE t2a = t1a) collect_set_t2, + (SELECT hex(count_min_sketch(t2d, 0.5d, 0.5d, 1)) FROM t2 WHERE t2a = t1a) collect_set_t2 +FROM t1; \ No newline at end of file diff --git a/sql/core/src/test/resources/sql-tests/inputs/table-aliases.sql b/sql/core/src/test/resources/sql-tests/inputs/table-aliases.sql index 4cfd5f28afdaa..5b98f056ebc5a 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/table-aliases.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/table-aliases.sql @@ -19,9 +19,17 @@ SELECT a AS col1, b AS col2 FROM testData AS t(c, d); -- Subquery aliases in FROM clause SELECT * FROM (SELECT 1 AS a, 1 AS b) t(col1, col2); +SELECT t.* FROM (SELECT 1 AS a, 1 AS b) t(col1, col2); + +SELECT col1, col2 FROM (SELECT 1 AS a, 1 AS b) t(col1, col2); + +SELECT t.col1, t.col2 FROM (SELECT 1 AS a, 1 AS b) t(col1, col2); + -- Aliases for join relations in FROM clause CREATE OR REPLACE TEMPORARY VIEW src1 AS SELECT * FROM VALUES (1, "a"), (2, "b"), (3, "c") AS src1(id, v1); CREATE OR REPLACE TEMPORARY VIEW src2 AS SELECT * FROM VALUES (2, 1.0), (3, 3.2), (1, 8.5) AS src2(id, v2); SELECT * FROM (src1 s1 INNER JOIN src2 s2 ON s1.id = s2.id) dst(a, b, c, d); + +SELECT dst.* FROM (src1 s1 INNER JOIN src2 s2 ON s1.id = s2.id) dst(a, b, c, d); diff --git a/sql/core/src/test/resources/sql-tests/inputs/table-valued-functions.sql b/sql/core/src/test/resources/sql-tests/inputs/table-valued-functions.sql index 6f14c8ca87821..7ea6af37c1470 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/table-valued-functions.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/table-valued-functions.sql @@ -13,11 +13,17 @@ select * from range(0, 10, 2); -- range call with numPartitions select * from range(0, 10, 1, 200); --- range call error +-- range call with invalid number of arguments select * from range(1, 1, 1, 1, 1); -- range call with null select * from range(1, null); +-- range call with incompatible type +select * from range(array(1, 2, 3)); + +-- range call with illegal step +select * from range(0, 5, 0); + -- range call with a mixed-case function name select * from RaNgE(2); diff --git a/sql/core/src/test/resources/sql-tests/inputs/timezone.sql b/sql/core/src/test/resources/sql-tests/inputs/timezone.sql new file mode 100644 index 0000000000000..105f2816fb549 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/timezone.sql @@ -0,0 +1,15 @@ +-- valid time zones +SET TIME ZONE 'Asia/Hong_Kong'; +SET TIME ZONE 'GMT+1'; +SET TIME ZONE INTERVAL 10 HOURS; +SET TIME ZONE INTERVAL '15:40:32' HOUR TO SECOND; +SET TIME ZONE LOCAL; + +-- invalid time zone +SET TIME ZONE; +SET TIME ZONE 'invalid/zone'; +SET TIME ZONE INTERVAL 3 DAYS; +SET TIME ZONE INTERVAL 24 HOURS; +SET TIME ZONE INTERVAL '19:40:32' HOUR TO SECOND; +SET TIME ZONE INTERVAL 10 HOURS 'GMT+1'; +SET TIME ZONE INTERVAL 10 HOURS 1 MILLISECOND; diff --git a/sql/core/src/test/resources/sql-tests/inputs/transform.sql b/sql/core/src/test/resources/sql-tests/inputs/transform.sql new file mode 100644 index 0000000000000..d84659c4ccb60 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/transform.sql @@ -0,0 +1,375 @@ +-- Test data. +CREATE OR REPLACE TEMPORARY VIEW t AS SELECT * FROM VALUES +('1', true, unhex('537061726B2053514C'), tinyint(1), 1, smallint(100), bigint(1), float(1.0), 1.0, Decimal(1.0), timestamp('1997-01-02'), date('2000-04-01')), +('2', false, unhex('537061726B2053514C'), tinyint(2), 2, smallint(200), bigint(2), float(2.0), 2.0, Decimal(2.0), timestamp('1997-01-02 03:04:05'), date('2000-04-02')), +('3', true, unhex('537061726B2053514C'), tinyint(3), 3, smallint(300), bigint(3), float(3.0), 3.0, Decimal(3.0), timestamp('1997-02-10 17:32:01-08'), date('2000-04-03')) +AS t(a, b, c, d, e, f, g, h, i, j, k, l); + +CREATE OR REPLACE TEMPORARY VIEW script_trans AS SELECT * FROM VALUES +(1, 2, 3), +(4, 5, 6), +(7, 8, 9) +AS script_trans(a, b, c); + +CREATE OR REPLACE TEMPORARY VIEW complex_trans AS SELECT * FROM VALUES +(1, 1), +(1, 1), +(2, 2), +(2, 2), +(3, 3), +(2, 2), +(3, 3), +(1, 1), +(3, 3) +as complex_trans(a, b); + +SELECT TRANSFORM(a) +USING 'cat' AS (a) +FROM t; + +-- common supported data types between no serde and serde transform +SELECT a, b, decode(c, 'UTF-8'), d, e, f, g, h, i, j, k, l FROM ( + SELECT TRANSFORM(a, b, c, d, e, f, g, h, i, j, k, l) + USING 'cat' AS ( + a string, + b boolean, + c binary, + d tinyint, + e int, + f smallint, + g long, + h float, + i double, + j decimal(38, 18), + k timestamp, + l date) + FROM t +) tmp; + +-- common supported data types between no serde and serde transform +SELECT a, b, decode(c, 'UTF-8'), d, e, f, g, h, i, j, k, l FROM ( + SELECT TRANSFORM(a, b, c, d, e, f, g, h, i, j, k, l) + USING 'cat' AS ( + a string, + b string, + c string, + d string, + e string, + f string, + g string, + h string, + i string, + j string, + k string, + l string) + FROM t +) tmp; + +-- SPARK-32388 handle schema less +SELECT TRANSFORM(a) +USING 'cat' +FROM t; + +SELECT TRANSFORM(a, b) +USING 'cat' +FROM t; + +SELECT TRANSFORM(a, b, c) +USING 'cat' +FROM t; + +-- return null when return string incompatible (no serde) +SELECT TRANSFORM(a, b, c, d, e, f, g, h, i) +USING 'cat' AS (a int, b short, c long, d byte, e float, f double, g decimal(38, 18), h date, i timestamp) +FROM VALUES +('a','','1231a','a','213.21a','213.21a','0a.21d','2000-04-01123','1997-0102 00:00:') tmp(a, b, c, d, e, f, g, h, i); + +-- SPARK-28227: transform can't run with aggregation +SELECT TRANSFORM(b, max(a), sum(f)) +USING 'cat' AS (a, b) +FROM t +GROUP BY b; + +-- transform use MAP +MAP a, b USING 'cat' AS (a, b) FROM t; + +-- transform use REDUCE +REDUCE a, b USING 'cat' AS (a, b) FROM t; + +-- transform with defined row format delimit +SELECT TRANSFORM(a, b, c, null) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY '@' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' +USING 'cat' AS (a, b, c, d) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY '@' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' +FROM t; + +SELECT TRANSFORM(a, b, c, null) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY '@' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' +USING 'cat' AS (d) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY '@' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' +FROM t; + +-- transform with defined row format delimit handle schema with correct type +SELECT a, b, decode(c, 'UTF-8'), d, e, f, g, h, i, j, k, l FROM ( + SELECT TRANSFORM(a, b, c, d, e, f, g, h, i, j, k, l) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' + USING 'cat' AS ( + a string, + b boolean, + c binary, + d tinyint, + e int, + f smallint, + g long, + h float, + i double, + j decimal(38, 18), + k timestamp, + l date) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' + FROM t +) tmp; + +-- transform with defined row format delimit handle schema with wrong type +SELECT a, b, decode(c, 'UTF-8'), d, e, f, g, h, i, j, k, l FROM ( + SELECT TRANSFORM(a, b, c, d, e, f, g, h, i, j, k, l) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' + USING 'cat' AS ( + a string, + b long, + c binary, + d tinyint, + e int, + f smallint, + g long, + h float, + i double, + j decimal(38, 18), + k int, + l long) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' + FROM t +) tmp; + +-- transform with defined row format delimit LINE TERMINATED BY only support '\n' +SELECT a, b, decode(c, 'UTF-8'), d, e, f, g, h, i, j, k, l FROM ( + SELECT TRANSFORM(a, b, c, d, e, f, g, h, i, j, k, l) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '@' + NULL DEFINED AS 'NULL' + USING 'cat' AS ( + a string, + b string, + c string, + d string, + e string, + f string, + g string, + h string, + i string, + j string, + k string, + l string) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '@' + NULL DEFINED AS 'NULL' + FROM t +) tmp; + +SELECT TRANSFORM(b, a, CAST(c AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4; + +SELECT TRANSFORM(1, 2, 3) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4; + +SELECT TRANSFORM(1, 2) + USING 'cat' AS (a INT, b INT) +FROM script_trans +LIMIT 1; + +SELECT TRANSFORM( + b, a, + CASE + WHEN c > 100 THEN 1 + WHEN c < 100 THEN 2 + ELSE 3 END) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4; + +SELECT TRANSFORM(b, a, c + 1) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4; + +SELECT TRANSFORM(*) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4; + +SELECT TRANSFORM(b, MAX(a), CAST(SUM(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +GROUP BY b; + +SELECT TRANSFORM(b, MAX(a) FILTER (WHERE a > 3), CAST(SUM(c) AS STRING)) + USING 'cat' AS (a,b,c) +FROM script_trans +WHERE a <= 4 +GROUP BY b; + +SELECT TRANSFORM(b, MAX(a), CAST(sum(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 2 +GROUP BY b; + +SELECT TRANSFORM(b, MAX(a), CAST(SUM(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +GROUP BY b +HAVING MAX(a) > 0; + +SELECT TRANSFORM(b, MAX(a), CAST(SUM(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +GROUP BY b +HAVING MAX(a) > 1; + +SELECT TRANSFORM(b, MAX(a) OVER w, CAST(SUM(c) OVER w AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +WINDOW w AS (PARTITION BY b ORDER BY a); + +SELECT TRANSFORM(b, MAX(a), CAST(SUM(c) AS STRING), myCol, myCol2) + USING 'cat' AS (a STRING, b STRING, c STRING, d ARRAY, e STRING) +FROM script_trans +LATERAL VIEW explode(array(array(1,2,3))) myTable AS myCol +LATERAL VIEW explode(myTable.myCol) myTable2 AS myCol2 +WHERE a <= 4 +GROUP BY b, myCol, myCol2 +HAVING max(a) > 1; + +FROM( + FROM script_trans + SELECT TRANSFORM(a, b) + USING 'cat' AS (`a` INT, b STRING) +) t +SELECT a + 1; + +FROM( + SELECT TRANSFORM(a, SUM(b)) + USING 'cat' AS (`a` INT, b STRING) + FROM script_trans + GROUP BY a +) t +SELECT (b + 1) AS result +ORDER BY result; + +MAP k / 10 USING 'cat' AS (one) FROM (SELECT 10 AS k); + +FROM (SELECT 1 AS key, 100 AS value) src +MAP src.*, src.key, CAST(src.key / 10 AS INT), CAST(src.key % 10 AS INT), src.value + USING 'cat' AS (k, v, tkey, ten, one, tvalue); + +SELECT TRANSFORM(1) + USING 'cat' AS (a) +FROM script_trans +HAVING true; + +SET spark.sql.legacy.parser.havingWithoutGroupByAsWhere=true; + +SELECT TRANSFORM(1) + USING 'cat' AS (a) +FROM script_trans +HAVING true; + +SET spark.sql.legacy.parser.havingWithoutGroupByAsWhere=false; + +-- SPARK-34634: self join using CTE contains transform +WITH temp AS ( + SELECT TRANSFORM(a) USING 'cat' AS (b string) FROM t +) +SELECT t1.b FROM temp t1 JOIN temp t2 ON t1.b = t2.b; + +SELECT TRANSFORM(DISTINCT b, a, c) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4; + +SELECT TRANSFORM(ALL b, a, c) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4; + +-- SPARK-35070: TRANSFORM not support alias in inputs +SELECT TRANSFORM(b AS b_1, MAX(a), CAST(sum(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 2 +GROUP BY b; + +SELECT TRANSFORM(b b_1, MAX(a), CAST(sum(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 2 +GROUP BY b; + +SELECT TRANSFORM(b, MAX(a) AS max_a, CAST(sum(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 2 +GROUP BY b; + +-- SPARK-33985: TRANSFORM with CLUSTER BY/ORDER BY/SORT BY +FROM ( + SELECT TRANSFORM(a, b) + USING 'cat' AS (a, b) + FROM complex_trans + CLUSTER BY a +) map_output +SELECT TRANSFORM(a, b) + USING 'cat' AS (a, b); + +FROM ( + SELECT TRANSFORM(a, b) + USING 'cat' AS (a, b) + FROM complex_trans + ORDER BY a +) map_output +SELECT TRANSFORM(a, b) + USING 'cat' AS (a, b); \ No newline at end of file diff --git a/sql/core/src/test/resources/sql-tests/inputs/try_arithmetic.sql b/sql/core/src/test/resources/sql-tests/inputs/try_arithmetic.sql new file mode 100644 index 0000000000000..cda83e80a53f9 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/try_arithmetic.sql @@ -0,0 +1,11 @@ +-- TRY_ADD +SELECT try_add(1, 1); +SELECT try_add(2147483647, 1); +SELECT try_add(-2147483648, -1); +SELECT try_add(9223372036854775807L, 1); +SELECT try_add(-9223372036854775808L, -1); + +-- TRY_DIVIDE +SELECT try_divide(1, 0.5); +SELECT try_divide(1, 0); +SELECT try_divide(0, 0); \ No newline at end of file diff --git a/sql/core/src/test/resources/sql-tests/inputs/try_cast.sql b/sql/core/src/test/resources/sql-tests/inputs/try_cast.sql new file mode 100644 index 0000000000000..2d584843ada3d --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/try_cast.sql @@ -0,0 +1,54 @@ +-- TRY_CAST string representing a valid fractional number to integral should truncate the number +SELECT TRY_CAST('1.23' AS int); +SELECT TRY_CAST('1.23' AS long); +SELECT TRY_CAST('-4.56' AS int); +SELECT TRY_CAST('-4.56' AS long); + +-- TRY_CAST string which are not numbers to integral should return null +SELECT TRY_CAST('abc' AS int); +SELECT TRY_CAST('abc' AS long); + +-- TRY_CAST empty string to integral should return null +SELECT TRY_CAST('' AS int); +SELECT TRY_CAST('' AS long); + +-- TRY_CAST null to integral should return null +SELECT TRY_CAST(NULL AS int); +SELECT TRY_CAST(NULL AS long); + +-- TRY_CAST invalid decimal string to integral should return null +SELECT TRY_CAST('123.a' AS int); +SELECT TRY_CAST('123.a' AS long); + +-- '-2147483648' is the smallest int value +SELECT TRY_CAST('-2147483648' AS int); +SELECT TRY_CAST('-2147483649' AS int); + +-- '2147483647' is the largest int value +SELECT TRY_CAST('2147483647' AS int); +SELECT TRY_CAST('2147483648' AS int); + +-- '-9223372036854775808' is the smallest long value +SELECT TRY_CAST('-9223372036854775808' AS long); +SELECT TRY_CAST('-9223372036854775809' AS long); + +-- '9223372036854775807' is the largest long value +SELECT TRY_CAST('9223372036854775807' AS long); +SELECT TRY_CAST('9223372036854775808' AS long); + +-- TRY_CAST string to interval and interval to string +SELECT TRY_CAST('interval 3 month 1 hour' AS interval); +SELECT TRY_CAST('abc' AS interval); + +-- TRY_CAST string to boolean +select TRY_CAST('true' as boolean); +select TRY_CAST('false' as boolean); +select TRY_CAST('abc' as boolean); + +-- TRY_CAST string to date +SELECT TRY_CAST("2021-01-01" AS date); +SELECT TRY_CAST("2021-101-01" AS date); + +-- TRY_CAST string to timestamp +SELECT TRY_CAST("2021-01-01 00:00:00" AS timestamp); +SELECT TRY_CAST("2021-101-01 00:00:00" AS timestamp); \ No newline at end of file diff --git a/sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-case.sql b/sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-case.sql index 8fa3c0a6dfec9..5322c1b502439 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-case.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-case.sql @@ -67,11 +67,11 @@ SELECT '7' AS `None`, CASE WHEN rand() < udf(0) THEN 1 END AS `NULL on no matches`; +-- [SPARK-33008] Spark SQL throws an exception -- Constant-expression folding shouldn't evaluate unreachable subexpressions SELECT CASE WHEN udf(1=0) THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END; SELECT CASE 1 WHEN 0 THEN 1/udf(0) WHEN 1 THEN 1 ELSE 2/0 END; --- [SPARK-27923] PostgreSQL throws an exception but Spark SQL is NULL -- However we do not currently suppress folding of potentially -- reachable subexpressions SELECT CASE WHEN i > 100 THEN udf(1/0) ELSE udf(0) END FROM case_tbl; diff --git a/sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-join.sql b/sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-join.sql index 77bcfe7e10cbc..16202a6765dc9 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-join.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-join.sql @@ -735,20 +735,20 @@ select * from a left join b on udf(i) = x and i = udf(y) and udf(x) = udf(i); -- -- test NULL behavior of whole-row Vars, per bug #5025 -- -select udf(t1.q2), udf(count(t2.*)) +select udf(t1.q2), udf(count(t2.q1, t2.q2)) from int8_tbl t1 left join int8_tbl t2 on (udf(udf(t1.q2)) = t2.q1) group by udf(t1.q2) order by 1; -select udf(udf(t1.q2)), udf(count(t2.*)) +select udf(udf(t1.q2)), udf(count(t2.q1, t2.q2)) from int8_tbl t1 left join (select * from int8_tbl) t2 on (udf(udf(t1.q2)) = udf(t2.q1)) group by udf(udf(t1.q2)) order by 1; -- [SPARK-28330] Enhance query limit --- select t1.q2, count(t2.*) +-- select t1.q2, count(t2.q1, t2.q2) -- from int8_tbl t1 left join (select * from int8_tbl offset 0) t2 on (t1.q2 = t2.q1) -- group by t1.q2 order by 1; -select udf(t1.q2) as q2, udf(udf(count(t2.*))) +select udf(t1.q2) as q2, udf(udf(count(t2.q1, t2.q2))) from int8_tbl t1 left join (select udf(q1) as q1, case when q2=1 then 1 else q2 end as q2 from int8_tbl) t2 on (udf(t1.q2) = udf(t2.q1)) @@ -876,7 +876,7 @@ from nt3 as nt3 on udf(ss2.id) = nt3.nt2_id where udf(nt3.id) = 1 and udf(ss2.b3); --- [SPARK-28379] Correlated scalar subqueries must be aggregated +-- Accessing outer query column is not allowed in LocalLimit -- -- test case where a PlaceHolderVar is propagated into a subquery -- diff --git a/sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-select_having.sql b/sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-select_having.sql index 412d45b49a184..76c0b198aa439 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-select_having.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-select_having.sql @@ -51,6 +51,7 @@ SELECT 1 AS one FROM test_having HAVING udf(a) > 1; SELECT 1 AS one FROM test_having HAVING udf(udf(1) > udf(2)); SELECT 1 AS one FROM test_having HAVING udf(udf(1) < udf(2)); +-- [SPARK-33008] Spark SQL throws an exception -- and just to prove that we aren't scanning the table: SELECT 1 AS one FROM test_having WHERE 1/udf(a) = 1 HAVING 1 < 2; diff --git a/sql/core/src/test/resources/sql-tests/inputs/udf/udf-count.sql b/sql/core/src/test/resources/sql-tests/inputs/udf/udf-count.sql index 6ab207b93f561..82058d43f88a2 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/udf/udf-count.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/udf/udf-count.sql @@ -20,9 +20,9 @@ SELECT FROM testData; -- count with multiple expressions -SELECT udf(count(a, b)), udf(count(b, a)), udf(count(testData.*)) FROM testData; +SELECT udf(count(a, b)), udf(count(b, a)), udf(count(testData.*, testData.*)) FROM testData; -- distinct count with multiple expressions SELECT - udf(count(DISTINCT a, b)), udf(count(DISTINCT b, a)), udf(count(DISTINCT *)), udf(count(DISTINCT testData.*)) + udf(count(DISTINCT a, b)), udf(count(DISTINCT b, a)), udf(count(DISTINCT *)), udf(count(DISTINCT testData.*, testData.*)) FROM testData; diff --git a/sql/core/src/test/resources/sql-tests/inputs/udf/udf-window.sql b/sql/core/src/test/resources/sql-tests/inputs/udf/udf-window.sql index bcbf87f8a04c5..1659f1c819592 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/udf/udf-window.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/udf/udf-window.sql @@ -1,15 +1,15 @@ --This test file was converted from window.sql. -- Test data. CREATE OR REPLACE TEMPORARY VIEW testData AS SELECT * FROM VALUES -(null, 1L, 1.0D, date("2017-08-01"), timestamp(1501545600), "a"), -(1, 1L, 1.0D, date("2017-08-01"), timestamp(1501545600), "a"), -(1, 2L, 2.5D, date("2017-08-02"), timestamp(1502000000), "a"), -(2, 2147483650L, 100.001D, date("2020-12-31"), timestamp(1609372800), "a"), -(1, null, 1.0D, date("2017-08-01"), timestamp(1501545600), "b"), -(2, 3L, 3.3D, date("2017-08-03"), timestamp(1503000000), "b"), -(3, 2147483650L, 100.001D, date("2020-12-31"), timestamp(1609372800), "b"), +(null, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "a"), +(1, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "a"), +(1, 2L, 2.5D, date("2017-08-02"), timestamp_seconds(1502000000), "a"), +(2, 2147483650L, 100.001D, date("2020-12-31"), timestamp_seconds(1609372800), "a"), +(1, null, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "b"), +(2, 3L, 3.3D, date("2017-08-03"), timestamp_seconds(1503000000), "b"), +(3, 2147483650L, 100.001D, date("2020-12-31"), timestamp_seconds(1609372800), "b"), (null, null, null, null, null, null), -(3, 1L, 1.0D, date("2017-08-01"), timestamp(1501545600), null) +(3, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), null) AS testData(val, val_long, val_double, val_date, val_timestamp, cate); -- RowsBetween diff --git a/sql/core/src/test/resources/sql-tests/inputs/union.sql b/sql/core/src/test/resources/sql-tests/inputs/union.sql index 6da1b9b49b226..8a5b6c50fc1e3 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/union.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/union.sql @@ -45,10 +45,24 @@ SELECT array(1, 2), 'str' UNION ALL SELECT array(1, 2, 3, NULL), 1; +-- SPARK-32638: corrects references when adding aliases in WidenSetOperationTypes +CREATE OR REPLACE TEMPORARY VIEW t3 AS VALUES (decimal(1)) tbl(v); +SELECT t.v FROM ( + SELECT v FROM t3 + UNION ALL + SELECT v + v AS v FROM t3 +) t; + +SELECT SUM(t.v) FROM ( + SELECT v FROM t3 + UNION + SELECT v + v AS v FROM t3 +) t; -- Clean-up DROP VIEW IF EXISTS t1; DROP VIEW IF EXISTS t2; +DROP VIEW IF EXISTS t3; DROP VIEW IF EXISTS p1; DROP VIEW IF EXISTS p2; DROP VIEW IF EXISTS p3; diff --git a/sql/core/src/test/resources/sql-tests/inputs/using-join.sql b/sql/core/src/test/resources/sql-tests/inputs/using-join.sql new file mode 100644 index 0000000000000..336d19f0f2a3d --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/inputs/using-join.sql @@ -0,0 +1,70 @@ +create temporary view nt1 as select * from values + ("one", 1), + ("two", 2), + ("three", 3) + as nt1(k, v1); + +create temporary view nt2 as select * from values + ("one", 1), + ("two", 22), + ("one", 5), + ("four", 4) + as nt2(k, v2); + +SELECT * FROM nt1 left outer join nt2 using (k); + +SELECT k FROM nt1 left outer join nt2 using (k); + +SELECT nt1.*, nt2.* FROM nt1 left outer join nt2 using (k); + +SELECT nt1.k, nt2.k FROM nt1 left outer join nt2 using (k); + +SELECT k, nt1.k FROM nt1 left outer join nt2 using (k); + +SELECT k, nt2.k FROM nt1 left outer join nt2 using (k); + +SELECT * FROM nt1 left semi join nt2 using (k); + +SELECT k FROM nt1 left semi join nt2 using (k); + +SELECT nt1.* FROM nt1 left semi join nt2 using (k); + +SELECT nt1.k FROM nt1 left semi join nt2 using (k); + +SELECT k, nt1.k FROM nt1 left semi join nt2 using (k); + +SELECT * FROM nt1 right outer join nt2 using (k); + +SELECT k FROM nt1 right outer join nt2 using (k); + +SELECT nt1.*, nt2.* FROM nt1 right outer join nt2 using (k); + +SELECT nt1.k, nt2.k FROM nt1 right outer join nt2 using (k); + +SELECT k, nt1.k FROM nt1 right outer join nt2 using (k); + +SELECT k, nt2.k FROM nt1 right outer join nt2 using (k); + +SELECT * FROM nt1 full outer join nt2 using (k); + +SELECT k FROM nt1 full outer join nt2 using (k); + +SELECT nt1.*, nt2.* FROM nt1 full outer join nt2 using (k); + +SELECT nt1.k, nt2.k FROM nt1 full outer join nt2 using (k); + +SELECT k, nt1.k FROM nt1 full outer join nt2 using (k); + +SELECT k, nt2.k FROM nt1 full outer join nt2 using (k); + +SELECT * FROM nt1 full outer join nt2 using (k); + +SELECT k FROM nt1 inner join nt2 using (k); + +SELECT nt1.*, nt2.* FROM nt1 inner join nt2 using (k); + +SELECT nt1.k, nt2.k FROM nt1 inner join nt2 using (k); + +SELECT k, nt1.k FROM nt1 inner join nt2 using (k); + +SELECT k, nt2.k FROM nt1 inner join nt2 using (k); diff --git a/sql/core/src/test/resources/sql-tests/inputs/window.sql b/sql/core/src/test/resources/sql-tests/inputs/window.sql index 3d05dfda6c3fa..46d3629a5dc50 100644 --- a/sql/core/src/test/resources/sql-tests/inputs/window.sql +++ b/sql/core/src/test/resources/sql-tests/inputs/window.sql @@ -5,17 +5,49 @@ -- Test data. CREATE OR REPLACE TEMPORARY VIEW testData AS SELECT * FROM VALUES -(null, 1L, 1.0D, date("2017-08-01"), timestamp(1501545600), "a"), -(1, 1L, 1.0D, date("2017-08-01"), timestamp(1501545600), "a"), -(1, 2L, 2.5D, date("2017-08-02"), timestamp(1502000000), "a"), -(2, 2147483650L, 100.001D, date("2020-12-31"), timestamp(1609372800), "a"), -(1, null, 1.0D, date("2017-08-01"), timestamp(1501545600), "b"), -(2, 3L, 3.3D, date("2017-08-03"), timestamp(1503000000), "b"), -(3, 2147483650L, 100.001D, date("2020-12-31"), timestamp(1609372800), "b"), +(null, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "a"), +(1, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "a"), +(1, 2L, 2.5D, date("2017-08-02"), timestamp_seconds(1502000000), "a"), +(2, 2147483650L, 100.001D, date("2020-12-31"), timestamp_seconds(1609372800), "a"), +(1, null, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "b"), +(2, 3L, 3.3D, date("2017-08-03"), timestamp_seconds(1503000000), "b"), +(3, 2147483650L, 100.001D, date("2020-12-31"), timestamp_seconds(1609372800), "b"), (null, null, null, null, null, null), -(3, 1L, 1.0D, date("2017-08-01"), timestamp(1501545600), null) +(3, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), null) AS testData(val, val_long, val_double, val_date, val_timestamp, cate); +CREATE OR REPLACE TEMPORARY VIEW basic_pays AS SELECT * FROM VALUES +('Diane Murphy','Accounting',8435), +('Mary Patterson','Accounting',9998), +('Jeff Firrelli','Accounting',8992), +('William Patterson','Accounting',8870), +('Gerard Bondur','Accounting',11472), +('Anthony Bow','Accounting',6627), +('Leslie Jennings','IT',8113), +('Leslie Thompson','IT',5186), +('Julie Firrelli','Sales',9181), +('Steve Patterson','Sales',9441), +('Foon Yue Tseng','Sales',6660), +('George Vanauf','Sales',10563), +('Loui Bondur','SCM',10449), +('Gerard Hernandez','SCM',6949), +('Pamela Castillo','SCM',11303), +('Larry Bott','SCM',11798), +('Barry Jones','SCM',10586) +AS basic_pays(employee_name, department, salary); + +CREATE OR REPLACE TEMPORARY VIEW test_ignore_null AS SELECT * FROM VALUES +('a', 0, null), +('a', 1, 'x'), +('b', 2, null), +('c', 3, null), +('a', 4, 'y'), +('b', 5, null), +('a', 6, 'z'), +('a', 7, 'v'), +('a', 8, null) +AS test_ignore_null(content, id, v); + -- RowsBetween SELECT val, cate, count(val) OVER(PARTITION BY cate ORDER BY val ROWS CURRENT ROW) FROM testData ORDER BY cate, val; @@ -38,6 +70,18 @@ RANGE BETWEEN CURRENT ROW AND 2 FOLLOWING) FROM testData ORDER BY cate, val_date SELECT val_timestamp, cate, avg(val_timestamp) OVER(PARTITION BY cate ORDER BY val_timestamp RANGE BETWEEN CURRENT ROW AND interval 23 days 4 hours FOLLOWING) FROM testData ORDER BY cate, val_timestamp; +SELECT val_timestamp, cate, avg(val_timestamp) OVER(PARTITION BY cate ORDER BY val_timestamp +RANGE BETWEEN CURRENT ROW AND interval '1-1' year to month FOLLOWING) FROM testData +ORDER BY cate, val_timestamp; +SELECT val_timestamp, cate, avg(val_timestamp) OVER(PARTITION BY cate ORDER BY val_timestamp +RANGE BETWEEN CURRENT ROW AND interval '1 2:3:4.001' day to second FOLLOWING) FROM testData +ORDER BY cate, val_timestamp; +SELECT val_date, cate, avg(val_timestamp) OVER(PARTITION BY cate ORDER BY val_date +RANGE BETWEEN CURRENT ROW AND interval '1-1' year to month FOLLOWING) FROM testData +ORDER BY cate, val_date; +SELECT val_date, cate, avg(val_timestamp) OVER(PARTITION BY cate ORDER BY val_date +RANGE BETWEEN CURRENT ROW AND interval '1 2:3:4.001' day to second FOLLOWING) FROM testData +ORDER BY cate, val_date; -- RangeBetween with reverse OrderBy SELECT val, cate, sum(val) OVER(PARTITION BY cate ORDER BY val DESC @@ -124,4 +168,256 @@ WINDOW w AS (PARTITION BY cate ORDER BY val); -- with filter predicate SELECT val, cate, count(val) FILTER (WHERE val > 1) OVER(PARTITION BY cate) -FROM testData ORDER BY cate, val; \ No newline at end of file +FROM testData ORDER BY cate, val; + +-- nth_value()/first_value() over () +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC) +ORDER BY salary DESC; + +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) +ORDER BY salary DESC; + +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) +ORDER BY salary DESC; + +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary RANGE BETWEEN 2000 PRECEDING AND 1000 FOLLOWING) +ORDER BY salary; + +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING) +ORDER BY salary DESC; + +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) +ORDER BY salary DESC; + +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) +ORDER BY salary DESC; + +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) +ORDER BY salary DESC; + +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING) +ORDER BY salary DESC; + +SELECT + employee_name, + department, + salary, + FIRST_VALUE(employee_name) OVER w highest_salary, + NTH_VALUE(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS ( + PARTITION BY department + ORDER BY salary DESC + RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING +) +ORDER BY department; + +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW + w AS (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING), + w AS (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND 2 FOLLOWING) +ORDER BY salary DESC; + +SELECT + content, + id, + v, + lead(v, 0) IGNORE NULLS OVER w lead_0, + lead(v, 1) IGNORE NULLS OVER w lead_1, + lead(v, 2) IGNORE NULLS OVER w lead_2, + lead(v, 3) IGNORE NULLS OVER w lead_3, + lag(v, 0) IGNORE NULLS OVER w lag_0, + lag(v, 1) IGNORE NULLS OVER w lag_1, + lag(v, 2) IGNORE NULLS OVER w lag_2, + lag(v, 3) IGNORE NULLS OVER w lag_3, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id) +ORDER BY id; + +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) +ORDER BY id; + +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) +ORDER BY id; + +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id RANGE BETWEEN 2 PRECEDING AND 2 FOLLOWING) +ORDER BY id; + +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING) +ORDER BY id; + +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) +ORDER BY id; + +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) +ORDER BY id; + +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) +ORDER BY id; + +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING) +ORDER BY id; \ No newline at end of file diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/array.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/array.sql.out new file mode 100644 index 0000000000000..a029a28200073 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/ansi/array.sql.out @@ -0,0 +1,234 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 20 + + +-- !query +create temporary view data as select * from values + ("one", array(11, 12, 13), array(array(111, 112, 113), array(121, 122, 123))), + ("two", array(21, 22, 23), array(array(211, 212, 213), array(221, 222, 223))) + as data(a, b, c) +-- !query schema +struct<> +-- !query output + + + +-- !query +select * from data +-- !query schema +struct,c:array>> +-- !query output +one [11,12,13] [[111,112,113],[121,122,123]] +two [21,22,23] [[211,212,213],[221,222,223]] + + +-- !query +select a, b[0], b[0] + b[1] from data +-- !query schema +struct +-- !query output +one 11 23 +two 21 43 + + +-- !query +select a, c[0][0] + c[0][0 + 1] from data +-- !query schema +struct +-- !query output +one 223 +two 423 + + +-- !query +create temporary view primitive_arrays as select * from values ( + array(true), + array(2Y, 1Y), + array(2S, 1S), + array(2, 1), + array(2L, 1L), + array(9223372036854775809, 9223372036854775808), + array(2.0D, 1.0D), + array(float(2.0), float(1.0)), + array(date '2016-03-14', date '2016-03-13'), + array(timestamp '2016-11-15 20:54:00.000', timestamp '2016-11-12 20:54:00.000') +) as primitive_arrays( + boolean_array, + tinyint_array, + smallint_array, + int_array, + bigint_array, + decimal_array, + double_array, + float_array, + date_array, + timestamp_array +) +-- !query schema +struct<> +-- !query output + + + +-- !query +select * from primitive_arrays +-- !query schema +struct,tinyint_array:array,smallint_array:array,int_array:array,bigint_array:array,decimal_array:array,double_array:array,float_array:array,date_array:array,timestamp_array:array> +-- !query output +[true] [2,1] [2,1] [2,1] [2,1] [9223372036854775809,9223372036854775808] [2.0,1.0] [2.0,1.0] [2016-03-14,2016-03-13] [2016-11-15 20:54:00,2016-11-12 20:54:00] + + +-- !query +select + array_contains(boolean_array, true), array_contains(boolean_array, false), + array_contains(tinyint_array, 2Y), array_contains(tinyint_array, 0Y), + array_contains(smallint_array, 2S), array_contains(smallint_array, 0S), + array_contains(int_array, 2), array_contains(int_array, 0), + array_contains(bigint_array, 2L), array_contains(bigint_array, 0L), + array_contains(decimal_array, 9223372036854775809), array_contains(decimal_array, 1), + array_contains(double_array, 2.0D), array_contains(double_array, 0.0D), + array_contains(float_array, float(2.0)), array_contains(float_array, float(0.0)), + array_contains(date_array, date '2016-03-14'), array_contains(date_array, date '2016-01-01'), + array_contains(timestamp_array, timestamp '2016-11-15 20:54:00.000'), array_contains(timestamp_array, timestamp '2016-01-01 20:54:00.000') +from primitive_arrays +-- !query schema +struct +-- !query output +true false true false true false true false true false true false true false true false true false true false + + +-- !query +select array_contains(b, 11), array_contains(c, array(111, 112, 113)) from data +-- !query schema +struct +-- !query output +false false +true true + + +-- !query +select + sort_array(boolean_array), + sort_array(tinyint_array), + sort_array(smallint_array), + sort_array(int_array), + sort_array(bigint_array), + sort_array(decimal_array), + sort_array(double_array), + sort_array(float_array), + sort_array(date_array), + sort_array(timestamp_array) +from primitive_arrays +-- !query schema +struct,sort_array(tinyint_array, true):array,sort_array(smallint_array, true):array,sort_array(int_array, true):array,sort_array(bigint_array, true):array,sort_array(decimal_array, true):array,sort_array(double_array, true):array,sort_array(float_array, true):array,sort_array(date_array, true):array,sort_array(timestamp_array, true):array> +-- !query output +[true] [1,2] [1,2] [1,2] [1,2] [9223372036854775808,9223372036854775809] [1.0,2.0] [1.0,2.0] [2016-03-13,2016-03-14] [2016-11-12 20:54:00,2016-11-15 20:54:00] + + +-- !query +select sort_array(array('b', 'd'), '1') +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'sort_array(array('b', 'd'), '1')' due to data type mismatch: Sort order in second argument requires a boolean literal.; line 1 pos 7 + + +-- !query +select sort_array(array('b', 'd'), cast(NULL as boolean)) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'sort_array(array('b', 'd'), CAST(NULL AS BOOLEAN))' due to data type mismatch: Sort order in second argument requires a boolean literal.; line 1 pos 7 + + +-- !query +select + size(boolean_array), + size(tinyint_array), + size(smallint_array), + size(int_array), + size(bigint_array), + size(decimal_array), + size(double_array), + size(float_array), + size(date_array), + size(timestamp_array) +from primitive_arrays +-- !query schema +struct +-- !query output +1 2 2 2 2 2 2 2 2 2 + + +-- !query +select element_at(array(1, 2, 3), 5) +-- !query schema +struct<> +-- !query output +java.lang.ArrayIndexOutOfBoundsException +Invalid index: 5, numElements: 3 + + +-- !query +select element_at(array(1, 2, 3), -5) +-- !query schema +struct<> +-- !query output +java.lang.ArrayIndexOutOfBoundsException +Invalid index: -5, numElements: 3 + + +-- !query +select element_at(array(1, 2, 3), 0) +-- !query schema +struct<> +-- !query output +java.lang.ArrayIndexOutOfBoundsException +SQL array indices start at 1 + + +-- !query +select elt(4, '123', '456') +-- !query schema +struct<> +-- !query output +java.lang.ArrayIndexOutOfBoundsException +Invalid index: 4, numElements: 2 + + +-- !query +select elt(0, '123', '456') +-- !query schema +struct<> +-- !query output +java.lang.ArrayIndexOutOfBoundsException +Invalid index: 0, numElements: 2 + + +-- !query +select elt(-1, '123', '456') +-- !query schema +struct<> +-- !query output +java.lang.ArrayIndexOutOfBoundsException +Invalid index: -1, numElements: 2 + + +-- !query +select array(1, 2, 3)[5] +-- !query schema +struct<> +-- !query output +java.lang.ArrayIndexOutOfBoundsException +Invalid index: 5, numElements: 3 + + +-- !query +select array(1, 2, 3)[-1] +-- !query schema +struct<> +-- !query output +java.lang.ArrayIndexOutOfBoundsException +Invalid index: -1, numElements: 3 diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/datetime.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/datetime.sql.out index aad1e5f343879..5bcc08f2bd618 100644 --- a/sql/core/src/test/resources/sql-tests/results/ansi/datetime.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/ansi/datetime.sql.out @@ -1,5 +1,130 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 85 +-- Number of queries: 128 + + +-- !query +select TIMESTAMP_SECONDS(1230219000),TIMESTAMP_SECONDS(-1230219000),TIMESTAMP_SECONDS(null) +-- !query schema +struct +-- !query output +2008-12-25 07:30:00 1931-01-07 00:30:00 NULL + + +-- !query +select TIMESTAMP_SECONDS(1.23), TIMESTAMP_SECONDS(1.23d), TIMESTAMP_SECONDS(FLOAT(1.23)) +-- !query schema +struct +-- !query output +1969-12-31 16:00:01.23 1969-12-31 16:00:01.23 1969-12-31 16:00:01.23 + + +-- !query +select TIMESTAMP_MILLIS(1230219000123),TIMESTAMP_MILLIS(-1230219000123),TIMESTAMP_MILLIS(null) +-- !query schema +struct +-- !query output +2008-12-25 07:30:00.123 1931-01-07 00:29:59.877 NULL + + +-- !query +select TIMESTAMP_MICROS(1230219000123123),TIMESTAMP_MICROS(-1230219000123123),TIMESTAMP_MICROS(null) +-- !query schema +struct +-- !query output +2008-12-25 07:30:00.123123 1931-01-07 00:29:59.876877 NULL + + +-- !query +select TIMESTAMP_SECONDS(1230219000123123) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select TIMESTAMP_SECONDS(-1230219000123123) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select TIMESTAMP_MILLIS(92233720368547758) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select TIMESTAMP_MILLIS(-92233720368547758) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select TIMESTAMP_SECONDS(0.1234567) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Rounding necessary + + +-- !query +select TIMESTAMP_SECONDS(0.1234567d), TIMESTAMP_SECONDS(FLOAT(0.1234567)) +-- !query schema +struct +-- !query output +1969-12-31 16:00:00.123456 1969-12-31 16:00:00.123456 + + +-- !query +select UNIX_SECONDS(TIMESTAMP('2020-12-01 14:30:08Z')), UNIX_SECONDS(TIMESTAMP('2020-12-01 14:30:08.999999Z')), UNIX_SECONDS(null) +-- !query schema +struct +-- !query output +1606833008 1606833008 NULL + + +-- !query +select UNIX_MILLIS(TIMESTAMP('2020-12-01 14:30:08Z')), UNIX_MILLIS(TIMESTAMP('2020-12-01 14:30:08.999999Z')), UNIX_MILLIS(null) +-- !query schema +struct +-- !query output +1606833008000 1606833008999 NULL + + +-- !query +select UNIX_MICROS(TIMESTAMP('2020-12-01 14:30:08Z')), UNIX_MICROS(TIMESTAMP('2020-12-01 14:30:08.999999Z')), UNIX_MICROS(null) +-- !query schema +struct +-- !query output +1606833008000000 1606833008999999 NULL + + +-- !query +select DATE_FROM_UNIX_DATE(0), DATE_FROM_UNIX_DATE(1000), DATE_FROM_UNIX_DATE(null) +-- !query schema +struct +-- !query output +1970-01-01 1972-09-27 NULL + + +-- !query +select UNIX_DATE(DATE('1970-01-01')), UNIX_DATE(DATE('2020-12-04')), UNIX_DATE(null) +-- !query schema +struct +-- !query output +0 18600 NULL -- !query @@ -35,7 +160,7 @@ NULL 2016-12-31 00:12:00 2016-12-31 00:00:00 -- !query select dayofweek('2007-02-03'), dayofweek('2009-07-30'), dayofweek('2017-05-27'), dayofweek(null), dayofweek('1582-10-15 13:10:15') -- !query schema -struct +struct -- !query output 7 5 7 NULL 6 @@ -106,7 +231,7 @@ struct -- !query select weekday('2007-02-03'), weekday('2009-07-30'), weekday('2017-05-27'), weekday(null), weekday('1582-10-15 13:10:15') -- !query schema -struct +struct -- !query output 5 3 5 NULL 4 @@ -114,15 +239,9 @@ struct +struct -- !query output -org.apache.spark.sql.catalyst.parser.ParseException - -no viable alternative at input 'year'(line 1, pos 7) - -== SQL == -select year('1500-01-01'), month('1500-01-01'), dayOfYear('1500-01-01') --------^^^ +1500 1 1 -- !query @@ -141,10 +260,38 @@ struct 2019-01-01 00:00:00 +-- !query +select date '2020-01-01中文' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the DATE value: 2020-01-01中文(line 1, pos 7) + +== SQL == +select date '2020-01-01中文' +-------^^^ + + +-- !query +select timestamp '2019-01-01中文' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the TIMESTAMP value: 2019-01-01中文(line 1, pos 7) + +== SQL == +select timestamp '2019-01-01中文' +-------^^^ + + -- !query select timestamp'2011-11-11 11:11:11' + interval '2' day -- !query schema -struct +struct -- !query output 2011-11-13 11:11:11 @@ -152,7 +299,7 @@ struct +struct -- !query output 2011-11-09 11:11:11 @@ -178,7 +325,7 @@ requirement failed: Cannot add hours, minutes or seconds, milliseconds, microsec -- !query select '2011-11-11' - interval '2' day -- !query schema -struct +struct<2011-11-11 - INTERVAL '2 days':string> -- !query output 2011-11-09 00:00:00 @@ -186,7 +333,7 @@ struct -- !query select '2011-11-11 11:11:11' - interval '2' second -- !query schema -struct +struct<2011-11-11 11:11:11 - INTERVAL '2 seconds':string> -- !query output 2011-11-11 11:11:09 @@ -194,9 +341,10 @@ struct -- !query select '1' - interval '2' second -- !query schema -struct +struct<> -- !query output -NULL +java.time.DateTimeException +Cannot cast 1 to TimestampType. -- !query @@ -211,23 +359,23 @@ cannot resolve '1 + (- INTERVAL '2 seconds')' due to data type mismatch: argumen -- !query select date'2020-01-01' - timestamp'2019-10-06 10:11:12.345678' -- !query schema -struct +struct<(DATE '2020-01-01' - TIMESTAMP '2019-10-06 10:11:12.345678'):interval day to second> -- !query output -2078 hours 48 minutes 47.654322 seconds +86 13:48:47.654322000 -- !query select timestamp'2019-10-06 10:11:12.345678' - date'2020-01-01' -- !query schema -struct +struct<(TIMESTAMP '2019-10-06 10:11:12.345678' - DATE '2020-01-01'):interval day to second> -- !query output --2078 hours -48 minutes -47.654322 seconds +-86 13:48:47.654322000 -- !query select timestamp'2019-10-06 10:11:12.345678' - null -- !query schema -struct +struct<(TIMESTAMP '2019-10-06 10:11:12.345678' - NULL):interval day to second> -- !query output NULL @@ -235,7 +383,7 @@ NULL -- !query select null - timestamp'2019-10-06 10:11:12.345678' -- !query schema -struct +struct<(NULL - TIMESTAMP '2019-10-06 10:11:12.345678'):interval day to second> -- !query output NULL @@ -243,7 +391,7 @@ NULL -- !query select date_add('2011-11-11', 1Y) -- !query schema -struct +struct -- !query output 2011-11-12 @@ -251,7 +399,7 @@ struct -- !query select date_add('2011-11-11', 1S) -- !query schema -struct +struct -- !query output 2011-11-12 @@ -259,7 +407,7 @@ struct -- !query select date_add('2011-11-11', 1) -- !query schema -struct +struct -- !query output 2011-11-12 @@ -294,7 +442,7 @@ cannot resolve 'date_add(CAST('2011-11-11' AS DATE), 10.0D)' due to data type mi -- !query select date_add('2011-11-11', '1') -- !query schema -struct +struct -- !query output 2011-11-12 @@ -305,7 +453,7 @@ select date_add('2011-11-11', '1.2') struct<> -- !query output org.apache.spark.sql.AnalysisException -The second argument of 'date_add' function needs to be an integer.; +The second argument of 'date_add' function needs to be an integer. -- !query @@ -319,7 +467,7 @@ struct -- !query select date_add(timestamp'2011-11-11', 1) -- !query schema -struct +struct -- !query output 2011-11-12 @@ -346,13 +494,13 @@ select date_sub(date'2011-11-11', '1.2') struct<> -- !query output org.apache.spark.sql.AnalysisException -The second argument of 'date_sub' function needs to be an integer.; +The second argument of 'date_sub' function needs to be an integer. -- !query select date_sub(timestamp'2011-11-11', 1) -- !query schema -struct +struct -- !query output 2011-11-10 @@ -360,7 +508,7 @@ struct -- !query select date_sub(null, 1) -- !query schema -struct +struct -- !query output NULL @@ -368,7 +516,7 @@ NULL -- !query select date_sub(date'2011-11-11', null) -- !query schema -struct +struct -- !query output NULL @@ -388,13 +536,13 @@ select date'2011-11-11' + '1' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'date_add(DATE '2011-11-11', CAST('1' AS DOUBLE))' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'CAST('1' AS DOUBLE)' is of double type.; line 1 pos 7 +cannot resolve 'date_add(DATE '2011-11-11', CAST('1' AS DATE))' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'CAST('1' AS DATE)' is of date type.; line 1 pos 7 -- !query select null + date '2001-09-28' -- !query schema -struct +struct -- !query output NULL @@ -428,14 +576,14 @@ select date '2001-10-01' - '7' -- !query schema struct<> -- !query output -org.apache.spark.sql.AnalysisException -cannot resolve 'date_sub(DATE '2001-10-01', CAST('7' AS DOUBLE))' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'CAST('7' AS DOUBLE)' is of double type.; line 1 pos 7 +java.time.DateTimeException +Cannot cast 7 to DateType. -- !query select date '2001-09-28' + null -- !query schema -struct +struct -- !query output NULL @@ -443,7 +591,7 @@ NULL -- !query select date '2001-09-28' - null -- !query schema -struct +struct -- !query output NULL @@ -462,7 +610,7 @@ select date_add('2011-11-11', str) from v struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'date_add(CAST('2011-11-11' AS DATE), v.`str`)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'v.`str`' is of string type.; line 1 pos 7 +cannot resolve 'date_add(CAST('2011-11-11' AS DATE), v.str)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'v.str' is of string type.; line 1 pos 7 -- !query @@ -471,13 +619,13 @@ select date_sub('2011-11-11', str) from v struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'date_sub(CAST('2011-11-11' AS DATE), v.`str`)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'v.`str`' is of string type.; line 1 pos 7 +cannot resolve 'date_sub(CAST('2011-11-11' AS DATE), v.str)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'v.str' is of string type.; line 1 pos 7 -- !query select null - date '2019-10-06' -- !query schema -struct +struct<(NULL - DATE '2019-10-06'):interval day to second> -- !query output NULL @@ -485,17 +633,18 @@ NULL -- !query select date '2001-10-01' - date '2001-09-28' -- !query schema -struct +struct<(DATE '2001-10-01' - DATE '2001-09-28'):interval day to second> -- !query output -3 days +3 00:00:00.000000000 -- !query select to_timestamp('2019-10-06 10:11:12.', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') -- !query schema -struct +struct<> -- !query output -NULL +java.time.format.DateTimeParseException +Text '2019-10-06 10:11:12.' could not be parsed at index 20 -- !query @@ -557,9 +706,10 @@ struct +struct<> -- !query output -NULL +java.time.format.DateTimeParseException +Text '2019-10-06 10:11:12.1234567PST' could not be parsed, unparsed text found at index 26 -- !query @@ -573,9 +723,10 @@ struct +struct<> -- !query output -NULL +java.time.format.DateTimeParseException +Text '223456 2019-10-06 10:11:12.123456PST' could not be parsed at index 27 -- !query @@ -637,17 +788,19 @@ struct +struct<> -- !query output -NULL +java.time.format.DateTimeParseException +Text '12.1232019-10-06S10:11' could not be parsed at index 7 -- !query select to_timestamp("12.1232019-10-06S10:11", "ss.SSSSyy-MM-dd'S'HH:mm") -- !query schema -struct +struct<> -- !query output -NULL +java.time.format.DateTimeParseException +Text '12.1232019-10-06S10:11' could not be parsed at index 9 -- !query @@ -675,58 +828,286 @@ struct -- !query -select date_format(timestamp '2019-10-06', 'yyyy-MM-dd uuee') +select to_timestamp("2019-10-06T10:11:12'12", "yyyy-MM-dd'T'HH:mm:ss''SSSS") +-- !query schema +struct +-- !query output +2019-10-06 10:11:12.12 + + +-- !query +select to_timestamp("2019-10-06T10:11:12'", "yyyy-MM-dd'T'HH:mm:ss''") +-- !query schema +struct +-- !query output +2019-10-06 10:11:12 + + +-- !query +select to_timestamp("'2019-10-06T10:11:12", "''yyyy-MM-dd'T'HH:mm:ss") +-- !query schema +struct +-- !query output +2019-10-06 10:11:12 + + +-- !query +select to_timestamp("P2019-10-06T10:11:12", "'P'yyyy-MM-dd'T'HH:mm:ss") +-- !query schema +struct +-- !query output +2019-10-06 10:11:12 + + +-- !query +select to_timestamp("16", "dd") +-- !query schema +struct +-- !query output +1970-01-16 00:00:00 + + +-- !query +select to_timestamp("02-29", "MM-dd") -- !query schema struct<> -- !query output -java.lang.IllegalArgumentException -Illegal pattern character: e +java.time.DateTimeException +Invalid date 'February 29' as '1970' is not a leap year -- !query -select date_format(timestamp '2019-10-06', 'yyyy-MM-dd uucc') +select to_date("16", "dd") +-- !query schema +struct +-- !query output +1970-01-16 + + +-- !query +select to_date("02-29", "MM-dd") -- !query schema struct<> -- !query output -java.lang.IllegalArgumentException -Illegal pattern character: c +java.time.DateTimeException +Invalid date 'February 29' as '1970' is not a leap year -- !query -select date_format(timestamp '2019-10-06', 'yyyy-MM-dd uuuu') +select to_timestamp("2019 40", "yyyy mm") -- !query schema -struct +struct -- !query output -2019-10-06 Sunday +2019-01-01 00:40:00 -- !query -select to_timestamp("2019-10-06T10:11:12'12", "yyyy-MM-dd'T'HH:mm:ss''SSSS") +select to_timestamp("2019 10:10:10", "yyyy hh:mm:ss") -- !query schema -struct +struct -- !query output -2019-10-06 10:11:12.12 +2019-01-01 10:10:10 -- !query -select to_timestamp("2019-10-06T10:11:12'", "yyyy-MM-dd'T'HH:mm:ss''") +select to_timestamp('2019-10-06 A', 'yyyy-MM-dd GGGGG') -- !query schema -struct +struct<> -- !query output -2019-10-06 10:11:12 +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'yyyy-MM-dd GGGGG' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html -- !query -select to_timestamp("'2019-10-06T10:11:12", "''yyyy-MM-dd'T'HH:mm:ss") +select to_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEEE') -- !query schema -struct +struct<> -- !query output -2019-10-06 10:11:12 +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd MM yyyy EEEEEE' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html -- !query -select to_timestamp("P2019-10-06T10:11:12", "'P'yyyy-MM-dd'T'HH:mm:ss") +select to_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEE') -- !query schema -struct +struct<> -- !query output -2019-10-06 10:11:12 +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd MM yyyy EEEEE' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select unix_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEE') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd MM yyyy EEEEE' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select from_json('{"t":"26/October/2015"}', 't Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy')) +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd/MMMMM/yyyy' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select from_json('{"d":"26/October/2015"}', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy')) +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd/MMMMM/yyyy' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select from_csv('26/October/2015', 't Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy')) +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd/MMMMM/yyyy' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select from_csv('26/October/2015', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy')) +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd/MMMMM/yyyy' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select to_date("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct<> +-- !query output +java.time.format.DateTimeParseException +Text '2020-01-27T20:06:11.847' could not be parsed at index 10 + + +-- !query +select to_date("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct<> +-- !query output +java.time.format.DateTimeParseException +Text 'Unparseable' could not be parsed at index 0 + + +-- !query +select to_timestamp("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct<> +-- !query output +java.time.format.DateTimeParseException +Text '2020-01-27T20:06:11.847' could not be parsed at index 10 + + +-- !query +select to_timestamp("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct<> +-- !query output +java.time.format.DateTimeParseException +Text 'Unparseable' could not be parsed at index 0 + + +-- !query +select unix_timestamp("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct<> +-- !query output +java.time.format.DateTimeParseException +Text '2020-01-27T20:06:11.847' could not be parsed at index 10 + + +-- !query +select unix_timestamp("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct<> +-- !query output +java.time.format.DateTimeParseException +Text 'Unparseable' could not be parsed at index 0 + + +-- !query +select to_unix_timestamp("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct<> +-- !query output +java.time.format.DateTimeParseException +Text '2020-01-27T20:06:11.847' could not be parsed at index 10 + + +-- !query +select to_unix_timestamp("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct<> +-- !query output +java.time.format.DateTimeParseException +Text 'Unparseable' could not be parsed at index 0 + + +-- !query +select cast("Unparseable" as timestamp) +-- !query schema +struct<> +-- !query output +java.time.DateTimeException +Cannot cast Unparseable to TimestampType. + + +-- !query +select cast("Unparseable" as date) +-- !query schema +struct<> +-- !query output +java.time.DateTimeException +Cannot cast Unparseable to DateType. + + +-- !query +select next_day("2015-07-23", "Mon") +-- !query schema +struct +-- !query output +2015-07-27 + + +-- !query +select next_day("2015-07-23", "xx") +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Illegal input for day of week: xx + + +-- !query +select next_day("xx", "Mon") +-- !query schema +struct<> +-- !query output +java.time.DateTimeException +Cannot cast xx to DateType. + + +-- !query +select next_day(null, "Mon") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select next_day(null, "xx") +-- !query schema +struct +-- !query output +NULL diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/decimalArithmeticOperations.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/decimalArithmeticOperations.sql.out index ce53e1c2863e0..2f3513e734f56 100644 --- a/sql/core/src/test/resources/sql-tests/results/ansi/decimalArithmeticOperations.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/ansi/decimalArithmeticOperations.sql.out @@ -22,7 +22,7 @@ struct<> -- !query select id, a*10, b/10 from decimals_test order by id -- !query schema -struct +struct -- !query output 1 1000.000000000000000 99.900000000000000000 2 123451.230000000000000 1234.512300000000000000 @@ -33,7 +33,7 @@ struct +struct<(10.3 * 3.0):decimal(6,2)> -- !query output 30.90 @@ -41,7 +41,7 @@ struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)> -- !query select 10.3000 * 3.0 -- !query schema -struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)> +struct<(10.3000 * 3.0):decimal(9,5)> -- !query output 30.90000 @@ -49,7 +49,7 @@ struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)> -- !query select 10.30000 * 30.0 -- !query schema -struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)> +struct<(10.30000 * 30.0):decimal(11,6)> -- !query output 309.000000 @@ -57,7 +57,7 @@ struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11, -- !query select 10.300000000000000000 * 3.000000000000000000 -- !query schema -struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,34)> +struct<(10.300000000000000000 * 3.000000000000000000):decimal(38,34)> -- !query output 30.9000000000000000000000000000000000 @@ -65,7 +65,7 @@ struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.00000000000000000 -- !query select 10.300000000000000000 * 3.0000000000000000000 -- !query schema -struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.0000000000000000000 AS DECIMAL(21,19))):decimal(38,34)> +struct<(10.300000000000000000 * 3.0000000000000000000):decimal(38,34)> -- !query output 30.9000000000000000000000000000000000 @@ -109,7 +109,7 @@ Decimal(expanded,1000000000000000000000000000000000000,37,0}) cannot be represen -- !query select 123456789123456789.1234567890 * 1.123456789123456789 -- !query schema -struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,18)> +struct<(123456789123456789.1234567890 * 1.123456789123456789):decimal(38,18)> -- !query output 138698367904130467.654320988515622621 @@ -117,7 +117,7 @@ struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789 -- !query select 123456789123456789.1234567890 * 1.123456789123456789 -- !query schema -struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,18)> +struct<(123456789123456789.1234567890 * 1.123456789123456789):decimal(38,18)> -- !query output 138698367904130467.654320988515622621 @@ -125,7 +125,7 @@ struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789 -- !query select 12345678912345.123456789123 / 0.000000012345678 -- !query schema -struct<(CAST(12345678912345.123456789123 AS DECIMAL(29,15)) / CAST(1.2345678E-8 AS DECIMAL(29,15))):decimal(38,9)> +struct<(12345678912345.123456789123 / 1.2345678E-8):decimal(38,9)> -- !query output 1000000073899961059796.725866332 diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/group-analytics.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/group-analytics.sql.out new file mode 100644 index 0000000000000..9dbfc4cf4fa18 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/ansi/group-analytics.sql.out @@ -0,0 +1,1293 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 52 + + +-- !query +CREATE OR REPLACE TEMPORARY VIEW testData AS SELECT * FROM VALUES +(1, 1), (1, 2), (2, 1), (2, 2), (3, 1), (3, 2) +AS testData(a, b) +-- !query schema +struct<> +-- !query output + + + +-- !query +SELECT a + b, b, SUM(a - b) FROM testData GROUP BY a + b, b WITH CUBE +-- !query schema +struct<(a + b):int,b:int,sum((a - b)):bigint> +-- !query output +2 1 0 +2 NULL 0 +3 1 1 +3 2 -1 +3 NULL 0 +4 1 2 +4 2 0 +4 NULL 2 +5 2 1 +5 NULL 1 +NULL 1 3 +NULL 2 0 +NULL NULL 3 + + +-- !query +SELECT a, b, SUM(b) FROM testData GROUP BY a, b WITH CUBE +-- !query schema +struct +-- !query output +1 1 1 +1 2 2 +1 NULL 3 +2 1 1 +2 2 2 +2 NULL 3 +3 1 1 +3 2 2 +3 NULL 3 +NULL 1 3 +NULL 2 6 +NULL NULL 9 + + +-- !query +SELECT a + b, b, SUM(a - b) FROM testData GROUP BY a + b, b WITH ROLLUP +-- !query schema +struct<(a + b):int,b:int,sum((a - b)):bigint> +-- !query output +2 1 0 +2 NULL 0 +3 1 1 +3 2 -1 +3 NULL 0 +4 1 2 +4 2 0 +4 NULL 2 +5 2 1 +5 NULL 1 +NULL NULL 3 + + +-- !query +SELECT a, b, SUM(b) FROM testData GROUP BY a, b WITH ROLLUP +-- !query schema +struct +-- !query output +1 1 1 +1 2 2 +1 NULL 3 +2 1 1 +2 2 2 +2 NULL 3 +3 1 1 +3 2 2 +3 NULL 3 +NULL NULL 9 + + +-- !query +CREATE OR REPLACE TEMPORARY VIEW courseSales AS SELECT * FROM VALUES +("dotNET", 2012, 10000), ("Java", 2012, 20000), ("dotNET", 2012, 5000), ("dotNET", 2013, 48000), ("Java", 2013, 30000) +AS courseSales(course, year, earnings) +-- !query schema +struct<> +-- !query output + + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP(course, year) ORDER BY course, year +-- !query schema +struct +-- !query output +NULL NULL 113000 +Java NULL 50000 +Java 2012 20000 +Java 2013 30000 +dotNET NULL 63000 +dotNET 2012 15000 +dotNET 2013 48000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP(course, year, (course, year)) ORDER BY course, year +-- !query schema +struct +-- !query output +NULL NULL 113000 +Java NULL 50000 +Java 2012 20000 +Java 2012 20000 +Java 2013 30000 +Java 2013 30000 +dotNET NULL 63000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2013 48000 +dotNET 2013 48000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP(course, year, (course, year), ()) ORDER BY course, year +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Empty set in ROLLUP grouping sets is not supported.(line 1, pos 61) + +== SQL == +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP(course, year, (course, year), ()) ORDER BY course, year +-------------------------------------------------------------^^^ + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year) ORDER BY course, year +-- !query schema +struct +-- !query output +NULL NULL 113000 +NULL 2012 35000 +NULL 2013 78000 +Java NULL 50000 +Java 2012 20000 +Java 2013 30000 +dotNET NULL 63000 +dotNET 2012 15000 +dotNET 2013 48000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year, (course, year)) ORDER BY course, year +-- !query schema +struct +-- !query output +NULL NULL 113000 +NULL 2012 35000 +NULL 2013 78000 +Java NULL 50000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +dotNET NULL 63000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year, (course, year), ()) ORDER BY course, year +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Empty set in CUBE grouping sets is not supported.(line 1, pos 61) + +== SQL == +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year, (course, year), ()) ORDER BY course, year +-------------------------------------------------------------^^^ + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(course, year) +-- !query schema +struct +-- !query output +Java NULL 50000 +NULL 2012 35000 +NULL 2013 78000 +dotNET NULL 63000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(course, year, ()) +-- !query schema +struct +-- !query output +Java NULL 50000 +NULL 2012 35000 +NULL 2013 78000 +NULL NULL 113000 +dotNET NULL 63000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(course) +-- !query schema +struct +-- !query output +Java NULL 50000 +dotNET NULL 63000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(year) +-- !query schema +struct +-- !query output +NULL 2012 35000 +NULL 2013 78000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, CUBE(course, year) ORDER BY course, year +-- !query schema +struct +-- !query output +Java NULL 50000 +Java NULL 50000 +Java 2012 20000 +Java 2012 20000 +Java 2013 30000 +Java 2013 30000 +dotNET NULL 63000 +dotNET NULL 63000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2013 48000 +dotNET 2013 48000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year), ROLLUP(course, year) ORDER BY course, year +-- !query schema +struct +-- !query output +NULL NULL 113000 +NULL 2012 35000 +NULL 2013 78000 +Java NULL 50000 +Java NULL 50000 +Java NULL 50000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +dotNET NULL 63000 +dotNET NULL 63000 +dotNET NULL 63000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year), ROLLUP(course, year), GROUPING SETS(course, year) ORDER BY course, year +-- !query schema +struct +-- !query output +NULL 2012 35000 +NULL 2012 35000 +NULL 2013 78000 +NULL 2013 78000 +Java NULL 50000 +Java NULL 50000 +Java NULL 50000 +Java NULL 50000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +dotNET NULL 63000 +dotNET NULL 63000 +dotNET NULL 63000 +dotNET NULL 63000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 + + +-- !query +SELECT course, SUM(earnings) AS sum FROM courseSales +GROUP BY course, earnings GROUPING SETS((), (course), (course, earnings)) ORDER BY course, sum +-- !query schema +struct +-- !query output +NULL 113000 +Java 20000 +Java 30000 +Java 50000 +dotNET 5000 +dotNET 10000 +dotNET 48000 +dotNET 63000 + + +-- !query +SELECT course, SUM(earnings) AS sum, GROUPING_ID(course, earnings) FROM courseSales +GROUP BY course, earnings GROUPING SETS((), (course), (course, earnings)) ORDER BY course, sum +-- !query schema +struct +-- !query output +NULL 113000 3 +Java 20000 0 +Java 30000 0 +Java 50000 1 +dotNET 5000 0 +dotNET 10000 0 +dotNET 48000 0 +dotNET 63000 1 + + +-- !query +SELECT course, year, GROUPING(course), GROUPING(year), GROUPING_ID(course, year) FROM courseSales +GROUP BY CUBE(course, year) +-- !query schema +struct +-- !query output +Java 2012 0 0 0 +Java 2013 0 0 0 +Java NULL 0 1 1 +NULL 2012 1 0 2 +NULL 2013 1 0 2 +NULL NULL 1 1 3 +dotNET 2012 0 0 0 +dotNET 2013 0 0 0 +dotNET NULL 0 1 1 + + +-- !query +SELECT course, year, GROUPING(course) FROM courseSales GROUP BY course, year +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +grouping() can only be used with GroupingSets/Cube/Rollup + + +-- !query +SELECT course, year, GROUPING_ID(course, year) FROM courseSales GROUP BY course, year +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +grouping_id() can only be used with GroupingSets/Cube/Rollup + + +-- !query +SELECT course, year, grouping__id FROM courseSales GROUP BY CUBE(course, year) ORDER BY grouping__id, course, year +-- !query schema +struct +-- !query output +Java 2012 0 +Java 2013 0 +dotNET 2012 0 +dotNET 2013 0 +Java NULL 1 +dotNET NULL 1 +NULL 2012 2 +NULL 2013 2 +NULL NULL 3 + + +-- !query +SELECT course, year FROM courseSales GROUP BY CUBE(course, year) +HAVING GROUPING(year) = 1 AND GROUPING_ID(course, year) > 0 ORDER BY course, year +-- !query schema +struct +-- !query output +NULL NULL +Java NULL +dotNET NULL + + +-- !query +SELECT course, year FROM courseSales GROUP BY course, year HAVING GROUPING(course) > 0 +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup + + +-- !query +SELECT course, year FROM courseSales GROUP BY course, year HAVING GROUPING_ID(course) > 0 +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup + + +-- !query +SELECT course, year FROM courseSales GROUP BY CUBE(course, year) HAVING grouping__id > 0 +-- !query schema +struct +-- !query output +Java NULL +NULL 2012 +NULL 2013 +NULL NULL +dotNET NULL + + +-- !query +SELECT course, year, GROUPING(course), GROUPING(year) FROM courseSales GROUP BY CUBE(course, year) +ORDER BY GROUPING(course), GROUPING(year), course, year +-- !query schema +struct +-- !query output +Java 2012 0 0 +Java 2013 0 0 +dotNET 2012 0 0 +dotNET 2013 0 0 +Java NULL 0 1 +dotNET NULL 0 1 +NULL 2012 1 0 +NULL 2013 1 0 +NULL NULL 1 1 + + +-- !query +SELECT course, year, GROUPING_ID(course, year) FROM courseSales GROUP BY CUBE(course, year) +ORDER BY GROUPING(course), GROUPING(year), course, year +-- !query schema +struct +-- !query output +Java 2012 0 +Java 2013 0 +dotNET 2012 0 +dotNET 2013 0 +Java NULL 1 +dotNET NULL 1 +NULL 2012 2 +NULL 2013 2 +NULL NULL 3 + + +-- !query +SELECT course, year FROM courseSales GROUP BY course, year ORDER BY GROUPING(course) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup + + +-- !query +SELECT course, year FROM courseSales GROUP BY course, year ORDER BY GROUPING_ID(course) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup + + +-- !query +SELECT course, year FROM courseSales GROUP BY CUBE(course, year) ORDER BY grouping__id, course, year +-- !query schema +struct +-- !query output +Java 2012 +Java 2013 +dotNET 2012 +dotNET 2013 +Java NULL +dotNET NULL +NULL 2012 +NULL 2013 +NULL NULL + + +-- !query +SELECT a + b AS k1, b AS k2, SUM(a - b) FROM testData GROUP BY CUBE(k1, k2) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'k1' given input columns: [testdata.a, testdata.b]; line 1 pos 68 + + +-- !query +SELECT a + b AS k, b, SUM(a - b) FROM testData GROUP BY ROLLUP(k, b) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'k' given input columns: [testdata.a, testdata.b]; line 1 pos 63 + + +-- !query +SELECT a + b, b AS k, SUM(a - b) FROM testData GROUP BY a + b, k GROUPING SETS(k) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'k' given input columns: [testdata.a, testdata.b]; line 1 pos 79 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, b, CUBE(a, b) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, b, ROLLUP(a, b) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY CUBE(a, b), ROLLUP(a, b) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 +3 NULL 2 +NULL 1 3 +NULL 2 3 +NULL NULL 6 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, CUBE(a, b), ROLLUP(b) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b), (a), ()) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, CUBE(a, b), GROUPING SETS((a, b), (a), ()) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, CUBE(a, b), ROLLUP(a, b), GROUPING SETS((a, b), (a), ()) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(ROLLUP(a, b)) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(GROUPING SETS((a, b), (a), ())) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b), GROUPING SETS(ROLLUP(a, b))) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b, a, b), (a, b, a), (a, b)) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(GROUPING SETS((a, b, a, b), (a, b, a), (a, b))) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(ROLLUP(a, b), CUBE(a, b)) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(GROUPING SETS((a, b), (a), ()), GROUPING SETS((a, b), (a), (b), ())) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b), (a), (), (a, b), (a), (b), ()) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/higher-order-functions.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/higher-order-functions.sql.out index 7bef1bad4507e..6d26fae73b11c 100644 --- a/sql/core/src/test/resources/sql-tests/results/ansi/higher-order-functions.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/ansi/higher-order-functions.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 29 +-- Number of queries: 30 -- !query @@ -282,3 +282,11 @@ no viable alternative at input 'all'(line 1, pos 22) == SQL == select transform(ys, (all, i) -> all + i) as v from values (array(32, 97)) as t(ys) ----------------------^^^ + + +-- !query +select aggregate(split('abcdefgh',''), array(array('')), (acc, x) -> array(array(x))) +-- !query schema +struct>> +-- !query output +[[""]] diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/interval.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/interval.sql.out index 39b230fd19f3d..320525920cbb7 100644 --- a/sql/core/src/test/resources/sql-tests/results/ansi/interval.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/ansi/interval.sql.out @@ -1,19 +1,19 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 91 +-- Number of queries: 134 -- !query select 3 * (timestamp'2019-10-15 10:11:12.001002' - date'2019-10-15') -- !query schema -struct +struct<((TIMESTAMP '2019-10-15 10:11:12.001002' - DATE '2019-10-15') * 3):interval day to second> -- !query output -30 hours 33 minutes 36.003006 seconds +1 06:33:36.003006000 -- !query select interval 4 month 2 weeks 3 microseconds * 1.5 -- !query schema -struct +struct -- !query output 6 months 21 days 0.000005 seconds @@ -21,9 +21,9 @@ struct +struct<((TIMESTAMP '2019-10-15 00:00:00' - TIMESTAMP '2019-10-14 00:00:00') / 1.5):interval day to second> -- !query output -16 hours +0 16:00:00.000000000 -- !query @@ -74,7 +74,7 @@ divide by zero -- !query select interval '2 seconds' / null -- !query schema -struct +struct -- !query output NULL @@ -82,7 +82,7 @@ NULL -- !query select interval '2 seconds' * null -- !query schema -struct +struct -- !query output NULL @@ -90,7 +90,7 @@ NULL -- !query select null * interval '2 seconds' -- !query schema -struct +struct -- !query output NULL @@ -127,6 +127,54 @@ struct<(+ INTERVAL '-1 months 1 days -1 seconds'):interval> -1 months 1 days -1 seconds +-- !query +select interval -'1-1' year to month +-- !query schema +struct +-- !query output +-1-1 + + +-- !query +select interval -'-1-1' year to month +-- !query schema +struct +-- !query output +1-1 + + +-- !query +select interval +'-1-1' year to month +-- !query schema +struct +-- !query output +-1-1 + + +-- !query +select interval - '1 2:3:4.001' day to second +-- !query schema +struct +-- !query output +-1 02:03:04.001000000 + + +-- !query +select interval +'1 2:3:4.001' day to second +-- !query schema +struct +-- !query output +1 02:03:04.001000000 + + +-- !query +select interval -'-1 2:3:4.001' day to second +-- !query schema +struct +-- !query output +1 02:03:04.001000000 + + -- !query select make_interval(1) -- !query schema @@ -178,11 +226,28 @@ struct -- !query select make_interval(1, 2, 3, 4, 5, 6, 7.008009) -- !query schema -struct +struct -- !query output 1 years 2 months 25 days 5 hours 6 minutes 7.008009 seconds +-- !query +select make_interval(1, 2, 3, 4, 0, 0, 123456789012.123456) +-- !query schema +struct +-- !query output +1 years 2 months 25 days 34293552 hours 30 minutes 12.123456 seconds + + +-- !query +select make_interval(0, 0, 0, 0, 0, 0, 1234567890123456789) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'make_interval(0, 0, 0, 0, 0, 0, 1234567890123456789L)' due to data type mismatch: argument 7 requires decimal(18,6) type, however, '1234567890123456789L' is of bigint type.; line 1 pos 7 + + -- !query select cast('1 second' as interval) -- !query schema @@ -263,90 +328,108 @@ struct +-- !query output +0-0 + + +-- !query +select interval '0 0:0:0' day to second +-- !query schema +struct +-- !query output +0 00:00:00.000000000 + + -- !query select interval '0 0:0:0.1' day to second -- !query schema -struct +struct -- !query output -0.1 seconds +0 00:00:00.100000000 -- !query select interval '10-9' year to month -- !query schema -struct +struct -- !query output -10 years 9 months +10-9 -- !query select interval '20 15' day to hour -- !query schema -struct +struct -- !query output -20 days 15 hours +20 15:00:00.000000000 -- !query select interval '20 15:40' day to minute -- !query schema -struct +struct -- !query output -20 days 15 hours 40 minutes +20 15:40:00.000000000 -- !query select interval '20 15:40:32.99899999' day to second -- !query schema -struct +struct -- !query output -20 days 15 hours 40 minutes 32.998999 seconds +20 15:40:32.998999000 -- !query select interval '15:40' hour to minute -- !query schema -struct +struct -- !query output -15 hours 40 minutes +0 15:40:00.000000000 -- !query select interval '15:40:32.99899999' hour to second -- !query schema -struct +struct -- !query output -15 hours 40 minutes 32.998999 seconds +0 15:40:32.998999000 -- !query select interval '40:32.99899999' minute to second -- !query schema -struct +struct -- !query output -40 minutes 32.998999 seconds +0 00:40:32.998999000 -- !query select interval '40:32' minute to second -- !query schema -struct +struct -- !query output -40 minutes 32 seconds +0 00:40:32.000000000 -- !query select interval 30 day day -- !query schema -struct<> +struct -- !query output -org.apache.spark.sql.catalyst.parser.ParseException +30 days -no viable alternative at input 'day'(line 1, pos 23) -== SQL == -select interval 30 day day ------------------------^^^ +-- !query +select interval 30 days days +-- !query schema +struct +-- !query output +30 days -- !query @@ -638,41 +721,101 @@ select interval (-30) day -- !query schema struct<> -- !query output +org.apache.spark.sql.AnalysisException +Undefined function: 'interval'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 7 + + +-- !query +select interval (a + 1) day +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Undefined function: 'interval'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 7 + + +-- !query +select interval 30 day day day +-- !query schema +struct<> +-- !query output org.apache.spark.sql.catalyst.parser.ParseException -no viable alternative at input 'day'(line 1, pos 22) +extraneous input 'day' expecting {, ';'}(line 1, pos 27) == SQL == -select interval (-30) day -----------------------^^^ +select interval 30 day day day +---------------------------^^^ -- !query -select interval (a + 1) day +select interval (-30) days +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Undefined function: 'interval'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 7 + + +-- !query +select interval (a + 1) days +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Undefined function: 'interval'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 7 + + +-- !query +select interval 30 days days days -- !query schema struct<> -- !query output org.apache.spark.sql.catalyst.parser.ParseException -no viable alternative at input 'day'(line 1, pos 24) +extraneous input 'days' expecting {, ';'}(line 1, pos 29) == SQL == -select interval (a + 1) day -------------------------^^^ +select interval 30 days days days +-----------------------------^^^ -- !query -select interval 30 day day day +SELECT INTERVAL '178956970-7' YEAR TO MONTH +-- !query schema +struct +-- !query output +178956970-7 + + +-- !query +SELECT INTERVAL '178956970-8' YEAR TO MONTH -- !query schema struct<> -- !query output org.apache.spark.sql.catalyst.parser.ParseException -no viable alternative at input 'day'(line 1, pos 23) +Error parsing interval year-month string: integer overflow(line 1, pos 16) == SQL == -select interval 30 day day day ------------------------^^^ +SELECT INTERVAL '178956970-8' YEAR TO MONTH +----------------^^^ + + +-- !query +SELECT INTERVAL '-178956970-8' YEAR TO MONTH +-- !query schema +struct +-- !query output +-178956970-8 + + +-- !query +SELECT INTERVAL -'178956970-8' YEAR TO MONTH +-- !query schema +struct +-- !query output +-178956970-8 -- !query @@ -697,7 +840,7 @@ select interval '2-2' year to month + dateval from interval_arithmetic -- !query schema -struct +struct -- !query output 2012-01-01 2009-11-01 2014-03-01 2014-03-01 2009-11-01 2009-11-01 2014-03-01 @@ -713,7 +856,7 @@ select interval '2-2' year to month + tsval from interval_arithmetic -- !query schema -struct +struct -- !query output 2012-01-01 00:00:00 2009-11-01 00:00:00 2014-03-01 00:00:00 2014-03-01 00:00:00 2009-11-01 00:00:00 2009-11-01 00:00:00 2014-03-01 00:00:00 @@ -724,9 +867,9 @@ select interval '2-2' year to month - interval '3-3' year to month from interval_arithmetic -- !query schema -struct<(INTERVAL '2 years 2 months' + INTERVAL '3 years 3 months'):interval,(INTERVAL '2 years 2 months' - INTERVAL '3 years 3 months'):interval> +struct<(INTERVAL '2-2' YEAR TO MONTH + INTERVAL '3-3' YEAR TO MONTH):interval year to month,(INTERVAL '2-2' YEAR TO MONTH - INTERVAL '3-3' YEAR TO MONTH):interval year to month> -- !query output -5 years 5 months -1 years -1 months +5-5 -1-1 -- !query @@ -740,10 +883,9 @@ select interval '99 11:22:33.123456789' day to second + dateval from interval_arithmetic -- !query schema -struct<> +struct -- !query output -java.lang.IllegalArgumentException -requirement failed: Cannot add hours, minutes or seconds, milliseconds, microseconds to a date +2012-01-01 2011-09-23 12:37:26.876544 2012-04-09 11:22:33.123456 2012-04-09 11:22:33.123456 2011-09-23 12:37:26.876544 2011-09-23 12:37:26.876544 2012-04-09 11:22:33.123456 -- !query @@ -757,7 +899,7 @@ select interval '99 11:22:33.123456789' day to second + tsval from interval_arithmetic -- !query schema -struct +struct -- !query output 2012-01-01 00:00:00 2011-09-23 12:37:26.876544 2012-04-09 11:22:33.123456 2012-04-09 11:22:33.123456 2011-09-23 12:37:26.876544 2011-09-23 12:37:26.876544 2012-04-09 11:22:33.123456 @@ -773,7 +915,7 @@ select interval '99 11:22:33.123456789' day to second + strval from interval_arithmetic -- !query schema -struct +struct -- !query output 2012-01-01 2011-09-23 12:37:26.876544 2012-04-09 11:22:33.123456 2012-04-09 11:22:33.123456 2011-09-23 12:37:26.876544 2011-09-23 12:37:26.876544 2012-04-09 11:22:33.123456 @@ -784,9 +926,9 @@ select interval '99 11:22:33.123456789' day to second - interval '10 9:8:7.123456789' day to second from interval_arithmetic -- !query schema -struct<(INTERVAL '99 days 11 hours 22 minutes 33.123456 seconds' + INTERVAL '10 days 9 hours 8 minutes 7.123456 seconds'):interval,(INTERVAL '99 days 11 hours 22 minutes 33.123456 seconds' - INTERVAL '10 days 9 hours 8 minutes 7.123456 seconds'):interval> +struct<(INTERVAL '99 11:22:33.123456' DAY TO SECOND + INTERVAL '10 09:08:07.123456' DAY TO SECOND):interval day to second,(INTERVAL '99 11:22:33.123456' DAY TO SECOND - INTERVAL '10 09:08:07.123456' DAY TO SECOND):interval day to second> -- !query output -109 days 20 hours 30 minutes 40.246912 seconds 89 days 2 hours 14 minutes 26 seconds +109 20:30:40.246912000 89 02:14:26.000000000 -- !query @@ -832,9 +974,9 @@ struct -- !query select interval '2-2\t' year to month -- !query schema -struct +struct -- !query output -2 years 2 months +2-2 -- !query @@ -854,9 +996,9 @@ select interval '-\t2-2\t' year to month -- !query select interval '\n0 12:34:46.789\t' day to second -- !query schema -struct +struct -- !query output -12 hours 34 minutes 46.789 seconds +0 12:34:46.789000000 -- !query @@ -874,6 +1016,48 @@ select interval '\n-\t10\t 12:34:46.789\t' day to second ----------------^^^ +-- !query +select interval '中文 interval 1 day' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: 中文 interval 1 day(line 1, pos 7) + +== SQL == +select interval '中文 interval 1 day' +-------^^^ + + +-- !query +select interval 'interval中文 1 day' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: interval中文 1 day(line 1, pos 7) + +== SQL == +select interval 'interval中文 1 day' +-------^^^ + + +-- !query +select interval 'interval 1中文day' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: interval 1中文day(line 1, pos 7) + +== SQL == +select interval 'interval 1中文day' +-------^^^ + + -- !query select -(a) from values (interval '-2147483648 months', interval '2147483647 months') t(a, b) -- !query schema @@ -941,3 +1125,241 @@ SELECT struct,to_json(from_json({"a":"1 days"})):string,to_json(map(a, INTERVAL '2 years 1 months 100 days 2 hours 10 minutes')):string,from_json(to_json(map(a, INTERVAL '2 years 1 months 100 days 2 hours 10 minutes'))):struct> -- !query output {"a":1 days} {"a":"1 days"} {"a":"2 years 1 months 100 days 2 hours 10 minutes"} {"a":2 years 1 months 100 days 2 hours 10 minutes} + + +-- !query +select interval '+' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: +(line 1, pos 7) + +== SQL == +select interval '+' +-------^^^ + + +-- !query +select interval '+.' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: +.(line 1, pos 7) + +== SQL == +select interval '+.' +-------^^^ + + +-- !query +select interval '1' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: 1(line 1, pos 7) + +== SQL == +select interval '1' +-------^^^ + + +-- !query +select interval '1.2' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: 1.2(line 1, pos 7) + +== SQL == +select interval '1.2' +-------^^^ + + +-- !query +select interval '- 2' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: - 2(line 1, pos 7) + +== SQL == +select interval '- 2' +-------^^^ + + +-- !query +select interval '1 day -' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: 1 day -(line 1, pos 7) + +== SQL == +select interval '1 day -' +-------^^^ + + +-- !query +select interval '1 day 1' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: 1 day 1(line 1, pos 7) + +== SQL == +select interval '1 day 1' +-------^^^ + + +-- !query +select interval '1 day 2' day +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Can only use numbers in the interval value part for multiple unit value pairs interval form, but got invalid value: 1 day 2(line 1, pos 16) + +== SQL == +select interval '1 day 2' day +----------------^^^ + + +-- !query +select interval 'interval 1' day +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Can only use numbers in the interval value part for multiple unit value pairs interval form, but got invalid value: interval 1(line 1, pos 16) + +== SQL == +select interval 'interval 1' day +----------------^^^ + + +-- !query +select interval '-\t 1' day +-- !query schema +struct +-- !query output +-1 days + + +-- !query +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / 2 +-- !query schema +struct<(INTERVAL '-178956970-8' YEAR TO MONTH / 2):interval year to month> +-- !query output +-89478485-4 + + +-- !query +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / 5 +-- !query schema +struct<(INTERVAL '-178956970-8' YEAR TO MONTH / 5):interval year to month> +-- !query output +-35791394-2 + + +-- !query +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / -1 +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Overflow in integral divide. + + +-- !query +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / -1L +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Overflow in integral divide. + + +-- !query +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / -1.0 +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Overflow + + +-- !query +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / -1.0D +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +not in range + + +-- !query +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / 2 +-- !query schema +struct<(INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND / 2):interval day to second> +-- !query output +-53375995 14:00:27.387904000 + + +-- !query +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / 5 +-- !query schema +struct<(INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND / 5):interval day to second> +-- !query output +-21350398 05:36:10.955162000 + + +-- !query +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / -1 +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Overflow in integral divide. + + +-- !query +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / -1L +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Overflow in integral divide. + + +-- !query +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / -1.0 +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Overflow + + +-- !query +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / -1.0D +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +not in range diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/literals.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/literals.sql.out index f6720f6c5faa4..9748d8bc56d72 100644 --- a/sql/core/src/test/resources/sql-tests/results/ansi/literals.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/ansi/literals.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 50 +-- Number of queries: 54 -- !query @@ -164,6 +164,36 @@ decimal can only support precision up to 38 select 1234567890123456789012345678901234567890.0 +-- !query +select 1F, 1.2F, .10f, 0.10f +-- !query schema +struct<1.0:float,1.2:float,0.1:float,0.1:float> +-- !query output +1.0 1.2 0.1 0.1 + + +-- !query +select -1F, -1.2F, -.10F, -0.10F +-- !query schema +struct<-1.0:float,-1.2:float,-0.1:float,-0.1:float> +-- !query output +-1.0 -1.2 -0.1 -0.1 + + +-- !query +select -3.4028235E39f +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Numeric literal -3.4028235E39 does not fit in range [-3.4028234663852886E+38, 3.4028234663852886E+38] for type float(line 1, pos 7) + +== SQL == +select -3.4028235E39f +-------^^^ + + -- !query select 1D, 1.2D, 1e10, 1.5e5, .10D, 0.10D, .1e5, .9e+2, 0.9e+2, 900e-1, 9.e+1 -- !query schema @@ -216,6 +246,14 @@ struct<0.3:decimal(1,1),-0.8:decimal(1,1),0.5:decimal(1,1),-0.18:decimal(2,2),0. 0.3 -0.8 0.5 -0.18 0.1111 0.1111 +-- !query +select 0.3 F, 0.4 D, 0.5 BD +-- !query schema +struct +-- !query output +0.3 0.4 0.5 + + -- !query select 123456789012345678901234567890123456789e10d, 123456789012345678901234567890123456789.1e10d -- !query schema @@ -398,7 +436,7 @@ select +date '1999-01-01' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(+ DATE '1999-01-01')' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'DATE '1999-01-01'' is of date type.; line 1 pos 7 +cannot resolve '(+ DATE '1999-01-01')' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'DATE '1999-01-01'' is of date type.; line 1 pos 7 -- !query @@ -407,7 +445,7 @@ select +timestamp '1999-01-01' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(+ TIMESTAMP '1999-01-01 00:00:00')' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'TIMESTAMP '1999-01-01 00:00:00'' is of timestamp type.; line 1 pos 7 +cannot resolve '(+ TIMESTAMP '1999-01-01 00:00:00')' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'TIMESTAMP '1999-01-01 00:00:00'' is of timestamp type.; line 1 pos 7 -- !query @@ -424,7 +462,7 @@ select +map(1, 2) struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(+ map(1, 2))' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'map(1, 2)' is of map type.; line 1 pos 7 +cannot resolve '(+ map(1, 2))' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'map(1, 2)' is of map type.; line 1 pos 7 -- !query @@ -433,7 +471,7 @@ select +array(1,2) struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(+ array(1, 2))' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'array(1, 2)' is of array type.; line 1 pos 7 +cannot resolve '(+ array(1, 2))' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'array(1, 2)' is of array type.; line 1 pos 7 -- !query @@ -442,7 +480,7 @@ select +named_struct('a', 1, 'b', 'spark') struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(+ named_struct('a', 1, 'b', 'spark'))' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'named_struct('a', 1, 'b', 'spark')' is of struct type.; line 1 pos 7 +cannot resolve '(+ named_struct('a', 1, 'b', 'spark'))' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'named_struct('a', 1, 'b', 'spark')' is of struct type.; line 1 pos 7 -- !query @@ -451,7 +489,7 @@ select +X'1' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(+ X'01')' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'X'01'' is of binary type.; line 1 pos 7 +cannot resolve '(+ X'01')' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'X'01'' is of binary type.; line 1 pos 7 -- !query @@ -460,7 +498,7 @@ select -date '1999-01-01' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(- DATE '1999-01-01')' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'DATE '1999-01-01'' is of date type.; line 1 pos 7 +cannot resolve '(- DATE '1999-01-01')' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'DATE '1999-01-01'' is of date type.; line 1 pos 7 -- !query @@ -469,7 +507,7 @@ select -timestamp '1999-01-01' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(- TIMESTAMP '1999-01-01 00:00:00')' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'TIMESTAMP '1999-01-01 00:00:00'' is of timestamp type.; line 1 pos 7 +cannot resolve '(- TIMESTAMP '1999-01-01 00:00:00')' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'TIMESTAMP '1999-01-01 00:00:00'' is of timestamp type.; line 1 pos 7 -- !query @@ -478,4 +516,4 @@ select -x'2379ACFe' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(- X'2379ACFE')' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'X'2379ACFE'' is of binary type.; line 1 pos 7 +cannot resolve '(- X'2379ACFE')' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'X'2379ACFE'' is of binary type.; line 1 pos 7 diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/map.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/map.sql.out new file mode 100644 index 0000000000000..12c599812cdee --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/ansi/map.sql.out @@ -0,0 +1,20 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 2 + + +-- !query +select element_at(map(1, 'a', 2, 'b'), 5) +-- !query schema +struct<> +-- !query output +java.util.NoSuchElementException +Key 5 does not exist. + + +-- !query +select map(1, 'a', 2, 'b')[5] +-- !query schema +struct<> +-- !query output +java.util.NoSuchElementException +Key 5 does not exist. diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/parse-schema-string.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/parse-schema-string.sql.out new file mode 100644 index 0000000000000..bfbf11d54489c --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/ansi/parse-schema-string.sql.out @@ -0,0 +1,62 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 4 + + +-- !query +select from_csv('1', 'create INT') +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Cannot parse the data type: +no viable alternative at input 'create'(line 1, pos 0) + +== SQL == +create INT +^^^ + +Failed fallback parsing: +no viable alternative at input 'create'(line 1, pos 0) + +== SQL == +create INT +^^^ +; line 1 pos 7 + + +-- !query +select from_csv('1', 'cube INT') +-- !query schema +struct> +-- !query output +{"cube":1} + + +-- !query +select from_json('{"create":1}', 'create INT') +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Cannot parse the data type: +no viable alternative at input 'create'(line 1, pos 0) + +== SQL == +create INT +^^^ + +Failed fallback parsing: +no viable alternative at input 'create'(line 1, pos 0) + +== SQL == +create INT +^^^ +; line 1 pos 7 + + +-- !query +select from_json('{"cube":1}', 'cube INT') +-- !query schema +struct> +-- !query output +{"cube":1} diff --git a/sql/core/src/test/resources/sql-tests/results/ansi/string-functions.sql.out b/sql/core/src/test/resources/sql-tests/results/ansi/string-functions.sql.out new file mode 100644 index 0000000000000..3f4399fe088b3 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/ansi/string-functions.sql.out @@ -0,0 +1,416 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 50 + + +-- !query +select concat_ws() +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +requirement failed: concat_ws requires at least one argument.; line 1 pos 7 + + +-- !query +select format_string() +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +requirement failed: format_string() should take at least 1 argument; line 1 pos 7 + + +-- !query +select 'a' || 'b' || 'c' +-- !query schema +struct +-- !query output +abc + + +-- !query +select replace('abc', 'b', '123') +-- !query schema +struct +-- !query output +a123c + + +-- !query +select replace('abc', 'b') +-- !query schema +struct +-- !query output +ac + + +-- !query +select length(uuid()), (uuid() <> uuid()) +-- !query schema +struct +-- !query output +36 true + + +-- !query +select position('bar' in 'foobarbar'), position(null, 'foobarbar'), position('aaads', null) +-- !query schema +struct +-- !query output +4 NULL NULL + + +-- !query +select left("abcd", 2), left("abcd", 5), left("abcd", '2'), left("abcd", null) +-- !query schema +struct +-- !query output +ab abcd ab NULL + + +-- !query +select left(null, -2) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'substring(NULL, 1, -2)' due to data type mismatch: argument 1 requires (string or binary) type, however, 'NULL' is of null type.; line 1 pos 7 + + +-- !query +select left("abcd", -2), left("abcd", 0), left("abcd", 'a') +-- !query schema +struct<> +-- !query output +java.lang.NumberFormatException +invalid input syntax for type numeric: a + + +-- !query +select right("abcd", 2), right("abcd", 5), right("abcd", '2'), right("abcd", null) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'substring('abcd', (- CAST('2' AS DOUBLE)), 2147483647)' due to data type mismatch: argument 2 requires int type, however, '(- CAST('2' AS DOUBLE))' is of double type.; line 1 pos 43 + + +-- !query +select right(null, -2) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'substring(NULL, (- -2), 2147483647)' due to data type mismatch: argument 1 requires (string or binary) type, however, 'NULL' is of null type.; line 1 pos 7 + + +-- !query +select right("abcd", -2), right("abcd", 0), right("abcd", 'a') +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'substring('abcd', (- CAST('a' AS DOUBLE)), 2147483647)' due to data type mismatch: argument 2 requires int type, however, '(- CAST('a' AS DOUBLE))' is of double type.; line 1 pos 44 + + +-- !query +SELECT split('aa1cc2ee3', '[1-9]+') +-- !query schema +struct> +-- !query output +["aa","cc","ee",""] + + +-- !query +SELECT split('aa1cc2ee3', '[1-9]+', 2) +-- !query schema +struct> +-- !query output +["aa","cc2ee3"] + + +-- !query +SELECT substr('Spark SQL', 5) +-- !query schema +struct +-- !query output +k SQL + + +-- !query +SELECT substr('Spark SQL', -3) +-- !query schema +struct +-- !query output +SQL + + +-- !query +SELECT substr('Spark SQL', 5, 1) +-- !query schema +struct +-- !query output +k + + +-- !query +SELECT substr('Spark SQL' from 5) +-- !query schema +struct +-- !query output +k SQL + + +-- !query +SELECT substr('Spark SQL' from -3) +-- !query schema +struct +-- !query output +SQL + + +-- !query +SELECT substr('Spark SQL' from 5 for 1) +-- !query schema +struct +-- !query output +k + + +-- !query +SELECT substring('Spark SQL', 5) +-- !query schema +struct +-- !query output +k SQL + + +-- !query +SELECT substring('Spark SQL', -3) +-- !query schema +struct +-- !query output +SQL + + +-- !query +SELECT substring('Spark SQL', 5, 1) +-- !query schema +struct +-- !query output +k + + +-- !query +SELECT substring('Spark SQL' from 5) +-- !query schema +struct +-- !query output +k SQL + + +-- !query +SELECT substring('Spark SQL' from -3) +-- !query schema +struct +-- !query output +SQL + + +-- !query +SELECT substring('Spark SQL' from 5 for 1) +-- !query schema +struct +-- !query output +k + + +-- !query +SELECT trim(" xyz "), ltrim(" xyz "), rtrim(" xyz ") +-- !query schema +struct +-- !query output +xyz xyz xyz + + +-- !query +SELECT trim(BOTH 'xyz' FROM 'yxTomxx'), trim('xyz' FROM 'yxTomxx') +-- !query schema +struct +-- !query output +Tom Tom + + +-- !query +SELECT trim(BOTH 'x' FROM 'xxxbarxxx'), trim('x' FROM 'xxxbarxxx') +-- !query schema +struct +-- !query output +bar bar + + +-- !query +SELECT trim(LEADING 'xyz' FROM 'zzzytest') +-- !query schema +struct +-- !query output +test + + +-- !query +SELECT trim(LEADING 'xyz' FROM 'zzzytestxyz') +-- !query schema +struct +-- !query output +testxyz + + +-- !query +SELECT trim(LEADING 'xy' FROM 'xyxXxyLAST WORD') +-- !query schema +struct +-- !query output +XxyLAST WORD + + +-- !query +SELECT trim(TRAILING 'xyz' FROM 'testxxzx') +-- !query schema +struct +-- !query output +test + + +-- !query +SELECT trim(TRAILING 'xyz' FROM 'xyztestxxzx') +-- !query schema +struct +-- !query output +xyztest + + +-- !query +SELECT trim(TRAILING 'xy' FROM 'TURNERyxXxy') +-- !query schema +struct +-- !query output +TURNERyxX + + +-- !query +SELECT btrim('xyxtrimyyx', 'xy') +-- !query schema +struct +-- !query output +trim + + +-- !query +SELECT btrim(encode(" xyz ", 'utf-8')) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'trim(encode(' xyz ', 'utf-8'))' due to data type mismatch: argument 1 requires string type, however, 'encode(' xyz ', 'utf-8')' is of binary type.; line 1 pos 7 + + +-- !query +SELECT btrim(encode('yxTomxx', 'utf-8'), encode('xyz', 'utf-8')) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'TRIM(BOTH encode('xyz', 'utf-8') FROM encode('yxTomxx', 'utf-8'))' due to data type mismatch: argument 1 requires string type, however, 'encode('yxTomxx', 'utf-8')' is of binary type. argument 2 requires string type, however, 'encode('xyz', 'utf-8')' is of binary type.; line 1 pos 7 + + +-- !query +SELECT btrim(encode('xxxbarxxx', 'utf-8'), encode('x', 'utf-8')) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'TRIM(BOTH encode('x', 'utf-8') FROM encode('xxxbarxxx', 'utf-8'))' due to data type mismatch: argument 1 requires string type, however, 'encode('xxxbarxxx', 'utf-8')' is of binary type. argument 2 requires string type, however, 'encode('x', 'utf-8')' is of binary type.; line 1 pos 7 + + +-- !query +SELECT lpad('hi', 'invalid_length') +-- !query schema +struct<> +-- !query output +java.lang.NumberFormatException +invalid input syntax for type numeric: invalid_length + + +-- !query +SELECT rpad('hi', 'invalid_length') +-- !query schema +struct<> +-- !query output +java.lang.NumberFormatException +invalid input syntax for type numeric: invalid_length + + +-- !query +select decode() +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Invalid number of arguments for function decode. Expected: 2; Found: 0; line 1 pos 7 + + +-- !query +select decode(encode('abc', 'utf-8')) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Invalid number of arguments for function decode. Expected: 2; Found: 1; line 1 pos 7 + + +-- !query +select decode(encode('abc', 'utf-8'), 'utf-8') +-- !query schema +struct +-- !query output +abc + + +-- !query +select decode(1, 1, 'Southlake') +-- !query schema +struct +-- !query output +Southlake + + +-- !query +select decode(2, 1, 'Southlake') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select decode(2, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle', 'Non domestic') +-- !query schema +struct +-- !query output +San Francisco + + +-- !query +select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle', 'Non domestic') +-- !query schema +struct +-- !query output +Non domestic + + +-- !query +select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle') +-- !query schema +struct +-- !query output +NULL diff --git a/sql/core/src/test/resources/sql-tests/results/array.sql.out b/sql/core/src/test/resources/sql-tests/results/array.sql.out index 2c2b1a7856304..76fdf035ad4ec 100644 --- a/sql/core/src/test/resources/sql-tests/results/array.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/array.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 12 +-- Number of queries: 20 -- !query @@ -92,7 +92,7 @@ select array_contains(timestamp_array, timestamp '2016-11-15 20:54:00.000'), array_contains(timestamp_array, timestamp '2016-01-01 20:54:00.000') from primitive_arrays -- !query schema -struct +struct -- !query output true false true false true false true false true false true false true false true false true false true false @@ -160,3 +160,68 @@ from primitive_arrays struct -- !query output 1 2 2 2 2 2 2 2 2 2 + + +-- !query +select element_at(array(1, 2, 3), 5) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select element_at(array(1, 2, 3), -5) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select element_at(array(1, 2, 3), 0) +-- !query schema +struct<> +-- !query output +java.lang.ArrayIndexOutOfBoundsException +SQL array indices start at 1 + + +-- !query +select elt(4, '123', '456') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select elt(0, '123', '456') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select elt(-1, '123', '456') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select array(1, 2, 3)[5] +-- !query schema +struct +-- !query output +NULL + + +-- !query +select array(1, 2, 3)[-1] +-- !query schema +struct +-- !query output +NULL diff --git a/sql/core/src/test/resources/sql-tests/results/bitwise.sql.out b/sql/core/src/test/resources/sql-tests/results/bitwise.sql.out index 552b027df1bc0..649cf21b51eeb 100644 --- a/sql/core/src/test/resources/sql-tests/results/bitwise.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/bitwise.sql.out @@ -1,11 +1,11 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 27 +-- Number of queries: 32 -- !query select bit_count(null) -- !query schema -struct +struct -- !query output NULL @@ -231,3 +231,45 @@ struct +-- !query output +1 0 1 1 + + +-- !query +select getbit(11L, 2 + 1), getbit(11L, 3 - 1), getbit(10L + 1, 1 * 1), getbit(cast(11L / 1 AS long), 1 - 1) +-- !query schema +struct +-- !query output +1 0 1 1 + + +-- !query +select getbit(11L, 63) +-- !query schema +struct +-- !query output +0 + + +-- !query +select getbit(11L, -1) +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Invalid bit position: -1 is less than zero + + +-- !query +select getbit(11L, 64) +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Invalid bit position: 64 exceeds the bit upper limit diff --git a/sql/core/src/test/resources/sql-tests/results/cast.sql.out b/sql/core/src/test/resources/sql-tests/results/cast.sql.out index 35b4c0e79720b..42d12b80be989 100644 --- a/sql/core/src/test/resources/sql-tests/results/cast.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/cast.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 46 +-- Number of queries: 51 -- !query @@ -269,6 +269,8 @@ Class: org.apache.spark.sql.catalyst.expressions.Cast Extended Usage: No example/argument for boolean. + Since: 2.0.1 + Function: boolean Usage: boolean(expr) - Casts the value `expr` to the target data type `boolean`. @@ -353,6 +355,46 @@ struct 1 +-- !query +select cast('1中文' as tinyint) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select cast('1中文' as smallint) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select cast('1中文' as INT) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select cast('中文1' as bigint) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select cast('1中文' as bigint) +-- !query schema +struct +-- !query output +NULL + + -- !query select cast('\t\t true \n\r ' as boolean) -- !query schema diff --git a/sql/core/src/test/resources/sql-tests/results/change-column.sql.out b/sql/core/src/test/resources/sql-tests/results/change-column.sql.out index b1a32ad1f63e9..96b28d734f5a7 100644 --- a/sql/core/src/test/resources/sql-tests/results/change-column.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/change-column.sql.out @@ -50,7 +50,7 @@ ALTER TABLE test_change RENAME COLUMN a TO a1 struct<> -- !query output org.apache.spark.sql.AnalysisException -RENAME COLUMN is only supported with v2 tables.; +RENAME COLUMN is only supported with v2 tables. -- !query @@ -69,7 +69,7 @@ ALTER TABLE test_change CHANGE a TYPE STRING struct<> -- !query output org.apache.spark.sql.AnalysisException -ALTER TABLE CHANGE COLUMN is not supported for changing column 'a' with type 'IntegerType' to 'a' with type 'StringType'; +ALTER TABLE CHANGE COLUMN is not supported for changing column 'a' with type 'IntegerType' to 'a' with type 'StringType' -- !query @@ -88,7 +88,7 @@ ALTER TABLE test_change CHANGE a AFTER b struct<> -- !query output org.apache.spark.sql.AnalysisException -ALTER COLUMN ... FIRST | ALTER is only supported with v2 tables.; +ALTER COLUMN ... FIRST | ALTER is only supported with v2 tables. -- !query @@ -97,7 +97,7 @@ ALTER TABLE test_change CHANGE b FIRST struct<> -- !query output org.apache.spark.sql.AnalysisException -ALTER COLUMN ... FIRST | ALTER is only supported with v2 tables.; +ALTER COLUMN ... FIRST | ALTER is only supported with v2 tables. -- !query @@ -176,7 +176,7 @@ ALTER TABLE test_change CHANGE invalid_col TYPE INT struct<> -- !query output org.apache.spark.sql.AnalysisException -Can't find column `invalid_col` given table data columns [`a`, `b`, `c`]; +Can't find column `invalid_col` given table data columns [`a`, `b`, `c`] -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/charvarchar.sql.out b/sql/core/src/test/resources/sql-tests/results/charvarchar.sql.out new file mode 100644 index 0000000000000..00180eec5653f --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/charvarchar.sql.out @@ -0,0 +1,1159 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 83 + + +-- !query +create table char_tbl(c char(5), v varchar(6)) using parquet +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_tbl +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) + +# Detailed Table Information +Database default +Table char_tbl +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_tbl + + +-- !query +desc formatted char_tbl c +-- !query schema +struct +-- !query output +col_name c +data_type char(5) +comment NULL +min NULL +max NULL +num_nulls NULL +distinct_count NULL +avg_col_len NULL +max_col_len NULL +histogram NULL + + +-- !query +show create table char_tbl +-- !query schema +struct +-- !query output +CREATE TABLE `default`.`char_tbl` ( + `c` CHAR(5), + `v` VARCHAR(6)) +USING parquet + + +-- !query +create table char_tbl2 using parquet as select * from char_tbl +-- !query schema +struct<> +-- !query output + + + +-- !query +show create table char_tbl2 +-- !query schema +struct +-- !query output +CREATE TABLE `default`.`char_tbl2` ( + `c` CHAR(5), + `v` VARCHAR(6)) +USING parquet + + +-- !query +desc formatted char_tbl2 +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) + +# Detailed Table Information +Database default +Table char_tbl2 +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_tbl2 + + +-- !query +desc formatted char_tbl2 c +-- !query schema +struct +-- !query output +col_name c +data_type char(5) +comment NULL +min NULL +max NULL +num_nulls NULL +distinct_count NULL +avg_col_len NULL +max_col_len NULL +histogram NULL + + +-- !query +create table char_tbl3 like char_tbl +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_tbl3 +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) + +# Detailed Table Information +Database default +Table char_tbl3 +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_tbl3 + + +-- !query +desc formatted char_tbl3 c +-- !query schema +struct +-- !query output +col_name c +data_type char(5) +comment NULL +min NULL +max NULL +num_nulls NULL +distinct_count NULL +avg_col_len NULL +max_col_len NULL +histogram NULL + + +-- !query +show create table char_tbl3 +-- !query schema +struct +-- !query output +CREATE TABLE `default`.`char_tbl3` ( + `c` CHAR(5), + `v` VARCHAR(6)) +USING parquet + + +-- !query +create view char_view as select * from char_tbl +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_view +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) + +# Detailed Table Information +Database default +Table char_view +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type VIEW +View Text select * from char_tbl +View Original Text select * from char_tbl +View Catalog and Namespace spark_catalog.default +View Query Output Columns [c, v] +Table Properties [] + + +-- !query +desc formatted char_view c +-- !query schema +struct +-- !query output +col_name c +data_type char(5) +comment NULL +min NULL +max NULL +num_nulls NULL +distinct_count NULL +avg_col_len NULL +max_col_len NULL +histogram NULL + + +-- !query +show create table char_view +-- !query schema +struct +-- !query output +CREATE VIEW `default`.`char_view` ( + `c`, + `v`) +AS select * from char_tbl + + +-- !query +alter table char_tbl rename to char_tbl1 +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_tbl1 +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) + +# Detailed Table Information +Database default +Table char_tbl1 +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_tbl1 + + +-- !query +alter table char_tbl1 change column c type char(6) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +ALTER TABLE CHANGE COLUMN is not supported for changing column 'c' with type 'CharType(5)' to 'c' with type 'CharType(6)' + + +-- !query +alter table char_tbl1 change column c type char(5) +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_tbl1 +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) + +# Detailed Table Information +Database default +Table char_tbl1 +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_tbl1 + + +-- !query +alter table char_tbl1 add columns (d char(5)) +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_tbl1 +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) +d char(5) + +# Detailed Table Information +Database default +Table char_tbl1 +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_tbl1 + + +-- !query +alter view char_view as select * from char_tbl2 +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_view +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) + +# Detailed Table Information +Database default +Table char_view +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type VIEW +View Text select * from char_tbl2 +View Original Text select * from char_tbl2 +View Catalog and Namespace spark_catalog.default +View Query Output Columns [c, v] +Table Properties [] + + +-- !query +alter table char_tbl1 SET TBLPROPERTIES('yes'='no') +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_tbl1 +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) +d char(5) + +# Detailed Table Information +Database default +Table char_tbl1 +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Table Properties [yes=no] +Location [not included in comparison]/{warehouse_dir}/char_tbl1 + + +-- !query +alter view char_view SET TBLPROPERTIES('yes'='no') +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_view +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) + +# Detailed Table Information +Database default +Table char_view +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type VIEW +View Text select * from char_tbl2 +View Original Text select * from char_tbl2 +View Catalog and Namespace spark_catalog.default +View Query Output Columns [c, v] +Table Properties [yes=no] + + +-- !query +alter table char_tbl1 UNSET TBLPROPERTIES('yes') +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_tbl1 +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) +d char(5) + +# Detailed Table Information +Database default +Table char_tbl1 +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_tbl1 + + +-- !query +alter view char_view UNSET TBLPROPERTIES('yes') +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_view +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) + +# Detailed Table Information +Database default +Table char_view +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type VIEW +View Text select * from char_tbl2 +View Original Text select * from char_tbl2 +View Catalog and Namespace spark_catalog.default +View Query Output Columns [c, v] +Table Properties [] + + +-- !query +alter table char_tbl1 SET SERDEPROPERTIES('yes'='no') +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_tbl1 +-- !query schema +struct +-- !query output +c char(5) +v varchar(6) +d char(5) + +# Detailed Table Information +Database default +Table char_tbl1 +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_tbl1 +Storage Properties [yes=no] + + +-- !query +create table char_part(c1 char(5), c2 char(2), v1 varchar(6), v2 varchar(2)) using parquet partitioned by (v2, c2) +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_part +-- !query schema +struct +-- !query output +c1 char(5) +v1 varchar(6) +v2 varchar(2) +c2 char(2) +# Partition Information +# col_name data_type comment +v2 varchar(2) +c2 char(2) + +# Detailed Table Information +Database default +Table char_part +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_part +Partition Provider Catalog + + +-- !query +alter table char_part add partition (v2='ke', c2='nt') location 'loc1' +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_part +-- !query schema +struct +-- !query output +c1 char(5) +v1 varchar(6) +v2 varchar(2) +c2 char(2) +# Partition Information +# col_name data_type comment +v2 varchar(2) +c2 char(2) + +# Detailed Table Information +Database default +Table char_part +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_part +Partition Provider Catalog + + +-- !query +alter table char_part partition (v2='ke') rename to partition (v2='nt') +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Partition spec is invalid. The spec (v2) must match the partition spec (v2, c2) defined in table '`default`.`char_part`' + + +-- !query +desc formatted char_part +-- !query schema +struct +-- !query output +c1 char(5) +v1 varchar(6) +v2 varchar(2) +c2 char(2) +# Partition Information +# col_name data_type comment +v2 varchar(2) +c2 char(2) + +# Detailed Table Information +Database default +Table char_part +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_part +Partition Provider Catalog + + +-- !query +alter table char_part partition (v2='ke', c2='nt') set location 'loc2' +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_part +-- !query schema +struct +-- !query output +c1 char(5) +v1 varchar(6) +v2 varchar(2) +c2 char(2) +# Partition Information +# col_name data_type comment +v2 varchar(2) +c2 char(2) + +# Detailed Table Information +Database default +Table char_part +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_part +Partition Provider Catalog + + +-- !query +MSCK REPAIR TABLE char_part +-- !query schema +struct<> +-- !query output + + + +-- !query +desc formatted char_part +-- !query schema +struct +-- !query output +c1 char(5) +v1 varchar(6) +v2 varchar(2) +c2 char(2) +# Partition Information +# col_name data_type comment +v2 varchar(2) +c2 char(2) + +# Detailed Table Information +Database default +Table char_part +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type MANAGED +Provider parquet +Location [not included in comparison]/{warehouse_dir}/char_part +Partition Provider Catalog + + +-- !query +create temporary view str_view as select c, v from values + (null, null), + (null, 'S'), + ('N', 'N '), + ('Ne', 'Sp'), + ('Net ', 'Spa '), + ('NetE', 'Spar'), + ('NetEa ', 'Spark '), + ('NetEas ', 'Spark'), + ('NetEase', 'Spark-') t(c, v) +-- !query schema +struct<> +-- !query output + + + +-- !query +create table char_tbl4(c7 char(7), c8 char(8), v varchar(6), s string) using parquet +-- !query schema +struct<> +-- !query output + + + +-- !query +insert into char_tbl4 select c, c, v, c from str_view +-- !query schema +struct<> +-- !query output + + + +-- !query +select c7, c8, v, s from char_tbl4 +-- !query schema +struct +-- !query output +N N N N +NULL NULL NULL NULL +NULL NULL S NULL +Ne Ne Sp Ne +Net Net Spa Net +NetE NetE Spar NetE +NetEa NetEa Spark NetEa +NetEas NetEas Spark NetEas +NetEase NetEase Spark- NetEase + + +-- !query +select c7, c8, v, s from char_tbl4 where c7 = c8 +-- !query schema +struct +-- !query output +N N N N +Ne Ne Sp Ne +Net Net Spa Net +NetE NetE Spar NetE +NetEa NetEa Spark NetEa +NetEas NetEas Spark NetEas +NetEase NetEase Spark- NetEase + + +-- !query +select c7, c8, v, s from char_tbl4 where c7 = v +-- !query schema +struct +-- !query output + + + +-- !query +select c7, c8, v, s from char_tbl4 where c7 = s +-- !query schema +struct +-- !query output +NetEas NetEas Spark NetEas +NetEase NetEase Spark- NetEase + + +-- !query +select c7, c8, v, s from char_tbl4 where c7 = 'NetEase ' +-- !query schema +struct +-- !query output +NetEase NetEase Spark- NetEase + + +-- !query +select c7, c8, v, s from char_tbl4 where v = 'Spark ' +-- !query schema +struct +-- !query output +NetEa NetEa Spark NetEa + + +-- !query +select c7, c8, v, s from char_tbl4 order by c7 +-- !query schema +struct +-- !query output +NULL NULL NULL NULL +NULL NULL S NULL +N N N N +Ne Ne Sp Ne +Net Net Spa Net +NetE NetE Spar NetE +NetEa NetEa Spark NetEa +NetEas NetEas Spark NetEas +NetEase NetEase Spark- NetEase + + +-- !query +select c7, c8, v, s from char_tbl4 order by v +-- !query schema +struct +-- !query output +NULL NULL NULL NULL +N N N N +NULL NULL S NULL +Ne Ne Sp Ne +Net Net Spa Net +NetE NetE Spar NetE +NetEas NetEas Spark NetEas +NetEa NetEa Spark NetEa +NetEase NetEase Spark- NetEase + + +-- !query +select ascii(c7), ascii(c8), ascii(v), ascii(s) from char_tbl4 +-- !query schema +struct +-- !query output +78 78 78 78 +78 78 83 78 +78 78 83 78 +78 78 83 78 +78 78 83 78 +78 78 83 78 +78 78 83 78 +NULL NULL 83 NULL +NULL NULL NULL NULL + + +-- !query +select base64(c7), base64(c8), base64(v), ascii(s) from char_tbl4 +-- !query schema +struct +-- !query output +NULL NULL NULL NULL +NULL NULL Uw== NULL +TiAgICAgIA== TiAgICAgICA= TiA= 78 +TmUgICAgIA== TmUgICAgICA= U3A= 78 +TmV0ICAgIA== TmV0ICAgICA= U3BhICA= 78 +TmV0RSAgIA== TmV0RSAgICA= U3Bhcg== 78 +TmV0RWEgIA== TmV0RWEgICA= U3Bhcmsg 78 +TmV0RWFzIA== TmV0RWFzICA= U3Bhcms= 78 +TmV0RWFzZQ== TmV0RWFzZSA= U3Bhcmst 78 + + +-- !query +select bit_length(c7), bit_length(c8), bit_length(v), bit_length(s) from char_tbl4 +-- !query schema +struct +-- !query output +56 64 16 16 +56 64 16 8 +56 64 32 32 +56 64 40 40 +56 64 40 56 +56 64 48 48 +56 64 48 56 +NULL NULL 8 NULL +NULL NULL NULL NULL + + +-- !query +select char_length(c7), char_length(c8), char_length(v), char_length(s) from char_tbl4 +-- !query schema +struct +-- !query output +7 8 2 1 +7 8 2 2 +7 8 4 4 +7 8 5 5 +7 8 5 7 +7 8 6 6 +7 8 6 7 +NULL NULL 1 NULL +NULL NULL NULL NULL + + +-- !query +select octet_length(c7), octet_length(c8), octet_length(v), octet_length(s) from char_tbl4 +-- !query schema +struct +-- !query output +7 8 2 1 +7 8 2 2 +7 8 4 4 +7 8 5 5 +7 8 5 7 +7 8 6 6 +7 8 6 7 +NULL NULL 1 NULL +NULL NULL NULL NULL + + +-- !query +select concat_ws('|', c7, c8), concat_ws('|', c7, v), concat_ws('|', c7, s), concat_ws('|', v, s) from char_tbl4 +-- !query schema +struct +-- !query output + + S S +N |N N |N N |N N |N +Ne |Ne Ne |Sp Ne |Ne Sp|Ne +Net |Net Net |Spa Net |Net Spa |Net +NetE |NetE NetE |Spar NetE |NetE Spar|NetE +NetEa |NetEa NetEa |Spark NetEa |NetEa Spark |NetEa +NetEas |NetEas NetEas |Spark NetEas |NetEas Spark|NetEas +NetEase|NetEase NetEase|Spark- NetEase|NetEase Spark-|NetEase + + +-- !query +select concat(c7, c8), concat(c7, v), concat(c7, s), concat(v, s) from char_tbl4 +-- !query schema +struct +-- !query output +N N N N N N N N +NULL NULL NULL NULL +NULL NULL NULL NULL +Ne Ne Ne Sp Ne Ne SpNe +Net Net Net Spa Net Net Spa Net +NetE NetE NetE Spar NetE NetE SparNetE +NetEa NetEa NetEa Spark NetEa NetEa Spark NetEa +NetEas NetEas NetEas Spark NetEas NetEas SparkNetEas +NetEaseNetEase NetEaseSpark- NetEaseNetEase Spark-NetEase + + +-- !query +select like(c7, 'Ne _'), like(c8, 'Ne _') from char_tbl4 +-- !query schema +struct +-- !query output +NULL NULL +NULL NULL +false false +false false +false false +false false +false false +false false +false true + + +-- !query +select like(v, 'Spark_') from char_tbl4 +-- !query schema +struct +-- !query output +NULL +false +false +false +false +false +false +true +true + + +-- !query +select c7 = c8, upper(c7) = upper(c8), lower(c7) = lower(c8) from char_tbl4 where s = 'NetEase' +-- !query schema +struct<(c7 = c8):boolean,(upper(c7) = upper(c8)):boolean,(lower(c7) = lower(c8)):boolean> +-- !query output +true false false + + +-- !query +select c7 = s, upper(c7) = upper(s), lower(c7) = lower(s) from char_tbl4 where s = 'NetEase' +-- !query schema +struct<(c7 = s):boolean,(upper(c7) = upper(s)):boolean,(lower(c7) = lower(s)):boolean> +-- !query output +true true true + + +-- !query +select c7 = 'NetEase', upper(c7) = upper('NetEase'), lower(c7) = lower('NetEase') from char_tbl4 where s = 'NetEase' +-- !query schema +struct<(c7 = NetEase):boolean,(upper(c7) = upper(NetEase)):boolean,(lower(c7) = lower(NetEase)):boolean> +-- !query output +true true true + + +-- !query +select printf('Hey, %s%s%s%s', c7, c8, v, s) from char_tbl4 +-- !query schema +struct +-- !query output +Hey, N N N N +Hey, Ne Ne SpNe +Hey, Net Net Spa Net +Hey, NetE NetE SparNetE +Hey, NetEa NetEa Spark NetEa +Hey, NetEas NetEas SparkNetEas +Hey, NetEaseNetEase Spark-NetEase +Hey, nullnullSnull +Hey, nullnullnullnull + + +-- !query +select repeat(c7, 2), repeat(c8, 2), repeat(v, 2), repeat(s, 2) from char_tbl4 +-- !query schema +struct +-- !query output +N N N N N N NN +NULL NULL NULL NULL +NULL NULL SS NULL +Ne Ne Ne Ne SpSp NeNe +Net Net Net Net Spa Spa Net Net +NetE NetE NetE NetE SparSpar NetENetE +NetEa NetEa NetEa NetEa Spark Spark NetEa NetEa +NetEas NetEas NetEas NetEas SparkSpark NetEas NetEas +NetEaseNetEase NetEase NetEase Spark-Spark- NetEaseNetEase + + +-- !query +select replace(c7, 'Net', 'Apache'), replace(c8, 'Net', 'Apache'), replace(v, 'Spark', 'Kyuubi'), replace(s, 'Net', 'Apache') from char_tbl4 +-- !query schema +struct +-- !query output +Apache Apache Spa Apache +ApacheE ApacheE Spar ApacheE +ApacheEa ApacheEa Kyuubi ApacheEa +ApacheEas ApacheEas Kyuubi ApacheEas +ApacheEase ApacheEase Kyuubi- ApacheEase +N N N N +NULL NULL NULL NULL +NULL NULL S NULL +Ne Ne Sp Ne + + +-- !query +select rpad(c7, 10), rpad(c8, 5), rpad(v, 5), rpad(s, 5) from char_tbl4 +-- !query schema +struct +-- !query output +N N N N +NULL NULL NULL NULL +NULL NULL S NULL +Ne Ne Sp Ne +Net Net Spa Net +NetE NetE Spar NetE +NetEa NetEa Spark NetEa +NetEas NetEa Spark NetEa +NetEase NetEa Spark NetEa + + +-- !query +select rtrim(c7), rtrim(c8), rtrim(v), rtrim(s) from char_tbl4 +-- !query schema +struct +-- !query output +N N N N +NULL NULL NULL NULL +NULL NULL S NULL +Ne Ne Sp Ne +Net Net Spa Net +NetE NetE Spar NetE +NetEa NetEa Spark NetEa +NetEas NetEas Spark NetEas +NetEase NetEase Spark- NetEase + + +-- !query +select split(c7, 'e'), split(c8, 'e'), split(v, 'a'), split(s, 'e') from char_tbl4 +-- !query schema +struct,split(c8, e, -1):array,split(v, a, -1):array,split(s, e, -1):array> +-- !query output +NULL NULL NULL NULL +NULL NULL ["S"] NULL +["N "] ["N "] ["N "] ["N"] +["N"," "] ["N"," "] ["Sp"] ["N",""] +["N","t "] ["N","t "] ["Sp"," "] ["N","t "] +["N","tE "] ["N","tE "] ["Sp","r"] ["N","tE"] +["N","tEa "] ["N","tEa "] ["Sp","rk "] ["N","tEa "] +["N","tEas "] ["N","tEas "] ["Sp","rk"] ["N","tEas "] +["N","tEas",""] ["N","tEas"," "] ["Sp","rk-"] ["N","tEas",""] + + +-- !query +select substring(c7, 2), substring(c8, 2), substring(v, 3), substring(s, 2) from char_tbl4 +-- !query schema +struct +-- !query output + +NULL NULL NULL +NULL NULL NULL NULL +e e e +et et a et +etE etE ar etE +etEa etEa ark etEa +etEas etEas ark etEas +etEase etEase ark- etEase + + +-- !query +select left(c7, 2), left(c8, 2), left(v, 3), left(s, 2) from char_tbl4 +-- !query schema +struct +-- !query output +N N N N +NULL NULL NULL NULL +NULL NULL S NULL +Ne Ne Sp Ne +Ne Ne Spa Ne +Ne Ne Spa Ne +Ne Ne Spa Ne +Ne Ne Spa Ne +Ne Ne Spa Ne + + +-- !query +select right(c7, 2), right(c8, 2), right(v, 3), right(s, 2) from char_tbl4 +-- !query schema +struct +-- !query output + N N + Sp Ne + a + par tE + rk a +NULL NULL NULL NULL +NULL NULL S NULL +s ark s +se e rk- se + + +-- !query +select typeof(c7), typeof(c8), typeof(v), typeof(s) from char_tbl4 limit 1 +-- !query schema +struct +-- !query output +string string string string + + +-- !query +select cast(c7 as char(1)), cast(c8 as char(10)), cast(v as char(1)), cast(v as varchar(1)), cast(s as char(5)) from char_tbl4 +-- !query schema +struct +-- !query output +N N N N N +NULL NULL NULL NULL NULL +NULL NULL S S NULL +Ne Ne Sp Sp Ne +Net Net Spa Spa Net +NetE NetE Spar Spar NetE +NetEa NetEa Spark Spark NetEa +NetEas NetEas Spark Spark NetEas +NetEase NetEase Spark- Spark- NetEase + + +-- !query +drop table char_tbl1 +-- !query schema +struct<> +-- !query output + + + +-- !query +drop table char_tbl2 +-- !query schema +struct<> +-- !query output + + + +-- !query +drop table char_tbl3 +-- !query schema +struct<> +-- !query output + + + +-- !query +drop table char_tbl4 +-- !query schema +struct<> +-- !query output + diff --git a/sql/core/src/test/resources/sql-tests/results/columnresolution-negative.sql.out b/sql/core/src/test/resources/sql-tests/results/columnresolution-negative.sql.out index 04ddfe0ac128c..994f90c7dfc4d 100644 --- a/sql/core/src/test/resources/sql-tests/results/columnresolution-negative.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/columnresolution-negative.sql.out @@ -161,7 +161,7 @@ SELECT db1.t1.i1 FROM t1, mydb2.t1 struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`db1.t1.i1`' given input columns: [spark_catalog.mydb2.t1.i1, spark_catalog.mydb2.t1.i1]; line 1 pos 7 +cannot resolve 'db1.t1.i1' given input columns: [spark_catalog.mydb2.t1.i1, spark_catalog.mydb2.t1.i1]; line 1 pos 7 -- !query @@ -186,7 +186,7 @@ SELECT mydb1.t1 FROM t1 struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`mydb1.t1`' given input columns: [spark_catalog.mydb1.t1.i1]; line 1 pos 7 +cannot resolve 'mydb1.t1' given input columns: [spark_catalog.mydb1.t1.i1]; line 1 pos 7 -- !query @@ -195,7 +195,7 @@ SELECT t1.x.y.* FROM t1 struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 't1.x.y.*' given input columns 'i1'; +cannot resolve 't1.x.y.*' given input columns 'i1' -- !query @@ -204,7 +204,7 @@ SELECT t1 FROM mydb1.t1 struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`t1`' given input columns: [spark_catalog.mydb1.t1.i1]; line 1 pos 7 +cannot resolve 't1' given input columns: [spark_catalog.mydb1.t1.i1]; line 1 pos 7 -- !query @@ -221,7 +221,7 @@ SELECT mydb1.t1.i1 FROM t1 struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`mydb1.t1.i1`' given input columns: [spark_catalog.mydb2.t1.i1]; line 1 pos 7 +cannot resolve 'mydb1.t1.i1' given input columns: [spark_catalog.mydb2.t1.i1]; line 1 pos 7 -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/comparator.sql.out b/sql/core/src/test/resources/sql-tests/results/comparator.sql.out index 721b56cc1da2f..a19b3228a7f99 100644 --- a/sql/core/src/test/resources/sql-tests/results/comparator.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/comparator.sql.out @@ -21,7 +21,7 @@ true -- !query select '1 ' = 1Y -- !query schema -struct<(CAST(1 AS TINYINT) = 1):boolean> +struct<(1 = 1):boolean> -- !query output true @@ -29,7 +29,7 @@ true -- !query select '\t1 ' = 1Y -- !query schema -struct<(CAST( 1 AS TINYINT) = 1):boolean> +struct<( 1 = 1):boolean> -- !query output true @@ -37,7 +37,7 @@ true -- !query select '1 ' = 1S -- !query schema -struct<(CAST(1 AS SMALLINT) = 1):boolean> +struct<(1 = 1):boolean> -- !query output true @@ -45,7 +45,7 @@ true -- !query select '1 ' = 1 -- !query schema -struct<(CAST(1 AS INT) = 1):boolean> +struct<(1 = 1):boolean> -- !query output true @@ -53,7 +53,7 @@ true -- !query select ' 1' = 1L -- !query schema -struct<(CAST( 1 AS BIGINT) = 1):boolean> +struct<( 1 = 1):boolean> -- !query output true @@ -61,7 +61,7 @@ true -- !query select ' 1' = cast(1.0 as float) -- !query schema -struct<(CAST( 1 AS FLOAT) = CAST(1.0 AS FLOAT)):boolean> +struct<( 1 = CAST(1.0 AS FLOAT)):boolean> -- !query output true @@ -69,7 +69,7 @@ true -- !query select ' 1.0 ' = 1.0D -- !query schema -struct<(CAST( 1.0 AS DOUBLE) = 1.0):boolean> +struct<( 1.0 = 1.0):boolean> -- !query output true @@ -77,6 +77,6 @@ true -- !query select ' 1.0 ' = 1.0BD -- !query schema -struct<(CAST( 1.0 AS DOUBLE) = CAST(1.0 AS DOUBLE)):boolean> +struct<( 1.0 = 1.0):boolean> -- !query output true diff --git a/sql/core/src/test/resources/sql-tests/results/count.sql.out b/sql/core/src/test/resources/sql-tests/results/count.sql.out index 68a5114bb5859..c0a04a1ddffd8 100644 --- a/sql/core/src/test/resources/sql-tests/results/count.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/count.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 5 +-- Number of queries: 21 -- !query @@ -38,18 +38,148 @@ struct +struct -- !query output 4 4 4 -- !query SELECT - count(DISTINCT a, b), count(DISTINCT b, a), count(DISTINCT *), count(DISTINCT testData.*) + count(DISTINCT a, b), count(DISTINCT b, a), count(DISTINCT *), count(DISTINCT testData.*, testData.*) FROM testData -- !query schema -struct +struct -- !query output 3 3 3 3 + + +-- !query +SELECT count(DISTINCT 3,2) +-- !query schema +struct +-- !query output +1 + + +-- !query +SELECT count(DISTINCT 2), count(DISTINCT 2,3) +-- !query schema +struct +-- !query output +1 1 + + +-- !query +SELECT count(DISTINCT 2), count(DISTINCT 3,2) +-- !query schema +struct +-- !query output +1 1 + + +-- !query +SELECT count(DISTINCT a), count(DISTINCT 2,3) FROM testData +-- !query schema +struct +-- !query output +2 1 + + +-- !query +SELECT count(DISTINCT a), count(DISTINCT 3,2) FROM testData +-- !query schema +struct +-- !query output +2 1 + + +-- !query +SELECT count(DISTINCT a), count(DISTINCT 2), count(DISTINCT 2,3) FROM testData +-- !query schema +struct +-- !query output +2 1 1 + + +-- !query +SELECT count(DISTINCT a), count(DISTINCT 2), count(DISTINCT 3,2) FROM testData +-- !query schema +struct +-- !query output +2 1 1 + + +-- !query +SELECT count(distinct 0.8), percentile_approx(distinct a, 0.8) FROM testData +-- !query schema +struct +-- !query output +1 2 + + +-- !query +set spark.sql.legacy.allowParameterlessCount=true +-- !query schema +struct +-- !query output +spark.sql.legacy.allowParameterlessCount true + + +-- !query +SELECT count() FROM testData +-- !query schema +struct +-- !query output +0 + + +-- !query +set spark.sql.legacy.allowParameterlessCount=false +-- !query schema +struct +-- !query output +spark.sql.legacy.allowParameterlessCount false + + +-- !query +SELECT count() FROM testData +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'count()' due to data type mismatch: count requires at least one argument. If you have to call the function count without arguments, set the legacy configuration `spark.sql.legacy.allowParameterlessCount` as true; line 1 pos 7 + + +-- !query +set spark.sql.legacy.allowStarWithSingleTableIdentifierInCount=true +-- !query schema +struct +-- !query output +spark.sql.legacy.allowStarWithSingleTableIdentifierInCount true + + +-- !query +SELECT count(testData.*) FROM testData +-- !query schema +struct +-- !query output +4 + + +-- !query +set spark.sql.legacy.allowStarWithSingleTableIdentifierInCount=false +-- !query schema +struct +-- !query output +spark.sql.legacy.allowStarWithSingleTableIdentifierInCount false + + +-- !query +SELECT count(testData.*) FROM testData +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +count(testData.*) is not allowed. Please use count(*) or expand the columns manually, e.g. count(col1, col2) diff --git a/sql/core/src/test/resources/sql-tests/results/csv-functions.sql.out b/sql/core/src/test/resources/sql-tests/results/csv-functions.sql.out index 1e3173172a528..2ca44d51244a5 100644 --- a/sql/core/src/test/resources/sql-tests/results/csv-functions.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/csv-functions.sql.out @@ -24,7 +24,7 @@ select from_csv('1', 1) struct<> -- !query output org.apache.spark.sql.AnalysisException -The expression '1' is not a valid schema string.;; line 1 pos 7 +The expression '1' is not a valid schema string.; line 1 pos 7 -- !query @@ -33,7 +33,14 @@ select from_csv('1', 'a InvalidType') struct<> -- !query output org.apache.spark.sql.AnalysisException +Cannot parse the data type: +extraneous input 'InvalidType' expecting (line 1, pos 2) +== SQL == +a InvalidType +--^^^ + +Failed fallback parsing: DataType invalidtype is not supported.(line 1, pos 2) == SQL == @@ -48,7 +55,7 @@ select from_csv('1', 'a INT', named_struct('mode', 'PERMISSIVE')) struct<> -- !query output org.apache.spark.sql.AnalysisException -Must use a map() function for options;; line 1 pos 7 +Must use a map() function for options; line 1 pos 7 -- !query @@ -57,7 +64,7 @@ select from_csv('1', 'a INT', map('mode', 1)) struct<> -- !query output org.apache.spark.sql.AnalysisException -A type of keys and values in map() must be string, but got map;; line 1 pos 7 +A type of keys and values in map() must be string, but got map; line 1 pos 7 -- !query @@ -82,7 +89,7 @@ select schema_of_csv('1|abc', map('delimiter', '|')) -- !query schema struct -- !query output -struct<_c0:int,_c1:string> +STRUCT<`_c0`: INT, `_c1`: STRING> -- !query @@ -108,7 +115,7 @@ SELECT schema_of_csv(csvField) FROM csvTable struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'schema_of_csv(csvtable.`csvField`)' due to data type mismatch: The input csv should be a foldable string expression and not null; however, got csvtable.`csvField`.; line 1 pos 7 +cannot resolve 'schema_of_csv(csvtable.csvField)' due to data type mismatch: The input csv should be a foldable string expression and not null; however, got csvtable.csvField.; line 1 pos 7 -- !query @@ -141,7 +148,7 @@ select to_csv(named_struct('a', 1, 'b', 2), named_struct('mode', 'PERMISSIVE')) struct<> -- !query output org.apache.spark.sql.AnalysisException -Must use a map() function for options;; line 1 pos 7 +Must use a map() function for options; line 1 pos 7 -- !query @@ -150,4 +157,4 @@ select to_csv(named_struct('a', 1, 'b', 2), map('mode', 1)) struct<> -- !query output org.apache.spark.sql.AnalysisException -A type of keys and values in map() must be string, but got map;; line 1 pos 7 +A type of keys and values in map() must be string, but got map; line 1 pos 7 diff --git a/sql/core/src/test/resources/sql-tests/results/cte-nested.sql.out b/sql/core/src/test/resources/sql-tests/results/cte-nested.sql.out index 2f736c7b4978f..a8db4599dafcc 100644 --- a/sql/core/src/test/resources/sql-tests/results/cte-nested.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/cte-nested.sql.out @@ -48,7 +48,7 @@ SELECT * FROM t2 struct<> -- !query output org.apache.spark.sql.AnalysisException -Name t is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228.; +Name t is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228. -- !query @@ -85,7 +85,7 @@ SELECT * FROM t2 struct<> -- !query output org.apache.spark.sql.AnalysisException -Name t is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228.; +Name t is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228. -- !query @@ -139,7 +139,7 @@ SELECT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Name t is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228.; +Name t is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228. -- !query @@ -154,7 +154,7 @@ SELECT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Name t is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228.; +Name t is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228. -- !query @@ -170,7 +170,7 @@ SELECT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Name t is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228.; +Name t is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228. -- !query @@ -184,7 +184,7 @@ WHERE c IN ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Name t is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228.; +Name t is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228. -- !query @@ -213,7 +213,7 @@ SELECT * FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Name aBc is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228.; +Name aBc is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228. -- !query @@ -226,4 +226,4 @@ SELECT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Name aBc is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228.; +Name aBc is ambiguous in nested CTE. Please set spark.sql.legacy.ctePrecedencePolicy to CORRECTED so that name defined in inner CTE takes precedence. If set it to LEGACY, outer CTE definitions will take precedence. See more details in SPARK-28228. diff --git a/sql/core/src/test/resources/sql-tests/results/current_database_catalog.sql.out b/sql/core/src/test/resources/sql-tests/results/current_database_catalog.sql.out new file mode 100644 index 0000000000000..b714463a0aa0c --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/current_database_catalog.sql.out @@ -0,0 +1,10 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 1 + + +-- !query +select current_database(), current_catalog() +-- !query schema +struct +-- !query output +default spark_catalog diff --git a/sql/core/src/test/resources/sql-tests/results/datetime-formatting-invalid.sql.out b/sql/core/src/test/resources/sql-tests/results/datetime-formatting-invalid.sql.out new file mode 100644 index 0000000000000..18d1a10068794 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/datetime-formatting-invalid.sql.out @@ -0,0 +1,335 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 37 + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'GGGGG') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'GGGGG' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'yyyyyyy') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'yyyyyyy' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'qqqqq') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Too many pattern letters: q + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'QQQQQ') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Too many pattern letters: Q + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'MMMMM') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'MMMMM' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'LLLLL') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'LLLLL' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'EEEEE') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'EEEEE' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'FF') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'FF' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'ddd') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'ddd' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'DDDD') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'DDDD' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'HHH') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'HHH' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'hhh') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'hhh' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'kkk') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'kkk' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'KKK') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'KKK' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'mmm') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'mmm' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'sss') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'sss' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'SSSSSSSSSS') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'SSSSSSSSSS' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'aa') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'aa' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'V') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Pattern letter count must be 2: V + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'zzzzz') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'zzzzz' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'XXXXXX') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Too many pattern letters: X + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'ZZZZZZ') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'ZZZZZZ' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'OO') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Pattern letter count must be 1 or 4: O + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'xxxxxx') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Too many pattern letters: x + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'A') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Illegal pattern character: A + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'n') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Illegal pattern character: n + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'N') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Illegal pattern character: N + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'p') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Illegal pattern character: p + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'Y') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'Y' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'w') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'w' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'W') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'W' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'u') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'u' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'e') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +All week-based patterns are unsupported since Spark 3.0, detected: e, Please use the SQL function EXTRACT instead + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'c') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +All week-based patterns are unsupported since Spark 3.0, detected: c, Please use the SQL function EXTRACT instead + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'B') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Unknown pattern letter: B + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'C') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Unknown pattern letter: C + + +-- !query +select date_format('2018-11-17 13:33:33.333', 'I') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Unknown pattern letter: I diff --git a/sql/core/src/test/resources/sql-tests/results/datetime-formatting-legacy.sql.out b/sql/core/src/test/resources/sql-tests/results/datetime-formatting-legacy.sql.out new file mode 100644 index 0000000000000..b37922b20807d --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/datetime-formatting-legacy.sql.out @@ -0,0 +1,401 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 31 + + +-- !query +create temporary view v as select col from values + (timestamp '1582-06-01 11:33:33.123UTC+080000'), + (timestamp '1970-01-01 00:00:00.000Europe/Paris'), + (timestamp '1970-12-31 23:59:59.999Asia/Srednekolymsk'), + (timestamp '1996-04-01 00:33:33.123Australia/Darwin'), + (timestamp '2018-11-17 13:33:33.123Z'), + (timestamp '2020-01-01 01:33:33.123Asia/Shanghai'), + (timestamp '2100-01-01 01:33:33.123America/Los_Angeles') t(col) +-- !query schema +struct<> +-- !query output + + + +-- !query +select col, date_format(col, 'G GG GGG GGGG') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 AD AD AD AD +1969-12-31 15:00:00 AD AD AD AD +1970-12-31 04:59:59.999 AD AD AD AD +1996-03-31 07:03:33.123 AD AD AD AD +2018-11-17 05:33:33.123 AD AD AD AD +2019-12-31 09:33:33.123 AD AD AD AD +2100-01-01 01:33:33.123 AD AD AD AD + + +-- !query +select col, date_format(col, 'y yy yyy yyyy yyyyy yyyyyy') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 1582 82 1582 1582 01582 001582 +1969-12-31 15:00:00 1969 69 1969 1969 01969 001969 +1970-12-31 04:59:59.999 1970 70 1970 1970 01970 001970 +1996-03-31 07:03:33.123 1996 96 1996 1996 01996 001996 +2018-11-17 05:33:33.123 2018 18 2018 2018 02018 002018 +2019-12-31 09:33:33.123 2019 19 2019 2019 02019 002019 +2100-01-01 01:33:33.123 2100 00 2100 2100 02100 002100 + + +-- !query +select col, date_format(col, 'q qq') from v +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Illegal pattern character 'q' + + +-- !query +select col, date_format(col, 'Q QQ QQQ QQQQ') from v +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Illegal pattern character 'Q' + + +-- !query +select col, date_format(col, 'M MM MMM MMMM') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 5 05 May May +1969-12-31 15:00:00 12 12 Dec December +1970-12-31 04:59:59.999 12 12 Dec December +1996-03-31 07:03:33.123 3 03 Mar March +2018-11-17 05:33:33.123 11 11 Nov November +2019-12-31 09:33:33.123 12 12 Dec December +2100-01-01 01:33:33.123 1 01 Jan January + + +-- !query +select col, date_format(col, 'L LL') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 5 05 +1969-12-31 15:00:00 12 12 +1970-12-31 04:59:59.999 12 12 +1996-03-31 07:03:33.123 3 03 +2018-11-17 05:33:33.123 11 11 +2019-12-31 09:33:33.123 12 12 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'E EE EEE EEEE') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 Thu Thu Thu Thursday +1969-12-31 15:00:00 Wed Wed Wed Wednesday +1970-12-31 04:59:59.999 Thu Thu Thu Thursday +1996-03-31 07:03:33.123 Sun Sun Sun Sunday +2018-11-17 05:33:33.123 Sat Sat Sat Saturday +2019-12-31 09:33:33.123 Tue Tue Tue Tuesday +2100-01-01 01:33:33.123 Fri Fri Fri Friday + + +-- !query +select col, date_format(col, 'F') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 5 +1969-12-31 15:00:00 5 +1970-12-31 04:59:59.999 5 +1996-03-31 07:03:33.123 5 +2018-11-17 05:33:33.123 3 +2019-12-31 09:33:33.123 5 +2100-01-01 01:33:33.123 1 + + +-- !query +select col, date_format(col, 'd dd') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 31 31 +1969-12-31 15:00:00 31 31 +1970-12-31 04:59:59.999 31 31 +1996-03-31 07:03:33.123 31 31 +2018-11-17 05:33:33.123 17 17 +2019-12-31 09:33:33.123 31 31 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'DD') from v where col = timestamp '2100-01-01 01:33:33.123America/Los_Angeles' +-- !query schema +struct +-- !query output +2100-01-01 01:33:33.123 01 + + +-- !query +select col, date_format(col, 'D DDD') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 151 151 +1969-12-31 15:00:00 365 365 +1970-12-31 04:59:59.999 365 365 +1996-03-31 07:03:33.123 91 091 +2018-11-17 05:33:33.123 321 321 +2019-12-31 09:33:33.123 365 365 +2100-01-01 01:33:33.123 1 001 + + +-- !query +select col, date_format(col, 'H HH') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 19 19 +1969-12-31 15:00:00 15 15 +1970-12-31 04:59:59.999 4 04 +1996-03-31 07:03:33.123 7 07 +2018-11-17 05:33:33.123 5 05 +2019-12-31 09:33:33.123 9 09 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'h hh') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 7 07 +1969-12-31 15:00:00 3 03 +1970-12-31 04:59:59.999 4 04 +1996-03-31 07:03:33.123 7 07 +2018-11-17 05:33:33.123 5 05 +2019-12-31 09:33:33.123 9 09 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'k kk') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 19 19 +1969-12-31 15:00:00 15 15 +1970-12-31 04:59:59.999 4 04 +1996-03-31 07:03:33.123 7 07 +2018-11-17 05:33:33.123 5 05 +2019-12-31 09:33:33.123 9 09 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'K KK') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 7 07 +1969-12-31 15:00:00 3 03 +1970-12-31 04:59:59.999 4 04 +1996-03-31 07:03:33.123 7 07 +2018-11-17 05:33:33.123 5 05 +2019-12-31 09:33:33.123 9 09 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'm mm') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 40 40 +1969-12-31 15:00:00 0 00 +1970-12-31 04:59:59.999 59 59 +1996-03-31 07:03:33.123 3 03 +2018-11-17 05:33:33.123 33 33 +2019-12-31 09:33:33.123 33 33 +2100-01-01 01:33:33.123 33 33 + + +-- !query +select col, date_format(col, 's ss') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 35 35 +1969-12-31 15:00:00 0 00 +1970-12-31 04:59:59.999 59 59 +1996-03-31 07:03:33.123 33 33 +2018-11-17 05:33:33.123 33 33 +2019-12-31 09:33:33.123 33 33 +2100-01-01 01:33:33.123 33 33 + + +-- !query +select col, date_format(col, 'S SS SSS SSSS SSSSS SSSSSS SSSSSSS SSSSSSSS SSSSSSSSS') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 123 123 123 0123 00123 000123 0000123 00000123 000000123 +1969-12-31 15:00:00 0 00 000 0000 00000 000000 0000000 00000000 000000000 +1970-12-31 04:59:59.999 999 999 999 0999 00999 000999 0000999 00000999 000000999 +1996-03-31 07:03:33.123 123 123 123 0123 00123 000123 0000123 00000123 000000123 +2018-11-17 05:33:33.123 123 123 123 0123 00123 000123 0000123 00000123 000000123 +2019-12-31 09:33:33.123 123 123 123 0123 00123 000123 0000123 00000123 000000123 +2100-01-01 01:33:33.123 123 123 123 0123 00123 000123 0000123 00000123 000000123 + + +-- !query +select col, date_format(col, 'a') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 PM +1969-12-31 15:00:00 PM +1970-12-31 04:59:59.999 AM +1996-03-31 07:03:33.123 AM +2018-11-17 05:33:33.123 AM +2019-12-31 09:33:33.123 AM +2100-01-01 01:33:33.123 AM + + +-- !query +select col, date_format(col, 'VV') from v +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Illegal pattern character 'V' + + +-- !query +select col, date_format(col, 'z zz zzz zzzz') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 PST PST PST Pacific Standard Time +1969-12-31 15:00:00 PST PST PST Pacific Standard Time +1970-12-31 04:59:59.999 PST PST PST Pacific Standard Time +1996-03-31 07:03:33.123 PST PST PST Pacific Standard Time +2018-11-17 05:33:33.123 PST PST PST Pacific Standard Time +2019-12-31 09:33:33.123 PST PST PST Pacific Standard Time +2100-01-01 01:33:33.123 PST PST PST Pacific Standard Time + + +-- !query +select col, date_format(col, 'X XX XXX') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 -08 -0800 -08:00 +1969-12-31 15:00:00 -08 -0800 -08:00 +1970-12-31 04:59:59.999 -08 -0800 -08:00 +1996-03-31 07:03:33.123 -08 -0800 -08:00 +2018-11-17 05:33:33.123 -08 -0800 -08:00 +2019-12-31 09:33:33.123 -08 -0800 -08:00 +2100-01-01 01:33:33.123 -08 -0800 -08:00 + + +-- !query +select col, date_format(col, 'XXXX XXXXX') from v +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +invalid ISO 8601 format: length=4 + + +-- !query +select col, date_format(col, 'Z ZZ ZZZ ZZZZ ZZZZZ') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 -0800 -0800 -0800 -0800 -0800 +1969-12-31 15:00:00 -0800 -0800 -0800 -0800 -0800 +1970-12-31 04:59:59.999 -0800 -0800 -0800 -0800 -0800 +1996-03-31 07:03:33.123 -0800 -0800 -0800 -0800 -0800 +2018-11-17 05:33:33.123 -0800 -0800 -0800 -0800 -0800 +2019-12-31 09:33:33.123 -0800 -0800 -0800 -0800 -0800 +2100-01-01 01:33:33.123 -0800 -0800 -0800 -0800 -0800 + + +-- !query +select col, date_format(col, 'O OOOO') from v +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Illegal pattern character 'O' + + +-- !query +select col, date_format(col, 'x xx xxx xxxx xxxx xxxxx') from v +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Illegal pattern character 'x' + + +-- !query +select col, date_format(col, '[yyyy-MM-dd HH:mm:ss]') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 [1582-05-31 19:40:35] +1969-12-31 15:00:00 [1969-12-31 15:00:00] +1970-12-31 04:59:59.999 [1970-12-31 04:59:59] +1996-03-31 07:03:33.123 [1996-03-31 07:03:33] +2018-11-17 05:33:33.123 [2018-11-17 05:33:33] +2019-12-31 09:33:33.123 [2019-12-31 09:33:33] +2100-01-01 01:33:33.123 [2100-01-01 01:33:33] + + +-- !query +select col, date_format(col, "姚123'GyYqQMLwWuEFDdhHmsSaVzZxXOV'") from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV +1969-12-31 15:00:00 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV +1970-12-31 04:59:59.999 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV +1996-03-31 07:03:33.123 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV +2018-11-17 05:33:33.123 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV +2019-12-31 09:33:33.123 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV +2100-01-01 01:33:33.123 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV + + +-- !query +select col, date_format(col, "''") from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 ' +1969-12-31 15:00:00 ' +1970-12-31 04:59:59.999 ' +1996-03-31 07:03:33.123 ' +2018-11-17 05:33:33.123 ' +2019-12-31 09:33:33.123 ' +2100-01-01 01:33:33.123 ' + + +-- !query +select col, date_format(col, '') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 +1969-12-31 15:00:00 +1970-12-31 04:59:59.999 +1996-03-31 07:03:33.123 +2018-11-17 05:33:33.123 +2019-12-31 09:33:33.123 +2100-01-01 01:33:33.123 diff --git a/sql/core/src/test/resources/sql-tests/results/datetime-formatting.sql.out b/sql/core/src/test/resources/sql-tests/results/datetime-formatting.sql.out new file mode 100644 index 0000000000000..5bed88e168f1e --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/datetime-formatting.sql.out @@ -0,0 +1,431 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 31 + + +-- !query +create temporary view v as select col from values + (timestamp '1582-06-01 11:33:33.123UTC+080000'), + (timestamp '1970-01-01 00:00:00.000Europe/Paris'), + (timestamp '1970-12-31 23:59:59.999Asia/Srednekolymsk'), + (timestamp '1996-04-01 00:33:33.123Australia/Darwin'), + (timestamp '2018-11-17 13:33:33.123Z'), + (timestamp '2020-01-01 01:33:33.123Asia/Shanghai'), + (timestamp '2100-01-01 01:33:33.123America/Los_Angeles') t(col) +-- !query schema +struct<> +-- !query output + + + +-- !query +select col, date_format(col, 'G GG GGG GGGG') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 AD AD AD Anno Domini +1969-12-31 15:00:00 AD AD AD Anno Domini +1970-12-31 04:59:59.999 AD AD AD Anno Domini +1996-03-31 07:03:33.123 AD AD AD Anno Domini +2018-11-17 05:33:33.123 AD AD AD Anno Domini +2019-12-31 09:33:33.123 AD AD AD Anno Domini +2100-01-01 01:33:33.123 AD AD AD Anno Domini + + +-- !query +select col, date_format(col, 'y yy yyy yyyy yyyyy yyyyyy') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 1582 82 1582 1582 01582 001582 +1969-12-31 15:00:00 1969 69 1969 1969 01969 001969 +1970-12-31 04:59:59.999 1970 70 1970 1970 01970 001970 +1996-03-31 07:03:33.123 1996 96 1996 1996 01996 001996 +2018-11-17 05:33:33.123 2018 18 2018 2018 02018 002018 +2019-12-31 09:33:33.123 2019 19 2019 2019 02019 002019 +2100-01-01 01:33:33.123 2100 00 2100 2100 02100 002100 + + +-- !query +select col, date_format(col, 'q qq') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 2 02 +1969-12-31 15:00:00 4 04 +1970-12-31 04:59:59.999 4 04 +1996-03-31 07:03:33.123 1 01 +2018-11-17 05:33:33.123 4 04 +2019-12-31 09:33:33.123 4 04 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'Q QQ QQQ QQQQ') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 2 02 Q2 2nd quarter +1969-12-31 15:00:00 4 04 Q4 4th quarter +1970-12-31 04:59:59.999 4 04 Q4 4th quarter +1996-03-31 07:03:33.123 1 01 Q1 1st quarter +2018-11-17 05:33:33.123 4 04 Q4 4th quarter +2019-12-31 09:33:33.123 4 04 Q4 4th quarter +2100-01-01 01:33:33.123 1 01 Q1 1st quarter + + +-- !query +select col, date_format(col, 'M MM MMM MMMM') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 5 05 May May +1969-12-31 15:00:00 12 12 Dec December +1970-12-31 04:59:59.999 12 12 Dec December +1996-03-31 07:03:33.123 3 03 Mar March +2018-11-17 05:33:33.123 11 11 Nov November +2019-12-31 09:33:33.123 12 12 Dec December +2100-01-01 01:33:33.123 1 01 Jan January + + +-- !query +select col, date_format(col, 'L LL') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 5 05 +1969-12-31 15:00:00 12 12 +1970-12-31 04:59:59.999 12 12 +1996-03-31 07:03:33.123 3 03 +2018-11-17 05:33:33.123 11 11 +2019-12-31 09:33:33.123 12 12 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'E EE EEE EEEE') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 Mon Mon Mon Monday +1969-12-31 15:00:00 Wed Wed Wed Wednesday +1970-12-31 04:59:59.999 Thu Thu Thu Thursday +1996-03-31 07:03:33.123 Sun Sun Sun Sunday +2018-11-17 05:33:33.123 Sat Sat Sat Saturday +2019-12-31 09:33:33.123 Tue Tue Tue Tuesday +2100-01-01 01:33:33.123 Fri Fri Fri Friday + + +-- !query +select col, date_format(col, 'F') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 3 +1969-12-31 15:00:00 3 +1970-12-31 04:59:59.999 3 +1996-03-31 07:03:33.123 3 +2018-11-17 05:33:33.123 3 +2019-12-31 09:33:33.123 3 +2100-01-01 01:33:33.123 1 + + +-- !query +select col, date_format(col, 'd dd') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 31 31 +1969-12-31 15:00:00 31 31 +1970-12-31 04:59:59.999 31 31 +1996-03-31 07:03:33.123 31 31 +2018-11-17 05:33:33.123 17 17 +2019-12-31 09:33:33.123 31 31 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'DD') from v where col = timestamp '2100-01-01 01:33:33.123America/Los_Angeles' +-- !query schema +struct +-- !query output +2100-01-01 01:33:33.123 01 + + +-- !query +select col, date_format(col, 'D DDD') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 151 151 +1969-12-31 15:00:00 365 365 +1970-12-31 04:59:59.999 365 365 +1996-03-31 07:03:33.123 91 091 +2018-11-17 05:33:33.123 321 321 +2019-12-31 09:33:33.123 365 365 +2100-01-01 01:33:33.123 1 001 + + +-- !query +select col, date_format(col, 'H HH') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 19 19 +1969-12-31 15:00:00 15 15 +1970-12-31 04:59:59.999 4 04 +1996-03-31 07:03:33.123 7 07 +2018-11-17 05:33:33.123 5 05 +2019-12-31 09:33:33.123 9 09 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'h hh') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 7 07 +1969-12-31 15:00:00 3 03 +1970-12-31 04:59:59.999 4 04 +1996-03-31 07:03:33.123 7 07 +2018-11-17 05:33:33.123 5 05 +2019-12-31 09:33:33.123 9 09 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'k kk') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 19 19 +1969-12-31 15:00:00 15 15 +1970-12-31 04:59:59.999 4 04 +1996-03-31 07:03:33.123 7 07 +2018-11-17 05:33:33.123 5 05 +2019-12-31 09:33:33.123 9 09 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'K KK') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 7 07 +1969-12-31 15:00:00 3 03 +1970-12-31 04:59:59.999 4 04 +1996-03-31 07:03:33.123 7 07 +2018-11-17 05:33:33.123 5 05 +2019-12-31 09:33:33.123 9 09 +2100-01-01 01:33:33.123 1 01 + + +-- !query +select col, date_format(col, 'm mm') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 40 40 +1969-12-31 15:00:00 0 00 +1970-12-31 04:59:59.999 59 59 +1996-03-31 07:03:33.123 3 03 +2018-11-17 05:33:33.123 33 33 +2019-12-31 09:33:33.123 33 33 +2100-01-01 01:33:33.123 33 33 + + +-- !query +select col, date_format(col, 's ss') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 35 35 +1969-12-31 15:00:00 0 00 +1970-12-31 04:59:59.999 59 59 +1996-03-31 07:03:33.123 33 33 +2018-11-17 05:33:33.123 33 33 +2019-12-31 09:33:33.123 33 33 +2100-01-01 01:33:33.123 33 33 + + +-- !query +select col, date_format(col, 'S SS SSS SSSS SSSSS SSSSSS SSSSSSS SSSSSSSS SSSSSSSSS') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 1 12 123 1230 12300 123000 1230000 12300000 123000000 +1969-12-31 15:00:00 0 00 000 0000 00000 000000 0000000 00000000 000000000 +1970-12-31 04:59:59.999 9 99 999 9990 99900 999000 9990000 99900000 999000000 +1996-03-31 07:03:33.123 1 12 123 1230 12300 123000 1230000 12300000 123000000 +2018-11-17 05:33:33.123 1 12 123 1230 12300 123000 1230000 12300000 123000000 +2019-12-31 09:33:33.123 1 12 123 1230 12300 123000 1230000 12300000 123000000 +2100-01-01 01:33:33.123 1 12 123 1230 12300 123000 1230000 12300000 123000000 + + +-- !query +select col, date_format(col, 'a') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 PM +1969-12-31 15:00:00 PM +1970-12-31 04:59:59.999 AM +1996-03-31 07:03:33.123 AM +2018-11-17 05:33:33.123 AM +2019-12-31 09:33:33.123 AM +2100-01-01 01:33:33.123 AM + + +-- !query +select col, date_format(col, 'VV') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 America/Los_Angeles +1969-12-31 15:00:00 America/Los_Angeles +1970-12-31 04:59:59.999 America/Los_Angeles +1996-03-31 07:03:33.123 America/Los_Angeles +2018-11-17 05:33:33.123 America/Los_Angeles +2019-12-31 09:33:33.123 America/Los_Angeles +2100-01-01 01:33:33.123 America/Los_Angeles + + +-- !query +select col, date_format(col, 'z zz zzz zzzz') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 PST PST PST Pacific Standard Time +1969-12-31 15:00:00 PST PST PST Pacific Standard Time +1970-12-31 04:59:59.999 PST PST PST Pacific Standard Time +1996-03-31 07:03:33.123 PST PST PST Pacific Standard Time +2018-11-17 05:33:33.123 PST PST PST Pacific Standard Time +2019-12-31 09:33:33.123 PST PST PST Pacific Standard Time +2100-01-01 01:33:33.123 PST PST PST Pacific Standard Time + + +-- !query +select col, date_format(col, 'X XX XXX') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 -0752 -0752 -07:52 +1969-12-31 15:00:00 -08 -0800 -08:00 +1970-12-31 04:59:59.999 -08 -0800 -08:00 +1996-03-31 07:03:33.123 -08 -0800 -08:00 +2018-11-17 05:33:33.123 -08 -0800 -08:00 +2019-12-31 09:33:33.123 -08 -0800 -08:00 +2100-01-01 01:33:33.123 -08 -0800 -08:00 + + +-- !query +select col, date_format(col, 'XXXX XXXXX') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 -075258 -07:52:58 +1969-12-31 15:00:00 -0800 -08:00 +1970-12-31 04:59:59.999 -0800 -08:00 +1996-03-31 07:03:33.123 -0800 -08:00 +2018-11-17 05:33:33.123 -0800 -08:00 +2019-12-31 09:33:33.123 -0800 -08:00 +2100-01-01 01:33:33.123 -0800 -08:00 + + +-- !query +select col, date_format(col, 'Z ZZ ZZZ ZZZZ ZZZZZ') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 -0752 -0752 -0752 GMT-07:52:58 -07:52:58 +1969-12-31 15:00:00 -0800 -0800 -0800 GMT-08:00 -08:00 +1970-12-31 04:59:59.999 -0800 -0800 -0800 GMT-08:00 -08:00 +1996-03-31 07:03:33.123 -0800 -0800 -0800 GMT-08:00 -08:00 +2018-11-17 05:33:33.123 -0800 -0800 -0800 GMT-08:00 -08:00 +2019-12-31 09:33:33.123 -0800 -0800 -0800 GMT-08:00 -08:00 +2100-01-01 01:33:33.123 -0800 -0800 -0800 GMT-08:00 -08:00 + + +-- !query +select col, date_format(col, 'O OOOO') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 GMT-7:52:58 GMT-07:52:58 +1969-12-31 15:00:00 GMT-8 GMT-08:00 +1970-12-31 04:59:59.999 GMT-8 GMT-08:00 +1996-03-31 07:03:33.123 GMT-8 GMT-08:00 +2018-11-17 05:33:33.123 GMT-8 GMT-08:00 +2019-12-31 09:33:33.123 GMT-8 GMT-08:00 +2100-01-01 01:33:33.123 GMT-8 GMT-08:00 + + +-- !query +select col, date_format(col, 'x xx xxx xxxx xxxx xxxxx') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 -0752 -0752 -07:52 -075258 -075258 -07:52:58 +1969-12-31 15:00:00 -08 -0800 -08:00 -0800 -0800 -08:00 +1970-12-31 04:59:59.999 -08 -0800 -08:00 -0800 -0800 -08:00 +1996-03-31 07:03:33.123 -08 -0800 -08:00 -0800 -0800 -08:00 +2018-11-17 05:33:33.123 -08 -0800 -08:00 -0800 -0800 -08:00 +2019-12-31 09:33:33.123 -08 -0800 -08:00 -0800 -0800 -08:00 +2100-01-01 01:33:33.123 -08 -0800 -08:00 -0800 -0800 -08:00 + + +-- !query +select col, date_format(col, '[yyyy-MM-dd HH:mm:ss]') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 1582-05-31 19:40:35 +1969-12-31 15:00:00 1969-12-31 15:00:00 +1970-12-31 04:59:59.999 1970-12-31 04:59:59 +1996-03-31 07:03:33.123 1996-03-31 07:03:33 +2018-11-17 05:33:33.123 2018-11-17 05:33:33 +2019-12-31 09:33:33.123 2019-12-31 09:33:33 +2100-01-01 01:33:33.123 2100-01-01 01:33:33 + + +-- !query +select col, date_format(col, "姚123'GyYqQMLwWuEFDdhHmsSaVzZxXOV'") from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV +1969-12-31 15:00:00 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV +1970-12-31 04:59:59.999 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV +1996-03-31 07:03:33.123 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV +2018-11-17 05:33:33.123 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV +2019-12-31 09:33:33.123 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV +2100-01-01 01:33:33.123 姚123GyYqQMLwWuEFDdhHmsSaVzZxXOV + + +-- !query +select col, date_format(col, "''") from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 ' +1969-12-31 15:00:00 ' +1970-12-31 04:59:59.999 ' +1996-03-31 07:03:33.123 ' +2018-11-17 05:33:33.123 ' +2019-12-31 09:33:33.123 ' +2100-01-01 01:33:33.123 ' + + +-- !query +select col, date_format(col, '') from v +-- !query schema +struct +-- !query output +1582-05-31 19:40:35.123 +1969-12-31 15:00:00 +1970-12-31 04:59:59.999 +1996-03-31 07:03:33.123 +2018-11-17 05:33:33.123 +2019-12-31 09:33:33.123 +2100-01-01 01:33:33.123 diff --git a/sql/core/src/test/resources/sql-tests/results/datetime-legacy.sql.out b/sql/core/src/test/resources/sql-tests/results/datetime-legacy.sql.out new file mode 100644 index 0000000000000..aaa1c469147b4 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/datetime-legacy.sql.out @@ -0,0 +1,1063 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 128 + + +-- !query +select TIMESTAMP_SECONDS(1230219000),TIMESTAMP_SECONDS(-1230219000),TIMESTAMP_SECONDS(null) +-- !query schema +struct +-- !query output +2008-12-25 07:30:00 1931-01-07 00:30:00 NULL + + +-- !query +select TIMESTAMP_SECONDS(1.23), TIMESTAMP_SECONDS(1.23d), TIMESTAMP_SECONDS(FLOAT(1.23)) +-- !query schema +struct +-- !query output +1969-12-31 16:00:01.23 1969-12-31 16:00:01.23 1969-12-31 16:00:01.23 + + +-- !query +select TIMESTAMP_MILLIS(1230219000123),TIMESTAMP_MILLIS(-1230219000123),TIMESTAMP_MILLIS(null) +-- !query schema +struct +-- !query output +2008-12-25 07:30:00.123 1931-01-07 00:29:59.877 NULL + + +-- !query +select TIMESTAMP_MICROS(1230219000123123),TIMESTAMP_MICROS(-1230219000123123),TIMESTAMP_MICROS(null) +-- !query schema +struct +-- !query output +2008-12-25 07:30:00.123123 1931-01-07 00:29:59.876877 NULL + + +-- !query +select TIMESTAMP_SECONDS(1230219000123123) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select TIMESTAMP_SECONDS(-1230219000123123) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select TIMESTAMP_MILLIS(92233720368547758) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select TIMESTAMP_MILLIS(-92233720368547758) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select TIMESTAMP_SECONDS(0.1234567) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Rounding necessary + + +-- !query +select TIMESTAMP_SECONDS(0.1234567d), TIMESTAMP_SECONDS(FLOAT(0.1234567)) +-- !query schema +struct +-- !query output +1969-12-31 16:00:00.123456 1969-12-31 16:00:00.123456 + + +-- !query +select UNIX_SECONDS(TIMESTAMP('2020-12-01 14:30:08Z')), UNIX_SECONDS(TIMESTAMP('2020-12-01 14:30:08.999999Z')), UNIX_SECONDS(null) +-- !query schema +struct +-- !query output +1606833008 1606833008 NULL + + +-- !query +select UNIX_MILLIS(TIMESTAMP('2020-12-01 14:30:08Z')), UNIX_MILLIS(TIMESTAMP('2020-12-01 14:30:08.999999Z')), UNIX_MILLIS(null) +-- !query schema +struct +-- !query output +1606833008000 1606833008999 NULL + + +-- !query +select UNIX_MICROS(TIMESTAMP('2020-12-01 14:30:08Z')), UNIX_MICROS(TIMESTAMP('2020-12-01 14:30:08.999999Z')), UNIX_MICROS(null) +-- !query schema +struct +-- !query output +1606833008000000 1606833008999999 NULL + + +-- !query +select DATE_FROM_UNIX_DATE(0), DATE_FROM_UNIX_DATE(1000), DATE_FROM_UNIX_DATE(null) +-- !query schema +struct +-- !query output +1970-01-01 1972-09-27 NULL + + +-- !query +select UNIX_DATE(DATE('1970-01-01')), UNIX_DATE(DATE('2020-12-04')), UNIX_DATE(null) +-- !query schema +struct +-- !query output +0 18600 NULL + + +-- !query +select current_date = current_date(), current_timestamp = current_timestamp() +-- !query schema +struct<(current_date() = current_date()):boolean,(current_timestamp() = current_timestamp()):boolean> +-- !query output +true true + + +-- !query +select to_date(null), to_date('2016-12-31'), to_date('2016-12-31', 'yyyy-MM-dd') +-- !query schema +struct +-- !query output +NULL 2016-12-31 2016-12-31 + + +-- !query +select to_timestamp(null), to_timestamp('2016-12-31 00:12:00'), to_timestamp('2016-12-31', 'yyyy-MM-dd') +-- !query schema +struct +-- !query output +NULL 2016-12-31 00:12:00 2016-12-31 00:00:00 + + +-- !query +select dayofweek('2007-02-03'), dayofweek('2009-07-30'), dayofweek('2017-05-27'), dayofweek(null), dayofweek('1582-10-15 13:10:15') +-- !query schema +struct +-- !query output +7 5 7 NULL 6 + + +-- !query +create temporary view ttf1 as select * from values + (1, 2), + (2, 3) + as ttf1(current_date, current_timestamp) +-- !query schema +struct<> +-- !query output + + + +-- !query +select current_date, current_timestamp from ttf1 +-- !query schema +struct +-- !query output +1 2 +2 3 + + +-- !query +create temporary view ttf2 as select * from values + (1, 2), + (2, 3) + as ttf2(a, b) +-- !query schema +struct<> +-- !query output + + + +-- !query +select current_date = current_date(), current_timestamp = current_timestamp(), a, b from ttf2 +-- !query schema +struct<(current_date() = current_date()):boolean,(current_timestamp() = current_timestamp()):boolean,a:int,b:int> +-- !query output +true true 1 2 +true true 2 3 + + +-- !query +select a, b from ttf2 order by a, current_date +-- !query schema +struct +-- !query output +1 2 +2 3 + + +-- !query +select weekday('2007-02-03'), weekday('2009-07-30'), weekday('2017-05-27'), weekday(null), weekday('1582-10-15 13:10:15') +-- !query schema +struct +-- !query output +5 3 5 NULL 4 + + +-- !query +select year('1500-01-01'), month('1500-01-01'), dayOfYear('1500-01-01') +-- !query schema +struct +-- !query output +1500 1 1 + + +-- !query +select date '2019-01-01\t' +-- !query schema +struct +-- !query output +2019-01-01 + + +-- !query +select timestamp '2019-01-01\t' +-- !query schema +struct +-- !query output +2019-01-01 00:00:00 + + +-- !query +select date '2020-01-01中文' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the DATE value: 2020-01-01中文(line 1, pos 7) + +== SQL == +select date '2020-01-01中文' +-------^^^ + + +-- !query +select timestamp '2019-01-01中文' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the TIMESTAMP value: 2019-01-01中文(line 1, pos 7) + +== SQL == +select timestamp '2019-01-01中文' +-------^^^ + + +-- !query +select timestamp'2011-11-11 11:11:11' + interval '2' day +-- !query schema +struct +-- !query output +2011-11-13 11:11:11 + + +-- !query +select timestamp'2011-11-11 11:11:11' - interval '2' day +-- !query schema +struct +-- !query output +2011-11-09 11:11:11 + + +-- !query +select date'2011-11-11 11:11:11' + interval '2' second +-- !query schema +struct +-- !query output +2011-11-11 + + +-- !query +select date'2011-11-11 11:11:11' - interval '2' second +-- !query schema +struct +-- !query output +2011-11-10 + + +-- !query +select '2011-11-11' - interval '2' day +-- !query schema +struct<2011-11-11 - INTERVAL '2 days':string> +-- !query output +2011-11-09 00:00:00 + + +-- !query +select '2011-11-11 11:11:11' - interval '2' second +-- !query schema +struct<2011-11-11 11:11:11 - INTERVAL '2 seconds':string> +-- !query output +2011-11-11 11:11:09 + + +-- !query +select '1' - interval '2' second +-- !query schema +struct<1 - INTERVAL '2 seconds':string> +-- !query output +NULL + + +-- !query +select 1 - interval '2' second +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve '1 + (- INTERVAL '2 seconds')' due to data type mismatch: argument 1 requires timestamp type, however, '1' is of int type.; line 1 pos 7 + + +-- !query +select date'2020-01-01' - timestamp'2019-10-06 10:11:12.345678' +-- !query schema +struct<(DATE '2020-01-01' - TIMESTAMP '2019-10-06 10:11:12.345678'):interval day to second> +-- !query output +86 13:48:47.654322000 + + +-- !query +select timestamp'2019-10-06 10:11:12.345678' - date'2020-01-01' +-- !query schema +struct<(TIMESTAMP '2019-10-06 10:11:12.345678' - DATE '2020-01-01'):interval day to second> +-- !query output +-86 13:48:47.654322000 + + +-- !query +select timestamp'2019-10-06 10:11:12.345678' - null +-- !query schema +struct<(TIMESTAMP '2019-10-06 10:11:12.345678' - NULL):interval day to second> +-- !query output +NULL + + +-- !query +select null - timestamp'2019-10-06 10:11:12.345678' +-- !query schema +struct<(NULL - TIMESTAMP '2019-10-06 10:11:12.345678'):interval day to second> +-- !query output +NULL + + +-- !query +select date_add('2011-11-11', 1Y) +-- !query schema +struct +-- !query output +2011-11-12 + + +-- !query +select date_add('2011-11-11', 1S) +-- !query schema +struct +-- !query output +2011-11-12 + + +-- !query +select date_add('2011-11-11', 1) +-- !query schema +struct +-- !query output +2011-11-12 + + +-- !query +select date_add('2011-11-11', 1L) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'date_add(CAST('2011-11-11' AS DATE), 1L)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, '1L' is of bigint type.; line 1 pos 7 + + +-- !query +select date_add('2011-11-11', 1.0) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'date_add(CAST('2011-11-11' AS DATE), 1.0BD)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, '1.0BD' is of decimal(2,1) type.; line 1 pos 7 + + +-- !query +select date_add('2011-11-11', 1E1) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'date_add(CAST('2011-11-11' AS DATE), 10.0D)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, '10.0D' is of double type.; line 1 pos 7 + + +-- !query +select date_add('2011-11-11', '1') +-- !query schema +struct +-- !query output +2011-11-12 + + +-- !query +select date_add('2011-11-11', '1.2') +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +The second argument of 'date_add' function needs to be an integer. + + +-- !query +select date_add(date'2011-11-11', 1) +-- !query schema +struct +-- !query output +2011-11-12 + + +-- !query +select date_add(timestamp'2011-11-11', 1) +-- !query schema +struct +-- !query output +2011-11-12 + + +-- !query +select date_sub(date'2011-11-11', 1) +-- !query schema +struct +-- !query output +2011-11-10 + + +-- !query +select date_sub(date'2011-11-11', '1') +-- !query schema +struct +-- !query output +2011-11-10 + + +-- !query +select date_sub(date'2011-11-11', '1.2') +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +The second argument of 'date_sub' function needs to be an integer. + + +-- !query +select date_sub(timestamp'2011-11-11', 1) +-- !query schema +struct +-- !query output +2011-11-10 + + +-- !query +select date_sub(null, 1) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select date_sub(date'2011-11-11', null) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select date'2011-11-11' + 1E1 +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'date_add(DATE '2011-11-11', 10.0D)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, '10.0D' is of double type.; line 1 pos 7 + + +-- !query +select date'2011-11-11' + '1' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'date_add(DATE '2011-11-11', CAST('1' AS DOUBLE))' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'CAST('1' AS DOUBLE)' is of double type.; line 1 pos 7 + + +-- !query +select null + date '2001-09-28' +-- !query schema +struct +-- !query output +NULL + + +-- !query +select date '2001-09-28' + 7Y +-- !query schema +struct +-- !query output +2001-10-05 + + +-- !query +select 7S + date '2001-09-28' +-- !query schema +struct +-- !query output +2001-10-05 + + +-- !query +select date '2001-10-01' - 7 +-- !query schema +struct +-- !query output +2001-09-24 + + +-- !query +select date '2001-10-01' - '7' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'date_sub(DATE '2001-10-01', CAST('7' AS DOUBLE))' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'CAST('7' AS DOUBLE)' is of double type.; line 1 pos 7 + + +-- !query +select date '2001-09-28' + null +-- !query schema +struct +-- !query output +NULL + + +-- !query +select date '2001-09-28' - null +-- !query schema +struct +-- !query output +NULL + + +-- !query +create temp view v as select '1' str +-- !query schema +struct<> +-- !query output + + + +-- !query +select date_add('2011-11-11', str) from v +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'date_add(CAST('2011-11-11' AS DATE), v.str)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'v.str' is of string type.; line 1 pos 7 + + +-- !query +select date_sub('2011-11-11', str) from v +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'date_sub(CAST('2011-11-11' AS DATE), v.str)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'v.str' is of string type.; line 1 pos 7 + + +-- !query +select null - date '2019-10-06' +-- !query schema +struct<(NULL - DATE '2019-10-06'):interval day to second> +-- !query output +NULL + + +-- !query +select date '2001-10-01' - date '2001-09-28' +-- !query schema +struct<(DATE '2001-10-01' - DATE '2001-09-28'):interval day to second> +-- !query output +3 00:00:00.000000000 + + +-- !query +select to_timestamp('2019-10-06 10:11:12.', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11:12.0', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11:12.1', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11:12.12', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11:12.123UTC', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11:12.1234', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11:12.12345CST', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11:12.123456PST', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11:12.1234567PST', 'yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('123456 2019-10-06 10:11:12.123456PST', 'SSSSSS yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('223456 2019-10-06 10:11:12.123456PST', 'SSSSSS yyyy-MM-dd HH:mm:ss.SSSSSS[zzz]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11:12.1234', 'yyyy-MM-dd HH:mm:ss.[SSSSSS]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11:12.123', 'yyyy-MM-dd HH:mm:ss[.SSSSSS]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11:12', 'yyyy-MM-dd HH:mm:ss[.SSSSSS]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11:12.12', 'yyyy-MM-dd HH:mm[:ss.SSSSSS]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-10-06 10:11', 'yyyy-MM-dd HH:mm[:ss.SSSSSS]') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp("2019-10-06S10:11:12.12345", "yyyy-MM-dd'S'HH:mm:ss.SSSSSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp("12.12342019-10-06S10:11", "ss.SSSSyyyy-MM-dd'S'HH:mm") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp("12.1232019-10-06S10:11", "ss.SSSSyyyy-MM-dd'S'HH:mm") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp("12.1232019-10-06S10:11", "ss.SSSSyy-MM-dd'S'HH:mm") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp("12.1234019-10-06S10:11", "ss.SSSSy-MM-dd'S'HH:mm") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp("2019-10-06S", "yyyy-MM-dd'S'") +-- !query schema +struct +-- !query output +2019-10-06 00:00:00 + + +-- !query +select to_timestamp("S2019-10-06", "'S'yyyy-MM-dd") +-- !query schema +struct +-- !query output +2019-10-06 00:00:00 + + +-- !query +select to_timestamp("2019-10-06T10:11:12'12", "yyyy-MM-dd'T'HH:mm:ss''SSSS") +-- !query schema +struct +-- !query output +2019-10-06 10:11:12.012 + + +-- !query +select to_timestamp("2019-10-06T10:11:12'", "yyyy-MM-dd'T'HH:mm:ss''") +-- !query schema +struct +-- !query output +2019-10-06 10:11:12 + + +-- !query +select to_timestamp("'2019-10-06T10:11:12", "''yyyy-MM-dd'T'HH:mm:ss") +-- !query schema +struct +-- !query output +2019-10-06 10:11:12 + + +-- !query +select to_timestamp("P2019-10-06T10:11:12", "'P'yyyy-MM-dd'T'HH:mm:ss") +-- !query schema +struct +-- !query output +2019-10-06 10:11:12 + + +-- !query +select to_timestamp("16", "dd") +-- !query schema +struct +-- !query output +1970-01-16 00:00:00 + + +-- !query +select to_timestamp("02-29", "MM-dd") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_date("16", "dd") +-- !query schema +struct +-- !query output +1970-01-16 + + +-- !query +select to_date("02-29", "MM-dd") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp("2019 40", "yyyy mm") +-- !query schema +struct +-- !query output +2019-01-01 00:40:00 + + +-- !query +select to_timestamp("2019 10:10:10", "yyyy hh:mm:ss") +-- !query schema +struct +-- !query output +2019-01-01 10:10:10 + + +-- !query +select to_timestamp('2019-10-06 A', 'yyyy-MM-dd GGGGG') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEEE') +-- !query schema +struct +-- !query output +2020-05-22 00:00:00 + + +-- !query +select to_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEE') +-- !query schema +struct +-- !query output +2020-05-22 00:00:00 + + +-- !query +select unix_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEE') +-- !query schema +struct +-- !query output +1590130800 + + +-- !query +select from_json('{"t":"26/October/2015"}', 't Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy')) +-- !query schema +struct> +-- !query output +{"t":2015-10-26 00:00:00} + + +-- !query +select from_json('{"d":"26/October/2015"}', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy')) +-- !query schema +struct> +-- !query output +{"d":2015-10-26} + + +-- !query +select from_csv('26/October/2015', 't Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy')) +-- !query schema +struct> +-- !query output +{"t":2015-10-26 00:00:00} + + +-- !query +select from_csv('26/October/2015', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy')) +-- !query schema +struct> +-- !query output +{"d":2015-10-26} + + +-- !query +select to_date("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_date("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select unix_timestamp("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select unix_timestamp("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_unix_timestamp("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_unix_timestamp("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select cast("Unparseable" as timestamp) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select cast("Unparseable" as date) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select next_day("2015-07-23", "Mon") +-- !query schema +struct +-- !query output +2015-07-27 + + +-- !query +select next_day("2015-07-23", "xx") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select next_day("xx", "Mon") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select next_day(null, "Mon") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select next_day(null, "xx") +-- !query schema +struct +-- !query output +NULL diff --git a/sql/core/src/test/resources/sql-tests/results/datetime-parsing-invalid.sql.out b/sql/core/src/test/resources/sql-tests/results/datetime-parsing-invalid.sql.out new file mode 100644 index 0000000000000..c11f5f39bebd0 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/datetime-parsing-invalid.sql.out @@ -0,0 +1,163 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 19 + + +-- !query +select to_timestamp('294248', 'y') +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select to_timestamp('1', 'yy') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to parse '1' in the new parser. You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0, or set to CORRECTED and treat it as an invalid datetime string. + + +-- !query +select to_timestamp('-12', 'yy') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('123', 'yy') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to parse '123' in the new parser. You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0, or set to CORRECTED and treat it as an invalid datetime string. + + +-- !query +select to_timestamp('1', 'yyy') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to parse '1' in the new parser. You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0, or set to CORRECTED and treat it as an invalid datetime string. + + +-- !query +select to_timestamp('1234567', 'yyyyyyy') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'yyyyyyy' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select to_timestamp('366', 'D') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('9', 'DD') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to parse '9' in the new parser. You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0, or set to CORRECTED and treat it as an invalid datetime string. + + +-- !query +select to_timestamp('366', 'DD') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('9', 'DDD') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to parse '9' in the new parser. You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0, or set to CORRECTED and treat it as an invalid datetime string. + + +-- !query +select to_timestamp('99', 'DDD') +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to parse '99' in the new parser. You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0, or set to CORRECTED and treat it as an invalid datetime string. + + +-- !query +select to_timestamp('30-365', 'dd-DDD') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('11-365', 'MM-DDD') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2019-366', 'yyyy-DDD') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('12-30-365', 'MM-dd-DDD') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2020-01-365', 'yyyy-dd-DDD') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2020-10-350', 'yyyy-MM-DDD') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp('2020-11-31-366', 'yyyy-MM-dd-DDD') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select from_csv('2018-366', 'date Date', map('dateFormat', 'yyyy-DDD')) +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to parse '2018-366' in the new parser. You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0, or set to CORRECTED and treat it as an invalid datetime string. diff --git a/sql/core/src/test/resources/sql-tests/results/datetime-parsing-legacy.sql.out b/sql/core/src/test/resources/sql-tests/results/datetime-parsing-legacy.sql.out new file mode 100644 index 0000000000000..bb7ce74a29ef5 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/datetime-parsing-legacy.sql.out @@ -0,0 +1,202 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 25 + + +-- !query +select to_timestamp('1', 'y') +-- !query schema +struct +-- !query output +0001-01-01 00:00:00 + + +-- !query +select to_timestamp('009999', 'y') +-- !query schema +struct +-- !query output +9999-01-01 00:00:00 + + +-- !query +select to_timestamp('00', 'yy') +-- !query schema +struct +-- !query output +2000-01-01 00:00:00 + + +-- !query +select to_timestamp('99', 'yy') +-- !query schema +struct +-- !query output +1999-01-01 00:00:00 + + +-- !query +select to_timestamp('001', 'yyy') +-- !query schema +struct +-- !query output +0001-01-01 00:00:00 + + +-- !query +select to_timestamp('009999', 'yyy') +-- !query schema +struct +-- !query output +9999-01-01 00:00:00 + + +-- !query +select to_timestamp('0001', 'yyyy') +-- !query schema +struct +-- !query output +0001-01-01 00:00:00 + + +-- !query +select to_timestamp('9999', 'yyyy') +-- !query schema +struct +-- !query output +9999-01-01 00:00:00 + + +-- !query +select to_timestamp('00001', 'yyyyy') +-- !query schema +struct +-- !query output +0001-01-01 00:00:00 + + +-- !query +select to_timestamp('09999', 'yyyyy') +-- !query schema +struct +-- !query output +9999-01-01 00:00:00 + + +-- !query +select to_timestamp('000001', 'yyyyyy') +-- !query schema +struct +-- !query output +0001-01-01 00:00:00 + + +-- !query +select to_timestamp('009999', 'yyyyyy') +-- !query schema +struct +-- !query output +9999-01-01 00:00:00 + + +-- !query +select to_timestamp('9', 'D') +-- !query schema +struct +-- !query output +1970-01-09 00:00:00 + + +-- !query +select to_timestamp('300', 'D') +-- !query schema +struct +-- !query output +1970-10-27 00:00:00 + + +-- !query +select to_timestamp('09', 'DD') +-- !query schema +struct +-- !query output +1970-01-09 00:00:00 + + +-- !query +select to_timestamp('99', 'DD') +-- !query schema +struct +-- !query output +1970-04-09 00:00:00 + + +-- !query +select to_timestamp('009', 'DDD') +-- !query schema +struct +-- !query output +1970-01-09 00:00:00 + + +-- !query +select to_timestamp('365', 'DDD') +-- !query schema +struct +-- !query output +1970-12-31 00:00:00 + + +-- !query +select to_timestamp('31-365', 'dd-DDD') +-- !query schema +struct +-- !query output +1970-12-31 00:00:00 + + +-- !query +select to_timestamp('12-365', 'MM-DDD') +-- !query schema +struct +-- !query output +1970-12-31 00:00:00 + + +-- !query +select to_timestamp('2020-365', 'yyyy-DDD') +-- !query schema +struct +-- !query output +2020-12-30 00:00:00 + + +-- !query +select to_timestamp('12-31-365', 'MM-dd-DDD') +-- !query schema +struct +-- !query output +1970-12-31 00:00:00 + + +-- !query +select to_timestamp('2020-30-365', 'yyyy-dd-DDD') +-- !query schema +struct +-- !query output +2020-12-30 00:00:00 + + +-- !query +select to_timestamp('2020-12-350', 'yyyy-MM-DDD') +-- !query schema +struct +-- !query output +2020-12-15 00:00:00 + + +-- !query +select to_timestamp('2020-12-31-366', 'yyyy-MM-dd-DDD') +-- !query schema +struct +-- !query output +2020-12-31 00:00:00 diff --git a/sql/core/src/test/resources/sql-tests/results/datetime-parsing.sql.out b/sql/core/src/test/resources/sql-tests/results/datetime-parsing.sql.out new file mode 100644 index 0000000000000..98146a189a005 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/datetime-parsing.sql.out @@ -0,0 +1,202 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 25 + + +-- !query +select to_timestamp('1', 'y') +-- !query schema +struct +-- !query output +0001-01-01 00:00:00 + + +-- !query +select to_timestamp('009999', 'y') +-- !query schema +struct +-- !query output +9999-01-01 00:00:00 + + +-- !query +select to_timestamp('00', 'yy') +-- !query schema +struct +-- !query output +2000-01-01 00:00:00 + + +-- !query +select to_timestamp('99', 'yy') +-- !query schema +struct +-- !query output +2099-01-01 00:00:00 + + +-- !query +select to_timestamp('001', 'yyy') +-- !query schema +struct +-- !query output +0001-01-01 00:00:00 + + +-- !query +select to_timestamp('009999', 'yyy') +-- !query schema +struct +-- !query output +9999-01-01 00:00:00 + + +-- !query +select to_timestamp('0001', 'yyyy') +-- !query schema +struct +-- !query output +0001-01-01 00:00:00 + + +-- !query +select to_timestamp('9999', 'yyyy') +-- !query schema +struct +-- !query output +9999-01-01 00:00:00 + + +-- !query +select to_timestamp('00001', 'yyyyy') +-- !query schema +struct +-- !query output +0001-01-01 00:00:00 + + +-- !query +select to_timestamp('09999', 'yyyyy') +-- !query schema +struct +-- !query output +9999-01-01 00:00:00 + + +-- !query +select to_timestamp('000001', 'yyyyyy') +-- !query schema +struct +-- !query output +0001-01-01 00:00:00 + + +-- !query +select to_timestamp('009999', 'yyyyyy') +-- !query schema +struct +-- !query output +9999-01-01 00:00:00 + + +-- !query +select to_timestamp('9', 'D') +-- !query schema +struct +-- !query output +1970-01-09 00:00:00 + + +-- !query +select to_timestamp('300', 'D') +-- !query schema +struct +-- !query output +1970-10-27 00:00:00 + + +-- !query +select to_timestamp('09', 'DD') +-- !query schema +struct +-- !query output +1970-01-09 00:00:00 + + +-- !query +select to_timestamp('99', 'DD') +-- !query schema +struct +-- !query output +1970-04-09 00:00:00 + + +-- !query +select to_timestamp('009', 'DDD') +-- !query schema +struct +-- !query output +1970-01-09 00:00:00 + + +-- !query +select to_timestamp('365', 'DDD') +-- !query schema +struct +-- !query output +1970-12-31 00:00:00 + + +-- !query +select to_timestamp('31-365', 'dd-DDD') +-- !query schema +struct +-- !query output +1970-12-31 00:00:00 + + +-- !query +select to_timestamp('12-365', 'MM-DDD') +-- !query schema +struct +-- !query output +1970-12-31 00:00:00 + + +-- !query +select to_timestamp('2020-365', 'yyyy-DDD') +-- !query schema +struct +-- !query output +2020-12-30 00:00:00 + + +-- !query +select to_timestamp('12-31-365', 'MM-dd-DDD') +-- !query schema +struct +-- !query output +1970-12-31 00:00:00 + + +-- !query +select to_timestamp('2020-30-365', 'yyyy-dd-DDD') +-- !query schema +struct +-- !query output +2020-12-30 00:00:00 + + +-- !query +select to_timestamp('2020-12-350', 'yyyy-MM-DDD') +-- !query schema +struct +-- !query output +2020-12-15 00:00:00 + + +-- !query +select to_timestamp('2020-12-31-366', 'yyyy-MM-dd-DDD') +-- !query schema +struct +-- !query output +2020-12-31 00:00:00 diff --git a/sql/core/src/test/resources/sql-tests/results/datetime.sql.out b/sql/core/src/test/resources/sql-tests/results/datetime.sql.out index a4f5b3772d2d2..b0820bb70011a 100755 --- a/sql/core/src/test/resources/sql-tests/results/datetime.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/datetime.sql.out @@ -1,5 +1,130 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 85 +-- Number of queries: 128 + + +-- !query +select TIMESTAMP_SECONDS(1230219000),TIMESTAMP_SECONDS(-1230219000),TIMESTAMP_SECONDS(null) +-- !query schema +struct +-- !query output +2008-12-25 07:30:00 1931-01-07 00:30:00 NULL + + +-- !query +select TIMESTAMP_SECONDS(1.23), TIMESTAMP_SECONDS(1.23d), TIMESTAMP_SECONDS(FLOAT(1.23)) +-- !query schema +struct +-- !query output +1969-12-31 16:00:01.23 1969-12-31 16:00:01.23 1969-12-31 16:00:01.23 + + +-- !query +select TIMESTAMP_MILLIS(1230219000123),TIMESTAMP_MILLIS(-1230219000123),TIMESTAMP_MILLIS(null) +-- !query schema +struct +-- !query output +2008-12-25 07:30:00.123 1931-01-07 00:29:59.877 NULL + + +-- !query +select TIMESTAMP_MICROS(1230219000123123),TIMESTAMP_MICROS(-1230219000123123),TIMESTAMP_MICROS(null) +-- !query schema +struct +-- !query output +2008-12-25 07:30:00.123123 1931-01-07 00:29:59.876877 NULL + + +-- !query +select TIMESTAMP_SECONDS(1230219000123123) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select TIMESTAMP_SECONDS(-1230219000123123) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select TIMESTAMP_MILLIS(92233720368547758) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select TIMESTAMP_MILLIS(-92233720368547758) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +long overflow + + +-- !query +select TIMESTAMP_SECONDS(0.1234567) +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Rounding necessary + + +-- !query +select TIMESTAMP_SECONDS(0.1234567d), TIMESTAMP_SECONDS(FLOAT(0.1234567)) +-- !query schema +struct +-- !query output +1969-12-31 16:00:00.123456 1969-12-31 16:00:00.123456 + + +-- !query +select UNIX_SECONDS(TIMESTAMP('2020-12-01 14:30:08Z')), UNIX_SECONDS(TIMESTAMP('2020-12-01 14:30:08.999999Z')), UNIX_SECONDS(null) +-- !query schema +struct +-- !query output +1606833008 1606833008 NULL + + +-- !query +select UNIX_MILLIS(TIMESTAMP('2020-12-01 14:30:08Z')), UNIX_MILLIS(TIMESTAMP('2020-12-01 14:30:08.999999Z')), UNIX_MILLIS(null) +-- !query schema +struct +-- !query output +1606833008000 1606833008999 NULL + + +-- !query +select UNIX_MICROS(TIMESTAMP('2020-12-01 14:30:08Z')), UNIX_MICROS(TIMESTAMP('2020-12-01 14:30:08.999999Z')), UNIX_MICROS(null) +-- !query schema +struct +-- !query output +1606833008000000 1606833008999999 NULL + + +-- !query +select DATE_FROM_UNIX_DATE(0), DATE_FROM_UNIX_DATE(1000), DATE_FROM_UNIX_DATE(null) +-- !query schema +struct +-- !query output +1970-01-01 1972-09-27 NULL + + +-- !query +select UNIX_DATE(DATE('1970-01-01')), UNIX_DATE(DATE('2020-12-04')), UNIX_DATE(null) +-- !query schema +struct +-- !query output +0 18600 NULL -- !query @@ -29,7 +154,7 @@ NULL 2016-12-31 00:12:00 2016-12-31 00:00:00 -- !query select dayofweek('2007-02-03'), dayofweek('2009-07-30'), dayofweek('2017-05-27'), dayofweek(null), dayofweek('1582-10-15 13:10:15') -- !query schema -struct +struct -- !query output 7 5 7 NULL 6 @@ -86,7 +211,7 @@ struct -- !query select weekday('2007-02-03'), weekday('2009-07-30'), weekday('2017-05-27'), weekday(null), weekday('1582-10-15 13:10:15') -- !query schema -struct +struct -- !query output 5 3 5 NULL 4 @@ -94,7 +219,7 @@ struct +struct -- !query output 1500 1 1 @@ -115,10 +240,38 @@ struct 2019-01-01 00:00:00 +-- !query +select date '2020-01-01中文' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the DATE value: 2020-01-01中文(line 1, pos 7) + +== SQL == +select date '2020-01-01中文' +-------^^^ + + +-- !query +select timestamp '2019-01-01中文' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the TIMESTAMP value: 2019-01-01中文(line 1, pos 7) + +== SQL == +select timestamp '2019-01-01中文' +-------^^^ + + -- !query select timestamp'2011-11-11 11:11:11' + interval '2' day -- !query schema -struct +struct -- !query output 2011-11-13 11:11:11 @@ -126,7 +279,7 @@ struct +struct -- !query output 2011-11-09 11:11:11 @@ -150,7 +303,7 @@ struct -- !query select '2011-11-11' - interval '2' day -- !query schema -struct +struct<2011-11-11 - INTERVAL '2 days':string> -- !query output 2011-11-09 00:00:00 @@ -158,7 +311,7 @@ struct -- !query select '2011-11-11 11:11:11' - interval '2' second -- !query schema -struct +struct<2011-11-11 11:11:11 - INTERVAL '2 seconds':string> -- !query output 2011-11-11 11:11:09 @@ -166,7 +319,7 @@ struct -- !query select '1' - interval '2' second -- !query schema -struct +struct<1 - INTERVAL '2 seconds':string> -- !query output NULL @@ -183,23 +336,23 @@ cannot resolve '1 + (- INTERVAL '2 seconds')' due to data type mismatch: argumen -- !query select date'2020-01-01' - timestamp'2019-10-06 10:11:12.345678' -- !query schema -struct +struct<(DATE '2020-01-01' - TIMESTAMP '2019-10-06 10:11:12.345678'):interval day to second> -- !query output -2078 hours 48 minutes 47.654322 seconds +86 13:48:47.654322000 -- !query select timestamp'2019-10-06 10:11:12.345678' - date'2020-01-01' -- !query schema -struct +struct<(TIMESTAMP '2019-10-06 10:11:12.345678' - DATE '2020-01-01'):interval day to second> -- !query output --2078 hours -48 minutes -47.654322 seconds +-86 13:48:47.654322000 -- !query select timestamp'2019-10-06 10:11:12.345678' - null -- !query schema -struct +struct<(TIMESTAMP '2019-10-06 10:11:12.345678' - NULL):interval day to second> -- !query output NULL @@ -207,7 +360,7 @@ NULL -- !query select null - timestamp'2019-10-06 10:11:12.345678' -- !query schema -struct +struct<(NULL - TIMESTAMP '2019-10-06 10:11:12.345678'):interval day to second> -- !query output NULL @@ -215,7 +368,7 @@ NULL -- !query select date_add('2011-11-11', 1Y) -- !query schema -struct +struct -- !query output 2011-11-12 @@ -223,7 +376,7 @@ struct -- !query select date_add('2011-11-11', 1S) -- !query schema -struct +struct -- !query output 2011-11-12 @@ -231,7 +384,7 @@ struct -- !query select date_add('2011-11-11', 1) -- !query schema -struct +struct -- !query output 2011-11-12 @@ -266,7 +419,7 @@ cannot resolve 'date_add(CAST('2011-11-11' AS DATE), 10.0D)' due to data type mi -- !query select date_add('2011-11-11', '1') -- !query schema -struct +struct -- !query output 2011-11-12 @@ -277,7 +430,7 @@ select date_add('2011-11-11', '1.2') struct<> -- !query output org.apache.spark.sql.AnalysisException -The second argument of 'date_add' function needs to be an integer.; +The second argument of 'date_add' function needs to be an integer. -- !query @@ -291,7 +444,7 @@ struct -- !query select date_add(timestamp'2011-11-11', 1) -- !query schema -struct +struct -- !query output 2011-11-12 @@ -318,13 +471,13 @@ select date_sub(date'2011-11-11', '1.2') struct<> -- !query output org.apache.spark.sql.AnalysisException -The second argument of 'date_sub' function needs to be an integer.; +The second argument of 'date_sub' function needs to be an integer. -- !query select date_sub(timestamp'2011-11-11', 1) -- !query schema -struct +struct -- !query output 2011-11-10 @@ -332,7 +485,7 @@ struct -- !query select date_sub(null, 1) -- !query schema -struct +struct -- !query output NULL @@ -340,7 +493,7 @@ NULL -- !query select date_sub(date'2011-11-11', null) -- !query schema -struct +struct -- !query output NULL @@ -366,7 +519,7 @@ cannot resolve 'date_add(DATE '2011-11-11', CAST('1' AS DOUBLE))' due to data ty -- !query select null + date '2001-09-28' -- !query schema -struct +struct -- !query output NULL @@ -407,7 +560,7 @@ cannot resolve 'date_sub(DATE '2001-10-01', CAST('7' AS DOUBLE))' due to data ty -- !query select date '2001-09-28' + null -- !query schema -struct +struct -- !query output NULL @@ -415,7 +568,7 @@ NULL -- !query select date '2001-09-28' - null -- !query schema -struct +struct -- !query output NULL @@ -434,7 +587,7 @@ select date_add('2011-11-11', str) from v struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'date_add(CAST('2011-11-11' AS DATE), v.`str`)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'v.`str`' is of string type.; line 1 pos 7 +cannot resolve 'date_add(CAST('2011-11-11' AS DATE), v.str)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'v.str' is of string type.; line 1 pos 7 -- !query @@ -443,13 +596,13 @@ select date_sub('2011-11-11', str) from v struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'date_sub(CAST('2011-11-11' AS DATE), v.`str`)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'v.`str`' is of string type.; line 1 pos 7 +cannot resolve 'date_sub(CAST('2011-11-11' AS DATE), v.str)' due to data type mismatch: argument 2 requires (int or smallint or tinyint) type, however, 'v.str' is of string type.; line 1 pos 7 -- !query select null - date '2019-10-06' -- !query schema -struct +struct<(NULL - DATE '2019-10-06'):interval day to second> -- !query output NULL @@ -457,9 +610,9 @@ NULL -- !query select date '2001-10-01' - date '2001-09-28' -- !query schema -struct +struct<(DATE '2001-10-01' - DATE '2001-09-28'):interval day to second> -- !query output -3 days +3 00:00:00.000000000 -- !query @@ -647,58 +800,272 @@ struct -- !query -select date_format(timestamp '2019-10-06', 'yyyy-MM-dd uuee') +select to_timestamp("2019-10-06T10:11:12'12", "yyyy-MM-dd'T'HH:mm:ss''SSSS") +-- !query schema +struct +-- !query output +2019-10-06 10:11:12.12 + + +-- !query +select to_timestamp("2019-10-06T10:11:12'", "yyyy-MM-dd'T'HH:mm:ss''") +-- !query schema +struct +-- !query output +2019-10-06 10:11:12 + + +-- !query +select to_timestamp("'2019-10-06T10:11:12", "''yyyy-MM-dd'T'HH:mm:ss") +-- !query schema +struct +-- !query output +2019-10-06 10:11:12 + + +-- !query +select to_timestamp("P2019-10-06T10:11:12", "'P'yyyy-MM-dd'T'HH:mm:ss") +-- !query schema +struct +-- !query output +2019-10-06 10:11:12 + + +-- !query +select to_timestamp("16", "dd") +-- !query schema +struct +-- !query output +1970-01-16 00:00:00 + + +-- !query +select to_timestamp("02-29", "MM-dd") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_date("16", "dd") +-- !query schema +struct +-- !query output +1970-01-16 + + +-- !query +select to_date("02-29", "MM-dd") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp("2019 40", "yyyy mm") +-- !query schema +struct +-- !query output +2019-01-01 00:40:00 + + +-- !query +select to_timestamp("2019 10:10:10", "yyyy hh:mm:ss") +-- !query schema +struct +-- !query output +2019-01-01 10:10:10 + + +-- !query +select to_timestamp('2019-10-06 A', 'yyyy-MM-dd GGGGG') -- !query schema struct<> -- !query output -java.lang.IllegalArgumentException -Illegal pattern character: e +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'yyyy-MM-dd GGGGG' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html -- !query -select date_format(timestamp '2019-10-06', 'yyyy-MM-dd uucc') +select to_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEEE') -- !query schema struct<> -- !query output -java.lang.IllegalArgumentException -Illegal pattern character: c +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd MM yyyy EEEEEE' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html -- !query -select date_format(timestamp '2019-10-06', 'yyyy-MM-dd uuuu') +select to_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEE') -- !query schema -struct +struct<> -- !query output -2019-10-06 Sunday +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd MM yyyy EEEEE' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html -- !query -select to_timestamp("2019-10-06T10:11:12'12", "yyyy-MM-dd'T'HH:mm:ss''SSSS") +select unix_timestamp('22 05 2020 Friday', 'dd MM yyyy EEEEE') -- !query schema -struct +struct<> -- !query output -2019-10-06 10:11:12.12 +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd MM yyyy EEEEE' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html -- !query -select to_timestamp("2019-10-06T10:11:12'", "yyyy-MM-dd'T'HH:mm:ss''") +select from_json('{"t":"26/October/2015"}', 't Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy')) -- !query schema -struct +struct<> -- !query output -2019-10-06 10:11:12 +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd/MMMMM/yyyy' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html -- !query -select to_timestamp("'2019-10-06T10:11:12", "''yyyy-MM-dd'T'HH:mm:ss") +select from_json('{"d":"26/October/2015"}', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy')) -- !query schema -struct +struct<> -- !query output -2019-10-06 10:11:12 +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd/MMMMM/yyyy' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html -- !query -select to_timestamp("P2019-10-06T10:11:12", "'P'yyyy-MM-dd'T'HH:mm:ss") +select from_csv('26/October/2015', 't Timestamp', map('timestampFormat', 'dd/MMMMM/yyyy')) -- !query schema -struct +struct<> -- !query output -2019-10-06 10:11:12 +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd/MMMMM/yyyy' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select from_csv('26/October/2015', 'd Date', map('dateFormat', 'dd/MMMMM/yyyy')) +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'dd/MMMMM/yyyy' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html + + +-- !query +select to_date("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_date("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_timestamp("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select unix_timestamp("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select unix_timestamp("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_unix_timestamp("2020-01-27T20:06:11.847", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select to_unix_timestamp("Unparseable", "yyyy-MM-dd HH:mm:ss.SSS") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select cast("Unparseable" as timestamp) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select cast("Unparseable" as date) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select next_day("2015-07-23", "Mon") +-- !query schema +struct +-- !query output +2015-07-27 + + +-- !query +select next_day("2015-07-23", "xx") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select next_day("xx", "Mon") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select next_day(null, "Mon") +-- !query schema +struct +-- !query output +NULL + + +-- !query +select next_day(null, "xx") +-- !query schema +struct +-- !query output +NULL diff --git a/sql/core/src/test/resources/sql-tests/results/decimalArithmeticOperations.sql.out b/sql/core/src/test/resources/sql-tests/results/decimalArithmeticOperations.sql.out index 72e46ef493a5d..1d92dc3501020 100644 --- a/sql/core/src/test/resources/sql-tests/results/decimalArithmeticOperations.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/decimalArithmeticOperations.sql.out @@ -13,7 +13,7 @@ struct<> -- !query select a / b from t -- !query schema -struct<(CAST(a AS DECIMAL(2,1)) / CAST(b AS DECIMAL(2,1))):decimal(8,6)> +struct<(a / b):decimal(8,6)> -- !query output NULL @@ -21,7 +21,7 @@ NULL -- !query select a % b from t -- !query schema -struct<(CAST(a AS DECIMAL(2,1)) % CAST(b AS DECIMAL(2,1))):decimal(1,1)> +struct<(a % b):decimal(1,1)> -- !query output NULL @@ -29,7 +29,7 @@ NULL -- !query select pmod(a, b) from t -- !query schema -struct +struct -- !query output NULL @@ -65,7 +65,7 @@ struct +struct -- !query output 1 1000.000000000000000 99.900000000000000000 2 123451.230000000000000 1234.512300000000000000 @@ -76,7 +76,7 @@ struct +struct<(10.3 * 3.0):decimal(6,2)> -- !query output 30.90 @@ -84,7 +84,7 @@ struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)> -- !query select 10.3000 * 3.0 -- !query schema -struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)> +struct<(10.3000 * 3.0):decimal(9,5)> -- !query output 30.90000 @@ -92,7 +92,7 @@ struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)> -- !query select 10.30000 * 30.0 -- !query schema -struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)> +struct<(10.30000 * 30.0):decimal(11,6)> -- !query output 309.000000 @@ -100,7 +100,7 @@ struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11, -- !query select 10.300000000000000000 * 3.000000000000000000 -- !query schema -struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,34)> +struct<(10.300000000000000000 * 3.000000000000000000):decimal(38,34)> -- !query output 30.9000000000000000000000000000000000 @@ -108,7 +108,7 @@ struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.00000000000000000 -- !query select 10.300000000000000000 * 3.0000000000000000000 -- !query schema -struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.0000000000000000000 AS DECIMAL(21,19))):decimal(38,34)> +struct<(10.300000000000000000 * 3.0000000000000000000):decimal(38,34)> -- !query output 30.9000000000000000000000000000000000 @@ -116,7 +116,7 @@ struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.00000000000000000 -- !query select 2.35E10 * 1.0 -- !query schema -struct<(2.35E10 * CAST(1.0 AS DOUBLE)):double> +struct<(2.35E10 * 1.0):double> -- !query output 2.35E10 @@ -124,7 +124,7 @@ struct<(2.35E10 * CAST(1.0 AS DOUBLE)):double> -- !query select (5e36BD + 0.1) + 5e36BD -- !query schema -struct<(CAST((CAST(5000000000000000000000000000000000000 AS DECIMAL(38,1)) + CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) + CAST(5000000000000000000000000000000000000 AS DECIMAL(38,1))):decimal(38,1)> +struct<((5000000000000000000000000000000000000 + 0.1) + 5000000000000000000000000000000000000):decimal(38,1)> -- !query output NULL @@ -132,7 +132,7 @@ NULL -- !query select (-4e36BD - 0.1) - 7e36BD -- !query schema -struct<(CAST((CAST(-4000000000000000000000000000000000000 AS DECIMAL(38,1)) - CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) - CAST(7000000000000000000000000000000000000 AS DECIMAL(38,1))):decimal(38,1)> +struct<((-4000000000000000000000000000000000000 - 0.1) - 7000000000000000000000000000000000000):decimal(38,1)> -- !query output NULL @@ -148,7 +148,7 @@ NULL -- !query select 1e35BD / 0.1 -- !query schema -struct<(CAST(100000000000000000000000000000000000 AS DECIMAL(37,1)) / CAST(0.1 AS DECIMAL(37,1))):decimal(38,6)> +struct<(100000000000000000000000000000000000 / 0.1):decimal(38,6)> -- !query output NULL @@ -156,7 +156,7 @@ NULL -- !query select 1.2345678901234567890E30BD * 1.2345678901234567890E25BD -- !query schema -struct<(CAST(1234567890123456789000000000000 AS DECIMAL(31,0)) * CAST(12345678901234567890000000 AS DECIMAL(31,0))):decimal(38,0)> +struct<(1234567890123456789000000000000 * 12345678901234567890000000):decimal(38,0)> -- !query output NULL @@ -164,7 +164,7 @@ NULL -- !query select 12345678912345678912345678912.1234567 + 9999999999999999999999999999999.12345 -- !query schema -struct<(CAST(12345678912345678912345678912.1234567 AS DECIMAL(38,6)) + CAST(9999999999999999999999999999999.12345 AS DECIMAL(38,6))):decimal(38,6)> +struct<(12345678912345678912345678912.1234567 + 9999999999999999999999999999999.12345):decimal(38,6)> -- !query output 10012345678912345678912345678911.246907 @@ -172,7 +172,7 @@ struct<(CAST(12345678912345678912345678912.1234567 AS DECIMAL(38,6)) + CAST(9999 -- !query select 123456789123456789.1234567890 * 1.123456789123456789 -- !query schema -struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,18)> +struct<(123456789123456789.1234567890 * 1.123456789123456789):decimal(38,18)> -- !query output 138698367904130467.654320988515622621 @@ -180,7 +180,7 @@ struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789 -- !query select 12345678912345.123456789123 / 0.000000012345678 -- !query schema -struct<(CAST(12345678912345.123456789123 AS DECIMAL(29,15)) / CAST(1.2345678E-8 AS DECIMAL(29,15))):decimal(38,9)> +struct<(12345678912345.123456789123 / 1.2345678E-8):decimal(38,9)> -- !query output 1000000073899961059796.725866332 @@ -207,7 +207,7 @@ struct +struct -- !query output 1 1000.000000000000000000 99.9000000000000000000 2 123451.230000000000000000 1234.5123000000000000000 @@ -218,7 +218,7 @@ struct +struct<(10.3 * 3.0):decimal(6,2)> -- !query output 30.90 @@ -226,7 +226,7 @@ struct<(CAST(10.3 AS DECIMAL(3,1)) * CAST(3.0 AS DECIMAL(3,1))):decimal(6,2)> -- !query select 10.3000 * 3.0 -- !query schema -struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)> +struct<(10.3000 * 3.0):decimal(9,5)> -- !query output 30.90000 @@ -234,7 +234,7 @@ struct<(CAST(10.3000 AS DECIMAL(6,4)) * CAST(3.0 AS DECIMAL(6,4))):decimal(9,5)> -- !query select 10.30000 * 30.0 -- !query schema -struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11,6)> +struct<(10.30000 * 30.0):decimal(11,6)> -- !query output 309.000000 @@ -242,7 +242,7 @@ struct<(CAST(10.30000 AS DECIMAL(7,5)) * CAST(30.0 AS DECIMAL(7,5))):decimal(11, -- !query select 10.300000000000000000 * 3.000000000000000000 -- !query schema -struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.000000000000000000 AS DECIMAL(20,18))):decimal(38,36)> +struct<(10.300000000000000000 * 3.000000000000000000):decimal(38,36)> -- !query output 30.900000000000000000000000000000000000 @@ -250,7 +250,7 @@ struct<(CAST(10.300000000000000000 AS DECIMAL(20,18)) * CAST(3.00000000000000000 -- !query select 10.300000000000000000 * 3.0000000000000000000 -- !query schema -struct<(CAST(10.300000000000000000 AS DECIMAL(21,19)) * CAST(3.0000000000000000000 AS DECIMAL(21,19))):decimal(38,37)> +struct<(10.300000000000000000 * 3.0000000000000000000):decimal(38,37)> -- !query output NULL @@ -258,7 +258,7 @@ NULL -- !query select 2.35E10 * 1.0 -- !query schema -struct<(2.35E10 * CAST(1.0 AS DOUBLE)):double> +struct<(2.35E10 * 1.0):double> -- !query output 2.35E10 @@ -266,7 +266,7 @@ struct<(2.35E10 * CAST(1.0 AS DOUBLE)):double> -- !query select (5e36BD + 0.1) + 5e36BD -- !query schema -struct<(CAST((CAST(5000000000000000000000000000000000000 AS DECIMAL(38,1)) + CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) + CAST(5000000000000000000000000000000000000 AS DECIMAL(38,1))):decimal(38,1)> +struct<((5000000000000000000000000000000000000 + 0.1) + 5000000000000000000000000000000000000):decimal(38,1)> -- !query output NULL @@ -274,7 +274,7 @@ NULL -- !query select (-4e36BD - 0.1) - 7e36BD -- !query schema -struct<(CAST((CAST(-4000000000000000000000000000000000000 AS DECIMAL(38,1)) - CAST(0.1 AS DECIMAL(38,1))) AS DECIMAL(38,1)) - CAST(7000000000000000000000000000000000000 AS DECIMAL(38,1))):decimal(38,1)> +struct<((-4000000000000000000000000000000000000 - 0.1) - 7000000000000000000000000000000000000):decimal(38,1)> -- !query output NULL @@ -290,7 +290,7 @@ NULL -- !query select 1e35BD / 0.1 -- !query schema -struct<(CAST(100000000000000000000000000000000000 AS DECIMAL(37,1)) / CAST(0.1 AS DECIMAL(37,1))):decimal(38,3)> +struct<(100000000000000000000000000000000000 / 0.1):decimal(38,3)> -- !query output NULL @@ -298,7 +298,7 @@ NULL -- !query select 1.2345678901234567890E30BD * 1.2345678901234567890E25BD -- !query schema -struct<(CAST(1234567890123456789000000000000 AS DECIMAL(31,0)) * CAST(12345678901234567890000000 AS DECIMAL(31,0))):decimal(38,0)> +struct<(1234567890123456789000000000000 * 12345678901234567890000000):decimal(38,0)> -- !query output NULL @@ -306,7 +306,7 @@ NULL -- !query select 12345678912345678912345678912.1234567 + 9999999999999999999999999999999.12345 -- !query schema -struct<(CAST(12345678912345678912345678912.1234567 AS DECIMAL(38,7)) + CAST(9999999999999999999999999999999.12345 AS DECIMAL(38,7))):decimal(38,7)> +struct<(12345678912345678912345678912.1234567 + 9999999999999999999999999999999.12345):decimal(38,7)> -- !query output NULL @@ -314,7 +314,7 @@ NULL -- !query select 123456789123456789.1234567890 * 1.123456789123456789 -- !query schema -struct<(CAST(123456789123456789.1234567890 AS DECIMAL(36,18)) * CAST(1.123456789123456789 AS DECIMAL(36,18))):decimal(38,28)> +struct<(123456789123456789.1234567890 * 1.123456789123456789):decimal(38,28)> -- !query output NULL @@ -322,7 +322,7 @@ NULL -- !query select 12345678912345.123456789123 / 0.000000012345678 -- !query schema -struct<(CAST(12345678912345.123456789123 AS DECIMAL(29,15)) / CAST(1.2345678E-8 AS DECIMAL(29,15))):decimal(38,18)> +struct<(12345678912345.123456789123 / 1.2345678E-8):decimal(38,18)> -- !query output NULL diff --git a/sql/core/src/test/resources/sql-tests/results/describe-table-column.sql.out b/sql/core/src/test/resources/sql-tests/results/describe-table-column.sql.out index c6d3d45879eb1..cc5b836b74109 100644 --- a/sql/core/src/test/resources/sql-tests/results/describe-table-column.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/describe-table-column.sql.out @@ -1,9 +1,9 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 28 +-- Number of queries: 30 -- !query -CREATE TEMPORARY VIEW desc_col_temp_view (key int COMMENT 'column_comment') USING PARQUET +CREATE TEMPORARY VIEW desc_col_temp_view (key int COMMENT 'column_comment', col struct) USING PARQUET -- !query schema struct<> -- !query output @@ -77,7 +77,16 @@ DESC desc_col_temp_view key1 struct<> -- !query output org.apache.spark.sql.AnalysisException -Column key1 does not exist; +Column key1 does not exist + + +-- !query +DESC desc_col_temp_view col.x +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +DESC TABLE COLUMN does not support nested column: col.x -- !query @@ -140,6 +149,15 @@ max_col_len 4 histogram NULL +-- !query +DESC desc_col_table key1 +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Column key1 does not exist + + -- !query CREATE TABLE desc_complex_col_table (`a.b` int, col struct) USING PARQUET -- !query schema @@ -188,7 +206,7 @@ DESC FORMATTED desc_complex_col_table col.x struct<> -- !query output org.apache.spark.sql.AnalysisException -DESC TABLE COLUMN command does not support nested data types: col.x; +DESC TABLE COLUMN does not support nested column: col.x -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/describe.sql.out b/sql/core/src/test/resources/sql-tests/results/describe.sql.out index a7de033e3a1ac..7634c112ab81a 100644 --- a/sql/core/src/test/resources/sql-tests/results/describe.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/describe.sql.out @@ -130,7 +130,7 @@ Num Buckets 2 Bucket Columns [`a`] Sort Columns [`b`] Comment table_comment -Table Properties [t=test, e=3] +Table Properties [e=3, t=test] Location [not included in comparison]/{warehouse_dir}/t Storage Properties [a=1, b=2] Partition Provider Catalog @@ -162,7 +162,7 @@ Num Buckets 2 Bucket Columns [`a`] Sort Columns [`b`] Comment table_comment -Table Properties [t=test, e=3] +Table Properties [e=3, t=test] Location [not included in comparison]/{warehouse_dir}/t Storage Properties [a=1, b=2] Partition Provider Catalog @@ -332,7 +332,7 @@ struct<> org.apache.spark.sql.catalyst.analysis.NoSuchPartitionException Partition not found in table 't' database 'default': c -> Us -d -> 2; +d -> 2 -- !query @@ -341,7 +341,7 @@ DESC t PARTITION (c='Us') struct<> -- !query output org.apache.spark.sql.AnalysisException -Partition spec is invalid. The spec (c) must match the partition spec (c, d) defined in table '`default`.`t`'; +Partition spec is invalid. The spec (c) must match the partition spec (c, d) defined in table '`default`.`t`' -- !query @@ -431,7 +431,7 @@ DESC temp_v PARTITION (c='Us', d=1) struct<> -- !query output org.apache.spark.sql.AnalysisException -DESC PARTITION is not allowed on a temporary view: temp_v; +DESC PARTITION is not allowed on a temporary view: temp_v -- !query @@ -477,7 +477,7 @@ View Text SELECT * FROM t View Original Text SELECT * FROM t View Catalog and Namespace spark_catalog.default View Query Output Columns [a, b, c, d] -Table Properties [view.query.out.col.3=d, view.catalogAndNamespace.numParts=2, view.query.out.col.0=a, view.query.out.numCols=4, view.query.out.col.1=b, view.catalogAndNamespace.part.0=spark_catalog, view.query.out.col.2=c, view.catalogAndNamespace.part.1=default] +Table Properties [] -- !query @@ -501,7 +501,7 @@ View Text SELECT * FROM t View Original Text SELECT * FROM t View Catalog and Namespace spark_catalog.default View Query Output Columns [a, b, c, d] -Table Properties [view.query.out.col.3=d, view.catalogAndNamespace.numParts=2, view.query.out.col.0=a, view.query.out.numCols=4, view.query.out.col.1=b, view.catalogAndNamespace.part.0=spark_catalog, view.query.out.col.2=c, view.catalogAndNamespace.part.1=default] +Table Properties [] -- !query @@ -510,7 +510,7 @@ DESC v PARTITION (c='Us', d=1) struct<> -- !query output org.apache.spark.sql.AnalysisException -DESC PARTITION is not allowed on a view: v; +DESC PARTITION is not allowed on a view: v -- !query @@ -520,7 +520,7 @@ struct -- !query output == Physical Plan == Execute DescribeTableCommand - +- DescribeTableCommand `default`.`t`, false + +- DescribeTableCommand `default`.`t`, false, [col_name#x, data_type#x, comment#x] -- !query @@ -530,7 +530,7 @@ struct -- !query output == Physical Plan == Execute DescribeTableCommand - +- DescribeTableCommand `default`.`t`, true + +- DescribeTableCommand `default`.`t`, true, [col_name#x, data_type#x, comment#x] -- !query @@ -539,19 +539,19 @@ EXPLAIN EXTENDED DESC t struct -- !query output == Parsed Logical Plan == -'DescribeRelation false -+- 'UnresolvedTableOrView [t] +'DescribeRelation false, [col_name#x, data_type#x, comment#x] ++- 'UnresolvedTableOrView [t], DESCRIBE TABLE, true == Analyzed Logical Plan == col_name: string, data_type: string, comment: string -DescribeTableCommand `default`.`t`, false +DescribeTableCommand `default`.`t`, false, [col_name#x, data_type#x, comment#x] == Optimized Logical Plan == -DescribeTableCommand `default`.`t`, false +DescribeTableCommand `default`.`t`, false, [col_name#x, data_type#x, comment#x] == Physical Plan == Execute DescribeTableCommand - +- DescribeTableCommand `default`.`t`, false + +- DescribeTableCommand `default`.`t`, false, [col_name#x, data_type#x, comment#x] -- !query @@ -561,7 +561,7 @@ struct -- !query output == Physical Plan == Execute DescribeColumnCommand - +- DescribeColumnCommand `default`.`t`, [b], false + +- DescribeColumnCommand `default`.`t`, [spark_catalog, default, t, b], false, [info_name#x, info_value#x] -- !query @@ -571,7 +571,7 @@ struct -- !query output == Physical Plan == Execute DescribeTableCommand - +- DescribeTableCommand `default`.`t`, Map(c -> Us, d -> 2), false + +- DescribeTableCommand `default`.`t`, [c=Us, d=2], false, [col_name#x, data_type#x, comment#x] -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/except-all.sql.out b/sql/core/src/test/resources/sql-tests/results/except-all.sql.out index 601ff8f024214..a1fe952e2c032 100644 --- a/sql/core/src/test/resources/sql-tests/results/except-all.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/except-all.sql.out @@ -141,7 +141,7 @@ SELECT array(1) struct<> -- !query output org.apache.spark.sql.AnalysisException -ExceptAll can only be performed on tables with the compatible column types. array <> int at the first column of the second table; +ExceptAll can only be performed on tables with the compatible column types. array <> int at the first column of the second table -- !query @@ -213,7 +213,7 @@ SELECT k, v FROM tab4 struct<> -- !query output org.apache.spark.sql.AnalysisException -ExceptAll can only be performed on tables with the same number of columns, but the first table has 1 columns and the second table has 2 columns; +ExceptAll can only be performed on tables with the same number of columns, but the first table has 1 columns and the second table has 2 columns -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/except.sql.out b/sql/core/src/test/resources/sql-tests/results/except.sql.out index 62d695219d01d..061b122eac7cf 100644 --- a/sql/core/src/test/resources/sql-tests/results/except.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/except.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 9 +-- Number of queries: 15 -- !query @@ -103,3 +103,59 @@ WHERE t1.v >= (SELECT min(t2.v) struct -- !query output two + + +-- !query +CREATE OR REPLACE TEMPORARY VIEW t3 AS VALUES (decimal(1)) tbl(v) +-- !query schema +struct<> +-- !query output + + + +-- !query +SELECT t.v FROM ( + SELECT v FROM t3 + EXCEPT + SELECT v + v AS v FROM t3 +) t +-- !query schema +struct +-- !query output +1 + + +-- !query +SELECT SUM(t.v) FROM ( + SELECT v FROM t3 + EXCEPT + SELECT v + v AS v FROM t3 +) t +-- !query schema +struct +-- !query output +1 + + +-- !query +DROP VIEW IF EXISTS t1 +-- !query schema +struct<> +-- !query output + + + +-- !query +DROP VIEW IF EXISTS t2 +-- !query schema +struct<> +-- !query output + + + +-- !query +DROP VIEW IF EXISTS t3 +-- !query schema +struct<> +-- !query output + diff --git a/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out b/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out index 36757863ffcb5..357445a806da4 100644 --- a/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/explain-aqe.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 23 +-- Number of queries: 24 -- !query @@ -42,6 +42,39 @@ struct spark.sql.codegen.wholeStage true +-- !query +EXPLAIN EXTENDED + SELECT sum(distinct val) + FROM explain_temp1 +-- !query schema +struct +-- !query output +== Parsed Logical Plan == +'Project [unresolvedalias('sum(distinct 'val), None)] ++- 'UnresolvedRelation [explain_temp1], [], false + +== Analyzed Logical Plan == +sum(DISTINCT val): bigint +Aggregate [sum(distinct val#x) AS sum(DISTINCT val)#xL] ++- SubqueryAlias spark_catalog.default.explain_temp1 + +- Relation default.explain_temp1[key#x,val#x] parquet + +== Optimized Logical Plan == +Aggregate [sum(distinct val#x) AS sum(DISTINCT val)#xL] ++- Project [val#x] + +- Relation default.explain_temp1[key#x,val#x] parquet + +== Physical Plan == +AdaptiveSparkPlan isFinalPlan=false ++- HashAggregate(keys=[], functions=[sum(distinct val#x)], output=[sum(DISTINCT val)#xL]) + +- Exchange SinglePartition, ENSURE_REQUIREMENTS, [id=#x] + +- HashAggregate(keys=[], functions=[partial_sum(distinct val#x)], output=[sum#xL]) + +- HashAggregate(keys=[val#x], functions=[], output=[val#x]) + +- Exchange hashpartitioning(val#x, 4), ENSURE_REQUIREMENTS, [id=#x] + +- HashAggregate(keys=[val#x], functions=[], output=[val#x]) + +- FileScan parquet default.explain_temp1[val#x] Batched: true, DataFilters: [], Format: Parquet, Location [not included in comparison]/{warehouse_dir}/explain_temp1], PartitionFilters: [], PushedFilters: [], ReadSchema: struct + + -- !query EXPLAIN FORMATTED SELECT key, max(val) @@ -53,15 +86,14 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -AdaptiveSparkPlan (9) -+- Sort (8) - +- Exchange (7) - +- HashAggregate (6) - +- Exchange (5) - +- HashAggregate (4) - +- Project (3) - +- Filter (2) - +- Scan parquet default.explain_temp1 (1) +AdaptiveSparkPlan (8) ++- Sort (7) + +- Exchange (6) + +- HashAggregate (5) + +- Exchange (4) + +- HashAggregate (3) + +- Filter (2) + +- Scan parquet default.explain_temp1 (1) (1) Scan parquet default.explain_temp1 @@ -75,37 +107,33 @@ ReadSchema: struct Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 0)) -(3) Project -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(4) HashAggregate +(3) HashAggregate Input [2]: [key#x, val#x] Keys [1]: [key#x] Functions [1]: [partial_max(val#x)] Aggregate Attributes [1]: [max#x] Results [2]: [key#x, max#x] -(5) Exchange +(4) Exchange Input [2]: [key#x, max#x] -Arguments: hashpartitioning(key#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x] -(6) HashAggregate +(5) HashAggregate Input [2]: [key#x, max#x] Keys [1]: [key#x] Functions [1]: [max(val#x)] Aggregate Attributes [1]: [max(val#x)#x] Results [2]: [key#x, max(val#x)#x AS max(val)#x] -(7) Exchange +(6) Exchange Input [2]: [key#x, max(val)#x] -Arguments: rangepartitioning(key#x ASC NULLS FIRST, 4), true, [id=#x] +Arguments: rangepartitioning(key#x ASC NULLS FIRST, 4), ENSURE_REQUIREMENTS, [id=#x] -(8) Sort +(7) Sort Input [2]: [key#x, max(val)#x] Arguments: [key#x ASC NULLS FIRST], true, 0 -(9) AdaptiveSparkPlan +(8) AdaptiveSparkPlan Output [2]: [key#x, max(val)#x] Arguments: isFinalPlan=false @@ -121,15 +149,14 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -AdaptiveSparkPlan (9) -+- Project (8) - +- Filter (7) - +- HashAggregate (6) - +- Exchange (5) - +- HashAggregate (4) - +- Project (3) - +- Filter (2) - +- Scan parquet default.explain_temp1 (1) +AdaptiveSparkPlan (8) ++- Project (7) + +- Filter (6) + +- HashAggregate (5) + +- Exchange (4) + +- HashAggregate (3) + +- Filter (2) + +- Scan parquet default.explain_temp1 (1) (1) Scan parquet default.explain_temp1 @@ -143,37 +170,33 @@ ReadSchema: struct Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 0)) -(3) Project -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(4) HashAggregate +(3) HashAggregate Input [2]: [key#x, val#x] Keys [1]: [key#x] Functions [1]: [partial_max(val#x)] Aggregate Attributes [1]: [max#x] Results [2]: [key#x, max#x] -(5) Exchange +(4) Exchange Input [2]: [key#x, max#x] -Arguments: hashpartitioning(key#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x] -(6) HashAggregate +(5) HashAggregate Input [2]: [key#x, max#x] Keys [1]: [key#x] Functions [1]: [max(val#x)] Aggregate Attributes [1]: [max(val#x)#x] Results [3]: [key#x, max(val#x)#x AS max(val)#x, max(val#x)#x AS max(val#x)#x] -(7) Filter +(6) Filter Input [3]: [key#x, max(val)#x, max(val#x)#x] Condition : (isnotnull(max(val#x)#x) AND (max(val#x)#x > 0)) -(8) Project +(7) Project Output [2]: [key#x, max(val)#x] Input [3]: [key#x, max(val)#x, max(val#x)#x] -(9) AdaptiveSparkPlan +(8) AdaptiveSparkPlan Output [2]: [key#x, max(val)#x] Arguments: isFinalPlan=false @@ -182,22 +205,20 @@ Arguments: isFinalPlan=false EXPLAIN FORMATTED SELECT key, val FROM explain_temp1 WHERE key > 0 UNION - SELECT key, val FROM explain_temp1 WHERE key > 0 + SELECT key, val FROM explain_temp1 WHERE key > 1 -- !query schema struct -- !query output == Physical Plan == -AdaptiveSparkPlan (11) -+- HashAggregate (10) - +- Exchange (9) - +- HashAggregate (8) - +- Union (7) - :- Project (3) - : +- Filter (2) - : +- Scan parquet default.explain_temp1 (1) - +- Project (6) - +- Filter (5) - +- Scan parquet default.explain_temp1 (4) +AdaptiveSparkPlan (9) ++- HashAggregate (8) + +- Exchange (7) + +- HashAggregate (6) + +- Union (5) + :- Filter (2) + : +- Scan parquet default.explain_temp1 (1) + +- Filter (4) + +- Scan parquet default.explain_temp1 (3) (1) Scan parquet default.explain_temp1 @@ -211,46 +232,38 @@ ReadSchema: struct Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 0)) -(3) Project -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(4) Scan parquet default.explain_temp1 +(3) Scan parquet default.explain_temp1 Output [2]: [key#x, val#x] Batched: true Location [not included in comparison]/{warehouse_dir}/explain_temp1] -PushedFilters: [IsNotNull(key), GreaterThan(key,0)] +PushedFilters: [IsNotNull(key), GreaterThan(key,1)] ReadSchema: struct -(5) Filter -Input [2]: [key#x, val#x] -Condition : (isnotnull(key#x) AND (key#x > 0)) - -(6) Project -Output [2]: [key#x, val#x] +(4) Filter Input [2]: [key#x, val#x] +Condition : (isnotnull(key#x) AND (key#x > 1)) -(7) Union +(5) Union -(8) HashAggregate +(6) HashAggregate Input [2]: [key#x, val#x] Keys [2]: [key#x, val#x] Functions: [] Aggregate Attributes: [] Results [2]: [key#x, val#x] -(9) Exchange +(7) Exchange Input [2]: [key#x, val#x] -Arguments: hashpartitioning(key#x, val#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, val#x, 4), ENSURE_REQUIREMENTS, [id=#x] -(10) HashAggregate +(8) HashAggregate Input [2]: [key#x, val#x] Keys [2]: [key#x, val#x] Functions: [] Aggregate Attributes: [] Results [2]: [key#x, val#x] -(11) AdaptiveSparkPlan +(9) AdaptiveSparkPlan Output [2]: [key#x, val#x] Arguments: isFinalPlan=false @@ -265,15 +278,13 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -AdaptiveSparkPlan (9) -+- BroadcastHashJoin Inner BuildRight (8) - :- Project (3) - : +- Filter (2) - : +- Scan parquet default.explain_temp1 (1) - +- BroadcastExchange (7) - +- Project (6) - +- Filter (5) - +- Scan parquet default.explain_temp2 (4) +AdaptiveSparkPlan (7) ++- BroadcastHashJoin Inner BuildRight (6) + :- Filter (2) + : +- Scan parquet default.explain_temp1 (1) + +- BroadcastExchange (5) + +- Filter (4) + +- Scan parquet default.explain_temp2 (3) (1) Scan parquet default.explain_temp1 @@ -287,35 +298,27 @@ ReadSchema: struct Input [2]: [key#x, val#x] Condition : isnotnull(key#x) -(3) Project -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(4) Scan parquet default.explain_temp2 +(3) Scan parquet default.explain_temp2 Output [2]: [key#x, val#x] Batched: true Location [not included in comparison]/{warehouse_dir}/explain_temp2] PushedFilters: [IsNotNull(key)] ReadSchema: struct -(5) Filter +(4) Filter Input [2]: [key#x, val#x] Condition : isnotnull(key#x) -(6) Project -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(7) BroadcastExchange +(5) BroadcastExchange Input [2]: [key#x, val#x] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint))), [id=#x] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#x] -(8) BroadcastHashJoin +(6) BroadcastHashJoin Left keys [1]: [key#x] Right keys [1]: [key#x] Join condition: None -(9) AdaptiveSparkPlan +(7) AdaptiveSparkPlan Output [4]: [key#x, val#x, key#x, val#x] Arguments: isFinalPlan=false @@ -330,13 +333,12 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -AdaptiveSparkPlan (7) -+- BroadcastHashJoin LeftOuter BuildRight (6) +AdaptiveSparkPlan (6) ++- BroadcastHashJoin LeftOuter BuildRight (5) :- Scan parquet default.explain_temp1 (1) - +- BroadcastExchange (5) - +- Project (4) - +- Filter (3) - +- Scan parquet default.explain_temp2 (2) + +- BroadcastExchange (4) + +- Filter (3) + +- Scan parquet default.explain_temp2 (2) (1) Scan parquet default.explain_temp1 @@ -356,20 +358,16 @@ ReadSchema: struct Input [2]: [key#x, val#x] Condition : isnotnull(key#x) -(4) Project -Output [2]: [key#x, val#x] +(4) BroadcastExchange Input [2]: [key#x, val#x] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#x] -(5) BroadcastExchange -Input [2]: [key#x, val#x] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint))), [id=#x] - -(6) BroadcastHashJoin +(5) BroadcastHashJoin Left keys [1]: [key#x] Right keys [1]: [key#x] Join condition: None -(7) AdaptiveSparkPlan +(6) AdaptiveSparkPlan Output [4]: [key#x, val#x, key#x, val#x] Arguments: isFinalPlan=false @@ -389,10 +387,9 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -AdaptiveSparkPlan (4) -+- Project (3) - +- Filter (2) - +- Scan parquet default.explain_temp1 (1) +AdaptiveSparkPlan (3) ++- Filter (2) + +- Scan parquet default.explain_temp1 (1) (1) Scan parquet default.explain_temp1 @@ -406,12 +403,104 @@ ReadSchema: struct Input [2]: [key#x, val#x] Condition : (((isnotnull(key#x) AND isnotnull(val#x)) AND (key#x = Subquery subquery#x, [id=#x])) AND (val#x > 3)) -(3) Project +(3) AdaptiveSparkPlan +Output [2]: [key#x, val#x] +Arguments: isFinalPlan=false + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 2 Hosting Expression = Subquery subquery#x, [id=#x] +AdaptiveSparkPlan (10) ++- HashAggregate (9) + +- Exchange (8) + +- HashAggregate (7) + +- Project (6) + +- Filter (5) + +- Scan parquet default.explain_temp2 (4) + + +(4) Scan parquet default.explain_temp2 Output [2]: [key#x, val#x] +Batched: true +Location [not included in comparison]/{warehouse_dir}/explain_temp2] +PushedFilters: [IsNotNull(key), IsNotNull(val), EqualTo(val,2)] +ReadSchema: struct + +(5) Filter Input [2]: [key#x, val#x] +Condition : (((isnotnull(key#x) AND isnotnull(val#x)) AND (key#x = Subquery subquery#x, [id=#x])) AND (val#x = 2)) + +(6) Project +Output [1]: [key#x] +Input [2]: [key#x, val#x] + +(7) HashAggregate +Input [1]: [key#x] +Keys: [] +Functions [1]: [partial_max(key#x)] +Aggregate Attributes [1]: [max#x] +Results [1]: [max#x] + +(8) Exchange +Input [1]: [max#x] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] + +(9) HashAggregate +Input [1]: [max#x] +Keys: [] +Functions [1]: [max(key#x)] +Aggregate Attributes [1]: [max(key#x)#x] +Results [1]: [max(key#x)#x AS max(key)#x] + +(10) AdaptiveSparkPlan +Output [1]: [max(key)#x] +Arguments: isFinalPlan=false -(4) AdaptiveSparkPlan +Subquery:2 Hosting operator id = 5 Hosting Expression = Subquery subquery#x, [id=#x] +AdaptiveSparkPlan (17) ++- HashAggregate (16) + +- Exchange (15) + +- HashAggregate (14) + +- Project (13) + +- Filter (12) + +- Scan parquet default.explain_temp3 (11) + + +(11) Scan parquet default.explain_temp3 Output [2]: [key#x, val#x] +Batched: true +Location [not included in comparison]/{warehouse_dir}/explain_temp3] +PushedFilters: [IsNotNull(val), GreaterThan(val,0)] +ReadSchema: struct + +(12) Filter +Input [2]: [key#x, val#x] +Condition : (isnotnull(val#x) AND (val#x > 0)) + +(13) Project +Output [1]: [key#x] +Input [2]: [key#x, val#x] + +(14) HashAggregate +Input [1]: [key#x] +Keys: [] +Functions [1]: [partial_max(key#x)] +Aggregate Attributes [1]: [max#x] +Results [1]: [max#x] + +(15) Exchange +Input [1]: [max#x] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] + +(16) HashAggregate +Input [1]: [max#x] +Keys: [] +Functions [1]: [max(key#x)] +Aggregate Attributes [1]: [max(key#x)#x] +Results [1]: [max(key#x)#x AS max(key)#x] + +(17) AdaptiveSparkPlan +Output [1]: [max(key)#x] Arguments: isFinalPlan=false @@ -449,6 +538,102 @@ Condition : ((key#x = Subquery subquery#x, [id=#x]) OR (cast(key#x as double) = Output [2]: [key#x, val#x] Arguments: isFinalPlan=false +===== Subqueries ===== + +Subquery:1 Hosting operator id = 2 Hosting Expression = Subquery subquery#x, [id=#x] +AdaptiveSparkPlan (10) ++- HashAggregate (9) + +- Exchange (8) + +- HashAggregate (7) + +- Project (6) + +- Filter (5) + +- Scan parquet default.explain_temp2 (4) + + +(4) Scan parquet default.explain_temp2 +Output [2]: [key#x, val#x] +Batched: true +Location [not included in comparison]/{warehouse_dir}/explain_temp2] +PushedFilters: [IsNotNull(val), GreaterThan(val,0)] +ReadSchema: struct + +(5) Filter +Input [2]: [key#x, val#x] +Condition : (isnotnull(val#x) AND (val#x > 0)) + +(6) Project +Output [1]: [key#x] +Input [2]: [key#x, val#x] + +(7) HashAggregate +Input [1]: [key#x] +Keys: [] +Functions [1]: [partial_max(key#x)] +Aggregate Attributes [1]: [max#x] +Results [1]: [max#x] + +(8) Exchange +Input [1]: [max#x] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] + +(9) HashAggregate +Input [1]: [max#x] +Keys: [] +Functions [1]: [max(key#x)] +Aggregate Attributes [1]: [max(key#x)#x] +Results [1]: [max(key#x)#x AS max(key)#x] + +(10) AdaptiveSparkPlan +Output [1]: [max(key)#x] +Arguments: isFinalPlan=false + +Subquery:2 Hosting operator id = 2 Hosting Expression = Subquery subquery#x, [id=#x] +AdaptiveSparkPlan (17) ++- HashAggregate (16) + +- Exchange (15) + +- HashAggregate (14) + +- Project (13) + +- Filter (12) + +- Scan parquet default.explain_temp3 (11) + + +(11) Scan parquet default.explain_temp3 +Output [2]: [key#x, val#x] +Batched: true +Location [not included in comparison]/{warehouse_dir}/explain_temp3] +PushedFilters: [IsNotNull(val), GreaterThan(val,0)] +ReadSchema: struct + +(12) Filter +Input [2]: [key#x, val#x] +Condition : (isnotnull(val#x) AND (val#x > 0)) + +(13) Project +Output [1]: [key#x] +Input [2]: [key#x, val#x] + +(14) HashAggregate +Input [1]: [key#x] +Keys: [] +Functions [1]: [partial_avg(key#x)] +Aggregate Attributes [2]: [sum#x, count#xL] +Results [2]: [sum#x, count#xL] + +(15) Exchange +Input [2]: [sum#x, count#xL] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] + +(16) HashAggregate +Input [2]: [sum#x, count#xL] +Keys: [] +Functions [1]: [avg(key#x)] +Aggregate Attributes [1]: [avg(key#x)#x] +Results [1]: [avg(key#x)#x AS avg(key)#x] + +(17) AdaptiveSparkPlan +Output [1]: [avg(key)#x] +Arguments: isFinalPlan=false + -- !query EXPLAIN FORMATTED @@ -477,6 +662,80 @@ Input: [] Output [1]: [(scalarsubquery() + scalarsubquery())#x] Arguments: isFinalPlan=false +===== Subqueries ===== + +Subquery:1 Hosting operator id = 2 Hosting Expression = Subquery subquery#x, [id=#x] +AdaptiveSparkPlan (8) ++- HashAggregate (7) + +- Exchange (6) + +- HashAggregate (5) + +- Scan parquet default.explain_temp1 (4) + + +(4) Scan parquet default.explain_temp1 +Output [1]: [key#x] +Batched: true +Location [not included in comparison]/{warehouse_dir}/explain_temp1] +ReadSchema: struct + +(5) HashAggregate +Input [1]: [key#x] +Keys: [] +Functions [1]: [partial_avg(key#x)] +Aggregate Attributes [2]: [sum#x, count#xL] +Results [2]: [sum#x, count#xL] + +(6) Exchange +Input [2]: [sum#x, count#xL] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] + +(7) HashAggregate +Input [2]: [sum#x, count#xL] +Keys: [] +Functions [1]: [avg(key#x)] +Aggregate Attributes [1]: [avg(key#x)#x] +Results [1]: [avg(key#x)#x AS avg(key)#x] + +(8) AdaptiveSparkPlan +Output [1]: [avg(key)#x] +Arguments: isFinalPlan=false + +Subquery:2 Hosting operator id = 2 Hosting Expression = Subquery subquery#x, [id=#x] +AdaptiveSparkPlan (13) ++- HashAggregate (12) + +- Exchange (11) + +- HashAggregate (10) + +- Scan parquet default.explain_temp1 (9) + + +(9) Scan parquet default.explain_temp1 +Output [1]: [key#x] +Batched: true +Location [not included in comparison]/{warehouse_dir}/explain_temp1] +ReadSchema: struct + +(10) HashAggregate +Input [1]: [key#x] +Keys: [] +Functions [1]: [partial_avg(key#x)] +Aggregate Attributes [2]: [sum#x, count#xL] +Results [2]: [sum#x, count#xL] + +(11) Exchange +Input [2]: [sum#x, count#xL] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] + +(12) HashAggregate +Input [2]: [sum#x, count#xL] +Keys: [] +Functions [1]: [avg(key#x)] +Aggregate Attributes [1]: [avg(key#x)#x] +Results [1]: [avg(key#x)#x AS avg(key)#x] + +(13) AdaptiveSparkPlan +Output [1]: [avg(key)#x] +Arguments: isFinalPlan=false + -- !query EXPLAIN FORMATTED @@ -490,15 +749,13 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -AdaptiveSparkPlan (9) -+- BroadcastHashJoin Inner BuildRight (8) - :- Project (3) - : +- Filter (2) - : +- Scan parquet default.explain_temp1 (1) - +- BroadcastExchange (7) - +- Project (6) - +- Filter (5) - +- Scan parquet default.explain_temp1 (4) +AdaptiveSparkPlan (7) ++- BroadcastHashJoin Inner BuildRight (6) + :- Filter (2) + : +- Scan parquet default.explain_temp1 (1) + +- BroadcastExchange (5) + +- Filter (4) + +- Scan parquet default.explain_temp1 (3) (1) Scan parquet default.explain_temp1 @@ -512,35 +769,27 @@ ReadSchema: struct Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 10)) -(3) Project -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(4) Scan parquet default.explain_temp1 +(3) Scan parquet default.explain_temp1 Output [2]: [key#x, val#x] Batched: true Location [not included in comparison]/{warehouse_dir}/explain_temp1] PushedFilters: [IsNotNull(key), GreaterThan(key,10)] ReadSchema: struct -(5) Filter +(4) Filter Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 10)) -(6) Project -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(7) BroadcastExchange +(5) BroadcastExchange Input [2]: [key#x, val#x] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint))), [id=#x] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#x] -(8) BroadcastHashJoin +(6) BroadcastHashJoin Left keys [1]: [key#x] Right keys [1]: [key#x] Join condition: None -(9) AdaptiveSparkPlan +(7) AdaptiveSparkPlan Output [4]: [key#x, val#x, key#x, val#x] Arguments: isFinalPlan=false @@ -558,21 +807,19 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -AdaptiveSparkPlan (15) -+- BroadcastHashJoin Inner BuildRight (14) - :- HashAggregate (6) - : +- Exchange (5) - : +- HashAggregate (4) - : +- Project (3) - : +- Filter (2) - : +- Scan parquet default.explain_temp1 (1) - +- BroadcastExchange (13) - +- HashAggregate (12) - +- Exchange (11) - +- HashAggregate (10) - +- Project (9) - +- Filter (8) - +- Scan parquet default.explain_temp1 (7) +AdaptiveSparkPlan (13) ++- BroadcastHashJoin Inner BuildRight (12) + :- HashAggregate (5) + : +- Exchange (4) + : +- HashAggregate (3) + : +- Filter (2) + : +- Scan parquet default.explain_temp1 (1) + +- BroadcastExchange (11) + +- HashAggregate (10) + +- Exchange (9) + +- HashAggregate (8) + +- Filter (7) + +- Scan parquet default.explain_temp1 (6) (1) Scan parquet default.explain_temp1 @@ -586,71 +833,63 @@ ReadSchema: struct Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 10)) -(3) Project -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(4) HashAggregate +(3) HashAggregate Input [2]: [key#x, val#x] Keys [1]: [key#x] Functions [1]: [partial_max(val#x)] Aggregate Attributes [1]: [max#x] Results [2]: [key#x, max#x] -(5) Exchange +(4) Exchange Input [2]: [key#x, max#x] -Arguments: hashpartitioning(key#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x] -(6) HashAggregate +(5) HashAggregate Input [2]: [key#x, max#x] Keys [1]: [key#x] Functions [1]: [max(val#x)] Aggregate Attributes [1]: [max(val#x)#x] Results [2]: [key#x, max(val#x)#x AS max(val)#x] -(7) Scan parquet default.explain_temp1 +(6) Scan parquet default.explain_temp1 Output [2]: [key#x, val#x] Batched: true Location [not included in comparison]/{warehouse_dir}/explain_temp1] PushedFilters: [IsNotNull(key), GreaterThan(key,10)] ReadSchema: struct -(8) Filter +(7) Filter Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 10)) -(9) Project -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(10) HashAggregate +(8) HashAggregate Input [2]: [key#x, val#x] Keys [1]: [key#x] Functions [1]: [partial_max(val#x)] Aggregate Attributes [1]: [max#x] Results [2]: [key#x, max#x] -(11) Exchange +(9) Exchange Input [2]: [key#x, max#x] -Arguments: hashpartitioning(key#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x] -(12) HashAggregate +(10) HashAggregate Input [2]: [key#x, max#x] Keys [1]: [key#x] Functions [1]: [max(val#x)] Aggregate Attributes [1]: [max(val#x)#x] Results [2]: [key#x, max(val#x)#x AS max(val)#x] -(13) BroadcastExchange +(11) BroadcastExchange Input [2]: [key#x, max(val)#x] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint))), [id=#x] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#x] -(14) BroadcastHashJoin +(12) BroadcastHashJoin Left keys [1]: [key#x] Right keys [1]: [key#x] Join condition: None -(15) AdaptiveSparkPlan +(13) AdaptiveSparkPlan Output [4]: [key#x, max(val)#x, key#x, max(val)#x] Arguments: isFinalPlan=false @@ -665,21 +904,37 @@ struct == Physical Plan == Execute CreateViewCommand (1) +- CreateViewCommand (2) - +- Project (4) - +- UnresolvedRelation (3) + +- Project (5) + +- SubqueryAlias (4) + +- LogicalRelation (3) (1) Execute CreateViewCommand Output: [] (2) CreateViewCommand -Arguments: `default`.`explain_view`, SELECT key, val FROM explain_temp1, false, false, PersistedView - -(3) UnresolvedRelation -Arguments: [explain_temp1] - -(4) Project -Arguments: ['key, 'val] +Arguments: `default`.`explain_view`, SELECT key, val FROM explain_temp1, false, false, PersistedView, true + +(3) LogicalRelation +Arguments: parquet, [key#x, val#x], CatalogTable( +Database: default +Table: explain_temp1 +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type: MANAGED +Provider: PARQUET +Location [not included in comparison]/{warehouse_dir}/explain_temp1 +Schema: root +-- key: integer (nullable = true) +-- val: integer (nullable = true) +), false + +(4) SubqueryAlias +Arguments: spark_catalog.default.explain_temp1 + +(5) Project +Arguments: [key#x, val#x] -- !query @@ -708,20 +963,20 @@ ReadSchema: struct (2) HashAggregate Input [2]: [key#x, val#x] Keys: [] -Functions [3]: [partial_count(val#x), partial_sum(cast(key#x as bigint)), partial_count(key#x) FILTER (WHERE (val#x > 1))] +Functions [3]: [partial_count(val#x), partial_sum(key#x), partial_count(key#x) FILTER (WHERE (val#x > 1))] Aggregate Attributes [3]: [count#xL, sum#xL, count#xL] Results [3]: [count#xL, sum#xL, count#xL] (3) Exchange Input [3]: [count#xL, sum#xL, count#xL] -Arguments: SinglePartition, true, [id=#x] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] (4) HashAggregate Input [3]: [count#xL, sum#xL, count#xL] Keys: [] -Functions [3]: [count(val#x), sum(cast(key#x as bigint)), count(key#x)] -Aggregate Attributes [3]: [count(val#x)#xL, sum(cast(key#x as bigint))#xL, count(key#x)#xL] -Results [2]: [(count(val#x)#xL + sum(cast(key#x as bigint))#xL) AS TOTAL#xL, count(key#x)#xL AS count(key) FILTER (WHERE (val > 1))#xL] +Functions [3]: [count(val#x), sum(key#x), count(key#x)] +Aggregate Attributes [3]: [count(val#x)#xL, sum(key#x)#xL, count(key#x)#xL] +Results [2]: [(count(val#x)#xL + sum(key#x)#xL) AS TOTAL#xL, count(key#x)#xL AS count(key) FILTER (WHERE (val > 1))#xL] (5) AdaptiveSparkPlan Output [2]: [TOTAL#xL, count(key) FILTER (WHERE (val > 1))#xL] @@ -759,7 +1014,7 @@ Results [2]: [key#x, buf#x] (3) Exchange Input [2]: [key#x, buf#x] -Arguments: hashpartitioning(key#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x] (4) ObjectHashAggregate Input [2]: [key#x, buf#x] @@ -810,7 +1065,7 @@ Results [2]: [key#x, min#x] (4) Exchange Input [2]: [key#x, min#x] -Arguments: hashpartitioning(key#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x] (5) Sort Input [2]: [key#x, min#x] diff --git a/sql/core/src/test/resources/sql-tests/results/explain-cbo.sql.out b/sql/core/src/test/resources/sql-tests/results/explain-cbo.sql.out new file mode 100644 index 0000000000000..086b4d2e0b194 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/explain-cbo.sql.out @@ -0,0 +1,96 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 7 + + +-- !query +CREATE TABLE explain_temp1(a INT, b INT) USING PARQUET +-- !query schema +struct<> +-- !query output + + + +-- !query +CREATE TABLE explain_temp2(c INT, d INT) USING PARQUET +-- !query schema +struct<> +-- !query output + + + +-- !query +ANALYZE TABLE explain_temp1 COMPUTE STATISTICS FOR ALL COLUMNS +-- !query schema +struct<> +-- !query output + + + +-- !query +ANALYZE TABLE explain_temp2 COMPUTE STATISTICS FOR ALL COLUMNS +-- !query schema +struct<> +-- !query output + + + +-- !query +EXPLAIN COST WITH max_store_sales AS +( + SELECT max(csales) tpcds_cmax + FROM ( + SELECT sum(b) csales + FROM explain_temp1 WHERE a < 100 + ) x +), +best_ss_customer AS +( + SELECT c + FROM explain_temp2 + WHERE d > (SELECT * FROM max_store_sales) +) +SELECT c FROM best_ss_customer +-- !query schema +struct +-- !query output +== Optimized Logical Plan == +Project [c#x], Statistics(sizeInBytes=1.0 B, rowCount=0) ++- Filter (isnotnull(d#x) AND (cast(d#x as bigint) > scalar-subquery#x [])), Statistics(sizeInBytes=1.0 B, rowCount=0) + : +- Aggregate [max(csales#xL) AS tpcds_cmax#xL], Statistics(sizeInBytes=16.0 B, rowCount=1) + : +- Aggregate [sum(b#x) AS csales#xL], Statistics(sizeInBytes=16.0 B, rowCount=1) + : +- Project [b#x], Statistics(sizeInBytes=1.0 B, rowCount=0) + : +- Filter (isnotnull(a#x) AND (a#x < 100)), Statistics(sizeInBytes=1.0 B, rowCount=0) + : +- Relation default.explain_temp1[a#x,b#x] parquet, Statistics(sizeInBytes=1.0 B, rowCount=0) + +- Relation default.explain_temp2[c#x,d#x] parquet, Statistics(sizeInBytes=1.0 B, rowCount=0) + +== Physical Plan == +AdaptiveSparkPlan isFinalPlan=false ++- Project [c#x] + +- Filter (isnotnull(d#x) AND (cast(d#x as bigint) > Subquery subquery#x, [id=#x])) + : +- Subquery subquery#x, [id=#x] + : +- AdaptiveSparkPlan isFinalPlan=false + : +- HashAggregate(keys=[], functions=[max(csales#xL)], output=[tpcds_cmax#xL]) + : +- HashAggregate(keys=[], functions=[partial_max(csales#xL)], output=[max#xL]) + : +- HashAggregate(keys=[], functions=[sum(b#x)], output=[csales#xL]) + : +- Exchange SinglePartition, ENSURE_REQUIREMENTS, [id=#x] + : +- HashAggregate(keys=[], functions=[partial_sum(b#x)], output=[sum#xL]) + : +- Project [b#x] + : +- Filter (isnotnull(a#x) AND (a#x < 100)) + : +- FileScan parquet default.explain_temp1[a#x,b#x] Batched: true, DataFilters: [isnotnull(a#x), (a#x < 100)], Format: Parquet, Location [not included in comparison]/{warehouse_dir}/explain_temp1], PartitionFilters: [], PushedFilters: [IsNotNull(a), LessThan(a,100)], ReadSchema: struct + +- FileScan parquet default.explain_temp2[c#x,d#x] Batched: true, DataFilters: [isnotnull(d#x)], Format: Parquet, Location [not included in comparison]/{warehouse_dir}/explain_temp2], PartitionFilters: [], PushedFilters: [IsNotNull(d)], ReadSchema: struct + + +-- !query +DROP TABLE explain_temp1 +-- !query schema +struct<> +-- !query output + + + +-- !query +DROP TABLE explain_temp2 +-- !query schema +struct<> +-- !query output + diff --git a/sql/core/src/test/resources/sql-tests/results/explain.sql.out b/sql/core/src/test/resources/sql-tests/results/explain.sql.out index 2b07dac0e5d0a..3d00872028fcb 100644 --- a/sql/core/src/test/resources/sql-tests/results/explain.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/explain.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 23 +-- Number of queries: 24 -- !query @@ -42,6 +42,39 @@ struct spark.sql.codegen.wholeStage true +-- !query +EXPLAIN EXTENDED + SELECT sum(distinct val) + FROM explain_temp1 +-- !query schema +struct +-- !query output +== Parsed Logical Plan == +'Project [unresolvedalias('sum(distinct 'val), None)] ++- 'UnresolvedRelation [explain_temp1], [], false + +== Analyzed Logical Plan == +sum(DISTINCT val): bigint +Aggregate [sum(distinct val#x) AS sum(DISTINCT val)#xL] ++- SubqueryAlias spark_catalog.default.explain_temp1 + +- Relation default.explain_temp1[key#x,val#x] parquet + +== Optimized Logical Plan == +Aggregate [sum(distinct val#x) AS sum(DISTINCT val)#xL] ++- Project [val#x] + +- Relation default.explain_temp1[key#x,val#x] parquet + +== Physical Plan == +*HashAggregate(keys=[], functions=[sum(distinct val#x)], output=[sum(DISTINCT val)#xL]) ++- Exchange SinglePartition, ENSURE_REQUIREMENTS, [id=#x] + +- *HashAggregate(keys=[], functions=[partial_sum(distinct val#x)], output=[sum#xL]) + +- *HashAggregate(keys=[val#x], functions=[], output=[val#x]) + +- Exchange hashpartitioning(val#x, 4), ENSURE_REQUIREMENTS, [id=#x] + +- *HashAggregate(keys=[val#x], functions=[], output=[val#x]) + +- *ColumnarToRow + +- FileScan parquet default.explain_temp1[val#x] Batched: true, DataFilters: [], Format: Parquet, Location [not included in comparison]/{warehouse_dir}/explain_temp1], PartitionFilters: [], PushedFilters: [], ReadSchema: struct + + -- !query EXPLAIN FORMATTED SELECT key, max(val) @@ -53,15 +86,14 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -* Sort (9) -+- Exchange (8) - +- * HashAggregate (7) - +- Exchange (6) - +- * HashAggregate (5) - +- * Project (4) - +- * Filter (3) - +- * ColumnarToRow (2) - +- Scan parquet default.explain_temp1 (1) +* Sort (8) ++- Exchange (7) + +- * HashAggregate (6) + +- Exchange (5) + +- * HashAggregate (4) + +- * Filter (3) + +- * ColumnarToRow (2) + +- Scan parquet default.explain_temp1 (1) (1) Scan parquet default.explain_temp1 @@ -78,33 +110,29 @@ Input [2]: [key#x, val#x] Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 0)) -(4) Project [codegen id : 1] -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(5) HashAggregate [codegen id : 1] +(4) HashAggregate [codegen id : 1] Input [2]: [key#x, val#x] Keys [1]: [key#x] Functions [1]: [partial_max(val#x)] Aggregate Attributes [1]: [max#x] Results [2]: [key#x, max#x] -(6) Exchange +(5) Exchange Input [2]: [key#x, max#x] -Arguments: hashpartitioning(key#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x] -(7) HashAggregate [codegen id : 2] +(6) HashAggregate [codegen id : 2] Input [2]: [key#x, max#x] Keys [1]: [key#x] Functions [1]: [max(val#x)] Aggregate Attributes [1]: [max(val#x)#x] Results [2]: [key#x, max(val#x)#x AS max(val)#x] -(8) Exchange +(7) Exchange Input [2]: [key#x, max(val)#x] -Arguments: rangepartitioning(key#x ASC NULLS FIRST, 4), true, [id=#x] +Arguments: rangepartitioning(key#x ASC NULLS FIRST, 4), ENSURE_REQUIREMENTS, [id=#x] -(9) Sort [codegen id : 3] +(8) Sort [codegen id : 3] Input [2]: [key#x, max(val)#x] Arguments: [key#x ASC NULLS FIRST], true, 0 @@ -120,15 +148,14 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -* Project (9) -+- * Filter (8) - +- * HashAggregate (7) - +- Exchange (6) - +- * HashAggregate (5) - +- * Project (4) - +- * Filter (3) - +- * ColumnarToRow (2) - +- Scan parquet default.explain_temp1 (1) +* Project (8) ++- * Filter (7) + +- * HashAggregate (6) + +- Exchange (5) + +- * HashAggregate (4) + +- * Filter (3) + +- * ColumnarToRow (2) + +- Scan parquet default.explain_temp1 (1) (1) Scan parquet default.explain_temp1 @@ -145,33 +172,29 @@ Input [2]: [key#x, val#x] Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 0)) -(4) Project [codegen id : 1] -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(5) HashAggregate [codegen id : 1] +(4) HashAggregate [codegen id : 1] Input [2]: [key#x, val#x] Keys [1]: [key#x] Functions [1]: [partial_max(val#x)] Aggregate Attributes [1]: [max#x] Results [2]: [key#x, max#x] -(6) Exchange +(5) Exchange Input [2]: [key#x, max#x] -Arguments: hashpartitioning(key#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x] -(7) HashAggregate [codegen id : 2] +(6) HashAggregate [codegen id : 2] Input [2]: [key#x, max#x] Keys [1]: [key#x] Functions [1]: [max(val#x)] Aggregate Attributes [1]: [max(val#x)#x] Results [3]: [key#x, max(val#x)#x AS max(val)#x, max(val#x)#x AS max(val#x)#x] -(8) Filter [codegen id : 2] +(7) Filter [codegen id : 2] Input [3]: [key#x, max(val)#x, max(val#x)#x] Condition : (isnotnull(max(val#x)#x) AND (max(val#x)#x > 0)) -(9) Project [codegen id : 2] +(8) Project [codegen id : 2] Output [2]: [key#x, max(val)#x] Input [3]: [key#x, max(val)#x, max(val#x)#x] @@ -180,23 +203,21 @@ Input [3]: [key#x, max(val)#x, max(val#x)#x] EXPLAIN FORMATTED SELECT key, val FROM explain_temp1 WHERE key > 0 UNION - SELECT key, val FROM explain_temp1 WHERE key > 0 + SELECT key, val FROM explain_temp1 WHERE key > 1 -- !query schema struct -- !query output == Physical Plan == -* HashAggregate (12) -+- Exchange (11) - +- * HashAggregate (10) - +- Union (9) - :- * Project (4) - : +- * Filter (3) - : +- * ColumnarToRow (2) - : +- Scan parquet default.explain_temp1 (1) - +- * Project (8) - +- * Filter (7) - +- * ColumnarToRow (6) - +- Scan parquet default.explain_temp1 (5) +* HashAggregate (10) ++- Exchange (9) + +- * HashAggregate (8) + +- Union (7) + :- * Filter (3) + : +- * ColumnarToRow (2) + : +- Scan parquet default.explain_temp1 (1) + +- * Filter (6) + +- * ColumnarToRow (5) + +- Scan parquet default.explain_temp1 (4) (1) Scan parquet default.explain_temp1 @@ -213,42 +234,34 @@ Input [2]: [key#x, val#x] Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 0)) -(4) Project [codegen id : 1] -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(5) Scan parquet default.explain_temp1 +(4) Scan parquet default.explain_temp1 Output [2]: [key#x, val#x] Batched: true Location [not included in comparison]/{warehouse_dir}/explain_temp1] -PushedFilters: [IsNotNull(key), GreaterThan(key,0)] +PushedFilters: [IsNotNull(key), GreaterThan(key,1)] ReadSchema: struct -(6) ColumnarToRow [codegen id : 2] +(5) ColumnarToRow [codegen id : 2] Input [2]: [key#x, val#x] -(7) Filter [codegen id : 2] -Input [2]: [key#x, val#x] -Condition : (isnotnull(key#x) AND (key#x > 0)) - -(8) Project [codegen id : 2] -Output [2]: [key#x, val#x] +(6) Filter [codegen id : 2] Input [2]: [key#x, val#x] +Condition : (isnotnull(key#x) AND (key#x > 1)) -(9) Union +(7) Union -(10) HashAggregate [codegen id : 3] +(8) HashAggregate [codegen id : 3] Input [2]: [key#x, val#x] Keys [2]: [key#x, val#x] Functions: [] Aggregate Attributes: [] Results [2]: [key#x, val#x] -(11) Exchange +(9) Exchange Input [2]: [key#x, val#x] -Arguments: hashpartitioning(key#x, val#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, val#x, 4), ENSURE_REQUIREMENTS, [id=#x] -(12) HashAggregate [codegen id : 4] +(10) HashAggregate [codegen id : 4] Input [2]: [key#x, val#x] Keys [2]: [key#x, val#x] Functions: [] @@ -266,16 +279,14 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -* BroadcastHashJoin Inner BuildRight (10) -:- * Project (4) -: +- * Filter (3) -: +- * ColumnarToRow (2) -: +- Scan parquet default.explain_temp1 (1) -+- BroadcastExchange (9) - +- * Project (8) - +- * Filter (7) - +- * ColumnarToRow (6) - +- Scan parquet default.explain_temp2 (5) +* BroadcastHashJoin Inner BuildRight (8) +:- * Filter (3) +: +- * ColumnarToRow (2) +: +- Scan parquet default.explain_temp1 (1) ++- BroadcastExchange (7) + +- * Filter (6) + +- * ColumnarToRow (5) + +- Scan parquet default.explain_temp2 (4) (1) Scan parquet default.explain_temp1 @@ -292,33 +303,25 @@ Input [2]: [key#x, val#x] Input [2]: [key#x, val#x] Condition : isnotnull(key#x) -(4) Project [codegen id : 2] -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(5) Scan parquet default.explain_temp2 +(4) Scan parquet default.explain_temp2 Output [2]: [key#x, val#x] Batched: true Location [not included in comparison]/{warehouse_dir}/explain_temp2] PushedFilters: [IsNotNull(key)] ReadSchema: struct -(6) ColumnarToRow [codegen id : 1] +(5) ColumnarToRow [codegen id : 1] Input [2]: [key#x, val#x] -(7) Filter [codegen id : 1] +(6) Filter [codegen id : 1] Input [2]: [key#x, val#x] Condition : isnotnull(key#x) -(8) Project [codegen id : 1] -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(9) BroadcastExchange +(7) BroadcastExchange Input [2]: [key#x, val#x] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint))), [id=#x] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#x] -(10) BroadcastHashJoin [codegen id : 2] +(8) BroadcastHashJoin [codegen id : 2] Left keys [1]: [key#x] Right keys [1]: [key#x] Join condition: None @@ -334,14 +337,13 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -* BroadcastHashJoin LeftOuter BuildRight (8) +* BroadcastHashJoin LeftOuter BuildRight (7) :- * ColumnarToRow (2) : +- Scan parquet default.explain_temp1 (1) -+- BroadcastExchange (7) - +- * Project (6) - +- * Filter (5) - +- * ColumnarToRow (4) - +- Scan parquet default.explain_temp2 (3) ++- BroadcastExchange (6) + +- * Filter (5) + +- * ColumnarToRow (4) + +- Scan parquet default.explain_temp2 (3) (1) Scan parquet default.explain_temp1 @@ -367,15 +369,11 @@ Input [2]: [key#x, val#x] Input [2]: [key#x, val#x] Condition : isnotnull(key#x) -(6) Project [codegen id : 1] -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(7) BroadcastExchange +(6) BroadcastExchange Input [2]: [key#x, val#x] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint))), [id=#x] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#x] -(8) BroadcastHashJoin [codegen id : 2] +(7) BroadcastHashJoin [codegen id : 2] Left keys [1]: [key#x] Right keys [1]: [key#x] Join condition: None @@ -396,10 +394,9 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -* Project (4) -+- * Filter (3) - +- * ColumnarToRow (2) - +- Scan parquet default.explain_temp1 (1) +* Filter (3) ++- * ColumnarToRow (2) + +- Scan parquet default.explain_temp1 (1) (1) Scan parquet default.explain_temp1 @@ -416,98 +413,94 @@ Input [2]: [key#x, val#x] Input [2]: [key#x, val#x] Condition : (((isnotnull(key#x) AND isnotnull(val#x)) AND (key#x = Subquery scalar-subquery#x, [id=#x])) AND (val#x > 3)) -(4) Project [codegen id : 1] -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - ===== Subqueries ===== Subquery:1 Hosting operator id = 3 Hosting Expression = Subquery scalar-subquery#x, [id=#x] -* HashAggregate (11) -+- Exchange (10) - +- * HashAggregate (9) - +- * Project (8) - +- * Filter (7) - +- * ColumnarToRow (6) - +- Scan parquet default.explain_temp2 (5) +* HashAggregate (10) ++- Exchange (9) + +- * HashAggregate (8) + +- * Project (7) + +- * Filter (6) + +- * ColumnarToRow (5) + +- Scan parquet default.explain_temp2 (4) -(5) Scan parquet default.explain_temp2 +(4) Scan parquet default.explain_temp2 Output [2]: [key#x, val#x] Batched: true Location [not included in comparison]/{warehouse_dir}/explain_temp2] PushedFilters: [IsNotNull(key), IsNotNull(val), EqualTo(val,2)] ReadSchema: struct -(6) ColumnarToRow [codegen id : 1] +(5) ColumnarToRow [codegen id : 1] Input [2]: [key#x, val#x] -(7) Filter [codegen id : 1] +(6) Filter [codegen id : 1] Input [2]: [key#x, val#x] Condition : (((isnotnull(key#x) AND isnotnull(val#x)) AND (key#x = Subquery scalar-subquery#x, [id=#x])) AND (val#x = 2)) -(8) Project [codegen id : 1] +(7) Project [codegen id : 1] Output [1]: [key#x] Input [2]: [key#x, val#x] -(9) HashAggregate [codegen id : 1] +(8) HashAggregate [codegen id : 1] Input [1]: [key#x] Keys: [] Functions [1]: [partial_max(key#x)] Aggregate Attributes [1]: [max#x] Results [1]: [max#x] -(10) Exchange +(9) Exchange Input [1]: [max#x] -Arguments: SinglePartition, true, [id=#x] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] -(11) HashAggregate [codegen id : 2] +(10) HashAggregate [codegen id : 2] Input [1]: [max#x] Keys: [] Functions [1]: [max(key#x)] Aggregate Attributes [1]: [max(key#x)#x] Results [1]: [max(key#x)#x AS max(key)#x] -Subquery:2 Hosting operator id = 7 Hosting Expression = Subquery scalar-subquery#x, [id=#x] -* HashAggregate (18) -+- Exchange (17) - +- * HashAggregate (16) - +- * Project (15) - +- * Filter (14) - +- * ColumnarToRow (13) - +- Scan parquet default.explain_temp3 (12) +Subquery:2 Hosting operator id = 6 Hosting Expression = Subquery scalar-subquery#x, [id=#x] +* HashAggregate (17) ++- Exchange (16) + +- * HashAggregate (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.explain_temp3 (11) -(12) Scan parquet default.explain_temp3 +(11) Scan parquet default.explain_temp3 Output [2]: [key#x, val#x] Batched: true Location [not included in comparison]/{warehouse_dir}/explain_temp3] PushedFilters: [IsNotNull(val), GreaterThan(val,0)] ReadSchema: struct -(13) ColumnarToRow [codegen id : 1] +(12) ColumnarToRow [codegen id : 1] Input [2]: [key#x, val#x] -(14) Filter [codegen id : 1] +(13) Filter [codegen id : 1] Input [2]: [key#x, val#x] Condition : (isnotnull(val#x) AND (val#x > 0)) -(15) Project [codegen id : 1] +(14) Project [codegen id : 1] Output [1]: [key#x] Input [2]: [key#x, val#x] -(16) HashAggregate [codegen id : 1] +(15) HashAggregate [codegen id : 1] Input [1]: [key#x] Keys: [] Functions [1]: [partial_max(key#x)] Aggregate Attributes [1]: [max#x] Results [1]: [max#x] -(17) Exchange +(16) Exchange Input [1]: [max#x] -Arguments: SinglePartition, true, [id=#x] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] -(18) HashAggregate [codegen id : 2] +(17) HashAggregate [codegen id : 2] Input [1]: [max#x] Keys: [] Functions [1]: [max(key#x)] @@ -587,7 +580,7 @@ Results [1]: [max#x] (9) Exchange Input [1]: [max#x] -Arguments: SinglePartition, true, [id=#x] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] (10) HashAggregate [codegen id : 2] Input [1]: [max#x] @@ -627,20 +620,20 @@ Input [2]: [key#x, val#x] (15) HashAggregate [codegen id : 1] Input [1]: [key#x] Keys: [] -Functions [1]: [partial_avg(cast(key#x as bigint))] +Functions [1]: [partial_avg(key#x)] Aggregate Attributes [2]: [sum#x, count#xL] Results [2]: [sum#x, count#xL] (16) Exchange Input [2]: [sum#x, count#xL] -Arguments: SinglePartition, true, [id=#x] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] (17) HashAggregate [codegen id : 2] Input [2]: [sum#x, count#xL] Keys: [] -Functions [1]: [avg(cast(key#x as bigint))] -Aggregate Attributes [1]: [avg(cast(key#x as bigint))#x] -Results [1]: [avg(cast(key#x as bigint))#x AS avg(key)#x] +Functions [1]: [avg(key#x)] +Aggregate Attributes [1]: [avg(key#x)#x] +Results [1]: [avg(key#x)#x AS avg(key)#x] -- !query @@ -691,20 +684,20 @@ Input [1]: [key#x] (6) HashAggregate [codegen id : 1] Input [1]: [key#x] Keys: [] -Functions [1]: [partial_avg(cast(key#x as bigint))] +Functions [1]: [partial_avg(key#x)] Aggregate Attributes [2]: [sum#x, count#xL] Results [2]: [sum#x, count#xL] (7) Exchange Input [2]: [sum#x, count#xL] -Arguments: SinglePartition, true, [id=#x] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] (8) HashAggregate [codegen id : 2] Input [2]: [sum#x, count#xL] Keys: [] -Functions [1]: [avg(cast(key#x as bigint))] -Aggregate Attributes [1]: [avg(cast(key#x as bigint))#x] -Results [1]: [avg(cast(key#x as bigint))#x AS avg(key)#x] +Functions [1]: [avg(key#x)] +Aggregate Attributes [1]: [avg(key#x)#x] +Results [1]: [avg(key#x)#x AS avg(key)#x] Subquery:2 Hosting operator id = 3 Hosting Expression = ReusedSubquery Subquery scalar-subquery#x, [id=#x] @@ -721,16 +714,14 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -* BroadcastHashJoin Inner BuildRight (10) -:- * Project (4) -: +- * Filter (3) -: +- * ColumnarToRow (2) -: +- Scan parquet default.explain_temp1 (1) -+- BroadcastExchange (9) - +- * Project (8) - +- * Filter (7) - +- * ColumnarToRow (6) - +- Scan parquet default.explain_temp1 (5) +* BroadcastHashJoin Inner BuildRight (8) +:- * Filter (3) +: +- * ColumnarToRow (2) +: +- Scan parquet default.explain_temp1 (1) ++- BroadcastExchange (7) + +- * Filter (6) + +- * ColumnarToRow (5) + +- Scan parquet default.explain_temp1 (4) (1) Scan parquet default.explain_temp1 @@ -747,33 +738,25 @@ Input [2]: [key#x, val#x] Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 10)) -(4) Project [codegen id : 2] -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(5) Scan parquet default.explain_temp1 +(4) Scan parquet default.explain_temp1 Output [2]: [key#x, val#x] Batched: true Location [not included in comparison]/{warehouse_dir}/explain_temp1] PushedFilters: [IsNotNull(key), GreaterThan(key,10)] ReadSchema: struct -(6) ColumnarToRow [codegen id : 1] +(5) ColumnarToRow [codegen id : 1] Input [2]: [key#x, val#x] -(7) Filter [codegen id : 1] +(6) Filter [codegen id : 1] Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 10)) -(8) Project [codegen id : 1] -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(9) BroadcastExchange +(7) BroadcastExchange Input [2]: [key#x, val#x] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint))), [id=#x] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#x] -(10) BroadcastHashJoin [codegen id : 2] +(8) BroadcastHashJoin [codegen id : 2] Left keys [1]: [key#x] Right keys [1]: [key#x] Join condition: None @@ -792,17 +775,16 @@ EXPLAIN FORMATTED struct -- !query output == Physical Plan == -* BroadcastHashJoin Inner BuildRight (11) -:- * HashAggregate (7) -: +- Exchange (6) -: +- * HashAggregate (5) -: +- * Project (4) -: +- * Filter (3) -: +- * ColumnarToRow (2) -: +- Scan parquet default.explain_temp1 (1) -+- BroadcastExchange (10) - +- * HashAggregate (9) - +- ReusedExchange (8) +* BroadcastHashJoin Inner BuildRight (10) +:- * HashAggregate (6) +: +- Exchange (5) +: +- * HashAggregate (4) +: +- * Filter (3) +: +- * ColumnarToRow (2) +: +- Scan parquet default.explain_temp1 (1) ++- BroadcastExchange (9) + +- * HashAggregate (8) + +- ReusedExchange (7) (1) Scan parquet default.explain_temp1 @@ -819,43 +801,39 @@ Input [2]: [key#x, val#x] Input [2]: [key#x, val#x] Condition : (isnotnull(key#x) AND (key#x > 10)) -(4) Project [codegen id : 1] -Output [2]: [key#x, val#x] -Input [2]: [key#x, val#x] - -(5) HashAggregate [codegen id : 1] +(4) HashAggregate [codegen id : 1] Input [2]: [key#x, val#x] Keys [1]: [key#x] Functions [1]: [partial_max(val#x)] Aggregate Attributes [1]: [max#x] Results [2]: [key#x, max#x] -(6) Exchange +(5) Exchange Input [2]: [key#x, max#x] -Arguments: hashpartitioning(key#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x] -(7) HashAggregate [codegen id : 4] +(6) HashAggregate [codegen id : 4] Input [2]: [key#x, max#x] Keys [1]: [key#x] Functions [1]: [max(val#x)] Aggregate Attributes [1]: [max(val#x)#x] Results [2]: [key#x, max(val#x)#x AS max(val)#x] -(8) ReusedExchange [Reuses operator id: 6] +(7) ReusedExchange [Reuses operator id: 5] Output [2]: [key#x, max#x] -(9) HashAggregate [codegen id : 3] +(8) HashAggregate [codegen id : 3] Input [2]: [key#x, max#x] Keys [1]: [key#x] Functions [1]: [max(val#x)] Aggregate Attributes [1]: [max(val#x)#x] Results [2]: [key#x, max(val#x)#x AS max(val)#x] -(10) BroadcastExchange +(9) BroadcastExchange Input [2]: [key#x, max(val)#x] -Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint))), [id=#x] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#x] -(11) BroadcastHashJoin [codegen id : 4] +(10) BroadcastHashJoin [codegen id : 4] Left keys [1]: [key#x] Right keys [1]: [key#x] Join condition: None @@ -871,21 +849,37 @@ struct == Physical Plan == Execute CreateViewCommand (1) +- CreateViewCommand (2) - +- Project (4) - +- UnresolvedRelation (3) + +- Project (5) + +- SubqueryAlias (4) + +- LogicalRelation (3) (1) Execute CreateViewCommand Output: [] (2) CreateViewCommand -Arguments: `default`.`explain_view`, SELECT key, val FROM explain_temp1, false, false, PersistedView - -(3) UnresolvedRelation -Arguments: [explain_temp1] - -(4) Project -Arguments: ['key, 'val] +Arguments: `default`.`explain_view`, SELECT key, val FROM explain_temp1, false, false, PersistedView, true + +(3) LogicalRelation +Arguments: parquet, [key#x, val#x], CatalogTable( +Database: default +Table: explain_temp1 +Created Time [not included in comparison] +Last Access [not included in comparison] +Created By [not included in comparison] +Type: MANAGED +Provider: PARQUET +Location [not included in comparison]/{warehouse_dir}/explain_temp1 +Schema: root +-- key: integer (nullable = true) +-- val: integer (nullable = true) +), false + +(4) SubqueryAlias +Arguments: spark_catalog.default.explain_temp1 + +(5) Project +Arguments: [key#x, val#x] -- !query @@ -900,7 +894,7 @@ struct == Physical Plan == * HashAggregate (5) +- Exchange (4) - +- HashAggregate (3) + +- * HashAggregate (3) +- * ColumnarToRow (2) +- Scan parquet default.explain_temp1 (1) @@ -914,23 +908,23 @@ ReadSchema: struct (2) ColumnarToRow [codegen id : 1] Input [2]: [key#x, val#x] -(3) HashAggregate +(3) HashAggregate [codegen id : 1] Input [2]: [key#x, val#x] Keys: [] -Functions [3]: [partial_count(val#x), partial_sum(cast(key#x as bigint)), partial_count(key#x) FILTER (WHERE (val#x > 1))] +Functions [3]: [partial_count(val#x), partial_sum(key#x), partial_count(key#x) FILTER (WHERE (val#x > 1))] Aggregate Attributes [3]: [count#xL, sum#xL, count#xL] Results [3]: [count#xL, sum#xL, count#xL] (4) Exchange Input [3]: [count#xL, sum#xL, count#xL] -Arguments: SinglePartition, true, [id=#x] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#x] (5) HashAggregate [codegen id : 2] Input [3]: [count#xL, sum#xL, count#xL] Keys: [] -Functions [3]: [count(val#x), sum(cast(key#x as bigint)), count(key#x)] -Aggregate Attributes [3]: [count(val#x)#xL, sum(cast(key#x as bigint))#xL, count(key#x)#xL] -Results [2]: [(count(val#x)#xL + sum(cast(key#x as bigint))#xL) AS TOTAL#xL, count(key#x)#xL AS count(key) FILTER (WHERE (val > 1))#xL] +Functions [3]: [count(val#x), sum(key#x), count(key#x)] +Aggregate Attributes [3]: [count(val#x)#xL, sum(key#x)#xL, count(key#x)#xL] +Results [2]: [(count(val#x)#xL + sum(key#x)#xL) AS TOTAL#xL, count(key#x)#xL AS count(key) FILTER (WHERE (val > 1))#xL] -- !query @@ -967,7 +961,7 @@ Results [2]: [key#x, buf#x] (4) Exchange Input [2]: [key#x, buf#x] -Arguments: hashpartitioning(key#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x] (5) ObjectHashAggregate Input [2]: [key#x, buf#x] @@ -1017,7 +1011,7 @@ Results [2]: [key#x, min#x] (5) Exchange Input [2]: [key#x, min#x] -Arguments: hashpartitioning(key#x, 4), true, [id=#x] +Arguments: hashpartitioning(key#x, 4), ENSURE_REQUIREMENTS, [id=#x] (6) Sort [codegen id : 2] Input [2]: [key#x, min#x] diff --git a/sql/core/src/test/resources/sql-tests/results/extract.sql.out b/sql/core/src/test/resources/sql-tests/results/extract.sql.out index 9d3fe5d17fafa..5a7cd665255c1 100644 --- a/sql/core/src/test/resources/sql-tests/results/extract.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/extract.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 100 +-- Number of queries: 125 -- !query @@ -197,7 +197,7 @@ struct -- !query select extract(hour from c), extract(hour from i) from t -- !query schema -struct +struct -- !query output 7 16 @@ -205,7 +205,7 @@ struct -- !query select extract(h from c), extract(h from i) from t -- !query schema -struct +struct -- !query output 7 16 @@ -213,7 +213,7 @@ struct -- !query select extract(hours from c), extract(hours from i) from t -- !query schema -struct +struct -- !query output 7 16 @@ -221,7 +221,7 @@ struct -- !query select extract(hr from c), extract(hr from i) from t -- !query schema -struct +struct -- !query output 7 16 @@ -229,7 +229,7 @@ struct -- !query select extract(hrs from c), extract(hrs from i) from t -- !query schema -struct +struct -- !query output 7 16 @@ -320,7 +320,7 @@ select extract(not_supported from c) from t struct<> -- !query output org.apache.spark.sql.AnalysisException -Literals of type 'not_supported' are currently not supported for the string type.;; line 1 pos 7 +Literals of type 'not_supported' are currently not supported for the string type.; line 1 pos 7 -- !query @@ -329,7 +329,7 @@ select extract(not_supported from i) from t struct<> -- !query output org.apache.spark.sql.AnalysisException -Literals of type 'not_supported' are currently not supported for the interval type.;; line 1 pos 7 +Literals of type 'not_supported' are currently not supported for the interval type.; line 1 pos 7 -- !query @@ -519,7 +519,7 @@ struct -- !query select date_part('hour', c), date_part('hour', i) from t -- !query schema -struct +struct -- !query output 7 16 @@ -527,7 +527,7 @@ struct -- !query select date_part('h', c), date_part('h', i) from t -- !query schema -struct +struct -- !query output 7 16 @@ -535,7 +535,7 @@ struct -- !query select date_part('hours', c), date_part('hours', i) from t -- !query schema -struct +struct -- !query output 7 16 @@ -543,7 +543,7 @@ struct -- !query select date_part('hr', c), date_part('hr', i) from t -- !query schema -struct +struct -- !query output 7 16 @@ -551,7 +551,7 @@ struct -- !query select date_part('hrs', c), date_part('hrs', i) from t -- !query schema -struct +struct -- !query output 7 16 @@ -642,7 +642,7 @@ select date_part('not_supported', c) from t struct<> -- !query output org.apache.spark.sql.AnalysisException -Literals of type 'not_supported' are currently not supported for the string type.;; line 1 pos 7 +Literals of type 'not_supported' are currently not supported for the string type.; line 1 pos 7 -- !query @@ -651,7 +651,7 @@ select date_part(c, c) from t struct<> -- !query output org.apache.spark.sql.AnalysisException -The field parameter needs to be a foldable string value.;; line 1 pos 7 +The field parameter needs to be a foldable string value.; line 1 pos 7 -- !query @@ -668,7 +668,7 @@ select date_part(i, i) from t struct<> -- !query output org.apache.spark.sql.AnalysisException -The field parameter needs to be a foldable string value.;; line 1 pos 7 +The field parameter needs to be a foldable string value.; line 1 pos 7 -- !query @@ -778,7 +778,7 @@ struct -- !query select c - i from t -- !query schema -struct +struct -- !query output 1999-08-05 14:18:02.334456 @@ -786,7 +786,7 @@ struct -- !query select year(c - i) from t -- !query schema -struct +struct -- !query output 1999 @@ -794,7 +794,7 @@ struct -- !query select extract(year from c - i) from t -- !query schema -struct +struct -- !query output 1999 @@ -802,6 +802,211 @@ struct -- !query select extract(month from to_timestamp(c) - i) from t -- !query schema -struct +struct -- !query output 8 + + +-- !query +select extract(YEAR from interval '2-1' YEAR TO MONTH) +-- !query schema +struct +-- !query output +2 + + +-- !query +select date_part('YEAR', interval '2-1' YEAR TO MONTH) +-- !query schema +struct +-- !query output +2 + + +-- !query +select extract(YEAR from -interval '2-1' YEAR TO MONTH) +-- !query schema +struct +-- !query output +-2 + + +-- !query +select extract(MONTH from interval '2-1' YEAR TO MONTH) +-- !query schema +struct +-- !query output +1 + + +-- !query +select date_part('MONTH', interval '2-1' YEAR TO MONTH) +-- !query schema +struct +-- !query output +1 + + +-- !query +select extract(MONTH from -interval '2-1' YEAR TO MONTH) +-- !query schema +struct +-- !query output +-1 + + +-- !query +select date_part(NULL, interval '2-1' YEAR TO MONTH) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select extract(DAY from interval '2-1' YEAR TO MONTH) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Literals of type 'DAY' are currently not supported for the interval year to month type.; line 1 pos 7 + + +-- !query +select date_part('DAY', interval '2-1' YEAR TO MONTH) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Literals of type 'DAY' are currently not supported for the interval year to month type.; line 1 pos 7 + + +-- !query +select date_part('not_supported', interval '2-1' YEAR TO MONTH) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Literals of type 'not_supported' are currently not supported for the interval year to month type.; line 1 pos 7 + + +-- !query +select extract(DAY from interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +123 + + +-- !query +select date_part('DAY', interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +123 + + +-- !query +select extract(DAY from -interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +-123 + + +-- !query +select extract(HOUR from interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +12 + + +-- !query +select date_part('HOUR', interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +12 + + +-- !query +select extract(HOUR from -interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +-12 + + +-- !query +select extract(MINUTE from interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +34 + + +-- !query +select date_part('MINUTE', interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +34 + + +-- !query +select extract(MINUTE from -interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +-34 + + +-- !query +select extract(SECOND from interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +56.789123 + + +-- !query +select date_part('SECOND', interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +56.789123 + + +-- !query +select extract(SECOND from -interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +-56.789123 + + +-- !query +select date_part(NULL, interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select extract(MONTH from interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Literals of type 'MONTH' are currently not supported for the interval day to second type.; line 1 pos 7 + + +-- !query +select date_part('not_supported', interval '123 12:34:56.789123123' DAY TO SECOND) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Literals of type 'not_supported' are currently not supported for the interval day to second type.; line 1 pos 7 diff --git a/sql/core/src/test/resources/sql-tests/results/group-analytics.sql.out b/sql/core/src/test/resources/sql-tests/results/group-analytics.sql.out index c4f9ea1fe026a..f249908163d01 100644 --- a/sql/core/src/test/resources/sql-tests/results/group-analytics.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/group-analytics.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 29 +-- Number of queries: 52 -- !query @@ -110,6 +110,38 @@ dotNET 2012 15000 dotNET 2013 48000 +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP(course, year, (course, year)) ORDER BY course, year +-- !query schema +struct +-- !query output +NULL NULL 113000 +Java NULL 50000 +Java 2012 20000 +Java 2012 20000 +Java 2013 30000 +Java 2013 30000 +dotNET NULL 63000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2013 48000 +dotNET 2013 48000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP(course, year, (course, year), ()) ORDER BY course, year +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Empty set in ROLLUP grouping sets is not supported.(line 1, pos 61) + +== SQL == +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY ROLLUP(course, year, (course, year), ()) ORDER BY course, year +-------------------------------------------------------------^^^ + + -- !query SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year) ORDER BY course, year -- !query schema @@ -126,6 +158,52 @@ dotNET 2012 15000 dotNET 2013 48000 +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year, (course, year)) ORDER BY course, year +-- !query schema +struct +-- !query output +NULL NULL 113000 +NULL 2012 35000 +NULL 2013 78000 +Java NULL 50000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +dotNET NULL 63000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year, (course, year), ()) ORDER BY course, year +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Empty set in CUBE grouping sets is not supported.(line 1, pos 61) + +== SQL == +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year, (course, year), ()) ORDER BY course, year +-------------------------------------------------------------^^^ + + -- !query SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(course, year) -- !query schema @@ -137,6 +215,18 @@ NULL 2013 78000 dotNET NULL 63000 +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(course, year, ()) +-- !query schema +struct +-- !query output +Java NULL 50000 +NULL 2012 35000 +NULL 2013 78000 +NULL NULL 113000 +dotNET NULL 63000 + + -- !query SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(course) -- !query schema @@ -155,6 +245,160 @@ NULL 2012 35000 NULL 2013 78000 +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY course, CUBE(course, year) ORDER BY course, year +-- !query schema +struct +-- !query output +Java NULL 50000 +Java NULL 50000 +Java 2012 20000 +Java 2012 20000 +Java 2013 30000 +Java 2013 30000 +dotNET NULL 63000 +dotNET NULL 63000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2013 48000 +dotNET 2013 48000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year), ROLLUP(course, year) ORDER BY course, year +-- !query schema +struct +-- !query output +NULL NULL 113000 +NULL 2012 35000 +NULL 2013 78000 +Java NULL 50000 +Java NULL 50000 +Java NULL 50000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +dotNET NULL 63000 +dotNET NULL 63000 +dotNET NULL 63000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 + + +-- !query +SELECT course, year, SUM(earnings) FROM courseSales GROUP BY CUBE(course, year), ROLLUP(course, year), GROUPING SETS(course, year) ORDER BY course, year +-- !query schema +struct +-- !query output +NULL 2012 35000 +NULL 2012 35000 +NULL 2013 78000 +NULL 2013 78000 +Java NULL 50000 +Java NULL 50000 +Java NULL 50000 +Java NULL 50000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2012 20000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +Java 2013 30000 +dotNET NULL 63000 +dotNET NULL 63000 +dotNET NULL 63000 +dotNET NULL 63000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2012 15000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 +dotNET 2013 48000 + + -- !query SELECT course, SUM(earnings) AS sum FROM courseSales GROUP BY course, earnings GROUPING SETS((), (course), (course, earnings)) ORDER BY course, sum @@ -210,7 +454,7 @@ SELECT course, year, GROUPING(course) FROM courseSales GROUP BY course, year struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping() can only be used with GroupingSets/Cube/Rollup; +grouping() can only be used with GroupingSets/Cube/Rollup -- !query @@ -219,7 +463,7 @@ SELECT course, year, GROUPING_ID(course, year) FROM courseSales GROUP BY course, struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping_id() can only be used with GroupingSets/Cube/Rollup; +grouping_id() can only be used with GroupingSets/Cube/Rollup -- !query @@ -255,7 +499,7 @@ SELECT course, year FROM courseSales GROUP BY course, year HAVING GROUPING(cours struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup; +grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup -- !query @@ -264,7 +508,7 @@ SELECT course, year FROM courseSales GROUP BY course, year HAVING GROUPING_ID(co struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup; +grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup -- !query @@ -319,7 +563,7 @@ SELECT course, year FROM courseSales GROUP BY course, year ORDER BY GROUPING(cou struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup; +grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup -- !query @@ -328,7 +572,7 @@ SELECT course, year FROM courseSales GROUP BY course, year ORDER BY GROUPING_ID( struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup; +grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup -- !query @@ -392,3 +636,678 @@ struct<(a + b):int,k:int,sum((a - b)):bigint> -- !query output NULL 1 3 NULL 2 0 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, b, CUBE(a, b) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, b, ROLLUP(a, b) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY CUBE(a, b), ROLLUP(a, b) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 +3 NULL 2 +NULL 1 3 +NULL 2 3 +NULL NULL 6 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, CUBE(a, b), ROLLUP(b) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b), (a), ()) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, CUBE(a, b), GROUPING SETS((a, b), (a), ()) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, CUBE(a, b), ROLLUP(a, b), GROUPING SETS((a, b), (a), ()) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(ROLLUP(a, b)) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(GROUPING SETS((a, b), (a), ())) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b), GROUPING SETS(ROLLUP(a, b))) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b, a, b), (a, b, a), (a, b)) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(GROUPING SETS((a, b, a, b), (a, b, a), (a, b))) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(ROLLUP(a, b), CUBE(a, b)) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS(GROUPING SETS((a, b), (a), ()), GROUPING SETS((a, b), (a), (b), ())) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 + + +-- !query +SELECT a, b, count(1) FROM testData GROUP BY a, GROUPING SETS((a, b), (a), (), (a, b), (a), (b), ()) +-- !query schema +struct +-- !query output +1 1 1 +1 1 1 +1 1 1 +1 2 1 +1 2 1 +1 2 1 +1 NULL 2 +1 NULL 2 +1 NULL 2 +1 NULL 2 +2 1 1 +2 1 1 +2 1 1 +2 2 1 +2 2 1 +2 2 1 +2 NULL 2 +2 NULL 2 +2 NULL 2 +2 NULL 2 +3 1 1 +3 1 1 +3 1 1 +3 2 1 +3 2 1 +3 2 1 +3 NULL 2 +3 NULL 2 +3 NULL 2 +3 NULL 2 diff --git a/sql/core/src/test/resources/sql-tests/results/group-by-filter.sql.out b/sql/core/src/test/resources/sql-tests/results/group-by-filter.sql.out index 3fcd132701a3f..e1633d5017e73 100644 --- a/sql/core/src/test/resources/sql-tests/results/group-by-filter.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/group-by-filter.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 37 +-- Number of queries: 76 -- !query @@ -51,7 +51,7 @@ SELECT a, COUNT(b) FILTER (WHERE a >= 2) FROM testData struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping expressions sequence is empty, and 'testdata.`a`' is not an aggregate function. Wrap '(count(testdata.`b`) FILTER (WHERE (testdata.`a` >= 2)) AS `count(b) FILTER (WHERE (a >= 2))`)' in windowing function(s) or wrap 'testdata.`a`' in first() (or first_value) if you don't care which value you get.; +grouping expressions sequence is empty, and 'testdata.a' is not an aggregate function. Wrap '(count(testdata.b) FILTER (WHERE (testdata.a >= 2)) AS `count(b) FILTER (WHERE (a >= 2))`)' in windowing function(s) or wrap 'testdata.a' in first() (or first_value) if you don't care which value you get. -- !query @@ -81,7 +81,7 @@ struct +struct -- !query output 2 @@ -89,11 +89,131 @@ struct +struct -- !query output 2 +-- !query +SELECT COUNT(DISTINCT id) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd HH:mm:ss") = "2001-01-01 00:00:00") FROM emp +-- !query schema +struct +-- !query output +2 + + +-- !query +SELECT COUNT(DISTINCT id), COUNT(DISTINCT id) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd HH:mm:ss") = "2001-01-01 00:00:00") FROM emp +-- !query schema +struct +-- !query output +8 2 + + +-- !query +SELECT COUNT(DISTINCT id) FILTER (WHERE hiredate = to_timestamp("2001-01-01 00:00:00")), COUNT(DISTINCT id) FILTER (WHERE hiredate = to_date('2001-01-01 00:00:00')) FROM emp +-- !query schema +struct +-- !query output +2 2 + + +-- !query +SELECT SUM(salary), COUNT(DISTINCT id), COUNT(DISTINCT id) FILTER (WHERE hiredate = date "2001-01-01") FROM emp +-- !query schema +struct +-- !query output +2450.0 8 2 + + +-- !query +SELECT COUNT(DISTINCT 1) FILTER (WHERE a = 1) FROM testData +-- !query schema +struct +-- !query output +1 + + +-- !query +SELECT COUNT(DISTINCT id) FILTER (WHERE true) FROM emp +-- !query schema +struct +-- !query output +8 + + +-- !query +SELECT COUNT(DISTINCT id) FILTER (WHERE false) FROM emp +-- !query schema +struct +-- !query output +0 + + +-- !query +SELECT COUNT(DISTINCT 2), COUNT(DISTINCT 2,3) FILTER (WHERE dept_id = 40) FROM emp +-- !query schema +struct +-- !query output +1 0 + + +-- !query +SELECT COUNT(DISTINCT 2), COUNT(DISTINCT 3,2) FILTER (WHERE dept_id = 40) FROM emp +-- !query schema +struct +-- !query output +1 0 + + +-- !query +SELECT COUNT(DISTINCT 2), COUNT(DISTINCT 2,3) FILTER (WHERE dept_id > 0) FROM emp +-- !query schema +struct 0)):bigint> +-- !query output +1 1 + + +-- !query +SELECT COUNT(DISTINCT 2), COUNT(DISTINCT 3,2) FILTER (WHERE dept_id > 0) FROM emp +-- !query schema +struct 0)):bigint> +-- !query output +1 1 + + +-- !query +SELECT COUNT(DISTINCT id), COUNT(DISTINCT 2,3) FILTER (WHERE dept_id = 40) FROM emp +-- !query schema +struct +-- !query output +8 0 + + +-- !query +SELECT COUNT(DISTINCT id), COUNT(DISTINCT 3,2) FILTER (WHERE dept_id = 40) FROM emp +-- !query schema +struct +-- !query output +8 0 + + +-- !query +SELECT COUNT(DISTINCT id), COUNT(DISTINCT 2,3) FILTER (WHERE dept_id > 0) FROM emp +-- !query schema +struct 0)):bigint> +-- !query output +8 1 + + +-- !query +SELECT COUNT(DISTINCT id), COUNT(DISTINCT 3,2) FILTER (WHERE dept_id > 0) FROM emp +-- !query schema +struct 0)):bigint> +-- !query output +8 1 + + -- !query SELECT a, COUNT(b) FILTER (WHERE a >= 2) FROM testData GROUP BY a -- !query schema @@ -111,7 +231,7 @@ SELECT a, COUNT(b) FILTER (WHERE a != 2) FROM testData GROUP BY b struct<> -- !query output org.apache.spark.sql.AnalysisException -expression 'testdata.`a`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.; +expression 'testdata.a' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get. -- !query @@ -154,7 +274,7 @@ NULL NULL -- !query SELECT dept_id, SUM(salary) FILTER (WHERE hiredate > to_timestamp("2003-01-01 00:00:00")) FROM emp GROUP BY dept_id -- !query schema -struct to_timestamp(2003-01-01 00:00:00))):double> +struct to_timestamp(2003-01-01 00:00:00))):double> -- !query output 10 200.0 100 400.0 @@ -167,7 +287,7 @@ NULL NULL -- !query SELECT dept_id, SUM(salary) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd") > "2003-01-01") FROM emp GROUP BY dept_id -- !query schema -struct 2003-01-01)):double> +struct 2003-01-01)):double> -- !query output 10 200.0 100 400.0 @@ -177,6 +297,68 @@ struct "2001-01-01 00:00:00") FROM emp GROUP BY dept_id +-- !query schema +struct 2001-01-01 00:00:00)):double> +-- !query output +10 300.0 +100 400.0 +20 300.0 +30 400.0 +70 150.0 +NULL NULL + + +-- !query +SELECT dept_id, SUM(DISTINCT salary), SUM(DISTINCT salary) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd HH:mm:ss") > "2001-01-01 00:00:00") FROM emp GROUP BY dept_id +-- !query schema +struct 2001-01-01 00:00:00)):double> +-- !query output +10 300.0 300.0 +100 400.0 400.0 +20 300.0 300.0 +30 400.0 400.0 +70 150.0 150.0 +NULL 400.0 NULL + + +-- !query +SELECT dept_id, SUM(DISTINCT salary) FILTER (WHERE hiredate > date "2001-01-01"), SUM(DISTINCT salary) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd HH:mm:ss") > "2001-01-01 00:00:00") FROM emp GROUP BY dept_id +-- !query schema +struct DATE '2001-01-01')):double,sum(DISTINCT salary) FILTER (WHERE (date_format(hiredate, yyyy-MM-dd HH:mm:ss) > 2001-01-01 00:00:00)):double> +-- !query output +10 300.0 300.0 +100 400.0 400.0 +20 300.0 300.0 +30 400.0 400.0 +70 150.0 150.0 +NULL NULL NULL + + +-- !query +SELECT dept_id, COUNT(id), SUM(DISTINCT salary), SUM(DISTINCT salary) FILTER (WHERE date_format(hiredate, "yyyy-MM-dd") > "2001-01-01") FROM emp GROUP BY dept_id +-- !query schema +struct 2001-01-01)):double> +-- !query output +10 3 300.0 300.0 +100 2 400.0 400.0 +20 1 300.0 300.0 +30 1 400.0 400.0 +70 1 150.0 150.0 +NULL 1 400.0 NULL + + +-- !query +SELECT b, COUNT(DISTINCT 1) FILTER (WHERE a = 1) FROM testData GROUP BY b +-- !query schema +struct +-- !query output +1 1 +2 1 +NULL 0 + + -- !query SELECT 'foo', COUNT(a) FILTER (WHERE b <= 2) FROM testData GROUP BY 1 -- !query schema @@ -204,7 +386,7 @@ foo 1350.0 -- !query SELECT 'foo', SUM(salary) FILTER (WHERE hiredate >= to_timestamp("2003-01-01")) FROM emp GROUP BY 1 -- !query schema -struct= to_timestamp(2003-01-01))):double> +struct= to_timestamp(2003-01-01))):double> -- !query output foo 1350.0 @@ -261,6 +443,240 @@ struct 200), sum(salary) from emp group by dept_id +-- !query schema +struct 200)):bigint,sum(salary):double> +-- !query output +10 0 400.0 +100 2 800.0 +20 1 300.0 +30 1 400.0 +70 1 150.0 +NULL 1 400.0 + + +-- !query +select dept_id, count(distinct emp_name) filter (where id + dept_id > 500), sum(salary) from emp group by dept_id +-- !query schema +struct 500)):bigint,sum(salary):double> +-- !query output +10 0 400.0 +100 2 800.0 +20 0 300.0 +30 0 400.0 +70 1 150.0 +NULL 0 400.0 + + +-- !query +select dept_id, count(distinct emp_name), count(distinct emp_name) filter (where id > 200), sum(salary) from emp group by dept_id +-- !query schema +struct 200)):bigint,sum(salary):double> +-- !query output +10 2 0 400.0 +100 2 2 800.0 +20 1 1 300.0 +30 1 1 400.0 +70 1 1 150.0 +NULL 1 1 400.0 + + +-- !query +select dept_id, count(distinct emp_name), count(distinct emp_name) filter (where id + dept_id > 500), sum(salary) from emp group by dept_id +-- !query schema +struct 500)):bigint,sum(salary):double> +-- !query output +10 2 0 400.0 +100 2 2 800.0 +20 1 0 300.0 +30 1 0 400.0 +70 1 1 150.0 +NULL 1 0 400.0 + + +-- !query +select dept_id, count(distinct emp_name), count(distinct emp_name) filter (where id > 200), sum(salary), sum(salary) filter (where id > 200) from emp group by dept_id +-- !query schema +struct 200)):bigint,sum(salary):double,sum(salary) FILTER (WHERE (id > 200)):double> +-- !query output +10 2 0 400.0 NULL +100 2 2 800.0 800.0 +20 1 1 300.0 300.0 +30 1 1 400.0 400.0 +70 1 1 150.0 150.0 +NULL 1 1 400.0 400.0 + + +-- !query +select dept_id, count(distinct emp_name), count(distinct emp_name) filter (where id + dept_id > 500), sum(salary), sum(salary) filter (where id > 200) from emp group by dept_id +-- !query schema +struct 500)):bigint,sum(salary):double,sum(salary) FILTER (WHERE (id > 200)):double> +-- !query output +10 2 0 400.0 NULL +100 2 2 800.0 800.0 +20 1 0 300.0 300.0 +30 1 0 400.0 400.0 +70 1 1 150.0 150.0 +NULL 1 0 400.0 400.0 + + +-- !query +select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct hiredate), sum(salary) from emp group by dept_id +-- !query schema +struct 200)):bigint,count(DISTINCT hiredate):bigint,sum(salary):double> +-- !query output +10 0 2 400.0 +100 2 2 800.0 +20 1 1 300.0 +30 1 1 400.0 +70 1 1 150.0 +NULL 1 1 400.0 + + +-- !query +select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) from emp group by dept_id +-- !query schema +struct 200)):bigint,count(DISTINCT hiredate) FILTER (WHERE (hiredate > DATE '2003-01-01')):bigint,sum(salary):double> +-- !query output +10 0 1 400.0 +100 2 1 800.0 +20 1 0 300.0 +30 1 1 400.0 +70 1 1 150.0 +NULL 1 0 400.0 + + +-- !query +select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) filter (where salary < 400.00D) from emp group by dept_id +-- !query schema +struct 200)):bigint,count(DISTINCT hiredate) FILTER (WHERE (hiredate > DATE '2003-01-01')):bigint,sum(salary) FILTER (WHERE (salary < 400.0)):double> +-- !query output +10 0 1 400.0 +100 2 1 NULL +20 1 0 300.0 +30 1 1 NULL +70 1 1 150.0 +NULL 1 0 NULL + + +-- !query +select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) filter (where salary < 400.00D), sum(salary) filter (where id > 200) from emp group by dept_id +-- !query schema +struct 200)):bigint,count(DISTINCT hiredate) FILTER (WHERE (hiredate > DATE '2003-01-01')):bigint,sum(salary) FILTER (WHERE (salary < 400.0)):double,sum(salary) FILTER (WHERE (id > 200)):double> +-- !query output +10 0 1 400.0 NULL +100 2 1 NULL 800.0 +20 1 0 300.0 300.0 +30 1 1 NULL 400.0 +70 1 1 150.0 150.0 +NULL 1 0 NULL 400.0 + + +-- !query +select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct emp_name), sum(salary) from emp group by dept_id +-- !query schema +struct 200)):bigint,count(DISTINCT emp_name):bigint,sum(salary):double> +-- !query output +10 0 2 400.0 +100 2 2 800.0 +20 1 1 300.0 +30 1 1 400.0 +70 1 1 150.0 +NULL 1 1 400.0 + + +-- !query +select dept_id, count(distinct emp_name) filter (where id > 200), count(distinct emp_name) filter (where hiredate > date "2003-01-01"), sum(salary) from emp group by dept_id +-- !query schema +struct 200)):bigint,count(DISTINCT emp_name) FILTER (WHERE (hiredate > DATE '2003-01-01')):bigint,sum(salary):double> +-- !query output +10 0 1 400.0 +100 2 1 800.0 +20 1 0 300.0 +30 1 1 400.0 +70 1 1 150.0 +NULL 1 0 400.0 + + +-- !query +select dept_id, sum(distinct (id + dept_id)) filter (where id > 200), count(distinct hiredate), sum(salary) from emp group by dept_id +-- !query schema +struct 200)):bigint,count(DISTINCT hiredate):bigint,sum(salary):double> +-- !query output +10 NULL 2 400.0 +100 1500 2 800.0 +20 320 1 300.0 +30 430 1 400.0 +70 870 1 150.0 +NULL NULL 1 400.0 + + +-- !query +select dept_id, sum(distinct (id + dept_id)) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) from emp group by dept_id +-- !query schema +struct 200)):bigint,count(DISTINCT hiredate) FILTER (WHERE (hiredate > DATE '2003-01-01')):bigint,sum(salary):double> +-- !query output +10 NULL 1 400.0 +100 1500 1 800.0 +20 320 0 300.0 +30 430 1 400.0 +70 870 1 150.0 +NULL NULL 0 400.0 + + +-- !query +select dept_id, avg(distinct (id + dept_id)) filter (where id > 200), count(distinct hiredate) filter (where hiredate > date "2003-01-01"), sum(salary) filter (where salary < 400.00D) from emp group by dept_id +-- !query schema +struct 200)):double,count(DISTINCT hiredate) FILTER (WHERE (hiredate > DATE '2003-01-01')):bigint,sum(salary) FILTER (WHERE (salary < 400.0)):double> +-- !query output +10 NULL 1 400.0 +100 750.0 1 NULL +20 320.0 0 300.0 +30 430.0 1 NULL +70 870.0 1 150.0 +NULL NULL 0 NULL + + +-- !query +select dept_id, count(distinct emp_name, hiredate) filter (where id > 200), sum(salary) from emp group by dept_id +-- !query schema +struct 200)):bigint,sum(salary):double> +-- !query output +10 0 400.0 +100 2 800.0 +20 1 300.0 +30 1 400.0 +70 1 150.0 +NULL 1 400.0 + + +-- !query +select dept_id, count(distinct emp_name, hiredate) filter (where id > 0), sum(salary) from emp group by dept_id +-- !query schema +struct 0)):bigint,sum(salary):double> +-- !query output +10 2 400.0 +100 2 800.0 +20 1 300.0 +30 1 400.0 +70 1 150.0 +NULL 1 400.0 + + +-- !query +select dept_id, count(distinct 1), count(distinct 1) filter (where id > 200), sum(salary) from emp group by dept_id +-- !query schema +struct 200)):bigint,sum(salary):double> +-- !query output +10 1 0 400.0 +100 1 1 800.0 +20 1 1 300.0 +30 1 1 400.0 +70 1 1 150.0 +NULL 1 1 400.0 + + -- !query SELECT 'foo', APPROX_COUNT_DISTINCT(a) FILTER (WHERE b >= 0) FROM testData WHERE a = 0 GROUP BY 1 -- !query schema @@ -272,7 +688,7 @@ struct= 0)):bigint> -- !query SELECT 'foo', MAX(STRUCT(a)) FILTER (WHERE b >= 1) FROM testData WHERE a = 0 GROUP BY 1 -- !query schema -struct= 1)):struct> +struct= 1)):struct> -- !query output @@ -295,7 +711,7 @@ SELECT a + 2, COUNT(b) FILTER (WHERE b IN (1, 2)) FROM testData GROUP BY a + 1 struct<> -- !query output org.apache.spark.sql.AnalysisException -expression 'testdata.`a`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.; +expression 'testdata.a' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get. -- !query @@ -309,6 +725,15 @@ struct<((a + 1) + 1):int,count(b) FILTER (WHERE (b > 0)):bigint> NULL 1 +-- !query +SELECT COUNT(DISTINCT b) FILTER (WHERE b > 0), COUNT(DISTINCT b, c) FILTER (WHERE b > 0 AND c > 2) +FROM (SELECT 1 AS a, 2 AS b, 3 AS c) GROUP BY a +-- !query schema +struct 0)):bigint,count(DISTINCT b, c) FILTER (WHERE ((b > 0) AND (c > 2))):bigint> +-- !query output +1 1 + + -- !query SELECT a AS k, COUNT(b) FILTER (WHERE b > 0) FROM testData GROUP BY k -- !query schema @@ -370,14 +795,17 @@ IN/EXISTS predicate sub-queries can only be used in Filter/Join and a few comman : +- Project [state#x] : +- Filter (dept_id#x = outer(dept_id#x)) : +- SubqueryAlias dept -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- View (`DEPT`, [dept_id#x,dept_name#x,state#x]) +: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] +: +- Project [dept_id#x, dept_name#x, state#x] +: +- SubqueryAlias DEPT +: +- LocalRelation [dept_id#x, dept_name#x, state#x] +- SubqueryAlias emp - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -; + +- View (`EMP`, [id#x,emp_name#x,hiredate#x,salary#x,dept_id#x]) + +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] + +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- SubqueryAlias EMP + +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -- !query @@ -396,14 +824,17 @@ IN/EXISTS predicate sub-queries can only be used in Filter/Join and a few comman : +- Project [state#x] : +- Filter (dept_id#x = outer(dept_id#x)) : +- SubqueryAlias dept -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- View (`DEPT`, [dept_id#x,dept_name#x,state#x]) +: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] +: +- Project [dept_id#x, dept_name#x, state#x] +: +- SubqueryAlias DEPT +: +- LocalRelation [dept_id#x, dept_name#x, state#x] +- SubqueryAlias emp - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -; + +- View (`EMP`, [id#x,emp_name#x,hiredate#x,salary#x,dept_id#x]) + +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] + +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- SubqueryAlias EMP + +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -- !query @@ -421,14 +852,17 @@ IN/EXISTS predicate sub-queries can only be used in Filter/Join and a few comman : +- Distinct : +- Project [dept_id#x] : +- SubqueryAlias dept -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- View (`DEPT`, [dept_id#x,dept_name#x,state#x]) +: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] +: +- Project [dept_id#x, dept_name#x, state#x] +: +- SubqueryAlias DEPT +: +- LocalRelation [dept_id#x, dept_name#x, state#x] +- SubqueryAlias emp - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -; + +- View (`EMP`, [id#x,emp_name#x,hiredate#x,salary#x,dept_id#x]) + +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] + +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- SubqueryAlias EMP + +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -- !query @@ -446,14 +880,17 @@ IN/EXISTS predicate sub-queries can only be used in Filter/Join and a few comman : +- Distinct : +- Project [dept_id#x] : +- SubqueryAlias dept -: +- Project [dept_id#x, dept_name#x, state#x] -: +- SubqueryAlias DEPT -: +- LocalRelation [dept_id#x, dept_name#x, state#x] +: +- View (`DEPT`, [dept_id#x,dept_name#x,state#x]) +: +- Project [cast(dept_id#x as int) AS dept_id#x, cast(dept_name#x as string) AS dept_name#x, cast(state#x as string) AS state#x] +: +- Project [dept_id#x, dept_name#x, state#x] +: +- SubqueryAlias DEPT +: +- LocalRelation [dept_id#x, dept_name#x, state#x] +- SubqueryAlias emp - +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] - +- SubqueryAlias EMP - +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -; + +- View (`EMP`, [id#x,emp_name#x,hiredate#x,salary#x,dept_id#x]) + +- Project [cast(id#x as int) AS id#x, cast(emp_name#x as string) AS emp_name#x, cast(hiredate#x as date) AS hiredate#x, cast(salary#x as double) AS salary#x, cast(dept_id#x as int) AS dept_id#x] + +- Project [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] + +- SubqueryAlias EMP + +- LocalRelation [id#x, emp_name#x, hiredate#x, salary#x, dept_id#x] -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/group-by-ordinal.sql.out b/sql/core/src/test/resources/sql-tests/results/group-by-ordinal.sql.out index bf9f606a2224e..92e4a861fa1aa 100644 --- a/sql/core/src/test/resources/sql-tests/results/group-by-ordinal.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/group-by-ordinal.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 20 +-- Number of queries: 33 -- !query @@ -122,7 +122,7 @@ select a, b, sum(b) from data group by 3 struct<> -- !query output org.apache.spark.sql.AnalysisException -aggregate functions are not allowed in GROUP BY, but found sum(CAST(data.`b` AS BIGINT)); +GROUP BY 3 refers to an expression that is or contains an aggregate function. Aggregate functions are not allowed in GROUP BY, but got sum(data.b) AS `sum(b)`; line 1 pos 39 -- !query @@ -131,7 +131,7 @@ select a, b, sum(b) + 2 from data group by 3 struct<> -- !query output org.apache.spark.sql.AnalysisException -aggregate functions are not allowed in GROUP BY, but found (sum(CAST(data.`b` AS BIGINT)) + CAST(2 AS BIGINT)); +GROUP BY 3 refers to an expression that is or contains an aggregate function. Aggregate functions are not allowed in GROUP BY, but got (sum(data.b) + CAST(2 AS BIGINT)) AS `(sum(b) + 2)`; line 1 pos 43 -- !query @@ -155,7 +155,7 @@ select * from data group by a, b, 1 struct<> -- !query output org.apache.spark.sql.AnalysisException -Star (*) is not allowed in select list when GROUP BY ordinal position is used; +Star (*) is not allowed in select list when GROUP BY ordinal position is used -- !query @@ -184,6 +184,204 @@ struct 3 3 2 +-- !query +select a, b, count(1) from data group by cube(1, 2) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +NULL 1 3 +NULL 2 3 +NULL NULL 6 + + +-- !query +select a, b, count(1) from data group by cube(1, b) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +NULL 1 3 +NULL 2 3 +NULL NULL 6 + + +-- !query +select a, b, count(1) from data group by 1, 2 with cube +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +NULL 1 3 +NULL 2 3 +NULL NULL 6 + + +-- !query +select a, b, count(1) from data group by rollup(1, 2) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +NULL NULL 6 + + +-- !query +select a, b, count(1) from data group by rollup(1, b) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +NULL NULL 6 + + +-- !query +select a, b, count(1) from data group by 1, 2 with rollup +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +NULL NULL 6 + + +-- !query +select a, b, count(1) from data group by grouping sets((1), (2), (1, 2)) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +NULL 1 3 +NULL 2 3 + + +-- !query +select a, b, count(1) from data group by grouping sets((1), (b), (a, 2)) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +NULL 1 3 +NULL 2 3 + + +-- !query +select a, b, count(1) from data group by a, 2 grouping sets((1), (b), (a, 2)) +-- !query schema +struct +-- !query output +1 1 1 +1 2 1 +1 NULL 2 +2 1 1 +2 2 1 +2 NULL 2 +3 1 1 +3 2 1 +3 NULL 2 +NULL 1 3 +NULL 2 3 + + +-- !query +select a, b, count(1) from data group by a, -1 +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +GROUP BY position -1 is not in select list (valid range is [1, 3]); line 1 pos 44 + + +-- !query +select a, b, count(1) from data group by a, 3 +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +GROUP BY 3 refers to an expression that is or contains an aggregate function. Aggregate functions are not allowed in GROUP BY, but got count(1) AS `count(1)`; line 1 pos 44 + + +-- !query +select a, b, count(1) from data group by cube(-1, 2) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +GROUP BY position -1 is not in select list (valid range is [1, 3]); line 1 pos 46 + + +-- !query +select a, b, count(1) from data group by cube(1, 3) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +GROUP BY 3 refers to an expression that is or contains an aggregate function. Aggregate functions are not allowed in GROUP BY, but got count(1) AS `count(1)`; line 1 pos 49 + + -- !query set spark.sql.groupByOrdinal=false -- !query schema diff --git a/sql/core/src/test/resources/sql-tests/results/group-by.sql.out b/sql/core/src/test/resources/sql-tests/results/group-by.sql.out index 7bfdd0ad53a95..b5471a785a224 100644 --- a/sql/core/src/test/resources/sql-tests/results/group-by.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/group-by.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 56 +-- Number of queries: 64 -- !query @@ -18,7 +18,7 @@ SELECT a, COUNT(b) FROM testData struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping expressions sequence is empty, and 'testdata.`a`' is not an aggregate function. Wrap '(count(testdata.`b`) AS `count(b)`)' in windowing function(s) or wrap 'testdata.`a`' in first() (or first_value) if you don't care which value you get.; +grouping expressions sequence is empty, and 'testdata.a' is not an aggregate function. Wrap '(count(testdata.b) AS `count(b)`)' in windowing function(s) or wrap 'testdata.a' in first() (or first_value) if you don't care which value you get. -- !query @@ -46,7 +46,7 @@ SELECT a, COUNT(b) FROM testData GROUP BY b struct<> -- !query output org.apache.spark.sql.AnalysisException -expression 'testdata.`a`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.; +expression 'testdata.a' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get. -- !query @@ -87,7 +87,7 @@ struct -- !query SELECT 'foo', MAX(STRUCT(a)) FROM testData WHERE a = 0 GROUP BY 1 -- !query schema -struct> +struct> -- !query output @@ -110,7 +110,7 @@ SELECT a + 2, COUNT(b) FROM testData GROUP BY a + 1 struct<> -- !query output org.apache.spark.sql.AnalysisException -expression 'testdata.`a`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.; +expression 'testdata.a' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get. -- !query @@ -128,7 +128,7 @@ NULL 1 SELECT SKEWNESS(a), KURTOSIS(a), MIN(a), MAX(a), AVG(a), VARIANCE(a), STDDEV(a), SUM(a), COUNT(a) FROM testData -- !query schema -struct +struct -- !query output -0.2723801058145729 -1.5069204152249134 1 3 2.142857142857143 0.8095238095238094 0.8997354108424372 15 7 @@ -167,7 +167,7 @@ SELECT COUNT(b) AS k FROM testData GROUP BY k struct<> -- !query output org.apache.spark.sql.AnalysisException -aggregate functions are not allowed in GROUP BY, but found count(testdata.`b`); +aggregate functions are not allowed in GROUP BY, but found count(testdata.b) -- !query @@ -185,7 +185,7 @@ SELECT k AS a, COUNT(v) FROM testDataHasSameNameWithAlias GROUP BY a struct<> -- !query output org.apache.spark.sql.AnalysisException -expression 'testdatahassamenamewithalias.`k`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.; +expression 'testdatahassamenamewithalias.k' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get. -- !query @@ -202,7 +202,7 @@ SELECT a AS k, COUNT(b) FROM testData GROUP BY k struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`k`' given input columns: [testdata.a, testdata.b]; line 1 pos 47 +cannot resolve 'k' given input columns: [testdata.a, testdata.b]; line 1 pos 47 -- !query @@ -247,7 +247,7 @@ struct<1:int> SELECT corr(DISTINCT x, y), corr(DISTINCT y, x), count(*) FROM (VALUES (1, 1), (2, 2), (2, 2)) t(x, y) -- !query schema -struct +struct -- !query output 1.0 1.0 3 @@ -274,7 +274,68 @@ SELECT id FROM range(10) HAVING id > 0 struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping expressions sequence is empty, and '`id`' is not an aggregate function. Wrap '()' in windowing function(s) or wrap '`id`' in first() (or first_value) if you don't care which value you get.; +grouping expressions sequence is empty, and 'id' is not an aggregate function. Wrap '()' in windowing function(s) or wrap 'id' in first() (or first_value) if you don't care which value you get. + + +-- !query +SET spark.sql.legacy.parser.havingWithoutGroupByAsWhere=true +-- !query schema +struct +-- !query output +spark.sql.legacy.parser.havingWithoutGroupByAsWhere true + + +-- !query +SELECT 1 FROM range(10) HAVING true +-- !query schema +struct<1:int> +-- !query output +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 + + +-- !query +SELECT 1 FROM range(10) HAVING MAX(id) > 0 +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException + +Aggregate/Window/Generate expressions are not valid in where clause of the query. +Expression in where clause: [(max(id) > CAST(0 AS BIGINT))] +Invalid expressions: [max(id)] + + +-- !query +SELECT id FROM range(10) HAVING id > 0 +-- !query schema +struct +-- !query output +1 +2 +3 +4 +5 +6 +7 +8 +9 + + +-- !query +SET spark.sql.legacy.parser.havingWithoutGroupByAsWhere=false +-- !query schema +struct +-- !query output +spark.sql.legacy.parser.havingWithoutGroupByAsWhere false -- !query @@ -548,7 +609,7 @@ org.apache.spark.sql.AnalysisException Aggregate/Window/Generate expressions are not valid in where clause of the query. Expression in where clause: [(count(1) > 1L)] -Invalid expressions: [count(1)]; +Invalid expressions: [count(1)] -- !query @@ -560,7 +621,7 @@ org.apache.spark.sql.AnalysisException Aggregate/Window/Generate expressions are not valid in where clause of the query. Expression in where clause: [((count(1) + 1L) > 1L)] -Invalid expressions: [count(1)]; +Invalid expressions: [count(1)] -- !query @@ -571,5 +632,35 @@ struct<> org.apache.spark.sql.AnalysisException Aggregate/Window/Generate expressions are not valid in where clause of the query. -Expression in where clause: [(((test_agg.`k` = 1) OR (test_agg.`k` = 2)) OR (((count(1) + 1L) > 1L) OR (max(test_agg.`k`) > 1)))] -Invalid expressions: [count(1), max(test_agg.`k`)]; +Expression in where clause: [(((test_agg.k = 1) OR (test_agg.k = 2)) OR (((count(1) + 1L) > 1L) OR (max(test_agg.k) > 1)))] +Invalid expressions: [count(1), max(test_agg.k)] + + +-- !query +SELECT AVG(DISTINCT decimal_col), SUM(DISTINCT decimal_col) FROM VALUES (CAST(1 AS DECIMAL(9, 0))) t(decimal_col) +-- !query schema +struct +-- !query output +1.0000 1 + + +-- !query +SELECT not(a IS NULL), count(*) AS c +FROM testData +GROUP BY a IS NULL +-- !query schema +struct<(NOT (a IS NULL)):boolean,c:bigint> +-- !query output +false 2 +true 7 + + +-- !query +SELECT if(not(a IS NULL), rand(0), 1), count(*) AS c +FROM testData +GROUP BY a IS NULL +-- !query schema +struct<(IF((NOT (a IS NULL)), rand(0), 1)):double,c:bigint> +-- !query output +0.7604953758285915 7 +1.0 2 diff --git a/sql/core/src/test/resources/sql-tests/results/grouping_set.sql.out b/sql/core/src/test/resources/sql-tests/results/grouping_set.sql.out index 7089e10cdef27..6af8e7048c815 100644 --- a/sql/core/src/test/resources/sql-tests/results/grouping_set.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/grouping_set.sql.out @@ -165,7 +165,7 @@ SELECT c1 FROM (values (1,2), (3,2)) t(c1, c2) GROUP BY GROUPING SETS (()) struct<> -- !query output org.apache.spark.sql.AnalysisException -expression '`c1`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.; +expression 't.c1' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get. -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/having.sql.out b/sql/core/src/test/resources/sql-tests/results/having.sql.out index 1b3ac7865159f..22e71f4f8a687 100644 --- a/sql/core/src/test/resources/sql-tests/results/having.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/having.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 9 +-- Number of queries: 13 -- !query @@ -43,7 +43,7 @@ struct -- !query SELECT a + b FROM VALUES (1L, 2), (3L, 4) AS T(a, b) GROUP BY a + b HAVING a + b > 1 -- !query schema -struct<(a + CAST(b AS BIGINT)):bigint> +struct<(a + b):bigint> -- !query output 3 7 @@ -81,3 +81,35 @@ SELECT SUM(a) AS b FROM VALUES (1, 10), (2, 20) AS T(a, b) GROUP BY ROLLUP(a, b) struct -- !query output 2 + + +-- !query +SELECT c1 FROM VALUES (1, 2) as t(c1, c2) GROUP BY GROUPING SETS(t.c1) HAVING t.c1 = 1 +-- !query schema +struct +-- !query output +1 + + +-- !query +SELECT c1 FROM VALUES (1, 2) as t(c1, c2) GROUP BY CUBE(t.c1) HAVING t.c1 = 1 +-- !query schema +struct +-- !query output +1 + + +-- !query +SELECT c1 FROM VALUES (1, 2) as t(c1, c2) GROUP BY ROLLUP(t.c1) HAVING t.c1 = 1 +-- !query schema +struct +-- !query output +1 + + +-- !query +SELECT c1 FROM VALUES (1, 2) as t(c1, c2) GROUP BY t.c1 HAVING t.c1 = 1 +-- !query schema +struct +-- !query output +1 diff --git a/sql/core/src/test/resources/sql-tests/results/higher-order-functions.sql.out b/sql/core/src/test/resources/sql-tests/results/higher-order-functions.sql.out index d35d0d5d944bb..7b31b5690998c 100644 --- a/sql/core/src/test/resources/sql-tests/results/higher-order-functions.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/higher-order-functions.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 29 +-- Number of queries: 30 -- !query @@ -270,3 +270,11 @@ select transform(ys, (all, i) -> all + i) as v from values (array(32, 97)) as t( struct> -- !query output [32,98] + + +-- !query +select aggregate(split('abcdefgh',''), array(array('')), (acc, x) -> array(array(x))) +-- !query schema +struct>> +-- !query output +[[""]] diff --git a/sql/core/src/test/resources/sql-tests/results/intersect-all.sql.out b/sql/core/src/test/resources/sql-tests/results/intersect-all.sql.out index 4762082dc3be2..caba8c6942c55 100644 --- a/sql/core/src/test/resources/sql-tests/results/intersect-all.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/intersect-all.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 22 +-- Number of queries: 26 -- !query @@ -98,7 +98,7 @@ SELECT array(1), 2 struct<> -- !query output org.apache.spark.sql.AnalysisException -IntersectAll can only be performed on tables with the compatible column types. array <> int at the first column of the second table; +IntersectAll can only be performed on tables with the compatible column types. array <> int at the first column of the second table -- !query @@ -109,7 +109,7 @@ SELECT k, v FROM tab2 struct<> -- !query output org.apache.spark.sql.AnalysisException -IntersectAll can only be performed on tables with the same number of columns, but the first table has 1 columns and the second table has 2 columns; +IntersectAll can only be performed on tables with the same number of columns, but the first table has 1 columns and the second table has 2 columns -- !query @@ -291,6 +291,38 @@ struct spark.sql.legacy.setopsPrecedence.enabled false +-- !query +CREATE OR REPLACE TEMPORARY VIEW tab3 AS VALUES (decimal(1)), (decimal(2)) tbl3(v) +-- !query schema +struct<> +-- !query output + + + +-- !query +SELECT t.v FROM ( + SELECT v FROM tab3 + INTERSECT + SELECT v + v AS v FROM tab3 +) t +-- !query schema +struct +-- !query output +2 + + +-- !query +SELECT SUM(t.v) FROM ( + SELECT v FROM tab3 + INTERSECT + SELECT v + v AS v FROM tab3 +) t +-- !query schema +struct +-- !query output +2 + + -- !query DROP VIEW IF EXISTS tab1 -- !query schema @@ -305,3 +337,11 @@ DROP VIEW IF EXISTS tab2 struct<> -- !query output + + +-- !query +DROP VIEW IF EXISTS tab3 +-- !query schema +struct<> +-- !query output + diff --git a/sql/core/src/test/resources/sql-tests/results/interval.sql.out b/sql/core/src/test/resources/sql-tests/results/interval.sql.out index 01db43ce9e8bc..ef9ef8f67bdd7 100644 --- a/sql/core/src/test/resources/sql-tests/results/interval.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/interval.sql.out @@ -1,19 +1,19 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 91 +-- Number of queries: 134 -- !query select 3 * (timestamp'2019-10-15 10:11:12.001002' - date'2019-10-15') -- !query schema -struct +struct<((TIMESTAMP '2019-10-15 10:11:12.001002' - DATE '2019-10-15') * 3):interval day to second> -- !query output -30 hours 33 minutes 36.003006 seconds +1 06:33:36.003006000 -- !query select interval 4 month 2 weeks 3 microseconds * 1.5 -- !query schema -struct +struct -- !query output 6 months 21 days 0.000005 seconds @@ -21,15 +21,15 @@ struct +struct<((TIMESTAMP '2019-10-15 00:00:00' - TIMESTAMP '2019-10-14 00:00:00') / 1.5):interval day to second> -- !query output -16 hours +0 16:00:00.000000000 -- !query select interval 2147483647 month * 2 -- !query schema -struct +struct -- !query output 178956970 years 7 months @@ -37,7 +37,7 @@ struct +struct -- !query output 178956970 years 7 months @@ -45,7 +45,7 @@ struct +struct -- !query output 2147483647 days 2562047788 hours 54.775807 seconds @@ -53,7 +53,7 @@ struct +struct -- !query output 2147483647 days 2562047788 hours 54.775807 seconds @@ -61,7 +61,7 @@ struct +struct -- !query output NULL @@ -69,7 +69,7 @@ NULL -- !query select interval '2 seconds' / null -- !query schema -struct +struct -- !query output NULL @@ -77,7 +77,7 @@ NULL -- !query select interval '2 seconds' * null -- !query schema -struct +struct -- !query output NULL @@ -85,7 +85,7 @@ NULL -- !query select null * interval '2 seconds' -- !query schema -struct +struct -- !query output NULL @@ -122,6 +122,54 @@ struct<(+ INTERVAL '-1 months 1 days -1 seconds'):interval> -1 months 1 days -1 seconds +-- !query +select interval -'1-1' year to month +-- !query schema +struct +-- !query output +-1-1 + + +-- !query +select interval -'-1-1' year to month +-- !query schema +struct +-- !query output +1-1 + + +-- !query +select interval +'-1-1' year to month +-- !query schema +struct +-- !query output +-1-1 + + +-- !query +select interval - '1 2:3:4.001' day to second +-- !query schema +struct +-- !query output +-1 02:03:04.001000000 + + +-- !query +select interval +'1 2:3:4.001' day to second +-- !query schema +struct +-- !query output +1 02:03:04.001000000 + + +-- !query +select interval -'-1 2:3:4.001' day to second +-- !query schema +struct +-- !query output +1 02:03:04.001000000 + + -- !query select make_interval(1) -- !query schema @@ -173,11 +221,27 @@ struct -- !query select make_interval(1, 2, 3, 4, 5, 6, 7.008009) -- !query schema -struct +struct -- !query output 1 years 2 months 25 days 5 hours 6 minutes 7.008009 seconds +-- !query +select make_interval(1, 2, 3, 4, 0, 0, 123456789012.123456) +-- !query schema +struct +-- !query output +1 years 2 months 25 days 34293552 hours 30 minutes 12.123456 seconds + + +-- !query +select make_interval(0, 0, 0, 0, 0, 0, 1234567890123456789) +-- !query schema +struct +-- !query output +NULL + + -- !query select cast('1 second' as interval) -- !query schema @@ -258,76 +322,92 @@ struct +-- !query output +0-0 + + +-- !query +select interval '0 0:0:0' day to second +-- !query schema +struct +-- !query output +0 00:00:00.000000000 + + -- !query select interval '0 0:0:0.1' day to second -- !query schema -struct +struct -- !query output -0.1 seconds +0 00:00:00.100000000 -- !query select interval '10-9' year to month -- !query schema -struct +struct -- !query output -10 years 9 months +10-9 -- !query select interval '20 15' day to hour -- !query schema -struct +struct -- !query output -20 days 15 hours +20 15:00:00.000000000 -- !query select interval '20 15:40' day to minute -- !query schema -struct +struct -- !query output -20 days 15 hours 40 minutes +20 15:40:00.000000000 -- !query select interval '20 15:40:32.99899999' day to second -- !query schema -struct +struct -- !query output -20 days 15 hours 40 minutes 32.998999 seconds +20 15:40:32.998999000 -- !query select interval '15:40' hour to minute -- !query schema -struct +struct -- !query output -15 hours 40 minutes +0 15:40:00.000000000 -- !query select interval '15:40:32.99899999' hour to second -- !query schema -struct +struct -- !query output -15 hours 40 minutes 32.998999 seconds +0 15:40:32.998999000 -- !query select interval '40:32.99899999' minute to second -- !query schema -struct +struct -- !query output -40 minutes 32.998999 seconds +0 00:40:32.998999000 -- !query select interval '40:32' minute to second -- !query schema -struct +struct -- !query output -40 minutes 32 seconds +0 00:40:32.000000000 -- !query @@ -338,6 +418,14 @@ struct 30 days +-- !query +select interval 30 days days +-- !query schema +struct +-- !query output +30 days + + -- !query select interval '20 15:40:32.99899999' day to hour -- !query schema @@ -654,6 +742,76 @@ select interval 30 day day day ---------------------------^^^ +-- !query +select interval (-30) days +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Undefined function: 'interval'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 7 + + +-- !query +select interval (a + 1) days +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Undefined function: 'interval'. This function is neither a registered temporary function nor a permanent function registered in the database 'default'.; line 1 pos 7 + + +-- !query +select interval 30 days days days +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +extraneous input 'days' expecting {, ';'}(line 1, pos 29) + +== SQL == +select interval 30 days days days +-----------------------------^^^ + + +-- !query +SELECT INTERVAL '178956970-7' YEAR TO MONTH +-- !query schema +struct +-- !query output +178956970-7 + + +-- !query +SELECT INTERVAL '178956970-8' YEAR TO MONTH +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Error parsing interval year-month string: integer overflow(line 1, pos 16) + +== SQL == +SELECT INTERVAL '178956970-8' YEAR TO MONTH +----------------^^^ + + +-- !query +SELECT INTERVAL '-178956970-8' YEAR TO MONTH +-- !query schema +struct +-- !query output +-178956970-8 + + +-- !query +SELECT INTERVAL -'178956970-8' YEAR TO MONTH +-- !query schema +struct +-- !query output +-178956970-8 + + -- !query create temporary view interval_arithmetic as select CAST(dateval AS date), CAST(tsval AS timestamp), dateval as strval from values @@ -676,7 +834,7 @@ select interval '2-2' year to month + dateval from interval_arithmetic -- !query schema -struct +struct -- !query output 2012-01-01 2009-11-01 2014-03-01 2014-03-01 2009-11-01 2009-11-01 2014-03-01 @@ -692,7 +850,7 @@ select interval '2-2' year to month + tsval from interval_arithmetic -- !query schema -struct +struct -- !query output 2012-01-01 00:00:00 2009-11-01 00:00:00 2014-03-01 00:00:00 2014-03-01 00:00:00 2009-11-01 00:00:00 2009-11-01 00:00:00 2014-03-01 00:00:00 @@ -703,9 +861,9 @@ select interval '2-2' year to month - interval '3-3' year to month from interval_arithmetic -- !query schema -struct<(INTERVAL '2 years 2 months' + INTERVAL '3 years 3 months'):interval,(INTERVAL '2 years 2 months' - INTERVAL '3 years 3 months'):interval> +struct<(INTERVAL '2-2' YEAR TO MONTH + INTERVAL '3-3' YEAR TO MONTH):interval year to month,(INTERVAL '2-2' YEAR TO MONTH - INTERVAL '3-3' YEAR TO MONTH):interval year to month> -- !query output -5 years 5 months -1 years -1 months +5-5 -1-1 -- !query @@ -719,9 +877,9 @@ select interval '99 11:22:33.123456789' day to second + dateval from interval_arithmetic -- !query schema -struct +struct -- !query output -2012-01-01 2011-09-23 2012-04-09 2012-04-09 2011-09-23 2011-09-23 2012-04-09 +2012-01-01 2011-09-23 12:37:26.876544 2012-04-09 11:22:33.123456 2012-04-09 11:22:33.123456 2011-09-23 12:37:26.876544 2011-09-23 12:37:26.876544 2012-04-09 11:22:33.123456 -- !query @@ -735,7 +893,7 @@ select interval '99 11:22:33.123456789' day to second + tsval from interval_arithmetic -- !query schema -struct +struct -- !query output 2012-01-01 00:00:00 2011-09-23 12:37:26.876544 2012-04-09 11:22:33.123456 2012-04-09 11:22:33.123456 2011-09-23 12:37:26.876544 2011-09-23 12:37:26.876544 2012-04-09 11:22:33.123456 @@ -751,7 +909,7 @@ select interval '99 11:22:33.123456789' day to second + strval from interval_arithmetic -- !query schema -struct +struct -- !query output 2012-01-01 2011-09-23 12:37:26.876544 2012-04-09 11:22:33.123456 2012-04-09 11:22:33.123456 2011-09-23 12:37:26.876544 2011-09-23 12:37:26.876544 2012-04-09 11:22:33.123456 @@ -762,9 +920,9 @@ select interval '99 11:22:33.123456789' day to second - interval '10 9:8:7.123456789' day to second from interval_arithmetic -- !query schema -struct<(INTERVAL '99 days 11 hours 22 minutes 33.123456 seconds' + INTERVAL '10 days 9 hours 8 minutes 7.123456 seconds'):interval,(INTERVAL '99 days 11 hours 22 minutes 33.123456 seconds' - INTERVAL '10 days 9 hours 8 minutes 7.123456 seconds'):interval> +struct<(INTERVAL '99 11:22:33.123456' DAY TO SECOND + INTERVAL '10 09:08:07.123456' DAY TO SECOND):interval day to second,(INTERVAL '99 11:22:33.123456' DAY TO SECOND - INTERVAL '10 09:08:07.123456' DAY TO SECOND):interval day to second> -- !query output -109 days 20 hours 30 minutes 40.246912 seconds 89 days 2 hours 14 minutes 26 seconds +109 20:30:40.246912000 89 02:14:26.000000000 -- !query @@ -810,9 +968,9 @@ struct -- !query select interval '2-2\t' year to month -- !query schema -struct +struct -- !query output -2 years 2 months +2-2 -- !query @@ -832,9 +990,9 @@ select interval '-\t2-2\t' year to month -- !query select interval '\n0 12:34:46.789\t' day to second -- !query schema -struct +struct -- !query output -12 hours 34 minutes 46.789 seconds +0 12:34:46.789000000 -- !query @@ -852,6 +1010,48 @@ select interval '\n-\t10\t 12:34:46.789\t' day to second ----------------^^^ +-- !query +select interval '中文 interval 1 day' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: 中文 interval 1 day(line 1, pos 7) + +== SQL == +select interval '中文 interval 1 day' +-------^^^ + + +-- !query +select interval 'interval中文 1 day' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: interval中文 1 day(line 1, pos 7) + +== SQL == +select interval 'interval中文 1 day' +-------^^^ + + +-- !query +select interval 'interval 1中文day' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: interval 1中文day(line 1, pos 7) + +== SQL == +select interval 'interval 1中文day' +-------^^^ + + -- !query select -(a) from values (interval '-2147483648 months', interval '2147483647 months') t(a, b) -- !query schema @@ -879,7 +1079,7 @@ struct<(b + INTERVAL '1 months'):interval> -- !query select a * 1.1 from values (interval '-2147483648 months', interval '2147483647 months') t(a, b) -- !query schema -struct +struct -- !query output -178956970 years -8 months @@ -887,7 +1087,7 @@ struct -- !query select a / 0.5 from values (interval '-2147483648 months', interval '2147483647 months') t(a, b) -- !query schema -struct +struct -- !query output -178956970 years -8 months @@ -914,3 +1114,241 @@ SELECT struct,to_json(from_json({"a":"1 days"})):string,to_json(map(a, INTERVAL '2 years 1 months 100 days 2 hours 10 minutes')):string,from_json(to_json(map(a, INTERVAL '2 years 1 months 100 days 2 hours 10 minutes'))):struct> -- !query output {"a":1 days} {"a":"1 days"} {"a":"2 years 1 months 100 days 2 hours 10 minutes"} {"a":2 years 1 months 100 days 2 hours 10 minutes} + + +-- !query +select interval '+' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: +(line 1, pos 7) + +== SQL == +select interval '+' +-------^^^ + + +-- !query +select interval '+.' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: +.(line 1, pos 7) + +== SQL == +select interval '+.' +-------^^^ + + +-- !query +select interval '1' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: 1(line 1, pos 7) + +== SQL == +select interval '1' +-------^^^ + + +-- !query +select interval '1.2' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: 1.2(line 1, pos 7) + +== SQL == +select interval '1.2' +-------^^^ + + +-- !query +select interval '- 2' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: - 2(line 1, pos 7) + +== SQL == +select interval '- 2' +-------^^^ + + +-- !query +select interval '1 day -' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: 1 day -(line 1, pos 7) + +== SQL == +select interval '1 day -' +-------^^^ + + +-- !query +select interval '1 day 1' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Cannot parse the INTERVAL value: 1 day 1(line 1, pos 7) + +== SQL == +select interval '1 day 1' +-------^^^ + + +-- !query +select interval '1 day 2' day +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Can only use numbers in the interval value part for multiple unit value pairs interval form, but got invalid value: 1 day 2(line 1, pos 16) + +== SQL == +select interval '1 day 2' day +----------------^^^ + + +-- !query +select interval 'interval 1' day +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Can only use numbers in the interval value part for multiple unit value pairs interval form, but got invalid value: interval 1(line 1, pos 16) + +== SQL == +select interval 'interval 1' day +----------------^^^ + + +-- !query +select interval '-\t 1' day +-- !query schema +struct +-- !query output +-1 days + + +-- !query +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / 2 +-- !query schema +struct<(INTERVAL '-178956970-8' YEAR TO MONTH / 2):interval year to month> +-- !query output +-89478485-4 + + +-- !query +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / 5 +-- !query schema +struct<(INTERVAL '-178956970-8' YEAR TO MONTH / 5):interval year to month> +-- !query output +-35791394-2 + + +-- !query +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / -1 +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Overflow in integral divide. + + +-- !query +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / -1L +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Overflow in integral divide. + + +-- !query +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / -1.0 +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Overflow + + +-- !query +SELECT (INTERVAL '-178956970-8' YEAR TO MONTH) / -1.0D +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +not in range + + +-- !query +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / 2 +-- !query schema +struct<(INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND / 2):interval day to second> +-- !query output +-53375995 14:00:27.387904000 + + +-- !query +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / 5 +-- !query schema +struct<(INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND / 5):interval day to second> +-- !query output +-21350398 05:36:10.955162000 + + +-- !query +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / -1 +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Overflow in integral divide. + + +-- !query +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / -1L +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Overflow in integral divide. + + +-- !query +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / -1.0 +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +Overflow + + +-- !query +SELECT (INTERVAL '-106751991 04:00:54.775808' DAY TO SECOND) / -1.0D +-- !query schema +struct<> +-- !query output +java.lang.ArithmeticException +not in range diff --git a/sql/core/src/test/resources/sql-tests/results/json-functions.sql.out b/sql/core/src/test/resources/sql-tests/results/json-functions.sql.out index e85237f1c9f6d..a344f618226e4 100644 --- a/sql/core/src/test/resources/sql-tests/results/json-functions.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/json-functions.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 67 +-- Number of queries: 71 -- !query @@ -72,7 +72,7 @@ select to_json(named_struct('a', 1, 'b', 2), named_struct('mode', 'PERMISSIVE')) struct<> -- !query output org.apache.spark.sql.AnalysisException -Must use a map() function for options;; line 1 pos 7 +Must use a map() function for options; line 1 pos 7 -- !query @@ -81,7 +81,7 @@ select to_json(named_struct('a', 1, 'b', 2), map('mode', 1)) struct<> -- !query output org.apache.spark.sql.AnalysisException -A type of keys and values in map() must be string, but got map;; line 1 pos 7 +A type of keys and values in map() must be string, but got map; line 1 pos 7 -- !query @@ -115,7 +115,7 @@ select from_json('{"a":1}', 1) struct<> -- !query output org.apache.spark.sql.AnalysisException -The expression '1' is not a valid schema string.;; line 1 pos 7 +The expression '1' is not a valid schema string.; line 1 pos 7 -- !query @@ -124,7 +124,14 @@ select from_json('{"a":1}', 'a InvalidType') struct<> -- !query output org.apache.spark.sql.AnalysisException +Cannot parse the data type: +extraneous input 'InvalidType' expecting (line 1, pos 2) +== SQL == +a InvalidType +--^^^ + +Failed fallback parsing: DataType invalidtype is not supported.(line 1, pos 2) == SQL == @@ -139,7 +146,7 @@ select from_json('{"a":1}', 'a INT', named_struct('mode', 'PERMISSIVE')) struct<> -- !query output org.apache.spark.sql.AnalysisException -Must use a map() function for options;; line 1 pos 7 +Must use a map() function for options; line 1 pos 7 -- !query @@ -148,7 +155,7 @@ select from_json('{"a":1}', 'a INT', map('mode', 1)) struct<> -- !query output org.apache.spark.sql.AnalysisException -A type of keys and values in map() must be string, but got map;; line 1 pos 7 +A type of keys and values in map() must be string, but got map; line 1 pos 7 -- !query @@ -213,7 +220,7 @@ select schema_of_json('{"c1":0, "c2":[1]}') -- !query schema struct -- !query output -struct> +STRUCT<`c1`: BIGINT, `c2`: ARRAY> -- !query @@ -288,6 +295,49 @@ struct>> NULL +-- !query +select from_json('{"d": "2012-12-15", "t": "2012-12-15 15:15:15"}', 'd date, t timestamp') +-- !query schema +struct> +-- !query output +{"d":2012-12-15,"t":2012-12-15 15:15:15} + + +-- !query +select from_json( + '{"d": "12/15 2012", "t": "12/15 2012 15:15:15"}', + 'd date, t timestamp', + map('dateFormat', 'MM/dd yyyy', 'timestampFormat', 'MM/dd yyyy HH:mm:ss')) +-- !query schema +struct> +-- !query output +{"d":2012-12-15,"t":2012-12-15 15:15:15} + + +-- !query +select from_json( + '{"d": "02-29"}', + 'd date', + map('dateFormat', 'MM-dd')) +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to parse '02-29' in the new parser. You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0, or set to CORRECTED and treat it as an invalid datetime string. + + +-- !query +select from_json( + '{"t": "02-29"}', + 't timestamp', + map('timestampFormat', 'MM-dd')) +-- !query schema +struct<> +-- !query output +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to parse '02-29' in the new parser. You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0, or set to CORRECTED and treat it as an invalid datetime string. + + -- !query select to_json(array('1', '2', '3')) -- !query schema @@ -309,7 +359,7 @@ select schema_of_json('{"c1":1}', map('primitivesAsString', 'true')) -- !query schema struct -- !query output -struct +STRUCT<`c1`: STRING> -- !query @@ -317,7 +367,7 @@ select schema_of_json('{"c1":01, "c2":0.1}', map('allowNumericLeadingZeros', 'tr -- !query schema struct -- !query output -struct +STRUCT<`c1`: BIGINT, `c2`: DECIMAL(1,1)> -- !query @@ -343,13 +393,13 @@ SELECT schema_of_json(jsonField) FROM jsonTable struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'schema_of_json(jsontable.`jsonField`)' due to data type mismatch: The input json should be a foldable string expression and not null; however, got jsontable.`jsonField`.; line 1 pos 7 +cannot resolve 'schema_of_json(jsontable.jsonField)' due to data type mismatch: The input json should be a foldable string expression and not null; however, got jsontable.jsonField.; line 1 pos 7 -- !query select json_array_length(null) -- !query schema -struct +struct -- !query output NULL @@ -448,7 +498,7 @@ Invalid number of arguments for function json_object_keys. Expected: 1; Found: 0 -- !query select json_object_keys(null) -- !query schema -struct> +struct> -- !query output NULL diff --git a/sql/core/src/test/resources/sql-tests/results/limit.sql.out b/sql/core/src/test/resources/sql-tests/results/limit.sql.out index 074e7a6d28c47..3b10bbd57401d 100644 --- a/sql/core/src/test/resources/sql-tests/results/limit.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/limit.sql.out @@ -53,7 +53,7 @@ SELECT * FROM testdata LIMIT -1 struct<> -- !query output org.apache.spark.sql.AnalysisException -The limit expression must be equal to or greater than 0, but got -1; +The limit expression must be equal to or greater than 0, but got -1 -- !query @@ -62,7 +62,7 @@ SELECT * FROM testData TABLESAMPLE (-1 ROWS) struct<> -- !query output org.apache.spark.sql.AnalysisException -The limit expression must be equal to or greater than 0, but got -1; +The limit expression must be equal to or greater than 0, but got -1 -- !query @@ -79,7 +79,7 @@ SELECT * FROM testdata LIMIT CAST(NULL AS INT) struct<> -- !query output org.apache.spark.sql.AnalysisException -The evaluated limit expression must not be null, but got CAST(NULL AS INT); +The evaluated limit expression must not be null, but got CAST(NULL AS INT) -- !query @@ -88,7 +88,7 @@ SELECT * FROM testdata LIMIT key > 3 struct<> -- !query output org.apache.spark.sql.AnalysisException -The limit expression must evaluate to a constant value, but got (spark_catalog.default.testdata.`key` > 3); +The limit expression must evaluate to a constant value, but got (spark_catalog.default.testdata.key > 3) -- !query @@ -97,7 +97,7 @@ SELECT * FROM testdata LIMIT true struct<> -- !query output org.apache.spark.sql.AnalysisException -The limit expression must be integer type, but got boolean; +The limit expression must be integer type, but got boolean -- !query @@ -106,7 +106,7 @@ SELECT * FROM testdata LIMIT 'a' struct<> -- !query output org.apache.spark.sql.AnalysisException -The limit expression must be integer type, but got string; +The limit expression must be integer type, but got string -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/literals.sql.out b/sql/core/src/test/resources/sql-tests/results/literals.sql.out index f6720f6c5faa4..9748d8bc56d72 100644 --- a/sql/core/src/test/resources/sql-tests/results/literals.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/literals.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 50 +-- Number of queries: 54 -- !query @@ -164,6 +164,36 @@ decimal can only support precision up to 38 select 1234567890123456789012345678901234567890.0 +-- !query +select 1F, 1.2F, .10f, 0.10f +-- !query schema +struct<1.0:float,1.2:float,0.1:float,0.1:float> +-- !query output +1.0 1.2 0.1 0.1 + + +-- !query +select -1F, -1.2F, -.10F, -0.10F +-- !query schema +struct<-1.0:float,-1.2:float,-0.1:float,-0.1:float> +-- !query output +-1.0 -1.2 -0.1 -0.1 + + +-- !query +select -3.4028235E39f +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Numeric literal -3.4028235E39 does not fit in range [-3.4028234663852886E+38, 3.4028234663852886E+38] for type float(line 1, pos 7) + +== SQL == +select -3.4028235E39f +-------^^^ + + -- !query select 1D, 1.2D, 1e10, 1.5e5, .10D, 0.10D, .1e5, .9e+2, 0.9e+2, 900e-1, 9.e+1 -- !query schema @@ -216,6 +246,14 @@ struct<0.3:decimal(1,1),-0.8:decimal(1,1),0.5:decimal(1,1),-0.18:decimal(2,2),0. 0.3 -0.8 0.5 -0.18 0.1111 0.1111 +-- !query +select 0.3 F, 0.4 D, 0.5 BD +-- !query schema +struct +-- !query output +0.3 0.4 0.5 + + -- !query select 123456789012345678901234567890123456789e10d, 123456789012345678901234567890123456789.1e10d -- !query schema @@ -398,7 +436,7 @@ select +date '1999-01-01' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(+ DATE '1999-01-01')' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'DATE '1999-01-01'' is of date type.; line 1 pos 7 +cannot resolve '(+ DATE '1999-01-01')' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'DATE '1999-01-01'' is of date type.; line 1 pos 7 -- !query @@ -407,7 +445,7 @@ select +timestamp '1999-01-01' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(+ TIMESTAMP '1999-01-01 00:00:00')' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'TIMESTAMP '1999-01-01 00:00:00'' is of timestamp type.; line 1 pos 7 +cannot resolve '(+ TIMESTAMP '1999-01-01 00:00:00')' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'TIMESTAMP '1999-01-01 00:00:00'' is of timestamp type.; line 1 pos 7 -- !query @@ -424,7 +462,7 @@ select +map(1, 2) struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(+ map(1, 2))' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'map(1, 2)' is of map type.; line 1 pos 7 +cannot resolve '(+ map(1, 2))' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'map(1, 2)' is of map type.; line 1 pos 7 -- !query @@ -433,7 +471,7 @@ select +array(1,2) struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(+ array(1, 2))' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'array(1, 2)' is of array type.; line 1 pos 7 +cannot resolve '(+ array(1, 2))' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'array(1, 2)' is of array type.; line 1 pos 7 -- !query @@ -442,7 +480,7 @@ select +named_struct('a', 1, 'b', 'spark') struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(+ named_struct('a', 1, 'b', 'spark'))' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'named_struct('a', 1, 'b', 'spark')' is of struct type.; line 1 pos 7 +cannot resolve '(+ named_struct('a', 1, 'b', 'spark'))' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'named_struct('a', 1, 'b', 'spark')' is of struct type.; line 1 pos 7 -- !query @@ -451,7 +489,7 @@ select +X'1' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(+ X'01')' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'X'01'' is of binary type.; line 1 pos 7 +cannot resolve '(+ X'01')' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'X'01'' is of binary type.; line 1 pos 7 -- !query @@ -460,7 +498,7 @@ select -date '1999-01-01' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(- DATE '1999-01-01')' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'DATE '1999-01-01'' is of date type.; line 1 pos 7 +cannot resolve '(- DATE '1999-01-01')' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'DATE '1999-01-01'' is of date type.; line 1 pos 7 -- !query @@ -469,7 +507,7 @@ select -timestamp '1999-01-01' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(- TIMESTAMP '1999-01-01 00:00:00')' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'TIMESTAMP '1999-01-01 00:00:00'' is of timestamp type.; line 1 pos 7 +cannot resolve '(- TIMESTAMP '1999-01-01 00:00:00')' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'TIMESTAMP '1999-01-01 00:00:00'' is of timestamp type.; line 1 pos 7 -- !query @@ -478,4 +516,4 @@ select -x'2379ACFe' struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(- X'2379ACFE')' due to data type mismatch: argument 1 requires (numeric or interval) type, however, 'X'2379ACFE'' is of binary type.; line 1 pos 7 +cannot resolve '(- X'2379ACFE')' due to data type mismatch: argument 1 requires (numeric or interval or interval day to second or interval year to month) type, however, 'X'2379ACFE'' is of binary type.; line 1 pos 7 diff --git a/sql/core/src/test/resources/sql-tests/results/map.sql.out b/sql/core/src/test/resources/sql-tests/results/map.sql.out new file mode 100644 index 0000000000000..7a0c0d776ca2b --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/map.sql.out @@ -0,0 +1,18 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 2 + + +-- !query +select element_at(map(1, 'a', 2, 'b'), 5) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select map(1, 'a', 2, 'b')[5] +-- !query schema +struct +-- !query output +NULL diff --git a/sql/core/src/test/resources/sql-tests/results/misc-functions.sql.out b/sql/core/src/test/resources/sql-tests/results/misc-functions.sql.out index bd8ffb82ee129..d927e890b0336 100644 --- a/sql/core/src/test/resources/sql-tests/results/misc-functions.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/misc-functions.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 7 +-- Number of queries: 16 -- !query @@ -56,3 +56,82 @@ select typeof(array(1, 2)), typeof(map(1, 2)), typeof(named_struct('a', 1, 'b', struct -- !query output array map struct + + +-- !query +SELECT assert_true(true), assert_true(boolean(1)) +-- !query schema +struct +-- !query output +NULL NULL + + +-- !query +SELECT assert_true(false) +-- !query schema +struct<> +-- !query output +java.lang.RuntimeException +'false' is not true! + + +-- !query +SELECT assert_true(boolean(0)) +-- !query schema +struct<> +-- !query output +java.lang.RuntimeException +'cast(0 as boolean)' is not true! + + +-- !query +SELECT assert_true(null) +-- !query schema +struct<> +-- !query output +java.lang.RuntimeException +'null' is not true! + + +-- !query +SELECT assert_true(boolean(null)) +-- !query schema +struct<> +-- !query output +java.lang.RuntimeException +'cast(null as boolean)' is not true! + + +-- !query +SELECT assert_true(false, 'custom error message') +-- !query schema +struct<> +-- !query output +java.lang.RuntimeException +custom error message + + +-- !query +CREATE TEMPORARY VIEW tbl_misc AS SELECT * FROM (VALUES (1), (8), (2)) AS T(v) +-- !query schema +struct<> +-- !query output + + + +-- !query +SELECT raise_error('error message') +-- !query schema +struct<> +-- !query output +java.lang.RuntimeException +error message + + +-- !query +SELECT if(v > 5, raise_error('too big: ' || v), v + 1) FROM tbl_misc +-- !query schema +struct<> +-- !query output +java.lang.RuntimeException +too big: 8 diff --git a/sql/core/src/test/resources/sql-tests/results/natural-join.sql.out b/sql/core/src/test/resources/sql-tests/results/natural-join.sql.out index 13f319700df3f..794e4725d9ea4 100644 --- a/sql/core/src/test/resources/sql-tests/results/natural-join.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/natural-join.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 6 +-- Number of queries: 29 -- !query @@ -26,6 +26,40 @@ struct<> +-- !query +create temporary view nt3 as select * from values + ("one", 4), + ("two", 5), + ("one", 6) + as nt3(k, v3) +-- !query schema +struct<> +-- !query output + + + +-- !query +create temporary view nt4 as select * from values + ("one", 7), + ("two", 8), + ("one", 9) + as nt4(k, v4) +-- !query schema +struct<> +-- !query output + + + +-- !query +SELECT * FROM nt1 natural join nt2 +-- !query schema +struct +-- !query output +one 1 1 +one 1 5 +two 2 22 + + -- !query SELECT * FROM nt1 natural join nt2 where k = "one" -- !query schema @@ -62,3 +96,216 @@ SELECT count(*) FROM nt1 natural full outer join nt2 struct -- !query output 4 + + +-- !query +SELECT k FROM nt1 natural join nt2 +-- !query schema +struct +-- !query output +one +one +two + + +-- !query +SELECT k FROM nt1 natural join nt2 where k = "one" +-- !query schema +struct +-- !query output +one +one + + +-- !query +SELECT nt1.* FROM nt1 natural join nt2 +-- !query schema +struct +-- !query output +one 1 +one 1 +two 2 + + +-- !query +SELECT nt2.* FROM nt1 natural join nt2 +-- !query schema +struct +-- !query output +one 1 +one 5 +two 22 + + +-- !query +SELECT sbq.* from (SELECT * FROM nt1 natural join nt2) sbq +-- !query schema +struct +-- !query output +one 1 1 +one 1 5 +two 2 22 + + +-- !query +SELECT sbq.k from (SELECT * FROM nt1 natural join nt2) sbq +-- !query schema +struct +-- !query output +one +one +two + + +-- !query +SELECT nt1.*, nt2.* FROM nt1 natural join nt2 +-- !query schema +struct +-- !query output +one 1 one 1 +one 1 one 5 +two 2 two 22 + + +-- !query +SELECT *, nt2.k FROM nt1 natural join nt2 +-- !query schema +struct +-- !query output +one 1 1 one +one 1 5 one +two 2 22 two + + +-- !query +SELECT nt1.k, nt2.k FROM nt1 natural join nt2 +-- !query schema +struct +-- !query output +one one +one one +two two + + +-- !query +SELECT nt1.k, nt2.k FROM nt1 natural join nt2 where k = "one" +-- !query schema +struct +-- !query output +one one +one one + + +-- !query +SELECT * FROM (SELECT * FROM nt1 natural join nt2) +-- !query schema +struct +-- !query output +one 1 1 +one 1 5 +two 2 22 + + +-- !query +SELECT * FROM (SELECT nt1.*, nt2.* FROM nt1 natural join nt2) +-- !query schema +struct +-- !query output +one 1 one 1 +one 1 one 5 +two 2 two 22 + + +-- !query +SELECT * FROM (SELECT nt1.v1, nt2.k FROM nt1 natural join nt2) +-- !query schema +struct +-- !query output +1 one +1 one +2 two + + +-- !query +SELECT nt2.k FROM (SELECT * FROM nt1 natural join nt2) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'nt2.k' given input columns: [__auto_generated_subquery_name.k, __auto_generated_subquery_name.v1, __auto_generated_subquery_name.v2]; line 1 pos 7 + + +-- !query +SELECT * FROM nt1 natural join nt2 natural join nt3 +-- !query schema +struct +-- !query output +one 1 1 4 +one 1 1 6 +one 1 5 4 +one 1 5 6 +two 2 22 5 + + +-- !query +SELECT nt1.*, nt2.*, nt3.* FROM nt1 natural join nt2 natural join nt3 +-- !query schema +struct +-- !query output +one 1 one 1 one 4 +one 1 one 1 one 6 +one 1 one 5 one 4 +one 1 one 5 one 6 +two 2 two 22 two 5 + + +-- !query +SELECT nt1.*, nt2.*, nt3.* FROM nt1 natural join nt2 join nt3 on nt2.k = nt3.k +-- !query schema +struct +-- !query output +one 1 one 1 one 4 +one 1 one 1 one 6 +one 1 one 5 one 4 +one 1 one 5 one 6 +two 2 two 22 two 5 + + +-- !query +SELECT * FROM nt1 natural join nt2 join nt3 on nt1.k = nt3.k +-- !query schema +struct +-- !query output +one 1 1 one 4 +one 1 1 one 6 +one 1 5 one 4 +one 1 5 one 6 +two 2 22 two 5 + + +-- !query +SELECT * FROM nt1 natural join nt2 join nt3 on nt2.k = nt3.k +-- !query schema +struct +-- !query output +one 1 1 one 4 +one 1 1 one 6 +one 1 5 one 4 +one 1 5 one 6 +two 2 22 two 5 + + +-- !query +SELECT nt1.*, nt2.*, nt3.*, nt4.* FROM nt1 natural join nt2 natural join nt3 natural join nt4 +-- !query schema +struct +-- !query output +one 1 one 1 one 4 one 7 +one 1 one 1 one 4 one 9 +one 1 one 1 one 6 one 7 +one 1 one 1 one 6 one 9 +one 1 one 5 one 4 one 7 +one 1 one 5 one 4 one 9 +one 1 one 5 one 6 one 7 +one 1 one 5 one 6 one 9 +two 2 two 22 two 5 two 8 diff --git a/sql/core/src/test/resources/sql-tests/results/null-propagation.sql.out b/sql/core/src/test/resources/sql-tests/results/null-propagation.sql.out index 76a41f9170388..b972d963c8dbc 100644 --- a/sql/core/src/test/resources/sql-tests/results/null-propagation.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/null-propagation.sql.out @@ -13,7 +13,7 @@ struct -- !query SELECT COUNT(1 + NULL) FROM VALUES 1, 2, 3 -- !query schema -struct +struct -- !query output 0 @@ -31,7 +31,7 @@ struct +struct -- !query output 0 0 diff --git a/sql/core/src/test/resources/sql-tests/results/operators.sql.out b/sql/core/src/test/resources/sql-tests/results/operators.sql.out index a94a123b1b8ab..3af92bf935713 100644 --- a/sql/core/src/test/resources/sql-tests/results/operators.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/operators.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 57 +-- Number of queries: 69 -- !query @@ -125,7 +125,7 @@ struct<(+ (- key)):int> -- !query select 5 / 2 -- !query schema -struct<(CAST(5 AS DOUBLE) / CAST(2 AS DOUBLE)):double> +struct<(5 / 2):double> -- !query output 2.5 @@ -133,7 +133,7 @@ struct<(CAST(5 AS DOUBLE) / CAST(2 AS DOUBLE)):double> -- !query select 5 / 0 -- !query schema -struct<(CAST(5 AS DOUBLE) / CAST(0 AS DOUBLE)):double> +struct<(5 / 0):double> -- !query output NULL @@ -141,7 +141,7 @@ NULL -- !query select 5 / null -- !query schema -struct<(CAST(5 AS DOUBLE) / CAST(NULL AS DOUBLE)):double> +struct<(5 / NULL):double> -- !query output NULL @@ -149,7 +149,7 @@ NULL -- !query select null / 5 -- !query schema -struct<(CAST(NULL AS DOUBLE) / CAST(5 AS DOUBLE)):double> +struct<(NULL / 5):double> -- !query output NULL @@ -173,7 +173,7 @@ NULL -- !query select 5 div null -- !query schema -struct<(5 div CAST(NULL AS INT)):bigint> +struct<(5 div NULL):bigint> -- !query output NULL @@ -181,7 +181,7 @@ NULL -- !query select null div 5 -- !query schema -struct<(CAST(NULL AS INT) div 5):bigint> +struct<(NULL div 5):bigint> -- !query output NULL @@ -189,7 +189,7 @@ NULL -- !query select cast(51 as decimal(10, 0)) div cast(2 as decimal(2, 0)) -- !query schema -struct<(CAST(CAST(51 AS DECIMAL(10,0)) AS DECIMAL(10,0)) div CAST(CAST(2 AS DECIMAL(2,0)) AS DECIMAL(10,0))):bigint> +struct<(CAST(51 AS DECIMAL(10,0)) div CAST(2 AS DECIMAL(2,0))):bigint> -- !query output 25 @@ -197,7 +197,7 @@ struct<(CAST(CAST(51 AS DECIMAL(10,0)) AS DECIMAL(10,0)) div CAST(CAST(2 AS DECI -- !query select cast(5 as decimal(1, 0)) div cast(0 as decimal(2, 0)) -- !query schema -struct<(CAST(CAST(5 AS DECIMAL(1,0)) AS DECIMAL(2,0)) div CAST(CAST(0 AS DECIMAL(2,0)) AS DECIMAL(2,0))):bigint> +struct<(CAST(5 AS DECIMAL(1,0)) div CAST(0 AS DECIMAL(2,0))):bigint> -- !query output NULL @@ -205,7 +205,7 @@ NULL -- !query select cast(5 as decimal(1, 0)) div cast(null as decimal(2, 0)) -- !query schema -struct<(CAST(CAST(5 AS DECIMAL(1,0)) AS DECIMAL(2,0)) div CAST(CAST(NULL AS DECIMAL(2,0)) AS DECIMAL(2,0))):bigint> +struct<(CAST(5 AS DECIMAL(1,0)) div CAST(NULL AS DECIMAL(2,0))):bigint> -- !query output NULL @@ -213,7 +213,7 @@ NULL -- !query select cast(null as decimal(1, 0)) div cast(5 as decimal(2, 0)) -- !query schema -struct<(CAST(CAST(NULL AS DECIMAL(1,0)) AS DECIMAL(2,0)) div CAST(CAST(5 AS DECIMAL(2,0)) AS DECIMAL(2,0))):bigint> +struct<(CAST(NULL AS DECIMAL(1,0)) div CAST(5 AS DECIMAL(2,0))):bigint> -- !query output NULL @@ -261,7 +261,7 @@ struct -- !query select cot(1) -- !query schema -struct +struct -- !query output 0.6420926159343306 @@ -269,7 +269,7 @@ struct -- !query select cot(null) -- !query schema -struct +struct -- !query output NULL @@ -277,7 +277,7 @@ NULL -- !query select cot(0) -- !query schema -struct +struct -- !query output Infinity @@ -285,7 +285,7 @@ Infinity -- !query select cot(-1) -- !query schema -struct +struct -- !query output -0.6420926159343306 @@ -293,7 +293,7 @@ struct -- !query select ceiling(0) -- !query schema -struct +struct -- !query output 0 @@ -301,7 +301,7 @@ struct -- !query select ceiling(1) -- !query schema -struct +struct -- !query output 1 @@ -341,7 +341,7 @@ struct -- !query select floor(0) -- !query schema -struct +struct -- !query output 0 @@ -349,7 +349,7 @@ struct -- !query select floor(1) -- !query schema -struct +struct -- !query output 1 @@ -381,7 +381,7 @@ struct -- !query select 1 > 0.00001 -- !query schema -struct<(CAST(1 AS BIGINT) > 0):boolean> +struct<(1 > 0):boolean> -- !query output true @@ -389,7 +389,7 @@ true -- !query select mod(7, 2), mod(7, 0), mod(0, 2), mod(7, null), mod(null, 2), mod(null, null) -- !query schema -struct +struct -- !query output 1 NULL 0 NULL NULL NULL @@ -429,7 +429,7 @@ struct -- !query select abs(-3.13), abs('-2.19') -- !query schema -struct +struct -- !query output 3.13 2.19 @@ -437,7 +437,7 @@ struct -- !query select positive('-1.11'), positive(-1.11), negative('-1.11'), negative(-1.11) -- !query schema -struct<(+ CAST(-1.11 AS DOUBLE)):double,(+ -1.11):decimal(3,2),negative(CAST(-1.11 AS DOUBLE)):double,negative(-1.11):decimal(3,2)> +struct<(+ -1.11):double,(+ -1.11):decimal(3,2),negative(-1.11):double,negative(-1.11):decimal(3,2)> -- !query output -1.11 -1.11 1.11 1.11 @@ -445,7 +445,7 @@ struct<(+ CAST(-1.11 AS DOUBLE)):double,(+ -1.11):decimal(3,2),negative(CAST(-1. -- !query select pmod(-7, 2), pmod(0, 2), pmod(7, 0), pmod(7, null), pmod(null, 2), pmod(null, null) -- !query schema -struct +struct -- !query output 1 0 NULL NULL NULL NULL @@ -456,3 +456,99 @@ select pmod(cast(3.13 as decimal), cast(0 as decimal)), pmod(cast(2 as smallint) struct -- !query output NULL NULL + + +-- !query +select width_bucket(5.35, 0.024, 10.06, 5) +-- !query schema +struct +-- !query output +3 + + +-- !query +select width_bucket(5.35, 0.024, 10.06, 3 + 2) +-- !query schema +struct +-- !query output +3 + + +-- !query +select width_bucket('5.35', '0.024', '10.06', '5') +-- !query schema +struct +-- !query output +3 + + +-- !query +select width_bucket(5.35, 0.024, 10.06, 2.5) +-- !query schema +struct +-- !query output +2 + + +-- !query +select width_bucket(5.35, 0.024, 10.06, 0.5) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select width_bucket(null, 0.024, 10.06, 5) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select width_bucket(5.35, null, 10.06, 5) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select width_bucket(5.35, 0.024, null, -5) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select width_bucket(5.35, 0.024, 10.06, null) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select width_bucket(5.35, 0.024, 10.06, -5) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select width_bucket(5.35, 0.024, 10.06, 9223372036854775807L) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select width_bucket(5.35, 0.024, 10.06, 9223372036854775807L - 1) +-- !query schema +struct +-- !query output +4894746858139549697 diff --git a/sql/core/src/test/resources/sql-tests/results/parse-schema-string.sql.out b/sql/core/src/test/resources/sql-tests/results/parse-schema-string.sql.out new file mode 100644 index 0000000000000..4440dd763bd2b --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/parse-schema-string.sql.out @@ -0,0 +1,34 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 4 + + +-- !query +select from_csv('1', 'create INT') +-- !query schema +struct> +-- !query output +{"create":1} + + +-- !query +select from_csv('1', 'cube INT') +-- !query schema +struct> +-- !query output +{"cube":1} + + +-- !query +select from_json('{"create":1}', 'create INT') +-- !query schema +struct> +-- !query output +{"create":1} + + +-- !query +select from_json('{"cube":1}', 'cube INT') +-- !query schema +struct> +-- !query output +{"cube":1} diff --git a/sql/core/src/test/resources/sql-tests/results/pivot.sql.out b/sql/core/src/test/resources/sql-tests/results/pivot.sql.out index ac4e71e244bc0..69679f8be5fe4 100644 --- a/sql/core/src/test/resources/sql-tests/results/pivot.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/pivot.sql.out @@ -75,7 +75,7 @@ PIVOT ( FOR course IN ('dotNET', 'Java') ) -- !query schema -struct +struct -- !query output 2012 15000 7500.0 20000 20000.0 2013 48000 48000.0 30000 30000.0 @@ -104,7 +104,7 @@ PIVOT ( FOR course IN ('dotNET', 'Java') ) -- !query schema -struct +struct -- !query output 63000 2012 50000 2012 @@ -139,7 +139,7 @@ PIVOT ( FOR course IN ('dotNET', 'Java') ) -- !query schema -struct +struct -- !query output 2012 15000 1 20000 1 2013 48000 2 30000 2 @@ -202,7 +202,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Aggregate expression required for pivot, but 'coursesales.`earnings`' did not appear in any aggregate function.; +Aggregate expression required for pivot, but 'coursesales.earnings' did not appear in any aggregate function. -- !query @@ -217,7 +217,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Aggregate expression required for pivot, but '__auto_generated_subquery_name.`year`' did not appear in any aggregate function.; +Aggregate expression required for pivot, but '__auto_generated_subquery_name.year' did not appear in any aggregate function. -- !query @@ -232,7 +232,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`year`' given input columns: [__auto_generated_subquery_name.course, __auto_generated_subquery_name.earnings]; line 4 pos 0 +cannot resolve 'year' given input columns: [__auto_generated_subquery_name.course, __auto_generated_subquery_name.earnings]; line 4 pos 0 -- !query @@ -244,7 +244,7 @@ PIVOT ( FOR course IN ('dotNET', 'Java') ) -- !query schema -struct +struct -- !query output 2012 15000 7501.0 20000 20001.0 2013 48000 48001.0 30000 30001.0 @@ -262,7 +262,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -It is not allowed to use an aggregate function in the argument of another aggregate function. Please use the inner aggregate function in a sub-query.; +It is not allowed to use an aggregate function in the argument of another aggregate function. Please use the inner aggregate function in a sub-query. -- !query @@ -276,7 +276,7 @@ PIVOT ( FOR (course, year) IN (('dotNET', 2012), ('Java', 2013)) ) -- !query schema -struct +struct -- !query output 1 15000 NULL 2 NULL 30000 @@ -313,7 +313,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Invalid pivot value 'dotNET': value data type string does not match pivot column data type struct; +Invalid pivot value 'dotNET': value data type string does not match pivot column data type struct -- !query @@ -326,7 +326,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`s`' given input columns: [coursesales.course, coursesales.earnings, coursesales.year]; line 4 pos 15 +cannot resolve 's' given input columns: [coursesales.course, coursesales.earnings, coursesales.year]; line 4 pos 15 -- !query @@ -339,7 +339,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Literal expressions required for pivot values, found 'course#x'; +Literal expressions required for pivot values, found 'course#x' -- !query @@ -370,7 +370,7 @@ PIVOT ( FOR (y, course) IN ((2012, 'dotNET'), (2013, 'Java')) ) -- !query schema -struct,[2013, Java]:array> +struct,{2013, Java}:array> -- !query output 2012 [1,1] NULL 2013 NULL [2,2] @@ -404,7 +404,7 @@ PIVOT ( FOR (course, a) IN (('dotNET', array(1, 1)), ('Java', array(2, 2))) ) -- !query schema -struct +struct -- !query output 2012 15000 NULL 2013 NULL 30000 @@ -421,7 +421,7 @@ PIVOT ( FOR s IN ((1, 'a'), (2, 'b')) ) -- !query schema -struct +struct -- !query output 2012 35000 NULL 2013 NULL 78000 @@ -438,7 +438,7 @@ PIVOT ( FOR (course, s) IN (('dotNET', (1, 'a')), ('Java', (2, 'b'))) ) -- !query schema -struct +struct -- !query output 2012 15000 NULL 2013 NULL 30000 @@ -458,7 +458,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Invalid pivot column 'm#x'. Pivot columns must be comparable.; +Invalid pivot column 'm#x'. Pivot columns must be comparable. -- !query @@ -475,7 +475,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Invalid pivot column 'named_struct(course, course#x, m, m#x)'. Pivot columns must be comparable.; +Invalid pivot column 'named_struct(course, course#x, m, m#x)'. Pivot columns must be comparable. -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/aggregates_part1.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/aggregates_part1.sql.out index f7bba96738eab..0d836258f9179 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/aggregates_part1.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/aggregates_part1.sql.out @@ -77,7 +77,7 @@ struct -- !query SELECT stddev_pop(b) FROM aggtest -- !query schema -struct +struct -- !query output 131.10703231895047 @@ -85,7 +85,7 @@ struct -- !query SELECT stddev_samp(b) FROM aggtest -- !query schema -struct +struct -- !query output 151.38936080399804 @@ -93,7 +93,7 @@ struct -- !query SELECT var_pop(b) FROM aggtest -- !query schema -struct +struct -- !query output 17189.053923482323 @@ -101,7 +101,7 @@ struct -- !query SELECT var_samp(b) FROM aggtest -- !query schema -struct +struct -- !query output 22918.738564643096 @@ -109,7 +109,7 @@ struct -- !query SELECT stddev_pop(CAST(b AS Decimal(38,0))) FROM aggtest -- !query schema -struct +struct -- !query output 131.18117242958306 @@ -117,7 +117,7 @@ struct -- !query SELECT stddev_samp(CAST(b AS Decimal(38,0))) FROM aggtest -- !query schema -struct +struct -- !query output 151.47497042966097 @@ -125,7 +125,7 @@ struct -- !query SELECT var_pop(CAST(b AS Decimal(38,0))) FROM aggtest -- !query schema -struct +struct -- !query output 17208.5 @@ -133,7 +133,7 @@ struct -- !query SELECT var_samp(CAST(b AS Decimal(38,0))) FROM aggtest -- !query schema -struct +struct -- !query output 22944.666666666668 @@ -141,17 +141,17 @@ struct -- !query SELECT var_pop(1.0), var_samp(2.0) -- !query schema -struct +struct -- !query output -0.0 NaN +0.0 NULL -- !query SELECT stddev_pop(CAST(3.0 AS Decimal(38,0))), stddev_samp(CAST(4.0 AS Decimal(38,0))) -- !query schema -struct +struct -- !query output -0.0 NaN +0.0 NULL -- !query @@ -291,7 +291,7 @@ struct -- !query SELECT covar_pop(b, a), covar_samp(b, a) FROM aggtest -- !query schema -struct +struct -- !query output 653.6289553875104 871.5052738500139 @@ -299,7 +299,7 @@ struct +struct -- !query output 0.1396345165178734 @@ -381,8 +381,8 @@ struct<> org.apache.spark.sql.AnalysisException Aggregate/Window/Generate expressions are not valid in where clause of the query. -Expression in where clause: [(sum(DISTINCT CAST((outer(a.`four`) + b.`four`) AS BIGINT)) = CAST(b.`four` AS BIGINT))] -Invalid expressions: [sum(DISTINCT CAST((outer(a.`four`) + b.`four`) AS BIGINT))]; +Expression in where clause: [(sum(DISTINCT (outer(a.four) + b.four)) = CAST(b.four AS BIGINT))] +Invalid expressions: [sum(DISTINCT (outer(a.four) + b.four))] -- !query @@ -393,4 +393,4 @@ from tenk1 o struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`o.unique1`' given input columns: [i.even, i.fivethous, i.four, i.hundred, i.odd, i.string4, i.stringu1, i.stringu2, i.ten, i.tenthous, i.thousand, i.twenty, i.two, i.twothousand, i.unique1, i.unique2]; line 2 pos 63 +cannot resolve 'o.unique1' given input columns: [i.even, i.fivethous, i.four, i.hundred, i.odd, i.string4, i.stringu1, i.stringu2, i.ten, i.tenthous, i.thousand, i.twenty, i.two, i.twothousand, i.unique1, i.unique2]; line 2 pos 63 diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/aggregates_part3.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/aggregates_part3.sql.out index 69f96b02782e3..f3ab092baf696 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/aggregates_part3.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/aggregates_part3.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 4 +-- Number of queries: 5 -- !query @@ -8,7 +8,7 @@ select max(min(unique1)) from tenk1 struct<> -- !query output org.apache.spark.sql.AnalysisException -It is not allowed to use an aggregate function in the argument of another aggregate function. Please use the inner aggregate function in a sub-query.; +It is not allowed to use an aggregate function in the argument of another aggregate function. Please use the inner aggregate function in a sub-query. -- !query @@ -22,11 +22,25 @@ struct 100)):int> -- !query select sum(1/ten) filter (where ten > 0) from tenk1 -- !query schema -struct 0)):double> +struct 0)):double> -- !query output 2828.9682539682954 +-- !query +select ten, sum(distinct four) filter (where four > 10) from onek a +group by ten +having exists (select 1 from onek b where sum(distinct a.four) = b.four) +-- !query schema +struct 10)):bigint> +-- !query output +0 NULL +2 NULL +4 NULL +6 NULL +8 NULL + + -- !query select (select count(*) from (values (1)) t0(inner_c)) diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/boolean.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/boolean.sql.out index 0347e0dc7853b..ef9a67a50b1db 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/boolean.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/boolean.sql.out @@ -53,9 +53,10 @@ true -- !query SELECT boolean('test') AS error -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: test -- !query @@ -69,9 +70,10 @@ false -- !query SELECT boolean('foo') AS error -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: foo -- !query @@ -93,9 +95,10 @@ true -- !query SELECT boolean('yeah') AS error -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: yeah -- !query @@ -117,57 +120,64 @@ false -- !query SELECT boolean('nay') AS error -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: nay -- !query SELECT boolean('on') AS true -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: on -- !query SELECT boolean('off') AS `false` -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: off -- !query SELECT boolean('of') AS `false` -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: of -- !query SELECT boolean('o') AS error -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: o -- !query SELECT boolean('on_') AS error -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: on_ -- !query SELECT boolean('off_') AS error -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: off_ -- !query @@ -181,9 +191,10 @@ true -- !query SELECT boolean('11') AS error -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: 11 -- !query @@ -197,17 +208,19 @@ false -- !query SELECT boolean('000') AS error -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: 000 -- !query SELECT boolean('') AS error -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: -- !query @@ -310,17 +323,19 @@ true false -- !query SELECT boolean(string(' tru e ')) AS invalid -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: tru e -- !query SELECT boolean(string('')) AS invalid -- !query schema -struct +struct<> -- !query output -NULL +java.lang.UnsupportedOperationException +invalid input syntax for type boolean: -- !query @@ -463,7 +478,8 @@ INSERT INTO BOOLTBL2 -- !query schema struct<> -- !query output - +org.apache.spark.sql.AnalysisException +failed to evaluate expression CAST('XXX' AS BOOLEAN): invalid input syntax for type boolean: XXX; line 2 pos 3 -- !query @@ -471,7 +487,6 @@ SELECT '' AS f_4, BOOLTBL2.* FROM BOOLTBL2 -- !query schema struct -- !query output - NULL false false false @@ -545,9 +560,6 @@ struct false false false false false false - true NULL - true NULL - true NULL true false true false true false @@ -623,7 +635,7 @@ SELECT '' AS `Not False`, f1 -- !query schema struct -- !query output - NULL + -- !query @@ -646,7 +658,6 @@ SELECT '' AS `Not True`, f1 -- !query schema struct -- !query output - NULL false false false diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/case.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/case.sql.out index 1b002c3f48ae2..090b97e97bea6 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/case.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/case.sql.out @@ -176,28 +176,28 @@ struct -- !query SELECT CASE WHEN 1=0 THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END -- !query schema -struct +struct<> -- !query output -1.0 +java.lang.ArithmeticException +divide by zero -- !query SELECT CASE 1 WHEN 0 THEN 1/0 WHEN 1 THEN 1 ELSE 2/0 END -- !query schema -struct +struct<> -- !query output -1.0 +java.lang.ArithmeticException +divide by zero -- !query SELECT CASE WHEN i > 100 THEN 1/0 ELSE 0 END FROM case_tbl -- !query schema -struct 100) THEN (CAST(1 AS DOUBLE) / CAST(0 AS DOUBLE)) ELSE CAST(0 AS DOUBLE) END:double> +struct<> -- !query output -0.0 -0.0 -0.0 -0.0 +java.lang.ArithmeticException +divide by zero -- !query @@ -294,7 +294,7 @@ struct SELECT COALESCE(a.f, b.i, b.j) FROM CASE_TBL a, CASE2_TBL b -- !query schema -struct +struct -- !query output -30.3 -30.3 @@ -388,7 +388,7 @@ SELECT CASE WHEN 'it was bar!' THEN 'bar recognized' ELSE 'unrecognized' END -- !query schema -struct +struct -- !query output bar recognized diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/create_view.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/create_view.sql.out index ae1cb2f171704..9d6a8e656b2a4 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/create_view.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/create_view.sql.out @@ -56,7 +56,7 @@ CREATE VIEW key_dependent_view AS struct<> -- !query output org.apache.spark.sql.AnalysisException -expression 'spark_catalog.default.view_base_table.`data`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.; +expression 'spark_catalog.default.view_base_table.data' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get. -- !query @@ -257,7 +257,7 @@ View Text SELECT * FROM base_table View Original Text SELECT * FROM base_table View Catalog and Namespace spark_catalog.temp_view_test View Query Output Columns [a, id] -Table Properties [view.catalogAndNamespace.numParts=2, view.query.out.col.0=a, view.query.out.numCols=2, view.query.out.col.1=id, view.catalogAndNamespace.part.0=spark_catalog, view.catalogAndNamespace.part.1=temp_view_test] +Table Properties [] -- !query @@ -266,7 +266,7 @@ CREATE VIEW v1_temp AS SELECT * FROM temp_table struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `temp_view_test`.`v1_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `temp_view_test`.`v1_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -313,7 +313,7 @@ View Text SELECT * FROM base_table View Original Text SELECT * FROM base_table View Catalog and Namespace spark_catalog.temp_view_test View Query Output Columns [a, id] -Table Properties [view.catalogAndNamespace.numParts=2, view.query.out.col.0=a, view.query.out.numCols=2, view.query.out.col.1=id, view.catalogAndNamespace.part.0=spark_catalog, view.catalogAndNamespace.part.1=temp_view_test] +Table Properties [] -- !query @@ -322,7 +322,7 @@ CREATE VIEW temp_view_test.v3_temp AS SELECT * FROM temp_table struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `temp_view_test`.`v3_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `temp_view_test`.`v3_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -359,7 +359,7 @@ View Original Text SELECT t1.a AS t1_a, t2.a AS t2_a WHERE t1.id = t2.id View Catalog and Namespace spark_catalog.temp_view_test View Query Output Columns [t1_a, t2_a] -Table Properties [view.catalogAndNamespace.numParts=2, view.query.out.col.0=t1_a, view.query.out.numCols=2, view.query.out.col.1=t2_a, view.catalogAndNamespace.part.0=spark_catalog, view.catalogAndNamespace.part.1=temp_view_test] +Table Properties [] -- !query @@ -371,7 +371,7 @@ CREATE VIEW v4_temp AS struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `temp_view_test`.`v4_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `temp_view_test`.`v4_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -383,7 +383,7 @@ CREATE VIEW v5_temp AS struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `temp_view_test`.`v5_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `temp_view_test`.`v5_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -413,7 +413,7 @@ View Text SELECT * FROM base_table WHERE id IN (SELECT id FROM base_t View Original Text SELECT * FROM base_table WHERE id IN (SELECT id FROM base_table2) View Catalog and Namespace spark_catalog.temp_view_test View Query Output Columns [a, id] -Table Properties [view.catalogAndNamespace.numParts=2, view.query.out.col.0=a, view.query.out.numCols=2, view.query.out.col.1=id, view.catalogAndNamespace.part.0=spark_catalog, view.catalogAndNamespace.part.1=temp_view_test] +Table Properties [] -- !query @@ -443,7 +443,7 @@ View Text SELECT t1.id, t2.a FROM base_table t1, (SELECT * FROM base_ View Original Text SELECT t1.id, t2.a FROM base_table t1, (SELECT * FROM base_table2) t2 View Catalog and Namespace spark_catalog.temp_view_test View Query Output Columns [id, a] -Table Properties [view.catalogAndNamespace.numParts=2, view.query.out.col.0=id, view.query.out.numCols=2, view.query.out.col.1=a, view.catalogAndNamespace.part.0=spark_catalog, view.catalogAndNamespace.part.1=temp_view_test] +Table Properties [] -- !query @@ -473,7 +473,7 @@ View Text SELECT * FROM base_table WHERE EXISTS (SELECT 1 FROM base_t View Original Text SELECT * FROM base_table WHERE EXISTS (SELECT 1 FROM base_table2) View Catalog and Namespace spark_catalog.temp_view_test View Query Output Columns [a, id] -Table Properties [view.catalogAndNamespace.numParts=2, view.query.out.col.0=a, view.query.out.numCols=2, view.query.out.col.1=id, view.catalogAndNamespace.part.0=spark_catalog, view.catalogAndNamespace.part.1=temp_view_test] +Table Properties [] -- !query @@ -503,7 +503,7 @@ View Text SELECT * FROM base_table WHERE NOT EXISTS (SELECT 1 FROM ba View Original Text SELECT * FROM base_table WHERE NOT EXISTS (SELECT 1 FROM base_table2) View Catalog and Namespace spark_catalog.temp_view_test View Query Output Columns [a, id] -Table Properties [view.catalogAndNamespace.numParts=2, view.query.out.col.0=a, view.query.out.numCols=2, view.query.out.col.1=id, view.catalogAndNamespace.part.0=spark_catalog, view.catalogAndNamespace.part.1=temp_view_test] +Table Properties [] -- !query @@ -533,7 +533,7 @@ View Text SELECT * FROM base_table WHERE EXISTS (SELECT 1) View Original Text SELECT * FROM base_table WHERE EXISTS (SELECT 1) View Catalog and Namespace spark_catalog.temp_view_test View Query Output Columns [a, id] -Table Properties [view.catalogAndNamespace.numParts=2, view.query.out.col.0=a, view.query.out.numCols=2, view.query.out.col.1=id, view.catalogAndNamespace.part.0=spark_catalog, view.catalogAndNamespace.part.1=temp_view_test] +Table Properties [] -- !query @@ -542,7 +542,7 @@ CREATE VIEW v6_temp AS SELECT * FROM base_table WHERE id IN (SELECT id FROM temp struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `temp_view_test`.`v6_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `temp_view_test`.`v6_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -551,7 +551,7 @@ CREATE VIEW v7_temp AS SELECT t1.id, t2.a FROM base_table t1, (SELECT * FROM tem struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `temp_view_test`.`v7_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `temp_view_test`.`v7_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -560,7 +560,7 @@ CREATE VIEW v8_temp AS SELECT * FROM base_table WHERE EXISTS (SELECT 1 FROM temp struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `temp_view_test`.`v8_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `temp_view_test`.`v8_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -569,7 +569,7 @@ CREATE VIEW v9_temp AS SELECT * FROM base_table WHERE NOT EXISTS (SELECT 1 FROM struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `temp_view_test`.`v9_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `temp_view_test`.`v9_temp` by referencing a temporary view temp_table. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -669,7 +669,7 @@ View Text SELECT * FROM t1 CROSS JOIN t2 View Original Text SELECT * FROM t1 CROSS JOIN t2 View Catalog and Namespace spark_catalog.testviewschm2 View Query Output Columns [num, name, num2, value] -Table Properties [view.query.out.col.3=value, view.catalogAndNamespace.numParts=2, view.query.out.col.0=num, view.query.out.numCols=4, view.query.out.col.1=name, view.catalogAndNamespace.part.0=spark_catalog, view.query.out.col.2=num2, view.catalogAndNamespace.part.1=testviewschm2] +Table Properties [] -- !query @@ -678,7 +678,7 @@ CREATE VIEW temporal1 AS SELECT * FROM t1 CROSS JOIN tt struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `testviewschm2`.`temporal1` by referencing a temporary view tt. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `testviewschm2`.`temporal1` by referencing a temporary view tt. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -710,7 +710,7 @@ View Text SELECT * FROM t1 INNER JOIN t2 ON t1.num = t2.num2 View Original Text SELECT * FROM t1 INNER JOIN t2 ON t1.num = t2.num2 View Catalog and Namespace spark_catalog.testviewschm2 View Query Output Columns [num, name, num2, value] -Table Properties [view.query.out.col.3=value, view.catalogAndNamespace.numParts=2, view.query.out.col.0=num, view.query.out.numCols=4, view.query.out.col.1=name, view.catalogAndNamespace.part.0=spark_catalog, view.query.out.col.2=num2, view.catalogAndNamespace.part.1=testviewschm2] +Table Properties [] -- !query @@ -719,7 +719,7 @@ CREATE VIEW temporal2 AS SELECT * FROM t1 INNER JOIN tt ON t1.num = tt.num2 struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `testviewschm2`.`temporal2` by referencing a temporary view tt. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `testviewschm2`.`temporal2` by referencing a temporary view tt. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -751,7 +751,7 @@ View Text SELECT * FROM t1 LEFT JOIN t2 ON t1.num = t2.num2 View Original Text SELECT * FROM t1 LEFT JOIN t2 ON t1.num = t2.num2 View Catalog and Namespace spark_catalog.testviewschm2 View Query Output Columns [num, name, num2, value] -Table Properties [view.query.out.col.3=value, view.catalogAndNamespace.numParts=2, view.query.out.col.0=num, view.query.out.numCols=4, view.query.out.col.1=name, view.catalogAndNamespace.part.0=spark_catalog, view.query.out.col.2=num2, view.catalogAndNamespace.part.1=testviewschm2] +Table Properties [] -- !query @@ -760,7 +760,7 @@ CREATE VIEW temporal3 AS SELECT * FROM t1 LEFT JOIN tt ON t1.num = tt.num2 struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `testviewschm2`.`temporal3` by referencing a temporary view tt. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `testviewschm2`.`temporal3` by referencing a temporary view tt. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -792,7 +792,7 @@ View Text SELECT * FROM t1 LEFT JOIN t2 ON t1.num = t2.num2 AND t2.va View Original Text SELECT * FROM t1 LEFT JOIN t2 ON t1.num = t2.num2 AND t2.value = 'xxx' View Catalog and Namespace spark_catalog.testviewschm2 View Query Output Columns [num, name, num2, value] -Table Properties [view.query.out.col.3=value, view.catalogAndNamespace.numParts=2, view.query.out.col.0=num, view.query.out.numCols=4, view.query.out.col.1=name, view.catalogAndNamespace.part.0=spark_catalog, view.query.out.col.2=num2, view.catalogAndNamespace.part.1=testviewschm2] +Table Properties [] -- !query @@ -801,7 +801,7 @@ CREATE VIEW temporal4 AS SELECT * FROM t1 LEFT JOIN tt ON t1.num = tt.num2 AND t struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `testviewschm2`.`temporal4` by referencing a temporary view tt. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `testviewschm2`.`temporal4` by referencing a temporary view tt. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -810,7 +810,7 @@ CREATE VIEW temporal5 AS SELECT * FROM t1 WHERE num IN (SELECT num FROM t1 WHERE struct<> -- !query output org.apache.spark.sql.AnalysisException -Not allowed to create a permanent view `testviewschm2`.`temporal5` by referencing a temporary view tt. Please create a temp view instead by CREATE TEMP VIEW; +Not allowed to create a permanent view `testviewschm2`.`temporal5` by referencing a temporary view tt. Please create a temp view instead by CREATE TEMP VIEW -- !query @@ -894,7 +894,7 @@ BETWEEN (SELECT d FROM tbl2 WHERE c = 1) AND (SELECT e FROM tbl3 WHERE f = 2) AND EXISTS (SELECT g FROM tbl4 LEFT JOIN tbl3 ON tbl4.h = tbl3.f) View Catalog and Namespace spark_catalog.testviewschm2 View Query Output Columns [a, b] -Table Properties [view.catalogAndNamespace.numParts=2, view.query.out.col.0=a, view.query.out.numCols=2, view.query.out.col.1=b, view.catalogAndNamespace.part.0=spark_catalog, view.catalogAndNamespace.part.1=testviewschm2] +Table Properties [] -- !query @@ -933,7 +933,7 @@ AND EXISTS (SELECT g FROM tbl4 LEFT JOIN tbl3 ON tbl4.h = tbl3.f) AND NOT EXISTS (SELECT g FROM tbl4 LEFT JOIN tmptbl ON tbl4.h = tmptbl.j) View Catalog and Namespace spark_catalog.testviewschm2 View Query Output Columns [a, b] -Table Properties [view.catalogAndNamespace.numParts=2, view.query.out.col.0=a, view.query.out.numCols=2, view.query.out.col.1=b, view.catalogAndNamespace.part.0=spark_catalog, view.catalogAndNamespace.part.1=testviewschm2] +Table Properties [] -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out index 1d862ba8a41a8..a959284750483 100755 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/date.sql.out @@ -584,31 +584,34 @@ select make_date(-44, 3, 15) -- !query schema struct -- !query output --0044-03-15 +0045-03-15 -- !query select make_date(2013, 2, 30) -- !query schema -struct +struct<> -- !query output -NULL +java.time.DateTimeException +Invalid date 'FEBRUARY 30' -- !query select make_date(2013, 13, 1) -- !query schema -struct +struct<> -- !query output -NULL +java.time.DateTimeException +Invalid value for MonthOfYear (valid values 1 - 12): 13 -- !query select make_date(2013, 11, -1) -- !query schema -struct +struct<> -- !query output -NULL +java.time.DateTimeException +Invalid value for DayOfMonth (valid values 1 - 28/31): -1 -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/float4.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/float4.sql.out index fe8375c5eab8f..c9ff3c8debc21 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/float4.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/float4.sql.out @@ -53,7 +53,7 @@ struct<> -- !query SELECT float('NaN') -- !query schema -struct +struct -- !query output NaN @@ -61,7 +61,7 @@ NaN -- !query SELECT float('nan') -- !query schema -struct +struct -- !query output NaN @@ -69,7 +69,7 @@ NaN -- !query SELECT float(' NAN ') -- !query schema -struct +struct< NAN :float> -- !query output NaN @@ -77,7 +77,7 @@ NaN -- !query SELECT float('infinity') -- !query schema -struct +struct -- !query output Infinity @@ -85,7 +85,7 @@ Infinity -- !query SELECT float(' -INFINiTY ') -- !query schema -struct +struct< -INFINiTY :float> -- !query output -Infinity @@ -120,7 +120,7 @@ invalid input syntax for type numeric: INFINITY x -- !query SELECT float('Infinity') + 100.0 -- !query schema -struct<(CAST(CAST(Infinity AS FLOAT) AS DOUBLE) + CAST(100.0 AS DOUBLE)):double> +struct<(Infinity + 100.0):double> -- !query output Infinity @@ -128,7 +128,7 @@ Infinity -- !query SELECT float('Infinity') / float('Infinity') -- !query schema -struct<(CAST(CAST(Infinity AS FLOAT) AS DOUBLE) / CAST(CAST(Infinity AS FLOAT) AS DOUBLE)):double> +struct<(Infinity / Infinity):double> -- !query output NaN @@ -136,7 +136,7 @@ NaN -- !query SELECT float('nan') / float('nan') -- !query schema -struct<(CAST(CAST(nan AS FLOAT) AS DOUBLE) / CAST(CAST(nan AS FLOAT) AS DOUBLE)):double> +struct<(nan / nan):double> -- !query output NaN @@ -227,22 +227,22 @@ struct SELECT '' AS three, f.f1, f.f1 * '-10' AS x FROM FLOAT4_TBL f WHERE f.f1 > '0.0' -- !query schema -struct +struct -- !query output - 1.2345679E-20 -1.2345678720289608E-19 - 1.2345679E20 -1.2345678955701443E21 - 1004.3 -10042.999877929688 + 1.2345679E-20 -1.2345678E-19 + 1.2345679E20 -1.2345678E21 + 1004.3 -10043.0 -- !query SELECT '' AS three, f.f1, f.f1 + '-10' AS x FROM FLOAT4_TBL f WHERE f.f1 > '0.0' -- !query schema -struct +struct -- !query output 1.2345679E-20 -10.0 - 1.2345679E20 1.2345678955701443E20 - 1004.3 994.2999877929688 + 1.2345679E20 1.2345679E20 + 1004.3 994.3 -- !query @@ -260,11 +260,11 @@ struct SELECT '' AS three, f.f1, f.f1 - '-10' AS x FROM FLOAT4_TBL f WHERE f.f1 > '0.0' -- !query schema -struct +struct -- !query output 1.2345679E-20 10.0 - 1.2345679E20 1.2345678955701443E20 - 1004.3 1014.2999877929688 + 1.2345679E20 1.2345679E20 + 1004.3 1014.3 -- !query @@ -282,7 +282,7 @@ struct -- !query SELECT smallint(float('32767.4')) -- !query schema -struct +struct<32767.4:smallint> -- !query output 32767 @@ -290,7 +290,7 @@ struct -- !query SELECT smallint(float('32767.6')) -- !query schema -struct +struct<32767.6:smallint> -- !query output 32767 @@ -298,7 +298,7 @@ struct -- !query SELECT smallint(float('-32768.4')) -- !query schema -struct +struct<-32768.4:smallint> -- !query output -32768 @@ -306,7 +306,7 @@ struct -- !query SELECT smallint(float('-32768.6')) -- !query schema -struct +struct<-32768.6:smallint> -- !query output -32768 @@ -314,7 +314,7 @@ struct -- !query SELECT int(float('2147483520')) -- !query schema -struct +struct<2147483520:int> -- !query output 2147483520 @@ -331,7 +331,7 @@ Casting 2.14748365E9 to int causes overflow -- !query SELECT int(float('-2147483648.5')) -- !query schema -struct +struct<-2147483648.5:int> -- !query output -2147483648 @@ -348,7 +348,7 @@ Casting -2.1474839E9 to int causes overflow -- !query SELECT bigint(float('9223369837831520256')) -- !query schema -struct +struct<9223369837831520256:bigint> -- !query output 9223369837831520256 @@ -356,7 +356,7 @@ struct -- !query SELECT bigint(float('9223372036854775807')) -- !query schema -struct +struct<9223372036854775807:bigint> -- !query output 9223372036854775807 @@ -364,7 +364,7 @@ struct -- !query SELECT bigint(float('-9223372036854775808.5')) -- !query schema -struct +struct<-9223372036854775808.5:bigint> -- !query output -9223372036854775808 diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/float8.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/float8.sql.out index 4cdb6958a230a..45e103e9482a3 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/float8.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/float8.sql.out @@ -53,7 +53,7 @@ struct<> -- !query SELECT double('10e400') -- !query schema -struct +struct<10e400:double> -- !query output Infinity @@ -61,7 +61,7 @@ Infinity -- !query SELECT double('-10e400') -- !query schema -struct +struct<-10e400:double> -- !query output -Infinity @@ -69,7 +69,7 @@ struct -- !query SELECT double('10e-400') -- !query schema -struct +struct<10e-400:double> -- !query output 0.0 @@ -77,7 +77,7 @@ struct -- !query SELECT double('-10e-400') -- !query schema -struct +struct<-10e-400:double> -- !query output -0.0 @@ -85,7 +85,7 @@ struct -- !query SELECT double('NaN') -- !query schema -struct +struct -- !query output NaN @@ -93,7 +93,7 @@ NaN -- !query SELECT double('nan') -- !query schema -struct +struct -- !query output NaN @@ -101,7 +101,7 @@ NaN -- !query SELECT double(' NAN ') -- !query schema -struct +struct< NAN :double> -- !query output NaN @@ -109,7 +109,7 @@ NaN -- !query SELECT double('infinity') -- !query schema -struct +struct -- !query output Infinity @@ -117,7 +117,7 @@ Infinity -- !query SELECT double(' -INFINiTY ') -- !query schema -struct +struct< -INFINiTY :double> -- !query output -Infinity @@ -152,7 +152,7 @@ invalid input syntax for type numeric: INFINITY x -- !query SELECT double('Infinity') + 100.0 -- !query schema -struct<(CAST(Infinity AS DOUBLE) + CAST(100.0 AS DOUBLE)):double> +struct<(Infinity + 100.0):double> -- !query output Infinity @@ -160,7 +160,7 @@ Infinity -- !query SELECT double('Infinity') / double('Infinity') -- !query schema -struct<(CAST(Infinity AS DOUBLE) / CAST(Infinity AS DOUBLE)):double> +struct<(Infinity / Infinity):double> -- !query output NaN @@ -168,7 +168,7 @@ NaN -- !query SELECT double('NaN') / double('NaN') -- !query schema -struct<(CAST(NaN AS DOUBLE) / CAST(NaN AS DOUBLE)):double> +struct<(NaN / NaN):double> -- !query output NaN @@ -375,7 +375,7 @@ struct -- !query SELECT power(double('144'), double('0.5')) -- !query schema -struct +struct -- !query output 12.0 @@ -383,7 +383,7 @@ struct -- !query SELECT power(double('NaN'), double('0.5')) -- !query schema -struct +struct -- !query output NaN @@ -391,7 +391,7 @@ NaN -- !query SELECT power(double('144'), double('NaN')) -- !query schema -struct +struct -- !query output NaN @@ -399,7 +399,7 @@ NaN -- !query SELECT power(double('NaN'), double('NaN')) -- !query schema -struct +struct -- !query output NaN @@ -407,7 +407,7 @@ NaN -- !query SELECT power(double('-1'), double('NaN')) -- !query schema -struct +struct -- !query output NaN @@ -415,7 +415,7 @@ NaN -- !query SELECT power(double('1'), double('NaN')) -- !query schema -struct +struct -- !query output NaN @@ -423,7 +423,7 @@ NaN -- !query SELECT power(double('NaN'), double('0')) -- !query schema -struct +struct -- !query output 1.0 @@ -466,7 +466,7 @@ struct<> -- !query SELECT '' AS bad, f.f1 * '1e200' from UPDATED_FLOAT8_TBL f -- !query schema -struct +struct -- !query output -1.0042999999999999E203 -1.2345678901234 @@ -490,7 +490,7 @@ struct -- !query SELECT sinh(double('1')) -- !query schema -struct +struct -- !query output 1.1752011936438014 @@ -498,7 +498,7 @@ struct -- !query SELECT cosh(double('1')) -- !query schema -struct +struct -- !query output 1.543080634815244 @@ -506,7 +506,7 @@ struct -- !query SELECT tanh(double('1')) -- !query schema -struct +struct -- !query output 0.7615941559557649 @@ -514,7 +514,7 @@ struct -- !query SELECT asinh(double('1')) -- !query schema -struct +struct -- !query output 0.8813735870195429 @@ -522,7 +522,7 @@ struct -- !query SELECT acosh(double('2')) -- !query schema -struct +struct -- !query output 1.3169578969248166 @@ -530,7 +530,7 @@ struct -- !query SELECT atanh(double('0.5')) -- !query schema -struct +struct -- !query output 0.5493061443340548 @@ -538,7 +538,7 @@ struct -- !query SELECT sinh(double('Infinity')) -- !query schema -struct +struct -- !query output Infinity @@ -546,7 +546,7 @@ Infinity -- !query SELECT sinh(double('-Infinity')) -- !query schema -struct +struct -- !query output -Infinity @@ -554,7 +554,7 @@ struct -- !query SELECT sinh(double('NaN')) -- !query schema -struct +struct -- !query output NaN @@ -562,7 +562,7 @@ NaN -- !query SELECT cosh(double('Infinity')) -- !query schema -struct +struct -- !query output Infinity @@ -570,7 +570,7 @@ Infinity -- !query SELECT cosh(double('-Infinity')) -- !query schema -struct +struct -- !query output Infinity @@ -578,7 +578,7 @@ Infinity -- !query SELECT cosh(double('NaN')) -- !query schema -struct +struct -- !query output NaN @@ -586,7 +586,7 @@ NaN -- !query SELECT tanh(double('Infinity')) -- !query schema -struct +struct -- !query output 1.0 @@ -594,7 +594,7 @@ struct -- !query SELECT tanh(double('-Infinity')) -- !query schema -struct +struct -- !query output -1.0 @@ -602,7 +602,7 @@ struct -- !query SELECT tanh(double('NaN')) -- !query schema -struct +struct -- !query output NaN @@ -610,7 +610,7 @@ NaN -- !query SELECT asinh(double('Infinity')) -- !query schema -struct +struct -- !query output Infinity @@ -618,7 +618,7 @@ Infinity -- !query SELECT asinh(double('-Infinity')) -- !query schema -struct +struct -- !query output -Infinity @@ -626,7 +626,7 @@ struct -- !query SELECT asinh(double('NaN')) -- !query schema -struct +struct -- !query output NaN @@ -634,7 +634,7 @@ NaN -- !query SELECT acosh(double('Infinity')) -- !query schema -struct +struct -- !query output Infinity @@ -642,7 +642,7 @@ Infinity -- !query SELECT acosh(double('-Infinity')) -- !query schema -struct +struct -- !query output NaN @@ -650,7 +650,7 @@ NaN -- !query SELECT acosh(double('NaN')) -- !query schema -struct +struct -- !query output NaN @@ -658,7 +658,7 @@ NaN -- !query SELECT atanh(double('Infinity')) -- !query schema -struct +struct -- !query output NaN @@ -666,7 +666,7 @@ NaN -- !query SELECT atanh(double('-Infinity')) -- !query schema -struct +struct -- !query output NaN @@ -674,7 +674,7 @@ NaN -- !query SELECT atanh(double('NaN')) -- !query schema -struct +struct -- !query output NaN @@ -742,7 +742,7 @@ struct -- !query SELECT smallint(double('32767.4')) -- !query schema -struct +struct<32767.4:smallint> -- !query output 32767 @@ -750,7 +750,7 @@ struct -- !query SELECT smallint(double('32767.6')) -- !query schema -struct +struct<32767.6:smallint> -- !query output 32767 @@ -758,7 +758,7 @@ struct -- !query SELECT smallint(double('-32768.4')) -- !query schema -struct +struct<-32768.4:smallint> -- !query output -32768 @@ -766,7 +766,7 @@ struct -- !query SELECT smallint(double('-32768.6')) -- !query schema -struct +struct<-32768.6:smallint> -- !query output -32768 @@ -774,7 +774,7 @@ struct -- !query SELECT int(double('2147483647.4')) -- !query schema -struct +struct<2147483647.4:int> -- !query output 2147483647 @@ -782,7 +782,7 @@ struct -- !query SELECT int(double('2147483647.6')) -- !query schema -struct +struct<2147483647.6:int> -- !query output 2147483647 @@ -790,7 +790,7 @@ struct -- !query SELECT int(double('-2147483648.4')) -- !query schema -struct +struct<-2147483648.4:int> -- !query output -2147483648 @@ -798,7 +798,7 @@ struct -- !query SELECT int(double('-2147483648.6')) -- !query schema -struct +struct<-2147483648.6:int> -- !query output -2147483648 @@ -806,7 +806,7 @@ struct -- !query SELECT bigint(double('9223372036854773760')) -- !query schema -struct +struct<9223372036854773760:bigint> -- !query output 9223372036854773760 @@ -814,7 +814,7 @@ struct -- !query SELECT bigint(double('9223372036854775807')) -- !query schema -struct +struct<9223372036854775807:bigint> -- !query output 9223372036854775807 @@ -822,7 +822,7 @@ struct -- !query SELECT bigint(double('-9223372036854775808.5')) -- !query schema -struct +struct<-9223372036854775808.5:bigint> -- !query output -9223372036854775808 diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/groupingsets.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/groupingsets.sql.out index 7312c20876296..1aa34b29575c2 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/groupingsets.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/groupingsets.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 54 +-- Number of queries: 55 -- !query @@ -443,6 +443,25 @@ struct NULL 1 +-- !query +select ten, sum(distinct four) filter (where string(four) like '123') from onek a +group by rollup(ten) +-- !query schema +struct +-- !query output +0 NULL +1 NULL +2 NULL +3 NULL +4 NULL +5 NULL +6 NULL +7 NULL +8 NULL +9 NULL +NULL NULL + + -- !query select count(*) from gstest4 group by rollup(unhashable_col,unsortable_col) -- !query schema @@ -654,7 +673,7 @@ select v||'a', case grouping(v||'a') when 1 then 1 else 0 end, count(*) from values (1, 'a'), (1, 'b') u(i,v) group by rollup(i, v||'a') order by 1,3 -- !query schema -struct +struct -- !query output NULL 1 2 NULL 1 2 @@ -667,7 +686,7 @@ select v||'a', case when grouping(v||'a') = 1 then 1 else 0 end, count(*) from values (1, 'a'), (1, 'b') u(i,v) group by rollup(i, v||'a') order by 1,3 -- !query schema -struct +struct -- !query output NULL 1 2 NULL 1 2 diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int2.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int2.sql.out index 02e373f2d2b2b..dee21ced28d90 100755 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int2.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int2.sql.out @@ -292,7 +292,7 @@ struct -- !query SELECT string(shiftleft(smallint(-1), 15)) -- !query schema -struct +struct -- !query output -32768 @@ -300,7 +300,7 @@ struct -- !query SELECT string(smallint(shiftleft(smallint(-1), 15))+1) -- !query schema -struct +struct<(shiftleft(-1, 15) + 1):string> -- !query output -32767 @@ -308,7 +308,7 @@ struct +struct<(-32768 % -1):smallint> -- !query output 0 diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int4.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int4.sql.out index 3d80c5d595d53..2bb71645af0e5 100755 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int4.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int4.sql.out @@ -433,7 +433,7 @@ struct -- !query SELECT string(shiftleft(int(-1), 31)) -- !query schema -struct +struct -- !query output -2147483648 @@ -441,7 +441,7 @@ struct -- !query SELECT string(int(shiftleft(int(-1), 31))+1) -- !query schema -struct +struct<(shiftleft(-1, 31) + 1):string> -- !query output -2147483647 @@ -449,7 +449,7 @@ struct -- !query SELECT int(-2147483648) % int(-1) -- !query schema -struct<(CAST(-2147483648 AS INT) % CAST(-1 AS INT)):int> +struct<(-2147483648 % -1):int> -- !query output 0 @@ -457,7 +457,7 @@ struct<(CAST(-2147483648 AS INT) % CAST(-1 AS INT)):int> -- !query SELECT int(-2147483648) % smallint(-1) -- !query schema -struct<(CAST(-2147483648 AS INT) % CAST(CAST(-1 AS SMALLINT) AS INT)):int> +struct<(-2147483648 % -1):int> -- !query output 0 diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int8.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int8.sql.out index 18b0c821ae70f..116e0c090d148 100755 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/int8.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/int8.sql.out @@ -569,25 +569,28 @@ struct -- !query select bigint('9223372036854775800') / bigint('0') -- !query schema -struct<(CAST(CAST(9223372036854775800 AS BIGINT) AS DOUBLE) / CAST(CAST(0 AS BIGINT) AS DOUBLE)):double> +struct<> -- !query output -NULL +java.lang.ArithmeticException +divide by zero -- !query select bigint('-9223372036854775808') / smallint('0') -- !query schema -struct<(CAST(CAST(-9223372036854775808 AS BIGINT) AS DOUBLE) / CAST(CAST(0 AS SMALLINT) AS DOUBLE)):double> +struct<> -- !query output -NULL +java.lang.ArithmeticException +divide by zero -- !query select smallint('100') / bigint('0') -- !query schema -struct<(CAST(CAST(100 AS SMALLINT) AS DOUBLE) / CAST(CAST(0 AS BIGINT) AS DOUBLE)):double> +struct<> -- !query output -NULL +java.lang.ArithmeticException +divide by zero -- !query @@ -621,13 +624,13 @@ SELECT CAST(q1 AS smallint) FROM int8_tbl WHERE q2 <> 456 struct<> -- !query output java.lang.ArithmeticException -Casting 4567890123456789 to short causes overflow +Casting 4567890123456789 to smallint causes overflow -- !query SELECT CAST(smallint('42') AS bigint), CAST(smallint('-37') AS bigint) -- !query schema -struct +struct -- !query output 42 -37 @@ -647,7 +650,7 @@ struct -- !query SELECT CAST(float('36854775807.0') AS bigint) -- !query schema -struct +struct -- !query output 36854775808 @@ -695,8 +698,13 @@ SELECT * FROM range(bigint('+4567890123456789'), bigint('+4567890123456799'), 0) -- !query schema struct<> -- !query output -java.lang.IllegalArgumentException -requirement failed: step (0) cannot be 0 +org.apache.spark.sql.AnalysisException +Table-valued function range with alternatives: + range(start: long, end: long, step: long, numSlices: integer) + range(start: long, end: long, step: long) + range(start: long, end: long) + range(end: long) +cannot be applied to (long, long, integer): requirement failed: step (0) cannot be 0; line 1 pos 14 -- !query @@ -714,7 +722,7 @@ struct -- !query SELECT string(shiftleft(bigint(-1), 63)) -- !query schema -struct +struct -- !query output -9223372036854775808 @@ -740,7 +748,7 @@ long overflow -- !query SELECT bigint((-9223372036854775808)) / bigint((-1)) -- !query schema -struct<(CAST(CAST(-9223372036854775808 AS BIGINT) AS DOUBLE) / CAST(CAST(-1 AS BIGINT) AS DOUBLE)):double> +struct<(-9223372036854775808 / -1):double> -- !query output 9.223372036854776E18 @@ -748,7 +756,7 @@ struct<(CAST(CAST(-9223372036854775808 AS BIGINT) AS DOUBLE) / CAST(CAST(-1 AS B -- !query SELECT bigint((-9223372036854775808)) % bigint((-1)) -- !query schema -struct<(CAST(-9223372036854775808 AS BIGINT) % CAST(-1 AS BIGINT)):bigint> +struct<(-9223372036854775808 % -1):bigint> -- !query output 0 @@ -765,7 +773,7 @@ long overflow -- !query SELECT bigint((-9223372036854775808)) / int((-1)) -- !query schema -struct<(CAST(CAST(-9223372036854775808 AS BIGINT) AS DOUBLE) / CAST(CAST(-1 AS INT) AS DOUBLE)):double> +struct<(-9223372036854775808 / -1):double> -- !query output 9.223372036854776E18 @@ -773,7 +781,7 @@ struct<(CAST(CAST(-9223372036854775808 AS BIGINT) AS DOUBLE) / CAST(CAST(-1 AS I -- !query SELECT bigint((-9223372036854775808)) % int((-1)) -- !query schema -struct<(CAST(-9223372036854775808 AS BIGINT) % CAST(CAST(-1 AS INT) AS BIGINT)):bigint> +struct<(-9223372036854775808 % -1):bigint> -- !query output 0 @@ -790,7 +798,7 @@ long overflow -- !query SELECT bigint((-9223372036854775808)) / smallint((-1)) -- !query schema -struct<(CAST(CAST(-9223372036854775808 AS BIGINT) AS DOUBLE) / CAST(CAST(-1 AS SMALLINT) AS DOUBLE)):double> +struct<(-9223372036854775808 / -1):double> -- !query output 9.223372036854776E18 @@ -798,7 +806,7 @@ struct<(CAST(CAST(-9223372036854775808 AS BIGINT) AS DOUBLE) / CAST(CAST(-1 AS S -- !query SELECT bigint((-9223372036854775808)) % smallint((-1)) -- !query schema -struct<(CAST(-9223372036854775808 AS BIGINT) % CAST(CAST(-1 AS SMALLINT) AS BIGINT)):bigint> +struct<(-9223372036854775808 % -1):bigint> -- !query output 0 diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/join.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/join.sql.out index 20f4f6b1f213f..4bc5b5e8df9fa 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/join.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/join.sql.out @@ -2729,7 +2729,7 @@ struct -- !query -select t1.q2, count(t2.*) +select t1.q2, count(t2.q1, t2.q2) from int8_tbl t1 left join int8_tbl t2 on (t1.q2 = t2.q1) group by t1.q2 order by 1 -- !query schema @@ -2742,7 +2742,7 @@ struct -- !query -select t1.q2, count(t2.*) +select t1.q2, count(t2.q1, t2.q2) from int8_tbl t1 left join (select * from int8_tbl) t2 on (t1.q2 = t2.q1) group by t1.q2 order by 1 -- !query schema @@ -2755,7 +2755,7 @@ struct -- !query -select t1.q2, count(t2.*) +select t1.q2, count(t2.q1, t2.q2) from int8_tbl t1 left join (select q1, case when q2=1 then 1 else q2 end as q2 from int8_tbl) t2 on (t1.q2 = t2.q1) @@ -3235,7 +3235,7 @@ select * from struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`y.f1`' given input columns: [j.f1, j.f1, x.q1, x.q2]; line 2 pos 63 +cannot resolve 'y.f1' given input columns: [j.f1, j.f1, x.q1, x.q2]; line 2 pos 63 -- !query @@ -3254,7 +3254,7 @@ select t1.uunique1 from struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`t1.uunique1`' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 7 +cannot resolve 't1.uunique1' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 7 -- !query @@ -3264,7 +3264,7 @@ select t2.uunique1 from struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`t2.uunique1`' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 7 +cannot resolve 't2.uunique1' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 7 -- !query @@ -3274,7 +3274,7 @@ select uunique1 from struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`uunique1`' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 7 +cannot resolve 'uunique1' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 7 -- !query @@ -3283,7 +3283,7 @@ select f1,g from int4_tbl a, (select f1 as g) ss struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`f1`' given input columns: []; line 1 pos 37 +cannot resolve 'f1' given input columns: []; line 1 pos 37 -- !query @@ -3292,7 +3292,7 @@ select f1,g from int4_tbl a, (select a.f1 as g) ss struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`a.f1`' given input columns: []; line 1 pos 37 +cannot resolve 'a.f1' given input columns: []; line 1 pos 37 -- !query @@ -3301,7 +3301,7 @@ select f1,g from int4_tbl a cross join (select f1 as g) ss struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`f1`' given input columns: []; line 1 pos 47 +cannot resolve 'f1' given input columns: []; line 1 pos 47 -- !query @@ -3310,7 +3310,7 @@ select f1,g from int4_tbl a cross join (select a.f1 as g) ss struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`a.f1`' given input columns: []; line 1 pos 47 +cannot resolve 'a.f1' given input columns: []; line 1 pos 47 -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/limit.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/limit.sql.out index 2c8bc31dbc6ca..2384010c67b4d 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/limit.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/limit.sql.out @@ -59,7 +59,7 @@ select * from int8_tbl limit (case when random() < 0.5 then bigint(null) end) struct<> -- !query output org.apache.spark.sql.AnalysisException -The limit expression must evaluate to a constant value, but got CASE WHEN (`_nondeterministic` < CAST(0.5BD AS DOUBLE)) THEN CAST(NULL AS BIGINT) END; +The limit expression must evaluate to a constant value, but got CASE WHEN (_nondeterministic < CAST(0.5BD AS DOUBLE)) THEN CAST(NULL AS BIGINT) END -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out index e59b9d5b63a40..8a4ee142011ce 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/numeric.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 577 +-- Number of queries: 592 -- !query @@ -3830,7 +3830,7 @@ INSERT INTO num_result SELECT t1.id, t2.id, t1.val, t2.val, t1.val * t2.val struct<> -- !query output org.apache.spark.sql.AnalysisException -`default`.`num_result` requires that the data to be inserted have the same number of columns as the target table: target table has 3 column(s) but the inserted data has 5 column(s), including 0 partition column(s) having constant value(s).; +`default`.`num_result` requires that the data to be inserted have the same number of columns as the target table: target table has 3 column(s) but the inserted data has 5 column(s), including 0 partition column(s) having constant value(s). -- !query @@ -4292,7 +4292,7 @@ struct<> -- !query SELECT decimal(double('NaN')) -- !query schema -struct +struct -- !query output NULL @@ -4300,7 +4300,7 @@ NULL -- !query SELECT decimal(double('Infinity')) -- !query schema -struct +struct -- !query output NULL @@ -4308,7 +4308,7 @@ NULL -- !query SELECT decimal(double('-Infinity')) -- !query schema -struct +struct<-Infinity:decimal(10,0)> -- !query output NULL @@ -4316,7 +4316,7 @@ NULL -- !query SELECT decimal(float('NaN')) -- !query schema -struct +struct -- !query output NULL @@ -4324,7 +4324,7 @@ NULL -- !query SELECT decimal(float('Infinity')) -- !query schema -struct +struct -- !query output NULL @@ -4332,7 +4332,7 @@ NULL -- !query SELECT decimal(float('-Infinity')) -- !query schema -struct +struct<-Infinity:decimal(10,0)> -- !query output NULL @@ -4423,6 +4423,177 @@ struct<> +-- !query +SELECT width_bucket(5.0, 3.0, 4.0, 0) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT width_bucket(5.0, 3.0, 4.0, -5) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT width_bucket(3.5, 3.0, 3.0, 888) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT width_bucket(double(5.0), double(3.0), double(4.0), 0) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT width_bucket(double(5.0), double(3.0), double(4.0), -5) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT width_bucket(double(3.5), double(3.0), double(3.0), 888) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT width_bucket('NaN', 3.0, 4.0, 888) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT width_bucket(double(0), 'NaN', double(4.0), 888) +-- !query schema +struct +-- !query output +NULL + + +-- !query +CREATE TABLE width_bucket_test (operand_num decimal(30,15), operand_f8 double) USING parquet +-- !query schema +struct<> +-- !query output + + + +-- !query +INSERT INTO width_bucket_test VALUES + (-5.2, -5.2), + (-0.0000000001, -0.0000000001), + (0.000000000001, 0.000000000001), + (1, 1), + (1.99999999999999, 1.99999999999999), + (2, 2), + (2.00000000000001, 2.00000000000001), + (3, 3), + (4, 4), + (4.5, 4.5), + (5, 5), + (5.5, 5.5), + (6, 6), + (7, 7), + (8, 8), + (9, 9), + (9.99999999999999, 9.99999999999999), + (10, 10), + (10.0000000000001, 10.0000000000001) +-- !query schema +struct<> +-- !query output + + + +-- !query +SELECT + operand_num, + width_bucket(operand_num, 0, 10, 5) AS wb_1, + width_bucket(operand_f8, 0, 10, 5) AS wb_1f, + width_bucket(operand_num, 10, 0, 5) AS wb_2, + width_bucket(operand_f8, 10, 0, 5) AS wb_2f, + width_bucket(operand_num, 2, 8, 4) AS wb_3, + width_bucket(operand_f8, 2, 8, 4) AS wb_3f, + width_bucket(operand_num, 5.0, 5.5, 20) AS wb_4, + width_bucket(operand_f8, 5.0, 5.5, 20) AS wb_4f, + width_bucket(operand_num, -25, 25, 10) AS wb_5, + width_bucket(operand_f8, -25, 25, 10) AS wb_5f + FROM width_bucket_test + ORDER BY operand_num ASC +-- !query schema +struct +-- !query output +-5.200000000000000 0 0 6 6 0 0 0 0 4 4 +-0.000000000100000 0 0 6 6 0 0 0 0 5 5 +0.000000000001000 1 1 5 5 0 0 0 0 6 6 +1.000000000000000 1 1 5 5 0 0 0 0 6 6 +1.999999999999990 1 1 5 5 0 0 0 0 6 6 +2.000000000000000 2 2 5 5 1 1 0 0 6 6 +2.000000000000010 2 2 4 4 1 1 0 0 6 6 +3.000000000000000 2 2 4 4 1 1 0 0 6 6 +4.000000000000000 3 3 4 4 2 2 0 0 6 6 +4.500000000000000 3 3 3 3 2 2 0 0 6 6 +5.000000000000000 3 3 3 3 3 3 1 1 7 7 +5.500000000000000 3 3 3 3 3 3 21 21 7 7 +6.000000000000000 4 4 3 3 3 3 21 21 7 7 +7.000000000000000 4 4 2 2 4 4 21 21 7 7 +8.000000000000000 5 5 2 2 5 5 21 21 7 7 +9.000000000000000 5 5 1 1 5 5 21 21 7 7 +9.999999999999990 5 5 1 1 5 5 21 21 7 7 +10.000000000000000 6 6 1 1 5 5 21 21 8 8 +10.000000000000100 6 6 0 0 5 5 21 21 8 8 + + +-- !query +SELECT width_bucket(double(0.0), double('Infinity'), 5, 10) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT width_bucket(double(0.0), 5, double('-Infinity'), 20) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT width_bucket(double('Infinity'), 1, 10, 10), + width_bucket(double('-Infinity'), 1, 10, 10) +-- !query schema +struct +-- !query output +11 0 + + +-- !query +DROP TABLE width_bucket_test +-- !query schema +struct<> +-- !query output + + + -- !query CREATE TABLE num_input_test (n1 decimal(38, 18)) USING parquet -- !query schema @@ -4486,7 +4657,7 @@ struct -- !query select cast(999999999999999999999 as decimal(38, 0))/1000000000000000000000 -- !query schema -struct<(CAST(CAST(999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) / CAST(1000000000000000000000 AS DECIMAL(38,0))):decimal(38,6)> +struct<(CAST(999999999999999999999 AS DECIMAL(38,0)) / 1000000000000000000000):decimal(38,6)> -- !query output 1.000000 @@ -4494,7 +4665,7 @@ struct<(CAST(CAST(999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) / CA -- !query select div(cast(999999999999999999999 as decimal(38, 0)),1000000000000000000000) -- !query schema -struct<(CAST(CAST(999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) div CAST(1000000000000000000000 AS DECIMAL(38,0))):bigint> +struct<(CAST(999999999999999999999 AS DECIMAL(38,0)) div 1000000000000000000000):bigint> -- !query output 0 @@ -4502,7 +4673,7 @@ struct<(CAST(CAST(999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) div -- !query select mod(cast(999999999999999999999 as decimal(38, 0)),1000000000000000000000) -- !query schema -struct<(CAST(CAST(999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) % CAST(1000000000000000000000 AS DECIMAL(38,0))):decimal(22,0)> +struct<(CAST(999999999999999999999 AS DECIMAL(38,0)) % 1000000000000000000000):decimal(22,0)> -- !query output 999999999999999999999 @@ -4510,7 +4681,7 @@ struct<(CAST(CAST(999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) % CA -- !query select div(cast(-9999999999999999999999 as decimal(38, 0)),1000000000000000000000) -- !query schema -struct<(CAST(CAST(-9999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) div CAST(1000000000000000000000 AS DECIMAL(38,0))):bigint> +struct<(CAST(-9999999999999999999999 AS DECIMAL(38,0)) div 1000000000000000000000):bigint> -- !query output -9 @@ -4518,7 +4689,7 @@ struct<(CAST(CAST(-9999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) di -- !query select mod(cast(-9999999999999999999999 as decimal(38, 0)),1000000000000000000000) -- !query schema -struct<(CAST(CAST(-9999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) % CAST(1000000000000000000000 AS DECIMAL(38,0))):decimal(22,0)> +struct<(CAST(-9999999999999999999999 AS DECIMAL(38,0)) % 1000000000000000000000):decimal(22,0)> -- !query output -999999999999999999999 @@ -4526,7 +4697,7 @@ struct<(CAST(CAST(-9999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) % -- !query select div(cast(-9999999999999999999999 as decimal(38, 0)),1000000000000000000000)*1000000000000000000000 + mod(cast(-9999999999999999999999 as decimal(38, 0)),1000000000000000000000) -- !query schema -struct<(CAST((CAST(CAST((CAST(CAST(-9999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) div CAST(1000000000000000000000 AS DECIMAL(38,0))) AS DECIMAL(20,0)) AS DECIMAL(22,0)) * CAST(1000000000000000000000 AS DECIMAL(22,0))) AS DECIMAL(38,0)) + CAST((CAST(CAST(-9999999999999999999999 AS DECIMAL(38,0)) AS DECIMAL(38,0)) % CAST(1000000000000000000000 AS DECIMAL(38,0))) AS DECIMAL(38,0))):decimal(38,0)> +struct<(((CAST(-9999999999999999999999 AS DECIMAL(38,0)) div 1000000000000000000000) * 1000000000000000000000) + (CAST(-9999999999999999999999 AS DECIMAL(38,0)) % 1000000000000000000000)):decimal(38,0)> -- !query output -9999999999999999999999 @@ -4534,7 +4705,7 @@ struct<(CAST((CAST(CAST((CAST(CAST(-9999999999999999999999 AS DECIMAL(38,0)) AS -- !query select mod (70.0,70) -- !query schema -struct<(CAST(70.0 AS DECIMAL(3,1)) % CAST(CAST(70 AS DECIMAL(2,0)) AS DECIMAL(3,1))):decimal(3,1)> +struct<(70.0 % 70):decimal(3,1)> -- !query output 0.0 @@ -4542,7 +4713,7 @@ struct<(CAST(70.0 AS DECIMAL(3,1)) % CAST(CAST(70 AS DECIMAL(2,0)) AS DECIMAL(3, -- !query select div (70.0,70) -- !query schema -struct<(CAST(70.0 AS DECIMAL(3,1)) div CAST(CAST(70 AS DECIMAL(2,0)) AS DECIMAL(3,1))):bigint> +struct<(70.0 div 70):bigint> -- !query output 1 @@ -4550,7 +4721,7 @@ struct<(CAST(70.0 AS DECIMAL(3,1)) div CAST(CAST(70 AS DECIMAL(2,0)) AS DECIMAL( -- !query select 70.0 / 70 -- !query schema -struct<(CAST(70.0 AS DECIMAL(3,1)) / CAST(CAST(70 AS DECIMAL(2,0)) AS DECIMAL(3,1))):decimal(8,6)> +struct<(70.0 / 70):decimal(8,6)> -- !query output 1.000000 @@ -4558,7 +4729,7 @@ struct<(CAST(70.0 AS DECIMAL(3,1)) / CAST(CAST(70 AS DECIMAL(2,0)) AS DECIMAL(3, -- !query select 12345678901234567890 % 123 -- !query schema -struct<(CAST(12345678901234567890 AS DECIMAL(20,0)) % CAST(CAST(123 AS DECIMAL(3,0)) AS DECIMAL(20,0))):decimal(3,0)> +struct<(12345678901234567890 % 123):decimal(3,0)> -- !query output 78 @@ -4566,7 +4737,7 @@ struct<(CAST(12345678901234567890 AS DECIMAL(20,0)) % CAST(CAST(123 AS DECIMAL(3 -- !query select exp(0.0) -- !query schema -struct +struct -- !query output 1.0 @@ -4574,7 +4745,7 @@ struct -- !query select exp(1.0) -- !query schema -struct +struct -- !query output 2.7182818284590455 @@ -4582,7 +4753,7 @@ struct -- !query select exp(32.999) -- !query schema -struct +struct -- !query output 2.1442904349215556E14 @@ -4590,7 +4761,7 @@ struct -- !query select exp(-32.999) -- !query schema -struct +struct -- !query output 4.663547361468238E-15 @@ -4598,7 +4769,7 @@ struct -- !query select exp(123.456) -- !query schema -struct +struct -- !query output 4.132944352778106E53 @@ -4606,7 +4777,7 @@ struct -- !query select exp(-123.456) -- !query schema -struct +struct -- !query output 2.4195825412645934E-54 @@ -4614,7 +4785,7 @@ struct -- !query select exp(1234.5678) -- !query schema -struct +struct -- !query output Infinity @@ -4622,39 +4793,49 @@ Infinity -- !query select * from range(cast(0.0 as decimal(38, 18)), cast(4.0 as decimal(38, 18))) -- !query schema -struct +struct<> -- !query output -0 -1 -2 -3 +org.apache.spark.sql.AnalysisException +Table-valued function range with alternatives: + range(start: long, end: long, step: long, numSlices: integer) + range(start: long, end: long, step: long) + range(start: long, end: long) + range(end: long) +cannot be applied to (decimal(38,18), decimal(38,18)): Incompatible input data type. Expected: long; Found: decimal(38,18); line 1 pos 14 -- !query select * from range(cast(0.1 as decimal(38, 18)), cast(4.0 as decimal(38, 18)), cast(1.3 as decimal(38, 18))) -- !query schema -struct +struct<> -- !query output -0 -1 -2 -3 +org.apache.spark.sql.AnalysisException +Table-valued function range with alternatives: + range(start: long, end: long, step: long, numSlices: integer) + range(start: long, end: long, step: long) + range(start: long, end: long) + range(end: long) +cannot be applied to (decimal(38,18), decimal(38,18), decimal(38,18)): Incompatible input data type. Expected: long; Found: decimal(38,18); line 1 pos 14 -- !query select * from range(cast(4.0 as decimal(38, 18)), cast(-1.5 as decimal(38, 18)), cast(-2.2 as decimal(38, 18))) -- !query schema -struct +struct<> -- !query output -0 -2 -4 +org.apache.spark.sql.AnalysisException +Table-valued function range with alternatives: + range(start: long, end: long, step: long, numSlices: integer) + range(start: long, end: long, step: long) + range(start: long, end: long) + range(end: long) +cannot be applied to (decimal(38,18), decimal(38,18), decimal(38,18)): Incompatible input data type. Expected: long; Found: decimal(38,18); line 1 pos 14 -- !query select ln(1.2345678e-28) -- !query schema -struct +struct -- !query output -64.26166165451762 @@ -4662,7 +4843,7 @@ struct -- !query select ln(0.0456789) -- !query schema -struct +struct -- !query output -3.0861187944847437 @@ -4670,7 +4851,7 @@ struct -- !query select ln(0.99949452) -- !query schema -struct +struct -- !query output -5.056077980832118E-4 @@ -4678,7 +4859,7 @@ struct -- !query select ln(1.00049687395) -- !query schema -struct +struct -- !query output 4.967505490136803E-4 @@ -4686,7 +4867,7 @@ struct -- !query select ln(1234.567890123456789) -- !query schema -struct +struct -- !query output 7.11847630129779 @@ -4694,7 +4875,7 @@ struct -- !query select ln(5.80397490724e5) -- !query schema -struct +struct -- !query output 13.271468476626518 @@ -4702,7 +4883,7 @@ struct -- !query select ln(9.342536355e34) -- !query schema -struct +struct -- !query output 80.52247093552418 @@ -4710,7 +4891,7 @@ struct -- !query select log(3.4634998359873254962349856073435545) -- !query schema -struct +struct -- !query output 1.2422795911259166 @@ -4718,7 +4899,7 @@ struct -- !query select log(9.999999999999999999) -- !query schema -struct +struct -- !query output 2.302585092994046 @@ -4726,7 +4907,7 @@ struct -- !query select log(10.00000000000000000) -- !query schema -struct +struct -- !query output 2.302585092994046 @@ -4734,7 +4915,7 @@ struct -- !query select log(10.00000000000000001) -- !query schema -struct +struct -- !query output 2.302585092994046 @@ -4742,7 +4923,7 @@ struct -- !query select log(590489.45235237) -- !query schema -struct +struct -- !query output 13.288707052228641 @@ -4750,7 +4931,7 @@ struct -- !query select log(0.99923, 4.58934e34) -- !query schema -struct +struct -- !query output -103611.55579543479 @@ -4758,7 +4939,7 @@ struct -- !query select log(1.000016, 8.452010e18) -- !query schema -struct +struct -- !query output 2723830.287707013 @@ -4766,7 +4947,7 @@ struct -- !query SELECT SUM(decimal(9999)) FROM range(1, 100001) -- !query schema -struct +struct -- !query output 999900000 @@ -4774,7 +4955,7 @@ struct -- !query SELECT SUM(decimal(-9999)) FROM range(1, 100001) -- !query schema -struct +struct -- !query output -999900000 diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/select_having.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/select_having.sql.out index d8d33d92a7cc4..d001e22e9b766 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/select_having.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/select_having.sql.out @@ -143,7 +143,7 @@ SELECT a FROM test_having HAVING min(a) < max(a) struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping expressions sequence is empty, and 'spark_catalog.default.test_having.`a`' is not an aggregate function. Wrap '(min(spark_catalog.default.test_having.`a`) AS `min(a#x)`, max(spark_catalog.default.test_having.`a`) AS `max(a#x)`)' in windowing function(s) or wrap 'spark_catalog.default.test_having.`a`' in first() (or first_value) if you don't care which value you get.; +grouping expressions sequence is empty, and 'spark_catalog.default.test_having.a' is not an aggregate function. Wrap '(min(spark_catalog.default.test_having.a) AS `min(a#x)`, max(spark_catalog.default.test_having.a) AS `max(a#x)`)' in windowing function(s) or wrap 'spark_catalog.default.test_having.a' in first() (or first_value) if you don't care which value you get. -- !query @@ -152,7 +152,7 @@ SELECT 1 AS one FROM test_having HAVING a > 1 struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`a`' given input columns: [one]; line 1 pos 40 +cannot resolve 'a' given input columns: [one]; line 1 pos 40 -- !query @@ -174,9 +174,10 @@ struct -- !query SELECT 1 AS one FROM test_having WHERE 1/a = 1 HAVING 1 < 2 -- !query schema -struct +struct<> -- !query output -1 +java.lang.ArithmeticException +divide by zero -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/select_implicit.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/select_implicit.sql.out index 4ecfabccdf414..4a304aeb606bb 100755 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/select_implicit.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/select_implicit.sql.out @@ -122,7 +122,7 @@ SELECT count(*) FROM test_missing_target GROUP BY a ORDER BY b struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`b`' given input columns: [count(1)]; line 1 pos 61 +cannot resolve 'b' given input columns: [count(1)]; line 1 pos 61 -- !query @@ -239,7 +239,7 @@ struct SELECT a/2, a/2 FROM test_missing_target ORDER BY a/2 -- !query schema -struct<(CAST(a AS DOUBLE) / CAST(2 AS DOUBLE)):double,(CAST(a AS DOUBLE) / CAST(2 AS DOUBLE)):double> +struct<(a / 2):double,(a / 2):double> -- !query output 0.0 0.0 0.5 0.5 @@ -257,7 +257,7 @@ struct<(CAST(a AS DOUBLE) / CAST(2 AS DOUBLE)):double,(CAST(a AS DOUBLE) / CAST( SELECT a/2, a/2 FROM test_missing_target GROUP BY a/2 ORDER BY a/2 -- !query schema -struct<(CAST(a AS DOUBLE) / CAST(2 AS DOUBLE)):double,(CAST(a AS DOUBLE) / CAST(2 AS DOUBLE)):double> +struct<(a / 2):double,(a / 2):double> -- !query output 0.0 0.0 0.5 0.5 @@ -327,7 +327,7 @@ SELECT count(a) FROM test_missing_target GROUP BY a ORDER BY b struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`b`' given input columns: [count(a)]; line 1 pos 61 +cannot resolve 'b' given input columns: [count(a)]; line 1 pos 61 -- !query @@ -398,7 +398,7 @@ SELECT x.b/2, count(x.b) FROM test_missing_target x, test_missing_target y WHERE x.a = y.a GROUP BY x.b/2 ORDER BY x.b/2 -- !query schema -struct<(CAST(b AS DOUBLE) / CAST(2 AS DOUBLE)):double,count(b):bigint> +struct<(b / 2):double,count(b):bigint> -- !query output 0.5 1 1.0 2 diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/strings.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/strings.sql.out index e8a3a9b9731a6..253a5e49b81fa 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/strings.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/strings.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 121 +-- Number of queries: 124 -- !query @@ -27,7 +27,7 @@ first line - next line - third line -- !query SELECT binary('\\xDeAdBeEf') -- !query schema -struct +struct<\xDeAdBeEf:binary> -- !query output \xDeAdBeEf @@ -35,7 +35,7 @@ struct -- !query SELECT binary('\\x De Ad Be Ef ') -- !query schema -struct +struct<\x De Ad Be Ef :binary> -- !query output \x De Ad Be Ef @@ -43,7 +43,7 @@ struct -- !query SELECT binary('\\xDe00BeEf') -- !query schema -struct +struct<\xDe00BeEf:binary> -- !query output \xDe00BeEf @@ -51,7 +51,7 @@ struct -- !query SELECT binary('DeAdBeEf') -- !query schema -struct +struct -- !query output DeAdBeEf @@ -59,7 +59,7 @@ DeAdBeEf -- !query SELECT binary('De\\000dBeEf') -- !query schema -struct +struct -- !query output De\000dBeEf @@ -67,7 +67,7 @@ De\000dBeEf -- !query SELECT binary('De\\123dBeEf') -- !query schema -struct +struct -- !query output De\123dBeEf @@ -446,7 +446,7 @@ SELECT 'maca' LIKE 'm%aca' ESCAPE '%' AS `true` struct<> -- !query output org.apache.spark.sql.AnalysisException -the pattern 'm%aca' is invalid, the escape character is not allowed to precede 'a'; +the pattern 'm%aca' is invalid, the escape character is not allowed to precede 'a' -- !query @@ -455,7 +455,7 @@ SELECT 'maca' NOT LIKE 'm%aca' ESCAPE '%' AS `false` struct<> -- !query output org.apache.spark.sql.AnalysisException -the pattern 'm%aca' is invalid, the escape character is not allowed to precede 'a'; +the pattern 'm%aca' is invalid, the escape character is not allowed to precede 'a' -- !query @@ -464,7 +464,7 @@ SELECT 'ma%a' LIKE 'm%a%%a' ESCAPE '%' AS `true` struct<> -- !query output org.apache.spark.sql.AnalysisException -the pattern 'm%a%%a' is invalid, the escape character is not allowed to precede 'a'; +the pattern 'm%a%%a' is invalid, the escape character is not allowed to precede 'a' -- !query @@ -473,7 +473,7 @@ SELECT 'ma%a' NOT LIKE 'm%a%%a' ESCAPE '%' AS `false` struct<> -- !query output org.apache.spark.sql.AnalysisException -the pattern 'm%a%%a' is invalid, the escape character is not allowed to precede 'a'; +the pattern 'm%a%%a' is invalid, the escape character is not allowed to precede 'a' -- !query @@ -482,7 +482,7 @@ SELECT 'bear' LIKE 'b_ear' ESCAPE '_' AS `true` struct<> -- !query output org.apache.spark.sql.AnalysisException -the pattern 'b_ear' is invalid, the escape character is not allowed to precede 'e'; +the pattern 'b_ear' is invalid, the escape character is not allowed to precede 'e' -- !query @@ -491,7 +491,7 @@ SELECT 'bear' NOT LIKE 'b_ear' ESCAPE '_' AS `false` struct<> -- !query output org.apache.spark.sql.AnalysisException -the pattern 'b_ear' is invalid, the escape character is not allowed to precede 'e'; +the pattern 'b_ear' is invalid, the escape character is not allowed to precede 'e' -- !query @@ -500,7 +500,7 @@ SELECT 'be_r' LIKE 'b_e__r' ESCAPE '_' AS `true` struct<> -- !query output org.apache.spark.sql.AnalysisException -the pattern 'b_e__r' is invalid, the escape character is not allowed to precede 'e'; +the pattern 'b_e__r' is invalid, the escape character is not allowed to precede 'e' -- !query @@ -509,7 +509,7 @@ SELECT 'be_r' NOT LIKE 'b_e__r' ESCAPE '_' AS `false` struct<> -- !query output org.apache.spark.sql.AnalysisException -the pattern 'b_e__r' is invalid, the escape character is not allowed to precede 'e'; +the pattern 'b_e__r' is invalid, the escape character is not allowed to precede 'e' -- !query @@ -945,7 +945,7 @@ struct -- !query SELECT chr(65) -- !query schema -struct +struct -- !query output A @@ -953,7 +953,7 @@ A -- !query SELECT chr(0) -- !query schema -struct +struct -- !query output @@ -977,9 +977,37 @@ struct -- !query SELECT trim(binary('\\000') from binary('\\000Tom\\000')) -- !query schema -struct +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'TRIM(BOTH CAST('\\000' AS BINARY) FROM CAST('\\000Tom\\000' AS BINARY))' due to data type mismatch: argument 1 requires string type, however, 'CAST('\\000Tom\\000' AS BINARY)' is of binary type. argument 2 requires string type, however, 'CAST('\\000' AS BINARY)' is of binary type.; line 1 pos 7 + + +-- !query +SELECT btrim(binary('\\000trim\\000'), binary('\\000')) +-- !query schema +struct<> -- !query output -Tom +org.apache.spark.sql.AnalysisException +cannot resolve 'TRIM(BOTH CAST('\\000' AS BINARY) FROM CAST('\\000trim\\000' AS BINARY))' due to data type mismatch: argument 1 requires string type, however, 'CAST('\\000trim\\000' AS BINARY)' is of binary type. argument 2 requires string type, however, 'CAST('\\000' AS BINARY)' is of binary type.; line 1 pos 7 + + +-- !query +SELECT btrim(binary(''), binary('\\000')) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'TRIM(BOTH CAST('\\000' AS BINARY) FROM CAST('' AS BINARY))' due to data type mismatch: argument 1 requires string type, however, 'CAST('' AS BINARY)' is of binary type. argument 2 requires string type, however, 'CAST('\\000' AS BINARY)' is of binary type.; line 1 pos 7 + + +-- !query +SELECT btrim(binary('\\000trim\\000'), binary('')) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'TRIM(BOTH CAST('' AS BINARY) FROM CAST('\\000trim\\000' AS BINARY))' due to data type mismatch: argument 1 requires string type, however, 'CAST('\\000trim\\000' AS BINARY)' is of binary type. argument 2 requires string type, however, 'CAST('' AS BINARY)' is of binary type.; line 1 pos 7 -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/text.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/text.sql.out index 811e7d6e4ca65..2387dd244181b 100755 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/text.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/text.sql.out @@ -54,9 +54,10 @@ struct -- !query select length(42) -- !query schema -struct +struct<> -- !query output -2 +org.apache.spark.sql.AnalysisException +cannot resolve 'length(42)' due to data type mismatch: argument 1 requires (string or binary) type, however, '42' is of int type.; line 1 pos 7 -- !query @@ -64,8 +65,8 @@ select string('four: ') || 2+2 -- !query schema struct<> -- !query output -java.lang.NumberFormatException -invalid input syntax for type numeric: four: 2 +org.apache.spark.sql.AnalysisException +cannot resolve 'concat(CAST('four: ' AS STRING), 2)' due to data type mismatch: input to function concat should have been string, binary or array, but it's [string, int]; line 1 pos 7 -- !query @@ -73,16 +74,17 @@ select 'four: ' || 2+2 -- !query schema struct<> -- !query output -java.lang.NumberFormatException -invalid input syntax for type numeric: four: 2 +org.apache.spark.sql.AnalysisException +cannot resolve 'concat('four: ', 2)' due to data type mismatch: input to function concat should have been string, binary or array, but it's [string, int]; line 1 pos 7 -- !query select 3 || 4.0 -- !query schema -struct +struct<> -- !query output -34.0 +org.apache.spark.sql.AnalysisException +cannot resolve 'concat(3, 4.0BD)' due to data type mismatch: input to function concat should have been string, binary or array, but it's [int, decimal(2,1)]; line 1 pos 7 -- !query @@ -99,9 +101,10 @@ one -- !query select concat(1,2,3,'hello',true, false, to_date('20100309','yyyyMMdd')) -- !query schema -struct +struct<> -- !query output -123hellotruefalse2010-03-09 +org.apache.spark.sql.AnalysisException +cannot resolve 'concat(1, 2, 3, 'hello', true, false, to_date('20100309', 'yyyyMMdd'))' due to data type mismatch: input to function concat should have been string, binary or array, but it's [int, int, int, string, boolean, boolean, date]; line 1 pos 7 -- !query @@ -115,33 +118,37 @@ one -- !query select concat_ws('#',1,2,3,'hello',true, false, to_date('20100309','yyyyMMdd')) -- !query schema -struct +struct<> -- !query output -1#x#x#hello#true#false#x-03-09 +org.apache.spark.sql.AnalysisException +cannot resolve 'concat_ws('#', 1, 2, 3, 'hello', true, false, to_date('20100309', 'yyyyMMdd'))' due to data type mismatch: argument 2 requires (array or string) type, however, '1' is of int type. argument 3 requires (array or string) type, however, '2' is of int type. argument 4 requires (array or string) type, however, '3' is of int type. argument 6 requires (array or string) type, however, 'true' is of boolean type. argument 7 requires (array or string) type, however, 'false' is of boolean type. argument 8 requires (array or string) type, however, 'to_date('20100309', 'yyyyMMdd')' is of date type.; line 1 pos 7 -- !query select concat_ws(',',10,20,null,30) -- !query schema -struct +struct<> -- !query output -10,20,30 +org.apache.spark.sql.AnalysisException +cannot resolve 'concat_ws(',', 10, 20, NULL, 30)' due to data type mismatch: argument 2 requires (array or string) type, however, '10' is of int type. argument 3 requires (array or string) type, however, '20' is of int type. argument 4 requires (array or string) type, however, 'NULL' is of null type. argument 5 requires (array or string) type, however, '30' is of int type.; line 1 pos 7 -- !query select concat_ws('',10,20,null,30) -- !query schema -struct +struct<> -- !query output -102030 +org.apache.spark.sql.AnalysisException +cannot resolve 'concat_ws('', 10, 20, NULL, 30)' due to data type mismatch: argument 2 requires (array or string) type, however, '10' is of int type. argument 3 requires (array or string) type, however, '20' is of int type. argument 4 requires (array or string) type, however, 'NULL' is of null type. argument 5 requires (array or string) type, however, '30' is of int type.; line 1 pos 7 -- !query select concat_ws(NULL,10,20,null,30) is null -- !query schema -struct<(concat_ws(CAST(NULL AS STRING), CAST(10 AS STRING), CAST(20 AS STRING), NULL, CAST(30 AS STRING)) IS NULL):boolean> +struct<> -- !query output -true +org.apache.spark.sql.AnalysisException +cannot resolve 'concat_ws(CAST(NULL AS STRING), 10, 20, NULL, 30)' due to data type mismatch: argument 2 requires (array or string) type, however, '10' is of int type. argument 3 requires (array or string) type, however, '20' is of int type. argument 4 requires (array or string) type, however, 'NULL' is of null type. argument 5 requires (array or string) type, however, '30' is of int type.; line 1 pos 7 -- !query @@ -155,19 +162,10 @@ edcba -- !query select i, left('ahoj', i), right('ahoj', i) from range(-5, 6) t(i) order by i -- !query schema -struct +struct<> -- !query output --5 --4 --3 --2 --1 -0 -1 a j -2 ah oj -3 aho hoj -4 ahoj ahoj -5 ahoj ahoj +org.apache.spark.sql.AnalysisException +cannot resolve 'substring('ahoj', 1, t.i)' due to data type mismatch: argument 3 requires int type, however, 't.i' is of bigint type.; line 1 pos 10 -- !query @@ -176,7 +174,7 @@ struct */ select format_string(NULL) -- !query schema -struct +struct -- !query output NULL diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/timestamp.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/timestamp.sql.out index 5b0b636ff0c29..68d2b5c9ce1bf 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/timestamp.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/timestamp.sql.out @@ -256,19 +256,16 @@ SELECT '' AS `54`, d1 as `timestamp`, date_part( 'minute', d1) AS `minute`, date_part( 'second', d1) AS `second` FROM TIMESTAMP_TBL WHERE d1 BETWEEN '1902-01-01' AND '2038-01-01' -- !query schema -struct<54:string,timestamp:timestamp,year:int,month:int,day:int,hour:int,minute:int,second:decimal(8,6)> +struct<> -- !query output - 1969-12-31 16:00:00 1969 12 31 16 0 0.000000 - 1997-01-02 00:00:00 1997 1 2 0 0 0.000000 - 1997-01-02 03:04:05 1997 1 2 3 4 5.000000 - 1997-02-10 17:32:01 1997 2 10 17 32 1.000000 - 2001-09-22 18:19:20 2001 9 22 18 19 20.000000 +org.apache.spark.sql.AnalysisException +cannot resolve 'year(spark_catalog.default.timestamp_tbl.d1)' due to data type mismatch: argument 1 requires date type, however, 'spark_catalog.default.timestamp_tbl.d1' is of timestamp type.; line 2 pos 4 -- !query SELECT make_timestamp(2014,12,28,6,30,45.887) -- !query schema -struct +struct -- !query output 2014-12-28 06:30:45.887 diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/union.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/union.sql.out index 2fe53055cf656..5f7a82b5c80ce 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/union.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/union.sql.out @@ -526,7 +526,7 @@ SELECT q1 FROM int8_tbl EXCEPT SELECT q2 FROM int8_tbl ORDER BY q2 LIMIT 1 struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`q2`' given input columns: [int8_tbl.q1]; line 1 pos 64 +cannot resolve 'q2' given input columns: [int8_tbl.q1]; line 1 pos 64 -- !query @@ -682,10 +682,10 @@ struct -- !query SELECT cast('3.4' as decimal(38, 18)) UNION SELECT 'foo' -- !query schema -struct +struct<> -- !query output -3.400000000000000000 -foo +org.apache.spark.SparkException +Failed to merge incompatible data types decimal(38,18) and string -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part1.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part1.sql.out index 2b1de87a6be5e..ba449ccf393e4 100755 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part1.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part1.sql.out @@ -14,7 +14,7 @@ struct<> SELECT four, ten, SUM(SUM(four)) OVER (PARTITION BY four), AVG(ten) FROM tenk1 GROUP BY four, ten ORDER BY four, ten -- !query schema -struct +struct -- !query output 0 0 0 0.0 0 2 0 2.0 @@ -270,7 +270,7 @@ struct +struct -- !query output 0 0 0 0 0 0 @@ -287,7 +287,7 @@ struct +struct -- !query output 0 4 0 1 1 1 @@ -306,7 +306,7 @@ SELECT last(ten) OVER (PARTITION BY four), ten, four FROM (SELECT * FROM tenk1 WHERE unique2 < 10 ORDER BY four, ten)s ORDER BY four, ten -- !query schema -struct +struct -- !query output 4 0 0 4 0 0 @@ -387,7 +387,7 @@ struct -- !query SELECT avg(four) OVER (PARTITION BY four ORDER BY thousand / 100) FROM tenk1 WHERE unique2 < 10 -- !query schema -struct +struct -- !query output 0.0 0.0 @@ -476,7 +476,7 @@ sum(ten) over (partition by four order by ten), last(ten) over (partition by four order by ten) FROM (select distinct ten, four from tenk1) ss -- !query schema -struct +struct -- !query output 0 0 0 0 0 2 2 2 @@ -506,7 +506,7 @@ sum(ten) over (partition by four order by ten range between unbounded preceding last(ten) over (partition by four order by ten range between unbounded preceding and current row) FROM (select distinct ten, four from tenk1) ss -- !query schema -struct +struct -- !query output 0 0 0 0 0 2 2 2 @@ -536,7 +536,7 @@ sum(ten) over (partition by four order by ten range between unbounded preceding last(ten) over (partition by four order by ten range between unbounded preceding and unbounded following) FROM (select distinct ten, four from tenk1) ss -- !query schema -struct +struct -- !query output 0 0 20 8 0 2 20 8 diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part2.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part2.sql.out index f41659a196ae1..3d07d9f155bed 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part2.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part2.sql.out @@ -101,7 +101,7 @@ from window w as (order by ss.id asc nulls first range between 2 preceding and 2 following) -- !query schema -struct +struct -- !query output 1 1 1 3 2 2 1 4 @@ -123,7 +123,7 @@ from window w as (order by ss.id asc nulls last range between 2 preceding and 2 following) -- !query schema -struct +struct -- !query output 1 1 1 3 2 2 1 4 @@ -145,7 +145,7 @@ from window w as (order by ss.id desc nulls first range between 2 preceding and 2 following) -- !query schema -struct +struct -- !query output 1 1 3 1 2 2 4 1 @@ -167,7 +167,7 @@ from window w as (order by ss.id desc nulls last range between 2 preceding and 2 following) -- !query schema -struct +struct -- !query output 1 1 3 1 2 2 4 1 @@ -182,7 +182,7 @@ NULL 43 42 43 select x.id, last(x.id) over (order by x.id range between current row and 2147450884 following) from range(32764, 32767) x -- !query schema -struct +struct -- !query output 32764 32766 32765 32766 @@ -193,7 +193,7 @@ struct +struct -- !query output -32766 -32766 @@ -202,7 +202,7 @@ struct +struct -- !query output 2147483644 2147483646 2147483645 2147483646 @@ -213,7 +213,7 @@ struct +struct -- !query output -2147483646 -2147483646 @@ -272,7 +272,7 @@ from numerics window w as (order by f_float4 range between 1 preceding and 1 following) -- !query schema -struct +struct -- !query output 1 -3.0 1 1 2 -1.0 2 3 @@ -289,7 +289,7 @@ from numerics window w as (order by f_float4 range between 1 preceding and 1.1 following) -- !query schema -struct +struct -- !query output 1 -3.0 1 1 2 -1.0 2 3 @@ -306,7 +306,7 @@ from numerics window w as (order by f_float4 range between 'inf' preceding and 'inf' following) -- !query schema -struct +struct -- !query output 1 -3.0 1 7 2 -1.0 1 7 @@ -323,7 +323,7 @@ from numerics window w as (order by f_float4 range between 1.1 preceding and 'NaN' following) -- !query schema -struct +struct -- !query output 1 -3.0 1 7 2 -1.0 2 7 @@ -340,7 +340,7 @@ from numerics window w as (order by f_float8 range between 1 preceding and 1 following) -- !query schema -struct +struct -- !query output 1 -3.0 1 1 2 -1.0 2 3 @@ -357,7 +357,7 @@ from numerics window w as (order by f_float8 range between 1 preceding and 1.1 following) -- !query schema -struct +struct -- !query output 1 -3.0 1 1 2 -1.0 2 3 @@ -374,7 +374,7 @@ from numerics window w as (order by f_float8 range between 'inf' preceding and 'inf' following) -- !query schema -struct +struct -- !query output 1 -3.0 1 7 2 -1.0 1 7 @@ -391,7 +391,7 @@ from numerics window w as (order by f_float8 range between 1.1 preceding and 'NaN' following) -- !query schema -struct +struct -- !query output 1 -3.0 1 7 2 -1.0 2 7 @@ -408,7 +408,7 @@ from numerics window w as (order by f_numeric range between 1 preceding and 1 following) -- !query schema -struct +struct -- !query output 1 -3 1 1 2 -1 2 3 @@ -425,7 +425,7 @@ from numerics window w as (order by f_numeric range between 1 preceding and 1.1 following) -- !query schema -struct +struct -- !query output 1 -3 1 1 2 -1 2 3 @@ -442,7 +442,7 @@ from numerics window w as (order by f_numeric range between 1 preceding and 1.1 following) -- !query schema -struct +struct -- !query output 1 -3 1 1 2 -1 2 3 diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part3.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part3.sql.out index 08eba6797b01d..14fd1bb281903 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part3.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part3.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 29 +-- Number of queries: 30 -- !query @@ -71,7 +71,8 @@ insert into datetimes values -- !query schema struct<> -- !query output - +org.apache.spark.sql.AnalysisException +failed to evaluate expression CAST('11:00 BST' AS TIMESTAMP): Cannot cast 11:00 BST to TimestampType.; line 1 pos 22 -- !query @@ -112,7 +113,7 @@ SELECT x, (sum(x) over w) FROM cte WINDOW w AS (ORDER BY x range between 1 preceding and 1 following) -- !query schema -struct +struct -- !query output 1 1 11 11 @@ -182,7 +183,7 @@ SELECT x, (sum(x) over w) FROM cte WINDOW w AS (ORDER BY x range between 1 preceding and 1 following) -- !query schema -struct +struct -- !query output 1 3 1 3 @@ -244,7 +245,7 @@ from t1 where f1 = f2 struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(PARTITION BY spark_catalog.default.t1.`f1` RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING)' due to data type mismatch: A range window frame cannot be used in an unordered window specification.; line 1 pos 24 +cannot resolve '(PARTITION BY spark_catalog.default.t1.f1 RANGE BETWEEN 1 PRECEDING AND 1 FOLLOWING)' due to data type mismatch: A range window frame cannot be used in an unordered window specification.; line 1 pos 24 -- !query @@ -294,7 +295,7 @@ SELECT * FROM empsalary WHERE row_number() OVER (ORDER BY salary) < 10 struct<> -- !query output org.apache.spark.sql.AnalysisException -It is not allowed to use window functions inside WHERE clause; +It is not allowed to use window functions inside WHERE clause -- !query @@ -306,7 +307,7 @@ org.apache.spark.sql.AnalysisException The query operator `Join` contains one or more unsupported expression types Aggregate, Window or Generate. -Invalid expressions: [row_number() OVER (ORDER BY spark_catalog.default.empsalary.`salary` ASC NULLS FIRST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)]; +Invalid expressions: [row_number() OVER (ORDER BY spark_catalog.default.empsalary.salary ASC NULLS FIRST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)] -- !query @@ -318,7 +319,7 @@ org.apache.spark.sql.AnalysisException The query operator `Aggregate` contains one or more unsupported expression types Aggregate, Window or Generate. -Invalid expressions: [RANK() OVER (ORDER BY 1 ASC NULLS FIRST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)]; +Invalid expressions: [RANK() OVER (ORDER BY 1 ASC NULLS FIRST ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)] -- !query @@ -341,7 +342,7 @@ SELECT * FROM empsalary WHERE (rank() OVER (ORDER BY random())) > 10 struct<> -- !query output org.apache.spark.sql.AnalysisException -It is not allowed to use window functions inside WHERE clause; +It is not allowed to use window functions inside WHERE clause -- !query @@ -350,7 +351,7 @@ SELECT * FROM empsalary WHERE rank() OVER (ORDER BY random()) struct<> -- !query output org.apache.spark.sql.AnalysisException -It is not allowed to use window functions inside WHERE clause; +It is not allowed to use window functions inside WHERE clause -- !query @@ -385,6 +386,15 @@ org.apache.spark.sql.AnalysisException cannot resolve 'ntile(0)' due to data type mismatch: Buckets expression must be positive, but got: 0; line 1 pos 7 +-- !query +SELECT nth_value(four, 0) OVER (ORDER BY ten), ten, four FROM tenk1 +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'nth_value(spark_catalog.default.tenk1.four, 0)' due to data type mismatch: The 'offset' argument of nth_value must be greater than zero but it is 0.; line 1 pos 7 + + -- !query DROP TABLE empsalary -- !query schema diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part4.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part4.sql.out index 4dd4712345a89..738a1381f99cc 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part4.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/window_part4.sql.out @@ -137,7 +137,7 @@ struct +struct -- !query output 0.0 11266.666666666666 @@ -150,7 +150,7 @@ struct +struct -- !query output 0.0 11266.666666666666 @@ -163,7 +163,7 @@ struct +struct -- !query output 0.0 11266.666666666666 @@ -176,7 +176,7 @@ struct +struct -- !query output 0.0 11266.666666666666 @@ -189,111 +189,111 @@ struct +struct -- !query output 16900.0 18491.666666666668 27129.999999999996 8450.0 -NaN +NULL -- !query SELECT VAR_SAMP(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n) -- !query schema -struct +struct -- !query output 16900.0 18491.666666666668 27129.999999999996 8450.0 -NaN +NULL -- !query SELECT VAR_SAMP(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n) -- !query schema -struct +struct -- !query output 16900.0 18491.666666666668 27129.999999999996 8450.0 -NaN +NULL -- !query SELECT VAR_SAMP(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n) -- !query schema -struct +struct -- !query output 16900.0 18491.666666666668 27129.999999999996 8450.0 -NaN +NULL -- !query SELECT VARIANCE(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n) -- !query schema -struct +struct -- !query output 16900.0 18491.666666666668 27129.999999999996 8450.0 -NaN +NULL -- !query SELECT VARIANCE(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n) -- !query schema -struct +struct -- !query output 16900.0 18491.666666666668 27129.999999999996 8450.0 -NaN +NULL -- !query SELECT VARIANCE(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n) -- !query schema -struct +struct -- !query output 16900.0 18491.666666666668 27129.999999999996 8450.0 -NaN +NULL -- !query SELECT VARIANCE(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n) -- !query schema -struct +struct -- !query output 16900.0 18491.666666666668 27129.999999999996 8450.0 -NaN +NULL -- !query SELECT STDDEV_POP(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n) -- !query schema -struct +struct -- !query output 0.0 106.14455552060438 @@ -307,7 +307,7 @@ struct +struct -- !query output 0.0 106.14455552060438 @@ -321,7 +321,7 @@ struct +struct -- !query output 0.0 106.14455552060438 @@ -335,7 +335,7 @@ struct +struct -- !query output 0.0 106.14455552060438 @@ -349,112 +349,112 @@ struct +struct -- !query output 130.0 135.9840676942217 164.7118696390761 164.7118696390761 91.92388155425118 -NaN +NULL -- !query SELECT STDDEV_SAMP(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n) -- !query schema -struct +struct -- !query output 130.0 135.9840676942217 164.7118696390761 164.7118696390761 91.92388155425118 -NaN +NULL -- !query SELECT STDDEV_SAMP(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n) -- !query schema -struct +struct -- !query output 130.0 135.9840676942217 164.7118696390761 164.7118696390761 91.92388155425118 -NaN +NULL -- !query SELECT STDDEV_SAMP(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,NULL),(2,600),(3,470),(4,170),(5,430),(6,300)) r(i,n) -- !query schema -struct +struct -- !query output 130.0 135.9840676942217 164.7118696390761 164.7118696390761 91.92388155425118 -NaN +NULL -- !query SELECT STDDEV(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n) -- !query schema -struct +struct -- !query output 130.0 135.9840676942217 164.7118696390761 164.7118696390761 91.92388155425118 -NaN +NULL -- !query SELECT STDDEV(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n) -- !query schema -struct +struct -- !query output 130.0 135.9840676942217 164.7118696390761 164.7118696390761 91.92388155425118 -NaN +NULL -- !query SELECT STDDEV(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n) -- !query schema -struct +struct -- !query output 130.0 135.9840676942217 164.7118696390761 164.7118696390761 91.92388155425118 -NaN +NULL -- !query SELECT STDDEV(n) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(0,NULL),(1,600),(2,470),(3,170),(4,430),(5,300)) r(i,n) -- !query schema -struct +struct -- !query output 130.0 135.9840676942217 164.7118696390761 164.7118696390761 91.92388155425118 -NaN +NULL -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/postgreSQL/with.sql.out b/sql/core/src/test/resources/sql-tests/results/postgreSQL/with.sql.out index badafc9e659e2..21bad134706bb 100644 --- a/sql/core/src/test/resources/sql-tests/results/postgreSQL/with.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/postgreSQL/with.sql.out @@ -223,7 +223,7 @@ Table or view not found: outermost; line 4 pos 23 -- !query -CREATE TABLE withz USING parquet AS SELECT i AS k, CAST(i || ' v' AS string) v FROM (SELECT EXPLODE(SEQUENCE(1, 16, 3)) i) +CREATE TABLE withz USING parquet AS SELECT i AS k, CAST(i AS string) || ' v' AS v FROM (SELECT EXPLODE(SEQUENCE(1, 16, 3)) i) -- !query schema struct<> -- !query output @@ -385,7 +385,7 @@ WITH test AS (SELECT 42) INSERT INTO test VALUES (1) struct<> -- !query output org.apache.spark.sql.AnalysisException -Table not found: test; +Table not found: test; line 1 pos 37 -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/predicate-functions.sql.out b/sql/core/src/test/resources/sql-tests/results/predicate-functions.sql.out index 819be95603b0c..32f9efde688e0 100644 --- a/sql/core/src/test/resources/sql-tests/results/predicate-functions.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/predicate-functions.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 37 +-- Number of queries: 53 -- !query @@ -13,7 +13,7 @@ true -- !query select 1 = '1' -- !query schema -struct<(1 = CAST(1 AS INT)):boolean> +struct<(1 = 1):boolean> -- !query output true @@ -21,7 +21,7 @@ true -- !query select 1.0 = '1' -- !query schema -struct<(CAST(1.0 AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(1.0 = 1):boolean> -- !query output true @@ -29,7 +29,7 @@ true -- !query select 1.5 = '1.51' -- !query schema -struct<(CAST(1.5 AS DOUBLE) = CAST(1.51 AS DOUBLE)):boolean> +struct<(1.5 = 1.51):boolean> -- !query output false @@ -37,7 +37,7 @@ false -- !query select 1 > '1' -- !query schema -struct<(1 > CAST(1 AS INT)):boolean> +struct<(1 > 1):boolean> -- !query output false @@ -45,7 +45,7 @@ false -- !query select 2 > '1.0' -- !query schema -struct<(2 > CAST(1.0 AS INT)):boolean> +struct<(2 > 1.0):boolean> -- !query output true @@ -53,7 +53,7 @@ true -- !query select 2 > '2.0' -- !query schema -struct<(2 > CAST(2.0 AS INT)):boolean> +struct<(2 > 2.0):boolean> -- !query output false @@ -61,7 +61,7 @@ false -- !query select 2 > '2.2' -- !query schema -struct<(2 > CAST(2.2 AS INT)):boolean> +struct<(2 > 2.2):boolean> -- !query output false @@ -69,7 +69,7 @@ false -- !query select '1.5' > 0.5 -- !query schema -struct<(CAST(1.5 AS DOUBLE) > CAST(0.5 AS DOUBLE)):boolean> +struct<(1.5 > 0.5):boolean> -- !query output true @@ -85,7 +85,7 @@ false -- !query select to_date('2009-07-30 04:17:52') > '2009-07-30 04:17:52' -- !query schema -struct<(to_date(2009-07-30 04:17:52) > CAST(2009-07-30 04:17:52 AS DATE)):boolean> +struct<(to_date(2009-07-30 04:17:52) > 2009-07-30 04:17:52):boolean> -- !query output false @@ -93,7 +93,7 @@ false -- !query select 1 >= '1' -- !query schema -struct<(1 >= CAST(1 AS INT)):boolean> +struct<(1 >= 1):boolean> -- !query output true @@ -101,7 +101,7 @@ true -- !query select 2 >= '1.0' -- !query schema -struct<(2 >= CAST(1.0 AS INT)):boolean> +struct<(2 >= 1.0):boolean> -- !query output true @@ -109,7 +109,7 @@ true -- !query select 2 >= '2.0' -- !query schema -struct<(2 >= CAST(2.0 AS INT)):boolean> +struct<(2 >= 2.0):boolean> -- !query output true @@ -117,7 +117,7 @@ true -- !query select 2.0 >= '2.2' -- !query schema -struct<(CAST(2.0 AS DOUBLE) >= CAST(2.2 AS DOUBLE)):boolean> +struct<(2.0 >= 2.2):boolean> -- !query output false @@ -125,7 +125,7 @@ false -- !query select '1.5' >= 0.5 -- !query schema -struct<(CAST(1.5 AS DOUBLE) >= CAST(0.5 AS DOUBLE)):boolean> +struct<(1.5 >= 0.5):boolean> -- !query output true @@ -141,7 +141,7 @@ true -- !query select to_date('2009-07-30 04:17:52') >= '2009-07-30 04:17:52' -- !query schema -struct<(to_date(2009-07-30 04:17:52) >= CAST(2009-07-30 04:17:52 AS DATE)):boolean> +struct<(to_date(2009-07-30 04:17:52) >= 2009-07-30 04:17:52):boolean> -- !query output true @@ -149,7 +149,7 @@ true -- !query select 1 < '1' -- !query schema -struct<(1 < CAST(1 AS INT)):boolean> +struct<(1 < 1):boolean> -- !query output false @@ -157,7 +157,7 @@ false -- !query select 2 < '1.0' -- !query schema -struct<(2 < CAST(1.0 AS INT)):boolean> +struct<(2 < 1.0):boolean> -- !query output false @@ -165,7 +165,7 @@ false -- !query select 2 < '2.0' -- !query schema -struct<(2 < CAST(2.0 AS INT)):boolean> +struct<(2 < 2.0):boolean> -- !query output false @@ -173,7 +173,7 @@ false -- !query select 2.0 < '2.2' -- !query schema -struct<(CAST(2.0 AS DOUBLE) < CAST(2.2 AS DOUBLE)):boolean> +struct<(2.0 < 2.2):boolean> -- !query output true @@ -181,7 +181,7 @@ true -- !query select 0.5 < '1.5' -- !query schema -struct<(CAST(0.5 AS DOUBLE) < CAST(1.5 AS DOUBLE)):boolean> +struct<(0.5 < 1.5):boolean> -- !query output true @@ -197,7 +197,7 @@ false -- !query select to_date('2009-07-30 04:17:52') < '2009-07-30 04:17:52' -- !query schema -struct<(to_date(2009-07-30 04:17:52) < CAST(2009-07-30 04:17:52 AS DATE)):boolean> +struct<(to_date(2009-07-30 04:17:52) < 2009-07-30 04:17:52):boolean> -- !query output false @@ -205,7 +205,7 @@ false -- !query select 1 <= '1' -- !query schema -struct<(1 <= CAST(1 AS INT)):boolean> +struct<(1 <= 1):boolean> -- !query output true @@ -213,7 +213,7 @@ true -- !query select 2 <= '1.0' -- !query schema -struct<(2 <= CAST(1.0 AS INT)):boolean> +struct<(2 <= 1.0):boolean> -- !query output false @@ -221,7 +221,7 @@ false -- !query select 2 <= '2.0' -- !query schema -struct<(2 <= CAST(2.0 AS INT)):boolean> +struct<(2 <= 2.0):boolean> -- !query output true @@ -229,7 +229,7 @@ true -- !query select 2.0 <= '2.2' -- !query schema -struct<(CAST(2.0 AS DOUBLE) <= CAST(2.2 AS DOUBLE)):boolean> +struct<(2.0 <= 2.2):boolean> -- !query output true @@ -237,7 +237,7 @@ true -- !query select 0.5 <= '1.5' -- !query schema -struct<(CAST(0.5 AS DOUBLE) <= CAST(1.5 AS DOUBLE)):boolean> +struct<(0.5 <= 1.5):boolean> -- !query output true @@ -253,7 +253,7 @@ true -- !query select to_date('2009-07-30 04:17:52') <= '2009-07-30 04:17:52' -- !query schema -struct<(to_date(2009-07-30 04:17:52) <= CAST(2009-07-30 04:17:52 AS DATE)):boolean> +struct<(to_date(2009-07-30 04:17:52) <= 2009-07-30 04:17:52):boolean> -- !query output true @@ -261,7 +261,7 @@ true -- !query select to_date('2017-03-01') = to_timestamp('2017-03-01 00:00:00') -- !query schema -struct<(CAST(to_date(2017-03-01) AS TIMESTAMP) = to_timestamp(2017-03-01 00:00:00)):boolean> +struct<(to_date(2017-03-01) = to_timestamp(2017-03-01 00:00:00)):boolean> -- !query output true @@ -269,7 +269,7 @@ true -- !query select to_timestamp('2017-03-01 00:00:01') > to_date('2017-03-01') -- !query schema -struct<(to_timestamp(2017-03-01 00:00:01) > CAST(to_date(2017-03-01) AS TIMESTAMP)):boolean> +struct<(to_timestamp(2017-03-01 00:00:01) > to_date(2017-03-01)):boolean> -- !query output true @@ -277,7 +277,7 @@ true -- !query select to_timestamp('2017-03-01 00:00:01') >= to_date('2017-03-01') -- !query schema -struct<(to_timestamp(2017-03-01 00:00:01) >= CAST(to_date(2017-03-01) AS TIMESTAMP)):boolean> +struct<(to_timestamp(2017-03-01 00:00:01) >= to_date(2017-03-01)):boolean> -- !query output true @@ -285,7 +285,7 @@ true -- !query select to_date('2017-03-01') < to_timestamp('2017-03-01 00:00:01') -- !query schema -struct<(CAST(to_date(2017-03-01) AS TIMESTAMP) < to_timestamp(2017-03-01 00:00:01)):boolean> +struct<(to_date(2017-03-01) < to_timestamp(2017-03-01 00:00:01)):boolean> -- !query output true @@ -293,6 +293,134 @@ true -- !query select to_date('2017-03-01') <= to_timestamp('2017-03-01 00:00:01') -- !query schema -struct<(CAST(to_date(2017-03-01) AS TIMESTAMP) <= to_timestamp(2017-03-01 00:00:01)):boolean> +struct<(to_date(2017-03-01) <= to_timestamp(2017-03-01 00:00:01)):boolean> +-- !query output +true + + +-- !query +select 1 in (1, 2, 3) +-- !query schema +struct<(1 IN (1, 2, 3)):boolean> +-- !query output +true + + +-- !query +select 1 in (1, 2, 3, null) +-- !query schema +struct<(1 IN (1, 2, 3, NULL)):boolean> +-- !query output +true + + +-- !query +select 1 in (1.0, 2.0, 3.0) +-- !query schema +struct<(1 IN (1.0, 2.0, 3.0)):boolean> +-- !query output +true + + +-- !query +select 1 in (1.0, 2.0, 3.0, null) +-- !query schema +struct<(1 IN (1.0, 2.0, 3.0, NULL)):boolean> -- !query output true + + +-- !query +select 1 in ('2', '3', '4') +-- !query schema +struct<(1 IN (2, 3, 4)):boolean> +-- !query output +false + + +-- !query +select 1 in ('2', '3', '4', null) +-- !query schema +struct<(1 IN (2, 3, 4, NULL)):boolean> +-- !query output +NULL + + +-- !query +select null in (1, 2, 3) +-- !query schema +struct<(NULL IN (1, 2, 3)):boolean> +-- !query output +NULL + + +-- !query +select null in (1, 2, null) +-- !query schema +struct<(NULL IN (1, 2, NULL)):boolean> +-- !query output +NULL + + +-- !query +select 1 not in (1, 2, 3) +-- !query schema +struct<(NOT (1 IN (1, 2, 3))):boolean> +-- !query output +false + + +-- !query +select 1 not in (1, 2, 3, null) +-- !query schema +struct<(NOT (1 IN (1, 2, 3, NULL))):boolean> +-- !query output +false + + +-- !query +select 1 not in (1.0, 2.0, 3.0) +-- !query schema +struct<(NOT (1 IN (1.0, 2.0, 3.0))):boolean> +-- !query output +false + + +-- !query +select 1 not in (1.0, 2.0, 3.0, null) +-- !query schema +struct<(NOT (1 IN (1.0, 2.0, 3.0, NULL))):boolean> +-- !query output +false + + +-- !query +select 1 not in ('2', '3', '4') +-- !query schema +struct<(NOT (1 IN (2, 3, 4))):boolean> +-- !query output +true + + +-- !query +select 1 not in ('2', '3', '4', null) +-- !query schema +struct<(NOT (1 IN (2, 3, 4, NULL))):boolean> +-- !query output +NULL + + +-- !query +select null not in (1, 2, 3) +-- !query schema +struct<(NOT (NULL IN (1, 2, 3))):boolean> +-- !query output +NULL + + +-- !query +select null not in (1, 2, null) +-- !query schema +struct<(NOT (NULL IN (1, 2, NULL))):boolean> +-- !query output +NULL diff --git a/sql/core/src/test/resources/sql-tests/results/random.sql.out b/sql/core/src/test/resources/sql-tests/results/random.sql.out index 9d00a82b76780..b269d40c3566c 100644 --- a/sql/core/src/test/resources/sql-tests/results/random.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/random.sql.out @@ -13,7 +13,7 @@ struct -- !query SELECT rand(cast(3 / 7 AS int)) -- !query schema -struct +struct -- !query output 0.7604953758285915 @@ -21,7 +21,7 @@ struct -- !query SELECT rand(NULL) -- !query schema -struct +struct -- !query output 0.7604953758285915 @@ -54,7 +54,7 @@ struct -- !query SELECT randn(cast(3 / 7 AS long)) -- !query schema -struct +struct -- !query output 1.6034991609278433 @@ -62,7 +62,7 @@ struct -- !query SELECT randn(NULL) -- !query schema -struct +struct -- !query output 1.6034991609278433 diff --git a/sql/core/src/test/resources/sql-tests/results/regexp-functions.sql.out b/sql/core/src/test/resources/sql-tests/results/regexp-functions.sql.out index c92c1ddca774f..f0a6fa064d05b 100644 --- a/sql/core/src/test/resources/sql-tests/results/regexp-functions.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/regexp-functions.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 8 +-- Number of queries: 46 -- !query @@ -37,6 +37,31 @@ java.lang.IllegalArgumentException Regex group count is 0, but the specified group index is 2 +-- !query +SELECT regexp_extract('1a 2b 14m', '\\d+', -1) +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +The specified group index cannot be less than zero + + +-- !query +SELECT regexp_extract('1a 2b 14m', '(\\d+)?', 1) +-- !query schema +struct +-- !query output +1 + + +-- !query +SELECT regexp_extract('a b m', '(\\d+)?', 1) +-- !query schema +struct +-- !query output + + + -- !query SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)') -- !query schema @@ -67,3 +92,293 @@ SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)', 2) struct -- !query output a + + +-- !query +SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)', 3) +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Regex group count is 2, but the specified group index is 3 + + +-- !query +SELECT regexp_extract('1a 2b 14m', '(\\d+)([a-z]+)', -1) +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +The specified group index cannot be less than zero + + +-- !query +SELECT regexp_extract('1a 2b 14m', '(\\d+)?([a-z]+)', 1) +-- !query schema +struct +-- !query output +1 + + +-- !query +SELECT regexp_extract('a b m', '(\\d+)?([a-z]+)', 1) +-- !query schema +struct +-- !query output + + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '\\d+') +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Regex group count is 0, but the specified group index is 1 + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '\\d+', 0) +-- !query schema +struct> +-- !query output +["1","2","14"] + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '\\d+', 1) +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Regex group count is 0, but the specified group index is 1 + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '\\d+', 2) +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Regex group count is 0, but the specified group index is 2 + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '\\d+', -1) +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +The specified group index cannot be less than zero + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)?', 1) +-- !query schema +struct> +-- !query output +["1","","","2","","","14","",""] + + +-- !query +SELECT regexp_extract_all('a 2b 14m', '(\\d+)?', 1) +-- !query schema +struct> +-- !query output +["","","2","","","14","",""] + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)([a-z]+)') +-- !query schema +struct> +-- !query output +["1","2","14"] + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)([a-z]+)', 0) +-- !query schema +struct> +-- !query output +["1a","2b","14m"] + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)([a-z]+)', 1) +-- !query schema +struct> +-- !query output +["1","2","14"] + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)([a-z]+)', 2) +-- !query schema +struct> +-- !query output +["a","b","m"] + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)([a-z]+)', 3) +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Regex group count is 2, but the specified group index is 3 + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)([a-z]+)', -1) +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +The specified group index cannot be less than zero + + +-- !query +SELECT regexp_extract_all('1a 2b 14m', '(\\d+)?([a-z]+)', 1) +-- !query schema +struct> +-- !query output +["1","2","14"] + + +-- !query +SELECT regexp_extract_all('a 2b 14m', '(\\d+)?([a-z]+)', 1) +-- !query schema +struct> +-- !query output +["","2","14"] + + +-- !query +SELECT regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something') +-- !query schema +struct +-- !query output +something, something, and wise + + +-- !query +SELECT regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something', -2) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something', -2)' due to data type mismatch: Position expression must be positive, but got: -2; line 1 pos 7 + + +-- !query +SELECT regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something', 0) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve 'regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something', 0)' due to data type mismatch: Position expression must be positive, but got: 0; line 1 pos 7 + + +-- !query +SELECT regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something', 1) +-- !query schema +struct +-- !query output +something, something, and wise + + +-- !query +SELECT regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something', 2) +-- !query schema +struct +-- !query output +hsomething, something, and wise + + +-- !query +SELECT regexp_replace('healthy, wealthy, and wise', '\\w+thy', 'something', 8) +-- !query schema +struct +-- !query output +healthy, something, and wise + + +-- !query +SELECT regexp_replace('healthy, wealthy, and wise', '\\w', 'something', 26) +-- !query schema +struct +-- !query output +healthy, wealthy, and wissomething + + +-- !query +SELECT regexp_replace('healthy, wealthy, and wise', '\\w', 'something', 27) +-- !query schema +struct +-- !query output +healthy, wealthy, and wise + + +-- !query +SELECT regexp_replace('healthy, wealthy, and wise', '\\w', 'something', 30) +-- !query schema +struct +-- !query output +healthy, wealthy, and wise + + +-- !query +SELECT regexp_replace('healthy, wealthy, and wise', '\\w', 'something', null) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT regexp_like('1a 2b 14m', '\\d+b') +-- !query schema +struct +-- !query output +true + + +-- !query +SELECT regexp_like('1a 2b 14m', '[a-z]+b') +-- !query schema +struct +-- !query output +false + + +-- !query +SELECT regexp('1a 2b 14m', '\\d+b') +-- !query schema +struct +-- !query output +true + + +-- !query +SELECT regexp('1a 2b 14m', '[a-z]+b') +-- !query schema +struct +-- !query output +false + + +-- !query +SELECT rlike('1a 2b 14m', '\\d+b') +-- !query schema +struct +-- !query output +true + + +-- !query +SELECT rlike('1a 2b 14m', '[a-z]+b') +-- !query schema +struct +-- !query output +false diff --git a/sql/core/src/test/resources/sql-tests/results/show-tables.sql.out b/sql/core/src/test/resources/sql-tests/results/show-tables.sql.out index a95b02c7f7743..276989db73e9b 100644 --- a/sql/core/src/test/resources/sql-tests/results/show-tables.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/show-tables.sql.out @@ -61,7 +61,7 @@ struct<> -- !query SHOW TABLES -- !query schema -struct +struct -- !query output show_t1 show_t2 @@ -71,7 +71,7 @@ show_t3 -- !query SHOW TABLES IN showdb -- !query schema -struct +struct -- !query output show_t1 show_t2 @@ -81,7 +81,7 @@ show_t3 -- !query SHOW TABLES 'show_t*' -- !query schema -struct +struct -- !query output show_t1 show_t2 @@ -91,7 +91,7 @@ show_t3 -- !query SHOW TABLES LIKE 'show_t1*|show_t2*' -- !query schema -struct +struct -- !query output show_t1 show_t2 @@ -100,7 +100,7 @@ show_t2 -- !query SHOW TABLES IN showdb 'show_t*' -- !query schema -struct +struct -- !query output show_t1 show_t2 @@ -110,7 +110,7 @@ show_t3 -- !query SHOW TABLES IN showdb LIKE 'show_t*' -- !query schema -struct +struct -- !query output show_t1 show_t2 @@ -120,13 +120,14 @@ show_t3 -- !query SHOW TABLE EXTENDED LIKE 'show_t*' -- !query schema -struct +struct -- !query output show_t3 true Table: show_t3 Created Time [not included in comparison] Last Access [not included in comparison] Created By [not included in comparison] Type: VIEW +Table Properties: [] Schema: root |-- e: integer (nullable = true) @@ -178,7 +179,7 @@ SHOW TABLE EXTENDED -- !query SHOW TABLE EXTENDED LIKE 'show_t1' PARTITION(c='Us', d=1) -- !query schema -struct +struct -- !query output showdb show_t1 false Partition Values: [c=Us, d=1] Location [not included in comparison]/{warehouse_dir}/showdb.db/show_t1/c=Us/d=1 @@ -206,7 +207,7 @@ SHOW TABLE EXTENDED LIKE 'show_t*' PARTITION(c='Us', d=1) struct<> -- !query output org.apache.spark.sql.catalyst.analysis.NoSuchTableException -Table or view 'show_t*' not found in database 'showdb'; +Table or view 'show_t*' not found in database 'showdb' -- !query @@ -215,7 +216,7 @@ SHOW TABLE EXTENDED LIKE 'show_t1' PARTITION(c='Us') struct<> -- !query output org.apache.spark.sql.AnalysisException -Partition spec is invalid. The spec (c) must match the partition spec (c, d) defined in table '`showdb`.`show_t1`'; +Partition spec is invalid. The spec (c) must match the partition spec (c, d) defined in table '`showdb`.`show_t1`' -- !query @@ -224,7 +225,7 @@ SHOW TABLE EXTENDED LIKE 'show_t1' PARTITION(a='Us', d=1) struct<> -- !query output org.apache.spark.sql.AnalysisException -Partition spec is invalid. The spec (a, d) must match the partition spec (c, d) defined in table '`showdb`.`show_t1`'; +a is not a valid partition column in table `showdb`.`show_t1`. -- !query @@ -235,7 +236,7 @@ struct<> org.apache.spark.sql.catalyst.analysis.NoSuchPartitionException Partition not found in table 'show_t1' database 'showdb': c -> Ch -d -> 1; +d -> 1 -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/show-tblproperties.sql.out b/sql/core/src/test/resources/sql-tests/results/show-tblproperties.sql.out index 6984b34c365ec..1008f9af0deb6 100644 --- a/sql/core/src/test/resources/sql-tests/results/show-tblproperties.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/show-tblproperties.sql.out @@ -23,17 +23,17 @@ p2 v2 -- !query SHOW TBLPROPERTIES tbl("p1") -- !query schema -struct +struct -- !query output -v1 +p1 v1 -- !query SHOW TBLPROPERTIES tbl("p3") -- !query schema -struct +struct -- !query output -Table default.tbl does not have property: p3 +p3 Table default.tbl does not have property: p3 -- !query @@ -64,22 +64,24 @@ view.catalogAndNamespace.part.0 spark_catalog view.catalogAndNamespace.part.1 default view.query.out.col.0 c1 view.query.out.numCols 1 +view.referredTempFunctionsNames [] +view.referredTempViewNames [] -- !query SHOW TBLPROPERTIES view("p1") -- !query schema -struct +struct -- !query output -v1 +p1 v1 -- !query SHOW TBLPROPERTIES view("p3") -- !query schema -struct +struct -- !query output -Table default.view does not have property: p3 +p3 Table default.view does not have property: p3 -- !query @@ -91,7 +93,7 @@ struct<> -- !query -CREATE TEMPORARY VIEW tv TBLPROPERTIES('p1'='v1') AS SELECT 1 AS c1 +CREATE TEMPORARY VIEW tv AS SELECT 1 AS c1 -- !query schema struct<> -- !query output diff --git a/sql/core/src/test/resources/sql-tests/results/show-views.sql.out b/sql/core/src/test/resources/sql-tests/results/show-views.sql.out index d88790d8b5ec8..c80f8fab433fb 100644 --- a/sql/core/src/test/resources/sql-tests/results/show-views.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/show-views.sql.out @@ -142,7 +142,7 @@ SHOW VIEWS IN wrongdb LIKE 'view_*' struct<> -- !query output org.apache.spark.sql.catalyst.analysis.NoSuchDatabaseException -Database 'wrongdb' not found; +Database 'wrongdb' not found -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/show_columns.sql.out b/sql/core/src/test/resources/sql-tests/results/show_columns.sql.out index 4f5db7f6c6b2f..d8d0926d242cf 100644 --- a/sql/core/src/test/resources/sql-tests/results/show_columns.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/show_columns.sql.out @@ -93,8 +93,8 @@ SHOW COLUMNS IN badtable FROM showdb -- !query schema struct<> -- !query output -org.apache.spark.sql.catalyst.analysis.NoSuchTableException -Table or view 'badtable' not found in database 'showdb'; +org.apache.spark.sql.AnalysisException +Table or view not found: showdb.badtable; line 1 pos 16 -- !query @@ -112,7 +112,7 @@ SHOW COLUMNS IN showdb.showcolumn1 FROM baddb struct<> -- !query output org.apache.spark.sql.AnalysisException -SHOW COLUMNS with conflicting databases: 'baddb' != 'showdb'; +SHOW COLUMNS with conflicting databases: 'baddb' != 'showdb' -- !query @@ -129,8 +129,8 @@ SHOW COLUMNS IN showdb.showcolumn3 -- !query schema struct<> -- !query output -org.apache.spark.sql.catalyst.analysis.NoSuchTableException -Table or view 'showcolumn3' not found in database 'showdb'; +org.apache.spark.sql.AnalysisException +Table or view not found: showdb.showcolumn3; line 1 pos 16 -- !query @@ -138,8 +138,8 @@ SHOW COLUMNS IN showcolumn3 FROM showdb -- !query schema struct<> -- !query output -org.apache.spark.sql.catalyst.analysis.NoSuchTableException -Table or view 'showcolumn3' not found in database 'showdb'; +org.apache.spark.sql.AnalysisException +Table or view not found: showdb.showcolumn3; line 1 pos 16 -- !query @@ -147,8 +147,8 @@ SHOW COLUMNS IN showcolumn4 -- !query schema struct<> -- !query output -org.apache.spark.sql.catalyst.analysis.NoSuchTableException -Table or view 'showcolumn4' not found in database 'showdb'; +org.apache.spark.sql.AnalysisException +Table or view not found: showcolumn4; line 1 pos 16 -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/sql-compatibility-functions.sql.out b/sql/core/src/test/resources/sql-tests/results/sql-compatibility-functions.sql.out index 26a44a85841e0..3549f2ccf9ae1 100644 --- a/sql/core/src/test/resources/sql-tests/results/sql-compatibility-functions.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/sql-compatibility-functions.sql.out @@ -69,7 +69,7 @@ struct -- !query SELECT boolean(1), tinyint(1), smallint(1), int(1), bigint(1) -- !query schema -struct +struct<1:boolean,1:tinyint,1:smallint,1:int,1:bigint> -- !query output true 1 1 1 1 @@ -77,7 +77,7 @@ true 1 1 1 1 -- !query SELECT float(1), double(1), decimal(1) -- !query schema -struct +struct<1:float,1:double,1:decimal(10,0)> -- !query output 1.0 1.0 1 @@ -85,7 +85,7 @@ struct +struct<2014-04-04:date,2014-04-04:timestamp> -- !query output 2014-04-04 2014-04-04 00:00:00 @@ -110,6 +110,6 @@ struct<> -- !query SELECT nvl(st.col1, "value"), count(*) FROM from tempView1 GROUP BY nvl(st.col1, "value") -- !query schema -struct +struct -- !query output gamma 1 diff --git a/sql/core/src/test/resources/sql-tests/results/string-functions.sql.out b/sql/core/src/test/resources/sql-tests/results/string-functions.sql.out index 068b8bc35c265..80e88d0566411 100644 --- a/sql/core/src/test/resources/sql-tests/results/string-functions.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/string-functions.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 34 +-- Number of queries: 50 -- !query @@ -55,7 +55,7 @@ struct -- !query select position('bar' in 'foobarbar'), position(null, 'foobarbar'), position('aaads', null) -- !query schema -struct +struct -- !query output 4 NULL NULL @@ -69,11 +69,19 @@ ab abcd ab NULL -- !query -select left(null, -2), left("abcd", -2), left("abcd", 0), left("abcd", 'a') +select left(null, -2) -- !query schema -struct +struct -- !query output -NULL NULL +NULL + + +-- !query +select left("abcd", -2), left("abcd", 0), left("abcd", 'a') +-- !query schema +struct +-- !query output + NULL -- !query @@ -85,11 +93,19 @@ cd abcd cd NULL -- !query -select right(null, -2), right("abcd", -2), right("abcd", 0), right("abcd", 'a') +select right(null, -2) -- !query schema -struct +struct -- !query output -NULL NULL +NULL + + +-- !query +select right("abcd", -2), right("abcd", 0), right("abcd", 'a') +-- !query schema +struct +-- !query output + NULL -- !query @@ -274,3 +290,117 @@ SELECT trim(TRAILING 'xy' FROM 'TURNERyxXxy') struct -- !query output TURNERyxX + + +-- !query +SELECT btrim('xyxtrimyyx', 'xy') +-- !query schema +struct +-- !query output +trim + + +-- !query +SELECT btrim(encode(" xyz ", 'utf-8')) +-- !query schema +struct +-- !query output +xyz + + +-- !query +SELECT btrim(encode('yxTomxx', 'utf-8'), encode('xyz', 'utf-8')) +-- !query schema +struct +-- !query output +Tom + + +-- !query +SELECT btrim(encode('xxxbarxxx', 'utf-8'), encode('x', 'utf-8')) +-- !query schema +struct +-- !query output +bar + + +-- !query +SELECT lpad('hi', 'invalid_length') +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT rpad('hi', 'invalid_length') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select decode() +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Invalid number of arguments for function decode. Expected: 2; Found: 0; line 1 pos 7 + + +-- !query +select decode(encode('abc', 'utf-8')) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Invalid number of arguments for function decode. Expected: 2; Found: 1; line 1 pos 7 + + +-- !query +select decode(encode('abc', 'utf-8'), 'utf-8') +-- !query schema +struct +-- !query output +abc + + +-- !query +select decode(1, 1, 'Southlake') +-- !query schema +struct +-- !query output +Southlake + + +-- !query +select decode(2, 1, 'Southlake') +-- !query schema +struct +-- !query output +NULL + + +-- !query +select decode(2, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle', 'Non domestic') +-- !query schema +struct +-- !query output +San Francisco + + +-- !query +select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle', 'Non domestic') +-- !query schema +struct +-- !query output +Non domestic + + +-- !query +select decode(6, 1, 'Southlake', 2, 'San Francisco', 3, 'New Jersey', 4, 'Seattle') +-- !query schema +struct +-- !query output +NULL diff --git a/sql/core/src/test/resources/sql-tests/results/struct.sql.out b/sql/core/src/test/resources/sql-tests/results/struct.sql.out index f294c5213d319..3b2da6c85882b 100644 --- a/sql/core/src/test/resources/sql-tests/results/struct.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/struct.sql.out @@ -83,7 +83,7 @@ struct -- !query SELECT ID, STRUCT(ST.C as STC, ST.D as STD).STD FROM tbl_x -- !query schema -struct +struct -- !query output 1 delta 2 eta diff --git a/sql/core/src/test/resources/sql-tests/results/subexp-elimination.sql.out b/sql/core/src/test/resources/sql-tests/results/subexp-elimination.sql.out new file mode 100644 index 0000000000000..aca2c4c2f5422 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/subexp-elimination.sql.out @@ -0,0 +1,116 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 10 + + +-- !query +CREATE OR REPLACE TEMPORARY VIEW testData AS SELECT * FROM VALUES +('{"a":1, "b":"2"}', '[{"a": 1, "b":2}, {"a":2, "b":2}]'), ('{"a":1, "b":"2"}', null), ('{"a":2, "b":"3"}', '[{"a": 3, "b":4}, {"a":4, "b":5}]'), ('{"a":5, "b":"6"}', '[{"a": 6, "b":7}, {"a":8, "b":9}]'), (null, '[{"a": 1, "b":2}, {"a":2, "b":2}]') +AS testData(a, b) +-- !query schema +struct<> +-- !query output + + + +-- !query +SELECT from_json(a, 'struct').a, from_json(a, 'struct').b, from_json(b, 'array>')[0].a, from_json(b, 'array>')[0].b FROM testData +-- !query schema +struct +-- !query output +1 2 1 2 +1 2 NULL NULL +2 3 3 4 +5 6 6 7 +NULL NULL 1 2 + + +-- !query +SELECT if(from_json(a, 'struct').a > 1, from_json(b, 'array>')[0].a, from_json(b, 'array>')[0].a + 1) FROM testData +-- !query schema +struct<(IF((from_json(a).a > 1), from_json(b)[0].a, (from_json(b)[0].a + 1))):int> +-- !query output +2 +2 +3 +6 +NULL + + +-- !query +SELECT if(isnull(from_json(a, 'struct').a), from_json(b, 'array>')[0].b + 1, from_json(b, 'array>')[0].b) FROM testData +-- !query schema +struct<(IF((from_json(a).a IS NULL), (from_json(b)[0].b + 1), from_json(b)[0].b)):int> +-- !query output +2 +3 +4 +7 +NULL + + +-- !query +SELECT case when from_json(a, 'struct').a > 5 then from_json(a, 'struct').b when from_json(a, 'struct').a > 4 then from_json(a, 'struct').b + 1 else from_json(a, 'struct').b + 2 end FROM testData +-- !query schema +struct 5) THEN from_json(a).b WHEN (from_json(a).a > 4) THEN (from_json(a).b + 1) ELSE (from_json(a).b + 2) END:string> +-- !query output +4.0 +4.0 +5.0 +7.0 +NULL + + +-- !query +SELECT case when from_json(a, 'struct').a > 5 then from_json(b, 'array>')[0].b when from_json(a, 'struct').a > 4 then from_json(b, 'array>')[0].b + 1 else from_json(b, 'array>')[0].b + 2 end FROM testData +-- !query schema +struct 5) THEN from_json(b)[0].b WHEN (from_json(a).a > 4) THEN (from_json(b)[0].b + 1) ELSE (from_json(b)[0].b + 2) END:int> +-- !query output +4 +4 +6 +8 +NULL + + +-- !query +SELECT from_json(a, 'struct').a + random() > 2, from_json(a, 'struct').b, from_json(b, 'array>')[0].a, from_json(b, 'array>')[0].b + + random() > 2 FROM testData +-- !query schema +struct<((from_json(a).a + rand()) > 2):boolean,from_json(a).b:string,from_json(b)[0].a:int,((from_json(b)[0].b + (+ rand())) > 2):boolean> +-- !query output +NULL NULL 1 true +false 2 1 true +false 2 NULL NULL +true 3 3 true +true 6 6 true + + +-- !query +SELECT if(from_json(a, 'struct').a + random() > 5, from_json(b, 'array>')[0].a, from_json(b, 'array>')[0].a + 1) FROM testData +-- !query schema +struct<(IF(((from_json(a).a + rand()) > 5), from_json(b)[0].a, (from_json(b)[0].a + 1))):int> +-- !query output +2 +2 +4 +6 +NULL + + +-- !query +SELECT case when from_json(a, 'struct').a > 5 then from_json(a, 'struct').b + random() > 5 when from_json(a, 'struct').a > 4 then from_json(a, 'struct').b + 1 + random() > 2 else from_json(a, 'struct').b + 2 + random() > 5 end FROM testData +-- !query schema +struct 5) THEN ((from_json(a).b + rand()) > 5) WHEN (from_json(a).a > 4) THEN (((from_json(a).b + 1) + rand()) > 2) ELSE (((from_json(a).b + 2) + rand()) > 5) END:boolean> +-- !query output +NULL +false +false +true +true + + +-- !query +DROP VIEW IF EXISTS testData +-- !query schema +struct<> +-- !query output + diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-basic.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-basic.sql.out index a33f78abf27f9..2acea22e91b66 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-basic.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-basic.sql.out @@ -41,15 +41,15 @@ select 1 from tab_a where (a1, b1) not in (select (a2, b2) from tab_b) struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(named_struct('a1', tab_a.`a1`, 'b1', tab_a.`b1`) IN (listquery()))' due to data type mismatch: +cannot resolve '(named_struct('a1', tab_a.a1, 'b1', tab_a.b1) IN (listquery()))' due to data type mismatch: The number of columns in the left hand side of an IN subquery does not match the number of columns in the output of subquery. #columns in left hand side: 2. #columns in right hand side: 1. Left side columns: -[tab_a.`a1`, tab_a.`b1`]. +[tab_a.a1, tab_a.b1]. Right side columns: -[`named_struct(a2, a2, b2, b2)`].; +[`named_struct(a2, a2, b2, b2)`].; line 1 pos 35 -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-limit.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-limit.sql.out index 1c335445114c7..e24538b9138ba 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-limit.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/in-subquery/in-limit.sql.out @@ -103,7 +103,7 @@ SELECT Count(DISTINCT( t1a )), FROM t1 WHERE t1d IN (SELECT t2d FROM t2 - ORDER BY t2c + ORDER BY t2c, t2d LIMIT 2) GROUP BY t1b ORDER BY t1b DESC NULLS FIRST @@ -136,7 +136,7 @@ SELECT Count(DISTINCT( t1a )), FROM t1 WHERE t1d NOT IN (SELECT t2d FROM t2 - ORDER BY t2b DESC nulls first + ORDER BY t2b DESC nulls first, t2d LIMIT 1) GROUP BY t1b ORDER BY t1b NULLS last diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/negative-cases/invalid-correlation.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/negative-cases/invalid-correlation.sql.out index d703d4e9112e9..5b54a52e69724 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/negative-cases/invalid-correlation.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/negative-cases/invalid-correlation.sql.out @@ -46,7 +46,7 @@ AND t2b = (SELECT max(avg) struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping expressions sequence is empty, and 't2.`t2b`' is not an aggregate function. Wrap '(avg(CAST(t2.`t2b` AS BIGINT)) AS `avg`)' in windowing function(s) or wrap 't2.`t2b`' in first() (or first_value) if you don't care which value you get.; +grouping expressions sequence is empty, and 't2.t2b' is not an aggregate function. Wrap '(avg(t2.t2b) AS avg)' in windowing function(s) or wrap 't2.t2b' in first() (or first_value) if you don't care which value you get. -- !query @@ -63,7 +63,7 @@ WHERE t1a IN (SELECT min(t2a) struct<> -- !query output org.apache.spark.sql.AnalysisException -Resolved attribute(s) t2b#x missing from min(t2a)#x,t2c#x in operator !Filter t2c#x IN (list#x [t2b#x]).; +Resolved attribute(s) t2b#x missing from min(t2a)#x,t2c#x in operator !Filter t2c#x IN (list#x [t2b#x]). -- !query @@ -78,7 +78,7 @@ HAVING EXISTS (SELECT t2a struct<> -- !query output org.apache.spark.sql.AnalysisException -Found an aggregate expression in a correlated predicate that has both outer and local references, which is not supported yet. Aggregate expression: min((t1.`t1a` + t2.`t2a`)), Outer references: t1.`t1a`, Local references: t2.`t2a`.; +Found an aggregate expression in a correlated predicate that has both outer and local references, which is not supported yet. Aggregate expression: min((t1.t1a + t2.t2a)), Outer references: t1.t1a, Local references: t2.t2a. -- !query @@ -94,7 +94,7 @@ WHERE t1a IN (SELECT t2a struct<> -- !query output org.apache.spark.sql.AnalysisException -Found an aggregate expression in a correlated predicate that has both outer and local references, which is not supported yet. Aggregate expression: min((t2.`t2a` + t3.`t3a`)), Outer references: t2.`t2a`, Local references: t3.`t3a`.; +Found an aggregate expression in a correlated predicate that has both outer and local references, which is not supported yet. Aggregate expression: min((t2.t2a + t3.t3a)), Outer references: t2.t2a, Local references: t3.t3a. -- !query @@ -109,9 +109,10 @@ struct<> -- !query output org.apache.spark.sql.AnalysisException Expressions referencing the outer query are not supported outside of WHERE/HAVING clauses: -Aggregate [min(outer(t2a#x)) AS min(outer(t2.`t2a`))#x] +Aggregate [min(outer(t2a#x)) AS min(outer(t2.t2a))#x] +- SubqueryAlias t3 - +- Project [t3a#x, t3b#x, t3c#x] - +- SubqueryAlias t3 - +- LocalRelation [t3a#x, t3b#x, t3c#x] -; + +- View (`t3`, [t3a#x,t3b#x,t3c#x]) + +- Project [cast(t3a#x as int) AS t3a#x, cast(t3b#x as int) AS t3b#x, cast(t3c#x as int) AS t3c#x] + +- Project [t3a#x, t3b#x, t3c#x] + +- SubqueryAlias t3 + +- LocalRelation [t3a#x, t3b#x, t3c#x] diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/negative-cases/subq-input-typecheck.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/negative-cases/subq-input-typecheck.sql.out index 776598127075b..0b1bfdf50c5f8 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/negative-cases/subq-input-typecheck.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/negative-cases/subq-input-typecheck.sql.out @@ -64,7 +64,7 @@ FROM t1 struct<> -- !query output org.apache.spark.sql.AnalysisException -Scalar subquery must return only one column, but got 2; +Scalar subquery must return only one column, but got 2 -- !query @@ -79,7 +79,7 @@ FROM t1 struct<> -- !query output org.apache.spark.sql.AnalysisException -Scalar subquery must return only one column, but got 2; +Scalar subquery must return only one column, but got 2 -- !query @@ -92,15 +92,15 @@ t1a IN (SELECT t2a, t2b struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(t1.`t1a` IN (listquery(t1.`t1a`)))' due to data type mismatch: +cannot resolve '(t1.t1a IN (listquery(t1.t1a)))' due to data type mismatch: The number of columns in the left hand side of an IN subquery does not match the number of columns in the output of subquery. #columns in left hand side: 1. #columns in right hand side: 2. Left side columns: -[t1.`t1a`]. +[t1.t1a]. Right side columns: -[t2.`t2a`, t2.`t2b`].; +[t2.t2a, t2.t2b].; line 3 pos 4 -- !query @@ -113,15 +113,15 @@ WHERE struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(named_struct('t1a', t1.`t1a`, 't1b', t1.`t1b`) IN (listquery(t1.`t1a`)))' due to data type mismatch: +cannot resolve '(named_struct('t1a', t1.t1a, 't1b', t1.t1b) IN (listquery(t1.t1a)))' due to data type mismatch: The number of columns in the left hand side of an IN subquery does not match the number of columns in the output of subquery. #columns in left hand side: 2. #columns in right hand side: 1. Left side columns: -[t1.`t1a`, t1.`t1b`]. +[t1.t1a, t1.t1b]. Right side columns: -[t2.`t2a`].; +[t2.t2a].; line 3 pos 11 -- !query @@ -135,12 +135,12 @@ WHERE struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(named_struct('t4a', t4.`t4a`, 't4b', t4.`t4b`, 't4c', t4.`t4c`) IN (listquery()))' due to data type mismatch: +cannot resolve '(named_struct('t4a', t4.t4a, 't4b', t4.t4b, 't4c', t4.t4c) IN (listquery()))' due to data type mismatch: The data type of one or more elements in the left hand side of an IN subquery is not compatible with the data type of the output of the subquery Mismatched columns: -[(t4.`t4a`:double, t5.`t5a`:timestamp), (t4.`t4c`:string, t5.`t5c`:bigint)] +[(t4.t4a:double, t5.t5a:timestamp), (t4.t4c:string, t5.t5c:bigint)] Left side: [double, string, string]. Right side: -[timestamp, string, bigint].; +[timestamp, string, bigint].; line 3 pos 16 diff --git a/sql/core/src/test/resources/sql-tests/results/subquery/scalar-subquery/scalar-subquery-select.sql.out b/sql/core/src/test/resources/sql-tests/results/subquery/scalar-subquery/scalar-subquery-select.sql.out index 184b8daf9d28e..16570c659dc38 100644 --- a/sql/core/src/test/resources/sql-tests/results/subquery/scalar-subquery/scalar-subquery-select.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/subquery/scalar-subquery/scalar-subquery-select.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 11 +-- Number of queries: 12 -- !query @@ -196,3 +196,29 @@ val1d NULL val1e 10 val1e 10 val1e 10 + + +-- !query +SELECT t1a, + (SELECT count(t2d) FROM t2 WHERE t2a = t1a) count_t2, + (SELECT count_if(t2d > 0) FROM t2 WHERE t2a = t1a) count_if_t2, + (SELECT approx_count_distinct(t2d) FROM t2 WHERE t2a = t1a) approx_count_distinct_t2, + (SELECT collect_list(t2d) FROM t2 WHERE t2a = t1a) collect_list_t2, + (SELECT collect_set(t2d) FROM t2 WHERE t2a = t1a) collect_set_t2, + (SELECT hex(count_min_sketch(t2d, 0.5d, 0.5d, 1)) FROM t2 WHERE t2a = t1a) collect_set_t2 +FROM t1 +-- !query schema +struct,collect_set_t2:array,collect_set_t2:string> +-- !query output +val1a 0 0 0 [] [] 0000000100000000000000000000000100000004000000005D8D6AB90000000000000000000000000000000000000000000000000000000000000000 +val1a 0 0 0 [] [] 0000000100000000000000000000000100000004000000005D8D6AB90000000000000000000000000000000000000000000000000000000000000000 +val1a 0 0 0 [] [] 0000000100000000000000000000000100000004000000005D8D6AB90000000000000000000000000000000000000000000000000000000000000000 +val1a 0 0 0 [] [] 0000000100000000000000000000000100000004000000005D8D6AB90000000000000000000000000000000000000000000000000000000000000000 +val1b 6 6 3 [19,119,319,19,19,19] [19,119,319] 0000000100000000000000060000000100000004000000005D8D6AB90000000000000000000000000000000400000000000000010000000000000001 +val1c 2 2 2 [219,19] [219,19] 0000000100000000000000020000000100000004000000005D8D6AB90000000000000000000000000000000100000000000000000000000000000001 +val1d 0 0 0 [] [] 0000000100000000000000000000000100000004000000005D8D6AB90000000000000000000000000000000000000000000000000000000000000000 +val1d 0 0 0 [] [] 0000000100000000000000000000000100000004000000005D8D6AB90000000000000000000000000000000000000000000000000000000000000000 +val1d 0 0 0 [] [] 0000000100000000000000000000000100000004000000005D8D6AB90000000000000000000000000000000000000000000000000000000000000000 +val1e 1 1 1 [19] [19] 0000000100000000000000010000000100000004000000005D8D6AB90000000000000000000000000000000100000000000000000000000000000000 +val1e 1 1 1 [19] [19] 0000000100000000000000010000000100000004000000005D8D6AB90000000000000000000000000000000100000000000000000000000000000000 +val1e 1 1 1 [19] [19] 0000000100000000000000010000000100000004000000005D8D6AB90000000000000000000000000000000100000000000000000000000000000000 diff --git a/sql/core/src/test/resources/sql-tests/results/table-aliases.sql.out b/sql/core/src/test/resources/sql-tests/results/table-aliases.sql.out index 25967a3968f23..c80f421c7061e 100644 --- a/sql/core/src/test/resources/sql-tests/results/table-aliases.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/table-aliases.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 11 +-- Number of queries: 15 -- !query @@ -60,7 +60,7 @@ SELECT a AS col1, b AS col2 FROM testData AS t(c, d) struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`a`' given input columns: [c, d]; line 1 pos 7 +cannot resolve 'a' given input columns: [t.c, t.d]; line 1 pos 7 -- !query @@ -71,6 +71,30 @@ struct 1 1 +-- !query +SELECT t.* FROM (SELECT 1 AS a, 1 AS b) t(col1, col2) +-- !query schema +struct +-- !query output +1 1 + + +-- !query +SELECT col1, col2 FROM (SELECT 1 AS a, 1 AS b) t(col1, col2) +-- !query schema +struct +-- !query output +1 1 + + +-- !query +SELECT t.col1, t.col2 FROM (SELECT 1 AS a, 1 AS b) t(col1, col2) +-- !query schema +struct +-- !query output +1 1 + + -- !query CREATE OR REPLACE TEMPORARY VIEW src1 AS SELECT * FROM VALUES (1, "a"), (2, "b"), (3, "c") AS src1(id, v1) -- !query schema @@ -95,3 +119,13 @@ struct 1 a 1 8.5 2 b 2 1.0 3 c 3 3.2 + + +-- !query +SELECT dst.* FROM (src1 s1 INNER JOIN src2 s2 ON s1.id = s2.id) dst(a, b, c, d) +-- !query schema +struct +-- !query output +1 a 1 8.5 +2 b 2 1.0 +3 c 3 3.2 diff --git a/sql/core/src/test/resources/sql-tests/results/table-valued-functions.sql.out b/sql/core/src/test/resources/sql-tests/results/table-valued-functions.sql.out index 16d483df62fd5..157b2cebf3792 100644 --- a/sql/core/src/test/resources/sql-tests/results/table-valued-functions.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/table-valued-functions.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 8 +-- Number of queries: 10 -- !query @@ -70,12 +70,12 @@ select * from range(1, 1, 1, 1, 1) struct<> -- !query output org.apache.spark.sql.AnalysisException -error: table-valued function range with alternatives: - (end: long) - (start: long, end: long) - (start: long, end: long, step: long) - (start: long, end: long, step: long, numPartitions: integer) -cannot be applied to: (integer, integer, integer, integer, integer); line 1 pos 14 +Table-valued function range with alternatives: + range(start: long, end: long, step: long, numSlices: integer) + range(start: long, end: long, step: long) + range(start: long, end: long) + range(end: long) +cannot be applied to (integer, integer, integer, integer, integer): Invalid number of arguments for function range. Expected: one of 1, 2, 3 and 4; Found: 5; line 1 pos 14 -- !query @@ -84,12 +84,40 @@ select * from range(1, null) struct<> -- !query output org.apache.spark.sql.AnalysisException -error: table-valued function range with alternatives: - (end: long) - (start: long, end: long) - (start: long, end: long, step: long) - (start: long, end: long, step: long, numPartitions: integer) -cannot be applied to: (integer, null); line 1 pos 14 +Table-valued function range with alternatives: + range(start: long, end: long, step: long, numSlices: integer) + range(start: long, end: long, step: long) + range(start: long, end: long) + range(end: long) +cannot be applied to (integer, null): Incompatible input data type. Expected: long; Found: null; line 1 pos 14 + + +-- !query +select * from range(array(1, 2, 3)) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Table-valued function range with alternatives: + range(start: long, end: long, step: long, numSlices: integer) + range(start: long, end: long, step: long) + range(start: long, end: long) + range(end: long) +cannot be applied to (array): Incompatible input data type. Expected: long; Found: array; line 1 pos 14 + + +-- !query +select * from range(0, 5, 0) +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +Table-valued function range with alternatives: + range(start: long, end: long, step: long, numSlices: integer) + range(start: long, end: long, step: long) + range(start: long, end: long) + range(end: long) +cannot be applied to (integer, integer, integer): requirement failed: step (0) cannot be 0; line 1 pos 14 -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/timezone.sql.out b/sql/core/src/test/resources/sql-tests/results/timezone.sql.out new file mode 100644 index 0000000000000..d816043130737 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/timezone.sql.out @@ -0,0 +1,135 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 12 + + +-- !query +SET TIME ZONE 'Asia/Hong_Kong' +-- !query schema +struct +-- !query output +spark.sql.session.timeZone Asia/Hong_Kong + + +-- !query +SET TIME ZONE 'GMT+1' +-- !query schema +struct +-- !query output +spark.sql.session.timeZone GMT+1 + + +-- !query +SET TIME ZONE INTERVAL 10 HOURS +-- !query schema +struct +-- !query output +spark.sql.session.timeZone +10:00 + + +-- !query +SET TIME ZONE INTERVAL '15:40:32' HOUR TO SECOND +-- !query schema +struct +-- !query output +spark.sql.session.timeZone +15:40:32 + + +-- !query +SET TIME ZONE LOCAL +-- !query schema +struct +-- !query output +spark.sql.session.timeZone America/Los_Angeles + + +-- !query +SET TIME ZONE +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Invalid time zone displacement value(line 1, pos 0) + +== SQL == +SET TIME ZONE +^^^ + + +-- !query +SET TIME ZONE 'invalid/zone' +-- !query schema +struct<> +-- !query output +java.lang.IllegalArgumentException +Cannot resolve the given timezone with ZoneId.of(_, ZoneId.SHORT_IDS) + + +-- !query +SET TIME ZONE INTERVAL 3 DAYS +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +The interval value must be in the range of [-18, +18] hours with second precision(line 1, pos 14) + +== SQL == +SET TIME ZONE INTERVAL 3 DAYS +--------------^^^ + + +-- !query +SET TIME ZONE INTERVAL 24 HOURS +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +The interval value must be in the range of [-18, +18] hours with second precision(line 1, pos 14) + +== SQL == +SET TIME ZONE INTERVAL 24 HOURS +--------------^^^ + + +-- !query +SET TIME ZONE INTERVAL '19:40:32' HOUR TO SECOND +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +The interval value must be in the range of [-18, +18] hours with second precision(line 1, pos 14) + +== SQL == +SET TIME ZONE INTERVAL '19:40:32' HOUR TO SECOND +--------------^^^ + + +-- !query +SET TIME ZONE INTERVAL 10 HOURS 'GMT+1' +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +Invalid time zone displacement value(line 1, pos 0) + +== SQL == +SET TIME ZONE INTERVAL 10 HOURS 'GMT+1' +^^^ + + +-- !query +SET TIME ZONE INTERVAL 10 HOURS 1 MILLISECOND +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +The interval value must be in the range of [-18, +18] hours with second precision(line 1, pos 14) + +== SQL == +SET TIME ZONE INTERVAL 10 HOURS 1 MILLISECOND +--------------^^^ diff --git a/sql/core/src/test/resources/sql-tests/results/transform.sql.out b/sql/core/src/test/resources/sql-tests/results/transform.sql.out new file mode 100644 index 0000000000000..6f94e742b8776 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/transform.sql.out @@ -0,0 +1,783 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 47 + + +-- !query +CREATE OR REPLACE TEMPORARY VIEW t AS SELECT * FROM VALUES +('1', true, unhex('537061726B2053514C'), tinyint(1), 1, smallint(100), bigint(1), float(1.0), 1.0, Decimal(1.0), timestamp('1997-01-02'), date('2000-04-01')), +('2', false, unhex('537061726B2053514C'), tinyint(2), 2, smallint(200), bigint(2), float(2.0), 2.0, Decimal(2.0), timestamp('1997-01-02 03:04:05'), date('2000-04-02')), +('3', true, unhex('537061726B2053514C'), tinyint(3), 3, smallint(300), bigint(3), float(3.0), 3.0, Decimal(3.0), timestamp('1997-02-10 17:32:01-08'), date('2000-04-03')) +AS t(a, b, c, d, e, f, g, h, i, j, k, l) +-- !query schema +struct<> +-- !query output + + + +-- !query +CREATE OR REPLACE TEMPORARY VIEW script_trans AS SELECT * FROM VALUES +(1, 2, 3), +(4, 5, 6), +(7, 8, 9) +AS script_trans(a, b, c) +-- !query schema +struct<> +-- !query output + + + +-- !query +CREATE OR REPLACE TEMPORARY VIEW complex_trans AS SELECT * FROM VALUES +(1, 1), +(1, 1), +(2, 2), +(2, 2), +(3, 3), +(2, 2), +(3, 3), +(1, 1), +(3, 3) +as complex_trans(a, b) +-- !query schema +struct<> +-- !query output + + + +-- !query +SELECT TRANSFORM(a) +USING 'cat' AS (a) +FROM t +-- !query schema +struct +-- !query output +1 +2 +3 + + +-- !query +SELECT a, b, decode(c, 'UTF-8'), d, e, f, g, h, i, j, k, l FROM ( + SELECT TRANSFORM(a, b, c, d, e, f, g, h, i, j, k, l) + USING 'cat' AS ( + a string, + b boolean, + c binary, + d tinyint, + e int, + f smallint, + g long, + h float, + i double, + j decimal(38, 18), + k timestamp, + l date) + FROM t +) tmp +-- !query schema +struct +-- !query output +1 true Spark SQL 1 1 100 1 1.0 1.0 1.000000000000000000 1997-01-02 00:00:00 2000-04-01 +2 false Spark SQL 2 2 200 2 2.0 2.0 2.000000000000000000 1997-01-02 03:04:05 2000-04-02 +3 true Spark SQL 3 3 300 3 3.0 3.0 3.000000000000000000 1997-02-10 17:32:01 2000-04-03 + + +-- !query +SELECT a, b, decode(c, 'UTF-8'), d, e, f, g, h, i, j, k, l FROM ( + SELECT TRANSFORM(a, b, c, d, e, f, g, h, i, j, k, l) + USING 'cat' AS ( + a string, + b string, + c string, + d string, + e string, + f string, + g string, + h string, + i string, + j string, + k string, + l string) + FROM t +) tmp +-- !query schema +struct +-- !query output +1 true Spark SQL 1 1 100 1 1.0 1.0 1 1997-01-02 00:00:00 2000-04-01 +2 false Spark SQL 2 2 200 2 2.0 2.0 2 1997-01-02 03:04:05 2000-04-02 +3 true Spark SQL 3 3 300 3 3.0 3.0 3 1997-02-10 17:32:01 2000-04-03 + + +-- !query +SELECT TRANSFORM(a) +USING 'cat' +FROM t +-- !query schema +struct +-- !query output +1 NULL +2 NULL +3 NULL + + +-- !query +SELECT TRANSFORM(a, b) +USING 'cat' +FROM t +-- !query schema +struct +-- !query output +1 true +2 false +3 true + + +-- !query +SELECT TRANSFORM(a, b, c) +USING 'cat' +FROM t +-- !query schema +struct +-- !query output +1 true +2 false +3 true + + +-- !query +SELECT TRANSFORM(a, b, c, d, e, f, g, h, i) +USING 'cat' AS (a int, b short, c long, d byte, e float, f double, g decimal(38, 18), h date, i timestamp) +FROM VALUES +('a','','1231a','a','213.21a','213.21a','0a.21d','2000-04-01123','1997-0102 00:00:') tmp(a, b, c, d, e, f, g, h, i) +-- !query schema +struct +-- !query output +NULL NULL NULL NULL NULL NULL NULL NULL NULL + + +-- !query +SELECT TRANSFORM(b, max(a), sum(f)) +USING 'cat' AS (a, b) +FROM t +GROUP BY b +-- !query schema +struct +-- !query output +false 2 +true 3 + + +-- !query +MAP a, b USING 'cat' AS (a, b) FROM t +-- !query schema +struct +-- !query output +1 true +2 false +3 true + + +-- !query +REDUCE a, b USING 'cat' AS (a, b) FROM t +-- !query schema +struct +-- !query output +1 true +2 false +3 true + + +-- !query +SELECT TRANSFORM(a, b, c, null) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY '@' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' +USING 'cat' AS (a, b, c, d) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY '@' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' +FROM t +-- !query schema +struct +-- !query output +1 true Spark SQL null +2 false Spark SQL null +3 true Spark SQL null + + +-- !query +SELECT TRANSFORM(a, b, c, null) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY '@' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' +USING 'cat' AS (d) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY '@' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' +FROM t +-- !query schema +struct +-- !query output +1 +2 +3 + + +-- !query +SELECT a, b, decode(c, 'UTF-8'), d, e, f, g, h, i, j, k, l FROM ( + SELECT TRANSFORM(a, b, c, d, e, f, g, h, i, j, k, l) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' + USING 'cat' AS ( + a string, + b boolean, + c binary, + d tinyint, + e int, + f smallint, + g long, + h float, + i double, + j decimal(38, 18), + k timestamp, + l date) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' + FROM t +) tmp +-- !query schema +struct +-- !query output +1 true Spark SQL 1 1 100 1 1.0 1.0 1.000000000000000000 1997-01-02 00:00:00 2000-04-01 +2 false Spark SQL 2 2 200 2 2.0 2.0 2.000000000000000000 1997-01-02 03:04:05 2000-04-02 +3 true Spark SQL 3 3 300 3 3.0 3.0 3.000000000000000000 1997-02-10 17:32:01 2000-04-03 + + +-- !query +SELECT a, b, decode(c, 'UTF-8'), d, e, f, g, h, i, j, k, l FROM ( + SELECT TRANSFORM(a, b, c, d, e, f, g, h, i, j, k, l) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' + USING 'cat' AS ( + a string, + b long, + c binary, + d tinyint, + e int, + f smallint, + g long, + h float, + i double, + j decimal(38, 18), + k int, + l long) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + NULL DEFINED AS 'NULL' + FROM t +) tmp +-- !query schema +struct +-- !query output +1 NULL Spark SQL 1 1 100 1 1.0 1.0 1.000000000000000000 NULL NULL +2 NULL Spark SQL 2 2 200 2 2.0 2.0 2.000000000000000000 NULL NULL +3 NULL Spark SQL 3 3 300 3 3.0 3.0 3.000000000000000000 NULL NULL + + +-- !query +SELECT a, b, decode(c, 'UTF-8'), d, e, f, g, h, i, j, k, l FROM ( + SELECT TRANSFORM(a, b, c, d, e, f, g, h, i, j, k, l) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '@' + NULL DEFINED AS 'NULL' + USING 'cat' AS ( + a string, + b string, + c string, + d string, + e string, + f string, + g string, + h string, + i string, + j string, + k string, + l string) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '@' + NULL DEFINED AS 'NULL' + FROM t +) tmp +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +LINES TERMINATED BY only supports newline '\n' right now: @(line 3, pos 4) + +== SQL == +SELECT a, b, decode(c, 'UTF-8'), d, e, f, g, h, i, j, k, l FROM ( + SELECT TRANSFORM(a, b, c, d, e, f, g, h, i, j, k, l) + ROW FORMAT DELIMITED +----^^^ + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '@' + NULL DEFINED AS 'NULL' + USING 'cat' AS ( + a string, + b string, + c string, + d string, + e string, + f string, + g string, + h string, + i string, + j string, + k string, + l string) + ROW FORMAT DELIMITED + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '@' + NULL DEFINED AS 'NULL' + FROM t +) tmp + + +-- !query +SELECT TRANSFORM(b, a, CAST(c AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +-- !query schema +struct +-- !query output +2 1 3 +5 4 6 + + +-- !query +SELECT TRANSFORM(1, 2, 3) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +-- !query schema +struct +-- !query output +1 2 3 +1 2 3 + + +-- !query +SELECT TRANSFORM(1, 2) + USING 'cat' AS (a INT, b INT) +FROM script_trans +LIMIT 1 +-- !query schema +struct +-- !query output +1 2 + + +-- !query +SELECT TRANSFORM( + b, a, + CASE + WHEN c > 100 THEN 1 + WHEN c < 100 THEN 2 + ELSE 3 END) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +-- !query schema +struct +-- !query output +2 1 2 +5 4 2 + + +-- !query +SELECT TRANSFORM(b, a, c + 1) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +-- !query schema +struct +-- !query output +2 1 4 +5 4 7 + + +-- !query +SELECT TRANSFORM(*) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +-- !query schema +struct +-- !query output +1 2 3 +4 5 6 + + +-- !query +SELECT TRANSFORM(b, MAX(a), CAST(SUM(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +GROUP BY b +-- !query schema +struct +-- !query output +2 1 3 +5 4 6 + + +-- !query +SELECT TRANSFORM(b, MAX(a) FILTER (WHERE a > 3), CAST(SUM(c) AS STRING)) + USING 'cat' AS (a,b,c) +FROM script_trans +WHERE a <= 4 +GROUP BY b +-- !query schema +struct +-- !query output +2 null 3 +5 4 6 + + +-- !query +SELECT TRANSFORM(b, MAX(a), CAST(sum(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 2 +GROUP BY b +-- !query schema +struct +-- !query output +2 1 3 + + +-- !query +SELECT TRANSFORM(b, MAX(a), CAST(SUM(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +GROUP BY b +HAVING MAX(a) > 0 +-- !query schema +struct +-- !query output +2 1 3 +5 4 6 + + +-- !query +SELECT TRANSFORM(b, MAX(a), CAST(SUM(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +GROUP BY b +HAVING MAX(a) > 1 +-- !query schema +struct +-- !query output +5 4 6 + + +-- !query +SELECT TRANSFORM(b, MAX(a) OVER w, CAST(SUM(c) OVER w AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +WINDOW w AS (PARTITION BY b ORDER BY a) +-- !query schema +struct +-- !query output +2 1 3 +5 4 6 + + +-- !query +SELECT TRANSFORM(b, MAX(a), CAST(SUM(c) AS STRING), myCol, myCol2) + USING 'cat' AS (a STRING, b STRING, c STRING, d ARRAY, e STRING) +FROM script_trans +LATERAL VIEW explode(array(array(1,2,3))) myTable AS myCol +LATERAL VIEW explode(myTable.myCol) myTable2 AS myCol2 +WHERE a <= 4 +GROUP BY b, myCol, myCol2 +HAVING max(a) > 1 +-- !query schema +struct,e:string> +-- !query output +5 4 6 [1,2,3] 1 +5 4 6 [1,2,3] 2 +5 4 6 [1,2,3] 3 + + +-- !query +FROM( + FROM script_trans + SELECT TRANSFORM(a, b) + USING 'cat' AS (`a` INT, b STRING) +) t +SELECT a + 1 +-- !query schema +struct<(a + 1):int> +-- !query output +2 +5 +8 + + +-- !query +FROM( + SELECT TRANSFORM(a, SUM(b)) + USING 'cat' AS (`a` INT, b STRING) + FROM script_trans + GROUP BY a +) t +SELECT (b + 1) AS result +ORDER BY result +-- !query schema +struct +-- !query output +3.0 +6.0 +9.0 + + +-- !query +MAP k / 10 USING 'cat' AS (one) FROM (SELECT 10 AS k) +-- !query schema +struct +-- !query output +1.0 + + +-- !query +FROM (SELECT 1 AS key, 100 AS value) src +MAP src.*, src.key, CAST(src.key / 10 AS INT), CAST(src.key % 10 AS INT), src.value + USING 'cat' AS (k, v, tkey, ten, one, tvalue) +-- !query schema +struct +-- !query output +1 100 1 0 1 100 + + +-- !query +SELECT TRANSFORM(1) + USING 'cat' AS (a) +FROM script_trans +HAVING true +-- !query schema +struct +-- !query output +1 + + +-- !query +SET spark.sql.legacy.parser.havingWithoutGroupByAsWhere=true +-- !query schema +struct +-- !query output +spark.sql.legacy.parser.havingWithoutGroupByAsWhere true + + +-- !query +SELECT TRANSFORM(1) + USING 'cat' AS (a) +FROM script_trans +HAVING true +-- !query schema +struct +-- !query output +1 +1 +1 + + +-- !query +SET spark.sql.legacy.parser.havingWithoutGroupByAsWhere=false +-- !query schema +struct +-- !query output +spark.sql.legacy.parser.havingWithoutGroupByAsWhere false + + +-- !query +WITH temp AS ( + SELECT TRANSFORM(a) USING 'cat' AS (b string) FROM t +) +SELECT t1.b FROM temp t1 JOIN temp t2 ON t1.b = t2.b +-- !query schema +struct +-- !query output +1 +2 +3 + + +-- !query +SELECT TRANSFORM(DISTINCT b, a, c) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +TRANSFORM does not support DISTINCT/ALL in inputs(line 1, pos 17) + +== SQL == +SELECT TRANSFORM(DISTINCT b, a, c) +-----------------^^^ + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 + + +-- !query +SELECT TRANSFORM(ALL b, a, c) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +TRANSFORM does not support DISTINCT/ALL in inputs(line 1, pos 17) + +== SQL == +SELECT TRANSFORM(ALL b, a, c) +-----------------^^^ + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 4 + + +-- !query +SELECT TRANSFORM(b AS b_1, MAX(a), CAST(sum(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 2 +GROUP BY b +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +no viable alternative at input 'SELECT TRANSFORM(b AS'(line 1, pos 19) + +== SQL == +SELECT TRANSFORM(b AS b_1, MAX(a), CAST(sum(c) AS STRING)) +-------------------^^^ + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 2 +GROUP BY b + + +-- !query +SELECT TRANSFORM(b b_1, MAX(a), CAST(sum(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 2 +GROUP BY b +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +no viable alternative at input 'SELECT TRANSFORM(b b_1'(line 1, pos 19) + +== SQL == +SELECT TRANSFORM(b b_1, MAX(a), CAST(sum(c) AS STRING)) +-------------------^^^ + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 2 +GROUP BY b + + +-- !query +SELECT TRANSFORM(b, MAX(a) AS max_a, CAST(sum(c) AS STRING)) + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 2 +GROUP BY b +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +no viable alternative at input 'SELECT TRANSFORM(b, MAX(a) AS'(line 1, pos 27) + +== SQL == +SELECT TRANSFORM(b, MAX(a) AS max_a, CAST(sum(c) AS STRING)) +---------------------------^^^ + USING 'cat' AS (a, b, c) +FROM script_trans +WHERE a <= 2 +GROUP BY b + + +-- !query +FROM ( + SELECT TRANSFORM(a, b) + USING 'cat' AS (a, b) + FROM complex_trans + CLUSTER BY a +) map_output +SELECT TRANSFORM(a, b) + USING 'cat' AS (a, b) +-- !query schema +struct +-- !query output +1 1 +1 1 +1 1 +2 2 +2 2 +2 2 +3 3 +3 3 +3 3 + + +-- !query +FROM ( + SELECT TRANSFORM(a, b) + USING 'cat' AS (a, b) + FROM complex_trans + ORDER BY a +) map_output +SELECT TRANSFORM(a, b) + USING 'cat' AS (a, b) +-- !query schema +struct +-- !query output +1 1 +1 1 +1 1 +2 2 +2 2 +2 2 +3 3 +3 3 +3 3 diff --git a/sql/core/src/test/resources/sql-tests/results/try_arithmetic.sql.out b/sql/core/src/test/resources/sql-tests/results/try_arithmetic.sql.out new file mode 100644 index 0000000000000..490ff50cc8782 --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/try_arithmetic.sql.out @@ -0,0 +1,66 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 8 + + +-- !query +SELECT try_add(1, 1) +-- !query schema +struct +-- !query output +2 + + +-- !query +SELECT try_add(2147483647, 1) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT try_add(-2147483648, -1) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT try_add(9223372036854775807L, 1) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT try_add(-9223372036854775808L, -1) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT try_divide(1, 0.5) +-- !query schema +struct +-- !query output +2.000000 + + +-- !query +SELECT try_divide(1, 0) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT try_divide(0, 0) +-- !query schema +struct +-- !query output +NULL diff --git a/sql/core/src/test/resources/sql-tests/results/try_cast.sql.out b/sql/core/src/test/resources/sql-tests/results/try_cast.sql.out new file mode 100644 index 0000000000000..8be8d6be3437e --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/try_cast.sql.out @@ -0,0 +1,234 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 29 + + +-- !query +SELECT TRY_CAST('1.23' AS int) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('1.23' AS long) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('-4.56' AS int) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('-4.56' AS long) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('abc' AS int) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('abc' AS long) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('' AS int) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('' AS long) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST(NULL AS int) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST(NULL AS long) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('123.a' AS int) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('123.a' AS long) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('-2147483648' AS int) +-- !query schema +struct +-- !query output +-2147483648 + + +-- !query +SELECT TRY_CAST('-2147483649' AS int) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('2147483647' AS int) +-- !query schema +struct +-- !query output +2147483647 + + +-- !query +SELECT TRY_CAST('2147483648' AS int) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('-9223372036854775808' AS long) +-- !query schema +struct +-- !query output +-9223372036854775808 + + +-- !query +SELECT TRY_CAST('-9223372036854775809' AS long) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('9223372036854775807' AS long) +-- !query schema +struct +-- !query output +9223372036854775807 + + +-- !query +SELECT TRY_CAST('9223372036854775808' AS long) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST('interval 3 month 1 hour' AS interval) +-- !query schema +struct +-- !query output +3 months 1 hours + + +-- !query +SELECT TRY_CAST('abc' AS interval) +-- !query schema +struct +-- !query output +NULL + + +-- !query +select TRY_CAST('true' as boolean) +-- !query schema +struct +-- !query output +true + + +-- !query +select TRY_CAST('false' as boolean) +-- !query schema +struct +-- !query output +false + + +-- !query +select TRY_CAST('abc' as boolean) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST("2021-01-01" AS date) +-- !query schema +struct +-- !query output +2021-01-01 + + +-- !query +SELECT TRY_CAST("2021-101-01" AS date) +-- !query schema +struct +-- !query output +NULL + + +-- !query +SELECT TRY_CAST("2021-01-01 00:00:00" AS timestamp) +-- !query schema +struct +-- !query output +2021-01-01 00:00:00 + + +-- !query +SELECT TRY_CAST("2021-101-01 00:00:00" AS timestamp) +-- !query schema +struct +-- !query output +NULL diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/arrayJoin.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/arrayJoin.sql.out index b49e6b5f21b16..d23b86651457f 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/arrayJoin.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/arrayJoin.sql.out @@ -61,7 +61,7 @@ struct -- !query SELECT array_join(array(float(2.0), float(1.0)), ', ') -- !query schema -struct +struct -- !query output 2.0, 1.0 diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/binaryComparison.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/binaryComparison.sql.out index 0e1a3d0bc4d9e..4cc005d215517 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/binaryComparison.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/binaryComparison.sql.out @@ -13,7 +13,7 @@ struct<> -- !query SELECT cast(1 as binary) = '1' FROM t -- !query schema -struct<(CAST(1 AS BINARY) = CAST(1 AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) = 1):boolean> -- !query output false @@ -21,7 +21,7 @@ false -- !query SELECT cast(1 as binary) > '2' FROM t -- !query schema -struct<(CAST(1 AS BINARY) > CAST(2 AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) > 2):boolean> -- !query output false @@ -29,7 +29,7 @@ false -- !query SELECT cast(1 as binary) >= '2' FROM t -- !query schema -struct<(CAST(1 AS BINARY) >= CAST(2 AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) >= 2):boolean> -- !query output false @@ -37,7 +37,7 @@ false -- !query SELECT cast(1 as binary) < '2' FROM t -- !query schema -struct<(CAST(1 AS BINARY) < CAST(2 AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) < 2):boolean> -- !query output true @@ -45,7 +45,7 @@ true -- !query SELECT cast(1 as binary) <= '2' FROM t -- !query schema -struct<(CAST(1 AS BINARY) <= CAST(2 AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) <= 2):boolean> -- !query output true @@ -53,7 +53,7 @@ true -- !query SELECT cast(1 as binary) <> '2' FROM t -- !query schema -struct<(NOT (CAST(1 AS BINARY) = CAST(2 AS BINARY))):boolean> +struct<(NOT (CAST(1 AS BINARY) = 2)):boolean> -- !query output true @@ -61,7 +61,7 @@ true -- !query SELECT cast(1 as binary) = cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS BINARY) = CAST(CAST(NULL AS STRING) AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) = CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -69,7 +69,7 @@ NULL -- !query SELECT cast(1 as binary) > cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS BINARY) > CAST(CAST(NULL AS STRING) AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) > CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -77,7 +77,7 @@ NULL -- !query SELECT cast(1 as binary) >= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS BINARY) >= CAST(CAST(NULL AS STRING) AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) >= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -85,7 +85,7 @@ NULL -- !query SELECT cast(1 as binary) < cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS BINARY) < CAST(CAST(NULL AS STRING) AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) < CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -93,7 +93,7 @@ NULL -- !query SELECT cast(1 as binary) <= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS BINARY) <= CAST(CAST(NULL AS STRING) AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) <= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -101,7 +101,7 @@ NULL -- !query SELECT cast(1 as binary) <> cast(null as string) FROM t -- !query schema -struct<(NOT (CAST(1 AS BINARY) = CAST(CAST(NULL AS STRING) AS BINARY))):boolean> +struct<(NOT (CAST(1 AS BINARY) = CAST(NULL AS STRING))):boolean> -- !query output NULL @@ -109,7 +109,7 @@ NULL -- !query SELECT '1' = cast(1 as binary) FROM t -- !query schema -struct<(CAST(1 AS BINARY) = CAST(1 AS BINARY)):boolean> +struct<(1 = CAST(1 AS BINARY)):boolean> -- !query output false @@ -117,7 +117,7 @@ false -- !query SELECT '2' > cast(1 as binary) FROM t -- !query schema -struct<(CAST(2 AS BINARY) > CAST(1 AS BINARY)):boolean> +struct<(2 > CAST(1 AS BINARY)):boolean> -- !query output true @@ -125,7 +125,7 @@ true -- !query SELECT '2' >= cast(1 as binary) FROM t -- !query schema -struct<(CAST(2 AS BINARY) >= CAST(1 AS BINARY)):boolean> +struct<(2 >= CAST(1 AS BINARY)):boolean> -- !query output true @@ -133,7 +133,7 @@ true -- !query SELECT '2' < cast(1 as binary) FROM t -- !query schema -struct<(CAST(2 AS BINARY) < CAST(1 AS BINARY)):boolean> +struct<(2 < CAST(1 AS BINARY)):boolean> -- !query output false @@ -141,7 +141,7 @@ false -- !query SELECT '2' <= cast(1 as binary) FROM t -- !query schema -struct<(CAST(2 AS BINARY) <= CAST(1 AS BINARY)):boolean> +struct<(2 <= CAST(1 AS BINARY)):boolean> -- !query output false @@ -149,7 +149,7 @@ false -- !query SELECT '2' <> cast(1 as binary) FROM t -- !query schema -struct<(NOT (CAST(2 AS BINARY) = CAST(1 AS BINARY))):boolean> +struct<(NOT (2 = CAST(1 AS BINARY))):boolean> -- !query output true @@ -157,7 +157,7 @@ true -- !query SELECT cast(null as string) = cast(1 as binary) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BINARY) = CAST(1 AS BINARY)):boolean> +struct<(CAST(NULL AS STRING) = CAST(1 AS BINARY)):boolean> -- !query output NULL @@ -165,7 +165,7 @@ NULL -- !query SELECT cast(null as string) > cast(1 as binary) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BINARY) > CAST(1 AS BINARY)):boolean> +struct<(CAST(NULL AS STRING) > CAST(1 AS BINARY)):boolean> -- !query output NULL @@ -173,7 +173,7 @@ NULL -- !query SELECT cast(null as string) >= cast(1 as binary) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BINARY) >= CAST(1 AS BINARY)):boolean> +struct<(CAST(NULL AS STRING) >= CAST(1 AS BINARY)):boolean> -- !query output NULL @@ -181,7 +181,7 @@ NULL -- !query SELECT cast(null as string) < cast(1 as binary) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BINARY) < CAST(1 AS BINARY)):boolean> +struct<(CAST(NULL AS STRING) < CAST(1 AS BINARY)):boolean> -- !query output NULL @@ -189,7 +189,7 @@ NULL -- !query SELECT cast(null as string) <= cast(1 as binary) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BINARY) <= CAST(1 AS BINARY)):boolean> +struct<(CAST(NULL AS STRING) <= CAST(1 AS BINARY)):boolean> -- !query output NULL @@ -197,7 +197,7 @@ NULL -- !query SELECT cast(null as string) <> cast(1 as binary) FROM t -- !query schema -struct<(NOT (CAST(CAST(NULL AS STRING) AS BINARY) = CAST(1 AS BINARY))):boolean> +struct<(NOT (CAST(NULL AS STRING) = CAST(1 AS BINARY))):boolean> -- !query output NULL @@ -205,7 +205,7 @@ NULL -- !query SELECT cast(1 as tinyint) = '1' FROM t -- !query schema -struct<(CAST(1 AS TINYINT) = CAST(1 AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) = 1):boolean> -- !query output true @@ -213,7 +213,7 @@ true -- !query SELECT cast(1 as tinyint) > '2' FROM t -- !query schema -struct<(CAST(1 AS TINYINT) > CAST(2 AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) > 2):boolean> -- !query output false @@ -221,7 +221,7 @@ false -- !query SELECT cast(1 as tinyint) >= '2' FROM t -- !query schema -struct<(CAST(1 AS TINYINT) >= CAST(2 AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) >= 2):boolean> -- !query output false @@ -229,7 +229,7 @@ false -- !query SELECT cast(1 as tinyint) < '2' FROM t -- !query schema -struct<(CAST(1 AS TINYINT) < CAST(2 AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) < 2):boolean> -- !query output true @@ -237,7 +237,7 @@ true -- !query SELECT cast(1 as tinyint) <= '2' FROM t -- !query schema -struct<(CAST(1 AS TINYINT) <= CAST(2 AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) <= 2):boolean> -- !query output true @@ -245,7 +245,7 @@ true -- !query SELECT cast(1 as tinyint) <> '2' FROM t -- !query schema -struct<(NOT (CAST(1 AS TINYINT) = CAST(2 AS TINYINT))):boolean> +struct<(NOT (CAST(1 AS TINYINT) = 2)):boolean> -- !query output true @@ -253,7 +253,7 @@ true -- !query SELECT cast(1 as tinyint) = cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS TINYINT) = CAST(CAST(NULL AS STRING) AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) = CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -261,7 +261,7 @@ NULL -- !query SELECT cast(1 as tinyint) > cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS TINYINT) > CAST(CAST(NULL AS STRING) AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) > CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -269,7 +269,7 @@ NULL -- !query SELECT cast(1 as tinyint) >= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS TINYINT) >= CAST(CAST(NULL AS STRING) AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) >= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -277,7 +277,7 @@ NULL -- !query SELECT cast(1 as tinyint) < cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS TINYINT) < CAST(CAST(NULL AS STRING) AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) < CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -285,7 +285,7 @@ NULL -- !query SELECT cast(1 as tinyint) <= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS TINYINT) <= CAST(CAST(NULL AS STRING) AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) <= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -293,7 +293,7 @@ NULL -- !query SELECT cast(1 as tinyint) <> cast(null as string) FROM t -- !query schema -struct<(NOT (CAST(1 AS TINYINT) = CAST(CAST(NULL AS STRING) AS TINYINT))):boolean> +struct<(NOT (CAST(1 AS TINYINT) = CAST(NULL AS STRING))):boolean> -- !query output NULL @@ -301,7 +301,7 @@ NULL -- !query SELECT '1' = cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS TINYINT) = CAST(1 AS TINYINT)):boolean> +struct<(1 = CAST(1 AS TINYINT)):boolean> -- !query output true @@ -309,7 +309,7 @@ true -- !query SELECT '2' > cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(2 AS TINYINT) > CAST(1 AS TINYINT)):boolean> +struct<(2 > CAST(1 AS TINYINT)):boolean> -- !query output true @@ -317,7 +317,7 @@ true -- !query SELECT '2' >= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(2 AS TINYINT) >= CAST(1 AS TINYINT)):boolean> +struct<(2 >= CAST(1 AS TINYINT)):boolean> -- !query output true @@ -325,7 +325,7 @@ true -- !query SELECT '2' < cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(2 AS TINYINT) < CAST(1 AS TINYINT)):boolean> +struct<(2 < CAST(1 AS TINYINT)):boolean> -- !query output false @@ -333,7 +333,7 @@ false -- !query SELECT '2' <= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(2 AS TINYINT) <= CAST(1 AS TINYINT)):boolean> +struct<(2 <= CAST(1 AS TINYINT)):boolean> -- !query output false @@ -341,7 +341,7 @@ false -- !query SELECT '2' <> cast(1 as tinyint) FROM t -- !query schema -struct<(NOT (CAST(2 AS TINYINT) = CAST(1 AS TINYINT))):boolean> +struct<(NOT (2 = CAST(1 AS TINYINT))):boolean> -- !query output true @@ -349,7 +349,7 @@ true -- !query SELECT cast(null as string) = cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS TINYINT) = CAST(1 AS TINYINT)):boolean> +struct<(CAST(NULL AS STRING) = CAST(1 AS TINYINT)):boolean> -- !query output NULL @@ -357,7 +357,7 @@ NULL -- !query SELECT cast(null as string) > cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS TINYINT) > CAST(1 AS TINYINT)):boolean> +struct<(CAST(NULL AS STRING) > CAST(1 AS TINYINT)):boolean> -- !query output NULL @@ -365,7 +365,7 @@ NULL -- !query SELECT cast(null as string) >= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS TINYINT) >= CAST(1 AS TINYINT)):boolean> +struct<(CAST(NULL AS STRING) >= CAST(1 AS TINYINT)):boolean> -- !query output NULL @@ -373,7 +373,7 @@ NULL -- !query SELECT cast(null as string) < cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS TINYINT) < CAST(1 AS TINYINT)):boolean> +struct<(CAST(NULL AS STRING) < CAST(1 AS TINYINT)):boolean> -- !query output NULL @@ -381,7 +381,7 @@ NULL -- !query SELECT cast(null as string) <= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS TINYINT) <= CAST(1 AS TINYINT)):boolean> +struct<(CAST(NULL AS STRING) <= CAST(1 AS TINYINT)):boolean> -- !query output NULL @@ -389,7 +389,7 @@ NULL -- !query SELECT cast(null as string) <> cast(1 as tinyint) FROM t -- !query schema -struct<(NOT (CAST(CAST(NULL AS STRING) AS TINYINT) = CAST(1 AS TINYINT))):boolean> +struct<(NOT (CAST(NULL AS STRING) = CAST(1 AS TINYINT))):boolean> -- !query output NULL @@ -397,7 +397,7 @@ NULL -- !query SELECT cast(1 as smallint) = '1' FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) = CAST(1 AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) = 1):boolean> -- !query output true @@ -405,7 +405,7 @@ true -- !query SELECT cast(1 as smallint) > '2' FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) > CAST(2 AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) > 2):boolean> -- !query output false @@ -413,7 +413,7 @@ false -- !query SELECT cast(1 as smallint) >= '2' FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) >= CAST(2 AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) >= 2):boolean> -- !query output false @@ -421,7 +421,7 @@ false -- !query SELECT cast(1 as smallint) < '2' FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) < CAST(2 AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) < 2):boolean> -- !query output true @@ -429,7 +429,7 @@ true -- !query SELECT cast(1 as smallint) <= '2' FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) <= CAST(2 AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) <= 2):boolean> -- !query output true @@ -437,7 +437,7 @@ true -- !query SELECT cast(1 as smallint) <> '2' FROM t -- !query schema -struct<(NOT (CAST(1 AS SMALLINT) = CAST(2 AS SMALLINT))):boolean> +struct<(NOT (CAST(1 AS SMALLINT) = 2)):boolean> -- !query output true @@ -445,7 +445,7 @@ true -- !query SELECT cast(1 as smallint) = cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) = CAST(CAST(NULL AS STRING) AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) = CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -453,7 +453,7 @@ NULL -- !query SELECT cast(1 as smallint) > cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) > CAST(CAST(NULL AS STRING) AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) > CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -461,7 +461,7 @@ NULL -- !query SELECT cast(1 as smallint) >= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) >= CAST(CAST(NULL AS STRING) AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) >= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -469,7 +469,7 @@ NULL -- !query SELECT cast(1 as smallint) < cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) < CAST(CAST(NULL AS STRING) AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) < CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -477,7 +477,7 @@ NULL -- !query SELECT cast(1 as smallint) <= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) <= CAST(CAST(NULL AS STRING) AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) <= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -485,7 +485,7 @@ NULL -- !query SELECT cast(1 as smallint) <> cast(null as string) FROM t -- !query schema -struct<(NOT (CAST(1 AS SMALLINT) = CAST(CAST(NULL AS STRING) AS SMALLINT))):boolean> +struct<(NOT (CAST(1 AS SMALLINT) = CAST(NULL AS STRING))):boolean> -- !query output NULL @@ -493,7 +493,7 @@ NULL -- !query SELECT '1' = cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) = CAST(1 AS SMALLINT)):boolean> +struct<(1 = CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -501,7 +501,7 @@ true -- !query SELECT '2' > cast(1 as smallint) FROM t -- !query schema -struct<(CAST(2 AS SMALLINT) > CAST(1 AS SMALLINT)):boolean> +struct<(2 > CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -509,7 +509,7 @@ true -- !query SELECT '2' >= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(2 AS SMALLINT) >= CAST(1 AS SMALLINT)):boolean> +struct<(2 >= CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -517,7 +517,7 @@ true -- !query SELECT '2' < cast(1 as smallint) FROM t -- !query schema -struct<(CAST(2 AS SMALLINT) < CAST(1 AS SMALLINT)):boolean> +struct<(2 < CAST(1 AS SMALLINT)):boolean> -- !query output false @@ -525,7 +525,7 @@ false -- !query SELECT '2' <= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(2 AS SMALLINT) <= CAST(1 AS SMALLINT)):boolean> +struct<(2 <= CAST(1 AS SMALLINT)):boolean> -- !query output false @@ -533,7 +533,7 @@ false -- !query SELECT '2' <> cast(1 as smallint) FROM t -- !query schema -struct<(NOT (CAST(2 AS SMALLINT) = CAST(1 AS SMALLINT))):boolean> +struct<(NOT (2 = CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -541,7 +541,7 @@ true -- !query SELECT cast(null as string) = cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS SMALLINT) = CAST(1 AS SMALLINT)):boolean> +struct<(CAST(NULL AS STRING) = CAST(1 AS SMALLINT)):boolean> -- !query output NULL @@ -549,7 +549,7 @@ NULL -- !query SELECT cast(null as string) > cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS SMALLINT) > CAST(1 AS SMALLINT)):boolean> +struct<(CAST(NULL AS STRING) > CAST(1 AS SMALLINT)):boolean> -- !query output NULL @@ -557,7 +557,7 @@ NULL -- !query SELECT cast(null as string) >= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS SMALLINT) >= CAST(1 AS SMALLINT)):boolean> +struct<(CAST(NULL AS STRING) >= CAST(1 AS SMALLINT)):boolean> -- !query output NULL @@ -565,7 +565,7 @@ NULL -- !query SELECT cast(null as string) < cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS SMALLINT) < CAST(1 AS SMALLINT)):boolean> +struct<(CAST(NULL AS STRING) < CAST(1 AS SMALLINT)):boolean> -- !query output NULL @@ -573,7 +573,7 @@ NULL -- !query SELECT cast(null as string) <= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS SMALLINT) <= CAST(1 AS SMALLINT)):boolean> +struct<(CAST(NULL AS STRING) <= CAST(1 AS SMALLINT)):boolean> -- !query output NULL @@ -581,7 +581,7 @@ NULL -- !query SELECT cast(null as string) <> cast(1 as smallint) FROM t -- !query schema -struct<(NOT (CAST(CAST(NULL AS STRING) AS SMALLINT) = CAST(1 AS SMALLINT))):boolean> +struct<(NOT (CAST(NULL AS STRING) = CAST(1 AS SMALLINT))):boolean> -- !query output NULL @@ -589,7 +589,7 @@ NULL -- !query SELECT cast(1 as int) = '1' FROM t -- !query schema -struct<(CAST(1 AS INT) = CAST(1 AS INT)):boolean> +struct<(CAST(1 AS INT) = 1):boolean> -- !query output true @@ -597,7 +597,7 @@ true -- !query SELECT cast(1 as int) > '2' FROM t -- !query schema -struct<(CAST(1 AS INT) > CAST(2 AS INT)):boolean> +struct<(CAST(1 AS INT) > 2):boolean> -- !query output false @@ -605,7 +605,7 @@ false -- !query SELECT cast(1 as int) >= '2' FROM t -- !query schema -struct<(CAST(1 AS INT) >= CAST(2 AS INT)):boolean> +struct<(CAST(1 AS INT) >= 2):boolean> -- !query output false @@ -613,7 +613,7 @@ false -- !query SELECT cast(1 as int) < '2' FROM t -- !query schema -struct<(CAST(1 AS INT) < CAST(2 AS INT)):boolean> +struct<(CAST(1 AS INT) < 2):boolean> -- !query output true @@ -621,7 +621,7 @@ true -- !query SELECT cast(1 as int) <= '2' FROM t -- !query schema -struct<(CAST(1 AS INT) <= CAST(2 AS INT)):boolean> +struct<(CAST(1 AS INT) <= 2):boolean> -- !query output true @@ -629,7 +629,7 @@ true -- !query SELECT cast(1 as int) <> '2' FROM t -- !query schema -struct<(NOT (CAST(1 AS INT) = CAST(2 AS INT))):boolean> +struct<(NOT (CAST(1 AS INT) = 2)):boolean> -- !query output true @@ -637,7 +637,7 @@ true -- !query SELECT cast(1 as int) = cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS INT) = CAST(CAST(NULL AS STRING) AS INT)):boolean> +struct<(CAST(1 AS INT) = CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -645,7 +645,7 @@ NULL -- !query SELECT cast(1 as int) > cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS INT) > CAST(CAST(NULL AS STRING) AS INT)):boolean> +struct<(CAST(1 AS INT) > CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -653,7 +653,7 @@ NULL -- !query SELECT cast(1 as int) >= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS INT) >= CAST(CAST(NULL AS STRING) AS INT)):boolean> +struct<(CAST(1 AS INT) >= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -661,7 +661,7 @@ NULL -- !query SELECT cast(1 as int) < cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS INT) < CAST(CAST(NULL AS STRING) AS INT)):boolean> +struct<(CAST(1 AS INT) < CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -669,7 +669,7 @@ NULL -- !query SELECT cast(1 as int) <= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS INT) <= CAST(CAST(NULL AS STRING) AS INT)):boolean> +struct<(CAST(1 AS INT) <= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -677,7 +677,7 @@ NULL -- !query SELECT cast(1 as int) <> cast(null as string) FROM t -- !query schema -struct<(NOT (CAST(1 AS INT) = CAST(CAST(NULL AS STRING) AS INT))):boolean> +struct<(NOT (CAST(1 AS INT) = CAST(NULL AS STRING))):boolean> -- !query output NULL @@ -685,7 +685,7 @@ NULL -- !query SELECT '1' = cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS INT) = CAST(1 AS INT)):boolean> +struct<(1 = CAST(1 AS INT)):boolean> -- !query output true @@ -693,7 +693,7 @@ true -- !query SELECT '2' > cast(1 as int) FROM t -- !query schema -struct<(CAST(2 AS INT) > CAST(1 AS INT)):boolean> +struct<(2 > CAST(1 AS INT)):boolean> -- !query output true @@ -701,7 +701,7 @@ true -- !query SELECT '2' >= cast(1 as int) FROM t -- !query schema -struct<(CAST(2 AS INT) >= CAST(1 AS INT)):boolean> +struct<(2 >= CAST(1 AS INT)):boolean> -- !query output true @@ -709,7 +709,7 @@ true -- !query SELECT '2' < cast(1 as int) FROM t -- !query schema -struct<(CAST(2 AS INT) < CAST(1 AS INT)):boolean> +struct<(2 < CAST(1 AS INT)):boolean> -- !query output false @@ -717,7 +717,7 @@ false -- !query SELECT '2' <> cast(1 as int) FROM t -- !query schema -struct<(NOT (CAST(2 AS INT) = CAST(1 AS INT))):boolean> +struct<(NOT (2 = CAST(1 AS INT))):boolean> -- !query output true @@ -725,7 +725,7 @@ true -- !query SELECT '2' <= cast(1 as int) FROM t -- !query schema -struct<(CAST(2 AS INT) <= CAST(1 AS INT)):boolean> +struct<(2 <= CAST(1 AS INT)):boolean> -- !query output false @@ -733,7 +733,7 @@ false -- !query SELECT cast(null as string) = cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS INT) = CAST(1 AS INT)):boolean> +struct<(CAST(NULL AS STRING) = CAST(1 AS INT)):boolean> -- !query output NULL @@ -741,7 +741,7 @@ NULL -- !query SELECT cast(null as string) > cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS INT) > CAST(1 AS INT)):boolean> +struct<(CAST(NULL AS STRING) > CAST(1 AS INT)):boolean> -- !query output NULL @@ -749,7 +749,7 @@ NULL -- !query SELECT cast(null as string) >= cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS INT) >= CAST(1 AS INT)):boolean> +struct<(CAST(NULL AS STRING) >= CAST(1 AS INT)):boolean> -- !query output NULL @@ -757,7 +757,7 @@ NULL -- !query SELECT cast(null as string) < cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS INT) < CAST(1 AS INT)):boolean> +struct<(CAST(NULL AS STRING) < CAST(1 AS INT)):boolean> -- !query output NULL @@ -765,7 +765,7 @@ NULL -- !query SELECT cast(null as string) <> cast(1 as int) FROM t -- !query schema -struct<(NOT (CAST(CAST(NULL AS STRING) AS INT) = CAST(1 AS INT))):boolean> +struct<(NOT (CAST(NULL AS STRING) = CAST(1 AS INT))):boolean> -- !query output NULL @@ -773,7 +773,7 @@ NULL -- !query SELECT cast(null as string) <= cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS INT) <= CAST(1 AS INT)):boolean> +struct<(CAST(NULL AS STRING) <= CAST(1 AS INT)):boolean> -- !query output NULL @@ -781,7 +781,7 @@ NULL -- !query SELECT cast(1 as bigint) = '1' FROM t -- !query schema -struct<(CAST(1 AS BIGINT) = CAST(1 AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) = 1):boolean> -- !query output true @@ -789,7 +789,7 @@ true -- !query SELECT cast(1 as bigint) > '2' FROM t -- !query schema -struct<(CAST(1 AS BIGINT) > CAST(2 AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) > 2):boolean> -- !query output false @@ -797,7 +797,7 @@ false -- !query SELECT cast(1 as bigint) >= '2' FROM t -- !query schema -struct<(CAST(1 AS BIGINT) >= CAST(2 AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) >= 2):boolean> -- !query output false @@ -805,7 +805,7 @@ false -- !query SELECT cast(1 as bigint) < '2' FROM t -- !query schema -struct<(CAST(1 AS BIGINT) < CAST(2 AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) < 2):boolean> -- !query output true @@ -813,7 +813,7 @@ true -- !query SELECT cast(1 as bigint) <= '2' FROM t -- !query schema -struct<(CAST(1 AS BIGINT) <= CAST(2 AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) <= 2):boolean> -- !query output true @@ -821,7 +821,7 @@ true -- !query SELECT cast(1 as bigint) <> '2' FROM t -- !query schema -struct<(NOT (CAST(1 AS BIGINT) = CAST(2 AS BIGINT))):boolean> +struct<(NOT (CAST(1 AS BIGINT) = 2)):boolean> -- !query output true @@ -829,7 +829,7 @@ true -- !query SELECT cast(1 as bigint) = cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS BIGINT) = CAST(CAST(NULL AS STRING) AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) = CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -837,7 +837,7 @@ NULL -- !query SELECT cast(1 as bigint) > cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS BIGINT) > CAST(CAST(NULL AS STRING) AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) > CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -845,7 +845,7 @@ NULL -- !query SELECT cast(1 as bigint) >= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS BIGINT) >= CAST(CAST(NULL AS STRING) AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) >= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -853,7 +853,7 @@ NULL -- !query SELECT cast(1 as bigint) < cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS BIGINT) < CAST(CAST(NULL AS STRING) AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) < CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -861,7 +861,7 @@ NULL -- !query SELECT cast(1 as bigint) <= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS BIGINT) <= CAST(CAST(NULL AS STRING) AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) <= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -869,7 +869,7 @@ NULL -- !query SELECT cast(1 as bigint) <> cast(null as string) FROM t -- !query schema -struct<(NOT (CAST(1 AS BIGINT) = CAST(CAST(NULL AS STRING) AS BIGINT))):boolean> +struct<(NOT (CAST(1 AS BIGINT) = CAST(NULL AS STRING))):boolean> -- !query output NULL @@ -877,7 +877,7 @@ NULL -- !query SELECT '1' = cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS BIGINT) = CAST(1 AS BIGINT)):boolean> +struct<(1 = CAST(1 AS BIGINT)):boolean> -- !query output true @@ -885,7 +885,7 @@ true -- !query SELECT '2' > cast(1 as bigint) FROM t -- !query schema -struct<(CAST(2 AS BIGINT) > CAST(1 AS BIGINT)):boolean> +struct<(2 > CAST(1 AS BIGINT)):boolean> -- !query output true @@ -893,7 +893,7 @@ true -- !query SELECT '2' >= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(2 AS BIGINT) >= CAST(1 AS BIGINT)):boolean> +struct<(2 >= CAST(1 AS BIGINT)):boolean> -- !query output true @@ -901,7 +901,7 @@ true -- !query SELECT '2' < cast(1 as bigint) FROM t -- !query schema -struct<(CAST(2 AS BIGINT) < CAST(1 AS BIGINT)):boolean> +struct<(2 < CAST(1 AS BIGINT)):boolean> -- !query output false @@ -909,7 +909,7 @@ false -- !query SELECT '2' <= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(2 AS BIGINT) <= CAST(1 AS BIGINT)):boolean> +struct<(2 <= CAST(1 AS BIGINT)):boolean> -- !query output false @@ -917,7 +917,7 @@ false -- !query SELECT '2' <> cast(1 as bigint) FROM t -- !query schema -struct<(NOT (CAST(2 AS BIGINT) = CAST(1 AS BIGINT))):boolean> +struct<(NOT (2 = CAST(1 AS BIGINT))):boolean> -- !query output true @@ -925,7 +925,7 @@ true -- !query SELECT cast(null as string) = cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BIGINT) = CAST(1 AS BIGINT)):boolean> +struct<(CAST(NULL AS STRING) = CAST(1 AS BIGINT)):boolean> -- !query output NULL @@ -933,7 +933,7 @@ NULL -- !query SELECT cast(null as string) > cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BIGINT) > CAST(1 AS BIGINT)):boolean> +struct<(CAST(NULL AS STRING) > CAST(1 AS BIGINT)):boolean> -- !query output NULL @@ -941,7 +941,7 @@ NULL -- !query SELECT cast(null as string) >= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BIGINT) >= CAST(1 AS BIGINT)):boolean> +struct<(CAST(NULL AS STRING) >= CAST(1 AS BIGINT)):boolean> -- !query output NULL @@ -949,7 +949,7 @@ NULL -- !query SELECT cast(null as string) < cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BIGINT) < CAST(1 AS BIGINT)):boolean> +struct<(CAST(NULL AS STRING) < CAST(1 AS BIGINT)):boolean> -- !query output NULL @@ -957,7 +957,7 @@ NULL -- !query SELECT cast(null as string) <= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BIGINT) <= CAST(1 AS BIGINT)):boolean> +struct<(CAST(NULL AS STRING) <= CAST(1 AS BIGINT)):boolean> -- !query output NULL @@ -965,7 +965,7 @@ NULL -- !query SELECT cast(null as string) <> cast(1 as bigint) FROM t -- !query schema -struct<(NOT (CAST(CAST(NULL AS STRING) AS BIGINT) = CAST(1 AS BIGINT))):boolean> +struct<(NOT (CAST(NULL AS STRING) = CAST(1 AS BIGINT))):boolean> -- !query output NULL @@ -973,7 +973,7 @@ NULL -- !query SELECT cast(1 as decimal(10, 0)) = '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = 1):boolean> -- !query output true @@ -981,7 +981,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) > '2' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) > CAST(2 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > 2):boolean> -- !query output false @@ -989,7 +989,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) >= '2' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) >= CAST(2 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= 2):boolean> -- !query output false @@ -997,7 +997,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) < '2' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) < CAST(2 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < 2):boolean> -- !query output true @@ -1005,7 +1005,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <> '2' FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) = CAST(2 AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = 2)):boolean> -- !query output true @@ -1013,7 +1013,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <= '2' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) <= CAST(2 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= 2):boolean> -- !query output true @@ -1021,7 +1021,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = cast(null as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) = CAST(CAST(NULL AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1029,7 +1029,7 @@ NULL -- !query SELECT cast(1 as decimal(10, 0)) > cast(null as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) > CAST(CAST(NULL AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1037,7 +1037,7 @@ NULL -- !query SELECT cast(1 as decimal(10, 0)) >= cast(null as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) >= CAST(CAST(NULL AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1045,7 +1045,7 @@ NULL -- !query SELECT cast(1 as decimal(10, 0)) < cast(null as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) < CAST(CAST(NULL AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1053,7 +1053,7 @@ NULL -- !query SELECT cast(1 as decimal(10, 0)) <> cast(null as string) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) = CAST(CAST(NULL AS STRING) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(NULL AS STRING))):boolean> -- !query output NULL @@ -1061,7 +1061,7 @@ NULL -- !query SELECT cast(1 as decimal(10, 0)) <= cast(null as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) <= CAST(CAST(NULL AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1069,7 +1069,7 @@ NULL -- !query SELECT '1' = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) = CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(1 = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -1077,7 +1077,7 @@ true -- !query SELECT '2' > cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(2 AS DOUBLE) > CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(2 > CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -1085,7 +1085,7 @@ true -- !query SELECT '2' >= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(2 AS DOUBLE) >= CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(2 >= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -1093,7 +1093,7 @@ true -- !query SELECT '2' < cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(2 AS DOUBLE) < CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(2 < CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -1101,7 +1101,7 @@ false -- !query SELECT '2' <= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(2 AS DOUBLE) <= CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(2 <= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -1109,7 +1109,7 @@ false -- !query SELECT '2' <> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(NOT (CAST(2 AS DOUBLE) = CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE))):boolean> +struct<(NOT (2 = CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -1117,7 +1117,7 @@ true -- !query SELECT cast(null as string) = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DOUBLE) = CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(NULL AS STRING) = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output NULL @@ -1125,7 +1125,7 @@ NULL -- !query SELECT cast(null as string) > cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DOUBLE) > CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(NULL AS STRING) > CAST(1 AS DECIMAL(10,0))):boolean> -- !query output NULL @@ -1133,7 +1133,7 @@ NULL -- !query SELECT cast(null as string) >= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DOUBLE) >= CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(NULL AS STRING) >= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output NULL @@ -1141,7 +1141,7 @@ NULL -- !query SELECT cast(null as string) < cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DOUBLE) < CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(NULL AS STRING) < CAST(1 AS DECIMAL(10,0))):boolean> -- !query output NULL @@ -1149,7 +1149,7 @@ NULL -- !query SELECT cast(null as string) <= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DOUBLE) <= CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(NULL AS STRING) <= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output NULL @@ -1157,7 +1157,7 @@ NULL -- !query SELECT cast(null as string) <> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(NULL AS STRING) AS DOUBLE) = CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE))):boolean> +struct<(NOT (CAST(NULL AS STRING) = CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output NULL @@ -1165,7 +1165,7 @@ NULL -- !query SELECT cast(1 as double) = '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) = 1):boolean> -- !query output true @@ -1173,7 +1173,7 @@ true -- !query SELECT cast(1 as double) > '2' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) > CAST(2 AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) > 2):boolean> -- !query output false @@ -1181,7 +1181,7 @@ false -- !query SELECT cast(1 as double) >= '2' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) >= CAST(2 AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) >= 2):boolean> -- !query output false @@ -1189,7 +1189,7 @@ false -- !query SELECT cast(1 as double) < '2' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) < CAST(2 AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) < 2):boolean> -- !query output true @@ -1197,7 +1197,7 @@ true -- !query SELECT cast(1 as double) <= '2' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <= CAST(2 AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <= 2):boolean> -- !query output true @@ -1205,7 +1205,7 @@ true -- !query SELECT cast(1 as double) <> '2' FROM t -- !query schema -struct<(NOT (CAST(1 AS DOUBLE) = CAST(2 AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DOUBLE) = 2)):boolean> -- !query output true @@ -1213,7 +1213,7 @@ true -- !query SELECT cast(1 as double) = cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) = CAST(CAST(NULL AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) = CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1221,7 +1221,7 @@ NULL -- !query SELECT cast(1 as double) > cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) > CAST(CAST(NULL AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) > CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1229,7 +1229,7 @@ NULL -- !query SELECT cast(1 as double) >= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) >= CAST(CAST(NULL AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) >= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1237,7 +1237,7 @@ NULL -- !query SELECT cast(1 as double) < cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) < CAST(CAST(NULL AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) < CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1245,7 +1245,7 @@ NULL -- !query SELECT cast(1 as double) <= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <= CAST(CAST(NULL AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1253,7 +1253,7 @@ NULL -- !query SELECT cast(1 as double) <> cast(null as string) FROM t -- !query schema -struct<(NOT (CAST(1 AS DOUBLE) = CAST(CAST(NULL AS STRING) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DOUBLE) = CAST(NULL AS STRING))):boolean> -- !query output NULL @@ -1261,7 +1261,7 @@ NULL -- !query SELECT '1' = cast(1 as double) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(1 = CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -1269,7 +1269,7 @@ true -- !query SELECT '2' > cast(1 as double) FROM t -- !query schema -struct<(CAST(2 AS DOUBLE) > CAST(1 AS DOUBLE)):boolean> +struct<(2 > CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -1277,7 +1277,7 @@ true -- !query SELECT '2' >= cast(1 as double) FROM t -- !query schema -struct<(CAST(2 AS DOUBLE) >= CAST(1 AS DOUBLE)):boolean> +struct<(2 >= CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -1285,7 +1285,7 @@ true -- !query SELECT '2' < cast(1 as double) FROM t -- !query schema -struct<(CAST(2 AS DOUBLE) < CAST(1 AS DOUBLE)):boolean> +struct<(2 < CAST(1 AS DOUBLE)):boolean> -- !query output false @@ -1293,7 +1293,7 @@ false -- !query SELECT '2' <= cast(1 as double) FROM t -- !query schema -struct<(CAST(2 AS DOUBLE) <= CAST(1 AS DOUBLE)):boolean> +struct<(2 <= CAST(1 AS DOUBLE)):boolean> -- !query output false @@ -1301,7 +1301,7 @@ false -- !query SELECT '2' <> cast(1 as double) FROM t -- !query schema -struct<(NOT (CAST(2 AS DOUBLE) = CAST(1 AS DOUBLE))):boolean> +struct<(NOT (2 = CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -1309,7 +1309,7 @@ true -- !query SELECT cast(null as string) = cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(CAST(NULL AS STRING) = CAST(1 AS DOUBLE)):boolean> -- !query output NULL @@ -1317,7 +1317,7 @@ NULL -- !query SELECT cast(null as string) > cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DOUBLE) > CAST(1 AS DOUBLE)):boolean> +struct<(CAST(NULL AS STRING) > CAST(1 AS DOUBLE)):boolean> -- !query output NULL @@ -1325,7 +1325,7 @@ NULL -- !query SELECT cast(null as string) >= cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DOUBLE) >= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(NULL AS STRING) >= CAST(1 AS DOUBLE)):boolean> -- !query output NULL @@ -1333,7 +1333,7 @@ NULL -- !query SELECT cast(null as string) < cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DOUBLE) < CAST(1 AS DOUBLE)):boolean> +struct<(CAST(NULL AS STRING) < CAST(1 AS DOUBLE)):boolean> -- !query output NULL @@ -1341,7 +1341,7 @@ NULL -- !query SELECT cast(null as string) <= cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DOUBLE) <= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(NULL AS STRING) <= CAST(1 AS DOUBLE)):boolean> -- !query output NULL @@ -1349,7 +1349,7 @@ NULL -- !query SELECT cast(null as string) <> cast(1 as double) FROM t -- !query schema -struct<(NOT (CAST(CAST(NULL AS STRING) AS DOUBLE) = CAST(1 AS DOUBLE))):boolean> +struct<(NOT (CAST(NULL AS STRING) = CAST(1 AS DOUBLE))):boolean> -- !query output NULL @@ -1357,7 +1357,7 @@ NULL -- !query SELECT cast(1 as float) = '1' FROM t -- !query schema -struct<(CAST(1 AS FLOAT) = CAST(1 AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) = 1):boolean> -- !query output true @@ -1365,7 +1365,7 @@ true -- !query SELECT cast(1 as float) > '2' FROM t -- !query schema -struct<(CAST(1 AS FLOAT) > CAST(2 AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) > 2):boolean> -- !query output false @@ -1373,7 +1373,7 @@ false -- !query SELECT cast(1 as float) >= '2' FROM t -- !query schema -struct<(CAST(1 AS FLOAT) >= CAST(2 AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) >= 2):boolean> -- !query output false @@ -1381,7 +1381,7 @@ false -- !query SELECT cast(1 as float) < '2' FROM t -- !query schema -struct<(CAST(1 AS FLOAT) < CAST(2 AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) < 2):boolean> -- !query output true @@ -1389,7 +1389,7 @@ true -- !query SELECT cast(1 as float) <= '2' FROM t -- !query schema -struct<(CAST(1 AS FLOAT) <= CAST(2 AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) <= 2):boolean> -- !query output true @@ -1397,7 +1397,7 @@ true -- !query SELECT cast(1 as float) <> '2' FROM t -- !query schema -struct<(NOT (CAST(1 AS FLOAT) = CAST(2 AS FLOAT))):boolean> +struct<(NOT (CAST(1 AS FLOAT) = 2)):boolean> -- !query output true @@ -1405,7 +1405,7 @@ true -- !query SELECT cast(1 as float) = cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS FLOAT) = CAST(CAST(NULL AS STRING) AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) = CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1413,7 +1413,7 @@ NULL -- !query SELECT cast(1 as float) > cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS FLOAT) > CAST(CAST(NULL AS STRING) AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) > CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1421,7 +1421,7 @@ NULL -- !query SELECT cast(1 as float) >= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS FLOAT) >= CAST(CAST(NULL AS STRING) AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) >= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1429,7 +1429,7 @@ NULL -- !query SELECT cast(1 as float) < cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS FLOAT) < CAST(CAST(NULL AS STRING) AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) < CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1437,7 +1437,7 @@ NULL -- !query SELECT cast(1 as float) <= cast(null as string) FROM t -- !query schema -struct<(CAST(1 AS FLOAT) <= CAST(CAST(NULL AS STRING) AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) <= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1445,7 +1445,7 @@ NULL -- !query SELECT cast(1 as float) <> cast(null as string) FROM t -- !query schema -struct<(NOT (CAST(1 AS FLOAT) = CAST(CAST(NULL AS STRING) AS FLOAT))):boolean> +struct<(NOT (CAST(1 AS FLOAT) = CAST(NULL AS STRING))):boolean> -- !query output NULL @@ -1453,7 +1453,7 @@ NULL -- !query SELECT '1' = cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS FLOAT) = CAST(1 AS FLOAT)):boolean> +struct<(1 = CAST(1 AS FLOAT)):boolean> -- !query output true @@ -1461,7 +1461,7 @@ true -- !query SELECT '2' > cast(1 as float) FROM t -- !query schema -struct<(CAST(2 AS FLOAT) > CAST(1 AS FLOAT)):boolean> +struct<(2 > CAST(1 AS FLOAT)):boolean> -- !query output true @@ -1469,7 +1469,7 @@ true -- !query SELECT '2' >= cast(1 as float) FROM t -- !query schema -struct<(CAST(2 AS FLOAT) >= CAST(1 AS FLOAT)):boolean> +struct<(2 >= CAST(1 AS FLOAT)):boolean> -- !query output true @@ -1477,7 +1477,7 @@ true -- !query SELECT '2' < cast(1 as float) FROM t -- !query schema -struct<(CAST(2 AS FLOAT) < CAST(1 AS FLOAT)):boolean> +struct<(2 < CAST(1 AS FLOAT)):boolean> -- !query output false @@ -1485,7 +1485,7 @@ false -- !query SELECT '2' <= cast(1 as float) FROM t -- !query schema -struct<(CAST(2 AS FLOAT) <= CAST(1 AS FLOAT)):boolean> +struct<(2 <= CAST(1 AS FLOAT)):boolean> -- !query output false @@ -1493,7 +1493,7 @@ false -- !query SELECT '2' <> cast(1 as float) FROM t -- !query schema -struct<(NOT (CAST(2 AS FLOAT) = CAST(1 AS FLOAT))):boolean> +struct<(NOT (2 = CAST(1 AS FLOAT))):boolean> -- !query output true @@ -1501,7 +1501,7 @@ true -- !query SELECT cast(null as string) = cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS FLOAT) = CAST(1 AS FLOAT)):boolean> +struct<(CAST(NULL AS STRING) = CAST(1 AS FLOAT)):boolean> -- !query output NULL @@ -1509,7 +1509,7 @@ NULL -- !query SELECT cast(null as string) > cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS FLOAT) > CAST(1 AS FLOAT)):boolean> +struct<(CAST(NULL AS STRING) > CAST(1 AS FLOAT)):boolean> -- !query output NULL @@ -1517,7 +1517,7 @@ NULL -- !query SELECT cast(null as string) >= cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS FLOAT) >= CAST(1 AS FLOAT)):boolean> +struct<(CAST(NULL AS STRING) >= CAST(1 AS FLOAT)):boolean> -- !query output NULL @@ -1525,7 +1525,7 @@ NULL -- !query SELECT cast(null as string) < cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS FLOAT) < CAST(1 AS FLOAT)):boolean> +struct<(CAST(NULL AS STRING) < CAST(1 AS FLOAT)):boolean> -- !query output NULL @@ -1533,7 +1533,7 @@ NULL -- !query SELECT cast(null as string) <= cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS FLOAT) <= CAST(1 AS FLOAT)):boolean> +struct<(CAST(NULL AS STRING) <= CAST(1 AS FLOAT)):boolean> -- !query output NULL @@ -1541,7 +1541,7 @@ NULL -- !query SELECT cast(null as string) <> cast(1 as float) FROM t -- !query schema -struct<(NOT (CAST(CAST(NULL AS STRING) AS FLOAT) = CAST(1 AS FLOAT))):boolean> +struct<(NOT (CAST(NULL AS STRING) = CAST(1 AS FLOAT))):boolean> -- !query output NULL @@ -1549,7 +1549,7 @@ NULL -- !query SELECT '1996-09-09' = date('1996-09-09') FROM t -- !query schema -struct<(CAST(1996-09-09 AS DATE) = CAST(1996-09-09 AS DATE)):boolean> +struct<(1996-09-09 = 1996-09-09):boolean> -- !query output true @@ -1557,7 +1557,7 @@ true -- !query SELECT '1996-9-10' > date('1996-09-09') FROM t -- !query schema -struct<(CAST(1996-9-10 AS DATE) > CAST(1996-09-09 AS DATE)):boolean> +struct<(1996-9-10 > 1996-09-09):boolean> -- !query output true @@ -1565,7 +1565,7 @@ true -- !query SELECT '1996-9-10' >= date('1996-09-09') FROM t -- !query schema -struct<(CAST(1996-9-10 AS DATE) >= CAST(1996-09-09 AS DATE)):boolean> +struct<(1996-9-10 >= 1996-09-09):boolean> -- !query output true @@ -1573,7 +1573,7 @@ true -- !query SELECT '1996-9-10' < date('1996-09-09') FROM t -- !query schema -struct<(CAST(1996-9-10 AS DATE) < CAST(1996-09-09 AS DATE)):boolean> +struct<(1996-9-10 < 1996-09-09):boolean> -- !query output false @@ -1581,7 +1581,7 @@ false -- !query SELECT '1996-9-10' <= date('1996-09-09') FROM t -- !query schema -struct<(CAST(1996-9-10 AS DATE) <= CAST(1996-09-09 AS DATE)):boolean> +struct<(1996-9-10 <= 1996-09-09):boolean> -- !query output false @@ -1589,7 +1589,7 @@ false -- !query SELECT '1996-9-10' <> date('1996-09-09') FROM t -- !query schema -struct<(NOT (CAST(1996-9-10 AS DATE) = CAST(1996-09-09 AS DATE))):boolean> +struct<(NOT (1996-9-10 = 1996-09-09)):boolean> -- !query output true @@ -1597,7 +1597,7 @@ true -- !query SELECT cast(null as string) = date('1996-09-09') FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DATE) = CAST(1996-09-09 AS DATE)):boolean> +struct<(CAST(NULL AS STRING) = 1996-09-09):boolean> -- !query output NULL @@ -1605,7 +1605,7 @@ NULL -- !query SELECT cast(null as string)> date('1996-09-09') FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DATE) > CAST(1996-09-09 AS DATE)):boolean> +struct<(CAST(NULL AS STRING) > 1996-09-09):boolean> -- !query output NULL @@ -1613,7 +1613,7 @@ NULL -- !query SELECT cast(null as string)>= date('1996-09-09') FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DATE) >= CAST(1996-09-09 AS DATE)):boolean> +struct<(CAST(NULL AS STRING) >= 1996-09-09):boolean> -- !query output NULL @@ -1621,7 +1621,7 @@ NULL -- !query SELECT cast(null as string)< date('1996-09-09') FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DATE) < CAST(1996-09-09 AS DATE)):boolean> +struct<(CAST(NULL AS STRING) < 1996-09-09):boolean> -- !query output NULL @@ -1629,7 +1629,7 @@ NULL -- !query SELECT cast(null as string)<= date('1996-09-09') FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS DATE) <= CAST(1996-09-09 AS DATE)):boolean> +struct<(CAST(NULL AS STRING) <= 1996-09-09):boolean> -- !query output NULL @@ -1637,7 +1637,7 @@ NULL -- !query SELECT cast(null as string)<> date('1996-09-09') FROM t -- !query schema -struct<(NOT (CAST(CAST(NULL AS STRING) AS DATE) = CAST(1996-09-09 AS DATE))):boolean> +struct<(NOT (CAST(NULL AS STRING) = 1996-09-09)):boolean> -- !query output NULL @@ -1645,7 +1645,7 @@ NULL -- !query SELECT date('1996-09-09') = '1996-09-09' FROM t -- !query schema -struct<(CAST(1996-09-09 AS DATE) = CAST(1996-09-09 AS DATE)):boolean> +struct<(1996-09-09 = 1996-09-09):boolean> -- !query output true @@ -1653,7 +1653,7 @@ true -- !query SELECT date('1996-9-10') > '1996-09-09' FROM t -- !query schema -struct<(CAST(1996-9-10 AS DATE) > CAST(1996-09-09 AS DATE)):boolean> +struct<(1996-9-10 > 1996-09-09):boolean> -- !query output true @@ -1661,7 +1661,7 @@ true -- !query SELECT date('1996-9-10') >= '1996-09-09' FROM t -- !query schema -struct<(CAST(1996-9-10 AS DATE) >= CAST(1996-09-09 AS DATE)):boolean> +struct<(1996-9-10 >= 1996-09-09):boolean> -- !query output true @@ -1669,7 +1669,7 @@ true -- !query SELECT date('1996-9-10') < '1996-09-09' FROM t -- !query schema -struct<(CAST(1996-9-10 AS DATE) < CAST(1996-09-09 AS DATE)):boolean> +struct<(1996-9-10 < 1996-09-09):boolean> -- !query output false @@ -1677,7 +1677,7 @@ false -- !query SELECT date('1996-9-10') <= '1996-09-09' FROM t -- !query schema -struct<(CAST(1996-9-10 AS DATE) <= CAST(1996-09-09 AS DATE)):boolean> +struct<(1996-9-10 <= 1996-09-09):boolean> -- !query output false @@ -1685,7 +1685,7 @@ false -- !query SELECT date('1996-9-10') <> '1996-09-09' FROM t -- !query schema -struct<(NOT (CAST(1996-9-10 AS DATE) = CAST(1996-09-09 AS DATE))):boolean> +struct<(NOT (1996-9-10 = 1996-09-09)):boolean> -- !query output true @@ -1693,7 +1693,7 @@ true -- !query SELECT date('1996-09-09') = cast(null as string) FROM t -- !query schema -struct<(CAST(1996-09-09 AS DATE) = CAST(CAST(NULL AS STRING) AS DATE)):boolean> +struct<(1996-09-09 = CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1701,7 +1701,7 @@ NULL -- !query SELECT date('1996-9-10') > cast(null as string) FROM t -- !query schema -struct<(CAST(1996-9-10 AS DATE) > CAST(CAST(NULL AS STRING) AS DATE)):boolean> +struct<(1996-9-10 > CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1709,7 +1709,7 @@ NULL -- !query SELECT date('1996-9-10') >= cast(null as string) FROM t -- !query schema -struct<(CAST(1996-9-10 AS DATE) >= CAST(CAST(NULL AS STRING) AS DATE)):boolean> +struct<(1996-9-10 >= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1717,7 +1717,7 @@ NULL -- !query SELECT date('1996-9-10') < cast(null as string) FROM t -- !query schema -struct<(CAST(1996-9-10 AS DATE) < CAST(CAST(NULL AS STRING) AS DATE)):boolean> +struct<(1996-9-10 < CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1725,7 +1725,7 @@ NULL -- !query SELECT date('1996-9-10') <= cast(null as string) FROM t -- !query schema -struct<(CAST(1996-9-10 AS DATE) <= CAST(CAST(NULL AS STRING) AS DATE)):boolean> +struct<(1996-9-10 <= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1733,7 +1733,7 @@ NULL -- !query SELECT date('1996-9-10') <> cast(null as string) FROM t -- !query schema -struct<(NOT (CAST(1996-9-10 AS DATE) = CAST(CAST(NULL AS STRING) AS DATE))):boolean> +struct<(NOT (1996-9-10 = CAST(NULL AS STRING))):boolean> -- !query output NULL @@ -1741,7 +1741,7 @@ NULL -- !query SELECT '1996-09-09 12:12:12.4' = timestamp('1996-09-09 12:12:12.4') FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.4 AS TIMESTAMP) = CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.4 = 1996-09-09 12:12:12.4):boolean> -- !query output true @@ -1749,7 +1749,7 @@ true -- !query SELECT '1996-09-09 12:12:12.5' > timestamp('1996-09-09 12:12:12.4') FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) > CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.5 > 1996-09-09 12:12:12.4):boolean> -- !query output true @@ -1757,7 +1757,7 @@ true -- !query SELECT '1996-09-09 12:12:12.5' >= timestamp('1996-09-09 12:12:12.4') FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) >= CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.5 >= 1996-09-09 12:12:12.4):boolean> -- !query output true @@ -1765,7 +1765,7 @@ true -- !query SELECT '1996-09-09 12:12:12.5' < timestamp('1996-09-09 12:12:12.4') FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) < CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.5 < 1996-09-09 12:12:12.4):boolean> -- !query output false @@ -1773,7 +1773,7 @@ false -- !query SELECT '1996-09-09 12:12:12.5' <= timestamp('1996-09-09 12:12:12.4') FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) <= CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.5 <= 1996-09-09 12:12:12.4):boolean> -- !query output false @@ -1781,7 +1781,7 @@ false -- !query SELECT '1996-09-09 12:12:12.5' <> timestamp('1996-09-09 12:12:12.4') FROM t -- !query schema -struct<(NOT (CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) = CAST(1996-09-09 12:12:12.4 AS TIMESTAMP))):boolean> +struct<(NOT (1996-09-09 12:12:12.5 = 1996-09-09 12:12:12.4)):boolean> -- !query output true @@ -1789,7 +1789,7 @@ true -- !query SELECT cast(null as string) = timestamp('1996-09-09 12:12:12.4') FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS TIMESTAMP) = CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(CAST(NULL AS STRING) = 1996-09-09 12:12:12.4):boolean> -- !query output NULL @@ -1797,7 +1797,7 @@ NULL -- !query SELECT cast(null as string) > timestamp('1996-09-09 12:12:12.4') FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS TIMESTAMP) > CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(CAST(NULL AS STRING) > 1996-09-09 12:12:12.4):boolean> -- !query output NULL @@ -1805,7 +1805,7 @@ NULL -- !query SELECT cast(null as string) >= timestamp('1996-09-09 12:12:12.4') FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS TIMESTAMP) >= CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(CAST(NULL AS STRING) >= 1996-09-09 12:12:12.4):boolean> -- !query output NULL @@ -1813,7 +1813,7 @@ NULL -- !query SELECT cast(null as string) < timestamp('1996-09-09 12:12:12.4') FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS TIMESTAMP) < CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(CAST(NULL AS STRING) < 1996-09-09 12:12:12.4):boolean> -- !query output NULL @@ -1821,7 +1821,7 @@ NULL -- !query SELECT cast(null as string) <= timestamp('1996-09-09 12:12:12.4') FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS TIMESTAMP) <= CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(CAST(NULL AS STRING) <= 1996-09-09 12:12:12.4):boolean> -- !query output NULL @@ -1829,7 +1829,7 @@ NULL -- !query SELECT cast(null as string) <> timestamp('1996-09-09 12:12:12.4') FROM t -- !query schema -struct<(NOT (CAST(CAST(NULL AS STRING) AS TIMESTAMP) = CAST(1996-09-09 12:12:12.4 AS TIMESTAMP))):boolean> +struct<(NOT (CAST(NULL AS STRING) = 1996-09-09 12:12:12.4)):boolean> -- !query output NULL @@ -1837,7 +1837,7 @@ NULL -- !query SELECT timestamp('1996-09-09 12:12:12.4' )= '1996-09-09 12:12:12.4' FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.4 AS TIMESTAMP) = CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.4 = 1996-09-09 12:12:12.4):boolean> -- !query output true @@ -1845,7 +1845,7 @@ true -- !query SELECT timestamp('1996-09-09 12:12:12.5' )> '1996-09-09 12:12:12.4' FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) > CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.5 > 1996-09-09 12:12:12.4):boolean> -- !query output true @@ -1853,7 +1853,7 @@ true -- !query SELECT timestamp('1996-09-09 12:12:12.5' )>= '1996-09-09 12:12:12.4' FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) >= CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.5 >= 1996-09-09 12:12:12.4):boolean> -- !query output true @@ -1861,7 +1861,7 @@ true -- !query SELECT timestamp('1996-09-09 12:12:12.5' )< '1996-09-09 12:12:12.4' FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) < CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.5 < 1996-09-09 12:12:12.4):boolean> -- !query output false @@ -1869,7 +1869,7 @@ false -- !query SELECT timestamp('1996-09-09 12:12:12.5' )<= '1996-09-09 12:12:12.4' FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) <= CAST(1996-09-09 12:12:12.4 AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.5 <= 1996-09-09 12:12:12.4):boolean> -- !query output false @@ -1877,7 +1877,7 @@ false -- !query SELECT timestamp('1996-09-09 12:12:12.5' )<> '1996-09-09 12:12:12.4' FROM t -- !query schema -struct<(NOT (CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) = CAST(1996-09-09 12:12:12.4 AS TIMESTAMP))):boolean> +struct<(NOT (1996-09-09 12:12:12.5 = 1996-09-09 12:12:12.4)):boolean> -- !query output true @@ -1885,7 +1885,7 @@ true -- !query SELECT timestamp('1996-09-09 12:12:12.4' )= cast(null as string) FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.4 AS TIMESTAMP) = CAST(CAST(NULL AS STRING) AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.4 = CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1893,7 +1893,7 @@ NULL -- !query SELECT timestamp('1996-09-09 12:12:12.5' )> cast(null as string) FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) > CAST(CAST(NULL AS STRING) AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.5 > CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1901,7 +1901,7 @@ NULL -- !query SELECT timestamp('1996-09-09 12:12:12.5' )>= cast(null as string) FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) >= CAST(CAST(NULL AS STRING) AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.5 >= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1909,7 +1909,7 @@ NULL -- !query SELECT timestamp('1996-09-09 12:12:12.5' )< cast(null as string) FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) < CAST(CAST(NULL AS STRING) AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.5 < CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1917,7 +1917,7 @@ NULL -- !query SELECT timestamp('1996-09-09 12:12:12.5' )<= cast(null as string) FROM t -- !query schema -struct<(CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) <= CAST(CAST(NULL AS STRING) AS TIMESTAMP)):boolean> +struct<(1996-09-09 12:12:12.5 <= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -1925,7 +1925,7 @@ NULL -- !query SELECT timestamp('1996-09-09 12:12:12.5' )<> cast(null as string) FROM t -- !query schema -struct<(NOT (CAST(1996-09-09 12:12:12.5 AS TIMESTAMP) = CAST(CAST(NULL AS STRING) AS TIMESTAMP))):boolean> +struct<(NOT (1996-09-09 12:12:12.5 = CAST(NULL AS STRING))):boolean> -- !query output NULL @@ -1933,7 +1933,7 @@ NULL -- !query SELECT ' ' = X'0020' FROM t -- !query schema -struct<(CAST( AS BINARY) = X'0020'):boolean> +struct<( = X'0020'):boolean> -- !query output false @@ -1941,7 +1941,7 @@ false -- !query SELECT ' ' > X'001F' FROM t -- !query schema -struct<(CAST( AS BINARY) > X'001F'):boolean> +struct<( > X'001F'):boolean> -- !query output true @@ -1949,7 +1949,7 @@ true -- !query SELECT ' ' >= X'001F' FROM t -- !query schema -struct<(CAST( AS BINARY) >= X'001F'):boolean> +struct<( >= X'001F'):boolean> -- !query output true @@ -1957,7 +1957,7 @@ true -- !query SELECT ' ' < X'001F' FROM t -- !query schema -struct<(CAST( AS BINARY) < X'001F'):boolean> +struct<( < X'001F'):boolean> -- !query output false @@ -1965,7 +1965,7 @@ false -- !query SELECT ' ' <= X'001F' FROM t -- !query schema -struct<(CAST( AS BINARY) <= X'001F'):boolean> +struct<( <= X'001F'):boolean> -- !query output false @@ -1973,7 +1973,7 @@ false -- !query SELECT ' ' <> X'001F' FROM t -- !query schema -struct<(NOT (CAST( AS BINARY) = X'001F')):boolean> +struct<(NOT ( = X'001F')):boolean> -- !query output true @@ -1981,7 +1981,7 @@ true -- !query SELECT cast(null as string) = X'0020' FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BINARY) = X'0020'):boolean> +struct<(CAST(NULL AS STRING) = X'0020'):boolean> -- !query output NULL @@ -1989,7 +1989,7 @@ NULL -- !query SELECT cast(null as string) > X'001F' FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BINARY) > X'001F'):boolean> +struct<(CAST(NULL AS STRING) > X'001F'):boolean> -- !query output NULL @@ -1997,7 +1997,7 @@ NULL -- !query SELECT cast(null as string) >= X'001F' FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BINARY) >= X'001F'):boolean> +struct<(CAST(NULL AS STRING) >= X'001F'):boolean> -- !query output NULL @@ -2005,7 +2005,7 @@ NULL -- !query SELECT cast(null as string) < X'001F' FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BINARY) < X'001F'):boolean> +struct<(CAST(NULL AS STRING) < X'001F'):boolean> -- !query output NULL @@ -2013,7 +2013,7 @@ NULL -- !query SELECT cast(null as string) <= X'001F' FROM t -- !query schema -struct<(CAST(CAST(NULL AS STRING) AS BINARY) <= X'001F'):boolean> +struct<(CAST(NULL AS STRING) <= X'001F'):boolean> -- !query output NULL @@ -2021,7 +2021,7 @@ NULL -- !query SELECT cast(null as string) <> X'001F' FROM t -- !query schema -struct<(NOT (CAST(CAST(NULL AS STRING) AS BINARY) = X'001F')):boolean> +struct<(NOT (CAST(NULL AS STRING) = X'001F')):boolean> -- !query output NULL @@ -2029,7 +2029,7 @@ NULL -- !query SELECT X'0020' = ' ' FROM t -- !query schema -struct<(X'0020' = CAST( AS BINARY)):boolean> +struct<(X'0020' = ):boolean> -- !query output false @@ -2037,7 +2037,7 @@ false -- !query SELECT X'001F' > ' ' FROM t -- !query schema -struct<(X'001F' > CAST( AS BINARY)):boolean> +struct<(X'001F' > ):boolean> -- !query output false @@ -2045,7 +2045,7 @@ false -- !query SELECT X'001F' >= ' ' FROM t -- !query schema -struct<(X'001F' >= CAST( AS BINARY)):boolean> +struct<(X'001F' >= ):boolean> -- !query output false @@ -2053,7 +2053,7 @@ false -- !query SELECT X'001F' < ' ' FROM t -- !query schema -struct<(X'001F' < CAST( AS BINARY)):boolean> +struct<(X'001F' < ):boolean> -- !query output true @@ -2061,7 +2061,7 @@ true -- !query SELECT X'001F' <= ' ' FROM t -- !query schema -struct<(X'001F' <= CAST( AS BINARY)):boolean> +struct<(X'001F' <= ):boolean> -- !query output true @@ -2069,7 +2069,7 @@ true -- !query SELECT X'001F' <> ' ' FROM t -- !query schema -struct<(NOT (X'001F' = CAST( AS BINARY))):boolean> +struct<(NOT (X'001F' = )):boolean> -- !query output true @@ -2077,7 +2077,7 @@ true -- !query SELECT X'0020' = cast(null as string) FROM t -- !query schema -struct<(X'0020' = CAST(CAST(NULL AS STRING) AS BINARY)):boolean> +struct<(X'0020' = CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -2085,7 +2085,7 @@ NULL -- !query SELECT X'001F' > cast(null as string) FROM t -- !query schema -struct<(X'001F' > CAST(CAST(NULL AS STRING) AS BINARY)):boolean> +struct<(X'001F' > CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -2093,7 +2093,7 @@ NULL -- !query SELECT X'001F' >= cast(null as string) FROM t -- !query schema -struct<(X'001F' >= CAST(CAST(NULL AS STRING) AS BINARY)):boolean> +struct<(X'001F' >= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -2101,7 +2101,7 @@ NULL -- !query SELECT X'001F' < cast(null as string) FROM t -- !query schema -struct<(X'001F' < CAST(CAST(NULL AS STRING) AS BINARY)):boolean> +struct<(X'001F' < CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -2109,7 +2109,7 @@ NULL -- !query SELECT X'001F' <= cast(null as string) FROM t -- !query schema -struct<(X'001F' <= CAST(CAST(NULL AS STRING) AS BINARY)):boolean> +struct<(X'001F' <= CAST(NULL AS STRING)):boolean> -- !query output NULL @@ -2117,6 +2117,6 @@ NULL -- !query SELECT X'001F' <> cast(null as string) FROM t -- !query schema -struct<(NOT (X'001F' = CAST(CAST(NULL AS STRING) AS BINARY))):boolean> +struct<(NOT (X'001F' = CAST(NULL AS STRING))):boolean> -- !query output NULL diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/booleanEquality.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/booleanEquality.sql.out index dc068e70d66db..1b63931d9229a 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/booleanEquality.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/booleanEquality.sql.out @@ -13,7 +13,7 @@ struct<> -- !query SELECT true = cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(true AS TINYINT) = CAST(1 AS TINYINT)):boolean> +struct<(true = CAST(1 AS TINYINT)):boolean> -- !query output true @@ -21,7 +21,7 @@ true -- !query SELECT true = cast(1 as smallint) FROM t -- !query schema -struct<(CAST(true AS SMALLINT) = CAST(1 AS SMALLINT)):boolean> +struct<(true = CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -29,7 +29,7 @@ true -- !query SELECT true = cast(1 as int) FROM t -- !query schema -struct<(CAST(true AS INT) = CAST(1 AS INT)):boolean> +struct<(true = CAST(1 AS INT)):boolean> -- !query output true @@ -37,7 +37,7 @@ true -- !query SELECT true = cast(1 as bigint) FROM t -- !query schema -struct<(CAST(true AS BIGINT) = CAST(1 AS BIGINT)):boolean> +struct<(true = CAST(1 AS BIGINT)):boolean> -- !query output true @@ -45,7 +45,7 @@ true -- !query SELECT true = cast(1 as float) FROM t -- !query schema -struct<(CAST(true AS FLOAT) = CAST(1 AS FLOAT)):boolean> +struct<(true = CAST(1 AS FLOAT)):boolean> -- !query output true @@ -53,7 +53,7 @@ true -- !query SELECT true = cast(1 as double) FROM t -- !query schema -struct<(CAST(true AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(true = CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -61,7 +61,7 @@ true -- !query SELECT true = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(true AS DECIMAL(10,0)) = CAST(1 AS DECIMAL(10,0))):boolean> +struct<(true = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -69,7 +69,7 @@ true -- !query SELECT true = cast(1 as string) FROM t -- !query schema -struct<(true = CAST(CAST(1 AS STRING) AS BOOLEAN)):boolean> +struct<(true = CAST(1 AS STRING)):boolean> -- !query output true @@ -112,7 +112,7 @@ cannot resolve '(true = CAST('2017-12-11 09:30:00' AS DATE))' due to data type m -- !query SELECT true <=> cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(true AS TINYINT) <=> CAST(1 AS TINYINT)):boolean> +struct<(true <=> CAST(1 AS TINYINT)):boolean> -- !query output true @@ -120,7 +120,7 @@ true -- !query SELECT true <=> cast(1 as smallint) FROM t -- !query schema -struct<(CAST(true AS SMALLINT) <=> CAST(1 AS SMALLINT)):boolean> +struct<(true <=> CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -128,7 +128,7 @@ true -- !query SELECT true <=> cast(1 as int) FROM t -- !query schema -struct<(CAST(true AS INT) <=> CAST(1 AS INT)):boolean> +struct<(true <=> CAST(1 AS INT)):boolean> -- !query output true @@ -136,7 +136,7 @@ true -- !query SELECT true <=> cast(1 as bigint) FROM t -- !query schema -struct<(CAST(true AS BIGINT) <=> CAST(1 AS BIGINT)):boolean> +struct<(true <=> CAST(1 AS BIGINT)):boolean> -- !query output true @@ -144,7 +144,7 @@ true -- !query SELECT true <=> cast(1 as float) FROM t -- !query schema -struct<(CAST(true AS FLOAT) <=> CAST(1 AS FLOAT)):boolean> +struct<(true <=> CAST(1 AS FLOAT)):boolean> -- !query output true @@ -152,7 +152,7 @@ true -- !query SELECT true <=> cast(1 as double) FROM t -- !query schema -struct<(CAST(true AS DOUBLE) <=> CAST(1 AS DOUBLE)):boolean> +struct<(true <=> CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -160,7 +160,7 @@ true -- !query SELECT true <=> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(true AS DECIMAL(10,0)) <=> CAST(1 AS DECIMAL(10,0))):boolean> +struct<(true <=> CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -168,7 +168,7 @@ true -- !query SELECT true <=> cast(1 as string) FROM t -- !query schema -struct<(true <=> CAST(CAST(1 AS STRING) AS BOOLEAN)):boolean> +struct<(true <=> CAST(1 AS STRING)):boolean> -- !query output true @@ -211,7 +211,7 @@ cannot resolve '(true <=> CAST('2017-12-11 09:30:00' AS DATE))' due to data type -- !query SELECT cast(1 as tinyint) = true FROM t -- !query schema -struct<(CAST(1 AS TINYINT) = CAST(true AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) = true):boolean> -- !query output true @@ -219,7 +219,7 @@ true -- !query SELECT cast(1 as smallint) = true FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) = CAST(true AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) = true):boolean> -- !query output true @@ -227,7 +227,7 @@ true -- !query SELECT cast(1 as int) = true FROM t -- !query schema -struct<(CAST(1 AS INT) = CAST(true AS INT)):boolean> +struct<(CAST(1 AS INT) = true):boolean> -- !query output true @@ -235,7 +235,7 @@ true -- !query SELECT cast(1 as bigint) = true FROM t -- !query schema -struct<(CAST(1 AS BIGINT) = CAST(true AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) = true):boolean> -- !query output true @@ -243,7 +243,7 @@ true -- !query SELECT cast(1 as float) = true FROM t -- !query schema -struct<(CAST(1 AS FLOAT) = CAST(true AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) = true):boolean> -- !query output true @@ -251,7 +251,7 @@ true -- !query SELECT cast(1 as double) = true FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) = CAST(true AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) = true):boolean> -- !query output true @@ -259,7 +259,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = true FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) = CAST(true AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = true):boolean> -- !query output true @@ -267,7 +267,7 @@ true -- !query SELECT cast(1 as string) = true FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS BOOLEAN) = true):boolean> +struct<(CAST(1 AS STRING) = true):boolean> -- !query output true @@ -310,7 +310,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) = true)' due to data type m -- !query SELECT cast(1 as tinyint) <=> true FROM t -- !query schema -struct<(CAST(1 AS TINYINT) <=> CAST(true AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) <=> true):boolean> -- !query output true @@ -318,7 +318,7 @@ true -- !query SELECT cast(1 as smallint) <=> true FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) <=> CAST(true AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) <=> true):boolean> -- !query output true @@ -326,7 +326,7 @@ true -- !query SELECT cast(1 as int) <=> true FROM t -- !query schema -struct<(CAST(1 AS INT) <=> CAST(true AS INT)):boolean> +struct<(CAST(1 AS INT) <=> true):boolean> -- !query output true @@ -334,7 +334,7 @@ true -- !query SELECT cast(1 as bigint) <=> true FROM t -- !query schema -struct<(CAST(1 AS BIGINT) <=> CAST(true AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) <=> true):boolean> -- !query output true @@ -342,7 +342,7 @@ true -- !query SELECT cast(1 as float) <=> true FROM t -- !query schema -struct<(CAST(1 AS FLOAT) <=> CAST(true AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) <=> true):boolean> -- !query output true @@ -350,7 +350,7 @@ true -- !query SELECT cast(1 as double) <=> true FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <=> CAST(true AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <=> true):boolean> -- !query output true @@ -358,7 +358,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> true FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(true AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> true):boolean> -- !query output true @@ -366,7 +366,7 @@ true -- !query SELECT cast(1 as string) <=> true FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS BOOLEAN) <=> true):boolean> +struct<(CAST(1 AS STRING) <=> true):boolean> -- !query output true @@ -409,7 +409,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) <=> true)' due to data type -- !query SELECT false = cast(0 as tinyint) FROM t -- !query schema -struct<(CAST(false AS TINYINT) = CAST(0 AS TINYINT)):boolean> +struct<(false = CAST(0 AS TINYINT)):boolean> -- !query output true @@ -417,7 +417,7 @@ true -- !query SELECT false = cast(0 as smallint) FROM t -- !query schema -struct<(CAST(false AS SMALLINT) = CAST(0 AS SMALLINT)):boolean> +struct<(false = CAST(0 AS SMALLINT)):boolean> -- !query output true @@ -425,7 +425,7 @@ true -- !query SELECT false = cast(0 as int) FROM t -- !query schema -struct<(CAST(false AS INT) = CAST(0 AS INT)):boolean> +struct<(false = CAST(0 AS INT)):boolean> -- !query output true @@ -433,7 +433,7 @@ true -- !query SELECT false = cast(0 as bigint) FROM t -- !query schema -struct<(CAST(false AS BIGINT) = CAST(0 AS BIGINT)):boolean> +struct<(false = CAST(0 AS BIGINT)):boolean> -- !query output true @@ -441,7 +441,7 @@ true -- !query SELECT false = cast(0 as float) FROM t -- !query schema -struct<(CAST(false AS FLOAT) = CAST(0 AS FLOAT)):boolean> +struct<(false = CAST(0 AS FLOAT)):boolean> -- !query output true @@ -449,7 +449,7 @@ true -- !query SELECT false = cast(0 as double) FROM t -- !query schema -struct<(CAST(false AS DOUBLE) = CAST(0 AS DOUBLE)):boolean> +struct<(false = CAST(0 AS DOUBLE)):boolean> -- !query output true @@ -457,7 +457,7 @@ true -- !query SELECT false = cast(0 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(false AS DECIMAL(10,0)) = CAST(0 AS DECIMAL(10,0))):boolean> +struct<(false = CAST(0 AS DECIMAL(10,0))):boolean> -- !query output true @@ -465,7 +465,7 @@ true -- !query SELECT false = cast(0 as string) FROM t -- !query schema -struct<(false = CAST(CAST(0 AS STRING) AS BOOLEAN)):boolean> +struct<(false = CAST(0 AS STRING)):boolean> -- !query output true @@ -508,7 +508,7 @@ cannot resolve '(false = CAST('2017-12-11 09:30:00' AS DATE))' due to data type -- !query SELECT false <=> cast(0 as tinyint) FROM t -- !query schema -struct<(CAST(false AS TINYINT) <=> CAST(0 AS TINYINT)):boolean> +struct<(false <=> CAST(0 AS TINYINT)):boolean> -- !query output true @@ -516,7 +516,7 @@ true -- !query SELECT false <=> cast(0 as smallint) FROM t -- !query schema -struct<(CAST(false AS SMALLINT) <=> CAST(0 AS SMALLINT)):boolean> +struct<(false <=> CAST(0 AS SMALLINT)):boolean> -- !query output true @@ -524,7 +524,7 @@ true -- !query SELECT false <=> cast(0 as int) FROM t -- !query schema -struct<(CAST(false AS INT) <=> CAST(0 AS INT)):boolean> +struct<(false <=> CAST(0 AS INT)):boolean> -- !query output true @@ -532,7 +532,7 @@ true -- !query SELECT false <=> cast(0 as bigint) FROM t -- !query schema -struct<(CAST(false AS BIGINT) <=> CAST(0 AS BIGINT)):boolean> +struct<(false <=> CAST(0 AS BIGINT)):boolean> -- !query output true @@ -540,7 +540,7 @@ true -- !query SELECT false <=> cast(0 as float) FROM t -- !query schema -struct<(CAST(false AS FLOAT) <=> CAST(0 AS FLOAT)):boolean> +struct<(false <=> CAST(0 AS FLOAT)):boolean> -- !query output true @@ -548,7 +548,7 @@ true -- !query SELECT false <=> cast(0 as double) FROM t -- !query schema -struct<(CAST(false AS DOUBLE) <=> CAST(0 AS DOUBLE)):boolean> +struct<(false <=> CAST(0 AS DOUBLE)):boolean> -- !query output true @@ -556,7 +556,7 @@ true -- !query SELECT false <=> cast(0 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(false AS DECIMAL(10,0)) <=> CAST(0 AS DECIMAL(10,0))):boolean> +struct<(false <=> CAST(0 AS DECIMAL(10,0))):boolean> -- !query output true @@ -564,7 +564,7 @@ true -- !query SELECT false <=> cast(0 as string) FROM t -- !query schema -struct<(false <=> CAST(CAST(0 AS STRING) AS BOOLEAN)):boolean> +struct<(false <=> CAST(0 AS STRING)):boolean> -- !query output true @@ -607,7 +607,7 @@ cannot resolve '(false <=> CAST('2017-12-11 09:30:00' AS DATE))' due to data typ -- !query SELECT cast(0 as tinyint) = false FROM t -- !query schema -struct<(CAST(0 AS TINYINT) = CAST(false AS TINYINT)):boolean> +struct<(CAST(0 AS TINYINT) = false):boolean> -- !query output true @@ -615,7 +615,7 @@ true -- !query SELECT cast(0 as smallint) = false FROM t -- !query schema -struct<(CAST(0 AS SMALLINT) = CAST(false AS SMALLINT)):boolean> +struct<(CAST(0 AS SMALLINT) = false):boolean> -- !query output true @@ -623,7 +623,7 @@ true -- !query SELECT cast(0 as int) = false FROM t -- !query schema -struct<(CAST(0 AS INT) = CAST(false AS INT)):boolean> +struct<(CAST(0 AS INT) = false):boolean> -- !query output true @@ -631,7 +631,7 @@ true -- !query SELECT cast(0 as bigint) = false FROM t -- !query schema -struct<(CAST(0 AS BIGINT) = CAST(false AS BIGINT)):boolean> +struct<(CAST(0 AS BIGINT) = false):boolean> -- !query output true @@ -639,7 +639,7 @@ true -- !query SELECT cast(0 as float) = false FROM t -- !query schema -struct<(CAST(0 AS FLOAT) = CAST(false AS FLOAT)):boolean> +struct<(CAST(0 AS FLOAT) = false):boolean> -- !query output true @@ -647,7 +647,7 @@ true -- !query SELECT cast(0 as double) = false FROM t -- !query schema -struct<(CAST(0 AS DOUBLE) = CAST(false AS DOUBLE)):boolean> +struct<(CAST(0 AS DOUBLE) = false):boolean> -- !query output true @@ -655,7 +655,7 @@ true -- !query SELECT cast(0 as decimal(10, 0)) = false FROM t -- !query schema -struct<(CAST(0 AS DECIMAL(10,0)) = CAST(false AS DECIMAL(10,0))):boolean> +struct<(CAST(0 AS DECIMAL(10,0)) = false):boolean> -- !query output true @@ -663,7 +663,7 @@ true -- !query SELECT cast(0 as string) = false FROM t -- !query schema -struct<(CAST(CAST(0 AS STRING) AS BOOLEAN) = false):boolean> +struct<(CAST(0 AS STRING) = false):boolean> -- !query output true @@ -706,7 +706,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) = false)' due to data type -- !query SELECT cast(0 as tinyint) <=> false FROM t -- !query schema -struct<(CAST(0 AS TINYINT) <=> CAST(false AS TINYINT)):boolean> +struct<(CAST(0 AS TINYINT) <=> false):boolean> -- !query output true @@ -714,7 +714,7 @@ true -- !query SELECT cast(0 as smallint) <=> false FROM t -- !query schema -struct<(CAST(0 AS SMALLINT) <=> CAST(false AS SMALLINT)):boolean> +struct<(CAST(0 AS SMALLINT) <=> false):boolean> -- !query output true @@ -722,7 +722,7 @@ true -- !query SELECT cast(0 as int) <=> false FROM t -- !query schema -struct<(CAST(0 AS INT) <=> CAST(false AS INT)):boolean> +struct<(CAST(0 AS INT) <=> false):boolean> -- !query output true @@ -730,7 +730,7 @@ true -- !query SELECT cast(0 as bigint) <=> false FROM t -- !query schema -struct<(CAST(0 AS BIGINT) <=> CAST(false AS BIGINT)):boolean> +struct<(CAST(0 AS BIGINT) <=> false):boolean> -- !query output true @@ -738,7 +738,7 @@ true -- !query SELECT cast(0 as float) <=> false FROM t -- !query schema -struct<(CAST(0 AS FLOAT) <=> CAST(false AS FLOAT)):boolean> +struct<(CAST(0 AS FLOAT) <=> false):boolean> -- !query output true @@ -746,7 +746,7 @@ true -- !query SELECT cast(0 as double) <=> false FROM t -- !query schema -struct<(CAST(0 AS DOUBLE) <=> CAST(false AS DOUBLE)):boolean> +struct<(CAST(0 AS DOUBLE) <=> false):boolean> -- !query output true @@ -754,7 +754,7 @@ true -- !query SELECT cast(0 as decimal(10, 0)) <=> false FROM t -- !query schema -struct<(CAST(0 AS DECIMAL(10,0)) <=> CAST(false AS DECIMAL(10,0))):boolean> +struct<(CAST(0 AS DECIMAL(10,0)) <=> false):boolean> -- !query output true @@ -762,7 +762,7 @@ true -- !query SELECT cast(0 as string) <=> false FROM t -- !query schema -struct<(CAST(CAST(0 AS STRING) AS BOOLEAN) <=> false):boolean> +struct<(CAST(0 AS STRING) <=> false):boolean> -- !query output true diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/caseWhenCoercion.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/caseWhenCoercion.sql.out index 18d97c2f1b42a..da1d1993b90d8 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/caseWhenCoercion.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/caseWhenCoercion.sql.out @@ -21,7 +21,7 @@ struct +struct -- !query output 1 @@ -29,7 +29,7 @@ struct +struct -- !query output 1 @@ -37,7 +37,7 @@ struct +struct -- !query output 1 @@ -45,7 +45,7 @@ struct +struct -- !query output 1.0 @@ -53,7 +53,7 @@ struct +struct -- !query output 1.0 @@ -61,7 +61,7 @@ struct +struct -- !query output 1 @@ -69,7 +69,7 @@ struct +struct -- !query output 1 @@ -113,7 +113,7 @@ cannot resolve 'CASE WHEN true THEN CAST(1 AS TINYINT) ELSE CAST('2017-12-11 09: -- !query SELECT CASE WHEN true THEN cast(1 as smallint) ELSE cast(2 as tinyint) END FROM t -- !query schema -struct +struct -- !query output 1 @@ -129,7 +129,7 @@ struct +struct -- !query output 1 @@ -137,7 +137,7 @@ struct +struct -- !query output 1 @@ -145,7 +145,7 @@ struct +struct -- !query output 1.0 @@ -153,7 +153,7 @@ struct +struct -- !query output 1.0 @@ -161,7 +161,7 @@ struct +struct -- !query output 1 @@ -169,7 +169,7 @@ struct +struct -- !query output 1 @@ -213,7 +213,7 @@ cannot resolve 'CASE WHEN true THEN CAST(1 AS SMALLINT) ELSE CAST('2017-12-11 09 -- !query SELECT CASE WHEN true THEN cast(1 as int) ELSE cast(2 as tinyint) END FROM t -- !query schema -struct +struct -- !query output 1 @@ -221,7 +221,7 @@ struct +struct -- !query output 1 @@ -237,7 +237,7 @@ struct -- !query SELECT CASE WHEN true THEN cast(1 as int) ELSE cast(2 as bigint) END FROM t -- !query schema -struct +struct -- !query output 1 @@ -245,7 +245,7 @@ struct +struct -- !query output 1.0 @@ -253,7 +253,7 @@ struct +struct -- !query output 1.0 @@ -261,7 +261,7 @@ struct +struct -- !query output 1 @@ -269,7 +269,7 @@ struct +struct -- !query output 1 @@ -313,7 +313,7 @@ cannot resolve 'CASE WHEN true THEN CAST(1 AS INT) ELSE CAST('2017-12-11 09:30:0 -- !query SELECT CASE WHEN true THEN cast(1 as bigint) ELSE cast(2 as tinyint) END FROM t -- !query schema -struct +struct -- !query output 1 @@ -321,7 +321,7 @@ struct +struct -- !query output 1 @@ -329,7 +329,7 @@ struct +struct -- !query output 1 @@ -345,7 +345,7 @@ struct -- !query SELECT CASE WHEN true THEN cast(1 as bigint) ELSE cast(2 as float) END FROM t -- !query schema -struct +struct -- !query output 1.0 @@ -353,7 +353,7 @@ struct +struct -- !query output 1.0 @@ -361,7 +361,7 @@ struct +struct -- !query output 1 @@ -369,7 +369,7 @@ struct +struct -- !query output 1 @@ -413,7 +413,7 @@ cannot resolve 'CASE WHEN true THEN CAST(1 AS BIGINT) ELSE CAST('2017-12-11 09:3 -- !query SELECT CASE WHEN true THEN cast(1 as float) ELSE cast(2 as tinyint) END FROM t -- !query schema -struct +struct -- !query output 1.0 @@ -421,7 +421,7 @@ struct +struct -- !query output 1.0 @@ -429,7 +429,7 @@ struct +struct -- !query output 1.0 @@ -437,7 +437,7 @@ struct +struct -- !query output 1.0 @@ -453,7 +453,7 @@ struct -- !query SELECT CASE WHEN true THEN cast(1 as float) ELSE cast(2 as double) END FROM t -- !query schema -struct +struct -- !query output 1.0 @@ -461,7 +461,7 @@ struct +struct -- !query output 1.0 @@ -469,7 +469,7 @@ struct +struct -- !query output 1.0 @@ -513,7 +513,7 @@ cannot resolve 'CASE WHEN true THEN CAST(1 AS FLOAT) ELSE CAST('2017-12-11 09:30 -- !query SELECT CASE WHEN true THEN cast(1 as double) ELSE cast(2 as tinyint) END FROM t -- !query schema -struct +struct -- !query output 1.0 @@ -521,7 +521,7 @@ struct +struct -- !query output 1.0 @@ -529,7 +529,7 @@ struct +struct -- !query output 1.0 @@ -537,7 +537,7 @@ struct +struct -- !query output 1.0 @@ -545,7 +545,7 @@ struct +struct -- !query output 1.0 @@ -561,7 +561,7 @@ struct -- !query SELECT CASE WHEN true THEN cast(1 as double) ELSE cast(2 as decimal(10, 0)) END FROM t -- !query schema -struct +struct -- !query output 1.0 @@ -569,7 +569,7 @@ struct +struct -- !query output 1.0 @@ -613,7 +613,7 @@ cannot resolve 'CASE WHEN true THEN CAST(1 AS DOUBLE) ELSE CAST('2017-12-11 09:3 -- !query SELECT CASE WHEN true THEN cast(1 as decimal(10, 0)) ELSE cast(2 as tinyint) END FROM t -- !query schema -struct +struct -- !query output 1 @@ -621,7 +621,7 @@ struct +struct -- !query output 1 @@ -629,7 +629,7 @@ struct +struct -- !query output 1 @@ -637,7 +637,7 @@ struct +struct -- !query output 1 @@ -645,7 +645,7 @@ struct +struct -- !query output 1.0 @@ -653,7 +653,7 @@ struct +struct -- !query output 1.0 @@ -669,7 +669,7 @@ struct +struct -- !query output 1 @@ -713,7 +713,7 @@ cannot resolve 'CASE WHEN true THEN CAST(1 AS DECIMAL(10,0)) ELSE CAST('2017-12- -- !query SELECT CASE WHEN true THEN cast(1 as string) ELSE cast(2 as tinyint) END FROM t -- !query schema -struct +struct -- !query output 1 @@ -721,7 +721,7 @@ struct +struct -- !query output 1 @@ -729,7 +729,7 @@ struct +struct -- !query output 1 @@ -737,7 +737,7 @@ struct +struct -- !query output 1 @@ -745,7 +745,7 @@ struct +struct -- !query output 1 @@ -753,7 +753,7 @@ struct +struct -- !query output 1 @@ -761,7 +761,7 @@ struct +struct -- !query output 1 @@ -795,7 +795,7 @@ cannot resolve 'CASE WHEN true THEN CAST(1 AS STRING) ELSE CAST(2 AS BOOLEAN) EN -- !query SELECT CASE WHEN true THEN cast(1 as string) ELSE cast('2017-12-11 09:30:00.0' as timestamp) END FROM t -- !query schema -struct +struct -- !query output 1 @@ -803,7 +803,7 @@ struct +struct -- !query output 1 @@ -1088,7 +1088,7 @@ cannot resolve 'CASE WHEN true THEN CAST('2017-12-12 09:30:00.0' AS TIMESTAMP) E -- !query SELECT CASE WHEN true THEN cast('2017-12-12 09:30:00.0' as timestamp) ELSE cast(2 as string) END FROM t -- !query schema -struct +struct -- !query output 2017-12-12 09:30:00 @@ -1122,7 +1122,7 @@ struct +struct -- !query output 2017-12-12 09:30:00 @@ -1193,7 +1193,7 @@ cannot resolve 'CASE WHEN true THEN CAST('2017-12-12 09:30:00' AS DATE) ELSE CAS -- !query SELECT CASE WHEN true THEN cast('2017-12-12 09:30:00' as date) ELSE cast(2 as string) END FROM t -- !query schema -struct +struct -- !query output 2017-12-12 @@ -1219,7 +1219,7 @@ cannot resolve 'CASE WHEN true THEN CAST('2017-12-12 09:30:00' AS DATE) ELSE CAS -- !query SELECT CASE WHEN true THEN cast('2017-12-12 09:30:00' as date) ELSE cast('2017-12-11 09:30:00.0' as timestamp) END FROM t -- !query schema -struct +struct -- !query output 2017-12-12 00:00:00 diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/dateTimeOperations.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/dateTimeOperations.sql.out index 41f888ee28923..9cad1e6887a09 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/dateTimeOperations.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/dateTimeOperations.sql.out @@ -76,7 +76,7 @@ cannot resolve 'CAST(1 AS DECIMAL(10,0)) + INTERVAL '2 days'' due to data type m -- !query select cast('2017-12-11' as string) + interval 2 day -- !query schema -struct +struct -- !query output 2017-12-13 00:00:00 @@ -84,7 +84,7 @@ struct +struct -- !query output 2017-12-13 09:30:00 @@ -110,7 +110,7 @@ cannot resolve 'CAST(1 AS BOOLEAN) + INTERVAL '2 days'' due to data type mismatc -- !query select cast('2017-12-11 09:30:00.0' as timestamp) + interval 2 day -- !query schema -struct +struct -- !query output 2017-12-13 09:30:00 @@ -189,7 +189,7 @@ cannot resolve 'CAST(1 AS DECIMAL(10,0)) + INTERVAL '2 days'' due to data type m -- !query select interval 2 day + cast('2017-12-11' as string) -- !query schema -struct +struct -- !query output 2017-12-13 00:00:00 @@ -197,7 +197,7 @@ struct +struct -- !query output 2017-12-13 09:30:00 @@ -223,7 +223,7 @@ cannot resolve 'CAST(1 AS BOOLEAN) + INTERVAL '2 days'' due to data type mismatc -- !query select interval 2 day + cast('2017-12-11 09:30:00.0' as timestamp) -- !query schema -struct +struct -- !query output 2017-12-13 09:30:00 @@ -302,7 +302,7 @@ cannot resolve 'CAST(1 AS DECIMAL(10,0)) + (- INTERVAL '2 days')' due to data ty -- !query select cast('2017-12-11' as string) - interval 2 day -- !query schema -struct +struct -- !query output 2017-12-09 00:00:00 @@ -310,7 +310,7 @@ struct -- !query select cast('2017-12-11 09:30:00' as string) - interval 2 day -- !query schema -struct +struct -- !query output 2017-12-09 09:30:00 @@ -336,7 +336,7 @@ cannot resolve 'CAST(1 AS BOOLEAN) + (- INTERVAL '2 days')' due to data type mis -- !query select cast('2017-12-11 09:30:00.0' as timestamp) - interval 2 day -- !query schema -struct +struct -- !query output 2017-12-09 09:30:00 diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/decimalPrecision.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/decimalPrecision.sql.out index 33bd3850732f0..58c34aafa3207 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/decimalPrecision.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/decimalPrecision.sql.out @@ -13,7 +13,7 @@ struct<> -- !query SELECT cast(1 as tinyint) + cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) + CAST(1 AS DECIMAL(3,0))):decimal(4,0)> +struct<(CAST(1 AS TINYINT) + CAST(1 AS DECIMAL(3,0))):decimal(4,0)> -- !query output 2 @@ -21,7 +21,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) + CAST(1 AS DECIMAL(3,0))):deci -- !query SELECT cast(1 as tinyint) + cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(6,0)) + CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(6,0))):decimal(6,0)> +struct<(CAST(1 AS TINYINT) + CAST(1 AS DECIMAL(5,0))):decimal(6,0)> -- !query output 2 @@ -29,7 +29,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(6,0)) + CAST(CA -- !query SELECT cast(1 as tinyint) + cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(11,0)) + CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS TINYINT) + CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query output 2 @@ -37,7 +37,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(11,0)) + CAST(C -- !query SELECT cast(1 as tinyint) + cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(21,0)) + CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS TINYINT) + CAST(1 AS DECIMAL(20,0))):decimal(21,0)> -- !query output 2 @@ -45,7 +45,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(21,0)) + CAST(C -- !query SELECT cast(1 as smallint) + cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(6,0)) + CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(6,0))):decimal(6,0)> +struct<(CAST(1 AS SMALLINT) + CAST(1 AS DECIMAL(3,0))):decimal(6,0)> -- !query output 2 @@ -53,7 +53,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(6,0)) + CAST(C -- !query SELECT cast(1 as smallint) + cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) + CAST(1 AS DECIMAL(5,0))):decimal(6,0)> +struct<(CAST(1 AS SMALLINT) + CAST(1 AS DECIMAL(5,0))):decimal(6,0)> -- !query output 2 @@ -61,7 +61,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) + CAST(1 AS DECIMAL(5,0))):dec -- !query SELECT cast(1 as smallint) + cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(11,0)) + CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS SMALLINT) + CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query output 2 @@ -69,7 +69,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(11,0)) + CAST( -- !query SELECT cast(1 as smallint) + cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(21,0)) + CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS SMALLINT) + CAST(1 AS DECIMAL(20,0))):decimal(21,0)> -- !query output 2 @@ -77,7 +77,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(21,0)) + CAST( -- !query SELECT cast(1 as int) + cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(11,0)) + CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS INT) + CAST(1 AS DECIMAL(3,0))):decimal(11,0)> -- !query output 2 @@ -85,7 +85,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(11,0)) + CAST(CAST -- !query SELECT cast(1 as int) + cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(11,0)) + CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS INT) + CAST(1 AS DECIMAL(5,0))):decimal(11,0)> -- !query output 2 @@ -93,7 +93,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(11,0)) + CAST(CAST -- !query SELECT cast(1 as int) + cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) + CAST(1 AS DECIMAL(10,0))):decimal(11,0)> +struct<(CAST(1 AS INT) + CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query output 2 @@ -101,7 +101,7 @@ struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) + CAST(1 AS DECIMAL(10,0))):decima -- !query SELECT cast(1 as int) + cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(21,0)) + CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS INT) + CAST(1 AS DECIMAL(20,0))):decimal(21,0)> -- !query output 2 @@ -109,7 +109,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(21,0)) + CAST(CAST -- !query SELECT cast(1 as bigint) + cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS BIGINT) + CAST(1 AS DECIMAL(3,0))):decimal(21,0)> -- !query output 2 @@ -117,7 +117,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(C -- !query SELECT cast(1 as bigint) + cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS BIGINT) + CAST(1 AS DECIMAL(5,0))):decimal(21,0)> -- !query output 2 @@ -125,7 +125,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(C -- !query SELECT cast(1 as bigint) + cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS BIGINT) + CAST(1 AS DECIMAL(10,0))):decimal(21,0)> -- !query output 2 @@ -133,7 +133,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(C -- !query SELECT cast(1 as bigint) + cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) + CAST(1 AS DECIMAL(20,0))):decimal(21,0)> +struct<(CAST(1 AS BIGINT) + CAST(1 AS DECIMAL(20,0))):decimal(21,0)> -- !query output 2 @@ -141,7 +141,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) + CAST(1 AS DECIMAL(20,0))):dec -- !query SELECT cast(1 as float) + cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) + CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) + CAST(1 AS DECIMAL(3,0))):double> -- !query output 2.0 @@ -149,7 +149,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) + CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBL -- !query SELECT cast(1 as float) + cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) + CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) + CAST(1 AS DECIMAL(5,0))):double> -- !query output 2.0 @@ -157,7 +157,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) + CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBL -- !query SELECT cast(1 as float) + cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) + CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) + CAST(1 AS DECIMAL(10,0))):double> -- !query output 2.0 @@ -165,7 +165,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) + CAST(CAST(1 AS DECIMAL(10,0)) AS DOUB -- !query SELECT cast(1 as float) + cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) + CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) + CAST(1 AS DECIMAL(20,0))):double> -- !query output 2.0 @@ -173,7 +173,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) + CAST(CAST(1 AS DECIMAL(20,0)) AS DOUB -- !query SELECT cast(1 as double) + cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) + CAST(1 AS DECIMAL(3,0))):double> -- !query output 2.0 @@ -181,7 +181,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) + cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) + CAST(1 AS DECIMAL(5,0))):double> -- !query output 2.0 @@ -189,7 +189,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) + cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) + CAST(1 AS DECIMAL(10,0))):double> -- !query output 2.0 @@ -197,7 +197,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) + cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) + CAST(1 AS DECIMAL(20,0))):double> -- !query output 2.0 @@ -205,7 +205,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) + cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) + CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(10,0)) + CAST(1 AS DECIMAL(3,0))):decimal(11,0)> -- !query output 2 @@ -213,7 +213,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) + CAST(CAST(1 AS DECIMAL -- !query SELECT cast(1 as decimal(10, 0)) + cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) + CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(10,0)) + CAST(1 AS DECIMAL(5,0))):decimal(11,0)> -- !query output 2 @@ -229,7 +229,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) + CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query SELECT cast(1 as decimal(10, 0)) + cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(21,0)) + CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(10,0)) + CAST(1 AS DECIMAL(20,0))):decimal(21,0)> -- !query output 2 @@ -345,7 +345,7 @@ cannot resolve 'date_add(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS DECIMAL( -- !query SELECT cast(1 as decimal(3, 0)) + cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) + CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):decimal(4,0)> +struct<(CAST(1 AS DECIMAL(3,0)) + CAST(1 AS TINYINT)):decimal(4,0)> -- !query output 2 @@ -353,7 +353,7 @@ struct<(CAST(1 AS DECIMAL(3,0)) + CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):deci -- !query SELECT cast(1 as decimal(5, 0)) + cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(6,0)) + CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(6,0))):decimal(6,0)> +struct<(CAST(1 AS DECIMAL(5,0)) + CAST(1 AS TINYINT)):decimal(6,0)> -- !query output 2 @@ -361,7 +361,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(6,0)) + CAST(CAST(CAST(1 AS TINY -- !query SELECT cast(1 as decimal(10, 0)) + cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) + CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(10,0)) + CAST(1 AS TINYINT)):decimal(11,0)> -- !query output 2 @@ -369,7 +369,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) + CAST(CAST(CAST(1 AS TI -- !query SELECT cast(1 as decimal(20, 0)) + cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(20,0)) + CAST(1 AS TINYINT)):decimal(21,0)> -- !query output 2 @@ -377,7 +377,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(CAST(CAST(1 AS TI -- !query SELECT cast(1 as decimal(3, 0)) + cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(6,0)) + CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(6,0))):decimal(6,0)> +struct<(CAST(1 AS DECIMAL(3,0)) + CAST(1 AS SMALLINT)):decimal(6,0)> -- !query output 2 @@ -385,7 +385,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(6,0)) + CAST(CAST(CAST(1 AS SMAL -- !query SELECT cast(1 as decimal(5, 0)) + cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) + CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):decimal(6,0)> +struct<(CAST(1 AS DECIMAL(5,0)) + CAST(1 AS SMALLINT)):decimal(6,0)> -- !query output 2 @@ -393,7 +393,7 @@ struct<(CAST(1 AS DECIMAL(5,0)) + CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):dec -- !query SELECT cast(1 as decimal(10, 0)) + cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) + CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(10,0)) + CAST(1 AS SMALLINT)):decimal(11,0)> -- !query output 2 @@ -401,7 +401,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) + CAST(CAST(CAST(1 AS SM -- !query SELECT cast(1 as decimal(20, 0)) + cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(20,0)) + CAST(1 AS SMALLINT)):decimal(21,0)> -- !query output 2 @@ -409,7 +409,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(CAST(CAST(1 AS SM -- !query SELECT cast(1 as decimal(3, 0)) + cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(11,0)) + CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(3,0)) + CAST(1 AS INT)):decimal(11,0)> -- !query output 2 @@ -417,7 +417,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(11,0)) + CAST(CAST(CAST(1 AS INT -- !query SELECT cast(1 as decimal(5, 0)) + cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(11,0)) + CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(5,0)) + CAST(1 AS INT)):decimal(11,0)> -- !query output 2 @@ -425,7 +425,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(11,0)) + CAST(CAST(CAST(1 AS INT -- !query SELECT cast(1 as decimal(10, 0)) + cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) + CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(10,0)) + CAST(1 AS INT)):decimal(11,0)> -- !query output 2 @@ -433,7 +433,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) + CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decima -- !query SELECT cast(1 as decimal(20, 0)) + cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(20,0)) + CAST(1 AS INT)):decimal(21,0)> -- !query output 2 @@ -441,7 +441,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(CAST(CAST(1 AS IN -- !query SELECT cast(1 as decimal(3, 0)) + cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(21,0)) + CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(3,0)) + CAST(1 AS BIGINT)):decimal(21,0)> -- !query output 2 @@ -449,7 +449,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(21,0)) + CAST(CAST(CAST(1 AS BIG -- !query SELECT cast(1 as decimal(5, 0)) + cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(21,0)) + CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(5,0)) + CAST(1 AS BIGINT)):decimal(21,0)> -- !query output 2 @@ -457,7 +457,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(21,0)) + CAST(CAST(CAST(1 AS BIG -- !query SELECT cast(1 as decimal(10, 0)) + cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(21,0)) + CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(10,0)) + CAST(1 AS BIGINT)):decimal(21,0)> -- !query output 2 @@ -465,7 +465,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(21,0)) + CAST(CAST(CAST(1 AS BI -- !query SELECT cast(1 as decimal(20, 0)) + cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) + CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(20,0)) + CAST(1 AS BIGINT)):decimal(21,0)> -- !query output 2 @@ -473,7 +473,7 @@ struct<(CAST(1 AS DECIMAL(20,0)) + CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):dec -- !query SELECT cast(1 as decimal(3, 0)) + cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) + CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) + CAST(1 AS FLOAT)):double> -- !query output 2.0 @@ -481,7 +481,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) + CAST(CAST(1 AS FLOAT) AS DOUBL -- !query SELECT cast(1 as decimal(5, 0)) + cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) + CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) + CAST(1 AS FLOAT)):double> -- !query output 2.0 @@ -489,7 +489,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) + CAST(CAST(1 AS FLOAT) AS DOUBL -- !query SELECT cast(1 as decimal(10, 0)) + cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) + CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) + CAST(1 AS FLOAT)):double> -- !query output 2.0 @@ -497,7 +497,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) + CAST(CAST(1 AS FLOAT) AS DOUB -- !query SELECT cast(1 as decimal(20, 0)) + cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) + CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) + CAST(1 AS FLOAT)):double> -- !query output 2.0 @@ -505,7 +505,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) + CAST(CAST(1 AS FLOAT) AS DOUB -- !query SELECT cast(1 as decimal(3, 0)) + cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) + CAST(1 AS DOUBLE)):double> -- !query output 2.0 @@ -513,7 +513,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) + CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(5, 0)) + cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) + CAST(1 AS DOUBLE)):double> -- !query output 2.0 @@ -521,7 +521,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) + CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) + cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) + CAST(1 AS DOUBLE)):double> -- !query output 2.0 @@ -529,7 +529,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) + CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(20, 0)) + cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) + CAST(1 AS DOUBLE)):double> -- !query output 2.0 @@ -537,7 +537,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) + CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(3, 0)) + cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(11,0)) + CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(3,0)) + CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query output 2 @@ -545,7 +545,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(11,0)) + CAST(CAST(1 AS DECIMAL( -- !query SELECT cast(1 as decimal(5, 0)) + cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(11,0)) + CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(5,0)) + CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query output 2 @@ -561,7 +561,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) + CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query SELECT cast(1 as decimal(20, 0)) + cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(20,0)) + CAST(1 AS DECIMAL(10,0))):decimal(21,0)> -- !query output 2 @@ -569,7 +569,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) + CAST(CAST(1 AS DECIMAL -- !query SELECT cast(1 as decimal(3, 0)) + cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) + CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) + CAST(1 AS STRING)):double> -- !query output 2.0 @@ -577,7 +577,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) + CAST(CAST(1 AS STRING) AS DOUB -- !query SELECT cast(1 as decimal(5, 0)) + cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) + CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) + CAST(1 AS STRING)):double> -- !query output 2.0 @@ -585,7 +585,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) + CAST(CAST(1 AS STRING) AS DOUB -- !query SELECT cast(1 as decimal(10, 0)) + cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) + CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) + CAST(1 AS STRING)):double> -- !query output 2.0 @@ -593,7 +593,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) + CAST(CAST(1 AS STRING) AS DOU -- !query SELECT cast(1 as decimal(20, 0)) + cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) + CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) + CAST(1 AS STRING)):double> -- !query output 2.0 @@ -745,7 +745,7 @@ cannot resolve 'date_add(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS DECIMAL( -- !query SELECT cast(1 as tinyint) - cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) - CAST(1 AS DECIMAL(3,0))):decimal(4,0)> +struct<(CAST(1 AS TINYINT) - CAST(1 AS DECIMAL(3,0))):decimal(4,0)> -- !query output 0 @@ -753,7 +753,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) - CAST(1 AS DECIMAL(3,0))):deci -- !query SELECT cast(1 as tinyint) - cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(6,0)) - CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(6,0))):decimal(6,0)> +struct<(CAST(1 AS TINYINT) - CAST(1 AS DECIMAL(5,0))):decimal(6,0)> -- !query output 0 @@ -761,7 +761,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(6,0)) - CAST(CA -- !query SELECT cast(1 as tinyint) - cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(11,0)) - CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS TINYINT) - CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query output 0 @@ -769,7 +769,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(11,0)) - CAST(C -- !query SELECT cast(1 as tinyint) - cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(21,0)) - CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS TINYINT) - CAST(1 AS DECIMAL(20,0))):decimal(21,0)> -- !query output 0 @@ -777,7 +777,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(21,0)) - CAST(C -- !query SELECT cast(1 as smallint) - cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(6,0)) - CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(6,0))):decimal(6,0)> +struct<(CAST(1 AS SMALLINT) - CAST(1 AS DECIMAL(3,0))):decimal(6,0)> -- !query output 0 @@ -785,7 +785,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(6,0)) - CAST(C -- !query SELECT cast(1 as smallint) - cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) - CAST(1 AS DECIMAL(5,0))):decimal(6,0)> +struct<(CAST(1 AS SMALLINT) - CAST(1 AS DECIMAL(5,0))):decimal(6,0)> -- !query output 0 @@ -793,7 +793,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) - CAST(1 AS DECIMAL(5,0))):dec -- !query SELECT cast(1 as smallint) - cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(11,0)) - CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS SMALLINT) - CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query output 0 @@ -801,7 +801,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(11,0)) - CAST( -- !query SELECT cast(1 as smallint) - cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(21,0)) - CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS SMALLINT) - CAST(1 AS DECIMAL(20,0))):decimal(21,0)> -- !query output 0 @@ -809,7 +809,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(21,0)) - CAST( -- !query SELECT cast(1 as int) - cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(11,0)) - CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS INT) - CAST(1 AS DECIMAL(3,0))):decimal(11,0)> -- !query output 0 @@ -817,7 +817,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(11,0)) - CAST(CAST -- !query SELECT cast(1 as int) - cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(11,0)) - CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS INT) - CAST(1 AS DECIMAL(5,0))):decimal(11,0)> -- !query output 0 @@ -825,7 +825,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(11,0)) - CAST(CAST -- !query SELECT cast(1 as int) - cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) - CAST(1 AS DECIMAL(10,0))):decimal(11,0)> +struct<(CAST(1 AS INT) - CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query output 0 @@ -833,7 +833,7 @@ struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) - CAST(1 AS DECIMAL(10,0))):decima -- !query SELECT cast(1 as int) - cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(21,0)) - CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS INT) - CAST(1 AS DECIMAL(20,0))):decimal(21,0)> -- !query output 0 @@ -841,7 +841,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(21,0)) - CAST(CAST -- !query SELECT cast(1 as bigint) - cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS BIGINT) - CAST(1 AS DECIMAL(3,0))):decimal(21,0)> -- !query output 0 @@ -849,7 +849,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(C -- !query SELECT cast(1 as bigint) - cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS BIGINT) - CAST(1 AS DECIMAL(5,0))):decimal(21,0)> -- !query output 0 @@ -857,7 +857,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(C -- !query SELECT cast(1 as bigint) - cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS BIGINT) - CAST(1 AS DECIMAL(10,0))):decimal(21,0)> -- !query output 0 @@ -865,7 +865,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(C -- !query SELECT cast(1 as bigint) - cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) - CAST(1 AS DECIMAL(20,0))):decimal(21,0)> +struct<(CAST(1 AS BIGINT) - CAST(1 AS DECIMAL(20,0))):decimal(21,0)> -- !query output 0 @@ -873,7 +873,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) - CAST(1 AS DECIMAL(20,0))):dec -- !query SELECT cast(1 as float) - cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) - CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) - CAST(1 AS DECIMAL(3,0))):double> -- !query output 0.0 @@ -881,7 +881,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) - CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBL -- !query SELECT cast(1 as float) - cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) - CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) - CAST(1 AS DECIMAL(5,0))):double> -- !query output 0.0 @@ -889,7 +889,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) - CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBL -- !query SELECT cast(1 as float) - cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) - CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) - CAST(1 AS DECIMAL(10,0))):double> -- !query output 0.0 @@ -897,7 +897,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) - CAST(CAST(1 AS DECIMAL(10,0)) AS DOUB -- !query SELECT cast(1 as float) - cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) - CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) - CAST(1 AS DECIMAL(20,0))):double> -- !query output 0.0 @@ -905,7 +905,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) - CAST(CAST(1 AS DECIMAL(20,0)) AS DOUB -- !query SELECT cast(1 as double) - cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) - CAST(1 AS DECIMAL(3,0))):double> -- !query output 0.0 @@ -913,7 +913,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) - cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) - CAST(1 AS DECIMAL(5,0))):double> -- !query output 0.0 @@ -921,7 +921,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) - cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) - CAST(1 AS DECIMAL(10,0))):double> -- !query output 0.0 @@ -929,7 +929,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) - cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) - CAST(1 AS DECIMAL(20,0))):double> -- !query output 0.0 @@ -937,7 +937,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) - cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) - CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(10,0)) - CAST(1 AS DECIMAL(3,0))):decimal(11,0)> -- !query output 0 @@ -945,7 +945,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) - CAST(CAST(1 AS DECIMAL -- !query SELECT cast(1 as decimal(10, 0)) - cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) - CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(10,0)) - CAST(1 AS DECIMAL(5,0))):decimal(11,0)> -- !query output 0 @@ -961,7 +961,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) - CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query SELECT cast(1 as decimal(10, 0)) - cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(21,0)) - CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(10,0)) - CAST(1 AS DECIMAL(20,0))):decimal(21,0)> -- !query output 0 @@ -1008,7 +1008,7 @@ SELECT cast('2017-12-11 09:30:00.0' as timestamp) - cast(1 as decimal(3, 0)) FRO struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtracttimestamps(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS DECIMAL(3,0)))' due to data type mismatch: argument 2 requires timestamp type, however, 'CAST(1 AS DECIMAL(3,0))' is of decimal(3,0) type.; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) - CAST(1 AS DECIMAL(3,0)))' due to data type mismatch: argument 2 requires timestamp type, however, 'CAST(1 AS DECIMAL(3,0))' is of decimal(3,0) type.; line 1 pos 7 -- !query @@ -1017,7 +1017,7 @@ SELECT cast('2017-12-11 09:30:00.0' as timestamp) - cast(1 as decimal(5, 0)) FRO struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtracttimestamps(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS DECIMAL(5,0)))' due to data type mismatch: argument 2 requires timestamp type, however, 'CAST(1 AS DECIMAL(5,0))' is of decimal(5,0) type.; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) - CAST(1 AS DECIMAL(5,0)))' due to data type mismatch: argument 2 requires timestamp type, however, 'CAST(1 AS DECIMAL(5,0))' is of decimal(5,0) type.; line 1 pos 7 -- !query @@ -1026,7 +1026,7 @@ SELECT cast('2017-12-11 09:30:00.0' as timestamp) - cast(1 as decimal(10, 0)) FR struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtracttimestamps(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: argument 2 requires timestamp type, however, 'CAST(1 AS DECIMAL(10,0))' is of decimal(10,0) type.; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) - CAST(1 AS DECIMAL(10,0)))' due to data type mismatch: argument 2 requires timestamp type, however, 'CAST(1 AS DECIMAL(10,0))' is of decimal(10,0) type.; line 1 pos 7 -- !query @@ -1035,7 +1035,7 @@ SELECT cast('2017-12-11 09:30:00.0' as timestamp) - cast(1 as decimal(20, 0)) FR struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtracttimestamps(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), CAST(1 AS DECIMAL(20,0)))' due to data type mismatch: argument 2 requires timestamp type, however, 'CAST(1 AS DECIMAL(20,0))' is of decimal(20,0) type.; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) - CAST(1 AS DECIMAL(20,0)))' due to data type mismatch: argument 2 requires timestamp type, however, 'CAST(1 AS DECIMAL(20,0))' is of decimal(20,0) type.; line 1 pos 7 -- !query @@ -1077,7 +1077,7 @@ cannot resolve 'date_sub(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS DECIMAL( -- !query SELECT cast(1 as decimal(3, 0)) - cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) - CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):decimal(4,0)> +struct<(CAST(1 AS DECIMAL(3,0)) - CAST(1 AS TINYINT)):decimal(4,0)> -- !query output 0 @@ -1085,7 +1085,7 @@ struct<(CAST(1 AS DECIMAL(3,0)) - CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):deci -- !query SELECT cast(1 as decimal(5, 0)) - cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(6,0)) - CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(6,0))):decimal(6,0)> +struct<(CAST(1 AS DECIMAL(5,0)) - CAST(1 AS TINYINT)):decimal(6,0)> -- !query output 0 @@ -1093,7 +1093,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(6,0)) - CAST(CAST(CAST(1 AS TINY -- !query SELECT cast(1 as decimal(10, 0)) - cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) - CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(10,0)) - CAST(1 AS TINYINT)):decimal(11,0)> -- !query output 0 @@ -1101,7 +1101,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) - CAST(CAST(CAST(1 AS TI -- !query SELECT cast(1 as decimal(20, 0)) - cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(20,0)) - CAST(1 AS TINYINT)):decimal(21,0)> -- !query output 0 @@ -1109,7 +1109,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(CAST(CAST(1 AS TI -- !query SELECT cast(1 as decimal(3, 0)) - cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(6,0)) - CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(6,0))):decimal(6,0)> +struct<(CAST(1 AS DECIMAL(3,0)) - CAST(1 AS SMALLINT)):decimal(6,0)> -- !query output 0 @@ -1117,7 +1117,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(6,0)) - CAST(CAST(CAST(1 AS SMAL -- !query SELECT cast(1 as decimal(5, 0)) - cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) - CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):decimal(6,0)> +struct<(CAST(1 AS DECIMAL(5,0)) - CAST(1 AS SMALLINT)):decimal(6,0)> -- !query output 0 @@ -1125,7 +1125,7 @@ struct<(CAST(1 AS DECIMAL(5,0)) - CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):dec -- !query SELECT cast(1 as decimal(10, 0)) - cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) - CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(10,0)) - CAST(1 AS SMALLINT)):decimal(11,0)> -- !query output 0 @@ -1133,7 +1133,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0)) - CAST(CAST(CAST(1 AS SM -- !query SELECT cast(1 as decimal(20, 0)) - cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(20,0)) - CAST(1 AS SMALLINT)):decimal(21,0)> -- !query output 0 @@ -1141,7 +1141,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(CAST(CAST(1 AS SM -- !query SELECT cast(1 as decimal(3, 0)) - cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(11,0)) - CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(3,0)) - CAST(1 AS INT)):decimal(11,0)> -- !query output 0 @@ -1149,7 +1149,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(11,0)) - CAST(CAST(CAST(1 AS INT -- !query SELECT cast(1 as decimal(5, 0)) - cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(11,0)) - CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(5,0)) - CAST(1 AS INT)):decimal(11,0)> -- !query output 0 @@ -1157,7 +1157,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(11,0)) - CAST(CAST(CAST(1 AS INT -- !query SELECT cast(1 as decimal(10, 0)) - cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) - CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(10,0)) - CAST(1 AS INT)):decimal(11,0)> -- !query output 0 @@ -1165,7 +1165,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) - CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decima -- !query SELECT cast(1 as decimal(20, 0)) - cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(20,0)) - CAST(1 AS INT)):decimal(21,0)> -- !query output 0 @@ -1173,7 +1173,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(CAST(CAST(1 AS IN -- !query SELECT cast(1 as decimal(3, 0)) - cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(21,0)) - CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(3,0)) - CAST(1 AS BIGINT)):decimal(21,0)> -- !query output 0 @@ -1181,7 +1181,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(21,0)) - CAST(CAST(CAST(1 AS BIG -- !query SELECT cast(1 as decimal(5, 0)) - cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(21,0)) - CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(5,0)) - CAST(1 AS BIGINT)):decimal(21,0)> -- !query output 0 @@ -1189,7 +1189,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(21,0)) - CAST(CAST(CAST(1 AS BIG -- !query SELECT cast(1 as decimal(10, 0)) - cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(21,0)) - CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(10,0)) - CAST(1 AS BIGINT)):decimal(21,0)> -- !query output 0 @@ -1197,7 +1197,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(21,0)) - CAST(CAST(CAST(1 AS BI -- !query SELECT cast(1 as decimal(20, 0)) - cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) - CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(20,0)) - CAST(1 AS BIGINT)):decimal(21,0)> -- !query output 0 @@ -1205,7 +1205,7 @@ struct<(CAST(1 AS DECIMAL(20,0)) - CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):dec -- !query SELECT cast(1 as decimal(3, 0)) - cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) - CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) - CAST(1 AS FLOAT)):double> -- !query output 0.0 @@ -1213,7 +1213,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) - CAST(CAST(1 AS FLOAT) AS DOUBL -- !query SELECT cast(1 as decimal(5, 0)) - cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) - CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) - CAST(1 AS FLOAT)):double> -- !query output 0.0 @@ -1221,7 +1221,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) - CAST(CAST(1 AS FLOAT) AS DOUBL -- !query SELECT cast(1 as decimal(10, 0)) - cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) - CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) - CAST(1 AS FLOAT)):double> -- !query output 0.0 @@ -1229,7 +1229,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) - CAST(CAST(1 AS FLOAT) AS DOUB -- !query SELECT cast(1 as decimal(20, 0)) - cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) - CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) - CAST(1 AS FLOAT)):double> -- !query output 0.0 @@ -1237,7 +1237,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) - CAST(CAST(1 AS FLOAT) AS DOUB -- !query SELECT cast(1 as decimal(3, 0)) - cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) - CAST(1 AS DOUBLE)):double> -- !query output 0.0 @@ -1245,7 +1245,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) - CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(5, 0)) - cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) - CAST(1 AS DOUBLE)):double> -- !query output 0.0 @@ -1253,7 +1253,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) - CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) - cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) - CAST(1 AS DOUBLE)):double> -- !query output 0.0 @@ -1261,7 +1261,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) - CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(20, 0)) - cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) - CAST(1 AS DOUBLE)):double> -- !query output 0.0 @@ -1269,7 +1269,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) - CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(3, 0)) - cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(11,0)) - CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(3,0)) - CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query output 0 @@ -1277,7 +1277,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(11,0)) - CAST(CAST(1 AS DECIMAL( -- !query SELECT cast(1 as decimal(5, 0)) - cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(11,0)) - CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(11,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(5,0)) - CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query output 0 @@ -1293,7 +1293,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) - CAST(1 AS DECIMAL(10,0))):decimal(11,0)> -- !query SELECT cast(1 as decimal(20, 0)) - cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(21,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(20,0)) - CAST(1 AS DECIMAL(10,0))):decimal(21,0)> -- !query output 0 @@ -1301,7 +1301,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(21,0)) - CAST(CAST(1 AS DECIMAL -- !query SELECT cast(1 as decimal(3, 0)) - cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) - CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) - CAST(1 AS STRING)):double> -- !query output 0.0 @@ -1309,7 +1309,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) - CAST(CAST(1 AS STRING) AS DOUB -- !query SELECT cast(1 as decimal(5, 0)) - cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) - CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) - CAST(1 AS STRING)):double> -- !query output 0.0 @@ -1317,7 +1317,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) - CAST(CAST(1 AS STRING) AS DOUB -- !query SELECT cast(1 as decimal(10, 0)) - cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) - CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) - CAST(1 AS STRING)):double> -- !query output 0.0 @@ -1325,7 +1325,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) - CAST(CAST(1 AS STRING) AS DOU -- !query SELECT cast(1 as decimal(20, 0)) - cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) - CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) - CAST(1 AS STRING)):double> -- !query output 0.0 @@ -1408,7 +1408,7 @@ SELECT cast(1 as decimal(3, 0)) - cast('2017-12-11 09:30:00.0' as timestamp) FR struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtracttimestamps(CAST(1 AS DECIMAL(3,0)), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: argument 1 requires timestamp type, however, 'CAST(1 AS DECIMAL(3,0))' is of decimal(3,0) type.; line 1 pos 7 +cannot resolve '(CAST(1 AS DECIMAL(3,0)) - CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: argument 1 requires timestamp type, however, 'CAST(1 AS DECIMAL(3,0))' is of decimal(3,0) type.; line 1 pos 7 -- !query @@ -1417,7 +1417,7 @@ SELECT cast(1 as decimal(5, 0)) - cast('2017-12-11 09:30:00.0' as timestamp) FR struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtracttimestamps(CAST(1 AS DECIMAL(5,0)), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: argument 1 requires timestamp type, however, 'CAST(1 AS DECIMAL(5,0))' is of decimal(5,0) type.; line 1 pos 7 +cannot resolve '(CAST(1 AS DECIMAL(5,0)) - CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: argument 1 requires timestamp type, however, 'CAST(1 AS DECIMAL(5,0))' is of decimal(5,0) type.; line 1 pos 7 -- !query @@ -1426,7 +1426,7 @@ SELECT cast(1 as decimal(10, 0)) - cast('2017-12-11 09:30:00.0' as timestamp) FR struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtracttimestamps(CAST(1 AS DECIMAL(10,0)), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: argument 1 requires timestamp type, however, 'CAST(1 AS DECIMAL(10,0))' is of decimal(10,0) type.; line 1 pos 7 +cannot resolve '(CAST(1 AS DECIMAL(10,0)) - CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: argument 1 requires timestamp type, however, 'CAST(1 AS DECIMAL(10,0))' is of decimal(10,0) type.; line 1 pos 7 -- !query @@ -1435,7 +1435,7 @@ SELECT cast(1 as decimal(20, 0)) - cast('2017-12-11 09:30:00.0' as timestamp) FR struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtracttimestamps(CAST(1 AS DECIMAL(20,0)), CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: argument 1 requires timestamp type, however, 'CAST(1 AS DECIMAL(20,0))' is of decimal(20,0) type.; line 1 pos 7 +cannot resolve '(CAST(1 AS DECIMAL(20,0)) - CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: argument 1 requires timestamp type, however, 'CAST(1 AS DECIMAL(20,0))' is of decimal(20,0) type.; line 1 pos 7 -- !query @@ -1444,7 +1444,7 @@ SELECT cast(1 as decimal(3, 0)) - cast('2017-12-11 09:30:00' as date) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtractdates(CAST(1 AS DECIMAL(3,0)), CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: argument 1 requires date type, however, 'CAST(1 AS DECIMAL(3,0))' is of decimal(3,0) type.; line 1 pos 7 +cannot resolve '(CAST(1 AS DECIMAL(3,0)) - CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: argument 1 requires date type, however, 'CAST(1 AS DECIMAL(3,0))' is of decimal(3,0) type.; line 1 pos 7 -- !query @@ -1453,7 +1453,7 @@ SELECT cast(1 as decimal(5, 0)) - cast('2017-12-11 09:30:00' as date) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtractdates(CAST(1 AS DECIMAL(5,0)), CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: argument 1 requires date type, however, 'CAST(1 AS DECIMAL(5,0))' is of decimal(5,0) type.; line 1 pos 7 +cannot resolve '(CAST(1 AS DECIMAL(5,0)) - CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: argument 1 requires date type, however, 'CAST(1 AS DECIMAL(5,0))' is of decimal(5,0) type.; line 1 pos 7 -- !query @@ -1462,7 +1462,7 @@ SELECT cast(1 as decimal(10, 0)) - cast('2017-12-11 09:30:00' as date) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtractdates(CAST(1 AS DECIMAL(10,0)), CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: argument 1 requires date type, however, 'CAST(1 AS DECIMAL(10,0))' is of decimal(10,0) type.; line 1 pos 7 +cannot resolve '(CAST(1 AS DECIMAL(10,0)) - CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: argument 1 requires date type, however, 'CAST(1 AS DECIMAL(10,0))' is of decimal(10,0) type.; line 1 pos 7 -- !query @@ -1471,13 +1471,13 @@ SELECT cast(1 as decimal(20, 0)) - cast('2017-12-11 09:30:00' as date) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtractdates(CAST(1 AS DECIMAL(20,0)), CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: argument 1 requires date type, however, 'CAST(1 AS DECIMAL(20,0))' is of decimal(20,0) type.; line 1 pos 7 +cannot resolve '(CAST(1 AS DECIMAL(20,0)) - CAST('2017-12-11 09:30:00' AS DATE))' due to data type mismatch: argument 1 requires date type, however, 'CAST(1 AS DECIMAL(20,0))' is of decimal(20,0) type.; line 1 pos 7 -- !query SELECT cast(1 as tinyint) * cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) * CAST(1 AS DECIMAL(3,0))):decimal(7,0)> +struct<(CAST(1 AS TINYINT) * CAST(1 AS DECIMAL(3,0))):decimal(7,0)> -- !query output 1 @@ -1485,7 +1485,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) * CAST(1 AS DECIMAL(3,0))):deci -- !query SELECT cast(1 as tinyint) * cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) * CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0))):decimal(9,0)> +struct<(CAST(1 AS TINYINT) * CAST(1 AS DECIMAL(5,0))):decimal(9,0)> -- !query output 1 @@ -1493,7 +1493,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) * CAST(CA -- !query SELECT cast(1 as tinyint) * cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) * CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(14,0)> +struct<(CAST(1 AS TINYINT) * CAST(1 AS DECIMAL(10,0))):decimal(14,0)> -- !query output 1 @@ -1501,7 +1501,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) * CAST(C -- !query SELECT cast(1 as tinyint) * cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) * CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(24,0)> +struct<(CAST(1 AS TINYINT) * CAST(1 AS DECIMAL(20,0))):decimal(24,0)> -- !query output 1 @@ -1509,7 +1509,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) * CAST(C -- !query SELECT cast(1 as smallint) * cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) * CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0))):decimal(9,0)> +struct<(CAST(1 AS SMALLINT) * CAST(1 AS DECIMAL(3,0))):decimal(9,0)> -- !query output 1 @@ -1517,7 +1517,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) * CAST(C -- !query SELECT cast(1 as smallint) * cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) * CAST(1 AS DECIMAL(5,0))):decimal(11,0)> +struct<(CAST(1 AS SMALLINT) * CAST(1 AS DECIMAL(5,0))):decimal(11,0)> -- !query output 1 @@ -1525,7 +1525,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) * CAST(1 AS DECIMAL(5,0))):dec -- !query SELECT cast(1 as smallint) * cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) * CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(16,0)> +struct<(CAST(1 AS SMALLINT) * CAST(1 AS DECIMAL(10,0))):decimal(16,0)> -- !query output 1 @@ -1533,7 +1533,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) * CAST( -- !query SELECT cast(1 as smallint) * cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) * CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(26,0)> +struct<(CAST(1 AS SMALLINT) * CAST(1 AS DECIMAL(20,0))):decimal(26,0)> -- !query output 1 @@ -1541,7 +1541,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) * CAST( -- !query SELECT cast(1 as int) * cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) * CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(14,0)> +struct<(CAST(1 AS INT) * CAST(1 AS DECIMAL(3,0))):decimal(14,0)> -- !query output 1 @@ -1549,7 +1549,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) * CAST(CAST -- !query SELECT cast(1 as int) * cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) * CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(16,0)> +struct<(CAST(1 AS INT) * CAST(1 AS DECIMAL(5,0))):decimal(16,0)> -- !query output 1 @@ -1557,7 +1557,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) * CAST(CAST -- !query SELECT cast(1 as int) * cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) * CAST(1 AS DECIMAL(10,0))):decimal(21,0)> +struct<(CAST(1 AS INT) * CAST(1 AS DECIMAL(10,0))):decimal(21,0)> -- !query output 1 @@ -1565,7 +1565,7 @@ struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) * CAST(1 AS DECIMAL(10,0))):decima -- !query SELECT cast(1 as int) * cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) * CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(31,0)> +struct<(CAST(1 AS INT) * CAST(1 AS DECIMAL(20,0))):decimal(31,0)> -- !query output 1 @@ -1573,7 +1573,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) * CAST(CAST -- !query SELECT cast(1 as bigint) * cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0))):decimal(24,0)> +struct<(CAST(1 AS BIGINT) * CAST(1 AS DECIMAL(3,0))):decimal(24,0)> -- !query output 1 @@ -1581,7 +1581,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(C -- !query SELECT cast(1 as bigint) * cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0))):decimal(26,0)> +struct<(CAST(1 AS BIGINT) * CAST(1 AS DECIMAL(5,0))):decimal(26,0)> -- !query output 1 @@ -1589,7 +1589,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(C -- !query SELECT cast(1 as bigint) * cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(31,0)> +struct<(CAST(1 AS BIGINT) * CAST(1 AS DECIMAL(10,0))):decimal(31,0)> -- !query output 1 @@ -1597,7 +1597,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(C -- !query SELECT cast(1 as bigint) * cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) * CAST(1 AS DECIMAL(20,0))):decimal(38,0)> +struct<(CAST(1 AS BIGINT) * CAST(1 AS DECIMAL(20,0))):decimal(38,0)> -- !query output 1 @@ -1605,7 +1605,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) * CAST(1 AS DECIMAL(20,0))):dec -- !query SELECT cast(1 as float) * cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) * CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) * CAST(1 AS DECIMAL(3,0))):double> -- !query output 1.0 @@ -1613,7 +1613,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) * CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBL -- !query SELECT cast(1 as float) * cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) * CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) * CAST(1 AS DECIMAL(5,0))):double> -- !query output 1.0 @@ -1621,7 +1621,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) * CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBL -- !query SELECT cast(1 as float) * cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) * CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) * CAST(1 AS DECIMAL(10,0))):double> -- !query output 1.0 @@ -1629,7 +1629,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) * CAST(CAST(1 AS DECIMAL(10,0)) AS DOUB -- !query SELECT cast(1 as float) * cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) * CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) * CAST(1 AS DECIMAL(20,0))):double> -- !query output 1.0 @@ -1637,7 +1637,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) * CAST(CAST(1 AS DECIMAL(20,0)) AS DOUB -- !query SELECT cast(1 as double) * cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) * CAST(1 AS DECIMAL(3,0))):double> -- !query output 1.0 @@ -1645,7 +1645,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) * cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) * CAST(1 AS DECIMAL(5,0))):double> -- !query output 1.0 @@ -1653,7 +1653,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) * cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) * CAST(1 AS DECIMAL(10,0))):double> -- !query output 1.0 @@ -1661,7 +1661,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) * cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) * CAST(1 AS DECIMAL(20,0))):double> -- !query output 1.0 @@ -1669,7 +1669,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) * cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) * CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(14,0)> +struct<(CAST(1 AS DECIMAL(10,0)) * CAST(1 AS DECIMAL(3,0))):decimal(14,0)> -- !query output 1 @@ -1677,7 +1677,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) * CAST(CAST(1 AS DECIMAL -- !query SELECT cast(1 as decimal(10, 0)) * cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) * CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(16,0)> +struct<(CAST(1 AS DECIMAL(10,0)) * CAST(1 AS DECIMAL(5,0))):decimal(16,0)> -- !query output 1 @@ -1693,7 +1693,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) * CAST(1 AS DECIMAL(10,0))):decimal(21,0)> -- !query SELECT cast(1 as decimal(10, 0)) * cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) * CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(31,0)> +struct<(CAST(1 AS DECIMAL(10,0)) * CAST(1 AS DECIMAL(20,0))):decimal(31,0)> -- !query output 1 @@ -1809,7 +1809,7 @@ cannot resolve '(CAST('2017*12*11 09:30:00' AS DATE) * CAST(1 AS DECIMAL(20,0))) -- !query SELECT cast(1 as decimal(3, 0)) * cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) * CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):decimal(7,0)> +struct<(CAST(1 AS DECIMAL(3,0)) * CAST(1 AS TINYINT)):decimal(7,0)> -- !query output 1 @@ -1817,7 +1817,7 @@ struct<(CAST(1 AS DECIMAL(3,0)) * CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):deci -- !query SELECT cast(1 as decimal(5, 0)) * cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) * CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0))):decimal(9,0)> +struct<(CAST(1 AS DECIMAL(5,0)) * CAST(1 AS TINYINT)):decimal(9,0)> -- !query output 1 @@ -1825,7 +1825,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) * CAST(CAST(CAST(1 AS TINY -- !query SELECT cast(1 as decimal(10, 0)) * cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) * CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(14,0)> +struct<(CAST(1 AS DECIMAL(10,0)) * CAST(1 AS TINYINT)):decimal(14,0)> -- !query output 1 @@ -1833,7 +1833,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) * CAST(CAST(CAST(1 AS TI -- !query SELECT cast(1 as decimal(20, 0)) * cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0))):decimal(24,0)> +struct<(CAST(1 AS DECIMAL(20,0)) * CAST(1 AS TINYINT)):decimal(24,0)> -- !query output 1 @@ -1841,7 +1841,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(CAST(CAST(1 AS TI -- !query SELECT cast(1 as decimal(3, 0)) * cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) * CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0))):decimal(9,0)> +struct<(CAST(1 AS DECIMAL(3,0)) * CAST(1 AS SMALLINT)):decimal(9,0)> -- !query output 1 @@ -1849,7 +1849,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) * CAST(CAST(CAST(1 AS SMAL -- !query SELECT cast(1 as decimal(5, 0)) * cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) * CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):decimal(11,0)> +struct<(CAST(1 AS DECIMAL(5,0)) * CAST(1 AS SMALLINT)):decimal(11,0)> -- !query output 1 @@ -1857,7 +1857,7 @@ struct<(CAST(1 AS DECIMAL(5,0)) * CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):dec -- !query SELECT cast(1 as decimal(10, 0)) * cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) * CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(16,0)> +struct<(CAST(1 AS DECIMAL(10,0)) * CAST(1 AS SMALLINT)):decimal(16,0)> -- !query output 1 @@ -1865,7 +1865,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) * CAST(CAST(CAST(1 AS SM -- !query SELECT cast(1 as decimal(20, 0)) * cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0))):decimal(26,0)> +struct<(CAST(1 AS DECIMAL(20,0)) * CAST(1 AS SMALLINT)):decimal(26,0)> -- !query output 1 @@ -1873,7 +1873,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(CAST(CAST(1 AS SM -- !query SELECT cast(1 as decimal(3, 0)) * cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) * CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(14,0)> +struct<(CAST(1 AS DECIMAL(3,0)) * CAST(1 AS INT)):decimal(14,0)> -- !query output 1 @@ -1881,7 +1881,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) * CAST(CAST(CAST(1 AS INT -- !query SELECT cast(1 as decimal(5, 0)) * cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) * CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(16,0)> +struct<(CAST(1 AS DECIMAL(5,0)) * CAST(1 AS INT)):decimal(16,0)> -- !query output 1 @@ -1889,7 +1889,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) * CAST(CAST(CAST(1 AS INT -- !query SELECT cast(1 as decimal(10, 0)) * cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) * CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decimal(21,0)> +struct<(CAST(1 AS DECIMAL(10,0)) * CAST(1 AS INT)):decimal(21,0)> -- !query output 1 @@ -1897,7 +1897,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) * CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decima -- !query SELECT cast(1 as decimal(20, 0)) * cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(31,0)> +struct<(CAST(1 AS DECIMAL(20,0)) * CAST(1 AS INT)):decimal(31,0)> -- !query output 1 @@ -1905,7 +1905,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(CAST(CAST(1 AS IN -- !query SELECT cast(1 as decimal(3, 0)) * cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) * CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(24,0)> +struct<(CAST(1 AS DECIMAL(3,0)) * CAST(1 AS BIGINT)):decimal(24,0)> -- !query output 1 @@ -1913,7 +1913,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) * CAST(CAST(CAST(1 AS BIG -- !query SELECT cast(1 as decimal(5, 0)) * cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) * CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(26,0)> +struct<(CAST(1 AS DECIMAL(5,0)) * CAST(1 AS BIGINT)):decimal(26,0)> -- !query output 1 @@ -1921,7 +1921,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) * CAST(CAST(CAST(1 AS BIG -- !query SELECT cast(1 as decimal(10, 0)) * cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) * CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(31,0)> +struct<(CAST(1 AS DECIMAL(10,0)) * CAST(1 AS BIGINT)):decimal(31,0)> -- !query output 1 @@ -1929,7 +1929,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) * CAST(CAST(CAST(1 AS BI -- !query SELECT cast(1 as decimal(20, 0)) * cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) * CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):decimal(38,0)> +struct<(CAST(1 AS DECIMAL(20,0)) * CAST(1 AS BIGINT)):decimal(38,0)> -- !query output 1 @@ -1937,7 +1937,7 @@ struct<(CAST(1 AS DECIMAL(20,0)) * CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):dec -- !query SELECT cast(1 as decimal(3, 0)) * cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) * CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) * CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -1945,7 +1945,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) * CAST(CAST(1 AS FLOAT) AS DOUBL -- !query SELECT cast(1 as decimal(5, 0)) * cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) * CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) * CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -1953,7 +1953,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) * CAST(CAST(1 AS FLOAT) AS DOUBL -- !query SELECT cast(1 as decimal(10, 0)) * cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) * CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) * CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -1961,7 +1961,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) * CAST(CAST(1 AS FLOAT) AS DOUB -- !query SELECT cast(1 as decimal(20, 0)) * cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) * CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) * CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -1969,7 +1969,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) * CAST(CAST(1 AS FLOAT) AS DOUB -- !query SELECT cast(1 as decimal(3, 0)) * cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) * CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -1977,7 +1977,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) * CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(5, 0)) * cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) * CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -1985,7 +1985,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) * CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) * cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) * CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -1993,7 +1993,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) * CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(20, 0)) * cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) * CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -2001,7 +2001,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) * CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(3, 0)) * cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) * CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(14,0)> +struct<(CAST(1 AS DECIMAL(3,0)) * CAST(1 AS DECIMAL(10,0))):decimal(14,0)> -- !query output 1 @@ -2009,7 +2009,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) * CAST(CAST(1 AS DECIMAL( -- !query SELECT cast(1 as decimal(5, 0)) * cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) * CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(16,0)> +struct<(CAST(1 AS DECIMAL(5,0)) * CAST(1 AS DECIMAL(10,0))):decimal(16,0)> -- !query output 1 @@ -2025,7 +2025,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) * CAST(1 AS DECIMAL(10,0))):decimal(21,0)> -- !query SELECT cast(1 as decimal(20, 0)) * cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(31,0)> +struct<(CAST(1 AS DECIMAL(20,0)) * CAST(1 AS DECIMAL(10,0))):decimal(31,0)> -- !query output 1 @@ -2033,7 +2033,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) * CAST(CAST(1 AS DECIMAL -- !query SELECT cast(1 as decimal(3, 0)) * cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) * CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) * CAST(1 AS STRING)):double> -- !query output 1.0 @@ -2041,7 +2041,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) * CAST(CAST(1 AS STRING) AS DOUB -- !query SELECT cast(1 as decimal(5, 0)) * cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) * CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) * CAST(1 AS STRING)):double> -- !query output 1.0 @@ -2049,7 +2049,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) * CAST(CAST(1 AS STRING) AS DOUB -- !query SELECT cast(1 as decimal(10, 0)) * cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) * CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) * CAST(1 AS STRING)):double> -- !query output 1.0 @@ -2057,7 +2057,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) * CAST(CAST(1 AS STRING) AS DOU -- !query SELECT cast(1 as decimal(20, 0)) * cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) * CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) * CAST(1 AS STRING)):double> -- !query output 1.0 @@ -2209,7 +2209,7 @@ cannot resolve '(CAST(1 AS DECIMAL(20,0)) * CAST('2017*12*11 09:30:00' AS DATE)) -- !query SELECT cast(1 as tinyint) / cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) / CAST(1 AS DECIMAL(3,0))):decimal(9,6)> +struct<(CAST(1 AS TINYINT) / CAST(1 AS DECIMAL(3,0))):decimal(9,6)> -- !query output 1.000000 @@ -2217,7 +2217,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) / CAST(1 AS DECIMAL(3,0))):deci -- !query SELECT cast(1 as tinyint) / cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) / CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0))):decimal(9,6)> +struct<(CAST(1 AS TINYINT) / CAST(1 AS DECIMAL(5,0))):decimal(9,6)> -- !query output 1.000000 @@ -2225,7 +2225,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) / CAST(CA -- !query SELECT cast(1 as tinyint) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(14,11)> +struct<(CAST(1 AS TINYINT) / CAST(1 AS DECIMAL(10,0))):decimal(14,11)> -- !query output 1.00000000000 @@ -2233,7 +2233,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(C -- !query SELECT cast(1 as tinyint) / cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(24,21)> +struct<(CAST(1 AS TINYINT) / CAST(1 AS DECIMAL(20,0))):decimal(24,21)> -- !query output 1.000000000000000000000 @@ -2241,7 +2241,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) / CAST(C -- !query SELECT cast(1 as smallint) / cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) / CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0))):decimal(11,6)> +struct<(CAST(1 AS SMALLINT) / CAST(1 AS DECIMAL(3,0))):decimal(11,6)> -- !query output 1.000000 @@ -2249,7 +2249,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) / CAST(C -- !query SELECT cast(1 as smallint) / cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) / CAST(1 AS DECIMAL(5,0))):decimal(11,6)> +struct<(CAST(1 AS SMALLINT) / CAST(1 AS DECIMAL(5,0))):decimal(11,6)> -- !query output 1.000000 @@ -2257,7 +2257,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) / CAST(1 AS DECIMAL(5,0))):dec -- !query SELECT cast(1 as smallint) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(16,11)> +struct<(CAST(1 AS SMALLINT) / CAST(1 AS DECIMAL(10,0))):decimal(16,11)> -- !query output 1.00000000000 @@ -2265,7 +2265,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) / CAST( -- !query SELECT cast(1 as smallint) / cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(26,21)> +struct<(CAST(1 AS SMALLINT) / CAST(1 AS DECIMAL(20,0))):decimal(26,21)> -- !query output 1.000000000000000000000 @@ -2273,7 +2273,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) / CAST( -- !query SELECT cast(1 as int) / cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(16,6)> +struct<(CAST(1 AS INT) / CAST(1 AS DECIMAL(3,0))):decimal(16,6)> -- !query output 1.000000 @@ -2281,7 +2281,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST -- !query SELECT cast(1 as int) / cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(16,6)> +struct<(CAST(1 AS INT) / CAST(1 AS DECIMAL(5,0))):decimal(16,6)> -- !query output 1.000000 @@ -2289,7 +2289,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST -- !query SELECT cast(1 as int) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)> +struct<(CAST(1 AS INT) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)> -- !query output 1.00000000000 @@ -2297,7 +2297,7 @@ struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decima -- !query SELECT cast(1 as int) / cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(31,21)> +struct<(CAST(1 AS INT) / CAST(1 AS DECIMAL(20,0))):decimal(31,21)> -- !query output 1.000000000000000000000 @@ -2305,7 +2305,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) / CAST(CAST -- !query SELECT cast(1 as bigint) / cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0))):decimal(26,6)> +struct<(CAST(1 AS BIGINT) / CAST(1 AS DECIMAL(3,0))):decimal(26,6)> -- !query output 1.000000 @@ -2313,7 +2313,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(C -- !query SELECT cast(1 as bigint) / cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0))):decimal(26,6)> +struct<(CAST(1 AS BIGINT) / CAST(1 AS DECIMAL(5,0))):decimal(26,6)> -- !query output 1.000000 @@ -2321,7 +2321,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(C -- !query SELECT cast(1 as bigint) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(31,11)> +struct<(CAST(1 AS BIGINT) / CAST(1 AS DECIMAL(10,0))):decimal(31,11)> -- !query output 1.00000000000 @@ -2329,7 +2329,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(C -- !query SELECT cast(1 as bigint) / cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) / CAST(1 AS DECIMAL(20,0))):decimal(38,18)> +struct<(CAST(1 AS BIGINT) / CAST(1 AS DECIMAL(20,0))):decimal(38,18)> -- !query output 1.000000000000000000 @@ -2337,7 +2337,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) / CAST(1 AS DECIMAL(20,0))):dec -- !query SELECT cast(1 as float) / cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / CAST(1 AS DECIMAL(3,0))):double> -- !query output 1.0 @@ -2345,7 +2345,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS DECIMAL(3,0)) AS -- !query SELECT cast(1 as float) / cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / CAST(1 AS DECIMAL(5,0))):double> -- !query output 1.0 @@ -2353,7 +2353,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS DECIMAL(5,0)) AS -- !query SELECT cast(1 as float) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / CAST(1 AS DECIMAL(10,0))):double> -- !query output 1.0 @@ -2361,7 +2361,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS DECIMAL(10,0)) AS -- !query SELECT cast(1 as float) / cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / CAST(1 AS DECIMAL(20,0))):double> -- !query output 1.0 @@ -2369,7 +2369,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS DECIMAL(20,0)) AS -- !query SELECT cast(1 as double) / cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) / CAST(1 AS DECIMAL(3,0))):double> -- !query output 1.0 @@ -2377,7 +2377,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) / cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) / CAST(1 AS DECIMAL(5,0))):double> -- !query output 1.0 @@ -2385,7 +2385,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) / CAST(1 AS DECIMAL(10,0))):double> -- !query output 1.0 @@ -2393,7 +2393,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) / cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) / CAST(1 AS DECIMAL(20,0))):double> -- !query output 1.0 @@ -2401,7 +2401,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(16,6)> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(3,0))):decimal(16,6)> -- !query output 1.000000 @@ -2409,7 +2409,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(16,6)> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(5,0))):decimal(16,6)> -- !query output 1.000000 @@ -2425,7 +2425,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)> -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(31,21)> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(20,0))):decimal(31,21)> -- !query output 1.000000000000000000000 @@ -2541,7 +2541,7 @@ cannot resolve '(CAST('2017/12/11 09:30:00' AS DATE) / CAST(1 AS DECIMAL(20,0))) -- !query SELECT cast(1 as decimal(3, 0)) / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) / CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):decimal(9,6)> +struct<(CAST(1 AS DECIMAL(3,0)) / CAST(1 AS TINYINT)):decimal(9,6)> -- !query output 1.000000 @@ -2549,7 +2549,7 @@ struct<(CAST(1 AS DECIMAL(3,0)) / CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):deci -- !query SELECT cast(1 as decimal(5, 0)) / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) / CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0))):decimal(11,6)> +struct<(CAST(1 AS DECIMAL(5,0)) / CAST(1 AS TINYINT)):decimal(11,6)> -- !query output 1.000000 @@ -2557,7 +2557,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) / CAST(CAST(CAST(1 AS TINY -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(16,6)> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS TINYINT)):decimal(16,6)> -- !query output 1.000000 @@ -2565,7 +2565,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS TI -- !query SELECT cast(1 as decimal(20, 0)) / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0))):decimal(26,6)> +struct<(CAST(1 AS DECIMAL(20,0)) / CAST(1 AS TINYINT)):decimal(26,6)> -- !query output 1.000000 @@ -2573,7 +2573,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS TI -- !query SELECT cast(1 as decimal(3, 0)) / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) / CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0))):decimal(9,6)> +struct<(CAST(1 AS DECIMAL(3,0)) / CAST(1 AS SMALLINT)):decimal(9,6)> -- !query output 1.000000 @@ -2581,7 +2581,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) / CAST(CAST(CAST(1 AS SMAL -- !query SELECT cast(1 as decimal(5, 0)) / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) / CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):decimal(11,6)> +struct<(CAST(1 AS DECIMAL(5,0)) / CAST(1 AS SMALLINT)):decimal(11,6)> -- !query output 1.000000 @@ -2589,7 +2589,7 @@ struct<(CAST(1 AS DECIMAL(5,0)) / CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):dec -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(16,6)> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS SMALLINT)):decimal(16,6)> -- !query output 1.000000 @@ -2597,7 +2597,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS SM -- !query SELECT cast(1 as decimal(20, 0)) / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0))):decimal(26,6)> +struct<(CAST(1 AS DECIMAL(20,0)) / CAST(1 AS SMALLINT)):decimal(26,6)> -- !query output 1.000000 @@ -2605,7 +2605,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS SM -- !query SELECT cast(1 as decimal(3, 0)) / cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(14,11)> +struct<(CAST(1 AS DECIMAL(3,0)) / CAST(1 AS INT)):decimal(14,11)> -- !query output 1.00000000000 @@ -2613,7 +2613,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS INT -- !query SELECT cast(1 as decimal(5, 0)) / cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(16,11)> +struct<(CAST(1 AS DECIMAL(5,0)) / CAST(1 AS INT)):decimal(16,11)> -- !query output 1.00000000000 @@ -2621,7 +2621,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS INT -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) / CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decimal(21,11)> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS INT)):decimal(21,11)> -- !query output 1.00000000000 @@ -2629,7 +2629,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) / CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decima -- !query SELECT cast(1 as decimal(20, 0)) / cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(31,11)> +struct<(CAST(1 AS DECIMAL(20,0)) / CAST(1 AS INT)):decimal(31,11)> -- !query output 1.00000000000 @@ -2637,7 +2637,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS IN -- !query SELECT cast(1 as decimal(3, 0)) / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(24,21)> +struct<(CAST(1 AS DECIMAL(3,0)) / CAST(1 AS BIGINT)):decimal(24,21)> -- !query output 1.000000000000000000000 @@ -2645,7 +2645,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BIG -- !query SELECT cast(1 as decimal(5, 0)) / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(26,21)> +struct<(CAST(1 AS DECIMAL(5,0)) / CAST(1 AS BIGINT)):decimal(26,21)> -- !query output 1.000000000000000000000 @@ -2653,7 +2653,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BIG -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(31,21)> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS BIGINT)):decimal(31,21)> -- !query output 1.000000000000000000000 @@ -2661,7 +2661,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BI -- !query SELECT cast(1 as decimal(20, 0)) / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) / CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):decimal(38,18)> +struct<(CAST(1 AS DECIMAL(20,0)) / CAST(1 AS BIGINT)):decimal(38,18)> -- !query output 1.000000000000000000 @@ -2669,7 +2669,7 @@ struct<(CAST(1 AS DECIMAL(20,0)) / CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):dec -- !query SELECT cast(1 as decimal(3, 0)) / cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -2677,7 +2677,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBL -- !query SELECT cast(1 as decimal(5, 0)) / cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -2685,7 +2685,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBL -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -2693,7 +2693,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUB -- !query SELECT cast(1 as decimal(20, 0)) / cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -2701,7 +2701,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUB -- !query SELECT cast(1 as decimal(3, 0)) / cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) / CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) / CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -2709,7 +2709,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) / CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(5, 0)) / cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) / CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) / CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -2717,7 +2717,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) / CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -2725,7 +2725,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(20, 0)) / cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) / CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) / CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -2733,7 +2733,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) / CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(3, 0)) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(14,11)> +struct<(CAST(1 AS DECIMAL(3,0)) / CAST(1 AS DECIMAL(10,0))):decimal(14,11)> -- !query output 1.00000000000 @@ -2741,7 +2741,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL( -- !query SELECT cast(1 as decimal(5, 0)) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(16,11)> +struct<(CAST(1 AS DECIMAL(5,0)) / CAST(1 AS DECIMAL(10,0))):decimal(16,11)> -- !query output 1.00000000000 @@ -2757,7 +2757,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)> -- !query SELECT cast(1 as decimal(20, 0)) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(31,11)> +struct<(CAST(1 AS DECIMAL(20,0)) / CAST(1 AS DECIMAL(10,0))):decimal(31,11)> -- !query output 1.00000000000 @@ -2765,7 +2765,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL -- !query SELECT cast(1 as decimal(3, 0)) / cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) / CAST(1 AS STRING)):double> -- !query output 1.0 @@ -2773,7 +2773,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUB -- !query SELECT cast(1 as decimal(5, 0)) / cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) / CAST(1 AS STRING)):double> -- !query output 1.0 @@ -2781,7 +2781,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUB -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS STRING)):double> -- !query output 1.0 @@ -2789,7 +2789,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOU -- !query SELECT cast(1 as decimal(20, 0)) / cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) / CAST(1 AS STRING)):double> -- !query output 1.0 @@ -2941,7 +2941,7 @@ cannot resolve '(CAST(1 AS DECIMAL(20,0)) / CAST('2017/12/11 09:30:00' AS DATE)) -- !query SELECT cast(1 as tinyint) % cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) % CAST(1 AS DECIMAL(3,0))):decimal(3,0)> +struct<(CAST(1 AS TINYINT) % CAST(1 AS DECIMAL(3,0))):decimal(3,0)> -- !query output 0 @@ -2949,7 +2949,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) % CAST(1 AS DECIMAL(3,0))):deci -- !query SELECT cast(1 as tinyint) % cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) % CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0))):decimal(3,0)> +struct<(CAST(1 AS TINYINT) % CAST(1 AS DECIMAL(5,0))):decimal(3,0)> -- !query output 0 @@ -2957,7 +2957,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) % CAST(CA -- !query SELECT cast(1 as tinyint) % cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) % CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(3,0)> +struct<(CAST(1 AS TINYINT) % CAST(1 AS DECIMAL(10,0))):decimal(3,0)> -- !query output 0 @@ -2965,7 +2965,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) % CAST(C -- !query SELECT cast(1 as tinyint) % cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) % CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(3,0)> +struct<(CAST(1 AS TINYINT) % CAST(1 AS DECIMAL(20,0))):decimal(3,0)> -- !query output 0 @@ -2973,7 +2973,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) % CAST(C -- !query SELECT cast(1 as smallint) % cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) % CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0))):decimal(3,0)> +struct<(CAST(1 AS SMALLINT) % CAST(1 AS DECIMAL(3,0))):decimal(3,0)> -- !query output 0 @@ -2981,7 +2981,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) % CAST(C -- !query SELECT cast(1 as smallint) % cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) % CAST(1 AS DECIMAL(5,0))):decimal(5,0)> +struct<(CAST(1 AS SMALLINT) % CAST(1 AS DECIMAL(5,0))):decimal(5,0)> -- !query output 0 @@ -2989,7 +2989,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) % CAST(1 AS DECIMAL(5,0))):dec -- !query SELECT cast(1 as smallint) % cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) % CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(5,0)> +struct<(CAST(1 AS SMALLINT) % CAST(1 AS DECIMAL(10,0))):decimal(5,0)> -- !query output 0 @@ -2997,7 +2997,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) % CAST( -- !query SELECT cast(1 as smallint) % cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) % CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(5,0)> +struct<(CAST(1 AS SMALLINT) % CAST(1 AS DECIMAL(20,0))):decimal(5,0)> -- !query output 0 @@ -3005,7 +3005,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) % CAST( -- !query SELECT cast(1 as int) % cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) % CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(3,0)> +struct<(CAST(1 AS INT) % CAST(1 AS DECIMAL(3,0))):decimal(3,0)> -- !query output 0 @@ -3013,7 +3013,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) % CAST(CAST -- !query SELECT cast(1 as int) % cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) % CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(5,0)> +struct<(CAST(1 AS INT) % CAST(1 AS DECIMAL(5,0))):decimal(5,0)> -- !query output 0 @@ -3021,7 +3021,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) % CAST(CAST -- !query SELECT cast(1 as int) % cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) % CAST(1 AS DECIMAL(10,0))):decimal(10,0)> +struct<(CAST(1 AS INT) % CAST(1 AS DECIMAL(10,0))):decimal(10,0)> -- !query output 0 @@ -3029,7 +3029,7 @@ struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) % CAST(1 AS DECIMAL(10,0))):decima -- !query SELECT cast(1 as int) % cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) % CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(10,0)> +struct<(CAST(1 AS INT) % CAST(1 AS DECIMAL(20,0))):decimal(10,0)> -- !query output 0 @@ -3037,7 +3037,7 @@ struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) % CAST(CAST -- !query SELECT cast(1 as bigint) % cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0))):decimal(3,0)> +struct<(CAST(1 AS BIGINT) % CAST(1 AS DECIMAL(3,0))):decimal(3,0)> -- !query output 0 @@ -3045,7 +3045,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(C -- !query SELECT cast(1 as bigint) % cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0))):decimal(5,0)> +struct<(CAST(1 AS BIGINT) % CAST(1 AS DECIMAL(5,0))):decimal(5,0)> -- !query output 0 @@ -3053,7 +3053,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(C -- !query SELECT cast(1 as bigint) % cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(10,0)> +struct<(CAST(1 AS BIGINT) % CAST(1 AS DECIMAL(10,0))):decimal(10,0)> -- !query output 0 @@ -3061,7 +3061,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(C -- !query SELECT cast(1 as bigint) % cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) % CAST(1 AS DECIMAL(20,0))):decimal(20,0)> +struct<(CAST(1 AS BIGINT) % CAST(1 AS DECIMAL(20,0))):decimal(20,0)> -- !query output 0 @@ -3069,7 +3069,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) % CAST(1 AS DECIMAL(20,0))):dec -- !query SELECT cast(1 as float) % cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) % CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) % CAST(1 AS DECIMAL(3,0))):double> -- !query output 0.0 @@ -3077,7 +3077,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) % CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBL -- !query SELECT cast(1 as float) % cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) % CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) % CAST(1 AS DECIMAL(5,0))):double> -- !query output 0.0 @@ -3085,7 +3085,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) % CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBL -- !query SELECT cast(1 as float) % cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) % CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) % CAST(1 AS DECIMAL(10,0))):double> -- !query output 0.0 @@ -3093,7 +3093,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) % CAST(CAST(1 AS DECIMAL(10,0)) AS DOUB -- !query SELECT cast(1 as float) % cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) % CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) % CAST(1 AS DECIMAL(20,0))):double> -- !query output 0.0 @@ -3101,7 +3101,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) % CAST(CAST(1 AS DECIMAL(20,0)) AS DOUB -- !query SELECT cast(1 as double) % cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) % CAST(1 AS DECIMAL(3,0))):double> -- !query output 0.0 @@ -3109,7 +3109,7 @@ struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) % cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) % CAST(1 AS DECIMAL(5,0))):double> -- !query output 0.0 @@ -3117,7 +3117,7 @@ struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) % cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) % CAST(1 AS DECIMAL(10,0))):double> -- !query output 0.0 @@ -3125,7 +3125,7 @@ struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) % cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) % CAST(1 AS DECIMAL(20,0))):double> -- !query output 0.0 @@ -3133,7 +3133,7 @@ struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) % cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) % CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(3,0)> +struct<(CAST(1 AS DECIMAL(10,0)) % CAST(1 AS DECIMAL(3,0))):decimal(3,0)> -- !query output 0 @@ -3141,7 +3141,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) % CAST(CAST(1 AS DECIMAL -- !query SELECT cast(1 as decimal(10, 0)) % cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) % CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(5,0)> +struct<(CAST(1 AS DECIMAL(10,0)) % CAST(1 AS DECIMAL(5,0))):decimal(5,0)> -- !query output 0 @@ -3157,7 +3157,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) % CAST(1 AS DECIMAL(10,0))):decimal(10,0)> -- !query SELECT cast(1 as decimal(10, 0)) % cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) % CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(10,0)> +struct<(CAST(1 AS DECIMAL(10,0)) % CAST(1 AS DECIMAL(20,0))):decimal(10,0)> -- !query output 0 @@ -3273,7 +3273,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) % CAST(1 AS DECIMAL(20,0))) -- !query SELECT cast(1 as decimal(3, 0)) % cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) % CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):decimal(3,0)> +struct<(CAST(1 AS DECIMAL(3,0)) % CAST(1 AS TINYINT)):decimal(3,0)> -- !query output 0 @@ -3281,7 +3281,7 @@ struct<(CAST(1 AS DECIMAL(3,0)) % CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):deci -- !query SELECT cast(1 as decimal(5, 0)) % cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) % CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0))):decimal(3,0)> +struct<(CAST(1 AS DECIMAL(5,0)) % CAST(1 AS TINYINT)):decimal(3,0)> -- !query output 0 @@ -3289,7 +3289,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) % CAST(CAST(CAST(1 AS TINY -- !query SELECT cast(1 as decimal(10, 0)) % cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) % CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(3,0)> +struct<(CAST(1 AS DECIMAL(10,0)) % CAST(1 AS TINYINT)):decimal(3,0)> -- !query output 0 @@ -3297,7 +3297,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) % CAST(CAST(CAST(1 AS TI -- !query SELECT cast(1 as decimal(20, 0)) % cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0))):decimal(3,0)> +struct<(CAST(1 AS DECIMAL(20,0)) % CAST(1 AS TINYINT)):decimal(3,0)> -- !query output 0 @@ -3305,7 +3305,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(CAST(CAST(1 AS TI -- !query SELECT cast(1 as decimal(3, 0)) % cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) % CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0))):decimal(3,0)> +struct<(CAST(1 AS DECIMAL(3,0)) % CAST(1 AS SMALLINT)):decimal(3,0)> -- !query output 0 @@ -3313,7 +3313,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) % CAST(CAST(CAST(1 AS SMAL -- !query SELECT cast(1 as decimal(5, 0)) % cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) % CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):decimal(5,0)> +struct<(CAST(1 AS DECIMAL(5,0)) % CAST(1 AS SMALLINT)):decimal(5,0)> -- !query output 0 @@ -3321,7 +3321,7 @@ struct<(CAST(1 AS DECIMAL(5,0)) % CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):dec -- !query SELECT cast(1 as decimal(10, 0)) % cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) % CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(5,0)> +struct<(CAST(1 AS DECIMAL(10,0)) % CAST(1 AS SMALLINT)):decimal(5,0)> -- !query output 0 @@ -3329,7 +3329,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) % CAST(CAST(CAST(1 AS SM -- !query SELECT cast(1 as decimal(20, 0)) % cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0))):decimal(5,0)> +struct<(CAST(1 AS DECIMAL(20,0)) % CAST(1 AS SMALLINT)):decimal(5,0)> -- !query output 0 @@ -3337,7 +3337,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(CAST(CAST(1 AS SM -- !query SELECT cast(1 as decimal(3, 0)) % cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) % CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(3,0)> +struct<(CAST(1 AS DECIMAL(3,0)) % CAST(1 AS INT)):decimal(3,0)> -- !query output 0 @@ -3345,7 +3345,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) % CAST(CAST(CAST(1 AS INT -- !query SELECT cast(1 as decimal(5, 0)) % cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) % CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(5,0)> +struct<(CAST(1 AS DECIMAL(5,0)) % CAST(1 AS INT)):decimal(5,0)> -- !query output 0 @@ -3353,7 +3353,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) % CAST(CAST(CAST(1 AS INT -- !query SELECT cast(1 as decimal(10, 0)) % cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) % CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decimal(10,0)> +struct<(CAST(1 AS DECIMAL(10,0)) % CAST(1 AS INT)):decimal(10,0)> -- !query output 0 @@ -3361,7 +3361,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) % CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decima -- !query SELECT cast(1 as decimal(20, 0)) % cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(10,0)> +struct<(CAST(1 AS DECIMAL(20,0)) % CAST(1 AS INT)):decimal(10,0)> -- !query output 0 @@ -3369,7 +3369,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(CAST(CAST(1 AS IN -- !query SELECT cast(1 as decimal(3, 0)) % cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) % CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(3,0)> +struct<(CAST(1 AS DECIMAL(3,0)) % CAST(1 AS BIGINT)):decimal(3,0)> -- !query output 0 @@ -3377,7 +3377,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) % CAST(CAST(CAST(1 AS BIG -- !query SELECT cast(1 as decimal(5, 0)) % cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) % CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(5,0)> +struct<(CAST(1 AS DECIMAL(5,0)) % CAST(1 AS BIGINT)):decimal(5,0)> -- !query output 0 @@ -3385,7 +3385,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) % CAST(CAST(CAST(1 AS BIG -- !query SELECT cast(1 as decimal(10, 0)) % cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) % CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(10,0)> +struct<(CAST(1 AS DECIMAL(10,0)) % CAST(1 AS BIGINT)):decimal(10,0)> -- !query output 0 @@ -3393,7 +3393,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) % CAST(CAST(CAST(1 AS BI -- !query SELECT cast(1 as decimal(20, 0)) % cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) % CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):decimal(20,0)> +struct<(CAST(1 AS DECIMAL(20,0)) % CAST(1 AS BIGINT)):decimal(20,0)> -- !query output 0 @@ -3401,7 +3401,7 @@ struct<(CAST(1 AS DECIMAL(20,0)) % CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):dec -- !query SELECT cast(1 as decimal(3, 0)) % cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) % CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) % CAST(1 AS FLOAT)):double> -- !query output 0.0 @@ -3409,7 +3409,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) % CAST(CAST(1 AS FLOAT) AS DOUBL -- !query SELECT cast(1 as decimal(5, 0)) % cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) % CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) % CAST(1 AS FLOAT)):double> -- !query output 0.0 @@ -3417,7 +3417,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) % CAST(CAST(1 AS FLOAT) AS DOUBL -- !query SELECT cast(1 as decimal(10, 0)) % cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) % CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) % CAST(1 AS FLOAT)):double> -- !query output 0.0 @@ -3425,7 +3425,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) % CAST(CAST(1 AS FLOAT) AS DOUB -- !query SELECT cast(1 as decimal(20, 0)) % cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) % CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) % CAST(1 AS FLOAT)):double> -- !query output 0.0 @@ -3433,7 +3433,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) % CAST(CAST(1 AS FLOAT) AS DOUB -- !query SELECT cast(1 as decimal(3, 0)) % cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) % CAST(1 AS DOUBLE)):double> -- !query output 0.0 @@ -3441,7 +3441,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) % CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(5, 0)) % cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) % CAST(1 AS DOUBLE)):double> -- !query output 0.0 @@ -3449,7 +3449,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) % CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) % cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) % CAST(1 AS DOUBLE)):double> -- !query output 0.0 @@ -3457,7 +3457,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) % CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(20, 0)) % cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) % CAST(1 AS DOUBLE)):double> -- !query output 0.0 @@ -3465,7 +3465,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) % CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(3, 0)) % cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) % CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(3,0)> +struct<(CAST(1 AS DECIMAL(3,0)) % CAST(1 AS DECIMAL(10,0))):decimal(3,0)> -- !query output 0 @@ -3473,7 +3473,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) % CAST(CAST(1 AS DECIMAL( -- !query SELECT cast(1 as decimal(5, 0)) % cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) % CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(5,0)> +struct<(CAST(1 AS DECIMAL(5,0)) % CAST(1 AS DECIMAL(10,0))):decimal(5,0)> -- !query output 0 @@ -3489,7 +3489,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) % CAST(1 AS DECIMAL(10,0))):decimal(10,0)> -- !query SELECT cast(1 as decimal(20, 0)) % cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(10,0)> +struct<(CAST(1 AS DECIMAL(20,0)) % CAST(1 AS DECIMAL(10,0))):decimal(10,0)> -- !query output 0 @@ -3497,7 +3497,7 @@ struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) % CAST(CAST(1 AS DECIMAL -- !query SELECT cast(1 as decimal(3, 0)) % cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) % CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(3,0)) % CAST(1 AS STRING)):double> -- !query output 0.0 @@ -3505,7 +3505,7 @@ struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) % CAST(CAST(1 AS STRING) AS DOUB -- !query SELECT cast(1 as decimal(5, 0)) % cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) % CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(5,0)) % CAST(1 AS STRING)):double> -- !query output 0.0 @@ -3513,7 +3513,7 @@ struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) % CAST(CAST(1 AS STRING) AS DOUB -- !query SELECT cast(1 as decimal(10, 0)) % cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) % CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) % CAST(1 AS STRING)):double> -- !query output 0.0 @@ -3521,7 +3521,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) % CAST(CAST(1 AS STRING) AS DOU -- !query SELECT cast(1 as decimal(20, 0)) % cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) % CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(20,0)) % CAST(1 AS STRING)):double> -- !query output 0.0 @@ -3673,7 +3673,7 @@ cannot resolve '(CAST(1 AS DECIMAL(20,0)) % CAST('2017-12-11 09:30:00' AS DATE)) -- !query SELECT pmod(cast(1 as tinyint), cast(1 as decimal(3, 0))) FROM t -- !query schema -struct +struct -- !query output 0 @@ -3681,7 +3681,7 @@ struct +struct -- !query output 0 @@ -3689,7 +3689,7 @@ struct +struct -- !query output 0 @@ -3697,7 +3697,7 @@ struct +struct -- !query output 0 @@ -3705,7 +3705,7 @@ struct +struct -- !query output 0 @@ -3713,7 +3713,7 @@ struct +struct -- !query output 0 @@ -3721,7 +3721,7 @@ struct +struct -- !query output 0 @@ -3729,7 +3729,7 @@ struct +struct -- !query output 0 @@ -3737,7 +3737,7 @@ struct +struct -- !query output 0 @@ -3745,7 +3745,7 @@ struct +struct -- !query output 0 @@ -3753,7 +3753,7 @@ struct +struct -- !query output 0 @@ -3761,7 +3761,7 @@ struct +struct -- !query output 0 @@ -3769,7 +3769,7 @@ struct +struct -- !query output 0 @@ -3777,7 +3777,7 @@ struct +struct -- !query output 0 @@ -3785,7 +3785,7 @@ struct +struct -- !query output 0 @@ -3793,7 +3793,7 @@ struct +struct -- !query output 0 @@ -3801,7 +3801,7 @@ struct +struct -- !query output 0.0 @@ -3809,7 +3809,7 @@ struct +struct -- !query output 0.0 @@ -3817,7 +3817,7 @@ struct +struct -- !query output 0.0 @@ -3825,7 +3825,7 @@ struct +struct -- !query output 0.0 @@ -3833,7 +3833,7 @@ struct +struct -- !query output 0.0 @@ -3841,7 +3841,7 @@ struct -- !query SELECT pmod(cast(1 as double), cast(1 as decimal(5, 0))) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -3849,7 +3849,7 @@ struct -- !query SELECT pmod(cast(1 as double), cast(1 as decimal(10, 0))) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -3857,7 +3857,7 @@ struct -- !query SELECT pmod(cast(1 as double), cast(1 as decimal(20, 0))) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -3865,7 +3865,7 @@ struct -- !query SELECT pmod(cast(1 as decimal(10, 0)), cast(1 as decimal(3, 0))) FROM t -- !query schema -struct +struct -- !query output 0 @@ -3873,7 +3873,7 @@ struct +struct -- !query output 0 @@ -3889,7 +3889,7 @@ struct -- !query SELECT pmod(cast(1 as decimal(10, 0)), cast(1 as decimal(20, 0))) FROM t -- !query schema -struct +struct -- !query output 0 @@ -4005,7 +4005,7 @@ cannot resolve 'pmod(CAST('2017-12-11 09:30:00' AS DATE), CAST(1 AS DECIMAL(20,0 -- !query SELECT pmod(cast(1 as decimal(3, 0)) , cast(1 as tinyint)) FROM t -- !query schema -struct +struct -- !query output 0 @@ -4013,7 +4013,7 @@ struct +struct -- !query output 0 @@ -4021,7 +4021,7 @@ struct +struct -- !query output 0 @@ -4029,7 +4029,7 @@ struct +struct -- !query output 0 @@ -4037,7 +4037,7 @@ struct +struct -- !query output 0 @@ -4045,7 +4045,7 @@ struct +struct -- !query output 0 @@ -4053,7 +4053,7 @@ struct +struct -- !query output 0 @@ -4061,7 +4061,7 @@ struct +struct -- !query output 0 @@ -4069,7 +4069,7 @@ struct +struct -- !query output 0 @@ -4077,7 +4077,7 @@ struct +struct -- !query output 0 @@ -4085,7 +4085,7 @@ struct +struct -- !query output 0 @@ -4093,7 +4093,7 @@ struct +struct -- !query output 0 @@ -4101,7 +4101,7 @@ struct +struct -- !query output 0 @@ -4109,7 +4109,7 @@ struct +struct -- !query output 0 @@ -4117,7 +4117,7 @@ struct +struct -- !query output 0 @@ -4125,7 +4125,7 @@ struct +struct -- !query output 0 @@ -4133,7 +4133,7 @@ struct +struct -- !query output 0.0 @@ -4141,7 +4141,7 @@ struct +struct -- !query output 0.0 @@ -4149,7 +4149,7 @@ struct +struct -- !query output 0.0 @@ -4157,7 +4157,7 @@ struct +struct -- !query output 0.0 @@ -4165,7 +4165,7 @@ struct +struct -- !query output 0.0 @@ -4173,7 +4173,7 @@ struct -- !query SELECT pmod(cast(1 as decimal(5, 0)) , cast(1 as double)) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -4181,7 +4181,7 @@ struct -- !query SELECT pmod(cast(1 as decimal(10, 0)), cast(1 as double)) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -4189,7 +4189,7 @@ struct -- !query SELECT pmod(cast(1 as decimal(20, 0)), cast(1 as double)) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -4197,7 +4197,7 @@ struct -- !query SELECT pmod(cast(1 as decimal(3, 0)) , cast(1 as decimal(10, 0))) FROM t -- !query schema -struct +struct -- !query output 0 @@ -4205,7 +4205,7 @@ struct +struct -- !query output 0 @@ -4221,7 +4221,7 @@ struct -- !query SELECT pmod(cast(1 as decimal(20, 0)), cast(1 as decimal(10, 0))) FROM t -- !query schema -struct +struct -- !query output 0 @@ -4229,7 +4229,7 @@ struct +struct -- !query output 0.0 @@ -4237,7 +4237,7 @@ struct +struct -- !query output 0.0 @@ -4245,7 +4245,7 @@ struct +struct -- !query output 0.0 @@ -4253,7 +4253,7 @@ struct +struct -- !query output 0.0 @@ -4405,7 +4405,7 @@ cannot resolve 'pmod(CAST(1 AS DECIMAL(20,0)), CAST('2017-12-11 09:30:00' AS DAT -- !query SELECT cast(1 as tinyint) = cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) = CAST(1 AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS TINYINT) = CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -4413,7 +4413,7 @@ true -- !query SELECT cast(1 as tinyint) = cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) = CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS TINYINT) = CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -4421,7 +4421,7 @@ true -- !query SELECT cast(1 as tinyint) = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS TINYINT) = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -4429,7 +4429,7 @@ true -- !query SELECT cast(1 as tinyint) = cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS TINYINT) = CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -4437,7 +4437,7 @@ true -- !query SELECT cast(1 as smallint) = cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) = CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS SMALLINT) = CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -4445,7 +4445,7 @@ true -- !query SELECT cast(1 as smallint) = cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) = CAST(1 AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS SMALLINT) = CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -4453,7 +4453,7 @@ true -- !query SELECT cast(1 as smallint) = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS SMALLINT) = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -4461,7 +4461,7 @@ true -- !query SELECT cast(1 as smallint) = cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS SMALLINT) = CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -4469,7 +4469,7 @@ true -- !query SELECT cast(1 as int) = cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) = CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -4477,7 +4477,7 @@ true -- !query SELECT cast(1 as int) = cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) = CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -4485,7 +4485,7 @@ true -- !query SELECT cast(1 as int) = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) = CAST(1 AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -4493,7 +4493,7 @@ true -- !query SELECT cast(1 as int) = cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS INT) = CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -4501,7 +4501,7 @@ true -- !query SELECT cast(1 as bigint) = cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) = CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -4509,7 +4509,7 @@ true -- !query SELECT cast(1 as bigint) = cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) = CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -4517,7 +4517,7 @@ true -- !query SELECT cast(1 as bigint) = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -4525,7 +4525,7 @@ true -- !query SELECT cast(1 as bigint) = cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) = CAST(1 AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) = CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -4533,7 +4533,7 @@ true -- !query SELECT cast(1 as float) = cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) = CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) = CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -4541,7 +4541,7 @@ true -- !query SELECT cast(1 as float) = cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) = CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) = CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -4549,7 +4549,7 @@ true -- !query SELECT cast(1 as float) = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) = CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -4557,7 +4557,7 @@ true -- !query SELECT cast(1 as float) = cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) = CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) = CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -4565,7 +4565,7 @@ true -- !query SELECT cast(1 as double) = cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) = CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) = CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -4573,7 +4573,7 @@ true -- !query SELECT cast(1 as double) = cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) = CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) = CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -4581,7 +4581,7 @@ true -- !query SELECT cast(1 as double) = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) = CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -4589,7 +4589,7 @@ true -- !query SELECT cast(1 as double) = cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) = CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) = CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -4597,7 +4597,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -4605,7 +4605,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -4621,7 +4621,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -4737,7 +4737,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) = CAST(1 AS DECIMAL(20,0))) -- !query SELECT cast(1 as decimal(3, 0)) = cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) = CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) = CAST(1 AS TINYINT)):boolean> -- !query output true @@ -4745,7 +4745,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) = cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) = CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) = CAST(1 AS TINYINT)):boolean> -- !query output true @@ -4753,7 +4753,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) = CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(1 AS TINYINT)):boolean> -- !query output true @@ -4761,7 +4761,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) = cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) = CAST(1 AS TINYINT)):boolean> -- !query output true @@ -4769,7 +4769,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) = cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) = CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) = CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -4777,7 +4777,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) = cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) = CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) = CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -4785,7 +4785,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) = CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -4793,7 +4793,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) = cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) = CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -4801,7 +4801,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) = cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) = CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) = CAST(1 AS INT)):boolean> -- !query output true @@ -4809,7 +4809,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) = cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) = CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) = CAST(1 AS INT)):boolean> -- !query output true @@ -4817,7 +4817,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) = CAST(CAST(1 AS INT) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(1 AS INT)):boolean> -- !query output true @@ -4825,7 +4825,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) = cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) = CAST(1 AS INT)):boolean> -- !query output true @@ -4833,7 +4833,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) = cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) = CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) = CAST(1 AS BIGINT)):boolean> -- !query output true @@ -4841,7 +4841,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) = cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) = CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) = CAST(1 AS BIGINT)):boolean> -- !query output true @@ -4849,7 +4849,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) = CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(1 AS BIGINT)):boolean> -- !query output true @@ -4857,7 +4857,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) = cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) = CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) = CAST(1 AS BIGINT)):boolean> -- !query output true @@ -4865,7 +4865,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) = cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) = CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) = CAST(1 AS FLOAT)):boolean> -- !query output true @@ -4873,7 +4873,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) = cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) = CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) = CAST(1 AS FLOAT)):boolean> -- !query output true @@ -4881,7 +4881,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) = CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(1 AS FLOAT)):boolean> -- !query output true @@ -4889,7 +4889,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) = cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) = CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) = CAST(1 AS FLOAT)):boolean> -- !query output true @@ -4897,7 +4897,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) = cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) = CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -4905,7 +4905,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) = cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) = CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -4913,7 +4913,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -4921,7 +4921,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) = cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) = CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -4929,7 +4929,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -4937,7 +4937,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -4953,7 +4953,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -4961,7 +4961,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) = cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) = CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) = CAST(1 AS STRING)):boolean> -- !query output true @@ -4969,7 +4969,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) = cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) = CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) = CAST(1 AS STRING)):boolean> -- !query output true @@ -4977,7 +4977,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) = CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(1 AS STRING)):boolean> -- !query output true @@ -4985,7 +4985,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) = cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) = CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) = CAST(1 AS STRING)):boolean> -- !query output true @@ -5029,7 +5029,7 @@ cannot resolve '(CAST(1 AS DECIMAL(20,0)) = CAST('1' AS BINARY))' due to data ty -- !query SELECT cast(1 as decimal(3, 0)) = cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) = CAST(CAST(1 AS BOOLEAN) AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) = CAST(1 AS BOOLEAN)):boolean> -- !query output true @@ -5037,7 +5037,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) = cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) = CAST(CAST(1 AS BOOLEAN) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) = CAST(1 AS BOOLEAN)):boolean> -- !query output true @@ -5045,7 +5045,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) = CAST(CAST(1 AS BOOLEAN) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = CAST(1 AS BOOLEAN)):boolean> -- !query output true @@ -5053,7 +5053,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) = cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) = CAST(CAST(1 AS BOOLEAN) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) = CAST(1 AS BOOLEAN)):boolean> -- !query output true @@ -5133,7 +5133,7 @@ cannot resolve '(CAST(1 AS DECIMAL(20,0)) = CAST('2017-12-11 09:30:00' AS DATE)) -- !query SELECT cast(1 as tinyint) <=> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) <=> CAST(1 AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS TINYINT) <=> CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -5141,7 +5141,7 @@ true -- !query SELECT cast(1 as tinyint) <=> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) <=> CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS TINYINT) <=> CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -5149,7 +5149,7 @@ true -- !query SELECT cast(1 as tinyint) <=> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) <=> CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS TINYINT) <=> CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -5157,7 +5157,7 @@ true -- !query SELECT cast(1 as tinyint) <=> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) <=> CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS TINYINT) <=> CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -5165,7 +5165,7 @@ true -- !query SELECT cast(1 as smallint) <=> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) <=> CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS SMALLINT) <=> CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -5173,7 +5173,7 @@ true -- !query SELECT cast(1 as smallint) <=> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) <=> CAST(1 AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS SMALLINT) <=> CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -5181,7 +5181,7 @@ true -- !query SELECT cast(1 as smallint) <=> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) <=> CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS SMALLINT) <=> CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -5189,7 +5189,7 @@ true -- !query SELECT cast(1 as smallint) <=> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) <=> CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS SMALLINT) <=> CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -5197,7 +5197,7 @@ true -- !query SELECT cast(1 as int) <=> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) <=> CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) <=> CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -5205,7 +5205,7 @@ true -- !query SELECT cast(1 as int) <=> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) <=> CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) <=> CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -5213,7 +5213,7 @@ true -- !query SELECT cast(1 as int) <=> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) <=> CAST(1 AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) <=> CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -5221,7 +5221,7 @@ true -- !query SELECT cast(1 as int) <=> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) <=> CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS INT) <=> CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -5229,7 +5229,7 @@ true -- !query SELECT cast(1 as bigint) <=> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) <=> CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) <=> CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -5237,7 +5237,7 @@ true -- !query SELECT cast(1 as bigint) <=> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) <=> CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) <=> CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -5245,7 +5245,7 @@ true -- !query SELECT cast(1 as bigint) <=> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) <=> CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) <=> CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -5253,7 +5253,7 @@ true -- !query SELECT cast(1 as bigint) <=> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) <=> CAST(1 AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) <=> CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -5261,7 +5261,7 @@ true -- !query SELECT cast(1 as float) <=> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) <=> CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) <=> CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -5269,7 +5269,7 @@ true -- !query SELECT cast(1 as float) <=> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) <=> CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) <=> CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -5277,7 +5277,7 @@ true -- !query SELECT cast(1 as float) <=> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) <=> CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) <=> CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -5285,7 +5285,7 @@ true -- !query SELECT cast(1 as float) <=> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) <=> CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) <=> CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -5293,7 +5293,7 @@ true -- !query SELECT cast(1 as double) <=> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <=> CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <=> CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -5301,7 +5301,7 @@ true -- !query SELECT cast(1 as double) <=> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <=> CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <=> CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -5309,7 +5309,7 @@ true -- !query SELECT cast(1 as double) <=> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <=> CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <=> CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -5317,7 +5317,7 @@ true -- !query SELECT cast(1 as double) <=> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <=> CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <=> CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -5325,7 +5325,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) <=> CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -5333,7 +5333,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) <=> CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -5349,7 +5349,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) <=> CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -5465,7 +5465,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) <=> CAST(1 AS DECIMAL(20,0) -- !query SELECT cast(1 as decimal(3, 0)) <=> cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) <=> CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <=> CAST(1 AS TINYINT)):boolean> -- !query output true @@ -5473,7 +5473,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <=> cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) <=> CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <=> CAST(1 AS TINYINT)):boolean> -- !query output true @@ -5481,7 +5481,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) <=> CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(1 AS TINYINT)):boolean> -- !query output true @@ -5489,7 +5489,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <=> cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) <=> CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <=> CAST(1 AS TINYINT)):boolean> -- !query output true @@ -5497,7 +5497,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <=> cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) <=> CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <=> CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -5505,7 +5505,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <=> cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) <=> CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <=> CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -5513,7 +5513,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) <=> CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -5521,7 +5521,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <=> cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) <=> CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <=> CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -5529,7 +5529,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <=> cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) <=> CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <=> CAST(1 AS INT)):boolean> -- !query output true @@ -5537,7 +5537,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <=> cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) <=> CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <=> CAST(1 AS INT)):boolean> -- !query output true @@ -5545,7 +5545,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(CAST(1 AS INT) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(1 AS INT)):boolean> -- !query output true @@ -5553,7 +5553,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <=> cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) <=> CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <=> CAST(1 AS INT)):boolean> -- !query output true @@ -5561,7 +5561,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <=> cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) <=> CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <=> CAST(1 AS BIGINT)):boolean> -- !query output true @@ -5569,7 +5569,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <=> cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) <=> CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <=> CAST(1 AS BIGINT)):boolean> -- !query output true @@ -5577,7 +5577,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) <=> CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(1 AS BIGINT)):boolean> -- !query output true @@ -5585,7 +5585,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <=> cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) <=> CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <=> CAST(1 AS BIGINT)):boolean> -- !query output true @@ -5593,7 +5593,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <=> cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) <=> CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <=> CAST(1 AS FLOAT)):boolean> -- !query output true @@ -5601,7 +5601,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <=> cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) <=> CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <=> CAST(1 AS FLOAT)):boolean> -- !query output true @@ -5609,7 +5609,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) <=> CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(1 AS FLOAT)):boolean> -- !query output true @@ -5617,7 +5617,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <=> cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) <=> CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <=> CAST(1 AS FLOAT)):boolean> -- !query output true @@ -5625,7 +5625,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <=> cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) <=> CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <=> CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -5633,7 +5633,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <=> cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) <=> CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <=> CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -5641,7 +5641,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) <=> CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -5649,7 +5649,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <=> cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) <=> CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <=> CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -5657,7 +5657,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <=> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) <=> CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <=> CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -5665,7 +5665,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <=> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) <=> CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <=> CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -5681,7 +5681,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <=> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) <=> CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <=> CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -5689,7 +5689,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <=> cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) <=> CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <=> CAST(1 AS STRING)):boolean> -- !query output true @@ -5697,7 +5697,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <=> cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) <=> CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <=> CAST(1 AS STRING)):boolean> -- !query output true @@ -5705,7 +5705,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) <=> CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(1 AS STRING)):boolean> -- !query output true @@ -5713,7 +5713,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <=> cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) <=> CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <=> CAST(1 AS STRING)):boolean> -- !query output true @@ -5757,7 +5757,7 @@ cannot resolve '(CAST(1 AS DECIMAL(20,0)) <=> CAST('1' AS BINARY))' due to data -- !query SELECT cast(1 as decimal(3, 0)) <=> cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) <=> CAST(CAST(1 AS BOOLEAN) AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <=> CAST(1 AS BOOLEAN)):boolean> -- !query output true @@ -5765,7 +5765,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <=> cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) <=> CAST(CAST(1 AS BOOLEAN) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <=> CAST(1 AS BOOLEAN)):boolean> -- !query output true @@ -5773,7 +5773,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(CAST(1 AS BOOLEAN) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> CAST(1 AS BOOLEAN)):boolean> -- !query output true @@ -5781,7 +5781,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <=> cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) <=> CAST(CAST(1 AS BOOLEAN) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <=> CAST(1 AS BOOLEAN)):boolean> -- !query output true @@ -5861,7 +5861,7 @@ cannot resolve '(CAST(1 AS DECIMAL(20,0)) <=> CAST('2017-12-11 09:30:00' AS DATE -- !query SELECT cast(1 as tinyint) < cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) < CAST(1 AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS TINYINT) < CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -5869,7 +5869,7 @@ false -- !query SELECT cast(1 as tinyint) < cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) < CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS TINYINT) < CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -5877,7 +5877,7 @@ false -- !query SELECT cast(1 as tinyint) < cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) < CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS TINYINT) < CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -5885,7 +5885,7 @@ false -- !query SELECT cast(1 as tinyint) < cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) < CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS TINYINT) < CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -5893,7 +5893,7 @@ false -- !query SELECT cast(1 as smallint) < cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) < CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS SMALLINT) < CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -5901,7 +5901,7 @@ false -- !query SELECT cast(1 as smallint) < cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) < CAST(1 AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS SMALLINT) < CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -5909,7 +5909,7 @@ false -- !query SELECT cast(1 as smallint) < cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) < CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS SMALLINT) < CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -5917,7 +5917,7 @@ false -- !query SELECT cast(1 as smallint) < cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) < CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS SMALLINT) < CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -5925,7 +5925,7 @@ false -- !query SELECT cast(1 as int) < cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) < CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) < CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -5933,7 +5933,7 @@ false -- !query SELECT cast(1 as int) < cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) < CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) < CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -5941,7 +5941,7 @@ false -- !query SELECT cast(1 as int) < cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) < CAST(1 AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) < CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -5949,7 +5949,7 @@ false -- !query SELECT cast(1 as int) < cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) < CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS INT) < CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -5957,7 +5957,7 @@ false -- !query SELECT cast(1 as bigint) < cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) < CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) < CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -5965,7 +5965,7 @@ false -- !query SELECT cast(1 as bigint) < cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) < CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) < CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -5973,7 +5973,7 @@ false -- !query SELECT cast(1 as bigint) < cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) < CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) < CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -5981,7 +5981,7 @@ false -- !query SELECT cast(1 as bigint) < cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) < CAST(1 AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) < CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -5989,7 +5989,7 @@ false -- !query SELECT cast(1 as float) < cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) < CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) < CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -5997,7 +5997,7 @@ false -- !query SELECT cast(1 as float) < cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) < CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) < CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -6005,7 +6005,7 @@ false -- !query SELECT cast(1 as float) < cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) < CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) < CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -6013,7 +6013,7 @@ false -- !query SELECT cast(1 as float) < cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) < CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) < CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -6021,7 +6021,7 @@ false -- !query SELECT cast(1 as double) < cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) < CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) < CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -6029,7 +6029,7 @@ false -- !query SELECT cast(1 as double) < cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) < CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) < CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -6037,7 +6037,7 @@ false -- !query SELECT cast(1 as double) < cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) < CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) < CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -6045,7 +6045,7 @@ false -- !query SELECT cast(1 as double) < cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) < CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) < CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -6053,7 +6053,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) < cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) < CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -6061,7 +6061,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) < cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) < CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -6077,7 +6077,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) < cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) < CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -6193,7 +6193,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) < CAST(1 AS DECIMAL(20,0))) -- !query SELECT cast(1 as decimal(3, 0)) < cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) < CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) < CAST(1 AS TINYINT)):boolean> -- !query output false @@ -6201,7 +6201,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) < cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) < CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) < CAST(1 AS TINYINT)):boolean> -- !query output false @@ -6209,7 +6209,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) < cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) < CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < CAST(1 AS TINYINT)):boolean> -- !query output false @@ -6217,7 +6217,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) < cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) < CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) < CAST(1 AS TINYINT)):boolean> -- !query output false @@ -6225,7 +6225,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) < cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) < CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) < CAST(1 AS SMALLINT)):boolean> -- !query output false @@ -6233,7 +6233,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) < cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) < CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) < CAST(1 AS SMALLINT)):boolean> -- !query output false @@ -6241,7 +6241,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) < cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) < CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < CAST(1 AS SMALLINT)):boolean> -- !query output false @@ -6249,7 +6249,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) < cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) < CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) < CAST(1 AS SMALLINT)):boolean> -- !query output false @@ -6257,7 +6257,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) < cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) < CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) < CAST(1 AS INT)):boolean> -- !query output false @@ -6265,7 +6265,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) < cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) < CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) < CAST(1 AS INT)):boolean> -- !query output false @@ -6273,7 +6273,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) < cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) < CAST(CAST(1 AS INT) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < CAST(1 AS INT)):boolean> -- !query output false @@ -6281,7 +6281,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) < cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) < CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) < CAST(1 AS INT)):boolean> -- !query output false @@ -6289,7 +6289,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) < cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) < CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) < CAST(1 AS BIGINT)):boolean> -- !query output false @@ -6297,7 +6297,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) < cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) < CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) < CAST(1 AS BIGINT)):boolean> -- !query output false @@ -6305,7 +6305,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) < cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) < CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < CAST(1 AS BIGINT)):boolean> -- !query output false @@ -6313,7 +6313,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) < cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) < CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) < CAST(1 AS BIGINT)):boolean> -- !query output false @@ -6321,7 +6321,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) < cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) < CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) < CAST(1 AS FLOAT)):boolean> -- !query output false @@ -6329,7 +6329,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) < cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) < CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) < CAST(1 AS FLOAT)):boolean> -- !query output false @@ -6337,7 +6337,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) < cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) < CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < CAST(1 AS FLOAT)):boolean> -- !query output false @@ -6345,7 +6345,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) < cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) < CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) < CAST(1 AS FLOAT)):boolean> -- !query output false @@ -6353,7 +6353,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) < cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) < CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) < CAST(1 AS DOUBLE)):boolean> -- !query output false @@ -6361,7 +6361,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) < cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) < CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) < CAST(1 AS DOUBLE)):boolean> -- !query output false @@ -6369,7 +6369,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) < cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) < CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < CAST(1 AS DOUBLE)):boolean> -- !query output false @@ -6377,7 +6377,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) < cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) < CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) < CAST(1 AS DOUBLE)):boolean> -- !query output false @@ -6385,7 +6385,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) < cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) < CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) < CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -6393,7 +6393,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) < cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) < CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) < CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -6409,7 +6409,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) < cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) < CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) < CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -6417,7 +6417,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) < cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) < CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) < CAST(1 AS STRING)):boolean> -- !query output false @@ -6425,7 +6425,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) < cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) < CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) < CAST(1 AS STRING)):boolean> -- !query output false @@ -6433,7 +6433,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) < cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) < CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < CAST(1 AS STRING)):boolean> -- !query output false @@ -6441,7 +6441,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) < cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) < CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) < CAST(1 AS STRING)):boolean> -- !query output false @@ -6593,7 +6593,7 @@ cannot resolve '(CAST(1 AS DECIMAL(20,0)) < CAST('2017-12-11 09:30:00' AS DATE)) -- !query SELECT cast(1 as tinyint) <= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) <= CAST(1 AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS TINYINT) <= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -6601,7 +6601,7 @@ true -- !query SELECT cast(1 as tinyint) <= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) <= CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS TINYINT) <= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -6609,7 +6609,7 @@ true -- !query SELECT cast(1 as tinyint) <= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) <= CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS TINYINT) <= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -6617,7 +6617,7 @@ true -- !query SELECT cast(1 as tinyint) <= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) <= CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS TINYINT) <= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -6625,7 +6625,7 @@ true -- !query SELECT cast(1 as smallint) <= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) <= CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS SMALLINT) <= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -6633,7 +6633,7 @@ true -- !query SELECT cast(1 as smallint) <= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) <= CAST(1 AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS SMALLINT) <= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -6641,7 +6641,7 @@ true -- !query SELECT cast(1 as smallint) <= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) <= CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS SMALLINT) <= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -6649,7 +6649,7 @@ true -- !query SELECT cast(1 as smallint) <= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) <= CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS SMALLINT) <= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -6657,7 +6657,7 @@ true -- !query SELECT cast(1 as int) <= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) <= CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) <= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -6665,7 +6665,7 @@ true -- !query SELECT cast(1 as int) <= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) <= CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) <= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -6673,7 +6673,7 @@ true -- !query SELECT cast(1 as int) <= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) <= CAST(1 AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) <= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -6681,7 +6681,7 @@ true -- !query SELECT cast(1 as int) <= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) <= CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS INT) <= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -6689,7 +6689,7 @@ true -- !query SELECT cast(1 as bigint) <= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) <= CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) <= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -6697,7 +6697,7 @@ true -- !query SELECT cast(1 as bigint) <= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) <= CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) <= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -6705,7 +6705,7 @@ true -- !query SELECT cast(1 as bigint) <= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) <= CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) <= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -6713,7 +6713,7 @@ true -- !query SELECT cast(1 as bigint) <= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) <= CAST(1 AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) <= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -6721,7 +6721,7 @@ true -- !query SELECT cast(1 as float) <= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) <= CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) <= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -6729,7 +6729,7 @@ true -- !query SELECT cast(1 as float) <= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) <= CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) <= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -6737,7 +6737,7 @@ true -- !query SELECT cast(1 as float) <= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) <= CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) <= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -6745,7 +6745,7 @@ true -- !query SELECT cast(1 as float) <= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) <= CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) <= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -6753,7 +6753,7 @@ true -- !query SELECT cast(1 as double) <= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <= CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -6761,7 +6761,7 @@ true -- !query SELECT cast(1 as double) <= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <= CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -6769,7 +6769,7 @@ true -- !query SELECT cast(1 as double) <= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <= CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -6777,7 +6777,7 @@ true -- !query SELECT cast(1 as double) <= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <= CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -6785,7 +6785,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) <= CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -6793,7 +6793,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) <= CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -6809,7 +6809,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) <= CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -6925,7 +6925,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) <= CAST(1 AS DECIMAL(20,0)) -- !query SELECT cast(1 as decimal(3, 0)) <= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) <= CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <= CAST(1 AS TINYINT)):boolean> -- !query output true @@ -6933,7 +6933,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) <= CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <= CAST(1 AS TINYINT)):boolean> -- !query output true @@ -6941,7 +6941,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) <= CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= CAST(1 AS TINYINT)):boolean> -- !query output true @@ -6949,7 +6949,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) <= CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <= CAST(1 AS TINYINT)):boolean> -- !query output true @@ -6957,7 +6957,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) <= CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <= CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -6965,7 +6965,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) <= CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <= CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -6973,7 +6973,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) <= CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -6981,7 +6981,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) <= CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <= CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -6989,7 +6989,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <= cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) <= CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <= CAST(1 AS INT)):boolean> -- !query output true @@ -6997,7 +6997,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <= cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) <= CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <= CAST(1 AS INT)):boolean> -- !query output true @@ -7005,7 +7005,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <= cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) <= CAST(CAST(1 AS INT) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= CAST(1 AS INT)):boolean> -- !query output true @@ -7013,7 +7013,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <= cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) <= CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <= CAST(1 AS INT)):boolean> -- !query output true @@ -7021,7 +7021,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) <= CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <= CAST(1 AS BIGINT)):boolean> -- !query output true @@ -7029,7 +7029,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) <= CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <= CAST(1 AS BIGINT)):boolean> -- !query output true @@ -7037,7 +7037,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) <= CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= CAST(1 AS BIGINT)):boolean> -- !query output true @@ -7045,7 +7045,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) <= CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <= CAST(1 AS BIGINT)):boolean> -- !query output true @@ -7053,7 +7053,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <= cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) <= CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <= CAST(1 AS FLOAT)):boolean> -- !query output true @@ -7061,7 +7061,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <= cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) <= CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <= CAST(1 AS FLOAT)):boolean> -- !query output true @@ -7069,7 +7069,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <= cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) <= CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= CAST(1 AS FLOAT)):boolean> -- !query output true @@ -7077,7 +7077,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <= cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) <= CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <= CAST(1 AS FLOAT)):boolean> -- !query output true @@ -7085,7 +7085,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <= cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) <= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <= CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -7093,7 +7093,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <= cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) <= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <= CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -7101,7 +7101,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <= cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) <= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -7109,7 +7109,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <= cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) <= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <= CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -7117,7 +7117,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) <= CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -7125,7 +7125,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) <= CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -7141,7 +7141,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) <= CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -7149,7 +7149,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) <= cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) <= CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) <= CAST(1 AS STRING)):boolean> -- !query output true @@ -7157,7 +7157,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) <= cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) <= CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) <= CAST(1 AS STRING)):boolean> -- !query output true @@ -7165,7 +7165,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <= cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) <= CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= CAST(1 AS STRING)):boolean> -- !query output true @@ -7173,7 +7173,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) <= cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) <= CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) <= CAST(1 AS STRING)):boolean> -- !query output true @@ -7325,7 +7325,7 @@ cannot resolve '(CAST(1 AS DECIMAL(20,0)) <= CAST('2017-12-11 09:30:00' AS DATE) -- !query SELECT cast(1 as tinyint) > cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) > CAST(1 AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS TINYINT) > CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -7333,7 +7333,7 @@ false -- !query SELECT cast(1 as tinyint) > cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) > CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS TINYINT) > CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -7341,7 +7341,7 @@ false -- !query SELECT cast(1 as tinyint) > cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) > CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS TINYINT) > CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -7349,7 +7349,7 @@ false -- !query SELECT cast(1 as tinyint) > cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) > CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS TINYINT) > CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -7357,7 +7357,7 @@ false -- !query SELECT cast(1 as smallint) > cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) > CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS SMALLINT) > CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -7365,7 +7365,7 @@ false -- !query SELECT cast(1 as smallint) > cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) > CAST(1 AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS SMALLINT) > CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -7373,7 +7373,7 @@ false -- !query SELECT cast(1 as smallint) > cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) > CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS SMALLINT) > CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -7381,7 +7381,7 @@ false -- !query SELECT cast(1 as smallint) > cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) > CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS SMALLINT) > CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -7389,7 +7389,7 @@ false -- !query SELECT cast(1 as int) > cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) > CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) > CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -7397,7 +7397,7 @@ false -- !query SELECT cast(1 as int) > cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) > CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) > CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -7405,7 +7405,7 @@ false -- !query SELECT cast(1 as int) > cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) > CAST(1 AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) > CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -7413,7 +7413,7 @@ false -- !query SELECT cast(1 as int) > cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) > CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS INT) > CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -7421,7 +7421,7 @@ false -- !query SELECT cast(1 as bigint) > cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) > CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) > CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -7429,7 +7429,7 @@ false -- !query SELECT cast(1 as bigint) > cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) > CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) > CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -7437,7 +7437,7 @@ false -- !query SELECT cast(1 as bigint) > cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) > CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) > CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -7445,7 +7445,7 @@ false -- !query SELECT cast(1 as bigint) > cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) > CAST(1 AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) > CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -7453,7 +7453,7 @@ false -- !query SELECT cast(1 as float) > cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) > CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) > CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -7461,7 +7461,7 @@ false -- !query SELECT cast(1 as float) > cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) > CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) > CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -7469,7 +7469,7 @@ false -- !query SELECT cast(1 as float) > cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) > CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) > CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -7477,7 +7477,7 @@ false -- !query SELECT cast(1 as float) > cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) > CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) > CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -7485,7 +7485,7 @@ false -- !query SELECT cast(1 as double) > cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) > CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) > CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -7493,7 +7493,7 @@ false -- !query SELECT cast(1 as double) > cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) > CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) > CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -7501,7 +7501,7 @@ false -- !query SELECT cast(1 as double) > cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) > CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) > CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -7509,7 +7509,7 @@ false -- !query SELECT cast(1 as double) > cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) > CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) > CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -7517,7 +7517,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) > cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) > CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > CAST(1 AS DECIMAL(3,0))):boolean> -- !query output false @@ -7525,7 +7525,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) > cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) > CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > CAST(1 AS DECIMAL(5,0))):boolean> -- !query output false @@ -7541,7 +7541,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) > cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) > CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > CAST(1 AS DECIMAL(20,0))):boolean> -- !query output false @@ -7657,7 +7657,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) > CAST(1 AS DECIMAL(20,0))) -- !query SELECT cast(1 as decimal(3, 0)) > cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) > CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) > CAST(1 AS TINYINT)):boolean> -- !query output false @@ -7665,7 +7665,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) > cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) > CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) > CAST(1 AS TINYINT)):boolean> -- !query output false @@ -7673,7 +7673,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) > cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) > CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > CAST(1 AS TINYINT)):boolean> -- !query output false @@ -7681,7 +7681,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) > cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) > CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) > CAST(1 AS TINYINT)):boolean> -- !query output false @@ -7689,7 +7689,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) > cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) > CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) > CAST(1 AS SMALLINT)):boolean> -- !query output false @@ -7697,7 +7697,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) > cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) > CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) > CAST(1 AS SMALLINT)):boolean> -- !query output false @@ -7705,7 +7705,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) > cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) > CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > CAST(1 AS SMALLINT)):boolean> -- !query output false @@ -7713,7 +7713,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) > cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) > CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) > CAST(1 AS SMALLINT)):boolean> -- !query output false @@ -7721,7 +7721,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) > cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) > CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) > CAST(1 AS INT)):boolean> -- !query output false @@ -7729,7 +7729,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) > cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) > CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) > CAST(1 AS INT)):boolean> -- !query output false @@ -7737,7 +7737,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) > cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) > CAST(CAST(1 AS INT) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > CAST(1 AS INT)):boolean> -- !query output false @@ -7745,7 +7745,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) > cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) > CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) > CAST(1 AS INT)):boolean> -- !query output false @@ -7753,7 +7753,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) > cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) > CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) > CAST(1 AS BIGINT)):boolean> -- !query output false @@ -7761,7 +7761,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) > cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) > CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) > CAST(1 AS BIGINT)):boolean> -- !query output false @@ -7769,7 +7769,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) > cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) > CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > CAST(1 AS BIGINT)):boolean> -- !query output false @@ -7777,7 +7777,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) > cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) > CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) > CAST(1 AS BIGINT)):boolean> -- !query output false @@ -7785,7 +7785,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) > cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) > CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) > CAST(1 AS FLOAT)):boolean> -- !query output false @@ -7793,7 +7793,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) > cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) > CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) > CAST(1 AS FLOAT)):boolean> -- !query output false @@ -7801,7 +7801,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) > cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) > CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > CAST(1 AS FLOAT)):boolean> -- !query output false @@ -7809,7 +7809,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) > cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) > CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) > CAST(1 AS FLOAT)):boolean> -- !query output false @@ -7817,7 +7817,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) > cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) > CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) > CAST(1 AS DOUBLE)):boolean> -- !query output false @@ -7825,7 +7825,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) > cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) > CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) > CAST(1 AS DOUBLE)):boolean> -- !query output false @@ -7833,7 +7833,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) > cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) > CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > CAST(1 AS DOUBLE)):boolean> -- !query output false @@ -7841,7 +7841,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) > cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) > CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) > CAST(1 AS DOUBLE)):boolean> -- !query output false @@ -7849,7 +7849,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) > cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) > CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) > CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -7857,7 +7857,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) > cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) > CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) > CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -7873,7 +7873,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) > cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) > CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) > CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -7881,7 +7881,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) > cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) > CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) > CAST(1 AS STRING)):boolean> -- !query output false @@ -7889,7 +7889,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) > cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) > CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) > CAST(1 AS STRING)):boolean> -- !query output false @@ -7897,7 +7897,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) > cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) > CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > CAST(1 AS STRING)):boolean> -- !query output false @@ -7905,7 +7905,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) > cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) > CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) > CAST(1 AS STRING)):boolean> -- !query output false @@ -8057,7 +8057,7 @@ cannot resolve '(CAST(1 AS DECIMAL(20,0)) > CAST('2017-12-11 09:30:00' AS DATE)) -- !query SELECT cast(1 as tinyint) >= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) >= CAST(1 AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS TINYINT) >= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -8065,7 +8065,7 @@ true -- !query SELECT cast(1 as tinyint) >= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) >= CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS TINYINT) >= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -8073,7 +8073,7 @@ true -- !query SELECT cast(1 as tinyint) >= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) >= CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS TINYINT) >= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -8081,7 +8081,7 @@ true -- !query SELECT cast(1 as tinyint) >= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) >= CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS TINYINT) >= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -8089,7 +8089,7 @@ true -- !query SELECT cast(1 as smallint) >= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) >= CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS SMALLINT) >= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -8097,7 +8097,7 @@ true -- !query SELECT cast(1 as smallint) >= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) >= CAST(1 AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS SMALLINT) >= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -8105,7 +8105,7 @@ true -- !query SELECT cast(1 as smallint) >= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) >= CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS SMALLINT) >= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -8113,7 +8113,7 @@ true -- !query SELECT cast(1 as smallint) >= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) >= CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS SMALLINT) >= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -8121,7 +8121,7 @@ true -- !query SELECT cast(1 as int) >= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) >= CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) >= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -8129,7 +8129,7 @@ true -- !query SELECT cast(1 as int) >= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) >= CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) >= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -8137,7 +8137,7 @@ true -- !query SELECT cast(1 as int) >= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) >= CAST(1 AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS INT) >= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -8145,7 +8145,7 @@ true -- !query SELECT cast(1 as int) >= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) >= CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS INT) >= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -8153,7 +8153,7 @@ true -- !query SELECT cast(1 as bigint) >= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) >= CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) >= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -8161,7 +8161,7 @@ true -- !query SELECT cast(1 as bigint) >= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) >= CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) >= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -8169,7 +8169,7 @@ true -- !query SELECT cast(1 as bigint) >= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) >= CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) >= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -8177,7 +8177,7 @@ true -- !query SELECT cast(1 as bigint) >= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) >= CAST(1 AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS BIGINT) >= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -8185,7 +8185,7 @@ true -- !query SELECT cast(1 as float) >= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) >= CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) >= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -8193,7 +8193,7 @@ true -- !query SELECT cast(1 as float) >= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) >= CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) >= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -8201,7 +8201,7 @@ true -- !query SELECT cast(1 as float) >= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) >= CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) >= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -8209,7 +8209,7 @@ true -- !query SELECT cast(1 as float) >= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) >= CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS FLOAT) >= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -8217,7 +8217,7 @@ true -- !query SELECT cast(1 as double) >= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) >= CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) >= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -8225,7 +8225,7 @@ true -- !query SELECT cast(1 as double) >= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) >= CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) >= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -8233,7 +8233,7 @@ true -- !query SELECT cast(1 as double) >= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) >= CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) >= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -8241,7 +8241,7 @@ true -- !query SELECT cast(1 as double) >= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) >= CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) >= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -8249,7 +8249,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) >= cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) >= CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= CAST(1 AS DECIMAL(3,0))):boolean> -- !query output true @@ -8257,7 +8257,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) >= cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) >= CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= CAST(1 AS DECIMAL(5,0))):boolean> -- !query output true @@ -8273,7 +8273,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) >= cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) >= CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= CAST(1 AS DECIMAL(20,0))):boolean> -- !query output true @@ -8389,7 +8389,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) >= CAST(1 AS DECIMAL(20,0)) -- !query SELECT cast(1 as decimal(3, 0)) >= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(3,0)) >= CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) >= CAST(1 AS TINYINT)):boolean> -- !query output true @@ -8397,7 +8397,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) >= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) >= CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) >= CAST(1 AS TINYINT)):boolean> -- !query output true @@ -8405,7 +8405,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) >= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) >= CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= CAST(1 AS TINYINT)):boolean> -- !query output true @@ -8413,7 +8413,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) >= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) >= CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) >= CAST(1 AS TINYINT)):boolean> -- !query output true @@ -8421,7 +8421,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) >= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) >= CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) >= CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -8429,7 +8429,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) >= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(5,0)) >= CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) >= CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -8437,7 +8437,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) >= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) >= CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -8445,7 +8445,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) >= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) >= CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) >= CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -8453,7 +8453,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) >= cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) >= CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) >= CAST(1 AS INT)):boolean> -- !query output true @@ -8461,7 +8461,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) >= cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) >= CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) >= CAST(1 AS INT)):boolean> -- !query output true @@ -8469,7 +8469,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) >= cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) >= CAST(CAST(1 AS INT) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= CAST(1 AS INT)):boolean> -- !query output true @@ -8477,7 +8477,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) >= cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) >= CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) >= CAST(1 AS INT)):boolean> -- !query output true @@ -8485,7 +8485,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) >= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) >= CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) >= CAST(1 AS BIGINT)):boolean> -- !query output true @@ -8493,7 +8493,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) >= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) >= CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) >= CAST(1 AS BIGINT)):boolean> -- !query output true @@ -8501,7 +8501,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) >= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) >= CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= CAST(1 AS BIGINT)):boolean> -- !query output true @@ -8509,7 +8509,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) >= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(20,0)) >= CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) >= CAST(1 AS BIGINT)):boolean> -- !query output true @@ -8517,7 +8517,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) >= cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) >= CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) >= CAST(1 AS FLOAT)):boolean> -- !query output true @@ -8525,7 +8525,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) >= cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) >= CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) >= CAST(1 AS FLOAT)):boolean> -- !query output true @@ -8533,7 +8533,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) >= cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) >= CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= CAST(1 AS FLOAT)):boolean> -- !query output true @@ -8541,7 +8541,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) >= cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) >= CAST(CAST(1 AS FLOAT) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) >= CAST(1 AS FLOAT)):boolean> -- !query output true @@ -8549,7 +8549,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) >= cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) >= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) >= CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -8557,7 +8557,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) >= cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) >= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) >= CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -8565,7 +8565,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) >= cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) >= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -8573,7 +8573,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) >= cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) >= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) >= CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -8581,7 +8581,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) >= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) >= CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) >= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -8589,7 +8589,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) >= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) >= CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) >= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -8605,7 +8605,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) >= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) >= CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) >= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -8613,7 +8613,7 @@ true -- !query SELECT cast(1 as decimal(3, 0)) >= cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) >= CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(3,0)) >= CAST(1 AS STRING)):boolean> -- !query output true @@ -8621,7 +8621,7 @@ true -- !query SELECT cast(1 as decimal(5, 0)) >= cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) >= CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(5,0)) >= CAST(1 AS STRING)):boolean> -- !query output true @@ -8629,7 +8629,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) >= cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) >= CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= CAST(1 AS STRING)):boolean> -- !query output true @@ -8637,7 +8637,7 @@ true -- !query SELECT cast(1 as decimal(20, 0)) >= cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) >= CAST(CAST(1 AS STRING) AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(20,0)) >= CAST(1 AS STRING)):boolean> -- !query output true @@ -8789,7 +8789,7 @@ cannot resolve '(CAST(1 AS DECIMAL(20,0)) >= CAST('2017-12-11 09:30:00' AS DATE) -- !query SELECT cast(1 as tinyint) <> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) = CAST(1 AS DECIMAL(3,0)))):boolean> +struct<(NOT (CAST(1 AS TINYINT) = CAST(1 AS DECIMAL(3,0)))):boolean> -- !query output false @@ -8797,7 +8797,7 @@ false -- !query SELECT cast(1 as tinyint) <> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)) = CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)))):boolean> +struct<(NOT (CAST(1 AS TINYINT) = CAST(1 AS DECIMAL(5,0)))):boolean> -- !query output false @@ -8805,7 +8805,7 @@ false -- !query SELECT cast(1 as tinyint) <> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS TINYINT) = CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output false @@ -8813,7 +8813,7 @@ false -- !query SELECT cast(1 as tinyint) <> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS TINYINT) = CAST(1 AS DECIMAL(20,0)))):boolean> -- !query output false @@ -8821,7 +8821,7 @@ false -- !query SELECT cast(1 as smallint) <> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)) = CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)))):boolean> +struct<(NOT (CAST(1 AS SMALLINT) = CAST(1 AS DECIMAL(3,0)))):boolean> -- !query output false @@ -8829,7 +8829,7 @@ false -- !query SELECT cast(1 as smallint) <> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) = CAST(1 AS DECIMAL(5,0)))):boolean> +struct<(NOT (CAST(1 AS SMALLINT) = CAST(1 AS DECIMAL(5,0)))):boolean> -- !query output false @@ -8837,7 +8837,7 @@ false -- !query SELECT cast(1 as smallint) <> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS SMALLINT) = CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output false @@ -8845,7 +8845,7 @@ false -- !query SELECT cast(1 as smallint) <> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS SMALLINT) = CAST(1 AS DECIMAL(20,0)))):boolean> -- !query output false @@ -8853,7 +8853,7 @@ false -- !query SELECT cast(1 as int) <> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS INT) = CAST(1 AS DECIMAL(3,0)))):boolean> -- !query output false @@ -8861,7 +8861,7 @@ false -- !query SELECT cast(1 as int) <> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS INT) = CAST(1 AS DECIMAL(5,0)))):boolean> -- !query output false @@ -8869,7 +8869,7 @@ false -- !query SELECT cast(1 as int) <> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS INT) AS DECIMAL(10,0)) = CAST(1 AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS INT) = CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output false @@ -8877,7 +8877,7 @@ false -- !query SELECT cast(1 as int) <> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS INT) = CAST(1 AS DECIMAL(20,0)))):boolean> -- !query output false @@ -8885,7 +8885,7 @@ false -- !query SELECT cast(1 as bigint) <> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS BIGINT) = CAST(1 AS DECIMAL(3,0)))):boolean> -- !query output false @@ -8893,7 +8893,7 @@ false -- !query SELECT cast(1 as bigint) <> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS BIGINT) = CAST(1 AS DECIMAL(5,0)))):boolean> -- !query output false @@ -8901,7 +8901,7 @@ false -- !query SELECT cast(1 as bigint) <> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS BIGINT) = CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output false @@ -8909,7 +8909,7 @@ false -- !query SELECT cast(1 as bigint) <> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) = CAST(1 AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS BIGINT) = CAST(1 AS DECIMAL(20,0)))):boolean> -- !query output false @@ -8917,7 +8917,7 @@ false -- !query SELECT cast(1 as float) <> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS FLOAT) AS DOUBLE) = CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS FLOAT) = CAST(1 AS DECIMAL(3,0)))):boolean> -- !query output false @@ -8925,7 +8925,7 @@ false -- !query SELECT cast(1 as float) <> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS FLOAT) AS DOUBLE) = CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS FLOAT) = CAST(1 AS DECIMAL(5,0)))):boolean> -- !query output false @@ -8933,7 +8933,7 @@ false -- !query SELECT cast(1 as float) <> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS FLOAT) AS DOUBLE) = CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS FLOAT) = CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output false @@ -8941,7 +8941,7 @@ false -- !query SELECT cast(1 as float) <> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS FLOAT) AS DOUBLE) = CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS FLOAT) = CAST(1 AS DECIMAL(20,0)))):boolean> -- !query output false @@ -8949,7 +8949,7 @@ false -- !query SELECT cast(1 as double) <> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(NOT (CAST(1 AS DOUBLE) = CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DOUBLE) = CAST(1 AS DECIMAL(3,0)))):boolean> -- !query output false @@ -8957,7 +8957,7 @@ false -- !query SELECT cast(1 as double) <> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(NOT (CAST(1 AS DOUBLE) = CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DOUBLE) = CAST(1 AS DECIMAL(5,0)))):boolean> -- !query output false @@ -8965,7 +8965,7 @@ false -- !query SELECT cast(1 as double) <> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(NOT (CAST(1 AS DOUBLE) = CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DOUBLE) = CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output false @@ -8973,7 +8973,7 @@ false -- !query SELECT cast(1 as double) <> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(NOT (CAST(1 AS DOUBLE) = CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DOUBLE) = CAST(1 AS DECIMAL(20,0)))):boolean> -- !query output false @@ -8981,7 +8981,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) <> cast(1 as decimal(3, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(1 AS DECIMAL(3,0)))):boolean> -- !query output false @@ -8989,7 +8989,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) <> cast(1 as decimal(5, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(1 AS DECIMAL(5,0)))):boolean> -- !query output false @@ -9005,7 +9005,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) <> cast(1 as decimal(20, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(1 AS DECIMAL(20,0)))):boolean> -- !query output false @@ -9121,7 +9121,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) = CAST(1 AS DECIMAL(20,0))) -- !query SELECT cast(1 as decimal(3, 0)) <> cast(1 as tinyint) FROM t -- !query schema -struct<(NOT (CAST(1 AS DECIMAL(3,0)) = CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(3,0)) = CAST(1 AS TINYINT))):boolean> -- !query output false @@ -9129,7 +9129,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) <> cast(1 as tinyint) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(5,0)) = CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(5,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(5,0)) = CAST(1 AS TINYINT))):boolean> -- !query output false @@ -9137,7 +9137,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) <> cast(1 as tinyint) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) = CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(1 AS TINYINT))):boolean> -- !query output false @@ -9145,7 +9145,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) <> cast(1 as tinyint) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(20,0)) = CAST(1 AS TINYINT))):boolean> -- !query output false @@ -9153,7 +9153,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) <> cast(1 as smallint) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(5,0)) = CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(5,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(3,0)) = CAST(1 AS SMALLINT))):boolean> -- !query output false @@ -9161,7 +9161,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) <> cast(1 as smallint) FROM t -- !query schema -struct<(NOT (CAST(1 AS DECIMAL(5,0)) = CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(5,0)) = CAST(1 AS SMALLINT))):boolean> -- !query output false @@ -9169,7 +9169,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) <> cast(1 as smallint) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) = CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(1 AS SMALLINT))):boolean> -- !query output false @@ -9177,7 +9177,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) <> cast(1 as smallint) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(20,0)) = CAST(1 AS SMALLINT))):boolean> -- !query output false @@ -9185,7 +9185,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) <> cast(1 as int) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) = CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(3,0)) = CAST(1 AS INT))):boolean> -- !query output false @@ -9193,7 +9193,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) <> cast(1 as int) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) = CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(5,0)) = CAST(1 AS INT))):boolean> -- !query output false @@ -9201,7 +9201,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) <> cast(1 as int) FROM t -- !query schema -struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(CAST(1 AS INT) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(1 AS INT))):boolean> -- !query output false @@ -9209,7 +9209,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) <> cast(1 as int) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(20,0)) = CAST(1 AS INT))):boolean> -- !query output false @@ -9217,7 +9217,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) <> cast(1 as bigint) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(20,0)) = CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(3,0)) = CAST(1 AS BIGINT))):boolean> -- !query output false @@ -9225,7 +9225,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) <> cast(1 as bigint) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(20,0)) = CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(5,0)) = CAST(1 AS BIGINT))):boolean> -- !query output false @@ -9233,7 +9233,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) <> cast(1 as bigint) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) = CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(1 AS BIGINT))):boolean> -- !query output false @@ -9241,7 +9241,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) <> cast(1 as bigint) FROM t -- !query schema -struct<(NOT (CAST(1 AS DECIMAL(20,0)) = CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(20,0)) = CAST(1 AS BIGINT))):boolean> -- !query output false @@ -9249,7 +9249,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) <> cast(1 as float) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) = CAST(CAST(1 AS FLOAT) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(3,0)) = CAST(1 AS FLOAT))):boolean> -- !query output false @@ -9257,7 +9257,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) <> cast(1 as float) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) = CAST(CAST(1 AS FLOAT) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(5,0)) = CAST(1 AS FLOAT))):boolean> -- !query output false @@ -9265,7 +9265,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) <> cast(1 as float) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) = CAST(CAST(1 AS FLOAT) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(1 AS FLOAT))):boolean> -- !query output false @@ -9273,7 +9273,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) <> cast(1 as float) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) = CAST(CAST(1 AS FLOAT) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(20,0)) = CAST(1 AS FLOAT))):boolean> -- !query output false @@ -9281,7 +9281,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) <> cast(1 as double) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) = CAST(1 AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(3,0)) = CAST(1 AS DOUBLE))):boolean> -- !query output false @@ -9289,7 +9289,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) <> cast(1 as double) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) = CAST(1 AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(5,0)) = CAST(1 AS DOUBLE))):boolean> -- !query output false @@ -9297,7 +9297,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) <> cast(1 as double) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) = CAST(1 AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(1 AS DOUBLE))):boolean> -- !query output false @@ -9305,7 +9305,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) <> cast(1 as double) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) = CAST(1 AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(20,0)) = CAST(1 AS DOUBLE))):boolean> -- !query output false @@ -9313,7 +9313,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) <> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(3,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(3,0)) = CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output false @@ -9321,7 +9321,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) <> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(5,0)) AS DECIMAL(10,0)) = CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(5,0)) = CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output false @@ -9337,7 +9337,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) <> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(20,0)) AS DECIMAL(20,0)) = CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(20,0)) = CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output false @@ -9345,7 +9345,7 @@ false -- !query SELECT cast(1 as decimal(3, 0)) <> cast(1 as string) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(3,0)) AS DOUBLE) = CAST(CAST(1 AS STRING) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(3,0)) = CAST(1 AS STRING))):boolean> -- !query output false @@ -9353,7 +9353,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) <> cast(1 as string) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(5,0)) AS DOUBLE) = CAST(CAST(1 AS STRING) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(5,0)) = CAST(1 AS STRING))):boolean> -- !query output false @@ -9361,7 +9361,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) <> cast(1 as string) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) = CAST(CAST(1 AS STRING) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(1 AS STRING))):boolean> -- !query output false @@ -9369,7 +9369,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) <> cast(1 as string) FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(20,0)) AS DOUBLE) = CAST(CAST(1 AS STRING) AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(20,0)) = CAST(1 AS STRING))):boolean> -- !query output false @@ -9413,7 +9413,7 @@ cannot resolve '(CAST(1 AS DECIMAL(20,0)) = CAST('1' AS BINARY))' due to data ty -- !query SELECT cast(1 as decimal(3, 0)) <> cast(1 as boolean) FROM t -- !query schema -struct<(NOT (CAST(1 AS DECIMAL(3,0)) = CAST(CAST(1 AS BOOLEAN) AS DECIMAL(3,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(3,0)) = CAST(1 AS BOOLEAN))):boolean> -- !query output false @@ -9421,7 +9421,7 @@ false -- !query SELECT cast(1 as decimal(5, 0)) <> cast(1 as boolean) FROM t -- !query schema -struct<(NOT (CAST(1 AS DECIMAL(5,0)) = CAST(CAST(1 AS BOOLEAN) AS DECIMAL(5,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(5,0)) = CAST(1 AS BOOLEAN))):boolean> -- !query output false @@ -9429,7 +9429,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) <> cast(1 as boolean) FROM t -- !query schema -struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(CAST(1 AS BOOLEAN) AS DECIMAL(10,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = CAST(1 AS BOOLEAN))):boolean> -- !query output false @@ -9437,7 +9437,7 @@ false -- !query SELECT cast(1 as decimal(20, 0)) <> cast(1 as boolean) FROM t -- !query schema -struct<(NOT (CAST(1 AS DECIMAL(20,0)) = CAST(CAST(1 AS BOOLEAN) AS DECIMAL(20,0)))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(20,0)) = CAST(1 AS BOOLEAN))):boolean> -- !query output false diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out index ae933da59f63f..987b4dda729f9 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/division.sql.out @@ -13,7 +13,7 @@ struct<> -- !query SELECT cast(1 as tinyint) / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<(CAST(1 AS TINYINT) / CAST(1 AS TINYINT)):double> -- !query output 1.0 @@ -21,7 +21,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)) -- !query SELECT cast(1 as tinyint) / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<(CAST(1 AS TINYINT) / CAST(1 AS SMALLINT)):double> -- !query output 1.0 @@ -29,7 +29,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE) -- !query SELECT cast(1 as tinyint) / cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<(CAST(1 AS TINYINT) / CAST(1 AS INT)):double> -- !query output 1.0 @@ -37,7 +37,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):dou -- !query SELECT cast(1 as tinyint) / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<(CAST(1 AS TINYINT) / CAST(1 AS BIGINT)):double> -- !query output 1.0 @@ -45,7 +45,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)): -- !query SELECT cast(1 as tinyint) / cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS TINYINT) / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -53,7 +53,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):d -- !query SELECT cast(1 as tinyint) / cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS TINYINT) / CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -61,7 +61,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)): -- !query SELECT cast(1 as tinyint) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(14,11)> +struct<(CAST(1 AS TINYINT) / CAST(1 AS DECIMAL(10,0))):decimal(14,11)> -- !query output 1.00000000000 @@ -69,7 +69,7 @@ struct<(CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0)) / CAST(C -- !query SELECT cast(1 as tinyint) / cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(CAST(1 AS STRING) AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS TINYINT) / CAST(1 AS STRING)):double> -- !query output 1.0 @@ -113,7 +113,7 @@ cannot resolve '(CAST(1 AS TINYINT) / CAST('2017-12-11 09:30:00' AS DATE))' due -- !query SELECT cast(1 as smallint) / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<(CAST(1 AS SMALLINT) / CAST(1 AS TINYINT)):double> -- !query output 1.0 @@ -121,7 +121,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE) -- !query SELECT cast(1 as smallint) / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<(CAST(1 AS SMALLINT) / CAST(1 AS SMALLINT)):double> -- !query output 1.0 @@ -129,7 +129,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE -- !query SELECT cast(1 as smallint) / cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<(CAST(1 AS SMALLINT) / CAST(1 AS INT)):double> -- !query output 1.0 @@ -137,7 +137,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):do -- !query SELECT cast(1 as smallint) / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<(CAST(1 AS SMALLINT) / CAST(1 AS BIGINT)):double> -- !query output 1.0 @@ -145,7 +145,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)) -- !query SELECT cast(1 as smallint) / cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS SMALLINT) / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -153,7 +153,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)): -- !query SELECT cast(1 as smallint) / cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS SMALLINT) / CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -161,7 +161,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)) -- !query SELECT cast(1 as smallint) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0))):decimal(16,11)> +struct<(CAST(1 AS SMALLINT) / CAST(1 AS DECIMAL(10,0))):decimal(16,11)> -- !query output 1.00000000000 @@ -169,7 +169,7 @@ struct<(CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0)) / CAST( -- !query SELECT cast(1 as smallint) / cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(CAST(1 AS STRING) AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS SMALLINT) / CAST(1 AS STRING)):double> -- !query output 1.0 @@ -213,7 +213,7 @@ cannot resolve '(CAST(1 AS SMALLINT) / CAST('2017-12-11 09:30:00' AS DATE))' due -- !query SELECT cast(1 as int) / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<(CAST(1 AS INT) / CAST(1 AS TINYINT)):double> -- !query output 1.0 @@ -221,7 +221,7 @@ struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):dou -- !query SELECT cast(1 as int) / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<(CAST(1 AS INT) / CAST(1 AS SMALLINT)):double> -- !query output 1.0 @@ -229,7 +229,7 @@ struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):do -- !query SELECT cast(1 as int) / cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<(CAST(1 AS INT) / CAST(1 AS INT)):double> -- !query output 1.0 @@ -237,7 +237,7 @@ struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> -- !query SELECT cast(1 as int) / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<(CAST(1 AS INT) / CAST(1 AS BIGINT)):double> -- !query output 1.0 @@ -245,7 +245,7 @@ struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):doub -- !query SELECT cast(1 as int) / cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS INT) / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -253,7 +253,7 @@ struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):doubl -- !query SELECT cast(1 as int) / cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS INT) / CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -261,7 +261,7 @@ struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):doub -- !query SELECT cast(1 as int) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)> +struct<(CAST(1 AS INT) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)> -- !query output 1.00000000000 @@ -269,7 +269,7 @@ struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decima -- !query SELECT cast(1 as int) / cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(CAST(1 AS STRING) AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS INT) / CAST(1 AS STRING)):double> -- !query output 1.0 @@ -313,7 +313,7 @@ cannot resolve '(CAST(1 AS INT) / CAST('2017-12-11 09:30:00' AS DATE))' due to d -- !query SELECT cast(1 as bigint) / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<(CAST(1 AS BIGINT) / CAST(1 AS TINYINT)):double> -- !query output 1.0 @@ -321,7 +321,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)): -- !query SELECT cast(1 as bigint) / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<(CAST(1 AS BIGINT) / CAST(1 AS SMALLINT)):double> -- !query output 1.0 @@ -329,7 +329,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)) -- !query SELECT cast(1 as bigint) / cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<(CAST(1 AS BIGINT) / CAST(1 AS INT)):double> -- !query output 1.0 @@ -337,7 +337,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):doub -- !query SELECT cast(1 as bigint) / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<(CAST(1 AS BIGINT) / CAST(1 AS BIGINT)):double> -- !query output 1.0 @@ -345,7 +345,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):d -- !query SELECT cast(1 as bigint) / cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS BIGINT) / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -353,7 +353,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):do -- !query SELECT cast(1 as bigint) / cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS BIGINT) / CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -361,7 +361,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):d -- !query SELECT cast(1 as bigint) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0))):decimal(31,11)> +struct<(CAST(1 AS BIGINT) / CAST(1 AS DECIMAL(10,0))):decimal(31,11)> -- !query output 1.00000000000 @@ -369,7 +369,7 @@ struct<(CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0)) / CAST(C -- !query SELECT cast(1 as bigint) / cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(CAST(1 AS STRING) AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS BIGINT) / CAST(1 AS STRING)):double> -- !query output 1.0 @@ -413,7 +413,7 @@ cannot resolve '(CAST(1 AS BIGINT) / CAST('2017-12-11 09:30:00' AS DATE))' due t -- !query SELECT cast(1 as float) / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / CAST(1 AS TINYINT)):double> -- !query output 1.0 @@ -421,7 +421,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):d -- !query SELECT cast(1 as float) / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / CAST(1 AS SMALLINT)):double> -- !query output 1.0 @@ -429,7 +429,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)): -- !query SELECT cast(1 as float) / cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / CAST(1 AS INT)):double> -- !query output 1.0 @@ -437,7 +437,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):doubl -- !query SELECT cast(1 as float) / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / CAST(1 AS BIGINT)):double> -- !query output 1.0 @@ -445,7 +445,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):do -- !query SELECT cast(1 as float) / cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -453,7 +453,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):dou -- !query SELECT cast(1 as float) / cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -461,7 +461,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):do -- !query SELECT cast(1 as float) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / CAST(1 AS DECIMAL(10,0))):double> -- !query output 1.0 @@ -469,7 +469,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS DECIMAL(10,0)) AS -- !query SELECT cast(1 as float) / cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(CAST(1 AS STRING) AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / CAST(1 AS STRING)):double> -- !query output 1.0 @@ -513,7 +513,7 @@ cannot resolve '(CAST(1 AS FLOAT) / CAST('2017-12-11 09:30:00' AS DATE))' due to -- !query SELECT cast(1 as double) / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) / CAST(1 AS TINYINT)):double> -- !query output 1.0 @@ -521,7 +521,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> -- !query SELECT cast(1 as double) / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) / CAST(1 AS SMALLINT)):double> -- !query output 1.0 @@ -529,7 +529,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> -- !query SELECT cast(1 as double) / cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) / CAST(1 AS INT)):double> -- !query output 1.0 @@ -537,7 +537,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> -- !query SELECT cast(1 as double) / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) / CAST(1 AS BIGINT)):double> -- !query output 1.0 @@ -545,7 +545,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> -- !query SELECT cast(1 as double) / cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -561,7 +561,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as double) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) / CAST(1 AS DECIMAL(10,0))):double> -- !query output 1.0 @@ -569,7 +569,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> -- !query SELECT cast(1 as double) / cast(1 as string) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) / CAST(1 AS STRING)):double> -- !query output 1.0 @@ -613,7 +613,7 @@ cannot resolve '(CAST(1 AS DOUBLE) / CAST('2017-12-11 09:30:00' AS DATE))' due t -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS TINYINT) AS DECIMAL(3,0)) AS DECIMAL(10,0))):decimal(16,6)> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS TINYINT)):decimal(16,6)> -- !query output 1.000000 @@ -621,7 +621,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS TI -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS SMALLINT) AS DECIMAL(5,0)) AS DECIMAL(10,0))):decimal(16,6)> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS SMALLINT)):decimal(16,6)> -- !query output 1.000000 @@ -629,7 +629,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) / CAST(CAST(CAST(1 AS SM -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DECIMAL(10,0)) / CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decimal(21,11)> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS INT)):decimal(21,11)> -- !query output 1.00000000000 @@ -637,7 +637,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) / CAST(CAST(1 AS INT) AS DECIMAL(10,0))):decima -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) AS DECIMAL(20,0))):decimal(31,21)> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS BIGINT)):decimal(31,21)> -- !query output 1.000000000000000000000 @@ -645,7 +645,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) / CAST(CAST(CAST(1 AS BI -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -653,7 +653,7 @@ struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUB -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -669,7 +669,7 @@ struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS DECIMAL(10,0))):decimal(21,11)> -- !query SELECT cast(1 as decimal(10, 0)) / cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) / CAST(1 AS STRING)):double> -- !query output 1.0 @@ -713,7 +713,7 @@ cannot resolve '(CAST(1 AS DECIMAL(10,0)) / CAST('2017-12-11 09:30:00' AS DATE)) -- !query SELECT cast(1 as string) / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<(CAST(1 AS STRING) / CAST(1 AS TINYINT)):double> -- !query output 1.0 @@ -721,7 +721,7 @@ struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)): -- !query SELECT cast(1 as string) / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<(CAST(1 AS STRING) / CAST(1 AS SMALLINT)):double> -- !query output 1.0 @@ -729,7 +729,7 @@ struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)) -- !query SELECT cast(1 as string) / cast(1 as int) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<(CAST(1 AS STRING) / CAST(1 AS INT)):double> -- !query output 1.0 @@ -737,7 +737,7 @@ struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):doub -- !query SELECT cast(1 as string) / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<(CAST(1 AS STRING) / CAST(1 AS BIGINT)):double> -- !query output 1.0 @@ -745,7 +745,7 @@ struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):d -- !query SELECT cast(1 as string) / cast(1 as float) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(CAST(1 AS STRING) / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -753,7 +753,7 @@ struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):do -- !query SELECT cast(1 as string) / cast(1 as double) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS STRING) / CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -761,7 +761,7 @@ struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as string) / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(CAST(1 AS STRING) / CAST(1 AS DECIMAL(10,0))):double> -- !query output 1.0 @@ -769,7 +769,7 @@ struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS DECIMAL(10,0)) AS DOU -- !query SELECT cast(1 as string) / cast(1 as string) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS DOUBLE) / CAST(CAST(1 AS STRING) AS DOUBLE)):double> +struct<(CAST(1 AS STRING) / CAST(1 AS STRING)):double> -- !query output 1.0 diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/ifCoercion.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/ifCoercion.sql.out index bb49d296eaada..a9424db391b42 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/ifCoercion.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/ifCoercion.sql.out @@ -21,7 +21,7 @@ struct<(IF(true, CAST(1 AS TINYINT), CAST(2 AS TINYINT))):tinyint> -- !query SELECT IF(true, cast(1 as tinyint), cast(2 as smallint)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS TINYINT) AS SMALLINT), CAST(2 AS SMALLINT))):smallint> +struct<(IF(true, CAST(1 AS TINYINT), CAST(2 AS SMALLINT))):smallint> -- !query output 1 @@ -29,7 +29,7 @@ struct<(IF(true, CAST(CAST(1 AS TINYINT) AS SMALLINT), CAST(2 AS SMALLINT))):sma -- !query SELECT IF(true, cast(1 as tinyint), cast(2 as int)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS TINYINT) AS INT), CAST(2 AS INT))):int> +struct<(IF(true, CAST(1 AS TINYINT), CAST(2 AS INT))):int> -- !query output 1 @@ -37,7 +37,7 @@ struct<(IF(true, CAST(CAST(1 AS TINYINT) AS INT), CAST(2 AS INT))):int> -- !query SELECT IF(true, cast(1 as tinyint), cast(2 as bigint)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS TINYINT) AS BIGINT), CAST(2 AS BIGINT))):bigint> +struct<(IF(true, CAST(1 AS TINYINT), CAST(2 AS BIGINT))):bigint> -- !query output 1 @@ -45,7 +45,7 @@ struct<(IF(true, CAST(CAST(1 AS TINYINT) AS BIGINT), CAST(2 AS BIGINT))):bigint> -- !query SELECT IF(true, cast(1 as tinyint), cast(2 as float)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS TINYINT) AS FLOAT), CAST(2 AS FLOAT))):float> +struct<(IF(true, CAST(1 AS TINYINT), CAST(2 AS FLOAT))):float> -- !query output 1.0 @@ -53,7 +53,7 @@ struct<(IF(true, CAST(CAST(1 AS TINYINT) AS FLOAT), CAST(2 AS FLOAT))):float> -- !query SELECT IF(true, cast(1 as tinyint), cast(2 as double)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS TINYINT) AS DOUBLE), CAST(2 AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS TINYINT), CAST(2 AS DOUBLE))):double> -- !query output 1.0 @@ -61,7 +61,7 @@ struct<(IF(true, CAST(CAST(1 AS TINYINT) AS DOUBLE), CAST(2 AS DOUBLE))):double> -- !query SELECT IF(true, cast(1 as tinyint), cast(2 as decimal(10, 0))) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS TINYINT) AS DECIMAL(10,0)), CAST(2 AS DECIMAL(10,0)))):decimal(10,0)> +struct<(IF(true, CAST(1 AS TINYINT), CAST(2 AS DECIMAL(10,0)))):decimal(10,0)> -- !query output 1 @@ -69,7 +69,7 @@ struct<(IF(true, CAST(CAST(1 AS TINYINT) AS DECIMAL(10,0)), CAST(2 AS DECIMAL(10 -- !query SELECT IF(true, cast(1 as tinyint), cast(2 as string)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS TINYINT) AS STRING), CAST(2 AS STRING))):string> +struct<(IF(true, CAST(1 AS TINYINT), CAST(2 AS STRING))):string> -- !query output 1 @@ -113,7 +113,7 @@ cannot resolve '(IF(true, CAST(1 AS TINYINT), CAST('2017-12-11 09:30:00' AS DATE -- !query SELECT IF(true, cast(1 as smallint), cast(2 as tinyint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS SMALLINT), CAST(CAST(2 AS TINYINT) AS SMALLINT))):smallint> +struct<(IF(true, CAST(1 AS SMALLINT), CAST(2 AS TINYINT))):smallint> -- !query output 1 @@ -129,7 +129,7 @@ struct<(IF(true, CAST(1 AS SMALLINT), CAST(2 AS SMALLINT))):smallint> -- !query SELECT IF(true, cast(1 as smallint), cast(2 as int)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS SMALLINT) AS INT), CAST(2 AS INT))):int> +struct<(IF(true, CAST(1 AS SMALLINT), CAST(2 AS INT))):int> -- !query output 1 @@ -137,7 +137,7 @@ struct<(IF(true, CAST(CAST(1 AS SMALLINT) AS INT), CAST(2 AS INT))):int> -- !query SELECT IF(true, cast(1 as smallint), cast(2 as bigint)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS SMALLINT) AS BIGINT), CAST(2 AS BIGINT))):bigint> +struct<(IF(true, CAST(1 AS SMALLINT), CAST(2 AS BIGINT))):bigint> -- !query output 1 @@ -145,7 +145,7 @@ struct<(IF(true, CAST(CAST(1 AS SMALLINT) AS BIGINT), CAST(2 AS BIGINT))):bigint -- !query SELECT IF(true, cast(1 as smallint), cast(2 as float)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS SMALLINT) AS FLOAT), CAST(2 AS FLOAT))):float> +struct<(IF(true, CAST(1 AS SMALLINT), CAST(2 AS FLOAT))):float> -- !query output 1.0 @@ -153,7 +153,7 @@ struct<(IF(true, CAST(CAST(1 AS SMALLINT) AS FLOAT), CAST(2 AS FLOAT))):float> -- !query SELECT IF(true, cast(1 as smallint), cast(2 as double)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS SMALLINT) AS DOUBLE), CAST(2 AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS SMALLINT), CAST(2 AS DOUBLE))):double> -- !query output 1.0 @@ -161,7 +161,7 @@ struct<(IF(true, CAST(CAST(1 AS SMALLINT) AS DOUBLE), CAST(2 AS DOUBLE))):double -- !query SELECT IF(true, cast(1 as smallint), cast(2 as decimal(10, 0))) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS SMALLINT) AS DECIMAL(10,0)), CAST(2 AS DECIMAL(10,0)))):decimal(10,0)> +struct<(IF(true, CAST(1 AS SMALLINT), CAST(2 AS DECIMAL(10,0)))):decimal(10,0)> -- !query output 1 @@ -169,7 +169,7 @@ struct<(IF(true, CAST(CAST(1 AS SMALLINT) AS DECIMAL(10,0)), CAST(2 AS DECIMAL(1 -- !query SELECT IF(true, cast(1 as smallint), cast(2 as string)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS SMALLINT) AS STRING), CAST(2 AS STRING))):string> +struct<(IF(true, CAST(1 AS SMALLINT), CAST(2 AS STRING))):string> -- !query output 1 @@ -213,7 +213,7 @@ cannot resolve '(IF(true, CAST(1 AS SMALLINT), CAST('2017-12-11 09:30:00' AS DAT -- !query SELECT IF(true, cast(1 as int), cast(2 as tinyint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS INT), CAST(CAST(2 AS TINYINT) AS INT))):int> +struct<(IF(true, CAST(1 AS INT), CAST(2 AS TINYINT))):int> -- !query output 1 @@ -221,7 +221,7 @@ struct<(IF(true, CAST(1 AS INT), CAST(CAST(2 AS TINYINT) AS INT))):int> -- !query SELECT IF(true, cast(1 as int), cast(2 as smallint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS INT), CAST(CAST(2 AS SMALLINT) AS INT))):int> +struct<(IF(true, CAST(1 AS INT), CAST(2 AS SMALLINT))):int> -- !query output 1 @@ -237,7 +237,7 @@ struct<(IF(true, CAST(1 AS INT), CAST(2 AS INT))):int> -- !query SELECT IF(true, cast(1 as int), cast(2 as bigint)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS INT) AS BIGINT), CAST(2 AS BIGINT))):bigint> +struct<(IF(true, CAST(1 AS INT), CAST(2 AS BIGINT))):bigint> -- !query output 1 @@ -245,7 +245,7 @@ struct<(IF(true, CAST(CAST(1 AS INT) AS BIGINT), CAST(2 AS BIGINT))):bigint> -- !query SELECT IF(true, cast(1 as int), cast(2 as float)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS INT) AS FLOAT), CAST(2 AS FLOAT))):float> +struct<(IF(true, CAST(1 AS INT), CAST(2 AS FLOAT))):float> -- !query output 1.0 @@ -253,7 +253,7 @@ struct<(IF(true, CAST(CAST(1 AS INT) AS FLOAT), CAST(2 AS FLOAT))):float> -- !query SELECT IF(true, cast(1 as int), cast(2 as double)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS INT) AS DOUBLE), CAST(2 AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS INT), CAST(2 AS DOUBLE))):double> -- !query output 1.0 @@ -261,7 +261,7 @@ struct<(IF(true, CAST(CAST(1 AS INT) AS DOUBLE), CAST(2 AS DOUBLE))):double> -- !query SELECT IF(true, cast(1 as int), cast(2 as decimal(10, 0))) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS INT) AS DECIMAL(10,0)), CAST(2 AS DECIMAL(10,0)))):decimal(10,0)> +struct<(IF(true, CAST(1 AS INT), CAST(2 AS DECIMAL(10,0)))):decimal(10,0)> -- !query output 1 @@ -269,7 +269,7 @@ struct<(IF(true, CAST(CAST(1 AS INT) AS DECIMAL(10,0)), CAST(2 AS DECIMAL(10,0)) -- !query SELECT IF(true, cast(1 as int), cast(2 as string)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS INT) AS STRING), CAST(2 AS STRING))):string> +struct<(IF(true, CAST(1 AS INT), CAST(2 AS STRING))):string> -- !query output 1 @@ -313,7 +313,7 @@ cannot resolve '(IF(true, CAST(1 AS INT), CAST('2017-12-11 09:30:00' AS DATE)))' -- !query SELECT IF(true, cast(1 as bigint), cast(2 as tinyint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS BIGINT), CAST(CAST(2 AS TINYINT) AS BIGINT))):bigint> +struct<(IF(true, CAST(1 AS BIGINT), CAST(2 AS TINYINT))):bigint> -- !query output 1 @@ -321,7 +321,7 @@ struct<(IF(true, CAST(1 AS BIGINT), CAST(CAST(2 AS TINYINT) AS BIGINT))):bigint> -- !query SELECT IF(true, cast(1 as bigint), cast(2 as smallint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS BIGINT), CAST(CAST(2 AS SMALLINT) AS BIGINT))):bigint> +struct<(IF(true, CAST(1 AS BIGINT), CAST(2 AS SMALLINT))):bigint> -- !query output 1 @@ -329,7 +329,7 @@ struct<(IF(true, CAST(1 AS BIGINT), CAST(CAST(2 AS SMALLINT) AS BIGINT))):bigint -- !query SELECT IF(true, cast(1 as bigint), cast(2 as int)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS BIGINT), CAST(CAST(2 AS INT) AS BIGINT))):bigint> +struct<(IF(true, CAST(1 AS BIGINT), CAST(2 AS INT))):bigint> -- !query output 1 @@ -345,7 +345,7 @@ struct<(IF(true, CAST(1 AS BIGINT), CAST(2 AS BIGINT))):bigint> -- !query SELECT IF(true, cast(1 as bigint), cast(2 as float)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS BIGINT) AS FLOAT), CAST(2 AS FLOAT))):float> +struct<(IF(true, CAST(1 AS BIGINT), CAST(2 AS FLOAT))):float> -- !query output 1.0 @@ -353,7 +353,7 @@ struct<(IF(true, CAST(CAST(1 AS BIGINT) AS FLOAT), CAST(2 AS FLOAT))):float> -- !query SELECT IF(true, cast(1 as bigint), cast(2 as double)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS BIGINT) AS DOUBLE), CAST(2 AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS BIGINT), CAST(2 AS DOUBLE))):double> -- !query output 1.0 @@ -361,7 +361,7 @@ struct<(IF(true, CAST(CAST(1 AS BIGINT) AS DOUBLE), CAST(2 AS DOUBLE))):double> -- !query SELECT IF(true, cast(1 as bigint), cast(2 as decimal(10, 0))) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)), CAST(CAST(2 AS DECIMAL(10,0)) AS DECIMAL(20,0)))):decimal(20,0)> +struct<(IF(true, CAST(1 AS BIGINT), CAST(2 AS DECIMAL(10,0)))):decimal(20,0)> -- !query output 1 @@ -369,7 +369,7 @@ struct<(IF(true, CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)), CAST(CAST(2 AS DECIMA -- !query SELECT IF(true, cast(1 as bigint), cast(2 as string)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS BIGINT) AS STRING), CAST(2 AS STRING))):string> +struct<(IF(true, CAST(1 AS BIGINT), CAST(2 AS STRING))):string> -- !query output 1 @@ -413,7 +413,7 @@ cannot resolve '(IF(true, CAST(1 AS BIGINT), CAST('2017-12-11 09:30:00' AS DATE) -- !query SELECT IF(true, cast(1 as float), cast(2 as tinyint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS FLOAT), CAST(CAST(2 AS TINYINT) AS FLOAT))):float> +struct<(IF(true, CAST(1 AS FLOAT), CAST(2 AS TINYINT))):float> -- !query output 1.0 @@ -421,7 +421,7 @@ struct<(IF(true, CAST(1 AS FLOAT), CAST(CAST(2 AS TINYINT) AS FLOAT))):float> -- !query SELECT IF(true, cast(1 as float), cast(2 as smallint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS FLOAT), CAST(CAST(2 AS SMALLINT) AS FLOAT))):float> +struct<(IF(true, CAST(1 AS FLOAT), CAST(2 AS SMALLINT))):float> -- !query output 1.0 @@ -429,7 +429,7 @@ struct<(IF(true, CAST(1 AS FLOAT), CAST(CAST(2 AS SMALLINT) AS FLOAT))):float> -- !query SELECT IF(true, cast(1 as float), cast(2 as int)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS FLOAT), CAST(CAST(2 AS INT) AS FLOAT))):float> +struct<(IF(true, CAST(1 AS FLOAT), CAST(2 AS INT))):float> -- !query output 1.0 @@ -437,7 +437,7 @@ struct<(IF(true, CAST(1 AS FLOAT), CAST(CAST(2 AS INT) AS FLOAT))):float> -- !query SELECT IF(true, cast(1 as float), cast(2 as bigint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS FLOAT), CAST(CAST(2 AS BIGINT) AS FLOAT))):float> +struct<(IF(true, CAST(1 AS FLOAT), CAST(2 AS BIGINT))):float> -- !query output 1.0 @@ -453,7 +453,7 @@ struct<(IF(true, CAST(1 AS FLOAT), CAST(2 AS FLOAT))):float> -- !query SELECT IF(true, cast(1 as float), cast(2 as double)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS FLOAT) AS DOUBLE), CAST(2 AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS FLOAT), CAST(2 AS DOUBLE))):double> -- !query output 1.0 @@ -461,7 +461,7 @@ struct<(IF(true, CAST(CAST(1 AS FLOAT) AS DOUBLE), CAST(2 AS DOUBLE))):double> -- !query SELECT IF(true, cast(1 as float), cast(2 as decimal(10, 0))) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS FLOAT) AS DOUBLE), CAST(CAST(2 AS DECIMAL(10,0)) AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS FLOAT), CAST(2 AS DECIMAL(10,0)))):double> -- !query output 1.0 @@ -469,7 +469,7 @@ struct<(IF(true, CAST(CAST(1 AS FLOAT) AS DOUBLE), CAST(CAST(2 AS DECIMAL(10,0)) -- !query SELECT IF(true, cast(1 as float), cast(2 as string)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS FLOAT) AS STRING), CAST(2 AS STRING))):string> +struct<(IF(true, CAST(1 AS FLOAT), CAST(2 AS STRING))):string> -- !query output 1.0 @@ -513,7 +513,7 @@ cannot resolve '(IF(true, CAST(1 AS FLOAT), CAST('2017-12-11 09:30:00' AS DATE)) -- !query SELECT IF(true, cast(1 as double), cast(2 as tinyint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS DOUBLE), CAST(CAST(2 AS TINYINT) AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS DOUBLE), CAST(2 AS TINYINT))):double> -- !query output 1.0 @@ -521,7 +521,7 @@ struct<(IF(true, CAST(1 AS DOUBLE), CAST(CAST(2 AS TINYINT) AS DOUBLE))):double> -- !query SELECT IF(true, cast(1 as double), cast(2 as smallint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS DOUBLE), CAST(CAST(2 AS SMALLINT) AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS DOUBLE), CAST(2 AS SMALLINT))):double> -- !query output 1.0 @@ -529,7 +529,7 @@ struct<(IF(true, CAST(1 AS DOUBLE), CAST(CAST(2 AS SMALLINT) AS DOUBLE))):double -- !query SELECT IF(true, cast(1 as double), cast(2 as int)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS DOUBLE), CAST(CAST(2 AS INT) AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS DOUBLE), CAST(2 AS INT))):double> -- !query output 1.0 @@ -537,7 +537,7 @@ struct<(IF(true, CAST(1 AS DOUBLE), CAST(CAST(2 AS INT) AS DOUBLE))):double> -- !query SELECT IF(true, cast(1 as double), cast(2 as bigint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS DOUBLE), CAST(CAST(2 AS BIGINT) AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS DOUBLE), CAST(2 AS BIGINT))):double> -- !query output 1.0 @@ -545,7 +545,7 @@ struct<(IF(true, CAST(1 AS DOUBLE), CAST(CAST(2 AS BIGINT) AS DOUBLE))):double> -- !query SELECT IF(true, cast(1 as double), cast(2 as float)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS DOUBLE), CAST(CAST(2 AS FLOAT) AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS DOUBLE), CAST(2 AS FLOAT))):double> -- !query output 1.0 @@ -561,7 +561,7 @@ struct<(IF(true, CAST(1 AS DOUBLE), CAST(2 AS DOUBLE))):double> -- !query SELECT IF(true, cast(1 as double), cast(2 as decimal(10, 0))) FROM t -- !query schema -struct<(IF(true, CAST(1 AS DOUBLE), CAST(CAST(2 AS DECIMAL(10,0)) AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS DOUBLE), CAST(2 AS DECIMAL(10,0)))):double> -- !query output 1.0 @@ -569,7 +569,7 @@ struct<(IF(true, CAST(1 AS DOUBLE), CAST(CAST(2 AS DECIMAL(10,0)) AS DOUBLE))):d -- !query SELECT IF(true, cast(1 as double), cast(2 as string)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS DOUBLE) AS STRING), CAST(2 AS STRING))):string> +struct<(IF(true, CAST(1 AS DOUBLE), CAST(2 AS STRING))):string> -- !query output 1.0 @@ -613,7 +613,7 @@ cannot resolve '(IF(true, CAST(1 AS DOUBLE), CAST('2017-12-11 09:30:00' AS DATE) -- !query SELECT IF(true, cast(1 as decimal(10, 0)), cast(2 as tinyint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(CAST(2 AS TINYINT) AS DECIMAL(10,0)))):decimal(10,0)> +struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(2 AS TINYINT))):decimal(10,0)> -- !query output 1 @@ -621,7 +621,7 @@ struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(CAST(2 AS TINYINT) AS DECIMAL(10 -- !query SELECT IF(true, cast(1 as decimal(10, 0)), cast(2 as smallint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(CAST(2 AS SMALLINT) AS DECIMAL(10,0)))):decimal(10,0)> +struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(2 AS SMALLINT))):decimal(10,0)> -- !query output 1 @@ -629,7 +629,7 @@ struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(CAST(2 AS SMALLINT) AS DECIMAL(1 -- !query SELECT IF(true, cast(1 as decimal(10, 0)), cast(2 as int)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(CAST(2 AS INT) AS DECIMAL(10,0)))):decimal(10,0)> +struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(2 AS INT))):decimal(10,0)> -- !query output 1 @@ -637,7 +637,7 @@ struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(CAST(2 AS INT) AS DECIMAL(10,0)) -- !query SELECT IF(true, cast(1 as decimal(10, 0)), cast(2 as bigint)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)), CAST(CAST(2 AS BIGINT) AS DECIMAL(20,0)))):decimal(20,0)> +struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(2 AS BIGINT))):decimal(20,0)> -- !query output 1 @@ -645,7 +645,7 @@ struct<(IF(true, CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)), CAST(CAST(2 AS -- !query SELECT IF(true, cast(1 as decimal(10, 0)), cast(2 as float)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE), CAST(CAST(2 AS FLOAT) AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(2 AS FLOAT))):double> -- !query output 1.0 @@ -653,7 +653,7 @@ struct<(IF(true, CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE), CAST(CAST(2 AS FLOAT) -- !query SELECT IF(true, cast(1 as decimal(10, 0)), cast(2 as double)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE), CAST(2 AS DOUBLE))):double> +struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(2 AS DOUBLE))):double> -- !query output 1.0 @@ -669,7 +669,7 @@ struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(2 AS DECIMAL(10,0)))):decimal(10 -- !query SELECT IF(true, cast(1 as decimal(10, 0)), cast(2 as string)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(1 AS DECIMAL(10,0)) AS STRING), CAST(2 AS STRING))):string> +struct<(IF(true, CAST(1 AS DECIMAL(10,0)), CAST(2 AS STRING))):string> -- !query output 1 @@ -713,7 +713,7 @@ cannot resolve '(IF(true, CAST(1 AS DECIMAL(10,0)), CAST('2017-12-11 09:30:00' A -- !query SELECT IF(true, cast(1 as string), cast(2 as tinyint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS TINYINT) AS STRING))):string> +struct<(IF(true, CAST(1 AS STRING), CAST(2 AS TINYINT))):string> -- !query output 1 @@ -721,7 +721,7 @@ struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS TINYINT) AS STRING))):string> -- !query SELECT IF(true, cast(1 as string), cast(2 as smallint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS SMALLINT) AS STRING))):string> +struct<(IF(true, CAST(1 AS STRING), CAST(2 AS SMALLINT))):string> -- !query output 1 @@ -729,7 +729,7 @@ struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS SMALLINT) AS STRING))):string -- !query SELECT IF(true, cast(1 as string), cast(2 as int)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS INT) AS STRING))):string> +struct<(IF(true, CAST(1 AS STRING), CAST(2 AS INT))):string> -- !query output 1 @@ -737,7 +737,7 @@ struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS INT) AS STRING))):string> -- !query SELECT IF(true, cast(1 as string), cast(2 as bigint)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS BIGINT) AS STRING))):string> +struct<(IF(true, CAST(1 AS STRING), CAST(2 AS BIGINT))):string> -- !query output 1 @@ -745,7 +745,7 @@ struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS BIGINT) AS STRING))):string> -- !query SELECT IF(true, cast(1 as string), cast(2 as float)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS FLOAT) AS STRING))):string> +struct<(IF(true, CAST(1 AS STRING), CAST(2 AS FLOAT))):string> -- !query output 1 @@ -753,7 +753,7 @@ struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS FLOAT) AS STRING))):string> -- !query SELECT IF(true, cast(1 as string), cast(2 as double)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS DOUBLE) AS STRING))):string> +struct<(IF(true, CAST(1 AS STRING), CAST(2 AS DOUBLE))):string> -- !query output 1 @@ -761,7 +761,7 @@ struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS DOUBLE) AS STRING))):string> -- !query SELECT IF(true, cast(1 as string), cast(2 as decimal(10, 0))) FROM t -- !query schema -struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2 AS DECIMAL(10,0)) AS STRING))):string> +struct<(IF(true, CAST(1 AS STRING), CAST(2 AS DECIMAL(10,0)))):string> -- !query output 1 @@ -795,7 +795,7 @@ cannot resolve '(IF(true, CAST(1 AS STRING), CAST(2 AS BOOLEAN)))' due to data t -- !query SELECT IF(true, cast(1 as string), cast('2017-12-11 09:30:00.0' as timestamp)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) AS STRING))):string> +struct<(IF(true, CAST(1 AS STRING), CAST(2017-12-11 09:30:00.0 AS TIMESTAMP))):string> -- !query output 1 @@ -803,7 +803,7 @@ struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP -- !query SELECT IF(true, cast(1 as string), cast('2017-12-11 09:30:00' as date)) FROM t -- !query schema -struct<(IF(true, CAST(1 AS STRING), CAST(CAST(2017-12-11 09:30:00 AS DATE) AS STRING))):string> +struct<(IF(true, CAST(1 AS STRING), CAST(2017-12-11 09:30:00 AS DATE))):string> -- !query output 1 @@ -1088,7 +1088,7 @@ cannot resolve '(IF(true, CAST('2017-12-12 09:30:00.0' AS TIMESTAMP), CAST(2 AS -- !query SELECT IF(true, cast('2017-12-12 09:30:00.0' as timestamp), cast(2 as string)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(2017-12-12 09:30:00.0 AS TIMESTAMP) AS STRING), CAST(2 AS STRING))):string> +struct<(IF(true, CAST(2017-12-12 09:30:00.0 AS TIMESTAMP), CAST(2 AS STRING))):string> -- !query output 2017-12-12 09:30:00 @@ -1122,7 +1122,7 @@ struct<(IF(true, CAST(2017-12-12 09:30:00.0 AS TIMESTAMP), CAST(2017-12-11 09:30 -- !query SELECT IF(true, cast('2017-12-12 09:30:00.0' as timestamp), cast('2017-12-11 09:30:00' as date)) FROM t -- !query schema -struct<(IF(true, CAST(2017-12-12 09:30:00.0 AS TIMESTAMP), CAST(CAST(2017-12-11 09:30:00 AS DATE) AS TIMESTAMP))):timestamp> +struct<(IF(true, CAST(2017-12-12 09:30:00.0 AS TIMESTAMP), CAST(2017-12-11 09:30:00 AS DATE))):timestamp> -- !query output 2017-12-12 09:30:00 @@ -1193,7 +1193,7 @@ cannot resolve '(IF(true, CAST('2017-12-12 09:30:00' AS DATE), CAST(2 AS DECIMAL -- !query SELECT IF(true, cast('2017-12-12 09:30:00' as date), cast(2 as string)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(2017-12-12 09:30:00 AS DATE) AS STRING), CAST(2 AS STRING))):string> +struct<(IF(true, CAST(2017-12-12 09:30:00 AS DATE), CAST(2 AS STRING))):string> -- !query output 2017-12-12 @@ -1219,7 +1219,7 @@ cannot resolve '(IF(true, CAST('2017-12-12 09:30:00' AS DATE), CAST(2 AS BOOLEAN -- !query SELECT IF(true, cast('2017-12-12 09:30:00' as date), cast('2017-12-11 09:30:00.0' as timestamp)) FROM t -- !query schema -struct<(IF(true, CAST(CAST(2017-12-12 09:30:00 AS DATE) AS TIMESTAMP), CAST(2017-12-11 09:30:00.0 AS TIMESTAMP))):timestamp> +struct<(IF(true, CAST(2017-12-12 09:30:00 AS DATE), CAST(2017-12-11 09:30:00.0 AS TIMESTAMP))):timestamp> -- !query output 2017-12-12 00:00:00 diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/implicitTypeCasts.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/implicitTypeCasts.sql.out index e47decbd33920..4e70f8dd5a6a0 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/implicitTypeCasts.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/implicitTypeCasts.sql.out @@ -13,7 +13,7 @@ struct<> -- !query SELECT 1 + '2' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(2 AS DOUBLE)):double> +struct<(1 + 2):double> -- !query output 3.0 @@ -21,7 +21,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(2 AS DOUBLE)):double> -- !query SELECT 1 - '2' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(2 AS DOUBLE)):double> +struct<(1 - 2):double> -- !query output -1.0 @@ -29,7 +29,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(2 AS DOUBLE)):double> -- !query SELECT 1 * '2' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(2 AS DOUBLE)):double> +struct<(1 * 2):double> -- !query output 2.0 @@ -37,7 +37,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(2 AS DOUBLE)):double> -- !query SELECT 4 / '2' FROM t -- !query schema -struct<(CAST(4 AS DOUBLE) / CAST(CAST(2 AS DOUBLE) AS DOUBLE)):double> +struct<(4 / 2):double> -- !query output 2.0 @@ -45,7 +45,7 @@ struct<(CAST(4 AS DOUBLE) / CAST(CAST(2 AS DOUBLE) AS DOUBLE)):double> -- !query SELECT 1.1 + '2' FROM t -- !query schema -struct<(CAST(1.1 AS DOUBLE) + CAST(2 AS DOUBLE)):double> +struct<(1.1 + 2):double> -- !query output 3.1 @@ -53,7 +53,7 @@ struct<(CAST(1.1 AS DOUBLE) + CAST(2 AS DOUBLE)):double> -- !query SELECT 1.1 - '2' FROM t -- !query schema -struct<(CAST(1.1 AS DOUBLE) - CAST(2 AS DOUBLE)):double> +struct<(1.1 - 2):double> -- !query output -0.8999999999999999 @@ -61,7 +61,7 @@ struct<(CAST(1.1 AS DOUBLE) - CAST(2 AS DOUBLE)):double> -- !query SELECT 1.1 * '2' FROM t -- !query schema -struct<(CAST(1.1 AS DOUBLE) * CAST(2 AS DOUBLE)):double> +struct<(1.1 * 2):double> -- !query output 2.2 @@ -69,7 +69,7 @@ struct<(CAST(1.1 AS DOUBLE) * CAST(2 AS DOUBLE)):double> -- !query SELECT 4.4 / '2' FROM t -- !query schema -struct<(CAST(4.4 AS DOUBLE) / CAST(2 AS DOUBLE)):double> +struct<(4.4 / 2):double> -- !query output 2.2 @@ -77,7 +77,7 @@ struct<(CAST(4.4 AS DOUBLE) / CAST(2 AS DOUBLE)):double> -- !query SELECT 1.1 + '2.2' FROM t -- !query schema -struct<(CAST(1.1 AS DOUBLE) + CAST(2.2 AS DOUBLE)):double> +struct<(1.1 + 2.2):double> -- !query output 3.3000000000000003 @@ -85,7 +85,7 @@ struct<(CAST(1.1 AS DOUBLE) + CAST(2.2 AS DOUBLE)):double> -- !query SELECT 1.1 - '2.2' FROM t -- !query schema -struct<(CAST(1.1 AS DOUBLE) - CAST(2.2 AS DOUBLE)):double> +struct<(1.1 - 2.2):double> -- !query output -1.1 @@ -93,7 +93,7 @@ struct<(CAST(1.1 AS DOUBLE) - CAST(2.2 AS DOUBLE)):double> -- !query SELECT 1.1 * '2.2' FROM t -- !query schema -struct<(CAST(1.1 AS DOUBLE) * CAST(2.2 AS DOUBLE)):double> +struct<(1.1 * 2.2):double> -- !query output 2.4200000000000004 @@ -101,7 +101,7 @@ struct<(CAST(1.1 AS DOUBLE) * CAST(2.2 AS DOUBLE)):double> -- !query SELECT 4.4 / '2.2' FROM t -- !query schema -struct<(CAST(4.4 AS DOUBLE) / CAST(2.2 AS DOUBLE)):double> +struct<(4.4 / 2.2):double> -- !query output 2.0 @@ -109,7 +109,7 @@ struct<(CAST(4.4 AS DOUBLE) / CAST(2.2 AS DOUBLE)):double> -- !query SELECT '$' || cast(1 as smallint) || '$' FROM t -- !query schema -struct +struct -- !query output $1$ @@ -117,7 +117,7 @@ $1$ -- !query SELECT '$' || 1 || '$' FROM t -- !query schema -struct +struct -- !query output $1$ @@ -125,7 +125,7 @@ $1$ -- !query SELECT '$' || cast(1 as bigint) || '$' FROM t -- !query schema -struct +struct -- !query output $1$ @@ -133,7 +133,7 @@ $1$ -- !query SELECT '$' || cast(1.1 as float) || '$' FROM t -- !query schema -struct +struct -- !query output $1.1$ @@ -141,7 +141,7 @@ $1.1$ -- !query SELECT '$' || cast(1.1 as double) || '$' FROM t -- !query schema -struct +struct -- !query output $1.1$ @@ -149,7 +149,7 @@ $1.1$ -- !query SELECT '$' || 1.1 || '$' FROM t -- !query schema -struct +struct -- !query output $1.1$ @@ -157,7 +157,7 @@ $1.1$ -- !query SELECT '$' || cast(1.1 as decimal(8,3)) || '$' FROM t -- !query schema -struct +struct -- !query output $1.100$ @@ -173,7 +173,7 @@ $abcd$ -- !query SELECT '$' || date('1996-09-09') || '$' FROM t -- !query schema -struct +struct -- !query output $1996-09-09$ @@ -181,7 +181,7 @@ $1996-09-09$ -- !query SELECT '$' || timestamp('1996-09-09 10:11:12.4' )|| '$' FROM t -- !query schema -struct +struct -- !query output $1996-09-09 10:11:12.4$ @@ -189,7 +189,7 @@ $1996-09-09 10:11:12.4$ -- !query SELECT length(cast(1 as smallint)) FROM t -- !query schema -struct +struct -- !query output 1 @@ -197,7 +197,7 @@ struct -- !query SELECT length(cast(1 as int)) FROM t -- !query schema -struct +struct -- !query output 1 @@ -205,7 +205,7 @@ struct -- !query SELECT length(cast(1 as bigint)) FROM t -- !query schema -struct +struct -- !query output 1 @@ -213,7 +213,7 @@ struct -- !query SELECT length(cast(1.1 as float)) FROM t -- !query schema -struct +struct -- !query output 3 @@ -221,7 +221,7 @@ struct -- !query SELECT length(cast(1.1 as double)) FROM t -- !query schema -struct +struct -- !query output 3 @@ -229,7 +229,7 @@ struct -- !query SELECT length(1.1) FROM t -- !query schema -struct +struct -- !query output 3 @@ -237,7 +237,7 @@ struct -- !query SELECT length(cast(1.1 as decimal(8,3))) FROM t -- !query schema -struct +struct -- !query output 5 @@ -253,7 +253,7 @@ struct -- !query SELECT length(date('1996-09-10')) FROM t -- !query schema -struct +struct -- !query output 10 @@ -261,7 +261,7 @@ struct -- !query SELECT length(timestamp('1996-09-10 10:11:12.4')) FROM t -- !query schema -struct +struct -- !query output 21 @@ -269,7 +269,7 @@ struct -- !query SELECT year( '1996-01-10') FROM t -- !query schema -struct +struct -- !query output 1996 @@ -277,7 +277,7 @@ struct -- !query SELECT month( '1996-01-10') FROM t -- !query schema -struct +struct -- !query output 1 @@ -285,7 +285,7 @@ struct -- !query SELECT day( '1996-01-10') FROM t -- !query schema -struct +struct -- !query output 10 @@ -293,7 +293,7 @@ struct -- !query SELECT hour( '10:11:12') FROM t -- !query schema -struct +struct -- !query output 10 @@ -301,7 +301,7 @@ struct -- !query SELECT minute( '10:11:12') FROM t -- !query schema -struct +struct -- !query output 11 @@ -309,7 +309,7 @@ struct -- !query SELECT second( '10:11:12') FROM t -- !query schema -struct +struct -- !query output 12 @@ -317,7 +317,7 @@ struct -- !query select 1 like '%' FROM t -- !query schema -struct +struct<1 LIKE %:boolean> -- !query output true @@ -325,7 +325,7 @@ true -- !query select date('1996-09-10') like '19%' FROM t -- !query schema -struct +struct<1996-09-10 LIKE 19%:boolean> -- !query output true @@ -333,7 +333,7 @@ true -- !query select '1' like 1 FROM t -- !query schema -struct<1 LIKE CAST(1 AS STRING):boolean> +struct<1 LIKE 1:boolean> -- !query output true @@ -341,7 +341,7 @@ true -- !query select '1 ' like 1 FROM t -- !query schema -struct<1 LIKE CAST(1 AS STRING):boolean> +struct<1 LIKE 1:boolean> -- !query output false @@ -349,6 +349,6 @@ false -- !query select '1996-09-10' like date('1996-09-10') FROM t -- !query schema -struct<1996-09-10 LIKE CAST(CAST(1996-09-10 AS DATE) AS STRING):boolean> +struct<1996-09-10 LIKE 1996-09-10:boolean> -- !query output true diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/inConversion.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/inConversion.sql.out index 21d0a0e0fef4e..7f87029a2ea75 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/inConversion.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/inConversion.sql.out @@ -21,7 +21,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS SMALLINT) IN (CAST(CAST(1 AS SMALLINT) AS SMALLINT))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -29,7 +29,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS INT) IN (CAST(CAST(1 AS INT) AS INT))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS INT))):boolean> -- !query output true @@ -37,7 +37,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS BIGINT) IN (CAST(CAST(1 AS BIGINT) AS BIGINT))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS BIGINT))):boolean> -- !query output true @@ -45,7 +45,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS FLOAT) IN (CAST(CAST(1 AS FLOAT) AS FLOAT))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS FLOAT))):boolean> -- !query output true @@ -53,7 +53,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) IN (CAST(CAST(1 AS DOUBLE) AS DOUBLE))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -61,7 +61,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(10,0)) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -69,7 +69,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS STRING))):boolean> -- !query output true @@ -113,7 +113,7 @@ cannot resolve '(CAST(1 AS TINYINT) IN (CAST('2017-12-11 09:30:00' AS DATE)))' d -- !query SELECT cast(1 as smallint) in (cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS SMALLINT) IN (CAST(CAST(1 AS TINYINT) AS SMALLINT))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS TINYINT))):boolean> -- !query output true @@ -129,7 +129,7 @@ true -- !query SELECT cast(1 as smallint) in (cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS INT) IN (CAST(CAST(1 AS INT) AS INT))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS INT))):boolean> -- !query output true @@ -137,7 +137,7 @@ true -- !query SELECT cast(1 as smallint) in (cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS BIGINT) IN (CAST(CAST(1 AS BIGINT) AS BIGINT))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS BIGINT))):boolean> -- !query output true @@ -145,7 +145,7 @@ true -- !query SELECT cast(1 as smallint) in (cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS FLOAT) IN (CAST(CAST(1 AS FLOAT) AS FLOAT))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS FLOAT))):boolean> -- !query output true @@ -153,7 +153,7 @@ true -- !query SELECT cast(1 as smallint) in (cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) IN (CAST(CAST(1 AS DOUBLE) AS DOUBLE))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -161,7 +161,7 @@ true -- !query SELECT cast(1 as smallint) in (cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(10,0)) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -169,7 +169,7 @@ true -- !query SELECT cast(1 as smallint) in (cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS STRING))):boolean> -- !query output true @@ -213,7 +213,7 @@ cannot resolve '(CAST(1 AS SMALLINT) IN (CAST('2017-12-11 09:30:00' AS DATE)))' -- !query SELECT cast(1 as int) in (cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS INT) IN (CAST(CAST(1 AS TINYINT) AS INT))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS TINYINT))):boolean> -- !query output true @@ -221,7 +221,7 @@ true -- !query SELECT cast(1 as int) in (cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS INT) IN (CAST(CAST(1 AS SMALLINT) AS INT))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -237,7 +237,7 @@ true -- !query SELECT cast(1 as int) in (cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS BIGINT) IN (CAST(CAST(1 AS BIGINT) AS BIGINT))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS BIGINT))):boolean> -- !query output true @@ -245,7 +245,7 @@ true -- !query SELECT cast(1 as int) in (cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS FLOAT) IN (CAST(CAST(1 AS FLOAT) AS FLOAT))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS FLOAT))):boolean> -- !query output true @@ -253,7 +253,7 @@ true -- !query SELECT cast(1 as int) in (cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) IN (CAST(CAST(1 AS DOUBLE) AS DOUBLE))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -261,7 +261,7 @@ true -- !query SELECT cast(1 as int) in (cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -269,7 +269,7 @@ true -- !query SELECT cast(1 as int) in (cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS STRING))):boolean> -- !query output true @@ -313,7 +313,7 @@ cannot resolve '(CAST(1 AS INT) IN (CAST('2017-12-11 09:30:00' AS DATE)))' due t -- !query SELECT cast(1 as bigint) in (cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS BIGINT) IN (CAST(CAST(1 AS TINYINT) AS BIGINT))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS TINYINT))):boolean> -- !query output true @@ -321,7 +321,7 @@ true -- !query SELECT cast(1 as bigint) in (cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS BIGINT) IN (CAST(CAST(1 AS SMALLINT) AS BIGINT))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -329,7 +329,7 @@ true -- !query SELECT cast(1 as bigint) in (cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS BIGINT) IN (CAST(CAST(1 AS INT) AS BIGINT))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS INT))):boolean> -- !query output true @@ -345,7 +345,7 @@ true -- !query SELECT cast(1 as bigint) in (cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS FLOAT) IN (CAST(CAST(1 AS FLOAT) AS FLOAT))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS FLOAT))):boolean> -- !query output true @@ -353,7 +353,7 @@ true -- !query SELECT cast(1 as bigint) in (cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) IN (CAST(CAST(1 AS DOUBLE) AS DOUBLE))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -361,7 +361,7 @@ true -- !query SELECT cast(1 as bigint) in (cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -369,7 +369,7 @@ true -- !query SELECT cast(1 as bigint) in (cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS STRING))):boolean> -- !query output true @@ -413,7 +413,7 @@ cannot resolve '(CAST(1 AS BIGINT) IN (CAST('2017-12-11 09:30:00' AS DATE)))' du -- !query SELECT cast(1 as float) in (cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS FLOAT) IN (CAST(CAST(1 AS TINYINT) AS FLOAT))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS TINYINT))):boolean> -- !query output true @@ -421,7 +421,7 @@ true -- !query SELECT cast(1 as float) in (cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS FLOAT) IN (CAST(CAST(1 AS SMALLINT) AS FLOAT))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -429,7 +429,7 @@ true -- !query SELECT cast(1 as float) in (cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS FLOAT) IN (CAST(CAST(1 AS INT) AS FLOAT))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS INT))):boolean> -- !query output true @@ -437,7 +437,7 @@ true -- !query SELECT cast(1 as float) in (cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS FLOAT) IN (CAST(CAST(1 AS BIGINT) AS FLOAT))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS BIGINT))):boolean> -- !query output true @@ -453,7 +453,7 @@ true -- !query SELECT cast(1 as float) in (cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) IN (CAST(CAST(1 AS DOUBLE) AS DOUBLE))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -461,7 +461,7 @@ true -- !query SELECT cast(1 as float) in (cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -469,7 +469,7 @@ true -- !query SELECT cast(1 as float) in (cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS STRING))):boolean> -- !query output false @@ -513,7 +513,7 @@ cannot resolve '(CAST(1 AS FLOAT) IN (CAST('2017-12-11 09:30:00' AS DATE)))' due -- !query SELECT cast(1 as double) in (cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS DOUBLE) IN (CAST(CAST(1 AS TINYINT) AS DOUBLE))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS TINYINT))):boolean> -- !query output true @@ -521,7 +521,7 @@ true -- !query SELECT cast(1 as double) in (cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS DOUBLE) IN (CAST(CAST(1 AS SMALLINT) AS DOUBLE))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -529,7 +529,7 @@ true -- !query SELECT cast(1 as double) in (cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS DOUBLE) IN (CAST(CAST(1 AS INT) AS DOUBLE))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS INT))):boolean> -- !query output true @@ -537,7 +537,7 @@ true -- !query SELECT cast(1 as double) in (cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS DOUBLE) IN (CAST(CAST(1 AS BIGINT) AS DOUBLE))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS BIGINT))):boolean> -- !query output true @@ -545,7 +545,7 @@ true -- !query SELECT cast(1 as double) in (cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS DOUBLE) IN (CAST(CAST(1 AS FLOAT) AS DOUBLE))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS FLOAT))):boolean> -- !query output true @@ -561,7 +561,7 @@ true -- !query SELECT cast(1 as double) in (cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS DOUBLE) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -569,7 +569,7 @@ true -- !query SELECT cast(1 as double) in (cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS STRING))):boolean> -- !query output false @@ -613,7 +613,7 @@ cannot resolve '(CAST(1 AS DOUBLE) IN (CAST('2017-12-11 09:30:00' AS DATE)))' du -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) IN (CAST(CAST(1 AS TINYINT) AS DECIMAL(10,0)))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS TINYINT))):boolean> -- !query output true @@ -621,7 +621,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) IN (CAST(CAST(1 AS SMALLINT) AS DECIMAL(10,0)))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -629,7 +629,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) IN (CAST(CAST(1 AS INT) AS DECIMAL(10,0)))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS INT))):boolean> -- !query output true @@ -637,7 +637,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) IN (CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS BIGINT))):boolean> -- !query output true @@ -645,7 +645,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) IN (CAST(CAST(1 AS FLOAT) AS DOUBLE))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS FLOAT))):boolean> -- !query output true @@ -653,7 +653,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) IN (CAST(CAST(1 AS DOUBLE) AS DOUBLE))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -669,7 +669,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS STRING))):boolean> -- !query output true @@ -713,7 +713,7 @@ cannot resolve '(CAST(1 AS DECIMAL(10,0)) IN (CAST('2017-12-11 09:30:00' AS DATE -- !query SELECT cast(1 as string) in (cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS TINYINT) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS TINYINT))):boolean> -- !query output true @@ -721,7 +721,7 @@ true -- !query SELECT cast(1 as string) in (cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS SMALLINT) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -729,7 +729,7 @@ true -- !query SELECT cast(1 as string) in (cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS INT) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS INT))):boolean> -- !query output true @@ -737,7 +737,7 @@ true -- !query SELECT cast(1 as string) in (cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS BIGINT) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS BIGINT))):boolean> -- !query output true @@ -745,7 +745,7 @@ true -- !query SELECT cast(1 as string) in (cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS FLOAT) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS FLOAT))):boolean> -- !query output false @@ -753,7 +753,7 @@ false -- !query SELECT cast(1 as string) in (cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS DOUBLE) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS DOUBLE))):boolean> -- !query output false @@ -761,7 +761,7 @@ false -- !query SELECT cast(1 as string) in (cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -795,7 +795,7 @@ cannot resolve '(CAST(1 AS STRING) IN (CAST(1 AS BOOLEAN)))' due to data type mi -- !query SELECT cast(1 as string) in (cast('2017-12-11 09:30:00.0' as timestamp)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(2017-12-11 09:30:00.0 AS TIMESTAMP))):boolean> -- !query output false @@ -803,7 +803,7 @@ false -- !query SELECT cast(1 as string) in (cast('2017-12-11 09:30:00' as date)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(2017-12-11 09:30:00 AS DATE) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(2017-12-11 09:30:00 AS DATE))):boolean> -- !query output false @@ -1088,7 +1088,7 @@ cannot resolve '(CAST('2017-12-12 09:30:00.0' AS TIMESTAMP) IN (CAST(2 AS DECIMA -- !query SELECT cast('2017-12-12 09:30:00.0' as timestamp) in (cast(2 as string)) FROM t -- !query schema -struct<(CAST(CAST(2017-12-12 09:30:00.0 AS TIMESTAMP) AS STRING) IN (CAST(CAST(2 AS STRING) AS STRING))):boolean> +struct<(CAST(2017-12-12 09:30:00.0 AS TIMESTAMP) IN (CAST(2 AS STRING))):boolean> -- !query output false @@ -1122,7 +1122,7 @@ false -- !query SELECT cast('2017-12-12 09:30:00.0' as timestamp) in (cast('2017-12-11 09:30:00' as date)) FROM t -- !query schema -struct<(CAST(CAST(2017-12-12 09:30:00.0 AS TIMESTAMP) AS TIMESTAMP) IN (CAST(CAST(2017-12-11 09:30:00 AS DATE) AS TIMESTAMP))):boolean> +struct<(CAST(2017-12-12 09:30:00.0 AS TIMESTAMP) IN (CAST(2017-12-11 09:30:00 AS DATE))):boolean> -- !query output false @@ -1193,7 +1193,7 @@ cannot resolve '(CAST('2017-12-12 09:30:00' AS DATE) IN (CAST(2 AS DECIMAL(10,0) -- !query SELECT cast('2017-12-12 09:30:00' as date) in (cast(2 as string)) FROM t -- !query schema -struct<(CAST(CAST(2017-12-12 09:30:00 AS DATE) AS STRING) IN (CAST(CAST(2 AS STRING) AS STRING))):boolean> +struct<(CAST(2017-12-12 09:30:00 AS DATE) IN (CAST(2 AS STRING))):boolean> -- !query output false @@ -1219,7 +1219,7 @@ cannot resolve '(CAST('2017-12-12 09:30:00' AS DATE) IN (CAST(2 AS BOOLEAN)))' d -- !query SELECT cast('2017-12-12 09:30:00' as date) in (cast('2017-12-11 09:30:00.0' as timestamp)) FROM t -- !query schema -struct<(CAST(CAST(2017-12-12 09:30:00 AS DATE) AS TIMESTAMP) IN (CAST(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) AS TIMESTAMP))):boolean> +struct<(CAST(2017-12-12 09:30:00 AS DATE) IN (CAST(2017-12-11 09:30:00.0 AS TIMESTAMP))):boolean> -- !query output false @@ -1243,7 +1243,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as tinyint), cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS SMALLINT) IN (CAST(CAST(1 AS TINYINT) AS SMALLINT), CAST(CAST(1 AS SMALLINT) AS SMALLINT))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS TINYINT), CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -1251,7 +1251,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as tinyint), cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS INT) IN (CAST(CAST(1 AS TINYINT) AS INT), CAST(CAST(1 AS INT) AS INT))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS TINYINT), CAST(1 AS INT))):boolean> -- !query output true @@ -1259,7 +1259,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as tinyint), cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS BIGINT) IN (CAST(CAST(1 AS TINYINT) AS BIGINT), CAST(CAST(1 AS BIGINT) AS BIGINT))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS TINYINT), CAST(1 AS BIGINT))):boolean> -- !query output true @@ -1267,7 +1267,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as tinyint), cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS FLOAT) IN (CAST(CAST(1 AS TINYINT) AS FLOAT), CAST(CAST(1 AS FLOAT) AS FLOAT))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS TINYINT), CAST(1 AS FLOAT))):boolean> -- !query output true @@ -1275,7 +1275,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as tinyint), cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) IN (CAST(CAST(1 AS TINYINT) AS DOUBLE), CAST(CAST(1 AS DOUBLE) AS DOUBLE))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS TINYINT), CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -1283,7 +1283,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as tinyint), cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DECIMAL(10,0)) IN (CAST(CAST(1 AS TINYINT) AS DECIMAL(10,0)), CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS TINYINT), CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -1291,7 +1291,7 @@ true -- !query SELECT cast(1 as tinyint) in (cast(1 as tinyint), cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS STRING) IN (CAST(CAST(1 AS TINYINT) AS STRING), CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS TINYINT) IN (CAST(1 AS TINYINT), CAST(1 AS STRING))):boolean> -- !query output true @@ -1335,7 +1335,7 @@ cannot resolve '(CAST(1 AS TINYINT) IN (CAST(1 AS TINYINT), CAST('2017-12-11 09: -- !query SELECT cast(1 as smallint) in (cast(1 as smallint), cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS SMALLINT) IN (CAST(CAST(1 AS SMALLINT) AS SMALLINT), CAST(CAST(1 AS TINYINT) AS SMALLINT))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS SMALLINT), CAST(1 AS TINYINT))):boolean> -- !query output true @@ -1351,7 +1351,7 @@ true -- !query SELECT cast(1 as smallint) in (cast(1 as smallint), cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS INT) IN (CAST(CAST(1 AS SMALLINT) AS INT), CAST(CAST(1 AS INT) AS INT))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS SMALLINT), CAST(1 AS INT))):boolean> -- !query output true @@ -1359,7 +1359,7 @@ true -- !query SELECT cast(1 as smallint) in (cast(1 as smallint), cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS BIGINT) IN (CAST(CAST(1 AS SMALLINT) AS BIGINT), CAST(CAST(1 AS BIGINT) AS BIGINT))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS SMALLINT), CAST(1 AS BIGINT))):boolean> -- !query output true @@ -1367,7 +1367,7 @@ true -- !query SELECT cast(1 as smallint) in (cast(1 as smallint), cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS FLOAT) IN (CAST(CAST(1 AS SMALLINT) AS FLOAT), CAST(CAST(1 AS FLOAT) AS FLOAT))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS SMALLINT), CAST(1 AS FLOAT))):boolean> -- !query output true @@ -1375,7 +1375,7 @@ true -- !query SELECT cast(1 as smallint) in (cast(1 as smallint), cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) IN (CAST(CAST(1 AS SMALLINT) AS DOUBLE), CAST(CAST(1 AS DOUBLE) AS DOUBLE))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS SMALLINT), CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -1383,7 +1383,7 @@ true -- !query SELECT cast(1 as smallint) in (cast(1 as smallint), cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DECIMAL(10,0)) IN (CAST(CAST(1 AS SMALLINT) AS DECIMAL(10,0)), CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS SMALLINT), CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -1391,7 +1391,7 @@ true -- !query SELECT cast(1 as smallint) in (cast(1 as smallint), cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS STRING) IN (CAST(CAST(1 AS SMALLINT) AS STRING), CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS SMALLINT) IN (CAST(1 AS SMALLINT), CAST(1 AS STRING))):boolean> -- !query output true @@ -1435,7 +1435,7 @@ cannot resolve '(CAST(1 AS SMALLINT) IN (CAST(1 AS SMALLINT), CAST('2017-12-11 0 -- !query SELECT cast(1 as int) in (cast(1 as int), cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS INT) IN (CAST(CAST(1 AS INT) AS INT), CAST(CAST(1 AS TINYINT) AS INT))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS INT), CAST(1 AS TINYINT))):boolean> -- !query output true @@ -1443,7 +1443,7 @@ true -- !query SELECT cast(1 as int) in (cast(1 as int), cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS INT) IN (CAST(CAST(1 AS INT) AS INT), CAST(CAST(1 AS SMALLINT) AS INT))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS INT), CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -1459,7 +1459,7 @@ true -- !query SELECT cast(1 as int) in (cast(1 as int), cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS BIGINT) IN (CAST(CAST(1 AS INT) AS BIGINT), CAST(CAST(1 AS BIGINT) AS BIGINT))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS INT), CAST(1 AS BIGINT))):boolean> -- !query output true @@ -1467,7 +1467,7 @@ true -- !query SELECT cast(1 as int) in (cast(1 as int), cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS FLOAT) IN (CAST(CAST(1 AS INT) AS FLOAT), CAST(CAST(1 AS FLOAT) AS FLOAT))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS INT), CAST(1 AS FLOAT))):boolean> -- !query output true @@ -1475,7 +1475,7 @@ true -- !query SELECT cast(1 as int) in (cast(1 as int), cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) IN (CAST(CAST(1 AS INT) AS DOUBLE), CAST(CAST(1 AS DOUBLE) AS DOUBLE))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS INT), CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -1483,7 +1483,7 @@ true -- !query SELECT cast(1 as int) in (cast(1 as int), cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DECIMAL(10,0)) IN (CAST(CAST(1 AS INT) AS DECIMAL(10,0)), CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS INT), CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -1491,7 +1491,7 @@ true -- !query SELECT cast(1 as int) in (cast(1 as int), cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS STRING) IN (CAST(CAST(1 AS INT) AS STRING), CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS INT) IN (CAST(1 AS INT), CAST(1 AS STRING))):boolean> -- !query output true @@ -1535,7 +1535,7 @@ cannot resolve '(CAST(1 AS INT) IN (CAST(1 AS INT), CAST('2017-12-11 09:30:00' A -- !query SELECT cast(1 as bigint) in (cast(1 as bigint), cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS BIGINT) IN (CAST(CAST(1 AS BIGINT) AS BIGINT), CAST(CAST(1 AS TINYINT) AS BIGINT))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS BIGINT), CAST(1 AS TINYINT))):boolean> -- !query output true @@ -1543,7 +1543,7 @@ true -- !query SELECT cast(1 as bigint) in (cast(1 as bigint), cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS BIGINT) IN (CAST(CAST(1 AS BIGINT) AS BIGINT), CAST(CAST(1 AS SMALLINT) AS BIGINT))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS BIGINT), CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -1551,7 +1551,7 @@ true -- !query SELECT cast(1 as bigint) in (cast(1 as bigint), cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS BIGINT) IN (CAST(CAST(1 AS BIGINT) AS BIGINT), CAST(CAST(1 AS INT) AS BIGINT))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS BIGINT), CAST(1 AS INT))):boolean> -- !query output true @@ -1567,7 +1567,7 @@ true -- !query SELECT cast(1 as bigint) in (cast(1 as bigint), cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS FLOAT) IN (CAST(CAST(1 AS BIGINT) AS FLOAT), CAST(CAST(1 AS FLOAT) AS FLOAT))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS BIGINT), CAST(1 AS FLOAT))):boolean> -- !query output true @@ -1575,7 +1575,7 @@ true -- !query SELECT cast(1 as bigint) in (cast(1 as bigint), cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) IN (CAST(CAST(1 AS BIGINT) AS DOUBLE), CAST(CAST(1 AS DOUBLE) AS DOUBLE))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS BIGINT), CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -1583,7 +1583,7 @@ true -- !query SELECT cast(1 as bigint) in (cast(1 as bigint), cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)) IN (CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)), CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS BIGINT), CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -1591,7 +1591,7 @@ true -- !query SELECT cast(1 as bigint) in (cast(1 as bigint), cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS STRING) IN (CAST(CAST(1 AS BIGINT) AS STRING), CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS BIGINT) IN (CAST(1 AS BIGINT), CAST(1 AS STRING))):boolean> -- !query output true @@ -1635,7 +1635,7 @@ cannot resolve '(CAST(1 AS BIGINT) IN (CAST(1 AS BIGINT), CAST('2017-12-11 09:30 -- !query SELECT cast(1 as float) in (cast(1 as float), cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS FLOAT) IN (CAST(CAST(1 AS FLOAT) AS FLOAT), CAST(CAST(1 AS TINYINT) AS FLOAT))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS FLOAT), CAST(1 AS TINYINT))):boolean> -- !query output true @@ -1643,7 +1643,7 @@ true -- !query SELECT cast(1 as float) in (cast(1 as float), cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS FLOAT) IN (CAST(CAST(1 AS FLOAT) AS FLOAT), CAST(CAST(1 AS SMALLINT) AS FLOAT))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS FLOAT), CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -1651,7 +1651,7 @@ true -- !query SELECT cast(1 as float) in (cast(1 as float), cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS FLOAT) IN (CAST(CAST(1 AS FLOAT) AS FLOAT), CAST(CAST(1 AS INT) AS FLOAT))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS FLOAT), CAST(1 AS INT))):boolean> -- !query output true @@ -1659,7 +1659,7 @@ true -- !query SELECT cast(1 as float) in (cast(1 as float), cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS FLOAT) IN (CAST(CAST(1 AS FLOAT) AS FLOAT), CAST(CAST(1 AS BIGINT) AS FLOAT))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS FLOAT), CAST(1 AS BIGINT))):boolean> -- !query output true @@ -1675,7 +1675,7 @@ true -- !query SELECT cast(1 as float) in (cast(1 as float), cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) IN (CAST(CAST(1 AS FLOAT) AS DOUBLE), CAST(CAST(1 AS DOUBLE) AS DOUBLE))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS FLOAT), CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -1683,7 +1683,7 @@ true -- !query SELECT cast(1 as float) in (cast(1 as float), cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) IN (CAST(CAST(1 AS FLOAT) AS DOUBLE), CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS FLOAT), CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -1691,7 +1691,7 @@ true -- !query SELECT cast(1 as float) in (cast(1 as float), cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS STRING) IN (CAST(CAST(1 AS FLOAT) AS STRING), CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS FLOAT) IN (CAST(1 AS FLOAT), CAST(1 AS STRING))):boolean> -- !query output true @@ -1735,7 +1735,7 @@ cannot resolve '(CAST(1 AS FLOAT) IN (CAST(1 AS FLOAT), CAST('2017-12-11 09:30:0 -- !query SELECT cast(1 as double) in (cast(1 as double), cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS DOUBLE) IN (CAST(CAST(1 AS DOUBLE) AS DOUBLE), CAST(CAST(1 AS TINYINT) AS DOUBLE))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS DOUBLE), CAST(1 AS TINYINT))):boolean> -- !query output true @@ -1743,7 +1743,7 @@ true -- !query SELECT cast(1 as double) in (cast(1 as double), cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS DOUBLE) IN (CAST(CAST(1 AS DOUBLE) AS DOUBLE), CAST(CAST(1 AS SMALLINT) AS DOUBLE))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS DOUBLE), CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -1751,7 +1751,7 @@ true -- !query SELECT cast(1 as double) in (cast(1 as double), cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS DOUBLE) IN (CAST(CAST(1 AS DOUBLE) AS DOUBLE), CAST(CAST(1 AS INT) AS DOUBLE))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS DOUBLE), CAST(1 AS INT))):boolean> -- !query output true @@ -1759,7 +1759,7 @@ true -- !query SELECT cast(1 as double) in (cast(1 as double), cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS DOUBLE) IN (CAST(CAST(1 AS DOUBLE) AS DOUBLE), CAST(CAST(1 AS BIGINT) AS DOUBLE))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS DOUBLE), CAST(1 AS BIGINT))):boolean> -- !query output true @@ -1767,7 +1767,7 @@ true -- !query SELECT cast(1 as double) in (cast(1 as double), cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS DOUBLE) IN (CAST(CAST(1 AS DOUBLE) AS DOUBLE), CAST(CAST(1 AS FLOAT) AS DOUBLE))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS DOUBLE), CAST(1 AS FLOAT))):boolean> -- !query output true @@ -1783,7 +1783,7 @@ true -- !query SELECT cast(1 as double) in (cast(1 as double), cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS DOUBLE) IN (CAST(CAST(1 AS DOUBLE) AS DOUBLE), CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS DOUBLE), CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -1791,7 +1791,7 @@ true -- !query SELECT cast(1 as double) in (cast(1 as double), cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DOUBLE) AS STRING) IN (CAST(CAST(1 AS DOUBLE) AS STRING), CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS DOUBLE) IN (CAST(1 AS DOUBLE), CAST(1 AS STRING))):boolean> -- !query output true @@ -1835,7 +1835,7 @@ cannot resolve '(CAST(1 AS DOUBLE) IN (CAST(1 AS DOUBLE), CAST('2017-12-11 09:30 -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as decimal(10, 0)), cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)), CAST(CAST(1 AS TINYINT) AS DECIMAL(10,0)))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS DECIMAL(10,0)), CAST(1 AS TINYINT))):boolean> -- !query output true @@ -1843,7 +1843,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as decimal(10, 0)), cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)), CAST(CAST(1 AS SMALLINT) AS DECIMAL(10,0)))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS DECIMAL(10,0)), CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -1851,7 +1851,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as decimal(10, 0)), cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(10,0)), CAST(CAST(1 AS INT) AS DECIMAL(10,0)))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS DECIMAL(10,0)), CAST(1 AS INT))):boolean> -- !query output true @@ -1859,7 +1859,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as decimal(10, 0)), cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS DECIMAL(20,0)), CAST(CAST(1 AS BIGINT) AS DECIMAL(20,0)))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS DECIMAL(10,0)), CAST(1 AS BIGINT))):boolean> -- !query output true @@ -1867,7 +1867,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as decimal(10, 0)), cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE), CAST(CAST(1 AS FLOAT) AS DOUBLE))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS DECIMAL(10,0)), CAST(1 AS FLOAT))):boolean> -- !query output true @@ -1875,7 +1875,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as decimal(10, 0)), cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE), CAST(CAST(1 AS DOUBLE) AS DOUBLE))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS DECIMAL(10,0)), CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -1891,7 +1891,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) in (cast(1 as decimal(10, 0)), cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS STRING) IN (CAST(CAST(1 AS DECIMAL(10,0)) AS STRING), CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS DECIMAL(10,0)), CAST(1 AS STRING))):boolean> -- !query output true @@ -1935,7 +1935,7 @@ cannot resolve '(CAST(1 AS DECIMAL(10,0)) IN (CAST(1 AS DECIMAL(10,0)), CAST('20 -- !query SELECT cast(1 as string) in (cast(1 as string), cast(1 as tinyint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING), CAST(CAST(1 AS TINYINT) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS STRING), CAST(1 AS TINYINT))):boolean> -- !query output true @@ -1943,7 +1943,7 @@ true -- !query SELECT cast(1 as string) in (cast(1 as string), cast(1 as smallint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING), CAST(CAST(1 AS SMALLINT) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS STRING), CAST(1 AS SMALLINT))):boolean> -- !query output true @@ -1951,7 +1951,7 @@ true -- !query SELECT cast(1 as string) in (cast(1 as string), cast(1 as int)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING), CAST(CAST(1 AS INT) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS STRING), CAST(1 AS INT))):boolean> -- !query output true @@ -1959,7 +1959,7 @@ true -- !query SELECT cast(1 as string) in (cast(1 as string), cast(1 as bigint)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING), CAST(CAST(1 AS BIGINT) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS STRING), CAST(1 AS BIGINT))):boolean> -- !query output true @@ -1967,7 +1967,7 @@ true -- !query SELECT cast(1 as string) in (cast(1 as string), cast(1 as float)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING), CAST(CAST(1 AS FLOAT) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS STRING), CAST(1 AS FLOAT))):boolean> -- !query output true @@ -1975,7 +1975,7 @@ true -- !query SELECT cast(1 as string) in (cast(1 as string), cast(1 as double)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING), CAST(CAST(1 AS DOUBLE) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS STRING), CAST(1 AS DOUBLE))):boolean> -- !query output true @@ -1983,7 +1983,7 @@ true -- !query SELECT cast(1 as string) in (cast(1 as string), cast(1 as decimal(10, 0))) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING), CAST(CAST(1 AS DECIMAL(10,0)) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS STRING), CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output true @@ -2017,7 +2017,7 @@ cannot resolve '(CAST(1 AS STRING) IN (CAST(1 AS STRING), CAST(1 AS BOOLEAN)))' -- !query SELECT cast(1 as string) in (cast(1 as string), cast('2017-12-11 09:30:00.0' as timestamp)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING), CAST(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS STRING), CAST(2017-12-11 09:30:00.0 AS TIMESTAMP))):boolean> -- !query output true @@ -2025,7 +2025,7 @@ true -- !query SELECT cast(1 as string) in (cast(1 as string), cast('2017-12-11 09:30:00' as date)) FROM t -- !query schema -struct<(CAST(CAST(1 AS STRING) AS STRING) IN (CAST(CAST(1 AS STRING) AS STRING), CAST(CAST(2017-12-11 09:30:00 AS DATE) AS STRING))):boolean> +struct<(CAST(1 AS STRING) IN (CAST(1 AS STRING), CAST(2017-12-11 09:30:00 AS DATE))):boolean> -- !query output true @@ -2310,7 +2310,7 @@ cannot resolve '(CAST('2017-12-12 09:30:00.0' AS TIMESTAMP) IN (CAST('2017-12-12 -- !query SELECT cast('2017-12-12 09:30:00.0' as timestamp) in (cast('2017-12-12 09:30:00.0' as timestamp), cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(2017-12-12 09:30:00.0 AS TIMESTAMP) AS STRING) IN (CAST(CAST(2017-12-12 09:30:00.0 AS TIMESTAMP) AS STRING), CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(2017-12-12 09:30:00.0 AS TIMESTAMP) IN (CAST(2017-12-12 09:30:00.0 AS TIMESTAMP), CAST(1 AS STRING))):boolean> -- !query output true @@ -2344,7 +2344,7 @@ true -- !query SELECT cast('2017-12-12 09:30:00.0' as timestamp) in (cast('2017-12-12 09:30:00.0' as timestamp), cast('2017-12-11 09:30:00' as date)) FROM t -- !query schema -struct<(CAST(CAST(2017-12-12 09:30:00.0 AS TIMESTAMP) AS TIMESTAMP) IN (CAST(CAST(2017-12-12 09:30:00.0 AS TIMESTAMP) AS TIMESTAMP), CAST(CAST(2017-12-11 09:30:00 AS DATE) AS TIMESTAMP))):boolean> +struct<(CAST(2017-12-12 09:30:00.0 AS TIMESTAMP) IN (CAST(2017-12-12 09:30:00.0 AS TIMESTAMP), CAST(2017-12-11 09:30:00 AS DATE))):boolean> -- !query output true @@ -2415,7 +2415,7 @@ cannot resolve '(CAST('2017-12-12 09:30:00' AS DATE) IN (CAST('2017-12-12 09:30: -- !query SELECT cast('2017-12-12 09:30:00' as date) in (cast('2017-12-12 09:30:00' as date), cast(1 as string)) FROM t -- !query schema -struct<(CAST(CAST(2017-12-12 09:30:00 AS DATE) AS STRING) IN (CAST(CAST(2017-12-12 09:30:00 AS DATE) AS STRING), CAST(CAST(1 AS STRING) AS STRING))):boolean> +struct<(CAST(2017-12-12 09:30:00 AS DATE) IN (CAST(2017-12-12 09:30:00 AS DATE), CAST(1 AS STRING))):boolean> -- !query output true @@ -2441,7 +2441,7 @@ cannot resolve '(CAST('2017-12-12 09:30:00' AS DATE) IN (CAST('2017-12-12 09:30: -- !query SELECT cast('2017-12-12 09:30:00' as date) in (cast('2017-12-12 09:30:00' as date), cast('2017-12-11 09:30:00.0' as timestamp)) FROM t -- !query schema -struct<(CAST(CAST(2017-12-12 09:30:00 AS DATE) AS TIMESTAMP) IN (CAST(CAST(2017-12-12 09:30:00 AS DATE) AS TIMESTAMP), CAST(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) AS TIMESTAMP))):boolean> +struct<(CAST(2017-12-12 09:30:00 AS DATE) IN (CAST(2017-12-12 09:30:00 AS DATE), CAST(2017-12-11 09:30:00.0 AS TIMESTAMP))):boolean> -- !query output true diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/mapZipWith.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/mapZipWith.sql.out index ed7ab5a342c12..c1ae1bea3e905 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/mapZipWith.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/mapZipWith.sql.out @@ -85,7 +85,7 @@ FROM various_maps struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'map_zip_with(various_maps.`decimal_map1`, various_maps.`decimal_map2`, lambdafunction(named_struct(NamePlaceholder(), k, NamePlaceholder(), v1, NamePlaceholder(), v2), k, v1, v2))' due to argument data type mismatch: The input to function map_zip_with should have been two maps with compatible key types, but the key types are [decimal(36,0), decimal(36,35)].; line 1 pos 7 +cannot resolve 'map_zip_with(various_maps.decimal_map1, various_maps.decimal_map2, lambdafunction(struct(k, v1, v2), k, v1, v2))' due to argument data type mismatch: The input to function map_zip_with should have been two maps with compatible key types, but the key types are [decimal(36,0), decimal(36,35)].; line 1 pos 7 -- !query @@ -113,7 +113,7 @@ FROM various_maps struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'map_zip_with(various_maps.`decimal_map2`, various_maps.`int_map`, lambdafunction(named_struct(NamePlaceholder(), k, NamePlaceholder(), v1, NamePlaceholder(), v2), k, v1, v2))' due to argument data type mismatch: The input to function map_zip_with should have been two maps with compatible key types, but the key types are [decimal(36,35), int].; line 1 pos 7 +cannot resolve 'map_zip_with(various_maps.decimal_map2, various_maps.int_map, lambdafunction(struct(k, v1, v2), k, v1, v2))' due to argument data type mismatch: The input to function map_zip_with should have been two maps with compatible key types, but the key types are [decimal(36,35), int].; line 1 pos 7 -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/mapconcat.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/mapconcat.sql.out index fcf1afc72efe9..c8831f3b08813 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/mapconcat.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/mapconcat.sql.out @@ -94,7 +94,7 @@ FROM various_maps struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'map_concat(various_maps.`tinyint_map1`, various_maps.`array_map1`)' due to data type mismatch: input to function map_concat should all be the same type, but it's [map, map,array>]; line 2 pos 4 +cannot resolve 'map_concat(various_maps.tinyint_map1, various_maps.array_map1)' due to data type mismatch: input to function map_concat should all be the same type, but it's [map, map,array>]; line 2 pos 4 -- !query @@ -105,7 +105,7 @@ FROM various_maps struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'map_concat(various_maps.`boolean_map1`, various_maps.`int_map2`)' due to data type mismatch: input to function map_concat should all be the same type, but it's [map, map]; line 2 pos 4 +cannot resolve 'map_concat(various_maps.boolean_map1, various_maps.int_map2)' due to data type mismatch: input to function map_concat should all be the same type, but it's [map, map]; line 2 pos 4 -- !query @@ -116,7 +116,7 @@ FROM various_maps struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'map_concat(various_maps.`int_map1`, various_maps.`struct_map2`)' due to data type mismatch: input to function map_concat should all be the same type, but it's [map, map,struct>]; line 2 pos 4 +cannot resolve 'map_concat(various_maps.int_map1, various_maps.struct_map2)' due to data type mismatch: input to function map_concat should all be the same type, but it's [map, map,struct>]; line 2 pos 4 -- !query @@ -127,7 +127,7 @@ FROM various_maps struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'map_concat(various_maps.`struct_map1`, various_maps.`array_map2`)' due to data type mismatch: input to function map_concat should all be the same type, but it's [map,struct>, map,array>]; line 2 pos 4 +cannot resolve 'map_concat(various_maps.struct_map1, various_maps.array_map2)' due to data type mismatch: input to function map_concat should all be the same type, but it's [map,struct>, map,array>]; line 2 pos 4 -- !query @@ -138,4 +138,4 @@ FROM various_maps struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'map_concat(various_maps.`int_map1`, various_maps.`array_map2`)' due to data type mismatch: input to function map_concat should all be the same type, but it's [map, map,array>]; line 2 pos 4 +cannot resolve 'map_concat(various_maps.int_map1, various_maps.array_map2)' due to data type mismatch: input to function map_concat should all be the same type, but it's [map, map,array>]; line 2 pos 4 diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/promoteStrings.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/promoteStrings.sql.out index b8c190beeae19..61eeea989d170 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/promoteStrings.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/promoteStrings.sql.out @@ -13,7 +13,7 @@ struct<> -- !query SELECT '1' + cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<(1 + CAST(1 AS TINYINT)):double> -- !query output 2.0 @@ -21,7 +21,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> -- !query SELECT '1' + cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<(1 + CAST(1 AS SMALLINT)):double> -- !query output 2.0 @@ -29,7 +29,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> -- !query SELECT '1' + cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<(1 + CAST(1 AS INT)):double> -- !query output 2.0 @@ -37,7 +37,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS INT) AS DOUBLE)):double> -- !query SELECT '1' + cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<(1 + CAST(1 AS BIGINT)):double> -- !query output 2.0 @@ -45,7 +45,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> -- !query SELECT '1' + cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(1 + CAST(1 AS FLOAT)):double> -- !query output 2.0 @@ -53,7 +53,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> -- !query SELECT '1' + cast(1 as double) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(1 + CAST(1 AS DOUBLE)):double> -- !query output 2.0 @@ -61,7 +61,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(1 AS DOUBLE)):double> -- !query SELECT '1' + cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(1 + CAST(1 AS DECIMAL(10,0))):double> -- !query output 2.0 @@ -69,7 +69,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> -- !query SELECT '1' + '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(1 + 1):double> -- !query output 2.0 @@ -113,7 +113,7 @@ cannot resolve 'date_add(CAST('2017-12-11 09:30:00' AS DATE), CAST('1' AS DOUBLE -- !query SELECT '1' - cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<(1 - CAST(1 AS TINYINT)):double> -- !query output 0.0 @@ -121,7 +121,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> -- !query SELECT '1' - cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<(1 - CAST(1 AS SMALLINT)):double> -- !query output 0.0 @@ -129,7 +129,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> -- !query SELECT '1' - cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<(1 - CAST(1 AS INT)):double> -- !query output 0.0 @@ -137,7 +137,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS INT) AS DOUBLE)):double> -- !query SELECT '1' - cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<(1 - CAST(1 AS BIGINT)):double> -- !query output 0.0 @@ -145,7 +145,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> -- !query SELECT '1' - cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(1 - CAST(1 AS FLOAT)):double> -- !query output 0.0 @@ -153,7 +153,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> -- !query SELECT '1' - cast(1 as double) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(1 - CAST(1 AS DOUBLE)):double> -- !query output 0.0 @@ -161,7 +161,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(1 AS DOUBLE)):double> -- !query SELECT '1' - cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(1 - CAST(1 AS DECIMAL(10,0))):double> -- !query output 0.0 @@ -169,7 +169,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> -- !query SELECT '1' - '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(1 - 1):double> -- !query output 0.0 @@ -198,13 +198,13 @@ SELECT '1' - cast('2017-12-11 09:30:00.0' as timestamp) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtracttimestamps('1', CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: argument 1 requires timestamp type, however, ''1'' is of string type.; line 1 pos 7 +cannot resolve '('1' - CAST('2017-12-11 09:30:00.0' AS TIMESTAMP))' due to data type mismatch: argument 1 requires timestamp type, however, ''1'' is of string type.; line 1 pos 7 -- !query SELECT '1' - cast('2017-12-11 09:30:00' as date) FROM t -- !query schema -struct +struct<(1 - CAST(2017-12-11 09:30:00 AS DATE)):interval day to second> -- !query output NULL @@ -212,7 +212,7 @@ NULL -- !query SELECT '1' * cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<(1 * CAST(1 AS TINYINT)):double> -- !query output 1.0 @@ -220,7 +220,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> -- !query SELECT '1' * cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<(1 * CAST(1 AS SMALLINT)):double> -- !query output 1.0 @@ -228,7 +228,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> -- !query SELECT '1' * cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<(1 * CAST(1 AS INT)):double> -- !query output 1.0 @@ -236,7 +236,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS INT) AS DOUBLE)):double> -- !query SELECT '1' * cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<(1 * CAST(1 AS BIGINT)):double> -- !query output 1.0 @@ -244,7 +244,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> -- !query SELECT '1' * cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(1 * CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -252,7 +252,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> -- !query SELECT '1' * cast(1 as double) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(1 * CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -260,7 +260,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(1 AS DOUBLE)):double> -- !query SELECT '1' * cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(1 * CAST(1 AS DECIMAL(10,0))):double> -- !query output 1.0 @@ -268,7 +268,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> -- !query SELECT '1' * '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(1 * 1):double> -- !query output 1.0 @@ -312,7 +312,7 @@ cannot resolve '(CAST('1' AS DOUBLE) * CAST('2017-12-11 09:30:00' AS DATE))' due -- !query SELECT '1' / cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<(1 / CAST(1 AS TINYINT)):double> -- !query output 1.0 @@ -320,7 +320,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> -- !query SELECT '1' / cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<(1 / CAST(1 AS SMALLINT)):double> -- !query output 1.0 @@ -328,7 +328,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> -- !query SELECT '1' / cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<(1 / CAST(1 AS INT)):double> -- !query output 1.0 @@ -336,7 +336,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS INT) AS DOUBLE)):double> -- !query SELECT '1' / cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<(1 / CAST(1 AS BIGINT)):double> -- !query output 1.0 @@ -344,7 +344,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> -- !query SELECT '1' / cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(1 / CAST(1 AS FLOAT)):double> -- !query output 1.0 @@ -352,7 +352,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> -- !query SELECT '1' / cast(1 as double) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(1 AS DOUBLE)):double> +struct<(1 / CAST(1 AS DOUBLE)):double> -- !query output 1.0 @@ -360,7 +360,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(1 AS DOUBLE)):double> -- !query SELECT '1' / cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(1 / CAST(1 AS DECIMAL(10,0))):double> -- !query output 1.0 @@ -368,7 +368,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> -- !query SELECT '1' / '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(1 AS DOUBLE)):double> +struct<(1 / 1):double> -- !query output 1.0 @@ -412,7 +412,7 @@ cannot resolve '(CAST('1' AS DOUBLE) / CAST('2017-12-11 09:30:00' AS DATE))' due -- !query SELECT '1' % cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> +struct<(1 % CAST(1 AS TINYINT)):double> -- !query output 0.0 @@ -420,7 +420,7 @@ struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS TINYINT) AS DOUBLE)):double> -- !query SELECT '1' % cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> +struct<(1 % CAST(1 AS SMALLINT)):double> -- !query output 0.0 @@ -428,7 +428,7 @@ struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS SMALLINT) AS DOUBLE)):double> -- !query SELECT '1' % cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS INT) AS DOUBLE)):double> +struct<(1 % CAST(1 AS INT)):double> -- !query output 0.0 @@ -436,7 +436,7 @@ struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS INT) AS DOUBLE)):double> -- !query SELECT '1' % cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> +struct<(1 % CAST(1 AS BIGINT)):double> -- !query output 0.0 @@ -444,7 +444,7 @@ struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS BIGINT) AS DOUBLE)):double> -- !query SELECT '1' % cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> +struct<(1 % CAST(1 AS FLOAT)):double> -- !query output 0.0 @@ -452,7 +452,7 @@ struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS FLOAT) AS DOUBLE)):double> -- !query SELECT '1' % cast(1 as double) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(1 % CAST(1 AS DOUBLE)):double> -- !query output 0.0 @@ -460,7 +460,7 @@ struct<(CAST(1 AS DOUBLE) % CAST(1 AS DOUBLE)):double> -- !query SELECT '1' % cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> +struct<(1 % CAST(1 AS DECIMAL(10,0))):double> -- !query output 0.0 @@ -468,7 +468,7 @@ struct<(CAST(1 AS DOUBLE) % CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):double> -- !query SELECT '1' % '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(1 % 1):double> -- !query output 0.0 @@ -512,7 +512,7 @@ cannot resolve '(CAST('1' AS DOUBLE) % CAST('2017-12-11 09:30:00' AS DATE))' due -- !query SELECT pmod('1', cast(1 as tinyint)) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -520,7 +520,7 @@ struct -- !query SELECT pmod('1', cast(1 as smallint)) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -528,7 +528,7 @@ struct -- !query SELECT pmod('1', cast(1 as int)) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -536,7 +536,7 @@ struct -- !query SELECT pmod('1', cast(1 as bigint)) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -544,7 +544,7 @@ struct -- !query SELECT pmod('1', cast(1 as float)) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -552,7 +552,7 @@ struct -- !query SELECT pmod('1', cast(1 as double)) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -560,7 +560,7 @@ struct -- !query SELECT pmod('1', cast(1 as decimal(10, 0))) FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -568,7 +568,7 @@ struct -- !query SELECT pmod('1', '1') FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -612,7 +612,7 @@ cannot resolve 'pmod(CAST('1' AS DOUBLE), CAST('2017-12-11 09:30:00' AS DATE))' -- !query SELECT cast(1 as tinyint) + '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS TINYINT) + 1):double> -- !query output 2.0 @@ -620,7 +620,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) + CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as smallint) + '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS SMALLINT) + 1):double> -- !query output 2.0 @@ -628,7 +628,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) + CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as int) + '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS INT) + 1):double> -- !query output 2.0 @@ -636,7 +636,7 @@ struct<(CAST(CAST(1 AS INT) AS DOUBLE) + CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as bigint) + '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS BIGINT) + 1):double> -- !query output 2.0 @@ -644,7 +644,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) + CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as float) + '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) + 1):double> -- !query output 2.0 @@ -652,7 +652,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) + CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as double) + '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) + 1):double> -- !query output 2.0 @@ -660,7 +660,7 @@ struct<(CAST(1 AS DOUBLE) + CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) + '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) + CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) + 1):double> -- !query output 2.0 @@ -704,7 +704,7 @@ cannot resolve 'date_add(CAST('2017-12-11 09:30:00' AS DATE), CAST('1' AS DOUBLE -- !query SELECT cast(1 as tinyint) - '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS TINYINT) - 1):double> -- !query output 0.0 @@ -712,7 +712,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) - CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as smallint) - '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS SMALLINT) - 1):double> -- !query output 0.0 @@ -720,7 +720,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) - CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as int) - '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS INT) - 1):double> -- !query output 0.0 @@ -728,7 +728,7 @@ struct<(CAST(CAST(1 AS INT) AS DOUBLE) - CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as bigint) - '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS BIGINT) - 1):double> -- !query output 0.0 @@ -736,7 +736,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) - CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as float) - '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) - 1):double> -- !query output 0.0 @@ -744,7 +744,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) - CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as double) - '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) - 1):double> -- !query output 0.0 @@ -752,7 +752,7 @@ struct<(CAST(1 AS DOUBLE) - CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) - '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) - CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) - 1):double> -- !query output 0.0 @@ -781,7 +781,7 @@ SELECT cast('2017-12-11 09:30:00.0' as timestamp) - '1' FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'subtracttimestamps(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP), '1')' due to data type mismatch: argument 2 requires timestamp type, however, ''1'' is of string type.; line 1 pos 7 +cannot resolve '(CAST('2017-12-11 09:30:00.0' AS TIMESTAMP) - '1')' due to data type mismatch: argument 2 requires timestamp type, however, ''1'' is of string type.; line 1 pos 7 -- !query @@ -796,7 +796,7 @@ cannot resolve 'date_sub(CAST('2017-12-11 09:30:00' AS DATE), CAST('1' AS DOUBLE -- !query SELECT cast(1 as tinyint) * '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS TINYINT) * 1):double> -- !query output 1.0 @@ -804,7 +804,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) * CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as smallint) * '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS SMALLINT) * 1):double> -- !query output 1.0 @@ -812,7 +812,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) * CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as int) * '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS INT) * 1):double> -- !query output 1.0 @@ -820,7 +820,7 @@ struct<(CAST(CAST(1 AS INT) AS DOUBLE) * CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as bigint) * '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS BIGINT) * 1):double> -- !query output 1.0 @@ -828,7 +828,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) * CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as float) * '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) * 1):double> -- !query output 1.0 @@ -836,7 +836,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) * CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as double) * '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) * 1):double> -- !query output 1.0 @@ -844,7 +844,7 @@ struct<(CAST(1 AS DOUBLE) * CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) * '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) * CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) * 1):double> -- !query output 1.0 @@ -888,7 +888,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) * CAST('1' AS DOUBLE))' due -- !query SELECT cast(1 as tinyint) / '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS TINYINT) / 1):double> -- !query output 1.0 @@ -896,7 +896,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)): -- !query SELECT cast(1 as smallint) / '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS SMALLINT) / 1):double> -- !query output 1.0 @@ -904,7 +904,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)) -- !query SELECT cast(1 as int) / '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS INT) / 1):double> -- !query output 1.0 @@ -912,7 +912,7 @@ struct<(CAST(CAST(1 AS INT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):doub -- !query SELECT cast(1 as bigint) / '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS BIGINT) / 1):double> -- !query output 1.0 @@ -920,7 +920,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):d -- !query SELECT cast(1 as float) / '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) / 1):double> -- !query output 1.0 @@ -928,7 +928,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) / CAST(CAST(1 AS DOUBLE) AS DOUBLE)):do -- !query SELECT cast(1 as double) / '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) / CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) / 1):double> -- !query output 1.0 @@ -936,7 +936,7 @@ struct<(CAST(1 AS DOUBLE) / CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) / '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) / CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) / 1):double> -- !query output 1.0 @@ -980,7 +980,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) / CAST('1' AS DOUBLE))' due -- !query SELECT cast(1 as tinyint) % '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS TINYINT) % 1):double> -- !query output 0.0 @@ -988,7 +988,7 @@ struct<(CAST(CAST(1 AS TINYINT) AS DOUBLE) % CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as smallint) % '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS SMALLINT) % 1):double> -- !query output 0.0 @@ -996,7 +996,7 @@ struct<(CAST(CAST(1 AS SMALLINT) AS DOUBLE) % CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as int) % '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS INT) AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS INT) % 1):double> -- !query output 0.0 @@ -1004,7 +1004,7 @@ struct<(CAST(CAST(1 AS INT) AS DOUBLE) % CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as bigint) % '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS BIGINT) % 1):double> -- !query output 0.0 @@ -1012,7 +1012,7 @@ struct<(CAST(CAST(1 AS BIGINT) AS DOUBLE) % CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as float) % '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS FLOAT) % 1):double> -- !query output 0.0 @@ -1020,7 +1020,7 @@ struct<(CAST(CAST(1 AS FLOAT) AS DOUBLE) % CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as double) % '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DOUBLE) % 1):double> -- !query output 0.0 @@ -1028,7 +1028,7 @@ struct<(CAST(1 AS DOUBLE) % CAST(1 AS DOUBLE)):double> -- !query SELECT cast(1 as decimal(10, 0)) % '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) % CAST(1 AS DOUBLE)):double> +struct<(CAST(1 AS DECIMAL(10,0)) % 1):double> -- !query output 0.0 @@ -1072,7 +1072,7 @@ cannot resolve '(CAST('2017-12-11 09:30:00' AS DATE) % CAST('1' AS DOUBLE))' due -- !query SELECT pmod(cast(1 as tinyint), '1') FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -1080,7 +1080,7 @@ struct -- !query SELECT pmod(cast(1 as smallint), '1') FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -1088,7 +1088,7 @@ struct -- !query SELECT pmod(cast(1 as int), '1') FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -1096,7 +1096,7 @@ struct -- !query SELECT pmod(cast(1 as bigint), '1') FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -1104,7 +1104,7 @@ struct -- !query SELECT pmod(cast(1 as float), '1') FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -1112,7 +1112,7 @@ struct -- !query SELECT pmod(cast(1 as double), '1') FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -1120,7 +1120,7 @@ struct -- !query SELECT pmod(cast(1 as decimal(10, 0)), '1') FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -1164,7 +1164,7 @@ cannot resolve 'pmod(CAST('2017-12-11 09:30:00' AS DATE), CAST('1' AS DOUBLE))' -- !query SELECT '1' = cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS TINYINT) = CAST(1 AS TINYINT)):boolean> +struct<(1 = CAST(1 AS TINYINT)):boolean> -- !query output true @@ -1172,7 +1172,7 @@ true -- !query SELECT '1' = cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) = CAST(1 AS SMALLINT)):boolean> +struct<(1 = CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -1180,7 +1180,7 @@ true -- !query SELECT '1' = cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS INT) = CAST(1 AS INT)):boolean> +struct<(1 = CAST(1 AS INT)):boolean> -- !query output true @@ -1188,7 +1188,7 @@ true -- !query SELECT '1' = cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS BIGINT) = CAST(1 AS BIGINT)):boolean> +struct<(1 = CAST(1 AS BIGINT)):boolean> -- !query output true @@ -1196,7 +1196,7 @@ true -- !query SELECT '1' = cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS FLOAT) = CAST(1 AS FLOAT)):boolean> +struct<(1 = CAST(1 AS FLOAT)):boolean> -- !query output true @@ -1204,7 +1204,7 @@ true -- !query SELECT '1' = cast(1 as double) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(1 = CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -1212,7 +1212,7 @@ true -- !query SELECT '1' = cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) = CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(1 = CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -1228,7 +1228,7 @@ true -- !query SELECT '1' = cast('1' as binary) FROM t -- !query schema -struct<(CAST(1 AS BINARY) = CAST(1 AS BINARY)):boolean> +struct<(1 = CAST(1 AS BINARY)):boolean> -- !query output true @@ -1236,7 +1236,7 @@ true -- !query SELECT '1' = cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS BOOLEAN) = CAST(1 AS BOOLEAN)):boolean> +struct<(1 = CAST(1 AS BOOLEAN)):boolean> -- !query output true @@ -1244,7 +1244,7 @@ true -- !query SELECT '1' = cast('2017-12-11 09:30:00.0' as timestamp) FROM t -- !query schema -struct<(CAST(1 AS TIMESTAMP) = CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)):boolean> +struct<(1 = CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)):boolean> -- !query output NULL @@ -1252,7 +1252,7 @@ NULL -- !query SELECT '1' = cast('2017-12-11 09:30:00' as date) FROM t -- !query schema -struct<(CAST(1 AS DATE) = CAST(2017-12-11 09:30:00 AS DATE)):boolean> +struct<(1 = CAST(2017-12-11 09:30:00 AS DATE)):boolean> -- !query output NULL @@ -1260,7 +1260,7 @@ NULL -- !query SELECT cast(1 as tinyint) = '1' FROM t -- !query schema -struct<(CAST(1 AS TINYINT) = CAST(1 AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) = 1):boolean> -- !query output true @@ -1268,7 +1268,7 @@ true -- !query SELECT cast(1 as smallint) = '1' FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) = CAST(1 AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) = 1):boolean> -- !query output true @@ -1276,7 +1276,7 @@ true -- !query SELECT cast(1 as int) = '1' FROM t -- !query schema -struct<(CAST(1 AS INT) = CAST(1 AS INT)):boolean> +struct<(CAST(1 AS INT) = 1):boolean> -- !query output true @@ -1284,7 +1284,7 @@ true -- !query SELECT cast(1 as bigint) = '1' FROM t -- !query schema -struct<(CAST(1 AS BIGINT) = CAST(1 AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) = 1):boolean> -- !query output true @@ -1292,7 +1292,7 @@ true -- !query SELECT cast(1 as float) = '1' FROM t -- !query schema -struct<(CAST(1 AS FLOAT) = CAST(1 AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) = 1):boolean> -- !query output true @@ -1300,7 +1300,7 @@ true -- !query SELECT cast(1 as double) = '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) = 1):boolean> -- !query output true @@ -1308,7 +1308,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) = '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) = CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) = 1):boolean> -- !query output true @@ -1316,7 +1316,7 @@ true -- !query SELECT cast('1' as binary) = '1' FROM t -- !query schema -struct<(CAST(1 AS BINARY) = CAST(1 AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) = 1):boolean> -- !query output true @@ -1324,7 +1324,7 @@ true -- !query SELECT cast(1 as boolean) = '1' FROM t -- !query schema -struct<(CAST(1 AS BOOLEAN) = CAST(1 AS BOOLEAN)):boolean> +struct<(CAST(1 AS BOOLEAN) = 1):boolean> -- !query output true @@ -1332,7 +1332,7 @@ true -- !query SELECT cast('2017-12-11 09:30:00.0' as timestamp) = '1' FROM t -- !query schema -struct<(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) = CAST(1 AS TIMESTAMP)):boolean> +struct<(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) = 1):boolean> -- !query output NULL @@ -1340,7 +1340,7 @@ NULL -- !query SELECT cast('2017-12-11 09:30:00' as date) = '1' FROM t -- !query schema -struct<(CAST(2017-12-11 09:30:00 AS DATE) = CAST(1 AS DATE)):boolean> +struct<(CAST(2017-12-11 09:30:00 AS DATE) = 1):boolean> -- !query output NULL @@ -1348,7 +1348,7 @@ NULL -- !query SELECT '1' <=> cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS TINYINT) <=> CAST(1 AS TINYINT)):boolean> +struct<(1 <=> CAST(1 AS TINYINT)):boolean> -- !query output true @@ -1356,7 +1356,7 @@ true -- !query SELECT '1' <=> cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) <=> CAST(1 AS SMALLINT)):boolean> +struct<(1 <=> CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -1364,7 +1364,7 @@ true -- !query SELECT '1' <=> cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS INT) <=> CAST(1 AS INT)):boolean> +struct<(1 <=> CAST(1 AS INT)):boolean> -- !query output true @@ -1372,7 +1372,7 @@ true -- !query SELECT '1' <=> cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS BIGINT) <=> CAST(1 AS BIGINT)):boolean> +struct<(1 <=> CAST(1 AS BIGINT)):boolean> -- !query output true @@ -1380,7 +1380,7 @@ true -- !query SELECT '1' <=> cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS FLOAT) <=> CAST(1 AS FLOAT)):boolean> +struct<(1 <=> CAST(1 AS FLOAT)):boolean> -- !query output true @@ -1388,7 +1388,7 @@ true -- !query SELECT '1' <=> cast(1 as double) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <=> CAST(1 AS DOUBLE)):boolean> +struct<(1 <=> CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -1396,7 +1396,7 @@ true -- !query SELECT '1' <=> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <=> CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(1 <=> CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -1412,7 +1412,7 @@ true -- !query SELECT '1' <=> cast('1' as binary) FROM t -- !query schema -struct<(CAST(1 AS BINARY) <=> CAST(1 AS BINARY)):boolean> +struct<(1 <=> CAST(1 AS BINARY)):boolean> -- !query output true @@ -1420,7 +1420,7 @@ true -- !query SELECT '1' <=> cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS BOOLEAN) <=> CAST(1 AS BOOLEAN)):boolean> +struct<(1 <=> CAST(1 AS BOOLEAN)):boolean> -- !query output true @@ -1428,7 +1428,7 @@ true -- !query SELECT '1' <=> cast('2017-12-11 09:30:00.0' as timestamp) FROM t -- !query schema -struct<(CAST(1 AS TIMESTAMP) <=> CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)):boolean> +struct<(1 <=> CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)):boolean> -- !query output false @@ -1436,7 +1436,7 @@ false -- !query SELECT '1' <=> cast('2017-12-11 09:30:00' as date) FROM t -- !query schema -struct<(CAST(1 AS DATE) <=> CAST(2017-12-11 09:30:00 AS DATE)):boolean> +struct<(1 <=> CAST(2017-12-11 09:30:00 AS DATE)):boolean> -- !query output false @@ -1444,7 +1444,7 @@ false -- !query SELECT cast(1 as tinyint) <=> '1' FROM t -- !query schema -struct<(CAST(1 AS TINYINT) <=> CAST(1 AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) <=> 1):boolean> -- !query output true @@ -1452,7 +1452,7 @@ true -- !query SELECT cast(1 as smallint) <=> '1' FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) <=> CAST(1 AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) <=> 1):boolean> -- !query output true @@ -1460,7 +1460,7 @@ true -- !query SELECT cast(1 as int) <=> '1' FROM t -- !query schema -struct<(CAST(1 AS INT) <=> CAST(1 AS INT)):boolean> +struct<(CAST(1 AS INT) <=> 1):boolean> -- !query output true @@ -1468,7 +1468,7 @@ true -- !query SELECT cast(1 as bigint) <=> '1' FROM t -- !query schema -struct<(CAST(1 AS BIGINT) <=> CAST(1 AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) <=> 1):boolean> -- !query output true @@ -1476,7 +1476,7 @@ true -- !query SELECT cast(1 as float) <=> '1' FROM t -- !query schema -struct<(CAST(1 AS FLOAT) <=> CAST(1 AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) <=> 1):boolean> -- !query output true @@ -1484,7 +1484,7 @@ true -- !query SELECT cast(1 as double) <=> '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <=> CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <=> 1):boolean> -- !query output true @@ -1492,7 +1492,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <=> '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) <=> CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <=> 1):boolean> -- !query output true @@ -1500,7 +1500,7 @@ true -- !query SELECT cast('1' as binary) <=> '1' FROM t -- !query schema -struct<(CAST(1 AS BINARY) <=> CAST(1 AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) <=> 1):boolean> -- !query output true @@ -1508,7 +1508,7 @@ true -- !query SELECT cast(1 as boolean) <=> '1' FROM t -- !query schema -struct<(CAST(1 AS BOOLEAN) <=> CAST(1 AS BOOLEAN)):boolean> +struct<(CAST(1 AS BOOLEAN) <=> 1):boolean> -- !query output true @@ -1516,7 +1516,7 @@ true -- !query SELECT cast('2017-12-11 09:30:00.0' as timestamp) <=> '1' FROM t -- !query schema -struct<(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) <=> CAST(1 AS TIMESTAMP)):boolean> +struct<(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) <=> 1):boolean> -- !query output false @@ -1524,7 +1524,7 @@ false -- !query SELECT cast('2017-12-11 09:30:00' as date) <=> '1' FROM t -- !query schema -struct<(CAST(2017-12-11 09:30:00 AS DATE) <=> CAST(1 AS DATE)):boolean> +struct<(CAST(2017-12-11 09:30:00 AS DATE) <=> 1):boolean> -- !query output false @@ -1532,7 +1532,7 @@ false -- !query SELECT '1' < cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS TINYINT) < CAST(1 AS TINYINT)):boolean> +struct<(1 < CAST(1 AS TINYINT)):boolean> -- !query output false @@ -1540,7 +1540,7 @@ false -- !query SELECT '1' < cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) < CAST(1 AS SMALLINT)):boolean> +struct<(1 < CAST(1 AS SMALLINT)):boolean> -- !query output false @@ -1548,7 +1548,7 @@ false -- !query SELECT '1' < cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS INT) < CAST(1 AS INT)):boolean> +struct<(1 < CAST(1 AS INT)):boolean> -- !query output false @@ -1556,7 +1556,7 @@ false -- !query SELECT '1' < cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS BIGINT) < CAST(1 AS BIGINT)):boolean> +struct<(1 < CAST(1 AS BIGINT)):boolean> -- !query output false @@ -1564,7 +1564,7 @@ false -- !query SELECT '1' < cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS FLOAT) < CAST(1 AS FLOAT)):boolean> +struct<(1 < CAST(1 AS FLOAT)):boolean> -- !query output false @@ -1572,7 +1572,7 @@ false -- !query SELECT '1' < cast(1 as double) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) < CAST(1 AS DOUBLE)):boolean> +struct<(1 < CAST(1 AS DOUBLE)):boolean> -- !query output false @@ -1580,7 +1580,7 @@ false -- !query SELECT '1' < cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) < CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(1 < CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -1596,7 +1596,7 @@ false -- !query SELECT '1' < cast('1' as binary) FROM t -- !query schema -struct<(CAST(1 AS BINARY) < CAST(1 AS BINARY)):boolean> +struct<(1 < CAST(1 AS BINARY)):boolean> -- !query output false @@ -1604,7 +1604,7 @@ false -- !query SELECT '1' < cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS BOOLEAN) < CAST(1 AS BOOLEAN)):boolean> +struct<(1 < CAST(1 AS BOOLEAN)):boolean> -- !query output false @@ -1612,7 +1612,7 @@ false -- !query SELECT '1' < cast('2017-12-11 09:30:00.0' as timestamp) FROM t -- !query schema -struct<(CAST(1 AS TIMESTAMP) < CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)):boolean> +struct<(1 < CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)):boolean> -- !query output NULL @@ -1620,7 +1620,7 @@ NULL -- !query SELECT '1' < cast('2017-12-11 09:30:00' as date) FROM t -- !query schema -struct<(CAST(1 AS DATE) < CAST(2017-12-11 09:30:00 AS DATE)):boolean> +struct<(1 < CAST(2017-12-11 09:30:00 AS DATE)):boolean> -- !query output NULL @@ -1628,7 +1628,7 @@ NULL -- !query SELECT '1' <= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS TINYINT) <= CAST(1 AS TINYINT)):boolean> +struct<(1 <= CAST(1 AS TINYINT)):boolean> -- !query output true @@ -1636,7 +1636,7 @@ true -- !query SELECT '1' <= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) <= CAST(1 AS SMALLINT)):boolean> +struct<(1 <= CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -1644,7 +1644,7 @@ true -- !query SELECT '1' <= cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS INT) <= CAST(1 AS INT)):boolean> +struct<(1 <= CAST(1 AS INT)):boolean> -- !query output true @@ -1652,7 +1652,7 @@ true -- !query SELECT '1' <= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS BIGINT) <= CAST(1 AS BIGINT)):boolean> +struct<(1 <= CAST(1 AS BIGINT)):boolean> -- !query output true @@ -1660,7 +1660,7 @@ true -- !query SELECT '1' <= cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS FLOAT) <= CAST(1 AS FLOAT)):boolean> +struct<(1 <= CAST(1 AS FLOAT)):boolean> -- !query output true @@ -1668,7 +1668,7 @@ true -- !query SELECT '1' <= cast(1 as double) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <= CAST(1 AS DOUBLE)):boolean> +struct<(1 <= CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -1676,7 +1676,7 @@ true -- !query SELECT '1' <= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <= CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(1 <= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -1692,7 +1692,7 @@ true -- !query SELECT '1' <= cast('1' as binary) FROM t -- !query schema -struct<(CAST(1 AS BINARY) <= CAST(1 AS BINARY)):boolean> +struct<(1 <= CAST(1 AS BINARY)):boolean> -- !query output true @@ -1700,7 +1700,7 @@ true -- !query SELECT '1' <= cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS BOOLEAN) <= CAST(1 AS BOOLEAN)):boolean> +struct<(1 <= CAST(1 AS BOOLEAN)):boolean> -- !query output true @@ -1708,7 +1708,7 @@ true -- !query SELECT '1' <= cast('2017-12-11 09:30:00.0' as timestamp) FROM t -- !query schema -struct<(CAST(1 AS TIMESTAMP) <= CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)):boolean> +struct<(1 <= CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)):boolean> -- !query output NULL @@ -1716,7 +1716,7 @@ NULL -- !query SELECT '1' <= cast('2017-12-11 09:30:00' as date) FROM t -- !query schema -struct<(CAST(1 AS DATE) <= CAST(2017-12-11 09:30:00 AS DATE)):boolean> +struct<(1 <= CAST(2017-12-11 09:30:00 AS DATE)):boolean> -- !query output NULL @@ -1724,7 +1724,7 @@ NULL -- !query SELECT '1' > cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS TINYINT) > CAST(1 AS TINYINT)):boolean> +struct<(1 > CAST(1 AS TINYINT)):boolean> -- !query output false @@ -1732,7 +1732,7 @@ false -- !query SELECT '1' > cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) > CAST(1 AS SMALLINT)):boolean> +struct<(1 > CAST(1 AS SMALLINT)):boolean> -- !query output false @@ -1740,7 +1740,7 @@ false -- !query SELECT '1' > cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS INT) > CAST(1 AS INT)):boolean> +struct<(1 > CAST(1 AS INT)):boolean> -- !query output false @@ -1748,7 +1748,7 @@ false -- !query SELECT '1' > cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS BIGINT) > CAST(1 AS BIGINT)):boolean> +struct<(1 > CAST(1 AS BIGINT)):boolean> -- !query output false @@ -1756,7 +1756,7 @@ false -- !query SELECT '1' > cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS FLOAT) > CAST(1 AS FLOAT)):boolean> +struct<(1 > CAST(1 AS FLOAT)):boolean> -- !query output false @@ -1764,7 +1764,7 @@ false -- !query SELECT '1' > cast(1 as double) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) > CAST(1 AS DOUBLE)):boolean> +struct<(1 > CAST(1 AS DOUBLE)):boolean> -- !query output false @@ -1772,7 +1772,7 @@ false -- !query SELECT '1' > cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) > CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(1 > CAST(1 AS DECIMAL(10,0))):boolean> -- !query output false @@ -1788,7 +1788,7 @@ false -- !query SELECT '1' > cast('1' as binary) FROM t -- !query schema -struct<(CAST(1 AS BINARY) > CAST(1 AS BINARY)):boolean> +struct<(1 > CAST(1 AS BINARY)):boolean> -- !query output false @@ -1796,7 +1796,7 @@ false -- !query SELECT '1' > cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS BOOLEAN) > CAST(1 AS BOOLEAN)):boolean> +struct<(1 > CAST(1 AS BOOLEAN)):boolean> -- !query output false @@ -1804,7 +1804,7 @@ false -- !query SELECT '1' > cast('2017-12-11 09:30:00.0' as timestamp) FROM t -- !query schema -struct<(CAST(1 AS TIMESTAMP) > CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)):boolean> +struct<(1 > CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)):boolean> -- !query output NULL @@ -1812,7 +1812,7 @@ NULL -- !query SELECT '1' > cast('2017-12-11 09:30:00' as date) FROM t -- !query schema -struct<(CAST(1 AS DATE) > CAST(2017-12-11 09:30:00 AS DATE)):boolean> +struct<(1 > CAST(2017-12-11 09:30:00 AS DATE)):boolean> -- !query output NULL @@ -1820,7 +1820,7 @@ NULL -- !query SELECT '1' >= cast(1 as tinyint) FROM t -- !query schema -struct<(CAST(1 AS TINYINT) >= CAST(1 AS TINYINT)):boolean> +struct<(1 >= CAST(1 AS TINYINT)):boolean> -- !query output true @@ -1828,7 +1828,7 @@ true -- !query SELECT '1' >= cast(1 as smallint) FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) >= CAST(1 AS SMALLINT)):boolean> +struct<(1 >= CAST(1 AS SMALLINT)):boolean> -- !query output true @@ -1836,7 +1836,7 @@ true -- !query SELECT '1' >= cast(1 as int) FROM t -- !query schema -struct<(CAST(1 AS INT) >= CAST(1 AS INT)):boolean> +struct<(1 >= CAST(1 AS INT)):boolean> -- !query output true @@ -1844,7 +1844,7 @@ true -- !query SELECT '1' >= cast(1 as bigint) FROM t -- !query schema -struct<(CAST(1 AS BIGINT) >= CAST(1 AS BIGINT)):boolean> +struct<(1 >= CAST(1 AS BIGINT)):boolean> -- !query output true @@ -1852,7 +1852,7 @@ true -- !query SELECT '1' >= cast(1 as float) FROM t -- !query schema -struct<(CAST(1 AS FLOAT) >= CAST(1 AS FLOAT)):boolean> +struct<(1 >= CAST(1 AS FLOAT)):boolean> -- !query output true @@ -1860,7 +1860,7 @@ true -- !query SELECT '1' >= cast(1 as double) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) >= CAST(1 AS DOUBLE)):boolean> +struct<(1 >= CAST(1 AS DOUBLE)):boolean> -- !query output true @@ -1868,7 +1868,7 @@ true -- !query SELECT '1' >= cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) >= CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE)):boolean> +struct<(1 >= CAST(1 AS DECIMAL(10,0))):boolean> -- !query output true @@ -1884,7 +1884,7 @@ true -- !query SELECT '1' >= cast('1' as binary) FROM t -- !query schema -struct<(CAST(1 AS BINARY) >= CAST(1 AS BINARY)):boolean> +struct<(1 >= CAST(1 AS BINARY)):boolean> -- !query output true @@ -1892,7 +1892,7 @@ true -- !query SELECT '1' >= cast(1 as boolean) FROM t -- !query schema -struct<(CAST(1 AS BOOLEAN) >= CAST(1 AS BOOLEAN)):boolean> +struct<(1 >= CAST(1 AS BOOLEAN)):boolean> -- !query output true @@ -1900,7 +1900,7 @@ true -- !query SELECT '1' >= cast('2017-12-11 09:30:00.0' as timestamp) FROM t -- !query schema -struct<(CAST(1 AS TIMESTAMP) >= CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)):boolean> +struct<(1 >= CAST(2017-12-11 09:30:00.0 AS TIMESTAMP)):boolean> -- !query output NULL @@ -1908,7 +1908,7 @@ NULL -- !query SELECT '1' >= cast('2017-12-11 09:30:00' as date) FROM t -- !query schema -struct<(CAST(1 AS DATE) >= CAST(2017-12-11 09:30:00 AS DATE)):boolean> +struct<(1 >= CAST(2017-12-11 09:30:00 AS DATE)):boolean> -- !query output NULL @@ -1916,7 +1916,7 @@ NULL -- !query SELECT '1' <> cast(1 as tinyint) FROM t -- !query schema -struct<(NOT (CAST(1 AS TINYINT) = CAST(1 AS TINYINT))):boolean> +struct<(NOT (1 = CAST(1 AS TINYINT))):boolean> -- !query output false @@ -1924,7 +1924,7 @@ false -- !query SELECT '1' <> cast(1 as smallint) FROM t -- !query schema -struct<(NOT (CAST(1 AS SMALLINT) = CAST(1 AS SMALLINT))):boolean> +struct<(NOT (1 = CAST(1 AS SMALLINT))):boolean> -- !query output false @@ -1932,7 +1932,7 @@ false -- !query SELECT '1' <> cast(1 as int) FROM t -- !query schema -struct<(NOT (CAST(1 AS INT) = CAST(1 AS INT))):boolean> +struct<(NOT (1 = CAST(1 AS INT))):boolean> -- !query output false @@ -1940,7 +1940,7 @@ false -- !query SELECT '1' <> cast(1 as bigint) FROM t -- !query schema -struct<(NOT (CAST(1 AS BIGINT) = CAST(1 AS BIGINT))):boolean> +struct<(NOT (1 = CAST(1 AS BIGINT))):boolean> -- !query output false @@ -1948,7 +1948,7 @@ false -- !query SELECT '1' <> cast(1 as float) FROM t -- !query schema -struct<(NOT (CAST(1 AS FLOAT) = CAST(1 AS FLOAT))):boolean> +struct<(NOT (1 = CAST(1 AS FLOAT))):boolean> -- !query output false @@ -1956,7 +1956,7 @@ false -- !query SELECT '1' <> cast(1 as double) FROM t -- !query schema -struct<(NOT (CAST(1 AS DOUBLE) = CAST(1 AS DOUBLE))):boolean> +struct<(NOT (1 = CAST(1 AS DOUBLE))):boolean> -- !query output false @@ -1964,7 +1964,7 @@ false -- !query SELECT '1' <> cast(1 as decimal(10, 0)) FROM t -- !query schema -struct<(NOT (CAST(1 AS DOUBLE) = CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE))):boolean> +struct<(NOT (1 = CAST(1 AS DECIMAL(10,0)))):boolean> -- !query output false @@ -1980,7 +1980,7 @@ false -- !query SELECT '1' <> cast('1' as binary) FROM t -- !query schema -struct<(NOT (CAST(1 AS BINARY) = CAST(1 AS BINARY))):boolean> +struct<(NOT (1 = CAST(1 AS BINARY))):boolean> -- !query output false @@ -1988,7 +1988,7 @@ false -- !query SELECT '1' <> cast(1 as boolean) FROM t -- !query schema -struct<(NOT (CAST(1 AS BOOLEAN) = CAST(1 AS BOOLEAN))):boolean> +struct<(NOT (1 = CAST(1 AS BOOLEAN))):boolean> -- !query output false @@ -1996,7 +1996,7 @@ false -- !query SELECT '1' <> cast('2017-12-11 09:30:00.0' as timestamp) FROM t -- !query schema -struct<(NOT (CAST(1 AS TIMESTAMP) = CAST(2017-12-11 09:30:00.0 AS TIMESTAMP))):boolean> +struct<(NOT (1 = CAST(2017-12-11 09:30:00.0 AS TIMESTAMP))):boolean> -- !query output NULL @@ -2004,7 +2004,7 @@ NULL -- !query SELECT '1' <> cast('2017-12-11 09:30:00' as date) FROM t -- !query schema -struct<(NOT (CAST(1 AS DATE) = CAST(2017-12-11 09:30:00 AS DATE))):boolean> +struct<(NOT (1 = CAST(2017-12-11 09:30:00 AS DATE))):boolean> -- !query output NULL @@ -2012,7 +2012,7 @@ NULL -- !query SELECT cast(1 as tinyint) < '1' FROM t -- !query schema -struct<(CAST(1 AS TINYINT) < CAST(1 AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) < 1):boolean> -- !query output false @@ -2020,7 +2020,7 @@ false -- !query SELECT cast(1 as smallint) < '1' FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) < CAST(1 AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) < 1):boolean> -- !query output false @@ -2028,7 +2028,7 @@ false -- !query SELECT cast(1 as int) < '1' FROM t -- !query schema -struct<(CAST(1 AS INT) < CAST(1 AS INT)):boolean> +struct<(CAST(1 AS INT) < 1):boolean> -- !query output false @@ -2036,7 +2036,7 @@ false -- !query SELECT cast(1 as bigint) < '1' FROM t -- !query schema -struct<(CAST(1 AS BIGINT) < CAST(1 AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) < 1):boolean> -- !query output false @@ -2044,7 +2044,7 @@ false -- !query SELECT cast(1 as float) < '1' FROM t -- !query schema -struct<(CAST(1 AS FLOAT) < CAST(1 AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) < 1):boolean> -- !query output false @@ -2052,7 +2052,7 @@ false -- !query SELECT cast(1 as double) < '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) < CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) < 1):boolean> -- !query output false @@ -2060,7 +2060,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) < '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) < CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) < 1):boolean> -- !query output false @@ -2076,7 +2076,7 @@ false -- !query SELECT cast('1' as binary) < '1' FROM t -- !query schema -struct<(CAST(1 AS BINARY) < CAST(1 AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) < 1):boolean> -- !query output false @@ -2084,7 +2084,7 @@ false -- !query SELECT cast(1 as boolean) < '1' FROM t -- !query schema -struct<(CAST(1 AS BOOLEAN) < CAST(1 AS BOOLEAN)):boolean> +struct<(CAST(1 AS BOOLEAN) < 1):boolean> -- !query output false @@ -2092,7 +2092,7 @@ false -- !query SELECT cast('2017-12-11 09:30:00.0' as timestamp) < '1' FROM t -- !query schema -struct<(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) < CAST(1 AS TIMESTAMP)):boolean> +struct<(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) < 1):boolean> -- !query output NULL @@ -2100,7 +2100,7 @@ NULL -- !query SELECT cast('2017-12-11 09:30:00' as date) < '1' FROM t -- !query schema -struct<(CAST(2017-12-11 09:30:00 AS DATE) < CAST(1 AS DATE)):boolean> +struct<(CAST(2017-12-11 09:30:00 AS DATE) < 1):boolean> -- !query output NULL @@ -2108,7 +2108,7 @@ NULL -- !query SELECT cast(1 as tinyint) <= '1' FROM t -- !query schema -struct<(CAST(1 AS TINYINT) <= CAST(1 AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) <= 1):boolean> -- !query output true @@ -2116,7 +2116,7 @@ true -- !query SELECT cast(1 as smallint) <= '1' FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) <= CAST(1 AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) <= 1):boolean> -- !query output true @@ -2124,7 +2124,7 @@ true -- !query SELECT cast(1 as int) <= '1' FROM t -- !query schema -struct<(CAST(1 AS INT) <= CAST(1 AS INT)):boolean> +struct<(CAST(1 AS INT) <= 1):boolean> -- !query output true @@ -2132,7 +2132,7 @@ true -- !query SELECT cast(1 as bigint) <= '1' FROM t -- !query schema -struct<(CAST(1 AS BIGINT) <= CAST(1 AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) <= 1):boolean> -- !query output true @@ -2140,7 +2140,7 @@ true -- !query SELECT cast(1 as float) <= '1' FROM t -- !query schema -struct<(CAST(1 AS FLOAT) <= CAST(1 AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) <= 1):boolean> -- !query output true @@ -2148,7 +2148,7 @@ true -- !query SELECT cast(1 as double) <= '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) <= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) <= 1):boolean> -- !query output true @@ -2156,7 +2156,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) <= '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) <= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) <= 1):boolean> -- !query output true @@ -2172,7 +2172,7 @@ true -- !query SELECT cast('1' as binary) <= '1' FROM t -- !query schema -struct<(CAST(1 AS BINARY) <= CAST(1 AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) <= 1):boolean> -- !query output true @@ -2180,7 +2180,7 @@ true -- !query SELECT cast(1 as boolean) <= '1' FROM t -- !query schema -struct<(CAST(1 AS BOOLEAN) <= CAST(1 AS BOOLEAN)):boolean> +struct<(CAST(1 AS BOOLEAN) <= 1):boolean> -- !query output true @@ -2188,7 +2188,7 @@ true -- !query SELECT cast('2017-12-11 09:30:00.0' as timestamp) <= '1' FROM t -- !query schema -struct<(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) <= CAST(1 AS TIMESTAMP)):boolean> +struct<(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) <= 1):boolean> -- !query output NULL @@ -2196,7 +2196,7 @@ NULL -- !query SELECT cast('2017-12-11 09:30:00' as date) <= '1' FROM t -- !query schema -struct<(CAST(2017-12-11 09:30:00 AS DATE) <= CAST(1 AS DATE)):boolean> +struct<(CAST(2017-12-11 09:30:00 AS DATE) <= 1):boolean> -- !query output NULL @@ -2204,7 +2204,7 @@ NULL -- !query SELECT cast(1 as tinyint) > '1' FROM t -- !query schema -struct<(CAST(1 AS TINYINT) > CAST(1 AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) > 1):boolean> -- !query output false @@ -2212,7 +2212,7 @@ false -- !query SELECT cast(1 as smallint) > '1' FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) > CAST(1 AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) > 1):boolean> -- !query output false @@ -2220,7 +2220,7 @@ false -- !query SELECT cast(1 as int) > '1' FROM t -- !query schema -struct<(CAST(1 AS INT) > CAST(1 AS INT)):boolean> +struct<(CAST(1 AS INT) > 1):boolean> -- !query output false @@ -2228,7 +2228,7 @@ false -- !query SELECT cast(1 as bigint) > '1' FROM t -- !query schema -struct<(CAST(1 AS BIGINT) > CAST(1 AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) > 1):boolean> -- !query output false @@ -2236,7 +2236,7 @@ false -- !query SELECT cast(1 as float) > '1' FROM t -- !query schema -struct<(CAST(1 AS FLOAT) > CAST(1 AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) > 1):boolean> -- !query output false @@ -2244,7 +2244,7 @@ false -- !query SELECT cast(1 as double) > '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) > CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) > 1):boolean> -- !query output false @@ -2252,7 +2252,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) > '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) > CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) > 1):boolean> -- !query output false @@ -2268,7 +2268,7 @@ false -- !query SELECT cast('1' as binary) > '1' FROM t -- !query schema -struct<(CAST(1 AS BINARY) > CAST(1 AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) > 1):boolean> -- !query output false @@ -2276,7 +2276,7 @@ false -- !query SELECT cast(1 as boolean) > '1' FROM t -- !query schema -struct<(CAST(1 AS BOOLEAN) > CAST(1 AS BOOLEAN)):boolean> +struct<(CAST(1 AS BOOLEAN) > 1):boolean> -- !query output false @@ -2284,7 +2284,7 @@ false -- !query SELECT cast('2017-12-11 09:30:00.0' as timestamp) > '1' FROM t -- !query schema -struct<(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) > CAST(1 AS TIMESTAMP)):boolean> +struct<(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) > 1):boolean> -- !query output NULL @@ -2292,7 +2292,7 @@ NULL -- !query SELECT cast('2017-12-11 09:30:00' as date) > '1' FROM t -- !query schema -struct<(CAST(2017-12-11 09:30:00 AS DATE) > CAST(1 AS DATE)):boolean> +struct<(CAST(2017-12-11 09:30:00 AS DATE) > 1):boolean> -- !query output NULL @@ -2300,7 +2300,7 @@ NULL -- !query SELECT cast(1 as tinyint) >= '1' FROM t -- !query schema -struct<(CAST(1 AS TINYINT) >= CAST(1 AS TINYINT)):boolean> +struct<(CAST(1 AS TINYINT) >= 1):boolean> -- !query output true @@ -2308,7 +2308,7 @@ true -- !query SELECT cast(1 as smallint) >= '1' FROM t -- !query schema -struct<(CAST(1 AS SMALLINT) >= CAST(1 AS SMALLINT)):boolean> +struct<(CAST(1 AS SMALLINT) >= 1):boolean> -- !query output true @@ -2316,7 +2316,7 @@ true -- !query SELECT cast(1 as int) >= '1' FROM t -- !query schema -struct<(CAST(1 AS INT) >= CAST(1 AS INT)):boolean> +struct<(CAST(1 AS INT) >= 1):boolean> -- !query output true @@ -2324,7 +2324,7 @@ true -- !query SELECT cast(1 as bigint) >= '1' FROM t -- !query schema -struct<(CAST(1 AS BIGINT) >= CAST(1 AS BIGINT)):boolean> +struct<(CAST(1 AS BIGINT) >= 1):boolean> -- !query output true @@ -2332,7 +2332,7 @@ true -- !query SELECT cast(1 as float) >= '1' FROM t -- !query schema -struct<(CAST(1 AS FLOAT) >= CAST(1 AS FLOAT)):boolean> +struct<(CAST(1 AS FLOAT) >= 1):boolean> -- !query output true @@ -2340,7 +2340,7 @@ true -- !query SELECT cast(1 as double) >= '1' FROM t -- !query schema -struct<(CAST(1 AS DOUBLE) >= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DOUBLE) >= 1):boolean> -- !query output true @@ -2348,7 +2348,7 @@ true -- !query SELECT cast(1 as decimal(10, 0)) >= '1' FROM t -- !query schema -struct<(CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) >= CAST(1 AS DOUBLE)):boolean> +struct<(CAST(1 AS DECIMAL(10,0)) >= 1):boolean> -- !query output true @@ -2364,7 +2364,7 @@ true -- !query SELECT cast('1' as binary) >= '1' FROM t -- !query schema -struct<(CAST(1 AS BINARY) >= CAST(1 AS BINARY)):boolean> +struct<(CAST(1 AS BINARY) >= 1):boolean> -- !query output true @@ -2372,7 +2372,7 @@ true -- !query SELECT cast(1 as boolean) >= '1' FROM t -- !query schema -struct<(CAST(1 AS BOOLEAN) >= CAST(1 AS BOOLEAN)):boolean> +struct<(CAST(1 AS BOOLEAN) >= 1):boolean> -- !query output true @@ -2380,7 +2380,7 @@ true -- !query SELECT cast('2017-12-11 09:30:00.0' as timestamp) >= '1' FROM t -- !query schema -struct<(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) >= CAST(1 AS TIMESTAMP)):boolean> +struct<(CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) >= 1):boolean> -- !query output NULL @@ -2388,7 +2388,7 @@ NULL -- !query SELECT cast('2017-12-11 09:30:00' as date) >= '1' FROM t -- !query schema -struct<(CAST(2017-12-11 09:30:00 AS DATE) >= CAST(1 AS DATE)):boolean> +struct<(CAST(2017-12-11 09:30:00 AS DATE) >= 1):boolean> -- !query output NULL @@ -2396,7 +2396,7 @@ NULL -- !query SELECT cast(1 as tinyint) <> '1' FROM t -- !query schema -struct<(NOT (CAST(1 AS TINYINT) = CAST(1 AS TINYINT))):boolean> +struct<(NOT (CAST(1 AS TINYINT) = 1)):boolean> -- !query output false @@ -2404,7 +2404,7 @@ false -- !query SELECT cast(1 as smallint) <> '1' FROM t -- !query schema -struct<(NOT (CAST(1 AS SMALLINT) = CAST(1 AS SMALLINT))):boolean> +struct<(NOT (CAST(1 AS SMALLINT) = 1)):boolean> -- !query output false @@ -2412,7 +2412,7 @@ false -- !query SELECT cast(1 as int) <> '1' FROM t -- !query schema -struct<(NOT (CAST(1 AS INT) = CAST(1 AS INT))):boolean> +struct<(NOT (CAST(1 AS INT) = 1)):boolean> -- !query output false @@ -2420,7 +2420,7 @@ false -- !query SELECT cast(1 as bigint) <> '1' FROM t -- !query schema -struct<(NOT (CAST(1 AS BIGINT) = CAST(1 AS BIGINT))):boolean> +struct<(NOT (CAST(1 AS BIGINT) = 1)):boolean> -- !query output false @@ -2428,7 +2428,7 @@ false -- !query SELECT cast(1 as float) <> '1' FROM t -- !query schema -struct<(NOT (CAST(1 AS FLOAT) = CAST(1 AS FLOAT))):boolean> +struct<(NOT (CAST(1 AS FLOAT) = 1)):boolean> -- !query output false @@ -2436,7 +2436,7 @@ false -- !query SELECT cast(1 as double) <> '1' FROM t -- !query schema -struct<(NOT (CAST(1 AS DOUBLE) = CAST(1 AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DOUBLE) = 1)):boolean> -- !query output false @@ -2444,7 +2444,7 @@ false -- !query SELECT cast(1 as decimal(10, 0)) <> '1' FROM t -- !query schema -struct<(NOT (CAST(CAST(1 AS DECIMAL(10,0)) AS DOUBLE) = CAST(1 AS DOUBLE))):boolean> +struct<(NOT (CAST(1 AS DECIMAL(10,0)) = 1)):boolean> -- !query output false @@ -2460,7 +2460,7 @@ false -- !query SELECT cast('1' as binary) <> '1' FROM t -- !query schema -struct<(NOT (CAST(1 AS BINARY) = CAST(1 AS BINARY))):boolean> +struct<(NOT (CAST(1 AS BINARY) = 1)):boolean> -- !query output false @@ -2468,7 +2468,7 @@ false -- !query SELECT cast(1 as boolean) <> '1' FROM t -- !query schema -struct<(NOT (CAST(1 AS BOOLEAN) = CAST(1 AS BOOLEAN))):boolean> +struct<(NOT (CAST(1 AS BOOLEAN) = 1)):boolean> -- !query output false @@ -2476,7 +2476,7 @@ false -- !query SELECT cast('2017-12-11 09:30:00.0' as timestamp) <> '1' FROM t -- !query schema -struct<(NOT (CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) = CAST(1 AS TIMESTAMP))):boolean> +struct<(NOT (CAST(2017-12-11 09:30:00.0 AS TIMESTAMP) = 1)):boolean> -- !query output NULL @@ -2484,7 +2484,7 @@ NULL -- !query SELECT cast('2017-12-11 09:30:00' as date) <> '1' FROM t -- !query schema -struct<(NOT (CAST(2017-12-11 09:30:00 AS DATE) = CAST(1 AS DATE))):boolean> +struct<(NOT (CAST(2017-12-11 09:30:00 AS DATE) = 1)):boolean> -- !query output NULL @@ -2492,7 +2492,7 @@ NULL -- !query SELECT abs('1') FROM t -- !query schema -struct +struct -- !query output 1.0 @@ -2500,7 +2500,7 @@ struct -- !query SELECT sum('1') FROM t -- !query schema -struct +struct -- !query output 1.0 @@ -2508,7 +2508,7 @@ struct -- !query SELECT avg('1') FROM t -- !query schema -struct +struct -- !query output 1.0 @@ -2516,7 +2516,7 @@ struct -- !query SELECT stddev_pop('1') FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -2524,15 +2524,15 @@ struct -- !query SELECT stddev_samp('1') FROM t -- !query schema -struct +struct -- !query output -NaN +NULL -- !query SELECT - '1' FROM t -- !query schema -struct<(- CAST(1 AS DOUBLE)):double> +struct<(- 1):double> -- !query output -1.0 @@ -2540,7 +2540,7 @@ struct<(- CAST(1 AS DOUBLE)):double> -- !query SELECT + '1' FROM t -- !query schema -struct<(+ CAST(1 AS DOUBLE)):double> +struct<(+ 1):double> -- !query output 1.0 @@ -2548,7 +2548,7 @@ struct<(+ CAST(1 AS DOUBLE)):double> -- !query SELECT var_pop('1') FROM t -- !query schema -struct +struct -- !query output 0.0 @@ -2556,22 +2556,22 @@ struct -- !query SELECT var_samp('1') FROM t -- !query schema -struct +struct -- !query output -NaN +NULL -- !query SELECT skewness('1') FROM t -- !query schema -struct +struct -- !query output -NaN +NULL -- !query SELECT kurtosis('1') FROM t -- !query schema -struct +struct -- !query output -NaN +NULL diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/stringCastAndExpressions.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/stringCastAndExpressions.sql.out index 8353c7e73d0bb..14e941c074041 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/stringCastAndExpressions.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/stringCastAndExpressions.sql.out @@ -104,7 +104,7 @@ select cast(a as array) from t struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 't.`a`' due to data type mismatch: cannot cast string to array; line 1 pos 7 +cannot resolve 't.a' due to data type mismatch: cannot cast string to array; line 1 pos 7 -- !query @@ -113,7 +113,7 @@ select cast(a as struct) from t struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 't.`a`' due to data type mismatch: cannot cast string to struct; line 1 pos 7 +cannot resolve 't.a' due to data type mismatch: cannot cast string to struct; line 1 pos 7 -- !query @@ -122,7 +122,7 @@ select cast(a as map) from t struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 't.`a`' due to data type mismatch: cannot cast string to map; line 1 pos 7 +cannot resolve 't.a' due to data type mismatch: cannot cast string to map; line 1 pos 7 -- !query @@ -136,9 +136,10 @@ NULL -- !query select to_timestamp('2018-01-01', a) from t -- !query schema -struct +struct<> -- !query output -NULL +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'aa' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html -- !query @@ -152,9 +153,10 @@ NULL -- !query select to_unix_timestamp('2018-01-01', a) from t -- !query schema -struct +struct<> -- !query output -NULL +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'aa' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html -- !query @@ -168,15 +170,16 @@ NULL -- !query select unix_timestamp('2018-01-01', a) from t -- !query schema -struct +struct<> -- !query output -NULL +org.apache.spark.SparkUpgradeException +You may get a different result due to the upgrading of Spark 3.0: Fail to recognize 'aa' pattern in the DateTimeFormatter. 1) You can set spark.sql.legacy.timeParserPolicy to LEGACY to restore the behavior before Spark 3.0. 2) You can form a valid datetime pattern with the guide from https://spark.apache.org/docs/latest/sql-ref-datetime-pattern.html -- !query select from_unixtime(a) from t -- !query schema -struct +struct -- !query output NULL @@ -184,7 +187,7 @@ NULL -- !query select from_unixtime('2018-01-01', a) from t -- !query schema -struct +struct -- !query output NULL @@ -192,7 +195,7 @@ NULL -- !query select next_day(a, 'MO') from t -- !query schema -struct +struct -- !query output NULL @@ -200,7 +203,7 @@ NULL -- !query select next_day('2018-01-01', a) from t -- !query schema -struct +struct -- !query output NULL @@ -208,7 +211,7 @@ NULL -- !query select trunc(a, 'MM') from t -- !query schema -struct +struct -- !query output NULL @@ -216,7 +219,7 @@ NULL -- !query select trunc('2018-01-01', a) from t -- !query schema -struct +struct -- !query output NULL @@ -232,7 +235,7 @@ NULL -- !query select sha2(a, a) from t -- !query schema -struct +struct -- !query output NULL diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/widenSetOperationTypes.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/widenSetOperationTypes.sql.out index 89b1cdb3e353d..a527b20dc04ff 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/widenSetOperationTypes.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/widenSetOperationTypes.sql.out @@ -88,7 +88,7 @@ SELECT cast(1 as tinyint) FROM t UNION SELECT cast('2' as binary) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. binary <> tinyint at the first column of the second table; +Union can only be performed on tables with the compatible column types. binary <> tinyint at the first column of the second table -- !query @@ -97,7 +97,7 @@ SELECT cast(1 as tinyint) FROM t UNION SELECT cast(2 as boolean) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. boolean <> tinyint at the first column of the second table; +Union can only be performed on tables with the compatible column types. boolean <> tinyint at the first column of the second table -- !query @@ -106,7 +106,7 @@ SELECT cast(1 as tinyint) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as ti struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. timestamp <> tinyint at the first column of the second table; +Union can only be performed on tables with the compatible column types. timestamp <> tinyint at the first column of the second table -- !query @@ -115,7 +115,7 @@ SELECT cast(1 as tinyint) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. date <> tinyint at the first column of the second table; +Union can only be performed on tables with the compatible column types. date <> tinyint at the first column of the second table -- !query @@ -196,7 +196,7 @@ SELECT cast(1 as smallint) FROM t UNION SELECT cast('2' as binary) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. binary <> smallint at the first column of the second table; +Union can only be performed on tables with the compatible column types. binary <> smallint at the first column of the second table -- !query @@ -205,7 +205,7 @@ SELECT cast(1 as smallint) FROM t UNION SELECT cast(2 as boolean) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. boolean <> smallint at the first column of the second table; +Union can only be performed on tables with the compatible column types. boolean <> smallint at the first column of the second table -- !query @@ -214,7 +214,7 @@ SELECT cast(1 as smallint) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. timestamp <> smallint at the first column of the second table; +Union can only be performed on tables with the compatible column types. timestamp <> smallint at the first column of the second table -- !query @@ -223,7 +223,7 @@ SELECT cast(1 as smallint) FROM t UNION SELECT cast('2017-12-11 09:30:00' as dat struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. date <> smallint at the first column of the second table; +Union can only be performed on tables with the compatible column types. date <> smallint at the first column of the second table -- !query @@ -304,7 +304,7 @@ SELECT cast(1 as int) FROM t UNION SELECT cast('2' as binary) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. binary <> int at the first column of the second table; +Union can only be performed on tables with the compatible column types. binary <> int at the first column of the second table -- !query @@ -313,7 +313,7 @@ SELECT cast(1 as int) FROM t UNION SELECT cast(2 as boolean) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. boolean <> int at the first column of the second table; +Union can only be performed on tables with the compatible column types. boolean <> int at the first column of the second table -- !query @@ -322,7 +322,7 @@ SELECT cast(1 as int) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as timest struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. timestamp <> int at the first column of the second table; +Union can only be performed on tables with the compatible column types. timestamp <> int at the first column of the second table -- !query @@ -331,7 +331,7 @@ SELECT cast(1 as int) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) FR struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. date <> int at the first column of the second table; +Union can only be performed on tables with the compatible column types. date <> int at the first column of the second table -- !query @@ -412,7 +412,7 @@ SELECT cast(1 as bigint) FROM t UNION SELECT cast('2' as binary) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. binary <> bigint at the first column of the second table; +Union can only be performed on tables with the compatible column types. binary <> bigint at the first column of the second table -- !query @@ -421,7 +421,7 @@ SELECT cast(1 as bigint) FROM t UNION SELECT cast(2 as boolean) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. boolean <> bigint at the first column of the second table; +Union can only be performed on tables with the compatible column types. boolean <> bigint at the first column of the second table -- !query @@ -430,7 +430,7 @@ SELECT cast(1 as bigint) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as tim struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. timestamp <> bigint at the first column of the second table; +Union can only be performed on tables with the compatible column types. timestamp <> bigint at the first column of the second table -- !query @@ -439,7 +439,7 @@ SELECT cast(1 as bigint) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. date <> bigint at the first column of the second table; +Union can only be performed on tables with the compatible column types. date <> bigint at the first column of the second table -- !query @@ -520,7 +520,7 @@ SELECT cast(1 as float) FROM t UNION SELECT cast('2' as binary) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. binary <> float at the first column of the second table; +Union can only be performed on tables with the compatible column types. binary <> float at the first column of the second table -- !query @@ -529,7 +529,7 @@ SELECT cast(1 as float) FROM t UNION SELECT cast(2 as boolean) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. boolean <> float at the first column of the second table; +Union can only be performed on tables with the compatible column types. boolean <> float at the first column of the second table -- !query @@ -538,7 +538,7 @@ SELECT cast(1 as float) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as time struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. timestamp <> float at the first column of the second table; +Union can only be performed on tables with the compatible column types. timestamp <> float at the first column of the second table -- !query @@ -547,7 +547,7 @@ SELECT cast(1 as float) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. date <> float at the first column of the second table; +Union can only be performed on tables with the compatible column types. date <> float at the first column of the second table -- !query @@ -628,7 +628,7 @@ SELECT cast(1 as double) FROM t UNION SELECT cast('2' as binary) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. binary <> double at the first column of the second table; +Union can only be performed on tables with the compatible column types. binary <> double at the first column of the second table -- !query @@ -637,7 +637,7 @@ SELECT cast(1 as double) FROM t UNION SELECT cast(2 as boolean) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. boolean <> double at the first column of the second table; +Union can only be performed on tables with the compatible column types. boolean <> double at the first column of the second table -- !query @@ -646,7 +646,7 @@ SELECT cast(1 as double) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as tim struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. timestamp <> double at the first column of the second table; +Union can only be performed on tables with the compatible column types. timestamp <> double at the first column of the second table -- !query @@ -655,7 +655,7 @@ SELECT cast(1 as double) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date) struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. date <> double at the first column of the second table; +Union can only be performed on tables with the compatible column types. date <> double at the first column of the second table -- !query @@ -736,7 +736,7 @@ SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast('2' as binary) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. binary <> decimal(10,0) at the first column of the second table; +Union can only be performed on tables with the compatible column types. binary <> decimal(10,0) at the first column of the second table -- !query @@ -745,7 +745,7 @@ SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast(2 as boolean) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. boolean <> decimal(10,0) at the first column of the second table; +Union can only be performed on tables with the compatible column types. boolean <> decimal(10,0) at the first column of the second table -- !query @@ -754,7 +754,7 @@ SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast('2017-12-11 09:30:00.0 struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. timestamp <> decimal(10,0) at the first column of the second table; +Union can only be performed on tables with the compatible column types. timestamp <> decimal(10,0) at the first column of the second table -- !query @@ -763,7 +763,7 @@ SELECT cast(1 as decimal(10, 0)) FROM t UNION SELECT cast('2017-12-11 09:30:00' struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. date <> decimal(10,0) at the first column of the second table; +Union can only be performed on tables with the compatible column types. date <> decimal(10,0) at the first column of the second table -- !query @@ -844,7 +844,7 @@ SELECT cast(1 as string) FROM t UNION SELECT cast('2' as binary) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. binary <> string at the first column of the second table; +Union can only be performed on tables with the compatible column types. binary <> string at the first column of the second table -- !query @@ -853,7 +853,7 @@ SELECT cast(1 as string) FROM t UNION SELECT cast(2 as boolean) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. boolean <> string at the first column of the second table; +Union can only be performed on tables with the compatible column types. boolean <> string at the first column of the second table -- !query @@ -880,7 +880,7 @@ SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as tinyint) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. tinyint <> binary at the first column of the second table; +Union can only be performed on tables with the compatible column types. tinyint <> binary at the first column of the second table -- !query @@ -889,7 +889,7 @@ SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as smallint) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. smallint <> binary at the first column of the second table; +Union can only be performed on tables with the compatible column types. smallint <> binary at the first column of the second table -- !query @@ -898,7 +898,7 @@ SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as int) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. int <> binary at the first column of the second table; +Union can only be performed on tables with the compatible column types. int <> binary at the first column of the second table -- !query @@ -907,7 +907,7 @@ SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as bigint) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. bigint <> binary at the first column of the second table; +Union can only be performed on tables with the compatible column types. bigint <> binary at the first column of the second table -- !query @@ -916,7 +916,7 @@ SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as float) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. float <> binary at the first column of the second table; +Union can only be performed on tables with the compatible column types. float <> binary at the first column of the second table -- !query @@ -925,7 +925,7 @@ SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as double) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. double <> binary at the first column of the second table; +Union can only be performed on tables with the compatible column types. double <> binary at the first column of the second table -- !query @@ -934,7 +934,7 @@ SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. decimal(10,0) <> binary at the first column of the second table; +Union can only be performed on tables with the compatible column types. decimal(10,0) <> binary at the first column of the second table -- !query @@ -943,7 +943,7 @@ SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as string) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. string <> binary at the first column of the second table; +Union can only be performed on tables with the compatible column types. string <> binary at the first column of the second table -- !query @@ -961,7 +961,7 @@ SELECT cast('1' as binary) FROM t UNION SELECT cast(2 as boolean) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. boolean <> binary at the first column of the second table; +Union can only be performed on tables with the compatible column types. boolean <> binary at the first column of the second table -- !query @@ -970,7 +970,7 @@ SELECT cast('1' as binary) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. timestamp <> binary at the first column of the second table; +Union can only be performed on tables with the compatible column types. timestamp <> binary at the first column of the second table -- !query @@ -979,7 +979,7 @@ SELECT cast('1' as binary) FROM t UNION SELECT cast('2017-12-11 09:30:00' as dat struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. date <> binary at the first column of the second table; +Union can only be performed on tables with the compatible column types. date <> binary at the first column of the second table -- !query @@ -988,7 +988,7 @@ SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as tinyint) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. tinyint <> boolean at the first column of the second table; +Union can only be performed on tables with the compatible column types. tinyint <> boolean at the first column of the second table -- !query @@ -997,7 +997,7 @@ SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as smallint) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. smallint <> boolean at the first column of the second table; +Union can only be performed on tables with the compatible column types. smallint <> boolean at the first column of the second table -- !query @@ -1006,7 +1006,7 @@ SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as int) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. int <> boolean at the first column of the second table; +Union can only be performed on tables with the compatible column types. int <> boolean at the first column of the second table -- !query @@ -1015,7 +1015,7 @@ SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as bigint) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. bigint <> boolean at the first column of the second table; +Union can only be performed on tables with the compatible column types. bigint <> boolean at the first column of the second table -- !query @@ -1024,7 +1024,7 @@ SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as float) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. float <> boolean at the first column of the second table; +Union can only be performed on tables with the compatible column types. float <> boolean at the first column of the second table -- !query @@ -1033,7 +1033,7 @@ SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as double) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. double <> boolean at the first column of the second table; +Union can only be performed on tables with the compatible column types. double <> boolean at the first column of the second table -- !query @@ -1042,7 +1042,7 @@ SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as decimal(10, 0)) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. decimal(10,0) <> boolean at the first column of the second table; +Union can only be performed on tables with the compatible column types. decimal(10,0) <> boolean at the first column of the second table -- !query @@ -1051,7 +1051,7 @@ SELECT cast(1 as boolean) FROM t UNION SELECT cast(2 as string) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. string <> boolean at the first column of the second table; +Union can only be performed on tables with the compatible column types. string <> boolean at the first column of the second table -- !query @@ -1060,7 +1060,7 @@ SELECT cast(1 as boolean) FROM t UNION SELECT cast('2' as binary) FROM t struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. binary <> boolean at the first column of the second table; +Union can only be performed on tables with the compatible column types. binary <> boolean at the first column of the second table -- !query @@ -1077,7 +1077,7 @@ SELECT cast(1 as boolean) FROM t UNION SELECT cast('2017-12-11 09:30:00.0' as ti struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. timestamp <> boolean at the first column of the second table; +Union can only be performed on tables with the compatible column types. timestamp <> boolean at the first column of the second table -- !query @@ -1086,7 +1086,7 @@ SELECT cast(1 as boolean) FROM t UNION SELECT cast('2017-12-11 09:30:00' as date struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. date <> boolean at the first column of the second table; +Union can only be performed on tables with the compatible column types. date <> boolean at the first column of the second table -- !query @@ -1095,7 +1095,7 @@ SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. tinyint <> timestamp at the first column of the second table; +Union can only be performed on tables with the compatible column types. tinyint <> timestamp at the first column of the second table -- !query @@ -1104,7 +1104,7 @@ SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. smallint <> timestamp at the first column of the second table; +Union can only be performed on tables with the compatible column types. smallint <> timestamp at the first column of the second table -- !query @@ -1113,7 +1113,7 @@ SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. int <> timestamp at the first column of the second table; +Union can only be performed on tables with the compatible column types. int <> timestamp at the first column of the second table -- !query @@ -1122,7 +1122,7 @@ SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. bigint <> timestamp at the first column of the second table; +Union can only be performed on tables with the compatible column types. bigint <> timestamp at the first column of the second table -- !query @@ -1131,7 +1131,7 @@ SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. float <> timestamp at the first column of the second table; +Union can only be performed on tables with the compatible column types. float <> timestamp at the first column of the second table -- !query @@ -1140,7 +1140,7 @@ SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. double <> timestamp at the first column of the second table; +Union can only be performed on tables with the compatible column types. double <> timestamp at the first column of the second table -- !query @@ -1149,7 +1149,7 @@ SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. decimal(10,0) <> timestamp at the first column of the second table; +Union can only be performed on tables with the compatible column types. decimal(10,0) <> timestamp at the first column of the second table -- !query @@ -1167,7 +1167,7 @@ SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast('2' a struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. binary <> timestamp at the first column of the second table; +Union can only be performed on tables with the compatible column types. binary <> timestamp at the first column of the second table -- !query @@ -1176,7 +1176,7 @@ SELECT cast('2017-12-12 09:30:00.0' as timestamp) FROM t UNION SELECT cast(2 as struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. boolean <> timestamp at the first column of the second table; +Union can only be performed on tables with the compatible column types. boolean <> timestamp at the first column of the second table -- !query @@ -1203,7 +1203,7 @@ SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as tinyint struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. tinyint <> date at the first column of the second table; +Union can only be performed on tables with the compatible column types. tinyint <> date at the first column of the second table -- !query @@ -1212,7 +1212,7 @@ SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as smallin struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. smallint <> date at the first column of the second table; +Union can only be performed on tables with the compatible column types. smallint <> date at the first column of the second table -- !query @@ -1221,7 +1221,7 @@ SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as int) FR struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. int <> date at the first column of the second table; +Union can only be performed on tables with the compatible column types. int <> date at the first column of the second table -- !query @@ -1230,7 +1230,7 @@ SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as bigint) struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. bigint <> date at the first column of the second table; +Union can only be performed on tables with the compatible column types. bigint <> date at the first column of the second table -- !query @@ -1239,7 +1239,7 @@ SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as float) struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. float <> date at the first column of the second table; +Union can only be performed on tables with the compatible column types. float <> date at the first column of the second table -- !query @@ -1248,7 +1248,7 @@ SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as double) struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. double <> date at the first column of the second table; +Union can only be performed on tables with the compatible column types. double <> date at the first column of the second table -- !query @@ -1257,7 +1257,7 @@ SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as decimal struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. decimal(10,0) <> date at the first column of the second table; +Union can only be performed on tables with the compatible column types. decimal(10,0) <> date at the first column of the second table -- !query @@ -1275,7 +1275,7 @@ SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast('2' as binar struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. binary <> date at the first column of the second table; +Union can only be performed on tables with the compatible column types. binary <> date at the first column of the second table -- !query @@ -1284,7 +1284,7 @@ SELECT cast('2017-12-12 09:30:00' as date) FROM t UNION SELECT cast(2 as boolean struct<> -- !query output org.apache.spark.sql.AnalysisException -Union can only be performed on tables with the compatible column types. boolean <> date at the first column of the second table; +Union can only be performed on tables with the compatible column types. boolean <> date at the first column of the second table -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/windowFrameCoercion.sql.out b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/windowFrameCoercion.sql.out index 12af1b7d034da..fa5ad19c31b11 100644 --- a/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/windowFrameCoercion.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/typeCoercion/native/windowFrameCoercion.sql.out @@ -109,7 +109,7 @@ struct +struct -- !query output 1 @@ -117,7 +117,7 @@ struct +struct -- !query output 1 @@ -133,7 +133,7 @@ struct +struct -- !query output 1 @@ -141,7 +141,7 @@ struct +struct -- !query output 1 @@ -149,7 +149,7 @@ struct +struct -- !query output 1 @@ -157,7 +157,7 @@ struct +struct -- !query output 1 @@ -168,7 +168,7 @@ SELECT COUNT(*) OVER (PARTITION BY 1 ORDER BY cast(1 as string) DESC RANGE BETWE struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'RANGE BETWEEN CURRENT ROW AND CAST(1 AS STRING) FOLLOWING' due to data type mismatch: The data type of the upper bound 'string' does not match the expected data type '(numeric or interval)'.; line 1 pos 21 +cannot resolve 'RANGE BETWEEN CURRENT ROW AND CAST(1 AS STRING) FOLLOWING' due to data type mismatch: The data type of the upper bound 'string' does not match the expected data type '(numeric or interval or interval day to second or interval year to month)'.; line 1 pos 21 -- !query @@ -177,7 +177,7 @@ SELECT COUNT(*) OVER (PARTITION BY 1 ORDER BY cast('1' as binary) DESC RANGE BET struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'RANGE BETWEEN CURRENT ROW AND CAST(1 AS BINARY) FOLLOWING' due to data type mismatch: The data type of the upper bound 'binary' does not match the expected data type '(numeric or interval)'.; line 1 pos 21 +cannot resolve 'RANGE BETWEEN CURRENT ROW AND CAST(1 AS BINARY) FOLLOWING' due to data type mismatch: The data type of the upper bound 'binary' does not match the expected data type '(numeric or interval or interval day to second or interval year to month)'.; line 1 pos 21 -- !query @@ -186,7 +186,7 @@ SELECT COUNT(*) OVER (PARTITION BY 1 ORDER BY cast(1 as boolean) DESC RANGE BETW struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve 'RANGE BETWEEN CURRENT ROW AND CAST(1 AS BOOLEAN) FOLLOWING' due to data type mismatch: The data type of the upper bound 'boolean' does not match the expected data type '(numeric or interval)'.; line 1 pos 21 +cannot resolve 'RANGE BETWEEN CURRENT ROW AND CAST(1 AS BOOLEAN) FOLLOWING' due to data type mismatch: The data type of the upper bound 'boolean' does not match the expected data type '(numeric or interval or interval day to second or interval year to month)'.; line 1 pos 21 -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-aggregates_part1.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-aggregates_part1.sql.out index 76637bf578e6f..4fffd450e35c2 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-aggregates_part1.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-aggregates_part1.sql.out @@ -77,7 +77,7 @@ struct -- !query SELECT stddev_pop(udf(b)) FROM aggtest -- !query schema -struct +struct -- !query output 131.10703231895047 @@ -85,7 +85,7 @@ struct +struct -- !query output 151.38936080399804 @@ -93,7 +93,7 @@ struct +struct -- !query output 17189.053923482323 @@ -101,7 +101,7 @@ struct +struct -- !query output 22918.738564643096 @@ -109,7 +109,7 @@ struct +struct -- !query output 131.18117242958306 @@ -117,7 +117,7 @@ struct +struct -- !query output 151.47497042966097 @@ -125,7 +125,7 @@ struct +struct -- !query output 17208.5 @@ -133,7 +133,7 @@ struct +struct -- !query output 22944.666666666668 @@ -141,23 +141,23 @@ struct +struct -- !query output -0.0 NaN +0.0 NULL -- !query SELECT stddev_pop(udf(CAST(3.0 AS Decimal(38,0)))), stddev_samp(CAST(udf(4.0) AS Decimal(38,0))) -- !query schema -struct +struct -- !query output -0.0 NaN +0.0 NULL -- !query select sum(udf(CAST(null AS int))) from range(1,4) -- !query schema -struct +struct -- !query output NULL @@ -165,7 +165,7 @@ NULL -- !query select sum(udf(CAST(null AS long))) from range(1,4) -- !query schema -struct +struct -- !query output NULL @@ -173,7 +173,7 @@ NULL -- !query select sum(udf(CAST(null AS Decimal(38,0)))) from range(1,4) -- !query schema -struct +struct -- !query output NULL @@ -181,7 +181,7 @@ NULL -- !query select sum(udf(CAST(null AS DOUBLE))) from range(1,4) -- !query schema -struct +struct -- !query output NULL @@ -189,7 +189,7 @@ NULL -- !query select avg(udf(CAST(null AS int))) from range(1,4) -- !query schema -struct +struct -- !query output NULL @@ -197,7 +197,7 @@ NULL -- !query select avg(udf(CAST(null AS long))) from range(1,4) -- !query schema -struct +struct -- !query output NULL @@ -205,7 +205,7 @@ NULL -- !query select avg(udf(CAST(null AS Decimal(38,0)))) from range(1,4) -- !query schema -struct +struct -- !query output NULL @@ -213,7 +213,7 @@ NULL -- !query select avg(udf(CAST(null AS DOUBLE))) from range(1,4) -- !query schema -struct +struct -- !query output NULL @@ -221,7 +221,7 @@ NULL -- !query select sum(CAST(udf('NaN') AS DOUBLE)) from range(1,4) -- !query schema -struct +struct -- !query output NaN @@ -229,7 +229,7 @@ NaN -- !query select avg(CAST(udf('NaN') AS DOUBLE)) from range(1,4) -- !query schema -struct +struct -- !query output NaN @@ -238,7 +238,7 @@ NaN SELECT avg(CAST(udf(x) AS DOUBLE)), var_pop(CAST(udf(x) AS DOUBLE)) FROM (VALUES ('Infinity'), ('1')) v(x) -- !query schema -struct +struct -- !query output Infinity NaN @@ -247,7 +247,7 @@ Infinity NaN SELECT avg(CAST(udf(x) AS DOUBLE)), var_pop(CAST(udf(x) AS DOUBLE)) FROM (VALUES ('Infinity'), ('Infinity')) v(x) -- !query schema -struct +struct -- !query output Infinity NaN @@ -256,7 +256,7 @@ Infinity NaN SELECT avg(CAST(udf(x) AS DOUBLE)), var_pop(CAST(udf(x) AS DOUBLE)) FROM (VALUES ('-Infinity'), ('Infinity')) v(x) -- !query schema -struct +struct -- !query output NaN NaN @@ -265,7 +265,7 @@ NaN NaN SELECT avg(udf(CAST(x AS DOUBLE))), udf(var_pop(CAST(x AS DOUBLE))) FROM (VALUES (100000003), (100000004), (100000006), (100000007)) v(x) -- !query schema -struct +struct -- !query output 1.00000005E8 2.5 @@ -274,7 +274,7 @@ struct +struct -- !query output 7.000000000006E12 1.0 @@ -282,7 +282,7 @@ struct +struct -- !query output 653.6289553875104 871.5052738500139 @@ -290,7 +290,7 @@ struct +struct -- !query output 0.1396345165178734 @@ -315,7 +315,7 @@ struct select ten, udf(count(*)), sum(udf(four)) from onek group by ten order by ten -- !query schema -struct +struct -- !query output 0 100 100 1 100 200 @@ -333,7 +333,7 @@ struct +struct -- !query output 0 100 2 1 100 4 @@ -352,7 +352,7 @@ select ten, udf(sum(distinct four)) from onek a group by ten having exists (select 1 from onek b where udf(sum(distinct a.four)) = b.four) -- !query schema -struct +struct -- !query output 0 2 2 2 @@ -372,8 +372,8 @@ struct<> org.apache.spark.sql.AnalysisException Aggregate/Window/Generate expressions are not valid in where clause of the query. -Expression in where clause: [(sum(DISTINCT CAST((outer(a.`four`) + b.`four`) AS BIGINT)) = CAST(CAST(udf(ansi_cast(four as string)) AS INT) AS BIGINT))] -Invalid expressions: [sum(DISTINCT CAST((outer(a.`four`) + b.`four`) AS BIGINT))]; +Expression in where clause: [(sum(DISTINCT (outer(a.four) + b.four)) = CAST(CAST(udf(ansi_cast(four as string)) AS INT) AS BIGINT))] +Invalid expressions: [sum(DISTINCT (outer(a.four) + b.four))] -- !query @@ -384,4 +384,4 @@ from tenk1 o struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`o.unique1`' given input columns: [i.even, i.fivethous, i.four, i.hundred, i.odd, i.string4, i.stringu1, i.stringu2, i.ten, i.tenthous, i.thousand, i.twenty, i.two, i.twothousand, i.unique1, i.unique2]; line 2 pos 67 +cannot resolve 'o.unique1' given input columns: [i.even, i.fivethous, i.four, i.hundred, i.odd, i.string4, i.stringu1, i.stringu2, i.ten, i.tenthous, i.thousand, i.twenty, i.two, i.twothousand, i.unique1, i.unique2]; line 2 pos 67 diff --git a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-aggregates_part2.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-aggregates_part2.sql.out index d4941d0a0b768..a0008c3dd5522 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-aggregates_part2.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-aggregates_part2.sql.out @@ -161,7 +161,7 @@ true true false NULL false true -- !query select min(udf(unique1)) from tenk1 -- !query schema -struct +struct -- !query output 0 @@ -169,7 +169,7 @@ struct -- !query select udf(max(unique1)) from tenk1 -- !query schema -struct +struct -- !query output 9999 @@ -217,7 +217,7 @@ struct -- !query select distinct max(udf(unique2)) from tenk1 -- !query schema -struct +struct -- !query output 9999 @@ -241,7 +241,7 @@ struct -- !query select udf(max(udf(unique2))) from tenk1 order by udf(max(unique2))+1 -- !query schema -struct +struct -- !query output 9999 @@ -249,7 +249,7 @@ struct +struct -- !query output 9999 3 9999 2 @@ -259,6 +259,6 @@ struct -- !query select udf(max(100)) from tenk1 -- !query schema -struct +struct -- !query output 100 diff --git a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-aggregates_part3.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-aggregates_part3.sql.out index f491d9b9ba3a8..17b77a8a7aea9 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-aggregates_part3.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-aggregates_part3.sql.out @@ -8,7 +8,7 @@ select udf(max(min(unique1))) from tenk1 struct<> -- !query output org.apache.spark.sql.AnalysisException -It is not allowed to use an aggregate function in the argument of another aggregate function. Please use the inner aggregate function in a sub-query.; +It is not allowed to use an aggregate function in the argument of another aggregate function. Please use the inner aggregate function in a sub-query. -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-case.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-case.sql.out index 6c733e916d734..1969717423914 100755 --- a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-case.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-case.sql.out @@ -176,34 +176,34 @@ struct -- !query SELECT CASE WHEN udf(1=0) THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END -- !query schema -struct +struct<> -- !query output -1.0 +java.lang.ArithmeticException +divide by zero -- !query SELECT CASE 1 WHEN 0 THEN 1/udf(0) WHEN 1 THEN 1 ELSE 2/0 END -- !query schema -struct +struct<> -- !query output -1.0 +java.lang.ArithmeticException +divide by zero -- !query SELECT CASE WHEN i > 100 THEN udf(1/0) ELSE udf(0) END FROM case_tbl -- !query schema -struct 100) THEN CAST(udf(ansi_cast((ansi_cast(1 as double) / ansi_cast(0 as double)) as string)) AS DOUBLE) ELSE CAST(CAST(udf(ansi_cast(0 as string)) AS INT) AS DOUBLE) END:double> +struct<> -- !query output -0.0 -0.0 -0.0 -0.0 +java.lang.ArithmeticException +divide by zero -- !query SELECT CASE 'a' WHEN 'a' THEN udf(1) ELSE udf(2) END -- !query schema -struct +struct -- !query output 1 @@ -294,7 +294,7 @@ struct SELECT udf(COALESCE(a.f, b.i, b.j)) FROM CASE_TBL a, CASE2_TBL b -- !query schema -struct +struct -- !query output -30.3 -30.3 diff --git a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-join.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-join.sql.out index 188b57ffd58d5..36529eabc758e 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-join.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-join.sql.out @@ -243,7 +243,7 @@ struct<> SELECT udf('') AS `xxx`, udf(i), udf(j), udf(t) FROM J1_TBL AS tx -- !query schema -struct +struct -- !query output 0 NULL zero 1 4 one @@ -262,7 +262,7 @@ struct +struct -- !query output 0 NULL zero 1 4 one @@ -281,7 +281,7 @@ struct +struct -- !query output 0 NULL zero 1 4 one @@ -300,7 +300,7 @@ struct +struct -- !query output 0 NULL zero 1 4 one @@ -319,7 +319,7 @@ struct +struct -- !query output 0 NULL zero 0 NULL 0 NULL zero 1 -1 @@ -543,7 +543,7 @@ Reference 'i' is ambiguous, could be: spark_catalog.default.j1_tbl.i, spark_cata SELECT udf('') AS `xxx`, udf(t1.i) AS i, udf(k), udf(t) FROM J1_TBL t1 CROSS JOIN J2_TBL t2 -- !query schema -struct +struct -- !query output 0 -1 zero 0 -3 zero @@ -651,7 +651,7 @@ SELECT udf(udf('')) AS `xxx`, udf(udf(ii)) AS ii, udf(udf(tt)) AS tt, udf(udf(kk FROM (J1_TBL CROSS JOIN J2_TBL) AS tx (ii, jj, tt, ii2, kk) -- !query schema -struct +struct -- !query output 0 zero -1 0 zero -3 @@ -758,7 +758,7 @@ struct +struct -- !query output 0 NULL zero 0 NULL 0 NULL 0 NULL zero 0 NULL 1 -1 @@ -1657,7 +1657,7 @@ struct +struct -- !query output 0 NULL zero NULL 1 4 one -1 @@ -1672,7 +1672,7 @@ struct +struct -- !query output 0 NULL zero NULL 1 4 one -1 @@ -1703,7 +1703,7 @@ struct SELECT udf(udf('')) AS `xxx`, udf(i), udf(j), udf(t), udf(k) FROM J1_TBL NATURAL JOIN J2_TBL -- !query schema -struct +struct -- !query output 0 NULL zero NULL 1 4 one -1 @@ -1718,7 +1718,7 @@ struct +struct -- !query output 0 NULL zero NULL 1 4 one -1 @@ -1733,7 +1733,7 @@ struct +struct -- !query output 0 NULL zero NULL 2 3 two 2 @@ -1744,7 +1744,7 @@ struct +struct -- !query output 0 NULL zero 0 NULL 1 4 one 1 -1 @@ -1759,7 +1759,7 @@ struct +struct -- !query output 0 NULL zero NULL 0 2 3 two 2 2 @@ -1770,7 +1770,7 @@ struct +struct -- !query output 0 NULL zero 2 2 0 NULL zero 2 4 @@ -1788,7 +1788,7 @@ SELECT udf(udf('')) AS `xxx`, udf(i), udf(j), udf(t), udf(k) FROM J1_TBL LEFT OUTER JOIN J2_TBL USING (i) ORDER BY udf(udf(i)), udf(k), udf(t) -- !query schema -struct +struct -- !query output NULL NULL null NULL NULL 0 zero NULL @@ -1810,7 +1810,7 @@ SELECT udf('') AS `xxx`, udf(i), udf(j), udf(t), udf(k) FROM J1_TBL LEFT JOIN J2_TBL USING (i) ORDER BY udf(i), udf(udf(k)), udf(t) -- !query schema -struct +struct -- !query output NULL NULL null NULL NULL 0 zero NULL @@ -1831,7 +1831,7 @@ struct +struct -- !query output 0 NULL zero NULL 1 4 one -1 @@ -1848,7 +1848,7 @@ struct +struct -- !query output 0 NULL zero NULL 1 4 one -1 @@ -1866,7 +1866,7 @@ SELECT udf('') AS `xxx`, udf(i), udf(j), udf(udf(t)), udf(k) FROM J1_TBL FULL OUTER JOIN J2_TBL USING (i) ORDER BY udf(udf(i)), udf(k), udf(t) -- !query schema -struct +struct -- !query output NULL NULL NULL NULL NULL NULL null NULL @@ -1890,7 +1890,7 @@ SELECT udf('') AS `xxx`, udf(i), udf(j), t, udf(udf(k)) FROM J1_TBL FULL JOIN J2_TBL USING (i) ORDER BY udf(udf(i)), udf(k), udf(udf(t)) -- !query schema -struct +struct -- !query output NULL NULL NULL NULL NULL NULL null NULL @@ -1913,7 +1913,7 @@ struct +struct -- !query output @@ -1922,7 +1922,7 @@ struct +struct -- !query output 1 4 one -1 @@ -2052,7 +2052,7 @@ FULL JOIN (SELECT * FROM t3) s3 USING (name) -- !query schema -struct +struct -- !query output bb 12 13 cc 22 23 @@ -2138,7 +2138,7 @@ NATURAL FULL JOIN (SELECT name, udf(udf(n)) as s3_n FROM t3) as s3 ) ss2 -- !query schema -struct +struct -- !query output bb 11 12 13 cc NULL 22 23 @@ -2171,7 +2171,7 @@ FULL JOIN (SELECT name, 2 as s2_n FROM t2) as s2 ON (udf(udf(s1_n)) = udf(s2_n)) -- !query schema -struct +struct -- !query output NULL NULL bb 2 NULL NULL cc 2 @@ -2202,7 +2202,7 @@ struct<> -- !query select udf(udf(x1)), udf(x2) from x -- !query schema -struct +struct -- !query output 1 11 2 22 @@ -2214,7 +2214,7 @@ struct +struct -- !query output 1 111 2 222 @@ -2336,7 +2336,7 @@ select udf(udf(count(*))) from tenk1 a where udf(udf(unique1)) in (select udf(unique1) from tenk1 b join tenk1 c using (unique1) where udf(udf(b.unique2)) = udf(42)) -- !query schema -struct +struct -- !query output 1 @@ -2347,7 +2347,7 @@ select udf(count(*)) from tenk1 x where udf(x.unique1) = 0 and udf(x.unique1) in (select aa.f1 from int4_tbl aa,float8_tbl bb where aa.f1=udf(udf(bb.f1))) -- !query schema -struct +struct -- !query output 1 @@ -2358,7 +2358,7 @@ select udf(udf(count(*))) from tenk1 x where udf(x.unique1) = 0 and udf(udf(x.unique1)) in (select udf(aa.f1) from int4_tbl aa,float8_tbl bb where udf(aa.f1)=udf(udf(bb.f1))) -- !query schema -struct +struct -- !query output 1 @@ -2388,7 +2388,7 @@ from tenk1 t5 where udf(t4.thousand) = udf(t5.unique1) and udf(udf(ss.x1)) = t4.tenthous and udf(ss.x2) = udf(udf(t5.stringu1)) -- !query schema -struct +struct -- !query output 1000 @@ -2400,7 +2400,7 @@ select udf(a.f1), udf(b.f1), udf(t.thousand), udf(t.tenthous) from (select udf(sum(udf(f1))) as f1 from int4_tbl i4b) b where b.f1 = udf(t.thousand) and udf(a.f1) = udf(b.f1) and udf((udf(a.f1)+udf(b.f1)+999)) = udf(udf(t.tenthous)) -- !query schema -struct +struct -- !query output @@ -2441,7 +2441,7 @@ select udf(count(*)) from (select * from tenk1 y order by udf(y.unique2)) y on udf(x.thousand) = y.unique2 and x.twothousand = udf(y.hundred) and x.fivethous = y.unique2 -- !query schema -struct +struct -- !query output 10000 @@ -2530,7 +2530,7 @@ struct select udf(count(*)) from tenk1 a, tenk1 b where udf(a.hundred) = b.thousand and udf(udf((b.fivethous % 10)) < 10) -- !query schema -struct +struct -- !query output 100000 @@ -2727,7 +2727,7 @@ from tenk1 a left join tenk1 b on a.unique2 = udf(b.tenthous) where udf(a.unique1) = 42 and ((udf(b.unique2) is null and udf(a.ten) = 2) or udf(udf(b.hundred)) = udf(udf(3))) -- !query schema -struct +struct -- !query output @@ -2757,11 +2757,11 @@ struct -- !query -select udf(t1.q2), udf(count(t2.*)) +select udf(t1.q2), udf(count(t2.q1, t2.q2)) from int8_tbl t1 left join int8_tbl t2 on (udf(udf(t1.q2)) = t2.q1) group by udf(t1.q2) order by 1 -- !query schema -struct +struct -- !query output -4567890123456789 0 123 2 @@ -2770,11 +2770,11 @@ struct +struct -- !query output -4567890123456789 0 123 2 @@ -2783,13 +2783,13 @@ struct +struct -- !query output -4567890123456789 0 123 2 @@ -2838,7 +2838,7 @@ from c left join on (udf(udf(c.a)) = udf(ss.code)) order by c.name -- !query schema -struct +struct -- !query output A p 2 -1 B q 0 -1 @@ -2884,7 +2884,7 @@ LEFT JOIN ) sub2 ON sub1.key1 = udf(udf(sub2.key3)) -- !query schema -struct +struct -- !query output 1 1 1 1 @@ -2898,7 +2898,7 @@ SELECT udf(qq), udf(udf(unique1)) USING (qq) INNER JOIN tenk1 c ON udf(qq) = udf(unique2) -- !query schema -struct +struct -- !query output 123 4596 123 4596 @@ -2948,7 +2948,7 @@ from nt3 as nt3 on udf(ss2.id) = nt3.nt2_id where udf(nt3.id) = 1 and udf(ss2.b3) -- !query schema -struct +struct -- !query output 1 @@ -3008,7 +3008,7 @@ select udf(count(*)) from left join tenk1 c on udf(a.unique2) = udf(b.unique1) and udf(c.thousand) = udf(udf(a.thousand)) join int4_tbl on udf(b.thousand) = f1 -- !query schema -struct +struct -- !query output 10 @@ -3021,7 +3021,7 @@ select udf(b.unique1) from right join int4_tbl i2 on udf(udf(i2.f1)) = udf(b.tenthous) order by udf(1) -- !query schema -struct +struct -- !query output NULL NULL @@ -3039,7 +3039,7 @@ select * from where udf(fault) = udf(122) order by udf(fault) -- !query schema -struct +struct -- !query output NULL 123 122 @@ -3049,7 +3049,7 @@ select udf(q1), udf(unique2), udf(thousand), udf(hundred) from int8_tbl a left join tenk1 b on udf(q1) = udf(unique2) where udf(coalesce(thousand,123)) = udf(q1) and udf(q1) = udf(udf(coalesce(hundred,123))) -- !query schema -struct +struct -- !query output @@ -3059,7 +3059,7 @@ select udf(f1), udf(unique2), case when udf(udf(unique2)) is null then udf(f1) e from int4_tbl a left join tenk1 b on udf(f1) = udf(udf(unique2)) where (case when udf(unique2) is null then udf(f1) else 0 end) = 0 -- !query schema -struct +struct -- !query output 0 0 0 @@ -3069,7 +3069,7 @@ select udf(a.unique1), udf(b.unique1), udf(c.unique1), udf(coalesce(b.twothousan from tenk1 a left join tenk1 b on udf(b.thousand) = a.unique1 left join tenk1 c on udf(c.unique2) = udf(coalesce(b.twothousand, a.twothousand)) where a.unique2 < udf(10) and udf(udf(coalesce(b.twothousand, a.twothousand))) = udf(44) -- !query schema -struct +struct -- !query output @@ -3107,7 +3107,7 @@ select udf(a.q2), udf(b.q1) from int8_tbl a left join int8_tbl b on udf(a.q2) = coalesce(b.q1, 1) where udf(udf(coalesce(b.q1, 1)) > 0) -- !query schema -struct +struct -- !query output -4567890123456789 NULL 123 123 @@ -3237,7 +3237,7 @@ SELECT * FROM FROM int8_tbl LEFT JOIN innertab ON udf(udf(q2)) = id) ss2 ON true -- !query schema -struct +struct -- !query output 1 123 456 123 1 123 4567890123456789 123 @@ -3263,7 +3263,7 @@ select * from struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`y.f1`' given input columns: [j.f1, j.f1, x.q1, x.q2]; line 2 pos 72 +cannot resolve 'y.f1' given input columns: [j.f1, j.f1, x.q1, x.q2]; line 2 pos 72 -- !query @@ -3282,7 +3282,7 @@ select udf(t1.uunique1) from struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`t1.uunique1`' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 11 +cannot resolve 't1.uunique1' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 11 -- !query @@ -3292,7 +3292,7 @@ select udf(udf(t2.uunique1)) from struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`t2.uunique1`' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 15 +cannot resolve 't2.uunique1' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 15 -- !query @@ -3302,7 +3302,7 @@ select udf(uunique1) from struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`uunique1`' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 11 +cannot resolve 'uunique1' given input columns: [t1.even, t2.even, t1.fivethous, t2.fivethous, t1.four, t2.four, t1.hundred, t2.hundred, t1.odd, t2.odd, t1.string4, t2.string4, t1.stringu1, t2.stringu1, t1.stringu2, t2.stringu2, t1.ten, t2.ten, t1.tenthous, t2.tenthous, t1.thousand, t2.thousand, t1.twenty, t2.twenty, t1.two, t2.two, t1.twothousand, t2.twothousand, t1.unique1, t2.unique1, t1.unique2, t2.unique2]; line 1 pos 11 -- !query @@ -3311,7 +3311,7 @@ select udf(udf(f1,g)) from int4_tbl a, (select udf(udf(f1)) as g) ss struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`f1`' given input columns: []; line 1 pos 55 +cannot resolve 'f1' given input columns: []; line 1 pos 55 -- !query @@ -3320,7 +3320,7 @@ select udf(f1,g) from int4_tbl a, (select a.f1 as g) ss struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`a.f1`' given input columns: []; line 1 pos 42 +cannot resolve 'a.f1' given input columns: []; line 1 pos 42 -- !query @@ -3329,7 +3329,7 @@ select udf(udf(f1,g)) from int4_tbl a cross join (select udf(f1) as g) ss struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`f1`' given input columns: []; line 1 pos 61 +cannot resolve 'f1' given input columns: []; line 1 pos 61 -- !query @@ -3338,7 +3338,7 @@ select udf(f1,g) from int4_tbl a cross join (select udf(udf(a.f1)) as g) ss struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`a.f1`' given input columns: []; line 1 pos 60 +cannot resolve 'a.f1' given input columns: []; line 1 pos 60 -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-select_having.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-select_having.sql.out index 50b6e60086747..3e69b2029e514 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-select_having.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-select_having.sql.out @@ -94,7 +94,7 @@ struct<> SELECT udf(b), udf(c) FROM test_having GROUP BY b, c HAVING udf(count(*)) = 1 ORDER BY udf(b), udf(c) -- !query schema -struct +struct -- !query output 1 XXXX 3 bbbb @@ -104,7 +104,7 @@ struct +struct -- !query output 3 BBBB 3 bbbb @@ -115,7 +115,7 @@ SELECT udf(c), max(udf(a)) FROM test_having GROUP BY c HAVING udf(count(*)) > 2 OR udf(min(a)) = udf(max(a)) ORDER BY c -- !query schema -struct +struct -- !query output XXXX 0 bbbb 5 @@ -124,7 +124,7 @@ bbbb 5 -- !query SELECT udf(udf(min(udf(a)))), udf(udf(max(udf(a)))) FROM test_having HAVING udf(udf(min(udf(a)))) = udf(udf(max(udf(a)))) -- !query schema -struct +struct -- !query output @@ -132,7 +132,7 @@ struct +struct -- !query output 0 9 @@ -143,7 +143,7 @@ SELECT udf(a) FROM test_having HAVING udf(min(a)) < udf(max(a)) struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping expressions sequence is empty, and 'spark_catalog.default.test_having.`a`' is not an aggregate function. Wrap '(min(spark_catalog.default.test_having.`a`) AS `min(a#x)`, max(spark_catalog.default.test_having.`a`) AS `max(a#x)`)' in windowing function(s) or wrap 'spark_catalog.default.test_having.`a`' in first() (or first_value) if you don't care which value you get.; +grouping expressions sequence is empty, and 'spark_catalog.default.test_having.a' is not an aggregate function. Wrap '(min(spark_catalog.default.test_having.a) AS `min(a#x)`, max(spark_catalog.default.test_having.a) AS `max(a#x)`)' in windowing function(s) or wrap 'spark_catalog.default.test_having.a' in first() (or first_value) if you don't care which value you get. -- !query @@ -152,7 +152,7 @@ SELECT 1 AS one FROM test_having HAVING udf(a) > 1 struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`a`' given input columns: [one]; line 1 pos 44 +cannot resolve 'a' given input columns: [one]; line 1 pos 44 -- !query @@ -174,9 +174,10 @@ struct -- !query SELECT 1 AS one FROM test_having WHERE 1/udf(a) = 1 HAVING 1 < 2 -- !query schema -struct +struct<> -- !query output -1 +java.lang.ArithmeticException +divide by zero -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-select_implicit.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-select_implicit.sql.out index 66e6c20a2f6f2..ee1f673cc9d9a 100755 --- a/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-select_implicit.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/postgreSQL/udf-select_implicit.sql.out @@ -95,7 +95,7 @@ SELECT udf(c), udf(count(*)) FROM test_missing_target GROUP BY udf(test_missing_target.c) ORDER BY udf(c) -- !query schema -struct +struct -- !query output ABAB 2 BBBB 2 @@ -109,7 +109,7 @@ cccc 2 SELECT udf(count(*)) FROM test_missing_target GROUP BY udf(test_missing_target.c) ORDER BY udf(c) -- !query schema -struct +struct -- !query output 2 2 @@ -125,13 +125,13 @@ SELECT udf(count(*)) FROM test_missing_target GROUP BY udf(a) ORDER BY udf(b) struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`b`' given input columns: [CAST(udf(ansi_cast(count(1) as string)) AS BIGINT)]; line 1 pos 75 +cannot resolve 'b' given input columns: [udf(count(1))]; line 1 pos 75 -- !query SELECT udf(count(*)) FROM test_missing_target GROUP BY udf(b) ORDER BY udf(b) -- !query schema -struct +struct -- !query output 1 2 @@ -143,7 +143,7 @@ struct SELECT udf(test_missing_target.b), udf(count(*)) FROM test_missing_target GROUP BY udf(b) ORDER BY udf(b) -- !query schema -struct +struct -- !query output 1 1 2 2 @@ -154,7 +154,7 @@ struct +struct -- !query output XXXX ABAB @@ -171,7 +171,7 @@ CCCC -- !query SELECT udf(count(*)) FROM test_missing_target GROUP BY udf(b) ORDER BY udf(b) desc -- !query schema -struct +struct -- !query output 4 3 @@ -182,7 +182,7 @@ struct -- !query SELECT udf(count(*)) FROM test_missing_target ORDER BY udf(1) desc -- !query schema -struct +struct -- !query output 10 @@ -190,7 +190,7 @@ struct -- !query SELECT udf(c), udf(count(*)) FROM test_missing_target GROUP BY 1 ORDER BY 1 -- !query schema -struct +struct -- !query output ABAB 2 BBBB 2 @@ -224,7 +224,7 @@ Reference 'b' is ambiguous, could be: x.b, y.b.; line 3 pos 14 SELECT udf(a), udf(a) FROM test_missing_target ORDER BY udf(a) -- !query schema -struct +struct -- !query output 0 0 1 1 @@ -242,7 +242,7 @@ struct +struct -- !query output 0.0 0.0 0.5 0.5 @@ -260,7 +260,7 @@ struct +struct -- !query output 0.0 0.0 0.5 0.5 @@ -279,7 +279,7 @@ SELECT udf(x.b), udf(count(*)) FROM test_missing_target x, test_missing_target y WHERE udf(x.a) = udf(y.a) GROUP BY udf(x.b) ORDER BY udf(x.b) -- !query schema -struct +struct -- !query output 1 1 2 2 @@ -292,7 +292,7 @@ SELECT udf(count(*)) FROM test_missing_target x, test_missing_target y WHERE udf(x.a) = udf(y.a) GROUP BY udf(x.b) ORDER BY udf(x.b) -- !query schema -struct +struct -- !query output 1 2 @@ -305,7 +305,7 @@ SELECT udf(a%2), udf(count(udf(b))) FROM test_missing_target GROUP BY udf(test_missing_target.a%2) ORDER BY udf(test_missing_target.a%2) -- !query schema -struct +struct -- !query output 0 5 1 5 @@ -316,7 +316,7 @@ SELECT udf(count(c)) FROM test_missing_target GROUP BY udf(lower(test_missing_target.c)) ORDER BY udf(lower(test_missing_target.c)) -- !query schema -struct +struct -- !query output 2 3 @@ -330,13 +330,13 @@ SELECT udf(count(udf(a))) FROM test_missing_target GROUP BY udf(a) ORDER BY udf( struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`b`' given input columns: [CAST(udf(ansi_cast(count(ansi_cast(udf(ansi_cast(a as string)) as int)) as string)) AS BIGINT)]; line 1 pos 80 +cannot resolve 'b' given input columns: [udf(count(udf(a)))]; line 1 pos 80 -- !query SELECT udf(count(b)) FROM test_missing_target GROUP BY udf(b/2) ORDER BY udf(b/2) -- !query schema -struct +struct -- !query output 1 2 @@ -348,7 +348,7 @@ struct SELECT udf(lower(test_missing_target.c)), udf(count(udf(c))) FROM test_missing_target GROUP BY udf(lower(c)) ORDER BY udf(lower(c)) -- !query schema -struct +struct -- !query output abab 2 bbbb 3 @@ -359,7 +359,7 @@ xxxx 1 -- !query SELECT udf(a) FROM test_missing_target ORDER BY udf(upper(udf(d))) -- !query schema -struct +struct -- !query output 0 1 @@ -377,7 +377,7 @@ struct SELECT udf(count(b)) FROM test_missing_target GROUP BY udf((b + 1) / 2) ORDER BY udf((b + 1) / 2) desc -- !query schema -struct +struct -- !query output 4 3 @@ -402,7 +402,7 @@ test_missing_target y WHERE udf(x.a) = udf(y.a) GROUP BY udf(x.b/2) ORDER BY udf(x.b/2) -- !query schema -struct +struct -- !query output 0.5 1 1.0 2 diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-count.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-count.sql.out index e66948dcdea34..4bd8da618607a 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-count.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-count.sql.out @@ -17,7 +17,7 @@ SELECT udf(count(*)), udf(count(1)), udf(count(null)), udf(count(a)), udf(count(b)), udf(count(a + b)), udf(count((a, b))) FROM testData -- !query schema -struct +struct -- !query output 7 7 0 5 5 4 7 @@ -32,24 +32,24 @@ SELECT udf(count(DISTINCT (a, b))) FROM testData -- !query schema -struct +struct -- !query output 1 0 2 2 2 6 -- !query -SELECT udf(count(a, b)), udf(count(b, a)), udf(count(testData.*)) FROM testData +SELECT udf(count(a, b)), udf(count(b, a)), udf(count(testData.*, testData.*)) FROM testData -- !query schema -struct +struct -- !query output 4 4 4 -- !query SELECT - udf(count(DISTINCT a, b)), udf(count(DISTINCT b, a)), udf(count(DISTINCT *)), udf(count(DISTINCT testData.*)) + udf(count(DISTINCT a, b)), udf(count(DISTINCT b, a)), udf(count(DISTINCT *)), udf(count(DISTINCT testData.*, testData.*)) FROM testData -- !query schema -struct +struct -- !query output 3 3 3 3 diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-cross-join.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-cross-join.sql.out index fdddfc55978b4..3843363f5a75c 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-cross-join.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-cross-join.sql.out @@ -76,7 +76,7 @@ SELECT udf(a.key), udf(b.key) FROM CROSS JOIN (SELECT udf(k) key FROM nt2 WHERE v2 = 22) b -- !query schema -struct +struct -- !query output one two diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-except-all.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-except-all.sql.out index 2613120e004df..ace56befb219f 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-except-all.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-except-all.sql.out @@ -53,7 +53,7 @@ SELECT udf(c1) FROM tab1 EXCEPT ALL SELECT udf(c1) FROM tab2 -- !query schema -struct +struct -- !query output 0 2 @@ -66,7 +66,7 @@ SELECT udf(c1) FROM tab1 MINUS ALL SELECT udf(c1) FROM tab2 -- !query schema -struct +struct -- !query output 0 2 @@ -79,7 +79,7 @@ SELECT udf(c1) FROM tab1 EXCEPT ALL SELECT udf(c1) FROM tab2 WHERE udf(c1) IS NOT NULL -- !query schema -struct +struct -- !query output 0 2 @@ -93,7 +93,7 @@ SELECT udf(c1) FROM tab1 WHERE udf(c1) > 5 EXCEPT ALL SELECT udf(c1) FROM tab2 -- !query schema -struct +struct -- !query output @@ -103,7 +103,7 @@ SELECT udf(c1) FROM tab1 EXCEPT ALL SELECT udf(c1) FROM tab2 WHERE udf(c1 > udf(6)) -- !query schema -struct +struct -- !query output 0 1 @@ -121,7 +121,7 @@ SELECT udf(c1) FROM tab1 EXCEPT ALL SELECT CAST(udf(1) AS BIGINT) -- !query schema -struct +struct -- !query output 0 2 @@ -141,7 +141,7 @@ SELECT array(1) struct<> -- !query output org.apache.spark.sql.AnalysisException -ExceptAll can only be performed on tables with the compatible column types. array <> int at the first column of the second table; +ExceptAll can only be performed on tables with the compatible column types. array <> int at the first column of the second table -- !query @@ -149,7 +149,7 @@ SELECT udf(k), v FROM tab3 EXCEPT ALL SELECT k, udf(v) FROM tab4 -- !query schema -struct +struct -- !query output 1 2 1 3 @@ -160,7 +160,7 @@ SELECT k, udf(v) FROM tab4 EXCEPT ALL SELECT udf(k), v FROM tab3 -- !query schema -struct +struct -- !query output 2 2 2 20 @@ -173,7 +173,7 @@ SELECT udf(k), udf(v) FROM tab3 INTERSECT DISTINCT SELECT udf(k), udf(v) FROM tab4 -- !query schema -struct +struct -- !query output 2 2 2 20 @@ -186,7 +186,7 @@ SELECT k, udf(v) FROM tab3 EXCEPT DISTINCT SELECT udf(k), udf(v) FROM tab4 -- !query schema -struct +struct -- !query output @@ -200,7 +200,7 @@ SELECT udf(k), v FROM tab3 EXCEPT DISTINCT SELECT k, udf(v) FROM tab4 -- !query schema -struct +struct -- !query output 1 3 @@ -213,7 +213,7 @@ SELECT k, v FROM tab4 struct<> -- !query output org.apache.spark.sql.AnalysisException -ExceptAll can only be performed on tables with the same number of columns, but the first table has 1 columns and the second table has 2 columns; +ExceptAll can only be performed on tables with the same number of columns, but the first table has 1 columns and the second table has 2 columns -- !query @@ -225,7 +225,7 @@ SELECT udf(k), udf(v) FROM tab3 EXCEPT DISTINCT SELECT udf(k), udf(v) FROM tab4 -- !query schema -struct +struct -- !query output 1 3 @@ -239,7 +239,7 @@ SELECT udf(k), udf(v) FROM tab3 MINUS DISTINCT SELECT k, udf(v) FROM tab4 -- !query schema -struct +struct -- !query output 1 3 @@ -253,7 +253,7 @@ SELECT k, udf(v) FROM tab3 EXCEPT DISTINCT SELECT udf(k), v FROM tab4 -- !query schema -struct +struct -- !query output @@ -273,7 +273,7 @@ FROM (SELECT udf(tab3.k), JOIN tab4 ON tab3.k = udf(tab4.k)) -- !query schema -struct +struct -- !query output @@ -293,7 +293,7 @@ FROM (SELECT udf(tab4.v) AS k, JOIN tab4 ON udf(tab3.k) = udf(tab4.k)) -- !query schema -struct +struct -- !query output 1 2 1 2 @@ -309,7 +309,7 @@ SELECT udf(v) FROM tab3 GROUP BY v EXCEPT ALL SELECT udf(k) FROM tab4 GROUP BY k -- !query schema -struct +struct -- !query output 3 diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-except.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-except.sql.out index 054ee00ecc2ae..7d21715fbaa8a 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-except.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-except.sql.out @@ -32,7 +32,7 @@ struct<> -- !query SELECT udf(k), udf(v) FROM t1 EXCEPT SELECT udf(k), udf(v) FROM t2 -- !query schema -struct +struct -- !query output three 3 two 2 @@ -100,6 +100,15 @@ WHERE udf(t1.v) >= (SELECT min(udf(t2.v)) FROM t2 WHERE t2.k = t1.k) -- !query schema -struct +struct<> -- !query output -two +org.apache.spark.sql.AnalysisException +Correlated column is not allowed in predicate (CAST(udf(cast(k as string)) AS STRING) = CAST(udf(cast(outer(k#x) as string)) AS STRING)): +Aggregate [cast(udf(cast(max(cast(udf(cast(v#x as string)) as int)) as string)) as int) AS udf(max(udf(v)))#x] ++- Filter (cast(udf(cast(k#x as string)) as string) = cast(udf(cast(outer(k#x) as string)) as string)) + +- SubqueryAlias t2 + +- View (`t2`, [k#x,v#x]) + +- Project [cast(k#x as string) AS k#x, cast(v#x as int) AS v#x] + +- Project [k#x, v#x] + +- SubqueryAlias t2 + +- LocalRelation [k#x, v#x] diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-group-analytics.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-group-analytics.sql.out index f4cf4196298c1..7d2fad8cc2087 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-group-analytics.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-group-analytics.sql.out @@ -15,7 +15,7 @@ struct<> -- !query SELECT udf(a + b), b, udf(SUM(a - b)) FROM testData GROUP BY udf(a + b), b WITH CUBE -- !query schema -struct +struct -- !query output 2 1 0 2 NULL 0 @@ -35,7 +35,7 @@ NULL NULL 3 -- !query SELECT udf(a), udf(b), SUM(b) FROM testData GROUP BY udf(a), b WITH CUBE -- !query schema -struct +struct -- !query output 1 1 1 1 2 2 @@ -54,7 +54,7 @@ NULL NULL 9 -- !query SELECT udf(a + b), b, SUM(a - b) FROM testData GROUP BY a + b, b WITH ROLLUP -- !query schema -struct +struct -- !query output 2 1 0 2 NULL 0 @@ -72,7 +72,7 @@ NULL NULL 3 -- !query SELECT udf(a), b, udf(SUM(b)) FROM testData GROUP BY udf(a), b WITH ROLLUP -- !query schema -struct +struct -- !query output 1 1 1 1 2 2 @@ -129,7 +129,7 @@ dotNET 2013 48000 -- !query SELECT course, udf(year), SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(course, year) -- !query schema -struct +struct -- !query output Java NULL 50000 NULL 2012 35000 @@ -140,7 +140,7 @@ dotNET NULL 63000 -- !query SELECT course, year, udf(SUM(earnings)) FROM courseSales GROUP BY course, year GROUPING SETS(course) -- !query schema -struct +struct -- !query output Java NULL 50000 dotNET NULL 63000 @@ -149,7 +149,7 @@ dotNET NULL 63000 -- !query SELECT udf(course), year, SUM(earnings) FROM courseSales GROUP BY course, year GROUPING SETS(year) -- !query schema -struct +struct -- !query output NULL 2012 35000 NULL 2013 78000 @@ -191,7 +191,7 @@ dotNET 63000 1 SELECT udf(course), udf(year), GROUPING(course), GROUPING(year), GROUPING_ID(course, year) FROM courseSales GROUP BY CUBE(course, year) -- !query schema -struct +struct -- !query output Java 2012 0 0 0 Java 2013 0 0 0 @@ -210,7 +210,7 @@ SELECT course, udf(year), GROUPING(course) FROM courseSales GROUP BY course, udf struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping() can only be used with GroupingSets/Cube/Rollup; +grouping() can only be used with GroupingSets/Cube/Rollup -- !query @@ -219,7 +219,7 @@ SELECT course, udf(year), GROUPING_ID(course, year) FROM courseSales GROUP BY ud struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping_id() can only be used with GroupingSets/Cube/Rollup; +grouping_id() can only be used with GroupingSets/Cube/Rollup -- !query @@ -255,7 +255,7 @@ SELECT course, udf(year) FROM courseSales GROUP BY udf(course), year HAVING GROU struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup; +grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup -- !query @@ -264,13 +264,13 @@ SELECT course, udf(udf(year)) FROM courseSales GROUP BY course, year HAVING GROU struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup; +grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup -- !query SELECT udf(course), year FROM courseSales GROUP BY CUBE(course, year) HAVING grouping__id > 0 -- !query schema -struct +struct -- !query output Java NULL NULL 2012 @@ -319,7 +319,7 @@ SELECT course, udf(year) FROM courseSales GROUP BY course, udf(year) ORDER BY GR struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup; +grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup -- !query @@ -328,7 +328,7 @@ SELECT course, udf(year) FROM courseSales GROUP BY course, udf(year) ORDER BY GR struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup; +grouping()/grouping_id() can only be used with GroupingSets/Cube/Rollup -- !query @@ -388,7 +388,7 @@ NULL NULL 3 -- !query SELECT udf(a + b), udf(udf(b)) AS k, SUM(a - b) FROM testData GROUP BY a + b, k GROUPING SETS(k) -- !query schema -struct +struct -- !query output NULL 1 3 NULL 2 0 diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-group-by.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-group-by.sql.out index 6403406413db9..07489dcad9a08 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-group-by.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-group-by.sql.out @@ -18,13 +18,13 @@ SELECT udf(a), udf(COUNT(b)) FROM testData struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping expressions sequence is empty, and 'testdata.`a`' is not an aggregate function. Wrap '(CAST(udf(cast(count(b) as string)) AS BIGINT) AS `CAST(udf(cast(count(b) as string)) AS BIGINT)`)' in windowing function(s) or wrap 'testdata.`a`' in first() (or first_value) if you don't care which value you get.; +grouping expressions sequence is empty, and 'testdata.a' is not an aggregate function. Wrap '(CAST(udf(cast(count(b) as string)) AS BIGINT) AS `udf(count(b))`)' in windowing function(s) or wrap 'testdata.a' in first() (or first_value) if you don't care which value you get. -- !query SELECT COUNT(udf(a)), udf(COUNT(b)) FROM testData -- !query schema -struct +struct -- !query output 7 7 @@ -32,7 +32,7 @@ struct +struct -- !query output 1 2 2 2 @@ -46,13 +46,13 @@ SELECT udf(a), udf(COUNT(udf(b))) FROM testData GROUP BY b struct<> -- !query output org.apache.spark.sql.AnalysisException -expression 'testdata.`a`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.; +expression 'testdata.a' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get. -- !query SELECT COUNT(udf(a)), COUNT(udf(b)) FROM testData GROUP BY udf(a) -- !query schema -struct +struct -- !query output 0 1 2 2 @@ -63,7 +63,7 @@ struct +struct -- !query output foo 7 @@ -79,7 +79,7 @@ struct -- !query SELECT 'foo', udf(APPROX_COUNT_DISTINCT(udf(a))) FROM testData WHERE a = 0 GROUP BY udf(1) -- !query schema -struct +struct -- !query output @@ -87,7 +87,7 @@ struct> +struct> -- !query output @@ -95,7 +95,7 @@ struct +struct -- !query output 2 1 3 2 @@ -110,13 +110,13 @@ SELECT udf(a + 2), udf(COUNT(b)) FROM testData GROUP BY a + 1 struct<> -- !query output org.apache.spark.sql.AnalysisException -expression 'testdata.`a`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.; +expression 'testdata.a' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get. -- !query SELECT udf(a + 1) + 1, udf(COUNT(b)) FROM testData GROUP BY udf(a + 1) -- !query schema -struct<(CAST(udf(cast((a + 1) as string)) AS INT) + 1):int,CAST(udf(cast(count(b) as string)) AS BIGINT):bigint> +struct<(udf((a + 1)) + 1):int,udf(count(b)):bigint> -- !query output 3 2 4 2 @@ -128,7 +128,7 @@ NULL 1 SELECT SKEWNESS(udf(a)), udf(KURTOSIS(a)), udf(MIN(a)), MAX(udf(a)), udf(AVG(udf(a))), udf(VARIANCE(a)), STDDEV(udf(a)), udf(SUM(a)), udf(COUNT(a)) FROM testData -- !query schema -struct +struct -- !query output -0.2723801058145729 -1.5069204152249134 1 3 2.142857142857143 0.8095238095238094 0.8997354108424372 15 7 @@ -136,7 +136,7 @@ struct +struct -- !query output 1 1 @@ -144,7 +144,7 @@ struct +struct -- !query output 1 2 2 2 @@ -155,7 +155,7 @@ NULL 1 -- !query SELECT a AS k, udf(COUNT(b)) FROM testData GROUP BY k HAVING k > 1 -- !query schema -struct +struct -- !query output 2 2 3 2 @@ -167,7 +167,7 @@ SELECT udf(COUNT(b)) AS k FROM testData GROUP BY k struct<> -- !query output org.apache.spark.sql.AnalysisException -aggregate functions are not allowed in GROUP BY, but found CAST(udf(cast(count(b) as string)) AS BIGINT); +aggregate functions are not allowed in GROUP BY, but found CAST(udf(cast(count(b) as string)) AS BIGINT) -- !query @@ -185,7 +185,7 @@ SELECT k AS a, udf(COUNT(udf(v))) FROM testDataHasSameNameWithAlias GROUP BY udf struct<> -- !query output org.apache.spark.sql.AnalysisException -expression 'testdatahassamenamewithalias.`k`' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get.; +expression 'testdatahassamenamewithalias.k' is neither present in the group by, nor is it an aggregate function. Add to group by or wrap in first() (or first_value) if you don't care which value you get. -- !query @@ -202,13 +202,13 @@ SELECT a AS k, udf(COUNT(udf(b))) FROM testData GROUP BY k struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`k`' given input columns: [testdata.a, testdata.b]; line 1 pos 57 +cannot resolve 'k' given input columns: [testdata.a, testdata.b]; line 1 pos 57 -- !query SELECT udf(a), COUNT(udf(1)) FROM testData WHERE false GROUP BY udf(a) -- !query schema -struct +struct -- !query output @@ -216,7 +216,7 @@ struct +struct -- !query output 0 @@ -247,7 +247,7 @@ struct<1:int> SELECT corr(DISTINCT x, y), udf(corr(DISTINCT y, x)), count(*) FROM (VALUES (1, 1), (2, 2), (2, 2)) t(x, y) -- !query schema -struct +struct -- !query output 1.0 1.0 3 @@ -255,7 +255,7 @@ struct +struct -- !query output 1 @@ -263,7 +263,7 @@ struct -- !query SELECT udf(udf(1)) FROM range(10) HAVING MAX(id) > 0 -- !query schema -struct +struct -- !query output 1 @@ -274,7 +274,7 @@ SELECT udf(id) FROM range(10) HAVING id > 0 struct<> -- !query output org.apache.spark.sql.AnalysisException -grouping expressions sequence is empty, and '`id`' is not an aggregate function. Wrap '()' in windowing function(s) or wrap '`id`' in first() (or first_value) if you don't care which value you get.; +grouping expressions sequence is empty, and 'id' is not an aggregate function. Wrap '()' in windowing function(s) or wrap 'id' in first() (or first_value) if you don't care which value you get. -- !query @@ -293,7 +293,7 @@ struct<> -- !query SELECT udf(every(v)), udf(some(v)), any(v) FROM test_agg WHERE 1 = 0 -- !query schema -struct +struct -- !query output NULL NULL NULL @@ -301,7 +301,7 @@ NULL NULL NULL -- !query SELECT udf(every(udf(v))), some(v), any(v) FROM test_agg WHERE k = 4 -- !query schema -struct +struct -- !query output NULL NULL NULL @@ -309,7 +309,7 @@ NULL NULL NULL -- !query SELECT every(v), udf(some(v)), any(v) FROM test_agg WHERE k = 5 -- !query schema -struct +struct -- !query output false true true @@ -317,7 +317,7 @@ false true true -- !query SELECT udf(k), every(v), udf(some(v)), any(v) FROM test_agg GROUP BY udf(k) -- !query schema -struct +struct -- !query output 1 false true true 2 true true true @@ -329,7 +329,7 @@ struct +struct -- !query output 1 false 3 false @@ -339,7 +339,7 @@ struct -- !query SELECT udf(k), udf(every(v)) FROM test_agg GROUP BY udf(k) HAVING every(v) IS NULL -- !query schema -struct +struct -- !query output 4 NULL @@ -354,7 +354,7 @@ WHERE k = 2 WHERE k = 1) GROUP BY udf(k) -- !query schema -struct +struct -- !query output 2 true @@ -369,7 +369,7 @@ WHERE k = 2 WHERE k = 1) GROUP BY udf(udf(k)) -- !query schema -struct +struct -- !query output @@ -430,7 +430,7 @@ struct +struct -- !query output 1 false false 1 true true @@ -447,7 +447,7 @@ struct +struct -- !query output 1 false false 1 true true @@ -464,7 +464,7 @@ struct 1L -- !query schema -struct +struct -- !query output 10 @@ -472,7 +472,7 @@ struct -- !query SELECT k, udf(max(v)) FROM test_agg GROUP BY k HAVING max(v) = true -- !query schema -struct +struct -- !query output 1 true 2 true @@ -496,7 +496,7 @@ org.apache.spark.sql.AnalysisException Aggregate/Window/Generate expressions are not valid in where clause of the query. Expression in where clause: [(count(1) > 1L)] -Invalid expressions: [count(1)]; +Invalid expressions: [count(1)] -- !query @@ -508,7 +508,7 @@ org.apache.spark.sql.AnalysisException Aggregate/Window/Generate expressions are not valid in where clause of the query. Expression in where clause: [((count(1) + 1L) > 1L)] -Invalid expressions: [count(1)]; +Invalid expressions: [count(1)] -- !query @@ -519,5 +519,5 @@ struct<> org.apache.spark.sql.AnalysisException Aggregate/Window/Generate expressions are not valid in where clause of the query. -Expression in where clause: [(((test_agg.`k` = 1) OR (test_agg.`k` = 2)) OR (((count(1) + 1L) > 1L) OR (max(test_agg.`k`) > 1)))] -Invalid expressions: [count(1), max(test_agg.`k`)]; +Expression in where clause: [(((test_agg.k = 1) OR (test_agg.k = 2)) OR (((count(1) + 1L) > 1L) OR (max(test_agg.k) > 1)))] +Invalid expressions: [count(1), max(test_agg.k)] diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-having.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-having.sql.out index 9be27bb77f81a..fb0a5b04dc1d7 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-having.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-having.sql.out @@ -18,7 +18,7 @@ struct<> -- !query SELECT udf(k) AS k, udf(sum(v)) FROM hav GROUP BY k HAVING udf(sum(v)) > 2 -- !query schema -struct +struct -- !query output one 6 three 3 @@ -27,7 +27,7 @@ three 3 -- !query SELECT udf(count(udf(k))) FROM hav GROUP BY v + 1 HAVING v + 1 = udf(2) -- !query schema -struct +struct -- !query output 1 @@ -35,7 +35,7 @@ struct 0) t HAVING(udf(COUNT(udf(1))) > 0) -- !query schema -struct +struct -- !query output 1 @@ -43,7 +43,7 @@ struct -- !query SELECT udf(a + b) FROM VALUES (1L, 2), (3L, 4) AS T(a, b) GROUP BY a + b HAVING a + b > udf(1) -- !query schema -struct +struct -- !query output 3 7 diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-inline-table.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-inline-table.sql.out index d78d347bc9802..78e9190820297 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-inline-table.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-inline-table.sql.out @@ -5,7 +5,7 @@ -- !query select udf(col1), udf(col2) from values ("one", 1) -- !query schema -struct +struct -- !query output one 1 @@ -13,7 +13,7 @@ one 1 -- !query select udf(col1), udf(udf(col2)) from values ("one", 1) as data -- !query schema -struct +struct -- !query output one 1 @@ -21,7 +21,7 @@ one 1 -- !query select udf(a), b from values ("one", 1) as data(a, b) -- !query schema -struct +struct -- !query output one 1 @@ -29,7 +29,7 @@ one 1 -- !query select udf(a) from values 1, 2, 3 as data(a) -- !query schema -struct +struct -- !query output 1 2 @@ -39,7 +39,7 @@ struct -- !query select udf(a), b from values ("one", 1), ("two", 2), ("three", null) as data(a, b) -- !query schema -struct +struct -- !query output one 1 three NULL @@ -49,7 +49,7 @@ two 2 -- !query select udf(a), b from values ("one", null), ("two", null) as data(a, b) -- !query schema -struct +struct -- !query output one NULL two NULL @@ -58,7 +58,7 @@ two NULL -- !query select udf(a), b from values ("one", 1), ("two", 2L) as data(a, b) -- !query schema -struct +struct -- !query output one 1 two 2 @@ -67,7 +67,7 @@ two 2 -- !query select udf(udf(a)), udf(b) from values ("one", 1 + 0), ("two", 1 + 3L) as data(a, b) -- !query schema -struct +struct -- !query output one 1 two 4 @@ -76,7 +76,7 @@ two 4 -- !query select udf(a), b from values ("one", array(0, 1)), ("two", array(2, 3)) as data(a, b) -- !query schema -struct> +struct> -- !query output one [0,1] two [2,3] @@ -85,7 +85,7 @@ two [2,3] -- !query select udf(a), b from values ("one", 2.0), ("two", 3.0D) as data(a, b) -- !query schema -struct +struct -- !query output one 2.0 two 3.0 @@ -148,6 +148,6 @@ cannot evaluate expression count(1) in inline table definition; line 1 pos 42 -- !query select udf(a), b from values (timestamp('1991-12-06 00:00:00.0'), array(timestamp('1991-12-06 01:00:00.0'), timestamp('1991-12-06 12:00:00.0'))) as data(a, b) -- !query schema -struct> +struct> -- !query output 1991-12-06 00:00:00 [1991-12-06 01:00:00,1991-12-06 12:00:00] diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-intersect-all.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-intersect-all.sql.out index b3735ae153267..f03e6c061a0e1 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-intersect-all.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-intersect-all.sql.out @@ -38,7 +38,7 @@ SELECT udf(k), v FROM tab1 INTERSECT ALL SELECT k, udf(v) FROM tab2 -- !query schema -struct +struct -- !query output 1 2 1 2 @@ -52,7 +52,7 @@ SELECT k, udf(v) FROM tab1 INTERSECT ALL SELECT udf(k), v FROM tab1 WHERE udf(k) = 1 -- !query schema -struct +struct -- !query output 1 2 1 2 @@ -65,7 +65,7 @@ SELECT udf(k), udf(v) FROM tab1 WHERE k > udf(2) INTERSECT ALL SELECT udf(k), udf(v) FROM tab2 -- !query schema -struct +struct -- !query output @@ -75,7 +75,7 @@ SELECT udf(k), v FROM tab1 INTERSECT ALL SELECT udf(k), v FROM tab2 WHERE udf(udf(k)) > 3 -- !query schema -struct +struct -- !query output @@ -85,7 +85,7 @@ SELECT udf(k), v FROM tab1 INTERSECT ALL SELECT CAST(udf(1) AS BIGINT), CAST(udf(2) AS BIGINT) -- !query schema -struct +struct -- !query output 1 2 @@ -98,7 +98,7 @@ SELECT array(1), udf(2) struct<> -- !query output org.apache.spark.sql.AnalysisException -IntersectAll can only be performed on tables with the compatible column types. array <> int at the first column of the second table; +IntersectAll can only be performed on tables with the compatible column types. array <> int at the first column of the second table -- !query @@ -109,7 +109,7 @@ SELECT udf(k), udf(v) FROM tab2 struct<> -- !query output org.apache.spark.sql.AnalysisException -IntersectAll can only be performed on tables with the same number of columns, but the first table has 1 columns and the second table has 2 columns; +IntersectAll can only be performed on tables with the same number of columns, but the first table has 1 columns and the second table has 2 columns -- !query @@ -119,7 +119,7 @@ SELECT k, udf(v) FROM tab1 INTERSECT ALL SELECT udf(k), udf(v) FROM tab2 -- !query schema -struct +struct -- !query output 1 2 1 2 @@ -137,7 +137,7 @@ SELECT k, udf(udf(v)) FROM tab1 INTERSECT ALL SELECT udf(k), v FROM tab2 -- !query schema -struct +struct -- !query output 1 2 1 2 @@ -156,7 +156,7 @@ SELECT k, udf(v) FROM tab1 INTERSECT ALL SELECT udf(k), udf(udf(v)) FROM tab2 -- !query schema -struct +struct -- !query output 1 3 @@ -176,7 +176,7 @@ struct +struct -- !query output @@ -196,7 +196,7 @@ FROM (SELECT udf(tab1.k), JOIN tab2 ON udf(tab1.k) = udf(udf(tab2.k))) -- !query schema -struct +struct -- !query output 1 2 1 2 @@ -224,7 +224,7 @@ FROM (SELECT udf(tab2.v) AS k, JOIN tab2 ON tab1.k = udf(tab2.k)) -- !query schema -struct +struct -- !query output @@ -234,7 +234,7 @@ SELECT udf(v) FROM tab1 GROUP BY v INTERSECT ALL SELECT udf(udf(k)) FROM tab2 GROUP BY k -- !query schema -struct +struct -- !query output 2 3 @@ -258,7 +258,7 @@ SELECT udf(k), udf(v) FROM tab1 INTERSECT ALL SELECT udf(udf(k)), udf(v) FROM tab2 -- !query schema -struct +struct -- !query output 1 2 1 2 @@ -276,7 +276,7 @@ SELECT udf(k), udf(v) FROM tab1 INTERSECT SELECT udf(k), udf(udf(v)) FROM tab2 -- !query schema -struct +struct -- !query output 1 2 2 3 diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-join-empty-relation.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-join-empty-relation.sql.out index 0802eb9a9f62b..94ac49588e3de 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-join-empty-relation.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-join-empty-relation.sql.out @@ -29,7 +29,7 @@ struct<> -- !query SELECT udf(t1.a), udf(empty_table.a) FROM t1 INNER JOIN empty_table ON (udf(t1.a) = udf(udf(empty_table.a))) -- !query schema -struct +struct -- !query output @@ -37,7 +37,7 @@ struct +struct -- !query output @@ -45,7 +45,7 @@ struct +struct -- !query output 1 NULL @@ -53,7 +53,7 @@ struct +struct -- !query output @@ -61,7 +61,7 @@ struct +struct -- !query output 1 NULL @@ -69,7 +69,7 @@ struct -- !query SELECT udf(udf(t1.a)) FROM t1 LEFT SEMI JOIN empty_table ON (udf(t1.a) = udf(udf(empty_table.a))) -- !query schema -struct +struct -- !query output @@ -77,7 +77,7 @@ struct +struct -- !query output 1 @@ -85,7 +85,7 @@ struct -- !query SELECT udf(empty_table.a), udf(t1.a) FROM empty_table INNER JOIN t1 ON (udf(udf(empty_table.a)) = udf(t1.a)) -- !query schema -struct +struct -- !query output @@ -93,7 +93,7 @@ struct +struct -- !query output @@ -101,7 +101,7 @@ struct +struct -- !query output @@ -109,7 +109,7 @@ struct +struct -- !query output NULL 1 @@ -117,7 +117,7 @@ NULL 1 -- !query SELECT empty_table.a, udf(udf(t1.a)) FROM empty_table FULL OUTER JOIN t1 ON (udf(empty_table.a) = udf(t1.a)) -- !query schema -struct +struct -- !query output NULL 1 @@ -125,7 +125,7 @@ NULL 1 -- !query SELECT udf(udf(empty_table.a)) FROM empty_table LEFT SEMI JOIN t1 ON (udf(empty_table.a) = udf(udf(t1.a))) -- !query schema -struct +struct -- !query output @@ -141,7 +141,7 @@ struct -- !query SELECT udf(empty_table.a) FROM empty_table INNER JOIN empty_table AS empty_table2 ON (udf(empty_table.a) = udf(udf(empty_table2.a))) -- !query schema -struct +struct -- !query output @@ -149,7 +149,7 @@ struct -- !query SELECT udf(udf(empty_table.a)) FROM empty_table CROSS JOIN empty_table AS empty_table2 ON (udf(udf(empty_table.a)) = udf(empty_table2.a)) -- !query schema -struct +struct -- !query output @@ -157,7 +157,7 @@ struct +struct -- !query output @@ -165,7 +165,7 @@ struct -- !query SELECT udf(udf(empty_table.a)) FROM empty_table RIGHT OUTER JOIN empty_table AS empty_table2 ON (udf(empty_table.a) = udf(udf(empty_table2.a))) -- !query schema -struct +struct -- !query output @@ -173,7 +173,7 @@ struct +struct -- !query output @@ -181,7 +181,7 @@ struct -- !query SELECT udf(udf(empty_table.a)) FROM empty_table LEFT SEMI JOIN empty_table AS empty_table2 ON (udf(empty_table.a) = udf(empty_table2.a)) -- !query schema -struct +struct -- !query output @@ -189,6 +189,6 @@ struct +struct -- !query output diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-natural-join.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-natural-join.sql.out index a8233a0e398b0..dd6ba9d6ddd86 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-natural-join.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-natural-join.sql.out @@ -59,6 +59,6 @@ two 2 22 -- !query SELECT udf(count(*)) FROM nt1 natural full outer join nt2 -- !query schema -struct +struct -- !query output 4 diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-outer-join.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-outer-join.sql.out index afebbb0c1da92..c9a3a519c5e0c 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-outer-join.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-outer-join.sql.out @@ -34,7 +34,7 @@ GROUP BY udf(GREATEST(COALESCE(udf(t2.int_col1), 109), COALESCE(t1.int_col1, udf HAVING (udf(SUM(COALESCE(udf(t1.int_col1), udf(t2.int_col0))))) > (udf(COALESCE(t1.int_col1, t2.int_col0)) * 2) -- !query schema -struct +struct -- !query output -367 -734 -507 -1014 diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-pivot.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-pivot.sql.out index 087b4ed9302d8..dc5cc29762657 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-pivot.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-pivot.sql.out @@ -47,7 +47,7 @@ PIVOT ( FOR course IN ('dotNET', 'Java') ) -- !query schema -struct +struct -- !query output 2012 15000 20000 2013 48000 30000 @@ -75,7 +75,7 @@ PIVOT ( FOR course IN ('dotNET', 'Java') ) -- !query schema -struct +struct -- !query output 2012 15000 7500.0 20000 20000.0 2013 48000 48000.0 30000 30000.0 @@ -104,7 +104,7 @@ PIVOT ( FOR course IN ('dotNET', 'Java') ) -- !query schema -struct +struct -- !query output 63000 2012 50000 2012 @@ -139,7 +139,7 @@ PIVOT ( FOR course IN ('dotNET', 'Java') ) -- !query schema -struct +struct -- !query output 2012 15000 1 20000 1 2013 48000 2 30000 2 @@ -202,7 +202,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Aggregate expression required for pivot, but 'coursesales.`earnings`' did not appear in any aggregate function.; +Aggregate expression required for pivot, but 'coursesales.earnings' did not appear in any aggregate function. -- !query @@ -217,7 +217,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Aggregate expression required for pivot, but '__auto_generated_subquery_name.`year`' did not appear in any aggregate function.; +Aggregate expression required for pivot, but '__auto_generated_subquery_name.year' did not appear in any aggregate function. -- !query @@ -232,7 +232,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`year`' given input columns: [__auto_generated_subquery_name.course, __auto_generated_subquery_name.earnings]; line 4 pos 0 +cannot resolve 'year' given input columns: [__auto_generated_subquery_name.course, __auto_generated_subquery_name.earnings]; line 4 pos 0 -- !query @@ -244,7 +244,7 @@ PIVOT ( FOR course IN ('dotNET', 'Java') ) -- !query schema -struct +struct -- !query output 2012 15000 7501.0 20000 20001.0 2013 48000 48001.0 30000 30001.0 @@ -262,7 +262,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -It is not allowed to use an aggregate function in the argument of another aggregate function. Please use the inner aggregate function in a sub-query.; +It is not allowed to use an aggregate function in the argument of another aggregate function. Please use the inner aggregate function in a sub-query. -- !query @@ -276,7 +276,7 @@ PIVOT ( FOR (course, year) IN (('dotNET', 2012), ('Java', 2013)) ) -- !query schema -struct +struct -- !query output 1 15000 NULL 2 NULL 30000 @@ -313,7 +313,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Invalid pivot value 'dotNET': value data type string does not match pivot column data type struct; +Invalid pivot value 'dotNET': value data type string does not match pivot column data type struct -- !query @@ -326,7 +326,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '`s`' given input columns: [coursesales.course, coursesales.earnings, coursesales.year]; line 4 pos 15 +cannot resolve 's' given input columns: [coursesales.course, coursesales.earnings, coursesales.year]; line 4 pos 15 -- !query @@ -339,7 +339,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Literal expressions required for pivot values, found 'course#x'; +Literal expressions required for pivot values, found 'course#x' -- !query @@ -370,7 +370,7 @@ PIVOT ( FOR (course, a) IN (('dotNET', array(1, 1)), ('Java', array(2, 2))) ) -- !query schema -struct +struct -- !query output 2012 15000 NULL 2013 NULL 30000 @@ -387,7 +387,7 @@ PIVOT ( FOR s IN ((1, 'a'), (2, 'b')) ) -- !query schema -struct +struct -- !query output 2012 35000 NULL 2013 NULL 78000 @@ -404,7 +404,7 @@ PIVOT ( FOR (course, s) IN (('dotNET', (1, 'a')), ('Java', (2, 'b'))) ) -- !query schema -struct +struct -- !query output 2012 15000 NULL 2013 NULL 30000 @@ -424,7 +424,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Invalid pivot column 'm#x'. Pivot columns must be comparable.; +Invalid pivot column 'm#x'. Pivot columns must be comparable. -- !query @@ -441,7 +441,7 @@ PIVOT ( struct<> -- !query output org.apache.spark.sql.AnalysisException -Invalid pivot column 'named_struct(course, course#x, m, m#x)'. Pivot columns must be comparable.; +Invalid pivot column 'named_struct(course, course#x, m, m#x)'. Pivot columns must be comparable. -- !query diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-special-values.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-special-values.sql.out index 5e5c79172bb7a..f7e1874477eb2 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-special-values.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-special-values.sql.out @@ -5,7 +5,7 @@ -- !query SELECT udf(x) FROM (VALUES (1), (2), (NULL)) v(x) -- !query schema -struct +struct -- !query output 1 2 @@ -15,7 +15,7 @@ NULL -- !query SELECT udf(x) FROM (VALUES ('A'), ('B'), (NULL)) v(x) -- !query schema -struct +struct -- !query output A B @@ -25,7 +25,7 @@ NULL -- !query SELECT udf(x) FROM (VALUES ('NaN'), ('1'), ('2')) v(x) -- !query schema -struct +struct -- !query output 1 2 @@ -35,7 +35,7 @@ NaN -- !query SELECT udf(x) FROM (VALUES ('Infinity'), ('1'), ('2')) v(x) -- !query schema -struct +struct -- !query output 1 2 @@ -45,7 +45,7 @@ Infinity -- !query SELECT udf(x) FROM (VALUES ('-Infinity'), ('1'), ('2')) v(x) -- !query schema -struct +struct -- !query output -Infinity 1 @@ -55,7 +55,7 @@ struct -- !query SELECT udf(x) FROM (VALUES 0.00000001, 0.00000002, 0.00000003) v(x) -- !query schema -struct +struct -- !query output 0.00000001 0.00000002 diff --git a/sql/core/src/test/resources/sql-tests/results/udf/udf-window.sql.out b/sql/core/src/test/resources/sql-tests/results/udf/udf-window.sql.out index a915c1bd6c717..d4c857d969163 100644 --- a/sql/core/src/test/resources/sql-tests/results/udf/udf-window.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/udf/udf-window.sql.out @@ -4,15 +4,15 @@ -- !query CREATE OR REPLACE TEMPORARY VIEW testData AS SELECT * FROM VALUES -(null, 1L, 1.0D, date("2017-08-01"), timestamp(1501545600), "a"), -(1, 1L, 1.0D, date("2017-08-01"), timestamp(1501545600), "a"), -(1, 2L, 2.5D, date("2017-08-02"), timestamp(1502000000), "a"), -(2, 2147483650L, 100.001D, date("2020-12-31"), timestamp(1609372800), "a"), -(1, null, 1.0D, date("2017-08-01"), timestamp(1501545600), "b"), -(2, 3L, 3.3D, date("2017-08-03"), timestamp(1503000000), "b"), -(3, 2147483650L, 100.001D, date("2020-12-31"), timestamp(1609372800), "b"), +(null, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "a"), +(1, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "a"), +(1, 2L, 2.5D, date("2017-08-02"), timestamp_seconds(1502000000), "a"), +(2, 2147483650L, 100.001D, date("2020-12-31"), timestamp_seconds(1609372800), "a"), +(1, null, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "b"), +(2, 3L, 3.3D, date("2017-08-03"), timestamp_seconds(1503000000), "b"), +(3, 2147483650L, 100.001D, date("2020-12-31"), timestamp_seconds(1609372800), "b"), (null, null, null, null, null, null), -(3, 1L, 1.0D, date("2017-08-01"), timestamp(1501545600), null) +(3, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), null) AS testData(val, val_long, val_double, val_date, val_timestamp, cate) -- !query schema struct<> @@ -24,7 +24,7 @@ struct<> SELECT udf(val), cate, count(val) OVER(PARTITION BY cate ORDER BY udf(val) ROWS CURRENT ROW) FROM testData ORDER BY cate, udf(val) -- !query schema -struct +struct -- !query output NULL NULL 0 3 NULL 1 @@ -41,7 +41,7 @@ NULL a 0 SELECT udf(val), cate, sum(val) OVER(PARTITION BY cate ORDER BY udf(val) ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING) FROM testData ORDER BY cate, udf(val) -- !query schema -struct +struct -- !query output NULL NULL 3 3 NULL 3 @@ -68,7 +68,7 @@ cannot resolve 'ROWS BETWEEN CURRENT ROW AND 2147483648L FOLLOWING' due to data SELECT udf(val), cate, count(val) OVER(PARTITION BY udf(cate) ORDER BY val RANGE 1 PRECEDING) FROM testData ORDER BY cate, udf(val) -- !query schema -struct +struct -- !query output NULL NULL 0 3 NULL 1 @@ -85,7 +85,7 @@ NULL a 0 SELECT val, udf(cate), sum(val) OVER(PARTITION BY udf(cate) ORDER BY val RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM testData ORDER BY udf(cate), val -- !query schema -struct +struct -- !query output NULL NULL NULL 3 NULL 3 @@ -102,7 +102,7 @@ NULL a NULL SELECT val_long, udf(cate), sum(val_long) OVER(PARTITION BY udf(cate) ORDER BY val_long RANGE BETWEEN CURRENT ROW AND 2147483648 FOLLOWING) FROM testData ORDER BY udf(cate), val_long -- !query schema -struct +struct -- !query output NULL NULL NULL 1 NULL 1 @@ -119,7 +119,7 @@ NULL b NULL SELECT val_double, udf(cate), sum(val_double) OVER(PARTITION BY udf(cate) ORDER BY val_double RANGE BETWEEN CURRENT ROW AND 2.5 FOLLOWING) FROM testData ORDER BY udf(cate), val_double -- !query schema -struct +struct -- !query output NULL NULL NULL 1.0 NULL 1.0 @@ -136,7 +136,7 @@ NULL NULL NULL SELECT val_date, udf(cate), max(val_date) OVER(PARTITION BY udf(cate) ORDER BY val_date RANGE BETWEEN CURRENT ROW AND 2 FOLLOWING) FROM testData ORDER BY udf(cate), val_date -- !query schema -struct +struct -- !query output NULL NULL NULL 2017-08-01 NULL 2017-08-01 @@ -154,7 +154,7 @@ SELECT val_timestamp, udf(cate), avg(val_timestamp) OVER(PARTITION BY udf(cate) RANGE BETWEEN CURRENT ROW AND interval 23 days 4 hours FOLLOWING) FROM testData ORDER BY udf(cate), val_timestamp -- !query schema -struct +struct -- !query output NULL NULL NULL 2017-07-31 17:00:00 NULL 1.5015456E9 @@ -171,7 +171,7 @@ NULL NULL NULL SELECT val, udf(cate), sum(val) OVER(PARTITION BY cate ORDER BY val DESC RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM testData ORDER BY cate, val -- !query schema -struct +struct -- !query output NULL NULL NULL 3 NULL 3 @@ -211,7 +211,7 @@ RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM testData ORDER BY cate, udf(val) struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(PARTITION BY CAST(udf(cast(cate as string)) AS STRING) ORDER BY CAST(udf(cast(val as string)) AS INT) ASC NULLS FIRST, testdata.`cate` ASC NULLS FIRST RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING)' due to data type mismatch: A range window frame with value boundaries cannot be used in a window specification with multiple order by expressions: cast(udf(cast(val#x as string)) as int) ASC NULLS FIRST,cate#x ASC NULLS FIRST; line 1 pos 38 +cannot resolve '(PARTITION BY CAST(udf(cast(cate as string)) AS STRING) ORDER BY CAST(udf(cast(val as string)) AS INT) ASC NULLS FIRST, testdata.cate ASC NULLS FIRST RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING)' due to data type mismatch: A range window frame with value boundaries cannot be used in a window specification with multiple order by expressions: cast(udf(cast(val#x as string)) as int) ASC NULLS FIRST,cate#x ASC NULLS FIRST; line 1 pos 38 -- !query @@ -286,23 +286,23 @@ FROM testData WINDOW w AS (PARTITION BY udf(cate) ORDER BY udf(val)) ORDER BY cate, udf(val) -- !query schema -struct,collect_set:array,skewness:double,kurtosis:double> +struct,collect_set:array,skewness:double,kurtosis:double> -- !query output NULL NULL NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1 0.5 0.0 1 1 NULL NULL 0 NULL NULL NULL NULL [] [] NULL NULL -3 NULL 3 3 3 1 3 3.0 NaN NULL 3 NULL 3 3 3 2 2 1.0 1.0 2 2 0.0 NaN 1 0.0 NaN NaN 0.0 [3] [3] NaN NaN -NULL a NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1 0.25 0.0 1 1 NULL NULL 0 NULL NULL NULL NULL [] [] NaN NaN +3 NULL 3 3 3 1 3 3.0 NULL NULL 3 NULL 3 3 3 2 2 1.0 1.0 2 2 0.0 NULL 1 0.0 NULL NULL 0.0 [3] [3] NULL NULL +NULL a NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1 0.25 0.0 1 1 NULL NULL 0 NULL NULL NULL NULL [] [] NULL NULL 1 a 1 1 1 2 2 1.0 0.0 NULL 1 NULL 1 1 1 2 2 0.75 0.3333333333333333 1 2 0.0 0.0 1 0.0 NULL 0.0 0.0 [1,1] [1] 0.7071067811865476 -1.5 1 a 1 1 1 2 2 1.0 0.0 NULL 1 NULL 1 1 1 2 2 0.75 0.3333333333333333 2 3 0.0 0.0 1 0.0 NULL 0.0 0.0 [1,1] [1] 0.7071067811865476 -1.5 2 a 2 1 1 3 4 1.3333333333333333 0.5773502691896258 NULL 1 NULL 2 2 2 4 3 1.0 1.0 2 4 0.22222222222222224 0.33333333333333337 2 4.772185885555555E8 1.0 0.5773502691896258 0.4714045207910317 [1,1,2] [1,2] 1.1539890888012805 -0.6672217220327235 -1 b 1 1 1 1 1 1.0 NaN 1 1 1 1 1 1 1 1 0.3333333333333333 0.0 1 1 0.0 NaN 1 NULL NULL NaN 0.0 [1] [1] NaN NaN -2 b 2 1 1 2 3 1.5 0.7071067811865476 1 1 1 2 2 2 2 2 0.6666666666666666 0.5 1 2 0.25 0.5 2 0.0 NaN 0.7071067811865476 0.5 [1,2] [1,2] 0.0 -2.0000000000000013 +1 b 1 1 1 1 1 1.0 NULL 1 1 1 1 1 1 1 1 0.3333333333333333 0.0 1 1 0.0 NULL 1 NULL NULL NULL 0.0 [1] [1] NULL NULL +2 b 2 1 1 2 3 1.5 0.7071067811865476 1 1 1 2 2 2 2 2 0.6666666666666666 0.5 1 2 0.25 0.5 2 0.0 NULL 0.7071067811865476 0.5 [1,2] [1,2] 0.0 -2.0000000000000013 3 b 3 1 1 3 6 2.0 1.0 1 1 1 3 3 3 3 3 1.0 1.0 2 3 0.6666666666666666 1.0 3 5.3687091175E8 1.0 1.0 0.816496580927726 [1,2,3] [1,2,3] 0.7057890433107311 -1.4999999999999984 -- !query SELECT udf(val), cate, avg(null) OVER(PARTITION BY cate ORDER BY val) FROM testData ORDER BY cate, val -- !query schema -struct +struct -- !query output NULL NULL NULL 3 NULL NULL @@ -321,13 +321,13 @@ SELECT udf(val), cate, row_number() OVER(PARTITION BY cate) FROM testData ORDER struct<> -- !query output org.apache.spark.sql.AnalysisException -Window function row_number() requires window to be ordered, please add ORDER BY clause. For example SELECT row_number()(value_expr) OVER (PARTITION BY window_partition ORDER BY window_ordering) from table; +Window function row_number() requires window to be ordered, please add ORDER BY clause. For example SELECT row_number()(value_expr) OVER (PARTITION BY window_partition ORDER BY window_ordering) from table -- !query SELECT udf(val), cate, sum(val) OVER(), avg(val) OVER() FROM testData ORDER BY cate, val -- !query schema -struct +struct -- !query output NULL NULL 13 1.8571428571428572 3 NULL 13 1.8571428571428572 @@ -352,7 +352,7 @@ FROM testData WINDOW w AS () ORDER BY cate, val -- !query schema -struct +struct -- !query output NULL NULL false true false false true false 3 NULL false true false false true false @@ -371,7 +371,7 @@ FROM testData WHERE val is not null WINDOW w AS (PARTITION BY cate ORDER BY val) -- !query schema -struct +struct -- !query output NULL 3 a 2 diff --git a/sql/core/src/test/resources/sql-tests/results/union.sql.out b/sql/core/src/test/resources/sql-tests/results/union.sql.out index 44002406836a4..ce3c761bc5d2d 100644 --- a/sql/core/src/test/resources/sql-tests/results/union.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/union.sql.out @@ -1,5 +1,5 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 16 +-- Number of queries: 20 -- !query @@ -126,6 +126,39 @@ struct,str:string> [1,2] str +-- !query +CREATE OR REPLACE TEMPORARY VIEW t3 AS VALUES (decimal(1)) tbl(v) +-- !query schema +struct<> +-- !query output + + + +-- !query +SELECT t.v FROM ( + SELECT v FROM t3 + UNION ALL + SELECT v + v AS v FROM t3 +) t +-- !query schema +struct +-- !query output +1 +2 + + +-- !query +SELECT SUM(t.v) FROM ( + SELECT v FROM t3 + UNION + SELECT v + v AS v FROM t3 +) t +-- !query schema +struct +-- !query output +3 + + -- !query DROP VIEW IF EXISTS t1 -- !query schema @@ -142,6 +175,14 @@ struct<> +-- !query +DROP VIEW IF EXISTS t3 +-- !query schema +struct<> +-- !query output + + + -- !query DROP VIEW IF EXISTS p1 -- !query schema diff --git a/sql/core/src/test/resources/sql-tests/results/using-join.sql.out b/sql/core/src/test/resources/sql-tests/results/using-join.sql.out new file mode 100644 index 0000000000000..1d2ae9d96ecad --- /dev/null +++ b/sql/core/src/test/resources/sql-tests/results/using-join.sql.out @@ -0,0 +1,338 @@ +-- Automatically generated by SQLQueryTestSuite +-- Number of queries: 31 + + +-- !query +create temporary view nt1 as select * from values + ("one", 1), + ("two", 2), + ("three", 3) + as nt1(k, v1) +-- !query schema +struct<> +-- !query output + + + +-- !query +create temporary view nt2 as select * from values + ("one", 1), + ("two", 22), + ("one", 5), + ("four", 4) + as nt2(k, v2) +-- !query schema +struct<> +-- !query output + + + +-- !query +SELECT * FROM nt1 left outer join nt2 using (k) +-- !query schema +struct +-- !query output +one 1 1 +one 1 5 +three 3 NULL +two 2 22 + + +-- !query +SELECT k FROM nt1 left outer join nt2 using (k) +-- !query schema +struct +-- !query output +one +one +three +two + + +-- !query +SELECT nt1.*, nt2.* FROM nt1 left outer join nt2 using (k) +-- !query schema +struct +-- !query output +one 1 one 1 +one 1 one 5 +three 3 NULL NULL +two 2 two 22 + + +-- !query +SELECT nt1.k, nt2.k FROM nt1 left outer join nt2 using (k) +-- !query schema +struct +-- !query output +one one +one one +three NULL +two two + + +-- !query +SELECT k, nt1.k FROM nt1 left outer join nt2 using (k) +-- !query schema +struct +-- !query output +one one +one one +three three +two two + + +-- !query +SELECT k, nt2.k FROM nt1 left outer join nt2 using (k) +-- !query schema +struct +-- !query output +one one +one one +three NULL +two two + + +-- !query +SELECT * FROM nt1 left semi join nt2 using (k) +-- !query schema +struct +-- !query output +one 1 +two 2 + + +-- !query +SELECT k FROM nt1 left semi join nt2 using (k) +-- !query schema +struct +-- !query output +one +two + + +-- !query +SELECT nt1.* FROM nt1 left semi join nt2 using (k) +-- !query schema +struct +-- !query output +one 1 +two 2 + + +-- !query +SELECT nt1.k FROM nt1 left semi join nt2 using (k) +-- !query schema +struct +-- !query output +one +two + + +-- !query +SELECT k, nt1.k FROM nt1 left semi join nt2 using (k) +-- !query schema +struct +-- !query output +one one +two two + + +-- !query +SELECT * FROM nt1 right outer join nt2 using (k) +-- !query schema +struct +-- !query output +four NULL 4 +one 1 1 +one 1 5 +two 2 22 + + +-- !query +SELECT k FROM nt1 right outer join nt2 using (k) +-- !query schema +struct +-- !query output +four +one +one +two + + +-- !query +SELECT nt1.*, nt2.* FROM nt1 right outer join nt2 using (k) +-- !query schema +struct +-- !query output +NULL NULL four 4 +one 1 one 1 +one 1 one 5 +two 2 two 22 + + +-- !query +SELECT nt1.k, nt2.k FROM nt1 right outer join nt2 using (k) +-- !query schema +struct +-- !query output +NULL four +one one +one one +two two + + +-- !query +SELECT k, nt1.k FROM nt1 right outer join nt2 using (k) +-- !query schema +struct +-- !query output +four NULL +one one +one one +two two + + +-- !query +SELECT k, nt2.k FROM nt1 right outer join nt2 using (k) +-- !query schema +struct +-- !query output +four four +one one +one one +two two + + +-- !query +SELECT * FROM nt1 full outer join nt2 using (k) +-- !query schema +struct +-- !query output +four NULL 4 +one 1 1 +one 1 5 +three 3 NULL +two 2 22 + + +-- !query +SELECT k FROM nt1 full outer join nt2 using (k) +-- !query schema +struct +-- !query output +four +one +one +three +two + + +-- !query +SELECT nt1.*, nt2.* FROM nt1 full outer join nt2 using (k) +-- !query schema +struct +-- !query output +NULL NULL four 4 +one 1 one 1 +one 1 one 5 +three 3 NULL NULL +two 2 two 22 + + +-- !query +SELECT nt1.k, nt2.k FROM nt1 full outer join nt2 using (k) +-- !query schema +struct +-- !query output +NULL four +one one +one one +three NULL +two two + + +-- !query +SELECT k, nt1.k FROM nt1 full outer join nt2 using (k) +-- !query schema +struct +-- !query output +four NULL +one one +one one +three three +two two + + +-- !query +SELECT k, nt2.k FROM nt1 full outer join nt2 using (k) +-- !query schema +struct +-- !query output +four four +one one +one one +three NULL +two two + + +-- !query +SELECT * FROM nt1 full outer join nt2 using (k) +-- !query schema +struct +-- !query output +four NULL 4 +one 1 1 +one 1 5 +three 3 NULL +two 2 22 + + +-- !query +SELECT k FROM nt1 inner join nt2 using (k) +-- !query schema +struct +-- !query output +one +one +two + + +-- !query +SELECT nt1.*, nt2.* FROM nt1 inner join nt2 using (k) +-- !query schema +struct +-- !query output +one 1 one 1 +one 1 one 5 +two 2 two 22 + + +-- !query +SELECT nt1.k, nt2.k FROM nt1 inner join nt2 using (k) +-- !query schema +struct +-- !query output +one one +one one +two two + + +-- !query +SELECT k, nt1.k FROM nt1 inner join nt2 using (k) +-- !query schema +struct +-- !query output +one one +one one +two two + + +-- !query +SELECT k, nt2.k FROM nt1 inner join nt2 using (k) +-- !query schema +struct +-- !query output +one one +one one +two two diff --git a/sql/core/src/test/resources/sql-tests/results/window.sql.out b/sql/core/src/test/resources/sql-tests/results/window.sql.out index 625088f90ced9..b3f9e6cb6132c 100644 --- a/sql/core/src/test/resources/sql-tests/results/window.sql.out +++ b/sql/core/src/test/resources/sql-tests/results/window.sql.out @@ -1,18 +1,18 @@ -- Automatically generated by SQLQueryTestSuite --- Number of queries: 24 +-- Number of queries: 50 -- !query CREATE OR REPLACE TEMPORARY VIEW testData AS SELECT * FROM VALUES -(null, 1L, 1.0D, date("2017-08-01"), timestamp(1501545600), "a"), -(1, 1L, 1.0D, date("2017-08-01"), timestamp(1501545600), "a"), -(1, 2L, 2.5D, date("2017-08-02"), timestamp(1502000000), "a"), -(2, 2147483650L, 100.001D, date("2020-12-31"), timestamp(1609372800), "a"), -(1, null, 1.0D, date("2017-08-01"), timestamp(1501545600), "b"), -(2, 3L, 3.3D, date("2017-08-03"), timestamp(1503000000), "b"), -(3, 2147483650L, 100.001D, date("2020-12-31"), timestamp(1609372800), "b"), +(null, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "a"), +(1, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "a"), +(1, 2L, 2.5D, date("2017-08-02"), timestamp_seconds(1502000000), "a"), +(2, 2147483650L, 100.001D, date("2020-12-31"), timestamp_seconds(1609372800), "a"), +(1, null, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), "b"), +(2, 3L, 3.3D, date("2017-08-03"), timestamp_seconds(1503000000), "b"), +(3, 2147483650L, 100.001D, date("2020-12-31"), timestamp_seconds(1609372800), "b"), (null, null, null, null, null, null), -(3, 1L, 1.0D, date("2017-08-01"), timestamp(1501545600), null) +(3, 1L, 1.0D, date("2017-08-01"), timestamp_seconds(1501545600), null) AS testData(val, val_long, val_double, val_date, val_timestamp, cate) -- !query schema struct<> @@ -20,6 +20,50 @@ struct<> +-- !query +CREATE OR REPLACE TEMPORARY VIEW basic_pays AS SELECT * FROM VALUES +('Diane Murphy','Accounting',8435), +('Mary Patterson','Accounting',9998), +('Jeff Firrelli','Accounting',8992), +('William Patterson','Accounting',8870), +('Gerard Bondur','Accounting',11472), +('Anthony Bow','Accounting',6627), +('Leslie Jennings','IT',8113), +('Leslie Thompson','IT',5186), +('Julie Firrelli','Sales',9181), +('Steve Patterson','Sales',9441), +('Foon Yue Tseng','Sales',6660), +('George Vanauf','Sales',10563), +('Loui Bondur','SCM',10449), +('Gerard Hernandez','SCM',6949), +('Pamela Castillo','SCM',11303), +('Larry Bott','SCM',11798), +('Barry Jones','SCM',10586) +AS basic_pays(employee_name, department, salary) +-- !query schema +struct<> +-- !query output + + + +-- !query +CREATE OR REPLACE TEMPORARY VIEW test_ignore_null AS SELECT * FROM VALUES +('a', 0, null), +('a', 1, 'x'), +('b', 2, null), +('c', 3, null), +('a', 4, 'y'), +('b', 5, null), +('a', 6, 'z'), +('a', 7, 'v'), +('a', 8, null) +AS test_ignore_null(content, id, v) +-- !query schema +struct<> +-- !query output + + + -- !query SELECT val, cate, count(val) OVER(PARTITION BY cate ORDER BY val ROWS CURRENT ROW) FROM testData ORDER BY cate, val @@ -119,7 +163,7 @@ NULL b NULL SELECT val_double, cate, sum(val_double) OVER(PARTITION BY cate ORDER BY val_double RANGE BETWEEN CURRENT ROW AND 2.5 FOLLOWING) FROM testData ORDER BY cate, val_double -- !query schema -struct +struct -- !query output NULL NULL NULL 1.0 NULL 1.0 @@ -154,7 +198,7 @@ SELECT val_timestamp, cate, avg(val_timestamp) OVER(PARTITION BY cate ORDER BY v RANGE BETWEEN CURRENT ROW AND interval 23 days 4 hours FOLLOWING) FROM testData ORDER BY cate, val_timestamp -- !query schema -struct +struct -- !query output NULL NULL NULL 2017-07-31 17:00:00 NULL 1.5015456E9 @@ -167,6 +211,71 @@ NULL NULL NULL 2020-12-30 16:00:00 b 1.6093728E9 +-- !query +SELECT val_timestamp, cate, avg(val_timestamp) OVER(PARTITION BY cate ORDER BY val_timestamp +RANGE BETWEEN CURRENT ROW AND interval '1-1' year to month FOLLOWING) FROM testData +ORDER BY cate, val_timestamp +-- !query schema +struct +-- !query output +NULL NULL NULL +2017-07-31 17:00:00 NULL 1.5015456E9 +2017-07-31 17:00:00 a 1.5016970666666667E9 +2017-07-31 17:00:00 a 1.5016970666666667E9 +2017-08-05 23:13:20 a 1.502E9 +2020-12-30 16:00:00 a 1.6093728E9 +2017-07-31 17:00:00 b 1.5022728E9 +2017-08-17 13:00:00 b 1.503E9 +2020-12-30 16:00:00 b 1.6093728E9 + + +-- !query +SELECT val_timestamp, cate, avg(val_timestamp) OVER(PARTITION BY cate ORDER BY val_timestamp +RANGE BETWEEN CURRENT ROW AND interval '1 2:3:4.001' day to second FOLLOWING) FROM testData +ORDER BY cate, val_timestamp +-- !query schema +struct +-- !query output +NULL NULL NULL +2017-07-31 17:00:00 NULL 1.5015456E9 +2017-07-31 17:00:00 a 1.5015456E9 +2017-07-31 17:00:00 a 1.5015456E9 +2017-08-05 23:13:20 a 1.502E9 +2020-12-30 16:00:00 a 1.6093728E9 +2017-07-31 17:00:00 b 1.5015456E9 +2017-08-17 13:00:00 b 1.503E9 +2020-12-30 16:00:00 b 1.6093728E9 + + +-- !query +SELECT val_date, cate, avg(val_timestamp) OVER(PARTITION BY cate ORDER BY val_date +RANGE BETWEEN CURRENT ROW AND interval '1-1' year to month FOLLOWING) FROM testData +ORDER BY cate, val_date +-- !query schema +struct +-- !query output +NULL NULL NULL +2017-08-01 NULL 1.5015456E9 +2017-08-01 a 1.5016970666666667E9 +2017-08-01 a 1.5016970666666667E9 +2017-08-02 a 1.502E9 +2020-12-31 a 1.6093728E9 +2017-08-01 b 1.5022728E9 +2017-08-03 b 1.503E9 +2020-12-31 b 1.6093728E9 + + +-- !query +SELECT val_date, cate, avg(val_timestamp) OVER(PARTITION BY cate ORDER BY val_date +RANGE BETWEEN CURRENT ROW AND interval '1 2:3:4.001' day to second FOLLOWING) FROM testData +ORDER BY cate, val_date +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.AnalysisException +cannot resolve '(PARTITION BY testdata.cate ORDER BY testdata.val_date ASC NULLS FIRST RANGE BETWEEN CURRENT ROW AND INTERVAL '1 02:03:04.001' DAY TO SECOND FOLLOWING)' due to data type mismatch: The data type 'date' used in the order specification does not match the data type 'interval day to second' which is used in the range frame.; line 1 pos 46 + + -- !query SELECT val, cate, sum(val) OVER(PARTITION BY cate ORDER BY val DESC RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM testData ORDER BY cate, val @@ -201,7 +310,7 @@ RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM testData ORDER BY cate, val struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(PARTITION BY testdata.`cate` RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING)' due to data type mismatch: A range window frame cannot be used in an unordered window specification.; line 1 pos 33 +cannot resolve '(PARTITION BY testdata.cate RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING)' due to data type mismatch: A range window frame cannot be used in an unordered window specification.; line 1 pos 33 -- !query @@ -211,7 +320,7 @@ RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM testData ORDER BY cate, val struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(PARTITION BY testdata.`cate` ORDER BY testdata.`val` ASC NULLS FIRST, testdata.`cate` ASC NULLS FIRST RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING)' due to data type mismatch: A range window frame with value boundaries cannot be used in a window specification with multiple order by expressions: val#x ASC NULLS FIRST,cate#x ASC NULLS FIRST; line 1 pos 33 +cannot resolve '(PARTITION BY testdata.cate ORDER BY testdata.val ASC NULLS FIRST, testdata.cate ASC NULLS FIRST RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING)' due to data type mismatch: A range window frame with value boundaries cannot be used in a window specification with multiple order by expressions: val#x ASC NULLS FIRST,cate#x ASC NULLS FIRST; line 1 pos 33 -- !query @@ -221,7 +330,7 @@ RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING) FROM testData ORDER BY cate, val struct<> -- !query output org.apache.spark.sql.AnalysisException -cannot resolve '(PARTITION BY testdata.`cate` ORDER BY current_timestamp() ASC NULLS FIRST RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING)' due to data type mismatch: The data type 'timestamp' used in the order specification does not match the data type 'int' which is used in the range frame.; line 1 pos 33 +cannot resolve '(PARTITION BY testdata.cate ORDER BY current_timestamp() ASC NULLS FIRST RANGE BETWEEN CURRENT ROW AND 1 FOLLOWING)' due to data type mismatch: The data type 'timestamp' used in the order specification does not match the data type 'int' which is used in the range frame.; line 1 pos 33 -- !query @@ -289,20 +398,20 @@ ORDER BY cate, val struct,collect_set:array,skewness:double,kurtosis:double> -- !query output NULL NULL NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1 0.5 0.0 1 1 NULL NULL 0 NULL NULL NULL NULL [] [] NULL NULL -3 NULL 3 3 3 1 3 3.0 NaN NULL 3 NULL 3 3 3 2 2 1.0 1.0 2 2 0.0 NaN 1 0.0 NaN NaN 0.0 [3] [3] NaN NaN -NULL a NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1 0.25 0.0 1 1 NULL NULL 0 NULL NULL NULL NULL [] [] NaN NaN +3 NULL 3 3 3 1 3 3.0 NULL NULL 3 NULL 3 3 3 2 2 1.0 1.0 2 2 0.0 NULL 1 0.0 NULL NULL 0.0 [3] [3] NULL NULL +NULL a NULL NULL NULL 0 NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1 0.25 0.0 1 1 NULL NULL 0 NULL NULL NULL NULL [] [] NULL NULL 1 a 1 1 1 2 2 1.0 0.0 NULL 1 NULL 1 1 1 2 2 0.75 0.3333333333333333 1 2 0.0 0.0 1 0.0 NULL 0.0 0.0 [1,1] [1] 0.7071067811865476 -1.5 1 a 1 1 1 2 2 1.0 0.0 NULL 1 NULL 1 1 1 2 2 0.75 0.3333333333333333 2 3 0.0 0.0 1 0.0 NULL 0.0 0.0 [1,1] [1] 0.7071067811865476 -1.5 2 a 2 1 1 3 4 1.3333333333333333 0.5773502691896258 NULL 1 NULL 2 2 2 4 3 1.0 1.0 2 4 0.22222222222222224 0.33333333333333337 2 4.772185885555555E8 1.0 0.5773502691896258 0.4714045207910317 [1,1,2] [1,2] 1.1539890888012805 -0.6672217220327235 -1 b 1 1 1 1 1 1.0 NaN 1 1 1 1 1 1 1 1 0.3333333333333333 0.0 1 1 0.0 NaN 1 NULL NULL NaN 0.0 [1] [1] NaN NaN -2 b 2 1 1 2 3 1.5 0.7071067811865476 1 1 1 2 2 2 2 2 0.6666666666666666 0.5 1 2 0.25 0.5 2 0.0 NaN 0.7071067811865476 0.5 [1,2] [1,2] 0.0 -2.0000000000000013 +1 b 1 1 1 1 1 1.0 NULL 1 1 1 1 1 1 1 1 0.3333333333333333 0.0 1 1 0.0 NULL 1 NULL NULL NULL 0.0 [1] [1] NULL NULL +2 b 2 1 1 2 3 1.5 0.7071067811865476 1 1 1 2 2 2 2 2 0.6666666666666666 0.5 1 2 0.25 0.5 2 0.0 NULL 0.7071067811865476 0.5 [1,2] [1,2] 0.0 -2.0000000000000013 3 b 3 1 1 3 6 2.0 1.0 1 1 1 3 3 3 3 3 1.0 1.0 2 3 0.6666666666666666 1.0 3 5.3687091175E8 1.0 1.0 0.816496580927726 [1,2,3] [1,2,3] 0.7057890433107311 -1.4999999999999984 -- !query SELECT val, cate, avg(null) OVER(PARTITION BY cate ORDER BY val) FROM testData ORDER BY cate, val -- !query schema -struct +struct -- !query output NULL NULL NULL 3 NULL NULL @@ -321,13 +430,13 @@ SELECT val, cate, row_number() OVER(PARTITION BY cate) FROM testData ORDER BY ca struct<> -- !query output org.apache.spark.sql.AnalysisException -Window function row_number() requires window to be ordered, please add ORDER BY clause. For example SELECT row_number()(value_expr) OVER (PARTITION BY window_partition ORDER BY window_ordering) from table; +Window function row_number() requires window to be ordered, please add ORDER BY clause. For example SELECT row_number()(value_expr) OVER (PARTITION BY window_partition ORDER BY window_ordering) from table -- !query SELECT val, cate, sum(val) OVER(), avg(val) OVER() FROM testData ORDER BY cate, val -- !query schema -struct +struct -- !query output NULL NULL 13 1.8571428571428572 3 NULL 13 1.8571428571428572 @@ -371,7 +480,7 @@ FROM testData WHERE val is not null WINDOW w AS (PARTITION BY cate ORDER BY val) -- !query schema -struct +struct -- !query output NULL 3 a 2 @@ -390,4 +499,623 @@ FROM testData ORDER BY cate, val struct<> -- !query output org.apache.spark.sql.AnalysisException -window aggregate function with filter predicate is not supported yet.; +window aggregate function with filter predicate is not supported yet. + + +-- !query +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC) +ORDER BY salary DESC +-- !query schema +struct +-- !query output +Larry Bott 11798 Larry Bott NULL +Gerard Bondur 11472 Larry Bott Gerard Bondur +Pamela Castillo 11303 Larry Bott Gerard Bondur +Barry Jones 10586 Larry Bott Gerard Bondur +George Vanauf 10563 Larry Bott Gerard Bondur +Loui Bondur 10449 Larry Bott Gerard Bondur +Mary Patterson 9998 Larry Bott Gerard Bondur +Steve Patterson 9441 Larry Bott Gerard Bondur +Julie Firrelli 9181 Larry Bott Gerard Bondur +Jeff Firrelli 8992 Larry Bott Gerard Bondur +William Patterson 8870 Larry Bott Gerard Bondur +Diane Murphy 8435 Larry Bott Gerard Bondur +Leslie Jennings 8113 Larry Bott Gerard Bondur +Gerard Hernandez 6949 Larry Bott Gerard Bondur +Foon Yue Tseng 6660 Larry Bott Gerard Bondur +Anthony Bow 6627 Larry Bott Gerard Bondur +Leslie Thompson 5186 Larry Bott Gerard Bondur + + +-- !query +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) +ORDER BY salary DESC +-- !query schema +struct +-- !query output +Larry Bott 11798 Larry Bott NULL +Gerard Bondur 11472 Larry Bott Gerard Bondur +Pamela Castillo 11303 Larry Bott Gerard Bondur +Barry Jones 10586 Larry Bott Gerard Bondur +George Vanauf 10563 Larry Bott Gerard Bondur +Loui Bondur 10449 Larry Bott Gerard Bondur +Mary Patterson 9998 Larry Bott Gerard Bondur +Steve Patterson 9441 Larry Bott Gerard Bondur +Julie Firrelli 9181 Larry Bott Gerard Bondur +Jeff Firrelli 8992 Larry Bott Gerard Bondur +William Patterson 8870 Larry Bott Gerard Bondur +Diane Murphy 8435 Larry Bott Gerard Bondur +Leslie Jennings 8113 Larry Bott Gerard Bondur +Gerard Hernandez 6949 Larry Bott Gerard Bondur +Foon Yue Tseng 6660 Larry Bott Gerard Bondur +Anthony Bow 6627 Larry Bott Gerard Bondur +Leslie Thompson 5186 Larry Bott Gerard Bondur + + +-- !query +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) +ORDER BY salary DESC +-- !query schema +struct +-- !query output +Larry Bott 11798 Larry Bott NULL +Gerard Bondur 11472 Larry Bott Gerard Bondur +Pamela Castillo 11303 Larry Bott Gerard Bondur +Barry Jones 10586 Larry Bott Gerard Bondur +George Vanauf 10563 Larry Bott Gerard Bondur +Loui Bondur 10449 Larry Bott Gerard Bondur +Mary Patterson 9998 Larry Bott Gerard Bondur +Steve Patterson 9441 Larry Bott Gerard Bondur +Julie Firrelli 9181 Larry Bott Gerard Bondur +Jeff Firrelli 8992 Larry Bott Gerard Bondur +William Patterson 8870 Larry Bott Gerard Bondur +Diane Murphy 8435 Larry Bott Gerard Bondur +Leslie Jennings 8113 Larry Bott Gerard Bondur +Gerard Hernandez 6949 Larry Bott Gerard Bondur +Foon Yue Tseng 6660 Larry Bott Gerard Bondur +Anthony Bow 6627 Larry Bott Gerard Bondur +Leslie Thompson 5186 Larry Bott Gerard Bondur + + +-- !query +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary RANGE BETWEEN 2000 PRECEDING AND 1000 FOLLOWING) +ORDER BY salary +-- !query schema +struct +-- !query output +Leslie Thompson 5186 Leslie Thompson NULL +Anthony Bow 6627 Leslie Thompson Anthony Bow +Foon Yue Tseng 6660 Leslie Thompson Anthony Bow +Gerard Hernandez 6949 Leslie Thompson Anthony Bow +Leslie Jennings 8113 Anthony Bow Foon Yue Tseng +Diane Murphy 8435 Anthony Bow Foon Yue Tseng +William Patterson 8870 Gerard Hernandez Leslie Jennings +Jeff Firrelli 8992 Leslie Jennings Diane Murphy +Julie Firrelli 9181 Leslie Jennings Diane Murphy +Steve Patterson 9441 Leslie Jennings Diane Murphy +Mary Patterson 9998 Leslie Jennings Diane Murphy +Loui Bondur 10449 William Patterson Jeff Firrelli +George Vanauf 10563 William Patterson Jeff Firrelli +Barry Jones 10586 William Patterson Jeff Firrelli +Pamela Castillo 11303 Steve Patterson Mary Patterson +Gerard Bondur 11472 Mary Patterson Loui Bondur +Larry Bott 11798 Mary Patterson Loui Bondur + + +-- !query +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING) +ORDER BY salary DESC +-- !query schema +struct +-- !query output +Larry Bott 11798 Larry Bott Gerard Bondur +Gerard Bondur 11472 Larry Bott Gerard Bondur +Pamela Castillo 11303 Larry Bott Gerard Bondur +Barry Jones 10586 Gerard Bondur Pamela Castillo +George Vanauf 10563 Pamela Castillo Barry Jones +Loui Bondur 10449 Barry Jones George Vanauf +Mary Patterson 9998 George Vanauf Loui Bondur +Steve Patterson 9441 Loui Bondur Mary Patterson +Julie Firrelli 9181 Mary Patterson Steve Patterson +Jeff Firrelli 8992 Steve Patterson Julie Firrelli +William Patterson 8870 Julie Firrelli Jeff Firrelli +Diane Murphy 8435 Jeff Firrelli William Patterson +Leslie Jennings 8113 William Patterson Diane Murphy +Gerard Hernandez 6949 Diane Murphy Leslie Jennings +Foon Yue Tseng 6660 Leslie Jennings Gerard Hernandez +Anthony Bow 6627 Gerard Hernandez Foon Yue Tseng +Leslie Thompson 5186 Foon Yue Tseng Anthony Bow + + +-- !query +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) +ORDER BY salary DESC +-- !query schema +struct +-- !query output +Larry Bott 11798 Larry Bott Gerard Bondur +Gerard Bondur 11472 Gerard Bondur Pamela Castillo +Pamela Castillo 11303 Pamela Castillo Barry Jones +Barry Jones 10586 Barry Jones George Vanauf +George Vanauf 10563 George Vanauf Loui Bondur +Loui Bondur 10449 Loui Bondur Mary Patterson +Mary Patterson 9998 Mary Patterson Steve Patterson +Steve Patterson 9441 Steve Patterson Julie Firrelli +Julie Firrelli 9181 Julie Firrelli Jeff Firrelli +Jeff Firrelli 8992 Jeff Firrelli William Patterson +William Patterson 8870 William Patterson Diane Murphy +Diane Murphy 8435 Diane Murphy Leslie Jennings +Leslie Jennings 8113 Leslie Jennings Gerard Hernandez +Gerard Hernandez 6949 Gerard Hernandez Foon Yue Tseng +Foon Yue Tseng 6660 Foon Yue Tseng Anthony Bow +Anthony Bow 6627 Anthony Bow Leslie Thompson +Leslie Thompson 5186 Leslie Thompson NULL + + +-- !query +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) +ORDER BY salary DESC +-- !query schema +struct +-- !query output +Larry Bott 11798 Larry Bott Gerard Bondur +Gerard Bondur 11472 Larry Bott Gerard Bondur +Pamela Castillo 11303 Larry Bott Gerard Bondur +Barry Jones 10586 Larry Bott Gerard Bondur +George Vanauf 10563 Larry Bott Gerard Bondur +Loui Bondur 10449 Larry Bott Gerard Bondur +Mary Patterson 9998 Larry Bott Gerard Bondur +Steve Patterson 9441 Larry Bott Gerard Bondur +Julie Firrelli 9181 Larry Bott Gerard Bondur +Jeff Firrelli 8992 Larry Bott Gerard Bondur +William Patterson 8870 Larry Bott Gerard Bondur +Diane Murphy 8435 Larry Bott Gerard Bondur +Leslie Jennings 8113 Larry Bott Gerard Bondur +Gerard Hernandez 6949 Larry Bott Gerard Bondur +Foon Yue Tseng 6660 Larry Bott Gerard Bondur +Anthony Bow 6627 Larry Bott Gerard Bondur +Leslie Thompson 5186 Larry Bott Gerard Bondur + + +-- !query +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) +ORDER BY salary DESC +-- !query schema +struct +-- !query output +Larry Bott 11798 Larry Bott Gerard Bondur +Gerard Bondur 11472 Larry Bott Gerard Bondur +Pamela Castillo 11303 Larry Bott Gerard Bondur +Barry Jones 10586 Larry Bott Gerard Bondur +George Vanauf 10563 Larry Bott Gerard Bondur +Loui Bondur 10449 Larry Bott Gerard Bondur +Mary Patterson 9998 Larry Bott Gerard Bondur +Steve Patterson 9441 Larry Bott Gerard Bondur +Julie Firrelli 9181 Larry Bott Gerard Bondur +Jeff Firrelli 8992 Larry Bott Gerard Bondur +William Patterson 8870 Larry Bott Gerard Bondur +Diane Murphy 8435 Larry Bott Gerard Bondur +Leslie Jennings 8113 Larry Bott Gerard Bondur +Gerard Hernandez 6949 Larry Bott Gerard Bondur +Foon Yue Tseng 6660 Larry Bott Gerard Bondur +Anthony Bow 6627 Larry Bott Gerard Bondur +Leslie Thompson 5186 Larry Bott Gerard Bondur + + +-- !query +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING) +ORDER BY salary DESC +-- !query schema +struct +-- !query output +Larry Bott 11798 Larry Bott Gerard Bondur +Gerard Bondur 11472 Larry Bott Gerard Bondur +Pamela Castillo 11303 Larry Bott Gerard Bondur +Barry Jones 10586 Larry Bott Gerard Bondur +George Vanauf 10563 Larry Bott Gerard Bondur +Loui Bondur 10449 Larry Bott Gerard Bondur +Mary Patterson 9998 Larry Bott Gerard Bondur +Steve Patterson 9441 Larry Bott Gerard Bondur +Julie Firrelli 9181 Larry Bott Gerard Bondur +Jeff Firrelli 8992 Larry Bott Gerard Bondur +William Patterson 8870 Larry Bott Gerard Bondur +Diane Murphy 8435 Larry Bott Gerard Bondur +Leslie Jennings 8113 Larry Bott Gerard Bondur +Gerard Hernandez 6949 Larry Bott Gerard Bondur +Foon Yue Tseng 6660 Larry Bott Gerard Bondur +Anthony Bow 6627 Larry Bott Gerard Bondur +Leslie Thompson 5186 Larry Bott Gerard Bondur + + +-- !query +SELECT + employee_name, + department, + salary, + FIRST_VALUE(employee_name) OVER w highest_salary, + NTH_VALUE(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW w AS ( + PARTITION BY department + ORDER BY salary DESC + RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING +) +ORDER BY department +-- !query schema +struct +-- !query output +Gerard Bondur Accounting 11472 Gerard Bondur Mary Patterson +Mary Patterson Accounting 9998 Gerard Bondur Mary Patterson +Jeff Firrelli Accounting 8992 Gerard Bondur Mary Patterson +William Patterson Accounting 8870 Gerard Bondur Mary Patterson +Diane Murphy Accounting 8435 Gerard Bondur Mary Patterson +Anthony Bow Accounting 6627 Gerard Bondur Mary Patterson +Leslie Jennings IT 8113 Leslie Jennings Leslie Thompson +Leslie Thompson IT 5186 Leslie Jennings Leslie Thompson +Larry Bott SCM 11798 Larry Bott Pamela Castillo +Pamela Castillo SCM 11303 Larry Bott Pamela Castillo +Barry Jones SCM 10586 Larry Bott Pamela Castillo +Loui Bondur SCM 10449 Larry Bott Pamela Castillo +Gerard Hernandez SCM 6949 Larry Bott Pamela Castillo +George Vanauf Sales 10563 George Vanauf Steve Patterson +Steve Patterson Sales 9441 George Vanauf Steve Patterson +Julie Firrelli Sales 9181 George Vanauf Steve Patterson +Foon Yue Tseng Sales 6660 George Vanauf Steve Patterson + + +-- !query +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW + w AS (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING), + w AS (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND 2 FOLLOWING) +ORDER BY salary DESC +-- !query schema +struct<> +-- !query output +org.apache.spark.sql.catalyst.parser.ParseException + +The definition of window 'w' is repetitive(line 8, pos 0) + +== SQL == +SELECT + employee_name, + salary, + first_value(employee_name) OVER w highest_salary, + nth_value(employee_name, 2) OVER w second_highest_salary +FROM + basic_pays +WINDOW +^^^ + w AS (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING), + w AS (ORDER BY salary DESC ROWS BETWEEN UNBOUNDED PRECEDING AND 2 FOLLOWING) +ORDER BY salary DESC + + +-- !query +SELECT + content, + id, + v, + lead(v, 0) IGNORE NULLS OVER w lead_0, + lead(v, 1) IGNORE NULLS OVER w lead_1, + lead(v, 2) IGNORE NULLS OVER w lead_2, + lead(v, 3) IGNORE NULLS OVER w lead_3, + lag(v, 0) IGNORE NULLS OVER w lag_0, + lag(v, 1) IGNORE NULLS OVER w lag_1, + lag(v, 2) IGNORE NULLS OVER w lag_2, + lag(v, 3) IGNORE NULLS OVER w lag_3, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id) +ORDER BY id +-- !query schema +struct +-- !query output +a 0 NULL NULL x y z NULL NULL NULL NULL NULL NULL NULL NULL NULL +a 1 x x y z v x NULL NULL NULL x NULL NULL x x +b 2 NULL NULL y z v NULL x NULL NULL x NULL NULL x x +c 3 NULL NULL y z v NULL x NULL NULL x NULL NULL x x +a 4 y y z v NULL y x NULL NULL x y NULL x y +b 5 NULL NULL z v NULL NULL y x NULL x y NULL x y +a 6 z z v NULL NULL z y x NULL x y z x z +a 7 v v NULL NULL NULL v z y x x y z x v +a 8 NULL NULL NULL NULL NULL NULL v z y x y z x v + + +-- !query +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) +ORDER BY id +-- !query schema +struct +-- !query output +a 0 NULL NULL NULL NULL NULL NULL +a 1 x x NULL NULL x x +b 2 NULL x NULL NULL x x +c 3 NULL x NULL NULL x x +a 4 y x y NULL x y +b 5 NULL x y NULL x y +a 6 z x y z x z +a 7 v x y z x v +a 8 NULL x y z x v + + +-- !query +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) +ORDER BY id +-- !query schema +struct +-- !query output +a 0 NULL NULL NULL NULL NULL NULL +a 1 x x NULL NULL x x +b 2 NULL x NULL NULL x x +c 3 NULL x NULL NULL x x +a 4 y x y NULL x y +b 5 NULL x y NULL x y +a 6 z x y z x z +a 7 v x y z x v +a 8 NULL x y z x v + + +-- !query +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id RANGE BETWEEN 2 PRECEDING AND 2 FOLLOWING) +ORDER BY id +-- !query schema +struct +-- !query output +a 0 NULL x NULL NULL x x +a 1 x x NULL NULL x x +b 2 NULL x y NULL x y +c 3 NULL x y NULL x y +a 4 y y z NULL y z +b 5 NULL y z v y v +a 6 z y z v y v +a 7 v z v NULL z v +a 8 NULL z v NULL z v + + +-- !query +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id ROWS BETWEEN 2 PRECEDING AND 2 FOLLOWING) +ORDER BY id +-- !query schema +struct +-- !query output +a 0 NULL x NULL NULL x x +a 1 x x NULL NULL x x +b 2 NULL x y NULL x y +c 3 NULL x y NULL x y +a 4 y y z NULL y z +b 5 NULL y z v y v +a 6 z y z v y v +a 7 v z v NULL z v +a 8 NULL z v NULL z v + + +-- !query +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id RANGE BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) +ORDER BY id +-- !query schema +struct +-- !query output +a 0 NULL x y z x v +a 1 x x y z x v +b 2 NULL y z v y v +c 3 NULL y z v y v +a 4 y y z v y v +b 5 NULL z v NULL z v +a 6 z z v NULL z v +a 7 v v NULL NULL v v +a 8 NULL NULL NULL NULL NULL NULL + + +-- !query +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) +ORDER BY id +-- !query schema +struct +-- !query output +a 0 NULL x y z x v +a 1 x x y z x v +b 2 NULL x y z x v +c 3 NULL x y z x v +a 4 y x y z x v +b 5 NULL x y z x v +a 6 z x y z x v +a 7 v x y z x v +a 8 NULL x y z x v + + +-- !query +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id ROWS BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED FOLLOWING) +ORDER BY id +-- !query schema +struct +-- !query output +a 0 NULL x y z x v +a 1 x x y z x v +b 2 NULL x y z x v +c 3 NULL x y z x v +a 4 y x y z x v +b 5 NULL x y z x v +a 6 z x y z x v +a 7 v x y z x v +a 8 NULL x y z x v + + +-- !query +SELECT + content, + id, + v, + nth_value(v, 1) IGNORE NULLS OVER w nth_value_1, + nth_value(v, 2) IGNORE NULLS OVER w nth_value_2, + nth_value(v, 3) IGNORE NULLS OVER w nth_value_3, + first_value(v) IGNORE NULLS OVER w first_value, + last_value(v) IGNORE NULLS OVER w last_value +FROM + test_ignore_null +WINDOW w AS (ORDER BY id ROWS BETWEEN UNBOUNDED PRECEDING AND 1 FOLLOWING) +ORDER BY id +-- !query schema +struct +-- !query output +a 0 NULL x NULL NULL x x +a 1 x x NULL NULL x x +b 2 NULL x NULL NULL x x +c 3 NULL x y NULL x y +a 4 y x y NULL x y +b 5 NULL x y z x z +a 6 z x y z x v +a 7 v x y z x v +a 8 NULL x y z x v diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/commits/0 b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/commits/0 new file mode 100644 index 0000000000000..9c1e3021c3ead --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/commits/0 @@ -0,0 +1,2 @@ +v1 +{"nextBatchWatermarkMs":0} \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/metadata b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/metadata new file mode 100644 index 0000000000000..26a0d5d707d44 --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/metadata @@ -0,0 +1 @@ +{"id":"5f1362da-99ce-4ba2-97e1-d992c295e563"} \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/offsets/0 b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/offsets/0 new file mode 100644 index 0000000000000..43cde63b8f68d --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/offsets/0 @@ -0,0 +1,3 @@ +v1 +{"batchWatermarkMs":0,"batchTimestampMs":1591241624051,"conf":{"spark.sql.streaming.stateStore.providerClass":"org.apache.spark.sql.execution.streaming.state.HDFSBackedStateStoreProvider","spark.sql.streaming.flatMapGroupsWithState.stateFormatVersion":"2","spark.sql.streaming.multipleWatermarkPolicy":"min","spark.sql.streaming.aggregation.stateFormatVersion":"2","spark.sql.shuffle.partitions":"5"}} +0 \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/0/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/0/1.delta new file mode 100644 index 0000000000000..6352978051846 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/0/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/1/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/1/1.delta new file mode 100644 index 0000000000000..e7de33ff90ca7 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/1/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/2/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/2/1.delta new file mode 100644 index 0000000000000..3769f794e6469 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/2/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/3/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/3/1.delta new file mode 100644 index 0000000000000..82386b020a045 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/3/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/4/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/4/1.delta new file mode 100644 index 0000000000000..ac70b46fc576d Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-common-functions/state/0/4/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/commits/0 b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/commits/0 new file mode 100644 index 0000000000000..9c1e3021c3ead --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/commits/0 @@ -0,0 +1,2 @@ +v1 +{"nextBatchWatermarkMs":0} \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/metadata b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/metadata new file mode 100644 index 0000000000000..0b78699f07bad --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/metadata @@ -0,0 +1 @@ +{"id":"26fe8d3d-d101-44b0-b9c1-a2f9f09cea69"} \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/offsets/0 b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/offsets/0 new file mode 100644 index 0000000000000..3c0c901ee0c38 --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/offsets/0 @@ -0,0 +1,3 @@ +v1 +{"batchWatermarkMs":0,"batchTimestampMs":1592306585407,"conf":{"spark.sql.streaming.stateStore.providerClass":"org.apache.spark.sql.execution.streaming.state.HDFSBackedStateStoreProvider","spark.sql.streaming.flatMapGroupsWithState.stateFormatVersion":"2","spark.sql.streaming.multipleWatermarkPolicy":"min","spark.sql.streaming.aggregation.stateFormatVersion":"2","spark.sql.shuffle.partitions":"5"}} +0 \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/0/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/0/1.delta new file mode 100644 index 0000000000000..6352978051846 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/0/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/1/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/1/1.delta new file mode 100644 index 0000000000000..71ab60304105a Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/1/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/2/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/2/1.delta new file mode 100644 index 0000000000000..6352978051846 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/2/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/3/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/3/1.delta new file mode 100644 index 0000000000000..eaaee05d674dc Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/3/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/4/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/4/1.delta new file mode 100644 index 0000000000000..9a014b2029cec Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-deduplicate/state/0/4/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/commits/0 b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/commits/0 new file mode 100644 index 0000000000000..9c1e3021c3ead --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/commits/0 @@ -0,0 +1,2 @@ +v1 +{"nextBatchWatermarkMs":0} \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/metadata b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/metadata new file mode 100644 index 0000000000000..196f2e0e5c9f3 --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/metadata @@ -0,0 +1 @@ +{"id":"8fc17276-e48b-4e8a-a9c9-31f0045ed860"} \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/offsets/0 b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/offsets/0 new file mode 100644 index 0000000000000..622db1a5f4f5b --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/offsets/0 @@ -0,0 +1,3 @@ +v1 +{"batchWatermarkMs":0,"batchTimestampMs":1591253127196,"conf":{"spark.sql.streaming.stateStore.providerClass":"org.apache.spark.sql.execution.streaming.state.HDFSBackedStateStoreProvider","spark.sql.streaming.flatMapGroupsWithState.stateFormatVersion":"2","spark.sql.streaming.multipleWatermarkPolicy":"min","spark.sql.streaming.aggregation.stateFormatVersion":"2","spark.sql.shuffle.partitions":"5"}} +0 \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/0/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/0/1.delta new file mode 100644 index 0000000000000..31a67ed57d7d1 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/0/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/1/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/1/1.delta new file mode 100644 index 0000000000000..6352978051846 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/1/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/2/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/2/1.delta new file mode 100644 index 0000000000000..2198a7736401a Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/2/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/3/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/3/1.delta new file mode 100644 index 0000000000000..e0a21939d2645 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/3/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/4/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/4/1.delta new file mode 100644 index 0000000000000..91e1e2dbf560b Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-statistical-functions/state/0/4/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/commits/0 b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/commits/0 new file mode 100644 index 0000000000000..9c1e3021c3ead --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/commits/0 @@ -0,0 +1,2 @@ +v1 +{"nextBatchWatermarkMs":0} \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/metadata b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/metadata new file mode 100644 index 0000000000000..1f8077da27c29 --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/metadata @@ -0,0 +1 @@ +{"id":"ac9f2680-3a39-4afd-824b-7beefdf7d7a7"} \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/offsets/0 b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/offsets/0 new file mode 100644 index 0000000000000..b0b5ea1df545a --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/offsets/0 @@ -0,0 +1,3 @@ +v1 +{"batchWatermarkMs":0,"batchTimestampMs":1591234028611,"conf":{"spark.sql.streaming.stateStore.providerClass":"org.apache.spark.sql.execution.streaming.state.HDFSBackedStateStoreProvider","spark.sql.streaming.flatMapGroupsWithState.stateFormatVersion":"2","spark.sql.streaming.multipleWatermarkPolicy":"min","spark.sql.streaming.aggregation.stateFormatVersion":"2","spark.sql.shuffle.partitions":"5"}} +0 \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/0/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/0/1.delta new file mode 100644 index 0000000000000..6352978051846 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/0/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/1/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/1/1.delta new file mode 100644 index 0000000000000..99110e438ff2f Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/1/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/2/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/2/1.delta new file mode 100644 index 0000000000000..6352978051846 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/2/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/3/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/3/1.delta new file mode 100644 index 0000000000000..cec2e6be7c9f7 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/3/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/4/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/4/1.delta new file mode 100644 index 0000000000000..6352978051846 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-2.4.5-for-compatibility-test-sum-decimal/state/0/4/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/commits/0 b/sql/core/src/test/resources/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/commits/0 new file mode 100644 index 0000000000000..9c1e3021c3ead --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/commits/0 @@ -0,0 +1,2 @@ +v1 +{"nextBatchWatermarkMs":0} \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/metadata b/sql/core/src/test/resources/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/metadata new file mode 100644 index 0000000000000..df5937f800382 --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/metadata @@ -0,0 +1 @@ +{"id":"6bcf6671-d23e-4ad8-824f-98aa5924ce6d"} \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/offsets/0 b/sql/core/src/test/resources/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/offsets/0 new file mode 100644 index 0000000000000..d12f52147dd6a --- /dev/null +++ b/sql/core/src/test/resources/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/offsets/0 @@ -0,0 +1,3 @@ +v1 +{"batchWatermarkMs":0,"batchTimestampMs":1603918440918,"conf":{"spark.sql.streaming.stateStore.providerClass":"org.apache.spark.sql.execution.streaming.state.HDFSBackedStateStoreProvider","spark.sql.streaming.join.stateFormatVersion":"2","spark.sql.streaming.flatMapGroupsWithState.stateFormatVersion":"2","spark.sql.streaming.multipleWatermarkPolicy":"min","spark.sql.streaming.aggregation.stateFormatVersion":"2","spark.sql.shuffle.partitions":"1"}} +0 \ No newline at end of file diff --git a/sql/core/src/test/resources/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/state/0/0/1.delta b/sql/core/src/test/resources/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/state/0/0/1.delta new file mode 100644 index 0000000000000..8de7bc89a5de8 Binary files /dev/null and b/sql/core/src/test/resources/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/state/0/0/1.delta differ diff --git a/sql/core/src/test/resources/structured-streaming/file-sink-log-version-2.1.0/8 b/sql/core/src/test/resources/structured-streaming/file-sink-log-version-2.1.0/8 index e7989804e8886..dd0513f16a1ad 100644 --- a/sql/core/src/test/resources/structured-streaming/file-sink-log-version-2.1.0/8 +++ b/sql/core/src/test/resources/structured-streaming/file-sink-log-version-2.1.0/8 @@ -1,3 +1,2 @@ v1 {"path":"/a/b/8","size":800,"isDir":false,"modificationTime":800,"blockReplication":1,"blockSize":100,"action":"add"} -{"path":"/a/b/0","size":100,"isDir":false,"modificationTime":100,"blockReplication":1,"blockSize":100,"action":"delete"} diff --git a/sql/core/src/test/resources/test-data/before_1582_date_v2_4.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_date_v2_4.snappy.parquet deleted file mode 100644 index 7d5cc12eefe04..0000000000000 Binary files a/sql/core/src/test/resources/test-data/before_1582_date_v2_4.snappy.parquet and /dev/null differ diff --git a/sql/core/src/test/resources/test-data/before_1582_date_v2_4_5.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_date_v2_4_5.snappy.parquet new file mode 100644 index 0000000000000..edd61c9b9fec8 Binary files /dev/null and b/sql/core/src/test/resources/test-data/before_1582_date_v2_4_5.snappy.parquet differ diff --git a/sql/core/src/test/resources/test-data/before_1582_date_v2_4_6.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_date_v2_4_6.snappy.parquet new file mode 100644 index 0000000000000..01f4887f5e994 Binary files /dev/null and b/sql/core/src/test/resources/test-data/before_1582_date_v2_4_6.snappy.parquet differ diff --git a/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_dict_v2_4_5.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_dict_v2_4_5.snappy.parquet new file mode 100644 index 0000000000000..c7e8d3926f63a Binary files /dev/null and b/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_dict_v2_4_5.snappy.parquet differ diff --git a/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_dict_v2_4_6.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_dict_v2_4_6.snappy.parquet new file mode 100644 index 0000000000000..939e2b8088eb0 Binary files /dev/null and b/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_dict_v2_4_6.snappy.parquet differ diff --git a/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_plain_v2_4_5.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_plain_v2_4_5.snappy.parquet new file mode 100644 index 0000000000000..88a94ac482052 Binary files /dev/null and b/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_plain_v2_4_5.snappy.parquet differ diff --git a/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_plain_v2_4_6.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_plain_v2_4_6.snappy.parquet new file mode 100644 index 0000000000000..68bfa33aac13f Binary files /dev/null and b/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_plain_v2_4_6.snappy.parquet differ diff --git a/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_v2_4.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_v2_4.snappy.parquet deleted file mode 100644 index 13254bd93a5e6..0000000000000 Binary files a/sql/core/src/test/resources/test-data/before_1582_timestamp_int96_v2_4.snappy.parquet and /dev/null differ diff --git a/sql/core/src/test/resources/test-data/before_1582_timestamp_micros_v2_4.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_timestamp_micros_v2_4.snappy.parquet deleted file mode 100644 index 7d2b46e9bea41..0000000000000 Binary files a/sql/core/src/test/resources/test-data/before_1582_timestamp_micros_v2_4.snappy.parquet and /dev/null differ diff --git a/sql/core/src/test/resources/test-data/before_1582_timestamp_micros_v2_4_5.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_timestamp_micros_v2_4_5.snappy.parquet new file mode 100644 index 0000000000000..62e6048354dc1 Binary files /dev/null and b/sql/core/src/test/resources/test-data/before_1582_timestamp_micros_v2_4_5.snappy.parquet differ diff --git a/sql/core/src/test/resources/test-data/before_1582_timestamp_micros_v2_4_6.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_timestamp_micros_v2_4_6.snappy.parquet new file mode 100644 index 0000000000000..d7fdaa3e67212 Binary files /dev/null and b/sql/core/src/test/resources/test-data/before_1582_timestamp_micros_v2_4_6.snappy.parquet differ diff --git a/sql/core/src/test/resources/test-data/before_1582_timestamp_millis_v2_4.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_timestamp_millis_v2_4.snappy.parquet deleted file mode 100644 index e9825455c2015..0000000000000 Binary files a/sql/core/src/test/resources/test-data/before_1582_timestamp_millis_v2_4.snappy.parquet and /dev/null differ diff --git a/sql/core/src/test/resources/test-data/before_1582_timestamp_millis_v2_4_5.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_timestamp_millis_v2_4_5.snappy.parquet new file mode 100644 index 0000000000000..a7cef9e60f134 Binary files /dev/null and b/sql/core/src/test/resources/test-data/before_1582_timestamp_millis_v2_4_5.snappy.parquet differ diff --git a/sql/core/src/test/resources/test-data/before_1582_timestamp_millis_v2_4_6.snappy.parquet b/sql/core/src/test/resources/test-data/before_1582_timestamp_millis_v2_4_6.snappy.parquet new file mode 100644 index 0000000000000..4c213f4540a73 Binary files /dev/null and b/sql/core/src/test/resources/test-data/before_1582_timestamp_millis_v2_4_6.snappy.parquet differ diff --git a/sql/core/src/test/resources/test-data/decimal32-written-as-64-bit-dict.snappy.parquet b/sql/core/src/test/resources/test-data/decimal32-written-as-64-bit-dict.snappy.parquet new file mode 100644 index 0000000000000..e19bd7ae01b85 Binary files /dev/null and b/sql/core/src/test/resources/test-data/decimal32-written-as-64-bit-dict.snappy.parquet differ diff --git a/sql/core/src/test/resources/test-data/decimal32-written-as-64-bit.snappy.parquet b/sql/core/src/test/resources/test-data/decimal32-written-as-64-bit.snappy.parquet new file mode 100644 index 0000000000000..1068a4e413235 Binary files /dev/null and b/sql/core/src/test/resources/test-data/decimal32-written-as-64-bit.snappy.parquet differ diff --git a/sql/core/src/test/resources/test-data/percentile_approx-input.csv.bz2 b/sql/core/src/test/resources/test-data/percentile_approx-input.csv.bz2 new file mode 100644 index 0000000000000..f85e2896b3a89 Binary files /dev/null and b/sql/core/src/test/resources/test-data/percentile_approx-input.csv.bz2 differ diff --git a/sql/hive/src/test/resources/test_script.py b/sql/core/src/test/resources/test_script.py similarity index 97% rename from sql/hive/src/test/resources/test_script.py rename to sql/core/src/test/resources/test_script.py index 82ef7b38f0c1b..4fcd483f44d43 100644 --- a/sql/hive/src/test/resources/test_script.py +++ b/sql/core/src/test/resources/test_script.py @@ -1,3 +1,5 @@ +#!/usr/bin/env python3 + # 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. diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt new file mode 100644 index 0000000000000..214c9260016bf --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/explain.txt @@ -0,0 +1,303 @@ +== Physical Plan == +TakeOrderedAndProject (52) ++- * HashAggregate (51) + +- Exchange (50) + +- * HashAggregate (49) + +- * Project (48) + +- * BroadcastHashJoin Inner BuildLeft (47) + :- BroadcastExchange (43) + : +- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Project (35) + : : +- * SortMergeJoin LeftSemi (34) + : : :- * SortMergeJoin LeftSemi (25) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer (1) + : : : +- * Sort (24) + : : : +- Exchange (23) + : : : +- Union (22) + : : : :- * Project (15) + : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : :- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.web_sales (6) + : : : : +- BroadcastExchange (13) + : : : : +- * Project (12) + : : : : +- * Filter (11) + : : : : +- * ColumnarToRow (10) + : : : : +- Scan parquet default.date_dim (9) + : : : +- * Project (21) + : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : :- * Filter (18) + : : : : +- * ColumnarToRow (17) + : : : : +- Scan parquet default.catalog_sales (16) + : : : +- ReusedExchange (19) + : : +- * Sort (33) + : : +- Exchange (32) + : : +- * Project (31) + : : +- * BroadcastHashJoin Inner BuildRight (30) + : : :- * Filter (28) + : : : +- * ColumnarToRow (27) + : : : +- Scan parquet default.store_sales (26) + : : +- ReusedExchange (29) + : +- BroadcastExchange (40) + : +- * Project (39) + : +- * Filter (38) + : +- * ColumnarToRow (37) + : +- Scan parquet default.customer_address (36) + +- * Filter (46) + +- * ColumnarToRow (45) + +- Scan parquet default.customer_demographics (44) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(3) Filter [codegen id : 1] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Condition : ((isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#3)) AND isnotnull(c_current_cdemo_sk#2)) + +(4) Exchange +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: hashpartitioning(c_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#4] + +(5) Sort [codegen id : 2] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#5, ws_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#6), dynamicpruningexpression(ws_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ws_bill_customer_sk#5, ws_sold_date_sk#6] + +(8) Filter [codegen id : 4] +Input [2]: [ws_bill_customer_sk#5, ws_sold_date_sk#6] +Condition : isnotnull(ws_bill_customer_sk#5) + +(9) Scan parquet default.date_dim +Output [3]: [d_date_sk#8, d_year#9, d_moy#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2002), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,7), IsNotNull(d_date_sk)] +ReadSchema: struct + +(10) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(11) Filter [codegen id : 3] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] +Condition : (((((isnotnull(d_year#9) AND isnotnull(d_moy#10)) AND (d_year#9 = 2002)) AND (d_moy#10 >= 4)) AND (d_moy#10 <= 7)) AND isnotnull(d_date_sk#8)) + +(12) Project [codegen id : 3] +Output [1]: [d_date_sk#8] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(13) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(15) Project [codegen id : 4] +Output [1]: [ws_bill_customer_sk#5 AS customer_sk#12] +Input [3]: [ws_bill_customer_sk#5, ws_sold_date_sk#6, d_date_sk#8] + +(16) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#13, cs_sold_date_sk#14] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#14), dynamicpruningexpression(cs_sold_date_sk#14 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(cs_ship_customer_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 6] +Input [2]: [cs_ship_customer_sk#13, cs_sold_date_sk#14] + +(18) Filter [codegen id : 6] +Input [2]: [cs_ship_customer_sk#13, cs_sold_date_sk#14] +Condition : isnotnull(cs_ship_customer_sk#13) + +(19) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#15] + +(20) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#14] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(21) Project [codegen id : 6] +Output [1]: [cs_ship_customer_sk#13 AS customer_sk#16] +Input [3]: [cs_ship_customer_sk#13, cs_sold_date_sk#14, d_date_sk#15] + +(22) Union + +(23) Exchange +Input [1]: [customer_sk#12] +Arguments: hashpartitioning(customer_sk#12, 5), ENSURE_REQUIREMENTS, [id=#17] + +(24) Sort [codegen id : 7] +Input [1]: [customer_sk#12] +Arguments: [customer_sk#12 ASC NULLS FIRST], false, 0 + +(25) SortMergeJoin [codegen id : 8] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customer_sk#12] +Join condition: None + +(26) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#18, ss_sold_date_sk#19] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#19), dynamicpruningexpression(ss_sold_date_sk#19 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 10] +Input [2]: [ss_customer_sk#18, ss_sold_date_sk#19] + +(28) Filter [codegen id : 10] +Input [2]: [ss_customer_sk#18, ss_sold_date_sk#19] +Condition : isnotnull(ss_customer_sk#18) + +(29) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#20] + +(30) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#19] +Right keys [1]: [d_date_sk#20] +Join condition: None + +(31) Project [codegen id : 10] +Output [1]: [ss_customer_sk#18 AS customer_sk#21] +Input [3]: [ss_customer_sk#18, ss_sold_date_sk#19, d_date_sk#20] + +(32) Exchange +Input [1]: [customer_sk#21] +Arguments: hashpartitioning(customer_sk#21, 5), ENSURE_REQUIREMENTS, [id=#22] + +(33) Sort [codegen id : 11] +Input [1]: [customer_sk#21] +Arguments: [customer_sk#21 ASC NULLS FIRST], false, 0 + +(34) SortMergeJoin [codegen id : 13] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customer_sk#21] +Join condition: None + +(35) Project [codegen id : 13] +Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(36) Scan parquet default.customer_address +Output [2]: [ca_address_sk#23, ca_county#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_county, [Walker County,Richland County,Gaines County,Douglas County,Dona Ana County]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 12] +Input [2]: [ca_address_sk#23, ca_county#24] + +(38) Filter [codegen id : 12] +Input [2]: [ca_address_sk#23, ca_county#24] +Condition : (ca_county#24 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#23)) + +(39) Project [codegen id : 12] +Output [1]: [ca_address_sk#23] +Input [2]: [ca_address_sk#23, ca_county#24] + +(40) BroadcastExchange +Input [1]: [ca_address_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] + +(41) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#23] +Join condition: None + +(42) Project [codegen id : 13] +Output [1]: [c_current_cdemo_sk#2] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#23] + +(43) BroadcastExchange +Input [1]: [c_current_cdemo_sk#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] + +(44) Scan parquet default.customer_demographics +Output [9]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(45) ColumnarToRow +Input [9]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] + +(46) Filter +Input [9]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Condition : isnotnull(cd_demo_sk#27) + +(47) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#27] +Join condition: None + +(48) Project [codegen id : 14] +Output [8]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] + +(49) HashAggregate [codegen id : 14] +Input [8]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Keys [8]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#36] +Results [9]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35, count#37] + +(50) Exchange +Input [9]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35, count#37] +Arguments: hashpartitioning(cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35, 5), ENSURE_REQUIREMENTS, [id=#38] + +(51) HashAggregate [codegen id : 15] +Input [9]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35, count#37] +Keys [8]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#39] +Results [14]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, count(1)#39 AS cnt1#40, cd_purchase_estimate#31, count(1)#39 AS cnt2#41, cd_credit_rating#32, count(1)#39 AS cnt3#42, cd_dep_count#33, count(1)#39 AS cnt4#43, cd_dep_employed_count#34, count(1)#39 AS cnt5#44, cd_dep_college_count#35, count(1)#39 AS cnt6#45] + +(52) TakeOrderedAndProject +Input [14]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cnt1#40, cd_purchase_estimate#31, cnt2#41, cd_credit_rating#32, cnt3#42, cd_dep_count#33, cnt4#43, cd_dep_employed_count#34, cnt5#44, cd_dep_college_count#35, cnt6#45] +Arguments: 100, [cd_gender#28 ASC NULLS FIRST, cd_marital_status#29 ASC NULLS FIRST, cd_education_status#30 ASC NULLS FIRST, cd_purchase_estimate#31 ASC NULLS FIRST, cd_credit_rating#32 ASC NULLS FIRST, cd_dep_count#33 ASC NULLS FIRST, cd_dep_employed_count#34 ASC NULLS FIRST, cd_dep_college_count#35 ASC NULLS FIRST], [cd_gender#28, cd_marital_status#29, cd_education_status#30, cnt1#40, cd_purchase_estimate#31, cnt2#41, cd_credit_rating#32, cnt3#42, cd_dep_count#33, cnt4#43, cd_dep_employed_count#34, cnt5#44, cd_dep_college_count#35, cnt6#45] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ws_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (53) + + +(53) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 16 Hosting Expression = cs_sold_date_sk#14 IN dynamicpruning#7 + +Subquery:3 Hosting operator id = 26 Hosting Expression = ss_sold_date_sk#19 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/simplified.txt new file mode 100644 index 0000000000000..af1e7c10e8e4d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10.sf100/simplified.txt @@ -0,0 +1,89 @@ +TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,cnt2,cnt3,cnt4,cnt5,cnt6] + WholeStageCodegen (15) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count] [count(1),cnt1,cnt2,cnt3,cnt4,cnt5,cnt6,count] + InputAdapter + Exchange [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 + WholeStageCodegen (14) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,count] + Project [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (13) + Project [c_current_cdemo_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + SortMergeJoin [c_customer_sk,customer_sk] + InputAdapter + WholeStageCodegen (8) + SortMergeJoin [c_customer_sk,customer_sk] + InputAdapter + WholeStageCodegen (2) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #3 + WholeStageCodegen (1) + Filter [c_customer_sk,c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (7) + Sort [customer_sk] + InputAdapter + Exchange [customer_sk] #4 + Union + WholeStageCodegen (4) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (6) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_ship_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + WholeStageCodegen (11) + Sort [customer_sk] + InputAdapter + Exchange [customer_sk] #6 + WholeStageCodegen (10) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (12) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt new file mode 100644 index 0000000000000..ff55b1c511456 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/explain.txt @@ -0,0 +1,283 @@ +== Physical Plan == +TakeOrderedAndProject (48) ++- * HashAggregate (47) + +- Exchange (46) + +- * HashAggregate (45) + +- * Project (44) + +- * BroadcastHashJoin Inner BuildRight (43) + :- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Project (31) + : : +- * BroadcastHashJoin LeftSemi BuildRight (30) + : : :- * BroadcastHashJoin LeftSemi BuildRight (22) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer (1) + : : : +- BroadcastExchange (21) + : : : +- Union (20) + : : : :- * Project (13) + : : : : +- * BroadcastHashJoin Inner BuildRight (12) + : : : : :- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.web_sales (4) + : : : : +- BroadcastExchange (11) + : : : : +- * Project (10) + : : : : +- * Filter (9) + : : : : +- * ColumnarToRow (8) + : : : : +- Scan parquet default.date_dim (7) + : : : +- * Project (19) + : : : +- * BroadcastHashJoin Inner BuildRight (18) + : : : :- * Filter (16) + : : : : +- * ColumnarToRow (15) + : : : : +- Scan parquet default.catalog_sales (14) + : : : +- ReusedExchange (17) + : : +- BroadcastExchange (29) + : : +- * Project (28) + : : +- * BroadcastHashJoin Inner BuildRight (27) + : : :- * Filter (25) + : : : +- * ColumnarToRow (24) + : : : +- Scan parquet default.store_sales (23) + : : +- ReusedExchange (26) + : +- BroadcastExchange (36) + : +- * Project (35) + : +- * Filter (34) + : +- * ColumnarToRow (33) + : +- Scan parquet default.customer_address (32) + +- BroadcastExchange (42) + +- * Filter (41) + +- * ColumnarToRow (40) + +- Scan parquet default.customer_demographics (39) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(3) Filter [codegen id : 9] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Condition : ((isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#3)) AND isnotnull(c_current_cdemo_sk#2)) + +(4) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#4, ws_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#5), dynamicpruningexpression(ws_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 2] +Input [2]: [ws_bill_customer_sk#4, ws_sold_date_sk#5] + +(6) Filter [codegen id : 2] +Input [2]: [ws_bill_customer_sk#4, ws_sold_date_sk#5] +Condition : isnotnull(ws_bill_customer_sk#4) + +(7) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_moy#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2002), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,7), IsNotNull(d_date_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] + +(9) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] +Condition : (((((isnotnull(d_year#8) AND isnotnull(d_moy#9)) AND (d_year#8 = 2002)) AND (d_moy#9 >= 4)) AND (d_moy#9 <= 7)) AND isnotnull(d_date_sk#7)) + +(10) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] + +(11) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(12) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ws_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(13) Project [codegen id : 2] +Output [1]: [ws_bill_customer_sk#4 AS customer_sk#11] +Input [3]: [ws_bill_customer_sk#4, ws_sold_date_sk#5, d_date_sk#7] + +(14) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#12, cs_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#13), dynamicpruningexpression(cs_sold_date_sk#13 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(cs_ship_customer_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 4] +Input [2]: [cs_ship_customer_sk#12, cs_sold_date_sk#13] + +(16) Filter [codegen id : 4] +Input [2]: [cs_ship_customer_sk#12, cs_sold_date_sk#13] +Condition : isnotnull(cs_ship_customer_sk#12) + +(17) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#14] + +(18) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#13] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(19) Project [codegen id : 4] +Output [1]: [cs_ship_customer_sk#12 AS customer_sk#15] +Input [3]: [cs_ship_customer_sk#12, cs_sold_date_sk#13, d_date_sk#14] + +(20) Union + +(21) BroadcastExchange +Input [1]: [customer_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(22) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customer_sk#11] +Join condition: None + +(23) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#17, ss_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#18), dynamicpruningexpression(ss_sold_date_sk#18 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 6] +Input [2]: [ss_customer_sk#17, ss_sold_date_sk#18] + +(25) Filter [codegen id : 6] +Input [2]: [ss_customer_sk#17, ss_sold_date_sk#18] +Condition : isnotnull(ss_customer_sk#17) + +(26) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#19] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#18] +Right keys [1]: [d_date_sk#19] +Join condition: None + +(28) Project [codegen id : 6] +Output [1]: [ss_customer_sk#17 AS customer_sk#20] +Input [3]: [ss_customer_sk#17, ss_sold_date_sk#18, d_date_sk#19] + +(29) BroadcastExchange +Input [1]: [customer_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(30) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customer_sk#20] +Join condition: None + +(31) Project [codegen id : 9] +Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(32) Scan parquet default.customer_address +Output [2]: [ca_address_sk#22, ca_county#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_county, [Walker County,Richland County,Gaines County,Douglas County,Dona Ana County]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(33) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#22, ca_county#23] + +(34) Filter [codegen id : 7] +Input [2]: [ca_address_sk#22, ca_county#23] +Condition : (ca_county#23 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#22)) + +(35) Project [codegen id : 7] +Output [1]: [ca_address_sk#22] +Input [2]: [ca_address_sk#22, ca_county#23] + +(36) BroadcastExchange +Input [1]: [ca_address_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(37) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#22] +Join condition: None + +(38) Project [codegen id : 9] +Output [1]: [c_current_cdemo_sk#2] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#22] + +(39) Scan parquet default.customer_demographics +Output [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 8] +Input [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] + +(41) Filter [codegen id : 8] +Input [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Condition : isnotnull(cd_demo_sk#25) + +(42) BroadcastExchange +Input [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#34] + +(43) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#25] +Join condition: None + +(44) Project [codegen id : 9] +Output [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] + +(45) HashAggregate [codegen id : 9] +Input [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Keys [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#35] +Results [9]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#36] + +(46) Exchange +Input [9]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#36] +Arguments: hashpartitioning(cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, 5), ENSURE_REQUIREMENTS, [id=#37] + +(47) HashAggregate [codegen id : 10] +Input [9]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#36] +Keys [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#38] +Results [14]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, count(1)#38 AS cnt1#39, cd_purchase_estimate#29, count(1)#38 AS cnt2#40, cd_credit_rating#30, count(1)#38 AS cnt3#41, cd_dep_count#31, count(1)#38 AS cnt4#42, cd_dep_employed_count#32, count(1)#38 AS cnt5#43, cd_dep_college_count#33, count(1)#38 AS cnt6#44] + +(48) TakeOrderedAndProject +Input [14]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cnt1#39, cd_purchase_estimate#29, cnt2#40, cd_credit_rating#30, cnt3#41, cd_dep_count#31, cnt4#42, cd_dep_employed_count#32, cnt5#43, cd_dep_college_count#33, cnt6#44] +Arguments: 100, [cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, cd_education_status#28 ASC NULLS FIRST, cd_purchase_estimate#29 ASC NULLS FIRST, cd_credit_rating#30 ASC NULLS FIRST, cd_dep_count#31 ASC NULLS FIRST, cd_dep_employed_count#32 ASC NULLS FIRST, cd_dep_college_count#33 ASC NULLS FIRST], [cd_gender#26, cd_marital_status#27, cd_education_status#28, cnt1#39, cd_purchase_estimate#29, cnt2#40, cd_credit_rating#30, cnt3#41, cd_dep_count#31, cnt4#42, cd_dep_employed_count#32, cnt5#43, cd_dep_college_count#33, cnt6#44] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ws_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (49) + + +(49) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#7] + +Subquery:2 Hosting operator id = 14 Hosting Expression = cs_sold_date_sk#13 IN dynamicpruning#6 + +Subquery:3 Hosting operator id = 23 Hosting Expression = ss_sold_date_sk#18 IN dynamicpruning#6 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/simplified.txt new file mode 100644 index 0000000000000..58eb3e3102c81 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q10/simplified.txt @@ -0,0 +1,75 @@ +TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,cnt2,cnt3,cnt4,cnt5,cnt6] + WholeStageCodegen (10) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count] [count(1),cnt1,cnt2,cnt3,cnt4,cnt5,cnt6,count] + InputAdapter + Exchange [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 + WholeStageCodegen (9) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,count] + Project [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [c_current_cdemo_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + BroadcastHashJoin [c_customer_sk,customer_sk] + BroadcastHashJoin [c_customer_sk,customer_sk] + Filter [c_customer_sk,c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #2 + Union + WholeStageCodegen (2) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (4) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_ship_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (6) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (8) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19.sf100/explain.txt new file mode 100644 index 0000000000000..858cbaae6b019 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19.sf100/explain.txt @@ -0,0 +1,262 @@ +== Physical Plan == +TakeOrderedAndProject (45) ++- * HashAggregate (44) + +- Exchange (43) + +- * HashAggregate (42) + +- * Project (41) + +- * BroadcastHashJoin Inner BuildRight (40) + :- * Project (34) + : +- * SortMergeJoin Inner (33) + : :- * Sort (27) + : : +- Exchange (26) + : : +- * Project (25) + : : +- * BroadcastHashJoin Inner BuildRight (24) + : : :- * Project (19) + : : : +- * SortMergeJoin Inner (18) + : : : :- * Sort (12) + : : : : +- Exchange (11) + : : : : +- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : : :- BroadcastExchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.date_dim (1) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.store_sales (6) + : : : +- * Sort (17) + : : : +- Exchange (16) + : : : +- * Filter (15) + : : : +- * ColumnarToRow (14) + : : : +- Scan parquet default.customer (13) + : : +- BroadcastExchange (23) + : : +- * Filter (22) + : : +- * ColumnarToRow (21) + : : +- Scan parquet default.store (20) + : +- * Sort (32) + : +- Exchange (31) + : +- * Filter (30) + : +- * ColumnarToRow (29) + : +- Scan parquet default.customer_address (28) + +- BroadcastExchange (39) + +- * Project (38) + +- * Filter (37) + +- * ColumnarToRow (36) + +- Scan parquet default.item (35) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,1999), GreaterThanOrEqual(d_date_sk,2451484), LessThanOrEqual(d_date_sk,2451513), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 11)) AND (d_year#2 = 1999)) AND (d_date_sk#1 >= 2451484)) AND (d_date_sk#1 <= 2451513)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [5]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8, ss_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#9), (ss_sold_date_sk#9 >= 2451484), (ss_sold_date_sk#9 <= 2451513), dynamicpruningexpression(ss_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [5]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8, ss_sold_date_sk#9] + +(8) Filter +Input [5]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8, ss_sold_date_sk#9] +Condition : ((isnotnull(ss_item_sk#5) AND isnotnull(ss_customer_sk#6)) AND isnotnull(ss_store_sk#7)) + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#9] +Join condition: None + +(10) Project [codegen id : 2] +Output [4]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8] +Input [6]: [d_date_sk#1, ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8, ss_sold_date_sk#9] + +(11) Exchange +Input [4]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8] +Arguments: hashpartitioning(ss_customer_sk#6, 5), ENSURE_REQUIREMENTS, [id=#11] + +(12) Sort [codegen id : 3] +Input [4]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8] +Arguments: [ss_customer_sk#6 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.customer +Output [2]: [c_customer_sk#12, c_current_addr_sk#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 4] +Input [2]: [c_customer_sk#12, c_current_addr_sk#13] + +(15) Filter [codegen id : 4] +Input [2]: [c_customer_sk#12, c_current_addr_sk#13] +Condition : (isnotnull(c_customer_sk#12) AND isnotnull(c_current_addr_sk#13)) + +(16) Exchange +Input [2]: [c_customer_sk#12, c_current_addr_sk#13] +Arguments: hashpartitioning(c_customer_sk#12, 5), ENSURE_REQUIREMENTS, [id=#14] + +(17) Sort [codegen id : 5] +Input [2]: [c_customer_sk#12, c_current_addr_sk#13] +Arguments: [c_customer_sk#12 ASC NULLS FIRST], false, 0 + +(18) SortMergeJoin [codegen id : 7] +Left keys [1]: [ss_customer_sk#6] +Right keys [1]: [c_customer_sk#12] +Join condition: None + +(19) Project [codegen id : 7] +Output [4]: [ss_item_sk#5, ss_store_sk#7, ss_ext_sales_price#8, c_current_addr_sk#13] +Input [6]: [ss_item_sk#5, ss_customer_sk#6, ss_store_sk#7, ss_ext_sales_price#8, c_customer_sk#12, c_current_addr_sk#13] + +(20) Scan parquet default.store +Output [2]: [s_store_sk#15, s_zip#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_zip), IsNotNull(s_store_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [2]: [s_store_sk#15, s_zip#16] + +(22) Filter [codegen id : 6] +Input [2]: [s_store_sk#15, s_zip#16] +Condition : (isnotnull(s_zip#16) AND isnotnull(s_store_sk#15)) + +(23) BroadcastExchange +Input [2]: [s_store_sk#15, s_zip#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(24) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_store_sk#7] +Right keys [1]: [s_store_sk#15] +Join condition: None + +(25) Project [codegen id : 7] +Output [4]: [ss_item_sk#5, ss_ext_sales_price#8, c_current_addr_sk#13, s_zip#16] +Input [6]: [ss_item_sk#5, ss_store_sk#7, ss_ext_sales_price#8, c_current_addr_sk#13, s_store_sk#15, s_zip#16] + +(26) Exchange +Input [4]: [ss_item_sk#5, ss_ext_sales_price#8, c_current_addr_sk#13, s_zip#16] +Arguments: hashpartitioning(c_current_addr_sk#13, 5), ENSURE_REQUIREMENTS, [id=#18] + +(27) Sort [codegen id : 8] +Input [4]: [ss_item_sk#5, ss_ext_sales_price#8, c_current_addr_sk#13, s_zip#16] +Arguments: [c_current_addr_sk#13 ASC NULLS FIRST], false, 0 + +(28) Scan parquet default.customer_address +Output [2]: [ca_address_sk#19, ca_zip#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_zip)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 9] +Input [2]: [ca_address_sk#19, ca_zip#20] + +(30) Filter [codegen id : 9] +Input [2]: [ca_address_sk#19, ca_zip#20] +Condition : (isnotnull(ca_address_sk#19) AND isnotnull(ca_zip#20)) + +(31) Exchange +Input [2]: [ca_address_sk#19, ca_zip#20] +Arguments: hashpartitioning(ca_address_sk#19, 5), ENSURE_REQUIREMENTS, [id=#21] + +(32) Sort [codegen id : 10] +Input [2]: [ca_address_sk#19, ca_zip#20] +Arguments: [ca_address_sk#19 ASC NULLS FIRST], false, 0 + +(33) SortMergeJoin [codegen id : 12] +Left keys [1]: [c_current_addr_sk#13] +Right keys [1]: [ca_address_sk#19] +Join condition: NOT (substr(ca_zip#20, 1, 5) = substr(s_zip#16, 1, 5)) + +(34) Project [codegen id : 12] +Output [2]: [ss_item_sk#5, ss_ext_sales_price#8] +Input [6]: [ss_item_sk#5, ss_ext_sales_price#8, c_current_addr_sk#13, s_zip#16, ca_address_sk#19, ca_zip#20] + +(35) Scan parquet default.item +Output [6]: [i_item_sk#22, i_brand_id#23, i_brand#24, i_manufact_id#25, i_manufact#26, i_manager_id#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,7), IsNotNull(i_item_sk)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 11] +Input [6]: [i_item_sk#22, i_brand_id#23, i_brand#24, i_manufact_id#25, i_manufact#26, i_manager_id#27] + +(37) Filter [codegen id : 11] +Input [6]: [i_item_sk#22, i_brand_id#23, i_brand#24, i_manufact_id#25, i_manufact#26, i_manager_id#27] +Condition : ((isnotnull(i_manager_id#27) AND (i_manager_id#27 = 7)) AND isnotnull(i_item_sk#22)) + +(38) Project [codegen id : 11] +Output [5]: [i_item_sk#22, i_brand_id#23, i_brand#24, i_manufact_id#25, i_manufact#26] +Input [6]: [i_item_sk#22, i_brand_id#23, i_brand#24, i_manufact_id#25, i_manufact#26, i_manager_id#27] + +(39) BroadcastExchange +Input [5]: [i_item_sk#22, i_brand_id#23, i_brand#24, i_manufact_id#25, i_manufact#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] + +(40) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [ss_item_sk#5] +Right keys [1]: [i_item_sk#22] +Join condition: None + +(41) Project [codegen id : 12] +Output [5]: [ss_ext_sales_price#8, i_brand_id#23, i_brand#24, i_manufact_id#25, i_manufact#26] +Input [7]: [ss_item_sk#5, ss_ext_sales_price#8, i_item_sk#22, i_brand_id#23, i_brand#24, i_manufact_id#25, i_manufact#26] + +(42) HashAggregate [codegen id : 12] +Input [5]: [ss_ext_sales_price#8, i_brand_id#23, i_brand#24, i_manufact_id#25, i_manufact#26] +Keys [4]: [i_brand#24, i_brand_id#23, i_manufact_id#25, i_manufact#26] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#8))] +Aggregate Attributes [1]: [sum#29] +Results [5]: [i_brand#24, i_brand_id#23, i_manufact_id#25, i_manufact#26, sum#30] + +(43) Exchange +Input [5]: [i_brand#24, i_brand_id#23, i_manufact_id#25, i_manufact#26, sum#30] +Arguments: hashpartitioning(i_brand#24, i_brand_id#23, i_manufact_id#25, i_manufact#26, 5), ENSURE_REQUIREMENTS, [id=#31] + +(44) HashAggregate [codegen id : 13] +Input [5]: [i_brand#24, i_brand_id#23, i_manufact_id#25, i_manufact#26, sum#30] +Keys [4]: [i_brand#24, i_brand_id#23, i_manufact_id#25, i_manufact#26] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#8))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#8))#32] +Results [5]: [i_brand_id#23 AS brand_id#33, i_brand#24 AS brand#34, i_manufact_id#25, i_manufact#26, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#8))#32,17,2) AS ext_price#35] + +(45) TakeOrderedAndProject +Input [5]: [brand_id#33, brand#34, i_manufact_id#25, i_manufact#26, ext_price#35] +Arguments: 100, [ext_price#35 DESC NULLS LAST, brand#34 ASC NULLS FIRST, brand_id#33 ASC NULLS FIRST, i_manufact_id#25 ASC NULLS FIRST, i_manufact#26 ASC NULLS FIRST], [brand_id#33, brand#34, i_manufact_id#25, i_manufact#26, ext_price#35] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (46) + + +(46) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19.sf100/simplified.txt new file mode 100644 index 0000000000000..36933c4aac86b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19.sf100/simplified.txt @@ -0,0 +1,78 @@ +TakeOrderedAndProject [ext_price,brand,brand_id,i_manufact_id,i_manufact] + WholeStageCodegen (13) + HashAggregate [i_brand,i_brand_id,i_manufact_id,i_manufact,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [i_brand,i_brand_id,i_manufact_id,i_manufact] #1 + WholeStageCodegen (12) + HashAggregate [i_brand,i_brand_id,i_manufact_id,i_manufact,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price] + SortMergeJoin [c_current_addr_sk,ca_address_sk,ca_zip,s_zip] + InputAdapter + WholeStageCodegen (8) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #2 + WholeStageCodegen (7) + Project [ss_item_sk,ss_ext_sales_price,c_current_addr_sk,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_ext_sales_price,c_current_addr_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #3 + WholeStageCodegen (2) + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [ss_item_sk,ss_customer_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Filter [s_zip,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_zip] + InputAdapter + WholeStageCodegen (10) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #7 + WholeStageCodegen (9) + Filter [ca_address_sk,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_zip] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (11) + Project [i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact,i_manager_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19/explain.txt new file mode 100644 index 0000000000000..e58fb8a1e1364 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19/explain.txt @@ -0,0 +1,222 @@ +== Physical Plan == +TakeOrderedAndProject (39) ++- * HashAggregate (38) + +- Exchange (37) + +- * HashAggregate (36) + +- * Project (35) + +- * BroadcastHashJoin Inner BuildRight (34) + :- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Project (17) + : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.date_dim (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Filter (7) + : : : : +- * ColumnarToRow (6) + : : : : +- Scan parquet default.store_sales (5) + : : : +- BroadcastExchange (15) + : : : +- * Project (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.item (11) + : : +- BroadcastExchange (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.customer (18) + : +- BroadcastExchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.customer_address (24) + +- BroadcastExchange (33) + +- * Filter (32) + +- * ColumnarToRow (31) + +- Scan parquet default.store (30) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,1999), GreaterThanOrEqual(d_date_sk,2451484), LessThanOrEqual(d_date_sk,2451513), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 6] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 6] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 11)) AND (d_year#2 = 1999)) AND (d_date_sk#1 >= 2451484)) AND (d_date_sk#1 <= 2451513)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 6] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) Scan parquet default.store_sales +Output [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), (ss_sold_date_sk#8 >= 2451484), (ss_sold_date_sk#8 <= 2451513), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8] + +(7) Filter [codegen id : 1] +Input [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_item_sk#4) AND isnotnull(ss_customer_sk#5)) AND isnotnull(ss_store_sk#6)) + +(8) BroadcastExchange +Input [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[4, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#8] +Join condition: None + +(10) Project [codegen id : 6] +Output [4]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7] +Input [6]: [d_date_sk#1, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8] + +(11) Scan parquet default.item +Output [6]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, i_manager_id#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,7), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [6]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, i_manager_id#15] + +(13) Filter [codegen id : 2] +Input [6]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, i_manager_id#15] +Condition : ((isnotnull(i_manager_id#15) AND (i_manager_id#15 = 7)) AND isnotnull(i_item_sk#10)) + +(14) Project [codegen id : 2] +Output [5]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14] +Input [6]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, i_manager_id#15] + +(15) BroadcastExchange +Input [5]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(16) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#4] +Right keys [1]: [i_item_sk#10] +Join condition: None + +(17) Project [codegen id : 6] +Output [7]: [ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14] +Input [9]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14] + +(18) Scan parquet default.customer +Output [2]: [c_customer_sk#17, c_current_addr_sk#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [c_customer_sk#17, c_current_addr_sk#18] + +(20) Filter [codegen id : 3] +Input [2]: [c_customer_sk#17, c_current_addr_sk#18] +Condition : (isnotnull(c_customer_sk#17) AND isnotnull(c_current_addr_sk#18)) + +(21) BroadcastExchange +Input [2]: [c_customer_sk#17, c_current_addr_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] + +(22) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#5] +Right keys [1]: [c_customer_sk#17] +Join condition: None + +(23) Project [codegen id : 6] +Output [7]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, c_current_addr_sk#18] +Input [9]: [ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, c_customer_sk#17, c_current_addr_sk#18] + +(24) Scan parquet default.customer_address +Output [2]: [ca_address_sk#20, ca_zip#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_zip)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [2]: [ca_address_sk#20, ca_zip#21] + +(26) Filter [codegen id : 4] +Input [2]: [ca_address_sk#20, ca_zip#21] +Condition : (isnotnull(ca_address_sk#20) AND isnotnull(ca_zip#21)) + +(27) BroadcastExchange +Input [2]: [ca_address_sk#20, ca_zip#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] + +(28) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [c_current_addr_sk#18] +Right keys [1]: [ca_address_sk#20] +Join condition: None + +(29) Project [codegen id : 6] +Output [7]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, ca_zip#21] +Input [9]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, c_current_addr_sk#18, ca_address_sk#20, ca_zip#21] + +(30) Scan parquet default.store +Output [2]: [s_store_sk#23, s_zip#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_zip), IsNotNull(s_store_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 5] +Input [2]: [s_store_sk#23, s_zip#24] + +(32) Filter [codegen id : 5] +Input [2]: [s_store_sk#23, s_zip#24] +Condition : (isnotnull(s_zip#24) AND isnotnull(s_store_sk#23)) + +(33) BroadcastExchange +Input [2]: [s_store_sk#23, s_zip#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] + +(34) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_store_sk#6] +Right keys [1]: [s_store_sk#23] +Join condition: NOT (substr(ca_zip#21, 1, 5) = substr(s_zip#24, 1, 5)) + +(35) Project [codegen id : 6] +Output [5]: [ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14] +Input [9]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, ca_zip#21, s_store_sk#23, s_zip#24] + +(36) HashAggregate [codegen id : 6] +Input [5]: [ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14] +Keys [4]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#7))] +Aggregate Attributes [1]: [sum#26] +Results [5]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14, sum#27] + +(37) Exchange +Input [5]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14, sum#27] +Arguments: hashpartitioning(i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14, 5), ENSURE_REQUIREMENTS, [id=#28] + +(38) HashAggregate [codegen id : 7] +Input [5]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14, sum#27] +Keys [4]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#7))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#7))#29] +Results [5]: [i_brand_id#11 AS brand_id#30, i_brand#12 AS brand#31, i_manufact_id#13, i_manufact#14, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#29,17,2) AS ext_price#32] + +(39) TakeOrderedAndProject +Input [5]: [brand_id#30, brand#31, i_manufact_id#13, i_manufact#14, ext_price#32] +Arguments: 100, [ext_price#32 DESC NULLS LAST, brand#31 ASC NULLS FIRST, brand_id#30 ASC NULLS FIRST, i_manufact_id#13 ASC NULLS FIRST, i_manufact#14 ASC NULLS FIRST], [brand_id#30, brand#31, i_manufact_id#13, i_manufact#14, ext_price#32] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19/simplified.txt new file mode 100644 index 0000000000000..4e00ccb014571 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q19/simplified.txt @@ -0,0 +1,58 @@ +TakeOrderedAndProject [ext_price,brand,brand_id,i_manufact_id,i_manufact] + WholeStageCodegen (7) + HashAggregate [i_brand,i_brand_id,i_manufact_id,i_manufact,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [i_brand,i_brand_id,i_manufact_id,i_manufact] #1 + WholeStageCodegen (6) + HashAggregate [i_brand,i_brand_id,i_manufact_id,i_manufact,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact] + BroadcastHashJoin [ss_store_sk,s_store_sk,ca_zip,s_zip] + Project [ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact,ca_zip] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact,c_current_addr_sk] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_customer_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact,i_manager_id] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [ca_address_sk,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_zip] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Filter [s_zip,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_zip] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt new file mode 100644 index 0000000000000..8f7cbc7d0ffbc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/explain.txt @@ -0,0 +1,445 @@ +== Physical Plan == +TakeOrderedAndProject (77) ++- Union (76) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Project (17) + : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (15) + : : : +- * Project (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.customer_demographics (11) + : : +- BroadcastExchange (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.store (18) + : +- BroadcastExchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.item (24) + :- * HashAggregate (54) + : +- Exchange (53) + : +- * HashAggregate (52) + : +- * Project (51) + : +- * BroadcastHashJoin Inner BuildRight (50) + : :- * Project (48) + : : +- * BroadcastHashJoin Inner BuildRight (47) + : : :- * Project (45) + : : : +- * BroadcastHashJoin Inner BuildRight (44) + : : : :- * Project (38) + : : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : : :- * Filter (35) + : : : : : +- * ColumnarToRow (34) + : : : : : +- Scan parquet default.store_sales (33) + : : : : +- ReusedExchange (36) + : : : +- BroadcastExchange (43) + : : : +- * Project (42) + : : : +- * Filter (41) + : : : +- * ColumnarToRow (40) + : : : +- Scan parquet default.store (39) + : : +- ReusedExchange (46) + : +- ReusedExchange (49) + +- * HashAggregate (75) + +- Exchange (74) + +- * HashAggregate (73) + +- * Project (72) + +- * BroadcastHashJoin Inner BuildRight (71) + :- * Project (66) + : +- * BroadcastHashJoin Inner BuildRight (65) + : :- * Project (63) + : : +- * BroadcastHashJoin Inner BuildRight (62) + : : :- * Project (60) + : : : +- * BroadcastHashJoin Inner BuildRight (59) + : : : :- * Filter (57) + : : : : +- * ColumnarToRow (56) + : : : : +- Scan parquet default.store_sales (55) + : : : +- ReusedExchange (58) + : : +- ReusedExchange (61) + : +- ReusedExchange (64) + +- BroadcastExchange (70) + +- * Filter (69) + +- * ColumnarToRow (68) + +- Scan parquet default.item (67) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), (ss_sold_date_sk#8 >= 2451545), (ss_sold_date_sk#8 <= 2451910), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_cdemo_sk#2) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#10, d_year#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), GreaterThanOrEqual(d_date_sk,2451545), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#10, d_year#11] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#10, d_year#11] +Condition : ((((isnotnull(d_year#11) AND (d_year#11 = 2000)) AND (d_date_sk#10 >= 2451545)) AND (d_date_sk#10 <= 2451910)) AND isnotnull(d_date_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#10] +Input [2]: [d_date_sk#10, d_year#11] + +(8) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#10] + +(11) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#13, cd_gender#14, cd_marital_status#15, cd_education_status#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,F), EqualTo(cd_marital_status,D), EqualTo(cd_education_status,Primary ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [cd_demo_sk#13, cd_gender#14, cd_marital_status#15, cd_education_status#16] + +(13) Filter [codegen id : 2] +Input [4]: [cd_demo_sk#13, cd_gender#14, cd_marital_status#15, cd_education_status#16] +Condition : ((((((isnotnull(cd_gender#14) AND isnotnull(cd_marital_status#15)) AND isnotnull(cd_education_status#16)) AND (cd_gender#14 = F)) AND (cd_marital_status#15 = D)) AND (cd_education_status#16 = Primary )) AND isnotnull(cd_demo_sk#13)) + +(14) Project [codegen id : 2] +Output [1]: [cd_demo_sk#13] +Input [4]: [cd_demo_sk#13, cd_gender#14, cd_marital_status#15, cd_education_status#16] + +(15) BroadcastExchange +Input [1]: [cd_demo_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#13] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, cd_demo_sk#13] + +(18) Scan parquet default.store +Output [2]: [s_store_sk#18, s_state#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_state, [TN,AL,SD]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#18, s_state#19] + +(20) Filter [codegen id : 3] +Input [2]: [s_store_sk#18, s_state#19] +Condition : (s_state#19 IN (TN,AL,SD) AND isnotnull(s_store_sk#18)) + +(21) BroadcastExchange +Input [2]: [s_store_sk#18, s_state#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(22) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#18] +Join condition: None + +(23) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#19] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#18, s_state#19] + +(24) Scan parquet default.item +Output [2]: [i_item_sk#21, i_item_id#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#21, i_item_id#22] + +(26) Filter [codegen id : 4] +Input [2]: [i_item_sk#21, i_item_id#22] +Condition : isnotnull(i_item_sk#21) + +(27) BroadcastExchange +Input [2]: [i_item_sk#21, i_item_id#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#21] +Join condition: None + +(29) Project [codegen id : 5] +Output [6]: [i_item_id#22, s_state#19, ss_quantity#4 AS agg1#24, ss_list_price#5 AS agg2#25, ss_coupon_amt#7 AS agg3#26, ss_sales_price#6 AS agg4#27] +Input [8]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#19, i_item_sk#21, i_item_id#22] + +(30) HashAggregate [codegen id : 5] +Input [6]: [i_item_id#22, s_state#19, agg1#24, agg2#25, agg3#26, agg4#27] +Keys [2]: [i_item_id#22, s_state#19] +Functions [4]: [partial_avg(agg1#24), partial_avg(UnscaledValue(agg2#25)), partial_avg(UnscaledValue(agg3#26)), partial_avg(UnscaledValue(agg4#27))] +Aggregate Attributes [8]: [sum#28, count#29, sum#30, count#31, sum#32, count#33, sum#34, count#35] +Results [10]: [i_item_id#22, s_state#19, sum#36, count#37, sum#38, count#39, sum#40, count#41, sum#42, count#43] + +(31) Exchange +Input [10]: [i_item_id#22, s_state#19, sum#36, count#37, sum#38, count#39, sum#40, count#41, sum#42, count#43] +Arguments: hashpartitioning(i_item_id#22, s_state#19, 5), ENSURE_REQUIREMENTS, [id=#44] + +(32) HashAggregate [codegen id : 6] +Input [10]: [i_item_id#22, s_state#19, sum#36, count#37, sum#38, count#39, sum#40, count#41, sum#42, count#43] +Keys [2]: [i_item_id#22, s_state#19] +Functions [4]: [avg(agg1#24), avg(UnscaledValue(agg2#25)), avg(UnscaledValue(agg3#26)), avg(UnscaledValue(agg4#27))] +Aggregate Attributes [4]: [avg(agg1#24)#45, avg(UnscaledValue(agg2#25))#46, avg(UnscaledValue(agg3#26))#47, avg(UnscaledValue(agg4#27))#48] +Results [7]: [i_item_id#22, s_state#19, 0 AS g_state#49, avg(agg1#24)#45 AS agg1#50, cast((avg(UnscaledValue(agg2#25))#46 / 100.0) as decimal(11,6)) AS agg2#51, cast((avg(UnscaledValue(agg3#26))#47 / 100.0) as decimal(11,6)) AS agg3#52, cast((avg(UnscaledValue(agg4#27))#48 / 100.0) as decimal(11,6)) AS agg4#53] + +(33) Scan parquet default.store_sales +Output [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#61), (ss_sold_date_sk#61 >= 2451545), (ss_sold_date_sk#61 <= 2451910), dynamicpruningexpression(ss_sold_date_sk#61 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] + +(35) Filter [codegen id : 11] +Input [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] +Condition : ((isnotnull(ss_cdemo_sk#55) AND isnotnull(ss_store_sk#56)) AND isnotnull(ss_item_sk#54)) + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#62] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_sold_date_sk#61] +Right keys [1]: [d_date_sk#62] +Join condition: None + +(38) Project [codegen id : 11] +Output [7]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60] +Input [9]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61, d_date_sk#62] + +(39) Scan parquet default.store +Output [2]: [s_store_sk#63, s_state#64] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_state, [TN,AL,SD]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 8] +Input [2]: [s_store_sk#63, s_state#64] + +(41) Filter [codegen id : 8] +Input [2]: [s_store_sk#63, s_state#64] +Condition : (s_state#64 IN (TN,AL,SD) AND isnotnull(s_store_sk#63)) + +(42) Project [codegen id : 8] +Output [1]: [s_store_sk#63] +Input [2]: [s_store_sk#63, s_state#64] + +(43) BroadcastExchange +Input [1]: [s_store_sk#63] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#65] + +(44) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_store_sk#56] +Right keys [1]: [s_store_sk#63] +Join condition: None + +(45) Project [codegen id : 11] +Output [6]: [ss_item_sk#54, ss_cdemo_sk#55, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60] +Input [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, s_store_sk#63] + +(46) ReusedExchange [Reuses operator id: 15] +Output [1]: [cd_demo_sk#66] + +(47) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_cdemo_sk#55] +Right keys [1]: [cd_demo_sk#66] +Join condition: None + +(48) Project [codegen id : 11] +Output [5]: [ss_item_sk#54, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60] +Input [7]: [ss_item_sk#54, ss_cdemo_sk#55, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, cd_demo_sk#66] + +(49) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#67, i_item_id#68] + +(50) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_item_sk#54] +Right keys [1]: [i_item_sk#67] +Join condition: None + +(51) Project [codegen id : 11] +Output [5]: [i_item_id#68, ss_quantity#57 AS agg1#24, ss_list_price#58 AS agg2#25, ss_coupon_amt#60 AS agg3#26, ss_sales_price#59 AS agg4#27] +Input [7]: [ss_item_sk#54, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, i_item_sk#67, i_item_id#68] + +(52) HashAggregate [codegen id : 11] +Input [5]: [i_item_id#68, agg1#24, agg2#25, agg3#26, agg4#27] +Keys [1]: [i_item_id#68] +Functions [4]: [partial_avg(agg1#24), partial_avg(UnscaledValue(agg2#25)), partial_avg(UnscaledValue(agg3#26)), partial_avg(UnscaledValue(agg4#27))] +Aggregate Attributes [8]: [sum#69, count#70, sum#71, count#72, sum#73, count#74, sum#75, count#76] +Results [9]: [i_item_id#68, sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84] + +(53) Exchange +Input [9]: [i_item_id#68, sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84] +Arguments: hashpartitioning(i_item_id#68, 5), ENSURE_REQUIREMENTS, [id=#85] + +(54) HashAggregate [codegen id : 12] +Input [9]: [i_item_id#68, sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84] +Keys [1]: [i_item_id#68] +Functions [4]: [avg(agg1#24), avg(UnscaledValue(agg2#25)), avg(UnscaledValue(agg3#26)), avg(UnscaledValue(agg4#27))] +Aggregate Attributes [4]: [avg(agg1#24)#86, avg(UnscaledValue(agg2#25))#87, avg(UnscaledValue(agg3#26))#88, avg(UnscaledValue(agg4#27))#89] +Results [7]: [i_item_id#68, null AS s_state#90, 1 AS g_state#91, avg(agg1#24)#86 AS agg1#92, cast((avg(UnscaledValue(agg2#25))#87 / 100.0) as decimal(11,6)) AS agg2#93, cast((avg(UnscaledValue(agg3#26))#88 / 100.0) as decimal(11,6)) AS agg3#94, cast((avg(UnscaledValue(agg4#27))#89 / 100.0) as decimal(11,6)) AS agg4#95] + +(55) Scan parquet default.store_sales +Output [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#103), (ss_sold_date_sk#103 >= 2451545), (ss_sold_date_sk#103 <= 2451910), dynamicpruningexpression(ss_sold_date_sk#103 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(56) ColumnarToRow [codegen id : 17] +Input [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] + +(57) Filter [codegen id : 17] +Input [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] +Condition : ((isnotnull(ss_cdemo_sk#97) AND isnotnull(ss_store_sk#98)) AND isnotnull(ss_item_sk#96)) + +(58) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#104] + +(59) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_sold_date_sk#103] +Right keys [1]: [d_date_sk#104] +Join condition: None + +(60) Project [codegen id : 17] +Output [7]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102] +Input [9]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103, d_date_sk#104] + +(61) ReusedExchange [Reuses operator id: 43] +Output [1]: [s_store_sk#105] + +(62) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_store_sk#98] +Right keys [1]: [s_store_sk#105] +Join condition: None + +(63) Project [codegen id : 17] +Output [6]: [ss_item_sk#96, ss_cdemo_sk#97, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102] +Input [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, s_store_sk#105] + +(64) ReusedExchange [Reuses operator id: 15] +Output [1]: [cd_demo_sk#106] + +(65) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_cdemo_sk#97] +Right keys [1]: [cd_demo_sk#106] +Join condition: None + +(66) Project [codegen id : 17] +Output [5]: [ss_item_sk#96, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102] +Input [7]: [ss_item_sk#96, ss_cdemo_sk#97, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, cd_demo_sk#106] + +(67) Scan parquet default.item +Output [1]: [i_item_sk#107] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(68) ColumnarToRow [codegen id : 16] +Input [1]: [i_item_sk#107] + +(69) Filter [codegen id : 16] +Input [1]: [i_item_sk#107] +Condition : isnotnull(i_item_sk#107) + +(70) BroadcastExchange +Input [1]: [i_item_sk#107] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#108] + +(71) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_item_sk#96] +Right keys [1]: [i_item_sk#107] +Join condition: None + +(72) Project [codegen id : 17] +Output [4]: [ss_quantity#99 AS agg1#24, ss_list_price#100 AS agg2#25, ss_coupon_amt#102 AS agg3#26, ss_sales_price#101 AS agg4#27] +Input [6]: [ss_item_sk#96, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, i_item_sk#107] + +(73) HashAggregate [codegen id : 17] +Input [4]: [agg1#24, agg2#25, agg3#26, agg4#27] +Keys: [] +Functions [4]: [partial_avg(agg1#24), partial_avg(UnscaledValue(agg2#25)), partial_avg(UnscaledValue(agg3#26)), partial_avg(UnscaledValue(agg4#27))] +Aggregate Attributes [8]: [sum#109, count#110, sum#111, count#112, sum#113, count#114, sum#115, count#116] +Results [8]: [sum#117, count#118, sum#119, count#120, sum#121, count#122, sum#123, count#124] + +(74) Exchange +Input [8]: [sum#117, count#118, sum#119, count#120, sum#121, count#122, sum#123, count#124] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#125] + +(75) HashAggregate [codegen id : 18] +Input [8]: [sum#117, count#118, sum#119, count#120, sum#121, count#122, sum#123, count#124] +Keys: [] +Functions [4]: [avg(agg1#24), avg(UnscaledValue(agg2#25)), avg(UnscaledValue(agg3#26)), avg(UnscaledValue(agg4#27))] +Aggregate Attributes [4]: [avg(agg1#24)#126, avg(UnscaledValue(agg2#25))#127, avg(UnscaledValue(agg3#26))#128, avg(UnscaledValue(agg4#27))#129] +Results [7]: [null AS i_item_id#130, null AS s_state#131, 1 AS g_state#132, avg(agg1#24)#126 AS agg1#133, cast((avg(UnscaledValue(agg2#25))#127 / 100.0) as decimal(11,6)) AS agg2#134, cast((avg(UnscaledValue(agg3#26))#128 / 100.0) as decimal(11,6)) AS agg3#135, cast((avg(UnscaledValue(agg4#27))#129 / 100.0) as decimal(11,6)) AS agg4#136] + +(76) Union + +(77) TakeOrderedAndProject +Input [7]: [i_item_id#22, s_state#19, g_state#49, agg1#50, agg2#51, agg3#52, agg4#53] +Arguments: 100, [i_item_id#22 ASC NULLS FIRST, s_state#19 ASC NULLS FIRST], [i_item_id#22, s_state#19, g_state#49, agg1#50, agg2#51, agg3#52, agg4#53] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (78) + + +(78) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#10] + +Subquery:2 Hosting operator id = 33 Hosting Expression = ss_sold_date_sk#61 IN dynamicpruning#9 + +Subquery:3 Hosting operator id = 55 Hosting Expression = ss_sold_date_sk#103 IN dynamicpruning#9 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/simplified.txt new file mode 100644 index 0000000000000..102307ec83594 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27.sf100/simplified.txt @@ -0,0 +1,117 @@ +TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] + Union + WholeStageCodegen (6) + HashAggregate [i_item_id,s_state,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,s_state] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,s_state,agg1,agg2,agg3,agg4] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,s_state,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [cd_demo_sk] + Filter [cd_gender,cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + WholeStageCodegen (12) + HashAggregate [i_item_id,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),s_state,g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id] #6 + WholeStageCodegen (11) + HashAggregate [i_item_id,agg1,agg2,agg3,agg4] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (8) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + ReusedExchange [cd_demo_sk] #3 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 + WholeStageCodegen (18) + HashAggregate [sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),i_item_id,s_state,g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange #8 + WholeStageCodegen (17) + HashAggregate [agg1,agg2,agg3,agg4] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [s_store_sk] #7 + InputAdapter + ReusedExchange [cd_demo_sk] #3 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (16) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt new file mode 100644 index 0000000000000..bfb9e8384817d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/explain.txt @@ -0,0 +1,445 @@ +== Physical Plan == +TakeOrderedAndProject (77) ++- Union (76) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Project (17) + : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.customer_demographics (4) + : : : +- BroadcastExchange (15) + : : : +- * Project (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.date_dim (11) + : : +- BroadcastExchange (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.store (18) + : +- BroadcastExchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.item (24) + :- * HashAggregate (54) + : +- Exchange (53) + : +- * HashAggregate (52) + : +- * Project (51) + : +- * BroadcastHashJoin Inner BuildRight (50) + : :- * Project (48) + : : +- * BroadcastHashJoin Inner BuildRight (47) + : : :- * Project (41) + : : : +- * BroadcastHashJoin Inner BuildRight (40) + : : : :- * Project (38) + : : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : : :- * Filter (35) + : : : : : +- * ColumnarToRow (34) + : : : : : +- Scan parquet default.store_sales (33) + : : : : +- ReusedExchange (36) + : : : +- ReusedExchange (39) + : : +- BroadcastExchange (46) + : : +- * Project (45) + : : +- * Filter (44) + : : +- * ColumnarToRow (43) + : : +- Scan parquet default.store (42) + : +- ReusedExchange (49) + +- * HashAggregate (75) + +- Exchange (74) + +- * HashAggregate (73) + +- * Project (72) + +- * BroadcastHashJoin Inner BuildRight (71) + :- * Project (66) + : +- * BroadcastHashJoin Inner BuildRight (65) + : :- * Project (63) + : : +- * BroadcastHashJoin Inner BuildRight (62) + : : :- * Project (60) + : : : +- * BroadcastHashJoin Inner BuildRight (59) + : : : :- * Filter (57) + : : : : +- * ColumnarToRow (56) + : : : : +- Scan parquet default.store_sales (55) + : : : +- ReusedExchange (58) + : : +- ReusedExchange (61) + : +- ReusedExchange (64) + +- BroadcastExchange (70) + +- * Filter (69) + +- * ColumnarToRow (68) + +- Scan parquet default.item (67) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), (ss_sold_date_sk#8 >= 2451545), (ss_sold_date_sk#8 <= 2451910), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_cdemo_sk#2) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,F), EqualTo(cd_marital_status,D), EqualTo(cd_education_status,Primary ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Condition : ((((((isnotnull(cd_gender#11) AND isnotnull(cd_marital_status#12)) AND isnotnull(cd_education_status#13)) AND (cd_gender#11 = F)) AND (cd_marital_status#12 = D)) AND (cd_education_status#13 = Primary )) AND isnotnull(cd_demo_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#10] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(8) BroadcastExchange +Input [1]: [cd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, cd_demo_sk#10] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#15, d_year#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), GreaterThanOrEqual(d_date_sk,2451545), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] +Condition : ((((isnotnull(d_year#16) AND (d_year#16 = 2000)) AND (d_date_sk#15 >= 2451545)) AND (d_date_sk#15 <= 2451910)) AND isnotnull(d_date_sk#15)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#15] +Input [2]: [d_date_sk#15, d_year#16] + +(15) BroadcastExchange +Input [1]: [d_date_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#15] + +(18) Scan parquet default.store +Output [2]: [s_store_sk#18, s_state#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_state, [TN,AL,SD]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#18, s_state#19] + +(20) Filter [codegen id : 3] +Input [2]: [s_store_sk#18, s_state#19] +Condition : (s_state#19 IN (TN,AL,SD) AND isnotnull(s_store_sk#18)) + +(21) BroadcastExchange +Input [2]: [s_store_sk#18, s_state#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(22) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#18] +Join condition: None + +(23) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#19] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#18, s_state#19] + +(24) Scan parquet default.item +Output [2]: [i_item_sk#21, i_item_id#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#21, i_item_id#22] + +(26) Filter [codegen id : 4] +Input [2]: [i_item_sk#21, i_item_id#22] +Condition : isnotnull(i_item_sk#21) + +(27) BroadcastExchange +Input [2]: [i_item_sk#21, i_item_id#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#21] +Join condition: None + +(29) Project [codegen id : 5] +Output [6]: [i_item_id#22, s_state#19, ss_quantity#4 AS agg1#24, ss_list_price#5 AS agg2#25, ss_coupon_amt#7 AS agg3#26, ss_sales_price#6 AS agg4#27] +Input [8]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#19, i_item_sk#21, i_item_id#22] + +(30) HashAggregate [codegen id : 5] +Input [6]: [i_item_id#22, s_state#19, agg1#24, agg2#25, agg3#26, agg4#27] +Keys [2]: [i_item_id#22, s_state#19] +Functions [4]: [partial_avg(agg1#24), partial_avg(UnscaledValue(agg2#25)), partial_avg(UnscaledValue(agg3#26)), partial_avg(UnscaledValue(agg4#27))] +Aggregate Attributes [8]: [sum#28, count#29, sum#30, count#31, sum#32, count#33, sum#34, count#35] +Results [10]: [i_item_id#22, s_state#19, sum#36, count#37, sum#38, count#39, sum#40, count#41, sum#42, count#43] + +(31) Exchange +Input [10]: [i_item_id#22, s_state#19, sum#36, count#37, sum#38, count#39, sum#40, count#41, sum#42, count#43] +Arguments: hashpartitioning(i_item_id#22, s_state#19, 5), ENSURE_REQUIREMENTS, [id=#44] + +(32) HashAggregate [codegen id : 6] +Input [10]: [i_item_id#22, s_state#19, sum#36, count#37, sum#38, count#39, sum#40, count#41, sum#42, count#43] +Keys [2]: [i_item_id#22, s_state#19] +Functions [4]: [avg(agg1#24), avg(UnscaledValue(agg2#25)), avg(UnscaledValue(agg3#26)), avg(UnscaledValue(agg4#27))] +Aggregate Attributes [4]: [avg(agg1#24)#45, avg(UnscaledValue(agg2#25))#46, avg(UnscaledValue(agg3#26))#47, avg(UnscaledValue(agg4#27))#48] +Results [7]: [i_item_id#22, s_state#19, 0 AS g_state#49, avg(agg1#24)#45 AS agg1#50, cast((avg(UnscaledValue(agg2#25))#46 / 100.0) as decimal(11,6)) AS agg2#51, cast((avg(UnscaledValue(agg3#26))#47 / 100.0) as decimal(11,6)) AS agg3#52, cast((avg(UnscaledValue(agg4#27))#48 / 100.0) as decimal(11,6)) AS agg4#53] + +(33) Scan parquet default.store_sales +Output [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#61), (ss_sold_date_sk#61 >= 2451545), (ss_sold_date_sk#61 <= 2451910), dynamicpruningexpression(ss_sold_date_sk#61 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] + +(35) Filter [codegen id : 11] +Input [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] +Condition : ((isnotnull(ss_cdemo_sk#55) AND isnotnull(ss_store_sk#56)) AND isnotnull(ss_item_sk#54)) + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [cd_demo_sk#62] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_cdemo_sk#55] +Right keys [1]: [cd_demo_sk#62] +Join condition: None + +(38) Project [codegen id : 11] +Output [7]: [ss_item_sk#54, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] +Input [9]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61, cd_demo_sk#62] + +(39) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#63] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_sold_date_sk#61] +Right keys [1]: [d_date_sk#63] +Join condition: None + +(41) Project [codegen id : 11] +Output [6]: [ss_item_sk#54, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60] +Input [8]: [ss_item_sk#54, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61, d_date_sk#63] + +(42) Scan parquet default.store +Output [2]: [s_store_sk#64, s_state#65] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_state, [TN,AL,SD]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(43) ColumnarToRow [codegen id : 9] +Input [2]: [s_store_sk#64, s_state#65] + +(44) Filter [codegen id : 9] +Input [2]: [s_store_sk#64, s_state#65] +Condition : (s_state#65 IN (TN,AL,SD) AND isnotnull(s_store_sk#64)) + +(45) Project [codegen id : 9] +Output [1]: [s_store_sk#64] +Input [2]: [s_store_sk#64, s_state#65] + +(46) BroadcastExchange +Input [1]: [s_store_sk#64] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#66] + +(47) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_store_sk#56] +Right keys [1]: [s_store_sk#64] +Join condition: None + +(48) Project [codegen id : 11] +Output [5]: [ss_item_sk#54, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60] +Input [7]: [ss_item_sk#54, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, s_store_sk#64] + +(49) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#67, i_item_id#68] + +(50) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_item_sk#54] +Right keys [1]: [i_item_sk#67] +Join condition: None + +(51) Project [codegen id : 11] +Output [5]: [i_item_id#68, ss_quantity#57 AS agg1#24, ss_list_price#58 AS agg2#25, ss_coupon_amt#60 AS agg3#26, ss_sales_price#59 AS agg4#27] +Input [7]: [ss_item_sk#54, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, i_item_sk#67, i_item_id#68] + +(52) HashAggregate [codegen id : 11] +Input [5]: [i_item_id#68, agg1#24, agg2#25, agg3#26, agg4#27] +Keys [1]: [i_item_id#68] +Functions [4]: [partial_avg(agg1#24), partial_avg(UnscaledValue(agg2#25)), partial_avg(UnscaledValue(agg3#26)), partial_avg(UnscaledValue(agg4#27))] +Aggregate Attributes [8]: [sum#69, count#70, sum#71, count#72, sum#73, count#74, sum#75, count#76] +Results [9]: [i_item_id#68, sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84] + +(53) Exchange +Input [9]: [i_item_id#68, sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84] +Arguments: hashpartitioning(i_item_id#68, 5), ENSURE_REQUIREMENTS, [id=#85] + +(54) HashAggregate [codegen id : 12] +Input [9]: [i_item_id#68, sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84] +Keys [1]: [i_item_id#68] +Functions [4]: [avg(agg1#24), avg(UnscaledValue(agg2#25)), avg(UnscaledValue(agg3#26)), avg(UnscaledValue(agg4#27))] +Aggregate Attributes [4]: [avg(agg1#24)#86, avg(UnscaledValue(agg2#25))#87, avg(UnscaledValue(agg3#26))#88, avg(UnscaledValue(agg4#27))#89] +Results [7]: [i_item_id#68, null AS s_state#90, 1 AS g_state#91, avg(agg1#24)#86 AS agg1#92, cast((avg(UnscaledValue(agg2#25))#87 / 100.0) as decimal(11,6)) AS agg2#93, cast((avg(UnscaledValue(agg3#26))#88 / 100.0) as decimal(11,6)) AS agg3#94, cast((avg(UnscaledValue(agg4#27))#89 / 100.0) as decimal(11,6)) AS agg4#95] + +(55) Scan parquet default.store_sales +Output [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#103), (ss_sold_date_sk#103 >= 2451545), (ss_sold_date_sk#103 <= 2451910), dynamicpruningexpression(ss_sold_date_sk#103 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(56) ColumnarToRow [codegen id : 17] +Input [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] + +(57) Filter [codegen id : 17] +Input [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] +Condition : ((isnotnull(ss_cdemo_sk#97) AND isnotnull(ss_store_sk#98)) AND isnotnull(ss_item_sk#96)) + +(58) ReusedExchange [Reuses operator id: 8] +Output [1]: [cd_demo_sk#104] + +(59) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_cdemo_sk#97] +Right keys [1]: [cd_demo_sk#104] +Join condition: None + +(60) Project [codegen id : 17] +Output [7]: [ss_item_sk#96, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] +Input [9]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103, cd_demo_sk#104] + +(61) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#105] + +(62) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_sold_date_sk#103] +Right keys [1]: [d_date_sk#105] +Join condition: None + +(63) Project [codegen id : 17] +Output [6]: [ss_item_sk#96, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102] +Input [8]: [ss_item_sk#96, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103, d_date_sk#105] + +(64) ReusedExchange [Reuses operator id: 46] +Output [1]: [s_store_sk#106] + +(65) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_store_sk#98] +Right keys [1]: [s_store_sk#106] +Join condition: None + +(66) Project [codegen id : 17] +Output [5]: [ss_item_sk#96, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102] +Input [7]: [ss_item_sk#96, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, s_store_sk#106] + +(67) Scan parquet default.item +Output [1]: [i_item_sk#107] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(68) ColumnarToRow [codegen id : 16] +Input [1]: [i_item_sk#107] + +(69) Filter [codegen id : 16] +Input [1]: [i_item_sk#107] +Condition : isnotnull(i_item_sk#107) + +(70) BroadcastExchange +Input [1]: [i_item_sk#107] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#108] + +(71) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_item_sk#96] +Right keys [1]: [i_item_sk#107] +Join condition: None + +(72) Project [codegen id : 17] +Output [4]: [ss_quantity#99 AS agg1#24, ss_list_price#100 AS agg2#25, ss_coupon_amt#102 AS agg3#26, ss_sales_price#101 AS agg4#27] +Input [6]: [ss_item_sk#96, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, i_item_sk#107] + +(73) HashAggregate [codegen id : 17] +Input [4]: [agg1#24, agg2#25, agg3#26, agg4#27] +Keys: [] +Functions [4]: [partial_avg(agg1#24), partial_avg(UnscaledValue(agg2#25)), partial_avg(UnscaledValue(agg3#26)), partial_avg(UnscaledValue(agg4#27))] +Aggregate Attributes [8]: [sum#109, count#110, sum#111, count#112, sum#113, count#114, sum#115, count#116] +Results [8]: [sum#117, count#118, sum#119, count#120, sum#121, count#122, sum#123, count#124] + +(74) Exchange +Input [8]: [sum#117, count#118, sum#119, count#120, sum#121, count#122, sum#123, count#124] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#125] + +(75) HashAggregate [codegen id : 18] +Input [8]: [sum#117, count#118, sum#119, count#120, sum#121, count#122, sum#123, count#124] +Keys: [] +Functions [4]: [avg(agg1#24), avg(UnscaledValue(agg2#25)), avg(UnscaledValue(agg3#26)), avg(UnscaledValue(agg4#27))] +Aggregate Attributes [4]: [avg(agg1#24)#126, avg(UnscaledValue(agg2#25))#127, avg(UnscaledValue(agg3#26))#128, avg(UnscaledValue(agg4#27))#129] +Results [7]: [null AS i_item_id#130, null AS s_state#131, 1 AS g_state#132, avg(agg1#24)#126 AS agg1#133, cast((avg(UnscaledValue(agg2#25))#127 / 100.0) as decimal(11,6)) AS agg2#134, cast((avg(UnscaledValue(agg3#26))#128 / 100.0) as decimal(11,6)) AS agg3#135, cast((avg(UnscaledValue(agg4#27))#129 / 100.0) as decimal(11,6)) AS agg4#136] + +(76) Union + +(77) TakeOrderedAndProject +Input [7]: [i_item_id#22, s_state#19, g_state#49, agg1#50, agg2#51, agg3#52, agg4#53] +Arguments: 100, [i_item_id#22 ASC NULLS FIRST, s_state#19 ASC NULLS FIRST], [i_item_id#22, s_state#19, g_state#49, agg1#50, agg2#51, agg3#52, agg4#53] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (78) + + +(78) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#15] + +Subquery:2 Hosting operator id = 33 Hosting Expression = ss_sold_date_sk#61 IN dynamicpruning#9 + +Subquery:3 Hosting operator id = 55 Hosting Expression = ss_sold_date_sk#103 IN dynamicpruning#9 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/simplified.txt new file mode 100644 index 0000000000000..ac6635c260051 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q27/simplified.txt @@ -0,0 +1,117 @@ +TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] + Union + WholeStageCodegen (6) + HashAggregate [i_item_id,s_state,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,s_state] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,s_state,agg1,agg2,agg3,agg4] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,s_state,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [cd_demo_sk] + Filter [cd_gender,cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + WholeStageCodegen (12) + HashAggregate [i_item_id,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),s_state,g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id] #6 + WholeStageCodegen (11) + HashAggregate [i_item_id,agg1,agg2,agg3,agg4] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [cd_demo_sk] #3 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (9) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 + WholeStageCodegen (18) + HashAggregate [sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),i_item_id,s_state,g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange #8 + WholeStageCodegen (17) + HashAggregate [agg1,agg2,agg3,agg4] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [cd_demo_sk] #3 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [s_store_sk] #7 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (16) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt new file mode 100644 index 0000000000000..ae3e54365ced4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/explain.txt @@ -0,0 +1,133 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.date_dim (11) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [((((((((((ss_sold_date_sk#3 >= 2415355) AND (ss_sold_date_sk#3 <= 2415385)) OR ((ss_sold_date_sk#3 >= 2415720) AND (ss_sold_date_sk#3 <= 2415750))) OR (((ss_sold_date_sk#3 >= 2416085) AND (ss_sold_date_sk#3 <= 2416115)) OR ((ss_sold_date_sk#3 >= 2416450) AND (ss_sold_date_sk#3 <= 2416480)))) OR ((((ss_sold_date_sk#3 >= 2416816) AND (ss_sold_date_sk#3 <= 2416846)) OR ((ss_sold_date_sk#3 >= 2417181) AND (ss_sold_date_sk#3 <= 2417211))) OR ((ss_sold_date_sk#3 >= 2417546) AND (ss_sold_date_sk#3 <= 2417576)))) OR (((((ss_sold_date_sk#3 >= 2417911) AND (ss_sold_date_sk#3 <= 2417941)) OR ((ss_sold_date_sk#3 >= 2418277) AND (ss_sold_date_sk#3 <= 2418307))) OR ((ss_sold_date_sk#3 >= 2418642) AND (ss_sold_date_sk#3 <= 2418672))) OR ((((ss_sold_date_sk#3 >= 2419007) AND (ss_sold_date_sk#3 <= 2419037)) OR ((ss_sold_date_sk#3 >= 2419372) AND (ss_sold_date_sk#3 <= 2419402))) OR ((ss_sold_date_sk#3 >= 2419738) AND (ss_sold_date_sk#3 <= 2419768))))) OR ((((((ss_sold_date_sk#3 >= 2420103) AND (ss_sold_date_sk#3 <= 2420133)) OR ((ss_sold_date_sk#3 >= 2420468) AND (ss_sold_date_sk#3 <= 2420498))) OR ((ss_sold_date_sk#3 >= 2420833) AND (ss_sold_date_sk#3 <= 2420863))) OR ((((ss_sold_date_sk#3 >= 2421199) AND (ss_sold_date_sk#3 <= 2421229)) OR ((ss_sold_date_sk#3 >= 2421564) AND (ss_sold_date_sk#3 <= 2421594))) OR ((ss_sold_date_sk#3 >= 2421929) AND (ss_sold_date_sk#3 <= 2421959)))) OR (((((ss_sold_date_sk#3 >= 2422294) AND (ss_sold_date_sk#3 <= 2422324)) OR ((ss_sold_date_sk#3 >= 2422660) AND (ss_sold_date_sk#3 <= 2422690))) OR ((ss_sold_date_sk#3 >= 2423025) AND (ss_sold_date_sk#3 <= 2423055))) OR ((((ss_sold_date_sk#3 >= 2423390) AND (ss_sold_date_sk#3 <= 2423420)) OR ((ss_sold_date_sk#3 >= 2423755) AND (ss_sold_date_sk#3 <= 2423785))) OR ((ss_sold_date_sk#3 >= 2424121) AND (ss_sold_date_sk#3 <= 2424151)))))) OR (((((((ss_sold_date_sk#3 >= 2424486) AND (ss_sold_date_sk#3 <= 2424516)) OR ((ss_sold_date_sk#3 >= 2424851) AND (ss_sold_date_sk#3 <= 2424881))) OR (((ss_sold_date_sk#3 >= 2425216) AND (ss_sold_date_sk#3 <= 2425246)) OR ((ss_sold_date_sk#3 >= 2425582) AND (ss_sold_date_sk#3 <= 2425612)))) OR ((((ss_sold_date_sk#3 >= 2425947) AND (ss_sold_date_sk#3 <= 2425977)) OR ((ss_sold_date_sk#3 >= 2426312) AND (ss_sold_date_sk#3 <= 2426342))) OR ((ss_sold_date_sk#3 >= 2426677) AND (ss_sold_date_sk#3 <= 2426707)))) OR (((((ss_sold_date_sk#3 >= 2427043) AND (ss_sold_date_sk#3 <= 2427073)) OR ((ss_sold_date_sk#3 >= 2427408) AND (ss_sold_date_sk#3 <= 2427438))) OR ((ss_sold_date_sk#3 >= 2427773) AND (ss_sold_date_sk#3 <= 2427803))) OR ((((ss_sold_date_sk#3 >= 2428138) AND (ss_sold_date_sk#3 <= 2428168)) OR ((ss_sold_date_sk#3 >= 2428504) AND (ss_sold_date_sk#3 <= 2428534))) OR ((ss_sold_date_sk#3 >= 2428869) AND (ss_sold_date_sk#3 <= 2428899))))) OR ((((((ss_sold_date_sk#3 >= 2429234) AND (ss_sold_date_sk#3 <= 2429264)) OR ((ss_sold_date_sk#3 >= 2429599) AND (ss_sold_date_sk#3 <= 2429629))) OR ((ss_sold_date_sk#3 >= 2429965) AND (ss_sold_date_sk#3 <= 2429995))) OR ((((ss_sold_date_sk#3 >= 2430330) AND (ss_sold_date_sk#3 <= 2430360)) OR ((ss_sold_date_sk#3 >= 2430695) AND (ss_sold_date_sk#3 <= 2430725))) OR ((ss_sold_date_sk#3 >= 2431060) AND (ss_sold_date_sk#3 <= 2431090)))) OR (((((ss_sold_date_sk#3 >= 2431426) AND (ss_sold_date_sk#3 <= 2431456)) OR ((ss_sold_date_sk#3 >= 2431791) AND (ss_sold_date_sk#3 <= 2431821))) OR ((ss_sold_date_sk#3 >= 2432156) AND (ss_sold_date_sk#3 <= 2432186))) OR ((((ss_sold_date_sk#3 >= 2432521) AND (ss_sold_date_sk#3 <= 2432551)) OR ((ss_sold_date_sk#3 >= 2432887) AND (ss_sold_date_sk#3 <= 2432917))) OR ((ss_sold_date_sk#3 >= 2433252) AND (ss_sold_date_sk#3 <= 2433282))))))) OR ((((((((ss_sold_date_sk#3 >= 2433617) AND (ss_sold_date_sk#3 <= 2433647)) OR ((ss_sold_date_sk#3 >= 2433982) AND (ss_sold_date_sk#3 <= 2434012))) OR (((ss_sold_date_sk#3 >= 2434348) AND (ss_sold_date_sk#3 <= 2434378)) OR ((ss_sold_date_sk#3 >= 2434713) AND (ss_sold_date_sk#3 <= 2434743)))) OR ((((ss_sold_date_sk#3 >= 2435078) AND (ss_sold_date_sk#3 <= 2435108)) OR ((ss_sold_date_sk#3 >= 2435443) AND (ss_sold_date_sk#3 <= 2435473))) OR ((ss_sold_date_sk#3 >= 2435809) AND (ss_sold_date_sk#3 <= 2435839)))) OR (((((ss_sold_date_sk#3 >= 2436174) AND (ss_sold_date_sk#3 <= 2436204)) OR ((ss_sold_date_sk#3 >= 2436539) AND (ss_sold_date_sk#3 <= 2436569))) OR ((ss_sold_date_sk#3 >= 2436904) AND (ss_sold_date_sk#3 <= 2436934))) OR ((((ss_sold_date_sk#3 >= 2437270) AND (ss_sold_date_sk#3 <= 2437300)) OR ((ss_sold_date_sk#3 >= 2437635) AND (ss_sold_date_sk#3 <= 2437665))) OR ((ss_sold_date_sk#3 >= 2438000) AND (ss_sold_date_sk#3 <= 2438030))))) OR ((((((ss_sold_date_sk#3 >= 2438365) AND (ss_sold_date_sk#3 <= 2438395)) OR ((ss_sold_date_sk#3 >= 2438731) AND (ss_sold_date_sk#3 <= 2438761))) OR ((ss_sold_date_sk#3 >= 2439096) AND (ss_sold_date_sk#3 <= 2439126))) OR ((((ss_sold_date_sk#3 >= 2439461) AND (ss_sold_date_sk#3 <= 2439491)) OR ((ss_sold_date_sk#3 >= 2439826) AND (ss_sold_date_sk#3 <= 2439856))) OR ((ss_sold_date_sk#3 >= 2440192) AND (ss_sold_date_sk#3 <= 2440222)))) OR (((((ss_sold_date_sk#3 >= 2440557) AND (ss_sold_date_sk#3 <= 2440587)) OR ((ss_sold_date_sk#3 >= 2440922) AND (ss_sold_date_sk#3 <= 2440952))) OR ((ss_sold_date_sk#3 >= 2441287) AND (ss_sold_date_sk#3 <= 2441317))) OR ((((ss_sold_date_sk#3 >= 2441653) AND (ss_sold_date_sk#3 <= 2441683)) OR ((ss_sold_date_sk#3 >= 2442018) AND (ss_sold_date_sk#3 <= 2442048))) OR ((ss_sold_date_sk#3 >= 2442383) AND (ss_sold_date_sk#3 <= 2442413)))))) OR (((((((ss_sold_date_sk#3 >= 2442748) AND (ss_sold_date_sk#3 <= 2442778)) OR ((ss_sold_date_sk#3 >= 2443114) AND (ss_sold_date_sk#3 <= 2443144))) OR (((ss_sold_date_sk#3 >= 2443479) AND (ss_sold_date_sk#3 <= 2443509)) OR ((ss_sold_date_sk#3 >= 2443844) AND (ss_sold_date_sk#3 <= 2443874)))) OR ((((ss_sold_date_sk#3 >= 2444209) AND (ss_sold_date_sk#3 <= 2444239)) OR ((ss_sold_date_sk#3 >= 2444575) AND (ss_sold_date_sk#3 <= 2444605))) OR ((ss_sold_date_sk#3 >= 2444940) AND (ss_sold_date_sk#3 <= 2444970)))) OR (((((ss_sold_date_sk#3 >= 2445305) AND (ss_sold_date_sk#3 <= 2445335)) OR ((ss_sold_date_sk#3 >= 2445670) AND (ss_sold_date_sk#3 <= 2445700))) OR ((ss_sold_date_sk#3 >= 2446036) AND (ss_sold_date_sk#3 <= 2446066))) OR ((((ss_sold_date_sk#3 >= 2446401) AND (ss_sold_date_sk#3 <= 2446431)) OR ((ss_sold_date_sk#3 >= 2446766) AND (ss_sold_date_sk#3 <= 2446796))) OR ((ss_sold_date_sk#3 >= 2447131) AND (ss_sold_date_sk#3 <= 2447161))))) OR ((((((ss_sold_date_sk#3 >= 2447497) AND (ss_sold_date_sk#3 <= 2447527)) OR ((ss_sold_date_sk#3 >= 2447862) AND (ss_sold_date_sk#3 <= 2447892))) OR ((ss_sold_date_sk#3 >= 2448227) AND (ss_sold_date_sk#3 <= 2448257))) OR ((((ss_sold_date_sk#3 >= 2448592) AND (ss_sold_date_sk#3 <= 2448622)) OR ((ss_sold_date_sk#3 >= 2448958) AND (ss_sold_date_sk#3 <= 2448988))) OR ((ss_sold_date_sk#3 >= 2449323) AND (ss_sold_date_sk#3 <= 2449353)))) OR (((((ss_sold_date_sk#3 >= 2449688) AND (ss_sold_date_sk#3 <= 2449718)) OR ((ss_sold_date_sk#3 >= 2450053) AND (ss_sold_date_sk#3 <= 2450083))) OR ((ss_sold_date_sk#3 >= 2450419) AND (ss_sold_date_sk#3 <= 2450449))) OR ((((ss_sold_date_sk#3 >= 2450784) AND (ss_sold_date_sk#3 <= 2450814)) OR ((ss_sold_date_sk#3 >= 2451149) AND (ss_sold_date_sk#3 <= 2451179))) OR ((ss_sold_date_sk#3 >= 2451514) AND (ss_sold_date_sk#3 <= 2451544)))))))) OR (((((((((ss_sold_date_sk#3 >= 2451880) AND (ss_sold_date_sk#3 <= 2451910)) OR ((ss_sold_date_sk#3 >= 2452245) AND (ss_sold_date_sk#3 <= 2452275))) OR (((ss_sold_date_sk#3 >= 2452610) AND (ss_sold_date_sk#3 <= 2452640)) OR ((ss_sold_date_sk#3 >= 2452975) AND (ss_sold_date_sk#3 <= 2453005)))) OR ((((ss_sold_date_sk#3 >= 2453341) AND (ss_sold_date_sk#3 <= 2453371)) OR ((ss_sold_date_sk#3 >= 2453706) AND (ss_sold_date_sk#3 <= 2453736))) OR ((ss_sold_date_sk#3 >= 2454071) AND (ss_sold_date_sk#3 <= 2454101)))) OR (((((ss_sold_date_sk#3 >= 2454436) AND (ss_sold_date_sk#3 <= 2454466)) OR ((ss_sold_date_sk#3 >= 2454802) AND (ss_sold_date_sk#3 <= 2454832))) OR ((ss_sold_date_sk#3 >= 2455167) AND (ss_sold_date_sk#3 <= 2455197))) OR ((((ss_sold_date_sk#3 >= 2455532) AND (ss_sold_date_sk#3 <= 2455562)) OR ((ss_sold_date_sk#3 >= 2455897) AND (ss_sold_date_sk#3 <= 2455927))) OR ((ss_sold_date_sk#3 >= 2456263) AND (ss_sold_date_sk#3 <= 2456293))))) OR ((((((ss_sold_date_sk#3 >= 2456628) AND (ss_sold_date_sk#3 <= 2456658)) OR ((ss_sold_date_sk#3 >= 2456993) AND (ss_sold_date_sk#3 <= 2457023))) OR ((ss_sold_date_sk#3 >= 2457358) AND (ss_sold_date_sk#3 <= 2457388))) OR ((((ss_sold_date_sk#3 >= 2457724) AND (ss_sold_date_sk#3 <= 2457754)) OR ((ss_sold_date_sk#3 >= 2458089) AND (ss_sold_date_sk#3 <= 2458119))) OR ((ss_sold_date_sk#3 >= 2458454) AND (ss_sold_date_sk#3 <= 2458484)))) OR (((((ss_sold_date_sk#3 >= 2458819) AND (ss_sold_date_sk#3 <= 2458849)) OR ((ss_sold_date_sk#3 >= 2459185) AND (ss_sold_date_sk#3 <= 2459215))) OR ((ss_sold_date_sk#3 >= 2459550) AND (ss_sold_date_sk#3 <= 2459580))) OR ((((ss_sold_date_sk#3 >= 2459915) AND (ss_sold_date_sk#3 <= 2459945)) OR ((ss_sold_date_sk#3 >= 2460280) AND (ss_sold_date_sk#3 <= 2460310))) OR ((ss_sold_date_sk#3 >= 2460646) AND (ss_sold_date_sk#3 <= 2460676)))))) OR (((((((ss_sold_date_sk#3 >= 2461011) AND (ss_sold_date_sk#3 <= 2461041)) OR ((ss_sold_date_sk#3 >= 2461376) AND (ss_sold_date_sk#3 <= 2461406))) OR (((ss_sold_date_sk#3 >= 2461741) AND (ss_sold_date_sk#3 <= 2461771)) OR ((ss_sold_date_sk#3 >= 2462107) AND (ss_sold_date_sk#3 <= 2462137)))) OR ((((ss_sold_date_sk#3 >= 2462472) AND (ss_sold_date_sk#3 <= 2462502)) OR ((ss_sold_date_sk#3 >= 2462837) AND (ss_sold_date_sk#3 <= 2462867))) OR ((ss_sold_date_sk#3 >= 2463202) AND (ss_sold_date_sk#3 <= 2463232)))) OR (((((ss_sold_date_sk#3 >= 2463568) AND (ss_sold_date_sk#3 <= 2463598)) OR ((ss_sold_date_sk#3 >= 2463933) AND (ss_sold_date_sk#3 <= 2463963))) OR ((ss_sold_date_sk#3 >= 2464298) AND (ss_sold_date_sk#3 <= 2464328))) OR ((((ss_sold_date_sk#3 >= 2464663) AND (ss_sold_date_sk#3 <= 2464693)) OR ((ss_sold_date_sk#3 >= 2465029) AND (ss_sold_date_sk#3 <= 2465059))) OR ((ss_sold_date_sk#3 >= 2465394) AND (ss_sold_date_sk#3 <= 2465424))))) OR ((((((ss_sold_date_sk#3 >= 2465759) AND (ss_sold_date_sk#3 <= 2465789)) OR ((ss_sold_date_sk#3 >= 2466124) AND (ss_sold_date_sk#3 <= 2466154))) OR ((ss_sold_date_sk#3 >= 2466490) AND (ss_sold_date_sk#3 <= 2466520))) OR ((((ss_sold_date_sk#3 >= 2466855) AND (ss_sold_date_sk#3 <= 2466885)) OR ((ss_sold_date_sk#3 >= 2467220) AND (ss_sold_date_sk#3 <= 2467250))) OR ((ss_sold_date_sk#3 >= 2467585) AND (ss_sold_date_sk#3 <= 2467615)))) OR (((((ss_sold_date_sk#3 >= 2467951) AND (ss_sold_date_sk#3 <= 2467981)) OR ((ss_sold_date_sk#3 >= 2468316) AND (ss_sold_date_sk#3 <= 2468346))) OR ((ss_sold_date_sk#3 >= 2468681) AND (ss_sold_date_sk#3 <= 2468711))) OR ((((ss_sold_date_sk#3 >= 2469046) AND (ss_sold_date_sk#3 <= 2469076)) OR ((ss_sold_date_sk#3 >= 2469412) AND (ss_sold_date_sk#3 <= 2469442))) OR ((ss_sold_date_sk#3 >= 2469777) AND (ss_sold_date_sk#3 <= 2469807))))))) OR ((((((((ss_sold_date_sk#3 >= 2470142) AND (ss_sold_date_sk#3 <= 2470172)) OR ((ss_sold_date_sk#3 >= 2470507) AND (ss_sold_date_sk#3 <= 2470537))) OR (((ss_sold_date_sk#3 >= 2470873) AND (ss_sold_date_sk#3 <= 2470903)) OR ((ss_sold_date_sk#3 >= 2471238) AND (ss_sold_date_sk#3 <= 2471268)))) OR ((((ss_sold_date_sk#3 >= 2471603) AND (ss_sold_date_sk#3 <= 2471633)) OR ((ss_sold_date_sk#3 >= 2471968) AND (ss_sold_date_sk#3 <= 2471998))) OR ((ss_sold_date_sk#3 >= 2472334) AND (ss_sold_date_sk#3 <= 2472364)))) OR (((((ss_sold_date_sk#3 >= 2472699) AND (ss_sold_date_sk#3 <= 2472729)) OR ((ss_sold_date_sk#3 >= 2473064) AND (ss_sold_date_sk#3 <= 2473094))) OR ((ss_sold_date_sk#3 >= 2473429) AND (ss_sold_date_sk#3 <= 2473459))) OR ((((ss_sold_date_sk#3 >= 2473795) AND (ss_sold_date_sk#3 <= 2473825)) OR ((ss_sold_date_sk#3 >= 2474160) AND (ss_sold_date_sk#3 <= 2474190))) OR ((ss_sold_date_sk#3 >= 2474525) AND (ss_sold_date_sk#3 <= 2474555))))) OR ((((((ss_sold_date_sk#3 >= 2474890) AND (ss_sold_date_sk#3 <= 2474920)) OR ((ss_sold_date_sk#3 >= 2475256) AND (ss_sold_date_sk#3 <= 2475286))) OR ((ss_sold_date_sk#3 >= 2475621) AND (ss_sold_date_sk#3 <= 2475651))) OR ((((ss_sold_date_sk#3 >= 2475986) AND (ss_sold_date_sk#3 <= 2476016)) OR ((ss_sold_date_sk#3 >= 2476351) AND (ss_sold_date_sk#3 <= 2476381))) OR ((ss_sold_date_sk#3 >= 2476717) AND (ss_sold_date_sk#3 <= 2476747)))) OR (((((ss_sold_date_sk#3 >= 2477082) AND (ss_sold_date_sk#3 <= 2477112)) OR ((ss_sold_date_sk#3 >= 2477447) AND (ss_sold_date_sk#3 <= 2477477))) OR ((ss_sold_date_sk#3 >= 2477812) AND (ss_sold_date_sk#3 <= 2477842))) OR ((((ss_sold_date_sk#3 >= 2478178) AND (ss_sold_date_sk#3 <= 2478208)) OR ((ss_sold_date_sk#3 >= 2478543) AND (ss_sold_date_sk#3 <= 2478573))) OR ((ss_sold_date_sk#3 >= 2478908) AND (ss_sold_date_sk#3 <= 2478938)))))) OR (((((((ss_sold_date_sk#3 >= 2479273) AND (ss_sold_date_sk#3 <= 2479303)) OR ((ss_sold_date_sk#3 >= 2479639) AND (ss_sold_date_sk#3 <= 2479669))) OR (((ss_sold_date_sk#3 >= 2480004) AND (ss_sold_date_sk#3 <= 2480034)) OR ((ss_sold_date_sk#3 >= 2480369) AND (ss_sold_date_sk#3 <= 2480399)))) OR ((((ss_sold_date_sk#3 >= 2480734) AND (ss_sold_date_sk#3 <= 2480764)) OR ((ss_sold_date_sk#3 >= 2481100) AND (ss_sold_date_sk#3 <= 2481130))) OR ((ss_sold_date_sk#3 >= 2481465) AND (ss_sold_date_sk#3 <= 2481495)))) OR (((((ss_sold_date_sk#3 >= 2481830) AND (ss_sold_date_sk#3 <= 2481860)) OR ((ss_sold_date_sk#3 >= 2482195) AND (ss_sold_date_sk#3 <= 2482225))) OR ((ss_sold_date_sk#3 >= 2482561) AND (ss_sold_date_sk#3 <= 2482591))) OR ((((ss_sold_date_sk#3 >= 2482926) AND (ss_sold_date_sk#3 <= 2482956)) OR ((ss_sold_date_sk#3 >= 2483291) AND (ss_sold_date_sk#3 <= 2483321))) OR ((ss_sold_date_sk#3 >= 2483656) AND (ss_sold_date_sk#3 <= 2483686))))) OR ((((((ss_sold_date_sk#3 >= 2484022) AND (ss_sold_date_sk#3 <= 2484052)) OR ((ss_sold_date_sk#3 >= 2484387) AND (ss_sold_date_sk#3 <= 2484417))) OR ((ss_sold_date_sk#3 >= 2484752) AND (ss_sold_date_sk#3 <= 2484782))) OR ((((ss_sold_date_sk#3 >= 2485117) AND (ss_sold_date_sk#3 <= 2485147)) OR ((ss_sold_date_sk#3 >= 2485483) AND (ss_sold_date_sk#3 <= 2485513))) OR ((ss_sold_date_sk#3 >= 2485848) AND (ss_sold_date_sk#3 <= 2485878)))) OR (((((ss_sold_date_sk#3 >= 2486213) AND (ss_sold_date_sk#3 <= 2486243)) OR ((ss_sold_date_sk#3 >= 2486578) AND (ss_sold_date_sk#3 <= 2486608))) OR ((ss_sold_date_sk#3 >= 2486944) AND (ss_sold_date_sk#3 <= 2486974))) OR ((((ss_sold_date_sk#3 >= 2487309) AND (ss_sold_date_sk#3 <= 2487339)) OR ((ss_sold_date_sk#3 >= 2487674) AND (ss_sold_date_sk#3 <= 2487704))) OR ((ss_sold_date_sk#3 >= 2488039) AND (ss_sold_date_sk#3 <= 2488069))))))))), isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_net_profit#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manufact_id#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,436), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manufact_id#8] + +(6) Filter [codegen id : 1] +Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manufact_id#8] +Condition : ((isnotnull(i_manufact_id#8) AND (i_manufact_id#8 = 436)) AND isnotnull(i_item_sk#5)) + +(7) Project [codegen id : 1] +Output [3]: [i_item_sk#5, i_brand_id#6, i_brand#7] +Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manufact_id#8] + +(8) BroadcastExchange +Input [3]: [i_item_sk#5, i_brand_id#6, i_brand#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(10) Project [codegen id : 3] +Output [4]: [ss_net_profit#2, ss_sold_date_sk#3, i_brand_id#6, i_brand#7] +Input [6]: [ss_item_sk#1, ss_net_profit#2, ss_sold_date_sk#3, i_item_sk#5, i_brand_id#6, i_brand#7] + +(11) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), EqualTo(d_moy,12), Or(Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2415355),LessThanOrEqual(d_date_sk,2415385)),And(GreaterThanOrEqual(d_date_sk,2415720),LessThanOrEqual(d_date_sk,2415750))),Or(And(GreaterThanOrEqual(d_date_sk,2416085),LessThanOrEqual(d_date_sk,2416115)),And(GreaterThanOrEqual(d_date_sk,2416450),LessThanOrEqual(d_date_sk,2416480)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2416816),LessThanOrEqual(d_date_sk,2416846)),And(GreaterThanOrEqual(d_date_sk,2417181),LessThanOrEqual(d_date_sk,2417211))),And(GreaterThanOrEqual(d_date_sk,2417546),LessThanOrEqual(d_date_sk,2417576)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2417911),LessThanOrEqual(d_date_sk,2417941)),And(GreaterThanOrEqual(d_date_sk,2418277),LessThanOrEqual(d_date_sk,2418307))),And(GreaterThanOrEqual(d_date_sk,2418642),LessThanOrEqual(d_date_sk,2418672))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2419007),LessThanOrEqual(d_date_sk,2419037)),And(GreaterThanOrEqual(d_date_sk,2419372),LessThanOrEqual(d_date_sk,2419402))),And(GreaterThanOrEqual(d_date_sk,2419738),LessThanOrEqual(d_date_sk,2419768))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2420103),LessThanOrEqual(d_date_sk,2420133)),And(GreaterThanOrEqual(d_date_sk,2420468),LessThanOrEqual(d_date_sk,2420498))),And(GreaterThanOrEqual(d_date_sk,2420833),LessThanOrEqual(d_date_sk,2420863))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2421199),LessThanOrEqual(d_date_sk,2421229)),And(GreaterThanOrEqual(d_date_sk,2421564),LessThanOrEqual(d_date_sk,2421594))),And(GreaterThanOrEqual(d_date_sk,2421929),LessThanOrEqual(d_date_sk,2421959)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2422294),LessThanOrEqual(d_date_sk,2422324)),And(GreaterThanOrEqual(d_date_sk,2422660),LessThanOrEqual(d_date_sk,2422690))),And(GreaterThanOrEqual(d_date_sk,2423025),LessThanOrEqual(d_date_sk,2423055))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2423390),LessThanOrEqual(d_date_sk,2423420)),And(GreaterThanOrEqual(d_date_sk,2423755),LessThanOrEqual(d_date_sk,2423785))),And(GreaterThanOrEqual(d_date_sk,2424121),LessThanOrEqual(d_date_sk,2424151)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2424486),LessThanOrEqual(d_date_sk,2424516)),And(GreaterThanOrEqual(d_date_sk,2424851),LessThanOrEqual(d_date_sk,2424881))),Or(And(GreaterThanOrEqual(d_date_sk,2425216),LessThanOrEqual(d_date_sk,2425246)),And(GreaterThanOrEqual(d_date_sk,2425582),LessThanOrEqual(d_date_sk,2425612)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2425947),LessThanOrEqual(d_date_sk,2425977)),And(GreaterThanOrEqual(d_date_sk,2426312),LessThanOrEqual(d_date_sk,2426342))),And(GreaterThanOrEqual(d_date_sk,2426677),LessThanOrEqual(d_date_sk,2426707)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2427043),LessThanOrEqual(d_date_sk,2427073)),And(GreaterThanOrEqual(d_date_sk,2427408),LessThanOrEqual(d_date_sk,2427438))),And(GreaterThanOrEqual(d_date_sk,2427773),LessThanOrEqual(d_date_sk,2427803))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2428138),LessThanOrEqual(d_date_sk,2428168)),And(GreaterThanOrEqual(d_date_sk,2428504),LessThanOrEqual(d_date_sk,2428534))),And(GreaterThanOrEqual(d_date_sk,2428869),LessThanOrEqual(d_date_sk,2428899))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2429234),LessThanOrEqual(d_date_sk,2429264)),And(GreaterThanOrEqual(d_date_sk,2429599),LessThanOrEqual(d_date_sk,2429629))),And(GreaterThanOrEqual(d_date_sk,2429965),LessThanOrEqual(d_date_sk,2429995))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2430330),LessThanOrEqual(d_date_sk,2430360)),And(GreaterThanOrEqual(d_date_sk,2430695),LessThanOrEqual(d_date_sk,2430725))),And(GreaterThanOrEqual(d_date_sk,2431060),LessThanOrEqual(d_date_sk,2431090)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2431426),LessThanOrEqual(d_date_sk,2431456)),And(GreaterThanOrEqual(d_date_sk,2431791),LessThanOrEqual(d_date_sk,2431821))),And(GreaterThanOrEqual(d_date_sk,2432156),LessThanOrEqual(d_date_sk,2432186))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2432521),LessThanOrEqual(d_date_sk,2432551)),And(GreaterThanOrEqual(d_date_sk,2432887),LessThanOrEqual(d_date_sk,2432917))),And(GreaterThanOrEqual(d_date_sk,2433252),LessThanOrEqual(d_date_sk,2433282))))))),Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2433617),LessThanOrEqual(d_date_sk,2433647)),And(GreaterThanOrEqual(d_date_sk,2433982),LessThanOrEqual(d_date_sk,2434012))),Or(And(GreaterThanOrEqual(d_date_sk,2434348),LessThanOrEqual(d_date_sk,2434378)),And(GreaterThanOrEqual(d_date_sk,2434713),LessThanOrEqual(d_date_sk,2434743)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2435078),LessThanOrEqual(d_date_sk,2435108)),And(GreaterThanOrEqual(d_date_sk,2435443),LessThanOrEqual(d_date_sk,2435473))),And(GreaterThanOrEqual(d_date_sk,2435809),LessThanOrEqual(d_date_sk,2435839)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2436174),LessThanOrEqual(d_date_sk,2436204)),And(GreaterThanOrEqual(d_date_sk,2436539),LessThanOrEqual(d_date_sk,2436569))),And(GreaterThanOrEqual(d_date_sk,2436904),LessThanOrEqual(d_date_sk,2436934))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2437270),LessThanOrEqual(d_date_sk,2437300)),And(GreaterThanOrEqual(d_date_sk,2437635),LessThanOrEqual(d_date_sk,2437665))),And(GreaterThanOrEqual(d_date_sk,2438000),LessThanOrEqual(d_date_sk,2438030))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2438365),LessThanOrEqual(d_date_sk,2438395)),And(GreaterThanOrEqual(d_date_sk,2438731),LessThanOrEqual(d_date_sk,2438761))),And(GreaterThanOrEqual(d_date_sk,2439096),LessThanOrEqual(d_date_sk,2439126))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2439461),LessThanOrEqual(d_date_sk,2439491)),And(GreaterThanOrEqual(d_date_sk,2439826),LessThanOrEqual(d_date_sk,2439856))),And(GreaterThanOrEqual(d_date_sk,2440192),LessThanOrEqual(d_date_sk,2440222)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2440557),LessThanOrEqual(d_date_sk,2440587)),And(GreaterThanOrEqual(d_date_sk,2440922),LessThanOrEqual(d_date_sk,2440952))),And(GreaterThanOrEqual(d_date_sk,2441287),LessThanOrEqual(d_date_sk,2441317))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2441653),LessThanOrEqual(d_date_sk,2441683)),And(GreaterThanOrEqual(d_date_sk,2442018),LessThanOrEqual(d_date_sk,2442048))),And(GreaterThanOrEqual(d_date_sk,2442383),LessThanOrEqual(d_date_sk,2442413)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2442748),LessThanOrEqual(d_date_sk,2442778)),And(GreaterThanOrEqual(d_date_sk,2443114),LessThanOrEqual(d_date_sk,2443144))),Or(And(GreaterThanOrEqual(d_date_sk,2443479),LessThanOrEqual(d_date_sk,2443509)),And(GreaterThanOrEqual(d_date_sk,2443844),LessThanOrEqual(d_date_sk,2443874)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2444209),LessThanOrEqual(d_date_sk,2444239)),And(GreaterThanOrEqual(d_date_sk,2444575),LessThanOrEqual(d_date_sk,2444605))),And(GreaterThanOrEqual(d_date_sk,2444940),LessThanOrEqual(d_date_sk,2444970)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2445305),LessThanOrEqual(d_date_sk,2445335)),And(GreaterThanOrEqual(d_date_sk,2445670),LessThanOrEqual(d_date_sk,2445700))),And(GreaterThanOrEqual(d_date_sk,2446036),LessThanOrEqual(d_date_sk,2446066))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2446401),LessThanOrEqual(d_date_sk,2446431)),And(GreaterThanOrEqual(d_date_sk,2446766),LessThanOrEqual(d_date_sk,2446796))),And(GreaterThanOrEqual(d_date_sk,2447131),LessThanOrEqual(d_date_sk,2447161))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2447497),LessThanOrEqual(d_date_sk,2447527)),And(GreaterThanOrEqual(d_date_sk,2447862),LessThanOrEqual(d_date_sk,2447892))),And(GreaterThanOrEqual(d_date_sk,2448227),LessThanOrEqual(d_date_sk,2448257))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2448592),LessThanOrEqual(d_date_sk,2448622)),And(GreaterThanOrEqual(d_date_sk,2448958),LessThanOrEqual(d_date_sk,2448988))),And(GreaterThanOrEqual(d_date_sk,2449323),LessThanOrEqual(d_date_sk,2449353)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2449688),LessThanOrEqual(d_date_sk,2449718)),And(GreaterThanOrEqual(d_date_sk,2450053),LessThanOrEqual(d_date_sk,2450083))),And(GreaterThanOrEqual(d_date_sk,2450419),LessThanOrEqual(d_date_sk,2450449))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2450784),LessThanOrEqual(d_date_sk,2450814)),And(GreaterThanOrEqual(d_date_sk,2451149),LessThanOrEqual(d_date_sk,2451179))),And(GreaterThanOrEqual(d_date_sk,2451514),LessThanOrEqual(d_date_sk,2451544)))))))),Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2451880),LessThanOrEqual(d_date_sk,2451910)),And(GreaterThanOrEqual(d_date_sk,2452245),LessThanOrEqual(d_date_sk,2452275))),Or(And(GreaterThanOrEqual(d_date_sk,2452610),LessThanOrEqual(d_date_sk,2452640)),And(GreaterThanOrEqual(d_date_sk,2452975),LessThanOrEqual(d_date_sk,2453005)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2453341),LessThanOrEqual(d_date_sk,2453371)),And(GreaterThanOrEqual(d_date_sk,2453706),LessThanOrEqual(d_date_sk,2453736))),And(GreaterThanOrEqual(d_date_sk,2454071),LessThanOrEqual(d_date_sk,2454101)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2454436),LessThanOrEqual(d_date_sk,2454466)),And(GreaterThanOrEqual(d_date_sk,2454802),LessThanOrEqual(d_date_sk,2454832))),And(GreaterThanOrEqual(d_date_sk,2455167),LessThanOrEqual(d_date_sk,2455197))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2455532),LessThanOrEqual(d_date_sk,2455562)),And(GreaterThanOrEqual(d_date_sk,2455897),LessThanOrEqual(d_date_sk,2455927))),And(GreaterThanOrEqual(d_date_sk,2456263),LessThanOrEqual(d_date_sk,2456293))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2456628),LessThanOrEqual(d_date_sk,2456658)),And(GreaterThanOrEqual(d_date_sk,2456993),LessThanOrEqual(d_date_sk,2457023))),And(GreaterThanOrEqual(d_date_sk,2457358),LessThanOrEqual(d_date_sk,2457388))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2457724),LessThanOrEqual(d_date_sk,2457754)),And(GreaterThanOrEqual(d_date_sk,2458089),LessThanOrEqual(d_date_sk,2458119))),And(GreaterThanOrEqual(d_date_sk,2458454),LessThanOrEqual(d_date_sk,2458484)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2458819),LessThanOrEqual(d_date_sk,2458849)),And(GreaterThanOrEqual(d_date_sk,2459185),LessThanOrEqual(d_date_sk,2459215))),And(GreaterThanOrEqual(d_date_sk,2459550),LessThanOrEqual(d_date_sk,2459580))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2459915),LessThanOrEqual(d_date_sk,2459945)),And(GreaterThanOrEqual(d_date_sk,2460280),LessThanOrEqual(d_date_sk,2460310))),And(GreaterThanOrEqual(d_date_sk,2460646),LessThanOrEqual(d_date_sk,2460676)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2461011),LessThanOrEqual(d_date_sk,2461041)),And(GreaterThanOrEqual(d_date_sk,2461376),LessThanOrEqual(d_date_sk,2461406))),Or(And(GreaterThanOrEqual(d_date_sk,2461741),LessThanOrEqual(d_date_sk,2461771)),And(GreaterThanOrEqual(d_date_sk,2462107),LessThanOrEqual(d_date_sk,2462137)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2462472),LessThanOrEqual(d_date_sk,2462502)),And(GreaterThanOrEqual(d_date_sk,2462837),LessThanOrEqual(d_date_sk,2462867))),And(GreaterThanOrEqual(d_date_sk,2463202),LessThanOrEqual(d_date_sk,2463232)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2463568),LessThanOrEqual(d_date_sk,2463598)),And(GreaterThanOrEqual(d_date_sk,2463933),LessThanOrEqual(d_date_sk,2463963))),And(GreaterThanOrEqual(d_date_sk,2464298),LessThanOrEqual(d_date_sk,2464328))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2464663),LessThanOrEqual(d_date_sk,2464693)),And(GreaterThanOrEqual(d_date_sk,2465029),LessThanOrEqual(d_date_sk,2465059))),And(GreaterThanOrEqual(d_date_sk,2465394),LessThanOrEqual(d_date_sk,2465424))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2465759),LessThanOrEqual(d_date_sk,2465789)),And(GreaterThanOrEqual(d_date_sk,2466124),LessThanOrEqual(d_date_sk,2466154))),And(GreaterThanOrEqual(d_date_sk,2466490),LessThanOrEqual(d_date_sk,2466520))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2466855),LessThanOrEqual(d_date_sk,2466885)),And(GreaterThanOrEqual(d_date_sk,2467220),LessThanOrEqual(d_date_sk,2467250))),And(GreaterThanOrEqual(d_date_sk,2467585),LessThanOrEqual(d_date_sk,2467615)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2467951),LessThanOrEqual(d_date_sk,2467981)),And(GreaterThanOrEqual(d_date_sk,2468316),LessThanOrEqual(d_date_sk,2468346))),And(GreaterThanOrEqual(d_date_sk,2468681),LessThanOrEqual(d_date_sk,2468711))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2469046),LessThanOrEqual(d_date_sk,2469076)),And(GreaterThanOrEqual(d_date_sk,2469412),LessThanOrEqual(d_date_sk,2469442))),And(GreaterThanOrEqual(d_date_sk,2469777),LessThanOrEqual(d_date_sk,2469807))))))),Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2470142),LessThanOrEqual(d_date_sk,2470172)),And(GreaterThanOrEqual(d_date_sk,2470507),LessThanOrEqual(d_date_sk,2470537))),Or(And(GreaterThanOrEqual(d_date_sk,2470873),LessThanOrEqual(d_date_sk,2470903)),And(GreaterThanOrEqual(d_date_sk,2471238),LessThanOrEqual(d_date_sk,2471268)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2471603),LessThanOrEqual(d_date_sk,2471633)),And(GreaterThanOrEqual(d_date_sk,2471968),LessThanOrEqual(d_date_sk,2471998))),And(GreaterThanOrEqual(d_date_sk,2472334),LessThanOrEqual(d_date_sk,2472364)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2472699),LessThanOrEqual(d_date_sk,2472729)),And(GreaterThanOrEqual(d_date_sk,2473064),LessThanOrEqual(d_date_sk,2473094))),And(GreaterThanOrEqual(d_date_sk,2473429),LessThanOrEqual(d_date_sk,2473459))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2473795),LessThanOrEqual(d_date_sk,2473825)),And(GreaterThanOrEqual(d_date_sk,2474160),LessThanOrEqual(d_date_sk,2474190))),And(GreaterThanOrEqual(d_date_sk,2474525),LessThanOrEqual(d_date_sk,2474555))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2474890),LessThanOrEqual(d_date_sk,2474920)),And(GreaterThanOrEqual(d_date_sk,2475256),LessThanOrEqual(d_date_sk,2475286))),And(GreaterThanOrEqual(d_date_sk,2475621),LessThanOrEqual(d_date_sk,2475651))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2475986),LessThanOrEqual(d_date_sk,2476016)),And(GreaterThanOrEqual(d_date_sk,2476351),LessThanOrEqual(d_date_sk,2476381))),And(GreaterThanOrEqual(d_date_sk,2476717),LessThanOrEqual(d_date_sk,2476747)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2477082),LessThanOrEqual(d_date_sk,2477112)),And(GreaterThanOrEqual(d_date_sk,2477447),LessThanOrEqual(d_date_sk,2477477))),And(GreaterThanOrEqual(d_date_sk,2477812),LessThanOrEqual(d_date_sk,2477842))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2478178),LessThanOrEqual(d_date_sk,2478208)),And(GreaterThanOrEqual(d_date_sk,2478543),LessThanOrEqual(d_date_sk,2478573))),And(GreaterThanOrEqual(d_date_sk,2478908),LessThanOrEqual(d_date_sk,2478938)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2479273),LessThanOrEqual(d_date_sk,2479303)),And(GreaterThanOrEqual(d_date_sk,2479639),LessThanOrEqual(d_date_sk,2479669))),Or(And(GreaterThanOrEqual(d_date_sk,2480004),LessThanOrEqual(d_date_sk,2480034)),And(GreaterThanOrEqual(d_date_sk,2480369),LessThanOrEqual(d_date_sk,2480399)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2480734),LessThanOrEqual(d_date_sk,2480764)),And(GreaterThanOrEqual(d_date_sk,2481100),LessThanOrEqual(d_date_sk,2481130))),And(GreaterThanOrEqual(d_date_sk,2481465),LessThanOrEqual(d_date_sk,2481495)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2481830),LessThanOrEqual(d_date_sk,2481860)),And(GreaterThanOrEqual(d_date_sk,2482195),LessThanOrEqual(d_date_sk,2482225))),And(GreaterThanOrEqual(d_date_sk,2482561),LessThanOrEqual(d_date_sk,2482591))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2482926),LessThanOrEqual(d_date_sk,2482956)),And(GreaterThanOrEqual(d_date_sk,2483291),LessThanOrEqual(d_date_sk,2483321))),And(GreaterThanOrEqual(d_date_sk,2483656),LessThanOrEqual(d_date_sk,2483686))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2484022),LessThanOrEqual(d_date_sk,2484052)),And(GreaterThanOrEqual(d_date_sk,2484387),LessThanOrEqual(d_date_sk,2484417))),And(GreaterThanOrEqual(d_date_sk,2484752),LessThanOrEqual(d_date_sk,2484782))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2485117),LessThanOrEqual(d_date_sk,2485147)),And(GreaterThanOrEqual(d_date_sk,2485483),LessThanOrEqual(d_date_sk,2485513))),And(GreaterThanOrEqual(d_date_sk,2485848),LessThanOrEqual(d_date_sk,2485878)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2486213),LessThanOrEqual(d_date_sk,2486243)),And(GreaterThanOrEqual(d_date_sk,2486578),LessThanOrEqual(d_date_sk,2486608))),And(GreaterThanOrEqual(d_date_sk,2486944),LessThanOrEqual(d_date_sk,2486974))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2487309),LessThanOrEqual(d_date_sk,2487339)),And(GreaterThanOrEqual(d_date_sk,2487674),LessThanOrEqual(d_date_sk,2487704))),And(GreaterThanOrEqual(d_date_sk,2488039),LessThanOrEqual(d_date_sk,2488069))))))))), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(13) Filter [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Condition : (((isnotnull(d_moy#12) AND (d_moy#12 = 12)) AND ((((((((((d_date_sk#10 >= 2415355) AND (d_date_sk#10 <= 2415385)) OR ((d_date_sk#10 >= 2415720) AND (d_date_sk#10 <= 2415750))) OR (((d_date_sk#10 >= 2416085) AND (d_date_sk#10 <= 2416115)) OR ((d_date_sk#10 >= 2416450) AND (d_date_sk#10 <= 2416480)))) OR ((((d_date_sk#10 >= 2416816) AND (d_date_sk#10 <= 2416846)) OR ((d_date_sk#10 >= 2417181) AND (d_date_sk#10 <= 2417211))) OR ((d_date_sk#10 >= 2417546) AND (d_date_sk#10 <= 2417576)))) OR (((((d_date_sk#10 >= 2417911) AND (d_date_sk#10 <= 2417941)) OR ((d_date_sk#10 >= 2418277) AND (d_date_sk#10 <= 2418307))) OR ((d_date_sk#10 >= 2418642) AND (d_date_sk#10 <= 2418672))) OR ((((d_date_sk#10 >= 2419007) AND (d_date_sk#10 <= 2419037)) OR ((d_date_sk#10 >= 2419372) AND (d_date_sk#10 <= 2419402))) OR ((d_date_sk#10 >= 2419738) AND (d_date_sk#10 <= 2419768))))) OR ((((((d_date_sk#10 >= 2420103) AND (d_date_sk#10 <= 2420133)) OR ((d_date_sk#10 >= 2420468) AND (d_date_sk#10 <= 2420498))) OR ((d_date_sk#10 >= 2420833) AND (d_date_sk#10 <= 2420863))) OR ((((d_date_sk#10 >= 2421199) AND (d_date_sk#10 <= 2421229)) OR ((d_date_sk#10 >= 2421564) AND (d_date_sk#10 <= 2421594))) OR ((d_date_sk#10 >= 2421929) AND (d_date_sk#10 <= 2421959)))) OR (((((d_date_sk#10 >= 2422294) AND (d_date_sk#10 <= 2422324)) OR ((d_date_sk#10 >= 2422660) AND (d_date_sk#10 <= 2422690))) OR ((d_date_sk#10 >= 2423025) AND (d_date_sk#10 <= 2423055))) OR ((((d_date_sk#10 >= 2423390) AND (d_date_sk#10 <= 2423420)) OR ((d_date_sk#10 >= 2423755) AND (d_date_sk#10 <= 2423785))) OR ((d_date_sk#10 >= 2424121) AND (d_date_sk#10 <= 2424151)))))) OR (((((((d_date_sk#10 >= 2424486) AND (d_date_sk#10 <= 2424516)) OR ((d_date_sk#10 >= 2424851) AND (d_date_sk#10 <= 2424881))) OR (((d_date_sk#10 >= 2425216) AND (d_date_sk#10 <= 2425246)) OR ((d_date_sk#10 >= 2425582) AND (d_date_sk#10 <= 2425612)))) OR ((((d_date_sk#10 >= 2425947) AND (d_date_sk#10 <= 2425977)) OR ((d_date_sk#10 >= 2426312) AND (d_date_sk#10 <= 2426342))) OR ((d_date_sk#10 >= 2426677) AND (d_date_sk#10 <= 2426707)))) OR (((((d_date_sk#10 >= 2427043) AND (d_date_sk#10 <= 2427073)) OR ((d_date_sk#10 >= 2427408) AND (d_date_sk#10 <= 2427438))) OR ((d_date_sk#10 >= 2427773) AND (d_date_sk#10 <= 2427803))) OR ((((d_date_sk#10 >= 2428138) AND (d_date_sk#10 <= 2428168)) OR ((d_date_sk#10 >= 2428504) AND (d_date_sk#10 <= 2428534))) OR ((d_date_sk#10 >= 2428869) AND (d_date_sk#10 <= 2428899))))) OR ((((((d_date_sk#10 >= 2429234) AND (d_date_sk#10 <= 2429264)) OR ((d_date_sk#10 >= 2429599) AND (d_date_sk#10 <= 2429629))) OR ((d_date_sk#10 >= 2429965) AND (d_date_sk#10 <= 2429995))) OR ((((d_date_sk#10 >= 2430330) AND (d_date_sk#10 <= 2430360)) OR ((d_date_sk#10 >= 2430695) AND (d_date_sk#10 <= 2430725))) OR ((d_date_sk#10 >= 2431060) AND (d_date_sk#10 <= 2431090)))) OR (((((d_date_sk#10 >= 2431426) AND (d_date_sk#10 <= 2431456)) OR ((d_date_sk#10 >= 2431791) AND (d_date_sk#10 <= 2431821))) OR ((d_date_sk#10 >= 2432156) AND (d_date_sk#10 <= 2432186))) OR ((((d_date_sk#10 >= 2432521) AND (d_date_sk#10 <= 2432551)) OR ((d_date_sk#10 >= 2432887) AND (d_date_sk#10 <= 2432917))) OR ((d_date_sk#10 >= 2433252) AND (d_date_sk#10 <= 2433282))))))) OR ((((((((d_date_sk#10 >= 2433617) AND (d_date_sk#10 <= 2433647)) OR ((d_date_sk#10 >= 2433982) AND (d_date_sk#10 <= 2434012))) OR (((d_date_sk#10 >= 2434348) AND (d_date_sk#10 <= 2434378)) OR ((d_date_sk#10 >= 2434713) AND (d_date_sk#10 <= 2434743)))) OR ((((d_date_sk#10 >= 2435078) AND (d_date_sk#10 <= 2435108)) OR ((d_date_sk#10 >= 2435443) AND (d_date_sk#10 <= 2435473))) OR ((d_date_sk#10 >= 2435809) AND (d_date_sk#10 <= 2435839)))) OR (((((d_date_sk#10 >= 2436174) AND (d_date_sk#10 <= 2436204)) OR ((d_date_sk#10 >= 2436539) AND (d_date_sk#10 <= 2436569))) OR ((d_date_sk#10 >= 2436904) AND (d_date_sk#10 <= 2436934))) OR ((((d_date_sk#10 >= 2437270) AND (d_date_sk#10 <= 2437300)) OR ((d_date_sk#10 >= 2437635) AND (d_date_sk#10 <= 2437665))) OR ((d_date_sk#10 >= 2438000) AND (d_date_sk#10 <= 2438030))))) OR ((((((d_date_sk#10 >= 2438365) AND (d_date_sk#10 <= 2438395)) OR ((d_date_sk#10 >= 2438731) AND (d_date_sk#10 <= 2438761))) OR ((d_date_sk#10 >= 2439096) AND (d_date_sk#10 <= 2439126))) OR ((((d_date_sk#10 >= 2439461) AND (d_date_sk#10 <= 2439491)) OR ((d_date_sk#10 >= 2439826) AND (d_date_sk#10 <= 2439856))) OR ((d_date_sk#10 >= 2440192) AND (d_date_sk#10 <= 2440222)))) OR (((((d_date_sk#10 >= 2440557) AND (d_date_sk#10 <= 2440587)) OR ((d_date_sk#10 >= 2440922) AND (d_date_sk#10 <= 2440952))) OR ((d_date_sk#10 >= 2441287) AND (d_date_sk#10 <= 2441317))) OR ((((d_date_sk#10 >= 2441653) AND (d_date_sk#10 <= 2441683)) OR ((d_date_sk#10 >= 2442018) AND (d_date_sk#10 <= 2442048))) OR ((d_date_sk#10 >= 2442383) AND (d_date_sk#10 <= 2442413)))))) OR (((((((d_date_sk#10 >= 2442748) AND (d_date_sk#10 <= 2442778)) OR ((d_date_sk#10 >= 2443114) AND (d_date_sk#10 <= 2443144))) OR (((d_date_sk#10 >= 2443479) AND (d_date_sk#10 <= 2443509)) OR ((d_date_sk#10 >= 2443844) AND (d_date_sk#10 <= 2443874)))) OR ((((d_date_sk#10 >= 2444209) AND (d_date_sk#10 <= 2444239)) OR ((d_date_sk#10 >= 2444575) AND (d_date_sk#10 <= 2444605))) OR ((d_date_sk#10 >= 2444940) AND (d_date_sk#10 <= 2444970)))) OR (((((d_date_sk#10 >= 2445305) AND (d_date_sk#10 <= 2445335)) OR ((d_date_sk#10 >= 2445670) AND (d_date_sk#10 <= 2445700))) OR ((d_date_sk#10 >= 2446036) AND (d_date_sk#10 <= 2446066))) OR ((((d_date_sk#10 >= 2446401) AND (d_date_sk#10 <= 2446431)) OR ((d_date_sk#10 >= 2446766) AND (d_date_sk#10 <= 2446796))) OR ((d_date_sk#10 >= 2447131) AND (d_date_sk#10 <= 2447161))))) OR ((((((d_date_sk#10 >= 2447497) AND (d_date_sk#10 <= 2447527)) OR ((d_date_sk#10 >= 2447862) AND (d_date_sk#10 <= 2447892))) OR ((d_date_sk#10 >= 2448227) AND (d_date_sk#10 <= 2448257))) OR ((((d_date_sk#10 >= 2448592) AND (d_date_sk#10 <= 2448622)) OR ((d_date_sk#10 >= 2448958) AND (d_date_sk#10 <= 2448988))) OR ((d_date_sk#10 >= 2449323) AND (d_date_sk#10 <= 2449353)))) OR (((((d_date_sk#10 >= 2449688) AND (d_date_sk#10 <= 2449718)) OR ((d_date_sk#10 >= 2450053) AND (d_date_sk#10 <= 2450083))) OR ((d_date_sk#10 >= 2450419) AND (d_date_sk#10 <= 2450449))) OR ((((d_date_sk#10 >= 2450784) AND (d_date_sk#10 <= 2450814)) OR ((d_date_sk#10 >= 2451149) AND (d_date_sk#10 <= 2451179))) OR ((d_date_sk#10 >= 2451514) AND (d_date_sk#10 <= 2451544)))))))) OR (((((((((d_date_sk#10 >= 2451880) AND (d_date_sk#10 <= 2451910)) OR ((d_date_sk#10 >= 2452245) AND (d_date_sk#10 <= 2452275))) OR (((d_date_sk#10 >= 2452610) AND (d_date_sk#10 <= 2452640)) OR ((d_date_sk#10 >= 2452975) AND (d_date_sk#10 <= 2453005)))) OR ((((d_date_sk#10 >= 2453341) AND (d_date_sk#10 <= 2453371)) OR ((d_date_sk#10 >= 2453706) AND (d_date_sk#10 <= 2453736))) OR ((d_date_sk#10 >= 2454071) AND (d_date_sk#10 <= 2454101)))) OR (((((d_date_sk#10 >= 2454436) AND (d_date_sk#10 <= 2454466)) OR ((d_date_sk#10 >= 2454802) AND (d_date_sk#10 <= 2454832))) OR ((d_date_sk#10 >= 2455167) AND (d_date_sk#10 <= 2455197))) OR ((((d_date_sk#10 >= 2455532) AND (d_date_sk#10 <= 2455562)) OR ((d_date_sk#10 >= 2455897) AND (d_date_sk#10 <= 2455927))) OR ((d_date_sk#10 >= 2456263) AND (d_date_sk#10 <= 2456293))))) OR ((((((d_date_sk#10 >= 2456628) AND (d_date_sk#10 <= 2456658)) OR ((d_date_sk#10 >= 2456993) AND (d_date_sk#10 <= 2457023))) OR ((d_date_sk#10 >= 2457358) AND (d_date_sk#10 <= 2457388))) OR ((((d_date_sk#10 >= 2457724) AND (d_date_sk#10 <= 2457754)) OR ((d_date_sk#10 >= 2458089) AND (d_date_sk#10 <= 2458119))) OR ((d_date_sk#10 >= 2458454) AND (d_date_sk#10 <= 2458484)))) OR (((((d_date_sk#10 >= 2458819) AND (d_date_sk#10 <= 2458849)) OR ((d_date_sk#10 >= 2459185) AND (d_date_sk#10 <= 2459215))) OR ((d_date_sk#10 >= 2459550) AND (d_date_sk#10 <= 2459580))) OR ((((d_date_sk#10 >= 2459915) AND (d_date_sk#10 <= 2459945)) OR ((d_date_sk#10 >= 2460280) AND (d_date_sk#10 <= 2460310))) OR ((d_date_sk#10 >= 2460646) AND (d_date_sk#10 <= 2460676)))))) OR (((((((d_date_sk#10 >= 2461011) AND (d_date_sk#10 <= 2461041)) OR ((d_date_sk#10 >= 2461376) AND (d_date_sk#10 <= 2461406))) OR (((d_date_sk#10 >= 2461741) AND (d_date_sk#10 <= 2461771)) OR ((d_date_sk#10 >= 2462107) AND (d_date_sk#10 <= 2462137)))) OR ((((d_date_sk#10 >= 2462472) AND (d_date_sk#10 <= 2462502)) OR ((d_date_sk#10 >= 2462837) AND (d_date_sk#10 <= 2462867))) OR ((d_date_sk#10 >= 2463202) AND (d_date_sk#10 <= 2463232)))) OR (((((d_date_sk#10 >= 2463568) AND (d_date_sk#10 <= 2463598)) OR ((d_date_sk#10 >= 2463933) AND (d_date_sk#10 <= 2463963))) OR ((d_date_sk#10 >= 2464298) AND (d_date_sk#10 <= 2464328))) OR ((((d_date_sk#10 >= 2464663) AND (d_date_sk#10 <= 2464693)) OR ((d_date_sk#10 >= 2465029) AND (d_date_sk#10 <= 2465059))) OR ((d_date_sk#10 >= 2465394) AND (d_date_sk#10 <= 2465424))))) OR ((((((d_date_sk#10 >= 2465759) AND (d_date_sk#10 <= 2465789)) OR ((d_date_sk#10 >= 2466124) AND (d_date_sk#10 <= 2466154))) OR ((d_date_sk#10 >= 2466490) AND (d_date_sk#10 <= 2466520))) OR ((((d_date_sk#10 >= 2466855) AND (d_date_sk#10 <= 2466885)) OR ((d_date_sk#10 >= 2467220) AND (d_date_sk#10 <= 2467250))) OR ((d_date_sk#10 >= 2467585) AND (d_date_sk#10 <= 2467615)))) OR (((((d_date_sk#10 >= 2467951) AND (d_date_sk#10 <= 2467981)) OR ((d_date_sk#10 >= 2468316) AND (d_date_sk#10 <= 2468346))) OR ((d_date_sk#10 >= 2468681) AND (d_date_sk#10 <= 2468711))) OR ((((d_date_sk#10 >= 2469046) AND (d_date_sk#10 <= 2469076)) OR ((d_date_sk#10 >= 2469412) AND (d_date_sk#10 <= 2469442))) OR ((d_date_sk#10 >= 2469777) AND (d_date_sk#10 <= 2469807))))))) OR ((((((((d_date_sk#10 >= 2470142) AND (d_date_sk#10 <= 2470172)) OR ((d_date_sk#10 >= 2470507) AND (d_date_sk#10 <= 2470537))) OR (((d_date_sk#10 >= 2470873) AND (d_date_sk#10 <= 2470903)) OR ((d_date_sk#10 >= 2471238) AND (d_date_sk#10 <= 2471268)))) OR ((((d_date_sk#10 >= 2471603) AND (d_date_sk#10 <= 2471633)) OR ((d_date_sk#10 >= 2471968) AND (d_date_sk#10 <= 2471998))) OR ((d_date_sk#10 >= 2472334) AND (d_date_sk#10 <= 2472364)))) OR (((((d_date_sk#10 >= 2472699) AND (d_date_sk#10 <= 2472729)) OR ((d_date_sk#10 >= 2473064) AND (d_date_sk#10 <= 2473094))) OR ((d_date_sk#10 >= 2473429) AND (d_date_sk#10 <= 2473459))) OR ((((d_date_sk#10 >= 2473795) AND (d_date_sk#10 <= 2473825)) OR ((d_date_sk#10 >= 2474160) AND (d_date_sk#10 <= 2474190))) OR ((d_date_sk#10 >= 2474525) AND (d_date_sk#10 <= 2474555))))) OR ((((((d_date_sk#10 >= 2474890) AND (d_date_sk#10 <= 2474920)) OR ((d_date_sk#10 >= 2475256) AND (d_date_sk#10 <= 2475286))) OR ((d_date_sk#10 >= 2475621) AND (d_date_sk#10 <= 2475651))) OR ((((d_date_sk#10 >= 2475986) AND (d_date_sk#10 <= 2476016)) OR ((d_date_sk#10 >= 2476351) AND (d_date_sk#10 <= 2476381))) OR ((d_date_sk#10 >= 2476717) AND (d_date_sk#10 <= 2476747)))) OR (((((d_date_sk#10 >= 2477082) AND (d_date_sk#10 <= 2477112)) OR ((d_date_sk#10 >= 2477447) AND (d_date_sk#10 <= 2477477))) OR ((d_date_sk#10 >= 2477812) AND (d_date_sk#10 <= 2477842))) OR ((((d_date_sk#10 >= 2478178) AND (d_date_sk#10 <= 2478208)) OR ((d_date_sk#10 >= 2478543) AND (d_date_sk#10 <= 2478573))) OR ((d_date_sk#10 >= 2478908) AND (d_date_sk#10 <= 2478938)))))) OR (((((((d_date_sk#10 >= 2479273) AND (d_date_sk#10 <= 2479303)) OR ((d_date_sk#10 >= 2479639) AND (d_date_sk#10 <= 2479669))) OR (((d_date_sk#10 >= 2480004) AND (d_date_sk#10 <= 2480034)) OR ((d_date_sk#10 >= 2480369) AND (d_date_sk#10 <= 2480399)))) OR ((((d_date_sk#10 >= 2480734) AND (d_date_sk#10 <= 2480764)) OR ((d_date_sk#10 >= 2481100) AND (d_date_sk#10 <= 2481130))) OR ((d_date_sk#10 >= 2481465) AND (d_date_sk#10 <= 2481495)))) OR (((((d_date_sk#10 >= 2481830) AND (d_date_sk#10 <= 2481860)) OR ((d_date_sk#10 >= 2482195) AND (d_date_sk#10 <= 2482225))) OR ((d_date_sk#10 >= 2482561) AND (d_date_sk#10 <= 2482591))) OR ((((d_date_sk#10 >= 2482926) AND (d_date_sk#10 <= 2482956)) OR ((d_date_sk#10 >= 2483291) AND (d_date_sk#10 <= 2483321))) OR ((d_date_sk#10 >= 2483656) AND (d_date_sk#10 <= 2483686))))) OR ((((((d_date_sk#10 >= 2484022) AND (d_date_sk#10 <= 2484052)) OR ((d_date_sk#10 >= 2484387) AND (d_date_sk#10 <= 2484417))) OR ((d_date_sk#10 >= 2484752) AND (d_date_sk#10 <= 2484782))) OR ((((d_date_sk#10 >= 2485117) AND (d_date_sk#10 <= 2485147)) OR ((d_date_sk#10 >= 2485483) AND (d_date_sk#10 <= 2485513))) OR ((d_date_sk#10 >= 2485848) AND (d_date_sk#10 <= 2485878)))) OR (((((d_date_sk#10 >= 2486213) AND (d_date_sk#10 <= 2486243)) OR ((d_date_sk#10 >= 2486578) AND (d_date_sk#10 <= 2486608))) OR ((d_date_sk#10 >= 2486944) AND (d_date_sk#10 <= 2486974))) OR ((((d_date_sk#10 >= 2487309) AND (d_date_sk#10 <= 2487339)) OR ((d_date_sk#10 >= 2487674) AND (d_date_sk#10 <= 2487704))) OR ((d_date_sk#10 >= 2488039) AND (d_date_sk#10 <= 2488069)))))))))) AND isnotnull(d_date_sk#10)) + +(14) Project [codegen id : 2] +Output [2]: [d_date_sk#10, d_year#11] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(15) BroadcastExchange +Input [2]: [d_date_sk#10, d_year#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_year#11, ss_net_profit#2, i_brand_id#6, i_brand#7] +Input [6]: [ss_net_profit#2, ss_sold_date_sk#3, i_brand_id#6, i_brand#7, d_date_sk#10, d_year#11] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_year#11, ss_net_profit#2, i_brand_id#6, i_brand#7] +Keys [3]: [d_year#11, i_brand#7, i_brand_id#6] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum#14] +Results [4]: [d_year#11, i_brand#7, i_brand_id#6, sum#15] + +(19) Exchange +Input [4]: [d_year#11, i_brand#7, i_brand_id#6, sum#15] +Arguments: hashpartitioning(d_year#11, i_brand#7, i_brand_id#6, 5), ENSURE_REQUIREMENTS, [id=#16] + +(20) HashAggregate [codegen id : 4] +Input [4]: [d_year#11, i_brand#7, i_brand_id#6, sum#15] +Keys [3]: [d_year#11, i_brand#7, i_brand_id#6] +Functions [1]: [sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#2))#17] +Results [4]: [d_year#11, i_brand_id#6 AS brand_id#18, i_brand#7 AS brand#19, MakeDecimal(sum(UnscaledValue(ss_net_profit#2))#17,17,2) AS sum_agg#20] + +(21) TakeOrderedAndProject +Input [4]: [d_year#11, brand_id#18, brand#19, sum_agg#20] +Arguments: 100, [d_year#11 ASC NULLS FIRST, sum_agg#20 DESC NULLS LAST, brand_id#18 ASC NULLS FIRST], [d_year#11, brand_id#18, brand#19, sum_agg#20] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (22) + + +(22) ReusedExchange [Reuses operator id: 15] +Output [2]: [d_date_sk#10, d_year#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/simplified.txt new file mode 100644 index 0000000000000..edf36b708a750 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3.sf100/simplified.txt @@ -0,0 +1,33 @@ +TakeOrderedAndProject [d_year,sum_agg,brand_id,brand] + WholeStageCodegen (4) + HashAggregate [d_year,i_brand,i_brand_id,sum] [sum(UnscaledValue(ss_net_profit)),brand_id,brand,sum_agg,sum] + InputAdapter + Exchange [d_year,i_brand,i_brand_id] #1 + WholeStageCodegen (3) + HashAggregate [d_year,i_brand,i_brand_id,ss_net_profit] [sum,sum] + Project [d_year,ss_net_profit,i_brand_id,i_brand] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_net_profit,ss_sold_date_sk,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk,d_year] + Filter [d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3/explain.txt new file mode 100644 index 0000000000000..a60caf19f23df --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3/explain.txt @@ -0,0 +1,123 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- BroadcastExchange (8) + : +- * Filter (7) + : +- * ColumnarToRow (6) + : +- Scan parquet default.store_sales (5) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), EqualTo(d_moy,12), Or(Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2415355),LessThanOrEqual(d_date_sk,2415385)),And(GreaterThanOrEqual(d_date_sk,2415720),LessThanOrEqual(d_date_sk,2415750))),Or(And(GreaterThanOrEqual(d_date_sk,2416085),LessThanOrEqual(d_date_sk,2416115)),And(GreaterThanOrEqual(d_date_sk,2416450),LessThanOrEqual(d_date_sk,2416480)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2416816),LessThanOrEqual(d_date_sk,2416846)),And(GreaterThanOrEqual(d_date_sk,2417181),LessThanOrEqual(d_date_sk,2417211))),And(GreaterThanOrEqual(d_date_sk,2417546),LessThanOrEqual(d_date_sk,2417576)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2417911),LessThanOrEqual(d_date_sk,2417941)),And(GreaterThanOrEqual(d_date_sk,2418277),LessThanOrEqual(d_date_sk,2418307))),And(GreaterThanOrEqual(d_date_sk,2418642),LessThanOrEqual(d_date_sk,2418672))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2419007),LessThanOrEqual(d_date_sk,2419037)),And(GreaterThanOrEqual(d_date_sk,2419372),LessThanOrEqual(d_date_sk,2419402))),And(GreaterThanOrEqual(d_date_sk,2419738),LessThanOrEqual(d_date_sk,2419768))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2420103),LessThanOrEqual(d_date_sk,2420133)),And(GreaterThanOrEqual(d_date_sk,2420468),LessThanOrEqual(d_date_sk,2420498))),And(GreaterThanOrEqual(d_date_sk,2420833),LessThanOrEqual(d_date_sk,2420863))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2421199),LessThanOrEqual(d_date_sk,2421229)),And(GreaterThanOrEqual(d_date_sk,2421564),LessThanOrEqual(d_date_sk,2421594))),And(GreaterThanOrEqual(d_date_sk,2421929),LessThanOrEqual(d_date_sk,2421959)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2422294),LessThanOrEqual(d_date_sk,2422324)),And(GreaterThanOrEqual(d_date_sk,2422660),LessThanOrEqual(d_date_sk,2422690))),And(GreaterThanOrEqual(d_date_sk,2423025),LessThanOrEqual(d_date_sk,2423055))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2423390),LessThanOrEqual(d_date_sk,2423420)),And(GreaterThanOrEqual(d_date_sk,2423755),LessThanOrEqual(d_date_sk,2423785))),And(GreaterThanOrEqual(d_date_sk,2424121),LessThanOrEqual(d_date_sk,2424151)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2424486),LessThanOrEqual(d_date_sk,2424516)),And(GreaterThanOrEqual(d_date_sk,2424851),LessThanOrEqual(d_date_sk,2424881))),Or(And(GreaterThanOrEqual(d_date_sk,2425216),LessThanOrEqual(d_date_sk,2425246)),And(GreaterThanOrEqual(d_date_sk,2425582),LessThanOrEqual(d_date_sk,2425612)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2425947),LessThanOrEqual(d_date_sk,2425977)),And(GreaterThanOrEqual(d_date_sk,2426312),LessThanOrEqual(d_date_sk,2426342))),And(GreaterThanOrEqual(d_date_sk,2426677),LessThanOrEqual(d_date_sk,2426707)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2427043),LessThanOrEqual(d_date_sk,2427073)),And(GreaterThanOrEqual(d_date_sk,2427408),LessThanOrEqual(d_date_sk,2427438))),And(GreaterThanOrEqual(d_date_sk,2427773),LessThanOrEqual(d_date_sk,2427803))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2428138),LessThanOrEqual(d_date_sk,2428168)),And(GreaterThanOrEqual(d_date_sk,2428504),LessThanOrEqual(d_date_sk,2428534))),And(GreaterThanOrEqual(d_date_sk,2428869),LessThanOrEqual(d_date_sk,2428899))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2429234),LessThanOrEqual(d_date_sk,2429264)),And(GreaterThanOrEqual(d_date_sk,2429599),LessThanOrEqual(d_date_sk,2429629))),And(GreaterThanOrEqual(d_date_sk,2429965),LessThanOrEqual(d_date_sk,2429995))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2430330),LessThanOrEqual(d_date_sk,2430360)),And(GreaterThanOrEqual(d_date_sk,2430695),LessThanOrEqual(d_date_sk,2430725))),And(GreaterThanOrEqual(d_date_sk,2431060),LessThanOrEqual(d_date_sk,2431090)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2431426),LessThanOrEqual(d_date_sk,2431456)),And(GreaterThanOrEqual(d_date_sk,2431791),LessThanOrEqual(d_date_sk,2431821))),And(GreaterThanOrEqual(d_date_sk,2432156),LessThanOrEqual(d_date_sk,2432186))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2432521),LessThanOrEqual(d_date_sk,2432551)),And(GreaterThanOrEqual(d_date_sk,2432887),LessThanOrEqual(d_date_sk,2432917))),And(GreaterThanOrEqual(d_date_sk,2433252),LessThanOrEqual(d_date_sk,2433282))))))),Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2433617),LessThanOrEqual(d_date_sk,2433647)),And(GreaterThanOrEqual(d_date_sk,2433982),LessThanOrEqual(d_date_sk,2434012))),Or(And(GreaterThanOrEqual(d_date_sk,2434348),LessThanOrEqual(d_date_sk,2434378)),And(GreaterThanOrEqual(d_date_sk,2434713),LessThanOrEqual(d_date_sk,2434743)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2435078),LessThanOrEqual(d_date_sk,2435108)),And(GreaterThanOrEqual(d_date_sk,2435443),LessThanOrEqual(d_date_sk,2435473))),And(GreaterThanOrEqual(d_date_sk,2435809),LessThanOrEqual(d_date_sk,2435839)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2436174),LessThanOrEqual(d_date_sk,2436204)),And(GreaterThanOrEqual(d_date_sk,2436539),LessThanOrEqual(d_date_sk,2436569))),And(GreaterThanOrEqual(d_date_sk,2436904),LessThanOrEqual(d_date_sk,2436934))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2437270),LessThanOrEqual(d_date_sk,2437300)),And(GreaterThanOrEqual(d_date_sk,2437635),LessThanOrEqual(d_date_sk,2437665))),And(GreaterThanOrEqual(d_date_sk,2438000),LessThanOrEqual(d_date_sk,2438030))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2438365),LessThanOrEqual(d_date_sk,2438395)),And(GreaterThanOrEqual(d_date_sk,2438731),LessThanOrEqual(d_date_sk,2438761))),And(GreaterThanOrEqual(d_date_sk,2439096),LessThanOrEqual(d_date_sk,2439126))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2439461),LessThanOrEqual(d_date_sk,2439491)),And(GreaterThanOrEqual(d_date_sk,2439826),LessThanOrEqual(d_date_sk,2439856))),And(GreaterThanOrEqual(d_date_sk,2440192),LessThanOrEqual(d_date_sk,2440222)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2440557),LessThanOrEqual(d_date_sk,2440587)),And(GreaterThanOrEqual(d_date_sk,2440922),LessThanOrEqual(d_date_sk,2440952))),And(GreaterThanOrEqual(d_date_sk,2441287),LessThanOrEqual(d_date_sk,2441317))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2441653),LessThanOrEqual(d_date_sk,2441683)),And(GreaterThanOrEqual(d_date_sk,2442018),LessThanOrEqual(d_date_sk,2442048))),And(GreaterThanOrEqual(d_date_sk,2442383),LessThanOrEqual(d_date_sk,2442413)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2442748),LessThanOrEqual(d_date_sk,2442778)),And(GreaterThanOrEqual(d_date_sk,2443114),LessThanOrEqual(d_date_sk,2443144))),Or(And(GreaterThanOrEqual(d_date_sk,2443479),LessThanOrEqual(d_date_sk,2443509)),And(GreaterThanOrEqual(d_date_sk,2443844),LessThanOrEqual(d_date_sk,2443874)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2444209),LessThanOrEqual(d_date_sk,2444239)),And(GreaterThanOrEqual(d_date_sk,2444575),LessThanOrEqual(d_date_sk,2444605))),And(GreaterThanOrEqual(d_date_sk,2444940),LessThanOrEqual(d_date_sk,2444970)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2445305),LessThanOrEqual(d_date_sk,2445335)),And(GreaterThanOrEqual(d_date_sk,2445670),LessThanOrEqual(d_date_sk,2445700))),And(GreaterThanOrEqual(d_date_sk,2446036),LessThanOrEqual(d_date_sk,2446066))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2446401),LessThanOrEqual(d_date_sk,2446431)),And(GreaterThanOrEqual(d_date_sk,2446766),LessThanOrEqual(d_date_sk,2446796))),And(GreaterThanOrEqual(d_date_sk,2447131),LessThanOrEqual(d_date_sk,2447161))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2447497),LessThanOrEqual(d_date_sk,2447527)),And(GreaterThanOrEqual(d_date_sk,2447862),LessThanOrEqual(d_date_sk,2447892))),And(GreaterThanOrEqual(d_date_sk,2448227),LessThanOrEqual(d_date_sk,2448257))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2448592),LessThanOrEqual(d_date_sk,2448622)),And(GreaterThanOrEqual(d_date_sk,2448958),LessThanOrEqual(d_date_sk,2448988))),And(GreaterThanOrEqual(d_date_sk,2449323),LessThanOrEqual(d_date_sk,2449353)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2449688),LessThanOrEqual(d_date_sk,2449718)),And(GreaterThanOrEqual(d_date_sk,2450053),LessThanOrEqual(d_date_sk,2450083))),And(GreaterThanOrEqual(d_date_sk,2450419),LessThanOrEqual(d_date_sk,2450449))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2450784),LessThanOrEqual(d_date_sk,2450814)),And(GreaterThanOrEqual(d_date_sk,2451149),LessThanOrEqual(d_date_sk,2451179))),And(GreaterThanOrEqual(d_date_sk,2451514),LessThanOrEqual(d_date_sk,2451544)))))))),Or(Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2451880),LessThanOrEqual(d_date_sk,2451910)),And(GreaterThanOrEqual(d_date_sk,2452245),LessThanOrEqual(d_date_sk,2452275))),Or(And(GreaterThanOrEqual(d_date_sk,2452610),LessThanOrEqual(d_date_sk,2452640)),And(GreaterThanOrEqual(d_date_sk,2452975),LessThanOrEqual(d_date_sk,2453005)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2453341),LessThanOrEqual(d_date_sk,2453371)),And(GreaterThanOrEqual(d_date_sk,2453706),LessThanOrEqual(d_date_sk,2453736))),And(GreaterThanOrEqual(d_date_sk,2454071),LessThanOrEqual(d_date_sk,2454101)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2454436),LessThanOrEqual(d_date_sk,2454466)),And(GreaterThanOrEqual(d_date_sk,2454802),LessThanOrEqual(d_date_sk,2454832))),And(GreaterThanOrEqual(d_date_sk,2455167),LessThanOrEqual(d_date_sk,2455197))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2455532),LessThanOrEqual(d_date_sk,2455562)),And(GreaterThanOrEqual(d_date_sk,2455897),LessThanOrEqual(d_date_sk,2455927))),And(GreaterThanOrEqual(d_date_sk,2456263),LessThanOrEqual(d_date_sk,2456293))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2456628),LessThanOrEqual(d_date_sk,2456658)),And(GreaterThanOrEqual(d_date_sk,2456993),LessThanOrEqual(d_date_sk,2457023))),And(GreaterThanOrEqual(d_date_sk,2457358),LessThanOrEqual(d_date_sk,2457388))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2457724),LessThanOrEqual(d_date_sk,2457754)),And(GreaterThanOrEqual(d_date_sk,2458089),LessThanOrEqual(d_date_sk,2458119))),And(GreaterThanOrEqual(d_date_sk,2458454),LessThanOrEqual(d_date_sk,2458484)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2458819),LessThanOrEqual(d_date_sk,2458849)),And(GreaterThanOrEqual(d_date_sk,2459185),LessThanOrEqual(d_date_sk,2459215))),And(GreaterThanOrEqual(d_date_sk,2459550),LessThanOrEqual(d_date_sk,2459580))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2459915),LessThanOrEqual(d_date_sk,2459945)),And(GreaterThanOrEqual(d_date_sk,2460280),LessThanOrEqual(d_date_sk,2460310))),And(GreaterThanOrEqual(d_date_sk,2460646),LessThanOrEqual(d_date_sk,2460676)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2461011),LessThanOrEqual(d_date_sk,2461041)),And(GreaterThanOrEqual(d_date_sk,2461376),LessThanOrEqual(d_date_sk,2461406))),Or(And(GreaterThanOrEqual(d_date_sk,2461741),LessThanOrEqual(d_date_sk,2461771)),And(GreaterThanOrEqual(d_date_sk,2462107),LessThanOrEqual(d_date_sk,2462137)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2462472),LessThanOrEqual(d_date_sk,2462502)),And(GreaterThanOrEqual(d_date_sk,2462837),LessThanOrEqual(d_date_sk,2462867))),And(GreaterThanOrEqual(d_date_sk,2463202),LessThanOrEqual(d_date_sk,2463232)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2463568),LessThanOrEqual(d_date_sk,2463598)),And(GreaterThanOrEqual(d_date_sk,2463933),LessThanOrEqual(d_date_sk,2463963))),And(GreaterThanOrEqual(d_date_sk,2464298),LessThanOrEqual(d_date_sk,2464328))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2464663),LessThanOrEqual(d_date_sk,2464693)),And(GreaterThanOrEqual(d_date_sk,2465029),LessThanOrEqual(d_date_sk,2465059))),And(GreaterThanOrEqual(d_date_sk,2465394),LessThanOrEqual(d_date_sk,2465424))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2465759),LessThanOrEqual(d_date_sk,2465789)),And(GreaterThanOrEqual(d_date_sk,2466124),LessThanOrEqual(d_date_sk,2466154))),And(GreaterThanOrEqual(d_date_sk,2466490),LessThanOrEqual(d_date_sk,2466520))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2466855),LessThanOrEqual(d_date_sk,2466885)),And(GreaterThanOrEqual(d_date_sk,2467220),LessThanOrEqual(d_date_sk,2467250))),And(GreaterThanOrEqual(d_date_sk,2467585),LessThanOrEqual(d_date_sk,2467615)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2467951),LessThanOrEqual(d_date_sk,2467981)),And(GreaterThanOrEqual(d_date_sk,2468316),LessThanOrEqual(d_date_sk,2468346))),And(GreaterThanOrEqual(d_date_sk,2468681),LessThanOrEqual(d_date_sk,2468711))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2469046),LessThanOrEqual(d_date_sk,2469076)),And(GreaterThanOrEqual(d_date_sk,2469412),LessThanOrEqual(d_date_sk,2469442))),And(GreaterThanOrEqual(d_date_sk,2469777),LessThanOrEqual(d_date_sk,2469807))))))),Or(Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2470142),LessThanOrEqual(d_date_sk,2470172)),And(GreaterThanOrEqual(d_date_sk,2470507),LessThanOrEqual(d_date_sk,2470537))),Or(And(GreaterThanOrEqual(d_date_sk,2470873),LessThanOrEqual(d_date_sk,2470903)),And(GreaterThanOrEqual(d_date_sk,2471238),LessThanOrEqual(d_date_sk,2471268)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2471603),LessThanOrEqual(d_date_sk,2471633)),And(GreaterThanOrEqual(d_date_sk,2471968),LessThanOrEqual(d_date_sk,2471998))),And(GreaterThanOrEqual(d_date_sk,2472334),LessThanOrEqual(d_date_sk,2472364)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2472699),LessThanOrEqual(d_date_sk,2472729)),And(GreaterThanOrEqual(d_date_sk,2473064),LessThanOrEqual(d_date_sk,2473094))),And(GreaterThanOrEqual(d_date_sk,2473429),LessThanOrEqual(d_date_sk,2473459))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2473795),LessThanOrEqual(d_date_sk,2473825)),And(GreaterThanOrEqual(d_date_sk,2474160),LessThanOrEqual(d_date_sk,2474190))),And(GreaterThanOrEqual(d_date_sk,2474525),LessThanOrEqual(d_date_sk,2474555))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2474890),LessThanOrEqual(d_date_sk,2474920)),And(GreaterThanOrEqual(d_date_sk,2475256),LessThanOrEqual(d_date_sk,2475286))),And(GreaterThanOrEqual(d_date_sk,2475621),LessThanOrEqual(d_date_sk,2475651))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2475986),LessThanOrEqual(d_date_sk,2476016)),And(GreaterThanOrEqual(d_date_sk,2476351),LessThanOrEqual(d_date_sk,2476381))),And(GreaterThanOrEqual(d_date_sk,2476717),LessThanOrEqual(d_date_sk,2476747)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2477082),LessThanOrEqual(d_date_sk,2477112)),And(GreaterThanOrEqual(d_date_sk,2477447),LessThanOrEqual(d_date_sk,2477477))),And(GreaterThanOrEqual(d_date_sk,2477812),LessThanOrEqual(d_date_sk,2477842))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2478178),LessThanOrEqual(d_date_sk,2478208)),And(GreaterThanOrEqual(d_date_sk,2478543),LessThanOrEqual(d_date_sk,2478573))),And(GreaterThanOrEqual(d_date_sk,2478908),LessThanOrEqual(d_date_sk,2478938)))))),Or(Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2479273),LessThanOrEqual(d_date_sk,2479303)),And(GreaterThanOrEqual(d_date_sk,2479639),LessThanOrEqual(d_date_sk,2479669))),Or(And(GreaterThanOrEqual(d_date_sk,2480004),LessThanOrEqual(d_date_sk,2480034)),And(GreaterThanOrEqual(d_date_sk,2480369),LessThanOrEqual(d_date_sk,2480399)))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2480734),LessThanOrEqual(d_date_sk,2480764)),And(GreaterThanOrEqual(d_date_sk,2481100),LessThanOrEqual(d_date_sk,2481130))),And(GreaterThanOrEqual(d_date_sk,2481465),LessThanOrEqual(d_date_sk,2481495)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2481830),LessThanOrEqual(d_date_sk,2481860)),And(GreaterThanOrEqual(d_date_sk,2482195),LessThanOrEqual(d_date_sk,2482225))),And(GreaterThanOrEqual(d_date_sk,2482561),LessThanOrEqual(d_date_sk,2482591))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2482926),LessThanOrEqual(d_date_sk,2482956)),And(GreaterThanOrEqual(d_date_sk,2483291),LessThanOrEqual(d_date_sk,2483321))),And(GreaterThanOrEqual(d_date_sk,2483656),LessThanOrEqual(d_date_sk,2483686))))),Or(Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2484022),LessThanOrEqual(d_date_sk,2484052)),And(GreaterThanOrEqual(d_date_sk,2484387),LessThanOrEqual(d_date_sk,2484417))),And(GreaterThanOrEqual(d_date_sk,2484752),LessThanOrEqual(d_date_sk,2484782))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2485117),LessThanOrEqual(d_date_sk,2485147)),And(GreaterThanOrEqual(d_date_sk,2485483),LessThanOrEqual(d_date_sk,2485513))),And(GreaterThanOrEqual(d_date_sk,2485848),LessThanOrEqual(d_date_sk,2485878)))),Or(Or(Or(And(GreaterThanOrEqual(d_date_sk,2486213),LessThanOrEqual(d_date_sk,2486243)),And(GreaterThanOrEqual(d_date_sk,2486578),LessThanOrEqual(d_date_sk,2486608))),And(GreaterThanOrEqual(d_date_sk,2486944),LessThanOrEqual(d_date_sk,2486974))),Or(Or(And(GreaterThanOrEqual(d_date_sk,2487309),LessThanOrEqual(d_date_sk,2487339)),And(GreaterThanOrEqual(d_date_sk,2487674),LessThanOrEqual(d_date_sk,2487704))),And(GreaterThanOrEqual(d_date_sk,2488039),LessThanOrEqual(d_date_sk,2488069))))))))), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : (((isnotnull(d_moy#3) AND (d_moy#3 = 12)) AND ((((((((((d_date_sk#1 >= 2415355) AND (d_date_sk#1 <= 2415385)) OR ((d_date_sk#1 >= 2415720) AND (d_date_sk#1 <= 2415750))) OR (((d_date_sk#1 >= 2416085) AND (d_date_sk#1 <= 2416115)) OR ((d_date_sk#1 >= 2416450) AND (d_date_sk#1 <= 2416480)))) OR ((((d_date_sk#1 >= 2416816) AND (d_date_sk#1 <= 2416846)) OR ((d_date_sk#1 >= 2417181) AND (d_date_sk#1 <= 2417211))) OR ((d_date_sk#1 >= 2417546) AND (d_date_sk#1 <= 2417576)))) OR (((((d_date_sk#1 >= 2417911) AND (d_date_sk#1 <= 2417941)) OR ((d_date_sk#1 >= 2418277) AND (d_date_sk#1 <= 2418307))) OR ((d_date_sk#1 >= 2418642) AND (d_date_sk#1 <= 2418672))) OR ((((d_date_sk#1 >= 2419007) AND (d_date_sk#1 <= 2419037)) OR ((d_date_sk#1 >= 2419372) AND (d_date_sk#1 <= 2419402))) OR ((d_date_sk#1 >= 2419738) AND (d_date_sk#1 <= 2419768))))) OR ((((((d_date_sk#1 >= 2420103) AND (d_date_sk#1 <= 2420133)) OR ((d_date_sk#1 >= 2420468) AND (d_date_sk#1 <= 2420498))) OR ((d_date_sk#1 >= 2420833) AND (d_date_sk#1 <= 2420863))) OR ((((d_date_sk#1 >= 2421199) AND (d_date_sk#1 <= 2421229)) OR ((d_date_sk#1 >= 2421564) AND (d_date_sk#1 <= 2421594))) OR ((d_date_sk#1 >= 2421929) AND (d_date_sk#1 <= 2421959)))) OR (((((d_date_sk#1 >= 2422294) AND (d_date_sk#1 <= 2422324)) OR ((d_date_sk#1 >= 2422660) AND (d_date_sk#1 <= 2422690))) OR ((d_date_sk#1 >= 2423025) AND (d_date_sk#1 <= 2423055))) OR ((((d_date_sk#1 >= 2423390) AND (d_date_sk#1 <= 2423420)) OR ((d_date_sk#1 >= 2423755) AND (d_date_sk#1 <= 2423785))) OR ((d_date_sk#1 >= 2424121) AND (d_date_sk#1 <= 2424151)))))) OR (((((((d_date_sk#1 >= 2424486) AND (d_date_sk#1 <= 2424516)) OR ((d_date_sk#1 >= 2424851) AND (d_date_sk#1 <= 2424881))) OR (((d_date_sk#1 >= 2425216) AND (d_date_sk#1 <= 2425246)) OR ((d_date_sk#1 >= 2425582) AND (d_date_sk#1 <= 2425612)))) OR ((((d_date_sk#1 >= 2425947) AND (d_date_sk#1 <= 2425977)) OR ((d_date_sk#1 >= 2426312) AND (d_date_sk#1 <= 2426342))) OR ((d_date_sk#1 >= 2426677) AND (d_date_sk#1 <= 2426707)))) OR (((((d_date_sk#1 >= 2427043) AND (d_date_sk#1 <= 2427073)) OR ((d_date_sk#1 >= 2427408) AND (d_date_sk#1 <= 2427438))) OR ((d_date_sk#1 >= 2427773) AND (d_date_sk#1 <= 2427803))) OR ((((d_date_sk#1 >= 2428138) AND (d_date_sk#1 <= 2428168)) OR ((d_date_sk#1 >= 2428504) AND (d_date_sk#1 <= 2428534))) OR ((d_date_sk#1 >= 2428869) AND (d_date_sk#1 <= 2428899))))) OR ((((((d_date_sk#1 >= 2429234) AND (d_date_sk#1 <= 2429264)) OR ((d_date_sk#1 >= 2429599) AND (d_date_sk#1 <= 2429629))) OR ((d_date_sk#1 >= 2429965) AND (d_date_sk#1 <= 2429995))) OR ((((d_date_sk#1 >= 2430330) AND (d_date_sk#1 <= 2430360)) OR ((d_date_sk#1 >= 2430695) AND (d_date_sk#1 <= 2430725))) OR ((d_date_sk#1 >= 2431060) AND (d_date_sk#1 <= 2431090)))) OR (((((d_date_sk#1 >= 2431426) AND (d_date_sk#1 <= 2431456)) OR ((d_date_sk#1 >= 2431791) AND (d_date_sk#1 <= 2431821))) OR ((d_date_sk#1 >= 2432156) AND (d_date_sk#1 <= 2432186))) OR ((((d_date_sk#1 >= 2432521) AND (d_date_sk#1 <= 2432551)) OR ((d_date_sk#1 >= 2432887) AND (d_date_sk#1 <= 2432917))) OR ((d_date_sk#1 >= 2433252) AND (d_date_sk#1 <= 2433282))))))) OR ((((((((d_date_sk#1 >= 2433617) AND (d_date_sk#1 <= 2433647)) OR ((d_date_sk#1 >= 2433982) AND (d_date_sk#1 <= 2434012))) OR (((d_date_sk#1 >= 2434348) AND (d_date_sk#1 <= 2434378)) OR ((d_date_sk#1 >= 2434713) AND (d_date_sk#1 <= 2434743)))) OR ((((d_date_sk#1 >= 2435078) AND (d_date_sk#1 <= 2435108)) OR ((d_date_sk#1 >= 2435443) AND (d_date_sk#1 <= 2435473))) OR ((d_date_sk#1 >= 2435809) AND (d_date_sk#1 <= 2435839)))) OR (((((d_date_sk#1 >= 2436174) AND (d_date_sk#1 <= 2436204)) OR ((d_date_sk#1 >= 2436539) AND (d_date_sk#1 <= 2436569))) OR ((d_date_sk#1 >= 2436904) AND (d_date_sk#1 <= 2436934))) OR ((((d_date_sk#1 >= 2437270) AND (d_date_sk#1 <= 2437300)) OR ((d_date_sk#1 >= 2437635) AND (d_date_sk#1 <= 2437665))) OR ((d_date_sk#1 >= 2438000) AND (d_date_sk#1 <= 2438030))))) OR ((((((d_date_sk#1 >= 2438365) AND (d_date_sk#1 <= 2438395)) OR ((d_date_sk#1 >= 2438731) AND (d_date_sk#1 <= 2438761))) OR ((d_date_sk#1 >= 2439096) AND (d_date_sk#1 <= 2439126))) OR ((((d_date_sk#1 >= 2439461) AND (d_date_sk#1 <= 2439491)) OR ((d_date_sk#1 >= 2439826) AND (d_date_sk#1 <= 2439856))) OR ((d_date_sk#1 >= 2440192) AND (d_date_sk#1 <= 2440222)))) OR (((((d_date_sk#1 >= 2440557) AND (d_date_sk#1 <= 2440587)) OR ((d_date_sk#1 >= 2440922) AND (d_date_sk#1 <= 2440952))) OR ((d_date_sk#1 >= 2441287) AND (d_date_sk#1 <= 2441317))) OR ((((d_date_sk#1 >= 2441653) AND (d_date_sk#1 <= 2441683)) OR ((d_date_sk#1 >= 2442018) AND (d_date_sk#1 <= 2442048))) OR ((d_date_sk#1 >= 2442383) AND (d_date_sk#1 <= 2442413)))))) OR (((((((d_date_sk#1 >= 2442748) AND (d_date_sk#1 <= 2442778)) OR ((d_date_sk#1 >= 2443114) AND (d_date_sk#1 <= 2443144))) OR (((d_date_sk#1 >= 2443479) AND (d_date_sk#1 <= 2443509)) OR ((d_date_sk#1 >= 2443844) AND (d_date_sk#1 <= 2443874)))) OR ((((d_date_sk#1 >= 2444209) AND (d_date_sk#1 <= 2444239)) OR ((d_date_sk#1 >= 2444575) AND (d_date_sk#1 <= 2444605))) OR ((d_date_sk#1 >= 2444940) AND (d_date_sk#1 <= 2444970)))) OR (((((d_date_sk#1 >= 2445305) AND (d_date_sk#1 <= 2445335)) OR ((d_date_sk#1 >= 2445670) AND (d_date_sk#1 <= 2445700))) OR ((d_date_sk#1 >= 2446036) AND (d_date_sk#1 <= 2446066))) OR ((((d_date_sk#1 >= 2446401) AND (d_date_sk#1 <= 2446431)) OR ((d_date_sk#1 >= 2446766) AND (d_date_sk#1 <= 2446796))) OR ((d_date_sk#1 >= 2447131) AND (d_date_sk#1 <= 2447161))))) OR ((((((d_date_sk#1 >= 2447497) AND (d_date_sk#1 <= 2447527)) OR ((d_date_sk#1 >= 2447862) AND (d_date_sk#1 <= 2447892))) OR ((d_date_sk#1 >= 2448227) AND (d_date_sk#1 <= 2448257))) OR ((((d_date_sk#1 >= 2448592) AND (d_date_sk#1 <= 2448622)) OR ((d_date_sk#1 >= 2448958) AND (d_date_sk#1 <= 2448988))) OR ((d_date_sk#1 >= 2449323) AND (d_date_sk#1 <= 2449353)))) OR (((((d_date_sk#1 >= 2449688) AND (d_date_sk#1 <= 2449718)) OR ((d_date_sk#1 >= 2450053) AND (d_date_sk#1 <= 2450083))) OR ((d_date_sk#1 >= 2450419) AND (d_date_sk#1 <= 2450449))) OR ((((d_date_sk#1 >= 2450784) AND (d_date_sk#1 <= 2450814)) OR ((d_date_sk#1 >= 2451149) AND (d_date_sk#1 <= 2451179))) OR ((d_date_sk#1 >= 2451514) AND (d_date_sk#1 <= 2451544)))))))) OR (((((((((d_date_sk#1 >= 2451880) AND (d_date_sk#1 <= 2451910)) OR ((d_date_sk#1 >= 2452245) AND (d_date_sk#1 <= 2452275))) OR (((d_date_sk#1 >= 2452610) AND (d_date_sk#1 <= 2452640)) OR ((d_date_sk#1 >= 2452975) AND (d_date_sk#1 <= 2453005)))) OR ((((d_date_sk#1 >= 2453341) AND (d_date_sk#1 <= 2453371)) OR ((d_date_sk#1 >= 2453706) AND (d_date_sk#1 <= 2453736))) OR ((d_date_sk#1 >= 2454071) AND (d_date_sk#1 <= 2454101)))) OR (((((d_date_sk#1 >= 2454436) AND (d_date_sk#1 <= 2454466)) OR ((d_date_sk#1 >= 2454802) AND (d_date_sk#1 <= 2454832))) OR ((d_date_sk#1 >= 2455167) AND (d_date_sk#1 <= 2455197))) OR ((((d_date_sk#1 >= 2455532) AND (d_date_sk#1 <= 2455562)) OR ((d_date_sk#1 >= 2455897) AND (d_date_sk#1 <= 2455927))) OR ((d_date_sk#1 >= 2456263) AND (d_date_sk#1 <= 2456293))))) OR ((((((d_date_sk#1 >= 2456628) AND (d_date_sk#1 <= 2456658)) OR ((d_date_sk#1 >= 2456993) AND (d_date_sk#1 <= 2457023))) OR ((d_date_sk#1 >= 2457358) AND (d_date_sk#1 <= 2457388))) OR ((((d_date_sk#1 >= 2457724) AND (d_date_sk#1 <= 2457754)) OR ((d_date_sk#1 >= 2458089) AND (d_date_sk#1 <= 2458119))) OR ((d_date_sk#1 >= 2458454) AND (d_date_sk#1 <= 2458484)))) OR (((((d_date_sk#1 >= 2458819) AND (d_date_sk#1 <= 2458849)) OR ((d_date_sk#1 >= 2459185) AND (d_date_sk#1 <= 2459215))) OR ((d_date_sk#1 >= 2459550) AND (d_date_sk#1 <= 2459580))) OR ((((d_date_sk#1 >= 2459915) AND (d_date_sk#1 <= 2459945)) OR ((d_date_sk#1 >= 2460280) AND (d_date_sk#1 <= 2460310))) OR ((d_date_sk#1 >= 2460646) AND (d_date_sk#1 <= 2460676)))))) OR (((((((d_date_sk#1 >= 2461011) AND (d_date_sk#1 <= 2461041)) OR ((d_date_sk#1 >= 2461376) AND (d_date_sk#1 <= 2461406))) OR (((d_date_sk#1 >= 2461741) AND (d_date_sk#1 <= 2461771)) OR ((d_date_sk#1 >= 2462107) AND (d_date_sk#1 <= 2462137)))) OR ((((d_date_sk#1 >= 2462472) AND (d_date_sk#1 <= 2462502)) OR ((d_date_sk#1 >= 2462837) AND (d_date_sk#1 <= 2462867))) OR ((d_date_sk#1 >= 2463202) AND (d_date_sk#1 <= 2463232)))) OR (((((d_date_sk#1 >= 2463568) AND (d_date_sk#1 <= 2463598)) OR ((d_date_sk#1 >= 2463933) AND (d_date_sk#1 <= 2463963))) OR ((d_date_sk#1 >= 2464298) AND (d_date_sk#1 <= 2464328))) OR ((((d_date_sk#1 >= 2464663) AND (d_date_sk#1 <= 2464693)) OR ((d_date_sk#1 >= 2465029) AND (d_date_sk#1 <= 2465059))) OR ((d_date_sk#1 >= 2465394) AND (d_date_sk#1 <= 2465424))))) OR ((((((d_date_sk#1 >= 2465759) AND (d_date_sk#1 <= 2465789)) OR ((d_date_sk#1 >= 2466124) AND (d_date_sk#1 <= 2466154))) OR ((d_date_sk#1 >= 2466490) AND (d_date_sk#1 <= 2466520))) OR ((((d_date_sk#1 >= 2466855) AND (d_date_sk#1 <= 2466885)) OR ((d_date_sk#1 >= 2467220) AND (d_date_sk#1 <= 2467250))) OR ((d_date_sk#1 >= 2467585) AND (d_date_sk#1 <= 2467615)))) OR (((((d_date_sk#1 >= 2467951) AND (d_date_sk#1 <= 2467981)) OR ((d_date_sk#1 >= 2468316) AND (d_date_sk#1 <= 2468346))) OR ((d_date_sk#1 >= 2468681) AND (d_date_sk#1 <= 2468711))) OR ((((d_date_sk#1 >= 2469046) AND (d_date_sk#1 <= 2469076)) OR ((d_date_sk#1 >= 2469412) AND (d_date_sk#1 <= 2469442))) OR ((d_date_sk#1 >= 2469777) AND (d_date_sk#1 <= 2469807))))))) OR ((((((((d_date_sk#1 >= 2470142) AND (d_date_sk#1 <= 2470172)) OR ((d_date_sk#1 >= 2470507) AND (d_date_sk#1 <= 2470537))) OR (((d_date_sk#1 >= 2470873) AND (d_date_sk#1 <= 2470903)) OR ((d_date_sk#1 >= 2471238) AND (d_date_sk#1 <= 2471268)))) OR ((((d_date_sk#1 >= 2471603) AND (d_date_sk#1 <= 2471633)) OR ((d_date_sk#1 >= 2471968) AND (d_date_sk#1 <= 2471998))) OR ((d_date_sk#1 >= 2472334) AND (d_date_sk#1 <= 2472364)))) OR (((((d_date_sk#1 >= 2472699) AND (d_date_sk#1 <= 2472729)) OR ((d_date_sk#1 >= 2473064) AND (d_date_sk#1 <= 2473094))) OR ((d_date_sk#1 >= 2473429) AND (d_date_sk#1 <= 2473459))) OR ((((d_date_sk#1 >= 2473795) AND (d_date_sk#1 <= 2473825)) OR ((d_date_sk#1 >= 2474160) AND (d_date_sk#1 <= 2474190))) OR ((d_date_sk#1 >= 2474525) AND (d_date_sk#1 <= 2474555))))) OR ((((((d_date_sk#1 >= 2474890) AND (d_date_sk#1 <= 2474920)) OR ((d_date_sk#1 >= 2475256) AND (d_date_sk#1 <= 2475286))) OR ((d_date_sk#1 >= 2475621) AND (d_date_sk#1 <= 2475651))) OR ((((d_date_sk#1 >= 2475986) AND (d_date_sk#1 <= 2476016)) OR ((d_date_sk#1 >= 2476351) AND (d_date_sk#1 <= 2476381))) OR ((d_date_sk#1 >= 2476717) AND (d_date_sk#1 <= 2476747)))) OR (((((d_date_sk#1 >= 2477082) AND (d_date_sk#1 <= 2477112)) OR ((d_date_sk#1 >= 2477447) AND (d_date_sk#1 <= 2477477))) OR ((d_date_sk#1 >= 2477812) AND (d_date_sk#1 <= 2477842))) OR ((((d_date_sk#1 >= 2478178) AND (d_date_sk#1 <= 2478208)) OR ((d_date_sk#1 >= 2478543) AND (d_date_sk#1 <= 2478573))) OR ((d_date_sk#1 >= 2478908) AND (d_date_sk#1 <= 2478938)))))) OR (((((((d_date_sk#1 >= 2479273) AND (d_date_sk#1 <= 2479303)) OR ((d_date_sk#1 >= 2479639) AND (d_date_sk#1 <= 2479669))) OR (((d_date_sk#1 >= 2480004) AND (d_date_sk#1 <= 2480034)) OR ((d_date_sk#1 >= 2480369) AND (d_date_sk#1 <= 2480399)))) OR ((((d_date_sk#1 >= 2480734) AND (d_date_sk#1 <= 2480764)) OR ((d_date_sk#1 >= 2481100) AND (d_date_sk#1 <= 2481130))) OR ((d_date_sk#1 >= 2481465) AND (d_date_sk#1 <= 2481495)))) OR (((((d_date_sk#1 >= 2481830) AND (d_date_sk#1 <= 2481860)) OR ((d_date_sk#1 >= 2482195) AND (d_date_sk#1 <= 2482225))) OR ((d_date_sk#1 >= 2482561) AND (d_date_sk#1 <= 2482591))) OR ((((d_date_sk#1 >= 2482926) AND (d_date_sk#1 <= 2482956)) OR ((d_date_sk#1 >= 2483291) AND (d_date_sk#1 <= 2483321))) OR ((d_date_sk#1 >= 2483656) AND (d_date_sk#1 <= 2483686))))) OR ((((((d_date_sk#1 >= 2484022) AND (d_date_sk#1 <= 2484052)) OR ((d_date_sk#1 >= 2484387) AND (d_date_sk#1 <= 2484417))) OR ((d_date_sk#1 >= 2484752) AND (d_date_sk#1 <= 2484782))) OR ((((d_date_sk#1 >= 2485117) AND (d_date_sk#1 <= 2485147)) OR ((d_date_sk#1 >= 2485483) AND (d_date_sk#1 <= 2485513))) OR ((d_date_sk#1 >= 2485848) AND (d_date_sk#1 <= 2485878)))) OR (((((d_date_sk#1 >= 2486213) AND (d_date_sk#1 <= 2486243)) OR ((d_date_sk#1 >= 2486578) AND (d_date_sk#1 <= 2486608))) OR ((d_date_sk#1 >= 2486944) AND (d_date_sk#1 <= 2486974))) OR ((((d_date_sk#1 >= 2487309) AND (d_date_sk#1 <= 2487339)) OR ((d_date_sk#1 >= 2487674) AND (d_date_sk#1 <= 2487704))) OR ((d_date_sk#1 >= 2488039) AND (d_date_sk#1 <= 2488069)))))))))) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 3] +Output [2]: [d_date_sk#1, d_year#2] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) Scan parquet default.store_sales +Output [3]: [ss_item_sk#4, ss_net_profit#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [((((((((((ss_sold_date_sk#6 >= 2415355) AND (ss_sold_date_sk#6 <= 2415385)) OR ((ss_sold_date_sk#6 >= 2415720) AND (ss_sold_date_sk#6 <= 2415750))) OR (((ss_sold_date_sk#6 >= 2416085) AND (ss_sold_date_sk#6 <= 2416115)) OR ((ss_sold_date_sk#6 >= 2416450) AND (ss_sold_date_sk#6 <= 2416480)))) OR ((((ss_sold_date_sk#6 >= 2416816) AND (ss_sold_date_sk#6 <= 2416846)) OR ((ss_sold_date_sk#6 >= 2417181) AND (ss_sold_date_sk#6 <= 2417211))) OR ((ss_sold_date_sk#6 >= 2417546) AND (ss_sold_date_sk#6 <= 2417576)))) OR (((((ss_sold_date_sk#6 >= 2417911) AND (ss_sold_date_sk#6 <= 2417941)) OR ((ss_sold_date_sk#6 >= 2418277) AND (ss_sold_date_sk#6 <= 2418307))) OR ((ss_sold_date_sk#6 >= 2418642) AND (ss_sold_date_sk#6 <= 2418672))) OR ((((ss_sold_date_sk#6 >= 2419007) AND (ss_sold_date_sk#6 <= 2419037)) OR ((ss_sold_date_sk#6 >= 2419372) AND (ss_sold_date_sk#6 <= 2419402))) OR ((ss_sold_date_sk#6 >= 2419738) AND (ss_sold_date_sk#6 <= 2419768))))) OR ((((((ss_sold_date_sk#6 >= 2420103) AND (ss_sold_date_sk#6 <= 2420133)) OR ((ss_sold_date_sk#6 >= 2420468) AND (ss_sold_date_sk#6 <= 2420498))) OR ((ss_sold_date_sk#6 >= 2420833) AND (ss_sold_date_sk#6 <= 2420863))) OR ((((ss_sold_date_sk#6 >= 2421199) AND (ss_sold_date_sk#6 <= 2421229)) OR ((ss_sold_date_sk#6 >= 2421564) AND (ss_sold_date_sk#6 <= 2421594))) OR ((ss_sold_date_sk#6 >= 2421929) AND (ss_sold_date_sk#6 <= 2421959)))) OR (((((ss_sold_date_sk#6 >= 2422294) AND (ss_sold_date_sk#6 <= 2422324)) OR ((ss_sold_date_sk#6 >= 2422660) AND (ss_sold_date_sk#6 <= 2422690))) OR ((ss_sold_date_sk#6 >= 2423025) AND (ss_sold_date_sk#6 <= 2423055))) OR ((((ss_sold_date_sk#6 >= 2423390) AND (ss_sold_date_sk#6 <= 2423420)) OR ((ss_sold_date_sk#6 >= 2423755) AND (ss_sold_date_sk#6 <= 2423785))) OR ((ss_sold_date_sk#6 >= 2424121) AND (ss_sold_date_sk#6 <= 2424151)))))) OR (((((((ss_sold_date_sk#6 >= 2424486) AND (ss_sold_date_sk#6 <= 2424516)) OR ((ss_sold_date_sk#6 >= 2424851) AND (ss_sold_date_sk#6 <= 2424881))) OR (((ss_sold_date_sk#6 >= 2425216) AND (ss_sold_date_sk#6 <= 2425246)) OR ((ss_sold_date_sk#6 >= 2425582) AND (ss_sold_date_sk#6 <= 2425612)))) OR ((((ss_sold_date_sk#6 >= 2425947) AND (ss_sold_date_sk#6 <= 2425977)) OR ((ss_sold_date_sk#6 >= 2426312) AND (ss_sold_date_sk#6 <= 2426342))) OR ((ss_sold_date_sk#6 >= 2426677) AND (ss_sold_date_sk#6 <= 2426707)))) OR (((((ss_sold_date_sk#6 >= 2427043) AND (ss_sold_date_sk#6 <= 2427073)) OR ((ss_sold_date_sk#6 >= 2427408) AND (ss_sold_date_sk#6 <= 2427438))) OR ((ss_sold_date_sk#6 >= 2427773) AND (ss_sold_date_sk#6 <= 2427803))) OR ((((ss_sold_date_sk#6 >= 2428138) AND (ss_sold_date_sk#6 <= 2428168)) OR ((ss_sold_date_sk#6 >= 2428504) AND (ss_sold_date_sk#6 <= 2428534))) OR ((ss_sold_date_sk#6 >= 2428869) AND (ss_sold_date_sk#6 <= 2428899))))) OR ((((((ss_sold_date_sk#6 >= 2429234) AND (ss_sold_date_sk#6 <= 2429264)) OR ((ss_sold_date_sk#6 >= 2429599) AND (ss_sold_date_sk#6 <= 2429629))) OR ((ss_sold_date_sk#6 >= 2429965) AND (ss_sold_date_sk#6 <= 2429995))) OR ((((ss_sold_date_sk#6 >= 2430330) AND (ss_sold_date_sk#6 <= 2430360)) OR ((ss_sold_date_sk#6 >= 2430695) AND (ss_sold_date_sk#6 <= 2430725))) OR ((ss_sold_date_sk#6 >= 2431060) AND (ss_sold_date_sk#6 <= 2431090)))) OR (((((ss_sold_date_sk#6 >= 2431426) AND (ss_sold_date_sk#6 <= 2431456)) OR ((ss_sold_date_sk#6 >= 2431791) AND (ss_sold_date_sk#6 <= 2431821))) OR ((ss_sold_date_sk#6 >= 2432156) AND (ss_sold_date_sk#6 <= 2432186))) OR ((((ss_sold_date_sk#6 >= 2432521) AND (ss_sold_date_sk#6 <= 2432551)) OR ((ss_sold_date_sk#6 >= 2432887) AND (ss_sold_date_sk#6 <= 2432917))) OR ((ss_sold_date_sk#6 >= 2433252) AND (ss_sold_date_sk#6 <= 2433282))))))) OR ((((((((ss_sold_date_sk#6 >= 2433617) AND (ss_sold_date_sk#6 <= 2433647)) OR ((ss_sold_date_sk#6 >= 2433982) AND (ss_sold_date_sk#6 <= 2434012))) OR (((ss_sold_date_sk#6 >= 2434348) AND (ss_sold_date_sk#6 <= 2434378)) OR ((ss_sold_date_sk#6 >= 2434713) AND (ss_sold_date_sk#6 <= 2434743)))) OR ((((ss_sold_date_sk#6 >= 2435078) AND (ss_sold_date_sk#6 <= 2435108)) OR ((ss_sold_date_sk#6 >= 2435443) AND (ss_sold_date_sk#6 <= 2435473))) OR ((ss_sold_date_sk#6 >= 2435809) AND (ss_sold_date_sk#6 <= 2435839)))) OR (((((ss_sold_date_sk#6 >= 2436174) AND (ss_sold_date_sk#6 <= 2436204)) OR ((ss_sold_date_sk#6 >= 2436539) AND (ss_sold_date_sk#6 <= 2436569))) OR ((ss_sold_date_sk#6 >= 2436904) AND (ss_sold_date_sk#6 <= 2436934))) OR ((((ss_sold_date_sk#6 >= 2437270) AND (ss_sold_date_sk#6 <= 2437300)) OR ((ss_sold_date_sk#6 >= 2437635) AND (ss_sold_date_sk#6 <= 2437665))) OR ((ss_sold_date_sk#6 >= 2438000) AND (ss_sold_date_sk#6 <= 2438030))))) OR ((((((ss_sold_date_sk#6 >= 2438365) AND (ss_sold_date_sk#6 <= 2438395)) OR ((ss_sold_date_sk#6 >= 2438731) AND (ss_sold_date_sk#6 <= 2438761))) OR ((ss_sold_date_sk#6 >= 2439096) AND (ss_sold_date_sk#6 <= 2439126))) OR ((((ss_sold_date_sk#6 >= 2439461) AND (ss_sold_date_sk#6 <= 2439491)) OR ((ss_sold_date_sk#6 >= 2439826) AND (ss_sold_date_sk#6 <= 2439856))) OR ((ss_sold_date_sk#6 >= 2440192) AND (ss_sold_date_sk#6 <= 2440222)))) OR (((((ss_sold_date_sk#6 >= 2440557) AND (ss_sold_date_sk#6 <= 2440587)) OR ((ss_sold_date_sk#6 >= 2440922) AND (ss_sold_date_sk#6 <= 2440952))) OR ((ss_sold_date_sk#6 >= 2441287) AND (ss_sold_date_sk#6 <= 2441317))) OR ((((ss_sold_date_sk#6 >= 2441653) AND (ss_sold_date_sk#6 <= 2441683)) OR ((ss_sold_date_sk#6 >= 2442018) AND (ss_sold_date_sk#6 <= 2442048))) OR ((ss_sold_date_sk#6 >= 2442383) AND (ss_sold_date_sk#6 <= 2442413)))))) OR (((((((ss_sold_date_sk#6 >= 2442748) AND (ss_sold_date_sk#6 <= 2442778)) OR ((ss_sold_date_sk#6 >= 2443114) AND (ss_sold_date_sk#6 <= 2443144))) OR (((ss_sold_date_sk#6 >= 2443479) AND (ss_sold_date_sk#6 <= 2443509)) OR ((ss_sold_date_sk#6 >= 2443844) AND (ss_sold_date_sk#6 <= 2443874)))) OR ((((ss_sold_date_sk#6 >= 2444209) AND (ss_sold_date_sk#6 <= 2444239)) OR ((ss_sold_date_sk#6 >= 2444575) AND (ss_sold_date_sk#6 <= 2444605))) OR ((ss_sold_date_sk#6 >= 2444940) AND (ss_sold_date_sk#6 <= 2444970)))) OR (((((ss_sold_date_sk#6 >= 2445305) AND (ss_sold_date_sk#6 <= 2445335)) OR ((ss_sold_date_sk#6 >= 2445670) AND (ss_sold_date_sk#6 <= 2445700))) OR ((ss_sold_date_sk#6 >= 2446036) AND (ss_sold_date_sk#6 <= 2446066))) OR ((((ss_sold_date_sk#6 >= 2446401) AND (ss_sold_date_sk#6 <= 2446431)) OR ((ss_sold_date_sk#6 >= 2446766) AND (ss_sold_date_sk#6 <= 2446796))) OR ((ss_sold_date_sk#6 >= 2447131) AND (ss_sold_date_sk#6 <= 2447161))))) OR ((((((ss_sold_date_sk#6 >= 2447497) AND (ss_sold_date_sk#6 <= 2447527)) OR ((ss_sold_date_sk#6 >= 2447862) AND (ss_sold_date_sk#6 <= 2447892))) OR ((ss_sold_date_sk#6 >= 2448227) AND (ss_sold_date_sk#6 <= 2448257))) OR ((((ss_sold_date_sk#6 >= 2448592) AND (ss_sold_date_sk#6 <= 2448622)) OR ((ss_sold_date_sk#6 >= 2448958) AND (ss_sold_date_sk#6 <= 2448988))) OR ((ss_sold_date_sk#6 >= 2449323) AND (ss_sold_date_sk#6 <= 2449353)))) OR (((((ss_sold_date_sk#6 >= 2449688) AND (ss_sold_date_sk#6 <= 2449718)) OR ((ss_sold_date_sk#6 >= 2450053) AND (ss_sold_date_sk#6 <= 2450083))) OR ((ss_sold_date_sk#6 >= 2450419) AND (ss_sold_date_sk#6 <= 2450449))) OR ((((ss_sold_date_sk#6 >= 2450784) AND (ss_sold_date_sk#6 <= 2450814)) OR ((ss_sold_date_sk#6 >= 2451149) AND (ss_sold_date_sk#6 <= 2451179))) OR ((ss_sold_date_sk#6 >= 2451514) AND (ss_sold_date_sk#6 <= 2451544)))))))) OR (((((((((ss_sold_date_sk#6 >= 2451880) AND (ss_sold_date_sk#6 <= 2451910)) OR ((ss_sold_date_sk#6 >= 2452245) AND (ss_sold_date_sk#6 <= 2452275))) OR (((ss_sold_date_sk#6 >= 2452610) AND (ss_sold_date_sk#6 <= 2452640)) OR ((ss_sold_date_sk#6 >= 2452975) AND (ss_sold_date_sk#6 <= 2453005)))) OR ((((ss_sold_date_sk#6 >= 2453341) AND (ss_sold_date_sk#6 <= 2453371)) OR ((ss_sold_date_sk#6 >= 2453706) AND (ss_sold_date_sk#6 <= 2453736))) OR ((ss_sold_date_sk#6 >= 2454071) AND (ss_sold_date_sk#6 <= 2454101)))) OR (((((ss_sold_date_sk#6 >= 2454436) AND (ss_sold_date_sk#6 <= 2454466)) OR ((ss_sold_date_sk#6 >= 2454802) AND (ss_sold_date_sk#6 <= 2454832))) OR ((ss_sold_date_sk#6 >= 2455167) AND (ss_sold_date_sk#6 <= 2455197))) OR ((((ss_sold_date_sk#6 >= 2455532) AND (ss_sold_date_sk#6 <= 2455562)) OR ((ss_sold_date_sk#6 >= 2455897) AND (ss_sold_date_sk#6 <= 2455927))) OR ((ss_sold_date_sk#6 >= 2456263) AND (ss_sold_date_sk#6 <= 2456293))))) OR ((((((ss_sold_date_sk#6 >= 2456628) AND (ss_sold_date_sk#6 <= 2456658)) OR ((ss_sold_date_sk#6 >= 2456993) AND (ss_sold_date_sk#6 <= 2457023))) OR ((ss_sold_date_sk#6 >= 2457358) AND (ss_sold_date_sk#6 <= 2457388))) OR ((((ss_sold_date_sk#6 >= 2457724) AND (ss_sold_date_sk#6 <= 2457754)) OR ((ss_sold_date_sk#6 >= 2458089) AND (ss_sold_date_sk#6 <= 2458119))) OR ((ss_sold_date_sk#6 >= 2458454) AND (ss_sold_date_sk#6 <= 2458484)))) OR (((((ss_sold_date_sk#6 >= 2458819) AND (ss_sold_date_sk#6 <= 2458849)) OR ((ss_sold_date_sk#6 >= 2459185) AND (ss_sold_date_sk#6 <= 2459215))) OR ((ss_sold_date_sk#6 >= 2459550) AND (ss_sold_date_sk#6 <= 2459580))) OR ((((ss_sold_date_sk#6 >= 2459915) AND (ss_sold_date_sk#6 <= 2459945)) OR ((ss_sold_date_sk#6 >= 2460280) AND (ss_sold_date_sk#6 <= 2460310))) OR ((ss_sold_date_sk#6 >= 2460646) AND (ss_sold_date_sk#6 <= 2460676)))))) OR (((((((ss_sold_date_sk#6 >= 2461011) AND (ss_sold_date_sk#6 <= 2461041)) OR ((ss_sold_date_sk#6 >= 2461376) AND (ss_sold_date_sk#6 <= 2461406))) OR (((ss_sold_date_sk#6 >= 2461741) AND (ss_sold_date_sk#6 <= 2461771)) OR ((ss_sold_date_sk#6 >= 2462107) AND (ss_sold_date_sk#6 <= 2462137)))) OR ((((ss_sold_date_sk#6 >= 2462472) AND (ss_sold_date_sk#6 <= 2462502)) OR ((ss_sold_date_sk#6 >= 2462837) AND (ss_sold_date_sk#6 <= 2462867))) OR ((ss_sold_date_sk#6 >= 2463202) AND (ss_sold_date_sk#6 <= 2463232)))) OR (((((ss_sold_date_sk#6 >= 2463568) AND (ss_sold_date_sk#6 <= 2463598)) OR ((ss_sold_date_sk#6 >= 2463933) AND (ss_sold_date_sk#6 <= 2463963))) OR ((ss_sold_date_sk#6 >= 2464298) AND (ss_sold_date_sk#6 <= 2464328))) OR ((((ss_sold_date_sk#6 >= 2464663) AND (ss_sold_date_sk#6 <= 2464693)) OR ((ss_sold_date_sk#6 >= 2465029) AND (ss_sold_date_sk#6 <= 2465059))) OR ((ss_sold_date_sk#6 >= 2465394) AND (ss_sold_date_sk#6 <= 2465424))))) OR ((((((ss_sold_date_sk#6 >= 2465759) AND (ss_sold_date_sk#6 <= 2465789)) OR ((ss_sold_date_sk#6 >= 2466124) AND (ss_sold_date_sk#6 <= 2466154))) OR ((ss_sold_date_sk#6 >= 2466490) AND (ss_sold_date_sk#6 <= 2466520))) OR ((((ss_sold_date_sk#6 >= 2466855) AND (ss_sold_date_sk#6 <= 2466885)) OR ((ss_sold_date_sk#6 >= 2467220) AND (ss_sold_date_sk#6 <= 2467250))) OR ((ss_sold_date_sk#6 >= 2467585) AND (ss_sold_date_sk#6 <= 2467615)))) OR (((((ss_sold_date_sk#6 >= 2467951) AND (ss_sold_date_sk#6 <= 2467981)) OR ((ss_sold_date_sk#6 >= 2468316) AND (ss_sold_date_sk#6 <= 2468346))) OR ((ss_sold_date_sk#6 >= 2468681) AND (ss_sold_date_sk#6 <= 2468711))) OR ((((ss_sold_date_sk#6 >= 2469046) AND (ss_sold_date_sk#6 <= 2469076)) OR ((ss_sold_date_sk#6 >= 2469412) AND (ss_sold_date_sk#6 <= 2469442))) OR ((ss_sold_date_sk#6 >= 2469777) AND (ss_sold_date_sk#6 <= 2469807))))))) OR ((((((((ss_sold_date_sk#6 >= 2470142) AND (ss_sold_date_sk#6 <= 2470172)) OR ((ss_sold_date_sk#6 >= 2470507) AND (ss_sold_date_sk#6 <= 2470537))) OR (((ss_sold_date_sk#6 >= 2470873) AND (ss_sold_date_sk#6 <= 2470903)) OR ((ss_sold_date_sk#6 >= 2471238) AND (ss_sold_date_sk#6 <= 2471268)))) OR ((((ss_sold_date_sk#6 >= 2471603) AND (ss_sold_date_sk#6 <= 2471633)) OR ((ss_sold_date_sk#6 >= 2471968) AND (ss_sold_date_sk#6 <= 2471998))) OR ((ss_sold_date_sk#6 >= 2472334) AND (ss_sold_date_sk#6 <= 2472364)))) OR (((((ss_sold_date_sk#6 >= 2472699) AND (ss_sold_date_sk#6 <= 2472729)) OR ((ss_sold_date_sk#6 >= 2473064) AND (ss_sold_date_sk#6 <= 2473094))) OR ((ss_sold_date_sk#6 >= 2473429) AND (ss_sold_date_sk#6 <= 2473459))) OR ((((ss_sold_date_sk#6 >= 2473795) AND (ss_sold_date_sk#6 <= 2473825)) OR ((ss_sold_date_sk#6 >= 2474160) AND (ss_sold_date_sk#6 <= 2474190))) OR ((ss_sold_date_sk#6 >= 2474525) AND (ss_sold_date_sk#6 <= 2474555))))) OR ((((((ss_sold_date_sk#6 >= 2474890) AND (ss_sold_date_sk#6 <= 2474920)) OR ((ss_sold_date_sk#6 >= 2475256) AND (ss_sold_date_sk#6 <= 2475286))) OR ((ss_sold_date_sk#6 >= 2475621) AND (ss_sold_date_sk#6 <= 2475651))) OR ((((ss_sold_date_sk#6 >= 2475986) AND (ss_sold_date_sk#6 <= 2476016)) OR ((ss_sold_date_sk#6 >= 2476351) AND (ss_sold_date_sk#6 <= 2476381))) OR ((ss_sold_date_sk#6 >= 2476717) AND (ss_sold_date_sk#6 <= 2476747)))) OR (((((ss_sold_date_sk#6 >= 2477082) AND (ss_sold_date_sk#6 <= 2477112)) OR ((ss_sold_date_sk#6 >= 2477447) AND (ss_sold_date_sk#6 <= 2477477))) OR ((ss_sold_date_sk#6 >= 2477812) AND (ss_sold_date_sk#6 <= 2477842))) OR ((((ss_sold_date_sk#6 >= 2478178) AND (ss_sold_date_sk#6 <= 2478208)) OR ((ss_sold_date_sk#6 >= 2478543) AND (ss_sold_date_sk#6 <= 2478573))) OR ((ss_sold_date_sk#6 >= 2478908) AND (ss_sold_date_sk#6 <= 2478938)))))) OR (((((((ss_sold_date_sk#6 >= 2479273) AND (ss_sold_date_sk#6 <= 2479303)) OR ((ss_sold_date_sk#6 >= 2479639) AND (ss_sold_date_sk#6 <= 2479669))) OR (((ss_sold_date_sk#6 >= 2480004) AND (ss_sold_date_sk#6 <= 2480034)) OR ((ss_sold_date_sk#6 >= 2480369) AND (ss_sold_date_sk#6 <= 2480399)))) OR ((((ss_sold_date_sk#6 >= 2480734) AND (ss_sold_date_sk#6 <= 2480764)) OR ((ss_sold_date_sk#6 >= 2481100) AND (ss_sold_date_sk#6 <= 2481130))) OR ((ss_sold_date_sk#6 >= 2481465) AND (ss_sold_date_sk#6 <= 2481495)))) OR (((((ss_sold_date_sk#6 >= 2481830) AND (ss_sold_date_sk#6 <= 2481860)) OR ((ss_sold_date_sk#6 >= 2482195) AND (ss_sold_date_sk#6 <= 2482225))) OR ((ss_sold_date_sk#6 >= 2482561) AND (ss_sold_date_sk#6 <= 2482591))) OR ((((ss_sold_date_sk#6 >= 2482926) AND (ss_sold_date_sk#6 <= 2482956)) OR ((ss_sold_date_sk#6 >= 2483291) AND (ss_sold_date_sk#6 <= 2483321))) OR ((ss_sold_date_sk#6 >= 2483656) AND (ss_sold_date_sk#6 <= 2483686))))) OR ((((((ss_sold_date_sk#6 >= 2484022) AND (ss_sold_date_sk#6 <= 2484052)) OR ((ss_sold_date_sk#6 >= 2484387) AND (ss_sold_date_sk#6 <= 2484417))) OR ((ss_sold_date_sk#6 >= 2484752) AND (ss_sold_date_sk#6 <= 2484782))) OR ((((ss_sold_date_sk#6 >= 2485117) AND (ss_sold_date_sk#6 <= 2485147)) OR ((ss_sold_date_sk#6 >= 2485483) AND (ss_sold_date_sk#6 <= 2485513))) OR ((ss_sold_date_sk#6 >= 2485848) AND (ss_sold_date_sk#6 <= 2485878)))) OR (((((ss_sold_date_sk#6 >= 2486213) AND (ss_sold_date_sk#6 <= 2486243)) OR ((ss_sold_date_sk#6 >= 2486578) AND (ss_sold_date_sk#6 <= 2486608))) OR ((ss_sold_date_sk#6 >= 2486944) AND (ss_sold_date_sk#6 <= 2486974))) OR ((((ss_sold_date_sk#6 >= 2487309) AND (ss_sold_date_sk#6 <= 2487339)) OR ((ss_sold_date_sk#6 >= 2487674) AND (ss_sold_date_sk#6 <= 2487704))) OR ((ss_sold_date_sk#6 >= 2488039) AND (ss_sold_date_sk#6 <= 2488069))))))))), isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_net_profit#5, ss_sold_date_sk#6] + +(7) Filter [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_net_profit#5, ss_sold_date_sk#6] +Condition : isnotnull(ss_item_sk#4) + +(8) BroadcastExchange +Input [3]: [ss_item_sk#4, ss_net_profit#5, ss_sold_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [d_year#2, ss_item_sk#4, ss_net_profit#5] +Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#4, ss_net_profit#5, ss_sold_date_sk#6] + +(11) Scan parquet default.item +Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manufact_id#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,436), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manufact_id#11] + +(13) Filter [codegen id : 2] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manufact_id#11] +Condition : ((isnotnull(i_manufact_id#11) AND (i_manufact_id#11 = 436)) AND isnotnull(i_item_sk#8)) + +(14) Project [codegen id : 2] +Output [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manufact_id#11] + +(15) BroadcastExchange +Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#4] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_year#2, ss_net_profit#5, i_brand_id#9, i_brand#10] +Input [6]: [d_year#2, ss_item_sk#4, ss_net_profit#5, i_item_sk#8, i_brand_id#9, i_brand#10] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_year#2, ss_net_profit#5, i_brand_id#9, i_brand#10] +Keys [3]: [d_year#2, i_brand#10, i_brand_id#9] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#5))] +Aggregate Attributes [1]: [sum#13] +Results [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] + +(19) Exchange +Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] +Arguments: hashpartitioning(d_year#2, i_brand#10, i_brand_id#9, 5), ENSURE_REQUIREMENTS, [id=#15] + +(20) HashAggregate [codegen id : 4] +Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] +Keys [3]: [d_year#2, i_brand#10, i_brand_id#9] +Functions [1]: [sum(UnscaledValue(ss_net_profit#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#5))#16] +Results [4]: [d_year#2, i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#16,17,2) AS sum_agg#19] + +(21) TakeOrderedAndProject +Input [4]: [d_year#2, brand_id#17, brand#18, sum_agg#19] +Arguments: 100, [d_year#2 ASC NULLS FIRST, sum_agg#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [d_year#2, brand_id#17, brand#18, sum_agg#19] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3/simplified.txt new file mode 100644 index 0000000000000..ef31be37f934e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q3/simplified.txt @@ -0,0 +1,31 @@ +TakeOrderedAndProject [d_year,sum_agg,brand_id,brand] + WholeStageCodegen (4) + HashAggregate [d_year,i_brand,i_brand_id,sum] [sum(UnscaledValue(ss_net_profit)),brand_id,brand,sum_agg,sum] + InputAdapter + Exchange [d_year,i_brand,i_brand_id] #1 + WholeStageCodegen (3) + HashAggregate [d_year,i_brand,i_brand_id,ss_net_profit] [sum,sum] + Project [d_year,ss_net_profit,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [d_year,ss_item_sk,ss_net_profit] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [d_date_sk,d_year] + Filter [d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_net_profit,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt new file mode 100644 index 0000000000000..ebc6009080bfa --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/explain.txt @@ -0,0 +1,229 @@ +== Physical Plan == +* Sort (39) ++- Exchange (38) + +- * Project (37) + +- * SortMergeJoin Inner (36) + :- * Sort (30) + : +- Exchange (29) + : +- * Filter (28) + : +- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.household_demographics (18) + +- * Sort (35) + +- Exchange (34) + +- * Filter (33) + +- * ColumnarToRow (32) + +- Scan parquet default.customer (31) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), (ss_sold_date_sk#5 >= 2450816), (ss_sold_date_sk#5 <= 2451910), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Condition : ((isnotnull(ss_store_sk#3) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_dom#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450816), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] +Condition : (((((((d_dom#9 >= 1) AND (d_dom#9 <= 3)) OR ((d_dom#9 >= 25) AND (d_dom#9 <= 28))) AND d_year#8 IN (1998,1999,2000)) AND (d_date_sk#7 >= 2450816)) AND (d_date_sk#7 <= 2451910)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4] +Input [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#11, s_county#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_county, [Saginaw County,Sumner County,Appanoose County,Daviess County,Fairfield County,Raleigh County,Ziebach County,Williamson County]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] +Condition : (s_county#12 IN (Saginaw County,Sumner County,Appanoose County,Daviess County,Fairfield County,Raleigh County,Ziebach County,Williamson County) AND isnotnull(s_store_sk#11)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#11] +Input [2]: [s_store_sk#11, s_county#12] + +(15) BroadcastExchange +Input [1]: [s_store_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#11] +Join condition: None + +(17) Project [codegen id : 4] +Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#11] + +(18) Scan parquet default.household_demographics +Output [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000 ),EqualTo(hd_buy_potential,Unknown )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(20) Filter [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Condition : (((((isnotnull(hd_vehicle_count#17) AND isnotnull(hd_dep_count#16)) AND ((hd_buy_potential#15 = >10000 ) OR (hd_buy_potential#15 = Unknown ))) AND (hd_vehicle_count#17 > 0)) AND ((cast(hd_dep_count#16 as double) / cast(hd_vehicle_count#17 as double)) > 1.2)) AND isnotnull(hd_demo_sk#14)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#14] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#14] +Join condition: None + +(24) Project [codegen id : 4] +Output [2]: [ss_customer_sk#1, ss_ticket_number#4] +Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#14] + +(25) HashAggregate [codegen id : 4] +Input [2]: [ss_customer_sk#1, ss_ticket_number#4] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#19] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] + +(26) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) HashAggregate [codegen id : 5] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#22] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#22 AS cnt#23] + +(28) Filter [codegen id : 5] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Condition : ((cnt#23 >= 15) AND (cnt#23 <= 20)) + +(29) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#24] + +(30) Sort [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(31) Scan parquet default.customer +Output [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 7] +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] + +(33) Filter [codegen id : 7] +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Condition : isnotnull(c_customer_sk#25) + +(34) Exchange +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Arguments: hashpartitioning(c_customer_sk#25, 5), ENSURE_REQUIREMENTS, [id=#30] + +(35) Sort [codegen id : 8] +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Arguments: [c_customer_sk#25 ASC NULLS FIRST], false, 0 + +(36) SortMergeJoin [codegen id : 9] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#25] +Join condition: None + +(37) Project [codegen id : 9] +Output [6]: [c_last_name#28, c_first_name#27, c_salutation#26, c_preferred_cust_flag#29, ss_ticket_number#4, cnt#23] +Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23, c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] + +(38) Exchange +Input [6]: [c_last_name#28, c_first_name#27, c_salutation#26, c_preferred_cust_flag#29, ss_ticket_number#4, cnt#23] +Arguments: rangepartitioning(c_last_name#28 ASC NULLS FIRST, c_first_name#27 ASC NULLS FIRST, c_salutation#26 ASC NULLS FIRST, c_preferred_cust_flag#29 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#31] + +(39) Sort [codegen id : 10] +Input [6]: [c_last_name#28, c_first_name#27, c_salutation#26, c_preferred_cust_flag#29, ss_ticket_number#4, cnt#23] +Arguments: [c_last_name#28 ASC NULLS FIRST, c_first_name#27 ASC NULLS FIRST, c_salutation#26 ASC NULLS FIRST, c_preferred_cust_flag#29 DESC NULLS LAST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (40) + + +(40) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/simplified.txt new file mode 100644 index 0000000000000..24c5c1c256c26 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34.sf100/simplified.txt @@ -0,0 +1,65 @@ +WholeStageCodegen (10) + Sort [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag] + InputAdapter + Exchange [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag] #1 + WholeStageCodegen (9) + Project [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number,cnt] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #2 + WholeStageCodegen (5) + Filter [cnt] + HashAggregate [ss_ticket_number,ss_customer_sk,count] [count(1),cnt,count] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk] #3 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk] [count,count] + Project [ss_customer_sk,ss_ticket_number] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_county,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_vehicle_count,hd_dep_count,hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential,hd_dep_count,hd_vehicle_count] + InputAdapter + WholeStageCodegen (8) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #7 + WholeStageCodegen (7) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34/explain.txt new file mode 100644 index 0000000000000..cd556c0bccb46 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34/explain.txt @@ -0,0 +1,214 @@ +== Physical Plan == +* Sort (36) ++- Exchange (35) + +- * Project (34) + +- * BroadcastHashJoin Inner BuildRight (33) + :- * Filter (28) + : +- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.household_demographics (18) + +- BroadcastExchange (32) + +- * Filter (31) + +- * ColumnarToRow (30) + +- Scan parquet default.customer (29) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), (ss_sold_date_sk#5 >= 2450816), (ss_sold_date_sk#5 <= 2451910), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Condition : ((isnotnull(ss_store_sk#3) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_dom#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450816), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] +Condition : (((((((d_dom#9 >= 1) AND (d_dom#9 <= 3)) OR ((d_dom#9 >= 25) AND (d_dom#9 <= 28))) AND d_year#8 IN (1998,1999,2000)) AND (d_date_sk#7 >= 2450816)) AND (d_date_sk#7 <= 2451910)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4] +Input [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#11, s_county#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_county, [Saginaw County,Sumner County,Appanoose County,Daviess County,Fairfield County,Raleigh County,Ziebach County,Williamson County]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] +Condition : (s_county#12 IN (Saginaw County,Sumner County,Appanoose County,Daviess County,Fairfield County,Raleigh County,Ziebach County,Williamson County) AND isnotnull(s_store_sk#11)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#11] +Input [2]: [s_store_sk#11, s_county#12] + +(15) BroadcastExchange +Input [1]: [s_store_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#11] +Join condition: None + +(17) Project [codegen id : 4] +Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#11] + +(18) Scan parquet default.household_demographics +Output [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000 ),EqualTo(hd_buy_potential,Unknown )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(20) Filter [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Condition : (((((isnotnull(hd_vehicle_count#17) AND isnotnull(hd_dep_count#16)) AND ((hd_buy_potential#15 = >10000 ) OR (hd_buy_potential#15 = Unknown ))) AND (hd_vehicle_count#17 > 0)) AND ((cast(hd_dep_count#16 as double) / cast(hd_vehicle_count#17 as double)) > 1.2)) AND isnotnull(hd_demo_sk#14)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#14] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#14] +Join condition: None + +(24) Project [codegen id : 4] +Output [2]: [ss_customer_sk#1, ss_ticket_number#4] +Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#14] + +(25) HashAggregate [codegen id : 4] +Input [2]: [ss_customer_sk#1, ss_ticket_number#4] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#19] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] + +(26) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) HashAggregate [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#22] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#22 AS cnt#23] + +(28) Filter [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Condition : ((cnt#23 >= 15) AND (cnt#23 <= 20)) + +(29) Scan parquet default.customer +Output [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] + +(31) Filter [codegen id : 5] +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Condition : isnotnull(c_customer_sk#24) + +(32) BroadcastExchange +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#24] +Join condition: None + +(34) Project [codegen id : 6] +Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] + +(35) Exchange +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Arguments: rangepartitioning(c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#30] + +(36) Sort [codegen id : 7] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Arguments: [c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (37) + + +(37) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34/simplified.txt new file mode 100644 index 0000000000000..e4f89ab27658b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q34/simplified.txt @@ -0,0 +1,56 @@ +WholeStageCodegen (7) + Sort [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag] + InputAdapter + Exchange [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag] #1 + WholeStageCodegen (6) + Project [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number,cnt] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Filter [cnt] + HashAggregate [ss_ticket_number,ss_customer_sk,count] [count(1),cnt,count] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk] #2 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk] [count,count] + Project [ss_customer_sk,ss_ticket_number] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_county,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_vehicle_count,hd_dep_count,hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt new file mode 100644 index 0000000000000..5e83e995a3766 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/explain.txt @@ -0,0 +1,133 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,12), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2451149), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 12)) AND (d_year#2 = 1998)) AND (d_date_sk#1 >= 2451149)) AND (d_date_sk#1 <= 2451179)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [d_date_sk#1, d_year#2] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) BroadcastExchange +Input [2]: [d_date_sk#1, d_year#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), (ss_sold_date_sk#7 >= 2451149), (ss_sold_date_sk#7 <= 2451179), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7] + +(8) Filter +Input [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7] +Condition : isnotnull(ss_item_sk#5) + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#7] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [d_year#2, ss_item_sk#5, ss_ext_sales_price#6] +Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7] + +(11) Scan parquet default.item +Output [4]: [i_item_sk#9, i_category_id#10, i_category#11, i_manager_id#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [i_item_sk#9, i_category_id#10, i_category#11, i_manager_id#12] + +(13) Filter [codegen id : 2] +Input [4]: [i_item_sk#9, i_category_id#10, i_category#11, i_manager_id#12] +Condition : ((isnotnull(i_manager_id#12) AND (i_manager_id#12 = 1)) AND isnotnull(i_item_sk#9)) + +(14) Project [codegen id : 2] +Output [3]: [i_item_sk#9, i_category_id#10, i_category#11] +Input [4]: [i_item_sk#9, i_category_id#10, i_category#11, i_manager_id#12] + +(15) BroadcastExchange +Input [3]: [i_item_sk#9, i_category_id#10, i_category#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#5] +Right keys [1]: [i_item_sk#9] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_year#2, ss_ext_sales_price#6, i_category_id#10, i_category#11] +Input [6]: [d_year#2, ss_item_sk#5, ss_ext_sales_price#6, i_item_sk#9, i_category_id#10, i_category#11] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_year#2, ss_ext_sales_price#6, i_category_id#10, i_category#11] +Keys [3]: [d_year#2, i_category_id#10, i_category#11] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#6))] +Aggregate Attributes [1]: [sum#14] +Results [4]: [d_year#2, i_category_id#10, i_category#11, sum#15] + +(19) Exchange +Input [4]: [d_year#2, i_category_id#10, i_category#11, sum#15] +Arguments: hashpartitioning(d_year#2, i_category_id#10, i_category#11, 5), ENSURE_REQUIREMENTS, [id=#16] + +(20) HashAggregate [codegen id : 4] +Input [4]: [d_year#2, i_category_id#10, i_category#11, sum#15] +Keys [3]: [d_year#2, i_category_id#10, i_category#11] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#6))#17] +Results [4]: [d_year#2, i_category_id#10, i_category#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#17,17,2) AS sum(ss_ext_sales_price)#18] + +(21) TakeOrderedAndProject +Input [4]: [d_year#2, i_category_id#10, i_category#11, sum(ss_ext_sales_price)#18] +Arguments: 100, [sum(ss_ext_sales_price)#18 DESC NULLS LAST, d_year#2 ASC NULLS FIRST, i_category_id#10 ASC NULLS FIRST, i_category#11 ASC NULLS FIRST], [d_year#2, i_category_id#10, i_category#11, sum(ss_ext_sales_price)#18] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (22) + + +(22) ReusedExchange [Reuses operator id: 5] +Output [2]: [d_date_sk#1, d_year#2] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/simplified.txt new file mode 100644 index 0000000000000..7e5c7eb6f59c9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42.sf100/simplified.txt @@ -0,0 +1,33 @@ +TakeOrderedAndProject [sum(ss_ext_sales_price),d_year,i_category_id,i_category] + WholeStageCodegen (4) + HashAggregate [d_year,i_category_id,i_category,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(ss_ext_sales_price),sum] + InputAdapter + Exchange [d_year,i_category_id,i_category] #1 + WholeStageCodegen (3) + HashAggregate [d_year,i_category_id,i_category,ss_ext_sales_price] [sum,sum] + Project [d_year,ss_ext_sales_price,i_category_id,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [d_year,ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk,d_year] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_category_id,i_category] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_category_id,i_category,i_manager_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42/explain.txt new file mode 100644 index 0000000000000..255f39414f908 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42/explain.txt @@ -0,0 +1,123 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- BroadcastExchange (8) + : +- * Filter (7) + : +- * ColumnarToRow (6) + : +- Scan parquet default.store_sales (5) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,12), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2451149), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 12)) AND (d_year#2 = 1998)) AND (d_date_sk#1 >= 2451149)) AND (d_date_sk#1 <= 2451179)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 3] +Output [2]: [d_date_sk#1, d_year#2] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) Scan parquet default.store_sales +Output [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), (ss_sold_date_sk#6 >= 2451149), (ss_sold_date_sk#6 <= 2451179), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(7) Filter [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Condition : isnotnull(ss_item_sk#4) + +(8) BroadcastExchange +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5] +Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(11) Scan parquet default.item +Output [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11] + +(13) Filter [codegen id : 2] +Input [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11] +Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 1)) AND isnotnull(i_item_sk#8)) + +(14) Project [codegen id : 2] +Output [3]: [i_item_sk#8, i_category_id#9, i_category#10] +Input [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11] + +(15) BroadcastExchange +Input [3]: [i_item_sk#8, i_category_id#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#4] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_year#2, ss_ext_sales_price#5, i_category_id#9, i_category#10] +Input [6]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_category_id#9, i_category#10] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_year#2, ss_ext_sales_price#5, i_category_id#9, i_category#10] +Keys [3]: [d_year#2, i_category_id#9, i_category#10] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum#13] +Results [4]: [d_year#2, i_category_id#9, i_category#10, sum#14] + +(19) Exchange +Input [4]: [d_year#2, i_category_id#9, i_category#10, sum#14] +Arguments: hashpartitioning(d_year#2, i_category_id#9, i_category#10, 5), ENSURE_REQUIREMENTS, [id=#15] + +(20) HashAggregate [codegen id : 4] +Input [4]: [d_year#2, i_category_id#9, i_category#10, sum#14] +Keys [3]: [d_year#2, i_category_id#9, i_category#10] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#16] +Results [4]: [d_year#2, i_category_id#9, i_category#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#16,17,2) AS sum(ss_ext_sales_price)#17] + +(21) TakeOrderedAndProject +Input [4]: [d_year#2, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17] +Arguments: 100, [sum(ss_ext_sales_price)#17 DESC NULLS LAST, d_year#2 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [d_year#2, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42/simplified.txt new file mode 100644 index 0000000000000..4806a9309bd90 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q42/simplified.txt @@ -0,0 +1,31 @@ +TakeOrderedAndProject [sum(ss_ext_sales_price),d_year,i_category_id,i_category] + WholeStageCodegen (4) + HashAggregate [d_year,i_category_id,i_category,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(ss_ext_sales_price),sum] + InputAdapter + Exchange [d_year,i_category_id,i_category] #1 + WholeStageCodegen (3) + HashAggregate [d_year,i_category_id,i_category,ss_ext_sales_price] [sum,sum] + Project [d_year,ss_ext_sales_price,i_category_id,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [d_year,ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [d_date_sk,d_year] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_category_id,i_category] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_category_id,i_category,i_manager_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43.sf100/explain.txt new file mode 100644 index 0000000000000..ec49a329ecded --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43.sf100/explain.txt @@ -0,0 +1,133 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.store (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_day_name#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2450816), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] + +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] +Condition : ((((isnotnull(d_year#2) AND (d_year#2 = 1998)) AND (d_date_sk#1 >= 2450816)) AND (d_date_sk#1 <= 2451179)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [d_date_sk#1, d_day_name#3] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] + +(5) BroadcastExchange +Input [2]: [d_date_sk#1, d_day_name#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [3]: [ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), (ss_sold_date_sk#7 >= 2450816), (ss_sold_date_sk#7 <= 2451179), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [3]: [ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] + +(8) Filter +Input [3]: [ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] +Condition : isnotnull(ss_store_sk#5) + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#7] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [d_day_name#3, ss_store_sk#5, ss_sales_price#6] +Input [5]: [d_date_sk#1, d_day_name#3, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] + +(11) Scan parquet default.store +Output [4]: [s_store_sk#9, s_store_id#10, s_store_name#11, s_gmt_offset#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_gmt_offset), EqualTo(s_gmt_offset,-5.00), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [s_store_sk#9, s_store_id#10, s_store_name#11, s_gmt_offset#12] + +(13) Filter [codegen id : 2] +Input [4]: [s_store_sk#9, s_store_id#10, s_store_name#11, s_gmt_offset#12] +Condition : ((isnotnull(s_gmt_offset#12) AND (s_gmt_offset#12 = -5.00)) AND isnotnull(s_store_sk#9)) + +(14) Project [codegen id : 2] +Output [3]: [s_store_sk#9, s_store_id#10, s_store_name#11] +Input [4]: [s_store_sk#9, s_store_id#10, s_store_name#11, s_gmt_offset#12] + +(15) BroadcastExchange +Input [3]: [s_store_sk#9, s_store_id#10, s_store_name#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#5] +Right keys [1]: [s_store_sk#9] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_day_name#3, ss_sales_price#6, s_store_id#10, s_store_name#11] +Input [6]: [d_day_name#3, ss_store_sk#5, ss_sales_price#6, s_store_sk#9, s_store_id#10, s_store_name#11] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_day_name#3, ss_sales_price#6, s_store_id#10, s_store_name#11] +Keys [2]: [s_store_name#11, s_store_id#10] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#6 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#6 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#6 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#6 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#6 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#6 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#6 ELSE null END))] +Aggregate Attributes [7]: [sum#14, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20] +Results [9]: [s_store_name#11, s_store_id#10, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27] + +(19) Exchange +Input [9]: [s_store_name#11, s_store_id#10, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27] +Arguments: hashpartitioning(s_store_name#11, s_store_id#10, 5), ENSURE_REQUIREMENTS, [id=#28] + +(20) HashAggregate [codegen id : 4] +Input [9]: [s_store_name#11, s_store_id#10, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27] +Keys [2]: [s_store_name#11, s_store_id#10] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#6 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#6 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#6 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#6 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#6 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#6 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#6 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#6 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#6 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#6 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#6 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#6 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#6 ELSE null END))#34, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#6 ELSE null END))#35] +Results [9]: [s_store_name#11, s_store_id#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#6 ELSE null END))#29,17,2) AS sun_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#6 ELSE null END))#30,17,2) AS mon_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#6 ELSE null END))#31,17,2) AS tue_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#6 ELSE null END))#32,17,2) AS wed_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#6 ELSE null END))#33,17,2) AS thu_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#6 ELSE null END))#34,17,2) AS fri_sales#41, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#6 ELSE null END))#35,17,2) AS sat_sales#42] + +(21) TakeOrderedAndProject +Input [9]: [s_store_name#11, s_store_id#10, sun_sales#36, mon_sales#37, tue_sales#38, wed_sales#39, thu_sales#40, fri_sales#41, sat_sales#42] +Arguments: 100, [s_store_name#11 ASC NULLS FIRST, s_store_id#10 ASC NULLS FIRST, sun_sales#36 ASC NULLS FIRST, mon_sales#37 ASC NULLS FIRST, tue_sales#38 ASC NULLS FIRST, wed_sales#39 ASC NULLS FIRST, thu_sales#40 ASC NULLS FIRST, fri_sales#41 ASC NULLS FIRST, sat_sales#42 ASC NULLS FIRST], [s_store_name#11, s_store_id#10, sun_sales#36, mon_sales#37, tue_sales#38, wed_sales#39, thu_sales#40, fri_sales#41, sat_sales#42] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (22) + + +(22) ReusedExchange [Reuses operator id: 5] +Output [2]: [d_date_sk#1, d_day_name#3] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43.sf100/simplified.txt new file mode 100644 index 0000000000000..1fbb5aa612fa9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43.sf100/simplified.txt @@ -0,0 +1,33 @@ +TakeOrderedAndProject [s_store_name,s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + WholeStageCodegen (4) + HashAggregate [s_store_name,s_store_id,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN ss_sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + Exchange [s_store_name,s_store_id] #1 + WholeStageCodegen (3) + HashAggregate [s_store_name,s_store_id,d_day_name,ss_sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [d_day_name,ss_sales_price,s_store_id,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [d_day_name,ss_store_sk,ss_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk,d_day_name] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_day_name] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_day_name] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [s_store_sk,s_store_id,s_store_name] + Filter [s_gmt_offset,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id,s_store_name,s_gmt_offset] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43/explain.txt new file mode 100644 index 0000000000000..2c15f0ebcbd54 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43/explain.txt @@ -0,0 +1,123 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- BroadcastExchange (8) + : +- * Filter (7) + : +- * ColumnarToRow (6) + : +- Scan parquet default.store_sales (5) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.store (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_day_name#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2450816), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] + +(3) Filter [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] +Condition : ((((isnotnull(d_year#2) AND (d_year#2 = 1998)) AND (d_date_sk#1 >= 2450816)) AND (d_date_sk#1 <= 2451179)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 3] +Output [2]: [d_date_sk#1, d_day_name#3] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] + +(5) Scan parquet default.store_sales +Output [3]: [ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), (ss_sold_date_sk#6 >= 2450816), (ss_sold_date_sk#6 <= 2451179), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] + +(7) Filter [codegen id : 1] +Input [3]: [ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] +Condition : isnotnull(ss_store_sk#4) + +(8) BroadcastExchange +Input [3]: [ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [d_day_name#3, ss_store_sk#4, ss_sales_price#5] +Input [5]: [d_date_sk#1, d_day_name#3, ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] + +(11) Scan parquet default.store +Output [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_gmt_offset), EqualTo(s_gmt_offset,-5.00), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11] + +(13) Filter [codegen id : 2] +Input [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11] +Condition : ((isnotnull(s_gmt_offset#11) AND (s_gmt_offset#11 = -5.00)) AND isnotnull(s_store_sk#8)) + +(14) Project [codegen id : 2] +Output [3]: [s_store_sk#8, s_store_id#9, s_store_name#10] +Input [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11] + +(15) BroadcastExchange +Input [3]: [s_store_sk#8, s_store_id#9, s_store_name#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#8] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_day_name#3, ss_sales_price#5, s_store_id#9, s_store_name#10] +Input [6]: [d_day_name#3, ss_store_sk#4, ss_sales_price#5, s_store_sk#8, s_store_id#9, s_store_name#10] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_day_name#3, ss_sales_price#5, s_store_id#9, s_store_name#10] +Keys [2]: [s_store_name#10, s_store_id#9] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#5 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#5 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#5 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#5 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#5 ELSE null END))] +Aggregate Attributes [7]: [sum#13, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19] +Results [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] + +(19) Exchange +Input [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Arguments: hashpartitioning(s_store_name#10, s_store_id#9, 5), ENSURE_REQUIREMENTS, [id=#27] + +(20) HashAggregate [codegen id : 4] +Input [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Keys [2]: [s_store_name#10, s_store_id#9] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#5 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#5 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#5 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#5 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#5 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#5 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#5 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#5 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#5 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#5 ELSE null END))#34] +Results [9]: [s_store_name#10, s_store_id#9, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#5 ELSE null END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#5 ELSE null END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#5 ELSE null END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 ELSE null END))#31,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 ELSE null END))#32,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#5 ELSE null END))#33,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#5 ELSE null END))#34,17,2) AS sat_sales#41] + +(21) TakeOrderedAndProject +Input [9]: [s_store_name#10, s_store_id#9, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41] +Arguments: 100, [s_store_name#10 ASC NULLS FIRST, s_store_id#9 ASC NULLS FIRST, sun_sales#35 ASC NULLS FIRST, mon_sales#36 ASC NULLS FIRST, tue_sales#37 ASC NULLS FIRST, wed_sales#38 ASC NULLS FIRST, thu_sales#39 ASC NULLS FIRST, fri_sales#40 ASC NULLS FIRST, sat_sales#41 ASC NULLS FIRST], [s_store_name#10, s_store_id#9, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43/simplified.txt new file mode 100644 index 0000000000000..2d292e81891af --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q43/simplified.txt @@ -0,0 +1,31 @@ +TakeOrderedAndProject [s_store_name,s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + WholeStageCodegen (4) + HashAggregate [s_store_name,s_store_id,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN ss_sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + Exchange [s_store_name,s_store_id] #1 + WholeStageCodegen (3) + HashAggregate [s_store_name,s_store_id,d_day_name,ss_sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [d_day_name,ss_sales_price,s_store_id,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [d_day_name,ss_store_sk,ss_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [d_date_sk,d_day_name] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_day_name] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [s_store_sk,s_store_id,s_store_name] + Filter [s_gmt_offset,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id,s_store_name,s_gmt_offset] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt new file mode 100644 index 0000000000000..e62003f82faec --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/explain.txt @@ -0,0 +1,292 @@ +== Physical Plan == +TakeOrderedAndProject (51) ++- * Project (50) + +- * SortMergeJoin Inner (49) + :- * Sort (46) + : +- Exchange (45) + : +- * Project (44) + : +- * SortMergeJoin Inner (43) + : :- * Sort (37) + : : +- Exchange (36) + : : +- * HashAggregate (35) + : : +- * HashAggregate (34) + : : +- * Project (33) + : : +- * SortMergeJoin Inner (32) + : : :- * Sort (26) + : : : +- Exchange (25) + : : : +- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Project (17) + : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : :- * Project (10) + : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.store_sales (1) + : : : : : +- BroadcastExchange (8) + : : : : : +- * Project (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.date_dim (4) + : : : : +- BroadcastExchange (15) + : : : : +- * Project (14) + : : : : +- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.store (11) + : : : +- BroadcastExchange (22) + : : : +- * Project (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.household_demographics (18) + : : +- * Sort (31) + : : +- Exchange (30) + : : +- * Filter (29) + : : +- * ColumnarToRow (28) + : : +- Scan parquet default.customer_address (27) + : +- * Sort (42) + : +- Exchange (41) + : +- * Filter (40) + : +- * ColumnarToRow (39) + : +- Scan parquet default.customer (38) + +- * Sort (48) + +- ReusedExchange (47) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [ss_sold_date_sk#8 INSET (2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028), isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 4] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Condition : (((isnotnull(ss_store_sk#4) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_addr_sk#3)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_dow#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_dow, [6,0]), In(d_year, [1999,2000,2001]), In(d_date_sk, [2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] +Condition : (((d_dow#12 IN (6,0) AND d_year#11 IN (1999,2000,2001)) AND d_date_sk#10 INSET (2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028)) AND isnotnull(d_date_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(8) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(10) Project [codegen id : 4] +Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8, d_date_sk#10] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#14, s_city#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_city, [Midway,Concord,Spring Hill,Brownsville,Greenville]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#14, s_city#15] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#14, s_city#15] +Condition : (s_city#15 IN (Midway,Concord,Spring Hill,Brownsville,Greenville) AND isnotnull(s_store_sk#14)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#14] +Input [2]: [s_store_sk#14, s_city#15] + +(15) BroadcastExchange +Input [1]: [s_store_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#14] +Join condition: None + +(17) Project [codegen id : 4] +Output [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_store_sk#14] + +(18) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(EqualTo(hd_dep_count,5),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] + +(20) Filter [codegen id : 3] +Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] +Condition : (((hd_dep_count#18 = 5) OR (hd_vehicle_count#19 = 3)) AND isnotnull(hd_demo_sk#17)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#17] +Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#17] +Join condition: None + +(24) Project [codegen id : 4] +Output [5]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, hd_demo_sk#17] + +(25) Exchange +Input [5]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Arguments: hashpartitioning(ss_addr_sk#3, 5), ENSURE_REQUIREMENTS, [id=#21] + +(26) Sort [codegen id : 5] +Input [5]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Arguments: [ss_addr_sk#3 ASC NULLS FIRST], false, 0 + +(27) Scan parquet default.customer_address +Output [2]: [ca_address_sk#22, ca_city#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 6] +Input [2]: [ca_address_sk#22, ca_city#23] + +(29) Filter [codegen id : 6] +Input [2]: [ca_address_sk#22, ca_city#23] +Condition : (isnotnull(ca_address_sk#22) AND isnotnull(ca_city#23)) + +(30) Exchange +Input [2]: [ca_address_sk#22, ca_city#23] +Arguments: hashpartitioning(ca_address_sk#22, 5), ENSURE_REQUIREMENTS, [id=#24] + +(31) Sort [codegen id : 7] +Input [2]: [ca_address_sk#22, ca_city#23] +Arguments: [ca_address_sk#22 ASC NULLS FIRST], false, 0 + +(32) SortMergeJoin [codegen id : 8] +Left keys [1]: [ss_addr_sk#3] +Right keys [1]: [ca_address_sk#22] +Join condition: None + +(33) Project [codegen id : 8] +Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#23] +Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_address_sk#22, ca_city#23] + +(34) HashAggregate [codegen id : 8] +Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#23] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23] +Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#6)), partial_sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum#25, sum#26] +Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23, sum#27, sum#28] + +(35) HashAggregate [codegen id : 8] +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23, sum#27, sum#28] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23] +Functions [2]: [sum(UnscaledValue(ss_coupon_amt#6)), sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#29, sum(UnscaledValue(ss_net_profit#7))#30] +Results [5]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#23 AS bought_city#31, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#29,17,2) AS amt#32, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#30,17,2) AS profit#33] + +(36) Exchange +Input [5]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#31, amt#32, profit#33] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#34] + +(37) Sort [codegen id : 9] +Input [5]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#31, amt#32, profit#33] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(38) Scan parquet default.customer +Output [4]: [c_customer_sk#35, c_current_addr_sk#36, c_first_name#37, c_last_name#38] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 10] +Input [4]: [c_customer_sk#35, c_current_addr_sk#36, c_first_name#37, c_last_name#38] + +(40) Filter [codegen id : 10] +Input [4]: [c_customer_sk#35, c_current_addr_sk#36, c_first_name#37, c_last_name#38] +Condition : (isnotnull(c_customer_sk#35) AND isnotnull(c_current_addr_sk#36)) + +(41) Exchange +Input [4]: [c_customer_sk#35, c_current_addr_sk#36, c_first_name#37, c_last_name#38] +Arguments: hashpartitioning(c_customer_sk#35, 5), ENSURE_REQUIREMENTS, [id=#39] + +(42) Sort [codegen id : 11] +Input [4]: [c_customer_sk#35, c_current_addr_sk#36, c_first_name#37, c_last_name#38] +Arguments: [c_customer_sk#35 ASC NULLS FIRST], false, 0 + +(43) SortMergeJoin [codegen id : 12] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#35] +Join condition: None + +(44) Project [codegen id : 12] +Output [7]: [ss_ticket_number#5, bought_city#31, amt#32, profit#33, c_current_addr_sk#36, c_first_name#37, c_last_name#38] +Input [9]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#31, amt#32, profit#33, c_customer_sk#35, c_current_addr_sk#36, c_first_name#37, c_last_name#38] + +(45) Exchange +Input [7]: [ss_ticket_number#5, bought_city#31, amt#32, profit#33, c_current_addr_sk#36, c_first_name#37, c_last_name#38] +Arguments: hashpartitioning(c_current_addr_sk#36, 5), ENSURE_REQUIREMENTS, [id=#40] + +(46) Sort [codegen id : 13] +Input [7]: [ss_ticket_number#5, bought_city#31, amt#32, profit#33, c_current_addr_sk#36, c_first_name#37, c_last_name#38] +Arguments: [c_current_addr_sk#36 ASC NULLS FIRST], false, 0 + +(47) ReusedExchange [Reuses operator id: 30] +Output [2]: [ca_address_sk#41, ca_city#42] + +(48) Sort [codegen id : 15] +Input [2]: [ca_address_sk#41, ca_city#42] +Arguments: [ca_address_sk#41 ASC NULLS FIRST], false, 0 + +(49) SortMergeJoin [codegen id : 16] +Left keys [1]: [c_current_addr_sk#36] +Right keys [1]: [ca_address_sk#41] +Join condition: NOT (ca_city#42 = bought_city#31) + +(50) Project [codegen id : 16] +Output [7]: [c_last_name#38, c_first_name#37, ca_city#42, bought_city#31, ss_ticket_number#5, amt#32, profit#33] +Input [9]: [ss_ticket_number#5, bought_city#31, amt#32, profit#33, c_current_addr_sk#36, c_first_name#37, c_last_name#38, ca_address_sk#41, ca_city#42] + +(51) TakeOrderedAndProject +Input [7]: [c_last_name#38, c_first_name#37, ca_city#42, bought_city#31, ss_ticket_number#5, amt#32, profit#33] +Arguments: 100, [c_last_name#38 ASC NULLS FIRST, c_first_name#37 ASC NULLS FIRST, ca_city#42 ASC NULLS FIRST, bought_city#31 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#38, c_first_name#37, ca_city#42, bought_city#31, ss_ticket_number#5, amt#32, profit#33] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (52) + + +(52) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#10] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/simplified.txt new file mode 100644 index 0000000000000..e3a4549474e37 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46.sf100/simplified.txt @@ -0,0 +1,89 @@ +TakeOrderedAndProject [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,amt,profit] + WholeStageCodegen (16) + Project [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,amt,profit] + SortMergeJoin [c_current_addr_sk,ca_address_sk,ca_city,bought_city] + InputAdapter + WholeStageCodegen (13) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #1 + WholeStageCodegen (12) + Project [ss_ticket_number,bought_city,amt,profit,c_current_addr_sk,c_first_name,c_last_name] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (9) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #2 + WholeStageCodegen (8) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,sum,sum] [sum(UnscaledValue(ss_coupon_amt)),sum(UnscaledValue(ss_net_profit)),bought_city,amt,profit,sum,sum] + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,ss_coupon_amt,ss_net_profit] [sum,sum,sum,sum] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ca_city] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (5) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #3 + WholeStageCodegen (4) + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dow,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dow] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_city,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_city] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + WholeStageCodegen (7) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #7 + WholeStageCodegen (6) + Filter [ca_address_sk,ca_city] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] + InputAdapter + WholeStageCodegen (11) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #8 + WholeStageCodegen (10) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + InputAdapter + WholeStageCodegen (15) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_city] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46/explain.txt new file mode 100644 index 0000000000000..a00e2eeac49b7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46/explain.txt @@ -0,0 +1,252 @@ +== Physical Plan == +TakeOrderedAndProject (43) ++- * Project (42) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (39) + : +- * BroadcastHashJoin Inner BuildRight (38) + : :- * HashAggregate (33) + : : +- Exchange (32) + : : +- * HashAggregate (31) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Project (17) + : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : :- * Project (10) + : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.store_sales (1) + : : : : : +- BroadcastExchange (8) + : : : : : +- * Project (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.date_dim (4) + : : : : +- BroadcastExchange (15) + : : : : +- * Project (14) + : : : : +- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.store (11) + : : : +- BroadcastExchange (22) + : : : +- * Project (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.household_demographics (18) + : : +- BroadcastExchange (28) + : : +- * Filter (27) + : : +- * ColumnarToRow (26) + : : +- Scan parquet default.customer_address (25) + : +- BroadcastExchange (37) + : +- * Filter (36) + : +- * ColumnarToRow (35) + : +- Scan parquet default.customer (34) + +- ReusedExchange (40) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [ss_sold_date_sk#8 INSET (2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028), isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Condition : (((isnotnull(ss_store_sk#4) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_addr_sk#3)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_dow#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_dow, [6,0]), In(d_year, [1999,2000,2001]), In(d_date_sk, [2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] +Condition : (((d_dow#12 IN (6,0) AND d_year#11 IN (1999,2000,2001)) AND d_date_sk#10 INSET (2451790,2451609,2451294,2451658,2452099,2451482,2451700,2452035,2452274,2451258,2451847,2451714,2451937,2451860,2451601,2451573,2451686,2452008,2451454,2451882,2451832,2452259,2451671,2451903,2451497,2452162,2451322,2451517,2451434,2451273,2451405,2452105,2451924,2452050,2452126,2452203,2451818,2451559,2451853,2451238,2451209,2451357,2451959,2452239,2451608,2452141,2452252,2451623,2451867,2451504,2451910,2452232,2451874,2451581,2451329,2451223,2451783,2452267,2452042,2451895,2451986,2452091,2451693,2451265,2451678,2451825,2451244,2451490,2451287,2451419,2451546,2451245,2451713,2452070,2451189,2451804,2451468,2451525,2451902,2452077,2452161,2451378,2451567,2451931,2451699,2451251,2451840,2452253,2451938,2451510,2452231,2452036,2451616,2451230,2452112,2451846,2451966,2451538,2451819,2452140,2452183,2451496,2451791,2451595,2451574,2451363,2451994,2451917,2451602,2452273,2451237,2451350,2451685,2451259,2451286,2451972,2452224,2451370,2452245,2451643,2451993,2451315,2451301,2451560,2451433,2452225,2451532,2451755,2451854,2451545,2451210,2451587,2451987,2451447,2452197,2451552,2451896,2451679,2452147,2451735,2452022,2451707,2451868,2451398,2451777,2451181,2451503,2451839,2452175,2451441,2452154,2452029,2452196,2451952,2451805,2451965,2451539,2452001,2451833,2451392,2451524,2451461,2452133,2451448,2451307,2451615,2451769,2451412,2451349,2451651,2451763,2451203,2452064,2451980,2451748,2451637,2452182,2451279,2451231,2451734,2451692,2452071,2451336,2451300,2451727,2451630,2452189,2451875,2451973,2451328,2452084,2451399,2451944,2452204,2451385,2451776,2451384,2451272,2451812,2451749,2451566,2451182,2451945,2451420,2451930,2452057,2451756,2451644,2451314,2451364,2452007,2451798,2451475,2452015,2451440,2452000,2451588,2452148,2451195,2452217,2451371,2452176,2451531,2452134,2452211,2451462,2451188,2451741,2452119,2451342,2451580,2451672,2451889,2451280,2451406,2451293,2451217,2452049,2452106,2451321,2451335,2451483,2452260,2451657,2451979,2451518,2451629,2451728,2451923,2451861,2451951,2452246,2451455,2451356,2451224,2452210,2452021,2451427,2451202,2452098,2452168,2451553,2451391,2451706,2452155,2451196,2451770,2452127,2451762,2452078,2451958,2451721,2451665,2452120,2451252,2452085,2452092,2451476,2452218,2452169,2451797,2451650,2451881,2451511,2451469,2451888,2452043,2452266,2451664,2452014,2451343,2452056,2452190,2452063,2451636,2451742,2451811,2451720,2451308,2451489,2451413,2451216,2451594,2452238,2451784,2451426,2451622,2451916,2452113,2451909,2451266,2451826,2451377,2452028)) AND isnotnull(d_date_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(8) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8, d_date_sk#10] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#14, s_city#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_city, [Midway,Concord,Spring Hill,Brownsville,Greenville]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#14, s_city#15] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#14, s_city#15] +Condition : (s_city#15 IN (Midway,Concord,Spring Hill,Brownsville,Greenville) AND isnotnull(s_store_sk#14)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#14] +Input [2]: [s_store_sk#14, s_city#15] + +(15) BroadcastExchange +Input [1]: [s_store_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#14] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_store_sk#14] + +(18) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(EqualTo(hd_dep_count,5),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] + +(20) Filter [codegen id : 3] +Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] +Condition : (((hd_dep_count#18 = 5) OR (hd_vehicle_count#19 = 3)) AND isnotnull(hd_demo_sk#17)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#17] +Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] + +(23) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#17] +Join condition: None + +(24) Project [codegen id : 5] +Output [5]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, hd_demo_sk#17] + +(25) Scan parquet default.customer_address +Output [2]: [ca_address_sk#21, ca_city#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 4] +Input [2]: [ca_address_sk#21, ca_city#22] + +(27) Filter [codegen id : 4] +Input [2]: [ca_address_sk#21, ca_city#22] +Condition : (isnotnull(ca_address_sk#21) AND isnotnull(ca_city#22)) + +(28) BroadcastExchange +Input [2]: [ca_address_sk#21, ca_city#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(29) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#3] +Right keys [1]: [ca_address_sk#21] +Join condition: None + +(30) Project [codegen id : 5] +Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#22] +Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_address_sk#21, ca_city#22] + +(31) HashAggregate [codegen id : 5] +Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#22] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#22] +Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#6)), partial_sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum#24, sum#25] +Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#22, sum#26, sum#27] + +(32) Exchange +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#22, sum#26, sum#27] +Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#22, 5), ENSURE_REQUIREMENTS, [id=#28] + +(33) HashAggregate [codegen id : 8] +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#22, sum#26, sum#27] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#22] +Functions [2]: [sum(UnscaledValue(ss_coupon_amt#6)), sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#29, sum(UnscaledValue(ss_net_profit#7))#30] +Results [5]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#22 AS bought_city#31, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#29,17,2) AS amt#32, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#30,17,2) AS profit#33] + +(34) Scan parquet default.customer +Output [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 6] +Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] + +(36) Filter [codegen id : 6] +Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Condition : (isnotnull(c_customer_sk#34) AND isnotnull(c_current_addr_sk#35)) + +(37) BroadcastExchange +Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#38] + +(38) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#34] +Join condition: None + +(39) Project [codegen id : 8] +Output [7]: [ss_ticket_number#5, bought_city#31, amt#32, profit#33, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Input [9]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#31, amt#32, profit#33, c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] + +(40) ReusedExchange [Reuses operator id: 28] +Output [2]: [ca_address_sk#39, ca_city#40] + +(41) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [c_current_addr_sk#35] +Right keys [1]: [ca_address_sk#39] +Join condition: NOT (ca_city#40 = bought_city#31) + +(42) Project [codegen id : 8] +Output [7]: [c_last_name#37, c_first_name#36, ca_city#40, bought_city#31, ss_ticket_number#5, amt#32, profit#33] +Input [9]: [ss_ticket_number#5, bought_city#31, amt#32, profit#33, c_current_addr_sk#35, c_first_name#36, c_last_name#37, ca_address_sk#39, ca_city#40] + +(43) TakeOrderedAndProject +Input [7]: [c_last_name#37, c_first_name#36, ca_city#40, bought_city#31, ss_ticket_number#5, amt#32, profit#33] +Arguments: 100, [c_last_name#37 ASC NULLS FIRST, c_first_name#36 ASC NULLS FIRST, ca_city#40 ASC NULLS FIRST, bought_city#31 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#37, c_first_name#36, ca_city#40, bought_city#31, ss_ticket_number#5, amt#32, profit#33] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (44) + + +(44) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#10] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46/simplified.txt new file mode 100644 index 0000000000000..7f729f9874b53 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q46/simplified.txt @@ -0,0 +1,65 @@ +TakeOrderedAndProject [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,amt,profit] + WholeStageCodegen (8) + Project [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,amt,profit] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk,ca_city,bought_city] + Project [ss_ticket_number,bought_city,amt,profit,c_current_addr_sk,c_first_name,c_last_name] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,sum,sum] [sum(UnscaledValue(ss_coupon_amt)),sum(UnscaledValue(ss_net_profit)),bought_city,amt,profit,sum,sum] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city] #1 + WholeStageCodegen (5) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,ss_coupon_amt,ss_net_profit] [sum,sum,sum,sum] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ca_city] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dow,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dow] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_city,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_city] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [ca_address_sk,ca_city] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + InputAdapter + ReusedExchange [ca_address_sk,ca_city] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt new file mode 100644 index 0000000000000..02f680fc0dd1a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/explain.txt @@ -0,0 +1,133 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,12), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2451149), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 12)) AND (d_year#2 = 1998)) AND (d_date_sk#1 >= 2451149)) AND (d_date_sk#1 <= 2451179)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [d_date_sk#1, d_year#2] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) BroadcastExchange +Input [2]: [d_date_sk#1, d_year#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), (ss_sold_date_sk#7 >= 2451149), (ss_sold_date_sk#7 <= 2451179), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7] + +(8) Filter +Input [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7] +Condition : isnotnull(ss_item_sk#5) + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#7] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [d_year#2, ss_item_sk#5, ss_ext_sales_price#6] +Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7] + +(11) Scan parquet default.item +Output [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12] + +(13) Filter [codegen id : 2] +Input [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12] +Condition : ((isnotnull(i_manager_id#12) AND (i_manager_id#12 = 1)) AND isnotnull(i_item_sk#9)) + +(14) Project [codegen id : 2] +Output [3]: [i_item_sk#9, i_brand_id#10, i_brand#11] +Input [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12] + +(15) BroadcastExchange +Input [3]: [i_item_sk#9, i_brand_id#10, i_brand#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#5] +Right keys [1]: [i_item_sk#9] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_year#2, ss_ext_sales_price#6, i_brand_id#10, i_brand#11] +Input [6]: [d_year#2, ss_item_sk#5, ss_ext_sales_price#6, i_item_sk#9, i_brand_id#10, i_brand#11] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_year#2, ss_ext_sales_price#6, i_brand_id#10, i_brand#11] +Keys [3]: [d_year#2, i_brand#11, i_brand_id#10] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#6))] +Aggregate Attributes [1]: [sum#14] +Results [4]: [d_year#2, i_brand#11, i_brand_id#10, sum#15] + +(19) Exchange +Input [4]: [d_year#2, i_brand#11, i_brand_id#10, sum#15] +Arguments: hashpartitioning(d_year#2, i_brand#11, i_brand_id#10, 5), ENSURE_REQUIREMENTS, [id=#16] + +(20) HashAggregate [codegen id : 4] +Input [4]: [d_year#2, i_brand#11, i_brand_id#10, sum#15] +Keys [3]: [d_year#2, i_brand#11, i_brand_id#10] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#6))#17] +Results [4]: [d_year#2, i_brand_id#10 AS brand_id#18, i_brand#11 AS brand#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#17,17,2) AS ext_price#20] + +(21) TakeOrderedAndProject +Input [4]: [d_year#2, brand_id#18, brand#19, ext_price#20] +Arguments: 100, [d_year#2 ASC NULLS FIRST, ext_price#20 DESC NULLS LAST, brand_id#18 ASC NULLS FIRST], [d_year#2, brand_id#18, brand#19, ext_price#20] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (22) + + +(22) ReusedExchange [Reuses operator id: 5] +Output [2]: [d_date_sk#1, d_year#2] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/simplified.txt new file mode 100644 index 0000000000000..6caf3262b7b8f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52.sf100/simplified.txt @@ -0,0 +1,33 @@ +TakeOrderedAndProject [d_year,ext_price,brand_id,brand] + WholeStageCodegen (4) + HashAggregate [d_year,i_brand,i_brand_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [d_year,i_brand,i_brand_id] #1 + WholeStageCodegen (3) + HashAggregate [d_year,i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] + Project [d_year,ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [d_year,ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk,d_year] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52/explain.txt new file mode 100644 index 0000000000000..8d081d60f9e85 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52/explain.txt @@ -0,0 +1,123 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- BroadcastExchange (8) + : +- * Filter (7) + : +- * ColumnarToRow (6) + : +- Scan parquet default.store_sales (5) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,12), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2451149), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 12)) AND (d_year#2 = 1998)) AND (d_date_sk#1 >= 2451149)) AND (d_date_sk#1 <= 2451179)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 3] +Output [2]: [d_date_sk#1, d_year#2] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) Scan parquet default.store_sales +Output [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), (ss_sold_date_sk#6 >= 2451149), (ss_sold_date_sk#6 <= 2451179), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(7) Filter [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Condition : isnotnull(ss_item_sk#4) + +(8) BroadcastExchange +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5] +Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(11) Scan parquet default.item +Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] + +(13) Filter [codegen id : 2] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] +Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 1)) AND isnotnull(i_item_sk#8)) + +(14) Project [codegen id : 2] +Output [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] + +(15) BroadcastExchange +Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#4] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_year#2, ss_ext_sales_price#5, i_brand_id#9, i_brand#10] +Input [6]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_brand_id#9, i_brand#10] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_year#2, ss_ext_sales_price#5, i_brand_id#9, i_brand#10] +Keys [3]: [d_year#2, i_brand#10, i_brand_id#9] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum#13] +Results [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] + +(19) Exchange +Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] +Arguments: hashpartitioning(d_year#2, i_brand#10, i_brand_id#9, 5), ENSURE_REQUIREMENTS, [id=#15] + +(20) HashAggregate [codegen id : 4] +Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] +Keys [3]: [d_year#2, i_brand#10, i_brand_id#9] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#16] +Results [4]: [d_year#2, i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#16,17,2) AS ext_price#19] + +(21) TakeOrderedAndProject +Input [4]: [d_year#2, brand_id#17, brand#18, ext_price#19] +Arguments: 100, [d_year#2 ASC NULLS FIRST, ext_price#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [d_year#2, brand_id#17, brand#18, ext_price#19] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52/simplified.txt new file mode 100644 index 0000000000000..d16dd603ec66a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q52/simplified.txt @@ -0,0 +1,31 @@ +TakeOrderedAndProject [d_year,ext_price,brand_id,brand] + WholeStageCodegen (4) + HashAggregate [d_year,i_brand,i_brand_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [d_year,i_brand,i_brand_id] #1 + WholeStageCodegen (3) + HashAggregate [d_year,i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] + Project [d_year,ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [d_year,ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [d_date_sk,d_year] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53.sf100/explain.txt new file mode 100644 index 0000000000000..a3223d60c96be --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53.sf100/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * Project (31) + +- * Filter (30) + +- Window (29) + +- * Sort (28) + +- Exchange (27) + +- * HashAggregate (26) + +- Exchange (25) + +- * HashAggregate (24) + +- * Project (23) + +- * BroadcastHashJoin Inner BuildRight (22) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.store_sales (6) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.store (11) + +- BroadcastExchange (21) + +- * Project (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.date_dim (17) + + +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books ,Children ,Electronics ]),In(i_class, [personal ,portable ,reference ,self-help ])),In(i_brand, [scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 ])),And(And(In(i_category, [Women ,Music ,Men ]),In(i_class, [accessories ,classical ,fragrances ,pants ])),In(i_brand, [amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] + +(3) Filter [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] +Condition : ((((i_category#4 IN (Books ,Children ,Electronics ) AND i_class#3 IN (personal ,portable ,reference ,self-help )) AND i_brand#2 IN (scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 )) OR ((i_category#4 IN (Women ,Music ,Men ) AND i_class#3 IN (accessories ,classical ,fragrances ,pants )) AND i_brand#2 IN (amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ))) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [i_item_sk#1, i_manufact_id#5] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] + +(5) BroadcastExchange +Input [2]: [i_item_sk#1, i_manufact_id#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(6) Scan parquet default.store_sales +Output [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#14), (ss_sold_date_sk#14 >= 2451911), (ss_sold_date_sk#14 <= 2452275), dynamicpruningexpression(ss_sold_date_sk#14 IN dynamicpruning#15)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] + +(8) Filter +Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] +Condition : (isnotnull(ss_item_sk#11) AND isnotnull(ss_store_sk#12)) + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#11] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [i_manufact_id#5, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] +Input [6]: [i_item_sk#1, i_manufact_id#5, ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] + +(11) Scan parquet default.store +Output [1]: [s_store_sk#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [1]: [s_store_sk#16] + +(13) Filter [codegen id : 2] +Input [1]: [s_store_sk#16] +Condition : isnotnull(s_store_sk#16) + +(14) BroadcastExchange +Input [1]: [s_store_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#12] +Right keys [1]: [s_store_sk#16] +Join condition: None + +(16) Project [codegen id : 4] +Output [3]: [i_manufact_id#5, ss_sales_price#13, ss_sold_date_sk#14] +Input [5]: [i_manufact_id#5, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14, s_store_sk#16] + +(17) Scan parquet default.date_dim +Output [3]: [d_date_sk#18, d_month_seq#19, d_qoy#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_month_seq, [1222,1215,1223,1217,1214,1219,1213,1218,1220,1221,1216,1212]), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2452275), IsNotNull(d_date_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#18, d_month_seq#19, d_qoy#20] + +(19) Filter [codegen id : 3] +Input [3]: [d_date_sk#18, d_month_seq#19, d_qoy#20] +Condition : (((d_month_seq#19 INSET (1222,1215,1223,1217,1214,1219,1213,1218,1220,1221,1216,1212) AND (d_date_sk#18 >= 2451911)) AND (d_date_sk#18 <= 2452275)) AND isnotnull(d_date_sk#18)) + +(20) Project [codegen id : 3] +Output [2]: [d_date_sk#18, d_qoy#20] +Input [3]: [d_date_sk#18, d_month_seq#19, d_qoy#20] + +(21) BroadcastExchange +Input [2]: [d_date_sk#18, d_qoy#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#14] +Right keys [1]: [d_date_sk#18] +Join condition: None + +(23) Project [codegen id : 4] +Output [3]: [i_manufact_id#5, ss_sales_price#13, d_qoy#20] +Input [5]: [i_manufact_id#5, ss_sales_price#13, ss_sold_date_sk#14, d_date_sk#18, d_qoy#20] + +(24) HashAggregate [codegen id : 4] +Input [3]: [i_manufact_id#5, ss_sales_price#13, d_qoy#20] +Keys [2]: [i_manufact_id#5, d_qoy#20] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#13))] +Aggregate Attributes [1]: [sum#22] +Results [3]: [i_manufact_id#5, d_qoy#20, sum#23] + +(25) Exchange +Input [3]: [i_manufact_id#5, d_qoy#20, sum#23] +Arguments: hashpartitioning(i_manufact_id#5, d_qoy#20, 5), ENSURE_REQUIREMENTS, [id=#24] + +(26) HashAggregate [codegen id : 5] +Input [3]: [i_manufact_id#5, d_qoy#20, sum#23] +Keys [2]: [i_manufact_id#5, d_qoy#20] +Functions [1]: [sum(UnscaledValue(ss_sales_price#13))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#13))#25] +Results [3]: [i_manufact_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#25,17,2) AS sum_sales#26, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#25,17,2) AS _w0#27] + +(27) Exchange +Input [3]: [i_manufact_id#5, sum_sales#26, _w0#27] +Arguments: hashpartitioning(i_manufact_id#5, 5), ENSURE_REQUIREMENTS, [id=#28] + +(28) Sort [codegen id : 6] +Input [3]: [i_manufact_id#5, sum_sales#26, _w0#27] +Arguments: [i_manufact_id#5 ASC NULLS FIRST], false, 0 + +(29) Window +Input [3]: [i_manufact_id#5, sum_sales#26, _w0#27] +Arguments: [avg(_w0#27) windowspecdefinition(i_manufact_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_quarterly_sales#29], [i_manufact_id#5] + +(30) Filter [codegen id : 7] +Input [4]: [i_manufact_id#5, sum_sales#26, _w0#27, avg_quarterly_sales#29] +Condition : (isnotnull(avg_quarterly_sales#29) AND ((avg_quarterly_sales#29 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#26 as decimal(22,6))) - promote_precision(cast(avg_quarterly_sales#29 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_quarterly_sales#29 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000))) + +(31) Project [codegen id : 7] +Output [3]: [i_manufact_id#5, sum_sales#26, avg_quarterly_sales#29] +Input [4]: [i_manufact_id#5, sum_sales#26, _w0#27, avg_quarterly_sales#29] + +(32) TakeOrderedAndProject +Input [3]: [i_manufact_id#5, sum_sales#26, avg_quarterly_sales#29] +Arguments: 100, [avg_quarterly_sales#29 ASC NULLS FIRST, sum_sales#26 ASC NULLS FIRST, i_manufact_id#5 ASC NULLS FIRST], [i_manufact_id#5, sum_sales#26, avg_quarterly_sales#29] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#14 IN dynamicpruning#15 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 21] +Output [2]: [d_date_sk#18, d_qoy#20] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53.sf100/simplified.txt new file mode 100644 index 0000000000000..2e57ebbc0e801 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53.sf100/simplified.txt @@ -0,0 +1,51 @@ +TakeOrderedAndProject [avg_quarterly_sales,sum_sales,i_manufact_id] + WholeStageCodegen (7) + Project [i_manufact_id,sum_sales,avg_quarterly_sales] + Filter [avg_quarterly_sales,sum_sales] + InputAdapter + Window [_w0,i_manufact_id] + WholeStageCodegen (6) + Sort [i_manufact_id] + InputAdapter + Exchange [i_manufact_id] #1 + WholeStageCodegen (5) + HashAggregate [i_manufact_id,d_qoy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_manufact_id,d_qoy] #2 + WholeStageCodegen (4) + HashAggregate [i_manufact_id,d_qoy,ss_sales_price] [sum,sum] + Project [i_manufact_id,ss_sales_price,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_manufact_id,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_manufact_id,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_manufact_id] + Filter [i_category,i_class,i_brand,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manufact_id] + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_qoy] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [d_date_sk,d_qoy] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq,d_qoy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53/explain.txt new file mode 100644 index 0000000000000..172e66022046d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * Project (31) + +- * Filter (30) + +- Window (29) + +- * Sort (28) + +- Exchange (27) + +- * HashAggregate (26) + +- Exchange (25) + +- * HashAggregate (24) + +- * Project (23) + +- * BroadcastHashJoin Inner BuildRight (22) + :- * Project (17) + : +- * BroadcastHashJoin Inner BuildRight (16) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- BroadcastExchange (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.store_sales (5) + : +- BroadcastExchange (15) + : +- * Project (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.date_dim (11) + +- BroadcastExchange (21) + +- * Filter (20) + +- * ColumnarToRow (19) + +- Scan parquet default.store (18) + + +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books ,Children ,Electronics ]),In(i_class, [personal ,portable ,reference ,self-help ])),In(i_brand, [scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 ])),And(And(In(i_category, [Women ,Music ,Men ]),In(i_class, [accessories ,classical ,fragrances ,pants ])),In(i_brand, [amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] + +(3) Filter [codegen id : 4] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] +Condition : ((((i_category#4 IN (Books ,Children ,Electronics ) AND i_class#3 IN (personal ,portable ,reference ,self-help )) AND i_brand#2 IN (scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 )) OR ((i_category#4 IN (Women ,Music ,Men ) AND i_class#3 IN (accessories ,classical ,fragrances ,pants )) AND i_brand#2 IN (amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ))) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 4] +Output [2]: [i_item_sk#1, i_manufact_id#5] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] + +(5) Scan parquet default.store_sales +Output [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#13), (ss_sold_date_sk#13 >= 2451911), (ss_sold_date_sk#13 <= 2452275), dynamicpruningexpression(ss_sold_date_sk#13 IN dynamicpruning#14)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] + +(7) Filter [codegen id : 1] +Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Condition : (isnotnull(ss_item_sk#10) AND isnotnull(ss_store_sk#11)) + +(8) BroadcastExchange +Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#10] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Input [6]: [i_item_sk#1, i_manufact_id#5, ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] + +(11) Scan parquet default.date_dim +Output [3]: [d_date_sk#16, d_month_seq#17, d_qoy#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_month_seq, [1222,1215,1223,1217,1214,1219,1213,1218,1220,1221,1216,1212]), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2452275), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#16, d_month_seq#17, d_qoy#18] + +(13) Filter [codegen id : 2] +Input [3]: [d_date_sk#16, d_month_seq#17, d_qoy#18] +Condition : (((d_month_seq#17 INSET (1222,1215,1223,1217,1214,1219,1213,1218,1220,1221,1216,1212) AND (d_date_sk#16 >= 2451911)) AND (d_date_sk#16 <= 2452275)) AND isnotnull(d_date_sk#16)) + +(14) Project [codegen id : 2] +Output [2]: [d_date_sk#16, d_qoy#18] +Input [3]: [d_date_sk#16, d_month_seq#17, d_qoy#18] + +(15) BroadcastExchange +Input [2]: [d_date_sk#16, d_qoy#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#13] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(17) Project [codegen id : 4] +Output [4]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, d_qoy#18] +Input [6]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13, d_date_sk#16, d_qoy#18] + +(18) Scan parquet default.store +Output [1]: [s_store_sk#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [1]: [s_store_sk#20] + +(20) Filter [codegen id : 3] +Input [1]: [s_store_sk#20] +Condition : isnotnull(s_store_sk#20) + +(21) BroadcastExchange +Input [1]: [s_store_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#11] +Right keys [1]: [s_store_sk#20] +Join condition: None + +(23) Project [codegen id : 4] +Output [3]: [i_manufact_id#5, ss_sales_price#12, d_qoy#18] +Input [5]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, d_qoy#18, s_store_sk#20] + +(24) HashAggregate [codegen id : 4] +Input [3]: [i_manufact_id#5, ss_sales_price#12, d_qoy#18] +Keys [2]: [i_manufact_id#5, d_qoy#18] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#12))] +Aggregate Attributes [1]: [sum#22] +Results [3]: [i_manufact_id#5, d_qoy#18, sum#23] + +(25) Exchange +Input [3]: [i_manufact_id#5, d_qoy#18, sum#23] +Arguments: hashpartitioning(i_manufact_id#5, d_qoy#18, 5), ENSURE_REQUIREMENTS, [id=#24] + +(26) HashAggregate [codegen id : 5] +Input [3]: [i_manufact_id#5, d_qoy#18, sum#23] +Keys [2]: [i_manufact_id#5, d_qoy#18] +Functions [1]: [sum(UnscaledValue(ss_sales_price#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#12))#25] +Results [3]: [i_manufact_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#25,17,2) AS sum_sales#26, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#25,17,2) AS _w0#27] + +(27) Exchange +Input [3]: [i_manufact_id#5, sum_sales#26, _w0#27] +Arguments: hashpartitioning(i_manufact_id#5, 5), ENSURE_REQUIREMENTS, [id=#28] + +(28) Sort [codegen id : 6] +Input [3]: [i_manufact_id#5, sum_sales#26, _w0#27] +Arguments: [i_manufact_id#5 ASC NULLS FIRST], false, 0 + +(29) Window +Input [3]: [i_manufact_id#5, sum_sales#26, _w0#27] +Arguments: [avg(_w0#27) windowspecdefinition(i_manufact_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_quarterly_sales#29], [i_manufact_id#5] + +(30) Filter [codegen id : 7] +Input [4]: [i_manufact_id#5, sum_sales#26, _w0#27, avg_quarterly_sales#29] +Condition : (isnotnull(avg_quarterly_sales#29) AND ((avg_quarterly_sales#29 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#26 as decimal(22,6))) - promote_precision(cast(avg_quarterly_sales#29 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_quarterly_sales#29 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000))) + +(31) Project [codegen id : 7] +Output [3]: [i_manufact_id#5, sum_sales#26, avg_quarterly_sales#29] +Input [4]: [i_manufact_id#5, sum_sales#26, _w0#27, avg_quarterly_sales#29] + +(32) TakeOrderedAndProject +Input [3]: [i_manufact_id#5, sum_sales#26, avg_quarterly_sales#29] +Arguments: 100, [avg_quarterly_sales#29 ASC NULLS FIRST, sum_sales#26 ASC NULLS FIRST, i_manufact_id#5 ASC NULLS FIRST], [i_manufact_id#5, sum_sales#26, avg_quarterly_sales#29] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 5 Hosting Expression = ss_sold_date_sk#13 IN dynamicpruning#14 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 15] +Output [2]: [d_date_sk#16, d_qoy#18] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53/simplified.txt new file mode 100644 index 0000000000000..d67def8b728c1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q53/simplified.txt @@ -0,0 +1,51 @@ +TakeOrderedAndProject [avg_quarterly_sales,sum_sales,i_manufact_id] + WholeStageCodegen (7) + Project [i_manufact_id,sum_sales,avg_quarterly_sales] + Filter [avg_quarterly_sales,sum_sales] + InputAdapter + Window [_w0,i_manufact_id] + WholeStageCodegen (6) + Sort [i_manufact_id] + InputAdapter + Exchange [i_manufact_id] #1 + WholeStageCodegen (5) + HashAggregate [i_manufact_id,d_qoy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_manufact_id,d_qoy] #2 + WholeStageCodegen (4) + HashAggregate [i_manufact_id,d_qoy,ss_sales_price] [sum,sum] + Project [i_manufact_id,ss_sales_price,d_qoy] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_manufact_id,ss_store_sk,ss_sales_price,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_manufact_id,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [i_item_sk,i_manufact_id] + Filter [i_category,i_class,i_brand,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manufact_id] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_qoy] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk,d_qoy] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq,d_qoy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt new file mode 100644 index 0000000000000..df4d94f40bc16 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/explain.txt @@ -0,0 +1,133 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,2001), GreaterThanOrEqual(d_date_sk,2452215), LessThanOrEqual(d_date_sk,2452244), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 11)) AND (d_year#2 = 2001)) AND (d_date_sk#1 >= 2452215)) AND (d_date_sk#1 <= 2452244)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) BroadcastExchange +Input [1]: [d_date_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), (ss_sold_date_sk#7 >= 2452215), (ss_sold_date_sk#7 <= 2452244), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7] + +(8) Filter +Input [3]: [ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7] +Condition : isnotnull(ss_item_sk#5) + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#7] +Join condition: None + +(10) Project [codegen id : 3] +Output [2]: [ss_item_sk#5, ss_ext_sales_price#6] +Input [4]: [d_date_sk#1, ss_item_sk#5, ss_ext_sales_price#6, ss_sold_date_sk#7] + +(11) Scan parquet default.item +Output [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,48), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12] + +(13) Filter [codegen id : 2] +Input [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12] +Condition : ((isnotnull(i_manager_id#12) AND (i_manager_id#12 = 48)) AND isnotnull(i_item_sk#9)) + +(14) Project [codegen id : 2] +Output [3]: [i_item_sk#9, i_brand_id#10, i_brand#11] +Input [4]: [i_item_sk#9, i_brand_id#10, i_brand#11, i_manager_id#12] + +(15) BroadcastExchange +Input [3]: [i_item_sk#9, i_brand_id#10, i_brand#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#5] +Right keys [1]: [i_item_sk#9] +Join condition: None + +(17) Project [codegen id : 3] +Output [3]: [ss_ext_sales_price#6, i_brand_id#10, i_brand#11] +Input [5]: [ss_item_sk#5, ss_ext_sales_price#6, i_item_sk#9, i_brand_id#10, i_brand#11] + +(18) HashAggregate [codegen id : 3] +Input [3]: [ss_ext_sales_price#6, i_brand_id#10, i_brand#11] +Keys [2]: [i_brand#11, i_brand_id#10] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#6))] +Aggregate Attributes [1]: [sum#14] +Results [3]: [i_brand#11, i_brand_id#10, sum#15] + +(19) Exchange +Input [3]: [i_brand#11, i_brand_id#10, sum#15] +Arguments: hashpartitioning(i_brand#11, i_brand_id#10, 5), ENSURE_REQUIREMENTS, [id=#16] + +(20) HashAggregate [codegen id : 4] +Input [3]: [i_brand#11, i_brand_id#10, sum#15] +Keys [2]: [i_brand#11, i_brand_id#10] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#6))#17] +Results [3]: [i_brand_id#10 AS brand_id#18, i_brand#11 AS brand#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#17,17,2) AS ext_price#20] + +(21) TakeOrderedAndProject +Input [3]: [brand_id#18, brand#19, ext_price#20] +Arguments: 100, [ext_price#20 DESC NULLS LAST, brand_id#18 ASC NULLS FIRST], [brand_id#18, brand#19, ext_price#20] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (22) + + +(22) ReusedExchange [Reuses operator id: 5] +Output [1]: [d_date_sk#1] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/simplified.txt new file mode 100644 index 0000000000000..48a1308dfc427 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55.sf100/simplified.txt @@ -0,0 +1,33 @@ +TakeOrderedAndProject [ext_price,brand_id,brand] + WholeStageCodegen (4) + HashAggregate [i_brand,i_brand_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [i_brand,i_brand_id] #1 + WholeStageCodegen (3) + HashAggregate [i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55/explain.txt new file mode 100644 index 0000000000000..a10fc3256db33 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55/explain.txt @@ -0,0 +1,123 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- BroadcastExchange (8) + : +- * Filter (7) + : +- * ColumnarToRow (6) + : +- Scan parquet default.store_sales (5) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,2001), GreaterThanOrEqual(d_date_sk,2452215), LessThanOrEqual(d_date_sk,2452244), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 11)) AND (d_year#2 = 2001)) AND (d_date_sk#1 >= 2452215)) AND (d_date_sk#1 <= 2452244)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 3] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) Scan parquet default.store_sales +Output [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), (ss_sold_date_sk#6 >= 2452215), (ss_sold_date_sk#6 <= 2452244), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(7) Filter [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Condition : isnotnull(ss_item_sk#4) + +(8) BroadcastExchange +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [2]: [ss_item_sk#4, ss_ext_sales_price#5] +Input [4]: [d_date_sk#1, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(11) Scan parquet default.item +Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,48), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] + +(13) Filter [codegen id : 2] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] +Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 48)) AND isnotnull(i_item_sk#8)) + +(14) Project [codegen id : 2] +Output [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] + +(15) BroadcastExchange +Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#4] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(17) Project [codegen id : 3] +Output [3]: [ss_ext_sales_price#5, i_brand_id#9, i_brand#10] +Input [5]: [ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_brand_id#9, i_brand#10] + +(18) HashAggregate [codegen id : 3] +Input [3]: [ss_ext_sales_price#5, i_brand_id#9, i_brand#10] +Keys [2]: [i_brand#10, i_brand_id#9] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum#13] +Results [3]: [i_brand#10, i_brand_id#9, sum#14] + +(19) Exchange +Input [3]: [i_brand#10, i_brand_id#9, sum#14] +Arguments: hashpartitioning(i_brand#10, i_brand_id#9, 5), ENSURE_REQUIREMENTS, [id=#15] + +(20) HashAggregate [codegen id : 4] +Input [3]: [i_brand#10, i_brand_id#9, sum#14] +Keys [2]: [i_brand#10, i_brand_id#9] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#16] +Results [3]: [i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#16,17,2) AS ext_price#19] + +(21) TakeOrderedAndProject +Input [3]: [brand_id#17, brand#18, ext_price#19] +Arguments: 100, [ext_price#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [brand_id#17, brand#18, ext_price#19] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55/simplified.txt new file mode 100644 index 0000000000000..9157bbec2b06a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q55/simplified.txt @@ -0,0 +1,31 @@ +TakeOrderedAndProject [ext_price,brand_id,brand] + WholeStageCodegen (4) + HashAggregate [i_brand,i_brand_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [i_brand,i_brand_id] #1 + WholeStageCodegen (3) + HashAggregate [i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59.sf100/explain.txt new file mode 100644 index 0000000000000..d20f7cf4a2857 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59.sf100/explain.txt @@ -0,0 +1,292 @@ +== Physical Plan == +TakeOrderedAndProject (51) ++- * Project (50) + +- * BroadcastHashJoin Inner BuildRight (49) + :- * Project (25) + : +- * BroadcastHashJoin Inner BuildRight (24) + : :- * Project (18) + : : +- * BroadcastHashJoin Inner BuildRight (17) + : : :- * HashAggregate (12) + : : : +- Exchange (11) + : : : +- * HashAggregate (10) + : : : +- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.store (13) + : +- BroadcastExchange (23) + : +- * Project (22) + : +- * Filter (21) + : +- * ColumnarToRow (20) + : +- Scan parquet default.date_dim (19) + +- BroadcastExchange (48) + +- * Project (47) + +- * BroadcastHashJoin Inner BuildRight (46) + :- * Project (40) + : +- * BroadcastHashJoin Inner BuildRight (39) + : :- * HashAggregate (34) + : : +- Exchange (33) + : : +- * HashAggregate (32) + : : +- * Project (31) + : : +- * BroadcastHashJoin Inner BuildRight (30) + : : :- * Filter (28) + : : : +- * ColumnarToRow (27) + : : : +- Scan parquet default.store_sales (26) + : : +- ReusedExchange (29) + : +- BroadcastExchange (38) + : +- * Filter (37) + : +- * ColumnarToRow (36) + : +- Scan parquet default.store (35) + +- BroadcastExchange (45) + +- * Project (44) + +- * Filter (43) + +- * ColumnarToRow (42) + +- Scan parquet default.date_dim (41) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] +Condition : (isnotnull(d_date_sk#4) AND isnotnull(d_week_seq#5)) + +(7) BroadcastExchange +Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#4] +Join condition: None + +(9) Project [codegen id : 2] +Output [4]: [ss_store_sk#1, ss_sales_price#2, d_week_seq#5, d_day_name#6] +Input [6]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3, d_date_sk#4, d_week_seq#5, d_day_name#6] + +(10) HashAggregate [codegen id : 2] +Input [4]: [ss_store_sk#1, ss_sales_price#2, d_week_seq#5, d_day_name#6] +Keys [2]: [d_week_seq#5, ss_store_sk#1] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))] +Aggregate Attributes [7]: [sum#8, sum#9, sum#10, sum#11, sum#12, sum#13, sum#14] +Results [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] + +(11) Exchange +Input [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] +Arguments: hashpartitioning(d_week_seq#5, ss_store_sk#1, 5), ENSURE_REQUIREMENTS, [id=#22] + +(12) HashAggregate [codegen id : 10] +Input [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] +Keys [2]: [d_week_seq#5, ss_store_sk#1] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END))#23, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END))#24, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END))#25, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END))#26, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))#29] +Results [9]: [d_week_seq#5, ss_store_sk#1, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END))#23,17,2) AS sun_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END))#24,17,2) AS mon_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END))#25,17,2) AS tue_sales#32, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END))#26,17,2) AS wed_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END))#27,17,2) AS thu_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END))#28,17,2) AS fri_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))#29,17,2) AS sat_sales#36] + +(13) Scan parquet default.store +Output [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_id)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 3] +Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] + +(15) Filter [codegen id : 3] +Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] +Condition : (isnotnull(s_store_sk#37) AND isnotnull(s_store_id#38)) + +(16) BroadcastExchange +Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40] + +(17) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#37] +Join condition: None + +(18) Project [codegen id : 10] +Output [10]: [d_week_seq#5, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#38, s_store_name#39] +Input [12]: [d_week_seq#5, ss_store_sk#1, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_sk#37, s_store_id#38, s_store_name#39] + +(19) Scan parquet default.date_dim +Output [2]: [d_month_seq#41, d_week_seq#42] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1185), LessThanOrEqual(d_month_seq,1196), IsNotNull(d_week_seq)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 4] +Input [2]: [d_month_seq#41, d_week_seq#42] + +(21) Filter [codegen id : 4] +Input [2]: [d_month_seq#41, d_week_seq#42] +Condition : (((isnotnull(d_month_seq#41) AND (d_month_seq#41 >= 1185)) AND (d_month_seq#41 <= 1196)) AND isnotnull(d_week_seq#42)) + +(22) Project [codegen id : 4] +Output [1]: [d_week_seq#42] +Input [2]: [d_month_seq#41, d_week_seq#42] + +(23) BroadcastExchange +Input [1]: [d_week_seq#42] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#43] + +(24) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [d_week_seq#5] +Right keys [1]: [d_week_seq#42] +Join condition: None + +(25) Project [codegen id : 10] +Output [10]: [s_store_name#39 AS s_store_name1#44, d_week_seq#5 AS d_week_seq1#45, s_store_id#38 AS s_store_id1#46, sun_sales#30 AS sun_sales1#47, mon_sales#31 AS mon_sales1#48, tue_sales#32 AS tue_sales1#49, wed_sales#33 AS wed_sales1#50, thu_sales#34 AS thu_sales1#51, fri_sales#35 AS fri_sales1#52, sat_sales#36 AS sat_sales1#53] +Input [11]: [d_week_seq#5, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#38, s_store_name#39, d_week_seq#42] + +(26) Scan parquet default.store_sales +Output [3]: [ss_store_sk#54, ss_sales_price#55, ss_sold_date_sk#56] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#56)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 6] +Input [3]: [ss_store_sk#54, ss_sales_price#55, ss_sold_date_sk#56] + +(28) Filter [codegen id : 6] +Input [3]: [ss_store_sk#54, ss_sales_price#55, ss_sold_date_sk#56] +Condition : isnotnull(ss_store_sk#54) + +(29) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#57, d_week_seq#58, d_day_name#59] + +(30) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#56] +Right keys [1]: [d_date_sk#57] +Join condition: None + +(31) Project [codegen id : 6] +Output [4]: [ss_store_sk#54, ss_sales_price#55, d_week_seq#58, d_day_name#59] +Input [6]: [ss_store_sk#54, ss_sales_price#55, ss_sold_date_sk#56, d_date_sk#57, d_week_seq#58, d_day_name#59] + +(32) HashAggregate [codegen id : 6] +Input [4]: [ss_store_sk#54, ss_sales_price#55, d_week_seq#58, d_day_name#59] +Keys [2]: [d_week_seq#58, ss_store_sk#54] +Functions [6]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#59 = Sunday ) THEN ss_sales_price#55 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#59 = Monday ) THEN ss_sales_price#55 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#59 = Wednesday) THEN ss_sales_price#55 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#59 = Thursday ) THEN ss_sales_price#55 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#59 = Friday ) THEN ss_sales_price#55 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#59 = Saturday ) THEN ss_sales_price#55 ELSE null END))] +Aggregate Attributes [6]: [sum#60, sum#61, sum#62, sum#63, sum#64, sum#65] +Results [8]: [d_week_seq#58, ss_store_sk#54, sum#66, sum#67, sum#68, sum#69, sum#70, sum#71] + +(33) Exchange +Input [8]: [d_week_seq#58, ss_store_sk#54, sum#66, sum#67, sum#68, sum#69, sum#70, sum#71] +Arguments: hashpartitioning(d_week_seq#58, ss_store_sk#54, 5), ENSURE_REQUIREMENTS, [id=#72] + +(34) HashAggregate [codegen id : 9] +Input [8]: [d_week_seq#58, ss_store_sk#54, sum#66, sum#67, sum#68, sum#69, sum#70, sum#71] +Keys [2]: [d_week_seq#58, ss_store_sk#54] +Functions [6]: [sum(UnscaledValue(CASE WHEN (d_day_name#59 = Sunday ) THEN ss_sales_price#55 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#59 = Monday ) THEN ss_sales_price#55 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#59 = Wednesday) THEN ss_sales_price#55 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#59 = Thursday ) THEN ss_sales_price#55 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#59 = Friday ) THEN ss_sales_price#55 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#59 = Saturday ) THEN ss_sales_price#55 ELSE null END))] +Aggregate Attributes [6]: [sum(UnscaledValue(CASE WHEN (d_day_name#59 = Sunday ) THEN ss_sales_price#55 ELSE null END))#73, sum(UnscaledValue(CASE WHEN (d_day_name#59 = Monday ) THEN ss_sales_price#55 ELSE null END))#74, sum(UnscaledValue(CASE WHEN (d_day_name#59 = Wednesday) THEN ss_sales_price#55 ELSE null END))#75, sum(UnscaledValue(CASE WHEN (d_day_name#59 = Thursday ) THEN ss_sales_price#55 ELSE null END))#76, sum(UnscaledValue(CASE WHEN (d_day_name#59 = Friday ) THEN ss_sales_price#55 ELSE null END))#77, sum(UnscaledValue(CASE WHEN (d_day_name#59 = Saturday ) THEN ss_sales_price#55 ELSE null END))#78] +Results [8]: [d_week_seq#58, ss_store_sk#54, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#59 = Sunday ) THEN ss_sales_price#55 ELSE null END))#73,17,2) AS sun_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#59 = Monday ) THEN ss_sales_price#55 ELSE null END))#74,17,2) AS mon_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#59 = Wednesday) THEN ss_sales_price#55 ELSE null END))#75,17,2) AS wed_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#59 = Thursday ) THEN ss_sales_price#55 ELSE null END))#76,17,2) AS thu_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#59 = Friday ) THEN ss_sales_price#55 ELSE null END))#77,17,2) AS fri_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#59 = Saturday ) THEN ss_sales_price#55 ELSE null END))#78,17,2) AS sat_sales#36] + +(35) Scan parquet default.store +Output [2]: [s_store_sk#79, s_store_id#80] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_id)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 7] +Input [2]: [s_store_sk#79, s_store_id#80] + +(37) Filter [codegen id : 7] +Input [2]: [s_store_sk#79, s_store_id#80] +Condition : (isnotnull(s_store_sk#79) AND isnotnull(s_store_id#80)) + +(38) BroadcastExchange +Input [2]: [s_store_sk#79, s_store_id#80] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#81] + +(39) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#54] +Right keys [1]: [s_store_sk#79] +Join condition: None + +(40) Project [codegen id : 9] +Output [8]: [d_week_seq#58, sun_sales#30, mon_sales#31, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#80] +Input [10]: [d_week_seq#58, ss_store_sk#54, sun_sales#30, mon_sales#31, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_sk#79, s_store_id#80] + +(41) Scan parquet default.date_dim +Output [2]: [d_month_seq#82, d_week_seq#83] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1197), LessThanOrEqual(d_month_seq,1208), IsNotNull(d_week_seq)] +ReadSchema: struct + +(42) ColumnarToRow [codegen id : 8] +Input [2]: [d_month_seq#82, d_week_seq#83] + +(43) Filter [codegen id : 8] +Input [2]: [d_month_seq#82, d_week_seq#83] +Condition : (((isnotnull(d_month_seq#82) AND (d_month_seq#82 >= 1197)) AND (d_month_seq#82 <= 1208)) AND isnotnull(d_week_seq#83)) + +(44) Project [codegen id : 8] +Output [1]: [d_week_seq#83] +Input [2]: [d_month_seq#82, d_week_seq#83] + +(45) BroadcastExchange +Input [1]: [d_week_seq#83] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#84] + +(46) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [d_week_seq#58] +Right keys [1]: [d_week_seq#83] +Join condition: None + +(47) Project [codegen id : 9] +Output [8]: [d_week_seq#58 AS d_week_seq2#85, s_store_id#80 AS s_store_id2#86, sun_sales#30 AS sun_sales2#87, mon_sales#31 AS mon_sales2#88, wed_sales#33 AS wed_sales2#89, thu_sales#34 AS thu_sales2#90, fri_sales#35 AS fri_sales2#91, sat_sales#36 AS sat_sales2#92] +Input [9]: [d_week_seq#58, sun_sales#30, mon_sales#31, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#80, d_week_seq#83] + +(48) BroadcastExchange +Input [8]: [d_week_seq2#85, s_store_id2#86, sun_sales2#87, mon_sales2#88, wed_sales2#89, thu_sales2#90, fri_sales2#91, sat_sales2#92] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true], (input[0, int, true] - 52)),false), [id=#93] + +(49) BroadcastHashJoin [codegen id : 10] +Left keys [2]: [s_store_id1#46, d_week_seq1#45] +Right keys [2]: [s_store_id2#86, (d_week_seq2#85 - 52)] +Join condition: None + +(50) Project [codegen id : 10] +Output [10]: [s_store_name1#44, s_store_id1#46, d_week_seq1#45, CheckOverflow((promote_precision(sun_sales1#47) / promote_precision(sun_sales2#87)), DecimalType(37,20), true) AS (sun_sales1 / sun_sales2)#94, CheckOverflow((promote_precision(mon_sales1#48) / promote_precision(mon_sales2#88)), DecimalType(37,20), true) AS (mon_sales1 / mon_sales2)#95, CheckOverflow((promote_precision(tue_sales1#49) / promote_precision(tue_sales1#49)), DecimalType(37,20), true) AS (tue_sales1 / tue_sales1)#96, CheckOverflow((promote_precision(wed_sales1#50) / promote_precision(wed_sales2#89)), DecimalType(37,20), true) AS (wed_sales1 / wed_sales2)#97, CheckOverflow((promote_precision(thu_sales1#51) / promote_precision(thu_sales2#90)), DecimalType(37,20), true) AS (thu_sales1 / thu_sales2)#98, CheckOverflow((promote_precision(fri_sales1#52) / promote_precision(fri_sales2#91)), DecimalType(37,20), true) AS (fri_sales1 / fri_sales2)#99, CheckOverflow((promote_precision(sat_sales1#53) / promote_precision(sat_sales2#92)), DecimalType(37,20), true) AS (sat_sales1 / sat_sales2)#100] +Input [18]: [s_store_name1#44, d_week_seq1#45, s_store_id1#46, sun_sales1#47, mon_sales1#48, tue_sales1#49, wed_sales1#50, thu_sales1#51, fri_sales1#52, sat_sales1#53, d_week_seq2#85, s_store_id2#86, sun_sales2#87, mon_sales2#88, wed_sales2#89, thu_sales2#90, fri_sales2#91, sat_sales2#92] + +(51) TakeOrderedAndProject +Input [10]: [s_store_name1#44, s_store_id1#46, d_week_seq1#45, (sun_sales1 / sun_sales2)#94, (mon_sales1 / mon_sales2)#95, (tue_sales1 / tue_sales1)#96, (wed_sales1 / wed_sales2)#97, (thu_sales1 / thu_sales2)#98, (fri_sales1 / fri_sales2)#99, (sat_sales1 / sat_sales2)#100] +Arguments: 100, [s_store_name1#44 ASC NULLS FIRST, s_store_id1#46 ASC NULLS FIRST, d_week_seq1#45 ASC NULLS FIRST], [s_store_name1#44, s_store_id1#46, d_week_seq1#45, (sun_sales1 / sun_sales2)#94, (mon_sales1 / mon_sales2)#95, (tue_sales1 / tue_sales1)#96, (wed_sales1 / wed_sales2)#97, (thu_sales1 / thu_sales2)#98, (fri_sales1 / fri_sales2)#99, (sat_sales1 / sat_sales2)#100] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59.sf100/simplified.txt new file mode 100644 index 0000000000000..eae7970dd89a0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59.sf100/simplified.txt @@ -0,0 +1,76 @@ +TakeOrderedAndProject [s_store_name1,s_store_id1,d_week_seq1,(sun_sales1 / sun_sales2),(mon_sales1 / mon_sales2),(tue_sales1 / tue_sales1),(wed_sales1 / wed_sales2),(thu_sales1 / thu_sales2),(fri_sales1 / fri_sales2),(sat_sales1 / sat_sales2)] + WholeStageCodegen (10) + Project [s_store_name1,s_store_id1,d_week_seq1,sun_sales1,sun_sales2,mon_sales1,mon_sales2,tue_sales1,wed_sales1,wed_sales2,thu_sales1,thu_sales2,fri_sales1,fri_sales2,sat_sales1,sat_sales2] + BroadcastHashJoin [s_store_id1,d_week_seq1,s_store_id2,d_week_seq2] + Project [s_store_name,d_week_seq,s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + BroadcastHashJoin [d_week_seq,d_week_seq] + Project [d_week_seq,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,s_store_id,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + HashAggregate [d_week_seq,ss_store_sk,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN ss_sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + Exchange [d_week_seq,ss_store_sk] #1 + WholeStageCodegen (2) + HashAggregate [d_week_seq,ss_store_sk,d_day_name,ss_sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [ss_store_sk,ss_sales_price,d_week_seq,d_day_name] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [d_date_sk,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq,d_day_name] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (3) + Filter [s_store_sk,s_store_id] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id,s_store_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [d_week_seq] + Filter [d_month_seq,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_week_seq] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + Project [d_week_seq,s_store_id,sun_sales,mon_sales,wed_sales,thu_sales,fri_sales,sat_sales] + BroadcastHashJoin [d_week_seq,d_week_seq] + Project [d_week_seq,sun_sales,mon_sales,wed_sales,thu_sales,fri_sales,sat_sales,s_store_id] + BroadcastHashJoin [ss_store_sk,s_store_sk] + HashAggregate [d_week_seq,ss_store_sk,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN ss_sales_price ELSE null END)),sun_sales,mon_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum] + InputAdapter + Exchange [d_week_seq,ss_store_sk] #6 + WholeStageCodegen (6) + HashAggregate [d_week_seq,ss_store_sk,d_day_name,ss_sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [ss_store_sk,ss_sales_price,d_week_seq,d_day_name] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_sales_price,ss_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_week_seq,d_day_name] #2 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (7) + Filter [s_store_sk,s_store_id] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (8) + Project [d_week_seq] + Filter [d_month_seq,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_week_seq] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59/explain.txt new file mode 100644 index 0000000000000..d20f7cf4a2857 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59/explain.txt @@ -0,0 +1,292 @@ +== Physical Plan == +TakeOrderedAndProject (51) ++- * Project (50) + +- * BroadcastHashJoin Inner BuildRight (49) + :- * Project (25) + : +- * BroadcastHashJoin Inner BuildRight (24) + : :- * Project (18) + : : +- * BroadcastHashJoin Inner BuildRight (17) + : : :- * HashAggregate (12) + : : : +- Exchange (11) + : : : +- * HashAggregate (10) + : : : +- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.store (13) + : +- BroadcastExchange (23) + : +- * Project (22) + : +- * Filter (21) + : +- * ColumnarToRow (20) + : +- Scan parquet default.date_dim (19) + +- BroadcastExchange (48) + +- * Project (47) + +- * BroadcastHashJoin Inner BuildRight (46) + :- * Project (40) + : +- * BroadcastHashJoin Inner BuildRight (39) + : :- * HashAggregate (34) + : : +- Exchange (33) + : : +- * HashAggregate (32) + : : +- * Project (31) + : : +- * BroadcastHashJoin Inner BuildRight (30) + : : :- * Filter (28) + : : : +- * ColumnarToRow (27) + : : : +- Scan parquet default.store_sales (26) + : : +- ReusedExchange (29) + : +- BroadcastExchange (38) + : +- * Filter (37) + : +- * ColumnarToRow (36) + : +- Scan parquet default.store (35) + +- BroadcastExchange (45) + +- * Project (44) + +- * Filter (43) + +- * ColumnarToRow (42) + +- Scan parquet default.date_dim (41) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] +Condition : (isnotnull(d_date_sk#4) AND isnotnull(d_week_seq#5)) + +(7) BroadcastExchange +Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#4] +Join condition: None + +(9) Project [codegen id : 2] +Output [4]: [ss_store_sk#1, ss_sales_price#2, d_week_seq#5, d_day_name#6] +Input [6]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3, d_date_sk#4, d_week_seq#5, d_day_name#6] + +(10) HashAggregate [codegen id : 2] +Input [4]: [ss_store_sk#1, ss_sales_price#2, d_week_seq#5, d_day_name#6] +Keys [2]: [d_week_seq#5, ss_store_sk#1] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))] +Aggregate Attributes [7]: [sum#8, sum#9, sum#10, sum#11, sum#12, sum#13, sum#14] +Results [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] + +(11) Exchange +Input [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] +Arguments: hashpartitioning(d_week_seq#5, ss_store_sk#1, 5), ENSURE_REQUIREMENTS, [id=#22] + +(12) HashAggregate [codegen id : 10] +Input [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] +Keys [2]: [d_week_seq#5, ss_store_sk#1] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END))#23, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END))#24, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END))#25, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END))#26, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))#29] +Results [9]: [d_week_seq#5, ss_store_sk#1, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END))#23,17,2) AS sun_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END))#24,17,2) AS mon_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END))#25,17,2) AS tue_sales#32, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END))#26,17,2) AS wed_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END))#27,17,2) AS thu_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END))#28,17,2) AS fri_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))#29,17,2) AS sat_sales#36] + +(13) Scan parquet default.store +Output [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_id)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 3] +Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] + +(15) Filter [codegen id : 3] +Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] +Condition : (isnotnull(s_store_sk#37) AND isnotnull(s_store_id#38)) + +(16) BroadcastExchange +Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40] + +(17) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#37] +Join condition: None + +(18) Project [codegen id : 10] +Output [10]: [d_week_seq#5, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#38, s_store_name#39] +Input [12]: [d_week_seq#5, ss_store_sk#1, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_sk#37, s_store_id#38, s_store_name#39] + +(19) Scan parquet default.date_dim +Output [2]: [d_month_seq#41, d_week_seq#42] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1185), LessThanOrEqual(d_month_seq,1196), IsNotNull(d_week_seq)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 4] +Input [2]: [d_month_seq#41, d_week_seq#42] + +(21) Filter [codegen id : 4] +Input [2]: [d_month_seq#41, d_week_seq#42] +Condition : (((isnotnull(d_month_seq#41) AND (d_month_seq#41 >= 1185)) AND (d_month_seq#41 <= 1196)) AND isnotnull(d_week_seq#42)) + +(22) Project [codegen id : 4] +Output [1]: [d_week_seq#42] +Input [2]: [d_month_seq#41, d_week_seq#42] + +(23) BroadcastExchange +Input [1]: [d_week_seq#42] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#43] + +(24) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [d_week_seq#5] +Right keys [1]: [d_week_seq#42] +Join condition: None + +(25) Project [codegen id : 10] +Output [10]: [s_store_name#39 AS s_store_name1#44, d_week_seq#5 AS d_week_seq1#45, s_store_id#38 AS s_store_id1#46, sun_sales#30 AS sun_sales1#47, mon_sales#31 AS mon_sales1#48, tue_sales#32 AS tue_sales1#49, wed_sales#33 AS wed_sales1#50, thu_sales#34 AS thu_sales1#51, fri_sales#35 AS fri_sales1#52, sat_sales#36 AS sat_sales1#53] +Input [11]: [d_week_seq#5, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#38, s_store_name#39, d_week_seq#42] + +(26) Scan parquet default.store_sales +Output [3]: [ss_store_sk#54, ss_sales_price#55, ss_sold_date_sk#56] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#56)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 6] +Input [3]: [ss_store_sk#54, ss_sales_price#55, ss_sold_date_sk#56] + +(28) Filter [codegen id : 6] +Input [3]: [ss_store_sk#54, ss_sales_price#55, ss_sold_date_sk#56] +Condition : isnotnull(ss_store_sk#54) + +(29) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#57, d_week_seq#58, d_day_name#59] + +(30) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#56] +Right keys [1]: [d_date_sk#57] +Join condition: None + +(31) Project [codegen id : 6] +Output [4]: [ss_store_sk#54, ss_sales_price#55, d_week_seq#58, d_day_name#59] +Input [6]: [ss_store_sk#54, ss_sales_price#55, ss_sold_date_sk#56, d_date_sk#57, d_week_seq#58, d_day_name#59] + +(32) HashAggregate [codegen id : 6] +Input [4]: [ss_store_sk#54, ss_sales_price#55, d_week_seq#58, d_day_name#59] +Keys [2]: [d_week_seq#58, ss_store_sk#54] +Functions [6]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#59 = Sunday ) THEN ss_sales_price#55 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#59 = Monday ) THEN ss_sales_price#55 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#59 = Wednesday) THEN ss_sales_price#55 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#59 = Thursday ) THEN ss_sales_price#55 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#59 = Friday ) THEN ss_sales_price#55 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#59 = Saturday ) THEN ss_sales_price#55 ELSE null END))] +Aggregate Attributes [6]: [sum#60, sum#61, sum#62, sum#63, sum#64, sum#65] +Results [8]: [d_week_seq#58, ss_store_sk#54, sum#66, sum#67, sum#68, sum#69, sum#70, sum#71] + +(33) Exchange +Input [8]: [d_week_seq#58, ss_store_sk#54, sum#66, sum#67, sum#68, sum#69, sum#70, sum#71] +Arguments: hashpartitioning(d_week_seq#58, ss_store_sk#54, 5), ENSURE_REQUIREMENTS, [id=#72] + +(34) HashAggregate [codegen id : 9] +Input [8]: [d_week_seq#58, ss_store_sk#54, sum#66, sum#67, sum#68, sum#69, sum#70, sum#71] +Keys [2]: [d_week_seq#58, ss_store_sk#54] +Functions [6]: [sum(UnscaledValue(CASE WHEN (d_day_name#59 = Sunday ) THEN ss_sales_price#55 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#59 = Monday ) THEN ss_sales_price#55 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#59 = Wednesday) THEN ss_sales_price#55 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#59 = Thursday ) THEN ss_sales_price#55 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#59 = Friday ) THEN ss_sales_price#55 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#59 = Saturday ) THEN ss_sales_price#55 ELSE null END))] +Aggregate Attributes [6]: [sum(UnscaledValue(CASE WHEN (d_day_name#59 = Sunday ) THEN ss_sales_price#55 ELSE null END))#73, sum(UnscaledValue(CASE WHEN (d_day_name#59 = Monday ) THEN ss_sales_price#55 ELSE null END))#74, sum(UnscaledValue(CASE WHEN (d_day_name#59 = Wednesday) THEN ss_sales_price#55 ELSE null END))#75, sum(UnscaledValue(CASE WHEN (d_day_name#59 = Thursday ) THEN ss_sales_price#55 ELSE null END))#76, sum(UnscaledValue(CASE WHEN (d_day_name#59 = Friday ) THEN ss_sales_price#55 ELSE null END))#77, sum(UnscaledValue(CASE WHEN (d_day_name#59 = Saturday ) THEN ss_sales_price#55 ELSE null END))#78] +Results [8]: [d_week_seq#58, ss_store_sk#54, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#59 = Sunday ) THEN ss_sales_price#55 ELSE null END))#73,17,2) AS sun_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#59 = Monday ) THEN ss_sales_price#55 ELSE null END))#74,17,2) AS mon_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#59 = Wednesday) THEN ss_sales_price#55 ELSE null END))#75,17,2) AS wed_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#59 = Thursday ) THEN ss_sales_price#55 ELSE null END))#76,17,2) AS thu_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#59 = Friday ) THEN ss_sales_price#55 ELSE null END))#77,17,2) AS fri_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#59 = Saturday ) THEN ss_sales_price#55 ELSE null END))#78,17,2) AS sat_sales#36] + +(35) Scan parquet default.store +Output [2]: [s_store_sk#79, s_store_id#80] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_id)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 7] +Input [2]: [s_store_sk#79, s_store_id#80] + +(37) Filter [codegen id : 7] +Input [2]: [s_store_sk#79, s_store_id#80] +Condition : (isnotnull(s_store_sk#79) AND isnotnull(s_store_id#80)) + +(38) BroadcastExchange +Input [2]: [s_store_sk#79, s_store_id#80] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#81] + +(39) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#54] +Right keys [1]: [s_store_sk#79] +Join condition: None + +(40) Project [codegen id : 9] +Output [8]: [d_week_seq#58, sun_sales#30, mon_sales#31, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#80] +Input [10]: [d_week_seq#58, ss_store_sk#54, sun_sales#30, mon_sales#31, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_sk#79, s_store_id#80] + +(41) Scan parquet default.date_dim +Output [2]: [d_month_seq#82, d_week_seq#83] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1197), LessThanOrEqual(d_month_seq,1208), IsNotNull(d_week_seq)] +ReadSchema: struct + +(42) ColumnarToRow [codegen id : 8] +Input [2]: [d_month_seq#82, d_week_seq#83] + +(43) Filter [codegen id : 8] +Input [2]: [d_month_seq#82, d_week_seq#83] +Condition : (((isnotnull(d_month_seq#82) AND (d_month_seq#82 >= 1197)) AND (d_month_seq#82 <= 1208)) AND isnotnull(d_week_seq#83)) + +(44) Project [codegen id : 8] +Output [1]: [d_week_seq#83] +Input [2]: [d_month_seq#82, d_week_seq#83] + +(45) BroadcastExchange +Input [1]: [d_week_seq#83] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#84] + +(46) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [d_week_seq#58] +Right keys [1]: [d_week_seq#83] +Join condition: None + +(47) Project [codegen id : 9] +Output [8]: [d_week_seq#58 AS d_week_seq2#85, s_store_id#80 AS s_store_id2#86, sun_sales#30 AS sun_sales2#87, mon_sales#31 AS mon_sales2#88, wed_sales#33 AS wed_sales2#89, thu_sales#34 AS thu_sales2#90, fri_sales#35 AS fri_sales2#91, sat_sales#36 AS sat_sales2#92] +Input [9]: [d_week_seq#58, sun_sales#30, mon_sales#31, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#80, d_week_seq#83] + +(48) BroadcastExchange +Input [8]: [d_week_seq2#85, s_store_id2#86, sun_sales2#87, mon_sales2#88, wed_sales2#89, thu_sales2#90, fri_sales2#91, sat_sales2#92] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true], (input[0, int, true] - 52)),false), [id=#93] + +(49) BroadcastHashJoin [codegen id : 10] +Left keys [2]: [s_store_id1#46, d_week_seq1#45] +Right keys [2]: [s_store_id2#86, (d_week_seq2#85 - 52)] +Join condition: None + +(50) Project [codegen id : 10] +Output [10]: [s_store_name1#44, s_store_id1#46, d_week_seq1#45, CheckOverflow((promote_precision(sun_sales1#47) / promote_precision(sun_sales2#87)), DecimalType(37,20), true) AS (sun_sales1 / sun_sales2)#94, CheckOverflow((promote_precision(mon_sales1#48) / promote_precision(mon_sales2#88)), DecimalType(37,20), true) AS (mon_sales1 / mon_sales2)#95, CheckOverflow((promote_precision(tue_sales1#49) / promote_precision(tue_sales1#49)), DecimalType(37,20), true) AS (tue_sales1 / tue_sales1)#96, CheckOverflow((promote_precision(wed_sales1#50) / promote_precision(wed_sales2#89)), DecimalType(37,20), true) AS (wed_sales1 / wed_sales2)#97, CheckOverflow((promote_precision(thu_sales1#51) / promote_precision(thu_sales2#90)), DecimalType(37,20), true) AS (thu_sales1 / thu_sales2)#98, CheckOverflow((promote_precision(fri_sales1#52) / promote_precision(fri_sales2#91)), DecimalType(37,20), true) AS (fri_sales1 / fri_sales2)#99, CheckOverflow((promote_precision(sat_sales1#53) / promote_precision(sat_sales2#92)), DecimalType(37,20), true) AS (sat_sales1 / sat_sales2)#100] +Input [18]: [s_store_name1#44, d_week_seq1#45, s_store_id1#46, sun_sales1#47, mon_sales1#48, tue_sales1#49, wed_sales1#50, thu_sales1#51, fri_sales1#52, sat_sales1#53, d_week_seq2#85, s_store_id2#86, sun_sales2#87, mon_sales2#88, wed_sales2#89, thu_sales2#90, fri_sales2#91, sat_sales2#92] + +(51) TakeOrderedAndProject +Input [10]: [s_store_name1#44, s_store_id1#46, d_week_seq1#45, (sun_sales1 / sun_sales2)#94, (mon_sales1 / mon_sales2)#95, (tue_sales1 / tue_sales1)#96, (wed_sales1 / wed_sales2)#97, (thu_sales1 / thu_sales2)#98, (fri_sales1 / fri_sales2)#99, (sat_sales1 / sat_sales2)#100] +Arguments: 100, [s_store_name1#44 ASC NULLS FIRST, s_store_id1#46 ASC NULLS FIRST, d_week_seq1#45 ASC NULLS FIRST], [s_store_name1#44, s_store_id1#46, d_week_seq1#45, (sun_sales1 / sun_sales2)#94, (mon_sales1 / mon_sales2)#95, (tue_sales1 / tue_sales1)#96, (wed_sales1 / wed_sales2)#97, (thu_sales1 / thu_sales2)#98, (fri_sales1 / fri_sales2)#99, (sat_sales1 / sat_sales2)#100] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59/simplified.txt new file mode 100644 index 0000000000000..eae7970dd89a0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q59/simplified.txt @@ -0,0 +1,76 @@ +TakeOrderedAndProject [s_store_name1,s_store_id1,d_week_seq1,(sun_sales1 / sun_sales2),(mon_sales1 / mon_sales2),(tue_sales1 / tue_sales1),(wed_sales1 / wed_sales2),(thu_sales1 / thu_sales2),(fri_sales1 / fri_sales2),(sat_sales1 / sat_sales2)] + WholeStageCodegen (10) + Project [s_store_name1,s_store_id1,d_week_seq1,sun_sales1,sun_sales2,mon_sales1,mon_sales2,tue_sales1,wed_sales1,wed_sales2,thu_sales1,thu_sales2,fri_sales1,fri_sales2,sat_sales1,sat_sales2] + BroadcastHashJoin [s_store_id1,d_week_seq1,s_store_id2,d_week_seq2] + Project [s_store_name,d_week_seq,s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + BroadcastHashJoin [d_week_seq,d_week_seq] + Project [d_week_seq,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,s_store_id,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + HashAggregate [d_week_seq,ss_store_sk,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN ss_sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + Exchange [d_week_seq,ss_store_sk] #1 + WholeStageCodegen (2) + HashAggregate [d_week_seq,ss_store_sk,d_day_name,ss_sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [ss_store_sk,ss_sales_price,d_week_seq,d_day_name] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [d_date_sk,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq,d_day_name] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (3) + Filter [s_store_sk,s_store_id] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id,s_store_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [d_week_seq] + Filter [d_month_seq,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_week_seq] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + Project [d_week_seq,s_store_id,sun_sales,mon_sales,wed_sales,thu_sales,fri_sales,sat_sales] + BroadcastHashJoin [d_week_seq,d_week_seq] + Project [d_week_seq,sun_sales,mon_sales,wed_sales,thu_sales,fri_sales,sat_sales,s_store_id] + BroadcastHashJoin [ss_store_sk,s_store_sk] + HashAggregate [d_week_seq,ss_store_sk,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN ss_sales_price ELSE null END)),sun_sales,mon_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum] + InputAdapter + Exchange [d_week_seq,ss_store_sk] #6 + WholeStageCodegen (6) + HashAggregate [d_week_seq,ss_store_sk,d_day_name,ss_sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [ss_store_sk,ss_sales_price,d_week_seq,d_day_name] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_sales_price,ss_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_week_seq,d_day_name] #2 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (7) + Filter [s_store_sk,s_store_id] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (8) + Project [d_week_seq] + Filter [d_month_seq,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_week_seq] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt new file mode 100644 index 0000000000000..75cdaecea7595 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * Project (31) + +- * Filter (30) + +- Window (29) + +- * Sort (28) + +- Exchange (27) + +- * HashAggregate (26) + +- Exchange (25) + +- * HashAggregate (24) + +- * Project (23) + +- * BroadcastHashJoin Inner BuildRight (22) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.store_sales (6) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.store (11) + +- BroadcastExchange (21) + +- * Project (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.date_dim (17) + + +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books ,Children ,Electronics ]),In(i_class, [personal ,portable ,reference ,self-help ])),In(i_brand, [scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 ])),And(And(In(i_category, [Women ,Music ,Men ]),In(i_class, [accessories ,classical ,fragrances ,pants ])),In(i_brand, [amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] + +(3) Filter [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +Condition : ((((i_category#4 IN (Books ,Children ,Electronics ) AND i_class#3 IN (personal ,portable ,reference ,self-help )) AND i_brand#2 IN (scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 )) OR ((i_category#4 IN (Women ,Music ,Men ) AND i_class#3 IN (accessories ,classical ,fragrances ,pants )) AND i_brand#2 IN (amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ))) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [i_item_sk#1, i_manager_id#5] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] + +(5) BroadcastExchange +Input [2]: [i_item_sk#1, i_manager_id#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(6) Scan parquet default.store_sales +Output [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#14), (ss_sold_date_sk#14 >= 2452123), (ss_sold_date_sk#14 <= 2452487), dynamicpruningexpression(ss_sold_date_sk#14 IN dynamicpruning#15)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] + +(8) Filter +Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] +Condition : (isnotnull(ss_item_sk#11) AND isnotnull(ss_store_sk#12)) + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#11] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [i_manager_id#5, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] +Input [6]: [i_item_sk#1, i_manager_id#5, ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] + +(11) Scan parquet default.store +Output [1]: [s_store_sk#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [1]: [s_store_sk#16] + +(13) Filter [codegen id : 2] +Input [1]: [s_store_sk#16] +Condition : isnotnull(s_store_sk#16) + +(14) BroadcastExchange +Input [1]: [s_store_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#12] +Right keys [1]: [s_store_sk#16] +Join condition: None + +(16) Project [codegen id : 4] +Output [3]: [i_manager_id#5, ss_sales_price#13, ss_sold_date_sk#14] +Input [5]: [i_manager_id#5, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14, s_store_sk#16] + +(17) Scan parquet default.date_dim +Output [3]: [d_date_sk#18, d_month_seq#19, d_moy#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_month_seq, [1222,1228,1223,1227,1219,1226,1224,1225,1230,1220,1221,1229]), GreaterThanOrEqual(d_date_sk,2452123), LessThanOrEqual(d_date_sk,2452487), IsNotNull(d_date_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#18, d_month_seq#19, d_moy#20] + +(19) Filter [codegen id : 3] +Input [3]: [d_date_sk#18, d_month_seq#19, d_moy#20] +Condition : (((d_month_seq#19 INSET (1222,1228,1223,1227,1219,1226,1224,1225,1230,1220,1221,1229) AND (d_date_sk#18 >= 2452123)) AND (d_date_sk#18 <= 2452487)) AND isnotnull(d_date_sk#18)) + +(20) Project [codegen id : 3] +Output [2]: [d_date_sk#18, d_moy#20] +Input [3]: [d_date_sk#18, d_month_seq#19, d_moy#20] + +(21) BroadcastExchange +Input [2]: [d_date_sk#18, d_moy#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#14] +Right keys [1]: [d_date_sk#18] +Join condition: None + +(23) Project [codegen id : 4] +Output [3]: [i_manager_id#5, ss_sales_price#13, d_moy#20] +Input [5]: [i_manager_id#5, ss_sales_price#13, ss_sold_date_sk#14, d_date_sk#18, d_moy#20] + +(24) HashAggregate [codegen id : 4] +Input [3]: [i_manager_id#5, ss_sales_price#13, d_moy#20] +Keys [2]: [i_manager_id#5, d_moy#20] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#13))] +Aggregate Attributes [1]: [sum#22] +Results [3]: [i_manager_id#5, d_moy#20, sum#23] + +(25) Exchange +Input [3]: [i_manager_id#5, d_moy#20, sum#23] +Arguments: hashpartitioning(i_manager_id#5, d_moy#20, 5), ENSURE_REQUIREMENTS, [id=#24] + +(26) HashAggregate [codegen id : 5] +Input [3]: [i_manager_id#5, d_moy#20, sum#23] +Keys [2]: [i_manager_id#5, d_moy#20] +Functions [1]: [sum(UnscaledValue(ss_sales_price#13))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#13))#25] +Results [3]: [i_manager_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#25,17,2) AS sum_sales#26, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#25,17,2) AS _w0#27] + +(27) Exchange +Input [3]: [i_manager_id#5, sum_sales#26, _w0#27] +Arguments: hashpartitioning(i_manager_id#5, 5), ENSURE_REQUIREMENTS, [id=#28] + +(28) Sort [codegen id : 6] +Input [3]: [i_manager_id#5, sum_sales#26, _w0#27] +Arguments: [i_manager_id#5 ASC NULLS FIRST], false, 0 + +(29) Window +Input [3]: [i_manager_id#5, sum_sales#26, _w0#27] +Arguments: [avg(_w0#27) windowspecdefinition(i_manager_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#29], [i_manager_id#5] + +(30) Filter [codegen id : 7] +Input [4]: [i_manager_id#5, sum_sales#26, _w0#27, avg_monthly_sales#29] +Condition : (isnotnull(avg_monthly_sales#29) AND ((avg_monthly_sales#29 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#26 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#29 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#29 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000))) + +(31) Project [codegen id : 7] +Output [3]: [i_manager_id#5, sum_sales#26, avg_monthly_sales#29] +Input [4]: [i_manager_id#5, sum_sales#26, _w0#27, avg_monthly_sales#29] + +(32) TakeOrderedAndProject +Input [3]: [i_manager_id#5, sum_sales#26, avg_monthly_sales#29] +Arguments: 100, [i_manager_id#5 ASC NULLS FIRST, avg_monthly_sales#29 ASC NULLS FIRST, sum_sales#26 ASC NULLS FIRST], [i_manager_id#5, sum_sales#26, avg_monthly_sales#29] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#14 IN dynamicpruning#15 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 21] +Output [2]: [d_date_sk#18, d_moy#20] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/simplified.txt new file mode 100644 index 0000000000000..d8e6d0dcef768 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63.sf100/simplified.txt @@ -0,0 +1,51 @@ +TakeOrderedAndProject [i_manager_id,avg_monthly_sales,sum_sales] + WholeStageCodegen (7) + Project [i_manager_id,sum_sales,avg_monthly_sales] + Filter [avg_monthly_sales,sum_sales] + InputAdapter + Window [_w0,i_manager_id] + WholeStageCodegen (6) + Sort [i_manager_id] + InputAdapter + Exchange [i_manager_id] #1 + WholeStageCodegen (5) + HashAggregate [i_manager_id,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_manager_id,d_moy] #2 + WholeStageCodegen (4) + HashAggregate [i_manager_id,d_moy,ss_sales_price] [sum,sum] + Project [i_manager_id,ss_sales_price,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_manager_id,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_manager_id,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_manager_id] + Filter [i_category,i_class,i_brand,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manager_id] + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_moy] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [d_date_sk,d_moy] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq,d_moy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63/explain.txt new file mode 100644 index 0000000000000..c8e0821dfacda --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * Project (31) + +- * Filter (30) + +- Window (29) + +- * Sort (28) + +- Exchange (27) + +- * HashAggregate (26) + +- Exchange (25) + +- * HashAggregate (24) + +- * Project (23) + +- * BroadcastHashJoin Inner BuildRight (22) + :- * Project (17) + : +- * BroadcastHashJoin Inner BuildRight (16) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- BroadcastExchange (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.store_sales (5) + : +- BroadcastExchange (15) + : +- * Project (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.date_dim (11) + +- BroadcastExchange (21) + +- * Filter (20) + +- * ColumnarToRow (19) + +- Scan parquet default.store (18) + + +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books ,Children ,Electronics ]),In(i_class, [personal ,portable ,reference ,self-help ])),In(i_brand, [scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 ])),And(And(In(i_category, [Women ,Music ,Men ]),In(i_class, [accessories ,classical ,fragrances ,pants ])),In(i_brand, [amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] + +(3) Filter [codegen id : 4] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +Condition : ((((i_category#4 IN (Books ,Children ,Electronics ) AND i_class#3 IN (personal ,portable ,reference ,self-help )) AND i_brand#2 IN (scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 )) OR ((i_category#4 IN (Women ,Music ,Men ) AND i_class#3 IN (accessories ,classical ,fragrances ,pants )) AND i_brand#2 IN (amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ))) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 4] +Output [2]: [i_item_sk#1, i_manager_id#5] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] + +(5) Scan parquet default.store_sales +Output [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#13), (ss_sold_date_sk#13 >= 2452123), (ss_sold_date_sk#13 <= 2452487), dynamicpruningexpression(ss_sold_date_sk#13 IN dynamicpruning#14)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] + +(7) Filter [codegen id : 1] +Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Condition : (isnotnull(ss_item_sk#10) AND isnotnull(ss_store_sk#11)) + +(8) BroadcastExchange +Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#10] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Input [6]: [i_item_sk#1, i_manager_id#5, ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] + +(11) Scan parquet default.date_dim +Output [3]: [d_date_sk#16, d_month_seq#17, d_moy#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_month_seq, [1222,1228,1223,1227,1219,1226,1224,1225,1230,1220,1221,1229]), GreaterThanOrEqual(d_date_sk,2452123), LessThanOrEqual(d_date_sk,2452487), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#16, d_month_seq#17, d_moy#18] + +(13) Filter [codegen id : 2] +Input [3]: [d_date_sk#16, d_month_seq#17, d_moy#18] +Condition : (((d_month_seq#17 INSET (1222,1228,1223,1227,1219,1226,1224,1225,1230,1220,1221,1229) AND (d_date_sk#16 >= 2452123)) AND (d_date_sk#16 <= 2452487)) AND isnotnull(d_date_sk#16)) + +(14) Project [codegen id : 2] +Output [2]: [d_date_sk#16, d_moy#18] +Input [3]: [d_date_sk#16, d_month_seq#17, d_moy#18] + +(15) BroadcastExchange +Input [2]: [d_date_sk#16, d_moy#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#13] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(17) Project [codegen id : 4] +Output [4]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, d_moy#18] +Input [6]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13, d_date_sk#16, d_moy#18] + +(18) Scan parquet default.store +Output [1]: [s_store_sk#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [1]: [s_store_sk#20] + +(20) Filter [codegen id : 3] +Input [1]: [s_store_sk#20] +Condition : isnotnull(s_store_sk#20) + +(21) BroadcastExchange +Input [1]: [s_store_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#11] +Right keys [1]: [s_store_sk#20] +Join condition: None + +(23) Project [codegen id : 4] +Output [3]: [i_manager_id#5, ss_sales_price#12, d_moy#18] +Input [5]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, d_moy#18, s_store_sk#20] + +(24) HashAggregate [codegen id : 4] +Input [3]: [i_manager_id#5, ss_sales_price#12, d_moy#18] +Keys [2]: [i_manager_id#5, d_moy#18] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#12))] +Aggregate Attributes [1]: [sum#22] +Results [3]: [i_manager_id#5, d_moy#18, sum#23] + +(25) Exchange +Input [3]: [i_manager_id#5, d_moy#18, sum#23] +Arguments: hashpartitioning(i_manager_id#5, d_moy#18, 5), ENSURE_REQUIREMENTS, [id=#24] + +(26) HashAggregate [codegen id : 5] +Input [3]: [i_manager_id#5, d_moy#18, sum#23] +Keys [2]: [i_manager_id#5, d_moy#18] +Functions [1]: [sum(UnscaledValue(ss_sales_price#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#12))#25] +Results [3]: [i_manager_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#25,17,2) AS sum_sales#26, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#25,17,2) AS _w0#27] + +(27) Exchange +Input [3]: [i_manager_id#5, sum_sales#26, _w0#27] +Arguments: hashpartitioning(i_manager_id#5, 5), ENSURE_REQUIREMENTS, [id=#28] + +(28) Sort [codegen id : 6] +Input [3]: [i_manager_id#5, sum_sales#26, _w0#27] +Arguments: [i_manager_id#5 ASC NULLS FIRST], false, 0 + +(29) Window +Input [3]: [i_manager_id#5, sum_sales#26, _w0#27] +Arguments: [avg(_w0#27) windowspecdefinition(i_manager_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#29], [i_manager_id#5] + +(30) Filter [codegen id : 7] +Input [4]: [i_manager_id#5, sum_sales#26, _w0#27, avg_monthly_sales#29] +Condition : (isnotnull(avg_monthly_sales#29) AND ((avg_monthly_sales#29 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#26 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#29 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#29 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000))) + +(31) Project [codegen id : 7] +Output [3]: [i_manager_id#5, sum_sales#26, avg_monthly_sales#29] +Input [4]: [i_manager_id#5, sum_sales#26, _w0#27, avg_monthly_sales#29] + +(32) TakeOrderedAndProject +Input [3]: [i_manager_id#5, sum_sales#26, avg_monthly_sales#29] +Arguments: 100, [i_manager_id#5 ASC NULLS FIRST, avg_monthly_sales#29 ASC NULLS FIRST, sum_sales#26 ASC NULLS FIRST], [i_manager_id#5, sum_sales#26, avg_monthly_sales#29] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 5 Hosting Expression = ss_sold_date_sk#13 IN dynamicpruning#14 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 15] +Output [2]: [d_date_sk#16, d_moy#18] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63/simplified.txt new file mode 100644 index 0000000000000..4d85c6d1f57a3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q63/simplified.txt @@ -0,0 +1,51 @@ +TakeOrderedAndProject [i_manager_id,avg_monthly_sales,sum_sales] + WholeStageCodegen (7) + Project [i_manager_id,sum_sales,avg_monthly_sales] + Filter [avg_monthly_sales,sum_sales] + InputAdapter + Window [_w0,i_manager_id] + WholeStageCodegen (6) + Sort [i_manager_id] + InputAdapter + Exchange [i_manager_id] #1 + WholeStageCodegen (5) + HashAggregate [i_manager_id,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_manager_id,d_moy] #2 + WholeStageCodegen (4) + HashAggregate [i_manager_id,d_moy,ss_sales_price] [sum,sum] + Project [i_manager_id,ss_sales_price,d_moy] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_manager_id,ss_store_sk,ss_sales_price,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_manager_id,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [i_item_sk,i_manager_id] + Filter [i_category,i_class,i_brand,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manager_id] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_moy] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk,d_moy] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq,d_moy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt new file mode 100644 index 0000000000000..240f579025038 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/explain.txt @@ -0,0 +1,259 @@ +== Physical Plan == +TakeOrderedAndProject (42) ++- * Project (41) + +- * BroadcastHashJoin Inner BuildLeft (40) + :- BroadcastExchange (36) + : +- * Project (35) + : +- * BroadcastHashJoin Inner BuildLeft (34) + : :- BroadcastExchange (30) + : : +- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Filter (14) + : : : +- * HashAggregate (13) + : : : +- Exchange (12) + : : : +- * HashAggregate (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (27) + : : +- * HashAggregate (26) + : : +- Exchange (25) + : : +- * HashAggregate (24) + : : +- * HashAggregate (23) + : : +- Exchange (22) + : : +- * HashAggregate (21) + : : +- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Filter (17) + : : : +- * ColumnarToRow (16) + : : : +- Scan parquet default.store_sales (15) + : : +- ReusedExchange (18) + : +- * Filter (33) + : +- * ColumnarToRow (32) + : +- Scan parquet default.store (31) + +- * Filter (39) + +- * ColumnarToRow (38) + +- Scan parquet default.item (37) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), (ss_sold_date_sk#4 >= 2451911), (ss_sold_date_sk#4 <= 2452275), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 2] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_month_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2452275), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] +Condition : (((((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1212)) AND (d_month_seq#7 <= 1223)) AND (d_date_sk#6 >= 2451911)) AND (d_date_sk#6 <= 2452275)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_month_seq#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 2] +Output [3]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4, d_date_sk#6] + +(11) HashAggregate [codegen id : 2] +Input [3]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3] +Keys [2]: [ss_store_sk#2, ss_item_sk#1] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#3))] +Aggregate Attributes [1]: [sum#9] +Results [3]: [ss_store_sk#2, ss_item_sk#1, sum#10] + +(12) Exchange +Input [3]: [ss_store_sk#2, ss_item_sk#1, sum#10] +Arguments: hashpartitioning(ss_store_sk#2, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#11] + +(13) HashAggregate [codegen id : 7] +Input [3]: [ss_store_sk#2, ss_item_sk#1, sum#10] +Keys [2]: [ss_store_sk#2, ss_item_sk#1] +Functions [1]: [sum(UnscaledValue(ss_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#3))#12] +Results [3]: [ss_store_sk#2, ss_item_sk#1, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#12,17,2) AS revenue#13] + +(14) Filter [codegen id : 7] +Input [3]: [ss_store_sk#2, ss_item_sk#1, revenue#13] +Condition : isnotnull(revenue#13) + +(15) Scan parquet default.store_sales +Output [4]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, ss_sold_date_sk#17] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#17), (ss_sold_date_sk#17 >= 2451911), (ss_sold_date_sk#17 <= 2452275), dynamicpruningexpression(ss_sold_date_sk#17 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 4] +Input [4]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, ss_sold_date_sk#17] + +(17) Filter [codegen id : 4] +Input [4]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, ss_sold_date_sk#17] +Condition : isnotnull(ss_store_sk#15) + +(18) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#18] + +(19) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#17] +Right keys [1]: [d_date_sk#18] +Join condition: None + +(20) Project [codegen id : 4] +Output [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +Input [5]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, ss_sold_date_sk#17, d_date_sk#18] + +(21) HashAggregate [codegen id : 4] +Input [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +Keys [2]: [ss_store_sk#15, ss_item_sk#14] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#16))] +Aggregate Attributes [1]: [sum#19] +Results [3]: [ss_store_sk#15, ss_item_sk#14, sum#20] + +(22) Exchange +Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#20] +Arguments: hashpartitioning(ss_store_sk#15, ss_item_sk#14, 5), ENSURE_REQUIREMENTS, [id=#21] + +(23) HashAggregate [codegen id : 5] +Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#20] +Keys [2]: [ss_store_sk#15, ss_item_sk#14] +Functions [1]: [sum(UnscaledValue(ss_sales_price#16))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#16))#22] +Results [2]: [ss_store_sk#15, MakeDecimal(sum(UnscaledValue(ss_sales_price#16))#22,17,2) AS revenue#23] + +(24) HashAggregate [codegen id : 5] +Input [2]: [ss_store_sk#15, revenue#23] +Keys [1]: [ss_store_sk#15] +Functions [1]: [partial_avg(revenue#23)] +Aggregate Attributes [2]: [sum#24, count#25] +Results [3]: [ss_store_sk#15, sum#26, count#27] + +(25) Exchange +Input [3]: [ss_store_sk#15, sum#26, count#27] +Arguments: hashpartitioning(ss_store_sk#15, 5), ENSURE_REQUIREMENTS, [id=#28] + +(26) HashAggregate [codegen id : 6] +Input [3]: [ss_store_sk#15, sum#26, count#27] +Keys [1]: [ss_store_sk#15] +Functions [1]: [avg(revenue#23)] +Aggregate Attributes [1]: [avg(revenue#23)#29] +Results [2]: [ss_store_sk#15, avg(revenue#23)#29 AS ave#30] + +(27) BroadcastExchange +Input [2]: [ss_store_sk#15, ave#30] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#31] + +(28) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [ss_store_sk#15] +Join condition: (cast(revenue#13 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#30)), DecimalType(23,7), true)) + +(29) Project [codegen id : 7] +Output [3]: [ss_store_sk#2, ss_item_sk#1, revenue#13] +Input [5]: [ss_store_sk#2, ss_item_sk#1, revenue#13, ss_store_sk#15, ave#30] + +(30) BroadcastExchange +Input [3]: [ss_store_sk#2, ss_item_sk#1, revenue#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#32] + +(31) Scan parquet default.store +Output [2]: [s_store_sk#33, s_store_name#34] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(32) ColumnarToRow +Input [2]: [s_store_sk#33, s_store_name#34] + +(33) Filter +Input [2]: [s_store_sk#33, s_store_name#34] +Condition : isnotnull(s_store_sk#33) + +(34) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#33] +Join condition: None + +(35) Project [codegen id : 8] +Output [3]: [ss_item_sk#1, revenue#13, s_store_name#34] +Input [5]: [ss_store_sk#2, ss_item_sk#1, revenue#13, s_store_sk#33, s_store_name#34] + +(36) BroadcastExchange +Input [3]: [ss_item_sk#1, revenue#13, s_store_name#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] + +(37) Scan parquet default.item +Output [5]: [i_item_sk#36, i_item_desc#37, i_current_price#38, i_wholesale_cost#39, i_brand#40] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(38) ColumnarToRow +Input [5]: [i_item_sk#36, i_item_desc#37, i_current_price#38, i_wholesale_cost#39, i_brand#40] + +(39) Filter +Input [5]: [i_item_sk#36, i_item_desc#37, i_current_price#38, i_wholesale_cost#39, i_brand#40] +Condition : isnotnull(i_item_sk#36) + +(40) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#36] +Join condition: None + +(41) Project [codegen id : 9] +Output [6]: [s_store_name#34, i_item_desc#37, revenue#13, i_current_price#38, i_wholesale_cost#39, i_brand#40] +Input [8]: [ss_item_sk#1, revenue#13, s_store_name#34, i_item_sk#36, i_item_desc#37, i_current_price#38, i_wholesale_cost#39, i_brand#40] + +(42) TakeOrderedAndProject +Input [6]: [s_store_name#34, i_item_desc#37, revenue#13, i_current_price#38, i_wholesale_cost#39, i_brand#40] +Arguments: 100, [s_store_name#34 ASC NULLS FIRST, i_item_desc#37 ASC NULLS FIRST], [s_store_name#34, i_item_desc#37, revenue#13, i_current_price#38, i_wholesale_cost#39, i_brand#40] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (43) + + +(43) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 15 Hosting Expression = ss_sold_date_sk#17 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/simplified.txt new file mode 100644 index 0000000000000..fec6d9ab3aefe --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65.sf100/simplified.txt @@ -0,0 +1,66 @@ +TakeOrderedAndProject [s_store_name,i_item_desc,revenue,i_current_price,i_wholesale_cost,i_brand] + WholeStageCodegen (9) + Project [s_store_name,i_item_desc,revenue,i_current_price,i_wholesale_cost,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + InputAdapter + BroadcastExchange #1 + WholeStageCodegen (8) + Project [ss_item_sk,revenue,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (7) + Project [ss_store_sk,ss_item_sk,revenue] + BroadcastHashJoin [ss_store_sk,ss_store_sk,revenue,ave] + Filter [revenue] + HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] + InputAdapter + Exchange [ss_store_sk,ss_item_sk] #3 + WholeStageCodegen (2) + HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (6) + HashAggregate [ss_store_sk,sum,count] [avg(revenue),ave,sum,count] + InputAdapter + Exchange [ss_store_sk] #6 + WholeStageCodegen (5) + HashAggregate [ss_store_sk,revenue] [sum,count,sum,count] + HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] + InputAdapter + Exchange [ss_store_sk,ss_item_sk] #7 + WholeStageCodegen (4) + HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name] + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_desc,i_current_price,i_wholesale_cost,i_brand] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65/explain.txt new file mode 100644 index 0000000000000..43ef320ed235f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65/explain.txt @@ -0,0 +1,259 @@ +== Physical Plan == +TakeOrderedAndProject (42) ++- * Project (41) + +- * BroadcastHashJoin Inner BuildRight (40) + :- * Project (26) + : +- * BroadcastHashJoin Inner BuildRight (25) + : :- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store (1) + : : +- BroadcastExchange (18) + : : +- * Filter (17) + : : +- * HashAggregate (16) + : : +- Exchange (15) + : : +- * HashAggregate (14) + : : +- * Project (13) + : : +- * BroadcastHashJoin Inner BuildRight (12) + : : :- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.store_sales (4) + : : +- BroadcastExchange (11) + : : +- * Project (10) + : : +- * Filter (9) + : : +- * ColumnarToRow (8) + : : +- Scan parquet default.date_dim (7) + : +- BroadcastExchange (24) + : +- * Filter (23) + : +- * ColumnarToRow (22) + : +- Scan parquet default.item (21) + +- BroadcastExchange (39) + +- * HashAggregate (38) + +- Exchange (37) + +- * HashAggregate (36) + +- * HashAggregate (35) + +- Exchange (34) + +- * HashAggregate (33) + +- * Project (32) + +- * BroadcastHashJoin Inner BuildRight (31) + :- * Filter (29) + : +- * ColumnarToRow (28) + : +- Scan parquet default.store_sales (27) + +- ReusedExchange (30) + + +(1) Scan parquet default.store +Output [2]: [s_store_sk#1, s_store_name#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [2]: [s_store_sk#1, s_store_name#2] + +(3) Filter [codegen id : 9] +Input [2]: [s_store_sk#1, s_store_name#2] +Condition : isnotnull(s_store_sk#1) + +(4) Scan parquet default.store_sales +Output [4]: [ss_item_sk#3, ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), (ss_sold_date_sk#6 >= 2451911), (ss_sold_date_sk#6 <= 2452275), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 2] +Input [4]: [ss_item_sk#3, ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] + +(6) Filter [codegen id : 2] +Input [4]: [ss_item_sk#3, ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] +Condition : (isnotnull(ss_store_sk#4) AND isnotnull(ss_item_sk#3)) + +(7) Scan parquet default.date_dim +Output [2]: [d_date_sk#8, d_month_seq#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2452275), IsNotNull(d_date_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#8, d_month_seq#9] + +(9) Filter [codegen id : 1] +Input [2]: [d_date_sk#8, d_month_seq#9] +Condition : (((((isnotnull(d_month_seq#9) AND (d_month_seq#9 >= 1212)) AND (d_month_seq#9 <= 1223)) AND (d_date_sk#8 >= 2451911)) AND (d_date_sk#8 <= 2452275)) AND isnotnull(d_date_sk#8)) + +(10) Project [codegen id : 1] +Output [1]: [d_date_sk#8] +Input [2]: [d_date_sk#8, d_month_seq#9] + +(11) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(12) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(13) Project [codegen id : 2] +Output [3]: [ss_item_sk#3, ss_store_sk#4, ss_sales_price#5] +Input [5]: [ss_item_sk#3, ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6, d_date_sk#8] + +(14) HashAggregate [codegen id : 2] +Input [3]: [ss_item_sk#3, ss_store_sk#4, ss_sales_price#5] +Keys [2]: [ss_store_sk#4, ss_item_sk#3] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#5))] +Aggregate Attributes [1]: [sum#11] +Results [3]: [ss_store_sk#4, ss_item_sk#3, sum#12] + +(15) Exchange +Input [3]: [ss_store_sk#4, ss_item_sk#3, sum#12] +Arguments: hashpartitioning(ss_store_sk#4, ss_item_sk#3, 5), ENSURE_REQUIREMENTS, [id=#13] + +(16) HashAggregate [codegen id : 3] +Input [3]: [ss_store_sk#4, ss_item_sk#3, sum#12] +Keys [2]: [ss_store_sk#4, ss_item_sk#3] +Functions [1]: [sum(UnscaledValue(ss_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#5))#14] +Results [3]: [ss_store_sk#4, ss_item_sk#3, MakeDecimal(sum(UnscaledValue(ss_sales_price#5))#14,17,2) AS revenue#15] + +(17) Filter [codegen id : 3] +Input [3]: [ss_store_sk#4, ss_item_sk#3, revenue#15] +Condition : isnotnull(revenue#15) + +(18) BroadcastExchange +Input [3]: [ss_store_sk#4, ss_item_sk#3, revenue#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(19) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [s_store_sk#1] +Right keys [1]: [ss_store_sk#4] +Join condition: None + +(20) Project [codegen id : 9] +Output [4]: [s_store_name#2, ss_store_sk#4, ss_item_sk#3, revenue#15] +Input [5]: [s_store_sk#1, s_store_name#2, ss_store_sk#4, ss_item_sk#3, revenue#15] + +(21) Scan parquet default.item +Output [5]: [i_item_sk#17, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 4] +Input [5]: [i_item_sk#17, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21] + +(23) Filter [codegen id : 4] +Input [5]: [i_item_sk#17, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21] +Condition : isnotnull(i_item_sk#17) + +(24) BroadcastExchange +Input [5]: [i_item_sk#17, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] + +(25) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#3] +Right keys [1]: [i_item_sk#17] +Join condition: None + +(26) Project [codegen id : 9] +Output [7]: [s_store_name#2, ss_store_sk#4, revenue#15, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21] +Input [9]: [s_store_name#2, ss_store_sk#4, ss_item_sk#3, revenue#15, i_item_sk#17, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21] + +(27) Scan parquet default.store_sales +Output [4]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25, ss_sold_date_sk#26] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#26), (ss_sold_date_sk#26 >= 2451911), (ss_sold_date_sk#26 <= 2452275), dynamicpruningexpression(ss_sold_date_sk#26 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 6] +Input [4]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25, ss_sold_date_sk#26] + +(29) Filter [codegen id : 6] +Input [4]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25, ss_sold_date_sk#26] +Condition : isnotnull(ss_store_sk#24) + +(30) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#27] + +(31) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#26] +Right keys [1]: [d_date_sk#27] +Join condition: None + +(32) Project [codegen id : 6] +Output [3]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25] +Input [5]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25, ss_sold_date_sk#26, d_date_sk#27] + +(33) HashAggregate [codegen id : 6] +Input [3]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25] +Keys [2]: [ss_store_sk#24, ss_item_sk#23] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#25))] +Aggregate Attributes [1]: [sum#28] +Results [3]: [ss_store_sk#24, ss_item_sk#23, sum#29] + +(34) Exchange +Input [3]: [ss_store_sk#24, ss_item_sk#23, sum#29] +Arguments: hashpartitioning(ss_store_sk#24, ss_item_sk#23, 5), ENSURE_REQUIREMENTS, [id=#30] + +(35) HashAggregate [codegen id : 7] +Input [3]: [ss_store_sk#24, ss_item_sk#23, sum#29] +Keys [2]: [ss_store_sk#24, ss_item_sk#23] +Functions [1]: [sum(UnscaledValue(ss_sales_price#25))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#25))#31] +Results [2]: [ss_store_sk#24, MakeDecimal(sum(UnscaledValue(ss_sales_price#25))#31,17,2) AS revenue#32] + +(36) HashAggregate [codegen id : 7] +Input [2]: [ss_store_sk#24, revenue#32] +Keys [1]: [ss_store_sk#24] +Functions [1]: [partial_avg(revenue#32)] +Aggregate Attributes [2]: [sum#33, count#34] +Results [3]: [ss_store_sk#24, sum#35, count#36] + +(37) Exchange +Input [3]: [ss_store_sk#24, sum#35, count#36] +Arguments: hashpartitioning(ss_store_sk#24, 5), ENSURE_REQUIREMENTS, [id=#37] + +(38) HashAggregate [codegen id : 8] +Input [3]: [ss_store_sk#24, sum#35, count#36] +Keys [1]: [ss_store_sk#24] +Functions [1]: [avg(revenue#32)] +Aggregate Attributes [1]: [avg(revenue#32)#38] +Results [2]: [ss_store_sk#24, avg(revenue#32)#38 AS ave#39] + +(39) BroadcastExchange +Input [2]: [ss_store_sk#24, ave#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#40] + +(40) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [ss_store_sk#24] +Join condition: (cast(revenue#15 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#39)), DecimalType(23,7), true)) + +(41) Project [codegen id : 9] +Output [6]: [s_store_name#2, i_item_desc#18, revenue#15, i_current_price#19, i_wholesale_cost#20, i_brand#21] +Input [9]: [s_store_name#2, ss_store_sk#4, revenue#15, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21, ss_store_sk#24, ave#39] + +(42) TakeOrderedAndProject +Input [6]: [s_store_name#2, i_item_desc#18, revenue#15, i_current_price#19, i_wholesale_cost#20, i_brand#21] +Arguments: 100, [s_store_name#2 ASC NULLS FIRST, i_item_desc#18 ASC NULLS FIRST], [s_store_name#2, i_item_desc#18, revenue#15, i_current_price#19, i_wholesale_cost#20, i_brand#21] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (43) + + +(43) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 27 Hosting Expression = ss_sold_date_sk#26 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65/simplified.txt new file mode 100644 index 0000000000000..d7d461677be96 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q65/simplified.txt @@ -0,0 +1,66 @@ +TakeOrderedAndProject [s_store_name,i_item_desc,revenue,i_current_price,i_wholesale_cost,i_brand] + WholeStageCodegen (9) + Project [s_store_name,i_item_desc,revenue,i_current_price,i_wholesale_cost,i_brand] + BroadcastHashJoin [ss_store_sk,ss_store_sk,revenue,ave] + Project [s_store_name,ss_store_sk,revenue,i_item_desc,i_current_price,i_wholesale_cost,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [s_store_name,ss_store_sk,ss_item_sk,revenue] + BroadcastHashJoin [s_store_sk,ss_store_sk] + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name] + InputAdapter + BroadcastExchange #1 + WholeStageCodegen (3) + Filter [revenue] + HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] + InputAdapter + Exchange [ss_store_sk,ss_item_sk] #2 + WholeStageCodegen (2) + HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_desc,i_current_price,i_wholesale_cost,i_brand] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (8) + HashAggregate [ss_store_sk,sum,count] [avg(revenue),ave,sum,count] + InputAdapter + Exchange [ss_store_sk] #6 + WholeStageCodegen (7) + HashAggregate [ss_store_sk,revenue] [sum,count,sum,count] + HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] + InputAdapter + Exchange [ss_store_sk,ss_item_sk] #7 + WholeStageCodegen (6) + HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt new file mode 100644 index 0000000000000..0b96b76a0ffc4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/explain.txt @@ -0,0 +1,270 @@ +== Physical Plan == +TakeOrderedAndProject (46) ++- * Project (45) + +- * BroadcastHashJoin Inner BuildLeft (44) + :- BroadcastExchange (40) + : +- * Project (39) + : +- * BroadcastHashJoin Inner BuildLeft (38) + : :- BroadcastExchange (34) + : : +- * HashAggregate (33) + : : +- Exchange (32) + : : +- * HashAggregate (31) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildLeft (29) + : : :- BroadcastExchange (25) + : : : +- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Project (17) + : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : :- * Project (10) + : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.store_sales (1) + : : : : : +- BroadcastExchange (8) + : : : : : +- * Project (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.store (4) + : : : : +- BroadcastExchange (15) + : : : : +- * Project (14) + : : : : +- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.date_dim (11) + : : : +- BroadcastExchange (22) + : : : +- * Project (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.household_demographics (18) + : : +- * Filter (28) + : : +- * ColumnarToRow (27) + : : +- Scan parquet default.customer_address (26) + : +- * Filter (37) + : +- * ColumnarToRow (36) + : +- Scan parquet default.customer (35) + +- * Filter (43) + +- * ColumnarToRow (42) + +- Scan parquet default.customer_address (41) + + +(1) Scan parquet default.store_sales +Output [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [ss_sold_date_sk#9 INSET (2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002), isnotnull(ss_sold_date_sk#9), dynamicpruningexpression(ss_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9] + +(3) Filter [codegen id : 4] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9] +Condition : (((isnotnull(ss_store_sk#4) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_addr_sk#3)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.store +Output [2]: [s_store_sk#11, s_city#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_city, [Midway,Fairview]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [s_store_sk#11, s_city#12] + +(6) Filter [codegen id : 1] +Input [2]: [s_store_sk#11, s_city#12] +Condition : (s_city#12 IN (Midway,Fairview) AND isnotnull(s_store_sk#11)) + +(7) Project [codegen id : 1] +Output [1]: [s_store_sk#11] +Input [2]: [s_store_sk#11, s_city#12] + +(8) BroadcastExchange +Input [1]: [s_store_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#11] +Join condition: None + +(10) Project [codegen id : 4] +Output [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9] +Input [10]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9, s_store_sk#11] + +(11) Scan parquet default.date_dim +Output [3]: [d_date_sk#14, d_year#15, d_dom#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), In(d_date_sk, [2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#14, d_year#15, d_dom#16] + +(13) Filter [codegen id : 2] +Input [3]: [d_date_sk#14, d_year#15, d_dom#16] +Condition : (((((isnotnull(d_dom#16) AND (d_dom#16 >= 1)) AND (d_dom#16 <= 2)) AND d_year#15 IN (1999,2000,2001)) AND d_date_sk#14 INSET (2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002)) AND isnotnull(d_date_sk#14)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#14] +Input [3]: [d_date_sk#14, d_year#15, d_dom#16] + +(15) BroadcastExchange +Input [1]: [d_date_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#9] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(17) Project [codegen id : 4] +Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9, d_date_sk#14] + +(18) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(EqualTo(hd_dep_count,5),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] + +(20) Filter [codegen id : 3] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] +Condition : (((hd_dep_count#19 = 5) OR (hd_vehicle_count#20 = 3)) AND isnotnull(hd_demo_sk#18)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#18] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#18] +Join condition: None + +(24) Project [codegen id : 4] +Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, hd_demo_sk#18] + +(25) BroadcastExchange +Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#22] + +(26) Scan parquet default.customer_address +Output [2]: [ca_address_sk#23, ca_city#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct + +(27) ColumnarToRow +Input [2]: [ca_address_sk#23, ca_city#24] + +(28) Filter +Input [2]: [ca_address_sk#23, ca_city#24] +Condition : (isnotnull(ca_address_sk#23) AND isnotnull(ca_city#24)) + +(29) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#3] +Right keys [1]: [ca_address_sk#23] +Join condition: None + +(30) Project [codegen id : 5] +Output [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#24] +Input [8]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_address_sk#23, ca_city#24] + +(31) HashAggregate [codegen id : 5] +Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#24] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#24] +Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#6)), partial_sum(UnscaledValue(ss_ext_list_price#7)), partial_sum(UnscaledValue(ss_ext_tax#8))] +Aggregate Attributes [3]: [sum#25, sum#26, sum#27] +Results [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#24, sum#28, sum#29, sum#30] + +(32) Exchange +Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#24, sum#28, sum#29, sum#30] +Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#24, 5), ENSURE_REQUIREMENTS, [id=#31] + +(33) HashAggregate [codegen id : 6] +Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#24, sum#28, sum#29, sum#30] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#24] +Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#6)), sum(UnscaledValue(ss_ext_list_price#7)), sum(UnscaledValue(ss_ext_tax#8))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#6))#32, sum(UnscaledValue(ss_ext_list_price#7))#33, sum(UnscaledValue(ss_ext_tax#8))#34] +Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#24 AS bought_city#35, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#32,17,2) AS extended_price#36, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#7))#33,17,2) AS list_price#37, MakeDecimal(sum(UnscaledValue(ss_ext_tax#8))#34,17,2) AS extended_tax#38] + +(34) BroadcastExchange +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#35, extended_price#36, list_price#37, extended_tax#38] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#39] + +(35) Scan parquet default.customer +Output [4]: [c_customer_sk#40, c_current_addr_sk#41, c_first_name#42, c_last_name#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(36) ColumnarToRow +Input [4]: [c_customer_sk#40, c_current_addr_sk#41, c_first_name#42, c_last_name#43] + +(37) Filter +Input [4]: [c_customer_sk#40, c_current_addr_sk#41, c_first_name#42, c_last_name#43] +Condition : (isnotnull(c_customer_sk#40) AND isnotnull(c_current_addr_sk#41)) + +(38) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#40] +Join condition: None + +(39) Project [codegen id : 7] +Output [8]: [ss_ticket_number#5, bought_city#35, extended_price#36, list_price#37, extended_tax#38, c_current_addr_sk#41, c_first_name#42, c_last_name#43] +Input [10]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#35, extended_price#36, list_price#37, extended_tax#38, c_customer_sk#40, c_current_addr_sk#41, c_first_name#42, c_last_name#43] + +(40) BroadcastExchange +Input [8]: [ss_ticket_number#5, bought_city#35, extended_price#36, list_price#37, extended_tax#38, c_current_addr_sk#41, c_first_name#42, c_last_name#43] +Arguments: HashedRelationBroadcastMode(List(cast(input[5, int, true] as bigint)),false), [id=#44] + +(41) Scan parquet default.customer_address +Output [2]: [ca_address_sk#45, ca_city#46] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct + +(42) ColumnarToRow +Input [2]: [ca_address_sk#45, ca_city#46] + +(43) Filter +Input [2]: [ca_address_sk#45, ca_city#46] +Condition : (isnotnull(ca_address_sk#45) AND isnotnull(ca_city#46)) + +(44) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [c_current_addr_sk#41] +Right keys [1]: [ca_address_sk#45] +Join condition: NOT (ca_city#46 = bought_city#35) + +(45) Project [codegen id : 8] +Output [8]: [c_last_name#43, c_first_name#42, ca_city#46, bought_city#35, ss_ticket_number#5, extended_price#36, extended_tax#38, list_price#37] +Input [10]: [ss_ticket_number#5, bought_city#35, extended_price#36, list_price#37, extended_tax#38, c_current_addr_sk#41, c_first_name#42, c_last_name#43, ca_address_sk#45, ca_city#46] + +(46) TakeOrderedAndProject +Input [8]: [c_last_name#43, c_first_name#42, ca_city#46, bought_city#35, ss_ticket_number#5, extended_price#36, extended_tax#38, list_price#37] +Arguments: 100, [c_last_name#43 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#43, c_first_name#42, ca_city#46, bought_city#35, ss_ticket_number#5, extended_price#36, extended_tax#38, list_price#37] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (47) + + +(47) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#14] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/simplified.txt new file mode 100644 index 0000000000000..11ab7865edd5a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68.sf100/simplified.txt @@ -0,0 +1,70 @@ +TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_city,extended_price,extended_tax,list_price] + WholeStageCodegen (8) + Project [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,extended_price,extended_tax,list_price] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk,ca_city,bought_city] + InputAdapter + BroadcastExchange #1 + WholeStageCodegen (7) + Project [ss_ticket_number,bought_city,extended_price,list_price,extended_tax,c_current_addr_sk,c_first_name,c_last_name] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (6) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,sum,sum,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(UnscaledValue(ss_ext_list_price)),sum(UnscaledValue(ss_ext_tax)),bought_city,extended_price,list_price,extended_tax,sum,sum,sum] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city] #3 + WholeStageCodegen (5) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] [sum,sum,sum,sum,sum,sum] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax,ca_city] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax,ss_sold_date_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Project [s_store_sk] + Filter [s_city,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_city] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + Filter [ca_address_sk,ca_city] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + Filter [ca_address_sk,ca_city] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68/explain.txt new file mode 100644 index 0000000000000..f50329db7e05e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68/explain.txt @@ -0,0 +1,252 @@ +== Physical Plan == +TakeOrderedAndProject (43) ++- * Project (42) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (39) + : +- * BroadcastHashJoin Inner BuildRight (38) + : :- * HashAggregate (33) + : : +- Exchange (32) + : : +- * HashAggregate (31) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Project (17) + : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : :- * Project (10) + : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.store_sales (1) + : : : : : +- BroadcastExchange (8) + : : : : : +- * Project (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.date_dim (4) + : : : : +- BroadcastExchange (15) + : : : : +- * Project (14) + : : : : +- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.store (11) + : : : +- BroadcastExchange (22) + : : : +- * Project (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.household_demographics (18) + : : +- BroadcastExchange (28) + : : +- * Filter (27) + : : +- * ColumnarToRow (26) + : : +- Scan parquet default.customer_address (25) + : +- BroadcastExchange (37) + : +- * Filter (36) + : +- * ColumnarToRow (35) + : +- Scan parquet default.customer (34) + +- ReusedExchange (40) + + +(1) Scan parquet default.store_sales +Output [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [ss_sold_date_sk#9 INSET (2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002), isnotnull(ss_sold_date_sk#9), dynamicpruningexpression(ss_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9] + +(3) Filter [codegen id : 5] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9] +Condition : (((isnotnull(ss_store_sk#4) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_addr_sk#3)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#11, d_year#12, d_dom#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), In(d_date_sk, [2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#11, d_year#12, d_dom#13] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#11, d_year#12, d_dom#13] +Condition : (((((isnotnull(d_dom#13) AND (d_dom#13 >= 1)) AND (d_dom#13 <= 2)) AND d_year#12 IN (1999,2000,2001)) AND d_date_sk#11 INSET (2451790,2451180,2452216,2451454,2452184,2451485,2451850,2451514,2452062,2451270,2452123,2451758,2451971,2451546,2451942,2451393,2451667,2451453,2452215,2451819,2451331,2451577,2451911,2452245,2451301,2451545,2451605,2451943,2451851,2451181,2452154,2451820,2452001,2451362,2451392,2451240,2452032,2451637,2451484,2452124,2451300,2451727,2452093,2451759,2451698,2451332,2451606,2451666,2451912,2452185,2451211,2451361,2452031,2451212,2451880,2451789,2451423,2451576,2451728,2452246,2452155,2452092,2451881,2451970,2451697,2452063,2451271,2451636,2451515,2451424,2451239,2452002)) AND isnotnull(d_date_sk#11)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#11] +Input [3]: [d_date_sk#11, d_year#12, d_dom#13] + +(8) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#9] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(10) Project [codegen id : 5] +Output [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8] +Input [10]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9, d_date_sk#11] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#15, s_city#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_city, [Midway,Fairview]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#15, s_city#16] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#15, s_city#16] +Condition : (s_city#16 IN (Midway,Fairview) AND isnotnull(s_store_sk#15)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#15] +Input [2]: [s_store_sk#15, s_city#16] + +(15) BroadcastExchange +Input [1]: [s_store_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#15] +Join condition: None + +(17) Project [codegen id : 5] +Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, s_store_sk#15] + +(18) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(EqualTo(hd_dep_count,5),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] + +(20) Filter [codegen id : 3] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] +Condition : (((hd_dep_count#19 = 5) OR (hd_vehicle_count#20 = 3)) AND isnotnull(hd_demo_sk#18)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#18] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(23) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#18] +Join condition: None + +(24) Project [codegen id : 5] +Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, hd_demo_sk#18] + +(25) Scan parquet default.customer_address +Output [2]: [ca_address_sk#22, ca_city#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 4] +Input [2]: [ca_address_sk#22, ca_city#23] + +(27) Filter [codegen id : 4] +Input [2]: [ca_address_sk#22, ca_city#23] +Condition : (isnotnull(ca_address_sk#22) AND isnotnull(ca_city#23)) + +(28) BroadcastExchange +Input [2]: [ca_address_sk#22, ca_city#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(29) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#3] +Right keys [1]: [ca_address_sk#22] +Join condition: None + +(30) Project [codegen id : 5] +Output [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#23] +Input [8]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_address_sk#22, ca_city#23] + +(31) HashAggregate [codegen id : 5] +Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#23] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23] +Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#6)), partial_sum(UnscaledValue(ss_ext_list_price#7)), partial_sum(UnscaledValue(ss_ext_tax#8))] +Aggregate Attributes [3]: [sum#25, sum#26, sum#27] +Results [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23, sum#28, sum#29, sum#30] + +(32) Exchange +Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23, sum#28, sum#29, sum#30] +Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23, 5), ENSURE_REQUIREMENTS, [id=#31] + +(33) HashAggregate [codegen id : 8] +Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23, sum#28, sum#29, sum#30] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23] +Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#6)), sum(UnscaledValue(ss_ext_list_price#7)), sum(UnscaledValue(ss_ext_tax#8))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#6))#32, sum(UnscaledValue(ss_ext_list_price#7))#33, sum(UnscaledValue(ss_ext_tax#8))#34] +Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#23 AS bought_city#35, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#32,17,2) AS extended_price#36, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#7))#33,17,2) AS list_price#37, MakeDecimal(sum(UnscaledValue(ss_ext_tax#8))#34,17,2) AS extended_tax#38] + +(34) Scan parquet default.customer +Output [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 6] +Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] + +(36) Filter [codegen id : 6] +Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Condition : (isnotnull(c_customer_sk#39) AND isnotnull(c_current_addr_sk#40)) + +(37) BroadcastExchange +Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#43] + +(38) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#39] +Join condition: None + +(39) Project [codegen id : 8] +Output [8]: [ss_ticket_number#5, bought_city#35, extended_price#36, list_price#37, extended_tax#38, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Input [10]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#35, extended_price#36, list_price#37, extended_tax#38, c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] + +(40) ReusedExchange [Reuses operator id: 28] +Output [2]: [ca_address_sk#44, ca_city#45] + +(41) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [c_current_addr_sk#40] +Right keys [1]: [ca_address_sk#44] +Join condition: NOT (ca_city#45 = bought_city#35) + +(42) Project [codegen id : 8] +Output [8]: [c_last_name#42, c_first_name#41, ca_city#45, bought_city#35, ss_ticket_number#5, extended_price#36, extended_tax#38, list_price#37] +Input [10]: [ss_ticket_number#5, bought_city#35, extended_price#36, list_price#37, extended_tax#38, c_current_addr_sk#40, c_first_name#41, c_last_name#42, ca_address_sk#44, ca_city#45] + +(43) TakeOrderedAndProject +Input [8]: [c_last_name#42, c_first_name#41, ca_city#45, bought_city#35, ss_ticket_number#5, extended_price#36, extended_tax#38, list_price#37] +Arguments: 100, [c_last_name#42 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#42, c_first_name#41, ca_city#45, bought_city#35, ss_ticket_number#5, extended_price#36, extended_tax#38, list_price#37] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (44) + + +(44) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68/simplified.txt new file mode 100644 index 0000000000000..b4d72f1da879d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q68/simplified.txt @@ -0,0 +1,65 @@ +TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_city,extended_price,extended_tax,list_price] + WholeStageCodegen (8) + Project [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,extended_price,extended_tax,list_price] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk,ca_city,bought_city] + Project [ss_ticket_number,bought_city,extended_price,list_price,extended_tax,c_current_addr_sk,c_first_name,c_last_name] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,sum,sum,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(UnscaledValue(ss_ext_list_price)),sum(UnscaledValue(ss_ext_tax)),bought_city,extended_price,list_price,extended_tax,sum,sum,sum] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city] #1 + WholeStageCodegen (5) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] [sum,sum,sum,sum,sum,sum] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax,ca_city] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_city,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_city] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [ca_address_sk,ca_city] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + InputAdapter + ReusedExchange [ca_address_sk,ca_city] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7.sf100/explain.txt new file mode 100644 index 0000000000000..daa0ca7b16562 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7.sf100/explain.txt @@ -0,0 +1,204 @@ +== Physical Plan == +TakeOrderedAndProject (34) ++- * HashAggregate (33) + +- Exchange (32) + +- * HashAggregate (31) + +- * Project (30) + +- * BroadcastHashJoin Inner BuildRight (29) + :- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.promotion (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.customer_demographics (18) + +- BroadcastExchange (28) + +- * Filter (27) + +- * ColumnarToRow (26) + +- Scan parquet default.item (25) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), (ss_sold_date_sk#8 >= 2450815), (ss_sold_date_sk#8 <= 2451179), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_item_sk), IsNotNull(ss_promo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_cdemo_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_promo_sk#3)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#10, d_year#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2450815), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#10, d_year#11] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#10, d_year#11] +Condition : ((((isnotnull(d_year#11) AND (d_year#11 = 1998)) AND (d_date_sk#10 >= 2450815)) AND (d_date_sk#10 <= 2451179)) AND isnotnull(d_date_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#10] +Input [2]: [d_date_sk#10, d_year#11] + +(8) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#10] + +(11) Scan parquet default.promotion +Output [3]: [p_promo_sk#13, p_channel_email#14, p_channel_event#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [Or(EqualTo(p_channel_email,N),EqualTo(p_channel_event,N)), IsNotNull(p_promo_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [p_promo_sk#13, p_channel_email#14, p_channel_event#15] + +(13) Filter [codegen id : 2] +Input [3]: [p_promo_sk#13, p_channel_email#14, p_channel_event#15] +Condition : (((p_channel_email#14 = N) OR (p_channel_event#15 = N)) AND isnotnull(p_promo_sk#13)) + +(14) Project [codegen id : 2] +Output [1]: [p_promo_sk#13] +Input [3]: [p_promo_sk#13, p_channel_email#14, p_channel_event#15] + +(15) BroadcastExchange +Input [1]: [p_promo_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_promo_sk#3] +Right keys [1]: [p_promo_sk#13] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_cdemo_sk#2, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, p_promo_sk#13] + +(18) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,F), EqualTo(cd_marital_status,W), EqualTo(cd_education_status,Primary ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [4]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20] + +(20) Filter [codegen id : 3] +Input [4]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20] +Condition : ((((((isnotnull(cd_gender#18) AND isnotnull(cd_marital_status#19)) AND isnotnull(cd_education_status#20)) AND (cd_gender#18 = F)) AND (cd_marital_status#19 = W)) AND (cd_education_status#20 = Primary )) AND isnotnull(cd_demo_sk#17)) + +(21) Project [codegen id : 3] +Output [1]: [cd_demo_sk#17] +Input [4]: [cd_demo_sk#17, cd_gender#18, cd_marital_status#19, cd_education_status#20] + +(22) BroadcastExchange +Input [1]: [cd_demo_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(23) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#17] +Join condition: None + +(24) Project [codegen id : 5] +Output [5]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [7]: [ss_item_sk#1, ss_cdemo_sk#2, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, cd_demo_sk#17] + +(25) Scan parquet default.item +Output [2]: [i_item_sk#22, i_item_id#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#22, i_item_id#23] + +(27) Filter [codegen id : 4] +Input [2]: [i_item_sk#22, i_item_id#23] +Condition : isnotnull(i_item_sk#22) + +(28) BroadcastExchange +Input [2]: [i_item_sk#22, i_item_id#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(29) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#22] +Join condition: None + +(30) Project [codegen id : 5] +Output [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#23] +Input [7]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#22, i_item_id#23] + +(31) HashAggregate [codegen id : 5] +Input [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#23] +Keys [1]: [i_item_id#23] +Functions [4]: [partial_avg(ss_quantity#4), partial_avg(UnscaledValue(ss_list_price#5)), partial_avg(UnscaledValue(ss_coupon_amt#7)), partial_avg(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [8]: [sum#25, count#26, sum#27, count#28, sum#29, count#30, sum#31, count#32] +Results [9]: [i_item_id#23, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] + +(32) Exchange +Input [9]: [i_item_id#23, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] +Arguments: hashpartitioning(i_item_id#23, 5), ENSURE_REQUIREMENTS, [id=#41] + +(33) HashAggregate [codegen id : 6] +Input [9]: [i_item_id#23, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] +Keys [1]: [i_item_id#23] +Functions [4]: [avg(ss_quantity#4), avg(UnscaledValue(ss_list_price#5)), avg(UnscaledValue(ss_coupon_amt#7)), avg(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [4]: [avg(ss_quantity#4)#42, avg(UnscaledValue(ss_list_price#5))#43, avg(UnscaledValue(ss_coupon_amt#7))#44, avg(UnscaledValue(ss_sales_price#6))#45] +Results [5]: [i_item_id#23, avg(ss_quantity#4)#42 AS agg1#46, cast((avg(UnscaledValue(ss_list_price#5))#43 / 100.0) as decimal(11,6)) AS agg2#47, cast((avg(UnscaledValue(ss_coupon_amt#7))#44 / 100.0) as decimal(11,6)) AS agg3#48, cast((avg(UnscaledValue(ss_sales_price#6))#45 / 100.0) as decimal(11,6)) AS agg4#49] + +(34) TakeOrderedAndProject +Input [5]: [i_item_id#23, agg1#46, agg2#47, agg3#48, agg4#49] +Arguments: 100, [i_item_id#23 ASC NULLS FIRST], [i_item_id#23, agg1#46, agg2#47, agg3#48, agg4#49] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#10] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7.sf100/simplified.txt new file mode 100644 index 0000000000000..c3e9e4655d3e7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7.sf100/simplified.txt @@ -0,0 +1,52 @@ +TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] + WholeStageCodegen (6) + HashAggregate [i_item_id,sum,count,sum,count,sum,count,sum,count] [avg(ss_quantity),avg(UnscaledValue(ss_list_price)),avg(UnscaledValue(ss_coupon_amt)),avg(UnscaledValue(ss_sales_price)),agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,i_item_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_cdemo_sk,ss_item_sk,ss_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [p_promo_sk] + Filter [p_channel_email,p_channel_event,p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk,p_channel_email,p_channel_event] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [cd_demo_sk] + Filter [cd_gender,cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7/explain.txt new file mode 100644 index 0000000000000..a9da9118323b6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7/explain.txt @@ -0,0 +1,204 @@ +== Physical Plan == +TakeOrderedAndProject (34) ++- * HashAggregate (33) + +- Exchange (32) + +- * HashAggregate (31) + +- * Project (30) + +- * BroadcastHashJoin Inner BuildRight (29) + :- * Project (23) + : +- * BroadcastHashJoin Inner BuildRight (22) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer_demographics (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.date_dim (11) + : +- BroadcastExchange (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.item (18) + +- BroadcastExchange (28) + +- * Project (27) + +- * Filter (26) + +- * ColumnarToRow (25) + +- Scan parquet default.promotion (24) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), (ss_sold_date_sk#8 >= 2450815), (ss_sold_date_sk#8 <= 2451179), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_item_sk), IsNotNull(ss_promo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_cdemo_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_promo_sk#3)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,F), EqualTo(cd_marital_status,W), EqualTo(cd_education_status,Primary ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Condition : ((((((isnotnull(cd_gender#11) AND isnotnull(cd_marital_status#12)) AND isnotnull(cd_education_status#13)) AND (cd_gender#11 = F)) AND (cd_marital_status#12 = W)) AND (cd_education_status#13 = Primary )) AND isnotnull(cd_demo_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#10] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(8) BroadcastExchange +Input [1]: [cd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, cd_demo_sk#10] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#15, d_year#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1998), GreaterThanOrEqual(d_date_sk,2450815), LessThanOrEqual(d_date_sk,2451179), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] +Condition : ((((isnotnull(d_year#16) AND (d_year#16 = 1998)) AND (d_date_sk#15 >= 2450815)) AND (d_date_sk#15 <= 2451179)) AND isnotnull(d_date_sk#15)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#15] +Input [2]: [d_date_sk#15, d_year#16] + +(15) BroadcastExchange +Input [1]: [d_date_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [8]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#15] + +(18) Scan parquet default.item +Output [2]: [i_item_sk#18, i_item_id#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_sk#18, i_item_id#19] + +(20) Filter [codegen id : 3] +Input [2]: [i_item_sk#18, i_item_id#19] +Condition : isnotnull(i_item_sk#18) + +(21) BroadcastExchange +Input [2]: [i_item_sk#18, i_item_id#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(22) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#18] +Join condition: None + +(23) Project [codegen id : 5] +Output [6]: [ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#19] +Input [8]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#18, i_item_id#19] + +(24) Scan parquet default.promotion +Output [3]: [p_promo_sk#21, p_channel_email#22, p_channel_event#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [Or(EqualTo(p_channel_email,N),EqualTo(p_channel_event,N)), IsNotNull(p_promo_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [3]: [p_promo_sk#21, p_channel_email#22, p_channel_event#23] + +(26) Filter [codegen id : 4] +Input [3]: [p_promo_sk#21, p_channel_email#22, p_channel_event#23] +Condition : (((p_channel_email#22 = N) OR (p_channel_event#23 = N)) AND isnotnull(p_promo_sk#21)) + +(27) Project [codegen id : 4] +Output [1]: [p_promo_sk#21] +Input [3]: [p_promo_sk#21, p_channel_email#22, p_channel_event#23] + +(28) BroadcastExchange +Input [1]: [p_promo_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(29) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_promo_sk#3] +Right keys [1]: [p_promo_sk#21] +Join condition: None + +(30) Project [codegen id : 5] +Output [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#19] +Input [7]: [ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#19, p_promo_sk#21] + +(31) HashAggregate [codegen id : 5] +Input [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#19] +Keys [1]: [i_item_id#19] +Functions [4]: [partial_avg(ss_quantity#4), partial_avg(UnscaledValue(ss_list_price#5)), partial_avg(UnscaledValue(ss_coupon_amt#7)), partial_avg(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [8]: [sum#25, count#26, sum#27, count#28, sum#29, count#30, sum#31, count#32] +Results [9]: [i_item_id#19, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] + +(32) Exchange +Input [9]: [i_item_id#19, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] +Arguments: hashpartitioning(i_item_id#19, 5), ENSURE_REQUIREMENTS, [id=#41] + +(33) HashAggregate [codegen id : 6] +Input [9]: [i_item_id#19, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] +Keys [1]: [i_item_id#19] +Functions [4]: [avg(ss_quantity#4), avg(UnscaledValue(ss_list_price#5)), avg(UnscaledValue(ss_coupon_amt#7)), avg(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [4]: [avg(ss_quantity#4)#42, avg(UnscaledValue(ss_list_price#5))#43, avg(UnscaledValue(ss_coupon_amt#7))#44, avg(UnscaledValue(ss_sales_price#6))#45] +Results [5]: [i_item_id#19, avg(ss_quantity#4)#42 AS agg1#46, cast((avg(UnscaledValue(ss_list_price#5))#43 / 100.0) as decimal(11,6)) AS agg2#47, cast((avg(UnscaledValue(ss_coupon_amt#7))#44 / 100.0) as decimal(11,6)) AS agg3#48, cast((avg(UnscaledValue(ss_sales_price#6))#45 / 100.0) as decimal(11,6)) AS agg4#49] + +(34) TakeOrderedAndProject +Input [5]: [i_item_id#19, agg1#46, agg2#47, agg3#48, agg4#49] +Arguments: 100, [i_item_id#19 ASC NULLS FIRST], [i_item_id#19, agg1#46, agg2#47, agg3#48, agg4#49] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#15] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7/simplified.txt new file mode 100644 index 0000000000000..4de61c8e70519 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q7/simplified.txt @@ -0,0 +1,52 @@ +TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] + WholeStageCodegen (6) + HashAggregate [i_item_id,sum,count,sum,count,sum,count,sum,count] [avg(ss_quantity),avg(UnscaledValue(ss_list_price)),avg(UnscaledValue(ss_coupon_amt)),avg(UnscaledValue(ss_sales_price)),agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,i_item_id] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,i_item_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_item_sk,ss_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [cd_demo_sk] + Filter [cd_gender,cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Project [p_promo_sk] + Filter [p_channel_email,p_channel_event,p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk,p_channel_email,p_channel_event] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73.sf100/explain.txt new file mode 100644 index 0000000000000..d7a40fad9ce61 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73.sf100/explain.txt @@ -0,0 +1,204 @@ +== Physical Plan == +* Sort (36) ++- Exchange (35) + +- * Project (34) + +- * BroadcastHashJoin Inner BuildLeft (33) + :- BroadcastExchange (29) + : +- * Filter (28) + : +- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildLeft (23) + : :- BroadcastExchange (18) + : : +- * Project (17) + : : +- * BroadcastHashJoin Inner BuildLeft (16) + : : :- BroadcastExchange (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : :- BroadcastExchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Project (8) + : : : +- * Filter (7) + : : : +- * ColumnarToRow (6) + : : : +- Scan parquet default.date_dim (5) + : : +- * Project (15) + : : +- * Filter (14) + : : +- * ColumnarToRow (13) + : : +- Scan parquet default.store (12) + : +- * Project (22) + : +- * Filter (21) + : +- * ColumnarToRow (20) + : +- Scan parquet default.household_demographics (19) + +- * Filter (32) + +- * ColumnarToRow (31) + +- Scan parquet default.customer (30) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [ss_sold_date_sk#5 INSET (2451790,2451119,2451180,2451454,2450874,2450906,2450967,2451485,2451850,2451514,2451270,2451758,2451028,2451546,2450997,2450996,2451393,2451667,2451453,2451819,2450905,2451331,2451577,2451089,2451301,2451545,2451605,2451851,2451181,2451149,2451820,2451362,2451392,2451240,2450935,2451637,2451484,2451058,2451300,2451727,2451759,2450815,2451698,2451150,2451332,2451606,2451666,2451211,2450846,2450875,2450966,2450936,2451361,2451212,2451880,2451059,2451789,2451423,2451576,2450816,2451088,2451728,2451027,2451120,2451881,2451697,2450847,2451271,2451636,2451515,2451424,2451239), isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 1] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Condition : ((isnotnull(ss_store_sk#3) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) BroadcastExchange +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[4, int, true] as bigint)),false), [id=#6] + +(5) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_dom#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1998,1999,2000]), In(d_date_sk, [2451790,2451119,2451180,2451454,2450874,2450906,2450967,2451485,2451850,2451514,2451270,2451758,2451028,2451546,2450997,2450996,2451393,2451667,2451453,2451819,2450905,2451331,2451577,2451089,2451301,2451545,2451605,2451851,2451181,2451149,2451820,2451362,2451392,2451240,2450935,2451637,2451484,2451058,2451300,2451727,2451759,2450815,2451698,2451150,2451332,2451606,2451666,2451211,2450846,2450875,2450966,2450936,2451361,2451212,2451880,2451059,2451789,2451423,2451576,2450816,2451088,2451728,2451027,2451120,2451881,2451697,2450847,2451271,2451636,2451515,2451424,2451239]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(6) ColumnarToRow +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(7) Filter +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] +Condition : (((((isnotnull(d_dom#9) AND (d_dom#9 >= 1)) AND (d_dom#9 <= 2)) AND d_year#8 IN (1998,1999,2000)) AND d_date_sk#7 INSET (2451790,2451119,2451180,2451454,2450874,2450906,2450967,2451485,2451850,2451514,2451270,2451758,2451028,2451546,2450997,2450996,2451393,2451667,2451453,2451819,2450905,2451331,2451577,2451089,2451301,2451545,2451605,2451851,2451181,2451149,2451820,2451362,2451392,2451240,2450935,2451637,2451484,2451058,2451300,2451727,2451759,2450815,2451698,2451150,2451332,2451606,2451666,2451211,2450846,2450875,2450966,2450936,2451361,2451212,2451880,2451059,2451789,2451423,2451576,2450816,2451088,2451728,2451027,2451120,2451881,2451697,2450847,2451271,2451636,2451515,2451424,2451239)) AND isnotnull(d_date_sk#7)) + +(8) Project +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 2] +Output [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4] +Input [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) BroadcastExchange +Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#10] + +(12) Scan parquet default.store +Output [2]: [s_store_sk#11, s_county#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_county, [Fairfield County,Ziebach County,Bronx County,Barrow County]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(13) ColumnarToRow +Input [2]: [s_store_sk#11, s_county#12] + +(14) Filter +Input [2]: [s_store_sk#11, s_county#12] +Condition : (s_county#12 IN (Fairfield County,Ziebach County,Bronx County,Barrow County) AND isnotnull(s_store_sk#11)) + +(15) Project +Output [1]: [s_store_sk#11] +Input [2]: [s_store_sk#11, s_county#12] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#11] +Join condition: None + +(17) Project [codegen id : 3] +Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#11] + +(18) BroadcastExchange +Input [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#13] + +(19) Scan parquet default.household_demographics +Output [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000 ),EqualTo(hd_buy_potential,Unknown )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(20) ColumnarToRow +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(21) Filter +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Condition : (((((isnotnull(hd_vehicle_count#17) AND isnotnull(hd_dep_count#16)) AND ((hd_buy_potential#15 = >10000 ) OR (hd_buy_potential#15 = Unknown ))) AND (hd_vehicle_count#17 > 0)) AND ((cast(hd_dep_count#16 as double) / cast(hd_vehicle_count#17 as double)) > 1.0)) AND isnotnull(hd_demo_sk#14)) + +(22) Project +Output [1]: [hd_demo_sk#14] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#14] +Join condition: None + +(24) Project [codegen id : 4] +Output [2]: [ss_customer_sk#1, ss_ticket_number#4] +Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#14] + +(25) HashAggregate [codegen id : 4] +Input [2]: [ss_customer_sk#1, ss_ticket_number#4] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#18] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#19] + +(26) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#19] +Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#20] + +(27) HashAggregate [codegen id : 5] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#19] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#21] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#21 AS cnt#22] + +(28) Filter [codegen id : 5] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#22] +Condition : ((cnt#22 >= 1) AND (cnt#22 <= 5)) + +(29) BroadcastExchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#23] + +(30) Scan parquet default.customer +Output [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(31) ColumnarToRow +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] + +(32) Filter +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Condition : isnotnull(c_customer_sk#24) + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#24] +Join condition: None + +(34) Project [codegen id : 6] +Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#22] +Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#22, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] + +(35) Exchange +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#22] +Arguments: rangepartitioning(cnt#22 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#29] + +(36) Sort [codegen id : 7] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#22] +Arguments: [cnt#22 DESC NULLS LAST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73.sf100/simplified.txt new file mode 100644 index 0000000000000..91deecbd03317 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73.sf100/simplified.txt @@ -0,0 +1,54 @@ +WholeStageCodegen (7) + Sort [cnt] + InputAdapter + Exchange [cnt] #1 + WholeStageCodegen (6) + Project [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number,cnt] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (5) + Filter [cnt] + HashAggregate [ss_ticket_number,ss_customer_sk,count] [count(1),cnt,count] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk] #3 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk] [count,count] + Project [ss_customer_sk,ss_ticket_number] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] + BroadcastHashJoin [ss_store_sk,s_store_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + Project [s_store_sk] + Filter [s_county,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county] + Project [hd_demo_sk] + Filter [hd_vehicle_count,hd_dep_count,hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential,hd_dep_count,hd_vehicle_count] + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73/explain.txt new file mode 100644 index 0000000000000..5ec772ca3d638 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73/explain.txt @@ -0,0 +1,214 @@ +== Physical Plan == +* Sort (36) ++- Exchange (35) + +- * Project (34) + +- * BroadcastHashJoin Inner BuildRight (33) + :- * Filter (28) + : +- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.household_demographics (18) + +- BroadcastExchange (32) + +- * Filter (31) + +- * ColumnarToRow (30) + +- Scan parquet default.customer (29) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [ss_sold_date_sk#5 INSET (2451790,2451119,2451180,2451454,2450874,2450906,2450967,2451485,2451850,2451514,2451270,2451758,2451028,2451546,2450997,2450996,2451393,2451667,2451453,2451819,2450905,2451331,2451577,2451089,2451301,2451545,2451605,2451851,2451181,2451149,2451820,2451362,2451392,2451240,2450935,2451637,2451484,2451058,2451300,2451727,2451759,2450815,2451698,2451150,2451332,2451606,2451666,2451211,2450846,2450875,2450966,2450936,2451361,2451212,2451880,2451059,2451789,2451423,2451576,2450816,2451088,2451728,2451027,2451120,2451881,2451697,2450847,2451271,2451636,2451515,2451424,2451239), isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Condition : ((isnotnull(ss_store_sk#3) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_dom#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1998,1999,2000]), In(d_date_sk, [2451790,2451119,2451180,2451454,2450874,2450906,2450967,2451485,2451850,2451514,2451270,2451758,2451028,2451546,2450997,2450996,2451393,2451667,2451453,2451819,2450905,2451331,2451577,2451089,2451301,2451545,2451605,2451851,2451181,2451149,2451820,2451362,2451392,2451240,2450935,2451637,2451484,2451058,2451300,2451727,2451759,2450815,2451698,2451150,2451332,2451606,2451666,2451211,2450846,2450875,2450966,2450936,2451361,2451212,2451880,2451059,2451789,2451423,2451576,2450816,2451088,2451728,2451027,2451120,2451881,2451697,2450847,2451271,2451636,2451515,2451424,2451239]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] +Condition : (((((isnotnull(d_dom#9) AND (d_dom#9 >= 1)) AND (d_dom#9 <= 2)) AND d_year#8 IN (1998,1999,2000)) AND d_date_sk#7 INSET (2451790,2451119,2451180,2451454,2450874,2450906,2450967,2451485,2451850,2451514,2451270,2451758,2451028,2451546,2450997,2450996,2451393,2451667,2451453,2451819,2450905,2451331,2451577,2451089,2451301,2451545,2451605,2451851,2451181,2451149,2451820,2451362,2451392,2451240,2450935,2451637,2451484,2451058,2451300,2451727,2451759,2450815,2451698,2451150,2451332,2451606,2451666,2451211,2450846,2450875,2450966,2450936,2451361,2451212,2451880,2451059,2451789,2451423,2451576,2450816,2451088,2451728,2451027,2451120,2451881,2451697,2450847,2451271,2451636,2451515,2451424,2451239)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4] +Input [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#11, s_county#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_county, [Fairfield County,Ziebach County,Bronx County,Barrow County]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] +Condition : (s_county#12 IN (Fairfield County,Ziebach County,Bronx County,Barrow County) AND isnotnull(s_store_sk#11)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#11] +Input [2]: [s_store_sk#11, s_county#12] + +(15) BroadcastExchange +Input [1]: [s_store_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#11] +Join condition: None + +(17) Project [codegen id : 4] +Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#11] + +(18) Scan parquet default.household_demographics +Output [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000 ),EqualTo(hd_buy_potential,Unknown )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(20) Filter [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Condition : (((((isnotnull(hd_vehicle_count#17) AND isnotnull(hd_dep_count#16)) AND ((hd_buy_potential#15 = >10000 ) OR (hd_buy_potential#15 = Unknown ))) AND (hd_vehicle_count#17 > 0)) AND ((cast(hd_dep_count#16 as double) / cast(hd_vehicle_count#17 as double)) > 1.0)) AND isnotnull(hd_demo_sk#14)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#14] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#14] +Join condition: None + +(24) Project [codegen id : 4] +Output [2]: [ss_customer_sk#1, ss_ticket_number#4] +Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#14] + +(25) HashAggregate [codegen id : 4] +Input [2]: [ss_customer_sk#1, ss_ticket_number#4] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#19] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] + +(26) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) HashAggregate [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#22] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#22 AS cnt#23] + +(28) Filter [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Condition : ((cnt#23 >= 1) AND (cnt#23 <= 5)) + +(29) Scan parquet default.customer +Output [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] + +(31) Filter [codegen id : 5] +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Condition : isnotnull(c_customer_sk#24) + +(32) BroadcastExchange +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#24] +Join condition: None + +(34) Project [codegen id : 6] +Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] + +(35) Exchange +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Arguments: rangepartitioning(cnt#23 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#30] + +(36) Sort [codegen id : 7] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Arguments: [cnt#23 DESC NULLS LAST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (37) + + +(37) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73/simplified.txt new file mode 100644 index 0000000000000..5bb7daa2bda9c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q73/simplified.txt @@ -0,0 +1,56 @@ +WholeStageCodegen (7) + Sort [cnt] + InputAdapter + Exchange [cnt] #1 + WholeStageCodegen (6) + Project [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number,cnt] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Filter [cnt] + HashAggregate [ss_ticket_number,ss_customer_sk,count] [count(1),cnt,count] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk] #2 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk] [count,count] + Project [ss_customer_sk,ss_ticket_number] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_county,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_vehicle_count,hd_dep_count,hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt new file mode 100644 index 0000000000000..b06961eafc6e7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/explain.txt @@ -0,0 +1,219 @@ +== Physical Plan == +TakeOrderedAndProject (37) ++- * Project (36) + +- * SortMergeJoin Inner (35) + :- * Sort (29) + : +- Exchange (28) + : +- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.household_demographics (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.store (18) + +- * Sort (34) + +- Exchange (33) + +- * Filter (32) + +- * ColumnarToRow (31) + +- Scan parquet default.customer (30) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), (ss_sold_date_sk#8 >= 2450819), (ss_sold_date_sk#8 <= 2451904), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 4] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_store_sk#4) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_dow#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dow), EqualTo(d_dow,1), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450819), LessThanOrEqual(d_date_sk,2451904), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] +Condition : (((((isnotnull(d_dow#12) AND (d_dow#12 = 1)) AND d_year#11 IN (1998,1999,2000)) AND (d_date_sk#10 >= 2450819)) AND (d_date_sk#10 <= 2451904)) AND isnotnull(d_date_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(8) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(10) Project [codegen id : 4] +Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8, d_date_sk#10] + +(11) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(EqualTo(hd_dep_count,8),GreaterThan(hd_vehicle_count,0)), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16] + +(13) Filter [codegen id : 2] +Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16] +Condition : (((hd_dep_count#15 = 8) OR (hd_vehicle_count#16 > 0)) AND isnotnull(hd_demo_sk#14)) + +(14) Project [codegen id : 2] +Output [1]: [hd_demo_sk#14] +Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16] + +(15) BroadcastExchange +Input [1]: [hd_demo_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#14] +Join condition: None + +(17) Project [codegen id : 4] +Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, hd_demo_sk#14] + +(18) Scan parquet default.store +Output [3]: [s_store_sk#18, s_number_employees#19, s_city#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_number_employees), GreaterThanOrEqual(s_number_employees,200), LessThanOrEqual(s_number_employees,295), IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [s_store_sk#18, s_number_employees#19, s_city#20] + +(20) Filter [codegen id : 3] +Input [3]: [s_store_sk#18, s_number_employees#19, s_city#20] +Condition : (((isnotnull(s_number_employees#19) AND (s_number_employees#19 >= 200)) AND (s_number_employees#19 <= 295)) AND isnotnull(s_store_sk#18)) + +(21) Project [codegen id : 3] +Output [2]: [s_store_sk#18, s_city#20] +Input [3]: [s_store_sk#18, s_number_employees#19, s_city#20] + +(22) BroadcastExchange +Input [2]: [s_store_sk#18, s_city#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#18] +Join condition: None + +(24) Project [codegen id : 4] +Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#20] +Input [8]: [ss_customer_sk#1, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_store_sk#18, s_city#20] + +(25) HashAggregate [codegen id : 4] +Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#20] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#20] +Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#6)), partial_sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum#22, sum#23] +Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#20, sum#24, sum#25] + +(26) Exchange +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#20, sum#24, sum#25] +Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#20, 5), ENSURE_REQUIREMENTS, [id=#26] + +(27) HashAggregate [codegen id : 5] +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#20, sum#24, sum#25] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#20] +Functions [2]: [sum(UnscaledValue(ss_coupon_amt#6)), sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#27, sum(UnscaledValue(ss_net_profit#7))#28] +Results [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#20, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#27,17,2) AS amt#29, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#28,17,2) AS profit#30] + +(28) Exchange +Input [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#20, amt#29, profit#30] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#31] + +(29) Sort [codegen id : 6] +Input [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#20, amt#29, profit#30] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(30) Scan parquet default.customer +Output [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 7] +Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] + +(32) Filter [codegen id : 7] +Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] +Condition : isnotnull(c_customer_sk#32) + +(33) Exchange +Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] +Arguments: hashpartitioning(c_customer_sk#32, 5), ENSURE_REQUIREMENTS, [id=#35] + +(34) Sort [codegen id : 8] +Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] +Arguments: [c_customer_sk#32 ASC NULLS FIRST], false, 0 + +(35) SortMergeJoin [codegen id : 9] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#32] +Join condition: None + +(36) Project [codegen id : 9] +Output [7]: [c_last_name#34, c_first_name#33, substr(s_city#20, 1, 30) AS substr(s_city, 1, 30)#36, ss_ticket_number#5, amt#29, profit#30, s_city#20] +Input [8]: [ss_ticket_number#5, ss_customer_sk#1, s_city#20, amt#29, profit#30, c_customer_sk#32, c_first_name#33, c_last_name#34] + +(37) TakeOrderedAndProject +Input [7]: [c_last_name#34, c_first_name#33, substr(s_city, 1, 30)#36, ss_ticket_number#5, amt#29, profit#30, s_city#20] +Arguments: 100, [c_last_name#34 ASC NULLS FIRST, c_first_name#33 ASC NULLS FIRST, substr(s_city#20, 1, 30) ASC NULLS FIRST, profit#30 ASC NULLS FIRST], [c_last_name#34, c_first_name#33, substr(s_city, 1, 30)#36, ss_ticket_number#5, amt#29, profit#30] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (38) + + +(38) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#10] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/simplified.txt new file mode 100644 index 0000000000000..bac3b763658f8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79.sf100/simplified.txt @@ -0,0 +1,61 @@ +TakeOrderedAndProject [c_last_name,c_first_name,s_city,profit,substr(s_city, 1, 30),ss_ticket_number,amt] + WholeStageCodegen (9) + Project [c_last_name,c_first_name,s_city,ss_ticket_number,amt,profit] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #1 + WholeStageCodegen (5) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,s_city,sum,sum] [sum(UnscaledValue(ss_coupon_amt)),sum(UnscaledValue(ss_net_profit)),amt,profit,sum,sum] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,s_city] #2 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,s_city,ss_coupon_amt,ss_net_profit] [sum,sum,sum,sum] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,s_city] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dow,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dow] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [s_store_sk,s_city] + Filter [s_number_employees,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_number_employees,s_city] + InputAdapter + WholeStageCodegen (8) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #6 + WholeStageCodegen (7) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79/explain.txt new file mode 100644 index 0000000000000..8162673563ea2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79/explain.txt @@ -0,0 +1,204 @@ +== Physical Plan == +TakeOrderedAndProject (34) ++- * Project (33) + +- * BroadcastHashJoin Inner BuildRight (32) + :- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.household_demographics (18) + +- BroadcastExchange (31) + +- * Filter (30) + +- * ColumnarToRow (29) + +- Scan parquet default.customer (28) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), (ss_sold_date_sk#8 >= 2450819), (ss_sold_date_sk#8 <= 2451904), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 4] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_store_sk#4) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_dow#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dow), EqualTo(d_dow,1), In(d_year, [1998,1999,2000]), GreaterThanOrEqual(d_date_sk,2450819), LessThanOrEqual(d_date_sk,2451904), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] +Condition : (((((isnotnull(d_dow#12) AND (d_dow#12 = 1)) AND d_year#11 IN (1998,1999,2000)) AND (d_date_sk#10 >= 2450819)) AND (d_date_sk#10 <= 2451904)) AND isnotnull(d_date_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(8) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(10) Project [codegen id : 4] +Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8, d_date_sk#10] + +(11) Scan parquet default.store +Output [3]: [s_store_sk#14, s_number_employees#15, s_city#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_number_employees), GreaterThanOrEqual(s_number_employees,200), LessThanOrEqual(s_number_employees,295), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [s_store_sk#14, s_number_employees#15, s_city#16] + +(13) Filter [codegen id : 2] +Input [3]: [s_store_sk#14, s_number_employees#15, s_city#16] +Condition : (((isnotnull(s_number_employees#15) AND (s_number_employees#15 >= 200)) AND (s_number_employees#15 <= 295)) AND isnotnull(s_store_sk#14)) + +(14) Project [codegen id : 2] +Output [2]: [s_store_sk#14, s_city#16] +Input [3]: [s_store_sk#14, s_number_employees#15, s_city#16] + +(15) BroadcastExchange +Input [2]: [s_store_sk#14, s_city#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#14] +Join condition: None + +(17) Project [codegen id : 4] +Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#16] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_store_sk#14, s_city#16] + +(18) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(EqualTo(hd_dep_count,8),GreaterThan(hd_vehicle_count,0)), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] + +(20) Filter [codegen id : 3] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] +Condition : (((hd_dep_count#19 = 8) OR (hd_vehicle_count#20 > 0)) AND isnotnull(hd_demo_sk#18)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#18] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#18] +Join condition: None + +(24) Project [codegen id : 4] +Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#16] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#16, hd_demo_sk#18] + +(25) HashAggregate [codegen id : 4] +Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#16] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16] +Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#6)), partial_sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum#22, sum#23] +Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16, sum#24, sum#25] + +(26) Exchange +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16, sum#24, sum#25] +Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16, 5), ENSURE_REQUIREMENTS, [id=#26] + +(27) HashAggregate [codegen id : 6] +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16, sum#24, sum#25] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16] +Functions [2]: [sum(UnscaledValue(ss_coupon_amt#6)), sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#27, sum(UnscaledValue(ss_net_profit#7))#28] +Results [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#16, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#27,17,2) AS amt#29, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#28,17,2) AS profit#30] + +(28) Scan parquet default.customer +Output [3]: [c_customer_sk#31, c_first_name#32, c_last_name#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 5] +Input [3]: [c_customer_sk#31, c_first_name#32, c_last_name#33] + +(30) Filter [codegen id : 5] +Input [3]: [c_customer_sk#31, c_first_name#32, c_last_name#33] +Condition : isnotnull(c_customer_sk#31) + +(31) BroadcastExchange +Input [3]: [c_customer_sk#31, c_first_name#32, c_last_name#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#34] + +(32) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#31] +Join condition: None + +(33) Project [codegen id : 6] +Output [7]: [c_last_name#33, c_first_name#32, substr(s_city#16, 1, 30) AS substr(s_city, 1, 30)#35, ss_ticket_number#5, amt#29, profit#30, s_city#16] +Input [8]: [ss_ticket_number#5, ss_customer_sk#1, s_city#16, amt#29, profit#30, c_customer_sk#31, c_first_name#32, c_last_name#33] + +(34) TakeOrderedAndProject +Input [7]: [c_last_name#33, c_first_name#32, substr(s_city, 1, 30)#35, ss_ticket_number#5, amt#29, profit#30, s_city#16] +Arguments: 100, [c_last_name#33 ASC NULLS FIRST, c_first_name#32 ASC NULLS FIRST, substr(s_city#16, 1, 30) ASC NULLS FIRST, profit#30 ASC NULLS FIRST], [c_last_name#33, c_first_name#32, substr(s_city, 1, 30)#35, ss_ticket_number#5, amt#29, profit#30] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#10] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79/simplified.txt new file mode 100644 index 0000000000000..6432bc55bd8f3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q79/simplified.txt @@ -0,0 +1,52 @@ +TakeOrderedAndProject [c_last_name,c_first_name,s_city,profit,substr(s_city, 1, 30),ss_ticket_number,amt] + WholeStageCodegen (6) + Project [c_last_name,c_first_name,s_city,ss_ticket_number,amt,profit] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,s_city,sum,sum] [sum(UnscaledValue(ss_coupon_amt)),sum(UnscaledValue(ss_net_profit)),amt,profit,sum,sum] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,s_city] #1 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,s_city,ss_coupon_amt,ss_net_profit] [sum,sum,sum,sum] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,s_city] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,s_city] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dow,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dow] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [s_store_sk,s_city] + Filter [s_number_employees,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_number_employees,s_city] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (5) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89.sf100/explain.txt new file mode 100644 index 0000000000000..a325bf820a4f9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89.sf100/explain.txt @@ -0,0 +1,186 @@ +== Physical Plan == +TakeOrderedAndProject (31) ++- * Project (30) + +- * Filter (29) + +- Window (28) + +- * Sort (27) + +- Exchange (26) + +- * HashAggregate (25) + +- Exchange (24) + +- * HashAggregate (23) + +- * Project (22) + +- * BroadcastHashJoin Inner BuildRight (21) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.store (11) + +- BroadcastExchange (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.item (17) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), (ss_sold_date_sk#4 >= 2451545), (ss_sold_date_sk#4 <= 2451910), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_store_sk#2)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), GreaterThanOrEqual(d_date_sk,2451545), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((isnotnull(d_year#7) AND (d_year#7 = 2000)) AND (d_date_sk#6 >= 2451545)) AND (d_date_sk#6 <= 2451910)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#6, d_moy#8] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(8) BroadcastExchange +Input [2]: [d_date_sk#6, d_moy#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, d_moy#8] +Input [6]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4, d_date_sk#6, d_moy#8] + +(11) Scan parquet default.store +Output [3]: [s_store_sk#10, s_store_name#11, s_company_name#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [s_store_sk#10, s_store_name#11, s_company_name#12] + +(13) Filter [codegen id : 2] +Input [3]: [s_store_sk#10, s_store_name#11, s_company_name#12] +Condition : isnotnull(s_store_sk#10) + +(14) BroadcastExchange +Input [3]: [s_store_sk#10, s_store_name#11, s_company_name#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#10] +Join condition: None + +(16) Project [codegen id : 4] +Output [5]: [ss_item_sk#1, ss_sales_price#3, d_moy#8, s_store_name#11, s_company_name#12] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, d_moy#8, s_store_sk#10, s_store_name#11, s_company_name#12] + +(17) Scan parquet default.item +Output [4]: [i_item_sk#14, i_brand#15, i_class#16, i_category#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(In(i_category, [Home ,Books ,Electronics ]),In(i_class, [wallpaper ,parenting ,musical ])),And(In(i_category, [Shoes ,Jewelry ,Men ]),In(i_class, [womens ,birdal ,pants ]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [4]: [i_item_sk#14, i_brand#15, i_class#16, i_category#17] + +(19) Filter [codegen id : 3] +Input [4]: [i_item_sk#14, i_brand#15, i_class#16, i_category#17] +Condition : (((i_category#17 IN (Home ,Books ,Electronics ) AND i_class#16 IN (wallpaper ,parenting ,musical )) OR (i_category#17 IN (Shoes ,Jewelry ,Men ) AND i_class#16 IN (womens ,birdal ,pants ))) AND isnotnull(i_item_sk#14)) + +(20) BroadcastExchange +Input [4]: [i_item_sk#14, i_brand#15, i_class#16, i_category#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#14] +Join condition: None + +(22) Project [codegen id : 4] +Output [7]: [i_brand#15, i_class#16, i_category#17, ss_sales_price#3, d_moy#8, s_store_name#11, s_company_name#12] +Input [9]: [ss_item_sk#1, ss_sales_price#3, d_moy#8, s_store_name#11, s_company_name#12, i_item_sk#14, i_brand#15, i_class#16, i_category#17] + +(23) HashAggregate [codegen id : 4] +Input [7]: [i_brand#15, i_class#16, i_category#17, ss_sales_price#3, d_moy#8, s_store_name#11, s_company_name#12] +Keys [6]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#3))] +Aggregate Attributes [1]: [sum#19] +Results [7]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, sum#20] + +(24) Exchange +Input [7]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, sum#20] +Arguments: hashpartitioning(i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, 5), ENSURE_REQUIREMENTS, [id=#21] + +(25) HashAggregate [codegen id : 5] +Input [7]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, sum#20] +Keys [6]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8] +Functions [1]: [sum(UnscaledValue(ss_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#3))#22] +Results [8]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#22,17,2) AS sum_sales#23, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#22,17,2) AS _w0#24] + +(26) Exchange +Input [8]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, sum_sales#23, _w0#24] +Arguments: hashpartitioning(i_category#17, i_brand#15, s_store_name#11, s_company_name#12, 5), ENSURE_REQUIREMENTS, [id=#25] + +(27) Sort [codegen id : 6] +Input [8]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, sum_sales#23, _w0#24] +Arguments: [i_category#17 ASC NULLS FIRST, i_brand#15 ASC NULLS FIRST, s_store_name#11 ASC NULLS FIRST, s_company_name#12 ASC NULLS FIRST], false, 0 + +(28) Window +Input [8]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, sum_sales#23, _w0#24] +Arguments: [avg(_w0#24) windowspecdefinition(i_category#17, i_brand#15, s_store_name#11, s_company_name#12, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#26], [i_category#17, i_brand#15, s_store_name#11, s_company_name#12] + +(29) Filter [codegen id : 7] +Input [9]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, sum_sales#23, _w0#24, avg_monthly_sales#26] +Condition : (isnotnull(avg_monthly_sales#26) AND (NOT (avg_monthly_sales#26 = 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#23 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000))) + +(30) Project [codegen id : 7] +Output [8]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, sum_sales#23, avg_monthly_sales#26] +Input [9]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, sum_sales#23, _w0#24, avg_monthly_sales#26] + +(31) TakeOrderedAndProject +Input [8]: [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, sum_sales#23, avg_monthly_sales#26] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#23 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#11 ASC NULLS FIRST], [i_category#17, i_class#16, i_brand#15, s_store_name#11, s_company_name#12, d_moy#8, sum_sales#23, avg_monthly_sales#26] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (32) + + +(32) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#6, d_moy#8] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89.sf100/simplified.txt new file mode 100644 index 0000000000000..c77c34f4408d9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89.sf100/simplified.txt @@ -0,0 +1,50 @@ +TakeOrderedAndProject [sum_sales,avg_monthly_sales,s_store_name,i_category,i_class,i_brand,s_company_name,d_moy] + WholeStageCodegen (7) + Project [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,sum_sales,avg_monthly_sales] + Filter [avg_monthly_sales,sum_sales] + InputAdapter + Window [_w0,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (6) + Sort [i_category,i_brand,s_store_name,s_company_name] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name] #1 + WholeStageCodegen (5) + HashAggregate [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy] #2 + WholeStageCodegen (4) + HashAggregate [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,ss_sales_price] [sum,sum] + Project [i_brand,i_class,i_category,ss_sales_price,d_moy,s_store_name,s_company_name] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_sales_price,d_moy,s_store_name,s_company_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_sales_price,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_moy] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk,d_moy] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_company_name] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [i_category,i_class,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89/explain.txt new file mode 100644 index 0000000000000..2ec1ea034361a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89/explain.txt @@ -0,0 +1,186 @@ +== Physical Plan == +TakeOrderedAndProject (31) ++- * Project (30) + +- * Filter (29) + +- Window (28) + +- * Sort (27) + +- Exchange (26) + +- * HashAggregate (25) + +- Exchange (24) + +- * HashAggregate (23) + +- * Project (22) + +- * BroadcastHashJoin Inner BuildRight (21) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (9) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.store_sales (4) + : +- BroadcastExchange (14) + : +- * Project (13) + : +- * Filter (12) + : +- * ColumnarToRow (11) + : +- Scan parquet default.date_dim (10) + +- BroadcastExchange (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.store (17) + + +(1) Scan parquet default.item +Output [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(In(i_category, [Home ,Books ,Electronics ]),In(i_class, [wallpaper ,parenting ,musical ])),And(In(i_category, [Shoes ,Jewelry ,Men ]),In(i_class, [womens ,birdal ,pants ]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] + +(3) Filter [codegen id : 4] +Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] +Condition : (((i_category#4 IN (Home ,Books ,Electronics ) AND i_class#3 IN (wallpaper ,parenting ,musical )) OR (i_category#4 IN (Shoes ,Jewelry ,Men ) AND i_class#3 IN (womens ,birdal ,pants ))) AND isnotnull(i_item_sk#1)) + +(4) Scan parquet default.store_sales +Output [4]: [ss_item_sk#5, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), (ss_sold_date_sk#8 >= 2451545), (ss_sold_date_sk#8 <= 2451910), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#5, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8] + +(6) Filter [codegen id : 1] +Input [4]: [ss_item_sk#5, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8] +Condition : (isnotnull(ss_item_sk#5) AND isnotnull(ss_store_sk#6)) + +(7) BroadcastExchange +Input [4]: [ss_item_sk#5, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] + +(8) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#5] +Join condition: None + +(9) Project [codegen id : 4] +Output [6]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8] +Input [8]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, ss_item_sk#5, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8] + +(10) Scan parquet default.date_dim +Output [3]: [d_date_sk#11, d_year#12, d_moy#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), GreaterThanOrEqual(d_date_sk,2451545), LessThanOrEqual(d_date_sk,2451910), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(12) Filter [codegen id : 2] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] +Condition : ((((isnotnull(d_year#12) AND (d_year#12 = 2000)) AND (d_date_sk#11 >= 2451545)) AND (d_date_sk#11 <= 2451910)) AND isnotnull(d_date_sk#11)) + +(13) Project [codegen id : 2] +Output [2]: [d_date_sk#11, d_moy#13] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(14) BroadcastExchange +Input [2]: [d_date_sk#11, d_moy#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(16) Project [codegen id : 4] +Output [6]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, d_moy#13] +Input [8]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8, d_date_sk#11, d_moy#13] + +(17) Scan parquet default.store +Output [3]: [s_store_sk#15, s_store_name#16, s_company_name#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [3]: [s_store_sk#15, s_store_name#16, s_company_name#17] + +(19) Filter [codegen id : 3] +Input [3]: [s_store_sk#15, s_store_name#16, s_company_name#17] +Condition : isnotnull(s_store_sk#15) + +(20) BroadcastExchange +Input [3]: [s_store_sk#15, s_store_name#16, s_company_name#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#6] +Right keys [1]: [s_store_sk#15] +Join condition: None + +(22) Project [codegen id : 4] +Output [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#7, d_moy#13, s_store_name#16, s_company_name#17] +Input [9]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, d_moy#13, s_store_sk#15, s_store_name#16, s_company_name#17] + +(23) HashAggregate [codegen id : 4] +Input [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#7, d_moy#13, s_store_name#16, s_company_name#17] +Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#7))] +Aggregate Attributes [1]: [sum#19] +Results [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum#20] + +(24) Exchange +Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum#20] +Arguments: hashpartitioning(i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, 5), ENSURE_REQUIREMENTS, [id=#21] + +(25) HashAggregate [codegen id : 5] +Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum#20] +Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13] +Functions [1]: [sum(UnscaledValue(ss_sales_price#7))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#7))#22] +Results [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#22,17,2) AS sum_sales#23, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#22,17,2) AS _w0#24] + +(26) Exchange +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24] +Arguments: hashpartitioning(i_category#4, i_brand#2, s_store_name#16, s_company_name#17, 5), ENSURE_REQUIREMENTS, [id=#25] + +(27) Sort [codegen id : 6] +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24] +Arguments: [i_category#4 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, s_store_name#16 ASC NULLS FIRST, s_company_name#17 ASC NULLS FIRST], false, 0 + +(28) Window +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24] +Arguments: [avg(_w0#24) windowspecdefinition(i_category#4, i_brand#2, s_store_name#16, s_company_name#17, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#26], [i_category#4, i_brand#2, s_store_name#16, s_company_name#17] + +(29) Filter [codegen id : 7] +Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24, avg_monthly_sales#26] +Condition : (isnotnull(avg_monthly_sales#26) AND (NOT (avg_monthly_sales#26 = 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#23 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000))) + +(30) Project [codegen id : 7] +Output [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, avg_monthly_sales#26] +Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24, avg_monthly_sales#26] + +(31) TakeOrderedAndProject +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, avg_monthly_sales#26] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#23 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#16 ASC NULLS FIRST], [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, avg_monthly_sales#26] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (32) + + +(32) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#11, d_moy#13] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89/simplified.txt new file mode 100644 index 0000000000000..b96445eec6223 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q89/simplified.txt @@ -0,0 +1,50 @@ +TakeOrderedAndProject [sum_sales,avg_monthly_sales,s_store_name,i_category,i_class,i_brand,s_company_name,d_moy] + WholeStageCodegen (7) + Project [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,sum_sales,avg_monthly_sales] + Filter [avg_monthly_sales,sum_sales] + InputAdapter + Window [_w0,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (6) + Sort [i_category,i_brand,s_store_name,s_company_name] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name] #1 + WholeStageCodegen (5) + HashAggregate [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy] #2 + WholeStageCodegen (4) + HashAggregate [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,ss_sales_price] [sum,sum] + Project [i_brand,i_class,i_category,ss_sales_price,d_moy,s_store_name,s_company_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_brand,i_class,i_category,ss_store_sk,ss_sales_price,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_brand,i_class,i_category,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + Filter [i_category,i_class,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_moy] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk,d_moy] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_company_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt new file mode 100644 index 0000000000000..9d369b5d211fc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/explain.txt @@ -0,0 +1,173 @@ +== Physical Plan == +* Project (29) ++- * Sort (28) + +- Exchange (27) + +- * Project (26) + +- Window (25) + +- * Sort (24) + +- Exchange (23) + +- * HashAggregate (22) + +- Exchange (21) + +- * HashAggregate (20) + +- * Project (19) + +- * SortMergeJoin Inner (18) + :- * Sort (12) + : +- Exchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (17) + +- Exchange (16) + +- * Filter (15) + +- * ColumnarToRow (14) + +- Scan parquet default.item (13) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), (ss_sold_date_sk#3 >= 2451911), (ss_sold_date_sk#3 <= 2451941), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_date#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2001-01-01), LessThanOrEqual(d_date,2001-01-31), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2451941), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_date#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_date#6] +Condition : (((((isnotnull(d_date#6) AND (d_date#6 >= 2001-01-01)) AND (d_date#6 <= 2001-01-31)) AND (d_date_sk#5 >= 2451911)) AND (d_date_sk#5 <= 2451941)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_date#6] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 2] +Output [2]: [ss_item_sk#1, ss_ext_sales_price#2] +Input [4]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, d_date_sk#5] + +(11) Exchange +Input [2]: [ss_item_sk#1, ss_ext_sales_price#2] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#8] + +(12) Sort [codegen id : 3] +Input [2]: [ss_item_sk#1, ss_ext_sales_price#2] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.item +Output [6]: [i_item_sk#9, i_item_id#10, i_item_desc#11, i_current_price#12, i_class#13, i_category#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Jewelry ,Sports ,Books ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#9, i_item_id#10, i_item_desc#11, i_current_price#12, i_class#13, i_category#14] + +(15) Filter [codegen id : 4] +Input [6]: [i_item_sk#9, i_item_id#10, i_item_desc#11, i_current_price#12, i_class#13, i_category#14] +Condition : (i_category#14 IN (Jewelry ,Sports ,Books ) AND isnotnull(i_item_sk#9)) + +(16) Exchange +Input [6]: [i_item_sk#9, i_item_id#10, i_item_desc#11, i_current_price#12, i_class#13, i_category#14] +Arguments: hashpartitioning(i_item_sk#9, 5), ENSURE_REQUIREMENTS, [id=#15] + +(17) Sort [codegen id : 5] +Input [6]: [i_item_sk#9, i_item_id#10, i_item_desc#11, i_current_price#12, i_class#13, i_category#14] +Arguments: [i_item_sk#9 ASC NULLS FIRST], false, 0 + +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#9] +Join condition: None + +(19) Project [codegen id : 6] +Output [6]: [ss_ext_sales_price#2, i_item_id#10, i_item_desc#11, i_current_price#12, i_class#13, i_category#14] +Input [8]: [ss_item_sk#1, ss_ext_sales_price#2, i_item_sk#9, i_item_id#10, i_item_desc#11, i_current_price#12, i_class#13, i_category#14] + +(20) HashAggregate [codegen id : 6] +Input [6]: [ss_ext_sales_price#2, i_item_id#10, i_item_desc#11, i_current_price#12, i_class#13, i_category#14] +Keys [5]: [i_item_id#10, i_item_desc#11, i_category#14, i_class#13, i_current_price#12] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#16] +Results [6]: [i_item_id#10, i_item_desc#11, i_category#14, i_class#13, i_current_price#12, sum#17] + +(21) Exchange +Input [6]: [i_item_id#10, i_item_desc#11, i_category#14, i_class#13, i_current_price#12, sum#17] +Arguments: hashpartitioning(i_item_id#10, i_item_desc#11, i_category#14, i_class#13, i_current_price#12, 5), ENSURE_REQUIREMENTS, [id=#18] + +(22) HashAggregate [codegen id : 7] +Input [6]: [i_item_id#10, i_item_desc#11, i_category#14, i_class#13, i_current_price#12, sum#17] +Keys [5]: [i_item_id#10, i_item_desc#11, i_category#14, i_class#13, i_current_price#12] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#19] +Results [8]: [i_item_desc#11, i_category#14, i_class#13, i_current_price#12, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#19,17,2) AS itemrevenue#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#19,17,2) AS _w0#21, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#19,17,2) AS _w1#22, i_item_id#10] + +(23) Exchange +Input [8]: [i_item_desc#11, i_category#14, i_class#13, i_current_price#12, itemrevenue#20, _w0#21, _w1#22, i_item_id#10] +Arguments: hashpartitioning(i_class#13, 5), ENSURE_REQUIREMENTS, [id=#23] + +(24) Sort [codegen id : 8] +Input [8]: [i_item_desc#11, i_category#14, i_class#13, i_current_price#12, itemrevenue#20, _w0#21, _w1#22, i_item_id#10] +Arguments: [i_class#13 ASC NULLS FIRST], false, 0 + +(25) Window +Input [8]: [i_item_desc#11, i_category#14, i_class#13, i_current_price#12, itemrevenue#20, _w0#21, _w1#22, i_item_id#10] +Arguments: [sum(_w1#22) windowspecdefinition(i_class#13, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#24], [i_class#13] + +(26) Project [codegen id : 9] +Output [7]: [i_item_desc#11, i_category#14, i_class#13, i_current_price#12, itemrevenue#20, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#21) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#24)), DecimalType(38,17), true) AS revenueratio#25, i_item_id#10] +Input [9]: [i_item_desc#11, i_category#14, i_class#13, i_current_price#12, itemrevenue#20, _w0#21, _w1#22, i_item_id#10, _we0#24] + +(27) Exchange +Input [7]: [i_item_desc#11, i_category#14, i_class#13, i_current_price#12, itemrevenue#20, revenueratio#25, i_item_id#10] +Arguments: rangepartitioning(i_category#14 ASC NULLS FIRST, i_class#13 ASC NULLS FIRST, i_item_id#10 ASC NULLS FIRST, i_item_desc#11 ASC NULLS FIRST, revenueratio#25 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#26] + +(28) Sort [codegen id : 10] +Input [7]: [i_item_desc#11, i_category#14, i_class#13, i_current_price#12, itemrevenue#20, revenueratio#25, i_item_id#10] +Arguments: [i_category#14 ASC NULLS FIRST, i_class#13 ASC NULLS FIRST, i_item_id#10 ASC NULLS FIRST, i_item_desc#11 ASC NULLS FIRST, revenueratio#25 ASC NULLS FIRST], true, 0 + +(29) Project [codegen id : 10] +Output [6]: [i_item_desc#11, i_category#14, i_class#13, i_current_price#12, itemrevenue#20, revenueratio#25] +Input [7]: [i_item_desc#11, i_category#14, i_class#13, i_current_price#12, itemrevenue#20, revenueratio#25, i_item_id#10] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (30) + + +(30) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/simplified.txt new file mode 100644 index 0000000000000..872ab90b8c3c8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98.sf100/simplified.txt @@ -0,0 +1,53 @@ +WholeStageCodegen (10) + Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,revenueratio] + Sort [i_category,i_class,i_item_id,i_item_desc,revenueratio] + InputAdapter + Exchange [i_category,i_class,i_item_id,i_item_desc,revenueratio] #1 + WholeStageCodegen (9) + Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0,i_item_id] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (8) + Sort [i_class] + InputAdapter + Exchange [i_class] #2 + WholeStageCodegen (7) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(ss_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #3 + WholeStageCodegen (6) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (2) + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #6 + WholeStageCodegen (4) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98/explain.txt new file mode 100644 index 0000000000000..e31c029b4932e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98/explain.txt @@ -0,0 +1,158 @@ +== Physical Plan == +* Project (26) ++- * Sort (25) + +- Exchange (24) + +- * Project (23) + +- Window (22) + +- * Sort (21) + +- Exchange (20) + +- * HashAggregate (19) + +- Exchange (18) + +- * HashAggregate (17) + +- * Project (16) + +- * BroadcastHashJoin Inner BuildRight (15) + :- * Project (9) + : +- * BroadcastHashJoin Inner BuildRight (8) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) + +- BroadcastExchange (14) + +- * Project (13) + +- * Filter (12) + +- * ColumnarToRow (11) + +- Scan parquet default.date_dim (10) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), (ss_sold_date_sk#3 >= 2451911), (ss_sold_date_sk#3 <= 2451941), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Jewelry ,Sports ,Books ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Jewelry ,Sports ,Books ) AND isnotnull(i_item_sk#5)) + +(7) BroadcastExchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(9) Project [codegen id : 3] +Output [7]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2001-01-01), LessThanOrEqual(d_date,2001-01-31), GreaterThanOrEqual(d_date_sk,2451911), LessThanOrEqual(d_date_sk,2451941), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((((isnotnull(d_date#13) AND (d_date#13 >= 2001-01-01)) AND (d_date#13 <= 2001-01-31)) AND (d_date_sk#12 >= 2451911)) AND (d_date_sk#12 <= 2451941)) AND isnotnull(d_date_sk#12)) + +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] + +(14) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#12] +Join condition: None + +(16) Project [codegen id : 3] +Output [6]: [ss_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] + +(17) HashAggregate [codegen id : 3] +Input [6]: [ss_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#15] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] + +(18) Exchange +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), ENSURE_REQUIREMENTS, [id=#17] + +(19) HashAggregate [codegen id : 4] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#18] +Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#18,17,2) AS _w1#21, i_item_id#6] + +(20) Exchange +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: hashpartitioning(i_class#9, 5), ENSURE_REQUIREMENTS, [id=#22] + +(21) Sort [codegen id : 5] +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 + +(22) Window +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] + +(23) Project [codegen id : 6] +Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#6] +Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6, _we0#23] + +(24) Exchange +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] +Arguments: rangepartitioning(i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#25] + +(25) Sort [codegen id : 7] +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] +Arguments: [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 + +(26) Project [codegen id : 7] +Output [6]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (27) + + +(27) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98/simplified.txt new file mode 100644 index 0000000000000..67205dff3ad35 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/q98/simplified.txt @@ -0,0 +1,44 @@ +WholeStageCodegen (7) + Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,revenueratio] + Sort [i_category,i_class,i_item_id,i_item_desc,revenueratio] + InputAdapter + Exchange [i_category,i_class,i_item_id,i_item_desc,revenueratio] #1 + WholeStageCodegen (6) + Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0,i_item_id] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (5) + Sort [i_class] + InputAdapter + Exchange [i_class] #2 + WholeStageCodegen (4) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(ss_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #3 + WholeStageCodegen (3) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_ext_sales_price,ss_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max.sf100/explain.txt new file mode 100644 index 0000000000000..1ebc9a69a3865 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max.sf100/explain.txt @@ -0,0 +1,56 @@ +== Physical Plan == +* HashAggregate (8) ++- Exchange (7) + +- * HashAggregate (6) + +- * HashAggregate (5) + +- Exchange (4) + +- * HashAggregate (3) + +- * ColumnarToRow (2) + +- Scan parquet default.store_sales (1) + + +(1) Scan parquet default.store_sales +Output [9]: [ss_sold_time_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_cdemo_sk#4, ss_hdemo_sk#5, ss_addr_sk#6, ss_store_sk#7, ss_promo_sk#8, ss_sold_date_sk#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [9]: [ss_sold_time_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_cdemo_sk#4, ss_hdemo_sk#5, ss_addr_sk#6, ss_store_sk#7, ss_promo_sk#8, ss_sold_date_sk#9] + +(3) HashAggregate [codegen id : 1] +Input [9]: [ss_sold_time_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_cdemo_sk#4, ss_hdemo_sk#5, ss_addr_sk#6, ss_store_sk#7, ss_promo_sk#8, ss_sold_date_sk#9] +Keys [1]: [ss_sold_date_sk#9] +Functions [11]: [partial_count(1), partial_count(ss_sold_date_sk#9), partial_max(ss_sold_date_sk#9), partial_max(ss_sold_time_sk#1), partial_max(ss_item_sk#2), partial_max(ss_customer_sk#3), partial_max(ss_cdemo_sk#4), partial_max(ss_hdemo_sk#5), partial_max(ss_addr_sk#6), partial_max(ss_store_sk#7), partial_max(ss_promo_sk#8)] +Aggregate Attributes [11]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20] +Results [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31] + +(4) Exchange +Input [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31] +Arguments: hashpartitioning(ss_sold_date_sk#9, 5), ENSURE_REQUIREMENTS, [id=#32] + +(5) HashAggregate [codegen id : 2] +Input [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31] +Keys [1]: [ss_sold_date_sk#9] +Functions [11]: [merge_count(1), merge_count(ss_sold_date_sk#9), merge_max(ss_sold_date_sk#9), merge_max(ss_sold_time_sk#1), merge_max(ss_item_sk#2), merge_max(ss_customer_sk#3), merge_max(ss_cdemo_sk#4), merge_max(ss_hdemo_sk#5), merge_max(ss_addr_sk#6), merge_max(ss_store_sk#7), merge_max(ss_promo_sk#8)] +Aggregate Attributes [11]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20] +Results [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31] + +(6) HashAggregate [codegen id : 2] +Input [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31] +Keys: [] +Functions [12]: [merge_count(1), merge_count(ss_sold_date_sk#9), merge_max(ss_sold_date_sk#9), merge_max(ss_sold_time_sk#1), merge_max(ss_item_sk#2), merge_max(ss_customer_sk#3), merge_max(ss_cdemo_sk#4), merge_max(ss_hdemo_sk#5), merge_max(ss_addr_sk#6), merge_max(ss_store_sk#7), merge_max(ss_promo_sk#8), partial_count(distinct ss_sold_date_sk#9)] +Aggregate Attributes [12]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20, count(ss_sold_date_sk#9)#33] +Results [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#34] + +(7) Exchange +Input [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#34] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#35] + +(8) HashAggregate [codegen id : 3] +Input [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#34] +Keys: [] +Functions [12]: [count(1), count(ss_sold_date_sk#9), max(ss_sold_date_sk#9), max(ss_sold_time_sk#1), max(ss_item_sk#2), max(ss_customer_sk#3), max(ss_cdemo_sk#4), max(ss_hdemo_sk#5), max(ss_addr_sk#6), max(ss_store_sk#7), max(ss_promo_sk#8), count(distinct ss_sold_date_sk#9)] +Aggregate Attributes [12]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20, count(ss_sold_date_sk#9)#33] +Results [12]: [count(1)#10 AS total#36, count(ss_sold_date_sk#9)#11 AS not_null_total#37, count(ss_sold_date_sk#9)#33 AS unique_days#38, max(ss_sold_date_sk#9)#12 AS max_ss_sold_date_sk#39, max(ss_sold_time_sk#1)#13 AS max_ss_sold_time_sk#40, max(ss_item_sk#2)#14 AS max_ss_item_sk#41, max(ss_customer_sk#3)#15 AS max_ss_customer_sk#42, max(ss_cdemo_sk#4)#16 AS max_ss_cdemo_sk#43, max(ss_hdemo_sk#5)#17 AS max_ss_hdemo_sk#44, max(ss_addr_sk#6)#18 AS max_ss_addr_sk#45, max(ss_store_sk#7)#19 AS max_ss_store_sk#46, max(ss_promo_sk#8)#20 AS max_ss_promo_sk#47] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max.sf100/simplified.txt new file mode 100644 index 0000000000000..0d132018b90e2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max.sf100/simplified.txt @@ -0,0 +1,14 @@ +WholeStageCodegen (3) + HashAggregate [count,count,max,max,max,max,max,max,max,max,max,count] [count(1),count(ss_sold_date_sk),max(ss_sold_date_sk),max(ss_sold_time_sk),max(ss_item_sk),max(ss_customer_sk),max(ss_cdemo_sk),max(ss_hdemo_sk),max(ss_addr_sk),max(ss_store_sk),max(ss_promo_sk),count(ss_sold_date_sk),total,not_null_total,unique_days,max_ss_sold_date_sk,max_ss_sold_time_sk,max_ss_item_sk,max_ss_customer_sk,max_ss_cdemo_sk,max_ss_hdemo_sk,max_ss_addr_sk,max_ss_store_sk,max_ss_promo_sk,count,count,max,max,max,max,max,max,max,max,max,count] + InputAdapter + Exchange #1 + WholeStageCodegen (2) + HashAggregate [ss_sold_date_sk] [count(1),count(ss_sold_date_sk),max(ss_sold_date_sk),max(ss_sold_time_sk),max(ss_item_sk),max(ss_customer_sk),max(ss_cdemo_sk),max(ss_hdemo_sk),max(ss_addr_sk),max(ss_store_sk),max(ss_promo_sk),count(ss_sold_date_sk),count,count,max,max,max,max,max,max,max,max,max,count,count,count,max,max,max,max,max,max,max,max,max,count] + HashAggregate [ss_sold_date_sk] [count(1),count(ss_sold_date_sk),max(ss_sold_date_sk),max(ss_sold_time_sk),max(ss_item_sk),max(ss_customer_sk),max(ss_cdemo_sk),max(ss_hdemo_sk),max(ss_addr_sk),max(ss_store_sk),max(ss_promo_sk),count,count,max,max,max,max,max,max,max,max,max,count,count,max,max,max,max,max,max,max,max,max] + InputAdapter + Exchange [ss_sold_date_sk] #2 + WholeStageCodegen (1) + HashAggregate [ss_sold_date_sk,ss_sold_time_sk,ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk] [count(1),count(ss_sold_date_sk),max(ss_sold_date_sk),max(ss_sold_time_sk),max(ss_item_sk),max(ss_customer_sk),max(ss_cdemo_sk),max(ss_hdemo_sk),max(ss_addr_sk),max(ss_store_sk),max(ss_promo_sk),count,count,max,max,max,max,max,max,max,max,max,count,count,max,max,max,max,max,max,max,max,max] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max/explain.txt new file mode 100644 index 0000000000000..1ebc9a69a3865 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max/explain.txt @@ -0,0 +1,56 @@ +== Physical Plan == +* HashAggregate (8) ++- Exchange (7) + +- * HashAggregate (6) + +- * HashAggregate (5) + +- Exchange (4) + +- * HashAggregate (3) + +- * ColumnarToRow (2) + +- Scan parquet default.store_sales (1) + + +(1) Scan parquet default.store_sales +Output [9]: [ss_sold_time_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_cdemo_sk#4, ss_hdemo_sk#5, ss_addr_sk#6, ss_store_sk#7, ss_promo_sk#8, ss_sold_date_sk#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [9]: [ss_sold_time_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_cdemo_sk#4, ss_hdemo_sk#5, ss_addr_sk#6, ss_store_sk#7, ss_promo_sk#8, ss_sold_date_sk#9] + +(3) HashAggregate [codegen id : 1] +Input [9]: [ss_sold_time_sk#1, ss_item_sk#2, ss_customer_sk#3, ss_cdemo_sk#4, ss_hdemo_sk#5, ss_addr_sk#6, ss_store_sk#7, ss_promo_sk#8, ss_sold_date_sk#9] +Keys [1]: [ss_sold_date_sk#9] +Functions [11]: [partial_count(1), partial_count(ss_sold_date_sk#9), partial_max(ss_sold_date_sk#9), partial_max(ss_sold_time_sk#1), partial_max(ss_item_sk#2), partial_max(ss_customer_sk#3), partial_max(ss_cdemo_sk#4), partial_max(ss_hdemo_sk#5), partial_max(ss_addr_sk#6), partial_max(ss_store_sk#7), partial_max(ss_promo_sk#8)] +Aggregate Attributes [11]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20] +Results [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31] + +(4) Exchange +Input [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31] +Arguments: hashpartitioning(ss_sold_date_sk#9, 5), ENSURE_REQUIREMENTS, [id=#32] + +(5) HashAggregate [codegen id : 2] +Input [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31] +Keys [1]: [ss_sold_date_sk#9] +Functions [11]: [merge_count(1), merge_count(ss_sold_date_sk#9), merge_max(ss_sold_date_sk#9), merge_max(ss_sold_time_sk#1), merge_max(ss_item_sk#2), merge_max(ss_customer_sk#3), merge_max(ss_cdemo_sk#4), merge_max(ss_hdemo_sk#5), merge_max(ss_addr_sk#6), merge_max(ss_store_sk#7), merge_max(ss_promo_sk#8)] +Aggregate Attributes [11]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20] +Results [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31] + +(6) HashAggregate [codegen id : 2] +Input [12]: [ss_sold_date_sk#9, count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31] +Keys: [] +Functions [12]: [merge_count(1), merge_count(ss_sold_date_sk#9), merge_max(ss_sold_date_sk#9), merge_max(ss_sold_time_sk#1), merge_max(ss_item_sk#2), merge_max(ss_customer_sk#3), merge_max(ss_cdemo_sk#4), merge_max(ss_hdemo_sk#5), merge_max(ss_addr_sk#6), merge_max(ss_store_sk#7), merge_max(ss_promo_sk#8), partial_count(distinct ss_sold_date_sk#9)] +Aggregate Attributes [12]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20, count(ss_sold_date_sk#9)#33] +Results [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#34] + +(7) Exchange +Input [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#34] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#35] + +(8) HashAggregate [codegen id : 3] +Input [12]: [count#21, count#22, max#23, max#24, max#25, max#26, max#27, max#28, max#29, max#30, max#31, count#34] +Keys: [] +Functions [12]: [count(1), count(ss_sold_date_sk#9), max(ss_sold_date_sk#9), max(ss_sold_time_sk#1), max(ss_item_sk#2), max(ss_customer_sk#3), max(ss_cdemo_sk#4), max(ss_hdemo_sk#5), max(ss_addr_sk#6), max(ss_store_sk#7), max(ss_promo_sk#8), count(distinct ss_sold_date_sk#9)] +Aggregate Attributes [12]: [count(1)#10, count(ss_sold_date_sk#9)#11, max(ss_sold_date_sk#9)#12, max(ss_sold_time_sk#1)#13, max(ss_item_sk#2)#14, max(ss_customer_sk#3)#15, max(ss_cdemo_sk#4)#16, max(ss_hdemo_sk#5)#17, max(ss_addr_sk#6)#18, max(ss_store_sk#7)#19, max(ss_promo_sk#8)#20, count(ss_sold_date_sk#9)#33] +Results [12]: [count(1)#10 AS total#36, count(ss_sold_date_sk#9)#11 AS not_null_total#37, count(ss_sold_date_sk#9)#33 AS unique_days#38, max(ss_sold_date_sk#9)#12 AS max_ss_sold_date_sk#39, max(ss_sold_time_sk#1)#13 AS max_ss_sold_time_sk#40, max(ss_item_sk#2)#14 AS max_ss_item_sk#41, max(ss_customer_sk#3)#15 AS max_ss_customer_sk#42, max(ss_cdemo_sk#4)#16 AS max_ss_cdemo_sk#43, max(ss_hdemo_sk#5)#17 AS max_ss_hdemo_sk#44, max(ss_addr_sk#6)#18 AS max_ss_addr_sk#45, max(ss_store_sk#7)#19 AS max_ss_store_sk#46, max(ss_promo_sk#8)#20 AS max_ss_promo_sk#47] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max/simplified.txt new file mode 100644 index 0000000000000..0d132018b90e2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-modified/ss_max/simplified.txt @@ -0,0 +1,14 @@ +WholeStageCodegen (3) + HashAggregate [count,count,max,max,max,max,max,max,max,max,max,count] [count(1),count(ss_sold_date_sk),max(ss_sold_date_sk),max(ss_sold_time_sk),max(ss_item_sk),max(ss_customer_sk),max(ss_cdemo_sk),max(ss_hdemo_sk),max(ss_addr_sk),max(ss_store_sk),max(ss_promo_sk),count(ss_sold_date_sk),total,not_null_total,unique_days,max_ss_sold_date_sk,max_ss_sold_time_sk,max_ss_item_sk,max_ss_customer_sk,max_ss_cdemo_sk,max_ss_hdemo_sk,max_ss_addr_sk,max_ss_store_sk,max_ss_promo_sk,count,count,max,max,max,max,max,max,max,max,max,count] + InputAdapter + Exchange #1 + WholeStageCodegen (2) + HashAggregate [ss_sold_date_sk] [count(1),count(ss_sold_date_sk),max(ss_sold_date_sk),max(ss_sold_time_sk),max(ss_item_sk),max(ss_customer_sk),max(ss_cdemo_sk),max(ss_hdemo_sk),max(ss_addr_sk),max(ss_store_sk),max(ss_promo_sk),count(ss_sold_date_sk),count,count,max,max,max,max,max,max,max,max,max,count,count,count,max,max,max,max,max,max,max,max,max,count] + HashAggregate [ss_sold_date_sk] [count(1),count(ss_sold_date_sk),max(ss_sold_date_sk),max(ss_sold_time_sk),max(ss_item_sk),max(ss_customer_sk),max(ss_cdemo_sk),max(ss_hdemo_sk),max(ss_addr_sk),max(ss_store_sk),max(ss_promo_sk),count,count,max,max,max,max,max,max,max,max,max,count,count,max,max,max,max,max,max,max,max,max] + InputAdapter + Exchange [ss_sold_date_sk] #2 + WholeStageCodegen (1) + HashAggregate [ss_sold_date_sk,ss_sold_time_sk,ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk] [count(1),count(ss_sold_date_sk),max(ss_sold_date_sk),max(ss_sold_time_sk),max(ss_item_sk),max(ss_customer_sk),max(ss_cdemo_sk),max(ss_hdemo_sk),max(ss_addr_sk),max(ss_store_sk),max(ss_promo_sk),count,count,max,max,max,max,max,max,max,max,max,count,count,max,max,max,max,max,max,max,max,max] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/explain.txt new file mode 100644 index 0000000000000..47c4db9ee29c1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/explain.txt @@ -0,0 +1,284 @@ +== Physical Plan == +TakeOrderedAndProject (47) ++- * Project (46) + +- * SortMergeJoin Inner (45) + :- * Sort (39) + : +- Exchange (38) + : +- * Project (37) + : +- * BroadcastHashJoin Inner BuildRight (36) + : :- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * Filter (14) + : : : +- * HashAggregate (13) + : : : +- Exchange (12) + : : : +- * HashAggregate (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_returns (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (28) + : : +- * Filter (27) + : : +- * HashAggregate (26) + : : +- Exchange (25) + : : +- * HashAggregate (24) + : : +- * HashAggregate (23) + : : +- Exchange (22) + : : +- * HashAggregate (21) + : : +- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Filter (17) + : : : +- * ColumnarToRow (16) + : : : +- Scan parquet default.store_returns (15) + : : +- ReusedExchange (18) + : +- BroadcastExchange (35) + : +- * Project (34) + : +- * Filter (33) + : +- * ColumnarToRow (32) + : +- Scan parquet default.store (31) + +- * Sort (44) + +- Exchange (43) + +- * Filter (42) + +- * ColumnarToRow (41) + +- Scan parquet default.customer (40) + + +(1) Scan parquet default.store_returns +Output [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#4), dynamicpruningexpression(sr_returned_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_store_sk), IsNotNull(sr_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4] + +(3) Filter [codegen id : 2] +Input [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4] +Condition : (isnotnull(sr_store_sk#2) AND isnotnull(sr_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_year#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] +Condition : ((isnotnull(d_year#7) AND (d_year#7 = 2000)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_year#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [sr_returned_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 2] +Output [3]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3] +Input [5]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4, d_date_sk#6] + +(11) HashAggregate [codegen id : 2] +Input [3]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3] +Keys [2]: [sr_customer_sk#1, sr_store_sk#2] +Functions [1]: [partial_sum(UnscaledValue(sr_return_amt#3))] +Aggregate Attributes [1]: [sum#9] +Results [3]: [sr_customer_sk#1, sr_store_sk#2, sum#10] + +(12) Exchange +Input [3]: [sr_customer_sk#1, sr_store_sk#2, sum#10] +Arguments: hashpartitioning(sr_customer_sk#1, sr_store_sk#2, 5), ENSURE_REQUIREMENTS, [id=#11] + +(13) HashAggregate [codegen id : 8] +Input [3]: [sr_customer_sk#1, sr_store_sk#2, sum#10] +Keys [2]: [sr_customer_sk#1, sr_store_sk#2] +Functions [1]: [sum(UnscaledValue(sr_return_amt#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(sr_return_amt#3))#12] +Results [3]: [sr_customer_sk#1 AS ctr_customer_sk#13, sr_store_sk#2 AS ctr_store_sk#14, MakeDecimal(sum(UnscaledValue(sr_return_amt#3))#12,17,2) AS ctr_total_return#15] + +(14) Filter [codegen id : 8] +Input [3]: [ctr_customer_sk#13, ctr_store_sk#14, ctr_total_return#15] +Condition : isnotnull(ctr_total_return#15) + +(15) Scan parquet default.store_returns +Output [4]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18, sr_returned_date_sk#19] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#19), dynamicpruningexpression(sr_returned_date_sk#19 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_store_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 4] +Input [4]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18, sr_returned_date_sk#19] + +(17) Filter [codegen id : 4] +Input [4]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18, sr_returned_date_sk#19] +Condition : isnotnull(sr_store_sk#17) + +(18) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#20] + +(19) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [sr_returned_date_sk#19] +Right keys [1]: [d_date_sk#20] +Join condition: None + +(20) Project [codegen id : 4] +Output [3]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18] +Input [5]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18, sr_returned_date_sk#19, d_date_sk#20] + +(21) HashAggregate [codegen id : 4] +Input [3]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18] +Keys [2]: [sr_customer_sk#16, sr_store_sk#17] +Functions [1]: [partial_sum(UnscaledValue(sr_return_amt#18))] +Aggregate Attributes [1]: [sum#21] +Results [3]: [sr_customer_sk#16, sr_store_sk#17, sum#22] + +(22) Exchange +Input [3]: [sr_customer_sk#16, sr_store_sk#17, sum#22] +Arguments: hashpartitioning(sr_customer_sk#16, sr_store_sk#17, 5), ENSURE_REQUIREMENTS, [id=#23] + +(23) HashAggregate [codegen id : 5] +Input [3]: [sr_customer_sk#16, sr_store_sk#17, sum#22] +Keys [2]: [sr_customer_sk#16, sr_store_sk#17] +Functions [1]: [sum(UnscaledValue(sr_return_amt#18))] +Aggregate Attributes [1]: [sum(UnscaledValue(sr_return_amt#18))#24] +Results [2]: [sr_store_sk#17 AS ctr_store_sk#14, MakeDecimal(sum(UnscaledValue(sr_return_amt#18))#24,17,2) AS ctr_total_return#15] + +(24) HashAggregate [codegen id : 5] +Input [2]: [ctr_store_sk#14, ctr_total_return#15] +Keys [1]: [ctr_store_sk#14] +Functions [1]: [partial_avg(ctr_total_return#15)] +Aggregate Attributes [2]: [sum#25, count#26] +Results [3]: [ctr_store_sk#14, sum#27, count#28] + +(25) Exchange +Input [3]: [ctr_store_sk#14, sum#27, count#28] +Arguments: hashpartitioning(ctr_store_sk#14, 5), ENSURE_REQUIREMENTS, [id=#29] + +(26) HashAggregate [codegen id : 6] +Input [3]: [ctr_store_sk#14, sum#27, count#28] +Keys [1]: [ctr_store_sk#14] +Functions [1]: [avg(ctr_total_return#15)] +Aggregate Attributes [1]: [avg(ctr_total_return#15)#30] +Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#15)#30) * 1.200000), DecimalType(24,7), true) AS (avg(ctr_total_return) * 1.2)#31, ctr_store_sk#14 AS ctr_store_sk#14#32] + +(27) Filter [codegen id : 6] +Input [2]: [(avg(ctr_total_return) * 1.2)#31, ctr_store_sk#14#32] +Condition : isnotnull((avg(ctr_total_return) * 1.2)#31) + +(28) BroadcastExchange +Input [2]: [(avg(ctr_total_return) * 1.2)#31, ctr_store_sk#14#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#33] + +(29) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ctr_store_sk#14] +Right keys [1]: [ctr_store_sk#14#32] +Join condition: (cast(ctr_total_return#15 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#31) + +(30) Project [codegen id : 8] +Output [2]: [ctr_customer_sk#13, ctr_store_sk#14] +Input [5]: [ctr_customer_sk#13, ctr_store_sk#14, ctr_total_return#15, (avg(ctr_total_return) * 1.2)#31, ctr_store_sk#14#32] + +(31) Scan parquet default.store +Output [2]: [s_store_sk#34, s_state#35] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 7] +Input [2]: [s_store_sk#34, s_state#35] + +(33) Filter [codegen id : 7] +Input [2]: [s_store_sk#34, s_state#35] +Condition : ((isnotnull(s_state#35) AND (s_state#35 = TN)) AND isnotnull(s_store_sk#34)) + +(34) Project [codegen id : 7] +Output [1]: [s_store_sk#34] +Input [2]: [s_store_sk#34, s_state#35] + +(35) BroadcastExchange +Input [1]: [s_store_sk#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#36] + +(36) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ctr_store_sk#14] +Right keys [1]: [s_store_sk#34] +Join condition: None + +(37) Project [codegen id : 8] +Output [1]: [ctr_customer_sk#13] +Input [3]: [ctr_customer_sk#13, ctr_store_sk#14, s_store_sk#34] + +(38) Exchange +Input [1]: [ctr_customer_sk#13] +Arguments: hashpartitioning(ctr_customer_sk#13, 5), ENSURE_REQUIREMENTS, [id=#37] + +(39) Sort [codegen id : 9] +Input [1]: [ctr_customer_sk#13] +Arguments: [ctr_customer_sk#13 ASC NULLS FIRST], false, 0 + +(40) Scan parquet default.customer +Output [2]: [c_customer_sk#38, c_customer_id#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 10] +Input [2]: [c_customer_sk#38, c_customer_id#39] + +(42) Filter [codegen id : 10] +Input [2]: [c_customer_sk#38, c_customer_id#39] +Condition : isnotnull(c_customer_sk#38) + +(43) Exchange +Input [2]: [c_customer_sk#38, c_customer_id#39] +Arguments: hashpartitioning(c_customer_sk#38, 5), ENSURE_REQUIREMENTS, [id=#40] + +(44) Sort [codegen id : 11] +Input [2]: [c_customer_sk#38, c_customer_id#39] +Arguments: [c_customer_sk#38 ASC NULLS FIRST], false, 0 + +(45) SortMergeJoin [codegen id : 12] +Left keys [1]: [ctr_customer_sk#13] +Right keys [1]: [c_customer_sk#38] +Join condition: None + +(46) Project [codegen id : 12] +Output [1]: [c_customer_id#39] +Input [3]: [ctr_customer_sk#13, c_customer_sk#38, c_customer_id#39] + +(47) TakeOrderedAndProject +Input [1]: [c_customer_id#39] +Arguments: 100, [c_customer_id#39 ASC NULLS FIRST], [c_customer_id#39] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = sr_returned_date_sk#4 IN dynamicpruning#5 +ReusedExchange (48) + + +(48) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 15 Hosting Expression = sr_returned_date_sk#19 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/simplified.txt new file mode 100644 index 0000000000000..dea7ed93e7a1a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1.sf100/simplified.txt @@ -0,0 +1,77 @@ +TakeOrderedAndProject [c_customer_id] + WholeStageCodegen (12) + Project [c_customer_id] + SortMergeJoin [ctr_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (9) + Sort [ctr_customer_sk] + InputAdapter + Exchange [ctr_customer_sk] #1 + WholeStageCodegen (8) + Project [ctr_customer_sk] + BroadcastHashJoin [ctr_store_sk,s_store_sk] + Project [ctr_customer_sk,ctr_store_sk] + BroadcastHashJoin [ctr_store_sk,ctr_store_sk,ctr_total_return,(avg(ctr_total_return) * 1.2)] + Filter [ctr_total_return] + HashAggregate [sr_customer_sk,sr_store_sk,sum] [sum(UnscaledValue(sr_return_amt)),ctr_customer_sk,ctr_store_sk,ctr_total_return,sum] + InputAdapter + Exchange [sr_customer_sk,sr_store_sk] #2 + WholeStageCodegen (2) + HashAggregate [sr_customer_sk,sr_store_sk,sr_return_amt] [sum,sum] + Project [sr_customer_sk,sr_store_sk,sr_return_amt] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_store_sk,sr_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_customer_sk,sr_store_sk,sr_return_amt,sr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (6) + Filter [(avg(ctr_total_return) * 1.2)] + HashAggregate [ctr_store_sk,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_store_sk,sum,count] + InputAdapter + Exchange [ctr_store_sk] #5 + WholeStageCodegen (5) + HashAggregate [ctr_store_sk,ctr_total_return] [sum,count,sum,count] + HashAggregate [sr_customer_sk,sr_store_sk,sum] [sum(UnscaledValue(sr_return_amt)),ctr_store_sk,ctr_total_return,sum] + InputAdapter + Exchange [sr_customer_sk,sr_store_sk] #6 + WholeStageCodegen (4) + HashAggregate [sr_customer_sk,sr_store_sk,sr_return_amt] [sum,sum] + Project [sr_customer_sk,sr_store_sk,sr_return_amt] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_customer_sk,sr_store_sk,sr_return_amt,sr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (7) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + WholeStageCodegen (11) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #8 + WholeStageCodegen (10) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt new file mode 100644 index 0000000000000..21f0534974c01 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/explain.txt @@ -0,0 +1,269 @@ +== Physical Plan == +TakeOrderedAndProject (44) ++- * Project (43) + +- * BroadcastHashJoin Inner BuildRight (42) + :- * Project (37) + : +- * BroadcastHashJoin Inner BuildRight (36) + : :- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * Filter (14) + : : : +- * HashAggregate (13) + : : : +- Exchange (12) + : : : +- * HashAggregate (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_returns (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (28) + : : +- * Filter (27) + : : +- * HashAggregate (26) + : : +- Exchange (25) + : : +- * HashAggregate (24) + : : +- * HashAggregate (23) + : : +- Exchange (22) + : : +- * HashAggregate (21) + : : +- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Filter (17) + : : : +- * ColumnarToRow (16) + : : : +- Scan parquet default.store_returns (15) + : : +- ReusedExchange (18) + : +- BroadcastExchange (35) + : +- * Project (34) + : +- * Filter (33) + : +- * ColumnarToRow (32) + : +- Scan parquet default.store (31) + +- BroadcastExchange (41) + +- * Filter (40) + +- * ColumnarToRow (39) + +- Scan parquet default.customer (38) + + +(1) Scan parquet default.store_returns +Output [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#4), dynamicpruningexpression(sr_returned_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_store_sk), IsNotNull(sr_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4] + +(3) Filter [codegen id : 2] +Input [4]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4] +Condition : (isnotnull(sr_store_sk#2) AND isnotnull(sr_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_year#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] +Condition : ((isnotnull(d_year#7) AND (d_year#7 = 2000)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_year#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [sr_returned_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 2] +Output [3]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3] +Input [5]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3, sr_returned_date_sk#4, d_date_sk#6] + +(11) HashAggregate [codegen id : 2] +Input [3]: [sr_customer_sk#1, sr_store_sk#2, sr_return_amt#3] +Keys [2]: [sr_customer_sk#1, sr_store_sk#2] +Functions [1]: [partial_sum(UnscaledValue(sr_return_amt#3))] +Aggregate Attributes [1]: [sum#9] +Results [3]: [sr_customer_sk#1, sr_store_sk#2, sum#10] + +(12) Exchange +Input [3]: [sr_customer_sk#1, sr_store_sk#2, sum#10] +Arguments: hashpartitioning(sr_customer_sk#1, sr_store_sk#2, 5), ENSURE_REQUIREMENTS, [id=#11] + +(13) HashAggregate [codegen id : 9] +Input [3]: [sr_customer_sk#1, sr_store_sk#2, sum#10] +Keys [2]: [sr_customer_sk#1, sr_store_sk#2] +Functions [1]: [sum(UnscaledValue(sr_return_amt#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(sr_return_amt#3))#12] +Results [3]: [sr_customer_sk#1 AS ctr_customer_sk#13, sr_store_sk#2 AS ctr_store_sk#14, MakeDecimal(sum(UnscaledValue(sr_return_amt#3))#12,17,2) AS ctr_total_return#15] + +(14) Filter [codegen id : 9] +Input [3]: [ctr_customer_sk#13, ctr_store_sk#14, ctr_total_return#15] +Condition : isnotnull(ctr_total_return#15) + +(15) Scan parquet default.store_returns +Output [4]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18, sr_returned_date_sk#19] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#19), dynamicpruningexpression(sr_returned_date_sk#19 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_store_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 4] +Input [4]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18, sr_returned_date_sk#19] + +(17) Filter [codegen id : 4] +Input [4]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18, sr_returned_date_sk#19] +Condition : isnotnull(sr_store_sk#17) + +(18) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#20] + +(19) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [sr_returned_date_sk#19] +Right keys [1]: [d_date_sk#20] +Join condition: None + +(20) Project [codegen id : 4] +Output [3]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18] +Input [5]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18, sr_returned_date_sk#19, d_date_sk#20] + +(21) HashAggregate [codegen id : 4] +Input [3]: [sr_customer_sk#16, sr_store_sk#17, sr_return_amt#18] +Keys [2]: [sr_customer_sk#16, sr_store_sk#17] +Functions [1]: [partial_sum(UnscaledValue(sr_return_amt#18))] +Aggregate Attributes [1]: [sum#21] +Results [3]: [sr_customer_sk#16, sr_store_sk#17, sum#22] + +(22) Exchange +Input [3]: [sr_customer_sk#16, sr_store_sk#17, sum#22] +Arguments: hashpartitioning(sr_customer_sk#16, sr_store_sk#17, 5), ENSURE_REQUIREMENTS, [id=#23] + +(23) HashAggregate [codegen id : 5] +Input [3]: [sr_customer_sk#16, sr_store_sk#17, sum#22] +Keys [2]: [sr_customer_sk#16, sr_store_sk#17] +Functions [1]: [sum(UnscaledValue(sr_return_amt#18))] +Aggregate Attributes [1]: [sum(UnscaledValue(sr_return_amt#18))#24] +Results [2]: [sr_store_sk#17 AS ctr_store_sk#14, MakeDecimal(sum(UnscaledValue(sr_return_amt#18))#24,17,2) AS ctr_total_return#15] + +(24) HashAggregate [codegen id : 5] +Input [2]: [ctr_store_sk#14, ctr_total_return#15] +Keys [1]: [ctr_store_sk#14] +Functions [1]: [partial_avg(ctr_total_return#15)] +Aggregate Attributes [2]: [sum#25, count#26] +Results [3]: [ctr_store_sk#14, sum#27, count#28] + +(25) Exchange +Input [3]: [ctr_store_sk#14, sum#27, count#28] +Arguments: hashpartitioning(ctr_store_sk#14, 5), ENSURE_REQUIREMENTS, [id=#29] + +(26) HashAggregate [codegen id : 6] +Input [3]: [ctr_store_sk#14, sum#27, count#28] +Keys [1]: [ctr_store_sk#14] +Functions [1]: [avg(ctr_total_return#15)] +Aggregate Attributes [1]: [avg(ctr_total_return#15)#30] +Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#15)#30) * 1.200000), DecimalType(24,7), true) AS (avg(ctr_total_return) * 1.2)#31, ctr_store_sk#14 AS ctr_store_sk#14#32] + +(27) Filter [codegen id : 6] +Input [2]: [(avg(ctr_total_return) * 1.2)#31, ctr_store_sk#14#32] +Condition : isnotnull((avg(ctr_total_return) * 1.2)#31) + +(28) BroadcastExchange +Input [2]: [(avg(ctr_total_return) * 1.2)#31, ctr_store_sk#14#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#33] + +(29) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ctr_store_sk#14] +Right keys [1]: [ctr_store_sk#14#32] +Join condition: (cast(ctr_total_return#15 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#31) + +(30) Project [codegen id : 9] +Output [2]: [ctr_customer_sk#13, ctr_store_sk#14] +Input [5]: [ctr_customer_sk#13, ctr_store_sk#14, ctr_total_return#15, (avg(ctr_total_return) * 1.2)#31, ctr_store_sk#14#32] + +(31) Scan parquet default.store +Output [2]: [s_store_sk#34, s_state#35] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 7] +Input [2]: [s_store_sk#34, s_state#35] + +(33) Filter [codegen id : 7] +Input [2]: [s_store_sk#34, s_state#35] +Condition : ((isnotnull(s_state#35) AND (s_state#35 = TN)) AND isnotnull(s_store_sk#34)) + +(34) Project [codegen id : 7] +Output [1]: [s_store_sk#34] +Input [2]: [s_store_sk#34, s_state#35] + +(35) BroadcastExchange +Input [1]: [s_store_sk#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#36] + +(36) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ctr_store_sk#14] +Right keys [1]: [s_store_sk#34] +Join condition: None + +(37) Project [codegen id : 9] +Output [1]: [ctr_customer_sk#13] +Input [3]: [ctr_customer_sk#13, ctr_store_sk#14, s_store_sk#34] + +(38) Scan parquet default.customer +Output [2]: [c_customer_sk#37, c_customer_id#38] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 8] +Input [2]: [c_customer_sk#37, c_customer_id#38] + +(40) Filter [codegen id : 8] +Input [2]: [c_customer_sk#37, c_customer_id#38] +Condition : isnotnull(c_customer_sk#37) + +(41) BroadcastExchange +Input [2]: [c_customer_sk#37, c_customer_id#38] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#39] + +(42) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ctr_customer_sk#13] +Right keys [1]: [c_customer_sk#37] +Join condition: None + +(43) Project [codegen id : 9] +Output [1]: [c_customer_id#38] +Input [3]: [ctr_customer_sk#13, c_customer_sk#37, c_customer_id#38] + +(44) TakeOrderedAndProject +Input [1]: [c_customer_id#38] +Arguments: 100, [c_customer_id#38 ASC NULLS FIRST], [c_customer_id#38] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = sr_returned_date_sk#4 IN dynamicpruning#5 +ReusedExchange (45) + + +(45) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 15 Hosting Expression = sr_returned_date_sk#19 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/simplified.txt new file mode 100644 index 0000000000000..1a7ee26015049 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q1/simplified.txt @@ -0,0 +1,68 @@ +TakeOrderedAndProject [c_customer_id] + WholeStageCodegen (9) + Project [c_customer_id] + BroadcastHashJoin [ctr_customer_sk,c_customer_sk] + Project [ctr_customer_sk] + BroadcastHashJoin [ctr_store_sk,s_store_sk] + Project [ctr_customer_sk,ctr_store_sk] + BroadcastHashJoin [ctr_store_sk,ctr_store_sk,ctr_total_return,(avg(ctr_total_return) * 1.2)] + Filter [ctr_total_return] + HashAggregate [sr_customer_sk,sr_store_sk,sum] [sum(UnscaledValue(sr_return_amt)),ctr_customer_sk,ctr_store_sk,ctr_total_return,sum] + InputAdapter + Exchange [sr_customer_sk,sr_store_sk] #1 + WholeStageCodegen (2) + HashAggregate [sr_customer_sk,sr_store_sk,sr_return_amt] [sum,sum] + Project [sr_customer_sk,sr_store_sk,sr_return_amt] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_store_sk,sr_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_customer_sk,sr_store_sk,sr_return_amt,sr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (6) + Filter [(avg(ctr_total_return) * 1.2)] + HashAggregate [ctr_store_sk,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_store_sk,sum,count] + InputAdapter + Exchange [ctr_store_sk] #4 + WholeStageCodegen (5) + HashAggregate [ctr_store_sk,ctr_total_return] [sum,count,sum,count] + HashAggregate [sr_customer_sk,sr_store_sk,sum] [sum(UnscaledValue(sr_return_amt)),ctr_store_sk,ctr_total_return,sum] + InputAdapter + Exchange [sr_customer_sk,sr_store_sk] #5 + WholeStageCodegen (4) + HashAggregate [sr_customer_sk,sr_store_sk,sr_return_amt] [sum,sum] + Project [sr_customer_sk,sr_store_sk,sr_return_amt] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_customer_sk,sr_store_sk,sr_return_amt,sr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (8) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt new file mode 100644 index 0000000000000..b7f3535bd0ea2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/explain.txt @@ -0,0 +1,318 @@ +== Physical Plan == +TakeOrderedAndProject (55) ++- * HashAggregate (54) + +- Exchange (53) + +- * HashAggregate (52) + +- * Project (51) + +- * SortMergeJoin Inner (50) + :- * Sort (44) + : +- Exchange (43) + : +- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Project (35) + : : +- * Filter (34) + : : +- SortMergeJoin ExistenceJoin(exists#1) (33) + : : :- SortMergeJoin ExistenceJoin(exists#2) (25) + : : : :- * SortMergeJoin LeftSemi (17) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- * Sort (16) + : : : : +- Exchange (15) + : : : : +- * Project (14) + : : : : +- * BroadcastHashJoin Inner BuildRight (13) + : : : : :- * ColumnarToRow (7) + : : : : : +- Scan parquet default.store_sales (6) + : : : : +- BroadcastExchange (12) + : : : : +- * Project (11) + : : : : +- * Filter (10) + : : : : +- * ColumnarToRow (9) + : : : : +- Scan parquet default.date_dim (8) + : : : +- * Sort (24) + : : : +- Exchange (23) + : : : +- * Project (22) + : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : :- * ColumnarToRow (19) + : : : : +- Scan parquet default.web_sales (18) + : : : +- ReusedExchange (20) + : : +- * Sort (32) + : : +- Exchange (31) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * ColumnarToRow (27) + : : : +- Scan parquet default.catalog_sales (26) + : : +- ReusedExchange (28) + : +- BroadcastExchange (40) + : +- * Project (39) + : +- * Filter (38) + : +- * ColumnarToRow (37) + : +- Scan parquet default.customer_address (36) + +- * Sort (49) + +- Exchange (48) + +- * Filter (47) + +- * ColumnarToRow (46) + +- Scan parquet default.customer_demographics (45) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] + +(3) Filter [codegen id : 1] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4)) + +(4) Exchange +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: hashpartitioning(c_customer_sk#3, 5), ENSURE_REQUIREMENTS, [id=#6] + +(5) Sort [codegen id : 2] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: [c_customer_sk#3 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ss_customer_sk#7, ss_sold_date_sk#8] + +(8) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2002), GreaterThanOrEqual(d_moy,1), LessThanOrEqual(d_moy,4), IsNotNull(d_date_sk)] +ReadSchema: struct + +(9) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(10) Filter [codegen id : 3] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Condition : (((((isnotnull(d_year#11) AND isnotnull(d_moy#12)) AND (d_year#11 = 2002)) AND (d_moy#12 >= 1)) AND (d_moy#12 <= 4)) AND isnotnull(d_date_sk#10)) + +(11) Project [codegen id : 3] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(12) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(13) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(14) Project [codegen id : 4] +Output [1]: [ss_customer_sk#7] +Input [3]: [ss_customer_sk#7, ss_sold_date_sk#8, d_date_sk#10] + +(15) Exchange +Input [1]: [ss_customer_sk#7] +Arguments: hashpartitioning(ss_customer_sk#7, 5), ENSURE_REQUIREMENTS, [id=#14] + +(16) Sort [codegen id : 5] +Input [1]: [ss_customer_sk#7] +Arguments: [ss_customer_sk#7 ASC NULLS FIRST], false, 0 + +(17) SortMergeJoin [codegen id : 6] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ss_customer_sk#7] +Join condition: None + +(18) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#15, ws_sold_date_sk#16] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#16), dynamicpruningexpression(ws_sold_date_sk#16 IN dynamicpruning#9)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 8] +Input [2]: [ws_bill_customer_sk#15, ws_sold_date_sk#16] + +(20) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#17] + +(21) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_sold_date_sk#16] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(22) Project [codegen id : 8] +Output [1]: [ws_bill_customer_sk#15] +Input [3]: [ws_bill_customer_sk#15, ws_sold_date_sk#16, d_date_sk#17] + +(23) Exchange +Input [1]: [ws_bill_customer_sk#15] +Arguments: hashpartitioning(ws_bill_customer_sk#15, 5), ENSURE_REQUIREMENTS, [id=#18] + +(24) Sort [codegen id : 9] +Input [1]: [ws_bill_customer_sk#15] +Arguments: [ws_bill_customer_sk#15 ASC NULLS FIRST], false, 0 + +(25) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ws_bill_customer_sk#15] +Join condition: None + +(26) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#19, cs_sold_date_sk#20] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#20), dynamicpruningexpression(cs_sold_date_sk#20 IN dynamicpruning#9)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 11] +Input [2]: [cs_ship_customer_sk#19, cs_sold_date_sk#20] + +(28) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#21] + +(29) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#20] +Right keys [1]: [d_date_sk#21] +Join condition: None + +(30) Project [codegen id : 11] +Output [1]: [cs_ship_customer_sk#19] +Input [3]: [cs_ship_customer_sk#19, cs_sold_date_sk#20, d_date_sk#21] + +(31) Exchange +Input [1]: [cs_ship_customer_sk#19] +Arguments: hashpartitioning(cs_ship_customer_sk#19, 5), ENSURE_REQUIREMENTS, [id=#22] + +(32) Sort [codegen id : 12] +Input [1]: [cs_ship_customer_sk#19] +Arguments: [cs_ship_customer_sk#19 ASC NULLS FIRST], false, 0 + +(33) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [cs_ship_customer_sk#19] +Join condition: None + +(34) Filter [codegen id : 14] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] +Condition : (exists#2 OR exists#1) + +(35) Project [codegen id : 14] +Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] + +(36) Scan parquet default.customer_address +Output [2]: [ca_address_sk#23, ca_county#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_county, [Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 13] +Input [2]: [ca_address_sk#23, ca_county#24] + +(38) Filter [codegen id : 13] +Input [2]: [ca_address_sk#23, ca_county#24] +Condition : (ca_county#24 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#23)) + +(39) Project [codegen id : 13] +Output [1]: [ca_address_sk#23] +Input [2]: [ca_address_sk#23, ca_county#24] + +(40) BroadcastExchange +Input [1]: [ca_address_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] + +(41) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [c_current_addr_sk#5] +Right keys [1]: [ca_address_sk#23] +Join condition: None + +(42) Project [codegen id : 14] +Output [1]: [c_current_cdemo_sk#4] +Input [3]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#23] + +(43) Exchange +Input [1]: [c_current_cdemo_sk#4] +Arguments: hashpartitioning(c_current_cdemo_sk#4, 5), ENSURE_REQUIREMENTS, [id=#26] + +(44) Sort [codegen id : 15] +Input [1]: [c_current_cdemo_sk#4] +Arguments: [c_current_cdemo_sk#4 ASC NULLS FIRST], false, 0 + +(45) Scan parquet default.customer_demographics +Output [9]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(46) ColumnarToRow [codegen id : 16] +Input [9]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] + +(47) Filter [codegen id : 16] +Input [9]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Condition : isnotnull(cd_demo_sk#27) + +(48) Exchange +Input [9]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Arguments: hashpartitioning(cd_demo_sk#27, 5), ENSURE_REQUIREMENTS, [id=#36] + +(49) Sort [codegen id : 17] +Input [9]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Arguments: [cd_demo_sk#27 ASC NULLS FIRST], false, 0 + +(50) SortMergeJoin [codegen id : 18] +Left keys [1]: [c_current_cdemo_sk#4] +Right keys [1]: [cd_demo_sk#27] +Join condition: None + +(51) Project [codegen id : 18] +Output [8]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Input [10]: [c_current_cdemo_sk#4, cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] + +(52) HashAggregate [codegen id : 18] +Input [8]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Keys [8]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#37] +Results [9]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35, count#38] + +(53) Exchange +Input [9]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35, count#38] +Arguments: hashpartitioning(cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35, 5), ENSURE_REQUIREMENTS, [id=#39] + +(54) HashAggregate [codegen id : 19] +Input [9]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35, count#38] +Keys [8]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cd_purchase_estimate#31, cd_credit_rating#32, cd_dep_count#33, cd_dep_employed_count#34, cd_dep_college_count#35] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#40] +Results [14]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, count(1)#40 AS cnt1#41, cd_purchase_estimate#31, count(1)#40 AS cnt2#42, cd_credit_rating#32, count(1)#40 AS cnt3#43, cd_dep_count#33, count(1)#40 AS cnt4#44, cd_dep_employed_count#34, count(1)#40 AS cnt5#45, cd_dep_college_count#35, count(1)#40 AS cnt6#46] + +(55) TakeOrderedAndProject +Input [14]: [cd_gender#28, cd_marital_status#29, cd_education_status#30, cnt1#41, cd_purchase_estimate#31, cnt2#42, cd_credit_rating#32, cnt3#43, cd_dep_count#33, cnt4#44, cd_dep_employed_count#34, cnt5#45, cd_dep_college_count#35, cnt6#46] +Arguments: 100, [cd_gender#28 ASC NULLS FIRST, cd_marital_status#29 ASC NULLS FIRST, cd_education_status#30 ASC NULLS FIRST, cd_purchase_estimate#31 ASC NULLS FIRST, cd_credit_rating#32 ASC NULLS FIRST, cd_dep_count#33 ASC NULLS FIRST, cd_dep_employed_count#34 ASC NULLS FIRST, cd_dep_college_count#35 ASC NULLS FIRST], [cd_gender#28, cd_marital_status#29, cd_education_status#30, cnt1#41, cd_purchase_estimate#31, cnt2#42, cd_credit_rating#32, cnt3#43, cd_dep_count#33, cnt4#44, cd_dep_employed_count#34, cnt5#45, cd_dep_college_count#35, cnt6#46] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (56) + + +(56) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#10] + +Subquery:2 Hosting operator id = 18 Hosting Expression = ws_sold_date_sk#16 IN dynamicpruning#9 + +Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#20 IN dynamicpruning#9 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/simplified.txt new file mode 100644 index 0000000000000..a40043d68deeb --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10.sf100/simplified.txt @@ -0,0 +1,99 @@ +TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,cnt2,cnt3,cnt4,cnt5,cnt6] + WholeStageCodegen (19) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count] [count(1),cnt1,cnt2,cnt3,cnt4,cnt5,cnt6,count] + InputAdapter + Exchange [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 + WholeStageCodegen (18) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,count] + Project [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (15) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #2 + WholeStageCodegen (14) + Project [c_current_cdemo_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + Filter [exists,exists] + InputAdapter + SortMergeJoin [c_customer_sk,cs_ship_customer_sk] + SortMergeJoin [c_customer_sk,ws_bill_customer_sk] + WholeStageCodegen (6) + SortMergeJoin [c_customer_sk,ss_customer_sk] + InputAdapter + WholeStageCodegen (2) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #3 + WholeStageCodegen (1) + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (5) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #4 + WholeStageCodegen (4) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (9) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #6 + WholeStageCodegen (8) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + WholeStageCodegen (12) + Sort [cs_ship_customer_sk] + InputAdapter + Exchange [cs_ship_customer_sk] #7 + WholeStageCodegen (11) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (13) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] + InputAdapter + WholeStageCodegen (17) + Sort [cd_demo_sk] + InputAdapter + Exchange [cd_demo_sk] #9 + WholeStageCodegen (16) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/explain.txt new file mode 100644 index 0000000000000..370551a2de652 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/explain.txt @@ -0,0 +1,278 @@ +== Physical Plan == +TakeOrderedAndProject (47) ++- * HashAggregate (46) + +- Exchange (45) + +- * HashAggregate (44) + +- * Project (43) + +- * BroadcastHashJoin Inner BuildRight (42) + :- * Project (37) + : +- * BroadcastHashJoin Inner BuildRight (36) + : :- * Project (30) + : : +- * Filter (29) + : : +- * BroadcastHashJoin ExistenceJoin(exists#1) BuildRight (28) + : : :- * BroadcastHashJoin ExistenceJoin(exists#2) BuildRight (21) + : : : :- * BroadcastHashJoin LeftSemi BuildRight (14) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (13) + : : : : +- * Project (12) + : : : : +- * BroadcastHashJoin Inner BuildRight (11) + : : : : :- * ColumnarToRow (5) + : : : : : +- Scan parquet default.store_sales (4) + : : : : +- BroadcastExchange (10) + : : : : +- * Project (9) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.date_dim (6) + : : : +- BroadcastExchange (20) + : : : +- * Project (19) + : : : +- * BroadcastHashJoin Inner BuildRight (18) + : : : :- * ColumnarToRow (16) + : : : : +- Scan parquet default.web_sales (15) + : : : +- ReusedExchange (17) + : : +- BroadcastExchange (27) + : : +- * Project (26) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- * ColumnarToRow (23) + : : : +- Scan parquet default.catalog_sales (22) + : : +- ReusedExchange (24) + : +- BroadcastExchange (35) + : +- * Project (34) + : +- * Filter (33) + : +- * ColumnarToRow (32) + : +- Scan parquet default.customer_address (31) + +- BroadcastExchange (41) + +- * Filter (40) + +- * ColumnarToRow (39) + +- Scan parquet default.customer_demographics (38) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] + +(3) Filter [codegen id : 9] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4)) + +(4) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 2] +Input [2]: [ss_customer_sk#6, ss_sold_date_sk#7] + +(6) Scan parquet default.date_dim +Output [3]: [d_date_sk#9, d_year#10, d_moy#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2002), GreaterThanOrEqual(d_moy,1), LessThanOrEqual(d_moy,4), IsNotNull(d_date_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#9, d_year#10, d_moy#11] + +(8) Filter [codegen id : 1] +Input [3]: [d_date_sk#9, d_year#10, d_moy#11] +Condition : (((((isnotnull(d_year#10) AND isnotnull(d_moy#11)) AND (d_year#10 = 2002)) AND (d_moy#11 >= 1)) AND (d_moy#11 <= 4)) AND isnotnull(d_date_sk#9)) + +(9) Project [codegen id : 1] +Output [1]: [d_date_sk#9] +Input [3]: [d_date_sk#9, d_year#10, d_moy#11] + +(10) BroadcastExchange +Input [1]: [d_date_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(11) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#9] +Join condition: None + +(12) Project [codegen id : 2] +Output [1]: [ss_customer_sk#6] +Input [3]: [ss_customer_sk#6, ss_sold_date_sk#7, d_date_sk#9] + +(13) BroadcastExchange +Input [1]: [ss_customer_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(14) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ss_customer_sk#6] +Join condition: None + +(15) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#14, ws_sold_date_sk#15] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#15), dynamicpruningexpression(ws_sold_date_sk#15 IN dynamicpruning#8)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 4] +Input [2]: [ws_bill_customer_sk#14, ws_sold_date_sk#15] + +(17) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#16] + +(18) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_sold_date_sk#15] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(19) Project [codegen id : 4] +Output [1]: [ws_bill_customer_sk#14] +Input [3]: [ws_bill_customer_sk#14, ws_sold_date_sk#15, d_date_sk#16] + +(20) BroadcastExchange +Input [1]: [ws_bill_customer_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(21) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ws_bill_customer_sk#14] +Join condition: None + +(22) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#18, cs_sold_date_sk#19] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#19), dynamicpruningexpression(cs_sold_date_sk#19 IN dynamicpruning#8)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 6] +Input [2]: [cs_ship_customer_sk#18, cs_sold_date_sk#19] + +(24) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#20] + +(25) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#19] +Right keys [1]: [d_date_sk#20] +Join condition: None + +(26) Project [codegen id : 6] +Output [1]: [cs_ship_customer_sk#18] +Input [3]: [cs_ship_customer_sk#18, cs_sold_date_sk#19, d_date_sk#20] + +(27) BroadcastExchange +Input [1]: [cs_ship_customer_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(28) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [cs_ship_customer_sk#18] +Join condition: None + +(29) Filter [codegen id : 9] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] +Condition : (exists#2 OR exists#1) + +(30) Project [codegen id : 9] +Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] + +(31) Scan parquet default.customer_address +Output [2]: [ca_address_sk#22, ca_county#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_county, [Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#22, ca_county#23] + +(33) Filter [codegen id : 7] +Input [2]: [ca_address_sk#22, ca_county#23] +Condition : (ca_county#23 IN (Rush County,Toole County,Jefferson County,Dona Ana County,La Porte County) AND isnotnull(ca_address_sk#22)) + +(34) Project [codegen id : 7] +Output [1]: [ca_address_sk#22] +Input [2]: [ca_address_sk#22, ca_county#23] + +(35) BroadcastExchange +Input [1]: [ca_address_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(36) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_addr_sk#5] +Right keys [1]: [ca_address_sk#22] +Join condition: None + +(37) Project [codegen id : 9] +Output [1]: [c_current_cdemo_sk#4] +Input [3]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#22] + +(38) Scan parquet default.customer_demographics +Output [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 8] +Input [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] + +(40) Filter [codegen id : 8] +Input [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Condition : isnotnull(cd_demo_sk#25) + +(41) BroadcastExchange +Input [9]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#34] + +(42) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_cdemo_sk#4] +Right keys [1]: [cd_demo_sk#25] +Join condition: None + +(43) Project [codegen id : 9] +Output [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Input [10]: [c_current_cdemo_sk#4, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] + +(44) HashAggregate [codegen id : 9] +Input [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Keys [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#35] +Results [9]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#36] + +(45) Exchange +Input [9]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#36] +Arguments: hashpartitioning(cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, 5), ENSURE_REQUIREMENTS, [id=#37] + +(46) HashAggregate [codegen id : 10] +Input [9]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#36] +Keys [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#38] +Results [14]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, count(1)#38 AS cnt1#39, cd_purchase_estimate#29, count(1)#38 AS cnt2#40, cd_credit_rating#30, count(1)#38 AS cnt3#41, cd_dep_count#31, count(1)#38 AS cnt4#42, cd_dep_employed_count#32, count(1)#38 AS cnt5#43, cd_dep_college_count#33, count(1)#38 AS cnt6#44] + +(47) TakeOrderedAndProject +Input [14]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cnt1#39, cd_purchase_estimate#29, cnt2#40, cd_credit_rating#30, cnt3#41, cd_dep_count#31, cnt4#42, cd_dep_employed_count#32, cnt5#43, cd_dep_college_count#33, cnt6#44] +Arguments: 100, [cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, cd_education_status#28 ASC NULLS FIRST, cd_purchase_estimate#29 ASC NULLS FIRST, cd_credit_rating#30 ASC NULLS FIRST, cd_dep_count#31 ASC NULLS FIRST, cd_dep_employed_count#32 ASC NULLS FIRST, cd_dep_college_count#33 ASC NULLS FIRST], [cd_gender#26, cd_marital_status#27, cd_education_status#28, cnt1#39, cd_purchase_estimate#29, cnt2#40, cd_credit_rating#30, cnt3#41, cd_dep_count#31, cnt4#42, cd_dep_employed_count#32, cnt5#43, cd_dep_college_count#33, cnt6#44] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (48) + + +(48) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#9] + +Subquery:2 Hosting operator id = 15 Hosting Expression = ws_sold_date_sk#15 IN dynamicpruning#8 + +Subquery:3 Hosting operator id = 22 Hosting Expression = cs_sold_date_sk#19 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/simplified.txt new file mode 100644 index 0000000000000..261bb6152b22a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q10/simplified.txt @@ -0,0 +1,75 @@ +TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,cnt2,cnt3,cnt4,cnt5,cnt6] + WholeStageCodegen (10) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count] [count(1),cnt1,cnt2,cnt3,cnt4,cnt5,cnt6,count] + InputAdapter + Exchange [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 + WholeStageCodegen (9) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,count] + Project [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [c_current_cdemo_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + Filter [exists,exists] + BroadcastHashJoin [c_customer_sk,cs_ship_customer_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (6) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (8) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt new file mode 100644 index 0000000000000..92e8e38634ea6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/explain.txt @@ -0,0 +1,507 @@ +== Physical Plan == +TakeOrderedAndProject (87) ++- * Project (86) + +- * SortMergeJoin Inner (85) + :- * Project (67) + : +- * SortMergeJoin Inner (66) + : :- * Project (46) + : : +- * SortMergeJoin Inner (45) + : : :- * Sort (24) + : : : +- Exchange (23) + : : : +- * Filter (22) + : : : +- * HashAggregate (21) + : : : +- Exchange (20) + : : : +- * HashAggregate (19) + : : : +- * Project (18) + : : : +- * SortMergeJoin Inner (17) + : : : :- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- * Sort (16) + : : : +- Exchange (15) + : : : +- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.customer (12) + : : +- * Sort (44) + : : +- Exchange (43) + : : +- * HashAggregate (42) + : : +- Exchange (41) + : : +- * HashAggregate (40) + : : +- * Project (39) + : : +- * SortMergeJoin Inner (38) + : : :- * Sort (35) + : : : +- Exchange (34) + : : : +- * Project (33) + : : : +- * BroadcastHashJoin Inner BuildRight (32) + : : : :- * Filter (27) + : : : : +- * ColumnarToRow (26) + : : : : +- Scan parquet default.store_sales (25) + : : : +- BroadcastExchange (31) + : : : +- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.date_dim (28) + : : +- * Sort (37) + : : +- ReusedExchange (36) + : +- * Sort (65) + : +- Exchange (64) + : +- * Project (63) + : +- * Filter (62) + : +- * HashAggregate (61) + : +- Exchange (60) + : +- * HashAggregate (59) + : +- * Project (58) + : +- * SortMergeJoin Inner (57) + : :- * Sort (54) + : : +- Exchange (53) + : : +- * Project (52) + : : +- * BroadcastHashJoin Inner BuildRight (51) + : : :- * Filter (49) + : : : +- * ColumnarToRow (48) + : : : +- Scan parquet default.web_sales (47) + : : +- ReusedExchange (50) + : +- * Sort (56) + : +- ReusedExchange (55) + +- * Sort (84) + +- Exchange (83) + +- * HashAggregate (82) + +- Exchange (81) + +- * HashAggregate (80) + +- * Project (79) + +- * SortMergeJoin Inner (78) + :- * Sort (75) + : +- Exchange (74) + : +- * Project (73) + : +- * BroadcastHashJoin Inner BuildRight (72) + : :- * Filter (70) + : : +- * ColumnarToRow (69) + : : +- Scan parquet default.web_sales (68) + : +- ReusedExchange (71) + +- * Sort (77) + +- ReusedExchange (76) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 2] +Input [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_customer_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_year#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] +Condition : ((isnotnull(d_year#7) AND (d_year#7 = 2001)) AND isnotnull(d_date_sk#6)) + +(7) BroadcastExchange +Input [2]: [d_date_sk#6, d_year#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(9) Project [codegen id : 2] +Output [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7] +Input [6]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, ss_sold_date_sk#4, d_date_sk#6, d_year#7] + +(10) Exchange +Input [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] + +(11) Sort [codegen id : 3] +Input [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(12) Scan parquet default.customer +Output [8]: [c_customer_sk#10, c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 4] +Input [8]: [c_customer_sk#10, c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] + +(14) Filter [codegen id : 4] +Input [8]: [c_customer_sk#10, c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] +Condition : (isnotnull(c_customer_sk#10) AND isnotnull(c_customer_id#11)) + +(15) Exchange +Input [8]: [c_customer_sk#10, c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] +Arguments: hashpartitioning(c_customer_sk#10, 5), ENSURE_REQUIREMENTS, [id=#18] + +(16) Sort [codegen id : 5] +Input [8]: [c_customer_sk#10, c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] +Arguments: [c_customer_sk#10 ASC NULLS FIRST], false, 0 + +(17) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#10] +Join condition: None + +(18) Project [codegen id : 6] +Output [10]: [c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7] +Input [12]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7, c_customer_sk#10, c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] + +(19) HashAggregate [codegen id : 6] +Input [10]: [c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7] +Keys [8]: [c_customer_id#11, c_first_name#12, c_last_name#13, d_year#7, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#19] +Results [9]: [c_customer_id#11, c_first_name#12, c_last_name#13, d_year#7, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17, sum#20] + +(20) Exchange +Input [9]: [c_customer_id#11, c_first_name#12, c_last_name#13, d_year#7, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17, sum#20] +Arguments: hashpartitioning(c_customer_id#11, c_first_name#12, c_last_name#13, d_year#7, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17, 5), ENSURE_REQUIREMENTS, [id=#21] + +(21) HashAggregate [codegen id : 7] +Input [9]: [c_customer_id#11, c_first_name#12, c_last_name#13, d_year#7, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17, sum#20] +Keys [8]: [c_customer_id#11, c_first_name#12, c_last_name#13, d_year#7, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))#22] +Results [2]: [c_customer_id#11 AS customer_id#23, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))#22,18,2) AS year_total#24] + +(22) Filter [codegen id : 7] +Input [2]: [customer_id#23, year_total#24] +Condition : (isnotnull(year_total#24) AND (year_total#24 > 0.00)) + +(23) Exchange +Input [2]: [customer_id#23, year_total#24] +Arguments: hashpartitioning(customer_id#23, 5), ENSURE_REQUIREMENTS, [id=#25] + +(24) Sort [codegen id : 8] +Input [2]: [customer_id#23, year_total#24] +Arguments: [customer_id#23 ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, ss_sold_date_sk#29] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#29), dynamicpruningexpression(ss_sold_date_sk#29 IN dynamicpruning#30)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 10] +Input [4]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, ss_sold_date_sk#29] + +(27) Filter [codegen id : 10] +Input [4]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, ss_sold_date_sk#29] +Condition : isnotnull(ss_customer_sk#26) + +(28) Scan parquet default.date_dim +Output [2]: [d_date_sk#31, d_year#32] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#31, d_year#32] + +(30) Filter [codegen id : 9] +Input [2]: [d_date_sk#31, d_year#32] +Condition : ((isnotnull(d_year#32) AND (d_year#32 = 2002)) AND isnotnull(d_date_sk#31)) + +(31) BroadcastExchange +Input [2]: [d_date_sk#31, d_year#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#33] + +(32) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#29] +Right keys [1]: [d_date_sk#31] +Join condition: None + +(33) Project [codegen id : 10] +Output [4]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, d_year#32] +Input [6]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, ss_sold_date_sk#29, d_date_sk#31, d_year#32] + +(34) Exchange +Input [4]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, d_year#32] +Arguments: hashpartitioning(ss_customer_sk#26, 5), ENSURE_REQUIREMENTS, [id=#34] + +(35) Sort [codegen id : 11] +Input [4]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, d_year#32] +Arguments: [ss_customer_sk#26 ASC NULLS FIRST], false, 0 + +(36) ReusedExchange [Reuses operator id: 15] +Output [8]: [c_customer_sk#35, c_customer_id#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42] + +(37) Sort [codegen id : 13] +Input [8]: [c_customer_sk#35, c_customer_id#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42] +Arguments: [c_customer_sk#35 ASC NULLS FIRST], false, 0 + +(38) SortMergeJoin [codegen id : 14] +Left keys [1]: [ss_customer_sk#26] +Right keys [1]: [c_customer_sk#35] +Join condition: None + +(39) Project [codegen id : 14] +Output [10]: [c_customer_id#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42, ss_ext_discount_amt#27, ss_ext_list_price#28, d_year#32] +Input [12]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, d_year#32, c_customer_sk#35, c_customer_id#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42] + +(40) HashAggregate [codegen id : 14] +Input [10]: [c_customer_id#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42, ss_ext_discount_amt#27, ss_ext_list_price#28, d_year#32] +Keys [8]: [c_customer_id#36, c_first_name#37, c_last_name#38, d_year#32, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#28 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#27 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#43] +Results [9]: [c_customer_id#36, c_first_name#37, c_last_name#38, d_year#32, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42, sum#44] + +(41) Exchange +Input [9]: [c_customer_id#36, c_first_name#37, c_last_name#38, d_year#32, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42, sum#44] +Arguments: hashpartitioning(c_customer_id#36, c_first_name#37, c_last_name#38, d_year#32, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42, 5), ENSURE_REQUIREMENTS, [id=#45] + +(42) HashAggregate [codegen id : 15] +Input [9]: [c_customer_id#36, c_first_name#37, c_last_name#38, d_year#32, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42, sum#44] +Keys [8]: [c_customer_id#36, c_first_name#37, c_last_name#38, d_year#32, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#28 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#27 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#28 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#27 as decimal(8,2)))), DecimalType(8,2), true)))#46] +Results [3]: [c_customer_id#36 AS customer_id#47, c_preferred_cust_flag#39 AS customer_preferred_cust_flag#48, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#28 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#27 as decimal(8,2)))), DecimalType(8,2), true)))#46,18,2) AS year_total#49] + +(43) Exchange +Input [3]: [customer_id#47, customer_preferred_cust_flag#48, year_total#49] +Arguments: hashpartitioning(customer_id#47, 5), ENSURE_REQUIREMENTS, [id=#50] + +(44) Sort [codegen id : 16] +Input [3]: [customer_id#47, customer_preferred_cust_flag#48, year_total#49] +Arguments: [customer_id#47 ASC NULLS FIRST], false, 0 + +(45) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#23] +Right keys [1]: [customer_id#47] +Join condition: None + +(46) Project [codegen id : 17] +Output [4]: [customer_id#23, year_total#24, customer_preferred_cust_flag#48, year_total#49] +Input [5]: [customer_id#23, year_total#24, customer_id#47, customer_preferred_cust_flag#48, year_total#49] + +(47) Scan parquet default.web_sales +Output [4]: [ws_bill_customer_sk#51, ws_ext_discount_amt#52, ws_ext_list_price#53, ws_sold_date_sk#54] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#54), dynamicpruningexpression(ws_sold_date_sk#54 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 19] +Input [4]: [ws_bill_customer_sk#51, ws_ext_discount_amt#52, ws_ext_list_price#53, ws_sold_date_sk#54] + +(49) Filter [codegen id : 19] +Input [4]: [ws_bill_customer_sk#51, ws_ext_discount_amt#52, ws_ext_list_price#53, ws_sold_date_sk#54] +Condition : isnotnull(ws_bill_customer_sk#51) + +(50) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#55, d_year#56] + +(51) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [ws_sold_date_sk#54] +Right keys [1]: [d_date_sk#55] +Join condition: None + +(52) Project [codegen id : 19] +Output [4]: [ws_bill_customer_sk#51, ws_ext_discount_amt#52, ws_ext_list_price#53, d_year#56] +Input [6]: [ws_bill_customer_sk#51, ws_ext_discount_amt#52, ws_ext_list_price#53, ws_sold_date_sk#54, d_date_sk#55, d_year#56] + +(53) Exchange +Input [4]: [ws_bill_customer_sk#51, ws_ext_discount_amt#52, ws_ext_list_price#53, d_year#56] +Arguments: hashpartitioning(ws_bill_customer_sk#51, 5), ENSURE_REQUIREMENTS, [id=#57] + +(54) Sort [codegen id : 20] +Input [4]: [ws_bill_customer_sk#51, ws_ext_discount_amt#52, ws_ext_list_price#53, d_year#56] +Arguments: [ws_bill_customer_sk#51 ASC NULLS FIRST], false, 0 + +(55) ReusedExchange [Reuses operator id: 15] +Output [8]: [c_customer_sk#58, c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65] + +(56) Sort [codegen id : 22] +Input [8]: [c_customer_sk#58, c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65] +Arguments: [c_customer_sk#58 ASC NULLS FIRST], false, 0 + +(57) SortMergeJoin [codegen id : 23] +Left keys [1]: [ws_bill_customer_sk#51] +Right keys [1]: [c_customer_sk#58] +Join condition: None + +(58) Project [codegen id : 23] +Output [10]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, ws_ext_discount_amt#52, ws_ext_list_price#53, d_year#56] +Input [12]: [ws_bill_customer_sk#51, ws_ext_discount_amt#52, ws_ext_list_price#53, d_year#56, c_customer_sk#58, c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65] + +(59) HashAggregate [codegen id : 23] +Input [10]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, ws_ext_discount_amt#52, ws_ext_list_price#53, d_year#56] +Keys [8]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, d_year#56] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#52 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#66] +Results [9]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, d_year#56, sum#67] + +(60) Exchange +Input [9]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, d_year#56, sum#67] +Arguments: hashpartitioning(c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, d_year#56, 5), ENSURE_REQUIREMENTS, [id=#68] + +(61) HashAggregate [codegen id : 24] +Input [9]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, d_year#56, sum#67] +Keys [8]: [c_customer_id#59, c_first_name#60, c_last_name#61, c_preferred_cust_flag#62, c_birth_country#63, c_login#64, c_email_address#65, d_year#56] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#52 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#52 as decimal(8,2)))), DecimalType(8,2), true)))#69] +Results [2]: [c_customer_id#59 AS customer_id#70, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#53 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#52 as decimal(8,2)))), DecimalType(8,2), true)))#69,18,2) AS year_total#71] + +(62) Filter [codegen id : 24] +Input [2]: [customer_id#70, year_total#71] +Condition : (isnotnull(year_total#71) AND (year_total#71 > 0.00)) + +(63) Project [codegen id : 24] +Output [2]: [customer_id#70 AS customer_id#72, year_total#71 AS year_total#73] +Input [2]: [customer_id#70, year_total#71] + +(64) Exchange +Input [2]: [customer_id#72, year_total#73] +Arguments: hashpartitioning(customer_id#72, 5), ENSURE_REQUIREMENTS, [id=#74] + +(65) Sort [codegen id : 25] +Input [2]: [customer_id#72, year_total#73] +Arguments: [customer_id#72 ASC NULLS FIRST], false, 0 + +(66) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#23] +Right keys [1]: [customer_id#72] +Join condition: None + +(67) Project [codegen id : 26] +Output [5]: [customer_id#23, year_total#24, customer_preferred_cust_flag#48, year_total#49, year_total#73] +Input [6]: [customer_id#23, year_total#24, customer_preferred_cust_flag#48, year_total#49, customer_id#72, year_total#73] + +(68) Scan parquet default.web_sales +Output [4]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_list_price#77, ws_sold_date_sk#78] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#78), dynamicpruningexpression(ws_sold_date_sk#78 IN dynamicpruning#30)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(69) ColumnarToRow [codegen id : 28] +Input [4]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_list_price#77, ws_sold_date_sk#78] + +(70) Filter [codegen id : 28] +Input [4]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_list_price#77, ws_sold_date_sk#78] +Condition : isnotnull(ws_bill_customer_sk#75) + +(71) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#79, d_year#80] + +(72) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#78] +Right keys [1]: [d_date_sk#79] +Join condition: None + +(73) Project [codegen id : 28] +Output [4]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_list_price#77, d_year#80] +Input [6]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_list_price#77, ws_sold_date_sk#78, d_date_sk#79, d_year#80] + +(74) Exchange +Input [4]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_list_price#77, d_year#80] +Arguments: hashpartitioning(ws_bill_customer_sk#75, 5), ENSURE_REQUIREMENTS, [id=#81] + +(75) Sort [codegen id : 29] +Input [4]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_list_price#77, d_year#80] +Arguments: [ws_bill_customer_sk#75 ASC NULLS FIRST], false, 0 + +(76) ReusedExchange [Reuses operator id: 15] +Output [8]: [c_customer_sk#82, c_customer_id#83, c_first_name#84, c_last_name#85, c_preferred_cust_flag#86, c_birth_country#87, c_login#88, c_email_address#89] + +(77) Sort [codegen id : 31] +Input [8]: [c_customer_sk#82, c_customer_id#83, c_first_name#84, c_last_name#85, c_preferred_cust_flag#86, c_birth_country#87, c_login#88, c_email_address#89] +Arguments: [c_customer_sk#82 ASC NULLS FIRST], false, 0 + +(78) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_customer_sk#75] +Right keys [1]: [c_customer_sk#82] +Join condition: None + +(79) Project [codegen id : 32] +Output [10]: [c_customer_id#83, c_first_name#84, c_last_name#85, c_preferred_cust_flag#86, c_birth_country#87, c_login#88, c_email_address#89, ws_ext_discount_amt#76, ws_ext_list_price#77, d_year#80] +Input [12]: [ws_bill_customer_sk#75, ws_ext_discount_amt#76, ws_ext_list_price#77, d_year#80, c_customer_sk#82, c_customer_id#83, c_first_name#84, c_last_name#85, c_preferred_cust_flag#86, c_birth_country#87, c_login#88, c_email_address#89] + +(80) HashAggregate [codegen id : 32] +Input [10]: [c_customer_id#83, c_first_name#84, c_last_name#85, c_preferred_cust_flag#86, c_birth_country#87, c_login#88, c_email_address#89, ws_ext_discount_amt#76, ws_ext_list_price#77, d_year#80] +Keys [8]: [c_customer_id#83, c_first_name#84, c_last_name#85, c_preferred_cust_flag#86, c_birth_country#87, c_login#88, c_email_address#89, d_year#80] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#90] +Results [9]: [c_customer_id#83, c_first_name#84, c_last_name#85, c_preferred_cust_flag#86, c_birth_country#87, c_login#88, c_email_address#89, d_year#80, sum#91] + +(81) Exchange +Input [9]: [c_customer_id#83, c_first_name#84, c_last_name#85, c_preferred_cust_flag#86, c_birth_country#87, c_login#88, c_email_address#89, d_year#80, sum#91] +Arguments: hashpartitioning(c_customer_id#83, c_first_name#84, c_last_name#85, c_preferred_cust_flag#86, c_birth_country#87, c_login#88, c_email_address#89, d_year#80, 5), ENSURE_REQUIREMENTS, [id=#92] + +(82) HashAggregate [codegen id : 33] +Input [9]: [c_customer_id#83, c_first_name#84, c_last_name#85, c_preferred_cust_flag#86, c_birth_country#87, c_login#88, c_email_address#89, d_year#80, sum#91] +Keys [8]: [c_customer_id#83, c_first_name#84, c_last_name#85, c_preferred_cust_flag#86, c_birth_country#87, c_login#88, c_email_address#89, d_year#80] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(8,2)))), DecimalType(8,2), true)))#93] +Results [2]: [c_customer_id#83 AS customer_id#94, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#77 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#76 as decimal(8,2)))), DecimalType(8,2), true)))#93,18,2) AS year_total#95] + +(83) Exchange +Input [2]: [customer_id#94, year_total#95] +Arguments: hashpartitioning(customer_id#94, 5), ENSURE_REQUIREMENTS, [id=#96] + +(84) Sort [codegen id : 34] +Input [2]: [customer_id#94, year_total#95] +Arguments: [customer_id#94 ASC NULLS FIRST], false, 0 + +(85) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#23] +Right keys [1]: [customer_id#94] +Join condition: (CASE WHEN (year_total#73 > 0.00) THEN CheckOverflow((promote_precision(year_total#95) / promote_precision(year_total#73)), DecimalType(38,20), true) ELSE null END > CASE WHEN (year_total#24 > 0.00) THEN CheckOverflow((promote_precision(year_total#49) / promote_precision(year_total#24)), DecimalType(38,20), true) ELSE null END) + +(86) Project [codegen id : 35] +Output [1]: [customer_preferred_cust_flag#48] +Input [7]: [customer_id#23, year_total#24, customer_preferred_cust_flag#48, year_total#49, year_total#73, customer_id#94, year_total#95] + +(87) TakeOrderedAndProject +Input [1]: [customer_preferred_cust_flag#48] +Arguments: 100, [customer_preferred_cust_flag#48 ASC NULLS FIRST], [customer_preferred_cust_flag#48] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (88) + + +(88) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#6, d_year#7] + +Subquery:2 Hosting operator id = 25 Hosting Expression = ss_sold_date_sk#29 IN dynamicpruning#30 +ReusedExchange (89) + + +(89) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#31, d_year#32] + +Subquery:3 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#54 IN dynamicpruning#5 + +Subquery:4 Hosting operator id = 68 Hosting Expression = ws_sold_date_sk#78 IN dynamicpruning#30 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/simplified.txt new file mode 100644 index 0000000000000..006f6a9f018ce --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11.sf100/simplified.txt @@ -0,0 +1,164 @@ +TakeOrderedAndProject [customer_preferred_cust_flag] + WholeStageCodegen (35) + Project [customer_preferred_cust_flag] + SortMergeJoin [customer_id,customer_id,year_total,year_total,year_total,year_total] + InputAdapter + WholeStageCodegen (26) + Project [customer_id,year_total,customer_preferred_cust_flag,year_total,year_total] + SortMergeJoin [customer_id,customer_id] + InputAdapter + WholeStageCodegen (17) + Project [customer_id,year_total,customer_preferred_cust_flag,year_total] + SortMergeJoin [customer_id,customer_id] + InputAdapter + WholeStageCodegen (8) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #1 + WholeStageCodegen (7) + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #3 + WholeStageCodegen (2) + Project [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + WholeStageCodegen (16) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #6 + WholeStageCodegen (15) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,customer_preferred_cust_flag,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #7 + WholeStageCodegen (14) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #8 + WholeStageCodegen (10) + Project [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (9) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (13) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 + InputAdapter + WholeStageCodegen (25) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #10 + WholeStageCodegen (24) + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #11 + WholeStageCodegen (23) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,d_year] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (20) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #12 + WholeStageCodegen (19) + Project [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 + InputAdapter + WholeStageCodegen (22) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 + InputAdapter + WholeStageCodegen (34) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #13 + WholeStageCodegen (33) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #14 + WholeStageCodegen (32) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,d_year] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (29) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #15 + WholeStageCodegen (28) + Project [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year] #9 + InputAdapter + WholeStageCodegen (31) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt new file mode 100644 index 0000000000000..4081f69732168 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/explain.txt @@ -0,0 +1,476 @@ +== Physical Plan == +TakeOrderedAndProject (79) ++- * Project (78) + +- * BroadcastHashJoin Inner BuildRight (77) + :- * Project (60) + : +- * BroadcastHashJoin Inner BuildRight (59) + : :- * Project (40) + : : +- * BroadcastHashJoin Inner BuildRight (39) + : : :- * Filter (19) + : : : +- * HashAggregate (18) + : : : +- Exchange (17) + : : : +- * HashAggregate (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (38) + : : +- * HashAggregate (37) + : : +- Exchange (36) + : : +- * HashAggregate (35) + : : +- * Project (34) + : : +- * BroadcastHashJoin Inner BuildRight (33) + : : :- * Project (28) + : : : +- * BroadcastHashJoin Inner BuildRight (27) + : : : :- * Filter (22) + : : : : +- * ColumnarToRow (21) + : : : : +- Scan parquet default.customer (20) + : : : +- BroadcastExchange (26) + : : : +- * Filter (25) + : : : +- * ColumnarToRow (24) + : : : +- Scan parquet default.store_sales (23) + : : +- BroadcastExchange (32) + : : +- * Filter (31) + : : +- * ColumnarToRow (30) + : : +- Scan parquet default.date_dim (29) + : +- BroadcastExchange (58) + : +- * Project (57) + : +- * Filter (56) + : +- * HashAggregate (55) + : +- Exchange (54) + : +- * HashAggregate (53) + : +- * Project (52) + : +- * BroadcastHashJoin Inner BuildRight (51) + : :- * Project (49) + : : +- * BroadcastHashJoin Inner BuildRight (48) + : : :- * Filter (43) + : : : +- * ColumnarToRow (42) + : : : +- Scan parquet default.customer (41) + : : +- BroadcastExchange (47) + : : +- * Filter (46) + : : +- * ColumnarToRow (45) + : : +- Scan parquet default.web_sales (44) + : +- ReusedExchange (50) + +- BroadcastExchange (76) + +- * HashAggregate (75) + +- Exchange (74) + +- * HashAggregate (73) + +- * Project (72) + +- * BroadcastHashJoin Inner BuildRight (71) + :- * Project (69) + : +- * BroadcastHashJoin Inner BuildRight (68) + : :- * Filter (63) + : : +- * ColumnarToRow (62) + : : +- Scan parquet default.customer (61) + : +- BroadcastExchange (67) + : +- * Filter (66) + : +- * ColumnarToRow (65) + : +- Scan parquet default.web_sales (64) + +- ReusedExchange (70) + + +(1) Scan parquet default.customer +Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] + +(3) Filter [codegen id : 3] +Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) + +(4) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#12), dynamicpruningexpression(ss_sold_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12] + +(6) Filter [codegen id : 1] +Input [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12] +Condition : isnotnull(ss_customer_sk#9) + +(7) BroadcastExchange +Input [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#9] +Join condition: None + +(9) Project [codegen id : 3] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12] +Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#15, d_year#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] +Condition : ((isnotnull(d_year#16) AND (d_year#16 = 2001)) AND isnotnull(d_date_sk#15)) + +(13) BroadcastExchange +Input [2]: [d_date_sk#15, d_year#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#12] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(15) Project [codegen id : 3] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, d_year#16] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12, d_date_sk#15, d_year#16] + +(16) HashAggregate [codegen id : 3] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, d_year#16] +Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#18] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#19] + +(17) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#19] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), ENSURE_REQUIREMENTS, [id=#20] + +(18) HashAggregate [codegen id : 16] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#19] +Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))#21] +Results [2]: [c_customer_id#2 AS customer_id#22, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))#21,18,2) AS year_total#23] + +(19) Filter [codegen id : 16] +Input [2]: [customer_id#22, year_total#23] +Condition : (isnotnull(year_total#23) AND (year_total#23 > 0.00)) + +(20) Scan parquet default.customer +Output [8]: [c_customer_sk#24, c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [8]: [c_customer_sk#24, c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31] + +(22) Filter [codegen id : 6] +Input [8]: [c_customer_sk#24, c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31] +Condition : (isnotnull(c_customer_sk#24) AND isnotnull(c_customer_id#25)) + +(23) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#32, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#35), dynamicpruningexpression(ss_sold_date_sk#35 IN dynamicpruning#36)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [4]: [ss_customer_sk#32, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35] + +(25) Filter [codegen id : 4] +Input [4]: [ss_customer_sk#32, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35] +Condition : isnotnull(ss_customer_sk#32) + +(26) BroadcastExchange +Input [4]: [ss_customer_sk#32, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#37] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [c_customer_sk#24] +Right keys [1]: [ss_customer_sk#32] +Join condition: None + +(28) Project [codegen id : 6] +Output [10]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35] +Input [12]: [c_customer_sk#24, c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_customer_sk#32, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35] + +(29) Scan parquet default.date_dim +Output [2]: [d_date_sk#38, d_year#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#38, d_year#39] + +(31) Filter [codegen id : 5] +Input [2]: [d_date_sk#38, d_year#39] +Condition : ((isnotnull(d_year#39) AND (d_year#39 = 2002)) AND isnotnull(d_date_sk#38)) + +(32) BroadcastExchange +Input [2]: [d_date_sk#38, d_year#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40] + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#35] +Right keys [1]: [d_date_sk#38] +Join condition: None + +(34) Project [codegen id : 6] +Output [10]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_ext_discount_amt#33, ss_ext_list_price#34, d_year#39] +Input [12]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35, d_date_sk#38, d_year#39] + +(35) HashAggregate [codegen id : 6] +Input [10]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_ext_discount_amt#33, ss_ext_list_price#34, d_year#39] +Keys [8]: [c_customer_id#25, c_first_name#26, c_last_name#27, d_year#39, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#34 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#33 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#41] +Results [9]: [c_customer_id#25, c_first_name#26, c_last_name#27, d_year#39, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, sum#42] + +(36) Exchange +Input [9]: [c_customer_id#25, c_first_name#26, c_last_name#27, d_year#39, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, sum#42] +Arguments: hashpartitioning(c_customer_id#25, c_first_name#26, c_last_name#27, d_year#39, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, 5), ENSURE_REQUIREMENTS, [id=#43] + +(37) HashAggregate [codegen id : 7] +Input [9]: [c_customer_id#25, c_first_name#26, c_last_name#27, d_year#39, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, sum#42] +Keys [8]: [c_customer_id#25, c_first_name#26, c_last_name#27, d_year#39, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#34 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#33 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#34 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#33 as decimal(8,2)))), DecimalType(8,2), true)))#44] +Results [3]: [c_customer_id#25 AS customer_id#45, c_preferred_cust_flag#28 AS customer_preferred_cust_flag#46, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#34 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#33 as decimal(8,2)))), DecimalType(8,2), true)))#44,18,2) AS year_total#47] + +(38) BroadcastExchange +Input [3]: [customer_id#45, customer_preferred_cust_flag#46, year_total#47] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#48] + +(39) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#22] +Right keys [1]: [customer_id#45] +Join condition: None + +(40) Project [codegen id : 16] +Output [4]: [customer_id#22, year_total#23, customer_preferred_cust_flag#46, year_total#47] +Input [5]: [customer_id#22, year_total#23, customer_id#45, customer_preferred_cust_flag#46, year_total#47] + +(41) Scan parquet default.customer +Output [8]: [c_customer_sk#49, c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(42) ColumnarToRow [codegen id : 10] +Input [8]: [c_customer_sk#49, c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56] + +(43) Filter [codegen id : 10] +Input [8]: [c_customer_sk#49, c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56] +Condition : (isnotnull(c_customer_sk#49) AND isnotnull(c_customer_id#50)) + +(44) Scan parquet default.web_sales +Output [4]: [ws_bill_customer_sk#57, ws_ext_discount_amt#58, ws_ext_list_price#59, ws_sold_date_sk#60] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#60), dynamicpruningexpression(ws_sold_date_sk#60 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(45) ColumnarToRow [codegen id : 8] +Input [4]: [ws_bill_customer_sk#57, ws_ext_discount_amt#58, ws_ext_list_price#59, ws_sold_date_sk#60] + +(46) Filter [codegen id : 8] +Input [4]: [ws_bill_customer_sk#57, ws_ext_discount_amt#58, ws_ext_list_price#59, ws_sold_date_sk#60] +Condition : isnotnull(ws_bill_customer_sk#57) + +(47) BroadcastExchange +Input [4]: [ws_bill_customer_sk#57, ws_ext_discount_amt#58, ws_ext_list_price#59, ws_sold_date_sk#60] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#61] + +(48) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [c_customer_sk#49] +Right keys [1]: [ws_bill_customer_sk#57] +Join condition: None + +(49) Project [codegen id : 10] +Output [10]: [c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56, ws_ext_discount_amt#58, ws_ext_list_price#59, ws_sold_date_sk#60] +Input [12]: [c_customer_sk#49, c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56, ws_bill_customer_sk#57, ws_ext_discount_amt#58, ws_ext_list_price#59, ws_sold_date_sk#60] + +(50) ReusedExchange [Reuses operator id: 13] +Output [2]: [d_date_sk#62, d_year#63] + +(51) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#60] +Right keys [1]: [d_date_sk#62] +Join condition: None + +(52) Project [codegen id : 10] +Output [10]: [c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56, ws_ext_discount_amt#58, ws_ext_list_price#59, d_year#63] +Input [12]: [c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56, ws_ext_discount_amt#58, ws_ext_list_price#59, ws_sold_date_sk#60, d_date_sk#62, d_year#63] + +(53) HashAggregate [codegen id : 10] +Input [10]: [c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56, ws_ext_discount_amt#58, ws_ext_list_price#59, d_year#63] +Keys [8]: [c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56, d_year#63] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#59 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#58 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#64] +Results [9]: [c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56, d_year#63, sum#65] + +(54) Exchange +Input [9]: [c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56, d_year#63, sum#65] +Arguments: hashpartitioning(c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56, d_year#63, 5), ENSURE_REQUIREMENTS, [id=#66] + +(55) HashAggregate [codegen id : 11] +Input [9]: [c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56, d_year#63, sum#65] +Keys [8]: [c_customer_id#50, c_first_name#51, c_last_name#52, c_preferred_cust_flag#53, c_birth_country#54, c_login#55, c_email_address#56, d_year#63] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#59 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#58 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#59 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#58 as decimal(8,2)))), DecimalType(8,2), true)))#67] +Results [2]: [c_customer_id#50 AS customer_id#68, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#59 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#58 as decimal(8,2)))), DecimalType(8,2), true)))#67,18,2) AS year_total#69] + +(56) Filter [codegen id : 11] +Input [2]: [customer_id#68, year_total#69] +Condition : (isnotnull(year_total#69) AND (year_total#69 > 0.00)) + +(57) Project [codegen id : 11] +Output [2]: [customer_id#68 AS customer_id#70, year_total#69 AS year_total#71] +Input [2]: [customer_id#68, year_total#69] + +(58) BroadcastExchange +Input [2]: [customer_id#70, year_total#71] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#72] + +(59) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#22] +Right keys [1]: [customer_id#70] +Join condition: None + +(60) Project [codegen id : 16] +Output [5]: [customer_id#22, year_total#23, customer_preferred_cust_flag#46, year_total#47, year_total#71] +Input [6]: [customer_id#22, year_total#23, customer_preferred_cust_flag#46, year_total#47, customer_id#70, year_total#71] + +(61) Scan parquet default.customer +Output [8]: [c_customer_sk#73, c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(62) ColumnarToRow [codegen id : 14] +Input [8]: [c_customer_sk#73, c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80] + +(63) Filter [codegen id : 14] +Input [8]: [c_customer_sk#73, c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80] +Condition : (isnotnull(c_customer_sk#73) AND isnotnull(c_customer_id#74)) + +(64) Scan parquet default.web_sales +Output [4]: [ws_bill_customer_sk#81, ws_ext_discount_amt#82, ws_ext_list_price#83, ws_sold_date_sk#84] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#84), dynamicpruningexpression(ws_sold_date_sk#84 IN dynamicpruning#36)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(65) ColumnarToRow [codegen id : 12] +Input [4]: [ws_bill_customer_sk#81, ws_ext_discount_amt#82, ws_ext_list_price#83, ws_sold_date_sk#84] + +(66) Filter [codegen id : 12] +Input [4]: [ws_bill_customer_sk#81, ws_ext_discount_amt#82, ws_ext_list_price#83, ws_sold_date_sk#84] +Condition : isnotnull(ws_bill_customer_sk#81) + +(67) BroadcastExchange +Input [4]: [ws_bill_customer_sk#81, ws_ext_discount_amt#82, ws_ext_list_price#83, ws_sold_date_sk#84] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#85] + +(68) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [c_customer_sk#73] +Right keys [1]: [ws_bill_customer_sk#81] +Join condition: None + +(69) Project [codegen id : 14] +Output [10]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, ws_ext_discount_amt#82, ws_ext_list_price#83, ws_sold_date_sk#84] +Input [12]: [c_customer_sk#73, c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, ws_bill_customer_sk#81, ws_ext_discount_amt#82, ws_ext_list_price#83, ws_sold_date_sk#84] + +(70) ReusedExchange [Reuses operator id: 32] +Output [2]: [d_date_sk#86, d_year#87] + +(71) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#84] +Right keys [1]: [d_date_sk#86] +Join condition: None + +(72) Project [codegen id : 14] +Output [10]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, ws_ext_discount_amt#82, ws_ext_list_price#83, d_year#87] +Input [12]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, ws_ext_discount_amt#82, ws_ext_list_price#83, ws_sold_date_sk#84, d_date_sk#86, d_year#87] + +(73) HashAggregate [codegen id : 14] +Input [10]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, ws_ext_discount_amt#82, ws_ext_list_price#83, d_year#87] +Keys [8]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, d_year#87] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#83 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#82 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#88] +Results [9]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, d_year#87, sum#89] + +(74) Exchange +Input [9]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, d_year#87, sum#89] +Arguments: hashpartitioning(c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, d_year#87, 5), ENSURE_REQUIREMENTS, [id=#90] + +(75) HashAggregate [codegen id : 15] +Input [9]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, d_year#87, sum#89] +Keys [8]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, d_year#87] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#83 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#82 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#83 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#82 as decimal(8,2)))), DecimalType(8,2), true)))#91] +Results [2]: [c_customer_id#74 AS customer_id#92, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#83 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#82 as decimal(8,2)))), DecimalType(8,2), true)))#91,18,2) AS year_total#93] + +(76) BroadcastExchange +Input [2]: [customer_id#92, year_total#93] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#94] + +(77) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#22] +Right keys [1]: [customer_id#92] +Join condition: (CASE WHEN (year_total#71 > 0.00) THEN CheckOverflow((promote_precision(year_total#93) / promote_precision(year_total#71)), DecimalType(38,20), true) ELSE null END > CASE WHEN (year_total#23 > 0.00) THEN CheckOverflow((promote_precision(year_total#47) / promote_precision(year_total#23)), DecimalType(38,20), true) ELSE null END) + +(78) Project [codegen id : 16] +Output [1]: [customer_preferred_cust_flag#46] +Input [7]: [customer_id#22, year_total#23, customer_preferred_cust_flag#46, year_total#47, year_total#71, customer_id#92, year_total#93] + +(79) TakeOrderedAndProject +Input [1]: [customer_preferred_cust_flag#46] +Arguments: 100, [customer_preferred_cust_flag#46 ASC NULLS FIRST], [customer_preferred_cust_flag#46] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#12 IN dynamicpruning#13 +ReusedExchange (80) + + +(80) ReusedExchange [Reuses operator id: 13] +Output [2]: [d_date_sk#15, d_year#16] + +Subquery:2 Hosting operator id = 23 Hosting Expression = ss_sold_date_sk#35 IN dynamicpruning#36 +ReusedExchange (81) + + +(81) ReusedExchange [Reuses operator id: 32] +Output [2]: [d_date_sk#38, d_year#39] + +Subquery:3 Hosting operator id = 44 Hosting Expression = ws_sold_date_sk#60 IN dynamicpruning#13 + +Subquery:4 Hosting operator id = 64 Hosting Expression = ws_sold_date_sk#84 IN dynamicpruning#36 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt new file mode 100644 index 0000000000000..6dbf8b3bf93f3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q11/simplified.txt @@ -0,0 +1,124 @@ +TakeOrderedAndProject [customer_preferred_cust_flag] + WholeStageCodegen (16) + Project [customer_preferred_cust_flag] + BroadcastHashJoin [customer_id,customer_id,year_total,year_total,year_total,year_total] + Project [customer_id,year_total,customer_preferred_cust_flag,year_total,year_total] + BroadcastHashJoin [customer_id,customer_id] + Project [customer_id,year_total,customer_preferred_cust_flag,year_total] + BroadcastHashJoin [customer_id,customer_id] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (7) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,customer_preferred_cust_flag,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #7 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (5) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (11) + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #9 + WholeStageCodegen (10) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (8) + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (15) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #12 + WholeStageCodegen (14) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (12) + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt new file mode 100644 index 0000000000000..7c414d9080734 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/explain.txt @@ -0,0 +1,163 @@ +== Physical Plan == +TakeOrderedAndProject (27) ++- * Project (26) + +- Window (25) + +- * Sort (24) + +- Exchange (23) + +- * HashAggregate (22) + +- Exchange (21) + +- * HashAggregate (20) + +- * Project (19) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) + +- * Filter (15) + +- * ColumnarToRow (14) + +- Scan parquet default.date_dim (13) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 1] +Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] +Condition : isnotnull(ws_item_sk#1) + +(4) Exchange +Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] +Arguments: hashpartitioning(ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#5] + +(5) Sort [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] +Arguments: [ws_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.item +Output [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports ,Books ,Home ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] + +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Condition : (i_category#11 IN (Sports ,Books ,Home ) AND isnotnull(i_item_sk#6)) + +(9) Exchange +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Arguments: hashpartitioning(i_item_sk#6, 5), ENSURE_REQUIREMENTS, [id=#12] + +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 + +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [ws_item_sk#1] +Right keys [1]: [i_item_sk#6] +Join condition: None + +(12) Project [codegen id : 6] +Output [7]: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Input [9]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] + +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#13, d_date#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#13, d_date#14] + +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#13, d_date#14] +Condition : (((isnotnull(d_date#14) AND (d_date#14 >= 1999-02-22)) AND (d_date#14 <= 1999-03-24)) AND isnotnull(d_date_sk#13)) + +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#13] +Input [2]: [d_date_sk#13, d_date#14] + +(17) BroadcastExchange +Input [1]: [d_date_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#13] +Join condition: None + +(19) Project [codegen id : 6] +Output [6]: [ws_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Input [8]: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11, d_date_sk#13] + +(20) HashAggregate [codegen id : 6] +Input [6]: [ws_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#16] +Results [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] + +(21) Exchange +Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] +Arguments: hashpartitioning(i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, 5), ENSURE_REQUIREMENTS, [id=#18] + +(22) HashAggregate [codegen id : 7] +Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] +Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#2))#19] +Results [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#19,17,2) AS itemrevenue#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#19,17,2) AS _w0#21, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#19,17,2) AS _w1#22, i_item_id#7] + +(23) Exchange +Input [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, i_item_id#7] +Arguments: hashpartitioning(i_class#10, 5), ENSURE_REQUIREMENTS, [id=#23] + +(24) Sort [codegen id : 8] +Input [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, i_item_id#7] +Arguments: [i_class#10 ASC NULLS FIRST], false, 0 + +(25) Window +Input [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, i_item_id#7] +Arguments: [sum(_w1#22) windowspecdefinition(i_class#10, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#24], [i_class#10] + +(26) Project [codegen id : 9] +Output [7]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#21) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#24)), DecimalType(38,17), true) AS revenueratio#25, i_item_id#7] +Input [9]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, i_item_id#7, _we0#24] + +(27) TakeOrderedAndProject +Input [7]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25, i_item_id#7] +Arguments: 100, [i_category#11 ASC NULLS FIRST, i_class#10 ASC NULLS FIRST, i_item_id#7 ASC NULLS FIRST, i_item_desc#8 ASC NULLS FIRST, revenueratio#25 ASC NULLS FIRST], [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (28) + + +(28) ReusedExchange [Reuses operator id: 17] +Output [1]: [d_date_sk#13] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt new file mode 100644 index 0000000000000..e981328e2d9b4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12.sf100/simplified.txt @@ -0,0 +1,49 @@ +TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_current_price,itemrevenue] + WholeStageCodegen (9) + Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0,i_item_id] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (8) + Sort [i_class] + InputAdapter + Exchange [i_class] #1 + WholeStageCodegen (7) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(ws_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #2 + WholeStageCodegen (6) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_ext_sales_price,ws_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [ws_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ws_item_sk] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (1) + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_ext_sales_price,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12/explain.txt new file mode 100644 index 0000000000000..0c22f6333e5a9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12/explain.txt @@ -0,0 +1,148 @@ +== Physical Plan == +TakeOrderedAndProject (24) ++- * Project (23) + +- Window (22) + +- * Sort (21) + +- Exchange (20) + +- * HashAggregate (19) + +- Exchange (18) + +- * HashAggregate (17) + +- * Project (16) + +- * BroadcastHashJoin Inner BuildRight (15) + :- * Project (9) + : +- * BroadcastHashJoin Inner BuildRight (8) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- BroadcastExchange (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) + +- BroadcastExchange (14) + +- * Project (13) + +- * Filter (12) + +- * ColumnarToRow (11) + +- Scan parquet default.date_dim (10) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] +Condition : isnotnull(ws_item_sk#1) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports ,Books ,Home ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports ,Books ,Home ) AND isnotnull(i_item_sk#5)) + +(7) BroadcastExchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(9) Project [codegen id : 3] +Output [7]: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 1999-02-22)) AND (d_date#13 <= 1999-03-24)) AND isnotnull(d_date_sk#12)) + +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] + +(14) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#12] +Join condition: None + +(16) Project [codegen id : 3] +Output [6]: [ws_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] + +(17) HashAggregate [codegen id : 3] +Input [6]: [ws_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#15] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] + +(18) Exchange +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), ENSURE_REQUIREMENTS, [id=#17] + +(19) HashAggregate [codegen id : 4] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#2))#18] +Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#18,17,2) AS _w1#21, i_item_id#6] + +(20) Exchange +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: hashpartitioning(i_class#9, 5), ENSURE_REQUIREMENTS, [id=#22] + +(21) Sort [codegen id : 5] +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 + +(22) Window +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] + +(23) Project [codegen id : 6] +Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#6] +Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6, _we0#23] + +(24) TakeOrderedAndProject +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] +Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (25) + + +(25) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12/simplified.txt new file mode 100644 index 0000000000000..0f193b514eff2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q12/simplified.txt @@ -0,0 +1,40 @@ +TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_current_price,itemrevenue] + WholeStageCodegen (6) + Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0,i_item_id] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (5) + Sort [i_class] + InputAdapter + Exchange [i_class] #1 + WholeStageCodegen (4) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(ws_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #2 + WholeStageCodegen (3) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_ext_sales_price,ws_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_ext_sales_price,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13.sf100/explain.txt new file mode 100644 index 0000000000000..7d562331218b9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13.sf100/explain.txt @@ -0,0 +1,227 @@ +== Physical Plan == +* HashAggregate (38) ++- Exchange (37) + +- * HashAggregate (36) + +- * Project (35) + +- * BroadcastHashJoin Inner BuildRight (34) + :- * Project (28) + : +- * BroadcastHashJoin Inner BuildRight (27) + : :- * Project (22) + : : +- * BroadcastHashJoin Inner BuildRight (21) + : : :- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.customer_demographics (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.household_demographics (10) + : : +- BroadcastExchange (20) + : : +- * Project (19) + : : +- * Filter (18) + : : +- * ColumnarToRow (17) + : : +- Scan parquet default.date_dim (16) + : +- BroadcastExchange (26) + : +- * Filter (25) + : +- * ColumnarToRow (24) + : +- Scan parquet default.store (23) + +- BroadcastExchange (33) + +- * Project (32) + +- * Filter (31) + +- * ColumnarToRow (30) + +- Scan parquet default.customer_address (29) + + +(1) Scan parquet default.store_sales +Output [10]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#10), dynamicpruningexpression(ss_sold_date_sk#10 IN dynamicpruning#11)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_hdemo_sk), Or(Or(And(GreaterThanOrEqual(ss_net_profit,100.00),LessThanOrEqual(ss_net_profit,200.00)),And(GreaterThanOrEqual(ss_net_profit,150.00),LessThanOrEqual(ss_net_profit,300.00))),And(GreaterThanOrEqual(ss_net_profit,50.00),LessThanOrEqual(ss_net_profit,250.00))), Or(Or(And(GreaterThanOrEqual(ss_sales_price,100.00),LessThanOrEqual(ss_sales_price,150.00)),And(GreaterThanOrEqual(ss_sales_price,50.00),LessThanOrEqual(ss_sales_price,100.00))),And(GreaterThanOrEqual(ss_sales_price,150.00),LessThanOrEqual(ss_sales_price,200.00)))] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 6] +Input [10]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10] + +(3) Filter [codegen id : 6] +Input [10]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10] +Condition : (((((isnotnull(ss_store_sk#4) AND isnotnull(ss_addr_sk#3)) AND isnotnull(ss_cdemo_sk#1)) AND isnotnull(ss_hdemo_sk#2)) AND ((((ss_net_profit#9 >= 100.00) AND (ss_net_profit#9 <= 200.00)) OR ((ss_net_profit#9 >= 150.00) AND (ss_net_profit#9 <= 300.00))) OR ((ss_net_profit#9 >= 50.00) AND (ss_net_profit#9 <= 250.00)))) AND ((((ss_sales_price#6 >= 100.00) AND (ss_sales_price#6 <= 150.00)) OR ((ss_sales_price#6 >= 50.00) AND (ss_sales_price#6 <= 100.00))) OR ((ss_sales_price#6 >= 150.00) AND (ss_sales_price#6 <= 200.00)))) + +(4) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#12, cd_marital_status#13, cd_education_status#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), Or(Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,Advanced Degree )),And(EqualTo(cd_marital_status,S),EqualTo(cd_education_status,College ))),And(EqualTo(cd_marital_status,W),EqualTo(cd_education_status,2 yr Degree )))] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [cd_demo_sk#12, cd_marital_status#13, cd_education_status#14] + +(6) Filter [codegen id : 1] +Input [3]: [cd_demo_sk#12, cd_marital_status#13, cd_education_status#14] +Condition : (isnotnull(cd_demo_sk#12) AND ((((cd_marital_status#13 = M) AND (cd_education_status#14 = Advanced Degree )) OR ((cd_marital_status#13 = S) AND (cd_education_status#14 = College ))) OR ((cd_marital_status#13 = W) AND (cd_education_status#14 = 2 yr Degree )))) + +(7) BroadcastExchange +Input [3]: [cd_demo_sk#12, cd_marital_status#13, cd_education_status#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(8) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_cdemo_sk#1] +Right keys [1]: [cd_demo_sk#12] +Join condition: ((((((cd_marital_status#13 = M) AND (cd_education_status#14 = Advanced Degree )) AND (ss_sales_price#6 >= 100.00)) AND (ss_sales_price#6 <= 150.00)) OR ((((cd_marital_status#13 = S) AND (cd_education_status#14 = College )) AND (ss_sales_price#6 >= 50.00)) AND (ss_sales_price#6 <= 100.00))) OR ((((cd_marital_status#13 = W) AND (cd_education_status#14 = 2 yr Degree )) AND (ss_sales_price#6 >= 150.00)) AND (ss_sales_price#6 <= 200.00))) + +(9) Project [codegen id : 6] +Output [11]: [ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10, cd_marital_status#13, cd_education_status#14] +Input [13]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10, cd_demo_sk#12, cd_marital_status#13, cd_education_status#14] + +(10) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#16, hd_dep_count#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_demo_sk), Or(Or(EqualTo(hd_dep_count,3),EqualTo(hd_dep_count,1)),EqualTo(hd_dep_count,1))] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [hd_demo_sk#16, hd_dep_count#17] + +(12) Filter [codegen id : 2] +Input [2]: [hd_demo_sk#16, hd_dep_count#17] +Condition : (isnotnull(hd_demo_sk#16) AND (((hd_dep_count#17 = 3) OR (hd_dep_count#17 = 1)) OR (hd_dep_count#17 = 1))) + +(13) BroadcastExchange +Input [2]: [hd_demo_sk#16, hd_dep_count#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(14) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#16] +Join condition: (((((((cd_marital_status#13 = M) AND (cd_education_status#14 = Advanced Degree )) AND (ss_sales_price#6 >= 100.00)) AND (ss_sales_price#6 <= 150.00)) AND (hd_dep_count#17 = 3)) OR (((((cd_marital_status#13 = S) AND (cd_education_status#14 = College )) AND (ss_sales_price#6 >= 50.00)) AND (ss_sales_price#6 <= 100.00)) AND (hd_dep_count#17 = 1))) OR (((((cd_marital_status#13 = W) AND (cd_education_status#14 = 2 yr Degree )) AND (ss_sales_price#6 >= 150.00)) AND (ss_sales_price#6 <= 200.00)) AND (hd_dep_count#17 = 1))) + +(15) Project [codegen id : 6] +Output [7]: [ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10] +Input [13]: [ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10, cd_marital_status#13, cd_education_status#14, hd_demo_sk#16, hd_dep_count#17] + +(16) Scan parquet default.date_dim +Output [2]: [d_date_sk#19, d_year#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#19, d_year#20] + +(18) Filter [codegen id : 3] +Input [2]: [d_date_sk#19, d_year#20] +Condition : ((isnotnull(d_year#20) AND (d_year#20 = 2001)) AND isnotnull(d_date_sk#19)) + +(19) Project [codegen id : 3] +Output [1]: [d_date_sk#19] +Input [2]: [d_date_sk#19, d_year#20] + +(20) BroadcastExchange +Input [1]: [d_date_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(21) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#10] +Right keys [1]: [d_date_sk#19] +Join condition: None + +(22) Project [codegen id : 6] +Output [6]: [ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9] +Input [8]: [ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10, d_date_sk#19] + +(23) Scan parquet default.store +Output [1]: [s_store_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [1]: [s_store_sk#22] + +(25) Filter [codegen id : 4] +Input [1]: [s_store_sk#22] +Condition : isnotnull(s_store_sk#22) + +(26) BroadcastExchange +Input [1]: [s_store_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#22] +Join condition: None + +(28) Project [codegen id : 6] +Output [5]: [ss_addr_sk#3, ss_quantity#5, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9] +Input [7]: [ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, s_store_sk#22] + +(29) Scan parquet default.customer_address +Output [3]: [ca_address_sk#24, ca_state#25, ca_country#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), EqualTo(ca_country,United States), IsNotNull(ca_address_sk), Or(Or(In(ca_state, [TX,OH]),In(ca_state, [OR,NM,KY])),In(ca_state, [VA,TX,MS]))] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [3]: [ca_address_sk#24, ca_state#25, ca_country#26] + +(31) Filter [codegen id : 5] +Input [3]: [ca_address_sk#24, ca_state#25, ca_country#26] +Condition : (((isnotnull(ca_country#26) AND (ca_country#26 = United States)) AND isnotnull(ca_address_sk#24)) AND ((ca_state#25 IN (TX,OH) OR ca_state#25 IN (OR,NM,KY)) OR ca_state#25 IN (VA,TX,MS))) + +(32) Project [codegen id : 5] +Output [2]: [ca_address_sk#24, ca_state#25] +Input [3]: [ca_address_sk#24, ca_state#25, ca_country#26] + +(33) BroadcastExchange +Input [2]: [ca_address_sk#24, ca_state#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] + +(34) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_addr_sk#3] +Right keys [1]: [ca_address_sk#24] +Join condition: ((((ca_state#25 IN (TX,OH) AND (ss_net_profit#9 >= 100.00)) AND (ss_net_profit#9 <= 200.00)) OR ((ca_state#25 IN (OR,NM,KY) AND (ss_net_profit#9 >= 150.00)) AND (ss_net_profit#9 <= 300.00))) OR ((ca_state#25 IN (VA,TX,MS) AND (ss_net_profit#9 >= 50.00)) AND (ss_net_profit#9 <= 250.00))) + +(35) Project [codegen id : 6] +Output [3]: [ss_quantity#5, ss_ext_sales_price#7, ss_ext_wholesale_cost#8] +Input [7]: [ss_addr_sk#3, ss_quantity#5, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ca_address_sk#24, ca_state#25] + +(36) HashAggregate [codegen id : 6] +Input [3]: [ss_quantity#5, ss_ext_sales_price#7, ss_ext_wholesale_cost#8] +Keys: [] +Functions [4]: [partial_avg(ss_quantity#5), partial_avg(UnscaledValue(ss_ext_sales_price#7)), partial_avg(UnscaledValue(ss_ext_wholesale_cost#8)), partial_sum(UnscaledValue(ss_ext_wholesale_cost#8))] +Aggregate Attributes [7]: [sum#28, count#29, sum#30, count#31, sum#32, count#33, sum#34] +Results [7]: [sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41] + +(37) Exchange +Input [7]: [sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#42] + +(38) HashAggregate [codegen id : 7] +Input [7]: [sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41] +Keys: [] +Functions [4]: [avg(ss_quantity#5), avg(UnscaledValue(ss_ext_sales_price#7)), avg(UnscaledValue(ss_ext_wholesale_cost#8)), sum(UnscaledValue(ss_ext_wholesale_cost#8))] +Aggregate Attributes [4]: [avg(ss_quantity#5)#43, avg(UnscaledValue(ss_ext_sales_price#7))#44, avg(UnscaledValue(ss_ext_wholesale_cost#8))#45, sum(UnscaledValue(ss_ext_wholesale_cost#8))#46] +Results [4]: [avg(ss_quantity#5)#43 AS avg(ss_quantity)#47, cast((avg(UnscaledValue(ss_ext_sales_price#7))#44 / 100.0) as decimal(11,6)) AS avg(ss_ext_sales_price)#48, cast((avg(UnscaledValue(ss_ext_wholesale_cost#8))#45 / 100.0) as decimal(11,6)) AS avg(ss_ext_wholesale_cost)#49, MakeDecimal(sum(UnscaledValue(ss_ext_wholesale_cost#8))#46,17,2) AS sum(ss_ext_wholesale_cost)#50] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#10 IN dynamicpruning#11 +ReusedExchange (39) + + +(39) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#19] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13.sf100/simplified.txt new file mode 100644 index 0000000000000..26be2b52e400a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13.sf100/simplified.txt @@ -0,0 +1,59 @@ +WholeStageCodegen (7) + HashAggregate [sum,count,sum,count,sum,count,sum] [avg(ss_quantity),avg(UnscaledValue(ss_ext_sales_price)),avg(UnscaledValue(ss_ext_wholesale_cost)),sum(UnscaledValue(ss_ext_wholesale_cost)),avg(ss_quantity),avg(ss_ext_sales_price),avg(ss_ext_wholesale_cost),sum(ss_ext_wholesale_cost),sum,count,sum,count,sum,count,sum] + InputAdapter + Exchange #1 + WholeStageCodegen (6) + HashAggregate [ss_quantity,ss_ext_sales_price,ss_ext_wholesale_cost] [sum,count,sum,count,sum,count,sum,sum,count,sum,count,sum,count,sum] + Project [ss_quantity,ss_ext_sales_price,ss_ext_wholesale_cost] + BroadcastHashJoin [ss_addr_sk,ca_address_sk,ca_state,ss_net_profit] + Project [ss_addr_sk,ss_quantity,ss_ext_sales_price,ss_ext_wholesale_cost,ss_net_profit] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_addr_sk,ss_store_sk,ss_quantity,ss_ext_sales_price,ss_ext_wholesale_cost,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_addr_sk,ss_store_sk,ss_quantity,ss_ext_sales_price,ss_ext_wholesale_cost,ss_net_profit,ss_sold_date_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk,cd_marital_status,cd_education_status,ss_sales_price,hd_dep_count] + Project [ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_ext_sales_price,ss_ext_wholesale_cost,ss_net_profit,ss_sold_date_sk,cd_marital_status,cd_education_status] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk,cd_marital_status,cd_education_status,ss_sales_price] + Filter [ss_store_sk,ss_addr_sk,ss_cdemo_sk,ss_hdemo_sk,ss_net_profit,ss_sales_price] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_ext_sales_price,ss_ext_wholesale_cost,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [cd_demo_sk,cd_marital_status,cd_education_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [hd_demo_sk,hd_dep_count] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Project [ca_address_sk,ca_state] + Filter [ca_country,ca_address_sk,ca_state] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_country] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13/explain.txt new file mode 100644 index 0000000000000..027fde38ff7fa --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13/explain.txt @@ -0,0 +1,227 @@ +== Physical Plan == +* HashAggregate (38) ++- Exchange (37) + +- * HashAggregate (36) + +- * Project (35) + +- * BroadcastHashJoin Inner BuildRight (34) + :- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store (4) + : : : +- BroadcastExchange (14) + : : : +- * Project (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.customer_address (10) + : : +- BroadcastExchange (21) + : : +- * Project (20) + : : +- * Filter (19) + : : +- * ColumnarToRow (18) + : : +- Scan parquet default.date_dim (17) + : +- BroadcastExchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.customer_demographics (24) + +- BroadcastExchange (33) + +- * Filter (32) + +- * ColumnarToRow (31) + +- Scan parquet default.household_demographics (30) + + +(1) Scan parquet default.store_sales +Output [10]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#10), dynamicpruningexpression(ss_sold_date_sk#10 IN dynamicpruning#11)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_hdemo_sk), Or(Or(And(GreaterThanOrEqual(ss_net_profit,100.00),LessThanOrEqual(ss_net_profit,200.00)),And(GreaterThanOrEqual(ss_net_profit,150.00),LessThanOrEqual(ss_net_profit,300.00))),And(GreaterThanOrEqual(ss_net_profit,50.00),LessThanOrEqual(ss_net_profit,250.00))), Or(Or(And(GreaterThanOrEqual(ss_sales_price,100.00),LessThanOrEqual(ss_sales_price,150.00)),And(GreaterThanOrEqual(ss_sales_price,50.00),LessThanOrEqual(ss_sales_price,100.00))),And(GreaterThanOrEqual(ss_sales_price,150.00),LessThanOrEqual(ss_sales_price,200.00)))] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 6] +Input [10]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10] + +(3) Filter [codegen id : 6] +Input [10]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10] +Condition : (((((isnotnull(ss_store_sk#4) AND isnotnull(ss_addr_sk#3)) AND isnotnull(ss_cdemo_sk#1)) AND isnotnull(ss_hdemo_sk#2)) AND ((((ss_net_profit#9 >= 100.00) AND (ss_net_profit#9 <= 200.00)) OR ((ss_net_profit#9 >= 150.00) AND (ss_net_profit#9 <= 300.00))) OR ((ss_net_profit#9 >= 50.00) AND (ss_net_profit#9 <= 250.00)))) AND ((((ss_sales_price#6 >= 100.00) AND (ss_sales_price#6 <= 150.00)) OR ((ss_sales_price#6 >= 50.00) AND (ss_sales_price#6 <= 100.00))) OR ((ss_sales_price#6 >= 150.00) AND (ss_sales_price#6 <= 200.00)))) + +(4) Scan parquet default.store +Output [1]: [s_store_sk#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [1]: [s_store_sk#12] + +(6) Filter [codegen id : 1] +Input [1]: [s_store_sk#12] +Condition : isnotnull(s_store_sk#12) + +(7) BroadcastExchange +Input [1]: [s_store_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(8) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#12] +Join condition: None + +(9) Project [codegen id : 6] +Output [9]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10] +Input [11]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10, s_store_sk#12] + +(10) Scan parquet default.customer_address +Output [3]: [ca_address_sk#14, ca_state#15, ca_country#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), EqualTo(ca_country,United States), IsNotNull(ca_address_sk), Or(Or(In(ca_state, [TX,OH]),In(ca_state, [OR,NM,KY])),In(ca_state, [VA,TX,MS]))] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [ca_address_sk#14, ca_state#15, ca_country#16] + +(12) Filter [codegen id : 2] +Input [3]: [ca_address_sk#14, ca_state#15, ca_country#16] +Condition : (((isnotnull(ca_country#16) AND (ca_country#16 = United States)) AND isnotnull(ca_address_sk#14)) AND ((ca_state#15 IN (TX,OH) OR ca_state#15 IN (OR,NM,KY)) OR ca_state#15 IN (VA,TX,MS))) + +(13) Project [codegen id : 2] +Output [2]: [ca_address_sk#14, ca_state#15] +Input [3]: [ca_address_sk#14, ca_state#15, ca_country#16] + +(14) BroadcastExchange +Input [2]: [ca_address_sk#14, ca_state#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(15) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_addr_sk#3] +Right keys [1]: [ca_address_sk#14] +Join condition: ((((ca_state#15 IN (TX,OH) AND (ss_net_profit#9 >= 100.00)) AND (ss_net_profit#9 <= 200.00)) OR ((ca_state#15 IN (OR,NM,KY) AND (ss_net_profit#9 >= 150.00)) AND (ss_net_profit#9 <= 300.00))) OR ((ca_state#15 IN (VA,TX,MS) AND (ss_net_profit#9 >= 50.00)) AND (ss_net_profit#9 <= 250.00))) + +(16) Project [codegen id : 6] +Output [7]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_sold_date_sk#10] +Input [11]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_net_profit#9, ss_sold_date_sk#10, ca_address_sk#14, ca_state#15] + +(17) Scan parquet default.date_dim +Output [2]: [d_date_sk#18, d_year#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#18, d_year#19] + +(19) Filter [codegen id : 3] +Input [2]: [d_date_sk#18, d_year#19] +Condition : ((isnotnull(d_year#19) AND (d_year#19 = 2001)) AND isnotnull(d_date_sk#18)) + +(20) Project [codegen id : 3] +Output [1]: [d_date_sk#18] +Input [2]: [d_date_sk#18, d_year#19] + +(21) BroadcastExchange +Input [1]: [d_date_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] + +(22) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#10] +Right keys [1]: [d_date_sk#18] +Join condition: None + +(23) Project [codegen id : 6] +Output [6]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8] +Input [8]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, ss_sold_date_sk#10, d_date_sk#18] + +(24) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#21, cd_marital_status#22, cd_education_status#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), Or(Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,Advanced Degree )),And(EqualTo(cd_marital_status,S),EqualTo(cd_education_status,College ))),And(EqualTo(cd_marital_status,W),EqualTo(cd_education_status,2 yr Degree )))] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [3]: [cd_demo_sk#21, cd_marital_status#22, cd_education_status#23] + +(26) Filter [codegen id : 4] +Input [3]: [cd_demo_sk#21, cd_marital_status#22, cd_education_status#23] +Condition : (isnotnull(cd_demo_sk#21) AND ((((cd_marital_status#22 = M) AND (cd_education_status#23 = Advanced Degree )) OR ((cd_marital_status#22 = S) AND (cd_education_status#23 = College ))) OR ((cd_marital_status#22 = W) AND (cd_education_status#23 = 2 yr Degree )))) + +(27) BroadcastExchange +Input [3]: [cd_demo_sk#21, cd_marital_status#22, cd_education_status#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(28) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_cdemo_sk#1] +Right keys [1]: [cd_demo_sk#21] +Join condition: ((((((cd_marital_status#22 = M) AND (cd_education_status#23 = Advanced Degree )) AND (ss_sales_price#6 >= 100.00)) AND (ss_sales_price#6 <= 150.00)) OR ((((cd_marital_status#22 = S) AND (cd_education_status#23 = College )) AND (ss_sales_price#6 >= 50.00)) AND (ss_sales_price#6 <= 100.00))) OR ((((cd_marital_status#22 = W) AND (cd_education_status#23 = 2 yr Degree )) AND (ss_sales_price#6 >= 150.00)) AND (ss_sales_price#6 <= 200.00))) + +(29) Project [codegen id : 6] +Output [7]: [ss_hdemo_sk#2, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, cd_marital_status#22, cd_education_status#23] +Input [9]: [ss_cdemo_sk#1, ss_hdemo_sk#2, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, cd_demo_sk#21, cd_marital_status#22, cd_education_status#23] + +(30) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#25, hd_dep_count#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_demo_sk), Or(Or(EqualTo(hd_dep_count,3),EqualTo(hd_dep_count,1)),EqualTo(hd_dep_count,1))] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 5] +Input [2]: [hd_demo_sk#25, hd_dep_count#26] + +(32) Filter [codegen id : 5] +Input [2]: [hd_demo_sk#25, hd_dep_count#26] +Condition : (isnotnull(hd_demo_sk#25) AND (((hd_dep_count#26 = 3) OR (hd_dep_count#26 = 1)) OR (hd_dep_count#26 = 1))) + +(33) BroadcastExchange +Input [2]: [hd_demo_sk#25, hd_dep_count#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(34) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#25] +Join condition: (((((((cd_marital_status#22 = M) AND (cd_education_status#23 = Advanced Degree )) AND (ss_sales_price#6 >= 100.00)) AND (ss_sales_price#6 <= 150.00)) AND (hd_dep_count#26 = 3)) OR (((((cd_marital_status#22 = S) AND (cd_education_status#23 = College )) AND (ss_sales_price#6 >= 50.00)) AND (ss_sales_price#6 <= 100.00)) AND (hd_dep_count#26 = 1))) OR (((((cd_marital_status#22 = W) AND (cd_education_status#23 = 2 yr Degree )) AND (ss_sales_price#6 >= 150.00)) AND (ss_sales_price#6 <= 200.00)) AND (hd_dep_count#26 = 1))) + +(35) Project [codegen id : 6] +Output [3]: [ss_quantity#5, ss_ext_sales_price#7, ss_ext_wholesale_cost#8] +Input [9]: [ss_hdemo_sk#2, ss_quantity#5, ss_sales_price#6, ss_ext_sales_price#7, ss_ext_wholesale_cost#8, cd_marital_status#22, cd_education_status#23, hd_demo_sk#25, hd_dep_count#26] + +(36) HashAggregate [codegen id : 6] +Input [3]: [ss_quantity#5, ss_ext_sales_price#7, ss_ext_wholesale_cost#8] +Keys: [] +Functions [4]: [partial_avg(ss_quantity#5), partial_avg(UnscaledValue(ss_ext_sales_price#7)), partial_avg(UnscaledValue(ss_ext_wholesale_cost#8)), partial_sum(UnscaledValue(ss_ext_wholesale_cost#8))] +Aggregate Attributes [7]: [sum#28, count#29, sum#30, count#31, sum#32, count#33, sum#34] +Results [7]: [sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41] + +(37) Exchange +Input [7]: [sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#42] + +(38) HashAggregate [codegen id : 7] +Input [7]: [sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41] +Keys: [] +Functions [4]: [avg(ss_quantity#5), avg(UnscaledValue(ss_ext_sales_price#7)), avg(UnscaledValue(ss_ext_wholesale_cost#8)), sum(UnscaledValue(ss_ext_wholesale_cost#8))] +Aggregate Attributes [4]: [avg(ss_quantity#5)#43, avg(UnscaledValue(ss_ext_sales_price#7))#44, avg(UnscaledValue(ss_ext_wholesale_cost#8))#45, sum(UnscaledValue(ss_ext_wholesale_cost#8))#46] +Results [4]: [avg(ss_quantity#5)#43 AS avg(ss_quantity)#47, cast((avg(UnscaledValue(ss_ext_sales_price#7))#44 / 100.0) as decimal(11,6)) AS avg(ss_ext_sales_price)#48, cast((avg(UnscaledValue(ss_ext_wholesale_cost#8))#45 / 100.0) as decimal(11,6)) AS avg(ss_ext_wholesale_cost)#49, MakeDecimal(sum(UnscaledValue(ss_ext_wholesale_cost#8))#46,17,2) AS sum(ss_ext_wholesale_cost)#50] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#10 IN dynamicpruning#11 +ReusedExchange (39) + + +(39) ReusedExchange [Reuses operator id: 21] +Output [1]: [d_date_sk#18] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13/simplified.txt new file mode 100644 index 0000000000000..679cd0add2b33 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q13/simplified.txt @@ -0,0 +1,59 @@ +WholeStageCodegen (7) + HashAggregate [sum,count,sum,count,sum,count,sum] [avg(ss_quantity),avg(UnscaledValue(ss_ext_sales_price)),avg(UnscaledValue(ss_ext_wholesale_cost)),sum(UnscaledValue(ss_ext_wholesale_cost)),avg(ss_quantity),avg(ss_ext_sales_price),avg(ss_ext_wholesale_cost),sum(ss_ext_wholesale_cost),sum,count,sum,count,sum,count,sum] + InputAdapter + Exchange #1 + WholeStageCodegen (6) + HashAggregate [ss_quantity,ss_ext_sales_price,ss_ext_wholesale_cost] [sum,count,sum,count,sum,count,sum,sum,count,sum,count,sum,count,sum] + Project [ss_quantity,ss_ext_sales_price,ss_ext_wholesale_cost] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk,cd_marital_status,cd_education_status,ss_sales_price,hd_dep_count] + Project [ss_hdemo_sk,ss_quantity,ss_sales_price,ss_ext_sales_price,ss_ext_wholesale_cost,cd_marital_status,cd_education_status] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk,cd_marital_status,cd_education_status,ss_sales_price] + Project [ss_cdemo_sk,ss_hdemo_sk,ss_quantity,ss_sales_price,ss_ext_sales_price,ss_ext_wholesale_cost] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_cdemo_sk,ss_hdemo_sk,ss_quantity,ss_sales_price,ss_ext_sales_price,ss_ext_wholesale_cost,ss_sold_date_sk] + BroadcastHashJoin [ss_addr_sk,ca_address_sk,ca_state,ss_net_profit] + Project [ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_quantity,ss_sales_price,ss_ext_sales_price,ss_ext_wholesale_cost,ss_net_profit,ss_sold_date_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Filter [ss_store_sk,ss_addr_sk,ss_cdemo_sk,ss_hdemo_sk,ss_net_profit,ss_sales_price] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_ext_sales_price,ss_ext_wholesale_cost,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [ca_address_sk,ca_state] + Filter [ca_country,ca_address_sk,ca_state] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_country] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [cd_demo_sk,cd_marital_status,cd_education_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Filter [hd_demo_sk,hd_dep_count] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/explain.txt new file mode 100644 index 0000000000000..8828920519371 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/explain.txt @@ -0,0 +1,917 @@ +== Physical Plan == +TakeOrderedAndProject (134) ++- * HashAggregate (133) + +- Exchange (132) + +- * HashAggregate (131) + +- * Expand (130) + +- Union (129) + :- * Project (90) + : +- * Filter (89) + : +- * HashAggregate (88) + : +- Exchange (87) + : +- * HashAggregate (86) + : +- * Project (85) + : +- * BroadcastHashJoin Inner BuildRight (84) + : :- * Project (74) + : : +- * BroadcastHashJoin Inner BuildRight (73) + : : :- * SortMergeJoin LeftSemi (67) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Sort (66) + : : : +- Exchange (65) + : : : +- * Project (64) + : : : +- * BroadcastHashJoin Inner BuildRight (63) + : : : :- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.item (6) + : : : +- BroadcastExchange (62) + : : : +- * HashAggregate (61) + : : : +- Exchange (60) + : : : +- * HashAggregate (59) + : : : +- * SortMergeJoin LeftSemi (58) + : : : :- * Sort (46) + : : : : +- Exchange (45) + : : : : +- * HashAggregate (44) + : : : : +- Exchange (43) + : : : : +- * HashAggregate (42) + : : : : +- * Project (41) + : : : : +- * BroadcastHashJoin Inner BuildRight (40) + : : : : :- * Project (18) + : : : : : +- * BroadcastHashJoin Inner BuildRight (17) + : : : : : :- * Filter (11) + : : : : : : +- * ColumnarToRow (10) + : : : : : : +- Scan parquet default.store_sales (9) + : : : : : +- BroadcastExchange (16) + : : : : : +- * Project (15) + : : : : : +- * Filter (14) + : : : : : +- * ColumnarToRow (13) + : : : : : +- Scan parquet default.date_dim (12) + : : : : +- BroadcastExchange (39) + : : : : +- * SortMergeJoin LeftSemi (38) + : : : : :- * Sort (23) + : : : : : +- Exchange (22) + : : : : : +- * Filter (21) + : : : : : +- * ColumnarToRow (20) + : : : : : +- Scan parquet default.item (19) + : : : : +- * Sort (37) + : : : : +- Exchange (36) + : : : : +- * Project (35) + : : : : +- * BroadcastHashJoin Inner BuildRight (34) + : : : : :- * Project (29) + : : : : : +- * BroadcastHashJoin Inner BuildRight (28) + : : : : : :- * Filter (26) + : : : : : : +- * ColumnarToRow (25) + : : : : : : +- Scan parquet default.catalog_sales (24) + : : : : : +- ReusedExchange (27) + : : : : +- BroadcastExchange (33) + : : : : +- * Filter (32) + : : : : +- * ColumnarToRow (31) + : : : : +- Scan parquet default.item (30) + : : : +- * Sort (57) + : : : +- Exchange (56) + : : : +- * Project (55) + : : : +- * BroadcastHashJoin Inner BuildRight (54) + : : : :- * Project (52) + : : : : +- * BroadcastHashJoin Inner BuildRight (51) + : : : : :- * Filter (49) + : : : : : +- * ColumnarToRow (48) + : : : : : +- Scan parquet default.web_sales (47) + : : : : +- ReusedExchange (50) + : : : +- ReusedExchange (53) + : : +- BroadcastExchange (72) + : : +- * Project (71) + : : +- * Filter (70) + : : +- * ColumnarToRow (69) + : : +- Scan parquet default.date_dim (68) + : +- BroadcastExchange (83) + : +- * SortMergeJoin LeftSemi (82) + : :- * Sort (79) + : : +- Exchange (78) + : : +- * Filter (77) + : : +- * ColumnarToRow (76) + : : +- Scan parquet default.item (75) + : +- * Sort (81) + : +- ReusedExchange (80) + :- * Project (109) + : +- * Filter (108) + : +- * HashAggregate (107) + : +- Exchange (106) + : +- * HashAggregate (105) + : +- * Project (104) + : +- * BroadcastHashJoin Inner BuildRight (103) + : :- * Project (101) + : : +- * BroadcastHashJoin Inner BuildRight (100) + : : :- * SortMergeJoin LeftSemi (98) + : : : :- * Sort (95) + : : : : +- Exchange (94) + : : : : +- * Filter (93) + : : : : +- * ColumnarToRow (92) + : : : : +- Scan parquet default.catalog_sales (91) + : : : +- * Sort (97) + : : : +- ReusedExchange (96) + : : +- ReusedExchange (99) + : +- ReusedExchange (102) + +- * Project (128) + +- * Filter (127) + +- * HashAggregate (126) + +- Exchange (125) + +- * HashAggregate (124) + +- * Project (123) + +- * BroadcastHashJoin Inner BuildRight (122) + :- * Project (120) + : +- * BroadcastHashJoin Inner BuildRight (119) + : :- * SortMergeJoin LeftSemi (117) + : : :- * Sort (114) + : : : +- Exchange (113) + : : : +- * Filter (112) + : : : +- * ColumnarToRow (111) + : : : +- Scan parquet default.web_sales (110) + : : +- * Sort (116) + : : +- ReusedExchange (115) + : +- ReusedExchange (118) + +- ReusedExchange (121) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 1] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_item_sk#1) + +(4) Exchange +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#6] + +(5) Sort [codegen id : 2] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.item +Output [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 20] +Input [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10] + +(8) Filter [codegen id : 20] +Input [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10] +Condition : ((isnotnull(i_brand_id#8) AND isnotnull(i_class_id#9)) AND isnotnull(i_category_id#10)) + +(9) Scan parquet default.store_sales +Output [2]: [ss_item_sk#11, ss_sold_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#12), dynamicpruningexpression(ss_sold_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(10) ColumnarToRow [codegen id : 11] +Input [2]: [ss_item_sk#11, ss_sold_date_sk#12] + +(11) Filter [codegen id : 11] +Input [2]: [ss_item_sk#11, ss_sold_date_sk#12] +Condition : isnotnull(ss_item_sk#11) + +(12) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#14, d_year#15] + +(14) Filter [codegen id : 3] +Input [2]: [d_date_sk#14, d_year#15] +Condition : (((isnotnull(d_year#15) AND (d_year#15 >= 1999)) AND (d_year#15 <= 2001)) AND isnotnull(d_date_sk#14)) + +(15) Project [codegen id : 3] +Output [1]: [d_date_sk#14] +Input [2]: [d_date_sk#14, d_year#15] + +(16) BroadcastExchange +Input [1]: [d_date_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(17) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_sold_date_sk#12] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(18) Project [codegen id : 11] +Output [1]: [ss_item_sk#11] +Input [3]: [ss_item_sk#11, ss_sold_date_sk#12, d_date_sk#14] + +(19) Scan parquet default.item +Output [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 4] +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] + +(21) Filter [codegen id : 4] +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Condition : (((isnotnull(i_item_sk#17) AND isnotnull(i_brand_id#18)) AND isnotnull(i_class_id#19)) AND isnotnull(i_category_id#20)) + +(22) Exchange +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Arguments: hashpartitioning(coalesce(i_brand_id#18, 0), isnull(i_brand_id#18), coalesce(i_class_id#19, 0), isnull(i_class_id#19), coalesce(i_category_id#20, 0), isnull(i_category_id#20), 5), ENSURE_REQUIREMENTS, [id=#21] + +(23) Sort [codegen id : 5] +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Arguments: [coalesce(i_brand_id#18, 0) ASC NULLS FIRST, isnull(i_brand_id#18) ASC NULLS FIRST, coalesce(i_class_id#19, 0) ASC NULLS FIRST, isnull(i_class_id#19) ASC NULLS FIRST, coalesce(i_category_id#20, 0) ASC NULLS FIRST, isnull(i_category_id#20) ASC NULLS FIRST], false, 0 + +(24) Scan parquet default.catalog_sales +Output [2]: [cs_item_sk#22, cs_sold_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#23), dynamicpruningexpression(cs_sold_date_sk#23 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 8] +Input [2]: [cs_item_sk#22, cs_sold_date_sk#23] + +(26) Filter [codegen id : 8] +Input [2]: [cs_item_sk#22, cs_sold_date_sk#23] +Condition : isnotnull(cs_item_sk#22) + +(27) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#24] + +(28) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_sold_date_sk#23] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(29) Project [codegen id : 8] +Output [1]: [cs_item_sk#22] +Input [3]: [cs_item_sk#22, cs_sold_date_sk#23, d_date_sk#24] + +(30) Scan parquet default.item +Output [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 7] +Input [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] + +(32) Filter [codegen id : 7] +Input [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] +Condition : isnotnull(i_item_sk#25) + +(33) BroadcastExchange +Input [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(34) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_item_sk#22] +Right keys [1]: [i_item_sk#25] +Join condition: None + +(35) Project [codegen id : 8] +Output [3]: [i_brand_id#26, i_class_id#27, i_category_id#28] +Input [5]: [cs_item_sk#22, i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] + +(36) Exchange +Input [3]: [i_brand_id#26, i_class_id#27, i_category_id#28] +Arguments: hashpartitioning(coalesce(i_brand_id#26, 0), isnull(i_brand_id#26), coalesce(i_class_id#27, 0), isnull(i_class_id#27), coalesce(i_category_id#28, 0), isnull(i_category_id#28), 5), ENSURE_REQUIREMENTS, [id=#30] + +(37) Sort [codegen id : 9] +Input [3]: [i_brand_id#26, i_class_id#27, i_category_id#28] +Arguments: [coalesce(i_brand_id#26, 0) ASC NULLS FIRST, isnull(i_brand_id#26) ASC NULLS FIRST, coalesce(i_class_id#27, 0) ASC NULLS FIRST, isnull(i_class_id#27) ASC NULLS FIRST, coalesce(i_category_id#28, 0) ASC NULLS FIRST, isnull(i_category_id#28) ASC NULLS FIRST], false, 0 + +(38) SortMergeJoin [codegen id : 10] +Left keys [6]: [coalesce(i_brand_id#18, 0), isnull(i_brand_id#18), coalesce(i_class_id#19, 0), isnull(i_class_id#19), coalesce(i_category_id#20, 0), isnull(i_category_id#20)] +Right keys [6]: [coalesce(i_brand_id#26, 0), isnull(i_brand_id#26), coalesce(i_class_id#27, 0), isnull(i_class_id#27), coalesce(i_category_id#28, 0), isnull(i_category_id#28)] +Join condition: None + +(39) BroadcastExchange +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_item_sk#11] +Right keys [1]: [i_item_sk#17] +Join condition: None + +(41) Project [codegen id : 11] +Output [3]: [i_brand_id#18 AS brand_id#32, i_class_id#19 AS class_id#33, i_category_id#20 AS category_id#34] +Input [5]: [ss_item_sk#11, i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] + +(42) HashAggregate [codegen id : 11] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(43) Exchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: hashpartitioning(brand_id#32, class_id#33, category_id#34, 5), ENSURE_REQUIREMENTS, [id=#35] + +(44) HashAggregate [codegen id : 12] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(45) Exchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: hashpartitioning(coalesce(brand_id#32, 0), isnull(brand_id#32), coalesce(class_id#33, 0), isnull(class_id#33), coalesce(category_id#34, 0), isnull(category_id#34), 5), ENSURE_REQUIREMENTS, [id=#36] + +(46) Sort [codegen id : 13] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: [coalesce(brand_id#32, 0) ASC NULLS FIRST, isnull(brand_id#32) ASC NULLS FIRST, coalesce(class_id#33, 0) ASC NULLS FIRST, isnull(class_id#33) ASC NULLS FIRST, coalesce(category_id#34, 0) ASC NULLS FIRST, isnull(category_id#34) ASC NULLS FIRST], false, 0 + +(47) Scan parquet default.web_sales +Output [2]: [ws_item_sk#37, ws_sold_date_sk#38] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#38), dynamicpruningexpression(ws_sold_date_sk#38 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 16] +Input [2]: [ws_item_sk#37, ws_sold_date_sk#38] + +(49) Filter [codegen id : 16] +Input [2]: [ws_item_sk#37, ws_sold_date_sk#38] +Condition : isnotnull(ws_item_sk#37) + +(50) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#39] + +(51) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [ws_sold_date_sk#38] +Right keys [1]: [d_date_sk#39] +Join condition: None + +(52) Project [codegen id : 16] +Output [1]: [ws_item_sk#37] +Input [3]: [ws_item_sk#37, ws_sold_date_sk#38, d_date_sk#39] + +(53) ReusedExchange [Reuses operator id: 33] +Output [4]: [i_item_sk#40, i_brand_id#41, i_class_id#42, i_category_id#43] + +(54) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [ws_item_sk#37] +Right keys [1]: [i_item_sk#40] +Join condition: None + +(55) Project [codegen id : 16] +Output [3]: [i_brand_id#41, i_class_id#42, i_category_id#43] +Input [5]: [ws_item_sk#37, i_item_sk#40, i_brand_id#41, i_class_id#42, i_category_id#43] + +(56) Exchange +Input [3]: [i_brand_id#41, i_class_id#42, i_category_id#43] +Arguments: hashpartitioning(coalesce(i_brand_id#41, 0), isnull(i_brand_id#41), coalesce(i_class_id#42, 0), isnull(i_class_id#42), coalesce(i_category_id#43, 0), isnull(i_category_id#43), 5), ENSURE_REQUIREMENTS, [id=#44] + +(57) Sort [codegen id : 17] +Input [3]: [i_brand_id#41, i_class_id#42, i_category_id#43] +Arguments: [coalesce(i_brand_id#41, 0) ASC NULLS FIRST, isnull(i_brand_id#41) ASC NULLS FIRST, coalesce(i_class_id#42, 0) ASC NULLS FIRST, isnull(i_class_id#42) ASC NULLS FIRST, coalesce(i_category_id#43, 0) ASC NULLS FIRST, isnull(i_category_id#43) ASC NULLS FIRST], false, 0 + +(58) SortMergeJoin [codegen id : 18] +Left keys [6]: [coalesce(brand_id#32, 0), isnull(brand_id#32), coalesce(class_id#33, 0), isnull(class_id#33), coalesce(category_id#34, 0), isnull(category_id#34)] +Right keys [6]: [coalesce(i_brand_id#41, 0), isnull(i_brand_id#41), coalesce(i_class_id#42, 0), isnull(i_class_id#42), coalesce(i_category_id#43, 0), isnull(i_category_id#43)] +Join condition: None + +(59) HashAggregate [codegen id : 18] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(60) Exchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: hashpartitioning(brand_id#32, class_id#33, category_id#34, 5), ENSURE_REQUIREMENTS, [id=#45] + +(61) HashAggregate [codegen id : 19] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(62) BroadcastExchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#46] + +(63) BroadcastHashJoin [codegen id : 20] +Left keys [3]: [i_brand_id#8, i_class_id#9, i_category_id#10] +Right keys [3]: [brand_id#32, class_id#33, category_id#34] +Join condition: None + +(64) Project [codegen id : 20] +Output [1]: [i_item_sk#7 AS ss_item_sk#47] +Input [7]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, brand_id#32, class_id#33, category_id#34] + +(65) Exchange +Input [1]: [ss_item_sk#47] +Arguments: hashpartitioning(ss_item_sk#47, 5), ENSURE_REQUIREMENTS, [id=#48] + +(66) Sort [codegen id : 21] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(67) SortMergeJoin [codegen id : 45] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(68) Scan parquet default.date_dim +Output [3]: [d_date_sk#49, d_year#50, d_moy#51] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct + +(69) ColumnarToRow [codegen id : 22] +Input [3]: [d_date_sk#49, d_year#50, d_moy#51] + +(70) Filter [codegen id : 22] +Input [3]: [d_date_sk#49, d_year#50, d_moy#51] +Condition : ((((isnotnull(d_year#50) AND isnotnull(d_moy#51)) AND (d_year#50 = 2001)) AND (d_moy#51 = 11)) AND isnotnull(d_date_sk#49)) + +(71) Project [codegen id : 22] +Output [1]: [d_date_sk#49] +Input [3]: [d_date_sk#49, d_year#50, d_moy#51] + +(72) BroadcastExchange +Input [1]: [d_date_sk#49] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#52] + +(73) BroadcastHashJoin [codegen id : 45] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#49] +Join condition: None + +(74) Project [codegen id : 45] +Output [3]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3] +Input [5]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, d_date_sk#49] + +(75) Scan parquet default.item +Output [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 23] +Input [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] + +(77) Filter [codegen id : 23] +Input [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] +Condition : isnotnull(i_item_sk#53) + +(78) Exchange +Input [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] +Arguments: hashpartitioning(i_item_sk#53, 5), ENSURE_REQUIREMENTS, [id=#57] + +(79) Sort [codegen id : 24] +Input [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] +Arguments: [i_item_sk#53 ASC NULLS FIRST], false, 0 + +(80) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#47] + +(81) Sort [codegen id : 43] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(82) SortMergeJoin [codegen id : 44] +Left keys [1]: [i_item_sk#53] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(83) BroadcastExchange +Input [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#58] + +(84) BroadcastHashJoin [codegen id : 45] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#53] +Join condition: None + +(85) Project [codegen id : 45] +Output [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#54, i_class_id#55, i_category_id#56] +Input [7]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] + +(86) HashAggregate [codegen id : 45] +Input [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#54, i_class_id#55, i_category_id#56] +Keys [3]: [i_brand_id#54, i_class_id#55, i_category_id#56] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#59, isEmpty#60, count#61] +Results [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum#62, isEmpty#63, count#64] + +(87) Exchange +Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum#62, isEmpty#63, count#64] +Arguments: hashpartitioning(i_brand_id#54, i_class_id#55, i_category_id#56, 5), ENSURE_REQUIREMENTS, [id=#65] + +(88) HashAggregate [codegen id : 46] +Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum#62, isEmpty#63, count#64] +Keys [3]: [i_brand_id#54, i_class_id#55, i_category_id#56] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66, count(1)#67] +Results [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66 AS sales#68, count(1)#67 AS number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#70] + +(89) Filter [codegen id : 46] +Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sales#68, number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#70] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#70) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#70 as decimal(32,6)) > cast(Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(90) Project [codegen id : 46] +Output [6]: [sales#68, number_sales#69, store AS channel#73, i_brand_id#54, i_class_id#55, i_category_id#56] +Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sales#68, number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#70] + +(91) Scan parquet default.catalog_sales +Output [4]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, cs_sold_date_sk#77] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#77), dynamicpruningexpression(cs_sold_date_sk#77 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(92) ColumnarToRow [codegen id : 47] +Input [4]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, cs_sold_date_sk#77] + +(93) Filter [codegen id : 47] +Input [4]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, cs_sold_date_sk#77] +Condition : isnotnull(cs_item_sk#74) + +(94) Exchange +Input [4]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, cs_sold_date_sk#77] +Arguments: hashpartitioning(cs_item_sk#74, 5), ENSURE_REQUIREMENTS, [id=#78] + +(95) Sort [codegen id : 48] +Input [4]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, cs_sold_date_sk#77] +Arguments: [cs_item_sk#74 ASC NULLS FIRST], false, 0 + +(96) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#47] + +(97) Sort [codegen id : 67] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(98) SortMergeJoin [codegen id : 91] +Left keys [1]: [cs_item_sk#74] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(99) ReusedExchange [Reuses operator id: 72] +Output [1]: [d_date_sk#79] + +(100) BroadcastHashJoin [codegen id : 91] +Left keys [1]: [cs_sold_date_sk#77] +Right keys [1]: [d_date_sk#79] +Join condition: None + +(101) Project [codegen id : 91] +Output [3]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76] +Input [5]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, cs_sold_date_sk#77, d_date_sk#79] + +(102) ReusedExchange [Reuses operator id: 83] +Output [4]: [i_item_sk#80, i_brand_id#81, i_class_id#82, i_category_id#83] + +(103) BroadcastHashJoin [codegen id : 91] +Left keys [1]: [cs_item_sk#74] +Right keys [1]: [i_item_sk#80] +Join condition: None + +(104) Project [codegen id : 91] +Output [5]: [cs_quantity#75, cs_list_price#76, i_brand_id#81, i_class_id#82, i_category_id#83] +Input [7]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, i_item_sk#80, i_brand_id#81, i_class_id#82, i_category_id#83] + +(105) HashAggregate [codegen id : 91] +Input [5]: [cs_quantity#75, cs_list_price#76, i_brand_id#81, i_class_id#82, i_category_id#83] +Keys [3]: [i_brand_id#81, i_class_id#82, i_category_id#83] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#84, isEmpty#85, count#86] +Results [6]: [i_brand_id#81, i_class_id#82, i_category_id#83, sum#87, isEmpty#88, count#89] + +(106) Exchange +Input [6]: [i_brand_id#81, i_class_id#82, i_category_id#83, sum#87, isEmpty#88, count#89] +Arguments: hashpartitioning(i_brand_id#81, i_class_id#82, i_category_id#83, 5), ENSURE_REQUIREMENTS, [id=#90] + +(107) HashAggregate [codegen id : 92] +Input [6]: [i_brand_id#81, i_class_id#82, i_category_id#83, sum#87, isEmpty#88, count#89] +Keys [3]: [i_brand_id#81, i_class_id#82, i_category_id#83] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#91, count(1)#92] +Results [6]: [i_brand_id#81, i_class_id#82, i_category_id#83, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#91 AS sales#93, count(1)#92 AS number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#91 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#95] + +(108) Filter [codegen id : 92] +Input [6]: [i_brand_id#81, i_class_id#82, i_category_id#83, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#95] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#95) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#95 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(109) Project [codegen id : 92] +Output [6]: [sales#93, number_sales#94, catalog AS channel#96, i_brand_id#81, i_class_id#82, i_category_id#83] +Input [6]: [i_brand_id#81, i_class_id#82, i_category_id#83, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#95] + +(110) Scan parquet default.web_sales +Output [4]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, ws_sold_date_sk#100] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#100), dynamicpruningexpression(ws_sold_date_sk#100 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(111) ColumnarToRow [codegen id : 93] +Input [4]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, ws_sold_date_sk#100] + +(112) Filter [codegen id : 93] +Input [4]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, ws_sold_date_sk#100] +Condition : isnotnull(ws_item_sk#97) + +(113) Exchange +Input [4]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, ws_sold_date_sk#100] +Arguments: hashpartitioning(ws_item_sk#97, 5), ENSURE_REQUIREMENTS, [id=#101] + +(114) Sort [codegen id : 94] +Input [4]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, ws_sold_date_sk#100] +Arguments: [ws_item_sk#97 ASC NULLS FIRST], false, 0 + +(115) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#47] + +(116) Sort [codegen id : 113] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(117) SortMergeJoin [codegen id : 137] +Left keys [1]: [ws_item_sk#97] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(118) ReusedExchange [Reuses operator id: 72] +Output [1]: [d_date_sk#102] + +(119) BroadcastHashJoin [codegen id : 137] +Left keys [1]: [ws_sold_date_sk#100] +Right keys [1]: [d_date_sk#102] +Join condition: None + +(120) Project [codegen id : 137] +Output [3]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99] +Input [5]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, ws_sold_date_sk#100, d_date_sk#102] + +(121) ReusedExchange [Reuses operator id: 83] +Output [4]: [i_item_sk#103, i_brand_id#104, i_class_id#105, i_category_id#106] + +(122) BroadcastHashJoin [codegen id : 137] +Left keys [1]: [ws_item_sk#97] +Right keys [1]: [i_item_sk#103] +Join condition: None + +(123) Project [codegen id : 137] +Output [5]: [ws_quantity#98, ws_list_price#99, i_brand_id#104, i_class_id#105, i_category_id#106] +Input [7]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, i_item_sk#103, i_brand_id#104, i_class_id#105, i_category_id#106] + +(124) HashAggregate [codegen id : 137] +Input [5]: [ws_quantity#98, ws_list_price#99, i_brand_id#104, i_class_id#105, i_category_id#106] +Keys [3]: [i_brand_id#104, i_class_id#105, i_category_id#106] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#107, isEmpty#108, count#109] +Results [6]: [i_brand_id#104, i_class_id#105, i_category_id#106, sum#110, isEmpty#111, count#112] + +(125) Exchange +Input [6]: [i_brand_id#104, i_class_id#105, i_category_id#106, sum#110, isEmpty#111, count#112] +Arguments: hashpartitioning(i_brand_id#104, i_class_id#105, i_category_id#106, 5), ENSURE_REQUIREMENTS, [id=#113] + +(126) HashAggregate [codegen id : 138] +Input [6]: [i_brand_id#104, i_class_id#105, i_category_id#106, sum#110, isEmpty#111, count#112] +Keys [3]: [i_brand_id#104, i_class_id#105, i_category_id#106] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#114, count(1)#115] +Results [6]: [i_brand_id#104, i_class_id#105, i_category_id#106, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#114 AS sales#116, count(1)#115 AS number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#114 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#118] + +(127) Filter [codegen id : 138] +Input [6]: [i_brand_id#104, i_class_id#105, i_category_id#106, sales#116, number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#118] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#118) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#118 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(128) Project [codegen id : 138] +Output [6]: [sales#116, number_sales#117, web AS channel#119, i_brand_id#104, i_class_id#105, i_category_id#106] +Input [6]: [i_brand_id#104, i_class_id#105, i_category_id#106, sales#116, number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#118] + +(129) Union + +(130) Expand [codegen id : 139] +Input [6]: [sales#68, number_sales#69, channel#73, i_brand_id#54, i_class_id#55, i_category_id#56] +Arguments: [ArrayBuffer(sales#68, number_sales#69, channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, 0), ArrayBuffer(sales#68, number_sales#69, channel#73, i_brand_id#54, i_class_id#55, null, 1), ArrayBuffer(sales#68, number_sales#69, channel#73, i_brand_id#54, null, null, 3), ArrayBuffer(sales#68, number_sales#69, channel#73, null, null, null, 7), ArrayBuffer(sales#68, number_sales#69, null, null, null, null, 15)], [sales#68, number_sales#69, channel#120, i_brand_id#121, i_class_id#122, i_category_id#123, spark_grouping_id#124] + +(131) HashAggregate [codegen id : 139] +Input [7]: [sales#68, number_sales#69, channel#120, i_brand_id#121, i_class_id#122, i_category_id#123, spark_grouping_id#124] +Keys [5]: [channel#120, i_brand_id#121, i_class_id#122, i_category_id#123, spark_grouping_id#124] +Functions [2]: [partial_sum(sales#68), partial_sum(number_sales#69)] +Aggregate Attributes [3]: [sum#125, isEmpty#126, sum#127] +Results [8]: [channel#120, i_brand_id#121, i_class_id#122, i_category_id#123, spark_grouping_id#124, sum#128, isEmpty#129, sum#130] + +(132) Exchange +Input [8]: [channel#120, i_brand_id#121, i_class_id#122, i_category_id#123, spark_grouping_id#124, sum#128, isEmpty#129, sum#130] +Arguments: hashpartitioning(channel#120, i_brand_id#121, i_class_id#122, i_category_id#123, spark_grouping_id#124, 5), ENSURE_REQUIREMENTS, [id=#131] + +(133) HashAggregate [codegen id : 140] +Input [8]: [channel#120, i_brand_id#121, i_class_id#122, i_category_id#123, spark_grouping_id#124, sum#128, isEmpty#129, sum#130] +Keys [5]: [channel#120, i_brand_id#121, i_class_id#122, i_category_id#123, spark_grouping_id#124] +Functions [2]: [sum(sales#68), sum(number_sales#69)] +Aggregate Attributes [2]: [sum(sales#68)#132, sum(number_sales#69)#133] +Results [6]: [channel#120, i_brand_id#121, i_class_id#122, i_category_id#123, sum(sales#68)#132 AS sum(sales)#134, sum(number_sales#69)#133 AS sum(number_sales)#135] + +(134) TakeOrderedAndProject +Input [6]: [channel#120, i_brand_id#121, i_class_id#122, i_category_id#123, sum(sales)#134, sum(number_sales)#135] +Arguments: 100, [channel#120 ASC NULLS FIRST, i_brand_id#121 ASC NULLS FIRST, i_class_id#122 ASC NULLS FIRST, i_category_id#123 ASC NULLS FIRST], [channel#120, i_brand_id#121, i_class_id#122, i_category_id#123, sum(sales)#134, sum(number_sales)#135] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 89 Hosting Expression = Subquery scalar-subquery#71, [id=#72] +* HashAggregate (157) ++- Exchange (156) + +- * HashAggregate (155) + +- Union (154) + :- * Project (143) + : +- * BroadcastHashJoin Inner BuildRight (142) + : :- * ColumnarToRow (136) + : : +- Scan parquet default.store_sales (135) + : +- BroadcastExchange (141) + : +- * Project (140) + : +- * Filter (139) + : +- * ColumnarToRow (138) + : +- Scan parquet default.date_dim (137) + :- * Project (148) + : +- * BroadcastHashJoin Inner BuildRight (147) + : :- * ColumnarToRow (145) + : : +- Scan parquet default.catalog_sales (144) + : +- ReusedExchange (146) + +- * Project (153) + +- * BroadcastHashJoin Inner BuildRight (152) + :- * ColumnarToRow (150) + : +- Scan parquet default.web_sales (149) + +- ReusedExchange (151) + + +(135) Scan parquet default.store_sales +Output [3]: [ss_quantity#136, ss_list_price#137, ss_sold_date_sk#138] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#138), dynamicpruningexpression(ss_sold_date_sk#138 IN dynamicpruning#139)] +ReadSchema: struct + +(136) ColumnarToRow [codegen id : 2] +Input [3]: [ss_quantity#136, ss_list_price#137, ss_sold_date_sk#138] + +(137) Scan parquet default.date_dim +Output [2]: [d_date_sk#140, d_year#141] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(138) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#140, d_year#141] + +(139) Filter [codegen id : 1] +Input [2]: [d_date_sk#140, d_year#141] +Condition : (((isnotnull(d_year#141) AND (d_year#141 >= 1999)) AND (d_year#141 <= 2001)) AND isnotnull(d_date_sk#140)) + +(140) Project [codegen id : 1] +Output [1]: [d_date_sk#140] +Input [2]: [d_date_sk#140, d_year#141] + +(141) BroadcastExchange +Input [1]: [d_date_sk#140] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#142] + +(142) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#138] +Right keys [1]: [d_date_sk#140] +Join condition: None + +(143) Project [codegen id : 2] +Output [2]: [ss_quantity#136 AS quantity#143, ss_list_price#137 AS list_price#144] +Input [4]: [ss_quantity#136, ss_list_price#137, ss_sold_date_sk#138, d_date_sk#140] + +(144) Scan parquet default.catalog_sales +Output [3]: [cs_quantity#145, cs_list_price#146, cs_sold_date_sk#147] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#147), dynamicpruningexpression(cs_sold_date_sk#147 IN dynamicpruning#139)] +ReadSchema: struct + +(145) ColumnarToRow [codegen id : 4] +Input [3]: [cs_quantity#145, cs_list_price#146, cs_sold_date_sk#147] + +(146) ReusedExchange [Reuses operator id: 141] +Output [1]: [d_date_sk#148] + +(147) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#147] +Right keys [1]: [d_date_sk#148] +Join condition: None + +(148) Project [codegen id : 4] +Output [2]: [cs_quantity#145 AS quantity#149, cs_list_price#146 AS list_price#150] +Input [4]: [cs_quantity#145, cs_list_price#146, cs_sold_date_sk#147, d_date_sk#148] + +(149) Scan parquet default.web_sales +Output [3]: [ws_quantity#151, ws_list_price#152, ws_sold_date_sk#153] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#153), dynamicpruningexpression(ws_sold_date_sk#153 IN dynamicpruning#139)] +ReadSchema: struct + +(150) ColumnarToRow [codegen id : 6] +Input [3]: [ws_quantity#151, ws_list_price#152, ws_sold_date_sk#153] + +(151) ReusedExchange [Reuses operator id: 141] +Output [1]: [d_date_sk#154] + +(152) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#153] +Right keys [1]: [d_date_sk#154] +Join condition: None + +(153) Project [codegen id : 6] +Output [2]: [ws_quantity#151 AS quantity#155, ws_list_price#152 AS list_price#156] +Input [4]: [ws_quantity#151, ws_list_price#152, ws_sold_date_sk#153, d_date_sk#154] + +(154) Union + +(155) HashAggregate [codegen id : 7] +Input [2]: [quantity#143, list_price#144] +Keys: [] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#143 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#144 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#157, count#158] +Results [2]: [sum#159, count#160] + +(156) Exchange +Input [2]: [sum#159, count#160] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#161] + +(157) HashAggregate [codegen id : 8] +Input [2]: [sum#159, count#160] +Keys: [] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#143 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#144 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#143 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#144 as decimal(12,2)))), DecimalType(18,2), true))#162] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#143 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#144 as decimal(12,2)))), DecimalType(18,2), true))#162 AS average_sales#163] + +Subquery:2 Hosting operator id = 135 Hosting Expression = ss_sold_date_sk#138 IN dynamicpruning#139 +ReusedExchange (158) + + +(158) ReusedExchange [Reuses operator id: 141] +Output [1]: [d_date_sk#140] + +Subquery:3 Hosting operator id = 144 Hosting Expression = cs_sold_date_sk#147 IN dynamicpruning#139 + +Subquery:4 Hosting operator id = 149 Hosting Expression = ws_sold_date_sk#153 IN dynamicpruning#139 + +Subquery:5 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (159) + + +(159) ReusedExchange [Reuses operator id: 72] +Output [1]: [d_date_sk#49] + +Subquery:6 Hosting operator id = 9 Hosting Expression = ss_sold_date_sk#12 IN dynamicpruning#13 +ReusedExchange (160) + + +(160) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#14] + +Subquery:7 Hosting operator id = 24 Hosting Expression = cs_sold_date_sk#23 IN dynamicpruning#13 + +Subquery:8 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#38 IN dynamicpruning#13 + +Subquery:9 Hosting operator id = 108 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:10 Hosting operator id = 91 Hosting Expression = cs_sold_date_sk#77 IN dynamicpruning#5 + +Subquery:11 Hosting operator id = 127 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:12 Hosting operator id = 110 Hosting Expression = ws_sold_date_sk#100 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/simplified.txt new file mode 100644 index 0000000000000..bf3b205bb8c58 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a.sf100/simplified.txt @@ -0,0 +1,280 @@ +TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),sum(number_sales)] + WholeStageCodegen (140) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum(sales),sum(number_sales),sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id] #1 + WholeStageCodegen (139) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + Expand [sales,number_sales,channel,i_brand_id,i_class_id,i_category_id] + InputAdapter + Union + WholeStageCodegen (46) + Project [sales,number_sales,i_brand_id,i_class_id,i_category_id] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + Subquery #3 + WholeStageCodegen (8) + HashAggregate [sum,count] [avg(CheckOverflow((promote_precision(cast(cast(quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price as decimal(12,2)))), DecimalType(18,2), true)),average_sales,sum,count] + InputAdapter + Exchange #19 + WholeStageCodegen (7) + HashAggregate [quantity,list_price] [sum,count,sum,count] + InputAdapter + Union + WholeStageCodegen (2) + Project [ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #4 + ReusedExchange [d_date_sk] #20 + InputAdapter + BroadcastExchange #20 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + WholeStageCodegen (4) + Project [cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_quantity,cs_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #4 + InputAdapter + ReusedExchange [d_date_sk] #20 + WholeStageCodegen (6) + Project [ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #4 + InputAdapter + ReusedExchange [d_date_sk] #20 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #2 + WholeStageCodegen (45) + HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + SortMergeJoin [ss_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #3 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + WholeStageCodegen (21) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #5 + WholeStageCodegen (20) + Project [i_item_sk] + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id] + Filter [i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (19) + HashAggregate [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #7 + WholeStageCodegen (18) + HashAggregate [brand_id,class_id,category_id] + SortMergeJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (13) + Sort [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #8 + WholeStageCodegen (12) + HashAggregate [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #9 + WholeStageCodegen (11) + HashAggregate [brand_id,class_id,category_id] + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #10 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (10) + SortMergeJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (5) + Sort [i_brand_id,i_class_id,i_category_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #12 + WholeStageCodegen (4) + Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (9) + Sort [i_brand_id,i_class_id,i_category_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #13 + WholeStageCodegen (8) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk] #10 + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (7) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (17) + Sort [i_brand_id,i_class_id,i_category_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #15 + WholeStageCodegen (16) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk] #10 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #14 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (22) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (44) + SortMergeJoin [i_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (24) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #17 + WholeStageCodegen (23) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (43) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk] #18 + WholeStageCodegen (92) + Project [sales,number_sales,i_brand_id,i_class_id,i_category_id] + Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #21 + WholeStageCodegen (91) + HashAggregate [i_brand_id,i_class_id,i_category_id,cs_quantity,cs_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [cs_quantity,cs_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + SortMergeJoin [cs_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (48) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #22 + WholeStageCodegen (47) + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (67) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk] #18 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #16 + WholeStageCodegen (138) + Project [sales,number_sales,i_brand_id,i_class_id,i_category_id] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #23 + WholeStageCodegen (137) + HashAggregate [i_brand_id,i_class_id,i_category_id,ws_quantity,ws_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ws_quantity,ws_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + SortMergeJoin [ws_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (94) + Sort [ws_item_sk] + InputAdapter + Exchange [ws_item_sk] #24 + WholeStageCodegen (93) + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (113) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk] #18 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #16 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt new file mode 100644 index 0000000000000..ffcbef4ce1602 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/explain.txt @@ -0,0 +1,822 @@ +== Physical Plan == +TakeOrderedAndProject (115) ++- * HashAggregate (114) + +- Exchange (113) + +- * HashAggregate (112) + +- * Expand (111) + +- Union (110) + :- * Project (77) + : +- * Filter (76) + : +- * HashAggregate (75) + : +- Exchange (74) + : +- * HashAggregate (73) + : +- * Project (72) + : +- * BroadcastHashJoin Inner BuildRight (71) + : :- * Project (65) + : : +- * BroadcastHashJoin Inner BuildRight (64) + : : :- * BroadcastHashJoin LeftSemi BuildRight (57) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (56) + : : : +- * Project (55) + : : : +- * BroadcastHashJoin Inner BuildRight (54) + : : : :- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.item (4) + : : : +- BroadcastExchange (53) + : : : +- * HashAggregate (52) + : : : +- * HashAggregate (51) + : : : +- * BroadcastHashJoin LeftSemi BuildRight (50) + : : : :- * HashAggregate (39) + : : : : +- Exchange (38) + : : : : +- * HashAggregate (37) + : : : : +- * Project (36) + : : : : +- * BroadcastHashJoin Inner BuildRight (35) + : : : : :- * Project (33) + : : : : : +- * BroadcastHashJoin Inner BuildRight (32) + : : : : : :- * Filter (9) + : : : : : : +- * ColumnarToRow (8) + : : : : : : +- Scan parquet default.store_sales (7) + : : : : : +- BroadcastExchange (31) + : : : : : +- * BroadcastHashJoin LeftSemi BuildRight (30) + : : : : : :- * Filter (12) + : : : : : : +- * ColumnarToRow (11) + : : : : : : +- Scan parquet default.item (10) + : : : : : +- BroadcastExchange (29) + : : : : : +- * Project (28) + : : : : : +- * BroadcastHashJoin Inner BuildRight (27) + : : : : : :- * Project (21) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : : : : :- * Filter (15) + : : : : : : : +- * ColumnarToRow (14) + : : : : : : : +- Scan parquet default.catalog_sales (13) + : : : : : : +- BroadcastExchange (19) + : : : : : : +- * Filter (18) + : : : : : : +- * ColumnarToRow (17) + : : : : : : +- Scan parquet default.item (16) + : : : : : +- BroadcastExchange (26) + : : : : : +- * Project (25) + : : : : : +- * Filter (24) + : : : : : +- * ColumnarToRow (23) + : : : : : +- Scan parquet default.date_dim (22) + : : : : +- ReusedExchange (34) + : : : +- BroadcastExchange (49) + : : : +- * Project (48) + : : : +- * BroadcastHashJoin Inner BuildRight (47) + : : : :- * Project (45) + : : : : +- * BroadcastHashJoin Inner BuildRight (44) + : : : : :- * Filter (42) + : : : : : +- * ColumnarToRow (41) + : : : : : +- Scan parquet default.web_sales (40) + : : : : +- ReusedExchange (43) + : : : +- ReusedExchange (46) + : : +- BroadcastExchange (63) + : : +- * BroadcastHashJoin LeftSemi BuildRight (62) + : : :- * Filter (60) + : : : +- * ColumnarToRow (59) + : : : +- Scan parquet default.item (58) + : : +- ReusedExchange (61) + : +- BroadcastExchange (70) + : +- * Project (69) + : +- * Filter (68) + : +- * ColumnarToRow (67) + : +- Scan parquet default.date_dim (66) + :- * Project (93) + : +- * Filter (92) + : +- * HashAggregate (91) + : +- Exchange (90) + : +- * HashAggregate (89) + : +- * Project (88) + : +- * BroadcastHashJoin Inner BuildRight (87) + : :- * Project (85) + : : +- * BroadcastHashJoin Inner BuildRight (84) + : : :- * BroadcastHashJoin LeftSemi BuildRight (82) + : : : :- * Filter (80) + : : : : +- * ColumnarToRow (79) + : : : : +- Scan parquet default.catalog_sales (78) + : : : +- ReusedExchange (81) + : : +- ReusedExchange (83) + : +- ReusedExchange (86) + +- * Project (109) + +- * Filter (108) + +- * HashAggregate (107) + +- Exchange (106) + +- * HashAggregate (105) + +- * Project (104) + +- * BroadcastHashJoin Inner BuildRight (103) + :- * Project (101) + : +- * BroadcastHashJoin Inner BuildRight (100) + : :- * BroadcastHashJoin LeftSemi BuildRight (98) + : : :- * Filter (96) + : : : +- * ColumnarToRow (95) + : : : +- Scan parquet default.web_sales (94) + : : +- ReusedExchange (97) + : +- ReusedExchange (99) + +- ReusedExchange (102) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 25] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 25] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 11] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] + +(6) Filter [codegen id : 11] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Condition : ((isnotnull(i_brand_id#7) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) + +(7) Scan parquet default.store_sales +Output [2]: [ss_item_sk#10, ss_sold_date_sk#11] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#11), dynamicpruningexpression(ss_sold_date_sk#11 IN dynamicpruning#12)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 6] +Input [2]: [ss_item_sk#10, ss_sold_date_sk#11] + +(9) Filter [codegen id : 6] +Input [2]: [ss_item_sk#10, ss_sold_date_sk#11] +Condition : isnotnull(ss_item_sk#10) + +(10) Scan parquet default.item +Output [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 4] +Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] + +(12) Filter [codegen id : 4] +Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] +Condition : (((isnotnull(i_item_sk#13) AND isnotnull(i_brand_id#14)) AND isnotnull(i_class_id#15)) AND isnotnull(i_category_id#16)) + +(13) Scan parquet default.catalog_sales +Output [2]: [cs_item_sk#17, cs_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#12)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 3] +Input [2]: [cs_item_sk#17, cs_sold_date_sk#18] + +(15) Filter [codegen id : 3] +Input [2]: [cs_item_sk#17, cs_sold_date_sk#18] +Condition : isnotnull(cs_item_sk#17) + +(16) Scan parquet default.item +Output [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] + +(18) Filter [codegen id : 1] +Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] +Condition : isnotnull(i_item_sk#19) + +(19) BroadcastExchange +Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(20) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_item_sk#17] +Right keys [1]: [i_item_sk#19] +Join condition: None + +(21) Project [codegen id : 3] +Output [4]: [cs_sold_date_sk#18, i_brand_id#20, i_class_id#21, i_category_id#22] +Input [6]: [cs_item_sk#17, cs_sold_date_sk#18, i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] + +(22) Scan parquet default.date_dim +Output [2]: [d_date_sk#24, d_year#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#24, d_year#25] + +(24) Filter [codegen id : 2] +Input [2]: [d_date_sk#24, d_year#25] +Condition : (((isnotnull(d_year#25) AND (d_year#25 >= 1999)) AND (d_year#25 <= 2001)) AND isnotnull(d_date_sk#24)) + +(25) Project [codegen id : 2] +Output [1]: [d_date_sk#24] +Input [2]: [d_date_sk#24, d_year#25] + +(26) BroadcastExchange +Input [1]: [d_date_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] + +(27) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(28) Project [codegen id : 3] +Output [3]: [i_brand_id#20, i_class_id#21, i_category_id#22] +Input [5]: [cs_sold_date_sk#18, i_brand_id#20, i_class_id#21, i_category_id#22, d_date_sk#24] + +(29) BroadcastExchange +Input [3]: [i_brand_id#20, i_class_id#21, i_category_id#22] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [id=#27] + +(30) BroadcastHashJoin [codegen id : 4] +Left keys [6]: [coalesce(i_brand_id#14, 0), isnull(i_brand_id#14), coalesce(i_class_id#15, 0), isnull(i_class_id#15), coalesce(i_category_id#16, 0), isnull(i_category_id#16)] +Right keys [6]: [coalesce(i_brand_id#20, 0), isnull(i_brand_id#20), coalesce(i_class_id#21, 0), isnull(i_class_id#21), coalesce(i_category_id#22, 0), isnull(i_category_id#22)] +Join condition: None + +(31) BroadcastExchange +Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#28] + +(32) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#10] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(33) Project [codegen id : 6] +Output [4]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16] +Input [6]: [ss_item_sk#10, ss_sold_date_sk#11, i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] + +(34) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#29] + +(35) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#11] +Right keys [1]: [d_date_sk#29] +Join condition: None + +(36) Project [codegen id : 6] +Output [3]: [i_brand_id#14 AS brand_id#30, i_class_id#15 AS class_id#31, i_category_id#16 AS category_id#32] +Input [5]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16, d_date_sk#29] + +(37) HashAggregate [codegen id : 6] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(38) Exchange +Input [3]: [brand_id#30, class_id#31, category_id#32] +Arguments: hashpartitioning(brand_id#30, class_id#31, category_id#32, 5), ENSURE_REQUIREMENTS, [id=#33] + +(39) HashAggregate [codegen id : 10] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(40) Scan parquet default.web_sales +Output [2]: [ws_item_sk#34, ws_sold_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#35), dynamicpruningexpression(ws_sold_date_sk#35 IN dynamicpruning#12)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 9] +Input [2]: [ws_item_sk#34, ws_sold_date_sk#35] + +(42) Filter [codegen id : 9] +Input [2]: [ws_item_sk#34, ws_sold_date_sk#35] +Condition : isnotnull(ws_item_sk#34) + +(43) ReusedExchange [Reuses operator id: 19] +Output [4]: [i_item_sk#36, i_brand_id#37, i_class_id#38, i_category_id#39] + +(44) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ws_item_sk#34] +Right keys [1]: [i_item_sk#36] +Join condition: None + +(45) Project [codegen id : 9] +Output [4]: [ws_sold_date_sk#35, i_brand_id#37, i_class_id#38, i_category_id#39] +Input [6]: [ws_item_sk#34, ws_sold_date_sk#35, i_item_sk#36, i_brand_id#37, i_class_id#38, i_category_id#39] + +(46) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#40] + +(47) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ws_sold_date_sk#35] +Right keys [1]: [d_date_sk#40] +Join condition: None + +(48) Project [codegen id : 9] +Output [3]: [i_brand_id#37, i_class_id#38, i_category_id#39] +Input [5]: [ws_sold_date_sk#35, i_brand_id#37, i_class_id#38, i_category_id#39, d_date_sk#40] + +(49) BroadcastExchange +Input [3]: [i_brand_id#37, i_class_id#38, i_category_id#39] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [id=#41] + +(50) BroadcastHashJoin [codegen id : 10] +Left keys [6]: [coalesce(brand_id#30, 0), isnull(brand_id#30), coalesce(class_id#31, 0), isnull(class_id#31), coalesce(category_id#32, 0), isnull(category_id#32)] +Right keys [6]: [coalesce(i_brand_id#37, 0), isnull(i_brand_id#37), coalesce(i_class_id#38, 0), isnull(i_class_id#38), coalesce(i_category_id#39, 0), isnull(i_category_id#39)] +Join condition: None + +(51) HashAggregate [codegen id : 10] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(52) HashAggregate [codegen id : 10] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(53) BroadcastExchange +Input [3]: [brand_id#30, class_id#31, category_id#32] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#42] + +(54) BroadcastHashJoin [codegen id : 11] +Left keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Right keys [3]: [brand_id#30, class_id#31, category_id#32] +Join condition: None + +(55) Project [codegen id : 11] +Output [1]: [i_item_sk#6 AS ss_item_sk#43] +Input [7]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, brand_id#30, class_id#31, category_id#32] + +(56) BroadcastExchange +Input [1]: [ss_item_sk#43] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] + +(57) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(58) Scan parquet default.item +Output [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(59) ColumnarToRow [codegen id : 23] +Input [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] + +(60) Filter [codegen id : 23] +Input [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] +Condition : isnotnull(i_item_sk#45) + +(61) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#43] + +(62) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [i_item_sk#45] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(63) BroadcastExchange +Input [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#49] + +(64) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#45] +Join condition: None + +(65) Project [codegen id : 25] +Output [6]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#46, i_class_id#47, i_category_id#48] +Input [8]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] + +(66) Scan parquet default.date_dim +Output [3]: [d_date_sk#50, d_year#51, d_moy#52] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct + +(67) ColumnarToRow [codegen id : 24] +Input [3]: [d_date_sk#50, d_year#51, d_moy#52] + +(68) Filter [codegen id : 24] +Input [3]: [d_date_sk#50, d_year#51, d_moy#52] +Condition : ((((isnotnull(d_year#51) AND isnotnull(d_moy#52)) AND (d_year#51 = 2001)) AND (d_moy#52 = 11)) AND isnotnull(d_date_sk#50)) + +(69) Project [codegen id : 24] +Output [1]: [d_date_sk#50] +Input [3]: [d_date_sk#50, d_year#51, d_moy#52] + +(70) BroadcastExchange +Input [1]: [d_date_sk#50] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#53] + +(71) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#50] +Join condition: None + +(72) Project [codegen id : 25] +Output [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#46, i_class_id#47, i_category_id#48] +Input [7]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#46, i_class_id#47, i_category_id#48, d_date_sk#50] + +(73) HashAggregate [codegen id : 25] +Input [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#46, i_class_id#47, i_category_id#48] +Keys [3]: [i_brand_id#46, i_class_id#47, i_category_id#48] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#54, isEmpty#55, count#56] +Results [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum#57, isEmpty#58, count#59] + +(74) Exchange +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum#57, isEmpty#58, count#59] +Arguments: hashpartitioning(i_brand_id#46, i_class_id#47, i_category_id#48, 5), ENSURE_REQUIREMENTS, [id=#60] + +(75) HashAggregate [codegen id : 26] +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum#57, isEmpty#58, count#59] +Keys [3]: [i_brand_id#46, i_class_id#47, i_category_id#48] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#61, count(1)#62] +Results [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#61 AS sales#63, count(1)#62 AS number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#61 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#65] + +(76) Filter [codegen id : 26] +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sales#63, number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#65] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#65) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#65 as decimal(32,6)) > cast(Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(77) Project [codegen id : 26] +Output [6]: [sales#63, number_sales#64, store AS channel#68, i_brand_id#46, i_class_id#47, i_category_id#48] +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sales#63, number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#65] + +(78) Scan parquet default.catalog_sales +Output [4]: [cs_item_sk#69, cs_quantity#70, cs_list_price#71, cs_sold_date_sk#72] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#72), dynamicpruningexpression(cs_sold_date_sk#72 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(79) ColumnarToRow [codegen id : 51] +Input [4]: [cs_item_sk#69, cs_quantity#70, cs_list_price#71, cs_sold_date_sk#72] + +(80) Filter [codegen id : 51] +Input [4]: [cs_item_sk#69, cs_quantity#70, cs_list_price#71, cs_sold_date_sk#72] +Condition : isnotnull(cs_item_sk#69) + +(81) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#43] + +(82) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [cs_item_sk#69] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(83) ReusedExchange [Reuses operator id: 63] +Output [4]: [i_item_sk#73, i_brand_id#74, i_class_id#75, i_category_id#76] + +(84) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [cs_item_sk#69] +Right keys [1]: [i_item_sk#73] +Join condition: None + +(85) Project [codegen id : 51] +Output [6]: [cs_quantity#70, cs_list_price#71, cs_sold_date_sk#72, i_brand_id#74, i_class_id#75, i_category_id#76] +Input [8]: [cs_item_sk#69, cs_quantity#70, cs_list_price#71, cs_sold_date_sk#72, i_item_sk#73, i_brand_id#74, i_class_id#75, i_category_id#76] + +(86) ReusedExchange [Reuses operator id: 70] +Output [1]: [d_date_sk#77] + +(87) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [cs_sold_date_sk#72] +Right keys [1]: [d_date_sk#77] +Join condition: None + +(88) Project [codegen id : 51] +Output [5]: [cs_quantity#70, cs_list_price#71, i_brand_id#74, i_class_id#75, i_category_id#76] +Input [7]: [cs_quantity#70, cs_list_price#71, cs_sold_date_sk#72, i_brand_id#74, i_class_id#75, i_category_id#76, d_date_sk#77] + +(89) HashAggregate [codegen id : 51] +Input [5]: [cs_quantity#70, cs_list_price#71, i_brand_id#74, i_class_id#75, i_category_id#76] +Keys [3]: [i_brand_id#74, i_class_id#75, i_category_id#76] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#78, isEmpty#79, count#80] +Results [6]: [i_brand_id#74, i_class_id#75, i_category_id#76, sum#81, isEmpty#82, count#83] + +(90) Exchange +Input [6]: [i_brand_id#74, i_class_id#75, i_category_id#76, sum#81, isEmpty#82, count#83] +Arguments: hashpartitioning(i_brand_id#74, i_class_id#75, i_category_id#76, 5), ENSURE_REQUIREMENTS, [id=#84] + +(91) HashAggregate [codegen id : 52] +Input [6]: [i_brand_id#74, i_class_id#75, i_category_id#76, sum#81, isEmpty#82, count#83] +Keys [3]: [i_brand_id#74, i_class_id#75, i_category_id#76] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#85, count(1)#86] +Results [6]: [i_brand_id#74, i_class_id#75, i_category_id#76, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#85 AS sales#87, count(1)#86 AS number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#85 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#89] + +(92) Filter [codegen id : 52] +Input [6]: [i_brand_id#74, i_class_id#75, i_category_id#76, sales#87, number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#89] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#89) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#89 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(93) Project [codegen id : 52] +Output [6]: [sales#87, number_sales#88, catalog AS channel#90, i_brand_id#74, i_class_id#75, i_category_id#76] +Input [6]: [i_brand_id#74, i_class_id#75, i_category_id#76, sales#87, number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#89] + +(94) Scan parquet default.web_sales +Output [4]: [ws_item_sk#91, ws_quantity#92, ws_list_price#93, ws_sold_date_sk#94] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#94), dynamicpruningexpression(ws_sold_date_sk#94 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(95) ColumnarToRow [codegen id : 77] +Input [4]: [ws_item_sk#91, ws_quantity#92, ws_list_price#93, ws_sold_date_sk#94] + +(96) Filter [codegen id : 77] +Input [4]: [ws_item_sk#91, ws_quantity#92, ws_list_price#93, ws_sold_date_sk#94] +Condition : isnotnull(ws_item_sk#91) + +(97) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#43] + +(98) BroadcastHashJoin [codegen id : 77] +Left keys [1]: [ws_item_sk#91] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(99) ReusedExchange [Reuses operator id: 63] +Output [4]: [i_item_sk#95, i_brand_id#96, i_class_id#97, i_category_id#98] + +(100) BroadcastHashJoin [codegen id : 77] +Left keys [1]: [ws_item_sk#91] +Right keys [1]: [i_item_sk#95] +Join condition: None + +(101) Project [codegen id : 77] +Output [6]: [ws_quantity#92, ws_list_price#93, ws_sold_date_sk#94, i_brand_id#96, i_class_id#97, i_category_id#98] +Input [8]: [ws_item_sk#91, ws_quantity#92, ws_list_price#93, ws_sold_date_sk#94, i_item_sk#95, i_brand_id#96, i_class_id#97, i_category_id#98] + +(102) ReusedExchange [Reuses operator id: 70] +Output [1]: [d_date_sk#99] + +(103) BroadcastHashJoin [codegen id : 77] +Left keys [1]: [ws_sold_date_sk#94] +Right keys [1]: [d_date_sk#99] +Join condition: None + +(104) Project [codegen id : 77] +Output [5]: [ws_quantity#92, ws_list_price#93, i_brand_id#96, i_class_id#97, i_category_id#98] +Input [7]: [ws_quantity#92, ws_list_price#93, ws_sold_date_sk#94, i_brand_id#96, i_class_id#97, i_category_id#98, d_date_sk#99] + +(105) HashAggregate [codegen id : 77] +Input [5]: [ws_quantity#92, ws_list_price#93, i_brand_id#96, i_class_id#97, i_category_id#98] +Keys [3]: [i_brand_id#96, i_class_id#97, i_category_id#98] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#100, isEmpty#101, count#102] +Results [6]: [i_brand_id#96, i_class_id#97, i_category_id#98, sum#103, isEmpty#104, count#105] + +(106) Exchange +Input [6]: [i_brand_id#96, i_class_id#97, i_category_id#98, sum#103, isEmpty#104, count#105] +Arguments: hashpartitioning(i_brand_id#96, i_class_id#97, i_category_id#98, 5), ENSURE_REQUIREMENTS, [id=#106] + +(107) HashAggregate [codegen id : 78] +Input [6]: [i_brand_id#96, i_class_id#97, i_category_id#98, sum#103, isEmpty#104, count#105] +Keys [3]: [i_brand_id#96, i_class_id#97, i_category_id#98] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#107, count(1)#108] +Results [6]: [i_brand_id#96, i_class_id#97, i_category_id#98, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#107 AS sales#109, count(1)#108 AS number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#107 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#111] + +(108) Filter [codegen id : 78] +Input [6]: [i_brand_id#96, i_class_id#97, i_category_id#98, sales#109, number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#111] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#111) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#111 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(109) Project [codegen id : 78] +Output [6]: [sales#109, number_sales#110, web AS channel#112, i_brand_id#96, i_class_id#97, i_category_id#98] +Input [6]: [i_brand_id#96, i_class_id#97, i_category_id#98, sales#109, number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#111] + +(110) Union + +(111) Expand [codegen id : 79] +Input [6]: [sales#63, number_sales#64, channel#68, i_brand_id#46, i_class_id#47, i_category_id#48] +Arguments: [ArrayBuffer(sales#63, number_sales#64, channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, 0), ArrayBuffer(sales#63, number_sales#64, channel#68, i_brand_id#46, i_class_id#47, null, 1), ArrayBuffer(sales#63, number_sales#64, channel#68, i_brand_id#46, null, null, 3), ArrayBuffer(sales#63, number_sales#64, channel#68, null, null, null, 7), ArrayBuffer(sales#63, number_sales#64, null, null, null, null, 15)], [sales#63, number_sales#64, channel#113, i_brand_id#114, i_class_id#115, i_category_id#116, spark_grouping_id#117] + +(112) HashAggregate [codegen id : 79] +Input [7]: [sales#63, number_sales#64, channel#113, i_brand_id#114, i_class_id#115, i_category_id#116, spark_grouping_id#117] +Keys [5]: [channel#113, i_brand_id#114, i_class_id#115, i_category_id#116, spark_grouping_id#117] +Functions [2]: [partial_sum(sales#63), partial_sum(number_sales#64)] +Aggregate Attributes [3]: [sum#118, isEmpty#119, sum#120] +Results [8]: [channel#113, i_brand_id#114, i_class_id#115, i_category_id#116, spark_grouping_id#117, sum#121, isEmpty#122, sum#123] + +(113) Exchange +Input [8]: [channel#113, i_brand_id#114, i_class_id#115, i_category_id#116, spark_grouping_id#117, sum#121, isEmpty#122, sum#123] +Arguments: hashpartitioning(channel#113, i_brand_id#114, i_class_id#115, i_category_id#116, spark_grouping_id#117, 5), ENSURE_REQUIREMENTS, [id=#124] + +(114) HashAggregate [codegen id : 80] +Input [8]: [channel#113, i_brand_id#114, i_class_id#115, i_category_id#116, spark_grouping_id#117, sum#121, isEmpty#122, sum#123] +Keys [5]: [channel#113, i_brand_id#114, i_class_id#115, i_category_id#116, spark_grouping_id#117] +Functions [2]: [sum(sales#63), sum(number_sales#64)] +Aggregate Attributes [2]: [sum(sales#63)#125, sum(number_sales#64)#126] +Results [6]: [channel#113, i_brand_id#114, i_class_id#115, i_category_id#116, sum(sales#63)#125 AS sum(sales)#127, sum(number_sales#64)#126 AS sum(number_sales)#128] + +(115) TakeOrderedAndProject +Input [6]: [channel#113, i_brand_id#114, i_class_id#115, i_category_id#116, sum(sales)#127, sum(number_sales)#128] +Arguments: 100, [channel#113 ASC NULLS FIRST, i_brand_id#114 ASC NULLS FIRST, i_class_id#115 ASC NULLS FIRST, i_category_id#116 ASC NULLS FIRST], [channel#113, i_brand_id#114, i_class_id#115, i_category_id#116, sum(sales)#127, sum(number_sales)#128] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 76 Hosting Expression = Subquery scalar-subquery#66, [id=#67] +* HashAggregate (138) ++- Exchange (137) + +- * HashAggregate (136) + +- Union (135) + :- * Project (124) + : +- * BroadcastHashJoin Inner BuildRight (123) + : :- * ColumnarToRow (117) + : : +- Scan parquet default.store_sales (116) + : +- BroadcastExchange (122) + : +- * Project (121) + : +- * Filter (120) + : +- * ColumnarToRow (119) + : +- Scan parquet default.date_dim (118) + :- * Project (129) + : +- * BroadcastHashJoin Inner BuildRight (128) + : :- * ColumnarToRow (126) + : : +- Scan parquet default.catalog_sales (125) + : +- ReusedExchange (127) + +- * Project (134) + +- * BroadcastHashJoin Inner BuildRight (133) + :- * ColumnarToRow (131) + : +- Scan parquet default.web_sales (130) + +- ReusedExchange (132) + + +(116) Scan parquet default.store_sales +Output [3]: [ss_quantity#129, ss_list_price#130, ss_sold_date_sk#131] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#131), dynamicpruningexpression(ss_sold_date_sk#131 IN dynamicpruning#132)] +ReadSchema: struct + +(117) ColumnarToRow [codegen id : 2] +Input [3]: [ss_quantity#129, ss_list_price#130, ss_sold_date_sk#131] + +(118) Scan parquet default.date_dim +Output [2]: [d_date_sk#133, d_year#134] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(119) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#133, d_year#134] + +(120) Filter [codegen id : 1] +Input [2]: [d_date_sk#133, d_year#134] +Condition : (((isnotnull(d_year#134) AND (d_year#134 >= 1999)) AND (d_year#134 <= 2001)) AND isnotnull(d_date_sk#133)) + +(121) Project [codegen id : 1] +Output [1]: [d_date_sk#133] +Input [2]: [d_date_sk#133, d_year#134] + +(122) BroadcastExchange +Input [1]: [d_date_sk#133] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#135] + +(123) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#131] +Right keys [1]: [d_date_sk#133] +Join condition: None + +(124) Project [codegen id : 2] +Output [2]: [ss_quantity#129 AS quantity#136, ss_list_price#130 AS list_price#137] +Input [4]: [ss_quantity#129, ss_list_price#130, ss_sold_date_sk#131, d_date_sk#133] + +(125) Scan parquet default.catalog_sales +Output [3]: [cs_quantity#138, cs_list_price#139, cs_sold_date_sk#140] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#140), dynamicpruningexpression(cs_sold_date_sk#140 IN dynamicpruning#132)] +ReadSchema: struct + +(126) ColumnarToRow [codegen id : 4] +Input [3]: [cs_quantity#138, cs_list_price#139, cs_sold_date_sk#140] + +(127) ReusedExchange [Reuses operator id: 122] +Output [1]: [d_date_sk#141] + +(128) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#140] +Right keys [1]: [d_date_sk#141] +Join condition: None + +(129) Project [codegen id : 4] +Output [2]: [cs_quantity#138 AS quantity#142, cs_list_price#139 AS list_price#143] +Input [4]: [cs_quantity#138, cs_list_price#139, cs_sold_date_sk#140, d_date_sk#141] + +(130) Scan parquet default.web_sales +Output [3]: [ws_quantity#144, ws_list_price#145, ws_sold_date_sk#146] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#146), dynamicpruningexpression(ws_sold_date_sk#146 IN dynamicpruning#132)] +ReadSchema: struct + +(131) ColumnarToRow [codegen id : 6] +Input [3]: [ws_quantity#144, ws_list_price#145, ws_sold_date_sk#146] + +(132) ReusedExchange [Reuses operator id: 122] +Output [1]: [d_date_sk#147] + +(133) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#146] +Right keys [1]: [d_date_sk#147] +Join condition: None + +(134) Project [codegen id : 6] +Output [2]: [ws_quantity#144 AS quantity#148, ws_list_price#145 AS list_price#149] +Input [4]: [ws_quantity#144, ws_list_price#145, ws_sold_date_sk#146, d_date_sk#147] + +(135) Union + +(136) HashAggregate [codegen id : 7] +Input [2]: [quantity#136, list_price#137] +Keys: [] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#136 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#137 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#150, count#151] +Results [2]: [sum#152, count#153] + +(137) Exchange +Input [2]: [sum#152, count#153] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#154] + +(138) HashAggregate [codegen id : 8] +Input [2]: [sum#152, count#153] +Keys: [] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#136 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#137 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#136 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#137 as decimal(12,2)))), DecimalType(18,2), true))#155] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#136 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#137 as decimal(12,2)))), DecimalType(18,2), true))#155 AS average_sales#156] + +Subquery:2 Hosting operator id = 116 Hosting Expression = ss_sold_date_sk#131 IN dynamicpruning#132 +ReusedExchange (139) + + +(139) ReusedExchange [Reuses operator id: 122] +Output [1]: [d_date_sk#133] + +Subquery:3 Hosting operator id = 125 Hosting Expression = cs_sold_date_sk#140 IN dynamicpruning#132 + +Subquery:4 Hosting operator id = 130 Hosting Expression = ws_sold_date_sk#146 IN dynamicpruning#132 + +Subquery:5 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (140) + + +(140) ReusedExchange [Reuses operator id: 70] +Output [1]: [d_date_sk#50] + +Subquery:6 Hosting operator id = 7 Hosting Expression = ss_sold_date_sk#11 IN dynamicpruning#12 +ReusedExchange (141) + + +(141) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#29] + +Subquery:7 Hosting operator id = 13 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#12 + +Subquery:8 Hosting operator id = 40 Hosting Expression = ws_sold_date_sk#35 IN dynamicpruning#12 + +Subquery:9 Hosting operator id = 92 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:10 Hosting operator id = 78 Hosting Expression = cs_sold_date_sk#72 IN dynamicpruning#5 + +Subquery:11 Hosting operator id = 108 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:12 Hosting operator id = 94 Hosting Expression = ws_sold_date_sk#94 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt new file mode 100644 index 0000000000000..9ae1a0e30e90e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14a/simplified.txt @@ -0,0 +1,223 @@ +TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum(sales),sum(number_sales)] + WholeStageCodegen (80) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum(sales),sum(number_sales),sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id] #1 + WholeStageCodegen (79) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,spark_grouping_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + Expand [sales,number_sales,channel,i_brand_id,i_class_id,i_category_id] + InputAdapter + Union + WholeStageCodegen (26) + Project [sales,number_sales,i_brand_id,i_class_id,i_category_id] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + Subquery #3 + WholeStageCodegen (8) + HashAggregate [sum,count] [avg(CheckOverflow((promote_precision(cast(cast(quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price as decimal(12,2)))), DecimalType(18,2), true)),average_sales,sum,count] + InputAdapter + Exchange #14 + WholeStageCodegen (7) + HashAggregate [quantity,list_price] [sum,count,sum,count] + InputAdapter + Union + WholeStageCodegen (2) + Project [ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #4 + ReusedExchange [d_date_sk] #15 + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + WholeStageCodegen (4) + Project [cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_quantity,cs_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #4 + InputAdapter + ReusedExchange [d_date_sk] #15 + WholeStageCodegen (6) + Project [ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #4 + InputAdapter + ReusedExchange [d_date_sk] #15 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #2 + WholeStageCodegen (25) + HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_quantity,ss_list_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + BroadcastHashJoin [ss_item_sk,ss_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (11) + Project [i_item_sk] + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id] + Filter [i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (10) + HashAggregate [brand_id,class_id,category_id] + HashAggregate [brand_id,class_id,category_id] + BroadcastHashJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] + HashAggregate [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #6 + WholeStageCodegen (6) + HashAggregate [brand_id,class_id,category_id] + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #7 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (4) + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id] + Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (3) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (1) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + ReusedExchange [d_date_sk] #7 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (9) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #10 + InputAdapter + ReusedExchange [d_date_sk] #7 + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (23) + BroadcastHashJoin [i_item_sk,ss_item_sk] + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + ReusedExchange [ss_item_sk] #13 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (24) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (52) + Project [sales,number_sales,i_brand_id,i_class_id,i_category_id] + Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #16 + WholeStageCodegen (51) + HashAggregate [i_brand_id,i_class_id,i_category_id,cs_quantity,cs_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [cs_quantity,cs_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_quantity,cs_list_price,cs_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + BroadcastHashJoin [cs_item_sk,ss_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [ss_item_sk] #13 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #12 + InputAdapter + ReusedExchange [d_date_sk] #3 + WholeStageCodegen (78) + Project [sales,number_sales,i_brand_id,i_class_id,i_category_id] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #17 + WholeStageCodegen (77) + HashAggregate [i_brand_id,i_class_id,i_category_id,ws_quantity,ws_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ws_quantity,ws_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_quantity,ws_list_price,ws_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + BroadcastHashJoin [ws_item_sk,ss_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [ss_item_sk] #13 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #12 + InputAdapter + ReusedExchange [d_date_sk] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/explain.txt new file mode 100644 index 0000000000000..d0bdd41048367 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/explain.txt @@ -0,0 +1,869 @@ +== Physical Plan == +TakeOrderedAndProject (116) ++- * BroadcastHashJoin Inner BuildRight (115) + :- * Project (90) + : +- * Filter (89) + : +- * HashAggregate (88) + : +- Exchange (87) + : +- * HashAggregate (86) + : +- * Project (85) + : +- * BroadcastHashJoin Inner BuildRight (84) + : :- * Project (74) + : : +- * BroadcastHashJoin Inner BuildRight (73) + : : :- * SortMergeJoin LeftSemi (67) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Sort (66) + : : : +- Exchange (65) + : : : +- * Project (64) + : : : +- * BroadcastHashJoin Inner BuildRight (63) + : : : :- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.item (6) + : : : +- BroadcastExchange (62) + : : : +- * HashAggregate (61) + : : : +- Exchange (60) + : : : +- * HashAggregate (59) + : : : +- * SortMergeJoin LeftSemi (58) + : : : :- * Sort (46) + : : : : +- Exchange (45) + : : : : +- * HashAggregate (44) + : : : : +- Exchange (43) + : : : : +- * HashAggregate (42) + : : : : +- * Project (41) + : : : : +- * BroadcastHashJoin Inner BuildRight (40) + : : : : :- * Project (18) + : : : : : +- * BroadcastHashJoin Inner BuildRight (17) + : : : : : :- * Filter (11) + : : : : : : +- * ColumnarToRow (10) + : : : : : : +- Scan parquet default.store_sales (9) + : : : : : +- BroadcastExchange (16) + : : : : : +- * Project (15) + : : : : : +- * Filter (14) + : : : : : +- * ColumnarToRow (13) + : : : : : +- Scan parquet default.date_dim (12) + : : : : +- BroadcastExchange (39) + : : : : +- * SortMergeJoin LeftSemi (38) + : : : : :- * Sort (23) + : : : : : +- Exchange (22) + : : : : : +- * Filter (21) + : : : : : +- * ColumnarToRow (20) + : : : : : +- Scan parquet default.item (19) + : : : : +- * Sort (37) + : : : : +- Exchange (36) + : : : : +- * Project (35) + : : : : +- * BroadcastHashJoin Inner BuildRight (34) + : : : : :- * Project (29) + : : : : : +- * BroadcastHashJoin Inner BuildRight (28) + : : : : : :- * Filter (26) + : : : : : : +- * ColumnarToRow (25) + : : : : : : +- Scan parquet default.catalog_sales (24) + : : : : : +- ReusedExchange (27) + : : : : +- BroadcastExchange (33) + : : : : +- * Filter (32) + : : : : +- * ColumnarToRow (31) + : : : : +- Scan parquet default.item (30) + : : : +- * Sort (57) + : : : +- Exchange (56) + : : : +- * Project (55) + : : : +- * BroadcastHashJoin Inner BuildRight (54) + : : : :- * Project (52) + : : : : +- * BroadcastHashJoin Inner BuildRight (51) + : : : : :- * Filter (49) + : : : : : +- * ColumnarToRow (48) + : : : : : +- Scan parquet default.web_sales (47) + : : : : +- ReusedExchange (50) + : : : +- ReusedExchange (53) + : : +- BroadcastExchange (72) + : : +- * Project (71) + : : +- * Filter (70) + : : +- * ColumnarToRow (69) + : : +- Scan parquet default.date_dim (68) + : +- BroadcastExchange (83) + : +- * SortMergeJoin LeftSemi (82) + : :- * Sort (79) + : : +- Exchange (78) + : : +- * Filter (77) + : : +- * ColumnarToRow (76) + : : +- Scan parquet default.item (75) + : +- * Sort (81) + : +- ReusedExchange (80) + +- BroadcastExchange (114) + +- * Project (113) + +- * Filter (112) + +- * HashAggregate (111) + +- Exchange (110) + +- * HashAggregate (109) + +- * Project (108) + +- * BroadcastHashJoin Inner BuildRight (107) + :- * Project (105) + : +- * BroadcastHashJoin Inner BuildRight (104) + : :- * SortMergeJoin LeftSemi (98) + : : :- * Sort (95) + : : : +- Exchange (94) + : : : +- * Filter (93) + : : : +- * ColumnarToRow (92) + : : : +- Scan parquet default.store_sales (91) + : : +- * Sort (97) + : : +- ReusedExchange (96) + : +- BroadcastExchange (103) + : +- * Project (102) + : +- * Filter (101) + : +- * ColumnarToRow (100) + : +- Scan parquet default.date_dim (99) + +- ReusedExchange (106) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 1] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_item_sk#1) + +(4) Exchange +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#6] + +(5) Sort [codegen id : 2] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.item +Output [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 20] +Input [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10] + +(8) Filter [codegen id : 20] +Input [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10] +Condition : ((isnotnull(i_brand_id#8) AND isnotnull(i_class_id#9)) AND isnotnull(i_category_id#10)) + +(9) Scan parquet default.store_sales +Output [2]: [ss_item_sk#11, ss_sold_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#12), dynamicpruningexpression(ss_sold_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(10) ColumnarToRow [codegen id : 11] +Input [2]: [ss_item_sk#11, ss_sold_date_sk#12] + +(11) Filter [codegen id : 11] +Input [2]: [ss_item_sk#11, ss_sold_date_sk#12] +Condition : isnotnull(ss_item_sk#11) + +(12) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#14, d_year#15] + +(14) Filter [codegen id : 3] +Input [2]: [d_date_sk#14, d_year#15] +Condition : (((isnotnull(d_year#15) AND (d_year#15 >= 1999)) AND (d_year#15 <= 2001)) AND isnotnull(d_date_sk#14)) + +(15) Project [codegen id : 3] +Output [1]: [d_date_sk#14] +Input [2]: [d_date_sk#14, d_year#15] + +(16) BroadcastExchange +Input [1]: [d_date_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(17) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_sold_date_sk#12] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(18) Project [codegen id : 11] +Output [1]: [ss_item_sk#11] +Input [3]: [ss_item_sk#11, ss_sold_date_sk#12, d_date_sk#14] + +(19) Scan parquet default.item +Output [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 4] +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] + +(21) Filter [codegen id : 4] +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Condition : (((isnotnull(i_item_sk#17) AND isnotnull(i_brand_id#18)) AND isnotnull(i_class_id#19)) AND isnotnull(i_category_id#20)) + +(22) Exchange +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Arguments: hashpartitioning(coalesce(i_brand_id#18, 0), isnull(i_brand_id#18), coalesce(i_class_id#19, 0), isnull(i_class_id#19), coalesce(i_category_id#20, 0), isnull(i_category_id#20), 5), ENSURE_REQUIREMENTS, [id=#21] + +(23) Sort [codegen id : 5] +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Arguments: [coalesce(i_brand_id#18, 0) ASC NULLS FIRST, isnull(i_brand_id#18) ASC NULLS FIRST, coalesce(i_class_id#19, 0) ASC NULLS FIRST, isnull(i_class_id#19) ASC NULLS FIRST, coalesce(i_category_id#20, 0) ASC NULLS FIRST, isnull(i_category_id#20) ASC NULLS FIRST], false, 0 + +(24) Scan parquet default.catalog_sales +Output [2]: [cs_item_sk#22, cs_sold_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#23), dynamicpruningexpression(cs_sold_date_sk#23 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 8] +Input [2]: [cs_item_sk#22, cs_sold_date_sk#23] + +(26) Filter [codegen id : 8] +Input [2]: [cs_item_sk#22, cs_sold_date_sk#23] +Condition : isnotnull(cs_item_sk#22) + +(27) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#24] + +(28) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_sold_date_sk#23] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(29) Project [codegen id : 8] +Output [1]: [cs_item_sk#22] +Input [3]: [cs_item_sk#22, cs_sold_date_sk#23, d_date_sk#24] + +(30) Scan parquet default.item +Output [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 7] +Input [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] + +(32) Filter [codegen id : 7] +Input [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] +Condition : isnotnull(i_item_sk#25) + +(33) BroadcastExchange +Input [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(34) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_item_sk#22] +Right keys [1]: [i_item_sk#25] +Join condition: None + +(35) Project [codegen id : 8] +Output [3]: [i_brand_id#26, i_class_id#27, i_category_id#28] +Input [5]: [cs_item_sk#22, i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] + +(36) Exchange +Input [3]: [i_brand_id#26, i_class_id#27, i_category_id#28] +Arguments: hashpartitioning(coalesce(i_brand_id#26, 0), isnull(i_brand_id#26), coalesce(i_class_id#27, 0), isnull(i_class_id#27), coalesce(i_category_id#28, 0), isnull(i_category_id#28), 5), ENSURE_REQUIREMENTS, [id=#30] + +(37) Sort [codegen id : 9] +Input [3]: [i_brand_id#26, i_class_id#27, i_category_id#28] +Arguments: [coalesce(i_brand_id#26, 0) ASC NULLS FIRST, isnull(i_brand_id#26) ASC NULLS FIRST, coalesce(i_class_id#27, 0) ASC NULLS FIRST, isnull(i_class_id#27) ASC NULLS FIRST, coalesce(i_category_id#28, 0) ASC NULLS FIRST, isnull(i_category_id#28) ASC NULLS FIRST], false, 0 + +(38) SortMergeJoin [codegen id : 10] +Left keys [6]: [coalesce(i_brand_id#18, 0), isnull(i_brand_id#18), coalesce(i_class_id#19, 0), isnull(i_class_id#19), coalesce(i_category_id#20, 0), isnull(i_category_id#20)] +Right keys [6]: [coalesce(i_brand_id#26, 0), isnull(i_brand_id#26), coalesce(i_class_id#27, 0), isnull(i_class_id#27), coalesce(i_category_id#28, 0), isnull(i_category_id#28)] +Join condition: None + +(39) BroadcastExchange +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_item_sk#11] +Right keys [1]: [i_item_sk#17] +Join condition: None + +(41) Project [codegen id : 11] +Output [3]: [i_brand_id#18 AS brand_id#32, i_class_id#19 AS class_id#33, i_category_id#20 AS category_id#34] +Input [5]: [ss_item_sk#11, i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] + +(42) HashAggregate [codegen id : 11] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(43) Exchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: hashpartitioning(brand_id#32, class_id#33, category_id#34, 5), ENSURE_REQUIREMENTS, [id=#35] + +(44) HashAggregate [codegen id : 12] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(45) Exchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: hashpartitioning(coalesce(brand_id#32, 0), isnull(brand_id#32), coalesce(class_id#33, 0), isnull(class_id#33), coalesce(category_id#34, 0), isnull(category_id#34), 5), ENSURE_REQUIREMENTS, [id=#36] + +(46) Sort [codegen id : 13] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: [coalesce(brand_id#32, 0) ASC NULLS FIRST, isnull(brand_id#32) ASC NULLS FIRST, coalesce(class_id#33, 0) ASC NULLS FIRST, isnull(class_id#33) ASC NULLS FIRST, coalesce(category_id#34, 0) ASC NULLS FIRST, isnull(category_id#34) ASC NULLS FIRST], false, 0 + +(47) Scan parquet default.web_sales +Output [2]: [ws_item_sk#37, ws_sold_date_sk#38] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#38), dynamicpruningexpression(ws_sold_date_sk#38 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 16] +Input [2]: [ws_item_sk#37, ws_sold_date_sk#38] + +(49) Filter [codegen id : 16] +Input [2]: [ws_item_sk#37, ws_sold_date_sk#38] +Condition : isnotnull(ws_item_sk#37) + +(50) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#39] + +(51) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [ws_sold_date_sk#38] +Right keys [1]: [d_date_sk#39] +Join condition: None + +(52) Project [codegen id : 16] +Output [1]: [ws_item_sk#37] +Input [3]: [ws_item_sk#37, ws_sold_date_sk#38, d_date_sk#39] + +(53) ReusedExchange [Reuses operator id: 33] +Output [4]: [i_item_sk#40, i_brand_id#41, i_class_id#42, i_category_id#43] + +(54) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [ws_item_sk#37] +Right keys [1]: [i_item_sk#40] +Join condition: None + +(55) Project [codegen id : 16] +Output [3]: [i_brand_id#41, i_class_id#42, i_category_id#43] +Input [5]: [ws_item_sk#37, i_item_sk#40, i_brand_id#41, i_class_id#42, i_category_id#43] + +(56) Exchange +Input [3]: [i_brand_id#41, i_class_id#42, i_category_id#43] +Arguments: hashpartitioning(coalesce(i_brand_id#41, 0), isnull(i_brand_id#41), coalesce(i_class_id#42, 0), isnull(i_class_id#42), coalesce(i_category_id#43, 0), isnull(i_category_id#43), 5), ENSURE_REQUIREMENTS, [id=#44] + +(57) Sort [codegen id : 17] +Input [3]: [i_brand_id#41, i_class_id#42, i_category_id#43] +Arguments: [coalesce(i_brand_id#41, 0) ASC NULLS FIRST, isnull(i_brand_id#41) ASC NULLS FIRST, coalesce(i_class_id#42, 0) ASC NULLS FIRST, isnull(i_class_id#42) ASC NULLS FIRST, coalesce(i_category_id#43, 0) ASC NULLS FIRST, isnull(i_category_id#43) ASC NULLS FIRST], false, 0 + +(58) SortMergeJoin [codegen id : 18] +Left keys [6]: [coalesce(brand_id#32, 0), isnull(brand_id#32), coalesce(class_id#33, 0), isnull(class_id#33), coalesce(category_id#34, 0), isnull(category_id#34)] +Right keys [6]: [coalesce(i_brand_id#41, 0), isnull(i_brand_id#41), coalesce(i_class_id#42, 0), isnull(i_class_id#42), coalesce(i_category_id#43, 0), isnull(i_category_id#43)] +Join condition: None + +(59) HashAggregate [codegen id : 18] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(60) Exchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: hashpartitioning(brand_id#32, class_id#33, category_id#34, 5), ENSURE_REQUIREMENTS, [id=#45] + +(61) HashAggregate [codegen id : 19] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(62) BroadcastExchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#46] + +(63) BroadcastHashJoin [codegen id : 20] +Left keys [3]: [i_brand_id#8, i_class_id#9, i_category_id#10] +Right keys [3]: [brand_id#32, class_id#33, category_id#34] +Join condition: None + +(64) Project [codegen id : 20] +Output [1]: [i_item_sk#7 AS ss_item_sk#47] +Input [7]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, brand_id#32, class_id#33, category_id#34] + +(65) Exchange +Input [1]: [ss_item_sk#47] +Arguments: hashpartitioning(ss_item_sk#47, 5), ENSURE_REQUIREMENTS, [id=#48] + +(66) Sort [codegen id : 21] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(67) SortMergeJoin [codegen id : 45] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(68) Scan parquet default.date_dim +Output [2]: [d_date_sk#49, d_week_seq#50] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(69) ColumnarToRow [codegen id : 22] +Input [2]: [d_date_sk#49, d_week_seq#50] + +(70) Filter [codegen id : 22] +Input [2]: [d_date_sk#49, d_week_seq#50] +Condition : ((isnotnull(d_week_seq#50) AND (d_week_seq#50 = Subquery scalar-subquery#51, [id=#52])) AND isnotnull(d_date_sk#49)) + +(71) Project [codegen id : 22] +Output [1]: [d_date_sk#49] +Input [2]: [d_date_sk#49, d_week_seq#50] + +(72) BroadcastExchange +Input [1]: [d_date_sk#49] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#53] + +(73) BroadcastHashJoin [codegen id : 45] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#49] +Join condition: None + +(74) Project [codegen id : 45] +Output [3]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3] +Input [5]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, d_date_sk#49] + +(75) Scan parquet default.item +Output [4]: [i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 23] +Input [4]: [i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] + +(77) Filter [codegen id : 23] +Input [4]: [i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] +Condition : (((isnotnull(i_item_sk#54) AND isnotnull(i_brand_id#55)) AND isnotnull(i_class_id#56)) AND isnotnull(i_category_id#57)) + +(78) Exchange +Input [4]: [i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] +Arguments: hashpartitioning(i_item_sk#54, 5), ENSURE_REQUIREMENTS, [id=#58] + +(79) Sort [codegen id : 24] +Input [4]: [i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] +Arguments: [i_item_sk#54 ASC NULLS FIRST], false, 0 + +(80) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#47] + +(81) Sort [codegen id : 43] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(82) SortMergeJoin [codegen id : 44] +Left keys [1]: [i_item_sk#54] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(83) BroadcastExchange +Input [4]: [i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#59] + +(84) BroadcastHashJoin [codegen id : 45] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#54] +Join condition: None + +(85) Project [codegen id : 45] +Output [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#55, i_class_id#56, i_category_id#57] +Input [7]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] + +(86) HashAggregate [codegen id : 45] +Input [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#55, i_class_id#56, i_category_id#57] +Keys [3]: [i_brand_id#55, i_class_id#56, i_category_id#57] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#60, isEmpty#61, count#62] +Results [6]: [i_brand_id#55, i_class_id#56, i_category_id#57, sum#63, isEmpty#64, count#65] + +(87) Exchange +Input [6]: [i_brand_id#55, i_class_id#56, i_category_id#57, sum#63, isEmpty#64, count#65] +Arguments: hashpartitioning(i_brand_id#55, i_class_id#56, i_category_id#57, 5), ENSURE_REQUIREMENTS, [id=#66] + +(88) HashAggregate [codegen id : 92] +Input [6]: [i_brand_id#55, i_class_id#56, i_category_id#57, sum#63, isEmpty#64, count#65] +Keys [3]: [i_brand_id#55, i_class_id#56, i_category_id#57] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#67, count(1)#68] +Results [6]: [i_brand_id#55, i_class_id#56, i_category_id#57, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#67 AS sales#69, count(1)#68 AS number_sales#70, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#67 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#71] + +(89) Filter [codegen id : 92] +Input [6]: [i_brand_id#55, i_class_id#56, i_category_id#57, sales#69, number_sales#70, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#71] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#71) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#71 as decimal(32,6)) > cast(Subquery scalar-subquery#72, [id=#73] as decimal(32,6)))) + +(90) Project [codegen id : 92] +Output [6]: [store AS channel#74, i_brand_id#55, i_class_id#56, i_category_id#57, sales#69, number_sales#70] +Input [6]: [i_brand_id#55, i_class_id#56, i_category_id#57, sales#69, number_sales#70, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#71] + +(91) Scan parquet default.store_sales +Output [4]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, ss_sold_date_sk#78] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#78), dynamicpruningexpression(ss_sold_date_sk#78 IN dynamicpruning#79)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(92) ColumnarToRow [codegen id : 46] +Input [4]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, ss_sold_date_sk#78] + +(93) Filter [codegen id : 46] +Input [4]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, ss_sold_date_sk#78] +Condition : isnotnull(ss_item_sk#75) + +(94) Exchange +Input [4]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, ss_sold_date_sk#78] +Arguments: hashpartitioning(ss_item_sk#75, 5), ENSURE_REQUIREMENTS, [id=#80] + +(95) Sort [codegen id : 47] +Input [4]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, ss_sold_date_sk#78] +Arguments: [ss_item_sk#75 ASC NULLS FIRST], false, 0 + +(96) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#47] + +(97) Sort [codegen id : 66] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(98) SortMergeJoin [codegen id : 90] +Left keys [1]: [ss_item_sk#75] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(99) Scan parquet default.date_dim +Output [2]: [d_date_sk#81, d_week_seq#82] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(100) ColumnarToRow [codegen id : 67] +Input [2]: [d_date_sk#81, d_week_seq#82] + +(101) Filter [codegen id : 67] +Input [2]: [d_date_sk#81, d_week_seq#82] +Condition : ((isnotnull(d_week_seq#82) AND (d_week_seq#82 = Subquery scalar-subquery#83, [id=#84])) AND isnotnull(d_date_sk#81)) + +(102) Project [codegen id : 67] +Output [1]: [d_date_sk#81] +Input [2]: [d_date_sk#81, d_week_seq#82] + +(103) BroadcastExchange +Input [1]: [d_date_sk#81] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#85] + +(104) BroadcastHashJoin [codegen id : 90] +Left keys [1]: [ss_sold_date_sk#78] +Right keys [1]: [d_date_sk#81] +Join condition: None + +(105) Project [codegen id : 90] +Output [3]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77] +Input [5]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, ss_sold_date_sk#78, d_date_sk#81] + +(106) ReusedExchange [Reuses operator id: 83] +Output [4]: [i_item_sk#86, i_brand_id#87, i_class_id#88, i_category_id#89] + +(107) BroadcastHashJoin [codegen id : 90] +Left keys [1]: [ss_item_sk#75] +Right keys [1]: [i_item_sk#86] +Join condition: None + +(108) Project [codegen id : 90] +Output [5]: [ss_quantity#76, ss_list_price#77, i_brand_id#87, i_class_id#88, i_category_id#89] +Input [7]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, i_item_sk#86, i_brand_id#87, i_class_id#88, i_category_id#89] + +(109) HashAggregate [codegen id : 90] +Input [5]: [ss_quantity#76, ss_list_price#77, i_brand_id#87, i_class_id#88, i_category_id#89] +Keys [3]: [i_brand_id#87, i_class_id#88, i_category_id#89] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#90, isEmpty#91, count#92] +Results [6]: [i_brand_id#87, i_class_id#88, i_category_id#89, sum#93, isEmpty#94, count#95] + +(110) Exchange +Input [6]: [i_brand_id#87, i_class_id#88, i_category_id#89, sum#93, isEmpty#94, count#95] +Arguments: hashpartitioning(i_brand_id#87, i_class_id#88, i_category_id#89, 5), ENSURE_REQUIREMENTS, [id=#96] + +(111) HashAggregate [codegen id : 91] +Input [6]: [i_brand_id#87, i_class_id#88, i_category_id#89, sum#93, isEmpty#94, count#95] +Keys [3]: [i_brand_id#87, i_class_id#88, i_category_id#89] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#97, count(1)#98] +Results [6]: [i_brand_id#87, i_class_id#88, i_category_id#89, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#97 AS sales#99, count(1)#98 AS number_sales#100, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#97 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#101] + +(112) Filter [codegen id : 91] +Input [6]: [i_brand_id#87, i_class_id#88, i_category_id#89, sales#99, number_sales#100, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#101] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#101) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#101 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#72, [id=#73] as decimal(32,6)))) + +(113) Project [codegen id : 91] +Output [6]: [store AS channel#102, i_brand_id#87, i_class_id#88, i_category_id#89, sales#99, number_sales#100] +Input [6]: [i_brand_id#87, i_class_id#88, i_category_id#89, sales#99, number_sales#100, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#101] + +(114) BroadcastExchange +Input [6]: [channel#102, i_brand_id#87, i_class_id#88, i_category_id#89, sales#99, number_sales#100] +Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true]),false), [id=#103] + +(115) BroadcastHashJoin [codegen id : 92] +Left keys [3]: [i_brand_id#55, i_class_id#56, i_category_id#57] +Right keys [3]: [i_brand_id#87, i_class_id#88, i_category_id#89] +Join condition: None + +(116) TakeOrderedAndProject +Input [12]: [channel#74, i_brand_id#55, i_class_id#56, i_category_id#57, sales#69, number_sales#70, channel#102, i_brand_id#87, i_class_id#88, i_category_id#89, sales#99, number_sales#100] +Arguments: 100, [i_brand_id#55 ASC NULLS FIRST, i_class_id#56 ASC NULLS FIRST, i_category_id#57 ASC NULLS FIRST], [channel#74, i_brand_id#55, i_class_id#56, i_category_id#57, sales#69, number_sales#70, channel#102, i_brand_id#87, i_class_id#88, i_category_id#89, sales#99, number_sales#100] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 89 Hosting Expression = Subquery scalar-subquery#72, [id=#73] +* HashAggregate (139) ++- Exchange (138) + +- * HashAggregate (137) + +- Union (136) + :- * Project (125) + : +- * BroadcastHashJoin Inner BuildRight (124) + : :- * ColumnarToRow (118) + : : +- Scan parquet default.store_sales (117) + : +- BroadcastExchange (123) + : +- * Project (122) + : +- * Filter (121) + : +- * ColumnarToRow (120) + : +- Scan parquet default.date_dim (119) + :- * Project (130) + : +- * BroadcastHashJoin Inner BuildRight (129) + : :- * ColumnarToRow (127) + : : +- Scan parquet default.catalog_sales (126) + : +- ReusedExchange (128) + +- * Project (135) + +- * BroadcastHashJoin Inner BuildRight (134) + :- * ColumnarToRow (132) + : +- Scan parquet default.web_sales (131) + +- ReusedExchange (133) + + +(117) Scan parquet default.store_sales +Output [3]: [ss_quantity#104, ss_list_price#105, ss_sold_date_sk#106] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#106), dynamicpruningexpression(ss_sold_date_sk#106 IN dynamicpruning#107)] +ReadSchema: struct + +(118) ColumnarToRow [codegen id : 2] +Input [3]: [ss_quantity#104, ss_list_price#105, ss_sold_date_sk#106] + +(119) Scan parquet default.date_dim +Output [2]: [d_date_sk#108, d_year#109] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(120) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#108, d_year#109] + +(121) Filter [codegen id : 1] +Input [2]: [d_date_sk#108, d_year#109] +Condition : (((isnotnull(d_year#109) AND (d_year#109 >= 1999)) AND (d_year#109 <= 2001)) AND isnotnull(d_date_sk#108)) + +(122) Project [codegen id : 1] +Output [1]: [d_date_sk#108] +Input [2]: [d_date_sk#108, d_year#109] + +(123) BroadcastExchange +Input [1]: [d_date_sk#108] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#110] + +(124) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#106] +Right keys [1]: [d_date_sk#108] +Join condition: None + +(125) Project [codegen id : 2] +Output [2]: [ss_quantity#104 AS quantity#111, ss_list_price#105 AS list_price#112] +Input [4]: [ss_quantity#104, ss_list_price#105, ss_sold_date_sk#106, d_date_sk#108] + +(126) Scan parquet default.catalog_sales +Output [3]: [cs_quantity#113, cs_list_price#114, cs_sold_date_sk#115] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#115), dynamicpruningexpression(cs_sold_date_sk#115 IN dynamicpruning#107)] +ReadSchema: struct + +(127) ColumnarToRow [codegen id : 4] +Input [3]: [cs_quantity#113, cs_list_price#114, cs_sold_date_sk#115] + +(128) ReusedExchange [Reuses operator id: 123] +Output [1]: [d_date_sk#116] + +(129) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#115] +Right keys [1]: [d_date_sk#116] +Join condition: None + +(130) Project [codegen id : 4] +Output [2]: [cs_quantity#113 AS quantity#117, cs_list_price#114 AS list_price#118] +Input [4]: [cs_quantity#113, cs_list_price#114, cs_sold_date_sk#115, d_date_sk#116] + +(131) Scan parquet default.web_sales +Output [3]: [ws_quantity#119, ws_list_price#120, ws_sold_date_sk#121] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#121), dynamicpruningexpression(ws_sold_date_sk#121 IN dynamicpruning#107)] +ReadSchema: struct + +(132) ColumnarToRow [codegen id : 6] +Input [3]: [ws_quantity#119, ws_list_price#120, ws_sold_date_sk#121] + +(133) ReusedExchange [Reuses operator id: 123] +Output [1]: [d_date_sk#122] + +(134) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#121] +Right keys [1]: [d_date_sk#122] +Join condition: None + +(135) Project [codegen id : 6] +Output [2]: [ws_quantity#119 AS quantity#123, ws_list_price#120 AS list_price#124] +Input [4]: [ws_quantity#119, ws_list_price#120, ws_sold_date_sk#121, d_date_sk#122] + +(136) Union + +(137) HashAggregate [codegen id : 7] +Input [2]: [quantity#111, list_price#112] +Keys: [] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#111 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#112 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#125, count#126] +Results [2]: [sum#127, count#128] + +(138) Exchange +Input [2]: [sum#127, count#128] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#129] + +(139) HashAggregate [codegen id : 8] +Input [2]: [sum#127, count#128] +Keys: [] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#111 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#112 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#111 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#112 as decimal(12,2)))), DecimalType(18,2), true))#130] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#111 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#112 as decimal(12,2)))), DecimalType(18,2), true))#130 AS average_sales#131] + +Subquery:2 Hosting operator id = 117 Hosting Expression = ss_sold_date_sk#106 IN dynamicpruning#107 +ReusedExchange (140) + + +(140) ReusedExchange [Reuses operator id: 123] +Output [1]: [d_date_sk#108] + +Subquery:3 Hosting operator id = 126 Hosting Expression = cs_sold_date_sk#115 IN dynamicpruning#107 + +Subquery:4 Hosting operator id = 131 Hosting Expression = ws_sold_date_sk#121 IN dynamicpruning#107 + +Subquery:5 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (141) + + +(141) ReusedExchange [Reuses operator id: 72] +Output [1]: [d_date_sk#49] + +Subquery:6 Hosting operator id = 9 Hosting Expression = ss_sold_date_sk#12 IN dynamicpruning#13 +ReusedExchange (142) + + +(142) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#14] + +Subquery:7 Hosting operator id = 24 Hosting Expression = cs_sold_date_sk#23 IN dynamicpruning#13 + +Subquery:8 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#38 IN dynamicpruning#13 + +Subquery:9 Hosting operator id = 70 Hosting Expression = Subquery scalar-subquery#51, [id=#52] +* Project (146) ++- * Filter (145) + +- * ColumnarToRow (144) + +- Scan parquet default.date_dim (143) + + +(143) Scan parquet default.date_dim +Output [4]: [d_week_seq#132, d_year#133, d_moy#134, d_dom#135] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,2000), EqualTo(d_moy,12), EqualTo(d_dom,11)] +ReadSchema: struct + +(144) ColumnarToRow [codegen id : 1] +Input [4]: [d_week_seq#132, d_year#133, d_moy#134, d_dom#135] + +(145) Filter [codegen id : 1] +Input [4]: [d_week_seq#132, d_year#133, d_moy#134, d_dom#135] +Condition : (((((isnotnull(d_year#133) AND isnotnull(d_moy#134)) AND isnotnull(d_dom#135)) AND (d_year#133 = 2000)) AND (d_moy#134 = 12)) AND (d_dom#135 = 11)) + +(146) Project [codegen id : 1] +Output [1]: [d_week_seq#132] +Input [4]: [d_week_seq#132, d_year#133, d_moy#134, d_dom#135] + +Subquery:10 Hosting operator id = 112 Hosting Expression = ReusedSubquery Subquery scalar-subquery#72, [id=#73] + +Subquery:11 Hosting operator id = 91 Hosting Expression = ss_sold_date_sk#78 IN dynamicpruning#79 +ReusedExchange (147) + + +(147) ReusedExchange [Reuses operator id: 103] +Output [1]: [d_date_sk#81] + +Subquery:12 Hosting operator id = 101 Hosting Expression = Subquery scalar-subquery#83, [id=#84] +* Project (151) ++- * Filter (150) + +- * ColumnarToRow (149) + +- Scan parquet default.date_dim (148) + + +(148) Scan parquet default.date_dim +Output [4]: [d_week_seq#136, d_year#137, d_moy#138, d_dom#139] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1999), EqualTo(d_moy,12), EqualTo(d_dom,11)] +ReadSchema: struct + +(149) ColumnarToRow [codegen id : 1] +Input [4]: [d_week_seq#136, d_year#137, d_moy#138, d_dom#139] + +(150) Filter [codegen id : 1] +Input [4]: [d_week_seq#136, d_year#137, d_moy#138, d_dom#139] +Condition : (((((isnotnull(d_year#137) AND isnotnull(d_moy#138)) AND isnotnull(d_dom#139)) AND (d_year#137 = 1999)) AND (d_moy#138 = 12)) AND (d_dom#139 = 11)) + +(151) Project [codegen id : 1] +Output [1]: [d_week_seq#136] +Input [4]: [d_week_seq#136, d_year#137, d_moy#138, d_dom#139] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/simplified.txt new file mode 100644 index 0000000000000..6a8fcada7a61b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b.sf100/simplified.txt @@ -0,0 +1,261 @@ +TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_sales,channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + WholeStageCodegen (92) + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id] + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + Subquery #4 + WholeStageCodegen (8) + HashAggregate [sum,count] [avg(CheckOverflow((promote_precision(cast(cast(quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price as decimal(12,2)))), DecimalType(18,2), true)),average_sales,sum,count] + InputAdapter + Exchange #18 + WholeStageCodegen (7) + HashAggregate [quantity,list_price] [sum,count,sum,count] + InputAdapter + Union + WholeStageCodegen (2) + Project [ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #5 + ReusedExchange [d_date_sk] #19 + InputAdapter + BroadcastExchange #19 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + WholeStageCodegen (4) + Project [cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_quantity,cs_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #5 + InputAdapter + ReusedExchange [d_date_sk] #19 + WholeStageCodegen (6) + Project [ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #5 + InputAdapter + ReusedExchange [d_date_sk] #19 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #1 + WholeStageCodegen (45) + HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + SortMergeJoin [ss_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #2 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + WholeStageCodegen (21) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (20) + Project [i_item_sk] + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id] + Filter [i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (19) + HashAggregate [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #6 + WholeStageCodegen (18) + HashAggregate [brand_id,class_id,category_id] + SortMergeJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (13) + Sort [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #7 + WholeStageCodegen (12) + HashAggregate [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #8 + WholeStageCodegen (11) + HashAggregate [brand_id,class_id,category_id] + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (10) + SortMergeJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (5) + Sort [i_brand_id,i_class_id,i_category_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #11 + WholeStageCodegen (4) + Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (9) + Sort [i_brand_id,i_class_id,i_category_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #12 + WholeStageCodegen (8) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk] #9 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (7) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (17) + Sort [i_brand_id,i_class_id,i_category_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #14 + WholeStageCodegen (16) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk] #9 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #13 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (22) + Project [d_date_sk] + Filter [d_week_seq,d_date_sk] + Subquery #3 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (44) + SortMergeJoin [i_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (24) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #16 + WholeStageCodegen (23) + Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (43) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk] #17 + InputAdapter + BroadcastExchange #20 + WholeStageCodegen (91) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #4 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #21 + WholeStageCodegen (90) + HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + SortMergeJoin [ss_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (47) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #22 + WholeStageCodegen (46) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #6 + ReusedExchange [d_date_sk] #23 + InputAdapter + WholeStageCodegen (66) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk] #17 + InputAdapter + BroadcastExchange #23 + WholeStageCodegen (67) + Project [d_date_sk] + Filter [d_week_seq,d_date_sk] + Subquery #7 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #15 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt new file mode 100644 index 0000000000000..ae653b43971db --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/explain.txt @@ -0,0 +1,789 @@ +== Physical Plan == +TakeOrderedAndProject (100) ++- * BroadcastHashJoin Inner BuildRight (99) + :- * Project (77) + : +- * Filter (76) + : +- * HashAggregate (75) + : +- Exchange (74) + : +- * HashAggregate (73) + : +- * Project (72) + : +- * BroadcastHashJoin Inner BuildRight (71) + : :- * Project (65) + : : +- * BroadcastHashJoin Inner BuildRight (64) + : : :- * BroadcastHashJoin LeftSemi BuildRight (57) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (56) + : : : +- * Project (55) + : : : +- * BroadcastHashJoin Inner BuildRight (54) + : : : :- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.item (4) + : : : +- BroadcastExchange (53) + : : : +- * HashAggregate (52) + : : : +- * HashAggregate (51) + : : : +- * BroadcastHashJoin LeftSemi BuildRight (50) + : : : :- * HashAggregate (39) + : : : : +- Exchange (38) + : : : : +- * HashAggregate (37) + : : : : +- * Project (36) + : : : : +- * BroadcastHashJoin Inner BuildRight (35) + : : : : :- * Project (33) + : : : : : +- * BroadcastHashJoin Inner BuildRight (32) + : : : : : :- * Filter (9) + : : : : : : +- * ColumnarToRow (8) + : : : : : : +- Scan parquet default.store_sales (7) + : : : : : +- BroadcastExchange (31) + : : : : : +- * BroadcastHashJoin LeftSemi BuildRight (30) + : : : : : :- * Filter (12) + : : : : : : +- * ColumnarToRow (11) + : : : : : : +- Scan parquet default.item (10) + : : : : : +- BroadcastExchange (29) + : : : : : +- * Project (28) + : : : : : +- * BroadcastHashJoin Inner BuildRight (27) + : : : : : :- * Project (21) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : : : : :- * Filter (15) + : : : : : : : +- * ColumnarToRow (14) + : : : : : : : +- Scan parquet default.catalog_sales (13) + : : : : : : +- BroadcastExchange (19) + : : : : : : +- * Filter (18) + : : : : : : +- * ColumnarToRow (17) + : : : : : : +- Scan parquet default.item (16) + : : : : : +- BroadcastExchange (26) + : : : : : +- * Project (25) + : : : : : +- * Filter (24) + : : : : : +- * ColumnarToRow (23) + : : : : : +- Scan parquet default.date_dim (22) + : : : : +- ReusedExchange (34) + : : : +- BroadcastExchange (49) + : : : +- * Project (48) + : : : +- * BroadcastHashJoin Inner BuildRight (47) + : : : :- * Project (45) + : : : : +- * BroadcastHashJoin Inner BuildRight (44) + : : : : :- * Filter (42) + : : : : : +- * ColumnarToRow (41) + : : : : : +- Scan parquet default.web_sales (40) + : : : : +- ReusedExchange (43) + : : : +- ReusedExchange (46) + : : +- BroadcastExchange (63) + : : +- * BroadcastHashJoin LeftSemi BuildRight (62) + : : :- * Filter (60) + : : : +- * ColumnarToRow (59) + : : : +- Scan parquet default.item (58) + : : +- ReusedExchange (61) + : +- BroadcastExchange (70) + : +- * Project (69) + : +- * Filter (68) + : +- * ColumnarToRow (67) + : +- Scan parquet default.date_dim (66) + +- BroadcastExchange (98) + +- * Project (97) + +- * Filter (96) + +- * HashAggregate (95) + +- Exchange (94) + +- * HashAggregate (93) + +- * Project (92) + +- * BroadcastHashJoin Inner BuildRight (91) + :- * Project (85) + : +- * BroadcastHashJoin Inner BuildRight (84) + : :- * BroadcastHashJoin LeftSemi BuildRight (82) + : : :- * Filter (80) + : : : +- * ColumnarToRow (79) + : : : +- Scan parquet default.store_sales (78) + : : +- ReusedExchange (81) + : +- ReusedExchange (83) + +- BroadcastExchange (90) + +- * Project (89) + +- * Filter (88) + +- * ColumnarToRow (87) + +- Scan parquet default.date_dim (86) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 25] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 25] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 11] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] + +(6) Filter [codegen id : 11] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Condition : ((isnotnull(i_brand_id#7) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) + +(7) Scan parquet default.store_sales +Output [2]: [ss_item_sk#10, ss_sold_date_sk#11] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#11), dynamicpruningexpression(ss_sold_date_sk#11 IN dynamicpruning#12)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 6] +Input [2]: [ss_item_sk#10, ss_sold_date_sk#11] + +(9) Filter [codegen id : 6] +Input [2]: [ss_item_sk#10, ss_sold_date_sk#11] +Condition : isnotnull(ss_item_sk#10) + +(10) Scan parquet default.item +Output [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 4] +Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] + +(12) Filter [codegen id : 4] +Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] +Condition : (((isnotnull(i_item_sk#13) AND isnotnull(i_brand_id#14)) AND isnotnull(i_class_id#15)) AND isnotnull(i_category_id#16)) + +(13) Scan parquet default.catalog_sales +Output [2]: [cs_item_sk#17, cs_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#12)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 3] +Input [2]: [cs_item_sk#17, cs_sold_date_sk#18] + +(15) Filter [codegen id : 3] +Input [2]: [cs_item_sk#17, cs_sold_date_sk#18] +Condition : isnotnull(cs_item_sk#17) + +(16) Scan parquet default.item +Output [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] + +(18) Filter [codegen id : 1] +Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] +Condition : isnotnull(i_item_sk#19) + +(19) BroadcastExchange +Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(20) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_item_sk#17] +Right keys [1]: [i_item_sk#19] +Join condition: None + +(21) Project [codegen id : 3] +Output [4]: [cs_sold_date_sk#18, i_brand_id#20, i_class_id#21, i_category_id#22] +Input [6]: [cs_item_sk#17, cs_sold_date_sk#18, i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] + +(22) Scan parquet default.date_dim +Output [2]: [d_date_sk#24, d_year#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#24, d_year#25] + +(24) Filter [codegen id : 2] +Input [2]: [d_date_sk#24, d_year#25] +Condition : (((isnotnull(d_year#25) AND (d_year#25 >= 1999)) AND (d_year#25 <= 2001)) AND isnotnull(d_date_sk#24)) + +(25) Project [codegen id : 2] +Output [1]: [d_date_sk#24] +Input [2]: [d_date_sk#24, d_year#25] + +(26) BroadcastExchange +Input [1]: [d_date_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] + +(27) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(28) Project [codegen id : 3] +Output [3]: [i_brand_id#20, i_class_id#21, i_category_id#22] +Input [5]: [cs_sold_date_sk#18, i_brand_id#20, i_class_id#21, i_category_id#22, d_date_sk#24] + +(29) BroadcastExchange +Input [3]: [i_brand_id#20, i_class_id#21, i_category_id#22] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [id=#27] + +(30) BroadcastHashJoin [codegen id : 4] +Left keys [6]: [coalesce(i_brand_id#14, 0), isnull(i_brand_id#14), coalesce(i_class_id#15, 0), isnull(i_class_id#15), coalesce(i_category_id#16, 0), isnull(i_category_id#16)] +Right keys [6]: [coalesce(i_brand_id#20, 0), isnull(i_brand_id#20), coalesce(i_class_id#21, 0), isnull(i_class_id#21), coalesce(i_category_id#22, 0), isnull(i_category_id#22)] +Join condition: None + +(31) BroadcastExchange +Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#28] + +(32) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#10] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(33) Project [codegen id : 6] +Output [4]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16] +Input [6]: [ss_item_sk#10, ss_sold_date_sk#11, i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] + +(34) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#29] + +(35) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#11] +Right keys [1]: [d_date_sk#29] +Join condition: None + +(36) Project [codegen id : 6] +Output [3]: [i_brand_id#14 AS brand_id#30, i_class_id#15 AS class_id#31, i_category_id#16 AS category_id#32] +Input [5]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16, d_date_sk#29] + +(37) HashAggregate [codegen id : 6] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(38) Exchange +Input [3]: [brand_id#30, class_id#31, category_id#32] +Arguments: hashpartitioning(brand_id#30, class_id#31, category_id#32, 5), ENSURE_REQUIREMENTS, [id=#33] + +(39) HashAggregate [codegen id : 10] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(40) Scan parquet default.web_sales +Output [2]: [ws_item_sk#34, ws_sold_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#35), dynamicpruningexpression(ws_sold_date_sk#35 IN dynamicpruning#12)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 9] +Input [2]: [ws_item_sk#34, ws_sold_date_sk#35] + +(42) Filter [codegen id : 9] +Input [2]: [ws_item_sk#34, ws_sold_date_sk#35] +Condition : isnotnull(ws_item_sk#34) + +(43) ReusedExchange [Reuses operator id: 19] +Output [4]: [i_item_sk#36, i_brand_id#37, i_class_id#38, i_category_id#39] + +(44) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ws_item_sk#34] +Right keys [1]: [i_item_sk#36] +Join condition: None + +(45) Project [codegen id : 9] +Output [4]: [ws_sold_date_sk#35, i_brand_id#37, i_class_id#38, i_category_id#39] +Input [6]: [ws_item_sk#34, ws_sold_date_sk#35, i_item_sk#36, i_brand_id#37, i_class_id#38, i_category_id#39] + +(46) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#40] + +(47) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ws_sold_date_sk#35] +Right keys [1]: [d_date_sk#40] +Join condition: None + +(48) Project [codegen id : 9] +Output [3]: [i_brand_id#37, i_class_id#38, i_category_id#39] +Input [5]: [ws_sold_date_sk#35, i_brand_id#37, i_class_id#38, i_category_id#39, d_date_sk#40] + +(49) BroadcastExchange +Input [3]: [i_brand_id#37, i_class_id#38, i_category_id#39] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [id=#41] + +(50) BroadcastHashJoin [codegen id : 10] +Left keys [6]: [coalesce(brand_id#30, 0), isnull(brand_id#30), coalesce(class_id#31, 0), isnull(class_id#31), coalesce(category_id#32, 0), isnull(category_id#32)] +Right keys [6]: [coalesce(i_brand_id#37, 0), isnull(i_brand_id#37), coalesce(i_class_id#38, 0), isnull(i_class_id#38), coalesce(i_category_id#39, 0), isnull(i_category_id#39)] +Join condition: None + +(51) HashAggregate [codegen id : 10] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(52) HashAggregate [codegen id : 10] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(53) BroadcastExchange +Input [3]: [brand_id#30, class_id#31, category_id#32] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#42] + +(54) BroadcastHashJoin [codegen id : 11] +Left keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Right keys [3]: [brand_id#30, class_id#31, category_id#32] +Join condition: None + +(55) Project [codegen id : 11] +Output [1]: [i_item_sk#6 AS ss_item_sk#43] +Input [7]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, brand_id#30, class_id#31, category_id#32] + +(56) BroadcastExchange +Input [1]: [ss_item_sk#43] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] + +(57) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(58) Scan parquet default.item +Output [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(59) ColumnarToRow [codegen id : 23] +Input [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] + +(60) Filter [codegen id : 23] +Input [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] +Condition : (((isnotnull(i_item_sk#45) AND isnotnull(i_brand_id#46)) AND isnotnull(i_class_id#47)) AND isnotnull(i_category_id#48)) + +(61) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#43] + +(62) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [i_item_sk#45] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(63) BroadcastExchange +Input [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#49] + +(64) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#45] +Join condition: None + +(65) Project [codegen id : 25] +Output [6]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#46, i_class_id#47, i_category_id#48] +Input [8]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] + +(66) Scan parquet default.date_dim +Output [2]: [d_date_sk#50, d_week_seq#51] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(67) ColumnarToRow [codegen id : 24] +Input [2]: [d_date_sk#50, d_week_seq#51] + +(68) Filter [codegen id : 24] +Input [2]: [d_date_sk#50, d_week_seq#51] +Condition : ((isnotnull(d_week_seq#51) AND (d_week_seq#51 = Subquery scalar-subquery#52, [id=#53])) AND isnotnull(d_date_sk#50)) + +(69) Project [codegen id : 24] +Output [1]: [d_date_sk#50] +Input [2]: [d_date_sk#50, d_week_seq#51] + +(70) BroadcastExchange +Input [1]: [d_date_sk#50] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#54] + +(71) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#50] +Join condition: None + +(72) Project [codegen id : 25] +Output [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#46, i_class_id#47, i_category_id#48] +Input [7]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#46, i_class_id#47, i_category_id#48, d_date_sk#50] + +(73) HashAggregate [codegen id : 25] +Input [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#46, i_class_id#47, i_category_id#48] +Keys [3]: [i_brand_id#46, i_class_id#47, i_category_id#48] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#55, isEmpty#56, count#57] +Results [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum#58, isEmpty#59, count#60] + +(74) Exchange +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum#58, isEmpty#59, count#60] +Arguments: hashpartitioning(i_brand_id#46, i_class_id#47, i_category_id#48, 5), ENSURE_REQUIREMENTS, [id=#61] + +(75) HashAggregate [codegen id : 52] +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum#58, isEmpty#59, count#60] +Keys [3]: [i_brand_id#46, i_class_id#47, i_category_id#48] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#62, count(1)#63] +Results [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#62 AS sales#64, count(1)#63 AS number_sales#65, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#62 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66] + +(76) Filter [codegen id : 52] +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sales#64, number_sales#65, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66 as decimal(32,6)) > cast(Subquery scalar-subquery#67, [id=#68] as decimal(32,6)))) + +(77) Project [codegen id : 52] +Output [6]: [store AS channel#69, i_brand_id#46, i_class_id#47, i_category_id#48, sales#64, number_sales#65] +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sales#64, number_sales#65, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66] + +(78) Scan parquet default.store_sales +Output [4]: [ss_item_sk#70, ss_quantity#71, ss_list_price#72, ss_sold_date_sk#73] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#73), dynamicpruningexpression(ss_sold_date_sk#73 IN dynamicpruning#74)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(79) ColumnarToRow [codegen id : 50] +Input [4]: [ss_item_sk#70, ss_quantity#71, ss_list_price#72, ss_sold_date_sk#73] + +(80) Filter [codegen id : 50] +Input [4]: [ss_item_sk#70, ss_quantity#71, ss_list_price#72, ss_sold_date_sk#73] +Condition : isnotnull(ss_item_sk#70) + +(81) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#43] + +(82) BroadcastHashJoin [codegen id : 50] +Left keys [1]: [ss_item_sk#70] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(83) ReusedExchange [Reuses operator id: 63] +Output [4]: [i_item_sk#75, i_brand_id#76, i_class_id#77, i_category_id#78] + +(84) BroadcastHashJoin [codegen id : 50] +Left keys [1]: [ss_item_sk#70] +Right keys [1]: [i_item_sk#75] +Join condition: None + +(85) Project [codegen id : 50] +Output [6]: [ss_quantity#71, ss_list_price#72, ss_sold_date_sk#73, i_brand_id#76, i_class_id#77, i_category_id#78] +Input [8]: [ss_item_sk#70, ss_quantity#71, ss_list_price#72, ss_sold_date_sk#73, i_item_sk#75, i_brand_id#76, i_class_id#77, i_category_id#78] + +(86) Scan parquet default.date_dim +Output [2]: [d_date_sk#79, d_week_seq#80] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(87) ColumnarToRow [codegen id : 49] +Input [2]: [d_date_sk#79, d_week_seq#80] + +(88) Filter [codegen id : 49] +Input [2]: [d_date_sk#79, d_week_seq#80] +Condition : ((isnotnull(d_week_seq#80) AND (d_week_seq#80 = Subquery scalar-subquery#81, [id=#82])) AND isnotnull(d_date_sk#79)) + +(89) Project [codegen id : 49] +Output [1]: [d_date_sk#79] +Input [2]: [d_date_sk#79, d_week_seq#80] + +(90) BroadcastExchange +Input [1]: [d_date_sk#79] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#83] + +(91) BroadcastHashJoin [codegen id : 50] +Left keys [1]: [ss_sold_date_sk#73] +Right keys [1]: [d_date_sk#79] +Join condition: None + +(92) Project [codegen id : 50] +Output [5]: [ss_quantity#71, ss_list_price#72, i_brand_id#76, i_class_id#77, i_category_id#78] +Input [7]: [ss_quantity#71, ss_list_price#72, ss_sold_date_sk#73, i_brand_id#76, i_class_id#77, i_category_id#78, d_date_sk#79] + +(93) HashAggregate [codegen id : 50] +Input [5]: [ss_quantity#71, ss_list_price#72, i_brand_id#76, i_class_id#77, i_category_id#78] +Keys [3]: [i_brand_id#76, i_class_id#77, i_category_id#78] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#84, isEmpty#85, count#86] +Results [6]: [i_brand_id#76, i_class_id#77, i_category_id#78, sum#87, isEmpty#88, count#89] + +(94) Exchange +Input [6]: [i_brand_id#76, i_class_id#77, i_category_id#78, sum#87, isEmpty#88, count#89] +Arguments: hashpartitioning(i_brand_id#76, i_class_id#77, i_category_id#78, 5), ENSURE_REQUIREMENTS, [id=#90] + +(95) HashAggregate [codegen id : 51] +Input [6]: [i_brand_id#76, i_class_id#77, i_category_id#78, sum#87, isEmpty#88, count#89] +Keys [3]: [i_brand_id#76, i_class_id#77, i_category_id#78] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#91, count(1)#92] +Results [6]: [i_brand_id#76, i_class_id#77, i_category_id#78, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#91 AS sales#93, count(1)#92 AS number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#91 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#95] + +(96) Filter [codegen id : 51] +Input [6]: [i_brand_id#76, i_class_id#77, i_category_id#78, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#95] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#95) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#95 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#67, [id=#68] as decimal(32,6)))) + +(97) Project [codegen id : 51] +Output [6]: [store AS channel#96, i_brand_id#76, i_class_id#77, i_category_id#78, sales#93, number_sales#94] +Input [6]: [i_brand_id#76, i_class_id#77, i_category_id#78, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#95] + +(98) BroadcastExchange +Input [6]: [channel#96, i_brand_id#76, i_class_id#77, i_category_id#78, sales#93, number_sales#94] +Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true]),false), [id=#97] + +(99) BroadcastHashJoin [codegen id : 52] +Left keys [3]: [i_brand_id#46, i_class_id#47, i_category_id#48] +Right keys [3]: [i_brand_id#76, i_class_id#77, i_category_id#78] +Join condition: None + +(100) TakeOrderedAndProject +Input [12]: [channel#69, i_brand_id#46, i_class_id#47, i_category_id#48, sales#64, number_sales#65, channel#96, i_brand_id#76, i_class_id#77, i_category_id#78, sales#93, number_sales#94] +Arguments: 100, [i_brand_id#46 ASC NULLS FIRST, i_class_id#47 ASC NULLS FIRST, i_category_id#48 ASC NULLS FIRST], [channel#69, i_brand_id#46, i_class_id#47, i_category_id#48, sales#64, number_sales#65, channel#96, i_brand_id#76, i_class_id#77, i_category_id#78, sales#93, number_sales#94] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 76 Hosting Expression = Subquery scalar-subquery#67, [id=#68] +* HashAggregate (123) ++- Exchange (122) + +- * HashAggregate (121) + +- Union (120) + :- * Project (109) + : +- * BroadcastHashJoin Inner BuildRight (108) + : :- * ColumnarToRow (102) + : : +- Scan parquet default.store_sales (101) + : +- BroadcastExchange (107) + : +- * Project (106) + : +- * Filter (105) + : +- * ColumnarToRow (104) + : +- Scan parquet default.date_dim (103) + :- * Project (114) + : +- * BroadcastHashJoin Inner BuildRight (113) + : :- * ColumnarToRow (111) + : : +- Scan parquet default.catalog_sales (110) + : +- ReusedExchange (112) + +- * Project (119) + +- * BroadcastHashJoin Inner BuildRight (118) + :- * ColumnarToRow (116) + : +- Scan parquet default.web_sales (115) + +- ReusedExchange (117) + + +(101) Scan parquet default.store_sales +Output [3]: [ss_quantity#98, ss_list_price#99, ss_sold_date_sk#100] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#100), dynamicpruningexpression(ss_sold_date_sk#100 IN dynamicpruning#101)] +ReadSchema: struct + +(102) ColumnarToRow [codegen id : 2] +Input [3]: [ss_quantity#98, ss_list_price#99, ss_sold_date_sk#100] + +(103) Scan parquet default.date_dim +Output [2]: [d_date_sk#102, d_year#103] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(104) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#102, d_year#103] + +(105) Filter [codegen id : 1] +Input [2]: [d_date_sk#102, d_year#103] +Condition : (((isnotnull(d_year#103) AND (d_year#103 >= 1999)) AND (d_year#103 <= 2001)) AND isnotnull(d_date_sk#102)) + +(106) Project [codegen id : 1] +Output [1]: [d_date_sk#102] +Input [2]: [d_date_sk#102, d_year#103] + +(107) BroadcastExchange +Input [1]: [d_date_sk#102] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#104] + +(108) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#100] +Right keys [1]: [d_date_sk#102] +Join condition: None + +(109) Project [codegen id : 2] +Output [2]: [ss_quantity#98 AS quantity#105, ss_list_price#99 AS list_price#106] +Input [4]: [ss_quantity#98, ss_list_price#99, ss_sold_date_sk#100, d_date_sk#102] + +(110) Scan parquet default.catalog_sales +Output [3]: [cs_quantity#107, cs_list_price#108, cs_sold_date_sk#109] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#109), dynamicpruningexpression(cs_sold_date_sk#109 IN dynamicpruning#101)] +ReadSchema: struct + +(111) ColumnarToRow [codegen id : 4] +Input [3]: [cs_quantity#107, cs_list_price#108, cs_sold_date_sk#109] + +(112) ReusedExchange [Reuses operator id: 107] +Output [1]: [d_date_sk#110] + +(113) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#109] +Right keys [1]: [d_date_sk#110] +Join condition: None + +(114) Project [codegen id : 4] +Output [2]: [cs_quantity#107 AS quantity#111, cs_list_price#108 AS list_price#112] +Input [4]: [cs_quantity#107, cs_list_price#108, cs_sold_date_sk#109, d_date_sk#110] + +(115) Scan parquet default.web_sales +Output [3]: [ws_quantity#113, ws_list_price#114, ws_sold_date_sk#115] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#115), dynamicpruningexpression(ws_sold_date_sk#115 IN dynamicpruning#101)] +ReadSchema: struct + +(116) ColumnarToRow [codegen id : 6] +Input [3]: [ws_quantity#113, ws_list_price#114, ws_sold_date_sk#115] + +(117) ReusedExchange [Reuses operator id: 107] +Output [1]: [d_date_sk#116] + +(118) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#115] +Right keys [1]: [d_date_sk#116] +Join condition: None + +(119) Project [codegen id : 6] +Output [2]: [ws_quantity#113 AS quantity#117, ws_list_price#114 AS list_price#118] +Input [4]: [ws_quantity#113, ws_list_price#114, ws_sold_date_sk#115, d_date_sk#116] + +(120) Union + +(121) HashAggregate [codegen id : 7] +Input [2]: [quantity#105, list_price#106] +Keys: [] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#105 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#106 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#119, count#120] +Results [2]: [sum#121, count#122] + +(122) Exchange +Input [2]: [sum#121, count#122] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#123] + +(123) HashAggregate [codegen id : 8] +Input [2]: [sum#121, count#122] +Keys: [] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#105 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#106 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#105 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#106 as decimal(12,2)))), DecimalType(18,2), true))#124] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#105 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#106 as decimal(12,2)))), DecimalType(18,2), true))#124 AS average_sales#125] + +Subquery:2 Hosting operator id = 101 Hosting Expression = ss_sold_date_sk#100 IN dynamicpruning#101 +ReusedExchange (124) + + +(124) ReusedExchange [Reuses operator id: 107] +Output [1]: [d_date_sk#102] + +Subquery:3 Hosting operator id = 110 Hosting Expression = cs_sold_date_sk#109 IN dynamicpruning#101 + +Subquery:4 Hosting operator id = 115 Hosting Expression = ws_sold_date_sk#115 IN dynamicpruning#101 + +Subquery:5 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (125) + + +(125) ReusedExchange [Reuses operator id: 70] +Output [1]: [d_date_sk#50] + +Subquery:6 Hosting operator id = 7 Hosting Expression = ss_sold_date_sk#11 IN dynamicpruning#12 +ReusedExchange (126) + + +(126) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#29] + +Subquery:7 Hosting operator id = 13 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#12 + +Subquery:8 Hosting operator id = 40 Hosting Expression = ws_sold_date_sk#35 IN dynamicpruning#12 + +Subquery:9 Hosting operator id = 68 Hosting Expression = Subquery scalar-subquery#52, [id=#53] +* Project (130) ++- * Filter (129) + +- * ColumnarToRow (128) + +- Scan parquet default.date_dim (127) + + +(127) Scan parquet default.date_dim +Output [4]: [d_week_seq#126, d_year#127, d_moy#128, d_dom#129] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,2000), EqualTo(d_moy,12), EqualTo(d_dom,11)] +ReadSchema: struct + +(128) ColumnarToRow [codegen id : 1] +Input [4]: [d_week_seq#126, d_year#127, d_moy#128, d_dom#129] + +(129) Filter [codegen id : 1] +Input [4]: [d_week_seq#126, d_year#127, d_moy#128, d_dom#129] +Condition : (((((isnotnull(d_year#127) AND isnotnull(d_moy#128)) AND isnotnull(d_dom#129)) AND (d_year#127 = 2000)) AND (d_moy#128 = 12)) AND (d_dom#129 = 11)) + +(130) Project [codegen id : 1] +Output [1]: [d_week_seq#126] +Input [4]: [d_week_seq#126, d_year#127, d_moy#128, d_dom#129] + +Subquery:10 Hosting operator id = 96 Hosting Expression = ReusedSubquery Subquery scalar-subquery#67, [id=#68] + +Subquery:11 Hosting operator id = 78 Hosting Expression = ss_sold_date_sk#73 IN dynamicpruning#74 +ReusedExchange (131) + + +(131) ReusedExchange [Reuses operator id: 90] +Output [1]: [d_date_sk#79] + +Subquery:12 Hosting operator id = 88 Hosting Expression = Subquery scalar-subquery#81, [id=#82] +* Project (135) ++- * Filter (134) + +- * ColumnarToRow (133) + +- Scan parquet default.date_dim (132) + + +(132) Scan parquet default.date_dim +Output [4]: [d_week_seq#130, d_year#131, d_moy#132, d_dom#133] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1999), EqualTo(d_moy,12), EqualTo(d_dom,11)] +ReadSchema: struct + +(133) ColumnarToRow [codegen id : 1] +Input [4]: [d_week_seq#130, d_year#131, d_moy#132, d_dom#133] + +(134) Filter [codegen id : 1] +Input [4]: [d_week_seq#130, d_year#131, d_moy#132, d_dom#133] +Condition : (((((isnotnull(d_year#131) AND isnotnull(d_moy#132)) AND isnotnull(d_dom#133)) AND (d_year#131 = 1999)) AND (d_moy#132 = 12)) AND (d_dom#133 = 11)) + +(135) Project [codegen id : 1] +Output [1]: [d_week_seq#130] +Input [4]: [d_week_seq#130, d_year#131, d_moy#132, d_dom#133] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt new file mode 100644 index 0000000000000..cb9b410ea8568 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q14b/simplified.txt @@ -0,0 +1,213 @@ +TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_sales,channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + WholeStageCodegen (52) + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id] + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + Subquery #4 + WholeStageCodegen (8) + HashAggregate [sum,count] [avg(CheckOverflow((promote_precision(cast(cast(quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price as decimal(12,2)))), DecimalType(18,2), true)),average_sales,sum,count] + InputAdapter + Exchange #13 + WholeStageCodegen (7) + HashAggregate [quantity,list_price] [sum,count,sum,count] + InputAdapter + Union + WholeStageCodegen (2) + Project [ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #5 + ReusedExchange [d_date_sk] #14 + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + WholeStageCodegen (4) + Project [cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_quantity,cs_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #5 + InputAdapter + ReusedExchange [d_date_sk] #14 + WholeStageCodegen (6) + Project [ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #5 + InputAdapter + ReusedExchange [d_date_sk] #14 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #1 + WholeStageCodegen (25) + HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_quantity,ss_list_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + BroadcastHashJoin [ss_item_sk,ss_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (11) + Project [i_item_sk] + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id] + Filter [i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (10) + HashAggregate [brand_id,class_id,category_id] + HashAggregate [brand_id,class_id,category_id] + BroadcastHashJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] + HashAggregate [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #5 + WholeStageCodegen (6) + HashAggregate [brand_id,class_id,category_id] + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (4) + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id] + Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (3) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (1) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (9) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #9 + InputAdapter + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (23) + BroadcastHashJoin [i_item_sk,ss_item_sk] + Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + ReusedExchange [ss_item_sk] #12 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (24) + Project [d_date_sk] + Filter [d_week_seq,d_date_sk] + Subquery #3 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (51) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #4 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #16 + WholeStageCodegen (50) + HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_quantity,ss_list_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + BroadcastHashJoin [ss_item_sk,ss_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #6 + ReusedExchange [d_date_sk] #17 + InputAdapter + ReusedExchange [ss_item_sk] #12 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #11 + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (49) + Project [d_date_sk] + Filter [d_week_seq,d_date_sk] + Subquery #7 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/explain.txt new file mode 100644 index 0000000000000..4725a7a60a3ce --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * HashAggregate (31) + +- Exchange (30) + +- * HashAggregate (29) + +- * Project (28) + +- * SortMergeJoin Inner (27) + :- * Sort (12) + : +- Exchange (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.catalog_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (26) + +- Exchange (25) + +- * Project (24) + +- * SortMergeJoin Inner (23) + :- * Sort (17) + : +- Exchange (16) + : +- * Filter (15) + : +- * ColumnarToRow (14) + : +- Scan parquet default.customer (13) + +- * Sort (22) + +- Exchange (21) + +- * Filter (20) + +- * ColumnarToRow (19) + +- Scan parquet default.customer_address (18) + + +(1) Scan parquet default.catalog_sales +Output [3]: [cs_bill_customer_sk#1, cs_sales_price#2, cs_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#3), dynamicpruningexpression(cs_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [cs_bill_customer_sk#1, cs_sales_price#2, cs_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [cs_bill_customer_sk#1, cs_sales_price#2, cs_sold_date_sk#3] +Condition : isnotnull(cs_bill_customer_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Condition : ((((isnotnull(d_qoy#7) AND isnotnull(d_year#6)) AND (d_qoy#7 = 2)) AND (d_year#6 = 2001)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [cs_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 2] +Output [2]: [cs_bill_customer_sk#1, cs_sales_price#2] +Input [4]: [cs_bill_customer_sk#1, cs_sales_price#2, cs_sold_date_sk#3, d_date_sk#5] + +(11) Exchange +Input [2]: [cs_bill_customer_sk#1, cs_sales_price#2] +Arguments: hashpartitioning(cs_bill_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] + +(12) Sort [codegen id : 3] +Input [2]: [cs_bill_customer_sk#1, cs_sales_price#2] +Arguments: [cs_bill_customer_sk#1 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.customer +Output [2]: [c_customer_sk#10, c_current_addr_sk#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 4] +Input [2]: [c_customer_sk#10, c_current_addr_sk#11] + +(15) Filter [codegen id : 4] +Input [2]: [c_customer_sk#10, c_current_addr_sk#11] +Condition : (isnotnull(c_customer_sk#10) AND isnotnull(c_current_addr_sk#11)) + +(16) Exchange +Input [2]: [c_customer_sk#10, c_current_addr_sk#11] +Arguments: hashpartitioning(c_current_addr_sk#11, 5), ENSURE_REQUIREMENTS, [id=#12] + +(17) Sort [codegen id : 5] +Input [2]: [c_customer_sk#10, c_current_addr_sk#11] +Arguments: [c_current_addr_sk#11 ASC NULLS FIRST], false, 0 + +(18) Scan parquet default.customer_address +Output [3]: [ca_address_sk#13, ca_state#14, ca_zip#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 6] +Input [3]: [ca_address_sk#13, ca_state#14, ca_zip#15] + +(20) Filter [codegen id : 6] +Input [3]: [ca_address_sk#13, ca_state#14, ca_zip#15] +Condition : isnotnull(ca_address_sk#13) + +(21) Exchange +Input [3]: [ca_address_sk#13, ca_state#14, ca_zip#15] +Arguments: hashpartitioning(ca_address_sk#13, 5), ENSURE_REQUIREMENTS, [id=#16] + +(22) Sort [codegen id : 7] +Input [3]: [ca_address_sk#13, ca_state#14, ca_zip#15] +Arguments: [ca_address_sk#13 ASC NULLS FIRST], false, 0 + +(23) SortMergeJoin [codegen id : 8] +Left keys [1]: [c_current_addr_sk#11] +Right keys [1]: [ca_address_sk#13] +Join condition: None + +(24) Project [codegen id : 8] +Output [3]: [c_customer_sk#10, ca_state#14, ca_zip#15] +Input [5]: [c_customer_sk#10, c_current_addr_sk#11, ca_address_sk#13, ca_state#14, ca_zip#15] + +(25) Exchange +Input [3]: [c_customer_sk#10, ca_state#14, ca_zip#15] +Arguments: hashpartitioning(c_customer_sk#10, 5), ENSURE_REQUIREMENTS, [id=#17] + +(26) Sort [codegen id : 9] +Input [3]: [c_customer_sk#10, ca_state#14, ca_zip#15] +Arguments: [c_customer_sk#10 ASC NULLS FIRST], false, 0 + +(27) SortMergeJoin [codegen id : 10] +Left keys [1]: [cs_bill_customer_sk#1] +Right keys [1]: [c_customer_sk#10] +Join condition: ((substr(ca_zip#15, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR ca_state#14 IN (CA,WA,GA)) OR (cs_sales_price#2 > 500.00)) + +(28) Project [codegen id : 10] +Output [2]: [cs_sales_price#2, ca_zip#15] +Input [5]: [cs_bill_customer_sk#1, cs_sales_price#2, c_customer_sk#10, ca_state#14, ca_zip#15] + +(29) HashAggregate [codegen id : 10] +Input [2]: [cs_sales_price#2, ca_zip#15] +Keys [1]: [ca_zip#15] +Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#2))] +Aggregate Attributes [1]: [sum#18] +Results [2]: [ca_zip#15, sum#19] + +(30) Exchange +Input [2]: [ca_zip#15, sum#19] +Arguments: hashpartitioning(ca_zip#15, 5), ENSURE_REQUIREMENTS, [id=#20] + +(31) HashAggregate [codegen id : 11] +Input [2]: [ca_zip#15, sum#19] +Keys [1]: [ca_zip#15] +Functions [1]: [sum(UnscaledValue(cs_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#2))#21] +Results [2]: [ca_zip#15, MakeDecimal(sum(UnscaledValue(cs_sales_price#2))#21,17,2) AS sum(cs_sales_price)#22] + +(32) TakeOrderedAndProject +Input [2]: [ca_zip#15, sum(cs_sales_price)#22] +Arguments: 100, [ca_zip#15 ASC NULLS FIRST], [ca_zip#15, sum(cs_sales_price)#22] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/simplified.txt new file mode 100644 index 0000000000000..f8d15ca97ac7a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15.sf100/simplified.txt @@ -0,0 +1,59 @@ +TakeOrderedAndProject [ca_zip,sum(cs_sales_price)] + WholeStageCodegen (11) + HashAggregate [ca_zip,sum] [sum(UnscaledValue(cs_sales_price)),sum(cs_sales_price),sum] + InputAdapter + Exchange [ca_zip] #1 + WholeStageCodegen (10) + HashAggregate [ca_zip,cs_sales_price] [sum,sum] + Project [cs_sales_price,ca_zip] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk,ca_zip,ca_state,cs_sales_price] + InputAdapter + WholeStageCodegen (3) + Sort [cs_bill_customer_sk] + InputAdapter + Exchange [cs_bill_customer_sk] #2 + WholeStageCodegen (2) + Project [cs_bill_customer_sk,cs_sales_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + WholeStageCodegen (9) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #4 + WholeStageCodegen (8) + Project [c_customer_sk,ca_state,ca_zip] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (5) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (7) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #6 + WholeStageCodegen (6) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15/explain.txt new file mode 100644 index 0000000000000..d360e7aa6a6fe --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15/explain.txt @@ -0,0 +1,161 @@ +== Physical Plan == +TakeOrderedAndProject (26) ++- * HashAggregate (25) + +- Exchange (24) + +- * HashAggregate (23) + +- * Project (22) + +- * BroadcastHashJoin Inner BuildRight (21) + :- * Project (15) + : +- * BroadcastHashJoin Inner BuildRight (14) + : :- * Project (9) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.catalog_sales (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.customer (4) + : +- BroadcastExchange (13) + : +- * Filter (12) + : +- * ColumnarToRow (11) + : +- Scan parquet default.customer_address (10) + +- BroadcastExchange (20) + +- * Project (19) + +- * Filter (18) + +- * ColumnarToRow (17) + +- Scan parquet default.date_dim (16) + + +(1) Scan parquet default.catalog_sales +Output [3]: [cs_bill_customer_sk#1, cs_sales_price#2, cs_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#3), dynamicpruningexpression(cs_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [3]: [cs_bill_customer_sk#1, cs_sales_price#2, cs_sold_date_sk#3] + +(3) Filter [codegen id : 4] +Input [3]: [cs_bill_customer_sk#1, cs_sales_price#2, cs_sold_date_sk#3] +Condition : isnotnull(cs_bill_customer_sk#1) + +(4) Scan parquet default.customer +Output [2]: [c_customer_sk#5, c_current_addr_sk#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [c_customer_sk#5, c_current_addr_sk#6] + +(6) Filter [codegen id : 1] +Input [2]: [c_customer_sk#5, c_current_addr_sk#6] +Condition : (isnotnull(c_customer_sk#5) AND isnotnull(c_current_addr_sk#6)) + +(7) BroadcastExchange +Input [2]: [c_customer_sk#5, c_current_addr_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_bill_customer_sk#1] +Right keys [1]: [c_customer_sk#5] +Join condition: None + +(9) Project [codegen id : 4] +Output [3]: [cs_sales_price#2, cs_sold_date_sk#3, c_current_addr_sk#6] +Input [5]: [cs_bill_customer_sk#1, cs_sales_price#2, cs_sold_date_sk#3, c_customer_sk#5, c_current_addr_sk#6] + +(10) Scan parquet default.customer_address +Output [3]: [ca_address_sk#8, ca_state#9, ca_zip#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [ca_address_sk#8, ca_state#9, ca_zip#10] + +(12) Filter [codegen id : 2] +Input [3]: [ca_address_sk#8, ca_state#9, ca_zip#10] +Condition : isnotnull(ca_address_sk#8) + +(13) BroadcastExchange +Input [3]: [ca_address_sk#8, ca_state#9, ca_zip#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [c_current_addr_sk#6] +Right keys [1]: [ca_address_sk#8] +Join condition: ((substr(ca_zip#10, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR ca_state#9 IN (CA,WA,GA)) OR (cs_sales_price#2 > 500.00)) + +(15) Project [codegen id : 4] +Output [3]: [cs_sales_price#2, cs_sold_date_sk#3, ca_zip#10] +Input [6]: [cs_sales_price#2, cs_sold_date_sk#3, c_current_addr_sk#6, ca_address_sk#8, ca_state#9, ca_zip#10] + +(16) Scan parquet default.date_dim +Output [3]: [d_date_sk#12, d_year#13, d_qoy#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] + +(18) Filter [codegen id : 3] +Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] +Condition : ((((isnotnull(d_qoy#14) AND isnotnull(d_year#13)) AND (d_qoy#14 = 2)) AND (d_year#13 = 2001)) AND isnotnull(d_date_sk#12)) + +(19) Project [codegen id : 3] +Output [1]: [d_date_sk#12] +Input [3]: [d_date_sk#12, d_year#13, d_qoy#14] + +(20) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#3] +Right keys [1]: [d_date_sk#12] +Join condition: None + +(22) Project [codegen id : 4] +Output [2]: [cs_sales_price#2, ca_zip#10] +Input [4]: [cs_sales_price#2, cs_sold_date_sk#3, ca_zip#10, d_date_sk#12] + +(23) HashAggregate [codegen id : 4] +Input [2]: [cs_sales_price#2, ca_zip#10] +Keys [1]: [ca_zip#10] +Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#2))] +Aggregate Attributes [1]: [sum#16] +Results [2]: [ca_zip#10, sum#17] + +(24) Exchange +Input [2]: [ca_zip#10, sum#17] +Arguments: hashpartitioning(ca_zip#10, 5), ENSURE_REQUIREMENTS, [id=#18] + +(25) HashAggregate [codegen id : 5] +Input [2]: [ca_zip#10, sum#17] +Keys [1]: [ca_zip#10] +Functions [1]: [sum(UnscaledValue(cs_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#2))#19] +Results [2]: [ca_zip#10, MakeDecimal(sum(UnscaledValue(cs_sales_price#2))#19,17,2) AS sum(cs_sales_price)#20] + +(26) TakeOrderedAndProject +Input [2]: [ca_zip#10, sum(cs_sales_price)#20] +Arguments: 100, [ca_zip#10 ASC NULLS FIRST], [ca_zip#10, sum(cs_sales_price)#20] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (27) + + +(27) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15/simplified.txt new file mode 100644 index 0000000000000..79b0d4b0cad21 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q15/simplified.txt @@ -0,0 +1,41 @@ +TakeOrderedAndProject [ca_zip,sum(cs_sales_price)] + WholeStageCodegen (5) + HashAggregate [ca_zip,sum] [sum(UnscaledValue(cs_sales_price)),sum(cs_sales_price),sum] + InputAdapter + Exchange [ca_zip] #1 + WholeStageCodegen (4) + HashAggregate [ca_zip,cs_sales_price] [sum,sum] + Project [cs_sales_price,ca_zip] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sales_price,cs_sold_date_sk,ca_zip] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk,ca_zip,ca_state,cs_sales_price] + Project [cs_sales_price,cs_sold_date_sk,c_current_addr_sk] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + Filter [cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt new file mode 100644 index 0000000000000..f9ab964739273 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/explain.txt @@ -0,0 +1,260 @@ +== Physical Plan == +* Sort (46) ++- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * HashAggregate (42) + +- * HashAggregate (41) + +- * Project (40) + +- * BroadcastHashJoin Inner BuildRight (39) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Project (26) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- SortMergeJoin LeftAnti (19) + : : : :- * Project (13) + : : : : +- * SortMergeJoin LeftSemi (12) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * ColumnarToRow (8) + : : : : +- Scan parquet default.catalog_sales (7) + : : : +- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.catalog_returns (14) + : : +- BroadcastExchange (24) + : : +- * Project (23) + : : +- * Filter (22) + : : +- * ColumnarToRow (21) + : : +- Scan parquet default.customer_address (20) + : +- BroadcastExchange (31) + : +- * Project (30) + : +- * Filter (29) + : +- * ColumnarToRow (28) + : +- Scan parquet default.call_center (27) + +- BroadcastExchange (38) + +- * Project (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.date_dim (34) + + +(1) Scan parquet default.catalog_sales +Output [8]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cs_sold_date_sk#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_ship_date_sk), IsNotNull(cs_ship_addr_sk), IsNotNull(cs_call_center_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [8]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cs_sold_date_sk#8] + +(3) Filter [codegen id : 1] +Input [8]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cs_sold_date_sk#8] +Condition : ((isnotnull(cs_ship_date_sk#1) AND isnotnull(cs_ship_addr_sk#2)) AND isnotnull(cs_call_center_sk#3)) + +(4) Project [codegen id : 1] +Output [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [8]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cs_sold_date_sk#8] + +(5) Exchange +Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Arguments: hashpartitioning(cs_order_number#5, 5), ENSURE_REQUIREMENTS, [id=#9] + +(6) Sort [codegen id : 2] +Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Arguments: [cs_order_number#5 ASC NULLS FIRST], false, 0 + +(7) Scan parquet default.catalog_sales +Output [3]: [cs_warehouse_sk#10, cs_order_number#11, cs_sold_date_sk#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 3] +Input [3]: [cs_warehouse_sk#10, cs_order_number#11, cs_sold_date_sk#12] + +(9) Project [codegen id : 3] +Output [2]: [cs_warehouse_sk#10, cs_order_number#11] +Input [3]: [cs_warehouse_sk#10, cs_order_number#11, cs_sold_date_sk#12] + +(10) Exchange +Input [2]: [cs_warehouse_sk#10, cs_order_number#11] +Arguments: hashpartitioning(cs_order_number#11, 5), ENSURE_REQUIREMENTS, [id=#13] + +(11) Sort [codegen id : 4] +Input [2]: [cs_warehouse_sk#10, cs_order_number#11] +Arguments: [cs_order_number#11 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 5] +Left keys [1]: [cs_order_number#5] +Right keys [1]: [cs_order_number#11] +Join condition: NOT (cs_warehouse_sk#4 = cs_warehouse_sk#10) + +(13) Project [codegen id : 5] +Output [6]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] + +(14) Scan parquet default.catalog_returns +Output [2]: [cr_order_number#14, cr_returned_date_sk#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 6] +Input [2]: [cr_order_number#14, cr_returned_date_sk#15] + +(16) Project [codegen id : 6] +Output [1]: [cr_order_number#14] +Input [2]: [cr_order_number#14, cr_returned_date_sk#15] + +(17) Exchange +Input [1]: [cr_order_number#14] +Arguments: hashpartitioning(cr_order_number#14, 5), ENSURE_REQUIREMENTS, [id=#16] + +(18) Sort [codegen id : 7] +Input [1]: [cr_order_number#14] +Arguments: [cr_order_number#14 ASC NULLS FIRST], false, 0 + +(19) SortMergeJoin +Left keys [1]: [cs_order_number#5] +Right keys [1]: [cr_order_number#14] +Join condition: None + +(20) Scan parquet default.customer_address +Output [2]: [ca_address_sk#17, ca_state#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 8] +Input [2]: [ca_address_sk#17, ca_state#18] + +(22) Filter [codegen id : 8] +Input [2]: [ca_address_sk#17, ca_state#18] +Condition : ((isnotnull(ca_state#18) AND (ca_state#18 = GA)) AND isnotnull(ca_address_sk#17)) + +(23) Project [codegen id : 8] +Output [1]: [ca_address_sk#17] +Input [2]: [ca_address_sk#17, ca_state#18] + +(24) BroadcastExchange +Input [1]: [ca_address_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] + +(25) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_ship_addr_sk#2] +Right keys [1]: [ca_address_sk#17] +Join condition: None + +(26) Project [codegen id : 11] +Output [5]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, ca_address_sk#17] + +(27) Scan parquet default.call_center +Output [2]: [cc_call_center_sk#20, cc_county#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_county), EqualTo(cc_county,Williamson County), IsNotNull(cc_call_center_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 9] +Input [2]: [cc_call_center_sk#20, cc_county#21] + +(29) Filter [codegen id : 9] +Input [2]: [cc_call_center_sk#20, cc_county#21] +Condition : ((isnotnull(cc_county#21) AND (cc_county#21 = Williamson County)) AND isnotnull(cc_call_center_sk#20)) + +(30) Project [codegen id : 9] +Output [1]: [cc_call_center_sk#20] +Input [2]: [cc_call_center_sk#20, cc_county#21] + +(31) BroadcastExchange +Input [1]: [cc_call_center_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] + +(32) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_call_center_sk#3] +Right keys [1]: [cc_call_center_sk#20] +Join condition: None + +(33) Project [codegen id : 11] +Output [4]: [cs_ship_date_sk#1, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [6]: [cs_ship_date_sk#1, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#20] + +(34) Scan parquet default.date_dim +Output [2]: [d_date_sk#23, d_date#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2002-02-01), LessThanOrEqual(d_date,2002-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 10] +Input [2]: [d_date_sk#23, d_date#24] + +(36) Filter [codegen id : 10] +Input [2]: [d_date_sk#23, d_date#24] +Condition : (((isnotnull(d_date#24) AND (d_date#24 >= 2002-02-01)) AND (d_date#24 <= 2002-04-02)) AND isnotnull(d_date_sk#23)) + +(37) Project [codegen id : 10] +Output [1]: [d_date_sk#23] +Input [2]: [d_date_sk#23, d_date#24] + +(38) BroadcastExchange +Input [1]: [d_date_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] + +(39) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_ship_date_sk#1] +Right keys [1]: [d_date_sk#23] +Join condition: None + +(40) Project [codegen id : 11] +Output [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [5]: [cs_ship_date_sk#1, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#23] + +(41) HashAggregate [codegen id : 11] +Input [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Keys [1]: [cs_order_number#5] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_ship_cost#6)), partial_sum(UnscaledValue(cs_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_ship_cost#6))#26, sum(UnscaledValue(cs_net_profit#7))#27] +Results [3]: [cs_order_number#5, sum#28, sum#29] + +(42) HashAggregate [codegen id : 11] +Input [3]: [cs_order_number#5, sum#28, sum#29] +Keys [1]: [cs_order_number#5] +Functions [2]: [merge_sum(UnscaledValue(cs_ext_ship_cost#6)), merge_sum(UnscaledValue(cs_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_ship_cost#6))#26, sum(UnscaledValue(cs_net_profit#7))#27] +Results [3]: [cs_order_number#5, sum#28, sum#29] + +(43) HashAggregate [codegen id : 11] +Input [3]: [cs_order_number#5, sum#28, sum#29] +Keys: [] +Functions [3]: [merge_sum(UnscaledValue(cs_ext_ship_cost#6)), merge_sum(UnscaledValue(cs_net_profit#7)), partial_count(distinct cs_order_number#5)] +Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_ship_cost#6))#26, sum(UnscaledValue(cs_net_profit#7))#27, count(cs_order_number#5)#30] +Results [3]: [sum#28, sum#29, count#31] + +(44) Exchange +Input [3]: [sum#28, sum#29, count#31] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#32] + +(45) HashAggregate [codegen id : 12] +Input [3]: [sum#28, sum#29, count#31] +Keys: [] +Functions [3]: [sum(UnscaledValue(cs_ext_ship_cost#6)), sum(UnscaledValue(cs_net_profit#7)), count(distinct cs_order_number#5)] +Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_ship_cost#6))#26, sum(UnscaledValue(cs_net_profit#7))#27, count(cs_order_number#5)#30] +Results [3]: [count(cs_order_number#5)#30 AS order count #33, MakeDecimal(sum(UnscaledValue(cs_ext_ship_cost#6))#26,17,2) AS total shipping cost #34, MakeDecimal(sum(UnscaledValue(cs_net_profit#7))#27,17,2) AS total net profit #35] + +(46) Sort [codegen id : 12] +Input [3]: [order count #33, total shipping cost #34, total net profit #35] +Arguments: [order count #33 ASC NULLS FIRST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt new file mode 100644 index 0000000000000..489200f5201eb --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16.sf100/simplified.txt @@ -0,0 +1,74 @@ +WholeStageCodegen (12) + Sort [order count ] + HashAggregate [sum,sum,count] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),count(cs_order_number),order count ,total shipping cost ,total net profit ,sum,sum,count] + InputAdapter + Exchange #1 + WholeStageCodegen (11) + HashAggregate [cs_order_number] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),count(cs_order_number),sum,sum,count,sum,sum,count] + HashAggregate [cs_order_number] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),sum,sum,sum,sum] + HashAggregate [cs_order_number,cs_ext_ship_cost,cs_net_profit] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),sum,sum,sum,sum] + Project [cs_order_number,cs_ext_ship_cost,cs_net_profit] + BroadcastHashJoin [cs_ship_date_sk,d_date_sk] + Project [cs_ship_date_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] + BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] + Project [cs_ship_date_sk,cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] + BroadcastHashJoin [cs_ship_addr_sk,ca_address_sk] + InputAdapter + SortMergeJoin [cs_order_number,cr_order_number] + WholeStageCodegen (5) + Project [cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] + SortMergeJoin [cs_order_number,cs_order_number,cs_warehouse_sk,cs_warehouse_sk] + InputAdapter + WholeStageCodegen (2) + Sort [cs_order_number] + InputAdapter + Exchange [cs_order_number] #2 + WholeStageCodegen (1) + Project [cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk,cs_warehouse_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] + Filter [cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk,cs_warehouse_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit,cs_sold_date_sk] + InputAdapter + WholeStageCodegen (4) + Sort [cs_order_number] + InputAdapter + Exchange [cs_order_number] #3 + WholeStageCodegen (3) + Project [cs_warehouse_sk,cs_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_warehouse_sk,cs_order_number,cs_sold_date_sk] + WholeStageCodegen (7) + Sort [cr_order_number] + InputAdapter + Exchange [cr_order_number] #4 + WholeStageCodegen (6) + Project [cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_order_number,cr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (8) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (9) + Project [cc_call_center_sk] + Filter [cc_county,cc_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.call_center [cc_call_center_sk,cc_county] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (10) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16/explain.txt new file mode 100644 index 0000000000000..647824d3a9d75 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16/explain.txt @@ -0,0 +1,260 @@ +== Physical Plan == +* Sort (46) ++- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * HashAggregate (42) + +- * HashAggregate (41) + +- * Project (40) + +- * BroadcastHashJoin Inner BuildRight (39) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Project (26) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- SortMergeJoin LeftAnti (19) + : : : :- * Project (13) + : : : : +- * SortMergeJoin LeftSemi (12) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * ColumnarToRow (8) + : : : : +- Scan parquet default.catalog_sales (7) + : : : +- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.catalog_returns (14) + : : +- BroadcastExchange (24) + : : +- * Project (23) + : : +- * Filter (22) + : : +- * ColumnarToRow (21) + : : +- Scan parquet default.date_dim (20) + : +- BroadcastExchange (31) + : +- * Project (30) + : +- * Filter (29) + : +- * ColumnarToRow (28) + : +- Scan parquet default.customer_address (27) + +- BroadcastExchange (38) + +- * Project (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.call_center (34) + + +(1) Scan parquet default.catalog_sales +Output [8]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cs_sold_date_sk#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_ship_date_sk), IsNotNull(cs_ship_addr_sk), IsNotNull(cs_call_center_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [8]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cs_sold_date_sk#8] + +(3) Filter [codegen id : 1] +Input [8]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cs_sold_date_sk#8] +Condition : ((isnotnull(cs_ship_date_sk#1) AND isnotnull(cs_ship_addr_sk#2)) AND isnotnull(cs_call_center_sk#3)) + +(4) Project [codegen id : 1] +Output [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [8]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cs_sold_date_sk#8] + +(5) Exchange +Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Arguments: hashpartitioning(cs_order_number#5, 5), ENSURE_REQUIREMENTS, [id=#9] + +(6) Sort [codegen id : 2] +Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Arguments: [cs_order_number#5 ASC NULLS FIRST], false, 0 + +(7) Scan parquet default.catalog_sales +Output [3]: [cs_warehouse_sk#10, cs_order_number#11, cs_sold_date_sk#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 3] +Input [3]: [cs_warehouse_sk#10, cs_order_number#11, cs_sold_date_sk#12] + +(9) Project [codegen id : 3] +Output [2]: [cs_warehouse_sk#10, cs_order_number#11] +Input [3]: [cs_warehouse_sk#10, cs_order_number#11, cs_sold_date_sk#12] + +(10) Exchange +Input [2]: [cs_warehouse_sk#10, cs_order_number#11] +Arguments: hashpartitioning(cs_order_number#11, 5), ENSURE_REQUIREMENTS, [id=#13] + +(11) Sort [codegen id : 4] +Input [2]: [cs_warehouse_sk#10, cs_order_number#11] +Arguments: [cs_order_number#11 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 5] +Left keys [1]: [cs_order_number#5] +Right keys [1]: [cs_order_number#11] +Join condition: NOT (cs_warehouse_sk#4 = cs_warehouse_sk#10) + +(13) Project [codegen id : 5] +Output [6]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_warehouse_sk#4, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] + +(14) Scan parquet default.catalog_returns +Output [2]: [cr_order_number#14, cr_returned_date_sk#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 6] +Input [2]: [cr_order_number#14, cr_returned_date_sk#15] + +(16) Project [codegen id : 6] +Output [1]: [cr_order_number#14] +Input [2]: [cr_order_number#14, cr_returned_date_sk#15] + +(17) Exchange +Input [1]: [cr_order_number#14] +Arguments: hashpartitioning(cr_order_number#14, 5), ENSURE_REQUIREMENTS, [id=#16] + +(18) Sort [codegen id : 7] +Input [1]: [cr_order_number#14] +Arguments: [cr_order_number#14 ASC NULLS FIRST], false, 0 + +(19) SortMergeJoin +Left keys [1]: [cs_order_number#5] +Right keys [1]: [cr_order_number#14] +Join condition: None + +(20) Scan parquet default.date_dim +Output [2]: [d_date_sk#17, d_date#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2002-02-01), LessThanOrEqual(d_date,2002-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 8] +Input [2]: [d_date_sk#17, d_date#18] + +(22) Filter [codegen id : 8] +Input [2]: [d_date_sk#17, d_date#18] +Condition : (((isnotnull(d_date#18) AND (d_date#18 >= 2002-02-01)) AND (d_date#18 <= 2002-04-02)) AND isnotnull(d_date_sk#17)) + +(23) Project [codegen id : 8] +Output [1]: [d_date_sk#17] +Input [2]: [d_date_sk#17, d_date#18] + +(24) BroadcastExchange +Input [1]: [d_date_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] + +(25) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_ship_date_sk#1] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(26) Project [codegen id : 11] +Output [5]: [cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [7]: [cs_ship_date_sk#1, cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, d_date_sk#17] + +(27) Scan parquet default.customer_address +Output [2]: [ca_address_sk#20, ca_state#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 9] +Input [2]: [ca_address_sk#20, ca_state#21] + +(29) Filter [codegen id : 9] +Input [2]: [ca_address_sk#20, ca_state#21] +Condition : ((isnotnull(ca_state#21) AND (ca_state#21 = GA)) AND isnotnull(ca_address_sk#20)) + +(30) Project [codegen id : 9] +Output [1]: [ca_address_sk#20] +Input [2]: [ca_address_sk#20, ca_state#21] + +(31) BroadcastExchange +Input [1]: [ca_address_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] + +(32) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_ship_addr_sk#2] +Right keys [1]: [ca_address_sk#20] +Join condition: None + +(33) Project [codegen id : 11] +Output [4]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [6]: [cs_ship_addr_sk#2, cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, ca_address_sk#20] + +(34) Scan parquet default.call_center +Output [2]: [cc_call_center_sk#23, cc_county#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_county), EqualTo(cc_county,Williamson County), IsNotNull(cc_call_center_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 10] +Input [2]: [cc_call_center_sk#23, cc_county#24] + +(36) Filter [codegen id : 10] +Input [2]: [cc_call_center_sk#23, cc_county#24] +Condition : ((isnotnull(cc_county#24) AND (cc_county#24 = Williamson County)) AND isnotnull(cc_call_center_sk#23)) + +(37) Project [codegen id : 10] +Output [1]: [cc_call_center_sk#23] +Input [2]: [cc_call_center_sk#23, cc_county#24] + +(38) BroadcastExchange +Input [1]: [cc_call_center_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] + +(39) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_call_center_sk#3] +Right keys [1]: [cc_call_center_sk#23] +Join condition: None + +(40) Project [codegen id : 11] +Output [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Input [5]: [cs_call_center_sk#3, cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7, cc_call_center_sk#23] + +(41) HashAggregate [codegen id : 11] +Input [3]: [cs_order_number#5, cs_ext_ship_cost#6, cs_net_profit#7] +Keys [1]: [cs_order_number#5] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_ship_cost#6)), partial_sum(UnscaledValue(cs_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_ship_cost#6))#26, sum(UnscaledValue(cs_net_profit#7))#27] +Results [3]: [cs_order_number#5, sum#28, sum#29] + +(42) HashAggregate [codegen id : 11] +Input [3]: [cs_order_number#5, sum#28, sum#29] +Keys [1]: [cs_order_number#5] +Functions [2]: [merge_sum(UnscaledValue(cs_ext_ship_cost#6)), merge_sum(UnscaledValue(cs_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_ship_cost#6))#26, sum(UnscaledValue(cs_net_profit#7))#27] +Results [3]: [cs_order_number#5, sum#28, sum#29] + +(43) HashAggregate [codegen id : 11] +Input [3]: [cs_order_number#5, sum#28, sum#29] +Keys: [] +Functions [3]: [merge_sum(UnscaledValue(cs_ext_ship_cost#6)), merge_sum(UnscaledValue(cs_net_profit#7)), partial_count(distinct cs_order_number#5)] +Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_ship_cost#6))#26, sum(UnscaledValue(cs_net_profit#7))#27, count(cs_order_number#5)#30] +Results [3]: [sum#28, sum#29, count#31] + +(44) Exchange +Input [3]: [sum#28, sum#29, count#31] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#32] + +(45) HashAggregate [codegen id : 12] +Input [3]: [sum#28, sum#29, count#31] +Keys: [] +Functions [3]: [sum(UnscaledValue(cs_ext_ship_cost#6)), sum(UnscaledValue(cs_net_profit#7)), count(distinct cs_order_number#5)] +Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_ship_cost#6))#26, sum(UnscaledValue(cs_net_profit#7))#27, count(cs_order_number#5)#30] +Results [3]: [count(cs_order_number#5)#30 AS order count #33, MakeDecimal(sum(UnscaledValue(cs_ext_ship_cost#6))#26,17,2) AS total shipping cost #34, MakeDecimal(sum(UnscaledValue(cs_net_profit#7))#27,17,2) AS total net profit #35] + +(46) Sort [codegen id : 12] +Input [3]: [order count #33, total shipping cost #34, total net profit #35] +Arguments: [order count #33 ASC NULLS FIRST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16/simplified.txt new file mode 100644 index 0000000000000..c7ead9a46797a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q16/simplified.txt @@ -0,0 +1,74 @@ +WholeStageCodegen (12) + Sort [order count ] + HashAggregate [sum,sum,count] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),count(cs_order_number),order count ,total shipping cost ,total net profit ,sum,sum,count] + InputAdapter + Exchange #1 + WholeStageCodegen (11) + HashAggregate [cs_order_number] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),count(cs_order_number),sum,sum,count,sum,sum,count] + HashAggregate [cs_order_number] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),sum,sum,sum,sum] + HashAggregate [cs_order_number,cs_ext_ship_cost,cs_net_profit] [sum(UnscaledValue(cs_ext_ship_cost)),sum(UnscaledValue(cs_net_profit)),sum,sum,sum,sum] + Project [cs_order_number,cs_ext_ship_cost,cs_net_profit] + BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] + Project [cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] + BroadcastHashJoin [cs_ship_addr_sk,ca_address_sk] + Project [cs_ship_addr_sk,cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] + BroadcastHashJoin [cs_ship_date_sk,d_date_sk] + InputAdapter + SortMergeJoin [cs_order_number,cr_order_number] + WholeStageCodegen (5) + Project [cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] + SortMergeJoin [cs_order_number,cs_order_number,cs_warehouse_sk,cs_warehouse_sk] + InputAdapter + WholeStageCodegen (2) + Sort [cs_order_number] + InputAdapter + Exchange [cs_order_number] #2 + WholeStageCodegen (1) + Project [cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk,cs_warehouse_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit] + Filter [cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_date_sk,cs_ship_addr_sk,cs_call_center_sk,cs_warehouse_sk,cs_order_number,cs_ext_ship_cost,cs_net_profit,cs_sold_date_sk] + InputAdapter + WholeStageCodegen (4) + Sort [cs_order_number] + InputAdapter + Exchange [cs_order_number] #3 + WholeStageCodegen (3) + Project [cs_warehouse_sk,cs_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_warehouse_sk,cs_order_number,cs_sold_date_sk] + WholeStageCodegen (7) + Sort [cr_order_number] + InputAdapter + Exchange [cr_order_number] #4 + WholeStageCodegen (6) + Project [cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_order_number,cr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (8) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (9) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (10) + Project [cc_call_center_sk] + Filter [cc_county,cc_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.call_center [cc_call_center_sk,cc_county] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt new file mode 100644 index 0000000000000..cc6b8786e2002 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/explain.txt @@ -0,0 +1,336 @@ +== Physical Plan == +TakeOrderedAndProject (57) ++- * HashAggregate (56) + +- Exchange (55) + +- * HashAggregate (54) + +- * Project (53) + +- * SortMergeJoin Inner (52) + :- * Sort (43) + : +- Exchange (42) + : +- * Project (41) + : +- * SortMergeJoin Inner (40) + : :- * Sort (27) + : : +- Exchange (26) + : : +- * Project (25) + : : +- * SortMergeJoin Inner (24) + : : :- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.store (11) + : : +- * Sort (23) + : : +- Exchange (22) + : : +- * Filter (21) + : : +- * ColumnarToRow (20) + : : +- Scan parquet default.item (19) + : +- * Sort (39) + : +- Exchange (38) + : +- * Project (37) + : +- * BroadcastHashJoin Inner BuildRight (36) + : :- * Filter (30) + : : +- * ColumnarToRow (29) + : : +- Scan parquet default.store_returns (28) + : +- BroadcastExchange (35) + : +- * Project (34) + : +- * Filter (33) + : +- * ColumnarToRow (32) + : +- Scan parquet default.date_dim (31) + +- * Sort (51) + +- Exchange (50) + +- * Project (49) + +- * BroadcastHashJoin Inner BuildRight (48) + :- * Filter (46) + : +- * ColumnarToRow (45) + : +- Scan parquet default.catalog_sales (44) + +- ReusedExchange (47) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 3] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_customer_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_ticket_number#4)) AND isnotnull(ss_store_sk#3)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#8, d_quarter_name#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_quarter_name), EqualTo(d_quarter_name,2001Q1), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#8, d_quarter_name#9] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#8, d_quarter_name#9] +Condition : ((isnotnull(d_quarter_name#9) AND (d_quarter_name#9 = 2001Q1)) AND isnotnull(d_date_sk#8)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#8] +Input [2]: [d_date_sk#8, d_quarter_name#9] + +(8) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(10) Project [codegen id : 3] +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6, d_date_sk#8] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#11, s_state#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#11, s_state#12] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#11, s_state#12] +Condition : isnotnull(s_store_sk#11) + +(14) BroadcastExchange +Input [2]: [s_store_sk#11, s_state#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#11] +Join condition: None + +(16) Project [codegen id : 3] +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_state#12] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, s_store_sk#11, s_state#12] + +(17) Exchange +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_state#12] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#14] + +(18) Sort [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_state#12] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.item +Output [3]: [i_item_sk#15, i_item_id#16, i_item_desc#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 5] +Input [3]: [i_item_sk#15, i_item_id#16, i_item_desc#17] + +(21) Filter [codegen id : 5] +Input [3]: [i_item_sk#15, i_item_id#16, i_item_desc#17] +Condition : isnotnull(i_item_sk#15) + +(22) Exchange +Input [3]: [i_item_sk#15, i_item_id#16, i_item_desc#17] +Arguments: hashpartitioning(i_item_sk#15, 5), ENSURE_REQUIREMENTS, [id=#18] + +(23) Sort [codegen id : 6] +Input [3]: [i_item_sk#15, i_item_id#16, i_item_desc#17] +Arguments: [i_item_sk#15 ASC NULLS FIRST], false, 0 + +(24) SortMergeJoin [codegen id : 7] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#15] +Join condition: None + +(25) Project [codegen id : 7] +Output [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17] +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_state#12, i_item_sk#15, i_item_id#16, i_item_desc#17] + +(26) Exchange +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17] +Arguments: hashpartitioning(ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#19] + +(27) Sort [codegen id : 8] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 + +(28) Scan parquet default.store_returns +Output [5]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, sr_returned_date_sk#24] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#24), dynamicpruningexpression(sr_returned_date_sk#24 IN dynamicpruning#25)] +PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 10] +Input [5]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, sr_returned_date_sk#24] + +(30) Filter [codegen id : 10] +Input [5]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, sr_returned_date_sk#24] +Condition : ((isnotnull(sr_customer_sk#21) AND isnotnull(sr_item_sk#20)) AND isnotnull(sr_ticket_number#22)) + +(31) Scan parquet default.date_dim +Output [2]: [d_date_sk#26, d_quarter_name#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_quarter_name, [2001Q1,2001Q2,2001Q3]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#26, d_quarter_name#27] + +(33) Filter [codegen id : 9] +Input [2]: [d_date_sk#26, d_quarter_name#27] +Condition : (d_quarter_name#27 IN (2001Q1,2001Q2,2001Q3) AND isnotnull(d_date_sk#26)) + +(34) Project [codegen id : 9] +Output [1]: [d_date_sk#26] +Input [2]: [d_date_sk#26, d_quarter_name#27] + +(35) BroadcastExchange +Input [1]: [d_date_sk#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] + +(36) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [sr_returned_date_sk#24] +Right keys [1]: [d_date_sk#26] +Join condition: None + +(37) Project [codegen id : 10] +Output [4]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] +Input [6]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23, sr_returned_date_sk#24, d_date_sk#26] + +(38) Exchange +Input [4]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] +Arguments: hashpartitioning(sr_customer_sk#21, sr_item_sk#20, sr_ticket_number#22, 5), ENSURE_REQUIREMENTS, [id=#29] + +(39) Sort [codegen id : 11] +Input [4]: [sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] +Arguments: [sr_customer_sk#21 ASC NULLS FIRST, sr_item_sk#20 ASC NULLS FIRST, sr_ticket_number#22 ASC NULLS FIRST], false, 0 + +(40) SortMergeJoin [codegen id : 12] +Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4] +Right keys [3]: [sr_customer_sk#21, sr_item_sk#20, sr_ticket_number#22] +Join condition: None + +(41) Project [codegen id : 12] +Output [7]: [ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23] +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17, sr_item_sk#20, sr_customer_sk#21, sr_ticket_number#22, sr_return_quantity#23] + +(42) Exchange +Input [7]: [ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23] +Arguments: hashpartitioning(sr_customer_sk#21, sr_item_sk#20, 5), ENSURE_REQUIREMENTS, [id=#30] + +(43) Sort [codegen id : 13] +Input [7]: [ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23] +Arguments: [sr_customer_sk#21 ASC NULLS FIRST, sr_item_sk#20 ASC NULLS FIRST], false, 0 + +(44) Scan parquet default.catalog_sales +Output [4]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33, cs_sold_date_sk#34] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#34), dynamicpruningexpression(cs_sold_date_sk#34 IN dynamicpruning#25)] +PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(45) ColumnarToRow [codegen id : 15] +Input [4]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33, cs_sold_date_sk#34] + +(46) Filter [codegen id : 15] +Input [4]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33, cs_sold_date_sk#34] +Condition : (isnotnull(cs_bill_customer_sk#31) AND isnotnull(cs_item_sk#32)) + +(47) ReusedExchange [Reuses operator id: 35] +Output [1]: [d_date_sk#35] + +(48) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [cs_sold_date_sk#34] +Right keys [1]: [d_date_sk#35] +Join condition: None + +(49) Project [codegen id : 15] +Output [3]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +Input [5]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33, cs_sold_date_sk#34, d_date_sk#35] + +(50) Exchange +Input [3]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +Arguments: hashpartitioning(cs_bill_customer_sk#31, cs_item_sk#32, 5), ENSURE_REQUIREMENTS, [id=#36] + +(51) Sort [codegen id : 16] +Input [3]: [cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] +Arguments: [cs_bill_customer_sk#31 ASC NULLS FIRST, cs_item_sk#32 ASC NULLS FIRST], false, 0 + +(52) SortMergeJoin [codegen id : 17] +Left keys [2]: [sr_customer_sk#21, sr_item_sk#20] +Right keys [2]: [cs_bill_customer_sk#31, cs_item_sk#32] +Join condition: None + +(53) Project [codegen id : 17] +Output [6]: [ss_quantity#5, sr_return_quantity#23, cs_quantity#33, s_state#12, i_item_id#16, i_item_desc#17] +Input [10]: [ss_quantity#5, s_state#12, i_item_id#16, i_item_desc#17, sr_item_sk#20, sr_customer_sk#21, sr_return_quantity#23, cs_bill_customer_sk#31, cs_item_sk#32, cs_quantity#33] + +(54) HashAggregate [codegen id : 17] +Input [6]: [ss_quantity#5, sr_return_quantity#23, cs_quantity#33, s_state#12, i_item_id#16, i_item_desc#17] +Keys [3]: [i_item_id#16, i_item_desc#17, s_state#12] +Functions [9]: [partial_count(ss_quantity#5), partial_avg(ss_quantity#5), partial_stddev_samp(cast(ss_quantity#5 as double)), partial_count(sr_return_quantity#23), partial_avg(sr_return_quantity#23), partial_stddev_samp(cast(sr_return_quantity#23 as double)), partial_count(cs_quantity#33), partial_avg(cs_quantity#33), partial_stddev_samp(cast(cs_quantity#33 as double))] +Aggregate Attributes [18]: [count#37, sum#38, count#39, n#40, avg#41, m2#42, count#43, sum#44, count#45, n#46, avg#47, m2#48, count#49, sum#50, count#51, n#52, avg#53, m2#54] +Results [21]: [i_item_id#16, i_item_desc#17, s_state#12, count#55, sum#56, count#57, n#58, avg#59, m2#60, count#61, sum#62, count#63, n#64, avg#65, m2#66, count#67, sum#68, count#69, n#70, avg#71, m2#72] + +(55) Exchange +Input [21]: [i_item_id#16, i_item_desc#17, s_state#12, count#55, sum#56, count#57, n#58, avg#59, m2#60, count#61, sum#62, count#63, n#64, avg#65, m2#66, count#67, sum#68, count#69, n#70, avg#71, m2#72] +Arguments: hashpartitioning(i_item_id#16, i_item_desc#17, s_state#12, 5), ENSURE_REQUIREMENTS, [id=#73] + +(56) HashAggregate [codegen id : 18] +Input [21]: [i_item_id#16, i_item_desc#17, s_state#12, count#55, sum#56, count#57, n#58, avg#59, m2#60, count#61, sum#62, count#63, n#64, avg#65, m2#66, count#67, sum#68, count#69, n#70, avg#71, m2#72] +Keys [3]: [i_item_id#16, i_item_desc#17, s_state#12] +Functions [9]: [count(ss_quantity#5), avg(ss_quantity#5), stddev_samp(cast(ss_quantity#5 as double)), count(sr_return_quantity#23), avg(sr_return_quantity#23), stddev_samp(cast(sr_return_quantity#23 as double)), count(cs_quantity#33), avg(cs_quantity#33), stddev_samp(cast(cs_quantity#33 as double))] +Aggregate Attributes [9]: [count(ss_quantity#5)#74, avg(ss_quantity#5)#75, stddev_samp(cast(ss_quantity#5 as double))#76, count(sr_return_quantity#23)#77, avg(sr_return_quantity#23)#78, stddev_samp(cast(sr_return_quantity#23 as double))#79, count(cs_quantity#33)#80, avg(cs_quantity#33)#81, stddev_samp(cast(cs_quantity#33 as double))#82] +Results [15]: [i_item_id#16, i_item_desc#17, s_state#12, count(ss_quantity#5)#74 AS store_sales_quantitycount#83, avg(ss_quantity#5)#75 AS store_sales_quantityave#84, stddev_samp(cast(ss_quantity#5 as double))#76 AS store_sales_quantitystdev#85, (stddev_samp(cast(ss_quantity#5 as double))#76 / avg(ss_quantity#5)#75) AS store_sales_quantitycov#86, count(sr_return_quantity#23)#77 AS as_store_returns_quantitycount#87, avg(sr_return_quantity#23)#78 AS as_store_returns_quantityave#88, stddev_samp(cast(sr_return_quantity#23 as double))#79 AS as_store_returns_quantitystdev#89, (stddev_samp(cast(sr_return_quantity#23 as double))#79 / avg(sr_return_quantity#23)#78) AS store_returns_quantitycov#90, count(cs_quantity#33)#80 AS catalog_sales_quantitycount#91, avg(cs_quantity#33)#81 AS catalog_sales_quantityave#92, (stddev_samp(cast(cs_quantity#33 as double))#82 / avg(cs_quantity#33)#81) AS catalog_sales_quantitystdev#93, (stddev_samp(cast(cs_quantity#33 as double))#82 / avg(cs_quantity#33)#81) AS catalog_sales_quantitycov#94] + +(57) TakeOrderedAndProject +Input [15]: [i_item_id#16, i_item_desc#17, s_state#12, store_sales_quantitycount#83, store_sales_quantityave#84, store_sales_quantitystdev#85, store_sales_quantitycov#86, as_store_returns_quantitycount#87, as_store_returns_quantityave#88, as_store_returns_quantitystdev#89, store_returns_quantitycov#90, catalog_sales_quantitycount#91, catalog_sales_quantityave#92, catalog_sales_quantitystdev#93, catalog_sales_quantitycov#94] +Arguments: 100, [i_item_id#16 ASC NULLS FIRST, i_item_desc#17 ASC NULLS FIRST, s_state#12 ASC NULLS FIRST], [i_item_id#16, i_item_desc#17, s_state#12, store_sales_quantitycount#83, store_sales_quantityave#84, store_sales_quantitystdev#85, store_sales_quantitycov#86, as_store_returns_quantitycount#87, as_store_returns_quantityave#88, as_store_returns_quantitystdev#89, store_returns_quantitycov#90, catalog_sales_quantitycount#91, catalog_sales_quantityave#92, catalog_sales_quantitystdev#93, catalog_sales_quantitycov#94] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (58) + + +(58) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 28 Hosting Expression = sr_returned_date_sk#24 IN dynamicpruning#25 +ReusedExchange (59) + + +(59) ReusedExchange [Reuses operator id: 35] +Output [1]: [d_date_sk#26] + +Subquery:3 Hosting operator id = 44 Hosting Expression = cs_sold_date_sk#34 IN dynamicpruning#25 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt new file mode 100644 index 0000000000000..cda77e94f5b7f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17.sf100/simplified.txt @@ -0,0 +1,103 @@ +TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,store_sales_quantityave,store_sales_quantitystdev,store_sales_quantitycov,as_store_returns_quantitycount,as_store_returns_quantityave,as_store_returns_quantitystdev,store_returns_quantitycov,catalog_sales_quantitycount,catalog_sales_quantityave,catalog_sales_quantitystdev,catalog_sales_quantitycov] + WholeStageCodegen (18) + HashAggregate [i_item_id,i_item_desc,s_state,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2] [count(ss_quantity),avg(ss_quantity),stddev_samp(cast(ss_quantity as double)),count(sr_return_quantity),avg(sr_return_quantity),stddev_samp(cast(sr_return_quantity as double)),count(cs_quantity),avg(cs_quantity),stddev_samp(cast(cs_quantity as double)),store_sales_quantitycount,store_sales_quantityave,store_sales_quantitystdev,store_sales_quantitycov,as_store_returns_quantitycount,as_store_returns_quantityave,as_store_returns_quantitystdev,store_returns_quantitycov,catalog_sales_quantitycount,catalog_sales_quantityave,catalog_sales_quantitystdev,catalog_sales_quantitycov,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2] + InputAdapter + Exchange [i_item_id,i_item_desc,s_state] #1 + WholeStageCodegen (17) + HashAggregate [i_item_id,i_item_desc,s_state,ss_quantity,sr_return_quantity,cs_quantity] [count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2] + Project [ss_quantity,sr_return_quantity,cs_quantity,s_state,i_item_id,i_item_desc] + SortMergeJoin [sr_customer_sk,sr_item_sk,cs_bill_customer_sk,cs_item_sk] + InputAdapter + WholeStageCodegen (13) + Sort [sr_customer_sk,sr_item_sk] + InputAdapter + Exchange [sr_customer_sk,sr_item_sk] #2 + WholeStageCodegen (12) + Project [ss_quantity,s_state,i_item_id,i_item_desc,sr_item_sk,sr_customer_sk,sr_return_quantity] + SortMergeJoin [ss_customer_sk,ss_item_sk,ss_ticket_number,sr_customer_sk,sr_item_sk,sr_ticket_number] + InputAdapter + WholeStageCodegen (8) + Sort [ss_customer_sk,ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_customer_sk,ss_item_sk,ss_ticket_number] #3 + WholeStageCodegen (7) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,s_state,i_item_id,i_item_desc] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (3) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_quarter_name,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_quarter_name] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #7 + WholeStageCodegen (5) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc] + InputAdapter + WholeStageCodegen (11) + Sort [sr_customer_sk,sr_item_sk,sr_ticket_number] + InputAdapter + Exchange [sr_customer_sk,sr_item_sk,sr_ticket_number] #8 + WholeStageCodegen (10) + Project [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_customer_sk,sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity,sr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (9) + Project [d_date_sk] + Filter [d_quarter_name,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_quarter_name] + InputAdapter + WholeStageCodegen (16) + Sort [cs_bill_customer_sk,cs_item_sk] + InputAdapter + Exchange [cs_bill_customer_sk,cs_item_sk] #10 + WholeStageCodegen (15) + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk] #9 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/explain.txt new file mode 100644 index 0000000000000..467bcc3b429c9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/explain.txt @@ -0,0 +1,291 @@ +== Physical Plan == +TakeOrderedAndProject (48) ++- * HashAggregate (47) + +- Exchange (46) + +- * HashAggregate (45) + +- * Project (44) + +- * BroadcastHashJoin Inner BuildRight (43) + :- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Project (32) + : : +- * BroadcastHashJoin Inner BuildRight (31) + : : :- * Project (29) + : : : +- * BroadcastHashJoin Inner BuildRight (28) + : : : :- * Project (22) + : : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : : :- * Project (15) + : : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : : :- * Project (9) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : +- BroadcastExchange (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.store_returns (4) + : : : : : +- BroadcastExchange (13) + : : : : : +- * Filter (12) + : : : : : +- * ColumnarToRow (11) + : : : : : +- Scan parquet default.catalog_sales (10) + : : : : +- BroadcastExchange (20) + : : : : +- * Project (19) + : : : : +- * Filter (18) + : : : : +- * ColumnarToRow (17) + : : : : +- Scan parquet default.date_dim (16) + : : : +- BroadcastExchange (27) + : : : +- * Project (26) + : : : +- * Filter (25) + : : : +- * ColumnarToRow (24) + : : : +- Scan parquet default.date_dim (23) + : : +- ReusedExchange (30) + : +- BroadcastExchange (36) + : +- * Filter (35) + : +- * ColumnarToRow (34) + : +- Scan parquet default.store (33) + +- BroadcastExchange (42) + +- * Filter (41) + +- * ColumnarToRow (40) + +- Scan parquet default.item (39) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 8] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 8] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_customer_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_ticket_number#4)) AND isnotnull(ss_store_sk#3)) + +(4) Scan parquet default.store_returns +Output [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#12), dynamicpruningexpression(sr_returned_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] + +(6) Filter [codegen id : 1] +Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] +Condition : ((isnotnull(sr_customer_sk#9) AND isnotnull(sr_item_sk#8)) AND isnotnull(sr_ticket_number#10)) + +(7) BroadcastExchange +Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(input[1, int, false], input[0, int, false], input[2, int, false]),false), [id=#14] + +(8) BroadcastHashJoin [codegen id : 8] +Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4] +Right keys [3]: [sr_customer_sk#9, sr_item_sk#8, sr_ticket_number#10] +Join condition: None + +(9) Project [codegen id : 8] +Output [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_return_quantity#11, sr_returned_date_sk#12] +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] + +(10) Scan parquet default.catalog_sales +Output [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] + +(12) Filter [codegen id : 2] +Input [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] +Condition : (isnotnull(cs_bill_customer_sk#15) AND isnotnull(cs_item_sk#16)) + +(13) BroadcastExchange +Input [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[1, int, false] as bigint) & 4294967295))),false), [id=#19] + +(14) BroadcastHashJoin [codegen id : 8] +Left keys [2]: [sr_customer_sk#9, sr_item_sk#8] +Right keys [2]: [cs_bill_customer_sk#15, cs_item_sk#16] +Join condition: None + +(15) Project [codegen id : 8] +Output [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18] +Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_return_quantity#11, sr_returned_date_sk#12, cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] + +(16) Scan parquet default.date_dim +Output [2]: [d_date_sk#20, d_quarter_name#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_quarter_name), EqualTo(d_quarter_name,2001Q1), IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#20, d_quarter_name#21] + +(18) Filter [codegen id : 3] +Input [2]: [d_date_sk#20, d_quarter_name#21] +Condition : ((isnotnull(d_quarter_name#21) AND (d_quarter_name#21 = 2001Q1)) AND isnotnull(d_date_sk#20)) + +(19) Project [codegen id : 3] +Output [1]: [d_date_sk#20] +Input [2]: [d_date_sk#20, d_quarter_name#21] + +(20) BroadcastExchange +Input [1]: [d_date_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] + +(21) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#20] +Join condition: None + +(22) Project [codegen id : 8] +Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18] +Input [9]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18, d_date_sk#20] + +(23) Scan parquet default.date_dim +Output [2]: [d_date_sk#23, d_quarter_name#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_quarter_name, [2001Q1,2001Q2,2001Q3]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#23, d_quarter_name#24] + +(25) Filter [codegen id : 4] +Input [2]: [d_date_sk#23, d_quarter_name#24] +Condition : (d_quarter_name#24 IN (2001Q1,2001Q2,2001Q3) AND isnotnull(d_date_sk#23)) + +(26) Project [codegen id : 4] +Output [1]: [d_date_sk#23] +Input [2]: [d_date_sk#23, d_quarter_name#24] + +(27) BroadcastExchange +Input [1]: [d_date_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] + +(28) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [sr_returned_date_sk#12] +Right keys [1]: [d_date_sk#23] +Join condition: None + +(29) Project [codegen id : 8] +Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, cs_sold_date_sk#18] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18, d_date_sk#23] + +(30) ReusedExchange [Reuses operator id: 27] +Output [1]: [d_date_sk#26] + +(31) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#26] +Join condition: None + +(32) Project [codegen id : 8] +Output [5]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17] +Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, cs_sold_date_sk#18, d_date_sk#26] + +(33) Scan parquet default.store +Output [2]: [s_store_sk#27, s_state#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 6] +Input [2]: [s_store_sk#27, s_state#28] + +(35) Filter [codegen id : 6] +Input [2]: [s_store_sk#27, s_state#28] +Condition : isnotnull(s_store_sk#27) + +(36) BroadcastExchange +Input [2]: [s_store_sk#27, s_state#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(37) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#27] +Join condition: None + +(38) Project [codegen id : 8] +Output [5]: [ss_item_sk#1, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_state#28] +Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_store_sk#27, s_state#28] + +(39) Scan parquet default.item +Output [3]: [i_item_sk#30, i_item_id#31, i_item_desc#32] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 7] +Input [3]: [i_item_sk#30, i_item_id#31, i_item_desc#32] + +(41) Filter [codegen id : 7] +Input [3]: [i_item_sk#30, i_item_id#31, i_item_desc#32] +Condition : isnotnull(i_item_sk#30) + +(42) BroadcastExchange +Input [3]: [i_item_sk#30, i_item_id#31, i_item_desc#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#33] + +(43) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#30] +Join condition: None + +(44) Project [codegen id : 8] +Output [6]: [ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_state#28, i_item_id#31, i_item_desc#32] +Input [8]: [ss_item_sk#1, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_state#28, i_item_sk#30, i_item_id#31, i_item_desc#32] + +(45) HashAggregate [codegen id : 8] +Input [6]: [ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_state#28, i_item_id#31, i_item_desc#32] +Keys [3]: [i_item_id#31, i_item_desc#32, s_state#28] +Functions [9]: [partial_count(ss_quantity#5), partial_avg(ss_quantity#5), partial_stddev_samp(cast(ss_quantity#5 as double)), partial_count(sr_return_quantity#11), partial_avg(sr_return_quantity#11), partial_stddev_samp(cast(sr_return_quantity#11 as double)), partial_count(cs_quantity#17), partial_avg(cs_quantity#17), partial_stddev_samp(cast(cs_quantity#17 as double))] +Aggregate Attributes [18]: [count#34, sum#35, count#36, n#37, avg#38, m2#39, count#40, sum#41, count#42, n#43, avg#44, m2#45, count#46, sum#47, count#48, n#49, avg#50, m2#51] +Results [21]: [i_item_id#31, i_item_desc#32, s_state#28, count#52, sum#53, count#54, n#55, avg#56, m2#57, count#58, sum#59, count#60, n#61, avg#62, m2#63, count#64, sum#65, count#66, n#67, avg#68, m2#69] + +(46) Exchange +Input [21]: [i_item_id#31, i_item_desc#32, s_state#28, count#52, sum#53, count#54, n#55, avg#56, m2#57, count#58, sum#59, count#60, n#61, avg#62, m2#63, count#64, sum#65, count#66, n#67, avg#68, m2#69] +Arguments: hashpartitioning(i_item_id#31, i_item_desc#32, s_state#28, 5), ENSURE_REQUIREMENTS, [id=#70] + +(47) HashAggregate [codegen id : 9] +Input [21]: [i_item_id#31, i_item_desc#32, s_state#28, count#52, sum#53, count#54, n#55, avg#56, m2#57, count#58, sum#59, count#60, n#61, avg#62, m2#63, count#64, sum#65, count#66, n#67, avg#68, m2#69] +Keys [3]: [i_item_id#31, i_item_desc#32, s_state#28] +Functions [9]: [count(ss_quantity#5), avg(ss_quantity#5), stddev_samp(cast(ss_quantity#5 as double)), count(sr_return_quantity#11), avg(sr_return_quantity#11), stddev_samp(cast(sr_return_quantity#11 as double)), count(cs_quantity#17), avg(cs_quantity#17), stddev_samp(cast(cs_quantity#17 as double))] +Aggregate Attributes [9]: [count(ss_quantity#5)#71, avg(ss_quantity#5)#72, stddev_samp(cast(ss_quantity#5 as double))#73, count(sr_return_quantity#11)#74, avg(sr_return_quantity#11)#75, stddev_samp(cast(sr_return_quantity#11 as double))#76, count(cs_quantity#17)#77, avg(cs_quantity#17)#78, stddev_samp(cast(cs_quantity#17 as double))#79] +Results [15]: [i_item_id#31, i_item_desc#32, s_state#28, count(ss_quantity#5)#71 AS store_sales_quantitycount#80, avg(ss_quantity#5)#72 AS store_sales_quantityave#81, stddev_samp(cast(ss_quantity#5 as double))#73 AS store_sales_quantitystdev#82, (stddev_samp(cast(ss_quantity#5 as double))#73 / avg(ss_quantity#5)#72) AS store_sales_quantitycov#83, count(sr_return_quantity#11)#74 AS as_store_returns_quantitycount#84, avg(sr_return_quantity#11)#75 AS as_store_returns_quantityave#85, stddev_samp(cast(sr_return_quantity#11 as double))#76 AS as_store_returns_quantitystdev#86, (stddev_samp(cast(sr_return_quantity#11 as double))#76 / avg(sr_return_quantity#11)#75) AS store_returns_quantitycov#87, count(cs_quantity#17)#77 AS catalog_sales_quantitycount#88, avg(cs_quantity#17)#78 AS catalog_sales_quantityave#89, (stddev_samp(cast(cs_quantity#17 as double))#79 / avg(cs_quantity#17)#78) AS catalog_sales_quantitystdev#90, (stddev_samp(cast(cs_quantity#17 as double))#79 / avg(cs_quantity#17)#78) AS catalog_sales_quantitycov#91] + +(48) TakeOrderedAndProject +Input [15]: [i_item_id#31, i_item_desc#32, s_state#28, store_sales_quantitycount#80, store_sales_quantityave#81, store_sales_quantitystdev#82, store_sales_quantitycov#83, as_store_returns_quantitycount#84, as_store_returns_quantityave#85, as_store_returns_quantitystdev#86, store_returns_quantitycov#87, catalog_sales_quantitycount#88, catalog_sales_quantityave#89, catalog_sales_quantitystdev#90, catalog_sales_quantitycov#91] +Arguments: 100, [i_item_id#31 ASC NULLS FIRST, i_item_desc#32 ASC NULLS FIRST, s_state#28 ASC NULLS FIRST], [i_item_id#31, i_item_desc#32, s_state#28, store_sales_quantitycount#80, store_sales_quantityave#81, store_sales_quantitystdev#82, store_sales_quantitycov#83, as_store_returns_quantitycount#84, as_store_returns_quantityave#85, as_store_returns_quantitystdev#86, store_returns_quantitycov#87, catalog_sales_quantitycount#88, catalog_sales_quantityave#89, catalog_sales_quantitystdev#90, catalog_sales_quantitycov#91] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (49) + + +(49) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#20] + +Subquery:2 Hosting operator id = 4 Hosting Expression = sr_returned_date_sk#12 IN dynamicpruning#13 +ReusedExchange (50) + + +(50) ReusedExchange [Reuses operator id: 27] +Output [1]: [d_date_sk#23] + +Subquery:3 Hosting operator id = 10 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#13 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/simplified.txt new file mode 100644 index 0000000000000..6d6fab87255f4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q17/simplified.txt @@ -0,0 +1,76 @@ +TakeOrderedAndProject [i_item_id,i_item_desc,s_state,store_sales_quantitycount,store_sales_quantityave,store_sales_quantitystdev,store_sales_quantitycov,as_store_returns_quantitycount,as_store_returns_quantityave,as_store_returns_quantitystdev,store_returns_quantitycov,catalog_sales_quantitycount,catalog_sales_quantityave,catalog_sales_quantitystdev,catalog_sales_quantitycov] + WholeStageCodegen (9) + HashAggregate [i_item_id,i_item_desc,s_state,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2] [count(ss_quantity),avg(ss_quantity),stddev_samp(cast(ss_quantity as double)),count(sr_return_quantity),avg(sr_return_quantity),stddev_samp(cast(sr_return_quantity as double)),count(cs_quantity),avg(cs_quantity),stddev_samp(cast(cs_quantity as double)),store_sales_quantitycount,store_sales_quantityave,store_sales_quantitystdev,store_sales_quantitycov,as_store_returns_quantitycount,as_store_returns_quantityave,as_store_returns_quantitystdev,store_returns_quantitycov,catalog_sales_quantitycount,catalog_sales_quantityave,catalog_sales_quantitystdev,catalog_sales_quantitycov,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2] + InputAdapter + Exchange [i_item_id,i_item_desc,s_state] #1 + WholeStageCodegen (8) + HashAggregate [i_item_id,i_item_desc,s_state,ss_quantity,sr_return_quantity,cs_quantity] [count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2,count,sum,count,n,avg,m2] + Project [ss_quantity,sr_return_quantity,cs_quantity,s_state,i_item_id,i_item_desc] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,sr_return_quantity,cs_quantity,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,sr_return_quantity,cs_quantity] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,sr_return_quantity,cs_quantity,cs_sold_date_sk] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,sr_return_quantity,sr_returned_date_sk,cs_quantity,cs_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_sold_date_sk,sr_return_quantity,sr_returned_date_sk,cs_quantity,cs_sold_date_sk] + BroadcastHashJoin [sr_customer_sk,sr_item_sk,cs_bill_customer_sk,cs_item_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_sold_date_sk,sr_item_sk,sr_customer_sk,sr_return_quantity,sr_returned_date_sk] + BroadcastHashJoin [ss_customer_sk,ss_item_sk,ss_ticket_number,sr_customer_sk,sr_item_sk,sr_ticket_number] + Filter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [sr_customer_sk,sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity,sr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_quarter_name,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_quarter_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_quarter_name,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_quarter_name] + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (7) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18.sf100/explain.txt new file mode 100644 index 0000000000000..f7927aad003a2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18.sf100/explain.txt @@ -0,0 +1,305 @@ +== Physical Plan == +TakeOrderedAndProject (53) ++- * HashAggregate (52) + +- Exchange (51) + +- * HashAggregate (50) + +- * Expand (49) + +- * Project (48) + +- * SortMergeJoin Inner (47) + :- * Sort (25) + : +- Exchange (24) + : +- * Project (23) + : +- * BroadcastHashJoin Inner BuildRight (22) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer_demographics (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.date_dim (11) + : +- BroadcastExchange (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.item (18) + +- * Sort (46) + +- Exchange (45) + +- * Project (44) + +- * SortMergeJoin Inner (43) + :- * Sort (37) + : +- Exchange (36) + : +- * Project (35) + : +- * BroadcastHashJoin Inner BuildRight (34) + : :- * Project (29) + : : +- * Filter (28) + : : +- * ColumnarToRow (27) + : : +- Scan parquet default.customer (26) + : +- BroadcastExchange (33) + : +- * Filter (32) + : +- * ColumnarToRow (31) + : +- Scan parquet default.customer_address (30) + +- * Sort (42) + +- Exchange (41) + +- * Filter (40) + +- * ColumnarToRow (39) + +- Scan parquet default.customer_demographics (38) + + +(1) Scan parquet default.catalog_sales +Output [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#9), dynamicpruningexpression(cs_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9] + +(3) Filter [codegen id : 4] +Input [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9] +Condition : ((isnotnull(cs_bill_cdemo_sk#2) AND isnotnull(cs_bill_customer_sk#1)) AND isnotnull(cs_item_sk#3)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_education_status), EqualTo(cd_gender,F), EqualTo(cd_education_status,Unknown ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] +Condition : ((((isnotnull(cd_gender#12) AND isnotnull(cd_education_status#13)) AND (cd_gender#12 = F)) AND (cd_education_status#13 = Unknown )) AND isnotnull(cd_demo_sk#11)) + +(7) Project [codegen id : 1] +Output [2]: [cd_demo_sk#11, cd_dep_count#14] +Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] + +(8) BroadcastExchange +Input [2]: [cd_demo_sk#11, cd_dep_count#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_bill_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#11] +Join condition: None + +(10) Project [codegen id : 4] +Output [9]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14] +Input [11]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_demo_sk#11, cd_dep_count#14] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#16, d_year#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1998), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#16, d_year#17] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#16, d_year#17] +Condition : ((isnotnull(d_year#17) AND (d_year#17 = 1998)) AND isnotnull(d_date_sk#16)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#16] +Input [2]: [d_date_sk#16, d_year#17] + +(15) BroadcastExchange +Input [1]: [d_date_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#9] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(17) Project [codegen id : 4] +Output [8]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14] +Input [10]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, d_date_sk#16] + +(18) Scan parquet default.item +Output [2]: [i_item_sk#19, i_item_id#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_sk#19, i_item_id#20] + +(20) Filter [codegen id : 3] +Input [2]: [i_item_sk#19, i_item_id#20] +Condition : isnotnull(i_item_sk#19) + +(21) BroadcastExchange +Input [2]: [i_item_sk#19, i_item_id#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_item_sk#3] +Right keys [1]: [i_item_sk#19] +Join condition: None + +(23) Project [codegen id : 4] +Output [8]: [cs_bill_customer_sk#1, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_id#20] +Input [10]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_sk#19, i_item_id#20] + +(24) Exchange +Input [8]: [cs_bill_customer_sk#1, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_id#20] +Arguments: hashpartitioning(cs_bill_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#22] + +(25) Sort [codegen id : 5] +Input [8]: [cs_bill_customer_sk#1, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_id#20] +Arguments: [cs_bill_customer_sk#1 ASC NULLS FIRST], false, 0 + +(26) Scan parquet default.customer +Output [5]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_month#26, c_birth_year#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [In(c_birth_month, [1,6,8,9,12,2]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 7] +Input [5]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_month#26, c_birth_year#27] + +(28) Filter [codegen id : 7] +Input [5]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_month#26, c_birth_year#27] +Condition : (((c_birth_month#26 IN (1,6,8,9,12,2) AND isnotnull(c_customer_sk#23)) AND isnotnull(c_current_cdemo_sk#24)) AND isnotnull(c_current_addr_sk#25)) + +(29) Project [codegen id : 7] +Output [4]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_year#27] +Input [5]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_month#26, c_birth_year#27] + +(30) Scan parquet default.customer_address +Output [4]: [ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [MS,IN,ND,OK,NM,VA]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 6] +Input [4]: [ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31] + +(32) Filter [codegen id : 6] +Input [4]: [ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31] +Condition : (ca_state#30 IN (MS,IN,ND,OK,NM,VA) AND isnotnull(ca_address_sk#28)) + +(33) BroadcastExchange +Input [4]: [ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] + +(34) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_addr_sk#25] +Right keys [1]: [ca_address_sk#28] +Join condition: None + +(35) Project [codegen id : 7] +Output [6]: [c_customer_sk#23, c_current_cdemo_sk#24, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] +Input [8]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_year#27, ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31] + +(36) Exchange +Input [6]: [c_customer_sk#23, c_current_cdemo_sk#24, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] +Arguments: hashpartitioning(c_current_cdemo_sk#24, 5), ENSURE_REQUIREMENTS, [id=#33] + +(37) Sort [codegen id : 8] +Input [6]: [c_customer_sk#23, c_current_cdemo_sk#24, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] +Arguments: [c_current_cdemo_sk#24 ASC NULLS FIRST], false, 0 + +(38) Scan parquet default.customer_demographics +Output [1]: [cd_demo_sk#34] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 9] +Input [1]: [cd_demo_sk#34] + +(40) Filter [codegen id : 9] +Input [1]: [cd_demo_sk#34] +Condition : isnotnull(cd_demo_sk#34) + +(41) Exchange +Input [1]: [cd_demo_sk#34] +Arguments: hashpartitioning(cd_demo_sk#34, 5), ENSURE_REQUIREMENTS, [id=#35] + +(42) Sort [codegen id : 10] +Input [1]: [cd_demo_sk#34] +Arguments: [cd_demo_sk#34 ASC NULLS FIRST], false, 0 + +(43) SortMergeJoin [codegen id : 11] +Left keys [1]: [c_current_cdemo_sk#24] +Right keys [1]: [cd_demo_sk#34] +Join condition: None + +(44) Project [codegen id : 11] +Output [5]: [c_customer_sk#23, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] +Input [7]: [c_customer_sk#23, c_current_cdemo_sk#24, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31, cd_demo_sk#34] + +(45) Exchange +Input [5]: [c_customer_sk#23, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] +Arguments: hashpartitioning(c_customer_sk#23, 5), ENSURE_REQUIREMENTS, [id=#36] + +(46) Sort [codegen id : 12] +Input [5]: [c_customer_sk#23, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] +Arguments: [c_customer_sk#23 ASC NULLS FIRST], false, 0 + +(47) SortMergeJoin [codegen id : 13] +Left keys [1]: [cs_bill_customer_sk#1] +Right keys [1]: [c_customer_sk#23] +Join condition: None + +(48) Project [codegen id : 13] +Output [11]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#27, i_item_id#20, ca_country#31, ca_state#30, ca_county#29] +Input [13]: [cs_bill_customer_sk#1, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_id#20, c_customer_sk#23, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] + +(49) Expand [codegen id : 13] +Input [11]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#27, i_item_id#20, ca_country#31, ca_state#30, ca_county#29] +Arguments: [List(cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#27, i_item_id#20, ca_country#31, ca_state#30, ca_county#29, 0), List(cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#27, i_item_id#20, ca_country#31, ca_state#30, null, 1), List(cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#27, i_item_id#20, ca_country#31, null, null, 3), List(cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#27, i_item_id#20, null, null, null, 7), List(cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#27, null, null, null, null, 15)], [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#27, i_item_id#37, ca_country#38, ca_state#39, ca_county#40, spark_grouping_id#41] + +(50) HashAggregate [codegen id : 13] +Input [12]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#27, i_item_id#37, ca_country#38, ca_state#39, ca_county#40, spark_grouping_id#41] +Keys [5]: [i_item_id#37, ca_country#38, ca_state#39, ca_county#40, spark_grouping_id#41] +Functions [7]: [partial_avg(cast(cs_quantity#4 as decimal(12,2))), partial_avg(cast(cs_list_price#5 as decimal(12,2))), partial_avg(cast(cs_coupon_amt#7 as decimal(12,2))), partial_avg(cast(cs_sales_price#6 as decimal(12,2))), partial_avg(cast(cs_net_profit#8 as decimal(12,2))), partial_avg(cast(c_birth_year#27 as decimal(12,2))), partial_avg(cast(cd_dep_count#14 as decimal(12,2)))] +Aggregate Attributes [14]: [sum#42, count#43, sum#44, count#45, sum#46, count#47, sum#48, count#49, sum#50, count#51, sum#52, count#53, sum#54, count#55] +Results [19]: [i_item_id#37, ca_country#38, ca_state#39, ca_county#40, spark_grouping_id#41, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69] + +(51) Exchange +Input [19]: [i_item_id#37, ca_country#38, ca_state#39, ca_county#40, spark_grouping_id#41, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69] +Arguments: hashpartitioning(i_item_id#37, ca_country#38, ca_state#39, ca_county#40, spark_grouping_id#41, 5), ENSURE_REQUIREMENTS, [id=#70] + +(52) HashAggregate [codegen id : 14] +Input [19]: [i_item_id#37, ca_country#38, ca_state#39, ca_county#40, spark_grouping_id#41, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69] +Keys [5]: [i_item_id#37, ca_country#38, ca_state#39, ca_county#40, spark_grouping_id#41] +Functions [7]: [avg(cast(cs_quantity#4 as decimal(12,2))), avg(cast(cs_list_price#5 as decimal(12,2))), avg(cast(cs_coupon_amt#7 as decimal(12,2))), avg(cast(cs_sales_price#6 as decimal(12,2))), avg(cast(cs_net_profit#8 as decimal(12,2))), avg(cast(c_birth_year#27 as decimal(12,2))), avg(cast(cd_dep_count#14 as decimal(12,2)))] +Aggregate Attributes [7]: [avg(cast(cs_quantity#4 as decimal(12,2)))#71, avg(cast(cs_list_price#5 as decimal(12,2)))#72, avg(cast(cs_coupon_amt#7 as decimal(12,2)))#73, avg(cast(cs_sales_price#6 as decimal(12,2)))#74, avg(cast(cs_net_profit#8 as decimal(12,2)))#75, avg(cast(c_birth_year#27 as decimal(12,2)))#76, avg(cast(cd_dep_count#14 as decimal(12,2)))#77] +Results [11]: [i_item_id#37, ca_country#38, ca_state#39, ca_county#40, avg(cast(cs_quantity#4 as decimal(12,2)))#71 AS agg1#78, avg(cast(cs_list_price#5 as decimal(12,2)))#72 AS agg2#79, avg(cast(cs_coupon_amt#7 as decimal(12,2)))#73 AS agg3#80, avg(cast(cs_sales_price#6 as decimal(12,2)))#74 AS agg4#81, avg(cast(cs_net_profit#8 as decimal(12,2)))#75 AS agg5#82, avg(cast(c_birth_year#27 as decimal(12,2)))#76 AS agg6#83, avg(cast(cd_dep_count#14 as decimal(12,2)))#77 AS agg7#84] + +(53) TakeOrderedAndProject +Input [11]: [i_item_id#37, ca_country#38, ca_state#39, ca_county#40, agg1#78, agg2#79, agg3#80, agg4#81, agg5#82, agg6#83, agg7#84] +Arguments: 100, [ca_country#38 ASC NULLS FIRST, ca_state#39 ASC NULLS FIRST, ca_county#40 ASC NULLS FIRST, i_item_id#37 ASC NULLS FIRST], [i_item_id#37, ca_country#38, ca_state#39, ca_county#40, agg1#78, agg2#79, agg3#80, agg4#81, agg5#82, agg6#83, agg7#84] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (54) + + +(54) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#16] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18.sf100/simplified.txt new file mode 100644 index 0000000000000..29f977c87cb10 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18.sf100/simplified.txt @@ -0,0 +1,89 @@ +TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7] + WholeStageCodegen (14) + HashAggregate [i_item_id,ca_country,ca_state,ca_county,spark_grouping_id,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(cast(cs_quantity as decimal(12,2))),avg(cast(cs_list_price as decimal(12,2))),avg(cast(cs_coupon_amt as decimal(12,2))),avg(cast(cs_sales_price as decimal(12,2))),avg(cast(cs_net_profit as decimal(12,2))),avg(cast(c_birth_year as decimal(12,2))),avg(cast(cd_dep_count as decimal(12,2))),agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,ca_country,ca_state,ca_county,spark_grouping_id] #1 + WholeStageCodegen (13) + HashAggregate [i_item_id,ca_country,ca_state,ca_county,spark_grouping_id,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Expand [cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year,i_item_id,ca_country,ca_state,ca_county] + Project [cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year,i_item_id,ca_country,ca_state,ca_county] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (5) + Sort [cs_bill_customer_sk] + InputAdapter + Exchange [cs_bill_customer_sk] #2 + WholeStageCodegen (4) + Project [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [cd_demo_sk,cd_dep_count] + Filter [cd_gender,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_education_status,cd_dep_count] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + WholeStageCodegen (12) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #6 + WholeStageCodegen (11) + Project [c_customer_sk,c_birth_year,ca_county,ca_state,ca_country] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (8) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #7 + WholeStageCodegen (7) + Project [c_customer_sk,c_current_cdemo_sk,c_birth_year,ca_county,ca_state,ca_country] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + Filter [c_birth_month,c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_month,c_birth_year] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (6) + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county,ca_state,ca_country] + InputAdapter + WholeStageCodegen (10) + Sort [cd_demo_sk] + InputAdapter + Exchange [cd_demo_sk] #9 + WholeStageCodegen (9) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18/explain.txt new file mode 100644 index 0000000000000..ed68f03734b13 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18/explain.txt @@ -0,0 +1,275 @@ +== Physical Plan == +TakeOrderedAndProject (47) ++- * HashAggregate (46) + +- Exchange (45) + +- * HashAggregate (44) + +- * Expand (43) + +- * Project (42) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (36) + : +- * BroadcastHashJoin Inner BuildRight (35) + : :- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Project (23) + : : : +- * BroadcastHashJoin Inner BuildRight (22) + : : : :- * Project (17) + : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : :- * Project (10) + : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.catalog_sales (1) + : : : : : +- BroadcastExchange (8) + : : : : : +- * Project (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.customer_demographics (4) + : : : : +- BroadcastExchange (15) + : : : : +- * Project (14) + : : : : +- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.customer (11) + : : : +- BroadcastExchange (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.customer_demographics (18) + : : +- BroadcastExchange (27) + : : +- * Filter (26) + : : +- * ColumnarToRow (25) + : : +- Scan parquet default.customer_address (24) + : +- BroadcastExchange (34) + : +- * Project (33) + : +- * Filter (32) + : +- * ColumnarToRow (31) + : +- Scan parquet default.date_dim (30) + +- BroadcastExchange (40) + +- * Filter (39) + +- * ColumnarToRow (38) + +- Scan parquet default.item (37) + + +(1) Scan parquet default.catalog_sales +Output [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#9), dynamicpruningexpression(cs_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 7] +Input [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9] + +(3) Filter [codegen id : 7] +Input [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9] +Condition : ((isnotnull(cs_bill_cdemo_sk#2) AND isnotnull(cs_bill_customer_sk#1)) AND isnotnull(cs_item_sk#3)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_education_status), EqualTo(cd_gender,F), EqualTo(cd_education_status,Unknown ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] +Condition : ((((isnotnull(cd_gender#12) AND isnotnull(cd_education_status#13)) AND (cd_gender#12 = F)) AND (cd_education_status#13 = Unknown )) AND isnotnull(cd_demo_sk#11)) + +(7) Project [codegen id : 1] +Output [2]: [cd_demo_sk#11, cd_dep_count#14] +Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] + +(8) BroadcastExchange +Input [2]: [cd_demo_sk#11, cd_dep_count#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(9) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cs_bill_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#11] +Join condition: None + +(10) Project [codegen id : 7] +Output [9]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14] +Input [11]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_demo_sk#11, cd_dep_count#14] + +(11) Scan parquet default.customer +Output [5]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_month#19, c_birth_year#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [In(c_birth_month, [1,6,8,9,12,2]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [5]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_month#19, c_birth_year#20] + +(13) Filter [codegen id : 2] +Input [5]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_month#19, c_birth_year#20] +Condition : (((c_birth_month#19 IN (1,6,8,9,12,2) AND isnotnull(c_customer_sk#16)) AND isnotnull(c_current_cdemo_sk#17)) AND isnotnull(c_current_addr_sk#18)) + +(14) Project [codegen id : 2] +Output [4]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20] +Input [5]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_month#19, c_birth_year#20] + +(15) BroadcastExchange +Input [4]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(16) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cs_bill_customer_sk#1] +Right keys [1]: [c_customer_sk#16] +Join condition: None + +(17) Project [codegen id : 7] +Output [11]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20] +Input [13]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20] + +(18) Scan parquet default.customer_demographics +Output [1]: [cd_demo_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [1]: [cd_demo_sk#22] + +(20) Filter [codegen id : 3] +Input [1]: [cd_demo_sk#22] +Condition : isnotnull(cd_demo_sk#22) + +(21) BroadcastExchange +Input [1]: [cd_demo_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(22) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_cdemo_sk#17] +Right keys [1]: [cd_demo_sk#22] +Join condition: None + +(23) Project [codegen id : 7] +Output [10]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_current_addr_sk#18, c_birth_year#20] +Input [12]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20, cd_demo_sk#22] + +(24) Scan parquet default.customer_address +Output [4]: [ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [MS,IN,ND,OK,NM,VA]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [4]: [ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27] + +(26) Filter [codegen id : 4] +Input [4]: [ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27] +Condition : (ca_state#26 IN (MS,IN,ND,OK,NM,VA) AND isnotnull(ca_address_sk#24)) + +(27) BroadcastExchange +Input [4]: [ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#28] + +(28) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_addr_sk#18] +Right keys [1]: [ca_address_sk#24] +Join condition: None + +(29) Project [codegen id : 7] +Output [12]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_birth_year#20, ca_county#25, ca_state#26, ca_country#27] +Input [14]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_current_addr_sk#18, c_birth_year#20, ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27] + +(30) Scan parquet default.date_dim +Output [2]: [d_date_sk#29, d_year#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1998), IsNotNull(d_date_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#29, d_year#30] + +(32) Filter [codegen id : 5] +Input [2]: [d_date_sk#29, d_year#30] +Condition : ((isnotnull(d_year#30) AND (d_year#30 = 1998)) AND isnotnull(d_date_sk#29)) + +(33) Project [codegen id : 5] +Output [1]: [d_date_sk#29] +Input [2]: [d_date_sk#29, d_year#30] + +(34) BroadcastExchange +Input [1]: [d_date_sk#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#31] + +(35) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cs_sold_date_sk#9] +Right keys [1]: [d_date_sk#29] +Join condition: None + +(36) Project [codegen id : 7] +Output [11]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, ca_county#25, ca_state#26, ca_country#27] +Input [13]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_birth_year#20, ca_county#25, ca_state#26, ca_country#27, d_date_sk#29] + +(37) Scan parquet default.item +Output [2]: [i_item_sk#32, i_item_id#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(38) ColumnarToRow [codegen id : 6] +Input [2]: [i_item_sk#32, i_item_id#33] + +(39) Filter [codegen id : 6] +Input [2]: [i_item_sk#32, i_item_id#33] +Condition : isnotnull(i_item_sk#32) + +(40) BroadcastExchange +Input [2]: [i_item_sk#32, i_item_id#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#34] + +(41) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cs_item_sk#3] +Right keys [1]: [i_item_sk#32] +Join condition: None + +(42) Project [codegen id : 7] +Output [11]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, i_item_id#33, ca_country#27, ca_state#26, ca_county#25] +Input [13]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, ca_county#25, ca_state#26, ca_country#27, i_item_sk#32, i_item_id#33] + +(43) Expand [codegen id : 7] +Input [11]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, i_item_id#33, ca_country#27, ca_state#26, ca_county#25] +Arguments: [List(cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, i_item_id#33, ca_country#27, ca_state#26, ca_county#25, 0), List(cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, i_item_id#33, ca_country#27, ca_state#26, null, 1), List(cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, i_item_id#33, ca_country#27, null, null, 3), List(cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, i_item_id#33, null, null, null, 7), List(cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, null, null, null, null, 15)], [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, i_item_id#35, ca_country#36, ca_state#37, ca_county#38, spark_grouping_id#39] + +(44) HashAggregate [codegen id : 7] +Input [12]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, i_item_id#35, ca_country#36, ca_state#37, ca_county#38, spark_grouping_id#39] +Keys [5]: [i_item_id#35, ca_country#36, ca_state#37, ca_county#38, spark_grouping_id#39] +Functions [7]: [partial_avg(cast(cs_quantity#4 as decimal(12,2))), partial_avg(cast(cs_list_price#5 as decimal(12,2))), partial_avg(cast(cs_coupon_amt#7 as decimal(12,2))), partial_avg(cast(cs_sales_price#6 as decimal(12,2))), partial_avg(cast(cs_net_profit#8 as decimal(12,2))), partial_avg(cast(c_birth_year#20 as decimal(12,2))), partial_avg(cast(cd_dep_count#14 as decimal(12,2)))] +Aggregate Attributes [14]: [sum#40, count#41, sum#42, count#43, sum#44, count#45, sum#46, count#47, sum#48, count#49, sum#50, count#51, sum#52, count#53] +Results [19]: [i_item_id#35, ca_country#36, ca_state#37, ca_county#38, spark_grouping_id#39, sum#54, count#55, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67] + +(45) Exchange +Input [19]: [i_item_id#35, ca_country#36, ca_state#37, ca_county#38, spark_grouping_id#39, sum#54, count#55, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67] +Arguments: hashpartitioning(i_item_id#35, ca_country#36, ca_state#37, ca_county#38, spark_grouping_id#39, 5), ENSURE_REQUIREMENTS, [id=#68] + +(46) HashAggregate [codegen id : 8] +Input [19]: [i_item_id#35, ca_country#36, ca_state#37, ca_county#38, spark_grouping_id#39, sum#54, count#55, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67] +Keys [5]: [i_item_id#35, ca_country#36, ca_state#37, ca_county#38, spark_grouping_id#39] +Functions [7]: [avg(cast(cs_quantity#4 as decimal(12,2))), avg(cast(cs_list_price#5 as decimal(12,2))), avg(cast(cs_coupon_amt#7 as decimal(12,2))), avg(cast(cs_sales_price#6 as decimal(12,2))), avg(cast(cs_net_profit#8 as decimal(12,2))), avg(cast(c_birth_year#20 as decimal(12,2))), avg(cast(cd_dep_count#14 as decimal(12,2)))] +Aggregate Attributes [7]: [avg(cast(cs_quantity#4 as decimal(12,2)))#69, avg(cast(cs_list_price#5 as decimal(12,2)))#70, avg(cast(cs_coupon_amt#7 as decimal(12,2)))#71, avg(cast(cs_sales_price#6 as decimal(12,2)))#72, avg(cast(cs_net_profit#8 as decimal(12,2)))#73, avg(cast(c_birth_year#20 as decimal(12,2)))#74, avg(cast(cd_dep_count#14 as decimal(12,2)))#75] +Results [11]: [i_item_id#35, ca_country#36, ca_state#37, ca_county#38, avg(cast(cs_quantity#4 as decimal(12,2)))#69 AS agg1#76, avg(cast(cs_list_price#5 as decimal(12,2)))#70 AS agg2#77, avg(cast(cs_coupon_amt#7 as decimal(12,2)))#71 AS agg3#78, avg(cast(cs_sales_price#6 as decimal(12,2)))#72 AS agg4#79, avg(cast(cs_net_profit#8 as decimal(12,2)))#73 AS agg5#80, avg(cast(c_birth_year#20 as decimal(12,2)))#74 AS agg6#81, avg(cast(cd_dep_count#14 as decimal(12,2)))#75 AS agg7#82] + +(47) TakeOrderedAndProject +Input [11]: [i_item_id#35, ca_country#36, ca_state#37, ca_county#38, agg1#76, agg2#77, agg3#78, agg4#79, agg5#80, agg6#81, agg7#82] +Arguments: 100, [ca_country#36 ASC NULLS FIRST, ca_state#37 ASC NULLS FIRST, ca_county#38 ASC NULLS FIRST, i_item_id#35 ASC NULLS FIRST], [i_item_id#35, ca_country#36, ca_state#37, ca_county#38, agg1#76, agg2#77, agg3#78, agg4#79, agg5#80, agg6#81, agg7#82] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (48) + + +(48) ReusedExchange [Reuses operator id: 34] +Output [1]: [d_date_sk#29] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18/simplified.txt new file mode 100644 index 0000000000000..d8dcd9db5ceef --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q18/simplified.txt @@ -0,0 +1,71 @@ +TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7] + WholeStageCodegen (8) + HashAggregate [i_item_id,ca_country,ca_state,ca_county,spark_grouping_id,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(cast(cs_quantity as decimal(12,2))),avg(cast(cs_list_price as decimal(12,2))),avg(cast(cs_coupon_amt as decimal(12,2))),avg(cast(cs_sales_price as decimal(12,2))),avg(cast(cs_net_profit as decimal(12,2))),avg(cast(c_birth_year as decimal(12,2))),avg(cast(cd_dep_count as decimal(12,2))),agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,ca_country,ca_state,ca_county,spark_grouping_id] #1 + WholeStageCodegen (7) + HashAggregate [i_item_id,ca_country,ca_state,ca_county,spark_grouping_id,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Expand [cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year,i_item_id,ca_country,ca_state,ca_county] + Project [cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year,i_item_id,ca_country,ca_state,ca_county] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year,ca_county,ca_state,ca_country] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_birth_year,ca_county,ca_state,ca_country] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_addr_sk,c_birth_year] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [cd_demo_sk,cd_dep_count] + Filter [cd_gender,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_education_status,cd_dep_count] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + Filter [c_birth_month,c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_month,c_birth_year] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county,ca_state,ca_country] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (6) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/explain.txt new file mode 100644 index 0000000000000..febae3b0df780 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/explain.txt @@ -0,0 +1,262 @@ +== Physical Plan == +TakeOrderedAndProject (45) ++- * HashAggregate (44) + +- Exchange (43) + +- * HashAggregate (42) + +- * Project (41) + +- * SortMergeJoin Inner (40) + :- * Sort (25) + : +- Exchange (24) + : +- * Project (23) + : +- * BroadcastHashJoin Inner BuildRight (22) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.item (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.date_dim (11) + : +- BroadcastExchange (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.store (18) + +- * Sort (39) + +- Exchange (38) + +- * Project (37) + +- * SortMergeJoin Inner (36) + :- * Sort (30) + : +- Exchange (29) + : +- * Filter (28) + : +- * ColumnarToRow (27) + : +- Scan parquet default.customer (26) + +- * Sort (35) + +- Exchange (34) + +- * Filter (33) + +- * ColumnarToRow (32) + +- Scan parquet default.customer_address (31) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_sold_date_sk#5] +Condition : ((isnotnull(ss_item_sk#1) AND isnotnull(ss_customer_sk#2)) AND isnotnull(ss_store_sk#3)) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, i_manager_id#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,8), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, i_manager_id#12] + +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, i_manager_id#12] +Condition : ((isnotnull(i_manager_id#12) AND (i_manager_id#12 = 8)) AND isnotnull(i_item_sk#7)) + +(7) Project [codegen id : 1] +Output [5]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11] +Input [6]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, i_manager_id#12] + +(8) BroadcastExchange +Input [5]: [i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [8]: [ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_sold_date_sk#5, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11] +Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_sold_date_sk#5, i_item_sk#7, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11] + +(11) Scan parquet default.date_dim +Output [3]: [d_date_sk#14, d_year#15, d_moy#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,1998), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#14, d_year#15, d_moy#16] + +(13) Filter [codegen id : 2] +Input [3]: [d_date_sk#14, d_year#15, d_moy#16] +Condition : ((((isnotnull(d_moy#16) AND isnotnull(d_year#15)) AND (d_moy#16 = 11)) AND (d_year#15 = 1998)) AND isnotnull(d_date_sk#14)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#14] +Input [3]: [d_date_sk#14, d_year#15, d_moy#16] + +(15) BroadcastExchange +Input [1]: [d_date_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(17) Project [codegen id : 4] +Output [7]: [ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11] +Input [9]: [ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, ss_sold_date_sk#5, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, d_date_sk#14] + +(18) Scan parquet default.store +Output [2]: [s_store_sk#18, s_zip#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_zip), IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#18, s_zip#19] + +(20) Filter [codegen id : 3] +Input [2]: [s_store_sk#18, s_zip#19] +Condition : (isnotnull(s_zip#19) AND isnotnull(s_store_sk#18)) + +(21) BroadcastExchange +Input [2]: [s_store_sk#18, s_zip#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#18] +Join condition: None + +(23) Project [codegen id : 4] +Output [7]: [ss_customer_sk#2, ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, s_zip#19] +Input [9]: [ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, s_store_sk#18, s_zip#19] + +(24) Exchange +Input [7]: [ss_customer_sk#2, ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, s_zip#19] +Arguments: hashpartitioning(ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#21] + +(25) Sort [codegen id : 5] +Input [7]: [ss_customer_sk#2, ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, s_zip#19] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(26) Scan parquet default.customer +Output [2]: [c_customer_sk#22, c_current_addr_sk#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 6] +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] + +(28) Filter [codegen id : 6] +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Condition : (isnotnull(c_customer_sk#22) AND isnotnull(c_current_addr_sk#23)) + +(29) Exchange +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Arguments: hashpartitioning(c_current_addr_sk#23, 5), ENSURE_REQUIREMENTS, [id=#24] + +(30) Sort [codegen id : 7] +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Arguments: [c_current_addr_sk#23 ASC NULLS FIRST], false, 0 + +(31) Scan parquet default.customer_address +Output [2]: [ca_address_sk#25, ca_zip#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_zip)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 8] +Input [2]: [ca_address_sk#25, ca_zip#26] + +(33) Filter [codegen id : 8] +Input [2]: [ca_address_sk#25, ca_zip#26] +Condition : (isnotnull(ca_address_sk#25) AND isnotnull(ca_zip#26)) + +(34) Exchange +Input [2]: [ca_address_sk#25, ca_zip#26] +Arguments: hashpartitioning(ca_address_sk#25, 5), ENSURE_REQUIREMENTS, [id=#27] + +(35) Sort [codegen id : 9] +Input [2]: [ca_address_sk#25, ca_zip#26] +Arguments: [ca_address_sk#25 ASC NULLS FIRST], false, 0 + +(36) SortMergeJoin [codegen id : 10] +Left keys [1]: [c_current_addr_sk#23] +Right keys [1]: [ca_address_sk#25] +Join condition: None + +(37) Project [codegen id : 10] +Output [2]: [c_customer_sk#22, ca_zip#26] +Input [4]: [c_customer_sk#22, c_current_addr_sk#23, ca_address_sk#25, ca_zip#26] + +(38) Exchange +Input [2]: [c_customer_sk#22, ca_zip#26] +Arguments: hashpartitioning(c_customer_sk#22, 5), ENSURE_REQUIREMENTS, [id=#28] + +(39) Sort [codegen id : 11] +Input [2]: [c_customer_sk#22, ca_zip#26] +Arguments: [c_customer_sk#22 ASC NULLS FIRST], false, 0 + +(40) SortMergeJoin [codegen id : 12] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#22] +Join condition: NOT (substr(ca_zip#26, 1, 5) = substr(s_zip#19, 1, 5)) + +(41) Project [codegen id : 12] +Output [5]: [ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11] +Input [9]: [ss_customer_sk#2, ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11, s_zip#19, c_customer_sk#22, ca_zip#26] + +(42) HashAggregate [codegen id : 12] +Input [5]: [ss_ext_sales_price#4, i_brand_id#8, i_brand#9, i_manufact_id#10, i_manufact#11] +Keys [4]: [i_brand#9, i_brand_id#8, i_manufact_id#10, i_manufact#11] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#4))] +Aggregate Attributes [1]: [sum#29] +Results [5]: [i_brand#9, i_brand_id#8, i_manufact_id#10, i_manufact#11, sum#30] + +(43) Exchange +Input [5]: [i_brand#9, i_brand_id#8, i_manufact_id#10, i_manufact#11, sum#30] +Arguments: hashpartitioning(i_brand#9, i_brand_id#8, i_manufact_id#10, i_manufact#11, 5), ENSURE_REQUIREMENTS, [id=#31] + +(44) HashAggregate [codegen id : 13] +Input [5]: [i_brand#9, i_brand_id#8, i_manufact_id#10, i_manufact#11, sum#30] +Keys [4]: [i_brand#9, i_brand_id#8, i_manufact_id#10, i_manufact#11] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#4))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#4))#32] +Results [5]: [i_brand_id#8 AS brand_id#33, i_brand#9 AS brand#34, i_manufact_id#10, i_manufact#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#4))#32,17,2) AS ext_price#35] + +(45) TakeOrderedAndProject +Input [5]: [brand_id#33, brand#34, i_manufact_id#10, i_manufact#11, ext_price#35] +Arguments: 100, [ext_price#35 DESC NULLS LAST, brand#34 ASC NULLS FIRST, brand_id#33 ASC NULLS FIRST, i_manufact_id#10 ASC NULLS FIRST, i_manufact#11 ASC NULLS FIRST], [brand_id#33, brand#34, i_manufact_id#10, i_manufact#11, ext_price#35] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (46) + + +(46) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#14] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/simplified.txt new file mode 100644 index 0000000000000..a563ccd2a0106 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19.sf100/simplified.txt @@ -0,0 +1,78 @@ +TakeOrderedAndProject [ext_price,brand,brand_id,i_manufact_id,i_manufact] + WholeStageCodegen (13) + HashAggregate [i_brand,i_brand_id,i_manufact_id,i_manufact,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [i_brand,i_brand_id,i_manufact_id,i_manufact] #1 + WholeStageCodegen (12) + HashAggregate [i_brand,i_brand_id,i_manufact_id,i_manufact,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact] + SortMergeJoin [ss_customer_sk,c_customer_sk,ca_zip,s_zip] + InputAdapter + WholeStageCodegen (5) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #2 + WholeStageCodegen (4) + Project [ss_customer_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_customer_sk,ss_store_sk,ss_ext_sales_price,ss_sold_date_sk,i_brand_id,i_brand,i_manufact_id,i_manufact] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk,ss_customer_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact,i_manager_id] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [s_zip,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_zip] + InputAdapter + WholeStageCodegen (11) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #6 + WholeStageCodegen (10) + Project [c_customer_sk,ca_zip] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (7) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #7 + WholeStageCodegen (6) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (9) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #8 + WholeStageCodegen (8) + Filter [ca_address_sk,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_zip] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19/explain.txt new file mode 100644 index 0000000000000..e321ddc156860 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19/explain.txt @@ -0,0 +1,222 @@ +== Physical Plan == +TakeOrderedAndProject (39) ++- * HashAggregate (38) + +- Exchange (37) + +- * HashAggregate (36) + +- * Project (35) + +- * BroadcastHashJoin Inner BuildRight (34) + :- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Project (17) + : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.date_dim (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Filter (7) + : : : : +- * ColumnarToRow (6) + : : : : +- Scan parquet default.store_sales (5) + : : : +- BroadcastExchange (15) + : : : +- * Project (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.item (11) + : : +- BroadcastExchange (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.customer (18) + : +- BroadcastExchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.customer_address (24) + +- BroadcastExchange (33) + +- * Filter (32) + +- * ColumnarToRow (31) + +- Scan parquet default.store (30) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,1998), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 6] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 6] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 11)) AND (d_year#2 = 1998)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 6] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) Scan parquet default.store_sales +Output [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8] + +(7) Filter [codegen id : 1] +Input [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_item_sk#4) AND isnotnull(ss_customer_sk#5)) AND isnotnull(ss_store_sk#6)) + +(8) BroadcastExchange +Input [5]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[4, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#8] +Join condition: None + +(10) Project [codegen id : 6] +Output [4]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7] +Input [6]: [d_date_sk#1, ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, ss_sold_date_sk#8] + +(11) Scan parquet default.item +Output [6]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, i_manager_id#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,8), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [6]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, i_manager_id#15] + +(13) Filter [codegen id : 2] +Input [6]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, i_manager_id#15] +Condition : ((isnotnull(i_manager_id#15) AND (i_manager_id#15 = 8)) AND isnotnull(i_item_sk#10)) + +(14) Project [codegen id : 2] +Output [5]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14] +Input [6]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, i_manager_id#15] + +(15) BroadcastExchange +Input [5]: [i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(16) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#4] +Right keys [1]: [i_item_sk#10] +Join condition: None + +(17) Project [codegen id : 6] +Output [7]: [ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14] +Input [9]: [ss_item_sk#4, ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_item_sk#10, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14] + +(18) Scan parquet default.customer +Output [2]: [c_customer_sk#17, c_current_addr_sk#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [c_customer_sk#17, c_current_addr_sk#18] + +(20) Filter [codegen id : 3] +Input [2]: [c_customer_sk#17, c_current_addr_sk#18] +Condition : (isnotnull(c_customer_sk#17) AND isnotnull(c_current_addr_sk#18)) + +(21) BroadcastExchange +Input [2]: [c_customer_sk#17, c_current_addr_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] + +(22) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#5] +Right keys [1]: [c_customer_sk#17] +Join condition: None + +(23) Project [codegen id : 6] +Output [7]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, c_current_addr_sk#18] +Input [9]: [ss_customer_sk#5, ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, c_customer_sk#17, c_current_addr_sk#18] + +(24) Scan parquet default.customer_address +Output [2]: [ca_address_sk#20, ca_zip#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_zip)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [2]: [ca_address_sk#20, ca_zip#21] + +(26) Filter [codegen id : 4] +Input [2]: [ca_address_sk#20, ca_zip#21] +Condition : (isnotnull(ca_address_sk#20) AND isnotnull(ca_zip#21)) + +(27) BroadcastExchange +Input [2]: [ca_address_sk#20, ca_zip#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] + +(28) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [c_current_addr_sk#18] +Right keys [1]: [ca_address_sk#20] +Join condition: None + +(29) Project [codegen id : 6] +Output [7]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, ca_zip#21] +Input [9]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, c_current_addr_sk#18, ca_address_sk#20, ca_zip#21] + +(30) Scan parquet default.store +Output [2]: [s_store_sk#23, s_zip#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_zip), IsNotNull(s_store_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 5] +Input [2]: [s_store_sk#23, s_zip#24] + +(32) Filter [codegen id : 5] +Input [2]: [s_store_sk#23, s_zip#24] +Condition : (isnotnull(s_zip#24) AND isnotnull(s_store_sk#23)) + +(33) BroadcastExchange +Input [2]: [s_store_sk#23, s_zip#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] + +(34) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_store_sk#6] +Right keys [1]: [s_store_sk#23] +Join condition: NOT (substr(ca_zip#21, 1, 5) = substr(s_zip#24, 1, 5)) + +(35) Project [codegen id : 6] +Output [5]: [ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14] +Input [9]: [ss_store_sk#6, ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14, ca_zip#21, s_store_sk#23, s_zip#24] + +(36) HashAggregate [codegen id : 6] +Input [5]: [ss_ext_sales_price#7, i_brand_id#11, i_brand#12, i_manufact_id#13, i_manufact#14] +Keys [4]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#7))] +Aggregate Attributes [1]: [sum#26] +Results [5]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14, sum#27] + +(37) Exchange +Input [5]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14, sum#27] +Arguments: hashpartitioning(i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14, 5), ENSURE_REQUIREMENTS, [id=#28] + +(38) HashAggregate [codegen id : 7] +Input [5]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14, sum#27] +Keys [4]: [i_brand#12, i_brand_id#11, i_manufact_id#13, i_manufact#14] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#7))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#7))#29] +Results [5]: [i_brand_id#11 AS brand_id#30, i_brand#12 AS brand#31, i_manufact_id#13, i_manufact#14, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#7))#29,17,2) AS ext_price#32] + +(39) TakeOrderedAndProject +Input [5]: [brand_id#30, brand#31, i_manufact_id#13, i_manufact#14, ext_price#32] +Arguments: 100, [ext_price#32 DESC NULLS LAST, brand#31 ASC NULLS FIRST, brand_id#30 ASC NULLS FIRST, i_manufact_id#13 ASC NULLS FIRST, i_manufact#14 ASC NULLS FIRST], [brand_id#30, brand#31, i_manufact_id#13, i_manufact#14, ext_price#32] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19/simplified.txt new file mode 100644 index 0000000000000..4e00ccb014571 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q19/simplified.txt @@ -0,0 +1,58 @@ +TakeOrderedAndProject [ext_price,brand,brand_id,i_manufact_id,i_manufact] + WholeStageCodegen (7) + HashAggregate [i_brand,i_brand_id,i_manufact_id,i_manufact,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [i_brand,i_brand_id,i_manufact_id,i_manufact] #1 + WholeStageCodegen (6) + HashAggregate [i_brand,i_brand_id,i_manufact_id,i_manufact,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact] + BroadcastHashJoin [ss_store_sk,s_store_sk,ca_zip,s_zip] + Project [ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact,ca_zip] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact,c_current_addr_sk] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,ss_store_sk,ss_ext_sales_price,i_brand_id,i_brand,i_manufact_id,i_manufact] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_customer_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id,i_manufact,i_manager_id] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [ca_address_sk,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_zip] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Filter [s_zip,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_zip] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/explain.txt new file mode 100644 index 0000000000000..c31bb7470648f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/explain.txt @@ -0,0 +1,208 @@ +== Physical Plan == +* Sort (37) ++- Exchange (36) + +- * Project (35) + +- * BroadcastHashJoin Inner BuildRight (34) + :- * Project (23) + : +- * BroadcastHashJoin Inner BuildRight (22) + : :- * HashAggregate (16) + : : +- Exchange (15) + : : +- * HashAggregate (14) + : : +- * Project (13) + : : +- * BroadcastHashJoin Inner BuildRight (12) + : : :- Union (7) + : : : :- * Project (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.web_sales (1) + : : : +- * Project (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.catalog_sales (4) + : : +- BroadcastExchange (11) + : : +- * Filter (10) + : : +- * ColumnarToRow (9) + : : +- Scan parquet default.date_dim (8) + : +- BroadcastExchange (21) + : +- * Project (20) + : +- * Filter (19) + : +- * ColumnarToRow (18) + : +- Scan parquet default.date_dim (17) + +- BroadcastExchange (33) + +- * Project (32) + +- * BroadcastHashJoin Inner BuildRight (31) + :- * HashAggregate (25) + : +- ReusedExchange (24) + +- BroadcastExchange (30) + +- * Project (29) + +- * Filter (28) + +- * ColumnarToRow (27) + +- Scan parquet default.date_dim (26) + + +(1) Scan parquet default.web_sales +Output [2]: [ws_ext_sales_price#1, ws_sold_date_sk#2] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#2)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [2]: [ws_ext_sales_price#1, ws_sold_date_sk#2] + +(3) Project [codegen id : 1] +Output [2]: [ws_sold_date_sk#2 AS sold_date_sk#3, ws_ext_sales_price#1 AS sales_price#4] +Input [2]: [ws_ext_sales_price#1, ws_sold_date_sk#2] + +(4) Scan parquet default.catalog_sales +Output [2]: [cs_ext_sales_price#5, cs_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#6)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 2] +Input [2]: [cs_ext_sales_price#5, cs_sold_date_sk#6] + +(6) Project [codegen id : 2] +Output [2]: [cs_sold_date_sk#6 AS sold_date_sk#7, cs_ext_sales_price#5 AS sales_price#8] +Input [2]: [cs_ext_sales_price#5, cs_sold_date_sk#6] + +(7) Union + +(8) Scan parquet default.date_dim +Output [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)] +ReadSchema: struct + +(9) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] + +(10) Filter [codegen id : 3] +Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Condition : (isnotnull(d_date_sk#9) AND isnotnull(d_week_seq#10)) + +(11) BroadcastExchange +Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] + +(12) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [sold_date_sk#3] +Right keys [1]: [d_date_sk#9] +Join condition: None + +(13) Project [codegen id : 4] +Output [3]: [sales_price#4, d_week_seq#10, d_day_name#11] +Input [5]: [sold_date_sk#3, sales_price#4, d_date_sk#9, d_week_seq#10, d_day_name#11] + +(14) HashAggregate [codegen id : 4] +Input [3]: [sales_price#4, d_week_seq#10, d_day_name#11] +Keys [1]: [d_week_seq#10] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday ) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday ) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday ) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday ) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday ) THEN sales_price#4 ELSE null END))] +Aggregate Attributes [7]: [sum#13, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19] +Results [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] + +(15) Exchange +Input [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Arguments: hashpartitioning(d_week_seq#10, 5), ENSURE_REQUIREMENTS, [id=#27] + +(16) HashAggregate [codegen id : 12] +Input [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Keys [1]: [d_week_seq#10] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday ) THEN sales_price#4 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday ) THEN sales_price#4 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday ) THEN sales_price#4 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday ) THEN sales_price#4 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday ) THEN sales_price#4 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday ) THEN sales_price#4 ELSE null END))#34] +Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday ) THEN sales_price#4 ELSE null END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday ) THEN sales_price#4 ELSE null END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday ) THEN sales_price#4 ELSE null END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#31,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 ELSE null END))#32,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday ) THEN sales_price#4 ELSE null END))#33,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday ) THEN sales_price#4 ELSE null END))#34,17,2) AS sat_sales#41] + +(17) Scan parquet default.date_dim +Output [2]: [d_week_seq#42, d_year#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_week_seq)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 5] +Input [2]: [d_week_seq#42, d_year#43] + +(19) Filter [codegen id : 5] +Input [2]: [d_week_seq#42, d_year#43] +Condition : ((isnotnull(d_year#43) AND (d_year#43 = 2001)) AND isnotnull(d_week_seq#42)) + +(20) Project [codegen id : 5] +Output [1]: [d_week_seq#42] +Input [2]: [d_week_seq#42, d_year#43] + +(21) BroadcastExchange +Input [1]: [d_week_seq#42] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] + +(22) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [d_week_seq#10] +Right keys [1]: [d_week_seq#42] +Join condition: None + +(23) Project [codegen id : 12] +Output [8]: [d_week_seq#10 AS d_week_seq1#45, sun_sales#35 AS sun_sales1#46, mon_sales#36 AS mon_sales1#47, tue_sales#37 AS tue_sales1#48, wed_sales#38 AS wed_sales1#49, thu_sales#39 AS thu_sales1#50, fri_sales#40 AS fri_sales1#51, sat_sales#41 AS sat_sales1#52] +Input [9]: [d_week_seq#10, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41, d_week_seq#42] + +(24) ReusedExchange [Reuses operator id: 15] +Output [8]: [d_week_seq#53, sum#54, sum#55, sum#56, sum#57, sum#58, sum#59, sum#60] + +(25) HashAggregate [codegen id : 11] +Input [8]: [d_week_seq#53, sum#54, sum#55, sum#56, sum#57, sum#58, sum#59, sum#60] +Keys [1]: [d_week_seq#53] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#61 = Sunday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#61 = Monday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#61 = Tuesday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#61 = Wednesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#61 = Thursday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#61 = Friday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#61 = Saturday ) THEN sales_price#4 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#61 = Sunday ) THEN sales_price#4 ELSE null END))#62, sum(UnscaledValue(CASE WHEN (d_day_name#61 = Monday ) THEN sales_price#4 ELSE null END))#63, sum(UnscaledValue(CASE WHEN (d_day_name#61 = Tuesday ) THEN sales_price#4 ELSE null END))#64, sum(UnscaledValue(CASE WHEN (d_day_name#61 = Wednesday) THEN sales_price#4 ELSE null END))#65, sum(UnscaledValue(CASE WHEN (d_day_name#61 = Thursday ) THEN sales_price#4 ELSE null END))#66, sum(UnscaledValue(CASE WHEN (d_day_name#61 = Friday ) THEN sales_price#4 ELSE null END))#67, sum(UnscaledValue(CASE WHEN (d_day_name#61 = Saturday ) THEN sales_price#4 ELSE null END))#68] +Results [8]: [d_week_seq#53, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Sunday ) THEN sales_price#4 ELSE null END))#62,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Monday ) THEN sales_price#4 ELSE null END))#63,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Tuesday ) THEN sales_price#4 ELSE null END))#64,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Wednesday) THEN sales_price#4 ELSE null END))#65,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Thursday ) THEN sales_price#4 ELSE null END))#66,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Friday ) THEN sales_price#4 ELSE null END))#67,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Saturday ) THEN sales_price#4 ELSE null END))#68,17,2) AS sat_sales#41] + +(26) Scan parquet default.date_dim +Output [2]: [d_week_seq#69, d_year#70] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_week_seq)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 10] +Input [2]: [d_week_seq#69, d_year#70] + +(28) Filter [codegen id : 10] +Input [2]: [d_week_seq#69, d_year#70] +Condition : ((isnotnull(d_year#70) AND (d_year#70 = 2002)) AND isnotnull(d_week_seq#69)) + +(29) Project [codegen id : 10] +Output [1]: [d_week_seq#69] +Input [2]: [d_week_seq#69, d_year#70] + +(30) BroadcastExchange +Input [1]: [d_week_seq#69] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#71] + +(31) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [d_week_seq#53] +Right keys [1]: [d_week_seq#69] +Join condition: None + +(32) Project [codegen id : 11] +Output [8]: [d_week_seq#53 AS d_week_seq2#72, sun_sales#35 AS sun_sales2#73, mon_sales#36 AS mon_sales2#74, tue_sales#37 AS tue_sales2#75, wed_sales#38 AS wed_sales2#76, thu_sales#39 AS thu_sales2#77, fri_sales#40 AS fri_sales2#78, sat_sales#41 AS sat_sales2#79] +Input [9]: [d_week_seq#53, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41, d_week_seq#69] + +(33) BroadcastExchange +Input [8]: [d_week_seq2#72, sun_sales2#73, mon_sales2#74, tue_sales2#75, wed_sales2#76, thu_sales2#77, fri_sales2#78, sat_sales2#79] +Arguments: HashedRelationBroadcastMode(List(cast((input[0, int, true] - 53) as bigint)),false), [id=#80] + +(34) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [d_week_seq1#45] +Right keys [1]: [(d_week_seq2#72 - 53)] +Join condition: None + +(35) Project [codegen id : 12] +Output [8]: [d_week_seq1#45, round(CheckOverflow((promote_precision(sun_sales1#46) / promote_precision(sun_sales2#73)), DecimalType(37,20), true), 2) AS round((sun_sales1 / sun_sales2), 2)#81, round(CheckOverflow((promote_precision(mon_sales1#47) / promote_precision(mon_sales2#74)), DecimalType(37,20), true), 2) AS round((mon_sales1 / mon_sales2), 2)#82, round(CheckOverflow((promote_precision(tue_sales1#48) / promote_precision(tue_sales2#75)), DecimalType(37,20), true), 2) AS round((tue_sales1 / tue_sales2), 2)#83, round(CheckOverflow((promote_precision(wed_sales1#49) / promote_precision(wed_sales2#76)), DecimalType(37,20), true), 2) AS round((wed_sales1 / wed_sales2), 2)#84, round(CheckOverflow((promote_precision(thu_sales1#50) / promote_precision(thu_sales2#77)), DecimalType(37,20), true), 2) AS round((thu_sales1 / thu_sales2), 2)#85, round(CheckOverflow((promote_precision(fri_sales1#51) / promote_precision(fri_sales2#78)), DecimalType(37,20), true), 2) AS round((fri_sales1 / fri_sales2), 2)#86, round(CheckOverflow((promote_precision(sat_sales1#52) / promote_precision(sat_sales2#79)), DecimalType(37,20), true), 2) AS round((sat_sales1 / sat_sales2), 2)#87] +Input [16]: [d_week_seq1#45, sun_sales1#46, mon_sales1#47, tue_sales1#48, wed_sales1#49, thu_sales1#50, fri_sales1#51, sat_sales1#52, d_week_seq2#72, sun_sales2#73, mon_sales2#74, tue_sales2#75, wed_sales2#76, thu_sales2#77, fri_sales2#78, sat_sales2#79] + +(36) Exchange +Input [8]: [d_week_seq1#45, round((sun_sales1 / sun_sales2), 2)#81, round((mon_sales1 / mon_sales2), 2)#82, round((tue_sales1 / tue_sales2), 2)#83, round((wed_sales1 / wed_sales2), 2)#84, round((thu_sales1 / thu_sales2), 2)#85, round((fri_sales1 / fri_sales2), 2)#86, round((sat_sales1 / sat_sales2), 2)#87] +Arguments: rangepartitioning(d_week_seq1#45 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#88] + +(37) Sort [codegen id : 13] +Input [8]: [d_week_seq1#45, round((sun_sales1 / sun_sales2), 2)#81, round((mon_sales1 / mon_sales2), 2)#82, round((tue_sales1 / tue_sales2), 2)#83, round((wed_sales1 / wed_sales2), 2)#84, round((thu_sales1 / thu_sales2), 2)#85, round((fri_sales1 / fri_sales2), 2)#86, round((sat_sales1 / sat_sales2), 2)#87] +Arguments: [d_week_seq1#45 ASC NULLS FIRST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/simplified.txt new file mode 100644 index 0000000000000..036f9e8f9caa5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2.sf100/simplified.txt @@ -0,0 +1,59 @@ +WholeStageCodegen (13) + Sort [d_week_seq1] + InputAdapter + Exchange [d_week_seq1] #1 + WholeStageCodegen (12) + Project [d_week_seq1,sun_sales1,sun_sales2,mon_sales1,mon_sales2,tue_sales1,tue_sales2,wed_sales1,wed_sales2,thu_sales1,thu_sales2,fri_sales1,fri_sales2,sat_sales1,sat_sales2] + BroadcastHashJoin [d_week_seq1,d_week_seq2] + Project [d_week_seq,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + BroadcastHashJoin [d_week_seq,d_week_seq] + HashAggregate [d_week_seq,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + Exchange [d_week_seq] #2 + WholeStageCodegen (4) + HashAggregate [d_week_seq,d_day_name,sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,d_week_seq,d_day_name] + BroadcastHashJoin [sold_date_sk,d_date_sk] + InputAdapter + Union + WholeStageCodegen (1) + Project [ws_sold_date_sk,ws_ext_sales_price] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_ext_sales_price,ws_sold_date_sk] + WholeStageCodegen (2) + Project [cs_sold_date_sk,cs_ext_sales_price] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ext_sales_price,cs_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (3) + Filter [d_date_sk,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq,d_day_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (5) + Project [d_week_seq] + Filter [d_year,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (11) + Project [d_week_seq,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + BroadcastHashJoin [d_week_seq,d_week_seq] + HashAggregate [d_week_seq,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + ReusedExchange [d_week_seq,sum,sum,sum,sum,sum,sum,sum] #2 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (10) + Project [d_week_seq] + Filter [d_year,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt new file mode 100644 index 0000000000000..c31bb7470648f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/explain.txt @@ -0,0 +1,208 @@ +== Physical Plan == +* Sort (37) ++- Exchange (36) + +- * Project (35) + +- * BroadcastHashJoin Inner BuildRight (34) + :- * Project (23) + : +- * BroadcastHashJoin Inner BuildRight (22) + : :- * HashAggregate (16) + : : +- Exchange (15) + : : +- * HashAggregate (14) + : : +- * Project (13) + : : +- * BroadcastHashJoin Inner BuildRight (12) + : : :- Union (7) + : : : :- * Project (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.web_sales (1) + : : : +- * Project (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.catalog_sales (4) + : : +- BroadcastExchange (11) + : : +- * Filter (10) + : : +- * ColumnarToRow (9) + : : +- Scan parquet default.date_dim (8) + : +- BroadcastExchange (21) + : +- * Project (20) + : +- * Filter (19) + : +- * ColumnarToRow (18) + : +- Scan parquet default.date_dim (17) + +- BroadcastExchange (33) + +- * Project (32) + +- * BroadcastHashJoin Inner BuildRight (31) + :- * HashAggregate (25) + : +- ReusedExchange (24) + +- BroadcastExchange (30) + +- * Project (29) + +- * Filter (28) + +- * ColumnarToRow (27) + +- Scan parquet default.date_dim (26) + + +(1) Scan parquet default.web_sales +Output [2]: [ws_ext_sales_price#1, ws_sold_date_sk#2] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#2)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [2]: [ws_ext_sales_price#1, ws_sold_date_sk#2] + +(3) Project [codegen id : 1] +Output [2]: [ws_sold_date_sk#2 AS sold_date_sk#3, ws_ext_sales_price#1 AS sales_price#4] +Input [2]: [ws_ext_sales_price#1, ws_sold_date_sk#2] + +(4) Scan parquet default.catalog_sales +Output [2]: [cs_ext_sales_price#5, cs_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#6)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 2] +Input [2]: [cs_ext_sales_price#5, cs_sold_date_sk#6] + +(6) Project [codegen id : 2] +Output [2]: [cs_sold_date_sk#6 AS sold_date_sk#7, cs_ext_sales_price#5 AS sales_price#8] +Input [2]: [cs_ext_sales_price#5, cs_sold_date_sk#6] + +(7) Union + +(8) Scan parquet default.date_dim +Output [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)] +ReadSchema: struct + +(9) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] + +(10) Filter [codegen id : 3] +Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Condition : (isnotnull(d_date_sk#9) AND isnotnull(d_week_seq#10)) + +(11) BroadcastExchange +Input [3]: [d_date_sk#9, d_week_seq#10, d_day_name#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] + +(12) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [sold_date_sk#3] +Right keys [1]: [d_date_sk#9] +Join condition: None + +(13) Project [codegen id : 4] +Output [3]: [sales_price#4, d_week_seq#10, d_day_name#11] +Input [5]: [sold_date_sk#3, sales_price#4, d_date_sk#9, d_week_seq#10, d_day_name#11] + +(14) HashAggregate [codegen id : 4] +Input [3]: [sales_price#4, d_week_seq#10, d_day_name#11] +Keys [1]: [d_week_seq#10] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday ) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday ) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday ) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday ) THEN sales_price#4 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday ) THEN sales_price#4 ELSE null END))] +Aggregate Attributes [7]: [sum#13, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19] +Results [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] + +(15) Exchange +Input [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Arguments: hashpartitioning(d_week_seq#10, 5), ENSURE_REQUIREMENTS, [id=#27] + +(16) HashAggregate [codegen id : 12] +Input [8]: [d_week_seq#10, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Keys [1]: [d_week_seq#10] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday ) THEN sales_price#4 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday ) THEN sales_price#4 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday ) THEN sales_price#4 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday ) THEN sales_price#4 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday ) THEN sales_price#4 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday ) THEN sales_price#4 ELSE null END))#34] +Results [8]: [d_week_seq#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Sunday ) THEN sales_price#4 ELSE null END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Monday ) THEN sales_price#4 ELSE null END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Tuesday ) THEN sales_price#4 ELSE null END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Wednesday) THEN sales_price#4 ELSE null END))#31,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Thursday ) THEN sales_price#4 ELSE null END))#32,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Friday ) THEN sales_price#4 ELSE null END))#33,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#11 = Saturday ) THEN sales_price#4 ELSE null END))#34,17,2) AS sat_sales#41] + +(17) Scan parquet default.date_dim +Output [2]: [d_week_seq#42, d_year#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_week_seq)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 5] +Input [2]: [d_week_seq#42, d_year#43] + +(19) Filter [codegen id : 5] +Input [2]: [d_week_seq#42, d_year#43] +Condition : ((isnotnull(d_year#43) AND (d_year#43 = 2001)) AND isnotnull(d_week_seq#42)) + +(20) Project [codegen id : 5] +Output [1]: [d_week_seq#42] +Input [2]: [d_week_seq#42, d_year#43] + +(21) BroadcastExchange +Input [1]: [d_week_seq#42] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] + +(22) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [d_week_seq#10] +Right keys [1]: [d_week_seq#42] +Join condition: None + +(23) Project [codegen id : 12] +Output [8]: [d_week_seq#10 AS d_week_seq1#45, sun_sales#35 AS sun_sales1#46, mon_sales#36 AS mon_sales1#47, tue_sales#37 AS tue_sales1#48, wed_sales#38 AS wed_sales1#49, thu_sales#39 AS thu_sales1#50, fri_sales#40 AS fri_sales1#51, sat_sales#41 AS sat_sales1#52] +Input [9]: [d_week_seq#10, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41, d_week_seq#42] + +(24) ReusedExchange [Reuses operator id: 15] +Output [8]: [d_week_seq#53, sum#54, sum#55, sum#56, sum#57, sum#58, sum#59, sum#60] + +(25) HashAggregate [codegen id : 11] +Input [8]: [d_week_seq#53, sum#54, sum#55, sum#56, sum#57, sum#58, sum#59, sum#60] +Keys [1]: [d_week_seq#53] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#61 = Sunday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#61 = Monday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#61 = Tuesday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#61 = Wednesday) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#61 = Thursday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#61 = Friday ) THEN sales_price#4 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#61 = Saturday ) THEN sales_price#4 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#61 = Sunday ) THEN sales_price#4 ELSE null END))#62, sum(UnscaledValue(CASE WHEN (d_day_name#61 = Monday ) THEN sales_price#4 ELSE null END))#63, sum(UnscaledValue(CASE WHEN (d_day_name#61 = Tuesday ) THEN sales_price#4 ELSE null END))#64, sum(UnscaledValue(CASE WHEN (d_day_name#61 = Wednesday) THEN sales_price#4 ELSE null END))#65, sum(UnscaledValue(CASE WHEN (d_day_name#61 = Thursday ) THEN sales_price#4 ELSE null END))#66, sum(UnscaledValue(CASE WHEN (d_day_name#61 = Friday ) THEN sales_price#4 ELSE null END))#67, sum(UnscaledValue(CASE WHEN (d_day_name#61 = Saturday ) THEN sales_price#4 ELSE null END))#68] +Results [8]: [d_week_seq#53, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Sunday ) THEN sales_price#4 ELSE null END))#62,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Monday ) THEN sales_price#4 ELSE null END))#63,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Tuesday ) THEN sales_price#4 ELSE null END))#64,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Wednesday) THEN sales_price#4 ELSE null END))#65,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Thursday ) THEN sales_price#4 ELSE null END))#66,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Friday ) THEN sales_price#4 ELSE null END))#67,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#61 = Saturday ) THEN sales_price#4 ELSE null END))#68,17,2) AS sat_sales#41] + +(26) Scan parquet default.date_dim +Output [2]: [d_week_seq#69, d_year#70] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_week_seq)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 10] +Input [2]: [d_week_seq#69, d_year#70] + +(28) Filter [codegen id : 10] +Input [2]: [d_week_seq#69, d_year#70] +Condition : ((isnotnull(d_year#70) AND (d_year#70 = 2002)) AND isnotnull(d_week_seq#69)) + +(29) Project [codegen id : 10] +Output [1]: [d_week_seq#69] +Input [2]: [d_week_seq#69, d_year#70] + +(30) BroadcastExchange +Input [1]: [d_week_seq#69] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#71] + +(31) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [d_week_seq#53] +Right keys [1]: [d_week_seq#69] +Join condition: None + +(32) Project [codegen id : 11] +Output [8]: [d_week_seq#53 AS d_week_seq2#72, sun_sales#35 AS sun_sales2#73, mon_sales#36 AS mon_sales2#74, tue_sales#37 AS tue_sales2#75, wed_sales#38 AS wed_sales2#76, thu_sales#39 AS thu_sales2#77, fri_sales#40 AS fri_sales2#78, sat_sales#41 AS sat_sales2#79] +Input [9]: [d_week_seq#53, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41, d_week_seq#69] + +(33) BroadcastExchange +Input [8]: [d_week_seq2#72, sun_sales2#73, mon_sales2#74, tue_sales2#75, wed_sales2#76, thu_sales2#77, fri_sales2#78, sat_sales2#79] +Arguments: HashedRelationBroadcastMode(List(cast((input[0, int, true] - 53) as bigint)),false), [id=#80] + +(34) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [d_week_seq1#45] +Right keys [1]: [(d_week_seq2#72 - 53)] +Join condition: None + +(35) Project [codegen id : 12] +Output [8]: [d_week_seq1#45, round(CheckOverflow((promote_precision(sun_sales1#46) / promote_precision(sun_sales2#73)), DecimalType(37,20), true), 2) AS round((sun_sales1 / sun_sales2), 2)#81, round(CheckOverflow((promote_precision(mon_sales1#47) / promote_precision(mon_sales2#74)), DecimalType(37,20), true), 2) AS round((mon_sales1 / mon_sales2), 2)#82, round(CheckOverflow((promote_precision(tue_sales1#48) / promote_precision(tue_sales2#75)), DecimalType(37,20), true), 2) AS round((tue_sales1 / tue_sales2), 2)#83, round(CheckOverflow((promote_precision(wed_sales1#49) / promote_precision(wed_sales2#76)), DecimalType(37,20), true), 2) AS round((wed_sales1 / wed_sales2), 2)#84, round(CheckOverflow((promote_precision(thu_sales1#50) / promote_precision(thu_sales2#77)), DecimalType(37,20), true), 2) AS round((thu_sales1 / thu_sales2), 2)#85, round(CheckOverflow((promote_precision(fri_sales1#51) / promote_precision(fri_sales2#78)), DecimalType(37,20), true), 2) AS round((fri_sales1 / fri_sales2), 2)#86, round(CheckOverflow((promote_precision(sat_sales1#52) / promote_precision(sat_sales2#79)), DecimalType(37,20), true), 2) AS round((sat_sales1 / sat_sales2), 2)#87] +Input [16]: [d_week_seq1#45, sun_sales1#46, mon_sales1#47, tue_sales1#48, wed_sales1#49, thu_sales1#50, fri_sales1#51, sat_sales1#52, d_week_seq2#72, sun_sales2#73, mon_sales2#74, tue_sales2#75, wed_sales2#76, thu_sales2#77, fri_sales2#78, sat_sales2#79] + +(36) Exchange +Input [8]: [d_week_seq1#45, round((sun_sales1 / sun_sales2), 2)#81, round((mon_sales1 / mon_sales2), 2)#82, round((tue_sales1 / tue_sales2), 2)#83, round((wed_sales1 / wed_sales2), 2)#84, round((thu_sales1 / thu_sales2), 2)#85, round((fri_sales1 / fri_sales2), 2)#86, round((sat_sales1 / sat_sales2), 2)#87] +Arguments: rangepartitioning(d_week_seq1#45 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#88] + +(37) Sort [codegen id : 13] +Input [8]: [d_week_seq1#45, round((sun_sales1 / sun_sales2), 2)#81, round((mon_sales1 / mon_sales2), 2)#82, round((tue_sales1 / tue_sales2), 2)#83, round((wed_sales1 / wed_sales2), 2)#84, round((thu_sales1 / thu_sales2), 2)#85, round((fri_sales1 / fri_sales2), 2)#86, round((sat_sales1 / sat_sales2), 2)#87] +Arguments: [d_week_seq1#45 ASC NULLS FIRST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt new file mode 100644 index 0000000000000..036f9e8f9caa5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q2/simplified.txt @@ -0,0 +1,59 @@ +WholeStageCodegen (13) + Sort [d_week_seq1] + InputAdapter + Exchange [d_week_seq1] #1 + WholeStageCodegen (12) + Project [d_week_seq1,sun_sales1,sun_sales2,mon_sales1,mon_sales2,tue_sales1,tue_sales2,wed_sales1,wed_sales2,thu_sales1,thu_sales2,fri_sales1,fri_sales2,sat_sales1,sat_sales2] + BroadcastHashJoin [d_week_seq1,d_week_seq2] + Project [d_week_seq,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + BroadcastHashJoin [d_week_seq,d_week_seq] + HashAggregate [d_week_seq,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + Exchange [d_week_seq] #2 + WholeStageCodegen (4) + HashAggregate [d_week_seq,d_day_name,sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,d_week_seq,d_day_name] + BroadcastHashJoin [sold_date_sk,d_date_sk] + InputAdapter + Union + WholeStageCodegen (1) + Project [ws_sold_date_sk,ws_ext_sales_price] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_ext_sales_price,ws_sold_date_sk] + WholeStageCodegen (2) + Project [cs_sold_date_sk,cs_ext_sales_price] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ext_sales_price,cs_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (3) + Filter [d_date_sk,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq,d_day_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (5) + Project [d_week_seq] + Filter [d_year,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (11) + Project [d_week_seq,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + BroadcastHashJoin [d_week_seq,d_week_seq] + HashAggregate [d_week_seq,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + ReusedExchange [d_week_seq,sum,sum,sum,sum,sum,sum,sum] #2 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (10) + Project [d_week_seq] + Filter [d_year,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt new file mode 100644 index 0000000000000..d6bbbfc515205 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/explain.txt @@ -0,0 +1,163 @@ +== Physical Plan == +TakeOrderedAndProject (27) ++- * Project (26) + +- Window (25) + +- * Sort (24) + +- Exchange (23) + +- * HashAggregate (22) + +- Exchange (21) + +- * HashAggregate (20) + +- * Project (19) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.catalog_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) + +- * Filter (15) + +- * ColumnarToRow (14) + +- Scan parquet default.date_dim (13) + + +(1) Scan parquet default.catalog_sales +Output [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#3), dynamicpruningexpression(cs_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] + +(3) Filter [codegen id : 1] +Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] +Condition : isnotnull(cs_item_sk#1) + +(4) Exchange +Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] +Arguments: hashpartitioning(cs_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#5] + +(5) Sort [codegen id : 2] +Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] +Arguments: [cs_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.item +Output [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports ,Books ,Home ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] + +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Condition : (i_category#11 IN (Sports ,Books ,Home ) AND isnotnull(i_item_sk#6)) + +(9) Exchange +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Arguments: hashpartitioning(i_item_sk#6, 5), ENSURE_REQUIREMENTS, [id=#12] + +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 + +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [cs_item_sk#1] +Right keys [1]: [i_item_sk#6] +Join condition: None + +(12) Project [codegen id : 6] +Output [7]: [cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Input [9]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] + +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#13, d_date#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#13, d_date#14] + +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#13, d_date#14] +Condition : (((isnotnull(d_date#14) AND (d_date#14 >= 1999-02-22)) AND (d_date#14 <= 1999-03-24)) AND isnotnull(d_date_sk#13)) + +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#13] +Input [2]: [d_date_sk#13, d_date#14] + +(17) BroadcastExchange +Input [1]: [d_date_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#3] +Right keys [1]: [d_date_sk#13] +Join condition: None + +(19) Project [codegen id : 6] +Output [6]: [cs_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Input [8]: [cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11, d_date_sk#13] + +(20) HashAggregate [codegen id : 6] +Input [6]: [cs_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#16] +Results [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] + +(21) Exchange +Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] +Arguments: hashpartitioning(i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, 5), ENSURE_REQUIREMENTS, [id=#18] + +(22) HashAggregate [codegen id : 7] +Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] +Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#2))#19] +Results [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#19,17,2) AS itemrevenue#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#19,17,2) AS _w0#21, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#19,17,2) AS _w1#22, i_item_id#7] + +(23) Exchange +Input [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, i_item_id#7] +Arguments: hashpartitioning(i_class#10, 5), ENSURE_REQUIREMENTS, [id=#23] + +(24) Sort [codegen id : 8] +Input [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, i_item_id#7] +Arguments: [i_class#10 ASC NULLS FIRST], false, 0 + +(25) Window +Input [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, i_item_id#7] +Arguments: [sum(_w1#22) windowspecdefinition(i_class#10, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#24], [i_class#10] + +(26) Project [codegen id : 9] +Output [7]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#21) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#24)), DecimalType(38,17), true) AS revenueratio#25, i_item_id#7] +Input [9]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, i_item_id#7, _we0#24] + +(27) TakeOrderedAndProject +Input [7]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25, i_item_id#7] +Arguments: 100, [i_category#11 ASC NULLS FIRST, i_class#10 ASC NULLS FIRST, i_item_id#7 ASC NULLS FIRST, i_item_desc#8 ASC NULLS FIRST, revenueratio#25 ASC NULLS FIRST], [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (28) + + +(28) ReusedExchange [Reuses operator id: 17] +Output [1]: [d_date_sk#13] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt new file mode 100644 index 0000000000000..bc14161be8ee2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20.sf100/simplified.txt @@ -0,0 +1,49 @@ +TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_current_price,itemrevenue] + WholeStageCodegen (9) + Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0,i_item_id] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (8) + Sort [i_class] + InputAdapter + Exchange [i_class] #1 + WholeStageCodegen (7) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(cs_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #2 + WholeStageCodegen (6) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,cs_ext_sales_price] [sum,sum] + Project [cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_ext_sales_price,cs_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [cs_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #3 + WholeStageCodegen (1) + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20/explain.txt new file mode 100644 index 0000000000000..4f5eebc0c300c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20/explain.txt @@ -0,0 +1,148 @@ +== Physical Plan == +TakeOrderedAndProject (24) ++- * Project (23) + +- Window (22) + +- * Sort (21) + +- Exchange (20) + +- * HashAggregate (19) + +- Exchange (18) + +- * HashAggregate (17) + +- * Project (16) + +- * BroadcastHashJoin Inner BuildRight (15) + :- * Project (9) + : +- * BroadcastHashJoin Inner BuildRight (8) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.catalog_sales (1) + : +- BroadcastExchange (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) + +- BroadcastExchange (14) + +- * Project (13) + +- * Filter (12) + +- * ColumnarToRow (11) + +- Scan parquet default.date_dim (10) + + +(1) Scan parquet default.catalog_sales +Output [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#3), dynamicpruningexpression(cs_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] +Condition : isnotnull(cs_item_sk#1) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports ,Books ,Home ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports ,Books ,Home ) AND isnotnull(i_item_sk#5)) + +(7) BroadcastExchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(9) Project [codegen id : 3] +Output [7]: [cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 1999-02-22)) AND (d_date#13 <= 1999-03-24)) AND isnotnull(d_date_sk#12)) + +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] + +(14) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#3] +Right keys [1]: [d_date_sk#12] +Join condition: None + +(16) Project [codegen id : 3] +Output [6]: [cs_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] + +(17) HashAggregate [codegen id : 3] +Input [6]: [cs_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#15] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] + +(18) Exchange +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), ENSURE_REQUIREMENTS, [id=#17] + +(19) HashAggregate [codegen id : 4] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#2))#18] +Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#18,17,2) AS _w1#21, i_item_id#6] + +(20) Exchange +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: hashpartitioning(i_class#9, 5), ENSURE_REQUIREMENTS, [id=#22] + +(21) Sort [codegen id : 5] +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 + +(22) Window +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] + +(23) Project [codegen id : 6] +Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#6] +Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6, _we0#23] + +(24) TakeOrderedAndProject +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] +Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (25) + + +(25) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20/simplified.txt new file mode 100644 index 0000000000000..d971de651c863 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q20/simplified.txt @@ -0,0 +1,40 @@ +TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_current_price,itemrevenue] + WholeStageCodegen (6) + Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0,i_item_id] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (5) + Sort [i_class] + InputAdapter + Exchange [i_class] #1 + WholeStageCodegen (4) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(cs_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #2 + WholeStageCodegen (3) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,cs_ext_sales_price] [sum,sum] + Project [cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_ext_sales_price,cs_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/explain.txt new file mode 100644 index 0000000000000..efb45b5ccdb7f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/explain.txt @@ -0,0 +1,166 @@ +== Physical Plan == +TakeOrderedAndProject (27) ++- * Filter (26) + +- * HashAggregate (25) + +- Exchange (24) + +- * HashAggregate (23) + +- * Project (22) + +- * BroadcastHashJoin Inner BuildRight (21) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.inventory (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.item (4) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.date_dim (11) + +- BroadcastExchange (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.warehouse (17) + + +(1) Scan parquet default.inventory +Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(inv_warehouse_sk), IsNotNull(inv_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Condition : (isnotnull(inv_warehouse_sk#2) AND isnotnull(inv_item_sk#1)) + +(4) Scan parquet default.item +Output [3]: [i_item_sk#6, i_item_id#7, i_current_price#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,0.99), LessThanOrEqual(i_current_price,1.49), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [i_item_sk#6, i_item_id#7, i_current_price#8] + +(6) Filter [codegen id : 1] +Input [3]: [i_item_sk#6, i_item_id#7, i_current_price#8] +Condition : (((isnotnull(i_current_price#8) AND (i_current_price#8 >= 0.99)) AND (i_current_price#8 <= 1.49)) AND isnotnull(i_item_sk#6)) + +(7) Project [codegen id : 1] +Output [2]: [i_item_sk#6, i_item_id#7] +Input [3]: [i_item_sk#6, i_item_id#7, i_current_price#8] + +(8) BroadcastExchange +Input [2]: [i_item_sk#6, i_item_id#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_item_sk#1] +Right keys [1]: [i_item_sk#6] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, i_item_id#7] +Input [6]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6, i_item_id#7] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#10, d_date#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-02-10), LessThanOrEqual(d_date,2000-04-10), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#10, d_date#11] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#10, d_date#11] +Condition : (((isnotnull(d_date#11) AND (d_date#11 >= 2000-02-10)) AND (d_date#11 <= 2000-04-10)) AND isnotnull(d_date_sk#10)) + +(14) BroadcastExchange +Input [2]: [d_date_sk#10, d_date#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_date_sk#4] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(16) Project [codegen id : 4] +Output [4]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, i_item_id#7, d_date#11] +Input [6]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, i_item_id#7, d_date_sk#10, d_date#11] + +(17) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#13, w_warehouse_name#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [2]: [w_warehouse_sk#13, w_warehouse_name#14] + +(19) Filter [codegen id : 3] +Input [2]: [w_warehouse_sk#13, w_warehouse_name#14] +Condition : isnotnull(w_warehouse_sk#13) + +(20) BroadcastExchange +Input [2]: [w_warehouse_sk#13, w_warehouse_name#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_warehouse_sk#2] +Right keys [1]: [w_warehouse_sk#13] +Join condition: None + +(22) Project [codegen id : 4] +Output [4]: [inv_quantity_on_hand#3, w_warehouse_name#14, i_item_id#7, d_date#11] +Input [6]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, i_item_id#7, d_date#11, w_warehouse_sk#13, w_warehouse_name#14] + +(23) HashAggregate [codegen id : 4] +Input [4]: [inv_quantity_on_hand#3, w_warehouse_name#14, i_item_id#7, d_date#11] +Keys [2]: [w_warehouse_name#14, i_item_id#7] +Functions [2]: [partial_sum(CASE WHEN (d_date#11 < 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END), partial_sum(CASE WHEN (d_date#11 >= 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)] +Aggregate Attributes [2]: [sum#16, sum#17] +Results [4]: [w_warehouse_name#14, i_item_id#7, sum#18, sum#19] + +(24) Exchange +Input [4]: [w_warehouse_name#14, i_item_id#7, sum#18, sum#19] +Arguments: hashpartitioning(w_warehouse_name#14, i_item_id#7, 5), ENSURE_REQUIREMENTS, [id=#20] + +(25) HashAggregate [codegen id : 5] +Input [4]: [w_warehouse_name#14, i_item_id#7, sum#18, sum#19] +Keys [2]: [w_warehouse_name#14, i_item_id#7] +Functions [2]: [sum(CASE WHEN (d_date#11 < 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END), sum(CASE WHEN (d_date#11 >= 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)] +Aggregate Attributes [2]: [sum(CASE WHEN (d_date#11 < 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)#21, sum(CASE WHEN (d_date#11 >= 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)#22] +Results [4]: [w_warehouse_name#14, i_item_id#7, sum(CASE WHEN (d_date#11 < 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)#21 AS inv_before#23, sum(CASE WHEN (d_date#11 >= 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)#22 AS inv_after#24] + +(26) Filter [codegen id : 5] +Input [4]: [w_warehouse_name#14, i_item_id#7, inv_before#23, inv_after#24] +Condition : ((isnotnull(inv_before#23) AND isnotnull(inv_after#24)) AND (((inv_before#23 > 0) AND ((cast(inv_after#24 as double) / cast(inv_before#23 as double)) >= 0.666667)) AND ((cast(inv_after#24 as double) / cast(inv_before#23 as double)) <= 1.5))) + +(27) TakeOrderedAndProject +Input [4]: [w_warehouse_name#14, i_item_id#7, inv_before#23, inv_after#24] +Arguments: 100, [w_warehouse_name#14 ASC NULLS FIRST, i_item_id#7 ASC NULLS FIRST], [w_warehouse_name#14, i_item_id#7, inv_before#23, inv_after#24] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5 +ReusedExchange (28) + + +(28) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#10, d_date#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/simplified.txt new file mode 100644 index 0000000000000..6cecd2af48359 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21.sf100/simplified.txt @@ -0,0 +1,42 @@ +TakeOrderedAndProject [w_warehouse_name,i_item_id,inv_before,inv_after] + WholeStageCodegen (5) + Filter [inv_before,inv_after] + HashAggregate [w_warehouse_name,i_item_id,sum,sum] [sum(CASE WHEN (d_date < 2000-03-11) THEN inv_quantity_on_hand ELSE 0 END),sum(CASE WHEN (d_date >= 2000-03-11) THEN inv_quantity_on_hand ELSE 0 END),inv_before,inv_after,sum,sum] + InputAdapter + Exchange [w_warehouse_name,i_item_id] #1 + WholeStageCodegen (4) + HashAggregate [w_warehouse_name,i_item_id,d_date,inv_quantity_on_hand] [sum,sum,sum,sum] + Project [inv_quantity_on_hand,w_warehouse_name,i_item_id,d_date] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,i_item_id,d_date] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk,i_item_id] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Filter [inv_warehouse_sk,inv_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_item_id] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_current_price] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21/explain.txt new file mode 100644 index 0000000000000..7fcbe1befa6b4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21/explain.txt @@ -0,0 +1,166 @@ +== Physical Plan == +TakeOrderedAndProject (27) ++- * Filter (26) + +- * HashAggregate (25) + +- Exchange (24) + +- * HashAggregate (23) + +- * Project (22) + +- * BroadcastHashJoin Inner BuildRight (21) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (9) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.inventory (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.warehouse (4) + : +- BroadcastExchange (14) + : +- * Project (13) + : +- * Filter (12) + : +- * ColumnarToRow (11) + : +- Scan parquet default.item (10) + +- BroadcastExchange (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.date_dim (17) + + +(1) Scan parquet default.inventory +Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(inv_warehouse_sk), IsNotNull(inv_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Condition : (isnotnull(inv_warehouse_sk#2) AND isnotnull(inv_item_sk#1)) + +(4) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#6, w_warehouse_name#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [w_warehouse_sk#6, w_warehouse_name#7] + +(6) Filter [codegen id : 1] +Input [2]: [w_warehouse_sk#6, w_warehouse_name#7] +Condition : isnotnull(w_warehouse_sk#6) + +(7) BroadcastExchange +Input [2]: [w_warehouse_sk#6, w_warehouse_name#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] + +(8) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_warehouse_sk#2] +Right keys [1]: [w_warehouse_sk#6] +Join condition: None + +(9) Project [codegen id : 4] +Output [4]: [inv_item_sk#1, inv_quantity_on_hand#3, inv_date_sk#4, w_warehouse_name#7] +Input [6]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, w_warehouse_sk#6, w_warehouse_name#7] + +(10) Scan parquet default.item +Output [3]: [i_item_sk#9, i_item_id#10, i_current_price#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,0.99), LessThanOrEqual(i_current_price,1.49), IsNotNull(i_item_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [i_item_sk#9, i_item_id#10, i_current_price#11] + +(12) Filter [codegen id : 2] +Input [3]: [i_item_sk#9, i_item_id#10, i_current_price#11] +Condition : (((isnotnull(i_current_price#11) AND (i_current_price#11 >= 0.99)) AND (i_current_price#11 <= 1.49)) AND isnotnull(i_item_sk#9)) + +(13) Project [codegen id : 2] +Output [2]: [i_item_sk#9, i_item_id#10] +Input [3]: [i_item_sk#9, i_item_id#10, i_current_price#11] + +(14) BroadcastExchange +Input [2]: [i_item_sk#9, i_item_id#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_item_sk#1] +Right keys [1]: [i_item_sk#9] +Join condition: None + +(16) Project [codegen id : 4] +Output [4]: [inv_quantity_on_hand#3, inv_date_sk#4, w_warehouse_name#7, i_item_id#10] +Input [6]: [inv_item_sk#1, inv_quantity_on_hand#3, inv_date_sk#4, w_warehouse_name#7, i_item_sk#9, i_item_id#10] + +(17) Scan parquet default.date_dim +Output [2]: [d_date_sk#13, d_date#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-02-10), LessThanOrEqual(d_date,2000-04-10), IsNotNull(d_date_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#13, d_date#14] + +(19) Filter [codegen id : 3] +Input [2]: [d_date_sk#13, d_date#14] +Condition : (((isnotnull(d_date#14) AND (d_date#14 >= 2000-02-10)) AND (d_date#14 <= 2000-04-10)) AND isnotnull(d_date_sk#13)) + +(20) BroadcastExchange +Input [2]: [d_date_sk#13, d_date#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_date_sk#4] +Right keys [1]: [d_date_sk#13] +Join condition: None + +(22) Project [codegen id : 4] +Output [4]: [inv_quantity_on_hand#3, w_warehouse_name#7, i_item_id#10, d_date#14] +Input [6]: [inv_quantity_on_hand#3, inv_date_sk#4, w_warehouse_name#7, i_item_id#10, d_date_sk#13, d_date#14] + +(23) HashAggregate [codegen id : 4] +Input [4]: [inv_quantity_on_hand#3, w_warehouse_name#7, i_item_id#10, d_date#14] +Keys [2]: [w_warehouse_name#7, i_item_id#10] +Functions [2]: [partial_sum(CASE WHEN (d_date#14 < 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END), partial_sum(CASE WHEN (d_date#14 >= 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)] +Aggregate Attributes [2]: [sum#16, sum#17] +Results [4]: [w_warehouse_name#7, i_item_id#10, sum#18, sum#19] + +(24) Exchange +Input [4]: [w_warehouse_name#7, i_item_id#10, sum#18, sum#19] +Arguments: hashpartitioning(w_warehouse_name#7, i_item_id#10, 5), ENSURE_REQUIREMENTS, [id=#20] + +(25) HashAggregate [codegen id : 5] +Input [4]: [w_warehouse_name#7, i_item_id#10, sum#18, sum#19] +Keys [2]: [w_warehouse_name#7, i_item_id#10] +Functions [2]: [sum(CASE WHEN (d_date#14 < 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END), sum(CASE WHEN (d_date#14 >= 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)] +Aggregate Attributes [2]: [sum(CASE WHEN (d_date#14 < 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)#21, sum(CASE WHEN (d_date#14 >= 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)#22] +Results [4]: [w_warehouse_name#7, i_item_id#10, sum(CASE WHEN (d_date#14 < 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)#21 AS inv_before#23, sum(CASE WHEN (d_date#14 >= 2000-03-11) THEN inv_quantity_on_hand#3 ELSE 0 END)#22 AS inv_after#24] + +(26) Filter [codegen id : 5] +Input [4]: [w_warehouse_name#7, i_item_id#10, inv_before#23, inv_after#24] +Condition : ((isnotnull(inv_before#23) AND isnotnull(inv_after#24)) AND (((inv_before#23 > 0) AND ((cast(inv_after#24 as double) / cast(inv_before#23 as double)) >= 0.666667)) AND ((cast(inv_after#24 as double) / cast(inv_before#23 as double)) <= 1.5))) + +(27) TakeOrderedAndProject +Input [4]: [w_warehouse_name#7, i_item_id#10, inv_before#23, inv_after#24] +Arguments: 100, [w_warehouse_name#7 ASC NULLS FIRST, i_item_id#10 ASC NULLS FIRST], [w_warehouse_name#7, i_item_id#10, inv_before#23, inv_after#24] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5 +ReusedExchange (28) + + +(28) ReusedExchange [Reuses operator id: 20] +Output [2]: [d_date_sk#13, d_date#14] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21/simplified.txt new file mode 100644 index 0000000000000..7431f803c13b7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q21/simplified.txt @@ -0,0 +1,42 @@ +TakeOrderedAndProject [w_warehouse_name,i_item_id,inv_before,inv_after] + WholeStageCodegen (5) + Filter [inv_before,inv_after] + HashAggregate [w_warehouse_name,i_item_id,sum,sum] [sum(CASE WHEN (d_date < 2000-03-11) THEN inv_quantity_on_hand ELSE 0 END),sum(CASE WHEN (d_date >= 2000-03-11) THEN inv_quantity_on_hand ELSE 0 END),inv_before,inv_after,sum,sum] + InputAdapter + Exchange [w_warehouse_name,i_item_id] #1 + WholeStageCodegen (4) + HashAggregate [w_warehouse_name,i_item_id,d_date,inv_quantity_on_hand] [sum,sum,sum,sum] + Project [inv_quantity_on_hand,w_warehouse_name,i_item_id,d_date] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [inv_quantity_on_hand,inv_date_sk,w_warehouse_name,i_item_id] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Project [inv_item_sk,inv_quantity_on_hand,inv_date_sk,w_warehouse_name] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Filter [inv_warehouse_sk,inv_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [i_item_sk,i_item_id] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_current_price] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt new file mode 100644 index 0000000000000..db9e7c70fbc21 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/explain.txt @@ -0,0 +1,181 @@ +== Physical Plan == +TakeOrderedAndProject (30) ++- * HashAggregate (29) + +- Exchange (28) + +- * HashAggregate (27) + +- * Expand (26) + +- * Project (25) + +- * SortMergeJoin Inner (24) + :- * Sort (18) + : +- Exchange (17) + : +- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (9) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.inventory (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.warehouse (4) + : +- BroadcastExchange (14) + : +- * Project (13) + : +- * Filter (12) + : +- * ColumnarToRow (11) + : +- Scan parquet default.date_dim (10) + +- * Sort (23) + +- Exchange (22) + +- * Filter (21) + +- * ColumnarToRow (20) + +- Scan parquet default.item (19) + + +(1) Scan parquet default.inventory +Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Condition : (isnotnull(inv_item_sk#1) AND isnotnull(inv_warehouse_sk#2)) + +(4) Scan parquet default.warehouse +Output [1]: [w_warehouse_sk#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [1]: [w_warehouse_sk#6] + +(6) Filter [codegen id : 1] +Input [1]: [w_warehouse_sk#6] +Condition : isnotnull(w_warehouse_sk#6) + +(7) BroadcastExchange +Input [1]: [w_warehouse_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_warehouse_sk#2] +Right keys [1]: [w_warehouse_sk#6] +Join condition: None + +(9) Project [codegen id : 3] +Output [3]: [inv_item_sk#1, inv_quantity_on_hand#3, inv_date_sk#4] +Input [5]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, w_warehouse_sk#6] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#8, d_month_seq#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#8, d_month_seq#9] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#8, d_month_seq#9] +Condition : (((isnotnull(d_month_seq#9) AND (d_month_seq#9 >= 1200)) AND (d_month_seq#9 <= 1211)) AND isnotnull(d_date_sk#8)) + +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#8] +Input [2]: [d_date_sk#8, d_month_seq#9] + +(14) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_date_sk#4] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(16) Project [codegen id : 3] +Output [2]: [inv_item_sk#1, inv_quantity_on_hand#3] +Input [4]: [inv_item_sk#1, inv_quantity_on_hand#3, inv_date_sk#4, d_date_sk#8] + +(17) Exchange +Input [2]: [inv_item_sk#1, inv_quantity_on_hand#3] +Arguments: hashpartitioning(inv_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#11] + +(18) Sort [codegen id : 4] +Input [2]: [inv_item_sk#1, inv_quantity_on_hand#3] +Arguments: [inv_item_sk#1 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.item +Output [5]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15, i_product_name#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 5] +Input [5]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15, i_product_name#16] + +(21) Filter [codegen id : 5] +Input [5]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15, i_product_name#16] +Condition : isnotnull(i_item_sk#12) + +(22) Exchange +Input [5]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15, i_product_name#16] +Arguments: hashpartitioning(i_item_sk#12, 5), ENSURE_REQUIREMENTS, [id=#17] + +(23) Sort [codegen id : 6] +Input [5]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15, i_product_name#16] +Arguments: [i_item_sk#12 ASC NULLS FIRST], false, 0 + +(24) SortMergeJoin [codegen id : 7] +Left keys [1]: [inv_item_sk#1] +Right keys [1]: [i_item_sk#12] +Join condition: None + +(25) Project [codegen id : 7] +Output [5]: [inv_quantity_on_hand#3, i_product_name#16, i_brand#13, i_class#14, i_category#15] +Input [7]: [inv_item_sk#1, inv_quantity_on_hand#3, i_item_sk#12, i_brand#13, i_class#14, i_category#15, i_product_name#16] + +(26) Expand [codegen id : 7] +Input [5]: [inv_quantity_on_hand#3, i_product_name#16, i_brand#13, i_class#14, i_category#15] +Arguments: [List(inv_quantity_on_hand#3, i_product_name#16, i_brand#13, i_class#14, i_category#15, 0), List(inv_quantity_on_hand#3, i_product_name#16, i_brand#13, i_class#14, null, 1), List(inv_quantity_on_hand#3, i_product_name#16, i_brand#13, null, null, 3), List(inv_quantity_on_hand#3, i_product_name#16, null, null, null, 7), List(inv_quantity_on_hand#3, null, null, null, null, 15)], [inv_quantity_on_hand#3, i_product_name#18, i_brand#19, i_class#20, i_category#21, spark_grouping_id#22] + +(27) HashAggregate [codegen id : 7] +Input [6]: [inv_quantity_on_hand#3, i_product_name#18, i_brand#19, i_class#20, i_category#21, spark_grouping_id#22] +Keys [5]: [i_product_name#18, i_brand#19, i_class#20, i_category#21, spark_grouping_id#22] +Functions [1]: [partial_avg(inv_quantity_on_hand#3)] +Aggregate Attributes [2]: [sum#23, count#24] +Results [7]: [i_product_name#18, i_brand#19, i_class#20, i_category#21, spark_grouping_id#22, sum#25, count#26] + +(28) Exchange +Input [7]: [i_product_name#18, i_brand#19, i_class#20, i_category#21, spark_grouping_id#22, sum#25, count#26] +Arguments: hashpartitioning(i_product_name#18, i_brand#19, i_class#20, i_category#21, spark_grouping_id#22, 5), ENSURE_REQUIREMENTS, [id=#27] + +(29) HashAggregate [codegen id : 8] +Input [7]: [i_product_name#18, i_brand#19, i_class#20, i_category#21, spark_grouping_id#22, sum#25, count#26] +Keys [5]: [i_product_name#18, i_brand#19, i_class#20, i_category#21, spark_grouping_id#22] +Functions [1]: [avg(inv_quantity_on_hand#3)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#3)#28] +Results [5]: [i_product_name#18, i_brand#19, i_class#20, i_category#21, avg(inv_quantity_on_hand#3)#28 AS qoh#29] + +(30) TakeOrderedAndProject +Input [5]: [i_product_name#18, i_brand#19, i_class#20, i_category#21, qoh#29] +Arguments: 100, [qoh#29 ASC NULLS FIRST, i_product_name#18 ASC NULLS FIRST, i_brand#19 ASC NULLS FIRST, i_class#20 ASC NULLS FIRST, i_category#21 ASC NULLS FIRST], [i_product_name#18, i_brand#19, i_class#20, i_category#21, qoh#29] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5 +ReusedExchange (31) + + +(31) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#8] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt new file mode 100644 index 0000000000000..1bcae4201335b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22.sf100/simplified.txt @@ -0,0 +1,51 @@ +TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] + WholeStageCodegen (8) + HashAggregate [i_product_name,i_brand,i_class,i_category,spark_grouping_id,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + Exchange [i_product_name,i_brand,i_class,i_category,spark_grouping_id] #1 + WholeStageCodegen (7) + HashAggregate [i_product_name,i_brand,i_class,i_category,spark_grouping_id,inv_quantity_on_hand] [sum,count,sum,count] + Expand [inv_quantity_on_hand,i_product_name,i_brand,i_class,i_category] + Project [inv_quantity_on_hand,i_product_name,i_brand,i_class,i_category] + SortMergeJoin [inv_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [inv_item_sk] + InputAdapter + Exchange [inv_item_sk] #2 + WholeStageCodegen (3) + Project [inv_item_sk,inv_quantity_on_hand] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [inv_item_sk,inv_quantity_on_hand,inv_date_sk] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Filter [inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (5) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_product_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22/explain.txt new file mode 100644 index 0000000000000..fa775d7c43bdc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22/explain.txt @@ -0,0 +1,166 @@ +== Physical Plan == +TakeOrderedAndProject (27) ++- * HashAggregate (26) + +- Exchange (25) + +- * HashAggregate (24) + +- * Expand (23) + +- * Project (22) + +- * BroadcastHashJoin Inner BuildRight (21) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.inventory (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.item (11) + +- BroadcastExchange (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.warehouse (17) + + +(1) Scan parquet default.inventory +Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Condition : (isnotnull(inv_item_sk#1) AND isnotnull(inv_warehouse_sk#2)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_month_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] +Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1200)) AND (d_month_seq#7 <= 1211)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_month_seq#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 4] +Output [3]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3] +Input [5]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.item +Output [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] + +(13) Filter [codegen id : 2] +Input [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Condition : isnotnull(i_item_sk#9) + +(14) BroadcastExchange +Input [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_item_sk#1] +Right keys [1]: [i_item_sk#9] +Join condition: None + +(16) Project [codegen id : 4] +Output [6]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Input [8]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] + +(17) Scan parquet default.warehouse +Output [1]: [w_warehouse_sk#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [1]: [w_warehouse_sk#15] + +(19) Filter [codegen id : 3] +Input [1]: [w_warehouse_sk#15] +Condition : isnotnull(w_warehouse_sk#15) + +(20) BroadcastExchange +Input [1]: [w_warehouse_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_warehouse_sk#2] +Right keys [1]: [w_warehouse_sk#15] +Join condition: None + +(22) Project [codegen id : 4] +Output [5]: [inv_quantity_on_hand#3, i_product_name#13, i_brand#10, i_class#11, i_category#12] +Input [7]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, i_brand#10, i_class#11, i_category#12, i_product_name#13, w_warehouse_sk#15] + +(23) Expand [codegen id : 4] +Input [5]: [inv_quantity_on_hand#3, i_product_name#13, i_brand#10, i_class#11, i_category#12] +Arguments: [List(inv_quantity_on_hand#3, i_product_name#13, i_brand#10, i_class#11, i_category#12, 0), List(inv_quantity_on_hand#3, i_product_name#13, i_brand#10, i_class#11, null, 1), List(inv_quantity_on_hand#3, i_product_name#13, i_brand#10, null, null, 3), List(inv_quantity_on_hand#3, i_product_name#13, null, null, null, 7), List(inv_quantity_on_hand#3, null, null, null, null, 15)], [inv_quantity_on_hand#3, i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_grouping_id#21] + +(24) HashAggregate [codegen id : 4] +Input [6]: [inv_quantity_on_hand#3, i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_grouping_id#21] +Keys [5]: [i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_grouping_id#21] +Functions [1]: [partial_avg(inv_quantity_on_hand#3)] +Aggregate Attributes [2]: [sum#22, count#23] +Results [7]: [i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_grouping_id#21, sum#24, count#25] + +(25) Exchange +Input [7]: [i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_grouping_id#21, sum#24, count#25] +Arguments: hashpartitioning(i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_grouping_id#21, 5), ENSURE_REQUIREMENTS, [id=#26] + +(26) HashAggregate [codegen id : 5] +Input [7]: [i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_grouping_id#21, sum#24, count#25] +Keys [5]: [i_product_name#17, i_brand#18, i_class#19, i_category#20, spark_grouping_id#21] +Functions [1]: [avg(inv_quantity_on_hand#3)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#3)#27] +Results [5]: [i_product_name#17, i_brand#18, i_class#19, i_category#20, avg(inv_quantity_on_hand#3)#27 AS qoh#28] + +(27) TakeOrderedAndProject +Input [5]: [i_product_name#17, i_brand#18, i_class#19, i_category#20, qoh#28] +Arguments: 100, [qoh#28 ASC NULLS FIRST, i_product_name#17 ASC NULLS FIRST, i_brand#18 ASC NULLS FIRST, i_class#19 ASC NULLS FIRST, i_category#20 ASC NULLS FIRST], [i_product_name#17, i_brand#18, i_class#19, i_category#20, qoh#28] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5 +ReusedExchange (28) + + +(28) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22/simplified.txt new file mode 100644 index 0000000000000..e0b0d3f84a169 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q22/simplified.txt @@ -0,0 +1,42 @@ +TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] + WholeStageCodegen (5) + HashAggregate [i_product_name,i_brand,i_class,i_category,spark_grouping_id,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + Exchange [i_product_name,i_brand,i_class,i_category,spark_grouping_id] #1 + WholeStageCodegen (4) + HashAggregate [i_product_name,i_brand,i_class,i_category,spark_grouping_id,inv_quantity_on_hand] [sum,count,sum,count] + Expand [inv_quantity_on_hand,i_product_name,i_brand,i_class,i_category] + Project [inv_quantity_on_hand,i_product_name,i_brand,i_class,i_category] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,i_brand,i_class,i_category,i_product_name] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Filter [inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_product_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/explain.txt new file mode 100644 index 0000000000000..c61606d124ccb --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/explain.txt @@ -0,0 +1,716 @@ +== Physical Plan == +* HashAggregate (98) ++- Exchange (97) + +- * HashAggregate (96) + +- Union (95) + :- * Project (59) + : +- * BroadcastHashJoin Inner BuildRight (58) + : :- * Project (52) + : : +- * SortMergeJoin LeftSemi (51) + : : :- * Sort (32) + : : : +- Exchange (31) + : : : +- * Project (30) + : : : +- * SortMergeJoin LeftSemi (29) + : : : :- * Sort (4) + : : : : +- Exchange (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- * Sort (28) + : : : +- * Project (27) + : : : +- * Filter (26) + : : : +- * HashAggregate (25) + : : : +- * HashAggregate (24) + : : : +- * Project (23) + : : : +- * SortMergeJoin Inner (22) + : : : :- * Sort (16) + : : : : +- Exchange (15) + : : : : +- * Project (14) + : : : : +- * BroadcastHashJoin Inner BuildRight (13) + : : : : :- * Filter (7) + : : : : : +- * ColumnarToRow (6) + : : : : : +- Scan parquet default.store_sales (5) + : : : : +- BroadcastExchange (12) + : : : : +- * Project (11) + : : : : +- * Filter (10) + : : : : +- * ColumnarToRow (9) + : : : : +- Scan parquet default.date_dim (8) + : : : +- * Sort (21) + : : : +- Exchange (20) + : : : +- * Filter (19) + : : : +- * ColumnarToRow (18) + : : : +- Scan parquet default.item (17) + : : +- * Sort (50) + : : +- * Project (49) + : : +- * Filter (48) + : : +- * HashAggregate (47) + : : +- * HashAggregate (46) + : : +- * Project (45) + : : +- * SortMergeJoin Inner (44) + : : :- * Sort (38) + : : : +- Exchange (37) + : : : +- * Project (36) + : : : +- * Filter (35) + : : : +- * ColumnarToRow (34) + : : : +- Scan parquet default.store_sales (33) + : : +- * Sort (43) + : : +- Exchange (42) + : : +- * Filter (41) + : : +- * ColumnarToRow (40) + : : +- Scan parquet default.customer (39) + : +- BroadcastExchange (57) + : +- * Project (56) + : +- * Filter (55) + : +- * ColumnarToRow (54) + : +- Scan parquet default.date_dim (53) + +- * Project (94) + +- * BroadcastHashJoin Inner BuildRight (93) + :- * Project (91) + : +- * SortMergeJoin LeftSemi (90) + : :- * Sort (78) + : : +- Exchange (77) + : : +- * Project (76) + : : +- * SortMergeJoin LeftSemi (75) + : : :- * Sort (63) + : : : +- Exchange (62) + : : : +- * ColumnarToRow (61) + : : : +- Scan parquet default.web_sales (60) + : : +- * Sort (74) + : : +- * Project (73) + : : +- * Filter (72) + : : +- * HashAggregate (71) + : : +- * HashAggregate (70) + : : +- * Project (69) + : : +- * SortMergeJoin Inner (68) + : : :- * Sort (65) + : : : +- ReusedExchange (64) + : : +- * Sort (67) + : : +- ReusedExchange (66) + : +- * Sort (89) + : +- * Project (88) + : +- * Filter (87) + : +- * HashAggregate (86) + : +- * HashAggregate (85) + : +- * Project (84) + : +- * SortMergeJoin Inner (83) + : :- * Sort (80) + : : +- ReusedExchange (79) + : +- * Sort (82) + : +- ReusedExchange (81) + +- ReusedExchange (92) + + +(1) Scan parquet default.catalog_sales +Output [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] + +(3) Exchange +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Arguments: hashpartitioning(cs_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] + +(4) Sort [codegen id : 2] +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 + +(5) Scan parquet default.store_sales +Output [2]: [ss_item_sk#8, ss_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#9), dynamicpruningexpression(ss_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 4] +Input [2]: [ss_item_sk#8, ss_sold_date_sk#9] + +(7) Filter [codegen id : 4] +Input [2]: [ss_item_sk#8, ss_sold_date_sk#9] +Condition : isnotnull(ss_item_sk#8) + +(8) Scan parquet default.date_dim +Output [3]: [d_date_sk#11, d_date#12, d_year#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(9) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#11, d_date#12, d_year#13] + +(10) Filter [codegen id : 3] +Input [3]: [d_date_sk#11, d_date#12, d_year#13] +Condition : (d_year#13 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#11)) + +(11) Project [codegen id : 3] +Output [2]: [d_date_sk#11, d_date#12] +Input [3]: [d_date_sk#11, d_date#12, d_year#13] + +(12) BroadcastExchange +Input [2]: [d_date_sk#11, d_date#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(13) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#9] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(14) Project [codegen id : 4] +Output [2]: [ss_item_sk#8, d_date#12] +Input [4]: [ss_item_sk#8, ss_sold_date_sk#9, d_date_sk#11, d_date#12] + +(15) Exchange +Input [2]: [ss_item_sk#8, d_date#12] +Arguments: hashpartitioning(ss_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#15] + +(16) Sort [codegen id : 5] +Input [2]: [ss_item_sk#8, d_date#12] +Arguments: [ss_item_sk#8 ASC NULLS FIRST], false, 0 + +(17) Scan parquet default.item +Output [2]: [i_item_sk#16, i_item_desc#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 6] +Input [2]: [i_item_sk#16, i_item_desc#17] + +(19) Filter [codegen id : 6] +Input [2]: [i_item_sk#16, i_item_desc#17] +Condition : isnotnull(i_item_sk#16) + +(20) Exchange +Input [2]: [i_item_sk#16, i_item_desc#17] +Arguments: hashpartitioning(i_item_sk#16, 5), ENSURE_REQUIREMENTS, [id=#18] + +(21) Sort [codegen id : 7] +Input [2]: [i_item_sk#16, i_item_desc#17] +Arguments: [i_item_sk#16 ASC NULLS FIRST], false, 0 + +(22) SortMergeJoin [codegen id : 8] +Left keys [1]: [ss_item_sk#8] +Right keys [1]: [i_item_sk#16] +Join condition: None + +(23) Project [codegen id : 8] +Output [3]: [d_date#12, i_item_sk#16, substr(i_item_desc#17, 1, 30) AS _groupingexpression#19] +Input [4]: [ss_item_sk#8, d_date#12, i_item_sk#16, i_item_desc#17] + +(24) HashAggregate [codegen id : 8] +Input [3]: [d_date#12, i_item_sk#16, _groupingexpression#19] +Keys [3]: [_groupingexpression#19, i_item_sk#16, d_date#12] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#20] +Results [4]: [_groupingexpression#19, i_item_sk#16, d_date#12, count#21] + +(25) HashAggregate [codegen id : 8] +Input [4]: [_groupingexpression#19, i_item_sk#16, d_date#12, count#21] +Keys [3]: [_groupingexpression#19, i_item_sk#16, d_date#12] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#22] +Results [2]: [i_item_sk#16 AS item_sk#23, count(1)#22 AS count(1)#24] + +(26) Filter [codegen id : 8] +Input [2]: [item_sk#23, count(1)#24] +Condition : (count(1)#24 > 4) + +(27) Project [codegen id : 8] +Output [1]: [item_sk#23] +Input [2]: [item_sk#23, count(1)#24] + +(28) Sort [codegen id : 8] +Input [1]: [item_sk#23] +Arguments: [item_sk#23 ASC NULLS FIRST], false, 0 + +(29) SortMergeJoin [codegen id : 9] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [item_sk#23] +Join condition: None + +(30) Project [codegen id : 9] +Output [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] + +(31) Exchange +Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Arguments: hashpartitioning(cs_bill_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#25] + +(32) Sort [codegen id : 10] +Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Arguments: [cs_bill_customer_sk#1 ASC NULLS FIRST], false, 0 + +(33) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] + +(35) Filter [codegen id : 11] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] +Condition : isnotnull(ss_customer_sk#26) + +(36) Project [codegen id : 11] +Output [3]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] + +(37) Exchange +Input [3]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28] +Arguments: hashpartitioning(ss_customer_sk#26, 5), ENSURE_REQUIREMENTS, [id=#30] + +(38) Sort [codegen id : 12] +Input [3]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28] +Arguments: [ss_customer_sk#26 ASC NULLS FIRST], false, 0 + +(39) Scan parquet default.customer +Output [1]: [c_customer_sk#31] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 13] +Input [1]: [c_customer_sk#31] + +(41) Filter [codegen id : 13] +Input [1]: [c_customer_sk#31] +Condition : isnotnull(c_customer_sk#31) + +(42) Exchange +Input [1]: [c_customer_sk#31] +Arguments: hashpartitioning(c_customer_sk#31, 5), ENSURE_REQUIREMENTS, [id=#32] + +(43) Sort [codegen id : 14] +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 + +(44) SortMergeJoin [codegen id : 15] +Left keys [1]: [ss_customer_sk#26] +Right keys [1]: [c_customer_sk#31] +Join condition: None + +(45) Project [codegen id : 15] +Output [3]: [ss_quantity#27, ss_sales_price#28, c_customer_sk#31] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, c_customer_sk#31] + +(46) HashAggregate [codegen id : 15] +Input [3]: [ss_quantity#27, ss_sales_price#28, c_customer_sk#31] +Keys [1]: [c_customer_sk#31] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#33, isEmpty#34] +Results [3]: [c_customer_sk#31, sum#35, isEmpty#36] + +(47) HashAggregate [codegen id : 15] +Input [3]: [c_customer_sk#31, sum#35, isEmpty#36] +Keys [1]: [c_customer_sk#31] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))#37] +Results [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))#37 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] + +(48) Filter [codegen id : 15] +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(Subquery scalar-subquery#41, [id=#42] as decimal(32,6)))), DecimalType(38,8), true))) + +(49) Project [codegen id : 15] +Output [1]: [c_customer_sk#31] +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] + +(50) Sort [codegen id : 15] +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 + +(51) SortMergeJoin [codegen id : 17] +Left keys [1]: [cs_bill_customer_sk#1] +Right keys [1]: [c_customer_sk#31] +Join condition: None + +(52) Project [codegen id : 17] +Output [3]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] + +(53) Scan parquet default.date_dim +Output [3]: [d_date_sk#43, d_year#44, d_moy#45] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,2), IsNotNull(d_date_sk)] +ReadSchema: struct + +(54) ColumnarToRow [codegen id : 16] +Input [3]: [d_date_sk#43, d_year#44, d_moy#45] + +(55) Filter [codegen id : 16] +Input [3]: [d_date_sk#43, d_year#44, d_moy#45] +Condition : ((((isnotnull(d_year#44) AND isnotnull(d_moy#45)) AND (d_year#44 = 2000)) AND (d_moy#45 = 2)) AND isnotnull(d_date_sk#43)) + +(56) Project [codegen id : 16] +Output [1]: [d_date_sk#43] +Input [3]: [d_date_sk#43, d_year#44, d_moy#45] + +(57) BroadcastExchange +Input [1]: [d_date_sk#43] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#46] + +(58) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [cs_sold_date_sk#5] +Right keys [1]: [d_date_sk#43] +Join condition: None + +(59) Project [codegen id : 17] +Output [1]: [CheckOverflow((promote_precision(cast(cast(cs_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#4 as decimal(12,2)))), DecimalType(18,2), true) AS sales#47] +Input [4]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, d_date_sk#43] + +(60) Scan parquet default.web_sales +Output [5]: [ws_item_sk#48, ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#52), dynamicpruningexpression(ws_sold_date_sk#52 IN dynamicpruning#6)] +ReadSchema: struct + +(61) ColumnarToRow [codegen id : 18] +Input [5]: [ws_item_sk#48, ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] + +(62) Exchange +Input [5]: [ws_item_sk#48, ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] +Arguments: hashpartitioning(ws_item_sk#48, 5), ENSURE_REQUIREMENTS, [id=#53] + +(63) Sort [codegen id : 19] +Input [5]: [ws_item_sk#48, ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] +Arguments: [ws_item_sk#48 ASC NULLS FIRST], false, 0 + +(64) ReusedExchange [Reuses operator id: unknown] +Output [2]: [ss_item_sk#54, d_date#55] + +(65) Sort [codegen id : 22] +Input [2]: [ss_item_sk#54, d_date#55] +Arguments: [ss_item_sk#54 ASC NULLS FIRST], false, 0 + +(66) ReusedExchange [Reuses operator id: 20] +Output [2]: [i_item_sk#56, i_item_desc#57] + +(67) Sort [codegen id : 24] +Input [2]: [i_item_sk#56, i_item_desc#57] +Arguments: [i_item_sk#56 ASC NULLS FIRST], false, 0 + +(68) SortMergeJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#54] +Right keys [1]: [i_item_sk#56] +Join condition: None + +(69) Project [codegen id : 25] +Output [3]: [d_date#55, i_item_sk#56, substr(i_item_desc#57, 1, 30) AS _groupingexpression#58] +Input [4]: [ss_item_sk#54, d_date#55, i_item_sk#56, i_item_desc#57] + +(70) HashAggregate [codegen id : 25] +Input [3]: [d_date#55, i_item_sk#56, _groupingexpression#58] +Keys [3]: [_groupingexpression#58, i_item_sk#56, d_date#55] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#59] +Results [4]: [_groupingexpression#58, i_item_sk#56, d_date#55, count#60] + +(71) HashAggregate [codegen id : 25] +Input [4]: [_groupingexpression#58, i_item_sk#56, d_date#55, count#60] +Keys [3]: [_groupingexpression#58, i_item_sk#56, d_date#55] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#61] +Results [2]: [i_item_sk#56 AS item_sk#23, count(1)#61 AS count(1)#62] + +(72) Filter [codegen id : 25] +Input [2]: [item_sk#23, count(1)#62] +Condition : (count(1)#62 > 4) + +(73) Project [codegen id : 25] +Output [1]: [item_sk#23] +Input [2]: [item_sk#23, count(1)#62] + +(74) Sort [codegen id : 25] +Input [1]: [item_sk#23] +Arguments: [item_sk#23 ASC NULLS FIRST], false, 0 + +(75) SortMergeJoin [codegen id : 26] +Left keys [1]: [ws_item_sk#48] +Right keys [1]: [item_sk#23] +Join condition: None + +(76) Project [codegen id : 26] +Output [4]: [ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] +Input [5]: [ws_item_sk#48, ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] + +(77) Exchange +Input [4]: [ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] +Arguments: hashpartitioning(ws_bill_customer_sk#49, 5), ENSURE_REQUIREMENTS, [id=#63] + +(78) Sort [codegen id : 27] +Input [4]: [ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] +Arguments: [ws_bill_customer_sk#49 ASC NULLS FIRST], false, 0 + +(79) ReusedExchange [Reuses operator id: 37] +Output [3]: [ss_customer_sk#64, ss_quantity#65, ss_sales_price#66] + +(80) Sort [codegen id : 29] +Input [3]: [ss_customer_sk#64, ss_quantity#65, ss_sales_price#66] +Arguments: [ss_customer_sk#64 ASC NULLS FIRST], false, 0 + +(81) ReusedExchange [Reuses operator id: 42] +Output [1]: [c_customer_sk#67] + +(82) Sort [codegen id : 31] +Input [1]: [c_customer_sk#67] +Arguments: [c_customer_sk#67 ASC NULLS FIRST], false, 0 + +(83) SortMergeJoin [codegen id : 32] +Left keys [1]: [ss_customer_sk#64] +Right keys [1]: [c_customer_sk#67] +Join condition: None + +(84) Project [codegen id : 32] +Output [3]: [ss_quantity#65, ss_sales_price#66, c_customer_sk#67] +Input [4]: [ss_customer_sk#64, ss_quantity#65, ss_sales_price#66, c_customer_sk#67] + +(85) HashAggregate [codegen id : 32] +Input [3]: [ss_quantity#65, ss_sales_price#66, c_customer_sk#67] +Keys [1]: [c_customer_sk#67] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#65 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#66 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#68, isEmpty#69] +Results [3]: [c_customer_sk#67, sum#70, isEmpty#71] + +(86) HashAggregate [codegen id : 32] +Input [3]: [c_customer_sk#67, sum#70, isEmpty#71] +Keys [1]: [c_customer_sk#67] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#65 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#66 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#65 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#66 as decimal(12,2)))), DecimalType(18,2), true))#72] +Results [2]: [c_customer_sk#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#65 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#66 as decimal(12,2)))), DecimalType(18,2), true))#72 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#73] + +(87) Filter [codegen id : 32] +Input [2]: [c_customer_sk#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#73] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#73) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#73 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#41, [id=#42] as decimal(32,6)))), DecimalType(38,8), true))) + +(88) Project [codegen id : 32] +Output [1]: [c_customer_sk#67] +Input [2]: [c_customer_sk#67, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#73] + +(89) Sort [codegen id : 32] +Input [1]: [c_customer_sk#67] +Arguments: [c_customer_sk#67 ASC NULLS FIRST], false, 0 + +(90) SortMergeJoin [codegen id : 34] +Left keys [1]: [ws_bill_customer_sk#49] +Right keys [1]: [c_customer_sk#67] +Join condition: None + +(91) Project [codegen id : 34] +Output [3]: [ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] +Input [4]: [ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] + +(92) ReusedExchange [Reuses operator id: 57] +Output [1]: [d_date_sk#74] + +(93) BroadcastHashJoin [codegen id : 34] +Left keys [1]: [ws_sold_date_sk#52] +Right keys [1]: [d_date_sk#74] +Join condition: None + +(94) Project [codegen id : 34] +Output [1]: [CheckOverflow((promote_precision(cast(cast(ws_quantity#50 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#51 as decimal(12,2)))), DecimalType(18,2), true) AS sales#75] +Input [4]: [ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52, d_date_sk#74] + +(95) Union + +(96) HashAggregate [codegen id : 35] +Input [1]: [sales#47] +Keys: [] +Functions [1]: [partial_sum(sales#47)] +Aggregate Attributes [2]: [sum#76, isEmpty#77] +Results [2]: [sum#78, isEmpty#79] + +(97) Exchange +Input [2]: [sum#78, isEmpty#79] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#80] + +(98) HashAggregate [codegen id : 36] +Input [2]: [sum#78, isEmpty#79] +Keys: [] +Functions [1]: [sum(sales#47)] +Aggregate Attributes [1]: [sum(sales#47)#81] +Results [1]: [sum(sales#47)#81 AS sum(sales)#82] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (99) + + +(99) ReusedExchange [Reuses operator id: 57] +Output [1]: [d_date_sk#43] + +Subquery:2 Hosting operator id = 5 Hosting Expression = ss_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (100) + + +(100) ReusedExchange [Reuses operator id: 12] +Output [2]: [d_date_sk#11, d_date#12] + +Subquery:3 Hosting operator id = 48 Hosting Expression = Subquery scalar-subquery#41, [id=#42] +* HashAggregate (124) ++- Exchange (123) + +- * HashAggregate (122) + +- * HashAggregate (121) + +- * HashAggregate (120) + +- * Project (119) + +- * SortMergeJoin Inner (118) + :- * Sort (112) + : +- Exchange (111) + : +- * Project (110) + : +- * BroadcastHashJoin Inner BuildRight (109) + : :- * Filter (103) + : : +- * ColumnarToRow (102) + : : +- Scan parquet default.store_sales (101) + : +- BroadcastExchange (108) + : +- * Project (107) + : +- * Filter (106) + : +- * ColumnarToRow (105) + : +- Scan parquet default.date_dim (104) + +- * Sort (117) + +- Exchange (116) + +- * Filter (115) + +- * ColumnarToRow (114) + +- Scan parquet default.customer (113) + + +(101) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#83, ss_quantity#84, ss_sales_price#85, ss_sold_date_sk#86] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#86), dynamicpruningexpression(ss_sold_date_sk#86 IN dynamicpruning#87)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(102) ColumnarToRow [codegen id : 2] +Input [4]: [ss_customer_sk#83, ss_quantity#84, ss_sales_price#85, ss_sold_date_sk#86] + +(103) Filter [codegen id : 2] +Input [4]: [ss_customer_sk#83, ss_quantity#84, ss_sales_price#85, ss_sold_date_sk#86] +Condition : isnotnull(ss_customer_sk#83) + +(104) Scan parquet default.date_dim +Output [2]: [d_date_sk#88, d_year#89] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(105) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#88, d_year#89] + +(106) Filter [codegen id : 1] +Input [2]: [d_date_sk#88, d_year#89] +Condition : (d_year#89 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#88)) + +(107) Project [codegen id : 1] +Output [1]: [d_date_sk#88] +Input [2]: [d_date_sk#88, d_year#89] + +(108) BroadcastExchange +Input [1]: [d_date_sk#88] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#90] + +(109) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#86] +Right keys [1]: [d_date_sk#88] +Join condition: None + +(110) Project [codegen id : 2] +Output [3]: [ss_customer_sk#83, ss_quantity#84, ss_sales_price#85] +Input [5]: [ss_customer_sk#83, ss_quantity#84, ss_sales_price#85, ss_sold_date_sk#86, d_date_sk#88] + +(111) Exchange +Input [3]: [ss_customer_sk#83, ss_quantity#84, ss_sales_price#85] +Arguments: hashpartitioning(ss_customer_sk#83, 5), ENSURE_REQUIREMENTS, [id=#91] + +(112) Sort [codegen id : 3] +Input [3]: [ss_customer_sk#83, ss_quantity#84, ss_sales_price#85] +Arguments: [ss_customer_sk#83 ASC NULLS FIRST], false, 0 + +(113) Scan parquet default.customer +Output [1]: [c_customer_sk#92] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(114) ColumnarToRow [codegen id : 4] +Input [1]: [c_customer_sk#92] + +(115) Filter [codegen id : 4] +Input [1]: [c_customer_sk#92] +Condition : isnotnull(c_customer_sk#92) + +(116) Exchange +Input [1]: [c_customer_sk#92] +Arguments: hashpartitioning(c_customer_sk#92, 5), ENSURE_REQUIREMENTS, [id=#93] + +(117) Sort [codegen id : 5] +Input [1]: [c_customer_sk#92] +Arguments: [c_customer_sk#92 ASC NULLS FIRST], false, 0 + +(118) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#83] +Right keys [1]: [c_customer_sk#92] +Join condition: None + +(119) Project [codegen id : 6] +Output [3]: [ss_quantity#84, ss_sales_price#85, c_customer_sk#92] +Input [4]: [ss_customer_sk#83, ss_quantity#84, ss_sales_price#85, c_customer_sk#92] + +(120) HashAggregate [codegen id : 6] +Input [3]: [ss_quantity#84, ss_sales_price#85, c_customer_sk#92] +Keys [1]: [c_customer_sk#92] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#84 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#85 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#94, isEmpty#95] +Results [3]: [c_customer_sk#92, sum#96, isEmpty#97] + +(121) HashAggregate [codegen id : 6] +Input [3]: [c_customer_sk#92, sum#96, isEmpty#97] +Keys [1]: [c_customer_sk#92] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#84 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#85 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#84 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#85 as decimal(12,2)))), DecimalType(18,2), true))#98] +Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#84 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#85 as decimal(12,2)))), DecimalType(18,2), true))#98 AS csales#99] + +(122) HashAggregate [codegen id : 6] +Input [1]: [csales#99] +Keys: [] +Functions [1]: [partial_max(csales#99)] +Aggregate Attributes [1]: [max#100] +Results [1]: [max#101] + +(123) Exchange +Input [1]: [max#101] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#102] + +(124) HashAggregate [codegen id : 7] +Input [1]: [max#101] +Keys: [] +Functions [1]: [max(csales#99)] +Aggregate Attributes [1]: [max(csales#99)#103] +Results [1]: [max(csales#99)#103 AS tpcds_cmax#104] + +Subquery:4 Hosting operator id = 101 Hosting Expression = ss_sold_date_sk#86 IN dynamicpruning#87 +ReusedExchange (125) + + +(125) ReusedExchange [Reuses operator id: 108] +Output [1]: [d_date_sk#88] + +Subquery:5 Hosting operator id = 60 Hosting Expression = ws_sold_date_sk#52 IN dynamicpruning#6 + +Subquery:6 Hosting operator id = 87 Hosting Expression = ReusedSubquery Subquery scalar-subquery#41, [id=#42] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/simplified.txt new file mode 100644 index 0000000000000..0e8b0977ae088 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a.sf100/simplified.txt @@ -0,0 +1,218 @@ +WholeStageCodegen (36) + HashAggregate [sum,isEmpty] [sum(sales),sum(sales),sum,isEmpty] + InputAdapter + Exchange #1 + WholeStageCodegen (35) + HashAggregate [sales] [sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (17) + Project [cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_quantity,cs_list_price,cs_sold_date_sk] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (10) + Sort [cs_bill_customer_sk] + InputAdapter + Exchange [cs_bill_customer_sk] #2 + WholeStageCodegen (9) + Project [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sold_date_sk] + SortMergeJoin [cs_item_sk,item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #3 + WholeStageCodegen (1) + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + WholeStageCodegen (8) + Sort [item_sk] + Project [item_sk] + Filter [count(1)] + HashAggregate [_groupingexpression,i_item_sk,d_date,count] [count(1),item_sk,count(1),count] + HashAggregate [_groupingexpression,i_item_sk,d_date] [count,count] + Project [d_date,i_item_sk,i_item_desc] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (5) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #5 + WholeStageCodegen (4) + Project [ss_item_sk,d_date] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_date] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [d_date_sk,d_date] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_year] + InputAdapter + WholeStageCodegen (7) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #7 + WholeStageCodegen (6) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_desc] + InputAdapter + WholeStageCodegen (15) + Sort [c_customer_sk] + Project [c_customer_sk] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] + Subquery #3 + WholeStageCodegen (7) + HashAggregate [max] [max(csales),tpcds_cmax,max] + InputAdapter + Exchange #10 + WholeStageCodegen (6) + HashAggregate [csales] [max,max] + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),csales,sum,isEmpty] + HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,c_customer_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #11 + WholeStageCodegen (2) + Project [ss_customer_sk,ss_quantity,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #4 + ReusedExchange [d_date_sk] #12 + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #13 + WholeStageCodegen (4) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk] + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty] + HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,c_customer_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (12) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #8 + WholeStageCodegen (11) + Project [ss_customer_sk,ss_quantity,ss_sales_price] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk] + InputAdapter + WholeStageCodegen (14) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #9 + WholeStageCodegen (13) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (16) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (34) + Project [ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_quantity,ws_list_price,ws_sold_date_sk] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (27) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #14 + WholeStageCodegen (26) + Project [ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk] + SortMergeJoin [ws_item_sk,item_sk] + InputAdapter + WholeStageCodegen (19) + Sort [ws_item_sk] + InputAdapter + Exchange [ws_item_sk] #15 + WholeStageCodegen (18) + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (25) + Sort [item_sk] + Project [item_sk] + Filter [count(1)] + HashAggregate [_groupingexpression,i_item_sk,d_date,count] [count(1),item_sk,count(1),count] + HashAggregate [_groupingexpression,i_item_sk,d_date] [count,count] + Project [d_date,i_item_sk,i_item_desc] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (22) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk,d_date] #16 + InputAdapter + WholeStageCodegen (24) + Sort [i_item_sk] + InputAdapter + ReusedExchange [i_item_sk,i_item_desc] #7 + InputAdapter + WholeStageCodegen (32) + Sort [c_customer_sk] + Project [c_customer_sk] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [tpcds_cmax] #3 + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty] + HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,c_customer_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (29) + Sort [ss_customer_sk] + InputAdapter + ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #8 + InputAdapter + WholeStageCodegen (31) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk] #9 + InputAdapter + ReusedExchange [d_date_sk] #4 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt new file mode 100644 index 0000000000000..2bce3e4d9bb60 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/explain.txt @@ -0,0 +1,577 @@ +== Physical Plan == +* HashAggregate (74) ++- Exchange (73) + +- * HashAggregate (72) + +- Union (71) + :- * Project (53) + : +- * BroadcastHashJoin Inner BuildRight (52) + : :- * Project (46) + : : +- * SortMergeJoin LeftSemi (45) + : : :- * Sort (28) + : : : +- Exchange (27) + : : : +- * Project (26) + : : : +- * BroadcastHashJoin LeftSemi BuildRight (25) + : : : :- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- BroadcastExchange (24) + : : : +- * Project (23) + : : : +- * Filter (22) + : : : +- * HashAggregate (21) + : : : +- Exchange (20) + : : : +- * HashAggregate (19) + : : : +- * Project (18) + : : : +- * BroadcastHashJoin Inner BuildRight (17) + : : : :- * Project (12) + : : : : +- * BroadcastHashJoin Inner BuildRight (11) + : : : : :- * Filter (5) + : : : : : +- * ColumnarToRow (4) + : : : : : +- Scan parquet default.store_sales (3) + : : : : +- BroadcastExchange (10) + : : : : +- * Project (9) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.date_dim (6) + : : : +- BroadcastExchange (16) + : : : +- * Filter (15) + : : : +- * ColumnarToRow (14) + : : : +- Scan parquet default.item (13) + : : +- * Sort (44) + : : +- * Project (43) + : : +- * Filter (42) + : : +- * HashAggregate (41) + : : +- Exchange (40) + : : +- * HashAggregate (39) + : : +- * Project (38) + : : +- * BroadcastHashJoin Inner BuildRight (37) + : : :- * Project (32) + : : : +- * Filter (31) + : : : +- * ColumnarToRow (30) + : : : +- Scan parquet default.store_sales (29) + : : +- BroadcastExchange (36) + : : +- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.customer (33) + : +- BroadcastExchange (51) + : +- * Project (50) + : +- * Filter (49) + : +- * ColumnarToRow (48) + : +- Scan parquet default.date_dim (47) + +- * Project (70) + +- * BroadcastHashJoin Inner BuildRight (69) + :- * Project (67) + : +- * SortMergeJoin LeftSemi (66) + : :- * Sort (60) + : : +- Exchange (59) + : : +- * Project (58) + : : +- * BroadcastHashJoin LeftSemi BuildRight (57) + : : :- * ColumnarToRow (55) + : : : +- Scan parquet default.web_sales (54) + : : +- ReusedExchange (56) + : +- * Sort (65) + : +- * Project (64) + : +- * Filter (63) + : +- * HashAggregate (62) + : +- ReusedExchange (61) + +- ReusedExchange (68) + + +(1) Scan parquet default.catalog_sales +Output [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] + +(3) Scan parquet default.store_sales +Output [2]: [ss_item_sk#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(4) ColumnarToRow [codegen id : 3] +Input [2]: [ss_item_sk#7, ss_sold_date_sk#8] + +(5) Filter [codegen id : 3] +Input [2]: [ss_item_sk#7, ss_sold_date_sk#8] +Condition : isnotnull(ss_item_sk#7) + +(6) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_date#11, d_year#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#10, d_date#11, d_year#12] + +(8) Filter [codegen id : 1] +Input [3]: [d_date_sk#10, d_date#11, d_year#12] +Condition : (d_year#12 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#10)) + +(9) Project [codegen id : 1] +Output [2]: [d_date_sk#10, d_date#11] +Input [3]: [d_date_sk#10, d_date#11, d_year#12] + +(10) BroadcastExchange +Input [2]: [d_date_sk#10, d_date#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(11) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(12) Project [codegen id : 3] +Output [2]: [ss_item_sk#7, d_date#11] +Input [4]: [ss_item_sk#7, ss_sold_date_sk#8, d_date_sk#10, d_date#11] + +(13) Scan parquet default.item +Output [2]: [i_item_sk#14, i_item_desc#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 2] +Input [2]: [i_item_sk#14, i_item_desc#15] + +(15) Filter [codegen id : 2] +Input [2]: [i_item_sk#14, i_item_desc#15] +Condition : isnotnull(i_item_sk#14) + +(16) BroadcastExchange +Input [2]: [i_item_sk#14, i_item_desc#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(17) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#7] +Right keys [1]: [i_item_sk#14] +Join condition: None + +(18) Project [codegen id : 3] +Output [3]: [d_date#11, i_item_sk#14, substr(i_item_desc#15, 1, 30) AS _groupingexpression#17] +Input [4]: [ss_item_sk#7, d_date#11, i_item_sk#14, i_item_desc#15] + +(19) HashAggregate [codegen id : 3] +Input [3]: [d_date#11, i_item_sk#14, _groupingexpression#17] +Keys [3]: [_groupingexpression#17, i_item_sk#14, d_date#11] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#18] +Results [4]: [_groupingexpression#17, i_item_sk#14, d_date#11, count#19] + +(20) Exchange +Input [4]: [_groupingexpression#17, i_item_sk#14, d_date#11, count#19] +Arguments: hashpartitioning(_groupingexpression#17, i_item_sk#14, d_date#11, 5), ENSURE_REQUIREMENTS, [id=#20] + +(21) HashAggregate [codegen id : 4] +Input [4]: [_groupingexpression#17, i_item_sk#14, d_date#11, count#19] +Keys [3]: [_groupingexpression#17, i_item_sk#14, d_date#11] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#21] +Results [2]: [i_item_sk#14 AS item_sk#22, count(1)#21 AS count(1)#23] + +(22) Filter [codegen id : 4] +Input [2]: [item_sk#22, count(1)#23] +Condition : (count(1)#23 > 4) + +(23) Project [codegen id : 4] +Output [1]: [item_sk#22] +Input [2]: [item_sk#22, count(1)#23] + +(24) BroadcastExchange +Input [1]: [item_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(25) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [item_sk#22] +Join condition: None + +(26) Project [codegen id : 5] +Output [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] + +(27) Exchange +Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Arguments: hashpartitioning(cs_bill_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#25] + +(28) Sort [codegen id : 6] +Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Arguments: [cs_bill_customer_sk#1 ASC NULLS FIRST], false, 0 + +(29) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 8] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] + +(31) Filter [codegen id : 8] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] +Condition : isnotnull(ss_customer_sk#26) + +(32) Project [codegen id : 8] +Output [3]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] + +(33) Scan parquet default.customer +Output [1]: [c_customer_sk#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 7] +Input [1]: [c_customer_sk#30] + +(35) Filter [codegen id : 7] +Input [1]: [c_customer_sk#30] +Condition : isnotnull(c_customer_sk#30) + +(36) BroadcastExchange +Input [1]: [c_customer_sk#30] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] + +(37) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_customer_sk#26] +Right keys [1]: [c_customer_sk#30] +Join condition: None + +(38) Project [codegen id : 8] +Output [3]: [ss_quantity#27, ss_sales_price#28, c_customer_sk#30] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, c_customer_sk#30] + +(39) HashAggregate [codegen id : 8] +Input [3]: [ss_quantity#27, ss_sales_price#28, c_customer_sk#30] +Keys [1]: [c_customer_sk#30] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#32, isEmpty#33] +Results [3]: [c_customer_sk#30, sum#34, isEmpty#35] + +(40) Exchange +Input [3]: [c_customer_sk#30, sum#34, isEmpty#35] +Arguments: hashpartitioning(c_customer_sk#30, 5), ENSURE_REQUIREMENTS, [id=#36] + +(41) HashAggregate [codegen id : 9] +Input [3]: [c_customer_sk#30, sum#34, isEmpty#35] +Keys [1]: [c_customer_sk#30] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))#37] +Results [2]: [c_customer_sk#30, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))#37 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] + +(42) Filter [codegen id : 9] +Input [2]: [c_customer_sk#30, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(Subquery scalar-subquery#41, [id=#42] as decimal(32,6)))), DecimalType(38,8), true))) + +(43) Project [codegen id : 9] +Output [1]: [c_customer_sk#30] +Input [2]: [c_customer_sk#30, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] + +(44) Sort [codegen id : 9] +Input [1]: [c_customer_sk#30] +Arguments: [c_customer_sk#30 ASC NULLS FIRST], false, 0 + +(45) SortMergeJoin [codegen id : 11] +Left keys [1]: [cs_bill_customer_sk#1] +Right keys [1]: [c_customer_sk#30] +Join condition: None + +(46) Project [codegen id : 11] +Output [3]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] + +(47) Scan parquet default.date_dim +Output [3]: [d_date_sk#43, d_year#44, d_moy#45] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,2), IsNotNull(d_date_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 10] +Input [3]: [d_date_sk#43, d_year#44, d_moy#45] + +(49) Filter [codegen id : 10] +Input [3]: [d_date_sk#43, d_year#44, d_moy#45] +Condition : ((((isnotnull(d_year#44) AND isnotnull(d_moy#45)) AND (d_year#44 = 2000)) AND (d_moy#45 = 2)) AND isnotnull(d_date_sk#43)) + +(50) Project [codegen id : 10] +Output [1]: [d_date_sk#43] +Input [3]: [d_date_sk#43, d_year#44, d_moy#45] + +(51) BroadcastExchange +Input [1]: [d_date_sk#43] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#46] + +(52) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#5] +Right keys [1]: [d_date_sk#43] +Join condition: None + +(53) Project [codegen id : 11] +Output [1]: [CheckOverflow((promote_precision(cast(cast(cs_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#4 as decimal(12,2)))), DecimalType(18,2), true) AS sales#47] +Input [4]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, d_date_sk#43] + +(54) Scan parquet default.web_sales +Output [5]: [ws_item_sk#48, ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#52), dynamicpruningexpression(ws_sold_date_sk#52 IN dynamicpruning#6)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 16] +Input [5]: [ws_item_sk#48, ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] + +(56) ReusedExchange [Reuses operator id: unknown] +Output [1]: [item_sk#22] + +(57) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [ws_item_sk#48] +Right keys [1]: [item_sk#22] +Join condition: None + +(58) Project [codegen id : 16] +Output [4]: [ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] +Input [5]: [ws_item_sk#48, ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] + +(59) Exchange +Input [4]: [ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] +Arguments: hashpartitioning(ws_bill_customer_sk#49, 5), ENSURE_REQUIREMENTS, [id=#53] + +(60) Sort [codegen id : 17] +Input [4]: [ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] +Arguments: [ws_bill_customer_sk#49 ASC NULLS FIRST], false, 0 + +(61) ReusedExchange [Reuses operator id: 40] +Output [3]: [c_customer_sk#54, sum#55, isEmpty#56] + +(62) HashAggregate [codegen id : 20] +Input [3]: [c_customer_sk#54, sum#55, isEmpty#56] +Keys [1]: [c_customer_sk#54] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#57 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#58 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#57 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#58 as decimal(12,2)))), DecimalType(18,2), true))#59] +Results [2]: [c_customer_sk#54, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#57 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#58 as decimal(12,2)))), DecimalType(18,2), true))#59 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#60] + +(63) Filter [codegen id : 20] +Input [2]: [c_customer_sk#54, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#60] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#60) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#60 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#41, [id=#42] as decimal(32,6)))), DecimalType(38,8), true))) + +(64) Project [codegen id : 20] +Output [1]: [c_customer_sk#54] +Input [2]: [c_customer_sk#54, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#60] + +(65) Sort [codegen id : 20] +Input [1]: [c_customer_sk#54] +Arguments: [c_customer_sk#54 ASC NULLS FIRST], false, 0 + +(66) SortMergeJoin [codegen id : 22] +Left keys [1]: [ws_bill_customer_sk#49] +Right keys [1]: [c_customer_sk#54] +Join condition: None + +(67) Project [codegen id : 22] +Output [3]: [ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] +Input [4]: [ws_bill_customer_sk#49, ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52] + +(68) ReusedExchange [Reuses operator id: 51] +Output [1]: [d_date_sk#61] + +(69) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [ws_sold_date_sk#52] +Right keys [1]: [d_date_sk#61] +Join condition: None + +(70) Project [codegen id : 22] +Output [1]: [CheckOverflow((promote_precision(cast(cast(ws_quantity#50 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#51 as decimal(12,2)))), DecimalType(18,2), true) AS sales#62] +Input [4]: [ws_quantity#50, ws_list_price#51, ws_sold_date_sk#52, d_date_sk#61] + +(71) Union + +(72) HashAggregate [codegen id : 23] +Input [1]: [sales#47] +Keys: [] +Functions [1]: [partial_sum(sales#47)] +Aggregate Attributes [2]: [sum#63, isEmpty#64] +Results [2]: [sum#65, isEmpty#66] + +(73) Exchange +Input [2]: [sum#65, isEmpty#66] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#67] + +(74) HashAggregate [codegen id : 24] +Input [2]: [sum#65, isEmpty#66] +Keys: [] +Functions [1]: [sum(sales#47)] +Aggregate Attributes [1]: [sum(sales#47)#68] +Results [1]: [sum(sales#47)#68 AS sum(sales)#69] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (75) + + +(75) ReusedExchange [Reuses operator id: 51] +Output [1]: [d_date_sk#43] + +Subquery:2 Hosting operator id = 3 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (76) + + +(76) ReusedExchange [Reuses operator id: 10] +Output [2]: [d_date_sk#10, d_date#11] + +Subquery:3 Hosting operator id = 42 Hosting Expression = Subquery scalar-subquery#41, [id=#42] +* HashAggregate (98) ++- Exchange (97) + +- * HashAggregate (96) + +- * HashAggregate (95) + +- Exchange (94) + +- * HashAggregate (93) + +- * Project (92) + +- * BroadcastHashJoin Inner BuildRight (91) + :- * Project (85) + : +- * BroadcastHashJoin Inner BuildRight (84) + : :- * Filter (79) + : : +- * ColumnarToRow (78) + : : +- Scan parquet default.store_sales (77) + : +- BroadcastExchange (83) + : +- * Filter (82) + : +- * ColumnarToRow (81) + : +- Scan parquet default.customer (80) + +- BroadcastExchange (90) + +- * Project (89) + +- * Filter (88) + +- * ColumnarToRow (87) + +- Scan parquet default.date_dim (86) + + +(77) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#70, ss_quantity#71, ss_sales_price#72, ss_sold_date_sk#73] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#73), dynamicpruningexpression(ss_sold_date_sk#73 IN dynamicpruning#74)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(78) ColumnarToRow [codegen id : 3] +Input [4]: [ss_customer_sk#70, ss_quantity#71, ss_sales_price#72, ss_sold_date_sk#73] + +(79) Filter [codegen id : 3] +Input [4]: [ss_customer_sk#70, ss_quantity#71, ss_sales_price#72, ss_sold_date_sk#73] +Condition : isnotnull(ss_customer_sk#70) + +(80) Scan parquet default.customer +Output [1]: [c_customer_sk#75] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(81) ColumnarToRow [codegen id : 1] +Input [1]: [c_customer_sk#75] + +(82) Filter [codegen id : 1] +Input [1]: [c_customer_sk#75] +Condition : isnotnull(c_customer_sk#75) + +(83) BroadcastExchange +Input [1]: [c_customer_sk#75] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#76] + +(84) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_customer_sk#70] +Right keys [1]: [c_customer_sk#75] +Join condition: None + +(85) Project [codegen id : 3] +Output [4]: [ss_quantity#71, ss_sales_price#72, ss_sold_date_sk#73, c_customer_sk#75] +Input [5]: [ss_customer_sk#70, ss_quantity#71, ss_sales_price#72, ss_sold_date_sk#73, c_customer_sk#75] + +(86) Scan parquet default.date_dim +Output [2]: [d_date_sk#77, d_year#78] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(87) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#77, d_year#78] + +(88) Filter [codegen id : 2] +Input [2]: [d_date_sk#77, d_year#78] +Condition : (d_year#78 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#77)) + +(89) Project [codegen id : 2] +Output [1]: [d_date_sk#77] +Input [2]: [d_date_sk#77, d_year#78] + +(90) BroadcastExchange +Input [1]: [d_date_sk#77] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#79] + +(91) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#73] +Right keys [1]: [d_date_sk#77] +Join condition: None + +(92) Project [codegen id : 3] +Output [3]: [ss_quantity#71, ss_sales_price#72, c_customer_sk#75] +Input [5]: [ss_quantity#71, ss_sales_price#72, ss_sold_date_sk#73, c_customer_sk#75, d_date_sk#77] + +(93) HashAggregate [codegen id : 3] +Input [3]: [ss_quantity#71, ss_sales_price#72, c_customer_sk#75] +Keys [1]: [c_customer_sk#75] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#72 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#80, isEmpty#81] +Results [3]: [c_customer_sk#75, sum#82, isEmpty#83] + +(94) Exchange +Input [3]: [c_customer_sk#75, sum#82, isEmpty#83] +Arguments: hashpartitioning(c_customer_sk#75, 5), ENSURE_REQUIREMENTS, [id=#84] + +(95) HashAggregate [codegen id : 4] +Input [3]: [c_customer_sk#75, sum#82, isEmpty#83] +Keys [1]: [c_customer_sk#75] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#72 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#72 as decimal(12,2)))), DecimalType(18,2), true))#85] +Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#72 as decimal(12,2)))), DecimalType(18,2), true))#85 AS csales#86] + +(96) HashAggregate [codegen id : 4] +Input [1]: [csales#86] +Keys: [] +Functions [1]: [partial_max(csales#86)] +Aggregate Attributes [1]: [max#87] +Results [1]: [max#88] + +(97) Exchange +Input [1]: [max#88] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#89] + +(98) HashAggregate [codegen id : 5] +Input [1]: [max#88] +Keys: [] +Functions [1]: [max(csales#86)] +Aggregate Attributes [1]: [max(csales#86)#90] +Results [1]: [max(csales#86)#90 AS tpcds_cmax#91] + +Subquery:4 Hosting operator id = 77 Hosting Expression = ss_sold_date_sk#73 IN dynamicpruning#74 +ReusedExchange (99) + + +(99) ReusedExchange [Reuses operator id: 90] +Output [1]: [d_date_sk#77] + +Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#52 IN dynamicpruning#6 + +Subquery:6 Hosting operator id = 63 Hosting Expression = ReusedSubquery Subquery scalar-subquery#41, [id=#42] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt new file mode 100644 index 0000000000000..697c1f497c399 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23a/simplified.txt @@ -0,0 +1,160 @@ +WholeStageCodegen (24) + HashAggregate [sum,isEmpty] [sum(sales),sum(sales),sum,isEmpty] + InputAdapter + Exchange #1 + WholeStageCodegen (23) + HashAggregate [sales] [sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (11) + Project [cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_quantity,cs_list_price,cs_sold_date_sk] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (6) + Sort [cs_bill_customer_sk] + InputAdapter + Exchange [cs_bill_customer_sk] #2 + WholeStageCodegen (5) + Project [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sold_date_sk] + BroadcastHashJoin [cs_item_sk,item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [item_sk] + Filter [count(1)] + HashAggregate [_groupingexpression,i_item_sk,d_date,count] [count(1),item_sk,count(1),count] + InputAdapter + Exchange [_groupingexpression,i_item_sk,d_date] #5 + WholeStageCodegen (3) + HashAggregate [_groupingexpression,i_item_sk,d_date] [count,count] + Project [d_date,i_item_sk,i_item_desc] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,d_date] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_date] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Project [d_date_sk,d_date] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_year] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_desc] + InputAdapter + WholeStageCodegen (9) + Sort [c_customer_sk] + Project [c_customer_sk] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] + Subquery #3 + WholeStageCodegen (5) + HashAggregate [max] [max(csales),tpcds_cmax,max] + InputAdapter + Exchange #10 + WholeStageCodegen (4) + HashAggregate [csales] [max,max] + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),csales,sum,isEmpty] + InputAdapter + Exchange [c_customer_sk] #11 + WholeStageCodegen (3) + HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,c_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_quantity,ss_sales_price,ss_sold_date_sk,c_customer_sk] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #4 + ReusedExchange [d_date_sk] #12 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (1) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty] + InputAdapter + Exchange [c_customer_sk] #8 + WholeStageCodegen (8) + HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,c_customer_sk] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,ss_quantity,ss_sales_price] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (7) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (10) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (22) + Project [ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_quantity,ws_list_price,ws_sold_date_sk] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (17) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #14 + WholeStageCodegen (16) + Project [ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk] + BroadcastHashJoin [ws_item_sk,item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [item_sk] #15 + InputAdapter + WholeStageCodegen (20) + Sort [c_customer_sk] + Project [c_customer_sk] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [tpcds_cmax] #3 + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty] + InputAdapter + ReusedExchange [c_customer_sk,sum,isEmpty] #8 + InputAdapter + ReusedExchange [d_date_sk] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/explain.txt new file mode 100644 index 0000000000000..c5b8ad4607553 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/explain.txt @@ -0,0 +1,938 @@ +== Physical Plan == +TakeOrderedAndProject (137) ++- Union (136) + :- * HashAggregate (81) + : +- Exchange (80) + : +- * HashAggregate (79) + : +- * Project (78) + : +- * SortMergeJoin Inner (77) + : :- * Project (59) + : : +- * BroadcastHashJoin Inner BuildRight (58) + : : :- * SortMergeJoin LeftSemi (52) + : : : :- * Sort (33) + : : : : +- Exchange (32) + : : : : +- * Project (31) + : : : : +- * SortMergeJoin LeftSemi (30) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- * Sort (29) + : : : : +- * Project (28) + : : : : +- * Filter (27) + : : : : +- * HashAggregate (26) + : : : : +- * HashAggregate (25) + : : : : +- * Project (24) + : : : : +- * SortMergeJoin Inner (23) + : : : : :- * Sort (17) + : : : : : +- Exchange (16) + : : : : : +- * Project (15) + : : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : : :- * Filter (8) + : : : : : : +- * ColumnarToRow (7) + : : : : : : +- Scan parquet default.store_sales (6) + : : : : : +- BroadcastExchange (13) + : : : : : +- * Project (12) + : : : : : +- * Filter (11) + : : : : : +- * ColumnarToRow (10) + : : : : : +- Scan parquet default.date_dim (9) + : : : : +- * Sort (22) + : : : : +- Exchange (21) + : : : : +- * Filter (20) + : : : : +- * ColumnarToRow (19) + : : : : +- Scan parquet default.item (18) + : : : +- * Sort (51) + : : : +- * Project (50) + : : : +- * Filter (49) + : : : +- * HashAggregate (48) + : : : +- * HashAggregate (47) + : : : +- * Project (46) + : : : +- * SortMergeJoin Inner (45) + : : : :- * Sort (39) + : : : : +- Exchange (38) + : : : : +- * Project (37) + : : : : +- * Filter (36) + : : : : +- * ColumnarToRow (35) + : : : : +- Scan parquet default.store_sales (34) + : : : +- * Sort (44) + : : : +- Exchange (43) + : : : +- * Filter (42) + : : : +- * ColumnarToRow (41) + : : : +- Scan parquet default.customer (40) + : : +- BroadcastExchange (57) + : : +- * Project (56) + : : +- * Filter (55) + : : +- * ColumnarToRow (54) + : : +- Scan parquet default.date_dim (53) + : +- * SortMergeJoin LeftSemi (76) + : :- * Sort (64) + : : +- Exchange (63) + : : +- * Filter (62) + : : +- * ColumnarToRow (61) + : : +- Scan parquet default.customer (60) + : +- * Sort (75) + : +- * Project (74) + : +- * Filter (73) + : +- * HashAggregate (72) + : +- * HashAggregate (71) + : +- * Project (70) + : +- * SortMergeJoin Inner (69) + : :- * Sort (66) + : : +- ReusedExchange (65) + : +- * Sort (68) + : +- ReusedExchange (67) + +- * HashAggregate (135) + +- Exchange (134) + +- * HashAggregate (133) + +- * Project (132) + +- * SortMergeJoin Inner (131) + :- * Project (116) + : +- * BroadcastHashJoin Inner BuildRight (115) + : :- * SortMergeJoin LeftSemi (113) + : : :- * Sort (101) + : : : +- Exchange (100) + : : : +- * Project (99) + : : : +- * SortMergeJoin LeftSemi (98) + : : : :- * Sort (86) + : : : : +- Exchange (85) + : : : : +- * Filter (84) + : : : : +- * ColumnarToRow (83) + : : : : +- Scan parquet default.web_sales (82) + : : : +- * Sort (97) + : : : +- * Project (96) + : : : +- * Filter (95) + : : : +- * HashAggregate (94) + : : : +- * HashAggregate (93) + : : : +- * Project (92) + : : : +- * SortMergeJoin Inner (91) + : : : :- * Sort (88) + : : : : +- ReusedExchange (87) + : : : +- * Sort (90) + : : : +- ReusedExchange (89) + : : +- * Sort (112) + : : +- * Project (111) + : : +- * Filter (110) + : : +- * HashAggregate (109) + : : +- * HashAggregate (108) + : : +- * Project (107) + : : +- * SortMergeJoin Inner (106) + : : :- * Sort (103) + : : : +- ReusedExchange (102) + : : +- * Sort (105) + : : +- ReusedExchange (104) + : +- ReusedExchange (114) + +- * SortMergeJoin LeftSemi (130) + :- * Sort (118) + : +- ReusedExchange (117) + +- * Sort (129) + +- * Project (128) + +- * Filter (127) + +- * HashAggregate (126) + +- * HashAggregate (125) + +- * Project (124) + +- * SortMergeJoin Inner (123) + :- * Sort (120) + : +- ReusedExchange (119) + +- * Sort (122) + +- ReusedExchange (121) + + +(1) Scan parquet default.catalog_sales +Output [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] + +(3) Filter [codegen id : 1] +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Condition : isnotnull(cs_bill_customer_sk#1) + +(4) Exchange +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Arguments: hashpartitioning(cs_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] + +(5) Sort [codegen id : 2] +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_sales +Output [2]: [ss_item_sk#8, ss_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#9), dynamicpruningexpression(ss_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ss_item_sk#8, ss_sold_date_sk#9] + +(8) Filter [codegen id : 4] +Input [2]: [ss_item_sk#8, ss_sold_date_sk#9] +Condition : isnotnull(ss_item_sk#8) + +(9) Scan parquet default.date_dim +Output [3]: [d_date_sk#11, d_date#12, d_year#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(10) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#11, d_date#12, d_year#13] + +(11) Filter [codegen id : 3] +Input [3]: [d_date_sk#11, d_date#12, d_year#13] +Condition : (d_year#13 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#11)) + +(12) Project [codegen id : 3] +Output [2]: [d_date_sk#11, d_date#12] +Input [3]: [d_date_sk#11, d_date#12, d_year#13] + +(13) BroadcastExchange +Input [2]: [d_date_sk#11, d_date#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#9] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(15) Project [codegen id : 4] +Output [2]: [ss_item_sk#8, d_date#12] +Input [4]: [ss_item_sk#8, ss_sold_date_sk#9, d_date_sk#11, d_date#12] + +(16) Exchange +Input [2]: [ss_item_sk#8, d_date#12] +Arguments: hashpartitioning(ss_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#15] + +(17) Sort [codegen id : 5] +Input [2]: [ss_item_sk#8, d_date#12] +Arguments: [ss_item_sk#8 ASC NULLS FIRST], false, 0 + +(18) Scan parquet default.item +Output [2]: [i_item_sk#16, i_item_desc#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 6] +Input [2]: [i_item_sk#16, i_item_desc#17] + +(20) Filter [codegen id : 6] +Input [2]: [i_item_sk#16, i_item_desc#17] +Condition : isnotnull(i_item_sk#16) + +(21) Exchange +Input [2]: [i_item_sk#16, i_item_desc#17] +Arguments: hashpartitioning(i_item_sk#16, 5), ENSURE_REQUIREMENTS, [id=#18] + +(22) Sort [codegen id : 7] +Input [2]: [i_item_sk#16, i_item_desc#17] +Arguments: [i_item_sk#16 ASC NULLS FIRST], false, 0 + +(23) SortMergeJoin [codegen id : 8] +Left keys [1]: [ss_item_sk#8] +Right keys [1]: [i_item_sk#16] +Join condition: None + +(24) Project [codegen id : 8] +Output [3]: [d_date#12, i_item_sk#16, substr(i_item_desc#17, 1, 30) AS _groupingexpression#19] +Input [4]: [ss_item_sk#8, d_date#12, i_item_sk#16, i_item_desc#17] + +(25) HashAggregate [codegen id : 8] +Input [3]: [d_date#12, i_item_sk#16, _groupingexpression#19] +Keys [3]: [_groupingexpression#19, i_item_sk#16, d_date#12] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#20] +Results [4]: [_groupingexpression#19, i_item_sk#16, d_date#12, count#21] + +(26) HashAggregate [codegen id : 8] +Input [4]: [_groupingexpression#19, i_item_sk#16, d_date#12, count#21] +Keys [3]: [_groupingexpression#19, i_item_sk#16, d_date#12] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#22] +Results [2]: [i_item_sk#16 AS item_sk#23, count(1)#22 AS count(1)#24] + +(27) Filter [codegen id : 8] +Input [2]: [item_sk#23, count(1)#24] +Condition : (count(1)#24 > 4) + +(28) Project [codegen id : 8] +Output [1]: [item_sk#23] +Input [2]: [item_sk#23, count(1)#24] + +(29) Sort [codegen id : 8] +Input [1]: [item_sk#23] +Arguments: [item_sk#23 ASC NULLS FIRST], false, 0 + +(30) SortMergeJoin [codegen id : 9] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [item_sk#23] +Join condition: None + +(31) Project [codegen id : 9] +Output [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] + +(32) Exchange +Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Arguments: hashpartitioning(cs_bill_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#25] + +(33) Sort [codegen id : 10] +Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Arguments: [cs_bill_customer_sk#1 ASC NULLS FIRST], false, 0 + +(34) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 11] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] + +(36) Filter [codegen id : 11] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] +Condition : isnotnull(ss_customer_sk#26) + +(37) Project [codegen id : 11] +Output [3]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] + +(38) Exchange +Input [3]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28] +Arguments: hashpartitioning(ss_customer_sk#26, 5), ENSURE_REQUIREMENTS, [id=#30] + +(39) Sort [codegen id : 12] +Input [3]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28] +Arguments: [ss_customer_sk#26 ASC NULLS FIRST], false, 0 + +(40) Scan parquet default.customer +Output [1]: [c_customer_sk#31] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 13] +Input [1]: [c_customer_sk#31] + +(42) Filter [codegen id : 13] +Input [1]: [c_customer_sk#31] +Condition : isnotnull(c_customer_sk#31) + +(43) Exchange +Input [1]: [c_customer_sk#31] +Arguments: hashpartitioning(c_customer_sk#31, 5), ENSURE_REQUIREMENTS, [id=#32] + +(44) Sort [codegen id : 14] +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 + +(45) SortMergeJoin [codegen id : 15] +Left keys [1]: [ss_customer_sk#26] +Right keys [1]: [c_customer_sk#31] +Join condition: None + +(46) Project [codegen id : 15] +Output [3]: [ss_quantity#27, ss_sales_price#28, c_customer_sk#31] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, c_customer_sk#31] + +(47) HashAggregate [codegen id : 15] +Input [3]: [ss_quantity#27, ss_sales_price#28, c_customer_sk#31] +Keys [1]: [c_customer_sk#31] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#33, isEmpty#34] +Results [3]: [c_customer_sk#31, sum#35, isEmpty#36] + +(48) HashAggregate [codegen id : 15] +Input [3]: [c_customer_sk#31, sum#35, isEmpty#36] +Keys [1]: [c_customer_sk#31] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))#37] +Results [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))#37 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] + +(49) Filter [codegen id : 15] +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(Subquery scalar-subquery#41, [id=#42] as decimal(32,6)))), DecimalType(38,8), true))) + +(50) Project [codegen id : 15] +Output [1]: [c_customer_sk#31] +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] + +(51) Sort [codegen id : 15] +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 + +(52) SortMergeJoin [codegen id : 17] +Left keys [1]: [cs_bill_customer_sk#1] +Right keys [1]: [c_customer_sk#31] +Join condition: None + +(53) Scan parquet default.date_dim +Output [3]: [d_date_sk#43, d_year#44, d_moy#45] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,2), IsNotNull(d_date_sk)] +ReadSchema: struct + +(54) ColumnarToRow [codegen id : 16] +Input [3]: [d_date_sk#43, d_year#44, d_moy#45] + +(55) Filter [codegen id : 16] +Input [3]: [d_date_sk#43, d_year#44, d_moy#45] +Condition : ((((isnotnull(d_year#44) AND isnotnull(d_moy#45)) AND (d_year#44 = 2000)) AND (d_moy#45 = 2)) AND isnotnull(d_date_sk#43)) + +(56) Project [codegen id : 16] +Output [1]: [d_date_sk#43] +Input [3]: [d_date_sk#43, d_year#44, d_moy#45] + +(57) BroadcastExchange +Input [1]: [d_date_sk#43] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#46] + +(58) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [cs_sold_date_sk#5] +Right keys [1]: [d_date_sk#43] +Join condition: None + +(59) Project [codegen id : 17] +Output [3]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4] +Input [5]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, d_date_sk#43] + +(60) Scan parquet default.customer +Output [3]: [c_customer_sk#47, c_first_name#48, c_last_name#49] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(61) ColumnarToRow [codegen id : 18] +Input [3]: [c_customer_sk#47, c_first_name#48, c_last_name#49] + +(62) Filter [codegen id : 18] +Input [3]: [c_customer_sk#47, c_first_name#48, c_last_name#49] +Condition : isnotnull(c_customer_sk#47) + +(63) Exchange +Input [3]: [c_customer_sk#47, c_first_name#48, c_last_name#49] +Arguments: hashpartitioning(c_customer_sk#47, 5), ENSURE_REQUIREMENTS, [id=#50] + +(64) Sort [codegen id : 19] +Input [3]: [c_customer_sk#47, c_first_name#48, c_last_name#49] +Arguments: [c_customer_sk#47 ASC NULLS FIRST], false, 0 + +(65) ReusedExchange [Reuses operator id: 38] +Output [3]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28] + +(66) Sort [codegen id : 21] +Input [3]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28] +Arguments: [ss_customer_sk#26 ASC NULLS FIRST], false, 0 + +(67) ReusedExchange [Reuses operator id: 43] +Output [1]: [c_customer_sk#31] + +(68) Sort [codegen id : 23] +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 + +(69) SortMergeJoin [codegen id : 24] +Left keys [1]: [ss_customer_sk#26] +Right keys [1]: [c_customer_sk#31] +Join condition: None + +(70) Project [codegen id : 24] +Output [3]: [ss_quantity#27, ss_sales_price#28, c_customer_sk#31] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, c_customer_sk#31] + +(71) HashAggregate [codegen id : 24] +Input [3]: [ss_quantity#27, ss_sales_price#28, c_customer_sk#31] +Keys [1]: [c_customer_sk#31] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#33, isEmpty#34] +Results [3]: [c_customer_sk#31, sum#35, isEmpty#36] + +(72) HashAggregate [codegen id : 24] +Input [3]: [c_customer_sk#31, sum#35, isEmpty#36] +Keys [1]: [c_customer_sk#31] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))#37] +Results [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))#37 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] + +(73) Filter [codegen id : 24] +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#41, [id=#42] as decimal(32,6)))), DecimalType(38,8), true))) + +(74) Project [codegen id : 24] +Output [1]: [c_customer_sk#31] +Input [2]: [c_customer_sk#31, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] + +(75) Sort [codegen id : 24] +Input [1]: [c_customer_sk#31] +Arguments: [c_customer_sk#31 ASC NULLS FIRST], false, 0 + +(76) SortMergeJoin [codegen id : 25] +Left keys [1]: [c_customer_sk#47] +Right keys [1]: [c_customer_sk#31] +Join condition: None + +(77) SortMergeJoin [codegen id : 26] +Left keys [1]: [cs_bill_customer_sk#1] +Right keys [1]: [c_customer_sk#47] +Join condition: None + +(78) Project [codegen id : 26] +Output [4]: [cs_quantity#3, cs_list_price#4, c_first_name#48, c_last_name#49] +Input [6]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, c_customer_sk#47, c_first_name#48, c_last_name#49] + +(79) HashAggregate [codegen id : 26] +Input [4]: [cs_quantity#3, cs_list_price#4, c_first_name#48, c_last_name#49] +Keys [2]: [c_last_name#49, c_first_name#48] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#51, isEmpty#52] +Results [4]: [c_last_name#49, c_first_name#48, sum#53, isEmpty#54] + +(80) Exchange +Input [4]: [c_last_name#49, c_first_name#48, sum#53, isEmpty#54] +Arguments: hashpartitioning(c_last_name#49, c_first_name#48, 5), ENSURE_REQUIREMENTS, [id=#55] + +(81) HashAggregate [codegen id : 27] +Input [4]: [c_last_name#49, c_first_name#48, sum#53, isEmpty#54] +Keys [2]: [c_last_name#49, c_first_name#48] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#56] +Results [3]: [c_last_name#49, c_first_name#48, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#56 AS sales#57] + +(82) Scan parquet default.web_sales +Output [5]: [ws_item_sk#58, ws_bill_customer_sk#59, ws_quantity#60, ws_list_price#61, ws_sold_date_sk#62] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#62), dynamicpruningexpression(ws_sold_date_sk#62 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(83) ColumnarToRow [codegen id : 28] +Input [5]: [ws_item_sk#58, ws_bill_customer_sk#59, ws_quantity#60, ws_list_price#61, ws_sold_date_sk#62] + +(84) Filter [codegen id : 28] +Input [5]: [ws_item_sk#58, ws_bill_customer_sk#59, ws_quantity#60, ws_list_price#61, ws_sold_date_sk#62] +Condition : isnotnull(ws_bill_customer_sk#59) + +(85) Exchange +Input [5]: [ws_item_sk#58, ws_bill_customer_sk#59, ws_quantity#60, ws_list_price#61, ws_sold_date_sk#62] +Arguments: hashpartitioning(ws_item_sk#58, 5), ENSURE_REQUIREMENTS, [id=#63] + +(86) Sort [codegen id : 29] +Input [5]: [ws_item_sk#58, ws_bill_customer_sk#59, ws_quantity#60, ws_list_price#61, ws_sold_date_sk#62] +Arguments: [ws_item_sk#58 ASC NULLS FIRST], false, 0 + +(87) ReusedExchange [Reuses operator id: unknown] +Output [2]: [ss_item_sk#64, d_date#65] + +(88) Sort [codegen id : 32] +Input [2]: [ss_item_sk#64, d_date#65] +Arguments: [ss_item_sk#64 ASC NULLS FIRST], false, 0 + +(89) ReusedExchange [Reuses operator id: 21] +Output [2]: [i_item_sk#66, i_item_desc#67] + +(90) Sort [codegen id : 34] +Input [2]: [i_item_sk#66, i_item_desc#67] +Arguments: [i_item_sk#66 ASC NULLS FIRST], false, 0 + +(91) SortMergeJoin [codegen id : 35] +Left keys [1]: [ss_item_sk#64] +Right keys [1]: [i_item_sk#66] +Join condition: None + +(92) Project [codegen id : 35] +Output [3]: [d_date#65, i_item_sk#66, substr(i_item_desc#67, 1, 30) AS _groupingexpression#68] +Input [4]: [ss_item_sk#64, d_date#65, i_item_sk#66, i_item_desc#67] + +(93) HashAggregate [codegen id : 35] +Input [3]: [d_date#65, i_item_sk#66, _groupingexpression#68] +Keys [3]: [_groupingexpression#68, i_item_sk#66, d_date#65] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#69] +Results [4]: [_groupingexpression#68, i_item_sk#66, d_date#65, count#70] + +(94) HashAggregate [codegen id : 35] +Input [4]: [_groupingexpression#68, i_item_sk#66, d_date#65, count#70] +Keys [3]: [_groupingexpression#68, i_item_sk#66, d_date#65] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#71] +Results [2]: [i_item_sk#66 AS item_sk#23, count(1)#71 AS count(1)#72] + +(95) Filter [codegen id : 35] +Input [2]: [item_sk#23, count(1)#72] +Condition : (count(1)#72 > 4) + +(96) Project [codegen id : 35] +Output [1]: [item_sk#23] +Input [2]: [item_sk#23, count(1)#72] + +(97) Sort [codegen id : 35] +Input [1]: [item_sk#23] +Arguments: [item_sk#23 ASC NULLS FIRST], false, 0 + +(98) SortMergeJoin [codegen id : 36] +Left keys [1]: [ws_item_sk#58] +Right keys [1]: [item_sk#23] +Join condition: None + +(99) Project [codegen id : 36] +Output [4]: [ws_bill_customer_sk#59, ws_quantity#60, ws_list_price#61, ws_sold_date_sk#62] +Input [5]: [ws_item_sk#58, ws_bill_customer_sk#59, ws_quantity#60, ws_list_price#61, ws_sold_date_sk#62] + +(100) Exchange +Input [4]: [ws_bill_customer_sk#59, ws_quantity#60, ws_list_price#61, ws_sold_date_sk#62] +Arguments: hashpartitioning(ws_bill_customer_sk#59, 5), ENSURE_REQUIREMENTS, [id=#73] + +(101) Sort [codegen id : 37] +Input [4]: [ws_bill_customer_sk#59, ws_quantity#60, ws_list_price#61, ws_sold_date_sk#62] +Arguments: [ws_bill_customer_sk#59 ASC NULLS FIRST], false, 0 + +(102) ReusedExchange [Reuses operator id: 38] +Output [3]: [ss_customer_sk#74, ss_quantity#75, ss_sales_price#76] + +(103) Sort [codegen id : 39] +Input [3]: [ss_customer_sk#74, ss_quantity#75, ss_sales_price#76] +Arguments: [ss_customer_sk#74 ASC NULLS FIRST], false, 0 + +(104) ReusedExchange [Reuses operator id: 43] +Output [1]: [c_customer_sk#77] + +(105) Sort [codegen id : 41] +Input [1]: [c_customer_sk#77] +Arguments: [c_customer_sk#77 ASC NULLS FIRST], false, 0 + +(106) SortMergeJoin [codegen id : 42] +Left keys [1]: [ss_customer_sk#74] +Right keys [1]: [c_customer_sk#77] +Join condition: None + +(107) Project [codegen id : 42] +Output [3]: [ss_quantity#75, ss_sales_price#76, c_customer_sk#77] +Input [4]: [ss_customer_sk#74, ss_quantity#75, ss_sales_price#76, c_customer_sk#77] + +(108) HashAggregate [codegen id : 42] +Input [3]: [ss_quantity#75, ss_sales_price#76, c_customer_sk#77] +Keys [1]: [c_customer_sk#77] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#76 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#78, isEmpty#79] +Results [3]: [c_customer_sk#77, sum#80, isEmpty#81] + +(109) HashAggregate [codegen id : 42] +Input [3]: [c_customer_sk#77, sum#80, isEmpty#81] +Keys [1]: [c_customer_sk#77] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#76 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#76 as decimal(12,2)))), DecimalType(18,2), true))#82] +Results [2]: [c_customer_sk#77, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#76 as decimal(12,2)))), DecimalType(18,2), true))#82 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#83] + +(110) Filter [codegen id : 42] +Input [2]: [c_customer_sk#77, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#83] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#83) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#83 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#41, [id=#42] as decimal(32,6)))), DecimalType(38,8), true))) + +(111) Project [codegen id : 42] +Output [1]: [c_customer_sk#77] +Input [2]: [c_customer_sk#77, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#83] + +(112) Sort [codegen id : 42] +Input [1]: [c_customer_sk#77] +Arguments: [c_customer_sk#77 ASC NULLS FIRST], false, 0 + +(113) SortMergeJoin [codegen id : 44] +Left keys [1]: [ws_bill_customer_sk#59] +Right keys [1]: [c_customer_sk#77] +Join condition: None + +(114) ReusedExchange [Reuses operator id: 57] +Output [1]: [d_date_sk#84] + +(115) BroadcastHashJoin [codegen id : 44] +Left keys [1]: [ws_sold_date_sk#62] +Right keys [1]: [d_date_sk#84] +Join condition: None + +(116) Project [codegen id : 44] +Output [3]: [ws_bill_customer_sk#59, ws_quantity#60, ws_list_price#61] +Input [5]: [ws_bill_customer_sk#59, ws_quantity#60, ws_list_price#61, ws_sold_date_sk#62, d_date_sk#84] + +(117) ReusedExchange [Reuses operator id: 63] +Output [3]: [c_customer_sk#85, c_first_name#86, c_last_name#87] + +(118) Sort [codegen id : 46] +Input [3]: [c_customer_sk#85, c_first_name#86, c_last_name#87] +Arguments: [c_customer_sk#85 ASC NULLS FIRST], false, 0 + +(119) ReusedExchange [Reuses operator id: 38] +Output [3]: [ss_customer_sk#74, ss_quantity#75, ss_sales_price#76] + +(120) Sort [codegen id : 48] +Input [3]: [ss_customer_sk#74, ss_quantity#75, ss_sales_price#76] +Arguments: [ss_customer_sk#74 ASC NULLS FIRST], false, 0 + +(121) ReusedExchange [Reuses operator id: 43] +Output [1]: [c_customer_sk#77] + +(122) Sort [codegen id : 50] +Input [1]: [c_customer_sk#77] +Arguments: [c_customer_sk#77 ASC NULLS FIRST], false, 0 + +(123) SortMergeJoin [codegen id : 51] +Left keys [1]: [ss_customer_sk#74] +Right keys [1]: [c_customer_sk#77] +Join condition: None + +(124) Project [codegen id : 51] +Output [3]: [ss_quantity#75, ss_sales_price#76, c_customer_sk#77] +Input [4]: [ss_customer_sk#74, ss_quantity#75, ss_sales_price#76, c_customer_sk#77] + +(125) HashAggregate [codegen id : 51] +Input [3]: [ss_quantity#75, ss_sales_price#76, c_customer_sk#77] +Keys [1]: [c_customer_sk#77] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#76 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#78, isEmpty#79] +Results [3]: [c_customer_sk#77, sum#80, isEmpty#81] + +(126) HashAggregate [codegen id : 51] +Input [3]: [c_customer_sk#77, sum#80, isEmpty#81] +Keys [1]: [c_customer_sk#77] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#76 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#76 as decimal(12,2)))), DecimalType(18,2), true))#82] +Results [2]: [c_customer_sk#77, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#76 as decimal(12,2)))), DecimalType(18,2), true))#82 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#83] + +(127) Filter [codegen id : 51] +Input [2]: [c_customer_sk#77, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#83] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#83) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#83 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#41, [id=#42] as decimal(32,6)))), DecimalType(38,8), true))) + +(128) Project [codegen id : 51] +Output [1]: [c_customer_sk#77] +Input [2]: [c_customer_sk#77, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#83] + +(129) Sort [codegen id : 51] +Input [1]: [c_customer_sk#77] +Arguments: [c_customer_sk#77 ASC NULLS FIRST], false, 0 + +(130) SortMergeJoin [codegen id : 52] +Left keys [1]: [c_customer_sk#85] +Right keys [1]: [c_customer_sk#77] +Join condition: None + +(131) SortMergeJoin [codegen id : 53] +Left keys [1]: [ws_bill_customer_sk#59] +Right keys [1]: [c_customer_sk#85] +Join condition: None + +(132) Project [codegen id : 53] +Output [4]: [ws_quantity#60, ws_list_price#61, c_first_name#86, c_last_name#87] +Input [6]: [ws_bill_customer_sk#59, ws_quantity#60, ws_list_price#61, c_customer_sk#85, c_first_name#86, c_last_name#87] + +(133) HashAggregate [codegen id : 53] +Input [4]: [ws_quantity#60, ws_list_price#61, c_first_name#86, c_last_name#87] +Keys [2]: [c_last_name#87, c_first_name#86] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#88, isEmpty#89] +Results [4]: [c_last_name#87, c_first_name#86, sum#90, isEmpty#91] + +(134) Exchange +Input [4]: [c_last_name#87, c_first_name#86, sum#90, isEmpty#91] +Arguments: hashpartitioning(c_last_name#87, c_first_name#86, 5), ENSURE_REQUIREMENTS, [id=#92] + +(135) HashAggregate [codegen id : 54] +Input [4]: [c_last_name#87, c_first_name#86, sum#90, isEmpty#91] +Keys [2]: [c_last_name#87, c_first_name#86] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#93] +Results [3]: [c_last_name#87, c_first_name#86, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#60 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#61 as decimal(12,2)))), DecimalType(18,2), true))#93 AS sales#94] + +(136) Union + +(137) TakeOrderedAndProject +Input [3]: [c_last_name#49, c_first_name#48, sales#57] +Arguments: 100, [c_last_name#49 ASC NULLS FIRST, c_first_name#48 ASC NULLS FIRST, sales#57 ASC NULLS FIRST], [c_last_name#49, c_first_name#48, sales#57] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (138) + + +(138) ReusedExchange [Reuses operator id: 57] +Output [1]: [d_date_sk#43] + +Subquery:2 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (139) + + +(139) ReusedExchange [Reuses operator id: 13] +Output [2]: [d_date_sk#11, d_date#12] + +Subquery:3 Hosting operator id = 49 Hosting Expression = Subquery scalar-subquery#41, [id=#42] +* HashAggregate (163) ++- Exchange (162) + +- * HashAggregate (161) + +- * HashAggregate (160) + +- * HashAggregate (159) + +- * Project (158) + +- * SortMergeJoin Inner (157) + :- * Sort (151) + : +- Exchange (150) + : +- * Project (149) + : +- * BroadcastHashJoin Inner BuildRight (148) + : :- * Filter (142) + : : +- * ColumnarToRow (141) + : : +- Scan parquet default.store_sales (140) + : +- BroadcastExchange (147) + : +- * Project (146) + : +- * Filter (145) + : +- * ColumnarToRow (144) + : +- Scan parquet default.date_dim (143) + +- * Sort (156) + +- Exchange (155) + +- * Filter (154) + +- * ColumnarToRow (153) + +- Scan parquet default.customer (152) + + +(140) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#95, ss_quantity#96, ss_sales_price#97, ss_sold_date_sk#98] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#98), dynamicpruningexpression(ss_sold_date_sk#98 IN dynamicpruning#99)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(141) ColumnarToRow [codegen id : 2] +Input [4]: [ss_customer_sk#95, ss_quantity#96, ss_sales_price#97, ss_sold_date_sk#98] + +(142) Filter [codegen id : 2] +Input [4]: [ss_customer_sk#95, ss_quantity#96, ss_sales_price#97, ss_sold_date_sk#98] +Condition : isnotnull(ss_customer_sk#95) + +(143) Scan parquet default.date_dim +Output [2]: [d_date_sk#100, d_year#101] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(144) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#100, d_year#101] + +(145) Filter [codegen id : 1] +Input [2]: [d_date_sk#100, d_year#101] +Condition : (d_year#101 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#100)) + +(146) Project [codegen id : 1] +Output [1]: [d_date_sk#100] +Input [2]: [d_date_sk#100, d_year#101] + +(147) BroadcastExchange +Input [1]: [d_date_sk#100] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#102] + +(148) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#98] +Right keys [1]: [d_date_sk#100] +Join condition: None + +(149) Project [codegen id : 2] +Output [3]: [ss_customer_sk#95, ss_quantity#96, ss_sales_price#97] +Input [5]: [ss_customer_sk#95, ss_quantity#96, ss_sales_price#97, ss_sold_date_sk#98, d_date_sk#100] + +(150) Exchange +Input [3]: [ss_customer_sk#95, ss_quantity#96, ss_sales_price#97] +Arguments: hashpartitioning(ss_customer_sk#95, 5), ENSURE_REQUIREMENTS, [id=#103] + +(151) Sort [codegen id : 3] +Input [3]: [ss_customer_sk#95, ss_quantity#96, ss_sales_price#97] +Arguments: [ss_customer_sk#95 ASC NULLS FIRST], false, 0 + +(152) Scan parquet default.customer +Output [1]: [c_customer_sk#104] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(153) ColumnarToRow [codegen id : 4] +Input [1]: [c_customer_sk#104] + +(154) Filter [codegen id : 4] +Input [1]: [c_customer_sk#104] +Condition : isnotnull(c_customer_sk#104) + +(155) Exchange +Input [1]: [c_customer_sk#104] +Arguments: hashpartitioning(c_customer_sk#104, 5), ENSURE_REQUIREMENTS, [id=#105] + +(156) Sort [codegen id : 5] +Input [1]: [c_customer_sk#104] +Arguments: [c_customer_sk#104 ASC NULLS FIRST], false, 0 + +(157) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#95] +Right keys [1]: [c_customer_sk#104] +Join condition: None + +(158) Project [codegen id : 6] +Output [3]: [ss_quantity#96, ss_sales_price#97, c_customer_sk#104] +Input [4]: [ss_customer_sk#95, ss_quantity#96, ss_sales_price#97, c_customer_sk#104] + +(159) HashAggregate [codegen id : 6] +Input [3]: [ss_quantity#96, ss_sales_price#97, c_customer_sk#104] +Keys [1]: [c_customer_sk#104] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#96 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#97 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#106, isEmpty#107] +Results [3]: [c_customer_sk#104, sum#108, isEmpty#109] + +(160) HashAggregate [codegen id : 6] +Input [3]: [c_customer_sk#104, sum#108, isEmpty#109] +Keys [1]: [c_customer_sk#104] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#96 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#97 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#96 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#97 as decimal(12,2)))), DecimalType(18,2), true))#110] +Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#96 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#97 as decimal(12,2)))), DecimalType(18,2), true))#110 AS csales#111] + +(161) HashAggregate [codegen id : 6] +Input [1]: [csales#111] +Keys: [] +Functions [1]: [partial_max(csales#111)] +Aggregate Attributes [1]: [max#112] +Results [1]: [max#113] + +(162) Exchange +Input [1]: [max#113] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#114] + +(163) HashAggregate [codegen id : 7] +Input [1]: [max#113] +Keys: [] +Functions [1]: [max(csales#111)] +Aggregate Attributes [1]: [max(csales#111)#115] +Results [1]: [max(csales#111)#115 AS tpcds_cmax#116] + +Subquery:4 Hosting operator id = 140 Hosting Expression = ss_sold_date_sk#98 IN dynamicpruning#99 +ReusedExchange (164) + + +(164) ReusedExchange [Reuses operator id: 147] +Output [1]: [d_date_sk#100] + +Subquery:5 Hosting operator id = 73 Hosting Expression = ReusedSubquery Subquery scalar-subquery#41, [id=#42] + +Subquery:6 Hosting operator id = 82 Hosting Expression = ws_sold_date_sk#62 IN dynamicpruning#6 + +Subquery:7 Hosting operator id = 110 Hosting Expression = ReusedSubquery Subquery scalar-subquery#41, [id=#42] + +Subquery:8 Hosting operator id = 127 Hosting Expression = ReusedSubquery Subquery scalar-subquery#41, [id=#42] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/simplified.txt new file mode 100644 index 0000000000000..98848b4ed0676 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b.sf100/simplified.txt @@ -0,0 +1,291 @@ +TakeOrderedAndProject [c_last_name,c_first_name,sales] + Union + WholeStageCodegen (27) + HashAggregate [c_last_name,c_first_name,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sales,sum,isEmpty] + InputAdapter + Exchange [c_last_name,c_first_name] #1 + WholeStageCodegen (26) + HashAggregate [c_last_name,c_first_name,cs_quantity,cs_list_price] [sum,isEmpty,sum,isEmpty] + Project [cs_quantity,cs_list_price,c_first_name,c_last_name] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (17) + Project [cs_bill_customer_sk,cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (10) + Sort [cs_bill_customer_sk] + InputAdapter + Exchange [cs_bill_customer_sk] #2 + WholeStageCodegen (9) + Project [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sold_date_sk] + SortMergeJoin [cs_item_sk,item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #3 + WholeStageCodegen (1) + Filter [cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + WholeStageCodegen (8) + Sort [item_sk] + Project [item_sk] + Filter [count(1)] + HashAggregate [_groupingexpression,i_item_sk,d_date,count] [count(1),item_sk,count(1),count] + HashAggregate [_groupingexpression,i_item_sk,d_date] [count,count] + Project [d_date,i_item_sk,i_item_desc] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (5) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #5 + WholeStageCodegen (4) + Project [ss_item_sk,d_date] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_date] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [d_date_sk,d_date] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_year] + InputAdapter + WholeStageCodegen (7) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #7 + WholeStageCodegen (6) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_desc] + InputAdapter + WholeStageCodegen (15) + Sort [c_customer_sk] + Project [c_customer_sk] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] + Subquery #3 + WholeStageCodegen (7) + HashAggregate [max] [max(csales),tpcds_cmax,max] + InputAdapter + Exchange #10 + WholeStageCodegen (6) + HashAggregate [csales] [max,max] + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),csales,sum,isEmpty] + HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,c_customer_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #11 + WholeStageCodegen (2) + Project [ss_customer_sk,ss_quantity,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #4 + ReusedExchange [d_date_sk] #12 + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #13 + WholeStageCodegen (4) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk] + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty] + HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,c_customer_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (12) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #8 + WholeStageCodegen (11) + Project [ss_customer_sk,ss_quantity,ss_sales_price] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk] + InputAdapter + WholeStageCodegen (14) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #9 + WholeStageCodegen (13) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (16) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + WholeStageCodegen (25) + SortMergeJoin [c_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (19) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #14 + WholeStageCodegen (18) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name] + InputAdapter + WholeStageCodegen (24) + Sort [c_customer_sk] + Project [c_customer_sk] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [tpcds_cmax] #3 + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty] + HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,c_customer_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (21) + Sort [ss_customer_sk] + InputAdapter + ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #8 + InputAdapter + WholeStageCodegen (23) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk] #9 + WholeStageCodegen (54) + HashAggregate [c_last_name,c_first_name,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sales,sum,isEmpty] + InputAdapter + Exchange [c_last_name,c_first_name] #15 + WholeStageCodegen (53) + HashAggregate [c_last_name,c_first_name,ws_quantity,ws_list_price] [sum,isEmpty,sum,isEmpty] + Project [ws_quantity,ws_list_price,c_first_name,c_last_name] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (44) + Project [ws_bill_customer_sk,ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (37) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #16 + WholeStageCodegen (36) + Project [ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk] + SortMergeJoin [ws_item_sk,item_sk] + InputAdapter + WholeStageCodegen (29) + Sort [ws_item_sk] + InputAdapter + Exchange [ws_item_sk] #17 + WholeStageCodegen (28) + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (35) + Sort [item_sk] + Project [item_sk] + Filter [count(1)] + HashAggregate [_groupingexpression,i_item_sk,d_date,count] [count(1),item_sk,count(1),count] + HashAggregate [_groupingexpression,i_item_sk,d_date] [count,count] + Project [d_date,i_item_sk,i_item_desc] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (32) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk,d_date] #18 + InputAdapter + WholeStageCodegen (34) + Sort [i_item_sk] + InputAdapter + ReusedExchange [i_item_sk,i_item_desc] #7 + InputAdapter + WholeStageCodegen (42) + Sort [c_customer_sk] + Project [c_customer_sk] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [tpcds_cmax] #3 + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty] + HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,c_customer_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (39) + Sort [ss_customer_sk] + InputAdapter + ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #8 + InputAdapter + WholeStageCodegen (41) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk] #9 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + WholeStageCodegen (52) + SortMergeJoin [c_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (46) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_first_name,c_last_name] #14 + InputAdapter + WholeStageCodegen (51) + Sort [c_customer_sk] + Project [c_customer_sk] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [tpcds_cmax] #3 + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty] + HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,c_customer_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (48) + Sort [ss_customer_sk] + InputAdapter + ReusedExchange [ss_customer_sk,ss_quantity,ss_sales_price] #8 + InputAdapter + WholeStageCodegen (50) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk] #9 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt new file mode 100644 index 0000000000000..a7d797dbb545e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/explain.txt @@ -0,0 +1,743 @@ +== Physical Plan == +TakeOrderedAndProject (103) ++- Union (102) + :- * HashAggregate (70) + : +- Exchange (69) + : +- * HashAggregate (68) + : +- * Project (67) + : +- * BroadcastHashJoin Inner BuildRight (66) + : :- * Project (60) + : : +- * BroadcastHashJoin Inner BuildRight (59) + : : :- * SortMergeJoin LeftSemi (46) + : : : :- * Sort (29) + : : : : +- Exchange (28) + : : : : +- * Project (27) + : : : : +- * BroadcastHashJoin LeftSemi BuildRight (26) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- BroadcastExchange (25) + : : : : +- * Project (24) + : : : : +- * Filter (23) + : : : : +- * HashAggregate (22) + : : : : +- Exchange (21) + : : : : +- * HashAggregate (20) + : : : : +- * Project (19) + : : : : +- * BroadcastHashJoin Inner BuildRight (18) + : : : : :- * Project (13) + : : : : : +- * BroadcastHashJoin Inner BuildRight (12) + : : : : : :- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.store_sales (4) + : : : : : +- BroadcastExchange (11) + : : : : : +- * Project (10) + : : : : : +- * Filter (9) + : : : : : +- * ColumnarToRow (8) + : : : : : +- Scan parquet default.date_dim (7) + : : : : +- BroadcastExchange (17) + : : : : +- * Filter (16) + : : : : +- * ColumnarToRow (15) + : : : : +- Scan parquet default.item (14) + : : : +- * Sort (45) + : : : +- * Project (44) + : : : +- * Filter (43) + : : : +- * HashAggregate (42) + : : : +- Exchange (41) + : : : +- * HashAggregate (40) + : : : +- * Project (39) + : : : +- * BroadcastHashJoin Inner BuildRight (38) + : : : :- * Project (33) + : : : : +- * Filter (32) + : : : : +- * ColumnarToRow (31) + : : : : +- Scan parquet default.store_sales (30) + : : : +- BroadcastExchange (37) + : : : +- * Filter (36) + : : : +- * ColumnarToRow (35) + : : : +- Scan parquet default.customer (34) + : : +- BroadcastExchange (58) + : : +- * SortMergeJoin LeftSemi (57) + : : :- * Sort (51) + : : : +- Exchange (50) + : : : +- * Filter (49) + : : : +- * ColumnarToRow (48) + : : : +- Scan parquet default.customer (47) + : : +- * Sort (56) + : : +- * Project (55) + : : +- * Filter (54) + : : +- * HashAggregate (53) + : : +- ReusedExchange (52) + : +- BroadcastExchange (65) + : +- * Project (64) + : +- * Filter (63) + : +- * ColumnarToRow (62) + : +- Scan parquet default.date_dim (61) + +- * HashAggregate (101) + +- Exchange (100) + +- * HashAggregate (99) + +- * Project (98) + +- * BroadcastHashJoin Inner BuildRight (97) + :- * Project (95) + : +- * BroadcastHashJoin Inner BuildRight (94) + : :- * SortMergeJoin LeftSemi (84) + : : :- * Sort (78) + : : : +- Exchange (77) + : : : +- * Project (76) + : : : +- * BroadcastHashJoin LeftSemi BuildRight (75) + : : : :- * Filter (73) + : : : : +- * ColumnarToRow (72) + : : : : +- Scan parquet default.web_sales (71) + : : : +- ReusedExchange (74) + : : +- * Sort (83) + : : +- * Project (82) + : : +- * Filter (81) + : : +- * HashAggregate (80) + : : +- ReusedExchange (79) + : +- BroadcastExchange (93) + : +- * SortMergeJoin LeftSemi (92) + : :- * Sort (86) + : : +- ReusedExchange (85) + : +- * Sort (91) + : +- * Project (90) + : +- * Filter (89) + : +- * HashAggregate (88) + : +- ReusedExchange (87) + +- ReusedExchange (96) + + +(1) Scan parquet default.catalog_sales +Output [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] + +(3) Filter [codegen id : 5] +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Condition : isnotnull(cs_bill_customer_sk#1) + +(4) Scan parquet default.store_sales +Output [2]: [ss_item_sk#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 3] +Input [2]: [ss_item_sk#7, ss_sold_date_sk#8] + +(6) Filter [codegen id : 3] +Input [2]: [ss_item_sk#7, ss_sold_date_sk#8] +Condition : isnotnull(ss_item_sk#7) + +(7) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_date#11, d_year#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#10, d_date#11, d_year#12] + +(9) Filter [codegen id : 1] +Input [3]: [d_date_sk#10, d_date#11, d_year#12] +Condition : (d_year#12 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#10)) + +(10) Project [codegen id : 1] +Output [2]: [d_date_sk#10, d_date#11] +Input [3]: [d_date_sk#10, d_date#11, d_year#12] + +(11) BroadcastExchange +Input [2]: [d_date_sk#10, d_date#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(12) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(13) Project [codegen id : 3] +Output [2]: [ss_item_sk#7, d_date#11] +Input [4]: [ss_item_sk#7, ss_sold_date_sk#8, d_date_sk#10, d_date#11] + +(14) Scan parquet default.item +Output [2]: [i_item_sk#14, i_item_desc#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 2] +Input [2]: [i_item_sk#14, i_item_desc#15] + +(16) Filter [codegen id : 2] +Input [2]: [i_item_sk#14, i_item_desc#15] +Condition : isnotnull(i_item_sk#14) + +(17) BroadcastExchange +Input [2]: [i_item_sk#14, i_item_desc#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(18) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#7] +Right keys [1]: [i_item_sk#14] +Join condition: None + +(19) Project [codegen id : 3] +Output [3]: [d_date#11, i_item_sk#14, substr(i_item_desc#15, 1, 30) AS _groupingexpression#17] +Input [4]: [ss_item_sk#7, d_date#11, i_item_sk#14, i_item_desc#15] + +(20) HashAggregate [codegen id : 3] +Input [3]: [d_date#11, i_item_sk#14, _groupingexpression#17] +Keys [3]: [_groupingexpression#17, i_item_sk#14, d_date#11] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#18] +Results [4]: [_groupingexpression#17, i_item_sk#14, d_date#11, count#19] + +(21) Exchange +Input [4]: [_groupingexpression#17, i_item_sk#14, d_date#11, count#19] +Arguments: hashpartitioning(_groupingexpression#17, i_item_sk#14, d_date#11, 5), ENSURE_REQUIREMENTS, [id=#20] + +(22) HashAggregate [codegen id : 4] +Input [4]: [_groupingexpression#17, i_item_sk#14, d_date#11, count#19] +Keys [3]: [_groupingexpression#17, i_item_sk#14, d_date#11] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#21] +Results [2]: [i_item_sk#14 AS item_sk#22, count(1)#21 AS count(1)#23] + +(23) Filter [codegen id : 4] +Input [2]: [item_sk#22, count(1)#23] +Condition : (count(1)#23 > 4) + +(24) Project [codegen id : 4] +Output [1]: [item_sk#22] +Input [2]: [item_sk#22, count(1)#23] + +(25) BroadcastExchange +Input [1]: [item_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(26) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [item_sk#22] +Join condition: None + +(27) Project [codegen id : 5] +Output [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Input [5]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] + +(28) Exchange +Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Arguments: hashpartitioning(cs_bill_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#25] + +(29) Sort [codegen id : 6] +Input [4]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5] +Arguments: [cs_bill_customer_sk#1 ASC NULLS FIRST], false, 0 + +(30) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 8] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] + +(32) Filter [codegen id : 8] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] +Condition : isnotnull(ss_customer_sk#26) + +(33) Project [codegen id : 8] +Output [3]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, ss_sold_date_sk#29] + +(34) Scan parquet default.customer +Output [1]: [c_customer_sk#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 7] +Input [1]: [c_customer_sk#30] + +(36) Filter [codegen id : 7] +Input [1]: [c_customer_sk#30] +Condition : isnotnull(c_customer_sk#30) + +(37) BroadcastExchange +Input [1]: [c_customer_sk#30] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] + +(38) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_customer_sk#26] +Right keys [1]: [c_customer_sk#30] +Join condition: None + +(39) Project [codegen id : 8] +Output [3]: [ss_quantity#27, ss_sales_price#28, c_customer_sk#30] +Input [4]: [ss_customer_sk#26, ss_quantity#27, ss_sales_price#28, c_customer_sk#30] + +(40) HashAggregate [codegen id : 8] +Input [3]: [ss_quantity#27, ss_sales_price#28, c_customer_sk#30] +Keys [1]: [c_customer_sk#30] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#32, isEmpty#33] +Results [3]: [c_customer_sk#30, sum#34, isEmpty#35] + +(41) Exchange +Input [3]: [c_customer_sk#30, sum#34, isEmpty#35] +Arguments: hashpartitioning(c_customer_sk#30, 5), ENSURE_REQUIREMENTS, [id=#36] + +(42) HashAggregate [codegen id : 9] +Input [3]: [c_customer_sk#30, sum#34, isEmpty#35] +Keys [1]: [c_customer_sk#30] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))#37] +Results [2]: [c_customer_sk#30, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))#37 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] + +(43) Filter [codegen id : 9] +Input [2]: [c_customer_sk#30, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(Subquery scalar-subquery#41, [id=#42] as decimal(32,6)))), DecimalType(38,8), true))) + +(44) Project [codegen id : 9] +Output [1]: [c_customer_sk#30] +Input [2]: [c_customer_sk#30, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] + +(45) Sort [codegen id : 9] +Input [1]: [c_customer_sk#30] +Arguments: [c_customer_sk#30 ASC NULLS FIRST], false, 0 + +(46) SortMergeJoin [codegen id : 17] +Left keys [1]: [cs_bill_customer_sk#1] +Right keys [1]: [c_customer_sk#30] +Join condition: None + +(47) Scan parquet default.customer +Output [3]: [c_customer_sk#43, c_first_name#44, c_last_name#45] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 10] +Input [3]: [c_customer_sk#43, c_first_name#44, c_last_name#45] + +(49) Filter [codegen id : 10] +Input [3]: [c_customer_sk#43, c_first_name#44, c_last_name#45] +Condition : isnotnull(c_customer_sk#43) + +(50) Exchange +Input [3]: [c_customer_sk#43, c_first_name#44, c_last_name#45] +Arguments: hashpartitioning(c_customer_sk#43, 5), ENSURE_REQUIREMENTS, [id=#46] + +(51) Sort [codegen id : 11] +Input [3]: [c_customer_sk#43, c_first_name#44, c_last_name#45] +Arguments: [c_customer_sk#43 ASC NULLS FIRST], false, 0 + +(52) ReusedExchange [Reuses operator id: 41] +Output [3]: [c_customer_sk#30, sum#34, isEmpty#35] + +(53) HashAggregate [codegen id : 14] +Input [3]: [c_customer_sk#30, sum#34, isEmpty#35] +Keys [1]: [c_customer_sk#30] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))#37] +Results [2]: [c_customer_sk#30, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#27 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#28 as decimal(12,2)))), DecimalType(18,2), true))#37 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] + +(54) Filter [codegen id : 14] +Input [2]: [c_customer_sk#30, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#41, [id=#42] as decimal(32,6)))), DecimalType(38,8), true))) + +(55) Project [codegen id : 14] +Output [1]: [c_customer_sk#30] +Input [2]: [c_customer_sk#30, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#40] + +(56) Sort [codegen id : 14] +Input [1]: [c_customer_sk#30] +Arguments: [c_customer_sk#30 ASC NULLS FIRST], false, 0 + +(57) SortMergeJoin [codegen id : 15] +Left keys [1]: [c_customer_sk#43] +Right keys [1]: [c_customer_sk#30] +Join condition: None + +(58) BroadcastExchange +Input [3]: [c_customer_sk#43, c_first_name#44, c_last_name#45] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#47] + +(59) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [cs_bill_customer_sk#1] +Right keys [1]: [c_customer_sk#43] +Join condition: None + +(60) Project [codegen id : 17] +Output [5]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, c_first_name#44, c_last_name#45] +Input [7]: [cs_bill_customer_sk#1, cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, c_customer_sk#43, c_first_name#44, c_last_name#45] + +(61) Scan parquet default.date_dim +Output [3]: [d_date_sk#48, d_year#49, d_moy#50] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,2), IsNotNull(d_date_sk)] +ReadSchema: struct + +(62) ColumnarToRow [codegen id : 16] +Input [3]: [d_date_sk#48, d_year#49, d_moy#50] + +(63) Filter [codegen id : 16] +Input [3]: [d_date_sk#48, d_year#49, d_moy#50] +Condition : ((((isnotnull(d_year#49) AND isnotnull(d_moy#50)) AND (d_year#49 = 2000)) AND (d_moy#50 = 2)) AND isnotnull(d_date_sk#48)) + +(64) Project [codegen id : 16] +Output [1]: [d_date_sk#48] +Input [3]: [d_date_sk#48, d_year#49, d_moy#50] + +(65) BroadcastExchange +Input [1]: [d_date_sk#48] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#51] + +(66) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [cs_sold_date_sk#5] +Right keys [1]: [d_date_sk#48] +Join condition: None + +(67) Project [codegen id : 17] +Output [4]: [cs_quantity#3, cs_list_price#4, c_first_name#44, c_last_name#45] +Input [6]: [cs_quantity#3, cs_list_price#4, cs_sold_date_sk#5, c_first_name#44, c_last_name#45, d_date_sk#48] + +(68) HashAggregate [codegen id : 17] +Input [4]: [cs_quantity#3, cs_list_price#4, c_first_name#44, c_last_name#45] +Keys [2]: [c_last_name#45, c_first_name#44] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#52, isEmpty#53] +Results [4]: [c_last_name#45, c_first_name#44, sum#54, isEmpty#55] + +(69) Exchange +Input [4]: [c_last_name#45, c_first_name#44, sum#54, isEmpty#55] +Arguments: hashpartitioning(c_last_name#45, c_first_name#44, 5), ENSURE_REQUIREMENTS, [id=#56] + +(70) HashAggregate [codegen id : 18] +Input [4]: [c_last_name#45, c_first_name#44, sum#54, isEmpty#55] +Keys [2]: [c_last_name#45, c_first_name#44] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#57] +Results [3]: [c_last_name#45, c_first_name#44, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#3 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#4 as decimal(12,2)))), DecimalType(18,2), true))#57 AS sales#58] + +(71) Scan parquet default.web_sales +Output [5]: [ws_item_sk#59, ws_bill_customer_sk#60, ws_quantity#61, ws_list_price#62, ws_sold_date_sk#63] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#63), dynamicpruningexpression(ws_sold_date_sk#63 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(72) ColumnarToRow [codegen id : 23] +Input [5]: [ws_item_sk#59, ws_bill_customer_sk#60, ws_quantity#61, ws_list_price#62, ws_sold_date_sk#63] + +(73) Filter [codegen id : 23] +Input [5]: [ws_item_sk#59, ws_bill_customer_sk#60, ws_quantity#61, ws_list_price#62, ws_sold_date_sk#63] +Condition : isnotnull(ws_bill_customer_sk#60) + +(74) ReusedExchange [Reuses operator id: unknown] +Output [1]: [item_sk#22] + +(75) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [ws_item_sk#59] +Right keys [1]: [item_sk#22] +Join condition: None + +(76) Project [codegen id : 23] +Output [4]: [ws_bill_customer_sk#60, ws_quantity#61, ws_list_price#62, ws_sold_date_sk#63] +Input [5]: [ws_item_sk#59, ws_bill_customer_sk#60, ws_quantity#61, ws_list_price#62, ws_sold_date_sk#63] + +(77) Exchange +Input [4]: [ws_bill_customer_sk#60, ws_quantity#61, ws_list_price#62, ws_sold_date_sk#63] +Arguments: hashpartitioning(ws_bill_customer_sk#60, 5), ENSURE_REQUIREMENTS, [id=#64] + +(78) Sort [codegen id : 24] +Input [4]: [ws_bill_customer_sk#60, ws_quantity#61, ws_list_price#62, ws_sold_date_sk#63] +Arguments: [ws_bill_customer_sk#60 ASC NULLS FIRST], false, 0 + +(79) ReusedExchange [Reuses operator id: 41] +Output [3]: [c_customer_sk#65, sum#66, isEmpty#67] + +(80) HashAggregate [codegen id : 27] +Input [3]: [c_customer_sk#65, sum#66, isEmpty#67] +Keys [1]: [c_customer_sk#65] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#68 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#69 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#68 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#69 as decimal(12,2)))), DecimalType(18,2), true))#70] +Results [2]: [c_customer_sk#65, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#68 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#69 as decimal(12,2)))), DecimalType(18,2), true))#70 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#71] + +(81) Filter [codegen id : 27] +Input [2]: [c_customer_sk#65, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#71] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#71) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#71 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#41, [id=#42] as decimal(32,6)))), DecimalType(38,8), true))) + +(82) Project [codegen id : 27] +Output [1]: [c_customer_sk#65] +Input [2]: [c_customer_sk#65, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#71] + +(83) Sort [codegen id : 27] +Input [1]: [c_customer_sk#65] +Arguments: [c_customer_sk#65 ASC NULLS FIRST], false, 0 + +(84) SortMergeJoin [codegen id : 35] +Left keys [1]: [ws_bill_customer_sk#60] +Right keys [1]: [c_customer_sk#65] +Join condition: None + +(85) ReusedExchange [Reuses operator id: 50] +Output [3]: [c_customer_sk#72, c_first_name#73, c_last_name#74] + +(86) Sort [codegen id : 29] +Input [3]: [c_customer_sk#72, c_first_name#73, c_last_name#74] +Arguments: [c_customer_sk#72 ASC NULLS FIRST], false, 0 + +(87) ReusedExchange [Reuses operator id: 41] +Output [3]: [c_customer_sk#65, sum#66, isEmpty#67] + +(88) HashAggregate [codegen id : 32] +Input [3]: [c_customer_sk#65, sum#66, isEmpty#67] +Keys [1]: [c_customer_sk#65] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#68 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#69 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#68 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#69 as decimal(12,2)))), DecimalType(18,2), true))#70] +Results [2]: [c_customer_sk#65, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#68 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#69 as decimal(12,2)))), DecimalType(18,2), true))#70 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#71] + +(89) Filter [codegen id : 32] +Input [2]: [c_customer_sk#65, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#71] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#71) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#71 as decimal(38,8)) > CheckOverflow((0.500000 * promote_precision(cast(ReusedSubquery Subquery scalar-subquery#41, [id=#42] as decimal(32,6)))), DecimalType(38,8), true))) + +(90) Project [codegen id : 32] +Output [1]: [c_customer_sk#65] +Input [2]: [c_customer_sk#65, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#38 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#39 as decimal(12,2)))), DecimalType(18,2), true))#71] + +(91) Sort [codegen id : 32] +Input [1]: [c_customer_sk#65] +Arguments: [c_customer_sk#65 ASC NULLS FIRST], false, 0 + +(92) SortMergeJoin [codegen id : 33] +Left keys [1]: [c_customer_sk#72] +Right keys [1]: [c_customer_sk#65] +Join condition: None + +(93) BroadcastExchange +Input [3]: [c_customer_sk#72, c_first_name#73, c_last_name#74] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#75] + +(94) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [ws_bill_customer_sk#60] +Right keys [1]: [c_customer_sk#72] +Join condition: None + +(95) Project [codegen id : 35] +Output [5]: [ws_quantity#61, ws_list_price#62, ws_sold_date_sk#63, c_first_name#73, c_last_name#74] +Input [7]: [ws_bill_customer_sk#60, ws_quantity#61, ws_list_price#62, ws_sold_date_sk#63, c_customer_sk#72, c_first_name#73, c_last_name#74] + +(96) ReusedExchange [Reuses operator id: 65] +Output [1]: [d_date_sk#76] + +(97) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [ws_sold_date_sk#63] +Right keys [1]: [d_date_sk#76] +Join condition: None + +(98) Project [codegen id : 35] +Output [4]: [ws_quantity#61, ws_list_price#62, c_first_name#73, c_last_name#74] +Input [6]: [ws_quantity#61, ws_list_price#62, ws_sold_date_sk#63, c_first_name#73, c_last_name#74, d_date_sk#76] + +(99) HashAggregate [codegen id : 35] +Input [4]: [ws_quantity#61, ws_list_price#62, c_first_name#73, c_last_name#74] +Keys [2]: [c_last_name#74, c_first_name#73] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#61 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#62 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#77, isEmpty#78] +Results [4]: [c_last_name#74, c_first_name#73, sum#79, isEmpty#80] + +(100) Exchange +Input [4]: [c_last_name#74, c_first_name#73, sum#79, isEmpty#80] +Arguments: hashpartitioning(c_last_name#74, c_first_name#73, 5), ENSURE_REQUIREMENTS, [id=#81] + +(101) HashAggregate [codegen id : 36] +Input [4]: [c_last_name#74, c_first_name#73, sum#79, isEmpty#80] +Keys [2]: [c_last_name#74, c_first_name#73] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#61 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#62 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#61 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#62 as decimal(12,2)))), DecimalType(18,2), true))#82] +Results [3]: [c_last_name#74, c_first_name#73, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#61 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#62 as decimal(12,2)))), DecimalType(18,2), true))#82 AS sales#83] + +(102) Union + +(103) TakeOrderedAndProject +Input [3]: [c_last_name#45, c_first_name#44, sales#58] +Arguments: 100, [c_last_name#45 ASC NULLS FIRST, c_first_name#44 ASC NULLS FIRST, sales#58 ASC NULLS FIRST], [c_last_name#45, c_first_name#44, sales#58] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (104) + + +(104) ReusedExchange [Reuses operator id: 65] +Output [1]: [d_date_sk#48] + +Subquery:2 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (105) + + +(105) ReusedExchange [Reuses operator id: 11] +Output [2]: [d_date_sk#10, d_date#11] + +Subquery:3 Hosting operator id = 43 Hosting Expression = Subquery scalar-subquery#41, [id=#42] +* HashAggregate (127) ++- Exchange (126) + +- * HashAggregate (125) + +- * HashAggregate (124) + +- Exchange (123) + +- * HashAggregate (122) + +- * Project (121) + +- * BroadcastHashJoin Inner BuildRight (120) + :- * Project (114) + : +- * BroadcastHashJoin Inner BuildRight (113) + : :- * Filter (108) + : : +- * ColumnarToRow (107) + : : +- Scan parquet default.store_sales (106) + : +- BroadcastExchange (112) + : +- * Filter (111) + : +- * ColumnarToRow (110) + : +- Scan parquet default.customer (109) + +- BroadcastExchange (119) + +- * Project (118) + +- * Filter (117) + +- * ColumnarToRow (116) + +- Scan parquet default.date_dim (115) + + +(106) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#84, ss_quantity#85, ss_sales_price#86, ss_sold_date_sk#87] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#87), dynamicpruningexpression(ss_sold_date_sk#87 IN dynamicpruning#88)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(107) ColumnarToRow [codegen id : 3] +Input [4]: [ss_customer_sk#84, ss_quantity#85, ss_sales_price#86, ss_sold_date_sk#87] + +(108) Filter [codegen id : 3] +Input [4]: [ss_customer_sk#84, ss_quantity#85, ss_sales_price#86, ss_sold_date_sk#87] +Condition : isnotnull(ss_customer_sk#84) + +(109) Scan parquet default.customer +Output [1]: [c_customer_sk#89] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(110) ColumnarToRow [codegen id : 1] +Input [1]: [c_customer_sk#89] + +(111) Filter [codegen id : 1] +Input [1]: [c_customer_sk#89] +Condition : isnotnull(c_customer_sk#89) + +(112) BroadcastExchange +Input [1]: [c_customer_sk#89] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#90] + +(113) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_customer_sk#84] +Right keys [1]: [c_customer_sk#89] +Join condition: None + +(114) Project [codegen id : 3] +Output [4]: [ss_quantity#85, ss_sales_price#86, ss_sold_date_sk#87, c_customer_sk#89] +Input [5]: [ss_customer_sk#84, ss_quantity#85, ss_sales_price#86, ss_sold_date_sk#87, c_customer_sk#89] + +(115) Scan parquet default.date_dim +Output [2]: [d_date_sk#91, d_year#92] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_year, [2000,2001,2002,2003]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(116) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#91, d_year#92] + +(117) Filter [codegen id : 2] +Input [2]: [d_date_sk#91, d_year#92] +Condition : (d_year#92 IN (2000,2001,2002,2003) AND isnotnull(d_date_sk#91)) + +(118) Project [codegen id : 2] +Output [1]: [d_date_sk#91] +Input [2]: [d_date_sk#91, d_year#92] + +(119) BroadcastExchange +Input [1]: [d_date_sk#91] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#93] + +(120) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#87] +Right keys [1]: [d_date_sk#91] +Join condition: None + +(121) Project [codegen id : 3] +Output [3]: [ss_quantity#85, ss_sales_price#86, c_customer_sk#89] +Input [5]: [ss_quantity#85, ss_sales_price#86, ss_sold_date_sk#87, c_customer_sk#89, d_date_sk#91] + +(122) HashAggregate [codegen id : 3] +Input [3]: [ss_quantity#85, ss_sales_price#86, c_customer_sk#89] +Keys [1]: [c_customer_sk#89] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#85 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#86 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#94, isEmpty#95] +Results [3]: [c_customer_sk#89, sum#96, isEmpty#97] + +(123) Exchange +Input [3]: [c_customer_sk#89, sum#96, isEmpty#97] +Arguments: hashpartitioning(c_customer_sk#89, 5), ENSURE_REQUIREMENTS, [id=#98] + +(124) HashAggregate [codegen id : 4] +Input [3]: [c_customer_sk#89, sum#96, isEmpty#97] +Keys [1]: [c_customer_sk#89] +Functions [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#85 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#86 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#85 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#86 as decimal(12,2)))), DecimalType(18,2), true))#99] +Results [1]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#85 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#86 as decimal(12,2)))), DecimalType(18,2), true))#99 AS csales#100] + +(125) HashAggregate [codegen id : 4] +Input [1]: [csales#100] +Keys: [] +Functions [1]: [partial_max(csales#100)] +Aggregate Attributes [1]: [max#101] +Results [1]: [max#102] + +(126) Exchange +Input [1]: [max#102] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#103] + +(127) HashAggregate [codegen id : 5] +Input [1]: [max#102] +Keys: [] +Functions [1]: [max(csales#100)] +Aggregate Attributes [1]: [max(csales#100)#104] +Results [1]: [max(csales#100)#104 AS tpcds_cmax#105] + +Subquery:4 Hosting operator id = 106 Hosting Expression = ss_sold_date_sk#87 IN dynamicpruning#88 +ReusedExchange (128) + + +(128) ReusedExchange [Reuses operator id: 119] +Output [1]: [d_date_sk#91] + +Subquery:5 Hosting operator id = 54 Hosting Expression = ReusedSubquery Subquery scalar-subquery#41, [id=#42] + +Subquery:6 Hosting operator id = 71 Hosting Expression = ws_sold_date_sk#63 IN dynamicpruning#6 + +Subquery:7 Hosting operator id = 81 Hosting Expression = ReusedSubquery Subquery scalar-subquery#41, [id=#42] + +Subquery:8 Hosting operator id = 89 Hosting Expression = ReusedSubquery Subquery scalar-subquery#41, [id=#42] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt new file mode 100644 index 0000000000000..8ef321be35bf0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q23b/simplified.txt @@ -0,0 +1,209 @@ +TakeOrderedAndProject [c_last_name,c_first_name,sales] + Union + WholeStageCodegen (18) + HashAggregate [c_last_name,c_first_name,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sales,sum,isEmpty] + InputAdapter + Exchange [c_last_name,c_first_name] #1 + WholeStageCodegen (17) + HashAggregate [c_last_name,c_first_name,cs_quantity,cs_list_price] [sum,isEmpty,sum,isEmpty] + Project [cs_quantity,cs_list_price,c_first_name,c_last_name] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_quantity,cs_list_price,cs_sold_date_sk,c_first_name,c_last_name] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (6) + Sort [cs_bill_customer_sk] + InputAdapter + Exchange [cs_bill_customer_sk] #2 + WholeStageCodegen (5) + Project [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sold_date_sk] + BroadcastHashJoin [cs_item_sk,item_sk] + Filter [cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [item_sk] + Filter [count(1)] + HashAggregate [_groupingexpression,i_item_sk,d_date,count] [count(1),item_sk,count(1),count] + InputAdapter + Exchange [_groupingexpression,i_item_sk,d_date] #5 + WholeStageCodegen (3) + HashAggregate [_groupingexpression,i_item_sk,d_date] [count,count] + Project [d_date,i_item_sk,i_item_desc] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,d_date] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_date] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Project [d_date_sk,d_date] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_year] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_desc] + InputAdapter + WholeStageCodegen (9) + Sort [c_customer_sk] + Project [c_customer_sk] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] + Subquery #3 + WholeStageCodegen (5) + HashAggregate [max] [max(csales),tpcds_cmax,max] + InputAdapter + Exchange #10 + WholeStageCodegen (4) + HashAggregate [csales] [max,max] + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),csales,sum,isEmpty] + InputAdapter + Exchange [c_customer_sk] #11 + WholeStageCodegen (3) + HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,c_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_quantity,ss_sales_price,ss_sold_date_sk,c_customer_sk] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #4 + ReusedExchange [d_date_sk] #12 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (1) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty] + InputAdapter + Exchange [c_customer_sk] #8 + WholeStageCodegen (8) + HashAggregate [c_customer_sk,ss_quantity,ss_sales_price] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,c_customer_sk] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,ss_quantity,ss_sales_price] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_quantity,ss_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (7) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk] + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (15) + SortMergeJoin [c_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (11) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #15 + WholeStageCodegen (10) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name] + InputAdapter + WholeStageCodegen (14) + Sort [c_customer_sk] + Project [c_customer_sk] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [tpcds_cmax] #3 + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty] + InputAdapter + ReusedExchange [c_customer_sk,sum,isEmpty] #8 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (16) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (36) + HashAggregate [c_last_name,c_first_name,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sales,sum,isEmpty] + InputAdapter + Exchange [c_last_name,c_first_name] #16 + WholeStageCodegen (35) + HashAggregate [c_last_name,c_first_name,ws_quantity,ws_list_price] [sum,isEmpty,sum,isEmpty] + Project [ws_quantity,ws_list_price,c_first_name,c_last_name] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_quantity,ws_list_price,ws_sold_date_sk,c_first_name,c_last_name] + BroadcastHashJoin [ws_bill_customer_sk,c_customer_sk] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (24) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #17 + WholeStageCodegen (23) + Project [ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk] + BroadcastHashJoin [ws_item_sk,item_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [item_sk] #18 + InputAdapter + WholeStageCodegen (27) + Sort [c_customer_sk] + Project [c_customer_sk] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [tpcds_cmax] #3 + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty] + InputAdapter + ReusedExchange [c_customer_sk,sum,isEmpty] #8 + InputAdapter + BroadcastExchange #19 + WholeStageCodegen (33) + SortMergeJoin [c_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (29) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_first_name,c_last_name] #15 + InputAdapter + WholeStageCodegen (32) + Sort [c_customer_sk] + Project [c_customer_sk] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [tpcds_cmax] #3 + HashAggregate [c_customer_sk,sum,isEmpty] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty] + InputAdapter + ReusedExchange [c_customer_sk,sum,isEmpty] #8 + InputAdapter + ReusedExchange [d_date_sk] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt new file mode 100644 index 0000000000000..23bfec44556cc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/explain.txt @@ -0,0 +1,587 @@ +== Physical Plan == +* Project (50) ++- * Filter (49) + +- * HashAggregate (48) + +- Exchange (47) + +- * HashAggregate (46) + +- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * Project (42) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (29) + : +- * SortMergeJoin Inner (28) + : :- * Sort (21) + : : +- Exchange (20) + : : +- * Project (19) + : : +- * SortMergeJoin Inner (18) + : : :- * Sort (12) + : : : +- Exchange (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Filter (7) + : : : +- * ColumnarToRow (6) + : : : +- Scan parquet default.item (5) + : : +- * Sort (17) + : : +- Exchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.customer (13) + : +- * Sort (27) + : +- Exchange (26) + : +- * Project (25) + : +- * Filter (24) + : +- * ColumnarToRow (23) + : +- Scan parquet default.store_returns (22) + +- BroadcastExchange (40) + +- * Project (39) + +- * BroadcastHashJoin Inner BuildLeft (38) + :- BroadcastExchange (34) + : +- * Project (33) + : +- * Filter (32) + : +- * ColumnarToRow (31) + : +- Scan parquet default.store (30) + +- * Filter (37) + +- * ColumnarToRow (36) + +- Scan parquet default.customer_address (35) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 2] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) + +(4) Project [codegen id : 2] +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] + +(5) Scan parquet default.item +Output [6]: [i_item_sk#7, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_color), EqualTo(i_color,pale ), IsNotNull(i_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#7, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] + +(7) Filter [codegen id : 1] +Input [6]: [i_item_sk#7, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] +Condition : ((isnotnull(i_color#10) AND (i_color#10 = pale )) AND isnotnull(i_item_sk#7)) + +(8) BroadcastExchange +Input [6]: [i_item_sk#7, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#7] +Join condition: None + +(10) Project [codegen id : 2] +Output [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_item_sk#7, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] + +(11) Exchange +Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] +Arguments: hashpartitioning(ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#14] + +(12) Sort [codegen id : 3] +Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.customer +Output [4]: [c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_birth_country)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 4] +Input [4]: [c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] + +(15) Filter [codegen id : 4] +Input [4]: [c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] +Condition : (isnotnull(c_customer_sk#15) AND isnotnull(c_birth_country#18)) + +(16) Exchange +Input [4]: [c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] +Arguments: hashpartitioning(c_customer_sk#15, 5), ENSURE_REQUIREMENTS, [id=#19] + +(17) Sort [codegen id : 5] +Input [4]: [c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] +Arguments: [c_customer_sk#15 ASC NULLS FIRST], false, 0 + +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#15] +Join condition: None + +(19) Project [codegen id : 6] +Output [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] + +(20) Exchange +Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#20] + +(21) Sort [codegen id : 7] +Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Arguments: [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(22) Scan parquet default.store_returns +Output [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 8] +Input [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] + +(24) Filter [codegen id : 8] +Input [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] +Condition : (isnotnull(sr_ticket_number#22) AND isnotnull(sr_item_sk#21)) + +(25) Project [codegen id : 8] +Output [2]: [sr_item_sk#21, sr_ticket_number#22] +Input [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] + +(26) Exchange +Input [2]: [sr_item_sk#21, sr_ticket_number#22] +Arguments: hashpartitioning(sr_ticket_number#22, sr_item_sk#21, 5), ENSURE_REQUIREMENTS, [id=#24] + +(27) Sort [codegen id : 9] +Input [2]: [sr_item_sk#21, sr_ticket_number#22] +Arguments: [sr_ticket_number#22 ASC NULLS FIRST, sr_item_sk#21 ASC NULLS FIRST], false, 0 + +(28) SortMergeJoin [codegen id : 12] +Left keys [2]: [ss_ticket_number#4, ss_item_sk#1] +Right keys [2]: [sr_ticket_number#22, sr_item_sk#21] +Join condition: None + +(29) Project [codegen id : 12] +Output [10]: [ss_store_sk#3, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Input [14]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18, sr_item_sk#21, sr_ticket_number#22] + +(30) Scan parquet default.store +Output [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 10] +Input [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] + +(32) Filter [codegen id : 10] +Input [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] +Condition : (((isnotnull(s_market_id#27) AND (s_market_id#27 = 8)) AND isnotnull(s_store_sk#25)) AND isnotnull(s_zip#29)) + +(33) Project [codegen id : 10] +Output [4]: [s_store_sk#25, s_store_name#26, s_state#28, s_zip#29] +Input [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] + +(34) BroadcastExchange +Input [4]: [s_store_sk#25, s_store_name#26, s_state#28, s_zip#29] +Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#30] + +(35) Scan parquet default.customer_address +Output [3]: [ca_state#31, ca_zip#32, ca_country#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(36) ColumnarToRow +Input [3]: [ca_state#31, ca_zip#32, ca_country#33] + +(37) Filter +Input [3]: [ca_state#31, ca_zip#32, ca_country#33] +Condition : (isnotnull(ca_country#33) AND isnotnull(ca_zip#32)) + +(38) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [s_zip#29] +Right keys [1]: [ca_zip#32] +Join condition: None + +(39) Project [codegen id : 11] +Output [5]: [s_store_sk#25, s_store_name#26, s_state#28, ca_state#31, ca_country#33] +Input [7]: [s_store_sk#25, s_store_name#26, s_state#28, s_zip#29, ca_state#31, ca_zip#32, ca_country#33] + +(40) BroadcastExchange +Input [5]: [s_store_sk#25, s_store_name#26, s_state#28, ca_state#31, ca_country#33] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[4, string, true])),false), [id=#34] + +(41) BroadcastHashJoin [codegen id : 12] +Left keys [2]: [ss_store_sk#3, c_birth_country#18] +Right keys [2]: [s_store_sk#25, upper(ca_country#33)] +Join condition: None + +(42) Project [codegen id : 12] +Output [11]: [ss_net_paid#5, s_store_name#26, s_state#28, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, ca_state#31] +Input [15]: [ss_store_sk#3, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18, s_store_sk#25, s_store_name#26, s_state#28, ca_state#31, ca_country#33] + +(43) HashAggregate [codegen id : 12] +Input [11]: [ss_net_paid#5, s_store_name#26, s_state#28, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, ca_state#31] +Keys [10]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum#35] +Results [11]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] + +(44) Exchange +Input [11]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] +Arguments: hashpartitioning(c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, 5), ENSURE_REQUIREMENTS, [id=#37] + +(45) HashAggregate [codegen id : 13] +Input [11]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] +Keys [10]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9] +Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#38] +Results [4]: [c_last_name#17, c_first_name#16, s_store_name#26, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#38,17,2) AS netpaid#39] + +(46) HashAggregate [codegen id : 13] +Input [4]: [c_last_name#17, c_first_name#16, s_store_name#26, netpaid#39] +Keys [3]: [c_last_name#17, c_first_name#16, s_store_name#26] +Functions [1]: [partial_sum(netpaid#39)] +Aggregate Attributes [2]: [sum#40, isEmpty#41] +Results [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum#42, isEmpty#43] + +(47) Exchange +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum#42, isEmpty#43] +Arguments: hashpartitioning(c_last_name#17, c_first_name#16, s_store_name#26, 5), ENSURE_REQUIREMENTS, [id=#44] + +(48) HashAggregate [codegen id : 14] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum#42, isEmpty#43] +Keys [3]: [c_last_name#17, c_first_name#16, s_store_name#26] +Functions [1]: [sum(netpaid#39)] +Aggregate Attributes [1]: [sum(netpaid#39)#45] +Results [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum(netpaid#39)#45 AS paid#46, sum(netpaid#39)#45 AS sum(netpaid#39)#47] + +(49) Filter [codegen id : 14] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, paid#46, sum(netpaid#39)#47] +Condition : (isnotnull(sum(netpaid#39)#47) AND (cast(sum(netpaid#39)#47 as decimal(33,8)) > cast(Subquery scalar-subquery#48, [id=#49] as decimal(33,8)))) + +(50) Project [codegen id : 14] +Output [4]: [c_last_name#17, c_first_name#16, s_store_name#26, paid#46] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, paid#46, sum(netpaid#39)#47] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 49 Hosting Expression = Subquery scalar-subquery#48, [id=#49] +* HashAggregate (104) ++- Exchange (103) + +- * HashAggregate (102) + +- * HashAggregate (101) + +- Exchange (100) + +- * HashAggregate (99) + +- * Project (98) + +- * SortMergeJoin Inner (97) + :- * Sort (91) + : +- Exchange (90) + : +- * Project (89) + : +- * SortMergeJoin Inner (88) + : :- * Sort (81) + : : +- Exchange (80) + : : +- * Project (79) + : : +- * SortMergeJoin Inner (78) + : : :- * Sort (72) + : : : +- Exchange (71) + : : : +- * Project (70) + : : : +- * SortMergeJoin Inner (69) + : : : :- * Sort (63) + : : : : +- Exchange (62) + : : : : +- * Project (61) + : : : : +- * BroadcastHashJoin Inner BuildRight (60) + : : : : :- * Project (54) + : : : : : +- * Filter (53) + : : : : : +- * ColumnarToRow (52) + : : : : : +- Scan parquet default.store_sales (51) + : : : : +- BroadcastExchange (59) + : : : : +- * Project (58) + : : : : +- * Filter (57) + : : : : +- * ColumnarToRow (56) + : : : : +- Scan parquet default.store (55) + : : : +- * Sort (68) + : : : +- Exchange (67) + : : : +- * Filter (66) + : : : +- * ColumnarToRow (65) + : : : +- Scan parquet default.item (64) + : : +- * Sort (77) + : : +- Exchange (76) + : : +- * Filter (75) + : : +- * ColumnarToRow (74) + : : +- Scan parquet default.customer (73) + : +- * Sort (87) + : +- Exchange (86) + : +- * Project (85) + : +- * Filter (84) + : +- * ColumnarToRow (83) + : +- Scan parquet default.store_returns (82) + +- * Sort (96) + +- Exchange (95) + +- * Filter (94) + +- * ColumnarToRow (93) + +- Scan parquet default.customer_address (92) + + +(51) Scan parquet default.store_sales +Output [6]: [ss_item_sk#50, ss_customer_sk#51, ss_store_sk#52, ss_ticket_number#53, ss_net_paid#54, ss_sold_date_sk#55] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 2] +Input [6]: [ss_item_sk#50, ss_customer_sk#51, ss_store_sk#52, ss_ticket_number#53, ss_net_paid#54, ss_sold_date_sk#55] + +(53) Filter [codegen id : 2] +Input [6]: [ss_item_sk#50, ss_customer_sk#51, ss_store_sk#52, ss_ticket_number#53, ss_net_paid#54, ss_sold_date_sk#55] +Condition : (((isnotnull(ss_ticket_number#53) AND isnotnull(ss_item_sk#50)) AND isnotnull(ss_store_sk#52)) AND isnotnull(ss_customer_sk#51)) + +(54) Project [codegen id : 2] +Output [5]: [ss_item_sk#50, ss_customer_sk#51, ss_store_sk#52, ss_ticket_number#53, ss_net_paid#54] +Input [6]: [ss_item_sk#50, ss_customer_sk#51, ss_store_sk#52, ss_ticket_number#53, ss_net_paid#54, ss_sold_date_sk#55] + +(55) Scan parquet default.store +Output [5]: [s_store_sk#56, s_store_name#57, s_market_id#58, s_state#59, s_zip#60] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(56) ColumnarToRow [codegen id : 1] +Input [5]: [s_store_sk#56, s_store_name#57, s_market_id#58, s_state#59, s_zip#60] + +(57) Filter [codegen id : 1] +Input [5]: [s_store_sk#56, s_store_name#57, s_market_id#58, s_state#59, s_zip#60] +Condition : (((isnotnull(s_market_id#58) AND (s_market_id#58 = 8)) AND isnotnull(s_store_sk#56)) AND isnotnull(s_zip#60)) + +(58) Project [codegen id : 1] +Output [4]: [s_store_sk#56, s_store_name#57, s_state#59, s_zip#60] +Input [5]: [s_store_sk#56, s_store_name#57, s_market_id#58, s_state#59, s_zip#60] + +(59) BroadcastExchange +Input [4]: [s_store_sk#56, s_store_name#57, s_state#59, s_zip#60] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#61] + +(60) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_store_sk#52] +Right keys [1]: [s_store_sk#56] +Join condition: None + +(61) Project [codegen id : 2] +Output [7]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60] +Input [9]: [ss_item_sk#50, ss_customer_sk#51, ss_store_sk#52, ss_ticket_number#53, ss_net_paid#54, s_store_sk#56, s_store_name#57, s_state#59, s_zip#60] + +(62) Exchange +Input [7]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60] +Arguments: hashpartitioning(ss_item_sk#50, 5), ENSURE_REQUIREMENTS, [id=#62] + +(63) Sort [codegen id : 3] +Input [7]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60] +Arguments: [ss_item_sk#50 ASC NULLS FIRST], false, 0 + +(64) Scan parquet default.item +Output [6]: [i_item_sk#63, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(65) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#63, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] + +(66) Filter [codegen id : 4] +Input [6]: [i_item_sk#63, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Condition : isnotnull(i_item_sk#63) + +(67) Exchange +Input [6]: [i_item_sk#63, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Arguments: hashpartitioning(i_item_sk#63, 5), ENSURE_REQUIREMENTS, [id=#69] + +(68) Sort [codegen id : 5] +Input [6]: [i_item_sk#63, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Arguments: [i_item_sk#63 ASC NULLS FIRST], false, 0 + +(69) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#50] +Right keys [1]: [i_item_sk#63] +Join condition: None + +(70) Project [codegen id : 6] +Output [12]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Input [13]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_item_sk#63, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] + +(71) Exchange +Input [12]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Arguments: hashpartitioning(ss_customer_sk#51, 5), ENSURE_REQUIREMENTS, [id=#70] + +(72) Sort [codegen id : 7] +Input [12]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Arguments: [ss_customer_sk#51 ASC NULLS FIRST], false, 0 + +(73) Scan parquet default.customer +Output [4]: [c_customer_sk#71, c_first_name#72, c_last_name#73, c_birth_country#74] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_birth_country)] +ReadSchema: struct + +(74) ColumnarToRow [codegen id : 8] +Input [4]: [c_customer_sk#71, c_first_name#72, c_last_name#73, c_birth_country#74] + +(75) Filter [codegen id : 8] +Input [4]: [c_customer_sk#71, c_first_name#72, c_last_name#73, c_birth_country#74] +Condition : (isnotnull(c_customer_sk#71) AND isnotnull(c_birth_country#74)) + +(76) Exchange +Input [4]: [c_customer_sk#71, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: hashpartitioning(c_customer_sk#71, 5), ENSURE_REQUIREMENTS, [id=#75] + +(77) Sort [codegen id : 9] +Input [4]: [c_customer_sk#71, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: [c_customer_sk#71 ASC NULLS FIRST], false, 0 + +(78) SortMergeJoin [codegen id : 10] +Left keys [1]: [ss_customer_sk#51] +Right keys [1]: [c_customer_sk#71] +Join condition: None + +(79) Project [codegen id : 10] +Output [14]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Input [16]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_customer_sk#71, c_first_name#72, c_last_name#73, c_birth_country#74] + +(80) Exchange +Input [14]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: hashpartitioning(ss_ticket_number#53, ss_item_sk#50, 5), ENSURE_REQUIREMENTS, [id=#76] + +(81) Sort [codegen id : 11] +Input [14]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: [ss_ticket_number#53 ASC NULLS FIRST, ss_item_sk#50 ASC NULLS FIRST], false, 0 + +(82) Scan parquet default.store_returns +Output [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(83) ColumnarToRow [codegen id : 12] +Input [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] + +(84) Filter [codegen id : 12] +Input [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] +Condition : (isnotnull(sr_ticket_number#78) AND isnotnull(sr_item_sk#77)) + +(85) Project [codegen id : 12] +Output [2]: [sr_item_sk#77, sr_ticket_number#78] +Input [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] + +(86) Exchange +Input [2]: [sr_item_sk#77, sr_ticket_number#78] +Arguments: hashpartitioning(sr_ticket_number#78, sr_item_sk#77, 5), ENSURE_REQUIREMENTS, [id=#80] + +(87) Sort [codegen id : 13] +Input [2]: [sr_item_sk#77, sr_ticket_number#78] +Arguments: [sr_ticket_number#78 ASC NULLS FIRST, sr_item_sk#77 ASC NULLS FIRST], false, 0 + +(88) SortMergeJoin [codegen id : 14] +Left keys [2]: [ss_ticket_number#53, ss_item_sk#50] +Right keys [2]: [sr_ticket_number#78, sr_item_sk#77] +Join condition: None + +(89) Project [codegen id : 14] +Output [12]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Input [16]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74, sr_item_sk#77, sr_ticket_number#78] + +(90) Exchange +Input [12]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: hashpartitioning(c_birth_country#74, s_zip#60, 5), ENSURE_REQUIREMENTS, [id=#81] + +(91) Sort [codegen id : 15] +Input [12]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: [c_birth_country#74 ASC NULLS FIRST, s_zip#60 ASC NULLS FIRST], false, 0 + +(92) Scan parquet default.customer_address +Output [3]: [ca_state#82, ca_zip#83, ca_country#84] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(93) ColumnarToRow [codegen id : 16] +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] + +(94) Filter [codegen id : 16] +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] +Condition : (isnotnull(ca_country#84) AND isnotnull(ca_zip#83)) + +(95) Exchange +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] +Arguments: hashpartitioning(upper(ca_country#84), ca_zip#83, 5), ENSURE_REQUIREMENTS, [id=#85] + +(96) Sort [codegen id : 17] +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] +Arguments: [upper(ca_country#84) ASC NULLS FIRST, ca_zip#83 ASC NULLS FIRST], false, 0 + +(97) SortMergeJoin [codegen id : 18] +Left keys [2]: [c_birth_country#74, s_zip#60] +Right keys [2]: [upper(ca_country#84), ca_zip#83] +Join condition: None + +(98) Project [codegen id : 18] +Output [11]: [ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#82] +Input [15]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74, ca_state#82, ca_zip#83, ca_country#84] + +(99) HashAggregate [codegen id : 18] +Input [11]: [ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#82] +Keys [10]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#54))] +Aggregate Attributes [1]: [sum#86] +Results [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] + +(100) Exchange +Input [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] +Arguments: hashpartitioning(c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, 5), ENSURE_REQUIREMENTS, [id=#88] + +(101) HashAggregate [codegen id : 19] +Input [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] +Keys [10]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65] +Functions [1]: [sum(UnscaledValue(ss_net_paid#54))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#54))#89] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#54))#89,17,2) AS netpaid#39] + +(102) HashAggregate [codegen id : 19] +Input [1]: [netpaid#39] +Keys: [] +Functions [1]: [partial_avg(netpaid#39)] +Aggregate Attributes [2]: [sum#90, count#91] +Results [2]: [sum#92, count#93] + +(103) Exchange +Input [2]: [sum#92, count#93] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#94] + +(104) HashAggregate [codegen id : 20] +Input [2]: [sum#92, count#93] +Keys: [] +Functions [1]: [avg(netpaid#39)] +Aggregate Attributes [1]: [avg(netpaid#39)#95] +Results [1]: [CheckOverflow((0.050000 * promote_precision(avg(netpaid#39)#95)), DecimalType(24,8), true) AS (0.05 * avg(netpaid))#96] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt new file mode 100644 index 0000000000000..46fa83fcfed4b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a.sf100/simplified.txt @@ -0,0 +1,183 @@ +WholeStageCodegen (14) + Project [c_last_name,c_first_name,s_store_name,paid] + Filter [sum(netpaid)] + Subquery #1 + WholeStageCodegen (20) + HashAggregate [sum,count] [avg(netpaid),(0.05 * avg(netpaid)),sum,count] + InputAdapter + Exchange #10 + WholeStageCodegen (19) + HashAggregate [netpaid] [sum,count,sum,count] + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #11 + WholeStageCodegen (18) + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] + Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + SortMergeJoin [c_birth_country,s_zip,ca_country,ca_zip] + InputAdapter + WholeStageCodegen (15) + Sort [c_birth_country,s_zip] + InputAdapter + Exchange [c_birth_country,s_zip] #12 + WholeStageCodegen (14) + Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #13 + WholeStageCodegen (10) + Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (7) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #14 + WholeStageCodegen (6) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #15 + WholeStageCodegen (2) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk] + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (1) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + InputAdapter + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #17 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + InputAdapter + WholeStageCodegen (9) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #18 + WholeStageCodegen (8) + Filter [c_customer_sk,c_birth_country] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country] + InputAdapter + WholeStageCodegen (13) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #19 + WholeStageCodegen (12) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + WholeStageCodegen (17) + Sort [ca_country,ca_zip] + InputAdapter + Exchange [ca_country,ca_zip] #20 + WholeStageCodegen (16) + Filter [ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_state,ca_zip,ca_country] + HashAggregate [c_last_name,c_first_name,s_store_name,sum,isEmpty] [sum(netpaid),paid,sum(netpaid),sum,isEmpty] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name] #1 + WholeStageCodegen (13) + HashAggregate [c_last_name,c_first_name,s_store_name,netpaid] [sum,isEmpty,sum,isEmpty] + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #2 + WholeStageCodegen (12) + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] + Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + BroadcastHashJoin [ss_store_sk,c_birth_country,s_store_sk,ca_country] + Project [ss_store_sk,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (7) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #3 + WholeStageCodegen (6) + Project [ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #4 + WholeStageCodegen (2) + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Filter [i_color,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #6 + WholeStageCodegen (4) + Filter [c_customer_sk,c_birth_country] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country] + InputAdapter + WholeStageCodegen (9) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #7 + WholeStageCodegen (8) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (11) + Project [s_store_sk,s_store_name,s_state,ca_state,ca_country] + BroadcastHashJoin [s_zip,ca_zip] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (10) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + Filter [ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_state,ca_zip,ca_country] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/explain.txt new file mode 100644 index 0000000000000..527913016c998 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/explain.txt @@ -0,0 +1,527 @@ +== Physical Plan == +* Project (47) ++- * Filter (46) + +- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * HashAggregate (42) + +- Exchange (41) + +- * HashAggregate (40) + +- * Project (39) + +- * BroadcastHashJoin Inner BuildRight (38) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Project (27) + : : +- * BroadcastHashJoin Inner BuildRight (26) + : : :- * Project (21) + : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : :- * Project (14) + : : : : +- * SortMergeJoin Inner (13) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- * Sort (12) + : : : : +- Exchange (11) + : : : : +- * Project (10) + : : : : +- * Filter (9) + : : : : +- * ColumnarToRow (8) + : : : : +- Scan parquet default.store_returns (7) + : : : +- BroadcastExchange (19) + : : : +- * Project (18) + : : : +- * Filter (17) + : : : +- * ColumnarToRow (16) + : : : +- Scan parquet default.store (15) + : : +- BroadcastExchange (25) + : : +- * Filter (24) + : : +- * ColumnarToRow (23) + : : +- Scan parquet default.item (22) + : +- BroadcastExchange (31) + : +- * Filter (30) + : +- * ColumnarToRow (29) + : +- Scan parquet default.customer (28) + +- BroadcastExchange (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.customer_address (34) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 1] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) + +(4) Project [codegen id : 1] +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] + +(5) Exchange +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#7] + +(6) Sort [codegen id : 2] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Arguments: [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(7) Scan parquet default.store_returns +Output [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 3] +Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] + +(9) Filter [codegen id : 3] +Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] +Condition : (isnotnull(sr_ticket_number#9) AND isnotnull(sr_item_sk#8)) + +(10) Project [codegen id : 3] +Output [2]: [sr_item_sk#8, sr_ticket_number#9] +Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] + +(11) Exchange +Input [2]: [sr_item_sk#8, sr_ticket_number#9] +Arguments: hashpartitioning(sr_ticket_number#9, sr_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#11] + +(12) Sort [codegen id : 4] +Input [2]: [sr_item_sk#8, sr_ticket_number#9] +Arguments: [sr_ticket_number#9 ASC NULLS FIRST, sr_item_sk#8 ASC NULLS FIRST], false, 0 + +(13) SortMergeJoin [codegen id : 9] +Left keys [2]: [ss_ticket_number#4, ss_item_sk#1] +Right keys [2]: [sr_ticket_number#9, sr_item_sk#8] +Join condition: None + +(14) Project [codegen id : 9] +Output [4]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, sr_item_sk#8, sr_ticket_number#9] + +(15) Scan parquet default.store +Output [5]: [s_store_sk#12, s_store_name#13, s_market_id#14, s_state#15, s_zip#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 5] +Input [5]: [s_store_sk#12, s_store_name#13, s_market_id#14, s_state#15, s_zip#16] + +(17) Filter [codegen id : 5] +Input [5]: [s_store_sk#12, s_store_name#13, s_market_id#14, s_state#15, s_zip#16] +Condition : (((isnotnull(s_market_id#14) AND (s_market_id#14 = 8)) AND isnotnull(s_store_sk#12)) AND isnotnull(s_zip#16)) + +(18) Project [codegen id : 5] +Output [4]: [s_store_sk#12, s_store_name#13, s_state#15, s_zip#16] +Input [5]: [s_store_sk#12, s_store_name#13, s_market_id#14, s_state#15, s_zip#16] + +(19) BroadcastExchange +Input [4]: [s_store_sk#12, s_store_name#13, s_state#15, s_zip#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(20) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#12] +Join condition: None + +(21) Project [codegen id : 9] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16] +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5, s_store_sk#12, s_store_name#13, s_state#15, s_zip#16] + +(22) Scan parquet default.item +Output [6]: [i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_color), EqualTo(i_color,pale ), IsNotNull(i_item_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 6] +Input [6]: [i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] + +(24) Filter [codegen id : 6] +Input [6]: [i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] +Condition : ((isnotnull(i_color#21) AND (i_color#21 = pale )) AND isnotnull(i_item_sk#18)) + +(25) BroadcastExchange +Input [6]: [i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(26) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#18] +Join condition: None + +(27) Project [codegen id : 9] +Output [10]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] + +(28) Scan parquet default.customer +Output [4]: [c_customer_sk#25, c_first_name#26, c_last_name#27, c_birth_country#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_birth_country)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 7] +Input [4]: [c_customer_sk#25, c_first_name#26, c_last_name#27, c_birth_country#28] + +(30) Filter [codegen id : 7] +Input [4]: [c_customer_sk#25, c_first_name#26, c_last_name#27, c_birth_country#28] +Condition : (isnotnull(c_customer_sk#25) AND isnotnull(c_birth_country#28)) + +(31) BroadcastExchange +Input [4]: [c_customer_sk#25, c_first_name#26, c_last_name#27, c_birth_country#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(32) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#25] +Join condition: None + +(33) Project [codegen id : 9] +Output [12]: [ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_first_name#26, c_last_name#27, c_birth_country#28] +Input [14]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_customer_sk#25, c_first_name#26, c_last_name#27, c_birth_country#28] + +(34) Scan parquet default.customer_address +Output [3]: [ca_state#30, ca_zip#31, ca_country#32] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 8] +Input [3]: [ca_state#30, ca_zip#31, ca_country#32] + +(36) Filter [codegen id : 8] +Input [3]: [ca_state#30, ca_zip#31, ca_country#32] +Condition : (isnotnull(ca_country#32) AND isnotnull(ca_zip#31)) + +(37) BroadcastExchange +Input [3]: [ca_state#30, ca_zip#31, ca_country#32] +Arguments: HashedRelationBroadcastMode(List(upper(input[2, string, false]), input[1, string, false]),false), [id=#33] + +(38) BroadcastHashJoin [codegen id : 9] +Left keys [2]: [c_birth_country#28, s_zip#16] +Right keys [2]: [upper(ca_country#32), ca_zip#31] +Join condition: None + +(39) Project [codegen id : 9] +Output [11]: [ss_net_paid#5, s_store_name#13, s_state#15, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_first_name#26, c_last_name#27, ca_state#30] +Input [15]: [ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_first_name#26, c_last_name#27, c_birth_country#28, ca_state#30, ca_zip#31, ca_country#32] + +(40) HashAggregate [codegen id : 9] +Input [11]: [ss_net_paid#5, s_store_name#13, s_state#15, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_first_name#26, c_last_name#27, ca_state#30] +Keys [10]: [c_last_name#27, c_first_name#26, s_store_name#13, ca_state#30, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum#34] +Results [11]: [c_last_name#27, c_first_name#26, s_store_name#13, ca_state#30, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20, sum#35] + +(41) Exchange +Input [11]: [c_last_name#27, c_first_name#26, s_store_name#13, ca_state#30, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20, sum#35] +Arguments: hashpartitioning(c_last_name#27, c_first_name#26, s_store_name#13, ca_state#30, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20, 5), ENSURE_REQUIREMENTS, [id=#36] + +(42) HashAggregate [codegen id : 10] +Input [11]: [c_last_name#27, c_first_name#26, s_store_name#13, ca_state#30, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20, sum#35] +Keys [10]: [c_last_name#27, c_first_name#26, s_store_name#13, ca_state#30, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20] +Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#37] +Results [4]: [c_last_name#27, c_first_name#26, s_store_name#13, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#37,17,2) AS netpaid#38] + +(43) HashAggregate [codegen id : 10] +Input [4]: [c_last_name#27, c_first_name#26, s_store_name#13, netpaid#38] +Keys [3]: [c_last_name#27, c_first_name#26, s_store_name#13] +Functions [1]: [partial_sum(netpaid#38)] +Aggregate Attributes [2]: [sum#39, isEmpty#40] +Results [5]: [c_last_name#27, c_first_name#26, s_store_name#13, sum#41, isEmpty#42] + +(44) Exchange +Input [5]: [c_last_name#27, c_first_name#26, s_store_name#13, sum#41, isEmpty#42] +Arguments: hashpartitioning(c_last_name#27, c_first_name#26, s_store_name#13, 5), ENSURE_REQUIREMENTS, [id=#43] + +(45) HashAggregate [codegen id : 11] +Input [5]: [c_last_name#27, c_first_name#26, s_store_name#13, sum#41, isEmpty#42] +Keys [3]: [c_last_name#27, c_first_name#26, s_store_name#13] +Functions [1]: [sum(netpaid#38)] +Aggregate Attributes [1]: [sum(netpaid#38)#44] +Results [5]: [c_last_name#27, c_first_name#26, s_store_name#13, sum(netpaid#38)#44 AS paid#45, sum(netpaid#38)#44 AS sum(netpaid#38)#46] + +(46) Filter [codegen id : 11] +Input [5]: [c_last_name#27, c_first_name#26, s_store_name#13, paid#45, sum(netpaid#38)#46] +Condition : (isnotnull(sum(netpaid#38)#46) AND (cast(sum(netpaid#38)#46 as decimal(33,8)) > cast(Subquery scalar-subquery#47, [id=#48] as decimal(33,8)))) + +(47) Project [codegen id : 11] +Output [4]: [c_last_name#27, c_first_name#26, s_store_name#13, paid#45] +Input [5]: [c_last_name#27, c_first_name#26, s_store_name#13, paid#45, sum(netpaid#38)#46] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 46 Hosting Expression = Subquery scalar-subquery#47, [id=#48] +* HashAggregate (92) ++- Exchange (91) + +- * HashAggregate (90) + +- * HashAggregate (89) + +- Exchange (88) + +- * HashAggregate (87) + +- * Project (86) + +- * BroadcastHashJoin Inner BuildRight (85) + :- * Project (80) + : +- * BroadcastHashJoin Inner BuildRight (79) + : :- * Project (74) + : : +- * BroadcastHashJoin Inner BuildRight (73) + : : :- * Project (68) + : : : +- * BroadcastHashJoin Inner BuildRight (67) + : : : :- * Project (61) + : : : : +- * SortMergeJoin Inner (60) + : : : : :- * Sort (53) + : : : : : +- Exchange (52) + : : : : : +- * Project (51) + : : : : : +- * Filter (50) + : : : : : +- * ColumnarToRow (49) + : : : : : +- Scan parquet default.store_sales (48) + : : : : +- * Sort (59) + : : : : +- Exchange (58) + : : : : +- * Project (57) + : : : : +- * Filter (56) + : : : : +- * ColumnarToRow (55) + : : : : +- Scan parquet default.store_returns (54) + : : : +- BroadcastExchange (66) + : : : +- * Project (65) + : : : +- * Filter (64) + : : : +- * ColumnarToRow (63) + : : : +- Scan parquet default.store (62) + : : +- BroadcastExchange (72) + : : +- * Filter (71) + : : +- * ColumnarToRow (70) + : : +- Scan parquet default.item (69) + : +- BroadcastExchange (78) + : +- * Filter (77) + : +- * ColumnarToRow (76) + : +- Scan parquet default.customer (75) + +- BroadcastExchange (84) + +- * Filter (83) + +- * ColumnarToRow (82) + +- Scan parquet default.customer_address (81) + + +(48) Scan parquet default.store_sales +Output [6]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53, ss_sold_date_sk#54] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 1] +Input [6]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53, ss_sold_date_sk#54] + +(50) Filter [codegen id : 1] +Input [6]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53, ss_sold_date_sk#54] +Condition : (((isnotnull(ss_ticket_number#52) AND isnotnull(ss_item_sk#49)) AND isnotnull(ss_store_sk#51)) AND isnotnull(ss_customer_sk#50)) + +(51) Project [codegen id : 1] +Output [5]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53] +Input [6]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53, ss_sold_date_sk#54] + +(52) Exchange +Input [5]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53] +Arguments: hashpartitioning(ss_ticket_number#52, ss_item_sk#49, 5), ENSURE_REQUIREMENTS, [id=#55] + +(53) Sort [codegen id : 2] +Input [5]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53] +Arguments: [ss_ticket_number#52 ASC NULLS FIRST, ss_item_sk#49 ASC NULLS FIRST], false, 0 + +(54) Scan parquet default.store_returns +Output [3]: [sr_item_sk#56, sr_ticket_number#57, sr_returned_date_sk#58] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 3] +Input [3]: [sr_item_sk#56, sr_ticket_number#57, sr_returned_date_sk#58] + +(56) Filter [codegen id : 3] +Input [3]: [sr_item_sk#56, sr_ticket_number#57, sr_returned_date_sk#58] +Condition : (isnotnull(sr_ticket_number#57) AND isnotnull(sr_item_sk#56)) + +(57) Project [codegen id : 3] +Output [2]: [sr_item_sk#56, sr_ticket_number#57] +Input [3]: [sr_item_sk#56, sr_ticket_number#57, sr_returned_date_sk#58] + +(58) Exchange +Input [2]: [sr_item_sk#56, sr_ticket_number#57] +Arguments: hashpartitioning(sr_ticket_number#57, sr_item_sk#56, 5), ENSURE_REQUIREMENTS, [id=#59] + +(59) Sort [codegen id : 4] +Input [2]: [sr_item_sk#56, sr_ticket_number#57] +Arguments: [sr_ticket_number#57 ASC NULLS FIRST, sr_item_sk#56 ASC NULLS FIRST], false, 0 + +(60) SortMergeJoin [codegen id : 9] +Left keys [2]: [ss_ticket_number#52, ss_item_sk#49] +Right keys [2]: [sr_ticket_number#57, sr_item_sk#56] +Join condition: None + +(61) Project [codegen id : 9] +Output [4]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_net_paid#53] +Input [7]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53, sr_item_sk#56, sr_ticket_number#57] + +(62) Scan parquet default.store +Output [5]: [s_store_sk#60, s_store_name#61, s_market_id#62, s_state#63, s_zip#64] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(63) ColumnarToRow [codegen id : 5] +Input [5]: [s_store_sk#60, s_store_name#61, s_market_id#62, s_state#63, s_zip#64] + +(64) Filter [codegen id : 5] +Input [5]: [s_store_sk#60, s_store_name#61, s_market_id#62, s_state#63, s_zip#64] +Condition : (((isnotnull(s_market_id#62) AND (s_market_id#62 = 8)) AND isnotnull(s_store_sk#60)) AND isnotnull(s_zip#64)) + +(65) Project [codegen id : 5] +Output [4]: [s_store_sk#60, s_store_name#61, s_state#63, s_zip#64] +Input [5]: [s_store_sk#60, s_store_name#61, s_market_id#62, s_state#63, s_zip#64] + +(66) BroadcastExchange +Input [4]: [s_store_sk#60, s_store_name#61, s_state#63, s_zip#64] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#65] + +(67) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#51] +Right keys [1]: [s_store_sk#60] +Join condition: None + +(68) Project [codegen id : 9] +Output [6]: [ss_item_sk#49, ss_customer_sk#50, ss_net_paid#53, s_store_name#61, s_state#63, s_zip#64] +Input [8]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_net_paid#53, s_store_sk#60, s_store_name#61, s_state#63, s_zip#64] + +(69) Scan parquet default.item +Output [6]: [i_item_sk#66, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(70) ColumnarToRow [codegen id : 6] +Input [6]: [i_item_sk#66, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71] + +(71) Filter [codegen id : 6] +Input [6]: [i_item_sk#66, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71] +Condition : isnotnull(i_item_sk#66) + +(72) BroadcastExchange +Input [6]: [i_item_sk#66, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#72] + +(73) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#49] +Right keys [1]: [i_item_sk#66] +Join condition: None + +(74) Project [codegen id : 9] +Output [10]: [ss_customer_sk#50, ss_net_paid#53, s_store_name#61, s_state#63, s_zip#64, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71] +Input [12]: [ss_item_sk#49, ss_customer_sk#50, ss_net_paid#53, s_store_name#61, s_state#63, s_zip#64, i_item_sk#66, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71] + +(75) Scan parquet default.customer +Output [4]: [c_customer_sk#73, c_first_name#74, c_last_name#75, c_birth_country#76] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_birth_country)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 7] +Input [4]: [c_customer_sk#73, c_first_name#74, c_last_name#75, c_birth_country#76] + +(77) Filter [codegen id : 7] +Input [4]: [c_customer_sk#73, c_first_name#74, c_last_name#75, c_birth_country#76] +Condition : (isnotnull(c_customer_sk#73) AND isnotnull(c_birth_country#76)) + +(78) BroadcastExchange +Input [4]: [c_customer_sk#73, c_first_name#74, c_last_name#75, c_birth_country#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#77] + +(79) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_customer_sk#50] +Right keys [1]: [c_customer_sk#73] +Join condition: None + +(80) Project [codegen id : 9] +Output [12]: [ss_net_paid#53, s_store_name#61, s_state#63, s_zip#64, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71, c_first_name#74, c_last_name#75, c_birth_country#76] +Input [14]: [ss_customer_sk#50, ss_net_paid#53, s_store_name#61, s_state#63, s_zip#64, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71, c_customer_sk#73, c_first_name#74, c_last_name#75, c_birth_country#76] + +(81) Scan parquet default.customer_address +Output [3]: [ca_state#78, ca_zip#79, ca_country#80] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(82) ColumnarToRow [codegen id : 8] +Input [3]: [ca_state#78, ca_zip#79, ca_country#80] + +(83) Filter [codegen id : 8] +Input [3]: [ca_state#78, ca_zip#79, ca_country#80] +Condition : (isnotnull(ca_country#80) AND isnotnull(ca_zip#79)) + +(84) BroadcastExchange +Input [3]: [ca_state#78, ca_zip#79, ca_country#80] +Arguments: HashedRelationBroadcastMode(List(upper(input[2, string, false]), input[1, string, false]),false), [id=#81] + +(85) BroadcastHashJoin [codegen id : 9] +Left keys [2]: [c_birth_country#76, s_zip#64] +Right keys [2]: [upper(ca_country#80), ca_zip#79] +Join condition: None + +(86) Project [codegen id : 9] +Output [11]: [ss_net_paid#53, s_store_name#61, s_state#63, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71, c_first_name#74, c_last_name#75, ca_state#78] +Input [15]: [ss_net_paid#53, s_store_name#61, s_state#63, s_zip#64, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71, c_first_name#74, c_last_name#75, c_birth_country#76, ca_state#78, ca_zip#79, ca_country#80] + +(87) HashAggregate [codegen id : 9] +Input [11]: [ss_net_paid#53, s_store_name#61, s_state#63, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71, c_first_name#74, c_last_name#75, ca_state#78] +Keys [10]: [c_last_name#75, c_first_name#74, s_store_name#61, ca_state#78, s_state#63, i_color#69, i_current_price#67, i_manager_id#71, i_units#70, i_size#68] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#53))] +Aggregate Attributes [1]: [sum#82] +Results [11]: [c_last_name#75, c_first_name#74, s_store_name#61, ca_state#78, s_state#63, i_color#69, i_current_price#67, i_manager_id#71, i_units#70, i_size#68, sum#83] + +(88) Exchange +Input [11]: [c_last_name#75, c_first_name#74, s_store_name#61, ca_state#78, s_state#63, i_color#69, i_current_price#67, i_manager_id#71, i_units#70, i_size#68, sum#83] +Arguments: hashpartitioning(c_last_name#75, c_first_name#74, s_store_name#61, ca_state#78, s_state#63, i_color#69, i_current_price#67, i_manager_id#71, i_units#70, i_size#68, 5), ENSURE_REQUIREMENTS, [id=#84] + +(89) HashAggregate [codegen id : 10] +Input [11]: [c_last_name#75, c_first_name#74, s_store_name#61, ca_state#78, s_state#63, i_color#69, i_current_price#67, i_manager_id#71, i_units#70, i_size#68, sum#83] +Keys [10]: [c_last_name#75, c_first_name#74, s_store_name#61, ca_state#78, s_state#63, i_color#69, i_current_price#67, i_manager_id#71, i_units#70, i_size#68] +Functions [1]: [sum(UnscaledValue(ss_net_paid#53))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#53))#85] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#53))#85,17,2) AS netpaid#38] + +(90) HashAggregate [codegen id : 10] +Input [1]: [netpaid#38] +Keys: [] +Functions [1]: [partial_avg(netpaid#38)] +Aggregate Attributes [2]: [sum#86, count#87] +Results [2]: [sum#88, count#89] + +(91) Exchange +Input [2]: [sum#88, count#89] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#90] + +(92) HashAggregate [codegen id : 11] +Input [2]: [sum#88, count#89] +Keys: [] +Functions [1]: [avg(netpaid#38)] +Aggregate Attributes [1]: [avg(netpaid#38)#91] +Results [1]: [CheckOverflow((0.050000 * promote_precision(avg(netpaid#38)#91)), DecimalType(24,8), true) AS (0.05 * avg(netpaid))#92] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/simplified.txt new file mode 100644 index 0000000000000..6d50a1e3f35a0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24a/simplified.txt @@ -0,0 +1,147 @@ +WholeStageCodegen (11) + Project [c_last_name,c_first_name,s_store_name,paid] + Filter [sum(netpaid)] + Subquery #1 + WholeStageCodegen (11) + HashAggregate [sum,count] [avg(netpaid),(0.05 * avg(netpaid)),sum,count] + InputAdapter + Exchange #9 + WholeStageCodegen (10) + HashAggregate [netpaid] [sum,count,sum,count] + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #10 + WholeStageCodegen (9) + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] + Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + BroadcastHashJoin [c_birth_country,s_zip,ca_country,ca_zip] + Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_net_paid] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #11 + WholeStageCodegen (1) + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk] + InputAdapter + WholeStageCodegen (4) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #12 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (5) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (6) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (7) + Filter [c_customer_sk,c_birth_country] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country] + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (8) + Filter [ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_state,ca_zip,ca_country] + HashAggregate [c_last_name,c_first_name,s_store_name,sum,isEmpty] [sum(netpaid),paid,sum(netpaid),sum,isEmpty] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name] #1 + WholeStageCodegen (10) + HashAggregate [c_last_name,c_first_name,s_store_name,netpaid] [sum,isEmpty,sum,isEmpty] + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #2 + WholeStageCodegen (9) + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] + Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + BroadcastHashJoin [c_birth_country,s_zip,ca_country,ca_zip] + Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_net_paid] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #3 + WholeStageCodegen (1) + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk] + InputAdapter + WholeStageCodegen (4) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #4 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (5) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Filter [i_color,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (7) + Filter [c_customer_sk,c_birth_country] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (8) + Filter [ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_state,ca_zip,ca_country] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt new file mode 100644 index 0000000000000..1663ffd6dc09e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/explain.txt @@ -0,0 +1,587 @@ +== Physical Plan == +* Project (50) ++- * Filter (49) + +- * HashAggregate (48) + +- Exchange (47) + +- * HashAggregate (46) + +- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * Project (42) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (29) + : +- * SortMergeJoin Inner (28) + : :- * Sort (21) + : : +- Exchange (20) + : : +- * Project (19) + : : +- * SortMergeJoin Inner (18) + : : :- * Sort (12) + : : : +- Exchange (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Filter (7) + : : : +- * ColumnarToRow (6) + : : : +- Scan parquet default.item (5) + : : +- * Sort (17) + : : +- Exchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.customer (13) + : +- * Sort (27) + : +- Exchange (26) + : +- * Project (25) + : +- * Filter (24) + : +- * ColumnarToRow (23) + : +- Scan parquet default.store_returns (22) + +- BroadcastExchange (40) + +- * Project (39) + +- * BroadcastHashJoin Inner BuildLeft (38) + :- BroadcastExchange (34) + : +- * Project (33) + : +- * Filter (32) + : +- * ColumnarToRow (31) + : +- Scan parquet default.store (30) + +- * Filter (37) + +- * ColumnarToRow (36) + +- Scan parquet default.customer_address (35) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 2] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) + +(4) Project [codegen id : 2] +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] + +(5) Scan parquet default.item +Output [6]: [i_item_sk#7, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_color), EqualTo(i_color,chiffon ), IsNotNull(i_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#7, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] + +(7) Filter [codegen id : 1] +Input [6]: [i_item_sk#7, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] +Condition : ((isnotnull(i_color#10) AND (i_color#10 = chiffon )) AND isnotnull(i_item_sk#7)) + +(8) BroadcastExchange +Input [6]: [i_item_sk#7, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#7] +Join condition: None + +(10) Project [codegen id : 2] +Output [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_item_sk#7, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] + +(11) Exchange +Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] +Arguments: hashpartitioning(ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#14] + +(12) Sort [codegen id : 3] +Input [10]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.customer +Output [4]: [c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_birth_country)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 4] +Input [4]: [c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] + +(15) Filter [codegen id : 4] +Input [4]: [c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] +Condition : (isnotnull(c_customer_sk#15) AND isnotnull(c_birth_country#18)) + +(16) Exchange +Input [4]: [c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] +Arguments: hashpartitioning(c_customer_sk#15, 5), ENSURE_REQUIREMENTS, [id=#19] + +(17) Sort [codegen id : 5] +Input [4]: [c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] +Arguments: [c_customer_sk#15 ASC NULLS FIRST], false, 0 + +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#15] +Join condition: None + +(19) Project [codegen id : 6] +Output [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_customer_sk#15, c_first_name#16, c_last_name#17, c_birth_country#18] + +(20) Exchange +Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#20] + +(21) Sort [codegen id : 7] +Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Arguments: [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(22) Scan parquet default.store_returns +Output [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 8] +Input [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] + +(24) Filter [codegen id : 8] +Input [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] +Condition : (isnotnull(sr_ticket_number#22) AND isnotnull(sr_item_sk#21)) + +(25) Project [codegen id : 8] +Output [2]: [sr_item_sk#21, sr_ticket_number#22] +Input [3]: [sr_item_sk#21, sr_ticket_number#22, sr_returned_date_sk#23] + +(26) Exchange +Input [2]: [sr_item_sk#21, sr_ticket_number#22] +Arguments: hashpartitioning(sr_ticket_number#22, sr_item_sk#21, 5), ENSURE_REQUIREMENTS, [id=#24] + +(27) Sort [codegen id : 9] +Input [2]: [sr_item_sk#21, sr_ticket_number#22] +Arguments: [sr_ticket_number#22 ASC NULLS FIRST, sr_item_sk#21 ASC NULLS FIRST], false, 0 + +(28) SortMergeJoin [codegen id : 12] +Left keys [2]: [ss_ticket_number#4, ss_item_sk#1] +Right keys [2]: [sr_ticket_number#22, sr_item_sk#21] +Join condition: None + +(29) Project [codegen id : 12] +Output [10]: [ss_store_sk#3, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18] +Input [14]: [ss_item_sk#1, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18, sr_item_sk#21, sr_ticket_number#22] + +(30) Scan parquet default.store +Output [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 10] +Input [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] + +(32) Filter [codegen id : 10] +Input [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] +Condition : (((isnotnull(s_market_id#27) AND (s_market_id#27 = 8)) AND isnotnull(s_store_sk#25)) AND isnotnull(s_zip#29)) + +(33) Project [codegen id : 10] +Output [4]: [s_store_sk#25, s_store_name#26, s_state#28, s_zip#29] +Input [5]: [s_store_sk#25, s_store_name#26, s_market_id#27, s_state#28, s_zip#29] + +(34) BroadcastExchange +Input [4]: [s_store_sk#25, s_store_name#26, s_state#28, s_zip#29] +Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#30] + +(35) Scan parquet default.customer_address +Output [3]: [ca_state#31, ca_zip#32, ca_country#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(36) ColumnarToRow +Input [3]: [ca_state#31, ca_zip#32, ca_country#33] + +(37) Filter +Input [3]: [ca_state#31, ca_zip#32, ca_country#33] +Condition : (isnotnull(ca_country#33) AND isnotnull(ca_zip#32)) + +(38) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [s_zip#29] +Right keys [1]: [ca_zip#32] +Join condition: None + +(39) Project [codegen id : 11] +Output [5]: [s_store_sk#25, s_store_name#26, s_state#28, ca_state#31, ca_country#33] +Input [7]: [s_store_sk#25, s_store_name#26, s_state#28, s_zip#29, ca_state#31, ca_zip#32, ca_country#33] + +(40) BroadcastExchange +Input [5]: [s_store_sk#25, s_store_name#26, s_state#28, ca_state#31, ca_country#33] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], upper(input[4, string, true])),false), [id=#34] + +(41) BroadcastHashJoin [codegen id : 12] +Left keys [2]: [ss_store_sk#3, c_birth_country#18] +Right keys [2]: [s_store_sk#25, upper(ca_country#33)] +Join condition: None + +(42) Project [codegen id : 12] +Output [11]: [ss_net_paid#5, s_store_name#26, s_state#28, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, ca_state#31] +Input [15]: [ss_store_sk#3, ss_net_paid#5, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, c_birth_country#18, s_store_sk#25, s_store_name#26, s_state#28, ca_state#31, ca_country#33] + +(43) HashAggregate [codegen id : 12] +Input [11]: [ss_net_paid#5, s_store_name#26, s_state#28, i_current_price#8, i_size#9, i_color#10, i_units#11, i_manager_id#12, c_first_name#16, c_last_name#17, ca_state#31] +Keys [10]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum#35] +Results [11]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] + +(44) Exchange +Input [11]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] +Arguments: hashpartitioning(c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, 5), ENSURE_REQUIREMENTS, [id=#37] + +(45) HashAggregate [codegen id : 13] +Input [11]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9, sum#36] +Keys [10]: [c_last_name#17, c_first_name#16, s_store_name#26, ca_state#31, s_state#28, i_color#10, i_current_price#8, i_manager_id#12, i_units#11, i_size#9] +Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#38] +Results [4]: [c_last_name#17, c_first_name#16, s_store_name#26, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#38,17,2) AS netpaid#39] + +(46) HashAggregate [codegen id : 13] +Input [4]: [c_last_name#17, c_first_name#16, s_store_name#26, netpaid#39] +Keys [3]: [c_last_name#17, c_first_name#16, s_store_name#26] +Functions [1]: [partial_sum(netpaid#39)] +Aggregate Attributes [2]: [sum#40, isEmpty#41] +Results [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum#42, isEmpty#43] + +(47) Exchange +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum#42, isEmpty#43] +Arguments: hashpartitioning(c_last_name#17, c_first_name#16, s_store_name#26, 5), ENSURE_REQUIREMENTS, [id=#44] + +(48) HashAggregate [codegen id : 14] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum#42, isEmpty#43] +Keys [3]: [c_last_name#17, c_first_name#16, s_store_name#26] +Functions [1]: [sum(netpaid#39)] +Aggregate Attributes [1]: [sum(netpaid#39)#45] +Results [5]: [c_last_name#17, c_first_name#16, s_store_name#26, sum(netpaid#39)#45 AS paid#46, sum(netpaid#39)#45 AS sum(netpaid#39)#47] + +(49) Filter [codegen id : 14] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, paid#46, sum(netpaid#39)#47] +Condition : (isnotnull(sum(netpaid#39)#47) AND (cast(sum(netpaid#39)#47 as decimal(33,8)) > cast(Subquery scalar-subquery#48, [id=#49] as decimal(33,8)))) + +(50) Project [codegen id : 14] +Output [4]: [c_last_name#17, c_first_name#16, s_store_name#26, paid#46] +Input [5]: [c_last_name#17, c_first_name#16, s_store_name#26, paid#46, sum(netpaid#39)#47] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 49 Hosting Expression = Subquery scalar-subquery#48, [id=#49] +* HashAggregate (104) ++- Exchange (103) + +- * HashAggregate (102) + +- * HashAggregate (101) + +- Exchange (100) + +- * HashAggregate (99) + +- * Project (98) + +- * SortMergeJoin Inner (97) + :- * Sort (91) + : +- Exchange (90) + : +- * Project (89) + : +- * SortMergeJoin Inner (88) + : :- * Sort (81) + : : +- Exchange (80) + : : +- * Project (79) + : : +- * SortMergeJoin Inner (78) + : : :- * Sort (72) + : : : +- Exchange (71) + : : : +- * Project (70) + : : : +- * SortMergeJoin Inner (69) + : : : :- * Sort (63) + : : : : +- Exchange (62) + : : : : +- * Project (61) + : : : : +- * BroadcastHashJoin Inner BuildRight (60) + : : : : :- * Project (54) + : : : : : +- * Filter (53) + : : : : : +- * ColumnarToRow (52) + : : : : : +- Scan parquet default.store_sales (51) + : : : : +- BroadcastExchange (59) + : : : : +- * Project (58) + : : : : +- * Filter (57) + : : : : +- * ColumnarToRow (56) + : : : : +- Scan parquet default.store (55) + : : : +- * Sort (68) + : : : +- Exchange (67) + : : : +- * Filter (66) + : : : +- * ColumnarToRow (65) + : : : +- Scan parquet default.item (64) + : : +- * Sort (77) + : : +- Exchange (76) + : : +- * Filter (75) + : : +- * ColumnarToRow (74) + : : +- Scan parquet default.customer (73) + : +- * Sort (87) + : +- Exchange (86) + : +- * Project (85) + : +- * Filter (84) + : +- * ColumnarToRow (83) + : +- Scan parquet default.store_returns (82) + +- * Sort (96) + +- Exchange (95) + +- * Filter (94) + +- * ColumnarToRow (93) + +- Scan parquet default.customer_address (92) + + +(51) Scan parquet default.store_sales +Output [6]: [ss_item_sk#50, ss_customer_sk#51, ss_store_sk#52, ss_ticket_number#53, ss_net_paid#54, ss_sold_date_sk#55] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 2] +Input [6]: [ss_item_sk#50, ss_customer_sk#51, ss_store_sk#52, ss_ticket_number#53, ss_net_paid#54, ss_sold_date_sk#55] + +(53) Filter [codegen id : 2] +Input [6]: [ss_item_sk#50, ss_customer_sk#51, ss_store_sk#52, ss_ticket_number#53, ss_net_paid#54, ss_sold_date_sk#55] +Condition : (((isnotnull(ss_ticket_number#53) AND isnotnull(ss_item_sk#50)) AND isnotnull(ss_store_sk#52)) AND isnotnull(ss_customer_sk#51)) + +(54) Project [codegen id : 2] +Output [5]: [ss_item_sk#50, ss_customer_sk#51, ss_store_sk#52, ss_ticket_number#53, ss_net_paid#54] +Input [6]: [ss_item_sk#50, ss_customer_sk#51, ss_store_sk#52, ss_ticket_number#53, ss_net_paid#54, ss_sold_date_sk#55] + +(55) Scan parquet default.store +Output [5]: [s_store_sk#56, s_store_name#57, s_market_id#58, s_state#59, s_zip#60] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(56) ColumnarToRow [codegen id : 1] +Input [5]: [s_store_sk#56, s_store_name#57, s_market_id#58, s_state#59, s_zip#60] + +(57) Filter [codegen id : 1] +Input [5]: [s_store_sk#56, s_store_name#57, s_market_id#58, s_state#59, s_zip#60] +Condition : (((isnotnull(s_market_id#58) AND (s_market_id#58 = 8)) AND isnotnull(s_store_sk#56)) AND isnotnull(s_zip#60)) + +(58) Project [codegen id : 1] +Output [4]: [s_store_sk#56, s_store_name#57, s_state#59, s_zip#60] +Input [5]: [s_store_sk#56, s_store_name#57, s_market_id#58, s_state#59, s_zip#60] + +(59) BroadcastExchange +Input [4]: [s_store_sk#56, s_store_name#57, s_state#59, s_zip#60] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#61] + +(60) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_store_sk#52] +Right keys [1]: [s_store_sk#56] +Join condition: None + +(61) Project [codegen id : 2] +Output [7]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60] +Input [9]: [ss_item_sk#50, ss_customer_sk#51, ss_store_sk#52, ss_ticket_number#53, ss_net_paid#54, s_store_sk#56, s_store_name#57, s_state#59, s_zip#60] + +(62) Exchange +Input [7]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60] +Arguments: hashpartitioning(ss_item_sk#50, 5), ENSURE_REQUIREMENTS, [id=#62] + +(63) Sort [codegen id : 3] +Input [7]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60] +Arguments: [ss_item_sk#50 ASC NULLS FIRST], false, 0 + +(64) Scan parquet default.item +Output [6]: [i_item_sk#63, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(65) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#63, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] + +(66) Filter [codegen id : 4] +Input [6]: [i_item_sk#63, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Condition : isnotnull(i_item_sk#63) + +(67) Exchange +Input [6]: [i_item_sk#63, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Arguments: hashpartitioning(i_item_sk#63, 5), ENSURE_REQUIREMENTS, [id=#69] + +(68) Sort [codegen id : 5] +Input [6]: [i_item_sk#63, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Arguments: [i_item_sk#63 ASC NULLS FIRST], false, 0 + +(69) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#50] +Right keys [1]: [i_item_sk#63] +Join condition: None + +(70) Project [codegen id : 6] +Output [12]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Input [13]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_item_sk#63, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] + +(71) Exchange +Input [12]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Arguments: hashpartitioning(ss_customer_sk#51, 5), ENSURE_REQUIREMENTS, [id=#70] + +(72) Sort [codegen id : 7] +Input [12]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68] +Arguments: [ss_customer_sk#51 ASC NULLS FIRST], false, 0 + +(73) Scan parquet default.customer +Output [4]: [c_customer_sk#71, c_first_name#72, c_last_name#73, c_birth_country#74] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_birth_country)] +ReadSchema: struct + +(74) ColumnarToRow [codegen id : 8] +Input [4]: [c_customer_sk#71, c_first_name#72, c_last_name#73, c_birth_country#74] + +(75) Filter [codegen id : 8] +Input [4]: [c_customer_sk#71, c_first_name#72, c_last_name#73, c_birth_country#74] +Condition : (isnotnull(c_customer_sk#71) AND isnotnull(c_birth_country#74)) + +(76) Exchange +Input [4]: [c_customer_sk#71, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: hashpartitioning(c_customer_sk#71, 5), ENSURE_REQUIREMENTS, [id=#75] + +(77) Sort [codegen id : 9] +Input [4]: [c_customer_sk#71, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: [c_customer_sk#71 ASC NULLS FIRST], false, 0 + +(78) SortMergeJoin [codegen id : 10] +Left keys [1]: [ss_customer_sk#51] +Right keys [1]: [c_customer_sk#71] +Join condition: None + +(79) Project [codegen id : 10] +Output [14]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Input [16]: [ss_item_sk#50, ss_customer_sk#51, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_customer_sk#71, c_first_name#72, c_last_name#73, c_birth_country#74] + +(80) Exchange +Input [14]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: hashpartitioning(ss_ticket_number#53, ss_item_sk#50, 5), ENSURE_REQUIREMENTS, [id=#76] + +(81) Sort [codegen id : 11] +Input [14]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: [ss_ticket_number#53 ASC NULLS FIRST, ss_item_sk#50 ASC NULLS FIRST], false, 0 + +(82) Scan parquet default.store_returns +Output [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(83) ColumnarToRow [codegen id : 12] +Input [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] + +(84) Filter [codegen id : 12] +Input [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] +Condition : (isnotnull(sr_ticket_number#78) AND isnotnull(sr_item_sk#77)) + +(85) Project [codegen id : 12] +Output [2]: [sr_item_sk#77, sr_ticket_number#78] +Input [3]: [sr_item_sk#77, sr_ticket_number#78, sr_returned_date_sk#79] + +(86) Exchange +Input [2]: [sr_item_sk#77, sr_ticket_number#78] +Arguments: hashpartitioning(sr_ticket_number#78, sr_item_sk#77, 5), ENSURE_REQUIREMENTS, [id=#80] + +(87) Sort [codegen id : 13] +Input [2]: [sr_item_sk#77, sr_ticket_number#78] +Arguments: [sr_ticket_number#78 ASC NULLS FIRST, sr_item_sk#77 ASC NULLS FIRST], false, 0 + +(88) SortMergeJoin [codegen id : 14] +Left keys [2]: [ss_ticket_number#53, ss_item_sk#50] +Right keys [2]: [sr_ticket_number#78, sr_item_sk#77] +Join condition: None + +(89) Project [codegen id : 14] +Output [12]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Input [16]: [ss_item_sk#50, ss_ticket_number#53, ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74, sr_item_sk#77, sr_ticket_number#78] + +(90) Exchange +Input [12]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: hashpartitioning(c_birth_country#74, s_zip#60, 5), ENSURE_REQUIREMENTS, [id=#81] + +(91) Sort [codegen id : 15] +Input [12]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74] +Arguments: [c_birth_country#74 ASC NULLS FIRST, s_zip#60 ASC NULLS FIRST], false, 0 + +(92) Scan parquet default.customer_address +Output [3]: [ca_state#82, ca_zip#83, ca_country#84] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(93) ColumnarToRow [codegen id : 16] +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] + +(94) Filter [codegen id : 16] +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] +Condition : (isnotnull(ca_country#84) AND isnotnull(ca_zip#83)) + +(95) Exchange +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] +Arguments: hashpartitioning(upper(ca_country#84), ca_zip#83, 5), ENSURE_REQUIREMENTS, [id=#85] + +(96) Sort [codegen id : 17] +Input [3]: [ca_state#82, ca_zip#83, ca_country#84] +Arguments: [upper(ca_country#84) ASC NULLS FIRST, ca_zip#83 ASC NULLS FIRST], false, 0 + +(97) SortMergeJoin [codegen id : 18] +Left keys [2]: [c_birth_country#74, s_zip#60] +Right keys [2]: [upper(ca_country#84), ca_zip#83] +Join condition: None + +(98) Project [codegen id : 18] +Output [11]: [ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#82] +Input [15]: [ss_net_paid#54, s_store_name#57, s_state#59, s_zip#60, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, c_birth_country#74, ca_state#82, ca_zip#83, ca_country#84] + +(99) HashAggregate [codegen id : 18] +Input [11]: [ss_net_paid#54, s_store_name#57, s_state#59, i_current_price#64, i_size#65, i_color#66, i_units#67, i_manager_id#68, c_first_name#72, c_last_name#73, ca_state#82] +Keys [10]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#54))] +Aggregate Attributes [1]: [sum#86] +Results [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] + +(100) Exchange +Input [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] +Arguments: hashpartitioning(c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, 5), ENSURE_REQUIREMENTS, [id=#88] + +(101) HashAggregate [codegen id : 19] +Input [11]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65, sum#87] +Keys [10]: [c_last_name#73, c_first_name#72, s_store_name#57, ca_state#82, s_state#59, i_color#66, i_current_price#64, i_manager_id#68, i_units#67, i_size#65] +Functions [1]: [sum(UnscaledValue(ss_net_paid#54))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#54))#89] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#54))#89,17,2) AS netpaid#39] + +(102) HashAggregate [codegen id : 19] +Input [1]: [netpaid#39] +Keys: [] +Functions [1]: [partial_avg(netpaid#39)] +Aggregate Attributes [2]: [sum#90, count#91] +Results [2]: [sum#92, count#93] + +(103) Exchange +Input [2]: [sum#92, count#93] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#94] + +(104) HashAggregate [codegen id : 20] +Input [2]: [sum#92, count#93] +Keys: [] +Functions [1]: [avg(netpaid#39)] +Aggregate Attributes [1]: [avg(netpaid#39)#95] +Results [1]: [CheckOverflow((0.050000 * promote_precision(avg(netpaid#39)#95)), DecimalType(24,8), true) AS (0.05 * avg(netpaid))#96] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt new file mode 100644 index 0000000000000..46fa83fcfed4b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b.sf100/simplified.txt @@ -0,0 +1,183 @@ +WholeStageCodegen (14) + Project [c_last_name,c_first_name,s_store_name,paid] + Filter [sum(netpaid)] + Subquery #1 + WholeStageCodegen (20) + HashAggregate [sum,count] [avg(netpaid),(0.05 * avg(netpaid)),sum,count] + InputAdapter + Exchange #10 + WholeStageCodegen (19) + HashAggregate [netpaid] [sum,count,sum,count] + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #11 + WholeStageCodegen (18) + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] + Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + SortMergeJoin [c_birth_country,s_zip,ca_country,ca_zip] + InputAdapter + WholeStageCodegen (15) + Sort [c_birth_country,s_zip] + InputAdapter + Exchange [c_birth_country,s_zip] #12 + WholeStageCodegen (14) + Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #13 + WholeStageCodegen (10) + Project [ss_item_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (7) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #14 + WholeStageCodegen (6) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #15 + WholeStageCodegen (2) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_paid,s_store_name,s_state,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk] + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (1) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + InputAdapter + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #17 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + InputAdapter + WholeStageCodegen (9) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #18 + WholeStageCodegen (8) + Filter [c_customer_sk,c_birth_country] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country] + InputAdapter + WholeStageCodegen (13) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #19 + WholeStageCodegen (12) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + WholeStageCodegen (17) + Sort [ca_country,ca_zip] + InputAdapter + Exchange [ca_country,ca_zip] #20 + WholeStageCodegen (16) + Filter [ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_state,ca_zip,ca_country] + HashAggregate [c_last_name,c_first_name,s_store_name,sum,isEmpty] [sum(netpaid),paid,sum(netpaid),sum,isEmpty] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name] #1 + WholeStageCodegen (13) + HashAggregate [c_last_name,c_first_name,s_store_name,netpaid] [sum,isEmpty,sum,isEmpty] + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #2 + WholeStageCodegen (12) + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] + Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + BroadcastHashJoin [ss_store_sk,c_birth_country,s_store_sk,ca_country] + Project [ss_store_sk,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (7) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #3 + WholeStageCodegen (6) + Project [ss_item_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #4 + WholeStageCodegen (2) + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Filter [i_color,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #6 + WholeStageCodegen (4) + Filter [c_customer_sk,c_birth_country] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country] + InputAdapter + WholeStageCodegen (9) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #7 + WholeStageCodegen (8) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (11) + Project [s_store_sk,s_store_name,s_state,ca_state,ca_country] + BroadcastHashJoin [s_zip,ca_zip] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (10) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + Filter [ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_state,ca_zip,ca_country] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/explain.txt new file mode 100644 index 0000000000000..2b6c25252d1df --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/explain.txt @@ -0,0 +1,527 @@ +== Physical Plan == +* Project (47) ++- * Filter (46) + +- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * HashAggregate (42) + +- Exchange (41) + +- * HashAggregate (40) + +- * Project (39) + +- * BroadcastHashJoin Inner BuildRight (38) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Project (27) + : : +- * BroadcastHashJoin Inner BuildRight (26) + : : :- * Project (21) + : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : :- * Project (14) + : : : : +- * SortMergeJoin Inner (13) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- * Sort (12) + : : : : +- Exchange (11) + : : : : +- * Project (10) + : : : : +- * Filter (9) + : : : : +- * ColumnarToRow (8) + : : : : +- Scan parquet default.store_returns (7) + : : : +- BroadcastExchange (19) + : : : +- * Project (18) + : : : +- * Filter (17) + : : : +- * ColumnarToRow (16) + : : : +- Scan parquet default.store (15) + : : +- BroadcastExchange (25) + : : +- * Filter (24) + : : +- * ColumnarToRow (23) + : : +- Scan parquet default.item (22) + : +- BroadcastExchange (31) + : +- * Filter (30) + : +- * ColumnarToRow (29) + : +- Scan parquet default.customer (28) + +- BroadcastExchange (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.customer_address (34) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 1] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) + +(4) Project [codegen id : 1] +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] + +(5) Exchange +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#7] + +(6) Sort [codegen id : 2] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Arguments: [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(7) Scan parquet default.store_returns +Output [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 3] +Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] + +(9) Filter [codegen id : 3] +Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] +Condition : (isnotnull(sr_ticket_number#9) AND isnotnull(sr_item_sk#8)) + +(10) Project [codegen id : 3] +Output [2]: [sr_item_sk#8, sr_ticket_number#9] +Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] + +(11) Exchange +Input [2]: [sr_item_sk#8, sr_ticket_number#9] +Arguments: hashpartitioning(sr_ticket_number#9, sr_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#11] + +(12) Sort [codegen id : 4] +Input [2]: [sr_item_sk#8, sr_ticket_number#9] +Arguments: [sr_ticket_number#9 ASC NULLS FIRST, sr_item_sk#8 ASC NULLS FIRST], false, 0 + +(13) SortMergeJoin [codegen id : 9] +Left keys [2]: [ss_ticket_number#4, ss_item_sk#1] +Right keys [2]: [sr_ticket_number#9, sr_item_sk#8] +Join condition: None + +(14) Project [codegen id : 9] +Output [4]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, sr_item_sk#8, sr_ticket_number#9] + +(15) Scan parquet default.store +Output [5]: [s_store_sk#12, s_store_name#13, s_market_id#14, s_state#15, s_zip#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 5] +Input [5]: [s_store_sk#12, s_store_name#13, s_market_id#14, s_state#15, s_zip#16] + +(17) Filter [codegen id : 5] +Input [5]: [s_store_sk#12, s_store_name#13, s_market_id#14, s_state#15, s_zip#16] +Condition : (((isnotnull(s_market_id#14) AND (s_market_id#14 = 8)) AND isnotnull(s_store_sk#12)) AND isnotnull(s_zip#16)) + +(18) Project [codegen id : 5] +Output [4]: [s_store_sk#12, s_store_name#13, s_state#15, s_zip#16] +Input [5]: [s_store_sk#12, s_store_name#13, s_market_id#14, s_state#15, s_zip#16] + +(19) BroadcastExchange +Input [4]: [s_store_sk#12, s_store_name#13, s_state#15, s_zip#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(20) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#12] +Join condition: None + +(21) Project [codegen id : 9] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16] +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5, s_store_sk#12, s_store_name#13, s_state#15, s_zip#16] + +(22) Scan parquet default.item +Output [6]: [i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_color), EqualTo(i_color,chiffon ), IsNotNull(i_item_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 6] +Input [6]: [i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] + +(24) Filter [codegen id : 6] +Input [6]: [i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] +Condition : ((isnotnull(i_color#21) AND (i_color#21 = chiffon )) AND isnotnull(i_item_sk#18)) + +(25) BroadcastExchange +Input [6]: [i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(26) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#18] +Join condition: None + +(27) Project [codegen id : 9] +Output [10]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] + +(28) Scan parquet default.customer +Output [4]: [c_customer_sk#25, c_first_name#26, c_last_name#27, c_birth_country#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_birth_country)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 7] +Input [4]: [c_customer_sk#25, c_first_name#26, c_last_name#27, c_birth_country#28] + +(30) Filter [codegen id : 7] +Input [4]: [c_customer_sk#25, c_first_name#26, c_last_name#27, c_birth_country#28] +Condition : (isnotnull(c_customer_sk#25) AND isnotnull(c_birth_country#28)) + +(31) BroadcastExchange +Input [4]: [c_customer_sk#25, c_first_name#26, c_last_name#27, c_birth_country#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(32) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#25] +Join condition: None + +(33) Project [codegen id : 9] +Output [12]: [ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_first_name#26, c_last_name#27, c_birth_country#28] +Input [14]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_customer_sk#25, c_first_name#26, c_last_name#27, c_birth_country#28] + +(34) Scan parquet default.customer_address +Output [3]: [ca_state#30, ca_zip#31, ca_country#32] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 8] +Input [3]: [ca_state#30, ca_zip#31, ca_country#32] + +(36) Filter [codegen id : 8] +Input [3]: [ca_state#30, ca_zip#31, ca_country#32] +Condition : (isnotnull(ca_country#32) AND isnotnull(ca_zip#31)) + +(37) BroadcastExchange +Input [3]: [ca_state#30, ca_zip#31, ca_country#32] +Arguments: HashedRelationBroadcastMode(List(upper(input[2, string, false]), input[1, string, false]),false), [id=#33] + +(38) BroadcastHashJoin [codegen id : 9] +Left keys [2]: [c_birth_country#28, s_zip#16] +Right keys [2]: [upper(ca_country#32), ca_zip#31] +Join condition: None + +(39) Project [codegen id : 9] +Output [11]: [ss_net_paid#5, s_store_name#13, s_state#15, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_first_name#26, c_last_name#27, ca_state#30] +Input [15]: [ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_first_name#26, c_last_name#27, c_birth_country#28, ca_state#30, ca_zip#31, ca_country#32] + +(40) HashAggregate [codegen id : 9] +Input [11]: [ss_net_paid#5, s_store_name#13, s_state#15, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_first_name#26, c_last_name#27, ca_state#30] +Keys [10]: [c_last_name#27, c_first_name#26, s_store_name#13, ca_state#30, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum#34] +Results [11]: [c_last_name#27, c_first_name#26, s_store_name#13, ca_state#30, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20, sum#35] + +(41) Exchange +Input [11]: [c_last_name#27, c_first_name#26, s_store_name#13, ca_state#30, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20, sum#35] +Arguments: hashpartitioning(c_last_name#27, c_first_name#26, s_store_name#13, ca_state#30, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20, 5), ENSURE_REQUIREMENTS, [id=#36] + +(42) HashAggregate [codegen id : 10] +Input [11]: [c_last_name#27, c_first_name#26, s_store_name#13, ca_state#30, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20, sum#35] +Keys [10]: [c_last_name#27, c_first_name#26, s_store_name#13, ca_state#30, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20] +Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#37] +Results [4]: [c_last_name#27, c_first_name#26, s_store_name#13, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#37,17,2) AS netpaid#38] + +(43) HashAggregate [codegen id : 10] +Input [4]: [c_last_name#27, c_first_name#26, s_store_name#13, netpaid#38] +Keys [3]: [c_last_name#27, c_first_name#26, s_store_name#13] +Functions [1]: [partial_sum(netpaid#38)] +Aggregate Attributes [2]: [sum#39, isEmpty#40] +Results [5]: [c_last_name#27, c_first_name#26, s_store_name#13, sum#41, isEmpty#42] + +(44) Exchange +Input [5]: [c_last_name#27, c_first_name#26, s_store_name#13, sum#41, isEmpty#42] +Arguments: hashpartitioning(c_last_name#27, c_first_name#26, s_store_name#13, 5), ENSURE_REQUIREMENTS, [id=#43] + +(45) HashAggregate [codegen id : 11] +Input [5]: [c_last_name#27, c_first_name#26, s_store_name#13, sum#41, isEmpty#42] +Keys [3]: [c_last_name#27, c_first_name#26, s_store_name#13] +Functions [1]: [sum(netpaid#38)] +Aggregate Attributes [1]: [sum(netpaid#38)#44] +Results [5]: [c_last_name#27, c_first_name#26, s_store_name#13, sum(netpaid#38)#44 AS paid#45, sum(netpaid#38)#44 AS sum(netpaid#38)#46] + +(46) Filter [codegen id : 11] +Input [5]: [c_last_name#27, c_first_name#26, s_store_name#13, paid#45, sum(netpaid#38)#46] +Condition : (isnotnull(sum(netpaid#38)#46) AND (cast(sum(netpaid#38)#46 as decimal(33,8)) > cast(Subquery scalar-subquery#47, [id=#48] as decimal(33,8)))) + +(47) Project [codegen id : 11] +Output [4]: [c_last_name#27, c_first_name#26, s_store_name#13, paid#45] +Input [5]: [c_last_name#27, c_first_name#26, s_store_name#13, paid#45, sum(netpaid#38)#46] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 46 Hosting Expression = Subquery scalar-subquery#47, [id=#48] +* HashAggregate (92) ++- Exchange (91) + +- * HashAggregate (90) + +- * HashAggregate (89) + +- Exchange (88) + +- * HashAggregate (87) + +- * Project (86) + +- * BroadcastHashJoin Inner BuildRight (85) + :- * Project (80) + : +- * BroadcastHashJoin Inner BuildRight (79) + : :- * Project (74) + : : +- * BroadcastHashJoin Inner BuildRight (73) + : : :- * Project (68) + : : : +- * BroadcastHashJoin Inner BuildRight (67) + : : : :- * Project (61) + : : : : +- * SortMergeJoin Inner (60) + : : : : :- * Sort (53) + : : : : : +- Exchange (52) + : : : : : +- * Project (51) + : : : : : +- * Filter (50) + : : : : : +- * ColumnarToRow (49) + : : : : : +- Scan parquet default.store_sales (48) + : : : : +- * Sort (59) + : : : : +- Exchange (58) + : : : : +- * Project (57) + : : : : +- * Filter (56) + : : : : +- * ColumnarToRow (55) + : : : : +- Scan parquet default.store_returns (54) + : : : +- BroadcastExchange (66) + : : : +- * Project (65) + : : : +- * Filter (64) + : : : +- * ColumnarToRow (63) + : : : +- Scan parquet default.store (62) + : : +- BroadcastExchange (72) + : : +- * Filter (71) + : : +- * ColumnarToRow (70) + : : +- Scan parquet default.item (69) + : +- BroadcastExchange (78) + : +- * Filter (77) + : +- * ColumnarToRow (76) + : +- Scan parquet default.customer (75) + +- BroadcastExchange (84) + +- * Filter (83) + +- * ColumnarToRow (82) + +- Scan parquet default.customer_address (81) + + +(48) Scan parquet default.store_sales +Output [6]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53, ss_sold_date_sk#54] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 1] +Input [6]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53, ss_sold_date_sk#54] + +(50) Filter [codegen id : 1] +Input [6]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53, ss_sold_date_sk#54] +Condition : (((isnotnull(ss_ticket_number#52) AND isnotnull(ss_item_sk#49)) AND isnotnull(ss_store_sk#51)) AND isnotnull(ss_customer_sk#50)) + +(51) Project [codegen id : 1] +Output [5]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53] +Input [6]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53, ss_sold_date_sk#54] + +(52) Exchange +Input [5]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53] +Arguments: hashpartitioning(ss_ticket_number#52, ss_item_sk#49, 5), ENSURE_REQUIREMENTS, [id=#55] + +(53) Sort [codegen id : 2] +Input [5]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53] +Arguments: [ss_ticket_number#52 ASC NULLS FIRST, ss_item_sk#49 ASC NULLS FIRST], false, 0 + +(54) Scan parquet default.store_returns +Output [3]: [sr_item_sk#56, sr_ticket_number#57, sr_returned_date_sk#58] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 3] +Input [3]: [sr_item_sk#56, sr_ticket_number#57, sr_returned_date_sk#58] + +(56) Filter [codegen id : 3] +Input [3]: [sr_item_sk#56, sr_ticket_number#57, sr_returned_date_sk#58] +Condition : (isnotnull(sr_ticket_number#57) AND isnotnull(sr_item_sk#56)) + +(57) Project [codegen id : 3] +Output [2]: [sr_item_sk#56, sr_ticket_number#57] +Input [3]: [sr_item_sk#56, sr_ticket_number#57, sr_returned_date_sk#58] + +(58) Exchange +Input [2]: [sr_item_sk#56, sr_ticket_number#57] +Arguments: hashpartitioning(sr_ticket_number#57, sr_item_sk#56, 5), ENSURE_REQUIREMENTS, [id=#59] + +(59) Sort [codegen id : 4] +Input [2]: [sr_item_sk#56, sr_ticket_number#57] +Arguments: [sr_ticket_number#57 ASC NULLS FIRST, sr_item_sk#56 ASC NULLS FIRST], false, 0 + +(60) SortMergeJoin [codegen id : 9] +Left keys [2]: [ss_ticket_number#52, ss_item_sk#49] +Right keys [2]: [sr_ticket_number#57, sr_item_sk#56] +Join condition: None + +(61) Project [codegen id : 9] +Output [4]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_net_paid#53] +Input [7]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_ticket_number#52, ss_net_paid#53, sr_item_sk#56, sr_ticket_number#57] + +(62) Scan parquet default.store +Output [5]: [s_store_sk#60, s_store_name#61, s_market_id#62, s_state#63, s_zip#64] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(63) ColumnarToRow [codegen id : 5] +Input [5]: [s_store_sk#60, s_store_name#61, s_market_id#62, s_state#63, s_zip#64] + +(64) Filter [codegen id : 5] +Input [5]: [s_store_sk#60, s_store_name#61, s_market_id#62, s_state#63, s_zip#64] +Condition : (((isnotnull(s_market_id#62) AND (s_market_id#62 = 8)) AND isnotnull(s_store_sk#60)) AND isnotnull(s_zip#64)) + +(65) Project [codegen id : 5] +Output [4]: [s_store_sk#60, s_store_name#61, s_state#63, s_zip#64] +Input [5]: [s_store_sk#60, s_store_name#61, s_market_id#62, s_state#63, s_zip#64] + +(66) BroadcastExchange +Input [4]: [s_store_sk#60, s_store_name#61, s_state#63, s_zip#64] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#65] + +(67) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#51] +Right keys [1]: [s_store_sk#60] +Join condition: None + +(68) Project [codegen id : 9] +Output [6]: [ss_item_sk#49, ss_customer_sk#50, ss_net_paid#53, s_store_name#61, s_state#63, s_zip#64] +Input [8]: [ss_item_sk#49, ss_customer_sk#50, ss_store_sk#51, ss_net_paid#53, s_store_sk#60, s_store_name#61, s_state#63, s_zip#64] + +(69) Scan parquet default.item +Output [6]: [i_item_sk#66, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(70) ColumnarToRow [codegen id : 6] +Input [6]: [i_item_sk#66, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71] + +(71) Filter [codegen id : 6] +Input [6]: [i_item_sk#66, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71] +Condition : isnotnull(i_item_sk#66) + +(72) BroadcastExchange +Input [6]: [i_item_sk#66, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#72] + +(73) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#49] +Right keys [1]: [i_item_sk#66] +Join condition: None + +(74) Project [codegen id : 9] +Output [10]: [ss_customer_sk#50, ss_net_paid#53, s_store_name#61, s_state#63, s_zip#64, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71] +Input [12]: [ss_item_sk#49, ss_customer_sk#50, ss_net_paid#53, s_store_name#61, s_state#63, s_zip#64, i_item_sk#66, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71] + +(75) Scan parquet default.customer +Output [4]: [c_customer_sk#73, c_first_name#74, c_last_name#75, c_birth_country#76] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_birth_country)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 7] +Input [4]: [c_customer_sk#73, c_first_name#74, c_last_name#75, c_birth_country#76] + +(77) Filter [codegen id : 7] +Input [4]: [c_customer_sk#73, c_first_name#74, c_last_name#75, c_birth_country#76] +Condition : (isnotnull(c_customer_sk#73) AND isnotnull(c_birth_country#76)) + +(78) BroadcastExchange +Input [4]: [c_customer_sk#73, c_first_name#74, c_last_name#75, c_birth_country#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#77] + +(79) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_customer_sk#50] +Right keys [1]: [c_customer_sk#73] +Join condition: None + +(80) Project [codegen id : 9] +Output [12]: [ss_net_paid#53, s_store_name#61, s_state#63, s_zip#64, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71, c_first_name#74, c_last_name#75, c_birth_country#76] +Input [14]: [ss_customer_sk#50, ss_net_paid#53, s_store_name#61, s_state#63, s_zip#64, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71, c_customer_sk#73, c_first_name#74, c_last_name#75, c_birth_country#76] + +(81) Scan parquet default.customer_address +Output [3]: [ca_state#78, ca_zip#79, ca_country#80] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(82) ColumnarToRow [codegen id : 8] +Input [3]: [ca_state#78, ca_zip#79, ca_country#80] + +(83) Filter [codegen id : 8] +Input [3]: [ca_state#78, ca_zip#79, ca_country#80] +Condition : (isnotnull(ca_country#80) AND isnotnull(ca_zip#79)) + +(84) BroadcastExchange +Input [3]: [ca_state#78, ca_zip#79, ca_country#80] +Arguments: HashedRelationBroadcastMode(List(upper(input[2, string, false]), input[1, string, false]),false), [id=#81] + +(85) BroadcastHashJoin [codegen id : 9] +Left keys [2]: [c_birth_country#76, s_zip#64] +Right keys [2]: [upper(ca_country#80), ca_zip#79] +Join condition: None + +(86) Project [codegen id : 9] +Output [11]: [ss_net_paid#53, s_store_name#61, s_state#63, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71, c_first_name#74, c_last_name#75, ca_state#78] +Input [15]: [ss_net_paid#53, s_store_name#61, s_state#63, s_zip#64, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71, c_first_name#74, c_last_name#75, c_birth_country#76, ca_state#78, ca_zip#79, ca_country#80] + +(87) HashAggregate [codegen id : 9] +Input [11]: [ss_net_paid#53, s_store_name#61, s_state#63, i_current_price#67, i_size#68, i_color#69, i_units#70, i_manager_id#71, c_first_name#74, c_last_name#75, ca_state#78] +Keys [10]: [c_last_name#75, c_first_name#74, s_store_name#61, ca_state#78, s_state#63, i_color#69, i_current_price#67, i_manager_id#71, i_units#70, i_size#68] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#53))] +Aggregate Attributes [1]: [sum#82] +Results [11]: [c_last_name#75, c_first_name#74, s_store_name#61, ca_state#78, s_state#63, i_color#69, i_current_price#67, i_manager_id#71, i_units#70, i_size#68, sum#83] + +(88) Exchange +Input [11]: [c_last_name#75, c_first_name#74, s_store_name#61, ca_state#78, s_state#63, i_color#69, i_current_price#67, i_manager_id#71, i_units#70, i_size#68, sum#83] +Arguments: hashpartitioning(c_last_name#75, c_first_name#74, s_store_name#61, ca_state#78, s_state#63, i_color#69, i_current_price#67, i_manager_id#71, i_units#70, i_size#68, 5), ENSURE_REQUIREMENTS, [id=#84] + +(89) HashAggregate [codegen id : 10] +Input [11]: [c_last_name#75, c_first_name#74, s_store_name#61, ca_state#78, s_state#63, i_color#69, i_current_price#67, i_manager_id#71, i_units#70, i_size#68, sum#83] +Keys [10]: [c_last_name#75, c_first_name#74, s_store_name#61, ca_state#78, s_state#63, i_color#69, i_current_price#67, i_manager_id#71, i_units#70, i_size#68] +Functions [1]: [sum(UnscaledValue(ss_net_paid#53))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#53))#85] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#53))#85,17,2) AS netpaid#38] + +(90) HashAggregate [codegen id : 10] +Input [1]: [netpaid#38] +Keys: [] +Functions [1]: [partial_avg(netpaid#38)] +Aggregate Attributes [2]: [sum#86, count#87] +Results [2]: [sum#88, count#89] + +(91) Exchange +Input [2]: [sum#88, count#89] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#90] + +(92) HashAggregate [codegen id : 11] +Input [2]: [sum#88, count#89] +Keys: [] +Functions [1]: [avg(netpaid#38)] +Aggregate Attributes [1]: [avg(netpaid#38)#91] +Results [1]: [CheckOverflow((0.050000 * promote_precision(avg(netpaid#38)#91)), DecimalType(24,8), true) AS (0.05 * avg(netpaid))#92] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/simplified.txt new file mode 100644 index 0000000000000..6d50a1e3f35a0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q24b/simplified.txt @@ -0,0 +1,147 @@ +WholeStageCodegen (11) + Project [c_last_name,c_first_name,s_store_name,paid] + Filter [sum(netpaid)] + Subquery #1 + WholeStageCodegen (11) + HashAggregate [sum,count] [avg(netpaid),(0.05 * avg(netpaid)),sum,count] + InputAdapter + Exchange #9 + WholeStageCodegen (10) + HashAggregate [netpaid] [sum,count,sum,count] + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #10 + WholeStageCodegen (9) + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] + Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + BroadcastHashJoin [c_birth_country,s_zip,ca_country,ca_zip] + Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_net_paid] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #11 + WholeStageCodegen (1) + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk] + InputAdapter + WholeStageCodegen (4) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #12 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (5) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (6) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (7) + Filter [c_customer_sk,c_birth_country] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country] + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (8) + Filter [ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_state,ca_zip,ca_country] + HashAggregate [c_last_name,c_first_name,s_store_name,sum,isEmpty] [sum(netpaid),paid,sum(netpaid),sum,isEmpty] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name] #1 + WholeStageCodegen (10) + HashAggregate [c_last_name,c_first_name,s_store_name,netpaid] [sum,isEmpty,sum,isEmpty] + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #2 + WholeStageCodegen (9) + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] + Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + BroadcastHashJoin [c_birth_country,s_zip,ca_country,ca_zip] + Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,c_birth_country] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_net_paid] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #3 + WholeStageCodegen (1) + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk] + InputAdapter + WholeStageCodegen (4) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #4 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (5) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Filter [i_color,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (7) + Filter [c_customer_sk,c_birth_country] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name,c_birth_country] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (8) + Filter [ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_state,ca_zip,ca_country] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/explain.txt new file mode 100644 index 0000000000000..60be358241b9e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/explain.txt @@ -0,0 +1,336 @@ +== Physical Plan == +TakeOrderedAndProject (57) ++- * HashAggregate (56) + +- Exchange (55) + +- * HashAggregate (54) + +- * Project (53) + +- * SortMergeJoin Inner (52) + :- * Sort (43) + : +- Exchange (42) + : +- * Project (41) + : +- * SortMergeJoin Inner (40) + : :- * Sort (27) + : : +- Exchange (26) + : : +- * Project (25) + : : +- * SortMergeJoin Inner (24) + : : :- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.store (11) + : : +- * Sort (23) + : : +- Exchange (22) + : : +- * Filter (21) + : : +- * ColumnarToRow (20) + : : +- Scan parquet default.item (19) + : +- * Sort (39) + : +- Exchange (38) + : +- * Project (37) + : +- * BroadcastHashJoin Inner BuildRight (36) + : :- * Filter (30) + : : +- * ColumnarToRow (29) + : : +- Scan parquet default.store_returns (28) + : +- BroadcastExchange (35) + : +- * Project (34) + : +- * Filter (33) + : +- * ColumnarToRow (32) + : +- Scan parquet default.date_dim (31) + +- * Sort (51) + +- Exchange (50) + +- * Project (49) + +- * BroadcastHashJoin Inner BuildRight (48) + :- * Filter (46) + : +- * ColumnarToRow (45) + : +- Scan parquet default.catalog_sales (44) + +- ReusedExchange (47) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 3] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_customer_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_ticket_number#4)) AND isnotnull(ss_store_sk#3)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#8, d_year#9, d_moy#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,4), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] +Condition : ((((isnotnull(d_moy#10) AND isnotnull(d_year#9)) AND (d_moy#10 = 4)) AND (d_year#9 = 2001)) AND isnotnull(d_date_sk#8)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#8] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(8) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(10) Project [codegen id : 3] +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, ss_sold_date_sk#6, d_date_sk#8] + +(11) Scan parquet default.store +Output [3]: [s_store_sk#12, s_store_id#13, s_store_name#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [s_store_sk#12, s_store_id#13, s_store_name#14] + +(13) Filter [codegen id : 2] +Input [3]: [s_store_sk#12, s_store_id#13, s_store_name#14] +Condition : isnotnull(s_store_sk#12) + +(14) BroadcastExchange +Input [3]: [s_store_sk#12, s_store_id#13, s_store_name#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#12] +Join condition: None + +(16) Project [codegen id : 3] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_profit#5, s_store_id#13, s_store_name#14] +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, s_store_sk#12, s_store_id#13, s_store_name#14] + +(17) Exchange +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_profit#5, s_store_id#13, s_store_name#14] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#16] + +(18) Sort [codegen id : 4] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_profit#5, s_store_id#13, s_store_name#14] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.item +Output [3]: [i_item_sk#17, i_item_id#18, i_item_desc#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 5] +Input [3]: [i_item_sk#17, i_item_id#18, i_item_desc#19] + +(21) Filter [codegen id : 5] +Input [3]: [i_item_sk#17, i_item_id#18, i_item_desc#19] +Condition : isnotnull(i_item_sk#17) + +(22) Exchange +Input [3]: [i_item_sk#17, i_item_id#18, i_item_desc#19] +Arguments: hashpartitioning(i_item_sk#17, 5), ENSURE_REQUIREMENTS, [id=#20] + +(23) Sort [codegen id : 6] +Input [3]: [i_item_sk#17, i_item_id#18, i_item_desc#19] +Arguments: [i_item_sk#17 ASC NULLS FIRST], false, 0 + +(24) SortMergeJoin [codegen id : 7] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#17] +Join condition: None + +(25) Project [codegen id : 7] +Output [8]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_profit#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_profit#5, s_store_id#13, s_store_name#14, i_item_sk#17, i_item_id#18, i_item_desc#19] + +(26) Exchange +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_profit#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] +Arguments: hashpartitioning(ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) Sort [codegen id : 8] +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_profit#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 + +(28) Scan parquet default.store_returns +Output [5]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_net_loss#25, sr_returned_date_sk#26] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#26), dynamicpruningexpression(sr_returned_date_sk#26 IN dynamicpruning#27)] +PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 10] +Input [5]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_net_loss#25, sr_returned_date_sk#26] + +(30) Filter [codegen id : 10] +Input [5]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_net_loss#25, sr_returned_date_sk#26] +Condition : ((isnotnull(sr_customer_sk#23) AND isnotnull(sr_item_sk#22)) AND isnotnull(sr_ticket_number#24)) + +(31) Scan parquet default.date_dim +Output [3]: [d_date_sk#28, d_year#29, d_moy#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,10), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 9] +Input [3]: [d_date_sk#28, d_year#29, d_moy#30] + +(33) Filter [codegen id : 9] +Input [3]: [d_date_sk#28, d_year#29, d_moy#30] +Condition : (((((isnotnull(d_moy#30) AND isnotnull(d_year#29)) AND (d_moy#30 >= 4)) AND (d_moy#30 <= 10)) AND (d_year#29 = 2001)) AND isnotnull(d_date_sk#28)) + +(34) Project [codegen id : 9] +Output [1]: [d_date_sk#28] +Input [3]: [d_date_sk#28, d_year#29, d_moy#30] + +(35) BroadcastExchange +Input [1]: [d_date_sk#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#31] + +(36) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [sr_returned_date_sk#26] +Right keys [1]: [d_date_sk#28] +Join condition: None + +(37) Project [codegen id : 10] +Output [4]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_net_loss#25] +Input [6]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_net_loss#25, sr_returned_date_sk#26, d_date_sk#28] + +(38) Exchange +Input [4]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_net_loss#25] +Arguments: hashpartitioning(sr_customer_sk#23, sr_item_sk#22, sr_ticket_number#24, 5), ENSURE_REQUIREMENTS, [id=#32] + +(39) Sort [codegen id : 11] +Input [4]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_net_loss#25] +Arguments: [sr_customer_sk#23 ASC NULLS FIRST, sr_item_sk#22 ASC NULLS FIRST, sr_ticket_number#24 ASC NULLS FIRST], false, 0 + +(40) SortMergeJoin [codegen id : 12] +Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4] +Right keys [3]: [sr_customer_sk#23, sr_item_sk#22, sr_ticket_number#24] +Join condition: None + +(41) Project [codegen id : 12] +Output [8]: [ss_net_profit#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19, sr_item_sk#22, sr_customer_sk#23, sr_net_loss#25] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_net_profit#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_net_loss#25] + +(42) Exchange +Input [8]: [ss_net_profit#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19, sr_item_sk#22, sr_customer_sk#23, sr_net_loss#25] +Arguments: hashpartitioning(sr_customer_sk#23, sr_item_sk#22, 5), ENSURE_REQUIREMENTS, [id=#33] + +(43) Sort [codegen id : 13] +Input [8]: [ss_net_profit#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19, sr_item_sk#22, sr_customer_sk#23, sr_net_loss#25] +Arguments: [sr_customer_sk#23 ASC NULLS FIRST, sr_item_sk#22 ASC NULLS FIRST], false, 0 + +(44) Scan parquet default.catalog_sales +Output [4]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36, cs_sold_date_sk#37] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#37), dynamicpruningexpression(cs_sold_date_sk#37 IN dynamicpruning#27)] +PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(45) ColumnarToRow [codegen id : 15] +Input [4]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36, cs_sold_date_sk#37] + +(46) Filter [codegen id : 15] +Input [4]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36, cs_sold_date_sk#37] +Condition : (isnotnull(cs_bill_customer_sk#34) AND isnotnull(cs_item_sk#35)) + +(47) ReusedExchange [Reuses operator id: 35] +Output [1]: [d_date_sk#38] + +(48) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [cs_sold_date_sk#37] +Right keys [1]: [d_date_sk#38] +Join condition: None + +(49) Project [codegen id : 15] +Output [3]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36] +Input [5]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36, cs_sold_date_sk#37, d_date_sk#38] + +(50) Exchange +Input [3]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36] +Arguments: hashpartitioning(cs_bill_customer_sk#34, cs_item_sk#35, 5), ENSURE_REQUIREMENTS, [id=#39] + +(51) Sort [codegen id : 16] +Input [3]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36] +Arguments: [cs_bill_customer_sk#34 ASC NULLS FIRST, cs_item_sk#35 ASC NULLS FIRST], false, 0 + +(52) SortMergeJoin [codegen id : 17] +Left keys [2]: [sr_customer_sk#23, sr_item_sk#22] +Right keys [2]: [cs_bill_customer_sk#34, cs_item_sk#35] +Join condition: None + +(53) Project [codegen id : 17] +Output [7]: [ss_net_profit#5, sr_net_loss#25, cs_net_profit#36, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] +Input [11]: [ss_net_profit#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19, sr_item_sk#22, sr_customer_sk#23, sr_net_loss#25, cs_bill_customer_sk#34, cs_item_sk#35, cs_net_profit#36] + +(54) HashAggregate [codegen id : 17] +Input [7]: [ss_net_profit#5, sr_net_loss#25, cs_net_profit#36, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] +Keys [4]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14] +Functions [3]: [partial_sum(UnscaledValue(ss_net_profit#5)), partial_sum(UnscaledValue(sr_net_loss#25)), partial_sum(UnscaledValue(cs_net_profit#36))] +Aggregate Attributes [3]: [sum#40, sum#41, sum#42] +Results [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum#43, sum#44, sum#45] + +(55) Exchange +Input [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum#43, sum#44, sum#45] +Arguments: hashpartitioning(i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, 5), ENSURE_REQUIREMENTS, [id=#46] + +(56) HashAggregate [codegen id : 18] +Input [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum#43, sum#44, sum#45] +Keys [4]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14] +Functions [3]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(sr_net_loss#25)), sum(UnscaledValue(cs_net_profit#36))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_net_profit#5))#47, sum(UnscaledValue(sr_net_loss#25))#48, sum(UnscaledValue(cs_net_profit#36))#49] +Results [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#47,17,2) AS store_sales_profit#50, MakeDecimal(sum(UnscaledValue(sr_net_loss#25))#48,17,2) AS store_returns_loss#51, MakeDecimal(sum(UnscaledValue(cs_net_profit#36))#49,17,2) AS catalog_sales_profit#52] + +(57) TakeOrderedAndProject +Input [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, store_sales_profit#50, store_returns_loss#51, catalog_sales_profit#52] +Arguments: 100, [i_item_id#18 ASC NULLS FIRST, i_item_desc#19 ASC NULLS FIRST, s_store_id#13 ASC NULLS FIRST, s_store_name#14 ASC NULLS FIRST], [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, store_sales_profit#50, store_returns_loss#51, catalog_sales_profit#52] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (58) + + +(58) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 28 Hosting Expression = sr_returned_date_sk#26 IN dynamicpruning#27 +ReusedExchange (59) + + +(59) ReusedExchange [Reuses operator id: 35] +Output [1]: [d_date_sk#28] + +Subquery:3 Hosting operator id = 44 Hosting Expression = cs_sold_date_sk#37 IN dynamicpruning#27 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/simplified.txt new file mode 100644 index 0000000000000..5d7e47650d1b5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25.sf100/simplified.txt @@ -0,0 +1,103 @@ +TakeOrderedAndProject [i_item_id,i_item_desc,s_store_id,s_store_name,store_sales_profit,store_returns_loss,catalog_sales_profit] + WholeStageCodegen (18) + HashAggregate [i_item_id,i_item_desc,s_store_id,s_store_name,sum,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(sr_net_loss)),sum(UnscaledValue(cs_net_profit)),store_sales_profit,store_returns_loss,catalog_sales_profit,sum,sum,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,s_store_id,s_store_name] #1 + WholeStageCodegen (17) + HashAggregate [i_item_id,i_item_desc,s_store_id,s_store_name,ss_net_profit,sr_net_loss,cs_net_profit] [sum,sum,sum,sum,sum,sum] + Project [ss_net_profit,sr_net_loss,cs_net_profit,s_store_id,s_store_name,i_item_id,i_item_desc] + SortMergeJoin [sr_customer_sk,sr_item_sk,cs_bill_customer_sk,cs_item_sk] + InputAdapter + WholeStageCodegen (13) + Sort [sr_customer_sk,sr_item_sk] + InputAdapter + Exchange [sr_customer_sk,sr_item_sk] #2 + WholeStageCodegen (12) + Project [ss_net_profit,s_store_id,s_store_name,i_item_id,i_item_desc,sr_item_sk,sr_customer_sk,sr_net_loss] + SortMergeJoin [ss_customer_sk,ss_item_sk,ss_ticket_number,sr_customer_sk,sr_item_sk,sr_ticket_number] + InputAdapter + WholeStageCodegen (8) + Sort [ss_customer_sk,ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_customer_sk,ss_item_sk,ss_ticket_number] #3 + WholeStageCodegen (7) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_profit,s_store_id,s_store_name,i_item_id,i_item_desc] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (3) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_net_profit,s_store_id,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id,s_store_name] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #7 + WholeStageCodegen (5) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc] + InputAdapter + WholeStageCodegen (11) + Sort [sr_customer_sk,sr_item_sk,sr_ticket_number] + InputAdapter + Exchange [sr_customer_sk,sr_item_sk,sr_ticket_number] #8 + WholeStageCodegen (10) + Project [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_net_loss] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_customer_sk,sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_net_loss,sr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (9) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + WholeStageCodegen (16) + Sort [cs_bill_customer_sk,cs_item_sk] + InputAdapter + Exchange [cs_bill_customer_sk,cs_item_sk] #10 + WholeStageCodegen (15) + Project [cs_bill_customer_sk,cs_item_sk,cs_net_profit] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk] #9 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/explain.txt new file mode 100644 index 0000000000000..184dd07f7d950 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/explain.txt @@ -0,0 +1,291 @@ +== Physical Plan == +TakeOrderedAndProject (48) ++- * HashAggregate (47) + +- Exchange (46) + +- * HashAggregate (45) + +- * Project (44) + +- * BroadcastHashJoin Inner BuildRight (43) + :- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Project (32) + : : +- * BroadcastHashJoin Inner BuildRight (31) + : : :- * Project (29) + : : : +- * BroadcastHashJoin Inner BuildRight (28) + : : : :- * Project (22) + : : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : : :- * Project (15) + : : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : : :- * Project (9) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : +- BroadcastExchange (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.store_returns (4) + : : : : : +- BroadcastExchange (13) + : : : : : +- * Filter (12) + : : : : : +- * ColumnarToRow (11) + : : : : : +- Scan parquet default.catalog_sales (10) + : : : : +- BroadcastExchange (20) + : : : : +- * Project (19) + : : : : +- * Filter (18) + : : : : +- * ColumnarToRow (17) + : : : : +- Scan parquet default.date_dim (16) + : : : +- BroadcastExchange (27) + : : : +- * Project (26) + : : : +- * Filter (25) + : : : +- * ColumnarToRow (24) + : : : +- Scan parquet default.date_dim (23) + : : +- ReusedExchange (30) + : +- BroadcastExchange (36) + : +- * Filter (35) + : +- * ColumnarToRow (34) + : +- Scan parquet default.store (33) + +- BroadcastExchange (42) + +- * Filter (41) + +- * ColumnarToRow (40) + +- Scan parquet default.item (39) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 8] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 8] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_customer_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_ticket_number#4)) AND isnotnull(ss_store_sk#3)) + +(4) Scan parquet default.store_returns +Output [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_net_loss#11, sr_returned_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#12), dynamicpruningexpression(sr_returned_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_net_loss#11, sr_returned_date_sk#12] + +(6) Filter [codegen id : 1] +Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_net_loss#11, sr_returned_date_sk#12] +Condition : ((isnotnull(sr_customer_sk#9) AND isnotnull(sr_item_sk#8)) AND isnotnull(sr_ticket_number#10)) + +(7) BroadcastExchange +Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_net_loss#11, sr_returned_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(input[1, int, false], input[0, int, false], input[2, int, false]),false), [id=#14] + +(8) BroadcastHashJoin [codegen id : 8] +Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4] +Right keys [3]: [sr_customer_sk#9, sr_item_sk#8, sr_ticket_number#10] +Join condition: None + +(9) Project [codegen id : 8] +Output [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_net_loss#11, sr_returned_date_sk#12] +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_profit#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_net_loss#11, sr_returned_date_sk#12] + +(10) Scan parquet default.catalog_sales +Output [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_net_profit#17, cs_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_net_profit#17, cs_sold_date_sk#18] + +(12) Filter [codegen id : 2] +Input [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_net_profit#17, cs_sold_date_sk#18] +Condition : (isnotnull(cs_bill_customer_sk#15) AND isnotnull(cs_item_sk#16)) + +(13) BroadcastExchange +Input [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_net_profit#17, cs_sold_date_sk#18] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[1, int, false] as bigint) & 4294967295))),false), [id=#19] + +(14) BroadcastHashJoin [codegen id : 8] +Left keys [2]: [sr_customer_sk#9, sr_item_sk#8] +Right keys [2]: [cs_bill_customer_sk#15, cs_item_sk#16] +Join condition: None + +(15) Project [codegen id : 8] +Output [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, ss_sold_date_sk#6, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#17, cs_sold_date_sk#18] +Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_net_loss#11, sr_returned_date_sk#12, cs_bill_customer_sk#15, cs_item_sk#16, cs_net_profit#17, cs_sold_date_sk#18] + +(16) Scan parquet default.date_dim +Output [3]: [d_date_sk#20, d_year#21, d_moy#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,4), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] + +(18) Filter [codegen id : 3] +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] +Condition : ((((isnotnull(d_moy#22) AND isnotnull(d_year#21)) AND (d_moy#22 = 4)) AND (d_year#21 = 2001)) AND isnotnull(d_date_sk#20)) + +(19) Project [codegen id : 3] +Output [1]: [d_date_sk#20] +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] + +(20) BroadcastExchange +Input [1]: [d_date_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] + +(21) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#20] +Join condition: None + +(22) Project [codegen id : 8] +Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#17, cs_sold_date_sk#18] +Input [9]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, ss_sold_date_sk#6, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#17, cs_sold_date_sk#18, d_date_sk#20] + +(23) Scan parquet default.date_dim +Output [3]: [d_date_sk#24, d_year#25, d_moy#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,10), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [3]: [d_date_sk#24, d_year#25, d_moy#26] + +(25) Filter [codegen id : 4] +Input [3]: [d_date_sk#24, d_year#25, d_moy#26] +Condition : (((((isnotnull(d_moy#26) AND isnotnull(d_year#25)) AND (d_moy#26 >= 4)) AND (d_moy#26 <= 10)) AND (d_year#25 = 2001)) AND isnotnull(d_date_sk#24)) + +(26) Project [codegen id : 4] +Output [1]: [d_date_sk#24] +Input [3]: [d_date_sk#24, d_year#25, d_moy#26] + +(27) BroadcastExchange +Input [1]: [d_date_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] + +(28) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [sr_returned_date_sk#12] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(29) Project [codegen id : 8] +Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, cs_sold_date_sk#18] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, sr_returned_date_sk#12, cs_net_profit#17, cs_sold_date_sk#18, d_date_sk#24] + +(30) ReusedExchange [Reuses operator id: 27] +Output [1]: [d_date_sk#28] + +(31) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#28] +Join condition: None + +(32) Project [codegen id : 8] +Output [5]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17] +Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, cs_sold_date_sk#18, d_date_sk#28] + +(33) Scan parquet default.store +Output [3]: [s_store_sk#29, s_store_id#30, s_store_name#31] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 6] +Input [3]: [s_store_sk#29, s_store_id#30, s_store_name#31] + +(35) Filter [codegen id : 6] +Input [3]: [s_store_sk#29, s_store_id#30, s_store_name#31] +Condition : isnotnull(s_store_sk#29) + +(36) BroadcastExchange +Input [3]: [s_store_sk#29, s_store_id#30, s_store_name#31] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] + +(37) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#29] +Join condition: None + +(38) Project [codegen id : 8] +Output [6]: [ss_item_sk#1, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_id#30, s_store_name#31] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_sk#29, s_store_id#30, s_store_name#31] + +(39) Scan parquet default.item +Output [3]: [i_item_sk#33, i_item_id#34, i_item_desc#35] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 7] +Input [3]: [i_item_sk#33, i_item_id#34, i_item_desc#35] + +(41) Filter [codegen id : 7] +Input [3]: [i_item_sk#33, i_item_id#34, i_item_desc#35] +Condition : isnotnull(i_item_sk#33) + +(42) BroadcastExchange +Input [3]: [i_item_sk#33, i_item_id#34, i_item_desc#35] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#36] + +(43) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#33] +Join condition: None + +(44) Project [codegen id : 8] +Output [7]: [ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_id#30, s_store_name#31, i_item_id#34, i_item_desc#35] +Input [9]: [ss_item_sk#1, ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_id#30, s_store_name#31, i_item_sk#33, i_item_id#34, i_item_desc#35] + +(45) HashAggregate [codegen id : 8] +Input [7]: [ss_net_profit#5, sr_net_loss#11, cs_net_profit#17, s_store_id#30, s_store_name#31, i_item_id#34, i_item_desc#35] +Keys [4]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31] +Functions [3]: [partial_sum(UnscaledValue(ss_net_profit#5)), partial_sum(UnscaledValue(sr_net_loss#11)), partial_sum(UnscaledValue(cs_net_profit#17))] +Aggregate Attributes [3]: [sum#37, sum#38, sum#39] +Results [7]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, sum#40, sum#41, sum#42] + +(46) Exchange +Input [7]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, sum#40, sum#41, sum#42] +Arguments: hashpartitioning(i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, 5), ENSURE_REQUIREMENTS, [id=#43] + +(47) HashAggregate [codegen id : 9] +Input [7]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, sum#40, sum#41, sum#42] +Keys [4]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31] +Functions [3]: [sum(UnscaledValue(ss_net_profit#5)), sum(UnscaledValue(sr_net_loss#11)), sum(UnscaledValue(cs_net_profit#17))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_net_profit#5))#44, sum(UnscaledValue(sr_net_loss#11))#45, sum(UnscaledValue(cs_net_profit#17))#46] +Results [7]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, MakeDecimal(sum(UnscaledValue(ss_net_profit#5))#44,17,2) AS store_sales_profit#47, MakeDecimal(sum(UnscaledValue(sr_net_loss#11))#45,17,2) AS store_returns_loss#48, MakeDecimal(sum(UnscaledValue(cs_net_profit#17))#46,17,2) AS catalog_sales_profit#49] + +(48) TakeOrderedAndProject +Input [7]: [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, store_sales_profit#47, store_returns_loss#48, catalog_sales_profit#49] +Arguments: 100, [i_item_id#34 ASC NULLS FIRST, i_item_desc#35 ASC NULLS FIRST, s_store_id#30 ASC NULLS FIRST, s_store_name#31 ASC NULLS FIRST], [i_item_id#34, i_item_desc#35, s_store_id#30, s_store_name#31, store_sales_profit#47, store_returns_loss#48, catalog_sales_profit#49] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (49) + + +(49) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#20] + +Subquery:2 Hosting operator id = 4 Hosting Expression = sr_returned_date_sk#12 IN dynamicpruning#13 +ReusedExchange (50) + + +(50) ReusedExchange [Reuses operator id: 27] +Output [1]: [d_date_sk#24] + +Subquery:3 Hosting operator id = 10 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#13 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/simplified.txt new file mode 100644 index 0000000000000..6b22b6392eade --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q25/simplified.txt @@ -0,0 +1,76 @@ +TakeOrderedAndProject [i_item_id,i_item_desc,s_store_id,s_store_name,store_sales_profit,store_returns_loss,catalog_sales_profit] + WholeStageCodegen (9) + HashAggregate [i_item_id,i_item_desc,s_store_id,s_store_name,sum,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(sr_net_loss)),sum(UnscaledValue(cs_net_profit)),store_sales_profit,store_returns_loss,catalog_sales_profit,sum,sum,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,s_store_id,s_store_name] #1 + WholeStageCodegen (8) + HashAggregate [i_item_id,i_item_desc,s_store_id,s_store_name,ss_net_profit,sr_net_loss,cs_net_profit] [sum,sum,sum,sum,sum,sum] + Project [ss_net_profit,sr_net_loss,cs_net_profit,s_store_id,s_store_name,i_item_id,i_item_desc] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_net_profit,sr_net_loss,cs_net_profit,s_store_id,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_net_profit,sr_net_loss,cs_net_profit] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_net_profit,sr_net_loss,cs_net_profit,cs_sold_date_sk] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_net_profit,sr_net_loss,sr_returned_date_sk,cs_net_profit,cs_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_net_profit,ss_sold_date_sk,sr_net_loss,sr_returned_date_sk,cs_net_profit,cs_sold_date_sk] + BroadcastHashJoin [sr_customer_sk,sr_item_sk,cs_bill_customer_sk,cs_item_sk] + Project [ss_item_sk,ss_store_sk,ss_net_profit,ss_sold_date_sk,sr_item_sk,sr_customer_sk,sr_net_loss,sr_returned_date_sk] + BroadcastHashJoin [ss_customer_sk,ss_item_sk,ss_ticket_number,sr_customer_sk,sr_item_sk,sr_ticket_number] + Filter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [sr_customer_sk,sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_net_loss,sr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id,s_store_name] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (7) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt new file mode 100644 index 0000000000000..40565dc76a7ba --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/explain.txt @@ -0,0 +1,204 @@ +== Physical Plan == +TakeOrderedAndProject (34) ++- * HashAggregate (33) + +- Exchange (32) + +- * HashAggregate (31) + +- * Project (30) + +- * BroadcastHashJoin Inner BuildRight (29) + :- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer_demographics (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.promotion (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.date_dim (18) + +- BroadcastExchange (28) + +- * Filter (27) + +- * ColumnarToRow (26) + +- Scan parquet default.item (25) + + +(1) Scan parquet default.catalog_sales +Output [8]: [cs_bill_cdemo_sk#1, cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#8), dynamicpruningexpression(cs_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_item_sk), IsNotNull(cs_promo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [cs_bill_cdemo_sk#1, cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [cs_bill_cdemo_sk#1, cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8] +Condition : ((isnotnull(cs_bill_cdemo_sk#1) AND isnotnull(cs_item_sk#2)) AND isnotnull(cs_promo_sk#3)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Condition : ((((((isnotnull(cd_gender#11) AND isnotnull(cd_marital_status#12)) AND isnotnull(cd_education_status#13)) AND (cd_gender#11 = M)) AND (cd_marital_status#12 = S)) AND (cd_education_status#13 = College )) AND isnotnull(cd_demo_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#10] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(8) BroadcastExchange +Input [1]: [cd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_bill_cdemo_sk#1] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8] +Input [9]: [cs_bill_cdemo_sk#1, cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8, cd_demo_sk#10] + +(11) Scan parquet default.promotion +Output [3]: [p_promo_sk#15, p_channel_email#16, p_channel_event#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [Or(EqualTo(p_channel_email,N),EqualTo(p_channel_event,N)), IsNotNull(p_promo_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [p_promo_sk#15, p_channel_email#16, p_channel_event#17] + +(13) Filter [codegen id : 2] +Input [3]: [p_promo_sk#15, p_channel_email#16, p_channel_event#17] +Condition : (((p_channel_email#16 = N) OR (p_channel_event#17 = N)) AND isnotnull(p_promo_sk#15)) + +(14) Project [codegen id : 2] +Output [1]: [p_promo_sk#15] +Input [3]: [p_promo_sk#15, p_channel_email#16, p_channel_event#17] + +(15) BroadcastExchange +Input [1]: [p_promo_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_promo_sk#3] +Right keys [1]: [p_promo_sk#15] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [cs_item_sk#2, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8] +Input [8]: [cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8, p_promo_sk#15] + +(18) Scan parquet default.date_dim +Output [2]: [d_date_sk#19, d_year#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#19, d_year#20] + +(20) Filter [codegen id : 3] +Input [2]: [d_date_sk#19, d_year#20] +Condition : ((isnotnull(d_year#20) AND (d_year#20 = 2000)) AND isnotnull(d_date_sk#19)) + +(21) Project [codegen id : 3] +Output [1]: [d_date_sk#19] +Input [2]: [d_date_sk#19, d_year#20] + +(22) BroadcastExchange +Input [1]: [d_date_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(23) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_sold_date_sk#8] +Right keys [1]: [d_date_sk#19] +Join condition: None + +(24) Project [codegen id : 5] +Output [5]: [cs_item_sk#2, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7] +Input [7]: [cs_item_sk#2, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8, d_date_sk#19] + +(25) Scan parquet default.item +Output [2]: [i_item_sk#22, i_item_id#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#22, i_item_id#23] + +(27) Filter [codegen id : 4] +Input [2]: [i_item_sk#22, i_item_id#23] +Condition : isnotnull(i_item_sk#22) + +(28) BroadcastExchange +Input [2]: [i_item_sk#22, i_item_id#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(29) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#22] +Join condition: None + +(30) Project [codegen id : 5] +Output [5]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_id#23] +Input [7]: [cs_item_sk#2, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_sk#22, i_item_id#23] + +(31) HashAggregate [codegen id : 5] +Input [5]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_id#23] +Keys [1]: [i_item_id#23] +Functions [4]: [partial_avg(cs_quantity#4), partial_avg(UnscaledValue(cs_list_price#5)), partial_avg(UnscaledValue(cs_coupon_amt#7)), partial_avg(UnscaledValue(cs_sales_price#6))] +Aggregate Attributes [8]: [sum#25, count#26, sum#27, count#28, sum#29, count#30, sum#31, count#32] +Results [9]: [i_item_id#23, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] + +(32) Exchange +Input [9]: [i_item_id#23, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] +Arguments: hashpartitioning(i_item_id#23, 5), ENSURE_REQUIREMENTS, [id=#41] + +(33) HashAggregate [codegen id : 6] +Input [9]: [i_item_id#23, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] +Keys [1]: [i_item_id#23] +Functions [4]: [avg(cs_quantity#4), avg(UnscaledValue(cs_list_price#5)), avg(UnscaledValue(cs_coupon_amt#7)), avg(UnscaledValue(cs_sales_price#6))] +Aggregate Attributes [4]: [avg(cs_quantity#4)#42, avg(UnscaledValue(cs_list_price#5))#43, avg(UnscaledValue(cs_coupon_amt#7))#44, avg(UnscaledValue(cs_sales_price#6))#45] +Results [5]: [i_item_id#23, avg(cs_quantity#4)#42 AS agg1#46, cast((avg(UnscaledValue(cs_list_price#5))#43 / 100.0) as decimal(11,6)) AS agg2#47, cast((avg(UnscaledValue(cs_coupon_amt#7))#44 / 100.0) as decimal(11,6)) AS agg3#48, cast((avg(UnscaledValue(cs_sales_price#6))#45 / 100.0) as decimal(11,6)) AS agg4#49] + +(34) TakeOrderedAndProject +Input [5]: [i_item_id#23, agg1#46, agg2#47, agg3#48, agg4#49] +Arguments: 100, [i_item_id#23 ASC NULLS FIRST], [i_item_id#23, agg1#46, agg2#47, agg3#48, agg4#49] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 22] +Output [1]: [d_date_sk#19] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt new file mode 100644 index 0000000000000..f5af2ee1a4aa4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26.sf100/simplified.txt @@ -0,0 +1,52 @@ +TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] + WholeStageCodegen (6) + HashAggregate [i_item_id,sum,count,sum,count,sum,count,sum,count] [avg(cs_quantity),avg(UnscaledValue(cs_list_price)),avg(UnscaledValue(cs_coupon_amt)),avg(UnscaledValue(cs_sales_price)),agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_sold_date_sk] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_sold_date_sk] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_item_sk,cs_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_cdemo_sk,cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [cd_demo_sk] + Filter [cd_gender,cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [p_promo_sk] + Filter [p_channel_email,p_channel_event,p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk,p_channel_email,p_channel_event] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26/explain.txt new file mode 100644 index 0000000000000..c86f121ad35a9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26/explain.txt @@ -0,0 +1,204 @@ +== Physical Plan == +TakeOrderedAndProject (34) ++- * HashAggregate (33) + +- Exchange (32) + +- * HashAggregate (31) + +- * Project (30) + +- * BroadcastHashJoin Inner BuildRight (29) + :- * Project (23) + : +- * BroadcastHashJoin Inner BuildRight (22) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer_demographics (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.date_dim (11) + : +- BroadcastExchange (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.item (18) + +- BroadcastExchange (28) + +- * Project (27) + +- * Filter (26) + +- * ColumnarToRow (25) + +- Scan parquet default.promotion (24) + + +(1) Scan parquet default.catalog_sales +Output [8]: [cs_bill_cdemo_sk#1, cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#8), dynamicpruningexpression(cs_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_item_sk), IsNotNull(cs_promo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [cs_bill_cdemo_sk#1, cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [cs_bill_cdemo_sk#1, cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8] +Condition : ((isnotnull(cs_bill_cdemo_sk#1) AND isnotnull(cs_item_sk#2)) AND isnotnull(cs_promo_sk#3)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Condition : ((((((isnotnull(cd_gender#11) AND isnotnull(cd_marital_status#12)) AND isnotnull(cd_education_status#13)) AND (cd_gender#11 = M)) AND (cd_marital_status#12 = S)) AND (cd_education_status#13 = College )) AND isnotnull(cd_demo_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#10] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(8) BroadcastExchange +Input [1]: [cd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_bill_cdemo_sk#1] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8] +Input [9]: [cs_bill_cdemo_sk#1, cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8, cd_demo_sk#10] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#15, d_year#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] +Condition : ((isnotnull(d_year#16) AND (d_year#16 = 2000)) AND isnotnull(d_date_sk#15)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#15] +Input [2]: [d_date_sk#15, d_year#16] + +(15) BroadcastExchange +Input [1]: [d_date_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_sold_date_sk#8] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7] +Input [8]: [cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_sold_date_sk#8, d_date_sk#15] + +(18) Scan parquet default.item +Output [2]: [i_item_sk#18, i_item_id#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_sk#18, i_item_id#19] + +(20) Filter [codegen id : 3] +Input [2]: [i_item_sk#18, i_item_id#19] +Condition : isnotnull(i_item_sk#18) + +(21) BroadcastExchange +Input [2]: [i_item_sk#18, i_item_id#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(22) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#18] +Join condition: None + +(23) Project [codegen id : 5] +Output [6]: [cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_id#19] +Input [8]: [cs_item_sk#2, cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_sk#18, i_item_id#19] + +(24) Scan parquet default.promotion +Output [3]: [p_promo_sk#21, p_channel_email#22, p_channel_event#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [Or(EqualTo(p_channel_email,N),EqualTo(p_channel_event,N)), IsNotNull(p_promo_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [3]: [p_promo_sk#21, p_channel_email#22, p_channel_event#23] + +(26) Filter [codegen id : 4] +Input [3]: [p_promo_sk#21, p_channel_email#22, p_channel_event#23] +Condition : (((p_channel_email#22 = N) OR (p_channel_event#23 = N)) AND isnotnull(p_promo_sk#21)) + +(27) Project [codegen id : 4] +Output [1]: [p_promo_sk#21] +Input [3]: [p_promo_sk#21, p_channel_email#22, p_channel_event#23] + +(28) BroadcastExchange +Input [1]: [p_promo_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(29) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_promo_sk#3] +Right keys [1]: [p_promo_sk#21] +Join condition: None + +(30) Project [codegen id : 5] +Output [5]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_id#19] +Input [7]: [cs_promo_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_id#19, p_promo_sk#21] + +(31) HashAggregate [codegen id : 5] +Input [5]: [cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, i_item_id#19] +Keys [1]: [i_item_id#19] +Functions [4]: [partial_avg(cs_quantity#4), partial_avg(UnscaledValue(cs_list_price#5)), partial_avg(UnscaledValue(cs_coupon_amt#7)), partial_avg(UnscaledValue(cs_sales_price#6))] +Aggregate Attributes [8]: [sum#25, count#26, sum#27, count#28, sum#29, count#30, sum#31, count#32] +Results [9]: [i_item_id#19, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] + +(32) Exchange +Input [9]: [i_item_id#19, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] +Arguments: hashpartitioning(i_item_id#19, 5), ENSURE_REQUIREMENTS, [id=#41] + +(33) HashAggregate [codegen id : 6] +Input [9]: [i_item_id#19, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] +Keys [1]: [i_item_id#19] +Functions [4]: [avg(cs_quantity#4), avg(UnscaledValue(cs_list_price#5)), avg(UnscaledValue(cs_coupon_amt#7)), avg(UnscaledValue(cs_sales_price#6))] +Aggregate Attributes [4]: [avg(cs_quantity#4)#42, avg(UnscaledValue(cs_list_price#5))#43, avg(UnscaledValue(cs_coupon_amt#7))#44, avg(UnscaledValue(cs_sales_price#6))#45] +Results [5]: [i_item_id#19, avg(cs_quantity#4)#42 AS agg1#46, cast((avg(UnscaledValue(cs_list_price#5))#43 / 100.0) as decimal(11,6)) AS agg2#47, cast((avg(UnscaledValue(cs_coupon_amt#7))#44 / 100.0) as decimal(11,6)) AS agg3#48, cast((avg(UnscaledValue(cs_sales_price#6))#45 / 100.0) as decimal(11,6)) AS agg4#49] + +(34) TakeOrderedAndProject +Input [5]: [i_item_id#19, agg1#46, agg2#47, agg3#48, agg4#49] +Arguments: 100, [i_item_id#19 ASC NULLS FIRST], [i_item_id#19, agg1#46, agg2#47, agg3#48, agg4#49] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#15] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26/simplified.txt new file mode 100644 index 0000000000000..685ecb9d6370e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q26/simplified.txt @@ -0,0 +1,52 @@ +TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] + WholeStageCodegen (6) + HashAggregate [i_item_id,sum,count,sum,count,sum,count,sum,count] [avg(cs_quantity),avg(UnscaledValue(cs_list_price)),avg(UnscaledValue(cs_coupon_amt)),avg(UnscaledValue(cs_sales_price)),agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,i_item_id] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_sold_date_sk] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_item_sk,cs_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_cdemo_sk,cs_item_sk,cs_promo_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [cd_demo_sk] + Filter [cd_gender,cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Project [p_promo_sk] + Filter [p_channel_email,p_channel_event,p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk,p_channel_email,p_channel_event] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q27.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q27.sf100/explain.txt new file mode 100644 index 0000000000000..8c530f5a37885 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q27.sf100/explain.txt @@ -0,0 +1,204 @@ +== Physical Plan == +TakeOrderedAndProject (34) ++- * HashAggregate (33) + +- Exchange (32) + +- * HashAggregate (31) + +- * Expand (30) + +- * Project (29) + +- * BroadcastHashJoin Inner BuildRight (28) + :- * Project (23) + : +- * BroadcastHashJoin Inner BuildRight (22) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer_demographics (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.date_dim (11) + : +- BroadcastExchange (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.store (18) + +- BroadcastExchange (27) + +- * Filter (26) + +- * ColumnarToRow (25) + +- Scan parquet default.item (24) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_cdemo_sk#2) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Condition : ((((((isnotnull(cd_gender#11) AND isnotnull(cd_marital_status#12)) AND isnotnull(cd_education_status#13)) AND (cd_gender#11 = M)) AND (cd_marital_status#12 = S)) AND (cd_education_status#13 = College )) AND isnotnull(cd_demo_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#10] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(8) BroadcastExchange +Input [1]: [cd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, cd_demo_sk#10] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#15, d_year#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] +Condition : ((isnotnull(d_year#16) AND (d_year#16 = 2002)) AND isnotnull(d_date_sk#15)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#15] +Input [2]: [d_date_sk#15, d_year#16] + +(15) BroadcastExchange +Input [1]: [d_date_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#15] + +(18) Scan parquet default.store +Output [2]: [s_store_sk#18, s_state#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#18, s_state#19] + +(20) Filter [codegen id : 3] +Input [2]: [s_store_sk#18, s_state#19] +Condition : ((isnotnull(s_state#19) AND (s_state#19 = TN)) AND isnotnull(s_store_sk#18)) + +(21) BroadcastExchange +Input [2]: [s_store_sk#18, s_state#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(22) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#18] +Join condition: None + +(23) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#19] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#18, s_state#19] + +(24) Scan parquet default.item +Output [2]: [i_item_sk#21, i_item_id#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#21, i_item_id#22] + +(26) Filter [codegen id : 4] +Input [2]: [i_item_sk#21, i_item_id#22] +Condition : isnotnull(i_item_sk#21) + +(27) BroadcastExchange +Input [2]: [i_item_sk#21, i_item_id#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#21] +Join condition: None + +(29) Project [codegen id : 5] +Output [6]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#22, s_state#19] +Input [8]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#19, i_item_sk#21, i_item_id#22] + +(30) Expand [codegen id : 5] +Input [6]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#22, s_state#19] +Arguments: [List(ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#22, s_state#19, 0), List(ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#22, null, 1), List(ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, null, null, 3)], [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#24, s_state#25, spark_grouping_id#26] + +(31) HashAggregate [codegen id : 5] +Input [7]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#24, s_state#25, spark_grouping_id#26] +Keys [3]: [i_item_id#24, s_state#25, spark_grouping_id#26] +Functions [4]: [partial_avg(ss_quantity#4), partial_avg(UnscaledValue(ss_list_price#5)), partial_avg(UnscaledValue(ss_coupon_amt#7)), partial_avg(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [8]: [sum#27, count#28, sum#29, count#30, sum#31, count#32, sum#33, count#34] +Results [11]: [i_item_id#24, s_state#25, spark_grouping_id#26, sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41, count#42] + +(32) Exchange +Input [11]: [i_item_id#24, s_state#25, spark_grouping_id#26, sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41, count#42] +Arguments: hashpartitioning(i_item_id#24, s_state#25, spark_grouping_id#26, 5), ENSURE_REQUIREMENTS, [id=#43] + +(33) HashAggregate [codegen id : 6] +Input [11]: [i_item_id#24, s_state#25, spark_grouping_id#26, sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41, count#42] +Keys [3]: [i_item_id#24, s_state#25, spark_grouping_id#26] +Functions [4]: [avg(ss_quantity#4), avg(UnscaledValue(ss_list_price#5)), avg(UnscaledValue(ss_coupon_amt#7)), avg(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [4]: [avg(ss_quantity#4)#44, avg(UnscaledValue(ss_list_price#5))#45, avg(UnscaledValue(ss_coupon_amt#7))#46, avg(UnscaledValue(ss_sales_price#6))#47] +Results [7]: [i_item_id#24, s_state#25, cast((shiftright(spark_grouping_id#26, 0) & 1) as tinyint) AS g_state#48, avg(ss_quantity#4)#44 AS agg1#49, cast((avg(UnscaledValue(ss_list_price#5))#45 / 100.0) as decimal(11,6)) AS agg2#50, cast((avg(UnscaledValue(ss_coupon_amt#7))#46 / 100.0) as decimal(11,6)) AS agg3#51, cast((avg(UnscaledValue(ss_sales_price#6))#47 / 100.0) as decimal(11,6)) AS agg4#52] + +(34) TakeOrderedAndProject +Input [7]: [i_item_id#24, s_state#25, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] +Arguments: 100, [i_item_id#24 ASC NULLS FIRST, s_state#25 ASC NULLS FIRST], [i_item_id#24, s_state#25, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#15] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q27.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q27.sf100/simplified.txt new file mode 100644 index 0000000000000..6724eceb18711 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q27.sf100/simplified.txt @@ -0,0 +1,52 @@ +TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] + WholeStageCodegen (6) + HashAggregate [i_item_id,s_state,spark_grouping_id,sum,count,sum,count,sum,count,sum,count] [avg(ss_quantity),avg(UnscaledValue(ss_list_price)),avg(UnscaledValue(ss_coupon_amt)),avg(UnscaledValue(ss_sales_price)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,s_state,spark_grouping_id] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,s_state,spark_grouping_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Expand [ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,i_item_id,s_state] + Project [ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,i_item_id,s_state] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [cd_demo_sk] + Filter [cd_gender,cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q27/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q27/explain.txt new file mode 100644 index 0000000000000..8c530f5a37885 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q27/explain.txt @@ -0,0 +1,204 @@ +== Physical Plan == +TakeOrderedAndProject (34) ++- * HashAggregate (33) + +- Exchange (32) + +- * HashAggregate (31) + +- * Expand (30) + +- * Project (29) + +- * BroadcastHashJoin Inner BuildRight (28) + :- * Project (23) + : +- * BroadcastHashJoin Inner BuildRight (22) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer_demographics (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.date_dim (11) + : +- BroadcastExchange (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.store (18) + +- BroadcastExchange (27) + +- * Filter (26) + +- * ColumnarToRow (25) + +- Scan parquet default.item (24) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_cdemo_sk#2) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Condition : ((((((isnotnull(cd_gender#11) AND isnotnull(cd_marital_status#12)) AND isnotnull(cd_education_status#13)) AND (cd_gender#11 = M)) AND (cd_marital_status#12 = S)) AND (cd_education_status#13 = College )) AND isnotnull(cd_demo_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#10] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(8) BroadcastExchange +Input [1]: [cd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, cd_demo_sk#10] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#15, d_year#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] +Condition : ((isnotnull(d_year#16) AND (d_year#16 = 2002)) AND isnotnull(d_date_sk#15)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#15] +Input [2]: [d_date_sk#15, d_year#16] + +(15) BroadcastExchange +Input [1]: [d_date_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#15] + +(18) Scan parquet default.store +Output [2]: [s_store_sk#18, s_state#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#18, s_state#19] + +(20) Filter [codegen id : 3] +Input [2]: [s_store_sk#18, s_state#19] +Condition : ((isnotnull(s_state#19) AND (s_state#19 = TN)) AND isnotnull(s_store_sk#18)) + +(21) BroadcastExchange +Input [2]: [s_store_sk#18, s_state#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(22) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#18] +Join condition: None + +(23) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#19] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#18, s_state#19] + +(24) Scan parquet default.item +Output [2]: [i_item_sk#21, i_item_id#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#21, i_item_id#22] + +(26) Filter [codegen id : 4] +Input [2]: [i_item_sk#21, i_item_id#22] +Condition : isnotnull(i_item_sk#21) + +(27) BroadcastExchange +Input [2]: [i_item_sk#21, i_item_id#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#21] +Join condition: None + +(29) Project [codegen id : 5] +Output [6]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#22, s_state#19] +Input [8]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#19, i_item_sk#21, i_item_id#22] + +(30) Expand [codegen id : 5] +Input [6]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#22, s_state#19] +Arguments: [List(ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#22, s_state#19, 0), List(ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#22, null, 1), List(ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, null, null, 3)], [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#24, s_state#25, spark_grouping_id#26] + +(31) HashAggregate [codegen id : 5] +Input [7]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#24, s_state#25, spark_grouping_id#26] +Keys [3]: [i_item_id#24, s_state#25, spark_grouping_id#26] +Functions [4]: [partial_avg(ss_quantity#4), partial_avg(UnscaledValue(ss_list_price#5)), partial_avg(UnscaledValue(ss_coupon_amt#7)), partial_avg(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [8]: [sum#27, count#28, sum#29, count#30, sum#31, count#32, sum#33, count#34] +Results [11]: [i_item_id#24, s_state#25, spark_grouping_id#26, sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41, count#42] + +(32) Exchange +Input [11]: [i_item_id#24, s_state#25, spark_grouping_id#26, sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41, count#42] +Arguments: hashpartitioning(i_item_id#24, s_state#25, spark_grouping_id#26, 5), ENSURE_REQUIREMENTS, [id=#43] + +(33) HashAggregate [codegen id : 6] +Input [11]: [i_item_id#24, s_state#25, spark_grouping_id#26, sum#35, count#36, sum#37, count#38, sum#39, count#40, sum#41, count#42] +Keys [3]: [i_item_id#24, s_state#25, spark_grouping_id#26] +Functions [4]: [avg(ss_quantity#4), avg(UnscaledValue(ss_list_price#5)), avg(UnscaledValue(ss_coupon_amt#7)), avg(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [4]: [avg(ss_quantity#4)#44, avg(UnscaledValue(ss_list_price#5))#45, avg(UnscaledValue(ss_coupon_amt#7))#46, avg(UnscaledValue(ss_sales_price#6))#47] +Results [7]: [i_item_id#24, s_state#25, cast((shiftright(spark_grouping_id#26, 0) & 1) as tinyint) AS g_state#48, avg(ss_quantity#4)#44 AS agg1#49, cast((avg(UnscaledValue(ss_list_price#5))#45 / 100.0) as decimal(11,6)) AS agg2#50, cast((avg(UnscaledValue(ss_coupon_amt#7))#46 / 100.0) as decimal(11,6)) AS agg3#51, cast((avg(UnscaledValue(ss_sales_price#6))#47 / 100.0) as decimal(11,6)) AS agg4#52] + +(34) TakeOrderedAndProject +Input [7]: [i_item_id#24, s_state#25, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] +Arguments: 100, [i_item_id#24 ASC NULLS FIRST, s_state#25 ASC NULLS FIRST], [i_item_id#24, s_state#25, g_state#48, agg1#49, agg2#50, agg3#51, agg4#52] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#15] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q27/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q27/simplified.txt new file mode 100644 index 0000000000000..6724eceb18711 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q27/simplified.txt @@ -0,0 +1,52 @@ +TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] + WholeStageCodegen (6) + HashAggregate [i_item_id,s_state,spark_grouping_id,sum,count,sum,count,sum,count,sum,count] [avg(ss_quantity),avg(UnscaledValue(ss_list_price)),avg(UnscaledValue(ss_coupon_amt)),avg(UnscaledValue(ss_sales_price)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,s_state,spark_grouping_id] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,s_state,spark_grouping_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Expand [ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,i_item_id,s_state] + Project [ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,i_item_id,s_state] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [cd_demo_sk] + Filter [cd_gender,cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q28.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q28.sf100/explain.txt new file mode 100644 index 0000000000000..eec45ea549531 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q28.sf100/explain.txt @@ -0,0 +1,432 @@ +== Physical Plan == +* BroadcastNestedLoopJoin Inner BuildRight (70) +:- * BroadcastNestedLoopJoin Inner BuildRight (58) +: :- * BroadcastNestedLoopJoin Inner BuildRight (46) +: : :- * BroadcastNestedLoopJoin Inner BuildRight (34) +: : : :- * BroadcastNestedLoopJoin Inner BuildRight (22) +: : : : :- * HashAggregate (10) +: : : : : +- Exchange (9) +: : : : : +- * HashAggregate (8) +: : : : : +- * HashAggregate (7) +: : : : : +- Exchange (6) +: : : : : +- * HashAggregate (5) +: : : : : +- * Project (4) +: : : : : +- * Filter (3) +: : : : : +- * ColumnarToRow (2) +: : : : : +- Scan parquet default.store_sales (1) +: : : : +- BroadcastExchange (21) +: : : : +- * HashAggregate (20) +: : : : +- Exchange (19) +: : : : +- * HashAggregate (18) +: : : : +- * HashAggregate (17) +: : : : +- Exchange (16) +: : : : +- * HashAggregate (15) +: : : : +- * Project (14) +: : : : +- * Filter (13) +: : : : +- * ColumnarToRow (12) +: : : : +- Scan parquet default.store_sales (11) +: : : +- BroadcastExchange (33) +: : : +- * HashAggregate (32) +: : : +- Exchange (31) +: : : +- * HashAggregate (30) +: : : +- * HashAggregate (29) +: : : +- Exchange (28) +: : : +- * HashAggregate (27) +: : : +- * Project (26) +: : : +- * Filter (25) +: : : +- * ColumnarToRow (24) +: : : +- Scan parquet default.store_sales (23) +: : +- BroadcastExchange (45) +: : +- * HashAggregate (44) +: : +- Exchange (43) +: : +- * HashAggregate (42) +: : +- * HashAggregate (41) +: : +- Exchange (40) +: : +- * HashAggregate (39) +: : +- * Project (38) +: : +- * Filter (37) +: : +- * ColumnarToRow (36) +: : +- Scan parquet default.store_sales (35) +: +- BroadcastExchange (57) +: +- * HashAggregate (56) +: +- Exchange (55) +: +- * HashAggregate (54) +: +- * HashAggregate (53) +: +- Exchange (52) +: +- * HashAggregate (51) +: +- * Project (50) +: +- * Filter (49) +: +- * ColumnarToRow (48) +: +- Scan parquet default.store_sales (47) ++- BroadcastExchange (69) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- * HashAggregate (65) + +- Exchange (64) + +- * HashAggregate (63) + +- * Project (62) + +- * Filter (61) + +- * ColumnarToRow (60) + +- Scan parquet default.store_sales (59) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_quantity#1, ss_wholesale_cost#2, ss_list_price#3, ss_coupon_amt#4, ss_sold_date_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,0), LessThanOrEqual(ss_quantity,5), Or(Or(And(GreaterThanOrEqual(ss_list_price,8.00),LessThanOrEqual(ss_list_price,18.00)),And(GreaterThanOrEqual(ss_coupon_amt,459.00),LessThanOrEqual(ss_coupon_amt,1459.00))),And(GreaterThanOrEqual(ss_wholesale_cost,57.00),LessThanOrEqual(ss_wholesale_cost,77.00)))] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [ss_quantity#1, ss_wholesale_cost#2, ss_list_price#3, ss_coupon_amt#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 1] +Input [5]: [ss_quantity#1, ss_wholesale_cost#2, ss_list_price#3, ss_coupon_amt#4, ss_sold_date_sk#5] +Condition : (((isnotnull(ss_quantity#1) AND (ss_quantity#1 >= 0)) AND (ss_quantity#1 <= 5)) AND ((((ss_list_price#3 >= 8.00) AND (ss_list_price#3 <= 18.00)) OR ((ss_coupon_amt#4 >= 459.00) AND (ss_coupon_amt#4 <= 1459.00))) OR ((ss_wholesale_cost#2 >= 57.00) AND (ss_wholesale_cost#2 <= 77.00)))) + +(4) Project [codegen id : 1] +Output [1]: [ss_list_price#3] +Input [5]: [ss_quantity#1, ss_wholesale_cost#2, ss_list_price#3, ss_coupon_amt#4, ss_sold_date_sk#5] + +(5) HashAggregate [codegen id : 1] +Input [1]: [ss_list_price#3] +Keys [1]: [ss_list_price#3] +Functions [2]: [partial_avg(UnscaledValue(ss_list_price#3)), partial_count(ss_list_price#3)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#3))#6, count(ss_list_price#3)#7] +Results [4]: [ss_list_price#3, sum#8, count#9, count#10] + +(6) Exchange +Input [4]: [ss_list_price#3, sum#8, count#9, count#10] +Arguments: hashpartitioning(ss_list_price#3, 5), ENSURE_REQUIREMENTS, [id=#11] + +(7) HashAggregate [codegen id : 2] +Input [4]: [ss_list_price#3, sum#8, count#9, count#10] +Keys [1]: [ss_list_price#3] +Functions [2]: [merge_avg(UnscaledValue(ss_list_price#3)), merge_count(ss_list_price#3)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#3))#6, count(ss_list_price#3)#7] +Results [4]: [ss_list_price#3, sum#8, count#9, count#10] + +(8) HashAggregate [codegen id : 2] +Input [4]: [ss_list_price#3, sum#8, count#9, count#10] +Keys: [] +Functions [3]: [merge_avg(UnscaledValue(ss_list_price#3)), merge_count(ss_list_price#3), partial_count(distinct ss_list_price#3)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#3))#6, count(ss_list_price#3)#7, count(ss_list_price#3)#12] +Results [4]: [sum#8, count#9, count#10, count#13] + +(9) Exchange +Input [4]: [sum#8, count#9, count#10, count#13] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#14] + +(10) HashAggregate [codegen id : 18] +Input [4]: [sum#8, count#9, count#10, count#13] +Keys: [] +Functions [3]: [avg(UnscaledValue(ss_list_price#3)), count(ss_list_price#3), count(distinct ss_list_price#3)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#3))#6, count(ss_list_price#3)#7, count(ss_list_price#3)#12] +Results [3]: [cast((avg(UnscaledValue(ss_list_price#3))#6 / 100.0) as decimal(11,6)) AS B1_LP#15, count(ss_list_price#3)#7 AS B1_CNT#16, count(ss_list_price#3)#12 AS B1_CNTD#17] + +(11) Scan parquet default.store_sales +Output [5]: [ss_quantity#18, ss_wholesale_cost#19, ss_list_price#20, ss_coupon_amt#21, ss_sold_date_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,6), LessThanOrEqual(ss_quantity,10), Or(Or(And(GreaterThanOrEqual(ss_list_price,90.00),LessThanOrEqual(ss_list_price,100.00)),And(GreaterThanOrEqual(ss_coupon_amt,2323.00),LessThanOrEqual(ss_coupon_amt,3323.00))),And(GreaterThanOrEqual(ss_wholesale_cost,31.00),LessThanOrEqual(ss_wholesale_cost,51.00)))] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 3] +Input [5]: [ss_quantity#18, ss_wholesale_cost#19, ss_list_price#20, ss_coupon_amt#21, ss_sold_date_sk#22] + +(13) Filter [codegen id : 3] +Input [5]: [ss_quantity#18, ss_wholesale_cost#19, ss_list_price#20, ss_coupon_amt#21, ss_sold_date_sk#22] +Condition : (((isnotnull(ss_quantity#18) AND (ss_quantity#18 >= 6)) AND (ss_quantity#18 <= 10)) AND ((((ss_list_price#20 >= 90.00) AND (ss_list_price#20 <= 100.00)) OR ((ss_coupon_amt#21 >= 2323.00) AND (ss_coupon_amt#21 <= 3323.00))) OR ((ss_wholesale_cost#19 >= 31.00) AND (ss_wholesale_cost#19 <= 51.00)))) + +(14) Project [codegen id : 3] +Output [1]: [ss_list_price#20] +Input [5]: [ss_quantity#18, ss_wholesale_cost#19, ss_list_price#20, ss_coupon_amt#21, ss_sold_date_sk#22] + +(15) HashAggregate [codegen id : 3] +Input [1]: [ss_list_price#20] +Keys [1]: [ss_list_price#20] +Functions [2]: [partial_avg(UnscaledValue(ss_list_price#20)), partial_count(ss_list_price#20)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#20))#23, count(ss_list_price#20)#24] +Results [4]: [ss_list_price#20, sum#25, count#26, count#27] + +(16) Exchange +Input [4]: [ss_list_price#20, sum#25, count#26, count#27] +Arguments: hashpartitioning(ss_list_price#20, 5), ENSURE_REQUIREMENTS, [id=#28] + +(17) HashAggregate [codegen id : 4] +Input [4]: [ss_list_price#20, sum#25, count#26, count#27] +Keys [1]: [ss_list_price#20] +Functions [2]: [merge_avg(UnscaledValue(ss_list_price#20)), merge_count(ss_list_price#20)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#20))#23, count(ss_list_price#20)#24] +Results [4]: [ss_list_price#20, sum#25, count#26, count#27] + +(18) HashAggregate [codegen id : 4] +Input [4]: [ss_list_price#20, sum#25, count#26, count#27] +Keys: [] +Functions [3]: [merge_avg(UnscaledValue(ss_list_price#20)), merge_count(ss_list_price#20), partial_count(distinct ss_list_price#20)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#20))#23, count(ss_list_price#20)#24, count(ss_list_price#20)#29] +Results [4]: [sum#25, count#26, count#27, count#30] + +(19) Exchange +Input [4]: [sum#25, count#26, count#27, count#30] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#31] + +(20) HashAggregate [codegen id : 5] +Input [4]: [sum#25, count#26, count#27, count#30] +Keys: [] +Functions [3]: [avg(UnscaledValue(ss_list_price#20)), count(ss_list_price#20), count(distinct ss_list_price#20)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#20))#23, count(ss_list_price#20)#24, count(ss_list_price#20)#29] +Results [3]: [cast((avg(UnscaledValue(ss_list_price#20))#23 / 100.0) as decimal(11,6)) AS B2_LP#32, count(ss_list_price#20)#24 AS B2_CNT#33, count(ss_list_price#20)#29 AS B2_CNTD#34] + +(21) BroadcastExchange +Input [3]: [B2_LP#32, B2_CNT#33, B2_CNTD#34] +Arguments: IdentityBroadcastMode, [id=#35] + +(22) BroadcastNestedLoopJoin [codegen id : 18] +Join condition: None + +(23) Scan parquet default.store_sales +Output [5]: [ss_quantity#36, ss_wholesale_cost#37, ss_list_price#38, ss_coupon_amt#39, ss_sold_date_sk#40] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,11), LessThanOrEqual(ss_quantity,15), Or(Or(And(GreaterThanOrEqual(ss_list_price,142.00),LessThanOrEqual(ss_list_price,152.00)),And(GreaterThanOrEqual(ss_coupon_amt,12214.00),LessThanOrEqual(ss_coupon_amt,13214.00))),And(GreaterThanOrEqual(ss_wholesale_cost,79.00),LessThanOrEqual(ss_wholesale_cost,99.00)))] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 6] +Input [5]: [ss_quantity#36, ss_wholesale_cost#37, ss_list_price#38, ss_coupon_amt#39, ss_sold_date_sk#40] + +(25) Filter [codegen id : 6] +Input [5]: [ss_quantity#36, ss_wholesale_cost#37, ss_list_price#38, ss_coupon_amt#39, ss_sold_date_sk#40] +Condition : (((isnotnull(ss_quantity#36) AND (ss_quantity#36 >= 11)) AND (ss_quantity#36 <= 15)) AND ((((ss_list_price#38 >= 142.00) AND (ss_list_price#38 <= 152.00)) OR ((ss_coupon_amt#39 >= 12214.00) AND (ss_coupon_amt#39 <= 13214.00))) OR ((ss_wholesale_cost#37 >= 79.00) AND (ss_wholesale_cost#37 <= 99.00)))) + +(26) Project [codegen id : 6] +Output [1]: [ss_list_price#38] +Input [5]: [ss_quantity#36, ss_wholesale_cost#37, ss_list_price#38, ss_coupon_amt#39, ss_sold_date_sk#40] + +(27) HashAggregate [codegen id : 6] +Input [1]: [ss_list_price#38] +Keys [1]: [ss_list_price#38] +Functions [2]: [partial_avg(UnscaledValue(ss_list_price#38)), partial_count(ss_list_price#38)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#38))#41, count(ss_list_price#38)#42] +Results [4]: [ss_list_price#38, sum#43, count#44, count#45] + +(28) Exchange +Input [4]: [ss_list_price#38, sum#43, count#44, count#45] +Arguments: hashpartitioning(ss_list_price#38, 5), ENSURE_REQUIREMENTS, [id=#46] + +(29) HashAggregate [codegen id : 7] +Input [4]: [ss_list_price#38, sum#43, count#44, count#45] +Keys [1]: [ss_list_price#38] +Functions [2]: [merge_avg(UnscaledValue(ss_list_price#38)), merge_count(ss_list_price#38)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#38))#41, count(ss_list_price#38)#42] +Results [4]: [ss_list_price#38, sum#43, count#44, count#45] + +(30) HashAggregate [codegen id : 7] +Input [4]: [ss_list_price#38, sum#43, count#44, count#45] +Keys: [] +Functions [3]: [merge_avg(UnscaledValue(ss_list_price#38)), merge_count(ss_list_price#38), partial_count(distinct ss_list_price#38)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#38))#41, count(ss_list_price#38)#42, count(ss_list_price#38)#47] +Results [4]: [sum#43, count#44, count#45, count#48] + +(31) Exchange +Input [4]: [sum#43, count#44, count#45, count#48] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#49] + +(32) HashAggregate [codegen id : 8] +Input [4]: [sum#43, count#44, count#45, count#48] +Keys: [] +Functions [3]: [avg(UnscaledValue(ss_list_price#38)), count(ss_list_price#38), count(distinct ss_list_price#38)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#38))#41, count(ss_list_price#38)#42, count(ss_list_price#38)#47] +Results [3]: [cast((avg(UnscaledValue(ss_list_price#38))#41 / 100.0) as decimal(11,6)) AS B3_LP#50, count(ss_list_price#38)#42 AS B3_CNT#51, count(ss_list_price#38)#47 AS B3_CNTD#52] + +(33) BroadcastExchange +Input [3]: [B3_LP#50, B3_CNT#51, B3_CNTD#52] +Arguments: IdentityBroadcastMode, [id=#53] + +(34) BroadcastNestedLoopJoin [codegen id : 18] +Join condition: None + +(35) Scan parquet default.store_sales +Output [5]: [ss_quantity#54, ss_wholesale_cost#55, ss_list_price#56, ss_coupon_amt#57, ss_sold_date_sk#58] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,16), LessThanOrEqual(ss_quantity,20), Or(Or(And(GreaterThanOrEqual(ss_list_price,135.00),LessThanOrEqual(ss_list_price,145.00)),And(GreaterThanOrEqual(ss_coupon_amt,6071.00),LessThanOrEqual(ss_coupon_amt,7071.00))),And(GreaterThanOrEqual(ss_wholesale_cost,38.00),LessThanOrEqual(ss_wholesale_cost,58.00)))] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 9] +Input [5]: [ss_quantity#54, ss_wholesale_cost#55, ss_list_price#56, ss_coupon_amt#57, ss_sold_date_sk#58] + +(37) Filter [codegen id : 9] +Input [5]: [ss_quantity#54, ss_wholesale_cost#55, ss_list_price#56, ss_coupon_amt#57, ss_sold_date_sk#58] +Condition : (((isnotnull(ss_quantity#54) AND (ss_quantity#54 >= 16)) AND (ss_quantity#54 <= 20)) AND ((((ss_list_price#56 >= 135.00) AND (ss_list_price#56 <= 145.00)) OR ((ss_coupon_amt#57 >= 6071.00) AND (ss_coupon_amt#57 <= 7071.00))) OR ((ss_wholesale_cost#55 >= 38.00) AND (ss_wholesale_cost#55 <= 58.00)))) + +(38) Project [codegen id : 9] +Output [1]: [ss_list_price#56] +Input [5]: [ss_quantity#54, ss_wholesale_cost#55, ss_list_price#56, ss_coupon_amt#57, ss_sold_date_sk#58] + +(39) HashAggregate [codegen id : 9] +Input [1]: [ss_list_price#56] +Keys [1]: [ss_list_price#56] +Functions [2]: [partial_avg(UnscaledValue(ss_list_price#56)), partial_count(ss_list_price#56)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#56))#59, count(ss_list_price#56)#60] +Results [4]: [ss_list_price#56, sum#61, count#62, count#63] + +(40) Exchange +Input [4]: [ss_list_price#56, sum#61, count#62, count#63] +Arguments: hashpartitioning(ss_list_price#56, 5), ENSURE_REQUIREMENTS, [id=#64] + +(41) HashAggregate [codegen id : 10] +Input [4]: [ss_list_price#56, sum#61, count#62, count#63] +Keys [1]: [ss_list_price#56] +Functions [2]: [merge_avg(UnscaledValue(ss_list_price#56)), merge_count(ss_list_price#56)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#56))#59, count(ss_list_price#56)#60] +Results [4]: [ss_list_price#56, sum#61, count#62, count#63] + +(42) HashAggregate [codegen id : 10] +Input [4]: [ss_list_price#56, sum#61, count#62, count#63] +Keys: [] +Functions [3]: [merge_avg(UnscaledValue(ss_list_price#56)), merge_count(ss_list_price#56), partial_count(distinct ss_list_price#56)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#56))#59, count(ss_list_price#56)#60, count(ss_list_price#56)#65] +Results [4]: [sum#61, count#62, count#63, count#66] + +(43) Exchange +Input [4]: [sum#61, count#62, count#63, count#66] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#67] + +(44) HashAggregate [codegen id : 11] +Input [4]: [sum#61, count#62, count#63, count#66] +Keys: [] +Functions [3]: [avg(UnscaledValue(ss_list_price#56)), count(ss_list_price#56), count(distinct ss_list_price#56)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#56))#59, count(ss_list_price#56)#60, count(ss_list_price#56)#65] +Results [3]: [cast((avg(UnscaledValue(ss_list_price#56))#59 / 100.0) as decimal(11,6)) AS B4_LP#68, count(ss_list_price#56)#60 AS B4_CNT#69, count(ss_list_price#56)#65 AS B4_CNTD#70] + +(45) BroadcastExchange +Input [3]: [B4_LP#68, B4_CNT#69, B4_CNTD#70] +Arguments: IdentityBroadcastMode, [id=#71] + +(46) BroadcastNestedLoopJoin [codegen id : 18] +Join condition: None + +(47) Scan parquet default.store_sales +Output [5]: [ss_quantity#72, ss_wholesale_cost#73, ss_list_price#74, ss_coupon_amt#75, ss_sold_date_sk#76] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,21), LessThanOrEqual(ss_quantity,25), Or(Or(And(GreaterThanOrEqual(ss_list_price,122.00),LessThanOrEqual(ss_list_price,132.00)),And(GreaterThanOrEqual(ss_coupon_amt,836.00),LessThanOrEqual(ss_coupon_amt,1836.00))),And(GreaterThanOrEqual(ss_wholesale_cost,17.00),LessThanOrEqual(ss_wholesale_cost,37.00)))] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 12] +Input [5]: [ss_quantity#72, ss_wholesale_cost#73, ss_list_price#74, ss_coupon_amt#75, ss_sold_date_sk#76] + +(49) Filter [codegen id : 12] +Input [5]: [ss_quantity#72, ss_wholesale_cost#73, ss_list_price#74, ss_coupon_amt#75, ss_sold_date_sk#76] +Condition : (((isnotnull(ss_quantity#72) AND (ss_quantity#72 >= 21)) AND (ss_quantity#72 <= 25)) AND ((((ss_list_price#74 >= 122.00) AND (ss_list_price#74 <= 132.00)) OR ((ss_coupon_amt#75 >= 836.00) AND (ss_coupon_amt#75 <= 1836.00))) OR ((ss_wholesale_cost#73 >= 17.00) AND (ss_wholesale_cost#73 <= 37.00)))) + +(50) Project [codegen id : 12] +Output [1]: [ss_list_price#74] +Input [5]: [ss_quantity#72, ss_wholesale_cost#73, ss_list_price#74, ss_coupon_amt#75, ss_sold_date_sk#76] + +(51) HashAggregate [codegen id : 12] +Input [1]: [ss_list_price#74] +Keys [1]: [ss_list_price#74] +Functions [2]: [partial_avg(UnscaledValue(ss_list_price#74)), partial_count(ss_list_price#74)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#74))#77, count(ss_list_price#74)#78] +Results [4]: [ss_list_price#74, sum#79, count#80, count#81] + +(52) Exchange +Input [4]: [ss_list_price#74, sum#79, count#80, count#81] +Arguments: hashpartitioning(ss_list_price#74, 5), ENSURE_REQUIREMENTS, [id=#82] + +(53) HashAggregate [codegen id : 13] +Input [4]: [ss_list_price#74, sum#79, count#80, count#81] +Keys [1]: [ss_list_price#74] +Functions [2]: [merge_avg(UnscaledValue(ss_list_price#74)), merge_count(ss_list_price#74)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#74))#77, count(ss_list_price#74)#78] +Results [4]: [ss_list_price#74, sum#79, count#80, count#81] + +(54) HashAggregate [codegen id : 13] +Input [4]: [ss_list_price#74, sum#79, count#80, count#81] +Keys: [] +Functions [3]: [merge_avg(UnscaledValue(ss_list_price#74)), merge_count(ss_list_price#74), partial_count(distinct ss_list_price#74)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#74))#77, count(ss_list_price#74)#78, count(ss_list_price#74)#83] +Results [4]: [sum#79, count#80, count#81, count#84] + +(55) Exchange +Input [4]: [sum#79, count#80, count#81, count#84] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#85] + +(56) HashAggregate [codegen id : 14] +Input [4]: [sum#79, count#80, count#81, count#84] +Keys: [] +Functions [3]: [avg(UnscaledValue(ss_list_price#74)), count(ss_list_price#74), count(distinct ss_list_price#74)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#74))#77, count(ss_list_price#74)#78, count(ss_list_price#74)#83] +Results [3]: [cast((avg(UnscaledValue(ss_list_price#74))#77 / 100.0) as decimal(11,6)) AS B5_LP#86, count(ss_list_price#74)#78 AS B5_CNT#87, count(ss_list_price#74)#83 AS B5_CNTD#88] + +(57) BroadcastExchange +Input [3]: [B5_LP#86, B5_CNT#87, B5_CNTD#88] +Arguments: IdentityBroadcastMode, [id=#89] + +(58) BroadcastNestedLoopJoin [codegen id : 18] +Join condition: None + +(59) Scan parquet default.store_sales +Output [5]: [ss_quantity#90, ss_wholesale_cost#91, ss_list_price#92, ss_coupon_amt#93, ss_sold_date_sk#94] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,26), LessThanOrEqual(ss_quantity,30), Or(Or(And(GreaterThanOrEqual(ss_list_price,154.00),LessThanOrEqual(ss_list_price,164.00)),And(GreaterThanOrEqual(ss_coupon_amt,7326.00),LessThanOrEqual(ss_coupon_amt,8326.00))),And(GreaterThanOrEqual(ss_wholesale_cost,7.00),LessThanOrEqual(ss_wholesale_cost,27.00)))] +ReadSchema: struct + +(60) ColumnarToRow [codegen id : 15] +Input [5]: [ss_quantity#90, ss_wholesale_cost#91, ss_list_price#92, ss_coupon_amt#93, ss_sold_date_sk#94] + +(61) Filter [codegen id : 15] +Input [5]: [ss_quantity#90, ss_wholesale_cost#91, ss_list_price#92, ss_coupon_amt#93, ss_sold_date_sk#94] +Condition : (((isnotnull(ss_quantity#90) AND (ss_quantity#90 >= 26)) AND (ss_quantity#90 <= 30)) AND ((((ss_list_price#92 >= 154.00) AND (ss_list_price#92 <= 164.00)) OR ((ss_coupon_amt#93 >= 7326.00) AND (ss_coupon_amt#93 <= 8326.00))) OR ((ss_wholesale_cost#91 >= 7.00) AND (ss_wholesale_cost#91 <= 27.00)))) + +(62) Project [codegen id : 15] +Output [1]: [ss_list_price#92] +Input [5]: [ss_quantity#90, ss_wholesale_cost#91, ss_list_price#92, ss_coupon_amt#93, ss_sold_date_sk#94] + +(63) HashAggregate [codegen id : 15] +Input [1]: [ss_list_price#92] +Keys [1]: [ss_list_price#92] +Functions [2]: [partial_avg(UnscaledValue(ss_list_price#92)), partial_count(ss_list_price#92)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#92))#95, count(ss_list_price#92)#96] +Results [4]: [ss_list_price#92, sum#97, count#98, count#99] + +(64) Exchange +Input [4]: [ss_list_price#92, sum#97, count#98, count#99] +Arguments: hashpartitioning(ss_list_price#92, 5), ENSURE_REQUIREMENTS, [id=#100] + +(65) HashAggregate [codegen id : 16] +Input [4]: [ss_list_price#92, sum#97, count#98, count#99] +Keys [1]: [ss_list_price#92] +Functions [2]: [merge_avg(UnscaledValue(ss_list_price#92)), merge_count(ss_list_price#92)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#92))#95, count(ss_list_price#92)#96] +Results [4]: [ss_list_price#92, sum#97, count#98, count#99] + +(66) HashAggregate [codegen id : 16] +Input [4]: [ss_list_price#92, sum#97, count#98, count#99] +Keys: [] +Functions [3]: [merge_avg(UnscaledValue(ss_list_price#92)), merge_count(ss_list_price#92), partial_count(distinct ss_list_price#92)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#92))#95, count(ss_list_price#92)#96, count(ss_list_price#92)#101] +Results [4]: [sum#97, count#98, count#99, count#102] + +(67) Exchange +Input [4]: [sum#97, count#98, count#99, count#102] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#103] + +(68) HashAggregate [codegen id : 17] +Input [4]: [sum#97, count#98, count#99, count#102] +Keys: [] +Functions [3]: [avg(UnscaledValue(ss_list_price#92)), count(ss_list_price#92), count(distinct ss_list_price#92)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#92))#95, count(ss_list_price#92)#96, count(ss_list_price#92)#101] +Results [3]: [cast((avg(UnscaledValue(ss_list_price#92))#95 / 100.0) as decimal(11,6)) AS B6_LP#104, count(ss_list_price#92)#96 AS B6_CNT#105, count(ss_list_price#92)#101 AS B6_CNTD#106] + +(69) BroadcastExchange +Input [3]: [B6_LP#104, B6_CNT#105, B6_CNTD#106] +Arguments: IdentityBroadcastMode, [id=#107] + +(70) BroadcastNestedLoopJoin [codegen id : 18] +Join condition: None + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q28.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q28.sf100/simplified.txt new file mode 100644 index 0000000000000..25317a944a6f7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q28.sf100/simplified.txt @@ -0,0 +1,111 @@ +WholeStageCodegen (18) + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + HashAggregate [sum,count,count,count] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),B1_LP,B1_CNT,B1_CNTD,sum,count,count,count] + InputAdapter + Exchange #1 + WholeStageCodegen (2) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),sum,count,count,count,sum,count,count,count] + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + InputAdapter + Exchange [ss_list_price] #2 + WholeStageCodegen (1) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + Project [ss_list_price] + Filter [ss_quantity,ss_list_price,ss_coupon_amt,ss_wholesale_cost] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (5) + HashAggregate [sum,count,count,count] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),B2_LP,B2_CNT,B2_CNTD,sum,count,count,count] + InputAdapter + Exchange #4 + WholeStageCodegen (4) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),sum,count,count,count,sum,count,count,count] + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + InputAdapter + Exchange [ss_list_price] #5 + WholeStageCodegen (3) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + Project [ss_list_price] + Filter [ss_quantity,ss_list_price,ss_coupon_amt,ss_wholesale_cost] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (8) + HashAggregate [sum,count,count,count] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),B3_LP,B3_CNT,B3_CNTD,sum,count,count,count] + InputAdapter + Exchange #7 + WholeStageCodegen (7) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),sum,count,count,count,sum,count,count,count] + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + InputAdapter + Exchange [ss_list_price] #8 + WholeStageCodegen (6) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + Project [ss_list_price] + Filter [ss_quantity,ss_list_price,ss_coupon_amt,ss_wholesale_cost] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (11) + HashAggregate [sum,count,count,count] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),B4_LP,B4_CNT,B4_CNTD,sum,count,count,count] + InputAdapter + Exchange #10 + WholeStageCodegen (10) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),sum,count,count,count,sum,count,count,count] + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + InputAdapter + Exchange [ss_list_price] #11 + WholeStageCodegen (9) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + Project [ss_list_price] + Filter [ss_quantity,ss_list_price,ss_coupon_amt,ss_wholesale_cost] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (14) + HashAggregate [sum,count,count,count] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),B5_LP,B5_CNT,B5_CNTD,sum,count,count,count] + InputAdapter + Exchange #13 + WholeStageCodegen (13) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),sum,count,count,count,sum,count,count,count] + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + InputAdapter + Exchange [ss_list_price] #14 + WholeStageCodegen (12) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + Project [ss_list_price] + Filter [ss_quantity,ss_list_price,ss_coupon_amt,ss_wholesale_cost] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (17) + HashAggregate [sum,count,count,count] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),B6_LP,B6_CNT,B6_CNTD,sum,count,count,count] + InputAdapter + Exchange #16 + WholeStageCodegen (16) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),sum,count,count,count,sum,count,count,count] + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + InputAdapter + Exchange [ss_list_price] #17 + WholeStageCodegen (15) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + Project [ss_list_price] + Filter [ss_quantity,ss_list_price,ss_coupon_amt,ss_wholesale_cost] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q28/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q28/explain.txt new file mode 100644 index 0000000000000..eec45ea549531 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q28/explain.txt @@ -0,0 +1,432 @@ +== Physical Plan == +* BroadcastNestedLoopJoin Inner BuildRight (70) +:- * BroadcastNestedLoopJoin Inner BuildRight (58) +: :- * BroadcastNestedLoopJoin Inner BuildRight (46) +: : :- * BroadcastNestedLoopJoin Inner BuildRight (34) +: : : :- * BroadcastNestedLoopJoin Inner BuildRight (22) +: : : : :- * HashAggregate (10) +: : : : : +- Exchange (9) +: : : : : +- * HashAggregate (8) +: : : : : +- * HashAggregate (7) +: : : : : +- Exchange (6) +: : : : : +- * HashAggregate (5) +: : : : : +- * Project (4) +: : : : : +- * Filter (3) +: : : : : +- * ColumnarToRow (2) +: : : : : +- Scan parquet default.store_sales (1) +: : : : +- BroadcastExchange (21) +: : : : +- * HashAggregate (20) +: : : : +- Exchange (19) +: : : : +- * HashAggregate (18) +: : : : +- * HashAggregate (17) +: : : : +- Exchange (16) +: : : : +- * HashAggregate (15) +: : : : +- * Project (14) +: : : : +- * Filter (13) +: : : : +- * ColumnarToRow (12) +: : : : +- Scan parquet default.store_sales (11) +: : : +- BroadcastExchange (33) +: : : +- * HashAggregate (32) +: : : +- Exchange (31) +: : : +- * HashAggregate (30) +: : : +- * HashAggregate (29) +: : : +- Exchange (28) +: : : +- * HashAggregate (27) +: : : +- * Project (26) +: : : +- * Filter (25) +: : : +- * ColumnarToRow (24) +: : : +- Scan parquet default.store_sales (23) +: : +- BroadcastExchange (45) +: : +- * HashAggregate (44) +: : +- Exchange (43) +: : +- * HashAggregate (42) +: : +- * HashAggregate (41) +: : +- Exchange (40) +: : +- * HashAggregate (39) +: : +- * Project (38) +: : +- * Filter (37) +: : +- * ColumnarToRow (36) +: : +- Scan parquet default.store_sales (35) +: +- BroadcastExchange (57) +: +- * HashAggregate (56) +: +- Exchange (55) +: +- * HashAggregate (54) +: +- * HashAggregate (53) +: +- Exchange (52) +: +- * HashAggregate (51) +: +- * Project (50) +: +- * Filter (49) +: +- * ColumnarToRow (48) +: +- Scan parquet default.store_sales (47) ++- BroadcastExchange (69) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- * HashAggregate (65) + +- Exchange (64) + +- * HashAggregate (63) + +- * Project (62) + +- * Filter (61) + +- * ColumnarToRow (60) + +- Scan parquet default.store_sales (59) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_quantity#1, ss_wholesale_cost#2, ss_list_price#3, ss_coupon_amt#4, ss_sold_date_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,0), LessThanOrEqual(ss_quantity,5), Or(Or(And(GreaterThanOrEqual(ss_list_price,8.00),LessThanOrEqual(ss_list_price,18.00)),And(GreaterThanOrEqual(ss_coupon_amt,459.00),LessThanOrEqual(ss_coupon_amt,1459.00))),And(GreaterThanOrEqual(ss_wholesale_cost,57.00),LessThanOrEqual(ss_wholesale_cost,77.00)))] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [ss_quantity#1, ss_wholesale_cost#2, ss_list_price#3, ss_coupon_amt#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 1] +Input [5]: [ss_quantity#1, ss_wholesale_cost#2, ss_list_price#3, ss_coupon_amt#4, ss_sold_date_sk#5] +Condition : (((isnotnull(ss_quantity#1) AND (ss_quantity#1 >= 0)) AND (ss_quantity#1 <= 5)) AND ((((ss_list_price#3 >= 8.00) AND (ss_list_price#3 <= 18.00)) OR ((ss_coupon_amt#4 >= 459.00) AND (ss_coupon_amt#4 <= 1459.00))) OR ((ss_wholesale_cost#2 >= 57.00) AND (ss_wholesale_cost#2 <= 77.00)))) + +(4) Project [codegen id : 1] +Output [1]: [ss_list_price#3] +Input [5]: [ss_quantity#1, ss_wholesale_cost#2, ss_list_price#3, ss_coupon_amt#4, ss_sold_date_sk#5] + +(5) HashAggregate [codegen id : 1] +Input [1]: [ss_list_price#3] +Keys [1]: [ss_list_price#3] +Functions [2]: [partial_avg(UnscaledValue(ss_list_price#3)), partial_count(ss_list_price#3)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#3))#6, count(ss_list_price#3)#7] +Results [4]: [ss_list_price#3, sum#8, count#9, count#10] + +(6) Exchange +Input [4]: [ss_list_price#3, sum#8, count#9, count#10] +Arguments: hashpartitioning(ss_list_price#3, 5), ENSURE_REQUIREMENTS, [id=#11] + +(7) HashAggregate [codegen id : 2] +Input [4]: [ss_list_price#3, sum#8, count#9, count#10] +Keys [1]: [ss_list_price#3] +Functions [2]: [merge_avg(UnscaledValue(ss_list_price#3)), merge_count(ss_list_price#3)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#3))#6, count(ss_list_price#3)#7] +Results [4]: [ss_list_price#3, sum#8, count#9, count#10] + +(8) HashAggregate [codegen id : 2] +Input [4]: [ss_list_price#3, sum#8, count#9, count#10] +Keys: [] +Functions [3]: [merge_avg(UnscaledValue(ss_list_price#3)), merge_count(ss_list_price#3), partial_count(distinct ss_list_price#3)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#3))#6, count(ss_list_price#3)#7, count(ss_list_price#3)#12] +Results [4]: [sum#8, count#9, count#10, count#13] + +(9) Exchange +Input [4]: [sum#8, count#9, count#10, count#13] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#14] + +(10) HashAggregate [codegen id : 18] +Input [4]: [sum#8, count#9, count#10, count#13] +Keys: [] +Functions [3]: [avg(UnscaledValue(ss_list_price#3)), count(ss_list_price#3), count(distinct ss_list_price#3)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#3))#6, count(ss_list_price#3)#7, count(ss_list_price#3)#12] +Results [3]: [cast((avg(UnscaledValue(ss_list_price#3))#6 / 100.0) as decimal(11,6)) AS B1_LP#15, count(ss_list_price#3)#7 AS B1_CNT#16, count(ss_list_price#3)#12 AS B1_CNTD#17] + +(11) Scan parquet default.store_sales +Output [5]: [ss_quantity#18, ss_wholesale_cost#19, ss_list_price#20, ss_coupon_amt#21, ss_sold_date_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,6), LessThanOrEqual(ss_quantity,10), Or(Or(And(GreaterThanOrEqual(ss_list_price,90.00),LessThanOrEqual(ss_list_price,100.00)),And(GreaterThanOrEqual(ss_coupon_amt,2323.00),LessThanOrEqual(ss_coupon_amt,3323.00))),And(GreaterThanOrEqual(ss_wholesale_cost,31.00),LessThanOrEqual(ss_wholesale_cost,51.00)))] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 3] +Input [5]: [ss_quantity#18, ss_wholesale_cost#19, ss_list_price#20, ss_coupon_amt#21, ss_sold_date_sk#22] + +(13) Filter [codegen id : 3] +Input [5]: [ss_quantity#18, ss_wholesale_cost#19, ss_list_price#20, ss_coupon_amt#21, ss_sold_date_sk#22] +Condition : (((isnotnull(ss_quantity#18) AND (ss_quantity#18 >= 6)) AND (ss_quantity#18 <= 10)) AND ((((ss_list_price#20 >= 90.00) AND (ss_list_price#20 <= 100.00)) OR ((ss_coupon_amt#21 >= 2323.00) AND (ss_coupon_amt#21 <= 3323.00))) OR ((ss_wholesale_cost#19 >= 31.00) AND (ss_wholesale_cost#19 <= 51.00)))) + +(14) Project [codegen id : 3] +Output [1]: [ss_list_price#20] +Input [5]: [ss_quantity#18, ss_wholesale_cost#19, ss_list_price#20, ss_coupon_amt#21, ss_sold_date_sk#22] + +(15) HashAggregate [codegen id : 3] +Input [1]: [ss_list_price#20] +Keys [1]: [ss_list_price#20] +Functions [2]: [partial_avg(UnscaledValue(ss_list_price#20)), partial_count(ss_list_price#20)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#20))#23, count(ss_list_price#20)#24] +Results [4]: [ss_list_price#20, sum#25, count#26, count#27] + +(16) Exchange +Input [4]: [ss_list_price#20, sum#25, count#26, count#27] +Arguments: hashpartitioning(ss_list_price#20, 5), ENSURE_REQUIREMENTS, [id=#28] + +(17) HashAggregate [codegen id : 4] +Input [4]: [ss_list_price#20, sum#25, count#26, count#27] +Keys [1]: [ss_list_price#20] +Functions [2]: [merge_avg(UnscaledValue(ss_list_price#20)), merge_count(ss_list_price#20)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#20))#23, count(ss_list_price#20)#24] +Results [4]: [ss_list_price#20, sum#25, count#26, count#27] + +(18) HashAggregate [codegen id : 4] +Input [4]: [ss_list_price#20, sum#25, count#26, count#27] +Keys: [] +Functions [3]: [merge_avg(UnscaledValue(ss_list_price#20)), merge_count(ss_list_price#20), partial_count(distinct ss_list_price#20)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#20))#23, count(ss_list_price#20)#24, count(ss_list_price#20)#29] +Results [4]: [sum#25, count#26, count#27, count#30] + +(19) Exchange +Input [4]: [sum#25, count#26, count#27, count#30] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#31] + +(20) HashAggregate [codegen id : 5] +Input [4]: [sum#25, count#26, count#27, count#30] +Keys: [] +Functions [3]: [avg(UnscaledValue(ss_list_price#20)), count(ss_list_price#20), count(distinct ss_list_price#20)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#20))#23, count(ss_list_price#20)#24, count(ss_list_price#20)#29] +Results [3]: [cast((avg(UnscaledValue(ss_list_price#20))#23 / 100.0) as decimal(11,6)) AS B2_LP#32, count(ss_list_price#20)#24 AS B2_CNT#33, count(ss_list_price#20)#29 AS B2_CNTD#34] + +(21) BroadcastExchange +Input [3]: [B2_LP#32, B2_CNT#33, B2_CNTD#34] +Arguments: IdentityBroadcastMode, [id=#35] + +(22) BroadcastNestedLoopJoin [codegen id : 18] +Join condition: None + +(23) Scan parquet default.store_sales +Output [5]: [ss_quantity#36, ss_wholesale_cost#37, ss_list_price#38, ss_coupon_amt#39, ss_sold_date_sk#40] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,11), LessThanOrEqual(ss_quantity,15), Or(Or(And(GreaterThanOrEqual(ss_list_price,142.00),LessThanOrEqual(ss_list_price,152.00)),And(GreaterThanOrEqual(ss_coupon_amt,12214.00),LessThanOrEqual(ss_coupon_amt,13214.00))),And(GreaterThanOrEqual(ss_wholesale_cost,79.00),LessThanOrEqual(ss_wholesale_cost,99.00)))] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 6] +Input [5]: [ss_quantity#36, ss_wholesale_cost#37, ss_list_price#38, ss_coupon_amt#39, ss_sold_date_sk#40] + +(25) Filter [codegen id : 6] +Input [5]: [ss_quantity#36, ss_wholesale_cost#37, ss_list_price#38, ss_coupon_amt#39, ss_sold_date_sk#40] +Condition : (((isnotnull(ss_quantity#36) AND (ss_quantity#36 >= 11)) AND (ss_quantity#36 <= 15)) AND ((((ss_list_price#38 >= 142.00) AND (ss_list_price#38 <= 152.00)) OR ((ss_coupon_amt#39 >= 12214.00) AND (ss_coupon_amt#39 <= 13214.00))) OR ((ss_wholesale_cost#37 >= 79.00) AND (ss_wholesale_cost#37 <= 99.00)))) + +(26) Project [codegen id : 6] +Output [1]: [ss_list_price#38] +Input [5]: [ss_quantity#36, ss_wholesale_cost#37, ss_list_price#38, ss_coupon_amt#39, ss_sold_date_sk#40] + +(27) HashAggregate [codegen id : 6] +Input [1]: [ss_list_price#38] +Keys [1]: [ss_list_price#38] +Functions [2]: [partial_avg(UnscaledValue(ss_list_price#38)), partial_count(ss_list_price#38)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#38))#41, count(ss_list_price#38)#42] +Results [4]: [ss_list_price#38, sum#43, count#44, count#45] + +(28) Exchange +Input [4]: [ss_list_price#38, sum#43, count#44, count#45] +Arguments: hashpartitioning(ss_list_price#38, 5), ENSURE_REQUIREMENTS, [id=#46] + +(29) HashAggregate [codegen id : 7] +Input [4]: [ss_list_price#38, sum#43, count#44, count#45] +Keys [1]: [ss_list_price#38] +Functions [2]: [merge_avg(UnscaledValue(ss_list_price#38)), merge_count(ss_list_price#38)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#38))#41, count(ss_list_price#38)#42] +Results [4]: [ss_list_price#38, sum#43, count#44, count#45] + +(30) HashAggregate [codegen id : 7] +Input [4]: [ss_list_price#38, sum#43, count#44, count#45] +Keys: [] +Functions [3]: [merge_avg(UnscaledValue(ss_list_price#38)), merge_count(ss_list_price#38), partial_count(distinct ss_list_price#38)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#38))#41, count(ss_list_price#38)#42, count(ss_list_price#38)#47] +Results [4]: [sum#43, count#44, count#45, count#48] + +(31) Exchange +Input [4]: [sum#43, count#44, count#45, count#48] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#49] + +(32) HashAggregate [codegen id : 8] +Input [4]: [sum#43, count#44, count#45, count#48] +Keys: [] +Functions [3]: [avg(UnscaledValue(ss_list_price#38)), count(ss_list_price#38), count(distinct ss_list_price#38)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#38))#41, count(ss_list_price#38)#42, count(ss_list_price#38)#47] +Results [3]: [cast((avg(UnscaledValue(ss_list_price#38))#41 / 100.0) as decimal(11,6)) AS B3_LP#50, count(ss_list_price#38)#42 AS B3_CNT#51, count(ss_list_price#38)#47 AS B3_CNTD#52] + +(33) BroadcastExchange +Input [3]: [B3_LP#50, B3_CNT#51, B3_CNTD#52] +Arguments: IdentityBroadcastMode, [id=#53] + +(34) BroadcastNestedLoopJoin [codegen id : 18] +Join condition: None + +(35) Scan parquet default.store_sales +Output [5]: [ss_quantity#54, ss_wholesale_cost#55, ss_list_price#56, ss_coupon_amt#57, ss_sold_date_sk#58] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,16), LessThanOrEqual(ss_quantity,20), Or(Or(And(GreaterThanOrEqual(ss_list_price,135.00),LessThanOrEqual(ss_list_price,145.00)),And(GreaterThanOrEqual(ss_coupon_amt,6071.00),LessThanOrEqual(ss_coupon_amt,7071.00))),And(GreaterThanOrEqual(ss_wholesale_cost,38.00),LessThanOrEqual(ss_wholesale_cost,58.00)))] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 9] +Input [5]: [ss_quantity#54, ss_wholesale_cost#55, ss_list_price#56, ss_coupon_amt#57, ss_sold_date_sk#58] + +(37) Filter [codegen id : 9] +Input [5]: [ss_quantity#54, ss_wholesale_cost#55, ss_list_price#56, ss_coupon_amt#57, ss_sold_date_sk#58] +Condition : (((isnotnull(ss_quantity#54) AND (ss_quantity#54 >= 16)) AND (ss_quantity#54 <= 20)) AND ((((ss_list_price#56 >= 135.00) AND (ss_list_price#56 <= 145.00)) OR ((ss_coupon_amt#57 >= 6071.00) AND (ss_coupon_amt#57 <= 7071.00))) OR ((ss_wholesale_cost#55 >= 38.00) AND (ss_wholesale_cost#55 <= 58.00)))) + +(38) Project [codegen id : 9] +Output [1]: [ss_list_price#56] +Input [5]: [ss_quantity#54, ss_wholesale_cost#55, ss_list_price#56, ss_coupon_amt#57, ss_sold_date_sk#58] + +(39) HashAggregate [codegen id : 9] +Input [1]: [ss_list_price#56] +Keys [1]: [ss_list_price#56] +Functions [2]: [partial_avg(UnscaledValue(ss_list_price#56)), partial_count(ss_list_price#56)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#56))#59, count(ss_list_price#56)#60] +Results [4]: [ss_list_price#56, sum#61, count#62, count#63] + +(40) Exchange +Input [4]: [ss_list_price#56, sum#61, count#62, count#63] +Arguments: hashpartitioning(ss_list_price#56, 5), ENSURE_REQUIREMENTS, [id=#64] + +(41) HashAggregate [codegen id : 10] +Input [4]: [ss_list_price#56, sum#61, count#62, count#63] +Keys [1]: [ss_list_price#56] +Functions [2]: [merge_avg(UnscaledValue(ss_list_price#56)), merge_count(ss_list_price#56)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#56))#59, count(ss_list_price#56)#60] +Results [4]: [ss_list_price#56, sum#61, count#62, count#63] + +(42) HashAggregate [codegen id : 10] +Input [4]: [ss_list_price#56, sum#61, count#62, count#63] +Keys: [] +Functions [3]: [merge_avg(UnscaledValue(ss_list_price#56)), merge_count(ss_list_price#56), partial_count(distinct ss_list_price#56)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#56))#59, count(ss_list_price#56)#60, count(ss_list_price#56)#65] +Results [4]: [sum#61, count#62, count#63, count#66] + +(43) Exchange +Input [4]: [sum#61, count#62, count#63, count#66] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#67] + +(44) HashAggregate [codegen id : 11] +Input [4]: [sum#61, count#62, count#63, count#66] +Keys: [] +Functions [3]: [avg(UnscaledValue(ss_list_price#56)), count(ss_list_price#56), count(distinct ss_list_price#56)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#56))#59, count(ss_list_price#56)#60, count(ss_list_price#56)#65] +Results [3]: [cast((avg(UnscaledValue(ss_list_price#56))#59 / 100.0) as decimal(11,6)) AS B4_LP#68, count(ss_list_price#56)#60 AS B4_CNT#69, count(ss_list_price#56)#65 AS B4_CNTD#70] + +(45) BroadcastExchange +Input [3]: [B4_LP#68, B4_CNT#69, B4_CNTD#70] +Arguments: IdentityBroadcastMode, [id=#71] + +(46) BroadcastNestedLoopJoin [codegen id : 18] +Join condition: None + +(47) Scan parquet default.store_sales +Output [5]: [ss_quantity#72, ss_wholesale_cost#73, ss_list_price#74, ss_coupon_amt#75, ss_sold_date_sk#76] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,21), LessThanOrEqual(ss_quantity,25), Or(Or(And(GreaterThanOrEqual(ss_list_price,122.00),LessThanOrEqual(ss_list_price,132.00)),And(GreaterThanOrEqual(ss_coupon_amt,836.00),LessThanOrEqual(ss_coupon_amt,1836.00))),And(GreaterThanOrEqual(ss_wholesale_cost,17.00),LessThanOrEqual(ss_wholesale_cost,37.00)))] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 12] +Input [5]: [ss_quantity#72, ss_wholesale_cost#73, ss_list_price#74, ss_coupon_amt#75, ss_sold_date_sk#76] + +(49) Filter [codegen id : 12] +Input [5]: [ss_quantity#72, ss_wholesale_cost#73, ss_list_price#74, ss_coupon_amt#75, ss_sold_date_sk#76] +Condition : (((isnotnull(ss_quantity#72) AND (ss_quantity#72 >= 21)) AND (ss_quantity#72 <= 25)) AND ((((ss_list_price#74 >= 122.00) AND (ss_list_price#74 <= 132.00)) OR ((ss_coupon_amt#75 >= 836.00) AND (ss_coupon_amt#75 <= 1836.00))) OR ((ss_wholesale_cost#73 >= 17.00) AND (ss_wholesale_cost#73 <= 37.00)))) + +(50) Project [codegen id : 12] +Output [1]: [ss_list_price#74] +Input [5]: [ss_quantity#72, ss_wholesale_cost#73, ss_list_price#74, ss_coupon_amt#75, ss_sold_date_sk#76] + +(51) HashAggregate [codegen id : 12] +Input [1]: [ss_list_price#74] +Keys [1]: [ss_list_price#74] +Functions [2]: [partial_avg(UnscaledValue(ss_list_price#74)), partial_count(ss_list_price#74)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#74))#77, count(ss_list_price#74)#78] +Results [4]: [ss_list_price#74, sum#79, count#80, count#81] + +(52) Exchange +Input [4]: [ss_list_price#74, sum#79, count#80, count#81] +Arguments: hashpartitioning(ss_list_price#74, 5), ENSURE_REQUIREMENTS, [id=#82] + +(53) HashAggregate [codegen id : 13] +Input [4]: [ss_list_price#74, sum#79, count#80, count#81] +Keys [1]: [ss_list_price#74] +Functions [2]: [merge_avg(UnscaledValue(ss_list_price#74)), merge_count(ss_list_price#74)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#74))#77, count(ss_list_price#74)#78] +Results [4]: [ss_list_price#74, sum#79, count#80, count#81] + +(54) HashAggregate [codegen id : 13] +Input [4]: [ss_list_price#74, sum#79, count#80, count#81] +Keys: [] +Functions [3]: [merge_avg(UnscaledValue(ss_list_price#74)), merge_count(ss_list_price#74), partial_count(distinct ss_list_price#74)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#74))#77, count(ss_list_price#74)#78, count(ss_list_price#74)#83] +Results [4]: [sum#79, count#80, count#81, count#84] + +(55) Exchange +Input [4]: [sum#79, count#80, count#81, count#84] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#85] + +(56) HashAggregate [codegen id : 14] +Input [4]: [sum#79, count#80, count#81, count#84] +Keys: [] +Functions [3]: [avg(UnscaledValue(ss_list_price#74)), count(ss_list_price#74), count(distinct ss_list_price#74)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#74))#77, count(ss_list_price#74)#78, count(ss_list_price#74)#83] +Results [3]: [cast((avg(UnscaledValue(ss_list_price#74))#77 / 100.0) as decimal(11,6)) AS B5_LP#86, count(ss_list_price#74)#78 AS B5_CNT#87, count(ss_list_price#74)#83 AS B5_CNTD#88] + +(57) BroadcastExchange +Input [3]: [B5_LP#86, B5_CNT#87, B5_CNTD#88] +Arguments: IdentityBroadcastMode, [id=#89] + +(58) BroadcastNestedLoopJoin [codegen id : 18] +Join condition: None + +(59) Scan parquet default.store_sales +Output [5]: [ss_quantity#90, ss_wholesale_cost#91, ss_list_price#92, ss_coupon_amt#93, ss_sold_date_sk#94] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,26), LessThanOrEqual(ss_quantity,30), Or(Or(And(GreaterThanOrEqual(ss_list_price,154.00),LessThanOrEqual(ss_list_price,164.00)),And(GreaterThanOrEqual(ss_coupon_amt,7326.00),LessThanOrEqual(ss_coupon_amt,8326.00))),And(GreaterThanOrEqual(ss_wholesale_cost,7.00),LessThanOrEqual(ss_wholesale_cost,27.00)))] +ReadSchema: struct + +(60) ColumnarToRow [codegen id : 15] +Input [5]: [ss_quantity#90, ss_wholesale_cost#91, ss_list_price#92, ss_coupon_amt#93, ss_sold_date_sk#94] + +(61) Filter [codegen id : 15] +Input [5]: [ss_quantity#90, ss_wholesale_cost#91, ss_list_price#92, ss_coupon_amt#93, ss_sold_date_sk#94] +Condition : (((isnotnull(ss_quantity#90) AND (ss_quantity#90 >= 26)) AND (ss_quantity#90 <= 30)) AND ((((ss_list_price#92 >= 154.00) AND (ss_list_price#92 <= 164.00)) OR ((ss_coupon_amt#93 >= 7326.00) AND (ss_coupon_amt#93 <= 8326.00))) OR ((ss_wholesale_cost#91 >= 7.00) AND (ss_wholesale_cost#91 <= 27.00)))) + +(62) Project [codegen id : 15] +Output [1]: [ss_list_price#92] +Input [5]: [ss_quantity#90, ss_wholesale_cost#91, ss_list_price#92, ss_coupon_amt#93, ss_sold_date_sk#94] + +(63) HashAggregate [codegen id : 15] +Input [1]: [ss_list_price#92] +Keys [1]: [ss_list_price#92] +Functions [2]: [partial_avg(UnscaledValue(ss_list_price#92)), partial_count(ss_list_price#92)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#92))#95, count(ss_list_price#92)#96] +Results [4]: [ss_list_price#92, sum#97, count#98, count#99] + +(64) Exchange +Input [4]: [ss_list_price#92, sum#97, count#98, count#99] +Arguments: hashpartitioning(ss_list_price#92, 5), ENSURE_REQUIREMENTS, [id=#100] + +(65) HashAggregate [codegen id : 16] +Input [4]: [ss_list_price#92, sum#97, count#98, count#99] +Keys [1]: [ss_list_price#92] +Functions [2]: [merge_avg(UnscaledValue(ss_list_price#92)), merge_count(ss_list_price#92)] +Aggregate Attributes [2]: [avg(UnscaledValue(ss_list_price#92))#95, count(ss_list_price#92)#96] +Results [4]: [ss_list_price#92, sum#97, count#98, count#99] + +(66) HashAggregate [codegen id : 16] +Input [4]: [ss_list_price#92, sum#97, count#98, count#99] +Keys: [] +Functions [3]: [merge_avg(UnscaledValue(ss_list_price#92)), merge_count(ss_list_price#92), partial_count(distinct ss_list_price#92)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#92))#95, count(ss_list_price#92)#96, count(ss_list_price#92)#101] +Results [4]: [sum#97, count#98, count#99, count#102] + +(67) Exchange +Input [4]: [sum#97, count#98, count#99, count#102] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#103] + +(68) HashAggregate [codegen id : 17] +Input [4]: [sum#97, count#98, count#99, count#102] +Keys: [] +Functions [3]: [avg(UnscaledValue(ss_list_price#92)), count(ss_list_price#92), count(distinct ss_list_price#92)] +Aggregate Attributes [3]: [avg(UnscaledValue(ss_list_price#92))#95, count(ss_list_price#92)#96, count(ss_list_price#92)#101] +Results [3]: [cast((avg(UnscaledValue(ss_list_price#92))#95 / 100.0) as decimal(11,6)) AS B6_LP#104, count(ss_list_price#92)#96 AS B6_CNT#105, count(ss_list_price#92)#101 AS B6_CNTD#106] + +(69) BroadcastExchange +Input [3]: [B6_LP#104, B6_CNT#105, B6_CNTD#106] +Arguments: IdentityBroadcastMode, [id=#107] + +(70) BroadcastNestedLoopJoin [codegen id : 18] +Join condition: None + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q28/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q28/simplified.txt new file mode 100644 index 0000000000000..25317a944a6f7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q28/simplified.txt @@ -0,0 +1,111 @@ +WholeStageCodegen (18) + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + HashAggregate [sum,count,count,count] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),B1_LP,B1_CNT,B1_CNTD,sum,count,count,count] + InputAdapter + Exchange #1 + WholeStageCodegen (2) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),sum,count,count,count,sum,count,count,count] + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + InputAdapter + Exchange [ss_list_price] #2 + WholeStageCodegen (1) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + Project [ss_list_price] + Filter [ss_quantity,ss_list_price,ss_coupon_amt,ss_wholesale_cost] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (5) + HashAggregate [sum,count,count,count] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),B2_LP,B2_CNT,B2_CNTD,sum,count,count,count] + InputAdapter + Exchange #4 + WholeStageCodegen (4) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),sum,count,count,count,sum,count,count,count] + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + InputAdapter + Exchange [ss_list_price] #5 + WholeStageCodegen (3) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + Project [ss_list_price] + Filter [ss_quantity,ss_list_price,ss_coupon_amt,ss_wholesale_cost] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (8) + HashAggregate [sum,count,count,count] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),B3_LP,B3_CNT,B3_CNTD,sum,count,count,count] + InputAdapter + Exchange #7 + WholeStageCodegen (7) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),sum,count,count,count,sum,count,count,count] + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + InputAdapter + Exchange [ss_list_price] #8 + WholeStageCodegen (6) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + Project [ss_list_price] + Filter [ss_quantity,ss_list_price,ss_coupon_amt,ss_wholesale_cost] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (11) + HashAggregate [sum,count,count,count] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),B4_LP,B4_CNT,B4_CNTD,sum,count,count,count] + InputAdapter + Exchange #10 + WholeStageCodegen (10) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),sum,count,count,count,sum,count,count,count] + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + InputAdapter + Exchange [ss_list_price] #11 + WholeStageCodegen (9) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + Project [ss_list_price] + Filter [ss_quantity,ss_list_price,ss_coupon_amt,ss_wholesale_cost] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (14) + HashAggregate [sum,count,count,count] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),B5_LP,B5_CNT,B5_CNTD,sum,count,count,count] + InputAdapter + Exchange #13 + WholeStageCodegen (13) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),sum,count,count,count,sum,count,count,count] + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + InputAdapter + Exchange [ss_list_price] #14 + WholeStageCodegen (12) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + Project [ss_list_price] + Filter [ss_quantity,ss_list_price,ss_coupon_amt,ss_wholesale_cost] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (17) + HashAggregate [sum,count,count,count] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),B6_LP,B6_CNT,B6_CNTD,sum,count,count,count] + InputAdapter + Exchange #16 + WholeStageCodegen (16) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),count(ss_list_price),sum,count,count,count,sum,count,count,count] + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + InputAdapter + Exchange [ss_list_price] #17 + WholeStageCodegen (15) + HashAggregate [ss_list_price] [avg(UnscaledValue(ss_list_price)),count(ss_list_price),sum,count,count,sum,count,count] + Project [ss_list_price] + Filter [ss_quantity,ss_list_price,ss_coupon_amt,ss_wholesale_cost] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt new file mode 100644 index 0000000000000..d07d84fda4259 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/explain.txt @@ -0,0 +1,364 @@ +== Physical Plan == +TakeOrderedAndProject (61) ++- * HashAggregate (60) + +- Exchange (59) + +- * HashAggregate (58) + +- * Project (57) + +- * SortMergeJoin Inner (56) + :- * Sort (43) + : +- Exchange (42) + : +- * Project (41) + : +- * SortMergeJoin Inner (40) + : :- * Sort (27) + : : +- Exchange (26) + : : +- * Project (25) + : : +- * SortMergeJoin Inner (24) + : : :- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.store (11) + : : +- * Sort (23) + : : +- Exchange (22) + : : +- * Filter (21) + : : +- * ColumnarToRow (20) + : : +- Scan parquet default.item (19) + : +- * Sort (39) + : +- Exchange (38) + : +- * Project (37) + : +- * BroadcastHashJoin Inner BuildRight (36) + : :- * Filter (30) + : : +- * ColumnarToRow (29) + : : +- Scan parquet default.store_returns (28) + : +- BroadcastExchange (35) + : +- * Project (34) + : +- * Filter (33) + : +- * ColumnarToRow (32) + : +- Scan parquet default.date_dim (31) + +- * Sort (55) + +- Exchange (54) + +- * Project (53) + +- * BroadcastHashJoin Inner BuildRight (52) + :- * Filter (46) + : +- * ColumnarToRow (45) + : +- Scan parquet default.catalog_sales (44) + +- BroadcastExchange (51) + +- * Project (50) + +- * Filter (49) + +- * ColumnarToRow (48) + +- Scan parquet default.date_dim (47) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 3] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_customer_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_ticket_number#4)) AND isnotnull(ss_store_sk#3)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#8, d_year#9, d_moy#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,9), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] +Condition : ((((isnotnull(d_moy#10) AND isnotnull(d_year#9)) AND (d_moy#10 = 9)) AND (d_year#9 = 1999)) AND isnotnull(d_date_sk#8)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#8] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(8) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(10) Project [codegen id : 3] +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6, d_date_sk#8] + +(11) Scan parquet default.store +Output [3]: [s_store_sk#12, s_store_id#13, s_store_name#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [s_store_sk#12, s_store_id#13, s_store_name#14] + +(13) Filter [codegen id : 2] +Input [3]: [s_store_sk#12, s_store_id#13, s_store_name#14] +Condition : isnotnull(s_store_sk#12) + +(14) BroadcastExchange +Input [3]: [s_store_sk#12, s_store_id#13, s_store_name#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#12] +Join condition: None + +(16) Project [codegen id : 3] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_store_id#13, s_store_name#14] +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, s_store_sk#12, s_store_id#13, s_store_name#14] + +(17) Exchange +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_store_id#13, s_store_name#14] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#16] + +(18) Sort [codegen id : 4] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_store_id#13, s_store_name#14] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.item +Output [3]: [i_item_sk#17, i_item_id#18, i_item_desc#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 5] +Input [3]: [i_item_sk#17, i_item_id#18, i_item_desc#19] + +(21) Filter [codegen id : 5] +Input [3]: [i_item_sk#17, i_item_id#18, i_item_desc#19] +Condition : isnotnull(i_item_sk#17) + +(22) Exchange +Input [3]: [i_item_sk#17, i_item_id#18, i_item_desc#19] +Arguments: hashpartitioning(i_item_sk#17, 5), ENSURE_REQUIREMENTS, [id=#20] + +(23) Sort [codegen id : 6] +Input [3]: [i_item_sk#17, i_item_id#18, i_item_desc#19] +Arguments: [i_item_sk#17 ASC NULLS FIRST], false, 0 + +(24) SortMergeJoin [codegen id : 7] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#17] +Join condition: None + +(25) Project [codegen id : 7] +Output [8]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_store_id#13, s_store_name#14, i_item_sk#17, i_item_id#18, i_item_desc#19] + +(26) Exchange +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] +Arguments: hashpartitioning(ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) Sort [codegen id : 8] +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 + +(28) Scan parquet default.store_returns +Output [5]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_return_quantity#25, sr_returned_date_sk#26] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#26), dynamicpruningexpression(sr_returned_date_sk#26 IN dynamicpruning#27)] +PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 10] +Input [5]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_return_quantity#25, sr_returned_date_sk#26] + +(30) Filter [codegen id : 10] +Input [5]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_return_quantity#25, sr_returned_date_sk#26] +Condition : ((isnotnull(sr_customer_sk#23) AND isnotnull(sr_item_sk#22)) AND isnotnull(sr_ticket_number#24)) + +(31) Scan parquet default.date_dim +Output [3]: [d_date_sk#28, d_year#29, d_moy#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), GreaterThanOrEqual(d_moy,9), LessThanOrEqual(d_moy,12), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 9] +Input [3]: [d_date_sk#28, d_year#29, d_moy#30] + +(33) Filter [codegen id : 9] +Input [3]: [d_date_sk#28, d_year#29, d_moy#30] +Condition : (((((isnotnull(d_moy#30) AND isnotnull(d_year#29)) AND (d_moy#30 >= 9)) AND (d_moy#30 <= 12)) AND (d_year#29 = 1999)) AND isnotnull(d_date_sk#28)) + +(34) Project [codegen id : 9] +Output [1]: [d_date_sk#28] +Input [3]: [d_date_sk#28, d_year#29, d_moy#30] + +(35) BroadcastExchange +Input [1]: [d_date_sk#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#31] + +(36) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [sr_returned_date_sk#26] +Right keys [1]: [d_date_sk#28] +Join condition: None + +(37) Project [codegen id : 10] +Output [4]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_return_quantity#25] +Input [6]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_return_quantity#25, sr_returned_date_sk#26, d_date_sk#28] + +(38) Exchange +Input [4]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_return_quantity#25] +Arguments: hashpartitioning(sr_customer_sk#23, sr_item_sk#22, sr_ticket_number#24, 5), ENSURE_REQUIREMENTS, [id=#32] + +(39) Sort [codegen id : 11] +Input [4]: [sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_return_quantity#25] +Arguments: [sr_customer_sk#23 ASC NULLS FIRST, sr_item_sk#22 ASC NULLS FIRST, sr_ticket_number#24 ASC NULLS FIRST], false, 0 + +(40) SortMergeJoin [codegen id : 12] +Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4] +Right keys [3]: [sr_customer_sk#23, sr_item_sk#22, sr_ticket_number#24] +Join condition: None + +(41) Project [codegen id : 12] +Output [8]: [ss_quantity#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19, sr_item_sk#22, sr_customer_sk#23, sr_return_quantity#25] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#4, ss_quantity#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19, sr_item_sk#22, sr_customer_sk#23, sr_ticket_number#24, sr_return_quantity#25] + +(42) Exchange +Input [8]: [ss_quantity#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19, sr_item_sk#22, sr_customer_sk#23, sr_return_quantity#25] +Arguments: hashpartitioning(sr_customer_sk#23, sr_item_sk#22, 5), ENSURE_REQUIREMENTS, [id=#33] + +(43) Sort [codegen id : 13] +Input [8]: [ss_quantity#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19, sr_item_sk#22, sr_customer_sk#23, sr_return_quantity#25] +Arguments: [sr_customer_sk#23 ASC NULLS FIRST, sr_item_sk#22 ASC NULLS FIRST], false, 0 + +(44) Scan parquet default.catalog_sales +Output [4]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_quantity#36, cs_sold_date_sk#37] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#37), dynamicpruningexpression(cs_sold_date_sk#37 IN dynamicpruning#38)] +PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(45) ColumnarToRow [codegen id : 15] +Input [4]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_quantity#36, cs_sold_date_sk#37] + +(46) Filter [codegen id : 15] +Input [4]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_quantity#36, cs_sold_date_sk#37] +Condition : (isnotnull(cs_bill_customer_sk#34) AND isnotnull(cs_item_sk#35)) + +(47) Scan parquet default.date_dim +Output [2]: [d_date_sk#39, d_year#40] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 14] +Input [2]: [d_date_sk#39, d_year#40] + +(49) Filter [codegen id : 14] +Input [2]: [d_date_sk#39, d_year#40] +Condition : (d_year#40 IN (1999,2000,2001) AND isnotnull(d_date_sk#39)) + +(50) Project [codegen id : 14] +Output [1]: [d_date_sk#39] +Input [2]: [d_date_sk#39, d_year#40] + +(51) BroadcastExchange +Input [1]: [d_date_sk#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#41] + +(52) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [cs_sold_date_sk#37] +Right keys [1]: [d_date_sk#39] +Join condition: None + +(53) Project [codegen id : 15] +Output [3]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_quantity#36] +Input [5]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_quantity#36, cs_sold_date_sk#37, d_date_sk#39] + +(54) Exchange +Input [3]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_quantity#36] +Arguments: hashpartitioning(cs_bill_customer_sk#34, cs_item_sk#35, 5), ENSURE_REQUIREMENTS, [id=#42] + +(55) Sort [codegen id : 16] +Input [3]: [cs_bill_customer_sk#34, cs_item_sk#35, cs_quantity#36] +Arguments: [cs_bill_customer_sk#34 ASC NULLS FIRST, cs_item_sk#35 ASC NULLS FIRST], false, 0 + +(56) SortMergeJoin [codegen id : 17] +Left keys [2]: [sr_customer_sk#23, sr_item_sk#22] +Right keys [2]: [cs_bill_customer_sk#34, cs_item_sk#35] +Join condition: None + +(57) Project [codegen id : 17] +Output [7]: [ss_quantity#5, sr_return_quantity#25, cs_quantity#36, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] +Input [11]: [ss_quantity#5, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19, sr_item_sk#22, sr_customer_sk#23, sr_return_quantity#25, cs_bill_customer_sk#34, cs_item_sk#35, cs_quantity#36] + +(58) HashAggregate [codegen id : 17] +Input [7]: [ss_quantity#5, sr_return_quantity#25, cs_quantity#36, s_store_id#13, s_store_name#14, i_item_id#18, i_item_desc#19] +Keys [4]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14] +Functions [3]: [partial_sum(ss_quantity#5), partial_sum(sr_return_quantity#25), partial_sum(cs_quantity#36)] +Aggregate Attributes [3]: [sum#43, sum#44, sum#45] +Results [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum#46, sum#47, sum#48] + +(59) Exchange +Input [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum#46, sum#47, sum#48] +Arguments: hashpartitioning(i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, 5), ENSURE_REQUIREMENTS, [id=#49] + +(60) HashAggregate [codegen id : 18] +Input [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum#46, sum#47, sum#48] +Keys [4]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14] +Functions [3]: [sum(ss_quantity#5), sum(sr_return_quantity#25), sum(cs_quantity#36)] +Aggregate Attributes [3]: [sum(ss_quantity#5)#50, sum(sr_return_quantity#25)#51, sum(cs_quantity#36)#52] +Results [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, sum(ss_quantity#5)#50 AS store_sales_quantity#53, sum(sr_return_quantity#25)#51 AS store_returns_quantity#54, sum(cs_quantity#36)#52 AS catalog_sales_quantity#55] + +(61) TakeOrderedAndProject +Input [7]: [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, store_sales_quantity#53, store_returns_quantity#54, catalog_sales_quantity#55] +Arguments: 100, [i_item_id#18 ASC NULLS FIRST, i_item_desc#19 ASC NULLS FIRST, s_store_id#13 ASC NULLS FIRST, s_store_name#14 ASC NULLS FIRST], [i_item_id#18, i_item_desc#19, s_store_id#13, s_store_name#14, store_sales_quantity#53, store_returns_quantity#54, catalog_sales_quantity#55] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (62) + + +(62) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 28 Hosting Expression = sr_returned_date_sk#26 IN dynamicpruning#27 +ReusedExchange (63) + + +(63) ReusedExchange [Reuses operator id: 35] +Output [1]: [d_date_sk#28] + +Subquery:3 Hosting operator id = 44 Hosting Expression = cs_sold_date_sk#37 IN dynamicpruning#38 +ReusedExchange (64) + + +(64) ReusedExchange [Reuses operator id: 51] +Output [1]: [d_date_sk#39] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/simplified.txt new file mode 100644 index 0000000000000..d4c30cb4a2283 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29.sf100/simplified.txt @@ -0,0 +1,110 @@ +TakeOrderedAndProject [i_item_id,i_item_desc,s_store_id,s_store_name,store_sales_quantity,store_returns_quantity,catalog_sales_quantity] + WholeStageCodegen (18) + HashAggregate [i_item_id,i_item_desc,s_store_id,s_store_name,sum,sum,sum] [sum(ss_quantity),sum(sr_return_quantity),sum(cs_quantity),store_sales_quantity,store_returns_quantity,catalog_sales_quantity,sum,sum,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,s_store_id,s_store_name] #1 + WholeStageCodegen (17) + HashAggregate [i_item_id,i_item_desc,s_store_id,s_store_name,ss_quantity,sr_return_quantity,cs_quantity] [sum,sum,sum,sum,sum,sum] + Project [ss_quantity,sr_return_quantity,cs_quantity,s_store_id,s_store_name,i_item_id,i_item_desc] + SortMergeJoin [sr_customer_sk,sr_item_sk,cs_bill_customer_sk,cs_item_sk] + InputAdapter + WholeStageCodegen (13) + Sort [sr_customer_sk,sr_item_sk] + InputAdapter + Exchange [sr_customer_sk,sr_item_sk] #2 + WholeStageCodegen (12) + Project [ss_quantity,s_store_id,s_store_name,i_item_id,i_item_desc,sr_item_sk,sr_customer_sk,sr_return_quantity] + SortMergeJoin [ss_customer_sk,ss_item_sk,ss_ticket_number,sr_customer_sk,sr_item_sk,sr_ticket_number] + InputAdapter + WholeStageCodegen (8) + Sort [ss_customer_sk,ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_customer_sk,ss_item_sk,ss_ticket_number] #3 + WholeStageCodegen (7) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,s_store_id,s_store_name,i_item_id,i_item_desc] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (3) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,s_store_id,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id,s_store_name] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #7 + WholeStageCodegen (5) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc] + InputAdapter + WholeStageCodegen (11) + Sort [sr_customer_sk,sr_item_sk,sr_ticket_number] + InputAdapter + Exchange [sr_customer_sk,sr_item_sk,sr_ticket_number] #8 + WholeStageCodegen (10) + Project [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_customer_sk,sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity,sr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (9) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + WholeStageCodegen (16) + Sort [cs_bill_customer_sk,cs_item_sk] + InputAdapter + Exchange [cs_bill_customer_sk,cs_item_sk] #10 + WholeStageCodegen (15) + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #3 + ReusedExchange [d_date_sk] #11 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (14) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29/explain.txt new file mode 100644 index 0000000000000..45a02422e92b1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29/explain.txt @@ -0,0 +1,319 @@ +== Physical Plan == +TakeOrderedAndProject (52) ++- * HashAggregate (51) + +- Exchange (50) + +- * HashAggregate (49) + +- * Project (48) + +- * BroadcastHashJoin Inner BuildRight (47) + :- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Project (36) + : : +- * BroadcastHashJoin Inner BuildRight (35) + : : :- * Project (29) + : : : +- * BroadcastHashJoin Inner BuildRight (28) + : : : :- * Project (22) + : : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : : :- * Project (15) + : : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : : :- * Project (9) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : +- BroadcastExchange (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.store_returns (4) + : : : : : +- BroadcastExchange (13) + : : : : : +- * Filter (12) + : : : : : +- * ColumnarToRow (11) + : : : : : +- Scan parquet default.catalog_sales (10) + : : : : +- BroadcastExchange (20) + : : : : +- * Project (19) + : : : : +- * Filter (18) + : : : : +- * ColumnarToRow (17) + : : : : +- Scan parquet default.date_dim (16) + : : : +- BroadcastExchange (27) + : : : +- * Project (26) + : : : +- * Filter (25) + : : : +- * ColumnarToRow (24) + : : : +- Scan parquet default.date_dim (23) + : : +- BroadcastExchange (34) + : : +- * Project (33) + : : +- * Filter (32) + : : +- * ColumnarToRow (31) + : : +- Scan parquet default.date_dim (30) + : +- BroadcastExchange (40) + : +- * Filter (39) + : +- * ColumnarToRow (38) + : +- Scan parquet default.store (37) + +- BroadcastExchange (46) + +- * Filter (45) + +- * ColumnarToRow (44) + +- Scan parquet default.item (43) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 8] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 8] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_customer_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_ticket_number#4)) AND isnotnull(ss_store_sk#3)) + +(4) Scan parquet default.store_returns +Output [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#12), dynamicpruningexpression(sr_returned_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(sr_customer_sk), IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] + +(6) Filter [codegen id : 1] +Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] +Condition : ((isnotnull(sr_customer_sk#9) AND isnotnull(sr_item_sk#8)) AND isnotnull(sr_ticket_number#10)) + +(7) BroadcastExchange +Input [5]: [sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(input[1, int, false], input[0, int, false], input[2, int, false]),false), [id=#14] + +(8) BroadcastHashJoin [codegen id : 8] +Left keys [3]: [ss_customer_sk#2, ss_item_sk#1, ss_ticket_number#4] +Right keys [3]: [sr_customer_sk#9, sr_item_sk#8, sr_ticket_number#10] +Join condition: None + +(9) Project [codegen id : 8] +Output [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_return_quantity#11, sr_returned_date_sk#12] +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_quantity#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] + +(10) Scan parquet default.catalog_sales +Output [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#19)] +PushedFilters: [IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] + +(12) Filter [codegen id : 2] +Input [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] +Condition : (isnotnull(cs_bill_customer_sk#15) AND isnotnull(cs_item_sk#16)) + +(13) BroadcastExchange +Input [4]: [cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[1, int, false] as bigint) & 4294967295))),false), [id=#20] + +(14) BroadcastHashJoin [codegen id : 8] +Left keys [2]: [sr_customer_sk#9, sr_item_sk#8] +Right keys [2]: [cs_bill_customer_sk#15, cs_item_sk#16] +Join condition: None + +(15) Project [codegen id : 8] +Output [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18] +Input [12]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_item_sk#8, sr_customer_sk#9, sr_return_quantity#11, sr_returned_date_sk#12, cs_bill_customer_sk#15, cs_item_sk#16, cs_quantity#17, cs_sold_date_sk#18] + +(16) Scan parquet default.date_dim +Output [3]: [d_date_sk#21, d_year#22, d_moy#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,9), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#21, d_year#22, d_moy#23] + +(18) Filter [codegen id : 3] +Input [3]: [d_date_sk#21, d_year#22, d_moy#23] +Condition : ((((isnotnull(d_moy#23) AND isnotnull(d_year#22)) AND (d_moy#23 = 9)) AND (d_year#22 = 1999)) AND isnotnull(d_date_sk#21)) + +(19) Project [codegen id : 3] +Output [1]: [d_date_sk#21] +Input [3]: [d_date_sk#21, d_year#22, d_moy#23] + +(20) BroadcastExchange +Input [1]: [d_date_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(21) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#21] +Join condition: None + +(22) Project [codegen id : 8] +Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18] +Input [9]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, ss_sold_date_sk#6, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18, d_date_sk#21] + +(23) Scan parquet default.date_dim +Output [3]: [d_date_sk#25, d_year#26, d_moy#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), GreaterThanOrEqual(d_moy,9), LessThanOrEqual(d_moy,12), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [3]: [d_date_sk#25, d_year#26, d_moy#27] + +(25) Filter [codegen id : 4] +Input [3]: [d_date_sk#25, d_year#26, d_moy#27] +Condition : (((((isnotnull(d_moy#27) AND isnotnull(d_year#26)) AND (d_moy#27 >= 9)) AND (d_moy#27 <= 12)) AND (d_year#26 = 1999)) AND isnotnull(d_date_sk#25)) + +(26) Project [codegen id : 4] +Output [1]: [d_date_sk#25] +Input [3]: [d_date_sk#25, d_year#26, d_moy#27] + +(27) BroadcastExchange +Input [1]: [d_date_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] + +(28) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [sr_returned_date_sk#12] +Right keys [1]: [d_date_sk#25] +Join condition: None + +(29) Project [codegen id : 8] +Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, cs_sold_date_sk#18] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, sr_returned_date_sk#12, cs_quantity#17, cs_sold_date_sk#18, d_date_sk#25] + +(30) Scan parquet default.date_dim +Output [2]: [d_date_sk#29, d_year#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#29, d_year#30] + +(32) Filter [codegen id : 5] +Input [2]: [d_date_sk#29, d_year#30] +Condition : (d_year#30 IN (1999,2000,2001) AND isnotnull(d_date_sk#29)) + +(33) Project [codegen id : 5] +Output [1]: [d_date_sk#29] +Input [2]: [d_date_sk#29, d_year#30] + +(34) BroadcastExchange +Input [1]: [d_date_sk#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#31] + +(35) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#29] +Join condition: None + +(36) Project [codegen id : 8] +Output [5]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17] +Input [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, cs_sold_date_sk#18, d_date_sk#29] + +(37) Scan parquet default.store +Output [3]: [s_store_sk#32, s_store_id#33, s_store_name#34] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(38) ColumnarToRow [codegen id : 6] +Input [3]: [s_store_sk#32, s_store_id#33, s_store_name#34] + +(39) Filter [codegen id : 6] +Input [3]: [s_store_sk#32, s_store_id#33, s_store_name#34] +Condition : isnotnull(s_store_sk#32) + +(40) BroadcastExchange +Input [3]: [s_store_sk#32, s_store_id#33, s_store_name#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#35] + +(41) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#32] +Join condition: None + +(42) Project [codegen id : 8] +Output [6]: [ss_item_sk#1, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_store_id#33, s_store_name#34] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_store_sk#32, s_store_id#33, s_store_name#34] + +(43) Scan parquet default.item +Output [3]: [i_item_sk#36, i_item_id#37, i_item_desc#38] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(44) ColumnarToRow [codegen id : 7] +Input [3]: [i_item_sk#36, i_item_id#37, i_item_desc#38] + +(45) Filter [codegen id : 7] +Input [3]: [i_item_sk#36, i_item_id#37, i_item_desc#38] +Condition : isnotnull(i_item_sk#36) + +(46) BroadcastExchange +Input [3]: [i_item_sk#36, i_item_id#37, i_item_desc#38] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#39] + +(47) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#36] +Join condition: None + +(48) Project [codegen id : 8] +Output [7]: [ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_store_id#33, s_store_name#34, i_item_id#37, i_item_desc#38] +Input [9]: [ss_item_sk#1, ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_store_id#33, s_store_name#34, i_item_sk#36, i_item_id#37, i_item_desc#38] + +(49) HashAggregate [codegen id : 8] +Input [7]: [ss_quantity#5, sr_return_quantity#11, cs_quantity#17, s_store_id#33, s_store_name#34, i_item_id#37, i_item_desc#38] +Keys [4]: [i_item_id#37, i_item_desc#38, s_store_id#33, s_store_name#34] +Functions [3]: [partial_sum(ss_quantity#5), partial_sum(sr_return_quantity#11), partial_sum(cs_quantity#17)] +Aggregate Attributes [3]: [sum#40, sum#41, sum#42] +Results [7]: [i_item_id#37, i_item_desc#38, s_store_id#33, s_store_name#34, sum#43, sum#44, sum#45] + +(50) Exchange +Input [7]: [i_item_id#37, i_item_desc#38, s_store_id#33, s_store_name#34, sum#43, sum#44, sum#45] +Arguments: hashpartitioning(i_item_id#37, i_item_desc#38, s_store_id#33, s_store_name#34, 5), ENSURE_REQUIREMENTS, [id=#46] + +(51) HashAggregate [codegen id : 9] +Input [7]: [i_item_id#37, i_item_desc#38, s_store_id#33, s_store_name#34, sum#43, sum#44, sum#45] +Keys [4]: [i_item_id#37, i_item_desc#38, s_store_id#33, s_store_name#34] +Functions [3]: [sum(ss_quantity#5), sum(sr_return_quantity#11), sum(cs_quantity#17)] +Aggregate Attributes [3]: [sum(ss_quantity#5)#47, sum(sr_return_quantity#11)#48, sum(cs_quantity#17)#49] +Results [7]: [i_item_id#37, i_item_desc#38, s_store_id#33, s_store_name#34, sum(ss_quantity#5)#47 AS store_sales_quantity#50, sum(sr_return_quantity#11)#48 AS store_returns_quantity#51, sum(cs_quantity#17)#49 AS catalog_sales_quantity#52] + +(52) TakeOrderedAndProject +Input [7]: [i_item_id#37, i_item_desc#38, s_store_id#33, s_store_name#34, store_sales_quantity#50, store_returns_quantity#51, catalog_sales_quantity#52] +Arguments: 100, [i_item_id#37 ASC NULLS FIRST, i_item_desc#38 ASC NULLS FIRST, s_store_id#33 ASC NULLS FIRST, s_store_name#34 ASC NULLS FIRST], [i_item_id#37, i_item_desc#38, s_store_id#33, s_store_name#34, store_sales_quantity#50, store_returns_quantity#51, catalog_sales_quantity#52] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (53) + + +(53) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#21] + +Subquery:2 Hosting operator id = 4 Hosting Expression = sr_returned_date_sk#12 IN dynamicpruning#13 +ReusedExchange (54) + + +(54) ReusedExchange [Reuses operator id: 27] +Output [1]: [d_date_sk#25] + +Subquery:3 Hosting operator id = 10 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#19 +ReusedExchange (55) + + +(55) ReusedExchange [Reuses operator id: 34] +Output [1]: [d_date_sk#29] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29/simplified.txt new file mode 100644 index 0000000000000..a5ad345ea77c8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q29/simplified.txt @@ -0,0 +1,83 @@ +TakeOrderedAndProject [i_item_id,i_item_desc,s_store_id,s_store_name,store_sales_quantity,store_returns_quantity,catalog_sales_quantity] + WholeStageCodegen (9) + HashAggregate [i_item_id,i_item_desc,s_store_id,s_store_name,sum,sum,sum] [sum(ss_quantity),sum(sr_return_quantity),sum(cs_quantity),store_sales_quantity,store_returns_quantity,catalog_sales_quantity,sum,sum,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,s_store_id,s_store_name] #1 + WholeStageCodegen (8) + HashAggregate [i_item_id,i_item_desc,s_store_id,s_store_name,ss_quantity,sr_return_quantity,cs_quantity] [sum,sum,sum,sum,sum,sum] + Project [ss_quantity,sr_return_quantity,cs_quantity,s_store_id,s_store_name,i_item_id,i_item_desc] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,sr_return_quantity,cs_quantity,s_store_id,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,sr_return_quantity,cs_quantity] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,sr_return_quantity,cs_quantity,cs_sold_date_sk] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,sr_return_quantity,sr_returned_date_sk,cs_quantity,cs_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_sold_date_sk,sr_return_quantity,sr_returned_date_sk,cs_quantity,cs_sold_date_sk] + BroadcastHashJoin [sr_customer_sk,sr_item_sk,cs_bill_customer_sk,cs_item_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_sold_date_sk,sr_item_sk,sr_customer_sk,sr_return_quantity,sr_returned_date_sk] + BroadcastHashJoin [ss_customer_sk,ss_item_sk,ss_ticket_number,sr_customer_sk,sr_item_sk,sr_ticket_number] + Filter [ss_customer_sk,ss_item_sk,ss_ticket_number,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_quantity,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [sr_customer_sk,sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_return_quantity,sr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #3 + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (6) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id,s_store_name] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (7) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/explain.txt new file mode 100644 index 0000000000000..d94a1f3b14b4e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/explain.txt @@ -0,0 +1,133 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.date_dim (11) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manufact_id#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,128), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manufact_id#8] + +(6) Filter [codegen id : 1] +Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manufact_id#8] +Condition : ((isnotnull(i_manufact_id#8) AND (i_manufact_id#8 = 128)) AND isnotnull(i_item_sk#5)) + +(7) Project [codegen id : 1] +Output [3]: [i_item_sk#5, i_brand_id#6, i_brand#7] +Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manufact_id#8] + +(8) BroadcastExchange +Input [3]: [i_item_sk#5, i_brand_id#6, i_brand#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(10) Project [codegen id : 3] +Output [4]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_brand_id#6, i_brand#7] +Input [6]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_sk#5, i_brand_id#6, i_brand#7] + +(11) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(13) Filter [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Condition : ((isnotnull(d_moy#12) AND (d_moy#12 = 11)) AND isnotnull(d_date_sk#10)) + +(14) Project [codegen id : 2] +Output [2]: [d_date_sk#10, d_year#11] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(15) BroadcastExchange +Input [2]: [d_date_sk#10, d_year#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_year#11, ss_ext_sales_price#2, i_brand_id#6, i_brand#7] +Input [6]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_brand_id#6, i_brand#7, d_date_sk#10, d_year#11] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_year#11, ss_ext_sales_price#2, i_brand_id#6, i_brand#7] +Keys [3]: [d_year#11, i_brand#7, i_brand_id#6] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#14] +Results [4]: [d_year#11, i_brand#7, i_brand_id#6, sum#15] + +(19) Exchange +Input [4]: [d_year#11, i_brand#7, i_brand_id#6, sum#15] +Arguments: hashpartitioning(d_year#11, i_brand#7, i_brand_id#6, 5), ENSURE_REQUIREMENTS, [id=#16] + +(20) HashAggregate [codegen id : 4] +Input [4]: [d_year#11, i_brand#7, i_brand_id#6, sum#15] +Keys [3]: [d_year#11, i_brand#7, i_brand_id#6] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#17] +Results [4]: [d_year#11, i_brand_id#6 AS brand_id#18, i_brand#7 AS brand#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#17,17,2) AS sum_agg#20] + +(21) TakeOrderedAndProject +Input [4]: [d_year#11, brand_id#18, brand#19, sum_agg#20] +Arguments: 100, [d_year#11 ASC NULLS FIRST, sum_agg#20 DESC NULLS LAST, brand_id#18 ASC NULLS FIRST], [d_year#11, brand_id#18, brand#19, sum_agg#20] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (22) + + +(22) ReusedExchange [Reuses operator id: 15] +Output [2]: [d_date_sk#10, d_year#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/simplified.txt new file mode 100644 index 0000000000000..9a4679289d519 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3.sf100/simplified.txt @@ -0,0 +1,33 @@ +TakeOrderedAndProject [d_year,sum_agg,brand_id,brand] + WholeStageCodegen (4) + HashAggregate [d_year,i_brand,i_brand_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,sum_agg,sum] + InputAdapter + Exchange [d_year,i_brand,i_brand_id] #1 + WholeStageCodegen (3) + HashAggregate [d_year,i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] + Project [d_year,ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_ext_sales_price,ss_sold_date_sk,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk,d_year] + Filter [d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3/explain.txt new file mode 100644 index 0000000000000..77eb7fefd4d05 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3/explain.txt @@ -0,0 +1,123 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- BroadcastExchange (8) + : +- * Filter (7) + : +- * ColumnarToRow (6) + : +- Scan parquet default.store_sales (5) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((isnotnull(d_moy#3) AND (d_moy#3 = 11)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 3] +Output [2]: [d_date_sk#1, d_year#2] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) Scan parquet default.store_sales +Output [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(7) Filter [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Condition : isnotnull(ss_item_sk#4) + +(8) BroadcastExchange +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5] +Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(11) Scan parquet default.item +Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manufact_id#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,128), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manufact_id#11] + +(13) Filter [codegen id : 2] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manufact_id#11] +Condition : ((isnotnull(i_manufact_id#11) AND (i_manufact_id#11 = 128)) AND isnotnull(i_item_sk#8)) + +(14) Project [codegen id : 2] +Output [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manufact_id#11] + +(15) BroadcastExchange +Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#4] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_year#2, ss_ext_sales_price#5, i_brand_id#9, i_brand#10] +Input [6]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_brand_id#9, i_brand#10] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_year#2, ss_ext_sales_price#5, i_brand_id#9, i_brand#10] +Keys [3]: [d_year#2, i_brand#10, i_brand_id#9] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum#13] +Results [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] + +(19) Exchange +Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] +Arguments: hashpartitioning(d_year#2, i_brand#10, i_brand_id#9, 5), ENSURE_REQUIREMENTS, [id=#15] + +(20) HashAggregate [codegen id : 4] +Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] +Keys [3]: [d_year#2, i_brand#10, i_brand_id#9] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#16] +Results [4]: [d_year#2, i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#16,17,2) AS sum_agg#19] + +(21) TakeOrderedAndProject +Input [4]: [d_year#2, brand_id#17, brand#18, sum_agg#19] +Arguments: 100, [d_year#2 ASC NULLS FIRST, sum_agg#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [d_year#2, brand_id#17, brand#18, sum_agg#19] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3/simplified.txt new file mode 100644 index 0000000000000..e05ba42f4e0ee --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q3/simplified.txt @@ -0,0 +1,31 @@ +TakeOrderedAndProject [d_year,sum_agg,brand_id,brand] + WholeStageCodegen (4) + HashAggregate [d_year,i_brand,i_brand_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,sum_agg,sum] + InputAdapter + Exchange [d_year,i_brand,i_brand_id] #1 + WholeStageCodegen (3) + HashAggregate [d_year,i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] + Project [d_year,ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [d_year,ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [d_date_sk,d_year] + Filter [d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manufact_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt new file mode 100644 index 0000000000000..6fdac15976957 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/explain.txt @@ -0,0 +1,347 @@ +== Physical Plan == +TakeOrderedAndProject (59) ++- * Project (58) + +- * BroadcastHashJoin Inner BuildRight (57) + :- * Project (36) + : +- * BroadcastHashJoin Inner BuildLeft (35) + : :- BroadcastExchange (11) + : : +- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.customer (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.customer_address (4) + : +- * Filter (34) + : +- * HashAggregate (33) + : +- Exchange (32) + : +- * HashAggregate (31) + : +- * Project (30) + : +- * SortMergeJoin Inner (29) + : :- * Sort (23) + : : +- Exchange (22) + : : +- * Project (21) + : : +- * BroadcastHashJoin Inner BuildRight (20) + : : :- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.web_returns (12) + : : +- BroadcastExchange (19) + : : +- * Project (18) + : : +- * Filter (17) + : : +- * ColumnarToRow (16) + : : +- Scan parquet default.date_dim (15) + : +- * Sort (28) + : +- Exchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.customer_address (24) + +- BroadcastExchange (56) + +- * Filter (55) + +- * HashAggregate (54) + +- Exchange (53) + +- * HashAggregate (52) + +- * HashAggregate (51) + +- Exchange (50) + +- * HashAggregate (49) + +- * Project (48) + +- * SortMergeJoin Inner (47) + :- * Sort (44) + : +- Exchange (43) + : +- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Filter (39) + : : +- * ColumnarToRow (38) + : : +- Scan parquet default.web_returns (37) + : +- ReusedExchange (40) + +- * Sort (46) + +- ReusedExchange (45) + + +(1) Scan parquet default.customer +Output [14]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [14]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14] + +(3) Filter [codegen id : 2] +Input [14]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#3)) + +(4) Scan parquet default.customer_address +Output [2]: [ca_address_sk#15, ca_state#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [ca_address_sk#15, ca_state#16] + +(6) Filter [codegen id : 1] +Input [2]: [ca_address_sk#15, ca_state#16] +Condition : ((isnotnull(ca_state#16) AND (ca_state#16 = GA)) AND isnotnull(ca_address_sk#15)) + +(7) Project [codegen id : 1] +Output [1]: [ca_address_sk#15] +Input [2]: [ca_address_sk#15, ca_state#16] + +(8) BroadcastExchange +Input [1]: [ca_address_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#15] +Join condition: None + +(10) Project [codegen id : 2] +Output [13]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14] +Input [15]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ca_address_sk#15] + +(11) BroadcastExchange +Input [13]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(12) Scan parquet default.web_returns +Output [4]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#22), dynamicpruningexpression(wr_returned_date_sk#22 IN dynamicpruning#23)] +PushedFilters: [IsNotNull(wr_returning_addr_sk), IsNotNull(wr_returning_customer_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 4] +Input [4]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22] + +(14) Filter [codegen id : 4] +Input [4]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22] +Condition : (isnotnull(wr_returning_addr_sk#20) AND isnotnull(wr_returning_customer_sk#19)) + +(15) Scan parquet default.date_dim +Output [2]: [d_date_sk#24, d_year#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#24, d_year#25] + +(17) Filter [codegen id : 3] +Input [2]: [d_date_sk#24, d_year#25] +Condition : ((isnotnull(d_year#25) AND (d_year#25 = 2002)) AND isnotnull(d_date_sk#24)) + +(18) Project [codegen id : 3] +Output [1]: [d_date_sk#24] +Input [2]: [d_date_sk#24, d_year#25] + +(19) BroadcastExchange +Input [1]: [d_date_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] + +(20) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [wr_returned_date_sk#22] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(21) Project [codegen id : 4] +Output [3]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21] +Input [5]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22, d_date_sk#24] + +(22) Exchange +Input [3]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21] +Arguments: hashpartitioning(wr_returning_addr_sk#20, 5), ENSURE_REQUIREMENTS, [id=#27] + +(23) Sort [codegen id : 5] +Input [3]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21] +Arguments: [wr_returning_addr_sk#20 ASC NULLS FIRST], false, 0 + +(24) Scan parquet default.customer_address +Output [2]: [ca_address_sk#28, ca_state#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_state)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 6] +Input [2]: [ca_address_sk#28, ca_state#29] + +(26) Filter [codegen id : 6] +Input [2]: [ca_address_sk#28, ca_state#29] +Condition : (isnotnull(ca_address_sk#28) AND isnotnull(ca_state#29)) + +(27) Exchange +Input [2]: [ca_address_sk#28, ca_state#29] +Arguments: hashpartitioning(ca_address_sk#28, 5), ENSURE_REQUIREMENTS, [id=#30] + +(28) Sort [codegen id : 7] +Input [2]: [ca_address_sk#28, ca_state#29] +Arguments: [ca_address_sk#28 ASC NULLS FIRST], false, 0 + +(29) SortMergeJoin [codegen id : 8] +Left keys [1]: [wr_returning_addr_sk#20] +Right keys [1]: [ca_address_sk#28] +Join condition: None + +(30) Project [codegen id : 8] +Output [3]: [wr_returning_customer_sk#19, wr_return_amt#21, ca_state#29] +Input [5]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, ca_address_sk#28, ca_state#29] + +(31) HashAggregate [codegen id : 8] +Input [3]: [wr_returning_customer_sk#19, wr_return_amt#21, ca_state#29] +Keys [2]: [wr_returning_customer_sk#19, ca_state#29] +Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#21))] +Aggregate Attributes [1]: [sum#31] +Results [3]: [wr_returning_customer_sk#19, ca_state#29, sum#32] + +(32) Exchange +Input [3]: [wr_returning_customer_sk#19, ca_state#29, sum#32] +Arguments: hashpartitioning(wr_returning_customer_sk#19, ca_state#29, 5), ENSURE_REQUIREMENTS, [id=#33] + +(33) HashAggregate +Input [3]: [wr_returning_customer_sk#19, ca_state#29, sum#32] +Keys [2]: [wr_returning_customer_sk#19, ca_state#29] +Functions [1]: [sum(UnscaledValue(wr_return_amt#21))] +Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#21))#34] +Results [3]: [wr_returning_customer_sk#19 AS ctr_customer_sk#35, ca_state#29 AS ctr_state#36, MakeDecimal(sum(UnscaledValue(wr_return_amt#21))#34,17,2) AS ctr_total_return#37] + +(34) Filter +Input [3]: [ctr_customer_sk#35, ctr_state#36, ctr_total_return#37] +Condition : isnotnull(ctr_total_return#37) + +(35) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ctr_customer_sk#35] +Join condition: None + +(36) Project [codegen id : 17] +Output [14]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ctr_state#36, ctr_total_return#37] +Input [16]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ctr_customer_sk#35, ctr_state#36, ctr_total_return#37] + +(37) Scan parquet default.web_returns +Output [4]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40, wr_returned_date_sk#41] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#41), dynamicpruningexpression(wr_returned_date_sk#41 IN dynamicpruning#23)] +PushedFilters: [IsNotNull(wr_returning_addr_sk)] +ReadSchema: struct + +(38) ColumnarToRow [codegen id : 10] +Input [4]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40, wr_returned_date_sk#41] + +(39) Filter [codegen id : 10] +Input [4]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40, wr_returned_date_sk#41] +Condition : isnotnull(wr_returning_addr_sk#39) + +(40) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#42] + +(41) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [wr_returned_date_sk#41] +Right keys [1]: [d_date_sk#42] +Join condition: None + +(42) Project [codegen id : 10] +Output [3]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40] +Input [5]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40, wr_returned_date_sk#41, d_date_sk#42] + +(43) Exchange +Input [3]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40] +Arguments: hashpartitioning(wr_returning_addr_sk#39, 5), ENSURE_REQUIREMENTS, [id=#43] + +(44) Sort [codegen id : 11] +Input [3]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40] +Arguments: [wr_returning_addr_sk#39 ASC NULLS FIRST], false, 0 + +(45) ReusedExchange [Reuses operator id: 27] +Output [2]: [ca_address_sk#44, ca_state#45] + +(46) Sort [codegen id : 13] +Input [2]: [ca_address_sk#44, ca_state#45] +Arguments: [ca_address_sk#44 ASC NULLS FIRST], false, 0 + +(47) SortMergeJoin [codegen id : 14] +Left keys [1]: [wr_returning_addr_sk#39] +Right keys [1]: [ca_address_sk#44] +Join condition: None + +(48) Project [codegen id : 14] +Output [3]: [wr_returning_customer_sk#38, wr_return_amt#40, ca_state#45] +Input [5]: [wr_returning_customer_sk#38, wr_returning_addr_sk#39, wr_return_amt#40, ca_address_sk#44, ca_state#45] + +(49) HashAggregate [codegen id : 14] +Input [3]: [wr_returning_customer_sk#38, wr_return_amt#40, ca_state#45] +Keys [2]: [wr_returning_customer_sk#38, ca_state#45] +Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#40))] +Aggregate Attributes [1]: [sum#46] +Results [3]: [wr_returning_customer_sk#38, ca_state#45, sum#47] + +(50) Exchange +Input [3]: [wr_returning_customer_sk#38, ca_state#45, sum#47] +Arguments: hashpartitioning(wr_returning_customer_sk#38, ca_state#45, 5), ENSURE_REQUIREMENTS, [id=#48] + +(51) HashAggregate [codegen id : 15] +Input [3]: [wr_returning_customer_sk#38, ca_state#45, sum#47] +Keys [2]: [wr_returning_customer_sk#38, ca_state#45] +Functions [1]: [sum(UnscaledValue(wr_return_amt#40))] +Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#40))#49] +Results [2]: [ca_state#45 AS ctr_state#36, MakeDecimal(sum(UnscaledValue(wr_return_amt#40))#49,17,2) AS ctr_total_return#37] + +(52) HashAggregate [codegen id : 15] +Input [2]: [ctr_state#36, ctr_total_return#37] +Keys [1]: [ctr_state#36] +Functions [1]: [partial_avg(ctr_total_return#37)] +Aggregate Attributes [2]: [sum#50, count#51] +Results [3]: [ctr_state#36, sum#52, count#53] + +(53) Exchange +Input [3]: [ctr_state#36, sum#52, count#53] +Arguments: hashpartitioning(ctr_state#36, 5), ENSURE_REQUIREMENTS, [id=#54] + +(54) HashAggregate [codegen id : 16] +Input [3]: [ctr_state#36, sum#52, count#53] +Keys [1]: [ctr_state#36] +Functions [1]: [avg(ctr_total_return#37)] +Aggregate Attributes [1]: [avg(ctr_total_return#37)#55] +Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#37)#55) * 1.200000), DecimalType(24,7), true) AS (avg(ctr_total_return) * 1.2)#56, ctr_state#36 AS ctr_state#36#57] + +(55) Filter [codegen id : 16] +Input [2]: [(avg(ctr_total_return) * 1.2)#56, ctr_state#36#57] +Condition : isnotnull((avg(ctr_total_return) * 1.2)#56) + +(56) BroadcastExchange +Input [2]: [(avg(ctr_total_return) * 1.2)#56, ctr_state#36#57] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#58] + +(57) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ctr_state#36] +Right keys [1]: [ctr_state#36#57] +Join condition: (cast(ctr_total_return#37 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#56) + +(58) Project [codegen id : 17] +Output [13]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ctr_total_return#37] +Input [16]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ctr_state#36, ctr_total_return#37, (avg(ctr_total_return) * 1.2)#56, ctr_state#36#57] + +(59) TakeOrderedAndProject +Input [13]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ctr_total_return#37] +Arguments: 100, [c_customer_id#2 ASC NULLS FIRST, c_salutation#4 ASC NULLS FIRST, c_first_name#5 ASC NULLS FIRST, c_last_name#6 ASC NULLS FIRST, c_preferred_cust_flag#7 ASC NULLS FIRST, c_birth_day#8 ASC NULLS FIRST, c_birth_month#9 ASC NULLS FIRST, c_birth_year#10 ASC NULLS FIRST, c_birth_country#11 ASC NULLS FIRST, c_login#12 ASC NULLS FIRST, c_email_address#13 ASC NULLS FIRST, c_last_review_date#14 ASC NULLS FIRST, ctr_total_return#37 ASC NULLS FIRST], [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, c_preferred_cust_flag#7, c_birth_day#8, c_birth_month#9, c_birth_year#10, c_birth_country#11, c_login#12, c_email_address#13, c_last_review_date#14, ctr_total_return#37] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 12 Hosting Expression = wr_returned_date_sk#22 IN dynamicpruning#23 +ReusedExchange (60) + + +(60) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#24] + +Subquery:2 Hosting operator id = 37 Hosting Expression = wr_returned_date_sk#41 IN dynamicpruning#23 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt new file mode 100644 index 0000000000000..e8c44d275d745 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30.sf100/simplified.txt @@ -0,0 +1,99 @@ +TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date,ctr_total_return] + WholeStageCodegen (17) + Project [c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date,ctr_total_return] + BroadcastHashJoin [ctr_state,ctr_state,ctr_total_return,(avg(ctr_total_return) * 1.2)] + Project [c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date,ctr_state,ctr_total_return] + BroadcastHashJoin [c_customer_sk,ctr_customer_sk] + InputAdapter + BroadcastExchange #1 + WholeStageCodegen (2) + Project [c_customer_sk,c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + Filter [ctr_total_return] + HashAggregate [wr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(wr_return_amt)),ctr_customer_sk,ctr_state,ctr_total_return,sum] + InputAdapter + Exchange [wr_returning_customer_sk,ca_state] #3 + WholeStageCodegen (8) + HashAggregate [wr_returning_customer_sk,ca_state,wr_return_amt] [sum,sum] + Project [wr_returning_customer_sk,wr_return_amt,ca_state] + SortMergeJoin [wr_returning_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (5) + Sort [wr_returning_addr_sk] + InputAdapter + Exchange [wr_returning_addr_sk] #4 + WholeStageCodegen (4) + Project [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + Filter [wr_returning_addr_sk,wr_returning_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt,wr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (7) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #6 + WholeStageCodegen (6) + Filter [ca_address_sk,ca_state] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (16) + Filter [(avg(ctr_total_return) * 1.2)] + HashAggregate [ctr_state,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_state,sum,count] + InputAdapter + Exchange [ctr_state] #8 + WholeStageCodegen (15) + HashAggregate [ctr_state,ctr_total_return] [sum,count,sum,count] + HashAggregate [wr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(wr_return_amt)),ctr_state,ctr_total_return,sum] + InputAdapter + Exchange [wr_returning_customer_sk,ca_state] #9 + WholeStageCodegen (14) + HashAggregate [wr_returning_customer_sk,ca_state,wr_return_amt] [sum,sum] + Project [wr_returning_customer_sk,wr_return_amt,ca_state] + SortMergeJoin [wr_returning_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (11) + Sort [wr_returning_addr_sk] + InputAdapter + Exchange [wr_returning_addr_sk] #10 + WholeStageCodegen (10) + Project [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + Filter [wr_returning_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt,wr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + WholeStageCodegen (13) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_state] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30/explain.txt new file mode 100644 index 0000000000000..ca8b8d966ea92 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30/explain.txt @@ -0,0 +1,317 @@ +== Physical Plan == +TakeOrderedAndProject (53) ++- * Project (52) + +- * BroadcastHashJoin Inner BuildRight (51) + :- * Project (45) + : +- * BroadcastHashJoin Inner BuildRight (44) + : :- * Project (39) + : : +- * BroadcastHashJoin Inner BuildRight (38) + : : :- * Filter (20) + : : : +- * HashAggregate (19) + : : : +- Exchange (18) + : : : +- * HashAggregate (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_returns (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.customer_address (11) + : : +- BroadcastExchange (37) + : : +- * Filter (36) + : : +- * HashAggregate (35) + : : +- Exchange (34) + : : +- * HashAggregate (33) + : : +- * HashAggregate (32) + : : +- Exchange (31) + : : +- * HashAggregate (30) + : : +- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Project (26) + : : : +- * BroadcastHashJoin Inner BuildRight (25) + : : : :- * Filter (23) + : : : : +- * ColumnarToRow (22) + : : : : +- Scan parquet default.web_returns (21) + : : : +- ReusedExchange (24) + : : +- ReusedExchange (27) + : +- BroadcastExchange (43) + : +- * Filter (42) + : +- * ColumnarToRow (41) + : +- Scan parquet default.customer (40) + +- BroadcastExchange (50) + +- * Project (49) + +- * Filter (48) + +- * ColumnarToRow (47) + +- Scan parquet default.customer_address (46) + + +(1) Scan parquet default.web_returns +Output [4]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#4), dynamicpruningexpression(wr_returned_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(wr_returning_addr_sk), IsNotNull(wr_returning_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4] +Condition : (isnotnull(wr_returning_addr_sk#2) AND isnotnull(wr_returning_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_year#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] +Condition : ((isnotnull(d_year#7) AND (d_year#7 = 2002)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_year#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [wr_returned_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3] +Input [5]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, wr_returned_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.customer_address +Output [2]: [ca_address_sk#9, ca_state#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_state)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [ca_address_sk#9, ca_state#10] + +(13) Filter [codegen id : 2] +Input [2]: [ca_address_sk#9, ca_state#10] +Condition : (isnotnull(ca_address_sk#9) AND isnotnull(ca_state#10)) + +(14) BroadcastExchange +Input [2]: [ca_address_sk#9, ca_state#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [wr_returning_addr_sk#2] +Right keys [1]: [ca_address_sk#9] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [wr_returning_customer_sk#1, wr_return_amt#3, ca_state#10] +Input [5]: [wr_returning_customer_sk#1, wr_returning_addr_sk#2, wr_return_amt#3, ca_address_sk#9, ca_state#10] + +(17) HashAggregate [codegen id : 3] +Input [3]: [wr_returning_customer_sk#1, wr_return_amt#3, ca_state#10] +Keys [2]: [wr_returning_customer_sk#1, ca_state#10] +Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#3))] +Aggregate Attributes [1]: [sum#12] +Results [3]: [wr_returning_customer_sk#1, ca_state#10, sum#13] + +(18) Exchange +Input [3]: [wr_returning_customer_sk#1, ca_state#10, sum#13] +Arguments: hashpartitioning(wr_returning_customer_sk#1, ca_state#10, 5), ENSURE_REQUIREMENTS, [id=#14] + +(19) HashAggregate [codegen id : 11] +Input [3]: [wr_returning_customer_sk#1, ca_state#10, sum#13] +Keys [2]: [wr_returning_customer_sk#1, ca_state#10] +Functions [1]: [sum(UnscaledValue(wr_return_amt#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#3))#15] +Results [3]: [wr_returning_customer_sk#1 AS ctr_customer_sk#16, ca_state#10 AS ctr_state#17, MakeDecimal(sum(UnscaledValue(wr_return_amt#3))#15,17,2) AS ctr_total_return#18] + +(20) Filter [codegen id : 11] +Input [3]: [ctr_customer_sk#16, ctr_state#17, ctr_total_return#18] +Condition : isnotnull(ctr_total_return#18) + +(21) Scan parquet default.web_returns +Output [4]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#22), dynamicpruningexpression(wr_returned_date_sk#22 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(wr_returning_addr_sk)] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 6] +Input [4]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22] + +(23) Filter [codegen id : 6] +Input [4]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22] +Condition : isnotnull(wr_returning_addr_sk#20) + +(24) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#23] + +(25) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [wr_returned_date_sk#22] +Right keys [1]: [d_date_sk#23] +Join condition: None + +(26) Project [codegen id : 6] +Output [3]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21] +Input [5]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, wr_returned_date_sk#22, d_date_sk#23] + +(27) ReusedExchange [Reuses operator id: 14] +Output [2]: [ca_address_sk#24, ca_state#25] + +(28) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [wr_returning_addr_sk#20] +Right keys [1]: [ca_address_sk#24] +Join condition: None + +(29) Project [codegen id : 6] +Output [3]: [wr_returning_customer_sk#19, wr_return_amt#21, ca_state#25] +Input [5]: [wr_returning_customer_sk#19, wr_returning_addr_sk#20, wr_return_amt#21, ca_address_sk#24, ca_state#25] + +(30) HashAggregate [codegen id : 6] +Input [3]: [wr_returning_customer_sk#19, wr_return_amt#21, ca_state#25] +Keys [2]: [wr_returning_customer_sk#19, ca_state#25] +Functions [1]: [partial_sum(UnscaledValue(wr_return_amt#21))] +Aggregate Attributes [1]: [sum#26] +Results [3]: [wr_returning_customer_sk#19, ca_state#25, sum#27] + +(31) Exchange +Input [3]: [wr_returning_customer_sk#19, ca_state#25, sum#27] +Arguments: hashpartitioning(wr_returning_customer_sk#19, ca_state#25, 5), ENSURE_REQUIREMENTS, [id=#28] + +(32) HashAggregate [codegen id : 7] +Input [3]: [wr_returning_customer_sk#19, ca_state#25, sum#27] +Keys [2]: [wr_returning_customer_sk#19, ca_state#25] +Functions [1]: [sum(UnscaledValue(wr_return_amt#21))] +Aggregate Attributes [1]: [sum(UnscaledValue(wr_return_amt#21))#29] +Results [2]: [ca_state#25 AS ctr_state#17, MakeDecimal(sum(UnscaledValue(wr_return_amt#21))#29,17,2) AS ctr_total_return#18] + +(33) HashAggregate [codegen id : 7] +Input [2]: [ctr_state#17, ctr_total_return#18] +Keys [1]: [ctr_state#17] +Functions [1]: [partial_avg(ctr_total_return#18)] +Aggregate Attributes [2]: [sum#30, count#31] +Results [3]: [ctr_state#17, sum#32, count#33] + +(34) Exchange +Input [3]: [ctr_state#17, sum#32, count#33] +Arguments: hashpartitioning(ctr_state#17, 5), ENSURE_REQUIREMENTS, [id=#34] + +(35) HashAggregate [codegen id : 8] +Input [3]: [ctr_state#17, sum#32, count#33] +Keys [1]: [ctr_state#17] +Functions [1]: [avg(ctr_total_return#18)] +Aggregate Attributes [1]: [avg(ctr_total_return#18)#35] +Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#18)#35) * 1.200000), DecimalType(24,7), true) AS (avg(ctr_total_return) * 1.2)#36, ctr_state#17 AS ctr_state#17#37] + +(36) Filter [codegen id : 8] +Input [2]: [(avg(ctr_total_return) * 1.2)#36, ctr_state#17#37] +Condition : isnotnull((avg(ctr_total_return) * 1.2)#36) + +(37) BroadcastExchange +Input [2]: [(avg(ctr_total_return) * 1.2)#36, ctr_state#17#37] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#38] + +(38) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ctr_state#17] +Right keys [1]: [ctr_state#17#37] +Join condition: (cast(ctr_total_return#18 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#36) + +(39) Project [codegen id : 11] +Output [2]: [ctr_customer_sk#16, ctr_total_return#18] +Input [5]: [ctr_customer_sk#16, ctr_state#17, ctr_total_return#18, (avg(ctr_total_return) * 1.2)#36, ctr_state#17#37] + +(40) Scan parquet default.customer +Output [14]: [c_customer_sk#39, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_day#46, c_birth_month#47, c_birth_year#48, c_birth_country#49, c_login#50, c_email_address#51, c_last_review_date#52] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 9] +Input [14]: [c_customer_sk#39, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_day#46, c_birth_month#47, c_birth_year#48, c_birth_country#49, c_login#50, c_email_address#51, c_last_review_date#52] + +(42) Filter [codegen id : 9] +Input [14]: [c_customer_sk#39, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_day#46, c_birth_month#47, c_birth_year#48, c_birth_country#49, c_login#50, c_email_address#51, c_last_review_date#52] +Condition : (isnotnull(c_customer_sk#39) AND isnotnull(c_current_addr_sk#41)) + +(43) BroadcastExchange +Input [14]: [c_customer_sk#39, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_day#46, c_birth_month#47, c_birth_year#48, c_birth_country#49, c_login#50, c_email_address#51, c_last_review_date#52] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#53] + +(44) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ctr_customer_sk#16] +Right keys [1]: [c_customer_sk#39] +Join condition: None + +(45) Project [codegen id : 11] +Output [14]: [ctr_total_return#18, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_day#46, c_birth_month#47, c_birth_year#48, c_birth_country#49, c_login#50, c_email_address#51, c_last_review_date#52] +Input [16]: [ctr_customer_sk#16, ctr_total_return#18, c_customer_sk#39, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_day#46, c_birth_month#47, c_birth_year#48, c_birth_country#49, c_login#50, c_email_address#51, c_last_review_date#52] + +(46) Scan parquet default.customer_address +Output [2]: [ca_address_sk#54, ca_state#55] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 10] +Input [2]: [ca_address_sk#54, ca_state#55] + +(48) Filter [codegen id : 10] +Input [2]: [ca_address_sk#54, ca_state#55] +Condition : ((isnotnull(ca_state#55) AND (ca_state#55 = GA)) AND isnotnull(ca_address_sk#54)) + +(49) Project [codegen id : 10] +Output [1]: [ca_address_sk#54] +Input [2]: [ca_address_sk#54, ca_state#55] + +(50) BroadcastExchange +Input [1]: [ca_address_sk#54] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#56] + +(51) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [c_current_addr_sk#41] +Right keys [1]: [ca_address_sk#54] +Join condition: None + +(52) Project [codegen id : 11] +Output [13]: [c_customer_id#40, c_salutation#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_day#46, c_birth_month#47, c_birth_year#48, c_birth_country#49, c_login#50, c_email_address#51, c_last_review_date#52, ctr_total_return#18] +Input [15]: [ctr_total_return#18, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_day#46, c_birth_month#47, c_birth_year#48, c_birth_country#49, c_login#50, c_email_address#51, c_last_review_date#52, ca_address_sk#54] + +(53) TakeOrderedAndProject +Input [13]: [c_customer_id#40, c_salutation#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_day#46, c_birth_month#47, c_birth_year#48, c_birth_country#49, c_login#50, c_email_address#51, c_last_review_date#52, ctr_total_return#18] +Arguments: 100, [c_customer_id#40 ASC NULLS FIRST, c_salutation#42 ASC NULLS FIRST, c_first_name#43 ASC NULLS FIRST, c_last_name#44 ASC NULLS FIRST, c_preferred_cust_flag#45 ASC NULLS FIRST, c_birth_day#46 ASC NULLS FIRST, c_birth_month#47 ASC NULLS FIRST, c_birth_year#48 ASC NULLS FIRST, c_birth_country#49 ASC NULLS FIRST, c_login#50 ASC NULLS FIRST, c_email_address#51 ASC NULLS FIRST, c_last_review_date#52 ASC NULLS FIRST, ctr_total_return#18 ASC NULLS FIRST], [c_customer_id#40, c_salutation#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_day#46, c_birth_month#47, c_birth_year#48, c_birth_country#49, c_login#50, c_email_address#51, c_last_review_date#52, ctr_total_return#18] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = wr_returned_date_sk#4 IN dynamicpruning#5 +ReusedExchange (54) + + +(54) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 21 Hosting Expression = wr_returned_date_sk#22 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30/simplified.txt new file mode 100644 index 0000000000000..59584ba2262bd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q30/simplified.txt @@ -0,0 +1,81 @@ +TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date,ctr_total_return] + WholeStageCodegen (11) + Project [c_customer_id,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date,ctr_total_return] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [ctr_total_return,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] + BroadcastHashJoin [ctr_customer_sk,c_customer_sk] + Project [ctr_customer_sk,ctr_total_return] + BroadcastHashJoin [ctr_state,ctr_state,ctr_total_return,(avg(ctr_total_return) * 1.2)] + Filter [ctr_total_return] + HashAggregate [wr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(wr_return_amt)),ctr_customer_sk,ctr_state,ctr_total_return,sum] + InputAdapter + Exchange [wr_returning_customer_sk,ca_state] #1 + WholeStageCodegen (3) + HashAggregate [wr_returning_customer_sk,ca_state,wr_return_amt] [sum,sum] + Project [wr_returning_customer_sk,wr_return_amt,ca_state] + BroadcastHashJoin [wr_returning_addr_sk,ca_address_sk] + Project [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + Filter [wr_returning_addr_sk,wr_returning_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt,wr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [ca_address_sk,ca_state] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (8) + Filter [(avg(ctr_total_return) * 1.2)] + HashAggregate [ctr_state,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_state,sum,count] + InputAdapter + Exchange [ctr_state] #5 + WholeStageCodegen (7) + HashAggregate [ctr_state,ctr_total_return] [sum,count,sum,count] + HashAggregate [wr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(wr_return_amt)),ctr_state,ctr_total_return,sum] + InputAdapter + Exchange [wr_returning_customer_sk,ca_state] #6 + WholeStageCodegen (6) + HashAggregate [wr_returning_customer_sk,ca_state,wr_return_amt] [sum,sum] + Project [wr_returning_customer_sk,wr_return_amt,ca_state] + BroadcastHashJoin [wr_returning_addr_sk,ca_address_sk] + Project [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + Filter [wr_returning_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_returning_customer_sk,wr_returning_addr_sk,wr_return_amt,wr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [ca_address_sk,ca_state] #3 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (9) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_day,c_birth_month,c_birth_year,c_birth_country,c_login,c_email_address,c_last_review_date] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (10) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/explain.txt new file mode 100644 index 0000000000000..1703da84e7914 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/explain.txt @@ -0,0 +1,699 @@ +== Physical Plan == +* Sort (119) ++- Exchange (118) + +- * Project (117) + +- * BroadcastHashJoin Inner BuildRight (116) + :- * Project (63) + : +- * BroadcastHashJoin Inner BuildRight (62) + : :- * Project (42) + : : +- * BroadcastHashJoin Inner BuildRight (41) + : : :- * HashAggregate (21) + : : : +- Exchange (20) + : : : +- * HashAggregate (19) + : : : +- * Project (18) + : : : +- * SortMergeJoin Inner (17) + : : : :- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- * Sort (16) + : : : +- Exchange (15) + : : : +- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.customer_address (12) + : : +- BroadcastExchange (40) + : : +- * HashAggregate (39) + : : +- Exchange (38) + : : +- * HashAggregate (37) + : : +- * Project (36) + : : +- * SortMergeJoin Inner (35) + : : :- * Sort (32) + : : : +- Exchange (31) + : : : +- * Project (30) + : : : +- * BroadcastHashJoin Inner BuildRight (29) + : : : :- * Filter (24) + : : : : +- * ColumnarToRow (23) + : : : : +- Scan parquet default.store_sales (22) + : : : +- BroadcastExchange (28) + : : : +- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.date_dim (25) + : : +- * Sort (34) + : : +- ReusedExchange (33) + : +- BroadcastExchange (61) + : +- * HashAggregate (60) + : +- Exchange (59) + : +- * HashAggregate (58) + : +- * Project (57) + : +- * SortMergeJoin Inner (56) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Project (51) + : : +- * BroadcastHashJoin Inner BuildRight (50) + : : :- * Filter (45) + : : : +- * ColumnarToRow (44) + : : : +- Scan parquet default.store_sales (43) + : : +- BroadcastExchange (49) + : : +- * Filter (48) + : : +- * ColumnarToRow (47) + : : +- Scan parquet default.date_dim (46) + : +- * Sort (55) + : +- ReusedExchange (54) + +- BroadcastExchange (115) + +- * Project (114) + +- * BroadcastHashJoin Inner BuildRight (113) + :- * Project (96) + : +- * BroadcastHashJoin Inner BuildRight (95) + : :- * HashAggregate (78) + : : +- Exchange (77) + : : +- * HashAggregate (76) + : : +- * Project (75) + : : +- * SortMergeJoin Inner (74) + : : :- * Sort (71) + : : : +- Exchange (70) + : : : +- * Project (69) + : : : +- * BroadcastHashJoin Inner BuildRight (68) + : : : :- * Filter (66) + : : : : +- * ColumnarToRow (65) + : : : : +- Scan parquet default.web_sales (64) + : : : +- ReusedExchange (67) + : : +- * Sort (73) + : : +- ReusedExchange (72) + : +- BroadcastExchange (94) + : +- * HashAggregate (93) + : +- Exchange (92) + : +- * HashAggregate (91) + : +- * Project (90) + : +- * SortMergeJoin Inner (89) + : :- * Sort (86) + : : +- Exchange (85) + : : +- * Project (84) + : : +- * BroadcastHashJoin Inner BuildRight (83) + : : :- * Filter (81) + : : : +- * ColumnarToRow (80) + : : : +- Scan parquet default.web_sales (79) + : : +- ReusedExchange (82) + : +- * Sort (88) + : +- ReusedExchange (87) + +- BroadcastExchange (112) + +- * HashAggregate (111) + +- Exchange (110) + +- * HashAggregate (109) + +- * Project (108) + +- * SortMergeJoin Inner (107) + :- * Sort (104) + : +- Exchange (103) + : +- * Project (102) + : +- * BroadcastHashJoin Inner BuildRight (101) + : :- * Filter (99) + : : +- * ColumnarToRow (98) + : : +- Scan parquet default.web_sales (97) + : +- ReusedExchange (100) + +- * Sort (106) + +- ReusedExchange (105) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_addr_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_addr_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [ss_addr_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_addr_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Condition : ((((isnotnull(d_qoy#7) AND isnotnull(d_year#6)) AND (d_qoy#7 = 2)) AND (d_year#6 = 2000)) AND isnotnull(d_date_sk#5)) + +(7) BroadcastExchange +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(9) Project [codegen id : 2] +Output [4]: [ss_addr_sk#1, ss_ext_sales_price#2, d_year#6, d_qoy#7] +Input [6]: [ss_addr_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, d_date_sk#5, d_year#6, d_qoy#7] + +(10) Exchange +Input [4]: [ss_addr_sk#1, ss_ext_sales_price#2, d_year#6, d_qoy#7] +Arguments: hashpartitioning(ss_addr_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] + +(11) Sort [codegen id : 3] +Input [4]: [ss_addr_sk#1, ss_ext_sales_price#2, d_year#6, d_qoy#7] +Arguments: [ss_addr_sk#1 ASC NULLS FIRST], false, 0 + +(12) Scan parquet default.customer_address +Output [2]: [ca_address_sk#10, ca_county#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_county)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 4] +Input [2]: [ca_address_sk#10, ca_county#11] + +(14) Filter [codegen id : 4] +Input [2]: [ca_address_sk#10, ca_county#11] +Condition : (isnotnull(ca_address_sk#10) AND isnotnull(ca_county#11)) + +(15) Exchange +Input [2]: [ca_address_sk#10, ca_county#11] +Arguments: hashpartitioning(ca_address_sk#10, 5), ENSURE_REQUIREMENTS, [id=#12] + +(16) Sort [codegen id : 5] +Input [2]: [ca_address_sk#10, ca_county#11] +Arguments: [ca_address_sk#10 ASC NULLS FIRST], false, 0 + +(17) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_addr_sk#1] +Right keys [1]: [ca_address_sk#10] +Join condition: None + +(18) Project [codegen id : 6] +Output [4]: [ss_ext_sales_price#2, d_year#6, d_qoy#7, ca_county#11] +Input [6]: [ss_addr_sk#1, ss_ext_sales_price#2, d_year#6, d_qoy#7, ca_address_sk#10, ca_county#11] + +(19) HashAggregate [codegen id : 6] +Input [4]: [ss_ext_sales_price#2, d_year#6, d_qoy#7, ca_county#11] +Keys [3]: [ca_county#11, d_qoy#7, d_year#6] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#13] +Results [4]: [ca_county#11, d_qoy#7, d_year#6, sum#14] + +(20) Exchange +Input [4]: [ca_county#11, d_qoy#7, d_year#6, sum#14] +Arguments: hashpartitioning(ca_county#11, d_qoy#7, d_year#6, 5), ENSURE_REQUIREMENTS, [id=#15] + +(21) HashAggregate [codegen id : 42] +Input [4]: [ca_county#11, d_qoy#7, d_year#6, sum#14] +Keys [3]: [ca_county#11, d_qoy#7, d_year#6] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#16] +Results [2]: [ca_county#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#16,17,2) AS store_sales#17] + +(22) Scan parquet default.store_sales +Output [3]: [ss_addr_sk#18, ss_ext_sales_price#19, ss_sold_date_sk#20] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#20), dynamicpruningexpression(ss_sold_date_sk#20 IN dynamicpruning#21)] +PushedFilters: [IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 8] +Input [3]: [ss_addr_sk#18, ss_ext_sales_price#19, ss_sold_date_sk#20] + +(24) Filter [codegen id : 8] +Input [3]: [ss_addr_sk#18, ss_ext_sales_price#19, ss_sold_date_sk#20] +Condition : isnotnull(ss_addr_sk#18) + +(25) Scan parquet default.date_dim +Output [3]: [d_date_sk#22, d_year#23, d_qoy#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,3), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 7] +Input [3]: [d_date_sk#22, d_year#23, d_qoy#24] + +(27) Filter [codegen id : 7] +Input [3]: [d_date_sk#22, d_year#23, d_qoy#24] +Condition : ((((isnotnull(d_qoy#24) AND isnotnull(d_year#23)) AND (d_qoy#24 = 3)) AND (d_year#23 = 2000)) AND isnotnull(d_date_sk#22)) + +(28) BroadcastExchange +Input [3]: [d_date_sk#22, d_year#23, d_qoy#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] + +(29) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_sold_date_sk#20] +Right keys [1]: [d_date_sk#22] +Join condition: None + +(30) Project [codegen id : 8] +Output [4]: [ss_addr_sk#18, ss_ext_sales_price#19, d_year#23, d_qoy#24] +Input [6]: [ss_addr_sk#18, ss_ext_sales_price#19, ss_sold_date_sk#20, d_date_sk#22, d_year#23, d_qoy#24] + +(31) Exchange +Input [4]: [ss_addr_sk#18, ss_ext_sales_price#19, d_year#23, d_qoy#24] +Arguments: hashpartitioning(ss_addr_sk#18, 5), ENSURE_REQUIREMENTS, [id=#26] + +(32) Sort [codegen id : 9] +Input [4]: [ss_addr_sk#18, ss_ext_sales_price#19, d_year#23, d_qoy#24] +Arguments: [ss_addr_sk#18 ASC NULLS FIRST], false, 0 + +(33) ReusedExchange [Reuses operator id: 15] +Output [2]: [ca_address_sk#27, ca_county#28] + +(34) Sort [codegen id : 11] +Input [2]: [ca_address_sk#27, ca_county#28] +Arguments: [ca_address_sk#27 ASC NULLS FIRST], false, 0 + +(35) SortMergeJoin [codegen id : 12] +Left keys [1]: [ss_addr_sk#18] +Right keys [1]: [ca_address_sk#27] +Join condition: None + +(36) Project [codegen id : 12] +Output [4]: [ss_ext_sales_price#19, d_year#23, d_qoy#24, ca_county#28] +Input [6]: [ss_addr_sk#18, ss_ext_sales_price#19, d_year#23, d_qoy#24, ca_address_sk#27, ca_county#28] + +(37) HashAggregate [codegen id : 12] +Input [4]: [ss_ext_sales_price#19, d_year#23, d_qoy#24, ca_county#28] +Keys [3]: [ca_county#28, d_qoy#24, d_year#23] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#19))] +Aggregate Attributes [1]: [sum#29] +Results [4]: [ca_county#28, d_qoy#24, d_year#23, sum#30] + +(38) Exchange +Input [4]: [ca_county#28, d_qoy#24, d_year#23, sum#30] +Arguments: hashpartitioning(ca_county#28, d_qoy#24, d_year#23, 5), ENSURE_REQUIREMENTS, [id=#31] + +(39) HashAggregate [codegen id : 13] +Input [4]: [ca_county#28, d_qoy#24, d_year#23, sum#30] +Keys [3]: [ca_county#28, d_qoy#24, d_year#23] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#19))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#19))#32] +Results [2]: [ca_county#28, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#19))#32,17,2) AS store_sales#33] + +(40) BroadcastExchange +Input [2]: [ca_county#28, store_sales#33] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#34] + +(41) BroadcastHashJoin [codegen id : 42] +Left keys [1]: [ca_county#11] +Right keys [1]: [ca_county#28] +Join condition: None + +(42) Project [codegen id : 42] +Output [3]: [ca_county#11, store_sales#17, store_sales#33] +Input [4]: [ca_county#11, store_sales#17, ca_county#28, store_sales#33] + +(43) Scan parquet default.store_sales +Output [3]: [ss_addr_sk#35, ss_ext_sales_price#36, ss_sold_date_sk#37] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#37), dynamicpruningexpression(ss_sold_date_sk#37 IN dynamicpruning#38)] +PushedFilters: [IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(44) ColumnarToRow [codegen id : 15] +Input [3]: [ss_addr_sk#35, ss_ext_sales_price#36, ss_sold_date_sk#37] + +(45) Filter [codegen id : 15] +Input [3]: [ss_addr_sk#35, ss_ext_sales_price#36, ss_sold_date_sk#37] +Condition : isnotnull(ss_addr_sk#35) + +(46) Scan parquet default.date_dim +Output [3]: [d_date_sk#39, d_year#40, d_qoy#41] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,1), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 14] +Input [3]: [d_date_sk#39, d_year#40, d_qoy#41] + +(48) Filter [codegen id : 14] +Input [3]: [d_date_sk#39, d_year#40, d_qoy#41] +Condition : ((((isnotnull(d_qoy#41) AND isnotnull(d_year#40)) AND (d_qoy#41 = 1)) AND (d_year#40 = 2000)) AND isnotnull(d_date_sk#39)) + +(49) BroadcastExchange +Input [3]: [d_date_sk#39, d_year#40, d_qoy#41] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#42] + +(50) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [ss_sold_date_sk#37] +Right keys [1]: [d_date_sk#39] +Join condition: None + +(51) Project [codegen id : 15] +Output [4]: [ss_addr_sk#35, ss_ext_sales_price#36, d_year#40, d_qoy#41] +Input [6]: [ss_addr_sk#35, ss_ext_sales_price#36, ss_sold_date_sk#37, d_date_sk#39, d_year#40, d_qoy#41] + +(52) Exchange +Input [4]: [ss_addr_sk#35, ss_ext_sales_price#36, d_year#40, d_qoy#41] +Arguments: hashpartitioning(ss_addr_sk#35, 5), ENSURE_REQUIREMENTS, [id=#43] + +(53) Sort [codegen id : 16] +Input [4]: [ss_addr_sk#35, ss_ext_sales_price#36, d_year#40, d_qoy#41] +Arguments: [ss_addr_sk#35 ASC NULLS FIRST], false, 0 + +(54) ReusedExchange [Reuses operator id: 15] +Output [2]: [ca_address_sk#44, ca_county#45] + +(55) Sort [codegen id : 18] +Input [2]: [ca_address_sk#44, ca_county#45] +Arguments: [ca_address_sk#44 ASC NULLS FIRST], false, 0 + +(56) SortMergeJoin [codegen id : 19] +Left keys [1]: [ss_addr_sk#35] +Right keys [1]: [ca_address_sk#44] +Join condition: None + +(57) Project [codegen id : 19] +Output [4]: [ss_ext_sales_price#36, d_year#40, d_qoy#41, ca_county#45] +Input [6]: [ss_addr_sk#35, ss_ext_sales_price#36, d_year#40, d_qoy#41, ca_address_sk#44, ca_county#45] + +(58) HashAggregate [codegen id : 19] +Input [4]: [ss_ext_sales_price#36, d_year#40, d_qoy#41, ca_county#45] +Keys [3]: [ca_county#45, d_qoy#41, d_year#40] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#36))] +Aggregate Attributes [1]: [sum#46] +Results [4]: [ca_county#45, d_qoy#41, d_year#40, sum#47] + +(59) Exchange +Input [4]: [ca_county#45, d_qoy#41, d_year#40, sum#47] +Arguments: hashpartitioning(ca_county#45, d_qoy#41, d_year#40, 5), ENSURE_REQUIREMENTS, [id=#48] + +(60) HashAggregate [codegen id : 20] +Input [4]: [ca_county#45, d_qoy#41, d_year#40, sum#47] +Keys [3]: [ca_county#45, d_qoy#41, d_year#40] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#36))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#36))#49] +Results [3]: [ca_county#45, d_year#40, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#36))#49,17,2) AS store_sales#50] + +(61) BroadcastExchange +Input [3]: [ca_county#45, d_year#40, store_sales#50] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#51] + +(62) BroadcastHashJoin [codegen id : 42] +Left keys [1]: [ca_county#11] +Right keys [1]: [ca_county#45] +Join condition: None + +(63) Project [codegen id : 42] +Output [5]: [store_sales#17, store_sales#33, ca_county#45, d_year#40, store_sales#50] +Input [6]: [ca_county#11, store_sales#17, store_sales#33, ca_county#45, d_year#40, store_sales#50] + +(64) Scan parquet default.web_sales +Output [3]: [ws_bill_addr_sk#52, ws_ext_sales_price#53, ws_sold_date_sk#54] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#54), dynamicpruningexpression(ws_sold_date_sk#54 IN dynamicpruning#38)] +PushedFilters: [IsNotNull(ws_bill_addr_sk)] +ReadSchema: struct + +(65) ColumnarToRow [codegen id : 22] +Input [3]: [ws_bill_addr_sk#52, ws_ext_sales_price#53, ws_sold_date_sk#54] + +(66) Filter [codegen id : 22] +Input [3]: [ws_bill_addr_sk#52, ws_ext_sales_price#53, ws_sold_date_sk#54] +Condition : isnotnull(ws_bill_addr_sk#52) + +(67) ReusedExchange [Reuses operator id: 49] +Output [3]: [d_date_sk#55, d_year#56, d_qoy#57] + +(68) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [ws_sold_date_sk#54] +Right keys [1]: [d_date_sk#55] +Join condition: None + +(69) Project [codegen id : 22] +Output [4]: [ws_bill_addr_sk#52, ws_ext_sales_price#53, d_year#56, d_qoy#57] +Input [6]: [ws_bill_addr_sk#52, ws_ext_sales_price#53, ws_sold_date_sk#54, d_date_sk#55, d_year#56, d_qoy#57] + +(70) Exchange +Input [4]: [ws_bill_addr_sk#52, ws_ext_sales_price#53, d_year#56, d_qoy#57] +Arguments: hashpartitioning(ws_bill_addr_sk#52, 5), ENSURE_REQUIREMENTS, [id=#58] + +(71) Sort [codegen id : 23] +Input [4]: [ws_bill_addr_sk#52, ws_ext_sales_price#53, d_year#56, d_qoy#57] +Arguments: [ws_bill_addr_sk#52 ASC NULLS FIRST], false, 0 + +(72) ReusedExchange [Reuses operator id: 15] +Output [2]: [ca_address_sk#59, ca_county#60] + +(73) Sort [codegen id : 25] +Input [2]: [ca_address_sk#59, ca_county#60] +Arguments: [ca_address_sk#59 ASC NULLS FIRST], false, 0 + +(74) SortMergeJoin [codegen id : 26] +Left keys [1]: [ws_bill_addr_sk#52] +Right keys [1]: [ca_address_sk#59] +Join condition: None + +(75) Project [codegen id : 26] +Output [4]: [ws_ext_sales_price#53, d_year#56, d_qoy#57, ca_county#60] +Input [6]: [ws_bill_addr_sk#52, ws_ext_sales_price#53, d_year#56, d_qoy#57, ca_address_sk#59, ca_county#60] + +(76) HashAggregate [codegen id : 26] +Input [4]: [ws_ext_sales_price#53, d_year#56, d_qoy#57, ca_county#60] +Keys [3]: [ca_county#60, d_qoy#57, d_year#56] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#53))] +Aggregate Attributes [1]: [sum#61] +Results [4]: [ca_county#60, d_qoy#57, d_year#56, sum#62] + +(77) Exchange +Input [4]: [ca_county#60, d_qoy#57, d_year#56, sum#62] +Arguments: hashpartitioning(ca_county#60, d_qoy#57, d_year#56, 5), ENSURE_REQUIREMENTS, [id=#63] + +(78) HashAggregate [codegen id : 41] +Input [4]: [ca_county#60, d_qoy#57, d_year#56, sum#62] +Keys [3]: [ca_county#60, d_qoy#57, d_year#56] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#53))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#53))#64] +Results [2]: [ca_county#60, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#53))#64,17,2) AS web_sales#65] + +(79) Scan parquet default.web_sales +Output [3]: [ws_bill_addr_sk#66, ws_ext_sales_price#67, ws_sold_date_sk#68] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#68), dynamicpruningexpression(ws_sold_date_sk#68 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_bill_addr_sk)] +ReadSchema: struct + +(80) ColumnarToRow [codegen id : 28] +Input [3]: [ws_bill_addr_sk#66, ws_ext_sales_price#67, ws_sold_date_sk#68] + +(81) Filter [codegen id : 28] +Input [3]: [ws_bill_addr_sk#66, ws_ext_sales_price#67, ws_sold_date_sk#68] +Condition : isnotnull(ws_bill_addr_sk#66) + +(82) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#69, d_year#70, d_qoy#71] + +(83) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#68] +Right keys [1]: [d_date_sk#69] +Join condition: None + +(84) Project [codegen id : 28] +Output [4]: [ws_bill_addr_sk#66, ws_ext_sales_price#67, d_year#70, d_qoy#71] +Input [6]: [ws_bill_addr_sk#66, ws_ext_sales_price#67, ws_sold_date_sk#68, d_date_sk#69, d_year#70, d_qoy#71] + +(85) Exchange +Input [4]: [ws_bill_addr_sk#66, ws_ext_sales_price#67, d_year#70, d_qoy#71] +Arguments: hashpartitioning(ws_bill_addr_sk#66, 5), ENSURE_REQUIREMENTS, [id=#72] + +(86) Sort [codegen id : 29] +Input [4]: [ws_bill_addr_sk#66, ws_ext_sales_price#67, d_year#70, d_qoy#71] +Arguments: [ws_bill_addr_sk#66 ASC NULLS FIRST], false, 0 + +(87) ReusedExchange [Reuses operator id: 15] +Output [2]: [ca_address_sk#73, ca_county#74] + +(88) Sort [codegen id : 31] +Input [2]: [ca_address_sk#73, ca_county#74] +Arguments: [ca_address_sk#73 ASC NULLS FIRST], false, 0 + +(89) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_addr_sk#66] +Right keys [1]: [ca_address_sk#73] +Join condition: None + +(90) Project [codegen id : 32] +Output [4]: [ws_ext_sales_price#67, d_year#70, d_qoy#71, ca_county#74] +Input [6]: [ws_bill_addr_sk#66, ws_ext_sales_price#67, d_year#70, d_qoy#71, ca_address_sk#73, ca_county#74] + +(91) HashAggregate [codegen id : 32] +Input [4]: [ws_ext_sales_price#67, d_year#70, d_qoy#71, ca_county#74] +Keys [3]: [ca_county#74, d_qoy#71, d_year#70] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#67))] +Aggregate Attributes [1]: [sum#75] +Results [4]: [ca_county#74, d_qoy#71, d_year#70, sum#76] + +(92) Exchange +Input [4]: [ca_county#74, d_qoy#71, d_year#70, sum#76] +Arguments: hashpartitioning(ca_county#74, d_qoy#71, d_year#70, 5), ENSURE_REQUIREMENTS, [id=#77] + +(93) HashAggregate [codegen id : 33] +Input [4]: [ca_county#74, d_qoy#71, d_year#70, sum#76] +Keys [3]: [ca_county#74, d_qoy#71, d_year#70] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#67))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#67))#78] +Results [2]: [ca_county#74, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#67))#78,17,2) AS web_sales#79] + +(94) BroadcastExchange +Input [2]: [ca_county#74, web_sales#79] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#80] + +(95) BroadcastHashJoin [codegen id : 41] +Left keys [1]: [ca_county#60] +Right keys [1]: [ca_county#74] +Join condition: None + +(96) Project [codegen id : 41] +Output [3]: [ca_county#60, web_sales#65, web_sales#79] +Input [4]: [ca_county#60, web_sales#65, ca_county#74, web_sales#79] + +(97) Scan parquet default.web_sales +Output [3]: [ws_bill_addr_sk#81, ws_ext_sales_price#82, ws_sold_date_sk#83] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#83), dynamicpruningexpression(ws_sold_date_sk#83 IN dynamicpruning#21)] +PushedFilters: [IsNotNull(ws_bill_addr_sk)] +ReadSchema: struct + +(98) ColumnarToRow [codegen id : 35] +Input [3]: [ws_bill_addr_sk#81, ws_ext_sales_price#82, ws_sold_date_sk#83] + +(99) Filter [codegen id : 35] +Input [3]: [ws_bill_addr_sk#81, ws_ext_sales_price#82, ws_sold_date_sk#83] +Condition : isnotnull(ws_bill_addr_sk#81) + +(100) ReusedExchange [Reuses operator id: 28] +Output [3]: [d_date_sk#84, d_year#85, d_qoy#86] + +(101) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [ws_sold_date_sk#83] +Right keys [1]: [d_date_sk#84] +Join condition: None + +(102) Project [codegen id : 35] +Output [4]: [ws_bill_addr_sk#81, ws_ext_sales_price#82, d_year#85, d_qoy#86] +Input [6]: [ws_bill_addr_sk#81, ws_ext_sales_price#82, ws_sold_date_sk#83, d_date_sk#84, d_year#85, d_qoy#86] + +(103) Exchange +Input [4]: [ws_bill_addr_sk#81, ws_ext_sales_price#82, d_year#85, d_qoy#86] +Arguments: hashpartitioning(ws_bill_addr_sk#81, 5), ENSURE_REQUIREMENTS, [id=#87] + +(104) Sort [codegen id : 36] +Input [4]: [ws_bill_addr_sk#81, ws_ext_sales_price#82, d_year#85, d_qoy#86] +Arguments: [ws_bill_addr_sk#81 ASC NULLS FIRST], false, 0 + +(105) ReusedExchange [Reuses operator id: 15] +Output [2]: [ca_address_sk#88, ca_county#89] + +(106) Sort [codegen id : 38] +Input [2]: [ca_address_sk#88, ca_county#89] +Arguments: [ca_address_sk#88 ASC NULLS FIRST], false, 0 + +(107) SortMergeJoin [codegen id : 39] +Left keys [1]: [ws_bill_addr_sk#81] +Right keys [1]: [ca_address_sk#88] +Join condition: None + +(108) Project [codegen id : 39] +Output [4]: [ws_ext_sales_price#82, d_year#85, d_qoy#86, ca_county#89] +Input [6]: [ws_bill_addr_sk#81, ws_ext_sales_price#82, d_year#85, d_qoy#86, ca_address_sk#88, ca_county#89] + +(109) HashAggregate [codegen id : 39] +Input [4]: [ws_ext_sales_price#82, d_year#85, d_qoy#86, ca_county#89] +Keys [3]: [ca_county#89, d_qoy#86, d_year#85] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#82))] +Aggregate Attributes [1]: [sum#90] +Results [4]: [ca_county#89, d_qoy#86, d_year#85, sum#91] + +(110) Exchange +Input [4]: [ca_county#89, d_qoy#86, d_year#85, sum#91] +Arguments: hashpartitioning(ca_county#89, d_qoy#86, d_year#85, 5), ENSURE_REQUIREMENTS, [id=#92] + +(111) HashAggregate [codegen id : 40] +Input [4]: [ca_county#89, d_qoy#86, d_year#85, sum#91] +Keys [3]: [ca_county#89, d_qoy#86, d_year#85] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#82))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#82))#93] +Results [2]: [ca_county#89, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#82))#93,17,2) AS web_sales#94] + +(112) BroadcastExchange +Input [2]: [ca_county#89, web_sales#94] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#95] + +(113) BroadcastHashJoin [codegen id : 41] +Left keys [1]: [ca_county#60] +Right keys [1]: [ca_county#89] +Join condition: None + +(114) Project [codegen id : 41] +Output [4]: [ca_county#60, web_sales#65, web_sales#79, web_sales#94] +Input [5]: [ca_county#60, web_sales#65, web_sales#79, ca_county#89, web_sales#94] + +(115) BroadcastExchange +Input [4]: [ca_county#60, web_sales#65, web_sales#79, web_sales#94] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#96] + +(116) BroadcastHashJoin [codegen id : 42] +Left keys [1]: [ca_county#45] +Right keys [1]: [ca_county#60] +Join condition: ((CASE WHEN (web_sales#65 > 0.00) THEN CheckOverflow((promote_precision(web_sales#79) / promote_precision(web_sales#65)), DecimalType(37,20), true) ELSE null END > CASE WHEN (store_sales#50 > 0.00) THEN CheckOverflow((promote_precision(store_sales#17) / promote_precision(store_sales#50)), DecimalType(37,20), true) ELSE null END) AND (CASE WHEN (web_sales#79 > 0.00) THEN CheckOverflow((promote_precision(web_sales#94) / promote_precision(web_sales#79)), DecimalType(37,20), true) ELSE null END > CASE WHEN (store_sales#17 > 0.00) THEN CheckOverflow((promote_precision(store_sales#33) / promote_precision(store_sales#17)), DecimalType(37,20), true) ELSE null END)) + +(117) Project [codegen id : 42] +Output [6]: [ca_county#45, d_year#40, CheckOverflow((promote_precision(web_sales#79) / promote_precision(web_sales#65)), DecimalType(37,20), true) AS web_q1_q2_increase#97, CheckOverflow((promote_precision(store_sales#17) / promote_precision(store_sales#50)), DecimalType(37,20), true) AS store_q1_q2_increase#98, CheckOverflow((promote_precision(web_sales#94) / promote_precision(web_sales#79)), DecimalType(37,20), true) AS web_q2_q3_increase#99, CheckOverflow((promote_precision(store_sales#33) / promote_precision(store_sales#17)), DecimalType(37,20), true) AS store_q2_q3_increase#100] +Input [9]: [store_sales#17, store_sales#33, ca_county#45, d_year#40, store_sales#50, ca_county#60, web_sales#65, web_sales#79, web_sales#94] + +(118) Exchange +Input [6]: [ca_county#45, d_year#40, web_q1_q2_increase#97, store_q1_q2_increase#98, web_q2_q3_increase#99, store_q2_q3_increase#100] +Arguments: rangepartitioning(ca_county#45 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#101] + +(119) Sort [codegen id : 43] +Input [6]: [ca_county#45, d_year#40, web_q1_q2_increase#97, store_q1_q2_increase#98, web_q2_q3_increase#99, store_q2_q3_increase#100] +Arguments: [ca_county#45 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (120) + + +(120) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] + +Subquery:2 Hosting operator id = 22 Hosting Expression = ss_sold_date_sk#20 IN dynamicpruning#21 +ReusedExchange (121) + + +(121) ReusedExchange [Reuses operator id: 28] +Output [3]: [d_date_sk#22, d_year#23, d_qoy#24] + +Subquery:3 Hosting operator id = 43 Hosting Expression = ss_sold_date_sk#37 IN dynamicpruning#38 +ReusedExchange (122) + + +(122) ReusedExchange [Reuses operator id: 49] +Output [3]: [d_date_sk#39, d_year#40, d_qoy#41] + +Subquery:4 Hosting operator id = 64 Hosting Expression = ws_sold_date_sk#54 IN dynamicpruning#38 + +Subquery:5 Hosting operator id = 79 Hosting Expression = ws_sold_date_sk#68 IN dynamicpruning#4 + +Subquery:6 Hosting operator id = 97 Hosting Expression = ws_sold_date_sk#83 IN dynamicpruning#21 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/simplified.txt new file mode 100644 index 0000000000000..0f83c5b264666 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31.sf100/simplified.txt @@ -0,0 +1,215 @@ +WholeStageCodegen (43) + Sort [ca_county] + InputAdapter + Exchange [ca_county] #1 + WholeStageCodegen (42) + Project [ca_county,d_year,web_sales,web_sales,store_sales,store_sales,web_sales,store_sales] + BroadcastHashJoin [ca_county,ca_county,web_sales,web_sales,store_sales,store_sales,web_sales,store_sales] + Project [store_sales,store_sales,ca_county,d_year,store_sales] + BroadcastHashJoin [ca_county,ca_county] + Project [ca_county,store_sales,store_sales] + BroadcastHashJoin [ca_county,ca_county] + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #2 + WholeStageCodegen (6) + HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,d_year,d_qoy,ca_county] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #3 + WholeStageCodegen (2) + Project [ss_addr_sk,ss_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_qoy] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + WholeStageCodegen (5) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #5 + WholeStageCodegen (4) + Filter [ca_address_sk,ca_county] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (13) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #7 + WholeStageCodegen (12) + HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,d_year,d_qoy,ca_county] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (9) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #8 + WholeStageCodegen (8) + Project [ss_addr_sk,ss_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year,d_qoy] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (7) + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + WholeStageCodegen (11) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #5 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (20) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #11 + WholeStageCodegen (19) + HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,d_year,d_qoy,ca_county] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (16) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #12 + WholeStageCodegen (15) + Project [ss_addr_sk,ss_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #3 + ReusedExchange [d_date_sk,d_year,d_qoy] #13 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (14) + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + WholeStageCodegen (18) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #5 + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (41) + Project [ca_county,web_sales,web_sales,web_sales] + BroadcastHashJoin [ca_county,ca_county] + Project [ca_county,web_sales,web_sales] + BroadcastHashJoin [ca_county,ca_county] + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ws_ext_sales_price)),web_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #15 + WholeStageCodegen (26) + HashAggregate [ca_county,d_qoy,d_year,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,d_year,d_qoy,ca_county] + SortMergeJoin [ws_bill_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (23) + Sort [ws_bill_addr_sk] + InputAdapter + Exchange [ws_bill_addr_sk] #16 + WholeStageCodegen (22) + Project [ws_bill_addr_sk,ws_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_addr_sk,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #3 + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #13 + InputAdapter + WholeStageCodegen (25) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #5 + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (33) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ws_ext_sales_price)),web_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #18 + WholeStageCodegen (32) + HashAggregate [ca_county,d_qoy,d_year,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,d_year,d_qoy,ca_county] + SortMergeJoin [ws_bill_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (29) + Sort [ws_bill_addr_sk] + InputAdapter + Exchange [ws_bill_addr_sk] #19 + WholeStageCodegen (28) + Project [ws_bill_addr_sk,ws_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_addr_sk,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #4 + InputAdapter + WholeStageCodegen (31) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #5 + InputAdapter + BroadcastExchange #20 + WholeStageCodegen (40) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ws_ext_sales_price)),web_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #21 + WholeStageCodegen (39) + HashAggregate [ca_county,d_qoy,d_year,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,d_year,d_qoy,ca_county] + SortMergeJoin [ws_bill_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (36) + Sort [ws_bill_addr_sk] + InputAdapter + Exchange [ws_bill_addr_sk] #22 + WholeStageCodegen (35) + Project [ws_bill_addr_sk,ws_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_addr_sk,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #9 + InputAdapter + WholeStageCodegen (38) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31/explain.txt new file mode 100644 index 0000000000000..f47a7af5a15e3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31/explain.txt @@ -0,0 +1,599 @@ +== Physical Plan == +* Sort (99) ++- Exchange (98) + +- * Project (97) + +- * BroadcastHashJoin Inner BuildRight (96) + :- * Project (82) + : +- * BroadcastHashJoin Inner BuildRight (81) + : :- * BroadcastHashJoin Inner BuildRight (67) + : : :- * Project (53) + : : : +- * BroadcastHashJoin Inner BuildRight (52) + : : : :- * BroadcastHashJoin Inner BuildRight (35) + : : : : :- * HashAggregate (18) + : : : : : +- Exchange (17) + : : : : : +- * HashAggregate (16) + : : : : : +- * Project (15) + : : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : : :- * Project (9) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : +- BroadcastExchange (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.date_dim (4) + : : : : : +- BroadcastExchange (13) + : : : : : +- * Filter (12) + : : : : : +- * ColumnarToRow (11) + : : : : : +- Scan parquet default.customer_address (10) + : : : : +- BroadcastExchange (34) + : : : : +- * HashAggregate (33) + : : : : +- Exchange (32) + : : : : +- * HashAggregate (31) + : : : : +- * Project (30) + : : : : +- * BroadcastHashJoin Inner BuildRight (29) + : : : : :- * Project (27) + : : : : : +- * BroadcastHashJoin Inner BuildRight (26) + : : : : : :- * Filter (21) + : : : : : : +- * ColumnarToRow (20) + : : : : : : +- Scan parquet default.store_sales (19) + : : : : : +- BroadcastExchange (25) + : : : : : +- * Filter (24) + : : : : : +- * ColumnarToRow (23) + : : : : : +- Scan parquet default.date_dim (22) + : : : : +- ReusedExchange (28) + : : : +- BroadcastExchange (51) + : : : +- * HashAggregate (50) + : : : +- Exchange (49) + : : : +- * HashAggregate (48) + : : : +- * Project (47) + : : : +- * BroadcastHashJoin Inner BuildRight (46) + : : : :- * Project (44) + : : : : +- * BroadcastHashJoin Inner BuildRight (43) + : : : : :- * Filter (38) + : : : : : +- * ColumnarToRow (37) + : : : : : +- Scan parquet default.store_sales (36) + : : : : +- BroadcastExchange (42) + : : : : +- * Filter (41) + : : : : +- * ColumnarToRow (40) + : : : : +- Scan parquet default.date_dim (39) + : : : +- ReusedExchange (45) + : : +- BroadcastExchange (66) + : : +- * HashAggregate (65) + : : +- Exchange (64) + : : +- * HashAggregate (63) + : : +- * Project (62) + : : +- * BroadcastHashJoin Inner BuildRight (61) + : : :- * Project (59) + : : : +- * BroadcastHashJoin Inner BuildRight (58) + : : : :- * Filter (56) + : : : : +- * ColumnarToRow (55) + : : : : +- Scan parquet default.web_sales (54) + : : : +- ReusedExchange (57) + : : +- ReusedExchange (60) + : +- BroadcastExchange (80) + : +- * HashAggregate (79) + : +- Exchange (78) + : +- * HashAggregate (77) + : +- * Project (76) + : +- * BroadcastHashJoin Inner BuildRight (75) + : :- * Project (73) + : : +- * BroadcastHashJoin Inner BuildRight (72) + : : :- * Filter (70) + : : : +- * ColumnarToRow (69) + : : : +- Scan parquet default.web_sales (68) + : : +- ReusedExchange (71) + : +- ReusedExchange (74) + +- BroadcastExchange (95) + +- * HashAggregate (94) + +- Exchange (93) + +- * HashAggregate (92) + +- * Project (91) + +- * BroadcastHashJoin Inner BuildRight (90) + :- * Project (88) + : +- * BroadcastHashJoin Inner BuildRight (87) + : :- * Filter (85) + : : +- * ColumnarToRow (84) + : : +- Scan parquet default.web_sales (83) + : +- ReusedExchange (86) + +- ReusedExchange (89) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_addr_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_addr_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ss_addr_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_addr_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,1), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Condition : ((((isnotnull(d_qoy#7) AND isnotnull(d_year#6)) AND (d_qoy#7 = 1)) AND (d_year#6 = 2000)) AND isnotnull(d_date_sk#5)) + +(7) BroadcastExchange +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(9) Project [codegen id : 3] +Output [4]: [ss_addr_sk#1, ss_ext_sales_price#2, d_year#6, d_qoy#7] +Input [6]: [ss_addr_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, d_date_sk#5, d_year#6, d_qoy#7] + +(10) Scan parquet default.customer_address +Output [2]: [ca_address_sk#9, ca_county#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_county)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [ca_address_sk#9, ca_county#10] + +(12) Filter [codegen id : 2] +Input [2]: [ca_address_sk#9, ca_county#10] +Condition : (isnotnull(ca_address_sk#9) AND isnotnull(ca_county#10)) + +(13) BroadcastExchange +Input [2]: [ca_address_sk#9, ca_county#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_addr_sk#1] +Right keys [1]: [ca_address_sk#9] +Join condition: None + +(15) Project [codegen id : 3] +Output [4]: [ss_ext_sales_price#2, d_year#6, d_qoy#7, ca_county#10] +Input [6]: [ss_addr_sk#1, ss_ext_sales_price#2, d_year#6, d_qoy#7, ca_address_sk#9, ca_county#10] + +(16) HashAggregate [codegen id : 3] +Input [4]: [ss_ext_sales_price#2, d_year#6, d_qoy#7, ca_county#10] +Keys [3]: [ca_county#10, d_qoy#7, d_year#6] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#12] +Results [4]: [ca_county#10, d_qoy#7, d_year#6, sum#13] + +(17) Exchange +Input [4]: [ca_county#10, d_qoy#7, d_year#6, sum#13] +Arguments: hashpartitioning(ca_county#10, d_qoy#7, d_year#6, 5), ENSURE_REQUIREMENTS, [id=#14] + +(18) HashAggregate [codegen id : 24] +Input [4]: [ca_county#10, d_qoy#7, d_year#6, sum#13] +Keys [3]: [ca_county#10, d_qoy#7, d_year#6] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#15] +Results [3]: [ca_county#10, d_year#6, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#15,17,2) AS store_sales#16] + +(19) Scan parquet default.store_sales +Output [3]: [ss_addr_sk#17, ss_ext_sales_price#18, ss_sold_date_sk#19] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#19), dynamicpruningexpression(ss_sold_date_sk#19 IN dynamicpruning#20)] +PushedFilters: [IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 6] +Input [3]: [ss_addr_sk#17, ss_ext_sales_price#18, ss_sold_date_sk#19] + +(21) Filter [codegen id : 6] +Input [3]: [ss_addr_sk#17, ss_ext_sales_price#18, ss_sold_date_sk#19] +Condition : isnotnull(ss_addr_sk#17) + +(22) Scan parquet default.date_dim +Output [3]: [d_date_sk#21, d_year#22, d_qoy#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 4] +Input [3]: [d_date_sk#21, d_year#22, d_qoy#23] + +(24) Filter [codegen id : 4] +Input [3]: [d_date_sk#21, d_year#22, d_qoy#23] +Condition : ((((isnotnull(d_qoy#23) AND isnotnull(d_year#22)) AND (d_qoy#23 = 2)) AND (d_year#22 = 2000)) AND isnotnull(d_date_sk#21)) + +(25) BroadcastExchange +Input [3]: [d_date_sk#21, d_year#22, d_qoy#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(26) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#19] +Right keys [1]: [d_date_sk#21] +Join condition: None + +(27) Project [codegen id : 6] +Output [4]: [ss_addr_sk#17, ss_ext_sales_price#18, d_year#22, d_qoy#23] +Input [6]: [ss_addr_sk#17, ss_ext_sales_price#18, ss_sold_date_sk#19, d_date_sk#21, d_year#22, d_qoy#23] + +(28) ReusedExchange [Reuses operator id: 13] +Output [2]: [ca_address_sk#25, ca_county#26] + +(29) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_addr_sk#17] +Right keys [1]: [ca_address_sk#25] +Join condition: None + +(30) Project [codegen id : 6] +Output [4]: [ss_ext_sales_price#18, d_year#22, d_qoy#23, ca_county#26] +Input [6]: [ss_addr_sk#17, ss_ext_sales_price#18, d_year#22, d_qoy#23, ca_address_sk#25, ca_county#26] + +(31) HashAggregate [codegen id : 6] +Input [4]: [ss_ext_sales_price#18, d_year#22, d_qoy#23, ca_county#26] +Keys [3]: [ca_county#26, d_qoy#23, d_year#22] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#18))] +Aggregate Attributes [1]: [sum#27] +Results [4]: [ca_county#26, d_qoy#23, d_year#22, sum#28] + +(32) Exchange +Input [4]: [ca_county#26, d_qoy#23, d_year#22, sum#28] +Arguments: hashpartitioning(ca_county#26, d_qoy#23, d_year#22, 5), ENSURE_REQUIREMENTS, [id=#29] + +(33) HashAggregate [codegen id : 7] +Input [4]: [ca_county#26, d_qoy#23, d_year#22, sum#28] +Keys [3]: [ca_county#26, d_qoy#23, d_year#22] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#18))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#18))#30] +Results [2]: [ca_county#26, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#18))#30,17,2) AS store_sales#31] + +(34) BroadcastExchange +Input [2]: [ca_county#26, store_sales#31] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#32] + +(35) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [ca_county#10] +Right keys [1]: [ca_county#26] +Join condition: None + +(36) Scan parquet default.store_sales +Output [3]: [ss_addr_sk#33, ss_ext_sales_price#34, ss_sold_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#35), dynamicpruningexpression(ss_sold_date_sk#35 IN dynamicpruning#36)] +PushedFilters: [IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 10] +Input [3]: [ss_addr_sk#33, ss_ext_sales_price#34, ss_sold_date_sk#35] + +(38) Filter [codegen id : 10] +Input [3]: [ss_addr_sk#33, ss_ext_sales_price#34, ss_sold_date_sk#35] +Condition : isnotnull(ss_addr_sk#33) + +(39) Scan parquet default.date_dim +Output [3]: [d_date_sk#37, d_year#38, d_qoy#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,3), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 8] +Input [3]: [d_date_sk#37, d_year#38, d_qoy#39] + +(41) Filter [codegen id : 8] +Input [3]: [d_date_sk#37, d_year#38, d_qoy#39] +Condition : ((((isnotnull(d_qoy#39) AND isnotnull(d_year#38)) AND (d_qoy#39 = 3)) AND (d_year#38 = 2000)) AND isnotnull(d_date_sk#37)) + +(42) BroadcastExchange +Input [3]: [d_date_sk#37, d_year#38, d_qoy#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40] + +(43) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#35] +Right keys [1]: [d_date_sk#37] +Join condition: None + +(44) Project [codegen id : 10] +Output [4]: [ss_addr_sk#33, ss_ext_sales_price#34, d_year#38, d_qoy#39] +Input [6]: [ss_addr_sk#33, ss_ext_sales_price#34, ss_sold_date_sk#35, d_date_sk#37, d_year#38, d_qoy#39] + +(45) ReusedExchange [Reuses operator id: 13] +Output [2]: [ca_address_sk#41, ca_county#42] + +(46) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_addr_sk#33] +Right keys [1]: [ca_address_sk#41] +Join condition: None + +(47) Project [codegen id : 10] +Output [4]: [ss_ext_sales_price#34, d_year#38, d_qoy#39, ca_county#42] +Input [6]: [ss_addr_sk#33, ss_ext_sales_price#34, d_year#38, d_qoy#39, ca_address_sk#41, ca_county#42] + +(48) HashAggregate [codegen id : 10] +Input [4]: [ss_ext_sales_price#34, d_year#38, d_qoy#39, ca_county#42] +Keys [3]: [ca_county#42, d_qoy#39, d_year#38] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#34))] +Aggregate Attributes [1]: [sum#43] +Results [4]: [ca_county#42, d_qoy#39, d_year#38, sum#44] + +(49) Exchange +Input [4]: [ca_county#42, d_qoy#39, d_year#38, sum#44] +Arguments: hashpartitioning(ca_county#42, d_qoy#39, d_year#38, 5), ENSURE_REQUIREMENTS, [id=#45] + +(50) HashAggregate [codegen id : 11] +Input [4]: [ca_county#42, d_qoy#39, d_year#38, sum#44] +Keys [3]: [ca_county#42, d_qoy#39, d_year#38] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#34))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#34))#46] +Results [2]: [ca_county#42, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#34))#46,17,2) AS store_sales#47] + +(51) BroadcastExchange +Input [2]: [ca_county#42, store_sales#47] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#48] + +(52) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [ca_county#26] +Right keys [1]: [ca_county#42] +Join condition: None + +(53) Project [codegen id : 24] +Output [5]: [ca_county#10, d_year#6, store_sales#16, store_sales#31, store_sales#47] +Input [7]: [ca_county#10, d_year#6, store_sales#16, ca_county#26, store_sales#31, ca_county#42, store_sales#47] + +(54) Scan parquet default.web_sales +Output [3]: [ws_bill_addr_sk#49, ws_ext_sales_price#50, ws_sold_date_sk#51] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#51), dynamicpruningexpression(ws_sold_date_sk#51 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_bill_addr_sk)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 14] +Input [3]: [ws_bill_addr_sk#49, ws_ext_sales_price#50, ws_sold_date_sk#51] + +(56) Filter [codegen id : 14] +Input [3]: [ws_bill_addr_sk#49, ws_ext_sales_price#50, ws_sold_date_sk#51] +Condition : isnotnull(ws_bill_addr_sk#49) + +(57) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#52, d_year#53, d_qoy#54] + +(58) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#51] +Right keys [1]: [d_date_sk#52] +Join condition: None + +(59) Project [codegen id : 14] +Output [4]: [ws_bill_addr_sk#49, ws_ext_sales_price#50, d_year#53, d_qoy#54] +Input [6]: [ws_bill_addr_sk#49, ws_ext_sales_price#50, ws_sold_date_sk#51, d_date_sk#52, d_year#53, d_qoy#54] + +(60) ReusedExchange [Reuses operator id: 13] +Output [2]: [ca_address_sk#55, ca_county#56] + +(61) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_bill_addr_sk#49] +Right keys [1]: [ca_address_sk#55] +Join condition: None + +(62) Project [codegen id : 14] +Output [4]: [ws_ext_sales_price#50, d_year#53, d_qoy#54, ca_county#56] +Input [6]: [ws_bill_addr_sk#49, ws_ext_sales_price#50, d_year#53, d_qoy#54, ca_address_sk#55, ca_county#56] + +(63) HashAggregate [codegen id : 14] +Input [4]: [ws_ext_sales_price#50, d_year#53, d_qoy#54, ca_county#56] +Keys [3]: [ca_county#56, d_qoy#54, d_year#53] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#50))] +Aggregate Attributes [1]: [sum#57] +Results [4]: [ca_county#56, d_qoy#54, d_year#53, sum#58] + +(64) Exchange +Input [4]: [ca_county#56, d_qoy#54, d_year#53, sum#58] +Arguments: hashpartitioning(ca_county#56, d_qoy#54, d_year#53, 5), ENSURE_REQUIREMENTS, [id=#59] + +(65) HashAggregate [codegen id : 15] +Input [4]: [ca_county#56, d_qoy#54, d_year#53, sum#58] +Keys [3]: [ca_county#56, d_qoy#54, d_year#53] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#50))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#50))#60] +Results [2]: [ca_county#56, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#50))#60,17,2) AS web_sales#61] + +(66) BroadcastExchange +Input [2]: [ca_county#56, web_sales#61] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#62] + +(67) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [ca_county#10] +Right keys [1]: [ca_county#56] +Join condition: None + +(68) Scan parquet default.web_sales +Output [3]: [ws_bill_addr_sk#63, ws_ext_sales_price#64, ws_sold_date_sk#65] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#65), dynamicpruningexpression(ws_sold_date_sk#65 IN dynamicpruning#20)] +PushedFilters: [IsNotNull(ws_bill_addr_sk)] +ReadSchema: struct + +(69) ColumnarToRow [codegen id : 18] +Input [3]: [ws_bill_addr_sk#63, ws_ext_sales_price#64, ws_sold_date_sk#65] + +(70) Filter [codegen id : 18] +Input [3]: [ws_bill_addr_sk#63, ws_ext_sales_price#64, ws_sold_date_sk#65] +Condition : isnotnull(ws_bill_addr_sk#63) + +(71) ReusedExchange [Reuses operator id: 25] +Output [3]: [d_date_sk#66, d_year#67, d_qoy#68] + +(72) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [ws_sold_date_sk#65] +Right keys [1]: [d_date_sk#66] +Join condition: None + +(73) Project [codegen id : 18] +Output [4]: [ws_bill_addr_sk#63, ws_ext_sales_price#64, d_year#67, d_qoy#68] +Input [6]: [ws_bill_addr_sk#63, ws_ext_sales_price#64, ws_sold_date_sk#65, d_date_sk#66, d_year#67, d_qoy#68] + +(74) ReusedExchange [Reuses operator id: 13] +Output [2]: [ca_address_sk#69, ca_county#70] + +(75) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [ws_bill_addr_sk#63] +Right keys [1]: [ca_address_sk#69] +Join condition: None + +(76) Project [codegen id : 18] +Output [4]: [ws_ext_sales_price#64, d_year#67, d_qoy#68, ca_county#70] +Input [6]: [ws_bill_addr_sk#63, ws_ext_sales_price#64, d_year#67, d_qoy#68, ca_address_sk#69, ca_county#70] + +(77) HashAggregate [codegen id : 18] +Input [4]: [ws_ext_sales_price#64, d_year#67, d_qoy#68, ca_county#70] +Keys [3]: [ca_county#70, d_qoy#68, d_year#67] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#64))] +Aggregate Attributes [1]: [sum#71] +Results [4]: [ca_county#70, d_qoy#68, d_year#67, sum#72] + +(78) Exchange +Input [4]: [ca_county#70, d_qoy#68, d_year#67, sum#72] +Arguments: hashpartitioning(ca_county#70, d_qoy#68, d_year#67, 5), ENSURE_REQUIREMENTS, [id=#73] + +(79) HashAggregate [codegen id : 19] +Input [4]: [ca_county#70, d_qoy#68, d_year#67, sum#72] +Keys [3]: [ca_county#70, d_qoy#68, d_year#67] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#64))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#64))#74] +Results [2]: [ca_county#70, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#64))#74,17,2) AS web_sales#75] + +(80) BroadcastExchange +Input [2]: [ca_county#70, web_sales#75] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#76] + +(81) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [ca_county#56] +Right keys [1]: [ca_county#70] +Join condition: (CASE WHEN (web_sales#61 > 0.00) THEN CheckOverflow((promote_precision(web_sales#75) / promote_precision(web_sales#61)), DecimalType(37,20), true) ELSE null END > CASE WHEN (store_sales#16 > 0.00) THEN CheckOverflow((promote_precision(store_sales#31) / promote_precision(store_sales#16)), DecimalType(37,20), true) ELSE null END) + +(82) Project [codegen id : 24] +Output [8]: [ca_county#10, d_year#6, store_sales#16, store_sales#31, store_sales#47, ca_county#56, web_sales#61, web_sales#75] +Input [9]: [ca_county#10, d_year#6, store_sales#16, store_sales#31, store_sales#47, ca_county#56, web_sales#61, ca_county#70, web_sales#75] + +(83) Scan parquet default.web_sales +Output [3]: [ws_bill_addr_sk#77, ws_ext_sales_price#78, ws_sold_date_sk#79] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#79), dynamicpruningexpression(ws_sold_date_sk#79 IN dynamicpruning#36)] +PushedFilters: [IsNotNull(ws_bill_addr_sk)] +ReadSchema: struct + +(84) ColumnarToRow [codegen id : 22] +Input [3]: [ws_bill_addr_sk#77, ws_ext_sales_price#78, ws_sold_date_sk#79] + +(85) Filter [codegen id : 22] +Input [3]: [ws_bill_addr_sk#77, ws_ext_sales_price#78, ws_sold_date_sk#79] +Condition : isnotnull(ws_bill_addr_sk#77) + +(86) ReusedExchange [Reuses operator id: 42] +Output [3]: [d_date_sk#80, d_year#81, d_qoy#82] + +(87) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [ws_sold_date_sk#79] +Right keys [1]: [d_date_sk#80] +Join condition: None + +(88) Project [codegen id : 22] +Output [4]: [ws_bill_addr_sk#77, ws_ext_sales_price#78, d_year#81, d_qoy#82] +Input [6]: [ws_bill_addr_sk#77, ws_ext_sales_price#78, ws_sold_date_sk#79, d_date_sk#80, d_year#81, d_qoy#82] + +(89) ReusedExchange [Reuses operator id: 13] +Output [2]: [ca_address_sk#83, ca_county#84] + +(90) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [ws_bill_addr_sk#77] +Right keys [1]: [ca_address_sk#83] +Join condition: None + +(91) Project [codegen id : 22] +Output [4]: [ws_ext_sales_price#78, d_year#81, d_qoy#82, ca_county#84] +Input [6]: [ws_bill_addr_sk#77, ws_ext_sales_price#78, d_year#81, d_qoy#82, ca_address_sk#83, ca_county#84] + +(92) HashAggregate [codegen id : 22] +Input [4]: [ws_ext_sales_price#78, d_year#81, d_qoy#82, ca_county#84] +Keys [3]: [ca_county#84, d_qoy#82, d_year#81] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#78))] +Aggregate Attributes [1]: [sum#85] +Results [4]: [ca_county#84, d_qoy#82, d_year#81, sum#86] + +(93) Exchange +Input [4]: [ca_county#84, d_qoy#82, d_year#81, sum#86] +Arguments: hashpartitioning(ca_county#84, d_qoy#82, d_year#81, 5), ENSURE_REQUIREMENTS, [id=#87] + +(94) HashAggregate [codegen id : 23] +Input [4]: [ca_county#84, d_qoy#82, d_year#81, sum#86] +Keys [3]: [ca_county#84, d_qoy#82, d_year#81] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#78))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#78))#88] +Results [2]: [ca_county#84, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#78))#88,17,2) AS web_sales#89] + +(95) BroadcastExchange +Input [2]: [ca_county#84, web_sales#89] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#90] + +(96) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [ca_county#56] +Right keys [1]: [ca_county#84] +Join condition: (CASE WHEN (web_sales#75 > 0.00) THEN CheckOverflow((promote_precision(web_sales#89) / promote_precision(web_sales#75)), DecimalType(37,20), true) ELSE null END > CASE WHEN (store_sales#31 > 0.00) THEN CheckOverflow((promote_precision(store_sales#47) / promote_precision(store_sales#31)), DecimalType(37,20), true) ELSE null END) + +(97) Project [codegen id : 24] +Output [6]: [ca_county#10, d_year#6, CheckOverflow((promote_precision(web_sales#75) / promote_precision(web_sales#61)), DecimalType(37,20), true) AS web_q1_q2_increase#91, CheckOverflow((promote_precision(store_sales#31) / promote_precision(store_sales#16)), DecimalType(37,20), true) AS store_q1_q2_increase#92, CheckOverflow((promote_precision(web_sales#89) / promote_precision(web_sales#75)), DecimalType(37,20), true) AS web_q2_q3_increase#93, CheckOverflow((promote_precision(store_sales#47) / promote_precision(store_sales#31)), DecimalType(37,20), true) AS store_q2_q3_increase#94] +Input [10]: [ca_county#10, d_year#6, store_sales#16, store_sales#31, store_sales#47, ca_county#56, web_sales#61, web_sales#75, ca_county#84, web_sales#89] + +(98) Exchange +Input [6]: [ca_county#10, d_year#6, web_q1_q2_increase#91, store_q1_q2_increase#92, web_q2_q3_increase#93, store_q2_q3_increase#94] +Arguments: rangepartitioning(ca_county#10 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#95] + +(99) Sort [codegen id : 25] +Input [6]: [ca_county#10, d_year#6, web_q1_q2_increase#91, store_q1_q2_increase#92, web_q2_q3_increase#93, store_q2_q3_increase#94] +Arguments: [ca_county#10 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (100) + + +(100) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] + +Subquery:2 Hosting operator id = 19 Hosting Expression = ss_sold_date_sk#19 IN dynamicpruning#20 +ReusedExchange (101) + + +(101) ReusedExchange [Reuses operator id: 25] +Output [3]: [d_date_sk#21, d_year#22, d_qoy#23] + +Subquery:3 Hosting operator id = 36 Hosting Expression = ss_sold_date_sk#35 IN dynamicpruning#36 +ReusedExchange (102) + + +(102) ReusedExchange [Reuses operator id: 42] +Output [3]: [d_date_sk#37, d_year#38, d_qoy#39] + +Subquery:4 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#51 IN dynamicpruning#4 + +Subquery:5 Hosting operator id = 68 Hosting Expression = ws_sold_date_sk#65 IN dynamicpruning#20 + +Subquery:6 Hosting operator id = 83 Hosting Expression = ws_sold_date_sk#79 IN dynamicpruning#36 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31/simplified.txt new file mode 100644 index 0000000000000..d7d6c5ee63cbc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q31/simplified.txt @@ -0,0 +1,159 @@ +WholeStageCodegen (25) + Sort [ca_county] + InputAdapter + Exchange [ca_county] #1 + WholeStageCodegen (24) + Project [ca_county,d_year,web_sales,web_sales,store_sales,store_sales,web_sales,store_sales] + BroadcastHashJoin [ca_county,ca_county,web_sales,web_sales,store_sales,store_sales] + Project [ca_county,d_year,store_sales,store_sales,store_sales,ca_county,web_sales,web_sales] + BroadcastHashJoin [ca_county,ca_county,web_sales,web_sales,store_sales,store_sales] + BroadcastHashJoin [ca_county,ca_county] + Project [ca_county,d_year,store_sales,store_sales,store_sales] + BroadcastHashJoin [ca_county,ca_county] + BroadcastHashJoin [ca_county,ca_county] + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #2 + WholeStageCodegen (3) + HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,d_year,d_qoy,ca_county] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_addr_sk,ss_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_qoy] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [ca_address_sk,ca_county] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #6 + WholeStageCodegen (6) + HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,d_year,d_qoy,ca_county] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_addr_sk,ss_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year,d_qoy] #7 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (4) + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #4 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (11) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ss_ext_sales_price)),store_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #9 + WholeStageCodegen (10) + HashAggregate [ca_county,d_qoy,d_year,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,d_year,d_qoy,ca_county] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_addr_sk,ss_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #3 + ReusedExchange [d_date_sk,d_year,d_qoy] #10 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (8) + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #4 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (15) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ws_ext_sales_price)),web_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #12 + WholeStageCodegen (14) + HashAggregate [ca_county,d_qoy,d_year,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,d_year,d_qoy,ca_county] + BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] + Project [ws_bill_addr_sk,ws_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_addr_sk,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #3 + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #4 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (19) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ws_ext_sales_price)),web_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #14 + WholeStageCodegen (18) + HashAggregate [ca_county,d_qoy,d_year,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,d_year,d_qoy,ca_county] + BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] + Project [ws_bill_addr_sk,ws_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_addr_sk,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #7 + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #4 + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (23) + HashAggregate [ca_county,d_qoy,d_year,sum] [sum(UnscaledValue(ws_ext_sales_price)),web_sales,sum] + InputAdapter + Exchange [ca_county,d_qoy,d_year] #16 + WholeStageCodegen (22) + HashAggregate [ca_county,d_qoy,d_year,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,d_year,d_qoy,ca_county] + BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] + Project [ws_bill_addr_sk,ws_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_addr_sk,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #3 + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #10 + InputAdapter + ReusedExchange [ca_address_sk,ca_county] #4 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/explain.txt new file mode 100644 index 0000000000000..5d171e5f595b9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/explain.txt @@ -0,0 +1,189 @@ +== Physical Plan == +CollectLimit (31) ++- * Project (30) + +- * BroadcastHashJoin Inner BuildRight (29) + :- * Project (27) + : +- * BroadcastHashJoin Inner BuildLeft (26) + : :- BroadcastExchange (22) + : : +- * Project (21) + : : +- * BroadcastHashJoin Inner BuildLeft (20) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (19) + : : +- * HashAggregate (18) + : : +- Exchange (17) + : : +- * HashAggregate (16) + : : +- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.catalog_sales (6) + : : +- BroadcastExchange (13) + : : +- * Project (12) + : : +- * Filter (11) + : : +- * ColumnarToRow (10) + : : +- Scan parquet default.date_dim (9) + : +- * Filter (25) + : +- * ColumnarToRow (24) + : +- Scan parquet default.catalog_sales (23) + +- ReusedExchange (28) + + +(1) Scan parquet default.item +Output [2]: [i_item_sk#1, i_manufact_id#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,977), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [2]: [i_item_sk#1, i_manufact_id#2] + +(3) Filter [codegen id : 1] +Input [2]: [i_item_sk#1, i_manufact_id#2] +Condition : ((isnotnull(i_manufact_id#2) AND (i_manufact_id#2 = 977)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [i_item_sk#1] +Input [2]: [i_item_sk#1, i_manufact_id#2] + +(5) BroadcastExchange +Input [1]: [i_item_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] + +(6) Scan parquet default.catalog_sales +Output [3]: [cs_item_sk#4, cs_ext_discount_amt#5, cs_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#6), dynamicpruningexpression(cs_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [3]: [cs_item_sk#4, cs_ext_discount_amt#5, cs_sold_date_sk#6] + +(8) Filter [codegen id : 3] +Input [3]: [cs_item_sk#4, cs_ext_discount_amt#5, cs_sold_date_sk#6] +Condition : isnotnull(cs_item_sk#4) + +(9) Scan parquet default.date_dim +Output [2]: [d_date_sk#8, d_date#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-01-27), LessThanOrEqual(d_date,2000-04-26), IsNotNull(d_date_sk)] +ReadSchema: struct + +(10) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#8, d_date#9] + +(11) Filter [codegen id : 2] +Input [2]: [d_date_sk#8, d_date#9] +Condition : (((isnotnull(d_date#9) AND (d_date#9 >= 2000-01-27)) AND (d_date#9 <= 2000-04-26)) AND isnotnull(d_date_sk#8)) + +(12) Project [codegen id : 2] +Output [1]: [d_date_sk#8] +Input [2]: [d_date_sk#8, d_date#9] + +(13) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(15) Project [codegen id : 3] +Output [2]: [cs_item_sk#4, cs_ext_discount_amt#5] +Input [4]: [cs_item_sk#4, cs_ext_discount_amt#5, cs_sold_date_sk#6, d_date_sk#8] + +(16) HashAggregate [codegen id : 3] +Input [2]: [cs_item_sk#4, cs_ext_discount_amt#5] +Keys [1]: [cs_item_sk#4] +Functions [1]: [partial_avg(UnscaledValue(cs_ext_discount_amt#5))] +Aggregate Attributes [2]: [sum#11, count#12] +Results [3]: [cs_item_sk#4, sum#13, count#14] + +(17) Exchange +Input [3]: [cs_item_sk#4, sum#13, count#14] +Arguments: hashpartitioning(cs_item_sk#4, 5), ENSURE_REQUIREMENTS, [id=#15] + +(18) HashAggregate +Input [3]: [cs_item_sk#4, sum#13, count#14] +Keys [1]: [cs_item_sk#4] +Functions [1]: [avg(UnscaledValue(cs_ext_discount_amt#5))] +Aggregate Attributes [1]: [avg(UnscaledValue(cs_ext_discount_amt#5))#16] +Results [2]: [CheckOverflow((1.300000 * promote_precision(cast((avg(UnscaledValue(cs_ext_discount_amt#5))#16 / 100.0) as decimal(11,6)))), DecimalType(14,7), true) AS (1.3 * avg(cs_ext_discount_amt))#17, cs_item_sk#4] + +(19) Filter +Input [2]: [(1.3 * avg(cs_ext_discount_amt))#17, cs_item_sk#4] +Condition : isnotnull((1.3 * avg(cs_ext_discount_amt))#17) + +(20) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [cs_item_sk#4] +Join condition: None + +(21) Project [codegen id : 4] +Output [2]: [i_item_sk#1, (1.3 * avg(cs_ext_discount_amt))#17] +Input [3]: [i_item_sk#1, (1.3 * avg(cs_ext_discount_amt))#17, cs_item_sk#4] + +(22) BroadcastExchange +Input [2]: [i_item_sk#1, (1.3 * avg(cs_ext_discount_amt))#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(23) Scan parquet default.catalog_sales +Output [3]: [cs_item_sk#19, cs_ext_discount_amt#20, cs_sold_date_sk#21] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#21), dynamicpruningexpression(cs_sold_date_sk#21 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_ext_discount_amt)] +ReadSchema: struct + +(24) ColumnarToRow +Input [3]: [cs_item_sk#19, cs_ext_discount_amt#20, cs_sold_date_sk#21] + +(25) Filter +Input [3]: [cs_item_sk#19, cs_ext_discount_amt#20, cs_sold_date_sk#21] +Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_ext_discount_amt#20)) + +(26) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [cs_item_sk#19] +Join condition: (cast(cs_ext_discount_amt#20 as decimal(14,7)) > (1.3 * avg(cs_ext_discount_amt))#17) + +(27) Project [codegen id : 6] +Output [1]: [cs_sold_date_sk#21] +Input [5]: [i_item_sk#1, (1.3 * avg(cs_ext_discount_amt))#17, cs_item_sk#19, cs_ext_discount_amt#20, cs_sold_date_sk#21] + +(28) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#22] + +(29) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#21] +Right keys [1]: [d_date_sk#22] +Join condition: None + +(30) Project [codegen id : 6] +Output [1]: [1 AS excess discount amount #23] +Input [2]: [cs_sold_date_sk#21, d_date_sk#22] + +(31) CollectLimit +Input [1]: [excess discount amount #23] +Arguments: 100 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = cs_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (32) + + +(32) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 23 Hosting Expression = cs_sold_date_sk#21 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/simplified.txt new file mode 100644 index 0000000000000..303bdf58604bf --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32.sf100/simplified.txt @@ -0,0 +1,48 @@ +CollectLimit + WholeStageCodegen (6) + Project + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sold_date_sk] + BroadcastHashJoin [i_item_sk,cs_item_sk,cs_ext_discount_amt,(1.3 * avg(cs_ext_discount_amt))] + InputAdapter + BroadcastExchange #1 + WholeStageCodegen (4) + Project [i_item_sk,(1.3 * avg(cs_ext_discount_amt))] + BroadcastHashJoin [i_item_sk,cs_item_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [i_item_sk] + Filter [i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_manufact_id] + Filter [(1.3 * avg(cs_ext_discount_amt))] + HashAggregate [cs_item_sk,sum,count] [avg(UnscaledValue(cs_ext_discount_amt)),(1.3 * avg(cs_ext_discount_amt)),sum,count] + InputAdapter + Exchange [cs_item_sk] #3 + WholeStageCodegen (3) + HashAggregate [cs_item_sk,cs_ext_discount_amt] [sum,count,sum,count] + Project [cs_item_sk,cs_ext_discount_amt] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_ext_discount_amt,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + Filter [cs_item_sk,cs_ext_discount_amt] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_ext_discount_amt,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32/explain.txt new file mode 100644 index 0000000000000..ad918310a918a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32/explain.txt @@ -0,0 +1,189 @@ +== Physical Plan == +CollectLimit (31) ++- * Project (30) + +- * BroadcastHashJoin Inner BuildRight (29) + :- * Project (27) + : +- * BroadcastHashJoin Inner BuildRight (26) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.catalog_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.item (4) + : +- BroadcastExchange (25) + : +- * Filter (24) + : +- * HashAggregate (23) + : +- Exchange (22) + : +- * HashAggregate (21) + : +- * Project (20) + : +- * BroadcastHashJoin Inner BuildRight (19) + : :- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.catalog_sales (11) + : +- BroadcastExchange (18) + : +- * Project (17) + : +- * Filter (16) + : +- * ColumnarToRow (15) + : +- Scan parquet default.date_dim (14) + +- ReusedExchange (28) + + +(1) Scan parquet default.catalog_sales +Output [3]: [cs_item_sk#1, cs_ext_discount_amt#2, cs_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#3), dynamicpruningexpression(cs_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_ext_discount_amt)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 6] +Input [3]: [cs_item_sk#1, cs_ext_discount_amt#2, cs_sold_date_sk#3] + +(3) Filter [codegen id : 6] +Input [3]: [cs_item_sk#1, cs_ext_discount_amt#2, cs_sold_date_sk#3] +Condition : (isnotnull(cs_item_sk#1) AND isnotnull(cs_ext_discount_amt#2)) + +(4) Scan parquet default.item +Output [2]: [i_item_sk#5, i_manufact_id#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,977), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [i_item_sk#5, i_manufact_id#6] + +(6) Filter [codegen id : 1] +Input [2]: [i_item_sk#5, i_manufact_id#6] +Condition : ((isnotnull(i_manufact_id#6) AND (i_manufact_id#6 = 977)) AND isnotnull(i_item_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [i_item_sk#5] +Input [2]: [i_item_sk#5, i_manufact_id#6] + +(8) BroadcastExchange +Input [1]: [i_item_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(10) Project [codegen id : 6] +Output [3]: [cs_ext_discount_amt#2, cs_sold_date_sk#3, i_item_sk#5] +Input [4]: [cs_item_sk#1, cs_ext_discount_amt#2, cs_sold_date_sk#3, i_item_sk#5] + +(11) Scan parquet default.catalog_sales +Output [3]: [cs_item_sk#8, cs_ext_discount_amt#9, cs_sold_date_sk#10] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#10), dynamicpruningexpression(cs_sold_date_sk#10 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 3] +Input [3]: [cs_item_sk#8, cs_ext_discount_amt#9, cs_sold_date_sk#10] + +(13) Filter [codegen id : 3] +Input [3]: [cs_item_sk#8, cs_ext_discount_amt#9, cs_sold_date_sk#10] +Condition : isnotnull(cs_item_sk#8) + +(14) Scan parquet default.date_dim +Output [2]: [d_date_sk#11, d_date#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-01-27), LessThanOrEqual(d_date,2000-04-26), IsNotNull(d_date_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#11, d_date#12] + +(16) Filter [codegen id : 2] +Input [2]: [d_date_sk#11, d_date#12] +Condition : (((isnotnull(d_date#12) AND (d_date#12 >= 2000-01-27)) AND (d_date#12 <= 2000-04-26)) AND isnotnull(d_date_sk#11)) + +(17) Project [codegen id : 2] +Output [1]: [d_date_sk#11] +Input [2]: [d_date_sk#11, d_date#12] + +(18) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(19) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#10] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(20) Project [codegen id : 3] +Output [2]: [cs_item_sk#8, cs_ext_discount_amt#9] +Input [4]: [cs_item_sk#8, cs_ext_discount_amt#9, cs_sold_date_sk#10, d_date_sk#11] + +(21) HashAggregate [codegen id : 3] +Input [2]: [cs_item_sk#8, cs_ext_discount_amt#9] +Keys [1]: [cs_item_sk#8] +Functions [1]: [partial_avg(UnscaledValue(cs_ext_discount_amt#9))] +Aggregate Attributes [2]: [sum#14, count#15] +Results [3]: [cs_item_sk#8, sum#16, count#17] + +(22) Exchange +Input [3]: [cs_item_sk#8, sum#16, count#17] +Arguments: hashpartitioning(cs_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#18] + +(23) HashAggregate [codegen id : 4] +Input [3]: [cs_item_sk#8, sum#16, count#17] +Keys [1]: [cs_item_sk#8] +Functions [1]: [avg(UnscaledValue(cs_ext_discount_amt#9))] +Aggregate Attributes [1]: [avg(UnscaledValue(cs_ext_discount_amt#9))#19] +Results [2]: [CheckOverflow((1.300000 * promote_precision(cast((avg(UnscaledValue(cs_ext_discount_amt#9))#19 / 100.0) as decimal(11,6)))), DecimalType(14,7), true) AS (1.3 * avg(cs_ext_discount_amt))#20, cs_item_sk#8] + +(24) Filter [codegen id : 4] +Input [2]: [(1.3 * avg(cs_ext_discount_amt))#20, cs_item_sk#8] +Condition : isnotnull((1.3 * avg(cs_ext_discount_amt))#20) + +(25) BroadcastExchange +Input [2]: [(1.3 * avg(cs_ext_discount_amt))#20, cs_item_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#21] + +(26) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [i_item_sk#5] +Right keys [1]: [cs_item_sk#8] +Join condition: (cast(cs_ext_discount_amt#2 as decimal(14,7)) > (1.3 * avg(cs_ext_discount_amt))#20) + +(27) Project [codegen id : 6] +Output [1]: [cs_sold_date_sk#3] +Input [5]: [cs_ext_discount_amt#2, cs_sold_date_sk#3, i_item_sk#5, (1.3 * avg(cs_ext_discount_amt))#20, cs_item_sk#8] + +(28) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#22] + +(29) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#3] +Right keys [1]: [d_date_sk#22] +Join condition: None + +(30) Project [codegen id : 6] +Output [1]: [1 AS excess discount amount #23] +Input [2]: [cs_sold_date_sk#3, d_date_sk#22] + +(31) CollectLimit +Input [1]: [excess discount amount #23] +Arguments: 100 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (32) + + +(32) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#22] + +Subquery:2 Hosting operator id = 11 Hosting Expression = cs_sold_date_sk#10 IN dynamicpruning#4 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32/simplified.txt new file mode 100644 index 0000000000000..f3dd6d0954046 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q32/simplified.txt @@ -0,0 +1,48 @@ +CollectLimit + WholeStageCodegen (6) + Project + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sold_date_sk] + BroadcastHashJoin [i_item_sk,cs_item_sk,cs_ext_discount_amt,(1.3 * avg(cs_ext_discount_amt))] + Project [cs_ext_discount_amt,cs_sold_date_sk,i_item_sk] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk,cs_ext_discount_amt] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_ext_discount_amt,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #1 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [i_item_sk] + Filter [i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_manufact_id] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (4) + Filter [(1.3 * avg(cs_ext_discount_amt))] + HashAggregate [cs_item_sk,sum,count] [avg(UnscaledValue(cs_ext_discount_amt)),(1.3 * avg(cs_ext_discount_amt)),sum,count] + InputAdapter + Exchange [cs_item_sk] #4 + WholeStageCodegen (3) + HashAggregate [cs_item_sk,cs_ext_discount_amt] [sum,count,sum,count] + Project [cs_item_sk,cs_ext_discount_amt] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_ext_discount_amt,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + BroadcastExchange #1 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + ReusedExchange [d_date_sk] #1 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/explain.txt new file mode 100644 index 0000000000000..2aa99626920ec --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/explain.txt @@ -0,0 +1,395 @@ +== Physical Plan == +TakeOrderedAndProject (67) ++- * HashAggregate (66) + +- Exchange (65) + +- * HashAggregate (64) + +- Union (63) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (22) + : : +- * BroadcastHashJoin Inner BuildRight (21) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (20) + : : +- * BroadcastHashJoin LeftSemi BuildRight (19) + : : :- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.item (11) + : : +- BroadcastExchange (18) + : : +- * Project (17) + : : +- * Filter (16) + : : +- * ColumnarToRow (15) + : : +- Scan parquet default.item (14) + : +- BroadcastExchange (27) + : +- * Project (26) + : +- * Filter (25) + : +- * ColumnarToRow (24) + : +- Scan parquet default.customer_address (23) + :- * HashAggregate (47) + : +- Exchange (46) + : +- * HashAggregate (45) + : +- * Project (44) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Project (41) + : : +- * BroadcastHashJoin Inner BuildRight (40) + : : :- * Project (38) + : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.catalog_sales (33) + : : : +- ReusedExchange (36) + : : +- ReusedExchange (39) + : +- ReusedExchange (42) + +- * HashAggregate (62) + +- Exchange (61) + +- * HashAggregate (60) + +- * Project (59) + +- * BroadcastHashJoin Inner BuildRight (58) + :- * Project (56) + : +- * BroadcastHashJoin Inner BuildRight (55) + : :- * Project (53) + : : +- * BroadcastHashJoin Inner BuildRight (52) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.web_sales (48) + : : +- ReusedExchange (51) + : +- ReusedExchange (54) + +- ReusedExchange (57) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_addr_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 5] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_addr_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,5), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((isnotnull(d_year#7) AND isnotnull(d_moy#8)) AND (d_year#7 = 1998)) AND (d_moy#8 = 5)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 5] +Output [3]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] +Input [5]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.item +Output [2]: [i_item_sk#10, i_manufact_id#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_sk#10, i_manufact_id#11] + +(13) Filter [codegen id : 3] +Input [2]: [i_item_sk#10, i_manufact_id#11] +Condition : isnotnull(i_item_sk#10) + +(14) Scan parquet default.item +Output [2]: [i_category#12, i_manufact_id#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Electronics )] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 2] +Input [2]: [i_category#12, i_manufact_id#13] + +(16) Filter [codegen id : 2] +Input [2]: [i_category#12, i_manufact_id#13] +Condition : (isnotnull(i_category#12) AND (i_category#12 = Electronics )) + +(17) Project [codegen id : 2] +Output [1]: [i_manufact_id#13] +Input [2]: [i_category#12, i_manufact_id#13] + +(18) BroadcastExchange +Input [1]: [i_manufact_id#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(19) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [i_manufact_id#11] +Right keys [1]: [i_manufact_id#13] +Join condition: None + +(20) BroadcastExchange +Input [2]: [i_item_sk#10, i_manufact_id#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(21) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#10] +Join condition: None + +(22) Project [codegen id : 5] +Output [3]: [ss_addr_sk#2, ss_ext_sales_price#3, i_manufact_id#11] +Input [5]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, i_item_sk#10, i_manufact_id#11] + +(23) Scan parquet default.customer_address +Output [2]: [ca_address_sk#16, ca_gmt_offset#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_gmt_offset), EqualTo(ca_gmt_offset,-5.00), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [2]: [ca_address_sk#16, ca_gmt_offset#17] + +(25) Filter [codegen id : 4] +Input [2]: [ca_address_sk#16, ca_gmt_offset#17] +Condition : ((isnotnull(ca_gmt_offset#17) AND (ca_gmt_offset#17 = -5.00)) AND isnotnull(ca_address_sk#16)) + +(26) Project [codegen id : 4] +Output [1]: [ca_address_sk#16] +Input [2]: [ca_address_sk#16, ca_gmt_offset#17] + +(27) BroadcastExchange +Input [1]: [ca_address_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#2] +Right keys [1]: [ca_address_sk#16] +Join condition: None + +(29) Project [codegen id : 5] +Output [2]: [ss_ext_sales_price#3, i_manufact_id#11] +Input [4]: [ss_addr_sk#2, ss_ext_sales_price#3, i_manufact_id#11, ca_address_sk#16] + +(30) HashAggregate [codegen id : 5] +Input [2]: [ss_ext_sales_price#3, i_manufact_id#11] +Keys [1]: [i_manufact_id#11] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum#19] +Results [2]: [i_manufact_id#11, sum#20] + +(31) Exchange +Input [2]: [i_manufact_id#11, sum#20] +Arguments: hashpartitioning(i_manufact_id#11, 5), ENSURE_REQUIREMENTS, [id=#21] + +(32) HashAggregate [codegen id : 6] +Input [2]: [i_manufact_id#11, sum#20] +Keys [1]: [i_manufact_id#11] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#22] +Results [2]: [i_manufact_id#11, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#22,17,2) AS total_sales#23] + +(33) Scan parquet default.catalog_sales +Output [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#27), dynamicpruningexpression(cs_sold_date_sk#27 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] + +(35) Filter [codegen id : 11] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] +Condition : (isnotnull(cs_bill_addr_sk#24) AND isnotnull(cs_item_sk#25)) + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#28] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#27] +Right keys [1]: [d_date_sk#28] +Join condition: None + +(38) Project [codegen id : 11] +Output [3]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] +Input [5]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27, d_date_sk#28] + +(39) ReusedExchange [Reuses operator id: 20] +Output [2]: [i_item_sk#29, i_manufact_id#30] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_item_sk#25] +Right keys [1]: [i_item_sk#29] +Join condition: None + +(41) Project [codegen id : 11] +Output [3]: [cs_bill_addr_sk#24, cs_ext_sales_price#26, i_manufact_id#30] +Input [5]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, i_item_sk#29, i_manufact_id#30] + +(42) ReusedExchange [Reuses operator id: 27] +Output [1]: [ca_address_sk#31] + +(43) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_bill_addr_sk#24] +Right keys [1]: [ca_address_sk#31] +Join condition: None + +(44) Project [codegen id : 11] +Output [2]: [cs_ext_sales_price#26, i_manufact_id#30] +Input [4]: [cs_bill_addr_sk#24, cs_ext_sales_price#26, i_manufact_id#30, ca_address_sk#31] + +(45) HashAggregate [codegen id : 11] +Input [2]: [cs_ext_sales_price#26, i_manufact_id#30] +Keys [1]: [i_manufact_id#30] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#26))] +Aggregate Attributes [1]: [sum#32] +Results [2]: [i_manufact_id#30, sum#33] + +(46) Exchange +Input [2]: [i_manufact_id#30, sum#33] +Arguments: hashpartitioning(i_manufact_id#30, 5), ENSURE_REQUIREMENTS, [id=#34] + +(47) HashAggregate [codegen id : 12] +Input [2]: [i_manufact_id#30, sum#33] +Keys [1]: [i_manufact_id#30] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#26))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#26))#35] +Results [2]: [i_manufact_id#30, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#26))#35,17,2) AS total_sales#36] + +(48) Scan parquet default.web_sales +Output [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#40), dynamicpruningexpression(ws_sold_date_sk#40 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 17] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] + +(50) Filter [codegen id : 17] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] +Condition : (isnotnull(ws_bill_addr_sk#38) AND isnotnull(ws_item_sk#37)) + +(51) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#41] + +(52) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#40] +Right keys [1]: [d_date_sk#41] +Join condition: None + +(53) Project [codegen id : 17] +Output [3]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39] +Input [5]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40, d_date_sk#41] + +(54) ReusedExchange [Reuses operator id: 20] +Output [2]: [i_item_sk#42, i_manufact_id#43] + +(55) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_item_sk#37] +Right keys [1]: [i_item_sk#42] +Join condition: None + +(56) Project [codegen id : 17] +Output [3]: [ws_bill_addr_sk#38, ws_ext_sales_price#39, i_manufact_id#43] +Input [5]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, i_item_sk#42, i_manufact_id#43] + +(57) ReusedExchange [Reuses operator id: 27] +Output [1]: [ca_address_sk#44] + +(58) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_bill_addr_sk#38] +Right keys [1]: [ca_address_sk#44] +Join condition: None + +(59) Project [codegen id : 17] +Output [2]: [ws_ext_sales_price#39, i_manufact_id#43] +Input [4]: [ws_bill_addr_sk#38, ws_ext_sales_price#39, i_manufact_id#43, ca_address_sk#44] + +(60) HashAggregate [codegen id : 17] +Input [2]: [ws_ext_sales_price#39, i_manufact_id#43] +Keys [1]: [i_manufact_id#43] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#39))] +Aggregate Attributes [1]: [sum#45] +Results [2]: [i_manufact_id#43, sum#46] + +(61) Exchange +Input [2]: [i_manufact_id#43, sum#46] +Arguments: hashpartitioning(i_manufact_id#43, 5), ENSURE_REQUIREMENTS, [id=#47] + +(62) HashAggregate [codegen id : 18] +Input [2]: [i_manufact_id#43, sum#46] +Keys [1]: [i_manufact_id#43] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#39))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#39))#48] +Results [2]: [i_manufact_id#43, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#39))#48,17,2) AS total_sales#49] + +(63) Union + +(64) HashAggregate [codegen id : 19] +Input [2]: [i_manufact_id#11, total_sales#23] +Keys [1]: [i_manufact_id#11] +Functions [1]: [partial_sum(total_sales#23)] +Aggregate Attributes [2]: [sum#50, isEmpty#51] +Results [3]: [i_manufact_id#11, sum#52, isEmpty#53] + +(65) Exchange +Input [3]: [i_manufact_id#11, sum#52, isEmpty#53] +Arguments: hashpartitioning(i_manufact_id#11, 5), ENSURE_REQUIREMENTS, [id=#54] + +(66) HashAggregate [codegen id : 20] +Input [3]: [i_manufact_id#11, sum#52, isEmpty#53] +Keys [1]: [i_manufact_id#11] +Functions [1]: [sum(total_sales#23)] +Aggregate Attributes [1]: [sum(total_sales#23)#55] +Results [2]: [i_manufact_id#11, sum(total_sales#23)#55 AS total_sales#56] + +(67) TakeOrderedAndProject +Input [2]: [i_manufact_id#11, total_sales#56] +Arguments: 100, [total_sales#56 ASC NULLS FIRST], [i_manufact_id#11, total_sales#56] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (68) + + +(68) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 33 Hosting Expression = cs_sold_date_sk#27 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 48 Hosting Expression = ws_sold_date_sk#40 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/simplified.txt new file mode 100644 index 0000000000000..1b29ee6b28a9c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33.sf100/simplified.txt @@ -0,0 +1,105 @@ +TakeOrderedAndProject [total_sales,i_manufact_id] + WholeStageCodegen (20) + HashAggregate [i_manufact_id,sum,isEmpty] [sum(total_sales),total_sales,sum,isEmpty] + InputAdapter + Exchange [i_manufact_id] #1 + WholeStageCodegen (19) + HashAggregate [i_manufact_id,total_sales] [sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (6) + HashAggregate [i_manufact_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_manufact_id] #2 + WholeStageCodegen (5) + HashAggregate [i_manufact_id,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_manufact_id] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_addr_sk,ss_ext_sales_price,i_manufact_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_addr_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_addr_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + BroadcastHashJoin [i_manufact_id,i_manufact_id] + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_manufact_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [i_manufact_id] + Filter [i_category] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_category,i_manufact_id] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Project [ca_address_sk] + Filter [ca_gmt_offset,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_gmt_offset] + WholeStageCodegen (12) + HashAggregate [i_manufact_id,sum] [sum(UnscaledValue(cs_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_manufact_id] #7 + WholeStageCodegen (11) + HashAggregate [i_manufact_id,cs_ext_sales_price] [sum,sum] + Project [cs_ext_sales_price,i_manufact_id] + BroadcastHashJoin [cs_bill_addr_sk,ca_address_sk] + Project [cs_bill_addr_sk,cs_ext_sales_price,i_manufact_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_addr_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [i_item_sk,i_manufact_id] #4 + InputAdapter + ReusedExchange [ca_address_sk] #6 + WholeStageCodegen (18) + HashAggregate [i_manufact_id,sum] [sum(UnscaledValue(ws_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_manufact_id] #8 + WholeStageCodegen (17) + HashAggregate [i_manufact_id,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,i_manufact_id] + BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] + Project [ws_bill_addr_sk,ws_ext_sales_price,i_manufact_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_addr_sk,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [i_item_sk,i_manufact_id] #4 + InputAdapter + ReusedExchange [ca_address_sk] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/explain.txt new file mode 100644 index 0000000000000..eeda8611876d6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/explain.txt @@ -0,0 +1,395 @@ +== Physical Plan == +TakeOrderedAndProject (67) ++- * HashAggregate (66) + +- Exchange (65) + +- * HashAggregate (64) + +- Union (63) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.customer_address (11) + : +- BroadcastExchange (27) + : +- * BroadcastHashJoin LeftSemi BuildRight (26) + : :- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.item (18) + : +- BroadcastExchange (25) + : +- * Project (24) + : +- * Filter (23) + : +- * ColumnarToRow (22) + : +- Scan parquet default.item (21) + :- * HashAggregate (47) + : +- Exchange (46) + : +- * HashAggregate (45) + : +- * Project (44) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Project (41) + : : +- * BroadcastHashJoin Inner BuildRight (40) + : : :- * Project (38) + : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.catalog_sales (33) + : : : +- ReusedExchange (36) + : : +- ReusedExchange (39) + : +- ReusedExchange (42) + +- * HashAggregate (62) + +- Exchange (61) + +- * HashAggregate (60) + +- * Project (59) + +- * BroadcastHashJoin Inner BuildRight (58) + :- * Project (56) + : +- * BroadcastHashJoin Inner BuildRight (55) + : :- * Project (53) + : : +- * BroadcastHashJoin Inner BuildRight (52) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.web_sales (48) + : : +- ReusedExchange (51) + : +- ReusedExchange (54) + +- ReusedExchange (57) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_addr_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 5] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_addr_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,5), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((isnotnull(d_year#7) AND isnotnull(d_moy#8)) AND (d_year#7 = 1998)) AND (d_moy#8 = 5)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 5] +Output [3]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] +Input [5]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.customer_address +Output [2]: [ca_address_sk#10, ca_gmt_offset#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_gmt_offset), EqualTo(ca_gmt_offset,-5.00), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] + +(13) Filter [codegen id : 2] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] +Condition : ((isnotnull(ca_gmt_offset#11) AND (ca_gmt_offset#11 = -5.00)) AND isnotnull(ca_address_sk#10)) + +(14) Project [codegen id : 2] +Output [1]: [ca_address_sk#10] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] + +(15) BroadcastExchange +Input [1]: [ca_address_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#2] +Right keys [1]: [ca_address_sk#10] +Join condition: None + +(17) Project [codegen id : 5] +Output [2]: [ss_item_sk#1, ss_ext_sales_price#3] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ca_address_sk#10] + +(18) Scan parquet default.item +Output [2]: [i_item_sk#13, i_manufact_id#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#13, i_manufact_id#14] + +(20) Filter [codegen id : 4] +Input [2]: [i_item_sk#13, i_manufact_id#14] +Condition : isnotnull(i_item_sk#13) + +(21) Scan parquet default.item +Output [2]: [i_category#15, i_manufact_id#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Electronics )] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 3] +Input [2]: [i_category#15, i_manufact_id#16] + +(23) Filter [codegen id : 3] +Input [2]: [i_category#15, i_manufact_id#16] +Condition : (isnotnull(i_category#15) AND (i_category#15 = Electronics )) + +(24) Project [codegen id : 3] +Output [1]: [i_manufact_id#16] +Input [2]: [i_category#15, i_manufact_id#16] + +(25) BroadcastExchange +Input [1]: [i_manufact_id#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(26) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_manufact_id#14] +Right keys [1]: [i_manufact_id#16] +Join condition: None + +(27) BroadcastExchange +Input [2]: [i_item_sk#13, i_manufact_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(29) Project [codegen id : 5] +Output [2]: [ss_ext_sales_price#3, i_manufact_id#14] +Input [4]: [ss_item_sk#1, ss_ext_sales_price#3, i_item_sk#13, i_manufact_id#14] + +(30) HashAggregate [codegen id : 5] +Input [2]: [ss_ext_sales_price#3, i_manufact_id#14] +Keys [1]: [i_manufact_id#14] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum#19] +Results [2]: [i_manufact_id#14, sum#20] + +(31) Exchange +Input [2]: [i_manufact_id#14, sum#20] +Arguments: hashpartitioning(i_manufact_id#14, 5), ENSURE_REQUIREMENTS, [id=#21] + +(32) HashAggregate [codegen id : 6] +Input [2]: [i_manufact_id#14, sum#20] +Keys [1]: [i_manufact_id#14] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#22] +Results [2]: [i_manufact_id#14, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#22,17,2) AS total_sales#23] + +(33) Scan parquet default.catalog_sales +Output [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#27), dynamicpruningexpression(cs_sold_date_sk#27 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] + +(35) Filter [codegen id : 11] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] +Condition : (isnotnull(cs_bill_addr_sk#24) AND isnotnull(cs_item_sk#25)) + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#28] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#27] +Right keys [1]: [d_date_sk#28] +Join condition: None + +(38) Project [codegen id : 11] +Output [3]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] +Input [5]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27, d_date_sk#28] + +(39) ReusedExchange [Reuses operator id: 15] +Output [1]: [ca_address_sk#29] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_bill_addr_sk#24] +Right keys [1]: [ca_address_sk#29] +Join condition: None + +(41) Project [codegen id : 11] +Output [2]: [cs_item_sk#25, cs_ext_sales_price#26] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, ca_address_sk#29] + +(42) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#30, i_manufact_id#31] + +(43) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_item_sk#25] +Right keys [1]: [i_item_sk#30] +Join condition: None + +(44) Project [codegen id : 11] +Output [2]: [cs_ext_sales_price#26, i_manufact_id#31] +Input [4]: [cs_item_sk#25, cs_ext_sales_price#26, i_item_sk#30, i_manufact_id#31] + +(45) HashAggregate [codegen id : 11] +Input [2]: [cs_ext_sales_price#26, i_manufact_id#31] +Keys [1]: [i_manufact_id#31] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#26))] +Aggregate Attributes [1]: [sum#32] +Results [2]: [i_manufact_id#31, sum#33] + +(46) Exchange +Input [2]: [i_manufact_id#31, sum#33] +Arguments: hashpartitioning(i_manufact_id#31, 5), ENSURE_REQUIREMENTS, [id=#34] + +(47) HashAggregate [codegen id : 12] +Input [2]: [i_manufact_id#31, sum#33] +Keys [1]: [i_manufact_id#31] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#26))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#26))#35] +Results [2]: [i_manufact_id#31, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#26))#35,17,2) AS total_sales#36] + +(48) Scan parquet default.web_sales +Output [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#40), dynamicpruningexpression(ws_sold_date_sk#40 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 17] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] + +(50) Filter [codegen id : 17] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] +Condition : (isnotnull(ws_bill_addr_sk#38) AND isnotnull(ws_item_sk#37)) + +(51) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#41] + +(52) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#40] +Right keys [1]: [d_date_sk#41] +Join condition: None + +(53) Project [codegen id : 17] +Output [3]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39] +Input [5]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40, d_date_sk#41] + +(54) ReusedExchange [Reuses operator id: 15] +Output [1]: [ca_address_sk#42] + +(55) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_bill_addr_sk#38] +Right keys [1]: [ca_address_sk#42] +Join condition: None + +(56) Project [codegen id : 17] +Output [2]: [ws_item_sk#37, ws_ext_sales_price#39] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ca_address_sk#42] + +(57) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#43, i_manufact_id#44] + +(58) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_item_sk#37] +Right keys [1]: [i_item_sk#43] +Join condition: None + +(59) Project [codegen id : 17] +Output [2]: [ws_ext_sales_price#39, i_manufact_id#44] +Input [4]: [ws_item_sk#37, ws_ext_sales_price#39, i_item_sk#43, i_manufact_id#44] + +(60) HashAggregate [codegen id : 17] +Input [2]: [ws_ext_sales_price#39, i_manufact_id#44] +Keys [1]: [i_manufact_id#44] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#39))] +Aggregate Attributes [1]: [sum#45] +Results [2]: [i_manufact_id#44, sum#46] + +(61) Exchange +Input [2]: [i_manufact_id#44, sum#46] +Arguments: hashpartitioning(i_manufact_id#44, 5), ENSURE_REQUIREMENTS, [id=#47] + +(62) HashAggregate [codegen id : 18] +Input [2]: [i_manufact_id#44, sum#46] +Keys [1]: [i_manufact_id#44] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#39))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#39))#48] +Results [2]: [i_manufact_id#44, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#39))#48,17,2) AS total_sales#49] + +(63) Union + +(64) HashAggregate [codegen id : 19] +Input [2]: [i_manufact_id#14, total_sales#23] +Keys [1]: [i_manufact_id#14] +Functions [1]: [partial_sum(total_sales#23)] +Aggregate Attributes [2]: [sum#50, isEmpty#51] +Results [3]: [i_manufact_id#14, sum#52, isEmpty#53] + +(65) Exchange +Input [3]: [i_manufact_id#14, sum#52, isEmpty#53] +Arguments: hashpartitioning(i_manufact_id#14, 5), ENSURE_REQUIREMENTS, [id=#54] + +(66) HashAggregate [codegen id : 20] +Input [3]: [i_manufact_id#14, sum#52, isEmpty#53] +Keys [1]: [i_manufact_id#14] +Functions [1]: [sum(total_sales#23)] +Aggregate Attributes [1]: [sum(total_sales#23)#55] +Results [2]: [i_manufact_id#14, sum(total_sales#23)#55 AS total_sales#56] + +(67) TakeOrderedAndProject +Input [2]: [i_manufact_id#14, total_sales#56] +Arguments: 100, [total_sales#56 ASC NULLS FIRST], [i_manufact_id#14, total_sales#56] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (68) + + +(68) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 33 Hosting Expression = cs_sold_date_sk#27 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 48 Hosting Expression = ws_sold_date_sk#40 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/simplified.txt new file mode 100644 index 0000000000000..d1a115fa528d5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q33/simplified.txt @@ -0,0 +1,105 @@ +TakeOrderedAndProject [total_sales,i_manufact_id] + WholeStageCodegen (20) + HashAggregate [i_manufact_id,sum,isEmpty] [sum(total_sales),total_sales,sum,isEmpty] + InputAdapter + Exchange [i_manufact_id] #1 + WholeStageCodegen (19) + HashAggregate [i_manufact_id,total_sales] [sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (6) + HashAggregate [i_manufact_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_manufact_id] #2 + WholeStageCodegen (5) + HashAggregate [i_manufact_id,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_manufact_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_addr_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_addr_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [ca_address_sk] + Filter [ca_gmt_offset,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_gmt_offset] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + BroadcastHashJoin [i_manufact_id,i_manufact_id] + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_manufact_id] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [i_manufact_id] + Filter [i_category] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_category,i_manufact_id] + WholeStageCodegen (12) + HashAggregate [i_manufact_id,sum] [sum(UnscaledValue(cs_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_manufact_id] #7 + WholeStageCodegen (11) + HashAggregate [i_manufact_id,cs_ext_sales_price] [sum,sum] + Project [cs_ext_sales_price,i_manufact_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_bill_addr_sk,ca_address_sk] + Project [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_addr_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [ca_address_sk] #4 + InputAdapter + ReusedExchange [i_item_sk,i_manufact_id] #5 + WholeStageCodegen (18) + HashAggregate [i_manufact_id,sum] [sum(UnscaledValue(ws_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_manufact_id] #8 + WholeStageCodegen (17) + HashAggregate [i_manufact_id,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,i_manufact_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] + Project [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_addr_sk,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [ca_address_sk] #4 + InputAdapter + ReusedExchange [i_item_sk,i_manufact_id] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q34.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q34.sf100/explain.txt new file mode 100644 index 0000000000000..ea9994910c3b9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q34.sf100/explain.txt @@ -0,0 +1,229 @@ +== Physical Plan == +* Sort (39) ++- Exchange (38) + +- * Project (37) + +- * SortMergeJoin Inner (36) + :- * Sort (30) + : +- Exchange (29) + : +- * Filter (28) + : +- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.household_demographics (18) + +- * Sort (35) + +- Exchange (34) + +- * Filter (33) + +- * ColumnarToRow (32) + +- Scan parquet default.customer (31) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Condition : ((isnotnull(ss_store_sk#3) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_dom#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] +Condition : (((((d_dom#9 >= 1) AND (d_dom#9 <= 3)) OR ((d_dom#9 >= 25) AND (d_dom#9 <= 28))) AND d_year#8 IN (1999,2000,2001)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4] +Input [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#11, s_county#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_county), EqualTo(s_county,Williamson County), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] +Condition : ((isnotnull(s_county#12) AND (s_county#12 = Williamson County)) AND isnotnull(s_store_sk#11)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#11] +Input [2]: [s_store_sk#11, s_county#12] + +(15) BroadcastExchange +Input [1]: [s_store_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#11] +Join condition: None + +(17) Project [codegen id : 4] +Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#11] + +(18) Scan parquet default.household_demographics +Output [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000 ),EqualTo(hd_buy_potential,unknown )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(20) Filter [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Condition : (((((isnotnull(hd_vehicle_count#17) AND isnotnull(hd_dep_count#16)) AND ((hd_buy_potential#15 = >10000 ) OR (hd_buy_potential#15 = unknown ))) AND (hd_vehicle_count#17 > 0)) AND ((cast(hd_dep_count#16 as double) / cast(hd_vehicle_count#17 as double)) > 1.2)) AND isnotnull(hd_demo_sk#14)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#14] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#14] +Join condition: None + +(24) Project [codegen id : 4] +Output [2]: [ss_customer_sk#1, ss_ticket_number#4] +Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#14] + +(25) HashAggregate [codegen id : 4] +Input [2]: [ss_customer_sk#1, ss_ticket_number#4] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#19] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] + +(26) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) HashAggregate [codegen id : 5] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#22] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#22 AS cnt#23] + +(28) Filter [codegen id : 5] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Condition : ((cnt#23 >= 15) AND (cnt#23 <= 20)) + +(29) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#24] + +(30) Sort [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(31) Scan parquet default.customer +Output [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 7] +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] + +(33) Filter [codegen id : 7] +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Condition : isnotnull(c_customer_sk#25) + +(34) Exchange +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Arguments: hashpartitioning(c_customer_sk#25, 5), ENSURE_REQUIREMENTS, [id=#30] + +(35) Sort [codegen id : 8] +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Arguments: [c_customer_sk#25 ASC NULLS FIRST], false, 0 + +(36) SortMergeJoin [codegen id : 9] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#25] +Join condition: None + +(37) Project [codegen id : 9] +Output [6]: [c_last_name#28, c_first_name#27, c_salutation#26, c_preferred_cust_flag#29, ss_ticket_number#4, cnt#23] +Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23, c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] + +(38) Exchange +Input [6]: [c_last_name#28, c_first_name#27, c_salutation#26, c_preferred_cust_flag#29, ss_ticket_number#4, cnt#23] +Arguments: rangepartitioning(c_last_name#28 ASC NULLS FIRST, c_first_name#27 ASC NULLS FIRST, c_salutation#26 ASC NULLS FIRST, c_preferred_cust_flag#29 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#31] + +(39) Sort [codegen id : 10] +Input [6]: [c_last_name#28, c_first_name#27, c_salutation#26, c_preferred_cust_flag#29, ss_ticket_number#4, cnt#23] +Arguments: [c_last_name#28 ASC NULLS FIRST, c_first_name#27 ASC NULLS FIRST, c_salutation#26 ASC NULLS FIRST, c_preferred_cust_flag#29 DESC NULLS LAST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (40) + + +(40) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q34.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q34.sf100/simplified.txt new file mode 100644 index 0000000000000..24c5c1c256c26 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q34.sf100/simplified.txt @@ -0,0 +1,65 @@ +WholeStageCodegen (10) + Sort [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag] + InputAdapter + Exchange [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag] #1 + WholeStageCodegen (9) + Project [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number,cnt] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #2 + WholeStageCodegen (5) + Filter [cnt] + HashAggregate [ss_ticket_number,ss_customer_sk,count] [count(1),cnt,count] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk] #3 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk] [count,count] + Project [ss_customer_sk,ss_ticket_number] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_county,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_vehicle_count,hd_dep_count,hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential,hd_dep_count,hd_vehicle_count] + InputAdapter + WholeStageCodegen (8) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #7 + WholeStageCodegen (7) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q34/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q34/explain.txt new file mode 100644 index 0000000000000..df5b93da51771 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q34/explain.txt @@ -0,0 +1,214 @@ +== Physical Plan == +* Sort (36) ++- Exchange (35) + +- * Project (34) + +- * BroadcastHashJoin Inner BuildRight (33) + :- * Filter (28) + : +- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.household_demographics (18) + +- BroadcastExchange (32) + +- * Filter (31) + +- * ColumnarToRow (30) + +- Scan parquet default.customer (29) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Condition : ((isnotnull(ss_store_sk#3) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_dom#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] +Condition : (((((d_dom#9 >= 1) AND (d_dom#9 <= 3)) OR ((d_dom#9 >= 25) AND (d_dom#9 <= 28))) AND d_year#8 IN (1999,2000,2001)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4] +Input [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#11, s_county#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_county), EqualTo(s_county,Williamson County), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] +Condition : ((isnotnull(s_county#12) AND (s_county#12 = Williamson County)) AND isnotnull(s_store_sk#11)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#11] +Input [2]: [s_store_sk#11, s_county#12] + +(15) BroadcastExchange +Input [1]: [s_store_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#11] +Join condition: None + +(17) Project [codegen id : 4] +Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#11] + +(18) Scan parquet default.household_demographics +Output [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000 ),EqualTo(hd_buy_potential,unknown )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(20) Filter [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Condition : (((((isnotnull(hd_vehicle_count#17) AND isnotnull(hd_dep_count#16)) AND ((hd_buy_potential#15 = >10000 ) OR (hd_buy_potential#15 = unknown ))) AND (hd_vehicle_count#17 > 0)) AND ((cast(hd_dep_count#16 as double) / cast(hd_vehicle_count#17 as double)) > 1.2)) AND isnotnull(hd_demo_sk#14)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#14] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#14] +Join condition: None + +(24) Project [codegen id : 4] +Output [2]: [ss_customer_sk#1, ss_ticket_number#4] +Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#14] + +(25) HashAggregate [codegen id : 4] +Input [2]: [ss_customer_sk#1, ss_ticket_number#4] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#19] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] + +(26) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) HashAggregate [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#22] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#22 AS cnt#23] + +(28) Filter [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Condition : ((cnt#23 >= 15) AND (cnt#23 <= 20)) + +(29) Scan parquet default.customer +Output [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] + +(31) Filter [codegen id : 5] +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Condition : isnotnull(c_customer_sk#24) + +(32) BroadcastExchange +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#24] +Join condition: None + +(34) Project [codegen id : 6] +Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] + +(35) Exchange +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Arguments: rangepartitioning(c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#30] + +(36) Sort [codegen id : 7] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Arguments: [c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (37) + + +(37) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q34/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q34/simplified.txt new file mode 100644 index 0000000000000..e4f89ab27658b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q34/simplified.txt @@ -0,0 +1,56 @@ +WholeStageCodegen (7) + Sort [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag] + InputAdapter + Exchange [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag] #1 + WholeStageCodegen (6) + Project [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number,cnt] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Filter [cnt] + HashAggregate [ss_ticket_number,ss_customer_sk,count] [count(1),cnt,count] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk] #2 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk] [count,count] + Project [ss_customer_sk,ss_ticket_number] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_county,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_vehicle_count,hd_dep_count,hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/explain.txt new file mode 100644 index 0000000000000..9ed490449b008 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/explain.txt @@ -0,0 +1,328 @@ +== Physical Plan == +TakeOrderedAndProject (57) ++- * HashAggregate (56) + +- Exchange (55) + +- * HashAggregate (54) + +- * Project (53) + +- * SortMergeJoin Inner (52) + :- * Sort (46) + : +- Exchange (45) + : +- * Project (44) + : +- * SortMergeJoin Inner (43) + : :- * Sort (37) + : : +- Exchange (36) + : : +- * Project (35) + : : +- * Filter (34) + : : +- SortMergeJoin ExistenceJoin(exists#1) (33) + : : :- SortMergeJoin ExistenceJoin(exists#2) (25) + : : : :- * SortMergeJoin LeftSemi (17) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- * Sort (16) + : : : : +- Exchange (15) + : : : : +- * Project (14) + : : : : +- * BroadcastHashJoin Inner BuildRight (13) + : : : : :- * ColumnarToRow (7) + : : : : : +- Scan parquet default.store_sales (6) + : : : : +- BroadcastExchange (12) + : : : : +- * Project (11) + : : : : +- * Filter (10) + : : : : +- * ColumnarToRow (9) + : : : : +- Scan parquet default.date_dim (8) + : : : +- * Sort (24) + : : : +- Exchange (23) + : : : +- * Project (22) + : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : :- * ColumnarToRow (19) + : : : : +- Scan parquet default.web_sales (18) + : : : +- ReusedExchange (20) + : : +- * Sort (32) + : : +- Exchange (31) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * ColumnarToRow (27) + : : : +- Scan parquet default.catalog_sales (26) + : : +- ReusedExchange (28) + : +- * Sort (42) + : +- Exchange (41) + : +- * Filter (40) + : +- * ColumnarToRow (39) + : +- Scan parquet default.customer_address (38) + +- * Sort (51) + +- Exchange (50) + +- * Filter (49) + +- * ColumnarToRow (48) + +- Scan parquet default.customer_demographics (47) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] + +(3) Filter [codegen id : 1] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4)) + +(4) Exchange +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: hashpartitioning(c_customer_sk#3, 5), ENSURE_REQUIREMENTS, [id=#6] + +(5) Sort [codegen id : 2] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: [c_customer_sk#3 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ss_customer_sk#7, ss_sold_date_sk#8] + +(8) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_qoy#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,2002), LessThan(d_qoy,4), IsNotNull(d_date_sk)] +ReadSchema: struct + +(9) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#10, d_year#11, d_qoy#12] + +(10) Filter [codegen id : 3] +Input [3]: [d_date_sk#10, d_year#11, d_qoy#12] +Condition : ((((isnotnull(d_year#11) AND isnotnull(d_qoy#12)) AND (d_year#11 = 2002)) AND (d_qoy#12 < 4)) AND isnotnull(d_date_sk#10)) + +(11) Project [codegen id : 3] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_qoy#12] + +(12) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(13) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(14) Project [codegen id : 4] +Output [1]: [ss_customer_sk#7] +Input [3]: [ss_customer_sk#7, ss_sold_date_sk#8, d_date_sk#10] + +(15) Exchange +Input [1]: [ss_customer_sk#7] +Arguments: hashpartitioning(ss_customer_sk#7, 5), ENSURE_REQUIREMENTS, [id=#14] + +(16) Sort [codegen id : 5] +Input [1]: [ss_customer_sk#7] +Arguments: [ss_customer_sk#7 ASC NULLS FIRST], false, 0 + +(17) SortMergeJoin [codegen id : 6] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ss_customer_sk#7] +Join condition: None + +(18) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#15, ws_sold_date_sk#16] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#16), dynamicpruningexpression(ws_sold_date_sk#16 IN dynamicpruning#9)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 8] +Input [2]: [ws_bill_customer_sk#15, ws_sold_date_sk#16] + +(20) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#17] + +(21) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_sold_date_sk#16] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(22) Project [codegen id : 8] +Output [1]: [ws_bill_customer_sk#15] +Input [3]: [ws_bill_customer_sk#15, ws_sold_date_sk#16, d_date_sk#17] + +(23) Exchange +Input [1]: [ws_bill_customer_sk#15] +Arguments: hashpartitioning(ws_bill_customer_sk#15, 5), ENSURE_REQUIREMENTS, [id=#18] + +(24) Sort [codegen id : 9] +Input [1]: [ws_bill_customer_sk#15] +Arguments: [ws_bill_customer_sk#15 ASC NULLS FIRST], false, 0 + +(25) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ws_bill_customer_sk#15] +Join condition: None + +(26) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#19, cs_sold_date_sk#20] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#20), dynamicpruningexpression(cs_sold_date_sk#20 IN dynamicpruning#9)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 11] +Input [2]: [cs_ship_customer_sk#19, cs_sold_date_sk#20] + +(28) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#21] + +(29) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#20] +Right keys [1]: [d_date_sk#21] +Join condition: None + +(30) Project [codegen id : 11] +Output [1]: [cs_ship_customer_sk#19] +Input [3]: [cs_ship_customer_sk#19, cs_sold_date_sk#20, d_date_sk#21] + +(31) Exchange +Input [1]: [cs_ship_customer_sk#19] +Arguments: hashpartitioning(cs_ship_customer_sk#19, 5), ENSURE_REQUIREMENTS, [id=#22] + +(32) Sort [codegen id : 12] +Input [1]: [cs_ship_customer_sk#19] +Arguments: [cs_ship_customer_sk#19 ASC NULLS FIRST], false, 0 + +(33) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [cs_ship_customer_sk#19] +Join condition: None + +(34) Filter [codegen id : 13] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] +Condition : (exists#2 OR exists#1) + +(35) Project [codegen id : 13] +Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] + +(36) Exchange +Input [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: hashpartitioning(c_current_addr_sk#5, 5), ENSURE_REQUIREMENTS, [id=#23] + +(37) Sort [codegen id : 14] +Input [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: [c_current_addr_sk#5 ASC NULLS FIRST], false, 0 + +(38) Scan parquet default.customer_address +Output [2]: [ca_address_sk#24, ca_state#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 15] +Input [2]: [ca_address_sk#24, ca_state#25] + +(40) Filter [codegen id : 15] +Input [2]: [ca_address_sk#24, ca_state#25] +Condition : isnotnull(ca_address_sk#24) + +(41) Exchange +Input [2]: [ca_address_sk#24, ca_state#25] +Arguments: hashpartitioning(ca_address_sk#24, 5), ENSURE_REQUIREMENTS, [id=#26] + +(42) Sort [codegen id : 16] +Input [2]: [ca_address_sk#24, ca_state#25] +Arguments: [ca_address_sk#24 ASC NULLS FIRST], false, 0 + +(43) SortMergeJoin [codegen id : 17] +Left keys [1]: [c_current_addr_sk#5] +Right keys [1]: [ca_address_sk#24] +Join condition: None + +(44) Project [codegen id : 17] +Output [2]: [c_current_cdemo_sk#4, ca_state#25] +Input [4]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#24, ca_state#25] + +(45) Exchange +Input [2]: [c_current_cdemo_sk#4, ca_state#25] +Arguments: hashpartitioning(c_current_cdemo_sk#4, 5), ENSURE_REQUIREMENTS, [id=#27] + +(46) Sort [codegen id : 18] +Input [2]: [c_current_cdemo_sk#4, ca_state#25] +Arguments: [c_current_cdemo_sk#4 ASC NULLS FIRST], false, 0 + +(47) Scan parquet default.customer_demographics +Output [6]: [cd_demo_sk#28, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 19] +Input [6]: [cd_demo_sk#28, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] + +(49) Filter [codegen id : 19] +Input [6]: [cd_demo_sk#28, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Condition : isnotnull(cd_demo_sk#28) + +(50) Exchange +Input [6]: [cd_demo_sk#28, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Arguments: hashpartitioning(cd_demo_sk#28, 5), ENSURE_REQUIREMENTS, [id=#34] + +(51) Sort [codegen id : 20] +Input [6]: [cd_demo_sk#28, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Arguments: [cd_demo_sk#28 ASC NULLS FIRST], false, 0 + +(52) SortMergeJoin [codegen id : 21] +Left keys [1]: [c_current_cdemo_sk#4] +Right keys [1]: [cd_demo_sk#28] +Join condition: None + +(53) Project [codegen id : 21] +Output [6]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Input [8]: [c_current_cdemo_sk#4, ca_state#25, cd_demo_sk#28, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] + +(54) HashAggregate [codegen id : 21] +Input [6]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Keys [6]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Functions [10]: [partial_count(1), partial_min(cd_dep_count#31), partial_max(cd_dep_count#31), partial_avg(cd_dep_count#31), partial_min(cd_dep_employed_count#32), partial_max(cd_dep_employed_count#32), partial_avg(cd_dep_employed_count#32), partial_min(cd_dep_college_count#33), partial_max(cd_dep_college_count#33), partial_avg(cd_dep_college_count#33)] +Aggregate Attributes [13]: [count#35, min#36, max#37, sum#38, count#39, min#40, max#41, sum#42, count#43, min#44, max#45, sum#46, count#47] +Results [19]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#48, min#49, max#50, sum#51, count#52, min#53, max#54, sum#55, count#56, min#57, max#58, sum#59, count#60] + +(55) Exchange +Input [19]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#48, min#49, max#50, sum#51, count#52, min#53, max#54, sum#55, count#56, min#57, max#58, sum#59, count#60] +Arguments: hashpartitioning(ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, 5), ENSURE_REQUIREMENTS, [id=#61] + +(56) HashAggregate [codegen id : 22] +Input [19]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#48, min#49, max#50, sum#51, count#52, min#53, max#54, sum#55, count#56, min#57, max#58, sum#59, count#60] +Keys [6]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Functions [10]: [count(1), min(cd_dep_count#31), max(cd_dep_count#31), avg(cd_dep_count#31), min(cd_dep_employed_count#32), max(cd_dep_employed_count#32), avg(cd_dep_employed_count#32), min(cd_dep_college_count#33), max(cd_dep_college_count#33), avg(cd_dep_college_count#33)] +Aggregate Attributes [10]: [count(1)#62, min(cd_dep_count#31)#63, max(cd_dep_count#31)#64, avg(cd_dep_count#31)#65, min(cd_dep_employed_count#32)#66, max(cd_dep_employed_count#32)#67, avg(cd_dep_employed_count#32)#68, min(cd_dep_college_count#33)#69, max(cd_dep_college_count#33)#70, avg(cd_dep_college_count#33)#71] +Results [18]: [ca_state#25, cd_gender#29, cd_marital_status#30, count(1)#62 AS cnt1#72, min(cd_dep_count#31)#63 AS min(cd_dep_count)#73, max(cd_dep_count#31)#64 AS max(cd_dep_count)#74, avg(cd_dep_count#31)#65 AS avg(cd_dep_count)#75, cd_dep_employed_count#32, count(1)#62 AS cnt2#76, min(cd_dep_employed_count#32)#66 AS min(cd_dep_employed_count)#77, max(cd_dep_employed_count#32)#67 AS max(cd_dep_employed_count)#78, avg(cd_dep_employed_count#32)#68 AS avg(cd_dep_employed_count)#79, cd_dep_college_count#33, count(1)#62 AS cnt3#80, min(cd_dep_college_count#33)#69 AS min(cd_dep_college_count)#81, max(cd_dep_college_count#33)#70 AS max(cd_dep_college_count)#82, avg(cd_dep_college_count#33)#71 AS avg(cd_dep_college_count)#83, cd_dep_count#31 AS aggOrder#84] + +(57) TakeOrderedAndProject +Input [18]: [ca_state#25, cd_gender#29, cd_marital_status#30, cnt1#72, min(cd_dep_count)#73, max(cd_dep_count)#74, avg(cd_dep_count)#75, cd_dep_employed_count#32, cnt2#76, min(cd_dep_employed_count)#77, max(cd_dep_employed_count)#78, avg(cd_dep_employed_count)#79, cd_dep_college_count#33, cnt3#80, min(cd_dep_college_count)#81, max(cd_dep_college_count)#82, avg(cd_dep_college_count)#83, aggOrder#84] +Arguments: 100, [ca_state#25 ASC NULLS FIRST, cd_gender#29 ASC NULLS FIRST, cd_marital_status#30 ASC NULLS FIRST, aggOrder#84 ASC NULLS FIRST, cd_dep_employed_count#32 ASC NULLS FIRST, cd_dep_college_count#33 ASC NULLS FIRST], [ca_state#25, cd_gender#29, cd_marital_status#30, cnt1#72, min(cd_dep_count)#73, max(cd_dep_count)#74, avg(cd_dep_count)#75, cd_dep_employed_count#32, cnt2#76, min(cd_dep_employed_count)#77, max(cd_dep_employed_count)#78, avg(cd_dep_employed_count)#79, cd_dep_college_count#33, cnt3#80, min(cd_dep_college_count)#81, max(cd_dep_college_count)#82, avg(cd_dep_college_count)#83] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (58) + + +(58) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#10] + +Subquery:2 Hosting operator id = 18 Hosting Expression = ws_sold_date_sk#16 IN dynamicpruning#9 + +Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#20 IN dynamicpruning#9 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/simplified.txt new file mode 100644 index 0000000000000..820be2b5fd58a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35.sf100/simplified.txt @@ -0,0 +1,107 @@ +TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,aggOrder,cd_dep_employed_count,cd_dep_college_count,cnt1,min(cd_dep_count),max(cd_dep_count),avg(cd_dep_count),cnt2,min(cd_dep_employed_count),max(cd_dep_employed_count),avg(cd_dep_employed_count),cnt3,min(cd_dep_college_count),max(cd_dep_college_count),avg(cd_dep_college_count)] + WholeStageCodegen (22) + HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count,min,max,sum,count,min,max,sum,count,min,max,sum,count] [count(1),min(cd_dep_count),max(cd_dep_count),avg(cd_dep_count),min(cd_dep_employed_count),max(cd_dep_employed_count),avg(cd_dep_employed_count),min(cd_dep_college_count),max(cd_dep_college_count),avg(cd_dep_college_count),cnt1,min(cd_dep_count),max(cd_dep_count),avg(cd_dep_count),cnt2,min(cd_dep_employed_count),max(cd_dep_employed_count),avg(cd_dep_employed_count),cnt3,min(cd_dep_college_count),max(cd_dep_college_count),avg(cd_dep_college_count),aggOrder,count,min,max,sum,count,min,max,sum,count,min,max,sum,count] + InputAdapter + Exchange [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 + WholeStageCodegen (21) + HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,min,max,sum,count,min,max,sum,count,min,max,sum,count,count,min,max,sum,count,min,max,sum,count,min,max,sum,count] + Project [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (18) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #2 + WholeStageCodegen (17) + Project [c_current_cdemo_sk,ca_state] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (14) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #3 + WholeStageCodegen (13) + Project [c_current_cdemo_sk,c_current_addr_sk] + Filter [exists,exists] + InputAdapter + SortMergeJoin [c_customer_sk,cs_ship_customer_sk] + SortMergeJoin [c_customer_sk,ws_bill_customer_sk] + WholeStageCodegen (6) + SortMergeJoin [c_customer_sk,ss_customer_sk] + InputAdapter + WholeStageCodegen (2) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #4 + WholeStageCodegen (1) + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (5) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #5 + WholeStageCodegen (4) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_qoy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + WholeStageCodegen (9) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #7 + WholeStageCodegen (8) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #6 + WholeStageCodegen (12) + Sort [cs_ship_customer_sk] + InputAdapter + Exchange [cs_ship_customer_sk] #8 + WholeStageCodegen (11) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #6 + InputAdapter + WholeStageCodegen (16) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #9 + WholeStageCodegen (15) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + WholeStageCodegen (20) + Sort [cd_demo_sk] + InputAdapter + Exchange [cd_demo_sk] #10 + WholeStageCodegen (19) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35/explain.txt new file mode 100644 index 0000000000000..48ae824834450 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35/explain.txt @@ -0,0 +1,273 @@ +== Physical Plan == +TakeOrderedAndProject (46) ++- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * Project (42) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (36) + : +- * BroadcastHashJoin Inner BuildRight (35) + : :- * Project (30) + : : +- * Filter (29) + : : +- * BroadcastHashJoin ExistenceJoin(exists#1) BuildRight (28) + : : :- * BroadcastHashJoin ExistenceJoin(exists#2) BuildRight (21) + : : : :- * BroadcastHashJoin LeftSemi BuildRight (14) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (13) + : : : : +- * Project (12) + : : : : +- * BroadcastHashJoin Inner BuildRight (11) + : : : : :- * ColumnarToRow (5) + : : : : : +- Scan parquet default.store_sales (4) + : : : : +- BroadcastExchange (10) + : : : : +- * Project (9) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.date_dim (6) + : : : +- BroadcastExchange (20) + : : : +- * Project (19) + : : : +- * BroadcastHashJoin Inner BuildRight (18) + : : : :- * ColumnarToRow (16) + : : : : +- Scan parquet default.web_sales (15) + : : : +- ReusedExchange (17) + : : +- BroadcastExchange (27) + : : +- * Project (26) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- * ColumnarToRow (23) + : : : +- Scan parquet default.catalog_sales (22) + : : +- ReusedExchange (24) + : +- BroadcastExchange (34) + : +- * Filter (33) + : +- * ColumnarToRow (32) + : +- Scan parquet default.customer_address (31) + +- BroadcastExchange (40) + +- * Filter (39) + +- * ColumnarToRow (38) + +- Scan parquet default.customer_demographics (37) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] + +(3) Filter [codegen id : 9] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4)) + +(4) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 2] +Input [2]: [ss_customer_sk#6, ss_sold_date_sk#7] + +(6) Scan parquet default.date_dim +Output [3]: [d_date_sk#9, d_year#10, d_qoy#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,2002), LessThan(d_qoy,4), IsNotNull(d_date_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] + +(8) Filter [codegen id : 1] +Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] +Condition : ((((isnotnull(d_year#10) AND isnotnull(d_qoy#11)) AND (d_year#10 = 2002)) AND (d_qoy#11 < 4)) AND isnotnull(d_date_sk#9)) + +(9) Project [codegen id : 1] +Output [1]: [d_date_sk#9] +Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] + +(10) BroadcastExchange +Input [1]: [d_date_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(11) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#9] +Join condition: None + +(12) Project [codegen id : 2] +Output [1]: [ss_customer_sk#6] +Input [3]: [ss_customer_sk#6, ss_sold_date_sk#7, d_date_sk#9] + +(13) BroadcastExchange +Input [1]: [ss_customer_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(14) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ss_customer_sk#6] +Join condition: None + +(15) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#14, ws_sold_date_sk#15] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#15), dynamicpruningexpression(ws_sold_date_sk#15 IN dynamicpruning#8)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 4] +Input [2]: [ws_bill_customer_sk#14, ws_sold_date_sk#15] + +(17) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#16] + +(18) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_sold_date_sk#15] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(19) Project [codegen id : 4] +Output [1]: [ws_bill_customer_sk#14] +Input [3]: [ws_bill_customer_sk#14, ws_sold_date_sk#15, d_date_sk#16] + +(20) BroadcastExchange +Input [1]: [ws_bill_customer_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(21) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ws_bill_customer_sk#14] +Join condition: None + +(22) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#18, cs_sold_date_sk#19] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#19), dynamicpruningexpression(cs_sold_date_sk#19 IN dynamicpruning#8)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 6] +Input [2]: [cs_ship_customer_sk#18, cs_sold_date_sk#19] + +(24) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#20] + +(25) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#19] +Right keys [1]: [d_date_sk#20] +Join condition: None + +(26) Project [codegen id : 6] +Output [1]: [cs_ship_customer_sk#18] +Input [3]: [cs_ship_customer_sk#18, cs_sold_date_sk#19, d_date_sk#20] + +(27) BroadcastExchange +Input [1]: [cs_ship_customer_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(28) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [cs_ship_customer_sk#18] +Join condition: None + +(29) Filter [codegen id : 9] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] +Condition : (exists#2 OR exists#1) + +(30) Project [codegen id : 9] +Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] + +(31) Scan parquet default.customer_address +Output [2]: [ca_address_sk#22, ca_state#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#22, ca_state#23] + +(33) Filter [codegen id : 7] +Input [2]: [ca_address_sk#22, ca_state#23] +Condition : isnotnull(ca_address_sk#22) + +(34) BroadcastExchange +Input [2]: [ca_address_sk#22, ca_state#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(35) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_addr_sk#5] +Right keys [1]: [ca_address_sk#22] +Join condition: None + +(36) Project [codegen id : 9] +Output [2]: [c_current_cdemo_sk#4, ca_state#23] +Input [4]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#22, ca_state#23] + +(37) Scan parquet default.customer_demographics +Output [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(38) ColumnarToRow [codegen id : 8] +Input [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] + +(39) Filter [codegen id : 8] +Input [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Condition : isnotnull(cd_demo_sk#25) + +(40) BroadcastExchange +Input [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] + +(41) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_cdemo_sk#4] +Right keys [1]: [cd_demo_sk#25] +Join condition: None + +(42) Project [codegen id : 9] +Output [6]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [8]: [c_current_cdemo_sk#4, ca_state#23, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] + +(43) HashAggregate [codegen id : 9] +Input [6]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Keys [6]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Functions [10]: [partial_count(1), partial_min(cd_dep_count#28), partial_max(cd_dep_count#28), partial_avg(cd_dep_count#28), partial_min(cd_dep_employed_count#29), partial_max(cd_dep_employed_count#29), partial_avg(cd_dep_employed_count#29), partial_min(cd_dep_college_count#30), partial_max(cd_dep_college_count#30), partial_avg(cd_dep_college_count#30)] +Aggregate Attributes [13]: [count#32, min#33, max#34, sum#35, count#36, min#37, max#38, sum#39, count#40, min#41, max#42, sum#43, count#44] +Results [19]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] + +(44) Exchange +Input [19]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] +Arguments: hashpartitioning(ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), ENSURE_REQUIREMENTS, [id=#58] + +(45) HashAggregate [codegen id : 10] +Input [19]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, min#46, max#47, sum#48, count#49, min#50, max#51, sum#52, count#53, min#54, max#55, sum#56, count#57] +Keys [6]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Functions [10]: [count(1), min(cd_dep_count#28), max(cd_dep_count#28), avg(cd_dep_count#28), min(cd_dep_employed_count#29), max(cd_dep_employed_count#29), avg(cd_dep_employed_count#29), min(cd_dep_college_count#30), max(cd_dep_college_count#30), avg(cd_dep_college_count#30)] +Aggregate Attributes [10]: [count(1)#59, min(cd_dep_count#28)#60, max(cd_dep_count#28)#61, avg(cd_dep_count#28)#62, min(cd_dep_employed_count#29)#63, max(cd_dep_employed_count#29)#64, avg(cd_dep_employed_count#29)#65, min(cd_dep_college_count#30)#66, max(cd_dep_college_count#30)#67, avg(cd_dep_college_count#30)#68] +Results [18]: [ca_state#23, cd_gender#26, cd_marital_status#27, count(1)#59 AS cnt1#69, min(cd_dep_count#28)#60 AS min(cd_dep_count)#70, max(cd_dep_count#28)#61 AS max(cd_dep_count)#71, avg(cd_dep_count#28)#62 AS avg(cd_dep_count)#72, cd_dep_employed_count#29, count(1)#59 AS cnt2#73, min(cd_dep_employed_count#29)#63 AS min(cd_dep_employed_count)#74, max(cd_dep_employed_count#29)#64 AS max(cd_dep_employed_count)#75, avg(cd_dep_employed_count#29)#65 AS avg(cd_dep_employed_count)#76, cd_dep_college_count#30, count(1)#59 AS cnt3#77, min(cd_dep_college_count#30)#66 AS min(cd_dep_college_count)#78, max(cd_dep_college_count#30)#67 AS max(cd_dep_college_count)#79, avg(cd_dep_college_count#30)#68 AS avg(cd_dep_college_count)#80, cd_dep_count#28 AS aggOrder#81] + +(46) TakeOrderedAndProject +Input [18]: [ca_state#23, cd_gender#26, cd_marital_status#27, cnt1#69, min(cd_dep_count)#70, max(cd_dep_count)#71, avg(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, min(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, avg(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, min(cd_dep_college_count)#78, max(cd_dep_college_count)#79, avg(cd_dep_college_count)#80, aggOrder#81] +Arguments: 100, [ca_state#23 ASC NULLS FIRST, cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, aggOrder#81 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [ca_state#23, cd_gender#26, cd_marital_status#27, cnt1#69, min(cd_dep_count)#70, max(cd_dep_count)#71, avg(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, min(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, avg(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, min(cd_dep_college_count)#78, max(cd_dep_college_count)#79, avg(cd_dep_college_count)#80] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (47) + + +(47) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#9] + +Subquery:2 Hosting operator id = 15 Hosting Expression = ws_sold_date_sk#15 IN dynamicpruning#8 + +Subquery:3 Hosting operator id = 22 Hosting Expression = cs_sold_date_sk#19 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35/simplified.txt new file mode 100644 index 0000000000000..2614f4f8ae881 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q35/simplified.txt @@ -0,0 +1,74 @@ +TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,aggOrder,cd_dep_employed_count,cd_dep_college_count,cnt1,min(cd_dep_count),max(cd_dep_count),avg(cd_dep_count),cnt2,min(cd_dep_employed_count),max(cd_dep_employed_count),avg(cd_dep_employed_count),cnt3,min(cd_dep_college_count),max(cd_dep_college_count),avg(cd_dep_college_count)] + WholeStageCodegen (10) + HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count,min,max,sum,count,min,max,sum,count,min,max,sum,count] [count(1),min(cd_dep_count),max(cd_dep_count),avg(cd_dep_count),min(cd_dep_employed_count),max(cd_dep_employed_count),avg(cd_dep_employed_count),min(cd_dep_college_count),max(cd_dep_college_count),avg(cd_dep_college_count),cnt1,min(cd_dep_count),max(cd_dep_count),avg(cd_dep_count),cnt2,min(cd_dep_employed_count),max(cd_dep_employed_count),avg(cd_dep_employed_count),cnt3,min(cd_dep_college_count),max(cd_dep_college_count),avg(cd_dep_college_count),aggOrder,count,min,max,sum,count,min,max,sum,count,min,max,sum,count] + InputAdapter + Exchange [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 + WholeStageCodegen (9) + HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,min,max,sum,count,min,max,sum,count,min,max,sum,count,count,min,max,sum,count,min,max,sum,count,min,max,sum,count] + Project [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [c_current_cdemo_sk,ca_state] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + Filter [exists,exists] + BroadcastHashJoin [c_customer_sk,cs_ship_customer_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_qoy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (6) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (8) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/explain.txt new file mode 100644 index 0000000000000..1c593f999ac02 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * Project (31) + +- Window (30) + +- * Sort (29) + +- Exchange (28) + +- * HashAggregate (27) + +- Exchange (26) + +- * HashAggregate (25) + +- * Expand (24) + +- * Project (23) + +- * BroadcastHashJoin Inner BuildRight (22) + :- * Project (17) + : +- * BroadcastHashJoin Inner BuildRight (16) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (15) + : +- * Project (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.store (11) + +- BroadcastExchange (21) + +- * Filter (20) + +- * ColumnarToRow (19) + +- Scan parquet default.item (18) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5] +Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_store_sk#2)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_year#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#7, d_year#8] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#7, d_year#8] +Condition : ((isnotnull(d_year#8) AND (d_year#8 = 2001)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [2]: [d_date_sk#7, d_year#8] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4] +Input [6]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#10, s_state#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#10, s_state#11] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#10, s_state#11] +Condition : ((isnotnull(s_state#11) AND (s_state#11 = TN)) AND isnotnull(s_store_sk#10)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#10] +Input [2]: [s_store_sk#10, s_state#11] + +(15) BroadcastExchange +Input [1]: [s_store_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#10] +Join condition: None + +(17) Project [codegen id : 4] +Output [3]: [ss_item_sk#1, ss_ext_sales_price#3, ss_net_profit#4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, s_store_sk#10] + +(18) Scan parquet default.item +Output [3]: [i_item_sk#13, i_class#14, i_category#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [i_item_sk#13, i_class#14, i_category#15] + +(20) Filter [codegen id : 3] +Input [3]: [i_item_sk#13, i_class#14, i_category#15] +Condition : isnotnull(i_item_sk#13) + +(21) BroadcastExchange +Input [3]: [i_item_sk#13, i_class#14, i_category#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(23) Project [codegen id : 4] +Output [4]: [ss_ext_sales_price#3, ss_net_profit#4, i_category#15, i_class#14] +Input [6]: [ss_item_sk#1, ss_ext_sales_price#3, ss_net_profit#4, i_item_sk#13, i_class#14, i_category#15] + +(24) Expand [codegen id : 4] +Input [4]: [ss_ext_sales_price#3, ss_net_profit#4, i_category#15, i_class#14] +Arguments: [List(ss_ext_sales_price#3, ss_net_profit#4, i_category#15, i_class#14, 0), List(ss_ext_sales_price#3, ss_net_profit#4, i_category#15, null, 1), List(ss_ext_sales_price#3, ss_net_profit#4, null, null, 3)], [ss_ext_sales_price#3, ss_net_profit#4, i_category#17, i_class#18, spark_grouping_id#19] + +(25) HashAggregate [codegen id : 4] +Input [5]: [ss_ext_sales_price#3, ss_net_profit#4, i_category#17, i_class#18, spark_grouping_id#19] +Keys [3]: [i_category#17, i_class#18, spark_grouping_id#19] +Functions [2]: [partial_sum(UnscaledValue(ss_net_profit#4)), partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [2]: [sum#20, sum#21] +Results [5]: [i_category#17, i_class#18, spark_grouping_id#19, sum#22, sum#23] + +(26) Exchange +Input [5]: [i_category#17, i_class#18, spark_grouping_id#19, sum#22, sum#23] +Arguments: hashpartitioning(i_category#17, i_class#18, spark_grouping_id#19, 5), ENSURE_REQUIREMENTS, [id=#24] + +(27) HashAggregate [codegen id : 5] +Input [5]: [i_category#17, i_class#18, spark_grouping_id#19, sum#22, sum#23] +Keys [3]: [i_category#17, i_class#18, spark_grouping_id#19] +Functions [2]: [sum(UnscaledValue(ss_net_profit#4)), sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#4))#25, sum(UnscaledValue(ss_ext_sales_price#3))#26] +Results [7]: [CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#4))#25,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#26,17,2))), DecimalType(37,20), true) AS gross_margin#27, i_category#17, i_class#18, (cast((shiftright(spark_grouping_id#19, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#19, 0) & 1) as tinyint)) AS lochierarchy#28, (cast((shiftright(spark_grouping_id#19, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#19, 0) & 1) as tinyint)) AS _w1#29, CASE WHEN (cast((shiftright(spark_grouping_id#19, 0) & 1) as tinyint) = 0) THEN i_category#17 END AS _w2#30, CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#4))#25,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#26,17,2))), DecimalType(37,20), true) AS _w3#31] + +(28) Exchange +Input [7]: [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, _w1#29, _w2#30, _w3#31] +Arguments: hashpartitioning(_w1#29, _w2#30, 5), ENSURE_REQUIREMENTS, [id=#32] + +(29) Sort [codegen id : 6] +Input [7]: [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, _w1#29, _w2#30, _w3#31] +Arguments: [_w1#29 ASC NULLS FIRST, _w2#30 ASC NULLS FIRST, _w3#31 ASC NULLS FIRST], false, 0 + +(30) Window +Input [7]: [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, _w1#29, _w2#30, _w3#31] +Arguments: [rank(_w3#31) windowspecdefinition(_w1#29, _w2#30, _w3#31 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#33], [_w1#29, _w2#30], [_w3#31 ASC NULLS FIRST] + +(31) Project [codegen id : 7] +Output [5]: [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, rank_within_parent#33] +Input [8]: [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, _w1#29, _w2#30, _w3#31, rank_within_parent#33] + +(32) TakeOrderedAndProject +Input [5]: [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, rank_within_parent#33] +Arguments: 100, [lochierarchy#28 DESC NULLS LAST, CASE WHEN (lochierarchy#28 = 0) THEN i_category#17 END ASC NULLS FIRST, rank_within_parent#33 ASC NULLS FIRST], [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, rank_within_parent#33] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/simplified.txt new file mode 100644 index 0000000000000..00f3d7ab6d192 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36.sf100/simplified.txt @@ -0,0 +1,51 @@ +TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i_class] + WholeStageCodegen (7) + Project [gross_margin,i_category,i_class,lochierarchy,rank_within_parent] + InputAdapter + Window [_w3,_w1,_w2] + WholeStageCodegen (6) + Sort [_w1,_w2,_w3] + InputAdapter + Exchange [_w1,_w2] #1 + WholeStageCodegen (5) + HashAggregate [i_category,i_class,spark_grouping_id,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(ss_ext_sales_price)),gross_margin,lochierarchy,_w1,_w2,_w3,sum,sum] + InputAdapter + Exchange [i_category,i_class,spark_grouping_id] #2 + WholeStageCodegen (4) + HashAggregate [i_category,i_class,spark_grouping_id,ss_net_profit,ss_ext_sales_price] [sum,sum,sum,sum] + Expand [ss_ext_sales_price,ss_net_profit,i_category,i_class] + Project [ss_ext_sales_price,ss_net_profit,i_category,i_class] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price,ss_net_profit] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36/explain.txt new file mode 100644 index 0000000000000..4300159e93dc5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * Project (31) + +- Window (30) + +- * Sort (29) + +- Exchange (28) + +- * HashAggregate (27) + +- Exchange (26) + +- * HashAggregate (25) + +- * Expand (24) + +- * Project (23) + +- * BroadcastHashJoin Inner BuildRight (22) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.item (11) + +- BroadcastExchange (21) + +- * Project (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.store (17) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5] +Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_store_sk#2)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_year#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#7, d_year#8] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#7, d_year#8] +Condition : ((isnotnull(d_year#8) AND (d_year#8 = 2001)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [2]: [d_date_sk#7, d_year#8] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4] +Input [6]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.item +Output [3]: [i_item_sk#10, i_class#11, i_category#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [i_item_sk#10, i_class#11, i_category#12] + +(13) Filter [codegen id : 2] +Input [3]: [i_item_sk#10, i_class#11, i_category#12] +Condition : isnotnull(i_item_sk#10) + +(14) BroadcastExchange +Input [3]: [i_item_sk#10, i_class#11, i_category#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#10] +Join condition: None + +(16) Project [codegen id : 4] +Output [5]: [ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, i_class#11, i_category#12] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, i_item_sk#10, i_class#11, i_category#12] + +(17) Scan parquet default.store +Output [2]: [s_store_sk#14, s_state#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#14, s_state#15] + +(19) Filter [codegen id : 3] +Input [2]: [s_store_sk#14, s_state#15] +Condition : ((isnotnull(s_state#15) AND (s_state#15 = TN)) AND isnotnull(s_store_sk#14)) + +(20) Project [codegen id : 3] +Output [1]: [s_store_sk#14] +Input [2]: [s_store_sk#14, s_state#15] + +(21) BroadcastExchange +Input [1]: [s_store_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#14] +Join condition: None + +(23) Project [codegen id : 4] +Output [4]: [ss_ext_sales_price#3, ss_net_profit#4, i_category#12, i_class#11] +Input [6]: [ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, i_class#11, i_category#12, s_store_sk#14] + +(24) Expand [codegen id : 4] +Input [4]: [ss_ext_sales_price#3, ss_net_profit#4, i_category#12, i_class#11] +Arguments: [List(ss_ext_sales_price#3, ss_net_profit#4, i_category#12, i_class#11, 0), List(ss_ext_sales_price#3, ss_net_profit#4, i_category#12, null, 1), List(ss_ext_sales_price#3, ss_net_profit#4, null, null, 3)], [ss_ext_sales_price#3, ss_net_profit#4, i_category#17, i_class#18, spark_grouping_id#19] + +(25) HashAggregate [codegen id : 4] +Input [5]: [ss_ext_sales_price#3, ss_net_profit#4, i_category#17, i_class#18, spark_grouping_id#19] +Keys [3]: [i_category#17, i_class#18, spark_grouping_id#19] +Functions [2]: [partial_sum(UnscaledValue(ss_net_profit#4)), partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [2]: [sum#20, sum#21] +Results [5]: [i_category#17, i_class#18, spark_grouping_id#19, sum#22, sum#23] + +(26) Exchange +Input [5]: [i_category#17, i_class#18, spark_grouping_id#19, sum#22, sum#23] +Arguments: hashpartitioning(i_category#17, i_class#18, spark_grouping_id#19, 5), ENSURE_REQUIREMENTS, [id=#24] + +(27) HashAggregate [codegen id : 5] +Input [5]: [i_category#17, i_class#18, spark_grouping_id#19, sum#22, sum#23] +Keys [3]: [i_category#17, i_class#18, spark_grouping_id#19] +Functions [2]: [sum(UnscaledValue(ss_net_profit#4)), sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#4))#25, sum(UnscaledValue(ss_ext_sales_price#3))#26] +Results [7]: [CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#4))#25,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#26,17,2))), DecimalType(37,20), true) AS gross_margin#27, i_category#17, i_class#18, (cast((shiftright(spark_grouping_id#19, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#19, 0) & 1) as tinyint)) AS lochierarchy#28, (cast((shiftright(spark_grouping_id#19, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#19, 0) & 1) as tinyint)) AS _w1#29, CASE WHEN (cast((shiftright(spark_grouping_id#19, 0) & 1) as tinyint) = 0) THEN i_category#17 END AS _w2#30, CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#4))#25,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#26,17,2))), DecimalType(37,20), true) AS _w3#31] + +(28) Exchange +Input [7]: [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, _w1#29, _w2#30, _w3#31] +Arguments: hashpartitioning(_w1#29, _w2#30, 5), ENSURE_REQUIREMENTS, [id=#32] + +(29) Sort [codegen id : 6] +Input [7]: [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, _w1#29, _w2#30, _w3#31] +Arguments: [_w1#29 ASC NULLS FIRST, _w2#30 ASC NULLS FIRST, _w3#31 ASC NULLS FIRST], false, 0 + +(30) Window +Input [7]: [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, _w1#29, _w2#30, _w3#31] +Arguments: [rank(_w3#31) windowspecdefinition(_w1#29, _w2#30, _w3#31 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#33], [_w1#29, _w2#30], [_w3#31 ASC NULLS FIRST] + +(31) Project [codegen id : 7] +Output [5]: [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, rank_within_parent#33] +Input [8]: [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, _w1#29, _w2#30, _w3#31, rank_within_parent#33] + +(32) TakeOrderedAndProject +Input [5]: [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, rank_within_parent#33] +Arguments: 100, [lochierarchy#28 DESC NULLS LAST, CASE WHEN (lochierarchy#28 = 0) THEN i_category#17 END ASC NULLS FIRST, rank_within_parent#33 ASC NULLS FIRST], [gross_margin#27, i_category#17, i_class#18, lochierarchy#28, rank_within_parent#33] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36/simplified.txt new file mode 100644 index 0000000000000..6e330ea7cff62 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q36/simplified.txt @@ -0,0 +1,51 @@ +TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i_class] + WholeStageCodegen (7) + Project [gross_margin,i_category,i_class,lochierarchy,rank_within_parent] + InputAdapter + Window [_w3,_w1,_w2] + WholeStageCodegen (6) + Sort [_w1,_w2,_w3] + InputAdapter + Exchange [_w1,_w2] #1 + WholeStageCodegen (5) + HashAggregate [i_category,i_class,spark_grouping_id,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(ss_ext_sales_price)),gross_margin,lochierarchy,_w1,_w2,_w3,sum,sum] + InputAdapter + Exchange [i_category,i_class,spark_grouping_id] #2 + WholeStageCodegen (4) + HashAggregate [i_category,i_class,spark_grouping_id,ss_net_profit,ss_ext_sales_price] [sum,sum,sum,sum] + Expand [ss_ext_sales_price,ss_net_profit,i_category,i_class] + Project [ss_ext_sales_price,ss_net_profit,i_category,i_class] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_ext_sales_price,ss_net_profit,i_class,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_class,i_category] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/explain.txt new file mode 100644 index 0000000000000..1f2c169ba0921 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * HashAggregate (31) + +- Exchange (30) + +- * HashAggregate (29) + +- * Project (28) + +- * SortMergeJoin Inner (27) + :- * Sort (20) + : +- Exchange (19) + : +- * Project (18) + : +- * BroadcastHashJoin Inner BuildRight (17) + : :- * Project (11) + : : +- * BroadcastHashJoin Inner BuildLeft (10) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Project (9) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.inventory (6) + : +- BroadcastExchange (16) + : +- * Project (15) + : +- * Filter (14) + : +- * ColumnarToRow (13) + : +- Scan parquet default.date_dim (12) + +- * Sort (26) + +- Exchange (25) + +- * Project (24) + +- * Filter (23) + +- * ColumnarToRow (22) + +- Scan parquet default.catalog_sales (21) + + +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,68.00), LessThanOrEqual(i_current_price,98.00), In(i_manufact_id, [677,940,694,808]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] + +(3) Filter [codegen id : 1] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +Condition : ((((isnotnull(i_current_price#4) AND (i_current_price#4 >= 68.00)) AND (i_current_price#4 <= 98.00)) AND i_manufact_id#5 IN (677,940,694,808)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] + +(5) BroadcastExchange +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] + +(6) Scan parquet default.inventory +Output [3]: [inv_item_sk#7, inv_quantity_on_hand#8, inv_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#9), dynamicpruningexpression(inv_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [3]: [inv_item_sk#7, inv_quantity_on_hand#8, inv_date_sk#9] + +(8) Filter +Input [3]: [inv_item_sk#7, inv_quantity_on_hand#8, inv_date_sk#9] +Condition : (((isnotnull(inv_quantity_on_hand#8) AND (inv_quantity_on_hand#8 >= 100)) AND (inv_quantity_on_hand#8 <= 500)) AND isnotnull(inv_item_sk#7)) + +(9) Project +Output [2]: [inv_item_sk#7, inv_date_sk#9] +Input [3]: [inv_item_sk#7, inv_quantity_on_hand#8, inv_date_sk#9] + +(10) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [inv_item_sk#7] +Join condition: None + +(11) Project [codegen id : 3] +Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#9] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_item_sk#7, inv_date_sk#9] + +(12) Scan parquet default.date_dim +Output [2]: [d_date_sk#11, d_date#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-02-01), LessThanOrEqual(d_date,2000-04-01), IsNotNull(d_date_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#11, d_date#12] + +(14) Filter [codegen id : 2] +Input [2]: [d_date_sk#11, d_date#12] +Condition : (((isnotnull(d_date#12) AND (d_date#12 >= 2000-02-01)) AND (d_date#12 <= 2000-04-01)) AND isnotnull(d_date_sk#11)) + +(15) Project [codegen id : 2] +Output [1]: [d_date_sk#11] +Input [2]: [d_date_sk#11, d_date#12] + +(16) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(17) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_date_sk#9] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(18) Project [codegen id : 3] +Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#9, d_date_sk#11] + +(19) Exchange +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: hashpartitioning(i_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#14] + +(20) Sort [codegen id : 4] +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 + +(21) Scan parquet default.catalog_sales +Output [2]: [cs_item_sk#15, cs_sold_date_sk#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 5] +Input [2]: [cs_item_sk#15, cs_sold_date_sk#16] + +(23) Filter [codegen id : 5] +Input [2]: [cs_item_sk#15, cs_sold_date_sk#16] +Condition : isnotnull(cs_item_sk#15) + +(24) Project [codegen id : 5] +Output [1]: [cs_item_sk#15] +Input [2]: [cs_item_sk#15, cs_sold_date_sk#16] + +(25) Exchange +Input [1]: [cs_item_sk#15] +Arguments: hashpartitioning(cs_item_sk#15, 5), ENSURE_REQUIREMENTS, [id=#17] + +(26) Sort [codegen id : 6] +Input [1]: [cs_item_sk#15] +Arguments: [cs_item_sk#15 ASC NULLS FIRST], false, 0 + +(27) SortMergeJoin [codegen id : 7] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [cs_item_sk#15] +Join condition: None + +(28) Project [codegen id : 7] +Output [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, cs_item_sk#15] + +(29) HashAggregate [codegen id : 7] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Functions: [] +Aggregate Attributes: [] +Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] + +(30) Exchange +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_current_price#4, 5), ENSURE_REQUIREMENTS, [id=#18] + +(31) HashAggregate [codegen id : 8] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Functions: [] +Aggregate Attributes: [] +Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] + +(32) TakeOrderedAndProject +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: 100, [i_item_id#2 ASC NULLS FIRST], [i_item_id#2, i_item_desc#3, i_current_price#4] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = inv_date_sk#9 IN dynamicpruning#10 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/simplified.txt new file mode 100644 index 0000000000000..6ef4ec510e986 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37.sf100/simplified.txt @@ -0,0 +1,53 @@ +TakeOrderedAndProject [i_item_id,i_item_desc,i_current_price] + WholeStageCodegen (8) + HashAggregate [i_item_id,i_item_desc,i_current_price] + InputAdapter + Exchange [i_item_id,i_item_desc,i_current_price] #1 + WholeStageCodegen (7) + HashAggregate [i_item_id,i_item_desc,i_current_price] + Project [i_item_id,i_item_desc,i_current_price] + SortMergeJoin [i_item_sk,cs_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #2 + WholeStageCodegen (3) + Project [i_item_sk,i_item_id,i_item_desc,i_current_price] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [i_item_sk,i_item_id,i_item_desc,i_current_price,inv_date_sk] + BroadcastHashJoin [i_item_sk,inv_item_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_item_id,i_item_desc,i_current_price] + Filter [i_current_price,i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_manufact_id] + Project [inv_item_sk,inv_date_sk] + Filter [inv_quantity_on_hand,inv_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + WholeStageCodegen (6) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #5 + WholeStageCodegen (5) + Project [cs_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37/explain.txt new file mode 100644 index 0000000000000..9cc89345f5a1c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37/explain.txt @@ -0,0 +1,176 @@ +== Physical Plan == +TakeOrderedAndProject (29) ++- * HashAggregate (28) + +- Exchange (27) + +- * HashAggregate (26) + +- * Project (25) + +- * BroadcastHashJoin Inner BuildLeft (24) + :- BroadcastExchange (19) + : +- * Project (18) + : +- * BroadcastHashJoin Inner BuildRight (17) + : :- * Project (11) + : : +- * BroadcastHashJoin Inner BuildRight (10) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- BroadcastExchange (9) + : : +- * Project (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.inventory (5) + : +- BroadcastExchange (16) + : +- * Project (15) + : +- * Filter (14) + : +- * ColumnarToRow (13) + : +- Scan parquet default.date_dim (12) + +- * Project (23) + +- * Filter (22) + +- * ColumnarToRow (21) + +- Scan parquet default.catalog_sales (20) + + +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,68.00), LessThanOrEqual(i_current_price,98.00), In(i_manufact_id, [677,940,694,808]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] + +(3) Filter [codegen id : 3] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +Condition : ((((isnotnull(i_current_price#4) AND (i_current_price#4 >= 68.00)) AND (i_current_price#4 <= 98.00)) AND i_manufact_id#5 IN (677,940,694,808)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 3] +Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] + +(5) Scan parquet default.inventory +Output [3]: [inv_item_sk#6, inv_quantity_on_hand#7, inv_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#8), dynamicpruningexpression(inv_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [inv_item_sk#6, inv_quantity_on_hand#7, inv_date_sk#8] + +(7) Filter [codegen id : 1] +Input [3]: [inv_item_sk#6, inv_quantity_on_hand#7, inv_date_sk#8] +Condition : (((isnotnull(inv_quantity_on_hand#7) AND (inv_quantity_on_hand#7 >= 100)) AND (inv_quantity_on_hand#7 <= 500)) AND isnotnull(inv_item_sk#6)) + +(8) Project [codegen id : 1] +Output [2]: [inv_item_sk#6, inv_date_sk#8] +Input [3]: [inv_item_sk#6, inv_quantity_on_hand#7, inv_date_sk#8] + +(9) BroadcastExchange +Input [2]: [inv_item_sk#6, inv_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(10) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [inv_item_sk#6] +Join condition: None + +(11) Project [codegen id : 3] +Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#8] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_item_sk#6, inv_date_sk#8] + +(12) Scan parquet default.date_dim +Output [2]: [d_date_sk#11, d_date#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-02-01), LessThanOrEqual(d_date,2000-04-01), IsNotNull(d_date_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#11, d_date#12] + +(14) Filter [codegen id : 2] +Input [2]: [d_date_sk#11, d_date#12] +Condition : (((isnotnull(d_date#12) AND (d_date#12 >= 2000-02-01)) AND (d_date#12 <= 2000-04-01)) AND isnotnull(d_date_sk#11)) + +(15) Project [codegen id : 2] +Output [1]: [d_date_sk#11] +Input [2]: [d_date_sk#11, d_date#12] + +(16) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(17) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_date_sk#8] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(18) Project [codegen id : 3] +Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#8, d_date_sk#11] + +(19) BroadcastExchange +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(20) Scan parquet default.catalog_sales +Output [2]: [cs_item_sk#15, cs_sold_date_sk#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(21) ColumnarToRow +Input [2]: [cs_item_sk#15, cs_sold_date_sk#16] + +(22) Filter +Input [2]: [cs_item_sk#15, cs_sold_date_sk#16] +Condition : isnotnull(cs_item_sk#15) + +(23) Project +Output [1]: [cs_item_sk#15] +Input [2]: [cs_item_sk#15, cs_sold_date_sk#16] + +(24) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [cs_item_sk#15] +Join condition: None + +(25) Project [codegen id : 4] +Output [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, cs_item_sk#15] + +(26) HashAggregate [codegen id : 4] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Functions: [] +Aggregate Attributes: [] +Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] + +(27) Exchange +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_current_price#4, 5), ENSURE_REQUIREMENTS, [id=#17] + +(28) HashAggregate [codegen id : 5] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Functions: [] +Aggregate Attributes: [] +Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] + +(29) TakeOrderedAndProject +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: 100, [i_item_id#2 ASC NULLS FIRST], [i_item_id#2, i_item_desc#3, i_current_price#4] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 5 Hosting Expression = inv_date_sk#8 IN dynamicpruning#9 +ReusedExchange (30) + + +(30) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37/simplified.txt new file mode 100644 index 0000000000000..49ec7264dc423 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q37/simplified.txt @@ -0,0 +1,44 @@ +TakeOrderedAndProject [i_item_id,i_item_desc,i_current_price] + WholeStageCodegen (5) + HashAggregate [i_item_id,i_item_desc,i_current_price] + InputAdapter + Exchange [i_item_id,i_item_desc,i_current_price] #1 + WholeStageCodegen (4) + HashAggregate [i_item_id,i_item_desc,i_current_price] + Project [i_item_id,i_item_desc,i_current_price] + BroadcastHashJoin [i_item_sk,cs_item_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [i_item_sk,i_item_id,i_item_desc,i_current_price] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [i_item_sk,i_item_id,i_item_desc,i_current_price,inv_date_sk] + BroadcastHashJoin [i_item_sk,inv_item_sk] + Project [i_item_sk,i_item_id,i_item_desc,i_current_price] + Filter [i_current_price,i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_manufact_id] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [inv_item_sk,inv_date_sk] + Filter [inv_quantity_on_hand,inv_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + Project [cs_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/explain.txt new file mode 100644 index 0000000000000..48edbc42d0ffb --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/explain.txt @@ -0,0 +1,425 @@ +== Physical Plan == +* HashAggregate (71) ++- Exchange (70) + +- * HashAggregate (69) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- * SortMergeJoin LeftSemi (65) + :- * Sort (47) + : +- Exchange (46) + : +- * HashAggregate (45) + : +- Exchange (44) + : +- * HashAggregate (43) + : +- * SortMergeJoin LeftSemi (42) + : :- * Sort (24) + : : +- Exchange (23) + : : +- * HashAggregate (22) + : : +- Exchange (21) + : : +- * HashAggregate (20) + : : +- * Project (19) + : : +- * SortMergeJoin Inner (18) + : : :- * Sort (12) + : : : +- Exchange (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- * Sort (17) + : : +- Exchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.customer (13) + : +- * Sort (41) + : +- Exchange (40) + : +- * HashAggregate (39) + : +- Exchange (38) + : +- * HashAggregate (37) + : +- * Project (36) + : +- * SortMergeJoin Inner (35) + : :- * Sort (32) + : : +- Exchange (31) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.catalog_sales (25) + : : +- ReusedExchange (28) + : +- * Sort (34) + : +- ReusedExchange (33) + +- * Sort (64) + +- Exchange (63) + +- * HashAggregate (62) + +- Exchange (61) + +- * HashAggregate (60) + +- * Project (59) + +- * SortMergeJoin Inner (58) + :- * Sort (55) + : +- Exchange (54) + : +- * Project (53) + : +- * BroadcastHashJoin Inner BuildRight (52) + : :- * Filter (50) + : : +- * ColumnarToRow (49) + : : +- Scan parquet default.web_sales (48) + : +- ReusedExchange (51) + +- * Sort (57) + +- ReusedExchange (56) + + +(1) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#1, ss_sold_date_sk#2] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#2), dynamicpruningexpression(ss_sold_date_sk#2 IN dynamicpruning#3)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [2]: [ss_customer_sk#1, ss_sold_date_sk#2] + +(3) Filter [codegen id : 2] +Input [2]: [ss_customer_sk#1, ss_sold_date_sk#2] +Condition : isnotnull(ss_customer_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_date#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_date#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_date#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#4)) + +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#4, d_date#5] +Input [3]: [d_date_sk#4, d_date#5, d_month_seq#6] + +(8) BroadcastExchange +Input [2]: [d_date_sk#4, d_date#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#2] +Right keys [1]: [d_date_sk#4] +Join condition: None + +(10) Project [codegen id : 2] +Output [2]: [ss_customer_sk#1, d_date#5] +Input [4]: [ss_customer_sk#1, ss_sold_date_sk#2, d_date_sk#4, d_date#5] + +(11) Exchange +Input [2]: [ss_customer_sk#1, d_date#5] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#8] + +(12) Sort [codegen id : 3] +Input [2]: [ss_customer_sk#1, d_date#5] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.customer +Output [3]: [c_customer_sk#9, c_first_name#10, c_last_name#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 4] +Input [3]: [c_customer_sk#9, c_first_name#10, c_last_name#11] + +(15) Filter [codegen id : 4] +Input [3]: [c_customer_sk#9, c_first_name#10, c_last_name#11] +Condition : isnotnull(c_customer_sk#9) + +(16) Exchange +Input [3]: [c_customer_sk#9, c_first_name#10, c_last_name#11] +Arguments: hashpartitioning(c_customer_sk#9, 5), ENSURE_REQUIREMENTS, [id=#12] + +(17) Sort [codegen id : 5] +Input [3]: [c_customer_sk#9, c_first_name#10, c_last_name#11] +Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 + +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#9] +Join condition: None + +(19) Project [codegen id : 6] +Output [3]: [c_last_name#11, c_first_name#10, d_date#5] +Input [5]: [ss_customer_sk#1, d_date#5, c_customer_sk#9, c_first_name#10, c_last_name#11] + +(20) HashAggregate [codegen id : 6] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Keys [3]: [c_last_name#11, c_first_name#10, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#11, c_first_name#10, d_date#5] + +(21) Exchange +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: hashpartitioning(c_last_name#11, c_first_name#10, d_date#5, 5), ENSURE_REQUIREMENTS, [id=#13] + +(22) HashAggregate [codegen id : 7] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Keys [3]: [c_last_name#11, c_first_name#10, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#11, c_first_name#10, d_date#5] + +(23) Exchange +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: hashpartitioning(coalesce(c_last_name#11, ), isnull(c_last_name#11), coalesce(c_first_name#10, ), isnull(c_first_name#10), coalesce(d_date#5, 1970-01-01), isnull(d_date#5), 5), ENSURE_REQUIREMENTS, [id=#14] + +(24) Sort [codegen id : 8] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: [coalesce(c_last_name#11, ) ASC NULLS FIRST, isnull(c_last_name#11) ASC NULLS FIRST, coalesce(c_first_name#10, ) ASC NULLS FIRST, isnull(c_first_name#10) ASC NULLS FIRST, coalesce(d_date#5, 1970-01-01) ASC NULLS FIRST, isnull(d_date#5) ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.catalog_sales +Output [2]: [cs_bill_customer_sk#15, cs_sold_date_sk#16] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#16), dynamicpruningexpression(cs_sold_date_sk#16 IN dynamicpruning#3)] +PushedFilters: [IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 10] +Input [2]: [cs_bill_customer_sk#15, cs_sold_date_sk#16] + +(27) Filter [codegen id : 10] +Input [2]: [cs_bill_customer_sk#15, cs_sold_date_sk#16] +Condition : isnotnull(cs_bill_customer_sk#15) + +(28) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#17, d_date#18] + +(29) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#16] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(30) Project [codegen id : 10] +Output [2]: [cs_bill_customer_sk#15, d_date#18] +Input [4]: [cs_bill_customer_sk#15, cs_sold_date_sk#16, d_date_sk#17, d_date#18] + +(31) Exchange +Input [2]: [cs_bill_customer_sk#15, d_date#18] +Arguments: hashpartitioning(cs_bill_customer_sk#15, 5), ENSURE_REQUIREMENTS, [id=#19] + +(32) Sort [codegen id : 11] +Input [2]: [cs_bill_customer_sk#15, d_date#18] +Arguments: [cs_bill_customer_sk#15 ASC NULLS FIRST], false, 0 + +(33) ReusedExchange [Reuses operator id: 16] +Output [3]: [c_customer_sk#20, c_first_name#21, c_last_name#22] + +(34) Sort [codegen id : 13] +Input [3]: [c_customer_sk#20, c_first_name#21, c_last_name#22] +Arguments: [c_customer_sk#20 ASC NULLS FIRST], false, 0 + +(35) SortMergeJoin [codegen id : 14] +Left keys [1]: [cs_bill_customer_sk#15] +Right keys [1]: [c_customer_sk#20] +Join condition: None + +(36) Project [codegen id : 14] +Output [3]: [c_last_name#22, c_first_name#21, d_date#18] +Input [5]: [cs_bill_customer_sk#15, d_date#18, c_customer_sk#20, c_first_name#21, c_last_name#22] + +(37) HashAggregate [codegen id : 14] +Input [3]: [c_last_name#22, c_first_name#21, d_date#18] +Keys [3]: [c_last_name#22, c_first_name#21, d_date#18] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#22, c_first_name#21, d_date#18] + +(38) Exchange +Input [3]: [c_last_name#22, c_first_name#21, d_date#18] +Arguments: hashpartitioning(c_last_name#22, c_first_name#21, d_date#18, 5), ENSURE_REQUIREMENTS, [id=#23] + +(39) HashAggregate [codegen id : 15] +Input [3]: [c_last_name#22, c_first_name#21, d_date#18] +Keys [3]: [c_last_name#22, c_first_name#21, d_date#18] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#22, c_first_name#21, d_date#18] + +(40) Exchange +Input [3]: [c_last_name#22, c_first_name#21, d_date#18] +Arguments: hashpartitioning(coalesce(c_last_name#22, ), isnull(c_last_name#22), coalesce(c_first_name#21, ), isnull(c_first_name#21), coalesce(d_date#18, 1970-01-01), isnull(d_date#18), 5), ENSURE_REQUIREMENTS, [id=#24] + +(41) Sort [codegen id : 16] +Input [3]: [c_last_name#22, c_first_name#21, d_date#18] +Arguments: [coalesce(c_last_name#22, ) ASC NULLS FIRST, isnull(c_last_name#22) ASC NULLS FIRST, coalesce(c_first_name#21, ) ASC NULLS FIRST, isnull(c_first_name#21) ASC NULLS FIRST, coalesce(d_date#18, 1970-01-01) ASC NULLS FIRST, isnull(d_date#18) ASC NULLS FIRST], false, 0 + +(42) SortMergeJoin [codegen id : 17] +Left keys [6]: [coalesce(c_last_name#11, ), isnull(c_last_name#11), coalesce(c_first_name#10, ), isnull(c_first_name#10), coalesce(d_date#5, 1970-01-01), isnull(d_date#5)] +Right keys [6]: [coalesce(c_last_name#22, ), isnull(c_last_name#22), coalesce(c_first_name#21, ), isnull(c_first_name#21), coalesce(d_date#18, 1970-01-01), isnull(d_date#18)] +Join condition: None + +(43) HashAggregate [codegen id : 17] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Keys [3]: [c_last_name#11, c_first_name#10, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#11, c_first_name#10, d_date#5] + +(44) Exchange +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: hashpartitioning(c_last_name#11, c_first_name#10, d_date#5, 5), ENSURE_REQUIREMENTS, [id=#25] + +(45) HashAggregate [codegen id : 18] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Keys [3]: [c_last_name#11, c_first_name#10, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#11, c_first_name#10, d_date#5] + +(46) Exchange +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: hashpartitioning(coalesce(c_last_name#11, ), isnull(c_last_name#11), coalesce(c_first_name#10, ), isnull(c_first_name#10), coalesce(d_date#5, 1970-01-01), isnull(d_date#5), 5), ENSURE_REQUIREMENTS, [id=#26] + +(47) Sort [codegen id : 19] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: [coalesce(c_last_name#11, ) ASC NULLS FIRST, isnull(c_last_name#11) ASC NULLS FIRST, coalesce(c_first_name#10, ) ASC NULLS FIRST, isnull(c_first_name#10) ASC NULLS FIRST, coalesce(d_date#5, 1970-01-01) ASC NULLS FIRST, isnull(d_date#5) ASC NULLS FIRST], false, 0 + +(48) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#27, ws_sold_date_sk#28] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#28), dynamicpruningexpression(ws_sold_date_sk#28 IN dynamicpruning#3)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 21] +Input [2]: [ws_bill_customer_sk#27, ws_sold_date_sk#28] + +(50) Filter [codegen id : 21] +Input [2]: [ws_bill_customer_sk#27, ws_sold_date_sk#28] +Condition : isnotnull(ws_bill_customer_sk#27) + +(51) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#29, d_date#30] + +(52) BroadcastHashJoin [codegen id : 21] +Left keys [1]: [ws_sold_date_sk#28] +Right keys [1]: [d_date_sk#29] +Join condition: None + +(53) Project [codegen id : 21] +Output [2]: [ws_bill_customer_sk#27, d_date#30] +Input [4]: [ws_bill_customer_sk#27, ws_sold_date_sk#28, d_date_sk#29, d_date#30] + +(54) Exchange +Input [2]: [ws_bill_customer_sk#27, d_date#30] +Arguments: hashpartitioning(ws_bill_customer_sk#27, 5), ENSURE_REQUIREMENTS, [id=#31] + +(55) Sort [codegen id : 22] +Input [2]: [ws_bill_customer_sk#27, d_date#30] +Arguments: [ws_bill_customer_sk#27 ASC NULLS FIRST], false, 0 + +(56) ReusedExchange [Reuses operator id: 16] +Output [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] + +(57) Sort [codegen id : 24] +Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] +Arguments: [c_customer_sk#32 ASC NULLS FIRST], false, 0 + +(58) SortMergeJoin [codegen id : 25] +Left keys [1]: [ws_bill_customer_sk#27] +Right keys [1]: [c_customer_sk#32] +Join condition: None + +(59) Project [codegen id : 25] +Output [3]: [c_last_name#34, c_first_name#33, d_date#30] +Input [5]: [ws_bill_customer_sk#27, d_date#30, c_customer_sk#32, c_first_name#33, c_last_name#34] + +(60) HashAggregate [codegen id : 25] +Input [3]: [c_last_name#34, c_first_name#33, d_date#30] +Keys [3]: [c_last_name#34, c_first_name#33, d_date#30] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#34, c_first_name#33, d_date#30] + +(61) Exchange +Input [3]: [c_last_name#34, c_first_name#33, d_date#30] +Arguments: hashpartitioning(c_last_name#34, c_first_name#33, d_date#30, 5), ENSURE_REQUIREMENTS, [id=#35] + +(62) HashAggregate [codegen id : 26] +Input [3]: [c_last_name#34, c_first_name#33, d_date#30] +Keys [3]: [c_last_name#34, c_first_name#33, d_date#30] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#34, c_first_name#33, d_date#30] + +(63) Exchange +Input [3]: [c_last_name#34, c_first_name#33, d_date#30] +Arguments: hashpartitioning(coalesce(c_last_name#34, ), isnull(c_last_name#34), coalesce(c_first_name#33, ), isnull(c_first_name#33), coalesce(d_date#30, 1970-01-01), isnull(d_date#30), 5), ENSURE_REQUIREMENTS, [id=#36] + +(64) Sort [codegen id : 27] +Input [3]: [c_last_name#34, c_first_name#33, d_date#30] +Arguments: [coalesce(c_last_name#34, ) ASC NULLS FIRST, isnull(c_last_name#34) ASC NULLS FIRST, coalesce(c_first_name#33, ) ASC NULLS FIRST, isnull(c_first_name#33) ASC NULLS FIRST, coalesce(d_date#30, 1970-01-01) ASC NULLS FIRST, isnull(d_date#30) ASC NULLS FIRST], false, 0 + +(65) SortMergeJoin [codegen id : 28] +Left keys [6]: [coalesce(c_last_name#11, ), isnull(c_last_name#11), coalesce(c_first_name#10, ), isnull(c_first_name#10), coalesce(d_date#5, 1970-01-01), isnull(d_date#5)] +Right keys [6]: [coalesce(c_last_name#34, ), isnull(c_last_name#34), coalesce(c_first_name#33, ), isnull(c_first_name#33), coalesce(d_date#30, 1970-01-01), isnull(d_date#30)] +Join condition: None + +(66) HashAggregate [codegen id : 28] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Keys [3]: [c_last_name#11, c_first_name#10, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#11, c_first_name#10, d_date#5] + +(67) Exchange +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: hashpartitioning(c_last_name#11, c_first_name#10, d_date#5, 5), ENSURE_REQUIREMENTS, [id=#37] + +(68) HashAggregate [codegen id : 29] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Keys [3]: [c_last_name#11, c_first_name#10, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results: [] + +(69) HashAggregate [codegen id : 29] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#38] +Results [1]: [count#39] + +(70) Exchange +Input [1]: [count#39] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#40] + +(71) HashAggregate [codegen id : 30] +Input [1]: [count#39] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#41] +Results [1]: [count(1)#41 AS count(1)#42] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#2 IN dynamicpruning#3 +ReusedExchange (72) + + +(72) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#4, d_date#5] + +Subquery:2 Hosting operator id = 25 Hosting Expression = cs_sold_date_sk#16 IN dynamicpruning#3 + +Subquery:3 Hosting operator id = 48 Hosting Expression = ws_sold_date_sk#28 IN dynamicpruning#3 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/simplified.txt new file mode 100644 index 0000000000000..421027136f3c0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38.sf100/simplified.txt @@ -0,0 +1,135 @@ +WholeStageCodegen (30) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #1 + WholeStageCodegen (29) + HashAggregate [count,count] + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #2 + WholeStageCodegen (28) + HashAggregate [c_last_name,c_first_name,d_date] + SortMergeJoin [c_last_name,c_first_name,d_date,c_last_name,c_first_name,d_date] + InputAdapter + WholeStageCodegen (19) + Sort [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #3 + WholeStageCodegen (18) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #4 + WholeStageCodegen (17) + HashAggregate [c_last_name,c_first_name,d_date] + SortMergeJoin [c_last_name,c_first_name,d_date,c_last_name,c_first_name,d_date] + InputAdapter + WholeStageCodegen (8) + Sort [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #5 + WholeStageCodegen (7) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #6 + WholeStageCodegen (6) + HashAggregate [c_last_name,c_first_name,d_date] + Project [c_last_name,c_first_name,d_date] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #7 + WholeStageCodegen (2) + Project [ss_customer_sk,d_date] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date] #8 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (1) + Project [d_date_sk,d_date] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_month_seq] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #9 + WholeStageCodegen (4) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name] + InputAdapter + WholeStageCodegen (16) + Sort [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #10 + WholeStageCodegen (15) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #11 + WholeStageCodegen (14) + HashAggregate [c_last_name,c_first_name,d_date] + Project [c_last_name,c_first_name,d_date] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (11) + Sort [cs_bill_customer_sk] + InputAdapter + Exchange [cs_bill_customer_sk] #12 + WholeStageCodegen (10) + Project [cs_bill_customer_sk,d_date] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_date] #8 + InputAdapter + WholeStageCodegen (13) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_first_name,c_last_name] #9 + InputAdapter + WholeStageCodegen (27) + Sort [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #13 + WholeStageCodegen (26) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #14 + WholeStageCodegen (25) + HashAggregate [c_last_name,c_first_name,d_date] + Project [c_last_name,c_first_name,d_date] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (22) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #15 + WholeStageCodegen (21) + Project [ws_bill_customer_sk,d_date] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_date] #8 + InputAdapter + WholeStageCodegen (24) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_first_name,c_last_name] #9 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38/explain.txt new file mode 100644 index 0000000000000..c4e679eb902e0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38/explain.txt @@ -0,0 +1,340 @@ +== Physical Plan == +* HashAggregate (54) ++- Exchange (53) + +- * HashAggregate (52) + +- * HashAggregate (51) + +- * HashAggregate (50) + +- * BroadcastHashJoin LeftSemi BuildRight (49) + :- * HashAggregate (35) + : +- * HashAggregate (34) + : +- * BroadcastHashJoin LeftSemi BuildRight (33) + : :- * HashAggregate (19) + : : +- Exchange (18) + : : +- * HashAggregate (17) + : : +- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.customer (11) + : +- BroadcastExchange (32) + : +- * HashAggregate (31) + : +- Exchange (30) + : +- * HashAggregate (29) + : +- * Project (28) + : +- * BroadcastHashJoin Inner BuildRight (27) + : :- * Project (25) + : : +- * BroadcastHashJoin Inner BuildRight (24) + : : :- * Filter (22) + : : : +- * ColumnarToRow (21) + : : : +- Scan parquet default.catalog_sales (20) + : : +- ReusedExchange (23) + : +- ReusedExchange (26) + +- BroadcastExchange (48) + +- * HashAggregate (47) + +- Exchange (46) + +- * HashAggregate (45) + +- * Project (44) + +- * BroadcastHashJoin Inner BuildRight (43) + :- * Project (41) + : +- * BroadcastHashJoin Inner BuildRight (40) + : :- * Filter (38) + : : +- * ColumnarToRow (37) + : : +- Scan parquet default.web_sales (36) + : +- ReusedExchange (39) + +- ReusedExchange (42) + + +(1) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#1, ss_sold_date_sk#2] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#2), dynamicpruningexpression(ss_sold_date_sk#2 IN dynamicpruning#3)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [2]: [ss_customer_sk#1, ss_sold_date_sk#2] + +(3) Filter [codegen id : 3] +Input [2]: [ss_customer_sk#1, ss_sold_date_sk#2] +Condition : isnotnull(ss_customer_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_date#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_date#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_date#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#4)) + +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#4, d_date#5] +Input [3]: [d_date_sk#4, d_date#5, d_month_seq#6] + +(8) BroadcastExchange +Input [2]: [d_date_sk#4, d_date#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#2] +Right keys [1]: [d_date_sk#4] +Join condition: None + +(10) Project [codegen id : 3] +Output [2]: [ss_customer_sk#1, d_date#5] +Input [4]: [ss_customer_sk#1, ss_sold_date_sk#2, d_date_sk#4, d_date#5] + +(11) Scan parquet default.customer +Output [3]: [c_customer_sk#8, c_first_name#9, c_last_name#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [c_customer_sk#8, c_first_name#9, c_last_name#10] + +(13) Filter [codegen id : 2] +Input [3]: [c_customer_sk#8, c_first_name#9, c_last_name#10] +Condition : isnotnull(c_customer_sk#8) + +(14) BroadcastExchange +Input [3]: [c_customer_sk#8, c_first_name#9, c_last_name#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#8] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [c_last_name#10, c_first_name#9, d_date#5] +Input [5]: [ss_customer_sk#1, d_date#5, c_customer_sk#8, c_first_name#9, c_last_name#10] + +(17) HashAggregate [codegen id : 3] +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Keys [3]: [c_last_name#10, c_first_name#9, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#10, c_first_name#9, d_date#5] + +(18) Exchange +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Arguments: hashpartitioning(c_last_name#10, c_first_name#9, d_date#5, 5), ENSURE_REQUIREMENTS, [id=#12] + +(19) HashAggregate [codegen id : 12] +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Keys [3]: [c_last_name#10, c_first_name#9, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#10, c_first_name#9, d_date#5] + +(20) Scan parquet default.catalog_sales +Output [2]: [cs_bill_customer_sk#13, cs_sold_date_sk#14] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#14), dynamicpruningexpression(cs_sold_date_sk#14 IN dynamicpruning#3)] +PushedFilters: [IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [2]: [cs_bill_customer_sk#13, cs_sold_date_sk#14] + +(22) Filter [codegen id : 6] +Input [2]: [cs_bill_customer_sk#13, cs_sold_date_sk#14] +Condition : isnotnull(cs_bill_customer_sk#13) + +(23) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#15, d_date#16] + +(24) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#14] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(25) Project [codegen id : 6] +Output [2]: [cs_bill_customer_sk#13, d_date#16] +Input [4]: [cs_bill_customer_sk#13, cs_sold_date_sk#14, d_date_sk#15, d_date#16] + +(26) ReusedExchange [Reuses operator id: 14] +Output [3]: [c_customer_sk#17, c_first_name#18, c_last_name#19] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_bill_customer_sk#13] +Right keys [1]: [c_customer_sk#17] +Join condition: None + +(28) Project [codegen id : 6] +Output [3]: [c_last_name#19, c_first_name#18, d_date#16] +Input [5]: [cs_bill_customer_sk#13, d_date#16, c_customer_sk#17, c_first_name#18, c_last_name#19] + +(29) HashAggregate [codegen id : 6] +Input [3]: [c_last_name#19, c_first_name#18, d_date#16] +Keys [3]: [c_last_name#19, c_first_name#18, d_date#16] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#19, c_first_name#18, d_date#16] + +(30) Exchange +Input [3]: [c_last_name#19, c_first_name#18, d_date#16] +Arguments: hashpartitioning(c_last_name#19, c_first_name#18, d_date#16, 5), ENSURE_REQUIREMENTS, [id=#20] + +(31) HashAggregate [codegen id : 7] +Input [3]: [c_last_name#19, c_first_name#18, d_date#16] +Keys [3]: [c_last_name#19, c_first_name#18, d_date#16] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#19, c_first_name#18, d_date#16] + +(32) BroadcastExchange +Input [3]: [c_last_name#19, c_first_name#18, d_date#16] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, string, true], ), isnull(input[0, string, true]), coalesce(input[1, string, true], ), isnull(input[1, string, true]), coalesce(input[2, date, true], 1970-01-01), isnull(input[2, date, true])),false), [id=#21] + +(33) BroadcastHashJoin [codegen id : 12] +Left keys [6]: [coalesce(c_last_name#10, ), isnull(c_last_name#10), coalesce(c_first_name#9, ), isnull(c_first_name#9), coalesce(d_date#5, 1970-01-01), isnull(d_date#5)] +Right keys [6]: [coalesce(c_last_name#19, ), isnull(c_last_name#19), coalesce(c_first_name#18, ), isnull(c_first_name#18), coalesce(d_date#16, 1970-01-01), isnull(d_date#16)] +Join condition: None + +(34) HashAggregate [codegen id : 12] +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Keys [3]: [c_last_name#10, c_first_name#9, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#10, c_first_name#9, d_date#5] + +(35) HashAggregate [codegen id : 12] +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Keys [3]: [c_last_name#10, c_first_name#9, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#10, c_first_name#9, d_date#5] + +(36) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#22, ws_sold_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#23), dynamicpruningexpression(ws_sold_date_sk#23 IN dynamicpruning#3)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 10] +Input [2]: [ws_bill_customer_sk#22, ws_sold_date_sk#23] + +(38) Filter [codegen id : 10] +Input [2]: [ws_bill_customer_sk#22, ws_sold_date_sk#23] +Condition : isnotnull(ws_bill_customer_sk#22) + +(39) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#24, d_date#25] + +(40) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#23] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(41) Project [codegen id : 10] +Output [2]: [ws_bill_customer_sk#22, d_date#25] +Input [4]: [ws_bill_customer_sk#22, ws_sold_date_sk#23, d_date_sk#24, d_date#25] + +(42) ReusedExchange [Reuses operator id: 14] +Output [3]: [c_customer_sk#26, c_first_name#27, c_last_name#28] + +(43) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_bill_customer_sk#22] +Right keys [1]: [c_customer_sk#26] +Join condition: None + +(44) Project [codegen id : 10] +Output [3]: [c_last_name#28, c_first_name#27, d_date#25] +Input [5]: [ws_bill_customer_sk#22, d_date#25, c_customer_sk#26, c_first_name#27, c_last_name#28] + +(45) HashAggregate [codegen id : 10] +Input [3]: [c_last_name#28, c_first_name#27, d_date#25] +Keys [3]: [c_last_name#28, c_first_name#27, d_date#25] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#28, c_first_name#27, d_date#25] + +(46) Exchange +Input [3]: [c_last_name#28, c_first_name#27, d_date#25] +Arguments: hashpartitioning(c_last_name#28, c_first_name#27, d_date#25, 5), ENSURE_REQUIREMENTS, [id=#29] + +(47) HashAggregate [codegen id : 11] +Input [3]: [c_last_name#28, c_first_name#27, d_date#25] +Keys [3]: [c_last_name#28, c_first_name#27, d_date#25] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#28, c_first_name#27, d_date#25] + +(48) BroadcastExchange +Input [3]: [c_last_name#28, c_first_name#27, d_date#25] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, string, true], ), isnull(input[0, string, true]), coalesce(input[1, string, true], ), isnull(input[1, string, true]), coalesce(input[2, date, true], 1970-01-01), isnull(input[2, date, true])),false), [id=#30] + +(49) BroadcastHashJoin [codegen id : 12] +Left keys [6]: [coalesce(c_last_name#10, ), isnull(c_last_name#10), coalesce(c_first_name#9, ), isnull(c_first_name#9), coalesce(d_date#5, 1970-01-01), isnull(d_date#5)] +Right keys [6]: [coalesce(c_last_name#28, ), isnull(c_last_name#28), coalesce(c_first_name#27, ), isnull(c_first_name#27), coalesce(d_date#25, 1970-01-01), isnull(d_date#25)] +Join condition: None + +(50) HashAggregate [codegen id : 12] +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Keys [3]: [c_last_name#10, c_first_name#9, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#10, c_first_name#9, d_date#5] + +(51) HashAggregate [codegen id : 12] +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Keys [3]: [c_last_name#10, c_first_name#9, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results: [] + +(52) HashAggregate [codegen id : 12] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#31] +Results [1]: [count#32] + +(53) Exchange +Input [1]: [count#32] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#33] + +(54) HashAggregate [codegen id : 13] +Input [1]: [count#32] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#34] +Results [1]: [count(1)#34 AS count(1)#35] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#2 IN dynamicpruning#3 +ReusedExchange (55) + + +(55) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#4, d_date#5] + +Subquery:2 Hosting operator id = 20 Hosting Expression = cs_sold_date_sk#14 IN dynamicpruning#3 + +Subquery:3 Hosting operator id = 36 Hosting Expression = ws_sold_date_sk#23 IN dynamicpruning#3 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38/simplified.txt new file mode 100644 index 0000000000000..ce0c20ab01d79 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q38/simplified.txt @@ -0,0 +1,84 @@ +WholeStageCodegen (13) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #1 + WholeStageCodegen (12) + HashAggregate [count,count] + HashAggregate [c_last_name,c_first_name,d_date] + HashAggregate [c_last_name,c_first_name,d_date] + BroadcastHashJoin [c_last_name,c_first_name,d_date,c_last_name,c_first_name,d_date] + HashAggregate [c_last_name,c_first_name,d_date] + HashAggregate [c_last_name,c_first_name,d_date] + BroadcastHashJoin [c_last_name,c_first_name,d_date,c_last_name,c_first_name,d_date] + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #2 + WholeStageCodegen (3) + HashAggregate [c_last_name,c_first_name,d_date] + Project [c_last_name,c_first_name,d_date] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,d_date] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk,d_date] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_month_seq] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #6 + WholeStageCodegen (6) + HashAggregate [c_last_name,c_first_name,d_date] + Project [c_last_name,c_first_name,d_date] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + Project [cs_bill_customer_sk,d_date] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_date] #3 + InputAdapter + ReusedExchange [c_customer_sk,c_first_name,c_last_name] #4 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (11) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #8 + WholeStageCodegen (10) + HashAggregate [c_last_name,c_first_name,d_date] + Project [c_last_name,c_first_name,d_date] + BroadcastHashJoin [ws_bill_customer_sk,c_customer_sk] + Project [ws_bill_customer_sk,d_date] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_date] #3 + InputAdapter + ReusedExchange [c_customer_sk,c_first_name,c_last_name] #4 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/explain.txt new file mode 100644 index 0000000000000..5eb63f2a046cf --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/explain.txt @@ -0,0 +1,326 @@ +== Physical Plan == +* Sort (55) ++- Exchange (54) + +- * SortMergeJoin Inner (53) + :- * Sort (29) + : +- Exchange (28) + : +- * Project (27) + : +- * Filter (26) + : +- * HashAggregate (25) + : +- Exchange (24) + : +- * HashAggregate (23) + : +- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.inventory (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.item (11) + : +- BroadcastExchange (20) + : +- * Filter (19) + : +- * ColumnarToRow (18) + : +- Scan parquet default.warehouse (17) + +- * Sort (52) + +- Exchange (51) + +- * Project (50) + +- * Filter (49) + +- * HashAggregate (48) + +- Exchange (47) + +- * HashAggregate (46) + +- * Project (45) + +- * BroadcastHashJoin Inner BuildRight (44) + :- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Project (39) + : : +- * BroadcastHashJoin Inner BuildRight (38) + : : :- * Filter (32) + : : : +- * ColumnarToRow (31) + : : : +- Scan parquet default.inventory (30) + : : +- BroadcastExchange (37) + : : +- * Project (36) + : : +- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.date_dim (33) + : +- ReusedExchange (40) + +- ReusedExchange (43) + + +(1) Scan parquet default.inventory +Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Condition : (isnotnull(inv_item_sk#1) AND isnotnull(inv_warehouse_sk#2)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,1), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((isnotnull(d_year#7) AND isnotnull(d_moy#8)) AND (d_year#7 = 2001)) AND (d_moy#8 = 1)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#6, d_moy#8] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(8) BroadcastExchange +Input [2]: [d_date_sk#6, d_moy#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, d_moy#8] +Input [6]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, d_date_sk#6, d_moy#8] + +(11) Scan parquet default.item +Output [1]: [i_item_sk#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [1]: [i_item_sk#10] + +(13) Filter [codegen id : 2] +Input [1]: [i_item_sk#10] +Condition : isnotnull(i_item_sk#10) + +(14) BroadcastExchange +Input [1]: [i_item_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_item_sk#1] +Right keys [1]: [i_item_sk#10] +Join condition: None + +(16) Project [codegen id : 4] +Output [4]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, d_moy#8, i_item_sk#10] +Input [5]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, d_moy#8, i_item_sk#10] + +(17) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#12, w_warehouse_name#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [2]: [w_warehouse_sk#12, w_warehouse_name#13] + +(19) Filter [codegen id : 3] +Input [2]: [w_warehouse_sk#12, w_warehouse_name#13] +Condition : isnotnull(w_warehouse_sk#12) + +(20) BroadcastExchange +Input [2]: [w_warehouse_sk#12, w_warehouse_name#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_warehouse_sk#2] +Right keys [1]: [w_warehouse_sk#12] +Join condition: None + +(22) Project [codegen id : 4] +Output [5]: [inv_quantity_on_hand#3, i_item_sk#10, w_warehouse_sk#12, w_warehouse_name#13, d_moy#8] +Input [6]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, d_moy#8, i_item_sk#10, w_warehouse_sk#12, w_warehouse_name#13] + +(23) HashAggregate [codegen id : 4] +Input [5]: [inv_quantity_on_hand#3, i_item_sk#10, w_warehouse_sk#12, w_warehouse_name#13, d_moy#8] +Keys [4]: [w_warehouse_name#13, w_warehouse_sk#12, i_item_sk#10, d_moy#8] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#3 as double)), partial_avg(inv_quantity_on_hand#3)] +Aggregate Attributes [5]: [n#15, avg#16, m2#17, sum#18, count#19] +Results [9]: [w_warehouse_name#13, w_warehouse_sk#12, i_item_sk#10, d_moy#8, n#20, avg#21, m2#22, sum#23, count#24] + +(24) Exchange +Input [9]: [w_warehouse_name#13, w_warehouse_sk#12, i_item_sk#10, d_moy#8, n#20, avg#21, m2#22, sum#23, count#24] +Arguments: hashpartitioning(w_warehouse_name#13, w_warehouse_sk#12, i_item_sk#10, d_moy#8, 5), ENSURE_REQUIREMENTS, [id=#25] + +(25) HashAggregate [codegen id : 5] +Input [9]: [w_warehouse_name#13, w_warehouse_sk#12, i_item_sk#10, d_moy#8, n#20, avg#21, m2#22, sum#23, count#24] +Keys [4]: [w_warehouse_name#13, w_warehouse_sk#12, i_item_sk#10, d_moy#8] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#3 as double)), avg(inv_quantity_on_hand#3)] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#3 as double))#26, avg(inv_quantity_on_hand#3)#27] +Results [5]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, stddev_samp(cast(inv_quantity_on_hand#3 as double))#26 AS stdev#28, avg(inv_quantity_on_hand#3)#27 AS mean#29] + +(26) Filter [codegen id : 5] +Input [5]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, stdev#28, mean#29] +Condition : ((isnotnull(mean#29) AND isnotnull(stdev#28)) AND (NOT (mean#29 = 0.0) AND ((stdev#28 / mean#29) > 1.0))) + +(27) Project [codegen id : 5] +Output [5]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, mean#29, CASE WHEN (mean#29 = 0.0) THEN null ELSE (stdev#28 / mean#29) END AS cov#30] +Input [5]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, stdev#28, mean#29] + +(28) Exchange +Input [5]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, mean#29, cov#30] +Arguments: hashpartitioning(i_item_sk#10, w_warehouse_sk#12, 5), ENSURE_REQUIREMENTS, [id=#31] + +(29) Sort [codegen id : 6] +Input [5]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, mean#29, cov#30] +Arguments: [i_item_sk#10 ASC NULLS FIRST, w_warehouse_sk#12 ASC NULLS FIRST], false, 0 + +(30) Scan parquet default.inventory +Output [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#35), dynamicpruningexpression(inv_date_sk#35 IN dynamicpruning#36)] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 10] +Input [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35] + +(32) Filter [codegen id : 10] +Input [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35] +Condition : (isnotnull(inv_item_sk#32) AND isnotnull(inv_warehouse_sk#33)) + +(33) Scan parquet default.date_dim +Output [3]: [d_date_sk#37, d_year#38, d_moy#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,2), IsNotNull(d_date_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 7] +Input [3]: [d_date_sk#37, d_year#38, d_moy#39] + +(35) Filter [codegen id : 7] +Input [3]: [d_date_sk#37, d_year#38, d_moy#39] +Condition : ((((isnotnull(d_year#38) AND isnotnull(d_moy#39)) AND (d_year#38 = 2001)) AND (d_moy#39 = 2)) AND isnotnull(d_date_sk#37)) + +(36) Project [codegen id : 7] +Output [2]: [d_date_sk#37, d_moy#39] +Input [3]: [d_date_sk#37, d_year#38, d_moy#39] + +(37) BroadcastExchange +Input [2]: [d_date_sk#37, d_moy#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#40] + +(38) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [inv_date_sk#35] +Right keys [1]: [d_date_sk#37] +Join condition: None + +(39) Project [codegen id : 10] +Output [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, d_moy#39] +Input [6]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35, d_date_sk#37, d_moy#39] + +(40) ReusedExchange [Reuses operator id: 14] +Output [1]: [i_item_sk#41] + +(41) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [inv_item_sk#32] +Right keys [1]: [i_item_sk#41] +Join condition: None + +(42) Project [codegen id : 10] +Output [4]: [inv_warehouse_sk#33, inv_quantity_on_hand#34, d_moy#39, i_item_sk#41] +Input [5]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, d_moy#39, i_item_sk#41] + +(43) ReusedExchange [Reuses operator id: 20] +Output [2]: [w_warehouse_sk#42, w_warehouse_name#43] + +(44) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [inv_warehouse_sk#33] +Right keys [1]: [w_warehouse_sk#42] +Join condition: None + +(45) Project [codegen id : 10] +Output [5]: [inv_quantity_on_hand#34, i_item_sk#41, w_warehouse_sk#42, w_warehouse_name#43, d_moy#39] +Input [6]: [inv_warehouse_sk#33, inv_quantity_on_hand#34, d_moy#39, i_item_sk#41, w_warehouse_sk#42, w_warehouse_name#43] + +(46) HashAggregate [codegen id : 10] +Input [5]: [inv_quantity_on_hand#34, i_item_sk#41, w_warehouse_sk#42, w_warehouse_name#43, d_moy#39] +Keys [4]: [w_warehouse_name#43, w_warehouse_sk#42, i_item_sk#41, d_moy#39] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#34 as double)), partial_avg(inv_quantity_on_hand#34)] +Aggregate Attributes [5]: [n#44, avg#45, m2#46, sum#47, count#48] +Results [9]: [w_warehouse_name#43, w_warehouse_sk#42, i_item_sk#41, d_moy#39, n#49, avg#50, m2#51, sum#52, count#53] + +(47) Exchange +Input [9]: [w_warehouse_name#43, w_warehouse_sk#42, i_item_sk#41, d_moy#39, n#49, avg#50, m2#51, sum#52, count#53] +Arguments: hashpartitioning(w_warehouse_name#43, w_warehouse_sk#42, i_item_sk#41, d_moy#39, 5), ENSURE_REQUIREMENTS, [id=#54] + +(48) HashAggregate [codegen id : 11] +Input [9]: [w_warehouse_name#43, w_warehouse_sk#42, i_item_sk#41, d_moy#39, n#49, avg#50, m2#51, sum#52, count#53] +Keys [4]: [w_warehouse_name#43, w_warehouse_sk#42, i_item_sk#41, d_moy#39] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#34 as double)), avg(inv_quantity_on_hand#34)] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#34 as double))#55, avg(inv_quantity_on_hand#34)#56] +Results [5]: [w_warehouse_sk#42, i_item_sk#41, d_moy#39, stddev_samp(cast(inv_quantity_on_hand#34 as double))#55 AS stdev#57, avg(inv_quantity_on_hand#34)#56 AS mean#58] + +(49) Filter [codegen id : 11] +Input [5]: [w_warehouse_sk#42, i_item_sk#41, d_moy#39, stdev#57, mean#58] +Condition : ((isnotnull(mean#58) AND isnotnull(stdev#57)) AND (NOT (mean#58 = 0.0) AND ((stdev#57 / mean#58) > 1.0))) + +(50) Project [codegen id : 11] +Output [5]: [w_warehouse_sk#42, i_item_sk#41, d_moy#39, mean#58, CASE WHEN (mean#58 = 0.0) THEN null ELSE (stdev#57 / mean#58) END AS cov#59] +Input [5]: [w_warehouse_sk#42, i_item_sk#41, d_moy#39, stdev#57, mean#58] + +(51) Exchange +Input [5]: [w_warehouse_sk#42, i_item_sk#41, d_moy#39, mean#58, cov#59] +Arguments: hashpartitioning(i_item_sk#41, w_warehouse_sk#42, 5), ENSURE_REQUIREMENTS, [id=#60] + +(52) Sort [codegen id : 12] +Input [5]: [w_warehouse_sk#42, i_item_sk#41, d_moy#39, mean#58, cov#59] +Arguments: [i_item_sk#41 ASC NULLS FIRST, w_warehouse_sk#42 ASC NULLS FIRST], false, 0 + +(53) SortMergeJoin [codegen id : 13] +Left keys [2]: [i_item_sk#10, w_warehouse_sk#12] +Right keys [2]: [i_item_sk#41, w_warehouse_sk#42] +Join condition: None + +(54) Exchange +Input [10]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, mean#29, cov#30, w_warehouse_sk#42, i_item_sk#41, d_moy#39, mean#58, cov#59] +Arguments: rangepartitioning(w_warehouse_sk#12 ASC NULLS FIRST, i_item_sk#10 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST, mean#29 ASC NULLS FIRST, cov#30 ASC NULLS FIRST, d_moy#39 ASC NULLS FIRST, mean#58 ASC NULLS FIRST, cov#59 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#61] + +(55) Sort [codegen id : 14] +Input [10]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, mean#29, cov#30, w_warehouse_sk#42, i_item_sk#41, d_moy#39, mean#58, cov#59] +Arguments: [w_warehouse_sk#12 ASC NULLS FIRST, i_item_sk#10 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST, mean#29 ASC NULLS FIRST, cov#30 ASC NULLS FIRST, d_moy#39 ASC NULLS FIRST, mean#58 ASC NULLS FIRST, cov#59 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5 +ReusedExchange (56) + + +(56) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#6, d_moy#8] + +Subquery:2 Hosting operator id = 30 Hosting Expression = inv_date_sk#35 IN dynamicpruning#36 +ReusedExchange (57) + + +(57) ReusedExchange [Reuses operator id: 37] +Output [2]: [d_date_sk#37, d_moy#39] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/simplified.txt new file mode 100644 index 0000000000000..c6fa5d7835a93 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a.sf100/simplified.txt @@ -0,0 +1,90 @@ +WholeStageCodegen (14) + Sort [w_warehouse_sk,i_item_sk,d_moy,mean,cov,d_moy,mean,cov] + InputAdapter + Exchange [w_warehouse_sk,i_item_sk,d_moy,mean,cov,d_moy,mean,cov] #1 + WholeStageCodegen (13) + SortMergeJoin [i_item_sk,w_warehouse_sk,i_item_sk,w_warehouse_sk] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk,w_warehouse_sk] + InputAdapter + Exchange [i_item_sk,w_warehouse_sk] #2 + WholeStageCodegen (5) + Project [w_warehouse_sk,i_item_sk,d_moy,mean,stdev] + Filter [mean,stdev] + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,n,avg,m2,sum,count] [stddev_samp(cast(inv_quantity_on_hand as double)),avg(inv_quantity_on_hand),stdev,mean,n,avg,m2,sum,count] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy] #3 + WholeStageCodegen (4) + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] + Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,d_moy,i_item_sk] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_moy] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Filter [inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_moy] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk,d_moy] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + InputAdapter + WholeStageCodegen (12) + Sort [i_item_sk,w_warehouse_sk] + InputAdapter + Exchange [i_item_sk,w_warehouse_sk] #7 + WholeStageCodegen (11) + Project [w_warehouse_sk,i_item_sk,d_moy,mean,stdev] + Filter [mean,stdev] + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,n,avg,m2,sum,count] [stddev_samp(cast(inv_quantity_on_hand as double)),avg(inv_quantity_on_hand),stdev,mean,n,avg,m2,sum,count] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy] #8 + WholeStageCodegen (10) + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] + Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,d_moy,i_item_sk] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_moy] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Filter [inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_moy] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (7) + Project [d_date_sk,d_moy] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + ReusedExchange [i_item_sk] #5 + InputAdapter + ReusedExchange [w_warehouse_sk,w_warehouse_name] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a/explain.txt new file mode 100644 index 0000000000000..e77de53c5adcb --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a/explain.txt @@ -0,0 +1,311 @@ +== Physical Plan == +* Sort (52) ++- Exchange (51) + +- * BroadcastHashJoin Inner BuildRight (50) + :- * Project (27) + : +- * Filter (26) + : +- * HashAggregate (25) + : +- Exchange (24) + : +- * HashAggregate (23) + : +- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.inventory (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.item (4) + : : +- BroadcastExchange (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.warehouse (10) + : +- BroadcastExchange (20) + : +- * Project (19) + : +- * Filter (18) + : +- * ColumnarToRow (17) + : +- Scan parquet default.date_dim (16) + +- BroadcastExchange (49) + +- * Project (48) + +- * Filter (47) + +- * HashAggregate (46) + +- Exchange (45) + +- * HashAggregate (44) + +- * Project (43) + +- * BroadcastHashJoin Inner BuildRight (42) + :- * Project (36) + : +- * BroadcastHashJoin Inner BuildRight (35) + : :- * Project (33) + : : +- * BroadcastHashJoin Inner BuildRight (32) + : : :- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.inventory (28) + : : +- ReusedExchange (31) + : +- ReusedExchange (34) + +- BroadcastExchange (41) + +- * Project (40) + +- * Filter (39) + +- * ColumnarToRow (38) + +- Scan parquet default.date_dim (37) + + +(1) Scan parquet default.inventory +Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Condition : (isnotnull(inv_item_sk#1) AND isnotnull(inv_warehouse_sk#2)) + +(4) Scan parquet default.item +Output [1]: [i_item_sk#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [1]: [i_item_sk#6] + +(6) Filter [codegen id : 1] +Input [1]: [i_item_sk#6] +Condition : isnotnull(i_item_sk#6) + +(7) BroadcastExchange +Input [1]: [i_item_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_item_sk#1] +Right keys [1]: [i_item_sk#6] +Join condition: None + +(9) Project [codegen id : 4] +Output [4]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6] +Input [5]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6] + +(10) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#8, w_warehouse_name#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [w_warehouse_sk#8, w_warehouse_name#9] + +(12) Filter [codegen id : 2] +Input [2]: [w_warehouse_sk#8, w_warehouse_name#9] +Condition : isnotnull(w_warehouse_sk#8) + +(13) BroadcastExchange +Input [2]: [w_warehouse_sk#8, w_warehouse_name#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] + +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_warehouse_sk#2] +Right keys [1]: [w_warehouse_sk#8] +Join condition: None + +(15) Project [codegen id : 4] +Output [5]: [inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6, w_warehouse_sk#8, w_warehouse_name#9] +Input [6]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6, w_warehouse_sk#8, w_warehouse_name#9] + +(16) Scan parquet default.date_dim +Output [3]: [d_date_sk#11, d_year#12, d_moy#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,1), IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(18) Filter [codegen id : 3] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] +Condition : ((((isnotnull(d_year#12) AND isnotnull(d_moy#13)) AND (d_year#12 = 2001)) AND (d_moy#13 = 1)) AND isnotnull(d_date_sk#11)) + +(19) Project [codegen id : 3] +Output [2]: [d_date_sk#11, d_moy#13] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(20) BroadcastExchange +Input [2]: [d_date_sk#11, d_moy#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_date_sk#4] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(22) Project [codegen id : 4] +Output [5]: [inv_quantity_on_hand#3, i_item_sk#6, w_warehouse_sk#8, w_warehouse_name#9, d_moy#13] +Input [7]: [inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6, w_warehouse_sk#8, w_warehouse_name#9, d_date_sk#11, d_moy#13] + +(23) HashAggregate [codegen id : 4] +Input [5]: [inv_quantity_on_hand#3, i_item_sk#6, w_warehouse_sk#8, w_warehouse_name#9, d_moy#13] +Keys [4]: [w_warehouse_name#9, w_warehouse_sk#8, i_item_sk#6, d_moy#13] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#3 as double)), partial_avg(inv_quantity_on_hand#3)] +Aggregate Attributes [5]: [n#15, avg#16, m2#17, sum#18, count#19] +Results [9]: [w_warehouse_name#9, w_warehouse_sk#8, i_item_sk#6, d_moy#13, n#20, avg#21, m2#22, sum#23, count#24] + +(24) Exchange +Input [9]: [w_warehouse_name#9, w_warehouse_sk#8, i_item_sk#6, d_moy#13, n#20, avg#21, m2#22, sum#23, count#24] +Arguments: hashpartitioning(w_warehouse_name#9, w_warehouse_sk#8, i_item_sk#6, d_moy#13, 5), ENSURE_REQUIREMENTS, [id=#25] + +(25) HashAggregate [codegen id : 10] +Input [9]: [w_warehouse_name#9, w_warehouse_sk#8, i_item_sk#6, d_moy#13, n#20, avg#21, m2#22, sum#23, count#24] +Keys [4]: [w_warehouse_name#9, w_warehouse_sk#8, i_item_sk#6, d_moy#13] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#3 as double)), avg(inv_quantity_on_hand#3)] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#3 as double))#26, avg(inv_quantity_on_hand#3)#27] +Results [5]: [w_warehouse_sk#8, i_item_sk#6, d_moy#13, stddev_samp(cast(inv_quantity_on_hand#3 as double))#26 AS stdev#28, avg(inv_quantity_on_hand#3)#27 AS mean#29] + +(26) Filter [codegen id : 10] +Input [5]: [w_warehouse_sk#8, i_item_sk#6, d_moy#13, stdev#28, mean#29] +Condition : ((isnotnull(mean#29) AND isnotnull(stdev#28)) AND (NOT (mean#29 = 0.0) AND ((stdev#28 / mean#29) > 1.0))) + +(27) Project [codegen id : 10] +Output [5]: [w_warehouse_sk#8, i_item_sk#6, d_moy#13, mean#29, CASE WHEN (mean#29 = 0.0) THEN null ELSE (stdev#28 / mean#29) END AS cov#30] +Input [5]: [w_warehouse_sk#8, i_item_sk#6, d_moy#13, stdev#28, mean#29] + +(28) Scan parquet default.inventory +Output [4]: [inv_item_sk#31, inv_warehouse_sk#32, inv_quantity_on_hand#33, inv_date_sk#34] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#34), dynamicpruningexpression(inv_date_sk#34 IN dynamicpruning#35)] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 8] +Input [4]: [inv_item_sk#31, inv_warehouse_sk#32, inv_quantity_on_hand#33, inv_date_sk#34] + +(30) Filter [codegen id : 8] +Input [4]: [inv_item_sk#31, inv_warehouse_sk#32, inv_quantity_on_hand#33, inv_date_sk#34] +Condition : (isnotnull(inv_item_sk#31) AND isnotnull(inv_warehouse_sk#32)) + +(31) ReusedExchange [Reuses operator id: 7] +Output [1]: [i_item_sk#36] + +(32) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [inv_item_sk#31] +Right keys [1]: [i_item_sk#36] +Join condition: None + +(33) Project [codegen id : 8] +Output [4]: [inv_warehouse_sk#32, inv_quantity_on_hand#33, inv_date_sk#34, i_item_sk#36] +Input [5]: [inv_item_sk#31, inv_warehouse_sk#32, inv_quantity_on_hand#33, inv_date_sk#34, i_item_sk#36] + +(34) ReusedExchange [Reuses operator id: 13] +Output [2]: [w_warehouse_sk#37, w_warehouse_name#38] + +(35) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [inv_warehouse_sk#32] +Right keys [1]: [w_warehouse_sk#37] +Join condition: None + +(36) Project [codegen id : 8] +Output [5]: [inv_quantity_on_hand#33, inv_date_sk#34, i_item_sk#36, w_warehouse_sk#37, w_warehouse_name#38] +Input [6]: [inv_warehouse_sk#32, inv_quantity_on_hand#33, inv_date_sk#34, i_item_sk#36, w_warehouse_sk#37, w_warehouse_name#38] + +(37) Scan parquet default.date_dim +Output [3]: [d_date_sk#39, d_year#40, d_moy#41] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,2), IsNotNull(d_date_sk)] +ReadSchema: struct + +(38) ColumnarToRow [codegen id : 7] +Input [3]: [d_date_sk#39, d_year#40, d_moy#41] + +(39) Filter [codegen id : 7] +Input [3]: [d_date_sk#39, d_year#40, d_moy#41] +Condition : ((((isnotnull(d_year#40) AND isnotnull(d_moy#41)) AND (d_year#40 = 2001)) AND (d_moy#41 = 2)) AND isnotnull(d_date_sk#39)) + +(40) Project [codegen id : 7] +Output [2]: [d_date_sk#39, d_moy#41] +Input [3]: [d_date_sk#39, d_year#40, d_moy#41] + +(41) BroadcastExchange +Input [2]: [d_date_sk#39, d_moy#41] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#42] + +(42) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [inv_date_sk#34] +Right keys [1]: [d_date_sk#39] +Join condition: None + +(43) Project [codegen id : 8] +Output [5]: [inv_quantity_on_hand#33, i_item_sk#36, w_warehouse_sk#37, w_warehouse_name#38, d_moy#41] +Input [7]: [inv_quantity_on_hand#33, inv_date_sk#34, i_item_sk#36, w_warehouse_sk#37, w_warehouse_name#38, d_date_sk#39, d_moy#41] + +(44) HashAggregate [codegen id : 8] +Input [5]: [inv_quantity_on_hand#33, i_item_sk#36, w_warehouse_sk#37, w_warehouse_name#38, d_moy#41] +Keys [4]: [w_warehouse_name#38, w_warehouse_sk#37, i_item_sk#36, d_moy#41] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#33 as double)), partial_avg(inv_quantity_on_hand#33)] +Aggregate Attributes [5]: [n#43, avg#44, m2#45, sum#46, count#47] +Results [9]: [w_warehouse_name#38, w_warehouse_sk#37, i_item_sk#36, d_moy#41, n#48, avg#49, m2#50, sum#51, count#52] + +(45) Exchange +Input [9]: [w_warehouse_name#38, w_warehouse_sk#37, i_item_sk#36, d_moy#41, n#48, avg#49, m2#50, sum#51, count#52] +Arguments: hashpartitioning(w_warehouse_name#38, w_warehouse_sk#37, i_item_sk#36, d_moy#41, 5), ENSURE_REQUIREMENTS, [id=#53] + +(46) HashAggregate [codegen id : 9] +Input [9]: [w_warehouse_name#38, w_warehouse_sk#37, i_item_sk#36, d_moy#41, n#48, avg#49, m2#50, sum#51, count#52] +Keys [4]: [w_warehouse_name#38, w_warehouse_sk#37, i_item_sk#36, d_moy#41] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#33 as double)), avg(inv_quantity_on_hand#33)] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#33 as double))#54, avg(inv_quantity_on_hand#33)#55] +Results [5]: [w_warehouse_sk#37, i_item_sk#36, d_moy#41, stddev_samp(cast(inv_quantity_on_hand#33 as double))#54 AS stdev#56, avg(inv_quantity_on_hand#33)#55 AS mean#57] + +(47) Filter [codegen id : 9] +Input [5]: [w_warehouse_sk#37, i_item_sk#36, d_moy#41, stdev#56, mean#57] +Condition : ((isnotnull(mean#57) AND isnotnull(stdev#56)) AND (NOT (mean#57 = 0.0) AND ((stdev#56 / mean#57) > 1.0))) + +(48) Project [codegen id : 9] +Output [5]: [w_warehouse_sk#37, i_item_sk#36, d_moy#41, mean#57, CASE WHEN (mean#57 = 0.0) THEN null ELSE (stdev#56 / mean#57) END AS cov#58] +Input [5]: [w_warehouse_sk#37, i_item_sk#36, d_moy#41, stdev#56, mean#57] + +(49) BroadcastExchange +Input [5]: [w_warehouse_sk#37, i_item_sk#36, d_moy#41, mean#57, cov#58] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [id=#59] + +(50) BroadcastHashJoin [codegen id : 10] +Left keys [2]: [i_item_sk#6, w_warehouse_sk#8] +Right keys [2]: [i_item_sk#36, w_warehouse_sk#37] +Join condition: None + +(51) Exchange +Input [10]: [w_warehouse_sk#8, i_item_sk#6, d_moy#13, mean#29, cov#30, w_warehouse_sk#37, i_item_sk#36, d_moy#41, mean#57, cov#58] +Arguments: rangepartitioning(w_warehouse_sk#8 ASC NULLS FIRST, i_item_sk#6 ASC NULLS FIRST, d_moy#13 ASC NULLS FIRST, mean#29 ASC NULLS FIRST, cov#30 ASC NULLS FIRST, d_moy#41 ASC NULLS FIRST, mean#57 ASC NULLS FIRST, cov#58 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#60] + +(52) Sort [codegen id : 11] +Input [10]: [w_warehouse_sk#8, i_item_sk#6, d_moy#13, mean#29, cov#30, w_warehouse_sk#37, i_item_sk#36, d_moy#41, mean#57, cov#58] +Arguments: [w_warehouse_sk#8 ASC NULLS FIRST, i_item_sk#6 ASC NULLS FIRST, d_moy#13 ASC NULLS FIRST, mean#29 ASC NULLS FIRST, cov#30 ASC NULLS FIRST, d_moy#41 ASC NULLS FIRST, mean#57 ASC NULLS FIRST, cov#58 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5 +ReusedExchange (53) + + +(53) ReusedExchange [Reuses operator id: 20] +Output [2]: [d_date_sk#11, d_moy#13] + +Subquery:2 Hosting operator id = 28 Hosting Expression = inv_date_sk#34 IN dynamicpruning#35 +ReusedExchange (54) + + +(54) ReusedExchange [Reuses operator id: 41] +Output [2]: [d_date_sk#39, d_moy#41] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a/simplified.txt new file mode 100644 index 0000000000000..ecd1313c1f5e1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39a/simplified.txt @@ -0,0 +1,81 @@ +WholeStageCodegen (11) + Sort [w_warehouse_sk,i_item_sk,d_moy,mean,cov,d_moy,mean,cov] + InputAdapter + Exchange [w_warehouse_sk,i_item_sk,d_moy,mean,cov,d_moy,mean,cov] #1 + WholeStageCodegen (10) + BroadcastHashJoin [i_item_sk,w_warehouse_sk,i_item_sk,w_warehouse_sk] + Project [w_warehouse_sk,i_item_sk,d_moy,mean,stdev] + Filter [mean,stdev] + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,n,avg,m2,sum,count] [stddev_samp(cast(inv_quantity_on_hand as double)),avg(inv_quantity_on_hand),stdev,mean,n,avg,m2,sum,count] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy] #2 + WholeStageCodegen (4) + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] + Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [inv_quantity_on_hand,inv_date_sk,i_item_sk,w_warehouse_sk,w_warehouse_name] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk,i_item_sk] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Filter [inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_moy] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (3) + Project [d_date_sk,d_moy] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (9) + Project [w_warehouse_sk,i_item_sk,d_moy,mean,stdev] + Filter [mean,stdev] + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,n,avg,m2,sum,count] [stddev_samp(cast(inv_quantity_on_hand as double)),avg(inv_quantity_on_hand),stdev,mean,n,avg,m2,sum,count] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy] #7 + WholeStageCodegen (8) + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] + Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [inv_quantity_on_hand,inv_date_sk,i_item_sk,w_warehouse_sk,w_warehouse_name] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk,i_item_sk] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Filter [inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_moy] #8 + InputAdapter + ReusedExchange [i_item_sk] #4 + InputAdapter + ReusedExchange [w_warehouse_sk,w_warehouse_name] #5 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (7) + Project [d_date_sk,d_moy] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/explain.txt new file mode 100644 index 0000000000000..e2e3760fe2d03 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/explain.txt @@ -0,0 +1,326 @@ +== Physical Plan == +* Sort (55) ++- Exchange (54) + +- * SortMergeJoin Inner (53) + :- * Sort (29) + : +- Exchange (28) + : +- * Project (27) + : +- * Filter (26) + : +- * HashAggregate (25) + : +- Exchange (24) + : +- * HashAggregate (23) + : +- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.inventory (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.item (11) + : +- BroadcastExchange (20) + : +- * Filter (19) + : +- * ColumnarToRow (18) + : +- Scan parquet default.warehouse (17) + +- * Sort (52) + +- Exchange (51) + +- * Project (50) + +- * Filter (49) + +- * HashAggregate (48) + +- Exchange (47) + +- * HashAggregate (46) + +- * Project (45) + +- * BroadcastHashJoin Inner BuildRight (44) + :- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Project (39) + : : +- * BroadcastHashJoin Inner BuildRight (38) + : : :- * Filter (32) + : : : +- * ColumnarToRow (31) + : : : +- Scan parquet default.inventory (30) + : : +- BroadcastExchange (37) + : : +- * Project (36) + : : +- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.date_dim (33) + : +- ReusedExchange (40) + +- ReusedExchange (43) + + +(1) Scan parquet default.inventory +Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Condition : (isnotnull(inv_item_sk#1) AND isnotnull(inv_warehouse_sk#2)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,1), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((isnotnull(d_year#7) AND isnotnull(d_moy#8)) AND (d_year#7 = 2001)) AND (d_moy#8 = 1)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#6, d_moy#8] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(8) BroadcastExchange +Input [2]: [d_date_sk#6, d_moy#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, d_moy#8] +Input [6]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, d_date_sk#6, d_moy#8] + +(11) Scan parquet default.item +Output [1]: [i_item_sk#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [1]: [i_item_sk#10] + +(13) Filter [codegen id : 2] +Input [1]: [i_item_sk#10] +Condition : isnotnull(i_item_sk#10) + +(14) BroadcastExchange +Input [1]: [i_item_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_item_sk#1] +Right keys [1]: [i_item_sk#10] +Join condition: None + +(16) Project [codegen id : 4] +Output [4]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, d_moy#8, i_item_sk#10] +Input [5]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, d_moy#8, i_item_sk#10] + +(17) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#12, w_warehouse_name#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [2]: [w_warehouse_sk#12, w_warehouse_name#13] + +(19) Filter [codegen id : 3] +Input [2]: [w_warehouse_sk#12, w_warehouse_name#13] +Condition : isnotnull(w_warehouse_sk#12) + +(20) BroadcastExchange +Input [2]: [w_warehouse_sk#12, w_warehouse_name#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_warehouse_sk#2] +Right keys [1]: [w_warehouse_sk#12] +Join condition: None + +(22) Project [codegen id : 4] +Output [5]: [inv_quantity_on_hand#3, i_item_sk#10, w_warehouse_sk#12, w_warehouse_name#13, d_moy#8] +Input [6]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, d_moy#8, i_item_sk#10, w_warehouse_sk#12, w_warehouse_name#13] + +(23) HashAggregate [codegen id : 4] +Input [5]: [inv_quantity_on_hand#3, i_item_sk#10, w_warehouse_sk#12, w_warehouse_name#13, d_moy#8] +Keys [4]: [w_warehouse_name#13, w_warehouse_sk#12, i_item_sk#10, d_moy#8] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#3 as double)), partial_avg(inv_quantity_on_hand#3)] +Aggregate Attributes [5]: [n#15, avg#16, m2#17, sum#18, count#19] +Results [9]: [w_warehouse_name#13, w_warehouse_sk#12, i_item_sk#10, d_moy#8, n#20, avg#21, m2#22, sum#23, count#24] + +(24) Exchange +Input [9]: [w_warehouse_name#13, w_warehouse_sk#12, i_item_sk#10, d_moy#8, n#20, avg#21, m2#22, sum#23, count#24] +Arguments: hashpartitioning(w_warehouse_name#13, w_warehouse_sk#12, i_item_sk#10, d_moy#8, 5), ENSURE_REQUIREMENTS, [id=#25] + +(25) HashAggregate [codegen id : 5] +Input [9]: [w_warehouse_name#13, w_warehouse_sk#12, i_item_sk#10, d_moy#8, n#20, avg#21, m2#22, sum#23, count#24] +Keys [4]: [w_warehouse_name#13, w_warehouse_sk#12, i_item_sk#10, d_moy#8] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#3 as double)), avg(inv_quantity_on_hand#3)] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#3 as double))#26, avg(inv_quantity_on_hand#3)#27] +Results [5]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, stddev_samp(cast(inv_quantity_on_hand#3 as double))#26 AS stdev#28, avg(inv_quantity_on_hand#3)#27 AS mean#29] + +(26) Filter [codegen id : 5] +Input [5]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, stdev#28, mean#29] +Condition : ((isnotnull(mean#29) AND isnotnull(stdev#28)) AND ((NOT (mean#29 = 0.0) AND ((stdev#28 / mean#29) > 1.0)) AND ((stdev#28 / mean#29) > 1.5))) + +(27) Project [codegen id : 5] +Output [5]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, mean#29, CASE WHEN (mean#29 = 0.0) THEN null ELSE (stdev#28 / mean#29) END AS cov#30] +Input [5]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, stdev#28, mean#29] + +(28) Exchange +Input [5]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, mean#29, cov#30] +Arguments: hashpartitioning(i_item_sk#10, w_warehouse_sk#12, 5), ENSURE_REQUIREMENTS, [id=#31] + +(29) Sort [codegen id : 6] +Input [5]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, mean#29, cov#30] +Arguments: [i_item_sk#10 ASC NULLS FIRST, w_warehouse_sk#12 ASC NULLS FIRST], false, 0 + +(30) Scan parquet default.inventory +Output [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#35), dynamicpruningexpression(inv_date_sk#35 IN dynamicpruning#36)] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 10] +Input [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35] + +(32) Filter [codegen id : 10] +Input [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35] +Condition : (isnotnull(inv_item_sk#32) AND isnotnull(inv_warehouse_sk#33)) + +(33) Scan parquet default.date_dim +Output [3]: [d_date_sk#37, d_year#38, d_moy#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,2), IsNotNull(d_date_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 7] +Input [3]: [d_date_sk#37, d_year#38, d_moy#39] + +(35) Filter [codegen id : 7] +Input [3]: [d_date_sk#37, d_year#38, d_moy#39] +Condition : ((((isnotnull(d_year#38) AND isnotnull(d_moy#39)) AND (d_year#38 = 2001)) AND (d_moy#39 = 2)) AND isnotnull(d_date_sk#37)) + +(36) Project [codegen id : 7] +Output [2]: [d_date_sk#37, d_moy#39] +Input [3]: [d_date_sk#37, d_year#38, d_moy#39] + +(37) BroadcastExchange +Input [2]: [d_date_sk#37, d_moy#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#40] + +(38) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [inv_date_sk#35] +Right keys [1]: [d_date_sk#37] +Join condition: None + +(39) Project [codegen id : 10] +Output [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, d_moy#39] +Input [6]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35, d_date_sk#37, d_moy#39] + +(40) ReusedExchange [Reuses operator id: 14] +Output [1]: [i_item_sk#41] + +(41) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [inv_item_sk#32] +Right keys [1]: [i_item_sk#41] +Join condition: None + +(42) Project [codegen id : 10] +Output [4]: [inv_warehouse_sk#33, inv_quantity_on_hand#34, d_moy#39, i_item_sk#41] +Input [5]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, d_moy#39, i_item_sk#41] + +(43) ReusedExchange [Reuses operator id: 20] +Output [2]: [w_warehouse_sk#42, w_warehouse_name#43] + +(44) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [inv_warehouse_sk#33] +Right keys [1]: [w_warehouse_sk#42] +Join condition: None + +(45) Project [codegen id : 10] +Output [5]: [inv_quantity_on_hand#34, i_item_sk#41, w_warehouse_sk#42, w_warehouse_name#43, d_moy#39] +Input [6]: [inv_warehouse_sk#33, inv_quantity_on_hand#34, d_moy#39, i_item_sk#41, w_warehouse_sk#42, w_warehouse_name#43] + +(46) HashAggregate [codegen id : 10] +Input [5]: [inv_quantity_on_hand#34, i_item_sk#41, w_warehouse_sk#42, w_warehouse_name#43, d_moy#39] +Keys [4]: [w_warehouse_name#43, w_warehouse_sk#42, i_item_sk#41, d_moy#39] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#34 as double)), partial_avg(inv_quantity_on_hand#34)] +Aggregate Attributes [5]: [n#44, avg#45, m2#46, sum#47, count#48] +Results [9]: [w_warehouse_name#43, w_warehouse_sk#42, i_item_sk#41, d_moy#39, n#49, avg#50, m2#51, sum#52, count#53] + +(47) Exchange +Input [9]: [w_warehouse_name#43, w_warehouse_sk#42, i_item_sk#41, d_moy#39, n#49, avg#50, m2#51, sum#52, count#53] +Arguments: hashpartitioning(w_warehouse_name#43, w_warehouse_sk#42, i_item_sk#41, d_moy#39, 5), ENSURE_REQUIREMENTS, [id=#54] + +(48) HashAggregate [codegen id : 11] +Input [9]: [w_warehouse_name#43, w_warehouse_sk#42, i_item_sk#41, d_moy#39, n#49, avg#50, m2#51, sum#52, count#53] +Keys [4]: [w_warehouse_name#43, w_warehouse_sk#42, i_item_sk#41, d_moy#39] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#34 as double)), avg(inv_quantity_on_hand#34)] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#34 as double))#55, avg(inv_quantity_on_hand#34)#56] +Results [5]: [w_warehouse_sk#42, i_item_sk#41, d_moy#39, stddev_samp(cast(inv_quantity_on_hand#34 as double))#55 AS stdev#57, avg(inv_quantity_on_hand#34)#56 AS mean#58] + +(49) Filter [codegen id : 11] +Input [5]: [w_warehouse_sk#42, i_item_sk#41, d_moy#39, stdev#57, mean#58] +Condition : ((isnotnull(mean#58) AND isnotnull(stdev#57)) AND (NOT (mean#58 = 0.0) AND ((stdev#57 / mean#58) > 1.0))) + +(50) Project [codegen id : 11] +Output [5]: [w_warehouse_sk#42, i_item_sk#41, d_moy#39, mean#58, CASE WHEN (mean#58 = 0.0) THEN null ELSE (stdev#57 / mean#58) END AS cov#59] +Input [5]: [w_warehouse_sk#42, i_item_sk#41, d_moy#39, stdev#57, mean#58] + +(51) Exchange +Input [5]: [w_warehouse_sk#42, i_item_sk#41, d_moy#39, mean#58, cov#59] +Arguments: hashpartitioning(i_item_sk#41, w_warehouse_sk#42, 5), ENSURE_REQUIREMENTS, [id=#60] + +(52) Sort [codegen id : 12] +Input [5]: [w_warehouse_sk#42, i_item_sk#41, d_moy#39, mean#58, cov#59] +Arguments: [i_item_sk#41 ASC NULLS FIRST, w_warehouse_sk#42 ASC NULLS FIRST], false, 0 + +(53) SortMergeJoin [codegen id : 13] +Left keys [2]: [i_item_sk#10, w_warehouse_sk#12] +Right keys [2]: [i_item_sk#41, w_warehouse_sk#42] +Join condition: None + +(54) Exchange +Input [10]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, mean#29, cov#30, w_warehouse_sk#42, i_item_sk#41, d_moy#39, mean#58, cov#59] +Arguments: rangepartitioning(w_warehouse_sk#12 ASC NULLS FIRST, i_item_sk#10 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST, mean#29 ASC NULLS FIRST, cov#30 ASC NULLS FIRST, d_moy#39 ASC NULLS FIRST, mean#58 ASC NULLS FIRST, cov#59 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#61] + +(55) Sort [codegen id : 14] +Input [10]: [w_warehouse_sk#12, i_item_sk#10, d_moy#8, mean#29, cov#30, w_warehouse_sk#42, i_item_sk#41, d_moy#39, mean#58, cov#59] +Arguments: [w_warehouse_sk#12 ASC NULLS FIRST, i_item_sk#10 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST, mean#29 ASC NULLS FIRST, cov#30 ASC NULLS FIRST, d_moy#39 ASC NULLS FIRST, mean#58 ASC NULLS FIRST, cov#59 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5 +ReusedExchange (56) + + +(56) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#6, d_moy#8] + +Subquery:2 Hosting operator id = 30 Hosting Expression = inv_date_sk#35 IN dynamicpruning#36 +ReusedExchange (57) + + +(57) ReusedExchange [Reuses operator id: 37] +Output [2]: [d_date_sk#37, d_moy#39] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/simplified.txt new file mode 100644 index 0000000000000..c6fa5d7835a93 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b.sf100/simplified.txt @@ -0,0 +1,90 @@ +WholeStageCodegen (14) + Sort [w_warehouse_sk,i_item_sk,d_moy,mean,cov,d_moy,mean,cov] + InputAdapter + Exchange [w_warehouse_sk,i_item_sk,d_moy,mean,cov,d_moy,mean,cov] #1 + WholeStageCodegen (13) + SortMergeJoin [i_item_sk,w_warehouse_sk,i_item_sk,w_warehouse_sk] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk,w_warehouse_sk] + InputAdapter + Exchange [i_item_sk,w_warehouse_sk] #2 + WholeStageCodegen (5) + Project [w_warehouse_sk,i_item_sk,d_moy,mean,stdev] + Filter [mean,stdev] + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,n,avg,m2,sum,count] [stddev_samp(cast(inv_quantity_on_hand as double)),avg(inv_quantity_on_hand),stdev,mean,n,avg,m2,sum,count] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy] #3 + WholeStageCodegen (4) + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] + Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,d_moy,i_item_sk] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_moy] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Filter [inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_moy] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk,d_moy] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + InputAdapter + WholeStageCodegen (12) + Sort [i_item_sk,w_warehouse_sk] + InputAdapter + Exchange [i_item_sk,w_warehouse_sk] #7 + WholeStageCodegen (11) + Project [w_warehouse_sk,i_item_sk,d_moy,mean,stdev] + Filter [mean,stdev] + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,n,avg,m2,sum,count] [stddev_samp(cast(inv_quantity_on_hand as double)),avg(inv_quantity_on_hand),stdev,mean,n,avg,m2,sum,count] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy] #8 + WholeStageCodegen (10) + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] + Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,d_moy,i_item_sk] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,d_moy] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Filter [inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_moy] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (7) + Project [d_date_sk,d_moy] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + ReusedExchange [i_item_sk] #5 + InputAdapter + ReusedExchange [w_warehouse_sk,w_warehouse_name] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b/explain.txt new file mode 100644 index 0000000000000..d60cd37ce7bf1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b/explain.txt @@ -0,0 +1,311 @@ +== Physical Plan == +* Sort (52) ++- Exchange (51) + +- * BroadcastHashJoin Inner BuildRight (50) + :- * Project (27) + : +- * Filter (26) + : +- * HashAggregate (25) + : +- Exchange (24) + : +- * HashAggregate (23) + : +- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.inventory (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.item (4) + : : +- BroadcastExchange (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.warehouse (10) + : +- BroadcastExchange (20) + : +- * Project (19) + : +- * Filter (18) + : +- * ColumnarToRow (17) + : +- Scan parquet default.date_dim (16) + +- BroadcastExchange (49) + +- * Project (48) + +- * Filter (47) + +- * HashAggregate (46) + +- Exchange (45) + +- * HashAggregate (44) + +- * Project (43) + +- * BroadcastHashJoin Inner BuildRight (42) + :- * Project (36) + : +- * BroadcastHashJoin Inner BuildRight (35) + : :- * Project (33) + : : +- * BroadcastHashJoin Inner BuildRight (32) + : : :- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.inventory (28) + : : +- ReusedExchange (31) + : +- ReusedExchange (34) + +- BroadcastExchange (41) + +- * Project (40) + +- * Filter (39) + +- * ColumnarToRow (38) + +- Scan parquet default.date_dim (37) + + +(1) Scan parquet default.inventory +Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Condition : (isnotnull(inv_item_sk#1) AND isnotnull(inv_warehouse_sk#2)) + +(4) Scan parquet default.item +Output [1]: [i_item_sk#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [1]: [i_item_sk#6] + +(6) Filter [codegen id : 1] +Input [1]: [i_item_sk#6] +Condition : isnotnull(i_item_sk#6) + +(7) BroadcastExchange +Input [1]: [i_item_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_item_sk#1] +Right keys [1]: [i_item_sk#6] +Join condition: None + +(9) Project [codegen id : 4] +Output [4]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6] +Input [5]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6] + +(10) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#8, w_warehouse_name#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [w_warehouse_sk#8, w_warehouse_name#9] + +(12) Filter [codegen id : 2] +Input [2]: [w_warehouse_sk#8, w_warehouse_name#9] +Condition : isnotnull(w_warehouse_sk#8) + +(13) BroadcastExchange +Input [2]: [w_warehouse_sk#8, w_warehouse_name#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] + +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_warehouse_sk#2] +Right keys [1]: [w_warehouse_sk#8] +Join condition: None + +(15) Project [codegen id : 4] +Output [5]: [inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6, w_warehouse_sk#8, w_warehouse_name#9] +Input [6]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6, w_warehouse_sk#8, w_warehouse_name#9] + +(16) Scan parquet default.date_dim +Output [3]: [d_date_sk#11, d_year#12, d_moy#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,1), IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(18) Filter [codegen id : 3] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] +Condition : ((((isnotnull(d_year#12) AND isnotnull(d_moy#13)) AND (d_year#12 = 2001)) AND (d_moy#13 = 1)) AND isnotnull(d_date_sk#11)) + +(19) Project [codegen id : 3] +Output [2]: [d_date_sk#11, d_moy#13] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(20) BroadcastExchange +Input [2]: [d_date_sk#11, d_moy#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_date_sk#4] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(22) Project [codegen id : 4] +Output [5]: [inv_quantity_on_hand#3, i_item_sk#6, w_warehouse_sk#8, w_warehouse_name#9, d_moy#13] +Input [7]: [inv_quantity_on_hand#3, inv_date_sk#4, i_item_sk#6, w_warehouse_sk#8, w_warehouse_name#9, d_date_sk#11, d_moy#13] + +(23) HashAggregate [codegen id : 4] +Input [5]: [inv_quantity_on_hand#3, i_item_sk#6, w_warehouse_sk#8, w_warehouse_name#9, d_moy#13] +Keys [4]: [w_warehouse_name#9, w_warehouse_sk#8, i_item_sk#6, d_moy#13] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#3 as double)), partial_avg(inv_quantity_on_hand#3)] +Aggregate Attributes [5]: [n#15, avg#16, m2#17, sum#18, count#19] +Results [9]: [w_warehouse_name#9, w_warehouse_sk#8, i_item_sk#6, d_moy#13, n#20, avg#21, m2#22, sum#23, count#24] + +(24) Exchange +Input [9]: [w_warehouse_name#9, w_warehouse_sk#8, i_item_sk#6, d_moy#13, n#20, avg#21, m2#22, sum#23, count#24] +Arguments: hashpartitioning(w_warehouse_name#9, w_warehouse_sk#8, i_item_sk#6, d_moy#13, 5), ENSURE_REQUIREMENTS, [id=#25] + +(25) HashAggregate [codegen id : 10] +Input [9]: [w_warehouse_name#9, w_warehouse_sk#8, i_item_sk#6, d_moy#13, n#20, avg#21, m2#22, sum#23, count#24] +Keys [4]: [w_warehouse_name#9, w_warehouse_sk#8, i_item_sk#6, d_moy#13] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#3 as double)), avg(inv_quantity_on_hand#3)] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#3 as double))#26, avg(inv_quantity_on_hand#3)#27] +Results [5]: [w_warehouse_sk#8, i_item_sk#6, d_moy#13, stddev_samp(cast(inv_quantity_on_hand#3 as double))#26 AS stdev#28, avg(inv_quantity_on_hand#3)#27 AS mean#29] + +(26) Filter [codegen id : 10] +Input [5]: [w_warehouse_sk#8, i_item_sk#6, d_moy#13, stdev#28, mean#29] +Condition : ((isnotnull(mean#29) AND isnotnull(stdev#28)) AND ((NOT (mean#29 = 0.0) AND ((stdev#28 / mean#29) > 1.0)) AND ((stdev#28 / mean#29) > 1.5))) + +(27) Project [codegen id : 10] +Output [5]: [w_warehouse_sk#8, i_item_sk#6, d_moy#13, mean#29, CASE WHEN (mean#29 = 0.0) THEN null ELSE (stdev#28 / mean#29) END AS cov#30] +Input [5]: [w_warehouse_sk#8, i_item_sk#6, d_moy#13, stdev#28, mean#29] + +(28) Scan parquet default.inventory +Output [4]: [inv_item_sk#31, inv_warehouse_sk#32, inv_quantity_on_hand#33, inv_date_sk#34] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#34), dynamicpruningexpression(inv_date_sk#34 IN dynamicpruning#35)] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 8] +Input [4]: [inv_item_sk#31, inv_warehouse_sk#32, inv_quantity_on_hand#33, inv_date_sk#34] + +(30) Filter [codegen id : 8] +Input [4]: [inv_item_sk#31, inv_warehouse_sk#32, inv_quantity_on_hand#33, inv_date_sk#34] +Condition : (isnotnull(inv_item_sk#31) AND isnotnull(inv_warehouse_sk#32)) + +(31) ReusedExchange [Reuses operator id: 7] +Output [1]: [i_item_sk#36] + +(32) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [inv_item_sk#31] +Right keys [1]: [i_item_sk#36] +Join condition: None + +(33) Project [codegen id : 8] +Output [4]: [inv_warehouse_sk#32, inv_quantity_on_hand#33, inv_date_sk#34, i_item_sk#36] +Input [5]: [inv_item_sk#31, inv_warehouse_sk#32, inv_quantity_on_hand#33, inv_date_sk#34, i_item_sk#36] + +(34) ReusedExchange [Reuses operator id: 13] +Output [2]: [w_warehouse_sk#37, w_warehouse_name#38] + +(35) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [inv_warehouse_sk#32] +Right keys [1]: [w_warehouse_sk#37] +Join condition: None + +(36) Project [codegen id : 8] +Output [5]: [inv_quantity_on_hand#33, inv_date_sk#34, i_item_sk#36, w_warehouse_sk#37, w_warehouse_name#38] +Input [6]: [inv_warehouse_sk#32, inv_quantity_on_hand#33, inv_date_sk#34, i_item_sk#36, w_warehouse_sk#37, w_warehouse_name#38] + +(37) Scan parquet default.date_dim +Output [3]: [d_date_sk#39, d_year#40, d_moy#41] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,2), IsNotNull(d_date_sk)] +ReadSchema: struct + +(38) ColumnarToRow [codegen id : 7] +Input [3]: [d_date_sk#39, d_year#40, d_moy#41] + +(39) Filter [codegen id : 7] +Input [3]: [d_date_sk#39, d_year#40, d_moy#41] +Condition : ((((isnotnull(d_year#40) AND isnotnull(d_moy#41)) AND (d_year#40 = 2001)) AND (d_moy#41 = 2)) AND isnotnull(d_date_sk#39)) + +(40) Project [codegen id : 7] +Output [2]: [d_date_sk#39, d_moy#41] +Input [3]: [d_date_sk#39, d_year#40, d_moy#41] + +(41) BroadcastExchange +Input [2]: [d_date_sk#39, d_moy#41] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#42] + +(42) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [inv_date_sk#34] +Right keys [1]: [d_date_sk#39] +Join condition: None + +(43) Project [codegen id : 8] +Output [5]: [inv_quantity_on_hand#33, i_item_sk#36, w_warehouse_sk#37, w_warehouse_name#38, d_moy#41] +Input [7]: [inv_quantity_on_hand#33, inv_date_sk#34, i_item_sk#36, w_warehouse_sk#37, w_warehouse_name#38, d_date_sk#39, d_moy#41] + +(44) HashAggregate [codegen id : 8] +Input [5]: [inv_quantity_on_hand#33, i_item_sk#36, w_warehouse_sk#37, w_warehouse_name#38, d_moy#41] +Keys [4]: [w_warehouse_name#38, w_warehouse_sk#37, i_item_sk#36, d_moy#41] +Functions [2]: [partial_stddev_samp(cast(inv_quantity_on_hand#33 as double)), partial_avg(inv_quantity_on_hand#33)] +Aggregate Attributes [5]: [n#43, avg#44, m2#45, sum#46, count#47] +Results [9]: [w_warehouse_name#38, w_warehouse_sk#37, i_item_sk#36, d_moy#41, n#48, avg#49, m2#50, sum#51, count#52] + +(45) Exchange +Input [9]: [w_warehouse_name#38, w_warehouse_sk#37, i_item_sk#36, d_moy#41, n#48, avg#49, m2#50, sum#51, count#52] +Arguments: hashpartitioning(w_warehouse_name#38, w_warehouse_sk#37, i_item_sk#36, d_moy#41, 5), ENSURE_REQUIREMENTS, [id=#53] + +(46) HashAggregate [codegen id : 9] +Input [9]: [w_warehouse_name#38, w_warehouse_sk#37, i_item_sk#36, d_moy#41, n#48, avg#49, m2#50, sum#51, count#52] +Keys [4]: [w_warehouse_name#38, w_warehouse_sk#37, i_item_sk#36, d_moy#41] +Functions [2]: [stddev_samp(cast(inv_quantity_on_hand#33 as double)), avg(inv_quantity_on_hand#33)] +Aggregate Attributes [2]: [stddev_samp(cast(inv_quantity_on_hand#33 as double))#54, avg(inv_quantity_on_hand#33)#55] +Results [5]: [w_warehouse_sk#37, i_item_sk#36, d_moy#41, stddev_samp(cast(inv_quantity_on_hand#33 as double))#54 AS stdev#56, avg(inv_quantity_on_hand#33)#55 AS mean#57] + +(47) Filter [codegen id : 9] +Input [5]: [w_warehouse_sk#37, i_item_sk#36, d_moy#41, stdev#56, mean#57] +Condition : ((isnotnull(mean#57) AND isnotnull(stdev#56)) AND (NOT (mean#57 = 0.0) AND ((stdev#56 / mean#57) > 1.0))) + +(48) Project [codegen id : 9] +Output [5]: [w_warehouse_sk#37, i_item_sk#36, d_moy#41, mean#57, CASE WHEN (mean#57 = 0.0) THEN null ELSE (stdev#56 / mean#57) END AS cov#58] +Input [5]: [w_warehouse_sk#37, i_item_sk#36, d_moy#41, stdev#56, mean#57] + +(49) BroadcastExchange +Input [5]: [w_warehouse_sk#37, i_item_sk#36, d_moy#41, mean#57, cov#58] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [id=#59] + +(50) BroadcastHashJoin [codegen id : 10] +Left keys [2]: [i_item_sk#6, w_warehouse_sk#8] +Right keys [2]: [i_item_sk#36, w_warehouse_sk#37] +Join condition: None + +(51) Exchange +Input [10]: [w_warehouse_sk#8, i_item_sk#6, d_moy#13, mean#29, cov#30, w_warehouse_sk#37, i_item_sk#36, d_moy#41, mean#57, cov#58] +Arguments: rangepartitioning(w_warehouse_sk#8 ASC NULLS FIRST, i_item_sk#6 ASC NULLS FIRST, d_moy#13 ASC NULLS FIRST, mean#29 ASC NULLS FIRST, cov#30 ASC NULLS FIRST, d_moy#41 ASC NULLS FIRST, mean#57 ASC NULLS FIRST, cov#58 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#60] + +(52) Sort [codegen id : 11] +Input [10]: [w_warehouse_sk#8, i_item_sk#6, d_moy#13, mean#29, cov#30, w_warehouse_sk#37, i_item_sk#36, d_moy#41, mean#57, cov#58] +Arguments: [w_warehouse_sk#8 ASC NULLS FIRST, i_item_sk#6 ASC NULLS FIRST, d_moy#13 ASC NULLS FIRST, mean#29 ASC NULLS FIRST, cov#30 ASC NULLS FIRST, d_moy#41 ASC NULLS FIRST, mean#57 ASC NULLS FIRST, cov#58 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5 +ReusedExchange (53) + + +(53) ReusedExchange [Reuses operator id: 20] +Output [2]: [d_date_sk#11, d_moy#13] + +Subquery:2 Hosting operator id = 28 Hosting Expression = inv_date_sk#34 IN dynamicpruning#35 +ReusedExchange (54) + + +(54) ReusedExchange [Reuses operator id: 41] +Output [2]: [d_date_sk#39, d_moy#41] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b/simplified.txt new file mode 100644 index 0000000000000..ecd1313c1f5e1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q39b/simplified.txt @@ -0,0 +1,81 @@ +WholeStageCodegen (11) + Sort [w_warehouse_sk,i_item_sk,d_moy,mean,cov,d_moy,mean,cov] + InputAdapter + Exchange [w_warehouse_sk,i_item_sk,d_moy,mean,cov,d_moy,mean,cov] #1 + WholeStageCodegen (10) + BroadcastHashJoin [i_item_sk,w_warehouse_sk,i_item_sk,w_warehouse_sk] + Project [w_warehouse_sk,i_item_sk,d_moy,mean,stdev] + Filter [mean,stdev] + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,n,avg,m2,sum,count] [stddev_samp(cast(inv_quantity_on_hand as double)),avg(inv_quantity_on_hand),stdev,mean,n,avg,m2,sum,count] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy] #2 + WholeStageCodegen (4) + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] + Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [inv_quantity_on_hand,inv_date_sk,i_item_sk,w_warehouse_sk,w_warehouse_name] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk,i_item_sk] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Filter [inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_moy] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (3) + Project [d_date_sk,d_moy] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (9) + Project [w_warehouse_sk,i_item_sk,d_moy,mean,stdev] + Filter [mean,stdev] + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,n,avg,m2,sum,count] [stddev_samp(cast(inv_quantity_on_hand as double)),avg(inv_quantity_on_hand),stdev,mean,n,avg,m2,sum,count] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy] #7 + WholeStageCodegen (8) + HashAggregate [w_warehouse_name,w_warehouse_sk,i_item_sk,d_moy,inv_quantity_on_hand] [n,avg,m2,sum,count,n,avg,m2,sum,count] + Project [inv_quantity_on_hand,i_item_sk,w_warehouse_sk,w_warehouse_name,d_moy] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [inv_quantity_on_hand,inv_date_sk,i_item_sk,w_warehouse_sk,w_warehouse_name] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk,i_item_sk] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Filter [inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_moy] #8 + InputAdapter + ReusedExchange [i_item_sk] #4 + InputAdapter + ReusedExchange [w_warehouse_sk,w_warehouse_name] #5 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (7) + Project [d_date_sk,d_moy] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt new file mode 100644 index 0000000000000..ce8b8bed5a26e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/explain.txt @@ -0,0 +1,726 @@ +== Physical Plan == +TakeOrderedAndProject (126) ++- * Project (125) + +- * SortMergeJoin Inner (124) + :- * Project (106) + : +- * SortMergeJoin Inner (105) + : :- * Project (85) + : : +- * SortMergeJoin Inner (84) + : : :- * Project (66) + : : : +- * SortMergeJoin Inner (65) + : : : :- * SortMergeJoin Inner (45) + : : : : :- * Sort (24) + : : : : : +- Exchange (23) + : : : : : +- * Filter (22) + : : : : : +- * HashAggregate (21) + : : : : : +- Exchange (20) + : : : : : +- * HashAggregate (19) + : : : : : +- * Project (18) + : : : : : +- * SortMergeJoin Inner (17) + : : : : : :- * Sort (11) + : : : : : : +- Exchange (10) + : : : : : : +- * Project (9) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : +- BroadcastExchange (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.date_dim (4) + : : : : : +- * Sort (16) + : : : : : +- Exchange (15) + : : : : : +- * Filter (14) + : : : : : +- * ColumnarToRow (13) + : : : : : +- Scan parquet default.customer (12) + : : : : +- * Sort (44) + : : : : +- Exchange (43) + : : : : +- * HashAggregate (42) + : : : : +- Exchange (41) + : : : : +- * HashAggregate (40) + : : : : +- * Project (39) + : : : : +- * SortMergeJoin Inner (38) + : : : : :- * Sort (35) + : : : : : +- Exchange (34) + : : : : : +- * Project (33) + : : : : : +- * BroadcastHashJoin Inner BuildRight (32) + : : : : : :- * Filter (27) + : : : : : : +- * ColumnarToRow (26) + : : : : : : +- Scan parquet default.store_sales (25) + : : : : : +- BroadcastExchange (31) + : : : : : +- * Filter (30) + : : : : : +- * ColumnarToRow (29) + : : : : : +- Scan parquet default.date_dim (28) + : : : : +- * Sort (37) + : : : : +- ReusedExchange (36) + : : : +- * Sort (64) + : : : +- Exchange (63) + : : : +- * Project (62) + : : : +- * Filter (61) + : : : +- * HashAggregate (60) + : : : +- Exchange (59) + : : : +- * HashAggregate (58) + : : : +- * Project (57) + : : : +- * SortMergeJoin Inner (56) + : : : :- * Sort (53) + : : : : +- Exchange (52) + : : : : +- * Project (51) + : : : : +- * BroadcastHashJoin Inner BuildRight (50) + : : : : :- * Filter (48) + : : : : : +- * ColumnarToRow (47) + : : : : : +- Scan parquet default.catalog_sales (46) + : : : : +- ReusedExchange (49) + : : : +- * Sort (55) + : : : +- ReusedExchange (54) + : : +- * Sort (83) + : : +- Exchange (82) + : : +- * HashAggregate (81) + : : +- Exchange (80) + : : +- * HashAggregate (79) + : : +- * Project (78) + : : +- * SortMergeJoin Inner (77) + : : :- * Sort (74) + : : : +- Exchange (73) + : : : +- * Project (72) + : : : +- * BroadcastHashJoin Inner BuildRight (71) + : : : :- * Filter (69) + : : : : +- * ColumnarToRow (68) + : : : : +- Scan parquet default.catalog_sales (67) + : : : +- ReusedExchange (70) + : : +- * Sort (76) + : : +- ReusedExchange (75) + : +- * Sort (104) + : +- Exchange (103) + : +- * Project (102) + : +- * Filter (101) + : +- * HashAggregate (100) + : +- Exchange (99) + : +- * HashAggregate (98) + : +- * Project (97) + : +- * SortMergeJoin Inner (96) + : :- * Sort (93) + : : +- Exchange (92) + : : +- * Project (91) + : : +- * BroadcastHashJoin Inner BuildRight (90) + : : :- * Filter (88) + : : : +- * ColumnarToRow (87) + : : : +- Scan parquet default.web_sales (86) + : : +- ReusedExchange (89) + : +- * Sort (95) + : +- ReusedExchange (94) + +- * Sort (123) + +- Exchange (122) + +- * HashAggregate (121) + +- Exchange (120) + +- * HashAggregate (119) + +- * Project (118) + +- * SortMergeJoin Inner (117) + :- * Sort (114) + : +- Exchange (113) + : +- * Project (112) + : +- * BroadcastHashJoin Inner BuildRight (111) + : :- * Filter (109) + : : +- * ColumnarToRow (108) + : : +- Scan parquet default.web_sales (107) + : +- ReusedExchange (110) + +- * Sort (116) + +- ReusedExchange (115) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_sales_price#3, ss_ext_wholesale_cost#4, ss_ext_list_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [6]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_sales_price#3, ss_ext_wholesale_cost#4, ss_ext_list_price#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 2] +Input [6]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_sales_price#3, ss_ext_wholesale_cost#4, ss_ext_list_price#5, ss_sold_date_sk#6] +Condition : isnotnull(ss_customer_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#8, d_year#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#8, d_year#9] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#8, d_year#9] +Condition : ((isnotnull(d_year#9) AND (d_year#9 = 2001)) AND isnotnull(d_date_sk#8)) + +(7) BroadcastExchange +Input [2]: [d_date_sk#8, d_year#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(9) Project [codegen id : 2] +Output [6]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_sales_price#3, ss_ext_wholesale_cost#4, ss_ext_list_price#5, d_year#9] +Input [8]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_sales_price#3, ss_ext_wholesale_cost#4, ss_ext_list_price#5, ss_sold_date_sk#6, d_date_sk#8, d_year#9] + +(10) Exchange +Input [6]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_sales_price#3, ss_ext_wholesale_cost#4, ss_ext_list_price#5, d_year#9] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#11] + +(11) Sort [codegen id : 3] +Input [6]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_sales_price#3, ss_ext_wholesale_cost#4, ss_ext_list_price#5, d_year#9] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(12) Scan parquet default.customer +Output [8]: [c_customer_sk#12, c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 4] +Input [8]: [c_customer_sk#12, c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19] + +(14) Filter [codegen id : 4] +Input [8]: [c_customer_sk#12, c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19] +Condition : (isnotnull(c_customer_sk#12) AND isnotnull(c_customer_id#13)) + +(15) Exchange +Input [8]: [c_customer_sk#12, c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19] +Arguments: hashpartitioning(c_customer_sk#12, 5), ENSURE_REQUIREMENTS, [id=#20] + +(16) Sort [codegen id : 5] +Input [8]: [c_customer_sk#12, c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19] +Arguments: [c_customer_sk#12 ASC NULLS FIRST], false, 0 + +(17) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#12] +Join condition: None + +(18) Project [codegen id : 6] +Output [12]: [c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19, ss_ext_discount_amt#2, ss_ext_sales_price#3, ss_ext_wholesale_cost#4, ss_ext_list_price#5, d_year#9] +Input [14]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_sales_price#3, ss_ext_wholesale_cost#4, ss_ext_list_price#5, d_year#9, c_customer_sk#12, c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19] + +(19) HashAggregate [codegen id : 6] +Input [12]: [c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19, ss_ext_discount_amt#2, ss_ext_sales_price#3, ss_ext_wholesale_cost#4, ss_ext_list_price#5, d_year#9] +Keys [8]: [c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19, d_year#9] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#5 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#4 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#3 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#21, isEmpty#22] +Results [10]: [c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19, d_year#9, sum#23, isEmpty#24] + +(20) Exchange +Input [10]: [c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19, d_year#9, sum#23, isEmpty#24] +Arguments: hashpartitioning(c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19, d_year#9, 5), ENSURE_REQUIREMENTS, [id=#25] + +(21) HashAggregate [codegen id : 7] +Input [10]: [c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19, d_year#9, sum#23, isEmpty#24] +Keys [8]: [c_customer_id#13, c_first_name#14, c_last_name#15, c_preferred_cust_flag#16, c_birth_country#17, c_login#18, c_email_address#19, d_year#9] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#5 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#4 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#3 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#5 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#4 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#3 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#26] +Results [2]: [c_customer_id#13 AS customer_id#27, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#5 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#4 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#3 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#26 AS year_total#28] + +(22) Filter [codegen id : 7] +Input [2]: [customer_id#27, year_total#28] +Condition : (isnotnull(year_total#28) AND (year_total#28 > 0.000000)) + +(23) Exchange +Input [2]: [customer_id#27, year_total#28] +Arguments: hashpartitioning(customer_id#27, 5), ENSURE_REQUIREMENTS, [id=#29] + +(24) Sort [codegen id : 8] +Input [2]: [customer_id#27, year_total#28] +Arguments: [customer_id#27 ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.store_sales +Output [6]: [ss_customer_sk#30, ss_ext_discount_amt#31, ss_ext_sales_price#32, ss_ext_wholesale_cost#33, ss_ext_list_price#34, ss_sold_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#35), dynamicpruningexpression(ss_sold_date_sk#35 IN dynamicpruning#36)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 10] +Input [6]: [ss_customer_sk#30, ss_ext_discount_amt#31, ss_ext_sales_price#32, ss_ext_wholesale_cost#33, ss_ext_list_price#34, ss_sold_date_sk#35] + +(27) Filter [codegen id : 10] +Input [6]: [ss_customer_sk#30, ss_ext_discount_amt#31, ss_ext_sales_price#32, ss_ext_wholesale_cost#33, ss_ext_list_price#34, ss_sold_date_sk#35] +Condition : isnotnull(ss_customer_sk#30) + +(28) Scan parquet default.date_dim +Output [2]: [d_date_sk#37, d_year#38] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#37, d_year#38] + +(30) Filter [codegen id : 9] +Input [2]: [d_date_sk#37, d_year#38] +Condition : ((isnotnull(d_year#38) AND (d_year#38 = 2002)) AND isnotnull(d_date_sk#37)) + +(31) BroadcastExchange +Input [2]: [d_date_sk#37, d_year#38] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#39] + +(32) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#35] +Right keys [1]: [d_date_sk#37] +Join condition: None + +(33) Project [codegen id : 10] +Output [6]: [ss_customer_sk#30, ss_ext_discount_amt#31, ss_ext_sales_price#32, ss_ext_wholesale_cost#33, ss_ext_list_price#34, d_year#38] +Input [8]: [ss_customer_sk#30, ss_ext_discount_amt#31, ss_ext_sales_price#32, ss_ext_wholesale_cost#33, ss_ext_list_price#34, ss_sold_date_sk#35, d_date_sk#37, d_year#38] + +(34) Exchange +Input [6]: [ss_customer_sk#30, ss_ext_discount_amt#31, ss_ext_sales_price#32, ss_ext_wholesale_cost#33, ss_ext_list_price#34, d_year#38] +Arguments: hashpartitioning(ss_customer_sk#30, 5), ENSURE_REQUIREMENTS, [id=#40] + +(35) Sort [codegen id : 11] +Input [6]: [ss_customer_sk#30, ss_ext_discount_amt#31, ss_ext_sales_price#32, ss_ext_wholesale_cost#33, ss_ext_list_price#34, d_year#38] +Arguments: [ss_customer_sk#30 ASC NULLS FIRST], false, 0 + +(36) ReusedExchange [Reuses operator id: 15] +Output [8]: [c_customer_sk#41, c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48] + +(37) Sort [codegen id : 13] +Input [8]: [c_customer_sk#41, c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48] +Arguments: [c_customer_sk#41 ASC NULLS FIRST], false, 0 + +(38) SortMergeJoin [codegen id : 14] +Left keys [1]: [ss_customer_sk#30] +Right keys [1]: [c_customer_sk#41] +Join condition: None + +(39) Project [codegen id : 14] +Output [12]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, ss_ext_discount_amt#31, ss_ext_sales_price#32, ss_ext_wholesale_cost#33, ss_ext_list_price#34, d_year#38] +Input [14]: [ss_customer_sk#30, ss_ext_discount_amt#31, ss_ext_sales_price#32, ss_ext_wholesale_cost#33, ss_ext_list_price#34, d_year#38, c_customer_sk#41, c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48] + +(40) HashAggregate [codegen id : 14] +Input [12]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, ss_ext_discount_amt#31, ss_ext_sales_price#32, ss_ext_wholesale_cost#33, ss_ext_list_price#34, d_year#38] +Keys [8]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, d_year#38] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#34 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#33 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#31 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#32 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#49, isEmpty#50] +Results [10]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, d_year#38, sum#51, isEmpty#52] + +(41) Exchange +Input [10]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, d_year#38, sum#51, isEmpty#52] +Arguments: hashpartitioning(c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, d_year#38, 5), ENSURE_REQUIREMENTS, [id=#53] + +(42) HashAggregate [codegen id : 15] +Input [10]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, d_year#38, sum#51, isEmpty#52] +Keys [8]: [c_customer_id#42, c_first_name#43, c_last_name#44, c_preferred_cust_flag#45, c_birth_country#46, c_login#47, c_email_address#48, d_year#38] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#34 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#33 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#31 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#32 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#34 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#33 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#31 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#32 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#54] +Results [8]: [c_customer_id#42 AS customer_id#55, c_first_name#43 AS customer_first_name#56, c_last_name#44 AS customer_last_name#57, c_preferred_cust_flag#45 AS customer_preferred_cust_flag#58, c_birth_country#46 AS customer_birth_country#59, c_login#47 AS customer_login#60, c_email_address#48 AS customer_email_address#61, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#34 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#33 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#31 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#32 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#54 AS year_total#62] + +(43) Exchange +Input [8]: [customer_id#55, customer_first_name#56, customer_last_name#57, customer_preferred_cust_flag#58, customer_birth_country#59, customer_login#60, customer_email_address#61, year_total#62] +Arguments: hashpartitioning(customer_id#55, 5), ENSURE_REQUIREMENTS, [id=#63] + +(44) Sort [codegen id : 16] +Input [8]: [customer_id#55, customer_first_name#56, customer_last_name#57, customer_preferred_cust_flag#58, customer_birth_country#59, customer_login#60, customer_email_address#61, year_total#62] +Arguments: [customer_id#55 ASC NULLS FIRST], false, 0 + +(45) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#27] +Right keys [1]: [customer_id#55] +Join condition: None + +(46) Scan parquet default.catalog_sales +Output [6]: [cs_bill_customer_sk#64, cs_ext_discount_amt#65, cs_ext_sales_price#66, cs_ext_wholesale_cost#67, cs_ext_list_price#68, cs_sold_date_sk#69] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#69), dynamicpruningexpression(cs_sold_date_sk#69 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 19] +Input [6]: [cs_bill_customer_sk#64, cs_ext_discount_amt#65, cs_ext_sales_price#66, cs_ext_wholesale_cost#67, cs_ext_list_price#68, cs_sold_date_sk#69] + +(48) Filter [codegen id : 19] +Input [6]: [cs_bill_customer_sk#64, cs_ext_discount_amt#65, cs_ext_sales_price#66, cs_ext_wholesale_cost#67, cs_ext_list_price#68, cs_sold_date_sk#69] +Condition : isnotnull(cs_bill_customer_sk#64) + +(49) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#70, d_year#71] + +(50) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_sold_date_sk#69] +Right keys [1]: [d_date_sk#70] +Join condition: None + +(51) Project [codegen id : 19] +Output [6]: [cs_bill_customer_sk#64, cs_ext_discount_amt#65, cs_ext_sales_price#66, cs_ext_wholesale_cost#67, cs_ext_list_price#68, d_year#71] +Input [8]: [cs_bill_customer_sk#64, cs_ext_discount_amt#65, cs_ext_sales_price#66, cs_ext_wholesale_cost#67, cs_ext_list_price#68, cs_sold_date_sk#69, d_date_sk#70, d_year#71] + +(52) Exchange +Input [6]: [cs_bill_customer_sk#64, cs_ext_discount_amt#65, cs_ext_sales_price#66, cs_ext_wholesale_cost#67, cs_ext_list_price#68, d_year#71] +Arguments: hashpartitioning(cs_bill_customer_sk#64, 5), ENSURE_REQUIREMENTS, [id=#72] + +(53) Sort [codegen id : 20] +Input [6]: [cs_bill_customer_sk#64, cs_ext_discount_amt#65, cs_ext_sales_price#66, cs_ext_wholesale_cost#67, cs_ext_list_price#68, d_year#71] +Arguments: [cs_bill_customer_sk#64 ASC NULLS FIRST], false, 0 + +(54) ReusedExchange [Reuses operator id: 15] +Output [8]: [c_customer_sk#73, c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80] + +(55) Sort [codegen id : 22] +Input [8]: [c_customer_sk#73, c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80] +Arguments: [c_customer_sk#73 ASC NULLS FIRST], false, 0 + +(56) SortMergeJoin [codegen id : 23] +Left keys [1]: [cs_bill_customer_sk#64] +Right keys [1]: [c_customer_sk#73] +Join condition: None + +(57) Project [codegen id : 23] +Output [12]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, cs_ext_discount_amt#65, cs_ext_sales_price#66, cs_ext_wholesale_cost#67, cs_ext_list_price#68, d_year#71] +Input [14]: [cs_bill_customer_sk#64, cs_ext_discount_amt#65, cs_ext_sales_price#66, cs_ext_wholesale_cost#67, cs_ext_list_price#68, d_year#71, c_customer_sk#73, c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80] + +(58) HashAggregate [codegen id : 23] +Input [12]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, cs_ext_discount_amt#65, cs_ext_sales_price#66, cs_ext_wholesale_cost#67, cs_ext_list_price#68, d_year#71] +Keys [8]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, d_year#71] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#68 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#67 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#65 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#66 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#81, isEmpty#82] +Results [10]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, d_year#71, sum#83, isEmpty#84] + +(59) Exchange +Input [10]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, d_year#71, sum#83, isEmpty#84] +Arguments: hashpartitioning(c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, d_year#71, 5), ENSURE_REQUIREMENTS, [id=#85] + +(60) HashAggregate [codegen id : 24] +Input [10]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, d_year#71, sum#83, isEmpty#84] +Keys [8]: [c_customer_id#74, c_first_name#75, c_last_name#76, c_preferred_cust_flag#77, c_birth_country#78, c_login#79, c_email_address#80, d_year#71] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#68 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#67 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#65 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#66 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#68 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#67 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#65 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#66 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#86] +Results [2]: [c_customer_id#74 AS customer_id#87, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#68 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#67 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#65 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#66 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#86 AS year_total#88] + +(61) Filter [codegen id : 24] +Input [2]: [customer_id#87, year_total#88] +Condition : (isnotnull(year_total#88) AND (year_total#88 > 0.000000)) + +(62) Project [codegen id : 24] +Output [2]: [customer_id#87 AS customer_id#89, year_total#88 AS year_total#90] +Input [2]: [customer_id#87, year_total#88] + +(63) Exchange +Input [2]: [customer_id#89, year_total#90] +Arguments: hashpartitioning(customer_id#89, 5), ENSURE_REQUIREMENTS, [id=#91] + +(64) Sort [codegen id : 25] +Input [2]: [customer_id#89, year_total#90] +Arguments: [customer_id#89 ASC NULLS FIRST], false, 0 + +(65) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#27] +Right keys [1]: [customer_id#89] +Join condition: None + +(66) Project [codegen id : 26] +Output [11]: [customer_id#27, year_total#28, customer_id#55, customer_first_name#56, customer_last_name#57, customer_preferred_cust_flag#58, customer_birth_country#59, customer_login#60, customer_email_address#61, year_total#62, year_total#90] +Input [12]: [customer_id#27, year_total#28, customer_id#55, customer_first_name#56, customer_last_name#57, customer_preferred_cust_flag#58, customer_birth_country#59, customer_login#60, customer_email_address#61, year_total#62, customer_id#89, year_total#90] + +(67) Scan parquet default.catalog_sales +Output [6]: [cs_bill_customer_sk#92, cs_ext_discount_amt#93, cs_ext_sales_price#94, cs_ext_wholesale_cost#95, cs_ext_list_price#96, cs_sold_date_sk#97] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#97), dynamicpruningexpression(cs_sold_date_sk#97 IN dynamicpruning#36)] +PushedFilters: [IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(68) ColumnarToRow [codegen id : 28] +Input [6]: [cs_bill_customer_sk#92, cs_ext_discount_amt#93, cs_ext_sales_price#94, cs_ext_wholesale_cost#95, cs_ext_list_price#96, cs_sold_date_sk#97] + +(69) Filter [codegen id : 28] +Input [6]: [cs_bill_customer_sk#92, cs_ext_discount_amt#93, cs_ext_sales_price#94, cs_ext_wholesale_cost#95, cs_ext_list_price#96, cs_sold_date_sk#97] +Condition : isnotnull(cs_bill_customer_sk#92) + +(70) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#98, d_year#99] + +(71) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [cs_sold_date_sk#97] +Right keys [1]: [d_date_sk#98] +Join condition: None + +(72) Project [codegen id : 28] +Output [6]: [cs_bill_customer_sk#92, cs_ext_discount_amt#93, cs_ext_sales_price#94, cs_ext_wholesale_cost#95, cs_ext_list_price#96, d_year#99] +Input [8]: [cs_bill_customer_sk#92, cs_ext_discount_amt#93, cs_ext_sales_price#94, cs_ext_wholesale_cost#95, cs_ext_list_price#96, cs_sold_date_sk#97, d_date_sk#98, d_year#99] + +(73) Exchange +Input [6]: [cs_bill_customer_sk#92, cs_ext_discount_amt#93, cs_ext_sales_price#94, cs_ext_wholesale_cost#95, cs_ext_list_price#96, d_year#99] +Arguments: hashpartitioning(cs_bill_customer_sk#92, 5), ENSURE_REQUIREMENTS, [id=#100] + +(74) Sort [codegen id : 29] +Input [6]: [cs_bill_customer_sk#92, cs_ext_discount_amt#93, cs_ext_sales_price#94, cs_ext_wholesale_cost#95, cs_ext_list_price#96, d_year#99] +Arguments: [cs_bill_customer_sk#92 ASC NULLS FIRST], false, 0 + +(75) ReusedExchange [Reuses operator id: 15] +Output [8]: [c_customer_sk#101, c_customer_id#102, c_first_name#103, c_last_name#104, c_preferred_cust_flag#105, c_birth_country#106, c_login#107, c_email_address#108] + +(76) Sort [codegen id : 31] +Input [8]: [c_customer_sk#101, c_customer_id#102, c_first_name#103, c_last_name#104, c_preferred_cust_flag#105, c_birth_country#106, c_login#107, c_email_address#108] +Arguments: [c_customer_sk#101 ASC NULLS FIRST], false, 0 + +(77) SortMergeJoin [codegen id : 32] +Left keys [1]: [cs_bill_customer_sk#92] +Right keys [1]: [c_customer_sk#101] +Join condition: None + +(78) Project [codegen id : 32] +Output [12]: [c_customer_id#102, c_first_name#103, c_last_name#104, c_preferred_cust_flag#105, c_birth_country#106, c_login#107, c_email_address#108, cs_ext_discount_amt#93, cs_ext_sales_price#94, cs_ext_wholesale_cost#95, cs_ext_list_price#96, d_year#99] +Input [14]: [cs_bill_customer_sk#92, cs_ext_discount_amt#93, cs_ext_sales_price#94, cs_ext_wholesale_cost#95, cs_ext_list_price#96, d_year#99, c_customer_sk#101, c_customer_id#102, c_first_name#103, c_last_name#104, c_preferred_cust_flag#105, c_birth_country#106, c_login#107, c_email_address#108] + +(79) HashAggregate [codegen id : 32] +Input [12]: [c_customer_id#102, c_first_name#103, c_last_name#104, c_preferred_cust_flag#105, c_birth_country#106, c_login#107, c_email_address#108, cs_ext_discount_amt#93, cs_ext_sales_price#94, cs_ext_wholesale_cost#95, cs_ext_list_price#96, d_year#99] +Keys [8]: [c_customer_id#102, c_first_name#103, c_last_name#104, c_preferred_cust_flag#105, c_birth_country#106, c_login#107, c_email_address#108, d_year#99] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#96 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#95 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#93 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#94 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#109, isEmpty#110] +Results [10]: [c_customer_id#102, c_first_name#103, c_last_name#104, c_preferred_cust_flag#105, c_birth_country#106, c_login#107, c_email_address#108, d_year#99, sum#111, isEmpty#112] + +(80) Exchange +Input [10]: [c_customer_id#102, c_first_name#103, c_last_name#104, c_preferred_cust_flag#105, c_birth_country#106, c_login#107, c_email_address#108, d_year#99, sum#111, isEmpty#112] +Arguments: hashpartitioning(c_customer_id#102, c_first_name#103, c_last_name#104, c_preferred_cust_flag#105, c_birth_country#106, c_login#107, c_email_address#108, d_year#99, 5), ENSURE_REQUIREMENTS, [id=#113] + +(81) HashAggregate [codegen id : 33] +Input [10]: [c_customer_id#102, c_first_name#103, c_last_name#104, c_preferred_cust_flag#105, c_birth_country#106, c_login#107, c_email_address#108, d_year#99, sum#111, isEmpty#112] +Keys [8]: [c_customer_id#102, c_first_name#103, c_last_name#104, c_preferred_cust_flag#105, c_birth_country#106, c_login#107, c_email_address#108, d_year#99] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#96 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#95 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#93 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#94 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#96 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#95 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#93 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#94 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#114] +Results [2]: [c_customer_id#102 AS customer_id#115, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#96 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#95 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#93 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#94 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#114 AS year_total#116] + +(82) Exchange +Input [2]: [customer_id#115, year_total#116] +Arguments: hashpartitioning(customer_id#115, 5), ENSURE_REQUIREMENTS, [id=#117] + +(83) Sort [codegen id : 34] +Input [2]: [customer_id#115, year_total#116] +Arguments: [customer_id#115 ASC NULLS FIRST], false, 0 + +(84) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#27] +Right keys [1]: [customer_id#115] +Join condition: (CASE WHEN (year_total#90 > 0.000000) THEN CheckOverflow((promote_precision(year_total#116) / promote_precision(year_total#90)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#28 > 0.000000) THEN CheckOverflow((promote_precision(year_total#62) / promote_precision(year_total#28)), DecimalType(38,14), true) ELSE null END) + +(85) Project [codegen id : 35] +Output [10]: [customer_id#27, customer_id#55, customer_first_name#56, customer_last_name#57, customer_preferred_cust_flag#58, customer_birth_country#59, customer_login#60, customer_email_address#61, year_total#90, year_total#116] +Input [13]: [customer_id#27, year_total#28, customer_id#55, customer_first_name#56, customer_last_name#57, customer_preferred_cust_flag#58, customer_birth_country#59, customer_login#60, customer_email_address#61, year_total#62, year_total#90, customer_id#115, year_total#116] + +(86) Scan parquet default.web_sales +Output [6]: [ws_bill_customer_sk#118, ws_ext_discount_amt#119, ws_ext_sales_price#120, ws_ext_wholesale_cost#121, ws_ext_list_price#122, ws_sold_date_sk#123] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#123), dynamicpruningexpression(ws_sold_date_sk#123 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(87) ColumnarToRow [codegen id : 37] +Input [6]: [ws_bill_customer_sk#118, ws_ext_discount_amt#119, ws_ext_sales_price#120, ws_ext_wholesale_cost#121, ws_ext_list_price#122, ws_sold_date_sk#123] + +(88) Filter [codegen id : 37] +Input [6]: [ws_bill_customer_sk#118, ws_ext_discount_amt#119, ws_ext_sales_price#120, ws_ext_wholesale_cost#121, ws_ext_list_price#122, ws_sold_date_sk#123] +Condition : isnotnull(ws_bill_customer_sk#118) + +(89) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#124, d_year#125] + +(90) BroadcastHashJoin [codegen id : 37] +Left keys [1]: [ws_sold_date_sk#123] +Right keys [1]: [d_date_sk#124] +Join condition: None + +(91) Project [codegen id : 37] +Output [6]: [ws_bill_customer_sk#118, ws_ext_discount_amt#119, ws_ext_sales_price#120, ws_ext_wholesale_cost#121, ws_ext_list_price#122, d_year#125] +Input [8]: [ws_bill_customer_sk#118, ws_ext_discount_amt#119, ws_ext_sales_price#120, ws_ext_wholesale_cost#121, ws_ext_list_price#122, ws_sold_date_sk#123, d_date_sk#124, d_year#125] + +(92) Exchange +Input [6]: [ws_bill_customer_sk#118, ws_ext_discount_amt#119, ws_ext_sales_price#120, ws_ext_wholesale_cost#121, ws_ext_list_price#122, d_year#125] +Arguments: hashpartitioning(ws_bill_customer_sk#118, 5), ENSURE_REQUIREMENTS, [id=#126] + +(93) Sort [codegen id : 38] +Input [6]: [ws_bill_customer_sk#118, ws_ext_discount_amt#119, ws_ext_sales_price#120, ws_ext_wholesale_cost#121, ws_ext_list_price#122, d_year#125] +Arguments: [ws_bill_customer_sk#118 ASC NULLS FIRST], false, 0 + +(94) ReusedExchange [Reuses operator id: 15] +Output [8]: [c_customer_sk#127, c_customer_id#128, c_first_name#129, c_last_name#130, c_preferred_cust_flag#131, c_birth_country#132, c_login#133, c_email_address#134] + +(95) Sort [codegen id : 40] +Input [8]: [c_customer_sk#127, c_customer_id#128, c_first_name#129, c_last_name#130, c_preferred_cust_flag#131, c_birth_country#132, c_login#133, c_email_address#134] +Arguments: [c_customer_sk#127 ASC NULLS FIRST], false, 0 + +(96) SortMergeJoin [codegen id : 41] +Left keys [1]: [ws_bill_customer_sk#118] +Right keys [1]: [c_customer_sk#127] +Join condition: None + +(97) Project [codegen id : 41] +Output [12]: [c_customer_id#128, c_first_name#129, c_last_name#130, c_preferred_cust_flag#131, c_birth_country#132, c_login#133, c_email_address#134, ws_ext_discount_amt#119, ws_ext_sales_price#120, ws_ext_wholesale_cost#121, ws_ext_list_price#122, d_year#125] +Input [14]: [ws_bill_customer_sk#118, ws_ext_discount_amt#119, ws_ext_sales_price#120, ws_ext_wholesale_cost#121, ws_ext_list_price#122, d_year#125, c_customer_sk#127, c_customer_id#128, c_first_name#129, c_last_name#130, c_preferred_cust_flag#131, c_birth_country#132, c_login#133, c_email_address#134] + +(98) HashAggregate [codegen id : 41] +Input [12]: [c_customer_id#128, c_first_name#129, c_last_name#130, c_preferred_cust_flag#131, c_birth_country#132, c_login#133, c_email_address#134, ws_ext_discount_amt#119, ws_ext_sales_price#120, ws_ext_wholesale_cost#121, ws_ext_list_price#122, d_year#125] +Keys [8]: [c_customer_id#128, c_first_name#129, c_last_name#130, c_preferred_cust_flag#131, c_birth_country#132, c_login#133, c_email_address#134, d_year#125] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#122 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#121 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#119 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#120 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#135, isEmpty#136] +Results [10]: [c_customer_id#128, c_first_name#129, c_last_name#130, c_preferred_cust_flag#131, c_birth_country#132, c_login#133, c_email_address#134, d_year#125, sum#137, isEmpty#138] + +(99) Exchange +Input [10]: [c_customer_id#128, c_first_name#129, c_last_name#130, c_preferred_cust_flag#131, c_birth_country#132, c_login#133, c_email_address#134, d_year#125, sum#137, isEmpty#138] +Arguments: hashpartitioning(c_customer_id#128, c_first_name#129, c_last_name#130, c_preferred_cust_flag#131, c_birth_country#132, c_login#133, c_email_address#134, d_year#125, 5), ENSURE_REQUIREMENTS, [id=#139] + +(100) HashAggregate [codegen id : 42] +Input [10]: [c_customer_id#128, c_first_name#129, c_last_name#130, c_preferred_cust_flag#131, c_birth_country#132, c_login#133, c_email_address#134, d_year#125, sum#137, isEmpty#138] +Keys [8]: [c_customer_id#128, c_first_name#129, c_last_name#130, c_preferred_cust_flag#131, c_birth_country#132, c_login#133, c_email_address#134, d_year#125] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#122 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#121 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#119 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#120 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#122 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#121 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#119 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#120 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#140] +Results [2]: [c_customer_id#128 AS customer_id#141, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#122 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#121 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#119 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#120 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#140 AS year_total#142] + +(101) Filter [codegen id : 42] +Input [2]: [customer_id#141, year_total#142] +Condition : (isnotnull(year_total#142) AND (year_total#142 > 0.000000)) + +(102) Project [codegen id : 42] +Output [2]: [customer_id#141 AS customer_id#143, year_total#142 AS year_total#144] +Input [2]: [customer_id#141, year_total#142] + +(103) Exchange +Input [2]: [customer_id#143, year_total#144] +Arguments: hashpartitioning(customer_id#143, 5), ENSURE_REQUIREMENTS, [id=#145] + +(104) Sort [codegen id : 43] +Input [2]: [customer_id#143, year_total#144] +Arguments: [customer_id#143 ASC NULLS FIRST], false, 0 + +(105) SortMergeJoin [codegen id : 44] +Left keys [1]: [customer_id#27] +Right keys [1]: [customer_id#143] +Join condition: None + +(106) Project [codegen id : 44] +Output [11]: [customer_id#27, customer_id#55, customer_first_name#56, customer_last_name#57, customer_preferred_cust_flag#58, customer_birth_country#59, customer_login#60, customer_email_address#61, year_total#90, year_total#116, year_total#144] +Input [12]: [customer_id#27, customer_id#55, customer_first_name#56, customer_last_name#57, customer_preferred_cust_flag#58, customer_birth_country#59, customer_login#60, customer_email_address#61, year_total#90, year_total#116, customer_id#143, year_total#144] + +(107) Scan parquet default.web_sales +Output [6]: [ws_bill_customer_sk#146, ws_ext_discount_amt#147, ws_ext_sales_price#148, ws_ext_wholesale_cost#149, ws_ext_list_price#150, ws_sold_date_sk#151] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#151), dynamicpruningexpression(ws_sold_date_sk#151 IN dynamicpruning#36)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(108) ColumnarToRow [codegen id : 46] +Input [6]: [ws_bill_customer_sk#146, ws_ext_discount_amt#147, ws_ext_sales_price#148, ws_ext_wholesale_cost#149, ws_ext_list_price#150, ws_sold_date_sk#151] + +(109) Filter [codegen id : 46] +Input [6]: [ws_bill_customer_sk#146, ws_ext_discount_amt#147, ws_ext_sales_price#148, ws_ext_wholesale_cost#149, ws_ext_list_price#150, ws_sold_date_sk#151] +Condition : isnotnull(ws_bill_customer_sk#146) + +(110) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#152, d_year#153] + +(111) BroadcastHashJoin [codegen id : 46] +Left keys [1]: [ws_sold_date_sk#151] +Right keys [1]: [d_date_sk#152] +Join condition: None + +(112) Project [codegen id : 46] +Output [6]: [ws_bill_customer_sk#146, ws_ext_discount_amt#147, ws_ext_sales_price#148, ws_ext_wholesale_cost#149, ws_ext_list_price#150, d_year#153] +Input [8]: [ws_bill_customer_sk#146, ws_ext_discount_amt#147, ws_ext_sales_price#148, ws_ext_wholesale_cost#149, ws_ext_list_price#150, ws_sold_date_sk#151, d_date_sk#152, d_year#153] + +(113) Exchange +Input [6]: [ws_bill_customer_sk#146, ws_ext_discount_amt#147, ws_ext_sales_price#148, ws_ext_wholesale_cost#149, ws_ext_list_price#150, d_year#153] +Arguments: hashpartitioning(ws_bill_customer_sk#146, 5), ENSURE_REQUIREMENTS, [id=#154] + +(114) Sort [codegen id : 47] +Input [6]: [ws_bill_customer_sk#146, ws_ext_discount_amt#147, ws_ext_sales_price#148, ws_ext_wholesale_cost#149, ws_ext_list_price#150, d_year#153] +Arguments: [ws_bill_customer_sk#146 ASC NULLS FIRST], false, 0 + +(115) ReusedExchange [Reuses operator id: 15] +Output [8]: [c_customer_sk#155, c_customer_id#156, c_first_name#157, c_last_name#158, c_preferred_cust_flag#159, c_birth_country#160, c_login#161, c_email_address#162] + +(116) Sort [codegen id : 49] +Input [8]: [c_customer_sk#155, c_customer_id#156, c_first_name#157, c_last_name#158, c_preferred_cust_flag#159, c_birth_country#160, c_login#161, c_email_address#162] +Arguments: [c_customer_sk#155 ASC NULLS FIRST], false, 0 + +(117) SortMergeJoin [codegen id : 50] +Left keys [1]: [ws_bill_customer_sk#146] +Right keys [1]: [c_customer_sk#155] +Join condition: None + +(118) Project [codegen id : 50] +Output [12]: [c_customer_id#156, c_first_name#157, c_last_name#158, c_preferred_cust_flag#159, c_birth_country#160, c_login#161, c_email_address#162, ws_ext_discount_amt#147, ws_ext_sales_price#148, ws_ext_wholesale_cost#149, ws_ext_list_price#150, d_year#153] +Input [14]: [ws_bill_customer_sk#146, ws_ext_discount_amt#147, ws_ext_sales_price#148, ws_ext_wholesale_cost#149, ws_ext_list_price#150, d_year#153, c_customer_sk#155, c_customer_id#156, c_first_name#157, c_last_name#158, c_preferred_cust_flag#159, c_birth_country#160, c_login#161, c_email_address#162] + +(119) HashAggregate [codegen id : 50] +Input [12]: [c_customer_id#156, c_first_name#157, c_last_name#158, c_preferred_cust_flag#159, c_birth_country#160, c_login#161, c_email_address#162, ws_ext_discount_amt#147, ws_ext_sales_price#148, ws_ext_wholesale_cost#149, ws_ext_list_price#150, d_year#153] +Keys [8]: [c_customer_id#156, c_first_name#157, c_last_name#158, c_preferred_cust_flag#159, c_birth_country#160, c_login#161, c_email_address#162, d_year#153] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#150 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#149 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#147 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#148 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#163, isEmpty#164] +Results [10]: [c_customer_id#156, c_first_name#157, c_last_name#158, c_preferred_cust_flag#159, c_birth_country#160, c_login#161, c_email_address#162, d_year#153, sum#165, isEmpty#166] + +(120) Exchange +Input [10]: [c_customer_id#156, c_first_name#157, c_last_name#158, c_preferred_cust_flag#159, c_birth_country#160, c_login#161, c_email_address#162, d_year#153, sum#165, isEmpty#166] +Arguments: hashpartitioning(c_customer_id#156, c_first_name#157, c_last_name#158, c_preferred_cust_flag#159, c_birth_country#160, c_login#161, c_email_address#162, d_year#153, 5), ENSURE_REQUIREMENTS, [id=#167] + +(121) HashAggregate [codegen id : 51] +Input [10]: [c_customer_id#156, c_first_name#157, c_last_name#158, c_preferred_cust_flag#159, c_birth_country#160, c_login#161, c_email_address#162, d_year#153, sum#165, isEmpty#166] +Keys [8]: [c_customer_id#156, c_first_name#157, c_last_name#158, c_preferred_cust_flag#159, c_birth_country#160, c_login#161, c_email_address#162, d_year#153] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#150 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#149 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#147 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#148 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#150 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#149 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#147 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#148 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#168] +Results [2]: [c_customer_id#156 AS customer_id#169, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#150 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#149 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#147 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#148 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#168 AS year_total#170] + +(122) Exchange +Input [2]: [customer_id#169, year_total#170] +Arguments: hashpartitioning(customer_id#169, 5), ENSURE_REQUIREMENTS, [id=#171] + +(123) Sort [codegen id : 52] +Input [2]: [customer_id#169, year_total#170] +Arguments: [customer_id#169 ASC NULLS FIRST], false, 0 + +(124) SortMergeJoin [codegen id : 53] +Left keys [1]: [customer_id#27] +Right keys [1]: [customer_id#169] +Join condition: (CASE WHEN (year_total#90 > 0.000000) THEN CheckOverflow((promote_precision(year_total#116) / promote_precision(year_total#90)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#144 > 0.000000) THEN CheckOverflow((promote_precision(year_total#170) / promote_precision(year_total#144)), DecimalType(38,14), true) ELSE null END) + +(125) Project [codegen id : 53] +Output [7]: [customer_id#55, customer_first_name#56, customer_last_name#57, customer_preferred_cust_flag#58, customer_birth_country#59, customer_login#60, customer_email_address#61] +Input [13]: [customer_id#27, customer_id#55, customer_first_name#56, customer_last_name#57, customer_preferred_cust_flag#58, customer_birth_country#59, customer_login#60, customer_email_address#61, year_total#90, year_total#116, year_total#144, customer_id#169, year_total#170] + +(126) TakeOrderedAndProject +Input [7]: [customer_id#55, customer_first_name#56, customer_last_name#57, customer_preferred_cust_flag#58, customer_birth_country#59, customer_login#60, customer_email_address#61] +Arguments: 100, [customer_id#55 ASC NULLS FIRST, customer_first_name#56 ASC NULLS FIRST, customer_last_name#57 ASC NULLS FIRST, customer_preferred_cust_flag#58 ASC NULLS FIRST, customer_birth_country#59 ASC NULLS FIRST, customer_login#60 ASC NULLS FIRST, customer_email_address#61 ASC NULLS FIRST], [customer_id#55, customer_first_name#56, customer_last_name#57, customer_preferred_cust_flag#58, customer_birth_country#59, customer_login#60, customer_email_address#61] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (127) + + +(127) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#8, d_year#9] + +Subquery:2 Hosting operator id = 25 Hosting Expression = ss_sold_date_sk#35 IN dynamicpruning#36 +ReusedExchange (128) + + +(128) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#37, d_year#38] + +Subquery:3 Hosting operator id = 46 Hosting Expression = cs_sold_date_sk#69 IN dynamicpruning#7 + +Subquery:4 Hosting operator id = 67 Hosting Expression = cs_sold_date_sk#97 IN dynamicpruning#36 + +Subquery:5 Hosting operator id = 86 Hosting Expression = ws_sold_date_sk#123 IN dynamicpruning#7 + +Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#151 IN dynamicpruning#36 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/simplified.txt new file mode 100644 index 0000000000000..29d4199f5aff3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4.sf100/simplified.txt @@ -0,0 +1,239 @@ +TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address] + WholeStageCodegen (53) + Project [customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address] + SortMergeJoin [customer_id,customer_id,year_total,year_total,year_total,year_total] + InputAdapter + WholeStageCodegen (44) + Project [customer_id,customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address,year_total,year_total,year_total] + SortMergeJoin [customer_id,customer_id] + InputAdapter + WholeStageCodegen (35) + Project [customer_id,customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address,year_total,year_total] + SortMergeJoin [customer_id,customer_id,year_total,year_total,year_total,year_total] + InputAdapter + WholeStageCodegen (26) + Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address,year_total,year_total] + SortMergeJoin [customer_id,customer_id] + InputAdapter + WholeStageCodegen (17) + SortMergeJoin [customer_id,customer_id] + InputAdapter + WholeStageCodegen (8) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #1 + WholeStageCodegen (7) + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ss_ext_list_price,ss_ext_wholesale_cost,ss_ext_discount_amt,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #3 + WholeStageCodegen (2) + Project [ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + WholeStageCodegen (16) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #6 + WholeStageCodegen (15) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #7 + WholeStageCodegen (14) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ss_ext_list_price,ss_ext_wholesale_cost,ss_ext_discount_amt,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #8 + WholeStageCodegen (10) + Project [ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (9) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (13) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 + InputAdapter + WholeStageCodegen (25) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #10 + WholeStageCodegen (24) + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #11 + WholeStageCodegen (23) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,cs_ext_list_price,cs_ext_wholesale_cost,cs_ext_discount_amt,cs_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,d_year] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (20) + Sort [cs_bill_customer_sk] + InputAdapter + Exchange [cs_bill_customer_sk] #12 + WholeStageCodegen (19) + Project [cs_bill_customer_sk,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 + InputAdapter + WholeStageCodegen (22) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 + InputAdapter + WholeStageCodegen (34) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #13 + WholeStageCodegen (33) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #14 + WholeStageCodegen (32) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,cs_ext_list_price,cs_ext_wholesale_cost,cs_ext_discount_amt,cs_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,d_year] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (29) + Sort [cs_bill_customer_sk] + InputAdapter + Exchange [cs_bill_customer_sk] #15 + WholeStageCodegen (28) + Project [cs_bill_customer_sk,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year] #9 + InputAdapter + WholeStageCodegen (31) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 + InputAdapter + WholeStageCodegen (43) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #16 + WholeStageCodegen (42) + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #17 + WholeStageCodegen (41) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_wholesale_cost,ws_ext_discount_amt,ws_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,d_year] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (38) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #18 + WholeStageCodegen (37) + Project [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 + InputAdapter + WholeStageCodegen (40) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 + InputAdapter + WholeStageCodegen (52) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #19 + WholeStageCodegen (51) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #20 + WholeStageCodegen (50) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_wholesale_cost,ws_ext_discount_amt,ws_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,d_year] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (47) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #21 + WholeStageCodegen (46) + Project [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year] #9 + InputAdapter + WholeStageCodegen (49) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/explain.txt new file mode 100644 index 0000000000000..1cf27630d2994 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/explain.txt @@ -0,0 +1,691 @@ +== Physical Plan == +TakeOrderedAndProject (116) ++- * Project (115) + +- * BroadcastHashJoin Inner BuildRight (114) + :- * Project (97) + : +- * BroadcastHashJoin Inner BuildRight (96) + : :- * Project (77) + : : +- * BroadcastHashJoin Inner BuildRight (76) + : : :- * Project (59) + : : : +- * BroadcastHashJoin Inner BuildRight (58) + : : : :- * BroadcastHashJoin Inner BuildRight (39) + : : : : :- * Filter (19) + : : : : : +- * HashAggregate (18) + : : : : : +- Exchange (17) + : : : : : +- * HashAggregate (16) + : : : : : +- * Project (15) + : : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : : :- * Project (9) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.customer (1) + : : : : : : +- BroadcastExchange (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.store_sales (4) + : : : : : +- BroadcastExchange (13) + : : : : : +- * Filter (12) + : : : : : +- * ColumnarToRow (11) + : : : : : +- Scan parquet default.date_dim (10) + : : : : +- BroadcastExchange (38) + : : : : +- * HashAggregate (37) + : : : : +- Exchange (36) + : : : : +- * HashAggregate (35) + : : : : +- * Project (34) + : : : : +- * BroadcastHashJoin Inner BuildRight (33) + : : : : :- * Project (28) + : : : : : +- * BroadcastHashJoin Inner BuildRight (27) + : : : : : :- * Filter (22) + : : : : : : +- * ColumnarToRow (21) + : : : : : : +- Scan parquet default.customer (20) + : : : : : +- BroadcastExchange (26) + : : : : : +- * Filter (25) + : : : : : +- * ColumnarToRow (24) + : : : : : +- Scan parquet default.store_sales (23) + : : : : +- BroadcastExchange (32) + : : : : +- * Filter (31) + : : : : +- * ColumnarToRow (30) + : : : : +- Scan parquet default.date_dim (29) + : : : +- BroadcastExchange (57) + : : : +- * Project (56) + : : : +- * Filter (55) + : : : +- * HashAggregate (54) + : : : +- Exchange (53) + : : : +- * HashAggregate (52) + : : : +- * Project (51) + : : : +- * BroadcastHashJoin Inner BuildRight (50) + : : : :- * Project (48) + : : : : +- * BroadcastHashJoin Inner BuildRight (47) + : : : : :- * Filter (42) + : : : : : +- * ColumnarToRow (41) + : : : : : +- Scan parquet default.customer (40) + : : : : +- BroadcastExchange (46) + : : : : +- * Filter (45) + : : : : +- * ColumnarToRow (44) + : : : : +- Scan parquet default.catalog_sales (43) + : : : +- ReusedExchange (49) + : : +- BroadcastExchange (75) + : : +- * HashAggregate (74) + : : +- Exchange (73) + : : +- * HashAggregate (72) + : : +- * Project (71) + : : +- * BroadcastHashJoin Inner BuildRight (70) + : : :- * Project (68) + : : : +- * BroadcastHashJoin Inner BuildRight (67) + : : : :- * Filter (62) + : : : : +- * ColumnarToRow (61) + : : : : +- Scan parquet default.customer (60) + : : : +- BroadcastExchange (66) + : : : +- * Filter (65) + : : : +- * ColumnarToRow (64) + : : : +- Scan parquet default.catalog_sales (63) + : : +- ReusedExchange (69) + : +- BroadcastExchange (95) + : +- * Project (94) + : +- * Filter (93) + : +- * HashAggregate (92) + : +- Exchange (91) + : +- * HashAggregate (90) + : +- * Project (89) + : +- * BroadcastHashJoin Inner BuildRight (88) + : :- * Project (86) + : : +- * BroadcastHashJoin Inner BuildRight (85) + : : :- * Filter (80) + : : : +- * ColumnarToRow (79) + : : : +- Scan parquet default.customer (78) + : : +- BroadcastExchange (84) + : : +- * Filter (83) + : : +- * ColumnarToRow (82) + : : +- Scan parquet default.web_sales (81) + : +- ReusedExchange (87) + +- BroadcastExchange (113) + +- * HashAggregate (112) + +- Exchange (111) + +- * HashAggregate (110) + +- * Project (109) + +- * BroadcastHashJoin Inner BuildRight (108) + :- * Project (106) + : +- * BroadcastHashJoin Inner BuildRight (105) + : :- * Filter (100) + : : +- * ColumnarToRow (99) + : : +- Scan parquet default.customer (98) + : +- BroadcastExchange (104) + : +- * Filter (103) + : +- * ColumnarToRow (102) + : +- Scan parquet default.web_sales (101) + +- ReusedExchange (107) + + +(1) Scan parquet default.customer +Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] + +(3) Filter [codegen id : 3] +Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) + +(4) Scan parquet default.store_sales +Output [6]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#14), dynamicpruningexpression(ss_sold_date_sk#14 IN dynamicpruning#15)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14] + +(6) Filter [codegen id : 1] +Input [6]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14] +Condition : isnotnull(ss_customer_sk#9) + +(7) BroadcastExchange +Input [6]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#9] +Join condition: None + +(9) Project [codegen id : 3] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14] +Input [14]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#17, d_year#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#17, d_year#18] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#17, d_year#18] +Condition : ((isnotnull(d_year#18) AND (d_year#18 = 2001)) AND isnotnull(d_date_sk#17)) + +(13) BroadcastExchange +Input [2]: [d_date_sk#17, d_year#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#14] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(15) Project [codegen id : 3] +Output [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, d_year#18] +Input [14]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, ss_sold_date_sk#14, d_date_sk#17, d_year#18] + +(16) HashAggregate [codegen id : 3] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_sales_price#11, ss_ext_wholesale_cost#12, ss_ext_list_price#13, d_year#18] +Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#18] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#13 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#12 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#11 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#20, isEmpty#21] +Results [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#18, sum#22, isEmpty#23] + +(17) Exchange +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#18, sum#22, isEmpty#23] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#18, 5), ENSURE_REQUIREMENTS, [id=#24] + +(18) HashAggregate [codegen id : 24] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#18, sum#22, isEmpty#23] +Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, d_year#18] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#13 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#12 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#11 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#13 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#12 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#11 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#25] +Results [2]: [c_customer_id#2 AS customer_id#26, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#13 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#12 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#11 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#25 AS year_total#27] + +(19) Filter [codegen id : 24] +Input [2]: [customer_id#26, year_total#27] +Condition : (isnotnull(year_total#27) AND (year_total#27 > 0.000000)) + +(20) Scan parquet default.customer +Output [8]: [c_customer_sk#28, c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [8]: [c_customer_sk#28, c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35] + +(22) Filter [codegen id : 6] +Input [8]: [c_customer_sk#28, c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35] +Condition : (isnotnull(c_customer_sk#28) AND isnotnull(c_customer_id#29)) + +(23) Scan parquet default.store_sales +Output [6]: [ss_customer_sk#36, ss_ext_discount_amt#37, ss_ext_sales_price#38, ss_ext_wholesale_cost#39, ss_ext_list_price#40, ss_sold_date_sk#41] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#41), dynamicpruningexpression(ss_sold_date_sk#41 IN dynamicpruning#42)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [6]: [ss_customer_sk#36, ss_ext_discount_amt#37, ss_ext_sales_price#38, ss_ext_wholesale_cost#39, ss_ext_list_price#40, ss_sold_date_sk#41] + +(25) Filter [codegen id : 4] +Input [6]: [ss_customer_sk#36, ss_ext_discount_amt#37, ss_ext_sales_price#38, ss_ext_wholesale_cost#39, ss_ext_list_price#40, ss_sold_date_sk#41] +Condition : isnotnull(ss_customer_sk#36) + +(26) BroadcastExchange +Input [6]: [ss_customer_sk#36, ss_ext_discount_amt#37, ss_ext_sales_price#38, ss_ext_wholesale_cost#39, ss_ext_list_price#40, ss_sold_date_sk#41] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#43] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [c_customer_sk#28] +Right keys [1]: [ss_customer_sk#36] +Join condition: None + +(28) Project [codegen id : 6] +Output [12]: [c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, ss_ext_discount_amt#37, ss_ext_sales_price#38, ss_ext_wholesale_cost#39, ss_ext_list_price#40, ss_sold_date_sk#41] +Input [14]: [c_customer_sk#28, c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, ss_customer_sk#36, ss_ext_discount_amt#37, ss_ext_sales_price#38, ss_ext_wholesale_cost#39, ss_ext_list_price#40, ss_sold_date_sk#41] + +(29) Scan parquet default.date_dim +Output [2]: [d_date_sk#44, d_year#45] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#44, d_year#45] + +(31) Filter [codegen id : 5] +Input [2]: [d_date_sk#44, d_year#45] +Condition : ((isnotnull(d_year#45) AND (d_year#45 = 2002)) AND isnotnull(d_date_sk#44)) + +(32) BroadcastExchange +Input [2]: [d_date_sk#44, d_year#45] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#46] + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#41] +Right keys [1]: [d_date_sk#44] +Join condition: None + +(34) Project [codegen id : 6] +Output [12]: [c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, ss_ext_discount_amt#37, ss_ext_sales_price#38, ss_ext_wholesale_cost#39, ss_ext_list_price#40, d_year#45] +Input [14]: [c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, ss_ext_discount_amt#37, ss_ext_sales_price#38, ss_ext_wholesale_cost#39, ss_ext_list_price#40, ss_sold_date_sk#41, d_date_sk#44, d_year#45] + +(35) HashAggregate [codegen id : 6] +Input [12]: [c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, ss_ext_discount_amt#37, ss_ext_sales_price#38, ss_ext_wholesale_cost#39, ss_ext_list_price#40, d_year#45] +Keys [8]: [c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, d_year#45] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#39 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#37 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#38 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#47, isEmpty#48] +Results [10]: [c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, d_year#45, sum#49, isEmpty#50] + +(36) Exchange +Input [10]: [c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, d_year#45, sum#49, isEmpty#50] +Arguments: hashpartitioning(c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, d_year#45, 5), ENSURE_REQUIREMENTS, [id=#51] + +(37) HashAggregate [codegen id : 7] +Input [10]: [c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, d_year#45, sum#49, isEmpty#50] +Keys [8]: [c_customer_id#29, c_first_name#30, c_last_name#31, c_preferred_cust_flag#32, c_birth_country#33, c_login#34, c_email_address#35, d_year#45] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#39 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#37 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#38 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#39 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#37 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#38 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#52] +Results [8]: [c_customer_id#29 AS customer_id#53, c_first_name#30 AS customer_first_name#54, c_last_name#31 AS customer_last_name#55, c_preferred_cust_flag#32 AS customer_preferred_cust_flag#56, c_birth_country#33 AS customer_birth_country#57, c_login#34 AS customer_login#58, c_email_address#35 AS customer_email_address#59, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price#40 as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost#39 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt#37 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price#38 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#52 AS year_total#60] + +(38) BroadcastExchange +Input [8]: [customer_id#53, customer_first_name#54, customer_last_name#55, customer_preferred_cust_flag#56, customer_birth_country#57, customer_login#58, customer_email_address#59, year_total#60] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#61] + +(39) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#26] +Right keys [1]: [customer_id#53] +Join condition: None + +(40) Scan parquet default.customer +Output [8]: [c_customer_sk#62, c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 10] +Input [8]: [c_customer_sk#62, c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69] + +(42) Filter [codegen id : 10] +Input [8]: [c_customer_sk#62, c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69] +Condition : (isnotnull(c_customer_sk#62) AND isnotnull(c_customer_id#63)) + +(43) Scan parquet default.catalog_sales +Output [6]: [cs_bill_customer_sk#70, cs_ext_discount_amt#71, cs_ext_sales_price#72, cs_ext_wholesale_cost#73, cs_ext_list_price#74, cs_sold_date_sk#75] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#75), dynamicpruningexpression(cs_sold_date_sk#75 IN dynamicpruning#15)] +PushedFilters: [IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(44) ColumnarToRow [codegen id : 8] +Input [6]: [cs_bill_customer_sk#70, cs_ext_discount_amt#71, cs_ext_sales_price#72, cs_ext_wholesale_cost#73, cs_ext_list_price#74, cs_sold_date_sk#75] + +(45) Filter [codegen id : 8] +Input [6]: [cs_bill_customer_sk#70, cs_ext_discount_amt#71, cs_ext_sales_price#72, cs_ext_wholesale_cost#73, cs_ext_list_price#74, cs_sold_date_sk#75] +Condition : isnotnull(cs_bill_customer_sk#70) + +(46) BroadcastExchange +Input [6]: [cs_bill_customer_sk#70, cs_ext_discount_amt#71, cs_ext_sales_price#72, cs_ext_wholesale_cost#73, cs_ext_list_price#74, cs_sold_date_sk#75] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#76] + +(47) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [c_customer_sk#62] +Right keys [1]: [cs_bill_customer_sk#70] +Join condition: None + +(48) Project [codegen id : 10] +Output [12]: [c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69, cs_ext_discount_amt#71, cs_ext_sales_price#72, cs_ext_wholesale_cost#73, cs_ext_list_price#74, cs_sold_date_sk#75] +Input [14]: [c_customer_sk#62, c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69, cs_bill_customer_sk#70, cs_ext_discount_amt#71, cs_ext_sales_price#72, cs_ext_wholesale_cost#73, cs_ext_list_price#74, cs_sold_date_sk#75] + +(49) ReusedExchange [Reuses operator id: 13] +Output [2]: [d_date_sk#77, d_year#78] + +(50) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#75] +Right keys [1]: [d_date_sk#77] +Join condition: None + +(51) Project [codegen id : 10] +Output [12]: [c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69, cs_ext_discount_amt#71, cs_ext_sales_price#72, cs_ext_wholesale_cost#73, cs_ext_list_price#74, d_year#78] +Input [14]: [c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69, cs_ext_discount_amt#71, cs_ext_sales_price#72, cs_ext_wholesale_cost#73, cs_ext_list_price#74, cs_sold_date_sk#75, d_date_sk#77, d_year#78] + +(52) HashAggregate [codegen id : 10] +Input [12]: [c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69, cs_ext_discount_amt#71, cs_ext_sales_price#72, cs_ext_wholesale_cost#73, cs_ext_list_price#74, d_year#78] +Keys [8]: [c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69, d_year#78] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#74 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#73 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#71 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#72 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#79, isEmpty#80] +Results [10]: [c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69, d_year#78, sum#81, isEmpty#82] + +(53) Exchange +Input [10]: [c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69, d_year#78, sum#81, isEmpty#82] +Arguments: hashpartitioning(c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69, d_year#78, 5), ENSURE_REQUIREMENTS, [id=#83] + +(54) HashAggregate [codegen id : 11] +Input [10]: [c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69, d_year#78, sum#81, isEmpty#82] +Keys [8]: [c_customer_id#63, c_first_name#64, c_last_name#65, c_preferred_cust_flag#66, c_birth_country#67, c_login#68, c_email_address#69, d_year#78] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#74 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#73 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#71 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#72 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#74 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#73 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#71 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#72 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#84] +Results [2]: [c_customer_id#63 AS customer_id#85, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#74 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#73 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#71 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#72 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#84 AS year_total#86] + +(55) Filter [codegen id : 11] +Input [2]: [customer_id#85, year_total#86] +Condition : (isnotnull(year_total#86) AND (year_total#86 > 0.000000)) + +(56) Project [codegen id : 11] +Output [2]: [customer_id#85 AS customer_id#87, year_total#86 AS year_total#88] +Input [2]: [customer_id#85, year_total#86] + +(57) BroadcastExchange +Input [2]: [customer_id#87, year_total#88] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#89] + +(58) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#26] +Right keys [1]: [customer_id#87] +Join condition: None + +(59) Project [codegen id : 24] +Output [11]: [customer_id#26, year_total#27, customer_id#53, customer_first_name#54, customer_last_name#55, customer_preferred_cust_flag#56, customer_birth_country#57, customer_login#58, customer_email_address#59, year_total#60, year_total#88] +Input [12]: [customer_id#26, year_total#27, customer_id#53, customer_first_name#54, customer_last_name#55, customer_preferred_cust_flag#56, customer_birth_country#57, customer_login#58, customer_email_address#59, year_total#60, customer_id#87, year_total#88] + +(60) Scan parquet default.customer +Output [8]: [c_customer_sk#90, c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(61) ColumnarToRow [codegen id : 14] +Input [8]: [c_customer_sk#90, c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97] + +(62) Filter [codegen id : 14] +Input [8]: [c_customer_sk#90, c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97] +Condition : (isnotnull(c_customer_sk#90) AND isnotnull(c_customer_id#91)) + +(63) Scan parquet default.catalog_sales +Output [6]: [cs_bill_customer_sk#98, cs_ext_discount_amt#99, cs_ext_sales_price#100, cs_ext_wholesale_cost#101, cs_ext_list_price#102, cs_sold_date_sk#103] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#103), dynamicpruningexpression(cs_sold_date_sk#103 IN dynamicpruning#42)] +PushedFilters: [IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(64) ColumnarToRow [codegen id : 12] +Input [6]: [cs_bill_customer_sk#98, cs_ext_discount_amt#99, cs_ext_sales_price#100, cs_ext_wholesale_cost#101, cs_ext_list_price#102, cs_sold_date_sk#103] + +(65) Filter [codegen id : 12] +Input [6]: [cs_bill_customer_sk#98, cs_ext_discount_amt#99, cs_ext_sales_price#100, cs_ext_wholesale_cost#101, cs_ext_list_price#102, cs_sold_date_sk#103] +Condition : isnotnull(cs_bill_customer_sk#98) + +(66) BroadcastExchange +Input [6]: [cs_bill_customer_sk#98, cs_ext_discount_amt#99, cs_ext_sales_price#100, cs_ext_wholesale_cost#101, cs_ext_list_price#102, cs_sold_date_sk#103] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#104] + +(67) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [c_customer_sk#90] +Right keys [1]: [cs_bill_customer_sk#98] +Join condition: None + +(68) Project [codegen id : 14] +Output [12]: [c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97, cs_ext_discount_amt#99, cs_ext_sales_price#100, cs_ext_wholesale_cost#101, cs_ext_list_price#102, cs_sold_date_sk#103] +Input [14]: [c_customer_sk#90, c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97, cs_bill_customer_sk#98, cs_ext_discount_amt#99, cs_ext_sales_price#100, cs_ext_wholesale_cost#101, cs_ext_list_price#102, cs_sold_date_sk#103] + +(69) ReusedExchange [Reuses operator id: 32] +Output [2]: [d_date_sk#105, d_year#106] + +(70) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [cs_sold_date_sk#103] +Right keys [1]: [d_date_sk#105] +Join condition: None + +(71) Project [codegen id : 14] +Output [12]: [c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97, cs_ext_discount_amt#99, cs_ext_sales_price#100, cs_ext_wholesale_cost#101, cs_ext_list_price#102, d_year#106] +Input [14]: [c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97, cs_ext_discount_amt#99, cs_ext_sales_price#100, cs_ext_wholesale_cost#101, cs_ext_list_price#102, cs_sold_date_sk#103, d_date_sk#105, d_year#106] + +(72) HashAggregate [codegen id : 14] +Input [12]: [c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97, cs_ext_discount_amt#99, cs_ext_sales_price#100, cs_ext_wholesale_cost#101, cs_ext_list_price#102, d_year#106] +Keys [8]: [c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97, d_year#106] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#102 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#101 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#99 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#100 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#107, isEmpty#108] +Results [10]: [c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97, d_year#106, sum#109, isEmpty#110] + +(73) Exchange +Input [10]: [c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97, d_year#106, sum#109, isEmpty#110] +Arguments: hashpartitioning(c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97, d_year#106, 5), ENSURE_REQUIREMENTS, [id=#111] + +(74) HashAggregate [codegen id : 15] +Input [10]: [c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97, d_year#106, sum#109, isEmpty#110] +Keys [8]: [c_customer_id#91, c_first_name#92, c_last_name#93, c_preferred_cust_flag#94, c_birth_country#95, c_login#96, c_email_address#97, d_year#106] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#102 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#101 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#99 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#100 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#102 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#101 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#99 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#100 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#112] +Results [2]: [c_customer_id#91 AS customer_id#113, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price#102 as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost#101 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt#99 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price#100 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#112 AS year_total#114] + +(75) BroadcastExchange +Input [2]: [customer_id#113, year_total#114] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#115] + +(76) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#26] +Right keys [1]: [customer_id#113] +Join condition: (CASE WHEN (year_total#88 > 0.000000) THEN CheckOverflow((promote_precision(year_total#114) / promote_precision(year_total#88)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#27 > 0.000000) THEN CheckOverflow((promote_precision(year_total#60) / promote_precision(year_total#27)), DecimalType(38,14), true) ELSE null END) + +(77) Project [codegen id : 24] +Output [10]: [customer_id#26, customer_id#53, customer_first_name#54, customer_last_name#55, customer_preferred_cust_flag#56, customer_birth_country#57, customer_login#58, customer_email_address#59, year_total#88, year_total#114] +Input [13]: [customer_id#26, year_total#27, customer_id#53, customer_first_name#54, customer_last_name#55, customer_preferred_cust_flag#56, customer_birth_country#57, customer_login#58, customer_email_address#59, year_total#60, year_total#88, customer_id#113, year_total#114] + +(78) Scan parquet default.customer +Output [8]: [c_customer_sk#116, c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(79) ColumnarToRow [codegen id : 18] +Input [8]: [c_customer_sk#116, c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123] + +(80) Filter [codegen id : 18] +Input [8]: [c_customer_sk#116, c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123] +Condition : (isnotnull(c_customer_sk#116) AND isnotnull(c_customer_id#117)) + +(81) Scan parquet default.web_sales +Output [6]: [ws_bill_customer_sk#124, ws_ext_discount_amt#125, ws_ext_sales_price#126, ws_ext_wholesale_cost#127, ws_ext_list_price#128, ws_sold_date_sk#129] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#129), dynamicpruningexpression(ws_sold_date_sk#129 IN dynamicpruning#15)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(82) ColumnarToRow [codegen id : 16] +Input [6]: [ws_bill_customer_sk#124, ws_ext_discount_amt#125, ws_ext_sales_price#126, ws_ext_wholesale_cost#127, ws_ext_list_price#128, ws_sold_date_sk#129] + +(83) Filter [codegen id : 16] +Input [6]: [ws_bill_customer_sk#124, ws_ext_discount_amt#125, ws_ext_sales_price#126, ws_ext_wholesale_cost#127, ws_ext_list_price#128, ws_sold_date_sk#129] +Condition : isnotnull(ws_bill_customer_sk#124) + +(84) BroadcastExchange +Input [6]: [ws_bill_customer_sk#124, ws_ext_discount_amt#125, ws_ext_sales_price#126, ws_ext_wholesale_cost#127, ws_ext_list_price#128, ws_sold_date_sk#129] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#130] + +(85) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [c_customer_sk#116] +Right keys [1]: [ws_bill_customer_sk#124] +Join condition: None + +(86) Project [codegen id : 18] +Output [12]: [c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123, ws_ext_discount_amt#125, ws_ext_sales_price#126, ws_ext_wholesale_cost#127, ws_ext_list_price#128, ws_sold_date_sk#129] +Input [14]: [c_customer_sk#116, c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123, ws_bill_customer_sk#124, ws_ext_discount_amt#125, ws_ext_sales_price#126, ws_ext_wholesale_cost#127, ws_ext_list_price#128, ws_sold_date_sk#129] + +(87) ReusedExchange [Reuses operator id: 13] +Output [2]: [d_date_sk#131, d_year#132] + +(88) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [ws_sold_date_sk#129] +Right keys [1]: [d_date_sk#131] +Join condition: None + +(89) Project [codegen id : 18] +Output [12]: [c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123, ws_ext_discount_amt#125, ws_ext_sales_price#126, ws_ext_wholesale_cost#127, ws_ext_list_price#128, d_year#132] +Input [14]: [c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123, ws_ext_discount_amt#125, ws_ext_sales_price#126, ws_ext_wholesale_cost#127, ws_ext_list_price#128, ws_sold_date_sk#129, d_date_sk#131, d_year#132] + +(90) HashAggregate [codegen id : 18] +Input [12]: [c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123, ws_ext_discount_amt#125, ws_ext_sales_price#126, ws_ext_wholesale_cost#127, ws_ext_list_price#128, d_year#132] +Keys [8]: [c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123, d_year#132] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#128 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#127 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#125 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#126 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#133, isEmpty#134] +Results [10]: [c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123, d_year#132, sum#135, isEmpty#136] + +(91) Exchange +Input [10]: [c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123, d_year#132, sum#135, isEmpty#136] +Arguments: hashpartitioning(c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123, d_year#132, 5), ENSURE_REQUIREMENTS, [id=#137] + +(92) HashAggregate [codegen id : 19] +Input [10]: [c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123, d_year#132, sum#135, isEmpty#136] +Keys [8]: [c_customer_id#117, c_first_name#118, c_last_name#119, c_preferred_cust_flag#120, c_birth_country#121, c_login#122, c_email_address#123, d_year#132] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#128 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#127 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#125 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#126 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#128 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#127 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#125 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#126 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#138] +Results [2]: [c_customer_id#117 AS customer_id#139, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#128 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#127 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#125 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#126 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#138 AS year_total#140] + +(93) Filter [codegen id : 19] +Input [2]: [customer_id#139, year_total#140] +Condition : (isnotnull(year_total#140) AND (year_total#140 > 0.000000)) + +(94) Project [codegen id : 19] +Output [2]: [customer_id#139 AS customer_id#141, year_total#140 AS year_total#142] +Input [2]: [customer_id#139, year_total#140] + +(95) BroadcastExchange +Input [2]: [customer_id#141, year_total#142] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#143] + +(96) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#26] +Right keys [1]: [customer_id#141] +Join condition: None + +(97) Project [codegen id : 24] +Output [11]: [customer_id#26, customer_id#53, customer_first_name#54, customer_last_name#55, customer_preferred_cust_flag#56, customer_birth_country#57, customer_login#58, customer_email_address#59, year_total#88, year_total#114, year_total#142] +Input [12]: [customer_id#26, customer_id#53, customer_first_name#54, customer_last_name#55, customer_preferred_cust_flag#56, customer_birth_country#57, customer_login#58, customer_email_address#59, year_total#88, year_total#114, customer_id#141, year_total#142] + +(98) Scan parquet default.customer +Output [8]: [c_customer_sk#144, c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(99) ColumnarToRow [codegen id : 22] +Input [8]: [c_customer_sk#144, c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151] + +(100) Filter [codegen id : 22] +Input [8]: [c_customer_sk#144, c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151] +Condition : (isnotnull(c_customer_sk#144) AND isnotnull(c_customer_id#145)) + +(101) Scan parquet default.web_sales +Output [6]: [ws_bill_customer_sk#152, ws_ext_discount_amt#153, ws_ext_sales_price#154, ws_ext_wholesale_cost#155, ws_ext_list_price#156, ws_sold_date_sk#157] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#157), dynamicpruningexpression(ws_sold_date_sk#157 IN dynamicpruning#42)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(102) ColumnarToRow [codegen id : 20] +Input [6]: [ws_bill_customer_sk#152, ws_ext_discount_amt#153, ws_ext_sales_price#154, ws_ext_wholesale_cost#155, ws_ext_list_price#156, ws_sold_date_sk#157] + +(103) Filter [codegen id : 20] +Input [6]: [ws_bill_customer_sk#152, ws_ext_discount_amt#153, ws_ext_sales_price#154, ws_ext_wholesale_cost#155, ws_ext_list_price#156, ws_sold_date_sk#157] +Condition : isnotnull(ws_bill_customer_sk#152) + +(104) BroadcastExchange +Input [6]: [ws_bill_customer_sk#152, ws_ext_discount_amt#153, ws_ext_sales_price#154, ws_ext_wholesale_cost#155, ws_ext_list_price#156, ws_sold_date_sk#157] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#158] + +(105) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [c_customer_sk#144] +Right keys [1]: [ws_bill_customer_sk#152] +Join condition: None + +(106) Project [codegen id : 22] +Output [12]: [c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151, ws_ext_discount_amt#153, ws_ext_sales_price#154, ws_ext_wholesale_cost#155, ws_ext_list_price#156, ws_sold_date_sk#157] +Input [14]: [c_customer_sk#144, c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151, ws_bill_customer_sk#152, ws_ext_discount_amt#153, ws_ext_sales_price#154, ws_ext_wholesale_cost#155, ws_ext_list_price#156, ws_sold_date_sk#157] + +(107) ReusedExchange [Reuses operator id: 32] +Output [2]: [d_date_sk#159, d_year#160] + +(108) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [ws_sold_date_sk#157] +Right keys [1]: [d_date_sk#159] +Join condition: None + +(109) Project [codegen id : 22] +Output [12]: [c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151, ws_ext_discount_amt#153, ws_ext_sales_price#154, ws_ext_wholesale_cost#155, ws_ext_list_price#156, d_year#160] +Input [14]: [c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151, ws_ext_discount_amt#153, ws_ext_sales_price#154, ws_ext_wholesale_cost#155, ws_ext_list_price#156, ws_sold_date_sk#157, d_date_sk#159, d_year#160] + +(110) HashAggregate [codegen id : 22] +Input [12]: [c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151, ws_ext_discount_amt#153, ws_ext_sales_price#154, ws_ext_wholesale_cost#155, ws_ext_list_price#156, d_year#160] +Keys [8]: [c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151, d_year#160] +Functions [1]: [partial_sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#156 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#155 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#153 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#154 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [2]: [sum#161, isEmpty#162] +Results [10]: [c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151, d_year#160, sum#163, isEmpty#164] + +(111) Exchange +Input [10]: [c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151, d_year#160, sum#163, isEmpty#164] +Arguments: hashpartitioning(c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151, d_year#160, 5), ENSURE_REQUIREMENTS, [id=#165] + +(112) HashAggregate [codegen id : 23] +Input [10]: [c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151, d_year#160, sum#163, isEmpty#164] +Keys [8]: [c_customer_id#145, c_first_name#146, c_last_name#147, c_preferred_cust_flag#148, c_birth_country#149, c_login#150, c_email_address#151, d_year#160] +Functions [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#156 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#155 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#153 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#154 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))] +Aggregate Attributes [1]: [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#156 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#155 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#153 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#154 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#166] +Results [2]: [c_customer_id#145 AS customer_id#167, sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price#156 as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost#155 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt#153 as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price#154 as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true))#166 AS year_total#168] + +(113) BroadcastExchange +Input [2]: [customer_id#167, year_total#168] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#169] + +(114) BroadcastHashJoin [codegen id : 24] +Left keys [1]: [customer_id#26] +Right keys [1]: [customer_id#167] +Join condition: (CASE WHEN (year_total#88 > 0.000000) THEN CheckOverflow((promote_precision(year_total#114) / promote_precision(year_total#88)), DecimalType(38,14), true) ELSE null END > CASE WHEN (year_total#142 > 0.000000) THEN CheckOverflow((promote_precision(year_total#168) / promote_precision(year_total#142)), DecimalType(38,14), true) ELSE null END) + +(115) Project [codegen id : 24] +Output [7]: [customer_id#53, customer_first_name#54, customer_last_name#55, customer_preferred_cust_flag#56, customer_birth_country#57, customer_login#58, customer_email_address#59] +Input [13]: [customer_id#26, customer_id#53, customer_first_name#54, customer_last_name#55, customer_preferred_cust_flag#56, customer_birth_country#57, customer_login#58, customer_email_address#59, year_total#88, year_total#114, year_total#142, customer_id#167, year_total#168] + +(116) TakeOrderedAndProject +Input [7]: [customer_id#53, customer_first_name#54, customer_last_name#55, customer_preferred_cust_flag#56, customer_birth_country#57, customer_login#58, customer_email_address#59] +Arguments: 100, [customer_id#53 ASC NULLS FIRST, customer_first_name#54 ASC NULLS FIRST, customer_last_name#55 ASC NULLS FIRST, customer_preferred_cust_flag#56 ASC NULLS FIRST, customer_birth_country#57 ASC NULLS FIRST, customer_login#58 ASC NULLS FIRST, customer_email_address#59 ASC NULLS FIRST], [customer_id#53, customer_first_name#54, customer_last_name#55, customer_preferred_cust_flag#56, customer_birth_country#57, customer_login#58, customer_email_address#59] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#14 IN dynamicpruning#15 +ReusedExchange (117) + + +(117) ReusedExchange [Reuses operator id: 13] +Output [2]: [d_date_sk#17, d_year#18] + +Subquery:2 Hosting operator id = 23 Hosting Expression = ss_sold_date_sk#41 IN dynamicpruning#42 +ReusedExchange (118) + + +(118) ReusedExchange [Reuses operator id: 32] +Output [2]: [d_date_sk#44, d_year#45] + +Subquery:3 Hosting operator id = 43 Hosting Expression = cs_sold_date_sk#75 IN dynamicpruning#15 + +Subquery:4 Hosting operator id = 63 Hosting Expression = cs_sold_date_sk#103 IN dynamicpruning#42 + +Subquery:5 Hosting operator id = 81 Hosting Expression = ws_sold_date_sk#129 IN dynamicpruning#15 + +Subquery:6 Hosting operator id = 101 Hosting Expression = ws_sold_date_sk#157 IN dynamicpruning#42 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/simplified.txt new file mode 100644 index 0000000000000..fcfef6b7d85ed --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q4/simplified.txt @@ -0,0 +1,181 @@ +TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address] + WholeStageCodegen (24) + Project [customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address] + BroadcastHashJoin [customer_id,customer_id,year_total,year_total,year_total,year_total] + Project [customer_id,customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address,year_total,year_total,year_total] + BroadcastHashJoin [customer_id,customer_id] + Project [customer_id,customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address,year_total,year_total] + BroadcastHashJoin [customer_id,customer_id,year_total,year_total,year_total,year_total] + Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address,year_total,year_total] + BroadcastHashJoin [customer_id,customer_id] + BroadcastHashJoin [customer_id,customer_id] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ss_ext_list_price,ss_ext_wholesale_cost,ss_ext_discount_amt,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (7) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ss_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,customer_first_name,customer_last_name,customer_preferred_cust_flag,customer_birth_country,customer_login,customer_email_address,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #5 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ss_ext_list_price,ss_ext_wholesale_cost,ss_ext_discount_amt,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_sales_price,ss_ext_wholesale_cost,ss_ext_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #7 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (5) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (11) + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #9 + WholeStageCodegen (10) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,cs_ext_list_price,cs_ext_wholesale_cost,cs_ext_discount_amt,cs_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,cs_sold_date_sk] + BroadcastHashJoin [c_customer_sk,cs_bill_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (8) + Filter [cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (15) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cs_ext_list_price as decimal(8,2))) - promote_precision(cast(cs_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(cs_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(cs_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #12 + WholeStageCodegen (14) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,cs_ext_list_price,cs_ext_wholesale_cost,cs_ext_discount_amt,cs_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,cs_sold_date_sk] + BroadcastHashJoin [c_customer_sk,cs_bill_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (12) + Filter [cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_ext_discount_amt,cs_ext_sales_price,cs_ext_wholesale_cost,cs_ext_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year] #7 + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (19) + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #15 + WholeStageCodegen (18) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_wholesale_cost,ws_ext_discount_amt,ws_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,ws_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (16) + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (23) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum,isEmpty] [sum(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ws_ext_list_price as decimal(8,2))) - promote_precision(cast(ws_ext_wholesale_cost as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) - promote_precision(cast(ws_ext_discount_amt as decimal(9,2)))), DecimalType(9,2), true) as decimal(10,2))) + promote_precision(cast(ws_ext_sales_price as decimal(10,2)))), DecimalType(10,2), true)) / 2.00), DecimalType(14,6), true)),customer_id,year_total,sum,isEmpty] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #18 + WholeStageCodegen (22) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_wholesale_cost,ws_ext_discount_amt,ws_ext_sales_price] [sum,isEmpty,sum,isEmpty] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,ws_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #19 + WholeStageCodegen (20) + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_sales_price,ws_ext_wholesale_cost,ws_ext_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/explain.txt new file mode 100644 index 0000000000000..fcd1b82886242 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/explain.txt @@ -0,0 +1,214 @@ +== Physical Plan == +TakeOrderedAndProject (36) ++- * HashAggregate (35) + +- Exchange (34) + +- * HashAggregate (33) + +- * Project (32) + +- * BroadcastHashJoin Inner BuildRight (31) + :- * Project (26) + : +- * BroadcastHashJoin Inner BuildRight (25) + : :- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Project (13) + : : : +- * SortMergeJoin LeftOuter (12) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- * Sort (11) + : : : +- Exchange (10) + : : : +- * Project (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.catalog_returns (6) + : : +- BroadcastExchange (18) + : : +- * Project (17) + : : +- * Filter (16) + : : +- * ColumnarToRow (15) + : : +- Scan parquet default.item (14) + : +- BroadcastExchange (24) + : +- * Filter (23) + : +- * ColumnarToRow (22) + : +- Scan parquet default.date_dim (21) + +- BroadcastExchange (30) + +- * Filter (29) + +- * ColumnarToRow (28) + +- Scan parquet default.warehouse (27) + + +(1) Scan parquet default.catalog_sales +Output [5]: [cs_warehouse_sk#1, cs_item_sk#2, cs_order_number#3, cs_sales_price#4, cs_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [cs_warehouse_sk#1, cs_item_sk#2, cs_order_number#3, cs_sales_price#4, cs_sold_date_sk#5] + +(3) Filter [codegen id : 1] +Input [5]: [cs_warehouse_sk#1, cs_item_sk#2, cs_order_number#3, cs_sales_price#4, cs_sold_date_sk#5] +Condition : (isnotnull(cs_warehouse_sk#1) AND isnotnull(cs_item_sk#2)) + +(4) Exchange +Input [5]: [cs_warehouse_sk#1, cs_item_sk#2, cs_order_number#3, cs_sales_price#4, cs_sold_date_sk#5] +Arguments: hashpartitioning(cs_order_number#3, cs_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] + +(5) Sort [codegen id : 2] +Input [5]: [cs_warehouse_sk#1, cs_item_sk#2, cs_order_number#3, cs_sales_price#4, cs_sold_date_sk#5] +Arguments: [cs_order_number#3 ASC NULLS FIRST, cs_item_sk#2 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.catalog_returns +Output [4]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10, cr_returned_date_sk#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [4]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10, cr_returned_date_sk#11] + +(8) Filter [codegen id : 3] +Input [4]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10, cr_returned_date_sk#11] +Condition : (isnotnull(cr_order_number#9) AND isnotnull(cr_item_sk#8)) + +(9) Project [codegen id : 3] +Output [3]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10] +Input [4]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10, cr_returned_date_sk#11] + +(10) Exchange +Input [3]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10] +Arguments: hashpartitioning(cr_order_number#9, cr_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#12] + +(11) Sort [codegen id : 4] +Input [3]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10] +Arguments: [cr_order_number#9 ASC NULLS FIRST, cr_item_sk#8 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 8] +Left keys [2]: [cs_order_number#3, cs_item_sk#2] +Right keys [2]: [cr_order_number#9, cr_item_sk#8] +Join condition: None + +(13) Project [codegen id : 8] +Output [5]: [cs_warehouse_sk#1, cs_item_sk#2, cs_sales_price#4, cs_sold_date_sk#5, cr_refunded_cash#10] +Input [8]: [cs_warehouse_sk#1, cs_item_sk#2, cs_order_number#3, cs_sales_price#4, cs_sold_date_sk#5, cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10] + +(14) Scan parquet default.item +Output [3]: [i_item_sk#13, i_item_id#14, i_current_price#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,0.99), LessThanOrEqual(i_current_price,1.49), IsNotNull(i_item_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 5] +Input [3]: [i_item_sk#13, i_item_id#14, i_current_price#15] + +(16) Filter [codegen id : 5] +Input [3]: [i_item_sk#13, i_item_id#14, i_current_price#15] +Condition : (((isnotnull(i_current_price#15) AND (i_current_price#15 >= 0.99)) AND (i_current_price#15 <= 1.49)) AND isnotnull(i_item_sk#13)) + +(17) Project [codegen id : 5] +Output [2]: [i_item_sk#13, i_item_id#14] +Input [3]: [i_item_sk#13, i_item_id#14, i_current_price#15] + +(18) BroadcastExchange +Input [2]: [i_item_sk#13, i_item_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(19) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(20) Project [codegen id : 8] +Output [5]: [cs_warehouse_sk#1, cs_sales_price#4, cs_sold_date_sk#5, cr_refunded_cash#10, i_item_id#14] +Input [7]: [cs_warehouse_sk#1, cs_item_sk#2, cs_sales_price#4, cs_sold_date_sk#5, cr_refunded_cash#10, i_item_sk#13, i_item_id#14] + +(21) Scan parquet default.date_dim +Output [2]: [d_date_sk#17, d_date#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-02-10), LessThanOrEqual(d_date,2000-04-10), IsNotNull(d_date_sk)] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 6] +Input [2]: [d_date_sk#17, d_date#18] + +(23) Filter [codegen id : 6] +Input [2]: [d_date_sk#17, d_date#18] +Condition : (((isnotnull(d_date#18) AND (d_date#18 >= 2000-02-10)) AND (d_date#18 <= 2000-04-10)) AND isnotnull(d_date_sk#17)) + +(24) BroadcastExchange +Input [2]: [d_date_sk#17, d_date#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] + +(25) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_sold_date_sk#5] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(26) Project [codegen id : 8] +Output [5]: [cs_warehouse_sk#1, cs_sales_price#4, cr_refunded_cash#10, i_item_id#14, d_date#18] +Input [7]: [cs_warehouse_sk#1, cs_sales_price#4, cs_sold_date_sk#5, cr_refunded_cash#10, i_item_id#14, d_date_sk#17, d_date#18] + +(27) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#20, w_state#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 7] +Input [2]: [w_warehouse_sk#20, w_state#21] + +(29) Filter [codegen id : 7] +Input [2]: [w_warehouse_sk#20, w_state#21] +Condition : isnotnull(w_warehouse_sk#20) + +(30) BroadcastExchange +Input [2]: [w_warehouse_sk#20, w_state#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] + +(31) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_warehouse_sk#1] +Right keys [1]: [w_warehouse_sk#20] +Join condition: None + +(32) Project [codegen id : 8] +Output [5]: [cs_sales_price#4, cr_refunded_cash#10, w_state#21, i_item_id#14, d_date#18] +Input [7]: [cs_warehouse_sk#1, cs_sales_price#4, cr_refunded_cash#10, i_item_id#14, d_date#18, w_warehouse_sk#20, w_state#21] + +(33) HashAggregate [codegen id : 8] +Input [5]: [cs_sales_price#4, cr_refunded_cash#10, w_state#21, i_item_id#14, d_date#18] +Keys [2]: [w_state#21, i_item_id#14] +Functions [2]: [partial_sum(CASE WHEN (d_date#18 < 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_date#18 >= 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)] +Aggregate Attributes [4]: [sum#23, isEmpty#24, sum#25, isEmpty#26] +Results [6]: [w_state#21, i_item_id#14, sum#27, isEmpty#28, sum#29, isEmpty#30] + +(34) Exchange +Input [6]: [w_state#21, i_item_id#14, sum#27, isEmpty#28, sum#29, isEmpty#30] +Arguments: hashpartitioning(w_state#21, i_item_id#14, 5), ENSURE_REQUIREMENTS, [id=#31] + +(35) HashAggregate [codegen id : 9] +Input [6]: [w_state#21, i_item_id#14, sum#27, isEmpty#28, sum#29, isEmpty#30] +Keys [2]: [w_state#21, i_item_id#14] +Functions [2]: [sum(CASE WHEN (d_date#18 < 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END), sum(CASE WHEN (d_date#18 >= 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)] +Aggregate Attributes [2]: [sum(CASE WHEN (d_date#18 < 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#32, sum(CASE WHEN (d_date#18 >= 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#33] +Results [4]: [w_state#21, i_item_id#14, sum(CASE WHEN (d_date#18 < 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#32 AS sales_before#34, sum(CASE WHEN (d_date#18 >= 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#33 AS sales_after#35] + +(36) TakeOrderedAndProject +Input [4]: [w_state#21, i_item_id#14, sales_before#34, sales_after#35] +Arguments: 100, [w_state#21 ASC NULLS FIRST, i_item_id#14 ASC NULLS FIRST], [w_state#21, i_item_id#14, sales_before#34, sales_after#35] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (37) + + +(37) ReusedExchange [Reuses operator id: 24] +Output [2]: [d_date_sk#17, d_date#18] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/simplified.txt new file mode 100644 index 0000000000000..53eafedcaa812 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40.sf100/simplified.txt @@ -0,0 +1,60 @@ +TakeOrderedAndProject [w_state,i_item_id,sales_before,sales_after] + WholeStageCodegen (9) + HashAggregate [w_state,i_item_id,sum,isEmpty,sum,isEmpty] [sum(CASE WHEN (d_date < 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END),sum(CASE WHEN (d_date >= 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END),sales_before,sales_after,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [w_state,i_item_id] #1 + WholeStageCodegen (8) + HashAggregate [w_state,i_item_id,d_date,cs_sales_price,cr_refunded_cash] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + Project [cs_sales_price,cr_refunded_cash,w_state,i_item_id,d_date] + BroadcastHashJoin [cs_warehouse_sk,w_warehouse_sk] + Project [cs_warehouse_sk,cs_sales_price,cr_refunded_cash,i_item_id,d_date] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_warehouse_sk,cs_sales_price,cs_sold_date_sk,cr_refunded_cash,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_warehouse_sk,cs_item_sk,cs_sales_price,cs_sold_date_sk,cr_refunded_cash] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #2 + WholeStageCodegen (1) + Filter [cs_warehouse_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_warehouse_sk,cs_item_sk,cs_order_number,cs_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date] #3 + InputAdapter + WholeStageCodegen (4) + Sort [cr_order_number,cr_item_sk] + InputAdapter + Exchange [cr_order_number,cr_item_sk] #4 + WholeStageCodegen (3) + Project [cr_item_sk,cr_order_number,cr_refunded_cash] + Filter [cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_refunded_cash,cr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (5) + Project [i_item_sk,i_item_id] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_current_price] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (6) + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_state] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40/explain.txt new file mode 100644 index 0000000000000..367d15e3b52f5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40/explain.txt @@ -0,0 +1,214 @@ +== Physical Plan == +TakeOrderedAndProject (36) ++- * HashAggregate (35) + +- Exchange (34) + +- * HashAggregate (33) + +- * Project (32) + +- * BroadcastHashJoin Inner BuildRight (31) + :- * Project (26) + : +- * BroadcastHashJoin Inner BuildRight (25) + : :- * Project (19) + : : +- * BroadcastHashJoin Inner BuildRight (18) + : : :- * Project (13) + : : : +- * SortMergeJoin LeftOuter (12) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- * Sort (11) + : : : +- Exchange (10) + : : : +- * Project (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.catalog_returns (6) + : : +- BroadcastExchange (17) + : : +- * Filter (16) + : : +- * ColumnarToRow (15) + : : +- Scan parquet default.warehouse (14) + : +- BroadcastExchange (24) + : +- * Project (23) + : +- * Filter (22) + : +- * ColumnarToRow (21) + : +- Scan parquet default.item (20) + +- BroadcastExchange (30) + +- * Filter (29) + +- * ColumnarToRow (28) + +- Scan parquet default.date_dim (27) + + +(1) Scan parquet default.catalog_sales +Output [5]: [cs_warehouse_sk#1, cs_item_sk#2, cs_order_number#3, cs_sales_price#4, cs_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [cs_warehouse_sk#1, cs_item_sk#2, cs_order_number#3, cs_sales_price#4, cs_sold_date_sk#5] + +(3) Filter [codegen id : 1] +Input [5]: [cs_warehouse_sk#1, cs_item_sk#2, cs_order_number#3, cs_sales_price#4, cs_sold_date_sk#5] +Condition : (isnotnull(cs_warehouse_sk#1) AND isnotnull(cs_item_sk#2)) + +(4) Exchange +Input [5]: [cs_warehouse_sk#1, cs_item_sk#2, cs_order_number#3, cs_sales_price#4, cs_sold_date_sk#5] +Arguments: hashpartitioning(cs_order_number#3, cs_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#7] + +(5) Sort [codegen id : 2] +Input [5]: [cs_warehouse_sk#1, cs_item_sk#2, cs_order_number#3, cs_sales_price#4, cs_sold_date_sk#5] +Arguments: [cs_order_number#3 ASC NULLS FIRST, cs_item_sk#2 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.catalog_returns +Output [4]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10, cr_returned_date_sk#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [4]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10, cr_returned_date_sk#11] + +(8) Filter [codegen id : 3] +Input [4]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10, cr_returned_date_sk#11] +Condition : (isnotnull(cr_order_number#9) AND isnotnull(cr_item_sk#8)) + +(9) Project [codegen id : 3] +Output [3]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10] +Input [4]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10, cr_returned_date_sk#11] + +(10) Exchange +Input [3]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10] +Arguments: hashpartitioning(cr_order_number#9, cr_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#12] + +(11) Sort [codegen id : 4] +Input [3]: [cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10] +Arguments: [cr_order_number#9 ASC NULLS FIRST, cr_item_sk#8 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 8] +Left keys [2]: [cs_order_number#3, cs_item_sk#2] +Right keys [2]: [cr_order_number#9, cr_item_sk#8] +Join condition: None + +(13) Project [codegen id : 8] +Output [5]: [cs_warehouse_sk#1, cs_item_sk#2, cs_sales_price#4, cs_sold_date_sk#5, cr_refunded_cash#10] +Input [8]: [cs_warehouse_sk#1, cs_item_sk#2, cs_order_number#3, cs_sales_price#4, cs_sold_date_sk#5, cr_item_sk#8, cr_order_number#9, cr_refunded_cash#10] + +(14) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#13, w_state#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 5] +Input [2]: [w_warehouse_sk#13, w_state#14] + +(16) Filter [codegen id : 5] +Input [2]: [w_warehouse_sk#13, w_state#14] +Condition : isnotnull(w_warehouse_sk#13) + +(17) BroadcastExchange +Input [2]: [w_warehouse_sk#13, w_state#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(18) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_warehouse_sk#1] +Right keys [1]: [w_warehouse_sk#13] +Join condition: None + +(19) Project [codegen id : 8] +Output [5]: [cs_item_sk#2, cs_sales_price#4, cs_sold_date_sk#5, cr_refunded_cash#10, w_state#14] +Input [7]: [cs_warehouse_sk#1, cs_item_sk#2, cs_sales_price#4, cs_sold_date_sk#5, cr_refunded_cash#10, w_warehouse_sk#13, w_state#14] + +(20) Scan parquet default.item +Output [3]: [i_item_sk#16, i_item_id#17, i_current_price#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,0.99), LessThanOrEqual(i_current_price,1.49), IsNotNull(i_item_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [3]: [i_item_sk#16, i_item_id#17, i_current_price#18] + +(22) Filter [codegen id : 6] +Input [3]: [i_item_sk#16, i_item_id#17, i_current_price#18] +Condition : (((isnotnull(i_current_price#18) AND (i_current_price#18 >= 0.99)) AND (i_current_price#18 <= 1.49)) AND isnotnull(i_item_sk#16)) + +(23) Project [codegen id : 6] +Output [2]: [i_item_sk#16, i_item_id#17] +Input [3]: [i_item_sk#16, i_item_id#17, i_current_price#18] + +(24) BroadcastExchange +Input [2]: [i_item_sk#16, i_item_id#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] + +(25) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#16] +Join condition: None + +(26) Project [codegen id : 8] +Output [5]: [cs_sales_price#4, cs_sold_date_sk#5, cr_refunded_cash#10, w_state#14, i_item_id#17] +Input [7]: [cs_item_sk#2, cs_sales_price#4, cs_sold_date_sk#5, cr_refunded_cash#10, w_state#14, i_item_sk#16, i_item_id#17] + +(27) Scan parquet default.date_dim +Output [2]: [d_date_sk#20, d_date#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-02-10), LessThanOrEqual(d_date,2000-04-10), IsNotNull(d_date_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 7] +Input [2]: [d_date_sk#20, d_date#21] + +(29) Filter [codegen id : 7] +Input [2]: [d_date_sk#20, d_date#21] +Condition : (((isnotnull(d_date#21) AND (d_date#21 >= 2000-02-10)) AND (d_date#21 <= 2000-04-10)) AND isnotnull(d_date_sk#20)) + +(30) BroadcastExchange +Input [2]: [d_date_sk#20, d_date#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] + +(31) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_sold_date_sk#5] +Right keys [1]: [d_date_sk#20] +Join condition: None + +(32) Project [codegen id : 8] +Output [5]: [cs_sales_price#4, cr_refunded_cash#10, w_state#14, i_item_id#17, d_date#21] +Input [7]: [cs_sales_price#4, cs_sold_date_sk#5, cr_refunded_cash#10, w_state#14, i_item_id#17, d_date_sk#20, d_date#21] + +(33) HashAggregate [codegen id : 8] +Input [5]: [cs_sales_price#4, cr_refunded_cash#10, w_state#14, i_item_id#17, d_date#21] +Keys [2]: [w_state#14, i_item_id#17] +Functions [2]: [partial_sum(CASE WHEN (d_date#21 < 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_date#21 >= 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)] +Aggregate Attributes [4]: [sum#23, isEmpty#24, sum#25, isEmpty#26] +Results [6]: [w_state#14, i_item_id#17, sum#27, isEmpty#28, sum#29, isEmpty#30] + +(34) Exchange +Input [6]: [w_state#14, i_item_id#17, sum#27, isEmpty#28, sum#29, isEmpty#30] +Arguments: hashpartitioning(w_state#14, i_item_id#17, 5), ENSURE_REQUIREMENTS, [id=#31] + +(35) HashAggregate [codegen id : 9] +Input [6]: [w_state#14, i_item_id#17, sum#27, isEmpty#28, sum#29, isEmpty#30] +Keys [2]: [w_state#14, i_item_id#17] +Functions [2]: [sum(CASE WHEN (d_date#21 < 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END), sum(CASE WHEN (d_date#21 >= 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)] +Aggregate Attributes [2]: [sum(CASE WHEN (d_date#21 < 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#32, sum(CASE WHEN (d_date#21 >= 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#33] +Results [4]: [w_state#14, i_item_id#17, sum(CASE WHEN (d_date#21 < 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#32 AS sales_before#34, sum(CASE WHEN (d_date#21 >= 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#4 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash#10 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END)#33 AS sales_after#35] + +(36) TakeOrderedAndProject +Input [4]: [w_state#14, i_item_id#17, sales_before#34, sales_after#35] +Arguments: 100, [w_state#14 ASC NULLS FIRST, i_item_id#17 ASC NULLS FIRST], [w_state#14, i_item_id#17, sales_before#34, sales_after#35] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (37) + + +(37) ReusedExchange [Reuses operator id: 30] +Output [2]: [d_date_sk#20, d_date#21] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40/simplified.txt new file mode 100644 index 0000000000000..9f8f7b0c5fe45 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q40/simplified.txt @@ -0,0 +1,60 @@ +TakeOrderedAndProject [w_state,i_item_id,sales_before,sales_after] + WholeStageCodegen (9) + HashAggregate [w_state,i_item_id,sum,isEmpty,sum,isEmpty] [sum(CASE WHEN (d_date < 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END),sum(CASE WHEN (d_date >= 2000-03-11) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_refunded_cash as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true) ELSE 0.00 END),sales_before,sales_after,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [w_state,i_item_id] #1 + WholeStageCodegen (8) + HashAggregate [w_state,i_item_id,d_date,cs_sales_price,cr_refunded_cash] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + Project [cs_sales_price,cr_refunded_cash,w_state,i_item_id,d_date] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sales_price,cs_sold_date_sk,cr_refunded_cash,w_state,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_sales_price,cs_sold_date_sk,cr_refunded_cash,w_state] + BroadcastHashJoin [cs_warehouse_sk,w_warehouse_sk] + Project [cs_warehouse_sk,cs_item_sk,cs_sales_price,cs_sold_date_sk,cr_refunded_cash] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #2 + WholeStageCodegen (1) + Filter [cs_warehouse_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_warehouse_sk,cs_item_sk,cs_order_number,cs_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date] #3 + InputAdapter + WholeStageCodegen (4) + Sort [cr_order_number,cr_item_sk] + InputAdapter + Exchange [cr_order_number,cr_item_sk] #4 + WholeStageCodegen (3) + Project [cr_item_sk,cr_order_number,cr_refunded_cash] + Filter [cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_refunded_cash,cr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (5) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_state] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Project [i_item_sk,i_item_id] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_current_price] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (7) + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41.sf100/explain.txt new file mode 100644 index 0000000000000..33c03d2b767dd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41.sf100/explain.txt @@ -0,0 +1,120 @@ +== Physical Plan == +TakeOrderedAndProject (20) ++- * HashAggregate (19) + +- Exchange (18) + +- * HashAggregate (17) + +- * Project (16) + +- * BroadcastHashJoin Inner BuildRight (15) + :- * Project (4) + : +- * Filter (3) + : +- * ColumnarToRow (2) + : +- Scan parquet default.item (1) + +- BroadcastExchange (14) + +- * Project (13) + +- * Filter (12) + +- * HashAggregate (11) + +- Exchange (10) + +- * HashAggregate (9) + +- * Project (8) + +- * Filter (7) + +- * ColumnarToRow (6) + +- Scan parquet default.item (5) + + +(1) Scan parquet default.item +Output [3]: [i_manufact_id#1, i_manufact#2, i_product_name#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), GreaterThanOrEqual(i_manufact_id,738), LessThanOrEqual(i_manufact_id,778), IsNotNull(i_manufact)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [i_manufact_id#1, i_manufact#2, i_product_name#3] + +(3) Filter [codegen id : 3] +Input [3]: [i_manufact_id#1, i_manufact#2, i_product_name#3] +Condition : (((isnotnull(i_manufact_id#1) AND (i_manufact_id#1 >= 738)) AND (i_manufact_id#1 <= 778)) AND isnotnull(i_manufact#2)) + +(4) Project [codegen id : 3] +Output [2]: [i_manufact#2, i_product_name#3] +Input [3]: [i_manufact_id#1, i_manufact#2, i_product_name#3] + +(5) Scan parquet default.item +Output [5]: [i_category#4, i_manufact#5, i_size#6, i_color#7, i_units#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(Or(And(EqualTo(i_category,Women ),Or(And(And(Or(EqualTo(i_color,powder ),EqualTo(i_color,khaki )),Or(EqualTo(i_units,Ounce ),EqualTo(i_units,Oz ))),Or(EqualTo(i_size,medium ),EqualTo(i_size,extra large ))),And(And(Or(EqualTo(i_color,brown ),EqualTo(i_color,honeydew )),Or(EqualTo(i_units,Bunch ),EqualTo(i_units,Ton ))),Or(EqualTo(i_size,N/A ),EqualTo(i_size,small ))))),And(EqualTo(i_category,Men ),Or(And(And(Or(EqualTo(i_color,floral ),EqualTo(i_color,deep )),Or(EqualTo(i_units,N/A ),EqualTo(i_units,Dozen ))),Or(EqualTo(i_size,petite ),EqualTo(i_size,large ))),And(And(Or(EqualTo(i_color,light ),EqualTo(i_color,cornflower )),Or(EqualTo(i_units,Box ),EqualTo(i_units,Pound ))),Or(EqualTo(i_size,medium ),EqualTo(i_size,extra large )))))),Or(And(EqualTo(i_category,Women ),Or(And(And(Or(EqualTo(i_color,midnight ),EqualTo(i_color,snow )),Or(EqualTo(i_units,Pallet ),EqualTo(i_units,Gross ))),Or(EqualTo(i_size,medium ),EqualTo(i_size,extra large ))),And(And(Or(EqualTo(i_color,cyan ),EqualTo(i_color,papaya )),Or(EqualTo(i_units,Cup ),EqualTo(i_units,Dram ))),Or(EqualTo(i_size,N/A ),EqualTo(i_size,small ))))),And(EqualTo(i_category,Men ),Or(And(And(Or(EqualTo(i_color,orange ),EqualTo(i_color,frosted )),Or(EqualTo(i_units,Each ),EqualTo(i_units,Tbl ))),Or(EqualTo(i_size,petite ),EqualTo(i_size,large ))),And(And(Or(EqualTo(i_color,forest ),EqualTo(i_color,ghost )),Or(EqualTo(i_units,Lb ),EqualTo(i_units,Bundle ))),Or(EqualTo(i_size,medium ),EqualTo(i_size,extra large ))))))), IsNotNull(i_manufact)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [5]: [i_category#4, i_manufact#5, i_size#6, i_color#7, i_units#8] + +(7) Filter [codegen id : 1] +Input [5]: [i_category#4, i_manufact#5, i_size#6, i_color#7, i_units#8] +Condition : (((((i_category#4 = Women ) AND (((((i_color#7 = powder ) OR (i_color#7 = khaki )) AND ((i_units#8 = Ounce ) OR (i_units#8 = Oz ))) AND ((i_size#6 = medium ) OR (i_size#6 = extra large ))) OR ((((i_color#7 = brown ) OR (i_color#7 = honeydew )) AND ((i_units#8 = Bunch ) OR (i_units#8 = Ton ))) AND ((i_size#6 = N/A ) OR (i_size#6 = small ))))) OR ((i_category#4 = Men ) AND (((((i_color#7 = floral ) OR (i_color#7 = deep )) AND ((i_units#8 = N/A ) OR (i_units#8 = Dozen ))) AND ((i_size#6 = petite ) OR (i_size#6 = large ))) OR ((((i_color#7 = light ) OR (i_color#7 = cornflower )) AND ((i_units#8 = Box ) OR (i_units#8 = Pound ))) AND ((i_size#6 = medium ) OR (i_size#6 = extra large )))))) OR (((i_category#4 = Women ) AND (((((i_color#7 = midnight ) OR (i_color#7 = snow )) AND ((i_units#8 = Pallet ) OR (i_units#8 = Gross ))) AND ((i_size#6 = medium ) OR (i_size#6 = extra large ))) OR ((((i_color#7 = cyan ) OR (i_color#7 = papaya )) AND ((i_units#8 = Cup ) OR (i_units#8 = Dram ))) AND ((i_size#6 = N/A ) OR (i_size#6 = small ))))) OR ((i_category#4 = Men ) AND (((((i_color#7 = orange ) OR (i_color#7 = frosted )) AND ((i_units#8 = Each ) OR (i_units#8 = Tbl ))) AND ((i_size#6 = petite ) OR (i_size#6 = large ))) OR ((((i_color#7 = forest ) OR (i_color#7 = ghost )) AND ((i_units#8 = Lb ) OR (i_units#8 = Bundle ))) AND ((i_size#6 = medium ) OR (i_size#6 = extra large ))))))) AND isnotnull(i_manufact#5)) + +(8) Project [codegen id : 1] +Output [1]: [i_manufact#5] +Input [5]: [i_category#4, i_manufact#5, i_size#6, i_color#7, i_units#8] + +(9) HashAggregate [codegen id : 1] +Input [1]: [i_manufact#5] +Keys [1]: [i_manufact#5] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#9] +Results [2]: [i_manufact#5, count#10] + +(10) Exchange +Input [2]: [i_manufact#5, count#10] +Arguments: hashpartitioning(i_manufact#5, 5), ENSURE_REQUIREMENTS, [id=#11] + +(11) HashAggregate [codegen id : 2] +Input [2]: [i_manufact#5, count#10] +Keys [1]: [i_manufact#5] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#12] +Results [2]: [count(1)#12 AS item_cnt#13, i_manufact#5] + +(12) Filter [codegen id : 2] +Input [2]: [item_cnt#13, i_manufact#5] +Condition : (item_cnt#13 > 0) + +(13) Project [codegen id : 2] +Output [1]: [i_manufact#5] +Input [2]: [item_cnt#13, i_manufact#5] + +(14) BroadcastExchange +Input [1]: [i_manufact#5] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [i_manufact#2] +Right keys [1]: [i_manufact#5] +Join condition: None + +(16) Project [codegen id : 3] +Output [1]: [i_product_name#3] +Input [3]: [i_manufact#2, i_product_name#3, i_manufact#5] + +(17) HashAggregate [codegen id : 3] +Input [1]: [i_product_name#3] +Keys [1]: [i_product_name#3] +Functions: [] +Aggregate Attributes: [] +Results [1]: [i_product_name#3] + +(18) Exchange +Input [1]: [i_product_name#3] +Arguments: hashpartitioning(i_product_name#3, 5), ENSURE_REQUIREMENTS, [id=#15] + +(19) HashAggregate [codegen id : 4] +Input [1]: [i_product_name#3] +Keys [1]: [i_product_name#3] +Functions: [] +Aggregate Attributes: [] +Results [1]: [i_product_name#3] + +(20) TakeOrderedAndProject +Input [1]: [i_product_name#3] +Arguments: 100, [i_product_name#3 ASC NULLS FIRST], [i_product_name#3] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41.sf100/simplified.txt new file mode 100644 index 0000000000000..d36800823bb3f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41.sf100/simplified.txt @@ -0,0 +1,29 @@ +TakeOrderedAndProject [i_product_name] + WholeStageCodegen (4) + HashAggregate [i_product_name] + InputAdapter + Exchange [i_product_name] #1 + WholeStageCodegen (3) + HashAggregate [i_product_name] + Project [i_product_name] + BroadcastHashJoin [i_manufact,i_manufact] + Project [i_manufact,i_product_name] + Filter [i_manufact_id,i_manufact] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_manufact_id,i_manufact,i_product_name] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [i_manufact] + Filter [item_cnt] + HashAggregate [i_manufact,count] [count(1),item_cnt,count] + InputAdapter + Exchange [i_manufact] #3 + WholeStageCodegen (1) + HashAggregate [i_manufact] [count,count] + Project [i_manufact] + Filter [i_category,i_color,i_units,i_size,i_manufact] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_category,i_manufact,i_size,i_color,i_units] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41/explain.txt new file mode 100644 index 0000000000000..33c03d2b767dd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41/explain.txt @@ -0,0 +1,120 @@ +== Physical Plan == +TakeOrderedAndProject (20) ++- * HashAggregate (19) + +- Exchange (18) + +- * HashAggregate (17) + +- * Project (16) + +- * BroadcastHashJoin Inner BuildRight (15) + :- * Project (4) + : +- * Filter (3) + : +- * ColumnarToRow (2) + : +- Scan parquet default.item (1) + +- BroadcastExchange (14) + +- * Project (13) + +- * Filter (12) + +- * HashAggregate (11) + +- Exchange (10) + +- * HashAggregate (9) + +- * Project (8) + +- * Filter (7) + +- * ColumnarToRow (6) + +- Scan parquet default.item (5) + + +(1) Scan parquet default.item +Output [3]: [i_manufact_id#1, i_manufact#2, i_product_name#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), GreaterThanOrEqual(i_manufact_id,738), LessThanOrEqual(i_manufact_id,778), IsNotNull(i_manufact)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [i_manufact_id#1, i_manufact#2, i_product_name#3] + +(3) Filter [codegen id : 3] +Input [3]: [i_manufact_id#1, i_manufact#2, i_product_name#3] +Condition : (((isnotnull(i_manufact_id#1) AND (i_manufact_id#1 >= 738)) AND (i_manufact_id#1 <= 778)) AND isnotnull(i_manufact#2)) + +(4) Project [codegen id : 3] +Output [2]: [i_manufact#2, i_product_name#3] +Input [3]: [i_manufact_id#1, i_manufact#2, i_product_name#3] + +(5) Scan parquet default.item +Output [5]: [i_category#4, i_manufact#5, i_size#6, i_color#7, i_units#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(Or(And(EqualTo(i_category,Women ),Or(And(And(Or(EqualTo(i_color,powder ),EqualTo(i_color,khaki )),Or(EqualTo(i_units,Ounce ),EqualTo(i_units,Oz ))),Or(EqualTo(i_size,medium ),EqualTo(i_size,extra large ))),And(And(Or(EqualTo(i_color,brown ),EqualTo(i_color,honeydew )),Or(EqualTo(i_units,Bunch ),EqualTo(i_units,Ton ))),Or(EqualTo(i_size,N/A ),EqualTo(i_size,small ))))),And(EqualTo(i_category,Men ),Or(And(And(Or(EqualTo(i_color,floral ),EqualTo(i_color,deep )),Or(EqualTo(i_units,N/A ),EqualTo(i_units,Dozen ))),Or(EqualTo(i_size,petite ),EqualTo(i_size,large ))),And(And(Or(EqualTo(i_color,light ),EqualTo(i_color,cornflower )),Or(EqualTo(i_units,Box ),EqualTo(i_units,Pound ))),Or(EqualTo(i_size,medium ),EqualTo(i_size,extra large )))))),Or(And(EqualTo(i_category,Women ),Or(And(And(Or(EqualTo(i_color,midnight ),EqualTo(i_color,snow )),Or(EqualTo(i_units,Pallet ),EqualTo(i_units,Gross ))),Or(EqualTo(i_size,medium ),EqualTo(i_size,extra large ))),And(And(Or(EqualTo(i_color,cyan ),EqualTo(i_color,papaya )),Or(EqualTo(i_units,Cup ),EqualTo(i_units,Dram ))),Or(EqualTo(i_size,N/A ),EqualTo(i_size,small ))))),And(EqualTo(i_category,Men ),Or(And(And(Or(EqualTo(i_color,orange ),EqualTo(i_color,frosted )),Or(EqualTo(i_units,Each ),EqualTo(i_units,Tbl ))),Or(EqualTo(i_size,petite ),EqualTo(i_size,large ))),And(And(Or(EqualTo(i_color,forest ),EqualTo(i_color,ghost )),Or(EqualTo(i_units,Lb ),EqualTo(i_units,Bundle ))),Or(EqualTo(i_size,medium ),EqualTo(i_size,extra large ))))))), IsNotNull(i_manufact)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [5]: [i_category#4, i_manufact#5, i_size#6, i_color#7, i_units#8] + +(7) Filter [codegen id : 1] +Input [5]: [i_category#4, i_manufact#5, i_size#6, i_color#7, i_units#8] +Condition : (((((i_category#4 = Women ) AND (((((i_color#7 = powder ) OR (i_color#7 = khaki )) AND ((i_units#8 = Ounce ) OR (i_units#8 = Oz ))) AND ((i_size#6 = medium ) OR (i_size#6 = extra large ))) OR ((((i_color#7 = brown ) OR (i_color#7 = honeydew )) AND ((i_units#8 = Bunch ) OR (i_units#8 = Ton ))) AND ((i_size#6 = N/A ) OR (i_size#6 = small ))))) OR ((i_category#4 = Men ) AND (((((i_color#7 = floral ) OR (i_color#7 = deep )) AND ((i_units#8 = N/A ) OR (i_units#8 = Dozen ))) AND ((i_size#6 = petite ) OR (i_size#6 = large ))) OR ((((i_color#7 = light ) OR (i_color#7 = cornflower )) AND ((i_units#8 = Box ) OR (i_units#8 = Pound ))) AND ((i_size#6 = medium ) OR (i_size#6 = extra large )))))) OR (((i_category#4 = Women ) AND (((((i_color#7 = midnight ) OR (i_color#7 = snow )) AND ((i_units#8 = Pallet ) OR (i_units#8 = Gross ))) AND ((i_size#6 = medium ) OR (i_size#6 = extra large ))) OR ((((i_color#7 = cyan ) OR (i_color#7 = papaya )) AND ((i_units#8 = Cup ) OR (i_units#8 = Dram ))) AND ((i_size#6 = N/A ) OR (i_size#6 = small ))))) OR ((i_category#4 = Men ) AND (((((i_color#7 = orange ) OR (i_color#7 = frosted )) AND ((i_units#8 = Each ) OR (i_units#8 = Tbl ))) AND ((i_size#6 = petite ) OR (i_size#6 = large ))) OR ((((i_color#7 = forest ) OR (i_color#7 = ghost )) AND ((i_units#8 = Lb ) OR (i_units#8 = Bundle ))) AND ((i_size#6 = medium ) OR (i_size#6 = extra large ))))))) AND isnotnull(i_manufact#5)) + +(8) Project [codegen id : 1] +Output [1]: [i_manufact#5] +Input [5]: [i_category#4, i_manufact#5, i_size#6, i_color#7, i_units#8] + +(9) HashAggregate [codegen id : 1] +Input [1]: [i_manufact#5] +Keys [1]: [i_manufact#5] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#9] +Results [2]: [i_manufact#5, count#10] + +(10) Exchange +Input [2]: [i_manufact#5, count#10] +Arguments: hashpartitioning(i_manufact#5, 5), ENSURE_REQUIREMENTS, [id=#11] + +(11) HashAggregate [codegen id : 2] +Input [2]: [i_manufact#5, count#10] +Keys [1]: [i_manufact#5] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#12] +Results [2]: [count(1)#12 AS item_cnt#13, i_manufact#5] + +(12) Filter [codegen id : 2] +Input [2]: [item_cnt#13, i_manufact#5] +Condition : (item_cnt#13 > 0) + +(13) Project [codegen id : 2] +Output [1]: [i_manufact#5] +Input [2]: [item_cnt#13, i_manufact#5] + +(14) BroadcastExchange +Input [1]: [i_manufact#5] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [i_manufact#2] +Right keys [1]: [i_manufact#5] +Join condition: None + +(16) Project [codegen id : 3] +Output [1]: [i_product_name#3] +Input [3]: [i_manufact#2, i_product_name#3, i_manufact#5] + +(17) HashAggregate [codegen id : 3] +Input [1]: [i_product_name#3] +Keys [1]: [i_product_name#3] +Functions: [] +Aggregate Attributes: [] +Results [1]: [i_product_name#3] + +(18) Exchange +Input [1]: [i_product_name#3] +Arguments: hashpartitioning(i_product_name#3, 5), ENSURE_REQUIREMENTS, [id=#15] + +(19) HashAggregate [codegen id : 4] +Input [1]: [i_product_name#3] +Keys [1]: [i_product_name#3] +Functions: [] +Aggregate Attributes: [] +Results [1]: [i_product_name#3] + +(20) TakeOrderedAndProject +Input [1]: [i_product_name#3] +Arguments: 100, [i_product_name#3 ASC NULLS FIRST], [i_product_name#3] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41/simplified.txt new file mode 100644 index 0000000000000..d36800823bb3f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q41/simplified.txt @@ -0,0 +1,29 @@ +TakeOrderedAndProject [i_product_name] + WholeStageCodegen (4) + HashAggregate [i_product_name] + InputAdapter + Exchange [i_product_name] #1 + WholeStageCodegen (3) + HashAggregate [i_product_name] + Project [i_product_name] + BroadcastHashJoin [i_manufact,i_manufact] + Project [i_manufact,i_product_name] + Filter [i_manufact_id,i_manufact] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_manufact_id,i_manufact,i_product_name] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [i_manufact] + Filter [item_cnt] + HashAggregate [i_manufact,count] [count(1),item_cnt,count] + InputAdapter + Exchange [i_manufact] #3 + WholeStageCodegen (1) + HashAggregate [i_manufact] [count,count] + Project [i_manufact] + Filter [i_category,i_color,i_units,i_size,i_manufact] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_category,i_manufact,i_size,i_color,i_units] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/explain.txt new file mode 100644 index 0000000000000..30a7a786e42ca --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/explain.txt @@ -0,0 +1,133 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.date_dim (11) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [4]: [i_item_sk#5, i_category_id#6, i_category#7, i_manager_id#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#5, i_category_id#6, i_category#7, i_manager_id#8] + +(6) Filter [codegen id : 1] +Input [4]: [i_item_sk#5, i_category_id#6, i_category#7, i_manager_id#8] +Condition : ((isnotnull(i_manager_id#8) AND (i_manager_id#8 = 1)) AND isnotnull(i_item_sk#5)) + +(7) Project [codegen id : 1] +Output [3]: [i_item_sk#5, i_category_id#6, i_category#7] +Input [4]: [i_item_sk#5, i_category_id#6, i_category#7, i_manager_id#8] + +(8) BroadcastExchange +Input [3]: [i_item_sk#5, i_category_id#6, i_category#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(10) Project [codegen id : 3] +Output [4]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_category_id#6, i_category#7] +Input [6]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_sk#5, i_category_id#6, i_category#7] + +(11) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(13) Filter [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Condition : ((((isnotnull(d_moy#12) AND isnotnull(d_year#11)) AND (d_moy#12 = 11)) AND (d_year#11 = 2000)) AND isnotnull(d_date_sk#10)) + +(14) Project [codegen id : 2] +Output [2]: [d_date_sk#10, d_year#11] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(15) BroadcastExchange +Input [2]: [d_date_sk#10, d_year#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_year#11, ss_ext_sales_price#2, i_category_id#6, i_category#7] +Input [6]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_category_id#6, i_category#7, d_date_sk#10, d_year#11] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_year#11, ss_ext_sales_price#2, i_category_id#6, i_category#7] +Keys [3]: [d_year#11, i_category_id#6, i_category#7] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#14] +Results [4]: [d_year#11, i_category_id#6, i_category#7, sum#15] + +(19) Exchange +Input [4]: [d_year#11, i_category_id#6, i_category#7, sum#15] +Arguments: hashpartitioning(d_year#11, i_category_id#6, i_category#7, 5), ENSURE_REQUIREMENTS, [id=#16] + +(20) HashAggregate [codegen id : 4] +Input [4]: [d_year#11, i_category_id#6, i_category#7, sum#15] +Keys [3]: [d_year#11, i_category_id#6, i_category#7] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#17] +Results [4]: [d_year#11, i_category_id#6, i_category#7, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#17,17,2) AS sum(ss_ext_sales_price)#18] + +(21) TakeOrderedAndProject +Input [4]: [d_year#11, i_category_id#6, i_category#7, sum(ss_ext_sales_price)#18] +Arguments: 100, [sum(ss_ext_sales_price)#18 DESC NULLS LAST, d_year#11 ASC NULLS FIRST, i_category_id#6 ASC NULLS FIRST, i_category#7 ASC NULLS FIRST], [d_year#11, i_category_id#6, i_category#7, sum(ss_ext_sales_price)#18] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (22) + + +(22) ReusedExchange [Reuses operator id: 15] +Output [2]: [d_date_sk#10, d_year#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/simplified.txt new file mode 100644 index 0000000000000..f1c1be7e7e41f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42.sf100/simplified.txt @@ -0,0 +1,33 @@ +TakeOrderedAndProject [sum(ss_ext_sales_price),d_year,i_category_id,i_category] + WholeStageCodegen (4) + HashAggregate [d_year,i_category_id,i_category,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(ss_ext_sales_price),sum] + InputAdapter + Exchange [d_year,i_category_id,i_category] #1 + WholeStageCodegen (3) + HashAggregate [d_year,i_category_id,i_category,ss_ext_sales_price] [sum,sum] + Project [d_year,ss_ext_sales_price,i_category_id,i_category] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_ext_sales_price,ss_sold_date_sk,i_category_id,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_category_id,i_category] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_category_id,i_category,i_manager_id] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk,d_year] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42/explain.txt new file mode 100644 index 0000000000000..d16b4bca7c3f4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42/explain.txt @@ -0,0 +1,123 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- BroadcastExchange (8) + : +- * Filter (7) + : +- * ColumnarToRow (6) + : +- Scan parquet default.store_sales (5) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 11)) AND (d_year#2 = 2000)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 3] +Output [2]: [d_date_sk#1, d_year#2] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) Scan parquet default.store_sales +Output [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(7) Filter [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Condition : isnotnull(ss_item_sk#4) + +(8) BroadcastExchange +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5] +Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(11) Scan parquet default.item +Output [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11] + +(13) Filter [codegen id : 2] +Input [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11] +Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 1)) AND isnotnull(i_item_sk#8)) + +(14) Project [codegen id : 2] +Output [3]: [i_item_sk#8, i_category_id#9, i_category#10] +Input [4]: [i_item_sk#8, i_category_id#9, i_category#10, i_manager_id#11] + +(15) BroadcastExchange +Input [3]: [i_item_sk#8, i_category_id#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#4] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_year#2, ss_ext_sales_price#5, i_category_id#9, i_category#10] +Input [6]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_category_id#9, i_category#10] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_year#2, ss_ext_sales_price#5, i_category_id#9, i_category#10] +Keys [3]: [d_year#2, i_category_id#9, i_category#10] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum#13] +Results [4]: [d_year#2, i_category_id#9, i_category#10, sum#14] + +(19) Exchange +Input [4]: [d_year#2, i_category_id#9, i_category#10, sum#14] +Arguments: hashpartitioning(d_year#2, i_category_id#9, i_category#10, 5), ENSURE_REQUIREMENTS, [id=#15] + +(20) HashAggregate [codegen id : 4] +Input [4]: [d_year#2, i_category_id#9, i_category#10, sum#14] +Keys [3]: [d_year#2, i_category_id#9, i_category#10] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#16] +Results [4]: [d_year#2, i_category_id#9, i_category#10, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#16,17,2) AS sum(ss_ext_sales_price)#17] + +(21) TakeOrderedAndProject +Input [4]: [d_year#2, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17] +Arguments: 100, [sum(ss_ext_sales_price)#17 DESC NULLS LAST, d_year#2 ASC NULLS FIRST, i_category_id#9 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [d_year#2, i_category_id#9, i_category#10, sum(ss_ext_sales_price)#17] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42/simplified.txt new file mode 100644 index 0000000000000..4806a9309bd90 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q42/simplified.txt @@ -0,0 +1,31 @@ +TakeOrderedAndProject [sum(ss_ext_sales_price),d_year,i_category_id,i_category] + WholeStageCodegen (4) + HashAggregate [d_year,i_category_id,i_category,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(ss_ext_sales_price),sum] + InputAdapter + Exchange [d_year,i_category_id,i_category] #1 + WholeStageCodegen (3) + HashAggregate [d_year,i_category_id,i_category,ss_ext_sales_price] [sum,sum] + Project [d_year,ss_ext_sales_price,i_category_id,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [d_year,ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [d_date_sk,d_year] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_category_id,i_category] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_category_id,i_category,i_manager_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/explain.txt new file mode 100644 index 0000000000000..d626333970af9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/explain.txt @@ -0,0 +1,133 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildLeft (9) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_sales (6) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.store (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_day_name#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] + +(3) Filter [codegen id : 1] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] +Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2000)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [d_date_sk#1, d_day_name#3] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] + +(5) BroadcastExchange +Input [2]: [d_date_sk#1, d_day_name#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#4] + +(6) Scan parquet default.store_sales +Output [3]: [ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [3]: [ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] + +(8) Filter +Input [3]: [ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] +Condition : isnotnull(ss_store_sk#5) + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#7] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [d_day_name#3, ss_store_sk#5, ss_sales_price#6] +Input [5]: [d_date_sk#1, d_day_name#3, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] + +(11) Scan parquet default.store +Output [4]: [s_store_sk#9, s_store_id#10, s_store_name#11, s_gmt_offset#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_gmt_offset), EqualTo(s_gmt_offset,-5.00), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [s_store_sk#9, s_store_id#10, s_store_name#11, s_gmt_offset#12] + +(13) Filter [codegen id : 2] +Input [4]: [s_store_sk#9, s_store_id#10, s_store_name#11, s_gmt_offset#12] +Condition : ((isnotnull(s_gmt_offset#12) AND (s_gmt_offset#12 = -5.00)) AND isnotnull(s_store_sk#9)) + +(14) Project [codegen id : 2] +Output [3]: [s_store_sk#9, s_store_id#10, s_store_name#11] +Input [4]: [s_store_sk#9, s_store_id#10, s_store_name#11, s_gmt_offset#12] + +(15) BroadcastExchange +Input [3]: [s_store_sk#9, s_store_id#10, s_store_name#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#5] +Right keys [1]: [s_store_sk#9] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_day_name#3, ss_sales_price#6, s_store_id#10, s_store_name#11] +Input [6]: [d_day_name#3, ss_store_sk#5, ss_sales_price#6, s_store_sk#9, s_store_id#10, s_store_name#11] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_day_name#3, ss_sales_price#6, s_store_id#10, s_store_name#11] +Keys [2]: [s_store_name#11, s_store_id#10] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#6 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#6 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#6 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#6 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#6 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#6 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#6 ELSE null END))] +Aggregate Attributes [7]: [sum#14, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20] +Results [9]: [s_store_name#11, s_store_id#10, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27] + +(19) Exchange +Input [9]: [s_store_name#11, s_store_id#10, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27] +Arguments: hashpartitioning(s_store_name#11, s_store_id#10, 5), ENSURE_REQUIREMENTS, [id=#28] + +(20) HashAggregate [codegen id : 4] +Input [9]: [s_store_name#11, s_store_id#10, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26, sum#27] +Keys [2]: [s_store_name#11, s_store_id#10] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#6 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#6 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#6 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#6 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#6 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#6 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#6 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#6 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#6 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#6 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#6 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#6 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#6 ELSE null END))#34, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#6 ELSE null END))#35] +Results [9]: [s_store_name#11, s_store_id#10, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#6 ELSE null END))#29,17,2) AS sun_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#6 ELSE null END))#30,17,2) AS mon_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#6 ELSE null END))#31,17,2) AS tue_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#6 ELSE null END))#32,17,2) AS wed_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#6 ELSE null END))#33,17,2) AS thu_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#6 ELSE null END))#34,17,2) AS fri_sales#41, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#6 ELSE null END))#35,17,2) AS sat_sales#42] + +(21) TakeOrderedAndProject +Input [9]: [s_store_name#11, s_store_id#10, sun_sales#36, mon_sales#37, tue_sales#38, wed_sales#39, thu_sales#40, fri_sales#41, sat_sales#42] +Arguments: 100, [s_store_name#11 ASC NULLS FIRST, s_store_id#10 ASC NULLS FIRST, sun_sales#36 ASC NULLS FIRST, mon_sales#37 ASC NULLS FIRST, tue_sales#38 ASC NULLS FIRST, wed_sales#39 ASC NULLS FIRST, thu_sales#40 ASC NULLS FIRST, fri_sales#41 ASC NULLS FIRST, sat_sales#42 ASC NULLS FIRST], [s_store_name#11, s_store_id#10, sun_sales#36, mon_sales#37, tue_sales#38, wed_sales#39, thu_sales#40, fri_sales#41, sat_sales#42] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (22) + + +(22) ReusedExchange [Reuses operator id: 5] +Output [2]: [d_date_sk#1, d_day_name#3] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/simplified.txt new file mode 100644 index 0000000000000..1fbb5aa612fa9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43.sf100/simplified.txt @@ -0,0 +1,33 @@ +TakeOrderedAndProject [s_store_name,s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + WholeStageCodegen (4) + HashAggregate [s_store_name,s_store_id,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN ss_sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + Exchange [s_store_name,s_store_id] #1 + WholeStageCodegen (3) + HashAggregate [s_store_name,s_store_id,d_day_name,ss_sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [d_day_name,ss_sales_price,s_store_id,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [d_day_name,ss_store_sk,ss_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk,d_day_name] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_day_name] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_day_name] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [s_store_sk,s_store_id,s_store_name] + Filter [s_gmt_offset,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id,s_store_name,s_gmt_offset] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43/explain.txt new file mode 100644 index 0000000000000..24af5d2e813cb --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43/explain.txt @@ -0,0 +1,123 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- BroadcastExchange (8) + : +- * Filter (7) + : +- * ColumnarToRow (6) + : +- Scan parquet default.store_sales (5) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.store (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_day_name#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] + +(3) Filter [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] +Condition : ((isnotnull(d_year#2) AND (d_year#2 = 2000)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 3] +Output [2]: [d_date_sk#1, d_day_name#3] +Input [3]: [d_date_sk#1, d_year#2, d_day_name#3] + +(5) Scan parquet default.store_sales +Output [3]: [ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] + +(7) Filter [codegen id : 1] +Input [3]: [ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] +Condition : isnotnull(ss_store_sk#4) + +(8) BroadcastExchange +Input [3]: [ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [d_day_name#3, ss_store_sk#4, ss_sales_price#5] +Input [5]: [d_date_sk#1, d_day_name#3, ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] + +(11) Scan parquet default.store +Output [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_gmt_offset), EqualTo(s_gmt_offset,-5.00), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11] + +(13) Filter [codegen id : 2] +Input [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11] +Condition : ((isnotnull(s_gmt_offset#11) AND (s_gmt_offset#11 = -5.00)) AND isnotnull(s_store_sk#8)) + +(14) Project [codegen id : 2] +Output [3]: [s_store_sk#8, s_store_id#9, s_store_name#10] +Input [4]: [s_store_sk#8, s_store_id#9, s_store_name#10, s_gmt_offset#11] + +(15) BroadcastExchange +Input [3]: [s_store_sk#8, s_store_id#9, s_store_name#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#8] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_day_name#3, ss_sales_price#5, s_store_id#9, s_store_name#10] +Input [6]: [d_day_name#3, ss_store_sk#4, ss_sales_price#5, s_store_sk#8, s_store_id#9, s_store_name#10] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_day_name#3, ss_sales_price#5, s_store_id#9, s_store_name#10] +Keys [2]: [s_store_name#10, s_store_id#9] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#5 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#5 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#5 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#5 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#5 ELSE null END))] +Aggregate Attributes [7]: [sum#13, sum#14, sum#15, sum#16, sum#17, sum#18, sum#19] +Results [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] + +(19) Exchange +Input [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Arguments: hashpartitioning(s_store_name#10, s_store_id#9, 5), ENSURE_REQUIREMENTS, [id=#27] + +(20) HashAggregate [codegen id : 4] +Input [9]: [s_store_name#10, s_store_id#9, sum#20, sum#21, sum#22, sum#23, sum#24, sum#25, sum#26] +Keys [2]: [s_store_name#10, s_store_id#9] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#5 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#5 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#5 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#5 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#5 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#5 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#5 ELSE null END))#29, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#5 ELSE null END))#30, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 ELSE null END))#31, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 ELSE null END))#32, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#5 ELSE null END))#33, sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#5 ELSE null END))#34] +Results [9]: [s_store_name#10, s_store_id#9, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Sunday ) THEN ss_sales_price#5 ELSE null END))#28,17,2) AS sun_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Monday ) THEN ss_sales_price#5 ELSE null END))#29,17,2) AS mon_sales#36, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Tuesday ) THEN ss_sales_price#5 ELSE null END))#30,17,2) AS tue_sales#37, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Wednesday) THEN ss_sales_price#5 ELSE null END))#31,17,2) AS wed_sales#38, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Thursday ) THEN ss_sales_price#5 ELSE null END))#32,17,2) AS thu_sales#39, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Friday ) THEN ss_sales_price#5 ELSE null END))#33,17,2) AS fri_sales#40, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#3 = Saturday ) THEN ss_sales_price#5 ELSE null END))#34,17,2) AS sat_sales#41] + +(21) TakeOrderedAndProject +Input [9]: [s_store_name#10, s_store_id#9, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41] +Arguments: 100, [s_store_name#10 ASC NULLS FIRST, s_store_id#9 ASC NULLS FIRST, sun_sales#35 ASC NULLS FIRST, mon_sales#36 ASC NULLS FIRST, tue_sales#37 ASC NULLS FIRST, wed_sales#38 ASC NULLS FIRST, thu_sales#39 ASC NULLS FIRST, fri_sales#40 ASC NULLS FIRST, sat_sales#41 ASC NULLS FIRST], [s_store_name#10, s_store_id#9, sun_sales#35, mon_sales#36, tue_sales#37, wed_sales#38, thu_sales#39, fri_sales#40, sat_sales#41] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43/simplified.txt new file mode 100644 index 0000000000000..2d292e81891af --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q43/simplified.txt @@ -0,0 +1,31 @@ +TakeOrderedAndProject [s_store_name,s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + WholeStageCodegen (4) + HashAggregate [s_store_name,s_store_id,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN ss_sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + Exchange [s_store_name,s_store_id] #1 + WholeStageCodegen (3) + HashAggregate [s_store_name,s_store_id,d_day_name,ss_sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [d_day_name,ss_sales_price,s_store_id,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [d_day_name,ss_store_sk,ss_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [d_date_sk,d_day_name] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_day_name] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [s_store_sk,s_store_id,s_store_name] + Filter [s_gmt_offset,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id,s_store_name,s_gmt_offset] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44.sf100/explain.txt new file mode 100644 index 0000000000000..84a8547e3f6ef --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44.sf100/explain.txt @@ -0,0 +1,248 @@ +== Physical Plan == +TakeOrderedAndProject (36) ++- * Project (35) + +- * BroadcastHashJoin Inner BuildRight (34) + :- * Project (32) + : +- * BroadcastHashJoin Inner BuildRight (31) + : :- * Project (26) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- * Project (14) + : : : +- * Filter (13) + : : : +- Window (12) + : : : +- * Sort (11) + : : : +- Exchange (10) + : : : +- * Project (9) + : : : +- * Filter (8) + : : : +- * HashAggregate (7) + : : : +- Exchange (6) + : : : +- * HashAggregate (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (24) + : : +- * Project (23) + : : +- * Filter (22) + : : +- Window (21) + : : +- * Sort (20) + : : +- Exchange (19) + : : +- * Project (18) + : : +- * Filter (17) + : : +- * HashAggregate (16) + : : +- ReusedExchange (15) + : +- BroadcastExchange (30) + : +- * Filter (29) + : +- * ColumnarToRow (28) + : +- Scan parquet default.item (27) + +- ReusedExchange (33) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_net_profit#3, ss_sold_date_sk#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_store_sk), EqualTo(ss_store_sk,4)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_net_profit#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 1] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_net_profit#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_store_sk#2) AND (ss_store_sk#2 = 4)) + +(4) Project [codegen id : 1] +Output [2]: [ss_item_sk#1, ss_net_profit#3] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_net_profit#3, ss_sold_date_sk#4] + +(5) HashAggregate [codegen id : 1] +Input [2]: [ss_item_sk#1, ss_net_profit#3] +Keys [1]: [ss_item_sk#1] +Functions [1]: [partial_avg(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [2]: [sum#5, count#6] +Results [3]: [ss_item_sk#1, sum#7, count#8] + +(6) Exchange +Input [3]: [ss_item_sk#1, sum#7, count#8] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] + +(7) HashAggregate [codegen id : 2] +Input [3]: [ss_item_sk#1, sum#7, count#8] +Keys [1]: [ss_item_sk#1] +Functions [1]: [avg(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_profit#3))#10] +Results [3]: [ss_item_sk#1 AS item_sk#11, cast((avg(UnscaledValue(ss_net_profit#3))#10 / 100.0) as decimal(11,6)) AS rank_col#12, cast((avg(UnscaledValue(ss_net_profit#3))#10 / 100.0) as decimal(11,6)) AS avg(ss_net_profit#3)#13] + +(8) Filter [codegen id : 2] +Input [3]: [item_sk#11, rank_col#12, avg(ss_net_profit#3)#13] +Condition : (isnotnull(avg(ss_net_profit#3)#13) AND (cast(avg(ss_net_profit#3)#13 as decimal(13,7)) > CheckOverflow((0.900000 * promote_precision(Subquery scalar-subquery#14, [id=#15])), DecimalType(13,7), true))) + +(9) Project [codegen id : 2] +Output [2]: [item_sk#11, rank_col#12] +Input [3]: [item_sk#11, rank_col#12, avg(ss_net_profit#3)#13] + +(10) Exchange +Input [2]: [item_sk#11, rank_col#12] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#16] + +(11) Sort [codegen id : 3] +Input [2]: [item_sk#11, rank_col#12] +Arguments: [rank_col#12 ASC NULLS FIRST], false, 0 + +(12) Window +Input [2]: [item_sk#11, rank_col#12] +Arguments: [rank(rank_col#12) windowspecdefinition(rank_col#12 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rnk#17], [rank_col#12 ASC NULLS FIRST] + +(13) Filter [codegen id : 10] +Input [3]: [item_sk#11, rank_col#12, rnk#17] +Condition : ((rnk#17 < 11) AND isnotnull(item_sk#11)) + +(14) Project [codegen id : 10] +Output [2]: [item_sk#11, rnk#17] +Input [3]: [item_sk#11, rank_col#12, rnk#17] + +(15) ReusedExchange [Reuses operator id: 6] +Output [3]: [ss_item_sk#18, sum#19, count#20] + +(16) HashAggregate [codegen id : 5] +Input [3]: [ss_item_sk#18, sum#19, count#20] +Keys [1]: [ss_item_sk#18] +Functions [1]: [avg(UnscaledValue(ss_net_profit#21))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_profit#21))#22] +Results [3]: [ss_item_sk#18 AS item_sk#23, cast((avg(UnscaledValue(ss_net_profit#21))#22 / 100.0) as decimal(11,6)) AS rank_col#24, cast((avg(UnscaledValue(ss_net_profit#21))#22 / 100.0) as decimal(11,6)) AS avg(ss_net_profit#21)#25] + +(17) Filter [codegen id : 5] +Input [3]: [item_sk#23, rank_col#24, avg(ss_net_profit#21)#25] +Condition : (isnotnull(avg(ss_net_profit#21)#25) AND (cast(avg(ss_net_profit#21)#25 as decimal(13,7)) > CheckOverflow((0.900000 * promote_precision(ReusedSubquery Subquery scalar-subquery#14, [id=#15])), DecimalType(13,7), true))) + +(18) Project [codegen id : 5] +Output [2]: [item_sk#23, rank_col#24] +Input [3]: [item_sk#23, rank_col#24, avg(ss_net_profit#21)#25] + +(19) Exchange +Input [2]: [item_sk#23, rank_col#24] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#26] + +(20) Sort [codegen id : 6] +Input [2]: [item_sk#23, rank_col#24] +Arguments: [rank_col#24 DESC NULLS LAST], false, 0 + +(21) Window +Input [2]: [item_sk#23, rank_col#24] +Arguments: [rank(rank_col#24) windowspecdefinition(rank_col#24 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rnk#27], [rank_col#24 DESC NULLS LAST] + +(22) Filter [codegen id : 7] +Input [3]: [item_sk#23, rank_col#24, rnk#27] +Condition : ((rnk#27 < 11) AND isnotnull(item_sk#23)) + +(23) Project [codegen id : 7] +Output [2]: [item_sk#23, rnk#27] +Input [3]: [item_sk#23, rank_col#24, rnk#27] + +(24) BroadcastExchange +Input [2]: [item_sk#23, rnk#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#28] + +(25) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [rnk#17] +Right keys [1]: [rnk#27] +Join condition: None + +(26) Project [codegen id : 10] +Output [3]: [item_sk#11, rnk#17, item_sk#23] +Input [4]: [item_sk#11, rnk#17, item_sk#23, rnk#27] + +(27) Scan parquet default.item +Output [2]: [i_item_sk#29, i_product_name#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 8] +Input [2]: [i_item_sk#29, i_product_name#30] + +(29) Filter [codegen id : 8] +Input [2]: [i_item_sk#29, i_product_name#30] +Condition : isnotnull(i_item_sk#29) + +(30) BroadcastExchange +Input [2]: [i_item_sk#29, i_product_name#30] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] + +(31) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [item_sk#11] +Right keys [1]: [i_item_sk#29] +Join condition: None + +(32) Project [codegen id : 10] +Output [3]: [rnk#17, item_sk#23, i_product_name#30] +Input [5]: [item_sk#11, rnk#17, item_sk#23, i_item_sk#29, i_product_name#30] + +(33) ReusedExchange [Reuses operator id: 30] +Output [2]: [i_item_sk#32, i_product_name#33] + +(34) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [item_sk#23] +Right keys [1]: [i_item_sk#32] +Join condition: None + +(35) Project [codegen id : 10] +Output [3]: [rnk#17, i_product_name#30 AS best_performing#34, i_product_name#33 AS worst_performing#35] +Input [5]: [rnk#17, item_sk#23, i_product_name#30, i_item_sk#32, i_product_name#33] + +(36) TakeOrderedAndProject +Input [3]: [rnk#17, best_performing#34, worst_performing#35] +Arguments: 100, [rnk#17 ASC NULLS FIRST], [rnk#17, best_performing#34, worst_performing#35] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 8 Hosting Expression = Subquery scalar-subquery#14, [id=#15] +* HashAggregate (43) ++- Exchange (42) + +- * HashAggregate (41) + +- * Project (40) + +- * Filter (39) + +- * ColumnarToRow (38) + +- Scan parquet default.store_sales (37) + + +(37) Scan parquet default.store_sales +Output [4]: [ss_addr_sk#36, ss_store_sk#37, ss_net_profit#38, ss_sold_date_sk#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_store_sk), EqualTo(ss_store_sk,4), IsNull(ss_addr_sk)] +ReadSchema: struct + +(38) ColumnarToRow [codegen id : 1] +Input [4]: [ss_addr_sk#36, ss_store_sk#37, ss_net_profit#38, ss_sold_date_sk#39] + +(39) Filter [codegen id : 1] +Input [4]: [ss_addr_sk#36, ss_store_sk#37, ss_net_profit#38, ss_sold_date_sk#39] +Condition : ((isnotnull(ss_store_sk#37) AND (ss_store_sk#37 = 4)) AND isnull(ss_addr_sk#36)) + +(40) Project [codegen id : 1] +Output [2]: [ss_store_sk#37, ss_net_profit#38] +Input [4]: [ss_addr_sk#36, ss_store_sk#37, ss_net_profit#38, ss_sold_date_sk#39] + +(41) HashAggregate [codegen id : 1] +Input [2]: [ss_store_sk#37, ss_net_profit#38] +Keys [1]: [ss_store_sk#37] +Functions [1]: [partial_avg(UnscaledValue(ss_net_profit#38))] +Aggregate Attributes [2]: [sum#40, count#41] +Results [3]: [ss_store_sk#37, sum#42, count#43] + +(42) Exchange +Input [3]: [ss_store_sk#37, sum#42, count#43] +Arguments: hashpartitioning(ss_store_sk#37, 5), ENSURE_REQUIREMENTS, [id=#44] + +(43) HashAggregate [codegen id : 2] +Input [3]: [ss_store_sk#37, sum#42, count#43] +Keys [1]: [ss_store_sk#37] +Functions [1]: [avg(UnscaledValue(ss_net_profit#38))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_profit#38))#45] +Results [1]: [cast((avg(UnscaledValue(ss_net_profit#38))#45 / 100.0) as decimal(11,6)) AS rank_col#46] + +Subquery:2 Hosting operator id = 17 Hosting Expression = ReusedSubquery Subquery scalar-subquery#14, [id=#15] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44.sf100/simplified.txt new file mode 100644 index 0000000000000..73bc3a333b631 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44.sf100/simplified.txt @@ -0,0 +1,68 @@ +TakeOrderedAndProject [rnk,best_performing,worst_performing] + WholeStageCodegen (10) + Project [rnk,i_product_name,i_product_name] + BroadcastHashJoin [item_sk,i_item_sk] + Project [rnk,item_sk,i_product_name] + BroadcastHashJoin [item_sk,i_item_sk] + Project [item_sk,rnk,item_sk] + BroadcastHashJoin [rnk,rnk] + Project [item_sk,rnk] + Filter [rnk,item_sk] + InputAdapter + Window [rank_col] + WholeStageCodegen (3) + Sort [rank_col] + InputAdapter + Exchange #1 + WholeStageCodegen (2) + Project [item_sk,rank_col] + Filter [avg(ss_net_profit)] + Subquery #1 + WholeStageCodegen (2) + HashAggregate [ss_store_sk,sum,count] [avg(UnscaledValue(ss_net_profit)),rank_col,sum,count] + InputAdapter + Exchange [ss_store_sk] #3 + WholeStageCodegen (1) + HashAggregate [ss_store_sk,ss_net_profit] [sum,count,sum,count] + Project [ss_store_sk,ss_net_profit] + Filter [ss_store_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_addr_sk,ss_store_sk,ss_net_profit,ss_sold_date_sk] + HashAggregate [ss_item_sk,sum,count] [avg(UnscaledValue(ss_net_profit)),item_sk,rank_col,avg(ss_net_profit),sum,count] + InputAdapter + Exchange [ss_item_sk] #2 + WholeStageCodegen (1) + HashAggregate [ss_item_sk,ss_net_profit] [sum,count,sum,count] + Project [ss_item_sk,ss_net_profit] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_net_profit,ss_sold_date_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (7) + Project [item_sk,rnk] + Filter [rnk,item_sk] + InputAdapter + Window [rank_col] + WholeStageCodegen (6) + Sort [rank_col] + InputAdapter + Exchange #5 + WholeStageCodegen (5) + Project [item_sk,rank_col] + Filter [avg(ss_net_profit)] + ReusedSubquery [rank_col] #1 + HashAggregate [ss_item_sk,sum,count] [avg(UnscaledValue(ss_net_profit)),item_sk,rank_col,avg(ss_net_profit),sum,count] + InputAdapter + ReusedExchange [ss_item_sk,sum,count] #2 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (8) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_product_name] + InputAdapter + ReusedExchange [i_item_sk,i_product_name] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44/explain.txt new file mode 100644 index 0000000000000..b42ddd8db7836 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44/explain.txt @@ -0,0 +1,253 @@ +== Physical Plan == +TakeOrderedAndProject (37) ++- * Project (36) + +- * BroadcastHashJoin Inner BuildRight (35) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Project (27) + : : +- * SortMergeJoin Inner (26) + : : :- * Sort (15) + : : : +- * Project (14) + : : : +- * Filter (13) + : : : +- Window (12) + : : : +- * Sort (11) + : : : +- Exchange (10) + : : : +- * Project (9) + : : : +- * Filter (8) + : : : +- * HashAggregate (7) + : : : +- Exchange (6) + : : : +- * HashAggregate (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- * Sort (25) + : : +- * Project (24) + : : +- * Filter (23) + : : +- Window (22) + : : +- * Sort (21) + : : +- Exchange (20) + : : +- * Project (19) + : : +- * Filter (18) + : : +- * HashAggregate (17) + : : +- ReusedExchange (16) + : +- BroadcastExchange (31) + : +- * Filter (30) + : +- * ColumnarToRow (29) + : +- Scan parquet default.item (28) + +- ReusedExchange (34) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_net_profit#3, ss_sold_date_sk#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_store_sk), EqualTo(ss_store_sk,4)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_net_profit#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 1] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_net_profit#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_store_sk#2) AND (ss_store_sk#2 = 4)) + +(4) Project [codegen id : 1] +Output [2]: [ss_item_sk#1, ss_net_profit#3] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_net_profit#3, ss_sold_date_sk#4] + +(5) HashAggregate [codegen id : 1] +Input [2]: [ss_item_sk#1, ss_net_profit#3] +Keys [1]: [ss_item_sk#1] +Functions [1]: [partial_avg(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [2]: [sum#5, count#6] +Results [3]: [ss_item_sk#1, sum#7, count#8] + +(6) Exchange +Input [3]: [ss_item_sk#1, sum#7, count#8] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] + +(7) HashAggregate [codegen id : 2] +Input [3]: [ss_item_sk#1, sum#7, count#8] +Keys [1]: [ss_item_sk#1] +Functions [1]: [avg(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_profit#3))#10] +Results [3]: [ss_item_sk#1 AS item_sk#11, cast((avg(UnscaledValue(ss_net_profit#3))#10 / 100.0) as decimal(11,6)) AS rank_col#12, cast((avg(UnscaledValue(ss_net_profit#3))#10 / 100.0) as decimal(11,6)) AS avg(ss_net_profit#3)#13] + +(8) Filter [codegen id : 2] +Input [3]: [item_sk#11, rank_col#12, avg(ss_net_profit#3)#13] +Condition : (isnotnull(avg(ss_net_profit#3)#13) AND (cast(avg(ss_net_profit#3)#13 as decimal(13,7)) > CheckOverflow((0.900000 * promote_precision(Subquery scalar-subquery#14, [id=#15])), DecimalType(13,7), true))) + +(9) Project [codegen id : 2] +Output [2]: [item_sk#11, rank_col#12] +Input [3]: [item_sk#11, rank_col#12, avg(ss_net_profit#3)#13] + +(10) Exchange +Input [2]: [item_sk#11, rank_col#12] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#16] + +(11) Sort [codegen id : 3] +Input [2]: [item_sk#11, rank_col#12] +Arguments: [rank_col#12 ASC NULLS FIRST], false, 0 + +(12) Window +Input [2]: [item_sk#11, rank_col#12] +Arguments: [rank(rank_col#12) windowspecdefinition(rank_col#12 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rnk#17], [rank_col#12 ASC NULLS FIRST] + +(13) Filter [codegen id : 4] +Input [3]: [item_sk#11, rank_col#12, rnk#17] +Condition : ((rnk#17 < 11) AND isnotnull(item_sk#11)) + +(14) Project [codegen id : 4] +Output [2]: [item_sk#11, rnk#17] +Input [3]: [item_sk#11, rank_col#12, rnk#17] + +(15) Sort [codegen id : 4] +Input [2]: [item_sk#11, rnk#17] +Arguments: [rnk#17 ASC NULLS FIRST], false, 0 + +(16) ReusedExchange [Reuses operator id: 6] +Output [3]: [ss_item_sk#18, sum#19, count#20] + +(17) HashAggregate [codegen id : 6] +Input [3]: [ss_item_sk#18, sum#19, count#20] +Keys [1]: [ss_item_sk#18] +Functions [1]: [avg(UnscaledValue(ss_net_profit#21))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_profit#21))#22] +Results [3]: [ss_item_sk#18 AS item_sk#23, cast((avg(UnscaledValue(ss_net_profit#21))#22 / 100.0) as decimal(11,6)) AS rank_col#24, cast((avg(UnscaledValue(ss_net_profit#21))#22 / 100.0) as decimal(11,6)) AS avg(ss_net_profit#21)#25] + +(18) Filter [codegen id : 6] +Input [3]: [item_sk#23, rank_col#24, avg(ss_net_profit#21)#25] +Condition : (isnotnull(avg(ss_net_profit#21)#25) AND (cast(avg(ss_net_profit#21)#25 as decimal(13,7)) > CheckOverflow((0.900000 * promote_precision(ReusedSubquery Subquery scalar-subquery#14, [id=#15])), DecimalType(13,7), true))) + +(19) Project [codegen id : 6] +Output [2]: [item_sk#23, rank_col#24] +Input [3]: [item_sk#23, rank_col#24, avg(ss_net_profit#21)#25] + +(20) Exchange +Input [2]: [item_sk#23, rank_col#24] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#26] + +(21) Sort [codegen id : 7] +Input [2]: [item_sk#23, rank_col#24] +Arguments: [rank_col#24 DESC NULLS LAST], false, 0 + +(22) Window +Input [2]: [item_sk#23, rank_col#24] +Arguments: [rank(rank_col#24) windowspecdefinition(rank_col#24 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rnk#27], [rank_col#24 DESC NULLS LAST] + +(23) Filter [codegen id : 8] +Input [3]: [item_sk#23, rank_col#24, rnk#27] +Condition : ((rnk#27 < 11) AND isnotnull(item_sk#23)) + +(24) Project [codegen id : 8] +Output [2]: [item_sk#23, rnk#27] +Input [3]: [item_sk#23, rank_col#24, rnk#27] + +(25) Sort [codegen id : 8] +Input [2]: [item_sk#23, rnk#27] +Arguments: [rnk#27 ASC NULLS FIRST], false, 0 + +(26) SortMergeJoin [codegen id : 11] +Left keys [1]: [rnk#17] +Right keys [1]: [rnk#27] +Join condition: None + +(27) Project [codegen id : 11] +Output [3]: [item_sk#11, rnk#17, item_sk#23] +Input [4]: [item_sk#11, rnk#17, item_sk#23, rnk#27] + +(28) Scan parquet default.item +Output [2]: [i_item_sk#28, i_product_name#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 9] +Input [2]: [i_item_sk#28, i_product_name#29] + +(30) Filter [codegen id : 9] +Input [2]: [i_item_sk#28, i_product_name#29] +Condition : isnotnull(i_item_sk#28) + +(31) BroadcastExchange +Input [2]: [i_item_sk#28, i_product_name#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#30] + +(32) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [item_sk#11] +Right keys [1]: [i_item_sk#28] +Join condition: None + +(33) Project [codegen id : 11] +Output [3]: [rnk#17, item_sk#23, i_product_name#29] +Input [5]: [item_sk#11, rnk#17, item_sk#23, i_item_sk#28, i_product_name#29] + +(34) ReusedExchange [Reuses operator id: 31] +Output [2]: [i_item_sk#31, i_product_name#32] + +(35) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [item_sk#23] +Right keys [1]: [i_item_sk#31] +Join condition: None + +(36) Project [codegen id : 11] +Output [3]: [rnk#17, i_product_name#29 AS best_performing#33, i_product_name#32 AS worst_performing#34] +Input [5]: [rnk#17, item_sk#23, i_product_name#29, i_item_sk#31, i_product_name#32] + +(37) TakeOrderedAndProject +Input [3]: [rnk#17, best_performing#33, worst_performing#34] +Arguments: 100, [rnk#17 ASC NULLS FIRST], [rnk#17, best_performing#33, worst_performing#34] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 8 Hosting Expression = Subquery scalar-subquery#14, [id=#15] +* HashAggregate (44) ++- Exchange (43) + +- * HashAggregate (42) + +- * Project (41) + +- * Filter (40) + +- * ColumnarToRow (39) + +- Scan parquet default.store_sales (38) + + +(38) Scan parquet default.store_sales +Output [4]: [ss_addr_sk#35, ss_store_sk#36, ss_net_profit#37, ss_sold_date_sk#38] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_store_sk), EqualTo(ss_store_sk,4), IsNull(ss_addr_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 1] +Input [4]: [ss_addr_sk#35, ss_store_sk#36, ss_net_profit#37, ss_sold_date_sk#38] + +(40) Filter [codegen id : 1] +Input [4]: [ss_addr_sk#35, ss_store_sk#36, ss_net_profit#37, ss_sold_date_sk#38] +Condition : ((isnotnull(ss_store_sk#36) AND (ss_store_sk#36 = 4)) AND isnull(ss_addr_sk#35)) + +(41) Project [codegen id : 1] +Output [2]: [ss_store_sk#36, ss_net_profit#37] +Input [4]: [ss_addr_sk#35, ss_store_sk#36, ss_net_profit#37, ss_sold_date_sk#38] + +(42) HashAggregate [codegen id : 1] +Input [2]: [ss_store_sk#36, ss_net_profit#37] +Keys [1]: [ss_store_sk#36] +Functions [1]: [partial_avg(UnscaledValue(ss_net_profit#37))] +Aggregate Attributes [2]: [sum#39, count#40] +Results [3]: [ss_store_sk#36, sum#41, count#42] + +(43) Exchange +Input [3]: [ss_store_sk#36, sum#41, count#42] +Arguments: hashpartitioning(ss_store_sk#36, 5), ENSURE_REQUIREMENTS, [id=#43] + +(44) HashAggregate [codegen id : 2] +Input [3]: [ss_store_sk#36, sum#41, count#42] +Keys [1]: [ss_store_sk#36] +Functions [1]: [avg(UnscaledValue(ss_net_profit#37))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_profit#37))#44] +Results [1]: [cast((avg(UnscaledValue(ss_net_profit#37))#44 / 100.0) as decimal(11,6)) AS rank_col#45] + +Subquery:2 Hosting operator id = 18 Hosting Expression = ReusedSubquery Subquery scalar-subquery#14, [id=#15] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44/simplified.txt new file mode 100644 index 0000000000000..10d3570c2dc8d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q44/simplified.txt @@ -0,0 +1,71 @@ +TakeOrderedAndProject [rnk,best_performing,worst_performing] + WholeStageCodegen (11) + Project [rnk,i_product_name,i_product_name] + BroadcastHashJoin [item_sk,i_item_sk] + Project [rnk,item_sk,i_product_name] + BroadcastHashJoin [item_sk,i_item_sk] + Project [item_sk,rnk,item_sk] + SortMergeJoin [rnk,rnk] + InputAdapter + WholeStageCodegen (4) + Sort [rnk] + Project [item_sk,rnk] + Filter [rnk,item_sk] + InputAdapter + Window [rank_col] + WholeStageCodegen (3) + Sort [rank_col] + InputAdapter + Exchange #1 + WholeStageCodegen (2) + Project [item_sk,rank_col] + Filter [avg(ss_net_profit)] + Subquery #1 + WholeStageCodegen (2) + HashAggregate [ss_store_sk,sum,count] [avg(UnscaledValue(ss_net_profit)),rank_col,sum,count] + InputAdapter + Exchange [ss_store_sk] #3 + WholeStageCodegen (1) + HashAggregate [ss_store_sk,ss_net_profit] [sum,count,sum,count] + Project [ss_store_sk,ss_net_profit] + Filter [ss_store_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_addr_sk,ss_store_sk,ss_net_profit,ss_sold_date_sk] + HashAggregate [ss_item_sk,sum,count] [avg(UnscaledValue(ss_net_profit)),item_sk,rank_col,avg(ss_net_profit),sum,count] + InputAdapter + Exchange [ss_item_sk] #2 + WholeStageCodegen (1) + HashAggregate [ss_item_sk,ss_net_profit] [sum,count,sum,count] + Project [ss_item_sk,ss_net_profit] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_net_profit,ss_sold_date_sk] + InputAdapter + WholeStageCodegen (8) + Sort [rnk] + Project [item_sk,rnk] + Filter [rnk,item_sk] + InputAdapter + Window [rank_col] + WholeStageCodegen (7) + Sort [rank_col] + InputAdapter + Exchange #4 + WholeStageCodegen (6) + Project [item_sk,rank_col] + Filter [avg(ss_net_profit)] + ReusedSubquery [rank_col] #1 + HashAggregate [ss_item_sk,sum,count] [avg(UnscaledValue(ss_net_profit)),item_sk,rank_col,avg(ss_net_profit),sum,count] + InputAdapter + ReusedExchange [ss_item_sk,sum,count] #2 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_product_name] + InputAdapter + ReusedExchange [i_item_sk,i_product_name] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/explain.txt new file mode 100644 index 0000000000000..701414b22eb80 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/explain.txt @@ -0,0 +1,267 @@ +== Physical Plan == +TakeOrderedAndProject (46) ++- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * Project (42) + +- * Filter (41) + +- * BroadcastHashJoin ExistenceJoin(exists#1) BuildRight (40) + :- * Project (34) + : +- * SortMergeJoin Inner (33) + : :- * Sort (18) + : : +- Exchange (17) + : : +- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.web_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.item (11) + : +- * Sort (32) + : +- Exchange (31) + : +- * Project (30) + : +- * SortMergeJoin Inner (29) + : :- * Sort (23) + : : +- Exchange (22) + : : +- * Filter (21) + : : +- * ColumnarToRow (20) + : : +- Scan parquet default.customer (19) + : +- * Sort (28) + : +- Exchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.customer_address (24) + +- BroadcastExchange (39) + +- * Project (38) + +- * Filter (37) + +- * ColumnarToRow (36) + +- Scan parquet default.item (35) + + +(1) Scan parquet default.web_sales +Output [4]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4, ws_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#5), dynamicpruningexpression(ws_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4, ws_sold_date_sk#5] + +(3) Filter [codegen id : 3] +Input [4]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4, ws_sold_date_sk#5] +Condition : (isnotnull(ws_bill_customer_sk#3) AND isnotnull(ws_item_sk#2)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_qoy#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_qoy#9] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_qoy#9] +Condition : ((((isnotnull(d_qoy#9) AND isnotnull(d_year#8)) AND (d_qoy#9 = 2)) AND (d_year#8 = 2001)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_qoy#9] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4] +Input [5]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4, ws_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.item +Output [2]: [i_item_sk#11, i_item_id#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [i_item_sk#11, i_item_id#12] + +(13) Filter [codegen id : 2] +Input [2]: [i_item_sk#11, i_item_id#12] +Condition : isnotnull(i_item_sk#11) + +(14) BroadcastExchange +Input [2]: [i_item_sk#11, i_item_id#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_item_sk#2] +Right keys [1]: [i_item_sk#11] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [ws_bill_customer_sk#3, ws_sales_price#4, i_item_id#12] +Input [5]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4, i_item_sk#11, i_item_id#12] + +(17) Exchange +Input [3]: [ws_bill_customer_sk#3, ws_sales_price#4, i_item_id#12] +Arguments: hashpartitioning(ws_bill_customer_sk#3, 5), ENSURE_REQUIREMENTS, [id=#14] + +(18) Sort [codegen id : 4] +Input [3]: [ws_bill_customer_sk#3, ws_sales_price#4, i_item_id#12] +Arguments: [ws_bill_customer_sk#3 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.customer +Output [2]: [c_customer_sk#15, c_current_addr_sk#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 5] +Input [2]: [c_customer_sk#15, c_current_addr_sk#16] + +(21) Filter [codegen id : 5] +Input [2]: [c_customer_sk#15, c_current_addr_sk#16] +Condition : (isnotnull(c_customer_sk#15) AND isnotnull(c_current_addr_sk#16)) + +(22) Exchange +Input [2]: [c_customer_sk#15, c_current_addr_sk#16] +Arguments: hashpartitioning(c_current_addr_sk#16, 5), ENSURE_REQUIREMENTS, [id=#17] + +(23) Sort [codegen id : 6] +Input [2]: [c_customer_sk#15, c_current_addr_sk#16] +Arguments: [c_current_addr_sk#16 ASC NULLS FIRST], false, 0 + +(24) Scan parquet default.customer_address +Output [3]: [ca_address_sk#18, ca_city#19, ca_zip#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 7] +Input [3]: [ca_address_sk#18, ca_city#19, ca_zip#20] + +(26) Filter [codegen id : 7] +Input [3]: [ca_address_sk#18, ca_city#19, ca_zip#20] +Condition : isnotnull(ca_address_sk#18) + +(27) Exchange +Input [3]: [ca_address_sk#18, ca_city#19, ca_zip#20] +Arguments: hashpartitioning(ca_address_sk#18, 5), ENSURE_REQUIREMENTS, [id=#21] + +(28) Sort [codegen id : 8] +Input [3]: [ca_address_sk#18, ca_city#19, ca_zip#20] +Arguments: [ca_address_sk#18 ASC NULLS FIRST], false, 0 + +(29) SortMergeJoin [codegen id : 9] +Left keys [1]: [c_current_addr_sk#16] +Right keys [1]: [ca_address_sk#18] +Join condition: None + +(30) Project [codegen id : 9] +Output [3]: [c_customer_sk#15, ca_city#19, ca_zip#20] +Input [5]: [c_customer_sk#15, c_current_addr_sk#16, ca_address_sk#18, ca_city#19, ca_zip#20] + +(31) Exchange +Input [3]: [c_customer_sk#15, ca_city#19, ca_zip#20] +Arguments: hashpartitioning(c_customer_sk#15, 5), ENSURE_REQUIREMENTS, [id=#22] + +(32) Sort [codegen id : 10] +Input [3]: [c_customer_sk#15, ca_city#19, ca_zip#20] +Arguments: [c_customer_sk#15 ASC NULLS FIRST], false, 0 + +(33) SortMergeJoin [codegen id : 12] +Left keys [1]: [ws_bill_customer_sk#3] +Right keys [1]: [c_customer_sk#15] +Join condition: None + +(34) Project [codegen id : 12] +Output [4]: [ws_sales_price#4, ca_city#19, ca_zip#20, i_item_id#12] +Input [6]: [ws_bill_customer_sk#3, ws_sales_price#4, i_item_id#12, c_customer_sk#15, ca_city#19, ca_zip#20] + +(35) Scan parquet default.item +Output [2]: [i_item_sk#23, i_item_id#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_item_sk, [2,3,5,7,11,13,17,19,23,29])] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 11] +Input [2]: [i_item_sk#23, i_item_id#24] + +(37) Filter [codegen id : 11] +Input [2]: [i_item_sk#23, i_item_id#24] +Condition : i_item_sk#23 IN (2,3,5,7,11,13,17,19,23,29) + +(38) Project [codegen id : 11] +Output [1]: [i_item_id#24] +Input [2]: [i_item_sk#23, i_item_id#24] + +(39) BroadcastExchange +Input [1]: [i_item_id#24] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#25] + +(40) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [i_item_id#12] +Right keys [1]: [i_item_id#24] +Join condition: None + +(41) Filter [codegen id : 12] +Input [5]: [ws_sales_price#4, ca_city#19, ca_zip#20, i_item_id#12, exists#1] +Condition : (substr(ca_zip#20, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR exists#1) + +(42) Project [codegen id : 12] +Output [3]: [ws_sales_price#4, ca_city#19, ca_zip#20] +Input [5]: [ws_sales_price#4, ca_city#19, ca_zip#20, i_item_id#12, exists#1] + +(43) HashAggregate [codegen id : 12] +Input [3]: [ws_sales_price#4, ca_city#19, ca_zip#20] +Keys [2]: [ca_zip#20, ca_city#19] +Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#4))] +Aggregate Attributes [1]: [sum#26] +Results [3]: [ca_zip#20, ca_city#19, sum#27] + +(44) Exchange +Input [3]: [ca_zip#20, ca_city#19, sum#27] +Arguments: hashpartitioning(ca_zip#20, ca_city#19, 5), ENSURE_REQUIREMENTS, [id=#28] + +(45) HashAggregate [codegen id : 13] +Input [3]: [ca_zip#20, ca_city#19, sum#27] +Keys [2]: [ca_zip#20, ca_city#19] +Functions [1]: [sum(UnscaledValue(ws_sales_price#4))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#4))#29] +Results [3]: [ca_zip#20, ca_city#19, MakeDecimal(sum(UnscaledValue(ws_sales_price#4))#29,17,2) AS sum(ws_sales_price)#30] + +(46) TakeOrderedAndProject +Input [3]: [ca_zip#20, ca_city#19, sum(ws_sales_price)#30] +Arguments: 100, [ca_zip#20 ASC NULLS FIRST, ca_city#19 ASC NULLS FIRST], [ca_zip#20, ca_city#19, sum(ws_sales_price)#30] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (47) + + +(47) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/simplified.txt new file mode 100644 index 0000000000000..fd36e3ade4099 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45.sf100/simplified.txt @@ -0,0 +1,79 @@ +TakeOrderedAndProject [ca_zip,ca_city,sum(ws_sales_price)] + WholeStageCodegen (13) + HashAggregate [ca_zip,ca_city,sum] [sum(UnscaledValue(ws_sales_price)),sum(ws_sales_price),sum] + InputAdapter + Exchange [ca_zip,ca_city] #1 + WholeStageCodegen (12) + HashAggregate [ca_zip,ca_city,ws_sales_price] [sum,sum] + Project [ws_sales_price,ca_city,ca_zip] + Filter [ca_zip,exists] + BroadcastHashJoin [i_item_id,i_item_id] + Project [ws_sales_price,ca_city,ca_zip,i_item_id] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #2 + WholeStageCodegen (3) + Project [ws_bill_customer_sk,ws_sales_price,i_item_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_bill_customer_sk,ws_sales_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_sales_price,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + WholeStageCodegen (10) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (9) + Project [c_customer_sk,ca_city,ca_zip] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (6) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #6 + WholeStageCodegen (5) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (8) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #7 + WholeStageCodegen (7) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city,ca_zip] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (11) + Project [i_item_id] + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45/explain.txt new file mode 100644 index 0000000000000..f3a37f9e8767e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45/explain.txt @@ -0,0 +1,237 @@ +== Physical Plan == +TakeOrderedAndProject (40) ++- * HashAggregate (39) + +- Exchange (38) + +- * HashAggregate (37) + +- * Project (36) + +- * Filter (35) + +- * BroadcastHashJoin ExistenceJoin(exists#1) BuildRight (34) + :- * Project (28) + : +- * BroadcastHashJoin Inner BuildRight (27) + : :- * Project (22) + : : +- * BroadcastHashJoin Inner BuildRight (21) + : : :- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.customer (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.customer_address (10) + : : +- BroadcastExchange (20) + : : +- * Project (19) + : : +- * Filter (18) + : : +- * ColumnarToRow (17) + : : +- Scan parquet default.date_dim (16) + : +- BroadcastExchange (26) + : +- * Filter (25) + : +- * ColumnarToRow (24) + : +- Scan parquet default.item (23) + +- BroadcastExchange (33) + +- * Project (32) + +- * Filter (31) + +- * ColumnarToRow (30) + +- Scan parquet default.item (29) + + +(1) Scan parquet default.web_sales +Output [4]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4, ws_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#5), dynamicpruningexpression(ws_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ws_bill_customer_sk), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 6] +Input [4]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4, ws_sold_date_sk#5] + +(3) Filter [codegen id : 6] +Input [4]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4, ws_sold_date_sk#5] +Condition : (isnotnull(ws_bill_customer_sk#3) AND isnotnull(ws_item_sk#2)) + +(4) Scan parquet default.customer +Output [2]: [c_customer_sk#7, c_current_addr_sk#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [c_customer_sk#7, c_current_addr_sk#8] + +(6) Filter [codegen id : 1] +Input [2]: [c_customer_sk#7, c_current_addr_sk#8] +Condition : (isnotnull(c_customer_sk#7) AND isnotnull(c_current_addr_sk#8)) + +(7) BroadcastExchange +Input [2]: [c_customer_sk#7, c_current_addr_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] + +(8) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_bill_customer_sk#3] +Right keys [1]: [c_customer_sk#7] +Join condition: None + +(9) Project [codegen id : 6] +Output [4]: [ws_item_sk#2, ws_sales_price#4, ws_sold_date_sk#5, c_current_addr_sk#8] +Input [6]: [ws_item_sk#2, ws_bill_customer_sk#3, ws_sales_price#4, ws_sold_date_sk#5, c_customer_sk#7, c_current_addr_sk#8] + +(10) Scan parquet default.customer_address +Output [3]: [ca_address_sk#10, ca_city#11, ca_zip#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [ca_address_sk#10, ca_city#11, ca_zip#12] + +(12) Filter [codegen id : 2] +Input [3]: [ca_address_sk#10, ca_city#11, ca_zip#12] +Condition : isnotnull(ca_address_sk#10) + +(13) BroadcastExchange +Input [3]: [ca_address_sk#10, ca_city#11, ca_zip#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(14) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [c_current_addr_sk#8] +Right keys [1]: [ca_address_sk#10] +Join condition: None + +(15) Project [codegen id : 6] +Output [5]: [ws_item_sk#2, ws_sales_price#4, ws_sold_date_sk#5, ca_city#11, ca_zip#12] +Input [7]: [ws_item_sk#2, ws_sales_price#4, ws_sold_date_sk#5, c_current_addr_sk#8, ca_address_sk#10, ca_city#11, ca_zip#12] + +(16) Scan parquet default.date_dim +Output [3]: [d_date_sk#14, d_year#15, d_qoy#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#14, d_year#15, d_qoy#16] + +(18) Filter [codegen id : 3] +Input [3]: [d_date_sk#14, d_year#15, d_qoy#16] +Condition : ((((isnotnull(d_qoy#16) AND isnotnull(d_year#15)) AND (d_qoy#16 = 2)) AND (d_year#15 = 2001)) AND isnotnull(d_date_sk#14)) + +(19) Project [codegen id : 3] +Output [1]: [d_date_sk#14] +Input [3]: [d_date_sk#14, d_year#15, d_qoy#16] + +(20) BroadcastExchange +Input [1]: [d_date_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(21) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#5] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(22) Project [codegen id : 6] +Output [4]: [ws_item_sk#2, ws_sales_price#4, ca_city#11, ca_zip#12] +Input [6]: [ws_item_sk#2, ws_sales_price#4, ws_sold_date_sk#5, ca_city#11, ca_zip#12, d_date_sk#14] + +(23) Scan parquet default.item +Output [2]: [i_item_sk#18, i_item_id#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#18, i_item_id#19] + +(25) Filter [codegen id : 4] +Input [2]: [i_item_sk#18, i_item_id#19] +Condition : isnotnull(i_item_sk#18) + +(26) BroadcastExchange +Input [2]: [i_item_sk#18, i_item_id#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_item_sk#2] +Right keys [1]: [i_item_sk#18] +Join condition: None + +(28) Project [codegen id : 6] +Output [4]: [ws_sales_price#4, ca_city#11, ca_zip#12, i_item_id#19] +Input [6]: [ws_item_sk#2, ws_sales_price#4, ca_city#11, ca_zip#12, i_item_sk#18, i_item_id#19] + +(29) Scan parquet default.item +Output [2]: [i_item_sk#21, i_item_id#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_item_sk, [2,3,5,7,11,13,17,19,23,29])] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [2]: [i_item_sk#21, i_item_id#22] + +(31) Filter [codegen id : 5] +Input [2]: [i_item_sk#21, i_item_id#22] +Condition : i_item_sk#21 IN (2,3,5,7,11,13,17,19,23,29) + +(32) Project [codegen id : 5] +Output [1]: [i_item_id#22] +Input [2]: [i_item_sk#21, i_item_id#22] + +(33) BroadcastExchange +Input [1]: [i_item_id#22] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#23] + +(34) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [i_item_id#19] +Right keys [1]: [i_item_id#22] +Join condition: None + +(35) Filter [codegen id : 6] +Input [5]: [ws_sales_price#4, ca_city#11, ca_zip#12, i_item_id#19, exists#1] +Condition : (substr(ca_zip#12, 1, 5) IN (85669,86197,88274,83405,86475,85392,85460,80348,81792) OR exists#1) + +(36) Project [codegen id : 6] +Output [3]: [ws_sales_price#4, ca_city#11, ca_zip#12] +Input [5]: [ws_sales_price#4, ca_city#11, ca_zip#12, i_item_id#19, exists#1] + +(37) HashAggregate [codegen id : 6] +Input [3]: [ws_sales_price#4, ca_city#11, ca_zip#12] +Keys [2]: [ca_zip#12, ca_city#11] +Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#4))] +Aggregate Attributes [1]: [sum#24] +Results [3]: [ca_zip#12, ca_city#11, sum#25] + +(38) Exchange +Input [3]: [ca_zip#12, ca_city#11, sum#25] +Arguments: hashpartitioning(ca_zip#12, ca_city#11, 5), ENSURE_REQUIREMENTS, [id=#26] + +(39) HashAggregate [codegen id : 7] +Input [3]: [ca_zip#12, ca_city#11, sum#25] +Keys [2]: [ca_zip#12, ca_city#11] +Functions [1]: [sum(UnscaledValue(ws_sales_price#4))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#4))#27] +Results [3]: [ca_zip#12, ca_city#11, MakeDecimal(sum(UnscaledValue(ws_sales_price#4))#27,17,2) AS sum(ws_sales_price)#28] + +(40) TakeOrderedAndProject +Input [3]: [ca_zip#12, ca_city#11, sum(ws_sales_price)#28] +Arguments: 100, [ca_zip#12 ASC NULLS FIRST, ca_city#11 ASC NULLS FIRST], [ca_zip#12, ca_city#11, sum(ws_sales_price)#28] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (41) + + +(41) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#14] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45/simplified.txt new file mode 100644 index 0000000000000..5b2be557a96fa --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q45/simplified.txt @@ -0,0 +1,61 @@ +TakeOrderedAndProject [ca_zip,ca_city,sum(ws_sales_price)] + WholeStageCodegen (7) + HashAggregate [ca_zip,ca_city,sum] [sum(UnscaledValue(ws_sales_price)),sum(ws_sales_price),sum] + InputAdapter + Exchange [ca_zip,ca_city] #1 + WholeStageCodegen (6) + HashAggregate [ca_zip,ca_city,ws_sales_price] [sum,sum] + Project [ws_sales_price,ca_city,ca_zip] + Filter [ca_zip,exists] + BroadcastHashJoin [i_item_id,i_item_id] + Project [ws_sales_price,ca_city,ca_zip,i_item_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_sales_price,ca_city,ca_zip] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_sales_price,ws_sold_date_sk,ca_city,ca_zip] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [ws_item_sk,ws_sales_price,ws_sold_date_sk,c_current_addr_sk] + BroadcastHashJoin [ws_bill_customer_sk,c_customer_sk] + Filter [ws_bill_customer_sk,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_sales_price,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city,ca_zip] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Project [i_item_id] + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/explain.txt new file mode 100644 index 0000000000000..ac35640c7b004 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/explain.txt @@ -0,0 +1,292 @@ +== Physical Plan == +TakeOrderedAndProject (51) ++- * Project (50) + +- * SortMergeJoin Inner (49) + :- * Sort (14) + : +- Exchange (13) + : +- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.customer (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.customer_address (6) + +- * Sort (48) + +- Exchange (47) + +- * HashAggregate (46) + +- * HashAggregate (45) + +- * Project (44) + +- * SortMergeJoin Inner (43) + :- * Sort (40) + : +- Exchange (39) + : +- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Project (31) + : : +- * BroadcastHashJoin Inner BuildRight (30) + : : :- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Filter (17) + : : : : +- * ColumnarToRow (16) + : : : : +- Scan parquet default.store_sales (15) + : : : +- BroadcastExchange (22) + : : : +- * Project (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.date_dim (18) + : : +- BroadcastExchange (29) + : : +- * Project (28) + : : +- * Filter (27) + : : +- * ColumnarToRow (26) + : : +- Scan parquet default.store (25) + : +- BroadcastExchange (36) + : +- * Project (35) + : +- * Filter (34) + : +- * ColumnarToRow (33) + : +- Scan parquet default.household_demographics (32) + +- * Sort (42) + +- ReusedExchange (41) + + +(1) Scan parquet default.customer +Output [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] + +(3) Filter [codegen id : 1] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#2)) + +(4) Exchange +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Arguments: hashpartitioning(c_current_addr_sk#2, 5), ENSURE_REQUIREMENTS, [id=#5] + +(5) Sort [codegen id : 2] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Arguments: [c_current_addr_sk#2 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.customer_address +Output [2]: [ca_address_sk#6, ca_city#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [2]: [ca_address_sk#6, ca_city#7] + +(8) Filter [codegen id : 3] +Input [2]: [ca_address_sk#6, ca_city#7] +Condition : (isnotnull(ca_address_sk#6) AND isnotnull(ca_city#7)) + +(9) Exchange +Input [2]: [ca_address_sk#6, ca_city#7] +Arguments: hashpartitioning(ca_address_sk#6, 5), ENSURE_REQUIREMENTS, [id=#8] + +(10) Sort [codegen id : 4] +Input [2]: [ca_address_sk#6, ca_city#7] +Arguments: [ca_address_sk#6 ASC NULLS FIRST], false, 0 + +(11) SortMergeJoin [codegen id : 5] +Left keys [1]: [c_current_addr_sk#2] +Right keys [1]: [ca_address_sk#6] +Join condition: None + +(12) Project [codegen id : 5] +Output [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] +Input [6]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4, ca_address_sk#6, ca_city#7] + +(13) Exchange +Input [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] +Arguments: hashpartitioning(c_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] + +(14) Sort [codegen id : 6] +Input [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 + +(15) Scan parquet default.store_sales +Output [8]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16, ss_sold_date_sk#17] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#17), dynamicpruningexpression(ss_sold_date_sk#17 IN dynamicpruning#18)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 10] +Input [8]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16, ss_sold_date_sk#17] + +(17) Filter [codegen id : 10] +Input [8]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16, ss_sold_date_sk#17] +Condition : (((isnotnull(ss_store_sk#13) AND isnotnull(ss_hdemo_sk#11)) AND isnotnull(ss_addr_sk#12)) AND isnotnull(ss_customer_sk#10)) + +(18) Scan parquet default.date_dim +Output [3]: [d_date_sk#19, d_year#20, d_dow#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_dow, [6,0]), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 7] +Input [3]: [d_date_sk#19, d_year#20, d_dow#21] + +(20) Filter [codegen id : 7] +Input [3]: [d_date_sk#19, d_year#20, d_dow#21] +Condition : ((d_dow#21 IN (6,0) AND d_year#20 IN (1999,2000,2001)) AND isnotnull(d_date_sk#19)) + +(21) Project [codegen id : 7] +Output [1]: [d_date_sk#19] +Input [3]: [d_date_sk#19, d_year#20, d_dow#21] + +(22) BroadcastExchange +Input [1]: [d_date_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] + +(23) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#17] +Right keys [1]: [d_date_sk#19] +Join condition: None + +(24) Project [codegen id : 10] +Output [7]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16] +Input [9]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16, ss_sold_date_sk#17, d_date_sk#19] + +(25) Scan parquet default.store +Output [2]: [s_store_sk#23, s_city#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_city, [Fairview,Midway]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 8] +Input [2]: [s_store_sk#23, s_city#24] + +(27) Filter [codegen id : 8] +Input [2]: [s_store_sk#23, s_city#24] +Condition : (s_city#24 IN (Fairview,Midway) AND isnotnull(s_store_sk#23)) + +(28) Project [codegen id : 8] +Output [1]: [s_store_sk#23] +Input [2]: [s_store_sk#23, s_city#24] + +(29) BroadcastExchange +Input [1]: [s_store_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] + +(30) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_store_sk#13] +Right keys [1]: [s_store_sk#23] +Join condition: None + +(31) Project [codegen id : 10] +Output [6]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16] +Input [8]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16, s_store_sk#23] + +(32) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#26, hd_dep_count#27, hd_vehicle_count#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(EqualTo(hd_dep_count,4),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(33) ColumnarToRow [codegen id : 9] +Input [3]: [hd_demo_sk#26, hd_dep_count#27, hd_vehicle_count#28] + +(34) Filter [codegen id : 9] +Input [3]: [hd_demo_sk#26, hd_dep_count#27, hd_vehicle_count#28] +Condition : (((hd_dep_count#27 = 4) OR (hd_vehicle_count#28 = 3)) AND isnotnull(hd_demo_sk#26)) + +(35) Project [codegen id : 9] +Output [1]: [hd_demo_sk#26] +Input [3]: [hd_demo_sk#26, hd_dep_count#27, hd_vehicle_count#28] + +(36) BroadcastExchange +Input [1]: [hd_demo_sk#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] + +(37) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_hdemo_sk#11] +Right keys [1]: [hd_demo_sk#26] +Join condition: None + +(38) Project [codegen id : 10] +Output [5]: [ss_customer_sk#10, ss_addr_sk#12, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16] +Input [7]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16, hd_demo_sk#26] + +(39) Exchange +Input [5]: [ss_customer_sk#10, ss_addr_sk#12, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16] +Arguments: hashpartitioning(ss_addr_sk#12, 5), ENSURE_REQUIREMENTS, [id=#30] + +(40) Sort [codegen id : 11] +Input [5]: [ss_customer_sk#10, ss_addr_sk#12, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16] +Arguments: [ss_addr_sk#12 ASC NULLS FIRST], false, 0 + +(41) ReusedExchange [Reuses operator id: 9] +Output [2]: [ca_address_sk#31, ca_city#32] + +(42) Sort [codegen id : 13] +Input [2]: [ca_address_sk#31, ca_city#32] +Arguments: [ca_address_sk#31 ASC NULLS FIRST], false, 0 + +(43) SortMergeJoin [codegen id : 14] +Left keys [1]: [ss_addr_sk#12] +Right keys [1]: [ca_address_sk#31] +Join condition: None + +(44) Project [codegen id : 14] +Output [6]: [ss_customer_sk#10, ss_addr_sk#12, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16, ca_city#32] +Input [7]: [ss_customer_sk#10, ss_addr_sk#12, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16, ca_address_sk#31, ca_city#32] + +(45) HashAggregate [codegen id : 14] +Input [6]: [ss_customer_sk#10, ss_addr_sk#12, ss_ticket_number#14, ss_coupon_amt#15, ss_net_profit#16, ca_city#32] +Keys [4]: [ss_ticket_number#14, ss_customer_sk#10, ss_addr_sk#12, ca_city#32] +Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#15)), partial_sum(UnscaledValue(ss_net_profit#16))] +Aggregate Attributes [2]: [sum#33, sum#34] +Results [6]: [ss_ticket_number#14, ss_customer_sk#10, ss_addr_sk#12, ca_city#32, sum#35, sum#36] + +(46) HashAggregate [codegen id : 14] +Input [6]: [ss_ticket_number#14, ss_customer_sk#10, ss_addr_sk#12, ca_city#32, sum#35, sum#36] +Keys [4]: [ss_ticket_number#14, ss_customer_sk#10, ss_addr_sk#12, ca_city#32] +Functions [2]: [sum(UnscaledValue(ss_coupon_amt#15)), sum(UnscaledValue(ss_net_profit#16))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#15))#37, sum(UnscaledValue(ss_net_profit#16))#38] +Results [5]: [ss_ticket_number#14, ss_customer_sk#10, ca_city#32 AS bought_city#39, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#15))#37,17,2) AS amt#40, MakeDecimal(sum(UnscaledValue(ss_net_profit#16))#38,17,2) AS profit#41] + +(47) Exchange +Input [5]: [ss_ticket_number#14, ss_customer_sk#10, bought_city#39, amt#40, profit#41] +Arguments: hashpartitioning(ss_customer_sk#10, 5), ENSURE_REQUIREMENTS, [id=#42] + +(48) Sort [codegen id : 15] +Input [5]: [ss_ticket_number#14, ss_customer_sk#10, bought_city#39, amt#40, profit#41] +Arguments: [ss_customer_sk#10 ASC NULLS FIRST], false, 0 + +(49) SortMergeJoin [codegen id : 16] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#10] +Join condition: NOT (ca_city#7 = bought_city#39) + +(50) Project [codegen id : 16] +Output [7]: [c_last_name#4, c_first_name#3, ca_city#7, bought_city#39, ss_ticket_number#14, amt#40, profit#41] +Input [9]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7, ss_ticket_number#14, ss_customer_sk#10, bought_city#39, amt#40, profit#41] + +(51) TakeOrderedAndProject +Input [7]: [c_last_name#4, c_first_name#3, ca_city#7, bought_city#39, ss_ticket_number#14, amt#40, profit#41] +Arguments: 100, [c_last_name#4 ASC NULLS FIRST, c_first_name#3 ASC NULLS FIRST, ca_city#7 ASC NULLS FIRST, bought_city#39 ASC NULLS FIRST, ss_ticket_number#14 ASC NULLS FIRST], [c_last_name#4, c_first_name#3, ca_city#7, bought_city#39, ss_ticket_number#14, amt#40, profit#41] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 15 Hosting Expression = ss_sold_date_sk#17 IN dynamicpruning#18 +ReusedExchange (52) + + +(52) ReusedExchange [Reuses operator id: 22] +Output [1]: [d_date_sk#19] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/simplified.txt new file mode 100644 index 0000000000000..f4e90335c78f9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46.sf100/simplified.txt @@ -0,0 +1,89 @@ +TakeOrderedAndProject [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,amt,profit] + WholeStageCodegen (16) + Project [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,amt,profit] + SortMergeJoin [c_customer_sk,ss_customer_sk,ca_city,bought_city] + InputAdapter + WholeStageCodegen (6) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #1 + WholeStageCodegen (5) + Project [c_customer_sk,c_first_name,c_last_name,ca_city] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (2) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #2 + WholeStageCodegen (1) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + InputAdapter + WholeStageCodegen (4) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #3 + WholeStageCodegen (3) + Filter [ca_address_sk,ca_city] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] + InputAdapter + WholeStageCodegen (15) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #4 + WholeStageCodegen (14) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,sum,sum] [sum(UnscaledValue(ss_coupon_amt)),sum(UnscaledValue(ss_net_profit)),bought_city,amt,profit,sum,sum] + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,ss_coupon_amt,ss_net_profit] [sum,sum,sum,sum] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ca_city] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #5 + WholeStageCodegen (10) + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Project [d_date_sk] + Filter [d_dow,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dow] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (8) + Project [s_store_sk] + Filter [s_city,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_city] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (9) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + WholeStageCodegen (13) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_city] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46/explain.txt new file mode 100644 index 0000000000000..2532a14d7907f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46/explain.txt @@ -0,0 +1,252 @@ +== Physical Plan == +TakeOrderedAndProject (43) ++- * Project (42) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (39) + : +- * BroadcastHashJoin Inner BuildRight (38) + : :- * HashAggregate (33) + : : +- Exchange (32) + : : +- * HashAggregate (31) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Project (17) + : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : :- * Project (10) + : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.store_sales (1) + : : : : : +- BroadcastExchange (8) + : : : : : +- * Project (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.date_dim (4) + : : : : +- BroadcastExchange (15) + : : : : +- * Project (14) + : : : : +- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.store (11) + : : : +- BroadcastExchange (22) + : : : +- * Project (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.household_demographics (18) + : : +- BroadcastExchange (28) + : : +- * Filter (27) + : : +- * ColumnarToRow (26) + : : +- Scan parquet default.customer_address (25) + : +- BroadcastExchange (37) + : +- * Filter (36) + : +- * ColumnarToRow (35) + : +- Scan parquet default.customer (34) + +- ReusedExchange (40) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Condition : (((isnotnull(ss_store_sk#4) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_addr_sk#3)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_dow#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_dow, [6,0]), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] +Condition : ((d_dow#12 IN (6,0) AND d_year#11 IN (1999,2000,2001)) AND isnotnull(d_date_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(8) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8, d_date_sk#10] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#14, s_city#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_city, [Fairview,Midway]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#14, s_city#15] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#14, s_city#15] +Condition : (s_city#15 IN (Fairview,Midway) AND isnotnull(s_store_sk#14)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#14] +Input [2]: [s_store_sk#14, s_city#15] + +(15) BroadcastExchange +Input [1]: [s_store_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#14] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_store_sk#14] + +(18) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(EqualTo(hd_dep_count,4),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] + +(20) Filter [codegen id : 3] +Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] +Condition : (((hd_dep_count#18 = 4) OR (hd_vehicle_count#19 = 3)) AND isnotnull(hd_demo_sk#17)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#17] +Input [3]: [hd_demo_sk#17, hd_dep_count#18, hd_vehicle_count#19] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] + +(23) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#17] +Join condition: None + +(24) Project [codegen id : 5] +Output [5]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, hd_demo_sk#17] + +(25) Scan parquet default.customer_address +Output [2]: [ca_address_sk#21, ca_city#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 4] +Input [2]: [ca_address_sk#21, ca_city#22] + +(27) Filter [codegen id : 4] +Input [2]: [ca_address_sk#21, ca_city#22] +Condition : (isnotnull(ca_address_sk#21) AND isnotnull(ca_city#22)) + +(28) BroadcastExchange +Input [2]: [ca_address_sk#21, ca_city#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(29) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#3] +Right keys [1]: [ca_address_sk#21] +Join condition: None + +(30) Project [codegen id : 5] +Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#22] +Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_address_sk#21, ca_city#22] + +(31) HashAggregate [codegen id : 5] +Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ca_city#22] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#22] +Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#6)), partial_sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum#24, sum#25] +Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#22, sum#26, sum#27] + +(32) Exchange +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#22, sum#26, sum#27] +Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#22, 5), ENSURE_REQUIREMENTS, [id=#28] + +(33) HashAggregate [codegen id : 8] +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#22, sum#26, sum#27] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#22] +Functions [2]: [sum(UnscaledValue(ss_coupon_amt#6)), sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#29, sum(UnscaledValue(ss_net_profit#7))#30] +Results [5]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#22 AS bought_city#31, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#29,17,2) AS amt#32, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#30,17,2) AS profit#33] + +(34) Scan parquet default.customer +Output [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 6] +Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] + +(36) Filter [codegen id : 6] +Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Condition : (isnotnull(c_customer_sk#34) AND isnotnull(c_current_addr_sk#35)) + +(37) BroadcastExchange +Input [4]: [c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#38] + +(38) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#34] +Join condition: None + +(39) Project [codegen id : 8] +Output [7]: [ss_ticket_number#5, bought_city#31, amt#32, profit#33, c_current_addr_sk#35, c_first_name#36, c_last_name#37] +Input [9]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#31, amt#32, profit#33, c_customer_sk#34, c_current_addr_sk#35, c_first_name#36, c_last_name#37] + +(40) ReusedExchange [Reuses operator id: 28] +Output [2]: [ca_address_sk#39, ca_city#40] + +(41) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [c_current_addr_sk#35] +Right keys [1]: [ca_address_sk#39] +Join condition: NOT (ca_city#40 = bought_city#31) + +(42) Project [codegen id : 8] +Output [7]: [c_last_name#37, c_first_name#36, ca_city#40, bought_city#31, ss_ticket_number#5, amt#32, profit#33] +Input [9]: [ss_ticket_number#5, bought_city#31, amt#32, profit#33, c_current_addr_sk#35, c_first_name#36, c_last_name#37, ca_address_sk#39, ca_city#40] + +(43) TakeOrderedAndProject +Input [7]: [c_last_name#37, c_first_name#36, ca_city#40, bought_city#31, ss_ticket_number#5, amt#32, profit#33] +Arguments: 100, [c_last_name#37 ASC NULLS FIRST, c_first_name#36 ASC NULLS FIRST, ca_city#40 ASC NULLS FIRST, bought_city#31 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#37, c_first_name#36, ca_city#40, bought_city#31, ss_ticket_number#5, amt#32, profit#33] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (44) + + +(44) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#10] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46/simplified.txt new file mode 100644 index 0000000000000..7f729f9874b53 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q46/simplified.txt @@ -0,0 +1,65 @@ +TakeOrderedAndProject [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,amt,profit] + WholeStageCodegen (8) + Project [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,amt,profit] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk,ca_city,bought_city] + Project [ss_ticket_number,bought_city,amt,profit,c_current_addr_sk,c_first_name,c_last_name] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,sum,sum] [sum(UnscaledValue(ss_coupon_amt)),sum(UnscaledValue(ss_net_profit)),bought_city,amt,profit,sum,sum] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city] #1 + WholeStageCodegen (5) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,ss_coupon_amt,ss_net_profit] [sum,sum,sum,sum] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ca_city] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dow,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dow] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_city,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_city] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [ca_address_sk,ca_city] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + InputAdapter + ReusedExchange [ca_address_sk,ca_city] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q47.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q47.sf100/explain.txt new file mode 100644 index 0000000000000..b7ffba01f92c6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q47.sf100/explain.txt @@ -0,0 +1,314 @@ +== Physical Plan == +TakeOrderedAndProject (56) ++- * Project (55) + +- * SortMergeJoin Inner (54) + :- * Project (47) + : +- * SortMergeJoin Inner (46) + : :- * Sort (37) + : : +- Exchange (36) + : : +- * Filter (35) + : : +- Window (34) + : : +- * Sort (33) + : : +- Exchange (32) + : : +- * Project (31) + : : +- Window (30) + : : +- * Sort (29) + : : +- Exchange (28) + : : +- * HashAggregate (27) + : : +- Exchange (26) + : : +- * HashAggregate (25) + : : +- * Project (24) + : : +- * SortMergeJoin Inner (23) + : : :- * Sort (17) + : : : +- Exchange (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.store (10) + : : +- * Sort (22) + : : +- Exchange (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.item (18) + : +- * Sort (45) + : +- Exchange (44) + : +- * Project (43) + : +- Window (42) + : +- * Sort (41) + : +- Exchange (40) + : +- * HashAggregate (39) + : +- ReusedExchange (38) + +- * Sort (53) + +- Exchange (52) + +- * Project (51) + +- Window (50) + +- * Sort (49) + +- ReusedExchange (48) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_store_sk#2)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(Or(EqualTo(d_year,1999),And(EqualTo(d_year,1998),EqualTo(d_moy,12))),And(EqualTo(d_year,2000),EqualTo(d_moy,1))), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((d_year#7 = 1999) OR ((d_year#7 = 1998) AND (d_moy#8 = 12))) OR ((d_year#7 = 2000) AND (d_moy#8 = 1))) AND isnotnull(d_date_sk#6)) + +(7) BroadcastExchange +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(9) Project [codegen id : 3] +Output [5]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, d_year#7, d_moy#8] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4, d_date_sk#6, d_year#7, d_moy#8] + +(10) Scan parquet default.store +Output [3]: [s_store_sk#10, s_store_name#11, s_company_name#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_name), IsNotNull(s_company_name)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [s_store_sk#10, s_store_name#11, s_company_name#12] + +(12) Filter [codegen id : 2] +Input [3]: [s_store_sk#10, s_store_name#11, s_company_name#12] +Condition : ((isnotnull(s_store_sk#10) AND isnotnull(s_store_name#11)) AND isnotnull(s_company_name#12)) + +(13) BroadcastExchange +Input [3]: [s_store_sk#10, s_store_name#11, s_company_name#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#10] +Join condition: None + +(15) Project [codegen id : 3] +Output [6]: [ss_item_sk#1, ss_sales_price#3, d_year#7, d_moy#8, s_store_name#11, s_company_name#12] +Input [8]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, d_year#7, d_moy#8, s_store_sk#10, s_store_name#11, s_company_name#12] + +(16) Exchange +Input [6]: [ss_item_sk#1, ss_sales_price#3, d_year#7, d_moy#8, s_store_name#11, s_company_name#12] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#14] + +(17) Sort [codegen id : 4] +Input [6]: [ss_item_sk#1, ss_sales_price#3, d_year#7, d_moy#8, s_store_name#11, s_company_name#12] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(18) Scan parquet default.item +Output [3]: [i_item_sk#15, i_brand#16, i_category#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_category), IsNotNull(i_brand)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 5] +Input [3]: [i_item_sk#15, i_brand#16, i_category#17] + +(20) Filter [codegen id : 5] +Input [3]: [i_item_sk#15, i_brand#16, i_category#17] +Condition : ((isnotnull(i_item_sk#15) AND isnotnull(i_category#17)) AND isnotnull(i_brand#16)) + +(21) Exchange +Input [3]: [i_item_sk#15, i_brand#16, i_category#17] +Arguments: hashpartitioning(i_item_sk#15, 5), ENSURE_REQUIREMENTS, [id=#18] + +(22) Sort [codegen id : 6] +Input [3]: [i_item_sk#15, i_brand#16, i_category#17] +Arguments: [i_item_sk#15 ASC NULLS FIRST], false, 0 + +(23) SortMergeJoin [codegen id : 7] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#15] +Join condition: None + +(24) Project [codegen id : 7] +Output [7]: [i_brand#16, i_category#17, ss_sales_price#3, d_year#7, d_moy#8, s_store_name#11, s_company_name#12] +Input [9]: [ss_item_sk#1, ss_sales_price#3, d_year#7, d_moy#8, s_store_name#11, s_company_name#12, i_item_sk#15, i_brand#16, i_category#17] + +(25) HashAggregate [codegen id : 7] +Input [7]: [i_brand#16, i_category#17, ss_sales_price#3, d_year#7, d_moy#8, s_store_name#11, s_company_name#12] +Keys [6]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#3))] +Aggregate Attributes [1]: [sum#19] +Results [7]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum#20] + +(26) Exchange +Input [7]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum#20] +Arguments: hashpartitioning(i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) HashAggregate [codegen id : 8] +Input [7]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum#20] +Keys [6]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8] +Functions [1]: [sum(UnscaledValue(ss_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#3))#22] +Results [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#22,17,2) AS sum_sales#23, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#22,17,2) AS _w0#24] + +(28) Exchange +Input [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, _w0#24] +Arguments: hashpartitioning(i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, 5), ENSURE_REQUIREMENTS, [id=#25] + +(29) Sort [codegen id : 9] +Input [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, _w0#24] +Arguments: [i_category#17 ASC NULLS FIRST, i_brand#16 ASC NULLS FIRST, s_store_name#11 ASC NULLS FIRST, s_company_name#12 ASC NULLS FIRST, d_year#7 ASC NULLS FIRST], false, 0 + +(30) Window +Input [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, _w0#24] +Arguments: [avg(_w0#24) windowspecdefinition(i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#26], [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7] + +(31) Project [codegen id : 10] +Output [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26] +Input [9]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, _w0#24, avg_monthly_sales#26] + +(32) Exchange +Input [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26] +Arguments: hashpartitioning(i_category#17, i_brand#16, s_store_name#11, s_company_name#12, 5), ENSURE_REQUIREMENTS, [id=#27] + +(33) Sort [codegen id : 11] +Input [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26] +Arguments: [i_category#17 ASC NULLS FIRST, i_brand#16 ASC NULLS FIRST, s_store_name#11 ASC NULLS FIRST, s_company_name#12 ASC NULLS FIRST, d_year#7 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST], false, 0 + +(34) Window +Input [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26] +Arguments: [rank(d_year#7, d_moy#8) windowspecdefinition(i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#28], [i_category#17, i_brand#16, s_store_name#11, s_company_name#12], [d_year#7 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST] + +(35) Filter [codegen id : 12] +Input [9]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26, rn#28] +Condition : ((((isnotnull(d_year#7) AND isnotnull(avg_monthly_sales#26)) AND (d_year#7 = 1999)) AND (avg_monthly_sales#26 > 0.000000)) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#23 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)) + +(36) Exchange +Input [9]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26, rn#28] +Arguments: hashpartitioning(i_category#17, i_brand#16, s_store_name#11, s_company_name#12, rn#28, 5), ENSURE_REQUIREMENTS, [id=#29] + +(37) Sort [codegen id : 13] +Input [9]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26, rn#28] +Arguments: [i_category#17 ASC NULLS FIRST, i_brand#16 ASC NULLS FIRST, s_store_name#11 ASC NULLS FIRST, s_company_name#12 ASC NULLS FIRST, rn#28 ASC NULLS FIRST], false, 0 + +(38) ReusedExchange [Reuses operator id: unknown] +Output [7]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, sum#36] + +(39) HashAggregate [codegen id : 21] +Input [7]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, sum#36] +Keys [6]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35] +Functions [1]: [sum(UnscaledValue(ss_sales_price#37))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#37))#38] +Results [7]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, MakeDecimal(sum(UnscaledValue(ss_sales_price#37))#38,17,2) AS sum_sales#39] + +(40) Exchange +Input [7]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, sum_sales#39] +Arguments: hashpartitioning(i_category#30, i_brand#31, s_store_name#32, s_company_name#33, 5), ENSURE_REQUIREMENTS, [id=#40] + +(41) Sort [codegen id : 22] +Input [7]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, sum_sales#39] +Arguments: [i_category#30 ASC NULLS FIRST, i_brand#31 ASC NULLS FIRST, s_store_name#32 ASC NULLS FIRST, s_company_name#33 ASC NULLS FIRST, d_year#34 ASC NULLS FIRST, d_moy#35 ASC NULLS FIRST], false, 0 + +(42) Window +Input [7]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, sum_sales#39] +Arguments: [rank(d_year#34, d_moy#35) windowspecdefinition(i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34 ASC NULLS FIRST, d_moy#35 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#41], [i_category#30, i_brand#31, s_store_name#32, s_company_name#33], [d_year#34 ASC NULLS FIRST, d_moy#35 ASC NULLS FIRST] + +(43) Project [codegen id : 23] +Output [6]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, sum_sales#39, rn#41] +Input [8]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, sum_sales#39, rn#41] + +(44) Exchange +Input [6]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, sum_sales#39, rn#41] +Arguments: hashpartitioning(i_category#30, i_brand#31, s_store_name#32, s_company_name#33, (rn#41 + 1), 5), ENSURE_REQUIREMENTS, [id=#42] + +(45) Sort [codegen id : 24] +Input [6]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, sum_sales#39, rn#41] +Arguments: [i_category#30 ASC NULLS FIRST, i_brand#31 ASC NULLS FIRST, s_store_name#32 ASC NULLS FIRST, s_company_name#33 ASC NULLS FIRST, (rn#41 + 1) ASC NULLS FIRST], false, 0 + +(46) SortMergeJoin [codegen id : 25] +Left keys [5]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, rn#28] +Right keys [5]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, (rn#41 + 1)] +Join condition: None + +(47) Project [codegen id : 25] +Output [10]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26, rn#28, sum_sales#39] +Input [15]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26, rn#28, i_category#30, i_brand#31, s_store_name#32, s_company_name#33, sum_sales#39, rn#41] + +(48) ReusedExchange [Reuses operator id: 40] +Output [7]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, d_year#47, d_moy#48, sum_sales#49] + +(49) Sort [codegen id : 34] +Input [7]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, d_year#47, d_moy#48, sum_sales#49] +Arguments: [i_category#43 ASC NULLS FIRST, i_brand#44 ASC NULLS FIRST, s_store_name#45 ASC NULLS FIRST, s_company_name#46 ASC NULLS FIRST, d_year#47 ASC NULLS FIRST, d_moy#48 ASC NULLS FIRST], false, 0 + +(50) Window +Input [7]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, d_year#47, d_moy#48, sum_sales#49] +Arguments: [rank(d_year#47, d_moy#48) windowspecdefinition(i_category#43, i_brand#44, s_store_name#45, s_company_name#46, d_year#47 ASC NULLS FIRST, d_moy#48 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#50], [i_category#43, i_brand#44, s_store_name#45, s_company_name#46], [d_year#47 ASC NULLS FIRST, d_moy#48 ASC NULLS FIRST] + +(51) Project [codegen id : 35] +Output [6]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, sum_sales#49, rn#50] +Input [8]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, d_year#47, d_moy#48, sum_sales#49, rn#50] + +(52) Exchange +Input [6]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, sum_sales#49, rn#50] +Arguments: hashpartitioning(i_category#43, i_brand#44, s_store_name#45, s_company_name#46, (rn#50 - 1), 5), ENSURE_REQUIREMENTS, [id=#51] + +(53) Sort [codegen id : 36] +Input [6]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, sum_sales#49, rn#50] +Arguments: [i_category#43 ASC NULLS FIRST, i_brand#44 ASC NULLS FIRST, s_store_name#45 ASC NULLS FIRST, s_company_name#46 ASC NULLS FIRST, (rn#50 - 1) ASC NULLS FIRST], false, 0 + +(54) SortMergeJoin [codegen id : 37] +Left keys [5]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, rn#28] +Right keys [5]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, (rn#50 - 1)] +Join condition: None + +(55) Project [codegen id : 37] +Output [10]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, avg_monthly_sales#26, sum_sales#23, sum_sales#39 AS psum#52, sum_sales#49 AS nsum#53] +Input [16]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26, rn#28, sum_sales#39, i_category#43, i_brand#44, s_store_name#45, s_company_name#46, sum_sales#49, rn#50] + +(56) TakeOrderedAndProject +Input [10]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, avg_monthly_sales#26, sum_sales#23, psum#52, nsum#53] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#23 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#11 ASC NULLS FIRST], [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, avg_monthly_sales#26, sum_sales#23, psum#52, nsum#53] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (57) + + +(57) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q47.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q47.sf100/simplified.txt new file mode 100644 index 0000000000000..71c344d7e240a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q47.sf100/simplified.txt @@ -0,0 +1,107 @@ +TakeOrderedAndProject [sum_sales,avg_monthly_sales,s_store_name,i_category,i_brand,s_company_name,d_year,d_moy,psum,nsum] + WholeStageCodegen (37) + Project [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,avg_monthly_sales,sum_sales,sum_sales,sum_sales] + SortMergeJoin [i_category,i_brand,s_store_name,s_company_name,rn,i_category,i_brand,s_store_name,s_company_name,rn] + InputAdapter + WholeStageCodegen (25) + Project [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum_sales,avg_monthly_sales,rn,sum_sales] + SortMergeJoin [i_category,i_brand,s_store_name,s_company_name,rn,i_category,i_brand,s_store_name,s_company_name,rn] + InputAdapter + WholeStageCodegen (13) + Sort [i_category,i_brand,s_store_name,s_company_name,rn] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,rn] #1 + WholeStageCodegen (12) + Filter [d_year,avg_monthly_sales,sum_sales] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (11) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name] #2 + WholeStageCodegen (10) + Project [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum_sales,avg_monthly_sales] + InputAdapter + Window [_w0,i_category,i_brand,s_store_name,s_company_name,d_year] + WholeStageCodegen (9) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,d_year] #3 + WholeStageCodegen (8) + HashAggregate [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] #4 + WholeStageCodegen (7) + HashAggregate [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,ss_sales_price] [sum,sum] + Project [i_brand,i_category,ss_sales_price,d_year,d_moy,s_store_name,s_company_name] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #5 + WholeStageCodegen (3) + Project [ss_item_sk,ss_sales_price,d_year,d_moy,s_store_name,s_company_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_sales_price,d_year,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (2) + Filter [s_store_sk,s_store_name,s_company_name] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_company_name] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #8 + WholeStageCodegen (5) + Filter [i_item_sk,i_category,i_brand] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_category] + InputAdapter + WholeStageCodegen (24) + Sort [i_category,i_brand,s_store_name,s_company_name,rn] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,rn] #9 + WholeStageCodegen (23) + Project [i_category,i_brand,s_store_name,s_company_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (22) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name] #10 + WholeStageCodegen (21) + HashAggregate [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,sum] + InputAdapter + ReusedExchange [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum] #11 + InputAdapter + WholeStageCodegen (36) + Sort [i_category,i_brand,s_store_name,s_company_name,rn] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,rn] #12 + WholeStageCodegen (35) + Project [i_category,i_brand,s_store_name,s_company_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (34) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] + InputAdapter + ReusedExchange [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum_sales] #10 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q47/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q47/explain.txt new file mode 100644 index 0000000000000..917b21c247449 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q47/explain.txt @@ -0,0 +1,279 @@ +== Physical Plan == +TakeOrderedAndProject (49) ++- * Project (48) + +- * BroadcastHashJoin Inner BuildRight (47) + :- * Project (41) + : +- * BroadcastHashJoin Inner BuildRight (40) + : :- * Filter (32) + : : +- Window (31) + : : +- * Sort (30) + : : +- Exchange (29) + : : +- * Project (28) + : : +- Window (27) + : : +- * Sort (26) + : : +- Exchange (25) + : : +- * HashAggregate (24) + : : +- Exchange (23) + : : +- * HashAggregate (22) + : : +- * Project (21) + : : +- * BroadcastHashJoin Inner BuildRight (20) + : : :- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.item (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (19) + : : +- * Filter (18) + : : +- * ColumnarToRow (17) + : : +- Scan parquet default.store (16) + : +- BroadcastExchange (39) + : +- * Project (38) + : +- Window (37) + : +- * Sort (36) + : +- Exchange (35) + : +- * HashAggregate (34) + : +- ReusedExchange (33) + +- BroadcastExchange (46) + +- * Project (45) + +- Window (44) + +- * Sort (43) + +- ReusedExchange (42) + + +(1) Scan parquet default.item +Output [3]: [i_item_sk#1, i_brand#2, i_category#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_category), IsNotNull(i_brand)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [3]: [i_item_sk#1, i_brand#2, i_category#3] + +(3) Filter [codegen id : 4] +Input [3]: [i_item_sk#1, i_brand#2, i_category#3] +Condition : ((isnotnull(i_item_sk#1) AND isnotnull(i_category#3)) AND isnotnull(i_brand#2)) + +(4) Scan parquet default.store_sales +Output [4]: [ss_item_sk#4, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#4, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] + +(6) Filter [codegen id : 1] +Input [4]: [ss_item_sk#4, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] +Condition : (isnotnull(ss_item_sk#4) AND isnotnull(ss_store_sk#5)) + +(7) BroadcastExchange +Input [4]: [ss_item_sk#4, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] + +(8) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#4] +Join condition: None + +(9) Project [codegen id : 4] +Output [5]: [i_brand#2, i_category#3, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] +Input [7]: [i_item_sk#1, i_brand#2, i_category#3, ss_item_sk#4, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] + +(10) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(Or(EqualTo(d_year,1999),And(EqualTo(d_year,1998),EqualTo(d_moy,12))),And(EqualTo(d_year,2000),EqualTo(d_moy,1))), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(12) Filter [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Condition : ((((d_year#11 = 1999) OR ((d_year#11 = 1998) AND (d_moy#12 = 12))) OR ((d_year#11 = 2000) AND (d_moy#12 = 1))) AND isnotnull(d_date_sk#10)) + +(13) BroadcastExchange +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(15) Project [codegen id : 4] +Output [6]: [i_brand#2, i_category#3, ss_store_sk#5, ss_sales_price#6, d_year#11, d_moy#12] +Input [8]: [i_brand#2, i_category#3, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7, d_date_sk#10, d_year#11, d_moy#12] + +(16) Scan parquet default.store +Output [3]: [s_store_sk#14, s_store_name#15, s_company_name#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_name), IsNotNull(s_company_name)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [3]: [s_store_sk#14, s_store_name#15, s_company_name#16] + +(18) Filter [codegen id : 3] +Input [3]: [s_store_sk#14, s_store_name#15, s_company_name#16] +Condition : ((isnotnull(s_store_sk#14) AND isnotnull(s_store_name#15)) AND isnotnull(s_company_name#16)) + +(19) BroadcastExchange +Input [3]: [s_store_sk#14, s_store_name#15, s_company_name#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(20) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#5] +Right keys [1]: [s_store_sk#14] +Join condition: None + +(21) Project [codegen id : 4] +Output [7]: [i_brand#2, i_category#3, ss_sales_price#6, d_year#11, d_moy#12, s_store_name#15, s_company_name#16] +Input [9]: [i_brand#2, i_category#3, ss_store_sk#5, ss_sales_price#6, d_year#11, d_moy#12, s_store_sk#14, s_store_name#15, s_company_name#16] + +(22) HashAggregate [codegen id : 4] +Input [7]: [i_brand#2, i_category#3, ss_sales_price#6, d_year#11, d_moy#12, s_store_name#15, s_company_name#16] +Keys [6]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [1]: [sum#18] +Results [7]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum#19] + +(23) Exchange +Input [7]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum#19] +Arguments: hashpartitioning(i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, 5), ENSURE_REQUIREMENTS, [id=#20] + +(24) HashAggregate [codegen id : 5] +Input [7]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum#19] +Keys [6]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12] +Functions [1]: [sum(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#6))#21] +Results [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, MakeDecimal(sum(UnscaledValue(ss_sales_price#6))#21,17,2) AS sum_sales#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#6))#21,17,2) AS _w0#23] + +(25) Exchange +Input [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, _w0#23] +Arguments: hashpartitioning(i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, 5), ENSURE_REQUIREMENTS, [id=#24] + +(26) Sort [codegen id : 6] +Input [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, _w0#23] +Arguments: [i_category#3 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST, s_company_name#16 ASC NULLS FIRST, d_year#11 ASC NULLS FIRST], false, 0 + +(27) Window +Input [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, _w0#23] +Arguments: [avg(_w0#23) windowspecdefinition(i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#25], [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11] + +(28) Project [codegen id : 7] +Output [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Input [9]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, _w0#23, avg_monthly_sales#25] + +(29) Exchange +Input [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Arguments: hashpartitioning(i_category#3, i_brand#2, s_store_name#15, s_company_name#16, 5), ENSURE_REQUIREMENTS, [id=#26] + +(30) Sort [codegen id : 8] +Input [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Arguments: [i_category#3 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST, s_company_name#16 ASC NULLS FIRST, d_year#11 ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST], false, 0 + +(31) Window +Input [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Arguments: [rank(d_year#11, d_moy#12) windowspecdefinition(i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11 ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#27], [i_category#3, i_brand#2, s_store_name#15, s_company_name#16], [d_year#11 ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST] + +(32) Filter [codegen id : 23] +Input [9]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25, rn#27] +Condition : ((((isnotnull(d_year#11) AND isnotnull(avg_monthly_sales#25)) AND (d_year#11 = 1999)) AND (avg_monthly_sales#25 > 0.000000)) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)) + +(33) ReusedExchange [Reuses operator id: unknown] +Output [7]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, sum#34] + +(34) HashAggregate [codegen id : 13] +Input [7]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, sum#34] +Keys [6]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33] +Functions [1]: [sum(UnscaledValue(ss_sales_price#35))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#35))#36] +Results [7]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, MakeDecimal(sum(UnscaledValue(ss_sales_price#35))#36,17,2) AS sum_sales#37] + +(35) Exchange +Input [7]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, sum_sales#37] +Arguments: hashpartitioning(i_category#28, i_brand#29, s_store_name#30, s_company_name#31, 5), ENSURE_REQUIREMENTS, [id=#38] + +(36) Sort [codegen id : 14] +Input [7]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, sum_sales#37] +Arguments: [i_category#28 ASC NULLS FIRST, i_brand#29 ASC NULLS FIRST, s_store_name#30 ASC NULLS FIRST, s_company_name#31 ASC NULLS FIRST, d_year#32 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST], false, 0 + +(37) Window +Input [7]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, sum_sales#37] +Arguments: [rank(d_year#32, d_moy#33) windowspecdefinition(i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#39], [i_category#28, i_brand#29, s_store_name#30, s_company_name#31], [d_year#32 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST] + +(38) Project [codegen id : 15] +Output [6]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, sum_sales#37, rn#39] +Input [8]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, sum_sales#37, rn#39] + +(39) BroadcastExchange +Input [6]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, sum_sales#37, rn#39] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true], input[1, string, true], input[2, string, true], input[3, string, true], (input[5, int, false] + 1)),false), [id=#40] + +(40) BroadcastHashJoin [codegen id : 23] +Left keys [5]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, rn#27] +Right keys [5]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, (rn#39 + 1)] +Join condition: None + +(41) Project [codegen id : 23] +Output [10]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25, rn#27, sum_sales#37] +Input [15]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25, rn#27, i_category#28, i_brand#29, s_store_name#30, s_company_name#31, sum_sales#37, rn#39] + +(42) ReusedExchange [Reuses operator id: 35] +Output [7]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, d_year#45, d_moy#46, sum_sales#47] + +(43) Sort [codegen id : 21] +Input [7]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, d_year#45, d_moy#46, sum_sales#47] +Arguments: [i_category#41 ASC NULLS FIRST, i_brand#42 ASC NULLS FIRST, s_store_name#43 ASC NULLS FIRST, s_company_name#44 ASC NULLS FIRST, d_year#45 ASC NULLS FIRST, d_moy#46 ASC NULLS FIRST], false, 0 + +(44) Window +Input [7]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, d_year#45, d_moy#46, sum_sales#47] +Arguments: [rank(d_year#45, d_moy#46) windowspecdefinition(i_category#41, i_brand#42, s_store_name#43, s_company_name#44, d_year#45 ASC NULLS FIRST, d_moy#46 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#48], [i_category#41, i_brand#42, s_store_name#43, s_company_name#44], [d_year#45 ASC NULLS FIRST, d_moy#46 ASC NULLS FIRST] + +(45) Project [codegen id : 22] +Output [6]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, sum_sales#47, rn#48] +Input [8]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, d_year#45, d_moy#46, sum_sales#47, rn#48] + +(46) BroadcastExchange +Input [6]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, sum_sales#47, rn#48] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true], input[1, string, true], input[2, string, true], input[3, string, true], (input[5, int, false] - 1)),false), [id=#49] + +(47) BroadcastHashJoin [codegen id : 23] +Left keys [5]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, rn#27] +Right keys [5]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, (rn#48 - 1)] +Join condition: None + +(48) Project [codegen id : 23] +Output [10]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, avg_monthly_sales#25, sum_sales#22, sum_sales#37 AS psum#50, sum_sales#47 AS nsum#51] +Input [16]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25, rn#27, sum_sales#37, i_category#41, i_brand#42, s_store_name#43, s_company_name#44, sum_sales#47, rn#48] + +(49) TakeOrderedAndProject +Input [10]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, avg_monthly_sales#25, sum_sales#22, psum#50, nsum#51] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST], [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, avg_monthly_sales#25, sum_sales#22, psum#50, nsum#51] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (50) + + +(50) ReusedExchange [Reuses operator id: 13] +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q47/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q47/simplified.txt new file mode 100644 index 0000000000000..ee3bf3f9890d3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q47/simplified.txt @@ -0,0 +1,84 @@ +TakeOrderedAndProject [sum_sales,avg_monthly_sales,s_store_name,i_category,i_brand,s_company_name,d_year,d_moy,psum,nsum] + WholeStageCodegen (23) + Project [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,avg_monthly_sales,sum_sales,sum_sales,sum_sales] + BroadcastHashJoin [i_category,i_brand,s_store_name,s_company_name,rn,i_category,i_brand,s_store_name,s_company_name,rn] + Project [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum_sales,avg_monthly_sales,rn,sum_sales] + BroadcastHashJoin [i_category,i_brand,s_store_name,s_company_name,rn,i_category,i_brand,s_store_name,s_company_name,rn] + Filter [d_year,avg_monthly_sales,sum_sales] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (8) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name] #1 + WholeStageCodegen (7) + Project [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum_sales,avg_monthly_sales] + InputAdapter + Window [_w0,i_category,i_brand,s_store_name,s_company_name,d_year] + WholeStageCodegen (6) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,d_year] #2 + WholeStageCodegen (5) + HashAggregate [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] #3 + WholeStageCodegen (4) + HashAggregate [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,ss_sales_price] [sum,sum] + Project [i_brand,i_category,ss_sales_price,d_year,d_moy,s_store_name,s_company_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_brand,i_category,ss_store_sk,ss_sales_price,d_year,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_brand,i_category,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + Filter [i_item_sk,i_category,i_brand] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Filter [s_store_sk,s_store_name,s_company_name] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_company_name] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (15) + Project [i_category,i_brand,s_store_name,s_company_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (14) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name] #8 + WholeStageCodegen (13) + HashAggregate [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,sum] + InputAdapter + ReusedExchange [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum] #9 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (22) + Project [i_category,i_brand,s_store_name,s_company_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (21) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] + InputAdapter + ReusedExchange [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum_sales] #8 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q48.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q48.sf100/explain.txt new file mode 100644 index 0000000000000..2f87af685f2e5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q48.sf100/explain.txt @@ -0,0 +1,194 @@ +== Physical Plan == +* HashAggregate (32) ++- Exchange (31) + +- * HashAggregate (30) + +- * Project (29) + +- * BroadcastHashJoin Inner BuildRight (28) + :- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.store (4) + : : +- BroadcastExchange (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.customer_demographics (10) + : +- BroadcastExchange (20) + : +- * Project (19) + : +- * Filter (18) + : +- * ColumnarToRow (17) + : +- Scan parquet default.customer_address (16) + +- BroadcastExchange (27) + +- * Project (26) + +- * Filter (25) + +- * ColumnarToRow (24) + +- Scan parquet default.date_dim (23) + + +(1) Scan parquet default.store_sales +Output [7]: [ss_cdemo_sk#1, ss_addr_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_addr_sk), Or(Or(And(GreaterThanOrEqual(ss_sales_price,100.00),LessThanOrEqual(ss_sales_price,150.00)),And(GreaterThanOrEqual(ss_sales_price,50.00),LessThanOrEqual(ss_sales_price,100.00))),And(GreaterThanOrEqual(ss_sales_price,150.00),LessThanOrEqual(ss_sales_price,200.00))), Or(Or(And(GreaterThanOrEqual(ss_net_profit,0.00),LessThanOrEqual(ss_net_profit,2000.00)),And(GreaterThanOrEqual(ss_net_profit,150.00),LessThanOrEqual(ss_net_profit,3000.00))),And(GreaterThanOrEqual(ss_net_profit,50.00),LessThanOrEqual(ss_net_profit,25000.00)))] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [7]: [ss_cdemo_sk#1, ss_addr_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] + +(3) Filter [codegen id : 5] +Input [7]: [ss_cdemo_sk#1, ss_addr_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Condition : ((((isnotnull(ss_store_sk#3) AND isnotnull(ss_cdemo_sk#1)) AND isnotnull(ss_addr_sk#2)) AND ((((ss_sales_price#5 >= 100.00) AND (ss_sales_price#5 <= 150.00)) OR ((ss_sales_price#5 >= 50.00) AND (ss_sales_price#5 <= 100.00))) OR ((ss_sales_price#5 >= 150.00) AND (ss_sales_price#5 <= 200.00)))) AND ((((ss_net_profit#6 >= 0.00) AND (ss_net_profit#6 <= 2000.00)) OR ((ss_net_profit#6 >= 150.00) AND (ss_net_profit#6 <= 3000.00))) OR ((ss_net_profit#6 >= 50.00) AND (ss_net_profit#6 <= 25000.00)))) + +(4) Scan parquet default.store +Output [1]: [s_store_sk#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [1]: [s_store_sk#9] + +(6) Filter [codegen id : 1] +Input [1]: [s_store_sk#9] +Condition : isnotnull(s_store_sk#9) + +(7) BroadcastExchange +Input [1]: [s_store_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] + +(8) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#9] +Join condition: None + +(9) Project [codegen id : 5] +Output [6]: [ss_cdemo_sk#1, ss_addr_sk#2, ss_quantity#4, ss_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Input [8]: [ss_cdemo_sk#1, ss_addr_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, s_store_sk#9] + +(10) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#11, cd_marital_status#12, cd_education_status#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), Or(Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,4 yr Degree )),And(EqualTo(cd_marital_status,D),EqualTo(cd_education_status,2 yr Degree ))),And(EqualTo(cd_marital_status,S),EqualTo(cd_education_status,College )))] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [cd_demo_sk#11, cd_marital_status#12, cd_education_status#13] + +(12) Filter [codegen id : 2] +Input [3]: [cd_demo_sk#11, cd_marital_status#12, cd_education_status#13] +Condition : (isnotnull(cd_demo_sk#11) AND ((((cd_marital_status#12 = M) AND (cd_education_status#13 = 4 yr Degree )) OR ((cd_marital_status#12 = D) AND (cd_education_status#13 = 2 yr Degree ))) OR ((cd_marital_status#12 = S) AND (cd_education_status#13 = College )))) + +(13) BroadcastExchange +Input [3]: [cd_demo_sk#11, cd_marital_status#12, cd_education_status#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(14) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_cdemo_sk#1] +Right keys [1]: [cd_demo_sk#11] +Join condition: ((((((cd_marital_status#12 = M) AND (cd_education_status#13 = 4 yr Degree )) AND (ss_sales_price#5 >= 100.00)) AND (ss_sales_price#5 <= 150.00)) OR ((((cd_marital_status#12 = D) AND (cd_education_status#13 = 2 yr Degree )) AND (ss_sales_price#5 >= 50.00)) AND (ss_sales_price#5 <= 100.00))) OR ((((cd_marital_status#12 = S) AND (cd_education_status#13 = College )) AND (ss_sales_price#5 >= 150.00)) AND (ss_sales_price#5 <= 200.00))) + +(15) Project [codegen id : 5] +Output [4]: [ss_addr_sk#2, ss_quantity#4, ss_net_profit#6, ss_sold_date_sk#7] +Input [9]: [ss_cdemo_sk#1, ss_addr_sk#2, ss_quantity#4, ss_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, cd_demo_sk#11, cd_marital_status#12, cd_education_status#13] + +(16) Scan parquet default.customer_address +Output [3]: [ca_address_sk#15, ca_state#16, ca_country#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), EqualTo(ca_country,United States), IsNotNull(ca_address_sk), Or(Or(In(ca_state, [CO,OH,TX]),In(ca_state, [OR,MN,KY])),In(ca_state, [VA,CA,MS]))] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [3]: [ca_address_sk#15, ca_state#16, ca_country#17] + +(18) Filter [codegen id : 3] +Input [3]: [ca_address_sk#15, ca_state#16, ca_country#17] +Condition : (((isnotnull(ca_country#17) AND (ca_country#17 = United States)) AND isnotnull(ca_address_sk#15)) AND ((ca_state#16 IN (CO,OH,TX) OR ca_state#16 IN (OR,MN,KY)) OR ca_state#16 IN (VA,CA,MS))) + +(19) Project [codegen id : 3] +Output [2]: [ca_address_sk#15, ca_state#16] +Input [3]: [ca_address_sk#15, ca_state#16, ca_country#17] + +(20) BroadcastExchange +Input [2]: [ca_address_sk#15, ca_state#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(21) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#2] +Right keys [1]: [ca_address_sk#15] +Join condition: ((((ca_state#16 IN (CO,OH,TX) AND (ss_net_profit#6 >= 0.00)) AND (ss_net_profit#6 <= 2000.00)) OR ((ca_state#16 IN (OR,MN,KY) AND (ss_net_profit#6 >= 150.00)) AND (ss_net_profit#6 <= 3000.00))) OR ((ca_state#16 IN (VA,CA,MS) AND (ss_net_profit#6 >= 50.00)) AND (ss_net_profit#6 <= 25000.00))) + +(22) Project [codegen id : 5] +Output [2]: [ss_quantity#4, ss_sold_date_sk#7] +Input [6]: [ss_addr_sk#2, ss_quantity#4, ss_net_profit#6, ss_sold_date_sk#7, ca_address_sk#15, ca_state#16] + +(23) Scan parquet default.date_dim +Output [2]: [d_date_sk#19, d_year#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#19, d_year#20] + +(25) Filter [codegen id : 4] +Input [2]: [d_date_sk#19, d_year#20] +Condition : ((isnotnull(d_year#20) AND (d_year#20 = 2001)) AND isnotnull(d_date_sk#19)) + +(26) Project [codegen id : 4] +Output [1]: [d_date_sk#19] +Input [2]: [d_date_sk#19, d_year#20] + +(27) BroadcastExchange +Input [1]: [d_date_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#19] +Join condition: None + +(29) Project [codegen id : 5] +Output [1]: [ss_quantity#4] +Input [3]: [ss_quantity#4, ss_sold_date_sk#7, d_date_sk#19] + +(30) HashAggregate [codegen id : 5] +Input [1]: [ss_quantity#4] +Keys: [] +Functions [1]: [partial_sum(ss_quantity#4)] +Aggregate Attributes [1]: [sum#22] +Results [1]: [sum#23] + +(31) Exchange +Input [1]: [sum#23] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#24] + +(32) HashAggregate [codegen id : 6] +Input [1]: [sum#23] +Keys: [] +Functions [1]: [sum(ss_quantity#4)] +Aggregate Attributes [1]: [sum(ss_quantity#4)#25] +Results [1]: [sum(ss_quantity#4)#25 AS sum(ss_quantity)#26] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 27] +Output [1]: [d_date_sk#19] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q48.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q48.sf100/simplified.txt new file mode 100644 index 0000000000000..9a7fc188f3ded --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q48.sf100/simplified.txt @@ -0,0 +1,50 @@ +WholeStageCodegen (6) + HashAggregate [sum] [sum(ss_quantity),sum(ss_quantity),sum] + InputAdapter + Exchange #1 + WholeStageCodegen (5) + HashAggregate [ss_quantity] [sum,sum] + Project [ss_quantity] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_quantity,ss_sold_date_sk] + BroadcastHashJoin [ss_addr_sk,ca_address_sk,ca_state,ss_net_profit] + Project [ss_addr_sk,ss_quantity,ss_net_profit,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk,cd_marital_status,cd_education_status,ss_sales_price] + Project [ss_cdemo_sk,ss_addr_sk,ss_quantity,ss_sales_price,ss_net_profit,ss_sold_date_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Filter [ss_store_sk,ss_cdemo_sk,ss_addr_sk,ss_sales_price,ss_net_profit] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_cdemo_sk,ss_addr_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [cd_demo_sk,cd_marital_status,cd_education_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [ca_address_sk,ca_state] + Filter [ca_country,ca_address_sk,ca_state] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_country] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q48/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q48/explain.txt new file mode 100644 index 0000000000000..2f87af685f2e5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q48/explain.txt @@ -0,0 +1,194 @@ +== Physical Plan == +* HashAggregate (32) ++- Exchange (31) + +- * HashAggregate (30) + +- * Project (29) + +- * BroadcastHashJoin Inner BuildRight (28) + :- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.store (4) + : : +- BroadcastExchange (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.customer_demographics (10) + : +- BroadcastExchange (20) + : +- * Project (19) + : +- * Filter (18) + : +- * ColumnarToRow (17) + : +- Scan parquet default.customer_address (16) + +- BroadcastExchange (27) + +- * Project (26) + +- * Filter (25) + +- * ColumnarToRow (24) + +- Scan parquet default.date_dim (23) + + +(1) Scan parquet default.store_sales +Output [7]: [ss_cdemo_sk#1, ss_addr_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_addr_sk), Or(Or(And(GreaterThanOrEqual(ss_sales_price,100.00),LessThanOrEqual(ss_sales_price,150.00)),And(GreaterThanOrEqual(ss_sales_price,50.00),LessThanOrEqual(ss_sales_price,100.00))),And(GreaterThanOrEqual(ss_sales_price,150.00),LessThanOrEqual(ss_sales_price,200.00))), Or(Or(And(GreaterThanOrEqual(ss_net_profit,0.00),LessThanOrEqual(ss_net_profit,2000.00)),And(GreaterThanOrEqual(ss_net_profit,150.00),LessThanOrEqual(ss_net_profit,3000.00))),And(GreaterThanOrEqual(ss_net_profit,50.00),LessThanOrEqual(ss_net_profit,25000.00)))] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [7]: [ss_cdemo_sk#1, ss_addr_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] + +(3) Filter [codegen id : 5] +Input [7]: [ss_cdemo_sk#1, ss_addr_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Condition : ((((isnotnull(ss_store_sk#3) AND isnotnull(ss_cdemo_sk#1)) AND isnotnull(ss_addr_sk#2)) AND ((((ss_sales_price#5 >= 100.00) AND (ss_sales_price#5 <= 150.00)) OR ((ss_sales_price#5 >= 50.00) AND (ss_sales_price#5 <= 100.00))) OR ((ss_sales_price#5 >= 150.00) AND (ss_sales_price#5 <= 200.00)))) AND ((((ss_net_profit#6 >= 0.00) AND (ss_net_profit#6 <= 2000.00)) OR ((ss_net_profit#6 >= 150.00) AND (ss_net_profit#6 <= 3000.00))) OR ((ss_net_profit#6 >= 50.00) AND (ss_net_profit#6 <= 25000.00)))) + +(4) Scan parquet default.store +Output [1]: [s_store_sk#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [1]: [s_store_sk#9] + +(6) Filter [codegen id : 1] +Input [1]: [s_store_sk#9] +Condition : isnotnull(s_store_sk#9) + +(7) BroadcastExchange +Input [1]: [s_store_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] + +(8) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#9] +Join condition: None + +(9) Project [codegen id : 5] +Output [6]: [ss_cdemo_sk#1, ss_addr_sk#2, ss_quantity#4, ss_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Input [8]: [ss_cdemo_sk#1, ss_addr_sk#2, ss_store_sk#3, ss_quantity#4, ss_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, s_store_sk#9] + +(10) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#11, cd_marital_status#12, cd_education_status#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), Or(Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,4 yr Degree )),And(EqualTo(cd_marital_status,D),EqualTo(cd_education_status,2 yr Degree ))),And(EqualTo(cd_marital_status,S),EqualTo(cd_education_status,College )))] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [cd_demo_sk#11, cd_marital_status#12, cd_education_status#13] + +(12) Filter [codegen id : 2] +Input [3]: [cd_demo_sk#11, cd_marital_status#12, cd_education_status#13] +Condition : (isnotnull(cd_demo_sk#11) AND ((((cd_marital_status#12 = M) AND (cd_education_status#13 = 4 yr Degree )) OR ((cd_marital_status#12 = D) AND (cd_education_status#13 = 2 yr Degree ))) OR ((cd_marital_status#12 = S) AND (cd_education_status#13 = College )))) + +(13) BroadcastExchange +Input [3]: [cd_demo_sk#11, cd_marital_status#12, cd_education_status#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(14) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_cdemo_sk#1] +Right keys [1]: [cd_demo_sk#11] +Join condition: ((((((cd_marital_status#12 = M) AND (cd_education_status#13 = 4 yr Degree )) AND (ss_sales_price#5 >= 100.00)) AND (ss_sales_price#5 <= 150.00)) OR ((((cd_marital_status#12 = D) AND (cd_education_status#13 = 2 yr Degree )) AND (ss_sales_price#5 >= 50.00)) AND (ss_sales_price#5 <= 100.00))) OR ((((cd_marital_status#12 = S) AND (cd_education_status#13 = College )) AND (ss_sales_price#5 >= 150.00)) AND (ss_sales_price#5 <= 200.00))) + +(15) Project [codegen id : 5] +Output [4]: [ss_addr_sk#2, ss_quantity#4, ss_net_profit#6, ss_sold_date_sk#7] +Input [9]: [ss_cdemo_sk#1, ss_addr_sk#2, ss_quantity#4, ss_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, cd_demo_sk#11, cd_marital_status#12, cd_education_status#13] + +(16) Scan parquet default.customer_address +Output [3]: [ca_address_sk#15, ca_state#16, ca_country#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), EqualTo(ca_country,United States), IsNotNull(ca_address_sk), Or(Or(In(ca_state, [CO,OH,TX]),In(ca_state, [OR,MN,KY])),In(ca_state, [VA,CA,MS]))] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [3]: [ca_address_sk#15, ca_state#16, ca_country#17] + +(18) Filter [codegen id : 3] +Input [3]: [ca_address_sk#15, ca_state#16, ca_country#17] +Condition : (((isnotnull(ca_country#17) AND (ca_country#17 = United States)) AND isnotnull(ca_address_sk#15)) AND ((ca_state#16 IN (CO,OH,TX) OR ca_state#16 IN (OR,MN,KY)) OR ca_state#16 IN (VA,CA,MS))) + +(19) Project [codegen id : 3] +Output [2]: [ca_address_sk#15, ca_state#16] +Input [3]: [ca_address_sk#15, ca_state#16, ca_country#17] + +(20) BroadcastExchange +Input [2]: [ca_address_sk#15, ca_state#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(21) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#2] +Right keys [1]: [ca_address_sk#15] +Join condition: ((((ca_state#16 IN (CO,OH,TX) AND (ss_net_profit#6 >= 0.00)) AND (ss_net_profit#6 <= 2000.00)) OR ((ca_state#16 IN (OR,MN,KY) AND (ss_net_profit#6 >= 150.00)) AND (ss_net_profit#6 <= 3000.00))) OR ((ca_state#16 IN (VA,CA,MS) AND (ss_net_profit#6 >= 50.00)) AND (ss_net_profit#6 <= 25000.00))) + +(22) Project [codegen id : 5] +Output [2]: [ss_quantity#4, ss_sold_date_sk#7] +Input [6]: [ss_addr_sk#2, ss_quantity#4, ss_net_profit#6, ss_sold_date_sk#7, ca_address_sk#15, ca_state#16] + +(23) Scan parquet default.date_dim +Output [2]: [d_date_sk#19, d_year#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#19, d_year#20] + +(25) Filter [codegen id : 4] +Input [2]: [d_date_sk#19, d_year#20] +Condition : ((isnotnull(d_year#20) AND (d_year#20 = 2001)) AND isnotnull(d_date_sk#19)) + +(26) Project [codegen id : 4] +Output [1]: [d_date_sk#19] +Input [2]: [d_date_sk#19, d_year#20] + +(27) BroadcastExchange +Input [1]: [d_date_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#19] +Join condition: None + +(29) Project [codegen id : 5] +Output [1]: [ss_quantity#4] +Input [3]: [ss_quantity#4, ss_sold_date_sk#7, d_date_sk#19] + +(30) HashAggregate [codegen id : 5] +Input [1]: [ss_quantity#4] +Keys: [] +Functions [1]: [partial_sum(ss_quantity#4)] +Aggregate Attributes [1]: [sum#22] +Results [1]: [sum#23] + +(31) Exchange +Input [1]: [sum#23] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#24] + +(32) HashAggregate [codegen id : 6] +Input [1]: [sum#23] +Keys: [] +Functions [1]: [sum(ss_quantity#4)] +Aggregate Attributes [1]: [sum(ss_quantity#4)#25] +Results [1]: [sum(ss_quantity#4)#25 AS sum(ss_quantity)#26] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 27] +Output [1]: [d_date_sk#19] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q48/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q48/simplified.txt new file mode 100644 index 0000000000000..9a7fc188f3ded --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q48/simplified.txt @@ -0,0 +1,50 @@ +WholeStageCodegen (6) + HashAggregate [sum] [sum(ss_quantity),sum(ss_quantity),sum] + InputAdapter + Exchange #1 + WholeStageCodegen (5) + HashAggregate [ss_quantity] [sum,sum] + Project [ss_quantity] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_quantity,ss_sold_date_sk] + BroadcastHashJoin [ss_addr_sk,ca_address_sk,ca_state,ss_net_profit] + Project [ss_addr_sk,ss_quantity,ss_net_profit,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk,cd_marital_status,cd_education_status,ss_sales_price] + Project [ss_cdemo_sk,ss_addr_sk,ss_quantity,ss_sales_price,ss_net_profit,ss_sold_date_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Filter [ss_store_sk,ss_cdemo_sk,ss_addr_sk,ss_sales_price,ss_net_profit] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_cdemo_sk,ss_addr_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [cd_demo_sk,cd_marital_status,cd_education_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [ca_address_sk,ca_state] + Filter [ca_country,ca_address_sk,ca_state] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_country] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt new file mode 100644 index 0000000000000..593d1ecf287e1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/explain.txt @@ -0,0 +1,510 @@ +== Physical Plan == +TakeOrderedAndProject (90) ++- * HashAggregate (89) + +- Exchange (88) + +- * HashAggregate (87) + +- Union (86) + :- * Project (31) + : +- * Filter (30) + : +- Window (29) + : +- * Sort (28) + : +- Window (27) + : +- * Sort (26) + : +- Exchange (25) + : +- * HashAggregate (24) + : +- Exchange (23) + : +- * HashAggregate (22) + : +- * Project (21) + : +- * SortMergeJoin Inner (20) + : :- * Sort (13) + : : +- Exchange (12) + : : +- * Project (11) + : : +- * BroadcastHashJoin Inner BuildRight (10) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.web_sales (1) + : : +- BroadcastExchange (9) + : : +- * Project (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.date_dim (5) + : +- * Sort (19) + : +- Exchange (18) + : +- * Project (17) + : +- * Filter (16) + : +- * ColumnarToRow (15) + : +- Scan parquet default.web_returns (14) + :- * Project (58) + : +- * Filter (57) + : +- Window (56) + : +- * Sort (55) + : +- Window (54) + : +- * Sort (53) + : +- Exchange (52) + : +- * HashAggregate (51) + : +- Exchange (50) + : +- * HashAggregate (49) + : +- * Project (48) + : +- * SortMergeJoin Inner (47) + : :- * Sort (40) + : : +- Exchange (39) + : : +- * Project (38) + : : +- * BroadcastHashJoin Inner BuildRight (37) + : : :- * Project (35) + : : : +- * Filter (34) + : : : +- * ColumnarToRow (33) + : : : +- Scan parquet default.catalog_sales (32) + : : +- ReusedExchange (36) + : +- * Sort (46) + : +- Exchange (45) + : +- * Project (44) + : +- * Filter (43) + : +- * ColumnarToRow (42) + : +- Scan parquet default.catalog_returns (41) + +- * Project (85) + +- * Filter (84) + +- Window (83) + +- * Sort (82) + +- Window (81) + +- * Sort (80) + +- Exchange (79) + +- * HashAggregate (78) + +- Exchange (77) + +- * HashAggregate (76) + +- * Project (75) + +- * SortMergeJoin Inner (74) + :- * Sort (67) + : +- Exchange (66) + : +- * Project (65) + : +- * BroadcastHashJoin Inner BuildRight (64) + : :- * Project (62) + : : +- * Filter (61) + : : +- * ColumnarToRow (60) + : : +- Scan parquet default.store_sales (59) + : +- ReusedExchange (63) + +- * Sort (73) + +- Exchange (72) + +- * Project (71) + +- * Filter (70) + +- * ColumnarToRow (69) + +- Scan parquet default.store_returns (68) + + +(1) Scan parquet default.web_sales +Output [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#6), dynamicpruningexpression(ws_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ws_net_profit), IsNotNull(ws_net_paid), IsNotNull(ws_quantity), GreaterThan(ws_net_profit,1.00), GreaterThan(ws_net_paid,0.00), GreaterThan(ws_quantity,0), IsNotNull(ws_order_number), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] + +(3) Filter [codegen id : 2] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] +Condition : (((((((isnotnull(ws_net_profit#5) AND isnotnull(ws_net_paid#4)) AND isnotnull(ws_quantity#3)) AND (ws_net_profit#5 > 1.00)) AND (ws_net_paid#4 > 0.00)) AND (ws_quantity#3 > 0)) AND isnotnull(ws_order_number#2)) AND isnotnull(ws_item_sk#1)) + +(4) Project [codegen id : 2] +Output [5]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] + +(5) Scan parquet default.date_dim +Output [3]: [d_date_sk#8, d_year#9, d_moy#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,12), IsNotNull(d_date_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(7) Filter [codegen id : 1] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] +Condition : ((((isnotnull(d_year#9) AND isnotnull(d_moy#10)) AND (d_year#9 = 2001)) AND (d_moy#10 = 12)) AND isnotnull(d_date_sk#8)) + +(8) Project [codegen id : 1] +Output [1]: [d_date_sk#8] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(9) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(10) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ws_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(11) Project [codegen id : 2] +Output [4]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6, d_date_sk#8] + +(12) Exchange +Input [4]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4] +Arguments: hashpartitioning(ws_order_number#2, ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#12] + +(13) Sort [codegen id : 3] +Input [4]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4] +Arguments: [ws_order_number#2 ASC NULLS FIRST, ws_item_sk#1 ASC NULLS FIRST], false, 0 + +(14) Scan parquet default.web_returns +Output [5]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16, wr_returned_date_sk#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_return_amt), GreaterThan(wr_return_amt,10000.00), IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 4] +Input [5]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16, wr_returned_date_sk#17] + +(16) Filter [codegen id : 4] +Input [5]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16, wr_returned_date_sk#17] +Condition : (((isnotnull(wr_return_amt#16) AND (wr_return_amt#16 > 10000.00)) AND isnotnull(wr_order_number#14)) AND isnotnull(wr_item_sk#13)) + +(17) Project [codegen id : 4] +Output [4]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16] +Input [5]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16, wr_returned_date_sk#17] + +(18) Exchange +Input [4]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16] +Arguments: hashpartitioning(wr_order_number#14, wr_item_sk#13, 5), ENSURE_REQUIREMENTS, [id=#18] + +(19) Sort [codegen id : 5] +Input [4]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16] +Arguments: [wr_order_number#14 ASC NULLS FIRST, wr_item_sk#13 ASC NULLS FIRST], false, 0 + +(20) SortMergeJoin [codegen id : 6] +Left keys [2]: [ws_order_number#2, ws_item_sk#1] +Right keys [2]: [wr_order_number#14, wr_item_sk#13] +Join condition: None + +(21) Project [codegen id : 6] +Output [5]: [ws_item_sk#1, ws_quantity#3, ws_net_paid#4, wr_return_quantity#15, wr_return_amt#16] +Input [8]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16] + +(22) HashAggregate [codegen id : 6] +Input [5]: [ws_item_sk#1, ws_quantity#3, ws_net_paid#4, wr_return_quantity#15, wr_return_amt#16] +Keys [1]: [ws_item_sk#1] +Functions [4]: [partial_sum(coalesce(wr_return_quantity#15, 0)), partial_sum(coalesce(ws_quantity#3, 0)), partial_sum(coalesce(cast(wr_return_amt#16 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))] +Aggregate Attributes [6]: [sum#19, sum#20, sum#21, isEmpty#22, sum#23, isEmpty#24] +Results [7]: [ws_item_sk#1, sum#25, sum#26, sum#27, isEmpty#28, sum#29, isEmpty#30] + +(23) Exchange +Input [7]: [ws_item_sk#1, sum#25, sum#26, sum#27, isEmpty#28, sum#29, isEmpty#30] +Arguments: hashpartitioning(ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#31] + +(24) HashAggregate [codegen id : 7] +Input [7]: [ws_item_sk#1, sum#25, sum#26, sum#27, isEmpty#28, sum#29, isEmpty#30] +Keys [1]: [ws_item_sk#1] +Functions [4]: [sum(coalesce(wr_return_quantity#15, 0)), sum(coalesce(ws_quantity#3, 0)), sum(coalesce(cast(wr_return_amt#16 as decimal(12,2)), 0.00)), sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(coalesce(wr_return_quantity#15, 0))#32, sum(coalesce(ws_quantity#3, 0))#33, sum(coalesce(cast(wr_return_amt#16 as decimal(12,2)), 0.00))#34, sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))#35] +Results [3]: [ws_item_sk#1 AS item#36, CheckOverflow((promote_precision(cast(sum(coalesce(wr_return_quantity#15, 0))#32 as decimal(15,4))) / promote_precision(cast(sum(coalesce(ws_quantity#3, 0))#33 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#37, CheckOverflow((promote_precision(cast(sum(coalesce(cast(wr_return_amt#16 as decimal(12,2)), 0.00))#34 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))#35 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#38] + +(25) Exchange +Input [3]: [item#36, return_ratio#37, currency_ratio#38] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#39] + +(26) Sort [codegen id : 8] +Input [3]: [item#36, return_ratio#37, currency_ratio#38] +Arguments: [return_ratio#37 ASC NULLS FIRST], false, 0 + +(27) Window +Input [3]: [item#36, return_ratio#37, currency_ratio#38] +Arguments: [rank(return_ratio#37) windowspecdefinition(return_ratio#37 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS return_rank#40], [return_ratio#37 ASC NULLS FIRST] + +(28) Sort [codegen id : 9] +Input [4]: [item#36, return_ratio#37, currency_ratio#38, return_rank#40] +Arguments: [currency_ratio#38 ASC NULLS FIRST], false, 0 + +(29) Window +Input [4]: [item#36, return_ratio#37, currency_ratio#38, return_rank#40] +Arguments: [rank(currency_ratio#38) windowspecdefinition(currency_ratio#38 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS currency_rank#41], [currency_ratio#38 ASC NULLS FIRST] + +(30) Filter [codegen id : 10] +Input [5]: [item#36, return_ratio#37, currency_ratio#38, return_rank#40, currency_rank#41] +Condition : ((return_rank#40 <= 10) OR (currency_rank#41 <= 10)) + +(31) Project [codegen id : 10] +Output [5]: [web AS channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Input [5]: [item#36, return_ratio#37, currency_ratio#38, return_rank#40, currency_rank#41] + +(32) Scan parquet default.catalog_sales +Output [6]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cs_net_profit#47, cs_sold_date_sk#48] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#48), dynamicpruningexpression(cs_sold_date_sk#48 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(cs_net_profit), IsNotNull(cs_net_paid), IsNotNull(cs_quantity), GreaterThan(cs_net_profit,1.00), GreaterThan(cs_net_paid,0.00), GreaterThan(cs_quantity,0), IsNotNull(cs_order_number), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(33) ColumnarToRow [codegen id : 12] +Input [6]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cs_net_profit#47, cs_sold_date_sk#48] + +(34) Filter [codegen id : 12] +Input [6]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cs_net_profit#47, cs_sold_date_sk#48] +Condition : (((((((isnotnull(cs_net_profit#47) AND isnotnull(cs_net_paid#46)) AND isnotnull(cs_quantity#45)) AND (cs_net_profit#47 > 1.00)) AND (cs_net_paid#46 > 0.00)) AND (cs_quantity#45 > 0)) AND isnotnull(cs_order_number#44)) AND isnotnull(cs_item_sk#43)) + +(35) Project [codegen id : 12] +Output [5]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cs_sold_date_sk#48] +Input [6]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cs_net_profit#47, cs_sold_date_sk#48] + +(36) ReusedExchange [Reuses operator id: 9] +Output [1]: [d_date_sk#49] + +(37) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [cs_sold_date_sk#48] +Right keys [1]: [d_date_sk#49] +Join condition: None + +(38) Project [codegen id : 12] +Output [4]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46] +Input [6]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cs_sold_date_sk#48, d_date_sk#49] + +(39) Exchange +Input [4]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46] +Arguments: hashpartitioning(cs_order_number#44, cs_item_sk#43, 5), ENSURE_REQUIREMENTS, [id=#50] + +(40) Sort [codegen id : 13] +Input [4]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46] +Arguments: [cs_order_number#44 ASC NULLS FIRST, cs_item_sk#43 ASC NULLS FIRST], false, 0 + +(41) Scan parquet default.catalog_returns +Output [5]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54, cr_returned_date_sk#55] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_return_amount), GreaterThan(cr_return_amount,10000.00), IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(42) ColumnarToRow [codegen id : 14] +Input [5]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54, cr_returned_date_sk#55] + +(43) Filter [codegen id : 14] +Input [5]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54, cr_returned_date_sk#55] +Condition : (((isnotnull(cr_return_amount#54) AND (cr_return_amount#54 > 10000.00)) AND isnotnull(cr_order_number#52)) AND isnotnull(cr_item_sk#51)) + +(44) Project [codegen id : 14] +Output [4]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54] +Input [5]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54, cr_returned_date_sk#55] + +(45) Exchange +Input [4]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54] +Arguments: hashpartitioning(cr_order_number#52, cr_item_sk#51, 5), ENSURE_REQUIREMENTS, [id=#56] + +(46) Sort [codegen id : 15] +Input [4]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54] +Arguments: [cr_order_number#52 ASC NULLS FIRST, cr_item_sk#51 ASC NULLS FIRST], false, 0 + +(47) SortMergeJoin [codegen id : 16] +Left keys [2]: [cs_order_number#44, cs_item_sk#43] +Right keys [2]: [cr_order_number#52, cr_item_sk#51] +Join condition: None + +(48) Project [codegen id : 16] +Output [5]: [cs_item_sk#43, cs_quantity#45, cs_net_paid#46, cr_return_quantity#53, cr_return_amount#54] +Input [8]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54] + +(49) HashAggregate [codegen id : 16] +Input [5]: [cs_item_sk#43, cs_quantity#45, cs_net_paid#46, cr_return_quantity#53, cr_return_amount#54] +Keys [1]: [cs_item_sk#43] +Functions [4]: [partial_sum(coalesce(cr_return_quantity#53, 0)), partial_sum(coalesce(cs_quantity#45, 0)), partial_sum(coalesce(cast(cr_return_amount#54 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(cs_net_paid#46 as decimal(12,2)), 0.00))] +Aggregate Attributes [6]: [sum#57, sum#58, sum#59, isEmpty#60, sum#61, isEmpty#62] +Results [7]: [cs_item_sk#43, sum#63, sum#64, sum#65, isEmpty#66, sum#67, isEmpty#68] + +(50) Exchange +Input [7]: [cs_item_sk#43, sum#63, sum#64, sum#65, isEmpty#66, sum#67, isEmpty#68] +Arguments: hashpartitioning(cs_item_sk#43, 5), ENSURE_REQUIREMENTS, [id=#69] + +(51) HashAggregate [codegen id : 17] +Input [7]: [cs_item_sk#43, sum#63, sum#64, sum#65, isEmpty#66, sum#67, isEmpty#68] +Keys [1]: [cs_item_sk#43] +Functions [4]: [sum(coalesce(cr_return_quantity#53, 0)), sum(coalesce(cs_quantity#45, 0)), sum(coalesce(cast(cr_return_amount#54 as decimal(12,2)), 0.00)), sum(coalesce(cast(cs_net_paid#46 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(coalesce(cr_return_quantity#53, 0))#70, sum(coalesce(cs_quantity#45, 0))#71, sum(coalesce(cast(cr_return_amount#54 as decimal(12,2)), 0.00))#72, sum(coalesce(cast(cs_net_paid#46 as decimal(12,2)), 0.00))#73] +Results [3]: [cs_item_sk#43 AS item#74, CheckOverflow((promote_precision(cast(sum(coalesce(cr_return_quantity#53, 0))#70 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cs_quantity#45, 0))#71 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#75, CheckOverflow((promote_precision(cast(sum(coalesce(cast(cr_return_amount#54 as decimal(12,2)), 0.00))#72 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(cs_net_paid#46 as decimal(12,2)), 0.00))#73 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#76] + +(52) Exchange +Input [3]: [item#74, return_ratio#75, currency_ratio#76] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#77] + +(53) Sort [codegen id : 18] +Input [3]: [item#74, return_ratio#75, currency_ratio#76] +Arguments: [return_ratio#75 ASC NULLS FIRST], false, 0 + +(54) Window +Input [3]: [item#74, return_ratio#75, currency_ratio#76] +Arguments: [rank(return_ratio#75) windowspecdefinition(return_ratio#75 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS return_rank#78], [return_ratio#75 ASC NULLS FIRST] + +(55) Sort [codegen id : 19] +Input [4]: [item#74, return_ratio#75, currency_ratio#76, return_rank#78] +Arguments: [currency_ratio#76 ASC NULLS FIRST], false, 0 + +(56) Window +Input [4]: [item#74, return_ratio#75, currency_ratio#76, return_rank#78] +Arguments: [rank(currency_ratio#76) windowspecdefinition(currency_ratio#76 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS currency_rank#79], [currency_ratio#76 ASC NULLS FIRST] + +(57) Filter [codegen id : 20] +Input [5]: [item#74, return_ratio#75, currency_ratio#76, return_rank#78, currency_rank#79] +Condition : ((return_rank#78 <= 10) OR (currency_rank#79 <= 10)) + +(58) Project [codegen id : 20] +Output [5]: [catalog AS channel#80, item#74, return_ratio#75, return_rank#78, currency_rank#79] +Input [5]: [item#74, return_ratio#75, currency_ratio#76, return_rank#78, currency_rank#79] + +(59) Scan parquet default.store_sales +Output [6]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, ss_net_profit#85, ss_sold_date_sk#86] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#86), dynamicpruningexpression(ss_sold_date_sk#86 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_net_profit), IsNotNull(ss_net_paid), IsNotNull(ss_quantity), GreaterThan(ss_net_profit,1.00), GreaterThan(ss_net_paid,0.00), GreaterThan(ss_quantity,0), IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(60) ColumnarToRow [codegen id : 22] +Input [6]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, ss_net_profit#85, ss_sold_date_sk#86] + +(61) Filter [codegen id : 22] +Input [6]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, ss_net_profit#85, ss_sold_date_sk#86] +Condition : (((((((isnotnull(ss_net_profit#85) AND isnotnull(ss_net_paid#84)) AND isnotnull(ss_quantity#83)) AND (ss_net_profit#85 > 1.00)) AND (ss_net_paid#84 > 0.00)) AND (ss_quantity#83 > 0)) AND isnotnull(ss_ticket_number#82)) AND isnotnull(ss_item_sk#81)) + +(62) Project [codegen id : 22] +Output [5]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, ss_sold_date_sk#86] +Input [6]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, ss_net_profit#85, ss_sold_date_sk#86] + +(63) ReusedExchange [Reuses operator id: 9] +Output [1]: [d_date_sk#87] + +(64) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [ss_sold_date_sk#86] +Right keys [1]: [d_date_sk#87] +Join condition: None + +(65) Project [codegen id : 22] +Output [4]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84] +Input [6]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, ss_sold_date_sk#86, d_date_sk#87] + +(66) Exchange +Input [4]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84] +Arguments: hashpartitioning(ss_ticket_number#82, ss_item_sk#81, 5), ENSURE_REQUIREMENTS, [id=#88] + +(67) Sort [codegen id : 23] +Input [4]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84] +Arguments: [ss_ticket_number#82 ASC NULLS FIRST, ss_item_sk#81 ASC NULLS FIRST], false, 0 + +(68) Scan parquet default.store_returns +Output [5]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92, sr_returned_date_sk#93] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_return_amt), GreaterThan(sr_return_amt,10000.00), IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(69) ColumnarToRow [codegen id : 24] +Input [5]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92, sr_returned_date_sk#93] + +(70) Filter [codegen id : 24] +Input [5]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92, sr_returned_date_sk#93] +Condition : (((isnotnull(sr_return_amt#92) AND (sr_return_amt#92 > 10000.00)) AND isnotnull(sr_ticket_number#90)) AND isnotnull(sr_item_sk#89)) + +(71) Project [codegen id : 24] +Output [4]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92] +Input [5]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92, sr_returned_date_sk#93] + +(72) Exchange +Input [4]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92] +Arguments: hashpartitioning(sr_ticket_number#90, sr_item_sk#89, 5), ENSURE_REQUIREMENTS, [id=#94] + +(73) Sort [codegen id : 25] +Input [4]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92] +Arguments: [sr_ticket_number#90 ASC NULLS FIRST, sr_item_sk#89 ASC NULLS FIRST], false, 0 + +(74) SortMergeJoin [codegen id : 26] +Left keys [2]: [ss_ticket_number#82, ss_item_sk#81] +Right keys [2]: [sr_ticket_number#90, sr_item_sk#89] +Join condition: None + +(75) Project [codegen id : 26] +Output [5]: [ss_item_sk#81, ss_quantity#83, ss_net_paid#84, sr_return_quantity#91, sr_return_amt#92] +Input [8]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92] + +(76) HashAggregate [codegen id : 26] +Input [5]: [ss_item_sk#81, ss_quantity#83, ss_net_paid#84, sr_return_quantity#91, sr_return_amt#92] +Keys [1]: [ss_item_sk#81] +Functions [4]: [partial_sum(coalesce(sr_return_quantity#91, 0)), partial_sum(coalesce(ss_quantity#83, 0)), partial_sum(coalesce(cast(sr_return_amt#92 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(ss_net_paid#84 as decimal(12,2)), 0.00))] +Aggregate Attributes [6]: [sum#95, sum#96, sum#97, isEmpty#98, sum#99, isEmpty#100] +Results [7]: [ss_item_sk#81, sum#101, sum#102, sum#103, isEmpty#104, sum#105, isEmpty#106] + +(77) Exchange +Input [7]: [ss_item_sk#81, sum#101, sum#102, sum#103, isEmpty#104, sum#105, isEmpty#106] +Arguments: hashpartitioning(ss_item_sk#81, 5), ENSURE_REQUIREMENTS, [id=#107] + +(78) HashAggregate [codegen id : 27] +Input [7]: [ss_item_sk#81, sum#101, sum#102, sum#103, isEmpty#104, sum#105, isEmpty#106] +Keys [1]: [ss_item_sk#81] +Functions [4]: [sum(coalesce(sr_return_quantity#91, 0)), sum(coalesce(ss_quantity#83, 0)), sum(coalesce(cast(sr_return_amt#92 as decimal(12,2)), 0.00)), sum(coalesce(cast(ss_net_paid#84 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(coalesce(sr_return_quantity#91, 0))#108, sum(coalesce(ss_quantity#83, 0))#109, sum(coalesce(cast(sr_return_amt#92 as decimal(12,2)), 0.00))#110, sum(coalesce(cast(ss_net_paid#84 as decimal(12,2)), 0.00))#111] +Results [3]: [ss_item_sk#81 AS item#112, CheckOverflow((promote_precision(cast(sum(coalesce(sr_return_quantity#91, 0))#108 as decimal(15,4))) / promote_precision(cast(sum(coalesce(ss_quantity#83, 0))#109 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#113, CheckOverflow((promote_precision(cast(sum(coalesce(cast(sr_return_amt#92 as decimal(12,2)), 0.00))#110 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(ss_net_paid#84 as decimal(12,2)), 0.00))#111 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#114] + +(79) Exchange +Input [3]: [item#112, return_ratio#113, currency_ratio#114] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#115] + +(80) Sort [codegen id : 28] +Input [3]: [item#112, return_ratio#113, currency_ratio#114] +Arguments: [return_ratio#113 ASC NULLS FIRST], false, 0 + +(81) Window +Input [3]: [item#112, return_ratio#113, currency_ratio#114] +Arguments: [rank(return_ratio#113) windowspecdefinition(return_ratio#113 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS return_rank#116], [return_ratio#113 ASC NULLS FIRST] + +(82) Sort [codegen id : 29] +Input [4]: [item#112, return_ratio#113, currency_ratio#114, return_rank#116] +Arguments: [currency_ratio#114 ASC NULLS FIRST], false, 0 + +(83) Window +Input [4]: [item#112, return_ratio#113, currency_ratio#114, return_rank#116] +Arguments: [rank(currency_ratio#114) windowspecdefinition(currency_ratio#114 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS currency_rank#117], [currency_ratio#114 ASC NULLS FIRST] + +(84) Filter [codegen id : 30] +Input [5]: [item#112, return_ratio#113, currency_ratio#114, return_rank#116, currency_rank#117] +Condition : ((return_rank#116 <= 10) OR (currency_rank#117 <= 10)) + +(85) Project [codegen id : 30] +Output [5]: [store AS channel#118, item#112, return_ratio#113, return_rank#116, currency_rank#117] +Input [5]: [item#112, return_ratio#113, currency_ratio#114, return_rank#116, currency_rank#117] + +(86) Union + +(87) HashAggregate [codegen id : 31] +Input [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Keys [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] + +(88) Exchange +Input [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Arguments: hashpartitioning(channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41, 5), ENSURE_REQUIREMENTS, [id=#119] + +(89) HashAggregate [codegen id : 32] +Input [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Keys [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] + +(90) TakeOrderedAndProject +Input [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Arguments: 100, [channel#42 ASC NULLS FIRST, return_rank#40 ASC NULLS FIRST, currency_rank#41 ASC NULLS FIRST], [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (91) + + +(91) ReusedExchange [Reuses operator id: 9] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 32 Hosting Expression = cs_sold_date_sk#48 IN dynamicpruning#7 + +Subquery:3 Hosting operator id = 59 Hosting Expression = ss_sold_date_sk#86 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/simplified.txt new file mode 100644 index 0000000000000..60d16f8b606af --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49.sf100/simplified.txt @@ -0,0 +1,160 @@ +TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] + WholeStageCodegen (32) + HashAggregate [channel,item,return_ratio,return_rank,currency_rank] + InputAdapter + Exchange [channel,item,return_ratio,return_rank,currency_rank] #1 + WholeStageCodegen (31) + HashAggregate [channel,item,return_ratio,return_rank,currency_rank] + InputAdapter + Union + WholeStageCodegen (10) + Project [item,return_ratio,return_rank,currency_rank] + Filter [return_rank,currency_rank] + InputAdapter + Window [currency_ratio] + WholeStageCodegen (9) + Sort [currency_ratio] + InputAdapter + Window [return_ratio] + WholeStageCodegen (8) + Sort [return_ratio] + InputAdapter + Exchange #2 + WholeStageCodegen (7) + HashAggregate [ws_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(wr_return_quantity, 0)),sum(coalesce(ws_quantity, 0)),sum(coalesce(cast(wr_return_amt as decimal(12,2)), 0.00)),sum(coalesce(cast(ws_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (6) + HashAggregate [ws_item_sk,wr_return_quantity,ws_quantity,wr_return_amt,ws_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty] + Project [ws_item_sk,ws_quantity,ws_net_paid,wr_return_quantity,wr_return_amt] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #4 + WholeStageCodegen (2) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_sold_date_sk] + Filter [ws_net_profit,ws_net_paid,ws_quantity,ws_order_number,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_net_profit,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + WholeStageCodegen (5) + Sort [wr_order_number,wr_item_sk] + InputAdapter + Exchange [wr_order_number,wr_item_sk] #6 + WholeStageCodegen (4) + Project [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt] + Filter [wr_return_amt,wr_order_number,wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt,wr_returned_date_sk] + WholeStageCodegen (20) + Project [item,return_ratio,return_rank,currency_rank] + Filter [return_rank,currency_rank] + InputAdapter + Window [currency_ratio] + WholeStageCodegen (19) + Sort [currency_ratio] + InputAdapter + Window [return_ratio] + WholeStageCodegen (18) + Sort [return_ratio] + InputAdapter + Exchange #7 + WholeStageCodegen (17) + HashAggregate [cs_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(cr_return_quantity, 0)),sum(coalesce(cs_quantity, 0)),sum(coalesce(cast(cr_return_amount as decimal(12,2)), 0.00)),sum(coalesce(cast(cs_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [cs_item_sk] #8 + WholeStageCodegen (16) + HashAggregate [cs_item_sk,cr_return_quantity,cs_quantity,cr_return_amount,cs_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty] + Project [cs_item_sk,cs_quantity,cs_net_paid,cr_return_quantity,cr_return_amount] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (13) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #9 + WholeStageCodegen (12) + Project [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid,cs_sold_date_sk] + Filter [cs_net_profit,cs_net_paid,cs_quantity,cs_order_number,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + WholeStageCodegen (15) + Sort [cr_order_number,cr_item_sk] + InputAdapter + Exchange [cr_order_number,cr_item_sk] #10 + WholeStageCodegen (14) + Project [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount] + Filter [cr_return_amount,cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount,cr_returned_date_sk] + WholeStageCodegen (30) + Project [item,return_ratio,return_rank,currency_rank] + Filter [return_rank,currency_rank] + InputAdapter + Window [currency_ratio] + WholeStageCodegen (29) + Sort [currency_ratio] + InputAdapter + Window [return_ratio] + WholeStageCodegen (28) + Sort [return_ratio] + InputAdapter + Exchange #11 + WholeStageCodegen (27) + HashAggregate [ss_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(sr_return_quantity, 0)),sum(coalesce(ss_quantity, 0)),sum(coalesce(cast(sr_return_amt as decimal(12,2)), 0.00)),sum(coalesce(cast(ss_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [ss_item_sk] #12 + WholeStageCodegen (26) + HashAggregate [ss_item_sk,sr_return_quantity,ss_quantity,sr_return_amt,ss_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty] + Project [ss_item_sk,ss_quantity,ss_net_paid,sr_return_quantity,sr_return_amt] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (23) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #13 + WholeStageCodegen (22) + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid,ss_sold_date_sk] + Filter [ss_net_profit,ss_net_paid,ss_quantity,ss_ticket_number,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid,ss_net_profit,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + WholeStageCodegen (25) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #14 + WholeStageCodegen (24) + Project [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt] + Filter [sr_return_amt,sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt,sr_returned_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt new file mode 100644 index 0000000000000..f5411b5681aad --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/explain.txt @@ -0,0 +1,465 @@ +== Physical Plan == +TakeOrderedAndProject (81) ++- * HashAggregate (80) + +- Exchange (79) + +- * HashAggregate (78) + +- Union (77) + :- * Project (28) + : +- * Filter (27) + : +- Window (26) + : +- * Sort (25) + : +- Window (24) + : +- * Sort (23) + : +- Exchange (22) + : +- * HashAggregate (21) + : +- Exchange (20) + : +- * HashAggregate (19) + : +- * Project (18) + : +- * BroadcastHashJoin Inner BuildRight (17) + : :- * Project (11) + : : +- * BroadcastHashJoin Inner BuildLeft (10) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.web_sales (1) + : : +- * Project (9) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.web_returns (6) + : +- BroadcastExchange (16) + : +- * Project (15) + : +- * Filter (14) + : +- * ColumnarToRow (13) + : +- Scan parquet default.date_dim (12) + :- * Project (52) + : +- * Filter (51) + : +- Window (50) + : +- * Sort (49) + : +- Window (48) + : +- * Sort (47) + : +- Exchange (46) + : +- * HashAggregate (45) + : +- Exchange (44) + : +- * HashAggregate (43) + : +- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Project (39) + : : +- * BroadcastHashJoin Inner BuildLeft (38) + : : :- BroadcastExchange (33) + : : : +- * Project (32) + : : : +- * Filter (31) + : : : +- * ColumnarToRow (30) + : : : +- Scan parquet default.catalog_sales (29) + : : +- * Project (37) + : : +- * Filter (36) + : : +- * ColumnarToRow (35) + : : +- Scan parquet default.catalog_returns (34) + : +- ReusedExchange (40) + +- * Project (76) + +- * Filter (75) + +- Window (74) + +- * Sort (73) + +- Window (72) + +- * Sort (71) + +- Exchange (70) + +- * HashAggregate (69) + +- Exchange (68) + +- * HashAggregate (67) + +- * Project (66) + +- * BroadcastHashJoin Inner BuildRight (65) + :- * Project (63) + : +- * BroadcastHashJoin Inner BuildLeft (62) + : :- BroadcastExchange (57) + : : +- * Project (56) + : : +- * Filter (55) + : : +- * ColumnarToRow (54) + : : +- Scan parquet default.store_sales (53) + : +- * Project (61) + : +- * Filter (60) + : +- * ColumnarToRow (59) + : +- Scan parquet default.store_returns (58) + +- ReusedExchange (64) + + +(1) Scan parquet default.web_sales +Output [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#6), dynamicpruningexpression(ws_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ws_net_profit), IsNotNull(ws_net_paid), IsNotNull(ws_quantity), GreaterThan(ws_net_profit,1.00), GreaterThan(ws_net_paid,0.00), GreaterThan(ws_quantity,0), IsNotNull(ws_order_number), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] + +(3) Filter [codegen id : 1] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] +Condition : (((((((isnotnull(ws_net_profit#5) AND isnotnull(ws_net_paid#4)) AND isnotnull(ws_quantity#3)) AND (ws_net_profit#5 > 1.00)) AND (ws_net_paid#4 > 0.00)) AND (ws_quantity#3 > 0)) AND isnotnull(ws_order_number#2)) AND isnotnull(ws_item_sk#1)) + +(4) Project [codegen id : 1] +Output [5]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] + +(5) BroadcastExchange +Input [5]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [id=#8] + +(6) Scan parquet default.web_returns +Output [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_return_amt), GreaterThan(wr_return_amt,10000.00), IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] + +(8) Filter +Input [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] +Condition : (((isnotnull(wr_return_amt#12) AND (wr_return_amt#12 > 10000.00)) AND isnotnull(wr_order_number#10)) AND isnotnull(wr_item_sk#9)) + +(9) Project +Output [4]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12] +Input [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] + +(10) BroadcastHashJoin [codegen id : 3] +Left keys [2]: [ws_order_number#2, ws_item_sk#1] +Right keys [2]: [wr_order_number#10, wr_item_sk#9] +Join condition: None + +(11) Project [codegen id : 3] +Output [6]: [ws_item_sk#1, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6, wr_return_quantity#11, wr_return_amt#12] +Input [9]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6, wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12] + +(12) Scan parquet default.date_dim +Output [3]: [d_date_sk#14, d_year#15, d_moy#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,12), IsNotNull(d_date_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#14, d_year#15, d_moy#16] + +(14) Filter [codegen id : 2] +Input [3]: [d_date_sk#14, d_year#15, d_moy#16] +Condition : ((((isnotnull(d_year#15) AND isnotnull(d_moy#16)) AND (d_year#15 = 2001)) AND (d_moy#16 = 12)) AND isnotnull(d_date_sk#14)) + +(15) Project [codegen id : 2] +Output [1]: [d_date_sk#14] +Input [3]: [d_date_sk#14, d_year#15, d_moy#16] + +(16) BroadcastExchange +Input [1]: [d_date_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(17) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#6] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(18) Project [codegen id : 3] +Output [5]: [ws_item_sk#1, ws_quantity#3, ws_net_paid#4, wr_return_quantity#11, wr_return_amt#12] +Input [7]: [ws_item_sk#1, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6, wr_return_quantity#11, wr_return_amt#12, d_date_sk#14] + +(19) HashAggregate [codegen id : 3] +Input [5]: [ws_item_sk#1, ws_quantity#3, ws_net_paid#4, wr_return_quantity#11, wr_return_amt#12] +Keys [1]: [ws_item_sk#1] +Functions [4]: [partial_sum(coalesce(wr_return_quantity#11, 0)), partial_sum(coalesce(ws_quantity#3, 0)), partial_sum(coalesce(cast(wr_return_amt#12 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))] +Aggregate Attributes [6]: [sum#18, sum#19, sum#20, isEmpty#21, sum#22, isEmpty#23] +Results [7]: [ws_item_sk#1, sum#24, sum#25, sum#26, isEmpty#27, sum#28, isEmpty#29] + +(20) Exchange +Input [7]: [ws_item_sk#1, sum#24, sum#25, sum#26, isEmpty#27, sum#28, isEmpty#29] +Arguments: hashpartitioning(ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#30] + +(21) HashAggregate [codegen id : 4] +Input [7]: [ws_item_sk#1, sum#24, sum#25, sum#26, isEmpty#27, sum#28, isEmpty#29] +Keys [1]: [ws_item_sk#1] +Functions [4]: [sum(coalesce(wr_return_quantity#11, 0)), sum(coalesce(ws_quantity#3, 0)), sum(coalesce(cast(wr_return_amt#12 as decimal(12,2)), 0.00)), sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(coalesce(wr_return_quantity#11, 0))#31, sum(coalesce(ws_quantity#3, 0))#32, sum(coalesce(cast(wr_return_amt#12 as decimal(12,2)), 0.00))#33, sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))#34] +Results [3]: [ws_item_sk#1 AS item#35, CheckOverflow((promote_precision(cast(sum(coalesce(wr_return_quantity#11, 0))#31 as decimal(15,4))) / promote_precision(cast(sum(coalesce(ws_quantity#3, 0))#32 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#36, CheckOverflow((promote_precision(cast(sum(coalesce(cast(wr_return_amt#12 as decimal(12,2)), 0.00))#33 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))#34 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#37] + +(22) Exchange +Input [3]: [item#35, return_ratio#36, currency_ratio#37] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#38] + +(23) Sort [codegen id : 5] +Input [3]: [item#35, return_ratio#36, currency_ratio#37] +Arguments: [return_ratio#36 ASC NULLS FIRST], false, 0 + +(24) Window +Input [3]: [item#35, return_ratio#36, currency_ratio#37] +Arguments: [rank(return_ratio#36) windowspecdefinition(return_ratio#36 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS return_rank#39], [return_ratio#36 ASC NULLS FIRST] + +(25) Sort [codegen id : 6] +Input [4]: [item#35, return_ratio#36, currency_ratio#37, return_rank#39] +Arguments: [currency_ratio#37 ASC NULLS FIRST], false, 0 + +(26) Window +Input [4]: [item#35, return_ratio#36, currency_ratio#37, return_rank#39] +Arguments: [rank(currency_ratio#37) windowspecdefinition(currency_ratio#37 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS currency_rank#40], [currency_ratio#37 ASC NULLS FIRST] + +(27) Filter [codegen id : 7] +Input [5]: [item#35, return_ratio#36, currency_ratio#37, return_rank#39, currency_rank#40] +Condition : ((return_rank#39 <= 10) OR (currency_rank#40 <= 10)) + +(28) Project [codegen id : 7] +Output [5]: [web AS channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Input [5]: [item#35, return_ratio#36, currency_ratio#37, return_rank#39, currency_rank#40] + +(29) Scan parquet default.catalog_sales +Output [6]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46, cs_sold_date_sk#47] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#47), dynamicpruningexpression(cs_sold_date_sk#47 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(cs_net_profit), IsNotNull(cs_net_paid), IsNotNull(cs_quantity), GreaterThan(cs_net_profit,1.00), GreaterThan(cs_net_paid,0.00), GreaterThan(cs_quantity,0), IsNotNull(cs_order_number), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 8] +Input [6]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46, cs_sold_date_sk#47] + +(31) Filter [codegen id : 8] +Input [6]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46, cs_sold_date_sk#47] +Condition : (((((((isnotnull(cs_net_profit#46) AND isnotnull(cs_net_paid#45)) AND isnotnull(cs_quantity#44)) AND (cs_net_profit#46 > 1.00)) AND (cs_net_paid#45 > 0.00)) AND (cs_quantity#44 > 0)) AND isnotnull(cs_order_number#43)) AND isnotnull(cs_item_sk#42)) + +(32) Project [codegen id : 8] +Output [5]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_sold_date_sk#47] +Input [6]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46, cs_sold_date_sk#47] + +(33) BroadcastExchange +Input [5]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_sold_date_sk#47] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [id=#48] + +(34) Scan parquet default.catalog_returns +Output [5]: [cr_item_sk#49, cr_order_number#50, cr_return_quantity#51, cr_return_amount#52, cr_returned_date_sk#53] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_return_amount), GreaterThan(cr_return_amount,10000.00), IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(35) ColumnarToRow +Input [5]: [cr_item_sk#49, cr_order_number#50, cr_return_quantity#51, cr_return_amount#52, cr_returned_date_sk#53] + +(36) Filter +Input [5]: [cr_item_sk#49, cr_order_number#50, cr_return_quantity#51, cr_return_amount#52, cr_returned_date_sk#53] +Condition : (((isnotnull(cr_return_amount#52) AND (cr_return_amount#52 > 10000.00)) AND isnotnull(cr_order_number#50)) AND isnotnull(cr_item_sk#49)) + +(37) Project +Output [4]: [cr_item_sk#49, cr_order_number#50, cr_return_quantity#51, cr_return_amount#52] +Input [5]: [cr_item_sk#49, cr_order_number#50, cr_return_quantity#51, cr_return_amount#52, cr_returned_date_sk#53] + +(38) BroadcastHashJoin [codegen id : 10] +Left keys [2]: [cs_order_number#43, cs_item_sk#42] +Right keys [2]: [cr_order_number#50, cr_item_sk#49] +Join condition: None + +(39) Project [codegen id : 10] +Output [6]: [cs_item_sk#42, cs_quantity#44, cs_net_paid#45, cs_sold_date_sk#47, cr_return_quantity#51, cr_return_amount#52] +Input [9]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_sold_date_sk#47, cr_item_sk#49, cr_order_number#50, cr_return_quantity#51, cr_return_amount#52] + +(40) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#54] + +(41) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#47] +Right keys [1]: [d_date_sk#54] +Join condition: None + +(42) Project [codegen id : 10] +Output [5]: [cs_item_sk#42, cs_quantity#44, cs_net_paid#45, cr_return_quantity#51, cr_return_amount#52] +Input [7]: [cs_item_sk#42, cs_quantity#44, cs_net_paid#45, cs_sold_date_sk#47, cr_return_quantity#51, cr_return_amount#52, d_date_sk#54] + +(43) HashAggregate [codegen id : 10] +Input [5]: [cs_item_sk#42, cs_quantity#44, cs_net_paid#45, cr_return_quantity#51, cr_return_amount#52] +Keys [1]: [cs_item_sk#42] +Functions [4]: [partial_sum(coalesce(cr_return_quantity#51, 0)), partial_sum(coalesce(cs_quantity#44, 0)), partial_sum(coalesce(cast(cr_return_amount#52 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(cs_net_paid#45 as decimal(12,2)), 0.00))] +Aggregate Attributes [6]: [sum#55, sum#56, sum#57, isEmpty#58, sum#59, isEmpty#60] +Results [7]: [cs_item_sk#42, sum#61, sum#62, sum#63, isEmpty#64, sum#65, isEmpty#66] + +(44) Exchange +Input [7]: [cs_item_sk#42, sum#61, sum#62, sum#63, isEmpty#64, sum#65, isEmpty#66] +Arguments: hashpartitioning(cs_item_sk#42, 5), ENSURE_REQUIREMENTS, [id=#67] + +(45) HashAggregate [codegen id : 11] +Input [7]: [cs_item_sk#42, sum#61, sum#62, sum#63, isEmpty#64, sum#65, isEmpty#66] +Keys [1]: [cs_item_sk#42] +Functions [4]: [sum(coalesce(cr_return_quantity#51, 0)), sum(coalesce(cs_quantity#44, 0)), sum(coalesce(cast(cr_return_amount#52 as decimal(12,2)), 0.00)), sum(coalesce(cast(cs_net_paid#45 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(coalesce(cr_return_quantity#51, 0))#68, sum(coalesce(cs_quantity#44, 0))#69, sum(coalesce(cast(cr_return_amount#52 as decimal(12,2)), 0.00))#70, sum(coalesce(cast(cs_net_paid#45 as decimal(12,2)), 0.00))#71] +Results [3]: [cs_item_sk#42 AS item#72, CheckOverflow((promote_precision(cast(sum(coalesce(cr_return_quantity#51, 0))#68 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cs_quantity#44, 0))#69 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#73, CheckOverflow((promote_precision(cast(sum(coalesce(cast(cr_return_amount#52 as decimal(12,2)), 0.00))#70 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(cs_net_paid#45 as decimal(12,2)), 0.00))#71 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#74] + +(46) Exchange +Input [3]: [item#72, return_ratio#73, currency_ratio#74] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#75] + +(47) Sort [codegen id : 12] +Input [3]: [item#72, return_ratio#73, currency_ratio#74] +Arguments: [return_ratio#73 ASC NULLS FIRST], false, 0 + +(48) Window +Input [3]: [item#72, return_ratio#73, currency_ratio#74] +Arguments: [rank(return_ratio#73) windowspecdefinition(return_ratio#73 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS return_rank#76], [return_ratio#73 ASC NULLS FIRST] + +(49) Sort [codegen id : 13] +Input [4]: [item#72, return_ratio#73, currency_ratio#74, return_rank#76] +Arguments: [currency_ratio#74 ASC NULLS FIRST], false, 0 + +(50) Window +Input [4]: [item#72, return_ratio#73, currency_ratio#74, return_rank#76] +Arguments: [rank(currency_ratio#74) windowspecdefinition(currency_ratio#74 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS currency_rank#77], [currency_ratio#74 ASC NULLS FIRST] + +(51) Filter [codegen id : 14] +Input [5]: [item#72, return_ratio#73, currency_ratio#74, return_rank#76, currency_rank#77] +Condition : ((return_rank#76 <= 10) OR (currency_rank#77 <= 10)) + +(52) Project [codegen id : 14] +Output [5]: [catalog AS channel#78, item#72, return_ratio#73, return_rank#76, currency_rank#77] +Input [5]: [item#72, return_ratio#73, currency_ratio#74, return_rank#76, currency_rank#77] + +(53) Scan parquet default.store_sales +Output [6]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_net_profit#83, ss_sold_date_sk#84] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#84), dynamicpruningexpression(ss_sold_date_sk#84 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_net_profit), IsNotNull(ss_net_paid), IsNotNull(ss_quantity), GreaterThan(ss_net_profit,1.00), GreaterThan(ss_net_paid,0.00), GreaterThan(ss_quantity,0), IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(54) ColumnarToRow [codegen id : 15] +Input [6]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_net_profit#83, ss_sold_date_sk#84] + +(55) Filter [codegen id : 15] +Input [6]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_net_profit#83, ss_sold_date_sk#84] +Condition : (((((((isnotnull(ss_net_profit#83) AND isnotnull(ss_net_paid#82)) AND isnotnull(ss_quantity#81)) AND (ss_net_profit#83 > 1.00)) AND (ss_net_paid#82 > 0.00)) AND (ss_quantity#81 > 0)) AND isnotnull(ss_ticket_number#80)) AND isnotnull(ss_item_sk#79)) + +(56) Project [codegen id : 15] +Output [5]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#84] +Input [6]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_net_profit#83, ss_sold_date_sk#84] + +(57) BroadcastExchange +Input [5]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#84] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [id=#85] + +(58) Scan parquet default.store_returns +Output [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_return_amt), GreaterThan(sr_return_amt,10000.00), IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(59) ColumnarToRow +Input [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] + +(60) Filter +Input [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] +Condition : (((isnotnull(sr_return_amt#89) AND (sr_return_amt#89 > 10000.00)) AND isnotnull(sr_ticket_number#87)) AND isnotnull(sr_item_sk#86)) + +(61) Project +Output [4]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89] +Input [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] + +(62) BroadcastHashJoin [codegen id : 17] +Left keys [2]: [ss_ticket_number#80, ss_item_sk#79] +Right keys [2]: [sr_ticket_number#87, sr_item_sk#86] +Join condition: None + +(63) Project [codegen id : 17] +Output [6]: [ss_item_sk#79, ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#84, sr_return_quantity#88, sr_return_amt#89] +Input [9]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#84, sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89] + +(64) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#91] + +(65) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_sold_date_sk#84] +Right keys [1]: [d_date_sk#91] +Join condition: None + +(66) Project [codegen id : 17] +Output [5]: [ss_item_sk#79, ss_quantity#81, ss_net_paid#82, sr_return_quantity#88, sr_return_amt#89] +Input [7]: [ss_item_sk#79, ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#84, sr_return_quantity#88, sr_return_amt#89, d_date_sk#91] + +(67) HashAggregate [codegen id : 17] +Input [5]: [ss_item_sk#79, ss_quantity#81, ss_net_paid#82, sr_return_quantity#88, sr_return_amt#89] +Keys [1]: [ss_item_sk#79] +Functions [4]: [partial_sum(coalesce(sr_return_quantity#88, 0)), partial_sum(coalesce(ss_quantity#81, 0)), partial_sum(coalesce(cast(sr_return_amt#89 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(ss_net_paid#82 as decimal(12,2)), 0.00))] +Aggregate Attributes [6]: [sum#92, sum#93, sum#94, isEmpty#95, sum#96, isEmpty#97] +Results [7]: [ss_item_sk#79, sum#98, sum#99, sum#100, isEmpty#101, sum#102, isEmpty#103] + +(68) Exchange +Input [7]: [ss_item_sk#79, sum#98, sum#99, sum#100, isEmpty#101, sum#102, isEmpty#103] +Arguments: hashpartitioning(ss_item_sk#79, 5), ENSURE_REQUIREMENTS, [id=#104] + +(69) HashAggregate [codegen id : 18] +Input [7]: [ss_item_sk#79, sum#98, sum#99, sum#100, isEmpty#101, sum#102, isEmpty#103] +Keys [1]: [ss_item_sk#79] +Functions [4]: [sum(coalesce(sr_return_quantity#88, 0)), sum(coalesce(ss_quantity#81, 0)), sum(coalesce(cast(sr_return_amt#89 as decimal(12,2)), 0.00)), sum(coalesce(cast(ss_net_paid#82 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(coalesce(sr_return_quantity#88, 0))#105, sum(coalesce(ss_quantity#81, 0))#106, sum(coalesce(cast(sr_return_amt#89 as decimal(12,2)), 0.00))#107, sum(coalesce(cast(ss_net_paid#82 as decimal(12,2)), 0.00))#108] +Results [3]: [ss_item_sk#79 AS item#109, CheckOverflow((promote_precision(cast(sum(coalesce(sr_return_quantity#88, 0))#105 as decimal(15,4))) / promote_precision(cast(sum(coalesce(ss_quantity#81, 0))#106 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#110, CheckOverflow((promote_precision(cast(sum(coalesce(cast(sr_return_amt#89 as decimal(12,2)), 0.00))#107 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(ss_net_paid#82 as decimal(12,2)), 0.00))#108 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#111] + +(70) Exchange +Input [3]: [item#109, return_ratio#110, currency_ratio#111] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#112] + +(71) Sort [codegen id : 19] +Input [3]: [item#109, return_ratio#110, currency_ratio#111] +Arguments: [return_ratio#110 ASC NULLS FIRST], false, 0 + +(72) Window +Input [3]: [item#109, return_ratio#110, currency_ratio#111] +Arguments: [rank(return_ratio#110) windowspecdefinition(return_ratio#110 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS return_rank#113], [return_ratio#110 ASC NULLS FIRST] + +(73) Sort [codegen id : 20] +Input [4]: [item#109, return_ratio#110, currency_ratio#111, return_rank#113] +Arguments: [currency_ratio#111 ASC NULLS FIRST], false, 0 + +(74) Window +Input [4]: [item#109, return_ratio#110, currency_ratio#111, return_rank#113] +Arguments: [rank(currency_ratio#111) windowspecdefinition(currency_ratio#111 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS currency_rank#114], [currency_ratio#111 ASC NULLS FIRST] + +(75) Filter [codegen id : 21] +Input [5]: [item#109, return_ratio#110, currency_ratio#111, return_rank#113, currency_rank#114] +Condition : ((return_rank#113 <= 10) OR (currency_rank#114 <= 10)) + +(76) Project [codegen id : 21] +Output [5]: [store AS channel#115, item#109, return_ratio#110, return_rank#113, currency_rank#114] +Input [5]: [item#109, return_ratio#110, currency_ratio#111, return_rank#113, currency_rank#114] + +(77) Union + +(78) HashAggregate [codegen id : 22] +Input [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Keys [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] + +(79) Exchange +Input [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Arguments: hashpartitioning(channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40, 5), ENSURE_REQUIREMENTS, [id=#116] + +(80) HashAggregate [codegen id : 23] +Input [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Keys [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] + +(81) TakeOrderedAndProject +Input [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Arguments: 100, [channel#41 ASC NULLS FIRST, return_rank#39 ASC NULLS FIRST, currency_rank#40 ASC NULLS FIRST], [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (82) + + +(82) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#14] + +Subquery:2 Hosting operator id = 29 Hosting Expression = cs_sold_date_sk#47 IN dynamicpruning#7 + +Subquery:3 Hosting operator id = 53 Hosting Expression = ss_sold_date_sk#84 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/simplified.txt new file mode 100644 index 0000000000000..0b548432d6fed --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q49/simplified.txt @@ -0,0 +1,133 @@ +TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] + WholeStageCodegen (23) + HashAggregate [channel,item,return_ratio,return_rank,currency_rank] + InputAdapter + Exchange [channel,item,return_ratio,return_rank,currency_rank] #1 + WholeStageCodegen (22) + HashAggregate [channel,item,return_ratio,return_rank,currency_rank] + InputAdapter + Union + WholeStageCodegen (7) + Project [item,return_ratio,return_rank,currency_rank] + Filter [return_rank,currency_rank] + InputAdapter + Window [currency_ratio] + WholeStageCodegen (6) + Sort [currency_ratio] + InputAdapter + Window [return_ratio] + WholeStageCodegen (5) + Sort [return_ratio] + InputAdapter + Exchange #2 + WholeStageCodegen (4) + HashAggregate [ws_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(wr_return_quantity, 0)),sum(coalesce(ws_quantity, 0)),sum(coalesce(cast(wr_return_amt as decimal(12,2)), 0.00)),sum(coalesce(cast(ws_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (3) + HashAggregate [ws_item_sk,wr_return_quantity,ws_quantity,wr_return_amt,ws_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty] + Project [ws_item_sk,ws_quantity,ws_net_paid,wr_return_quantity,wr_return_amt] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_quantity,ws_net_paid,ws_sold_date_sk,wr_return_quantity,wr_return_amt] + BroadcastHashJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_sold_date_sk] + Filter [ws_net_profit,ws_net_paid,ws_quantity,ws_order_number,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_net_profit,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + Project [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt] + Filter [wr_return_amt,wr_order_number,wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt,wr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (14) + Project [item,return_ratio,return_rank,currency_rank] + Filter [return_rank,currency_rank] + InputAdapter + Window [currency_ratio] + WholeStageCodegen (13) + Sort [currency_ratio] + InputAdapter + Window [return_ratio] + WholeStageCodegen (12) + Sort [return_ratio] + InputAdapter + Exchange #6 + WholeStageCodegen (11) + HashAggregate [cs_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(cr_return_quantity, 0)),sum(coalesce(cs_quantity, 0)),sum(coalesce(cast(cr_return_amount as decimal(12,2)), 0.00)),sum(coalesce(cast(cs_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [cs_item_sk] #7 + WholeStageCodegen (10) + HashAggregate [cs_item_sk,cr_return_quantity,cs_quantity,cr_return_amount,cs_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty] + Project [cs_item_sk,cs_quantity,cs_net_paid,cr_return_quantity,cr_return_amount] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_quantity,cs_net_paid,cs_sold_date_sk,cr_return_quantity,cr_return_amount] + BroadcastHashJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (8) + Project [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid,cs_sold_date_sk] + Filter [cs_net_profit,cs_net_paid,cs_quantity,cs_order_number,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + Project [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount] + Filter [cr_return_amount,cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount,cr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #5 + WholeStageCodegen (21) + Project [item,return_ratio,return_rank,currency_rank] + Filter [return_rank,currency_rank] + InputAdapter + Window [currency_ratio] + WholeStageCodegen (20) + Sort [currency_ratio] + InputAdapter + Window [return_ratio] + WholeStageCodegen (19) + Sort [return_ratio] + InputAdapter + Exchange #9 + WholeStageCodegen (18) + HashAggregate [ss_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(sr_return_quantity, 0)),sum(coalesce(ss_quantity, 0)),sum(coalesce(cast(sr_return_amt as decimal(12,2)), 0.00)),sum(coalesce(cast(ss_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [ss_item_sk] #10 + WholeStageCodegen (17) + HashAggregate [ss_item_sk,sr_return_quantity,ss_quantity,sr_return_amt,ss_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty] + Project [ss_item_sk,ss_quantity,ss_net_paid,sr_return_quantity,sr_return_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_quantity,ss_net_paid,ss_sold_date_sk,sr_return_quantity,sr_return_amt] + BroadcastHashJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (15) + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid,ss_sold_date_sk] + Filter [ss_net_profit,ss_net_paid,ss_quantity,ss_ticket_number,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid,ss_net_profit,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + Project [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt] + Filter [sr_return_amt,sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt,sr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt new file mode 100644 index 0000000000000..ec4a566d0e4c4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/explain.txt @@ -0,0 +1,476 @@ +== Physical Plan == +TakeOrderedAndProject (81) ++- * HashAggregate (80) + +- Exchange (79) + +- * HashAggregate (78) + +- * Expand (77) + +- Union (76) + :- * HashAggregate (25) + : +- Exchange (24) + : +- * HashAggregate (23) + : +- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- Union (9) + : : : :- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Project (8) + : : : +- * Filter (7) + : : : +- * ColumnarToRow (6) + : : : +- Scan parquet default.store_returns (5) + : : +- BroadcastExchange (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.store (10) + : +- BroadcastExchange (20) + : +- * Project (19) + : +- * Filter (18) + : +- * ColumnarToRow (17) + : +- Scan parquet default.date_dim (16) + :- * HashAggregate (46) + : +- Exchange (45) + : +- * HashAggregate (44) + : +- * Project (43) + : +- * BroadcastHashJoin Inner BuildRight (42) + : :- * Project (40) + : : +- * BroadcastHashJoin Inner BuildRight (39) + : : :- Union (34) + : : : :- * Project (29) + : : : : +- * Filter (28) + : : : : +- * ColumnarToRow (27) + : : : : +- Scan parquet default.catalog_sales (26) + : : : +- * Project (33) + : : : +- * Filter (32) + : : : +- * ColumnarToRow (31) + : : : +- Scan parquet default.catalog_returns (30) + : : +- BroadcastExchange (38) + : : +- * Filter (37) + : : +- * ColumnarToRow (36) + : : +- Scan parquet default.catalog_page (35) + : +- ReusedExchange (41) + +- * HashAggregate (75) + +- Exchange (74) + +- * HashAggregate (73) + +- * Project (72) + +- * BroadcastHashJoin Inner BuildRight (71) + :- * Project (69) + : +- * BroadcastHashJoin Inner BuildRight (68) + : :- Union (63) + : : :- * Project (50) + : : : +- * Filter (49) + : : : +- * ColumnarToRow (48) + : : : +- Scan parquet default.web_sales (47) + : : +- * Project (62) + : : +- * SortMergeJoin Inner (61) + : : :- * Sort (54) + : : : +- Exchange (53) + : : : +- * ColumnarToRow (52) + : : : +- Scan parquet default.web_returns (51) + : : +- * Sort (60) + : : +- Exchange (59) + : : +- * Project (58) + : : +- * Filter (57) + : : +- * ColumnarToRow (56) + : : +- Scan parquet default.web_sales (55) + : +- BroadcastExchange (67) + : +- * Filter (66) + : +- * ColumnarToRow (65) + : +- Scan parquet default.web_site (64) + +- ReusedExchange (70) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 1] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_store_sk#1) + +(4) Project [codegen id : 1] +Output [6]: [ss_store_sk#1 AS store_sk#6, ss_sold_date_sk#4 AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] + +(5) Scan parquet default.store_returns +Output [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#15), dynamicpruningexpression(sr_returned_date_sk#15 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 2] +Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] + +(7) Filter [codegen id : 2] +Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] +Condition : isnotnull(sr_store_sk#12) + +(8) Project [codegen id : 2] +Output [6]: [sr_store_sk#12 AS store_sk#16, sr_returned_date_sk#15 AS date_sk#17, 0.00 AS sales_price#18, 0.00 AS profit#19, sr_return_amt#13 AS return_amt#20, sr_net_loss#14 AS net_loss#21] +Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] + +(9) Union + +(10) Scan parquet default.store +Output [2]: [s_store_sk#22, s_store_id#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#22, s_store_id#23] + +(12) Filter [codegen id : 3] +Input [2]: [s_store_sk#22, s_store_id#23] +Condition : isnotnull(s_store_sk#22) + +(13) BroadcastExchange +Input [2]: [s_store_sk#22, s_store_id#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(14) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [store_sk#6] +Right keys [1]: [s_store_sk#22] +Join condition: None + +(15) Project [codegen id : 5] +Output [6]: [date_sk#7, sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#23] +Input [8]: [store_sk#6, date_sk#7, sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_sk#22, s_store_id#23] + +(16) Scan parquet default.date_dim +Output [2]: [d_date_sk#25, d_date#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-08-23), LessThanOrEqual(d_date,2000-09-06), IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#25, d_date#26] + +(18) Filter [codegen id : 4] +Input [2]: [d_date_sk#25, d_date#26] +Condition : (((isnotnull(d_date#26) AND (d_date#26 >= 2000-08-23)) AND (d_date#26 <= 2000-09-06)) AND isnotnull(d_date_sk#25)) + +(19) Project [codegen id : 4] +Output [1]: [d_date_sk#25] +Input [2]: [d_date_sk#25, d_date#26] + +(20) BroadcastExchange +Input [1]: [d_date_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] + +(21) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [date_sk#7] +Right keys [1]: [d_date_sk#25] +Join condition: None + +(22) Project [codegen id : 5] +Output [5]: [sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#23] +Input [7]: [date_sk#7, sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#23, d_date_sk#25] + +(23) HashAggregate [codegen id : 5] +Input [5]: [sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#23] +Keys [1]: [s_store_id#23] +Functions [4]: [partial_sum(UnscaledValue(sales_price#8)), partial_sum(UnscaledValue(return_amt#10)), partial_sum(UnscaledValue(profit#9)), partial_sum(UnscaledValue(net_loss#11))] +Aggregate Attributes [4]: [sum#28, sum#29, sum#30, sum#31] +Results [5]: [s_store_id#23, sum#32, sum#33, sum#34, sum#35] + +(24) Exchange +Input [5]: [s_store_id#23, sum#32, sum#33, sum#34, sum#35] +Arguments: hashpartitioning(s_store_id#23, 5), ENSURE_REQUIREMENTS, [id=#36] + +(25) HashAggregate [codegen id : 6] +Input [5]: [s_store_id#23, sum#32, sum#33, sum#34, sum#35] +Keys [1]: [s_store_id#23] +Functions [4]: [sum(UnscaledValue(sales_price#8)), sum(UnscaledValue(return_amt#10)), sum(UnscaledValue(profit#9)), sum(UnscaledValue(net_loss#11))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#8))#37, sum(UnscaledValue(return_amt#10))#38, sum(UnscaledValue(profit#9))#39, sum(UnscaledValue(net_loss#11))#40] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#8))#37,17,2) AS sales#41, MakeDecimal(sum(UnscaledValue(return_amt#10))#38,17,2) AS RETURNS#42, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#9))#39,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#11))#40,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#43, store channel AS channel#44, concat(store, s_store_id#23) AS id#45] + +(26) Scan parquet default.catalog_sales +Output [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#49), dynamicpruningexpression(cs_sold_date_sk#49 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_catalog_page_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 7] +Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] + +(28) Filter [codegen id : 7] +Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] +Condition : isnotnull(cs_catalog_page_sk#46) + +(29) Project [codegen id : 7] +Output [6]: [cs_catalog_page_sk#46 AS page_sk#50, cs_sold_date_sk#49 AS date_sk#51, cs_ext_sales_price#47 AS sales_price#52, cs_net_profit#48 AS profit#53, 0.00 AS return_amt#54, 0.00 AS net_loss#55] +Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] + +(30) Scan parquet default.catalog_returns +Output [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#59), dynamicpruningexpression(cr_returned_date_sk#59 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cr_catalog_page_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 8] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(32) Filter [codegen id : 8] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Condition : isnotnull(cr_catalog_page_sk#56) + +(33) Project [codegen id : 8] +Output [6]: [cr_catalog_page_sk#56 AS page_sk#60, cr_returned_date_sk#59 AS date_sk#61, 0.00 AS sales_price#62, 0.00 AS profit#63, cr_return_amount#57 AS return_amt#64, cr_net_loss#58 AS net_loss#65] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(34) Union + +(35) Scan parquet default.catalog_page +Output [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_page] +PushedFilters: [IsNotNull(cp_catalog_page_sk)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 9] +Input [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] + +(37) Filter [codegen id : 9] +Input [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] +Condition : isnotnull(cp_catalog_page_sk#66) + +(38) BroadcastExchange +Input [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#68] + +(39) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [page_sk#50] +Right keys [1]: [cp_catalog_page_sk#66] +Join condition: None + +(40) Project [codegen id : 11] +Output [6]: [date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67] +Input [8]: [page_sk#50, date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_sk#66, cp_catalog_page_id#67] + +(41) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#69] + +(42) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [date_sk#51] +Right keys [1]: [d_date_sk#69] +Join condition: None + +(43) Project [codegen id : 11] +Output [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67] +Input [7]: [date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67, d_date_sk#69] + +(44) HashAggregate [codegen id : 11] +Input [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67] +Keys [1]: [cp_catalog_page_id#67] +Functions [4]: [partial_sum(UnscaledValue(sales_price#52)), partial_sum(UnscaledValue(return_amt#54)), partial_sum(UnscaledValue(profit#53)), partial_sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum#70, sum#71, sum#72, sum#73] +Results [5]: [cp_catalog_page_id#67, sum#74, sum#75, sum#76, sum#77] + +(45) Exchange +Input [5]: [cp_catalog_page_id#67, sum#74, sum#75, sum#76, sum#77] +Arguments: hashpartitioning(cp_catalog_page_id#67, 5), ENSURE_REQUIREMENTS, [id=#78] + +(46) HashAggregate [codegen id : 12] +Input [5]: [cp_catalog_page_id#67, sum#74, sum#75, sum#76, sum#77] +Keys [1]: [cp_catalog_page_id#67] +Functions [4]: [sum(UnscaledValue(sales_price#52)), sum(UnscaledValue(return_amt#54)), sum(UnscaledValue(profit#53)), sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#52))#79, sum(UnscaledValue(return_amt#54))#80, sum(UnscaledValue(profit#53))#81, sum(UnscaledValue(net_loss#55))#82] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#52))#79,17,2) AS sales#83, MakeDecimal(sum(UnscaledValue(return_amt#54))#80,17,2) AS RETURNS#84, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#53))#81,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#55))#82,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#85, catalog channel AS channel#86, concat(catalog_page, cp_catalog_page_id#67) AS id#87] + +(47) Scan parquet default.web_sales +Output [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#91), dynamicpruningexpression(ws_sold_date_sk#91 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 13] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] + +(49) Filter [codegen id : 13] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] +Condition : isnotnull(ws_web_site_sk#88) + +(50) Project [codegen id : 13] +Output [6]: [ws_web_site_sk#88 AS wsr_web_site_sk#92, ws_sold_date_sk#91 AS date_sk#93, ws_ext_sales_price#89 AS sales_price#94, ws_net_profit#90 AS profit#95, 0.00 AS return_amt#96, 0.00 AS net_loss#97] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] + +(51) Scan parquet default.web_returns +Output [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#102), dynamicpruningexpression(wr_returned_date_sk#102 IN dynamicpruning#5)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 14] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] + +(53) Exchange +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Arguments: hashpartitioning(wr_item_sk#98, wr_order_number#99, 5), ENSURE_REQUIREMENTS, [id=#103] + +(54) Sort [codegen id : 15] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Arguments: [wr_item_sk#98 ASC NULLS FIRST, wr_order_number#99 ASC NULLS FIRST], false, 0 + +(55) Scan parquet default.web_sales +Output [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(56) ColumnarToRow [codegen id : 16] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] + +(57) Filter [codegen id : 16] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] +Condition : ((isnotnull(ws_item_sk#104) AND isnotnull(ws_order_number#106)) AND isnotnull(ws_web_site_sk#105)) + +(58) Project [codegen id : 16] +Output [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] + +(59) Exchange +Input [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Arguments: hashpartitioning(ws_item_sk#104, ws_order_number#106, 5), ENSURE_REQUIREMENTS, [id=#108] + +(60) Sort [codegen id : 17] +Input [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Arguments: [ws_item_sk#104 ASC NULLS FIRST, ws_order_number#106 ASC NULLS FIRST], false, 0 + +(61) SortMergeJoin [codegen id : 18] +Left keys [2]: [wr_item_sk#98, wr_order_number#99] +Right keys [2]: [ws_item_sk#104, ws_order_number#106] +Join condition: None + +(62) Project [codegen id : 18] +Output [6]: [ws_web_site_sk#105 AS wsr_web_site_sk#109, wr_returned_date_sk#102 AS date_sk#110, 0.00 AS sales_price#111, 0.00 AS profit#112, wr_return_amt#100 AS return_amt#113, wr_net_loss#101 AS net_loss#114] +Input [8]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102, ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] + +(63) Union + +(64) Scan parquet default.web_site +Output [2]: [web_site_sk#115, web_site_id#116] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_site_sk)] +ReadSchema: struct + +(65) ColumnarToRow [codegen id : 19] +Input [2]: [web_site_sk#115, web_site_id#116] + +(66) Filter [codegen id : 19] +Input [2]: [web_site_sk#115, web_site_id#116] +Condition : isnotnull(web_site_sk#115) + +(67) BroadcastExchange +Input [2]: [web_site_sk#115, web_site_id#116] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#117] + +(68) BroadcastHashJoin [codegen id : 21] +Left keys [1]: [wsr_web_site_sk#92] +Right keys [1]: [web_site_sk#115] +Join condition: None + +(69) Project [codegen id : 21] +Output [6]: [date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Input [8]: [wsr_web_site_sk#92, date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_sk#115, web_site_id#116] + +(70) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#118] + +(71) BroadcastHashJoin [codegen id : 21] +Left keys [1]: [date_sk#93] +Right keys [1]: [d_date_sk#118] +Join condition: None + +(72) Project [codegen id : 21] +Output [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Input [7]: [date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116, d_date_sk#118] + +(73) HashAggregate [codegen id : 21] +Input [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Keys [1]: [web_site_id#116] +Functions [4]: [partial_sum(UnscaledValue(sales_price#94)), partial_sum(UnscaledValue(return_amt#96)), partial_sum(UnscaledValue(profit#95)), partial_sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum#119, sum#120, sum#121, sum#122] +Results [5]: [web_site_id#116, sum#123, sum#124, sum#125, sum#126] + +(74) Exchange +Input [5]: [web_site_id#116, sum#123, sum#124, sum#125, sum#126] +Arguments: hashpartitioning(web_site_id#116, 5), ENSURE_REQUIREMENTS, [id=#127] + +(75) HashAggregate [codegen id : 22] +Input [5]: [web_site_id#116, sum#123, sum#124, sum#125, sum#126] +Keys [1]: [web_site_id#116] +Functions [4]: [sum(UnscaledValue(sales_price#94)), sum(UnscaledValue(return_amt#96)), sum(UnscaledValue(profit#95)), sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#94))#128, sum(UnscaledValue(return_amt#96))#129, sum(UnscaledValue(profit#95))#130, sum(UnscaledValue(net_loss#97))#131] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#94))#128,17,2) AS sales#132, MakeDecimal(sum(UnscaledValue(return_amt#96))#129,17,2) AS RETURNS#133, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#95))#130,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#97))#131,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#134, web channel AS channel#135, concat(web_site, web_site_id#116) AS id#136] + +(76) Union + +(77) Expand [codegen id : 23] +Input [5]: [sales#41, RETURNS#42, profit#43, channel#44, id#45] +Arguments: [ArrayBuffer(sales#41, returns#42, profit#43, channel#44, id#45, 0), ArrayBuffer(sales#41, returns#42, profit#43, channel#44, null, 1), ArrayBuffer(sales#41, returns#42, profit#43, null, null, 3)], [sales#41, returns#42, profit#43, channel#137, id#138, spark_grouping_id#139] + +(78) HashAggregate [codegen id : 23] +Input [6]: [sales#41, returns#42, profit#43, channel#137, id#138, spark_grouping_id#139] +Keys [3]: [channel#137, id#138, spark_grouping_id#139] +Functions [3]: [partial_sum(sales#41), partial_sum(returns#42), partial_sum(profit#43)] +Aggregate Attributes [6]: [sum#140, isEmpty#141, sum#142, isEmpty#143, sum#144, isEmpty#145] +Results [9]: [channel#137, id#138, spark_grouping_id#139, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] + +(79) Exchange +Input [9]: [channel#137, id#138, spark_grouping_id#139, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] +Arguments: hashpartitioning(channel#137, id#138, spark_grouping_id#139, 5), ENSURE_REQUIREMENTS, [id=#152] + +(80) HashAggregate [codegen id : 24] +Input [9]: [channel#137, id#138, spark_grouping_id#139, sum#146, isEmpty#147, sum#148, isEmpty#149, sum#150, isEmpty#151] +Keys [3]: [channel#137, id#138, spark_grouping_id#139] +Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)] +Aggregate Attributes [3]: [sum(sales#41)#153, sum(returns#42)#154, sum(profit#43)#155] +Results [5]: [channel#137, id#138, sum(sales#41)#153 AS sales#156, sum(returns#42)#154 AS returns#157, sum(profit#43)#155 AS profit#158] + +(81) TakeOrderedAndProject +Input [5]: [channel#137, id#138, sales#156, returns#157, profit#158] +Arguments: 100, [channel#137 ASC NULLS FIRST, id#138 ASC NULLS FIRST], [channel#137, id#138, sales#156, returns#157, profit#158] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (82) + + +(82) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#25] + +Subquery:2 Hosting operator id = 5 Hosting Expression = sr_returned_date_sk#15 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#49 IN dynamicpruning#5 + +Subquery:4 Hosting operator id = 30 Hosting Expression = cr_returned_date_sk#59 IN dynamicpruning#5 + +Subquery:5 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#91 IN dynamicpruning#5 + +Subquery:6 Hosting operator id = 51 Hosting Expression = wr_returned_date_sk#102 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt new file mode 100644 index 0000000000000..2b62a0f686b43 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5.sf100/simplified.txt @@ -0,0 +1,139 @@ +TakeOrderedAndProject [channel,id,sales,returns,profit] + WholeStageCodegen (24) + HashAggregate [channel,id,spark_grouping_id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel,id,spark_grouping_id] #1 + WholeStageCodegen (23) + HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + Expand [sales,returns,profit,channel,id] + InputAdapter + Union + WholeStageCodegen (6) + HashAggregate [s_store_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),sales,RETURNS,profit,channel,id,sum,sum,sum,sum] + InputAdapter + Exchange [s_store_id] #2 + WholeStageCodegen (5) + HashAggregate [s_store_id,sales_price,return_amt,profit,net_loss] [sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,profit,return_amt,net_loss,s_store_id] + BroadcastHashJoin [date_sk,d_date_sk] + Project [date_sk,sales_price,profit,return_amt,net_loss,s_store_id] + BroadcastHashJoin [store_sk,s_store_sk] + InputAdapter + Union + WholeStageCodegen (1) + Project [ss_store_sk,ss_sold_date_sk,ss_ext_sales_price,ss_net_profit] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + WholeStageCodegen (2) + Project [sr_store_sk,sr_returned_date_sk,sr_return_amt,sr_net_loss] + Filter [sr_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_store_sk,sr_return_amt,sr_net_loss,sr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + WholeStageCodegen (12) + HashAggregate [cp_catalog_page_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),sales,RETURNS,profit,channel,id,sum,sum,sum,sum] + InputAdapter + Exchange [cp_catalog_page_id] #5 + WholeStageCodegen (11) + HashAggregate [cp_catalog_page_id,sales_price,return_amt,profit,net_loss] [sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,profit,return_amt,net_loss,cp_catalog_page_id] + BroadcastHashJoin [date_sk,d_date_sk] + Project [date_sk,sales_price,profit,return_amt,net_loss,cp_catalog_page_id] + BroadcastHashJoin [page_sk,cp_catalog_page_sk] + InputAdapter + Union + WholeStageCodegen (7) + Project [cs_catalog_page_sk,cs_sold_date_sk,cs_ext_sales_price,cs_net_profit] + Filter [cs_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + WholeStageCodegen (8) + Project [cr_catalog_page_sk,cr_returned_date_sk,cr_return_amount,cr_net_loss] + Filter [cr_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_catalog_page_sk,cr_return_amount,cr_net_loss,cr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (9) + Filter [cp_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_page [cp_catalog_page_sk,cp_catalog_page_id] + InputAdapter + ReusedExchange [d_date_sk] #3 + WholeStageCodegen (22) + HashAggregate [web_site_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),sales,RETURNS,profit,channel,id,sum,sum,sum,sum] + InputAdapter + Exchange [web_site_id] #7 + WholeStageCodegen (21) + HashAggregate [web_site_id,sales_price,return_amt,profit,net_loss] [sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,profit,return_amt,net_loss,web_site_id] + BroadcastHashJoin [date_sk,d_date_sk] + Project [date_sk,sales_price,profit,return_amt,net_loss,web_site_id] + BroadcastHashJoin [wsr_web_site_sk,web_site_sk] + InputAdapter + Union + WholeStageCodegen (13) + Project [ws_web_site_sk,ws_sold_date_sk,ws_ext_sales_price,ws_net_profit] + Filter [ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_web_site_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + WholeStageCodegen (18) + Project [ws_web_site_sk,wr_returned_date_sk,wr_return_amt,wr_net_loss] + SortMergeJoin [wr_item_sk,wr_order_number,ws_item_sk,ws_order_number] + InputAdapter + WholeStageCodegen (15) + Sort [wr_item_sk,wr_order_number] + InputAdapter + Exchange [wr_item_sk,wr_order_number] #8 + WholeStageCodegen (14) + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss,wr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (17) + Sort [ws_item_sk,ws_order_number] + InputAdapter + Exchange [ws_item_sk,ws_order_number] #9 + WholeStageCodegen (16) + Project [ws_item_sk,ws_web_site_sk,ws_order_number] + Filter [ws_item_sk,ws_order_number,ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_web_site_sk,ws_order_number,ws_sold_date_sk] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (19) + Filter [web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_site_id] + InputAdapter + ReusedExchange [d_date_sk] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt new file mode 100644 index 0000000000000..7c0804a51c860 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/explain.txt @@ -0,0 +1,461 @@ +== Physical Plan == +TakeOrderedAndProject (78) ++- * HashAggregate (77) + +- Exchange (76) + +- * HashAggregate (75) + +- * Expand (74) + +- Union (73) + :- * HashAggregate (25) + : +- Exchange (24) + : +- * HashAggregate (23) + : +- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- Union (9) + : : : :- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Project (8) + : : : +- * Filter (7) + : : : +- * ColumnarToRow (6) + : : : +- Scan parquet default.store_returns (5) + : : +- BroadcastExchange (14) + : : +- * Project (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.date_dim (10) + : +- BroadcastExchange (20) + : +- * Filter (19) + : +- * ColumnarToRow (18) + : +- Scan parquet default.store (17) + :- * HashAggregate (46) + : +- Exchange (45) + : +- * HashAggregate (44) + : +- * Project (43) + : +- * BroadcastHashJoin Inner BuildRight (42) + : :- * Project (37) + : : +- * BroadcastHashJoin Inner BuildRight (36) + : : :- Union (34) + : : : :- * Project (29) + : : : : +- * Filter (28) + : : : : +- * ColumnarToRow (27) + : : : : +- Scan parquet default.catalog_sales (26) + : : : +- * Project (33) + : : : +- * Filter (32) + : : : +- * ColumnarToRow (31) + : : : +- Scan parquet default.catalog_returns (30) + : : +- ReusedExchange (35) + : +- BroadcastExchange (41) + : +- * Filter (40) + : +- * ColumnarToRow (39) + : +- Scan parquet default.catalog_page (38) + +- * HashAggregate (72) + +- Exchange (71) + +- * HashAggregate (70) + +- * Project (69) + +- * BroadcastHashJoin Inner BuildRight (68) + :- * Project (63) + : +- * BroadcastHashJoin Inner BuildRight (62) + : :- Union (60) + : : :- * Project (50) + : : : +- * Filter (49) + : : : +- * ColumnarToRow (48) + : : : +- Scan parquet default.web_sales (47) + : : +- * Project (59) + : : +- * BroadcastHashJoin Inner BuildLeft (58) + : : :- BroadcastExchange (53) + : : : +- * ColumnarToRow (52) + : : : +- Scan parquet default.web_returns (51) + : : +- * Project (57) + : : +- * Filter (56) + : : +- * ColumnarToRow (55) + : : +- Scan parquet default.web_sales (54) + : +- ReusedExchange (61) + +- BroadcastExchange (67) + +- * Filter (66) + +- * ColumnarToRow (65) + +- Scan parquet default.web_site (64) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 1] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_store_sk#1) + +(4) Project [codegen id : 1] +Output [6]: [ss_store_sk#1 AS store_sk#6, ss_sold_date_sk#4 AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] + +(5) Scan parquet default.store_returns +Output [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#15), dynamicpruningexpression(sr_returned_date_sk#15 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 2] +Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] + +(7) Filter [codegen id : 2] +Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] +Condition : isnotnull(sr_store_sk#12) + +(8) Project [codegen id : 2] +Output [6]: [sr_store_sk#12 AS store_sk#16, sr_returned_date_sk#15 AS date_sk#17, 0.00 AS sales_price#18, 0.00 AS profit#19, sr_return_amt#13 AS return_amt#20, sr_net_loss#14 AS net_loss#21] +Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] + +(9) Union + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#22, d_date#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-08-23), LessThanOrEqual(d_date,2000-09-06), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#22, d_date#23] + +(12) Filter [codegen id : 3] +Input [2]: [d_date_sk#22, d_date#23] +Condition : (((isnotnull(d_date#23) AND (d_date#23 >= 2000-08-23)) AND (d_date#23 <= 2000-09-06)) AND isnotnull(d_date_sk#22)) + +(13) Project [codegen id : 3] +Output [1]: [d_date_sk#22] +Input [2]: [d_date_sk#22, d_date#23] + +(14) BroadcastExchange +Input [1]: [d_date_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(15) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [date_sk#7] +Right keys [1]: [d_date_sk#22] +Join condition: None + +(16) Project [codegen id : 5] +Output [5]: [store_sk#6, sales_price#8, profit#9, return_amt#10, net_loss#11] +Input [7]: [store_sk#6, date_sk#7, sales_price#8, profit#9, return_amt#10, net_loss#11, d_date_sk#22] + +(17) Scan parquet default.store +Output [2]: [s_store_sk#25, s_store_id#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 4] +Input [2]: [s_store_sk#25, s_store_id#26] + +(19) Filter [codegen id : 4] +Input [2]: [s_store_sk#25, s_store_id#26] +Condition : isnotnull(s_store_sk#25) + +(20) BroadcastExchange +Input [2]: [s_store_sk#25, s_store_id#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(21) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [store_sk#6] +Right keys [1]: [s_store_sk#25] +Join condition: None + +(22) Project [codegen id : 5] +Output [5]: [sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#26] +Input [7]: [store_sk#6, sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_sk#25, s_store_id#26] + +(23) HashAggregate [codegen id : 5] +Input [5]: [sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#26] +Keys [1]: [s_store_id#26] +Functions [4]: [partial_sum(UnscaledValue(sales_price#8)), partial_sum(UnscaledValue(return_amt#10)), partial_sum(UnscaledValue(profit#9)), partial_sum(UnscaledValue(net_loss#11))] +Aggregate Attributes [4]: [sum#28, sum#29, sum#30, sum#31] +Results [5]: [s_store_id#26, sum#32, sum#33, sum#34, sum#35] + +(24) Exchange +Input [5]: [s_store_id#26, sum#32, sum#33, sum#34, sum#35] +Arguments: hashpartitioning(s_store_id#26, 5), ENSURE_REQUIREMENTS, [id=#36] + +(25) HashAggregate [codegen id : 6] +Input [5]: [s_store_id#26, sum#32, sum#33, sum#34, sum#35] +Keys [1]: [s_store_id#26] +Functions [4]: [sum(UnscaledValue(sales_price#8)), sum(UnscaledValue(return_amt#10)), sum(UnscaledValue(profit#9)), sum(UnscaledValue(net_loss#11))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#8))#37, sum(UnscaledValue(return_amt#10))#38, sum(UnscaledValue(profit#9))#39, sum(UnscaledValue(net_loss#11))#40] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#8))#37,17,2) AS sales#41, MakeDecimal(sum(UnscaledValue(return_amt#10))#38,17,2) AS RETURNS#42, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#9))#39,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#11))#40,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#43, store channel AS channel#44, concat(store, s_store_id#26) AS id#45] + +(26) Scan parquet default.catalog_sales +Output [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#49), dynamicpruningexpression(cs_sold_date_sk#49 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_catalog_page_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 7] +Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] + +(28) Filter [codegen id : 7] +Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] +Condition : isnotnull(cs_catalog_page_sk#46) + +(29) Project [codegen id : 7] +Output [6]: [cs_catalog_page_sk#46 AS page_sk#50, cs_sold_date_sk#49 AS date_sk#51, cs_ext_sales_price#47 AS sales_price#52, cs_net_profit#48 AS profit#53, 0.00 AS return_amt#54, 0.00 AS net_loss#55] +Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] + +(30) Scan parquet default.catalog_returns +Output [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#59), dynamicpruningexpression(cr_returned_date_sk#59 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cr_catalog_page_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 8] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(32) Filter [codegen id : 8] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Condition : isnotnull(cr_catalog_page_sk#56) + +(33) Project [codegen id : 8] +Output [6]: [cr_catalog_page_sk#56 AS page_sk#60, cr_returned_date_sk#59 AS date_sk#61, 0.00 AS sales_price#62, 0.00 AS profit#63, cr_return_amount#57 AS return_amt#64, cr_net_loss#58 AS net_loss#65] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(34) Union + +(35) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#66] + +(36) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [date_sk#51] +Right keys [1]: [d_date_sk#66] +Join condition: None + +(37) Project [codegen id : 11] +Output [5]: [page_sk#50, sales_price#52, profit#53, return_amt#54, net_loss#55] +Input [7]: [page_sk#50, date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, d_date_sk#66] + +(38) Scan parquet default.catalog_page +Output [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_page] +PushedFilters: [IsNotNull(cp_catalog_page_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 10] +Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] + +(40) Filter [codegen id : 10] +Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Condition : isnotnull(cp_catalog_page_sk#67) + +(41) BroadcastExchange +Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#69] + +(42) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [page_sk#50] +Right keys [1]: [cp_catalog_page_sk#67] +Join condition: None + +(43) Project [codegen id : 11] +Output [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#68] +Input [7]: [page_sk#50, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_sk#67, cp_catalog_page_id#68] + +(44) HashAggregate [codegen id : 11] +Input [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#68] +Keys [1]: [cp_catalog_page_id#68] +Functions [4]: [partial_sum(UnscaledValue(sales_price#52)), partial_sum(UnscaledValue(return_amt#54)), partial_sum(UnscaledValue(profit#53)), partial_sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum#70, sum#71, sum#72, sum#73] +Results [5]: [cp_catalog_page_id#68, sum#74, sum#75, sum#76, sum#77] + +(45) Exchange +Input [5]: [cp_catalog_page_id#68, sum#74, sum#75, sum#76, sum#77] +Arguments: hashpartitioning(cp_catalog_page_id#68, 5), ENSURE_REQUIREMENTS, [id=#78] + +(46) HashAggregate [codegen id : 12] +Input [5]: [cp_catalog_page_id#68, sum#74, sum#75, sum#76, sum#77] +Keys [1]: [cp_catalog_page_id#68] +Functions [4]: [sum(UnscaledValue(sales_price#52)), sum(UnscaledValue(return_amt#54)), sum(UnscaledValue(profit#53)), sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#52))#79, sum(UnscaledValue(return_amt#54))#80, sum(UnscaledValue(profit#53))#81, sum(UnscaledValue(net_loss#55))#82] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#52))#79,17,2) AS sales#83, MakeDecimal(sum(UnscaledValue(return_amt#54))#80,17,2) AS RETURNS#84, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#53))#81,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#55))#82,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#85, catalog channel AS channel#86, concat(catalog_page, cp_catalog_page_id#68) AS id#87] + +(47) Scan parquet default.web_sales +Output [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#91), dynamicpruningexpression(ws_sold_date_sk#91 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 13] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] + +(49) Filter [codegen id : 13] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] +Condition : isnotnull(ws_web_site_sk#88) + +(50) Project [codegen id : 13] +Output [6]: [ws_web_site_sk#88 AS wsr_web_site_sk#92, ws_sold_date_sk#91 AS date_sk#93, ws_ext_sales_price#89 AS sales_price#94, ws_net_profit#90 AS profit#95, 0.00 AS return_amt#96, 0.00 AS net_loss#97] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] + +(51) Scan parquet default.web_returns +Output [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#102), dynamicpruningexpression(wr_returned_date_sk#102 IN dynamicpruning#5)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 14] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] + +(53) BroadcastExchange +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, true] as bigint), 32) | (cast(input[1, int, true] as bigint) & 4294967295))),false), [id=#103] + +(54) Scan parquet default.web_sales +Output [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(55) ColumnarToRow +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] + +(56) Filter +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] +Condition : ((isnotnull(ws_item_sk#104) AND isnotnull(ws_order_number#106)) AND isnotnull(ws_web_site_sk#105)) + +(57) Project +Output [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] + +(58) BroadcastHashJoin [codegen id : 15] +Left keys [2]: [wr_item_sk#98, wr_order_number#99] +Right keys [2]: [ws_item_sk#104, ws_order_number#106] +Join condition: None + +(59) Project [codegen id : 15] +Output [6]: [ws_web_site_sk#105 AS wsr_web_site_sk#108, wr_returned_date_sk#102 AS date_sk#109, 0.00 AS sales_price#110, 0.00 AS profit#111, wr_return_amt#100 AS return_amt#112, wr_net_loss#101 AS net_loss#113] +Input [8]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102, ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] + +(60) Union + +(61) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#114] + +(62) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [date_sk#93] +Right keys [1]: [d_date_sk#114] +Join condition: None + +(63) Project [codegen id : 18] +Output [5]: [wsr_web_site_sk#92, sales_price#94, profit#95, return_amt#96, net_loss#97] +Input [7]: [wsr_web_site_sk#92, date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, d_date_sk#114] + +(64) Scan parquet default.web_site +Output [2]: [web_site_sk#115, web_site_id#116] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_site_sk)] +ReadSchema: struct + +(65) ColumnarToRow [codegen id : 17] +Input [2]: [web_site_sk#115, web_site_id#116] + +(66) Filter [codegen id : 17] +Input [2]: [web_site_sk#115, web_site_id#116] +Condition : isnotnull(web_site_sk#115) + +(67) BroadcastExchange +Input [2]: [web_site_sk#115, web_site_id#116] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#117] + +(68) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [wsr_web_site_sk#92] +Right keys [1]: [web_site_sk#115] +Join condition: None + +(69) Project [codegen id : 18] +Output [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Input [7]: [wsr_web_site_sk#92, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_sk#115, web_site_id#116] + +(70) HashAggregate [codegen id : 18] +Input [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Keys [1]: [web_site_id#116] +Functions [4]: [partial_sum(UnscaledValue(sales_price#94)), partial_sum(UnscaledValue(return_amt#96)), partial_sum(UnscaledValue(profit#95)), partial_sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum#118, sum#119, sum#120, sum#121] +Results [5]: [web_site_id#116, sum#122, sum#123, sum#124, sum#125] + +(71) Exchange +Input [5]: [web_site_id#116, sum#122, sum#123, sum#124, sum#125] +Arguments: hashpartitioning(web_site_id#116, 5), ENSURE_REQUIREMENTS, [id=#126] + +(72) HashAggregate [codegen id : 19] +Input [5]: [web_site_id#116, sum#122, sum#123, sum#124, sum#125] +Keys [1]: [web_site_id#116] +Functions [4]: [sum(UnscaledValue(sales_price#94)), sum(UnscaledValue(return_amt#96)), sum(UnscaledValue(profit#95)), sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#94))#127, sum(UnscaledValue(return_amt#96))#128, sum(UnscaledValue(profit#95))#129, sum(UnscaledValue(net_loss#97))#130] +Results [5]: [MakeDecimal(sum(UnscaledValue(sales_price#94))#127,17,2) AS sales#131, MakeDecimal(sum(UnscaledValue(return_amt#96))#128,17,2) AS RETURNS#132, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#95))#129,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#97))#130,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#133, web channel AS channel#134, concat(web_site, web_site_id#116) AS id#135] + +(73) Union + +(74) Expand [codegen id : 20] +Input [5]: [sales#41, RETURNS#42, profit#43, channel#44, id#45] +Arguments: [ArrayBuffer(sales#41, returns#42, profit#43, channel#44, id#45, 0), ArrayBuffer(sales#41, returns#42, profit#43, channel#44, null, 1), ArrayBuffer(sales#41, returns#42, profit#43, null, null, 3)], [sales#41, returns#42, profit#43, channel#136, id#137, spark_grouping_id#138] + +(75) HashAggregate [codegen id : 20] +Input [6]: [sales#41, returns#42, profit#43, channel#136, id#137, spark_grouping_id#138] +Keys [3]: [channel#136, id#137, spark_grouping_id#138] +Functions [3]: [partial_sum(sales#41), partial_sum(returns#42), partial_sum(profit#43)] +Aggregate Attributes [6]: [sum#139, isEmpty#140, sum#141, isEmpty#142, sum#143, isEmpty#144] +Results [9]: [channel#136, id#137, spark_grouping_id#138, sum#145, isEmpty#146, sum#147, isEmpty#148, sum#149, isEmpty#150] + +(76) Exchange +Input [9]: [channel#136, id#137, spark_grouping_id#138, sum#145, isEmpty#146, sum#147, isEmpty#148, sum#149, isEmpty#150] +Arguments: hashpartitioning(channel#136, id#137, spark_grouping_id#138, 5), ENSURE_REQUIREMENTS, [id=#151] + +(77) HashAggregate [codegen id : 21] +Input [9]: [channel#136, id#137, spark_grouping_id#138, sum#145, isEmpty#146, sum#147, isEmpty#148, sum#149, isEmpty#150] +Keys [3]: [channel#136, id#137, spark_grouping_id#138] +Functions [3]: [sum(sales#41), sum(returns#42), sum(profit#43)] +Aggregate Attributes [3]: [sum(sales#41)#152, sum(returns#42)#153, sum(profit#43)#154] +Results [5]: [channel#136, id#137, sum(sales#41)#152 AS sales#155, sum(returns#42)#153 AS returns#156, sum(profit#43)#154 AS profit#157] + +(78) TakeOrderedAndProject +Input [5]: [channel#136, id#137, sales#155, returns#156, profit#157] +Arguments: 100, [channel#136 ASC NULLS FIRST, id#137 ASC NULLS FIRST], [channel#136, id#137, sales#155, returns#156, profit#157] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (79) + + +(79) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#22] + +Subquery:2 Hosting operator id = 5 Hosting Expression = sr_returned_date_sk#15 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#49 IN dynamicpruning#5 + +Subquery:4 Hosting operator id = 30 Hosting Expression = cr_returned_date_sk#59 IN dynamicpruning#5 + +Subquery:5 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#91 IN dynamicpruning#5 + +Subquery:6 Hosting operator id = 51 Hosting Expression = wr_returned_date_sk#102 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt new file mode 100644 index 0000000000000..99ad64a42ab28 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q5/simplified.txt @@ -0,0 +1,130 @@ +TakeOrderedAndProject [channel,id,sales,returns,profit] + WholeStageCodegen (21) + HashAggregate [channel,id,spark_grouping_id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel,id,spark_grouping_id] #1 + WholeStageCodegen (20) + HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + Expand [sales,returns,profit,channel,id] + InputAdapter + Union + WholeStageCodegen (6) + HashAggregate [s_store_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),sales,RETURNS,profit,channel,id,sum,sum,sum,sum] + InputAdapter + Exchange [s_store_id] #2 + WholeStageCodegen (5) + HashAggregate [s_store_id,sales_price,return_amt,profit,net_loss] [sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,profit,return_amt,net_loss,s_store_id] + BroadcastHashJoin [store_sk,s_store_sk] + Project [store_sk,sales_price,profit,return_amt,net_loss] + BroadcastHashJoin [date_sk,d_date_sk] + InputAdapter + Union + WholeStageCodegen (1) + Project [ss_store_sk,ss_sold_date_sk,ss_ext_sales_price,ss_net_profit] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + WholeStageCodegen (2) + Project [sr_store_sk,sr_returned_date_sk,sr_return_amt,sr_net_loss] + Filter [sr_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_store_sk,sr_return_amt,sr_net_loss,sr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + WholeStageCodegen (12) + HashAggregate [cp_catalog_page_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),sales,RETURNS,profit,channel,id,sum,sum,sum,sum] + InputAdapter + Exchange [cp_catalog_page_id] #5 + WholeStageCodegen (11) + HashAggregate [cp_catalog_page_id,sales_price,return_amt,profit,net_loss] [sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,profit,return_amt,net_loss,cp_catalog_page_id] + BroadcastHashJoin [page_sk,cp_catalog_page_sk] + Project [page_sk,sales_price,profit,return_amt,net_loss] + BroadcastHashJoin [date_sk,d_date_sk] + InputAdapter + Union + WholeStageCodegen (7) + Project [cs_catalog_page_sk,cs_sold_date_sk,cs_ext_sales_price,cs_net_profit] + Filter [cs_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + WholeStageCodegen (8) + Project [cr_catalog_page_sk,cr_returned_date_sk,cr_return_amount,cr_net_loss] + Filter [cr_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_catalog_page_sk,cr_return_amount,cr_net_loss,cr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (10) + Filter [cp_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_page [cp_catalog_page_sk,cp_catalog_page_id] + WholeStageCodegen (19) + HashAggregate [web_site_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),sales,RETURNS,profit,channel,id,sum,sum,sum,sum] + InputAdapter + Exchange [web_site_id] #7 + WholeStageCodegen (18) + HashAggregate [web_site_id,sales_price,return_amt,profit,net_loss] [sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,profit,return_amt,net_loss,web_site_id] + BroadcastHashJoin [wsr_web_site_sk,web_site_sk] + Project [wsr_web_site_sk,sales_price,profit,return_amt,net_loss] + BroadcastHashJoin [date_sk,d_date_sk] + InputAdapter + Union + WholeStageCodegen (13) + Project [ws_web_site_sk,ws_sold_date_sk,ws_ext_sales_price,ws_net_profit] + Filter [ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_web_site_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + WholeStageCodegen (15) + Project [ws_web_site_sk,wr_returned_date_sk,wr_return_amt,wr_net_loss] + BroadcastHashJoin [wr_item_sk,wr_order_number,ws_item_sk,ws_order_number] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (14) + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss,wr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + Project [ws_item_sk,ws_web_site_sk,ws_order_number] + Filter [ws_item_sk,ws_order_number,ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_web_site_sk,ws_order_number,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (17) + Filter [web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_site_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt new file mode 100644 index 0000000000000..ccb95a316cb28 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/explain.txt @@ -0,0 +1,210 @@ +== Physical Plan == +TakeOrderedAndProject (35) ++- * HashAggregate (34) + +- Exchange (33) + +- * HashAggregate (32) + +- * Project (31) + +- * BroadcastHashJoin Inner BuildRight (30) + :- * Project (25) + : +- * BroadcastHashJoin Inner BuildRight (24) + : :- * Project (19) + : : +- * SortMergeJoin Inner (18) + : : :- * Sort (12) + : : : +- Exchange (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_returns (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- * Sort (17) + : : +- Exchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.store_sales (13) + : +- BroadcastExchange (23) + : +- * Filter (22) + : +- * ColumnarToRow (21) + : +- Scan parquet default.date_dim (20) + +- BroadcastExchange (29) + +- * Filter (28) + +- * ColumnarToRow (27) + +- Scan parquet default.store (26) + + +(1) Scan parquet default.store_returns +Output [4]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#4), dynamicpruningexpression(sr_returned_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk), IsNotNull(sr_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [4]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4] + +(3) Filter [codegen id : 2] +Input [4]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4] +Condition : ((isnotnull(sr_ticket_number#3) AND isnotnull(sr_item_sk#1)) AND isnotnull(sr_customer_sk#2)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,8), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((isnotnull(d_year#7) AND isnotnull(d_moy#8)) AND (d_year#7 = 2001)) AND (d_moy#8 = 8)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [sr_returned_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 2] +Output [4]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4] +Input [5]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4, d_date_sk#6] + +(11) Exchange +Input [4]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4] +Arguments: hashpartitioning(sr_ticket_number#3, sr_item_sk#1, sr_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#10] + +(12) Sort [codegen id : 3] +Input [4]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4] +Arguments: [sr_ticket_number#3 ASC NULLS FIRST, sr_item_sk#1 ASC NULLS FIRST, sr_customer_sk#2 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.store_sales +Output [5]: [ss_item_sk#11, ss_customer_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_sold_date_sk#15] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#15)] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 4] +Input [5]: [ss_item_sk#11, ss_customer_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_sold_date_sk#15] + +(15) Filter [codegen id : 4] +Input [5]: [ss_item_sk#11, ss_customer_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_sold_date_sk#15] +Condition : (((isnotnull(ss_ticket_number#14) AND isnotnull(ss_item_sk#11)) AND isnotnull(ss_customer_sk#12)) AND isnotnull(ss_store_sk#13)) + +(16) Exchange +Input [5]: [ss_item_sk#11, ss_customer_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_sold_date_sk#15] +Arguments: hashpartitioning(ss_ticket_number#14, ss_item_sk#11, ss_customer_sk#12, 5), ENSURE_REQUIREMENTS, [id=#16] + +(17) Sort [codegen id : 5] +Input [5]: [ss_item_sk#11, ss_customer_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_sold_date_sk#15] +Arguments: [ss_ticket_number#14 ASC NULLS FIRST, ss_item_sk#11 ASC NULLS FIRST, ss_customer_sk#12 ASC NULLS FIRST], false, 0 + +(18) SortMergeJoin [codegen id : 8] +Left keys [3]: [sr_ticket_number#3, sr_item_sk#1, sr_customer_sk#2] +Right keys [3]: [ss_ticket_number#14, ss_item_sk#11, ss_customer_sk#12] +Join condition: None + +(19) Project [codegen id : 8] +Output [3]: [sr_returned_date_sk#4, ss_store_sk#13, ss_sold_date_sk#15] +Input [9]: [sr_item_sk#1, sr_customer_sk#2, sr_ticket_number#3, sr_returned_date_sk#4, ss_item_sk#11, ss_customer_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_sold_date_sk#15] + +(20) Scan parquet default.date_dim +Output [1]: [d_date_sk#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [1]: [d_date_sk#17] + +(22) Filter [codegen id : 6] +Input [1]: [d_date_sk#17] +Condition : isnotnull(d_date_sk#17) + +(23) BroadcastExchange +Input [1]: [d_date_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(24) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_sold_date_sk#15] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(25) Project [codegen id : 8] +Output [3]: [sr_returned_date_sk#4, ss_store_sk#13, ss_sold_date_sk#15] +Input [4]: [sr_returned_date_sk#4, ss_store_sk#13, ss_sold_date_sk#15, d_date_sk#17] + +(26) Scan parquet default.store +Output [11]: [s_store_sk#19, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 7] +Input [11]: [s_store_sk#19, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] + +(28) Filter [codegen id : 7] +Input [11]: [s_store_sk#19, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Condition : isnotnull(s_store_sk#19) + +(29) BroadcastExchange +Input [11]: [s_store_sk#19, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#30] + +(30) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_store_sk#13] +Right keys [1]: [s_store_sk#19] +Join condition: None + +(31) Project [codegen id : 8] +Output [12]: [ss_sold_date_sk#15, sr_returned_date_sk#4, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Input [14]: [sr_returned_date_sk#4, ss_store_sk#13, ss_sold_date_sk#15, s_store_sk#19, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] + +(32) HashAggregate [codegen id : 8] +Input [12]: [ss_sold_date_sk#15, sr_returned_date_sk#4, s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Keys [10]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Functions [5]: [partial_sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 30) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 30) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 60)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 60) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 90)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 90) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 120)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum#31, sum#32, sum#33, sum#34, sum#35] +Results [15]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, sum#36, sum#37, sum#38, sum#39, sum#40] + +(33) Exchange +Input [15]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, sum#36, sum#37, sum#38, sum#39, sum#40] +Arguments: hashpartitioning(s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, 5), ENSURE_REQUIREMENTS, [id=#41] + +(34) HashAggregate [codegen id : 9] +Input [15]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, sum#36, sum#37, sum#38, sum#39, sum#40] +Keys [10]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29] +Functions [5]: [sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 30) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 60)) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 60) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 90)) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 90) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 120)) THEN 1 ELSE 0 END), sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 30) THEN 1 ELSE 0 END)#42, sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 30) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 60)) THEN 1 ELSE 0 END)#43, sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 60) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 90)) THEN 1 ELSE 0 END)#44, sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 90) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 120)) THEN 1 ELSE 0 END)#45, sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 120) THEN 1 ELSE 0 END)#46] +Results [15]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 30) THEN 1 ELSE 0 END)#42 AS 30 days #47, sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 30) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 60)) THEN 1 ELSE 0 END)#43 AS 31 - 60 days #48, sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 60) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 90)) THEN 1 ELSE 0 END)#44 AS 61 - 90 days #49, sum(CASE WHEN (((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 90) AND ((sr_returned_date_sk#4 - ss_sold_date_sk#15) <= 120)) THEN 1 ELSE 0 END)#45 AS 91 - 120 days #50, sum(CASE WHEN ((sr_returned_date_sk#4 - ss_sold_date_sk#15) > 120) THEN 1 ELSE 0 END)#46 AS >120 days #51] + +(35) TakeOrderedAndProject +Input [15]: [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, 30 days #47, 31 - 60 days #48, 61 - 90 days #49, 91 - 120 days #50, >120 days #51] +Arguments: 100, [s_store_name#20 ASC NULLS FIRST, s_company_id#21 ASC NULLS FIRST, s_street_number#22 ASC NULLS FIRST, s_street_name#23 ASC NULLS FIRST, s_street_type#24 ASC NULLS FIRST, s_suite_number#25 ASC NULLS FIRST, s_city#26 ASC NULLS FIRST, s_county#27 ASC NULLS FIRST, s_state#28 ASC NULLS FIRST, s_zip#29 ASC NULLS FIRST], [s_store_name#20, s_company_id#21, s_street_number#22, s_street_name#23, s_street_type#24, s_suite_number#25, s_city#26, s_county#27, s_state#28, s_zip#29, 30 days #47, 31 - 60 days #48, 61 - 90 days #49, 91 - 120 days #50, >120 days #51] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = sr_returned_date_sk#4 IN dynamicpruning#5 +ReusedExchange (36) + + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt new file mode 100644 index 0000000000000..441e0963f478c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50.sf100/simplified.txt @@ -0,0 +1,59 @@ +TakeOrderedAndProject [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ] + WholeStageCodegen (9) + HashAggregate [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,sum,sum,sum,sum,sum] [sum(CASE WHEN ((sr_returned_date_sk - ss_sold_date_sk) <= 30) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_sk - ss_sold_date_sk) > 30) AND ((sr_returned_date_sk - ss_sold_date_sk) <= 60)) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_sk - ss_sold_date_sk) > 60) AND ((sr_returned_date_sk - ss_sold_date_sk) <= 90)) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_sk - ss_sold_date_sk) > 90) AND ((sr_returned_date_sk - ss_sold_date_sk) <= 120)) THEN 1 ELSE 0 END),sum(CASE WHEN ((sr_returned_date_sk - ss_sold_date_sk) > 120) THEN 1 ELSE 0 END),30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ,sum,sum,sum,sum,sum] + InputAdapter + Exchange [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] #1 + WholeStageCodegen (8) + HashAggregate [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,sr_returned_date_sk,ss_sold_date_sk] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [ss_sold_date_sk,sr_returned_date_sk,s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [sr_returned_date_sk,ss_store_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [sr_returned_date_sk,ss_store_sk,ss_sold_date_sk] + SortMergeJoin [sr_ticket_number,sr_item_sk,sr_customer_sk,ss_ticket_number,ss_item_sk,ss_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [sr_ticket_number,sr_item_sk,sr_customer_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk,sr_customer_sk] #2 + WholeStageCodegen (2) + Project [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_returned_date_sk] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_ticket_number,sr_item_sk,sr_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + WholeStageCodegen (5) + Sort [ss_ticket_number,ss_item_sk,ss_customer_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk,ss_customer_sk] #4 + WholeStageCodegen (4) + Filter [ss_ticket_number,ss_item_sk,ss_customer_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (6) + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/explain.txt new file mode 100644 index 0000000000000..0598c5b81f90a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/explain.txt @@ -0,0 +1,195 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * HashAggregate (31) + +- Exchange (30) + +- * HashAggregate (29) + +- * Project (28) + +- * BroadcastHashJoin Inner BuildRight (27) + :- * Project (21) + : +- * BroadcastHashJoin Inner BuildRight (20) + : :- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.store_returns (4) + : : +- BroadcastExchange (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.store (10) + : +- BroadcastExchange (19) + : +- * Filter (18) + : +- * ColumnarToRow (17) + : +- Scan parquet default.date_dim (16) + +- BroadcastExchange (26) + +- * Project (25) + +- * Filter (24) + +- * ColumnarToRow (23) + +- Scan parquet default.date_dim (22) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5)] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 5] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_customer_sk#2)) AND isnotnull(ss_store_sk#3)) + +(4) Scan parquet default.store_returns +Output [4]: [sr_item_sk#6, sr_customer_sk#7, sr_ticket_number#8, sr_returned_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#9), dynamicpruningexpression(sr_returned_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk), IsNotNull(sr_customer_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [sr_item_sk#6, sr_customer_sk#7, sr_ticket_number#8, sr_returned_date_sk#9] + +(6) Filter [codegen id : 1] +Input [4]: [sr_item_sk#6, sr_customer_sk#7, sr_ticket_number#8, sr_returned_date_sk#9] +Condition : ((isnotnull(sr_ticket_number#8) AND isnotnull(sr_item_sk#6)) AND isnotnull(sr_customer_sk#7)) + +(7) BroadcastExchange +Input [4]: [sr_item_sk#6, sr_customer_sk#7, sr_ticket_number#8, sr_returned_date_sk#9] +Arguments: HashedRelationBroadcastMode(List(input[2, int, false], input[0, int, false], input[1, int, false]),false), [id=#11] + +(8) BroadcastHashJoin [codegen id : 5] +Left keys [3]: [ss_ticket_number#4, ss_item_sk#1, ss_customer_sk#2] +Right keys [3]: [sr_ticket_number#8, sr_item_sk#6, sr_customer_sk#7] +Join condition: None + +(9) Project [codegen id : 5] +Output [3]: [ss_store_sk#3, ss_sold_date_sk#5, sr_returned_date_sk#9] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, sr_item_sk#6, sr_customer_sk#7, sr_ticket_number#8, sr_returned_date_sk#9] + +(10) Scan parquet default.store +Output [11]: [s_store_sk#12, s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [11]: [s_store_sk#12, s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] + +(12) Filter [codegen id : 2] +Input [11]: [s_store_sk#12, s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] +Condition : isnotnull(s_store_sk#12) + +(13) BroadcastExchange +Input [11]: [s_store_sk#12, s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(14) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#12] +Join condition: None + +(15) Project [codegen id : 5] +Output [12]: [ss_sold_date_sk#5, sr_returned_date_sk#9, s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] +Input [14]: [ss_store_sk#3, ss_sold_date_sk#5, sr_returned_date_sk#9, s_store_sk#12, s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] + +(16) Scan parquet default.date_dim +Output [1]: [d_date_sk#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [1]: [d_date_sk#24] + +(18) Filter [codegen id : 3] +Input [1]: [d_date_sk#24] +Condition : isnotnull(d_date_sk#24) + +(19) BroadcastExchange +Input [1]: [d_date_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] + +(20) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(21) Project [codegen id : 5] +Output [12]: [ss_sold_date_sk#5, sr_returned_date_sk#9, s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] +Input [13]: [ss_sold_date_sk#5, sr_returned_date_sk#9, s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, d_date_sk#24] + +(22) Scan parquet default.date_dim +Output [3]: [d_date_sk#26, d_year#27, d_moy#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,8), IsNotNull(d_date_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 4] +Input [3]: [d_date_sk#26, d_year#27, d_moy#28] + +(24) Filter [codegen id : 4] +Input [3]: [d_date_sk#26, d_year#27, d_moy#28] +Condition : ((((isnotnull(d_year#27) AND isnotnull(d_moy#28)) AND (d_year#27 = 2001)) AND (d_moy#28 = 8)) AND isnotnull(d_date_sk#26)) + +(25) Project [codegen id : 4] +Output [1]: [d_date_sk#26] +Input [3]: [d_date_sk#26, d_year#27, d_moy#28] + +(26) BroadcastExchange +Input [1]: [d_date_sk#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] + +(27) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [sr_returned_date_sk#9] +Right keys [1]: [d_date_sk#26] +Join condition: None + +(28) Project [codegen id : 5] +Output [12]: [ss_sold_date_sk#5, sr_returned_date_sk#9, s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] +Input [13]: [ss_sold_date_sk#5, sr_returned_date_sk#9, s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, d_date_sk#26] + +(29) HashAggregate [codegen id : 5] +Input [12]: [ss_sold_date_sk#5, sr_returned_date_sk#9, s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] +Keys [10]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] +Functions [5]: [partial_sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 30) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 60) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 90) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum#30, sum#31, sum#32, sum#33, sum#34] +Results [15]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, sum#35, sum#36, sum#37, sum#38, sum#39] + +(30) Exchange +Input [15]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, sum#35, sum#36, sum#37, sum#38, sum#39] +Arguments: hashpartitioning(s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, 5), ENSURE_REQUIREMENTS, [id=#40] + +(31) HashAggregate [codegen id : 6] +Input [15]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, sum#35, sum#36, sum#37, sum#38, sum#39] +Keys [10]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22] +Functions [5]: [sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 30) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 60) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END), sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 90) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END), sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END)#41, sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 30) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END)#42, sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 60) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END)#43, sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 90) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END)#44, sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)#45] +Results [15]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END)#41 AS 30 days #46, sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 30) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END)#42 AS 31 - 60 days #47, sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 60) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END)#43 AS 61 - 90 days #48, sum(CASE WHEN (((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 90) AND ((sr_returned_date_sk#9 - ss_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END)#44 AS 91 - 120 days #49, sum(CASE WHEN ((sr_returned_date_sk#9 - ss_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)#45 AS >120 days #50] + +(32) TakeOrderedAndProject +Input [15]: [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, 30 days #46, 31 - 60 days #47, 61 - 90 days #48, 91 - 120 days #49, >120 days #50] +Arguments: 100, [s_store_name#13 ASC NULLS FIRST, s_company_id#14 ASC NULLS FIRST, s_street_number#15 ASC NULLS FIRST, s_street_name#16 ASC NULLS FIRST, s_street_type#17 ASC NULLS FIRST, s_suite_number#18 ASC NULLS FIRST, s_city#19 ASC NULLS FIRST, s_county#20 ASC NULLS FIRST, s_state#21 ASC NULLS FIRST, s_zip#22 ASC NULLS FIRST], [s_store_name#13, s_company_id#14, s_street_number#15, s_street_name#16, s_street_type#17, s_suite_number#18, s_city#19, s_county#20, s_state#21, s_zip#22, 30 days #46, 31 - 60 days #47, 61 - 90 days #48, 91 - 120 days #49, >120 days #50] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = sr_returned_date_sk#9 IN dynamicpruning#10 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#26] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/simplified.txt new file mode 100644 index 0000000000000..446b8705f3553 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q50/simplified.txt @@ -0,0 +1,50 @@ +TakeOrderedAndProject [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ] + WholeStageCodegen (6) + HashAggregate [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,sum,sum,sum,sum,sum] [sum(CASE WHEN ((sr_returned_date_sk - ss_sold_date_sk) <= 30) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_sk - ss_sold_date_sk) > 30) AND ((sr_returned_date_sk - ss_sold_date_sk) <= 60)) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_sk - ss_sold_date_sk) > 60) AND ((sr_returned_date_sk - ss_sold_date_sk) <= 90)) THEN 1 ELSE 0 END),sum(CASE WHEN (((sr_returned_date_sk - ss_sold_date_sk) > 90) AND ((sr_returned_date_sk - ss_sold_date_sk) <= 120)) THEN 1 ELSE 0 END),sum(CASE WHEN ((sr_returned_date_sk - ss_sold_date_sk) > 120) THEN 1 ELSE 0 END),30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ,sum,sum,sum,sum,sum] + InputAdapter + Exchange [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] #1 + WholeStageCodegen (5) + HashAggregate [s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip,sr_returned_date_sk,ss_sold_date_sk] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [ss_sold_date_sk,sr_returned_date_sk,s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Project [ss_sold_date_sk,sr_returned_date_sk,s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,sr_returned_date_sk,s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_sold_date_sk,sr_returned_date_sk] + BroadcastHashJoin [ss_ticket_number,ss_item_sk,ss_customer_sk,sr_ticket_number,sr_item_sk,sr_customer_sk] + Filter [ss_ticket_number,ss_item_sk,ss_customer_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [sr_ticket_number,sr_item_sk,sr_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_customer_sk,sr_ticket_number,sr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_company_id,s_street_number,s_street_name,s_street_type,s_suite_number,s_city,s_county,s_state,s_zip] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q51.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q51.sf100/explain.txt new file mode 100644 index 0000000000000..8fef2a0b3f023 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q51.sf100/explain.txt @@ -0,0 +1,242 @@ +== Physical Plan == +TakeOrderedAndProject (41) ++- * Filter (40) + +- Window (39) + +- * Sort (38) + +- Exchange (37) + +- * Project (36) + +- SortMergeJoin FullOuter (35) + :- * Sort (19) + : +- Exchange (18) + : +- * Project (17) + : +- Window (16) + : +- * Sort (15) + : +- Exchange (14) + : +- * HashAggregate (13) + : +- Exchange (12) + : +- * HashAggregate (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (34) + +- Exchange (33) + +- * Project (32) + +- Window (31) + +- * Sort (30) + +- Exchange (29) + +- * HashAggregate (28) + +- Exchange (27) + +- * HashAggregate (26) + +- * Project (25) + +- * BroadcastHashJoin Inner BuildRight (24) + :- * Filter (22) + : +- * ColumnarToRow (21) + : +- Scan parquet default.store_sales (20) + +- ReusedExchange (23) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3] +Condition : isnotnull(ws_item_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_date#6, d_month_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_date#6, d_month_seq#7] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_date#6, d_month_seq#7] +Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1200)) AND (d_month_seq#7 <= 1211)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#5, d_date#6] +Input [3]: [d_date_sk#5, d_date#6, d_month_seq#7] + +(8) BroadcastExchange +Input [2]: [d_date_sk#5, d_date#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 2] +Output [3]: [ws_item_sk#1, ws_sales_price#2, d_date#6] +Input [5]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3, d_date_sk#5, d_date#6] + +(11) HashAggregate [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_sales_price#2, d_date#6] +Keys [2]: [ws_item_sk#1, d_date#6] +Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#2))] +Aggregate Attributes [1]: [sum#9] +Results [3]: [ws_item_sk#1, d_date#6, sum#10] + +(12) Exchange +Input [3]: [ws_item_sk#1, d_date#6, sum#10] +Arguments: hashpartitioning(ws_item_sk#1, d_date#6, 5), ENSURE_REQUIREMENTS, [id=#11] + +(13) HashAggregate [codegen id : 3] +Input [3]: [ws_item_sk#1, d_date#6, sum#10] +Keys [2]: [ws_item_sk#1, d_date#6] +Functions [1]: [sum(UnscaledValue(ws_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#2))#12] +Results [4]: [ws_item_sk#1 AS item_sk#13, d_date#6, MakeDecimal(sum(UnscaledValue(ws_sales_price#2))#12,17,2) AS _w0#14, ws_item_sk#1] + +(14) Exchange +Input [4]: [item_sk#13, d_date#6, _w0#14, ws_item_sk#1] +Arguments: hashpartitioning(ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#15] + +(15) Sort [codegen id : 4] +Input [4]: [item_sk#13, d_date#6, _w0#14, ws_item_sk#1] +Arguments: [ws_item_sk#1 ASC NULLS FIRST, d_date#6 ASC NULLS FIRST], false, 0 + +(16) Window +Input [4]: [item_sk#13, d_date#6, _w0#14, ws_item_sk#1] +Arguments: [sum(_w0#14) windowspecdefinition(ws_item_sk#1, d_date#6 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS cume_sales#16], [ws_item_sk#1], [d_date#6 ASC NULLS FIRST] + +(17) Project [codegen id : 5] +Output [3]: [item_sk#13, d_date#6, cume_sales#16] +Input [5]: [item_sk#13, d_date#6, _w0#14, ws_item_sk#1, cume_sales#16] + +(18) Exchange +Input [3]: [item_sk#13, d_date#6, cume_sales#16] +Arguments: hashpartitioning(item_sk#13, d_date#6, 5), ENSURE_REQUIREMENTS, [id=#17] + +(19) Sort [codegen id : 6] +Input [3]: [item_sk#13, d_date#6, cume_sales#16] +Arguments: [item_sk#13 ASC NULLS FIRST, d_date#6 ASC NULLS FIRST], false, 0 + +(20) Scan parquet default.store_sales +Output [3]: [ss_item_sk#18, ss_sales_price#19, ss_sold_date_sk#20] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#20), dynamicpruningexpression(ss_sold_date_sk#20 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 8] +Input [3]: [ss_item_sk#18, ss_sales_price#19, ss_sold_date_sk#20] + +(22) Filter [codegen id : 8] +Input [3]: [ss_item_sk#18, ss_sales_price#19, ss_sold_date_sk#20] +Condition : isnotnull(ss_item_sk#18) + +(23) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#21, d_date#22] + +(24) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_sold_date_sk#20] +Right keys [1]: [d_date_sk#21] +Join condition: None + +(25) Project [codegen id : 8] +Output [3]: [ss_item_sk#18, ss_sales_price#19, d_date#22] +Input [5]: [ss_item_sk#18, ss_sales_price#19, ss_sold_date_sk#20, d_date_sk#21, d_date#22] + +(26) HashAggregate [codegen id : 8] +Input [3]: [ss_item_sk#18, ss_sales_price#19, d_date#22] +Keys [2]: [ss_item_sk#18, d_date#22] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#19))] +Aggregate Attributes [1]: [sum#23] +Results [3]: [ss_item_sk#18, d_date#22, sum#24] + +(27) Exchange +Input [3]: [ss_item_sk#18, d_date#22, sum#24] +Arguments: hashpartitioning(ss_item_sk#18, d_date#22, 5), ENSURE_REQUIREMENTS, [id=#25] + +(28) HashAggregate [codegen id : 9] +Input [3]: [ss_item_sk#18, d_date#22, sum#24] +Keys [2]: [ss_item_sk#18, d_date#22] +Functions [1]: [sum(UnscaledValue(ss_sales_price#19))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#19))#26] +Results [4]: [ss_item_sk#18 AS item_sk#27, d_date#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#19))#26,17,2) AS _w0#28, ss_item_sk#18] + +(29) Exchange +Input [4]: [item_sk#27, d_date#22, _w0#28, ss_item_sk#18] +Arguments: hashpartitioning(ss_item_sk#18, 5), ENSURE_REQUIREMENTS, [id=#29] + +(30) Sort [codegen id : 10] +Input [4]: [item_sk#27, d_date#22, _w0#28, ss_item_sk#18] +Arguments: [ss_item_sk#18 ASC NULLS FIRST, d_date#22 ASC NULLS FIRST], false, 0 + +(31) Window +Input [4]: [item_sk#27, d_date#22, _w0#28, ss_item_sk#18] +Arguments: [sum(_w0#28) windowspecdefinition(ss_item_sk#18, d_date#22 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS cume_sales#30], [ss_item_sk#18], [d_date#22 ASC NULLS FIRST] + +(32) Project [codegen id : 11] +Output [3]: [item_sk#27, d_date#22, cume_sales#30] +Input [5]: [item_sk#27, d_date#22, _w0#28, ss_item_sk#18, cume_sales#30] + +(33) Exchange +Input [3]: [item_sk#27, d_date#22, cume_sales#30] +Arguments: hashpartitioning(item_sk#27, d_date#22, 5), ENSURE_REQUIREMENTS, [id=#31] + +(34) Sort [codegen id : 12] +Input [3]: [item_sk#27, d_date#22, cume_sales#30] +Arguments: [item_sk#27 ASC NULLS FIRST, d_date#22 ASC NULLS FIRST], false, 0 + +(35) SortMergeJoin +Left keys [2]: [item_sk#13, d_date#6] +Right keys [2]: [item_sk#27, d_date#22] +Join condition: None + +(36) Project [codegen id : 13] +Output [4]: [CASE WHEN isnotnull(item_sk#13) THEN item_sk#13 ELSE item_sk#27 END AS item_sk#32, CASE WHEN isnotnull(d_date#6) THEN d_date#6 ELSE d_date#22 END AS d_date#33, cume_sales#16 AS web_sales#34, cume_sales#30 AS store_sales#35] +Input [6]: [item_sk#13, d_date#6, cume_sales#16, item_sk#27, d_date#22, cume_sales#30] + +(37) Exchange +Input [4]: [item_sk#32, d_date#33, web_sales#34, store_sales#35] +Arguments: hashpartitioning(item_sk#32, 5), ENSURE_REQUIREMENTS, [id=#36] + +(38) Sort [codegen id : 14] +Input [4]: [item_sk#32, d_date#33, web_sales#34, store_sales#35] +Arguments: [item_sk#32 ASC NULLS FIRST, d_date#33 ASC NULLS FIRST], false, 0 + +(39) Window +Input [4]: [item_sk#32, d_date#33, web_sales#34, store_sales#35] +Arguments: [max(web_sales#34) windowspecdefinition(item_sk#32, d_date#33 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS web_cumulative#37, max(store_sales#35) windowspecdefinition(item_sk#32, d_date#33 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS store_cumulative#38], [item_sk#32], [d_date#33 ASC NULLS FIRST] + +(40) Filter [codegen id : 15] +Input [6]: [item_sk#32, d_date#33, web_sales#34, store_sales#35, web_cumulative#37, store_cumulative#38] +Condition : ((isnotnull(web_cumulative#37) AND isnotnull(store_cumulative#38)) AND (web_cumulative#37 > store_cumulative#38)) + +(41) TakeOrderedAndProject +Input [6]: [item_sk#32, d_date#33, web_sales#34, store_sales#35, web_cumulative#37, store_cumulative#38] +Arguments: 100, [item_sk#32 ASC NULLS FIRST, d_date#33 ASC NULLS FIRST], [item_sk#32, d_date#33, web_sales#34, store_sales#35, web_cumulative#37, store_cumulative#38] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (42) + + +(42) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#5, d_date#6] + +Subquery:2 Hosting operator id = 20 Hosting Expression = ss_sold_date_sk#20 IN dynamicpruning#4 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q51.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q51.sf100/simplified.txt new file mode 100644 index 0000000000000..d9831cd015452 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q51.sf100/simplified.txt @@ -0,0 +1,74 @@ +TakeOrderedAndProject [item_sk,d_date,web_sales,store_sales,web_cumulative,store_cumulative] + WholeStageCodegen (15) + Filter [web_cumulative,store_cumulative] + InputAdapter + Window [web_sales,item_sk,d_date,store_sales] + WholeStageCodegen (14) + Sort [item_sk,d_date] + InputAdapter + Exchange [item_sk] #1 + WholeStageCodegen (13) + Project [item_sk,item_sk,d_date,d_date,cume_sales,cume_sales] + InputAdapter + SortMergeJoin [item_sk,d_date,item_sk,d_date] + WholeStageCodegen (6) + Sort [item_sk,d_date] + InputAdapter + Exchange [item_sk,d_date] #2 + WholeStageCodegen (5) + Project [item_sk,d_date,cume_sales] + InputAdapter + Window [_w0,ws_item_sk,d_date] + WholeStageCodegen (4) + Sort [ws_item_sk,d_date] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (3) + HashAggregate [ws_item_sk,d_date,sum] [sum(UnscaledValue(ws_sales_price)),item_sk,_w0,sum] + InputAdapter + Exchange [ws_item_sk,d_date] #4 + WholeStageCodegen (2) + HashAggregate [ws_item_sk,d_date,ws_sales_price] [sum,sum] + Project [ws_item_sk,ws_sales_price,d_date] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_sales_price,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk,d_date] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_month_seq] + WholeStageCodegen (12) + Sort [item_sk,d_date] + InputAdapter + Exchange [item_sk,d_date] #6 + WholeStageCodegen (11) + Project [item_sk,d_date,cume_sales] + InputAdapter + Window [_w0,ss_item_sk,d_date] + WholeStageCodegen (10) + Sort [ss_item_sk,d_date] + InputAdapter + Exchange [ss_item_sk] #7 + WholeStageCodegen (9) + HashAggregate [ss_item_sk,d_date,sum] [sum(UnscaledValue(ss_sales_price)),item_sk,_w0,sum] + InputAdapter + Exchange [ss_item_sk,d_date] #8 + WholeStageCodegen (8) + HashAggregate [ss_item_sk,d_date,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_sales_price,d_date] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_date] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q51/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q51/explain.txt new file mode 100644 index 0000000000000..8fef2a0b3f023 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q51/explain.txt @@ -0,0 +1,242 @@ +== Physical Plan == +TakeOrderedAndProject (41) ++- * Filter (40) + +- Window (39) + +- * Sort (38) + +- Exchange (37) + +- * Project (36) + +- SortMergeJoin FullOuter (35) + :- * Sort (19) + : +- Exchange (18) + : +- * Project (17) + : +- Window (16) + : +- * Sort (15) + : +- Exchange (14) + : +- * HashAggregate (13) + : +- Exchange (12) + : +- * HashAggregate (11) + : +- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- * Sort (34) + +- Exchange (33) + +- * Project (32) + +- Window (31) + +- * Sort (30) + +- Exchange (29) + +- * HashAggregate (28) + +- Exchange (27) + +- * HashAggregate (26) + +- * Project (25) + +- * BroadcastHashJoin Inner BuildRight (24) + :- * Filter (22) + : +- * ColumnarToRow (21) + : +- Scan parquet default.store_sales (20) + +- ReusedExchange (23) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3] +Condition : isnotnull(ws_item_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_date#6, d_month_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_date#6, d_month_seq#7] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_date#6, d_month_seq#7] +Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1200)) AND (d_month_seq#7 <= 1211)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#5, d_date#6] +Input [3]: [d_date_sk#5, d_date#6, d_month_seq#7] + +(8) BroadcastExchange +Input [2]: [d_date_sk#5, d_date#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 2] +Output [3]: [ws_item_sk#1, ws_sales_price#2, d_date#6] +Input [5]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3, d_date_sk#5, d_date#6] + +(11) HashAggregate [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_sales_price#2, d_date#6] +Keys [2]: [ws_item_sk#1, d_date#6] +Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#2))] +Aggregate Attributes [1]: [sum#9] +Results [3]: [ws_item_sk#1, d_date#6, sum#10] + +(12) Exchange +Input [3]: [ws_item_sk#1, d_date#6, sum#10] +Arguments: hashpartitioning(ws_item_sk#1, d_date#6, 5), ENSURE_REQUIREMENTS, [id=#11] + +(13) HashAggregate [codegen id : 3] +Input [3]: [ws_item_sk#1, d_date#6, sum#10] +Keys [2]: [ws_item_sk#1, d_date#6] +Functions [1]: [sum(UnscaledValue(ws_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#2))#12] +Results [4]: [ws_item_sk#1 AS item_sk#13, d_date#6, MakeDecimal(sum(UnscaledValue(ws_sales_price#2))#12,17,2) AS _w0#14, ws_item_sk#1] + +(14) Exchange +Input [4]: [item_sk#13, d_date#6, _w0#14, ws_item_sk#1] +Arguments: hashpartitioning(ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#15] + +(15) Sort [codegen id : 4] +Input [4]: [item_sk#13, d_date#6, _w0#14, ws_item_sk#1] +Arguments: [ws_item_sk#1 ASC NULLS FIRST, d_date#6 ASC NULLS FIRST], false, 0 + +(16) Window +Input [4]: [item_sk#13, d_date#6, _w0#14, ws_item_sk#1] +Arguments: [sum(_w0#14) windowspecdefinition(ws_item_sk#1, d_date#6 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS cume_sales#16], [ws_item_sk#1], [d_date#6 ASC NULLS FIRST] + +(17) Project [codegen id : 5] +Output [3]: [item_sk#13, d_date#6, cume_sales#16] +Input [5]: [item_sk#13, d_date#6, _w0#14, ws_item_sk#1, cume_sales#16] + +(18) Exchange +Input [3]: [item_sk#13, d_date#6, cume_sales#16] +Arguments: hashpartitioning(item_sk#13, d_date#6, 5), ENSURE_REQUIREMENTS, [id=#17] + +(19) Sort [codegen id : 6] +Input [3]: [item_sk#13, d_date#6, cume_sales#16] +Arguments: [item_sk#13 ASC NULLS FIRST, d_date#6 ASC NULLS FIRST], false, 0 + +(20) Scan parquet default.store_sales +Output [3]: [ss_item_sk#18, ss_sales_price#19, ss_sold_date_sk#20] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#20), dynamicpruningexpression(ss_sold_date_sk#20 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 8] +Input [3]: [ss_item_sk#18, ss_sales_price#19, ss_sold_date_sk#20] + +(22) Filter [codegen id : 8] +Input [3]: [ss_item_sk#18, ss_sales_price#19, ss_sold_date_sk#20] +Condition : isnotnull(ss_item_sk#18) + +(23) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#21, d_date#22] + +(24) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_sold_date_sk#20] +Right keys [1]: [d_date_sk#21] +Join condition: None + +(25) Project [codegen id : 8] +Output [3]: [ss_item_sk#18, ss_sales_price#19, d_date#22] +Input [5]: [ss_item_sk#18, ss_sales_price#19, ss_sold_date_sk#20, d_date_sk#21, d_date#22] + +(26) HashAggregate [codegen id : 8] +Input [3]: [ss_item_sk#18, ss_sales_price#19, d_date#22] +Keys [2]: [ss_item_sk#18, d_date#22] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#19))] +Aggregate Attributes [1]: [sum#23] +Results [3]: [ss_item_sk#18, d_date#22, sum#24] + +(27) Exchange +Input [3]: [ss_item_sk#18, d_date#22, sum#24] +Arguments: hashpartitioning(ss_item_sk#18, d_date#22, 5), ENSURE_REQUIREMENTS, [id=#25] + +(28) HashAggregate [codegen id : 9] +Input [3]: [ss_item_sk#18, d_date#22, sum#24] +Keys [2]: [ss_item_sk#18, d_date#22] +Functions [1]: [sum(UnscaledValue(ss_sales_price#19))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#19))#26] +Results [4]: [ss_item_sk#18 AS item_sk#27, d_date#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#19))#26,17,2) AS _w0#28, ss_item_sk#18] + +(29) Exchange +Input [4]: [item_sk#27, d_date#22, _w0#28, ss_item_sk#18] +Arguments: hashpartitioning(ss_item_sk#18, 5), ENSURE_REQUIREMENTS, [id=#29] + +(30) Sort [codegen id : 10] +Input [4]: [item_sk#27, d_date#22, _w0#28, ss_item_sk#18] +Arguments: [ss_item_sk#18 ASC NULLS FIRST, d_date#22 ASC NULLS FIRST], false, 0 + +(31) Window +Input [4]: [item_sk#27, d_date#22, _w0#28, ss_item_sk#18] +Arguments: [sum(_w0#28) windowspecdefinition(ss_item_sk#18, d_date#22 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS cume_sales#30], [ss_item_sk#18], [d_date#22 ASC NULLS FIRST] + +(32) Project [codegen id : 11] +Output [3]: [item_sk#27, d_date#22, cume_sales#30] +Input [5]: [item_sk#27, d_date#22, _w0#28, ss_item_sk#18, cume_sales#30] + +(33) Exchange +Input [3]: [item_sk#27, d_date#22, cume_sales#30] +Arguments: hashpartitioning(item_sk#27, d_date#22, 5), ENSURE_REQUIREMENTS, [id=#31] + +(34) Sort [codegen id : 12] +Input [3]: [item_sk#27, d_date#22, cume_sales#30] +Arguments: [item_sk#27 ASC NULLS FIRST, d_date#22 ASC NULLS FIRST], false, 0 + +(35) SortMergeJoin +Left keys [2]: [item_sk#13, d_date#6] +Right keys [2]: [item_sk#27, d_date#22] +Join condition: None + +(36) Project [codegen id : 13] +Output [4]: [CASE WHEN isnotnull(item_sk#13) THEN item_sk#13 ELSE item_sk#27 END AS item_sk#32, CASE WHEN isnotnull(d_date#6) THEN d_date#6 ELSE d_date#22 END AS d_date#33, cume_sales#16 AS web_sales#34, cume_sales#30 AS store_sales#35] +Input [6]: [item_sk#13, d_date#6, cume_sales#16, item_sk#27, d_date#22, cume_sales#30] + +(37) Exchange +Input [4]: [item_sk#32, d_date#33, web_sales#34, store_sales#35] +Arguments: hashpartitioning(item_sk#32, 5), ENSURE_REQUIREMENTS, [id=#36] + +(38) Sort [codegen id : 14] +Input [4]: [item_sk#32, d_date#33, web_sales#34, store_sales#35] +Arguments: [item_sk#32 ASC NULLS FIRST, d_date#33 ASC NULLS FIRST], false, 0 + +(39) Window +Input [4]: [item_sk#32, d_date#33, web_sales#34, store_sales#35] +Arguments: [max(web_sales#34) windowspecdefinition(item_sk#32, d_date#33 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS web_cumulative#37, max(store_sales#35) windowspecdefinition(item_sk#32, d_date#33 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS store_cumulative#38], [item_sk#32], [d_date#33 ASC NULLS FIRST] + +(40) Filter [codegen id : 15] +Input [6]: [item_sk#32, d_date#33, web_sales#34, store_sales#35, web_cumulative#37, store_cumulative#38] +Condition : ((isnotnull(web_cumulative#37) AND isnotnull(store_cumulative#38)) AND (web_cumulative#37 > store_cumulative#38)) + +(41) TakeOrderedAndProject +Input [6]: [item_sk#32, d_date#33, web_sales#34, store_sales#35, web_cumulative#37, store_cumulative#38] +Arguments: 100, [item_sk#32 ASC NULLS FIRST, d_date#33 ASC NULLS FIRST], [item_sk#32, d_date#33, web_sales#34, store_sales#35, web_cumulative#37, store_cumulative#38] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (42) + + +(42) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#5, d_date#6] + +Subquery:2 Hosting operator id = 20 Hosting Expression = ss_sold_date_sk#20 IN dynamicpruning#4 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q51/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q51/simplified.txt new file mode 100644 index 0000000000000..d9831cd015452 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q51/simplified.txt @@ -0,0 +1,74 @@ +TakeOrderedAndProject [item_sk,d_date,web_sales,store_sales,web_cumulative,store_cumulative] + WholeStageCodegen (15) + Filter [web_cumulative,store_cumulative] + InputAdapter + Window [web_sales,item_sk,d_date,store_sales] + WholeStageCodegen (14) + Sort [item_sk,d_date] + InputAdapter + Exchange [item_sk] #1 + WholeStageCodegen (13) + Project [item_sk,item_sk,d_date,d_date,cume_sales,cume_sales] + InputAdapter + SortMergeJoin [item_sk,d_date,item_sk,d_date] + WholeStageCodegen (6) + Sort [item_sk,d_date] + InputAdapter + Exchange [item_sk,d_date] #2 + WholeStageCodegen (5) + Project [item_sk,d_date,cume_sales] + InputAdapter + Window [_w0,ws_item_sk,d_date] + WholeStageCodegen (4) + Sort [ws_item_sk,d_date] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (3) + HashAggregate [ws_item_sk,d_date,sum] [sum(UnscaledValue(ws_sales_price)),item_sk,_w0,sum] + InputAdapter + Exchange [ws_item_sk,d_date] #4 + WholeStageCodegen (2) + HashAggregate [ws_item_sk,d_date,ws_sales_price] [sum,sum] + Project [ws_item_sk,ws_sales_price,d_date] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_sales_price,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk,d_date] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_month_seq] + WholeStageCodegen (12) + Sort [item_sk,d_date] + InputAdapter + Exchange [item_sk,d_date] #6 + WholeStageCodegen (11) + Project [item_sk,d_date,cume_sales] + InputAdapter + Window [_w0,ss_item_sk,d_date] + WholeStageCodegen (10) + Sort [ss_item_sk,d_date] + InputAdapter + Exchange [ss_item_sk] #7 + WholeStageCodegen (9) + HashAggregate [ss_item_sk,d_date,sum] [sum(UnscaledValue(ss_sales_price)),item_sk,_w0,sum] + InputAdapter + Exchange [ss_item_sk,d_date] #8 + WholeStageCodegen (8) + HashAggregate [ss_item_sk,d_date,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_sales_price,d_date] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_date] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/explain.txt new file mode 100644 index 0000000000000..aa943cd6a7473 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/explain.txt @@ -0,0 +1,133 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.date_dim (11) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manager_id#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manager_id#8] + +(6) Filter [codegen id : 1] +Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manager_id#8] +Condition : ((isnotnull(i_manager_id#8) AND (i_manager_id#8 = 1)) AND isnotnull(i_item_sk#5)) + +(7) Project [codegen id : 1] +Output [3]: [i_item_sk#5, i_brand_id#6, i_brand#7] +Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manager_id#8] + +(8) BroadcastExchange +Input [3]: [i_item_sk#5, i_brand_id#6, i_brand#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(10) Project [codegen id : 3] +Output [4]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_brand_id#6, i_brand#7] +Input [6]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_sk#5, i_brand_id#6, i_brand#7] + +(11) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(13) Filter [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Condition : ((((isnotnull(d_moy#12) AND isnotnull(d_year#11)) AND (d_moy#12 = 11)) AND (d_year#11 = 2000)) AND isnotnull(d_date_sk#10)) + +(14) Project [codegen id : 2] +Output [2]: [d_date_sk#10, d_year#11] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(15) BroadcastExchange +Input [2]: [d_date_sk#10, d_year#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_year#11, ss_ext_sales_price#2, i_brand_id#6, i_brand#7] +Input [6]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_brand_id#6, i_brand#7, d_date_sk#10, d_year#11] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_year#11, ss_ext_sales_price#2, i_brand_id#6, i_brand#7] +Keys [3]: [d_year#11, i_brand#7, i_brand_id#6] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#14] +Results [4]: [d_year#11, i_brand#7, i_brand_id#6, sum#15] + +(19) Exchange +Input [4]: [d_year#11, i_brand#7, i_brand_id#6, sum#15] +Arguments: hashpartitioning(d_year#11, i_brand#7, i_brand_id#6, 5), ENSURE_REQUIREMENTS, [id=#16] + +(20) HashAggregate [codegen id : 4] +Input [4]: [d_year#11, i_brand#7, i_brand_id#6, sum#15] +Keys [3]: [d_year#11, i_brand#7, i_brand_id#6] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#17] +Results [4]: [d_year#11, i_brand_id#6 AS brand_id#18, i_brand#7 AS brand#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#17,17,2) AS ext_price#20] + +(21) TakeOrderedAndProject +Input [4]: [d_year#11, brand_id#18, brand#19, ext_price#20] +Arguments: 100, [d_year#11 ASC NULLS FIRST, ext_price#20 DESC NULLS LAST, brand_id#18 ASC NULLS FIRST], [d_year#11, brand_id#18, brand#19, ext_price#20] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (22) + + +(22) ReusedExchange [Reuses operator id: 15] +Output [2]: [d_date_sk#10, d_year#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/simplified.txt new file mode 100644 index 0000000000000..c00005c8eb798 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52.sf100/simplified.txt @@ -0,0 +1,33 @@ +TakeOrderedAndProject [d_year,ext_price,brand_id,brand] + WholeStageCodegen (4) + HashAggregate [d_year,i_brand,i_brand_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [d_year,i_brand,i_brand_id] #1 + WholeStageCodegen (3) + HashAggregate [d_year,i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] + Project [d_year,ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_ext_sales_price,ss_sold_date_sk,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk,d_year] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52/explain.txt new file mode 100644 index 0000000000000..e6e106706fb07 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52/explain.txt @@ -0,0 +1,123 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- BroadcastExchange (8) + : +- * Filter (7) + : +- * ColumnarToRow (6) + : +- Scan parquet default.store_sales (5) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 11)) AND (d_year#2 = 2000)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 3] +Output [2]: [d_date_sk#1, d_year#2] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) Scan parquet default.store_sales +Output [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(7) Filter [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Condition : isnotnull(ss_item_sk#4) + +(8) BroadcastExchange +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5] +Input [5]: [d_date_sk#1, d_year#2, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(11) Scan parquet default.item +Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] + +(13) Filter [codegen id : 2] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] +Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 1)) AND isnotnull(i_item_sk#8)) + +(14) Project [codegen id : 2] +Output [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] + +(15) BroadcastExchange +Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#4] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(17) Project [codegen id : 3] +Output [4]: [d_year#2, ss_ext_sales_price#5, i_brand_id#9, i_brand#10] +Input [6]: [d_year#2, ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_brand_id#9, i_brand#10] + +(18) HashAggregate [codegen id : 3] +Input [4]: [d_year#2, ss_ext_sales_price#5, i_brand_id#9, i_brand#10] +Keys [3]: [d_year#2, i_brand#10, i_brand_id#9] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum#13] +Results [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] + +(19) Exchange +Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] +Arguments: hashpartitioning(d_year#2, i_brand#10, i_brand_id#9, 5), ENSURE_REQUIREMENTS, [id=#15] + +(20) HashAggregate [codegen id : 4] +Input [4]: [d_year#2, i_brand#10, i_brand_id#9, sum#14] +Keys [3]: [d_year#2, i_brand#10, i_brand_id#9] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#16] +Results [4]: [d_year#2, i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#16,17,2) AS ext_price#19] + +(21) TakeOrderedAndProject +Input [4]: [d_year#2, brand_id#17, brand#18, ext_price#19] +Arguments: 100, [d_year#2 ASC NULLS FIRST, ext_price#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [d_year#2, brand_id#17, brand#18, ext_price#19] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52/simplified.txt new file mode 100644 index 0000000000000..d16dd603ec66a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q52/simplified.txt @@ -0,0 +1,31 @@ +TakeOrderedAndProject [d_year,ext_price,brand_id,brand] + WholeStageCodegen (4) + HashAggregate [d_year,i_brand,i_brand_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [d_year,i_brand,i_brand_id] #1 + WholeStageCodegen (3) + HashAggregate [d_year,i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] + Project [d_year,ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [d_year,ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [d_date_sk,d_year] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/explain.txt new file mode 100644 index 0000000000000..e0cd0729e0e32 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * Project (31) + +- * Filter (30) + +- Window (29) + +- * Sort (28) + +- Exchange (27) + +- * HashAggregate (26) + +- Exchange (25) + +- * HashAggregate (24) + +- * Project (23) + +- * BroadcastHashJoin Inner BuildRight (22) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.store_sales (6) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.store (11) + +- BroadcastExchange (21) + +- * Project (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.date_dim (17) + + +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books ,Children ,Electronics ]),In(i_class, [personal ,portable ,reference ,self-help ])),In(i_brand, [scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 ])),And(And(In(i_category, [Women ,Music ,Men ]),In(i_class, [accessories ,classical ,fragrances ,pants ])),In(i_brand, [amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] + +(3) Filter [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] +Condition : ((((i_category#4 IN (Books ,Children ,Electronics ) AND i_class#3 IN (personal ,portable ,reference ,self-help )) AND i_brand#2 IN (scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 )) OR ((i_category#4 IN (Women ,Music ,Men ) AND i_class#3 IN (accessories ,classical ,fragrances ,pants )) AND i_brand#2 IN (amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ))) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [i_item_sk#1, i_manufact_id#5] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] + +(5) BroadcastExchange +Input [2]: [i_item_sk#1, i_manufact_id#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(6) Scan parquet default.store_sales +Output [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#14), dynamicpruningexpression(ss_sold_date_sk#14 IN dynamicpruning#15)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] + +(8) Filter +Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] +Condition : (isnotnull(ss_item_sk#11) AND isnotnull(ss_store_sk#12)) + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#11] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [i_manufact_id#5, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] +Input [6]: [i_item_sk#1, i_manufact_id#5, ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] + +(11) Scan parquet default.store +Output [1]: [s_store_sk#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [1]: [s_store_sk#16] + +(13) Filter [codegen id : 2] +Input [1]: [s_store_sk#16] +Condition : isnotnull(s_store_sk#16) + +(14) BroadcastExchange +Input [1]: [s_store_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#12] +Right keys [1]: [s_store_sk#16] +Join condition: None + +(16) Project [codegen id : 4] +Output [3]: [i_manufact_id#5, ss_sales_price#13, ss_sold_date_sk#14] +Input [5]: [i_manufact_id#5, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14, s_store_sk#16] + +(17) Scan parquet default.date_dim +Output [3]: [d_date_sk#18, d_month_seq#19, d_qoy#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_month_seq, [1200,1211,1205,1201,1206,1210,1207,1202,1209,1203,1208,1204]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#18, d_month_seq#19, d_qoy#20] + +(19) Filter [codegen id : 3] +Input [3]: [d_date_sk#18, d_month_seq#19, d_qoy#20] +Condition : (d_month_seq#19 INSET (1200,1211,1205,1201,1206,1210,1207,1202,1209,1203,1208,1204) AND isnotnull(d_date_sk#18)) + +(20) Project [codegen id : 3] +Output [2]: [d_date_sk#18, d_qoy#20] +Input [3]: [d_date_sk#18, d_month_seq#19, d_qoy#20] + +(21) BroadcastExchange +Input [2]: [d_date_sk#18, d_qoy#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#14] +Right keys [1]: [d_date_sk#18] +Join condition: None + +(23) Project [codegen id : 4] +Output [3]: [i_manufact_id#5, ss_sales_price#13, d_qoy#20] +Input [5]: [i_manufact_id#5, ss_sales_price#13, ss_sold_date_sk#14, d_date_sk#18, d_qoy#20] + +(24) HashAggregate [codegen id : 4] +Input [3]: [i_manufact_id#5, ss_sales_price#13, d_qoy#20] +Keys [2]: [i_manufact_id#5, d_qoy#20] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#13))] +Aggregate Attributes [1]: [sum#22] +Results [3]: [i_manufact_id#5, d_qoy#20, sum#23] + +(25) Exchange +Input [3]: [i_manufact_id#5, d_qoy#20, sum#23] +Arguments: hashpartitioning(i_manufact_id#5, d_qoy#20, 5), ENSURE_REQUIREMENTS, [id=#24] + +(26) HashAggregate [codegen id : 5] +Input [3]: [i_manufact_id#5, d_qoy#20, sum#23] +Keys [2]: [i_manufact_id#5, d_qoy#20] +Functions [1]: [sum(UnscaledValue(ss_sales_price#13))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#13))#25] +Results [3]: [i_manufact_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#25,17,2) AS sum_sales#26, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#25,17,2) AS _w0#27] + +(27) Exchange +Input [3]: [i_manufact_id#5, sum_sales#26, _w0#27] +Arguments: hashpartitioning(i_manufact_id#5, 5), ENSURE_REQUIREMENTS, [id=#28] + +(28) Sort [codegen id : 6] +Input [3]: [i_manufact_id#5, sum_sales#26, _w0#27] +Arguments: [i_manufact_id#5 ASC NULLS FIRST], false, 0 + +(29) Window +Input [3]: [i_manufact_id#5, sum_sales#26, _w0#27] +Arguments: [avg(_w0#27) windowspecdefinition(i_manufact_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_quarterly_sales#29], [i_manufact_id#5] + +(30) Filter [codegen id : 7] +Input [4]: [i_manufact_id#5, sum_sales#26, _w0#27, avg_quarterly_sales#29] +Condition : (isnotnull(avg_quarterly_sales#29) AND ((avg_quarterly_sales#29 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#26 as decimal(22,6))) - promote_precision(cast(avg_quarterly_sales#29 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_quarterly_sales#29 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000))) + +(31) Project [codegen id : 7] +Output [3]: [i_manufact_id#5, sum_sales#26, avg_quarterly_sales#29] +Input [4]: [i_manufact_id#5, sum_sales#26, _w0#27, avg_quarterly_sales#29] + +(32) TakeOrderedAndProject +Input [3]: [i_manufact_id#5, sum_sales#26, avg_quarterly_sales#29] +Arguments: 100, [avg_quarterly_sales#29 ASC NULLS FIRST, sum_sales#26 ASC NULLS FIRST, i_manufact_id#5 ASC NULLS FIRST], [i_manufact_id#5, sum_sales#26, avg_quarterly_sales#29] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#14 IN dynamicpruning#15 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 21] +Output [2]: [d_date_sk#18, d_qoy#20] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/simplified.txt new file mode 100644 index 0000000000000..2e57ebbc0e801 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53.sf100/simplified.txt @@ -0,0 +1,51 @@ +TakeOrderedAndProject [avg_quarterly_sales,sum_sales,i_manufact_id] + WholeStageCodegen (7) + Project [i_manufact_id,sum_sales,avg_quarterly_sales] + Filter [avg_quarterly_sales,sum_sales] + InputAdapter + Window [_w0,i_manufact_id] + WholeStageCodegen (6) + Sort [i_manufact_id] + InputAdapter + Exchange [i_manufact_id] #1 + WholeStageCodegen (5) + HashAggregate [i_manufact_id,d_qoy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_manufact_id,d_qoy] #2 + WholeStageCodegen (4) + HashAggregate [i_manufact_id,d_qoy,ss_sales_price] [sum,sum] + Project [i_manufact_id,ss_sales_price,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_manufact_id,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_manufact_id,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_manufact_id] + Filter [i_category,i_class,i_brand,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manufact_id] + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_qoy] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [d_date_sk,d_qoy] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq,d_qoy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53/explain.txt new file mode 100644 index 0000000000000..3bf06577e3212 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * Project (31) + +- * Filter (30) + +- Window (29) + +- * Sort (28) + +- Exchange (27) + +- * HashAggregate (26) + +- Exchange (25) + +- * HashAggregate (24) + +- * Project (23) + +- * BroadcastHashJoin Inner BuildRight (22) + :- * Project (17) + : +- * BroadcastHashJoin Inner BuildRight (16) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- BroadcastExchange (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.store_sales (5) + : +- BroadcastExchange (15) + : +- * Project (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.date_dim (11) + +- BroadcastExchange (21) + +- * Filter (20) + +- * ColumnarToRow (19) + +- Scan parquet default.store (18) + + +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books ,Children ,Electronics ]),In(i_class, [personal ,portable ,reference ,self-help ])),In(i_brand, [scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 ])),And(And(In(i_category, [Women ,Music ,Men ]),In(i_class, [accessories ,classical ,fragrances ,pants ])),In(i_brand, [amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] + +(3) Filter [codegen id : 4] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] +Condition : ((((i_category#4 IN (Books ,Children ,Electronics ) AND i_class#3 IN (personal ,portable ,reference ,self-help )) AND i_brand#2 IN (scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 )) OR ((i_category#4 IN (Women ,Music ,Men ) AND i_class#3 IN (accessories ,classical ,fragrances ,pants )) AND i_brand#2 IN (amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ))) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 4] +Output [2]: [i_item_sk#1, i_manufact_id#5] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manufact_id#5] + +(5) Scan parquet default.store_sales +Output [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#13), dynamicpruningexpression(ss_sold_date_sk#13 IN dynamicpruning#14)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] + +(7) Filter [codegen id : 1] +Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Condition : (isnotnull(ss_item_sk#10) AND isnotnull(ss_store_sk#11)) + +(8) BroadcastExchange +Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#10] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Input [6]: [i_item_sk#1, i_manufact_id#5, ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] + +(11) Scan parquet default.date_dim +Output [3]: [d_date_sk#16, d_month_seq#17, d_qoy#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_month_seq, [1200,1211,1205,1201,1206,1210,1207,1202,1209,1203,1208,1204]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#16, d_month_seq#17, d_qoy#18] + +(13) Filter [codegen id : 2] +Input [3]: [d_date_sk#16, d_month_seq#17, d_qoy#18] +Condition : (d_month_seq#17 INSET (1200,1211,1205,1201,1206,1210,1207,1202,1209,1203,1208,1204) AND isnotnull(d_date_sk#16)) + +(14) Project [codegen id : 2] +Output [2]: [d_date_sk#16, d_qoy#18] +Input [3]: [d_date_sk#16, d_month_seq#17, d_qoy#18] + +(15) BroadcastExchange +Input [2]: [d_date_sk#16, d_qoy#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#13] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(17) Project [codegen id : 4] +Output [4]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, d_qoy#18] +Input [6]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13, d_date_sk#16, d_qoy#18] + +(18) Scan parquet default.store +Output [1]: [s_store_sk#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [1]: [s_store_sk#20] + +(20) Filter [codegen id : 3] +Input [1]: [s_store_sk#20] +Condition : isnotnull(s_store_sk#20) + +(21) BroadcastExchange +Input [1]: [s_store_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#11] +Right keys [1]: [s_store_sk#20] +Join condition: None + +(23) Project [codegen id : 4] +Output [3]: [i_manufact_id#5, ss_sales_price#12, d_qoy#18] +Input [5]: [i_manufact_id#5, ss_store_sk#11, ss_sales_price#12, d_qoy#18, s_store_sk#20] + +(24) HashAggregate [codegen id : 4] +Input [3]: [i_manufact_id#5, ss_sales_price#12, d_qoy#18] +Keys [2]: [i_manufact_id#5, d_qoy#18] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#12))] +Aggregate Attributes [1]: [sum#22] +Results [3]: [i_manufact_id#5, d_qoy#18, sum#23] + +(25) Exchange +Input [3]: [i_manufact_id#5, d_qoy#18, sum#23] +Arguments: hashpartitioning(i_manufact_id#5, d_qoy#18, 5), ENSURE_REQUIREMENTS, [id=#24] + +(26) HashAggregate [codegen id : 5] +Input [3]: [i_manufact_id#5, d_qoy#18, sum#23] +Keys [2]: [i_manufact_id#5, d_qoy#18] +Functions [1]: [sum(UnscaledValue(ss_sales_price#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#12))#25] +Results [3]: [i_manufact_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#25,17,2) AS sum_sales#26, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#25,17,2) AS _w0#27] + +(27) Exchange +Input [3]: [i_manufact_id#5, sum_sales#26, _w0#27] +Arguments: hashpartitioning(i_manufact_id#5, 5), ENSURE_REQUIREMENTS, [id=#28] + +(28) Sort [codegen id : 6] +Input [3]: [i_manufact_id#5, sum_sales#26, _w0#27] +Arguments: [i_manufact_id#5 ASC NULLS FIRST], false, 0 + +(29) Window +Input [3]: [i_manufact_id#5, sum_sales#26, _w0#27] +Arguments: [avg(_w0#27) windowspecdefinition(i_manufact_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_quarterly_sales#29], [i_manufact_id#5] + +(30) Filter [codegen id : 7] +Input [4]: [i_manufact_id#5, sum_sales#26, _w0#27, avg_quarterly_sales#29] +Condition : (isnotnull(avg_quarterly_sales#29) AND ((avg_quarterly_sales#29 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#26 as decimal(22,6))) - promote_precision(cast(avg_quarterly_sales#29 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_quarterly_sales#29 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000))) + +(31) Project [codegen id : 7] +Output [3]: [i_manufact_id#5, sum_sales#26, avg_quarterly_sales#29] +Input [4]: [i_manufact_id#5, sum_sales#26, _w0#27, avg_quarterly_sales#29] + +(32) TakeOrderedAndProject +Input [3]: [i_manufact_id#5, sum_sales#26, avg_quarterly_sales#29] +Arguments: 100, [avg_quarterly_sales#29 ASC NULLS FIRST, sum_sales#26 ASC NULLS FIRST, i_manufact_id#5 ASC NULLS FIRST], [i_manufact_id#5, sum_sales#26, avg_quarterly_sales#29] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 5 Hosting Expression = ss_sold_date_sk#13 IN dynamicpruning#14 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 15] +Output [2]: [d_date_sk#16, d_qoy#18] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53/simplified.txt new file mode 100644 index 0000000000000..d67def8b728c1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q53/simplified.txt @@ -0,0 +1,51 @@ +TakeOrderedAndProject [avg_quarterly_sales,sum_sales,i_manufact_id] + WholeStageCodegen (7) + Project [i_manufact_id,sum_sales,avg_quarterly_sales] + Filter [avg_quarterly_sales,sum_sales] + InputAdapter + Window [_w0,i_manufact_id] + WholeStageCodegen (6) + Sort [i_manufact_id] + InputAdapter + Exchange [i_manufact_id] #1 + WholeStageCodegen (5) + HashAggregate [i_manufact_id,d_qoy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_manufact_id,d_qoy] #2 + WholeStageCodegen (4) + HashAggregate [i_manufact_id,d_qoy,ss_sales_price] [sum,sum] + Project [i_manufact_id,ss_sales_price,d_qoy] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_manufact_id,ss_store_sk,ss_sales_price,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_manufact_id,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [i_item_sk,i_manufact_id] + Filter [i_category,i_class,i_brand,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manufact_id] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_qoy] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk,d_qoy] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq,d_qoy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/explain.txt new file mode 100644 index 0000000000000..b149bdd3e1e3f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/explain.txt @@ -0,0 +1,493 @@ +== Physical Plan == +TakeOrderedAndProject (67) ++- * HashAggregate (66) + +- Exchange (65) + +- * HashAggregate (64) + +- * HashAggregate (63) + +- * HashAggregate (62) + +- * Project (61) + +- * SortMergeJoin Inner (60) + :- * Sort (47) + : +- * Project (46) + : +- * BroadcastHashJoin Inner BuildLeft (45) + : :- BroadcastExchange (10) + : : +- * Project (9) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.customer_address (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.store (4) + : +- * HashAggregate (44) + : +- * HashAggregate (43) + : +- * Project (42) + : +- * SortMergeJoin Inner (41) + : :- * Sort (35) + : : +- Exchange (34) + : : +- * Project (33) + : : +- * BroadcastHashJoin Inner BuildRight (32) + : : :- * Project (26) + : : : +- * BroadcastHashJoin Inner BuildRight (25) + : : : :- Union (19) + : : : : :- * Project (14) + : : : : : +- * Filter (13) + : : : : : +- * ColumnarToRow (12) + : : : : : +- Scan parquet default.catalog_sales (11) + : : : : +- * Project (18) + : : : : +- * Filter (17) + : : : : +- * ColumnarToRow (16) + : : : : +- Scan parquet default.web_sales (15) + : : : +- BroadcastExchange (24) + : : : +- * Project (23) + : : : +- * Filter (22) + : : : +- * ColumnarToRow (21) + : : : +- Scan parquet default.date_dim (20) + : : +- BroadcastExchange (31) + : : +- * Project (30) + : : +- * Filter (29) + : : +- * ColumnarToRow (28) + : : +- Scan parquet default.item (27) + : +- * Sort (40) + : +- Exchange (39) + : +- * Filter (38) + : +- * ColumnarToRow (37) + : +- Scan parquet default.customer (36) + +- * Sort (59) + +- Exchange (58) + +- * Project (57) + +- * BroadcastHashJoin Inner BuildRight (56) + :- * Filter (50) + : +- * ColumnarToRow (49) + : +- Scan parquet default.store_sales (48) + +- BroadcastExchange (55) + +- * Project (54) + +- * Filter (53) + +- * ColumnarToRow (52) + +- Scan parquet default.date_dim (51) + + +(1) Scan parquet default.customer_address +Output [3]: [ca_address_sk#1, ca_county#2, ca_state#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_county), IsNotNull(ca_state)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ca_address_sk#1, ca_county#2, ca_state#3] + +(3) Filter [codegen id : 2] +Input [3]: [ca_address_sk#1, ca_county#2, ca_state#3] +Condition : ((isnotnull(ca_address_sk#1) AND isnotnull(ca_county#2)) AND isnotnull(ca_state#3)) + +(4) Scan parquet default.store +Output [2]: [s_county#4, s_state#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_county), IsNotNull(s_state)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [s_county#4, s_state#5] + +(6) Filter [codegen id : 1] +Input [2]: [s_county#4, s_state#5] +Condition : (isnotnull(s_county#4) AND isnotnull(s_state#5)) + +(7) BroadcastExchange +Input [2]: [s_county#4, s_state#5] +Arguments: HashedRelationBroadcastMode(List(input[0, string, false], input[1, string, false]),false), [id=#6] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [2]: [ca_county#2, ca_state#3] +Right keys [2]: [s_county#4, s_state#5] +Join condition: None + +(9) Project [codegen id : 2] +Output [1]: [ca_address_sk#1] +Input [5]: [ca_address_sk#1, ca_county#2, ca_state#3, s_county#4, s_state#5] + +(10) BroadcastExchange +Input [1]: [ca_address_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(11) Scan parquet default.catalog_sales +Output [3]: [cs_bill_customer_sk#8, cs_item_sk#9, cs_sold_date_sk#10] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#10), dynamicpruningexpression(cs_sold_date_sk#10 IN dynamicpruning#11)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 3] +Input [3]: [cs_bill_customer_sk#8, cs_item_sk#9, cs_sold_date_sk#10] + +(13) Filter [codegen id : 3] +Input [3]: [cs_bill_customer_sk#8, cs_item_sk#9, cs_sold_date_sk#10] +Condition : (isnotnull(cs_item_sk#9) AND isnotnull(cs_bill_customer_sk#8)) + +(14) Project [codegen id : 3] +Output [3]: [cs_sold_date_sk#10 AS sold_date_sk#12, cs_bill_customer_sk#8 AS customer_sk#13, cs_item_sk#9 AS item_sk#14] +Input [3]: [cs_bill_customer_sk#8, cs_item_sk#9, cs_sold_date_sk#10] + +(15) Scan parquet default.web_sales +Output [3]: [ws_item_sk#15, ws_bill_customer_sk#16, ws_sold_date_sk#17] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#17), dynamicpruningexpression(ws_sold_date_sk#17 IN dynamicpruning#11)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 4] +Input [3]: [ws_item_sk#15, ws_bill_customer_sk#16, ws_sold_date_sk#17] + +(17) Filter [codegen id : 4] +Input [3]: [ws_item_sk#15, ws_bill_customer_sk#16, ws_sold_date_sk#17] +Condition : (isnotnull(ws_item_sk#15) AND isnotnull(ws_bill_customer_sk#16)) + +(18) Project [codegen id : 4] +Output [3]: [ws_sold_date_sk#17 AS sold_date_sk#18, ws_bill_customer_sk#16 AS customer_sk#19, ws_item_sk#15 AS item_sk#20] +Input [3]: [ws_item_sk#15, ws_bill_customer_sk#16, ws_sold_date_sk#17] + +(19) Union + +(20) Scan parquet default.date_dim +Output [3]: [d_date_sk#21, d_year#22, d_moy#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,12), EqualTo(d_year,1998), IsNotNull(d_date_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 5] +Input [3]: [d_date_sk#21, d_year#22, d_moy#23] + +(22) Filter [codegen id : 5] +Input [3]: [d_date_sk#21, d_year#22, d_moy#23] +Condition : ((((isnotnull(d_moy#23) AND isnotnull(d_year#22)) AND (d_moy#23 = 12)) AND (d_year#22 = 1998)) AND isnotnull(d_date_sk#21)) + +(23) Project [codegen id : 5] +Output [1]: [d_date_sk#21] +Input [3]: [d_date_sk#21, d_year#22, d_moy#23] + +(24) BroadcastExchange +Input [1]: [d_date_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(25) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [sold_date_sk#12] +Right keys [1]: [d_date_sk#21] +Join condition: None + +(26) Project [codegen id : 7] +Output [2]: [customer_sk#13, item_sk#14] +Input [4]: [sold_date_sk#12, customer_sk#13, item_sk#14, d_date_sk#21] + +(27) Scan parquet default.item +Output [3]: [i_item_sk#25, i_class#26, i_category#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), IsNotNull(i_class), EqualTo(i_category,Women ), EqualTo(i_class,maternity ), IsNotNull(i_item_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 6] +Input [3]: [i_item_sk#25, i_class#26, i_category#27] + +(29) Filter [codegen id : 6] +Input [3]: [i_item_sk#25, i_class#26, i_category#27] +Condition : ((((isnotnull(i_category#27) AND isnotnull(i_class#26)) AND (i_category#27 = Women )) AND (i_class#26 = maternity )) AND isnotnull(i_item_sk#25)) + +(30) Project [codegen id : 6] +Output [1]: [i_item_sk#25] +Input [3]: [i_item_sk#25, i_class#26, i_category#27] + +(31) BroadcastExchange +Input [1]: [i_item_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] + +(32) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [item_sk#14] +Right keys [1]: [i_item_sk#25] +Join condition: None + +(33) Project [codegen id : 7] +Output [1]: [customer_sk#13] +Input [3]: [customer_sk#13, item_sk#14, i_item_sk#25] + +(34) Exchange +Input [1]: [customer_sk#13] +Arguments: hashpartitioning(customer_sk#13, 5), ENSURE_REQUIREMENTS, [id=#29] + +(35) Sort [codegen id : 8] +Input [1]: [customer_sk#13] +Arguments: [customer_sk#13 ASC NULLS FIRST], false, 0 + +(36) Scan parquet default.customer +Output [2]: [c_customer_sk#30, c_current_addr_sk#31] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 9] +Input [2]: [c_customer_sk#30, c_current_addr_sk#31] + +(38) Filter [codegen id : 9] +Input [2]: [c_customer_sk#30, c_current_addr_sk#31] +Condition : (isnotnull(c_customer_sk#30) AND isnotnull(c_current_addr_sk#31)) + +(39) Exchange +Input [2]: [c_customer_sk#30, c_current_addr_sk#31] +Arguments: hashpartitioning(c_customer_sk#30, 5), ENSURE_REQUIREMENTS, [id=#32] + +(40) Sort [codegen id : 10] +Input [2]: [c_customer_sk#30, c_current_addr_sk#31] +Arguments: [c_customer_sk#30 ASC NULLS FIRST], false, 0 + +(41) SortMergeJoin +Left keys [1]: [customer_sk#13] +Right keys [1]: [c_customer_sk#30] +Join condition: None + +(42) Project +Output [2]: [c_customer_sk#30, c_current_addr_sk#31] +Input [3]: [customer_sk#13, c_customer_sk#30, c_current_addr_sk#31] + +(43) HashAggregate +Input [2]: [c_customer_sk#30, c_current_addr_sk#31] +Keys [2]: [c_customer_sk#30, c_current_addr_sk#31] +Functions: [] +Aggregate Attributes: [] +Results [2]: [c_customer_sk#30, c_current_addr_sk#31] + +(44) HashAggregate +Input [2]: [c_customer_sk#30, c_current_addr_sk#31] +Keys [2]: [c_customer_sk#30, c_current_addr_sk#31] +Functions: [] +Aggregate Attributes: [] +Results [2]: [c_customer_sk#30, c_current_addr_sk#31] + +(45) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ca_address_sk#1] +Right keys [1]: [c_current_addr_sk#31] +Join condition: None + +(46) Project [codegen id : 11] +Output [1]: [c_customer_sk#30] +Input [3]: [ca_address_sk#1, c_customer_sk#30, c_current_addr_sk#31] + +(47) Sort [codegen id : 11] +Input [1]: [c_customer_sk#30] +Arguments: [c_customer_sk#30 ASC NULLS FIRST], false, 0 + +(48) Scan parquet default.store_sales +Output [3]: [ss_customer_sk#33, ss_ext_sales_price#34, ss_sold_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#35), dynamicpruningexpression(ss_sold_date_sk#35 IN dynamicpruning#36)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 13] +Input [3]: [ss_customer_sk#33, ss_ext_sales_price#34, ss_sold_date_sk#35] + +(50) Filter [codegen id : 13] +Input [3]: [ss_customer_sk#33, ss_ext_sales_price#34, ss_sold_date_sk#35] +Condition : isnotnull(ss_customer_sk#33) + +(51) Scan parquet default.date_dim +Output [2]: [d_date_sk#37, d_month_seq#38] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 12] +Input [2]: [d_date_sk#37, d_month_seq#38] + +(53) Filter [codegen id : 12] +Input [2]: [d_date_sk#37, d_month_seq#38] +Condition : (((isnotnull(d_month_seq#38) AND (d_month_seq#38 >= Subquery scalar-subquery#39, [id=#40])) AND (d_month_seq#38 <= Subquery scalar-subquery#41, [id=#42])) AND isnotnull(d_date_sk#37)) + +(54) Project [codegen id : 12] +Output [1]: [d_date_sk#37] +Input [2]: [d_date_sk#37, d_month_seq#38] + +(55) BroadcastExchange +Input [1]: [d_date_sk#37] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#43] + +(56) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_sold_date_sk#35] +Right keys [1]: [d_date_sk#37] +Join condition: None + +(57) Project [codegen id : 13] +Output [2]: [ss_customer_sk#33, ss_ext_sales_price#34] +Input [4]: [ss_customer_sk#33, ss_ext_sales_price#34, ss_sold_date_sk#35, d_date_sk#37] + +(58) Exchange +Input [2]: [ss_customer_sk#33, ss_ext_sales_price#34] +Arguments: hashpartitioning(ss_customer_sk#33, 5), ENSURE_REQUIREMENTS, [id=#44] + +(59) Sort [codegen id : 14] +Input [2]: [ss_customer_sk#33, ss_ext_sales_price#34] +Arguments: [ss_customer_sk#33 ASC NULLS FIRST], false, 0 + +(60) SortMergeJoin [codegen id : 15] +Left keys [1]: [c_customer_sk#30] +Right keys [1]: [ss_customer_sk#33] +Join condition: None + +(61) Project [codegen id : 15] +Output [2]: [c_customer_sk#30, ss_ext_sales_price#34] +Input [3]: [c_customer_sk#30, ss_customer_sk#33, ss_ext_sales_price#34] + +(62) HashAggregate [codegen id : 15] +Input [2]: [c_customer_sk#30, ss_ext_sales_price#34] +Keys [1]: [c_customer_sk#30] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#34))] +Aggregate Attributes [1]: [sum#45] +Results [2]: [c_customer_sk#30, sum#46] + +(63) HashAggregate [codegen id : 15] +Input [2]: [c_customer_sk#30, sum#46] +Keys [1]: [c_customer_sk#30] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#34))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#34))#47] +Results [1]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#34))#47,17,2)) / 50.00), DecimalType(21,6), true) as int) AS segment#48] + +(64) HashAggregate [codegen id : 15] +Input [1]: [segment#48] +Keys [1]: [segment#48] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#49] +Results [2]: [segment#48, count#50] + +(65) Exchange +Input [2]: [segment#48, count#50] +Arguments: hashpartitioning(segment#48, 5), ENSURE_REQUIREMENTS, [id=#51] + +(66) HashAggregate [codegen id : 16] +Input [2]: [segment#48, count#50] +Keys [1]: [segment#48] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#52] +Results [3]: [segment#48, count(1)#52 AS num_customers#53, (segment#48 * 50) AS segment_base#54] + +(67) TakeOrderedAndProject +Input [3]: [segment#48, num_customers#53, segment_base#54] +Arguments: 100, [segment#48 ASC NULLS FIRST, num_customers#53 ASC NULLS FIRST], [segment#48, num_customers#53, segment_base#54] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 11 Hosting Expression = cs_sold_date_sk#10 IN dynamicpruning#11 +ReusedExchange (68) + + +(68) ReusedExchange [Reuses operator id: 24] +Output [1]: [d_date_sk#21] + +Subquery:2 Hosting operator id = 15 Hosting Expression = ws_sold_date_sk#17 IN dynamicpruning#11 + +Subquery:3 Hosting operator id = 48 Hosting Expression = ss_sold_date_sk#35 IN dynamicpruning#36 +ReusedExchange (69) + + +(69) ReusedExchange [Reuses operator id: 55] +Output [1]: [d_date_sk#37] + +Subquery:4 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquery#39, [id=#40] +* HashAggregate (76) ++- Exchange (75) + +- * HashAggregate (74) + +- * Project (73) + +- * Filter (72) + +- * ColumnarToRow (71) + +- Scan parquet default.date_dim (70) + + +(70) Scan parquet default.date_dim +Output [3]: [d_month_seq#55, d_year#56, d_moy#57] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,12)] +ReadSchema: struct + +(71) ColumnarToRow [codegen id : 1] +Input [3]: [d_month_seq#55, d_year#56, d_moy#57] + +(72) Filter [codegen id : 1] +Input [3]: [d_month_seq#55, d_year#56, d_moy#57] +Condition : (((isnotnull(d_year#56) AND isnotnull(d_moy#57)) AND (d_year#56 = 1998)) AND (d_moy#57 = 12)) + +(73) Project [codegen id : 1] +Output [1]: [(d_month_seq#55 + 1) AS (d_month_seq + 1)#58] +Input [3]: [d_month_seq#55, d_year#56, d_moy#57] + +(74) HashAggregate [codegen id : 1] +Input [1]: [(d_month_seq + 1)#58] +Keys [1]: [(d_month_seq + 1)#58] +Functions: [] +Aggregate Attributes: [] +Results [1]: [(d_month_seq + 1)#58] + +(75) Exchange +Input [1]: [(d_month_seq + 1)#58] +Arguments: hashpartitioning((d_month_seq + 1)#58, 5), ENSURE_REQUIREMENTS, [id=#59] + +(76) HashAggregate [codegen id : 2] +Input [1]: [(d_month_seq + 1)#58] +Keys [1]: [(d_month_seq + 1)#58] +Functions: [] +Aggregate Attributes: [] +Results [1]: [(d_month_seq + 1)#58] + +Subquery:5 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquery#41, [id=#42] +* HashAggregate (83) ++- Exchange (82) + +- * HashAggregate (81) + +- * Project (80) + +- * Filter (79) + +- * ColumnarToRow (78) + +- Scan parquet default.date_dim (77) + + +(77) Scan parquet default.date_dim +Output [3]: [d_month_seq#60, d_year#61, d_moy#62] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,12)] +ReadSchema: struct + +(78) ColumnarToRow [codegen id : 1] +Input [3]: [d_month_seq#60, d_year#61, d_moy#62] + +(79) Filter [codegen id : 1] +Input [3]: [d_month_seq#60, d_year#61, d_moy#62] +Condition : (((isnotnull(d_year#61) AND isnotnull(d_moy#62)) AND (d_year#61 = 1998)) AND (d_moy#62 = 12)) + +(80) Project [codegen id : 1] +Output [1]: [(d_month_seq#60 + 3) AS (d_month_seq + 3)#63] +Input [3]: [d_month_seq#60, d_year#61, d_moy#62] + +(81) HashAggregate [codegen id : 1] +Input [1]: [(d_month_seq + 3)#63] +Keys [1]: [(d_month_seq + 3)#63] +Functions: [] +Aggregate Attributes: [] +Results [1]: [(d_month_seq + 3)#63] + +(82) Exchange +Input [1]: [(d_month_seq + 3)#63] +Arguments: hashpartitioning((d_month_seq + 3)#63, 5), ENSURE_REQUIREMENTS, [id=#64] + +(83) HashAggregate [codegen id : 2] +Input [1]: [(d_month_seq + 3)#63] +Keys [1]: [(d_month_seq + 3)#63] +Functions: [] +Aggregate Attributes: [] +Results [1]: [(d_month_seq + 3)#63] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/simplified.txt new file mode 100644 index 0000000000000..b800afb9a4c65 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54.sf100/simplified.txt @@ -0,0 +1,135 @@ +TakeOrderedAndProject [segment,num_customers,segment_base] + WholeStageCodegen (16) + HashAggregate [segment,count] [count(1),num_customers,segment_base,count] + InputAdapter + Exchange [segment] #1 + WholeStageCodegen (15) + HashAggregate [segment] [count,count] + HashAggregate [c_customer_sk,sum] [sum(UnscaledValue(ss_ext_sales_price)),segment,sum] + HashAggregate [c_customer_sk,ss_ext_sales_price] [sum,sum] + Project [c_customer_sk,ss_ext_sales_price] + SortMergeJoin [c_customer_sk,ss_customer_sk] + InputAdapter + WholeStageCodegen (11) + Sort [c_customer_sk] + Project [c_customer_sk] + BroadcastHashJoin [ca_address_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [ca_address_sk] + BroadcastHashJoin [ca_county,ca_state,s_county,s_state] + Filter [ca_address_sk,ca_county,ca_state] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county,ca_state] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [s_county,s_state] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_county,s_state] + HashAggregate [c_customer_sk,c_current_addr_sk] + HashAggregate [c_customer_sk,c_current_addr_sk] + Project [c_customer_sk,c_current_addr_sk] + SortMergeJoin [customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (8) + Sort [customer_sk] + InputAdapter + Exchange [customer_sk] #4 + WholeStageCodegen (7) + Project [customer_sk] + BroadcastHashJoin [item_sk,i_item_sk] + Project [customer_sk,item_sk] + BroadcastHashJoin [sold_date_sk,d_date_sk] + InputAdapter + Union + WholeStageCodegen (3) + Project [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk] + Filter [cs_item_sk,cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + WholeStageCodegen (4) + Project [ws_sold_date_sk,ws_bill_customer_sk,ws_item_sk] + Filter [ws_item_sk,ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Project [i_item_sk] + Filter [i_category,i_class,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_class,i_category] + InputAdapter + WholeStageCodegen (10) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #7 + WholeStageCodegen (9) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (14) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #8 + WholeStageCodegen (13) + Project [ss_customer_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (12) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + Subquery #3 + WholeStageCodegen (2) + HashAggregate [(d_month_seq + 1)] + InputAdapter + Exchange [(d_month_seq + 1)] #10 + WholeStageCodegen (1) + HashAggregate [(d_month_seq + 1)] + Project [d_month_seq] + Filter [d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_year,d_moy] + Subquery #4 + WholeStageCodegen (2) + HashAggregate [(d_month_seq + 3)] + InputAdapter + Exchange [(d_month_seq + 3)] #11 + WholeStageCodegen (1) + HashAggregate [(d_month_seq + 3)] + Project [d_month_seq] + Filter [d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/explain.txt new file mode 100644 index 0000000000000..d0638d7606bb5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/explain.txt @@ -0,0 +1,478 @@ +== Physical Plan == +TakeOrderedAndProject (64) ++- * HashAggregate (63) + +- Exchange (62) + +- * HashAggregate (61) + +- * HashAggregate (60) + +- Exchange (59) + +- * HashAggregate (58) + +- * Project (57) + +- * BroadcastHashJoin Inner BuildRight (56) + :- * Project (50) + : +- * BroadcastHashJoin Inner BuildRight (49) + : :- * Project (44) + : : +- * BroadcastHashJoin Inner BuildRight (43) + : : :- * Project (38) + : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : :- * HashAggregate (32) + : : : : +- Exchange (31) + : : : : +- * HashAggregate (30) + : : : : +- * Project (29) + : : : : +- * BroadcastHashJoin Inner BuildRight (28) + : : : : :- * Project (23) + : : : : : +- * BroadcastHashJoin Inner BuildRight (22) + : : : : : :- * Project (16) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : : : : :- Union (9) + : : : : : : : :- * Project (4) + : : : : : : : : +- * Filter (3) + : : : : : : : : +- * ColumnarToRow (2) + : : : : : : : : +- Scan parquet default.catalog_sales (1) + : : : : : : : +- * Project (8) + : : : : : : : +- * Filter (7) + : : : : : : : +- * ColumnarToRow (6) + : : : : : : : +- Scan parquet default.web_sales (5) + : : : : : : +- BroadcastExchange (14) + : : : : : : +- * Project (13) + : : : : : : +- * Filter (12) + : : : : : : +- * ColumnarToRow (11) + : : : : : : +- Scan parquet default.item (10) + : : : : : +- BroadcastExchange (21) + : : : : : +- * Project (20) + : : : : : +- * Filter (19) + : : : : : +- * ColumnarToRow (18) + : : : : : +- Scan parquet default.date_dim (17) + : : : : +- BroadcastExchange (27) + : : : : +- * Filter (26) + : : : : +- * ColumnarToRow (25) + : : : : +- Scan parquet default.customer (24) + : : : +- BroadcastExchange (36) + : : : +- * Filter (35) + : : : +- * ColumnarToRow (34) + : : : +- Scan parquet default.store_sales (33) + : : +- BroadcastExchange (42) + : : +- * Filter (41) + : : +- * ColumnarToRow (40) + : : +- Scan parquet default.customer_address (39) + : +- BroadcastExchange (48) + : +- * Filter (47) + : +- * ColumnarToRow (46) + : +- Scan parquet default.store (45) + +- BroadcastExchange (55) + +- * Project (54) + +- * Filter (53) + +- * ColumnarToRow (52) + +- Scan parquet default.date_dim (51) + + +(1) Scan parquet default.catalog_sales +Output [3]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#3), dynamicpruningexpression(cs_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_sold_date_sk#3] + +(3) Filter [codegen id : 1] +Input [3]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_sold_date_sk#3] +Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_bill_customer_sk#1)) + +(4) Project [codegen id : 1] +Output [3]: [cs_sold_date_sk#3 AS sold_date_sk#5, cs_bill_customer_sk#1 AS customer_sk#6, cs_item_sk#2 AS item_sk#7] +Input [3]: [cs_bill_customer_sk#1, cs_item_sk#2, cs_sold_date_sk#3] + +(5) Scan parquet default.web_sales +Output [3]: [ws_item_sk#8, ws_bill_customer_sk#9, ws_sold_date_sk#10] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#10), dynamicpruningexpression(ws_sold_date_sk#10 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 2] +Input [3]: [ws_item_sk#8, ws_bill_customer_sk#9, ws_sold_date_sk#10] + +(7) Filter [codegen id : 2] +Input [3]: [ws_item_sk#8, ws_bill_customer_sk#9, ws_sold_date_sk#10] +Condition : (isnotnull(ws_item_sk#8) AND isnotnull(ws_bill_customer_sk#9)) + +(8) Project [codegen id : 2] +Output [3]: [ws_sold_date_sk#10 AS sold_date_sk#11, ws_bill_customer_sk#9 AS customer_sk#12, ws_item_sk#8 AS item_sk#13] +Input [3]: [ws_item_sk#8, ws_bill_customer_sk#9, ws_sold_date_sk#10] + +(9) Union + +(10) Scan parquet default.item +Output [3]: [i_item_sk#14, i_class#15, i_category#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), IsNotNull(i_class), EqualTo(i_category,Women ), EqualTo(i_class,maternity ), IsNotNull(i_item_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 3] +Input [3]: [i_item_sk#14, i_class#15, i_category#16] + +(12) Filter [codegen id : 3] +Input [3]: [i_item_sk#14, i_class#15, i_category#16] +Condition : ((((isnotnull(i_category#16) AND isnotnull(i_class#15)) AND (i_category#16 = Women )) AND (i_class#15 = maternity )) AND isnotnull(i_item_sk#14)) + +(13) Project [codegen id : 3] +Output [1]: [i_item_sk#14] +Input [3]: [i_item_sk#14, i_class#15, i_category#16] + +(14) BroadcastExchange +Input [1]: [i_item_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(15) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [item_sk#7] +Right keys [1]: [i_item_sk#14] +Join condition: None + +(16) Project [codegen id : 6] +Output [2]: [sold_date_sk#5, customer_sk#6] +Input [4]: [sold_date_sk#5, customer_sk#6, item_sk#7, i_item_sk#14] + +(17) Scan parquet default.date_dim +Output [3]: [d_date_sk#18, d_year#19, d_moy#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,12), EqualTo(d_year,1998), IsNotNull(d_date_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 4] +Input [3]: [d_date_sk#18, d_year#19, d_moy#20] + +(19) Filter [codegen id : 4] +Input [3]: [d_date_sk#18, d_year#19, d_moy#20] +Condition : ((((isnotnull(d_moy#20) AND isnotnull(d_year#19)) AND (d_moy#20 = 12)) AND (d_year#19 = 1998)) AND isnotnull(d_date_sk#18)) + +(20) Project [codegen id : 4] +Output [1]: [d_date_sk#18] +Input [3]: [d_date_sk#18, d_year#19, d_moy#20] + +(21) BroadcastExchange +Input [1]: [d_date_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(22) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [sold_date_sk#5] +Right keys [1]: [d_date_sk#18] +Join condition: None + +(23) Project [codegen id : 6] +Output [1]: [customer_sk#6] +Input [3]: [sold_date_sk#5, customer_sk#6, d_date_sk#18] + +(24) Scan parquet default.customer +Output [2]: [c_customer_sk#22, c_current_addr_sk#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 5] +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] + +(26) Filter [codegen id : 5] +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Condition : (isnotnull(c_customer_sk#22) AND isnotnull(c_current_addr_sk#23)) + +(27) BroadcastExchange +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(28) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [customer_sk#6] +Right keys [1]: [c_customer_sk#22] +Join condition: None + +(29) Project [codegen id : 6] +Output [2]: [c_customer_sk#22, c_current_addr_sk#23] +Input [3]: [customer_sk#6, c_customer_sk#22, c_current_addr_sk#23] + +(30) HashAggregate [codegen id : 6] +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Keys [2]: [c_customer_sk#22, c_current_addr_sk#23] +Functions: [] +Aggregate Attributes: [] +Results [2]: [c_customer_sk#22, c_current_addr_sk#23] + +(31) Exchange +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Arguments: hashpartitioning(c_customer_sk#22, c_current_addr_sk#23, 5), ENSURE_REQUIREMENTS, [id=#25] + +(32) HashAggregate [codegen id : 11] +Input [2]: [c_customer_sk#22, c_current_addr_sk#23] +Keys [2]: [c_customer_sk#22, c_current_addr_sk#23] +Functions: [] +Aggregate Attributes: [] +Results [2]: [c_customer_sk#22, c_current_addr_sk#23] + +(33) Scan parquet default.store_sales +Output [3]: [ss_customer_sk#26, ss_ext_sales_price#27, ss_sold_date_sk#28] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#28), dynamicpruningexpression(ss_sold_date_sk#28 IN dynamicpruning#29)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 7] +Input [3]: [ss_customer_sk#26, ss_ext_sales_price#27, ss_sold_date_sk#28] + +(35) Filter [codegen id : 7] +Input [3]: [ss_customer_sk#26, ss_ext_sales_price#27, ss_sold_date_sk#28] +Condition : isnotnull(ss_customer_sk#26) + +(36) BroadcastExchange +Input [3]: [ss_customer_sk#26, ss_ext_sales_price#27, ss_sold_date_sk#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#30] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [c_customer_sk#22] +Right keys [1]: [ss_customer_sk#26] +Join condition: None + +(38) Project [codegen id : 11] +Output [4]: [c_customer_sk#22, c_current_addr_sk#23, ss_ext_sales_price#27, ss_sold_date_sk#28] +Input [5]: [c_customer_sk#22, c_current_addr_sk#23, ss_customer_sk#26, ss_ext_sales_price#27, ss_sold_date_sk#28] + +(39) Scan parquet default.customer_address +Output [3]: [ca_address_sk#31, ca_county#32, ca_state#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_county), IsNotNull(ca_state)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 8] +Input [3]: [ca_address_sk#31, ca_county#32, ca_state#33] + +(41) Filter [codegen id : 8] +Input [3]: [ca_address_sk#31, ca_county#32, ca_state#33] +Condition : ((isnotnull(ca_address_sk#31) AND isnotnull(ca_county#32)) AND isnotnull(ca_state#33)) + +(42) BroadcastExchange +Input [3]: [ca_address_sk#31, ca_county#32, ca_state#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#34] + +(43) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [c_current_addr_sk#23] +Right keys [1]: [ca_address_sk#31] +Join condition: None + +(44) Project [codegen id : 11] +Output [5]: [c_customer_sk#22, ss_ext_sales_price#27, ss_sold_date_sk#28, ca_county#32, ca_state#33] +Input [7]: [c_customer_sk#22, c_current_addr_sk#23, ss_ext_sales_price#27, ss_sold_date_sk#28, ca_address_sk#31, ca_county#32, ca_state#33] + +(45) Scan parquet default.store +Output [2]: [s_county#35, s_state#36] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_county), IsNotNull(s_state)] +ReadSchema: struct + +(46) ColumnarToRow [codegen id : 9] +Input [2]: [s_county#35, s_state#36] + +(47) Filter [codegen id : 9] +Input [2]: [s_county#35, s_state#36] +Condition : (isnotnull(s_county#35) AND isnotnull(s_state#36)) + +(48) BroadcastExchange +Input [2]: [s_county#35, s_state#36] +Arguments: HashedRelationBroadcastMode(List(input[0, string, false], input[1, string, false]),false), [id=#37] + +(49) BroadcastHashJoin [codegen id : 11] +Left keys [2]: [ca_county#32, ca_state#33] +Right keys [2]: [s_county#35, s_state#36] +Join condition: None + +(50) Project [codegen id : 11] +Output [3]: [c_customer_sk#22, ss_ext_sales_price#27, ss_sold_date_sk#28] +Input [7]: [c_customer_sk#22, ss_ext_sales_price#27, ss_sold_date_sk#28, ca_county#32, ca_state#33, s_county#35, s_state#36] + +(51) Scan parquet default.date_dim +Output [2]: [d_date_sk#38, d_month_seq#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 10] +Input [2]: [d_date_sk#38, d_month_seq#39] + +(53) Filter [codegen id : 10] +Input [2]: [d_date_sk#38, d_month_seq#39] +Condition : (((isnotnull(d_month_seq#39) AND (d_month_seq#39 >= Subquery scalar-subquery#40, [id=#41])) AND (d_month_seq#39 <= Subquery scalar-subquery#42, [id=#43])) AND isnotnull(d_date_sk#38)) + +(54) Project [codegen id : 10] +Output [1]: [d_date_sk#38] +Input [2]: [d_date_sk#38, d_month_seq#39] + +(55) BroadcastExchange +Input [1]: [d_date_sk#38] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] + +(56) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_sold_date_sk#28] +Right keys [1]: [d_date_sk#38] +Join condition: None + +(57) Project [codegen id : 11] +Output [2]: [c_customer_sk#22, ss_ext_sales_price#27] +Input [4]: [c_customer_sk#22, ss_ext_sales_price#27, ss_sold_date_sk#28, d_date_sk#38] + +(58) HashAggregate [codegen id : 11] +Input [2]: [c_customer_sk#22, ss_ext_sales_price#27] +Keys [1]: [c_customer_sk#22] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#27))] +Aggregate Attributes [1]: [sum#45] +Results [2]: [c_customer_sk#22, sum#46] + +(59) Exchange +Input [2]: [c_customer_sk#22, sum#46] +Arguments: hashpartitioning(c_customer_sk#22, 5), ENSURE_REQUIREMENTS, [id=#47] + +(60) HashAggregate [codegen id : 12] +Input [2]: [c_customer_sk#22, sum#46] +Keys [1]: [c_customer_sk#22] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#27))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#27))#48] +Results [1]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#27))#48,17,2)) / 50.00), DecimalType(21,6), true) as int) AS segment#49] + +(61) HashAggregate [codegen id : 12] +Input [1]: [segment#49] +Keys [1]: [segment#49] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#50] +Results [2]: [segment#49, count#51] + +(62) Exchange +Input [2]: [segment#49, count#51] +Arguments: hashpartitioning(segment#49, 5), ENSURE_REQUIREMENTS, [id=#52] + +(63) HashAggregate [codegen id : 13] +Input [2]: [segment#49, count#51] +Keys [1]: [segment#49] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#53] +Results [3]: [segment#49, count(1)#53 AS num_customers#54, (segment#49 * 50) AS segment_base#55] + +(64) TakeOrderedAndProject +Input [3]: [segment#49, num_customers#54, segment_base#55] +Arguments: 100, [segment#49 ASC NULLS FIRST, num_customers#54 ASC NULLS FIRST], [segment#49, num_customers#54, segment_base#55] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (65) + + +(65) ReusedExchange [Reuses operator id: 21] +Output [1]: [d_date_sk#18] + +Subquery:2 Hosting operator id = 5 Hosting Expression = ws_sold_date_sk#10 IN dynamicpruning#4 + +Subquery:3 Hosting operator id = 33 Hosting Expression = ss_sold_date_sk#28 IN dynamicpruning#29 +ReusedExchange (66) + + +(66) ReusedExchange [Reuses operator id: 55] +Output [1]: [d_date_sk#38] + +Subquery:4 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquery#40, [id=#41] +* HashAggregate (73) ++- Exchange (72) + +- * HashAggregate (71) + +- * Project (70) + +- * Filter (69) + +- * ColumnarToRow (68) + +- Scan parquet default.date_dim (67) + + +(67) Scan parquet default.date_dim +Output [3]: [d_month_seq#56, d_year#57, d_moy#58] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,12)] +ReadSchema: struct + +(68) ColumnarToRow [codegen id : 1] +Input [3]: [d_month_seq#56, d_year#57, d_moy#58] + +(69) Filter [codegen id : 1] +Input [3]: [d_month_seq#56, d_year#57, d_moy#58] +Condition : (((isnotnull(d_year#57) AND isnotnull(d_moy#58)) AND (d_year#57 = 1998)) AND (d_moy#58 = 12)) + +(70) Project [codegen id : 1] +Output [1]: [(d_month_seq#56 + 1) AS (d_month_seq + 1)#59] +Input [3]: [d_month_seq#56, d_year#57, d_moy#58] + +(71) HashAggregate [codegen id : 1] +Input [1]: [(d_month_seq + 1)#59] +Keys [1]: [(d_month_seq + 1)#59] +Functions: [] +Aggregate Attributes: [] +Results [1]: [(d_month_seq + 1)#59] + +(72) Exchange +Input [1]: [(d_month_seq + 1)#59] +Arguments: hashpartitioning((d_month_seq + 1)#59, 5), ENSURE_REQUIREMENTS, [id=#60] + +(73) HashAggregate [codegen id : 2] +Input [1]: [(d_month_seq + 1)#59] +Keys [1]: [(d_month_seq + 1)#59] +Functions: [] +Aggregate Attributes: [] +Results [1]: [(d_month_seq + 1)#59] + +Subquery:5 Hosting operator id = 53 Hosting Expression = Subquery scalar-subquery#42, [id=#43] +* HashAggregate (80) ++- Exchange (79) + +- * HashAggregate (78) + +- * Project (77) + +- * Filter (76) + +- * ColumnarToRow (75) + +- Scan parquet default.date_dim (74) + + +(74) Scan parquet default.date_dim +Output [3]: [d_month_seq#61, d_year#62, d_moy#63] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,12)] +ReadSchema: struct + +(75) ColumnarToRow [codegen id : 1] +Input [3]: [d_month_seq#61, d_year#62, d_moy#63] + +(76) Filter [codegen id : 1] +Input [3]: [d_month_seq#61, d_year#62, d_moy#63] +Condition : (((isnotnull(d_year#62) AND isnotnull(d_moy#63)) AND (d_year#62 = 1998)) AND (d_moy#63 = 12)) + +(77) Project [codegen id : 1] +Output [1]: [(d_month_seq#61 + 3) AS (d_month_seq + 3)#64] +Input [3]: [d_month_seq#61, d_year#62, d_moy#63] + +(78) HashAggregate [codegen id : 1] +Input [1]: [(d_month_seq + 3)#64] +Keys [1]: [(d_month_seq + 3)#64] +Functions: [] +Aggregate Attributes: [] +Results [1]: [(d_month_seq + 3)#64] + +(79) Exchange +Input [1]: [(d_month_seq + 3)#64] +Arguments: hashpartitioning((d_month_seq + 3)#64, 5), ENSURE_REQUIREMENTS, [id=#65] + +(80) HashAggregate [codegen id : 2] +Input [1]: [(d_month_seq + 3)#64] +Keys [1]: [(d_month_seq + 3)#64] +Functions: [] +Aggregate Attributes: [] +Results [1]: [(d_month_seq + 3)#64] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/simplified.txt new file mode 100644 index 0000000000000..d2db5d8da0a65 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q54/simplified.txt @@ -0,0 +1,126 @@ +TakeOrderedAndProject [segment,num_customers,segment_base] + WholeStageCodegen (13) + HashAggregate [segment,count] [count(1),num_customers,segment_base,count] + InputAdapter + Exchange [segment] #1 + WholeStageCodegen (12) + HashAggregate [segment] [count,count] + HashAggregate [c_customer_sk,sum] [sum(UnscaledValue(ss_ext_sales_price)),segment,sum] + InputAdapter + Exchange [c_customer_sk] #2 + WholeStageCodegen (11) + HashAggregate [c_customer_sk,ss_ext_sales_price] [sum,sum] + Project [c_customer_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_sk,ss_ext_sales_price,ss_sold_date_sk] + BroadcastHashJoin [ca_county,ca_state,s_county,s_state] + Project [c_customer_sk,ss_ext_sales_price,ss_sold_date_sk,ca_county,ca_state] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_customer_sk,c_current_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + HashAggregate [c_customer_sk,c_current_addr_sk] + InputAdapter + Exchange [c_customer_sk,c_current_addr_sk] #3 + WholeStageCodegen (6) + HashAggregate [c_customer_sk,c_current_addr_sk] + Project [c_customer_sk,c_current_addr_sk] + BroadcastHashJoin [customer_sk,c_customer_sk] + Project [customer_sk] + BroadcastHashJoin [sold_date_sk,d_date_sk] + Project [sold_date_sk,customer_sk] + BroadcastHashJoin [item_sk,i_item_sk] + InputAdapter + Union + WholeStageCodegen (1) + Project [cs_sold_date_sk,cs_bill_customer_sk,cs_item_sk] + Filter [cs_item_sk,cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + WholeStageCodegen (2) + Project [ws_sold_date_sk,ws_bill_customer_sk,ws_item_sk] + Filter [ws_item_sk,ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [i_item_sk] + Filter [i_category,i_class,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (7) + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #8 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (8) + Filter [ca_address_sk,ca_county,ca_state] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county,ca_state] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (9) + Filter [s_county,s_state] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_county,s_state] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (10) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + Subquery #3 + WholeStageCodegen (2) + HashAggregate [(d_month_seq + 1)] + InputAdapter + Exchange [(d_month_seq + 1)] #11 + WholeStageCodegen (1) + HashAggregate [(d_month_seq + 1)] + Project [d_month_seq] + Filter [d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_year,d_moy] + Subquery #4 + WholeStageCodegen (2) + HashAggregate [(d_month_seq + 3)] + InputAdapter + Exchange [(d_month_seq + 3)] #12 + WholeStageCodegen (1) + HashAggregate [(d_month_seq + 3)] + Project [d_month_seq] + Filter [d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/explain.txt new file mode 100644 index 0000000000000..c8d2a4748ba95 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/explain.txt @@ -0,0 +1,133 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.date_dim (11) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manager_id#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,28), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manager_id#8] + +(6) Filter [codegen id : 1] +Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manager_id#8] +Condition : ((isnotnull(i_manager_id#8) AND (i_manager_id#8 = 28)) AND isnotnull(i_item_sk#5)) + +(7) Project [codegen id : 1] +Output [3]: [i_item_sk#5, i_brand_id#6, i_brand#7] +Input [4]: [i_item_sk#5, i_brand_id#6, i_brand#7, i_manager_id#8] + +(8) BroadcastExchange +Input [3]: [i_item_sk#5, i_brand_id#6, i_brand#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(10) Project [codegen id : 3] +Output [4]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_brand_id#6, i_brand#7] +Input [6]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_sk#5, i_brand_id#6, i_brand#7] + +(11) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(13) Filter [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Condition : ((((isnotnull(d_moy#12) AND isnotnull(d_year#11)) AND (d_moy#12 = 11)) AND (d_year#11 = 1999)) AND isnotnull(d_date_sk#10)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(15) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(17) Project [codegen id : 3] +Output [3]: [ss_ext_sales_price#2, i_brand_id#6, i_brand#7] +Input [5]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_brand_id#6, i_brand#7, d_date_sk#10] + +(18) HashAggregate [codegen id : 3] +Input [3]: [ss_ext_sales_price#2, i_brand_id#6, i_brand#7] +Keys [2]: [i_brand#7, i_brand_id#6] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#14] +Results [3]: [i_brand#7, i_brand_id#6, sum#15] + +(19) Exchange +Input [3]: [i_brand#7, i_brand_id#6, sum#15] +Arguments: hashpartitioning(i_brand#7, i_brand_id#6, 5), ENSURE_REQUIREMENTS, [id=#16] + +(20) HashAggregate [codegen id : 4] +Input [3]: [i_brand#7, i_brand_id#6, sum#15] +Keys [2]: [i_brand#7, i_brand_id#6] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#17] +Results [3]: [i_brand_id#6 AS brand_id#18, i_brand#7 AS brand#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#17,17,2) AS ext_price#20] + +(21) TakeOrderedAndProject +Input [3]: [brand_id#18, brand#19, ext_price#20] +Arguments: 100, [ext_price#20 DESC NULLS LAST, brand_id#18 ASC NULLS FIRST], [brand_id#18, brand#19, ext_price#20] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (22) + + +(22) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#10] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/simplified.txt new file mode 100644 index 0000000000000..4208d6ce88e97 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55.sf100/simplified.txt @@ -0,0 +1,33 @@ +TakeOrderedAndProject [ext_price,brand_id,brand] + WholeStageCodegen (4) + HashAggregate [i_brand,i_brand_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [i_brand,i_brand_id] #1 + WholeStageCodegen (3) + HashAggregate [i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_ext_sales_price,ss_sold_date_sk,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55/explain.txt new file mode 100644 index 0000000000000..25b423382e332 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55/explain.txt @@ -0,0 +1,123 @@ +== Physical Plan == +TakeOrderedAndProject (21) ++- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Project (17) + +- * BroadcastHashJoin Inner BuildRight (16) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.date_dim (1) + : +- BroadcastExchange (8) + : +- * Filter (7) + : +- * ColumnarToRow (6) + : +- Scan parquet default.store_sales (5) + +- BroadcastExchange (15) + +- * Project (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.date_dim +Output [3]: [d_date_sk#1, d_year#2, d_moy#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(3) Filter [codegen id : 3] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] +Condition : ((((isnotnull(d_moy#3) AND isnotnull(d_year#2)) AND (d_moy#3 = 11)) AND (d_year#2 = 1999)) AND isnotnull(d_date_sk#1)) + +(4) Project [codegen id : 3] +Output [1]: [d_date_sk#1] +Input [3]: [d_date_sk#1, d_year#2, d_moy#3] + +(5) Scan parquet default.store_sales +Output [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(7) Filter [codegen id : 1] +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Condition : isnotnull(ss_item_sk#4) + +(8) BroadcastExchange +Input [3]: [ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date_sk#1] +Right keys [1]: [ss_sold_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [2]: [ss_item_sk#4, ss_ext_sales_price#5] +Input [4]: [d_date_sk#1, ss_item_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(11) Scan parquet default.item +Output [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,28), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] + +(13) Filter [codegen id : 2] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] +Condition : ((isnotnull(i_manager_id#11) AND (i_manager_id#11 = 28)) AND isnotnull(i_item_sk#8)) + +(14) Project [codegen id : 2] +Output [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] +Input [4]: [i_item_sk#8, i_brand_id#9, i_brand#10, i_manager_id#11] + +(15) BroadcastExchange +Input [3]: [i_item_sk#8, i_brand_id#9, i_brand#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#4] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(17) Project [codegen id : 3] +Output [3]: [ss_ext_sales_price#5, i_brand_id#9, i_brand#10] +Input [5]: [ss_item_sk#4, ss_ext_sales_price#5, i_item_sk#8, i_brand_id#9, i_brand#10] + +(18) HashAggregate [codegen id : 3] +Input [3]: [ss_ext_sales_price#5, i_brand_id#9, i_brand#10] +Keys [2]: [i_brand#10, i_brand_id#9] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum#13] +Results [3]: [i_brand#10, i_brand_id#9, sum#14] + +(19) Exchange +Input [3]: [i_brand#10, i_brand_id#9, sum#14] +Arguments: hashpartitioning(i_brand#10, i_brand_id#9, 5), ENSURE_REQUIREMENTS, [id=#15] + +(20) HashAggregate [codegen id : 4] +Input [3]: [i_brand#10, i_brand_id#9, sum#14] +Keys [2]: [i_brand#10, i_brand_id#9] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#16] +Results [3]: [i_brand_id#9 AS brand_id#17, i_brand#10 AS brand#18, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#16,17,2) AS ext_price#19] + +(21) TakeOrderedAndProject +Input [3]: [brand_id#17, brand#18, ext_price#19] +Arguments: 100, [ext_price#19 DESC NULLS LAST, brand_id#17 ASC NULLS FIRST], [brand_id#17, brand#18, ext_price#19] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55/simplified.txt new file mode 100644 index 0000000000000..9157bbec2b06a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q55/simplified.txt @@ -0,0 +1,31 @@ +TakeOrderedAndProject [ext_price,brand_id,brand] + WholeStageCodegen (4) + HashAggregate [i_brand,i_brand_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [i_brand,i_brand_id] #1 + WholeStageCodegen (3) + HashAggregate [i_brand,i_brand_id,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_brand_id,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [d_date_sk,ss_sold_date_sk] + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/explain.txt new file mode 100644 index 0000000000000..47eda1483a06c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/explain.txt @@ -0,0 +1,395 @@ +== Physical Plan == +TakeOrderedAndProject (67) ++- * HashAggregate (66) + +- Exchange (65) + +- * HashAggregate (64) + +- Union (63) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.customer_address (11) + : +- BroadcastExchange (27) + : +- * BroadcastHashJoin LeftSemi BuildRight (26) + : :- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.item (18) + : +- BroadcastExchange (25) + : +- * Project (24) + : +- * Filter (23) + : +- * ColumnarToRow (22) + : +- Scan parquet default.item (21) + :- * HashAggregate (47) + : +- Exchange (46) + : +- * HashAggregate (45) + : +- * Project (44) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Project (41) + : : +- * BroadcastHashJoin Inner BuildRight (40) + : : :- * Project (38) + : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.catalog_sales (33) + : : : +- ReusedExchange (36) + : : +- ReusedExchange (39) + : +- ReusedExchange (42) + +- * HashAggregate (62) + +- Exchange (61) + +- * HashAggregate (60) + +- * Project (59) + +- * BroadcastHashJoin Inner BuildRight (58) + :- * Project (56) + : +- * BroadcastHashJoin Inner BuildRight (55) + : :- * Project (53) + : : +- * BroadcastHashJoin Inner BuildRight (52) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.web_sales (48) + : : +- ReusedExchange (51) + : +- ReusedExchange (54) + +- ReusedExchange (57) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_addr_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 5] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_addr_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,2), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((isnotnull(d_year#7) AND isnotnull(d_moy#8)) AND (d_year#7 = 2001)) AND (d_moy#8 = 2)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 5] +Output [3]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] +Input [5]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.customer_address +Output [2]: [ca_address_sk#10, ca_gmt_offset#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_gmt_offset), EqualTo(ca_gmt_offset,-5.00), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] + +(13) Filter [codegen id : 2] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] +Condition : ((isnotnull(ca_gmt_offset#11) AND (ca_gmt_offset#11 = -5.00)) AND isnotnull(ca_address_sk#10)) + +(14) Project [codegen id : 2] +Output [1]: [ca_address_sk#10] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] + +(15) BroadcastExchange +Input [1]: [ca_address_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#2] +Right keys [1]: [ca_address_sk#10] +Join condition: None + +(17) Project [codegen id : 5] +Output [2]: [ss_item_sk#1, ss_ext_sales_price#3] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ca_address_sk#10] + +(18) Scan parquet default.item +Output [2]: [i_item_sk#13, i_item_id#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#13, i_item_id#14] + +(20) Filter [codegen id : 4] +Input [2]: [i_item_sk#13, i_item_id#14] +Condition : isnotnull(i_item_sk#13) + +(21) Scan parquet default.item +Output [2]: [i_item_id#15, i_color#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_color, [slate ,blanched ,burnished ])] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_id#15, i_color#16] + +(23) Filter [codegen id : 3] +Input [2]: [i_item_id#15, i_color#16] +Condition : i_color#16 IN (slate ,blanched ,burnished ) + +(24) Project [codegen id : 3] +Output [1]: [i_item_id#15] +Input [2]: [i_item_id#15, i_color#16] + +(25) BroadcastExchange +Input [1]: [i_item_id#15] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#17] + +(26) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_id#14] +Right keys [1]: [i_item_id#15] +Join condition: None + +(27) BroadcastExchange +Input [2]: [i_item_sk#13, i_item_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(29) Project [codegen id : 5] +Output [2]: [ss_ext_sales_price#3, i_item_id#14] +Input [4]: [ss_item_sk#1, ss_ext_sales_price#3, i_item_sk#13, i_item_id#14] + +(30) HashAggregate [codegen id : 5] +Input [2]: [ss_ext_sales_price#3, i_item_id#14] +Keys [1]: [i_item_id#14] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum#19] +Results [2]: [i_item_id#14, sum#20] + +(31) Exchange +Input [2]: [i_item_id#14, sum#20] +Arguments: hashpartitioning(i_item_id#14, 5), ENSURE_REQUIREMENTS, [id=#21] + +(32) HashAggregate [codegen id : 6] +Input [2]: [i_item_id#14, sum#20] +Keys [1]: [i_item_id#14] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#22] +Results [2]: [i_item_id#14, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#22,17,2) AS total_sales#23] + +(33) Scan parquet default.catalog_sales +Output [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#27), dynamicpruningexpression(cs_sold_date_sk#27 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] + +(35) Filter [codegen id : 11] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] +Condition : (isnotnull(cs_bill_addr_sk#24) AND isnotnull(cs_item_sk#25)) + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#28] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#27] +Right keys [1]: [d_date_sk#28] +Join condition: None + +(38) Project [codegen id : 11] +Output [3]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] +Input [5]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27, d_date_sk#28] + +(39) ReusedExchange [Reuses operator id: 15] +Output [1]: [ca_address_sk#29] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_bill_addr_sk#24] +Right keys [1]: [ca_address_sk#29] +Join condition: None + +(41) Project [codegen id : 11] +Output [2]: [cs_item_sk#25, cs_ext_sales_price#26] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, ca_address_sk#29] + +(42) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#30, i_item_id#31] + +(43) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_item_sk#25] +Right keys [1]: [i_item_sk#30] +Join condition: None + +(44) Project [codegen id : 11] +Output [2]: [cs_ext_sales_price#26, i_item_id#31] +Input [4]: [cs_item_sk#25, cs_ext_sales_price#26, i_item_sk#30, i_item_id#31] + +(45) HashAggregate [codegen id : 11] +Input [2]: [cs_ext_sales_price#26, i_item_id#31] +Keys [1]: [i_item_id#31] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#26))] +Aggregate Attributes [1]: [sum#32] +Results [2]: [i_item_id#31, sum#33] + +(46) Exchange +Input [2]: [i_item_id#31, sum#33] +Arguments: hashpartitioning(i_item_id#31, 5), ENSURE_REQUIREMENTS, [id=#34] + +(47) HashAggregate [codegen id : 12] +Input [2]: [i_item_id#31, sum#33] +Keys [1]: [i_item_id#31] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#26))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#26))#35] +Results [2]: [i_item_id#31, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#26))#35,17,2) AS total_sales#36] + +(48) Scan parquet default.web_sales +Output [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#40), dynamicpruningexpression(ws_sold_date_sk#40 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 17] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] + +(50) Filter [codegen id : 17] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] +Condition : (isnotnull(ws_bill_addr_sk#38) AND isnotnull(ws_item_sk#37)) + +(51) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#41] + +(52) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#40] +Right keys [1]: [d_date_sk#41] +Join condition: None + +(53) Project [codegen id : 17] +Output [3]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39] +Input [5]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40, d_date_sk#41] + +(54) ReusedExchange [Reuses operator id: 15] +Output [1]: [ca_address_sk#42] + +(55) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_bill_addr_sk#38] +Right keys [1]: [ca_address_sk#42] +Join condition: None + +(56) Project [codegen id : 17] +Output [2]: [ws_item_sk#37, ws_ext_sales_price#39] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ca_address_sk#42] + +(57) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#43, i_item_id#44] + +(58) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_item_sk#37] +Right keys [1]: [i_item_sk#43] +Join condition: None + +(59) Project [codegen id : 17] +Output [2]: [ws_ext_sales_price#39, i_item_id#44] +Input [4]: [ws_item_sk#37, ws_ext_sales_price#39, i_item_sk#43, i_item_id#44] + +(60) HashAggregate [codegen id : 17] +Input [2]: [ws_ext_sales_price#39, i_item_id#44] +Keys [1]: [i_item_id#44] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#39))] +Aggregate Attributes [1]: [sum#45] +Results [2]: [i_item_id#44, sum#46] + +(61) Exchange +Input [2]: [i_item_id#44, sum#46] +Arguments: hashpartitioning(i_item_id#44, 5), ENSURE_REQUIREMENTS, [id=#47] + +(62) HashAggregate [codegen id : 18] +Input [2]: [i_item_id#44, sum#46] +Keys [1]: [i_item_id#44] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#39))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#39))#48] +Results [2]: [i_item_id#44, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#39))#48,17,2) AS total_sales#49] + +(63) Union + +(64) HashAggregate [codegen id : 19] +Input [2]: [i_item_id#14, total_sales#23] +Keys [1]: [i_item_id#14] +Functions [1]: [partial_sum(total_sales#23)] +Aggregate Attributes [2]: [sum#50, isEmpty#51] +Results [3]: [i_item_id#14, sum#52, isEmpty#53] + +(65) Exchange +Input [3]: [i_item_id#14, sum#52, isEmpty#53] +Arguments: hashpartitioning(i_item_id#14, 5), ENSURE_REQUIREMENTS, [id=#54] + +(66) HashAggregate [codegen id : 20] +Input [3]: [i_item_id#14, sum#52, isEmpty#53] +Keys [1]: [i_item_id#14] +Functions [1]: [sum(total_sales#23)] +Aggregate Attributes [1]: [sum(total_sales#23)#55] +Results [2]: [i_item_id#14, sum(total_sales#23)#55 AS total_sales#56] + +(67) TakeOrderedAndProject +Input [2]: [i_item_id#14, total_sales#56] +Arguments: 100, [total_sales#56 ASC NULLS FIRST], [i_item_id#14, total_sales#56] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (68) + + +(68) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 33 Hosting Expression = cs_sold_date_sk#27 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 48 Hosting Expression = ws_sold_date_sk#40 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/simplified.txt new file mode 100644 index 0000000000000..2d21010c26b8d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56.sf100/simplified.txt @@ -0,0 +1,105 @@ +TakeOrderedAndProject [total_sales,i_item_id] + WholeStageCodegen (20) + HashAggregate [i_item_id,sum,isEmpty] [sum(total_sales),total_sales,sum,isEmpty] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (19) + HashAggregate [i_item_id,total_sales] [sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (6) + HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_item_id] #2 + WholeStageCodegen (5) + HashAggregate [i_item_id,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_item_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_addr_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_addr_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [ca_address_sk] + Filter [ca_gmt_offset,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_gmt_offset] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + BroadcastHashJoin [i_item_id,i_item_id] + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [i_item_id] + Filter [i_color] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_id,i_color] + WholeStageCodegen (12) + HashAggregate [i_item_id,sum] [sum(UnscaledValue(cs_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_item_id] #7 + WholeStageCodegen (11) + HashAggregate [i_item_id,cs_ext_sales_price] [sum,sum] + Project [cs_ext_sales_price,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_bill_addr_sk,ca_address_sk] + Project [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_addr_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [ca_address_sk] #4 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 + WholeStageCodegen (18) + HashAggregate [i_item_id,sum] [sum(UnscaledValue(ws_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_item_id] #8 + WholeStageCodegen (17) + HashAggregate [i_item_id,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,i_item_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] + Project [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_addr_sk,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [ca_address_sk] #4 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/explain.txt new file mode 100644 index 0000000000000..47eda1483a06c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/explain.txt @@ -0,0 +1,395 @@ +== Physical Plan == +TakeOrderedAndProject (67) ++- * HashAggregate (66) + +- Exchange (65) + +- * HashAggregate (64) + +- Union (63) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.customer_address (11) + : +- BroadcastExchange (27) + : +- * BroadcastHashJoin LeftSemi BuildRight (26) + : :- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.item (18) + : +- BroadcastExchange (25) + : +- * Project (24) + : +- * Filter (23) + : +- * ColumnarToRow (22) + : +- Scan parquet default.item (21) + :- * HashAggregate (47) + : +- Exchange (46) + : +- * HashAggregate (45) + : +- * Project (44) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Project (41) + : : +- * BroadcastHashJoin Inner BuildRight (40) + : : :- * Project (38) + : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.catalog_sales (33) + : : : +- ReusedExchange (36) + : : +- ReusedExchange (39) + : +- ReusedExchange (42) + +- * HashAggregate (62) + +- Exchange (61) + +- * HashAggregate (60) + +- * Project (59) + +- * BroadcastHashJoin Inner BuildRight (58) + :- * Project (56) + : +- * BroadcastHashJoin Inner BuildRight (55) + : :- * Project (53) + : : +- * BroadcastHashJoin Inner BuildRight (52) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.web_sales (48) + : : +- ReusedExchange (51) + : +- ReusedExchange (54) + +- ReusedExchange (57) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_addr_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 5] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_addr_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,2), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((isnotnull(d_year#7) AND isnotnull(d_moy#8)) AND (d_year#7 = 2001)) AND (d_moy#8 = 2)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 5] +Output [3]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] +Input [5]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.customer_address +Output [2]: [ca_address_sk#10, ca_gmt_offset#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_gmt_offset), EqualTo(ca_gmt_offset,-5.00), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] + +(13) Filter [codegen id : 2] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] +Condition : ((isnotnull(ca_gmt_offset#11) AND (ca_gmt_offset#11 = -5.00)) AND isnotnull(ca_address_sk#10)) + +(14) Project [codegen id : 2] +Output [1]: [ca_address_sk#10] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] + +(15) BroadcastExchange +Input [1]: [ca_address_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#2] +Right keys [1]: [ca_address_sk#10] +Join condition: None + +(17) Project [codegen id : 5] +Output [2]: [ss_item_sk#1, ss_ext_sales_price#3] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ca_address_sk#10] + +(18) Scan parquet default.item +Output [2]: [i_item_sk#13, i_item_id#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#13, i_item_id#14] + +(20) Filter [codegen id : 4] +Input [2]: [i_item_sk#13, i_item_id#14] +Condition : isnotnull(i_item_sk#13) + +(21) Scan parquet default.item +Output [2]: [i_item_id#15, i_color#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_color, [slate ,blanched ,burnished ])] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_id#15, i_color#16] + +(23) Filter [codegen id : 3] +Input [2]: [i_item_id#15, i_color#16] +Condition : i_color#16 IN (slate ,blanched ,burnished ) + +(24) Project [codegen id : 3] +Output [1]: [i_item_id#15] +Input [2]: [i_item_id#15, i_color#16] + +(25) BroadcastExchange +Input [1]: [i_item_id#15] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#17] + +(26) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_id#14] +Right keys [1]: [i_item_id#15] +Join condition: None + +(27) BroadcastExchange +Input [2]: [i_item_sk#13, i_item_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(29) Project [codegen id : 5] +Output [2]: [ss_ext_sales_price#3, i_item_id#14] +Input [4]: [ss_item_sk#1, ss_ext_sales_price#3, i_item_sk#13, i_item_id#14] + +(30) HashAggregate [codegen id : 5] +Input [2]: [ss_ext_sales_price#3, i_item_id#14] +Keys [1]: [i_item_id#14] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum#19] +Results [2]: [i_item_id#14, sum#20] + +(31) Exchange +Input [2]: [i_item_id#14, sum#20] +Arguments: hashpartitioning(i_item_id#14, 5), ENSURE_REQUIREMENTS, [id=#21] + +(32) HashAggregate [codegen id : 6] +Input [2]: [i_item_id#14, sum#20] +Keys [1]: [i_item_id#14] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#22] +Results [2]: [i_item_id#14, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#22,17,2) AS total_sales#23] + +(33) Scan parquet default.catalog_sales +Output [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#27), dynamicpruningexpression(cs_sold_date_sk#27 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] + +(35) Filter [codegen id : 11] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] +Condition : (isnotnull(cs_bill_addr_sk#24) AND isnotnull(cs_item_sk#25)) + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#28] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#27] +Right keys [1]: [d_date_sk#28] +Join condition: None + +(38) Project [codegen id : 11] +Output [3]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] +Input [5]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27, d_date_sk#28] + +(39) ReusedExchange [Reuses operator id: 15] +Output [1]: [ca_address_sk#29] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_bill_addr_sk#24] +Right keys [1]: [ca_address_sk#29] +Join condition: None + +(41) Project [codegen id : 11] +Output [2]: [cs_item_sk#25, cs_ext_sales_price#26] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, ca_address_sk#29] + +(42) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#30, i_item_id#31] + +(43) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_item_sk#25] +Right keys [1]: [i_item_sk#30] +Join condition: None + +(44) Project [codegen id : 11] +Output [2]: [cs_ext_sales_price#26, i_item_id#31] +Input [4]: [cs_item_sk#25, cs_ext_sales_price#26, i_item_sk#30, i_item_id#31] + +(45) HashAggregate [codegen id : 11] +Input [2]: [cs_ext_sales_price#26, i_item_id#31] +Keys [1]: [i_item_id#31] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#26))] +Aggregate Attributes [1]: [sum#32] +Results [2]: [i_item_id#31, sum#33] + +(46) Exchange +Input [2]: [i_item_id#31, sum#33] +Arguments: hashpartitioning(i_item_id#31, 5), ENSURE_REQUIREMENTS, [id=#34] + +(47) HashAggregate [codegen id : 12] +Input [2]: [i_item_id#31, sum#33] +Keys [1]: [i_item_id#31] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#26))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#26))#35] +Results [2]: [i_item_id#31, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#26))#35,17,2) AS total_sales#36] + +(48) Scan parquet default.web_sales +Output [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#40), dynamicpruningexpression(ws_sold_date_sk#40 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 17] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] + +(50) Filter [codegen id : 17] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] +Condition : (isnotnull(ws_bill_addr_sk#38) AND isnotnull(ws_item_sk#37)) + +(51) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#41] + +(52) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#40] +Right keys [1]: [d_date_sk#41] +Join condition: None + +(53) Project [codegen id : 17] +Output [3]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39] +Input [5]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40, d_date_sk#41] + +(54) ReusedExchange [Reuses operator id: 15] +Output [1]: [ca_address_sk#42] + +(55) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_bill_addr_sk#38] +Right keys [1]: [ca_address_sk#42] +Join condition: None + +(56) Project [codegen id : 17] +Output [2]: [ws_item_sk#37, ws_ext_sales_price#39] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ca_address_sk#42] + +(57) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#43, i_item_id#44] + +(58) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_item_sk#37] +Right keys [1]: [i_item_sk#43] +Join condition: None + +(59) Project [codegen id : 17] +Output [2]: [ws_ext_sales_price#39, i_item_id#44] +Input [4]: [ws_item_sk#37, ws_ext_sales_price#39, i_item_sk#43, i_item_id#44] + +(60) HashAggregate [codegen id : 17] +Input [2]: [ws_ext_sales_price#39, i_item_id#44] +Keys [1]: [i_item_id#44] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#39))] +Aggregate Attributes [1]: [sum#45] +Results [2]: [i_item_id#44, sum#46] + +(61) Exchange +Input [2]: [i_item_id#44, sum#46] +Arguments: hashpartitioning(i_item_id#44, 5), ENSURE_REQUIREMENTS, [id=#47] + +(62) HashAggregate [codegen id : 18] +Input [2]: [i_item_id#44, sum#46] +Keys [1]: [i_item_id#44] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#39))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#39))#48] +Results [2]: [i_item_id#44, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#39))#48,17,2) AS total_sales#49] + +(63) Union + +(64) HashAggregate [codegen id : 19] +Input [2]: [i_item_id#14, total_sales#23] +Keys [1]: [i_item_id#14] +Functions [1]: [partial_sum(total_sales#23)] +Aggregate Attributes [2]: [sum#50, isEmpty#51] +Results [3]: [i_item_id#14, sum#52, isEmpty#53] + +(65) Exchange +Input [3]: [i_item_id#14, sum#52, isEmpty#53] +Arguments: hashpartitioning(i_item_id#14, 5), ENSURE_REQUIREMENTS, [id=#54] + +(66) HashAggregate [codegen id : 20] +Input [3]: [i_item_id#14, sum#52, isEmpty#53] +Keys [1]: [i_item_id#14] +Functions [1]: [sum(total_sales#23)] +Aggregate Attributes [1]: [sum(total_sales#23)#55] +Results [2]: [i_item_id#14, sum(total_sales#23)#55 AS total_sales#56] + +(67) TakeOrderedAndProject +Input [2]: [i_item_id#14, total_sales#56] +Arguments: 100, [total_sales#56 ASC NULLS FIRST], [i_item_id#14, total_sales#56] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (68) + + +(68) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 33 Hosting Expression = cs_sold_date_sk#27 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 48 Hosting Expression = ws_sold_date_sk#40 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/simplified.txt new file mode 100644 index 0000000000000..2d21010c26b8d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q56/simplified.txt @@ -0,0 +1,105 @@ +TakeOrderedAndProject [total_sales,i_item_id] + WholeStageCodegen (20) + HashAggregate [i_item_id,sum,isEmpty] [sum(total_sales),total_sales,sum,isEmpty] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (19) + HashAggregate [i_item_id,total_sales] [sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (6) + HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_item_id] #2 + WholeStageCodegen (5) + HashAggregate [i_item_id,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_item_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_addr_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_addr_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [ca_address_sk] + Filter [ca_gmt_offset,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_gmt_offset] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + BroadcastHashJoin [i_item_id,i_item_id] + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [i_item_id] + Filter [i_color] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_id,i_color] + WholeStageCodegen (12) + HashAggregate [i_item_id,sum] [sum(UnscaledValue(cs_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_item_id] #7 + WholeStageCodegen (11) + HashAggregate [i_item_id,cs_ext_sales_price] [sum,sum] + Project [cs_ext_sales_price,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_bill_addr_sk,ca_address_sk] + Project [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_addr_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [ca_address_sk] #4 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 + WholeStageCodegen (18) + HashAggregate [i_item_id,sum] [sum(UnscaledValue(ws_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_item_id] #8 + WholeStageCodegen (17) + HashAggregate [i_item_id,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,i_item_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] + Project [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_addr_sk,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [ca_address_sk] #4 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/explain.txt new file mode 100644 index 0000000000000..6e39745703215 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/explain.txt @@ -0,0 +1,314 @@ +== Physical Plan == +TakeOrderedAndProject (56) ++- * Project (55) + +- * SortMergeJoin Inner (54) + :- * Project (47) + : +- * SortMergeJoin Inner (46) + : :- * Sort (37) + : : +- Exchange (36) + : : +- * Filter (35) + : : +- Window (34) + : : +- * Sort (33) + : : +- Exchange (32) + : : +- * Project (31) + : : +- Window (30) + : : +- * Sort (29) + : : +- Exchange (28) + : : +- * HashAggregate (27) + : : +- Exchange (26) + : : +- * HashAggregate (25) + : : +- * Project (24) + : : +- * SortMergeJoin Inner (23) + : : :- * Sort (17) + : : : +- Exchange (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.call_center (10) + : : +- * Sort (22) + : : +- Exchange (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.item (18) + : +- * Sort (45) + : +- Exchange (44) + : +- * Project (43) + : +- Window (42) + : +- * Sort (41) + : +- Exchange (40) + : +- * HashAggregate (39) + : +- ReusedExchange (38) + +- * Sort (53) + +- Exchange (52) + +- * Project (51) + +- Window (50) + +- * Sort (49) + +- ReusedExchange (48) + + +(1) Scan parquet default.catalog_sales +Output [4]: [cs_call_center_sk#1, cs_item_sk#2, cs_sales_price#3, cs_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#4), dynamicpruningexpression(cs_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_call_center_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [cs_call_center_sk#1, cs_item_sk#2, cs_sales_price#3, cs_sold_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [cs_call_center_sk#1, cs_item_sk#2, cs_sales_price#3, cs_sold_date_sk#4] +Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_call_center_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(Or(EqualTo(d_year,1999),And(EqualTo(d_year,1998),EqualTo(d_moy,12))),And(EqualTo(d_year,2000),EqualTo(d_moy,1))), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((d_year#7 = 1999) OR ((d_year#7 = 1998) AND (d_moy#8 = 12))) OR ((d_year#7 = 2000) AND (d_moy#8 = 1))) AND isnotnull(d_date_sk#6)) + +(7) BroadcastExchange +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(9) Project [codegen id : 3] +Output [5]: [cs_call_center_sk#1, cs_item_sk#2, cs_sales_price#3, d_year#7, d_moy#8] +Input [7]: [cs_call_center_sk#1, cs_item_sk#2, cs_sales_price#3, cs_sold_date_sk#4, d_date_sk#6, d_year#7, d_moy#8] + +(10) Scan parquet default.call_center +Output [2]: [cc_call_center_sk#10, cc_name#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_call_center_sk), IsNotNull(cc_name)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [cc_call_center_sk#10, cc_name#11] + +(12) Filter [codegen id : 2] +Input [2]: [cc_call_center_sk#10, cc_name#11] +Condition : (isnotnull(cc_call_center_sk#10) AND isnotnull(cc_name#11)) + +(13) BroadcastExchange +Input [2]: [cc_call_center_sk#10, cc_name#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_call_center_sk#1] +Right keys [1]: [cc_call_center_sk#10] +Join condition: None + +(15) Project [codegen id : 3] +Output [5]: [cs_item_sk#2, cs_sales_price#3, d_year#7, d_moy#8, cc_name#11] +Input [7]: [cs_call_center_sk#1, cs_item_sk#2, cs_sales_price#3, d_year#7, d_moy#8, cc_call_center_sk#10, cc_name#11] + +(16) Exchange +Input [5]: [cs_item_sk#2, cs_sales_price#3, d_year#7, d_moy#8, cc_name#11] +Arguments: hashpartitioning(cs_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#13] + +(17) Sort [codegen id : 4] +Input [5]: [cs_item_sk#2, cs_sales_price#3, d_year#7, d_moy#8, cc_name#11] +Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 + +(18) Scan parquet default.item +Output [3]: [i_item_sk#14, i_brand#15, i_category#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_category), IsNotNull(i_brand)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 5] +Input [3]: [i_item_sk#14, i_brand#15, i_category#16] + +(20) Filter [codegen id : 5] +Input [3]: [i_item_sk#14, i_brand#15, i_category#16] +Condition : ((isnotnull(i_item_sk#14) AND isnotnull(i_category#16)) AND isnotnull(i_brand#15)) + +(21) Exchange +Input [3]: [i_item_sk#14, i_brand#15, i_category#16] +Arguments: hashpartitioning(i_item_sk#14, 5), ENSURE_REQUIREMENTS, [id=#17] + +(22) Sort [codegen id : 6] +Input [3]: [i_item_sk#14, i_brand#15, i_category#16] +Arguments: [i_item_sk#14 ASC NULLS FIRST], false, 0 + +(23) SortMergeJoin [codegen id : 7] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#14] +Join condition: None + +(24) Project [codegen id : 7] +Output [6]: [i_brand#15, i_category#16, cs_sales_price#3, d_year#7, d_moy#8, cc_name#11] +Input [8]: [cs_item_sk#2, cs_sales_price#3, d_year#7, d_moy#8, cc_name#11, i_item_sk#14, i_brand#15, i_category#16] + +(25) HashAggregate [codegen id : 7] +Input [6]: [i_brand#15, i_category#16, cs_sales_price#3, d_year#7, d_moy#8, cc_name#11] +Keys [5]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8] +Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#3))] +Aggregate Attributes [1]: [sum#18] +Results [6]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum#19] + +(26) Exchange +Input [6]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum#19] +Arguments: hashpartitioning(i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, 5), ENSURE_REQUIREMENTS, [id=#20] + +(27) HashAggregate [codegen id : 8] +Input [6]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum#19] +Keys [5]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8] +Functions [1]: [sum(UnscaledValue(cs_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#3))#21] +Results [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, MakeDecimal(sum(UnscaledValue(cs_sales_price#3))#21,17,2) AS sum_sales#22, MakeDecimal(sum(UnscaledValue(cs_sales_price#3))#21,17,2) AS _w0#23] + +(28) Exchange +Input [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, _w0#23] +Arguments: hashpartitioning(i_category#16, i_brand#15, cc_name#11, d_year#7, 5), ENSURE_REQUIREMENTS, [id=#24] + +(29) Sort [codegen id : 9] +Input [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, _w0#23] +Arguments: [i_category#16 ASC NULLS FIRST, i_brand#15 ASC NULLS FIRST, cc_name#11 ASC NULLS FIRST, d_year#7 ASC NULLS FIRST], false, 0 + +(30) Window +Input [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, _w0#23] +Arguments: [avg(_w0#23) windowspecdefinition(i_category#16, i_brand#15, cc_name#11, d_year#7, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#25], [i_category#16, i_brand#15, cc_name#11, d_year#7] + +(31) Project [codegen id : 10] +Output [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25] +Input [8]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, _w0#23, avg_monthly_sales#25] + +(32) Exchange +Input [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25] +Arguments: hashpartitioning(i_category#16, i_brand#15, cc_name#11, 5), ENSURE_REQUIREMENTS, [id=#26] + +(33) Sort [codegen id : 11] +Input [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25] +Arguments: [i_category#16 ASC NULLS FIRST, i_brand#15 ASC NULLS FIRST, cc_name#11 ASC NULLS FIRST, d_year#7 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST], false, 0 + +(34) Window +Input [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25] +Arguments: [rank(d_year#7, d_moy#8) windowspecdefinition(i_category#16, i_brand#15, cc_name#11, d_year#7 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#27], [i_category#16, i_brand#15, cc_name#11], [d_year#7 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST] + +(35) Filter [codegen id : 12] +Input [8]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25, rn#27] +Condition : ((((isnotnull(d_year#7) AND isnotnull(avg_monthly_sales#25)) AND (d_year#7 = 1999)) AND (avg_monthly_sales#25 > 0.000000)) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)) + +(36) Exchange +Input [8]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25, rn#27] +Arguments: hashpartitioning(i_category#16, i_brand#15, cc_name#11, rn#27, 5), ENSURE_REQUIREMENTS, [id=#28] + +(37) Sort [codegen id : 13] +Input [8]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25, rn#27] +Arguments: [i_category#16 ASC NULLS FIRST, i_brand#15 ASC NULLS FIRST, cc_name#11 ASC NULLS FIRST, rn#27 ASC NULLS FIRST], false, 0 + +(38) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, sum#34] + +(39) HashAggregate [codegen id : 21] +Input [6]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, sum#34] +Keys [5]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33] +Functions [1]: [sum(UnscaledValue(cs_sales_price#35))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#35))#36] +Results [6]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, MakeDecimal(sum(UnscaledValue(cs_sales_price#35))#36,17,2) AS sum_sales#37] + +(40) Exchange +Input [6]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, sum_sales#37] +Arguments: hashpartitioning(i_category#29, i_brand#30, cc_name#31, 5), ENSURE_REQUIREMENTS, [id=#38] + +(41) Sort [codegen id : 22] +Input [6]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, sum_sales#37] +Arguments: [i_category#29 ASC NULLS FIRST, i_brand#30 ASC NULLS FIRST, cc_name#31 ASC NULLS FIRST, d_year#32 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST], false, 0 + +(42) Window +Input [6]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, sum_sales#37] +Arguments: [rank(d_year#32, d_moy#33) windowspecdefinition(i_category#29, i_brand#30, cc_name#31, d_year#32 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#39], [i_category#29, i_brand#30, cc_name#31], [d_year#32 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST] + +(43) Project [codegen id : 23] +Output [5]: [i_category#29, i_brand#30, cc_name#31, sum_sales#37, rn#39] +Input [7]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, sum_sales#37, rn#39] + +(44) Exchange +Input [5]: [i_category#29, i_brand#30, cc_name#31, sum_sales#37, rn#39] +Arguments: hashpartitioning(i_category#29, i_brand#30, cc_name#31, (rn#39 + 1), 5), ENSURE_REQUIREMENTS, [id=#40] + +(45) Sort [codegen id : 24] +Input [5]: [i_category#29, i_brand#30, cc_name#31, sum_sales#37, rn#39] +Arguments: [i_category#29 ASC NULLS FIRST, i_brand#30 ASC NULLS FIRST, cc_name#31 ASC NULLS FIRST, (rn#39 + 1) ASC NULLS FIRST], false, 0 + +(46) SortMergeJoin [codegen id : 25] +Left keys [4]: [i_category#16, i_brand#15, cc_name#11, rn#27] +Right keys [4]: [i_category#29, i_brand#30, cc_name#31, (rn#39 + 1)] +Join condition: None + +(47) Project [codegen id : 25] +Output [9]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25, rn#27, sum_sales#37] +Input [13]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25, rn#27, i_category#29, i_brand#30, cc_name#31, sum_sales#37, rn#39] + +(48) ReusedExchange [Reuses operator id: 40] +Output [6]: [i_category#41, i_brand#42, cc_name#43, d_year#44, d_moy#45, sum_sales#46] + +(49) Sort [codegen id : 34] +Input [6]: [i_category#41, i_brand#42, cc_name#43, d_year#44, d_moy#45, sum_sales#46] +Arguments: [i_category#41 ASC NULLS FIRST, i_brand#42 ASC NULLS FIRST, cc_name#43 ASC NULLS FIRST, d_year#44 ASC NULLS FIRST, d_moy#45 ASC NULLS FIRST], false, 0 + +(50) Window +Input [6]: [i_category#41, i_brand#42, cc_name#43, d_year#44, d_moy#45, sum_sales#46] +Arguments: [rank(d_year#44, d_moy#45) windowspecdefinition(i_category#41, i_brand#42, cc_name#43, d_year#44 ASC NULLS FIRST, d_moy#45 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#47], [i_category#41, i_brand#42, cc_name#43], [d_year#44 ASC NULLS FIRST, d_moy#45 ASC NULLS FIRST] + +(51) Project [codegen id : 35] +Output [5]: [i_category#41, i_brand#42, cc_name#43, sum_sales#46, rn#47] +Input [7]: [i_category#41, i_brand#42, cc_name#43, d_year#44, d_moy#45, sum_sales#46, rn#47] + +(52) Exchange +Input [5]: [i_category#41, i_brand#42, cc_name#43, sum_sales#46, rn#47] +Arguments: hashpartitioning(i_category#41, i_brand#42, cc_name#43, (rn#47 - 1), 5), ENSURE_REQUIREMENTS, [id=#48] + +(53) Sort [codegen id : 36] +Input [5]: [i_category#41, i_brand#42, cc_name#43, sum_sales#46, rn#47] +Arguments: [i_category#41 ASC NULLS FIRST, i_brand#42 ASC NULLS FIRST, cc_name#43 ASC NULLS FIRST, (rn#47 - 1) ASC NULLS FIRST], false, 0 + +(54) SortMergeJoin [codegen id : 37] +Left keys [4]: [i_category#16, i_brand#15, cc_name#11, rn#27] +Right keys [4]: [i_category#41, i_brand#42, cc_name#43, (rn#47 - 1)] +Join condition: None + +(55) Project [codegen id : 37] +Output [9]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, avg_monthly_sales#25, sum_sales#22, sum_sales#37 AS psum#49, sum_sales#46 AS nsum#50] +Input [14]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25, rn#27, sum_sales#37, i_category#41, i_brand#42, cc_name#43, sum_sales#46, rn#47] + +(56) TakeOrderedAndProject +Input [9]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, avg_monthly_sales#25, sum_sales#22, psum#49, nsum#50] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, cc_name#11 ASC NULLS FIRST], [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, avg_monthly_sales#25, sum_sales#22, psum#49, nsum#50] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (57) + + +(57) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/simplified.txt new file mode 100644 index 0000000000000..bd84b91e1ac12 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57.sf100/simplified.txt @@ -0,0 +1,107 @@ +TakeOrderedAndProject [sum_sales,avg_monthly_sales,cc_name,i_category,i_brand,d_year,d_moy,psum,nsum] + WholeStageCodegen (37) + Project [i_category,i_brand,cc_name,d_year,d_moy,avg_monthly_sales,sum_sales,sum_sales,sum_sales] + SortMergeJoin [i_category,i_brand,cc_name,rn,i_category,i_brand,cc_name,rn] + InputAdapter + WholeStageCodegen (25) + Project [i_category,i_brand,cc_name,d_year,d_moy,sum_sales,avg_monthly_sales,rn,sum_sales] + SortMergeJoin [i_category,i_brand,cc_name,rn,i_category,i_brand,cc_name,rn] + InputAdapter + WholeStageCodegen (13) + Sort [i_category,i_brand,cc_name,rn] + InputAdapter + Exchange [i_category,i_brand,cc_name,rn] #1 + WholeStageCodegen (12) + Filter [d_year,avg_monthly_sales,sum_sales] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,cc_name] + WholeStageCodegen (11) + Sort [i_category,i_brand,cc_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,cc_name] #2 + WholeStageCodegen (10) + Project [i_category,i_brand,cc_name,d_year,d_moy,sum_sales,avg_monthly_sales] + InputAdapter + Window [_w0,i_category,i_brand,cc_name,d_year] + WholeStageCodegen (9) + Sort [i_category,i_brand,cc_name,d_year] + InputAdapter + Exchange [i_category,i_brand,cc_name,d_year] #3 + WholeStageCodegen (8) + HashAggregate [i_category,i_brand,cc_name,d_year,d_moy,sum] [sum(UnscaledValue(cs_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_category,i_brand,cc_name,d_year,d_moy] #4 + WholeStageCodegen (7) + HashAggregate [i_category,i_brand,cc_name,d_year,d_moy,cs_sales_price] [sum,sum] + Project [i_brand,i_category,cs_sales_price,d_year,d_moy,cc_name] + SortMergeJoin [cs_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #5 + WholeStageCodegen (3) + Project [cs_item_sk,cs_sales_price,d_year,d_moy,cc_name] + BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] + Project [cs_call_center_sk,cs_item_sk,cs_sales_price,d_year,d_moy] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk,cs_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_call_center_sk,cs_item_sk,cs_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (2) + Filter [cc_call_center_sk,cc_name] + ColumnarToRow + InputAdapter + Scan parquet default.call_center [cc_call_center_sk,cc_name] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #8 + WholeStageCodegen (5) + Filter [i_item_sk,i_category,i_brand] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_category] + InputAdapter + WholeStageCodegen (24) + Sort [i_category,i_brand,cc_name,rn] + InputAdapter + Exchange [i_category,i_brand,cc_name,rn] #9 + WholeStageCodegen (23) + Project [i_category,i_brand,cc_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,cc_name] + WholeStageCodegen (22) + Sort [i_category,i_brand,cc_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,cc_name] #10 + WholeStageCodegen (21) + HashAggregate [i_category,i_brand,cc_name,d_year,d_moy,sum] [sum(UnscaledValue(cs_sales_price)),sum_sales,sum] + InputAdapter + ReusedExchange [i_category,i_brand,cc_name,d_year,d_moy,sum] #11 + InputAdapter + WholeStageCodegen (36) + Sort [i_category,i_brand,cc_name,rn] + InputAdapter + Exchange [i_category,i_brand,cc_name,rn] #12 + WholeStageCodegen (35) + Project [i_category,i_brand,cc_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,cc_name] + WholeStageCodegen (34) + Sort [i_category,i_brand,cc_name,d_year,d_moy] + InputAdapter + ReusedExchange [i_category,i_brand,cc_name,d_year,d_moy,sum_sales] #10 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57/explain.txt new file mode 100644 index 0000000000000..fa24f5ede5453 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57/explain.txt @@ -0,0 +1,279 @@ +== Physical Plan == +TakeOrderedAndProject (49) ++- * Project (48) + +- * BroadcastHashJoin Inner BuildRight (47) + :- * Project (41) + : +- * BroadcastHashJoin Inner BuildRight (40) + : :- * Filter (32) + : : +- Window (31) + : : +- * Sort (30) + : : +- Exchange (29) + : : +- * Project (28) + : : +- Window (27) + : : +- * Sort (26) + : : +- Exchange (25) + : : +- * HashAggregate (24) + : : +- Exchange (23) + : : +- * HashAggregate (22) + : : +- * Project (21) + : : +- * BroadcastHashJoin Inner BuildRight (20) + : : :- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.item (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.catalog_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (19) + : : +- * Filter (18) + : : +- * ColumnarToRow (17) + : : +- Scan parquet default.call_center (16) + : +- BroadcastExchange (39) + : +- * Project (38) + : +- Window (37) + : +- * Sort (36) + : +- Exchange (35) + : +- * HashAggregate (34) + : +- ReusedExchange (33) + +- BroadcastExchange (46) + +- * Project (45) + +- Window (44) + +- * Sort (43) + +- ReusedExchange (42) + + +(1) Scan parquet default.item +Output [3]: [i_item_sk#1, i_brand#2, i_category#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_category), IsNotNull(i_brand)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [3]: [i_item_sk#1, i_brand#2, i_category#3] + +(3) Filter [codegen id : 4] +Input [3]: [i_item_sk#1, i_brand#2, i_category#3] +Condition : ((isnotnull(i_item_sk#1) AND isnotnull(i_category#3)) AND isnotnull(i_brand#2)) + +(4) Scan parquet default.catalog_sales +Output [4]: [cs_call_center_sk#4, cs_item_sk#5, cs_sales_price#6, cs_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#7), dynamicpruningexpression(cs_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_call_center_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cs_call_center_sk#4, cs_item_sk#5, cs_sales_price#6, cs_sold_date_sk#7] + +(6) Filter [codegen id : 1] +Input [4]: [cs_call_center_sk#4, cs_item_sk#5, cs_sales_price#6, cs_sold_date_sk#7] +Condition : (isnotnull(cs_item_sk#5) AND isnotnull(cs_call_center_sk#4)) + +(7) BroadcastExchange +Input [4]: [cs_call_center_sk#4, cs_item_sk#5, cs_sales_price#6, cs_sold_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#9] + +(8) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [cs_item_sk#5] +Join condition: None + +(9) Project [codegen id : 4] +Output [5]: [i_brand#2, i_category#3, cs_call_center_sk#4, cs_sales_price#6, cs_sold_date_sk#7] +Input [7]: [i_item_sk#1, i_brand#2, i_category#3, cs_call_center_sk#4, cs_item_sk#5, cs_sales_price#6, cs_sold_date_sk#7] + +(10) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(Or(EqualTo(d_year,1999),And(EqualTo(d_year,1998),EqualTo(d_moy,12))),And(EqualTo(d_year,2000),EqualTo(d_moy,1))), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(12) Filter [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Condition : ((((d_year#11 = 1999) OR ((d_year#11 = 1998) AND (d_moy#12 = 12))) OR ((d_year#11 = 2000) AND (d_moy#12 = 1))) AND isnotnull(d_date_sk#10)) + +(13) BroadcastExchange +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#7] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(15) Project [codegen id : 4] +Output [6]: [i_brand#2, i_category#3, cs_call_center_sk#4, cs_sales_price#6, d_year#11, d_moy#12] +Input [8]: [i_brand#2, i_category#3, cs_call_center_sk#4, cs_sales_price#6, cs_sold_date_sk#7, d_date_sk#10, d_year#11, d_moy#12] + +(16) Scan parquet default.call_center +Output [2]: [cc_call_center_sk#14, cc_name#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_call_center_sk), IsNotNull(cc_name)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [2]: [cc_call_center_sk#14, cc_name#15] + +(18) Filter [codegen id : 3] +Input [2]: [cc_call_center_sk#14, cc_name#15] +Condition : (isnotnull(cc_call_center_sk#14) AND isnotnull(cc_name#15)) + +(19) BroadcastExchange +Input [2]: [cc_call_center_sk#14, cc_name#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(20) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_call_center_sk#4] +Right keys [1]: [cc_call_center_sk#14] +Join condition: None + +(21) Project [codegen id : 4] +Output [6]: [i_brand#2, i_category#3, cs_sales_price#6, d_year#11, d_moy#12, cc_name#15] +Input [8]: [i_brand#2, i_category#3, cs_call_center_sk#4, cs_sales_price#6, d_year#11, d_moy#12, cc_call_center_sk#14, cc_name#15] + +(22) HashAggregate [codegen id : 4] +Input [6]: [i_brand#2, i_category#3, cs_sales_price#6, d_year#11, d_moy#12, cc_name#15] +Keys [5]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12] +Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#6))] +Aggregate Attributes [1]: [sum#17] +Results [6]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum#18] + +(23) Exchange +Input [6]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum#18] +Arguments: hashpartitioning(i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, 5), ENSURE_REQUIREMENTS, [id=#19] + +(24) HashAggregate [codegen id : 5] +Input [6]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum#18] +Keys [5]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12] +Functions [1]: [sum(UnscaledValue(cs_sales_price#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#6))#20] +Results [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, MakeDecimal(sum(UnscaledValue(cs_sales_price#6))#20,17,2) AS sum_sales#21, MakeDecimal(sum(UnscaledValue(cs_sales_price#6))#20,17,2) AS _w0#22] + +(25) Exchange +Input [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, _w0#22] +Arguments: hashpartitioning(i_category#3, i_brand#2, cc_name#15, d_year#11, 5), ENSURE_REQUIREMENTS, [id=#23] + +(26) Sort [codegen id : 6] +Input [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, _w0#22] +Arguments: [i_category#3 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, cc_name#15 ASC NULLS FIRST, d_year#11 ASC NULLS FIRST], false, 0 + +(27) Window +Input [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, _w0#22] +Arguments: [avg(_w0#22) windowspecdefinition(i_category#3, i_brand#2, cc_name#15, d_year#11, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#24], [i_category#3, i_brand#2, cc_name#15, d_year#11] + +(28) Project [codegen id : 7] +Output [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24] +Input [8]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, _w0#22, avg_monthly_sales#24] + +(29) Exchange +Input [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24] +Arguments: hashpartitioning(i_category#3, i_brand#2, cc_name#15, 5), ENSURE_REQUIREMENTS, [id=#25] + +(30) Sort [codegen id : 8] +Input [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24] +Arguments: [i_category#3 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, cc_name#15 ASC NULLS FIRST, d_year#11 ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST], false, 0 + +(31) Window +Input [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24] +Arguments: [rank(d_year#11, d_moy#12) windowspecdefinition(i_category#3, i_brand#2, cc_name#15, d_year#11 ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#26], [i_category#3, i_brand#2, cc_name#15], [d_year#11 ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST] + +(32) Filter [codegen id : 23] +Input [8]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24, rn#26] +Condition : ((((isnotnull(d_year#11) AND isnotnull(avg_monthly_sales#24)) AND (d_year#11 = 1999)) AND (avg_monthly_sales#24 > 0.000000)) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)) + +(33) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, sum#32] + +(34) HashAggregate [codegen id : 13] +Input [6]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, sum#32] +Keys [5]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31] +Functions [1]: [sum(UnscaledValue(cs_sales_price#33))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#33))#34] +Results [6]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, MakeDecimal(sum(UnscaledValue(cs_sales_price#33))#34,17,2) AS sum_sales#35] + +(35) Exchange +Input [6]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, sum_sales#35] +Arguments: hashpartitioning(i_category#27, i_brand#28, cc_name#29, 5), ENSURE_REQUIREMENTS, [id=#36] + +(36) Sort [codegen id : 14] +Input [6]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, sum_sales#35] +Arguments: [i_category#27 ASC NULLS FIRST, i_brand#28 ASC NULLS FIRST, cc_name#29 ASC NULLS FIRST, d_year#30 ASC NULLS FIRST, d_moy#31 ASC NULLS FIRST], false, 0 + +(37) Window +Input [6]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, sum_sales#35] +Arguments: [rank(d_year#30, d_moy#31) windowspecdefinition(i_category#27, i_brand#28, cc_name#29, d_year#30 ASC NULLS FIRST, d_moy#31 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#37], [i_category#27, i_brand#28, cc_name#29], [d_year#30 ASC NULLS FIRST, d_moy#31 ASC NULLS FIRST] + +(38) Project [codegen id : 15] +Output [5]: [i_category#27, i_brand#28, cc_name#29, sum_sales#35, rn#37] +Input [7]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, sum_sales#35, rn#37] + +(39) BroadcastExchange +Input [5]: [i_category#27, i_brand#28, cc_name#29, sum_sales#35, rn#37] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true], input[1, string, true], input[2, string, true], (input[4, int, false] + 1)),false), [id=#38] + +(40) BroadcastHashJoin [codegen id : 23] +Left keys [4]: [i_category#3, i_brand#2, cc_name#15, rn#26] +Right keys [4]: [i_category#27, i_brand#28, cc_name#29, (rn#37 + 1)] +Join condition: None + +(41) Project [codegen id : 23] +Output [9]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24, rn#26, sum_sales#35] +Input [13]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24, rn#26, i_category#27, i_brand#28, cc_name#29, sum_sales#35, rn#37] + +(42) ReusedExchange [Reuses operator id: 35] +Output [6]: [i_category#39, i_brand#40, cc_name#41, d_year#42, d_moy#43, sum_sales#44] + +(43) Sort [codegen id : 21] +Input [6]: [i_category#39, i_brand#40, cc_name#41, d_year#42, d_moy#43, sum_sales#44] +Arguments: [i_category#39 ASC NULLS FIRST, i_brand#40 ASC NULLS FIRST, cc_name#41 ASC NULLS FIRST, d_year#42 ASC NULLS FIRST, d_moy#43 ASC NULLS FIRST], false, 0 + +(44) Window +Input [6]: [i_category#39, i_brand#40, cc_name#41, d_year#42, d_moy#43, sum_sales#44] +Arguments: [rank(d_year#42, d_moy#43) windowspecdefinition(i_category#39, i_brand#40, cc_name#41, d_year#42 ASC NULLS FIRST, d_moy#43 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#45], [i_category#39, i_brand#40, cc_name#41], [d_year#42 ASC NULLS FIRST, d_moy#43 ASC NULLS FIRST] + +(45) Project [codegen id : 22] +Output [5]: [i_category#39, i_brand#40, cc_name#41, sum_sales#44, rn#45] +Input [7]: [i_category#39, i_brand#40, cc_name#41, d_year#42, d_moy#43, sum_sales#44, rn#45] + +(46) BroadcastExchange +Input [5]: [i_category#39, i_brand#40, cc_name#41, sum_sales#44, rn#45] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true], input[1, string, true], input[2, string, true], (input[4, int, false] - 1)),false), [id=#46] + +(47) BroadcastHashJoin [codegen id : 23] +Left keys [4]: [i_category#3, i_brand#2, cc_name#15, rn#26] +Right keys [4]: [i_category#39, i_brand#40, cc_name#41, (rn#45 - 1)] +Join condition: None + +(48) Project [codegen id : 23] +Output [9]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, avg_monthly_sales#24, sum_sales#21, sum_sales#35 AS psum#47, sum_sales#44 AS nsum#48] +Input [14]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24, rn#26, sum_sales#35, i_category#39, i_brand#40, cc_name#41, sum_sales#44, rn#45] + +(49) TakeOrderedAndProject +Input [9]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, avg_monthly_sales#24, sum_sales#21, psum#47, nsum#48] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, cc_name#15 ASC NULLS FIRST], [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, avg_monthly_sales#24, sum_sales#21, psum#47, nsum#48] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = cs_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (50) + + +(50) ReusedExchange [Reuses operator id: 13] +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57/simplified.txt new file mode 100644 index 0000000000000..e9e7cf96303c3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q57/simplified.txt @@ -0,0 +1,84 @@ +TakeOrderedAndProject [sum_sales,avg_monthly_sales,cc_name,i_category,i_brand,d_year,d_moy,psum,nsum] + WholeStageCodegen (23) + Project [i_category,i_brand,cc_name,d_year,d_moy,avg_monthly_sales,sum_sales,sum_sales,sum_sales] + BroadcastHashJoin [i_category,i_brand,cc_name,rn,i_category,i_brand,cc_name,rn] + Project [i_category,i_brand,cc_name,d_year,d_moy,sum_sales,avg_monthly_sales,rn,sum_sales] + BroadcastHashJoin [i_category,i_brand,cc_name,rn,i_category,i_brand,cc_name,rn] + Filter [d_year,avg_monthly_sales,sum_sales] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,cc_name] + WholeStageCodegen (8) + Sort [i_category,i_brand,cc_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,cc_name] #1 + WholeStageCodegen (7) + Project [i_category,i_brand,cc_name,d_year,d_moy,sum_sales,avg_monthly_sales] + InputAdapter + Window [_w0,i_category,i_brand,cc_name,d_year] + WholeStageCodegen (6) + Sort [i_category,i_brand,cc_name,d_year] + InputAdapter + Exchange [i_category,i_brand,cc_name,d_year] #2 + WholeStageCodegen (5) + HashAggregate [i_category,i_brand,cc_name,d_year,d_moy,sum] [sum(UnscaledValue(cs_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_category,i_brand,cc_name,d_year,d_moy] #3 + WholeStageCodegen (4) + HashAggregate [i_category,i_brand,cc_name,d_year,d_moy,cs_sales_price] [sum,sum] + Project [i_brand,i_category,cs_sales_price,d_year,d_moy,cc_name] + BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] + Project [i_brand,i_category,cs_call_center_sk,cs_sales_price,d_year,d_moy] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [i_brand,i_category,cs_call_center_sk,cs_sales_price,cs_sold_date_sk] + BroadcastHashJoin [i_item_sk,cs_item_sk] + Filter [i_item_sk,i_category,i_brand] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [cs_item_sk,cs_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_call_center_sk,cs_item_sk,cs_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Filter [cc_call_center_sk,cc_name] + ColumnarToRow + InputAdapter + Scan parquet default.call_center [cc_call_center_sk,cc_name] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (15) + Project [i_category,i_brand,cc_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,cc_name] + WholeStageCodegen (14) + Sort [i_category,i_brand,cc_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,cc_name] #8 + WholeStageCodegen (13) + HashAggregate [i_category,i_brand,cc_name,d_year,d_moy,sum] [sum(UnscaledValue(cs_sales_price)),sum_sales,sum] + InputAdapter + ReusedExchange [i_category,i_brand,cc_name,d_year,d_moy,sum] #9 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (22) + Project [i_category,i_brand,cc_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,cc_name] + WholeStageCodegen (21) + Sort [i_category,i_brand,cc_name,d_year,d_moy] + InputAdapter + ReusedExchange [i_category,i_brand,cc_name,d_year,d_moy,sum_sales] #8 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q58.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q58.sf100/explain.txt new file mode 100644 index 0000000000000..b339df0707d2f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q58.sf100/explain.txt @@ -0,0 +1,480 @@ +== Physical Plan == +TakeOrderedAndProject (79) ++- * Project (78) + +- * BroadcastHashJoin Inner BuildRight (77) + :- * Project (52) + : +- * BroadcastHashJoin Inner BuildRight (51) + : :- * Filter (26) + : : +- * HashAggregate (25) + : : +- Exchange (24) + : : +- * HashAggregate (23) + : : +- * Project (22) + : : +- * BroadcastHashJoin Inner BuildRight (21) + : : :- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (14) + : : : +- * Project (13) + : : : +- * BroadcastHashJoin LeftSemi BuildRight (12) + : : : :- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (11) + : : : +- * Project (10) + : : : +- * Filter (9) + : : : +- * ColumnarToRow (8) + : : : +- Scan parquet default.date_dim (7) + : : +- BroadcastExchange (20) + : : +- * Filter (19) + : : +- * ColumnarToRow (18) + : : +- Scan parquet default.item (17) + : +- BroadcastExchange (50) + : +- * Filter (49) + : +- * HashAggregate (48) + : +- Exchange (47) + : +- * HashAggregate (46) + : +- * Project (45) + : +- * BroadcastHashJoin Inner BuildRight (44) + : :- * Project (42) + : : +- * BroadcastHashJoin Inner BuildRight (41) + : : :- * Filter (29) + : : : +- * ColumnarToRow (28) + : : : +- Scan parquet default.catalog_sales (27) + : : +- BroadcastExchange (40) + : : +- * Project (39) + : : +- * BroadcastHashJoin LeftSemi BuildRight (38) + : : :- * Filter (32) + : : : +- * ColumnarToRow (31) + : : : +- Scan parquet default.date_dim (30) + : : +- BroadcastExchange (37) + : : +- * Project (36) + : : +- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.date_dim (33) + : +- ReusedExchange (43) + +- BroadcastExchange (76) + +- * Filter (75) + +- * HashAggregate (74) + +- Exchange (73) + +- * HashAggregate (72) + +- * Project (71) + +- * BroadcastHashJoin Inner BuildRight (70) + :- * Project (68) + : +- * BroadcastHashJoin Inner BuildRight (67) + : :- * Filter (55) + : : +- * ColumnarToRow (54) + : : +- Scan parquet default.web_sales (53) + : +- BroadcastExchange (66) + : +- * Project (65) + : +- * BroadcastHashJoin LeftSemi BuildRight (64) + : :- * Filter (58) + : : +- * ColumnarToRow (57) + : : +- Scan parquet default.date_dim (56) + : +- BroadcastExchange (63) + : +- * Project (62) + : +- * Filter (61) + : +- * ColumnarToRow (60) + : +- Scan parquet default.date_dim (59) + +- ReusedExchange (69) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 4] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#4, d_date#5] + +(6) Filter [codegen id : 2] +Input [2]: [d_date_sk#4, d_date#5] +Condition : isnotnull(d_date_sk#4) + +(7) Scan parquet default.date_dim +Output [2]: [d_date#6, d_week_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 1] +Input [2]: [d_date#6, d_week_seq#7] + +(9) Filter [codegen id : 1] +Input [2]: [d_date#6, d_week_seq#7] +Condition : (isnotnull(d_week_seq#7) AND (d_week_seq#7 = Subquery scalar-subquery#8, [id=#9])) + +(10) Project [codegen id : 1] +Output [1]: [d_date#6] +Input [2]: [d_date#6, d_week_seq#7] + +(11) BroadcastExchange +Input [1]: [d_date#6] +Arguments: HashedRelationBroadcastMode(List(input[0, date, true]),false), [id=#10] + +(12) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [d_date#5] +Right keys [1]: [d_date#6] +Join condition: None + +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] + +(14) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#4] +Join condition: None + +(16) Project [codegen id : 4] +Output [2]: [ss_item_sk#1, ss_ext_sales_price#2] +Input [4]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, d_date_sk#4] + +(17) Scan parquet default.item +Output [2]: [i_item_sk#12, i_item_id#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_item_id)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_sk#12, i_item_id#13] + +(19) Filter [codegen id : 3] +Input [2]: [i_item_sk#12, i_item_id#13] +Condition : (isnotnull(i_item_sk#12) AND isnotnull(i_item_id#13)) + +(20) BroadcastExchange +Input [2]: [i_item_sk#12, i_item_id#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#12] +Join condition: None + +(22) Project [codegen id : 4] +Output [2]: [ss_ext_sales_price#2, i_item_id#13] +Input [4]: [ss_item_sk#1, ss_ext_sales_price#2, i_item_sk#12, i_item_id#13] + +(23) HashAggregate [codegen id : 4] +Input [2]: [ss_ext_sales_price#2, i_item_id#13] +Keys [1]: [i_item_id#13] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#15] +Results [2]: [i_item_id#13, sum#16] + +(24) Exchange +Input [2]: [i_item_id#13, sum#16] +Arguments: hashpartitioning(i_item_id#13, 5), ENSURE_REQUIREMENTS, [id=#17] + +(25) HashAggregate [codegen id : 15] +Input [2]: [i_item_id#13, sum#16] +Keys [1]: [i_item_id#13] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#18] +Results [2]: [i_item_id#13 AS item_id#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#18,17,2) AS ss_item_rev#20] + +(26) Filter [codegen id : 15] +Input [2]: [item_id#19, ss_item_rev#20] +Condition : isnotnull(ss_item_rev#20) + +(27) Scan parquet default.catalog_sales +Output [3]: [cs_item_sk#21, cs_ext_sales_price#22, cs_sold_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#23), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 8] +Input [3]: [cs_item_sk#21, cs_ext_sales_price#22, cs_sold_date_sk#23] + +(29) Filter [codegen id : 8] +Input [3]: [cs_item_sk#21, cs_ext_sales_price#22, cs_sold_date_sk#23] +Condition : isnotnull(cs_item_sk#21) + +(30) Scan parquet default.date_dim +Output [2]: [d_date_sk#24, d_date#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 6] +Input [2]: [d_date_sk#24, d_date#25] + +(32) Filter [codegen id : 6] +Input [2]: [d_date_sk#24, d_date#25] +Condition : isnotnull(d_date_sk#24) + +(33) Scan parquet default.date_dim +Output [2]: [d_date#26, d_week_seq#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 5] +Input [2]: [d_date#26, d_week_seq#27] + +(35) Filter [codegen id : 5] +Input [2]: [d_date#26, d_week_seq#27] +Condition : (isnotnull(d_week_seq#27) AND (d_week_seq#27 = ReusedSubquery Subquery scalar-subquery#8, [id=#9])) + +(36) Project [codegen id : 5] +Output [1]: [d_date#26] +Input [2]: [d_date#26, d_week_seq#27] + +(37) BroadcastExchange +Input [1]: [d_date#26] +Arguments: HashedRelationBroadcastMode(List(input[0, date, true]),false), [id=#28] + +(38) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [d_date#25] +Right keys [1]: [d_date#26] +Join condition: None + +(39) Project [codegen id : 6] +Output [1]: [d_date_sk#24] +Input [2]: [d_date_sk#24, d_date#25] + +(40) BroadcastExchange +Input [1]: [d_date_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] + +(41) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_sold_date_sk#23] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(42) Project [codegen id : 8] +Output [2]: [cs_item_sk#21, cs_ext_sales_price#22] +Input [4]: [cs_item_sk#21, cs_ext_sales_price#22, cs_sold_date_sk#23, d_date_sk#24] + +(43) ReusedExchange [Reuses operator id: 20] +Output [2]: [i_item_sk#30, i_item_id#31] + +(44) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_item_sk#21] +Right keys [1]: [i_item_sk#30] +Join condition: None + +(45) Project [codegen id : 8] +Output [2]: [cs_ext_sales_price#22, i_item_id#31] +Input [4]: [cs_item_sk#21, cs_ext_sales_price#22, i_item_sk#30, i_item_id#31] + +(46) HashAggregate [codegen id : 8] +Input [2]: [cs_ext_sales_price#22, i_item_id#31] +Keys [1]: [i_item_id#31] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#22))] +Aggregate Attributes [1]: [sum#32] +Results [2]: [i_item_id#31, sum#33] + +(47) Exchange +Input [2]: [i_item_id#31, sum#33] +Arguments: hashpartitioning(i_item_id#31, 5), ENSURE_REQUIREMENTS, [id=#34] + +(48) HashAggregate [codegen id : 9] +Input [2]: [i_item_id#31, sum#33] +Keys [1]: [i_item_id#31] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#22))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#22))#35] +Results [2]: [i_item_id#31 AS item_id#36, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#22))#35,17,2) AS cs_item_rev#37] + +(49) Filter [codegen id : 9] +Input [2]: [item_id#36, cs_item_rev#37] +Condition : isnotnull(cs_item_rev#37) + +(50) BroadcastExchange +Input [2]: [item_id#36, cs_item_rev#37] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#38] + +(51) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [item_id#19] +Right keys [1]: [item_id#36] +Join condition: ((((cast(ss_item_rev#20 as decimal(19,3)) >= CheckOverflow((0.90 * promote_precision(cs_item_rev#37)), DecimalType(19,3), true)) AND (cast(ss_item_rev#20 as decimal(20,3)) <= CheckOverflow((1.10 * promote_precision(cs_item_rev#37)), DecimalType(20,3), true))) AND (cast(cs_item_rev#37 as decimal(19,3)) >= CheckOverflow((0.90 * promote_precision(ss_item_rev#20)), DecimalType(19,3), true))) AND (cast(cs_item_rev#37 as decimal(20,3)) <= CheckOverflow((1.10 * promote_precision(ss_item_rev#20)), DecimalType(20,3), true))) + +(52) Project [codegen id : 15] +Output [3]: [item_id#19, ss_item_rev#20, cs_item_rev#37] +Input [4]: [item_id#19, ss_item_rev#20, item_id#36, cs_item_rev#37] + +(53) Scan parquet default.web_sales +Output [3]: [ws_item_sk#39, ws_ext_sales_price#40, ws_sold_date_sk#41] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#41), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(54) ColumnarToRow [codegen id : 13] +Input [3]: [ws_item_sk#39, ws_ext_sales_price#40, ws_sold_date_sk#41] + +(55) Filter [codegen id : 13] +Input [3]: [ws_item_sk#39, ws_ext_sales_price#40, ws_sold_date_sk#41] +Condition : isnotnull(ws_item_sk#39) + +(56) Scan parquet default.date_dim +Output [2]: [d_date_sk#42, d_date#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(57) ColumnarToRow [codegen id : 11] +Input [2]: [d_date_sk#42, d_date#43] + +(58) Filter [codegen id : 11] +Input [2]: [d_date_sk#42, d_date#43] +Condition : isnotnull(d_date_sk#42) + +(59) Scan parquet default.date_dim +Output [2]: [d_date#44, d_week_seq#45] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq)] +ReadSchema: struct + +(60) ColumnarToRow [codegen id : 10] +Input [2]: [d_date#44, d_week_seq#45] + +(61) Filter [codegen id : 10] +Input [2]: [d_date#44, d_week_seq#45] +Condition : (isnotnull(d_week_seq#45) AND (d_week_seq#45 = ReusedSubquery Subquery scalar-subquery#8, [id=#9])) + +(62) Project [codegen id : 10] +Output [1]: [d_date#44] +Input [2]: [d_date#44, d_week_seq#45] + +(63) BroadcastExchange +Input [1]: [d_date#44] +Arguments: HashedRelationBroadcastMode(List(input[0, date, true]),false), [id=#46] + +(64) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [d_date#43] +Right keys [1]: [d_date#44] +Join condition: None + +(65) Project [codegen id : 11] +Output [1]: [d_date_sk#42] +Input [2]: [d_date_sk#42, d_date#43] + +(66) BroadcastExchange +Input [1]: [d_date_sk#42] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#47] + +(67) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ws_sold_date_sk#41] +Right keys [1]: [d_date_sk#42] +Join condition: None + +(68) Project [codegen id : 13] +Output [2]: [ws_item_sk#39, ws_ext_sales_price#40] +Input [4]: [ws_item_sk#39, ws_ext_sales_price#40, ws_sold_date_sk#41, d_date_sk#42] + +(69) ReusedExchange [Reuses operator id: 20] +Output [2]: [i_item_sk#48, i_item_id#49] + +(70) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ws_item_sk#39] +Right keys [1]: [i_item_sk#48] +Join condition: None + +(71) Project [codegen id : 13] +Output [2]: [ws_ext_sales_price#40, i_item_id#49] +Input [4]: [ws_item_sk#39, ws_ext_sales_price#40, i_item_sk#48, i_item_id#49] + +(72) HashAggregate [codegen id : 13] +Input [2]: [ws_ext_sales_price#40, i_item_id#49] +Keys [1]: [i_item_id#49] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#40))] +Aggregate Attributes [1]: [sum#50] +Results [2]: [i_item_id#49, sum#51] + +(73) Exchange +Input [2]: [i_item_id#49, sum#51] +Arguments: hashpartitioning(i_item_id#49, 5), ENSURE_REQUIREMENTS, [id=#52] + +(74) HashAggregate [codegen id : 14] +Input [2]: [i_item_id#49, sum#51] +Keys [1]: [i_item_id#49] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#40))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#40))#53] +Results [2]: [i_item_id#49 AS item_id#54, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#40))#53,17,2) AS ws_item_rev#55] + +(75) Filter [codegen id : 14] +Input [2]: [item_id#54, ws_item_rev#55] +Condition : isnotnull(ws_item_rev#55) + +(76) BroadcastExchange +Input [2]: [item_id#54, ws_item_rev#55] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#56] + +(77) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [item_id#19] +Right keys [1]: [item_id#54] +Join condition: ((((((((cast(ss_item_rev#20 as decimal(19,3)) >= CheckOverflow((0.90 * promote_precision(ws_item_rev#55)), DecimalType(19,3), true)) AND (cast(ss_item_rev#20 as decimal(20,3)) <= CheckOverflow((1.10 * promote_precision(ws_item_rev#55)), DecimalType(20,3), true))) AND (cast(cs_item_rev#37 as decimal(19,3)) >= CheckOverflow((0.90 * promote_precision(ws_item_rev#55)), DecimalType(19,3), true))) AND (cast(cs_item_rev#37 as decimal(20,3)) <= CheckOverflow((1.10 * promote_precision(ws_item_rev#55)), DecimalType(20,3), true))) AND (cast(ws_item_rev#55 as decimal(19,3)) >= CheckOverflow((0.90 * promote_precision(ss_item_rev#20)), DecimalType(19,3), true))) AND (cast(ws_item_rev#55 as decimal(20,3)) <= CheckOverflow((1.10 * promote_precision(ss_item_rev#20)), DecimalType(20,3), true))) AND (cast(ws_item_rev#55 as decimal(19,3)) >= CheckOverflow((0.90 * promote_precision(cs_item_rev#37)), DecimalType(19,3), true))) AND (cast(ws_item_rev#55 as decimal(20,3)) <= CheckOverflow((1.10 * promote_precision(cs_item_rev#37)), DecimalType(20,3), true))) + +(78) Project [codegen id : 15] +Output [8]: [item_id#19, ss_item_rev#20, CheckOverflow((promote_precision(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(ss_item_rev#20 as decimal(19,2))) / promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_item_rev#20 as decimal(18,2))) + promote_precision(cast(cs_item_rev#37 as decimal(18,2)))), DecimalType(18,2), true) as decimal(19,2))) + promote_precision(cast(ws_item_rev#55 as decimal(19,2)))), DecimalType(19,2), true))), DecimalType(38,21), true)) / 3.000000000000000000000), DecimalType(38,21), true)) * 100.000000000000000000000), DecimalType(38,17), true) AS ss_dev#57, cs_item_rev#37, CheckOverflow((promote_precision(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(cs_item_rev#37 as decimal(19,2))) / promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_item_rev#20 as decimal(18,2))) + promote_precision(cast(cs_item_rev#37 as decimal(18,2)))), DecimalType(18,2), true) as decimal(19,2))) + promote_precision(cast(ws_item_rev#55 as decimal(19,2)))), DecimalType(19,2), true))), DecimalType(38,21), true)) / 3.000000000000000000000), DecimalType(38,21), true)) * 100.000000000000000000000), DecimalType(38,17), true) AS cs_dev#58, ws_item_rev#55, CheckOverflow((promote_precision(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(ws_item_rev#55 as decimal(19,2))) / promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_item_rev#20 as decimal(18,2))) + promote_precision(cast(cs_item_rev#37 as decimal(18,2)))), DecimalType(18,2), true) as decimal(19,2))) + promote_precision(cast(ws_item_rev#55 as decimal(19,2)))), DecimalType(19,2), true))), DecimalType(38,21), true)) / 3.000000000000000000000), DecimalType(38,21), true)) * 100.000000000000000000000), DecimalType(38,17), true) AS ws_dev#59, CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_item_rev#20 as decimal(18,2))) + promote_precision(cast(cs_item_rev#37 as decimal(18,2)))), DecimalType(18,2), true) as decimal(19,2))) + promote_precision(cast(ws_item_rev#55 as decimal(19,2)))), DecimalType(19,2), true)) / 3.00), DecimalType(23,6), true) AS average#60] +Input [5]: [item_id#19, ss_item_rev#20, cs_item_rev#37, item_id#54, ws_item_rev#55] + +(79) TakeOrderedAndProject +Input [8]: [item_id#19, ss_item_rev#20, ss_dev#57, cs_item_rev#37, cs_dev#58, ws_item_rev#55, ws_dev#59, average#60] +Arguments: 100, [item_id#19 ASC NULLS FIRST, ss_item_rev#20 ASC NULLS FIRST], [item_id#19, ss_item_rev#20, ss_dev#57, cs_item_rev#37, cs_dev#58, ws_item_rev#55, ws_dev#59, average#60] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 9 Hosting Expression = Subquery scalar-subquery#8, [id=#9] +* Project (83) ++- * Filter (82) + +- * ColumnarToRow (81) + +- Scan parquet default.date_dim (80) + + +(80) Scan parquet default.date_dim +Output [2]: [d_date#61, d_week_seq#62] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), EqualTo(d_date,2000-01-03)] +ReadSchema: struct + +(81) ColumnarToRow [codegen id : 1] +Input [2]: [d_date#61, d_week_seq#62] + +(82) Filter [codegen id : 1] +Input [2]: [d_date#61, d_week_seq#62] +Condition : (isnotnull(d_date#61) AND (d_date#61 = 2000-01-03)) + +(83) Project [codegen id : 1] +Output [1]: [d_week_seq#62] +Input [2]: [d_date#61, d_week_seq#62] + +Subquery:2 Hosting operator id = 35 Hosting Expression = ReusedSubquery Subquery scalar-subquery#8, [id=#9] + +Subquery:3 Hosting operator id = 61 Hosting Expression = ReusedSubquery Subquery scalar-subquery#8, [id=#9] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q58.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q58.sf100/simplified.txt new file mode 100644 index 0000000000000..5642c7dcbf91c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q58.sf100/simplified.txt @@ -0,0 +1,125 @@ +TakeOrderedAndProject [item_id,ss_item_rev,ss_dev,cs_item_rev,cs_dev,ws_item_rev,ws_dev,average] + WholeStageCodegen (15) + Project [item_id,ss_item_rev,cs_item_rev,ws_item_rev] + BroadcastHashJoin [item_id,item_id,ss_item_rev,ws_item_rev,cs_item_rev] + Project [item_id,ss_item_rev,cs_item_rev] + BroadcastHashJoin [item_id,item_id,ss_item_rev,cs_item_rev] + Filter [ss_item_rev] + HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),item_id,ss_item_rev,sum] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (4) + HashAggregate [i_item_id,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_item_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk] + BroadcastHashJoin [d_date,d_date] + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date] + Filter [d_week_seq] + Subquery #1 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_date] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date,d_week_seq] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [i_item_sk,i_item_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + Filter [cs_item_rev] + HashAggregate [i_item_id,sum] [sum(UnscaledValue(cs_ext_sales_price)),item_id,cs_item_rev,sum] + InputAdapter + Exchange [i_item_id] #6 + WholeStageCodegen (8) + HashAggregate [i_item_id,cs_ext_sales_price] [sum,sum] + Project [cs_ext_sales_price,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (6) + Project [d_date_sk] + BroadcastHashJoin [d_date,d_date] + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (5) + Project [d_date] + Filter [d_week_seq] + ReusedSubquery [d_week_seq] #1 + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date,d_week_seq] + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #4 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (14) + Filter [ws_item_rev] + HashAggregate [i_item_id,sum] [sum(UnscaledValue(ws_ext_sales_price)),item_id,ws_item_rev,sum] + InputAdapter + Exchange [i_item_id] #10 + WholeStageCodegen (13) + HashAggregate [i_item_id,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,i_item_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_ext_sales_price,ws_sold_date_sk] + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (11) + Project [d_date_sk] + BroadcastHashJoin [d_date,d_date] + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (10) + Project [d_date] + Filter [d_week_seq] + ReusedSubquery [d_week_seq] #1 + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date,d_week_seq] + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #4 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q58/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q58/explain.txt new file mode 100644 index 0000000000000..1f3e6853a3c41 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q58/explain.txt @@ -0,0 +1,480 @@ +== Physical Plan == +TakeOrderedAndProject (79) ++- * Project (78) + +- * BroadcastHashJoin Inner BuildRight (77) + :- * Project (52) + : +- * BroadcastHashJoin Inner BuildRight (51) + : :- * Filter (26) + : : +- * HashAggregate (25) + : : +- Exchange (24) + : : +- * HashAggregate (23) + : : +- * Project (22) + : : +- * BroadcastHashJoin Inner BuildRight (21) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.item (4) + : : +- BroadcastExchange (20) + : : +- * Project (19) + : : +- * BroadcastHashJoin LeftSemi BuildRight (18) + : : :- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (17) + : : +- * Project (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.date_dim (13) + : +- BroadcastExchange (50) + : +- * Filter (49) + : +- * HashAggregate (48) + : +- Exchange (47) + : +- * HashAggregate (46) + : +- * Project (45) + : +- * BroadcastHashJoin Inner BuildRight (44) + : :- * Project (32) + : : +- * BroadcastHashJoin Inner BuildRight (31) + : : :- * Filter (29) + : : : +- * ColumnarToRow (28) + : : : +- Scan parquet default.catalog_sales (27) + : : +- ReusedExchange (30) + : +- BroadcastExchange (43) + : +- * Project (42) + : +- * BroadcastHashJoin LeftSemi BuildRight (41) + : :- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.date_dim (33) + : +- BroadcastExchange (40) + : +- * Project (39) + : +- * Filter (38) + : +- * ColumnarToRow (37) + : +- Scan parquet default.date_dim (36) + +- BroadcastExchange (76) + +- * Filter (75) + +- * HashAggregate (74) + +- Exchange (73) + +- * HashAggregate (72) + +- * Project (71) + +- * BroadcastHashJoin Inner BuildRight (70) + :- * Project (58) + : +- * BroadcastHashJoin Inner BuildRight (57) + : :- * Filter (55) + : : +- * ColumnarToRow (54) + : : +- Scan parquet default.web_sales (53) + : +- ReusedExchange (56) + +- BroadcastExchange (69) + +- * Project (68) + +- * BroadcastHashJoin LeftSemi BuildRight (67) + :- * Filter (61) + : +- * ColumnarToRow (60) + : +- Scan parquet default.date_dim (59) + +- BroadcastExchange (66) + +- * Project (65) + +- * Filter (64) + +- * ColumnarToRow (63) + +- Scan parquet default.date_dim (62) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 4] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [2]: [i_item_sk#4, i_item_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_item_id)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [i_item_sk#4, i_item_id#5] + +(6) Filter [codegen id : 1] +Input [2]: [i_item_sk#4, i_item_id#5] +Condition : (isnotnull(i_item_sk#4) AND isnotnull(i_item_id#5)) + +(7) BroadcastExchange +Input [2]: [i_item_sk#4, i_item_id#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#6] + +(8) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#4] +Join condition: None + +(9) Project [codegen id : 4] +Output [3]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#5] +Input [5]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_sk#4, i_item_id#5] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_date#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#7, d_date#8] + +(12) Filter [codegen id : 3] +Input [2]: [d_date_sk#7, d_date#8] +Condition : isnotnull(d_date_sk#7) + +(13) Scan parquet default.date_dim +Output [2]: [d_date#9, d_week_seq#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 2] +Input [2]: [d_date#9, d_week_seq#10] + +(15) Filter [codegen id : 2] +Input [2]: [d_date#9, d_week_seq#10] +Condition : (isnotnull(d_week_seq#10) AND (d_week_seq#10 = Subquery scalar-subquery#11, [id=#12])) + +(16) Project [codegen id : 2] +Output [1]: [d_date#9] +Input [2]: [d_date#9, d_week_seq#10] + +(17) BroadcastExchange +Input [1]: [d_date#9] +Arguments: HashedRelationBroadcastMode(List(input[0, date, true]),false), [id=#13] + +(18) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date#8] +Right keys [1]: [d_date#9] +Join condition: None + +(19) Project [codegen id : 3] +Output [1]: [d_date_sk#7] +Input [2]: [d_date_sk#7, d_date#8] + +(20) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(22) Project [codegen id : 4] +Output [2]: [ss_ext_sales_price#2, i_item_id#5] +Input [4]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#5, d_date_sk#7] + +(23) HashAggregate [codegen id : 4] +Input [2]: [ss_ext_sales_price#2, i_item_id#5] +Keys [1]: [i_item_id#5] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#15] +Results [2]: [i_item_id#5, sum#16] + +(24) Exchange +Input [2]: [i_item_id#5, sum#16] +Arguments: hashpartitioning(i_item_id#5, 5), ENSURE_REQUIREMENTS, [id=#17] + +(25) HashAggregate [codegen id : 15] +Input [2]: [i_item_id#5, sum#16] +Keys [1]: [i_item_id#5] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#18] +Results [2]: [i_item_id#5 AS item_id#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#18,17,2) AS ss_item_rev#20] + +(26) Filter [codegen id : 15] +Input [2]: [item_id#19, ss_item_rev#20] +Condition : isnotnull(ss_item_rev#20) + +(27) Scan parquet default.catalog_sales +Output [3]: [cs_item_sk#21, cs_ext_sales_price#22, cs_sold_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#23), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 8] +Input [3]: [cs_item_sk#21, cs_ext_sales_price#22, cs_sold_date_sk#23] + +(29) Filter [codegen id : 8] +Input [3]: [cs_item_sk#21, cs_ext_sales_price#22, cs_sold_date_sk#23] +Condition : isnotnull(cs_item_sk#21) + +(30) ReusedExchange [Reuses operator id: 7] +Output [2]: [i_item_sk#24, i_item_id#25] + +(31) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_item_sk#21] +Right keys [1]: [i_item_sk#24] +Join condition: None + +(32) Project [codegen id : 8] +Output [3]: [cs_ext_sales_price#22, cs_sold_date_sk#23, i_item_id#25] +Input [5]: [cs_item_sk#21, cs_ext_sales_price#22, cs_sold_date_sk#23, i_item_sk#24, i_item_id#25] + +(33) Scan parquet default.date_dim +Output [2]: [d_date_sk#26, d_date#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 7] +Input [2]: [d_date_sk#26, d_date#27] + +(35) Filter [codegen id : 7] +Input [2]: [d_date_sk#26, d_date#27] +Condition : isnotnull(d_date_sk#26) + +(36) Scan parquet default.date_dim +Output [2]: [d_date#28, d_week_seq#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 6] +Input [2]: [d_date#28, d_week_seq#29] + +(38) Filter [codegen id : 6] +Input [2]: [d_date#28, d_week_seq#29] +Condition : (isnotnull(d_week_seq#29) AND (d_week_seq#29 = ReusedSubquery Subquery scalar-subquery#11, [id=#12])) + +(39) Project [codegen id : 6] +Output [1]: [d_date#28] +Input [2]: [d_date#28, d_week_seq#29] + +(40) BroadcastExchange +Input [1]: [d_date#28] +Arguments: HashedRelationBroadcastMode(List(input[0, date, true]),false), [id=#30] + +(41) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [d_date#27] +Right keys [1]: [d_date#28] +Join condition: None + +(42) Project [codegen id : 7] +Output [1]: [d_date_sk#26] +Input [2]: [d_date_sk#26, d_date#27] + +(43) BroadcastExchange +Input [1]: [d_date_sk#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#31] + +(44) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_sold_date_sk#23] +Right keys [1]: [d_date_sk#26] +Join condition: None + +(45) Project [codegen id : 8] +Output [2]: [cs_ext_sales_price#22, i_item_id#25] +Input [4]: [cs_ext_sales_price#22, cs_sold_date_sk#23, i_item_id#25, d_date_sk#26] + +(46) HashAggregate [codegen id : 8] +Input [2]: [cs_ext_sales_price#22, i_item_id#25] +Keys [1]: [i_item_id#25] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#22))] +Aggregate Attributes [1]: [sum#32] +Results [2]: [i_item_id#25, sum#33] + +(47) Exchange +Input [2]: [i_item_id#25, sum#33] +Arguments: hashpartitioning(i_item_id#25, 5), ENSURE_REQUIREMENTS, [id=#34] + +(48) HashAggregate [codegen id : 9] +Input [2]: [i_item_id#25, sum#33] +Keys [1]: [i_item_id#25] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#22))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#22))#35] +Results [2]: [i_item_id#25 AS item_id#36, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#22))#35,17,2) AS cs_item_rev#37] + +(49) Filter [codegen id : 9] +Input [2]: [item_id#36, cs_item_rev#37] +Condition : isnotnull(cs_item_rev#37) + +(50) BroadcastExchange +Input [2]: [item_id#36, cs_item_rev#37] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#38] + +(51) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [item_id#19] +Right keys [1]: [item_id#36] +Join condition: ((((cast(ss_item_rev#20 as decimal(19,3)) >= CheckOverflow((0.90 * promote_precision(cs_item_rev#37)), DecimalType(19,3), true)) AND (cast(ss_item_rev#20 as decimal(20,3)) <= CheckOverflow((1.10 * promote_precision(cs_item_rev#37)), DecimalType(20,3), true))) AND (cast(cs_item_rev#37 as decimal(19,3)) >= CheckOverflow((0.90 * promote_precision(ss_item_rev#20)), DecimalType(19,3), true))) AND (cast(cs_item_rev#37 as decimal(20,3)) <= CheckOverflow((1.10 * promote_precision(ss_item_rev#20)), DecimalType(20,3), true))) + +(52) Project [codegen id : 15] +Output [3]: [item_id#19, ss_item_rev#20, cs_item_rev#37] +Input [4]: [item_id#19, ss_item_rev#20, item_id#36, cs_item_rev#37] + +(53) Scan parquet default.web_sales +Output [3]: [ws_item_sk#39, ws_ext_sales_price#40, ws_sold_date_sk#41] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#41), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(54) ColumnarToRow [codegen id : 13] +Input [3]: [ws_item_sk#39, ws_ext_sales_price#40, ws_sold_date_sk#41] + +(55) Filter [codegen id : 13] +Input [3]: [ws_item_sk#39, ws_ext_sales_price#40, ws_sold_date_sk#41] +Condition : isnotnull(ws_item_sk#39) + +(56) ReusedExchange [Reuses operator id: 7] +Output [2]: [i_item_sk#42, i_item_id#43] + +(57) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ws_item_sk#39] +Right keys [1]: [i_item_sk#42] +Join condition: None + +(58) Project [codegen id : 13] +Output [3]: [ws_ext_sales_price#40, ws_sold_date_sk#41, i_item_id#43] +Input [5]: [ws_item_sk#39, ws_ext_sales_price#40, ws_sold_date_sk#41, i_item_sk#42, i_item_id#43] + +(59) Scan parquet default.date_dim +Output [2]: [d_date_sk#44, d_date#45] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(60) ColumnarToRow [codegen id : 12] +Input [2]: [d_date_sk#44, d_date#45] + +(61) Filter [codegen id : 12] +Input [2]: [d_date_sk#44, d_date#45] +Condition : isnotnull(d_date_sk#44) + +(62) Scan parquet default.date_dim +Output [2]: [d_date#46, d_week_seq#47] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq)] +ReadSchema: struct + +(63) ColumnarToRow [codegen id : 11] +Input [2]: [d_date#46, d_week_seq#47] + +(64) Filter [codegen id : 11] +Input [2]: [d_date#46, d_week_seq#47] +Condition : (isnotnull(d_week_seq#47) AND (d_week_seq#47 = ReusedSubquery Subquery scalar-subquery#11, [id=#12])) + +(65) Project [codegen id : 11] +Output [1]: [d_date#46] +Input [2]: [d_date#46, d_week_seq#47] + +(66) BroadcastExchange +Input [1]: [d_date#46] +Arguments: HashedRelationBroadcastMode(List(input[0, date, true]),false), [id=#48] + +(67) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [d_date#45] +Right keys [1]: [d_date#46] +Join condition: None + +(68) Project [codegen id : 12] +Output [1]: [d_date_sk#44] +Input [2]: [d_date_sk#44, d_date#45] + +(69) BroadcastExchange +Input [1]: [d_date_sk#44] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#49] + +(70) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ws_sold_date_sk#41] +Right keys [1]: [d_date_sk#44] +Join condition: None + +(71) Project [codegen id : 13] +Output [2]: [ws_ext_sales_price#40, i_item_id#43] +Input [4]: [ws_ext_sales_price#40, ws_sold_date_sk#41, i_item_id#43, d_date_sk#44] + +(72) HashAggregate [codegen id : 13] +Input [2]: [ws_ext_sales_price#40, i_item_id#43] +Keys [1]: [i_item_id#43] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#40))] +Aggregate Attributes [1]: [sum#50] +Results [2]: [i_item_id#43, sum#51] + +(73) Exchange +Input [2]: [i_item_id#43, sum#51] +Arguments: hashpartitioning(i_item_id#43, 5), ENSURE_REQUIREMENTS, [id=#52] + +(74) HashAggregate [codegen id : 14] +Input [2]: [i_item_id#43, sum#51] +Keys [1]: [i_item_id#43] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#40))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#40))#53] +Results [2]: [i_item_id#43 AS item_id#54, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#40))#53,17,2) AS ws_item_rev#55] + +(75) Filter [codegen id : 14] +Input [2]: [item_id#54, ws_item_rev#55] +Condition : isnotnull(ws_item_rev#55) + +(76) BroadcastExchange +Input [2]: [item_id#54, ws_item_rev#55] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#56] + +(77) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [item_id#19] +Right keys [1]: [item_id#54] +Join condition: ((((((((cast(ss_item_rev#20 as decimal(19,3)) >= CheckOverflow((0.90 * promote_precision(ws_item_rev#55)), DecimalType(19,3), true)) AND (cast(ss_item_rev#20 as decimal(20,3)) <= CheckOverflow((1.10 * promote_precision(ws_item_rev#55)), DecimalType(20,3), true))) AND (cast(cs_item_rev#37 as decimal(19,3)) >= CheckOverflow((0.90 * promote_precision(ws_item_rev#55)), DecimalType(19,3), true))) AND (cast(cs_item_rev#37 as decimal(20,3)) <= CheckOverflow((1.10 * promote_precision(ws_item_rev#55)), DecimalType(20,3), true))) AND (cast(ws_item_rev#55 as decimal(19,3)) >= CheckOverflow((0.90 * promote_precision(ss_item_rev#20)), DecimalType(19,3), true))) AND (cast(ws_item_rev#55 as decimal(20,3)) <= CheckOverflow((1.10 * promote_precision(ss_item_rev#20)), DecimalType(20,3), true))) AND (cast(ws_item_rev#55 as decimal(19,3)) >= CheckOverflow((0.90 * promote_precision(cs_item_rev#37)), DecimalType(19,3), true))) AND (cast(ws_item_rev#55 as decimal(20,3)) <= CheckOverflow((1.10 * promote_precision(cs_item_rev#37)), DecimalType(20,3), true))) + +(78) Project [codegen id : 15] +Output [8]: [item_id#19, ss_item_rev#20, CheckOverflow((promote_precision(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(ss_item_rev#20 as decimal(19,2))) / promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_item_rev#20 as decimal(18,2))) + promote_precision(cast(cs_item_rev#37 as decimal(18,2)))), DecimalType(18,2), true) as decimal(19,2))) + promote_precision(cast(ws_item_rev#55 as decimal(19,2)))), DecimalType(19,2), true))), DecimalType(38,21), true)) / 3.000000000000000000000), DecimalType(38,21), true)) * 100.000000000000000000000), DecimalType(38,17), true) AS ss_dev#57, cs_item_rev#37, CheckOverflow((promote_precision(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(cs_item_rev#37 as decimal(19,2))) / promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_item_rev#20 as decimal(18,2))) + promote_precision(cast(cs_item_rev#37 as decimal(18,2)))), DecimalType(18,2), true) as decimal(19,2))) + promote_precision(cast(ws_item_rev#55 as decimal(19,2)))), DecimalType(19,2), true))), DecimalType(38,21), true)) / 3.000000000000000000000), DecimalType(38,21), true)) * 100.000000000000000000000), DecimalType(38,17), true) AS cs_dev#58, ws_item_rev#55, CheckOverflow((promote_precision(CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(ws_item_rev#55 as decimal(19,2))) / promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_item_rev#20 as decimal(18,2))) + promote_precision(cast(cs_item_rev#37 as decimal(18,2)))), DecimalType(18,2), true) as decimal(19,2))) + promote_precision(cast(ws_item_rev#55 as decimal(19,2)))), DecimalType(19,2), true))), DecimalType(38,21), true)) / 3.000000000000000000000), DecimalType(38,21), true)) * 100.000000000000000000000), DecimalType(38,17), true) AS ws_dev#59, CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(ss_item_rev#20 as decimal(18,2))) + promote_precision(cast(cs_item_rev#37 as decimal(18,2)))), DecimalType(18,2), true) as decimal(19,2))) + promote_precision(cast(ws_item_rev#55 as decimal(19,2)))), DecimalType(19,2), true)) / 3.00), DecimalType(23,6), true) AS average#60] +Input [5]: [item_id#19, ss_item_rev#20, cs_item_rev#37, item_id#54, ws_item_rev#55] + +(79) TakeOrderedAndProject +Input [8]: [item_id#19, ss_item_rev#20, ss_dev#57, cs_item_rev#37, cs_dev#58, ws_item_rev#55, ws_dev#59, average#60] +Arguments: 100, [item_id#19 ASC NULLS FIRST, ss_item_rev#20 ASC NULLS FIRST], [item_id#19, ss_item_rev#20, ss_dev#57, cs_item_rev#37, cs_dev#58, ws_item_rev#55, ws_dev#59, average#60] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 15 Hosting Expression = Subquery scalar-subquery#11, [id=#12] +* Project (83) ++- * Filter (82) + +- * ColumnarToRow (81) + +- Scan parquet default.date_dim (80) + + +(80) Scan parquet default.date_dim +Output [2]: [d_date#61, d_week_seq#62] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), EqualTo(d_date,2000-01-03)] +ReadSchema: struct + +(81) ColumnarToRow [codegen id : 1] +Input [2]: [d_date#61, d_week_seq#62] + +(82) Filter [codegen id : 1] +Input [2]: [d_date#61, d_week_seq#62] +Condition : (isnotnull(d_date#61) AND (d_date#61 = 2000-01-03)) + +(83) Project [codegen id : 1] +Output [1]: [d_week_seq#62] +Input [2]: [d_date#61, d_week_seq#62] + +Subquery:2 Hosting operator id = 38 Hosting Expression = ReusedSubquery Subquery scalar-subquery#11, [id=#12] + +Subquery:3 Hosting operator id = 64 Hosting Expression = ReusedSubquery Subquery scalar-subquery#11, [id=#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q58/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q58/simplified.txt new file mode 100644 index 0000000000000..b2e184c7e279d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q58/simplified.txt @@ -0,0 +1,125 @@ +TakeOrderedAndProject [item_id,ss_item_rev,ss_dev,cs_item_rev,cs_dev,ws_item_rev,ws_dev,average] + WholeStageCodegen (15) + Project [item_id,ss_item_rev,cs_item_rev,ws_item_rev] + BroadcastHashJoin [item_id,item_id,ss_item_rev,ws_item_rev,cs_item_rev] + Project [item_id,ss_item_rev,cs_item_rev] + BroadcastHashJoin [item_id,item_id,ss_item_rev,cs_item_rev] + Filter [ss_item_rev] + HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),item_id,ss_item_rev,sum] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (4) + HashAggregate [i_item_id,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_item_id] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_ext_sales_price,ss_sold_date_sk,i_item_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [i_item_sk,i_item_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (3) + Project [d_date_sk] + BroadcastHashJoin [d_date,d_date] + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date] + Filter [d_week_seq] + Subquery #1 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_date] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date,d_week_seq] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + Filter [cs_item_rev] + HashAggregate [i_item_id,sum] [sum(UnscaledValue(cs_ext_sales_price)),item_id,cs_item_rev,sum] + InputAdapter + Exchange [i_item_id] #6 + WholeStageCodegen (8) + HashAggregate [i_item_id,cs_ext_sales_price] [sum,sum] + Project [cs_ext_sales_price,i_item_id] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_ext_sales_price,cs_sold_date_sk,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #2 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (7) + Project [d_date_sk] + BroadcastHashJoin [d_date,d_date] + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (6) + Project [d_date] + Filter [d_week_seq] + ReusedSubquery [d_week_seq] #1 + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date,d_week_seq] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (14) + Filter [ws_item_rev] + HashAggregate [i_item_id,sum] [sum(UnscaledValue(ws_ext_sales_price)),item_id,ws_item_rev,sum] + InputAdapter + Exchange [i_item_id] #10 + WholeStageCodegen (13) + HashAggregate [i_item_id,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,i_item_id] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_ext_sales_price,ws_sold_date_sk,i_item_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_ext_sales_price,ws_sold_date_sk] + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #2 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (12) + Project [d_date_sk] + BroadcastHashJoin [d_date,d_date] + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (11) + Project [d_date] + Filter [d_week_seq] + ReusedSubquery [d_week_seq] #1 + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date,d_week_seq] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q59.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q59.sf100/explain.txt new file mode 100644 index 0000000000000..cf22f178dd33f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q59.sf100/explain.txt @@ -0,0 +1,250 @@ +== Physical Plan == +TakeOrderedAndProject (44) ++- * Project (43) + +- * BroadcastHashJoin Inner BuildRight (42) + :- * Project (25) + : +- * BroadcastHashJoin Inner BuildRight (24) + : :- * Project (18) + : : +- * BroadcastHashJoin Inner BuildRight (17) + : : :- * HashAggregate (12) + : : : +- Exchange (11) + : : : +- * HashAggregate (10) + : : : +- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.store (13) + : +- BroadcastExchange (23) + : +- * Project (22) + : +- * Filter (21) + : +- * ColumnarToRow (20) + : +- Scan parquet default.date_dim (19) + +- BroadcastExchange (41) + +- * Project (40) + +- * BroadcastHashJoin Inner BuildRight (39) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * HashAggregate (27) + : : +- ReusedExchange (26) + : +- BroadcastExchange (31) + : +- * Filter (30) + : +- * ColumnarToRow (29) + : +- Scan parquet default.store (28) + +- BroadcastExchange (38) + +- * Project (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.date_dim (34) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] +Condition : (isnotnull(d_date_sk#4) AND isnotnull(d_week_seq#5)) + +(7) BroadcastExchange +Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#4] +Join condition: None + +(9) Project [codegen id : 2] +Output [4]: [ss_store_sk#1, ss_sales_price#2, d_week_seq#5, d_day_name#6] +Input [6]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3, d_date_sk#4, d_week_seq#5, d_day_name#6] + +(10) HashAggregate [codegen id : 2] +Input [4]: [ss_store_sk#1, ss_sales_price#2, d_week_seq#5, d_day_name#6] +Keys [2]: [d_week_seq#5, ss_store_sk#1] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))] +Aggregate Attributes [7]: [sum#8, sum#9, sum#10, sum#11, sum#12, sum#13, sum#14] +Results [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] + +(11) Exchange +Input [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] +Arguments: hashpartitioning(d_week_seq#5, ss_store_sk#1, 5), ENSURE_REQUIREMENTS, [id=#22] + +(12) HashAggregate [codegen id : 10] +Input [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] +Keys [2]: [d_week_seq#5, ss_store_sk#1] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END))#23, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END))#24, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END))#25, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END))#26, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))#29] +Results [9]: [d_week_seq#5, ss_store_sk#1, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END))#23,17,2) AS sun_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END))#24,17,2) AS mon_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END))#25,17,2) AS tue_sales#32, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END))#26,17,2) AS wed_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END))#27,17,2) AS thu_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END))#28,17,2) AS fri_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))#29,17,2) AS sat_sales#36] + +(13) Scan parquet default.store +Output [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_id)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 3] +Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] + +(15) Filter [codegen id : 3] +Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] +Condition : (isnotnull(s_store_sk#37) AND isnotnull(s_store_id#38)) + +(16) BroadcastExchange +Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40] + +(17) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#37] +Join condition: None + +(18) Project [codegen id : 10] +Output [10]: [d_week_seq#5, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#38, s_store_name#39] +Input [12]: [d_week_seq#5, ss_store_sk#1, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_sk#37, s_store_id#38, s_store_name#39] + +(19) Scan parquet default.date_dim +Output [2]: [d_month_seq#41, d_week_seq#42] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_week_seq)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 4] +Input [2]: [d_month_seq#41, d_week_seq#42] + +(21) Filter [codegen id : 4] +Input [2]: [d_month_seq#41, d_week_seq#42] +Condition : (((isnotnull(d_month_seq#41) AND (d_month_seq#41 >= 1212)) AND (d_month_seq#41 <= 1223)) AND isnotnull(d_week_seq#42)) + +(22) Project [codegen id : 4] +Output [1]: [d_week_seq#42] +Input [2]: [d_month_seq#41, d_week_seq#42] + +(23) BroadcastExchange +Input [1]: [d_week_seq#42] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#43] + +(24) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [d_week_seq#5] +Right keys [1]: [d_week_seq#42] +Join condition: None + +(25) Project [codegen id : 10] +Output [10]: [s_store_name#39 AS s_store_name1#44, d_week_seq#5 AS d_week_seq1#45, s_store_id#38 AS s_store_id1#46, sun_sales#30 AS sun_sales1#47, mon_sales#31 AS mon_sales1#48, tue_sales#32 AS tue_sales1#49, wed_sales#33 AS wed_sales1#50, thu_sales#34 AS thu_sales1#51, fri_sales#35 AS fri_sales1#52, sat_sales#36 AS sat_sales1#53] +Input [11]: [d_week_seq#5, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#38, s_store_name#39, d_week_seq#42] + +(26) ReusedExchange [Reuses operator id: 11] +Output [9]: [d_week_seq#54, ss_store_sk#55, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61, sum#62] + +(27) HashAggregate [codegen id : 9] +Input [9]: [d_week_seq#54, ss_store_sk#55, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61, sum#62] +Keys [2]: [d_week_seq#54, ss_store_sk#55] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#63 = Sunday ) THEN ss_sales_price#64 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#63 = Monday ) THEN ss_sales_price#64 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#63 = Tuesday ) THEN ss_sales_price#64 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#63 = Wednesday) THEN ss_sales_price#64 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#63 = Thursday ) THEN ss_sales_price#64 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#63 = Friday ) THEN ss_sales_price#64 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#63 = Saturday ) THEN ss_sales_price#64 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#63 = Sunday ) THEN ss_sales_price#64 ELSE null END))#65, sum(UnscaledValue(CASE WHEN (d_day_name#63 = Monday ) THEN ss_sales_price#64 ELSE null END))#66, sum(UnscaledValue(CASE WHEN (d_day_name#63 = Tuesday ) THEN ss_sales_price#64 ELSE null END))#67, sum(UnscaledValue(CASE WHEN (d_day_name#63 = Wednesday) THEN ss_sales_price#64 ELSE null END))#68, sum(UnscaledValue(CASE WHEN (d_day_name#63 = Thursday ) THEN ss_sales_price#64 ELSE null END))#69, sum(UnscaledValue(CASE WHEN (d_day_name#63 = Friday ) THEN ss_sales_price#64 ELSE null END))#70, sum(UnscaledValue(CASE WHEN (d_day_name#63 = Saturday ) THEN ss_sales_price#64 ELSE null END))#71] +Results [9]: [d_week_seq#54, ss_store_sk#55, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Sunday ) THEN ss_sales_price#64 ELSE null END))#65,17,2) AS sun_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Monday ) THEN ss_sales_price#64 ELSE null END))#66,17,2) AS mon_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Tuesday ) THEN ss_sales_price#64 ELSE null END))#67,17,2) AS tue_sales#32, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Wednesday) THEN ss_sales_price#64 ELSE null END))#68,17,2) AS wed_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Thursday ) THEN ss_sales_price#64 ELSE null END))#69,17,2) AS thu_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Friday ) THEN ss_sales_price#64 ELSE null END))#70,17,2) AS fri_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Saturday ) THEN ss_sales_price#64 ELSE null END))#71,17,2) AS sat_sales#36] + +(28) Scan parquet default.store +Output [2]: [s_store_sk#72, s_store_id#73] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_id)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 7] +Input [2]: [s_store_sk#72, s_store_id#73] + +(30) Filter [codegen id : 7] +Input [2]: [s_store_sk#72, s_store_id#73] +Condition : (isnotnull(s_store_sk#72) AND isnotnull(s_store_id#73)) + +(31) BroadcastExchange +Input [2]: [s_store_sk#72, s_store_id#73] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#74] + +(32) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#55] +Right keys [1]: [s_store_sk#72] +Join condition: None + +(33) Project [codegen id : 9] +Output [9]: [d_week_seq#54, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#73] +Input [11]: [d_week_seq#54, ss_store_sk#55, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_sk#72, s_store_id#73] + +(34) Scan parquet default.date_dim +Output [2]: [d_month_seq#75, d_week_seq#76] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1224), LessThanOrEqual(d_month_seq,1235), IsNotNull(d_week_seq)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 8] +Input [2]: [d_month_seq#75, d_week_seq#76] + +(36) Filter [codegen id : 8] +Input [2]: [d_month_seq#75, d_week_seq#76] +Condition : (((isnotnull(d_month_seq#75) AND (d_month_seq#75 >= 1224)) AND (d_month_seq#75 <= 1235)) AND isnotnull(d_week_seq#76)) + +(37) Project [codegen id : 8] +Output [1]: [d_week_seq#76] +Input [2]: [d_month_seq#75, d_week_seq#76] + +(38) BroadcastExchange +Input [1]: [d_week_seq#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#77] + +(39) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [d_week_seq#54] +Right keys [1]: [d_week_seq#76] +Join condition: None + +(40) Project [codegen id : 9] +Output [9]: [d_week_seq#54 AS d_week_seq2#78, s_store_id#73 AS s_store_id2#79, sun_sales#30 AS sun_sales2#80, mon_sales#31 AS mon_sales2#81, tue_sales#32 AS tue_sales2#82, wed_sales#33 AS wed_sales2#83, thu_sales#34 AS thu_sales2#84, fri_sales#35 AS fri_sales2#85, sat_sales#36 AS sat_sales2#86] +Input [10]: [d_week_seq#54, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#73, d_week_seq#76] + +(41) BroadcastExchange +Input [9]: [d_week_seq2#78, s_store_id2#79, sun_sales2#80, mon_sales2#81, tue_sales2#82, wed_sales2#83, thu_sales2#84, fri_sales2#85, sat_sales2#86] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true], (input[0, int, true] - 52)),false), [id=#87] + +(42) BroadcastHashJoin [codegen id : 10] +Left keys [2]: [s_store_id1#46, d_week_seq1#45] +Right keys [2]: [s_store_id2#79, (d_week_seq2#78 - 52)] +Join condition: None + +(43) Project [codegen id : 10] +Output [10]: [s_store_name1#44, s_store_id1#46, d_week_seq1#45, CheckOverflow((promote_precision(sun_sales1#47) / promote_precision(sun_sales2#80)), DecimalType(37,20), true) AS (sun_sales1 / sun_sales2)#88, CheckOverflow((promote_precision(mon_sales1#48) / promote_precision(mon_sales2#81)), DecimalType(37,20), true) AS (mon_sales1 / mon_sales2)#89, CheckOverflow((promote_precision(tue_sales1#49) / promote_precision(tue_sales2#82)), DecimalType(37,20), true) AS (tue_sales1 / tue_sales2)#90, CheckOverflow((promote_precision(wed_sales1#50) / promote_precision(wed_sales2#83)), DecimalType(37,20), true) AS (wed_sales1 / wed_sales2)#91, CheckOverflow((promote_precision(thu_sales1#51) / promote_precision(thu_sales2#84)), DecimalType(37,20), true) AS (thu_sales1 / thu_sales2)#92, CheckOverflow((promote_precision(fri_sales1#52) / promote_precision(fri_sales2#85)), DecimalType(37,20), true) AS (fri_sales1 / fri_sales2)#93, CheckOverflow((promote_precision(sat_sales1#53) / promote_precision(sat_sales2#86)), DecimalType(37,20), true) AS (sat_sales1 / sat_sales2)#94] +Input [19]: [s_store_name1#44, d_week_seq1#45, s_store_id1#46, sun_sales1#47, mon_sales1#48, tue_sales1#49, wed_sales1#50, thu_sales1#51, fri_sales1#52, sat_sales1#53, d_week_seq2#78, s_store_id2#79, sun_sales2#80, mon_sales2#81, tue_sales2#82, wed_sales2#83, thu_sales2#84, fri_sales2#85, sat_sales2#86] + +(44) TakeOrderedAndProject +Input [10]: [s_store_name1#44, s_store_id1#46, d_week_seq1#45, (sun_sales1 / sun_sales2)#88, (mon_sales1 / mon_sales2)#89, (tue_sales1 / tue_sales2)#90, (wed_sales1 / wed_sales2)#91, (thu_sales1 / thu_sales2)#92, (fri_sales1 / fri_sales2)#93, (sat_sales1 / sat_sales2)#94] +Arguments: 100, [s_store_name1#44 ASC NULLS FIRST, s_store_id1#46 ASC NULLS FIRST, d_week_seq1#45 ASC NULLS FIRST], [s_store_name1#44, s_store_id1#46, d_week_seq1#45, (sun_sales1 / sun_sales2)#88, (mon_sales1 / mon_sales2)#89, (tue_sales1 / tue_sales2)#90, (wed_sales1 / wed_sales2)#91, (thu_sales1 / thu_sales2)#92, (fri_sales1 / fri_sales2)#93, (sat_sales1 / sat_sales2)#94] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q59.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q59.sf100/simplified.txt new file mode 100644 index 0000000000000..541817641b129 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q59.sf100/simplified.txt @@ -0,0 +1,66 @@ +TakeOrderedAndProject [s_store_name1,s_store_id1,d_week_seq1,(sun_sales1 / sun_sales2),(mon_sales1 / mon_sales2),(tue_sales1 / tue_sales2),(wed_sales1 / wed_sales2),(thu_sales1 / thu_sales2),(fri_sales1 / fri_sales2),(sat_sales1 / sat_sales2)] + WholeStageCodegen (10) + Project [s_store_name1,s_store_id1,d_week_seq1,sun_sales1,sun_sales2,mon_sales1,mon_sales2,tue_sales1,tue_sales2,wed_sales1,wed_sales2,thu_sales1,thu_sales2,fri_sales1,fri_sales2,sat_sales1,sat_sales2] + BroadcastHashJoin [s_store_id1,d_week_seq1,s_store_id2,d_week_seq2] + Project [s_store_name,d_week_seq,s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + BroadcastHashJoin [d_week_seq,d_week_seq] + Project [d_week_seq,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,s_store_id,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + HashAggregate [d_week_seq,ss_store_sk,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN ss_sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + Exchange [d_week_seq,ss_store_sk] #1 + WholeStageCodegen (2) + HashAggregate [d_week_seq,ss_store_sk,d_day_name,ss_sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [ss_store_sk,ss_sales_price,d_week_seq,d_day_name] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [d_date_sk,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq,d_day_name] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (3) + Filter [s_store_sk,s_store_id] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id,s_store_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [d_week_seq] + Filter [d_month_seq,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_week_seq] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + Project [d_week_seq,s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + BroadcastHashJoin [d_week_seq,d_week_seq] + Project [d_week_seq,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,s_store_id] + BroadcastHashJoin [ss_store_sk,s_store_sk] + HashAggregate [d_week_seq,ss_store_sk,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN ss_sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + ReusedExchange [d_week_seq,ss_store_sk,sum,sum,sum,sum,sum,sum,sum] #1 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Filter [s_store_sk,s_store_id] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (8) + Project [d_week_seq] + Filter [d_month_seq,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_week_seq] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q59/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q59/explain.txt new file mode 100644 index 0000000000000..cf22f178dd33f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q59/explain.txt @@ -0,0 +1,250 @@ +== Physical Plan == +TakeOrderedAndProject (44) ++- * Project (43) + +- * BroadcastHashJoin Inner BuildRight (42) + :- * Project (25) + : +- * BroadcastHashJoin Inner BuildRight (24) + : :- * Project (18) + : : +- * BroadcastHashJoin Inner BuildRight (17) + : : :- * HashAggregate (12) + : : : +- Exchange (11) + : : : +- * HashAggregate (10) + : : : +- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.store (13) + : +- BroadcastExchange (23) + : +- * Project (22) + : +- * Filter (21) + : +- * ColumnarToRow (20) + : +- Scan parquet default.date_dim (19) + +- BroadcastExchange (41) + +- * Project (40) + +- * BroadcastHashJoin Inner BuildRight (39) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * HashAggregate (27) + : : +- ReusedExchange (26) + : +- BroadcastExchange (31) + : +- * Filter (30) + : +- * ColumnarToRow (29) + : +- Scan parquet default.store (28) + +- BroadcastExchange (38) + +- * Project (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.date_dim (34) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk), IsNotNull(d_week_seq)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] +Condition : (isnotnull(d_date_sk#4) AND isnotnull(d_week_seq#5)) + +(7) BroadcastExchange +Input [3]: [d_date_sk#4, d_week_seq#5, d_day_name#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#4] +Join condition: None + +(9) Project [codegen id : 2] +Output [4]: [ss_store_sk#1, ss_sales_price#2, d_week_seq#5, d_day_name#6] +Input [6]: [ss_store_sk#1, ss_sales_price#2, ss_sold_date_sk#3, d_date_sk#4, d_week_seq#5, d_day_name#6] + +(10) HashAggregate [codegen id : 2] +Input [4]: [ss_store_sk#1, ss_sales_price#2, d_week_seq#5, d_day_name#6] +Keys [2]: [d_week_seq#5, ss_store_sk#1] +Functions [7]: [partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END)), partial_sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))] +Aggregate Attributes [7]: [sum#8, sum#9, sum#10, sum#11, sum#12, sum#13, sum#14] +Results [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] + +(11) Exchange +Input [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] +Arguments: hashpartitioning(d_week_seq#5, ss_store_sk#1, 5), ENSURE_REQUIREMENTS, [id=#22] + +(12) HashAggregate [codegen id : 10] +Input [9]: [d_week_seq#5, ss_store_sk#1, sum#15, sum#16, sum#17, sum#18, sum#19, sum#20, sum#21] +Keys [2]: [d_week_seq#5, ss_store_sk#1] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END))#23, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END))#24, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END))#25, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END))#26, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END))#27, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END))#28, sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))#29] +Results [9]: [d_week_seq#5, ss_store_sk#1, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Sunday ) THEN ss_sales_price#2 ELSE null END))#23,17,2) AS sun_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Monday ) THEN ss_sales_price#2 ELSE null END))#24,17,2) AS mon_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Tuesday ) THEN ss_sales_price#2 ELSE null END))#25,17,2) AS tue_sales#32, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Wednesday) THEN ss_sales_price#2 ELSE null END))#26,17,2) AS wed_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Thursday ) THEN ss_sales_price#2 ELSE null END))#27,17,2) AS thu_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Friday ) THEN ss_sales_price#2 ELSE null END))#28,17,2) AS fri_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#6 = Saturday ) THEN ss_sales_price#2 ELSE null END))#29,17,2) AS sat_sales#36] + +(13) Scan parquet default.store +Output [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_id)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 3] +Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] + +(15) Filter [codegen id : 3] +Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] +Condition : (isnotnull(s_store_sk#37) AND isnotnull(s_store_id#38)) + +(16) BroadcastExchange +Input [3]: [s_store_sk#37, s_store_id#38, s_store_name#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40] + +(17) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#37] +Join condition: None + +(18) Project [codegen id : 10] +Output [10]: [d_week_seq#5, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#38, s_store_name#39] +Input [12]: [d_week_seq#5, ss_store_sk#1, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_sk#37, s_store_id#38, s_store_name#39] + +(19) Scan parquet default.date_dim +Output [2]: [d_month_seq#41, d_week_seq#42] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_week_seq)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 4] +Input [2]: [d_month_seq#41, d_week_seq#42] + +(21) Filter [codegen id : 4] +Input [2]: [d_month_seq#41, d_week_seq#42] +Condition : (((isnotnull(d_month_seq#41) AND (d_month_seq#41 >= 1212)) AND (d_month_seq#41 <= 1223)) AND isnotnull(d_week_seq#42)) + +(22) Project [codegen id : 4] +Output [1]: [d_week_seq#42] +Input [2]: [d_month_seq#41, d_week_seq#42] + +(23) BroadcastExchange +Input [1]: [d_week_seq#42] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#43] + +(24) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [d_week_seq#5] +Right keys [1]: [d_week_seq#42] +Join condition: None + +(25) Project [codegen id : 10] +Output [10]: [s_store_name#39 AS s_store_name1#44, d_week_seq#5 AS d_week_seq1#45, s_store_id#38 AS s_store_id1#46, sun_sales#30 AS sun_sales1#47, mon_sales#31 AS mon_sales1#48, tue_sales#32 AS tue_sales1#49, wed_sales#33 AS wed_sales1#50, thu_sales#34 AS thu_sales1#51, fri_sales#35 AS fri_sales1#52, sat_sales#36 AS sat_sales1#53] +Input [11]: [d_week_seq#5, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#38, s_store_name#39, d_week_seq#42] + +(26) ReusedExchange [Reuses operator id: 11] +Output [9]: [d_week_seq#54, ss_store_sk#55, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61, sum#62] + +(27) HashAggregate [codegen id : 9] +Input [9]: [d_week_seq#54, ss_store_sk#55, sum#56, sum#57, sum#58, sum#59, sum#60, sum#61, sum#62] +Keys [2]: [d_week_seq#54, ss_store_sk#55] +Functions [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#63 = Sunday ) THEN ss_sales_price#64 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#63 = Monday ) THEN ss_sales_price#64 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#63 = Tuesday ) THEN ss_sales_price#64 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#63 = Wednesday) THEN ss_sales_price#64 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#63 = Thursday ) THEN ss_sales_price#64 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#63 = Friday ) THEN ss_sales_price#64 ELSE null END)), sum(UnscaledValue(CASE WHEN (d_day_name#63 = Saturday ) THEN ss_sales_price#64 ELSE null END))] +Aggregate Attributes [7]: [sum(UnscaledValue(CASE WHEN (d_day_name#63 = Sunday ) THEN ss_sales_price#64 ELSE null END))#65, sum(UnscaledValue(CASE WHEN (d_day_name#63 = Monday ) THEN ss_sales_price#64 ELSE null END))#66, sum(UnscaledValue(CASE WHEN (d_day_name#63 = Tuesday ) THEN ss_sales_price#64 ELSE null END))#67, sum(UnscaledValue(CASE WHEN (d_day_name#63 = Wednesday) THEN ss_sales_price#64 ELSE null END))#68, sum(UnscaledValue(CASE WHEN (d_day_name#63 = Thursday ) THEN ss_sales_price#64 ELSE null END))#69, sum(UnscaledValue(CASE WHEN (d_day_name#63 = Friday ) THEN ss_sales_price#64 ELSE null END))#70, sum(UnscaledValue(CASE WHEN (d_day_name#63 = Saturday ) THEN ss_sales_price#64 ELSE null END))#71] +Results [9]: [d_week_seq#54, ss_store_sk#55, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Sunday ) THEN ss_sales_price#64 ELSE null END))#65,17,2) AS sun_sales#30, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Monday ) THEN ss_sales_price#64 ELSE null END))#66,17,2) AS mon_sales#31, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Tuesday ) THEN ss_sales_price#64 ELSE null END))#67,17,2) AS tue_sales#32, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Wednesday) THEN ss_sales_price#64 ELSE null END))#68,17,2) AS wed_sales#33, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Thursday ) THEN ss_sales_price#64 ELSE null END))#69,17,2) AS thu_sales#34, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Friday ) THEN ss_sales_price#64 ELSE null END))#70,17,2) AS fri_sales#35, MakeDecimal(sum(UnscaledValue(CASE WHEN (d_day_name#63 = Saturday ) THEN ss_sales_price#64 ELSE null END))#71,17,2) AS sat_sales#36] + +(28) Scan parquet default.store +Output [2]: [s_store_sk#72, s_store_id#73] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_id)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 7] +Input [2]: [s_store_sk#72, s_store_id#73] + +(30) Filter [codegen id : 7] +Input [2]: [s_store_sk#72, s_store_id#73] +Condition : (isnotnull(s_store_sk#72) AND isnotnull(s_store_id#73)) + +(31) BroadcastExchange +Input [2]: [s_store_sk#72, s_store_id#73] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#74] + +(32) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#55] +Right keys [1]: [s_store_sk#72] +Join condition: None + +(33) Project [codegen id : 9] +Output [9]: [d_week_seq#54, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#73] +Input [11]: [d_week_seq#54, ss_store_sk#55, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_sk#72, s_store_id#73] + +(34) Scan parquet default.date_dim +Output [2]: [d_month_seq#75, d_week_seq#76] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1224), LessThanOrEqual(d_month_seq,1235), IsNotNull(d_week_seq)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 8] +Input [2]: [d_month_seq#75, d_week_seq#76] + +(36) Filter [codegen id : 8] +Input [2]: [d_month_seq#75, d_week_seq#76] +Condition : (((isnotnull(d_month_seq#75) AND (d_month_seq#75 >= 1224)) AND (d_month_seq#75 <= 1235)) AND isnotnull(d_week_seq#76)) + +(37) Project [codegen id : 8] +Output [1]: [d_week_seq#76] +Input [2]: [d_month_seq#75, d_week_seq#76] + +(38) BroadcastExchange +Input [1]: [d_week_seq#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#77] + +(39) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [d_week_seq#54] +Right keys [1]: [d_week_seq#76] +Join condition: None + +(40) Project [codegen id : 9] +Output [9]: [d_week_seq#54 AS d_week_seq2#78, s_store_id#73 AS s_store_id2#79, sun_sales#30 AS sun_sales2#80, mon_sales#31 AS mon_sales2#81, tue_sales#32 AS tue_sales2#82, wed_sales#33 AS wed_sales2#83, thu_sales#34 AS thu_sales2#84, fri_sales#35 AS fri_sales2#85, sat_sales#36 AS sat_sales2#86] +Input [10]: [d_week_seq#54, sun_sales#30, mon_sales#31, tue_sales#32, wed_sales#33, thu_sales#34, fri_sales#35, sat_sales#36, s_store_id#73, d_week_seq#76] + +(41) BroadcastExchange +Input [9]: [d_week_seq2#78, s_store_id2#79, sun_sales2#80, mon_sales2#81, tue_sales2#82, wed_sales2#83, thu_sales2#84, fri_sales2#85, sat_sales2#86] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true], (input[0, int, true] - 52)),false), [id=#87] + +(42) BroadcastHashJoin [codegen id : 10] +Left keys [2]: [s_store_id1#46, d_week_seq1#45] +Right keys [2]: [s_store_id2#79, (d_week_seq2#78 - 52)] +Join condition: None + +(43) Project [codegen id : 10] +Output [10]: [s_store_name1#44, s_store_id1#46, d_week_seq1#45, CheckOverflow((promote_precision(sun_sales1#47) / promote_precision(sun_sales2#80)), DecimalType(37,20), true) AS (sun_sales1 / sun_sales2)#88, CheckOverflow((promote_precision(mon_sales1#48) / promote_precision(mon_sales2#81)), DecimalType(37,20), true) AS (mon_sales1 / mon_sales2)#89, CheckOverflow((promote_precision(tue_sales1#49) / promote_precision(tue_sales2#82)), DecimalType(37,20), true) AS (tue_sales1 / tue_sales2)#90, CheckOverflow((promote_precision(wed_sales1#50) / promote_precision(wed_sales2#83)), DecimalType(37,20), true) AS (wed_sales1 / wed_sales2)#91, CheckOverflow((promote_precision(thu_sales1#51) / promote_precision(thu_sales2#84)), DecimalType(37,20), true) AS (thu_sales1 / thu_sales2)#92, CheckOverflow((promote_precision(fri_sales1#52) / promote_precision(fri_sales2#85)), DecimalType(37,20), true) AS (fri_sales1 / fri_sales2)#93, CheckOverflow((promote_precision(sat_sales1#53) / promote_precision(sat_sales2#86)), DecimalType(37,20), true) AS (sat_sales1 / sat_sales2)#94] +Input [19]: [s_store_name1#44, d_week_seq1#45, s_store_id1#46, sun_sales1#47, mon_sales1#48, tue_sales1#49, wed_sales1#50, thu_sales1#51, fri_sales1#52, sat_sales1#53, d_week_seq2#78, s_store_id2#79, sun_sales2#80, mon_sales2#81, tue_sales2#82, wed_sales2#83, thu_sales2#84, fri_sales2#85, sat_sales2#86] + +(44) TakeOrderedAndProject +Input [10]: [s_store_name1#44, s_store_id1#46, d_week_seq1#45, (sun_sales1 / sun_sales2)#88, (mon_sales1 / mon_sales2)#89, (tue_sales1 / tue_sales2)#90, (wed_sales1 / wed_sales2)#91, (thu_sales1 / thu_sales2)#92, (fri_sales1 / fri_sales2)#93, (sat_sales1 / sat_sales2)#94] +Arguments: 100, [s_store_name1#44 ASC NULLS FIRST, s_store_id1#46 ASC NULLS FIRST, d_week_seq1#45 ASC NULLS FIRST], [s_store_name1#44, s_store_id1#46, d_week_seq1#45, (sun_sales1 / sun_sales2)#88, (mon_sales1 / mon_sales2)#89, (tue_sales1 / tue_sales2)#90, (wed_sales1 / wed_sales2)#91, (thu_sales1 / thu_sales2)#92, (fri_sales1 / fri_sales2)#93, (sat_sales1 / sat_sales2)#94] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q59/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q59/simplified.txt new file mode 100644 index 0000000000000..541817641b129 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q59/simplified.txt @@ -0,0 +1,66 @@ +TakeOrderedAndProject [s_store_name1,s_store_id1,d_week_seq1,(sun_sales1 / sun_sales2),(mon_sales1 / mon_sales2),(tue_sales1 / tue_sales2),(wed_sales1 / wed_sales2),(thu_sales1 / thu_sales2),(fri_sales1 / fri_sales2),(sat_sales1 / sat_sales2)] + WholeStageCodegen (10) + Project [s_store_name1,s_store_id1,d_week_seq1,sun_sales1,sun_sales2,mon_sales1,mon_sales2,tue_sales1,tue_sales2,wed_sales1,wed_sales2,thu_sales1,thu_sales2,fri_sales1,fri_sales2,sat_sales1,sat_sales2] + BroadcastHashJoin [s_store_id1,d_week_seq1,s_store_id2,d_week_seq2] + Project [s_store_name,d_week_seq,s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + BroadcastHashJoin [d_week_seq,d_week_seq] + Project [d_week_seq,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,s_store_id,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + HashAggregate [d_week_seq,ss_store_sk,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN ss_sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + Exchange [d_week_seq,ss_store_sk] #1 + WholeStageCodegen (2) + HashAggregate [d_week_seq,ss_store_sk,d_day_name,ss_sales_price] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [ss_store_sk,ss_sales_price,d_week_seq,d_day_name] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [d_date_sk,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq,d_day_name] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (3) + Filter [s_store_sk,s_store_id] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id,s_store_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [d_week_seq] + Filter [d_month_seq,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_week_seq] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + Project [d_week_seq,s_store_id,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales] + BroadcastHashJoin [d_week_seq,d_week_seq] + Project [d_week_seq,sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,s_store_id] + BroadcastHashJoin [ss_store_sk,s_store_sk] + HashAggregate [d_week_seq,ss_store_sk,sum,sum,sum,sum,sum,sum,sum] [sum(UnscaledValue(CASE WHEN (d_day_name = Sunday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Monday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Tuesday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Wednesday) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Thursday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Friday ) THEN ss_sales_price ELSE null END)),sum(UnscaledValue(CASE WHEN (d_day_name = Saturday ) THEN ss_sales_price ELSE null END)),sun_sales,mon_sales,tue_sales,wed_sales,thu_sales,fri_sales,sat_sales,sum,sum,sum,sum,sum,sum,sum] + InputAdapter + ReusedExchange [d_week_seq,ss_store_sk,sum,sum,sum,sum,sum,sum,sum] #1 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Filter [s_store_sk,s_store_id] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (8) + Project [d_week_seq] + Filter [d_month_seq,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_week_seq] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt new file mode 100644 index 0000000000000..7e82b4d5df296 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/explain.txt @@ -0,0 +1,339 @@ +== Physical Plan == +TakeOrderedAndProject (50) ++- * Project (49) + +- * Filter (48) + +- * HashAggregate (47) + +- Exchange (46) + +- * HashAggregate (45) + +- * Project (44) + +- * SortMergeJoin Inner (43) + :- * Sort (28) + : +- Exchange (27) + : +- * Project (26) + : +- * BroadcastHashJoin Inner BuildRight (25) + : :- * Project (19) + : : +- * BroadcastHashJoin Inner BuildRight (18) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (17) + : : +- * Project (16) + : : +- * Filter (15) + : : +- * BroadcastHashJoin LeftOuter BuildRight (14) + : : :- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.item (4) + : : +- BroadcastExchange (13) + : : +- * HashAggregate (12) + : : +- Exchange (11) + : : +- * HashAggregate (10) + : : +- * Filter (9) + : : +- * ColumnarToRow (8) + : : +- Scan parquet default.item (7) + : +- BroadcastExchange (24) + : +- * Project (23) + : +- * Filter (22) + : +- * ColumnarToRow (21) + : +- Scan parquet default.date_dim (20) + +- * Sort (42) + +- Exchange (41) + +- * Project (40) + +- * SortMergeJoin Inner (39) + :- * Sort (33) + : +- Exchange (32) + : +- * Filter (31) + : +- * ColumnarToRow (30) + : +- Scan parquet default.customer_address (29) + +- * Sort (38) + +- Exchange (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.customer (34) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [3]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 5] +Input [3]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3] +Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.item +Output [3]: [i_item_sk#5, i_current_price#6, i_category#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 3] +Input [3]: [i_item_sk#5, i_current_price#6, i_category#7] + +(6) Filter [codegen id : 3] +Input [3]: [i_item_sk#5, i_current_price#6, i_category#7] +Condition : (isnotnull(i_current_price#6) AND isnotnull(i_item_sk#5)) + +(7) Scan parquet default.item +Output [2]: [i_current_price#8, i_category#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 1] +Input [2]: [i_current_price#8, i_category#9] + +(9) Filter [codegen id : 1] +Input [2]: [i_current_price#8, i_category#9] +Condition : isnotnull(i_category#9) + +(10) HashAggregate [codegen id : 1] +Input [2]: [i_current_price#8, i_category#9] +Keys [1]: [i_category#9] +Functions [1]: [partial_avg(UnscaledValue(i_current_price#8))] +Aggregate Attributes [2]: [sum#10, count#11] +Results [3]: [i_category#9, sum#12, count#13] + +(11) Exchange +Input [3]: [i_category#9, sum#12, count#13] +Arguments: hashpartitioning(i_category#9, 5), ENSURE_REQUIREMENTS, [id=#14] + +(12) HashAggregate [codegen id : 2] +Input [3]: [i_category#9, sum#12, count#13] +Keys [1]: [i_category#9] +Functions [1]: [avg(UnscaledValue(i_current_price#8))] +Aggregate Attributes [1]: [avg(UnscaledValue(i_current_price#8))#15] +Results [2]: [cast((avg(UnscaledValue(i_current_price#8))#15 / 100.0) as decimal(11,6)) AS avg(i_current_price)#16, i_category#9] + +(13) BroadcastExchange +Input [2]: [avg(i_current_price)#16, i_category#9] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#17] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [i_category#7] +Right keys [1]: [i_category#9] +Join condition: None + +(15) Filter [codegen id : 3] +Input [5]: [i_item_sk#5, i_current_price#6, i_category#7, avg(i_current_price)#16, i_category#9] +Condition : (cast(i_current_price#6 as decimal(14,7)) > CheckOverflow((1.200000 * promote_precision(avg(i_current_price)#16)), DecimalType(14,7), true)) + +(16) Project [codegen id : 3] +Output [1]: [i_item_sk#5] +Input [5]: [i_item_sk#5, i_current_price#6, i_category#7, avg(i_current_price)#16, i_category#9] + +(17) BroadcastExchange +Input [1]: [i_item_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(18) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(19) Project [codegen id : 5] +Output [2]: [ss_customer_sk#2, ss_sold_date_sk#3] +Input [4]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3, i_item_sk#5] + +(20) Scan parquet default.date_dim +Output [2]: [d_date_sk#19, d_month_seq#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#19, d_month_seq#20] + +(22) Filter [codegen id : 4] +Input [2]: [d_date_sk#19, d_month_seq#20] +Condition : ((isnotnull(d_month_seq#20) AND (d_month_seq#20 = Subquery scalar-subquery#21, [id=#22])) AND isnotnull(d_date_sk#19)) + +(23) Project [codegen id : 4] +Output [1]: [d_date_sk#19] +Input [2]: [d_date_sk#19, d_month_seq#20] + +(24) BroadcastExchange +Input [1]: [d_date_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] + +(25) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#19] +Join condition: None + +(26) Project [codegen id : 5] +Output [1]: [ss_customer_sk#2] +Input [3]: [ss_customer_sk#2, ss_sold_date_sk#3, d_date_sk#19] + +(27) Exchange +Input [1]: [ss_customer_sk#2] +Arguments: hashpartitioning(ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#24] + +(28) Sort [codegen id : 6] +Input [1]: [ss_customer_sk#2] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(29) Scan parquet default.customer_address +Output [2]: [ca_address_sk#25, ca_state#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#25, ca_state#26] + +(31) Filter [codegen id : 7] +Input [2]: [ca_address_sk#25, ca_state#26] +Condition : isnotnull(ca_address_sk#25) + +(32) Exchange +Input [2]: [ca_address_sk#25, ca_state#26] +Arguments: hashpartitioning(ca_address_sk#25, 5), ENSURE_REQUIREMENTS, [id=#27] + +(33) Sort [codegen id : 8] +Input [2]: [ca_address_sk#25, ca_state#26] +Arguments: [ca_address_sk#25 ASC NULLS FIRST], false, 0 + +(34) Scan parquet default.customer +Output [2]: [c_customer_sk#28, c_current_addr_sk#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_customer_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 9] +Input [2]: [c_customer_sk#28, c_current_addr_sk#29] + +(36) Filter [codegen id : 9] +Input [2]: [c_customer_sk#28, c_current_addr_sk#29] +Condition : (isnotnull(c_current_addr_sk#29) AND isnotnull(c_customer_sk#28)) + +(37) Exchange +Input [2]: [c_customer_sk#28, c_current_addr_sk#29] +Arguments: hashpartitioning(c_current_addr_sk#29, 5), ENSURE_REQUIREMENTS, [id=#30] + +(38) Sort [codegen id : 10] +Input [2]: [c_customer_sk#28, c_current_addr_sk#29] +Arguments: [c_current_addr_sk#29 ASC NULLS FIRST], false, 0 + +(39) SortMergeJoin [codegen id : 11] +Left keys [1]: [ca_address_sk#25] +Right keys [1]: [c_current_addr_sk#29] +Join condition: None + +(40) Project [codegen id : 11] +Output [2]: [ca_state#26, c_customer_sk#28] +Input [4]: [ca_address_sk#25, ca_state#26, c_customer_sk#28, c_current_addr_sk#29] + +(41) Exchange +Input [2]: [ca_state#26, c_customer_sk#28] +Arguments: hashpartitioning(c_customer_sk#28, 5), ENSURE_REQUIREMENTS, [id=#31] + +(42) Sort [codegen id : 12] +Input [2]: [ca_state#26, c_customer_sk#28] +Arguments: [c_customer_sk#28 ASC NULLS FIRST], false, 0 + +(43) SortMergeJoin [codegen id : 13] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#28] +Join condition: None + +(44) Project [codegen id : 13] +Output [1]: [ca_state#26] +Input [3]: [ss_customer_sk#2, ca_state#26, c_customer_sk#28] + +(45) HashAggregate [codegen id : 13] +Input [1]: [ca_state#26] +Keys [1]: [ca_state#26] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#32] +Results [2]: [ca_state#26, count#33] + +(46) Exchange +Input [2]: [ca_state#26, count#33] +Arguments: hashpartitioning(ca_state#26, 5), ENSURE_REQUIREMENTS, [id=#34] + +(47) HashAggregate [codegen id : 14] +Input [2]: [ca_state#26, count#33] +Keys [1]: [ca_state#26] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#35] +Results [3]: [ca_state#26 AS state#36, count(1)#35 AS cnt#37, count(1)#35 AS count(1)#38] + +(48) Filter [codegen id : 14] +Input [3]: [state#36, cnt#37, count(1)#38] +Condition : (count(1)#38 >= 10) + +(49) Project [codegen id : 14] +Output [2]: [state#36, cnt#37] +Input [3]: [state#36, cnt#37, count(1)#38] + +(50) TakeOrderedAndProject +Input [2]: [state#36, cnt#37] +Arguments: 100, [cnt#37 ASC NULLS FIRST], [state#36, cnt#37] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (51) + + +(51) ReusedExchange [Reuses operator id: 24] +Output [1]: [d_date_sk#19] + +Subquery:2 Hosting operator id = 22 Hosting Expression = Subquery scalar-subquery#21, [id=#22] +* HashAggregate (58) ++- Exchange (57) + +- * HashAggregate (56) + +- * Project (55) + +- * Filter (54) + +- * ColumnarToRow (53) + +- Scan parquet default.date_dim (52) + + +(52) Scan parquet default.date_dim +Output [3]: [d_month_seq#39, d_year#40, d_moy#41] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,1)] +ReadSchema: struct + +(53) ColumnarToRow [codegen id : 1] +Input [3]: [d_month_seq#39, d_year#40, d_moy#41] + +(54) Filter [codegen id : 1] +Input [3]: [d_month_seq#39, d_year#40, d_moy#41] +Condition : (((isnotnull(d_year#40) AND isnotnull(d_moy#41)) AND (d_year#40 = 2000)) AND (d_moy#41 = 1)) + +(55) Project [codegen id : 1] +Output [1]: [d_month_seq#39] +Input [3]: [d_month_seq#39, d_year#40, d_moy#41] + +(56) HashAggregate [codegen id : 1] +Input [1]: [d_month_seq#39] +Keys [1]: [d_month_seq#39] +Functions: [] +Aggregate Attributes: [] +Results [1]: [d_month_seq#39] + +(57) Exchange +Input [1]: [d_month_seq#39] +Arguments: hashpartitioning(d_month_seq#39, 5), ENSURE_REQUIREMENTS, [id=#42] + +(58) HashAggregate [codegen id : 2] +Input [1]: [d_month_seq#39] +Keys [1]: [d_month_seq#39] +Functions: [] +Aggregate Attributes: [] +Results [1]: [d_month_seq#39] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt new file mode 100644 index 0000000000000..1cdb7a5df8e6f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6.sf100/simplified.txt @@ -0,0 +1,97 @@ +TakeOrderedAndProject [cnt,state] + WholeStageCodegen (14) + Project [state,cnt] + Filter [count(1)] + HashAggregate [ca_state,count] [count(1),state,cnt,count(1),count] + InputAdapter + Exchange [ca_state] #1 + WholeStageCodegen (13) + HashAggregate [ca_state] [count,count] + Project [ca_state] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #2 + WholeStageCodegen (5) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_customer_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_customer_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [i_item_sk] + Filter [i_current_price,avg(i_current_price)] + BroadcastHashJoin [i_category,i_category] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_category] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + HashAggregate [i_category,sum,count] [avg(UnscaledValue(i_current_price)),avg(i_current_price),sum,count] + InputAdapter + Exchange [i_category] #6 + WholeStageCodegen (1) + HashAggregate [i_category,i_current_price] [sum,count,sum,count] + Filter [i_category] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_current_price,i_category] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + Subquery #2 + WholeStageCodegen (2) + HashAggregate [d_month_seq] + InputAdapter + Exchange [d_month_seq] #7 + WholeStageCodegen (1) + HashAggregate [d_month_seq] + Project [d_month_seq] + Filter [d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + WholeStageCodegen (12) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #8 + WholeStageCodegen (11) + Project [ca_state,c_customer_sk] + SortMergeJoin [ca_address_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (8) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #9 + WholeStageCodegen (7) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + WholeStageCodegen (10) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #10 + WholeStageCodegen (9) + Filter [c_current_addr_sk,c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6/explain.txt new file mode 100644 index 0000000000000..0f98039fc0f7f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6/explain.txt @@ -0,0 +1,309 @@ +== Physical Plan == +TakeOrderedAndProject (44) ++- * Project (43) + +- * Filter (42) + +- * HashAggregate (41) + +- Exchange (40) + +- * HashAggregate (39) + +- * Project (38) + +- * BroadcastHashJoin Inner BuildRight (37) + :- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer_address (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer (4) + : : +- BroadcastExchange (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.store_sales (10) + : +- BroadcastExchange (20) + : +- * Project (19) + : +- * Filter (18) + : +- * ColumnarToRow (17) + : +- Scan parquet default.date_dim (16) + +- BroadcastExchange (36) + +- * Project (35) + +- * Filter (34) + +- * BroadcastHashJoin LeftOuter BuildRight (33) + :- * Filter (25) + : +- * ColumnarToRow (24) + : +- Scan parquet default.item (23) + +- BroadcastExchange (32) + +- * HashAggregate (31) + +- Exchange (30) + +- * HashAggregate (29) + +- * Filter (28) + +- * ColumnarToRow (27) + +- Scan parquet default.item (26) + + +(1) Scan parquet default.customer_address +Output [2]: [ca_address_sk#1, ca_state#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#1, ca_state#2] + +(3) Filter [codegen id : 7] +Input [2]: [ca_address_sk#1, ca_state#2] +Condition : isnotnull(ca_address_sk#1) + +(4) Scan parquet default.customer +Output [2]: [c_customer_sk#3, c_current_addr_sk#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_customer_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [c_customer_sk#3, c_current_addr_sk#4] + +(6) Filter [codegen id : 1] +Input [2]: [c_customer_sk#3, c_current_addr_sk#4] +Condition : (isnotnull(c_current_addr_sk#4) AND isnotnull(c_customer_sk#3)) + +(7) BroadcastExchange +Input [2]: [c_customer_sk#3, c_current_addr_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#5] + +(8) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ca_address_sk#1] +Right keys [1]: [c_current_addr_sk#4] +Join condition: None + +(9) Project [codegen id : 7] +Output [2]: [ca_state#2, c_customer_sk#3] +Input [4]: [ca_address_sk#1, ca_state#2, c_customer_sk#3, c_current_addr_sk#4] + +(10) Scan parquet default.store_sales +Output [3]: [ss_item_sk#6, ss_customer_sk#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [ss_item_sk#6, ss_customer_sk#7, ss_sold_date_sk#8] + +(12) Filter [codegen id : 2] +Input [3]: [ss_item_sk#6, ss_customer_sk#7, ss_sold_date_sk#8] +Condition : (isnotnull(ss_customer_sk#7) AND isnotnull(ss_item_sk#6)) + +(13) BroadcastExchange +Input [3]: [ss_item_sk#6, ss_customer_sk#7, ss_sold_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#10] + +(14) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ss_customer_sk#7] +Join condition: None + +(15) Project [codegen id : 7] +Output [3]: [ca_state#2, ss_item_sk#6, ss_sold_date_sk#8] +Input [5]: [ca_state#2, c_customer_sk#3, ss_item_sk#6, ss_customer_sk#7, ss_sold_date_sk#8] + +(16) Scan parquet default.date_dim +Output [2]: [d_date_sk#11, d_month_seq#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#11, d_month_seq#12] + +(18) Filter [codegen id : 3] +Input [2]: [d_date_sk#11, d_month_seq#12] +Condition : ((isnotnull(d_month_seq#12) AND (d_month_seq#12 = Subquery scalar-subquery#13, [id=#14])) AND isnotnull(d_date_sk#11)) + +(19) Project [codegen id : 3] +Output [1]: [d_date_sk#11] +Input [2]: [d_date_sk#11, d_month_seq#12] + +(20) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(21) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(22) Project [codegen id : 7] +Output [2]: [ca_state#2, ss_item_sk#6] +Input [4]: [ca_state#2, ss_item_sk#6, ss_sold_date_sk#8, d_date_sk#11] + +(23) Scan parquet default.item +Output [3]: [i_item_sk#16, i_current_price#17, i_category#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), IsNotNull(i_item_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 6] +Input [3]: [i_item_sk#16, i_current_price#17, i_category#18] + +(25) Filter [codegen id : 6] +Input [3]: [i_item_sk#16, i_current_price#17, i_category#18] +Condition : (isnotnull(i_current_price#17) AND isnotnull(i_item_sk#16)) + +(26) Scan parquet default.item +Output [2]: [i_current_price#19, i_category#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 4] +Input [2]: [i_current_price#19, i_category#20] + +(28) Filter [codegen id : 4] +Input [2]: [i_current_price#19, i_category#20] +Condition : isnotnull(i_category#20) + +(29) HashAggregate [codegen id : 4] +Input [2]: [i_current_price#19, i_category#20] +Keys [1]: [i_category#20] +Functions [1]: [partial_avg(UnscaledValue(i_current_price#19))] +Aggregate Attributes [2]: [sum#21, count#22] +Results [3]: [i_category#20, sum#23, count#24] + +(30) Exchange +Input [3]: [i_category#20, sum#23, count#24] +Arguments: hashpartitioning(i_category#20, 5), ENSURE_REQUIREMENTS, [id=#25] + +(31) HashAggregate [codegen id : 5] +Input [3]: [i_category#20, sum#23, count#24] +Keys [1]: [i_category#20] +Functions [1]: [avg(UnscaledValue(i_current_price#19))] +Aggregate Attributes [1]: [avg(UnscaledValue(i_current_price#19))#26] +Results [2]: [cast((avg(UnscaledValue(i_current_price#19))#26 / 100.0) as decimal(11,6)) AS avg(i_current_price)#27, i_category#20] + +(32) BroadcastExchange +Input [2]: [avg(i_current_price)#27, i_category#20] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#28] + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [i_category#18] +Right keys [1]: [i_category#20] +Join condition: None + +(34) Filter [codegen id : 6] +Input [5]: [i_item_sk#16, i_current_price#17, i_category#18, avg(i_current_price)#27, i_category#20] +Condition : (cast(i_current_price#17 as decimal(14,7)) > CheckOverflow((1.200000 * promote_precision(avg(i_current_price)#27)), DecimalType(14,7), true)) + +(35) Project [codegen id : 6] +Output [1]: [i_item_sk#16] +Input [5]: [i_item_sk#16, i_current_price#17, i_category#18, avg(i_current_price)#27, i_category#20] + +(36) BroadcastExchange +Input [1]: [i_item_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] + +(37) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_item_sk#6] +Right keys [1]: [i_item_sk#16] +Join condition: None + +(38) Project [codegen id : 7] +Output [1]: [ca_state#2] +Input [3]: [ca_state#2, ss_item_sk#6, i_item_sk#16] + +(39) HashAggregate [codegen id : 7] +Input [1]: [ca_state#2] +Keys [1]: [ca_state#2] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#30] +Results [2]: [ca_state#2, count#31] + +(40) Exchange +Input [2]: [ca_state#2, count#31] +Arguments: hashpartitioning(ca_state#2, 5), ENSURE_REQUIREMENTS, [id=#32] + +(41) HashAggregate [codegen id : 8] +Input [2]: [ca_state#2, count#31] +Keys [1]: [ca_state#2] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#33] +Results [3]: [ca_state#2 AS state#34, count(1)#33 AS cnt#35, count(1)#33 AS count(1)#36] + +(42) Filter [codegen id : 8] +Input [3]: [state#34, cnt#35, count(1)#36] +Condition : (count(1)#36 >= 10) + +(43) Project [codegen id : 8] +Output [2]: [state#34, cnt#35] +Input [3]: [state#34, cnt#35, count(1)#36] + +(44) TakeOrderedAndProject +Input [2]: [state#34, cnt#35] +Arguments: 100, [cnt#35 ASC NULLS FIRST], [state#34, cnt#35] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 10 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (45) + + +(45) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#11] + +Subquery:2 Hosting operator id = 18 Hosting Expression = Subquery scalar-subquery#13, [id=#14] +* HashAggregate (52) ++- Exchange (51) + +- * HashAggregate (50) + +- * Project (49) + +- * Filter (48) + +- * ColumnarToRow (47) + +- Scan parquet default.date_dim (46) + + +(46) Scan parquet default.date_dim +Output [3]: [d_month_seq#37, d_year#38, d_moy#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,1)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 1] +Input [3]: [d_month_seq#37, d_year#38, d_moy#39] + +(48) Filter [codegen id : 1] +Input [3]: [d_month_seq#37, d_year#38, d_moy#39] +Condition : (((isnotnull(d_year#38) AND isnotnull(d_moy#39)) AND (d_year#38 = 2000)) AND (d_moy#39 = 1)) + +(49) Project [codegen id : 1] +Output [1]: [d_month_seq#37] +Input [3]: [d_month_seq#37, d_year#38, d_moy#39] + +(50) HashAggregate [codegen id : 1] +Input [1]: [d_month_seq#37] +Keys [1]: [d_month_seq#37] +Functions: [] +Aggregate Attributes: [] +Results [1]: [d_month_seq#37] + +(51) Exchange +Input [1]: [d_month_seq#37] +Arguments: hashpartitioning(d_month_seq#37, 5), ENSURE_REQUIREMENTS, [id=#40] + +(52) HashAggregate [codegen id : 2] +Input [1]: [d_month_seq#37] +Keys [1]: [d_month_seq#37] +Functions: [] +Aggregate Attributes: [] +Results [1]: [d_month_seq#37] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6/simplified.txt new file mode 100644 index 0000000000000..d7fad5948f64b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q6/simplified.txt @@ -0,0 +1,79 @@ +TakeOrderedAndProject [cnt,state] + WholeStageCodegen (8) + Project [state,cnt] + Filter [count(1)] + HashAggregate [ca_state,count] [count(1),state,cnt,count(1),count] + InputAdapter + Exchange [ca_state] #1 + WholeStageCodegen (7) + HashAggregate [ca_state] [count,count] + Project [ca_state] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ca_state,ss_item_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ca_state,ss_item_sk,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Project [ca_state,c_customer_sk] + BroadcastHashJoin [ca_address_sk,c_current_addr_sk] + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [c_current_addr_sk,c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [ss_customer_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + Subquery #2 + WholeStageCodegen (2) + HashAggregate [d_month_seq] + InputAdapter + Exchange [d_month_seq] #5 + WholeStageCodegen (1) + HashAggregate [d_month_seq] + Project [d_month_seq] + Filter [d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Project [i_item_sk] + Filter [i_current_price,avg(i_current_price)] + BroadcastHashJoin [i_category,i_category] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_category] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (5) + HashAggregate [i_category,sum,count] [avg(UnscaledValue(i_current_price)),avg(i_current_price),sum,count] + InputAdapter + Exchange [i_category] #8 + WholeStageCodegen (4) + HashAggregate [i_category,i_current_price] [sum,count,sum,count] + Filter [i_category] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_current_price,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/explain.txt new file mode 100644 index 0000000000000..49cfd232239aa --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/explain.txt @@ -0,0 +1,395 @@ +== Physical Plan == +TakeOrderedAndProject (67) ++- * HashAggregate (66) + +- Exchange (65) + +- * HashAggregate (64) + +- Union (63) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.customer_address (11) + : +- BroadcastExchange (27) + : +- * BroadcastHashJoin LeftSemi BuildRight (26) + : :- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.item (18) + : +- BroadcastExchange (25) + : +- * Project (24) + : +- * Filter (23) + : +- * ColumnarToRow (22) + : +- Scan parquet default.item (21) + :- * HashAggregate (47) + : +- Exchange (46) + : +- * HashAggregate (45) + : +- * Project (44) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Project (41) + : : +- * BroadcastHashJoin Inner BuildRight (40) + : : :- * Project (38) + : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.catalog_sales (33) + : : : +- ReusedExchange (36) + : : +- ReusedExchange (39) + : +- ReusedExchange (42) + +- * HashAggregate (62) + +- Exchange (61) + +- * HashAggregate (60) + +- * Project (59) + +- * BroadcastHashJoin Inner BuildRight (58) + :- * Project (56) + : +- * BroadcastHashJoin Inner BuildRight (55) + : :- * Project (53) + : : +- * BroadcastHashJoin Inner BuildRight (52) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.web_sales (48) + : : +- ReusedExchange (51) + : +- ReusedExchange (54) + +- ReusedExchange (57) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_addr_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 5] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_addr_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,9), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((isnotnull(d_year#7) AND isnotnull(d_moy#8)) AND (d_year#7 = 1998)) AND (d_moy#8 = 9)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 5] +Output [3]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] +Input [5]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.customer_address +Output [2]: [ca_address_sk#10, ca_gmt_offset#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_gmt_offset), EqualTo(ca_gmt_offset,-5.00), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] + +(13) Filter [codegen id : 2] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] +Condition : ((isnotnull(ca_gmt_offset#11) AND (ca_gmt_offset#11 = -5.00)) AND isnotnull(ca_address_sk#10)) + +(14) Project [codegen id : 2] +Output [1]: [ca_address_sk#10] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] + +(15) BroadcastExchange +Input [1]: [ca_address_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#2] +Right keys [1]: [ca_address_sk#10] +Join condition: None + +(17) Project [codegen id : 5] +Output [2]: [ss_item_sk#1, ss_ext_sales_price#3] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ca_address_sk#10] + +(18) Scan parquet default.item +Output [2]: [i_item_sk#13, i_item_id#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#13, i_item_id#14] + +(20) Filter [codegen id : 4] +Input [2]: [i_item_sk#13, i_item_id#14] +Condition : isnotnull(i_item_sk#13) + +(21) Scan parquet default.item +Output [2]: [i_item_id#15, i_category#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Music )] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_id#15, i_category#16] + +(23) Filter [codegen id : 3] +Input [2]: [i_item_id#15, i_category#16] +Condition : (isnotnull(i_category#16) AND (i_category#16 = Music )) + +(24) Project [codegen id : 3] +Output [1]: [i_item_id#15] +Input [2]: [i_item_id#15, i_category#16] + +(25) BroadcastExchange +Input [1]: [i_item_id#15] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#17] + +(26) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_id#14] +Right keys [1]: [i_item_id#15] +Join condition: None + +(27) BroadcastExchange +Input [2]: [i_item_sk#13, i_item_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(29) Project [codegen id : 5] +Output [2]: [ss_ext_sales_price#3, i_item_id#14] +Input [4]: [ss_item_sk#1, ss_ext_sales_price#3, i_item_sk#13, i_item_id#14] + +(30) HashAggregate [codegen id : 5] +Input [2]: [ss_ext_sales_price#3, i_item_id#14] +Keys [1]: [i_item_id#14] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum#19] +Results [2]: [i_item_id#14, sum#20] + +(31) Exchange +Input [2]: [i_item_id#14, sum#20] +Arguments: hashpartitioning(i_item_id#14, 5), ENSURE_REQUIREMENTS, [id=#21] + +(32) HashAggregate [codegen id : 6] +Input [2]: [i_item_id#14, sum#20] +Keys [1]: [i_item_id#14] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#22] +Results [2]: [i_item_id#14, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#22,17,2) AS total_sales#23] + +(33) Scan parquet default.catalog_sales +Output [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#27), dynamicpruningexpression(cs_sold_date_sk#27 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] + +(35) Filter [codegen id : 11] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] +Condition : (isnotnull(cs_bill_addr_sk#24) AND isnotnull(cs_item_sk#25)) + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#28] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#27] +Right keys [1]: [d_date_sk#28] +Join condition: None + +(38) Project [codegen id : 11] +Output [3]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] +Input [5]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27, d_date_sk#28] + +(39) ReusedExchange [Reuses operator id: 15] +Output [1]: [ca_address_sk#29] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_bill_addr_sk#24] +Right keys [1]: [ca_address_sk#29] +Join condition: None + +(41) Project [codegen id : 11] +Output [2]: [cs_item_sk#25, cs_ext_sales_price#26] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, ca_address_sk#29] + +(42) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#30, i_item_id#31] + +(43) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_item_sk#25] +Right keys [1]: [i_item_sk#30] +Join condition: None + +(44) Project [codegen id : 11] +Output [2]: [cs_ext_sales_price#26, i_item_id#31] +Input [4]: [cs_item_sk#25, cs_ext_sales_price#26, i_item_sk#30, i_item_id#31] + +(45) HashAggregate [codegen id : 11] +Input [2]: [cs_ext_sales_price#26, i_item_id#31] +Keys [1]: [i_item_id#31] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#26))] +Aggregate Attributes [1]: [sum#32] +Results [2]: [i_item_id#31, sum#33] + +(46) Exchange +Input [2]: [i_item_id#31, sum#33] +Arguments: hashpartitioning(i_item_id#31, 5), ENSURE_REQUIREMENTS, [id=#34] + +(47) HashAggregate [codegen id : 12] +Input [2]: [i_item_id#31, sum#33] +Keys [1]: [i_item_id#31] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#26))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#26))#35] +Results [2]: [i_item_id#31, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#26))#35,17,2) AS total_sales#36] + +(48) Scan parquet default.web_sales +Output [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#40), dynamicpruningexpression(ws_sold_date_sk#40 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 17] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] + +(50) Filter [codegen id : 17] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] +Condition : (isnotnull(ws_bill_addr_sk#38) AND isnotnull(ws_item_sk#37)) + +(51) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#41] + +(52) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#40] +Right keys [1]: [d_date_sk#41] +Join condition: None + +(53) Project [codegen id : 17] +Output [3]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39] +Input [5]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40, d_date_sk#41] + +(54) ReusedExchange [Reuses operator id: 15] +Output [1]: [ca_address_sk#42] + +(55) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_bill_addr_sk#38] +Right keys [1]: [ca_address_sk#42] +Join condition: None + +(56) Project [codegen id : 17] +Output [2]: [ws_item_sk#37, ws_ext_sales_price#39] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ca_address_sk#42] + +(57) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#43, i_item_id#44] + +(58) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_item_sk#37] +Right keys [1]: [i_item_sk#43] +Join condition: None + +(59) Project [codegen id : 17] +Output [2]: [ws_ext_sales_price#39, i_item_id#44] +Input [4]: [ws_item_sk#37, ws_ext_sales_price#39, i_item_sk#43, i_item_id#44] + +(60) HashAggregate [codegen id : 17] +Input [2]: [ws_ext_sales_price#39, i_item_id#44] +Keys [1]: [i_item_id#44] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#39))] +Aggregate Attributes [1]: [sum#45] +Results [2]: [i_item_id#44, sum#46] + +(61) Exchange +Input [2]: [i_item_id#44, sum#46] +Arguments: hashpartitioning(i_item_id#44, 5), ENSURE_REQUIREMENTS, [id=#47] + +(62) HashAggregate [codegen id : 18] +Input [2]: [i_item_id#44, sum#46] +Keys [1]: [i_item_id#44] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#39))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#39))#48] +Results [2]: [i_item_id#44, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#39))#48,17,2) AS total_sales#49] + +(63) Union + +(64) HashAggregate [codegen id : 19] +Input [2]: [i_item_id#14, total_sales#23] +Keys [1]: [i_item_id#14] +Functions [1]: [partial_sum(total_sales#23)] +Aggregate Attributes [2]: [sum#50, isEmpty#51] +Results [3]: [i_item_id#14, sum#52, isEmpty#53] + +(65) Exchange +Input [3]: [i_item_id#14, sum#52, isEmpty#53] +Arguments: hashpartitioning(i_item_id#14, 5), ENSURE_REQUIREMENTS, [id=#54] + +(66) HashAggregate [codegen id : 20] +Input [3]: [i_item_id#14, sum#52, isEmpty#53] +Keys [1]: [i_item_id#14] +Functions [1]: [sum(total_sales#23)] +Aggregate Attributes [1]: [sum(total_sales#23)#55] +Results [2]: [i_item_id#14, sum(total_sales#23)#55 AS total_sales#56] + +(67) TakeOrderedAndProject +Input [2]: [i_item_id#14, total_sales#56] +Arguments: 100, [i_item_id#14 ASC NULLS FIRST, total_sales#56 ASC NULLS FIRST], [i_item_id#14, total_sales#56] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (68) + + +(68) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 33 Hosting Expression = cs_sold_date_sk#27 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 48 Hosting Expression = ws_sold_date_sk#40 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/simplified.txt new file mode 100644 index 0000000000000..46775417cbb70 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60.sf100/simplified.txt @@ -0,0 +1,105 @@ +TakeOrderedAndProject [i_item_id,total_sales] + WholeStageCodegen (20) + HashAggregate [i_item_id,sum,isEmpty] [sum(total_sales),total_sales,sum,isEmpty] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (19) + HashAggregate [i_item_id,total_sales] [sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (6) + HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_item_id] #2 + WholeStageCodegen (5) + HashAggregate [i_item_id,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_item_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_addr_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_addr_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [ca_address_sk] + Filter [ca_gmt_offset,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_gmt_offset] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + BroadcastHashJoin [i_item_id,i_item_id] + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [i_item_id] + Filter [i_category] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_id,i_category] + WholeStageCodegen (12) + HashAggregate [i_item_id,sum] [sum(UnscaledValue(cs_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_item_id] #7 + WholeStageCodegen (11) + HashAggregate [i_item_id,cs_ext_sales_price] [sum,sum] + Project [cs_ext_sales_price,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_bill_addr_sk,ca_address_sk] + Project [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_addr_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [ca_address_sk] #4 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 + WholeStageCodegen (18) + HashAggregate [i_item_id,sum] [sum(UnscaledValue(ws_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_item_id] #8 + WholeStageCodegen (17) + HashAggregate [i_item_id,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,i_item_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] + Project [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_addr_sk,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [ca_address_sk] #4 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/explain.txt new file mode 100644 index 0000000000000..49cfd232239aa --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/explain.txt @@ -0,0 +1,395 @@ +== Physical Plan == +TakeOrderedAndProject (67) ++- * HashAggregate (66) + +- Exchange (65) + +- * HashAggregate (64) + +- Union (63) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.customer_address (11) + : +- BroadcastExchange (27) + : +- * BroadcastHashJoin LeftSemi BuildRight (26) + : :- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.item (18) + : +- BroadcastExchange (25) + : +- * Project (24) + : +- * Filter (23) + : +- * ColumnarToRow (22) + : +- Scan parquet default.item (21) + :- * HashAggregate (47) + : +- Exchange (46) + : +- * HashAggregate (45) + : +- * Project (44) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Project (41) + : : +- * BroadcastHashJoin Inner BuildRight (40) + : : :- * Project (38) + : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.catalog_sales (33) + : : : +- ReusedExchange (36) + : : +- ReusedExchange (39) + : +- ReusedExchange (42) + +- * HashAggregate (62) + +- Exchange (61) + +- * HashAggregate (60) + +- * Project (59) + +- * BroadcastHashJoin Inner BuildRight (58) + :- * Project (56) + : +- * BroadcastHashJoin Inner BuildRight (55) + : :- * Project (53) + : : +- * BroadcastHashJoin Inner BuildRight (52) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.web_sales (48) + : : +- ReusedExchange (51) + : +- ReusedExchange (54) + +- ReusedExchange (57) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_addr_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 5] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_addr_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,9), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((isnotnull(d_year#7) AND isnotnull(d_moy#8)) AND (d_year#7 = 1998)) AND (d_moy#8 = 9)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 5] +Output [3]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3] +Input [5]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.customer_address +Output [2]: [ca_address_sk#10, ca_gmt_offset#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_gmt_offset), EqualTo(ca_gmt_offset,-5.00), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] + +(13) Filter [codegen id : 2] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] +Condition : ((isnotnull(ca_gmt_offset#11) AND (ca_gmt_offset#11 = -5.00)) AND isnotnull(ca_address_sk#10)) + +(14) Project [codegen id : 2] +Output [1]: [ca_address_sk#10] +Input [2]: [ca_address_sk#10, ca_gmt_offset#11] + +(15) BroadcastExchange +Input [1]: [ca_address_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#2] +Right keys [1]: [ca_address_sk#10] +Join condition: None + +(17) Project [codegen id : 5] +Output [2]: [ss_item_sk#1, ss_ext_sales_price#3] +Input [4]: [ss_item_sk#1, ss_addr_sk#2, ss_ext_sales_price#3, ca_address_sk#10] + +(18) Scan parquet default.item +Output [2]: [i_item_sk#13, i_item_id#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#13, i_item_id#14] + +(20) Filter [codegen id : 4] +Input [2]: [i_item_sk#13, i_item_id#14] +Condition : isnotnull(i_item_sk#13) + +(21) Scan parquet default.item +Output [2]: [i_item_id#15, i_category#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Music )] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_id#15, i_category#16] + +(23) Filter [codegen id : 3] +Input [2]: [i_item_id#15, i_category#16] +Condition : (isnotnull(i_category#16) AND (i_category#16 = Music )) + +(24) Project [codegen id : 3] +Output [1]: [i_item_id#15] +Input [2]: [i_item_id#15, i_category#16] + +(25) BroadcastExchange +Input [1]: [i_item_id#15] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#17] + +(26) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_id#14] +Right keys [1]: [i_item_id#15] +Join condition: None + +(27) BroadcastExchange +Input [2]: [i_item_sk#13, i_item_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(29) Project [codegen id : 5] +Output [2]: [ss_ext_sales_price#3, i_item_id#14] +Input [4]: [ss_item_sk#1, ss_ext_sales_price#3, i_item_sk#13, i_item_id#14] + +(30) HashAggregate [codegen id : 5] +Input [2]: [ss_ext_sales_price#3, i_item_id#14] +Keys [1]: [i_item_id#14] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum#19] +Results [2]: [i_item_id#14, sum#20] + +(31) Exchange +Input [2]: [i_item_id#14, sum#20] +Arguments: hashpartitioning(i_item_id#14, 5), ENSURE_REQUIREMENTS, [id=#21] + +(32) HashAggregate [codegen id : 6] +Input [2]: [i_item_id#14, sum#20] +Keys [1]: [i_item_id#14] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#3))#22] +Results [2]: [i_item_id#14, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#22,17,2) AS total_sales#23] + +(33) Scan parquet default.catalog_sales +Output [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#27), dynamicpruningexpression(cs_sold_date_sk#27 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_bill_addr_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] + +(35) Filter [codegen id : 11] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27] +Condition : (isnotnull(cs_bill_addr_sk#24) AND isnotnull(cs_item_sk#25)) + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#28] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#27] +Right keys [1]: [d_date_sk#28] +Join condition: None + +(38) Project [codegen id : 11] +Output [3]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26] +Input [5]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, cs_sold_date_sk#27, d_date_sk#28] + +(39) ReusedExchange [Reuses operator id: 15] +Output [1]: [ca_address_sk#29] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_bill_addr_sk#24] +Right keys [1]: [ca_address_sk#29] +Join condition: None + +(41) Project [codegen id : 11] +Output [2]: [cs_item_sk#25, cs_ext_sales_price#26] +Input [4]: [cs_bill_addr_sk#24, cs_item_sk#25, cs_ext_sales_price#26, ca_address_sk#29] + +(42) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#30, i_item_id#31] + +(43) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_item_sk#25] +Right keys [1]: [i_item_sk#30] +Join condition: None + +(44) Project [codegen id : 11] +Output [2]: [cs_ext_sales_price#26, i_item_id#31] +Input [4]: [cs_item_sk#25, cs_ext_sales_price#26, i_item_sk#30, i_item_id#31] + +(45) HashAggregate [codegen id : 11] +Input [2]: [cs_ext_sales_price#26, i_item_id#31] +Keys [1]: [i_item_id#31] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#26))] +Aggregate Attributes [1]: [sum#32] +Results [2]: [i_item_id#31, sum#33] + +(46) Exchange +Input [2]: [i_item_id#31, sum#33] +Arguments: hashpartitioning(i_item_id#31, 5), ENSURE_REQUIREMENTS, [id=#34] + +(47) HashAggregate [codegen id : 12] +Input [2]: [i_item_id#31, sum#33] +Keys [1]: [i_item_id#31] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#26))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#26))#35] +Results [2]: [i_item_id#31, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#26))#35,17,2) AS total_sales#36] + +(48) Scan parquet default.web_sales +Output [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#40), dynamicpruningexpression(ws_sold_date_sk#40 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_bill_addr_sk), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 17] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] + +(50) Filter [codegen id : 17] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40] +Condition : (isnotnull(ws_bill_addr_sk#38) AND isnotnull(ws_item_sk#37)) + +(51) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#41] + +(52) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#40] +Right keys [1]: [d_date_sk#41] +Join condition: None + +(53) Project [codegen id : 17] +Output [3]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39] +Input [5]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ws_sold_date_sk#40, d_date_sk#41] + +(54) ReusedExchange [Reuses operator id: 15] +Output [1]: [ca_address_sk#42] + +(55) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_bill_addr_sk#38] +Right keys [1]: [ca_address_sk#42] +Join condition: None + +(56) Project [codegen id : 17] +Output [2]: [ws_item_sk#37, ws_ext_sales_price#39] +Input [4]: [ws_item_sk#37, ws_bill_addr_sk#38, ws_ext_sales_price#39, ca_address_sk#42] + +(57) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#43, i_item_id#44] + +(58) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_item_sk#37] +Right keys [1]: [i_item_sk#43] +Join condition: None + +(59) Project [codegen id : 17] +Output [2]: [ws_ext_sales_price#39, i_item_id#44] +Input [4]: [ws_item_sk#37, ws_ext_sales_price#39, i_item_sk#43, i_item_id#44] + +(60) HashAggregate [codegen id : 17] +Input [2]: [ws_ext_sales_price#39, i_item_id#44] +Keys [1]: [i_item_id#44] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#39))] +Aggregate Attributes [1]: [sum#45] +Results [2]: [i_item_id#44, sum#46] + +(61) Exchange +Input [2]: [i_item_id#44, sum#46] +Arguments: hashpartitioning(i_item_id#44, 5), ENSURE_REQUIREMENTS, [id=#47] + +(62) HashAggregate [codegen id : 18] +Input [2]: [i_item_id#44, sum#46] +Keys [1]: [i_item_id#44] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#39))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#39))#48] +Results [2]: [i_item_id#44, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#39))#48,17,2) AS total_sales#49] + +(63) Union + +(64) HashAggregate [codegen id : 19] +Input [2]: [i_item_id#14, total_sales#23] +Keys [1]: [i_item_id#14] +Functions [1]: [partial_sum(total_sales#23)] +Aggregate Attributes [2]: [sum#50, isEmpty#51] +Results [3]: [i_item_id#14, sum#52, isEmpty#53] + +(65) Exchange +Input [3]: [i_item_id#14, sum#52, isEmpty#53] +Arguments: hashpartitioning(i_item_id#14, 5), ENSURE_REQUIREMENTS, [id=#54] + +(66) HashAggregate [codegen id : 20] +Input [3]: [i_item_id#14, sum#52, isEmpty#53] +Keys [1]: [i_item_id#14] +Functions [1]: [sum(total_sales#23)] +Aggregate Attributes [1]: [sum(total_sales#23)#55] +Results [2]: [i_item_id#14, sum(total_sales#23)#55 AS total_sales#56] + +(67) TakeOrderedAndProject +Input [2]: [i_item_id#14, total_sales#56] +Arguments: 100, [i_item_id#14 ASC NULLS FIRST, total_sales#56 ASC NULLS FIRST], [i_item_id#14, total_sales#56] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (68) + + +(68) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 33 Hosting Expression = cs_sold_date_sk#27 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 48 Hosting Expression = ws_sold_date_sk#40 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/simplified.txt new file mode 100644 index 0000000000000..46775417cbb70 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q60/simplified.txt @@ -0,0 +1,105 @@ +TakeOrderedAndProject [i_item_id,total_sales] + WholeStageCodegen (20) + HashAggregate [i_item_id,sum,isEmpty] [sum(total_sales),total_sales,sum,isEmpty] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (19) + HashAggregate [i_item_id,total_sales] [sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (6) + HashAggregate [i_item_id,sum] [sum(UnscaledValue(ss_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_item_id] #2 + WholeStageCodegen (5) + HashAggregate [i_item_id,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_item_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_addr_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_addr_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_addr_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [ca_address_sk] + Filter [ca_gmt_offset,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_gmt_offset] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + BroadcastHashJoin [i_item_id,i_item_id] + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [i_item_id] + Filter [i_category] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_id,i_category] + WholeStageCodegen (12) + HashAggregate [i_item_id,sum] [sum(UnscaledValue(cs_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_item_id] #7 + WholeStageCodegen (11) + HashAggregate [i_item_id,cs_ext_sales_price] [sum,sum] + Project [cs_ext_sales_price,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_bill_addr_sk,ca_address_sk] + Project [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_addr_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_addr_sk,cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [ca_address_sk] #4 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 + WholeStageCodegen (18) + HashAggregate [i_item_id,sum] [sum(UnscaledValue(ws_ext_sales_price)),total_sales,sum] + InputAdapter + Exchange [i_item_id] #8 + WholeStageCodegen (17) + HashAggregate [i_item_id,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,i_item_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_bill_addr_sk,ca_address_sk] + Project [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_addr_sk,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_addr_sk,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [ca_address_sk] #4 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt new file mode 100644 index 0000000000000..410fd9bc3d4e7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/explain.txt @@ -0,0 +1,395 @@ +== Physical Plan == +* Sort (69) ++- * Project (68) + +- * BroadcastNestedLoopJoin Inner BuildRight (67) + :- * HashAggregate (47) + : +- Exchange (46) + : +- * HashAggregate (45) + : +- * Project (44) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Project (31) + : : +- * BroadcastHashJoin Inner BuildRight (30) + : : :- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Project (17) + : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : :- * Project (10) + : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.store_sales (1) + : : : : : +- BroadcastExchange (8) + : : : : : +- * Project (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.date_dim (4) + : : : : +- BroadcastExchange (15) + : : : : +- * Project (14) + : : : : +- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.item (11) + : : : +- BroadcastExchange (22) + : : : +- * Project (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.promotion (18) + : : +- BroadcastExchange (29) + : : +- * Project (28) + : : +- * Filter (27) + : : +- * ColumnarToRow (26) + : : +- Scan parquet default.store (25) + : +- BroadcastExchange (42) + : +- * Project (41) + : +- * BroadcastHashJoin Inner BuildRight (40) + : :- * Filter (34) + : : +- * ColumnarToRow (33) + : : +- Scan parquet default.customer (32) + : +- BroadcastExchange (39) + : +- * Project (38) + : +- * Filter (37) + : +- * ColumnarToRow (36) + : +- Scan parquet default.customer_address (35) + +- BroadcastExchange (66) + +- * HashAggregate (65) + +- Exchange (64) + +- * HashAggregate (63) + +- * Project (62) + +- * BroadcastHashJoin Inner BuildRight (61) + :- * Project (59) + : +- * BroadcastHashJoin Inner BuildRight (58) + : :- * Project (56) + : : +- * BroadcastHashJoin Inner BuildRight (55) + : : :- * Project (53) + : : : +- * BroadcastHashJoin Inner BuildRight (52) + : : : :- * Filter (50) + : : : : +- * ColumnarToRow (49) + : : : : +- Scan parquet default.store_sales (48) + : : : +- ReusedExchange (51) + : : +- ReusedExchange (54) + : +- ReusedExchange (57) + +- ReusedExchange (60) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_promo_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 7] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 7] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_store_sk#3) AND isnotnull(ss_promo_sk#4)) AND isnotnull(ss_customer_sk#2)) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#8, d_year#9, d_moy#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] +Condition : ((((isnotnull(d_year#9) AND isnotnull(d_moy#10)) AND (d_year#9 = 1998)) AND (d_moy#10 = 11)) AND isnotnull(d_date_sk#8)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#8] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(8) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(9) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(10) Project [codegen id : 7] +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6, d_date_sk#8] + +(11) Scan parquet default.item +Output [2]: [i_item_sk#12, i_category#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Jewelry ), IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [i_item_sk#12, i_category#13] + +(13) Filter [codegen id : 2] +Input [2]: [i_item_sk#12, i_category#13] +Condition : ((isnotnull(i_category#13) AND (i_category#13 = Jewelry )) AND isnotnull(i_item_sk#12)) + +(14) Project [codegen id : 2] +Output [1]: [i_item_sk#12] +Input [2]: [i_item_sk#12, i_category#13] + +(15) BroadcastExchange +Input [1]: [i_item_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(16) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#12] +Join condition: None + +(17) Project [codegen id : 7] +Output [4]: [ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, i_item_sk#12] + +(18) Scan parquet default.promotion +Output [4]: [p_promo_sk#15, p_channel_dmail#16, p_channel_email#17, p_channel_tv#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [Or(Or(EqualTo(p_channel_dmail,Y),EqualTo(p_channel_email,Y)),EqualTo(p_channel_tv,Y)), IsNotNull(p_promo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [4]: [p_promo_sk#15, p_channel_dmail#16, p_channel_email#17, p_channel_tv#18] + +(20) Filter [codegen id : 3] +Input [4]: [p_promo_sk#15, p_channel_dmail#16, p_channel_email#17, p_channel_tv#18] +Condition : ((((p_channel_dmail#16 = Y) OR (p_channel_email#17 = Y)) OR (p_channel_tv#18 = Y)) AND isnotnull(p_promo_sk#15)) + +(21) Project [codegen id : 3] +Output [1]: [p_promo_sk#15] +Input [4]: [p_promo_sk#15, p_channel_dmail#16, p_channel_email#17, p_channel_tv#18] + +(22) BroadcastExchange +Input [1]: [p_promo_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] + +(23) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_promo_sk#4] +Right keys [1]: [p_promo_sk#15] +Join condition: None + +(24) Project [codegen id : 7] +Output [3]: [ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#5] +Input [5]: [ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, p_promo_sk#15] + +(25) Scan parquet default.store +Output [2]: [s_store_sk#20, s_gmt_offset#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_gmt_offset), EqualTo(s_gmt_offset,-5.00), IsNotNull(s_store_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 4] +Input [2]: [s_store_sk#20, s_gmt_offset#21] + +(27) Filter [codegen id : 4] +Input [2]: [s_store_sk#20, s_gmt_offset#21] +Condition : ((isnotnull(s_gmt_offset#21) AND (s_gmt_offset#21 = -5.00)) AND isnotnull(s_store_sk#20)) + +(28) Project [codegen id : 4] +Output [1]: [s_store_sk#20] +Input [2]: [s_store_sk#20, s_gmt_offset#21] + +(29) BroadcastExchange +Input [1]: [s_store_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] + +(30) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#20] +Join condition: None + +(31) Project [codegen id : 7] +Output [2]: [ss_customer_sk#2, ss_ext_sales_price#5] +Input [4]: [ss_customer_sk#2, ss_store_sk#3, ss_ext_sales_price#5, s_store_sk#20] + +(32) Scan parquet default.customer +Output [2]: [c_customer_sk#23, c_current_addr_sk#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(33) ColumnarToRow [codegen id : 6] +Input [2]: [c_customer_sk#23, c_current_addr_sk#24] + +(34) Filter [codegen id : 6] +Input [2]: [c_customer_sk#23, c_current_addr_sk#24] +Condition : (isnotnull(c_customer_sk#23) AND isnotnull(c_current_addr_sk#24)) + +(35) Scan parquet default.customer_address +Output [2]: [ca_address_sk#25, ca_gmt_offset#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_gmt_offset), EqualTo(ca_gmt_offset,-5.00), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 5] +Input [2]: [ca_address_sk#25, ca_gmt_offset#26] + +(37) Filter [codegen id : 5] +Input [2]: [ca_address_sk#25, ca_gmt_offset#26] +Condition : ((isnotnull(ca_gmt_offset#26) AND (ca_gmt_offset#26 = -5.00)) AND isnotnull(ca_address_sk#25)) + +(38) Project [codegen id : 5] +Output [1]: [ca_address_sk#25] +Input [2]: [ca_address_sk#25, ca_gmt_offset#26] + +(39) BroadcastExchange +Input [1]: [ca_address_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] + +(40) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [c_current_addr_sk#24] +Right keys [1]: [ca_address_sk#25] +Join condition: None + +(41) Project [codegen id : 6] +Output [1]: [c_customer_sk#23] +Input [3]: [c_customer_sk#23, c_current_addr_sk#24, ca_address_sk#25] + +(42) BroadcastExchange +Input [1]: [c_customer_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] + +(43) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#23] +Join condition: None + +(44) Project [codegen id : 7] +Output [1]: [ss_ext_sales_price#5] +Input [3]: [ss_customer_sk#2, ss_ext_sales_price#5, c_customer_sk#23] + +(45) HashAggregate [codegen id : 7] +Input [1]: [ss_ext_sales_price#5] +Keys: [] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum#29] +Results [1]: [sum#30] + +(46) Exchange +Input [1]: [sum#30] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#31] + +(47) HashAggregate [codegen id : 15] +Input [1]: [sum#30] +Keys: [] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#32] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#32,17,2) AS promotions#33] + +(48) Scan parquet default.store_sales +Output [5]: [ss_item_sk#34, ss_customer_sk#35, ss_store_sk#36, ss_ext_sales_price#37, ss_sold_date_sk#38] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#38), dynamicpruningexpression(ss_sold_date_sk#38 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 13] +Input [5]: [ss_item_sk#34, ss_customer_sk#35, ss_store_sk#36, ss_ext_sales_price#37, ss_sold_date_sk#38] + +(50) Filter [codegen id : 13] +Input [5]: [ss_item_sk#34, ss_customer_sk#35, ss_store_sk#36, ss_ext_sales_price#37, ss_sold_date_sk#38] +Condition : ((isnotnull(ss_store_sk#36) AND isnotnull(ss_customer_sk#35)) AND isnotnull(ss_item_sk#34)) + +(51) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#39] + +(52) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_sold_date_sk#38] +Right keys [1]: [d_date_sk#39] +Join condition: None + +(53) Project [codegen id : 13] +Output [4]: [ss_item_sk#34, ss_customer_sk#35, ss_store_sk#36, ss_ext_sales_price#37] +Input [6]: [ss_item_sk#34, ss_customer_sk#35, ss_store_sk#36, ss_ext_sales_price#37, ss_sold_date_sk#38, d_date_sk#39] + +(54) ReusedExchange [Reuses operator id: 15] +Output [1]: [i_item_sk#40] + +(55) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_item_sk#34] +Right keys [1]: [i_item_sk#40] +Join condition: None + +(56) Project [codegen id : 13] +Output [3]: [ss_customer_sk#35, ss_store_sk#36, ss_ext_sales_price#37] +Input [5]: [ss_item_sk#34, ss_customer_sk#35, ss_store_sk#36, ss_ext_sales_price#37, i_item_sk#40] + +(57) ReusedExchange [Reuses operator id: 29] +Output [1]: [s_store_sk#41] + +(58) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_store_sk#36] +Right keys [1]: [s_store_sk#41] +Join condition: None + +(59) Project [codegen id : 13] +Output [2]: [ss_customer_sk#35, ss_ext_sales_price#37] +Input [4]: [ss_customer_sk#35, ss_store_sk#36, ss_ext_sales_price#37, s_store_sk#41] + +(60) ReusedExchange [Reuses operator id: 42] +Output [1]: [c_customer_sk#42] + +(61) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_customer_sk#35] +Right keys [1]: [c_customer_sk#42] +Join condition: None + +(62) Project [codegen id : 13] +Output [1]: [ss_ext_sales_price#37] +Input [3]: [ss_customer_sk#35, ss_ext_sales_price#37, c_customer_sk#42] + +(63) HashAggregate [codegen id : 13] +Input [1]: [ss_ext_sales_price#37] +Keys: [] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#37))] +Aggregate Attributes [1]: [sum#43] +Results [1]: [sum#44] + +(64) Exchange +Input [1]: [sum#44] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#45] + +(65) HashAggregate [codegen id : 14] +Input [1]: [sum#44] +Keys: [] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#37))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#37))#46] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#37))#46,17,2) AS total#47] + +(66) BroadcastExchange +Input [1]: [total#47] +Arguments: IdentityBroadcastMode, [id=#48] + +(67) BroadcastNestedLoopJoin [codegen id : 15] +Join condition: None + +(68) Project [codegen id : 15] +Output [3]: [promotions#33, total#47, CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(promotions#33 as decimal(15,4))) / promote_precision(cast(total#47 as decimal(15,4)))), DecimalType(35,20), true)) * 100.00000000000000000000), DecimalType(38,19), true) AS ((CAST(promotions AS DECIMAL(15,4)) / CAST(total AS DECIMAL(15,4))) * 100)#49] +Input [2]: [promotions#33, total#47] + +(69) Sort [codegen id : 15] +Input [3]: [promotions#33, total#47, ((CAST(promotions AS DECIMAL(15,4)) / CAST(total AS DECIMAL(15,4))) * 100)#49] +Arguments: [promotions#33 ASC NULLS FIRST, total#47 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (70) + + +(70) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 48 Hosting Expression = ss_sold_date_sk#38 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt new file mode 100644 index 0000000000000..b4e4877c12ee1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61.sf100/simplified.txt @@ -0,0 +1,103 @@ +WholeStageCodegen (15) + Sort [promotions,total] + Project [promotions,total] + BroadcastNestedLoopJoin + HashAggregate [sum] [sum(UnscaledValue(ss_ext_sales_price)),promotions,sum] + InputAdapter + Exchange #1 + WholeStageCodegen (7) + HashAggregate [ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_store_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_customer_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_promo_sk,ss_customer_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [i_item_sk] + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [p_promo_sk] + Filter [p_channel_dmail,p_channel_email,p_channel_tv,p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk,p_channel_dmail,p_channel_email,p_channel_tv] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Project [s_store_sk] + Filter [s_gmt_offset,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_gmt_offset] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Project [c_customer_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (5) + Project [ca_address_sk] + Filter [ca_gmt_offset,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_gmt_offset] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (14) + HashAggregate [sum] [sum(UnscaledValue(ss_ext_sales_price)),total,sum] + InputAdapter + Exchange #9 + WholeStageCodegen (13) + HashAggregate [ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_store_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_customer_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk] #3 + InputAdapter + ReusedExchange [s_store_sk] #5 + InputAdapter + ReusedExchange [c_customer_sk] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61/explain.txt new file mode 100644 index 0000000000000..e0bee37e047cb --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61/explain.txt @@ -0,0 +1,410 @@ +== Physical Plan == +* Sort (72) ++- * Project (71) + +- * BroadcastNestedLoopJoin Inner BuildRight (70) + :- * HashAggregate (47) + : +- Exchange (46) + : +- * HashAggregate (45) + : +- * Project (44) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Project (37) + : : +- * BroadcastHashJoin Inner BuildRight (36) + : : :- * Project (30) + : : : +- * BroadcastHashJoin Inner BuildRight (29) + : : : :- * Project (24) + : : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : : :- * Project (17) + : : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : : :- * Project (10) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : +- BroadcastExchange (8) + : : : : : : +- * Project (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.store (4) + : : : : : +- BroadcastExchange (15) + : : : : : +- * Project (14) + : : : : : +- * Filter (13) + : : : : : +- * ColumnarToRow (12) + : : : : : +- Scan parquet default.promotion (11) + : : : : +- BroadcastExchange (22) + : : : : +- * Project (21) + : : : : +- * Filter (20) + : : : : +- * ColumnarToRow (19) + : : : : +- Scan parquet default.date_dim (18) + : : : +- BroadcastExchange (28) + : : : +- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.customer (25) + : : +- BroadcastExchange (35) + : : +- * Project (34) + : : +- * Filter (33) + : : +- * ColumnarToRow (32) + : : +- Scan parquet default.customer_address (31) + : +- BroadcastExchange (42) + : +- * Project (41) + : +- * Filter (40) + : +- * ColumnarToRow (39) + : +- Scan parquet default.item (38) + +- BroadcastExchange (69) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- * Project (65) + +- * BroadcastHashJoin Inner BuildRight (64) + :- * Project (62) + : +- * BroadcastHashJoin Inner BuildRight (61) + : :- * Project (59) + : : +- * BroadcastHashJoin Inner BuildRight (58) + : : :- * Project (56) + : : : +- * BroadcastHashJoin Inner BuildRight (55) + : : : :- * Project (53) + : : : : +- * BroadcastHashJoin Inner BuildRight (52) + : : : : :- * Filter (50) + : : : : : +- * ColumnarToRow (49) + : : : : : +- Scan parquet default.store_sales (48) + : : : : +- ReusedExchange (51) + : : : +- ReusedExchange (54) + : : +- ReusedExchange (57) + : +- ReusedExchange (60) + +- ReusedExchange (63) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_promo_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 7] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 7] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_store_sk#3) AND isnotnull(ss_promo_sk#4)) AND isnotnull(ss_customer_sk#2)) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.store +Output [2]: [s_store_sk#8, s_gmt_offset#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_gmt_offset), EqualTo(s_gmt_offset,-5.00), IsNotNull(s_store_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [s_store_sk#8, s_gmt_offset#9] + +(6) Filter [codegen id : 1] +Input [2]: [s_store_sk#8, s_gmt_offset#9] +Condition : ((isnotnull(s_gmt_offset#9) AND (s_gmt_offset#9 = -5.00)) AND isnotnull(s_store_sk#8)) + +(7) Project [codegen id : 1] +Output [1]: [s_store_sk#8] +Input [2]: [s_store_sk#8, s_gmt_offset#9] + +(8) BroadcastExchange +Input [1]: [s_store_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(9) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#8] +Join condition: None + +(10) Project [codegen id : 7] +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_promo_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_promo_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6, s_store_sk#8] + +(11) Scan parquet default.promotion +Output [4]: [p_promo_sk#11, p_channel_dmail#12, p_channel_email#13, p_channel_tv#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [Or(Or(EqualTo(p_channel_dmail,Y),EqualTo(p_channel_email,Y)),EqualTo(p_channel_tv,Y)), IsNotNull(p_promo_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [4]: [p_promo_sk#11, p_channel_dmail#12, p_channel_email#13, p_channel_tv#14] + +(13) Filter [codegen id : 2] +Input [4]: [p_promo_sk#11, p_channel_dmail#12, p_channel_email#13, p_channel_tv#14] +Condition : ((((p_channel_dmail#12 = Y) OR (p_channel_email#13 = Y)) OR (p_channel_tv#14 = Y)) AND isnotnull(p_promo_sk#11)) + +(14) Project [codegen id : 2] +Output [1]: [p_promo_sk#11] +Input [4]: [p_promo_sk#11, p_channel_dmail#12, p_channel_email#13, p_channel_tv#14] + +(15) BroadcastExchange +Input [1]: [p_promo_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(16) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_promo_sk#4] +Right keys [1]: [p_promo_sk#11] +Join condition: None + +(17) Project [codegen id : 7] +Output [4]: [ss_item_sk#1, ss_customer_sk#2, ss_ext_sales_price#5, ss_sold_date_sk#6] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_promo_sk#4, ss_ext_sales_price#5, ss_sold_date_sk#6, p_promo_sk#11] + +(18) Scan parquet default.date_dim +Output [3]: [d_date_sk#16, d_year#17, d_moy#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#16, d_year#17, d_moy#18] + +(20) Filter [codegen id : 3] +Input [3]: [d_date_sk#16, d_year#17, d_moy#18] +Condition : ((((isnotnull(d_year#17) AND isnotnull(d_moy#18)) AND (d_year#17 = 1998)) AND (d_moy#18 = 11)) AND isnotnull(d_date_sk#16)) + +(21) Project [codegen id : 3] +Output [1]: [d_date_sk#16] +Input [3]: [d_date_sk#16, d_year#17, d_moy#18] + +(22) BroadcastExchange +Input [1]: [d_date_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] + +(23) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(24) Project [codegen id : 7] +Output [3]: [ss_item_sk#1, ss_customer_sk#2, ss_ext_sales_price#5] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_ext_sales_price#5, ss_sold_date_sk#6, d_date_sk#16] + +(25) Scan parquet default.customer +Output [2]: [c_customer_sk#20, c_current_addr_sk#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 4] +Input [2]: [c_customer_sk#20, c_current_addr_sk#21] + +(27) Filter [codegen id : 4] +Input [2]: [c_customer_sk#20, c_current_addr_sk#21] +Condition : (isnotnull(c_customer_sk#20) AND isnotnull(c_current_addr_sk#21)) + +(28) BroadcastExchange +Input [2]: [c_customer_sk#20, c_current_addr_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] + +(29) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#20] +Join condition: None + +(30) Project [codegen id : 7] +Output [3]: [ss_item_sk#1, ss_ext_sales_price#5, c_current_addr_sk#21] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_ext_sales_price#5, c_customer_sk#20, c_current_addr_sk#21] + +(31) Scan parquet default.customer_address +Output [2]: [ca_address_sk#23, ca_gmt_offset#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_gmt_offset), EqualTo(ca_gmt_offset,-5.00), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 5] +Input [2]: [ca_address_sk#23, ca_gmt_offset#24] + +(33) Filter [codegen id : 5] +Input [2]: [ca_address_sk#23, ca_gmt_offset#24] +Condition : ((isnotnull(ca_gmt_offset#24) AND (ca_gmt_offset#24 = -5.00)) AND isnotnull(ca_address_sk#23)) + +(34) Project [codegen id : 5] +Output [1]: [ca_address_sk#23] +Input [2]: [ca_address_sk#23, ca_gmt_offset#24] + +(35) BroadcastExchange +Input [1]: [ca_address_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] + +(36) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_addr_sk#21] +Right keys [1]: [ca_address_sk#23] +Join condition: None + +(37) Project [codegen id : 7] +Output [2]: [ss_item_sk#1, ss_ext_sales_price#5] +Input [4]: [ss_item_sk#1, ss_ext_sales_price#5, c_current_addr_sk#21, ca_address_sk#23] + +(38) Scan parquet default.item +Output [2]: [i_item_sk#26, i_category#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Jewelry ), IsNotNull(i_item_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 6] +Input [2]: [i_item_sk#26, i_category#27] + +(40) Filter [codegen id : 6] +Input [2]: [i_item_sk#26, i_category#27] +Condition : ((isnotnull(i_category#27) AND (i_category#27 = Jewelry )) AND isnotnull(i_item_sk#26)) + +(41) Project [codegen id : 6] +Output [1]: [i_item_sk#26] +Input [2]: [i_item_sk#26, i_category#27] + +(42) BroadcastExchange +Input [1]: [i_item_sk#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] + +(43) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#26] +Join condition: None + +(44) Project [codegen id : 7] +Output [1]: [ss_ext_sales_price#5] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#5, i_item_sk#26] + +(45) HashAggregate [codegen id : 7] +Input [1]: [ss_ext_sales_price#5] +Keys: [] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum#29] +Results [1]: [sum#30] + +(46) Exchange +Input [1]: [sum#30] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#31] + +(47) HashAggregate [codegen id : 15] +Input [1]: [sum#30] +Keys: [] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#5))#32] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#32,17,2) AS promotions#33] + +(48) Scan parquet default.store_sales +Output [5]: [ss_item_sk#34, ss_customer_sk#35, ss_store_sk#36, ss_ext_sales_price#37, ss_sold_date_sk#38] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#38), dynamicpruningexpression(ss_sold_date_sk#38 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 13] +Input [5]: [ss_item_sk#34, ss_customer_sk#35, ss_store_sk#36, ss_ext_sales_price#37, ss_sold_date_sk#38] + +(50) Filter [codegen id : 13] +Input [5]: [ss_item_sk#34, ss_customer_sk#35, ss_store_sk#36, ss_ext_sales_price#37, ss_sold_date_sk#38] +Condition : ((isnotnull(ss_store_sk#36) AND isnotnull(ss_customer_sk#35)) AND isnotnull(ss_item_sk#34)) + +(51) ReusedExchange [Reuses operator id: 8] +Output [1]: [s_store_sk#39] + +(52) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_store_sk#36] +Right keys [1]: [s_store_sk#39] +Join condition: None + +(53) Project [codegen id : 13] +Output [4]: [ss_item_sk#34, ss_customer_sk#35, ss_ext_sales_price#37, ss_sold_date_sk#38] +Input [6]: [ss_item_sk#34, ss_customer_sk#35, ss_store_sk#36, ss_ext_sales_price#37, ss_sold_date_sk#38, s_store_sk#39] + +(54) ReusedExchange [Reuses operator id: 22] +Output [1]: [d_date_sk#40] + +(55) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_sold_date_sk#38] +Right keys [1]: [d_date_sk#40] +Join condition: None + +(56) Project [codegen id : 13] +Output [3]: [ss_item_sk#34, ss_customer_sk#35, ss_ext_sales_price#37] +Input [5]: [ss_item_sk#34, ss_customer_sk#35, ss_ext_sales_price#37, ss_sold_date_sk#38, d_date_sk#40] + +(57) ReusedExchange [Reuses operator id: 28] +Output [2]: [c_customer_sk#41, c_current_addr_sk#42] + +(58) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_customer_sk#35] +Right keys [1]: [c_customer_sk#41] +Join condition: None + +(59) Project [codegen id : 13] +Output [3]: [ss_item_sk#34, ss_ext_sales_price#37, c_current_addr_sk#42] +Input [5]: [ss_item_sk#34, ss_customer_sk#35, ss_ext_sales_price#37, c_customer_sk#41, c_current_addr_sk#42] + +(60) ReusedExchange [Reuses operator id: 35] +Output [1]: [ca_address_sk#43] + +(61) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [c_current_addr_sk#42] +Right keys [1]: [ca_address_sk#43] +Join condition: None + +(62) Project [codegen id : 13] +Output [2]: [ss_item_sk#34, ss_ext_sales_price#37] +Input [4]: [ss_item_sk#34, ss_ext_sales_price#37, c_current_addr_sk#42, ca_address_sk#43] + +(63) ReusedExchange [Reuses operator id: 42] +Output [1]: [i_item_sk#44] + +(64) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_item_sk#34] +Right keys [1]: [i_item_sk#44] +Join condition: None + +(65) Project [codegen id : 13] +Output [1]: [ss_ext_sales_price#37] +Input [3]: [ss_item_sk#34, ss_ext_sales_price#37, i_item_sk#44] + +(66) HashAggregate [codegen id : 13] +Input [1]: [ss_ext_sales_price#37] +Keys: [] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#37))] +Aggregate Attributes [1]: [sum#45] +Results [1]: [sum#46] + +(67) Exchange +Input [1]: [sum#46] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#47] + +(68) HashAggregate [codegen id : 14] +Input [1]: [sum#46] +Keys: [] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#37))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#37))#48] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#37))#48,17,2) AS total#49] + +(69) BroadcastExchange +Input [1]: [total#49] +Arguments: IdentityBroadcastMode, [id=#50] + +(70) BroadcastNestedLoopJoin [codegen id : 15] +Join condition: None + +(71) Project [codegen id : 15] +Output [3]: [promotions#33, total#49, CheckOverflow((promote_precision(CheckOverflow((promote_precision(cast(promotions#33 as decimal(15,4))) / promote_precision(cast(total#49 as decimal(15,4)))), DecimalType(35,20), true)) * 100.00000000000000000000), DecimalType(38,19), true) AS ((CAST(promotions AS DECIMAL(15,4)) / CAST(total AS DECIMAL(15,4))) * 100)#51] +Input [2]: [promotions#33, total#49] + +(72) Sort [codegen id : 15] +Input [3]: [promotions#33, total#49, ((CAST(promotions AS DECIMAL(15,4)) / CAST(total AS DECIMAL(15,4))) * 100)#51] +Arguments: [promotions#33 ASC NULLS FIRST, total#49 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (73) + + +(73) ReusedExchange [Reuses operator id: 22] +Output [1]: [d_date_sk#16] + +Subquery:2 Hosting operator id = 48 Hosting Expression = ss_sold_date_sk#38 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61/simplified.txt new file mode 100644 index 0000000000000..5a96e4d5b4196 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q61/simplified.txt @@ -0,0 +1,107 @@ +WholeStageCodegen (15) + Sort [promotions,total] + Project [promotions,total] + BroadcastNestedLoopJoin + HashAggregate [sum] [sum(UnscaledValue(ss_ext_sales_price)),promotions,sum] + InputAdapter + Exchange #1 + WholeStageCodegen (7) + HashAggregate [ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_ext_sales_price,c_current_addr_sk] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_item_sk,ss_customer_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_ext_sales_price,ss_sold_date_sk] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_item_sk,ss_customer_sk,ss_promo_sk,ss_ext_sales_price,ss_sold_date_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Filter [ss_store_sk,ss_promo_sk,ss_customer_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [s_store_sk] + Filter [s_gmt_offset,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_gmt_offset] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [p_promo_sk] + Filter [p_channel_dmail,p_channel_email,p_channel_tv,p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk,p_channel_dmail,p_channel_email,p_channel_tv] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Project [ca_address_sk] + Filter [ca_gmt_offset,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_gmt_offset] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (6) + Project [i_item_sk] + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_category] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (14) + HashAggregate [sum] [sum(UnscaledValue(ss_ext_sales_price)),total,sum] + InputAdapter + Exchange #9 + WholeStageCodegen (13) + HashAggregate [ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_ext_sales_price,c_current_addr_sk] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_item_sk,ss_customer_sk,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_ext_sales_price,ss_sold_date_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Filter [ss_store_sk,ss_customer_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ext_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [s_store_sk] #3 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [c_customer_sk,c_current_addr_sk] #5 + InputAdapter + ReusedExchange [ca_address_sk] #6 + InputAdapter + ReusedExchange [i_item_sk] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q62.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q62.sf100/explain.txt new file mode 100644 index 0000000000000..0c82f6182c240 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q62.sf100/explain.txt @@ -0,0 +1,183 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * HashAggregate (31) + +- Exchange (30) + +- * HashAggregate (29) + +- * Project (28) + +- * BroadcastHashJoin Inner BuildRight (27) + :- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.web_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.web_site (11) + : +- BroadcastExchange (20) + : +- * Filter (19) + : +- * ColumnarToRow (18) + : +- Scan parquet default.ship_mode (17) + +- BroadcastExchange (26) + +- * Filter (25) + +- * ColumnarToRow (24) + +- Scan parquet default.warehouse (23) + + +(1) Scan parquet default.web_sales +Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_ship_mode_sk#3, ws_warehouse_sk#4, ws_sold_date_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_warehouse_sk), IsNotNull(ws_ship_mode_sk), IsNotNull(ws_web_site_sk), IsNotNull(ws_ship_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [5]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_ship_mode_sk#3, ws_warehouse_sk#4, ws_sold_date_sk#5] + +(3) Filter [codegen id : 5] +Input [5]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_ship_mode_sk#3, ws_warehouse_sk#4, ws_sold_date_sk#5] +Condition : (((isnotnull(ws_warehouse_sk#4) AND isnotnull(ws_ship_mode_sk#3)) AND isnotnull(ws_web_site_sk#2)) AND isnotnull(ws_ship_date_sk#1)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_month_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] +Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1200)) AND (d_month_seq#7 <= 1211)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_month_seq#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_ship_date_sk#1] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 5] +Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_ship_mode_sk#3, ws_warehouse_sk#4, ws_sold_date_sk#5] +Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_ship_mode_sk#3, ws_warehouse_sk#4, ws_sold_date_sk#5, d_date_sk#6] + +(11) Scan parquet default.web_site +Output [2]: [web_site_sk#9, web_name#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_site_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [web_site_sk#9, web_name#10] + +(13) Filter [codegen id : 2] +Input [2]: [web_site_sk#9, web_name#10] +Condition : isnotnull(web_site_sk#9) + +(14) BroadcastExchange +Input [2]: [web_site_sk#9, web_name#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_web_site_sk#2] +Right keys [1]: [web_site_sk#9] +Join condition: None + +(16) Project [codegen id : 5] +Output [5]: [ws_ship_date_sk#1, ws_ship_mode_sk#3, ws_warehouse_sk#4, ws_sold_date_sk#5, web_name#10] +Input [7]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_ship_mode_sk#3, ws_warehouse_sk#4, ws_sold_date_sk#5, web_site_sk#9, web_name#10] + +(17) Scan parquet default.ship_mode +Output [2]: [sm_ship_mode_sk#12, sm_type#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/ship_mode] +PushedFilters: [IsNotNull(sm_ship_mode_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [2]: [sm_ship_mode_sk#12, sm_type#13] + +(19) Filter [codegen id : 3] +Input [2]: [sm_ship_mode_sk#12, sm_type#13] +Condition : isnotnull(sm_ship_mode_sk#12) + +(20) BroadcastExchange +Input [2]: [sm_ship_mode_sk#12, sm_type#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(21) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_ship_mode_sk#3] +Right keys [1]: [sm_ship_mode_sk#12] +Join condition: None + +(22) Project [codegen id : 5] +Output [5]: [ws_ship_date_sk#1, ws_warehouse_sk#4, ws_sold_date_sk#5, web_name#10, sm_type#13] +Input [7]: [ws_ship_date_sk#1, ws_ship_mode_sk#3, ws_warehouse_sk#4, ws_sold_date_sk#5, web_name#10, sm_ship_mode_sk#12, sm_type#13] + +(23) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#15, w_warehouse_name#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] + +(25) Filter [codegen id : 4] +Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] +Condition : isnotnull(w_warehouse_sk#15) + +(26) BroadcastExchange +Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(27) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_warehouse_sk#4] +Right keys [1]: [w_warehouse_sk#15] +Join condition: None + +(28) Project [codegen id : 5] +Output [5]: [ws_ship_date_sk#1, ws_sold_date_sk#5, sm_type#13, web_name#10, substr(w_warehouse_name#16, 1, 20) AS _groupingexpression#18] +Input [7]: [ws_ship_date_sk#1, ws_warehouse_sk#4, ws_sold_date_sk#5, web_name#10, sm_type#13, w_warehouse_sk#15, w_warehouse_name#16] + +(29) HashAggregate [codegen id : 5] +Input [5]: [ws_ship_date_sk#1, ws_sold_date_sk#5, sm_type#13, web_name#10, _groupingexpression#18] +Keys [3]: [_groupingexpression#18, sm_type#13, web_name#10] +Functions [5]: [partial_sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 30) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 60) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 90) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum#19, sum#20, sum#21, sum#22, sum#23] +Results [8]: [_groupingexpression#18, sm_type#13, web_name#10, sum#24, sum#25, sum#26, sum#27, sum#28] + +(30) Exchange +Input [8]: [_groupingexpression#18, sm_type#13, web_name#10, sum#24, sum#25, sum#26, sum#27, sum#28] +Arguments: hashpartitioning(_groupingexpression#18, sm_type#13, web_name#10, 5), ENSURE_REQUIREMENTS, [id=#29] + +(31) HashAggregate [codegen id : 6] +Input [8]: [_groupingexpression#18, sm_type#13, web_name#10, sum#24, sum#25, sum#26, sum#27, sum#28] +Keys [3]: [_groupingexpression#18, sm_type#13, web_name#10] +Functions [5]: [sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 30) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END), sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 60) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END), sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 90) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END), sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END)#30, sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 30) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END)#31, sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 60) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END)#32, sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 90) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END)#33, sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)#34] +Results [8]: [_groupingexpression#18 AS substr(w_warehouse_name, 1, 20)#35, sm_type#13, web_name#10, sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END)#30 AS 30 days #36, sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 30) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END)#31 AS 31 - 60 days #37, sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 60) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END)#32 AS 61 - 90 days #38, sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 90) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END)#33 AS 91 - 120 days #39, sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)#34 AS >120 days #40] + +(32) TakeOrderedAndProject +Input [8]: [substr(w_warehouse_name, 1, 20)#35, sm_type#13, web_name#10, 30 days #36, 31 - 60 days #37, 61 - 90 days #38, 91 - 120 days #39, >120 days #40] +Arguments: 100, [substr(w_warehouse_name, 1, 20)#35 ASC NULLS FIRST, sm_type#13 ASC NULLS FIRST, web_name#10 ASC NULLS FIRST], [substr(w_warehouse_name, 1, 20)#35, sm_type#13, web_name#10, 30 days #36, 31 - 60 days #37, 61 - 90 days #38, 91 - 120 days #39, >120 days #40] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q62.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q62.sf100/simplified.txt new file mode 100644 index 0000000000000..5d48a8701abe6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q62.sf100/simplified.txt @@ -0,0 +1,48 @@ +TakeOrderedAndProject [substr(w_warehouse_name, 1, 20),sm_type,web_name,30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ] + WholeStageCodegen (6) + HashAggregate [_groupingexpression,sm_type,web_name,sum,sum,sum,sum,sum] [sum(CASE WHEN ((ws_ship_date_sk - ws_sold_date_sk) <= 30) THEN 1 ELSE 0 END),sum(CASE WHEN (((ws_ship_date_sk - ws_sold_date_sk) > 30) AND ((ws_ship_date_sk - ws_sold_date_sk) <= 60)) THEN 1 ELSE 0 END),sum(CASE WHEN (((ws_ship_date_sk - ws_sold_date_sk) > 60) AND ((ws_ship_date_sk - ws_sold_date_sk) <= 90)) THEN 1 ELSE 0 END),sum(CASE WHEN (((ws_ship_date_sk - ws_sold_date_sk) > 90) AND ((ws_ship_date_sk - ws_sold_date_sk) <= 120)) THEN 1 ELSE 0 END),sum(CASE WHEN ((ws_ship_date_sk - ws_sold_date_sk) > 120) THEN 1 ELSE 0 END),substr(w_warehouse_name, 1, 20),30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ,sum,sum,sum,sum,sum] + InputAdapter + Exchange [_groupingexpression,sm_type,web_name] #1 + WholeStageCodegen (5) + HashAggregate [_groupingexpression,sm_type,web_name,ws_ship_date_sk,ws_sold_date_sk] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [ws_ship_date_sk,ws_sold_date_sk,sm_type,web_name,w_warehouse_name] + BroadcastHashJoin [ws_warehouse_sk,w_warehouse_sk] + Project [ws_ship_date_sk,ws_warehouse_sk,ws_sold_date_sk,web_name,sm_type] + BroadcastHashJoin [ws_ship_mode_sk,sm_ship_mode_sk] + Project [ws_ship_date_sk,ws_ship_mode_sk,ws_warehouse_sk,ws_sold_date_sk,web_name] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_ship_date_sk,ws_web_site_sk,ws_ship_mode_sk,ws_warehouse_sk,ws_sold_date_sk] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + Filter [ws_warehouse_sk,ws_ship_mode_sk,ws_web_site_sk,ws_ship_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_ship_date_sk,ws_web_site_sk,ws_ship_mode_sk,ws_warehouse_sk,ws_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [sm_ship_mode_sk] + ColumnarToRow + InputAdapter + Scan parquet default.ship_mode [sm_ship_mode_sk,sm_type] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q62/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q62/explain.txt new file mode 100644 index 0000000000000..752025ebea0a5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q62/explain.txt @@ -0,0 +1,183 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * HashAggregate (31) + +- Exchange (30) + +- * HashAggregate (29) + +- * Project (28) + +- * BroadcastHashJoin Inner BuildRight (27) + :- * Project (21) + : +- * BroadcastHashJoin Inner BuildRight (20) + : :- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.web_sales (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.warehouse (4) + : : +- BroadcastExchange (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.ship_mode (10) + : +- BroadcastExchange (19) + : +- * Filter (18) + : +- * ColumnarToRow (17) + : +- Scan parquet default.web_site (16) + +- BroadcastExchange (26) + +- * Project (25) + +- * Filter (24) + +- * ColumnarToRow (23) + +- Scan parquet default.date_dim (22) + + +(1) Scan parquet default.web_sales +Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_ship_mode_sk#3, ws_warehouse_sk#4, ws_sold_date_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_warehouse_sk), IsNotNull(ws_ship_mode_sk), IsNotNull(ws_web_site_sk), IsNotNull(ws_ship_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [5]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_ship_mode_sk#3, ws_warehouse_sk#4, ws_sold_date_sk#5] + +(3) Filter [codegen id : 5] +Input [5]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_ship_mode_sk#3, ws_warehouse_sk#4, ws_sold_date_sk#5] +Condition : (((isnotnull(ws_warehouse_sk#4) AND isnotnull(ws_ship_mode_sk#3)) AND isnotnull(ws_web_site_sk#2)) AND isnotnull(ws_ship_date_sk#1)) + +(4) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#6, w_warehouse_name#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [w_warehouse_sk#6, w_warehouse_name#7] + +(6) Filter [codegen id : 1] +Input [2]: [w_warehouse_sk#6, w_warehouse_name#7] +Condition : isnotnull(w_warehouse_sk#6) + +(7) BroadcastExchange +Input [2]: [w_warehouse_sk#6, w_warehouse_name#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] + +(8) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_warehouse_sk#4] +Right keys [1]: [w_warehouse_sk#6] +Join condition: None + +(9) Project [codegen id : 5] +Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_ship_mode_sk#3, ws_sold_date_sk#5, w_warehouse_name#7] +Input [7]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_ship_mode_sk#3, ws_warehouse_sk#4, ws_sold_date_sk#5, w_warehouse_sk#6, w_warehouse_name#7] + +(10) Scan parquet default.ship_mode +Output [2]: [sm_ship_mode_sk#9, sm_type#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/ship_mode] +PushedFilters: [IsNotNull(sm_ship_mode_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [sm_ship_mode_sk#9, sm_type#10] + +(12) Filter [codegen id : 2] +Input [2]: [sm_ship_mode_sk#9, sm_type#10] +Condition : isnotnull(sm_ship_mode_sk#9) + +(13) BroadcastExchange +Input [2]: [sm_ship_mode_sk#9, sm_type#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(14) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_ship_mode_sk#3] +Right keys [1]: [sm_ship_mode_sk#9] +Join condition: None + +(15) Project [codegen id : 5] +Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_sold_date_sk#5, w_warehouse_name#7, sm_type#10] +Input [7]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_ship_mode_sk#3, ws_sold_date_sk#5, w_warehouse_name#7, sm_ship_mode_sk#9, sm_type#10] + +(16) Scan parquet default.web_site +Output [2]: [web_site_sk#12, web_name#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_site_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [2]: [web_site_sk#12, web_name#13] + +(18) Filter [codegen id : 3] +Input [2]: [web_site_sk#12, web_name#13] +Condition : isnotnull(web_site_sk#12) + +(19) BroadcastExchange +Input [2]: [web_site_sk#12, web_name#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(20) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_web_site_sk#2] +Right keys [1]: [web_site_sk#12] +Join condition: None + +(21) Project [codegen id : 5] +Output [5]: [ws_ship_date_sk#1, ws_sold_date_sk#5, w_warehouse_name#7, sm_type#10, web_name#13] +Input [7]: [ws_ship_date_sk#1, ws_web_site_sk#2, ws_sold_date_sk#5, w_warehouse_name#7, sm_type#10, web_site_sk#12, web_name#13] + +(22) Scan parquet default.date_dim +Output [2]: [d_date_sk#15, d_month_seq#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#15, d_month_seq#16] + +(24) Filter [codegen id : 4] +Input [2]: [d_date_sk#15, d_month_seq#16] +Condition : (((isnotnull(d_month_seq#16) AND (d_month_seq#16 >= 1200)) AND (d_month_seq#16 <= 1211)) AND isnotnull(d_date_sk#15)) + +(25) Project [codegen id : 4] +Output [1]: [d_date_sk#15] +Input [2]: [d_date_sk#15, d_month_seq#16] + +(26) BroadcastExchange +Input [1]: [d_date_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(27) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_ship_date_sk#1] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(28) Project [codegen id : 5] +Output [5]: [ws_ship_date_sk#1, ws_sold_date_sk#5, sm_type#10, web_name#13, substr(w_warehouse_name#7, 1, 20) AS _groupingexpression#18] +Input [6]: [ws_ship_date_sk#1, ws_sold_date_sk#5, w_warehouse_name#7, sm_type#10, web_name#13, d_date_sk#15] + +(29) HashAggregate [codegen id : 5] +Input [5]: [ws_ship_date_sk#1, ws_sold_date_sk#5, sm_type#10, web_name#13, _groupingexpression#18] +Keys [3]: [_groupingexpression#18, sm_type#10, web_name#13] +Functions [5]: [partial_sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 30) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 60) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 90) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum#19, sum#20, sum#21, sum#22, sum#23] +Results [8]: [_groupingexpression#18, sm_type#10, web_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] + +(30) Exchange +Input [8]: [_groupingexpression#18, sm_type#10, web_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] +Arguments: hashpartitioning(_groupingexpression#18, sm_type#10, web_name#13, 5), ENSURE_REQUIREMENTS, [id=#29] + +(31) HashAggregate [codegen id : 6] +Input [8]: [_groupingexpression#18, sm_type#10, web_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] +Keys [3]: [_groupingexpression#18, sm_type#10, web_name#13] +Functions [5]: [sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 30) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END), sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 60) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END), sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 90) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END), sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END)#30, sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 30) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END)#31, sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 60) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END)#32, sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 90) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END)#33, sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)#34] +Results [8]: [_groupingexpression#18 AS substr(w_warehouse_name, 1, 20)#35, sm_type#10, web_name#13, sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END)#30 AS 30 days #36, sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 30) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END)#31 AS 31 - 60 days #37, sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 60) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END)#32 AS 61 - 90 days #38, sum(CASE WHEN (((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 90) AND ((ws_ship_date_sk#1 - ws_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END)#33 AS 91 - 120 days #39, sum(CASE WHEN ((ws_ship_date_sk#1 - ws_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)#34 AS >120 days #40] + +(32) TakeOrderedAndProject +Input [8]: [substr(w_warehouse_name, 1, 20)#35, sm_type#10, web_name#13, 30 days #36, 31 - 60 days #37, 61 - 90 days #38, 91 - 120 days #39, >120 days #40] +Arguments: 100, [substr(w_warehouse_name, 1, 20)#35 ASC NULLS FIRST, sm_type#10 ASC NULLS FIRST, web_name#13 ASC NULLS FIRST], [substr(w_warehouse_name, 1, 20)#35, sm_type#10, web_name#13, 30 days #36, 31 - 60 days #37, 61 - 90 days #38, 91 - 120 days #39, >120 days #40] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q62/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q62/simplified.txt new file mode 100644 index 0000000000000..7b67c51892d9a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q62/simplified.txt @@ -0,0 +1,48 @@ +TakeOrderedAndProject [substr(w_warehouse_name, 1, 20),sm_type,web_name,30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ] + WholeStageCodegen (6) + HashAggregate [_groupingexpression,sm_type,web_name,sum,sum,sum,sum,sum] [sum(CASE WHEN ((ws_ship_date_sk - ws_sold_date_sk) <= 30) THEN 1 ELSE 0 END),sum(CASE WHEN (((ws_ship_date_sk - ws_sold_date_sk) > 30) AND ((ws_ship_date_sk - ws_sold_date_sk) <= 60)) THEN 1 ELSE 0 END),sum(CASE WHEN (((ws_ship_date_sk - ws_sold_date_sk) > 60) AND ((ws_ship_date_sk - ws_sold_date_sk) <= 90)) THEN 1 ELSE 0 END),sum(CASE WHEN (((ws_ship_date_sk - ws_sold_date_sk) > 90) AND ((ws_ship_date_sk - ws_sold_date_sk) <= 120)) THEN 1 ELSE 0 END),sum(CASE WHEN ((ws_ship_date_sk - ws_sold_date_sk) > 120) THEN 1 ELSE 0 END),substr(w_warehouse_name, 1, 20),30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ,sum,sum,sum,sum,sum] + InputAdapter + Exchange [_groupingexpression,sm_type,web_name] #1 + WholeStageCodegen (5) + HashAggregate [_groupingexpression,sm_type,web_name,ws_ship_date_sk,ws_sold_date_sk] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [ws_ship_date_sk,ws_sold_date_sk,sm_type,web_name,w_warehouse_name] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + Project [ws_ship_date_sk,ws_sold_date_sk,w_warehouse_name,sm_type,web_name] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_ship_date_sk,ws_web_site_sk,ws_sold_date_sk,w_warehouse_name,sm_type] + BroadcastHashJoin [ws_ship_mode_sk,sm_ship_mode_sk] + Project [ws_ship_date_sk,ws_web_site_sk,ws_ship_mode_sk,ws_sold_date_sk,w_warehouse_name] + BroadcastHashJoin [ws_warehouse_sk,w_warehouse_sk] + Filter [ws_warehouse_sk,ws_ship_mode_sk,ws_web_site_sk,ws_ship_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_ship_date_sk,ws_web_site_sk,ws_ship_mode_sk,ws_warehouse_sk,ws_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [sm_ship_mode_sk] + ColumnarToRow + InputAdapter + Scan parquet default.ship_mode [sm_ship_mode_sk,sm_type] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_name] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/explain.txt new file mode 100644 index 0000000000000..2b8dbaddacad8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * Project (31) + +- * Filter (30) + +- Window (29) + +- * Sort (28) + +- Exchange (27) + +- * HashAggregate (26) + +- Exchange (25) + +- * HashAggregate (24) + +- * Project (23) + +- * BroadcastHashJoin Inner BuildRight (22) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.store_sales (6) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.store (11) + +- BroadcastExchange (21) + +- * Project (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.date_dim (17) + + +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books ,Children ,Electronics ]),In(i_class, [personal ,portable ,refernece ,self-help ])),In(i_brand, [scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 ])),And(And(In(i_category, [Women ,Music ,Men ]),In(i_class, [accessories ,classical ,fragrances ,pants ])),In(i_brand, [amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] + +(3) Filter [codegen id : 1] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +Condition : ((((i_category#4 IN (Books ,Children ,Electronics ) AND i_class#3 IN (personal ,portable ,refernece ,self-help )) AND i_brand#2 IN (scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 )) OR ((i_category#4 IN (Women ,Music ,Men ) AND i_class#3 IN (accessories ,classical ,fragrances ,pants )) AND i_brand#2 IN (amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ))) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [2]: [i_item_sk#1, i_manager_id#5] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] + +(5) BroadcastExchange +Input [2]: [i_item_sk#1, i_manager_id#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(6) Scan parquet default.store_sales +Output [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#14), dynamicpruningexpression(ss_sold_date_sk#14 IN dynamicpruning#15)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] + +(8) Filter +Input [4]: [ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] +Condition : (isnotnull(ss_item_sk#11) AND isnotnull(ss_store_sk#12)) + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#11] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [i_manager_id#5, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] +Input [6]: [i_item_sk#1, i_manager_id#5, ss_item_sk#11, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14] + +(11) Scan parquet default.store +Output [1]: [s_store_sk#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [1]: [s_store_sk#16] + +(13) Filter [codegen id : 2] +Input [1]: [s_store_sk#16] +Condition : isnotnull(s_store_sk#16) + +(14) BroadcastExchange +Input [1]: [s_store_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#12] +Right keys [1]: [s_store_sk#16] +Join condition: None + +(16) Project [codegen id : 4] +Output [3]: [i_manager_id#5, ss_sales_price#13, ss_sold_date_sk#14] +Input [5]: [i_manager_id#5, ss_store_sk#12, ss_sales_price#13, ss_sold_date_sk#14, s_store_sk#16] + +(17) Scan parquet default.date_dim +Output [3]: [d_date_sk#18, d_month_seq#19, d_moy#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_month_seq, [1200,1211,1205,1201,1206,1210,1207,1202,1209,1203,1208,1204]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#18, d_month_seq#19, d_moy#20] + +(19) Filter [codegen id : 3] +Input [3]: [d_date_sk#18, d_month_seq#19, d_moy#20] +Condition : (d_month_seq#19 INSET (1200,1211,1205,1201,1206,1210,1207,1202,1209,1203,1208,1204) AND isnotnull(d_date_sk#18)) + +(20) Project [codegen id : 3] +Output [2]: [d_date_sk#18, d_moy#20] +Input [3]: [d_date_sk#18, d_month_seq#19, d_moy#20] + +(21) BroadcastExchange +Input [2]: [d_date_sk#18, d_moy#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#14] +Right keys [1]: [d_date_sk#18] +Join condition: None + +(23) Project [codegen id : 4] +Output [3]: [i_manager_id#5, ss_sales_price#13, d_moy#20] +Input [5]: [i_manager_id#5, ss_sales_price#13, ss_sold_date_sk#14, d_date_sk#18, d_moy#20] + +(24) HashAggregate [codegen id : 4] +Input [3]: [i_manager_id#5, ss_sales_price#13, d_moy#20] +Keys [2]: [i_manager_id#5, d_moy#20] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#13))] +Aggregate Attributes [1]: [sum#22] +Results [3]: [i_manager_id#5, d_moy#20, sum#23] + +(25) Exchange +Input [3]: [i_manager_id#5, d_moy#20, sum#23] +Arguments: hashpartitioning(i_manager_id#5, d_moy#20, 5), ENSURE_REQUIREMENTS, [id=#24] + +(26) HashAggregate [codegen id : 5] +Input [3]: [i_manager_id#5, d_moy#20, sum#23] +Keys [2]: [i_manager_id#5, d_moy#20] +Functions [1]: [sum(UnscaledValue(ss_sales_price#13))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#13))#25] +Results [3]: [i_manager_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#25,17,2) AS sum_sales#26, MakeDecimal(sum(UnscaledValue(ss_sales_price#13))#25,17,2) AS _w0#27] + +(27) Exchange +Input [3]: [i_manager_id#5, sum_sales#26, _w0#27] +Arguments: hashpartitioning(i_manager_id#5, 5), ENSURE_REQUIREMENTS, [id=#28] + +(28) Sort [codegen id : 6] +Input [3]: [i_manager_id#5, sum_sales#26, _w0#27] +Arguments: [i_manager_id#5 ASC NULLS FIRST], false, 0 + +(29) Window +Input [3]: [i_manager_id#5, sum_sales#26, _w0#27] +Arguments: [avg(_w0#27) windowspecdefinition(i_manager_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#29], [i_manager_id#5] + +(30) Filter [codegen id : 7] +Input [4]: [i_manager_id#5, sum_sales#26, _w0#27, avg_monthly_sales#29] +Condition : (isnotnull(avg_monthly_sales#29) AND ((avg_monthly_sales#29 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#26 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#29 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#29 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000))) + +(31) Project [codegen id : 7] +Output [3]: [i_manager_id#5, sum_sales#26, avg_monthly_sales#29] +Input [4]: [i_manager_id#5, sum_sales#26, _w0#27, avg_monthly_sales#29] + +(32) TakeOrderedAndProject +Input [3]: [i_manager_id#5, sum_sales#26, avg_monthly_sales#29] +Arguments: 100, [i_manager_id#5 ASC NULLS FIRST, avg_monthly_sales#29 ASC NULLS FIRST, sum_sales#26 ASC NULLS FIRST], [i_manager_id#5, sum_sales#26, avg_monthly_sales#29] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#14 IN dynamicpruning#15 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 21] +Output [2]: [d_date_sk#18, d_moy#20] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/simplified.txt new file mode 100644 index 0000000000000..d8e6d0dcef768 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63.sf100/simplified.txt @@ -0,0 +1,51 @@ +TakeOrderedAndProject [i_manager_id,avg_monthly_sales,sum_sales] + WholeStageCodegen (7) + Project [i_manager_id,sum_sales,avg_monthly_sales] + Filter [avg_monthly_sales,sum_sales] + InputAdapter + Window [_w0,i_manager_id] + WholeStageCodegen (6) + Sort [i_manager_id] + InputAdapter + Exchange [i_manager_id] #1 + WholeStageCodegen (5) + HashAggregate [i_manager_id,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_manager_id,d_moy] #2 + WholeStageCodegen (4) + HashAggregate [i_manager_id,d_moy,ss_sales_price] [sum,sum] + Project [i_manager_id,ss_sales_price,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_manager_id,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_manager_id,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_manager_id] + Filter [i_category,i_class,i_brand,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manager_id] + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_moy] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [d_date_sk,d_moy] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq,d_moy] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63/explain.txt new file mode 100644 index 0000000000000..efb27d8cd8b11 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * Project (31) + +- * Filter (30) + +- Window (29) + +- * Sort (28) + +- Exchange (27) + +- * HashAggregate (26) + +- Exchange (25) + +- * HashAggregate (24) + +- * Project (23) + +- * BroadcastHashJoin Inner BuildRight (22) + :- * Project (17) + : +- * BroadcastHashJoin Inner BuildRight (16) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- BroadcastExchange (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.store_sales (5) + : +- BroadcastExchange (15) + : +- * Project (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.date_dim (11) + +- BroadcastExchange (21) + +- * Filter (20) + +- * ColumnarToRow (19) + +- Scan parquet default.store (18) + + +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(And(In(i_category, [Books ,Children ,Electronics ]),In(i_class, [personal ,portable ,refernece ,self-help ])),In(i_brand, [scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 ])),And(And(In(i_category, [Women ,Music ,Men ]),In(i_class, [accessories ,classical ,fragrances ,pants ])),In(i_brand, [amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] + +(3) Filter [codegen id : 4] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] +Condition : ((((i_category#4 IN (Books ,Children ,Electronics ) AND i_class#3 IN (personal ,portable ,refernece ,self-help )) AND i_brand#2 IN (scholaramalgamalg #6 ,scholaramalgamalg #7 ,exportiunivamalg #8 ,scholaramalgamalg #8 )) OR ((i_category#4 IN (Women ,Music ,Men ) AND i_class#3 IN (accessories ,classical ,fragrances ,pants )) AND i_brand#2 IN (amalgimporto #9 ,edu packscholar #9 ,exportiimporto #9 ,importoamalg #9 ))) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 4] +Output [2]: [i_item_sk#1, i_manager_id#5] +Input [5]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, i_manager_id#5] + +(5) Scan parquet default.store_sales +Output [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#13), dynamicpruningexpression(ss_sold_date_sk#13 IN dynamicpruning#14)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] + +(7) Filter [codegen id : 1] +Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Condition : (isnotnull(ss_item_sk#10) AND isnotnull(ss_store_sk#11)) + +(8) BroadcastExchange +Input [4]: [ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#10] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] +Input [6]: [i_item_sk#1, i_manager_id#5, ss_item_sk#10, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13] + +(11) Scan parquet default.date_dim +Output [3]: [d_date_sk#16, d_month_seq#17, d_moy#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [In(d_month_seq, [1200,1211,1205,1201,1206,1210,1207,1202,1209,1203,1208,1204]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#16, d_month_seq#17, d_moy#18] + +(13) Filter [codegen id : 2] +Input [3]: [d_date_sk#16, d_month_seq#17, d_moy#18] +Condition : (d_month_seq#17 INSET (1200,1211,1205,1201,1206,1210,1207,1202,1209,1203,1208,1204) AND isnotnull(d_date_sk#16)) + +(14) Project [codegen id : 2] +Output [2]: [d_date_sk#16, d_moy#18] +Input [3]: [d_date_sk#16, d_month_seq#17, d_moy#18] + +(15) BroadcastExchange +Input [2]: [d_date_sk#16, d_moy#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#13] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(17) Project [codegen id : 4] +Output [4]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, d_moy#18] +Input [6]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, ss_sold_date_sk#13, d_date_sk#16, d_moy#18] + +(18) Scan parquet default.store +Output [1]: [s_store_sk#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [1]: [s_store_sk#20] + +(20) Filter [codegen id : 3] +Input [1]: [s_store_sk#20] +Condition : isnotnull(s_store_sk#20) + +(21) BroadcastExchange +Input [1]: [s_store_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#11] +Right keys [1]: [s_store_sk#20] +Join condition: None + +(23) Project [codegen id : 4] +Output [3]: [i_manager_id#5, ss_sales_price#12, d_moy#18] +Input [5]: [i_manager_id#5, ss_store_sk#11, ss_sales_price#12, d_moy#18, s_store_sk#20] + +(24) HashAggregate [codegen id : 4] +Input [3]: [i_manager_id#5, ss_sales_price#12, d_moy#18] +Keys [2]: [i_manager_id#5, d_moy#18] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#12))] +Aggregate Attributes [1]: [sum#22] +Results [3]: [i_manager_id#5, d_moy#18, sum#23] + +(25) Exchange +Input [3]: [i_manager_id#5, d_moy#18, sum#23] +Arguments: hashpartitioning(i_manager_id#5, d_moy#18, 5), ENSURE_REQUIREMENTS, [id=#24] + +(26) HashAggregate [codegen id : 5] +Input [3]: [i_manager_id#5, d_moy#18, sum#23] +Keys [2]: [i_manager_id#5, d_moy#18] +Functions [1]: [sum(UnscaledValue(ss_sales_price#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#12))#25] +Results [3]: [i_manager_id#5, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#25,17,2) AS sum_sales#26, MakeDecimal(sum(UnscaledValue(ss_sales_price#12))#25,17,2) AS _w0#27] + +(27) Exchange +Input [3]: [i_manager_id#5, sum_sales#26, _w0#27] +Arguments: hashpartitioning(i_manager_id#5, 5), ENSURE_REQUIREMENTS, [id=#28] + +(28) Sort [codegen id : 6] +Input [3]: [i_manager_id#5, sum_sales#26, _w0#27] +Arguments: [i_manager_id#5 ASC NULLS FIRST], false, 0 + +(29) Window +Input [3]: [i_manager_id#5, sum_sales#26, _w0#27] +Arguments: [avg(_w0#27) windowspecdefinition(i_manager_id#5, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#29], [i_manager_id#5] + +(30) Filter [codegen id : 7] +Input [4]: [i_manager_id#5, sum_sales#26, _w0#27, avg_monthly_sales#29] +Condition : (isnotnull(avg_monthly_sales#29) AND ((avg_monthly_sales#29 > 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#26 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#29 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#29 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000))) + +(31) Project [codegen id : 7] +Output [3]: [i_manager_id#5, sum_sales#26, avg_monthly_sales#29] +Input [4]: [i_manager_id#5, sum_sales#26, _w0#27, avg_monthly_sales#29] + +(32) TakeOrderedAndProject +Input [3]: [i_manager_id#5, sum_sales#26, avg_monthly_sales#29] +Arguments: 100, [i_manager_id#5 ASC NULLS FIRST, avg_monthly_sales#29 ASC NULLS FIRST, sum_sales#26 ASC NULLS FIRST], [i_manager_id#5, sum_sales#26, avg_monthly_sales#29] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 5 Hosting Expression = ss_sold_date_sk#13 IN dynamicpruning#14 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 15] +Output [2]: [d_date_sk#16, d_moy#18] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63/simplified.txt new file mode 100644 index 0000000000000..4d85c6d1f57a3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q63/simplified.txt @@ -0,0 +1,51 @@ +TakeOrderedAndProject [i_manager_id,avg_monthly_sales,sum_sales] + WholeStageCodegen (7) + Project [i_manager_id,sum_sales,avg_monthly_sales] + Filter [avg_monthly_sales,sum_sales] + InputAdapter + Window [_w0,i_manager_id] + WholeStageCodegen (6) + Sort [i_manager_id] + InputAdapter + Exchange [i_manager_id] #1 + WholeStageCodegen (5) + HashAggregate [i_manager_id,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_manager_id,d_moy] #2 + WholeStageCodegen (4) + HashAggregate [i_manager_id,d_moy,ss_sales_price] [sum,sum] + Project [i_manager_id,ss_sales_price,d_moy] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_manager_id,ss_store_sk,ss_sales_price,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_manager_id,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + Project [i_item_sk,i_manager_id] + Filter [i_category,i_class,i_brand,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_manager_id] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_moy] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk,d_moy] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq,d_moy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64.sf100/explain.txt new file mode 100644 index 0000000000000..d8b825209f8bd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64.sf100/explain.txt @@ -0,0 +1,1162 @@ +== Physical Plan == +* Sort (215) ++- Exchange (214) + +- * Project (213) + +- * SortMergeJoin Inner (212) + :- * Sort (131) + : +- Exchange (130) + : +- * HashAggregate (129) + : +- Exchange (128) + : +- * HashAggregate (127) + : +- * Project (126) + : +- * BroadcastHashJoin Inner BuildRight (125) + : :- * Project (119) + : : +- * BroadcastHashJoin Inner BuildRight (118) + : : :- * Project (116) + : : : +- * BroadcastHashJoin Inner BuildRight (115) + : : : :- * Project (110) + : : : : +- * SortMergeJoin Inner (109) + : : : : :- * Sort (106) + : : : : : +- Exchange (105) + : : : : : +- * Project (104) + : : : : : +- * SortMergeJoin Inner (103) + : : : : : :- * Sort (97) + : : : : : : +- Exchange (96) + : : : : : : +- * Project (95) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (94) + : : : : : : :- * Project (92) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (91) + : : : : : : : :- * Project (86) + : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (85) + : : : : : : : : :- * Project (80) + : : : : : : : : : +- * SortMergeJoin Inner (79) + : : : : : : : : : :- * Sort (76) + : : : : : : : : : : +- Exchange (75) + : : : : : : : : : : +- * Project (74) + : : : : : : : : : : +- * SortMergeJoin Inner (73) + : : : : : : : : : : :- * Sort (67) + : : : : : : : : : : : +- Exchange (66) + : : : : : : : : : : : +- * Project (65) + : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (64) + : : : : : : : : : : : :- * Project (62) + : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (61) + : : : : : : : : : : : : :- * Project (56) + : : : : : : : : : : : : : +- * SortMergeJoin Inner (55) + : : : : : : : : : : : : : :- * Sort (49) + : : : : : : : : : : : : : : +- Exchange (48) + : : : : : : : : : : : : : : +- * Project (47) + : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (46) + : : : : : : : : : : : : : : :- * Project (41) + : : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (40) + : : : : : : : : : : : : : : : :- * Project (35) + : : : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (34) + : : : : : : : : : : : : : : : : :- * Project (13) + : : : : : : : : : : : : : : : : : +- * SortMergeJoin Inner (12) + : : : : : : : : : : : : : : : : : :- * Sort (5) + : : : : : : : : : : : : : : : : : : +- Exchange (4) + : : : : : : : : : : : : : : : : : : +- * Filter (3) + : : : : : : : : : : : : : : : : : : +- * ColumnarToRow (2) + : : : : : : : : : : : : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : : : : : : : : : : : : +- * Sort (11) + : : : : : : : : : : : : : : : : : +- Exchange (10) + : : : : : : : : : : : : : : : : : +- * Project (9) + : : : : : : : : : : : : : : : : : +- * Filter (8) + : : : : : : : : : : : : : : : : : +- * ColumnarToRow (7) + : : : : : : : : : : : : : : : : : +- Scan parquet default.store_returns (6) + : : : : : : : : : : : : : : : : +- BroadcastExchange (33) + : : : : : : : : : : : : : : : : +- * Project (32) + : : : : : : : : : : : : : : : : +- * Filter (31) + : : : : : : : : : : : : : : : : +- * HashAggregate (30) + : : : : : : : : : : : : : : : : +- Exchange (29) + : : : : : : : : : : : : : : : : +- * HashAggregate (28) + : : : : : : : : : : : : : : : : +- * Project (27) + : : : : : : : : : : : : : : : : +- * SortMergeJoin Inner (26) + : : : : : : : : : : : : : : : : :- * Sort (19) + : : : : : : : : : : : : : : : : : +- Exchange (18) + : : : : : : : : : : : : : : : : : +- * Project (17) + : : : : : : : : : : : : : : : : : +- * Filter (16) + : : : : : : : : : : : : : : : : : +- * ColumnarToRow (15) + : : : : : : : : : : : : : : : : : +- Scan parquet default.catalog_sales (14) + : : : : : : : : : : : : : : : : +- * Sort (25) + : : : : : : : : : : : : : : : : +- Exchange (24) + : : : : : : : : : : : : : : : : +- * Project (23) + : : : : : : : : : : : : : : : : +- * Filter (22) + : : : : : : : : : : : : : : : : +- * ColumnarToRow (21) + : : : : : : : : : : : : : : : : +- Scan parquet default.catalog_returns (20) + : : : : : : : : : : : : : : : +- BroadcastExchange (39) + : : : : : : : : : : : : : : : +- * Filter (38) + : : : : : : : : : : : : : : : +- * ColumnarToRow (37) + : : : : : : : : : : : : : : : +- Scan parquet default.date_dim (36) + : : : : : : : : : : : : : : +- BroadcastExchange (45) + : : : : : : : : : : : : : : +- * Filter (44) + : : : : : : : : : : : : : : +- * ColumnarToRow (43) + : : : : : : : : : : : : : : +- Scan parquet default.store (42) + : : : : : : : : : : : : : +- * Sort (54) + : : : : : : : : : : : : : +- Exchange (53) + : : : : : : : : : : : : : +- * Filter (52) + : : : : : : : : : : : : : +- * ColumnarToRow (51) + : : : : : : : : : : : : : +- Scan parquet default.customer (50) + : : : : : : : : : : : : +- BroadcastExchange (60) + : : : : : : : : : : : : +- * Filter (59) + : : : : : : : : : : : : +- * ColumnarToRow (58) + : : : : : : : : : : : : +- Scan parquet default.date_dim (57) + : : : : : : : : : : : +- ReusedExchange (63) + : : : : : : : : : : +- * Sort (72) + : : : : : : : : : : +- Exchange (71) + : : : : : : : : : : +- * Filter (70) + : : : : : : : : : : +- * ColumnarToRow (69) + : : : : : : : : : : +- Scan parquet default.customer_demographics (68) + : : : : : : : : : +- * Sort (78) + : : : : : : : : : +- ReusedExchange (77) + : : : : : : : : +- BroadcastExchange (84) + : : : : : : : : +- * Filter (83) + : : : : : : : : +- * ColumnarToRow (82) + : : : : : : : : +- Scan parquet default.promotion (81) + : : : : : : : +- BroadcastExchange (90) + : : : : : : : +- * Filter (89) + : : : : : : : +- * ColumnarToRow (88) + : : : : : : : +- Scan parquet default.household_demographics (87) + : : : : : : +- ReusedExchange (93) + : : : : : +- * Sort (102) + : : : : : +- Exchange (101) + : : : : : +- * Filter (100) + : : : : : +- * ColumnarToRow (99) + : : : : : +- Scan parquet default.customer_address (98) + : : : : +- * Sort (108) + : : : : +- ReusedExchange (107) + : : : +- BroadcastExchange (114) + : : : +- * Filter (113) + : : : +- * ColumnarToRow (112) + : : : +- Scan parquet default.income_band (111) + : : +- ReusedExchange (117) + : +- BroadcastExchange (124) + : +- * Project (123) + : +- * Filter (122) + : +- * ColumnarToRow (121) + : +- Scan parquet default.item (120) + +- * Sort (211) + +- Exchange (210) + +- * HashAggregate (209) + +- Exchange (208) + +- * HashAggregate (207) + +- * Project (206) + +- * BroadcastHashJoin Inner BuildRight (205) + :- * Project (203) + : +- * BroadcastHashJoin Inner BuildRight (202) + : :- * Project (200) + : : +- * BroadcastHashJoin Inner BuildRight (199) + : : :- * Project (197) + : : : +- * SortMergeJoin Inner (196) + : : : :- * Sort (193) + : : : : +- Exchange (192) + : : : : +- * Project (191) + : : : : +- * SortMergeJoin Inner (190) + : : : : :- * Sort (187) + : : : : : +- Exchange (186) + : : : : : +- * Project (185) + : : : : : +- * BroadcastHashJoin Inner BuildRight (184) + : : : : : :- * Project (182) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (181) + : : : : : : :- * Project (179) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (178) + : : : : : : : :- * Project (176) + : : : : : : : : +- * SortMergeJoin Inner (175) + : : : : : : : : :- * Sort (172) + : : : : : : : : : +- Exchange (171) + : : : : : : : : : +- * Project (170) + : : : : : : : : : +- * SortMergeJoin Inner (169) + : : : : : : : : : :- * Sort (166) + : : : : : : : : : : +- Exchange (165) + : : : : : : : : : : +- * Project (164) + : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (163) + : : : : : : : : : : :- * Project (161) + : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (160) + : : : : : : : : : : : :- * Project (158) + : : : : : : : : : : : : +- * SortMergeJoin Inner (157) + : : : : : : : : : : : : :- * Sort (154) + : : : : : : : : : : : : : +- Exchange (153) + : : : : : : : : : : : : : +- * Project (152) + : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (151) + : : : : : : : : : : : : : :- * Project (149) + : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (148) + : : : : : : : : : : : : : : :- * Project (143) + : : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (142) + : : : : : : : : : : : : : : : :- * Project (140) + : : : : : : : : : : : : : : : : +- * SortMergeJoin Inner (139) + : : : : : : : : : : : : : : : : :- * Sort (136) + : : : : : : : : : : : : : : : : : +- Exchange (135) + : : : : : : : : : : : : : : : : : +- * Filter (134) + : : : : : : : : : : : : : : : : : +- * ColumnarToRow (133) + : : : : : : : : : : : : : : : : : +- Scan parquet default.store_sales (132) + : : : : : : : : : : : : : : : : +- * Sort (138) + : : : : : : : : : : : : : : : : +- ReusedExchange (137) + : : : : : : : : : : : : : : : +- ReusedExchange (141) + : : : : : : : : : : : : : : +- BroadcastExchange (147) + : : : : : : : : : : : : : : +- * Filter (146) + : : : : : : : : : : : : : : +- * ColumnarToRow (145) + : : : : : : : : : : : : : : +- Scan parquet default.date_dim (144) + : : : : : : : : : : : : : +- ReusedExchange (150) + : : : : : : : : : : : : +- * Sort (156) + : : : : : : : : : : : : +- ReusedExchange (155) + : : : : : : : : : : : +- ReusedExchange (159) + : : : : : : : : : : +- ReusedExchange (162) + : : : : : : : : : +- * Sort (168) + : : : : : : : : : +- ReusedExchange (167) + : : : : : : : : +- * Sort (174) + : : : : : : : : +- ReusedExchange (173) + : : : : : : : +- ReusedExchange (177) + : : : : : : +- ReusedExchange (180) + : : : : : +- ReusedExchange (183) + : : : : +- * Sort (189) + : : : : +- ReusedExchange (188) + : : : +- * Sort (195) + : : : +- ReusedExchange (194) + : : +- ReusedExchange (198) + : +- ReusedExchange (201) + +- ReusedExchange (204) + + +(1) Scan parquet default.store_sales +Output [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#12), dynamicpruningexpression(ss_sold_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_promo_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] + +(3) Filter [codegen id : 1] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Condition : (((((((isnotnull(ss_item_sk#1) AND isnotnull(ss_ticket_number#8)) AND isnotnull(ss_store_sk#6)) AND isnotnull(ss_customer_sk#2)) AND isnotnull(ss_cdemo_sk#3)) AND isnotnull(ss_promo_sk#7)) AND isnotnull(ss_hdemo_sk#4)) AND isnotnull(ss_addr_sk#5)) + +(4) Exchange +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#8, 5), ENSURE_REQUIREMENTS, [id=#14] + +(5) Sort [codegen id : 2] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#8 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_returns +Output [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] + +(8) Filter [codegen id : 3] +Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] +Condition : (isnotnull(sr_item_sk#15) AND isnotnull(sr_ticket_number#16)) + +(9) Project [codegen id : 3] +Output [2]: [sr_item_sk#15, sr_ticket_number#16] +Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] + +(10) Exchange +Input [2]: [sr_item_sk#15, sr_ticket_number#16] +Arguments: hashpartitioning(sr_item_sk#15, sr_ticket_number#16, 5), ENSURE_REQUIREMENTS, [id=#18] + +(11) Sort [codegen id : 4] +Input [2]: [sr_item_sk#15, sr_ticket_number#16] +Arguments: [sr_item_sk#15 ASC NULLS FIRST, sr_ticket_number#16 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 13] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#8] +Right keys [2]: [sr_item_sk#15, sr_ticket_number#16] +Join condition: None + +(13) Project [codegen id : 13] +Output [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12, sr_item_sk#15, sr_ticket_number#16] + +(14) Scan parquet default.catalog_sales +Output [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_order_number)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 5] +Input [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] + +(16) Filter [codegen id : 5] +Input [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] +Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_order_number#20)) + +(17) Project [codegen id : 5] +Output [3]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21] +Input [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] + +(18) Exchange +Input [3]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21] +Arguments: hashpartitioning(cs_item_sk#19, cs_order_number#20, 5), ENSURE_REQUIREMENTS, [id=#23] + +(19) Sort [codegen id : 6] +Input [3]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21] +Arguments: [cs_item_sk#19 ASC NULLS FIRST, cs_order_number#20 ASC NULLS FIRST], false, 0 + +(20) Scan parquet default.catalog_returns +Output [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_order_number)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 7] +Input [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] + +(22) Filter [codegen id : 7] +Input [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] +Condition : (isnotnull(cr_item_sk#24) AND isnotnull(cr_order_number#25)) + +(23) Project [codegen id : 7] +Output [5]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Input [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] + +(24) Exchange +Input [5]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Arguments: hashpartitioning(cr_item_sk#24, cr_order_number#25, 5), ENSURE_REQUIREMENTS, [id=#30] + +(25) Sort [codegen id : 8] +Input [5]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Arguments: [cr_item_sk#24 ASC NULLS FIRST, cr_order_number#25 ASC NULLS FIRST], false, 0 + +(26) SortMergeJoin [codegen id : 9] +Left keys [2]: [cs_item_sk#19, cs_order_number#20] +Right keys [2]: [cr_item_sk#24, cr_order_number#25] +Join condition: None + +(27) Project [codegen id : 9] +Output [5]: [cs_item_sk#19, cs_ext_list_price#21, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Input [8]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] + +(28) HashAggregate [codegen id : 9] +Input [5]: [cs_item_sk#19, cs_ext_list_price#21, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Keys [1]: [cs_item_sk#19] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_list_price#21)), partial_sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))] +Aggregate Attributes [3]: [sum#31, sum#32, isEmpty#33] +Results [4]: [cs_item_sk#19, sum#34, sum#35, isEmpty#36] + +(29) Exchange +Input [4]: [cs_item_sk#19, sum#34, sum#35, isEmpty#36] +Arguments: hashpartitioning(cs_item_sk#19, 5), ENSURE_REQUIREMENTS, [id=#37] + +(30) HashAggregate [codegen id : 10] +Input [4]: [cs_item_sk#19, sum#34, sum#35, isEmpty#36] +Keys [1]: [cs_item_sk#19] +Functions [2]: [sum(UnscaledValue(cs_ext_list_price#21)), sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_list_price#21))#38, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#39] +Results [3]: [cs_item_sk#19, MakeDecimal(sum(UnscaledValue(cs_ext_list_price#21))#38,17,2) AS sum(cs_ext_list_price#21)#40, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#39 AS sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41] + +(31) Filter [codegen id : 10] +Input [3]: [cs_item_sk#19, sum(cs_ext_list_price#21)#40, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41] +Condition : (isnotnull(sum(cs_ext_list_price#21)#40) AND (cast(sum(cs_ext_list_price#21)#40 as decimal(21,2)) > CheckOverflow((2.00 * promote_precision(sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41)), DecimalType(21,2), true))) + +(32) Project [codegen id : 10] +Output [1]: [cs_item_sk#19] +Input [3]: [cs_item_sk#19, sum(cs_ext_list_price#21)#40, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41] + +(33) BroadcastExchange +Input [1]: [cs_item_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#42] + +(34) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [cs_item_sk#19] +Join condition: None + +(35) Project [codegen id : 13] +Output [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12, cs_item_sk#19] + +(36) Scan parquet default.date_dim +Output [2]: [d_date_sk#43, d_year#44] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 11] +Input [2]: [d_date_sk#43, d_year#44] + +(38) Filter [codegen id : 11] +Input [2]: [d_date_sk#43, d_year#44] +Condition : ((isnotnull(d_year#44) AND (d_year#44 = 1999)) AND isnotnull(d_date_sk#43)) + +(39) BroadcastExchange +Input [2]: [d_date_sk#43, d_year#44] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#45] + +(40) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_sold_date_sk#12] +Right keys [1]: [d_date_sk#43] +Join condition: None + +(41) Project [codegen id : 13] +Output [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44] +Input [13]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12, d_date_sk#43, d_year#44] + +(42) Scan parquet default.store +Output [3]: [s_store_sk#46, s_store_name#47, s_zip#48] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_name), IsNotNull(s_zip)] +ReadSchema: struct + +(43) ColumnarToRow [codegen id : 12] +Input [3]: [s_store_sk#46, s_store_name#47, s_zip#48] + +(44) Filter [codegen id : 12] +Input [3]: [s_store_sk#46, s_store_name#47, s_zip#48] +Condition : ((isnotnull(s_store_sk#46) AND isnotnull(s_store_name#47)) AND isnotnull(s_zip#48)) + +(45) BroadcastExchange +Input [3]: [s_store_sk#46, s_store_name#47, s_zip#48] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#49] + +(46) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_store_sk#6] +Right keys [1]: [s_store_sk#46] +Join condition: None + +(47) Project [codegen id : 13] +Output [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48] +Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_sk#46, s_store_name#47, s_zip#48] + +(48) Exchange +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48] +Arguments: hashpartitioning(ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#50] + +(49) Sort [codegen id : 14] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(50) Scan parquet default.customer +Output [6]: [c_customer_sk#51, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_first_sales_date_sk), IsNotNull(c_first_shipto_date_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(51) ColumnarToRow [codegen id : 15] +Input [6]: [c_customer_sk#51, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] + +(52) Filter [codegen id : 15] +Input [6]: [c_customer_sk#51, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] +Condition : (((((isnotnull(c_customer_sk#51) AND isnotnull(c_first_sales_date_sk#56)) AND isnotnull(c_first_shipto_date_sk#55)) AND isnotnull(c_current_cdemo_sk#52)) AND isnotnull(c_current_hdemo_sk#53)) AND isnotnull(c_current_addr_sk#54)) + +(53) Exchange +Input [6]: [c_customer_sk#51, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] +Arguments: hashpartitioning(c_customer_sk#51, 5), ENSURE_REQUIREMENTS, [id=#57] + +(54) Sort [codegen id : 16] +Input [6]: [c_customer_sk#51, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] +Arguments: [c_customer_sk#51 ASC NULLS FIRST], false, 0 + +(55) SortMergeJoin [codegen id : 19] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#51] +Join condition: None + +(56) Project [codegen id : 19] +Output [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] +Input [18]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_customer_sk#51, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] + +(57) Scan parquet default.date_dim +Output [2]: [d_date_sk#58, d_year#59] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(58) ColumnarToRow [codegen id : 17] +Input [2]: [d_date_sk#58, d_year#59] + +(59) Filter [codegen id : 17] +Input [2]: [d_date_sk#58, d_year#59] +Condition : isnotnull(d_date_sk#58) + +(60) BroadcastExchange +Input [2]: [d_date_sk#58, d_year#59] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#60] + +(61) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [c_first_sales_date_sk#56] +Right keys [1]: [d_date_sk#58] +Join condition: None + +(62) Project [codegen id : 19] +Output [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, d_year#59] +Input [18]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56, d_date_sk#58, d_year#59] + +(63) ReusedExchange [Reuses operator id: 60] +Output [2]: [d_date_sk#61, d_year#62] + +(64) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [c_first_shipto_date_sk#55] +Right keys [1]: [d_date_sk#61] +Join condition: None + +(65) Project [codegen id : 19] +Output [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62] +Input [18]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, d_year#59, d_date_sk#61, d_year#62] + +(66) Exchange +Input [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62] +Arguments: hashpartitioning(ss_cdemo_sk#3, 5), ENSURE_REQUIREMENTS, [id=#63] + +(67) Sort [codegen id : 20] +Input [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62] +Arguments: [ss_cdemo_sk#3 ASC NULLS FIRST], false, 0 + +(68) Scan parquet default.customer_demographics +Output [2]: [cd_demo_sk#64, cd_marital_status#65] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), IsNotNull(cd_marital_status)] +ReadSchema: struct + +(69) ColumnarToRow [codegen id : 21] +Input [2]: [cd_demo_sk#64, cd_marital_status#65] + +(70) Filter [codegen id : 21] +Input [2]: [cd_demo_sk#64, cd_marital_status#65] +Condition : (isnotnull(cd_demo_sk#64) AND isnotnull(cd_marital_status#65)) + +(71) Exchange +Input [2]: [cd_demo_sk#64, cd_marital_status#65] +Arguments: hashpartitioning(cd_demo_sk#64, 5), ENSURE_REQUIREMENTS, [id=#66] + +(72) Sort [codegen id : 22] +Input [2]: [cd_demo_sk#64, cd_marital_status#65] +Arguments: [cd_demo_sk#64 ASC NULLS FIRST], false, 0 + +(73) SortMergeJoin [codegen id : 23] +Left keys [1]: [ss_cdemo_sk#3] +Right keys [1]: [cd_demo_sk#64] +Join condition: None + +(74) Project [codegen id : 23] +Output [16]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, cd_marital_status#65] +Input [18]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, cd_demo_sk#64, cd_marital_status#65] + +(75) Exchange +Input [16]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, cd_marital_status#65] +Arguments: hashpartitioning(c_current_cdemo_sk#52, 5), ENSURE_REQUIREMENTS, [id=#67] + +(76) Sort [codegen id : 24] +Input [16]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, cd_marital_status#65] +Arguments: [c_current_cdemo_sk#52 ASC NULLS FIRST], false, 0 + +(77) ReusedExchange [Reuses operator id: 71] +Output [2]: [cd_demo_sk#68, cd_marital_status#69] + +(78) Sort [codegen id : 26] +Input [2]: [cd_demo_sk#68, cd_marital_status#69] +Arguments: [cd_demo_sk#68 ASC NULLS FIRST], false, 0 + +(79) SortMergeJoin [codegen id : 30] +Left keys [1]: [c_current_cdemo_sk#52] +Right keys [1]: [cd_demo_sk#68] +Join condition: NOT (cd_marital_status#65 = cd_marital_status#69) + +(80) Project [codegen id : 30] +Output [14]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62] +Input [18]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, cd_marital_status#65, cd_demo_sk#68, cd_marital_status#69] + +(81) Scan parquet default.promotion +Output [1]: [p_promo_sk#70] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_promo_sk)] +ReadSchema: struct + +(82) ColumnarToRow [codegen id : 27] +Input [1]: [p_promo_sk#70] + +(83) Filter [codegen id : 27] +Input [1]: [p_promo_sk#70] +Condition : isnotnull(p_promo_sk#70) + +(84) BroadcastExchange +Input [1]: [p_promo_sk#70] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#71] + +(85) BroadcastHashJoin [codegen id : 30] +Left keys [1]: [ss_promo_sk#7] +Right keys [1]: [p_promo_sk#70] +Join condition: None + +(86) Project [codegen id : 30] +Output [13]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62] +Input [15]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, p_promo_sk#70] + +(87) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#72, hd_income_band_sk#73] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_demo_sk), IsNotNull(hd_income_band_sk)] +ReadSchema: struct + +(88) ColumnarToRow [codegen id : 28] +Input [2]: [hd_demo_sk#72, hd_income_band_sk#73] + +(89) Filter [codegen id : 28] +Input [2]: [hd_demo_sk#72, hd_income_band_sk#73] +Condition : (isnotnull(hd_demo_sk#72) AND isnotnull(hd_income_band_sk#73)) + +(90) BroadcastExchange +Input [2]: [hd_demo_sk#72, hd_income_band_sk#73] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#74] + +(91) BroadcastHashJoin [codegen id : 30] +Left keys [1]: [ss_hdemo_sk#4] +Right keys [1]: [hd_demo_sk#72] +Join condition: None + +(92) Project [codegen id : 30] +Output [13]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73] +Input [15]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, hd_demo_sk#72, hd_income_band_sk#73] + +(93) ReusedExchange [Reuses operator id: 90] +Output [2]: [hd_demo_sk#75, hd_income_band_sk#76] + +(94) BroadcastHashJoin [codegen id : 30] +Left keys [1]: [c_current_hdemo_sk#53] +Right keys [1]: [hd_demo_sk#75] +Join condition: None + +(95) Project [codegen id : 30] +Output [13]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76] +Input [15]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_demo_sk#75, hd_income_band_sk#76] + +(96) Exchange +Input [13]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76] +Arguments: hashpartitioning(ss_addr_sk#5, 5), ENSURE_REQUIREMENTS, [id=#77] + +(97) Sort [codegen id : 31] +Input [13]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76] +Arguments: [ss_addr_sk#5 ASC NULLS FIRST], false, 0 + +(98) Scan parquet default.customer_address +Output [5]: [ca_address_sk#78, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(99) ColumnarToRow [codegen id : 32] +Input [5]: [ca_address_sk#78, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] + +(100) Filter [codegen id : 32] +Input [5]: [ca_address_sk#78, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Condition : isnotnull(ca_address_sk#78) + +(101) Exchange +Input [5]: [ca_address_sk#78, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Arguments: hashpartitioning(ca_address_sk#78, 5), ENSURE_REQUIREMENTS, [id=#83] + +(102) Sort [codegen id : 33] +Input [5]: [ca_address_sk#78, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Arguments: [ca_address_sk#78 ASC NULLS FIRST], false, 0 + +(103) SortMergeJoin [codegen id : 34] +Left keys [1]: [ss_addr_sk#5] +Right keys [1]: [ca_address_sk#78] +Join condition: None + +(104) Project [codegen id : 34] +Output [16]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Input [18]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_address_sk#78, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] + +(105) Exchange +Input [16]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Arguments: hashpartitioning(c_current_addr_sk#54, 5), ENSURE_REQUIREMENTS, [id=#84] + +(106) Sort [codegen id : 35] +Input [16]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Arguments: [c_current_addr_sk#54 ASC NULLS FIRST], false, 0 + +(107) ReusedExchange [Reuses operator id: 101] +Output [5]: [ca_address_sk#85, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89] + +(108) Sort [codegen id : 37] +Input [5]: [ca_address_sk#85, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89] +Arguments: [ca_address_sk#85 ASC NULLS FIRST], false, 0 + +(109) SortMergeJoin [codegen id : 41] +Left keys [1]: [c_current_addr_sk#54] +Right keys [1]: [ca_address_sk#85] +Join condition: None + +(110) Project [codegen id : 41] +Output [19]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89] +Input [21]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_address_sk#85, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89] + +(111) Scan parquet default.income_band +Output [1]: [ib_income_band_sk#90] +Batched: true +Location [not included in comparison]/{warehouse_dir}/income_band] +PushedFilters: [IsNotNull(ib_income_band_sk)] +ReadSchema: struct + +(112) ColumnarToRow [codegen id : 38] +Input [1]: [ib_income_band_sk#90] + +(113) Filter [codegen id : 38] +Input [1]: [ib_income_band_sk#90] +Condition : isnotnull(ib_income_band_sk#90) + +(114) BroadcastExchange +Input [1]: [ib_income_band_sk#90] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#91] + +(115) BroadcastHashJoin [codegen id : 41] +Left keys [1]: [hd_income_band_sk#73] +Right keys [1]: [ib_income_band_sk#90] +Join condition: None + +(116) Project [codegen id : 41] +Output [18]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, d_year#59, d_year#62, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89] +Input [20]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, ib_income_band_sk#90] + +(117) ReusedExchange [Reuses operator id: 114] +Output [1]: [ib_income_band_sk#92] + +(118) BroadcastHashJoin [codegen id : 41] +Left keys [1]: [hd_income_band_sk#76] +Right keys [1]: [ib_income_band_sk#92] +Join condition: None + +(119) Project [codegen id : 41] +Output [17]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, d_year#59, d_year#62, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89] +Input [19]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, d_year#59, d_year#62, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, ib_income_band_sk#92] + +(120) Scan parquet default.item +Output [4]: [i_item_sk#93, i_current_price#94, i_color#95, i_product_name#96] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), In(i_color, [purple ,burlywood ,indian ,spring ,floral ,medium ]), GreaterThanOrEqual(i_current_price,64.00), LessThanOrEqual(i_current_price,74.00), GreaterThanOrEqual(i_current_price,65.00), LessThanOrEqual(i_current_price,79.00), IsNotNull(i_item_sk)] +ReadSchema: struct + +(121) ColumnarToRow [codegen id : 40] +Input [4]: [i_item_sk#93, i_current_price#94, i_color#95, i_product_name#96] + +(122) Filter [codegen id : 40] +Input [4]: [i_item_sk#93, i_current_price#94, i_color#95, i_product_name#96] +Condition : ((((((isnotnull(i_current_price#94) AND i_color#95 IN (purple ,burlywood ,indian ,spring ,floral ,medium )) AND (i_current_price#94 >= 64.00)) AND (i_current_price#94 <= 74.00)) AND (i_current_price#94 >= 65.00)) AND (i_current_price#94 <= 79.00)) AND isnotnull(i_item_sk#93)) + +(123) Project [codegen id : 40] +Output [2]: [i_item_sk#93, i_product_name#96] +Input [4]: [i_item_sk#93, i_current_price#94, i_color#95, i_product_name#96] + +(124) BroadcastExchange +Input [2]: [i_item_sk#93, i_product_name#96] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#97] + +(125) BroadcastHashJoin [codegen id : 41] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#93] +Join condition: None + +(126) Project [codegen id : 41] +Output [18]: [ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, d_year#59, d_year#62, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, i_item_sk#93, i_product_name#96] +Input [19]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, d_year#59, d_year#62, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, i_item_sk#93, i_product_name#96] + +(127) HashAggregate [codegen id : 41] +Input [18]: [ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, d_year#59, d_year#62, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, i_item_sk#93, i_product_name#96] +Keys [15]: [i_product_name#96, i_item_sk#93, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, d_year#44, d_year#59, d_year#62] +Functions [4]: [partial_count(1), partial_sum(UnscaledValue(ss_wholesale_cost#9)), partial_sum(UnscaledValue(ss_list_price#10)), partial_sum(UnscaledValue(ss_coupon_amt#11))] +Aggregate Attributes [4]: [count#98, sum#99, sum#100, sum#101] +Results [19]: [i_product_name#96, i_item_sk#93, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, d_year#44, d_year#59, d_year#62, count#102, sum#103, sum#104, sum#105] + +(128) Exchange +Input [19]: [i_product_name#96, i_item_sk#93, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, d_year#44, d_year#59, d_year#62, count#102, sum#103, sum#104, sum#105] +Arguments: hashpartitioning(i_product_name#96, i_item_sk#93, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, d_year#44, d_year#59, d_year#62, 5), ENSURE_REQUIREMENTS, [id=#106] + +(129) HashAggregate [codegen id : 42] +Input [19]: [i_product_name#96, i_item_sk#93, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, d_year#44, d_year#59, d_year#62, count#102, sum#103, sum#104, sum#105] +Keys [15]: [i_product_name#96, i_item_sk#93, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, d_year#44, d_year#59, d_year#62] +Functions [4]: [count(1), sum(UnscaledValue(ss_wholesale_cost#9)), sum(UnscaledValue(ss_list_price#10)), sum(UnscaledValue(ss_coupon_amt#11))] +Aggregate Attributes [4]: [count(1)#107, sum(UnscaledValue(ss_wholesale_cost#9))#108, sum(UnscaledValue(ss_list_price#10))#109, sum(UnscaledValue(ss_coupon_amt#11))#110] +Results [17]: [i_product_name#96 AS product_name#111, i_item_sk#93 AS item_sk#112, s_store_name#47 AS store_name#113, s_zip#48 AS store_zip#114, ca_street_number#79 AS b_street_number#115, ca_street_name#80 AS b_streen_name#116, ca_city#81 AS b_city#117, ca_zip#82 AS b_zip#118, ca_street_number#86 AS c_street_number#119, ca_street_name#87 AS c_street_name#120, ca_city#88 AS c_city#121, ca_zip#89 AS c_zip#122, d_year#44 AS syear#123, count(1)#107 AS cnt#124, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#9))#108,17,2) AS s1#125, MakeDecimal(sum(UnscaledValue(ss_list_price#10))#109,17,2) AS s2#126, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#11))#110,17,2) AS s3#127] + +(130) Exchange +Input [17]: [product_name#111, item_sk#112, store_name#113, store_zip#114, b_street_number#115, b_streen_name#116, b_city#117, b_zip#118, c_street_number#119, c_street_name#120, c_city#121, c_zip#122, syear#123, cnt#124, s1#125, s2#126, s3#127] +Arguments: hashpartitioning(item_sk#112, store_name#113, store_zip#114, 5), ENSURE_REQUIREMENTS, [id=#128] + +(131) Sort [codegen id : 43] +Input [17]: [product_name#111, item_sk#112, store_name#113, store_zip#114, b_street_number#115, b_streen_name#116, b_city#117, b_zip#118, c_street_number#119, c_street_name#120, c_city#121, c_zip#122, syear#123, cnt#124, s1#125, s2#126, s3#127] +Arguments: [item_sk#112 ASC NULLS FIRST, store_name#113 ASC NULLS FIRST, store_zip#114 ASC NULLS FIRST], false, 0 + +(132) Scan parquet default.store_sales +Output [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#140), dynamicpruningexpression(ss_sold_date_sk#140 IN dynamicpruning#141)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_promo_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(133) ColumnarToRow [codegen id : 44] +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] + +(134) Filter [codegen id : 44] +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] +Condition : (((((((isnotnull(ss_item_sk#129) AND isnotnull(ss_ticket_number#136)) AND isnotnull(ss_store_sk#134)) AND isnotnull(ss_customer_sk#130)) AND isnotnull(ss_cdemo_sk#131)) AND isnotnull(ss_promo_sk#135)) AND isnotnull(ss_hdemo_sk#132)) AND isnotnull(ss_addr_sk#133)) + +(135) Exchange +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] +Arguments: hashpartitioning(ss_item_sk#129, ss_ticket_number#136, 5), ENSURE_REQUIREMENTS, [id=#142] + +(136) Sort [codegen id : 45] +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] +Arguments: [ss_item_sk#129 ASC NULLS FIRST, ss_ticket_number#136 ASC NULLS FIRST], false, 0 + +(137) ReusedExchange [Reuses operator id: 10] +Output [2]: [sr_item_sk#143, sr_ticket_number#144] + +(138) Sort [codegen id : 47] +Input [2]: [sr_item_sk#143, sr_ticket_number#144] +Arguments: [sr_item_sk#143 ASC NULLS FIRST, sr_ticket_number#144 ASC NULLS FIRST], false, 0 + +(139) SortMergeJoin [codegen id : 56] +Left keys [2]: [ss_item_sk#129, ss_ticket_number#136] +Right keys [2]: [sr_item_sk#143, sr_ticket_number#144] +Join condition: None + +(140) Project [codegen id : 56] +Output [11]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] +Input [14]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140, sr_item_sk#143, sr_ticket_number#144] + +(141) ReusedExchange [Reuses operator id: 33] +Output [1]: [cs_item_sk#145] + +(142) BroadcastHashJoin [codegen id : 56] +Left keys [1]: [ss_item_sk#129] +Right keys [1]: [cs_item_sk#145] +Join condition: None + +(143) Project [codegen id : 56] +Output [11]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140, cs_item_sk#145] + +(144) Scan parquet default.date_dim +Output [2]: [d_date_sk#146, d_year#147] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(145) ColumnarToRow [codegen id : 54] +Input [2]: [d_date_sk#146, d_year#147] + +(146) Filter [codegen id : 54] +Input [2]: [d_date_sk#146, d_year#147] +Condition : ((isnotnull(d_year#147) AND (d_year#147 = 2000)) AND isnotnull(d_date_sk#146)) + +(147) BroadcastExchange +Input [2]: [d_date_sk#146, d_year#147] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#148] + +(148) BroadcastHashJoin [codegen id : 56] +Left keys [1]: [ss_sold_date_sk#140] +Right keys [1]: [d_date_sk#146] +Join condition: None + +(149) Project [codegen id : 56] +Output [11]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147] +Input [13]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140, d_date_sk#146, d_year#147] + +(150) ReusedExchange [Reuses operator id: 45] +Output [3]: [s_store_sk#149, s_store_name#150, s_zip#151] + +(151) BroadcastHashJoin [codegen id : 56] +Left keys [1]: [ss_store_sk#134] +Right keys [1]: [s_store_sk#149] +Join condition: None + +(152) Project [codegen id : 56] +Output [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151] +Input [14]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_sk#149, s_store_name#150, s_zip#151] + +(153) Exchange +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151] +Arguments: hashpartitioning(ss_customer_sk#130, 5), ENSURE_REQUIREMENTS, [id=#152] + +(154) Sort [codegen id : 57] +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151] +Arguments: [ss_customer_sk#130 ASC NULLS FIRST], false, 0 + +(155) ReusedExchange [Reuses operator id: 53] +Output [6]: [c_customer_sk#153, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, c_first_sales_date_sk#158] + +(156) Sort [codegen id : 59] +Input [6]: [c_customer_sk#153, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, c_first_sales_date_sk#158] +Arguments: [c_customer_sk#153 ASC NULLS FIRST], false, 0 + +(157) SortMergeJoin [codegen id : 62] +Left keys [1]: [ss_customer_sk#130] +Right keys [1]: [c_customer_sk#153] +Join condition: None + +(158) Project [codegen id : 62] +Output [16]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, c_first_sales_date_sk#158] +Input [18]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_customer_sk#153, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, c_first_sales_date_sk#158] + +(159) ReusedExchange [Reuses operator id: 60] +Output [2]: [d_date_sk#159, d_year#160] + +(160) BroadcastHashJoin [codegen id : 62] +Left keys [1]: [c_first_sales_date_sk#158] +Right keys [1]: [d_date_sk#159] +Join condition: None + +(161) Project [codegen id : 62] +Output [16]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, d_year#160] +Input [18]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, c_first_sales_date_sk#158, d_date_sk#159, d_year#160] + +(162) ReusedExchange [Reuses operator id: 60] +Output [2]: [d_date_sk#161, d_year#162] + +(163) BroadcastHashJoin [codegen id : 62] +Left keys [1]: [c_first_shipto_date_sk#157] +Right keys [1]: [d_date_sk#161] +Join condition: None + +(164) Project [codegen id : 62] +Output [16]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162] +Input [18]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, d_year#160, d_date_sk#161, d_year#162] + +(165) Exchange +Input [16]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162] +Arguments: hashpartitioning(ss_cdemo_sk#131, 5), ENSURE_REQUIREMENTS, [id=#163] + +(166) Sort [codegen id : 63] +Input [16]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162] +Arguments: [ss_cdemo_sk#131 ASC NULLS FIRST], false, 0 + +(167) ReusedExchange [Reuses operator id: 71] +Output [2]: [cd_demo_sk#164, cd_marital_status#165] + +(168) Sort [codegen id : 65] +Input [2]: [cd_demo_sk#164, cd_marital_status#165] +Arguments: [cd_demo_sk#164 ASC NULLS FIRST], false, 0 + +(169) SortMergeJoin [codegen id : 66] +Left keys [1]: [ss_cdemo_sk#131] +Right keys [1]: [cd_demo_sk#164] +Join condition: None + +(170) Project [codegen id : 66] +Output [16]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, cd_marital_status#165] +Input [18]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, cd_demo_sk#164, cd_marital_status#165] + +(171) Exchange +Input [16]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, cd_marital_status#165] +Arguments: hashpartitioning(c_current_cdemo_sk#154, 5), ENSURE_REQUIREMENTS, [id=#166] + +(172) Sort [codegen id : 67] +Input [16]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, cd_marital_status#165] +Arguments: [c_current_cdemo_sk#154 ASC NULLS FIRST], false, 0 + +(173) ReusedExchange [Reuses operator id: 71] +Output [2]: [cd_demo_sk#167, cd_marital_status#168] + +(174) Sort [codegen id : 69] +Input [2]: [cd_demo_sk#167, cd_marital_status#168] +Arguments: [cd_demo_sk#167 ASC NULLS FIRST], false, 0 + +(175) SortMergeJoin [codegen id : 73] +Left keys [1]: [c_current_cdemo_sk#154] +Right keys [1]: [cd_demo_sk#167] +Join condition: NOT (cd_marital_status#165 = cd_marital_status#168) + +(176) Project [codegen id : 73] +Output [14]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162] +Input [18]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, cd_marital_status#165, cd_demo_sk#167, cd_marital_status#168] + +(177) ReusedExchange [Reuses operator id: 84] +Output [1]: [p_promo_sk#169] + +(178) BroadcastHashJoin [codegen id : 73] +Left keys [1]: [ss_promo_sk#135] +Right keys [1]: [p_promo_sk#169] +Join condition: None + +(179) Project [codegen id : 73] +Output [13]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162] +Input [15]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, p_promo_sk#169] + +(180) ReusedExchange [Reuses operator id: 90] +Output [2]: [hd_demo_sk#170, hd_income_band_sk#171] + +(181) BroadcastHashJoin [codegen id : 73] +Left keys [1]: [ss_hdemo_sk#132] +Right keys [1]: [hd_demo_sk#170] +Join condition: None + +(182) Project [codegen id : 73] +Output [13]: [ss_item_sk#129, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171] +Input [15]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, hd_demo_sk#170, hd_income_band_sk#171] + +(183) ReusedExchange [Reuses operator id: 90] +Output [2]: [hd_demo_sk#172, hd_income_band_sk#173] + +(184) BroadcastHashJoin [codegen id : 73] +Left keys [1]: [c_current_hdemo_sk#155] +Right keys [1]: [hd_demo_sk#172] +Join condition: None + +(185) Project [codegen id : 73] +Output [13]: [ss_item_sk#129, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173] +Input [15]: [ss_item_sk#129, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_demo_sk#172, hd_income_band_sk#173] + +(186) Exchange +Input [13]: [ss_item_sk#129, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173] +Arguments: hashpartitioning(ss_addr_sk#133, 5), ENSURE_REQUIREMENTS, [id=#174] + +(187) Sort [codegen id : 74] +Input [13]: [ss_item_sk#129, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173] +Arguments: [ss_addr_sk#133 ASC NULLS FIRST], false, 0 + +(188) ReusedExchange [Reuses operator id: 101] +Output [5]: [ca_address_sk#175, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179] + +(189) Sort [codegen id : 76] +Input [5]: [ca_address_sk#175, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179] +Arguments: [ca_address_sk#175 ASC NULLS FIRST], false, 0 + +(190) SortMergeJoin [codegen id : 77] +Left keys [1]: [ss_addr_sk#133] +Right keys [1]: [ca_address_sk#175] +Join condition: None + +(191) Project [codegen id : 77] +Output [16]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179] +Input [18]: [ss_item_sk#129, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_address_sk#175, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179] + +(192) Exchange +Input [16]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179] +Arguments: hashpartitioning(c_current_addr_sk#156, 5), ENSURE_REQUIREMENTS, [id=#180] + +(193) Sort [codegen id : 78] +Input [16]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179] +Arguments: [c_current_addr_sk#156 ASC NULLS FIRST], false, 0 + +(194) ReusedExchange [Reuses operator id: 101] +Output [5]: [ca_address_sk#181, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185] + +(195) Sort [codegen id : 80] +Input [5]: [ca_address_sk#181, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185] +Arguments: [ca_address_sk#181 ASC NULLS FIRST], false, 0 + +(196) SortMergeJoin [codegen id : 84] +Left keys [1]: [c_current_addr_sk#156] +Right keys [1]: [ca_address_sk#181] +Join condition: None + +(197) Project [codegen id : 84] +Output [19]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185] +Input [21]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_address_sk#181, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185] + +(198) ReusedExchange [Reuses operator id: 114] +Output [1]: [ib_income_band_sk#186] + +(199) BroadcastHashJoin [codegen id : 84] +Left keys [1]: [hd_income_band_sk#171] +Right keys [1]: [ib_income_band_sk#186] +Join condition: None + +(200) Project [codegen id : 84] +Output [18]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, d_year#160, d_year#162, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185] +Input [20]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, ib_income_band_sk#186] + +(201) ReusedExchange [Reuses operator id: 114] +Output [1]: [ib_income_band_sk#187] + +(202) BroadcastHashJoin [codegen id : 84] +Left keys [1]: [hd_income_band_sk#173] +Right keys [1]: [ib_income_band_sk#187] +Join condition: None + +(203) Project [codegen id : 84] +Output [17]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, d_year#160, d_year#162, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185] +Input [19]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, d_year#160, d_year#162, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, ib_income_band_sk#187] + +(204) ReusedExchange [Reuses operator id: 124] +Output [2]: [i_item_sk#188, i_product_name#189] + +(205) BroadcastHashJoin [codegen id : 84] +Left keys [1]: [ss_item_sk#129] +Right keys [1]: [i_item_sk#188] +Join condition: None + +(206) Project [codegen id : 84] +Output [18]: [ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, d_year#160, d_year#162, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, i_item_sk#188, i_product_name#189] +Input [19]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, d_year#160, d_year#162, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, i_item_sk#188, i_product_name#189] + +(207) HashAggregate [codegen id : 84] +Input [18]: [ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, d_year#160, d_year#162, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, i_item_sk#188, i_product_name#189] +Keys [15]: [i_product_name#189, i_item_sk#188, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, d_year#147, d_year#160, d_year#162] +Functions [4]: [partial_count(1), partial_sum(UnscaledValue(ss_wholesale_cost#137)), partial_sum(UnscaledValue(ss_list_price#138)), partial_sum(UnscaledValue(ss_coupon_amt#139))] +Aggregate Attributes [4]: [count#190, sum#191, sum#192, sum#193] +Results [19]: [i_product_name#189, i_item_sk#188, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, d_year#147, d_year#160, d_year#162, count#194, sum#195, sum#196, sum#197] + +(208) Exchange +Input [19]: [i_product_name#189, i_item_sk#188, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, d_year#147, d_year#160, d_year#162, count#194, sum#195, sum#196, sum#197] +Arguments: hashpartitioning(i_product_name#189, i_item_sk#188, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, d_year#147, d_year#160, d_year#162, 5), ENSURE_REQUIREMENTS, [id=#198] + +(209) HashAggregate [codegen id : 85] +Input [19]: [i_product_name#189, i_item_sk#188, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, d_year#147, d_year#160, d_year#162, count#194, sum#195, sum#196, sum#197] +Keys [15]: [i_product_name#189, i_item_sk#188, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, d_year#147, d_year#160, d_year#162] +Functions [4]: [count(1), sum(UnscaledValue(ss_wholesale_cost#137)), sum(UnscaledValue(ss_list_price#138)), sum(UnscaledValue(ss_coupon_amt#139))] +Aggregate Attributes [4]: [count(1)#199, sum(UnscaledValue(ss_wholesale_cost#137))#200, sum(UnscaledValue(ss_list_price#138))#201, sum(UnscaledValue(ss_coupon_amt#139))#202] +Results [8]: [i_item_sk#188 AS item_sk#203, s_store_name#150 AS store_name#204, s_zip#151 AS store_zip#205, d_year#147 AS syear#206, count(1)#199 AS cnt#207, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#137))#200,17,2) AS s1#208, MakeDecimal(sum(UnscaledValue(ss_list_price#138))#201,17,2) AS s2#209, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#139))#202,17,2) AS s3#210] + +(210) Exchange +Input [8]: [item_sk#203, store_name#204, store_zip#205, syear#206, cnt#207, s1#208, s2#209, s3#210] +Arguments: hashpartitioning(item_sk#203, store_name#204, store_zip#205, 5), ENSURE_REQUIREMENTS, [id=#211] + +(211) Sort [codegen id : 86] +Input [8]: [item_sk#203, store_name#204, store_zip#205, syear#206, cnt#207, s1#208, s2#209, s3#210] +Arguments: [item_sk#203 ASC NULLS FIRST, store_name#204 ASC NULLS FIRST, store_zip#205 ASC NULLS FIRST], false, 0 + +(212) SortMergeJoin [codegen id : 87] +Left keys [3]: [item_sk#112, store_name#113, store_zip#114] +Right keys [3]: [item_sk#203, store_name#204, store_zip#205] +Join condition: (cnt#207 <= cnt#124) + +(213) Project [codegen id : 87] +Output [21]: [product_name#111, store_name#113, store_zip#114, b_street_number#115, b_streen_name#116, b_city#117, b_zip#118, c_street_number#119, c_street_name#120, c_city#121, c_zip#122, syear#123, cnt#124, s1#125, s2#126, s3#127, s1#208, s2#209, s3#210, syear#206, cnt#207] +Input [25]: [product_name#111, item_sk#112, store_name#113, store_zip#114, b_street_number#115, b_streen_name#116, b_city#117, b_zip#118, c_street_number#119, c_street_name#120, c_city#121, c_zip#122, syear#123, cnt#124, s1#125, s2#126, s3#127, item_sk#203, store_name#204, store_zip#205, syear#206, cnt#207, s1#208, s2#209, s3#210] + +(214) Exchange +Input [21]: [product_name#111, store_name#113, store_zip#114, b_street_number#115, b_streen_name#116, b_city#117, b_zip#118, c_street_number#119, c_street_name#120, c_city#121, c_zip#122, syear#123, cnt#124, s1#125, s2#126, s3#127, s1#208, s2#209, s3#210, syear#206, cnt#207] +Arguments: rangepartitioning(product_name#111 ASC NULLS FIRST, store_name#113 ASC NULLS FIRST, cnt#207 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#212] + +(215) Sort [codegen id : 88] +Input [21]: [product_name#111, store_name#113, store_zip#114, b_street_number#115, b_streen_name#116, b_city#117, b_zip#118, c_street_number#119, c_street_name#120, c_city#121, c_zip#122, syear#123, cnt#124, s1#125, s2#126, s3#127, s1#208, s2#209, s3#210, syear#206, cnt#207] +Arguments: [product_name#111 ASC NULLS FIRST, store_name#113 ASC NULLS FIRST, cnt#207 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#12 IN dynamicpruning#13 +ReusedExchange (216) + + +(216) ReusedExchange [Reuses operator id: 39] +Output [2]: [d_date_sk#43, d_year#44] + +Subquery:2 Hosting operator id = 132 Hosting Expression = ss_sold_date_sk#140 IN dynamicpruning#141 +ReusedExchange (217) + + +(217) ReusedExchange [Reuses operator id: 147] +Output [2]: [d_date_sk#146, d_year#147] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64.sf100/simplified.txt new file mode 100644 index 0000000000000..09023ded66475 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64.sf100/simplified.txt @@ -0,0 +1,379 @@ +WholeStageCodegen (88) + Sort [product_name,store_name,cnt] + InputAdapter + Exchange [product_name,store_name,cnt] #1 + WholeStageCodegen (87) + Project [product_name,store_name,store_zip,b_street_number,b_streen_name,b_city,b_zip,c_street_number,c_street_name,c_city,c_zip,syear,cnt,s1,s2,s3,s1,s2,s3,syear,cnt] + SortMergeJoin [item_sk,store_name,store_zip,item_sk,store_name,store_zip,cnt,cnt] + InputAdapter + WholeStageCodegen (43) + Sort [item_sk,store_name,store_zip] + InputAdapter + Exchange [item_sk,store_name,store_zip] #2 + WholeStageCodegen (42) + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,count,sum,sum,sum] [count(1),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_list_price)),sum(UnscaledValue(ss_coupon_amt)),product_name,item_sk,store_name,store_zip,b_street_number,b_streen_name,b_city,b_zip,c_street_number,c_street_name,c_city,c_zip,syear,cnt,s1,s2,s3,count,sum,sum,sum] + InputAdapter + Exchange [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year] #3 + WholeStageCodegen (41) + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,ss_wholesale_cost,ss_list_price,ss_coupon_amt] [count,sum,sum,sum,count,sum,sum,sum] + Project [ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,d_year,d_year,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,i_item_sk,i_product_name] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (35) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #4 + WholeStageCodegen (34) + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (31) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #5 + WholeStageCodegen (30) + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,hd_income_band_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk,cd_marital_status,cd_marital_status] + InputAdapter + WholeStageCodegen (24) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #6 + WholeStageCodegen (23) + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,cd_marital_status] + SortMergeJoin [ss_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (20) + Sort [ss_cdemo_sk] + InputAdapter + Exchange [ss_cdemo_sk] #7 + WholeStageCodegen (19) + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [c_first_shipto_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,d_year] + BroadcastHashJoin [c_first_sales_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (14) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #8 + WholeStageCodegen (13) + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_item_sk,cs_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SortMergeJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_item_sk,ss_ticket_number] #9 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_ticket_number,ss_store_sk,ss_customer_sk,ss_cdemo_sk,ss_promo_sk,ss_hdemo_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #10 + InputAdapter + WholeStageCodegen (4) + Sort [sr_item_sk,sr_ticket_number] + InputAdapter + Exchange [sr_item_sk,sr_ticket_number] #11 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (10) + Project [cs_item_sk] + Filter [sum(cs_ext_list_price),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true))] + HashAggregate [cs_item_sk,sum,sum,isEmpty] [sum(UnscaledValue(cs_ext_list_price)),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true)),sum(cs_ext_list_price),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true)),sum,sum,isEmpty] + InputAdapter + Exchange [cs_item_sk] #13 + WholeStageCodegen (9) + HashAggregate [cs_item_sk,cs_ext_list_price,cr_refunded_cash,cr_reversed_charge,cr_store_credit] [sum,sum,isEmpty,sum,sum,isEmpty] + Project [cs_item_sk,cs_ext_list_price,cr_refunded_cash,cr_reversed_charge,cr_store_credit] + SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] + InputAdapter + WholeStageCodegen (6) + Sort [cs_item_sk,cs_order_number] + InputAdapter + Exchange [cs_item_sk,cs_order_number] #14 + WholeStageCodegen (5) + Project [cs_item_sk,cs_order_number,cs_ext_list_price] + Filter [cs_item_sk,cs_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_ext_list_price,cs_sold_date_sk] + InputAdapter + WholeStageCodegen (8) + Sort [cr_item_sk,cr_order_number] + InputAdapter + Exchange [cr_item_sk,cr_order_number] #15 + WholeStageCodegen (7) + Project [cr_item_sk,cr_order_number,cr_refunded_cash,cr_reversed_charge,cr_store_credit] + Filter [cr_item_sk,cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_refunded_cash,cr_reversed_charge,cr_store_credit,cr_returned_date_sk] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (11) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (12) + Filter [s_store_sk,s_store_name,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_zip] + InputAdapter + WholeStageCodegen (16) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #17 + WholeStageCodegen (15) + Filter [c_customer_sk,c_first_sales_date_sk,c_first_shipto_date_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] + InputAdapter + BroadcastExchange #18 + WholeStageCodegen (17) + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + ReusedExchange [d_date_sk,d_year] #18 + InputAdapter + WholeStageCodegen (22) + Sort [cd_demo_sk] + InputAdapter + Exchange [cd_demo_sk] #19 + WholeStageCodegen (21) + Filter [cd_demo_sk,cd_marital_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status] + InputAdapter + WholeStageCodegen (26) + Sort [cd_demo_sk] + InputAdapter + ReusedExchange [cd_demo_sk,cd_marital_status] #19 + InputAdapter + BroadcastExchange #20 + WholeStageCodegen (27) + Filter [p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk] + InputAdapter + BroadcastExchange #21 + WholeStageCodegen (28) + Filter [hd_demo_sk,hd_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_income_band_sk] + InputAdapter + ReusedExchange [hd_demo_sk,hd_income_band_sk] #21 + InputAdapter + WholeStageCodegen (33) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #22 + WholeStageCodegen (32) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] + InputAdapter + WholeStageCodegen (37) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] #22 + InputAdapter + BroadcastExchange #23 + WholeStageCodegen (38) + Filter [ib_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.income_band [ib_income_band_sk] + InputAdapter + ReusedExchange [ib_income_band_sk] #23 + InputAdapter + BroadcastExchange #24 + WholeStageCodegen (40) + Project [i_item_sk,i_product_name] + Filter [i_current_price,i_color,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_color,i_product_name] + InputAdapter + WholeStageCodegen (86) + Sort [item_sk,store_name,store_zip] + InputAdapter + Exchange [item_sk,store_name,store_zip] #25 + WholeStageCodegen (85) + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,count,sum,sum,sum] [count(1),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_list_price)),sum(UnscaledValue(ss_coupon_amt)),item_sk,store_name,store_zip,syear,cnt,s1,s2,s3,count,sum,sum,sum] + InputAdapter + Exchange [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year] #26 + WholeStageCodegen (84) + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,ss_wholesale_cost,ss_list_price,ss_coupon_amt] [count,sum,sum,sum,count,sum,sum,sum] + Project [ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,d_year,d_year,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,i_item_sk,i_product_name] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (78) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #27 + WholeStageCodegen (77) + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (74) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #28 + WholeStageCodegen (73) + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,hd_income_band_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk,cd_marital_status,cd_marital_status] + InputAdapter + WholeStageCodegen (67) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #29 + WholeStageCodegen (66) + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,cd_marital_status] + SortMergeJoin [ss_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (63) + Sort [ss_cdemo_sk] + InputAdapter + Exchange [ss_cdemo_sk] #30 + WholeStageCodegen (62) + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [c_first_shipto_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,d_year] + BroadcastHashJoin [c_first_sales_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (57) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #31 + WholeStageCodegen (56) + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_item_sk,cs_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SortMergeJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + WholeStageCodegen (45) + Sort [ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_item_sk,ss_ticket_number] #32 + WholeStageCodegen (44) + Filter [ss_item_sk,ss_ticket_number,ss_store_sk,ss_customer_sk,ss_cdemo_sk,ss_promo_sk,ss_hdemo_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #33 + InputAdapter + WholeStageCodegen (47) + Sort [sr_item_sk,sr_ticket_number] + InputAdapter + ReusedExchange [sr_item_sk,sr_ticket_number] #11 + InputAdapter + ReusedExchange [cs_item_sk] #12 + InputAdapter + BroadcastExchange #33 + WholeStageCodegen (54) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + ReusedExchange [s_store_sk,s_store_name,s_zip] #16 + InputAdapter + WholeStageCodegen (59) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] #17 + InputAdapter + ReusedExchange [d_date_sk,d_year] #18 + InputAdapter + ReusedExchange [d_date_sk,d_year] #18 + InputAdapter + WholeStageCodegen (65) + Sort [cd_demo_sk] + InputAdapter + ReusedExchange [cd_demo_sk,cd_marital_status] #19 + InputAdapter + WholeStageCodegen (69) + Sort [cd_demo_sk] + InputAdapter + ReusedExchange [cd_demo_sk,cd_marital_status] #19 + InputAdapter + ReusedExchange [p_promo_sk] #20 + InputAdapter + ReusedExchange [hd_demo_sk,hd_income_band_sk] #21 + InputAdapter + ReusedExchange [hd_demo_sk,hd_income_band_sk] #21 + InputAdapter + WholeStageCodegen (76) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] #22 + InputAdapter + WholeStageCodegen (80) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] #22 + InputAdapter + ReusedExchange [ib_income_band_sk] #23 + InputAdapter + ReusedExchange [ib_income_band_sk] #23 + InputAdapter + ReusedExchange [i_item_sk,i_product_name] #24 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64/explain.txt new file mode 100644 index 0000000000000..c1138bbbf315e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64/explain.txt @@ -0,0 +1,1038 @@ +== Physical Plan == +* Sort (189) ++- Exchange (188) + +- * Project (187) + +- * SortMergeJoin Inner (186) + :- * Sort (114) + : +- Exchange (113) + : +- * HashAggregate (112) + : +- * HashAggregate (111) + : +- * Project (110) + : +- * BroadcastHashJoin Inner BuildRight (109) + : :- * Project (103) + : : +- * BroadcastHashJoin Inner BuildRight (102) + : : :- * Project (100) + : : : +- * BroadcastHashJoin Inner BuildRight (99) + : : : :- * Project (94) + : : : : +- * BroadcastHashJoin Inner BuildRight (93) + : : : : :- * Project (91) + : : : : : +- * BroadcastHashJoin Inner BuildRight (90) + : : : : : :- * Project (85) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (84) + : : : : : : :- * Project (82) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (81) + : : : : : : : :- * Project (76) + : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (75) + : : : : : : : : :- * Project (70) + : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (69) + : : : : : : : : : :- * Project (67) + : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (66) + : : : : : : : : : : :- * Project (61) + : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (60) + : : : : : : : : : : : :- * Project (58) + : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (57) + : : : : : : : : : : : : :- * Project (52) + : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (51) + : : : : : : : : : : : : : :- * Project (46) + : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (45) + : : : : : : : : : : : : : : :- * Project (40) + : : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (39) + : : : : : : : : : : : : : : : :- * Project (34) + : : : : : : : : : : : : : : : : +- * SortMergeJoin Inner (33) + : : : : : : : : : : : : : : : : :- * Sort (12) + : : : : : : : : : : : : : : : : : +- Exchange (11) + : : : : : : : : : : : : : : : : : +- * Project (10) + : : : : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : : : : : : : : : : : : : : : :- BroadcastExchange (4) + : : : : : : : : : : : : : : : : : : +- * Filter (3) + : : : : : : : : : : : : : : : : : : +- * ColumnarToRow (2) + : : : : : : : : : : : : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : : : : : : : : : : : : +- * Project (8) + : : : : : : : : : : : : : : : : : +- * Filter (7) + : : : : : : : : : : : : : : : : : +- * ColumnarToRow (6) + : : : : : : : : : : : : : : : : : +- Scan parquet default.store_returns (5) + : : : : : : : : : : : : : : : : +- * Sort (32) + : : : : : : : : : : : : : : : : +- * Project (31) + : : : : : : : : : : : : : : : : +- * Filter (30) + : : : : : : : : : : : : : : : : +- * HashAggregate (29) + : : : : : : : : : : : : : : : : +- Exchange (28) + : : : : : : : : : : : : : : : : +- * HashAggregate (27) + : : : : : : : : : : : : : : : : +- * Project (26) + : : : : : : : : : : : : : : : : +- * SortMergeJoin Inner (25) + : : : : : : : : : : : : : : : : :- * Sort (18) + : : : : : : : : : : : : : : : : : +- Exchange (17) + : : : : : : : : : : : : : : : : : +- * Project (16) + : : : : : : : : : : : : : : : : : +- * Filter (15) + : : : : : : : : : : : : : : : : : +- * ColumnarToRow (14) + : : : : : : : : : : : : : : : : : +- Scan parquet default.catalog_sales (13) + : : : : : : : : : : : : : : : : +- * Sort (24) + : : : : : : : : : : : : : : : : +- Exchange (23) + : : : : : : : : : : : : : : : : +- * Project (22) + : : : : : : : : : : : : : : : : +- * Filter (21) + : : : : : : : : : : : : : : : : +- * ColumnarToRow (20) + : : : : : : : : : : : : : : : : +- Scan parquet default.catalog_returns (19) + : : : : : : : : : : : : : : : +- BroadcastExchange (38) + : : : : : : : : : : : : : : : +- * Filter (37) + : : : : : : : : : : : : : : : +- * ColumnarToRow (36) + : : : : : : : : : : : : : : : +- Scan parquet default.date_dim (35) + : : : : : : : : : : : : : : +- BroadcastExchange (44) + : : : : : : : : : : : : : : +- * Filter (43) + : : : : : : : : : : : : : : +- * ColumnarToRow (42) + : : : : : : : : : : : : : : +- Scan parquet default.store (41) + : : : : : : : : : : : : : +- BroadcastExchange (50) + : : : : : : : : : : : : : +- * Filter (49) + : : : : : : : : : : : : : +- * ColumnarToRow (48) + : : : : : : : : : : : : : +- Scan parquet default.customer (47) + : : : : : : : : : : : : +- BroadcastExchange (56) + : : : : : : : : : : : : +- * Filter (55) + : : : : : : : : : : : : +- * ColumnarToRow (54) + : : : : : : : : : : : : +- Scan parquet default.date_dim (53) + : : : : : : : : : : : +- ReusedExchange (59) + : : : : : : : : : : +- BroadcastExchange (65) + : : : : : : : : : : +- * Filter (64) + : : : : : : : : : : +- * ColumnarToRow (63) + : : : : : : : : : : +- Scan parquet default.customer_demographics (62) + : : : : : : : : : +- ReusedExchange (68) + : : : : : : : : +- BroadcastExchange (74) + : : : : : : : : +- * Filter (73) + : : : : : : : : +- * ColumnarToRow (72) + : : : : : : : : +- Scan parquet default.promotion (71) + : : : : : : : +- BroadcastExchange (80) + : : : : : : : +- * Filter (79) + : : : : : : : +- * ColumnarToRow (78) + : : : : : : : +- Scan parquet default.household_demographics (77) + : : : : : : +- ReusedExchange (83) + : : : : : +- BroadcastExchange (89) + : : : : : +- * Filter (88) + : : : : : +- * ColumnarToRow (87) + : : : : : +- Scan parquet default.customer_address (86) + : : : : +- ReusedExchange (92) + : : : +- BroadcastExchange (98) + : : : +- * Filter (97) + : : : +- * ColumnarToRow (96) + : : : +- Scan parquet default.income_band (95) + : : +- ReusedExchange (101) + : +- BroadcastExchange (108) + : +- * Project (107) + : +- * Filter (106) + : +- * ColumnarToRow (105) + : +- Scan parquet default.item (104) + +- * Sort (185) + +- Exchange (184) + +- * HashAggregate (183) + +- * HashAggregate (182) + +- * Project (181) + +- * BroadcastHashJoin Inner BuildRight (180) + :- * Project (178) + : +- * BroadcastHashJoin Inner BuildRight (177) + : :- * Project (175) + : : +- * BroadcastHashJoin Inner BuildRight (174) + : : :- * Project (172) + : : : +- * BroadcastHashJoin Inner BuildRight (171) + : : : :- * Project (169) + : : : : +- * BroadcastHashJoin Inner BuildRight (168) + : : : : :- * Project (166) + : : : : : +- * BroadcastHashJoin Inner BuildRight (165) + : : : : : :- * Project (163) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (162) + : : : : : : :- * Project (160) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (159) + : : : : : : : :- * Project (157) + : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (156) + : : : : : : : : :- * Project (154) + : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (153) + : : : : : : : : : :- * Project (151) + : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (150) + : : : : : : : : : : :- * Project (148) + : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (147) + : : : : : : : : : : : :- * Project (145) + : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (144) + : : : : : : : : : : : : :- * Project (142) + : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (141) + : : : : : : : : : : : : : :- * Project (139) + : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (138) + : : : : : : : : : : : : : : :- * Project (133) + : : : : : : : : : : : : : : : +- * SortMergeJoin Inner (132) + : : : : : : : : : : : : : : : :- * Sort (126) + : : : : : : : : : : : : : : : : +- Exchange (125) + : : : : : : : : : : : : : : : : +- * Project (124) + : : : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildLeft (123) + : : : : : : : : : : : : : : : : :- BroadcastExchange (118) + : : : : : : : : : : : : : : : : : +- * Filter (117) + : : : : : : : : : : : : : : : : : +- * ColumnarToRow (116) + : : : : : : : : : : : : : : : : : +- Scan parquet default.store_sales (115) + : : : : : : : : : : : : : : : : +- * Project (122) + : : : : : : : : : : : : : : : : +- * Filter (121) + : : : : : : : : : : : : : : : : +- * ColumnarToRow (120) + : : : : : : : : : : : : : : : : +- Scan parquet default.store_returns (119) + : : : : : : : : : : : : : : : +- * Sort (131) + : : : : : : : : : : : : : : : +- * Project (130) + : : : : : : : : : : : : : : : +- * Filter (129) + : : : : : : : : : : : : : : : +- * HashAggregate (128) + : : : : : : : : : : : : : : : +- ReusedExchange (127) + : : : : : : : : : : : : : : +- BroadcastExchange (137) + : : : : : : : : : : : : : : +- * Filter (136) + : : : : : : : : : : : : : : +- * ColumnarToRow (135) + : : : : : : : : : : : : : : +- Scan parquet default.date_dim (134) + : : : : : : : : : : : : : +- ReusedExchange (140) + : : : : : : : : : : : : +- ReusedExchange (143) + : : : : : : : : : : : +- ReusedExchange (146) + : : : : : : : : : : +- ReusedExchange (149) + : : : : : : : : : +- ReusedExchange (152) + : : : : : : : : +- ReusedExchange (155) + : : : : : : : +- ReusedExchange (158) + : : : : : : +- ReusedExchange (161) + : : : : : +- ReusedExchange (164) + : : : : +- ReusedExchange (167) + : : : +- ReusedExchange (170) + : : +- ReusedExchange (173) + : +- ReusedExchange (176) + +- ReusedExchange (179) + + +(1) Scan parquet default.store_sales +Output [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#12), dynamicpruningexpression(ss_sold_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_promo_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] + +(3) Filter [codegen id : 1] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Condition : (((((((isnotnull(ss_item_sk#1) AND isnotnull(ss_ticket_number#8)) AND isnotnull(ss_store_sk#6)) AND isnotnull(ss_customer_sk#2)) AND isnotnull(ss_cdemo_sk#3)) AND isnotnull(ss_promo_sk#7)) AND isnotnull(ss_hdemo_sk#4)) AND isnotnull(ss_addr_sk#5)) + +(4) BroadcastExchange +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[7, int, false] as bigint) & 4294967295))),false), [id=#14] + +(5) Scan parquet default.store_returns +Output [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(6) ColumnarToRow +Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] + +(7) Filter +Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] +Condition : (isnotnull(sr_item_sk#15) AND isnotnull(sr_ticket_number#16)) + +(8) Project +Output [2]: [sr_item_sk#15, sr_ticket_number#16] +Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#8] +Right keys [2]: [sr_item_sk#15, sr_ticket_number#16] +Join condition: None + +(10) Project [codegen id : 2] +Output [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12, sr_item_sk#15, sr_ticket_number#16] + +(11) Exchange +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#18] + +(12) Sort [codegen id : 3] +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.catalog_sales +Output [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_order_number)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 4] +Input [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] + +(15) Filter [codegen id : 4] +Input [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] +Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_order_number#20)) + +(16) Project [codegen id : 4] +Output [3]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21] +Input [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] + +(17) Exchange +Input [3]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21] +Arguments: hashpartitioning(cs_item_sk#19, cs_order_number#20, 5), ENSURE_REQUIREMENTS, [id=#23] + +(18) Sort [codegen id : 5] +Input [3]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21] +Arguments: [cs_item_sk#19 ASC NULLS FIRST, cs_order_number#20 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.catalog_returns +Output [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_order_number)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 6] +Input [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] + +(21) Filter [codegen id : 6] +Input [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] +Condition : (isnotnull(cr_item_sk#24) AND isnotnull(cr_order_number#25)) + +(22) Project [codegen id : 6] +Output [5]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Input [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] + +(23) Exchange +Input [5]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Arguments: hashpartitioning(cr_item_sk#24, cr_order_number#25, 5), ENSURE_REQUIREMENTS, [id=#30] + +(24) Sort [codegen id : 7] +Input [5]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Arguments: [cr_item_sk#24 ASC NULLS FIRST, cr_order_number#25 ASC NULLS FIRST], false, 0 + +(25) SortMergeJoin [codegen id : 8] +Left keys [2]: [cs_item_sk#19, cs_order_number#20] +Right keys [2]: [cr_item_sk#24, cr_order_number#25] +Join condition: None + +(26) Project [codegen id : 8] +Output [5]: [cs_item_sk#19, cs_ext_list_price#21, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Input [8]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] + +(27) HashAggregate [codegen id : 8] +Input [5]: [cs_item_sk#19, cs_ext_list_price#21, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Keys [1]: [cs_item_sk#19] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_list_price#21)), partial_sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))] +Aggregate Attributes [3]: [sum#31, sum#32, isEmpty#33] +Results [4]: [cs_item_sk#19, sum#34, sum#35, isEmpty#36] + +(28) Exchange +Input [4]: [cs_item_sk#19, sum#34, sum#35, isEmpty#36] +Arguments: hashpartitioning(cs_item_sk#19, 5), ENSURE_REQUIREMENTS, [id=#37] + +(29) HashAggregate [codegen id : 9] +Input [4]: [cs_item_sk#19, sum#34, sum#35, isEmpty#36] +Keys [1]: [cs_item_sk#19] +Functions [2]: [sum(UnscaledValue(cs_ext_list_price#21)), sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_list_price#21))#38, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#39] +Results [3]: [cs_item_sk#19, MakeDecimal(sum(UnscaledValue(cs_ext_list_price#21))#38,17,2) AS sum(cs_ext_list_price#21)#40, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#39 AS sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41] + +(30) Filter [codegen id : 9] +Input [3]: [cs_item_sk#19, sum(cs_ext_list_price#21)#40, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41] +Condition : (isnotnull(sum(cs_ext_list_price#21)#40) AND (cast(sum(cs_ext_list_price#21)#40 as decimal(21,2)) > CheckOverflow((2.00 * promote_precision(sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41)), DecimalType(21,2), true))) + +(31) Project [codegen id : 9] +Output [1]: [cs_item_sk#19] +Input [3]: [cs_item_sk#19, sum(cs_ext_list_price#21)#40, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41] + +(32) Sort [codegen id : 9] +Input [1]: [cs_item_sk#19] +Arguments: [cs_item_sk#19 ASC NULLS FIRST], false, 0 + +(33) SortMergeJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [cs_item_sk#19] +Join condition: None + +(34) Project [codegen id : 25] +Output [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12, cs_item_sk#19] + +(35) Scan parquet default.date_dim +Output [2]: [d_date_sk#42, d_year#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 10] +Input [2]: [d_date_sk#42, d_year#43] + +(37) Filter [codegen id : 10] +Input [2]: [d_date_sk#42, d_year#43] +Condition : ((isnotnull(d_year#43) AND (d_year#43 = 1999)) AND isnotnull(d_date_sk#42)) + +(38) BroadcastExchange +Input [2]: [d_date_sk#42, d_year#43] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#44] + +(39) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_sold_date_sk#12] +Right keys [1]: [d_date_sk#42] +Join condition: None + +(40) Project [codegen id : 25] +Output [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43] +Input [13]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12, d_date_sk#42, d_year#43] + +(41) Scan parquet default.store +Output [3]: [s_store_sk#45, s_store_name#46, s_zip#47] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_name), IsNotNull(s_zip)] +ReadSchema: struct + +(42) ColumnarToRow [codegen id : 11] +Input [3]: [s_store_sk#45, s_store_name#46, s_zip#47] + +(43) Filter [codegen id : 11] +Input [3]: [s_store_sk#45, s_store_name#46, s_zip#47] +Condition : ((isnotnull(s_store_sk#45) AND isnotnull(s_store_name#46)) AND isnotnull(s_zip#47)) + +(44) BroadcastExchange +Input [3]: [s_store_sk#45, s_store_name#46, s_zip#47] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#48] + +(45) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_store_sk#6] +Right keys [1]: [s_store_sk#45] +Join condition: None + +(46) Project [codegen id : 25] +Output [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47] +Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_sk#45, s_store_name#46, s_zip#47] + +(47) Scan parquet default.customer +Output [6]: [c_customer_sk#49, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_first_sales_date_sk), IsNotNull(c_first_shipto_date_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 12] +Input [6]: [c_customer_sk#49, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54] + +(49) Filter [codegen id : 12] +Input [6]: [c_customer_sk#49, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54] +Condition : (((((isnotnull(c_customer_sk#49) AND isnotnull(c_first_sales_date_sk#54)) AND isnotnull(c_first_shipto_date_sk#53)) AND isnotnull(c_current_cdemo_sk#50)) AND isnotnull(c_current_hdemo_sk#51)) AND isnotnull(c_current_addr_sk#52)) + +(50) BroadcastExchange +Input [6]: [c_customer_sk#49, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#55] + +(51) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#49] +Join condition: None + +(52) Project [codegen id : 25] +Output [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54] +Input [18]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_customer_sk#49, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54] + +(53) Scan parquet default.date_dim +Output [2]: [d_date_sk#56, d_year#57] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(54) ColumnarToRow [codegen id : 13] +Input [2]: [d_date_sk#56, d_year#57] + +(55) Filter [codegen id : 13] +Input [2]: [d_date_sk#56, d_year#57] +Condition : isnotnull(d_date_sk#56) + +(56) BroadcastExchange +Input [2]: [d_date_sk#56, d_year#57] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#58] + +(57) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [c_first_sales_date_sk#54] +Right keys [1]: [d_date_sk#56] +Join condition: None + +(58) Project [codegen id : 25] +Output [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, d_year#57] +Input [18]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54, d_date_sk#56, d_year#57] + +(59) ReusedExchange [Reuses operator id: 56] +Output [2]: [d_date_sk#59, d_year#60] + +(60) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [c_first_shipto_date_sk#53] +Right keys [1]: [d_date_sk#59] +Join condition: None + +(61) Project [codegen id : 25] +Output [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60] +Input [18]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, d_year#57, d_date_sk#59, d_year#60] + +(62) Scan parquet default.customer_demographics +Output [2]: [cd_demo_sk#61, cd_marital_status#62] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), IsNotNull(cd_marital_status)] +ReadSchema: struct + +(63) ColumnarToRow [codegen id : 15] +Input [2]: [cd_demo_sk#61, cd_marital_status#62] + +(64) Filter [codegen id : 15] +Input [2]: [cd_demo_sk#61, cd_marital_status#62] +Condition : (isnotnull(cd_demo_sk#61) AND isnotnull(cd_marital_status#62)) + +(65) BroadcastExchange +Input [2]: [cd_demo_sk#61, cd_marital_status#62] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#63] + +(66) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_cdemo_sk#3] +Right keys [1]: [cd_demo_sk#61] +Join condition: None + +(67) Project [codegen id : 25] +Output [16]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, cd_marital_status#62] +Input [18]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, cd_demo_sk#61, cd_marital_status#62] + +(68) ReusedExchange [Reuses operator id: 65] +Output [2]: [cd_demo_sk#64, cd_marital_status#65] + +(69) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [c_current_cdemo_sk#50] +Right keys [1]: [cd_demo_sk#64] +Join condition: NOT (cd_marital_status#62 = cd_marital_status#65) + +(70) Project [codegen id : 25] +Output [14]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60] +Input [18]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, cd_marital_status#62, cd_demo_sk#64, cd_marital_status#65] + +(71) Scan parquet default.promotion +Output [1]: [p_promo_sk#66] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_promo_sk)] +ReadSchema: struct + +(72) ColumnarToRow [codegen id : 17] +Input [1]: [p_promo_sk#66] + +(73) Filter [codegen id : 17] +Input [1]: [p_promo_sk#66] +Condition : isnotnull(p_promo_sk#66) + +(74) BroadcastExchange +Input [1]: [p_promo_sk#66] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#67] + +(75) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_promo_sk#7] +Right keys [1]: [p_promo_sk#66] +Join condition: None + +(76) Project [codegen id : 25] +Output [13]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60] +Input [15]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, p_promo_sk#66] + +(77) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#68, hd_income_band_sk#69] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_demo_sk), IsNotNull(hd_income_band_sk)] +ReadSchema: struct + +(78) ColumnarToRow [codegen id : 18] +Input [2]: [hd_demo_sk#68, hd_income_band_sk#69] + +(79) Filter [codegen id : 18] +Input [2]: [hd_demo_sk#68, hd_income_band_sk#69] +Condition : (isnotnull(hd_demo_sk#68) AND isnotnull(hd_income_band_sk#69)) + +(80) BroadcastExchange +Input [2]: [hd_demo_sk#68, hd_income_band_sk#69] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#70] + +(81) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_hdemo_sk#4] +Right keys [1]: [hd_demo_sk#68] +Join condition: None + +(82) Project [codegen id : 25] +Output [13]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, hd_income_band_sk#69] +Input [15]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, hd_demo_sk#68, hd_income_band_sk#69] + +(83) ReusedExchange [Reuses operator id: 80] +Output [2]: [hd_demo_sk#71, hd_income_band_sk#72] + +(84) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [c_current_hdemo_sk#51] +Right keys [1]: [hd_demo_sk#71] +Join condition: None + +(85) Project [codegen id : 25] +Output [13]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_addr_sk#52, d_year#57, d_year#60, hd_income_band_sk#69, hd_income_band_sk#72] +Input [15]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, hd_income_band_sk#69, hd_demo_sk#71, hd_income_band_sk#72] + +(86) Scan parquet default.customer_address +Output [5]: [ca_address_sk#73, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(87) ColumnarToRow [codegen id : 20] +Input [5]: [ca_address_sk#73, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77] + +(88) Filter [codegen id : 20] +Input [5]: [ca_address_sk#73, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77] +Condition : isnotnull(ca_address_sk#73) + +(89) BroadcastExchange +Input [5]: [ca_address_sk#73, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#78] + +(90) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_addr_sk#5] +Right keys [1]: [ca_address_sk#73] +Join condition: None + +(91) Project [codegen id : 25] +Output [16]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_addr_sk#52, d_year#57, d_year#60, hd_income_band_sk#69, hd_income_band_sk#72, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77] +Input [18]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_addr_sk#52, d_year#57, d_year#60, hd_income_band_sk#69, hd_income_band_sk#72, ca_address_sk#73, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77] + +(92) ReusedExchange [Reuses operator id: 89] +Output [5]: [ca_address_sk#79, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83] + +(93) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [c_current_addr_sk#52] +Right keys [1]: [ca_address_sk#79] +Join condition: None + +(94) Project [codegen id : 25] +Output [19]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, d_year#57, d_year#60, hd_income_band_sk#69, hd_income_band_sk#72, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83] +Input [21]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_addr_sk#52, d_year#57, d_year#60, hd_income_band_sk#69, hd_income_band_sk#72, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_address_sk#79, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83] + +(95) Scan parquet default.income_band +Output [1]: [ib_income_band_sk#84] +Batched: true +Location [not included in comparison]/{warehouse_dir}/income_band] +PushedFilters: [IsNotNull(ib_income_band_sk)] +ReadSchema: struct + +(96) ColumnarToRow [codegen id : 22] +Input [1]: [ib_income_band_sk#84] + +(97) Filter [codegen id : 22] +Input [1]: [ib_income_band_sk#84] +Condition : isnotnull(ib_income_band_sk#84) + +(98) BroadcastExchange +Input [1]: [ib_income_band_sk#84] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#85] + +(99) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [hd_income_band_sk#69] +Right keys [1]: [ib_income_band_sk#84] +Join condition: None + +(100) Project [codegen id : 25] +Output [18]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, d_year#57, d_year#60, hd_income_band_sk#72, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83] +Input [20]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, d_year#57, d_year#60, hd_income_band_sk#69, hd_income_band_sk#72, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, ib_income_band_sk#84] + +(101) ReusedExchange [Reuses operator id: 98] +Output [1]: [ib_income_band_sk#86] + +(102) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [hd_income_band_sk#72] +Right keys [1]: [ib_income_band_sk#86] +Join condition: None + +(103) Project [codegen id : 25] +Output [17]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, d_year#57, d_year#60, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83] +Input [19]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, d_year#57, d_year#60, hd_income_band_sk#72, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, ib_income_band_sk#86] + +(104) Scan parquet default.item +Output [4]: [i_item_sk#87, i_current_price#88, i_color#89, i_product_name#90] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), In(i_color, [purple ,burlywood ,indian ,spring ,floral ,medium ]), GreaterThanOrEqual(i_current_price,64.00), LessThanOrEqual(i_current_price,74.00), GreaterThanOrEqual(i_current_price,65.00), LessThanOrEqual(i_current_price,79.00), IsNotNull(i_item_sk)] +ReadSchema: struct + +(105) ColumnarToRow [codegen id : 24] +Input [4]: [i_item_sk#87, i_current_price#88, i_color#89, i_product_name#90] + +(106) Filter [codegen id : 24] +Input [4]: [i_item_sk#87, i_current_price#88, i_color#89, i_product_name#90] +Condition : ((((((isnotnull(i_current_price#88) AND i_color#89 IN (purple ,burlywood ,indian ,spring ,floral ,medium )) AND (i_current_price#88 >= 64.00)) AND (i_current_price#88 <= 74.00)) AND (i_current_price#88 >= 65.00)) AND (i_current_price#88 <= 79.00)) AND isnotnull(i_item_sk#87)) + +(107) Project [codegen id : 24] +Output [2]: [i_item_sk#87, i_product_name#90] +Input [4]: [i_item_sk#87, i_current_price#88, i_color#89, i_product_name#90] + +(108) BroadcastExchange +Input [2]: [i_item_sk#87, i_product_name#90] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#91] + +(109) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#87] +Join condition: None + +(110) Project [codegen id : 25] +Output [18]: [ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, d_year#57, d_year#60, s_store_name#46, s_zip#47, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, i_item_sk#87, i_product_name#90] +Input [19]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, d_year#57, d_year#60, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, i_item_sk#87, i_product_name#90] + +(111) HashAggregate [codegen id : 25] +Input [18]: [ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, d_year#57, d_year#60, s_store_name#46, s_zip#47, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, i_item_sk#87, i_product_name#90] +Keys [15]: [i_product_name#90, i_item_sk#87, s_store_name#46, s_zip#47, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, d_year#43, d_year#57, d_year#60] +Functions [4]: [partial_count(1), partial_sum(UnscaledValue(ss_wholesale_cost#9)), partial_sum(UnscaledValue(ss_list_price#10)), partial_sum(UnscaledValue(ss_coupon_amt#11))] +Aggregate Attributes [4]: [count#92, sum#93, sum#94, sum#95] +Results [19]: [i_product_name#90, i_item_sk#87, s_store_name#46, s_zip#47, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, d_year#43, d_year#57, d_year#60, count#96, sum#97, sum#98, sum#99] + +(112) HashAggregate [codegen id : 25] +Input [19]: [i_product_name#90, i_item_sk#87, s_store_name#46, s_zip#47, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, d_year#43, d_year#57, d_year#60, count#96, sum#97, sum#98, sum#99] +Keys [15]: [i_product_name#90, i_item_sk#87, s_store_name#46, s_zip#47, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, d_year#43, d_year#57, d_year#60] +Functions [4]: [count(1), sum(UnscaledValue(ss_wholesale_cost#9)), sum(UnscaledValue(ss_list_price#10)), sum(UnscaledValue(ss_coupon_amt#11))] +Aggregate Attributes [4]: [count(1)#100, sum(UnscaledValue(ss_wholesale_cost#9))#101, sum(UnscaledValue(ss_list_price#10))#102, sum(UnscaledValue(ss_coupon_amt#11))#103] +Results [17]: [i_product_name#90 AS product_name#104, i_item_sk#87 AS item_sk#105, s_store_name#46 AS store_name#106, s_zip#47 AS store_zip#107, ca_street_number#74 AS b_street_number#108, ca_street_name#75 AS b_streen_name#109, ca_city#76 AS b_city#110, ca_zip#77 AS b_zip#111, ca_street_number#80 AS c_street_number#112, ca_street_name#81 AS c_street_name#113, ca_city#82 AS c_city#114, ca_zip#83 AS c_zip#115, d_year#43 AS syear#116, count(1)#100 AS cnt#117, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#9))#101,17,2) AS s1#118, MakeDecimal(sum(UnscaledValue(ss_list_price#10))#102,17,2) AS s2#119, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#11))#103,17,2) AS s3#120] + +(113) Exchange +Input [17]: [product_name#104, item_sk#105, store_name#106, store_zip#107, b_street_number#108, b_streen_name#109, b_city#110, b_zip#111, c_street_number#112, c_street_name#113, c_city#114, c_zip#115, syear#116, cnt#117, s1#118, s2#119, s3#120] +Arguments: hashpartitioning(item_sk#105, store_name#106, store_zip#107, 5), ENSURE_REQUIREMENTS, [id=#121] + +(114) Sort [codegen id : 26] +Input [17]: [product_name#104, item_sk#105, store_name#106, store_zip#107, b_street_number#108, b_streen_name#109, b_city#110, b_zip#111, c_street_number#112, c_street_name#113, c_city#114, c_zip#115, syear#116, cnt#117, s1#118, s2#119, s3#120] +Arguments: [item_sk#105 ASC NULLS FIRST, store_name#106 ASC NULLS FIRST, store_zip#107 ASC NULLS FIRST], false, 0 + +(115) Scan parquet default.store_sales +Output [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_ticket_number#129, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#133), dynamicpruningexpression(ss_sold_date_sk#133 IN dynamicpruning#134)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_promo_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(116) ColumnarToRow [codegen id : 27] +Input [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_ticket_number#129, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] + +(117) Filter [codegen id : 27] +Input [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_ticket_number#129, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Condition : (((((((isnotnull(ss_item_sk#122) AND isnotnull(ss_ticket_number#129)) AND isnotnull(ss_store_sk#127)) AND isnotnull(ss_customer_sk#123)) AND isnotnull(ss_cdemo_sk#124)) AND isnotnull(ss_promo_sk#128)) AND isnotnull(ss_hdemo_sk#125)) AND isnotnull(ss_addr_sk#126)) + +(118) BroadcastExchange +Input [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_ticket_number#129, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[7, int, false] as bigint) & 4294967295))),false), [id=#135] + +(119) Scan parquet default.store_returns +Output [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(120) ColumnarToRow +Input [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] + +(121) Filter +Input [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] +Condition : (isnotnull(sr_item_sk#136) AND isnotnull(sr_ticket_number#137)) + +(122) Project +Output [2]: [sr_item_sk#136, sr_ticket_number#137] +Input [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] + +(123) BroadcastHashJoin [codegen id : 28] +Left keys [2]: [ss_item_sk#122, ss_ticket_number#129] +Right keys [2]: [sr_item_sk#136, sr_ticket_number#137] +Join condition: None + +(124) Project [codegen id : 28] +Output [11]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Input [14]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_ticket_number#129, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133, sr_item_sk#136, sr_ticket_number#137] + +(125) Exchange +Input [11]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Arguments: hashpartitioning(ss_item_sk#122, 5), ENSURE_REQUIREMENTS, [id=#139] + +(126) Sort [codegen id : 29] +Input [11]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Arguments: [ss_item_sk#122 ASC NULLS FIRST], false, 0 + +(127) ReusedExchange [Reuses operator id: 28] +Output [4]: [cs_item_sk#140, sum#141, sum#142, isEmpty#143] + +(128) HashAggregate [codegen id : 35] +Input [4]: [cs_item_sk#140, sum#141, sum#142, isEmpty#143] +Keys [1]: [cs_item_sk#140] +Functions [2]: [sum(UnscaledValue(cs_ext_list_price#144)), sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_list_price#144))#148, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))#149] +Results [3]: [cs_item_sk#140, MakeDecimal(sum(UnscaledValue(cs_ext_list_price#144))#148,17,2) AS sum(cs_ext_list_price#144)#150, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))#149 AS sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))#151] + +(129) Filter [codegen id : 35] +Input [3]: [cs_item_sk#140, sum(cs_ext_list_price#144)#150, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))#151] +Condition : (isnotnull(sum(cs_ext_list_price#144)#150) AND (cast(sum(cs_ext_list_price#144)#150 as decimal(21,2)) > CheckOverflow((2.00 * promote_precision(sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))#151)), DecimalType(21,2), true))) + +(130) Project [codegen id : 35] +Output [1]: [cs_item_sk#140] +Input [3]: [cs_item_sk#140, sum(cs_ext_list_price#144)#150, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))#151] + +(131) Sort [codegen id : 35] +Input [1]: [cs_item_sk#140] +Arguments: [cs_item_sk#140 ASC NULLS FIRST], false, 0 + +(132) SortMergeJoin [codegen id : 51] +Left keys [1]: [ss_item_sk#122] +Right keys [1]: [cs_item_sk#140] +Join condition: None + +(133) Project [codegen id : 51] +Output [11]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Input [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133, cs_item_sk#140] + +(134) Scan parquet default.date_dim +Output [2]: [d_date_sk#152, d_year#153] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(135) ColumnarToRow [codegen id : 36] +Input [2]: [d_date_sk#152, d_year#153] + +(136) Filter [codegen id : 36] +Input [2]: [d_date_sk#152, d_year#153] +Condition : ((isnotnull(d_year#153) AND (d_year#153 = 2000)) AND isnotnull(d_date_sk#152)) + +(137) BroadcastExchange +Input [2]: [d_date_sk#152, d_year#153] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#154] + +(138) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_sold_date_sk#133] +Right keys [1]: [d_date_sk#152] +Join condition: None + +(139) Project [codegen id : 51] +Output [11]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153] +Input [13]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133, d_date_sk#152, d_year#153] + +(140) ReusedExchange [Reuses operator id: 44] +Output [3]: [s_store_sk#155, s_store_name#156, s_zip#157] + +(141) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_store_sk#127] +Right keys [1]: [s_store_sk#155] +Join condition: None + +(142) Project [codegen id : 51] +Output [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157] +Input [14]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_sk#155, s_store_name#156, s_zip#157] + +(143) ReusedExchange [Reuses operator id: 50] +Output [6]: [c_customer_sk#158, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, c_first_shipto_date_sk#162, c_first_sales_date_sk#163] + +(144) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_customer_sk#123] +Right keys [1]: [c_customer_sk#158] +Join condition: None + +(145) Project [codegen id : 51] +Output [16]: [ss_item_sk#122, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, c_first_shipto_date_sk#162, c_first_sales_date_sk#163] +Input [18]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_customer_sk#158, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, c_first_shipto_date_sk#162, c_first_sales_date_sk#163] + +(146) ReusedExchange [Reuses operator id: 56] +Output [2]: [d_date_sk#164, d_year#165] + +(147) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [c_first_sales_date_sk#163] +Right keys [1]: [d_date_sk#164] +Join condition: None + +(148) Project [codegen id : 51] +Output [16]: [ss_item_sk#122, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, c_first_shipto_date_sk#162, d_year#165] +Input [18]: [ss_item_sk#122, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, c_first_shipto_date_sk#162, c_first_sales_date_sk#163, d_date_sk#164, d_year#165] + +(149) ReusedExchange [Reuses operator id: 56] +Output [2]: [d_date_sk#166, d_year#167] + +(150) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [c_first_shipto_date_sk#162] +Right keys [1]: [d_date_sk#166] +Join condition: None + +(151) Project [codegen id : 51] +Output [16]: [ss_item_sk#122, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167] +Input [18]: [ss_item_sk#122, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, c_first_shipto_date_sk#162, d_year#165, d_date_sk#166, d_year#167] + +(152) ReusedExchange [Reuses operator id: 65] +Output [2]: [cd_demo_sk#168, cd_marital_status#169] + +(153) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_cdemo_sk#124] +Right keys [1]: [cd_demo_sk#168] +Join condition: None + +(154) Project [codegen id : 51] +Output [16]: [ss_item_sk#122, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, cd_marital_status#169] +Input [18]: [ss_item_sk#122, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, cd_demo_sk#168, cd_marital_status#169] + +(155) ReusedExchange [Reuses operator id: 65] +Output [2]: [cd_demo_sk#170, cd_marital_status#171] + +(156) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [c_current_cdemo_sk#159] +Right keys [1]: [cd_demo_sk#170] +Join condition: NOT (cd_marital_status#169 = cd_marital_status#171) + +(157) Project [codegen id : 51] +Output [14]: [ss_item_sk#122, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167] +Input [18]: [ss_item_sk#122, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, cd_marital_status#169, cd_demo_sk#170, cd_marital_status#171] + +(158) ReusedExchange [Reuses operator id: 74] +Output [1]: [p_promo_sk#172] + +(159) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_promo_sk#128] +Right keys [1]: [p_promo_sk#172] +Join condition: None + +(160) Project [codegen id : 51] +Output [13]: [ss_item_sk#122, ss_hdemo_sk#125, ss_addr_sk#126, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167] +Input [15]: [ss_item_sk#122, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, p_promo_sk#172] + +(161) ReusedExchange [Reuses operator id: 80] +Output [2]: [hd_demo_sk#173, hd_income_band_sk#174] + +(162) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_hdemo_sk#125] +Right keys [1]: [hd_demo_sk#173] +Join condition: None + +(163) Project [codegen id : 51] +Output [13]: [ss_item_sk#122, ss_addr_sk#126, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, hd_income_band_sk#174] +Input [15]: [ss_item_sk#122, ss_hdemo_sk#125, ss_addr_sk#126, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, hd_demo_sk#173, hd_income_band_sk#174] + +(164) ReusedExchange [Reuses operator id: 80] +Output [2]: [hd_demo_sk#175, hd_income_band_sk#176] + +(165) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [c_current_hdemo_sk#160] +Right keys [1]: [hd_demo_sk#175] +Join condition: None + +(166) Project [codegen id : 51] +Output [13]: [ss_item_sk#122, ss_addr_sk#126, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_addr_sk#161, d_year#165, d_year#167, hd_income_band_sk#174, hd_income_band_sk#176] +Input [15]: [ss_item_sk#122, ss_addr_sk#126, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, hd_income_band_sk#174, hd_demo_sk#175, hd_income_band_sk#176] + +(167) ReusedExchange [Reuses operator id: 89] +Output [5]: [ca_address_sk#177, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181] + +(168) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_addr_sk#126] +Right keys [1]: [ca_address_sk#177] +Join condition: None + +(169) Project [codegen id : 51] +Output [16]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_addr_sk#161, d_year#165, d_year#167, hd_income_band_sk#174, hd_income_band_sk#176, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181] +Input [18]: [ss_item_sk#122, ss_addr_sk#126, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_addr_sk#161, d_year#165, d_year#167, hd_income_band_sk#174, hd_income_band_sk#176, ca_address_sk#177, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181] + +(170) ReusedExchange [Reuses operator id: 89] +Output [5]: [ca_address_sk#182, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186] + +(171) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [c_current_addr_sk#161] +Right keys [1]: [ca_address_sk#182] +Join condition: None + +(172) Project [codegen id : 51] +Output [19]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, d_year#165, d_year#167, hd_income_band_sk#174, hd_income_band_sk#176, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186] +Input [21]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_addr_sk#161, d_year#165, d_year#167, hd_income_band_sk#174, hd_income_band_sk#176, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_address_sk#182, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186] + +(173) ReusedExchange [Reuses operator id: 98] +Output [1]: [ib_income_band_sk#187] + +(174) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [hd_income_band_sk#174] +Right keys [1]: [ib_income_band_sk#187] +Join condition: None + +(175) Project [codegen id : 51] +Output [18]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, d_year#165, d_year#167, hd_income_band_sk#176, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186] +Input [20]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, d_year#165, d_year#167, hd_income_band_sk#174, hd_income_band_sk#176, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, ib_income_band_sk#187] + +(176) ReusedExchange [Reuses operator id: 98] +Output [1]: [ib_income_band_sk#188] + +(177) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [hd_income_band_sk#176] +Right keys [1]: [ib_income_band_sk#188] +Join condition: None + +(178) Project [codegen id : 51] +Output [17]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, d_year#165, d_year#167, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186] +Input [19]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, d_year#165, d_year#167, hd_income_band_sk#176, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, ib_income_band_sk#188] + +(179) ReusedExchange [Reuses operator id: 108] +Output [2]: [i_item_sk#189, i_product_name#190] + +(180) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_item_sk#122] +Right keys [1]: [i_item_sk#189] +Join condition: None + +(181) Project [codegen id : 51] +Output [18]: [ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, d_year#165, d_year#167, s_store_name#156, s_zip#157, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, i_item_sk#189, i_product_name#190] +Input [19]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, d_year#165, d_year#167, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, i_item_sk#189, i_product_name#190] + +(182) HashAggregate [codegen id : 51] +Input [18]: [ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, d_year#165, d_year#167, s_store_name#156, s_zip#157, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, i_item_sk#189, i_product_name#190] +Keys [15]: [i_product_name#190, i_item_sk#189, s_store_name#156, s_zip#157, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, d_year#153, d_year#165, d_year#167] +Functions [4]: [partial_count(1), partial_sum(UnscaledValue(ss_wholesale_cost#130)), partial_sum(UnscaledValue(ss_list_price#131)), partial_sum(UnscaledValue(ss_coupon_amt#132))] +Aggregate Attributes [4]: [count#191, sum#192, sum#193, sum#194] +Results [19]: [i_product_name#190, i_item_sk#189, s_store_name#156, s_zip#157, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, d_year#153, d_year#165, d_year#167, count#195, sum#196, sum#197, sum#198] + +(183) HashAggregate [codegen id : 51] +Input [19]: [i_product_name#190, i_item_sk#189, s_store_name#156, s_zip#157, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, d_year#153, d_year#165, d_year#167, count#195, sum#196, sum#197, sum#198] +Keys [15]: [i_product_name#190, i_item_sk#189, s_store_name#156, s_zip#157, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, d_year#153, d_year#165, d_year#167] +Functions [4]: [count(1), sum(UnscaledValue(ss_wholesale_cost#130)), sum(UnscaledValue(ss_list_price#131)), sum(UnscaledValue(ss_coupon_amt#132))] +Aggregate Attributes [4]: [count(1)#199, sum(UnscaledValue(ss_wholesale_cost#130))#200, sum(UnscaledValue(ss_list_price#131))#201, sum(UnscaledValue(ss_coupon_amt#132))#202] +Results [8]: [i_item_sk#189 AS item_sk#203, s_store_name#156 AS store_name#204, s_zip#157 AS store_zip#205, d_year#153 AS syear#206, count(1)#199 AS cnt#207, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#130))#200,17,2) AS s1#208, MakeDecimal(sum(UnscaledValue(ss_list_price#131))#201,17,2) AS s2#209, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#132))#202,17,2) AS s3#210] + +(184) Exchange +Input [8]: [item_sk#203, store_name#204, store_zip#205, syear#206, cnt#207, s1#208, s2#209, s3#210] +Arguments: hashpartitioning(item_sk#203, store_name#204, store_zip#205, 5), ENSURE_REQUIREMENTS, [id=#211] + +(185) Sort [codegen id : 52] +Input [8]: [item_sk#203, store_name#204, store_zip#205, syear#206, cnt#207, s1#208, s2#209, s3#210] +Arguments: [item_sk#203 ASC NULLS FIRST, store_name#204 ASC NULLS FIRST, store_zip#205 ASC NULLS FIRST], false, 0 + +(186) SortMergeJoin [codegen id : 53] +Left keys [3]: [item_sk#105, store_name#106, store_zip#107] +Right keys [3]: [item_sk#203, store_name#204, store_zip#205] +Join condition: (cnt#207 <= cnt#117) + +(187) Project [codegen id : 53] +Output [21]: [product_name#104, store_name#106, store_zip#107, b_street_number#108, b_streen_name#109, b_city#110, b_zip#111, c_street_number#112, c_street_name#113, c_city#114, c_zip#115, syear#116, cnt#117, s1#118, s2#119, s3#120, s1#208, s2#209, s3#210, syear#206, cnt#207] +Input [25]: [product_name#104, item_sk#105, store_name#106, store_zip#107, b_street_number#108, b_streen_name#109, b_city#110, b_zip#111, c_street_number#112, c_street_name#113, c_city#114, c_zip#115, syear#116, cnt#117, s1#118, s2#119, s3#120, item_sk#203, store_name#204, store_zip#205, syear#206, cnt#207, s1#208, s2#209, s3#210] + +(188) Exchange +Input [21]: [product_name#104, store_name#106, store_zip#107, b_street_number#108, b_streen_name#109, b_city#110, b_zip#111, c_street_number#112, c_street_name#113, c_city#114, c_zip#115, syear#116, cnt#117, s1#118, s2#119, s3#120, s1#208, s2#209, s3#210, syear#206, cnt#207] +Arguments: rangepartitioning(product_name#104 ASC NULLS FIRST, store_name#106 ASC NULLS FIRST, cnt#207 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#212] + +(189) Sort [codegen id : 54] +Input [21]: [product_name#104, store_name#106, store_zip#107, b_street_number#108, b_streen_name#109, b_city#110, b_zip#111, c_street_number#112, c_street_name#113, c_city#114, c_zip#115, syear#116, cnt#117, s1#118, s2#119, s3#120, s1#208, s2#209, s3#210, syear#206, cnt#207] +Arguments: [product_name#104 ASC NULLS FIRST, store_name#106 ASC NULLS FIRST, cnt#207 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#12 IN dynamicpruning#13 +ReusedExchange (190) + + +(190) ReusedExchange [Reuses operator id: 38] +Output [2]: [d_date_sk#42, d_year#43] + +Subquery:2 Hosting operator id = 115 Hosting Expression = ss_sold_date_sk#133 IN dynamicpruning#134 +ReusedExchange (191) + + +(191) ReusedExchange [Reuses operator id: 137] +Output [2]: [d_date_sk#152, d_year#153] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64/simplified.txt new file mode 100644 index 0000000000000..4a0006b2db5ca --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q64/simplified.txt @@ -0,0 +1,289 @@ +WholeStageCodegen (54) + Sort [product_name,store_name,cnt] + InputAdapter + Exchange [product_name,store_name,cnt] #1 + WholeStageCodegen (53) + Project [product_name,store_name,store_zip,b_street_number,b_streen_name,b_city,b_zip,c_street_number,c_street_name,c_city,c_zip,syear,cnt,s1,s2,s3,s1,s2,s3,syear,cnt] + SortMergeJoin [item_sk,store_name,store_zip,item_sk,store_name,store_zip,cnt,cnt] + InputAdapter + WholeStageCodegen (26) + Sort [item_sk,store_name,store_zip] + InputAdapter + Exchange [item_sk,store_name,store_zip] #2 + WholeStageCodegen (25) + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,count,sum,sum,sum] [count(1),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_list_price)),sum(UnscaledValue(ss_coupon_amt)),product_name,item_sk,store_name,store_zip,b_street_number,b_streen_name,b_city,b_zip,c_street_number,c_street_name,c_city,c_zip,syear,cnt,s1,s2,s3,count,sum,sum,sum] + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,ss_wholesale_cost,ss_list_price,ss_coupon_amt] [count,sum,sum,sum,count,sum,sum,sum] + Project [ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,d_year,d_year,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,i_item_sk,i_product_name] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,hd_income_band_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk,cd_marital_status,cd_marital_status] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,cd_marital_status] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [c_first_shipto_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,d_year] + BroadcastHashJoin [c_first_sales_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SortMergeJoin [ss_item_sk,cs_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #3 + WholeStageCodegen (2) + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_ticket_number,ss_store_sk,ss_customer_sk,ss_cdemo_sk,ss_promo_sk,ss_hdemo_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #5 + Project [sr_item_sk,sr_ticket_number] + Filter [sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + WholeStageCodegen (9) + Sort [cs_item_sk] + Project [cs_item_sk] + Filter [sum(cs_ext_list_price),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true))] + HashAggregate [cs_item_sk,sum,sum,isEmpty] [sum(UnscaledValue(cs_ext_list_price)),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true)),sum(cs_ext_list_price),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true)),sum,sum,isEmpty] + InputAdapter + Exchange [cs_item_sk] #6 + WholeStageCodegen (8) + HashAggregate [cs_item_sk,cs_ext_list_price,cr_refunded_cash,cr_reversed_charge,cr_store_credit] [sum,sum,isEmpty,sum,sum,isEmpty] + Project [cs_item_sk,cs_ext_list_price,cr_refunded_cash,cr_reversed_charge,cr_store_credit] + SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] + InputAdapter + WholeStageCodegen (5) + Sort [cs_item_sk,cs_order_number] + InputAdapter + Exchange [cs_item_sk,cs_order_number] #7 + WholeStageCodegen (4) + Project [cs_item_sk,cs_order_number,cs_ext_list_price] + Filter [cs_item_sk,cs_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_ext_list_price,cs_sold_date_sk] + InputAdapter + WholeStageCodegen (7) + Sort [cr_item_sk,cr_order_number] + InputAdapter + Exchange [cr_item_sk,cr_order_number] #8 + WholeStageCodegen (6) + Project [cr_item_sk,cr_order_number,cr_refunded_cash,cr_reversed_charge,cr_store_credit] + Filter [cr_item_sk,cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_refunded_cash,cr_reversed_charge,cr_store_credit,cr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (10) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (11) + Filter [s_store_sk,s_store_name,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_zip] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (12) + Filter [c_customer_sk,c_first_sales_date_sk,c_first_shipto_date_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (13) + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + ReusedExchange [d_date_sk,d_year] #11 + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (15) + Filter [cd_demo_sk,cd_marital_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status] + InputAdapter + ReusedExchange [cd_demo_sk,cd_marital_status] #12 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (17) + Filter [p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk] + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (18) + Filter [hd_demo_sk,hd_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_income_band_sk] + InputAdapter + ReusedExchange [hd_demo_sk,hd_income_band_sk] #14 + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (20) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] + InputAdapter + ReusedExchange [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] #15 + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (22) + Filter [ib_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.income_band [ib_income_band_sk] + InputAdapter + ReusedExchange [ib_income_band_sk] #16 + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (24) + Project [i_item_sk,i_product_name] + Filter [i_current_price,i_color,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_color,i_product_name] + InputAdapter + WholeStageCodegen (52) + Sort [item_sk,store_name,store_zip] + InputAdapter + Exchange [item_sk,store_name,store_zip] #18 + WholeStageCodegen (51) + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,count,sum,sum,sum] [count(1),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_list_price)),sum(UnscaledValue(ss_coupon_amt)),item_sk,store_name,store_zip,syear,cnt,s1,s2,s3,count,sum,sum,sum] + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,ss_wholesale_cost,ss_list_price,ss_coupon_amt] [count,sum,sum,sum,count,sum,sum,sum] + Project [ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,d_year,d_year,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,i_item_sk,i_product_name] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,hd_income_band_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk,cd_marital_status,cd_marital_status] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,cd_marital_status] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [c_first_shipto_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,d_year] + BroadcastHashJoin [c_first_sales_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SortMergeJoin [ss_item_sk,cs_item_sk] + InputAdapter + WholeStageCodegen (29) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #19 + WholeStageCodegen (28) + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + BroadcastExchange #20 + WholeStageCodegen (27) + Filter [ss_item_sk,ss_ticket_number,ss_store_sk,ss_customer_sk,ss_cdemo_sk,ss_promo_sk,ss_hdemo_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #21 + Project [sr_item_sk,sr_ticket_number] + Filter [sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + WholeStageCodegen (35) + Sort [cs_item_sk] + Project [cs_item_sk] + Filter [sum(cs_ext_list_price),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true))] + HashAggregate [cs_item_sk,sum,sum,isEmpty] [sum(UnscaledValue(cs_ext_list_price)),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true)),sum(cs_ext_list_price),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true)),sum,sum,isEmpty] + InputAdapter + ReusedExchange [cs_item_sk,sum,sum,isEmpty] #6 + InputAdapter + BroadcastExchange #21 + WholeStageCodegen (36) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + ReusedExchange [s_store_sk,s_store_name,s_zip] #9 + InputAdapter + ReusedExchange [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] #10 + InputAdapter + ReusedExchange [d_date_sk,d_year] #11 + InputAdapter + ReusedExchange [d_date_sk,d_year] #11 + InputAdapter + ReusedExchange [cd_demo_sk,cd_marital_status] #12 + InputAdapter + ReusedExchange [cd_demo_sk,cd_marital_status] #12 + InputAdapter + ReusedExchange [p_promo_sk] #13 + InputAdapter + ReusedExchange [hd_demo_sk,hd_income_band_sk] #14 + InputAdapter + ReusedExchange [hd_demo_sk,hd_income_band_sk] #14 + InputAdapter + ReusedExchange [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] #15 + InputAdapter + ReusedExchange [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] #15 + InputAdapter + ReusedExchange [ib_income_band_sk] #16 + InputAdapter + ReusedExchange [ib_income_band_sk] #16 + InputAdapter + ReusedExchange [i_item_sk,i_product_name] #17 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/explain.txt new file mode 100644 index 0000000000000..84e49ab9373e4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/explain.txt @@ -0,0 +1,274 @@ +== Physical Plan == +TakeOrderedAndProject (45) ++- * Project (44) + +- * SortMergeJoin Inner (43) + :- * Sort (37) + : +- Exchange (36) + : +- * Project (35) + : +- * BroadcastHashJoin Inner BuildRight (34) + : :- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Filter (14) + : : : +- * HashAggregate (13) + : : : +- Exchange (12) + : : : +- * HashAggregate (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (27) + : : +- * HashAggregate (26) + : : +- Exchange (25) + : : +- * HashAggregate (24) + : : +- * HashAggregate (23) + : : +- Exchange (22) + : : +- * HashAggregate (21) + : : +- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Filter (17) + : : : +- * ColumnarToRow (16) + : : : +- Scan parquet default.store_sales (15) + : : +- ReusedExchange (18) + : +- BroadcastExchange (33) + : +- * Filter (32) + : +- * ColumnarToRow (31) + : +- Scan parquet default.store (30) + +- * Sort (42) + +- Exchange (41) + +- * Filter (40) + +- * ColumnarToRow (39) + +- Scan parquet default.item (38) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 2] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_month_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1176), LessThanOrEqual(d_month_seq,1187), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] +Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1176)) AND (d_month_seq#7 <= 1187)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_month_seq#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 2] +Output [3]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4, d_date_sk#6] + +(11) HashAggregate [codegen id : 2] +Input [3]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3] +Keys [2]: [ss_store_sk#2, ss_item_sk#1] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#3))] +Aggregate Attributes [1]: [sum#9] +Results [3]: [ss_store_sk#2, ss_item_sk#1, sum#10] + +(12) Exchange +Input [3]: [ss_store_sk#2, ss_item_sk#1, sum#10] +Arguments: hashpartitioning(ss_store_sk#2, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#11] + +(13) HashAggregate [codegen id : 8] +Input [3]: [ss_store_sk#2, ss_item_sk#1, sum#10] +Keys [2]: [ss_store_sk#2, ss_item_sk#1] +Functions [1]: [sum(UnscaledValue(ss_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#3))#12] +Results [3]: [ss_store_sk#2, ss_item_sk#1, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#12,17,2) AS revenue#13] + +(14) Filter [codegen id : 8] +Input [3]: [ss_store_sk#2, ss_item_sk#1, revenue#13] +Condition : isnotnull(revenue#13) + +(15) Scan parquet default.store_sales +Output [4]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, ss_sold_date_sk#17] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#17), dynamicpruningexpression(ss_sold_date_sk#17 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 4] +Input [4]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, ss_sold_date_sk#17] + +(17) Filter [codegen id : 4] +Input [4]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, ss_sold_date_sk#17] +Condition : isnotnull(ss_store_sk#15) + +(18) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#18] + +(19) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#17] +Right keys [1]: [d_date_sk#18] +Join condition: None + +(20) Project [codegen id : 4] +Output [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +Input [5]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16, ss_sold_date_sk#17, d_date_sk#18] + +(21) HashAggregate [codegen id : 4] +Input [3]: [ss_item_sk#14, ss_store_sk#15, ss_sales_price#16] +Keys [2]: [ss_store_sk#15, ss_item_sk#14] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#16))] +Aggregate Attributes [1]: [sum#19] +Results [3]: [ss_store_sk#15, ss_item_sk#14, sum#20] + +(22) Exchange +Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#20] +Arguments: hashpartitioning(ss_store_sk#15, ss_item_sk#14, 5), ENSURE_REQUIREMENTS, [id=#21] + +(23) HashAggregate [codegen id : 5] +Input [3]: [ss_store_sk#15, ss_item_sk#14, sum#20] +Keys [2]: [ss_store_sk#15, ss_item_sk#14] +Functions [1]: [sum(UnscaledValue(ss_sales_price#16))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#16))#22] +Results [2]: [ss_store_sk#15, MakeDecimal(sum(UnscaledValue(ss_sales_price#16))#22,17,2) AS revenue#23] + +(24) HashAggregate [codegen id : 5] +Input [2]: [ss_store_sk#15, revenue#23] +Keys [1]: [ss_store_sk#15] +Functions [1]: [partial_avg(revenue#23)] +Aggregate Attributes [2]: [sum#24, count#25] +Results [3]: [ss_store_sk#15, sum#26, count#27] + +(25) Exchange +Input [3]: [ss_store_sk#15, sum#26, count#27] +Arguments: hashpartitioning(ss_store_sk#15, 5), ENSURE_REQUIREMENTS, [id=#28] + +(26) HashAggregate [codegen id : 6] +Input [3]: [ss_store_sk#15, sum#26, count#27] +Keys [1]: [ss_store_sk#15] +Functions [1]: [avg(revenue#23)] +Aggregate Attributes [1]: [avg(revenue#23)#29] +Results [2]: [ss_store_sk#15, avg(revenue#23)#29 AS ave#30] + +(27) BroadcastExchange +Input [2]: [ss_store_sk#15, ave#30] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#31] + +(28) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [ss_store_sk#15] +Join condition: (cast(revenue#13 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#30)), DecimalType(23,7), true)) + +(29) Project [codegen id : 8] +Output [3]: [ss_store_sk#2, ss_item_sk#1, revenue#13] +Input [5]: [ss_store_sk#2, ss_item_sk#1, revenue#13, ss_store_sk#15, ave#30] + +(30) Scan parquet default.store +Output [2]: [s_store_sk#32, s_store_name#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 7] +Input [2]: [s_store_sk#32, s_store_name#33] + +(32) Filter [codegen id : 7] +Input [2]: [s_store_sk#32, s_store_name#33] +Condition : isnotnull(s_store_sk#32) + +(33) BroadcastExchange +Input [2]: [s_store_sk#32, s_store_name#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#34] + +(34) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#32] +Join condition: None + +(35) Project [codegen id : 8] +Output [3]: [ss_item_sk#1, revenue#13, s_store_name#33] +Input [5]: [ss_store_sk#2, ss_item_sk#1, revenue#13, s_store_sk#32, s_store_name#33] + +(36) Exchange +Input [3]: [ss_item_sk#1, revenue#13, s_store_name#33] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#35] + +(37) Sort [codegen id : 9] +Input [3]: [ss_item_sk#1, revenue#13, s_store_name#33] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(38) Scan parquet default.item +Output [5]: [i_item_sk#36, i_item_desc#37, i_current_price#38, i_wholesale_cost#39, i_brand#40] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 10] +Input [5]: [i_item_sk#36, i_item_desc#37, i_current_price#38, i_wholesale_cost#39, i_brand#40] + +(40) Filter [codegen id : 10] +Input [5]: [i_item_sk#36, i_item_desc#37, i_current_price#38, i_wholesale_cost#39, i_brand#40] +Condition : isnotnull(i_item_sk#36) + +(41) Exchange +Input [5]: [i_item_sk#36, i_item_desc#37, i_current_price#38, i_wholesale_cost#39, i_brand#40] +Arguments: hashpartitioning(i_item_sk#36, 5), ENSURE_REQUIREMENTS, [id=#41] + +(42) Sort [codegen id : 11] +Input [5]: [i_item_sk#36, i_item_desc#37, i_current_price#38, i_wholesale_cost#39, i_brand#40] +Arguments: [i_item_sk#36 ASC NULLS FIRST], false, 0 + +(43) SortMergeJoin [codegen id : 12] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#36] +Join condition: None + +(44) Project [codegen id : 12] +Output [6]: [s_store_name#33, i_item_desc#37, revenue#13, i_current_price#38, i_wholesale_cost#39, i_brand#40] +Input [8]: [ss_item_sk#1, revenue#13, s_store_name#33, i_item_sk#36, i_item_desc#37, i_current_price#38, i_wholesale_cost#39, i_brand#40] + +(45) TakeOrderedAndProject +Input [6]: [s_store_name#33, i_item_desc#37, revenue#13, i_current_price#38, i_wholesale_cost#39, i_brand#40] +Arguments: 100, [s_store_name#33 ASC NULLS FIRST, i_item_desc#37 ASC NULLS FIRST], [s_store_name#33, i_item_desc#37, revenue#13, i_current_price#38, i_wholesale_cost#39, i_brand#40] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (46) + + +(46) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 15 Hosting Expression = ss_sold_date_sk#17 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/simplified.txt new file mode 100644 index 0000000000000..aed4f13fecfd4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65.sf100/simplified.txt @@ -0,0 +1,75 @@ +TakeOrderedAndProject [s_store_name,i_item_desc,revenue,i_current_price,i_wholesale_cost,i_brand] + WholeStageCodegen (12) + Project [s_store_name,i_item_desc,revenue,i_current_price,i_wholesale_cost,i_brand] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (9) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #1 + WholeStageCodegen (8) + Project [ss_item_sk,revenue,s_store_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_item_sk,revenue] + BroadcastHashJoin [ss_store_sk,ss_store_sk,revenue,ave] + Filter [revenue] + HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] + InputAdapter + Exchange [ss_store_sk,ss_item_sk] #2 + WholeStageCodegen (2) + HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (6) + HashAggregate [ss_store_sk,sum,count] [avg(revenue),ave,sum,count] + InputAdapter + Exchange [ss_store_sk] #5 + WholeStageCodegen (5) + HashAggregate [ss_store_sk,revenue] [sum,count,sum,count] + HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] + InputAdapter + Exchange [ss_store_sk,ss_item_sk] #6 + WholeStageCodegen (4) + HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (7) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name] + InputAdapter + WholeStageCodegen (11) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #8 + WholeStageCodegen (10) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_desc,i_current_price,i_wholesale_cost,i_brand] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65/explain.txt new file mode 100644 index 0000000000000..45c7c051601c5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65/explain.txt @@ -0,0 +1,259 @@ +== Physical Plan == +TakeOrderedAndProject (42) ++- * Project (41) + +- * BroadcastHashJoin Inner BuildRight (40) + :- * Project (26) + : +- * BroadcastHashJoin Inner BuildRight (25) + : :- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store (1) + : : +- BroadcastExchange (18) + : : +- * Filter (17) + : : +- * HashAggregate (16) + : : +- Exchange (15) + : : +- * HashAggregate (14) + : : +- * Project (13) + : : +- * BroadcastHashJoin Inner BuildRight (12) + : : :- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.store_sales (4) + : : +- BroadcastExchange (11) + : : +- * Project (10) + : : +- * Filter (9) + : : +- * ColumnarToRow (8) + : : +- Scan parquet default.date_dim (7) + : +- BroadcastExchange (24) + : +- * Filter (23) + : +- * ColumnarToRow (22) + : +- Scan parquet default.item (21) + +- BroadcastExchange (39) + +- * HashAggregate (38) + +- Exchange (37) + +- * HashAggregate (36) + +- * HashAggregate (35) + +- Exchange (34) + +- * HashAggregate (33) + +- * Project (32) + +- * BroadcastHashJoin Inner BuildRight (31) + :- * Filter (29) + : +- * ColumnarToRow (28) + : +- Scan parquet default.store_sales (27) + +- ReusedExchange (30) + + +(1) Scan parquet default.store +Output [2]: [s_store_sk#1, s_store_name#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [2]: [s_store_sk#1, s_store_name#2] + +(3) Filter [codegen id : 9] +Input [2]: [s_store_sk#1, s_store_name#2] +Condition : isnotnull(s_store_sk#1) + +(4) Scan parquet default.store_sales +Output [4]: [ss_item_sk#3, ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 2] +Input [4]: [ss_item_sk#3, ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] + +(6) Filter [codegen id : 2] +Input [4]: [ss_item_sk#3, ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6] +Condition : (isnotnull(ss_store_sk#4) AND isnotnull(ss_item_sk#3)) + +(7) Scan parquet default.date_dim +Output [2]: [d_date_sk#8, d_month_seq#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1176), LessThanOrEqual(d_month_seq,1187), IsNotNull(d_date_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#8, d_month_seq#9] + +(9) Filter [codegen id : 1] +Input [2]: [d_date_sk#8, d_month_seq#9] +Condition : (((isnotnull(d_month_seq#9) AND (d_month_seq#9 >= 1176)) AND (d_month_seq#9 <= 1187)) AND isnotnull(d_date_sk#8)) + +(10) Project [codegen id : 1] +Output [1]: [d_date_sk#8] +Input [2]: [d_date_sk#8, d_month_seq#9] + +(11) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(12) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(13) Project [codegen id : 2] +Output [3]: [ss_item_sk#3, ss_store_sk#4, ss_sales_price#5] +Input [5]: [ss_item_sk#3, ss_store_sk#4, ss_sales_price#5, ss_sold_date_sk#6, d_date_sk#8] + +(14) HashAggregate [codegen id : 2] +Input [3]: [ss_item_sk#3, ss_store_sk#4, ss_sales_price#5] +Keys [2]: [ss_store_sk#4, ss_item_sk#3] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#5))] +Aggregate Attributes [1]: [sum#11] +Results [3]: [ss_store_sk#4, ss_item_sk#3, sum#12] + +(15) Exchange +Input [3]: [ss_store_sk#4, ss_item_sk#3, sum#12] +Arguments: hashpartitioning(ss_store_sk#4, ss_item_sk#3, 5), ENSURE_REQUIREMENTS, [id=#13] + +(16) HashAggregate [codegen id : 3] +Input [3]: [ss_store_sk#4, ss_item_sk#3, sum#12] +Keys [2]: [ss_store_sk#4, ss_item_sk#3] +Functions [1]: [sum(UnscaledValue(ss_sales_price#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#5))#14] +Results [3]: [ss_store_sk#4, ss_item_sk#3, MakeDecimal(sum(UnscaledValue(ss_sales_price#5))#14,17,2) AS revenue#15] + +(17) Filter [codegen id : 3] +Input [3]: [ss_store_sk#4, ss_item_sk#3, revenue#15] +Condition : isnotnull(revenue#15) + +(18) BroadcastExchange +Input [3]: [ss_store_sk#4, ss_item_sk#3, revenue#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(19) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [s_store_sk#1] +Right keys [1]: [ss_store_sk#4] +Join condition: None + +(20) Project [codegen id : 9] +Output [4]: [s_store_name#2, ss_store_sk#4, ss_item_sk#3, revenue#15] +Input [5]: [s_store_sk#1, s_store_name#2, ss_store_sk#4, ss_item_sk#3, revenue#15] + +(21) Scan parquet default.item +Output [5]: [i_item_sk#17, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 4] +Input [5]: [i_item_sk#17, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21] + +(23) Filter [codegen id : 4] +Input [5]: [i_item_sk#17, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21] +Condition : isnotnull(i_item_sk#17) + +(24) BroadcastExchange +Input [5]: [i_item_sk#17, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#22] + +(25) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#3] +Right keys [1]: [i_item_sk#17] +Join condition: None + +(26) Project [codegen id : 9] +Output [7]: [s_store_name#2, ss_store_sk#4, revenue#15, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21] +Input [9]: [s_store_name#2, ss_store_sk#4, ss_item_sk#3, revenue#15, i_item_sk#17, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21] + +(27) Scan parquet default.store_sales +Output [4]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25, ss_sold_date_sk#26] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#26), dynamicpruningexpression(ss_sold_date_sk#26 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 6] +Input [4]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25, ss_sold_date_sk#26] + +(29) Filter [codegen id : 6] +Input [4]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25, ss_sold_date_sk#26] +Condition : isnotnull(ss_store_sk#24) + +(30) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#27] + +(31) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#26] +Right keys [1]: [d_date_sk#27] +Join condition: None + +(32) Project [codegen id : 6] +Output [3]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25] +Input [5]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25, ss_sold_date_sk#26, d_date_sk#27] + +(33) HashAggregate [codegen id : 6] +Input [3]: [ss_item_sk#23, ss_store_sk#24, ss_sales_price#25] +Keys [2]: [ss_store_sk#24, ss_item_sk#23] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#25))] +Aggregate Attributes [1]: [sum#28] +Results [3]: [ss_store_sk#24, ss_item_sk#23, sum#29] + +(34) Exchange +Input [3]: [ss_store_sk#24, ss_item_sk#23, sum#29] +Arguments: hashpartitioning(ss_store_sk#24, ss_item_sk#23, 5), ENSURE_REQUIREMENTS, [id=#30] + +(35) HashAggregate [codegen id : 7] +Input [3]: [ss_store_sk#24, ss_item_sk#23, sum#29] +Keys [2]: [ss_store_sk#24, ss_item_sk#23] +Functions [1]: [sum(UnscaledValue(ss_sales_price#25))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#25))#31] +Results [2]: [ss_store_sk#24, MakeDecimal(sum(UnscaledValue(ss_sales_price#25))#31,17,2) AS revenue#32] + +(36) HashAggregate [codegen id : 7] +Input [2]: [ss_store_sk#24, revenue#32] +Keys [1]: [ss_store_sk#24] +Functions [1]: [partial_avg(revenue#32)] +Aggregate Attributes [2]: [sum#33, count#34] +Results [3]: [ss_store_sk#24, sum#35, count#36] + +(37) Exchange +Input [3]: [ss_store_sk#24, sum#35, count#36] +Arguments: hashpartitioning(ss_store_sk#24, 5), ENSURE_REQUIREMENTS, [id=#37] + +(38) HashAggregate [codegen id : 8] +Input [3]: [ss_store_sk#24, sum#35, count#36] +Keys [1]: [ss_store_sk#24] +Functions [1]: [avg(revenue#32)] +Aggregate Attributes [1]: [avg(revenue#32)#38] +Results [2]: [ss_store_sk#24, avg(revenue#32)#38 AS ave#39] + +(39) BroadcastExchange +Input [2]: [ss_store_sk#24, ave#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#40] + +(40) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [ss_store_sk#24] +Join condition: (cast(revenue#15 as decimal(23,7)) <= CheckOverflow((0.100000 * promote_precision(ave#39)), DecimalType(23,7), true)) + +(41) Project [codegen id : 9] +Output [6]: [s_store_name#2, i_item_desc#18, revenue#15, i_current_price#19, i_wholesale_cost#20, i_brand#21] +Input [9]: [s_store_name#2, ss_store_sk#4, revenue#15, i_item_desc#18, i_current_price#19, i_wholesale_cost#20, i_brand#21, ss_store_sk#24, ave#39] + +(42) TakeOrderedAndProject +Input [6]: [s_store_name#2, i_item_desc#18, revenue#15, i_current_price#19, i_wholesale_cost#20, i_brand#21] +Arguments: 100, [s_store_name#2 ASC NULLS FIRST, i_item_desc#18 ASC NULLS FIRST], [s_store_name#2, i_item_desc#18, revenue#15, i_current_price#19, i_wholesale_cost#20, i_brand#21] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (43) + + +(43) ReusedExchange [Reuses operator id: 11] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 27 Hosting Expression = ss_sold_date_sk#26 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65/simplified.txt new file mode 100644 index 0000000000000..d7d461677be96 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q65/simplified.txt @@ -0,0 +1,66 @@ +TakeOrderedAndProject [s_store_name,i_item_desc,revenue,i_current_price,i_wholesale_cost,i_brand] + WholeStageCodegen (9) + Project [s_store_name,i_item_desc,revenue,i_current_price,i_wholesale_cost,i_brand] + BroadcastHashJoin [ss_store_sk,ss_store_sk,revenue,ave] + Project [s_store_name,ss_store_sk,revenue,i_item_desc,i_current_price,i_wholesale_cost,i_brand] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [s_store_name,ss_store_sk,ss_item_sk,revenue] + BroadcastHashJoin [s_store_sk,ss_store_sk] + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name] + InputAdapter + BroadcastExchange #1 + WholeStageCodegen (3) + Filter [revenue] + HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] + InputAdapter + Exchange [ss_store_sk,ss_item_sk] #2 + WholeStageCodegen (2) + HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_desc,i_current_price,i_wholesale_cost,i_brand] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (8) + HashAggregate [ss_store_sk,sum,count] [avg(revenue),ave,sum,count] + InputAdapter + Exchange [ss_store_sk] #6 + WholeStageCodegen (7) + HashAggregate [ss_store_sk,revenue] [sum,count,sum,count] + HashAggregate [ss_store_sk,ss_item_sk,sum] [sum(UnscaledValue(ss_sales_price)),revenue,sum] + InputAdapter + Exchange [ss_store_sk,ss_item_sk] #7 + WholeStageCodegen (6) + HashAggregate [ss_store_sk,ss_item_sk,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_store_sk,ss_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/explain.txt new file mode 100644 index 0000000000000..8c342961cf970 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/explain.txt @@ -0,0 +1,324 @@ +== Physical Plan == +TakeOrderedAndProject (55) ++- * HashAggregate (54) + +- Exchange (53) + +- * HashAggregate (52) + +- Union (51) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Project (17) + : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.ship_mode (4) + : : : +- BroadcastExchange (15) + : : : +- * Project (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.time_dim (11) + : : +- BroadcastExchange (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.date_dim (18) + : +- BroadcastExchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.warehouse (24) + +- * HashAggregate (50) + +- Exchange (49) + +- * HashAggregate (48) + +- * Project (47) + +- * BroadcastHashJoin Inner BuildRight (46) + :- * Project (44) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Project (41) + : : +- * BroadcastHashJoin Inner BuildRight (40) + : : :- * Project (38) + : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.catalog_sales (33) + : : : +- ReusedExchange (36) + : : +- ReusedExchange (39) + : +- ReusedExchange (42) + +- ReusedExchange (45) + + +(1) Scan parquet default.web_sales +Output [7]: [ws_sold_time_sk#1, ws_ship_mode_sk#2, ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#7), dynamicpruningexpression(ws_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_warehouse_sk), IsNotNull(ws_sold_time_sk), IsNotNull(ws_ship_mode_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [7]: [ws_sold_time_sk#1, ws_ship_mode_sk#2, ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7] + +(3) Filter [codegen id : 5] +Input [7]: [ws_sold_time_sk#1, ws_ship_mode_sk#2, ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7] +Condition : ((isnotnull(ws_warehouse_sk#3) AND isnotnull(ws_sold_time_sk#1)) AND isnotnull(ws_ship_mode_sk#2)) + +(4) Scan parquet default.ship_mode +Output [2]: [sm_ship_mode_sk#9, sm_carrier#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/ship_mode] +PushedFilters: [In(sm_carrier, [DHL ,BARIAN ]), IsNotNull(sm_ship_mode_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [sm_ship_mode_sk#9, sm_carrier#10] + +(6) Filter [codegen id : 1] +Input [2]: [sm_ship_mode_sk#9, sm_carrier#10] +Condition : (sm_carrier#10 IN (DHL ,BARIAN ) AND isnotnull(sm_ship_mode_sk#9)) + +(7) Project [codegen id : 1] +Output [1]: [sm_ship_mode_sk#9] +Input [2]: [sm_ship_mode_sk#9, sm_carrier#10] + +(8) BroadcastExchange +Input [1]: [sm_ship_mode_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_ship_mode_sk#2] +Right keys [1]: [sm_ship_mode_sk#9] +Join condition: None + +(10) Project [codegen id : 5] +Output [6]: [ws_sold_time_sk#1, ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7] +Input [8]: [ws_sold_time_sk#1, ws_ship_mode_sk#2, ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7, sm_ship_mode_sk#9] + +(11) Scan parquet default.time_dim +Output [2]: [t_time_sk#12, t_time#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_time), GreaterThanOrEqual(t_time,30838), LessThanOrEqual(t_time,59638), IsNotNull(t_time_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [t_time_sk#12, t_time#13] + +(13) Filter [codegen id : 2] +Input [2]: [t_time_sk#12, t_time#13] +Condition : (((isnotnull(t_time#13) AND (t_time#13 >= 30838)) AND (t_time#13 <= 59638)) AND isnotnull(t_time_sk#12)) + +(14) Project [codegen id : 2] +Output [1]: [t_time_sk#12] +Input [2]: [t_time_sk#12, t_time#13] + +(15) BroadcastExchange +Input [1]: [t_time_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_sold_time_sk#1] +Right keys [1]: [t_time_sk#12] +Join condition: None + +(17) Project [codegen id : 5] +Output [5]: [ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7] +Input [7]: [ws_sold_time_sk#1, ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7, t_time_sk#12] + +(18) Scan parquet default.date_dim +Output [3]: [d_date_sk#15, d_year#16, d_moy#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#15, d_year#16, d_moy#17] + +(20) Filter [codegen id : 3] +Input [3]: [d_date_sk#15, d_year#16, d_moy#17] +Condition : ((isnotnull(d_year#16) AND (d_year#16 = 2001)) AND isnotnull(d_date_sk#15)) + +(21) BroadcastExchange +Input [3]: [d_date_sk#15, d_year#16, d_moy#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(22) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_sold_date_sk#7] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(23) Project [codegen id : 5] +Output [6]: [ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, d_year#16, d_moy#17] +Input [8]: [ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7, d_date_sk#15, d_year#16, d_moy#17] + +(24) Scan parquet default.warehouse +Output [7]: [w_warehouse_sk#19, w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [7]: [w_warehouse_sk#19, w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25] + +(26) Filter [codegen id : 4] +Input [7]: [w_warehouse_sk#19, w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25] +Condition : isnotnull(w_warehouse_sk#19) + +(27) BroadcastExchange +Input [7]: [w_warehouse_sk#19, w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_warehouse_sk#3] +Right keys [1]: [w_warehouse_sk#19] +Join condition: None + +(29) Project [codegen id : 5] +Output [11]: [ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, d_year#16, d_moy#17] +Input [13]: [ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, d_year#16, d_moy#17, w_warehouse_sk#19, w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25] + +(30) HashAggregate [codegen id : 5] +Input [11]: [ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, d_year#16, d_moy#17] +Keys [7]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, d_year#16] +Functions [24]: [partial_sum(CASE WHEN (d_moy#17 = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#17 = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)] +Aggregate Attributes [48]: [sum#27, isEmpty#28, sum#29, isEmpty#30, sum#31, isEmpty#32, sum#33, isEmpty#34, sum#35, isEmpty#36, sum#37, isEmpty#38, sum#39, isEmpty#40, sum#41, isEmpty#42, sum#43, isEmpty#44, sum#45, isEmpty#46, sum#47, isEmpty#48, sum#49, isEmpty#50, sum#51, isEmpty#52, sum#53, isEmpty#54, sum#55, isEmpty#56, sum#57, isEmpty#58, sum#59, isEmpty#60, sum#61, isEmpty#62, sum#63, isEmpty#64, sum#65, isEmpty#66, sum#67, isEmpty#68, sum#69, isEmpty#70, sum#71, isEmpty#72, sum#73, isEmpty#74] +Results [55]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, d_year#16, sum#75, isEmpty#76, sum#77, isEmpty#78, sum#79, isEmpty#80, sum#81, isEmpty#82, sum#83, isEmpty#84, sum#85, isEmpty#86, sum#87, isEmpty#88, sum#89, isEmpty#90, sum#91, isEmpty#92, sum#93, isEmpty#94, sum#95, isEmpty#96, sum#97, isEmpty#98, sum#99, isEmpty#100, sum#101, isEmpty#102, sum#103, isEmpty#104, sum#105, isEmpty#106, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] + +(31) Exchange +Input [55]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, d_year#16, sum#75, isEmpty#76, sum#77, isEmpty#78, sum#79, isEmpty#80, sum#81, isEmpty#82, sum#83, isEmpty#84, sum#85, isEmpty#86, sum#87, isEmpty#88, sum#89, isEmpty#90, sum#91, isEmpty#92, sum#93, isEmpty#94, sum#95, isEmpty#96, sum#97, isEmpty#98, sum#99, isEmpty#100, sum#101, isEmpty#102, sum#103, isEmpty#104, sum#105, isEmpty#106, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] +Arguments: hashpartitioning(w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, d_year#16, 5), ENSURE_REQUIREMENTS, [id=#123] + +(32) HashAggregate [codegen id : 6] +Input [55]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, d_year#16, sum#75, isEmpty#76, sum#77, isEmpty#78, sum#79, isEmpty#80, sum#81, isEmpty#82, sum#83, isEmpty#84, sum#85, isEmpty#86, sum#87, isEmpty#88, sum#89, isEmpty#90, sum#91, isEmpty#92, sum#93, isEmpty#94, sum#95, isEmpty#96, sum#97, isEmpty#98, sum#99, isEmpty#100, sum#101, isEmpty#102, sum#103, isEmpty#104, sum#105, isEmpty#106, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] +Keys [7]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, d_year#16] +Functions [24]: [sum(CASE WHEN (d_moy#17 = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#17 = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)] +Aggregate Attributes [24]: [sum(CASE WHEN (d_moy#17 = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#124, sum(CASE WHEN (d_moy#17 = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#125, sum(CASE WHEN (d_moy#17 = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#126, sum(CASE WHEN (d_moy#17 = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#127, sum(CASE WHEN (d_moy#17 = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#128, sum(CASE WHEN (d_moy#17 = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#129, sum(CASE WHEN (d_moy#17 = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#130, sum(CASE WHEN (d_moy#17 = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#131, sum(CASE WHEN (d_moy#17 = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#132, sum(CASE WHEN (d_moy#17 = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#133, sum(CASE WHEN (d_moy#17 = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#134, sum(CASE WHEN (d_moy#17 = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#135, sum(CASE WHEN (d_moy#17 = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#136, sum(CASE WHEN (d_moy#17 = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#137, sum(CASE WHEN (d_moy#17 = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#138, sum(CASE WHEN (d_moy#17 = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#139, sum(CASE WHEN (d_moy#17 = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#140, sum(CASE WHEN (d_moy#17 = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#141, sum(CASE WHEN (d_moy#17 = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#142, sum(CASE WHEN (d_moy#17 = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#143, sum(CASE WHEN (d_moy#17 = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#144, sum(CASE WHEN (d_moy#17 = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#145, sum(CASE WHEN (d_moy#17 = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#146, sum(CASE WHEN (d_moy#17 = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#147] +Results [32]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, DHL,BARIAN AS ship_carriers#148, d_year#16 AS year#149, sum(CASE WHEN (d_moy#17 = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#124 AS jan_sales#150, sum(CASE WHEN (d_moy#17 = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#125 AS feb_sales#151, sum(CASE WHEN (d_moy#17 = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#126 AS mar_sales#152, sum(CASE WHEN (d_moy#17 = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#127 AS apr_sales#153, sum(CASE WHEN (d_moy#17 = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#128 AS may_sales#154, sum(CASE WHEN (d_moy#17 = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#129 AS jun_sales#155, sum(CASE WHEN (d_moy#17 = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#130 AS jul_sales#156, sum(CASE WHEN (d_moy#17 = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#131 AS aug_sales#157, sum(CASE WHEN (d_moy#17 = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#132 AS sep_sales#158, sum(CASE WHEN (d_moy#17 = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#133 AS oct_sales#159, sum(CASE WHEN (d_moy#17 = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#134 AS nov_sales#160, sum(CASE WHEN (d_moy#17 = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#135 AS dec_sales#161, sum(CASE WHEN (d_moy#17 = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#136 AS jan_net#162, sum(CASE WHEN (d_moy#17 = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#137 AS feb_net#163, sum(CASE WHEN (d_moy#17 = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#138 AS mar_net#164, sum(CASE WHEN (d_moy#17 = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#139 AS apr_net#165, sum(CASE WHEN (d_moy#17 = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#140 AS may_net#166, sum(CASE WHEN (d_moy#17 = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#141 AS jun_net#167, sum(CASE WHEN (d_moy#17 = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#142 AS jul_net#168, sum(CASE WHEN (d_moy#17 = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#143 AS aug_net#169, sum(CASE WHEN (d_moy#17 = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#144 AS sep_net#170, sum(CASE WHEN (d_moy#17 = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#145 AS oct_net#171, sum(CASE WHEN (d_moy#17 = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#146 AS nov_net#172, sum(CASE WHEN (d_moy#17 = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#147 AS dec_net#173] + +(33) Scan parquet default.catalog_sales +Output [7]: [cs_sold_time_sk#174, cs_ship_mode_sk#175, cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#180), dynamicpruningexpression(cs_sold_date_sk#180 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_sold_time_sk), IsNotNull(cs_ship_mode_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [7]: [cs_sold_time_sk#174, cs_ship_mode_sk#175, cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180] + +(35) Filter [codegen id : 11] +Input [7]: [cs_sold_time_sk#174, cs_ship_mode_sk#175, cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180] +Condition : ((isnotnull(cs_warehouse_sk#176) AND isnotnull(cs_sold_time_sk#174)) AND isnotnull(cs_ship_mode_sk#175)) + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [sm_ship_mode_sk#181] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_ship_mode_sk#175] +Right keys [1]: [sm_ship_mode_sk#181] +Join condition: None + +(38) Project [codegen id : 11] +Output [6]: [cs_sold_time_sk#174, cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180] +Input [8]: [cs_sold_time_sk#174, cs_ship_mode_sk#175, cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180, sm_ship_mode_sk#181] + +(39) ReusedExchange [Reuses operator id: 15] +Output [1]: [t_time_sk#182] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_time_sk#174] +Right keys [1]: [t_time_sk#182] +Join condition: None + +(41) Project [codegen id : 11] +Output [5]: [cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180] +Input [7]: [cs_sold_time_sk#174, cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180, t_time_sk#182] + +(42) ReusedExchange [Reuses operator id: 21] +Output [3]: [d_date_sk#183, d_year#184, d_moy#185] + +(43) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#180] +Right keys [1]: [d_date_sk#183] +Join condition: None + +(44) Project [codegen id : 11] +Output [6]: [cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, d_year#184, d_moy#185] +Input [8]: [cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180, d_date_sk#183, d_year#184, d_moy#185] + +(45) ReusedExchange [Reuses operator id: 27] +Output [7]: [w_warehouse_sk#186, w_warehouse_name#187, w_warehouse_sq_ft#188, w_city#189, w_county#190, w_state#191, w_country#192] + +(46) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_warehouse_sk#176] +Right keys [1]: [w_warehouse_sk#186] +Join condition: None + +(47) Project [codegen id : 11] +Output [11]: [cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, w_warehouse_name#187, w_warehouse_sq_ft#188, w_city#189, w_county#190, w_state#191, w_country#192, d_year#184, d_moy#185] +Input [13]: [cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, d_year#184, d_moy#185, w_warehouse_sk#186, w_warehouse_name#187, w_warehouse_sq_ft#188, w_city#189, w_county#190, w_state#191, w_country#192] + +(48) HashAggregate [codegen id : 11] +Input [11]: [cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, w_warehouse_name#187, w_warehouse_sq_ft#188, w_city#189, w_county#190, w_state#191, w_country#192, d_year#184, d_moy#185] +Keys [7]: [w_warehouse_name#187, w_warehouse_sq_ft#188, w_city#189, w_county#190, w_state#191, w_country#192, d_year#184] +Functions [24]: [partial_sum(CASE WHEN (d_moy#185 = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#185 = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)] +Aggregate Attributes [48]: [sum#193, isEmpty#194, sum#195, isEmpty#196, sum#197, isEmpty#198, sum#199, isEmpty#200, sum#201, isEmpty#202, sum#203, isEmpty#204, sum#205, isEmpty#206, sum#207, isEmpty#208, sum#209, isEmpty#210, sum#211, isEmpty#212, sum#213, isEmpty#214, sum#215, isEmpty#216, sum#217, isEmpty#218, sum#219, isEmpty#220, sum#221, isEmpty#222, sum#223, isEmpty#224, sum#225, isEmpty#226, sum#227, isEmpty#228, sum#229, isEmpty#230, sum#231, isEmpty#232, sum#233, isEmpty#234, sum#235, isEmpty#236, sum#237, isEmpty#238, sum#239, isEmpty#240] +Results [55]: [w_warehouse_name#187, w_warehouse_sq_ft#188, w_city#189, w_county#190, w_state#191, w_country#192, d_year#184, sum#241, isEmpty#242, sum#243, isEmpty#244, sum#245, isEmpty#246, sum#247, isEmpty#248, sum#249, isEmpty#250, sum#251, isEmpty#252, sum#253, isEmpty#254, sum#255, isEmpty#256, sum#257, isEmpty#258, sum#259, isEmpty#260, sum#261, isEmpty#262, sum#263, isEmpty#264, sum#265, isEmpty#266, sum#267, isEmpty#268, sum#269, isEmpty#270, sum#271, isEmpty#272, sum#273, isEmpty#274, sum#275, isEmpty#276, sum#277, isEmpty#278, sum#279, isEmpty#280, sum#281, isEmpty#282, sum#283, isEmpty#284, sum#285, isEmpty#286, sum#287, isEmpty#288] + +(49) Exchange +Input [55]: [w_warehouse_name#187, w_warehouse_sq_ft#188, w_city#189, w_county#190, w_state#191, w_country#192, d_year#184, sum#241, isEmpty#242, sum#243, isEmpty#244, sum#245, isEmpty#246, sum#247, isEmpty#248, sum#249, isEmpty#250, sum#251, isEmpty#252, sum#253, isEmpty#254, sum#255, isEmpty#256, sum#257, isEmpty#258, sum#259, isEmpty#260, sum#261, isEmpty#262, sum#263, isEmpty#264, sum#265, isEmpty#266, sum#267, isEmpty#268, sum#269, isEmpty#270, sum#271, isEmpty#272, sum#273, isEmpty#274, sum#275, isEmpty#276, sum#277, isEmpty#278, sum#279, isEmpty#280, sum#281, isEmpty#282, sum#283, isEmpty#284, sum#285, isEmpty#286, sum#287, isEmpty#288] +Arguments: hashpartitioning(w_warehouse_name#187, w_warehouse_sq_ft#188, w_city#189, w_county#190, w_state#191, w_country#192, d_year#184, 5), ENSURE_REQUIREMENTS, [id=#289] + +(50) HashAggregate [codegen id : 12] +Input [55]: [w_warehouse_name#187, w_warehouse_sq_ft#188, w_city#189, w_county#190, w_state#191, w_country#192, d_year#184, sum#241, isEmpty#242, sum#243, isEmpty#244, sum#245, isEmpty#246, sum#247, isEmpty#248, sum#249, isEmpty#250, sum#251, isEmpty#252, sum#253, isEmpty#254, sum#255, isEmpty#256, sum#257, isEmpty#258, sum#259, isEmpty#260, sum#261, isEmpty#262, sum#263, isEmpty#264, sum#265, isEmpty#266, sum#267, isEmpty#268, sum#269, isEmpty#270, sum#271, isEmpty#272, sum#273, isEmpty#274, sum#275, isEmpty#276, sum#277, isEmpty#278, sum#279, isEmpty#280, sum#281, isEmpty#282, sum#283, isEmpty#284, sum#285, isEmpty#286, sum#287, isEmpty#288] +Keys [7]: [w_warehouse_name#187, w_warehouse_sq_ft#188, w_city#189, w_county#190, w_state#191, w_country#192, d_year#184] +Functions [24]: [sum(CASE WHEN (d_moy#185 = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#185 = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)] +Aggregate Attributes [24]: [sum(CASE WHEN (d_moy#185 = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#290, sum(CASE WHEN (d_moy#185 = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#291, sum(CASE WHEN (d_moy#185 = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#292, sum(CASE WHEN (d_moy#185 = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#293, sum(CASE WHEN (d_moy#185 = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#294, sum(CASE WHEN (d_moy#185 = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#295, sum(CASE WHEN (d_moy#185 = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#296, sum(CASE WHEN (d_moy#185 = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#297, sum(CASE WHEN (d_moy#185 = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#298, sum(CASE WHEN (d_moy#185 = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#299, sum(CASE WHEN (d_moy#185 = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#300, sum(CASE WHEN (d_moy#185 = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#301, sum(CASE WHEN (d_moy#185 = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#302, sum(CASE WHEN (d_moy#185 = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#303, sum(CASE WHEN (d_moy#185 = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#304, sum(CASE WHEN (d_moy#185 = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#305, sum(CASE WHEN (d_moy#185 = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#306, sum(CASE WHEN (d_moy#185 = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#307, sum(CASE WHEN (d_moy#185 = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#308, sum(CASE WHEN (d_moy#185 = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#309, sum(CASE WHEN (d_moy#185 = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#310, sum(CASE WHEN (d_moy#185 = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#311, sum(CASE WHEN (d_moy#185 = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#312, sum(CASE WHEN (d_moy#185 = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#313] +Results [32]: [w_warehouse_name#187, w_warehouse_sq_ft#188, w_city#189, w_county#190, w_state#191, w_country#192, DHL,BARIAN AS ship_carriers#314, d_year#184 AS year#315, sum(CASE WHEN (d_moy#185 = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#290 AS jan_sales#316, sum(CASE WHEN (d_moy#185 = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#291 AS feb_sales#317, sum(CASE WHEN (d_moy#185 = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#292 AS mar_sales#318, sum(CASE WHEN (d_moy#185 = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#293 AS apr_sales#319, sum(CASE WHEN (d_moy#185 = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#294 AS may_sales#320, sum(CASE WHEN (d_moy#185 = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#295 AS jun_sales#321, sum(CASE WHEN (d_moy#185 = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#296 AS jul_sales#322, sum(CASE WHEN (d_moy#185 = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#297 AS aug_sales#323, sum(CASE WHEN (d_moy#185 = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#298 AS sep_sales#324, sum(CASE WHEN (d_moy#185 = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#299 AS oct_sales#325, sum(CASE WHEN (d_moy#185 = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#300 AS nov_sales#326, sum(CASE WHEN (d_moy#185 = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#301 AS dec_sales#327, sum(CASE WHEN (d_moy#185 = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#302 AS jan_net#328, sum(CASE WHEN (d_moy#185 = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#303 AS feb_net#329, sum(CASE WHEN (d_moy#185 = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#304 AS mar_net#330, sum(CASE WHEN (d_moy#185 = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#305 AS apr_net#331, sum(CASE WHEN (d_moy#185 = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#306 AS may_net#332, sum(CASE WHEN (d_moy#185 = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#307 AS jun_net#333, sum(CASE WHEN (d_moy#185 = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#308 AS jul_net#334, sum(CASE WHEN (d_moy#185 = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#309 AS aug_net#335, sum(CASE WHEN (d_moy#185 = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#310 AS sep_net#336, sum(CASE WHEN (d_moy#185 = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#311 AS oct_net#337, sum(CASE WHEN (d_moy#185 = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#312 AS nov_net#338, sum(CASE WHEN (d_moy#185 = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#313 AS dec_net#339] + +(51) Union + +(52) HashAggregate [codegen id : 13] +Input [32]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, ship_carriers#148, year#149, jan_sales#150, feb_sales#151, mar_sales#152, apr_sales#153, may_sales#154, jun_sales#155, jul_sales#156, aug_sales#157, sep_sales#158, oct_sales#159, nov_sales#160, dec_sales#161, jan_net#162, feb_net#163, mar_net#164, apr_net#165, may_net#166, jun_net#167, jul_net#168, aug_net#169, sep_net#170, oct_net#171, nov_net#172, dec_net#173] +Keys [8]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, ship_carriers#148, year#149] +Functions [36]: [partial_sum(jan_sales#150), partial_sum(feb_sales#151), partial_sum(mar_sales#152), partial_sum(apr_sales#153), partial_sum(may_sales#154), partial_sum(jun_sales#155), partial_sum(jul_sales#156), partial_sum(aug_sales#157), partial_sum(sep_sales#158), partial_sum(oct_sales#159), partial_sum(nov_sales#160), partial_sum(dec_sales#161), partial_sum(CheckOverflow((promote_precision(jan_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(feb_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(mar_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(apr_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(may_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jun_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jul_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(aug_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(sep_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(oct_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(nov_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(dec_sales#161) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(jan_net#162), partial_sum(feb_net#163), partial_sum(mar_net#164), partial_sum(apr_net#165), partial_sum(may_net#166), partial_sum(jun_net#167), partial_sum(jul_net#168), partial_sum(aug_net#169), partial_sum(sep_net#170), partial_sum(oct_net#171), partial_sum(nov_net#172), partial_sum(dec_net#173)] +Aggregate Attributes [72]: [sum#340, isEmpty#341, sum#342, isEmpty#343, sum#344, isEmpty#345, sum#346, isEmpty#347, sum#348, isEmpty#349, sum#350, isEmpty#351, sum#352, isEmpty#353, sum#354, isEmpty#355, sum#356, isEmpty#357, sum#358, isEmpty#359, sum#360, isEmpty#361, sum#362, isEmpty#363, sum#364, isEmpty#365, sum#366, isEmpty#367, sum#368, isEmpty#369, sum#370, isEmpty#371, sum#372, isEmpty#373, sum#374, isEmpty#375, sum#376, isEmpty#377, sum#378, isEmpty#379, sum#380, isEmpty#381, sum#382, isEmpty#383, sum#384, isEmpty#385, sum#386, isEmpty#387, sum#388, isEmpty#389, sum#390, isEmpty#391, sum#392, isEmpty#393, sum#394, isEmpty#395, sum#396, isEmpty#397, sum#398, isEmpty#399, sum#400, isEmpty#401, sum#402, isEmpty#403, sum#404, isEmpty#405, sum#406, isEmpty#407, sum#408, isEmpty#409, sum#410, isEmpty#411] +Results [80]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, ship_carriers#148, year#149, sum#412, isEmpty#413, sum#414, isEmpty#415, sum#416, isEmpty#417, sum#418, isEmpty#419, sum#420, isEmpty#421, sum#422, isEmpty#423, sum#424, isEmpty#425, sum#426, isEmpty#427, sum#428, isEmpty#429, sum#430, isEmpty#431, sum#432, isEmpty#433, sum#434, isEmpty#435, sum#436, isEmpty#437, sum#438, isEmpty#439, sum#440, isEmpty#441, sum#442, isEmpty#443, sum#444, isEmpty#445, sum#446, isEmpty#447, sum#448, isEmpty#449, sum#450, isEmpty#451, sum#452, isEmpty#453, sum#454, isEmpty#455, sum#456, isEmpty#457, sum#458, isEmpty#459, sum#460, isEmpty#461, sum#462, isEmpty#463, sum#464, isEmpty#465, sum#466, isEmpty#467, sum#468, isEmpty#469, sum#470, isEmpty#471, sum#472, isEmpty#473, sum#474, isEmpty#475, sum#476, isEmpty#477, sum#478, isEmpty#479, sum#480, isEmpty#481, sum#482, isEmpty#483] + +(53) Exchange +Input [80]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, ship_carriers#148, year#149, sum#412, isEmpty#413, sum#414, isEmpty#415, sum#416, isEmpty#417, sum#418, isEmpty#419, sum#420, isEmpty#421, sum#422, isEmpty#423, sum#424, isEmpty#425, sum#426, isEmpty#427, sum#428, isEmpty#429, sum#430, isEmpty#431, sum#432, isEmpty#433, sum#434, isEmpty#435, sum#436, isEmpty#437, sum#438, isEmpty#439, sum#440, isEmpty#441, sum#442, isEmpty#443, sum#444, isEmpty#445, sum#446, isEmpty#447, sum#448, isEmpty#449, sum#450, isEmpty#451, sum#452, isEmpty#453, sum#454, isEmpty#455, sum#456, isEmpty#457, sum#458, isEmpty#459, sum#460, isEmpty#461, sum#462, isEmpty#463, sum#464, isEmpty#465, sum#466, isEmpty#467, sum#468, isEmpty#469, sum#470, isEmpty#471, sum#472, isEmpty#473, sum#474, isEmpty#475, sum#476, isEmpty#477, sum#478, isEmpty#479, sum#480, isEmpty#481, sum#482, isEmpty#483] +Arguments: hashpartitioning(w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, ship_carriers#148, year#149, 5), ENSURE_REQUIREMENTS, [id=#484] + +(54) HashAggregate [codegen id : 14] +Input [80]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, ship_carriers#148, year#149, sum#412, isEmpty#413, sum#414, isEmpty#415, sum#416, isEmpty#417, sum#418, isEmpty#419, sum#420, isEmpty#421, sum#422, isEmpty#423, sum#424, isEmpty#425, sum#426, isEmpty#427, sum#428, isEmpty#429, sum#430, isEmpty#431, sum#432, isEmpty#433, sum#434, isEmpty#435, sum#436, isEmpty#437, sum#438, isEmpty#439, sum#440, isEmpty#441, sum#442, isEmpty#443, sum#444, isEmpty#445, sum#446, isEmpty#447, sum#448, isEmpty#449, sum#450, isEmpty#451, sum#452, isEmpty#453, sum#454, isEmpty#455, sum#456, isEmpty#457, sum#458, isEmpty#459, sum#460, isEmpty#461, sum#462, isEmpty#463, sum#464, isEmpty#465, sum#466, isEmpty#467, sum#468, isEmpty#469, sum#470, isEmpty#471, sum#472, isEmpty#473, sum#474, isEmpty#475, sum#476, isEmpty#477, sum#478, isEmpty#479, sum#480, isEmpty#481, sum#482, isEmpty#483] +Keys [8]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, ship_carriers#148, year#149] +Functions [36]: [sum(jan_sales#150), sum(feb_sales#151), sum(mar_sales#152), sum(apr_sales#153), sum(may_sales#154), sum(jun_sales#155), sum(jul_sales#156), sum(aug_sales#157), sum(sep_sales#158), sum(oct_sales#159), sum(nov_sales#160), sum(dec_sales#161), sum(CheckOverflow((promote_precision(jan_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(feb_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(mar_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(apr_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(may_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jun_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jul_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(aug_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(sep_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(oct_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(nov_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(dec_sales#161) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(jan_net#162), sum(feb_net#163), sum(mar_net#164), sum(apr_net#165), sum(may_net#166), sum(jun_net#167), sum(jul_net#168), sum(aug_net#169), sum(sep_net#170), sum(oct_net#171), sum(nov_net#172), sum(dec_net#173)] +Aggregate Attributes [36]: [sum(jan_sales#150)#485, sum(feb_sales#151)#486, sum(mar_sales#152)#487, sum(apr_sales#153)#488, sum(may_sales#154)#489, sum(jun_sales#155)#490, sum(jul_sales#156)#491, sum(aug_sales#157)#492, sum(sep_sales#158)#493, sum(oct_sales#159)#494, sum(nov_sales#160)#495, sum(dec_sales#161)#496, sum(CheckOverflow((promote_precision(jan_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#497, sum(CheckOverflow((promote_precision(feb_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#498, sum(CheckOverflow((promote_precision(mar_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#499, sum(CheckOverflow((promote_precision(apr_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#500, sum(CheckOverflow((promote_precision(may_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#501, sum(CheckOverflow((promote_precision(jun_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#502, sum(CheckOverflow((promote_precision(jul_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#503, sum(CheckOverflow((promote_precision(aug_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#504, sum(CheckOverflow((promote_precision(sep_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#505, sum(CheckOverflow((promote_precision(oct_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#506, sum(CheckOverflow((promote_precision(nov_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#507, sum(CheckOverflow((promote_precision(dec_sales#161) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#508, sum(jan_net#162)#509, sum(feb_net#163)#510, sum(mar_net#164)#511, sum(apr_net#165)#512, sum(may_net#166)#513, sum(jun_net#167)#514, sum(jul_net#168)#515, sum(aug_net#169)#516, sum(sep_net#170)#517, sum(oct_net#171)#518, sum(nov_net#172)#519, sum(dec_net#173)#520] +Results [44]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, ship_carriers#148, year#149, sum(jan_sales#150)#485 AS jan_sales#521, sum(feb_sales#151)#486 AS feb_sales#522, sum(mar_sales#152)#487 AS mar_sales#523, sum(apr_sales#153)#488 AS apr_sales#524, sum(may_sales#154)#489 AS may_sales#525, sum(jun_sales#155)#490 AS jun_sales#526, sum(jul_sales#156)#491 AS jul_sales#527, sum(aug_sales#157)#492 AS aug_sales#528, sum(sep_sales#158)#493 AS sep_sales#529, sum(oct_sales#159)#494 AS oct_sales#530, sum(nov_sales#160)#495 AS nov_sales#531, sum(dec_sales#161)#496 AS dec_sales#532, sum(CheckOverflow((promote_precision(jan_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#497 AS jan_sales_per_sq_foot#533, sum(CheckOverflow((promote_precision(feb_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#498 AS feb_sales_per_sq_foot#534, sum(CheckOverflow((promote_precision(mar_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#499 AS mar_sales_per_sq_foot#535, sum(CheckOverflow((promote_precision(apr_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#500 AS apr_sales_per_sq_foot#536, sum(CheckOverflow((promote_precision(may_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#501 AS may_sales_per_sq_foot#537, sum(CheckOverflow((promote_precision(jun_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#502 AS jun_sales_per_sq_foot#538, sum(CheckOverflow((promote_precision(jul_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#503 AS jul_sales_per_sq_foot#539, sum(CheckOverflow((promote_precision(aug_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#504 AS aug_sales_per_sq_foot#540, sum(CheckOverflow((promote_precision(sep_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#505 AS sep_sales_per_sq_foot#541, sum(CheckOverflow((promote_precision(oct_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#506 AS oct_sales_per_sq_foot#542, sum(CheckOverflow((promote_precision(nov_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#507 AS nov_sales_per_sq_foot#543, sum(CheckOverflow((promote_precision(dec_sales#161) / promote_precision(cast(cast(w_warehouse_sq_ft#21 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#508 AS dec_sales_per_sq_foot#544, sum(jan_net#162)#509 AS jan_net#545, sum(feb_net#163)#510 AS feb_net#546, sum(mar_net#164)#511 AS mar_net#547, sum(apr_net#165)#512 AS apr_net#548, sum(may_net#166)#513 AS may_net#549, sum(jun_net#167)#514 AS jun_net#550, sum(jul_net#168)#515 AS jul_net#551, sum(aug_net#169)#516 AS aug_net#552, sum(sep_net#170)#517 AS sep_net#553, sum(oct_net#171)#518 AS oct_net#554, sum(nov_net#172)#519 AS nov_net#555, sum(dec_net#173)#520 AS dec_net#556] + +(55) TakeOrderedAndProject +Input [44]: [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, ship_carriers#148, year#149, jan_sales#521, feb_sales#522, mar_sales#523, apr_sales#524, may_sales#525, jun_sales#526, jul_sales#527, aug_sales#528, sep_sales#529, oct_sales#530, nov_sales#531, dec_sales#532, jan_sales_per_sq_foot#533, feb_sales_per_sq_foot#534, mar_sales_per_sq_foot#535, apr_sales_per_sq_foot#536, may_sales_per_sq_foot#537, jun_sales_per_sq_foot#538, jul_sales_per_sq_foot#539, aug_sales_per_sq_foot#540, sep_sales_per_sq_foot#541, oct_sales_per_sq_foot#542, nov_sales_per_sq_foot#543, dec_sales_per_sq_foot#544, jan_net#545, feb_net#546, mar_net#547, apr_net#548, may_net#549, jun_net#550, jul_net#551, aug_net#552, sep_net#553, oct_net#554, nov_net#555, dec_net#556] +Arguments: 100, [w_warehouse_name#20 ASC NULLS FIRST], [w_warehouse_name#20, w_warehouse_sq_ft#21, w_city#22, w_county#23, w_state#24, w_country#25, ship_carriers#148, year#149, jan_sales#521, feb_sales#522, mar_sales#523, apr_sales#524, may_sales#525, jun_sales#526, jul_sales#527, aug_sales#528, sep_sales#529, oct_sales#530, nov_sales#531, dec_sales#532, jan_sales_per_sq_foot#533, feb_sales_per_sq_foot#534, mar_sales_per_sq_foot#535, apr_sales_per_sq_foot#536, ... 20 more fields] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (56) + + +(56) ReusedExchange [Reuses operator id: 21] +Output [3]: [d_date_sk#15, d_year#16, d_moy#17] + +Subquery:2 Hosting operator id = 33 Hosting Expression = cs_sold_date_sk#180 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/simplified.txt new file mode 100644 index 0000000000000..ae92c0623bd82 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66.sf100/simplified.txt @@ -0,0 +1,86 @@ +TakeOrderedAndProject [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_sales_per_sq_foot,feb_sales_per_sq_foot,mar_sales_per_sq_foot,apr_sales_per_sq_foot,may_sales_per_sq_foot,jun_sales_per_sq_foot,jul_sales_per_sq_foot,aug_sales_per_sq_foot,sep_sales_per_sq_foot,oct_sales_per_sq_foot,nov_sales_per_sq_foot,dec_sales_per_sq_foot,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net] + WholeStageCodegen (14) + HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(jan_sales),sum(feb_sales),sum(mar_sales),sum(apr_sales),sum(may_sales),sum(jun_sales),sum(jul_sales),sum(aug_sales),sum(sep_sales),sum(oct_sales),sum(nov_sales),sum(dec_sales),sum(CheckOverflow((promote_precision(jan_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(feb_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(mar_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(apr_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(may_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(jun_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(jul_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(aug_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(sep_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(oct_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(nov_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(dec_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(jan_net),sum(feb_net),sum(mar_net),sum(apr_net),sum(may_net),sum(jun_net),sum(jul_net),sum(aug_net),sum(sep_net),sum(oct_net),sum(nov_net),sum(dec_net),jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_sales_per_sq_foot,feb_sales_per_sq_foot,mar_sales_per_sq_foot,apr_sales_per_sq_foot,may_sales_per_sq_foot,jun_sales_per_sq_foot,jul_sales_per_sq_foot,aug_sales_per_sq_foot,sep_sales_per_sq_foot,oct_sales_per_sq_foot,nov_sales_per_sq_foot,dec_sales_per_sq_foot,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year] #1 + WholeStageCodegen (13) + HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (6) + HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year] #2 + WholeStageCodegen (5) + HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,d_moy,ws_ext_sales_price,ws_quantity,ws_net_paid] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + Project [ws_quantity,ws_ext_sales_price,ws_net_paid,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,d_moy] + BroadcastHashJoin [ws_warehouse_sk,w_warehouse_sk] + Project [ws_warehouse_sk,ws_quantity,ws_ext_sales_price,ws_net_paid,d_year,d_moy] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_warehouse_sk,ws_quantity,ws_ext_sales_price,ws_net_paid,ws_sold_date_sk] + BroadcastHashJoin [ws_sold_time_sk,t_time_sk] + Project [ws_sold_time_sk,ws_warehouse_sk,ws_quantity,ws_ext_sales_price,ws_net_paid,ws_sold_date_sk] + BroadcastHashJoin [ws_ship_mode_sk,sm_ship_mode_sk] + Filter [ws_warehouse_sk,ws_sold_time_sk,ws_ship_mode_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_time_sk,ws_ship_mode_sk,ws_warehouse_sk,ws_quantity,ws_ext_sales_price,ws_net_paid,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [sm_ship_mode_sk] + Filter [sm_carrier,sm_ship_mode_sk] + ColumnarToRow + InputAdapter + Scan parquet default.ship_mode [sm_ship_mode_sk,sm_carrier] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [t_time_sk] + Filter [t_time,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_time] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (3) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country] + WholeStageCodegen (12) + HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year] #7 + WholeStageCodegen (11) + HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,d_moy,cs_sales_price,cs_quantity,cs_net_paid_inc_tax] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + Project [cs_quantity,cs_sales_price,cs_net_paid_inc_tax,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,d_moy] + BroadcastHashJoin [cs_warehouse_sk,w_warehouse_sk] + Project [cs_warehouse_sk,cs_quantity,cs_sales_price,cs_net_paid_inc_tax,d_year,d_moy] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_warehouse_sk,cs_quantity,cs_sales_price,cs_net_paid_inc_tax,cs_sold_date_sk] + BroadcastHashJoin [cs_sold_time_sk,t_time_sk] + Project [cs_sold_time_sk,cs_warehouse_sk,cs_quantity,cs_sales_price,cs_net_paid_inc_tax,cs_sold_date_sk] + BroadcastHashJoin [cs_ship_mode_sk,sm_ship_mode_sk] + Filter [cs_warehouse_sk,cs_sold_time_sk,cs_ship_mode_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_time_sk,cs_ship_mode_sk,cs_warehouse_sk,cs_quantity,cs_sales_price,cs_net_paid_inc_tax,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [sm_ship_mode_sk] #4 + InputAdapter + ReusedExchange [t_time_sk] #5 + InputAdapter + ReusedExchange [d_date_sk,d_year,d_moy] #3 + InputAdapter + ReusedExchange [w_warehouse_sk,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/explain.txt new file mode 100644 index 0000000000000..832965c1aaa31 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/explain.txt @@ -0,0 +1,324 @@ +== Physical Plan == +TakeOrderedAndProject (55) ++- * HashAggregate (54) + +- Exchange (53) + +- * HashAggregate (52) + +- Union (51) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (22) + : : +- * BroadcastHashJoin Inner BuildRight (21) + : : :- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.warehouse (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (20) + : : +- * Project (19) + : : +- * Filter (18) + : : +- * ColumnarToRow (17) + : : +- Scan parquet default.time_dim (16) + : +- BroadcastExchange (27) + : +- * Project (26) + : +- * Filter (25) + : +- * ColumnarToRow (24) + : +- Scan parquet default.ship_mode (23) + +- * HashAggregate (50) + +- Exchange (49) + +- * HashAggregate (48) + +- * Project (47) + +- * BroadcastHashJoin Inner BuildRight (46) + :- * Project (44) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Project (41) + : : +- * BroadcastHashJoin Inner BuildRight (40) + : : :- * Project (38) + : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : :- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.catalog_sales (33) + : : : +- ReusedExchange (36) + : : +- ReusedExchange (39) + : +- ReusedExchange (42) + +- ReusedExchange (45) + + +(1) Scan parquet default.web_sales +Output [7]: [ws_sold_time_sk#1, ws_ship_mode_sk#2, ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#7), dynamicpruningexpression(ws_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_warehouse_sk), IsNotNull(ws_sold_time_sk), IsNotNull(ws_ship_mode_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [7]: [ws_sold_time_sk#1, ws_ship_mode_sk#2, ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7] + +(3) Filter [codegen id : 5] +Input [7]: [ws_sold_time_sk#1, ws_ship_mode_sk#2, ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7] +Condition : ((isnotnull(ws_warehouse_sk#3) AND isnotnull(ws_sold_time_sk#1)) AND isnotnull(ws_ship_mode_sk#2)) + +(4) Scan parquet default.warehouse +Output [7]: [w_warehouse_sk#9, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [7]: [w_warehouse_sk#9, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15] + +(6) Filter [codegen id : 1] +Input [7]: [w_warehouse_sk#9, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15] +Condition : isnotnull(w_warehouse_sk#9) + +(7) BroadcastExchange +Input [7]: [w_warehouse_sk#9, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(8) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_warehouse_sk#3] +Right keys [1]: [w_warehouse_sk#9] +Join condition: None + +(9) Project [codegen id : 5] +Output [12]: [ws_sold_time_sk#1, ws_ship_mode_sk#2, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15] +Input [14]: [ws_sold_time_sk#1, ws_ship_mode_sk#2, ws_warehouse_sk#3, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7, w_warehouse_sk#9, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15] + +(10) Scan parquet default.date_dim +Output [3]: [d_date_sk#17, d_year#18, d_moy#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#17, d_year#18, d_moy#19] + +(12) Filter [codegen id : 2] +Input [3]: [d_date_sk#17, d_year#18, d_moy#19] +Condition : ((isnotnull(d_year#18) AND (d_year#18 = 2001)) AND isnotnull(d_date_sk#17)) + +(13) BroadcastExchange +Input [3]: [d_date_sk#17, d_year#18, d_moy#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(14) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_sold_date_sk#7] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(15) Project [codegen id : 5] +Output [13]: [ws_sold_time_sk#1, ws_ship_mode_sk#2, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_year#18, d_moy#19] +Input [15]: [ws_sold_time_sk#1, ws_ship_mode_sk#2, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, ws_sold_date_sk#7, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_date_sk#17, d_year#18, d_moy#19] + +(16) Scan parquet default.time_dim +Output [2]: [t_time_sk#21, t_time#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_time), GreaterThanOrEqual(t_time,30838), LessThanOrEqual(t_time,59638), IsNotNull(t_time_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [2]: [t_time_sk#21, t_time#22] + +(18) Filter [codegen id : 3] +Input [2]: [t_time_sk#21, t_time#22] +Condition : (((isnotnull(t_time#22) AND (t_time#22 >= 30838)) AND (t_time#22 <= 59638)) AND isnotnull(t_time_sk#21)) + +(19) Project [codegen id : 3] +Output [1]: [t_time_sk#21] +Input [2]: [t_time_sk#21, t_time#22] + +(20) BroadcastExchange +Input [1]: [t_time_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] + +(21) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_sold_time_sk#1] +Right keys [1]: [t_time_sk#21] +Join condition: None + +(22) Project [codegen id : 5] +Output [12]: [ws_ship_mode_sk#2, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_year#18, d_moy#19] +Input [14]: [ws_sold_time_sk#1, ws_ship_mode_sk#2, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_year#18, d_moy#19, t_time_sk#21] + +(23) Scan parquet default.ship_mode +Output [2]: [sm_ship_mode_sk#24, sm_carrier#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/ship_mode] +PushedFilters: [In(sm_carrier, [DHL ,BARIAN ]), IsNotNull(sm_ship_mode_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [2]: [sm_ship_mode_sk#24, sm_carrier#25] + +(25) Filter [codegen id : 4] +Input [2]: [sm_ship_mode_sk#24, sm_carrier#25] +Condition : (sm_carrier#25 IN (DHL ,BARIAN ) AND isnotnull(sm_ship_mode_sk#24)) + +(26) Project [codegen id : 4] +Output [1]: [sm_ship_mode_sk#24] +Input [2]: [sm_ship_mode_sk#24, sm_carrier#25] + +(27) BroadcastExchange +Input [1]: [sm_ship_mode_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_ship_mode_sk#2] +Right keys [1]: [sm_ship_mode_sk#24] +Join condition: None + +(29) Project [codegen id : 5] +Output [11]: [ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_year#18, d_moy#19] +Input [13]: [ws_ship_mode_sk#2, ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_year#18, d_moy#19, sm_ship_mode_sk#24] + +(30) HashAggregate [codegen id : 5] +Input [11]: [ws_quantity#4, ws_ext_sales_price#5, ws_net_paid#6, w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_year#18, d_moy#19] +Keys [7]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_year#18] +Functions [24]: [partial_sum(CASE WHEN (d_moy#19 = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#19 = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)] +Aggregate Attributes [48]: [sum#27, isEmpty#28, sum#29, isEmpty#30, sum#31, isEmpty#32, sum#33, isEmpty#34, sum#35, isEmpty#36, sum#37, isEmpty#38, sum#39, isEmpty#40, sum#41, isEmpty#42, sum#43, isEmpty#44, sum#45, isEmpty#46, sum#47, isEmpty#48, sum#49, isEmpty#50, sum#51, isEmpty#52, sum#53, isEmpty#54, sum#55, isEmpty#56, sum#57, isEmpty#58, sum#59, isEmpty#60, sum#61, isEmpty#62, sum#63, isEmpty#64, sum#65, isEmpty#66, sum#67, isEmpty#68, sum#69, isEmpty#70, sum#71, isEmpty#72, sum#73, isEmpty#74] +Results [55]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_year#18, sum#75, isEmpty#76, sum#77, isEmpty#78, sum#79, isEmpty#80, sum#81, isEmpty#82, sum#83, isEmpty#84, sum#85, isEmpty#86, sum#87, isEmpty#88, sum#89, isEmpty#90, sum#91, isEmpty#92, sum#93, isEmpty#94, sum#95, isEmpty#96, sum#97, isEmpty#98, sum#99, isEmpty#100, sum#101, isEmpty#102, sum#103, isEmpty#104, sum#105, isEmpty#106, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] + +(31) Exchange +Input [55]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_year#18, sum#75, isEmpty#76, sum#77, isEmpty#78, sum#79, isEmpty#80, sum#81, isEmpty#82, sum#83, isEmpty#84, sum#85, isEmpty#86, sum#87, isEmpty#88, sum#89, isEmpty#90, sum#91, isEmpty#92, sum#93, isEmpty#94, sum#95, isEmpty#96, sum#97, isEmpty#98, sum#99, isEmpty#100, sum#101, isEmpty#102, sum#103, isEmpty#104, sum#105, isEmpty#106, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] +Arguments: hashpartitioning(w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_year#18, 5), ENSURE_REQUIREMENTS, [id=#123] + +(32) HashAggregate [codegen id : 6] +Input [55]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_year#18, sum#75, isEmpty#76, sum#77, isEmpty#78, sum#79, isEmpty#80, sum#81, isEmpty#82, sum#83, isEmpty#84, sum#85, isEmpty#86, sum#87, isEmpty#88, sum#89, isEmpty#90, sum#91, isEmpty#92, sum#93, isEmpty#94, sum#95, isEmpty#96, sum#97, isEmpty#98, sum#99, isEmpty#100, sum#101, isEmpty#102, sum#103, isEmpty#104, sum#105, isEmpty#106, sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118, sum#119, isEmpty#120, sum#121, isEmpty#122] +Keys [7]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, d_year#18] +Functions [24]: [sum(CASE WHEN (d_moy#19 = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#19 = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)] +Aggregate Attributes [24]: [sum(CASE WHEN (d_moy#19 = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#124, sum(CASE WHEN (d_moy#19 = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#125, sum(CASE WHEN (d_moy#19 = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#126, sum(CASE WHEN (d_moy#19 = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#127, sum(CASE WHEN (d_moy#19 = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#128, sum(CASE WHEN (d_moy#19 = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#129, sum(CASE WHEN (d_moy#19 = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#130, sum(CASE WHEN (d_moy#19 = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#131, sum(CASE WHEN (d_moy#19 = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#132, sum(CASE WHEN (d_moy#19 = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#133, sum(CASE WHEN (d_moy#19 = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#134, sum(CASE WHEN (d_moy#19 = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#135, sum(CASE WHEN (d_moy#19 = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#136, sum(CASE WHEN (d_moy#19 = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#137, sum(CASE WHEN (d_moy#19 = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#138, sum(CASE WHEN (d_moy#19 = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#139, sum(CASE WHEN (d_moy#19 = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#140, sum(CASE WHEN (d_moy#19 = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#141, sum(CASE WHEN (d_moy#19 = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#142, sum(CASE WHEN (d_moy#19 = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#143, sum(CASE WHEN (d_moy#19 = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#144, sum(CASE WHEN (d_moy#19 = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#145, sum(CASE WHEN (d_moy#19 = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#146, sum(CASE WHEN (d_moy#19 = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#147] +Results [32]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, DHL,BARIAN AS ship_carriers#148, d_year#18 AS year#149, sum(CASE WHEN (d_moy#19 = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#124 AS jan_sales#150, sum(CASE WHEN (d_moy#19 = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#125 AS feb_sales#151, sum(CASE WHEN (d_moy#19 = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#126 AS mar_sales#152, sum(CASE WHEN (d_moy#19 = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#127 AS apr_sales#153, sum(CASE WHEN (d_moy#19 = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#128 AS may_sales#154, sum(CASE WHEN (d_moy#19 = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#129 AS jun_sales#155, sum(CASE WHEN (d_moy#19 = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#130 AS jul_sales#156, sum(CASE WHEN (d_moy#19 = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#131 AS aug_sales#157, sum(CASE WHEN (d_moy#19 = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#132 AS sep_sales#158, sum(CASE WHEN (d_moy#19 = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#133 AS oct_sales#159, sum(CASE WHEN (d_moy#19 = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#134 AS nov_sales#160, sum(CASE WHEN (d_moy#19 = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price#5 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#135 AS dec_sales#161, sum(CASE WHEN (d_moy#19 = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#136 AS jan_net#162, sum(CASE WHEN (d_moy#19 = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#137 AS feb_net#163, sum(CASE WHEN (d_moy#19 = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#138 AS mar_net#164, sum(CASE WHEN (d_moy#19 = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#139 AS apr_net#165, sum(CASE WHEN (d_moy#19 = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#140 AS may_net#166, sum(CASE WHEN (d_moy#19 = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#141 AS jun_net#167, sum(CASE WHEN (d_moy#19 = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#142 AS jul_net#168, sum(CASE WHEN (d_moy#19 = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#143 AS aug_net#169, sum(CASE WHEN (d_moy#19 = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#144 AS sep_net#170, sum(CASE WHEN (d_moy#19 = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#145 AS oct_net#171, sum(CASE WHEN (d_moy#19 = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#146 AS nov_net#172, sum(CASE WHEN (d_moy#19 = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid#6 as decimal(12,2))) * promote_precision(cast(cast(ws_quantity#4 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#147 AS dec_net#173] + +(33) Scan parquet default.catalog_sales +Output [7]: [cs_sold_time_sk#174, cs_ship_mode_sk#175, cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#180), dynamicpruningexpression(cs_sold_date_sk#180 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_sold_time_sk), IsNotNull(cs_ship_mode_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [7]: [cs_sold_time_sk#174, cs_ship_mode_sk#175, cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180] + +(35) Filter [codegen id : 11] +Input [7]: [cs_sold_time_sk#174, cs_ship_mode_sk#175, cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180] +Condition : ((isnotnull(cs_warehouse_sk#176) AND isnotnull(cs_sold_time_sk#174)) AND isnotnull(cs_ship_mode_sk#175)) + +(36) ReusedExchange [Reuses operator id: 7] +Output [7]: [w_warehouse_sk#181, w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_warehouse_sk#176] +Right keys [1]: [w_warehouse_sk#181] +Join condition: None + +(38) Project [codegen id : 11] +Output [12]: [cs_sold_time_sk#174, cs_ship_mode_sk#175, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180, w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187] +Input [14]: [cs_sold_time_sk#174, cs_ship_mode_sk#175, cs_warehouse_sk#176, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180, w_warehouse_sk#181, w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187] + +(39) ReusedExchange [Reuses operator id: 13] +Output [3]: [d_date_sk#188, d_year#189, d_moy#190] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#180] +Right keys [1]: [d_date_sk#188] +Join condition: None + +(41) Project [codegen id : 11] +Output [13]: [cs_sold_time_sk#174, cs_ship_mode_sk#175, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_year#189, d_moy#190] +Input [15]: [cs_sold_time_sk#174, cs_ship_mode_sk#175, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, cs_sold_date_sk#180, w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_date_sk#188, d_year#189, d_moy#190] + +(42) ReusedExchange [Reuses operator id: 20] +Output [1]: [t_time_sk#191] + +(43) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_time_sk#174] +Right keys [1]: [t_time_sk#191] +Join condition: None + +(44) Project [codegen id : 11] +Output [12]: [cs_ship_mode_sk#175, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_year#189, d_moy#190] +Input [14]: [cs_sold_time_sk#174, cs_ship_mode_sk#175, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_year#189, d_moy#190, t_time_sk#191] + +(45) ReusedExchange [Reuses operator id: 27] +Output [1]: [sm_ship_mode_sk#192] + +(46) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_ship_mode_sk#175] +Right keys [1]: [sm_ship_mode_sk#192] +Join condition: None + +(47) Project [codegen id : 11] +Output [11]: [cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_year#189, d_moy#190] +Input [13]: [cs_ship_mode_sk#175, cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_year#189, d_moy#190, sm_ship_mode_sk#192] + +(48) HashAggregate [codegen id : 11] +Input [11]: [cs_quantity#177, cs_sales_price#178, cs_net_paid_inc_tax#179, w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_year#189, d_moy#190] +Keys [7]: [w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_year#189] +Functions [24]: [partial_sum(CASE WHEN (d_moy#190 = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), partial_sum(CASE WHEN (d_moy#190 = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)] +Aggregate Attributes [48]: [sum#193, isEmpty#194, sum#195, isEmpty#196, sum#197, isEmpty#198, sum#199, isEmpty#200, sum#201, isEmpty#202, sum#203, isEmpty#204, sum#205, isEmpty#206, sum#207, isEmpty#208, sum#209, isEmpty#210, sum#211, isEmpty#212, sum#213, isEmpty#214, sum#215, isEmpty#216, sum#217, isEmpty#218, sum#219, isEmpty#220, sum#221, isEmpty#222, sum#223, isEmpty#224, sum#225, isEmpty#226, sum#227, isEmpty#228, sum#229, isEmpty#230, sum#231, isEmpty#232, sum#233, isEmpty#234, sum#235, isEmpty#236, sum#237, isEmpty#238, sum#239, isEmpty#240] +Results [55]: [w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_year#189, sum#241, isEmpty#242, sum#243, isEmpty#244, sum#245, isEmpty#246, sum#247, isEmpty#248, sum#249, isEmpty#250, sum#251, isEmpty#252, sum#253, isEmpty#254, sum#255, isEmpty#256, sum#257, isEmpty#258, sum#259, isEmpty#260, sum#261, isEmpty#262, sum#263, isEmpty#264, sum#265, isEmpty#266, sum#267, isEmpty#268, sum#269, isEmpty#270, sum#271, isEmpty#272, sum#273, isEmpty#274, sum#275, isEmpty#276, sum#277, isEmpty#278, sum#279, isEmpty#280, sum#281, isEmpty#282, sum#283, isEmpty#284, sum#285, isEmpty#286, sum#287, isEmpty#288] + +(49) Exchange +Input [55]: [w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_year#189, sum#241, isEmpty#242, sum#243, isEmpty#244, sum#245, isEmpty#246, sum#247, isEmpty#248, sum#249, isEmpty#250, sum#251, isEmpty#252, sum#253, isEmpty#254, sum#255, isEmpty#256, sum#257, isEmpty#258, sum#259, isEmpty#260, sum#261, isEmpty#262, sum#263, isEmpty#264, sum#265, isEmpty#266, sum#267, isEmpty#268, sum#269, isEmpty#270, sum#271, isEmpty#272, sum#273, isEmpty#274, sum#275, isEmpty#276, sum#277, isEmpty#278, sum#279, isEmpty#280, sum#281, isEmpty#282, sum#283, isEmpty#284, sum#285, isEmpty#286, sum#287, isEmpty#288] +Arguments: hashpartitioning(w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_year#189, 5), ENSURE_REQUIREMENTS, [id=#289] + +(50) HashAggregate [codegen id : 12] +Input [55]: [w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_year#189, sum#241, isEmpty#242, sum#243, isEmpty#244, sum#245, isEmpty#246, sum#247, isEmpty#248, sum#249, isEmpty#250, sum#251, isEmpty#252, sum#253, isEmpty#254, sum#255, isEmpty#256, sum#257, isEmpty#258, sum#259, isEmpty#260, sum#261, isEmpty#262, sum#263, isEmpty#264, sum#265, isEmpty#266, sum#267, isEmpty#268, sum#269, isEmpty#270, sum#271, isEmpty#272, sum#273, isEmpty#274, sum#275, isEmpty#276, sum#277, isEmpty#278, sum#279, isEmpty#280, sum#281, isEmpty#282, sum#283, isEmpty#284, sum#285, isEmpty#286, sum#287, isEmpty#288] +Keys [7]: [w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, d_year#189] +Functions [24]: [sum(CASE WHEN (d_moy#190 = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END), sum(CASE WHEN (d_moy#190 = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)] +Aggregate Attributes [24]: [sum(CASE WHEN (d_moy#190 = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#290, sum(CASE WHEN (d_moy#190 = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#291, sum(CASE WHEN (d_moy#190 = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#292, sum(CASE WHEN (d_moy#190 = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#293, sum(CASE WHEN (d_moy#190 = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#294, sum(CASE WHEN (d_moy#190 = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#295, sum(CASE WHEN (d_moy#190 = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#296, sum(CASE WHEN (d_moy#190 = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#297, sum(CASE WHEN (d_moy#190 = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#298, sum(CASE WHEN (d_moy#190 = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#299, sum(CASE WHEN (d_moy#190 = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#300, sum(CASE WHEN (d_moy#190 = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#301, sum(CASE WHEN (d_moy#190 = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#302, sum(CASE WHEN (d_moy#190 = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#303, sum(CASE WHEN (d_moy#190 = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#304, sum(CASE WHEN (d_moy#190 = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#305, sum(CASE WHEN (d_moy#190 = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#306, sum(CASE WHEN (d_moy#190 = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#307, sum(CASE WHEN (d_moy#190 = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#308, sum(CASE WHEN (d_moy#190 = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#309, sum(CASE WHEN (d_moy#190 = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#310, sum(CASE WHEN (d_moy#190 = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#311, sum(CASE WHEN (d_moy#190 = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#312, sum(CASE WHEN (d_moy#190 = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#313] +Results [32]: [w_warehouse_name#182, w_warehouse_sq_ft#183, w_city#184, w_county#185, w_state#186, w_country#187, DHL,BARIAN AS ship_carriers#314, d_year#189 AS year#315, sum(CASE WHEN (d_moy#190 = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#290 AS jan_sales#316, sum(CASE WHEN (d_moy#190 = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#291 AS feb_sales#317, sum(CASE WHEN (d_moy#190 = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#292 AS mar_sales#318, sum(CASE WHEN (d_moy#190 = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#293 AS apr_sales#319, sum(CASE WHEN (d_moy#190 = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#294 AS may_sales#320, sum(CASE WHEN (d_moy#190 = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#295 AS jun_sales#321, sum(CASE WHEN (d_moy#190 = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#296 AS jul_sales#322, sum(CASE WHEN (d_moy#190 = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#297 AS aug_sales#323, sum(CASE WHEN (d_moy#190 = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#298 AS sep_sales#324, sum(CASE WHEN (d_moy#190 = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#299 AS oct_sales#325, sum(CASE WHEN (d_moy#190 = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#300 AS nov_sales#326, sum(CASE WHEN (d_moy#190 = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price#178 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#301 AS dec_sales#327, sum(CASE WHEN (d_moy#190 = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#302 AS jan_net#328, sum(CASE WHEN (d_moy#190 = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#303 AS feb_net#329, sum(CASE WHEN (d_moy#190 = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#304 AS mar_net#330, sum(CASE WHEN (d_moy#190 = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#305 AS apr_net#331, sum(CASE WHEN (d_moy#190 = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#306 AS may_net#332, sum(CASE WHEN (d_moy#190 = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#307 AS jun_net#333, sum(CASE WHEN (d_moy#190 = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#308 AS jul_net#334, sum(CASE WHEN (d_moy#190 = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#309 AS aug_net#335, sum(CASE WHEN (d_moy#190 = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#310 AS sep_net#336, sum(CASE WHEN (d_moy#190 = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#311 AS oct_net#337, sum(CASE WHEN (d_moy#190 = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#312 AS nov_net#338, sum(CASE WHEN (d_moy#190 = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax#179 as decimal(12,2))) * promote_precision(cast(cast(cs_quantity#177 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END)#313 AS dec_net#339] + +(51) Union + +(52) HashAggregate [codegen id : 13] +Input [32]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, ship_carriers#148, year#149, jan_sales#150, feb_sales#151, mar_sales#152, apr_sales#153, may_sales#154, jun_sales#155, jul_sales#156, aug_sales#157, sep_sales#158, oct_sales#159, nov_sales#160, dec_sales#161, jan_net#162, feb_net#163, mar_net#164, apr_net#165, may_net#166, jun_net#167, jul_net#168, aug_net#169, sep_net#170, oct_net#171, nov_net#172, dec_net#173] +Keys [8]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, ship_carriers#148, year#149] +Functions [36]: [partial_sum(jan_sales#150), partial_sum(feb_sales#151), partial_sum(mar_sales#152), partial_sum(apr_sales#153), partial_sum(may_sales#154), partial_sum(jun_sales#155), partial_sum(jul_sales#156), partial_sum(aug_sales#157), partial_sum(sep_sales#158), partial_sum(oct_sales#159), partial_sum(nov_sales#160), partial_sum(dec_sales#161), partial_sum(CheckOverflow((promote_precision(jan_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(feb_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(mar_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(apr_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(may_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jun_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(jul_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(aug_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(sep_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(oct_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(nov_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(CheckOverflow((promote_precision(dec_sales#161) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), partial_sum(jan_net#162), partial_sum(feb_net#163), partial_sum(mar_net#164), partial_sum(apr_net#165), partial_sum(may_net#166), partial_sum(jun_net#167), partial_sum(jul_net#168), partial_sum(aug_net#169), partial_sum(sep_net#170), partial_sum(oct_net#171), partial_sum(nov_net#172), partial_sum(dec_net#173)] +Aggregate Attributes [72]: [sum#340, isEmpty#341, sum#342, isEmpty#343, sum#344, isEmpty#345, sum#346, isEmpty#347, sum#348, isEmpty#349, sum#350, isEmpty#351, sum#352, isEmpty#353, sum#354, isEmpty#355, sum#356, isEmpty#357, sum#358, isEmpty#359, sum#360, isEmpty#361, sum#362, isEmpty#363, sum#364, isEmpty#365, sum#366, isEmpty#367, sum#368, isEmpty#369, sum#370, isEmpty#371, sum#372, isEmpty#373, sum#374, isEmpty#375, sum#376, isEmpty#377, sum#378, isEmpty#379, sum#380, isEmpty#381, sum#382, isEmpty#383, sum#384, isEmpty#385, sum#386, isEmpty#387, sum#388, isEmpty#389, sum#390, isEmpty#391, sum#392, isEmpty#393, sum#394, isEmpty#395, sum#396, isEmpty#397, sum#398, isEmpty#399, sum#400, isEmpty#401, sum#402, isEmpty#403, sum#404, isEmpty#405, sum#406, isEmpty#407, sum#408, isEmpty#409, sum#410, isEmpty#411] +Results [80]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, ship_carriers#148, year#149, sum#412, isEmpty#413, sum#414, isEmpty#415, sum#416, isEmpty#417, sum#418, isEmpty#419, sum#420, isEmpty#421, sum#422, isEmpty#423, sum#424, isEmpty#425, sum#426, isEmpty#427, sum#428, isEmpty#429, sum#430, isEmpty#431, sum#432, isEmpty#433, sum#434, isEmpty#435, sum#436, isEmpty#437, sum#438, isEmpty#439, sum#440, isEmpty#441, sum#442, isEmpty#443, sum#444, isEmpty#445, sum#446, isEmpty#447, sum#448, isEmpty#449, sum#450, isEmpty#451, sum#452, isEmpty#453, sum#454, isEmpty#455, sum#456, isEmpty#457, sum#458, isEmpty#459, sum#460, isEmpty#461, sum#462, isEmpty#463, sum#464, isEmpty#465, sum#466, isEmpty#467, sum#468, isEmpty#469, sum#470, isEmpty#471, sum#472, isEmpty#473, sum#474, isEmpty#475, sum#476, isEmpty#477, sum#478, isEmpty#479, sum#480, isEmpty#481, sum#482, isEmpty#483] + +(53) Exchange +Input [80]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, ship_carriers#148, year#149, sum#412, isEmpty#413, sum#414, isEmpty#415, sum#416, isEmpty#417, sum#418, isEmpty#419, sum#420, isEmpty#421, sum#422, isEmpty#423, sum#424, isEmpty#425, sum#426, isEmpty#427, sum#428, isEmpty#429, sum#430, isEmpty#431, sum#432, isEmpty#433, sum#434, isEmpty#435, sum#436, isEmpty#437, sum#438, isEmpty#439, sum#440, isEmpty#441, sum#442, isEmpty#443, sum#444, isEmpty#445, sum#446, isEmpty#447, sum#448, isEmpty#449, sum#450, isEmpty#451, sum#452, isEmpty#453, sum#454, isEmpty#455, sum#456, isEmpty#457, sum#458, isEmpty#459, sum#460, isEmpty#461, sum#462, isEmpty#463, sum#464, isEmpty#465, sum#466, isEmpty#467, sum#468, isEmpty#469, sum#470, isEmpty#471, sum#472, isEmpty#473, sum#474, isEmpty#475, sum#476, isEmpty#477, sum#478, isEmpty#479, sum#480, isEmpty#481, sum#482, isEmpty#483] +Arguments: hashpartitioning(w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, ship_carriers#148, year#149, 5), ENSURE_REQUIREMENTS, [id=#484] + +(54) HashAggregate [codegen id : 14] +Input [80]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, ship_carriers#148, year#149, sum#412, isEmpty#413, sum#414, isEmpty#415, sum#416, isEmpty#417, sum#418, isEmpty#419, sum#420, isEmpty#421, sum#422, isEmpty#423, sum#424, isEmpty#425, sum#426, isEmpty#427, sum#428, isEmpty#429, sum#430, isEmpty#431, sum#432, isEmpty#433, sum#434, isEmpty#435, sum#436, isEmpty#437, sum#438, isEmpty#439, sum#440, isEmpty#441, sum#442, isEmpty#443, sum#444, isEmpty#445, sum#446, isEmpty#447, sum#448, isEmpty#449, sum#450, isEmpty#451, sum#452, isEmpty#453, sum#454, isEmpty#455, sum#456, isEmpty#457, sum#458, isEmpty#459, sum#460, isEmpty#461, sum#462, isEmpty#463, sum#464, isEmpty#465, sum#466, isEmpty#467, sum#468, isEmpty#469, sum#470, isEmpty#471, sum#472, isEmpty#473, sum#474, isEmpty#475, sum#476, isEmpty#477, sum#478, isEmpty#479, sum#480, isEmpty#481, sum#482, isEmpty#483] +Keys [8]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, ship_carriers#148, year#149] +Functions [36]: [sum(jan_sales#150), sum(feb_sales#151), sum(mar_sales#152), sum(apr_sales#153), sum(may_sales#154), sum(jun_sales#155), sum(jul_sales#156), sum(aug_sales#157), sum(sep_sales#158), sum(oct_sales#159), sum(nov_sales#160), sum(dec_sales#161), sum(CheckOverflow((promote_precision(jan_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(feb_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(mar_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(apr_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(may_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jun_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(jul_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(aug_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(sep_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(oct_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(nov_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(CheckOverflow((promote_precision(dec_sales#161) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)), sum(jan_net#162), sum(feb_net#163), sum(mar_net#164), sum(apr_net#165), sum(may_net#166), sum(jun_net#167), sum(jul_net#168), sum(aug_net#169), sum(sep_net#170), sum(oct_net#171), sum(nov_net#172), sum(dec_net#173)] +Aggregate Attributes [36]: [sum(jan_sales#150)#485, sum(feb_sales#151)#486, sum(mar_sales#152)#487, sum(apr_sales#153)#488, sum(may_sales#154)#489, sum(jun_sales#155)#490, sum(jul_sales#156)#491, sum(aug_sales#157)#492, sum(sep_sales#158)#493, sum(oct_sales#159)#494, sum(nov_sales#160)#495, sum(dec_sales#161)#496, sum(CheckOverflow((promote_precision(jan_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#497, sum(CheckOverflow((promote_precision(feb_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#498, sum(CheckOverflow((promote_precision(mar_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#499, sum(CheckOverflow((promote_precision(apr_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#500, sum(CheckOverflow((promote_precision(may_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#501, sum(CheckOverflow((promote_precision(jun_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#502, sum(CheckOverflow((promote_precision(jul_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#503, sum(CheckOverflow((promote_precision(aug_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#504, sum(CheckOverflow((promote_precision(sep_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#505, sum(CheckOverflow((promote_precision(oct_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#506, sum(CheckOverflow((promote_precision(nov_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#507, sum(CheckOverflow((promote_precision(dec_sales#161) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#508, sum(jan_net#162)#509, sum(feb_net#163)#510, sum(mar_net#164)#511, sum(apr_net#165)#512, sum(may_net#166)#513, sum(jun_net#167)#514, sum(jul_net#168)#515, sum(aug_net#169)#516, sum(sep_net#170)#517, sum(oct_net#171)#518, sum(nov_net#172)#519, sum(dec_net#173)#520] +Results [44]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, ship_carriers#148, year#149, sum(jan_sales#150)#485 AS jan_sales#521, sum(feb_sales#151)#486 AS feb_sales#522, sum(mar_sales#152)#487 AS mar_sales#523, sum(apr_sales#153)#488 AS apr_sales#524, sum(may_sales#154)#489 AS may_sales#525, sum(jun_sales#155)#490 AS jun_sales#526, sum(jul_sales#156)#491 AS jul_sales#527, sum(aug_sales#157)#492 AS aug_sales#528, sum(sep_sales#158)#493 AS sep_sales#529, sum(oct_sales#159)#494 AS oct_sales#530, sum(nov_sales#160)#495 AS nov_sales#531, sum(dec_sales#161)#496 AS dec_sales#532, sum(CheckOverflow((promote_precision(jan_sales#150) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#497 AS jan_sales_per_sq_foot#533, sum(CheckOverflow((promote_precision(feb_sales#151) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#498 AS feb_sales_per_sq_foot#534, sum(CheckOverflow((promote_precision(mar_sales#152) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#499 AS mar_sales_per_sq_foot#535, sum(CheckOverflow((promote_precision(apr_sales#153) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#500 AS apr_sales_per_sq_foot#536, sum(CheckOverflow((promote_precision(may_sales#154) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#501 AS may_sales_per_sq_foot#537, sum(CheckOverflow((promote_precision(jun_sales#155) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#502 AS jun_sales_per_sq_foot#538, sum(CheckOverflow((promote_precision(jul_sales#156) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#503 AS jul_sales_per_sq_foot#539, sum(CheckOverflow((promote_precision(aug_sales#157) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#504 AS aug_sales_per_sq_foot#540, sum(CheckOverflow((promote_precision(sep_sales#158) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#505 AS sep_sales_per_sq_foot#541, sum(CheckOverflow((promote_precision(oct_sales#159) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#506 AS oct_sales_per_sq_foot#542, sum(CheckOverflow((promote_precision(nov_sales#160) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#507 AS nov_sales_per_sq_foot#543, sum(CheckOverflow((promote_precision(dec_sales#161) / promote_precision(cast(cast(w_warehouse_sq_ft#11 as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true))#508 AS dec_sales_per_sq_foot#544, sum(jan_net#162)#509 AS jan_net#545, sum(feb_net#163)#510 AS feb_net#546, sum(mar_net#164)#511 AS mar_net#547, sum(apr_net#165)#512 AS apr_net#548, sum(may_net#166)#513 AS may_net#549, sum(jun_net#167)#514 AS jun_net#550, sum(jul_net#168)#515 AS jul_net#551, sum(aug_net#169)#516 AS aug_net#552, sum(sep_net#170)#517 AS sep_net#553, sum(oct_net#171)#518 AS oct_net#554, sum(nov_net#172)#519 AS nov_net#555, sum(dec_net#173)#520 AS dec_net#556] + +(55) TakeOrderedAndProject +Input [44]: [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, ship_carriers#148, year#149, jan_sales#521, feb_sales#522, mar_sales#523, apr_sales#524, may_sales#525, jun_sales#526, jul_sales#527, aug_sales#528, sep_sales#529, oct_sales#530, nov_sales#531, dec_sales#532, jan_sales_per_sq_foot#533, feb_sales_per_sq_foot#534, mar_sales_per_sq_foot#535, apr_sales_per_sq_foot#536, may_sales_per_sq_foot#537, jun_sales_per_sq_foot#538, jul_sales_per_sq_foot#539, aug_sales_per_sq_foot#540, sep_sales_per_sq_foot#541, oct_sales_per_sq_foot#542, nov_sales_per_sq_foot#543, dec_sales_per_sq_foot#544, jan_net#545, feb_net#546, mar_net#547, apr_net#548, may_net#549, jun_net#550, jul_net#551, aug_net#552, sep_net#553, oct_net#554, nov_net#555, dec_net#556] +Arguments: 100, [w_warehouse_name#10 ASC NULLS FIRST], [w_warehouse_name#10, w_warehouse_sq_ft#11, w_city#12, w_county#13, w_state#14, w_country#15, ship_carriers#148, year#149, jan_sales#521, feb_sales#522, mar_sales#523, apr_sales#524, may_sales#525, jun_sales#526, jul_sales#527, aug_sales#528, sep_sales#529, oct_sales#530, nov_sales#531, dec_sales#532, jan_sales_per_sq_foot#533, feb_sales_per_sq_foot#534, mar_sales_per_sq_foot#535, apr_sales_per_sq_foot#536, ... 20 more fields] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (56) + + +(56) ReusedExchange [Reuses operator id: 13] +Output [3]: [d_date_sk#17, d_year#18, d_moy#19] + +Subquery:2 Hosting operator id = 33 Hosting Expression = cs_sold_date_sk#180 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/simplified.txt new file mode 100644 index 0000000000000..ae0b56b8aa037 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q66/simplified.txt @@ -0,0 +1,86 @@ +TakeOrderedAndProject [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_sales_per_sq_foot,feb_sales_per_sq_foot,mar_sales_per_sq_foot,apr_sales_per_sq_foot,may_sales_per_sq_foot,jun_sales_per_sq_foot,jul_sales_per_sq_foot,aug_sales_per_sq_foot,sep_sales_per_sq_foot,oct_sales_per_sq_foot,nov_sales_per_sq_foot,dec_sales_per_sq_foot,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net] + WholeStageCodegen (14) + HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(jan_sales),sum(feb_sales),sum(mar_sales),sum(apr_sales),sum(may_sales),sum(jun_sales),sum(jul_sales),sum(aug_sales),sum(sep_sales),sum(oct_sales),sum(nov_sales),sum(dec_sales),sum(CheckOverflow((promote_precision(jan_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(feb_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(mar_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(apr_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(may_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(jun_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(jul_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(aug_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(sep_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(oct_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(nov_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(CheckOverflow((promote_precision(dec_sales) / promote_precision(cast(cast(w_warehouse_sq_ft as decimal(10,0)) as decimal(28,2)))), DecimalType(38,12), true)),sum(jan_net),sum(feb_net),sum(mar_net),sum(apr_net),sum(may_net),sum(jun_net),sum(jul_net),sum(aug_net),sum(sep_net),sum(oct_net),sum(nov_net),sum(dec_net),jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_sales_per_sq_foot,feb_sales_per_sq_foot,mar_sales_per_sq_foot,apr_sales_per_sq_foot,may_sales_per_sq_foot,jun_sales_per_sq_foot,jul_sales_per_sq_foot,aug_sales_per_sq_foot,sep_sales_per_sq_foot,oct_sales_per_sq_foot,nov_sales_per_sq_foot,dec_sales_per_sq_foot,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year] #1 + WholeStageCodegen (13) + HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (6) + HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(ws_ext_sales_price as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(ws_net_paid as decimal(12,2))) * promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year] #2 + WholeStageCodegen (5) + HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,d_moy,ws_ext_sales_price,ws_quantity,ws_net_paid] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + Project [ws_quantity,ws_ext_sales_price,ws_net_paid,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,d_moy] + BroadcastHashJoin [ws_ship_mode_sk,sm_ship_mode_sk] + Project [ws_ship_mode_sk,ws_quantity,ws_ext_sales_price,ws_net_paid,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,d_moy] + BroadcastHashJoin [ws_sold_time_sk,t_time_sk] + Project [ws_sold_time_sk,ws_ship_mode_sk,ws_quantity,ws_ext_sales_price,ws_net_paid,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,d_moy] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_sold_time_sk,ws_ship_mode_sk,ws_quantity,ws_ext_sales_price,ws_net_paid,ws_sold_date_sk,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country] + BroadcastHashJoin [ws_warehouse_sk,w_warehouse_sk] + Filter [ws_warehouse_sk,ws_sold_time_sk,ws_ship_mode_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_time_sk,ws_ship_mode_sk,ws_warehouse_sk,ws_quantity,ws_ext_sales_price,ws_net_paid,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [t_time_sk] + Filter [t_time,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_time] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Project [sm_ship_mode_sk] + Filter [sm_carrier,sm_ship_mode_sk] + ColumnarToRow + InputAdapter + Scan parquet default.ship_mode [sm_ship_mode_sk,sm_carrier] + WholeStageCodegen (12) + HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(cs_sales_price as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 1) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 2) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 3) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 4) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 5) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 6) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 7) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 8) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 9) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 10) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 11) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),sum(CASE WHEN (d_moy = 12) THEN CheckOverflow((promote_precision(cast(cs_net_paid_inc_tax as decimal(12,2))) * promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true) ELSE 0.00 END),ship_carriers,year,jan_sales,feb_sales,mar_sales,apr_sales,may_sales,jun_sales,jul_sales,aug_sales,sep_sales,oct_sales,nov_sales,dec_sales,jan_net,feb_net,mar_net,apr_net,may_net,jun_net,jul_net,aug_net,sep_net,oct_net,nov_net,dec_net,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year] #7 + WholeStageCodegen (11) + HashAggregate [w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,d_moy,cs_sales_price,cs_quantity,cs_net_paid_inc_tax] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + Project [cs_quantity,cs_sales_price,cs_net_paid_inc_tax,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,d_moy] + BroadcastHashJoin [cs_ship_mode_sk,sm_ship_mode_sk] + Project [cs_ship_mode_sk,cs_quantity,cs_sales_price,cs_net_paid_inc_tax,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,d_moy] + BroadcastHashJoin [cs_sold_time_sk,t_time_sk] + Project [cs_sold_time_sk,cs_ship_mode_sk,cs_quantity,cs_sales_price,cs_net_paid_inc_tax,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country,d_year,d_moy] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sold_time_sk,cs_ship_mode_sk,cs_quantity,cs_sales_price,cs_net_paid_inc_tax,cs_sold_date_sk,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country] + BroadcastHashJoin [cs_warehouse_sk,w_warehouse_sk] + Filter [cs_warehouse_sk,cs_sold_time_sk,cs_ship_mode_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_time_sk,cs_ship_mode_sk,cs_warehouse_sk,cs_quantity,cs_sales_price,cs_net_paid_inc_tax,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [w_warehouse_sk,w_warehouse_name,w_warehouse_sq_ft,w_city,w_county,w_state,w_country] #4 + InputAdapter + ReusedExchange [d_date_sk,d_year,d_moy] #3 + InputAdapter + ReusedExchange [t_time_sk] #5 + InputAdapter + ReusedExchange [sm_ship_mode_sk] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/explain.txt new file mode 100644 index 0000000000000..3a19c3923737d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/explain.txt @@ -0,0 +1,201 @@ +== Physical Plan == +TakeOrderedAndProject (34) ++- * Filter (33) + +- Window (32) + +- * Sort (31) + +- Exchange (30) + +- * HashAggregate (29) + +- Exchange (28) + +- * HashAggregate (27) + +- * Expand (26) + +- * Project (25) + +- * SortMergeJoin Inner (24) + :- * Sort (18) + : +- Exchange (17) + : +- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.store (11) + +- * Sort (23) + +- Exchange (22) + +- * Filter (21) + +- * ColumnarToRow (20) + +- Scan parquet default.item (19) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 3] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5] +Condition : (isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] + +(6) Filter [codegen id : 1] +Input [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] +Condition : (((isnotnull(d_month_seq#8) AND (d_month_seq#8 >= 1200)) AND (d_month_seq#8 <= 1211)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [4]: [d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] +Input [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] + +(8) BroadcastExchange +Input [4]: [d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 3] +Output [7]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5, d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#13, s_store_id#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#13, s_store_id#14] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#13, s_store_id#14] +Condition : isnotnull(s_store_sk#13) + +(14) BroadcastExchange +Input [2]: [s_store_sk#13, s_store_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#13] +Join condition: None + +(16) Project [codegen id : 3] +Output [7]: [ss_item_sk#1, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_sk#13, s_store_id#14] + +(17) Exchange +Input [7]: [ss_item_sk#1, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#16] + +(18) Sort [codegen id : 4] +Input [7]: [ss_item_sk#1, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.item +Output [5]: [i_item_sk#17, i_brand#18, i_class#19, i_category#20, i_product_name#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 5] +Input [5]: [i_item_sk#17, i_brand#18, i_class#19, i_category#20, i_product_name#21] + +(21) Filter [codegen id : 5] +Input [5]: [i_item_sk#17, i_brand#18, i_class#19, i_category#20, i_product_name#21] +Condition : isnotnull(i_item_sk#17) + +(22) Exchange +Input [5]: [i_item_sk#17, i_brand#18, i_class#19, i_category#20, i_product_name#21] +Arguments: hashpartitioning(i_item_sk#17, 5), ENSURE_REQUIREMENTS, [id=#22] + +(23) Sort [codegen id : 6] +Input [5]: [i_item_sk#17, i_brand#18, i_class#19, i_category#20, i_product_name#21] +Arguments: [i_item_sk#17 ASC NULLS FIRST], false, 0 + +(24) SortMergeJoin [codegen id : 7] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#17] +Join condition: None + +(25) Project [codegen id : 7] +Output [10]: [ss_quantity#3, ss_sales_price#4, i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14] +Input [12]: [ss_item_sk#1, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14, i_item_sk#17, i_brand#18, i_class#19, i_category#20, i_product_name#21] + +(26) Expand [codegen id : 7] +Input [10]: [ss_quantity#3, ss_sales_price#4, i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14] +Arguments: [List(ss_quantity#3, ss_sales_price#4, i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, 0), List(ss_quantity#3, ss_sales_price#4, i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, null, 1), List(ss_quantity#3, ss_sales_price#4, i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, null, null, 3), List(ss_quantity#3, ss_sales_price#4, i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, null, null, null, 7), List(ss_quantity#3, ss_sales_price#4, i_category#20, i_class#19, i_brand#18, i_product_name#21, null, null, null, null, 15), List(ss_quantity#3, ss_sales_price#4, i_category#20, i_class#19, i_brand#18, null, null, null, null, null, 31), List(ss_quantity#3, ss_sales_price#4, i_category#20, i_class#19, null, null, null, null, null, null, 63), List(ss_quantity#3, ss_sales_price#4, i_category#20, null, null, null, null, null, null, null, 127), List(ss_quantity#3, ss_sales_price#4, null, null, null, null, null, null, null, null, 255)], [ss_quantity#3, ss_sales_price#4, i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, spark_grouping_id#31] + +(27) HashAggregate [codegen id : 7] +Input [11]: [ss_quantity#3, ss_sales_price#4, i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, spark_grouping_id#31] +Keys [9]: [i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, spark_grouping_id#31] +Functions [1]: [partial_sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [2]: [sum#32, isEmpty#33] +Results [11]: [i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, spark_grouping_id#31, sum#34, isEmpty#35] + +(28) Exchange +Input [11]: [i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, spark_grouping_id#31, sum#34, isEmpty#35] +Arguments: hashpartitioning(i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, spark_grouping_id#31, 5), ENSURE_REQUIREMENTS, [id=#36] + +(29) HashAggregate [codegen id : 8] +Input [11]: [i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, spark_grouping_id#31, sum#34, isEmpty#35] +Keys [9]: [i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, spark_grouping_id#31] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#37] +Results [9]: [i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#37 AS sumsales#38] + +(30) Exchange +Input [9]: [i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, sumsales#38] +Arguments: hashpartitioning(i_category#23, 5), ENSURE_REQUIREMENTS, [id=#39] + +(31) Sort [codegen id : 9] +Input [9]: [i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, sumsales#38] +Arguments: [i_category#23 ASC NULLS FIRST, sumsales#38 DESC NULLS LAST], false, 0 + +(32) Window +Input [9]: [i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, sumsales#38] +Arguments: [rank(sumsales#38) windowspecdefinition(i_category#23, sumsales#38 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#40], [i_category#23], [sumsales#38 DESC NULLS LAST] + +(33) Filter [codegen id : 10] +Input [10]: [i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, sumsales#38, rk#40] +Condition : (rk#40 <= 100) + +(34) TakeOrderedAndProject +Input [10]: [i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, sumsales#38, rk#40] +Arguments: 100, [i_category#23 ASC NULLS FIRST, i_class#24 ASC NULLS FIRST, i_brand#25 ASC NULLS FIRST, i_product_name#26 ASC NULLS FIRST, d_year#27 ASC NULLS FIRST, d_qoy#28 ASC NULLS FIRST, d_moy#29 ASC NULLS FIRST, s_store_id#30 ASC NULLS FIRST, sumsales#38 ASC NULLS FIRST, rk#40 ASC NULLS FIRST], [i_category#23, i_class#24, i_brand#25, i_product_name#26, d_year#27, d_qoy#28, d_moy#29, s_store_id#30, sumsales#38, rk#40] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 8] +Output [4]: [d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/simplified.txt new file mode 100644 index 0000000000000..ceff615184818 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67.sf100/simplified.txt @@ -0,0 +1,59 @@ +TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,rk] + WholeStageCodegen (10) + Filter [rk] + InputAdapter + Window [sumsales,i_category] + WholeStageCodegen (9) + Sort [i_category,sumsales] + InputAdapter + Exchange [i_category] #1 + WholeStageCodegen (8) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,spark_grouping_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,spark_grouping_id] #2 + WholeStageCodegen (7) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,spark_grouping_id,ss_sales_price,ss_quantity] [sum,isEmpty,sum,isEmpty] + Expand [ss_quantity,ss_sales_price,i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id] + Project [ss_quantity,ss_sales_price,i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #3 + WholeStageCodegen (3) + Project [ss_item_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy,s_store_id] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy,d_qoy] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk,d_year,d_moy,d_qoy] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq,d_year,d_moy,d_qoy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #6 + WholeStageCodegen (5) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_product_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67/explain.txt new file mode 100644 index 0000000000000..3d42f49415640 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67/explain.txt @@ -0,0 +1,186 @@ +== Physical Plan == +TakeOrderedAndProject (31) ++- * Filter (30) + +- Window (29) + +- * Sort (28) + +- Exchange (27) + +- * HashAggregate (26) + +- Exchange (25) + +- * HashAggregate (24) + +- * Expand (23) + +- * Project (22) + +- * BroadcastHashJoin Inner BuildRight (21) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.store (11) + +- BroadcastExchange (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.item (17) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5] +Condition : (isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] + +(6) Filter [codegen id : 1] +Input [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] +Condition : (((isnotnull(d_month_seq#8) AND (d_month_seq#8 >= 1200)) AND (d_month_seq#8 <= 1211)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [4]: [d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] +Input [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] + +(8) BroadcastExchange +Input [4]: [d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [7]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5, d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#13, s_store_id#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#13, s_store_id#14] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#13, s_store_id#14] +Condition : isnotnull(s_store_sk#13) + +(14) BroadcastExchange +Input [2]: [s_store_sk#13, s_store_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#13] +Join condition: None + +(16) Project [codegen id : 4] +Output [7]: [ss_item_sk#1, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_sk#13, s_store_id#14] + +(17) Scan parquet default.item +Output [5]: [i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [5]: [i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] + +(19) Filter [codegen id : 3] +Input [5]: [i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] +Condition : isnotnull(i_item_sk#16) + +(20) BroadcastExchange +Input [5]: [i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#16] +Join condition: None + +(22) Project [codegen id : 4] +Output [10]: [ss_quantity#3, ss_sales_price#4, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14] +Input [12]: [ss_item_sk#1, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14, i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] + +(23) Expand [codegen id : 4] +Input [10]: [ss_quantity#3, ss_sales_price#4, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14] +Arguments: [List(ss_quantity#3, ss_sales_price#4, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, 0), List(ss_quantity#3, ss_sales_price#4, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, null, 1), List(ss_quantity#3, ss_sales_price#4, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, null, null, 3), List(ss_quantity#3, ss_sales_price#4, i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, null, null, null, 7), List(ss_quantity#3, ss_sales_price#4, i_category#19, i_class#18, i_brand#17, i_product_name#20, null, null, null, null, 15), List(ss_quantity#3, ss_sales_price#4, i_category#19, i_class#18, i_brand#17, null, null, null, null, null, 31), List(ss_quantity#3, ss_sales_price#4, i_category#19, i_class#18, null, null, null, null, null, null, 63), List(ss_quantity#3, ss_sales_price#4, i_category#19, null, null, null, null, null, null, null, 127), List(ss_quantity#3, ss_sales_price#4, null, null, null, null, null, null, null, null, 255)], [ss_quantity#3, ss_sales_price#4, i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] + +(24) HashAggregate [codegen id : 4] +Input [11]: [ss_quantity#3, ss_sales_price#4, i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] +Keys [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] +Functions [1]: [partial_sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [2]: [sum#31, isEmpty#32] +Results [11]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30, sum#33, isEmpty#34] + +(25) Exchange +Input [11]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30, sum#33, isEmpty#34] +Arguments: hashpartitioning(i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30, 5), ENSURE_REQUIREMENTS, [id=#35] + +(26) HashAggregate [codegen id : 5] +Input [11]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30, sum#33, isEmpty#34] +Keys [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, spark_grouping_id#30] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#36] +Results [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#36 AS sumsales#37] + +(27) Exchange +Input [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sumsales#37] +Arguments: hashpartitioning(i_category#22, 5), ENSURE_REQUIREMENTS, [id=#38] + +(28) Sort [codegen id : 6] +Input [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sumsales#37] +Arguments: [i_category#22 ASC NULLS FIRST, sumsales#37 DESC NULLS LAST], false, 0 + +(29) Window +Input [9]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sumsales#37] +Arguments: [rank(sumsales#37) windowspecdefinition(i_category#22, sumsales#37 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#39], [i_category#22], [sumsales#37 DESC NULLS LAST] + +(30) Filter [codegen id : 7] +Input [10]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sumsales#37, rk#39] +Condition : (rk#39 <= 100) + +(31) TakeOrderedAndProject +Input [10]: [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sumsales#37, rk#39] +Arguments: 100, [i_category#22 ASC NULLS FIRST, i_class#23 ASC NULLS FIRST, i_brand#24 ASC NULLS FIRST, i_product_name#25 ASC NULLS FIRST, d_year#26 ASC NULLS FIRST, d_qoy#27 ASC NULLS FIRST, d_moy#28 ASC NULLS FIRST, s_store_id#29 ASC NULLS FIRST, sumsales#37 ASC NULLS FIRST, rk#39 ASC NULLS FIRST], [i_category#22, i_class#23, i_brand#24, i_product_name#25, d_year#26, d_qoy#27, d_moy#28, s_store_id#29, sumsales#37, rk#39] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (32) + + +(32) ReusedExchange [Reuses operator id: 8] +Output [4]: [d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67/simplified.txt new file mode 100644 index 0000000000000..a7cc283af5aa1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q67/simplified.txt @@ -0,0 +1,50 @@ +TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,rk] + WholeStageCodegen (7) + Filter [rk] + InputAdapter + Window [sumsales,i_category] + WholeStageCodegen (6) + Sort [i_category,sumsales] + InputAdapter + Exchange [i_category] #1 + WholeStageCodegen (5) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,spark_grouping_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,spark_grouping_id] #2 + WholeStageCodegen (4) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,spark_grouping_id,ss_sales_price,ss_quantity] [sum,isEmpty,sum,isEmpty] + Expand [ss_quantity,ss_sales_price,i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id] + Project [ss_quantity,ss_sales_price,i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy,s_store_id] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy,d_qoy] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk,d_year,d_moy,d_qoy] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq,d_year,d_moy,d_qoy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_product_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/explain.txt new file mode 100644 index 0000000000000..b6a609ec193b4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/explain.txt @@ -0,0 +1,292 @@ +== Physical Plan == +TakeOrderedAndProject (51) ++- * Project (50) + +- * SortMergeJoin Inner (49) + :- * Sort (14) + : +- Exchange (13) + : +- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.customer (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.customer_address (6) + +- * Sort (48) + +- Exchange (47) + +- * HashAggregate (46) + +- * HashAggregate (45) + +- * Project (44) + +- * SortMergeJoin Inner (43) + :- * Sort (40) + : +- Exchange (39) + : +- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Project (31) + : : +- * BroadcastHashJoin Inner BuildRight (30) + : : :- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Filter (17) + : : : : +- * ColumnarToRow (16) + : : : : +- Scan parquet default.store_sales (15) + : : : +- BroadcastExchange (22) + : : : +- * Project (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.date_dim (18) + : : +- BroadcastExchange (29) + : : +- * Project (28) + : : +- * Filter (27) + : : +- * ColumnarToRow (26) + : : +- Scan parquet default.store (25) + : +- BroadcastExchange (36) + : +- * Project (35) + : +- * Filter (34) + : +- * ColumnarToRow (33) + : +- Scan parquet default.household_demographics (32) + +- * Sort (42) + +- ReusedExchange (41) + + +(1) Scan parquet default.customer +Output [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] + +(3) Filter [codegen id : 1] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#2)) + +(4) Exchange +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Arguments: hashpartitioning(c_current_addr_sk#2, 5), ENSURE_REQUIREMENTS, [id=#5] + +(5) Sort [codegen id : 2] +Input [4]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4] +Arguments: [c_current_addr_sk#2 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.customer_address +Output [2]: [ca_address_sk#6, ca_city#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [2]: [ca_address_sk#6, ca_city#7] + +(8) Filter [codegen id : 3] +Input [2]: [ca_address_sk#6, ca_city#7] +Condition : (isnotnull(ca_address_sk#6) AND isnotnull(ca_city#7)) + +(9) Exchange +Input [2]: [ca_address_sk#6, ca_city#7] +Arguments: hashpartitioning(ca_address_sk#6, 5), ENSURE_REQUIREMENTS, [id=#8] + +(10) Sort [codegen id : 4] +Input [2]: [ca_address_sk#6, ca_city#7] +Arguments: [ca_address_sk#6 ASC NULLS FIRST], false, 0 + +(11) SortMergeJoin [codegen id : 5] +Left keys [1]: [c_current_addr_sk#2] +Right keys [1]: [ca_address_sk#6] +Join condition: None + +(12) Project [codegen id : 5] +Output [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] +Input [6]: [c_customer_sk#1, c_current_addr_sk#2, c_first_name#3, c_last_name#4, ca_address_sk#6, ca_city#7] + +(13) Exchange +Input [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] +Arguments: hashpartitioning(c_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] + +(14) Sort [codegen id : 6] +Input [4]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 + +(15) Scan parquet default.store_sales +Output [9]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17, ss_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#18), dynamicpruningexpression(ss_sold_date_sk#18 IN dynamicpruning#19)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 10] +Input [9]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17, ss_sold_date_sk#18] + +(17) Filter [codegen id : 10] +Input [9]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17, ss_sold_date_sk#18] +Condition : (((isnotnull(ss_store_sk#13) AND isnotnull(ss_hdemo_sk#11)) AND isnotnull(ss_addr_sk#12)) AND isnotnull(ss_customer_sk#10)) + +(18) Scan parquet default.date_dim +Output [3]: [d_date_sk#20, d_year#21, d_dom#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 7] +Input [3]: [d_date_sk#20, d_year#21, d_dom#22] + +(20) Filter [codegen id : 7] +Input [3]: [d_date_sk#20, d_year#21, d_dom#22] +Condition : ((((isnotnull(d_dom#22) AND (d_dom#22 >= 1)) AND (d_dom#22 <= 2)) AND d_year#21 IN (1999,2000,2001)) AND isnotnull(d_date_sk#20)) + +(21) Project [codegen id : 7] +Output [1]: [d_date_sk#20] +Input [3]: [d_date_sk#20, d_year#21, d_dom#22] + +(22) BroadcastExchange +Input [1]: [d_date_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] + +(23) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#18] +Right keys [1]: [d_date_sk#20] +Join condition: None + +(24) Project [codegen id : 10] +Output [8]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17] +Input [10]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17, ss_sold_date_sk#18, d_date_sk#20] + +(25) Scan parquet default.store +Output [2]: [s_store_sk#24, s_city#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_city, [Midway,Fairview]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 8] +Input [2]: [s_store_sk#24, s_city#25] + +(27) Filter [codegen id : 8] +Input [2]: [s_store_sk#24, s_city#25] +Condition : (s_city#25 IN (Midway,Fairview) AND isnotnull(s_store_sk#24)) + +(28) Project [codegen id : 8] +Output [1]: [s_store_sk#24] +Input [2]: [s_store_sk#24, s_city#25] + +(29) BroadcastExchange +Input [1]: [s_store_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] + +(30) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_store_sk#13] +Right keys [1]: [s_store_sk#24] +Join condition: None + +(31) Project [codegen id : 10] +Output [7]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17] +Input [9]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_store_sk#13, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17, s_store_sk#24] + +(32) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#27, hd_dep_count#28, hd_vehicle_count#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(EqualTo(hd_dep_count,4),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(33) ColumnarToRow [codegen id : 9] +Input [3]: [hd_demo_sk#27, hd_dep_count#28, hd_vehicle_count#29] + +(34) Filter [codegen id : 9] +Input [3]: [hd_demo_sk#27, hd_dep_count#28, hd_vehicle_count#29] +Condition : (((hd_dep_count#28 = 4) OR (hd_vehicle_count#29 = 3)) AND isnotnull(hd_demo_sk#27)) + +(35) Project [codegen id : 9] +Output [1]: [hd_demo_sk#27] +Input [3]: [hd_demo_sk#27, hd_dep_count#28, hd_vehicle_count#29] + +(36) BroadcastExchange +Input [1]: [hd_demo_sk#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30] + +(37) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_hdemo_sk#11] +Right keys [1]: [hd_demo_sk#27] +Join condition: None + +(38) Project [codegen id : 10] +Output [6]: [ss_customer_sk#10, ss_addr_sk#12, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17] +Input [8]: [ss_customer_sk#10, ss_hdemo_sk#11, ss_addr_sk#12, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17, hd_demo_sk#27] + +(39) Exchange +Input [6]: [ss_customer_sk#10, ss_addr_sk#12, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17] +Arguments: hashpartitioning(ss_addr_sk#12, 5), ENSURE_REQUIREMENTS, [id=#31] + +(40) Sort [codegen id : 11] +Input [6]: [ss_customer_sk#10, ss_addr_sk#12, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17] +Arguments: [ss_addr_sk#12 ASC NULLS FIRST], false, 0 + +(41) ReusedExchange [Reuses operator id: 9] +Output [2]: [ca_address_sk#32, ca_city#33] + +(42) Sort [codegen id : 13] +Input [2]: [ca_address_sk#32, ca_city#33] +Arguments: [ca_address_sk#32 ASC NULLS FIRST], false, 0 + +(43) SortMergeJoin [codegen id : 14] +Left keys [1]: [ss_addr_sk#12] +Right keys [1]: [ca_address_sk#32] +Join condition: None + +(44) Project [codegen id : 14] +Output [7]: [ss_customer_sk#10, ss_addr_sk#12, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17, ca_city#33] +Input [8]: [ss_customer_sk#10, ss_addr_sk#12, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17, ca_address_sk#32, ca_city#33] + +(45) HashAggregate [codegen id : 14] +Input [7]: [ss_customer_sk#10, ss_addr_sk#12, ss_ticket_number#14, ss_ext_sales_price#15, ss_ext_list_price#16, ss_ext_tax#17, ca_city#33] +Keys [4]: [ss_ticket_number#14, ss_customer_sk#10, ss_addr_sk#12, ca_city#33] +Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#15)), partial_sum(UnscaledValue(ss_ext_list_price#16)), partial_sum(UnscaledValue(ss_ext_tax#17))] +Aggregate Attributes [3]: [sum#34, sum#35, sum#36] +Results [7]: [ss_ticket_number#14, ss_customer_sk#10, ss_addr_sk#12, ca_city#33, sum#37, sum#38, sum#39] + +(46) HashAggregate [codegen id : 14] +Input [7]: [ss_ticket_number#14, ss_customer_sk#10, ss_addr_sk#12, ca_city#33, sum#37, sum#38, sum#39] +Keys [4]: [ss_ticket_number#14, ss_customer_sk#10, ss_addr_sk#12, ca_city#33] +Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#15)), sum(UnscaledValue(ss_ext_list_price#16)), sum(UnscaledValue(ss_ext_tax#17))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#15))#40, sum(UnscaledValue(ss_ext_list_price#16))#41, sum(UnscaledValue(ss_ext_tax#17))#42] +Results [6]: [ss_ticket_number#14, ss_customer_sk#10, ca_city#33 AS bought_city#43, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#15))#40,17,2) AS extended_price#44, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#16))#41,17,2) AS list_price#45, MakeDecimal(sum(UnscaledValue(ss_ext_tax#17))#42,17,2) AS extended_tax#46] + +(47) Exchange +Input [6]: [ss_ticket_number#14, ss_customer_sk#10, bought_city#43, extended_price#44, list_price#45, extended_tax#46] +Arguments: hashpartitioning(ss_customer_sk#10, 5), ENSURE_REQUIREMENTS, [id=#47] + +(48) Sort [codegen id : 15] +Input [6]: [ss_ticket_number#14, ss_customer_sk#10, bought_city#43, extended_price#44, list_price#45, extended_tax#46] +Arguments: [ss_customer_sk#10 ASC NULLS FIRST], false, 0 + +(49) SortMergeJoin [codegen id : 16] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#10] +Join condition: NOT (ca_city#7 = bought_city#43) + +(50) Project [codegen id : 16] +Output [8]: [c_last_name#4, c_first_name#3, ca_city#7, bought_city#43, ss_ticket_number#14, extended_price#44, extended_tax#46, list_price#45] +Input [10]: [c_customer_sk#1, c_first_name#3, c_last_name#4, ca_city#7, ss_ticket_number#14, ss_customer_sk#10, bought_city#43, extended_price#44, list_price#45, extended_tax#46] + +(51) TakeOrderedAndProject +Input [8]: [c_last_name#4, c_first_name#3, ca_city#7, bought_city#43, ss_ticket_number#14, extended_price#44, extended_tax#46, list_price#45] +Arguments: 100, [c_last_name#4 ASC NULLS FIRST, ss_ticket_number#14 ASC NULLS FIRST], [c_last_name#4, c_first_name#3, ca_city#7, bought_city#43, ss_ticket_number#14, extended_price#44, extended_tax#46, list_price#45] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 15 Hosting Expression = ss_sold_date_sk#18 IN dynamicpruning#19 +ReusedExchange (52) + + +(52) ReusedExchange [Reuses operator id: 22] +Output [1]: [d_date_sk#20] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/simplified.txt new file mode 100644 index 0000000000000..3c4e863923c5d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68.sf100/simplified.txt @@ -0,0 +1,89 @@ +TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_city,extended_price,extended_tax,list_price] + WholeStageCodegen (16) + Project [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,extended_price,extended_tax,list_price] + SortMergeJoin [c_customer_sk,ss_customer_sk,ca_city,bought_city] + InputAdapter + WholeStageCodegen (6) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #1 + WholeStageCodegen (5) + Project [c_customer_sk,c_first_name,c_last_name,ca_city] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (2) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #2 + WholeStageCodegen (1) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + InputAdapter + WholeStageCodegen (4) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #3 + WholeStageCodegen (3) + Filter [ca_address_sk,ca_city] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] + InputAdapter + WholeStageCodegen (15) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #4 + WholeStageCodegen (14) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,sum,sum,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(UnscaledValue(ss_ext_list_price)),sum(UnscaledValue(ss_ext_tax)),bought_city,extended_price,list_price,extended_tax,sum,sum,sum] + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] [sum,sum,sum,sum,sum,sum] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax,ca_city] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #5 + WholeStageCodegen (10) + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (8) + Project [s_store_sk] + Filter [s_city,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_city] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (9) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + WholeStageCodegen (13) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_city] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68/explain.txt new file mode 100644 index 0000000000000..101e4f272f98a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68/explain.txt @@ -0,0 +1,252 @@ +== Physical Plan == +TakeOrderedAndProject (43) ++- * Project (42) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (39) + : +- * BroadcastHashJoin Inner BuildRight (38) + : :- * HashAggregate (33) + : : +- Exchange (32) + : : +- * HashAggregate (31) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * Project (24) + : : : +- * BroadcastHashJoin Inner BuildRight (23) + : : : :- * Project (17) + : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : :- * Project (10) + : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.store_sales (1) + : : : : : +- BroadcastExchange (8) + : : : : : +- * Project (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.date_dim (4) + : : : : +- BroadcastExchange (15) + : : : : +- * Project (14) + : : : : +- * Filter (13) + : : : : +- * ColumnarToRow (12) + : : : : +- Scan parquet default.store (11) + : : : +- BroadcastExchange (22) + : : : +- * Project (21) + : : : +- * Filter (20) + : : : +- * ColumnarToRow (19) + : : : +- Scan parquet default.household_demographics (18) + : : +- BroadcastExchange (28) + : : +- * Filter (27) + : : +- * ColumnarToRow (26) + : : +- Scan parquet default.customer_address (25) + : +- BroadcastExchange (37) + : +- * Filter (36) + : +- * ColumnarToRow (35) + : +- Scan parquet default.customer (34) + +- ReusedExchange (40) + + +(1) Scan parquet default.store_sales +Output [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#9), dynamicpruningexpression(ss_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9] + +(3) Filter [codegen id : 5] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9] +Condition : (((isnotnull(ss_store_sk#4) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_addr_sk#3)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#11, d_year#12, d_dom#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#11, d_year#12, d_dom#13] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#11, d_year#12, d_dom#13] +Condition : ((((isnotnull(d_dom#13) AND (d_dom#13 >= 1)) AND (d_dom#13 <= 2)) AND d_year#12 IN (1999,2000,2001)) AND isnotnull(d_date_sk#11)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#11] +Input [3]: [d_date_sk#11, d_year#12, d_dom#13] + +(8) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#9] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(10) Project [codegen id : 5] +Output [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8] +Input [10]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ss_sold_date_sk#9, d_date_sk#11] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#15, s_city#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_city, [Midway,Fairview]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#15, s_city#16] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#15, s_city#16] +Condition : (s_city#16 IN (Midway,Fairview) AND isnotnull(s_store_sk#15)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#15] +Input [2]: [s_store_sk#15, s_city#16] + +(15) BroadcastExchange +Input [1]: [s_store_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#15] +Join condition: None + +(17) Project [codegen id : 5] +Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, s_store_sk#15] + +(18) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(EqualTo(hd_dep_count,4),EqualTo(hd_vehicle_count,3)), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] + +(20) Filter [codegen id : 3] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] +Condition : (((hd_dep_count#19 = 4) OR (hd_vehicle_count#20 = 3)) AND isnotnull(hd_demo_sk#18)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#18] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(23) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#18] +Join condition: None + +(24) Project [codegen id : 5] +Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, hd_demo_sk#18] + +(25) Scan parquet default.customer_address +Output [2]: [ca_address_sk#22, ca_city#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_city)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 4] +Input [2]: [ca_address_sk#22, ca_city#23] + +(27) Filter [codegen id : 4] +Input [2]: [ca_address_sk#22, ca_city#23] +Condition : (isnotnull(ca_address_sk#22) AND isnotnull(ca_city#23)) + +(28) BroadcastExchange +Input [2]: [ca_address_sk#22, ca_city#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(29) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_addr_sk#3] +Right keys [1]: [ca_address_sk#22] +Join condition: None + +(30) Project [codegen id : 5] +Output [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#23] +Input [8]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_address_sk#22, ca_city#23] + +(31) HashAggregate [codegen id : 5] +Input [7]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_ext_sales_price#6, ss_ext_list_price#7, ss_ext_tax#8, ca_city#23] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23] +Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#6)), partial_sum(UnscaledValue(ss_ext_list_price#7)), partial_sum(UnscaledValue(ss_ext_tax#8))] +Aggregate Attributes [3]: [sum#25, sum#26, sum#27] +Results [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23, sum#28, sum#29, sum#30] + +(32) Exchange +Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23, sum#28, sum#29, sum#30] +Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23, 5), ENSURE_REQUIREMENTS, [id=#31] + +(33) HashAggregate [codegen id : 8] +Input [7]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23, sum#28, sum#29, sum#30] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, ca_city#23] +Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#6)), sum(UnscaledValue(ss_ext_list_price#7)), sum(UnscaledValue(ss_ext_tax#8))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#6))#32, sum(UnscaledValue(ss_ext_list_price#7))#33, sum(UnscaledValue(ss_ext_tax#8))#34] +Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ca_city#23 AS bought_city#35, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#6))#32,17,2) AS extended_price#36, MakeDecimal(sum(UnscaledValue(ss_ext_list_price#7))#33,17,2) AS list_price#37, MakeDecimal(sum(UnscaledValue(ss_ext_tax#8))#34,17,2) AS extended_tax#38] + +(34) Scan parquet default.customer +Output [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 6] +Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] + +(36) Filter [codegen id : 6] +Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Condition : (isnotnull(c_customer_sk#39) AND isnotnull(c_current_addr_sk#40)) + +(37) BroadcastExchange +Input [4]: [c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#43] + +(38) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#39] +Join condition: None + +(39) Project [codegen id : 8] +Output [8]: [ss_ticket_number#5, bought_city#35, extended_price#36, list_price#37, extended_tax#38, c_current_addr_sk#40, c_first_name#41, c_last_name#42] +Input [10]: [ss_ticket_number#5, ss_customer_sk#1, bought_city#35, extended_price#36, list_price#37, extended_tax#38, c_customer_sk#39, c_current_addr_sk#40, c_first_name#41, c_last_name#42] + +(40) ReusedExchange [Reuses operator id: 28] +Output [2]: [ca_address_sk#44, ca_city#45] + +(41) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [c_current_addr_sk#40] +Right keys [1]: [ca_address_sk#44] +Join condition: NOT (ca_city#45 = bought_city#35) + +(42) Project [codegen id : 8] +Output [8]: [c_last_name#42, c_first_name#41, ca_city#45, bought_city#35, ss_ticket_number#5, extended_price#36, extended_tax#38, list_price#37] +Input [10]: [ss_ticket_number#5, bought_city#35, extended_price#36, list_price#37, extended_tax#38, c_current_addr_sk#40, c_first_name#41, c_last_name#42, ca_address_sk#44, ca_city#45] + +(43) TakeOrderedAndProject +Input [8]: [c_last_name#42, c_first_name#41, ca_city#45, bought_city#35, ss_ticket_number#5, extended_price#36, extended_tax#38, list_price#37] +Arguments: 100, [c_last_name#42 ASC NULLS FIRST, ss_ticket_number#5 ASC NULLS FIRST], [c_last_name#42, c_first_name#41, ca_city#45, bought_city#35, ss_ticket_number#5, extended_price#36, extended_tax#38, list_price#37] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (44) + + +(44) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68/simplified.txt new file mode 100644 index 0000000000000..b4d72f1da879d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q68/simplified.txt @@ -0,0 +1,65 @@ +TakeOrderedAndProject [c_last_name,ss_ticket_number,c_first_name,ca_city,bought_city,extended_price,extended_tax,list_price] + WholeStageCodegen (8) + Project [c_last_name,c_first_name,ca_city,bought_city,ss_ticket_number,extended_price,extended_tax,list_price] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk,ca_city,bought_city] + Project [ss_ticket_number,bought_city,extended_price,list_price,extended_tax,c_current_addr_sk,c_first_name,c_last_name] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,sum,sum,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(UnscaledValue(ss_ext_list_price)),sum(UnscaledValue(ss_ext_tax)),bought_city,extended_price,list_price,extended_tax,sum,sum,sum] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city] #1 + WholeStageCodegen (5) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,ca_city,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] [sum,sum,sum,sum,sum,sum] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax,ca_city] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_addr_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_ext_sales_price,ss_ext_list_price,ss_ext_tax,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_city,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_city] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [ca_address_sk,ca_city] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name] + InputAdapter + ReusedExchange [ca_address_sk,ca_city] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/explain.txt new file mode 100644 index 0000000000000..2cb4a1f42eb1d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/explain.txt @@ -0,0 +1,298 @@ +== Physical Plan == +TakeOrderedAndProject (51) ++- * HashAggregate (50) + +- Exchange (49) + +- * HashAggregate (48) + +- * Project (47) + +- * BroadcastHashJoin Inner BuildLeft (46) + :- BroadcastExchange (42) + : +- * Project (41) + : +- * BroadcastHashJoin Inner BuildRight (40) + : :- * Project (34) + : : +- SortMergeJoin LeftAnti (33) + : : :- SortMergeJoin LeftAnti (25) + : : : :- * SortMergeJoin LeftSemi (17) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- * Sort (16) + : : : : +- Exchange (15) + : : : : +- * Project (14) + : : : : +- * BroadcastHashJoin Inner BuildRight (13) + : : : : :- * ColumnarToRow (7) + : : : : : +- Scan parquet default.store_sales (6) + : : : : +- BroadcastExchange (12) + : : : : +- * Project (11) + : : : : +- * Filter (10) + : : : : +- * ColumnarToRow (9) + : : : : +- Scan parquet default.date_dim (8) + : : : +- * Sort (24) + : : : +- Exchange (23) + : : : +- * Project (22) + : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : :- * ColumnarToRow (19) + : : : : +- Scan parquet default.web_sales (18) + : : : +- ReusedExchange (20) + : : +- * Sort (32) + : : +- Exchange (31) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * ColumnarToRow (27) + : : : +- Scan parquet default.catalog_sales (26) + : : +- ReusedExchange (28) + : +- BroadcastExchange (39) + : +- * Project (38) + : +- * Filter (37) + : +- * ColumnarToRow (36) + : +- Scan parquet default.customer_address (35) + +- * Filter (45) + +- * ColumnarToRow (44) + +- Scan parquet default.customer_demographics (43) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(3) Filter [codegen id : 1] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Condition : (isnotnull(c_current_addr_sk#3) AND isnotnull(c_current_cdemo_sk#2)) + +(4) Exchange +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: hashpartitioning(c_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#4] + +(5) Sort [codegen id : 2] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ss_customer_sk#5, ss_sold_date_sk#6] + +(8) Scan parquet default.date_dim +Output [3]: [d_date_sk#8, d_year#9, d_moy#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,6), IsNotNull(d_date_sk)] +ReadSchema: struct + +(9) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(10) Filter [codegen id : 3] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] +Condition : (((((isnotnull(d_year#9) AND isnotnull(d_moy#10)) AND (d_year#9 = 2001)) AND (d_moy#10 >= 4)) AND (d_moy#10 <= 6)) AND isnotnull(d_date_sk#8)) + +(11) Project [codegen id : 3] +Output [1]: [d_date_sk#8] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(12) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(13) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(14) Project [codegen id : 4] +Output [1]: [ss_customer_sk#5] +Input [3]: [ss_customer_sk#5, ss_sold_date_sk#6, d_date_sk#8] + +(15) Exchange +Input [1]: [ss_customer_sk#5] +Arguments: hashpartitioning(ss_customer_sk#5, 5), ENSURE_REQUIREMENTS, [id=#12] + +(16) Sort [codegen id : 5] +Input [1]: [ss_customer_sk#5] +Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 + +(17) SortMergeJoin [codegen id : 6] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#5] +Join condition: None + +(18) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#13, ws_sold_date_sk#14] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#14), dynamicpruningexpression(ws_sold_date_sk#14 IN dynamicpruning#7)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 8] +Input [2]: [ws_bill_customer_sk#13, ws_sold_date_sk#14] + +(20) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#15] + +(21) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_sold_date_sk#14] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(22) Project [codegen id : 8] +Output [1]: [ws_bill_customer_sk#13] +Input [3]: [ws_bill_customer_sk#13, ws_sold_date_sk#14, d_date_sk#15] + +(23) Exchange +Input [1]: [ws_bill_customer_sk#13] +Arguments: hashpartitioning(ws_bill_customer_sk#13, 5), ENSURE_REQUIREMENTS, [id=#16] + +(24) Sort [codegen id : 9] +Input [1]: [ws_bill_customer_sk#13] +Arguments: [ws_bill_customer_sk#13 ASC NULLS FIRST], false, 0 + +(25) SortMergeJoin +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ws_bill_customer_sk#13] +Join condition: None + +(26) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#17, cs_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#7)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 11] +Input [2]: [cs_ship_customer_sk#17, cs_sold_date_sk#18] + +(28) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#19] + +(29) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#19] +Join condition: None + +(30) Project [codegen id : 11] +Output [1]: [cs_ship_customer_sk#17] +Input [3]: [cs_ship_customer_sk#17, cs_sold_date_sk#18, d_date_sk#19] + +(31) Exchange +Input [1]: [cs_ship_customer_sk#17] +Arguments: hashpartitioning(cs_ship_customer_sk#17, 5), ENSURE_REQUIREMENTS, [id=#20] + +(32) Sort [codegen id : 12] +Input [1]: [cs_ship_customer_sk#17] +Arguments: [cs_ship_customer_sk#17 ASC NULLS FIRST], false, 0 + +(33) SortMergeJoin +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [cs_ship_customer_sk#17] +Join condition: None + +(34) Project [codegen id : 14] +Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(35) Scan parquet default.customer_address +Output [2]: [ca_address_sk#21, ca_state#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [KY,GA,NM]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 13] +Input [2]: [ca_address_sk#21, ca_state#22] + +(37) Filter [codegen id : 13] +Input [2]: [ca_address_sk#21, ca_state#22] +Condition : (ca_state#22 IN (KY,GA,NM) AND isnotnull(ca_address_sk#21)) + +(38) Project [codegen id : 13] +Output [1]: [ca_address_sk#21] +Input [2]: [ca_address_sk#21, ca_state#22] + +(39) BroadcastExchange +Input [1]: [ca_address_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] + +(40) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#21] +Join condition: None + +(41) Project [codegen id : 14] +Output [1]: [c_current_cdemo_sk#2] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#21] + +(42) BroadcastExchange +Input [1]: [c_current_cdemo_sk#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(43) Scan parquet default.customer_demographics +Output [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(44) ColumnarToRow +Input [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30] + +(45) Filter +Input [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30] +Condition : isnotnull(cd_demo_sk#25) + +(46) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#25] +Join condition: None + +(47) Project [codegen id : 15] +Output [5]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30] +Input [7]: [c_current_cdemo_sk#2, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30] + +(48) HashAggregate [codegen id : 15] +Input [5]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30] +Keys [5]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#31] +Results [6]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, count#32] + +(49) Exchange +Input [6]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, count#32] +Arguments: hashpartitioning(cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, 5), ENSURE_REQUIREMENTS, [id=#33] + +(50) HashAggregate [codegen id : 16] +Input [6]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30, count#32] +Keys [5]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cd_purchase_estimate#29, cd_credit_rating#30] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#34] +Results [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, count(1)#34 AS cnt1#35, cd_purchase_estimate#29, count(1)#34 AS cnt2#36, cd_credit_rating#30, count(1)#34 AS cnt3#37] + +(51) TakeOrderedAndProject +Input [8]: [cd_gender#26, cd_marital_status#27, cd_education_status#28, cnt1#35, cd_purchase_estimate#29, cnt2#36, cd_credit_rating#30, cnt3#37] +Arguments: 100, [cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, cd_education_status#28 ASC NULLS FIRST, cd_purchase_estimate#29 ASC NULLS FIRST, cd_credit_rating#30 ASC NULLS FIRST], [cd_gender#26, cd_marital_status#27, cd_education_status#28, cnt1#35, cd_purchase_estimate#29, cnt2#36, cd_credit_rating#30, cnt3#37] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (52) + + +(52) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 18 Hosting Expression = ws_sold_date_sk#14 IN dynamicpruning#7 + +Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/simplified.txt new file mode 100644 index 0000000000000..bdbf95bd10721 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69.sf100/simplified.txt @@ -0,0 +1,89 @@ +TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cnt1,cnt2,cnt3] + WholeStageCodegen (16) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,count] [count(1),cnt1,cnt2,cnt3,count] + InputAdapter + Exchange [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating] #1 + WholeStageCodegen (15) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating] [count,count] + Project [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (14) + Project [c_current_cdemo_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + SortMergeJoin [c_customer_sk,cs_ship_customer_sk] + SortMergeJoin [c_customer_sk,ws_bill_customer_sk] + WholeStageCodegen (6) + SortMergeJoin [c_customer_sk,ss_customer_sk] + InputAdapter + WholeStageCodegen (2) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #3 + WholeStageCodegen (1) + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (5) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #4 + WholeStageCodegen (4) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (9) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #6 + WholeStageCodegen (8) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + WholeStageCodegen (12) + Sort [cs_ship_customer_sk] + InputAdapter + Exchange [cs_ship_customer_sk] #7 + WholeStageCodegen (11) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (13) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69/explain.txt new file mode 100644 index 0000000000000..d0b3c2231d997 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69/explain.txt @@ -0,0 +1,273 @@ +== Physical Plan == +TakeOrderedAndProject (46) ++- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * Project (42) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (36) + : +- * BroadcastHashJoin Inner BuildRight (35) + : :- * Project (29) + : : +- * BroadcastHashJoin LeftAnti BuildRight (28) + : : :- * BroadcastHashJoin LeftAnti BuildRight (21) + : : : :- * BroadcastHashJoin LeftSemi BuildRight (14) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (13) + : : : : +- * Project (12) + : : : : +- * BroadcastHashJoin Inner BuildRight (11) + : : : : :- * ColumnarToRow (5) + : : : : : +- Scan parquet default.store_sales (4) + : : : : +- BroadcastExchange (10) + : : : : +- * Project (9) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.date_dim (6) + : : : +- BroadcastExchange (20) + : : : +- * Project (19) + : : : +- * BroadcastHashJoin Inner BuildRight (18) + : : : :- * ColumnarToRow (16) + : : : : +- Scan parquet default.web_sales (15) + : : : +- ReusedExchange (17) + : : +- BroadcastExchange (27) + : : +- * Project (26) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- * ColumnarToRow (23) + : : : +- Scan parquet default.catalog_sales (22) + : : +- ReusedExchange (24) + : +- BroadcastExchange (34) + : +- * Project (33) + : +- * Filter (32) + : +- * ColumnarToRow (31) + : +- Scan parquet default.customer_address (30) + +- BroadcastExchange (40) + +- * Filter (39) + +- * ColumnarToRow (38) + +- Scan parquet default.customer_demographics (37) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(3) Filter [codegen id : 9] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Condition : (isnotnull(c_current_addr_sk#3) AND isnotnull(c_current_cdemo_sk#2)) + +(4) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 2] +Input [2]: [ss_customer_sk#4, ss_sold_date_sk#5] + +(6) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_moy#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,6), IsNotNull(d_date_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] + +(8) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] +Condition : (((((isnotnull(d_year#8) AND isnotnull(d_moy#9)) AND (d_year#8 = 2001)) AND (d_moy#9 >= 4)) AND (d_moy#9 <= 6)) AND isnotnull(d_date_sk#7)) + +(9) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] + +(10) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(11) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(12) Project [codegen id : 2] +Output [1]: [ss_customer_sk#4] +Input [3]: [ss_customer_sk#4, ss_sold_date_sk#5, d_date_sk#7] + +(13) BroadcastExchange +Input [1]: [ss_customer_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(14) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#4] +Join condition: None + +(15) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#12, ws_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#13), dynamicpruningexpression(ws_sold_date_sk#13 IN dynamicpruning#6)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 4] +Input [2]: [ws_bill_customer_sk#12, ws_sold_date_sk#13] + +(17) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#14] + +(18) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_sold_date_sk#13] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(19) Project [codegen id : 4] +Output [1]: [ws_bill_customer_sk#12] +Input [3]: [ws_bill_customer_sk#12, ws_sold_date_sk#13, d_date_sk#14] + +(20) BroadcastExchange +Input [1]: [ws_bill_customer_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(21) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ws_bill_customer_sk#12] +Join condition: None + +(22) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#16, cs_sold_date_sk#17] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#17), dynamicpruningexpression(cs_sold_date_sk#17 IN dynamicpruning#6)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 6] +Input [2]: [cs_ship_customer_sk#16, cs_sold_date_sk#17] + +(24) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#18] + +(25) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#17] +Right keys [1]: [d_date_sk#18] +Join condition: None + +(26) Project [codegen id : 6] +Output [1]: [cs_ship_customer_sk#16] +Input [3]: [cs_ship_customer_sk#16, cs_sold_date_sk#17, d_date_sk#18] + +(27) BroadcastExchange +Input [1]: [cs_ship_customer_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] + +(28) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [cs_ship_customer_sk#16] +Join condition: None + +(29) Project [codegen id : 9] +Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(30) Scan parquet default.customer_address +Output [2]: [ca_address_sk#20, ca_state#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [KY,GA,NM]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#20, ca_state#21] + +(32) Filter [codegen id : 7] +Input [2]: [ca_address_sk#20, ca_state#21] +Condition : (ca_state#21 IN (KY,GA,NM) AND isnotnull(ca_address_sk#20)) + +(33) Project [codegen id : 7] +Output [1]: [ca_address_sk#20] +Input [2]: [ca_address_sk#20, ca_state#21] + +(34) BroadcastExchange +Input [1]: [ca_address_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] + +(35) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#20] +Join condition: None + +(36) Project [codegen id : 9] +Output [1]: [c_current_cdemo_sk#2] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#20] + +(37) Scan parquet default.customer_demographics +Output [6]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(38) ColumnarToRow [codegen id : 8] +Input [6]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28] + +(39) Filter [codegen id : 8] +Input [6]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28] +Condition : isnotnull(cd_demo_sk#23) + +(40) BroadcastExchange +Input [6]: [cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(41) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#23] +Join condition: None + +(42) Project [codegen id : 9] +Output [5]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28] +Input [7]: [c_current_cdemo_sk#2, cd_demo_sk#23, cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28] + +(43) HashAggregate [codegen id : 9] +Input [5]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28] +Keys [5]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#30] +Results [6]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, count#31] + +(44) Exchange +Input [6]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, count#31] +Arguments: hashpartitioning(cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, 5), ENSURE_REQUIREMENTS, [id=#32] + +(45) HashAggregate [codegen id : 10] +Input [6]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28, count#31] +Keys [5]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cd_purchase_estimate#27, cd_credit_rating#28] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#33] +Results [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, count(1)#33 AS cnt1#34, cd_purchase_estimate#27, count(1)#33 AS cnt2#35, cd_credit_rating#28, count(1)#33 AS cnt3#36] + +(46) TakeOrderedAndProject +Input [8]: [cd_gender#24, cd_marital_status#25, cd_education_status#26, cnt1#34, cd_purchase_estimate#27, cnt2#35, cd_credit_rating#28, cnt3#36] +Arguments: 100, [cd_gender#24 ASC NULLS FIRST, cd_marital_status#25 ASC NULLS FIRST, cd_education_status#26 ASC NULLS FIRST, cd_purchase_estimate#27 ASC NULLS FIRST, cd_credit_rating#28 ASC NULLS FIRST], [cd_gender#24, cd_marital_status#25, cd_education_status#26, cnt1#34, cd_purchase_estimate#27, cnt2#35, cd_credit_rating#28, cnt3#36] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (47) + + +(47) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#7] + +Subquery:2 Hosting operator id = 15 Hosting Expression = ws_sold_date_sk#13 IN dynamicpruning#6 + +Subquery:3 Hosting operator id = 22 Hosting Expression = cs_sold_date_sk#17 IN dynamicpruning#6 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69/simplified.txt new file mode 100644 index 0000000000000..957b9561b1752 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q69/simplified.txt @@ -0,0 +1,74 @@ +TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cnt1,cnt2,cnt3] + WholeStageCodegen (10) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,count] [count(1),cnt1,cnt2,cnt3,count] + InputAdapter + Exchange [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating] #1 + WholeStageCodegen (9) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating] [count,count] + Project [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [c_current_cdemo_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + BroadcastHashJoin [c_customer_sk,cs_ship_customer_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (6) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (8) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt new file mode 100644 index 0000000000000..b138d059eaecb --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/explain.txt @@ -0,0 +1,204 @@ +== Physical Plan == +TakeOrderedAndProject (34) ++- * HashAggregate (33) + +- Exchange (32) + +- * HashAggregate (31) + +- * Project (30) + +- * BroadcastHashJoin Inner BuildRight (29) + :- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer_demographics (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.promotion (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.date_dim (18) + +- BroadcastExchange (28) + +- * Filter (27) + +- * ColumnarToRow (26) + +- Scan parquet default.item (25) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_item_sk), IsNotNull(ss_promo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_cdemo_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_promo_sk#3)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Condition : ((((((isnotnull(cd_gender#11) AND isnotnull(cd_marital_status#12)) AND isnotnull(cd_education_status#13)) AND (cd_gender#11 = M)) AND (cd_marital_status#12 = S)) AND (cd_education_status#13 = College )) AND isnotnull(cd_demo_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#10] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(8) BroadcastExchange +Input [1]: [cd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, cd_demo_sk#10] + +(11) Scan parquet default.promotion +Output [3]: [p_promo_sk#15, p_channel_email#16, p_channel_event#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [Or(EqualTo(p_channel_email,N),EqualTo(p_channel_event,N)), IsNotNull(p_promo_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [p_promo_sk#15, p_channel_email#16, p_channel_event#17] + +(13) Filter [codegen id : 2] +Input [3]: [p_promo_sk#15, p_channel_email#16, p_channel_event#17] +Condition : (((p_channel_email#16 = N) OR (p_channel_event#17 = N)) AND isnotnull(p_promo_sk#15)) + +(14) Project [codegen id : 2] +Output [1]: [p_promo_sk#15] +Input [3]: [p_promo_sk#15, p_channel_email#16, p_channel_event#17] + +(15) BroadcastExchange +Input [1]: [p_promo_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_promo_sk#3] +Right keys [1]: [p_promo_sk#15] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Input [8]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, p_promo_sk#15] + +(18) Scan parquet default.date_dim +Output [2]: [d_date_sk#19, d_year#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#19, d_year#20] + +(20) Filter [codegen id : 3] +Input [2]: [d_date_sk#19, d_year#20] +Condition : ((isnotnull(d_year#20) AND (d_year#20 = 2000)) AND isnotnull(d_date_sk#19)) + +(21) Project [codegen id : 3] +Output [1]: [d_date_sk#19] +Input [2]: [d_date_sk#19, d_year#20] + +(22) BroadcastExchange +Input [1]: [d_date_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(23) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#19] +Join condition: None + +(24) Project [codegen id : 5] +Output [5]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [7]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#19] + +(25) Scan parquet default.item +Output [2]: [i_item_sk#22, i_item_id#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#22, i_item_id#23] + +(27) Filter [codegen id : 4] +Input [2]: [i_item_sk#22, i_item_id#23] +Condition : isnotnull(i_item_sk#22) + +(28) BroadcastExchange +Input [2]: [i_item_sk#22, i_item_id#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(29) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#22] +Join condition: None + +(30) Project [codegen id : 5] +Output [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#23] +Input [7]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#22, i_item_id#23] + +(31) HashAggregate [codegen id : 5] +Input [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#23] +Keys [1]: [i_item_id#23] +Functions [4]: [partial_avg(ss_quantity#4), partial_avg(UnscaledValue(ss_list_price#5)), partial_avg(UnscaledValue(ss_coupon_amt#7)), partial_avg(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [8]: [sum#25, count#26, sum#27, count#28, sum#29, count#30, sum#31, count#32] +Results [9]: [i_item_id#23, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] + +(32) Exchange +Input [9]: [i_item_id#23, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] +Arguments: hashpartitioning(i_item_id#23, 5), ENSURE_REQUIREMENTS, [id=#41] + +(33) HashAggregate [codegen id : 6] +Input [9]: [i_item_id#23, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] +Keys [1]: [i_item_id#23] +Functions [4]: [avg(ss_quantity#4), avg(UnscaledValue(ss_list_price#5)), avg(UnscaledValue(ss_coupon_amt#7)), avg(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [4]: [avg(ss_quantity#4)#42, avg(UnscaledValue(ss_list_price#5))#43, avg(UnscaledValue(ss_coupon_amt#7))#44, avg(UnscaledValue(ss_sales_price#6))#45] +Results [5]: [i_item_id#23, avg(ss_quantity#4)#42 AS agg1#46, cast((avg(UnscaledValue(ss_list_price#5))#43 / 100.0) as decimal(11,6)) AS agg2#47, cast((avg(UnscaledValue(ss_coupon_amt#7))#44 / 100.0) as decimal(11,6)) AS agg3#48, cast((avg(UnscaledValue(ss_sales_price#6))#45 / 100.0) as decimal(11,6)) AS agg4#49] + +(34) TakeOrderedAndProject +Input [5]: [i_item_id#23, agg1#46, agg2#47, agg3#48, agg4#49] +Arguments: 100, [i_item_id#23 ASC NULLS FIRST], [i_item_id#23, agg1#46, agg2#47, agg3#48, agg4#49] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 22] +Output [1]: [d_date_sk#19] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt new file mode 100644 index 0000000000000..e5cf942ba37b5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7.sf100/simplified.txt @@ -0,0 +1,52 @@ +TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] + WholeStageCodegen (6) + HashAggregate [i_item_id,sum,count,sum,count,sum,count,sum,count] [avg(ss_quantity),avg(UnscaledValue(ss_list_price)),avg(UnscaledValue(ss_coupon_amt)),avg(UnscaledValue(ss_sales_price)),agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,i_item_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_item_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_item_sk,ss_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [cd_demo_sk] + Filter [cd_gender,cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [p_promo_sk] + Filter [p_channel_email,p_channel_event,p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk,p_channel_email,p_channel_event] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7/explain.txt new file mode 100644 index 0000000000000..5f6002b84f411 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7/explain.txt @@ -0,0 +1,204 @@ +== Physical Plan == +TakeOrderedAndProject (34) ++- * HashAggregate (33) + +- Exchange (32) + +- * HashAggregate (31) + +- * Project (30) + +- * BroadcastHashJoin Inner BuildRight (29) + :- * Project (23) + : +- * BroadcastHashJoin Inner BuildRight (22) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer_demographics (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.date_dim (11) + : +- BroadcastExchange (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.item (18) + +- BroadcastExchange (28) + +- * Project (27) + +- * Filter (26) + +- * ColumnarToRow (25) + +- Scan parquet default.promotion (24) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_item_sk), IsNotNull(ss_promo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_cdemo_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_promo_sk#3)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_marital_status,S), EqualTo(cd_education_status,College ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Condition : ((((((isnotnull(cd_gender#11) AND isnotnull(cd_marital_status#12)) AND isnotnull(cd_education_status#13)) AND (cd_gender#11 = M)) AND (cd_marital_status#12 = S)) AND (cd_education_status#13 = College )) AND isnotnull(cd_demo_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#10] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(8) BroadcastExchange +Input [1]: [cd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, cd_demo_sk#10] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#15, d_year#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] +Condition : ((isnotnull(d_year#16) AND (d_year#16 = 2000)) AND isnotnull(d_date_sk#15)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#15] +Input [2]: [d_date_sk#15, d_year#16] + +(15) BroadcastExchange +Input [1]: [d_date_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [8]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#15] + +(18) Scan parquet default.item +Output [2]: [i_item_sk#18, i_item_id#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_sk#18, i_item_id#19] + +(20) Filter [codegen id : 3] +Input [2]: [i_item_sk#18, i_item_id#19] +Condition : isnotnull(i_item_sk#18) + +(21) BroadcastExchange +Input [2]: [i_item_sk#18, i_item_id#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(22) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#18] +Join condition: None + +(23) Project [codegen id : 5] +Output [6]: [ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#19] +Input [8]: [ss_item_sk#1, ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_sk#18, i_item_id#19] + +(24) Scan parquet default.promotion +Output [3]: [p_promo_sk#21, p_channel_email#22, p_channel_event#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [Or(EqualTo(p_channel_email,N),EqualTo(p_channel_event,N)), IsNotNull(p_promo_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [3]: [p_promo_sk#21, p_channel_email#22, p_channel_event#23] + +(26) Filter [codegen id : 4] +Input [3]: [p_promo_sk#21, p_channel_email#22, p_channel_event#23] +Condition : (((p_channel_email#22 = N) OR (p_channel_event#23 = N)) AND isnotnull(p_promo_sk#21)) + +(27) Project [codegen id : 4] +Output [1]: [p_promo_sk#21] +Input [3]: [p_promo_sk#21, p_channel_email#22, p_channel_event#23] + +(28) BroadcastExchange +Input [1]: [p_promo_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(29) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_promo_sk#3] +Right keys [1]: [p_promo_sk#21] +Join condition: None + +(30) Project [codegen id : 5] +Output [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#19] +Input [7]: [ss_promo_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#19, p_promo_sk#21] + +(31) HashAggregate [codegen id : 5] +Input [5]: [ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, i_item_id#19] +Keys [1]: [i_item_id#19] +Functions [4]: [partial_avg(ss_quantity#4), partial_avg(UnscaledValue(ss_list_price#5)), partial_avg(UnscaledValue(ss_coupon_amt#7)), partial_avg(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [8]: [sum#25, count#26, sum#27, count#28, sum#29, count#30, sum#31, count#32] +Results [9]: [i_item_id#19, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] + +(32) Exchange +Input [9]: [i_item_id#19, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] +Arguments: hashpartitioning(i_item_id#19, 5), ENSURE_REQUIREMENTS, [id=#41] + +(33) HashAggregate [codegen id : 6] +Input [9]: [i_item_id#19, sum#33, count#34, sum#35, count#36, sum#37, count#38, sum#39, count#40] +Keys [1]: [i_item_id#19] +Functions [4]: [avg(ss_quantity#4), avg(UnscaledValue(ss_list_price#5)), avg(UnscaledValue(ss_coupon_amt#7)), avg(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [4]: [avg(ss_quantity#4)#42, avg(UnscaledValue(ss_list_price#5))#43, avg(UnscaledValue(ss_coupon_amt#7))#44, avg(UnscaledValue(ss_sales_price#6))#45] +Results [5]: [i_item_id#19, avg(ss_quantity#4)#42 AS agg1#46, cast((avg(UnscaledValue(ss_list_price#5))#43 / 100.0) as decimal(11,6)) AS agg2#47, cast((avg(UnscaledValue(ss_coupon_amt#7))#44 / 100.0) as decimal(11,6)) AS agg3#48, cast((avg(UnscaledValue(ss_sales_price#6))#45 / 100.0) as decimal(11,6)) AS agg4#49] + +(34) TakeOrderedAndProject +Input [5]: [i_item_id#19, agg1#46, agg2#47, agg3#48, agg4#49] +Arguments: 100, [i_item_id#19 ASC NULLS FIRST], [i_item_id#19, agg1#46, agg2#47, agg3#48, agg4#49] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#15] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7/simplified.txt new file mode 100644 index 0000000000000..4de61c8e70519 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q7/simplified.txt @@ -0,0 +1,52 @@ +TakeOrderedAndProject [i_item_id,agg1,agg2,agg3,agg4] + WholeStageCodegen (6) + HashAggregate [i_item_id,sum,count,sum,count,sum,count,sum,count] [avg(ss_quantity),avg(UnscaledValue(ss_list_price)),avg(UnscaledValue(ss_coupon_amt)),avg(UnscaledValue(ss_sales_price)),agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,i_item_id] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,i_item_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_item_sk,ss_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_promo_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [cd_demo_sk] + Filter [cd_gender,cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Project [p_promo_sk] + Filter [p_channel_email,p_channel_event,p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk,p_channel_email,p_channel_event] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/explain.txt new file mode 100644 index 0000000000000..7b8445a46ac54 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/explain.txt @@ -0,0 +1,278 @@ +== Physical Plan == +TakeOrderedAndProject (47) ++- * Project (46) + +- Window (45) + +- * Sort (44) + +- Exchange (43) + +- * HashAggregate (42) + +- Exchange (41) + +- * HashAggregate (40) + +- * Expand (39) + +- * Project (38) + +- * BroadcastHashJoin Inner BuildRight (37) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- BroadcastExchange (36) + +- * BroadcastHashJoin LeftSemi BuildRight (35) + :- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.store (11) + +- BroadcastExchange (34) + +- * Project (33) + +- * Filter (32) + +- Window (31) + +- * Sort (30) + +- Exchange (29) + +- * HashAggregate (28) + +- Exchange (27) + +- * HashAggregate (26) + +- * Project (25) + +- * BroadcastHashJoin Inner BuildRight (24) + :- * Project (19) + : +- * BroadcastHashJoin Inner BuildRight (18) + : :- * Filter (16) + : : +- * ColumnarToRow (15) + : : +- Scan parquet default.store_sales (14) + : +- ReusedExchange (17) + +- BroadcastExchange (23) + +- * Filter (22) + +- * ColumnarToRow (21) + +- Scan parquet default.store (20) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 9] +Input [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 9] +Output [2]: [ss_store_sk#1, ss_net_profit#2] +Input [4]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3, d_date_sk#5] + +(11) Scan parquet default.store +Output [3]: [s_store_sk#8, s_county#9, s_state#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 8] +Input [3]: [s_store_sk#8, s_county#9, s_state#10] + +(13) Filter [codegen id : 8] +Input [3]: [s_store_sk#8, s_county#9, s_state#10] +Condition : isnotnull(s_store_sk#8) + +(14) Scan parquet default.store_sales +Output [3]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#13), dynamicpruningexpression(ss_sold_date_sk#13 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 4] +Input [3]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13] + +(16) Filter [codegen id : 4] +Input [3]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13] +Condition : isnotnull(ss_store_sk#11) + +(17) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#14] + +(18) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#13] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(19) Project [codegen id : 4] +Output [2]: [ss_store_sk#11, ss_net_profit#12] +Input [4]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13, d_date_sk#14] + +(20) Scan parquet default.store +Output [2]: [s_store_sk#15, s_state#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#15, s_state#16] + +(22) Filter [codegen id : 3] +Input [2]: [s_store_sk#15, s_state#16] +Condition : isnotnull(s_store_sk#15) + +(23) BroadcastExchange +Input [2]: [s_store_sk#15, s_state#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(24) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#11] +Right keys [1]: [s_store_sk#15] +Join condition: None + +(25) Project [codegen id : 4] +Output [2]: [ss_net_profit#12, s_state#16] +Input [4]: [ss_store_sk#11, ss_net_profit#12, s_store_sk#15, s_state#16] + +(26) HashAggregate [codegen id : 4] +Input [2]: [ss_net_profit#12, s_state#16] +Keys [1]: [s_state#16] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#12))] +Aggregate Attributes [1]: [sum#18] +Results [2]: [s_state#16, sum#19] + +(27) Exchange +Input [2]: [s_state#16, sum#19] +Arguments: hashpartitioning(s_state#16, 5), ENSURE_REQUIREMENTS, [id=#20] + +(28) HashAggregate [codegen id : 5] +Input [2]: [s_state#16, sum#19] +Keys [1]: [s_state#16] +Functions [1]: [sum(UnscaledValue(ss_net_profit#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#12))#21] +Results [3]: [s_state#16 AS s_state#22, s_state#16, MakeDecimal(sum(UnscaledValue(ss_net_profit#12))#21,17,2) AS _w2#23] + +(29) Exchange +Input [3]: [s_state#22, s_state#16, _w2#23] +Arguments: hashpartitioning(s_state#16, 5), ENSURE_REQUIREMENTS, [id=#24] + +(30) Sort [codegen id : 6] +Input [3]: [s_state#22, s_state#16, _w2#23] +Arguments: [s_state#16 ASC NULLS FIRST, _w2#23 DESC NULLS LAST], false, 0 + +(31) Window +Input [3]: [s_state#22, s_state#16, _w2#23] +Arguments: [rank(_w2#23) windowspecdefinition(s_state#16, _w2#23 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS ranking#25], [s_state#16], [_w2#23 DESC NULLS LAST] + +(32) Filter [codegen id : 7] +Input [4]: [s_state#22, s_state#16, _w2#23, ranking#25] +Condition : (ranking#25 <= 5) + +(33) Project [codegen id : 7] +Output [1]: [s_state#22] +Input [4]: [s_state#22, s_state#16, _w2#23, ranking#25] + +(34) BroadcastExchange +Input [1]: [s_state#22] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#26] + +(35) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [s_state#10] +Right keys [1]: [s_state#22] +Join condition: None + +(36) BroadcastExchange +Input [3]: [s_store_sk#8, s_county#9, s_state#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(37) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#8] +Join condition: None + +(38) Project [codegen id : 9] +Output [3]: [ss_net_profit#2, s_state#10, s_county#9] +Input [5]: [ss_store_sk#1, ss_net_profit#2, s_store_sk#8, s_county#9, s_state#10] + +(39) Expand [codegen id : 9] +Input [3]: [ss_net_profit#2, s_state#10, s_county#9] +Arguments: [List(ss_net_profit#2, s_state#10, s_county#9, 0), List(ss_net_profit#2, s_state#10, null, 1), List(ss_net_profit#2, null, null, 3)], [ss_net_profit#2, s_state#28, s_county#29, spark_grouping_id#30] + +(40) HashAggregate [codegen id : 9] +Input [4]: [ss_net_profit#2, s_state#28, s_county#29, spark_grouping_id#30] +Keys [3]: [s_state#28, s_county#29, spark_grouping_id#30] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum#31] +Results [4]: [s_state#28, s_county#29, spark_grouping_id#30, sum#32] + +(41) Exchange +Input [4]: [s_state#28, s_county#29, spark_grouping_id#30, sum#32] +Arguments: hashpartitioning(s_state#28, s_county#29, spark_grouping_id#30, 5), ENSURE_REQUIREMENTS, [id=#33] + +(42) HashAggregate [codegen id : 10] +Input [4]: [s_state#28, s_county#29, spark_grouping_id#30, sum#32] +Keys [3]: [s_state#28, s_county#29, spark_grouping_id#30] +Functions [1]: [sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#2))#34] +Results [7]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#2))#34,17,2) AS total_sum#35, s_state#28, s_county#29, (cast((shiftright(spark_grouping_id#30, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#30, 0) & 1) as tinyint)) AS lochierarchy#36, (cast((shiftright(spark_grouping_id#30, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#30, 0) & 1) as tinyint)) AS _w1#37, CASE WHEN (cast((shiftright(spark_grouping_id#30, 0) & 1) as tinyint) = 0) THEN s_state#28 END AS _w2#38, MakeDecimal(sum(UnscaledValue(ss_net_profit#2))#34,17,2) AS _w3#39] + +(43) Exchange +Input [7]: [total_sum#35, s_state#28, s_county#29, lochierarchy#36, _w1#37, _w2#38, _w3#39] +Arguments: hashpartitioning(_w1#37, _w2#38, 5), ENSURE_REQUIREMENTS, [id=#40] + +(44) Sort [codegen id : 11] +Input [7]: [total_sum#35, s_state#28, s_county#29, lochierarchy#36, _w1#37, _w2#38, _w3#39] +Arguments: [_w1#37 ASC NULLS FIRST, _w2#38 ASC NULLS FIRST, _w3#39 DESC NULLS LAST], false, 0 + +(45) Window +Input [7]: [total_sum#35, s_state#28, s_county#29, lochierarchy#36, _w1#37, _w2#38, _w3#39] +Arguments: [rank(_w3#39) windowspecdefinition(_w1#37, _w2#38, _w3#39 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#41], [_w1#37, _w2#38], [_w3#39 DESC NULLS LAST] + +(46) Project [codegen id : 12] +Output [5]: [total_sum#35, s_state#28, s_county#29, lochierarchy#36, rank_within_parent#41] +Input [8]: [total_sum#35, s_state#28, s_county#29, lochierarchy#36, _w1#37, _w2#38, _w3#39, rank_within_parent#41] + +(47) TakeOrderedAndProject +Input [5]: [total_sum#35, s_state#28, s_county#29, lochierarchy#36, rank_within_parent#41] +Arguments: 100, [lochierarchy#36 DESC NULLS LAST, CASE WHEN (lochierarchy#36 = 0) THEN s_state#28 END ASC NULLS FIRST, rank_within_parent#41 ASC NULLS FIRST], [total_sum#35, s_state#28, s_county#29, lochierarchy#36, rank_within_parent#41] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (48) + + +(48) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + +Subquery:2 Hosting operator id = 14 Hosting Expression = ss_sold_date_sk#13 IN dynamicpruning#4 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/simplified.txt new file mode 100644 index 0000000000000..7a5207362a5bd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70.sf100/simplified.txt @@ -0,0 +1,77 @@ +TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_county] + WholeStageCodegen (12) + Project [total_sum,s_state,s_county,lochierarchy,rank_within_parent] + InputAdapter + Window [_w3,_w1,_w2] + WholeStageCodegen (11) + Sort [_w1,_w2,_w3] + InputAdapter + Exchange [_w1,_w2] #1 + WholeStageCodegen (10) + HashAggregate [s_state,s_county,spark_grouping_id,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,lochierarchy,_w1,_w2,_w3,sum] + InputAdapter + Exchange [s_state,s_county,spark_grouping_id] #2 + WholeStageCodegen (9) + HashAggregate [s_state,s_county,spark_grouping_id,ss_net_profit] [sum,sum] + Expand [ss_net_profit,s_state,s_county] + Project [ss_net_profit,s_state,s_county] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (8) + BroadcastHashJoin [s_state,s_state] + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county,s_state] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + Project [s_state] + Filter [ranking] + InputAdapter + Window [_w2,s_state] + WholeStageCodegen (6) + Sort [s_state,_w2] + InputAdapter + Exchange [s_state] #6 + WholeStageCodegen (5) + HashAggregate [s_state,sum] [sum(UnscaledValue(ss_net_profit)),s_state,_w2,sum] + InputAdapter + Exchange [s_state] #7 + WholeStageCodegen (4) + HashAggregate [s_state,ss_net_profit] [sum,sum] + Project [ss_net_profit,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_net_profit,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (3) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70/explain.txt new file mode 100644 index 0000000000000..91cfba59bb5bc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70/explain.txt @@ -0,0 +1,278 @@ +== Physical Plan == +TakeOrderedAndProject (47) ++- * Project (46) + +- Window (45) + +- * Sort (44) + +- Exchange (43) + +- * HashAggregate (42) + +- Exchange (41) + +- * HashAggregate (40) + +- * Expand (39) + +- * Project (38) + +- * BroadcastHashJoin Inner BuildRight (37) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- BroadcastExchange (36) + +- * BroadcastHashJoin LeftSemi BuildRight (35) + :- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.store (11) + +- BroadcastExchange (34) + +- * Project (33) + +- * Filter (32) + +- Window (31) + +- * Sort (30) + +- Exchange (29) + +- * HashAggregate (28) + +- Exchange (27) + +- * HashAggregate (26) + +- * Project (25) + +- * BroadcastHashJoin Inner BuildRight (24) + :- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Filter (16) + : : +- * ColumnarToRow (15) + : : +- Scan parquet default.store_sales (14) + : +- BroadcastExchange (20) + : +- * Filter (19) + : +- * ColumnarToRow (18) + : +- Scan parquet default.store (17) + +- ReusedExchange (23) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 9] +Input [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 9] +Output [2]: [ss_store_sk#1, ss_net_profit#2] +Input [4]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3, d_date_sk#5] + +(11) Scan parquet default.store +Output [3]: [s_store_sk#8, s_county#9, s_state#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 8] +Input [3]: [s_store_sk#8, s_county#9, s_state#10] + +(13) Filter [codegen id : 8] +Input [3]: [s_store_sk#8, s_county#9, s_state#10] +Condition : isnotnull(s_store_sk#8) + +(14) Scan parquet default.store_sales +Output [3]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#13), dynamicpruningexpression(ss_sold_date_sk#13 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 4] +Input [3]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13] + +(16) Filter [codegen id : 4] +Input [3]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13] +Condition : isnotnull(ss_store_sk#11) + +(17) Scan parquet default.store +Output [2]: [s_store_sk#14, s_state#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#14, s_state#15] + +(19) Filter [codegen id : 2] +Input [2]: [s_store_sk#14, s_state#15] +Condition : isnotnull(s_store_sk#14) + +(20) BroadcastExchange +Input [2]: [s_store_sk#14, s_state#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#11] +Right keys [1]: [s_store_sk#14] +Join condition: None + +(22) Project [codegen id : 4] +Output [3]: [ss_net_profit#12, ss_sold_date_sk#13, s_state#15] +Input [5]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13, s_store_sk#14, s_state#15] + +(23) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#17] + +(24) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#13] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(25) Project [codegen id : 4] +Output [2]: [ss_net_profit#12, s_state#15] +Input [4]: [ss_net_profit#12, ss_sold_date_sk#13, s_state#15, d_date_sk#17] + +(26) HashAggregate [codegen id : 4] +Input [2]: [ss_net_profit#12, s_state#15] +Keys [1]: [s_state#15] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#12))] +Aggregate Attributes [1]: [sum#18] +Results [2]: [s_state#15, sum#19] + +(27) Exchange +Input [2]: [s_state#15, sum#19] +Arguments: hashpartitioning(s_state#15, 5), ENSURE_REQUIREMENTS, [id=#20] + +(28) HashAggregate [codegen id : 5] +Input [2]: [s_state#15, sum#19] +Keys [1]: [s_state#15] +Functions [1]: [sum(UnscaledValue(ss_net_profit#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#12))#21] +Results [3]: [s_state#15 AS s_state#22, s_state#15, MakeDecimal(sum(UnscaledValue(ss_net_profit#12))#21,17,2) AS _w2#23] + +(29) Exchange +Input [3]: [s_state#22, s_state#15, _w2#23] +Arguments: hashpartitioning(s_state#15, 5), ENSURE_REQUIREMENTS, [id=#24] + +(30) Sort [codegen id : 6] +Input [3]: [s_state#22, s_state#15, _w2#23] +Arguments: [s_state#15 ASC NULLS FIRST, _w2#23 DESC NULLS LAST], false, 0 + +(31) Window +Input [3]: [s_state#22, s_state#15, _w2#23] +Arguments: [rank(_w2#23) windowspecdefinition(s_state#15, _w2#23 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS ranking#25], [s_state#15], [_w2#23 DESC NULLS LAST] + +(32) Filter [codegen id : 7] +Input [4]: [s_state#22, s_state#15, _w2#23, ranking#25] +Condition : (ranking#25 <= 5) + +(33) Project [codegen id : 7] +Output [1]: [s_state#22] +Input [4]: [s_state#22, s_state#15, _w2#23, ranking#25] + +(34) BroadcastExchange +Input [1]: [s_state#22] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#26] + +(35) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [s_state#10] +Right keys [1]: [s_state#22] +Join condition: None + +(36) BroadcastExchange +Input [3]: [s_store_sk#8, s_county#9, s_state#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(37) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#8] +Join condition: None + +(38) Project [codegen id : 9] +Output [3]: [ss_net_profit#2, s_state#10, s_county#9] +Input [5]: [ss_store_sk#1, ss_net_profit#2, s_store_sk#8, s_county#9, s_state#10] + +(39) Expand [codegen id : 9] +Input [3]: [ss_net_profit#2, s_state#10, s_county#9] +Arguments: [List(ss_net_profit#2, s_state#10, s_county#9, 0), List(ss_net_profit#2, s_state#10, null, 1), List(ss_net_profit#2, null, null, 3)], [ss_net_profit#2, s_state#28, s_county#29, spark_grouping_id#30] + +(40) HashAggregate [codegen id : 9] +Input [4]: [ss_net_profit#2, s_state#28, s_county#29, spark_grouping_id#30] +Keys [3]: [s_state#28, s_county#29, spark_grouping_id#30] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum#31] +Results [4]: [s_state#28, s_county#29, spark_grouping_id#30, sum#32] + +(41) Exchange +Input [4]: [s_state#28, s_county#29, spark_grouping_id#30, sum#32] +Arguments: hashpartitioning(s_state#28, s_county#29, spark_grouping_id#30, 5), ENSURE_REQUIREMENTS, [id=#33] + +(42) HashAggregate [codegen id : 10] +Input [4]: [s_state#28, s_county#29, spark_grouping_id#30, sum#32] +Keys [3]: [s_state#28, s_county#29, spark_grouping_id#30] +Functions [1]: [sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#2))#34] +Results [7]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#2))#34,17,2) AS total_sum#35, s_state#28, s_county#29, (cast((shiftright(spark_grouping_id#30, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#30, 0) & 1) as tinyint)) AS lochierarchy#36, (cast((shiftright(spark_grouping_id#30, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#30, 0) & 1) as tinyint)) AS _w1#37, CASE WHEN (cast((shiftright(spark_grouping_id#30, 0) & 1) as tinyint) = 0) THEN s_state#28 END AS _w2#38, MakeDecimal(sum(UnscaledValue(ss_net_profit#2))#34,17,2) AS _w3#39] + +(43) Exchange +Input [7]: [total_sum#35, s_state#28, s_county#29, lochierarchy#36, _w1#37, _w2#38, _w3#39] +Arguments: hashpartitioning(_w1#37, _w2#38, 5), ENSURE_REQUIREMENTS, [id=#40] + +(44) Sort [codegen id : 11] +Input [7]: [total_sum#35, s_state#28, s_county#29, lochierarchy#36, _w1#37, _w2#38, _w3#39] +Arguments: [_w1#37 ASC NULLS FIRST, _w2#38 ASC NULLS FIRST, _w3#39 DESC NULLS LAST], false, 0 + +(45) Window +Input [7]: [total_sum#35, s_state#28, s_county#29, lochierarchy#36, _w1#37, _w2#38, _w3#39] +Arguments: [rank(_w3#39) windowspecdefinition(_w1#37, _w2#38, _w3#39 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#41], [_w1#37, _w2#38], [_w3#39 DESC NULLS LAST] + +(46) Project [codegen id : 12] +Output [5]: [total_sum#35, s_state#28, s_county#29, lochierarchy#36, rank_within_parent#41] +Input [8]: [total_sum#35, s_state#28, s_county#29, lochierarchy#36, _w1#37, _w2#38, _w3#39, rank_within_parent#41] + +(47) TakeOrderedAndProject +Input [5]: [total_sum#35, s_state#28, s_county#29, lochierarchy#36, rank_within_parent#41] +Arguments: 100, [lochierarchy#36 DESC NULLS LAST, CASE WHEN (lochierarchy#36 = 0) THEN s_state#28 END ASC NULLS FIRST, rank_within_parent#41 ASC NULLS FIRST], [total_sum#35, s_state#28, s_county#29, lochierarchy#36, rank_within_parent#41] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (48) + + +(48) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + +Subquery:2 Hosting operator id = 14 Hosting Expression = ss_sold_date_sk#13 IN dynamicpruning#4 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70/simplified.txt new file mode 100644 index 0000000000000..f52e7f9a11922 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q70/simplified.txt @@ -0,0 +1,77 @@ +TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_county] + WholeStageCodegen (12) + Project [total_sum,s_state,s_county,lochierarchy,rank_within_parent] + InputAdapter + Window [_w3,_w1,_w2] + WholeStageCodegen (11) + Sort [_w1,_w2,_w3] + InputAdapter + Exchange [_w1,_w2] #1 + WholeStageCodegen (10) + HashAggregate [s_state,s_county,spark_grouping_id,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,lochierarchy,_w1,_w2,_w3,sum] + InputAdapter + Exchange [s_state,s_county,spark_grouping_id] #2 + WholeStageCodegen (9) + HashAggregate [s_state,s_county,spark_grouping_id,ss_net_profit] [sum,sum] + Expand [ss_net_profit,s_state,s_county] + Project [ss_net_profit,s_state,s_county] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (8) + BroadcastHashJoin [s_state,s_state] + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county,s_state] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + Project [s_state] + Filter [ranking] + InputAdapter + Window [_w2,s_state] + WholeStageCodegen (6) + Sort [s_state,_w2] + InputAdapter + Exchange [s_state] #6 + WholeStageCodegen (5) + HashAggregate [s_state,sum] [sum(UnscaledValue(ss_net_profit)),s_state,_w2,sum] + InputAdapter + Exchange [s_state] #7 + WholeStageCodegen (4) + HashAggregate [s_state,ss_net_profit] [sum,sum] + Project [ss_net_profit,s_state] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_net_profit,ss_sold_date_sk,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_net_profit,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + ReusedExchange [d_date_sk] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/explain.txt new file mode 100644 index 0000000000000..274d0c02b5583 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/explain.txt @@ -0,0 +1,249 @@ +== Physical Plan == +* Sort (42) ++- Exchange (41) + +- * HashAggregate (40) + +- Exchange (39) + +- * HashAggregate (38) + +- * Project (37) + +- * BroadcastHashJoin Inner BuildRight (36) + :- * Project (30) + : +- * BroadcastHashJoin Inner BuildLeft (29) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.item (1) + : +- Union (28) + : :- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.web_sales (6) + : : +- BroadcastExchange (13) + : : +- * Project (12) + : : +- * Filter (11) + : : +- * ColumnarToRow (10) + : : +- Scan parquet default.date_dim (9) + : :- * Project (21) + : : +- * BroadcastHashJoin Inner BuildRight (20) + : : :- * Filter (18) + : : : +- * ColumnarToRow (17) + : : : +- Scan parquet default.catalog_sales (16) + : : +- ReusedExchange (19) + : +- * Project (27) + : +- * BroadcastHashJoin Inner BuildRight (26) + : :- * Filter (24) + : : +- * ColumnarToRow (23) + : : +- Scan parquet default.store_sales (22) + : +- ReusedExchange (25) + +- BroadcastExchange (35) + +- * Project (34) + +- * Filter (33) + +- * ColumnarToRow (32) + +- Scan parquet default.time_dim (31) + + +(1) Scan parquet default.item +Output [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] + +(3) Filter [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] +Condition : ((isnotnull(i_manager_id#4) AND (i_manager_id#4 = 1)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] + +(5) BroadcastExchange +Input [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] + +(6) Scan parquet default.web_sales +Output [4]: [ws_sold_time_sk#6, ws_item_sk#7, ws_ext_sales_price#8, ws_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#9), dynamicpruningexpression(ws_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_time_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [4]: [ws_sold_time_sk#6, ws_item_sk#7, ws_ext_sales_price#8, ws_sold_date_sk#9] + +(8) Filter [codegen id : 3] +Input [4]: [ws_sold_time_sk#6, ws_item_sk#7, ws_ext_sales_price#8, ws_sold_date_sk#9] +Condition : (isnotnull(ws_item_sk#7) AND isnotnull(ws_sold_time_sk#6)) + +(9) Scan parquet default.date_dim +Output [3]: [d_date_sk#11, d_year#12, d_moy#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(10) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(11) Filter [codegen id : 2] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] +Condition : ((((isnotnull(d_moy#13) AND isnotnull(d_year#12)) AND (d_moy#13 = 11)) AND (d_year#12 = 1999)) AND isnotnull(d_date_sk#11)) + +(12) Project [codegen id : 2] +Output [1]: [d_date_sk#11] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(13) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#9] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(15) Project [codegen id : 3] +Output [3]: [ws_ext_sales_price#8 AS ext_price#15, ws_item_sk#7 AS sold_item_sk#16, ws_sold_time_sk#6 AS time_sk#17] +Input [5]: [ws_sold_time_sk#6, ws_item_sk#7, ws_ext_sales_price#8, ws_sold_date_sk#9, d_date_sk#11] + +(16) Scan parquet default.catalog_sales +Output [4]: [cs_sold_time_sk#18, cs_item_sk#19, cs_ext_sales_price#20, cs_sold_date_sk#21] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#21), dynamicpruningexpression(cs_sold_date_sk#21 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_time_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 5] +Input [4]: [cs_sold_time_sk#18, cs_item_sk#19, cs_ext_sales_price#20, cs_sold_date_sk#21] + +(18) Filter [codegen id : 5] +Input [4]: [cs_sold_time_sk#18, cs_item_sk#19, cs_ext_sales_price#20, cs_sold_date_sk#21] +Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_sold_time_sk#18)) + +(19) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#22] + +(20) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_sold_date_sk#21] +Right keys [1]: [d_date_sk#22] +Join condition: None + +(21) Project [codegen id : 5] +Output [3]: [cs_ext_sales_price#20 AS ext_price#23, cs_item_sk#19 AS sold_item_sk#24, cs_sold_time_sk#18 AS time_sk#25] +Input [5]: [cs_sold_time_sk#18, cs_item_sk#19, cs_ext_sales_price#20, cs_sold_date_sk#21, d_date_sk#22] + +(22) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#26, ss_item_sk#27, ss_ext_sales_price#28, ss_sold_date_sk#29] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#29), dynamicpruningexpression(ss_sold_date_sk#29 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_time_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 7] +Input [4]: [ss_sold_time_sk#26, ss_item_sk#27, ss_ext_sales_price#28, ss_sold_date_sk#29] + +(24) Filter [codegen id : 7] +Input [4]: [ss_sold_time_sk#26, ss_item_sk#27, ss_ext_sales_price#28, ss_sold_date_sk#29] +Condition : (isnotnull(ss_item_sk#27) AND isnotnull(ss_sold_time_sk#26)) + +(25) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#30] + +(26) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_sold_date_sk#29] +Right keys [1]: [d_date_sk#30] +Join condition: None + +(27) Project [codegen id : 7] +Output [3]: [ss_ext_sales_price#28 AS ext_price#31, ss_item_sk#27 AS sold_item_sk#32, ss_sold_time_sk#26 AS time_sk#33] +Input [5]: [ss_sold_time_sk#26, ss_item_sk#27, ss_ext_sales_price#28, ss_sold_date_sk#29, d_date_sk#30] + +(28) Union + +(29) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [sold_item_sk#16] +Join condition: None + +(30) Project [codegen id : 9] +Output [4]: [i_brand_id#2, i_brand#3, ext_price#15, time_sk#17] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ext_price#15, sold_item_sk#16, time_sk#17] + +(31) Scan parquet default.time_dim +Output [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [Or(EqualTo(t_meal_time,breakfast ),EqualTo(t_meal_time,dinner )), IsNotNull(t_time_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 8] +Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] + +(33) Filter [codegen id : 8] +Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] +Condition : (((t_meal_time#37 = breakfast ) OR (t_meal_time#37 = dinner )) AND isnotnull(t_time_sk#34)) + +(34) Project [codegen id : 8] +Output [3]: [t_time_sk#34, t_hour#35, t_minute#36] +Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] + +(35) BroadcastExchange +Input [3]: [t_time_sk#34, t_hour#35, t_minute#36] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#38] + +(36) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [time_sk#17] +Right keys [1]: [t_time_sk#34] +Join condition: None + +(37) Project [codegen id : 9] +Output [5]: [i_brand_id#2, i_brand#3, ext_price#15, t_hour#35, t_minute#36] +Input [7]: [i_brand_id#2, i_brand#3, ext_price#15, time_sk#17, t_time_sk#34, t_hour#35, t_minute#36] + +(38) HashAggregate [codegen id : 9] +Input [5]: [i_brand_id#2, i_brand#3, ext_price#15, t_hour#35, t_minute#36] +Keys [4]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36] +Functions [1]: [partial_sum(UnscaledValue(ext_price#15))] +Aggregate Attributes [1]: [sum#39] +Results [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] + +(39) Exchange +Input [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] +Arguments: hashpartitioning(i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, 5), ENSURE_REQUIREMENTS, [id=#41] + +(40) HashAggregate [codegen id : 10] +Input [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] +Keys [4]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36] +Functions [1]: [sum(UnscaledValue(ext_price#15))] +Aggregate Attributes [1]: [sum(UnscaledValue(ext_price#15))#42] +Results [5]: [i_brand_id#2 AS brand_id#43, i_brand#3 AS brand#44, t_hour#35, t_minute#36, MakeDecimal(sum(UnscaledValue(ext_price#15))#42,17,2) AS ext_price#45] + +(41) Exchange +Input [5]: [brand_id#43, brand#44, t_hour#35, t_minute#36, ext_price#45] +Arguments: rangepartitioning(ext_price#45 DESC NULLS LAST, brand_id#43 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#46] + +(42) Sort [codegen id : 11] +Input [5]: [brand_id#43, brand#44, t_hour#35, t_minute#36, ext_price#45] +Arguments: [ext_price#45 DESC NULLS LAST, brand_id#43 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ws_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (43) + + +(43) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#11] + +Subquery:2 Hosting operator id = 16 Hosting Expression = cs_sold_date_sk#21 IN dynamicpruning#10 + +Subquery:3 Hosting operator id = 22 Hosting Expression = ss_sold_date_sk#29 IN dynamicpruning#10 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/simplified.txt new file mode 100644 index 0000000000000..eaa3121cbab39 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71.sf100/simplified.txt @@ -0,0 +1,69 @@ +WholeStageCodegen (11) + Sort [ext_price,brand_id] + InputAdapter + Exchange [ext_price,brand_id] #1 + WholeStageCodegen (10) + HashAggregate [i_brand,i_brand_id,t_hour,t_minute,sum] [sum(UnscaledValue(ext_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [i_brand,i_brand_id,t_hour,t_minute] #2 + WholeStageCodegen (9) + HashAggregate [i_brand,i_brand_id,t_hour,t_minute,ext_price] [sum,sum] + Project [i_brand_id,i_brand,ext_price,t_hour,t_minute] + BroadcastHashJoin [time_sk,t_time_sk] + Project [i_brand_id,i_brand,ext_price,time_sk] + BroadcastHashJoin [i_item_sk,sold_item_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] + InputAdapter + Union + WholeStageCodegen (3) + Project [ws_ext_sales_price,ws_item_sk,ws_sold_time_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk,ws_sold_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_time_sk,ws_item_sk,ws_ext_sales_price,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (5) + Project [cs_ext_sales_price,cs_item_sk,cs_sold_time_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk,cs_sold_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_time_sk,cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + WholeStageCodegen (7) + Project [ss_ext_sales_price,ss_item_sk,ss_sold_time_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk,ss_sold_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (8) + Project [t_time_sk,t_hour,t_minute] + Filter [t_meal_time,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute,t_meal_time] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/explain.txt new file mode 100644 index 0000000000000..274d0c02b5583 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/explain.txt @@ -0,0 +1,249 @@ +== Physical Plan == +* Sort (42) ++- Exchange (41) + +- * HashAggregate (40) + +- Exchange (39) + +- * HashAggregate (38) + +- * Project (37) + +- * BroadcastHashJoin Inner BuildRight (36) + :- * Project (30) + : +- * BroadcastHashJoin Inner BuildLeft (29) + : :- BroadcastExchange (5) + : : +- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.item (1) + : +- Union (28) + : :- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.web_sales (6) + : : +- BroadcastExchange (13) + : : +- * Project (12) + : : +- * Filter (11) + : : +- * ColumnarToRow (10) + : : +- Scan parquet default.date_dim (9) + : :- * Project (21) + : : +- * BroadcastHashJoin Inner BuildRight (20) + : : :- * Filter (18) + : : : +- * ColumnarToRow (17) + : : : +- Scan parquet default.catalog_sales (16) + : : +- ReusedExchange (19) + : +- * Project (27) + : +- * BroadcastHashJoin Inner BuildRight (26) + : :- * Filter (24) + : : +- * ColumnarToRow (23) + : : +- Scan parquet default.store_sales (22) + : +- ReusedExchange (25) + +- BroadcastExchange (35) + +- * Project (34) + +- * Filter (33) + +- * ColumnarToRow (32) + +- Scan parquet default.time_dim (31) + + +(1) Scan parquet default.item +Output [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manager_id), EqualTo(i_manager_id,1), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] + +(3) Filter [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] +Condition : ((isnotnull(i_manager_id#4) AND (i_manager_id#4 = 1)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] +Input [4]: [i_item_sk#1, i_brand_id#2, i_brand#3, i_manager_id#4] + +(5) BroadcastExchange +Input [3]: [i_item_sk#1, i_brand_id#2, i_brand#3] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#5] + +(6) Scan parquet default.web_sales +Output [4]: [ws_sold_time_sk#6, ws_item_sk#7, ws_ext_sales_price#8, ws_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#9), dynamicpruningexpression(ws_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_sold_time_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [4]: [ws_sold_time_sk#6, ws_item_sk#7, ws_ext_sales_price#8, ws_sold_date_sk#9] + +(8) Filter [codegen id : 3] +Input [4]: [ws_sold_time_sk#6, ws_item_sk#7, ws_ext_sales_price#8, ws_sold_date_sk#9] +Condition : (isnotnull(ws_item_sk#7) AND isnotnull(ws_sold_time_sk#6)) + +(9) Scan parquet default.date_dim +Output [3]: [d_date_sk#11, d_year#12, d_moy#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_moy), IsNotNull(d_year), EqualTo(d_moy,11), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(10) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(11) Filter [codegen id : 2] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] +Condition : ((((isnotnull(d_moy#13) AND isnotnull(d_year#12)) AND (d_moy#13 = 11)) AND (d_year#12 = 1999)) AND isnotnull(d_date_sk#11)) + +(12) Project [codegen id : 2] +Output [1]: [d_date_sk#11] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(13) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#9] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(15) Project [codegen id : 3] +Output [3]: [ws_ext_sales_price#8 AS ext_price#15, ws_item_sk#7 AS sold_item_sk#16, ws_sold_time_sk#6 AS time_sk#17] +Input [5]: [ws_sold_time_sk#6, ws_item_sk#7, ws_ext_sales_price#8, ws_sold_date_sk#9, d_date_sk#11] + +(16) Scan parquet default.catalog_sales +Output [4]: [cs_sold_time_sk#18, cs_item_sk#19, cs_ext_sales_price#20, cs_sold_date_sk#21] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#21), dynamicpruningexpression(cs_sold_date_sk#21 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_sold_time_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 5] +Input [4]: [cs_sold_time_sk#18, cs_item_sk#19, cs_ext_sales_price#20, cs_sold_date_sk#21] + +(18) Filter [codegen id : 5] +Input [4]: [cs_sold_time_sk#18, cs_item_sk#19, cs_ext_sales_price#20, cs_sold_date_sk#21] +Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_sold_time_sk#18)) + +(19) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#22] + +(20) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_sold_date_sk#21] +Right keys [1]: [d_date_sk#22] +Join condition: None + +(21) Project [codegen id : 5] +Output [3]: [cs_ext_sales_price#20 AS ext_price#23, cs_item_sk#19 AS sold_item_sk#24, cs_sold_time_sk#18 AS time_sk#25] +Input [5]: [cs_sold_time_sk#18, cs_item_sk#19, cs_ext_sales_price#20, cs_sold_date_sk#21, d_date_sk#22] + +(22) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#26, ss_item_sk#27, ss_ext_sales_price#28, ss_sold_date_sk#29] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#29), dynamicpruningexpression(ss_sold_date_sk#29 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_sold_time_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 7] +Input [4]: [ss_sold_time_sk#26, ss_item_sk#27, ss_ext_sales_price#28, ss_sold_date_sk#29] + +(24) Filter [codegen id : 7] +Input [4]: [ss_sold_time_sk#26, ss_item_sk#27, ss_ext_sales_price#28, ss_sold_date_sk#29] +Condition : (isnotnull(ss_item_sk#27) AND isnotnull(ss_sold_time_sk#26)) + +(25) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#30] + +(26) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_sold_date_sk#29] +Right keys [1]: [d_date_sk#30] +Join condition: None + +(27) Project [codegen id : 7] +Output [3]: [ss_ext_sales_price#28 AS ext_price#31, ss_item_sk#27 AS sold_item_sk#32, ss_sold_time_sk#26 AS time_sk#33] +Input [5]: [ss_sold_time_sk#26, ss_item_sk#27, ss_ext_sales_price#28, ss_sold_date_sk#29, d_date_sk#30] + +(28) Union + +(29) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [sold_item_sk#16] +Join condition: None + +(30) Project [codegen id : 9] +Output [4]: [i_brand_id#2, i_brand#3, ext_price#15, time_sk#17] +Input [6]: [i_item_sk#1, i_brand_id#2, i_brand#3, ext_price#15, sold_item_sk#16, time_sk#17] + +(31) Scan parquet default.time_dim +Output [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [Or(EqualTo(t_meal_time,breakfast ),EqualTo(t_meal_time,dinner )), IsNotNull(t_time_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 8] +Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] + +(33) Filter [codegen id : 8] +Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] +Condition : (((t_meal_time#37 = breakfast ) OR (t_meal_time#37 = dinner )) AND isnotnull(t_time_sk#34)) + +(34) Project [codegen id : 8] +Output [3]: [t_time_sk#34, t_hour#35, t_minute#36] +Input [4]: [t_time_sk#34, t_hour#35, t_minute#36, t_meal_time#37] + +(35) BroadcastExchange +Input [3]: [t_time_sk#34, t_hour#35, t_minute#36] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#38] + +(36) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [time_sk#17] +Right keys [1]: [t_time_sk#34] +Join condition: None + +(37) Project [codegen id : 9] +Output [5]: [i_brand_id#2, i_brand#3, ext_price#15, t_hour#35, t_minute#36] +Input [7]: [i_brand_id#2, i_brand#3, ext_price#15, time_sk#17, t_time_sk#34, t_hour#35, t_minute#36] + +(38) HashAggregate [codegen id : 9] +Input [5]: [i_brand_id#2, i_brand#3, ext_price#15, t_hour#35, t_minute#36] +Keys [4]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36] +Functions [1]: [partial_sum(UnscaledValue(ext_price#15))] +Aggregate Attributes [1]: [sum#39] +Results [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] + +(39) Exchange +Input [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] +Arguments: hashpartitioning(i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, 5), ENSURE_REQUIREMENTS, [id=#41] + +(40) HashAggregate [codegen id : 10] +Input [5]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36, sum#40] +Keys [4]: [i_brand#3, i_brand_id#2, t_hour#35, t_minute#36] +Functions [1]: [sum(UnscaledValue(ext_price#15))] +Aggregate Attributes [1]: [sum(UnscaledValue(ext_price#15))#42] +Results [5]: [i_brand_id#2 AS brand_id#43, i_brand#3 AS brand#44, t_hour#35, t_minute#36, MakeDecimal(sum(UnscaledValue(ext_price#15))#42,17,2) AS ext_price#45] + +(41) Exchange +Input [5]: [brand_id#43, brand#44, t_hour#35, t_minute#36, ext_price#45] +Arguments: rangepartitioning(ext_price#45 DESC NULLS LAST, brand_id#43 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#46] + +(42) Sort [codegen id : 11] +Input [5]: [brand_id#43, brand#44, t_hour#35, t_minute#36, ext_price#45] +Arguments: [ext_price#45 DESC NULLS LAST, brand_id#43 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ws_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (43) + + +(43) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#11] + +Subquery:2 Hosting operator id = 16 Hosting Expression = cs_sold_date_sk#21 IN dynamicpruning#10 + +Subquery:3 Hosting operator id = 22 Hosting Expression = ss_sold_date_sk#29 IN dynamicpruning#10 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/simplified.txt new file mode 100644 index 0000000000000..eaa3121cbab39 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q71/simplified.txt @@ -0,0 +1,69 @@ +WholeStageCodegen (11) + Sort [ext_price,brand_id] + InputAdapter + Exchange [ext_price,brand_id] #1 + WholeStageCodegen (10) + HashAggregate [i_brand,i_brand_id,t_hour,t_minute,sum] [sum(UnscaledValue(ext_price)),brand_id,brand,ext_price,sum] + InputAdapter + Exchange [i_brand,i_brand_id,t_hour,t_minute] #2 + WholeStageCodegen (9) + HashAggregate [i_brand,i_brand_id,t_hour,t_minute,ext_price] [sum,sum] + Project [i_brand_id,i_brand,ext_price,t_hour,t_minute] + BroadcastHashJoin [time_sk,t_time_sk] + Project [i_brand_id,i_brand,ext_price,time_sk] + BroadcastHashJoin [i_item_sk,sold_item_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_brand_id,i_brand] + Filter [i_manager_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_brand,i_manager_id] + InputAdapter + Union + WholeStageCodegen (3) + Project [ws_ext_sales_price,ws_item_sk,ws_sold_time_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk,ws_sold_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_time_sk,ws_item_sk,ws_ext_sales_price,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_moy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (5) + Project [cs_ext_sales_price,cs_item_sk,cs_sold_time_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk,cs_sold_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_sold_time_sk,cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + WholeStageCodegen (7) + Project [ss_ext_sales_price,ss_item_sk,ss_sold_time_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk,ss_sold_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (8) + Project [t_time_sk,t_hour,t_minute] + Filter [t_meal_time,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute,t_meal_time] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/explain.txt new file mode 100644 index 0000000000000..ac66894467451 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/explain.txt @@ -0,0 +1,453 @@ +== Physical Plan == +TakeOrderedAndProject (80) ++- * HashAggregate (79) + +- Exchange (78) + +- * HashAggregate (77) + +- * Project (76) + +- * SortMergeJoin LeftOuter (75) + :- * Sort (68) + : +- Exchange (67) + : +- * Project (66) + : +- * BroadcastHashJoin LeftOuter BuildRight (65) + : :- * Project (60) + : : +- * SortMergeJoin Inner (59) + : : :- * Sort (47) + : : : +- Exchange (46) + : : : +- * Project (45) + : : : +- * BroadcastHashJoin Inner BuildRight (44) + : : : :- * Project (32) + : : : : +- * SortMergeJoin Inner (31) + : : : : :- * Sort (25) + : : : : : +- Exchange (24) + : : : : : +- * Project (23) + : : : : : +- * BroadcastHashJoin Inner BuildRight (22) + : : : : : :- * Project (17) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : : : :- * Project (10) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : : : :- * Filter (3) + : : : : : : : : +- * ColumnarToRow (2) + : : : : : : : : +- Scan parquet default.catalog_sales (1) + : : : : : : : +- BroadcastExchange (8) + : : : : : : : +- * Project (7) + : : : : : : : +- * Filter (6) + : : : : : : : +- * ColumnarToRow (5) + : : : : : : : +- Scan parquet default.household_demographics (4) + : : : : : : +- BroadcastExchange (15) + : : : : : : +- * Project (14) + : : : : : : +- * Filter (13) + : : : : : : +- * ColumnarToRow (12) + : : : : : : +- Scan parquet default.customer_demographics (11) + : : : : : +- BroadcastExchange (21) + : : : : : +- * Filter (20) + : : : : : +- * ColumnarToRow (19) + : : : : : +- Scan parquet default.date_dim (18) + : : : : +- * Sort (30) + : : : : +- Exchange (29) + : : : : +- * Filter (28) + : : : : +- * ColumnarToRow (27) + : : : : +- Scan parquet default.item (26) + : : : +- BroadcastExchange (43) + : : : +- * Project (42) + : : : +- * BroadcastHashJoin Inner BuildLeft (41) + : : : :- BroadcastExchange (37) + : : : : +- * Project (36) + : : : : +- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.date_dim (33) + : : : +- * Filter (40) + : : : +- * ColumnarToRow (39) + : : : +- Scan parquet default.date_dim (38) + : : +- * Sort (58) + : : +- Exchange (57) + : : +- * Project (56) + : : +- * BroadcastHashJoin Inner BuildRight (55) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.inventory (48) + : : +- BroadcastExchange (54) + : : +- * Filter (53) + : : +- * ColumnarToRow (52) + : : +- Scan parquet default.warehouse (51) + : +- BroadcastExchange (64) + : +- * Filter (63) + : +- * ColumnarToRow (62) + : +- Scan parquet default.promotion (61) + +- * Sort (74) + +- Exchange (73) + +- * Project (72) + +- * Filter (71) + +- * ColumnarToRow (70) + +- Scan parquet default.catalog_returns (69) + + +(1) Scan parquet default.catalog_sales +Output [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#8), dynamicpruningexpression(cs_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(cs_quantity), IsNotNull(cs_item_sk), IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_hdemo_sk), IsNotNull(cs_ship_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] + +(3) Filter [codegen id : 4] +Input [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] +Condition : ((((isnotnull(cs_quantity#7) AND isnotnull(cs_item_sk#4)) AND isnotnull(cs_bill_cdemo_sk#2)) AND isnotnull(cs_bill_hdemo_sk#3)) AND isnotnull(cs_ship_date_sk#1)) + +(4) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#10, hd_buy_potential#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_buy_potential), EqualTo(hd_buy_potential,>10000 ), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [hd_demo_sk#10, hd_buy_potential#11] + +(6) Filter [codegen id : 1] +Input [2]: [hd_demo_sk#10, hd_buy_potential#11] +Condition : ((isnotnull(hd_buy_potential#11) AND (hd_buy_potential#11 = >10000 )) AND isnotnull(hd_demo_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [hd_demo_sk#10] +Input [2]: [hd_demo_sk#10, hd_buy_potential#11] + +(8) BroadcastExchange +Input [1]: [hd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_bill_hdemo_sk#3] +Right keys [1]: [hd_demo_sk#10] +Join condition: None + +(10) Project [codegen id : 4] +Output [7]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] +Input [9]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, hd_demo_sk#10] + +(11) Scan parquet default.customer_demographics +Output [2]: [cd_demo_sk#13, cd_marital_status#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_marital_status), EqualTo(cd_marital_status,D), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [cd_demo_sk#13, cd_marital_status#14] + +(13) Filter [codegen id : 2] +Input [2]: [cd_demo_sk#13, cd_marital_status#14] +Condition : ((isnotnull(cd_marital_status#14) AND (cd_marital_status#14 = D)) AND isnotnull(cd_demo_sk#13)) + +(14) Project [codegen id : 2] +Output [1]: [cd_demo_sk#13] +Input [2]: [cd_demo_sk#13, cd_marital_status#14] + +(15) BroadcastExchange +Input [1]: [cd_demo_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_bill_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#13] +Join condition: None + +(17) Project [codegen id : 4] +Output [6]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] +Input [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, cd_demo_sk#13] + +(18) Scan parquet default.date_dim +Output [2]: [d_date_sk#16, d_date#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), IsNotNull(d_date_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#16, d_date#17] + +(20) Filter [codegen id : 3] +Input [2]: [d_date_sk#16, d_date#17] +Condition : (isnotnull(d_date#17) AND isnotnull(d_date_sk#16)) + +(21) BroadcastExchange +Input [2]: [d_date_sk#16, d_date#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_ship_date_sk#1] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(23) Project [codegen id : 4] +Output [6]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date#17] +Input [8]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date_sk#16, d_date#17] + +(24) Exchange +Input [6]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date#17] +Arguments: hashpartitioning(cs_item_sk#4, 5), ENSURE_REQUIREMENTS, [id=#19] + +(25) Sort [codegen id : 5] +Input [6]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date#17] +Arguments: [cs_item_sk#4 ASC NULLS FIRST], false, 0 + +(26) Scan parquet default.item +Output [2]: [i_item_sk#20, i_item_desc#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 6] +Input [2]: [i_item_sk#20, i_item_desc#21] + +(28) Filter [codegen id : 6] +Input [2]: [i_item_sk#20, i_item_desc#21] +Condition : isnotnull(i_item_sk#20) + +(29) Exchange +Input [2]: [i_item_sk#20, i_item_desc#21] +Arguments: hashpartitioning(i_item_sk#20, 5), ENSURE_REQUIREMENTS, [id=#22] + +(30) Sort [codegen id : 7] +Input [2]: [i_item_sk#20, i_item_desc#21] +Arguments: [i_item_sk#20 ASC NULLS FIRST], false, 0 + +(31) SortMergeJoin [codegen id : 10] +Left keys [1]: [cs_item_sk#4] +Right keys [1]: [i_item_sk#20] +Join condition: None + +(32) Project [codegen id : 10] +Output [7]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date#17, i_item_desc#21] +Input [8]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date#17, i_item_sk#20, i_item_desc#21] + +(33) Scan parquet default.date_dim +Output [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_year#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1999), IsNotNull(d_date_sk), IsNotNull(d_week_seq), IsNotNull(d_date)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 8] +Input [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_year#26] + +(35) Filter [codegen id : 8] +Input [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_year#26] +Condition : ((((isnotnull(d_year#26) AND (d_year#26 = 1999)) AND isnotnull(d_date_sk#23)) AND isnotnull(d_week_seq#25)) AND isnotnull(d_date#24)) + +(36) Project [codegen id : 8] +Output [3]: [d_date_sk#23, d_date#24, d_week_seq#25] +Input [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_year#26] + +(37) BroadcastExchange +Input [3]: [d_date_sk#23, d_date#24, d_week_seq#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#27] + +(38) Scan parquet default.date_dim +Output [2]: [d_date_sk#28, d_week_seq#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(39) ColumnarToRow +Input [2]: [d_date_sk#28, d_week_seq#29] + +(40) Filter +Input [2]: [d_date_sk#28, d_week_seq#29] +Condition : (isnotnull(d_week_seq#29) AND isnotnull(d_date_sk#28)) + +(41) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [d_week_seq#25] +Right keys [1]: [d_week_seq#29] +Join condition: None + +(42) Project [codegen id : 9] +Output [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_date_sk#28] +Input [5]: [d_date_sk#23, d_date#24, d_week_seq#25, d_date_sk#28, d_week_seq#29] + +(43) BroadcastExchange +Input [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_date_sk#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30] + +(44) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#8] +Right keys [1]: [d_date_sk#23] +Join condition: (d_date#17 > d_date#24 + 5 days) + +(45) Project [codegen id : 10] +Output [7]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, i_item_desc#21, d_week_seq#25, d_date_sk#28] +Input [11]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date#17, i_item_desc#21, d_date_sk#23, d_date#24, d_week_seq#25, d_date_sk#28] + +(46) Exchange +Input [7]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, i_item_desc#21, d_week_seq#25, d_date_sk#28] +Arguments: hashpartitioning(cs_item_sk#4, d_date_sk#28, 5), ENSURE_REQUIREMENTS, [id=#31] + +(47) Sort [codegen id : 11] +Input [7]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, i_item_desc#21, d_week_seq#25, d_date_sk#28] +Arguments: [cs_item_sk#4 ASC NULLS FIRST, d_date_sk#28 ASC NULLS FIRST], false, 0 + +(48) Scan parquet default.inventory +Output [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#35), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(inv_quantity_on_hand), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 13] +Input [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35] + +(50) Filter [codegen id : 13] +Input [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35] +Condition : ((isnotnull(inv_quantity_on_hand#34) AND isnotnull(inv_item_sk#32)) AND isnotnull(inv_warehouse_sk#33)) + +(51) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#36, w_warehouse_name#37] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 12] +Input [2]: [w_warehouse_sk#36, w_warehouse_name#37] + +(53) Filter [codegen id : 12] +Input [2]: [w_warehouse_sk#36, w_warehouse_name#37] +Condition : isnotnull(w_warehouse_sk#36) + +(54) BroadcastExchange +Input [2]: [w_warehouse_sk#36, w_warehouse_name#37] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#38] + +(55) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [inv_warehouse_sk#33] +Right keys [1]: [w_warehouse_sk#36] +Join condition: None + +(56) Project [codegen id : 13] +Output [4]: [inv_item_sk#32, inv_quantity_on_hand#34, inv_date_sk#35, w_warehouse_name#37] +Input [6]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35, w_warehouse_sk#36, w_warehouse_name#37] + +(57) Exchange +Input [4]: [inv_item_sk#32, inv_quantity_on_hand#34, inv_date_sk#35, w_warehouse_name#37] +Arguments: hashpartitioning(inv_item_sk#32, inv_date_sk#35, 5), ENSURE_REQUIREMENTS, [id=#39] + +(58) Sort [codegen id : 14] +Input [4]: [inv_item_sk#32, inv_quantity_on_hand#34, inv_date_sk#35, w_warehouse_name#37] +Arguments: [inv_item_sk#32 ASC NULLS FIRST, inv_date_sk#35 ASC NULLS FIRST], false, 0 + +(59) SortMergeJoin [codegen id : 16] +Left keys [2]: [cs_item_sk#4, d_date_sk#28] +Right keys [2]: [inv_item_sk#32, inv_date_sk#35] +Join condition: (inv_quantity_on_hand#34 < cs_quantity#7) + +(60) Project [codegen id : 16] +Output [6]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, w_warehouse_name#37, i_item_desc#21, d_week_seq#25] +Input [11]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, i_item_desc#21, d_week_seq#25, d_date_sk#28, inv_item_sk#32, inv_quantity_on_hand#34, inv_date_sk#35, w_warehouse_name#37] + +(61) Scan parquet default.promotion +Output [1]: [p_promo_sk#40] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_promo_sk)] +ReadSchema: struct + +(62) ColumnarToRow [codegen id : 15] +Input [1]: [p_promo_sk#40] + +(63) Filter [codegen id : 15] +Input [1]: [p_promo_sk#40] +Condition : isnotnull(p_promo_sk#40) + +(64) BroadcastExchange +Input [1]: [p_promo_sk#40] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#41] + +(65) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [cs_promo_sk#5] +Right keys [1]: [p_promo_sk#40] +Join condition: None + +(66) Project [codegen id : 16] +Output [5]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#37, i_item_desc#21, d_week_seq#25] +Input [7]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, w_warehouse_name#37, i_item_desc#21, d_week_seq#25, p_promo_sk#40] + +(67) Exchange +Input [5]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#37, i_item_desc#21, d_week_seq#25] +Arguments: hashpartitioning(cs_item_sk#4, cs_order_number#6, 5), ENSURE_REQUIREMENTS, [id=#42] + +(68) Sort [codegen id : 17] +Input [5]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#37, i_item_desc#21, d_week_seq#25] +Arguments: [cs_item_sk#4 ASC NULLS FIRST, cs_order_number#6 ASC NULLS FIRST], false, 0 + +(69) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#43, cr_order_number#44, cr_returned_date_sk#45] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_order_number)] +ReadSchema: struct + +(70) ColumnarToRow [codegen id : 18] +Input [3]: [cr_item_sk#43, cr_order_number#44, cr_returned_date_sk#45] + +(71) Filter [codegen id : 18] +Input [3]: [cr_item_sk#43, cr_order_number#44, cr_returned_date_sk#45] +Condition : (isnotnull(cr_item_sk#43) AND isnotnull(cr_order_number#44)) + +(72) Project [codegen id : 18] +Output [2]: [cr_item_sk#43, cr_order_number#44] +Input [3]: [cr_item_sk#43, cr_order_number#44, cr_returned_date_sk#45] + +(73) Exchange +Input [2]: [cr_item_sk#43, cr_order_number#44] +Arguments: hashpartitioning(cr_item_sk#43, cr_order_number#44, 5), ENSURE_REQUIREMENTS, [id=#46] + +(74) Sort [codegen id : 19] +Input [2]: [cr_item_sk#43, cr_order_number#44] +Arguments: [cr_item_sk#43 ASC NULLS FIRST, cr_order_number#44 ASC NULLS FIRST], false, 0 + +(75) SortMergeJoin [codegen id : 20] +Left keys [2]: [cs_item_sk#4, cs_order_number#6] +Right keys [2]: [cr_item_sk#43, cr_order_number#44] +Join condition: None + +(76) Project [codegen id : 20] +Output [3]: [w_warehouse_name#37, i_item_desc#21, d_week_seq#25] +Input [7]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#37, i_item_desc#21, d_week_seq#25, cr_item_sk#43, cr_order_number#44] + +(77) HashAggregate [codegen id : 20] +Input [3]: [w_warehouse_name#37, i_item_desc#21, d_week_seq#25] +Keys [3]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#47] +Results [4]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25, count#48] + +(78) Exchange +Input [4]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25, count#48] +Arguments: hashpartitioning(i_item_desc#21, w_warehouse_name#37, d_week_seq#25, 5), ENSURE_REQUIREMENTS, [id=#49] + +(79) HashAggregate [codegen id : 21] +Input [4]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25, count#48] +Keys [3]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#50] +Results [6]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25, count(1)#50 AS no_promo#51, count(1)#50 AS promo#52, count(1)#50 AS total_cnt#53] + +(80) TakeOrderedAndProject +Input [6]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25, no_promo#51, promo#52, total_cnt#53] +Arguments: 100, [total_cnt#53 DESC NULLS LAST, i_item_desc#21 ASC NULLS FIRST, w_warehouse_name#37 ASC NULLS FIRST, d_week_seq#25 ASC NULLS FIRST], [i_item_desc#21, w_warehouse_name#37, d_week_seq#25, no_promo#51, promo#52, total_cnt#53] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (81) + + +(81) ReusedExchange [Reuses operator id: 43] +Output [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_date_sk#28] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/simplified.txt new file mode 100644 index 0000000000000..da6b79ca3c79d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72.sf100/simplified.txt @@ -0,0 +1,134 @@ +TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_promo,promo] + WholeStageCodegen (21) + HashAggregate [i_item_desc,w_warehouse_name,d_week_seq,count] [count(1),no_promo,promo,total_cnt,count] + InputAdapter + Exchange [i_item_desc,w_warehouse_name,d_week_seq] #1 + WholeStageCodegen (20) + HashAggregate [i_item_desc,w_warehouse_name,d_week_seq] [count,count] + Project [w_warehouse_name,i_item_desc,d_week_seq] + SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] + InputAdapter + WholeStageCodegen (17) + Sort [cs_item_sk,cs_order_number] + InputAdapter + Exchange [cs_item_sk,cs_order_number] #2 + WholeStageCodegen (16) + Project [cs_item_sk,cs_order_number,w_warehouse_name,i_item_desc,d_week_seq] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_item_sk,cs_promo_sk,cs_order_number,w_warehouse_name,i_item_desc,d_week_seq] + SortMergeJoin [cs_item_sk,d_date_sk,inv_item_sk,inv_date_sk,inv_quantity_on_hand,cs_quantity] + InputAdapter + WholeStageCodegen (11) + Sort [cs_item_sk,d_date_sk] + InputAdapter + Exchange [cs_item_sk,d_date_sk] #3 + WholeStageCodegen (10) + Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,i_item_desc,d_week_seq,d_date_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk,d_date,d_date] + Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,cs_sold_date_sk,d_date,i_item_desc] + SortMergeJoin [cs_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (5) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #4 + WholeStageCodegen (4) + Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,cs_sold_date_sk,d_date] + BroadcastHashJoin [cs_ship_date_sk,d_date_sk] + Project [cs_ship_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,cs_sold_date_sk] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Project [cs_ship_date_sk,cs_bill_cdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,cs_sold_date_sk] + BroadcastHashJoin [cs_bill_hdemo_sk,hd_demo_sk] + Filter [cs_quantity,cs_item_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_ship_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date,d_week_seq,d_date_sk] #5 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Project [hd_demo_sk] + Filter [hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (2) + Project [cd_demo_sk] + Filter [cd_marital_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (3) + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + WholeStageCodegen (7) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #9 + WholeStageCodegen (6) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_desc] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + Project [d_date_sk,d_date,d_week_seq,d_date_sk] + BroadcastHashJoin [d_week_seq,d_week_seq] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (8) + Project [d_date_sk,d_date,d_week_seq] + Filter [d_year,d_date_sk,d_week_seq,d_date] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_week_seq,d_year] + Filter [d_week_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] + InputAdapter + WholeStageCodegen (14) + Sort [inv_item_sk,inv_date_sk] + InputAdapter + Exchange [inv_item_sk,inv_date_sk] #11 + WholeStageCodegen (13) + Project [inv_item_sk,inv_quantity_on_hand,inv_date_sk,w_warehouse_name] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Filter [inv_quantity_on_hand,inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (12) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (15) + Filter [p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk] + InputAdapter + WholeStageCodegen (19) + Sort [cr_item_sk,cr_order_number] + InputAdapter + Exchange [cr_item_sk,cr_order_number] #14 + WholeStageCodegen (18) + Project [cr_item_sk,cr_order_number] + Filter [cr_item_sk,cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_returned_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72/explain.txt new file mode 100644 index 0000000000000..75a96ae5d2cdd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72/explain.txt @@ -0,0 +1,423 @@ +== Physical Plan == +TakeOrderedAndProject (74) ++- * HashAggregate (73) + +- Exchange (72) + +- * HashAggregate (71) + +- * Project (70) + +- * SortMergeJoin LeftOuter (69) + :- * Sort (62) + : +- Exchange (61) + : +- * Project (60) + : +- * BroadcastHashJoin LeftOuter BuildRight (59) + : :- * Project (54) + : : +- * BroadcastHashJoin Inner BuildRight (53) + : : :- * Project (48) + : : : +- * BroadcastHashJoin Inner BuildRight (47) + : : : :- * Project (42) + : : : : +- * BroadcastHashJoin Inner BuildRight (41) + : : : : :- * Project (35) + : : : : : +- * BroadcastHashJoin Inner BuildRight (34) + : : : : : :- * Project (28) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (27) + : : : : : : :- * Project (21) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : : : : : :- * Project (15) + : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : : : : : :- * Project (9) + : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : : : : :- * Filter (3) + : : : : : : : : : : +- * ColumnarToRow (2) + : : : : : : : : : : +- Scan parquet default.catalog_sales (1) + : : : : : : : : : +- BroadcastExchange (7) + : : : : : : : : : +- * Filter (6) + : : : : : : : : : +- * ColumnarToRow (5) + : : : : : : : : : +- Scan parquet default.inventory (4) + : : : : : : : : +- BroadcastExchange (13) + : : : : : : : : +- * Filter (12) + : : : : : : : : +- * ColumnarToRow (11) + : : : : : : : : +- Scan parquet default.warehouse (10) + : : : : : : : +- BroadcastExchange (19) + : : : : : : : +- * Filter (18) + : : : : : : : +- * ColumnarToRow (17) + : : : : : : : +- Scan parquet default.item (16) + : : : : : : +- BroadcastExchange (26) + : : : : : : +- * Project (25) + : : : : : : +- * Filter (24) + : : : : : : +- * ColumnarToRow (23) + : : : : : : +- Scan parquet default.customer_demographics (22) + : : : : : +- BroadcastExchange (33) + : : : : : +- * Project (32) + : : : : : +- * Filter (31) + : : : : : +- * ColumnarToRow (30) + : : : : : +- Scan parquet default.household_demographics (29) + : : : : +- BroadcastExchange (40) + : : : : +- * Project (39) + : : : : +- * Filter (38) + : : : : +- * ColumnarToRow (37) + : : : : +- Scan parquet default.date_dim (36) + : : : +- BroadcastExchange (46) + : : : +- * Filter (45) + : : : +- * ColumnarToRow (44) + : : : +- Scan parquet default.date_dim (43) + : : +- BroadcastExchange (52) + : : +- * Filter (51) + : : +- * ColumnarToRow (50) + : : +- Scan parquet default.date_dim (49) + : +- BroadcastExchange (58) + : +- * Filter (57) + : +- * ColumnarToRow (56) + : +- Scan parquet default.promotion (55) + +- * Sort (68) + +- Exchange (67) + +- * Project (66) + +- * Filter (65) + +- * ColumnarToRow (64) + +- Scan parquet default.catalog_returns (63) + + +(1) Scan parquet default.catalog_sales +Output [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#8), dynamicpruningexpression(cs_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(cs_quantity), IsNotNull(cs_item_sk), IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_hdemo_sk), IsNotNull(cs_ship_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 10] +Input [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] + +(3) Filter [codegen id : 10] +Input [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] +Condition : ((((isnotnull(cs_quantity#7) AND isnotnull(cs_item_sk#4)) AND isnotnull(cs_bill_cdemo_sk#2)) AND isnotnull(cs_bill_hdemo_sk#3)) AND isnotnull(cs_ship_date_sk#1)) + +(4) Scan parquet default.inventory +Output [4]: [inv_item_sk#10, inv_warehouse_sk#11, inv_quantity_on_hand#12, inv_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#13)] +PushedFilters: [IsNotNull(inv_quantity_on_hand), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [inv_item_sk#10, inv_warehouse_sk#11, inv_quantity_on_hand#12, inv_date_sk#13] + +(6) Filter [codegen id : 1] +Input [4]: [inv_item_sk#10, inv_warehouse_sk#11, inv_quantity_on_hand#12, inv_date_sk#13] +Condition : ((isnotnull(inv_quantity_on_hand#12) AND isnotnull(inv_item_sk#10)) AND isnotnull(inv_warehouse_sk#11)) + +(7) BroadcastExchange +Input [4]: [inv_item_sk#10, inv_warehouse_sk#11, inv_quantity_on_hand#12, inv_date_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(8) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_item_sk#4] +Right keys [1]: [inv_item_sk#10] +Join condition: (inv_quantity_on_hand#12 < cs_quantity#7) + +(9) Project [codegen id : 10] +Output [9]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_warehouse_sk#11, inv_date_sk#13] +Input [12]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, inv_item_sk#10, inv_warehouse_sk#11, inv_quantity_on_hand#12, inv_date_sk#13] + +(10) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#15, w_warehouse_name#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] + +(12) Filter [codegen id : 2] +Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] +Condition : isnotnull(w_warehouse_sk#15) + +(13) BroadcastExchange +Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(14) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [inv_warehouse_sk#11] +Right keys [1]: [w_warehouse_sk#15] +Join condition: None + +(15) Project [codegen id : 10] +Output [9]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16] +Input [11]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_warehouse_sk#11, inv_date_sk#13, w_warehouse_sk#15, w_warehouse_name#16] + +(16) Scan parquet default.item +Output [2]: [i_item_sk#18, i_item_desc#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_sk#18, i_item_desc#19] + +(18) Filter [codegen id : 3] +Input [2]: [i_item_sk#18, i_item_desc#19] +Condition : isnotnull(i_item_sk#18) + +(19) BroadcastExchange +Input [2]: [i_item_sk#18, i_item_desc#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(20) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_item_sk#4] +Right keys [1]: [i_item_sk#18] +Join condition: None + +(21) Project [codegen id : 10] +Output [10]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19] +Input [11]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_sk#18, i_item_desc#19] + +(22) Scan parquet default.customer_demographics +Output [2]: [cd_demo_sk#21, cd_marital_status#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_marital_status), EqualTo(cd_marital_status,D), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 4] +Input [2]: [cd_demo_sk#21, cd_marital_status#22] + +(24) Filter [codegen id : 4] +Input [2]: [cd_demo_sk#21, cd_marital_status#22] +Condition : ((isnotnull(cd_marital_status#22) AND (cd_marital_status#22 = D)) AND isnotnull(cd_demo_sk#21)) + +(25) Project [codegen id : 4] +Output [1]: [cd_demo_sk#21] +Input [2]: [cd_demo_sk#21, cd_marital_status#22] + +(26) BroadcastExchange +Input [1]: [cd_demo_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] + +(27) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_bill_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#21] +Join condition: None + +(28) Project [codegen id : 10] +Output [9]: [cs_ship_date_sk#1, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19] +Input [11]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19, cd_demo_sk#21] + +(29) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#24, hd_buy_potential#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_buy_potential), EqualTo(hd_buy_potential,>10000 ), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [2]: [hd_demo_sk#24, hd_buy_potential#25] + +(31) Filter [codegen id : 5] +Input [2]: [hd_demo_sk#24, hd_buy_potential#25] +Condition : ((isnotnull(hd_buy_potential#25) AND (hd_buy_potential#25 = >10000 )) AND isnotnull(hd_demo_sk#24)) + +(32) Project [codegen id : 5] +Output [1]: [hd_demo_sk#24] +Input [2]: [hd_demo_sk#24, hd_buy_potential#25] + +(33) BroadcastExchange +Input [1]: [hd_demo_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] + +(34) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_bill_hdemo_sk#3] +Right keys [1]: [hd_demo_sk#24] +Join condition: None + +(35) Project [codegen id : 10] +Output [8]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19] +Input [10]: [cs_ship_date_sk#1, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19, hd_demo_sk#24] + +(36) Scan parquet default.date_dim +Output [4]: [d_date_sk#27, d_date#28, d_week_seq#29, d_year#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1999), IsNotNull(d_date_sk), IsNotNull(d_week_seq), IsNotNull(d_date)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 6] +Input [4]: [d_date_sk#27, d_date#28, d_week_seq#29, d_year#30] + +(38) Filter [codegen id : 6] +Input [4]: [d_date_sk#27, d_date#28, d_week_seq#29, d_year#30] +Condition : ((((isnotnull(d_year#30) AND (d_year#30 = 1999)) AND isnotnull(d_date_sk#27)) AND isnotnull(d_week_seq#29)) AND isnotnull(d_date#28)) + +(39) Project [codegen id : 6] +Output [3]: [d_date_sk#27, d_date#28, d_week_seq#29] +Input [4]: [d_date_sk#27, d_date#28, d_week_seq#29, d_year#30] + +(40) BroadcastExchange +Input [3]: [d_date_sk#27, d_date#28, d_week_seq#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#31] + +(41) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#8] +Right keys [1]: [d_date_sk#27] +Join condition: None + +(42) Project [codegen id : 10] +Output [9]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19, d_date#28, d_week_seq#29] +Input [11]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19, d_date_sk#27, d_date#28, d_week_seq#29] + +(43) Scan parquet default.date_dim +Output [2]: [d_date_sk#32, d_week_seq#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(44) ColumnarToRow [codegen id : 7] +Input [2]: [d_date_sk#32, d_week_seq#33] + +(45) Filter [codegen id : 7] +Input [2]: [d_date_sk#32, d_week_seq#33] +Condition : (isnotnull(d_week_seq#33) AND isnotnull(d_date_sk#32)) + +(46) BroadcastExchange +Input [2]: [d_date_sk#32, d_week_seq#33] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, false] as bigint), 32) | (cast(input[0, int, false] as bigint) & 4294967295))),false), [id=#34] + +(47) BroadcastHashJoin [codegen id : 10] +Left keys [2]: [d_week_seq#29, inv_date_sk#13] +Right keys [2]: [d_week_seq#33, d_date_sk#32] +Join condition: None + +(48) Project [codegen id : 10] +Output [8]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_date#28, d_week_seq#29] +Input [11]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19, d_date#28, d_week_seq#29, d_date_sk#32, d_week_seq#33] + +(49) Scan parquet default.date_dim +Output [2]: [d_date_sk#35, d_date#36] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), IsNotNull(d_date_sk)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 8] +Input [2]: [d_date_sk#35, d_date#36] + +(51) Filter [codegen id : 8] +Input [2]: [d_date_sk#35, d_date#36] +Condition : (isnotnull(d_date#36) AND isnotnull(d_date_sk#35)) + +(52) BroadcastExchange +Input [2]: [d_date_sk#35, d_date#36] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#37] + +(53) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_ship_date_sk#1] +Right keys [1]: [d_date_sk#35] +Join condition: (d_date#36 > d_date#28 + 5 days) + +(54) Project [codegen id : 10] +Output [6]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_week_seq#29] +Input [10]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_date#28, d_week_seq#29, d_date_sk#35, d_date#36] + +(55) Scan parquet default.promotion +Output [1]: [p_promo_sk#38] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_promo_sk)] +ReadSchema: struct + +(56) ColumnarToRow [codegen id : 9] +Input [1]: [p_promo_sk#38] + +(57) Filter [codegen id : 9] +Input [1]: [p_promo_sk#38] +Condition : isnotnull(p_promo_sk#38) + +(58) BroadcastExchange +Input [1]: [p_promo_sk#38] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#39] + +(59) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_promo_sk#5] +Right keys [1]: [p_promo_sk#38] +Join condition: None + +(60) Project [codegen id : 10] +Output [5]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_week_seq#29] +Input [7]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_week_seq#29, p_promo_sk#38] + +(61) Exchange +Input [5]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_week_seq#29] +Arguments: hashpartitioning(cs_item_sk#4, cs_order_number#6, 5), ENSURE_REQUIREMENTS, [id=#40] + +(62) Sort [codegen id : 11] +Input [5]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_week_seq#29] +Arguments: [cs_item_sk#4 ASC NULLS FIRST, cs_order_number#6 ASC NULLS FIRST], false, 0 + +(63) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#41, cr_order_number#42, cr_returned_date_sk#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_order_number)] +ReadSchema: struct + +(64) ColumnarToRow [codegen id : 12] +Input [3]: [cr_item_sk#41, cr_order_number#42, cr_returned_date_sk#43] + +(65) Filter [codegen id : 12] +Input [3]: [cr_item_sk#41, cr_order_number#42, cr_returned_date_sk#43] +Condition : (isnotnull(cr_item_sk#41) AND isnotnull(cr_order_number#42)) + +(66) Project [codegen id : 12] +Output [2]: [cr_item_sk#41, cr_order_number#42] +Input [3]: [cr_item_sk#41, cr_order_number#42, cr_returned_date_sk#43] + +(67) Exchange +Input [2]: [cr_item_sk#41, cr_order_number#42] +Arguments: hashpartitioning(cr_item_sk#41, cr_order_number#42, 5), ENSURE_REQUIREMENTS, [id=#44] + +(68) Sort [codegen id : 13] +Input [2]: [cr_item_sk#41, cr_order_number#42] +Arguments: [cr_item_sk#41 ASC NULLS FIRST, cr_order_number#42 ASC NULLS FIRST], false, 0 + +(69) SortMergeJoin [codegen id : 14] +Left keys [2]: [cs_item_sk#4, cs_order_number#6] +Right keys [2]: [cr_item_sk#41, cr_order_number#42] +Join condition: None + +(70) Project [codegen id : 14] +Output [3]: [w_warehouse_name#16, i_item_desc#19, d_week_seq#29] +Input [7]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_week_seq#29, cr_item_sk#41, cr_order_number#42] + +(71) HashAggregate [codegen id : 14] +Input [3]: [w_warehouse_name#16, i_item_desc#19, d_week_seq#29] +Keys [3]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#45] +Results [4]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29, count#46] + +(72) Exchange +Input [4]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29, count#46] +Arguments: hashpartitioning(i_item_desc#19, w_warehouse_name#16, d_week_seq#29, 5), ENSURE_REQUIREMENTS, [id=#47] + +(73) HashAggregate [codegen id : 15] +Input [4]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29, count#46] +Keys [3]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#48] +Results [6]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29, count(1)#48 AS no_promo#49, count(1)#48 AS promo#50, count(1)#48 AS total_cnt#51] + +(74) TakeOrderedAndProject +Input [6]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29, no_promo#49, promo#50, total_cnt#51] +Arguments: 100, [total_cnt#51 DESC NULLS LAST, i_item_desc#19 ASC NULLS FIRST, w_warehouse_name#16 ASC NULLS FIRST, d_week_seq#29 ASC NULLS FIRST], [i_item_desc#19, w_warehouse_name#16, d_week_seq#29, no_promo#49, promo#50, total_cnt#51] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (75) + + +(75) ReusedExchange [Reuses operator id: 40] +Output [3]: [d_date_sk#27, d_date#28, d_week_seq#29] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72/simplified.txt new file mode 100644 index 0000000000000..92800d31b82f1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q72/simplified.txt @@ -0,0 +1,116 @@ +TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_promo,promo] + WholeStageCodegen (15) + HashAggregate [i_item_desc,w_warehouse_name,d_week_seq,count] [count(1),no_promo,promo,total_cnt,count] + InputAdapter + Exchange [i_item_desc,w_warehouse_name,d_week_seq] #1 + WholeStageCodegen (14) + HashAggregate [i_item_desc,w_warehouse_name,d_week_seq] [count,count] + Project [w_warehouse_name,i_item_desc,d_week_seq] + SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] + InputAdapter + WholeStageCodegen (11) + Sort [cs_item_sk,cs_order_number] + InputAdapter + Exchange [cs_item_sk,cs_order_number] #2 + WholeStageCodegen (10) + Project [cs_item_sk,cs_order_number,w_warehouse_name,i_item_desc,d_week_seq] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_item_sk,cs_promo_sk,cs_order_number,w_warehouse_name,i_item_desc,d_week_seq] + BroadcastHashJoin [cs_ship_date_sk,d_date_sk,d_date,d_date] + Project [cs_ship_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,w_warehouse_name,i_item_desc,d_date,d_week_seq] + BroadcastHashJoin [d_week_seq,inv_date_sk,d_week_seq,d_date_sk] + Project [cs_ship_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,inv_date_sk,w_warehouse_name,i_item_desc,d_date,d_week_seq] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_ship_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_sold_date_sk,inv_date_sk,w_warehouse_name,i_item_desc] + BroadcastHashJoin [cs_bill_hdemo_sk,hd_demo_sk] + Project [cs_ship_date_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_sold_date_sk,inv_date_sk,w_warehouse_name,i_item_desc] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Project [cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_sold_date_sk,inv_date_sk,w_warehouse_name,i_item_desc] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_sold_date_sk,inv_date_sk,w_warehouse_name] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_sold_date_sk,inv_warehouse_sk,inv_date_sk] + BroadcastHashJoin [cs_item_sk,inv_item_sk,inv_quantity_on_hand,cs_quantity] + Filter [cs_quantity,cs_item_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_ship_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date,d_week_seq] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [inv_quantity_on_hand,inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_desc] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (4) + Project [cd_demo_sk] + Filter [cd_marital_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (5) + Project [hd_demo_sk] + Filter [hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (6) + Project [d_date_sk,d_date,d_week_seq] + Filter [d_year,d_date_sk,d_week_seq,d_date] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_week_seq,d_year] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (7) + Filter [d_week_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (8) + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (9) + Filter [p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk] + InputAdapter + WholeStageCodegen (13) + Sort [cr_item_sk,cr_order_number] + InputAdapter + Exchange [cr_item_sk,cr_order_number] #12 + WholeStageCodegen (12) + Project [cr_item_sk,cr_order_number] + Filter [cr_item_sk,cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_returned_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/explain.txt new file mode 100644 index 0000000000000..aec6d66c98fdd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/explain.txt @@ -0,0 +1,229 @@ +== Physical Plan == +* Sort (39) ++- Exchange (38) + +- * Project (37) + +- * SortMergeJoin Inner (36) + :- * Sort (30) + : +- Exchange (29) + : +- * Filter (28) + : +- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.household_demographics (18) + +- * Sort (35) + +- Exchange (34) + +- * Filter (33) + +- * ColumnarToRow (32) + +- Scan parquet default.customer (31) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Condition : ((isnotnull(ss_store_sk#3) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_dom#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] +Condition : ((((isnotnull(d_dom#9) AND (d_dom#9 >= 1)) AND (d_dom#9 <= 2)) AND d_year#8 IN (1999,2000,2001)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4] +Input [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#11, s_county#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_county, [Williamson County,Franklin Parish,Bronx County,Orange County]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] +Condition : (s_county#12 IN (Williamson County,Franklin Parish,Bronx County,Orange County) AND isnotnull(s_store_sk#11)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#11] +Input [2]: [s_store_sk#11, s_county#12] + +(15) BroadcastExchange +Input [1]: [s_store_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#11] +Join condition: None + +(17) Project [codegen id : 4] +Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#11] + +(18) Scan parquet default.household_demographics +Output [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000 ),EqualTo(hd_buy_potential,unknown )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(20) Filter [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Condition : (((((isnotnull(hd_vehicle_count#17) AND isnotnull(hd_dep_count#16)) AND ((hd_buy_potential#15 = >10000 ) OR (hd_buy_potential#15 = unknown ))) AND (hd_vehicle_count#17 > 0)) AND ((cast(hd_dep_count#16 as double) / cast(hd_vehicle_count#17 as double)) > 1.0)) AND isnotnull(hd_demo_sk#14)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#14] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#14] +Join condition: None + +(24) Project [codegen id : 4] +Output [2]: [ss_customer_sk#1, ss_ticket_number#4] +Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#14] + +(25) HashAggregate [codegen id : 4] +Input [2]: [ss_customer_sk#1, ss_ticket_number#4] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#19] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] + +(26) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) HashAggregate [codegen id : 5] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#22] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#22 AS cnt#23] + +(28) Filter [codegen id : 5] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Condition : ((cnt#23 >= 1) AND (cnt#23 <= 5)) + +(29) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#24] + +(30) Sort [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(31) Scan parquet default.customer +Output [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 7] +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] + +(33) Filter [codegen id : 7] +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Condition : isnotnull(c_customer_sk#25) + +(34) Exchange +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Arguments: hashpartitioning(c_customer_sk#25, 5), ENSURE_REQUIREMENTS, [id=#30] + +(35) Sort [codegen id : 8] +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Arguments: [c_customer_sk#25 ASC NULLS FIRST], false, 0 + +(36) SortMergeJoin [codegen id : 9] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#25] +Join condition: None + +(37) Project [codegen id : 9] +Output [6]: [c_last_name#28, c_first_name#27, c_salutation#26, c_preferred_cust_flag#29, ss_ticket_number#4, cnt#23] +Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23, c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] + +(38) Exchange +Input [6]: [c_last_name#28, c_first_name#27, c_salutation#26, c_preferred_cust_flag#29, ss_ticket_number#4, cnt#23] +Arguments: rangepartitioning(cnt#23 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#31] + +(39) Sort [codegen id : 10] +Input [6]: [c_last_name#28, c_first_name#27, c_salutation#26, c_preferred_cust_flag#29, ss_ticket_number#4, cnt#23] +Arguments: [cnt#23 DESC NULLS LAST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (40) + + +(40) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/simplified.txt new file mode 100644 index 0000000000000..5884cd70c28fc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73.sf100/simplified.txt @@ -0,0 +1,65 @@ +WholeStageCodegen (10) + Sort [cnt] + InputAdapter + Exchange [cnt] #1 + WholeStageCodegen (9) + Project [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number,cnt] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #2 + WholeStageCodegen (5) + Filter [cnt] + HashAggregate [ss_ticket_number,ss_customer_sk,count] [count(1),cnt,count] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk] #3 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk] [count,count] + Project [ss_customer_sk,ss_ticket_number] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_county,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_vehicle_count,hd_dep_count,hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential,hd_dep_count,hd_vehicle_count] + InputAdapter + WholeStageCodegen (8) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #7 + WholeStageCodegen (7) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73/explain.txt new file mode 100644 index 0000000000000..646a8fbc11a3a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73/explain.txt @@ -0,0 +1,214 @@ +== Physical Plan == +* Sort (36) ++- Exchange (35) + +- * Project (34) + +- * BroadcastHashJoin Inner BuildRight (33) + :- * Filter (28) + : +- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.household_demographics (18) + +- BroadcastExchange (32) + +- * Filter (31) + +- * ColumnarToRow (30) + +- Scan parquet default.customer (29) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Condition : ((isnotnull(ss_store_sk#3) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_dom#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dom), GreaterThanOrEqual(d_dom,1), LessThanOrEqual(d_dom,2), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] +Condition : ((((isnotnull(d_dom#9) AND (d_dom#9 >= 1)) AND (d_dom#9 <= 2)) AND d_year#8 IN (1999,2000,2001)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4] +Input [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#11, s_county#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [In(s_county, [Williamson County,Franklin Parish,Bronx County,Orange County]), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] +Condition : (s_county#12 IN (Williamson County,Franklin Parish,Bronx County,Orange County) AND isnotnull(s_store_sk#11)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#11] +Input [2]: [s_store_sk#11, s_county#12] + +(15) BroadcastExchange +Input [1]: [s_store_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#11] +Join condition: None + +(17) Project [codegen id : 4] +Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#11] + +(18) Scan parquet default.household_demographics +Output [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000 ),EqualTo(hd_buy_potential,unknown )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(20) Filter [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Condition : (((((isnotnull(hd_vehicle_count#17) AND isnotnull(hd_dep_count#16)) AND ((hd_buy_potential#15 = >10000 ) OR (hd_buy_potential#15 = unknown ))) AND (hd_vehicle_count#17 > 0)) AND ((cast(hd_dep_count#16 as double) / cast(hd_vehicle_count#17 as double)) > 1.0)) AND isnotnull(hd_demo_sk#14)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#14] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#14] +Join condition: None + +(24) Project [codegen id : 4] +Output [2]: [ss_customer_sk#1, ss_ticket_number#4] +Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#14] + +(25) HashAggregate [codegen id : 4] +Input [2]: [ss_customer_sk#1, ss_ticket_number#4] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#19] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] + +(26) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) HashAggregate [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#22] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#22 AS cnt#23] + +(28) Filter [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Condition : ((cnt#23 >= 1) AND (cnt#23 <= 5)) + +(29) Scan parquet default.customer +Output [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] + +(31) Filter [codegen id : 5] +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Condition : isnotnull(c_customer_sk#24) + +(32) BroadcastExchange +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#24] +Join condition: None + +(34) Project [codegen id : 6] +Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] + +(35) Exchange +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Arguments: rangepartitioning(cnt#23 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#30] + +(36) Sort [codegen id : 7] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Arguments: [cnt#23 DESC NULLS LAST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (37) + + +(37) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73/simplified.txt new file mode 100644 index 0000000000000..5bb7daa2bda9c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q73/simplified.txt @@ -0,0 +1,56 @@ +WholeStageCodegen (7) + Sort [cnt] + InputAdapter + Exchange [cnt] #1 + WholeStageCodegen (6) + Project [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number,cnt] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Filter [cnt] + HashAggregate [ss_ticket_number,ss_customer_sk,count] [count(1),cnt,count] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk] #2 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk] [count,count] + Project [ss_customer_sk,ss_ticket_number] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_county,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_vehicle_count,hd_dep_count,hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/explain.txt new file mode 100644 index 0000000000000..9b2ead7ea96f7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/explain.txt @@ -0,0 +1,502 @@ +== Physical Plan == +TakeOrderedAndProject (86) ++- * Project (85) + +- * SortMergeJoin Inner (84) + :- * Project (66) + : +- * SortMergeJoin Inner (65) + : :- * SortMergeJoin Inner (45) + : : :- * Sort (24) + : : : +- Exchange (23) + : : : +- * Filter (22) + : : : +- * HashAggregate (21) + : : : +- Exchange (20) + : : : +- * HashAggregate (19) + : : : +- * Project (18) + : : : +- * SortMergeJoin Inner (17) + : : : :- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- * Sort (16) + : : : +- Exchange (15) + : : : +- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.customer (12) + : : +- * Sort (44) + : : +- Exchange (43) + : : +- * HashAggregate (42) + : : +- Exchange (41) + : : +- * HashAggregate (40) + : : +- * Project (39) + : : +- * SortMergeJoin Inner (38) + : : :- * Sort (35) + : : : +- Exchange (34) + : : : +- * Project (33) + : : : +- * BroadcastHashJoin Inner BuildRight (32) + : : : :- * Filter (27) + : : : : +- * ColumnarToRow (26) + : : : : +- Scan parquet default.store_sales (25) + : : : +- BroadcastExchange (31) + : : : +- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.date_dim (28) + : : +- * Sort (37) + : : +- ReusedExchange (36) + : +- * Sort (64) + : +- Exchange (63) + : +- * Project (62) + : +- * Filter (61) + : +- * HashAggregate (60) + : +- Exchange (59) + : +- * HashAggregate (58) + : +- * Project (57) + : +- * SortMergeJoin Inner (56) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Project (51) + : : +- * BroadcastHashJoin Inner BuildRight (50) + : : :- * Filter (48) + : : : +- * ColumnarToRow (47) + : : : +- Scan parquet default.web_sales (46) + : : +- ReusedExchange (49) + : +- * Sort (55) + : +- ReusedExchange (54) + +- * Sort (83) + +- Exchange (82) + +- * HashAggregate (81) + +- Exchange (80) + +- * HashAggregate (79) + +- * Project (78) + +- * SortMergeJoin Inner (77) + :- * Sort (74) + : +- Exchange (73) + : +- * Project (72) + : +- * BroadcastHashJoin Inner BuildRight (71) + : :- * Filter (69) + : : +- * ColumnarToRow (68) + : : +- Scan parquet default.web_sales (67) + : +- ReusedExchange (70) + +- * Sort (76) + +- ReusedExchange (75) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_customer_sk#1, ss_net_paid#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_customer_sk#1, ss_net_paid#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [ss_customer_sk#1, ss_net_paid#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_customer_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_year#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_year#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_year#6] +Condition : (((isnotnull(d_year#6) AND (d_year#6 = 2001)) AND d_year#6 IN (2001,2002)) AND isnotnull(d_date_sk#5)) + +(7) BroadcastExchange +Input [2]: [d_date_sk#5, d_year#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(9) Project [codegen id : 2] +Output [3]: [ss_customer_sk#1, ss_net_paid#2, d_year#6] +Input [5]: [ss_customer_sk#1, ss_net_paid#2, ss_sold_date_sk#3, d_date_sk#5, d_year#6] + +(10) Exchange +Input [3]: [ss_customer_sk#1, ss_net_paid#2, d_year#6] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#8] + +(11) Sort [codegen id : 3] +Input [3]: [ss_customer_sk#1, ss_net_paid#2, d_year#6] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(12) Scan parquet default.customer +Output [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 4] +Input [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12] + +(14) Filter [codegen id : 4] +Input [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12] +Condition : (isnotnull(c_customer_sk#9) AND isnotnull(c_customer_id#10)) + +(15) Exchange +Input [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12] +Arguments: hashpartitioning(c_customer_sk#9, 5), ENSURE_REQUIREMENTS, [id=#13] + +(16) Sort [codegen id : 5] +Input [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12] +Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 + +(17) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#9] +Join condition: None + +(18) Project [codegen id : 6] +Output [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, ss_net_paid#2, d_year#6] +Input [7]: [ss_customer_sk#1, ss_net_paid#2, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12] + +(19) HashAggregate [codegen id : 6] +Input [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, ss_net_paid#2, d_year#6] +Keys [4]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#2))] +Aggregate Attributes [1]: [sum#14] +Results [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, sum#15] + +(20) Exchange +Input [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, sum#15] +Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, 5), ENSURE_REQUIREMENTS, [id=#16] + +(21) HashAggregate [codegen id : 7] +Input [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, sum#15] +Keys [4]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6] +Functions [1]: [sum(UnscaledValue(ss_net_paid#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#2))#17] +Results [2]: [c_customer_id#10 AS customer_id#18, MakeDecimal(sum(UnscaledValue(ss_net_paid#2))#17,17,2) AS year_total#19] + +(22) Filter [codegen id : 7] +Input [2]: [customer_id#18, year_total#19] +Condition : (isnotnull(year_total#19) AND (year_total#19 > 0.00)) + +(23) Exchange +Input [2]: [customer_id#18, year_total#19] +Arguments: hashpartitioning(customer_id#18, 5), ENSURE_REQUIREMENTS, [id=#20] + +(24) Sort [codegen id : 8] +Input [2]: [customer_id#18, year_total#19] +Arguments: [customer_id#18 ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.store_sales +Output [3]: [ss_customer_sk#21, ss_net_paid#22, ss_sold_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#23), dynamicpruningexpression(ss_sold_date_sk#23 IN dynamicpruning#24)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 10] +Input [3]: [ss_customer_sk#21, ss_net_paid#22, ss_sold_date_sk#23] + +(27) Filter [codegen id : 10] +Input [3]: [ss_customer_sk#21, ss_net_paid#22, ss_sold_date_sk#23] +Condition : isnotnull(ss_customer_sk#21) + +(28) Scan parquet default.date_dim +Output [2]: [d_date_sk#25, d_year#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#25, d_year#26] + +(30) Filter [codegen id : 9] +Input [2]: [d_date_sk#25, d_year#26] +Condition : (((isnotnull(d_year#26) AND (d_year#26 = 2002)) AND d_year#26 IN (2001,2002)) AND isnotnull(d_date_sk#25)) + +(31) BroadcastExchange +Input [2]: [d_date_sk#25, d_year#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(32) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#23] +Right keys [1]: [d_date_sk#25] +Join condition: None + +(33) Project [codegen id : 10] +Output [3]: [ss_customer_sk#21, ss_net_paid#22, d_year#26] +Input [5]: [ss_customer_sk#21, ss_net_paid#22, ss_sold_date_sk#23, d_date_sk#25, d_year#26] + +(34) Exchange +Input [3]: [ss_customer_sk#21, ss_net_paid#22, d_year#26] +Arguments: hashpartitioning(ss_customer_sk#21, 5), ENSURE_REQUIREMENTS, [id=#28] + +(35) Sort [codegen id : 11] +Input [3]: [ss_customer_sk#21, ss_net_paid#22, d_year#26] +Arguments: [ss_customer_sk#21 ASC NULLS FIRST], false, 0 + +(36) ReusedExchange [Reuses operator id: 15] +Output [4]: [c_customer_sk#29, c_customer_id#30, c_first_name#31, c_last_name#32] + +(37) Sort [codegen id : 13] +Input [4]: [c_customer_sk#29, c_customer_id#30, c_first_name#31, c_last_name#32] +Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 + +(38) SortMergeJoin [codegen id : 14] +Left keys [1]: [ss_customer_sk#21] +Right keys [1]: [c_customer_sk#29] +Join condition: None + +(39) Project [codegen id : 14] +Output [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, ss_net_paid#22, d_year#26] +Input [7]: [ss_customer_sk#21, ss_net_paid#22, d_year#26, c_customer_sk#29, c_customer_id#30, c_first_name#31, c_last_name#32] + +(40) HashAggregate [codegen id : 14] +Input [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, ss_net_paid#22, d_year#26] +Keys [4]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#22))] +Aggregate Attributes [1]: [sum#33] +Results [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26, sum#34] + +(41) Exchange +Input [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26, sum#34] +Arguments: hashpartitioning(c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26, 5), ENSURE_REQUIREMENTS, [id=#35] + +(42) HashAggregate [codegen id : 15] +Input [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26, sum#34] +Keys [4]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26] +Functions [1]: [sum(UnscaledValue(ss_net_paid#22))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#22))#36] +Results [4]: [c_customer_id#30 AS customer_id#37, c_first_name#31 AS customer_first_name#38, c_last_name#32 AS customer_last_name#39, MakeDecimal(sum(UnscaledValue(ss_net_paid#22))#36,17,2) AS year_total#40] + +(43) Exchange +Input [4]: [customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40] +Arguments: hashpartitioning(customer_id#37, 5), ENSURE_REQUIREMENTS, [id=#41] + +(44) Sort [codegen id : 16] +Input [4]: [customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40] +Arguments: [customer_id#37 ASC NULLS FIRST], false, 0 + +(45) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#18] +Right keys [1]: [customer_id#37] +Join condition: None + +(46) Scan parquet default.web_sales +Output [3]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#44), dynamicpruningexpression(ws_sold_date_sk#44 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 19] +Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44] + +(48) Filter [codegen id : 19] +Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44] +Condition : isnotnull(ws_bill_customer_sk#42) + +(49) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#45, d_year#46] + +(50) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [ws_sold_date_sk#44] +Right keys [1]: [d_date_sk#45] +Join condition: None + +(51) Project [codegen id : 19] +Output [3]: [ws_bill_customer_sk#42, ws_net_paid#43, d_year#46] +Input [5]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44, d_date_sk#45, d_year#46] + +(52) Exchange +Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, d_year#46] +Arguments: hashpartitioning(ws_bill_customer_sk#42, 5), ENSURE_REQUIREMENTS, [id=#47] + +(53) Sort [codegen id : 20] +Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, d_year#46] +Arguments: [ws_bill_customer_sk#42 ASC NULLS FIRST], false, 0 + +(54) ReusedExchange [Reuses operator id: 15] +Output [4]: [c_customer_sk#48, c_customer_id#49, c_first_name#50, c_last_name#51] + +(55) Sort [codegen id : 22] +Input [4]: [c_customer_sk#48, c_customer_id#49, c_first_name#50, c_last_name#51] +Arguments: [c_customer_sk#48 ASC NULLS FIRST], false, 0 + +(56) SortMergeJoin [codegen id : 23] +Left keys [1]: [ws_bill_customer_sk#42] +Right keys [1]: [c_customer_sk#48] +Join condition: None + +(57) Project [codegen id : 23] +Output [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, ws_net_paid#43, d_year#46] +Input [7]: [ws_bill_customer_sk#42, ws_net_paid#43, d_year#46, c_customer_sk#48, c_customer_id#49, c_first_name#50, c_last_name#51] + +(58) HashAggregate [codegen id : 23] +Input [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, ws_net_paid#43, d_year#46] +Keys [4]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#43))] +Aggregate Attributes [1]: [sum#52] +Results [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46, sum#53] + +(59) Exchange +Input [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46, sum#53] +Arguments: hashpartitioning(c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46, 5), ENSURE_REQUIREMENTS, [id=#54] + +(60) HashAggregate [codegen id : 24] +Input [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46, sum#53] +Keys [4]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46] +Functions [1]: [sum(UnscaledValue(ws_net_paid#43))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#43))#55] +Results [2]: [c_customer_id#49 AS customer_id#56, MakeDecimal(sum(UnscaledValue(ws_net_paid#43))#55,17,2) AS year_total#57] + +(61) Filter [codegen id : 24] +Input [2]: [customer_id#56, year_total#57] +Condition : (isnotnull(year_total#57) AND (year_total#57 > 0.00)) + +(62) Project [codegen id : 24] +Output [2]: [customer_id#56 AS customer_id#58, year_total#57 AS year_total#59] +Input [2]: [customer_id#56, year_total#57] + +(63) Exchange +Input [2]: [customer_id#58, year_total#59] +Arguments: hashpartitioning(customer_id#58, 5), ENSURE_REQUIREMENTS, [id=#60] + +(64) Sort [codegen id : 25] +Input [2]: [customer_id#58, year_total#59] +Arguments: [customer_id#58 ASC NULLS FIRST], false, 0 + +(65) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#18] +Right keys [1]: [customer_id#58] +Join condition: None + +(66) Project [codegen id : 26] +Output [7]: [customer_id#18, year_total#19, customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40, year_total#59] +Input [8]: [customer_id#18, year_total#19, customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40, customer_id#58, year_total#59] + +(67) Scan parquet default.web_sales +Output [3]: [ws_bill_customer_sk#61, ws_net_paid#62, ws_sold_date_sk#63] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#63), dynamicpruningexpression(ws_sold_date_sk#63 IN dynamicpruning#24)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(68) ColumnarToRow [codegen id : 28] +Input [3]: [ws_bill_customer_sk#61, ws_net_paid#62, ws_sold_date_sk#63] + +(69) Filter [codegen id : 28] +Input [3]: [ws_bill_customer_sk#61, ws_net_paid#62, ws_sold_date_sk#63] +Condition : isnotnull(ws_bill_customer_sk#61) + +(70) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#64, d_year#65] + +(71) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#63] +Right keys [1]: [d_date_sk#64] +Join condition: None + +(72) Project [codegen id : 28] +Output [3]: [ws_bill_customer_sk#61, ws_net_paid#62, d_year#65] +Input [5]: [ws_bill_customer_sk#61, ws_net_paid#62, ws_sold_date_sk#63, d_date_sk#64, d_year#65] + +(73) Exchange +Input [3]: [ws_bill_customer_sk#61, ws_net_paid#62, d_year#65] +Arguments: hashpartitioning(ws_bill_customer_sk#61, 5), ENSURE_REQUIREMENTS, [id=#66] + +(74) Sort [codegen id : 29] +Input [3]: [ws_bill_customer_sk#61, ws_net_paid#62, d_year#65] +Arguments: [ws_bill_customer_sk#61 ASC NULLS FIRST], false, 0 + +(75) ReusedExchange [Reuses operator id: 15] +Output [4]: [c_customer_sk#67, c_customer_id#68, c_first_name#69, c_last_name#70] + +(76) Sort [codegen id : 31] +Input [4]: [c_customer_sk#67, c_customer_id#68, c_first_name#69, c_last_name#70] +Arguments: [c_customer_sk#67 ASC NULLS FIRST], false, 0 + +(77) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_customer_sk#61] +Right keys [1]: [c_customer_sk#67] +Join condition: None + +(78) Project [codegen id : 32] +Output [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, ws_net_paid#62, d_year#65] +Input [7]: [ws_bill_customer_sk#61, ws_net_paid#62, d_year#65, c_customer_sk#67, c_customer_id#68, c_first_name#69, c_last_name#70] + +(79) HashAggregate [codegen id : 32] +Input [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, ws_net_paid#62, d_year#65] +Keys [4]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#62))] +Aggregate Attributes [1]: [sum#71] +Results [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65, sum#72] + +(80) Exchange +Input [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65, sum#72] +Arguments: hashpartitioning(c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65, 5), ENSURE_REQUIREMENTS, [id=#73] + +(81) HashAggregate [codegen id : 33] +Input [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65, sum#72] +Keys [4]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65] +Functions [1]: [sum(UnscaledValue(ws_net_paid#62))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#62))#74] +Results [2]: [c_customer_id#68 AS customer_id#75, MakeDecimal(sum(UnscaledValue(ws_net_paid#62))#74,17,2) AS year_total#76] + +(82) Exchange +Input [2]: [customer_id#75, year_total#76] +Arguments: hashpartitioning(customer_id#75, 5), ENSURE_REQUIREMENTS, [id=#77] + +(83) Sort [codegen id : 34] +Input [2]: [customer_id#75, year_total#76] +Arguments: [customer_id#75 ASC NULLS FIRST], false, 0 + +(84) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#18] +Right keys [1]: [customer_id#75] +Join condition: (CASE WHEN (year_total#59 > 0.00) THEN CheckOverflow((promote_precision(year_total#76) / promote_precision(year_total#59)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#19 > 0.00) THEN CheckOverflow((promote_precision(year_total#40) / promote_precision(year_total#19)), DecimalType(37,20), true) ELSE null END) + +(85) Project [codegen id : 35] +Output [3]: [customer_id#37, customer_first_name#38, customer_last_name#39] +Input [9]: [customer_id#18, year_total#19, customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40, year_total#59, customer_id#75, year_total#76] + +(86) TakeOrderedAndProject +Input [3]: [customer_id#37, customer_first_name#38, customer_last_name#39] +Arguments: 100, [customer_id#37 ASC NULLS FIRST, customer_id#37 ASC NULLS FIRST, customer_id#37 ASC NULLS FIRST], [customer_id#37, customer_first_name#38, customer_last_name#39] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (87) + + +(87) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#5, d_year#6] + +Subquery:2 Hosting operator id = 25 Hosting Expression = ss_sold_date_sk#23 IN dynamicpruning#24 +ReusedExchange (88) + + +(88) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#25, d_year#26] + +Subquery:3 Hosting operator id = 46 Hosting Expression = ws_sold_date_sk#44 IN dynamicpruning#4 + +Subquery:4 Hosting operator id = 67 Hosting Expression = ws_sold_date_sk#63 IN dynamicpruning#24 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/simplified.txt new file mode 100644 index 0000000000000..4a047351e7cdd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74.sf100/simplified.txt @@ -0,0 +1,163 @@ +TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name] + WholeStageCodegen (35) + Project [customer_id,customer_first_name,customer_last_name] + SortMergeJoin [customer_id,customer_id,year_total,year_total,year_total,year_total] + InputAdapter + WholeStageCodegen (26) + Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,year_total,year_total] + SortMergeJoin [customer_id,customer_id] + InputAdapter + WholeStageCodegen (17) + SortMergeJoin [customer_id,customer_id] + InputAdapter + WholeStageCodegen (8) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #1 + WholeStageCodegen (7) + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #3 + WholeStageCodegen (2) + Project [ss_customer_sk,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_net_paid,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + WholeStageCodegen (16) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #6 + WholeStageCodegen (15) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,customer_first_name,customer_last_name,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #7 + WholeStageCodegen (14) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #8 + WholeStageCodegen (10) + Project [ss_customer_sk,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_net_paid,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (9) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (13) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name] #5 + InputAdapter + WholeStageCodegen (25) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #10 + WholeStageCodegen (24) + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ws_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #11 + WholeStageCodegen (23) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ws_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ws_net_paid,d_year] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (20) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #12 + WholeStageCodegen (19) + Project [ws_bill_customer_sk,ws_net_paid,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_net_paid,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 + InputAdapter + WholeStageCodegen (22) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name] #5 + InputAdapter + WholeStageCodegen (34) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #13 + WholeStageCodegen (33) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ws_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #14 + WholeStageCodegen (32) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ws_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ws_net_paid,d_year] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (29) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #15 + WholeStageCodegen (28) + Project [ws_bill_customer_sk,ws_net_paid,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_net_paid,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year] #9 + InputAdapter + WholeStageCodegen (31) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/explain.txt new file mode 100644 index 0000000000000..9fccc4c4ba66d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/explain.txt @@ -0,0 +1,471 @@ +== Physical Plan == +TakeOrderedAndProject (78) ++- * Project (77) + +- * BroadcastHashJoin Inner BuildRight (76) + :- * Project (59) + : +- * BroadcastHashJoin Inner BuildRight (58) + : :- * BroadcastHashJoin Inner BuildRight (39) + : : :- * Filter (19) + : : : +- * HashAggregate (18) + : : : +- Exchange (17) + : : : +- * HashAggregate (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (38) + : : +- * HashAggregate (37) + : : +- Exchange (36) + : : +- * HashAggregate (35) + : : +- * Project (34) + : : +- * BroadcastHashJoin Inner BuildRight (33) + : : :- * Project (28) + : : : +- * BroadcastHashJoin Inner BuildRight (27) + : : : :- * Filter (22) + : : : : +- * ColumnarToRow (21) + : : : : +- Scan parquet default.customer (20) + : : : +- BroadcastExchange (26) + : : : +- * Filter (25) + : : : +- * ColumnarToRow (24) + : : : +- Scan parquet default.store_sales (23) + : : +- BroadcastExchange (32) + : : +- * Filter (31) + : : +- * ColumnarToRow (30) + : : +- Scan parquet default.date_dim (29) + : +- BroadcastExchange (57) + : +- * Project (56) + : +- * Filter (55) + : +- * HashAggregate (54) + : +- Exchange (53) + : +- * HashAggregate (52) + : +- * Project (51) + : +- * BroadcastHashJoin Inner BuildRight (50) + : :- * Project (48) + : : +- * BroadcastHashJoin Inner BuildRight (47) + : : :- * Filter (42) + : : : +- * ColumnarToRow (41) + : : : +- Scan parquet default.customer (40) + : : +- BroadcastExchange (46) + : : +- * Filter (45) + : : +- * ColumnarToRow (44) + : : +- Scan parquet default.web_sales (43) + : +- ReusedExchange (49) + +- BroadcastExchange (75) + +- * HashAggregate (74) + +- Exchange (73) + +- * HashAggregate (72) + +- * Project (71) + +- * BroadcastHashJoin Inner BuildRight (70) + :- * Project (68) + : +- * BroadcastHashJoin Inner BuildRight (67) + : :- * Filter (62) + : : +- * ColumnarToRow (61) + : : +- Scan parquet default.customer (60) + : +- BroadcastExchange (66) + : +- * Filter (65) + : +- * ColumnarToRow (64) + : +- Scan parquet default.web_sales (63) + +- ReusedExchange (69) + + +(1) Scan parquet default.customer +Output [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] + +(3) Filter [codegen id : 3] +Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) + +(4) Scan parquet default.store_sales +Output [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7] + +(6) Filter [codegen id : 1] +Input [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7] +Condition : isnotnull(ss_customer_sk#5) + +(7) BroadcastExchange +Input [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#5] +Join condition: None + +(9) Project [codegen id : 3] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, ss_sold_date_sk#7] +Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#10, d_year#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#10, d_year#11] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#10, d_year#11] +Condition : (((isnotnull(d_year#11) AND (d_year#11 = 2001)) AND d_year#11 IN (2001,2002)) AND isnotnull(d_date_sk#10)) + +(13) BroadcastExchange +Input [2]: [d_date_sk#10, d_year#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(15) Project [codegen id : 3] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, d_year#11] +Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, ss_sold_date_sk#7, d_date_sk#10, d_year#11] + +(16) HashAggregate [codegen id : 3] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, d_year#11] +Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#11] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#6))] +Aggregate Attributes [1]: [sum#13] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#11, sum#14] + +(17) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#11, sum#14] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#11, 5), ENSURE_REQUIREMENTS, [id=#15] + +(18) HashAggregate [codegen id : 16] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#11, sum#14] +Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#11] +Functions [1]: [sum(UnscaledValue(ss_net_paid#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#6))#16] +Results [2]: [c_customer_id#2 AS customer_id#17, MakeDecimal(sum(UnscaledValue(ss_net_paid#6))#16,17,2) AS year_total#18] + +(19) Filter [codegen id : 16] +Input [2]: [customer_id#17, year_total#18] +Condition : (isnotnull(year_total#18) AND (year_total#18 > 0.00)) + +(20) Scan parquet default.customer +Output [4]: [c_customer_sk#19, c_customer_id#20, c_first_name#21, c_last_name#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [4]: [c_customer_sk#19, c_customer_id#20, c_first_name#21, c_last_name#22] + +(22) Filter [codegen id : 6] +Input [4]: [c_customer_sk#19, c_customer_id#20, c_first_name#21, c_last_name#22] +Condition : (isnotnull(c_customer_sk#19) AND isnotnull(c_customer_id#20)) + +(23) Scan parquet default.store_sales +Output [3]: [ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#25), dynamicpruningexpression(ss_sold_date_sk#25 IN dynamicpruning#26)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [3]: [ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25] + +(25) Filter [codegen id : 4] +Input [3]: [ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25] +Condition : isnotnull(ss_customer_sk#23) + +(26) BroadcastExchange +Input [3]: [ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [c_customer_sk#19] +Right keys [1]: [ss_customer_sk#23] +Join condition: None + +(28) Project [codegen id : 6] +Output [5]: [c_customer_id#20, c_first_name#21, c_last_name#22, ss_net_paid#24, ss_sold_date_sk#25] +Input [7]: [c_customer_sk#19, c_customer_id#20, c_first_name#21, c_last_name#22, ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25] + +(29) Scan parquet default.date_dim +Output [2]: [d_date_sk#28, d_year#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#28, d_year#29] + +(31) Filter [codegen id : 5] +Input [2]: [d_date_sk#28, d_year#29] +Condition : (((isnotnull(d_year#29) AND (d_year#29 = 2002)) AND d_year#29 IN (2001,2002)) AND isnotnull(d_date_sk#28)) + +(32) BroadcastExchange +Input [2]: [d_date_sk#28, d_year#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#30] + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#25] +Right keys [1]: [d_date_sk#28] +Join condition: None + +(34) Project [codegen id : 6] +Output [5]: [c_customer_id#20, c_first_name#21, c_last_name#22, ss_net_paid#24, d_year#29] +Input [7]: [c_customer_id#20, c_first_name#21, c_last_name#22, ss_net_paid#24, ss_sold_date_sk#25, d_date_sk#28, d_year#29] + +(35) HashAggregate [codegen id : 6] +Input [5]: [c_customer_id#20, c_first_name#21, c_last_name#22, ss_net_paid#24, d_year#29] +Keys [4]: [c_customer_id#20, c_first_name#21, c_last_name#22, d_year#29] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#24))] +Aggregate Attributes [1]: [sum#31] +Results [5]: [c_customer_id#20, c_first_name#21, c_last_name#22, d_year#29, sum#32] + +(36) Exchange +Input [5]: [c_customer_id#20, c_first_name#21, c_last_name#22, d_year#29, sum#32] +Arguments: hashpartitioning(c_customer_id#20, c_first_name#21, c_last_name#22, d_year#29, 5), ENSURE_REQUIREMENTS, [id=#33] + +(37) HashAggregate [codegen id : 7] +Input [5]: [c_customer_id#20, c_first_name#21, c_last_name#22, d_year#29, sum#32] +Keys [4]: [c_customer_id#20, c_first_name#21, c_last_name#22, d_year#29] +Functions [1]: [sum(UnscaledValue(ss_net_paid#24))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#24))#34] +Results [4]: [c_customer_id#20 AS customer_id#35, c_first_name#21 AS customer_first_name#36, c_last_name#22 AS customer_last_name#37, MakeDecimal(sum(UnscaledValue(ss_net_paid#24))#34,17,2) AS year_total#38] + +(38) BroadcastExchange +Input [4]: [customer_id#35, customer_first_name#36, customer_last_name#37, year_total#38] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#39] + +(39) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#17] +Right keys [1]: [customer_id#35] +Join condition: None + +(40) Scan parquet default.customer +Output [4]: [c_customer_sk#40, c_customer_id#41, c_first_name#42, c_last_name#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 10] +Input [4]: [c_customer_sk#40, c_customer_id#41, c_first_name#42, c_last_name#43] + +(42) Filter [codegen id : 10] +Input [4]: [c_customer_sk#40, c_customer_id#41, c_first_name#42, c_last_name#43] +Condition : (isnotnull(c_customer_sk#40) AND isnotnull(c_customer_id#41)) + +(43) Scan parquet default.web_sales +Output [3]: [ws_bill_customer_sk#44, ws_net_paid#45, ws_sold_date_sk#46] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#46), dynamicpruningexpression(ws_sold_date_sk#46 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(44) ColumnarToRow [codegen id : 8] +Input [3]: [ws_bill_customer_sk#44, ws_net_paid#45, ws_sold_date_sk#46] + +(45) Filter [codegen id : 8] +Input [3]: [ws_bill_customer_sk#44, ws_net_paid#45, ws_sold_date_sk#46] +Condition : isnotnull(ws_bill_customer_sk#44) + +(46) BroadcastExchange +Input [3]: [ws_bill_customer_sk#44, ws_net_paid#45, ws_sold_date_sk#46] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#47] + +(47) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [c_customer_sk#40] +Right keys [1]: [ws_bill_customer_sk#44] +Join condition: None + +(48) Project [codegen id : 10] +Output [5]: [c_customer_id#41, c_first_name#42, c_last_name#43, ws_net_paid#45, ws_sold_date_sk#46] +Input [7]: [c_customer_sk#40, c_customer_id#41, c_first_name#42, c_last_name#43, ws_bill_customer_sk#44, ws_net_paid#45, ws_sold_date_sk#46] + +(49) ReusedExchange [Reuses operator id: 13] +Output [2]: [d_date_sk#48, d_year#49] + +(50) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#46] +Right keys [1]: [d_date_sk#48] +Join condition: None + +(51) Project [codegen id : 10] +Output [5]: [c_customer_id#41, c_first_name#42, c_last_name#43, ws_net_paid#45, d_year#49] +Input [7]: [c_customer_id#41, c_first_name#42, c_last_name#43, ws_net_paid#45, ws_sold_date_sk#46, d_date_sk#48, d_year#49] + +(52) HashAggregate [codegen id : 10] +Input [5]: [c_customer_id#41, c_first_name#42, c_last_name#43, ws_net_paid#45, d_year#49] +Keys [4]: [c_customer_id#41, c_first_name#42, c_last_name#43, d_year#49] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#45))] +Aggregate Attributes [1]: [sum#50] +Results [5]: [c_customer_id#41, c_first_name#42, c_last_name#43, d_year#49, sum#51] + +(53) Exchange +Input [5]: [c_customer_id#41, c_first_name#42, c_last_name#43, d_year#49, sum#51] +Arguments: hashpartitioning(c_customer_id#41, c_first_name#42, c_last_name#43, d_year#49, 5), ENSURE_REQUIREMENTS, [id=#52] + +(54) HashAggregate [codegen id : 11] +Input [5]: [c_customer_id#41, c_first_name#42, c_last_name#43, d_year#49, sum#51] +Keys [4]: [c_customer_id#41, c_first_name#42, c_last_name#43, d_year#49] +Functions [1]: [sum(UnscaledValue(ws_net_paid#45))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#45))#53] +Results [2]: [c_customer_id#41 AS customer_id#54, MakeDecimal(sum(UnscaledValue(ws_net_paid#45))#53,17,2) AS year_total#55] + +(55) Filter [codegen id : 11] +Input [2]: [customer_id#54, year_total#55] +Condition : (isnotnull(year_total#55) AND (year_total#55 > 0.00)) + +(56) Project [codegen id : 11] +Output [2]: [customer_id#54 AS customer_id#56, year_total#55 AS year_total#57] +Input [2]: [customer_id#54, year_total#55] + +(57) BroadcastExchange +Input [2]: [customer_id#56, year_total#57] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#58] + +(58) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#17] +Right keys [1]: [customer_id#56] +Join condition: None + +(59) Project [codegen id : 16] +Output [7]: [customer_id#17, year_total#18, customer_id#35, customer_first_name#36, customer_last_name#37, year_total#38, year_total#57] +Input [8]: [customer_id#17, year_total#18, customer_id#35, customer_first_name#36, customer_last_name#37, year_total#38, customer_id#56, year_total#57] + +(60) Scan parquet default.customer +Output [4]: [c_customer_sk#59, c_customer_id#60, c_first_name#61, c_last_name#62] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(61) ColumnarToRow [codegen id : 14] +Input [4]: [c_customer_sk#59, c_customer_id#60, c_first_name#61, c_last_name#62] + +(62) Filter [codegen id : 14] +Input [4]: [c_customer_sk#59, c_customer_id#60, c_first_name#61, c_last_name#62] +Condition : (isnotnull(c_customer_sk#59) AND isnotnull(c_customer_id#60)) + +(63) Scan parquet default.web_sales +Output [3]: [ws_bill_customer_sk#63, ws_net_paid#64, ws_sold_date_sk#65] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#65), dynamicpruningexpression(ws_sold_date_sk#65 IN dynamicpruning#26)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(64) ColumnarToRow [codegen id : 12] +Input [3]: [ws_bill_customer_sk#63, ws_net_paid#64, ws_sold_date_sk#65] + +(65) Filter [codegen id : 12] +Input [3]: [ws_bill_customer_sk#63, ws_net_paid#64, ws_sold_date_sk#65] +Condition : isnotnull(ws_bill_customer_sk#63) + +(66) BroadcastExchange +Input [3]: [ws_bill_customer_sk#63, ws_net_paid#64, ws_sold_date_sk#65] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#66] + +(67) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [c_customer_sk#59] +Right keys [1]: [ws_bill_customer_sk#63] +Join condition: None + +(68) Project [codegen id : 14] +Output [5]: [c_customer_id#60, c_first_name#61, c_last_name#62, ws_net_paid#64, ws_sold_date_sk#65] +Input [7]: [c_customer_sk#59, c_customer_id#60, c_first_name#61, c_last_name#62, ws_bill_customer_sk#63, ws_net_paid#64, ws_sold_date_sk#65] + +(69) ReusedExchange [Reuses operator id: 32] +Output [2]: [d_date_sk#67, d_year#68] + +(70) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#65] +Right keys [1]: [d_date_sk#67] +Join condition: None + +(71) Project [codegen id : 14] +Output [5]: [c_customer_id#60, c_first_name#61, c_last_name#62, ws_net_paid#64, d_year#68] +Input [7]: [c_customer_id#60, c_first_name#61, c_last_name#62, ws_net_paid#64, ws_sold_date_sk#65, d_date_sk#67, d_year#68] + +(72) HashAggregate [codegen id : 14] +Input [5]: [c_customer_id#60, c_first_name#61, c_last_name#62, ws_net_paid#64, d_year#68] +Keys [4]: [c_customer_id#60, c_first_name#61, c_last_name#62, d_year#68] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#64))] +Aggregate Attributes [1]: [sum#69] +Results [5]: [c_customer_id#60, c_first_name#61, c_last_name#62, d_year#68, sum#70] + +(73) Exchange +Input [5]: [c_customer_id#60, c_first_name#61, c_last_name#62, d_year#68, sum#70] +Arguments: hashpartitioning(c_customer_id#60, c_first_name#61, c_last_name#62, d_year#68, 5), ENSURE_REQUIREMENTS, [id=#71] + +(74) HashAggregate [codegen id : 15] +Input [5]: [c_customer_id#60, c_first_name#61, c_last_name#62, d_year#68, sum#70] +Keys [4]: [c_customer_id#60, c_first_name#61, c_last_name#62, d_year#68] +Functions [1]: [sum(UnscaledValue(ws_net_paid#64))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#64))#72] +Results [2]: [c_customer_id#60 AS customer_id#73, MakeDecimal(sum(UnscaledValue(ws_net_paid#64))#72,17,2) AS year_total#74] + +(75) BroadcastExchange +Input [2]: [customer_id#73, year_total#74] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#75] + +(76) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#17] +Right keys [1]: [customer_id#73] +Join condition: (CASE WHEN (year_total#57 > 0.00) THEN CheckOverflow((promote_precision(year_total#74) / promote_precision(year_total#57)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#18 > 0.00) THEN CheckOverflow((promote_precision(year_total#38) / promote_precision(year_total#18)), DecimalType(37,20), true) ELSE null END) + +(77) Project [codegen id : 16] +Output [3]: [customer_id#35, customer_first_name#36, customer_last_name#37] +Input [9]: [customer_id#17, year_total#18, customer_id#35, customer_first_name#36, customer_last_name#37, year_total#38, year_total#57, customer_id#73, year_total#74] + +(78) TakeOrderedAndProject +Input [3]: [customer_id#35, customer_first_name#36, customer_last_name#37] +Arguments: 100, [customer_id#35 ASC NULLS FIRST, customer_id#35 ASC NULLS FIRST, customer_id#35 ASC NULLS FIRST], [customer_id#35, customer_first_name#36, customer_last_name#37] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (79) + + +(79) ReusedExchange [Reuses operator id: 13] +Output [2]: [d_date_sk#10, d_year#11] + +Subquery:2 Hosting operator id = 23 Hosting Expression = ss_sold_date_sk#25 IN dynamicpruning#26 +ReusedExchange (80) + + +(80) ReusedExchange [Reuses operator id: 32] +Output [2]: [d_date_sk#28, d_year#29] + +Subquery:3 Hosting operator id = 43 Hosting Expression = ws_sold_date_sk#46 IN dynamicpruning#8 + +Subquery:4 Hosting operator id = 63 Hosting Expression = ws_sold_date_sk#65 IN dynamicpruning#26 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/simplified.txt new file mode 100644 index 0000000000000..f1e2b9a595e64 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q74/simplified.txt @@ -0,0 +1,123 @@ +TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name] + WholeStageCodegen (16) + Project [customer_id,customer_first_name,customer_last_name] + BroadcastHashJoin [customer_id,customer_id,year_total,year_total,year_total,year_total] + Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,year_total,year_total] + BroadcastHashJoin [customer_id,customer_id] + BroadcastHashJoin [customer_id,customer_id] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_net_paid,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (7) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,customer_first_name,customer_last_name,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #5 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_net_paid,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #7 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (5) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (11) + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ws_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #9 + WholeStageCodegen (10) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ws_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ws_net_paid,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,ws_net_paid,ws_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (8) + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_net_paid,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (15) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ws_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #12 + WholeStageCodegen (14) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ws_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ws_net_paid,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,ws_net_paid,ws_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (12) + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_net_paid,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt new file mode 100644 index 0000000000000..d2f110a58788f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/explain.txt @@ -0,0 +1,750 @@ +== Physical Plan == +TakeOrderedAndProject (133) ++- * Project (132) + +- * SortMergeJoin Inner (131) + :- * Sort (73) + : +- Exchange (72) + : +- * HashAggregate (71) + : +- Exchange (70) + : +- * HashAggregate (69) + : +- * HashAggregate (68) + : +- Exchange (67) + : +- * HashAggregate (66) + : +- Union (65) + : :- * Project (26) + : : +- * SortMergeJoin LeftOuter (25) + : : :- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.item (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.date_dim (11) + : : +- * Sort (24) + : : +- Exchange (23) + : : +- * Project (22) + : : +- * Filter (21) + : : +- * ColumnarToRow (20) + : : +- Scan parquet default.catalog_returns (19) + : :- * Project (45) + : : +- * SortMergeJoin LeftOuter (44) + : : :- * Sort (37) + : : : +- Exchange (36) + : : : +- * Project (35) + : : : +- * BroadcastHashJoin Inner BuildRight (34) + : : : :- * Project (32) + : : : : +- * BroadcastHashJoin Inner BuildRight (31) + : : : : :- * Filter (29) + : : : : : +- * ColumnarToRow (28) + : : : : : +- Scan parquet default.store_sales (27) + : : : : +- ReusedExchange (30) + : : : +- ReusedExchange (33) + : : +- * Sort (43) + : : +- Exchange (42) + : : +- * Project (41) + : : +- * Filter (40) + : : +- * ColumnarToRow (39) + : : +- Scan parquet default.store_returns (38) + : +- * Project (64) + : +- * SortMergeJoin LeftOuter (63) + : :- * Sort (56) + : : +- Exchange (55) + : : +- * Project (54) + : : +- * BroadcastHashJoin Inner BuildRight (53) + : : :- * Project (51) + : : : +- * BroadcastHashJoin Inner BuildRight (50) + : : : :- * Filter (48) + : : : : +- * ColumnarToRow (47) + : : : : +- Scan parquet default.web_sales (46) + : : : +- ReusedExchange (49) + : : +- ReusedExchange (52) + : +- * Sort (62) + : +- Exchange (61) + : +- * Project (60) + : +- * Filter (59) + : +- * ColumnarToRow (58) + : +- Scan parquet default.web_returns (57) + +- * Sort (130) + +- Exchange (129) + +- * HashAggregate (128) + +- Exchange (127) + +- * HashAggregate (126) + +- * HashAggregate (125) + +- Exchange (124) + +- * HashAggregate (123) + +- Union (122) + :- * Project (91) + : +- * SortMergeJoin LeftOuter (90) + : :- * Sort (87) + : : +- Exchange (86) + : : +- * Project (85) + : : +- * BroadcastHashJoin Inner BuildRight (84) + : : :- * Project (79) + : : : +- * BroadcastHashJoin Inner BuildRight (78) + : : : :- * Filter (76) + : : : : +- * ColumnarToRow (75) + : : : : +- Scan parquet default.catalog_sales (74) + : : : +- ReusedExchange (77) + : : +- BroadcastExchange (83) + : : +- * Filter (82) + : : +- * ColumnarToRow (81) + : : +- Scan parquet default.date_dim (80) + : +- * Sort (89) + : +- ReusedExchange (88) + :- * Project (106) + : +- * SortMergeJoin LeftOuter (105) + : :- * Sort (102) + : : +- Exchange (101) + : : +- * Project (100) + : : +- * BroadcastHashJoin Inner BuildRight (99) + : : :- * Project (97) + : : : +- * BroadcastHashJoin Inner BuildRight (96) + : : : :- * Filter (94) + : : : : +- * ColumnarToRow (93) + : : : : +- Scan parquet default.store_sales (92) + : : : +- ReusedExchange (95) + : : +- ReusedExchange (98) + : +- * Sort (104) + : +- ReusedExchange (103) + +- * Project (121) + +- * SortMergeJoin LeftOuter (120) + :- * Sort (117) + : +- Exchange (116) + : +- * Project (115) + : +- * BroadcastHashJoin Inner BuildRight (114) + : :- * Project (112) + : : +- * BroadcastHashJoin Inner BuildRight (111) + : : :- * Filter (109) + : : : +- * ColumnarToRow (108) + : : : +- Scan parquet default.web_sales (107) + : : +- ReusedExchange (110) + : +- ReusedExchange (113) + +- * Sort (119) + +- ReusedExchange (118) + + +(1) Scan parquet default.catalog_sales +Output [5]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [5]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5] + +(3) Filter [codegen id : 3] +Input [5]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5] +Condition : isnotnull(cs_item_sk#1) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Books ), IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id), IsNotNull(i_manufact_id)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] + +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] +Condition : ((((((isnotnull(i_category#11) AND (i_category#11 = Books )) AND isnotnull(i_item_sk#7)) AND isnotnull(i_brand_id#8)) AND isnotnull(i_class_id#9)) AND isnotnull(i_category_id#10)) AND isnotnull(i_manufact_id#12)) + +(7) Project [codegen id : 1] +Output [5]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Input [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] + +(8) BroadcastExchange +Input [5]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_item_sk#1] +Right keys [1]: [i_item_sk#7] +Join condition: None + +(10) Project [codegen id : 3] +Output [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Input [10]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5, i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#14, d_year#15] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#14, d_year#15] +Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2002)) AND isnotnull(d_date_sk#14)) + +(14) BroadcastExchange +Input [2]: [d_date_sk#14, d_year#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#5] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(16) Project [codegen id : 3] +Output [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15] +Input [11]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_date_sk#14, d_year#15] + +(17) Exchange +Input [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15] +Arguments: hashpartitioning(cs_order_number#2, cs_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#17] + +(18) Sort [codegen id : 4] +Input [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15] +Arguments: [cs_order_number#2 ASC NULLS FIRST, cs_item_sk#1 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.catalog_returns +Output [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 5] +Input [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] + +(21) Filter [codegen id : 5] +Input [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] +Condition : (isnotnull(cr_order_number#19) AND isnotnull(cr_item_sk#18)) + +(22) Project [codegen id : 5] +Output [4]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] +Input [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] + +(23) Exchange +Input [4]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] +Arguments: hashpartitioning(cr_order_number#19, cr_item_sk#18, 5), ENSURE_REQUIREMENTS, [id=#23] + +(24) Sort [codegen id : 6] +Input [4]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] +Arguments: [cr_order_number#19 ASC NULLS FIRST, cr_item_sk#18 ASC NULLS FIRST], false, 0 + +(25) SortMergeJoin [codegen id : 7] +Left keys [2]: [cs_order_number#2, cs_item_sk#1] +Right keys [2]: [cr_order_number#19, cr_item_sk#18] +Join condition: None + +(26) Project [codegen id : 7] +Output [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, (cs_quantity#3 - coalesce(cr_return_quantity#20, 0)) AS sales_cnt#24, CheckOverflow((promote_precision(cast(cs_ext_sales_price#4 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#21, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#25] +Input [13]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15, cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] + +(27) Scan parquet default.store_sales +Output [5]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#30), dynamicpruningexpression(ss_sold_date_sk#30 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 10] +Input [5]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30] + +(29) Filter [codegen id : 10] +Input [5]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30] +Condition : isnotnull(ss_item_sk#26) + +(30) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#31, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35] + +(31) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_item_sk#26] +Right keys [1]: [i_item_sk#31] +Join condition: None + +(32) Project [codegen id : 10] +Output [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35] +Input [10]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30, i_item_sk#31, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35] + +(33) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#36, d_year#37] + +(34) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#30] +Right keys [1]: [d_date_sk#36] +Join condition: None + +(35) Project [codegen id : 10] +Output [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] +Input [11]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_date_sk#36, d_year#37] + +(36) Exchange +Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] +Arguments: hashpartitioning(ss_ticket_number#27, ss_item_sk#26, 5), ENSURE_REQUIREMENTS, [id=#38] + +(37) Sort [codegen id : 11] +Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] +Arguments: [ss_ticket_number#27 ASC NULLS FIRST, ss_item_sk#26 ASC NULLS FIRST], false, 0 + +(38) Scan parquet default.store_returns +Output [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 12] +Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] + +(40) Filter [codegen id : 12] +Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] +Condition : (isnotnull(sr_ticket_number#40) AND isnotnull(sr_item_sk#39)) + +(41) Project [codegen id : 12] +Output [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] +Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] + +(42) Exchange +Input [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] +Arguments: hashpartitioning(sr_ticket_number#40, sr_item_sk#39, 5), ENSURE_REQUIREMENTS, [id=#44] + +(43) Sort [codegen id : 13] +Input [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] +Arguments: [sr_ticket_number#40 ASC NULLS FIRST, sr_item_sk#39 ASC NULLS FIRST], false, 0 + +(44) SortMergeJoin [codegen id : 14] +Left keys [2]: [ss_ticket_number#27, ss_item_sk#26] +Right keys [2]: [sr_ticket_number#40, sr_item_sk#39] +Join condition: None + +(45) Project [codegen id : 14] +Output [7]: [d_year#37, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, (ss_quantity#28 - coalesce(sr_return_quantity#41, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#29 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#42, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#46] +Input [13]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37, sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] + +(46) Scan parquet default.web_sales +Output [5]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#51), dynamicpruningexpression(ws_sold_date_sk#51 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 17] +Input [5]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51] + +(48) Filter [codegen id : 17] +Input [5]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51] +Condition : isnotnull(ws_item_sk#47) + +(49) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#52, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56] + +(50) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_item_sk#47] +Right keys [1]: [i_item_sk#52] +Join condition: None + +(51) Project [codegen id : 17] +Output [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56] +Input [10]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51, i_item_sk#52, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56] + +(52) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#57, d_year#58] + +(53) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#51] +Right keys [1]: [d_date_sk#57] +Join condition: None + +(54) Project [codegen id : 17] +Output [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] +Input [11]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_date_sk#57, d_year#58] + +(55) Exchange +Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] +Arguments: hashpartitioning(ws_order_number#48, ws_item_sk#47, 5), ENSURE_REQUIREMENTS, [id=#59] + +(56) Sort [codegen id : 18] +Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] +Arguments: [ws_order_number#48 ASC NULLS FIRST, ws_item_sk#47 ASC NULLS FIRST], false, 0 + +(57) Scan parquet default.web_returns +Output [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct + +(58) ColumnarToRow [codegen id : 19] +Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] + +(59) Filter [codegen id : 19] +Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] +Condition : (isnotnull(wr_order_number#61) AND isnotnull(wr_item_sk#60)) + +(60) Project [codegen id : 19] +Output [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] +Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] + +(61) Exchange +Input [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] +Arguments: hashpartitioning(wr_order_number#61, wr_item_sk#60, 5), ENSURE_REQUIREMENTS, [id=#65] + +(62) Sort [codegen id : 20] +Input [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] +Arguments: [wr_order_number#61 ASC NULLS FIRST, wr_item_sk#60 ASC NULLS FIRST], false, 0 + +(63) SortMergeJoin [codegen id : 21] +Left keys [2]: [ws_order_number#48, ws_item_sk#47] +Right keys [2]: [wr_order_number#61, wr_item_sk#60] +Join condition: None + +(64) Project [codegen id : 21] +Output [7]: [d_year#58, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, (ws_quantity#49 - coalesce(wr_return_quantity#62, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#50 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#63, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58, wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] + +(65) Union + +(66) HashAggregate [codegen id : 22] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] + +(67) Exchange +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Arguments: hashpartitioning(d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#68] + +(68) HashAggregate [codegen id : 23] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] + +(69) HashAggregate [codegen id : 23] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Keys [5]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Functions [2]: [partial_sum(sales_cnt#24), partial_sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum#69, sum#70] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum#71, sum#72] + +(70) Exchange +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum#71, sum#72] +Arguments: hashpartitioning(d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, 5), ENSURE_REQUIREMENTS, [id=#73] + +(71) HashAggregate [codegen id : 24] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum#71, sum#72] +Keys [5]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Functions [2]: [sum(sales_cnt#24), sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum(sales_cnt#24)#74, sum(UnscaledValue(sales_amt#25))#75] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum(sales_cnt#24)#74 AS sales_cnt#76, MakeDecimal(sum(UnscaledValue(sales_amt#25))#75,18,2) AS sales_amt#77] + +(72) Exchange +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77] +Arguments: hashpartitioning(i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, 5), ENSURE_REQUIREMENTS, [id=#78] + +(73) Sort [codegen id : 25] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77] +Arguments: [i_brand_id#8 ASC NULLS FIRST, i_class_id#9 ASC NULLS FIRST, i_category_id#10 ASC NULLS FIRST, i_manufact_id#12 ASC NULLS FIRST], false, 0 + +(74) Scan parquet default.catalog_sales +Output [5]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#83), dynamicpruningexpression(cs_sold_date_sk#83 IN dynamicpruning#84)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(75) ColumnarToRow [codegen id : 28] +Input [5]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83] + +(76) Filter [codegen id : 28] +Input [5]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83] +Condition : isnotnull(cs_item_sk#79) + +(77) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#85, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] + +(78) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [cs_item_sk#79] +Right keys [1]: [i_item_sk#85] +Join condition: None + +(79) Project [codegen id : 28] +Output [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Input [10]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83, i_item_sk#85, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] + +(80) Scan parquet default.date_dim +Output [2]: [d_date_sk#90, d_year#91] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(81) ColumnarToRow [codegen id : 27] +Input [2]: [d_date_sk#90, d_year#91] + +(82) Filter [codegen id : 27] +Input [2]: [d_date_sk#90, d_year#91] +Condition : ((isnotnull(d_year#91) AND (d_year#91 = 2001)) AND isnotnull(d_date_sk#90)) + +(83) BroadcastExchange +Input [2]: [d_date_sk#90, d_year#91] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#92] + +(84) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [cs_sold_date_sk#83] +Right keys [1]: [d_date_sk#90] +Join condition: None + +(85) Project [codegen id : 28] +Output [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91] +Input [11]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_date_sk#90, d_year#91] + +(86) Exchange +Input [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91] +Arguments: hashpartitioning(cs_order_number#80, cs_item_sk#79, 5), ENSURE_REQUIREMENTS, [id=#93] + +(87) Sort [codegen id : 29] +Input [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91] +Arguments: [cs_order_number#80 ASC NULLS FIRST, cs_item_sk#79 ASC NULLS FIRST], false, 0 + +(88) ReusedExchange [Reuses operator id: 23] +Output [4]: [cr_item_sk#94, cr_order_number#95, cr_return_quantity#96, cr_return_amount#97] + +(89) Sort [codegen id : 31] +Input [4]: [cr_item_sk#94, cr_order_number#95, cr_return_quantity#96, cr_return_amount#97] +Arguments: [cr_order_number#95 ASC NULLS FIRST, cr_item_sk#94 ASC NULLS FIRST], false, 0 + +(90) SortMergeJoin [codegen id : 32] +Left keys [2]: [cs_order_number#80, cs_item_sk#79] +Right keys [2]: [cr_order_number#95, cr_item_sk#94] +Join condition: None + +(91) Project [codegen id : 32] +Output [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, (cs_quantity#81 - coalesce(cr_return_quantity#96, 0)) AS sales_cnt#24, CheckOverflow((promote_precision(cast(cs_ext_sales_price#82 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#97, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#25] +Input [13]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91, cr_item_sk#94, cr_order_number#95, cr_return_quantity#96, cr_return_amount#97] + +(92) Scan parquet default.store_sales +Output [5]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#102), dynamicpruningexpression(ss_sold_date_sk#102 IN dynamicpruning#84)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(93) ColumnarToRow [codegen id : 35] +Input [5]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102] + +(94) Filter [codegen id : 35] +Input [5]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102] +Condition : isnotnull(ss_item_sk#98) + +(95) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#103, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107] + +(96) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [ss_item_sk#98] +Right keys [1]: [i_item_sk#103] +Join condition: None + +(97) Project [codegen id : 35] +Output [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107] +Input [10]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102, i_item_sk#103, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107] + +(98) ReusedExchange [Reuses operator id: 83] +Output [2]: [d_date_sk#108, d_year#109] + +(99) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [ss_sold_date_sk#102] +Right keys [1]: [d_date_sk#108] +Join condition: None + +(100) Project [codegen id : 35] +Output [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] +Input [11]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_date_sk#108, d_year#109] + +(101) Exchange +Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] +Arguments: hashpartitioning(ss_ticket_number#99, ss_item_sk#98, 5), ENSURE_REQUIREMENTS, [id=#110] + +(102) Sort [codegen id : 36] +Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] +Arguments: [ss_ticket_number#99 ASC NULLS FIRST, ss_item_sk#98 ASC NULLS FIRST], false, 0 + +(103) ReusedExchange [Reuses operator id: 42] +Output [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] + +(104) Sort [codegen id : 38] +Input [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] +Arguments: [sr_ticket_number#112 ASC NULLS FIRST, sr_item_sk#111 ASC NULLS FIRST], false, 0 + +(105) SortMergeJoin [codegen id : 39] +Left keys [2]: [ss_ticket_number#99, ss_item_sk#98] +Right keys [2]: [sr_ticket_number#112, sr_item_sk#111] +Join condition: None + +(106) Project [codegen id : 39] +Output [7]: [d_year#109, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, (ss_quantity#100 - coalesce(sr_return_quantity#113, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#101 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#114, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#46] +Input [13]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109, sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] + +(107) Scan parquet default.web_sales +Output [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#119), dynamicpruningexpression(ws_sold_date_sk#119 IN dynamicpruning#84)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(108) ColumnarToRow [codegen id : 42] +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] + +(109) Filter [codegen id : 42] +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] +Condition : isnotnull(ws_item_sk#115) + +(110) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] + +(111) BroadcastHashJoin [codegen id : 42] +Left keys [1]: [ws_item_sk#115] +Right keys [1]: [i_item_sk#120] +Join condition: None + +(112) Project [codegen id : 42] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] +Input [10]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] + +(113) ReusedExchange [Reuses operator id: 83] +Output [2]: [d_date_sk#125, d_year#126] + +(114) BroadcastHashJoin [codegen id : 42] +Left keys [1]: [ws_sold_date_sk#119] +Right keys [1]: [d_date_sk#125] +Join condition: None + +(115) Project [codegen id : 42] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Input [11]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_date_sk#125, d_year#126] + +(116) Exchange +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: hashpartitioning(ws_order_number#116, ws_item_sk#115, 5), ENSURE_REQUIREMENTS, [id=#127] + +(117) Sort [codegen id : 43] +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: [ws_order_number#116 ASC NULLS FIRST, ws_item_sk#115 ASC NULLS FIRST], false, 0 + +(118) ReusedExchange [Reuses operator id: 61] +Output [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] + +(119) Sort [codegen id : 45] +Input [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] +Arguments: [wr_order_number#129 ASC NULLS FIRST, wr_item_sk#128 ASC NULLS FIRST], false, 0 + +(120) SortMergeJoin [codegen id : 46] +Left keys [2]: [ws_order_number#116, ws_item_sk#115] +Right keys [2]: [wr_order_number#129, wr_item_sk#128] +Join condition: None + +(121) Project [codegen id : 46] +Output [7]: [d_year#126, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, (ws_quantity#117 - coalesce(wr_return_quantity#130, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#118 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#131, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126, wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] + +(122) Union + +(123) HashAggregate [codegen id : 47] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] + +(124) Exchange +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#132] + +(125) HashAggregate [codegen id : 48] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] + +(126) HashAggregate [codegen id : 48] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Functions [2]: [partial_sum(sales_cnt#24), partial_sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum#133, sum#134] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] + +(127) Exchange +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#137] + +(128) HashAggregate [codegen id : 49] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] +Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Functions [2]: [sum(sales_cnt#24), sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum(sales_cnt#24)#138, sum(UnscaledValue(sales_amt#25))#139] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum(sales_cnt#24)#138 AS sales_cnt#140, MakeDecimal(sum(UnscaledValue(sales_amt#25))#139,18,2) AS sales_amt#141] + +(129) Exchange +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] +Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#142] + +(130) Sort [codegen id : 50] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] +Arguments: [i_brand_id#86 ASC NULLS FIRST, i_class_id#87 ASC NULLS FIRST, i_category_id#88 ASC NULLS FIRST, i_manufact_id#89 ASC NULLS FIRST], false, 0 + +(131) SortMergeJoin [codegen id : 51] +Left keys [4]: [i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Right keys [4]: [i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#76 as decimal(17,2))) / promote_precision(cast(sales_cnt#140 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) + +(132) Project [codegen id : 51] +Output [10]: [d_year#91 AS prev_year#143, d_year#15 AS year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#140 AS prev_yr_cnt#145, sales_cnt#76 AS curr_yr_cnt#146, (sales_cnt#76 - sales_cnt#140) AS sales_cnt_diff#147, CheckOverflow((promote_precision(cast(sales_amt#77 as decimal(19,2))) - promote_precision(cast(sales_amt#141 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#148] +Input [14]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77, d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] + +(133) TakeOrderedAndProject +Input [10]: [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] +Arguments: 100, [sales_cnt_diff#147 ASC NULLS FIRST], [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (134) + + +(134) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#14, d_year#15] + +Subquery:2 Hosting operator id = 27 Hosting Expression = ss_sold_date_sk#30 IN dynamicpruning#6 + +Subquery:3 Hosting operator id = 46 Hosting Expression = ws_sold_date_sk#51 IN dynamicpruning#6 + +Subquery:4 Hosting operator id = 74 Hosting Expression = cs_sold_date_sk#83 IN dynamicpruning#84 +ReusedExchange (135) + + +(135) ReusedExchange [Reuses operator id: 83] +Output [2]: [d_date_sk#90, d_year#91] + +Subquery:5 Hosting operator id = 92 Hosting Expression = ss_sold_date_sk#102 IN dynamicpruning#84 + +Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#119 IN dynamicpruning#84 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/simplified.txt new file mode 100644 index 0000000000000..170dad0b5dadd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75.sf100/simplified.txt @@ -0,0 +1,238 @@ +TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_category_id,i_manufact_id,prev_yr_cnt,curr_yr_cnt,sales_amt_diff] + WholeStageCodegen (51) + Project [d_year,d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_cnt,sales_amt,sales_amt] + SortMergeJoin [i_brand_id,i_class_id,i_category_id,i_manufact_id,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_cnt] + InputAdapter + WholeStageCodegen (25) + Sort [i_brand_id,i_class_id,i_category_id,i_manufact_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id,i_manufact_id] #1 + WholeStageCodegen (24) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sum,sum] [sum(sales_cnt),sum(UnscaledValue(sales_amt)),sales_cnt,sales_amt,sum,sum] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id] #2 + WholeStageCodegen (23) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] [sum,sum,sum,sum] + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] #3 + WholeStageCodegen (22) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Union + WholeStageCodegen (7) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #4 + WholeStageCodegen (3) + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #5 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Project [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + Filter [i_category,i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id,i_category,i_manufact_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (6) + Sort [cr_order_number,cr_item_sk] + InputAdapter + Exchange [cr_order_number,cr_item_sk] #7 + WholeStageCodegen (5) + Project [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount] + Filter [cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount,cr_returned_date_sk] + WholeStageCodegen (14) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ss_quantity,sr_return_quantity,ss_ext_sales_price,sr_return_amt] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #8 + WholeStageCodegen (10) + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #5 + InputAdapter + WholeStageCodegen (13) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #9 + WholeStageCodegen (12) + Project [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt,sr_returned_date_sk] + WholeStageCodegen (21) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ws_quantity,wr_return_quantity,ws_ext_sales_price,wr_return_amt] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (18) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #10 + WholeStageCodegen (17) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #5 + InputAdapter + WholeStageCodegen (20) + Sort [wr_order_number,wr_item_sk] + InputAdapter + Exchange [wr_order_number,wr_item_sk] #11 + WholeStageCodegen (19) + Project [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt] + Filter [wr_order_number,wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt,wr_returned_date_sk] + InputAdapter + WholeStageCodegen (50) + Sort [i_brand_id,i_class_id,i_category_id,i_manufact_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id,i_manufact_id] #12 + WholeStageCodegen (49) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sum,sum] [sum(sales_cnt),sum(UnscaledValue(sales_amt)),sales_cnt,sales_amt,sum,sum] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id] #13 + WholeStageCodegen (48) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] [sum,sum,sum,sum] + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] #14 + WholeStageCodegen (47) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Union + WholeStageCodegen (32) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (29) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #15 + WholeStageCodegen (28) + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #16 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (27) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (31) + Sort [cr_order_number,cr_item_sk] + InputAdapter + ReusedExchange [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount] #7 + WholeStageCodegen (39) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ss_quantity,sr_return_quantity,ss_ext_sales_price,sr_return_amt] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (36) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #17 + WholeStageCodegen (35) + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #16 + InputAdapter + WholeStageCodegen (38) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + ReusedExchange [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt] #9 + WholeStageCodegen (46) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ws_quantity,wr_return_quantity,ws_ext_sales_price,wr_return_amt] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (43) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #18 + WholeStageCodegen (42) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #16 + InputAdapter + WholeStageCodegen (45) + Sort [wr_order_number,wr_item_sk] + InputAdapter + ReusedExchange [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt] #11 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt new file mode 100644 index 0000000000000..d2f110a58788f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/explain.txt @@ -0,0 +1,750 @@ +== Physical Plan == +TakeOrderedAndProject (133) ++- * Project (132) + +- * SortMergeJoin Inner (131) + :- * Sort (73) + : +- Exchange (72) + : +- * HashAggregate (71) + : +- Exchange (70) + : +- * HashAggregate (69) + : +- * HashAggregate (68) + : +- Exchange (67) + : +- * HashAggregate (66) + : +- Union (65) + : :- * Project (26) + : : +- * SortMergeJoin LeftOuter (25) + : : :- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.item (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.date_dim (11) + : : +- * Sort (24) + : : +- Exchange (23) + : : +- * Project (22) + : : +- * Filter (21) + : : +- * ColumnarToRow (20) + : : +- Scan parquet default.catalog_returns (19) + : :- * Project (45) + : : +- * SortMergeJoin LeftOuter (44) + : : :- * Sort (37) + : : : +- Exchange (36) + : : : +- * Project (35) + : : : +- * BroadcastHashJoin Inner BuildRight (34) + : : : :- * Project (32) + : : : : +- * BroadcastHashJoin Inner BuildRight (31) + : : : : :- * Filter (29) + : : : : : +- * ColumnarToRow (28) + : : : : : +- Scan parquet default.store_sales (27) + : : : : +- ReusedExchange (30) + : : : +- ReusedExchange (33) + : : +- * Sort (43) + : : +- Exchange (42) + : : +- * Project (41) + : : +- * Filter (40) + : : +- * ColumnarToRow (39) + : : +- Scan parquet default.store_returns (38) + : +- * Project (64) + : +- * SortMergeJoin LeftOuter (63) + : :- * Sort (56) + : : +- Exchange (55) + : : +- * Project (54) + : : +- * BroadcastHashJoin Inner BuildRight (53) + : : :- * Project (51) + : : : +- * BroadcastHashJoin Inner BuildRight (50) + : : : :- * Filter (48) + : : : : +- * ColumnarToRow (47) + : : : : +- Scan parquet default.web_sales (46) + : : : +- ReusedExchange (49) + : : +- ReusedExchange (52) + : +- * Sort (62) + : +- Exchange (61) + : +- * Project (60) + : +- * Filter (59) + : +- * ColumnarToRow (58) + : +- Scan parquet default.web_returns (57) + +- * Sort (130) + +- Exchange (129) + +- * HashAggregate (128) + +- Exchange (127) + +- * HashAggregate (126) + +- * HashAggregate (125) + +- Exchange (124) + +- * HashAggregate (123) + +- Union (122) + :- * Project (91) + : +- * SortMergeJoin LeftOuter (90) + : :- * Sort (87) + : : +- Exchange (86) + : : +- * Project (85) + : : +- * BroadcastHashJoin Inner BuildRight (84) + : : :- * Project (79) + : : : +- * BroadcastHashJoin Inner BuildRight (78) + : : : :- * Filter (76) + : : : : +- * ColumnarToRow (75) + : : : : +- Scan parquet default.catalog_sales (74) + : : : +- ReusedExchange (77) + : : +- BroadcastExchange (83) + : : +- * Filter (82) + : : +- * ColumnarToRow (81) + : : +- Scan parquet default.date_dim (80) + : +- * Sort (89) + : +- ReusedExchange (88) + :- * Project (106) + : +- * SortMergeJoin LeftOuter (105) + : :- * Sort (102) + : : +- Exchange (101) + : : +- * Project (100) + : : +- * BroadcastHashJoin Inner BuildRight (99) + : : :- * Project (97) + : : : +- * BroadcastHashJoin Inner BuildRight (96) + : : : :- * Filter (94) + : : : : +- * ColumnarToRow (93) + : : : : +- Scan parquet default.store_sales (92) + : : : +- ReusedExchange (95) + : : +- ReusedExchange (98) + : +- * Sort (104) + : +- ReusedExchange (103) + +- * Project (121) + +- * SortMergeJoin LeftOuter (120) + :- * Sort (117) + : +- Exchange (116) + : +- * Project (115) + : +- * BroadcastHashJoin Inner BuildRight (114) + : :- * Project (112) + : : +- * BroadcastHashJoin Inner BuildRight (111) + : : :- * Filter (109) + : : : +- * ColumnarToRow (108) + : : : +- Scan parquet default.web_sales (107) + : : +- ReusedExchange (110) + : +- ReusedExchange (113) + +- * Sort (119) + +- ReusedExchange (118) + + +(1) Scan parquet default.catalog_sales +Output [5]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [5]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5] + +(3) Filter [codegen id : 3] +Input [5]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5] +Condition : isnotnull(cs_item_sk#1) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Books ), IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id), IsNotNull(i_manufact_id)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] + +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] +Condition : ((((((isnotnull(i_category#11) AND (i_category#11 = Books )) AND isnotnull(i_item_sk#7)) AND isnotnull(i_brand_id#8)) AND isnotnull(i_class_id#9)) AND isnotnull(i_category_id#10)) AND isnotnull(i_manufact_id#12)) + +(7) Project [codegen id : 1] +Output [5]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Input [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] + +(8) BroadcastExchange +Input [5]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_item_sk#1] +Right keys [1]: [i_item_sk#7] +Join condition: None + +(10) Project [codegen id : 3] +Output [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Input [10]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5, i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#14, d_year#15] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#14, d_year#15] +Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2002)) AND isnotnull(d_date_sk#14)) + +(14) BroadcastExchange +Input [2]: [d_date_sk#14, d_year#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#5] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(16) Project [codegen id : 3] +Output [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15] +Input [11]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_date_sk#14, d_year#15] + +(17) Exchange +Input [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15] +Arguments: hashpartitioning(cs_order_number#2, cs_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#17] + +(18) Sort [codegen id : 4] +Input [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15] +Arguments: [cs_order_number#2 ASC NULLS FIRST, cs_item_sk#1 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.catalog_returns +Output [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 5] +Input [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] + +(21) Filter [codegen id : 5] +Input [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] +Condition : (isnotnull(cr_order_number#19) AND isnotnull(cr_item_sk#18)) + +(22) Project [codegen id : 5] +Output [4]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] +Input [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] + +(23) Exchange +Input [4]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] +Arguments: hashpartitioning(cr_order_number#19, cr_item_sk#18, 5), ENSURE_REQUIREMENTS, [id=#23] + +(24) Sort [codegen id : 6] +Input [4]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] +Arguments: [cr_order_number#19 ASC NULLS FIRST, cr_item_sk#18 ASC NULLS FIRST], false, 0 + +(25) SortMergeJoin [codegen id : 7] +Left keys [2]: [cs_order_number#2, cs_item_sk#1] +Right keys [2]: [cr_order_number#19, cr_item_sk#18] +Join condition: None + +(26) Project [codegen id : 7] +Output [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, (cs_quantity#3 - coalesce(cr_return_quantity#20, 0)) AS sales_cnt#24, CheckOverflow((promote_precision(cast(cs_ext_sales_price#4 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#21, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#25] +Input [13]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15, cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] + +(27) Scan parquet default.store_sales +Output [5]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#30), dynamicpruningexpression(ss_sold_date_sk#30 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 10] +Input [5]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30] + +(29) Filter [codegen id : 10] +Input [5]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30] +Condition : isnotnull(ss_item_sk#26) + +(30) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#31, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35] + +(31) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_item_sk#26] +Right keys [1]: [i_item_sk#31] +Join condition: None + +(32) Project [codegen id : 10] +Output [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35] +Input [10]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30, i_item_sk#31, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35] + +(33) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#36, d_year#37] + +(34) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#30] +Right keys [1]: [d_date_sk#36] +Join condition: None + +(35) Project [codegen id : 10] +Output [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] +Input [11]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_date_sk#36, d_year#37] + +(36) Exchange +Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] +Arguments: hashpartitioning(ss_ticket_number#27, ss_item_sk#26, 5), ENSURE_REQUIREMENTS, [id=#38] + +(37) Sort [codegen id : 11] +Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] +Arguments: [ss_ticket_number#27 ASC NULLS FIRST, ss_item_sk#26 ASC NULLS FIRST], false, 0 + +(38) Scan parquet default.store_returns +Output [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 12] +Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] + +(40) Filter [codegen id : 12] +Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] +Condition : (isnotnull(sr_ticket_number#40) AND isnotnull(sr_item_sk#39)) + +(41) Project [codegen id : 12] +Output [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] +Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] + +(42) Exchange +Input [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] +Arguments: hashpartitioning(sr_ticket_number#40, sr_item_sk#39, 5), ENSURE_REQUIREMENTS, [id=#44] + +(43) Sort [codegen id : 13] +Input [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] +Arguments: [sr_ticket_number#40 ASC NULLS FIRST, sr_item_sk#39 ASC NULLS FIRST], false, 0 + +(44) SortMergeJoin [codegen id : 14] +Left keys [2]: [ss_ticket_number#27, ss_item_sk#26] +Right keys [2]: [sr_ticket_number#40, sr_item_sk#39] +Join condition: None + +(45) Project [codegen id : 14] +Output [7]: [d_year#37, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, (ss_quantity#28 - coalesce(sr_return_quantity#41, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#29 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#42, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#46] +Input [13]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37, sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] + +(46) Scan parquet default.web_sales +Output [5]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#51), dynamicpruningexpression(ws_sold_date_sk#51 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 17] +Input [5]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51] + +(48) Filter [codegen id : 17] +Input [5]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51] +Condition : isnotnull(ws_item_sk#47) + +(49) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#52, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56] + +(50) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_item_sk#47] +Right keys [1]: [i_item_sk#52] +Join condition: None + +(51) Project [codegen id : 17] +Output [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56] +Input [10]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51, i_item_sk#52, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56] + +(52) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#57, d_year#58] + +(53) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#51] +Right keys [1]: [d_date_sk#57] +Join condition: None + +(54) Project [codegen id : 17] +Output [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] +Input [11]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_date_sk#57, d_year#58] + +(55) Exchange +Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] +Arguments: hashpartitioning(ws_order_number#48, ws_item_sk#47, 5), ENSURE_REQUIREMENTS, [id=#59] + +(56) Sort [codegen id : 18] +Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] +Arguments: [ws_order_number#48 ASC NULLS FIRST, ws_item_sk#47 ASC NULLS FIRST], false, 0 + +(57) Scan parquet default.web_returns +Output [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct + +(58) ColumnarToRow [codegen id : 19] +Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] + +(59) Filter [codegen id : 19] +Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] +Condition : (isnotnull(wr_order_number#61) AND isnotnull(wr_item_sk#60)) + +(60) Project [codegen id : 19] +Output [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] +Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] + +(61) Exchange +Input [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] +Arguments: hashpartitioning(wr_order_number#61, wr_item_sk#60, 5), ENSURE_REQUIREMENTS, [id=#65] + +(62) Sort [codegen id : 20] +Input [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] +Arguments: [wr_order_number#61 ASC NULLS FIRST, wr_item_sk#60 ASC NULLS FIRST], false, 0 + +(63) SortMergeJoin [codegen id : 21] +Left keys [2]: [ws_order_number#48, ws_item_sk#47] +Right keys [2]: [wr_order_number#61, wr_item_sk#60] +Join condition: None + +(64) Project [codegen id : 21] +Output [7]: [d_year#58, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, (ws_quantity#49 - coalesce(wr_return_quantity#62, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#50 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#63, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58, wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] + +(65) Union + +(66) HashAggregate [codegen id : 22] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] + +(67) Exchange +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Arguments: hashpartitioning(d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#68] + +(68) HashAggregate [codegen id : 23] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] + +(69) HashAggregate [codegen id : 23] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Keys [5]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Functions [2]: [partial_sum(sales_cnt#24), partial_sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum#69, sum#70] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum#71, sum#72] + +(70) Exchange +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum#71, sum#72] +Arguments: hashpartitioning(d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, 5), ENSURE_REQUIREMENTS, [id=#73] + +(71) HashAggregate [codegen id : 24] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum#71, sum#72] +Keys [5]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Functions [2]: [sum(sales_cnt#24), sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum(sales_cnt#24)#74, sum(UnscaledValue(sales_amt#25))#75] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum(sales_cnt#24)#74 AS sales_cnt#76, MakeDecimal(sum(UnscaledValue(sales_amt#25))#75,18,2) AS sales_amt#77] + +(72) Exchange +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77] +Arguments: hashpartitioning(i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, 5), ENSURE_REQUIREMENTS, [id=#78] + +(73) Sort [codegen id : 25] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77] +Arguments: [i_brand_id#8 ASC NULLS FIRST, i_class_id#9 ASC NULLS FIRST, i_category_id#10 ASC NULLS FIRST, i_manufact_id#12 ASC NULLS FIRST], false, 0 + +(74) Scan parquet default.catalog_sales +Output [5]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#83), dynamicpruningexpression(cs_sold_date_sk#83 IN dynamicpruning#84)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(75) ColumnarToRow [codegen id : 28] +Input [5]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83] + +(76) Filter [codegen id : 28] +Input [5]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83] +Condition : isnotnull(cs_item_sk#79) + +(77) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#85, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] + +(78) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [cs_item_sk#79] +Right keys [1]: [i_item_sk#85] +Join condition: None + +(79) Project [codegen id : 28] +Output [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Input [10]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83, i_item_sk#85, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] + +(80) Scan parquet default.date_dim +Output [2]: [d_date_sk#90, d_year#91] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(81) ColumnarToRow [codegen id : 27] +Input [2]: [d_date_sk#90, d_year#91] + +(82) Filter [codegen id : 27] +Input [2]: [d_date_sk#90, d_year#91] +Condition : ((isnotnull(d_year#91) AND (d_year#91 = 2001)) AND isnotnull(d_date_sk#90)) + +(83) BroadcastExchange +Input [2]: [d_date_sk#90, d_year#91] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#92] + +(84) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [cs_sold_date_sk#83] +Right keys [1]: [d_date_sk#90] +Join condition: None + +(85) Project [codegen id : 28] +Output [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91] +Input [11]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_date_sk#90, d_year#91] + +(86) Exchange +Input [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91] +Arguments: hashpartitioning(cs_order_number#80, cs_item_sk#79, 5), ENSURE_REQUIREMENTS, [id=#93] + +(87) Sort [codegen id : 29] +Input [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91] +Arguments: [cs_order_number#80 ASC NULLS FIRST, cs_item_sk#79 ASC NULLS FIRST], false, 0 + +(88) ReusedExchange [Reuses operator id: 23] +Output [4]: [cr_item_sk#94, cr_order_number#95, cr_return_quantity#96, cr_return_amount#97] + +(89) Sort [codegen id : 31] +Input [4]: [cr_item_sk#94, cr_order_number#95, cr_return_quantity#96, cr_return_amount#97] +Arguments: [cr_order_number#95 ASC NULLS FIRST, cr_item_sk#94 ASC NULLS FIRST], false, 0 + +(90) SortMergeJoin [codegen id : 32] +Left keys [2]: [cs_order_number#80, cs_item_sk#79] +Right keys [2]: [cr_order_number#95, cr_item_sk#94] +Join condition: None + +(91) Project [codegen id : 32] +Output [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, (cs_quantity#81 - coalesce(cr_return_quantity#96, 0)) AS sales_cnt#24, CheckOverflow((promote_precision(cast(cs_ext_sales_price#82 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#97, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#25] +Input [13]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91, cr_item_sk#94, cr_order_number#95, cr_return_quantity#96, cr_return_amount#97] + +(92) Scan parquet default.store_sales +Output [5]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#102), dynamicpruningexpression(ss_sold_date_sk#102 IN dynamicpruning#84)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(93) ColumnarToRow [codegen id : 35] +Input [5]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102] + +(94) Filter [codegen id : 35] +Input [5]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102] +Condition : isnotnull(ss_item_sk#98) + +(95) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#103, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107] + +(96) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [ss_item_sk#98] +Right keys [1]: [i_item_sk#103] +Join condition: None + +(97) Project [codegen id : 35] +Output [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107] +Input [10]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102, i_item_sk#103, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107] + +(98) ReusedExchange [Reuses operator id: 83] +Output [2]: [d_date_sk#108, d_year#109] + +(99) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [ss_sold_date_sk#102] +Right keys [1]: [d_date_sk#108] +Join condition: None + +(100) Project [codegen id : 35] +Output [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] +Input [11]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_date_sk#108, d_year#109] + +(101) Exchange +Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] +Arguments: hashpartitioning(ss_ticket_number#99, ss_item_sk#98, 5), ENSURE_REQUIREMENTS, [id=#110] + +(102) Sort [codegen id : 36] +Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] +Arguments: [ss_ticket_number#99 ASC NULLS FIRST, ss_item_sk#98 ASC NULLS FIRST], false, 0 + +(103) ReusedExchange [Reuses operator id: 42] +Output [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] + +(104) Sort [codegen id : 38] +Input [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] +Arguments: [sr_ticket_number#112 ASC NULLS FIRST, sr_item_sk#111 ASC NULLS FIRST], false, 0 + +(105) SortMergeJoin [codegen id : 39] +Left keys [2]: [ss_ticket_number#99, ss_item_sk#98] +Right keys [2]: [sr_ticket_number#112, sr_item_sk#111] +Join condition: None + +(106) Project [codegen id : 39] +Output [7]: [d_year#109, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, (ss_quantity#100 - coalesce(sr_return_quantity#113, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#101 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#114, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#46] +Input [13]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109, sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] + +(107) Scan parquet default.web_sales +Output [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#119), dynamicpruningexpression(ws_sold_date_sk#119 IN dynamicpruning#84)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(108) ColumnarToRow [codegen id : 42] +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] + +(109) Filter [codegen id : 42] +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] +Condition : isnotnull(ws_item_sk#115) + +(110) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] + +(111) BroadcastHashJoin [codegen id : 42] +Left keys [1]: [ws_item_sk#115] +Right keys [1]: [i_item_sk#120] +Join condition: None + +(112) Project [codegen id : 42] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] +Input [10]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] + +(113) ReusedExchange [Reuses operator id: 83] +Output [2]: [d_date_sk#125, d_year#126] + +(114) BroadcastHashJoin [codegen id : 42] +Left keys [1]: [ws_sold_date_sk#119] +Right keys [1]: [d_date_sk#125] +Join condition: None + +(115) Project [codegen id : 42] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Input [11]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_date_sk#125, d_year#126] + +(116) Exchange +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: hashpartitioning(ws_order_number#116, ws_item_sk#115, 5), ENSURE_REQUIREMENTS, [id=#127] + +(117) Sort [codegen id : 43] +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: [ws_order_number#116 ASC NULLS FIRST, ws_item_sk#115 ASC NULLS FIRST], false, 0 + +(118) ReusedExchange [Reuses operator id: 61] +Output [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] + +(119) Sort [codegen id : 45] +Input [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] +Arguments: [wr_order_number#129 ASC NULLS FIRST, wr_item_sk#128 ASC NULLS FIRST], false, 0 + +(120) SortMergeJoin [codegen id : 46] +Left keys [2]: [ws_order_number#116, ws_item_sk#115] +Right keys [2]: [wr_order_number#129, wr_item_sk#128] +Join condition: None + +(121) Project [codegen id : 46] +Output [7]: [d_year#126, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, (ws_quantity#117 - coalesce(wr_return_quantity#130, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#118 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#131, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126, wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] + +(122) Union + +(123) HashAggregate [codegen id : 47] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] + +(124) Exchange +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#132] + +(125) HashAggregate [codegen id : 48] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] + +(126) HashAggregate [codegen id : 48] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Functions [2]: [partial_sum(sales_cnt#24), partial_sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum#133, sum#134] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] + +(127) Exchange +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#137] + +(128) HashAggregate [codegen id : 49] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] +Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Functions [2]: [sum(sales_cnt#24), sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum(sales_cnt#24)#138, sum(UnscaledValue(sales_amt#25))#139] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum(sales_cnt#24)#138 AS sales_cnt#140, MakeDecimal(sum(UnscaledValue(sales_amt#25))#139,18,2) AS sales_amt#141] + +(129) Exchange +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] +Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#142] + +(130) Sort [codegen id : 50] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] +Arguments: [i_brand_id#86 ASC NULLS FIRST, i_class_id#87 ASC NULLS FIRST, i_category_id#88 ASC NULLS FIRST, i_manufact_id#89 ASC NULLS FIRST], false, 0 + +(131) SortMergeJoin [codegen id : 51] +Left keys [4]: [i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Right keys [4]: [i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#76 as decimal(17,2))) / promote_precision(cast(sales_cnt#140 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) + +(132) Project [codegen id : 51] +Output [10]: [d_year#91 AS prev_year#143, d_year#15 AS year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#140 AS prev_yr_cnt#145, sales_cnt#76 AS curr_yr_cnt#146, (sales_cnt#76 - sales_cnt#140) AS sales_cnt_diff#147, CheckOverflow((promote_precision(cast(sales_amt#77 as decimal(19,2))) - promote_precision(cast(sales_amt#141 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#148] +Input [14]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77, d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] + +(133) TakeOrderedAndProject +Input [10]: [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] +Arguments: 100, [sales_cnt_diff#147 ASC NULLS FIRST], [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (134) + + +(134) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#14, d_year#15] + +Subquery:2 Hosting operator id = 27 Hosting Expression = ss_sold_date_sk#30 IN dynamicpruning#6 + +Subquery:3 Hosting operator id = 46 Hosting Expression = ws_sold_date_sk#51 IN dynamicpruning#6 + +Subquery:4 Hosting operator id = 74 Hosting Expression = cs_sold_date_sk#83 IN dynamicpruning#84 +ReusedExchange (135) + + +(135) ReusedExchange [Reuses operator id: 83] +Output [2]: [d_date_sk#90, d_year#91] + +Subquery:5 Hosting operator id = 92 Hosting Expression = ss_sold_date_sk#102 IN dynamicpruning#84 + +Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#119 IN dynamicpruning#84 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/simplified.txt new file mode 100644 index 0000000000000..170dad0b5dadd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q75/simplified.txt @@ -0,0 +1,238 @@ +TakeOrderedAndProject [sales_cnt_diff,prev_year,year,i_brand_id,i_class_id,i_category_id,i_manufact_id,prev_yr_cnt,curr_yr_cnt,sales_amt_diff] + WholeStageCodegen (51) + Project [d_year,d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_cnt,sales_amt,sales_amt] + SortMergeJoin [i_brand_id,i_class_id,i_category_id,i_manufact_id,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_cnt] + InputAdapter + WholeStageCodegen (25) + Sort [i_brand_id,i_class_id,i_category_id,i_manufact_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id,i_manufact_id] #1 + WholeStageCodegen (24) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sum,sum] [sum(sales_cnt),sum(UnscaledValue(sales_amt)),sales_cnt,sales_amt,sum,sum] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id] #2 + WholeStageCodegen (23) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] [sum,sum,sum,sum] + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] #3 + WholeStageCodegen (22) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Union + WholeStageCodegen (7) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #4 + WholeStageCodegen (3) + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #5 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Project [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + Filter [i_category,i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id,i_category,i_manufact_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (6) + Sort [cr_order_number,cr_item_sk] + InputAdapter + Exchange [cr_order_number,cr_item_sk] #7 + WholeStageCodegen (5) + Project [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount] + Filter [cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount,cr_returned_date_sk] + WholeStageCodegen (14) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ss_quantity,sr_return_quantity,ss_ext_sales_price,sr_return_amt] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #8 + WholeStageCodegen (10) + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #5 + InputAdapter + WholeStageCodegen (13) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #9 + WholeStageCodegen (12) + Project [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt,sr_returned_date_sk] + WholeStageCodegen (21) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ws_quantity,wr_return_quantity,ws_ext_sales_price,wr_return_amt] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (18) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #10 + WholeStageCodegen (17) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #5 + InputAdapter + WholeStageCodegen (20) + Sort [wr_order_number,wr_item_sk] + InputAdapter + Exchange [wr_order_number,wr_item_sk] #11 + WholeStageCodegen (19) + Project [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt] + Filter [wr_order_number,wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt,wr_returned_date_sk] + InputAdapter + WholeStageCodegen (50) + Sort [i_brand_id,i_class_id,i_category_id,i_manufact_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id,i_manufact_id] #12 + WholeStageCodegen (49) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sum,sum] [sum(sales_cnt),sum(UnscaledValue(sales_amt)),sales_cnt,sales_amt,sum,sum] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id] #13 + WholeStageCodegen (48) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] [sum,sum,sum,sum] + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] #14 + WholeStageCodegen (47) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Union + WholeStageCodegen (32) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (29) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #15 + WholeStageCodegen (28) + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #16 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (27) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (31) + Sort [cr_order_number,cr_item_sk] + InputAdapter + ReusedExchange [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount] #7 + WholeStageCodegen (39) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ss_quantity,sr_return_quantity,ss_ext_sales_price,sr_return_amt] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (36) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #17 + WholeStageCodegen (35) + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #16 + InputAdapter + WholeStageCodegen (38) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + ReusedExchange [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt] #9 + WholeStageCodegen (46) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ws_quantity,wr_return_quantity,ws_ext_sales_price,wr_return_amt] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (43) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #18 + WholeStageCodegen (42) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #16 + InputAdapter + WholeStageCodegen (45) + Sort [wr_order_number,wr_item_sk] + InputAdapter + ReusedExchange [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt] #11 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/explain.txt new file mode 100644 index 0000000000000..9284172139688 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/explain.txt @@ -0,0 +1,248 @@ +== Physical Plan == +TakeOrderedAndProject (44) ++- * HashAggregate (43) + +- Exchange (42) + +- * HashAggregate (41) + +- Union (40) + :- * Project (15) + : +- * BroadcastHashJoin Inner BuildRight (14) + : :- * Project (9) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (13) + : +- * Filter (12) + : +- * ColumnarToRow (11) + : +- Scan parquet default.item (10) + :- * Project (30) + : +- * BroadcastHashJoin Inner BuildLeft (29) + : :- BroadcastExchange (25) + : : +- * Project (24) + : : +- * BroadcastHashJoin Inner BuildLeft (23) + : : :- BroadcastExchange (19) + : : : +- * Filter (18) + : : : +- * ColumnarToRow (17) + : : : +- Scan parquet default.web_sales (16) + : : +- * Filter (22) + : : +- * ColumnarToRow (21) + : : +- Scan parquet default.date_dim (20) + : +- * Filter (28) + : +- * ColumnarToRow (27) + : +- Scan parquet default.item (26) + +- * Project (39) + +- * BroadcastHashJoin Inner BuildRight (38) + :- * Project (36) + : +- * BroadcastHashJoin Inner BuildRight (35) + : :- * Filter (33) + : : +- * ColumnarToRow (32) + : : +- Scan parquet default.catalog_sales (31) + : +- ReusedExchange (34) + +- ReusedExchange (37) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4)] +PushedFilters: [IsNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Condition : (isnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Condition : isnotnull(d_date_sk#5) + +(7) BroadcastExchange +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(9) Project [codegen id : 3] +Output [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, d_year#6, d_qoy#7] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, d_date_sk#5, d_year#6, d_qoy#7] + +(10) Scan parquet default.item +Output [2]: [i_item_sk#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [i_item_sk#9, i_category#10] + +(12) Filter [codegen id : 2] +Input [2]: [i_item_sk#9, i_category#10] +Condition : isnotnull(i_item_sk#9) + +(13) BroadcastExchange +Input [2]: [i_item_sk#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#9] +Join condition: None + +(15) Project [codegen id : 3] +Output [6]: [store AS channel#12, ss_store_sk#2 AS col_name#13, d_year#6, d_qoy#7, i_category#10, ss_ext_sales_price#3 AS ext_sales_price#14] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, d_year#6, d_qoy#7, i_item_sk#9, i_category#10] + +(16) Scan parquet default.web_sales +Output [4]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#18)] +PushedFilters: [IsNull(ws_ship_customer_sk), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 4] +Input [4]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18] + +(18) Filter [codegen id : 4] +Input [4]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18] +Condition : (isnull(ws_ship_customer_sk#16) AND isnotnull(ws_item_sk#15)) + +(19) BroadcastExchange +Input [4]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[3, int, true] as bigint)),false), [id=#19] + +(20) Scan parquet default.date_dim +Output [3]: [d_date_sk#20, d_year#21, d_qoy#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(21) ColumnarToRow +Input [3]: [d_date_sk#20, d_year#21, d_qoy#22] + +(22) Filter +Input [3]: [d_date_sk#20, d_year#21, d_qoy#22] +Condition : isnotnull(d_date_sk#20) + +(23) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ws_sold_date_sk#18] +Right keys [1]: [d_date_sk#20] +Join condition: None + +(24) Project [codegen id : 5] +Output [5]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, d_year#21, d_qoy#22] +Input [7]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18, d_date_sk#20, d_year#21, d_qoy#22] + +(25) BroadcastExchange +Input [5]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, d_year#21, d_qoy#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] + +(26) Scan parquet default.item +Output [2]: [i_item_sk#24, i_category#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(27) ColumnarToRow +Input [2]: [i_item_sk#24, i_category#25] + +(28) Filter +Input [2]: [i_item_sk#24, i_category#25] +Condition : isnotnull(i_item_sk#24) + +(29) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_item_sk#15] +Right keys [1]: [i_item_sk#24] +Join condition: None + +(30) Project [codegen id : 6] +Output [6]: [web AS channel#26, ws_ship_customer_sk#16 AS col_name#27, d_year#21, d_qoy#22, i_category#25, ws_ext_sales_price#17 AS ext_sales_price#28] +Input [7]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, d_year#21, d_qoy#22, i_item_sk#24, i_category#25] + +(31) Scan parquet default.catalog_sales +Output [4]: [cs_ship_addr_sk#29, cs_item_sk#30, cs_ext_sales_price#31, cs_sold_date_sk#32] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#32)] +PushedFilters: [IsNull(cs_ship_addr_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 9] +Input [4]: [cs_ship_addr_sk#29, cs_item_sk#30, cs_ext_sales_price#31, cs_sold_date_sk#32] + +(33) Filter [codegen id : 9] +Input [4]: [cs_ship_addr_sk#29, cs_item_sk#30, cs_ext_sales_price#31, cs_sold_date_sk#32] +Condition : (isnull(cs_ship_addr_sk#29) AND isnotnull(cs_item_sk#30)) + +(34) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#33, d_year#34, d_qoy#35] + +(35) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [cs_sold_date_sk#32] +Right keys [1]: [d_date_sk#33] +Join condition: None + +(36) Project [codegen id : 9] +Output [5]: [cs_ship_addr_sk#29, cs_item_sk#30, cs_ext_sales_price#31, d_year#34, d_qoy#35] +Input [7]: [cs_ship_addr_sk#29, cs_item_sk#30, cs_ext_sales_price#31, cs_sold_date_sk#32, d_date_sk#33, d_year#34, d_qoy#35] + +(37) ReusedExchange [Reuses operator id: 13] +Output [2]: [i_item_sk#36, i_category#37] + +(38) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [cs_item_sk#30] +Right keys [1]: [i_item_sk#36] +Join condition: None + +(39) Project [codegen id : 9] +Output [6]: [catalog AS channel#38, cs_ship_addr_sk#29 AS col_name#39, d_year#34, d_qoy#35, i_category#37, cs_ext_sales_price#31 AS ext_sales_price#40] +Input [7]: [cs_ship_addr_sk#29, cs_item_sk#30, cs_ext_sales_price#31, d_year#34, d_qoy#35, i_item_sk#36, i_category#37] + +(40) Union + +(41) HashAggregate [codegen id : 10] +Input [6]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, ext_sales_price#14] +Keys [5]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10] +Functions [2]: [partial_count(1), partial_sum(UnscaledValue(ext_sales_price#14))] +Aggregate Attributes [2]: [count#41, sum#42] +Results [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count#43, sum#44] + +(42) Exchange +Input [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count#43, sum#44] +Arguments: hashpartitioning(channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, 5), ENSURE_REQUIREMENTS, [id=#45] + +(43) HashAggregate [codegen id : 11] +Input [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count#43, sum#44] +Keys [5]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10] +Functions [2]: [count(1), sum(UnscaledValue(ext_sales_price#14))] +Aggregate Attributes [2]: [count(1)#46, sum(UnscaledValue(ext_sales_price#14))#47] +Results [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, count(1)#46 AS sales_cnt#48, MakeDecimal(sum(UnscaledValue(ext_sales_price#14))#47,17,2) AS sales_amt#49] + +(44) TakeOrderedAndProject +Input [7]: [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, sales_cnt#48, sales_amt#49] +Arguments: 100, [channel#12 ASC NULLS FIRST, col_name#13 ASC NULLS FIRST, d_year#6 ASC NULLS FIRST, d_qoy#7 ASC NULLS FIRST, i_category#10 ASC NULLS FIRST], [channel#12, col_name#13, d_year#6, d_qoy#7, i_category#10, sales_cnt#48, sales_amt#49] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/simplified.txt new file mode 100644 index 0000000000000..c866897775ede --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76.sf100/simplified.txt @@ -0,0 +1,68 @@ +TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_amt] + WholeStageCodegen (11) + HashAggregate [channel,col_name,d_year,d_qoy,i_category,count,sum] [count(1),sum(UnscaledValue(ext_sales_price)),sales_cnt,sales_amt,count,sum] + InputAdapter + Exchange [channel,col_name,d_year,d_qoy,i_category] #1 + WholeStageCodegen (10) + HashAggregate [channel,col_name,d_year,d_qoy,i_category,ext_sales_price] [count,sum,count,sum] + InputAdapter + Union + WholeStageCodegen (3) + Project [ss_store_sk,d_year,d_qoy,i_category,ss_ext_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_store_sk,ss_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_category] + WholeStageCodegen (6) + Project [ws_ship_customer_sk,d_year,d_qoy,i_category,ws_ext_sales_price] + BroadcastHashJoin [ws_item_sk,i_item_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (5) + Project [ws_item_sk,ws_ship_customer_sk,ws_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [ws_ship_customer_sk,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_ship_customer_sk,ws_ext_sales_price,ws_sold_date_sk] + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_category] + WholeStageCodegen (9) + Project [cs_ship_addr_sk,d_year,d_qoy,i_category,cs_ext_sales_price] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_ship_addr_sk,cs_item_sk,cs_ext_sales_price,d_year,d_qoy] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_ship_addr_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_addr_sk,cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #2 + InputAdapter + ReusedExchange [i_item_sk,i_category] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/explain.txt new file mode 100644 index 0000000000000..026c9396cd025 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/explain.txt @@ -0,0 +1,212 @@ +== Physical Plan == +TakeOrderedAndProject (38) ++- * HashAggregate (37) + +- Exchange (36) + +- * HashAggregate (35) + +- Union (34) + :- * Project (15) + : +- * BroadcastHashJoin Inner BuildRight (14) + : :- * Project (9) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.item (4) + : +- BroadcastExchange (13) + : +- * Filter (12) + : +- * ColumnarToRow (11) + : +- Scan parquet default.date_dim (10) + :- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (21) + : : +- * BroadcastHashJoin Inner BuildRight (20) + : : :- * Filter (18) + : : : +- * ColumnarToRow (17) + : : : +- Scan parquet default.web_sales (16) + : : +- ReusedExchange (19) + : +- ReusedExchange (22) + +- * Project (33) + +- * BroadcastHashJoin Inner BuildRight (32) + :- * Project (30) + : +- * BroadcastHashJoin Inner BuildRight (29) + : :- * Filter (27) + : : +- * ColumnarToRow (26) + : : +- Scan parquet default.catalog_sales (25) + : +- ReusedExchange (28) + +- ReusedExchange (31) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4)] +PushedFilters: [IsNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4] +Condition : (isnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.item +Output [2]: [i_item_sk#5, i_category#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [i_item_sk#5, i_category#6] + +(6) Filter [codegen id : 1] +Input [2]: [i_item_sk#5, i_category#6] +Condition : isnotnull(i_item_sk#5) + +(7) BroadcastExchange +Input [2]: [i_item_sk#5, i_category#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(9) Project [codegen id : 3] +Output [4]: [ss_store_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, i_category#6] +Input [6]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, i_item_sk#5, i_category#6] + +(10) Scan parquet default.date_dim +Output [3]: [d_date_sk#8, d_year#9, d_qoy#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#8, d_year#9, d_qoy#10] + +(12) Filter [codegen id : 2] +Input [3]: [d_date_sk#8, d_year#9, d_qoy#10] +Condition : isnotnull(d_date_sk#8) + +(13) BroadcastExchange +Input [3]: [d_date_sk#8, d_year#9, d_qoy#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(15) Project [codegen id : 3] +Output [6]: [store AS channel#12, ss_store_sk#2 AS col_name#13, d_year#9, d_qoy#10, i_category#6, ss_ext_sales_price#3 AS ext_sales_price#14] +Input [7]: [ss_store_sk#2, ss_ext_sales_price#3, ss_sold_date_sk#4, i_category#6, d_date_sk#8, d_year#9, d_qoy#10] + +(16) Scan parquet default.web_sales +Output [4]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#18)] +PushedFilters: [IsNull(ws_ship_customer_sk), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 6] +Input [4]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18] + +(18) Filter [codegen id : 6] +Input [4]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18] +Condition : (isnull(ws_ship_customer_sk#16) AND isnotnull(ws_item_sk#15)) + +(19) ReusedExchange [Reuses operator id: 7] +Output [2]: [i_item_sk#19, i_category#20] + +(20) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_item_sk#15] +Right keys [1]: [i_item_sk#19] +Join condition: None + +(21) Project [codegen id : 6] +Output [4]: [ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18, i_category#20] +Input [6]: [ws_item_sk#15, ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18, i_item_sk#19, i_category#20] + +(22) ReusedExchange [Reuses operator id: 13] +Output [3]: [d_date_sk#21, d_year#22, d_qoy#23] + +(23) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#18] +Right keys [1]: [d_date_sk#21] +Join condition: None + +(24) Project [codegen id : 6] +Output [6]: [web AS channel#24, ws_ship_customer_sk#16 AS col_name#25, d_year#22, d_qoy#23, i_category#20, ws_ext_sales_price#17 AS ext_sales_price#26] +Input [7]: [ws_ship_customer_sk#16, ws_ext_sales_price#17, ws_sold_date_sk#18, i_category#20, d_date_sk#21, d_year#22, d_qoy#23] + +(25) Scan parquet default.catalog_sales +Output [4]: [cs_ship_addr_sk#27, cs_item_sk#28, cs_ext_sales_price#29, cs_sold_date_sk#30] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#30)] +PushedFilters: [IsNull(cs_ship_addr_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 9] +Input [4]: [cs_ship_addr_sk#27, cs_item_sk#28, cs_ext_sales_price#29, cs_sold_date_sk#30] + +(27) Filter [codegen id : 9] +Input [4]: [cs_ship_addr_sk#27, cs_item_sk#28, cs_ext_sales_price#29, cs_sold_date_sk#30] +Condition : (isnull(cs_ship_addr_sk#27) AND isnotnull(cs_item_sk#28)) + +(28) ReusedExchange [Reuses operator id: 7] +Output [2]: [i_item_sk#31, i_category#32] + +(29) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [cs_item_sk#28] +Right keys [1]: [i_item_sk#31] +Join condition: None + +(30) Project [codegen id : 9] +Output [4]: [cs_ship_addr_sk#27, cs_ext_sales_price#29, cs_sold_date_sk#30, i_category#32] +Input [6]: [cs_ship_addr_sk#27, cs_item_sk#28, cs_ext_sales_price#29, cs_sold_date_sk#30, i_item_sk#31, i_category#32] + +(31) ReusedExchange [Reuses operator id: 13] +Output [3]: [d_date_sk#33, d_year#34, d_qoy#35] + +(32) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [cs_sold_date_sk#30] +Right keys [1]: [d_date_sk#33] +Join condition: None + +(33) Project [codegen id : 9] +Output [6]: [catalog AS channel#36, cs_ship_addr_sk#27 AS col_name#37, d_year#34, d_qoy#35, i_category#32, cs_ext_sales_price#29 AS ext_sales_price#38] +Input [7]: [cs_ship_addr_sk#27, cs_ext_sales_price#29, cs_sold_date_sk#30, i_category#32, d_date_sk#33, d_year#34, d_qoy#35] + +(34) Union + +(35) HashAggregate [codegen id : 10] +Input [6]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, ext_sales_price#14] +Keys [5]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6] +Functions [2]: [partial_count(1), partial_sum(UnscaledValue(ext_sales_price#14))] +Aggregate Attributes [2]: [count#39, sum#40] +Results [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, count#41, sum#42] + +(36) Exchange +Input [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, count#41, sum#42] +Arguments: hashpartitioning(channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, 5), ENSURE_REQUIREMENTS, [id=#43] + +(37) HashAggregate [codegen id : 11] +Input [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, count#41, sum#42] +Keys [5]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6] +Functions [2]: [count(1), sum(UnscaledValue(ext_sales_price#14))] +Aggregate Attributes [2]: [count(1)#44, sum(UnscaledValue(ext_sales_price#14))#45] +Results [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, count(1)#44 AS sales_cnt#46, MakeDecimal(sum(UnscaledValue(ext_sales_price#14))#45,17,2) AS sales_amt#47] + +(38) TakeOrderedAndProject +Input [7]: [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, sales_cnt#46, sales_amt#47] +Arguments: 100, [channel#12 ASC NULLS FIRST, col_name#13 ASC NULLS FIRST, d_year#9 ASC NULLS FIRST, d_qoy#10 ASC NULLS FIRST, i_category#6 ASC NULLS FIRST], [channel#12, col_name#13, d_year#9, d_qoy#10, i_category#6, sales_cnt#46, sales_amt#47] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/simplified.txt new file mode 100644 index 0000000000000..15a607c70b63f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q76/simplified.txt @@ -0,0 +1,58 @@ +TakeOrderedAndProject [channel,col_name,d_year,d_qoy,i_category,sales_cnt,sales_amt] + WholeStageCodegen (11) + HashAggregate [channel,col_name,d_year,d_qoy,i_category,count,sum] [count(1),sum(UnscaledValue(ext_sales_price)),sales_cnt,sales_amt,count,sum] + InputAdapter + Exchange [channel,col_name,d_year,d_qoy,i_category] #1 + WholeStageCodegen (10) + HashAggregate [channel,col_name,d_year,d_qoy,i_category,ext_sales_price] [count,sum,count,sum] + InputAdapter + Union + WholeStageCodegen (3) + Project [ss_store_sk,d_year,d_qoy,i_category,ss_ext_sales_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_store_sk,ss_ext_sales_price,ss_sold_date_sk,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_category] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + WholeStageCodegen (6) + Project [ws_ship_customer_sk,d_year,d_qoy,i_category,ws_ext_sales_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_ship_customer_sk,ws_ext_sales_price,ws_sold_date_sk,i_category] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_ship_customer_sk,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_ship_customer_sk,ws_ext_sales_price,ws_sold_date_sk] + InputAdapter + ReusedExchange [i_item_sk,i_category] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #3 + WholeStageCodegen (9) + Project [cs_ship_addr_sk,d_year,d_qoy,i_category,cs_ext_sales_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_ship_addr_sk,cs_ext_sales_price,cs_sold_date_sk,i_category] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_ship_addr_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_addr_sk,cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + InputAdapter + ReusedExchange [i_item_sk,i_category] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year,d_qoy] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt new file mode 100644 index 0000000000000..34d2ec82f500d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/explain.txt @@ -0,0 +1,534 @@ +== Physical Plan == +TakeOrderedAndProject (89) ++- * HashAggregate (88) + +- Exchange (87) + +- * HashAggregate (86) + +- * Expand (85) + +- Union (84) + :- * Project (34) + : +- * BroadcastHashJoin LeftOuter BuildRight (33) + : :- * HashAggregate (19) + : : +- Exchange (18) + : : +- * HashAggregate (17) + : : +- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (32) + : +- * HashAggregate (31) + : +- Exchange (30) + : +- * HashAggregate (29) + : +- * Project (28) + : +- * BroadcastHashJoin Inner BuildRight (27) + : :- * Project (25) + : : +- * BroadcastHashJoin Inner BuildRight (24) + : : :- * Filter (22) + : : : +- * ColumnarToRow (21) + : : : +- Scan parquet default.store_returns (20) + : : +- ReusedExchange (23) + : +- ReusedExchange (26) + :- * Project (53) + : +- * BroadcastNestedLoopJoin Inner BuildRight (52) + : :- * HashAggregate (42) + : : +- Exchange (41) + : : +- * HashAggregate (40) + : : +- * Project (39) + : : +- * BroadcastHashJoin Inner BuildRight (38) + : : :- * ColumnarToRow (36) + : : : +- Scan parquet default.catalog_sales (35) + : : +- ReusedExchange (37) + : +- BroadcastExchange (51) + : +- * HashAggregate (50) + : +- Exchange (49) + : +- * HashAggregate (48) + : +- * Project (47) + : +- * BroadcastHashJoin Inner BuildRight (46) + : :- * ColumnarToRow (44) + : : +- Scan parquet default.catalog_returns (43) + : +- ReusedExchange (45) + +- * Project (83) + +- * BroadcastHashJoin LeftOuter BuildRight (82) + :- * HashAggregate (68) + : +- Exchange (67) + : +- * HashAggregate (66) + : +- * Project (65) + : +- * BroadcastHashJoin Inner BuildRight (64) + : :- * Project (59) + : : +- * BroadcastHashJoin Inner BuildRight (58) + : : :- * Filter (56) + : : : +- * ColumnarToRow (55) + : : : +- Scan parquet default.web_sales (54) + : : +- ReusedExchange (57) + : +- BroadcastExchange (63) + : +- * Filter (62) + : +- * ColumnarToRow (61) + : +- Scan parquet default.web_page (60) + +- BroadcastExchange (81) + +- * HashAggregate (80) + +- Exchange (79) + +- * HashAggregate (78) + +- * Project (77) + +- * BroadcastHashJoin Inner BuildRight (76) + :- * Project (74) + : +- * BroadcastHashJoin Inner BuildRight (73) + : :- * Filter (71) + : : +- * ColumnarToRow (70) + : : +- Scan parquet default.web_returns (69) + : +- ReusedExchange (72) + +- ReusedExchange (75) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_date#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-08-03), LessThanOrEqual(d_date,2000-09-02), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_date#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_date#7] +Condition : (((isnotnull(d_date#7) AND (d_date#7 >= 2000-08-03)) AND (d_date#7 <= 2000-09-02)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_date#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3] +Input [5]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.store +Output [1]: [s_store_sk#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [1]: [s_store_sk#9] + +(13) Filter [codegen id : 2] +Input [1]: [s_store_sk#9] +Condition : isnotnull(s_store_sk#9) + +(14) BroadcastExchange +Input [1]: [s_store_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#9] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#9] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#9] + +(17) HashAggregate [codegen id : 3] +Input [3]: [ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#9] +Keys [1]: [s_store_sk#9] +Functions [2]: [partial_sum(UnscaledValue(ss_ext_sales_price#2)), partial_sum(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [2]: [sum#11, sum#12] +Results [3]: [s_store_sk#9, sum#13, sum#14] + +(18) Exchange +Input [3]: [s_store_sk#9, sum#13, sum#14] +Arguments: hashpartitioning(s_store_sk#9, 5), ENSURE_REQUIREMENTS, [id=#15] + +(19) HashAggregate [codegen id : 8] +Input [3]: [s_store_sk#9, sum#13, sum#14] +Keys [1]: [s_store_sk#9] +Functions [2]: [sum(UnscaledValue(ss_ext_sales_price#2)), sum(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_ext_sales_price#2))#16, sum(UnscaledValue(ss_net_profit#3))#17] +Results [3]: [s_store_sk#9, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#16,17,2) AS sales#18, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#17,17,2) AS profit#19] + +(20) Scan parquet default.store_returns +Output [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#23), dynamicpruningexpression(sr_returned_date_sk#23 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_store_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] + +(22) Filter [codegen id : 6] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] +Condition : isnotnull(sr_store_sk#20) + +(23) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#24] + +(24) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [sr_returned_date_sk#23] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(25) Project [codegen id : 6] +Output [3]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] +Input [5]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, d_date_sk#24] + +(26) ReusedExchange [Reuses operator id: 14] +Output [1]: [s_store_sk#25] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [sr_store_sk#20] +Right keys [1]: [s_store_sk#25] +Join condition: None + +(28) Project [codegen id : 6] +Output [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, s_store_sk#25] + +(29) HashAggregate [codegen id : 6] +Input [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] +Keys [1]: [s_store_sk#25] +Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#21)), partial_sum(UnscaledValue(sr_net_loss#22))] +Aggregate Attributes [2]: [sum#26, sum#27] +Results [3]: [s_store_sk#25, sum#28, sum#29] + +(30) Exchange +Input [3]: [s_store_sk#25, sum#28, sum#29] +Arguments: hashpartitioning(s_store_sk#25, 5), ENSURE_REQUIREMENTS, [id=#30] + +(31) HashAggregate [codegen id : 7] +Input [3]: [s_store_sk#25, sum#28, sum#29] +Keys [1]: [s_store_sk#25] +Functions [2]: [sum(UnscaledValue(sr_return_amt#21)), sum(UnscaledValue(sr_net_loss#22))] +Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#31, sum(UnscaledValue(sr_net_loss#22))#32] +Results [3]: [s_store_sk#25, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#31,17,2) AS returns#33, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#32,17,2) AS profit_loss#34] + +(32) BroadcastExchange +Input [3]: [s_store_sk#25, returns#33, profit_loss#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] + +(33) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [s_store_sk#9] +Right keys [1]: [s_store_sk#25] +Join condition: None + +(34) Project [codegen id : 8] +Output [5]: [sales#18, coalesce(returns#33, 0.00) AS returns#36, CheckOverflow((promote_precision(cast(profit#19 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#34, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#37, store channel AS channel#38, s_store_sk#9 AS id#39] +Input [6]: [s_store_sk#9, sales#18, profit#19, s_store_sk#25, returns#33, profit_loss#34] + +(35) Scan parquet default.catalog_sales +Output [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#43), dynamicpruningexpression(cs_sold_date_sk#43 IN dynamicpruning#5)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 10] +Input [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] + +(37) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#44] + +(38) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#43] +Right keys [1]: [d_date_sk#44] +Join condition: None + +(39) Project [codegen id : 10] +Output [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Input [5]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43, d_date_sk#44] + +(40) HashAggregate [codegen id : 10] +Input [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#41)), partial_sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum#45, sum#46] +Results [3]: [cs_call_center_sk#40, sum#47, sum#48] + +(41) Exchange +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Arguments: hashpartitioning(cs_call_center_sk#40, 5), ENSURE_REQUIREMENTS, [id=#49] + +(42) HashAggregate [codegen id : 14] +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#41)), sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#41))#50, sum(UnscaledValue(cs_net_profit#42))#51] +Results [3]: [cs_call_center_sk#40, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#41))#50,17,2) AS sales#52, MakeDecimal(sum(UnscaledValue(cs_net_profit#42))#51,17,2) AS profit#53] + +(43) Scan parquet default.catalog_returns +Output [3]: [cr_return_amount#54, cr_net_loss#55, cr_returned_date_sk#56] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#56), dynamicpruningexpression(cr_returned_date_sk#56 IN dynamicpruning#5)] +ReadSchema: struct + +(44) ColumnarToRow [codegen id : 12] +Input [3]: [cr_return_amount#54, cr_net_loss#55, cr_returned_date_sk#56] + +(45) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#57] + +(46) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [cr_returned_date_sk#56] +Right keys [1]: [d_date_sk#57] +Join condition: None + +(47) Project [codegen id : 12] +Output [2]: [cr_return_amount#54, cr_net_loss#55] +Input [4]: [cr_return_amount#54, cr_net_loss#55, cr_returned_date_sk#56, d_date_sk#57] + +(48) HashAggregate [codegen id : 12] +Input [2]: [cr_return_amount#54, cr_net_loss#55] +Keys: [] +Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#54)), partial_sum(UnscaledValue(cr_net_loss#55))] +Aggregate Attributes [2]: [sum#58, sum#59] +Results [2]: [sum#60, sum#61] + +(49) Exchange +Input [2]: [sum#60, sum#61] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#62] + +(50) HashAggregate [codegen id : 13] +Input [2]: [sum#60, sum#61] +Keys: [] +Functions [2]: [sum(UnscaledValue(cr_return_amount#54)), sum(UnscaledValue(cr_net_loss#55))] +Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#54))#63, sum(UnscaledValue(cr_net_loss#55))#64] +Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#54))#63,17,2) AS returns#65, MakeDecimal(sum(UnscaledValue(cr_net_loss#55))#64,17,2) AS profit_loss#66] + +(51) BroadcastExchange +Input [2]: [returns#65, profit_loss#66] +Arguments: IdentityBroadcastMode, [id=#67] + +(52) BroadcastNestedLoopJoin [codegen id : 14] +Join condition: None + +(53) Project [codegen id : 14] +Output [5]: [sales#52, returns#65, CheckOverflow((promote_precision(cast(profit#53 as decimal(18,2))) - promote_precision(cast(profit_loss#66 as decimal(18,2)))), DecimalType(18,2), true) AS profit#68, catalog channel AS channel#69, cs_call_center_sk#40 AS id#70] +Input [5]: [cs_call_center_sk#40, sales#52, profit#53, returns#65, profit_loss#66] + +(54) Scan parquet default.web_sales +Output [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#74), dynamicpruningexpression(ws_sold_date_sk#74 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_web_page_sk)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 17] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] + +(56) Filter [codegen id : 17] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] +Condition : isnotnull(ws_web_page_sk#71) + +(57) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#75] + +(58) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#74] +Right keys [1]: [d_date_sk#75] +Join condition: None + +(59) Project [codegen id : 17] +Output [3]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73] +Input [5]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74, d_date_sk#75] + +(60) Scan parquet default.web_page +Output [1]: [wp_web_page_sk#76] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_page] +PushedFilters: [IsNotNull(wp_web_page_sk)] +ReadSchema: struct + +(61) ColumnarToRow [codegen id : 16] +Input [1]: [wp_web_page_sk#76] + +(62) Filter [codegen id : 16] +Input [1]: [wp_web_page_sk#76] +Condition : isnotnull(wp_web_page_sk#76) + +(63) BroadcastExchange +Input [1]: [wp_web_page_sk#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#77] + +(64) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_web_page_sk#71] +Right keys [1]: [wp_web_page_sk#76] +Join condition: None + +(65) Project [codegen id : 17] +Output [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] + +(66) HashAggregate [codegen id : 17] +Input [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#72)), partial_sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum#78, sum#79] +Results [3]: [wp_web_page_sk#76, sum#80, sum#81] + +(67) Exchange +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Arguments: hashpartitioning(wp_web_page_sk#76, 5), ENSURE_REQUIREMENTS, [id=#82] + +(68) HashAggregate [codegen id : 22] +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#72)), sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#72))#83, sum(UnscaledValue(ws_net_profit#73))#84] +Results [3]: [wp_web_page_sk#76, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#72))#83,17,2) AS sales#85, MakeDecimal(sum(UnscaledValue(ws_net_profit#73))#84,17,2) AS profit#86] + +(69) Scan parquet default.web_returns +Output [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#90), dynamicpruningexpression(wr_returned_date_sk#90 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(wr_web_page_sk)] +ReadSchema: struct + +(70) ColumnarToRow [codegen id : 20] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] + +(71) Filter [codegen id : 20] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] +Condition : isnotnull(wr_web_page_sk#87) + +(72) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#91] + +(73) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [wr_returned_date_sk#90] +Right keys [1]: [d_date_sk#91] +Join condition: None + +(74) Project [codegen id : 20] +Output [3]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89] +Input [5]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90, d_date_sk#91] + +(75) ReusedExchange [Reuses operator id: 63] +Output [1]: [wp_web_page_sk#92] + +(76) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [wr_web_page_sk#87] +Right keys [1]: [wp_web_page_sk#92] +Join condition: None + +(77) Project [codegen id : 20] +Output [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] + +(78) HashAggregate [codegen id : 20] +Input [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Keys [1]: [wp_web_page_sk#92] +Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#88)), partial_sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum#93, sum#94] +Results [3]: [wp_web_page_sk#92, sum#95, sum#96] + +(79) Exchange +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Arguments: hashpartitioning(wp_web_page_sk#92, 5), ENSURE_REQUIREMENTS, [id=#97] + +(80) HashAggregate [codegen id : 21] +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Keys [1]: [wp_web_page_sk#92] +Functions [2]: [sum(UnscaledValue(wr_return_amt#88)), sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#88))#98, sum(UnscaledValue(wr_net_loss#89))#99] +Results [3]: [wp_web_page_sk#92, MakeDecimal(sum(UnscaledValue(wr_return_amt#88))#98,17,2) AS returns#100, MakeDecimal(sum(UnscaledValue(wr_net_loss#89))#99,17,2) AS profit_loss#101] + +(81) BroadcastExchange +Input [3]: [wp_web_page_sk#92, returns#100, profit_loss#101] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#102] + +(82) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [wp_web_page_sk#76] +Right keys [1]: [wp_web_page_sk#92] +Join condition: None + +(83) Project [codegen id : 22] +Output [5]: [sales#85, coalesce(returns#100, 0.00) AS returns#103, CheckOverflow((promote_precision(cast(profit#86 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#101, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#104, web channel AS channel#105, wp_web_page_sk#76 AS id#106] +Input [6]: [wp_web_page_sk#76, sales#85, profit#86, wp_web_page_sk#92, returns#100, profit_loss#101] + +(84) Union + +(85) Expand [codegen id : 23] +Input [5]: [sales#18, returns#36, profit#37, channel#38, id#39] +Arguments: [ArrayBuffer(sales#18, returns#36, profit#37, channel#38, id#39, 0), ArrayBuffer(sales#18, returns#36, profit#37, channel#38, null, 1), ArrayBuffer(sales#18, returns#36, profit#37, null, null, 3)], [sales#18, returns#36, profit#37, channel#107, id#108, spark_grouping_id#109] + +(86) HashAggregate [codegen id : 23] +Input [6]: [sales#18, returns#36, profit#37, channel#107, id#108, spark_grouping_id#109] +Keys [3]: [channel#107, id#108, spark_grouping_id#109] +Functions [3]: [partial_sum(sales#18), partial_sum(returns#36), partial_sum(profit#37)] +Aggregate Attributes [6]: [sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Results [9]: [channel#107, id#108, spark_grouping_id#109, sum#116, isEmpty#117, sum#118, isEmpty#119, sum#120, isEmpty#121] + +(87) Exchange +Input [9]: [channel#107, id#108, spark_grouping_id#109, sum#116, isEmpty#117, sum#118, isEmpty#119, sum#120, isEmpty#121] +Arguments: hashpartitioning(channel#107, id#108, spark_grouping_id#109, 5), ENSURE_REQUIREMENTS, [id=#122] + +(88) HashAggregate [codegen id : 24] +Input [9]: [channel#107, id#108, spark_grouping_id#109, sum#116, isEmpty#117, sum#118, isEmpty#119, sum#120, isEmpty#121] +Keys [3]: [channel#107, id#108, spark_grouping_id#109] +Functions [3]: [sum(sales#18), sum(returns#36), sum(profit#37)] +Aggregate Attributes [3]: [sum(sales#18)#123, sum(returns#36)#124, sum(profit#37)#125] +Results [5]: [channel#107, id#108, sum(sales#18)#123 AS sales#126, sum(returns#36)#124 AS returns#127, sum(profit#37)#125 AS profit#128] + +(89) TakeOrderedAndProject +Input [5]: [channel#107, id#108, sales#126, returns#127, profit#128] +Arguments: 100, [channel#107 ASC NULLS FIRST, id#108 ASC NULLS FIRST], [channel#107, id#108, sales#126, returns#127, profit#128] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (90) + + +(90) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 20 Hosting Expression = sr_returned_date_sk#23 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 35 Hosting Expression = cs_sold_date_sk#43 IN dynamicpruning#5 + +Subquery:4 Hosting operator id = 43 Hosting Expression = cr_returned_date_sk#56 IN dynamicpruning#5 + +Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#74 IN dynamicpruning#5 + +Subquery:6 Hosting operator id = 69 Hosting Expression = wr_returned_date_sk#90 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt new file mode 100644 index 0000000000000..d2fc07d0112f0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77.sf100/simplified.txt @@ -0,0 +1,143 @@ +TakeOrderedAndProject [channel,id,sales,returns,profit] + WholeStageCodegen (24) + HashAggregate [channel,id,spark_grouping_id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel,id,spark_grouping_id] #1 + WholeStageCodegen (23) + HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + Expand [sales,returns,profit,channel,id] + InputAdapter + Union + WholeStageCodegen (8) + Project [sales,returns,profit,profit_loss,s_store_sk] + BroadcastHashJoin [s_store_sk,s_store_sk] + HashAggregate [s_store_sk,sum,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(UnscaledValue(ss_net_profit)),sales,profit,sum,sum] + InputAdapter + Exchange [s_store_sk] #2 + WholeStageCodegen (3) + HashAggregate [s_store_sk,ss_ext_sales_price,ss_net_profit] [sum,sum,sum,sum] + Project [ss_ext_sales_price,ss_net_profit,s_store_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_ext_sales_price,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + HashAggregate [s_store_sk,sum,sum] [sum(UnscaledValue(sr_return_amt)),sum(UnscaledValue(sr_net_loss)),returns,profit_loss,sum,sum] + InputAdapter + Exchange [s_store_sk] #6 + WholeStageCodegen (6) + HashAggregate [s_store_sk,sr_return_amt,sr_net_loss] [sum,sum,sum,sum] + Project [sr_return_amt,sr_net_loss,s_store_sk] + BroadcastHashJoin [sr_store_sk,s_store_sk] + Project [sr_store_sk,sr_return_amt,sr_net_loss] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_store_sk,sr_return_amt,sr_net_loss,sr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [s_store_sk] #4 + WholeStageCodegen (14) + Project [sales,returns,profit,profit_loss,cs_call_center_sk] + BroadcastNestedLoopJoin + HashAggregate [cs_call_center_sk,sum,sum] [sum(UnscaledValue(cs_ext_sales_price)),sum(UnscaledValue(cs_net_profit)),sales,profit,sum,sum] + InputAdapter + Exchange [cs_call_center_sk] #7 + WholeStageCodegen (10) + HashAggregate [cs_call_center_sk,cs_ext_sales_price,cs_net_profit] [sum,sum,sum,sum] + Project [cs_call_center_sk,cs_ext_sales_price,cs_net_profit] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_call_center_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (13) + HashAggregate [sum,sum] [sum(UnscaledValue(cr_return_amount)),sum(UnscaledValue(cr_net_loss)),returns,profit_loss,sum,sum] + InputAdapter + Exchange #9 + WholeStageCodegen (12) + HashAggregate [cr_return_amount,cr_net_loss] [sum,sum,sum,sum] + Project [cr_return_amount,cr_net_loss] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_return_amount,cr_net_loss,cr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + WholeStageCodegen (22) + Project [sales,returns,profit,profit_loss,wp_web_page_sk] + BroadcastHashJoin [wp_web_page_sk,wp_web_page_sk] + HashAggregate [wp_web_page_sk,sum,sum] [sum(UnscaledValue(ws_ext_sales_price)),sum(UnscaledValue(ws_net_profit)),sales,profit,sum,sum] + InputAdapter + Exchange [wp_web_page_sk] #10 + WholeStageCodegen (17) + HashAggregate [wp_web_page_sk,ws_ext_sales_price,ws_net_profit] [sum,sum,sum,sum] + Project [ws_ext_sales_price,ws_net_profit,wp_web_page_sk] + BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] + Project [ws_web_page_sk,ws_ext_sales_price,ws_net_profit] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_web_page_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (16) + Filter [wp_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_page [wp_web_page_sk] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (21) + HashAggregate [wp_web_page_sk,sum,sum] [sum(UnscaledValue(wr_return_amt)),sum(UnscaledValue(wr_net_loss)),returns,profit_loss,sum,sum] + InputAdapter + Exchange [wp_web_page_sk] #13 + WholeStageCodegen (20) + HashAggregate [wp_web_page_sk,wr_return_amt,wr_net_loss] [sum,sum,sum,sum] + Project [wr_return_amt,wr_net_loss,wp_web_page_sk] + BroadcastHashJoin [wr_web_page_sk,wp_web_page_sk] + Project [wr_web_page_sk,wr_return_amt,wr_net_loss] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + Filter [wr_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_web_page_sk,wr_return_amt,wr_net_loss,wr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [wp_web_page_sk] #11 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt new file mode 100644 index 0000000000000..7c9c3589c275e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/explain.txt @@ -0,0 +1,534 @@ +== Physical Plan == +TakeOrderedAndProject (89) ++- * HashAggregate (88) + +- Exchange (87) + +- * HashAggregate (86) + +- * Expand (85) + +- Union (84) + :- * Project (34) + : +- * BroadcastHashJoin LeftOuter BuildRight (33) + : :- * HashAggregate (19) + : : +- Exchange (18) + : : +- * HashAggregate (17) + : : +- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (32) + : +- * HashAggregate (31) + : +- Exchange (30) + : +- * HashAggregate (29) + : +- * Project (28) + : +- * BroadcastHashJoin Inner BuildRight (27) + : :- * Project (25) + : : +- * BroadcastHashJoin Inner BuildRight (24) + : : :- * Filter (22) + : : : +- * ColumnarToRow (21) + : : : +- Scan parquet default.store_returns (20) + : : +- ReusedExchange (23) + : +- ReusedExchange (26) + :- * Project (53) + : +- * BroadcastNestedLoopJoin Inner BuildLeft (52) + : :- BroadcastExchange (43) + : : +- * HashAggregate (42) + : : +- Exchange (41) + : : +- * HashAggregate (40) + : : +- * Project (39) + : : +- * BroadcastHashJoin Inner BuildRight (38) + : : :- * ColumnarToRow (36) + : : : +- Scan parquet default.catalog_sales (35) + : : +- ReusedExchange (37) + : +- * HashAggregate (51) + : +- Exchange (50) + : +- * HashAggregate (49) + : +- * Project (48) + : +- * BroadcastHashJoin Inner BuildRight (47) + : :- * ColumnarToRow (45) + : : +- Scan parquet default.catalog_returns (44) + : +- ReusedExchange (46) + +- * Project (83) + +- * BroadcastHashJoin LeftOuter BuildRight (82) + :- * HashAggregate (68) + : +- Exchange (67) + : +- * HashAggregate (66) + : +- * Project (65) + : +- * BroadcastHashJoin Inner BuildRight (64) + : :- * Project (59) + : : +- * BroadcastHashJoin Inner BuildRight (58) + : : :- * Filter (56) + : : : +- * ColumnarToRow (55) + : : : +- Scan parquet default.web_sales (54) + : : +- ReusedExchange (57) + : +- BroadcastExchange (63) + : +- * Filter (62) + : +- * ColumnarToRow (61) + : +- Scan parquet default.web_page (60) + +- BroadcastExchange (81) + +- * HashAggregate (80) + +- Exchange (79) + +- * HashAggregate (78) + +- * Project (77) + +- * BroadcastHashJoin Inner BuildRight (76) + :- * Project (74) + : +- * BroadcastHashJoin Inner BuildRight (73) + : :- * Filter (71) + : : +- * ColumnarToRow (70) + : : +- Scan parquet default.web_returns (69) + : +- ReusedExchange (72) + +- ReusedExchange (75) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_date#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-08-03), LessThanOrEqual(d_date,2000-09-02), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_date#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_date#7] +Condition : (((isnotnull(d_date#7) AND (d_date#7 >= 2000-08-03)) AND (d_date#7 <= 2000-09-02)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_date#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3] +Input [5]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.store +Output [1]: [s_store_sk#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [1]: [s_store_sk#9] + +(13) Filter [codegen id : 2] +Input [1]: [s_store_sk#9] +Condition : isnotnull(s_store_sk#9) + +(14) BroadcastExchange +Input [1]: [s_store_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#9] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#9] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#9] + +(17) HashAggregate [codegen id : 3] +Input [3]: [ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#9] +Keys [1]: [s_store_sk#9] +Functions [2]: [partial_sum(UnscaledValue(ss_ext_sales_price#2)), partial_sum(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [2]: [sum#11, sum#12] +Results [3]: [s_store_sk#9, sum#13, sum#14] + +(18) Exchange +Input [3]: [s_store_sk#9, sum#13, sum#14] +Arguments: hashpartitioning(s_store_sk#9, 5), ENSURE_REQUIREMENTS, [id=#15] + +(19) HashAggregate [codegen id : 8] +Input [3]: [s_store_sk#9, sum#13, sum#14] +Keys [1]: [s_store_sk#9] +Functions [2]: [sum(UnscaledValue(ss_ext_sales_price#2)), sum(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_ext_sales_price#2))#16, sum(UnscaledValue(ss_net_profit#3))#17] +Results [3]: [s_store_sk#9, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#16,17,2) AS sales#18, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#17,17,2) AS profit#19] + +(20) Scan parquet default.store_returns +Output [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#23), dynamicpruningexpression(sr_returned_date_sk#23 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_store_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] + +(22) Filter [codegen id : 6] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] +Condition : isnotnull(sr_store_sk#20) + +(23) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#24] + +(24) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [sr_returned_date_sk#23] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(25) Project [codegen id : 6] +Output [3]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] +Input [5]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, d_date_sk#24] + +(26) ReusedExchange [Reuses operator id: 14] +Output [1]: [s_store_sk#25] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [sr_store_sk#20] +Right keys [1]: [s_store_sk#25] +Join condition: None + +(28) Project [codegen id : 6] +Output [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, s_store_sk#25] + +(29) HashAggregate [codegen id : 6] +Input [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] +Keys [1]: [s_store_sk#25] +Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#21)), partial_sum(UnscaledValue(sr_net_loss#22))] +Aggregate Attributes [2]: [sum#26, sum#27] +Results [3]: [s_store_sk#25, sum#28, sum#29] + +(30) Exchange +Input [3]: [s_store_sk#25, sum#28, sum#29] +Arguments: hashpartitioning(s_store_sk#25, 5), ENSURE_REQUIREMENTS, [id=#30] + +(31) HashAggregate [codegen id : 7] +Input [3]: [s_store_sk#25, sum#28, sum#29] +Keys [1]: [s_store_sk#25] +Functions [2]: [sum(UnscaledValue(sr_return_amt#21)), sum(UnscaledValue(sr_net_loss#22))] +Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#31, sum(UnscaledValue(sr_net_loss#22))#32] +Results [3]: [s_store_sk#25, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#31,17,2) AS returns#33, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#32,17,2) AS profit_loss#34] + +(32) BroadcastExchange +Input [3]: [s_store_sk#25, returns#33, profit_loss#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] + +(33) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [s_store_sk#9] +Right keys [1]: [s_store_sk#25] +Join condition: None + +(34) Project [codegen id : 8] +Output [5]: [sales#18, coalesce(returns#33, 0.00) AS returns#36, CheckOverflow((promote_precision(cast(profit#19 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#34, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#37, store channel AS channel#38, s_store_sk#9 AS id#39] +Input [6]: [s_store_sk#9, sales#18, profit#19, s_store_sk#25, returns#33, profit_loss#34] + +(35) Scan parquet default.catalog_sales +Output [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#43), dynamicpruningexpression(cs_sold_date_sk#43 IN dynamicpruning#5)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 10] +Input [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] + +(37) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#44] + +(38) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#43] +Right keys [1]: [d_date_sk#44] +Join condition: None + +(39) Project [codegen id : 10] +Output [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Input [5]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43, d_date_sk#44] + +(40) HashAggregate [codegen id : 10] +Input [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#41)), partial_sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum#45, sum#46] +Results [3]: [cs_call_center_sk#40, sum#47, sum#48] + +(41) Exchange +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Arguments: hashpartitioning(cs_call_center_sk#40, 5), ENSURE_REQUIREMENTS, [id=#49] + +(42) HashAggregate [codegen id : 11] +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#41)), sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#41))#50, sum(UnscaledValue(cs_net_profit#42))#51] +Results [3]: [cs_call_center_sk#40, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#41))#50,17,2) AS sales#52, MakeDecimal(sum(UnscaledValue(cs_net_profit#42))#51,17,2) AS profit#53] + +(43) BroadcastExchange +Input [3]: [cs_call_center_sk#40, sales#52, profit#53] +Arguments: IdentityBroadcastMode, [id=#54] + +(44) Scan parquet default.catalog_returns +Output [3]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#57), dynamicpruningexpression(cr_returned_date_sk#57 IN dynamicpruning#5)] +ReadSchema: struct + +(45) ColumnarToRow [codegen id : 13] +Input [3]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57] + +(46) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#58] + +(47) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [cr_returned_date_sk#57] +Right keys [1]: [d_date_sk#58] +Join condition: None + +(48) Project [codegen id : 13] +Output [2]: [cr_return_amount#55, cr_net_loss#56] +Input [4]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57, d_date_sk#58] + +(49) HashAggregate [codegen id : 13] +Input [2]: [cr_return_amount#55, cr_net_loss#56] +Keys: [] +Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#55)), partial_sum(UnscaledValue(cr_net_loss#56))] +Aggregate Attributes [2]: [sum#59, sum#60] +Results [2]: [sum#61, sum#62] + +(50) Exchange +Input [2]: [sum#61, sum#62] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#63] + +(51) HashAggregate +Input [2]: [sum#61, sum#62] +Keys: [] +Functions [2]: [sum(UnscaledValue(cr_return_amount#55)), sum(UnscaledValue(cr_net_loss#56))] +Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#55))#64, sum(UnscaledValue(cr_net_loss#56))#65] +Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#55))#64,17,2) AS returns#66, MakeDecimal(sum(UnscaledValue(cr_net_loss#56))#65,17,2) AS profit_loss#67] + +(52) BroadcastNestedLoopJoin [codegen id : 14] +Join condition: None + +(53) Project [codegen id : 14] +Output [5]: [sales#52, returns#66, CheckOverflow((promote_precision(cast(profit#53 as decimal(18,2))) - promote_precision(cast(profit_loss#67 as decimal(18,2)))), DecimalType(18,2), true) AS profit#68, catalog channel AS channel#69, cs_call_center_sk#40 AS id#70] +Input [5]: [cs_call_center_sk#40, sales#52, profit#53, returns#66, profit_loss#67] + +(54) Scan parquet default.web_sales +Output [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#74), dynamicpruningexpression(ws_sold_date_sk#74 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_web_page_sk)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 17] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] + +(56) Filter [codegen id : 17] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] +Condition : isnotnull(ws_web_page_sk#71) + +(57) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#75] + +(58) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#74] +Right keys [1]: [d_date_sk#75] +Join condition: None + +(59) Project [codegen id : 17] +Output [3]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73] +Input [5]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74, d_date_sk#75] + +(60) Scan parquet default.web_page +Output [1]: [wp_web_page_sk#76] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_page] +PushedFilters: [IsNotNull(wp_web_page_sk)] +ReadSchema: struct + +(61) ColumnarToRow [codegen id : 16] +Input [1]: [wp_web_page_sk#76] + +(62) Filter [codegen id : 16] +Input [1]: [wp_web_page_sk#76] +Condition : isnotnull(wp_web_page_sk#76) + +(63) BroadcastExchange +Input [1]: [wp_web_page_sk#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#77] + +(64) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_web_page_sk#71] +Right keys [1]: [wp_web_page_sk#76] +Join condition: None + +(65) Project [codegen id : 17] +Output [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] + +(66) HashAggregate [codegen id : 17] +Input [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#72)), partial_sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum#78, sum#79] +Results [3]: [wp_web_page_sk#76, sum#80, sum#81] + +(67) Exchange +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Arguments: hashpartitioning(wp_web_page_sk#76, 5), ENSURE_REQUIREMENTS, [id=#82] + +(68) HashAggregate [codegen id : 22] +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#72)), sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#72))#83, sum(UnscaledValue(ws_net_profit#73))#84] +Results [3]: [wp_web_page_sk#76, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#72))#83,17,2) AS sales#85, MakeDecimal(sum(UnscaledValue(ws_net_profit#73))#84,17,2) AS profit#86] + +(69) Scan parquet default.web_returns +Output [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#90), dynamicpruningexpression(wr_returned_date_sk#90 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(wr_web_page_sk)] +ReadSchema: struct + +(70) ColumnarToRow [codegen id : 20] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] + +(71) Filter [codegen id : 20] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] +Condition : isnotnull(wr_web_page_sk#87) + +(72) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#91] + +(73) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [wr_returned_date_sk#90] +Right keys [1]: [d_date_sk#91] +Join condition: None + +(74) Project [codegen id : 20] +Output [3]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89] +Input [5]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90, d_date_sk#91] + +(75) ReusedExchange [Reuses operator id: 63] +Output [1]: [wp_web_page_sk#92] + +(76) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [wr_web_page_sk#87] +Right keys [1]: [wp_web_page_sk#92] +Join condition: None + +(77) Project [codegen id : 20] +Output [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] + +(78) HashAggregate [codegen id : 20] +Input [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Keys [1]: [wp_web_page_sk#92] +Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#88)), partial_sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum#93, sum#94] +Results [3]: [wp_web_page_sk#92, sum#95, sum#96] + +(79) Exchange +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Arguments: hashpartitioning(wp_web_page_sk#92, 5), ENSURE_REQUIREMENTS, [id=#97] + +(80) HashAggregate [codegen id : 21] +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Keys [1]: [wp_web_page_sk#92] +Functions [2]: [sum(UnscaledValue(wr_return_amt#88)), sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#88))#98, sum(UnscaledValue(wr_net_loss#89))#99] +Results [3]: [wp_web_page_sk#92, MakeDecimal(sum(UnscaledValue(wr_return_amt#88))#98,17,2) AS returns#100, MakeDecimal(sum(UnscaledValue(wr_net_loss#89))#99,17,2) AS profit_loss#101] + +(81) BroadcastExchange +Input [3]: [wp_web_page_sk#92, returns#100, profit_loss#101] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#102] + +(82) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [wp_web_page_sk#76] +Right keys [1]: [wp_web_page_sk#92] +Join condition: None + +(83) Project [codegen id : 22] +Output [5]: [sales#85, coalesce(returns#100, 0.00) AS returns#103, CheckOverflow((promote_precision(cast(profit#86 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#101, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#104, web channel AS channel#105, wp_web_page_sk#76 AS id#106] +Input [6]: [wp_web_page_sk#76, sales#85, profit#86, wp_web_page_sk#92, returns#100, profit_loss#101] + +(84) Union + +(85) Expand [codegen id : 23] +Input [5]: [sales#18, returns#36, profit#37, channel#38, id#39] +Arguments: [ArrayBuffer(sales#18, returns#36, profit#37, channel#38, id#39, 0), ArrayBuffer(sales#18, returns#36, profit#37, channel#38, null, 1), ArrayBuffer(sales#18, returns#36, profit#37, null, null, 3)], [sales#18, returns#36, profit#37, channel#107, id#108, spark_grouping_id#109] + +(86) HashAggregate [codegen id : 23] +Input [6]: [sales#18, returns#36, profit#37, channel#107, id#108, spark_grouping_id#109] +Keys [3]: [channel#107, id#108, spark_grouping_id#109] +Functions [3]: [partial_sum(sales#18), partial_sum(returns#36), partial_sum(profit#37)] +Aggregate Attributes [6]: [sum#110, isEmpty#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Results [9]: [channel#107, id#108, spark_grouping_id#109, sum#116, isEmpty#117, sum#118, isEmpty#119, sum#120, isEmpty#121] + +(87) Exchange +Input [9]: [channel#107, id#108, spark_grouping_id#109, sum#116, isEmpty#117, sum#118, isEmpty#119, sum#120, isEmpty#121] +Arguments: hashpartitioning(channel#107, id#108, spark_grouping_id#109, 5), ENSURE_REQUIREMENTS, [id=#122] + +(88) HashAggregate [codegen id : 24] +Input [9]: [channel#107, id#108, spark_grouping_id#109, sum#116, isEmpty#117, sum#118, isEmpty#119, sum#120, isEmpty#121] +Keys [3]: [channel#107, id#108, spark_grouping_id#109] +Functions [3]: [sum(sales#18), sum(returns#36), sum(profit#37)] +Aggregate Attributes [3]: [sum(sales#18)#123, sum(returns#36)#124, sum(profit#37)#125] +Results [5]: [channel#107, id#108, sum(sales#18)#123 AS sales#126, sum(returns#36)#124 AS returns#127, sum(profit#37)#125 AS profit#128] + +(89) TakeOrderedAndProject +Input [5]: [channel#107, id#108, sales#126, returns#127, profit#128] +Arguments: 100, [channel#107 ASC NULLS FIRST, id#108 ASC NULLS FIRST], [channel#107, id#108, sales#126, returns#127, profit#128] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (90) + + +(90) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 20 Hosting Expression = sr_returned_date_sk#23 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 35 Hosting Expression = cs_sold_date_sk#43 IN dynamicpruning#5 + +Subquery:4 Hosting operator id = 44 Hosting Expression = cr_returned_date_sk#57 IN dynamicpruning#5 + +Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#74 IN dynamicpruning#5 + +Subquery:6 Hosting operator id = 69 Hosting Expression = wr_returned_date_sk#90 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt new file mode 100644 index 0000000000000..7c20631f0086a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q77/simplified.txt @@ -0,0 +1,143 @@ +TakeOrderedAndProject [channel,id,sales,returns,profit] + WholeStageCodegen (24) + HashAggregate [channel,id,spark_grouping_id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel,id,spark_grouping_id] #1 + WholeStageCodegen (23) + HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + Expand [sales,returns,profit,channel,id] + InputAdapter + Union + WholeStageCodegen (8) + Project [sales,returns,profit,profit_loss,s_store_sk] + BroadcastHashJoin [s_store_sk,s_store_sk] + HashAggregate [s_store_sk,sum,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(UnscaledValue(ss_net_profit)),sales,profit,sum,sum] + InputAdapter + Exchange [s_store_sk] #2 + WholeStageCodegen (3) + HashAggregate [s_store_sk,ss_ext_sales_price,ss_net_profit] [sum,sum,sum,sum] + Project [ss_ext_sales_price,ss_net_profit,s_store_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_ext_sales_price,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + HashAggregate [s_store_sk,sum,sum] [sum(UnscaledValue(sr_return_amt)),sum(UnscaledValue(sr_net_loss)),returns,profit_loss,sum,sum] + InputAdapter + Exchange [s_store_sk] #6 + WholeStageCodegen (6) + HashAggregate [s_store_sk,sr_return_amt,sr_net_loss] [sum,sum,sum,sum] + Project [sr_return_amt,sr_net_loss,s_store_sk] + BroadcastHashJoin [sr_store_sk,s_store_sk] + Project [sr_store_sk,sr_return_amt,sr_net_loss] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_store_sk,sr_return_amt,sr_net_loss,sr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [s_store_sk] #4 + WholeStageCodegen (14) + Project [sales,returns,profit,profit_loss,cs_call_center_sk] + BroadcastNestedLoopJoin + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (11) + HashAggregate [cs_call_center_sk,sum,sum] [sum(UnscaledValue(cs_ext_sales_price)),sum(UnscaledValue(cs_net_profit)),sales,profit,sum,sum] + InputAdapter + Exchange [cs_call_center_sk] #8 + WholeStageCodegen (10) + HashAggregate [cs_call_center_sk,cs_ext_sales_price,cs_net_profit] [sum,sum,sum,sum] + Project [cs_call_center_sk,cs_ext_sales_price,cs_net_profit] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_call_center_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + HashAggregate [sum,sum] [sum(UnscaledValue(cr_return_amount)),sum(UnscaledValue(cr_net_loss)),returns,profit_loss,sum,sum] + InputAdapter + Exchange #9 + WholeStageCodegen (13) + HashAggregate [cr_return_amount,cr_net_loss] [sum,sum,sum,sum] + Project [cr_return_amount,cr_net_loss] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_return_amount,cr_net_loss,cr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + WholeStageCodegen (22) + Project [sales,returns,profit,profit_loss,wp_web_page_sk] + BroadcastHashJoin [wp_web_page_sk,wp_web_page_sk] + HashAggregate [wp_web_page_sk,sum,sum] [sum(UnscaledValue(ws_ext_sales_price)),sum(UnscaledValue(ws_net_profit)),sales,profit,sum,sum] + InputAdapter + Exchange [wp_web_page_sk] #10 + WholeStageCodegen (17) + HashAggregate [wp_web_page_sk,ws_ext_sales_price,ws_net_profit] [sum,sum,sum,sum] + Project [ws_ext_sales_price,ws_net_profit,wp_web_page_sk] + BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] + Project [ws_web_page_sk,ws_ext_sales_price,ws_net_profit] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_web_page_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (16) + Filter [wp_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_page [wp_web_page_sk] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (21) + HashAggregate [wp_web_page_sk,sum,sum] [sum(UnscaledValue(wr_return_amt)),sum(UnscaledValue(wr_net_loss)),returns,profit_loss,sum,sum] + InputAdapter + Exchange [wp_web_page_sk] #13 + WholeStageCodegen (20) + HashAggregate [wp_web_page_sk,wr_return_amt,wr_net_loss] [sum,sum,sum,sum] + Project [wr_return_amt,wr_net_loss,wp_web_page_sk] + BroadcastHashJoin [wr_web_page_sk,wp_web_page_sk] + Project [wr_web_page_sk,wr_return_amt,wr_net_loss] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + Filter [wr_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_web_page_sk,wr_return_amt,wr_net_loss,wr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + ReusedExchange [wp_web_page_sk] #11 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt new file mode 100644 index 0000000000000..5ed24863c0e1d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/explain.txt @@ -0,0 +1,423 @@ +== Physical Plan == +TakeOrderedAndProject (73) ++- * Project (72) + +- * SortMergeJoin Inner (71) + :- * Project (48) + : +- * SortMergeJoin Inner (47) + : :- * Sort (24) + : : +- * HashAggregate (23) + : : +- Exchange (22) + : : +- * HashAggregate (21) + : : +- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Project (14) + : : : +- * Filter (13) + : : : +- * SortMergeJoin LeftOuter (12) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Sort (11) + : : : +- Exchange (10) + : : : +- * Project (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_returns (6) + : : +- BroadcastExchange (18) + : : +- * Filter (17) + : : +- * ColumnarToRow (16) + : : +- Scan parquet default.date_dim (15) + : +- * Sort (46) + : +- * Filter (45) + : +- * HashAggregate (44) + : +- Exchange (43) + : +- * HashAggregate (42) + : +- * Project (41) + : +- * BroadcastHashJoin Inner BuildRight (40) + : :- * Project (38) + : : +- * Filter (37) + : : +- * SortMergeJoin LeftOuter (36) + : : :- * Sort (29) + : : : +- Exchange (28) + : : : +- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.web_sales (25) + : : +- * Sort (35) + : : +- Exchange (34) + : : +- * Project (33) + : : +- * Filter (32) + : : +- * ColumnarToRow (31) + : : +- Scan parquet default.web_returns (30) + : +- ReusedExchange (39) + +- * Sort (70) + +- * Filter (69) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- * Project (65) + +- * BroadcastHashJoin Inner BuildRight (64) + :- * Project (62) + : +- * Filter (61) + : +- * SortMergeJoin LeftOuter (60) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Filter (51) + : : +- * ColumnarToRow (50) + : : +- Scan parquet default.catalog_sales (49) + : +- * Sort (59) + : +- Exchange (58) + : +- * Project (57) + : +- * Filter (56) + : +- * ColumnarToRow (55) + : +- Scan parquet default.catalog_returns (54) + +- ReusedExchange (63) + + +(1) Scan parquet default.store_sales +Output [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] + +(3) Filter [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_customer_sk#2)) + +(4) Exchange +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Arguments: hashpartitioning(ss_ticket_number#3, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] + +(5) Sort [codegen id : 2] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Arguments: [ss_ticket_number#3 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_returns +Output [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] + +(8) Filter [codegen id : 3] +Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] +Condition : (isnotnull(sr_ticket_number#11) AND isnotnull(sr_item_sk#10)) + +(9) Project [codegen id : 3] +Output [2]: [sr_item_sk#10, sr_ticket_number#11] +Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] + +(10) Exchange +Input [2]: [sr_item_sk#10, sr_ticket_number#11] +Arguments: hashpartitioning(sr_ticket_number#11, sr_item_sk#10, 5), ENSURE_REQUIREMENTS, [id=#13] + +(11) Sort [codegen id : 4] +Input [2]: [sr_item_sk#10, sr_ticket_number#11] +Arguments: [sr_ticket_number#11 ASC NULLS FIRST, sr_item_sk#10 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 6] +Left keys [2]: [ss_ticket_number#3, ss_item_sk#1] +Right keys [2]: [sr_ticket_number#11, sr_item_sk#10] +Join condition: None + +(13) Filter [codegen id : 6] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7, sr_item_sk#10, sr_ticket_number#11] +Condition : isnull(sr_ticket_number#11) + +(14) Project [codegen id : 6] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7, sr_item_sk#10, sr_ticket_number#11] + +(15) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#14, d_year#15] + +(17) Filter [codegen id : 5] +Input [2]: [d_date_sk#14, d_year#15] +Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2000)) AND isnotnull(d_date_sk#14)) + +(18) BroadcastExchange +Input [2]: [d_date_sk#14, d_year#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(19) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(20) Project [codegen id : 6] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#15] +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7, d_date_sk#14, d_year#15] + +(21) HashAggregate [codegen id : 6] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#15] +Keys [3]: [d_year#15, ss_item_sk#1, ss_customer_sk#2] +Functions [3]: [partial_sum(ss_quantity#4), partial_sum(UnscaledValue(ss_wholesale_cost#5)), partial_sum(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [3]: [sum#17, sum#18, sum#19] +Results [6]: [d_year#15, ss_item_sk#1, ss_customer_sk#2, sum#20, sum#21, sum#22] + +(22) Exchange +Input [6]: [d_year#15, ss_item_sk#1, ss_customer_sk#2, sum#20, sum#21, sum#22] +Arguments: hashpartitioning(d_year#15, ss_item_sk#1, ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#23] + +(23) HashAggregate [codegen id : 7] +Input [6]: [d_year#15, ss_item_sk#1, ss_customer_sk#2, sum#20, sum#21, sum#22] +Keys [3]: [d_year#15, ss_item_sk#1, ss_customer_sk#2] +Functions [3]: [sum(ss_quantity#4), sum(UnscaledValue(ss_wholesale_cost#5)), sum(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [3]: [sum(ss_quantity#4)#24, sum(UnscaledValue(ss_wholesale_cost#5))#25, sum(UnscaledValue(ss_sales_price#6))#26] +Results [6]: [d_year#15 AS ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, sum(ss_quantity#4)#24 AS ss_qty#28, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#5))#25,17,2) AS ss_wc#29, MakeDecimal(sum(UnscaledValue(ss_sales_price#6))#26,17,2) AS ss_sp#30] + +(24) Sort [codegen id : 7] +Input [6]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] +Arguments: [ss_sold_year#27 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.web_sales +Output [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#37), dynamicpruningexpression(ws_sold_date_sk#37 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 8] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] + +(27) Filter [codegen id : 8] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Condition : (isnotnull(ws_item_sk#31) AND isnotnull(ws_bill_customer_sk#32)) + +(28) Exchange +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Arguments: hashpartitioning(ws_order_number#33, ws_item_sk#31, 5), ENSURE_REQUIREMENTS, [id=#38] + +(29) Sort [codegen id : 9] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Arguments: [ws_order_number#33 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST], false, 0 + +(30) Scan parquet default.web_returns +Output [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 10] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] + +(32) Filter [codegen id : 10] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] +Condition : (isnotnull(wr_order_number#40) AND isnotnull(wr_item_sk#39)) + +(33) Project [codegen id : 10] +Output [2]: [wr_item_sk#39, wr_order_number#40] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] + +(34) Exchange +Input [2]: [wr_item_sk#39, wr_order_number#40] +Arguments: hashpartitioning(wr_order_number#40, wr_item_sk#39, 5), ENSURE_REQUIREMENTS, [id=#42] + +(35) Sort [codegen id : 11] +Input [2]: [wr_item_sk#39, wr_order_number#40] +Arguments: [wr_order_number#40 ASC NULLS FIRST, wr_item_sk#39 ASC NULLS FIRST], false, 0 + +(36) SortMergeJoin [codegen id : 13] +Left keys [2]: [ws_order_number#33, ws_item_sk#31] +Right keys [2]: [wr_order_number#40, wr_item_sk#39] +Join condition: None + +(37) Filter [codegen id : 13] +Input [9]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, wr_item_sk#39, wr_order_number#40] +Condition : isnull(wr_order_number#40) + +(38) Project [codegen id : 13] +Output [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Input [9]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, wr_item_sk#39, wr_order_number#40] + +(39) ReusedExchange [Reuses operator id: 18] +Output [2]: [d_date_sk#43, d_year#44] + +(40) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ws_sold_date_sk#37] +Right keys [1]: [d_date_sk#43] +Join condition: None + +(41) Project [codegen id : 13] +Output [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, d_year#44] +Input [8]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, d_date_sk#43, d_year#44] + +(42) HashAggregate [codegen id : 13] +Input [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, d_year#44] +Keys [3]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32] +Functions [3]: [partial_sum(ws_quantity#34), partial_sum(UnscaledValue(ws_wholesale_cost#35)), partial_sum(UnscaledValue(ws_sales_price#36))] +Aggregate Attributes [3]: [sum#45, sum#46, sum#47] +Results [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] + +(43) Exchange +Input [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] +Arguments: hashpartitioning(d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, 5), ENSURE_REQUIREMENTS, [id=#51] + +(44) HashAggregate [codegen id : 14] +Input [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] +Keys [3]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32] +Functions [3]: [sum(ws_quantity#34), sum(UnscaledValue(ws_wholesale_cost#35)), sum(UnscaledValue(ws_sales_price#36))] +Aggregate Attributes [3]: [sum(ws_quantity#34)#52, sum(UnscaledValue(ws_wholesale_cost#35))#53, sum(UnscaledValue(ws_sales_price#36))#54] +Results [6]: [d_year#44 AS ws_sold_year#55, ws_item_sk#31, ws_bill_customer_sk#32 AS ws_customer_sk#56, sum(ws_quantity#34)#52 AS ws_qty#57, MakeDecimal(sum(UnscaledValue(ws_wholesale_cost#35))#53,17,2) AS ws_wc#58, MakeDecimal(sum(UnscaledValue(ws_sales_price#36))#54,17,2) AS ws_sp#59] + +(45) Filter [codegen id : 14] +Input [6]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] +Condition : (coalesce(ws_qty#57, 0) > 0) + +(46) Sort [codegen id : 14] +Input [6]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] +Arguments: [ws_sold_year#55 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST, ws_customer_sk#56 ASC NULLS FIRST], false, 0 + +(47) SortMergeJoin [codegen id : 15] +Left keys [3]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2] +Right keys [3]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56] +Join condition: None + +(48) Project [codegen id : 15] +Output [9]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, ws_wc#58, ws_sp#59] +Input [12]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] + +(49) Scan parquet default.catalog_sales +Output [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#66), dynamicpruningexpression(cs_sold_date_sk#66 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 16] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] + +(51) Filter [codegen id : 16] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Condition : (isnotnull(cs_item_sk#61) AND isnotnull(cs_bill_customer_sk#60)) + +(52) Exchange +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Arguments: hashpartitioning(cs_order_number#62, cs_item_sk#61, 5), ENSURE_REQUIREMENTS, [id=#67] + +(53) Sort [codegen id : 17] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Arguments: [cs_order_number#62 ASC NULLS FIRST, cs_item_sk#61 ASC NULLS FIRST], false, 0 + +(54) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 18] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] + +(56) Filter [codegen id : 18] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] +Condition : (isnotnull(cr_order_number#69) AND isnotnull(cr_item_sk#68)) + +(57) Project [codegen id : 18] +Output [2]: [cr_item_sk#68, cr_order_number#69] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] + +(58) Exchange +Input [2]: [cr_item_sk#68, cr_order_number#69] +Arguments: hashpartitioning(cr_order_number#69, cr_item_sk#68, 5), ENSURE_REQUIREMENTS, [id=#71] + +(59) Sort [codegen id : 19] +Input [2]: [cr_item_sk#68, cr_order_number#69] +Arguments: [cr_order_number#69 ASC NULLS FIRST, cr_item_sk#68 ASC NULLS FIRST], false, 0 + +(60) SortMergeJoin [codegen id : 21] +Left keys [2]: [cs_order_number#62, cs_item_sk#61] +Right keys [2]: [cr_order_number#69, cr_item_sk#68] +Join condition: None + +(61) Filter [codegen id : 21] +Input [9]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, cr_item_sk#68, cr_order_number#69] +Condition : isnull(cr_order_number#69) + +(62) Project [codegen id : 21] +Output [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Input [9]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, cr_item_sk#68, cr_order_number#69] + +(63) ReusedExchange [Reuses operator id: 18] +Output [2]: [d_date_sk#72, d_year#73] + +(64) BroadcastHashJoin [codegen id : 21] +Left keys [1]: [cs_sold_date_sk#66] +Right keys [1]: [d_date_sk#72] +Join condition: None + +(65) Project [codegen id : 21] +Output [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, d_year#73] +Input [8]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, d_date_sk#72, d_year#73] + +(66) HashAggregate [codegen id : 21] +Input [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, d_year#73] +Keys [3]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60] +Functions [3]: [partial_sum(cs_quantity#63), partial_sum(UnscaledValue(cs_wholesale_cost#64)), partial_sum(UnscaledValue(cs_sales_price#65))] +Aggregate Attributes [3]: [sum#74, sum#75, sum#76] +Results [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] + +(67) Exchange +Input [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] +Arguments: hashpartitioning(d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, 5), ENSURE_REQUIREMENTS, [id=#80] + +(68) HashAggregate [codegen id : 22] +Input [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] +Keys [3]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60] +Functions [3]: [sum(cs_quantity#63), sum(UnscaledValue(cs_wholesale_cost#64)), sum(UnscaledValue(cs_sales_price#65))] +Aggregate Attributes [3]: [sum(cs_quantity#63)#81, sum(UnscaledValue(cs_wholesale_cost#64))#82, sum(UnscaledValue(cs_sales_price#65))#83] +Results [6]: [d_year#73 AS cs_sold_year#84, cs_item_sk#61, cs_bill_customer_sk#60 AS cs_customer_sk#85, sum(cs_quantity#63)#81 AS cs_qty#86, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#64))#82,17,2) AS cs_wc#87, MakeDecimal(sum(UnscaledValue(cs_sales_price#65))#83,17,2) AS cs_sp#88] + +(69) Filter [codegen id : 22] +Input [6]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] +Condition : (coalesce(cs_qty#86, 0) > 0) + +(70) Sort [codegen id : 22] +Input [6]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] +Arguments: [cs_sold_year#84 ASC NULLS FIRST, cs_item_sk#61 ASC NULLS FIRST, cs_customer_sk#85 ASC NULLS FIRST], false, 0 + +(71) SortMergeJoin [codegen id : 23] +Left keys [3]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2] +Right keys [3]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85] +Join condition: None + +(72) Project [codegen id : 23] +Output [12]: [round((cast(ss_qty#28 as double) / cast(coalesce((ws_qty#57 + cs_qty#86), 1) as double)), 2) AS ratio#89, ss_qty#28 AS store_qty#90, ss_wc#29 AS store_wholesale_cost#91, ss_sp#30 AS store_sales_price#92, (coalesce(ws_qty#57, 0) + coalesce(cs_qty#86, 0)) AS other_chan_qty#93, CheckOverflow((promote_precision(cast(coalesce(ws_wc#58, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#87, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#94, CheckOverflow((promote_precision(cast(coalesce(ws_sp#59, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#88, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#95, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, cs_qty#86] +Input [15]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, ws_wc#58, ws_sp#59, cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] + +(73) TakeOrderedAndProject +Input [12]: [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, cs_qty#86] +Arguments: 100, [ratio#89 ASC NULLS FIRST, ss_qty#28 DESC NULLS LAST, ss_wc#29 DESC NULLS LAST, ss_sp#30 DESC NULLS LAST, other_chan_qty#93 ASC NULLS FIRST, other_chan_wholesale_cost#94 ASC NULLS FIRST, other_chan_sales_price#95 ASC NULLS FIRST, round((cast(ss_qty#28 as double) / cast(coalesce((ws_qty#57 + cs_qty#86), 1) as double)), 2) ASC NULLS FIRST], [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (74) + + +(74) ReusedExchange [Reuses operator id: 18] +Output [2]: [d_date_sk#14, d_year#15] + +Subquery:2 Hosting operator id = 25 Hosting Expression = ws_sold_date_sk#37 IN dynamicpruning#8 + +Subquery:3 Hosting operator id = 49 Hosting Expression = cs_sold_date_sk#66 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt new file mode 100644 index 0000000000000..0aa69ab4645e4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78.sf100/simplified.txt @@ -0,0 +1,127 @@ +TakeOrderedAndProject [ratio,ss_qty,ss_wc,ss_sp,other_chan_qty,other_chan_wholesale_cost,other_chan_sales_price,ws_qty,cs_qty,store_qty,store_wholesale_cost,store_sales_price] + WholeStageCodegen (23) + Project [ss_qty,ws_qty,cs_qty,ss_wc,ss_sp,ws_wc,cs_wc,ws_sp,cs_sp] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,cs_sold_year,cs_item_sk,cs_customer_sk] + InputAdapter + WholeStageCodegen (15) + Project [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,ws_qty,ws_wc,ws_sp] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,ws_sold_year,ws_item_sk,ws_customer_sk] + InputAdapter + WholeStageCodegen (7) + Sort [ss_sold_year,ss_item_sk,ss_customer_sk] + HashAggregate [d_year,ss_item_sk,ss_customer_sk,sum,sum,sum] [sum(ss_quantity),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_sales_price)),ss_sold_year,ss_qty,ss_wc,ss_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,ss_item_sk,ss_customer_sk] #1 + WholeStageCodegen (6) + HashAggregate [d_year,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,ss_sold_date_sk] + Filter [sr_ticket_number] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #2 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + WholeStageCodegen (4) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #4 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (5) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (14) + Sort [ws_sold_year,ws_item_sk,ws_customer_sk] + Filter [ws_qty] + HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,sum,sum,sum] [sum(ws_quantity),sum(UnscaledValue(ws_wholesale_cost)),sum(UnscaledValue(ws_sales_price)),ws_sold_year,ws_customer_sk,ws_qty,ws_wc,ws_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,ws_item_sk,ws_bill_customer_sk] #5 + WholeStageCodegen (13) + HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] + Filter [wr_order_number] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (9) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #6 + WholeStageCodegen (8) + Filter [ws_item_sk,ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_order_number,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (11) + Sort [wr_order_number,wr_item_sk] + InputAdapter + Exchange [wr_order_number,wr_item_sk] #7 + WholeStageCodegen (10) + Project [wr_item_sk,wr_order_number] + Filter [wr_order_number,wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + WholeStageCodegen (22) + Sort [cs_sold_year,cs_item_sk,cs_customer_sk] + Filter [cs_qty] + HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,sum,sum,sum] [sum(cs_quantity),sum(UnscaledValue(cs_wholesale_cost)),sum(UnscaledValue(cs_sales_price)),cs_sold_year,cs_customer_sk,cs_qty,cs_wc,cs_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #8 + WholeStageCodegen (21) + HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,cs_quantity,cs_wholesale_cost,cs_sales_price] [sum,sum,sum,sum,sum,sum] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] + Filter [cr_order_number] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (17) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #9 + WholeStageCodegen (16) + Filter [cs_item_sk,cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (19) + Sort [cr_order_number,cr_item_sk] + InputAdapter + Exchange [cr_order_number,cr_item_sk] #10 + WholeStageCodegen (18) + Project [cr_item_sk,cr_order_number] + Filter [cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78/explain.txt new file mode 100644 index 0000000000000..5ed24863c0e1d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78/explain.txt @@ -0,0 +1,423 @@ +== Physical Plan == +TakeOrderedAndProject (73) ++- * Project (72) + +- * SortMergeJoin Inner (71) + :- * Project (48) + : +- * SortMergeJoin Inner (47) + : :- * Sort (24) + : : +- * HashAggregate (23) + : : +- Exchange (22) + : : +- * HashAggregate (21) + : : +- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Project (14) + : : : +- * Filter (13) + : : : +- * SortMergeJoin LeftOuter (12) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Sort (11) + : : : +- Exchange (10) + : : : +- * Project (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_returns (6) + : : +- BroadcastExchange (18) + : : +- * Filter (17) + : : +- * ColumnarToRow (16) + : : +- Scan parquet default.date_dim (15) + : +- * Sort (46) + : +- * Filter (45) + : +- * HashAggregate (44) + : +- Exchange (43) + : +- * HashAggregate (42) + : +- * Project (41) + : +- * BroadcastHashJoin Inner BuildRight (40) + : :- * Project (38) + : : +- * Filter (37) + : : +- * SortMergeJoin LeftOuter (36) + : : :- * Sort (29) + : : : +- Exchange (28) + : : : +- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.web_sales (25) + : : +- * Sort (35) + : : +- Exchange (34) + : : +- * Project (33) + : : +- * Filter (32) + : : +- * ColumnarToRow (31) + : : +- Scan parquet default.web_returns (30) + : +- ReusedExchange (39) + +- * Sort (70) + +- * Filter (69) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- * Project (65) + +- * BroadcastHashJoin Inner BuildRight (64) + :- * Project (62) + : +- * Filter (61) + : +- * SortMergeJoin LeftOuter (60) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Filter (51) + : : +- * ColumnarToRow (50) + : : +- Scan parquet default.catalog_sales (49) + : +- * Sort (59) + : +- Exchange (58) + : +- * Project (57) + : +- * Filter (56) + : +- * ColumnarToRow (55) + : +- Scan parquet default.catalog_returns (54) + +- ReusedExchange (63) + + +(1) Scan parquet default.store_sales +Output [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] + +(3) Filter [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_customer_sk#2)) + +(4) Exchange +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Arguments: hashpartitioning(ss_ticket_number#3, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] + +(5) Sort [codegen id : 2] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Arguments: [ss_ticket_number#3 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_returns +Output [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] + +(8) Filter [codegen id : 3] +Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] +Condition : (isnotnull(sr_ticket_number#11) AND isnotnull(sr_item_sk#10)) + +(9) Project [codegen id : 3] +Output [2]: [sr_item_sk#10, sr_ticket_number#11] +Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] + +(10) Exchange +Input [2]: [sr_item_sk#10, sr_ticket_number#11] +Arguments: hashpartitioning(sr_ticket_number#11, sr_item_sk#10, 5), ENSURE_REQUIREMENTS, [id=#13] + +(11) Sort [codegen id : 4] +Input [2]: [sr_item_sk#10, sr_ticket_number#11] +Arguments: [sr_ticket_number#11 ASC NULLS FIRST, sr_item_sk#10 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 6] +Left keys [2]: [ss_ticket_number#3, ss_item_sk#1] +Right keys [2]: [sr_ticket_number#11, sr_item_sk#10] +Join condition: None + +(13) Filter [codegen id : 6] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7, sr_item_sk#10, sr_ticket_number#11] +Condition : isnull(sr_ticket_number#11) + +(14) Project [codegen id : 6] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7, sr_item_sk#10, sr_ticket_number#11] + +(15) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#14, d_year#15] + +(17) Filter [codegen id : 5] +Input [2]: [d_date_sk#14, d_year#15] +Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2000)) AND isnotnull(d_date_sk#14)) + +(18) BroadcastExchange +Input [2]: [d_date_sk#14, d_year#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(19) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(20) Project [codegen id : 6] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#15] +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7, d_date_sk#14, d_year#15] + +(21) HashAggregate [codegen id : 6] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#15] +Keys [3]: [d_year#15, ss_item_sk#1, ss_customer_sk#2] +Functions [3]: [partial_sum(ss_quantity#4), partial_sum(UnscaledValue(ss_wholesale_cost#5)), partial_sum(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [3]: [sum#17, sum#18, sum#19] +Results [6]: [d_year#15, ss_item_sk#1, ss_customer_sk#2, sum#20, sum#21, sum#22] + +(22) Exchange +Input [6]: [d_year#15, ss_item_sk#1, ss_customer_sk#2, sum#20, sum#21, sum#22] +Arguments: hashpartitioning(d_year#15, ss_item_sk#1, ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#23] + +(23) HashAggregate [codegen id : 7] +Input [6]: [d_year#15, ss_item_sk#1, ss_customer_sk#2, sum#20, sum#21, sum#22] +Keys [3]: [d_year#15, ss_item_sk#1, ss_customer_sk#2] +Functions [3]: [sum(ss_quantity#4), sum(UnscaledValue(ss_wholesale_cost#5)), sum(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [3]: [sum(ss_quantity#4)#24, sum(UnscaledValue(ss_wholesale_cost#5))#25, sum(UnscaledValue(ss_sales_price#6))#26] +Results [6]: [d_year#15 AS ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, sum(ss_quantity#4)#24 AS ss_qty#28, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#5))#25,17,2) AS ss_wc#29, MakeDecimal(sum(UnscaledValue(ss_sales_price#6))#26,17,2) AS ss_sp#30] + +(24) Sort [codegen id : 7] +Input [6]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] +Arguments: [ss_sold_year#27 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.web_sales +Output [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#37), dynamicpruningexpression(ws_sold_date_sk#37 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 8] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] + +(27) Filter [codegen id : 8] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Condition : (isnotnull(ws_item_sk#31) AND isnotnull(ws_bill_customer_sk#32)) + +(28) Exchange +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Arguments: hashpartitioning(ws_order_number#33, ws_item_sk#31, 5), ENSURE_REQUIREMENTS, [id=#38] + +(29) Sort [codegen id : 9] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Arguments: [ws_order_number#33 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST], false, 0 + +(30) Scan parquet default.web_returns +Output [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 10] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] + +(32) Filter [codegen id : 10] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] +Condition : (isnotnull(wr_order_number#40) AND isnotnull(wr_item_sk#39)) + +(33) Project [codegen id : 10] +Output [2]: [wr_item_sk#39, wr_order_number#40] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] + +(34) Exchange +Input [2]: [wr_item_sk#39, wr_order_number#40] +Arguments: hashpartitioning(wr_order_number#40, wr_item_sk#39, 5), ENSURE_REQUIREMENTS, [id=#42] + +(35) Sort [codegen id : 11] +Input [2]: [wr_item_sk#39, wr_order_number#40] +Arguments: [wr_order_number#40 ASC NULLS FIRST, wr_item_sk#39 ASC NULLS FIRST], false, 0 + +(36) SortMergeJoin [codegen id : 13] +Left keys [2]: [ws_order_number#33, ws_item_sk#31] +Right keys [2]: [wr_order_number#40, wr_item_sk#39] +Join condition: None + +(37) Filter [codegen id : 13] +Input [9]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, wr_item_sk#39, wr_order_number#40] +Condition : isnull(wr_order_number#40) + +(38) Project [codegen id : 13] +Output [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Input [9]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, wr_item_sk#39, wr_order_number#40] + +(39) ReusedExchange [Reuses operator id: 18] +Output [2]: [d_date_sk#43, d_year#44] + +(40) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ws_sold_date_sk#37] +Right keys [1]: [d_date_sk#43] +Join condition: None + +(41) Project [codegen id : 13] +Output [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, d_year#44] +Input [8]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, d_date_sk#43, d_year#44] + +(42) HashAggregate [codegen id : 13] +Input [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, d_year#44] +Keys [3]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32] +Functions [3]: [partial_sum(ws_quantity#34), partial_sum(UnscaledValue(ws_wholesale_cost#35)), partial_sum(UnscaledValue(ws_sales_price#36))] +Aggregate Attributes [3]: [sum#45, sum#46, sum#47] +Results [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] + +(43) Exchange +Input [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] +Arguments: hashpartitioning(d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, 5), ENSURE_REQUIREMENTS, [id=#51] + +(44) HashAggregate [codegen id : 14] +Input [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] +Keys [3]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32] +Functions [3]: [sum(ws_quantity#34), sum(UnscaledValue(ws_wholesale_cost#35)), sum(UnscaledValue(ws_sales_price#36))] +Aggregate Attributes [3]: [sum(ws_quantity#34)#52, sum(UnscaledValue(ws_wholesale_cost#35))#53, sum(UnscaledValue(ws_sales_price#36))#54] +Results [6]: [d_year#44 AS ws_sold_year#55, ws_item_sk#31, ws_bill_customer_sk#32 AS ws_customer_sk#56, sum(ws_quantity#34)#52 AS ws_qty#57, MakeDecimal(sum(UnscaledValue(ws_wholesale_cost#35))#53,17,2) AS ws_wc#58, MakeDecimal(sum(UnscaledValue(ws_sales_price#36))#54,17,2) AS ws_sp#59] + +(45) Filter [codegen id : 14] +Input [6]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] +Condition : (coalesce(ws_qty#57, 0) > 0) + +(46) Sort [codegen id : 14] +Input [6]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] +Arguments: [ws_sold_year#55 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST, ws_customer_sk#56 ASC NULLS FIRST], false, 0 + +(47) SortMergeJoin [codegen id : 15] +Left keys [3]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2] +Right keys [3]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56] +Join condition: None + +(48) Project [codegen id : 15] +Output [9]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, ws_wc#58, ws_sp#59] +Input [12]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] + +(49) Scan parquet default.catalog_sales +Output [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#66), dynamicpruningexpression(cs_sold_date_sk#66 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 16] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] + +(51) Filter [codegen id : 16] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Condition : (isnotnull(cs_item_sk#61) AND isnotnull(cs_bill_customer_sk#60)) + +(52) Exchange +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Arguments: hashpartitioning(cs_order_number#62, cs_item_sk#61, 5), ENSURE_REQUIREMENTS, [id=#67] + +(53) Sort [codegen id : 17] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Arguments: [cs_order_number#62 ASC NULLS FIRST, cs_item_sk#61 ASC NULLS FIRST], false, 0 + +(54) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 18] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] + +(56) Filter [codegen id : 18] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] +Condition : (isnotnull(cr_order_number#69) AND isnotnull(cr_item_sk#68)) + +(57) Project [codegen id : 18] +Output [2]: [cr_item_sk#68, cr_order_number#69] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] + +(58) Exchange +Input [2]: [cr_item_sk#68, cr_order_number#69] +Arguments: hashpartitioning(cr_order_number#69, cr_item_sk#68, 5), ENSURE_REQUIREMENTS, [id=#71] + +(59) Sort [codegen id : 19] +Input [2]: [cr_item_sk#68, cr_order_number#69] +Arguments: [cr_order_number#69 ASC NULLS FIRST, cr_item_sk#68 ASC NULLS FIRST], false, 0 + +(60) SortMergeJoin [codegen id : 21] +Left keys [2]: [cs_order_number#62, cs_item_sk#61] +Right keys [2]: [cr_order_number#69, cr_item_sk#68] +Join condition: None + +(61) Filter [codegen id : 21] +Input [9]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, cr_item_sk#68, cr_order_number#69] +Condition : isnull(cr_order_number#69) + +(62) Project [codegen id : 21] +Output [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Input [9]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, cr_item_sk#68, cr_order_number#69] + +(63) ReusedExchange [Reuses operator id: 18] +Output [2]: [d_date_sk#72, d_year#73] + +(64) BroadcastHashJoin [codegen id : 21] +Left keys [1]: [cs_sold_date_sk#66] +Right keys [1]: [d_date_sk#72] +Join condition: None + +(65) Project [codegen id : 21] +Output [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, d_year#73] +Input [8]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, d_date_sk#72, d_year#73] + +(66) HashAggregate [codegen id : 21] +Input [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, d_year#73] +Keys [3]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60] +Functions [3]: [partial_sum(cs_quantity#63), partial_sum(UnscaledValue(cs_wholesale_cost#64)), partial_sum(UnscaledValue(cs_sales_price#65))] +Aggregate Attributes [3]: [sum#74, sum#75, sum#76] +Results [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] + +(67) Exchange +Input [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] +Arguments: hashpartitioning(d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, 5), ENSURE_REQUIREMENTS, [id=#80] + +(68) HashAggregate [codegen id : 22] +Input [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] +Keys [3]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60] +Functions [3]: [sum(cs_quantity#63), sum(UnscaledValue(cs_wholesale_cost#64)), sum(UnscaledValue(cs_sales_price#65))] +Aggregate Attributes [3]: [sum(cs_quantity#63)#81, sum(UnscaledValue(cs_wholesale_cost#64))#82, sum(UnscaledValue(cs_sales_price#65))#83] +Results [6]: [d_year#73 AS cs_sold_year#84, cs_item_sk#61, cs_bill_customer_sk#60 AS cs_customer_sk#85, sum(cs_quantity#63)#81 AS cs_qty#86, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#64))#82,17,2) AS cs_wc#87, MakeDecimal(sum(UnscaledValue(cs_sales_price#65))#83,17,2) AS cs_sp#88] + +(69) Filter [codegen id : 22] +Input [6]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] +Condition : (coalesce(cs_qty#86, 0) > 0) + +(70) Sort [codegen id : 22] +Input [6]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] +Arguments: [cs_sold_year#84 ASC NULLS FIRST, cs_item_sk#61 ASC NULLS FIRST, cs_customer_sk#85 ASC NULLS FIRST], false, 0 + +(71) SortMergeJoin [codegen id : 23] +Left keys [3]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2] +Right keys [3]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85] +Join condition: None + +(72) Project [codegen id : 23] +Output [12]: [round((cast(ss_qty#28 as double) / cast(coalesce((ws_qty#57 + cs_qty#86), 1) as double)), 2) AS ratio#89, ss_qty#28 AS store_qty#90, ss_wc#29 AS store_wholesale_cost#91, ss_sp#30 AS store_sales_price#92, (coalesce(ws_qty#57, 0) + coalesce(cs_qty#86, 0)) AS other_chan_qty#93, CheckOverflow((promote_precision(cast(coalesce(ws_wc#58, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#87, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#94, CheckOverflow((promote_precision(cast(coalesce(ws_sp#59, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#88, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#95, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, cs_qty#86] +Input [15]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, ws_wc#58, ws_sp#59, cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] + +(73) TakeOrderedAndProject +Input [12]: [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, cs_qty#86] +Arguments: 100, [ratio#89 ASC NULLS FIRST, ss_qty#28 DESC NULLS LAST, ss_wc#29 DESC NULLS LAST, ss_sp#30 DESC NULLS LAST, other_chan_qty#93 ASC NULLS FIRST, other_chan_wholesale_cost#94 ASC NULLS FIRST, other_chan_sales_price#95 ASC NULLS FIRST, round((cast(ss_qty#28 as double) / cast(coalesce((ws_qty#57 + cs_qty#86), 1) as double)), 2) ASC NULLS FIRST], [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (74) + + +(74) ReusedExchange [Reuses operator id: 18] +Output [2]: [d_date_sk#14, d_year#15] + +Subquery:2 Hosting operator id = 25 Hosting Expression = ws_sold_date_sk#37 IN dynamicpruning#8 + +Subquery:3 Hosting operator id = 49 Hosting Expression = cs_sold_date_sk#66 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78/simplified.txt new file mode 100644 index 0000000000000..0aa69ab4645e4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q78/simplified.txt @@ -0,0 +1,127 @@ +TakeOrderedAndProject [ratio,ss_qty,ss_wc,ss_sp,other_chan_qty,other_chan_wholesale_cost,other_chan_sales_price,ws_qty,cs_qty,store_qty,store_wholesale_cost,store_sales_price] + WholeStageCodegen (23) + Project [ss_qty,ws_qty,cs_qty,ss_wc,ss_sp,ws_wc,cs_wc,ws_sp,cs_sp] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,cs_sold_year,cs_item_sk,cs_customer_sk] + InputAdapter + WholeStageCodegen (15) + Project [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,ws_qty,ws_wc,ws_sp] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,ws_sold_year,ws_item_sk,ws_customer_sk] + InputAdapter + WholeStageCodegen (7) + Sort [ss_sold_year,ss_item_sk,ss_customer_sk] + HashAggregate [d_year,ss_item_sk,ss_customer_sk,sum,sum,sum] [sum(ss_quantity),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_sales_price)),ss_sold_year,ss_qty,ss_wc,ss_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,ss_item_sk,ss_customer_sk] #1 + WholeStageCodegen (6) + HashAggregate [d_year,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,ss_sold_date_sk] + Filter [sr_ticket_number] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #2 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + WholeStageCodegen (4) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #4 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (5) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (14) + Sort [ws_sold_year,ws_item_sk,ws_customer_sk] + Filter [ws_qty] + HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,sum,sum,sum] [sum(ws_quantity),sum(UnscaledValue(ws_wholesale_cost)),sum(UnscaledValue(ws_sales_price)),ws_sold_year,ws_customer_sk,ws_qty,ws_wc,ws_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,ws_item_sk,ws_bill_customer_sk] #5 + WholeStageCodegen (13) + HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] + Filter [wr_order_number] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (9) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #6 + WholeStageCodegen (8) + Filter [ws_item_sk,ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_order_number,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (11) + Sort [wr_order_number,wr_item_sk] + InputAdapter + Exchange [wr_order_number,wr_item_sk] #7 + WholeStageCodegen (10) + Project [wr_item_sk,wr_order_number] + Filter [wr_order_number,wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + WholeStageCodegen (22) + Sort [cs_sold_year,cs_item_sk,cs_customer_sk] + Filter [cs_qty] + HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,sum,sum,sum] [sum(cs_quantity),sum(UnscaledValue(cs_wholesale_cost)),sum(UnscaledValue(cs_sales_price)),cs_sold_year,cs_customer_sk,cs_qty,cs_wc,cs_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #8 + WholeStageCodegen (21) + HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,cs_quantity,cs_wholesale_cost,cs_sales_price] [sum,sum,sum,sum,sum,sum] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] + Filter [cr_order_number] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (17) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #9 + WholeStageCodegen (16) + Filter [cs_item_sk,cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (19) + Sort [cr_order_number,cr_item_sk] + InputAdapter + Exchange [cr_order_number,cr_item_sk] #10 + WholeStageCodegen (18) + Project [cr_item_sk,cr_order_number] + Filter [cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q79.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q79.sf100/explain.txt new file mode 100644 index 0000000000000..09a95c5df6e29 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q79.sf100/explain.txt @@ -0,0 +1,219 @@ +== Physical Plan == +TakeOrderedAndProject (37) ++- * Project (36) + +- * SortMergeJoin Inner (35) + :- * Sort (29) + : +- Exchange (28) + : +- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.household_demographics (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.store (18) + +- * Sort (34) + +- Exchange (33) + +- * Filter (32) + +- * ColumnarToRow (31) + +- Scan parquet default.customer (30) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 4] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_store_sk#4) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_dow#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dow), EqualTo(d_dow,1), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] +Condition : (((isnotnull(d_dow#12) AND (d_dow#12 = 1)) AND d_year#11 IN (1999,2000,2001)) AND isnotnull(d_date_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(8) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(10) Project [codegen id : 4] +Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8, d_date_sk#10] + +(11) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(EqualTo(hd_dep_count,6),GreaterThan(hd_vehicle_count,2)), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16] + +(13) Filter [codegen id : 2] +Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16] +Condition : (((hd_dep_count#15 = 6) OR (hd_vehicle_count#16 > 2)) AND isnotnull(hd_demo_sk#14)) + +(14) Project [codegen id : 2] +Output [1]: [hd_demo_sk#14] +Input [3]: [hd_demo_sk#14, hd_dep_count#15, hd_vehicle_count#16] + +(15) BroadcastExchange +Input [1]: [hd_demo_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#14] +Join condition: None + +(17) Project [codegen id : 4] +Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, hd_demo_sk#14] + +(18) Scan parquet default.store +Output [3]: [s_store_sk#18, s_number_employees#19, s_city#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_number_employees), GreaterThanOrEqual(s_number_employees,200), LessThanOrEqual(s_number_employees,295), IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [s_store_sk#18, s_number_employees#19, s_city#20] + +(20) Filter [codegen id : 3] +Input [3]: [s_store_sk#18, s_number_employees#19, s_city#20] +Condition : (((isnotnull(s_number_employees#19) AND (s_number_employees#19 >= 200)) AND (s_number_employees#19 <= 295)) AND isnotnull(s_store_sk#18)) + +(21) Project [codegen id : 3] +Output [2]: [s_store_sk#18, s_city#20] +Input [3]: [s_store_sk#18, s_number_employees#19, s_city#20] + +(22) BroadcastExchange +Input [2]: [s_store_sk#18, s_city#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#18] +Join condition: None + +(24) Project [codegen id : 4] +Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#20] +Input [8]: [ss_customer_sk#1, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_store_sk#18, s_city#20] + +(25) HashAggregate [codegen id : 4] +Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#20] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#20] +Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#6)), partial_sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum#22, sum#23] +Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#20, sum#24, sum#25] + +(26) Exchange +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#20, sum#24, sum#25] +Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#20, 5), ENSURE_REQUIREMENTS, [id=#26] + +(27) HashAggregate [codegen id : 5] +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#20, sum#24, sum#25] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#20] +Functions [2]: [sum(UnscaledValue(ss_coupon_amt#6)), sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#27, sum(UnscaledValue(ss_net_profit#7))#28] +Results [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#20, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#27,17,2) AS amt#29, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#28,17,2) AS profit#30] + +(28) Exchange +Input [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#20, amt#29, profit#30] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#31] + +(29) Sort [codegen id : 6] +Input [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#20, amt#29, profit#30] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(30) Scan parquet default.customer +Output [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 7] +Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] + +(32) Filter [codegen id : 7] +Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] +Condition : isnotnull(c_customer_sk#32) + +(33) Exchange +Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] +Arguments: hashpartitioning(c_customer_sk#32, 5), ENSURE_REQUIREMENTS, [id=#35] + +(34) Sort [codegen id : 8] +Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] +Arguments: [c_customer_sk#32 ASC NULLS FIRST], false, 0 + +(35) SortMergeJoin [codegen id : 9] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#32] +Join condition: None + +(36) Project [codegen id : 9] +Output [7]: [c_last_name#34, c_first_name#33, substr(s_city#20, 1, 30) AS substr(s_city, 1, 30)#36, ss_ticket_number#5, amt#29, profit#30, s_city#20] +Input [8]: [ss_ticket_number#5, ss_customer_sk#1, s_city#20, amt#29, profit#30, c_customer_sk#32, c_first_name#33, c_last_name#34] + +(37) TakeOrderedAndProject +Input [7]: [c_last_name#34, c_first_name#33, substr(s_city, 1, 30)#36, ss_ticket_number#5, amt#29, profit#30, s_city#20] +Arguments: 100, [c_last_name#34 ASC NULLS FIRST, c_first_name#33 ASC NULLS FIRST, substr(s_city#20, 1, 30) ASC NULLS FIRST, profit#30 ASC NULLS FIRST], [c_last_name#34, c_first_name#33, substr(s_city, 1, 30)#36, ss_ticket_number#5, amt#29, profit#30] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (38) + + +(38) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#10] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q79.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q79.sf100/simplified.txt new file mode 100644 index 0000000000000..bac3b763658f8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q79.sf100/simplified.txt @@ -0,0 +1,61 @@ +TakeOrderedAndProject [c_last_name,c_first_name,s_city,profit,substr(s_city, 1, 30),ss_ticket_number,amt] + WholeStageCodegen (9) + Project [c_last_name,c_first_name,s_city,ss_ticket_number,amt,profit] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #1 + WholeStageCodegen (5) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,s_city,sum,sum] [sum(UnscaledValue(ss_coupon_amt)),sum(UnscaledValue(ss_net_profit)),amt,profit,sum,sum] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,s_city] #2 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,s_city,ss_coupon_amt,ss_net_profit] [sum,sum,sum,sum] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,s_city] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dow,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dow] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [s_store_sk,s_city] + Filter [s_number_employees,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_number_employees,s_city] + InputAdapter + WholeStageCodegen (8) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #6 + WholeStageCodegen (7) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q79/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q79/explain.txt new file mode 100644 index 0000000000000..5602a2fddfde7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q79/explain.txt @@ -0,0 +1,204 @@ +== Physical Plan == +TakeOrderedAndProject (34) ++- * Project (33) + +- * BroadcastHashJoin Inner BuildRight (32) + :- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.household_demographics (18) + +- BroadcastExchange (31) + +- * Filter (30) + +- * ColumnarToRow (29) + +- Scan parquet default.customer (28) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 4] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_store_sk#4) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_dow#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_dow), EqualTo(d_dow,1), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] +Condition : (((isnotnull(d_dow#12) AND (d_dow#12 = 1)) AND d_year#11 IN (1999,2000,2001)) AND isnotnull(d_date_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_dow#12] + +(8) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(10) Project [codegen id : 4] +Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, ss_sold_date_sk#8, d_date_sk#10] + +(11) Scan parquet default.store +Output [3]: [s_store_sk#14, s_number_employees#15, s_city#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_number_employees), GreaterThanOrEqual(s_number_employees,200), LessThanOrEqual(s_number_employees,295), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [s_store_sk#14, s_number_employees#15, s_city#16] + +(13) Filter [codegen id : 2] +Input [3]: [s_store_sk#14, s_number_employees#15, s_city#16] +Condition : (((isnotnull(s_number_employees#15) AND (s_number_employees#15 >= 200)) AND (s_number_employees#15 <= 295)) AND isnotnull(s_store_sk#14)) + +(14) Project [codegen id : 2] +Output [2]: [s_store_sk#14, s_city#16] +Input [3]: [s_store_sk#14, s_number_employees#15, s_city#16] + +(15) BroadcastExchange +Input [2]: [s_store_sk#14, s_city#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#4] +Right keys [1]: [s_store_sk#14] +Join condition: None + +(17) Project [codegen id : 4] +Output [7]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#16] +Input [9]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_store_sk#4, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_store_sk#14, s_city#16] + +(18) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(EqualTo(hd_dep_count,6),GreaterThan(hd_vehicle_count,2)), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] + +(20) Filter [codegen id : 3] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] +Condition : (((hd_dep_count#19 = 6) OR (hd_vehicle_count#20 > 2)) AND isnotnull(hd_demo_sk#18)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#18] +Input [3]: [hd_demo_sk#18, hd_dep_count#19, hd_vehicle_count#20] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#18] +Join condition: None + +(24) Project [codegen id : 4] +Output [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#16] +Input [8]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#16, hd_demo_sk#18] + +(25) HashAggregate [codegen id : 4] +Input [6]: [ss_customer_sk#1, ss_addr_sk#3, ss_ticket_number#5, ss_coupon_amt#6, ss_net_profit#7, s_city#16] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16] +Functions [2]: [partial_sum(UnscaledValue(ss_coupon_amt#6)), partial_sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum#22, sum#23] +Results [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16, sum#24, sum#25] + +(26) Exchange +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16, sum#24, sum#25] +Arguments: hashpartitioning(ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16, 5), ENSURE_REQUIREMENTS, [id=#26] + +(27) HashAggregate [codegen id : 6] +Input [6]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16, sum#24, sum#25] +Keys [4]: [ss_ticket_number#5, ss_customer_sk#1, ss_addr_sk#3, s_city#16] +Functions [2]: [sum(UnscaledValue(ss_coupon_amt#6)), sum(UnscaledValue(ss_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_coupon_amt#6))#27, sum(UnscaledValue(ss_net_profit#7))#28] +Results [5]: [ss_ticket_number#5, ss_customer_sk#1, s_city#16, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#6))#27,17,2) AS amt#29, MakeDecimal(sum(UnscaledValue(ss_net_profit#7))#28,17,2) AS profit#30] + +(28) Scan parquet default.customer +Output [3]: [c_customer_sk#31, c_first_name#32, c_last_name#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 5] +Input [3]: [c_customer_sk#31, c_first_name#32, c_last_name#33] + +(30) Filter [codegen id : 5] +Input [3]: [c_customer_sk#31, c_first_name#32, c_last_name#33] +Condition : isnotnull(c_customer_sk#31) + +(31) BroadcastExchange +Input [3]: [c_customer_sk#31, c_first_name#32, c_last_name#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#34] + +(32) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#31] +Join condition: None + +(33) Project [codegen id : 6] +Output [7]: [c_last_name#33, c_first_name#32, substr(s_city#16, 1, 30) AS substr(s_city, 1, 30)#35, ss_ticket_number#5, amt#29, profit#30, s_city#16] +Input [8]: [ss_ticket_number#5, ss_customer_sk#1, s_city#16, amt#29, profit#30, c_customer_sk#31, c_first_name#32, c_last_name#33] + +(34) TakeOrderedAndProject +Input [7]: [c_last_name#33, c_first_name#32, substr(s_city, 1, 30)#35, ss_ticket_number#5, amt#29, profit#30, s_city#16] +Arguments: 100, [c_last_name#33 ASC NULLS FIRST, c_first_name#32 ASC NULLS FIRST, substr(s_city#16, 1, 30) ASC NULLS FIRST, profit#30 ASC NULLS FIRST], [c_last_name#33, c_first_name#32, substr(s_city, 1, 30)#35, ss_ticket_number#5, amt#29, profit#30] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#10] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q79/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q79/simplified.txt new file mode 100644 index 0000000000000..6432bc55bd8f3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q79/simplified.txt @@ -0,0 +1,52 @@ +TakeOrderedAndProject [c_last_name,c_first_name,s_city,profit,substr(s_city, 1, 30),ss_ticket_number,amt] + WholeStageCodegen (6) + Project [c_last_name,c_first_name,s_city,ss_ticket_number,amt,profit] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,s_city,sum,sum] [sum(UnscaledValue(ss_coupon_amt)),sum(UnscaledValue(ss_net_profit)),amt,profit,sum,sum] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk,ss_addr_sk,s_city] #1 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk,ss_addr_sk,s_city,ss_coupon_amt,ss_net_profit] [sum,sum,sum,sum] + Project [ss_customer_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,s_city] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,s_city] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_ticket_number,ss_coupon_amt,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dow,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dow] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [s_store_sk,s_city] + Filter [s_number_employees,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_number_employees,s_city] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (5) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q8.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q8.sf100/explain.txt new file mode 100644 index 0000000000000..d13b9623d1b34 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q8.sf100/explain.txt @@ -0,0 +1,313 @@ +== Physical Plan == +TakeOrderedAndProject (53) ++- * HashAggregate (52) + +- Exchange (51) + +- * HashAggregate (50) + +- * Project (49) + +- * SortMergeJoin Inner (48) + :- * Sort (18) + : +- Exchange (17) + : +- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.store (11) + +- * Sort (47) + +- Exchange (46) + +- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * Project (42) + +- * BroadcastHashJoin LeftSemi BuildRight (41) + :- * Filter (21) + : +- * ColumnarToRow (20) + : +- Scan parquet default.customer_address (19) + +- BroadcastExchange (40) + +- * Project (39) + +- * Filter (38) + +- * HashAggregate (37) + +- Exchange (36) + +- * HashAggregate (35) + +- * Project (34) + +- * SortMergeJoin Inner (33) + :- * Sort (26) + : +- Exchange (25) + : +- * Filter (24) + : +- * ColumnarToRow (23) + : +- Scan parquet default.customer_address (22) + +- * Sort (32) + +- Exchange (31) + +- * Project (30) + +- * Filter (29) + +- * ColumnarToRow (28) + +- Scan parquet default.customer (27) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,1998), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Condition : ((((isnotnull(d_qoy#7) AND isnotnull(d_year#6)) AND (d_qoy#7 = 2)) AND (d_year#6 = 1998)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 3] +Output [2]: [ss_store_sk#1, ss_net_profit#2] +Input [4]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3, d_date_sk#5] + +(11) Scan parquet default.store +Output [3]: [s_store_sk#9, s_store_name#10, s_zip#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [s_store_sk#9, s_store_name#10, s_zip#11] + +(13) Filter [codegen id : 2] +Input [3]: [s_store_sk#9, s_store_name#10, s_zip#11] +Condition : (isnotnull(s_store_sk#9) AND isnotnull(s_zip#11)) + +(14) BroadcastExchange +Input [3]: [s_store_sk#9, s_store_name#10, s_zip#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#9] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [ss_net_profit#2, s_store_name#10, s_zip#11] +Input [5]: [ss_store_sk#1, ss_net_profit#2, s_store_sk#9, s_store_name#10, s_zip#11] + +(17) Exchange +Input [3]: [ss_net_profit#2, s_store_name#10, s_zip#11] +Arguments: hashpartitioning(substr(s_zip#11, 1, 2), 5), ENSURE_REQUIREMENTS, [id=#13] + +(18) Sort [codegen id : 4] +Input [3]: [ss_net_profit#2, s_store_name#10, s_zip#11] +Arguments: [substr(s_zip#11, 1, 2) ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.customer_address +Output [1]: [ca_zip#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 11] +Input [1]: [ca_zip#14] + +(21) Filter [codegen id : 11] +Input [1]: [ca_zip#14] +Condition : (substr(ca_zip#14, 1, 5) INSET (56910,69952,63792,39371,74351,11101,25003,97189,57834,73134,62377,51200,32754,22752,86379,14171,91110,40162,98569,28709,13394,66162,25733,25782,26065,18383,51949,87343,50298,83849,33786,64528,23470,67030,46136,25280,46820,77721,99076,18426,31880,17871,98235,45748,49156,18652,72013,51622,43848,78567,41248,13695,44165,67853,54917,53179,64034,10567,71791,68908,55565,59402,64147,85816,57855,61547,27700,68100,28810,58263,15723,83933,51103,58058,90578,82276,81096,81426,96451,77556,38607,76638,18906,62971,57047,48425,35576,11928,30625,83444,73520,51650,57647,60099,30122,94983,24128,10445,41368,26233,26859,21756,24676,19849,36420,38193,58470,39127,13595,87501,24317,15455,69399,98025,81019,48033,11376,39516,67875,92712,14867,38122,29741,42961,30469,51211,56458,15559,16021,33123,33282,33515,72823,54601,76698,56240,72175,60279,20004,68806,72325,28488,43933,50412,45200,22246,78668,79777,96765,67301,73273,49448,82636,23932,47305,29839,39192,18799,61265,37125,58943,64457,88424,24610,84935,89360,68893,30431,28898,10336,90257,59166,46081,26105,96888,36634,86284,35258,39972,22927,73241,53268,24206,27385,99543,31671,14663,30903,39861,24996,63089,88086,83921,21076,67897,66708,45721,60576,25103,52867,30450,36233,30010,96576,73171,56571,56575,64544,13955,78451,43285,18119,16725,83041,76107,79994,54364,35942,56691,19769,63435,34102,18845,22744,13354,75691,45549,23968,31387,83144,13375,15765,28577,88190,19736,73650,37930,25989,83926,94898,51798,39736,22437,55253,38415,71256,18376,42029,25858,44438,19515,38935,51649,71954,15882,18767,63193,25486,49130,37126,40604,34425,17043,12305,11634,26653,94167,36446,10516,67473,66864,72425,63981,18842,22461,42666,47770,69035,70372,28587,45266,15371,15798,45375,90225,16807,31016,68014,21337,19505,50016,10144,84093,21286,19430,34322,91068,94945,72305,24671,58048,65084,28545,21195,20548,22245,77191,96976,48583,76231,15734,61810,11356,68621,68786,98359,41367,26689,69913,76614,68101,88885,50308,79077,18270,28915,29178,53672,62878,10390,14922,68341,56529,41766,68309,56616,15126,61860,97789,11489,45692,41918,72151,72550,27156,36495,70738,17879,53535,17920,68880,78890,35850,14089,58078,65164,27068,26231,13376,57665,32213,77610,87816,21309,15146,86198,91137,55307,67467,40558,94627,82136,22351,89091,20260,23006,91393,47537,62496,98294,18840,71286,81312,31029,70466,35458,14060,22685,28286,25631,19512,40081,63837,14328,35474,22152,76232,51061,86057,17183) AND isnotnull(substr(ca_zip#14, 1, 5))) + +(22) Scan parquet default.customer_address +Output [2]: [ca_address_sk#15, ca_zip#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 5] +Input [2]: [ca_address_sk#15, ca_zip#16] + +(24) Filter [codegen id : 5] +Input [2]: [ca_address_sk#15, ca_zip#16] +Condition : isnotnull(ca_address_sk#15) + +(25) Exchange +Input [2]: [ca_address_sk#15, ca_zip#16] +Arguments: hashpartitioning(ca_address_sk#15, 5), ENSURE_REQUIREMENTS, [id=#17] + +(26) Sort [codegen id : 6] +Input [2]: [ca_address_sk#15, ca_zip#16] +Arguments: [ca_address_sk#15 ASC NULLS FIRST], false, 0 + +(27) Scan parquet default.customer +Output [2]: [c_current_addr_sk#18, c_preferred_cust_flag#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_preferred_cust_flag), EqualTo(c_preferred_cust_flag,Y), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 7] +Input [2]: [c_current_addr_sk#18, c_preferred_cust_flag#19] + +(29) Filter [codegen id : 7] +Input [2]: [c_current_addr_sk#18, c_preferred_cust_flag#19] +Condition : ((isnotnull(c_preferred_cust_flag#19) AND (c_preferred_cust_flag#19 = Y)) AND isnotnull(c_current_addr_sk#18)) + +(30) Project [codegen id : 7] +Output [1]: [c_current_addr_sk#18] +Input [2]: [c_current_addr_sk#18, c_preferred_cust_flag#19] + +(31) Exchange +Input [1]: [c_current_addr_sk#18] +Arguments: hashpartitioning(c_current_addr_sk#18, 5), ENSURE_REQUIREMENTS, [id=#20] + +(32) Sort [codegen id : 8] +Input [1]: [c_current_addr_sk#18] +Arguments: [c_current_addr_sk#18 ASC NULLS FIRST], false, 0 + +(33) SortMergeJoin [codegen id : 9] +Left keys [1]: [ca_address_sk#15] +Right keys [1]: [c_current_addr_sk#18] +Join condition: None + +(34) Project [codegen id : 9] +Output [1]: [ca_zip#16] +Input [3]: [ca_address_sk#15, ca_zip#16, c_current_addr_sk#18] + +(35) HashAggregate [codegen id : 9] +Input [1]: [ca_zip#16] +Keys [1]: [ca_zip#16] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#21] +Results [2]: [ca_zip#16, count#22] + +(36) Exchange +Input [2]: [ca_zip#16, count#22] +Arguments: hashpartitioning(ca_zip#16, 5), ENSURE_REQUIREMENTS, [id=#23] + +(37) HashAggregate [codegen id : 10] +Input [2]: [ca_zip#16, count#22] +Keys [1]: [ca_zip#16] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#24] +Results [2]: [substr(ca_zip#16, 1, 5) AS ca_zip#25, count(1)#24 AS count(1)#26] + +(38) Filter [codegen id : 10] +Input [2]: [ca_zip#25, count(1)#26] +Condition : (count(1)#26 > 10) + +(39) Project [codegen id : 10] +Output [1]: [ca_zip#25] +Input [2]: [ca_zip#25, count(1)#26] + +(40) BroadcastExchange +Input [1]: [ca_zip#25] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, string, true], ), isnull(input[0, string, true])),false), [id=#27] + +(41) BroadcastHashJoin [codegen id : 11] +Left keys [2]: [coalesce(substr(ca_zip#14, 1, 5), ), isnull(substr(ca_zip#14, 1, 5))] +Right keys [2]: [coalesce(ca_zip#25, ), isnull(ca_zip#25)] +Join condition: None + +(42) Project [codegen id : 11] +Output [1]: [substr(ca_zip#14, 1, 5) AS ca_zip#28] +Input [1]: [ca_zip#14] + +(43) HashAggregate [codegen id : 11] +Input [1]: [ca_zip#28] +Keys [1]: [ca_zip#28] +Functions: [] +Aggregate Attributes: [] +Results [1]: [ca_zip#28] + +(44) Exchange +Input [1]: [ca_zip#28] +Arguments: hashpartitioning(ca_zip#28, 5), ENSURE_REQUIREMENTS, [id=#29] + +(45) HashAggregate [codegen id : 12] +Input [1]: [ca_zip#28] +Keys [1]: [ca_zip#28] +Functions: [] +Aggregate Attributes: [] +Results [1]: [ca_zip#28] + +(46) Exchange +Input [1]: [ca_zip#28] +Arguments: hashpartitioning(substr(ca_zip#28, 1, 2), 5), ENSURE_REQUIREMENTS, [id=#30] + +(47) Sort [codegen id : 13] +Input [1]: [ca_zip#28] +Arguments: [substr(ca_zip#28, 1, 2) ASC NULLS FIRST], false, 0 + +(48) SortMergeJoin [codegen id : 14] +Left keys [1]: [substr(s_zip#11, 1, 2)] +Right keys [1]: [substr(ca_zip#28, 1, 2)] +Join condition: None + +(49) Project [codegen id : 14] +Output [2]: [ss_net_profit#2, s_store_name#10] +Input [4]: [ss_net_profit#2, s_store_name#10, s_zip#11, ca_zip#28] + +(50) HashAggregate [codegen id : 14] +Input [2]: [ss_net_profit#2, s_store_name#10] +Keys [1]: [s_store_name#10] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum#31] +Results [2]: [s_store_name#10, sum#32] + +(51) Exchange +Input [2]: [s_store_name#10, sum#32] +Arguments: hashpartitioning(s_store_name#10, 5), ENSURE_REQUIREMENTS, [id=#33] + +(52) HashAggregate [codegen id : 15] +Input [2]: [s_store_name#10, sum#32] +Keys [1]: [s_store_name#10] +Functions [1]: [sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#2))#34] +Results [2]: [s_store_name#10, MakeDecimal(sum(UnscaledValue(ss_net_profit#2))#34,17,2) AS sum(ss_net_profit)#35] + +(53) TakeOrderedAndProject +Input [2]: [s_store_name#10, sum(ss_net_profit)#35] +Arguments: 100, [s_store_name#10 ASC NULLS FIRST], [s_store_name#10, sum(ss_net_profit)#35] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (54) + + +(54) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q8.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q8.sf100/simplified.txt new file mode 100644 index 0000000000000..88cc9c98e1ed7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q8.sf100/simplified.txt @@ -0,0 +1,90 @@ +TakeOrderedAndProject [s_store_name,sum(ss_net_profit)] + WholeStageCodegen (15) + HashAggregate [s_store_name,sum] [sum(UnscaledValue(ss_net_profit)),sum(ss_net_profit),sum] + InputAdapter + Exchange [s_store_name] #1 + WholeStageCodegen (14) + HashAggregate [s_store_name,ss_net_profit] [sum,sum] + Project [ss_net_profit,s_store_name] + SortMergeJoin [s_zip,ca_zip] + InputAdapter + WholeStageCodegen (4) + Sort [s_zip] + InputAdapter + Exchange [s_zip] #2 + WholeStageCodegen (3) + Project [ss_net_profit,s_store_name,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_zip] + InputAdapter + WholeStageCodegen (13) + Sort [ca_zip] + InputAdapter + Exchange [ca_zip] #5 + WholeStageCodegen (12) + HashAggregate [ca_zip] + InputAdapter + Exchange [ca_zip] #6 + WholeStageCodegen (11) + HashAggregate [ca_zip] + Project [ca_zip] + BroadcastHashJoin [ca_zip,ca_zip] + Filter [ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_zip] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (10) + Project [ca_zip] + Filter [count(1)] + HashAggregate [ca_zip,count] [count(1),ca_zip,count(1),count] + InputAdapter + Exchange [ca_zip] #8 + WholeStageCodegen (9) + HashAggregate [ca_zip] [count,count] + Project [ca_zip] + SortMergeJoin [ca_address_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #9 + WholeStageCodegen (5) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_zip] + InputAdapter + WholeStageCodegen (8) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #10 + WholeStageCodegen (7) + Project [c_current_addr_sk] + Filter [c_preferred_cust_flag,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_current_addr_sk,c_preferred_cust_flag] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q8/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q8/explain.txt new file mode 100644 index 0000000000000..dbb5e1f606a8d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q8/explain.txt @@ -0,0 +1,283 @@ +== Physical Plan == +TakeOrderedAndProject (47) ++- * HashAggregate (46) + +- Exchange (45) + +- * HashAggregate (44) + +- * Project (43) + +- * BroadcastHashJoin Inner BuildRight (42) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.store (11) + +- BroadcastExchange (41) + +- * HashAggregate (40) + +- Exchange (39) + +- * HashAggregate (38) + +- * Project (37) + +- * BroadcastHashJoin LeftSemi BuildRight (36) + :- * Filter (19) + : +- * ColumnarToRow (18) + : +- Scan parquet default.customer_address (17) + +- BroadcastExchange (35) + +- * Project (34) + +- * Filter (33) + +- * HashAggregate (32) + +- Exchange (31) + +- * HashAggregate (30) + +- * Project (29) + +- * BroadcastHashJoin Inner BuildRight (28) + :- * Filter (22) + : +- * ColumnarToRow (21) + : +- Scan parquet default.customer_address (20) + +- BroadcastExchange (27) + +- * Project (26) + +- * Filter (25) + +- * ColumnarToRow (24) + +- Scan parquet default.customer (23) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 8] +Input [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 8] +Input [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_qoy), IsNotNull(d_year), EqualTo(d_qoy,2), EqualTo(d_year,1998), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] +Condition : ((((isnotnull(d_qoy#7) AND isnotnull(d_year#6)) AND (d_qoy#7 = 2)) AND (d_year#6 = 1998)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [3]: [d_date_sk#5, d_year#6, d_qoy#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 8] +Output [2]: [ss_store_sk#1, ss_net_profit#2] +Input [4]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3, d_date_sk#5] + +(11) Scan parquet default.store +Output [3]: [s_store_sk#9, s_store_name#10, s_zip#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [s_store_sk#9, s_store_name#10, s_zip#11] + +(13) Filter [codegen id : 2] +Input [3]: [s_store_sk#9, s_store_name#10, s_zip#11] +Condition : (isnotnull(s_store_sk#9) AND isnotnull(s_zip#11)) + +(14) BroadcastExchange +Input [3]: [s_store_sk#9, s_store_name#10, s_zip#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] + +(15) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#9] +Join condition: None + +(16) Project [codegen id : 8] +Output [3]: [ss_net_profit#2, s_store_name#10, s_zip#11] +Input [5]: [ss_store_sk#1, ss_net_profit#2, s_store_sk#9, s_store_name#10, s_zip#11] + +(17) Scan parquet default.customer_address +Output [1]: [ca_zip#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 6] +Input [1]: [ca_zip#13] + +(19) Filter [codegen id : 6] +Input [1]: [ca_zip#13] +Condition : (substr(ca_zip#13, 1, 5) INSET (56910,69952,63792,39371,74351,11101,25003,97189,57834,73134,62377,51200,32754,22752,86379,14171,91110,40162,98569,28709,13394,66162,25733,25782,26065,18383,51949,87343,50298,83849,33786,64528,23470,67030,46136,25280,46820,77721,99076,18426,31880,17871,98235,45748,49156,18652,72013,51622,43848,78567,41248,13695,44165,67853,54917,53179,64034,10567,71791,68908,55565,59402,64147,85816,57855,61547,27700,68100,28810,58263,15723,83933,51103,58058,90578,82276,81096,81426,96451,77556,38607,76638,18906,62971,57047,48425,35576,11928,30625,83444,73520,51650,57647,60099,30122,94983,24128,10445,41368,26233,26859,21756,24676,19849,36420,38193,58470,39127,13595,87501,24317,15455,69399,98025,81019,48033,11376,39516,67875,92712,14867,38122,29741,42961,30469,51211,56458,15559,16021,33123,33282,33515,72823,54601,76698,56240,72175,60279,20004,68806,72325,28488,43933,50412,45200,22246,78668,79777,96765,67301,73273,49448,82636,23932,47305,29839,39192,18799,61265,37125,58943,64457,88424,24610,84935,89360,68893,30431,28898,10336,90257,59166,46081,26105,96888,36634,86284,35258,39972,22927,73241,53268,24206,27385,99543,31671,14663,30903,39861,24996,63089,88086,83921,21076,67897,66708,45721,60576,25103,52867,30450,36233,30010,96576,73171,56571,56575,64544,13955,78451,43285,18119,16725,83041,76107,79994,54364,35942,56691,19769,63435,34102,18845,22744,13354,75691,45549,23968,31387,83144,13375,15765,28577,88190,19736,73650,37930,25989,83926,94898,51798,39736,22437,55253,38415,71256,18376,42029,25858,44438,19515,38935,51649,71954,15882,18767,63193,25486,49130,37126,40604,34425,17043,12305,11634,26653,94167,36446,10516,67473,66864,72425,63981,18842,22461,42666,47770,69035,70372,28587,45266,15371,15798,45375,90225,16807,31016,68014,21337,19505,50016,10144,84093,21286,19430,34322,91068,94945,72305,24671,58048,65084,28545,21195,20548,22245,77191,96976,48583,76231,15734,61810,11356,68621,68786,98359,41367,26689,69913,76614,68101,88885,50308,79077,18270,28915,29178,53672,62878,10390,14922,68341,56529,41766,68309,56616,15126,61860,97789,11489,45692,41918,72151,72550,27156,36495,70738,17879,53535,17920,68880,78890,35850,14089,58078,65164,27068,26231,13376,57665,32213,77610,87816,21309,15146,86198,91137,55307,67467,40558,94627,82136,22351,89091,20260,23006,91393,47537,62496,98294,18840,71286,81312,31029,70466,35458,14060,22685,28286,25631,19512,40081,63837,14328,35474,22152,76232,51061,86057,17183) AND isnotnull(substr(ca_zip#13, 1, 5))) + +(20) Scan parquet default.customer_address +Output [2]: [ca_address_sk#14, ca_zip#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 4] +Input [2]: [ca_address_sk#14, ca_zip#15] + +(22) Filter [codegen id : 4] +Input [2]: [ca_address_sk#14, ca_zip#15] +Condition : isnotnull(ca_address_sk#14) + +(23) Scan parquet default.customer +Output [2]: [c_current_addr_sk#16, c_preferred_cust_flag#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_preferred_cust_flag), EqualTo(c_preferred_cust_flag,Y), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 3] +Input [2]: [c_current_addr_sk#16, c_preferred_cust_flag#17] + +(25) Filter [codegen id : 3] +Input [2]: [c_current_addr_sk#16, c_preferred_cust_flag#17] +Condition : ((isnotnull(c_preferred_cust_flag#17) AND (c_preferred_cust_flag#17 = Y)) AND isnotnull(c_current_addr_sk#16)) + +(26) Project [codegen id : 3] +Output [1]: [c_current_addr_sk#16] +Input [2]: [c_current_addr_sk#16, c_preferred_cust_flag#17] + +(27) BroadcastExchange +Input [1]: [c_current_addr_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(28) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ca_address_sk#14] +Right keys [1]: [c_current_addr_sk#16] +Join condition: None + +(29) Project [codegen id : 4] +Output [1]: [ca_zip#15] +Input [3]: [ca_address_sk#14, ca_zip#15, c_current_addr_sk#16] + +(30) HashAggregate [codegen id : 4] +Input [1]: [ca_zip#15] +Keys [1]: [ca_zip#15] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#19] +Results [2]: [ca_zip#15, count#20] + +(31) Exchange +Input [2]: [ca_zip#15, count#20] +Arguments: hashpartitioning(ca_zip#15, 5), ENSURE_REQUIREMENTS, [id=#21] + +(32) HashAggregate [codegen id : 5] +Input [2]: [ca_zip#15, count#20] +Keys [1]: [ca_zip#15] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#22] +Results [2]: [substr(ca_zip#15, 1, 5) AS ca_zip#23, count(1)#22 AS count(1)#24] + +(33) Filter [codegen id : 5] +Input [2]: [ca_zip#23, count(1)#24] +Condition : (count(1)#24 > 10) + +(34) Project [codegen id : 5] +Output [1]: [ca_zip#23] +Input [2]: [ca_zip#23, count(1)#24] + +(35) BroadcastExchange +Input [1]: [ca_zip#23] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, string, true], ), isnull(input[0, string, true])),false), [id=#25] + +(36) BroadcastHashJoin [codegen id : 6] +Left keys [2]: [coalesce(substr(ca_zip#13, 1, 5), ), isnull(substr(ca_zip#13, 1, 5))] +Right keys [2]: [coalesce(ca_zip#23, ), isnull(ca_zip#23)] +Join condition: None + +(37) Project [codegen id : 6] +Output [1]: [substr(ca_zip#13, 1, 5) AS ca_zip#26] +Input [1]: [ca_zip#13] + +(38) HashAggregate [codegen id : 6] +Input [1]: [ca_zip#26] +Keys [1]: [ca_zip#26] +Functions: [] +Aggregate Attributes: [] +Results [1]: [ca_zip#26] + +(39) Exchange +Input [1]: [ca_zip#26] +Arguments: hashpartitioning(ca_zip#26, 5), ENSURE_REQUIREMENTS, [id=#27] + +(40) HashAggregate [codegen id : 7] +Input [1]: [ca_zip#26] +Keys [1]: [ca_zip#26] +Functions: [] +Aggregate Attributes: [] +Results [1]: [ca_zip#26] + +(41) BroadcastExchange +Input [1]: [ca_zip#26] +Arguments: HashedRelationBroadcastMode(List(substr(input[0, string, true], 1, 2)),false), [id=#28] + +(42) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [substr(s_zip#11, 1, 2)] +Right keys [1]: [substr(ca_zip#26, 1, 2)] +Join condition: None + +(43) Project [codegen id : 8] +Output [2]: [ss_net_profit#2, s_store_name#10] +Input [4]: [ss_net_profit#2, s_store_name#10, s_zip#11, ca_zip#26] + +(44) HashAggregate [codegen id : 8] +Input [2]: [ss_net_profit#2, s_store_name#10] +Keys [1]: [s_store_name#10] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum#29] +Results [2]: [s_store_name#10, sum#30] + +(45) Exchange +Input [2]: [s_store_name#10, sum#30] +Arguments: hashpartitioning(s_store_name#10, 5), ENSURE_REQUIREMENTS, [id=#31] + +(46) HashAggregate [codegen id : 9] +Input [2]: [s_store_name#10, sum#30] +Keys [1]: [s_store_name#10] +Functions [1]: [sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#2))#32] +Results [2]: [s_store_name#10, MakeDecimal(sum(UnscaledValue(ss_net_profit#2))#32,17,2) AS sum(ss_net_profit)#33] + +(47) TakeOrderedAndProject +Input [2]: [s_store_name#10, sum(ss_net_profit)#33] +Arguments: 100, [s_store_name#10 ASC NULLS FIRST], [s_store_name#10, sum(ss_net_profit)#33] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (48) + + +(48) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q8/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q8/simplified.txt new file mode 100644 index 0000000000000..294468c04eea3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q8/simplified.txt @@ -0,0 +1,72 @@ +TakeOrderedAndProject [s_store_name,sum(ss_net_profit)] + WholeStageCodegen (9) + HashAggregate [s_store_name,sum] [sum(UnscaledValue(ss_net_profit)),sum(ss_net_profit),sum] + InputAdapter + Exchange [s_store_name] #1 + WholeStageCodegen (8) + HashAggregate [s_store_name,ss_net_profit] [sum,sum] + Project [ss_net_profit,s_store_name] + BroadcastHashJoin [s_zip,ca_zip] + Project [ss_net_profit,s_store_name,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_qoy,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_zip] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (7) + HashAggregate [ca_zip] + InputAdapter + Exchange [ca_zip] #5 + WholeStageCodegen (6) + HashAggregate [ca_zip] + Project [ca_zip] + BroadcastHashJoin [ca_zip,ca_zip] + Filter [ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_zip] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Project [ca_zip] + Filter [count(1)] + HashAggregate [ca_zip,count] [count(1),ca_zip,count(1),count] + InputAdapter + Exchange [ca_zip] #7 + WholeStageCodegen (4) + HashAggregate [ca_zip] [count,count] + Project [ca_zip] + BroadcastHashJoin [ca_address_sk,c_current_addr_sk] + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_zip] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (3) + Project [c_current_addr_sk] + Filter [c_preferred_cust_flag,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_current_addr_sk,c_preferred_cust_flag] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt new file mode 100644 index 0000000000000..d9794c33a767d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/explain.txt @@ -0,0 +1,630 @@ +== Physical Plan == +TakeOrderedAndProject (111) ++- * HashAggregate (110) + +- Exchange (109) + +- * HashAggregate (108) + +- * Expand (107) + +- Union (106) + :- * HashAggregate (43) + : +- Exchange (42) + : +- * HashAggregate (41) + : +- * Project (40) + : +- * BroadcastHashJoin Inner BuildRight (39) + : :- * Project (34) + : : +- * BroadcastHashJoin Inner BuildRight (33) + : : :- * Project (27) + : : : +- * BroadcastHashJoin Inner BuildRight (26) + : : : :- * Project (20) + : : : : +- * BroadcastHashJoin Inner BuildRight (19) + : : : : :- * Project (13) + : : : : : +- * SortMergeJoin LeftOuter (12) + : : : : : :- * Sort (5) + : : : : : : +- Exchange (4) + : : : : : : +- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.store_sales (1) + : : : : : +- * Sort (11) + : : : : : +- Exchange (10) + : : : : : +- * Project (9) + : : : : : +- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.store_returns (6) + : : : : +- BroadcastExchange (18) + : : : : +- * Project (17) + : : : : +- * Filter (16) + : : : : +- * ColumnarToRow (15) + : : : : +- Scan parquet default.item (14) + : : : +- BroadcastExchange (25) + : : : +- * Project (24) + : : : +- * Filter (23) + : : : +- * ColumnarToRow (22) + : : : +- Scan parquet default.promotion (21) + : : +- BroadcastExchange (32) + : : +- * Project (31) + : : +- * Filter (30) + : : +- * ColumnarToRow (29) + : : +- Scan parquet default.date_dim (28) + : +- BroadcastExchange (38) + : +- * Filter (37) + : +- * ColumnarToRow (36) + : +- Scan parquet default.store (35) + :- * HashAggregate (74) + : +- Exchange (73) + : +- * HashAggregate (72) + : +- * Project (71) + : +- * BroadcastHashJoin Inner BuildRight (70) + : :- * Project (65) + : : +- * BroadcastHashJoin Inner BuildRight (64) + : : :- * Project (62) + : : : +- * BroadcastHashJoin Inner BuildRight (61) + : : : :- * Project (59) + : : : : +- * BroadcastHashJoin Inner BuildRight (58) + : : : : :- * Project (56) + : : : : : +- * SortMergeJoin LeftOuter (55) + : : : : : :- * Sort (48) + : : : : : : +- Exchange (47) + : : : : : : +- * Filter (46) + : : : : : : +- * ColumnarToRow (45) + : : : : : : +- Scan parquet default.catalog_sales (44) + : : : : : +- * Sort (54) + : : : : : +- Exchange (53) + : : : : : +- * Project (52) + : : : : : +- * Filter (51) + : : : : : +- * ColumnarToRow (50) + : : : : : +- Scan parquet default.catalog_returns (49) + : : : : +- ReusedExchange (57) + : : : +- ReusedExchange (60) + : : +- ReusedExchange (63) + : +- BroadcastExchange (69) + : +- * Filter (68) + : +- * ColumnarToRow (67) + : +- Scan parquet default.catalog_page (66) + +- * HashAggregate (105) + +- Exchange (104) + +- * HashAggregate (103) + +- * Project (102) + +- * BroadcastHashJoin Inner BuildRight (101) + :- * Project (96) + : +- * BroadcastHashJoin Inner BuildRight (95) + : :- * Project (93) + : : +- * BroadcastHashJoin Inner BuildRight (92) + : : :- * Project (90) + : : : +- * BroadcastHashJoin Inner BuildRight (89) + : : : :- * Project (87) + : : : : +- * SortMergeJoin LeftOuter (86) + : : : : :- * Sort (79) + : : : : : +- Exchange (78) + : : : : : +- * Filter (77) + : : : : : +- * ColumnarToRow (76) + : : : : : +- Scan parquet default.web_sales (75) + : : : : +- * Sort (85) + : : : : +- Exchange (84) + : : : : +- * Project (83) + : : : : +- * Filter (82) + : : : : +- * ColumnarToRow (81) + : : : : +- Scan parquet default.web_returns (80) + : : : +- ReusedExchange (88) + : : +- ReusedExchange (91) + : +- ReusedExchange (94) + +- BroadcastExchange (100) + +- * Filter (99) + +- * ColumnarToRow (98) + +- Scan parquet default.web_site (97) + + +(1) Scan parquet default.store_sales +Output [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_item_sk), IsNotNull(ss_promo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] + +(3) Filter [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Condition : ((isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_promo_sk#3)) + +(4) Exchange +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#9] + +(5) Sort [codegen id : 2] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_returns +Output [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] + +(8) Filter [codegen id : 3] +Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] +Condition : (isnotnull(sr_item_sk#10) AND isnotnull(sr_ticket_number#11)) + +(9) Project [codegen id : 3] +Output [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] +Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] + +(10) Exchange +Input [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] +Arguments: hashpartitioning(sr_item_sk#10, sr_ticket_number#11, 5), ENSURE_REQUIREMENTS, [id=#15] + +(11) Sort [codegen id : 4] +Input [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] +Arguments: [sr_item_sk#10 ASC NULLS FIRST, sr_ticket_number#11 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 9] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#4] +Right keys [2]: [sr_item_sk#10, sr_ticket_number#11] +Join condition: None + +(13) Project [codegen id : 9] +Output [8]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13] +Input [11]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] + +(14) Scan parquet default.item +Output [2]: [i_item_sk#16, i_current_price#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThan(i_current_price,50.00), IsNotNull(i_item_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 5] +Input [2]: [i_item_sk#16, i_current_price#17] + +(16) Filter [codegen id : 5] +Input [2]: [i_item_sk#16, i_current_price#17] +Condition : ((isnotnull(i_current_price#17) AND (i_current_price#17 > 50.00)) AND isnotnull(i_item_sk#16)) + +(17) Project [codegen id : 5] +Output [1]: [i_item_sk#16] +Input [2]: [i_item_sk#16, i_current_price#17] + +(18) BroadcastExchange +Input [1]: [i_item_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(19) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#16] +Join condition: None + +(20) Project [codegen id : 9] +Output [7]: [ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13, i_item_sk#16] + +(21) Scan parquet default.promotion +Output [2]: [p_promo_sk#19, p_channel_tv#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_channel_tv), EqualTo(p_channel_tv,N), IsNotNull(p_promo_sk)] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 6] +Input [2]: [p_promo_sk#19, p_channel_tv#20] + +(23) Filter [codegen id : 6] +Input [2]: [p_promo_sk#19, p_channel_tv#20] +Condition : ((isnotnull(p_channel_tv#20) AND (p_channel_tv#20 = N)) AND isnotnull(p_promo_sk#19)) + +(24) Project [codegen id : 6] +Output [1]: [p_promo_sk#19] +Input [2]: [p_promo_sk#19, p_channel_tv#20] + +(25) BroadcastExchange +Input [1]: [p_promo_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(26) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_promo_sk#3] +Right keys [1]: [p_promo_sk#19] +Join condition: None + +(27) Project [codegen id : 9] +Output [6]: [ss_store_sk#2, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13] +Input [8]: [ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13, p_promo_sk#19] + +(28) Scan parquet default.date_dim +Output [2]: [d_date_sk#22, d_date#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-08-23), LessThanOrEqual(d_date,2000-09-22), IsNotNull(d_date_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 7] +Input [2]: [d_date_sk#22, d_date#23] + +(30) Filter [codegen id : 7] +Input [2]: [d_date_sk#22, d_date#23] +Condition : (((isnotnull(d_date#23) AND (d_date#23 >= 2000-08-23)) AND (d_date#23 <= 2000-09-22)) AND isnotnull(d_date_sk#22)) + +(31) Project [codegen id : 7] +Output [1]: [d_date_sk#22] +Input [2]: [d_date_sk#22, d_date#23] + +(32) BroadcastExchange +Input [1]: [d_date_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(33) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#22] +Join condition: None + +(34) Project [codegen id : 9] +Output [5]: [ss_store_sk#2, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13] +Input [7]: [ss_store_sk#2, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13, d_date_sk#22] + +(35) Scan parquet default.store +Output [2]: [s_store_sk#25, s_store_id#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 8] +Input [2]: [s_store_sk#25, s_store_id#26] + +(37) Filter [codegen id : 8] +Input [2]: [s_store_sk#25, s_store_id#26] +Condition : isnotnull(s_store_sk#25) + +(38) BroadcastExchange +Input [2]: [s_store_sk#25, s_store_id#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(39) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#25] +Join condition: None + +(40) Project [codegen id : 9] +Output [5]: [ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#26] +Input [7]: [ss_store_sk#2, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_sk#25, s_store_id#26] + +(41) HashAggregate [codegen id : 9] +Input [5]: [ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#26] +Keys [1]: [s_store_id#26] +Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#5)), partial_sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00)), partial_sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [5]: [sum#28, sum#29, isEmpty#30, sum#31, isEmpty#32] +Results [6]: [s_store_id#26, sum#33, sum#34, isEmpty#35, sum#36, isEmpty#37] + +(42) Exchange +Input [6]: [s_store_id#26, sum#33, sum#34, isEmpty#35, sum#36, isEmpty#37] +Arguments: hashpartitioning(s_store_id#26, 5), ENSURE_REQUIREMENTS, [id=#38] + +(43) HashAggregate [codegen id : 10] +Input [6]: [s_store_id#26, sum#33, sum#34, isEmpty#35, sum#36, isEmpty#37] +Keys [1]: [s_store_id#26] +Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#5)), sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00)), sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#5))#39, sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00))#40, sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#41] +Results [5]: [MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#39,17,2) AS sales#42, sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00))#40 AS returns#43, sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#41 AS profit#44, store channel AS channel#45, concat(store, s_store_id#26) AS id#46] + +(44) Scan parquet default.catalog_sales +Output [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#53), dynamicpruningexpression(cs_sold_date_sk#53 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_catalog_page_sk), IsNotNull(cs_item_sk), IsNotNull(cs_promo_sk)] +ReadSchema: struct + +(45) ColumnarToRow [codegen id : 11] +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] + +(46) Filter [codegen id : 11] +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Condition : ((isnotnull(cs_catalog_page_sk#47) AND isnotnull(cs_item_sk#48)) AND isnotnull(cs_promo_sk#49)) + +(47) Exchange +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Arguments: hashpartitioning(cs_item_sk#48, cs_order_number#50, 5), ENSURE_REQUIREMENTS, [id=#54] + +(48) Sort [codegen id : 12] +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Arguments: [cs_item_sk#48 ASC NULLS FIRST, cs_order_number#50 ASC NULLS FIRST], false, 0 + +(49) Scan parquet default.catalog_returns +Output [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_order_number)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 13] +Input [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(51) Filter [codegen id : 13] +Input [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Condition : (isnotnull(cr_item_sk#55) AND isnotnull(cr_order_number#56)) + +(52) Project [codegen id : 13] +Output [4]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] +Input [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(53) Exchange +Input [4]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] +Arguments: hashpartitioning(cr_item_sk#55, cr_order_number#56, 5), ENSURE_REQUIREMENTS, [id=#60] + +(54) Sort [codegen id : 14] +Input [4]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] +Arguments: [cr_item_sk#55 ASC NULLS FIRST, cr_order_number#56 ASC NULLS FIRST], false, 0 + +(55) SortMergeJoin [codegen id : 19] +Left keys [2]: [cs_item_sk#48, cs_order_number#50] +Right keys [2]: [cr_item_sk#55, cr_order_number#56] +Join condition: None + +(56) Project [codegen id : 19] +Output [8]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58] +Input [11]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] + +(57) ReusedExchange [Reuses operator id: 18] +Output [1]: [i_item_sk#61] + +(58) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_item_sk#48] +Right keys [1]: [i_item_sk#61] +Join condition: None + +(59) Project [codegen id : 19] +Output [7]: [cs_catalog_page_sk#47, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58] +Input [9]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58, i_item_sk#61] + +(60) ReusedExchange [Reuses operator id: 25] +Output [1]: [p_promo_sk#62] + +(61) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_promo_sk#49] +Right keys [1]: [p_promo_sk#62] +Join condition: None + +(62) Project [codegen id : 19] +Output [6]: [cs_catalog_page_sk#47, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58] +Input [8]: [cs_catalog_page_sk#47, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58, p_promo_sk#62] + +(63) ReusedExchange [Reuses operator id: 32] +Output [1]: [d_date_sk#63] + +(64) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_sold_date_sk#53] +Right keys [1]: [d_date_sk#63] +Join condition: None + +(65) Project [codegen id : 19] +Output [5]: [cs_catalog_page_sk#47, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58] +Input [7]: [cs_catalog_page_sk#47, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58, d_date_sk#63] + +(66) Scan parquet default.catalog_page +Output [2]: [cp_catalog_page_sk#64, cp_catalog_page_id#65] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_page] +PushedFilters: [IsNotNull(cp_catalog_page_sk)] +ReadSchema: struct + +(67) ColumnarToRow [codegen id : 18] +Input [2]: [cp_catalog_page_sk#64, cp_catalog_page_id#65] + +(68) Filter [codegen id : 18] +Input [2]: [cp_catalog_page_sk#64, cp_catalog_page_id#65] +Condition : isnotnull(cp_catalog_page_sk#64) + +(69) BroadcastExchange +Input [2]: [cp_catalog_page_sk#64, cp_catalog_page_id#65] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#66] + +(70) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_catalog_page_sk#47] +Right keys [1]: [cp_catalog_page_sk#64] +Join condition: None + +(71) Project [codegen id : 19] +Output [5]: [cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#65] +Input [7]: [cs_catalog_page_sk#47, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_sk#64, cp_catalog_page_id#65] + +(72) HashAggregate [codegen id : 19] +Input [5]: [cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#65] +Keys [1]: [cp_catalog_page_id#65] +Functions [3]: [partial_sum(UnscaledValue(cs_ext_sales_price#51)), partial_sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00)), partial_sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [5]: [sum#67, sum#68, isEmpty#69, sum#70, isEmpty#71] +Results [6]: [cp_catalog_page_id#65, sum#72, sum#73, isEmpty#74, sum#75, isEmpty#76] + +(73) Exchange +Input [6]: [cp_catalog_page_id#65, sum#72, sum#73, isEmpty#74, sum#75, isEmpty#76] +Arguments: hashpartitioning(cp_catalog_page_id#65, 5), ENSURE_REQUIREMENTS, [id=#77] + +(74) HashAggregate [codegen id : 20] +Input [6]: [cp_catalog_page_id#65, sum#72, sum#73, isEmpty#74, sum#75, isEmpty#76] +Keys [1]: [cp_catalog_page_id#65] +Functions [3]: [sum(UnscaledValue(cs_ext_sales_price#51)), sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00)), sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_sales_price#51))#78, sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00))#79, sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#80] +Results [5]: [MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#51))#78,17,2) AS sales#81, sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00))#79 AS returns#82, sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#80 AS profit#83, catalog channel AS channel#84, concat(catalog_page, cp_catalog_page_id#65) AS id#85] + +(75) Scan parquet default.web_sales +Output [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#92), dynamicpruningexpression(ws_sold_date_sk#92 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_web_site_sk), IsNotNull(ws_item_sk), IsNotNull(ws_promo_sk)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 21] +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] + +(77) Filter [codegen id : 21] +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Condition : ((isnotnull(ws_web_site_sk#87) AND isnotnull(ws_item_sk#86)) AND isnotnull(ws_promo_sk#88)) + +(78) Exchange +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Arguments: hashpartitioning(ws_item_sk#86, ws_order_number#89, 5), ENSURE_REQUIREMENTS, [id=#93] + +(79) Sort [codegen id : 22] +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Arguments: [ws_item_sk#86 ASC NULLS FIRST, ws_order_number#89 ASC NULLS FIRST], false, 0 + +(80) Scan parquet default.web_returns +Output [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number)] +ReadSchema: struct + +(81) ColumnarToRow [codegen id : 23] +Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] + +(82) Filter [codegen id : 23] +Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] +Condition : (isnotnull(wr_item_sk#94) AND isnotnull(wr_order_number#95)) + +(83) Project [codegen id : 23] +Output [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] +Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] + +(84) Exchange +Input [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] +Arguments: hashpartitioning(wr_item_sk#94, wr_order_number#95, 5), ENSURE_REQUIREMENTS, [id=#99] + +(85) Sort [codegen id : 24] +Input [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] +Arguments: [wr_item_sk#94 ASC NULLS FIRST, wr_order_number#95 ASC NULLS FIRST], false, 0 + +(86) SortMergeJoin [codegen id : 29] +Left keys [2]: [ws_item_sk#86, ws_order_number#89] +Right keys [2]: [wr_item_sk#94, wr_order_number#95] +Join condition: None + +(87) Project [codegen id : 29] +Output [8]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97] +Input [11]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] + +(88) ReusedExchange [Reuses operator id: 18] +Output [1]: [i_item_sk#100] + +(89) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_item_sk#86] +Right keys [1]: [i_item_sk#100] +Join condition: None + +(90) Project [codegen id : 29] +Output [7]: [ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97] +Input [9]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97, i_item_sk#100] + +(91) ReusedExchange [Reuses operator id: 25] +Output [1]: [p_promo_sk#101] + +(92) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_promo_sk#88] +Right keys [1]: [p_promo_sk#101] +Join condition: None + +(93) Project [codegen id : 29] +Output [6]: [ws_web_site_sk#87, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97] +Input [8]: [ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97, p_promo_sk#101] + +(94) ReusedExchange [Reuses operator id: 32] +Output [1]: [d_date_sk#102] + +(95) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_sold_date_sk#92] +Right keys [1]: [d_date_sk#102] +Join condition: None + +(96) Project [codegen id : 29] +Output [5]: [ws_web_site_sk#87, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97] +Input [7]: [ws_web_site_sk#87, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97, d_date_sk#102] + +(97) Scan parquet default.web_site +Output [2]: [web_site_sk#103, web_site_id#104] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_site_sk)] +ReadSchema: struct + +(98) ColumnarToRow [codegen id : 28] +Input [2]: [web_site_sk#103, web_site_id#104] + +(99) Filter [codegen id : 28] +Input [2]: [web_site_sk#103, web_site_id#104] +Condition : isnotnull(web_site_sk#103) + +(100) BroadcastExchange +Input [2]: [web_site_sk#103, web_site_id#104] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#105] + +(101) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_web_site_sk#87] +Right keys [1]: [web_site_sk#103] +Join condition: None + +(102) Project [codegen id : 29] +Output [5]: [ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#104] +Input [7]: [ws_web_site_sk#87, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_sk#103, web_site_id#104] + +(103) HashAggregate [codegen id : 29] +Input [5]: [ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#104] +Keys [1]: [web_site_id#104] +Functions [3]: [partial_sum(UnscaledValue(ws_ext_sales_price#90)), partial_sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00)), partial_sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [5]: [sum#106, sum#107, isEmpty#108, sum#109, isEmpty#110] +Results [6]: [web_site_id#104, sum#111, sum#112, isEmpty#113, sum#114, isEmpty#115] + +(104) Exchange +Input [6]: [web_site_id#104, sum#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Arguments: hashpartitioning(web_site_id#104, 5), ENSURE_REQUIREMENTS, [id=#116] + +(105) HashAggregate [codegen id : 30] +Input [6]: [web_site_id#104, sum#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Keys [1]: [web_site_id#104] +Functions [3]: [sum(UnscaledValue(ws_ext_sales_price#90)), sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00)), sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_sales_price#90))#117, sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00))#118, sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#119] +Results [5]: [MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#90))#117,17,2) AS sales#120, sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00))#118 AS returns#121, sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#119 AS profit#122, web channel AS channel#123, concat(web_site, web_site_id#104) AS id#124] + +(106) Union + +(107) Expand [codegen id : 31] +Input [5]: [sales#42, returns#43, profit#44, channel#45, id#46] +Arguments: [ArrayBuffer(sales#42, returns#43, profit#44, channel#45, id#46, 0), ArrayBuffer(sales#42, returns#43, profit#44, channel#45, null, 1), ArrayBuffer(sales#42, returns#43, profit#44, null, null, 3)], [sales#42, returns#43, profit#44, channel#125, id#126, spark_grouping_id#127] + +(108) HashAggregate [codegen id : 31] +Input [6]: [sales#42, returns#43, profit#44, channel#125, id#126, spark_grouping_id#127] +Keys [3]: [channel#125, id#126, spark_grouping_id#127] +Functions [3]: [partial_sum(sales#42), partial_sum(returns#43), partial_sum(profit#44)] +Aggregate Attributes [6]: [sum#128, isEmpty#129, sum#130, isEmpty#131, sum#132, isEmpty#133] +Results [9]: [channel#125, id#126, spark_grouping_id#127, sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139] + +(109) Exchange +Input [9]: [channel#125, id#126, spark_grouping_id#127, sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139] +Arguments: hashpartitioning(channel#125, id#126, spark_grouping_id#127, 5), ENSURE_REQUIREMENTS, [id=#140] + +(110) HashAggregate [codegen id : 32] +Input [9]: [channel#125, id#126, spark_grouping_id#127, sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139] +Keys [3]: [channel#125, id#126, spark_grouping_id#127] +Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#44)] +Aggregate Attributes [3]: [sum(sales#42)#141, sum(returns#43)#142, sum(profit#44)#143] +Results [5]: [channel#125, id#126, sum(sales#42)#141 AS sales#144, sum(returns#43)#142 AS returns#145, sum(profit#44)#143 AS profit#146] + +(111) TakeOrderedAndProject +Input [5]: [channel#125, id#126, sales#144, returns#145, profit#146] +Arguments: 100, [channel#125 ASC NULLS FIRST, id#126 ASC NULLS FIRST], [channel#125, id#126, sales#144, returns#145, profit#146] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (112) + + +(112) ReusedExchange [Reuses operator id: 32] +Output [1]: [d_date_sk#22] + +Subquery:2 Hosting operator id = 44 Hosting Expression = cs_sold_date_sk#53 IN dynamicpruning#8 + +Subquery:3 Hosting operator id = 75 Hosting Expression = ws_sold_date_sk#92 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt new file mode 100644 index 0000000000000..4155b5176397e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80.sf100/simplified.txt @@ -0,0 +1,182 @@ +TakeOrderedAndProject [channel,id,sales,returns,profit] + WholeStageCodegen (32) + HashAggregate [channel,id,spark_grouping_id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel,id,spark_grouping_id] #1 + WholeStageCodegen (31) + HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + Expand [sales,returns,profit,channel,id] + InputAdapter + Union + WholeStageCodegen (10) + HashAggregate [s_store_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(ss_ext_sales_price)),sum(coalesce(cast(sr_return_amt as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(ss_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),sales,returns,profit,channel,id,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [s_store_id] #2 + WholeStageCodegen (9) + HashAggregate [s_store_id,ss_ext_sales_price,sr_return_amt,ss_net_profit,sr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] + Project [ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss,s_store_id] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk,sr_return_amt,sr_net_loss] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk,sr_return_amt,sr_net_loss] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk,sr_return_amt,sr_net_loss] + SortMergeJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_item_sk,ss_ticket_number] #3 + WholeStageCodegen (1) + Filter [ss_store_sk,ss_item_sk,ss_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + WholeStageCodegen (4) + Sort [sr_item_sk,sr_ticket_number] + InputAdapter + Exchange [sr_item_sk,sr_ticket_number] #5 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number,sr_return_amt,sr_net_loss] + Filter [sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_amt,sr_net_loss,sr_returned_date_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Project [i_item_sk] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (6) + Project [p_promo_sk] + Filter [p_channel_tv,p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk,p_channel_tv] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (7) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (8) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + WholeStageCodegen (20) + HashAggregate [cp_catalog_page_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(cs_ext_sales_price)),sum(coalesce(cast(cr_return_amount as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(cs_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),sales,returns,profit,channel,id,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [cp_catalog_page_id] #9 + WholeStageCodegen (19) + HashAggregate [cp_catalog_page_id,cs_ext_sales_price,cr_return_amount,cs_net_profit,cr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] + Project [cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss,cp_catalog_page_id] + BroadcastHashJoin [cs_catalog_page_sk,cp_catalog_page_sk] + Project [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk,cr_return_amount,cr_net_loss] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_catalog_page_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk,cr_return_amount,cr_net_loss] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk,cr_return_amount,cr_net_loss] + SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] + InputAdapter + WholeStageCodegen (12) + Sort [cs_item_sk,cs_order_number] + InputAdapter + Exchange [cs_item_sk,cs_order_number] #10 + WholeStageCodegen (11) + Filter [cs_catalog_page_sk,cs_item_sk,cs_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (14) + Sort [cr_item_sk,cr_order_number] + InputAdapter + Exchange [cr_item_sk,cr_order_number] #11 + WholeStageCodegen (13) + Project [cr_item_sk,cr_order_number,cr_return_amount,cr_net_loss] + Filter [cr_item_sk,cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_amount,cr_net_loss,cr_returned_date_sk] + InputAdapter + ReusedExchange [i_item_sk] #6 + InputAdapter + ReusedExchange [p_promo_sk] #7 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (18) + Filter [cp_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_page [cp_catalog_page_sk,cp_catalog_page_id] + WholeStageCodegen (30) + HashAggregate [web_site_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(ws_ext_sales_price)),sum(coalesce(cast(wr_return_amt as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(ws_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),sales,returns,profit,channel,id,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [web_site_id] #13 + WholeStageCodegen (29) + HashAggregate [web_site_id,ws_ext_sales_price,wr_return_amt,ws_net_profit,wr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] + Project [ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss,web_site_id] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_web_site_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_web_site_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk,wr_return_amt,wr_net_loss] + BroadcastHashJoin [ws_promo_sk,p_promo_sk] + Project [ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk,wr_return_amt,wr_net_loss] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk,wr_return_amt,wr_net_loss] + SortMergeJoin [ws_item_sk,ws_order_number,wr_item_sk,wr_order_number] + InputAdapter + WholeStageCodegen (22) + Sort [ws_item_sk,ws_order_number] + InputAdapter + Exchange [ws_item_sk,ws_order_number] #14 + WholeStageCodegen (21) + Filter [ws_web_site_sk,ws_item_sk,ws_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_order_number,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (24) + Sort [wr_item_sk,wr_order_number] + InputAdapter + Exchange [wr_item_sk,wr_order_number] #15 + WholeStageCodegen (23) + Project [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss] + Filter [wr_item_sk,wr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss,wr_returned_date_sk] + InputAdapter + ReusedExchange [i_item_sk] #6 + InputAdapter + ReusedExchange [p_promo_sk] #7 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (28) + Filter [web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_site_id] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt new file mode 100644 index 0000000000000..5d0c3b9ddbb31 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/explain.txt @@ -0,0 +1,630 @@ +== Physical Plan == +TakeOrderedAndProject (111) ++- * HashAggregate (110) + +- Exchange (109) + +- * HashAggregate (108) + +- * Expand (107) + +- Union (106) + :- * HashAggregate (43) + : +- Exchange (42) + : +- * HashAggregate (41) + : +- * Project (40) + : +- * BroadcastHashJoin Inner BuildRight (39) + : :- * Project (33) + : : +- * BroadcastHashJoin Inner BuildRight (32) + : : :- * Project (26) + : : : +- * BroadcastHashJoin Inner BuildRight (25) + : : : :- * Project (20) + : : : : +- * BroadcastHashJoin Inner BuildRight (19) + : : : : :- * Project (13) + : : : : : +- * SortMergeJoin LeftOuter (12) + : : : : : :- * Sort (5) + : : : : : : +- Exchange (4) + : : : : : : +- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.store_sales (1) + : : : : : +- * Sort (11) + : : : : : +- Exchange (10) + : : : : : +- * Project (9) + : : : : : +- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.store_returns (6) + : : : : +- BroadcastExchange (18) + : : : : +- * Project (17) + : : : : +- * Filter (16) + : : : : +- * ColumnarToRow (15) + : : : : +- Scan parquet default.date_dim (14) + : : : +- BroadcastExchange (24) + : : : +- * Filter (23) + : : : +- * ColumnarToRow (22) + : : : +- Scan parquet default.store (21) + : : +- BroadcastExchange (31) + : : +- * Project (30) + : : +- * Filter (29) + : : +- * ColumnarToRow (28) + : : +- Scan parquet default.item (27) + : +- BroadcastExchange (38) + : +- * Project (37) + : +- * Filter (36) + : +- * ColumnarToRow (35) + : +- Scan parquet default.promotion (34) + :- * HashAggregate (74) + : +- Exchange (73) + : +- * HashAggregate (72) + : +- * Project (71) + : +- * BroadcastHashJoin Inner BuildRight (70) + : :- * Project (68) + : : +- * BroadcastHashJoin Inner BuildRight (67) + : : :- * Project (65) + : : : +- * BroadcastHashJoin Inner BuildRight (64) + : : : :- * Project (59) + : : : : +- * BroadcastHashJoin Inner BuildRight (58) + : : : : :- * Project (56) + : : : : : +- * SortMergeJoin LeftOuter (55) + : : : : : :- * Sort (48) + : : : : : : +- Exchange (47) + : : : : : : +- * Filter (46) + : : : : : : +- * ColumnarToRow (45) + : : : : : : +- Scan parquet default.catalog_sales (44) + : : : : : +- * Sort (54) + : : : : : +- Exchange (53) + : : : : : +- * Project (52) + : : : : : +- * Filter (51) + : : : : : +- * ColumnarToRow (50) + : : : : : +- Scan parquet default.catalog_returns (49) + : : : : +- ReusedExchange (57) + : : : +- BroadcastExchange (63) + : : : +- * Filter (62) + : : : +- * ColumnarToRow (61) + : : : +- Scan parquet default.catalog_page (60) + : : +- ReusedExchange (66) + : +- ReusedExchange (69) + +- * HashAggregate (105) + +- Exchange (104) + +- * HashAggregate (103) + +- * Project (102) + +- * BroadcastHashJoin Inner BuildRight (101) + :- * Project (99) + : +- * BroadcastHashJoin Inner BuildRight (98) + : :- * Project (96) + : : +- * BroadcastHashJoin Inner BuildRight (95) + : : :- * Project (90) + : : : +- * BroadcastHashJoin Inner BuildRight (89) + : : : :- * Project (87) + : : : : +- * SortMergeJoin LeftOuter (86) + : : : : :- * Sort (79) + : : : : : +- Exchange (78) + : : : : : +- * Filter (77) + : : : : : +- * ColumnarToRow (76) + : : : : : +- Scan parquet default.web_sales (75) + : : : : +- * Sort (85) + : : : : +- Exchange (84) + : : : : +- * Project (83) + : : : : +- * Filter (82) + : : : : +- * ColumnarToRow (81) + : : : : +- Scan parquet default.web_returns (80) + : : : +- ReusedExchange (88) + : : +- BroadcastExchange (94) + : : +- * Filter (93) + : : +- * ColumnarToRow (92) + : : +- Scan parquet default.web_site (91) + : +- ReusedExchange (97) + +- ReusedExchange (100) + + +(1) Scan parquet default.store_sales +Output [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_item_sk), IsNotNull(ss_promo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] + +(3) Filter [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Condition : ((isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_promo_sk#3)) + +(4) Exchange +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#9] + +(5) Sort [codegen id : 2] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_returns +Output [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] + +(8) Filter [codegen id : 3] +Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] +Condition : (isnotnull(sr_item_sk#10) AND isnotnull(sr_ticket_number#11)) + +(9) Project [codegen id : 3] +Output [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] +Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] + +(10) Exchange +Input [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] +Arguments: hashpartitioning(sr_item_sk#10, sr_ticket_number#11, 5), ENSURE_REQUIREMENTS, [id=#15] + +(11) Sort [codegen id : 4] +Input [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] +Arguments: [sr_item_sk#10 ASC NULLS FIRST, sr_ticket_number#11 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 9] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#4] +Right keys [2]: [sr_item_sk#10, sr_ticket_number#11] +Join condition: None + +(13) Project [codegen id : 9] +Output [8]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13] +Input [11]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] + +(14) Scan parquet default.date_dim +Output [2]: [d_date_sk#16, d_date#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-08-23), LessThanOrEqual(d_date,2000-09-22), IsNotNull(d_date_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#16, d_date#17] + +(16) Filter [codegen id : 5] +Input [2]: [d_date_sk#16, d_date#17] +Condition : (((isnotnull(d_date#17) AND (d_date#17 >= 2000-08-23)) AND (d_date#17 <= 2000-09-22)) AND isnotnull(d_date_sk#16)) + +(17) Project [codegen id : 5] +Output [1]: [d_date_sk#16] +Input [2]: [d_date_sk#16, d_date#17] + +(18) BroadcastExchange +Input [1]: [d_date_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(19) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(20) Project [codegen id : 9] +Output [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13, d_date_sk#16] + +(21) Scan parquet default.store +Output [2]: [s_store_sk#19, s_store_id#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 6] +Input [2]: [s_store_sk#19, s_store_id#20] + +(23) Filter [codegen id : 6] +Input [2]: [s_store_sk#19, s_store_id#20] +Condition : isnotnull(s_store_sk#19) + +(24) BroadcastExchange +Input [2]: [s_store_sk#19, s_store_id#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21] + +(25) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#19] +Join condition: None + +(26) Project [codegen id : 9] +Output [7]: [ss_item_sk#1, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#20] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_sk#19, s_store_id#20] + +(27) Scan parquet default.item +Output [2]: [i_item_sk#22, i_current_price#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThan(i_current_price,50.00), IsNotNull(i_item_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 7] +Input [2]: [i_item_sk#22, i_current_price#23] + +(29) Filter [codegen id : 7] +Input [2]: [i_item_sk#22, i_current_price#23] +Condition : ((isnotnull(i_current_price#23) AND (i_current_price#23 > 50.00)) AND isnotnull(i_item_sk#22)) + +(30) Project [codegen id : 7] +Output [1]: [i_item_sk#22] +Input [2]: [i_item_sk#22, i_current_price#23] + +(31) BroadcastExchange +Input [1]: [i_item_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(32) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#22] +Join condition: None + +(33) Project [codegen id : 9] +Output [6]: [ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#20] +Input [8]: [ss_item_sk#1, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#20, i_item_sk#22] + +(34) Scan parquet default.promotion +Output [2]: [p_promo_sk#25, p_channel_tv#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_channel_tv), EqualTo(p_channel_tv,N), IsNotNull(p_promo_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 8] +Input [2]: [p_promo_sk#25, p_channel_tv#26] + +(36) Filter [codegen id : 8] +Input [2]: [p_promo_sk#25, p_channel_tv#26] +Condition : ((isnotnull(p_channel_tv#26) AND (p_channel_tv#26 = N)) AND isnotnull(p_promo_sk#25)) + +(37) Project [codegen id : 8] +Output [1]: [p_promo_sk#25] +Input [2]: [p_promo_sk#25, p_channel_tv#26] + +(38) BroadcastExchange +Input [1]: [p_promo_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] + +(39) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_promo_sk#3] +Right keys [1]: [p_promo_sk#25] +Join condition: None + +(40) Project [codegen id : 9] +Output [5]: [ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#20] +Input [7]: [ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#20, p_promo_sk#25] + +(41) HashAggregate [codegen id : 9] +Input [5]: [ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#20] +Keys [1]: [s_store_id#20] +Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#5)), partial_sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00)), partial_sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [5]: [sum#28, sum#29, isEmpty#30, sum#31, isEmpty#32] +Results [6]: [s_store_id#20, sum#33, sum#34, isEmpty#35, sum#36, isEmpty#37] + +(42) Exchange +Input [6]: [s_store_id#20, sum#33, sum#34, isEmpty#35, sum#36, isEmpty#37] +Arguments: hashpartitioning(s_store_id#20, 5), ENSURE_REQUIREMENTS, [id=#38] + +(43) HashAggregate [codegen id : 10] +Input [6]: [s_store_id#20, sum#33, sum#34, isEmpty#35, sum#36, isEmpty#37] +Keys [1]: [s_store_id#20] +Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#5)), sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00)), sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#5))#39, sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00))#40, sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#41] +Results [5]: [MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#39,17,2) AS sales#42, sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00))#40 AS returns#43, sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#41 AS profit#44, store channel AS channel#45, concat(store, s_store_id#20) AS id#46] + +(44) Scan parquet default.catalog_sales +Output [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#53), dynamicpruningexpression(cs_sold_date_sk#53 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_catalog_page_sk), IsNotNull(cs_item_sk), IsNotNull(cs_promo_sk)] +ReadSchema: struct + +(45) ColumnarToRow [codegen id : 11] +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] + +(46) Filter [codegen id : 11] +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Condition : ((isnotnull(cs_catalog_page_sk#47) AND isnotnull(cs_item_sk#48)) AND isnotnull(cs_promo_sk#49)) + +(47) Exchange +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Arguments: hashpartitioning(cs_item_sk#48, cs_order_number#50, 5), ENSURE_REQUIREMENTS, [id=#54] + +(48) Sort [codegen id : 12] +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Arguments: [cs_item_sk#48 ASC NULLS FIRST, cs_order_number#50 ASC NULLS FIRST], false, 0 + +(49) Scan parquet default.catalog_returns +Output [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_order_number)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 13] +Input [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(51) Filter [codegen id : 13] +Input [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Condition : (isnotnull(cr_item_sk#55) AND isnotnull(cr_order_number#56)) + +(52) Project [codegen id : 13] +Output [4]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] +Input [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(53) Exchange +Input [4]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] +Arguments: hashpartitioning(cr_item_sk#55, cr_order_number#56, 5), ENSURE_REQUIREMENTS, [id=#60] + +(54) Sort [codegen id : 14] +Input [4]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] +Arguments: [cr_item_sk#55 ASC NULLS FIRST, cr_order_number#56 ASC NULLS FIRST], false, 0 + +(55) SortMergeJoin [codegen id : 19] +Left keys [2]: [cs_item_sk#48, cs_order_number#50] +Right keys [2]: [cr_item_sk#55, cr_order_number#56] +Join condition: None + +(56) Project [codegen id : 19] +Output [8]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58] +Input [11]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] + +(57) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#61] + +(58) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_sold_date_sk#53] +Right keys [1]: [d_date_sk#61] +Join condition: None + +(59) Project [codegen id : 19] +Output [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58] +Input [9]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58, d_date_sk#61] + +(60) Scan parquet default.catalog_page +Output [2]: [cp_catalog_page_sk#62, cp_catalog_page_id#63] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_page] +PushedFilters: [IsNotNull(cp_catalog_page_sk)] +ReadSchema: struct + +(61) ColumnarToRow [codegen id : 16] +Input [2]: [cp_catalog_page_sk#62, cp_catalog_page_id#63] + +(62) Filter [codegen id : 16] +Input [2]: [cp_catalog_page_sk#62, cp_catalog_page_id#63] +Condition : isnotnull(cp_catalog_page_sk#62) + +(63) BroadcastExchange +Input [2]: [cp_catalog_page_sk#62, cp_catalog_page_id#63] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#64] + +(64) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_catalog_page_sk#47] +Right keys [1]: [cp_catalog_page_sk#62] +Join condition: None + +(65) Project [codegen id : 19] +Output [7]: [cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#63] +Input [9]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_sk#62, cp_catalog_page_id#63] + +(66) ReusedExchange [Reuses operator id: 31] +Output [1]: [i_item_sk#65] + +(67) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_item_sk#48] +Right keys [1]: [i_item_sk#65] +Join condition: None + +(68) Project [codegen id : 19] +Output [6]: [cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#63] +Input [8]: [cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#63, i_item_sk#65] + +(69) ReusedExchange [Reuses operator id: 38] +Output [1]: [p_promo_sk#66] + +(70) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_promo_sk#49] +Right keys [1]: [p_promo_sk#66] +Join condition: None + +(71) Project [codegen id : 19] +Output [5]: [cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#63] +Input [7]: [cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#63, p_promo_sk#66] + +(72) HashAggregate [codegen id : 19] +Input [5]: [cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#63] +Keys [1]: [cp_catalog_page_id#63] +Functions [3]: [partial_sum(UnscaledValue(cs_ext_sales_price#51)), partial_sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00)), partial_sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [5]: [sum#67, sum#68, isEmpty#69, sum#70, isEmpty#71] +Results [6]: [cp_catalog_page_id#63, sum#72, sum#73, isEmpty#74, sum#75, isEmpty#76] + +(73) Exchange +Input [6]: [cp_catalog_page_id#63, sum#72, sum#73, isEmpty#74, sum#75, isEmpty#76] +Arguments: hashpartitioning(cp_catalog_page_id#63, 5), ENSURE_REQUIREMENTS, [id=#77] + +(74) HashAggregate [codegen id : 20] +Input [6]: [cp_catalog_page_id#63, sum#72, sum#73, isEmpty#74, sum#75, isEmpty#76] +Keys [1]: [cp_catalog_page_id#63] +Functions [3]: [sum(UnscaledValue(cs_ext_sales_price#51)), sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00)), sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_sales_price#51))#78, sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00))#79, sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#80] +Results [5]: [MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#51))#78,17,2) AS sales#81, sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00))#79 AS returns#82, sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#80 AS profit#83, catalog channel AS channel#84, concat(catalog_page, cp_catalog_page_id#63) AS id#85] + +(75) Scan parquet default.web_sales +Output [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#92), dynamicpruningexpression(ws_sold_date_sk#92 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_web_site_sk), IsNotNull(ws_item_sk), IsNotNull(ws_promo_sk)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 21] +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] + +(77) Filter [codegen id : 21] +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Condition : ((isnotnull(ws_web_site_sk#87) AND isnotnull(ws_item_sk#86)) AND isnotnull(ws_promo_sk#88)) + +(78) Exchange +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Arguments: hashpartitioning(ws_item_sk#86, ws_order_number#89, 5), ENSURE_REQUIREMENTS, [id=#93] + +(79) Sort [codegen id : 22] +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Arguments: [ws_item_sk#86 ASC NULLS FIRST, ws_order_number#89 ASC NULLS FIRST], false, 0 + +(80) Scan parquet default.web_returns +Output [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number)] +ReadSchema: struct + +(81) ColumnarToRow [codegen id : 23] +Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] + +(82) Filter [codegen id : 23] +Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] +Condition : (isnotnull(wr_item_sk#94) AND isnotnull(wr_order_number#95)) + +(83) Project [codegen id : 23] +Output [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] +Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] + +(84) Exchange +Input [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] +Arguments: hashpartitioning(wr_item_sk#94, wr_order_number#95, 5), ENSURE_REQUIREMENTS, [id=#99] + +(85) Sort [codegen id : 24] +Input [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] +Arguments: [wr_item_sk#94 ASC NULLS FIRST, wr_order_number#95 ASC NULLS FIRST], false, 0 + +(86) SortMergeJoin [codegen id : 29] +Left keys [2]: [ws_item_sk#86, ws_order_number#89] +Right keys [2]: [wr_item_sk#94, wr_order_number#95] +Join condition: None + +(87) Project [codegen id : 29] +Output [8]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97] +Input [11]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] + +(88) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#100] + +(89) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_sold_date_sk#92] +Right keys [1]: [d_date_sk#100] +Join condition: None + +(90) Project [codegen id : 29] +Output [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97] +Input [9]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97, d_date_sk#100] + +(91) Scan parquet default.web_site +Output [2]: [web_site_sk#101, web_site_id#102] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_site_sk)] +ReadSchema: struct + +(92) ColumnarToRow [codegen id : 26] +Input [2]: [web_site_sk#101, web_site_id#102] + +(93) Filter [codegen id : 26] +Input [2]: [web_site_sk#101, web_site_id#102] +Condition : isnotnull(web_site_sk#101) + +(94) BroadcastExchange +Input [2]: [web_site_sk#101, web_site_id#102] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#103] + +(95) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_web_site_sk#87] +Right keys [1]: [web_site_sk#101] +Join condition: None + +(96) Project [codegen id : 29] +Output [7]: [ws_item_sk#86, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#102] +Input [9]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_sk#101, web_site_id#102] + +(97) ReusedExchange [Reuses operator id: 31] +Output [1]: [i_item_sk#104] + +(98) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_item_sk#86] +Right keys [1]: [i_item_sk#104] +Join condition: None + +(99) Project [codegen id : 29] +Output [6]: [ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#102] +Input [8]: [ws_item_sk#86, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#102, i_item_sk#104] + +(100) ReusedExchange [Reuses operator id: 38] +Output [1]: [p_promo_sk#105] + +(101) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_promo_sk#88] +Right keys [1]: [p_promo_sk#105] +Join condition: None + +(102) Project [codegen id : 29] +Output [5]: [ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#102] +Input [7]: [ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#102, p_promo_sk#105] + +(103) HashAggregate [codegen id : 29] +Input [5]: [ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#102] +Keys [1]: [web_site_id#102] +Functions [3]: [partial_sum(UnscaledValue(ws_ext_sales_price#90)), partial_sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00)), partial_sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [5]: [sum#106, sum#107, isEmpty#108, sum#109, isEmpty#110] +Results [6]: [web_site_id#102, sum#111, sum#112, isEmpty#113, sum#114, isEmpty#115] + +(104) Exchange +Input [6]: [web_site_id#102, sum#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Arguments: hashpartitioning(web_site_id#102, 5), ENSURE_REQUIREMENTS, [id=#116] + +(105) HashAggregate [codegen id : 30] +Input [6]: [web_site_id#102, sum#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Keys [1]: [web_site_id#102] +Functions [3]: [sum(UnscaledValue(ws_ext_sales_price#90)), sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00)), sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_sales_price#90))#117, sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00))#118, sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#119] +Results [5]: [MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#90))#117,17,2) AS sales#120, sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00))#118 AS returns#121, sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#119 AS profit#122, web channel AS channel#123, concat(web_site, web_site_id#102) AS id#124] + +(106) Union + +(107) Expand [codegen id : 31] +Input [5]: [sales#42, returns#43, profit#44, channel#45, id#46] +Arguments: [ArrayBuffer(sales#42, returns#43, profit#44, channel#45, id#46, 0), ArrayBuffer(sales#42, returns#43, profit#44, channel#45, null, 1), ArrayBuffer(sales#42, returns#43, profit#44, null, null, 3)], [sales#42, returns#43, profit#44, channel#125, id#126, spark_grouping_id#127] + +(108) HashAggregate [codegen id : 31] +Input [6]: [sales#42, returns#43, profit#44, channel#125, id#126, spark_grouping_id#127] +Keys [3]: [channel#125, id#126, spark_grouping_id#127] +Functions [3]: [partial_sum(sales#42), partial_sum(returns#43), partial_sum(profit#44)] +Aggregate Attributes [6]: [sum#128, isEmpty#129, sum#130, isEmpty#131, sum#132, isEmpty#133] +Results [9]: [channel#125, id#126, spark_grouping_id#127, sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139] + +(109) Exchange +Input [9]: [channel#125, id#126, spark_grouping_id#127, sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139] +Arguments: hashpartitioning(channel#125, id#126, spark_grouping_id#127, 5), ENSURE_REQUIREMENTS, [id=#140] + +(110) HashAggregate [codegen id : 32] +Input [9]: [channel#125, id#126, spark_grouping_id#127, sum#134, isEmpty#135, sum#136, isEmpty#137, sum#138, isEmpty#139] +Keys [3]: [channel#125, id#126, spark_grouping_id#127] +Functions [3]: [sum(sales#42), sum(returns#43), sum(profit#44)] +Aggregate Attributes [3]: [sum(sales#42)#141, sum(returns#43)#142, sum(profit#44)#143] +Results [5]: [channel#125, id#126, sum(sales#42)#141 AS sales#144, sum(returns#43)#142 AS returns#145, sum(profit#44)#143 AS profit#146] + +(111) TakeOrderedAndProject +Input [5]: [channel#125, id#126, sales#144, returns#145, profit#146] +Arguments: 100, [channel#125 ASC NULLS FIRST, id#126 ASC NULLS FIRST], [channel#125, id#126, sales#144, returns#145, profit#146] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (112) + + +(112) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#16] + +Subquery:2 Hosting operator id = 44 Hosting Expression = cs_sold_date_sk#53 IN dynamicpruning#8 + +Subquery:3 Hosting operator id = 75 Hosting Expression = ws_sold_date_sk#92 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/simplified.txt new file mode 100644 index 0000000000000..5c8bd611e8dbc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q80/simplified.txt @@ -0,0 +1,182 @@ +TakeOrderedAndProject [channel,id,sales,returns,profit] + WholeStageCodegen (32) + HashAggregate [channel,id,spark_grouping_id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel,id,spark_grouping_id] #1 + WholeStageCodegen (31) + HashAggregate [channel,id,spark_grouping_id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + Expand [sales,returns,profit,channel,id] + InputAdapter + Union + WholeStageCodegen (10) + HashAggregate [s_store_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(ss_ext_sales_price)),sum(coalesce(cast(sr_return_amt as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(ss_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),sales,returns,profit,channel,id,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [s_store_id] #2 + WholeStageCodegen (9) + HashAggregate [s_store_id,ss_ext_sales_price,sr_return_amt,ss_net_profit,sr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] + Project [ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss,s_store_id] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss,s_store_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss,s_store_id] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk,sr_return_amt,sr_net_loss] + SortMergeJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_item_sk,ss_ticket_number] #3 + WholeStageCodegen (1) + Filter [ss_store_sk,ss_item_sk,ss_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + WholeStageCodegen (4) + Sort [sr_item_sk,sr_ticket_number] + InputAdapter + Exchange [sr_item_sk,sr_ticket_number] #5 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number,sr_return_amt,sr_net_loss] + Filter [sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_amt,sr_net_loss,sr_returned_date_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (7) + Project [i_item_sk] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (8) + Project [p_promo_sk] + Filter [p_channel_tv,p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk,p_channel_tv] + WholeStageCodegen (20) + HashAggregate [cp_catalog_page_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(cs_ext_sales_price)),sum(coalesce(cast(cr_return_amount as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(cs_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),sales,returns,profit,channel,id,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [cp_catalog_page_id] #9 + WholeStageCodegen (19) + HashAggregate [cp_catalog_page_id,cs_ext_sales_price,cr_return_amount,cs_net_profit,cr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] + Project [cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss,cp_catalog_page_id] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss,cp_catalog_page_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss,cp_catalog_page_id] + BroadcastHashJoin [cs_catalog_page_sk,cp_catalog_page_sk] + Project [cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk,cr_return_amount,cr_net_loss] + SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] + InputAdapter + WholeStageCodegen (12) + Sort [cs_item_sk,cs_order_number] + InputAdapter + Exchange [cs_item_sk,cs_order_number] #10 + WholeStageCodegen (11) + Filter [cs_catalog_page_sk,cs_item_sk,cs_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (14) + Sort [cr_item_sk,cr_order_number] + InputAdapter + Exchange [cr_item_sk,cr_order_number] #11 + WholeStageCodegen (13) + Project [cr_item_sk,cr_order_number,cr_return_amount,cr_net_loss] + Filter [cr_item_sk,cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_amount,cr_net_loss,cr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (16) + Filter [cp_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_page [cp_catalog_page_sk,cp_catalog_page_id] + InputAdapter + ReusedExchange [i_item_sk] #7 + InputAdapter + ReusedExchange [p_promo_sk] #8 + WholeStageCodegen (30) + HashAggregate [web_site_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(ws_ext_sales_price)),sum(coalesce(cast(wr_return_amt as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(ws_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),sales,returns,profit,channel,id,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [web_site_id] #13 + WholeStageCodegen (29) + HashAggregate [web_site_id,ws_ext_sales_price,wr_return_amt,ws_net_profit,wr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] + Project [ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss,web_site_id] + BroadcastHashJoin [ws_promo_sk,p_promo_sk] + Project [ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss,web_site_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss,web_site_id] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk,wr_return_amt,wr_net_loss] + SortMergeJoin [ws_item_sk,ws_order_number,wr_item_sk,wr_order_number] + InputAdapter + WholeStageCodegen (22) + Sort [ws_item_sk,ws_order_number] + InputAdapter + Exchange [ws_item_sk,ws_order_number] #14 + WholeStageCodegen (21) + Filter [ws_web_site_sk,ws_item_sk,ws_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_order_number,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (24) + Sort [wr_item_sk,wr_order_number] + InputAdapter + Exchange [wr_item_sk,wr_order_number] #15 + WholeStageCodegen (23) + Project [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss] + Filter [wr_item_sk,wr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss,wr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (26) + Filter [web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_site_id] + InputAdapter + ReusedExchange [i_item_sk] #7 + InputAdapter + ReusedExchange [p_promo_sk] #8 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/explain.txt new file mode 100644 index 0000000000000..93cc597893dc2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/explain.txt @@ -0,0 +1,357 @@ +== Physical Plan == +TakeOrderedAndProject (61) ++- * Project (60) + +- * BroadcastHashJoin Inner BuildRight (59) + :- * Project (38) + : +- * SortMergeJoin Inner (37) + : :- * Sort (11) + : : +- Exchange (10) + : : +- * Project (9) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.customer (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.customer_address (4) + : +- * Sort (36) + : +- Exchange (35) + : +- * Filter (34) + : +- * HashAggregate (33) + : +- Exchange (32) + : +- * HashAggregate (31) + : +- * Project (30) + : +- * SortMergeJoin Inner (29) + : :- * Sort (23) + : : +- Exchange (22) + : : +- * Project (21) + : : +- * BroadcastHashJoin Inner BuildRight (20) + : : :- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.catalog_returns (12) + : : +- BroadcastExchange (19) + : : +- * Project (18) + : : +- * Filter (17) + : : +- * ColumnarToRow (16) + : : +- Scan parquet default.date_dim (15) + : +- * Sort (28) + : +- Exchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.customer_address (24) + +- BroadcastExchange (58) + +- * Filter (57) + +- * HashAggregate (56) + +- Exchange (55) + +- * HashAggregate (54) + +- * HashAggregate (53) + +- Exchange (52) + +- * HashAggregate (51) + +- * Project (50) + +- * SortMergeJoin Inner (49) + :- * Sort (46) + : +- Exchange (45) + : +- * Project (44) + : +- * BroadcastHashJoin Inner BuildRight (43) + : :- * Filter (41) + : : +- * ColumnarToRow (40) + : : +- Scan parquet default.catalog_returns (39) + : +- ReusedExchange (42) + +- * Sort (48) + +- ReusedExchange (47) + + +(1) Scan parquet default.customer +Output [6]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [6]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6] + +(3) Filter [codegen id : 2] +Input [6]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#3)) + +(4) Scan parquet default.customer_address +Output [12]: [ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [12]: [ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] + +(6) Filter [codegen id : 1] +Input [12]: [ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +Condition : ((isnotnull(ca_state#14) AND (ca_state#14 = GA)) AND isnotnull(ca_address_sk#7)) + +(7) BroadcastExchange +Input [12]: [ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#7] +Join condition: None + +(9) Project [codegen id : 2] +Output [16]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +Input [18]: [c_customer_sk#1, c_customer_id#2, c_current_addr_sk#3, c_salutation#4, c_first_name#5, c_last_name#6, ca_address_sk#7, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] + +(10) Exchange +Input [16]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +Arguments: hashpartitioning(c_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#20] + +(11) Sort [codegen id : 3] +Input [16]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 + +(12) Scan parquet default.catalog_returns +Output [4]: [cr_returning_customer_sk#21, cr_returning_addr_sk#22, cr_return_amt_inc_tax#23, cr_returned_date_sk#24] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#24), dynamicpruningexpression(cr_returned_date_sk#24 IN dynamicpruning#25)] +PushedFilters: [IsNotNull(cr_returning_addr_sk), IsNotNull(cr_returning_customer_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 5] +Input [4]: [cr_returning_customer_sk#21, cr_returning_addr_sk#22, cr_return_amt_inc_tax#23, cr_returned_date_sk#24] + +(14) Filter [codegen id : 5] +Input [4]: [cr_returning_customer_sk#21, cr_returning_addr_sk#22, cr_return_amt_inc_tax#23, cr_returned_date_sk#24] +Condition : (isnotnull(cr_returning_addr_sk#22) AND isnotnull(cr_returning_customer_sk#21)) + +(15) Scan parquet default.date_dim +Output [2]: [d_date_sk#26, d_year#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#26, d_year#27] + +(17) Filter [codegen id : 4] +Input [2]: [d_date_sk#26, d_year#27] +Condition : ((isnotnull(d_year#27) AND (d_year#27 = 2000)) AND isnotnull(d_date_sk#26)) + +(18) Project [codegen id : 4] +Output [1]: [d_date_sk#26] +Input [2]: [d_date_sk#26, d_year#27] + +(19) BroadcastExchange +Input [1]: [d_date_sk#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] + +(20) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cr_returned_date_sk#24] +Right keys [1]: [d_date_sk#26] +Join condition: None + +(21) Project [codegen id : 5] +Output [3]: [cr_returning_customer_sk#21, cr_returning_addr_sk#22, cr_return_amt_inc_tax#23] +Input [5]: [cr_returning_customer_sk#21, cr_returning_addr_sk#22, cr_return_amt_inc_tax#23, cr_returned_date_sk#24, d_date_sk#26] + +(22) Exchange +Input [3]: [cr_returning_customer_sk#21, cr_returning_addr_sk#22, cr_return_amt_inc_tax#23] +Arguments: hashpartitioning(cr_returning_addr_sk#22, 5), ENSURE_REQUIREMENTS, [id=#29] + +(23) Sort [codegen id : 6] +Input [3]: [cr_returning_customer_sk#21, cr_returning_addr_sk#22, cr_return_amt_inc_tax#23] +Arguments: [cr_returning_addr_sk#22 ASC NULLS FIRST], false, 0 + +(24) Scan parquet default.customer_address +Output [2]: [ca_address_sk#30, ca_state#31] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_state)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#30, ca_state#31] + +(26) Filter [codegen id : 7] +Input [2]: [ca_address_sk#30, ca_state#31] +Condition : (isnotnull(ca_address_sk#30) AND isnotnull(ca_state#31)) + +(27) Exchange +Input [2]: [ca_address_sk#30, ca_state#31] +Arguments: hashpartitioning(ca_address_sk#30, 5), ENSURE_REQUIREMENTS, [id=#32] + +(28) Sort [codegen id : 8] +Input [2]: [ca_address_sk#30, ca_state#31] +Arguments: [ca_address_sk#30 ASC NULLS FIRST], false, 0 + +(29) SortMergeJoin [codegen id : 9] +Left keys [1]: [cr_returning_addr_sk#22] +Right keys [1]: [ca_address_sk#30] +Join condition: None + +(30) Project [codegen id : 9] +Output [3]: [cr_returning_customer_sk#21, cr_return_amt_inc_tax#23, ca_state#31] +Input [5]: [cr_returning_customer_sk#21, cr_returning_addr_sk#22, cr_return_amt_inc_tax#23, ca_address_sk#30, ca_state#31] + +(31) HashAggregate [codegen id : 9] +Input [3]: [cr_returning_customer_sk#21, cr_return_amt_inc_tax#23, ca_state#31] +Keys [2]: [cr_returning_customer_sk#21, ca_state#31] +Functions [1]: [partial_sum(UnscaledValue(cr_return_amt_inc_tax#23))] +Aggregate Attributes [1]: [sum#33] +Results [3]: [cr_returning_customer_sk#21, ca_state#31, sum#34] + +(32) Exchange +Input [3]: [cr_returning_customer_sk#21, ca_state#31, sum#34] +Arguments: hashpartitioning(cr_returning_customer_sk#21, ca_state#31, 5), ENSURE_REQUIREMENTS, [id=#35] + +(33) HashAggregate [codegen id : 10] +Input [3]: [cr_returning_customer_sk#21, ca_state#31, sum#34] +Keys [2]: [cr_returning_customer_sk#21, ca_state#31] +Functions [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#23))] +Aggregate Attributes [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#23))#36] +Results [3]: [cr_returning_customer_sk#21 AS ctr_customer_sk#37, ca_state#31 AS ctr_state#38, MakeDecimal(sum(UnscaledValue(cr_return_amt_inc_tax#23))#36,17,2) AS ctr_total_return#39] + +(34) Filter [codegen id : 10] +Input [3]: [ctr_customer_sk#37, ctr_state#38, ctr_total_return#39] +Condition : isnotnull(ctr_total_return#39) + +(35) Exchange +Input [3]: [ctr_customer_sk#37, ctr_state#38, ctr_total_return#39] +Arguments: hashpartitioning(ctr_customer_sk#37, 5), ENSURE_REQUIREMENTS, [id=#40] + +(36) Sort [codegen id : 11] +Input [3]: [ctr_customer_sk#37, ctr_state#38, ctr_total_return#39] +Arguments: [ctr_customer_sk#37 ASC NULLS FIRST], false, 0 + +(37) SortMergeJoin [codegen id : 20] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ctr_customer_sk#37] +Join condition: None + +(38) Project [codegen id : 20] +Output [17]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_state#38, ctr_total_return#39] +Input [19]: [c_customer_sk#1, c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_customer_sk#37, ctr_state#38, ctr_total_return#39] + +(39) Scan parquet default.catalog_returns +Output [4]: [cr_returning_customer_sk#41, cr_returning_addr_sk#42, cr_return_amt_inc_tax#43, cr_returned_date_sk#44] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#44), dynamicpruningexpression(cr_returned_date_sk#44 IN dynamicpruning#25)] +PushedFilters: [IsNotNull(cr_returning_addr_sk)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 13] +Input [4]: [cr_returning_customer_sk#41, cr_returning_addr_sk#42, cr_return_amt_inc_tax#43, cr_returned_date_sk#44] + +(41) Filter [codegen id : 13] +Input [4]: [cr_returning_customer_sk#41, cr_returning_addr_sk#42, cr_return_amt_inc_tax#43, cr_returned_date_sk#44] +Condition : isnotnull(cr_returning_addr_sk#42) + +(42) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#45] + +(43) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [cr_returned_date_sk#44] +Right keys [1]: [d_date_sk#45] +Join condition: None + +(44) Project [codegen id : 13] +Output [3]: [cr_returning_customer_sk#41, cr_returning_addr_sk#42, cr_return_amt_inc_tax#43] +Input [5]: [cr_returning_customer_sk#41, cr_returning_addr_sk#42, cr_return_amt_inc_tax#43, cr_returned_date_sk#44, d_date_sk#45] + +(45) Exchange +Input [3]: [cr_returning_customer_sk#41, cr_returning_addr_sk#42, cr_return_amt_inc_tax#43] +Arguments: hashpartitioning(cr_returning_addr_sk#42, 5), ENSURE_REQUIREMENTS, [id=#46] + +(46) Sort [codegen id : 14] +Input [3]: [cr_returning_customer_sk#41, cr_returning_addr_sk#42, cr_return_amt_inc_tax#43] +Arguments: [cr_returning_addr_sk#42 ASC NULLS FIRST], false, 0 + +(47) ReusedExchange [Reuses operator id: 27] +Output [2]: [ca_address_sk#47, ca_state#48] + +(48) Sort [codegen id : 16] +Input [2]: [ca_address_sk#47, ca_state#48] +Arguments: [ca_address_sk#47 ASC NULLS FIRST], false, 0 + +(49) SortMergeJoin [codegen id : 17] +Left keys [1]: [cr_returning_addr_sk#42] +Right keys [1]: [ca_address_sk#47] +Join condition: None + +(50) Project [codegen id : 17] +Output [3]: [cr_returning_customer_sk#41, cr_return_amt_inc_tax#43, ca_state#48] +Input [5]: [cr_returning_customer_sk#41, cr_returning_addr_sk#42, cr_return_amt_inc_tax#43, ca_address_sk#47, ca_state#48] + +(51) HashAggregate [codegen id : 17] +Input [3]: [cr_returning_customer_sk#41, cr_return_amt_inc_tax#43, ca_state#48] +Keys [2]: [cr_returning_customer_sk#41, ca_state#48] +Functions [1]: [partial_sum(UnscaledValue(cr_return_amt_inc_tax#43))] +Aggregate Attributes [1]: [sum#49] +Results [3]: [cr_returning_customer_sk#41, ca_state#48, sum#50] + +(52) Exchange +Input [3]: [cr_returning_customer_sk#41, ca_state#48, sum#50] +Arguments: hashpartitioning(cr_returning_customer_sk#41, ca_state#48, 5), ENSURE_REQUIREMENTS, [id=#51] + +(53) HashAggregate [codegen id : 18] +Input [3]: [cr_returning_customer_sk#41, ca_state#48, sum#50] +Keys [2]: [cr_returning_customer_sk#41, ca_state#48] +Functions [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#43))] +Aggregate Attributes [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#43))#52] +Results [2]: [ca_state#48 AS ctr_state#38, MakeDecimal(sum(UnscaledValue(cr_return_amt_inc_tax#43))#52,17,2) AS ctr_total_return#39] + +(54) HashAggregate [codegen id : 18] +Input [2]: [ctr_state#38, ctr_total_return#39] +Keys [1]: [ctr_state#38] +Functions [1]: [partial_avg(ctr_total_return#39)] +Aggregate Attributes [2]: [sum#53, count#54] +Results [3]: [ctr_state#38, sum#55, count#56] + +(55) Exchange +Input [3]: [ctr_state#38, sum#55, count#56] +Arguments: hashpartitioning(ctr_state#38, 5), ENSURE_REQUIREMENTS, [id=#57] + +(56) HashAggregate [codegen id : 19] +Input [3]: [ctr_state#38, sum#55, count#56] +Keys [1]: [ctr_state#38] +Functions [1]: [avg(ctr_total_return#39)] +Aggregate Attributes [1]: [avg(ctr_total_return#39)#58] +Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#39)#58) * 1.200000), DecimalType(24,7), true) AS (avg(ctr_total_return) * 1.2)#59, ctr_state#38 AS ctr_state#38#60] + +(57) Filter [codegen id : 19] +Input [2]: [(avg(ctr_total_return) * 1.2)#59, ctr_state#38#60] +Condition : isnotnull((avg(ctr_total_return) * 1.2)#59) + +(58) BroadcastExchange +Input [2]: [(avg(ctr_total_return) * 1.2)#59, ctr_state#38#60] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#61] + +(59) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [ctr_state#38] +Right keys [1]: [ctr_state#38#60] +Join condition: (cast(ctr_total_return#39 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#59) + +(60) Project [codegen id : 20] +Output [16]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_total_return#39] +Input [19]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_state#38, ctr_total_return#39, (avg(ctr_total_return) * 1.2)#59, ctr_state#38#60] + +(61) TakeOrderedAndProject +Input [16]: [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_total_return#39] +Arguments: 100, [c_customer_id#2 ASC NULLS FIRST, c_salutation#4 ASC NULLS FIRST, c_first_name#5 ASC NULLS FIRST, c_last_name#6 ASC NULLS FIRST, ca_street_number#8 ASC NULLS FIRST, ca_street_name#9 ASC NULLS FIRST, ca_street_type#10 ASC NULLS FIRST, ca_suite_number#11 ASC NULLS FIRST, ca_city#12 ASC NULLS FIRST, ca_county#13 ASC NULLS FIRST, ca_state#14 ASC NULLS FIRST, ca_zip#15 ASC NULLS FIRST, ca_country#16 ASC NULLS FIRST, ca_gmt_offset#17 ASC NULLS FIRST, ca_location_type#18 ASC NULLS FIRST, ctr_total_return#39 ASC NULLS FIRST], [c_customer_id#2, c_salutation#4, c_first_name#5, c_last_name#6, ca_street_number#8, ca_street_name#9, ca_street_type#10, ca_suite_number#11, ca_city#12, ca_county#13, ca_state#14, ca_zip#15, ca_country#16, ca_gmt_offset#17, ca_location_type#18, ctr_total_return#39] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 12 Hosting Expression = cr_returned_date_sk#24 IN dynamicpruning#25 +ReusedExchange (62) + + +(62) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#26] + +Subquery:2 Hosting operator id = 39 Hosting Expression = cr_returned_date_sk#44 IN dynamicpruning#25 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/simplified.txt new file mode 100644 index 0000000000000..cee20aeec3948 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81.sf100/simplified.txt @@ -0,0 +1,107 @@ +TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,ctr_total_return] + WholeStageCodegen (20) + Project [c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,ctr_total_return] + BroadcastHashJoin [ctr_state,ctr_state,ctr_total_return,(avg(ctr_total_return) * 1.2)] + Project [c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,ctr_state,ctr_total_return] + SortMergeJoin [c_customer_sk,ctr_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #1 + WholeStageCodegen (2) + Project [c_customer_sk,c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type] + InputAdapter + WholeStageCodegen (11) + Sort [ctr_customer_sk] + InputAdapter + Exchange [ctr_customer_sk] #3 + WholeStageCodegen (10) + Filter [ctr_total_return] + HashAggregate [cr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(cr_return_amt_inc_tax)),ctr_customer_sk,ctr_state,ctr_total_return,sum] + InputAdapter + Exchange [cr_returning_customer_sk,ca_state] #4 + WholeStageCodegen (9) + HashAggregate [cr_returning_customer_sk,ca_state,cr_return_amt_inc_tax] [sum,sum] + Project [cr_returning_customer_sk,cr_return_amt_inc_tax,ca_state] + SortMergeJoin [cr_returning_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (6) + Sort [cr_returning_addr_sk] + InputAdapter + Exchange [cr_returning_addr_sk] #5 + WholeStageCodegen (5) + Project [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + Filter [cr_returning_addr_sk,cr_returning_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax,cr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (8) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #7 + WholeStageCodegen (7) + Filter [ca_address_sk,ca_state] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (19) + Filter [(avg(ctr_total_return) * 1.2)] + HashAggregate [ctr_state,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_state,sum,count] + InputAdapter + Exchange [ctr_state] #9 + WholeStageCodegen (18) + HashAggregate [ctr_state,ctr_total_return] [sum,count,sum,count] + HashAggregate [cr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(cr_return_amt_inc_tax)),ctr_state,ctr_total_return,sum] + InputAdapter + Exchange [cr_returning_customer_sk,ca_state] #10 + WholeStageCodegen (17) + HashAggregate [cr_returning_customer_sk,ca_state,cr_return_amt_inc_tax] [sum,sum] + Project [cr_returning_customer_sk,cr_return_amt_inc_tax,ca_state] + SortMergeJoin [cr_returning_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (14) + Sort [cr_returning_addr_sk] + InputAdapter + Exchange [cr_returning_addr_sk] #11 + WholeStageCodegen (13) + Project [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + Filter [cr_returning_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax,cr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #6 + InputAdapter + WholeStageCodegen (16) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_state] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81/explain.txt new file mode 100644 index 0000000000000..04371a7f43d2a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81/explain.txt @@ -0,0 +1,312 @@ +== Physical Plan == +TakeOrderedAndProject (52) ++- * Project (51) + +- * BroadcastHashJoin Inner BuildRight (50) + :- * Project (45) + : +- * BroadcastHashJoin Inner BuildRight (44) + : :- * Project (39) + : : +- * BroadcastHashJoin Inner BuildRight (38) + : : :- * Filter (20) + : : : +- * HashAggregate (19) + : : : +- Exchange (18) + : : : +- * HashAggregate (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_returns (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.customer_address (11) + : : +- BroadcastExchange (37) + : : +- * Filter (36) + : : +- * HashAggregate (35) + : : +- Exchange (34) + : : +- * HashAggregate (33) + : : +- * HashAggregate (32) + : : +- Exchange (31) + : : +- * HashAggregate (30) + : : +- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Project (26) + : : : +- * BroadcastHashJoin Inner BuildRight (25) + : : : :- * Filter (23) + : : : : +- * ColumnarToRow (22) + : : : : +- Scan parquet default.catalog_returns (21) + : : : +- ReusedExchange (24) + : : +- ReusedExchange (27) + : +- BroadcastExchange (43) + : +- * Filter (42) + : +- * ColumnarToRow (41) + : +- Scan parquet default.customer (40) + +- BroadcastExchange (49) + +- * Filter (48) + +- * ColumnarToRow (47) + +- Scan parquet default.customer_address (46) + + +(1) Scan parquet default.catalog_returns +Output [4]: [cr_returning_customer_sk#1, cr_returning_addr_sk#2, cr_return_amt_inc_tax#3, cr_returned_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#4), dynamicpruningexpression(cr_returned_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cr_returning_addr_sk), IsNotNull(cr_returning_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [cr_returning_customer_sk#1, cr_returning_addr_sk#2, cr_return_amt_inc_tax#3, cr_returned_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [cr_returning_customer_sk#1, cr_returning_addr_sk#2, cr_return_amt_inc_tax#3, cr_returned_date_sk#4] +Condition : (isnotnull(cr_returning_addr_sk#2) AND isnotnull(cr_returning_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_year#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] +Condition : ((isnotnull(d_year#7) AND (d_year#7 = 2000)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_year#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cr_returned_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [cr_returning_customer_sk#1, cr_returning_addr_sk#2, cr_return_amt_inc_tax#3] +Input [5]: [cr_returning_customer_sk#1, cr_returning_addr_sk#2, cr_return_amt_inc_tax#3, cr_returned_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.customer_address +Output [2]: [ca_address_sk#9, ca_state#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_state)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [ca_address_sk#9, ca_state#10] + +(13) Filter [codegen id : 2] +Input [2]: [ca_address_sk#9, ca_state#10] +Condition : (isnotnull(ca_address_sk#9) AND isnotnull(ca_state#10)) + +(14) BroadcastExchange +Input [2]: [ca_address_sk#9, ca_state#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cr_returning_addr_sk#2] +Right keys [1]: [ca_address_sk#9] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [cr_returning_customer_sk#1, cr_return_amt_inc_tax#3, ca_state#10] +Input [5]: [cr_returning_customer_sk#1, cr_returning_addr_sk#2, cr_return_amt_inc_tax#3, ca_address_sk#9, ca_state#10] + +(17) HashAggregate [codegen id : 3] +Input [3]: [cr_returning_customer_sk#1, cr_return_amt_inc_tax#3, ca_state#10] +Keys [2]: [cr_returning_customer_sk#1, ca_state#10] +Functions [1]: [partial_sum(UnscaledValue(cr_return_amt_inc_tax#3))] +Aggregate Attributes [1]: [sum#12] +Results [3]: [cr_returning_customer_sk#1, ca_state#10, sum#13] + +(18) Exchange +Input [3]: [cr_returning_customer_sk#1, ca_state#10, sum#13] +Arguments: hashpartitioning(cr_returning_customer_sk#1, ca_state#10, 5), ENSURE_REQUIREMENTS, [id=#14] + +(19) HashAggregate [codegen id : 11] +Input [3]: [cr_returning_customer_sk#1, ca_state#10, sum#13] +Keys [2]: [cr_returning_customer_sk#1, ca_state#10] +Functions [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#3))#15] +Results [3]: [cr_returning_customer_sk#1 AS ctr_customer_sk#16, ca_state#10 AS ctr_state#17, MakeDecimal(sum(UnscaledValue(cr_return_amt_inc_tax#3))#15,17,2) AS ctr_total_return#18] + +(20) Filter [codegen id : 11] +Input [3]: [ctr_customer_sk#16, ctr_state#17, ctr_total_return#18] +Condition : isnotnull(ctr_total_return#18) + +(21) Scan parquet default.catalog_returns +Output [4]: [cr_returning_customer_sk#19, cr_returning_addr_sk#20, cr_return_amt_inc_tax#21, cr_returned_date_sk#22] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#22), dynamicpruningexpression(cr_returned_date_sk#22 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cr_returning_addr_sk)] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 6] +Input [4]: [cr_returning_customer_sk#19, cr_returning_addr_sk#20, cr_return_amt_inc_tax#21, cr_returned_date_sk#22] + +(23) Filter [codegen id : 6] +Input [4]: [cr_returning_customer_sk#19, cr_returning_addr_sk#20, cr_return_amt_inc_tax#21, cr_returned_date_sk#22] +Condition : isnotnull(cr_returning_addr_sk#20) + +(24) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#23] + +(25) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cr_returned_date_sk#22] +Right keys [1]: [d_date_sk#23] +Join condition: None + +(26) Project [codegen id : 6] +Output [3]: [cr_returning_customer_sk#19, cr_returning_addr_sk#20, cr_return_amt_inc_tax#21] +Input [5]: [cr_returning_customer_sk#19, cr_returning_addr_sk#20, cr_return_amt_inc_tax#21, cr_returned_date_sk#22, d_date_sk#23] + +(27) ReusedExchange [Reuses operator id: 14] +Output [2]: [ca_address_sk#24, ca_state#25] + +(28) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cr_returning_addr_sk#20] +Right keys [1]: [ca_address_sk#24] +Join condition: None + +(29) Project [codegen id : 6] +Output [3]: [cr_returning_customer_sk#19, cr_return_amt_inc_tax#21, ca_state#25] +Input [5]: [cr_returning_customer_sk#19, cr_returning_addr_sk#20, cr_return_amt_inc_tax#21, ca_address_sk#24, ca_state#25] + +(30) HashAggregate [codegen id : 6] +Input [3]: [cr_returning_customer_sk#19, cr_return_amt_inc_tax#21, ca_state#25] +Keys [2]: [cr_returning_customer_sk#19, ca_state#25] +Functions [1]: [partial_sum(UnscaledValue(cr_return_amt_inc_tax#21))] +Aggregate Attributes [1]: [sum#26] +Results [3]: [cr_returning_customer_sk#19, ca_state#25, sum#27] + +(31) Exchange +Input [3]: [cr_returning_customer_sk#19, ca_state#25, sum#27] +Arguments: hashpartitioning(cr_returning_customer_sk#19, ca_state#25, 5), ENSURE_REQUIREMENTS, [id=#28] + +(32) HashAggregate [codegen id : 7] +Input [3]: [cr_returning_customer_sk#19, ca_state#25, sum#27] +Keys [2]: [cr_returning_customer_sk#19, ca_state#25] +Functions [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#21))] +Aggregate Attributes [1]: [sum(UnscaledValue(cr_return_amt_inc_tax#21))#29] +Results [2]: [ca_state#25 AS ctr_state#17, MakeDecimal(sum(UnscaledValue(cr_return_amt_inc_tax#21))#29,17,2) AS ctr_total_return#18] + +(33) HashAggregate [codegen id : 7] +Input [2]: [ctr_state#17, ctr_total_return#18] +Keys [1]: [ctr_state#17] +Functions [1]: [partial_avg(ctr_total_return#18)] +Aggregate Attributes [2]: [sum#30, count#31] +Results [3]: [ctr_state#17, sum#32, count#33] + +(34) Exchange +Input [3]: [ctr_state#17, sum#32, count#33] +Arguments: hashpartitioning(ctr_state#17, 5), ENSURE_REQUIREMENTS, [id=#34] + +(35) HashAggregate [codegen id : 8] +Input [3]: [ctr_state#17, sum#32, count#33] +Keys [1]: [ctr_state#17] +Functions [1]: [avg(ctr_total_return#18)] +Aggregate Attributes [1]: [avg(ctr_total_return#18)#35] +Results [2]: [CheckOverflow((promote_precision(avg(ctr_total_return#18)#35) * 1.200000), DecimalType(24,7), true) AS (avg(ctr_total_return) * 1.2)#36, ctr_state#17 AS ctr_state#17#37] + +(36) Filter [codegen id : 8] +Input [2]: [(avg(ctr_total_return) * 1.2)#36, ctr_state#17#37] +Condition : isnotnull((avg(ctr_total_return) * 1.2)#36) + +(37) BroadcastExchange +Input [2]: [(avg(ctr_total_return) * 1.2)#36, ctr_state#17#37] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#38] + +(38) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ctr_state#17] +Right keys [1]: [ctr_state#17#37] +Join condition: (cast(ctr_total_return#18 as decimal(24,7)) > (avg(ctr_total_return) * 1.2)#36) + +(39) Project [codegen id : 11] +Output [2]: [ctr_customer_sk#16, ctr_total_return#18] +Input [5]: [ctr_customer_sk#16, ctr_state#17, ctr_total_return#18, (avg(ctr_total_return) * 1.2)#36, ctr_state#17#37] + +(40) Scan parquet default.customer +Output [6]: [c_customer_sk#39, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 9] +Input [6]: [c_customer_sk#39, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44] + +(42) Filter [codegen id : 9] +Input [6]: [c_customer_sk#39, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44] +Condition : (isnotnull(c_customer_sk#39) AND isnotnull(c_current_addr_sk#41)) + +(43) BroadcastExchange +Input [6]: [c_customer_sk#39, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#45] + +(44) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ctr_customer_sk#16] +Right keys [1]: [c_customer_sk#39] +Join condition: None + +(45) Project [codegen id : 11] +Output [6]: [ctr_total_return#18, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44] +Input [8]: [ctr_customer_sk#16, ctr_total_return#18, c_customer_sk#39, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44] + +(46) Scan parquet default.customer_address +Output [12]: [ca_address_sk#46, ca_street_number#47, ca_street_name#48, ca_street_type#49, ca_suite_number#50, ca_city#51, ca_county#52, ca_state#53, ca_zip#54, ca_country#55, ca_gmt_offset#56, ca_location_type#57] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,GA), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 10] +Input [12]: [ca_address_sk#46, ca_street_number#47, ca_street_name#48, ca_street_type#49, ca_suite_number#50, ca_city#51, ca_county#52, ca_state#53, ca_zip#54, ca_country#55, ca_gmt_offset#56, ca_location_type#57] + +(48) Filter [codegen id : 10] +Input [12]: [ca_address_sk#46, ca_street_number#47, ca_street_name#48, ca_street_type#49, ca_suite_number#50, ca_city#51, ca_county#52, ca_state#53, ca_zip#54, ca_country#55, ca_gmt_offset#56, ca_location_type#57] +Condition : ((isnotnull(ca_state#53) AND (ca_state#53 = GA)) AND isnotnull(ca_address_sk#46)) + +(49) BroadcastExchange +Input [12]: [ca_address_sk#46, ca_street_number#47, ca_street_name#48, ca_street_type#49, ca_suite_number#50, ca_city#51, ca_county#52, ca_state#53, ca_zip#54, ca_country#55, ca_gmt_offset#56, ca_location_type#57] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#58] + +(50) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [c_current_addr_sk#41] +Right keys [1]: [ca_address_sk#46] +Join condition: None + +(51) Project [codegen id : 11] +Output [16]: [c_customer_id#40, c_salutation#42, c_first_name#43, c_last_name#44, ca_street_number#47, ca_street_name#48, ca_street_type#49, ca_suite_number#50, ca_city#51, ca_county#52, ca_state#53, ca_zip#54, ca_country#55, ca_gmt_offset#56, ca_location_type#57, ctr_total_return#18] +Input [18]: [ctr_total_return#18, c_customer_id#40, c_current_addr_sk#41, c_salutation#42, c_first_name#43, c_last_name#44, ca_address_sk#46, ca_street_number#47, ca_street_name#48, ca_street_type#49, ca_suite_number#50, ca_city#51, ca_county#52, ca_state#53, ca_zip#54, ca_country#55, ca_gmt_offset#56, ca_location_type#57] + +(52) TakeOrderedAndProject +Input [16]: [c_customer_id#40, c_salutation#42, c_first_name#43, c_last_name#44, ca_street_number#47, ca_street_name#48, ca_street_type#49, ca_suite_number#50, ca_city#51, ca_county#52, ca_state#53, ca_zip#54, ca_country#55, ca_gmt_offset#56, ca_location_type#57, ctr_total_return#18] +Arguments: 100, [c_customer_id#40 ASC NULLS FIRST, c_salutation#42 ASC NULLS FIRST, c_first_name#43 ASC NULLS FIRST, c_last_name#44 ASC NULLS FIRST, ca_street_number#47 ASC NULLS FIRST, ca_street_name#48 ASC NULLS FIRST, ca_street_type#49 ASC NULLS FIRST, ca_suite_number#50 ASC NULLS FIRST, ca_city#51 ASC NULLS FIRST, ca_county#52 ASC NULLS FIRST, ca_state#53 ASC NULLS FIRST, ca_zip#54 ASC NULLS FIRST, ca_country#55 ASC NULLS FIRST, ca_gmt_offset#56 ASC NULLS FIRST, ca_location_type#57 ASC NULLS FIRST, ctr_total_return#18 ASC NULLS FIRST], [c_customer_id#40, c_salutation#42, c_first_name#43, c_last_name#44, ca_street_number#47, ca_street_name#48, ca_street_type#49, ca_suite_number#50, ca_city#51, ca_county#52, ca_state#53, ca_zip#54, ca_country#55, ca_gmt_offset#56, ca_location_type#57, ctr_total_return#18] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cr_returned_date_sk#4 IN dynamicpruning#5 +ReusedExchange (53) + + +(53) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 21 Hosting Expression = cr_returned_date_sk#22 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81/simplified.txt new file mode 100644 index 0000000000000..767205a90cddf --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q81/simplified.txt @@ -0,0 +1,80 @@ +TakeOrderedAndProject [c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,ctr_total_return] + WholeStageCodegen (11) + Project [c_customer_id,c_salutation,c_first_name,c_last_name,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type,ctr_total_return] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [ctr_total_return,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name] + BroadcastHashJoin [ctr_customer_sk,c_customer_sk] + Project [ctr_customer_sk,ctr_total_return] + BroadcastHashJoin [ctr_state,ctr_state,ctr_total_return,(avg(ctr_total_return) * 1.2)] + Filter [ctr_total_return] + HashAggregate [cr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(cr_return_amt_inc_tax)),ctr_customer_sk,ctr_state,ctr_total_return,sum] + InputAdapter + Exchange [cr_returning_customer_sk,ca_state] #1 + WholeStageCodegen (3) + HashAggregate [cr_returning_customer_sk,ca_state,cr_return_amt_inc_tax] [sum,sum] + Project [cr_returning_customer_sk,cr_return_amt_inc_tax,ca_state] + BroadcastHashJoin [cr_returning_addr_sk,ca_address_sk] + Project [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + Filter [cr_returning_addr_sk,cr_returning_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax,cr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [ca_address_sk,ca_state] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (8) + Filter [(avg(ctr_total_return) * 1.2)] + HashAggregate [ctr_state,sum,count] [avg(ctr_total_return),(avg(ctr_total_return) * 1.2),ctr_state,sum,count] + InputAdapter + Exchange [ctr_state] #5 + WholeStageCodegen (7) + HashAggregate [ctr_state,ctr_total_return] [sum,count,sum,count] + HashAggregate [cr_returning_customer_sk,ca_state,sum] [sum(UnscaledValue(cr_return_amt_inc_tax)),ctr_state,ctr_total_return,sum] + InputAdapter + Exchange [cr_returning_customer_sk,ca_state] #6 + WholeStageCodegen (6) + HashAggregate [cr_returning_customer_sk,ca_state,cr_return_amt_inc_tax] [sum,sum] + Project [cr_returning_customer_sk,cr_return_amt_inc_tax,ca_state] + BroadcastHashJoin [cr_returning_addr_sk,ca_address_sk] + Project [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + Filter [cr_returning_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_returning_customer_sk,cr_returning_addr_sk,cr_return_amt_inc_tax,cr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [ca_address_sk,ca_state] #3 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (9) + Filter [c_customer_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_current_addr_sk,c_salutation,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (10) + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_street_number,ca_street_name,ca_street_type,ca_suite_number,ca_city,ca_county,ca_state,ca_zip,ca_country,ca_gmt_offset,ca_location_type] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/explain.txt new file mode 100644 index 0000000000000..6725e273a3acc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/explain.txt @@ -0,0 +1,191 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * HashAggregate (31) + +- Exchange (30) + +- * HashAggregate (29) + +- * Project (28) + +- * SortMergeJoin Inner (27) + :- * Sort (20) + : +- Exchange (19) + : +- * Project (18) + : +- * BroadcastHashJoin Inner BuildRight (17) + : :- * Project (11) + : : +- * BroadcastHashJoin Inner BuildLeft (10) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Project (9) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.inventory (6) + : +- BroadcastExchange (16) + : +- * Project (15) + : +- * Filter (14) + : +- * ColumnarToRow (13) + : +- Scan parquet default.date_dim (12) + +- * Sort (26) + +- Exchange (25) + +- * Project (24) + +- * Filter (23) + +- * ColumnarToRow (22) + +- Scan parquet default.store_sales (21) + + +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,62.00), LessThanOrEqual(i_current_price,92.00), In(i_manufact_id, [129,270,821,423]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] + +(3) Filter [codegen id : 1] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +Condition : ((((isnotnull(i_current_price#4) AND (i_current_price#4 >= 62.00)) AND (i_current_price#4 <= 92.00)) AND i_manufact_id#5 IN (129,270,821,423)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] + +(5) BroadcastExchange +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#6] + +(6) Scan parquet default.inventory +Output [3]: [inv_item_sk#7, inv_quantity_on_hand#8, inv_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#9), dynamicpruningexpression(inv_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [3]: [inv_item_sk#7, inv_quantity_on_hand#8, inv_date_sk#9] + +(8) Filter +Input [3]: [inv_item_sk#7, inv_quantity_on_hand#8, inv_date_sk#9] +Condition : (((isnotnull(inv_quantity_on_hand#8) AND (inv_quantity_on_hand#8 >= 100)) AND (inv_quantity_on_hand#8 <= 500)) AND isnotnull(inv_item_sk#7)) + +(9) Project +Output [2]: [inv_item_sk#7, inv_date_sk#9] +Input [3]: [inv_item_sk#7, inv_quantity_on_hand#8, inv_date_sk#9] + +(10) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [inv_item_sk#7] +Join condition: None + +(11) Project [codegen id : 3] +Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#9] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_item_sk#7, inv_date_sk#9] + +(12) Scan parquet default.date_dim +Output [2]: [d_date_sk#11, d_date#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-05-25), LessThanOrEqual(d_date,2000-07-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#11, d_date#12] + +(14) Filter [codegen id : 2] +Input [2]: [d_date_sk#11, d_date#12] +Condition : (((isnotnull(d_date#12) AND (d_date#12 >= 2000-05-25)) AND (d_date#12 <= 2000-07-24)) AND isnotnull(d_date_sk#11)) + +(15) Project [codegen id : 2] +Output [1]: [d_date_sk#11] +Input [2]: [d_date_sk#11, d_date#12] + +(16) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(17) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_date_sk#9] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(18) Project [codegen id : 3] +Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#9, d_date_sk#11] + +(19) Exchange +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: hashpartitioning(i_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#14] + +(20) Sort [codegen id : 4] +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: [i_item_sk#1 ASC NULLS FIRST], false, 0 + +(21) Scan parquet default.store_sales +Output [2]: [ss_item_sk#15, ss_sold_date_sk#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 5] +Input [2]: [ss_item_sk#15, ss_sold_date_sk#16] + +(23) Filter [codegen id : 5] +Input [2]: [ss_item_sk#15, ss_sold_date_sk#16] +Condition : isnotnull(ss_item_sk#15) + +(24) Project [codegen id : 5] +Output [1]: [ss_item_sk#15] +Input [2]: [ss_item_sk#15, ss_sold_date_sk#16] + +(25) Exchange +Input [1]: [ss_item_sk#15] +Arguments: hashpartitioning(ss_item_sk#15, 5), ENSURE_REQUIREMENTS, [id=#17] + +(26) Sort [codegen id : 6] +Input [1]: [ss_item_sk#15] +Arguments: [ss_item_sk#15 ASC NULLS FIRST], false, 0 + +(27) SortMergeJoin [codegen id : 7] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#15] +Join condition: None + +(28) Project [codegen id : 7] +Output [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, ss_item_sk#15] + +(29) HashAggregate [codegen id : 7] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Functions: [] +Aggregate Attributes: [] +Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] + +(30) Exchange +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_current_price#4, 5), ENSURE_REQUIREMENTS, [id=#18] + +(31) HashAggregate [codegen id : 8] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Functions: [] +Aggregate Attributes: [] +Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] + +(32) TakeOrderedAndProject +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: 100, [i_item_id#2 ASC NULLS FIRST], [i_item_id#2, i_item_desc#3, i_current_price#4] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = inv_date_sk#9 IN dynamicpruning#10 +ReusedExchange (33) + + +(33) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/simplified.txt new file mode 100644 index 0000000000000..1a22750705b3c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82.sf100/simplified.txt @@ -0,0 +1,53 @@ +TakeOrderedAndProject [i_item_id,i_item_desc,i_current_price] + WholeStageCodegen (8) + HashAggregate [i_item_id,i_item_desc,i_current_price] + InputAdapter + Exchange [i_item_id,i_item_desc,i_current_price] #1 + WholeStageCodegen (7) + HashAggregate [i_item_id,i_item_desc,i_current_price] + Project [i_item_id,i_item_desc,i_current_price] + SortMergeJoin [i_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #2 + WholeStageCodegen (3) + Project [i_item_sk,i_item_id,i_item_desc,i_current_price] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [i_item_sk,i_item_id,i_item_desc,i_current_price,inv_date_sk] + BroadcastHashJoin [i_item_sk,inv_item_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk,i_item_id,i_item_desc,i_current_price] + Filter [i_current_price,i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_manufact_id] + Project [inv_item_sk,inv_date_sk] + Filter [inv_quantity_on_hand,inv_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + WholeStageCodegen (6) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #5 + WholeStageCodegen (5) + Project [ss_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82/explain.txt new file mode 100644 index 0000000000000..a03333f7623cc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82/explain.txt @@ -0,0 +1,176 @@ +== Physical Plan == +TakeOrderedAndProject (29) ++- * HashAggregate (28) + +- Exchange (27) + +- * HashAggregate (26) + +- * Project (25) + +- * BroadcastHashJoin Inner BuildLeft (24) + :- BroadcastExchange (19) + : +- * Project (18) + : +- * BroadcastHashJoin Inner BuildRight (17) + : :- * Project (11) + : : +- * BroadcastHashJoin Inner BuildRight (10) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- BroadcastExchange (9) + : : +- * Project (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.inventory (5) + : +- BroadcastExchange (16) + : +- * Project (15) + : +- * Filter (14) + : +- * ColumnarToRow (13) + : +- Scan parquet default.date_dim (12) + +- * Project (23) + +- * Filter (22) + +- * ColumnarToRow (21) + +- Scan parquet default.store_sales (20) + + +(1) Scan parquet default.item +Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThanOrEqual(i_current_price,62.00), LessThanOrEqual(i_current_price,92.00), In(i_manufact_id, [129,270,821,423]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] + +(3) Filter [codegen id : 3] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] +Condition : ((((isnotnull(i_current_price#4) AND (i_current_price#4 >= 62.00)) AND (i_current_price#4 <= 92.00)) AND i_manufact_id#5 IN (129,270,821,423)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 3] +Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, i_manufact_id#5] + +(5) Scan parquet default.inventory +Output [3]: [inv_item_sk#6, inv_quantity_on_hand#7, inv_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#8), dynamicpruningexpression(inv_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(inv_quantity_on_hand), GreaterThanOrEqual(inv_quantity_on_hand,100), LessThanOrEqual(inv_quantity_on_hand,500), IsNotNull(inv_item_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [inv_item_sk#6, inv_quantity_on_hand#7, inv_date_sk#8] + +(7) Filter [codegen id : 1] +Input [3]: [inv_item_sk#6, inv_quantity_on_hand#7, inv_date_sk#8] +Condition : (((isnotnull(inv_quantity_on_hand#7) AND (inv_quantity_on_hand#7 >= 100)) AND (inv_quantity_on_hand#7 <= 500)) AND isnotnull(inv_item_sk#6)) + +(8) Project [codegen id : 1] +Output [2]: [inv_item_sk#6, inv_date_sk#8] +Input [3]: [inv_item_sk#6, inv_quantity_on_hand#7, inv_date_sk#8] + +(9) BroadcastExchange +Input [2]: [inv_item_sk#6, inv_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(10) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [inv_item_sk#6] +Join condition: None + +(11) Project [codegen id : 3] +Output [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#8] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_item_sk#6, inv_date_sk#8] + +(12) Scan parquet default.date_dim +Output [2]: [d_date_sk#11, d_date#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-05-25), LessThanOrEqual(d_date,2000-07-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#11, d_date#12] + +(14) Filter [codegen id : 2] +Input [2]: [d_date_sk#11, d_date#12] +Condition : (((isnotnull(d_date#12) AND (d_date#12 >= 2000-05-25)) AND (d_date#12 <= 2000-07-24)) AND isnotnull(d_date_sk#11)) + +(15) Project [codegen id : 2] +Output [1]: [d_date_sk#11] +Input [2]: [d_date_sk#11, d_date#12] + +(16) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(17) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_date_sk#8] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(18) Project [codegen id : 3] +Output [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Input [6]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, inv_date_sk#8, d_date_sk#11] + +(19) BroadcastExchange +Input [4]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(20) Scan parquet default.store_sales +Output [2]: [ss_item_sk#15, ss_sold_date_sk#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(21) ColumnarToRow +Input [2]: [ss_item_sk#15, ss_sold_date_sk#16] + +(22) Filter +Input [2]: [ss_item_sk#15, ss_sold_date_sk#16] +Condition : isnotnull(ss_item_sk#15) + +(23) Project +Output [1]: [ss_item_sk#15] +Input [2]: [ss_item_sk#15, ss_sold_date_sk#16] + +(24) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#15] +Join condition: None + +(25) Project [codegen id : 4] +Output [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Input [5]: [i_item_sk#1, i_item_id#2, i_item_desc#3, i_current_price#4, ss_item_sk#15] + +(26) HashAggregate [codegen id : 4] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Functions: [] +Aggregate Attributes: [] +Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] + +(27) Exchange +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: hashpartitioning(i_item_id#2, i_item_desc#3, i_current_price#4, 5), ENSURE_REQUIREMENTS, [id=#17] + +(28) HashAggregate [codegen id : 5] +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Keys [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Functions: [] +Aggregate Attributes: [] +Results [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] + +(29) TakeOrderedAndProject +Input [3]: [i_item_id#2, i_item_desc#3, i_current_price#4] +Arguments: 100, [i_item_id#2 ASC NULLS FIRST], [i_item_id#2, i_item_desc#3, i_current_price#4] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 5 Hosting Expression = inv_date_sk#8 IN dynamicpruning#9 +ReusedExchange (30) + + +(30) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82/simplified.txt new file mode 100644 index 0000000000000..7cec23062ee50 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q82/simplified.txt @@ -0,0 +1,44 @@ +TakeOrderedAndProject [i_item_id,i_item_desc,i_current_price] + WholeStageCodegen (5) + HashAggregate [i_item_id,i_item_desc,i_current_price] + InputAdapter + Exchange [i_item_id,i_item_desc,i_current_price] #1 + WholeStageCodegen (4) + HashAggregate [i_item_id,i_item_desc,i_current_price] + Project [i_item_id,i_item_desc,i_current_price] + BroadcastHashJoin [i_item_sk,ss_item_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [i_item_sk,i_item_id,i_item_desc,i_current_price] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [i_item_sk,i_item_id,i_item_desc,i_current_price,inv_date_sk] + BroadcastHashJoin [i_item_sk,inv_item_sk] + Project [i_item_sk,i_item_id,i_item_desc,i_current_price] + Filter [i_current_price,i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_manufact_id] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [inv_item_sk,inv_date_sk] + Filter [inv_quantity_on_hand,inv_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + Project [ss_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt new file mode 100644 index 0000000000000..7f0868b3b4db2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/explain.txt @@ -0,0 +1,347 @@ +== Physical Plan == +TakeOrderedAndProject (61) ++- * Project (60) + +- * BroadcastHashJoin Inner BuildRight (59) + :- * Project (45) + : +- * BroadcastHashJoin Inner BuildRight (44) + : :- * HashAggregate (30) + : : +- Exchange (29) + : : +- * HashAggregate (28) + : : +- * Project (27) + : : +- * BroadcastHashJoin Inner BuildRight (26) + : : :- * Project (21) + : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_returns (1) + : : : +- BroadcastExchange (19) + : : : +- * Project (18) + : : : +- * BroadcastHashJoin LeftSemi BuildRight (17) + : : : :- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin LeftSemi BuildRight (14) + : : : :- * ColumnarToRow (8) + : : : : +- Scan parquet default.date_dim (7) + : : : +- BroadcastExchange (13) + : : : +- * Project (12) + : : : +- * Filter (11) + : : : +- * ColumnarToRow (10) + : : : +- Scan parquet default.date_dim (9) + : : +- BroadcastExchange (25) + : : +- * Filter (24) + : : +- * ColumnarToRow (23) + : : +- Scan parquet default.item (22) + : +- BroadcastExchange (43) + : +- * HashAggregate (42) + : +- Exchange (41) + : +- * HashAggregate (40) + : +- * Project (39) + : +- * BroadcastHashJoin Inner BuildRight (38) + : :- * Project (36) + : : +- * BroadcastHashJoin Inner BuildRight (35) + : : :- * Filter (33) + : : : +- * ColumnarToRow (32) + : : : +- Scan parquet default.catalog_returns (31) + : : +- ReusedExchange (34) + : +- ReusedExchange (37) + +- BroadcastExchange (58) + +- * HashAggregate (57) + +- Exchange (56) + +- * HashAggregate (55) + +- * Project (54) + +- * BroadcastHashJoin Inner BuildRight (53) + :- * Project (51) + : +- * BroadcastHashJoin Inner BuildRight (50) + : :- * Filter (48) + : : +- * ColumnarToRow (47) + : : +- Scan parquet default.web_returns (46) + : +- ReusedExchange (49) + +- ReusedExchange (52) + + +(1) Scan parquet default.store_returns +Output [3]: [sr_item_sk#1, sr_return_quantity#2, sr_returned_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#3), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(sr_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [3]: [sr_item_sk#1, sr_return_quantity#2, sr_returned_date_sk#3] + +(3) Filter [codegen id : 5] +Input [3]: [sr_item_sk#1, sr_return_quantity#2, sr_returned_date_sk#3] +Condition : isnotnull(sr_item_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#4, d_date#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#4, d_date#5] + +(6) Filter [codegen id : 3] +Input [2]: [d_date_sk#4, d_date#5] +Condition : isnotnull(d_date_sk#4) + +(7) Scan parquet default.date_dim +Output [2]: [d_date#6, d_week_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 2] +Input [2]: [d_date#6, d_week_seq#7] + +(9) Scan parquet default.date_dim +Output [2]: [d_date#8, d_week_seq#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +ReadSchema: struct + +(10) ColumnarToRow [codegen id : 1] +Input [2]: [d_date#8, d_week_seq#9] + +(11) Filter [codegen id : 1] +Input [2]: [d_date#8, d_week_seq#9] +Condition : cast(d_date#8 as string) IN (2000-06-30,2000-09-27,2000-11-17) + +(12) Project [codegen id : 1] +Output [1]: [d_week_seq#9] +Input [2]: [d_date#8, d_week_seq#9] + +(13) BroadcastExchange +Input [1]: [d_week_seq#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(14) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [d_week_seq#7] +Right keys [1]: [d_week_seq#9] +Join condition: None + +(15) Project [codegen id : 2] +Output [1]: [d_date#6] +Input [2]: [d_date#6, d_week_seq#7] + +(16) BroadcastExchange +Input [1]: [d_date#6] +Arguments: HashedRelationBroadcastMode(List(input[0, date, true]),false), [id=#11] + +(17) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_date#5] +Right keys [1]: [d_date#6] +Join condition: None + +(18) Project [codegen id : 3] +Output [1]: [d_date_sk#4] +Input [2]: [d_date_sk#4, d_date#5] + +(19) BroadcastExchange +Input [1]: [d_date_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(20) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [sr_returned_date_sk#3] +Right keys [1]: [d_date_sk#4] +Join condition: None + +(21) Project [codegen id : 5] +Output [2]: [sr_item_sk#1, sr_return_quantity#2] +Input [4]: [sr_item_sk#1, sr_return_quantity#2, sr_returned_date_sk#3, d_date_sk#4] + +(22) Scan parquet default.item +Output [2]: [i_item_sk#13, i_item_id#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_item_id)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#13, i_item_id#14] + +(24) Filter [codegen id : 4] +Input [2]: [i_item_sk#13, i_item_id#14] +Condition : (isnotnull(i_item_sk#13) AND isnotnull(i_item_id#14)) + +(25) BroadcastExchange +Input [2]: [i_item_sk#13, i_item_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(26) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [sr_item_sk#1] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(27) Project [codegen id : 5] +Output [2]: [sr_return_quantity#2, i_item_id#14] +Input [4]: [sr_item_sk#1, sr_return_quantity#2, i_item_sk#13, i_item_id#14] + +(28) HashAggregate [codegen id : 5] +Input [2]: [sr_return_quantity#2, i_item_id#14] +Keys [1]: [i_item_id#14] +Functions [1]: [partial_sum(sr_return_quantity#2)] +Aggregate Attributes [1]: [sum#16] +Results [2]: [i_item_id#14, sum#17] + +(29) Exchange +Input [2]: [i_item_id#14, sum#17] +Arguments: hashpartitioning(i_item_id#14, 5), ENSURE_REQUIREMENTS, [id=#18] + +(30) HashAggregate [codegen id : 18] +Input [2]: [i_item_id#14, sum#17] +Keys [1]: [i_item_id#14] +Functions [1]: [sum(sr_return_quantity#2)] +Aggregate Attributes [1]: [sum(sr_return_quantity#2)#19] +Results [2]: [i_item_id#14 AS item_id#20, sum(sr_return_quantity#2)#19 AS sr_item_qty#21] + +(31) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#22, cr_return_quantity#23, cr_returned_date_sk#24] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#24), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(cr_item_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 10] +Input [3]: [cr_item_sk#22, cr_return_quantity#23, cr_returned_date_sk#24] + +(33) Filter [codegen id : 10] +Input [3]: [cr_item_sk#22, cr_return_quantity#23, cr_returned_date_sk#24] +Condition : isnotnull(cr_item_sk#22) + +(34) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#25] + +(35) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cr_returned_date_sk#24] +Right keys [1]: [d_date_sk#25] +Join condition: None + +(36) Project [codegen id : 10] +Output [2]: [cr_item_sk#22, cr_return_quantity#23] +Input [4]: [cr_item_sk#22, cr_return_quantity#23, cr_returned_date_sk#24, d_date_sk#25] + +(37) ReusedExchange [Reuses operator id: 25] +Output [2]: [i_item_sk#26, i_item_id#27] + +(38) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cr_item_sk#22] +Right keys [1]: [i_item_sk#26] +Join condition: None + +(39) Project [codegen id : 10] +Output [2]: [cr_return_quantity#23, i_item_id#27] +Input [4]: [cr_item_sk#22, cr_return_quantity#23, i_item_sk#26, i_item_id#27] + +(40) HashAggregate [codegen id : 10] +Input [2]: [cr_return_quantity#23, i_item_id#27] +Keys [1]: [i_item_id#27] +Functions [1]: [partial_sum(cr_return_quantity#23)] +Aggregate Attributes [1]: [sum#28] +Results [2]: [i_item_id#27, sum#29] + +(41) Exchange +Input [2]: [i_item_id#27, sum#29] +Arguments: hashpartitioning(i_item_id#27, 5), ENSURE_REQUIREMENTS, [id=#30] + +(42) HashAggregate [codegen id : 11] +Input [2]: [i_item_id#27, sum#29] +Keys [1]: [i_item_id#27] +Functions [1]: [sum(cr_return_quantity#23)] +Aggregate Attributes [1]: [sum(cr_return_quantity#23)#31] +Results [2]: [i_item_id#27 AS item_id#32, sum(cr_return_quantity#23)#31 AS cr_item_qty#33] + +(43) BroadcastExchange +Input [2]: [item_id#32, cr_item_qty#33] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#34] + +(44) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [item_id#20] +Right keys [1]: [item_id#32] +Join condition: None + +(45) Project [codegen id : 18] +Output [3]: [item_id#20, sr_item_qty#21, cr_item_qty#33] +Input [4]: [item_id#20, sr_item_qty#21, item_id#32, cr_item_qty#33] + +(46) Scan parquet default.web_returns +Output [3]: [wr_item_sk#35, wr_return_quantity#36, wr_returned_date_sk#37] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#37), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(wr_item_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 16] +Input [3]: [wr_item_sk#35, wr_return_quantity#36, wr_returned_date_sk#37] + +(48) Filter [codegen id : 16] +Input [3]: [wr_item_sk#35, wr_return_quantity#36, wr_returned_date_sk#37] +Condition : isnotnull(wr_item_sk#35) + +(49) ReusedExchange [Reuses operator id: 19] +Output [1]: [d_date_sk#38] + +(50) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [wr_returned_date_sk#37] +Right keys [1]: [d_date_sk#38] +Join condition: None + +(51) Project [codegen id : 16] +Output [2]: [wr_item_sk#35, wr_return_quantity#36] +Input [4]: [wr_item_sk#35, wr_return_quantity#36, wr_returned_date_sk#37, d_date_sk#38] + +(52) ReusedExchange [Reuses operator id: 25] +Output [2]: [i_item_sk#39, i_item_id#40] + +(53) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [wr_item_sk#35] +Right keys [1]: [i_item_sk#39] +Join condition: None + +(54) Project [codegen id : 16] +Output [2]: [wr_return_quantity#36, i_item_id#40] +Input [4]: [wr_item_sk#35, wr_return_quantity#36, i_item_sk#39, i_item_id#40] + +(55) HashAggregate [codegen id : 16] +Input [2]: [wr_return_quantity#36, i_item_id#40] +Keys [1]: [i_item_id#40] +Functions [1]: [partial_sum(wr_return_quantity#36)] +Aggregate Attributes [1]: [sum#41] +Results [2]: [i_item_id#40, sum#42] + +(56) Exchange +Input [2]: [i_item_id#40, sum#42] +Arguments: hashpartitioning(i_item_id#40, 5), ENSURE_REQUIREMENTS, [id=#43] + +(57) HashAggregate [codegen id : 17] +Input [2]: [i_item_id#40, sum#42] +Keys [1]: [i_item_id#40] +Functions [1]: [sum(wr_return_quantity#36)] +Aggregate Attributes [1]: [sum(wr_return_quantity#36)#44] +Results [2]: [i_item_id#40 AS item_id#45, sum(wr_return_quantity#36)#44 AS wr_item_qty#46] + +(58) BroadcastExchange +Input [2]: [item_id#45, wr_item_qty#46] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#47] + +(59) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [item_id#20] +Right keys [1]: [item_id#45] +Join condition: None + +(60) Project [codegen id : 18] +Output [8]: [item_id#20, sr_item_qty#21, (((cast(sr_item_qty#21 as double) / cast(((sr_item_qty#21 + cr_item_qty#33) + wr_item_qty#46) as double)) / 3.0) * 100.0) AS sr_dev#48, cr_item_qty#33, (((cast(cr_item_qty#33 as double) / cast(((sr_item_qty#21 + cr_item_qty#33) + wr_item_qty#46) as double)) / 3.0) * 100.0) AS cr_dev#49, wr_item_qty#46, (((cast(wr_item_qty#46 as double) / cast(((sr_item_qty#21 + cr_item_qty#33) + wr_item_qty#46) as double)) / 3.0) * 100.0) AS wr_dev#50, CheckOverflow((promote_precision(cast(cast(((sr_item_qty#21 + cr_item_qty#33) + wr_item_qty#46) as decimal(20,0)) as decimal(21,1))) / 3.0), DecimalType(27,6), true) AS average#51] +Input [5]: [item_id#20, sr_item_qty#21, cr_item_qty#33, item_id#45, wr_item_qty#46] + +(61) TakeOrderedAndProject +Input [8]: [item_id#20, sr_item_qty#21, sr_dev#48, cr_item_qty#33, cr_dev#49, wr_item_qty#46, wr_dev#50, average#51] +Arguments: 100, [item_id#20 ASC NULLS FIRST, sr_item_qty#21 ASC NULLS FIRST], [item_id#20, sr_item_qty#21, sr_dev#48, cr_item_qty#33, cr_dev#49, wr_item_qty#46, wr_dev#50, average#51] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/simplified.txt new file mode 100644 index 0000000000000..b46131afd5ec7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83.sf100/simplified.txt @@ -0,0 +1,91 @@ +TakeOrderedAndProject [item_id,sr_item_qty,sr_dev,cr_item_qty,cr_dev,wr_item_qty,wr_dev,average] + WholeStageCodegen (18) + Project [item_id,sr_item_qty,cr_item_qty,wr_item_qty] + BroadcastHashJoin [item_id,item_id] + Project [item_id,sr_item_qty,cr_item_qty] + BroadcastHashJoin [item_id,item_id] + HashAggregate [i_item_id,sum] [sum(sr_return_quantity),item_id,sr_item_qty,sum] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,sr_return_quantity] [sum,sum] + Project [sr_return_quantity,i_item_id] + BroadcastHashJoin [sr_item_sk,i_item_sk] + Project [sr_item_sk,sr_return_quantity] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_return_quantity,sr_returned_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (3) + Project [d_date_sk] + BroadcastHashJoin [d_date,d_date] + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [d_date] + BroadcastHashJoin [d_week_seq,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date,d_week_seq] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_date] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date,d_week_seq] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [i_item_sk,i_item_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (11) + HashAggregate [i_item_id,sum] [sum(cr_return_quantity),item_id,cr_item_qty,sum] + InputAdapter + Exchange [i_item_id] #7 + WholeStageCodegen (10) + HashAggregate [i_item_id,cr_return_quantity] [sum,sum] + Project [cr_return_quantity,i_item_id] + BroadcastHashJoin [cr_item_sk,i_item_sk] + Project [cr_item_sk,cr_return_quantity] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + Filter [cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_return_quantity,cr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (17) + HashAggregate [i_item_id,sum] [sum(wr_return_quantity),item_id,wr_item_qty,sum] + InputAdapter + Exchange [i_item_id] #9 + WholeStageCodegen (16) + HashAggregate [i_item_id,wr_return_quantity] [sum,sum] + Project [wr_return_quantity,i_item_id] + BroadcastHashJoin [wr_item_sk,i_item_sk] + Project [wr_item_sk,wr_return_quantity] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + Filter [wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_return_quantity,wr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83/explain.txt new file mode 100644 index 0000000000000..0764824706376 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83/explain.txt @@ -0,0 +1,347 @@ +== Physical Plan == +TakeOrderedAndProject (61) ++- * Project (60) + +- * BroadcastHashJoin Inner BuildRight (59) + :- * Project (45) + : +- * BroadcastHashJoin Inner BuildRight (44) + : :- * HashAggregate (30) + : : +- Exchange (29) + : : +- * HashAggregate (28) + : : +- * Project (27) + : : +- * BroadcastHashJoin Inner BuildRight (26) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_returns (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.item (4) + : : +- BroadcastExchange (25) + : : +- * Project (24) + : : +- * BroadcastHashJoin LeftSemi BuildRight (23) + : : :- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (22) + : : +- * Project (21) + : : +- * BroadcastHashJoin LeftSemi BuildRight (20) + : : :- * ColumnarToRow (14) + : : : +- Scan parquet default.date_dim (13) + : : +- BroadcastExchange (19) + : : +- * Project (18) + : : +- * Filter (17) + : : +- * ColumnarToRow (16) + : : +- Scan parquet default.date_dim (15) + : +- BroadcastExchange (43) + : +- * HashAggregate (42) + : +- Exchange (41) + : +- * HashAggregate (40) + : +- * Project (39) + : +- * BroadcastHashJoin Inner BuildRight (38) + : :- * Project (36) + : : +- * BroadcastHashJoin Inner BuildRight (35) + : : :- * Filter (33) + : : : +- * ColumnarToRow (32) + : : : +- Scan parquet default.catalog_returns (31) + : : +- ReusedExchange (34) + : +- ReusedExchange (37) + +- BroadcastExchange (58) + +- * HashAggregate (57) + +- Exchange (56) + +- * HashAggregate (55) + +- * Project (54) + +- * BroadcastHashJoin Inner BuildRight (53) + :- * Project (51) + : +- * BroadcastHashJoin Inner BuildRight (50) + : :- * Filter (48) + : : +- * ColumnarToRow (47) + : : +- Scan parquet default.web_returns (46) + : +- ReusedExchange (49) + +- ReusedExchange (52) + + +(1) Scan parquet default.store_returns +Output [3]: [sr_item_sk#1, sr_return_quantity#2, sr_returned_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#3), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(sr_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [3]: [sr_item_sk#1, sr_return_quantity#2, sr_returned_date_sk#3] + +(3) Filter [codegen id : 5] +Input [3]: [sr_item_sk#1, sr_return_quantity#2, sr_returned_date_sk#3] +Condition : isnotnull(sr_item_sk#1) + +(4) Scan parquet default.item +Output [2]: [i_item_sk#4, i_item_id#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_item_id)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [i_item_sk#4, i_item_id#5] + +(6) Filter [codegen id : 1] +Input [2]: [i_item_sk#4, i_item_id#5] +Condition : (isnotnull(i_item_sk#4) AND isnotnull(i_item_id#5)) + +(7) BroadcastExchange +Input [2]: [i_item_sk#4, i_item_id#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#6] + +(8) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [sr_item_sk#1] +Right keys [1]: [i_item_sk#4] +Join condition: None + +(9) Project [codegen id : 5] +Output [3]: [sr_return_quantity#2, sr_returned_date_sk#3, i_item_id#5] +Input [5]: [sr_item_sk#1, sr_return_quantity#2, sr_returned_date_sk#3, i_item_sk#4, i_item_id#5] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_date#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#7, d_date#8] + +(12) Filter [codegen id : 4] +Input [2]: [d_date_sk#7, d_date#8] +Condition : isnotnull(d_date_sk#7) + +(13) Scan parquet default.date_dim +Output [2]: [d_date#9, d_week_seq#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 3] +Input [2]: [d_date#9, d_week_seq#10] + +(15) Scan parquet default.date_dim +Output [2]: [d_date#11, d_week_seq#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 2] +Input [2]: [d_date#11, d_week_seq#12] + +(17) Filter [codegen id : 2] +Input [2]: [d_date#11, d_week_seq#12] +Condition : cast(d_date#11 as string) IN (2000-06-30,2000-09-27,2000-11-17) + +(18) Project [codegen id : 2] +Output [1]: [d_week_seq#12] +Input [2]: [d_date#11, d_week_seq#12] + +(19) BroadcastExchange +Input [1]: [d_week_seq#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(20) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [d_week_seq#10] +Right keys [1]: [d_week_seq#12] +Join condition: None + +(21) Project [codegen id : 3] +Output [1]: [d_date#9] +Input [2]: [d_date#9, d_week_seq#10] + +(22) BroadcastExchange +Input [1]: [d_date#9] +Arguments: HashedRelationBroadcastMode(List(input[0, date, true]),false), [id=#14] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [d_date#8] +Right keys [1]: [d_date#9] +Join condition: None + +(24) Project [codegen id : 4] +Output [1]: [d_date_sk#7] +Input [2]: [d_date_sk#7, d_date#8] + +(25) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(26) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [sr_returned_date_sk#3] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(27) Project [codegen id : 5] +Output [2]: [sr_return_quantity#2, i_item_id#5] +Input [4]: [sr_return_quantity#2, sr_returned_date_sk#3, i_item_id#5, d_date_sk#7] + +(28) HashAggregate [codegen id : 5] +Input [2]: [sr_return_quantity#2, i_item_id#5] +Keys [1]: [i_item_id#5] +Functions [1]: [partial_sum(sr_return_quantity#2)] +Aggregate Attributes [1]: [sum#16] +Results [2]: [i_item_id#5, sum#17] + +(29) Exchange +Input [2]: [i_item_id#5, sum#17] +Arguments: hashpartitioning(i_item_id#5, 5), ENSURE_REQUIREMENTS, [id=#18] + +(30) HashAggregate [codegen id : 18] +Input [2]: [i_item_id#5, sum#17] +Keys [1]: [i_item_id#5] +Functions [1]: [sum(sr_return_quantity#2)] +Aggregate Attributes [1]: [sum(sr_return_quantity#2)#19] +Results [2]: [i_item_id#5 AS item_id#20, sum(sr_return_quantity#2)#19 AS sr_item_qty#21] + +(31) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#22, cr_return_quantity#23, cr_returned_date_sk#24] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#24), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(cr_item_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 10] +Input [3]: [cr_item_sk#22, cr_return_quantity#23, cr_returned_date_sk#24] + +(33) Filter [codegen id : 10] +Input [3]: [cr_item_sk#22, cr_return_quantity#23, cr_returned_date_sk#24] +Condition : isnotnull(cr_item_sk#22) + +(34) ReusedExchange [Reuses operator id: 7] +Output [2]: [i_item_sk#25, i_item_id#26] + +(35) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cr_item_sk#22] +Right keys [1]: [i_item_sk#25] +Join condition: None + +(36) Project [codegen id : 10] +Output [3]: [cr_return_quantity#23, cr_returned_date_sk#24, i_item_id#26] +Input [5]: [cr_item_sk#22, cr_return_quantity#23, cr_returned_date_sk#24, i_item_sk#25, i_item_id#26] + +(37) ReusedExchange [Reuses operator id: 25] +Output [1]: [d_date_sk#27] + +(38) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cr_returned_date_sk#24] +Right keys [1]: [d_date_sk#27] +Join condition: None + +(39) Project [codegen id : 10] +Output [2]: [cr_return_quantity#23, i_item_id#26] +Input [4]: [cr_return_quantity#23, cr_returned_date_sk#24, i_item_id#26, d_date_sk#27] + +(40) HashAggregate [codegen id : 10] +Input [2]: [cr_return_quantity#23, i_item_id#26] +Keys [1]: [i_item_id#26] +Functions [1]: [partial_sum(cr_return_quantity#23)] +Aggregate Attributes [1]: [sum#28] +Results [2]: [i_item_id#26, sum#29] + +(41) Exchange +Input [2]: [i_item_id#26, sum#29] +Arguments: hashpartitioning(i_item_id#26, 5), ENSURE_REQUIREMENTS, [id=#30] + +(42) HashAggregate [codegen id : 11] +Input [2]: [i_item_id#26, sum#29] +Keys [1]: [i_item_id#26] +Functions [1]: [sum(cr_return_quantity#23)] +Aggregate Attributes [1]: [sum(cr_return_quantity#23)#31] +Results [2]: [i_item_id#26 AS item_id#32, sum(cr_return_quantity#23)#31 AS cr_item_qty#33] + +(43) BroadcastExchange +Input [2]: [item_id#32, cr_item_qty#33] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#34] + +(44) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [item_id#20] +Right keys [1]: [item_id#32] +Join condition: None + +(45) Project [codegen id : 18] +Output [3]: [item_id#20, sr_item_qty#21, cr_item_qty#33] +Input [4]: [item_id#20, sr_item_qty#21, item_id#32, cr_item_qty#33] + +(46) Scan parquet default.web_returns +Output [3]: [wr_item_sk#35, wr_return_quantity#36, wr_returned_date_sk#37] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#37), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(wr_item_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 16] +Input [3]: [wr_item_sk#35, wr_return_quantity#36, wr_returned_date_sk#37] + +(48) Filter [codegen id : 16] +Input [3]: [wr_item_sk#35, wr_return_quantity#36, wr_returned_date_sk#37] +Condition : isnotnull(wr_item_sk#35) + +(49) ReusedExchange [Reuses operator id: 7] +Output [2]: [i_item_sk#38, i_item_id#39] + +(50) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [wr_item_sk#35] +Right keys [1]: [i_item_sk#38] +Join condition: None + +(51) Project [codegen id : 16] +Output [3]: [wr_return_quantity#36, wr_returned_date_sk#37, i_item_id#39] +Input [5]: [wr_item_sk#35, wr_return_quantity#36, wr_returned_date_sk#37, i_item_sk#38, i_item_id#39] + +(52) ReusedExchange [Reuses operator id: 25] +Output [1]: [d_date_sk#40] + +(53) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [wr_returned_date_sk#37] +Right keys [1]: [d_date_sk#40] +Join condition: None + +(54) Project [codegen id : 16] +Output [2]: [wr_return_quantity#36, i_item_id#39] +Input [4]: [wr_return_quantity#36, wr_returned_date_sk#37, i_item_id#39, d_date_sk#40] + +(55) HashAggregate [codegen id : 16] +Input [2]: [wr_return_quantity#36, i_item_id#39] +Keys [1]: [i_item_id#39] +Functions [1]: [partial_sum(wr_return_quantity#36)] +Aggregate Attributes [1]: [sum#41] +Results [2]: [i_item_id#39, sum#42] + +(56) Exchange +Input [2]: [i_item_id#39, sum#42] +Arguments: hashpartitioning(i_item_id#39, 5), ENSURE_REQUIREMENTS, [id=#43] + +(57) HashAggregate [codegen id : 17] +Input [2]: [i_item_id#39, sum#42] +Keys [1]: [i_item_id#39] +Functions [1]: [sum(wr_return_quantity#36)] +Aggregate Attributes [1]: [sum(wr_return_quantity#36)#44] +Results [2]: [i_item_id#39 AS item_id#45, sum(wr_return_quantity#36)#44 AS wr_item_qty#46] + +(58) BroadcastExchange +Input [2]: [item_id#45, wr_item_qty#46] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#47] + +(59) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [item_id#20] +Right keys [1]: [item_id#45] +Join condition: None + +(60) Project [codegen id : 18] +Output [8]: [item_id#20, sr_item_qty#21, (((cast(sr_item_qty#21 as double) / cast(((sr_item_qty#21 + cr_item_qty#33) + wr_item_qty#46) as double)) / 3.0) * 100.0) AS sr_dev#48, cr_item_qty#33, (((cast(cr_item_qty#33 as double) / cast(((sr_item_qty#21 + cr_item_qty#33) + wr_item_qty#46) as double)) / 3.0) * 100.0) AS cr_dev#49, wr_item_qty#46, (((cast(wr_item_qty#46 as double) / cast(((sr_item_qty#21 + cr_item_qty#33) + wr_item_qty#46) as double)) / 3.0) * 100.0) AS wr_dev#50, CheckOverflow((promote_precision(cast(cast(((sr_item_qty#21 + cr_item_qty#33) + wr_item_qty#46) as decimal(20,0)) as decimal(21,1))) / 3.0), DecimalType(27,6), true) AS average#51] +Input [5]: [item_id#20, sr_item_qty#21, cr_item_qty#33, item_id#45, wr_item_qty#46] + +(61) TakeOrderedAndProject +Input [8]: [item_id#20, sr_item_qty#21, sr_dev#48, cr_item_qty#33, cr_dev#49, wr_item_qty#46, wr_dev#50, average#51] +Arguments: 100, [item_id#20 ASC NULLS FIRST, sr_item_qty#21 ASC NULLS FIRST], [item_id#20, sr_item_qty#21, sr_dev#48, cr_item_qty#33, cr_dev#49, wr_item_qty#46, wr_dev#50, average#51] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83/simplified.txt new file mode 100644 index 0000000000000..7fc930f2885fd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q83/simplified.txt @@ -0,0 +1,91 @@ +TakeOrderedAndProject [item_id,sr_item_qty,sr_dev,cr_item_qty,cr_dev,wr_item_qty,wr_dev,average] + WholeStageCodegen (18) + Project [item_id,sr_item_qty,cr_item_qty,wr_item_qty] + BroadcastHashJoin [item_id,item_id] + Project [item_id,sr_item_qty,cr_item_qty] + BroadcastHashJoin [item_id,item_id] + HashAggregate [i_item_id,sum] [sum(sr_return_quantity),item_id,sr_item_qty,sum] + InputAdapter + Exchange [i_item_id] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,sr_return_quantity] [sum,sum] + Project [sr_return_quantity,i_item_id] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Project [sr_return_quantity,sr_returned_date_sk,i_item_id] + BroadcastHashJoin [sr_item_sk,i_item_sk] + Filter [sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_return_quantity,sr_returned_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [i_item_sk,i_item_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (4) + Project [d_date_sk] + BroadcastHashJoin [d_date,d_date] + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [d_date] + BroadcastHashJoin [d_week_seq,d_week_seq] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date,d_week_seq] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [d_week_seq] + Filter [d_date] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date,d_week_seq] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (11) + HashAggregate [i_item_id,sum] [sum(cr_return_quantity),item_id,cr_item_qty,sum] + InputAdapter + Exchange [i_item_id] #7 + WholeStageCodegen (10) + HashAggregate [i_item_id,cr_return_quantity] [sum,sum] + Project [cr_return_quantity,i_item_id] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + Project [cr_return_quantity,cr_returned_date_sk,i_item_id] + BroadcastHashJoin [cr_item_sk,i_item_sk] + Filter [cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_return_quantity,cr_returned_date_sk] + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #2 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (17) + HashAggregate [i_item_id,sum] [sum(wr_return_quantity),item_id,wr_item_qty,sum] + InputAdapter + Exchange [i_item_id] #9 + WholeStageCodegen (16) + HashAggregate [i_item_id,wr_return_quantity] [sum,sum] + Project [wr_return_quantity,i_item_id] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + Project [wr_return_quantity,wr_returned_date_sk,i_item_id] + BroadcastHashJoin [wr_item_sk,i_item_sk] + Filter [wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_return_quantity,wr_returned_date_sk] + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #2 + InputAdapter + ReusedExchange [d_date_sk] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt new file mode 100644 index 0000000000000..9762d51e943e8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/explain.txt @@ -0,0 +1,205 @@ +== Physical Plan == +TakeOrderedAndProject (37) ++- * Project (36) + +- * BroadcastHashJoin Inner BuildLeft (35) + :- BroadcastExchange (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildLeft (28) + : :- BroadcastExchange (24) + : : +- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer_address (4) + : : +- BroadcastExchange (21) + : : +- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.household_demographics (11) + : : +- BroadcastExchange (18) + : : +- * Project (17) + : : +- * Filter (16) + : : +- * ColumnarToRow (15) + : : +- Scan parquet default.income_band (14) + : +- * Filter (27) + : +- * ColumnarToRow (26) + : +- Scan parquet default.customer_demographics (25) + +- * Project (34) + +- * Filter (33) + +- * ColumnarToRow (32) + +- Scan parquet default.store_returns (31) + + +(1) Scan parquet default.customer +Output [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6] + +(3) Filter [codegen id : 4] +Input [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6] +Condition : ((isnotnull(c_current_addr_sk#4) AND isnotnull(c_current_cdemo_sk#2)) AND isnotnull(c_current_hdemo_sk#3)) + +(4) Scan parquet default.customer_address +Output [2]: [ca_address_sk#7, ca_city#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_city), EqualTo(ca_city,Edgewood), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [ca_address_sk#7, ca_city#8] + +(6) Filter [codegen id : 1] +Input [2]: [ca_address_sk#7, ca_city#8] +Condition : ((isnotnull(ca_city#8) AND (ca_city#8 = Edgewood)) AND isnotnull(ca_address_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [ca_address_sk#7] +Input [2]: [ca_address_sk#7, ca_city#8] + +(8) BroadcastExchange +Input [1]: [ca_address_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [c_current_addr_sk#4] +Right keys [1]: [ca_address_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [5]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_first_name#5, c_last_name#6] +Input [7]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6, ca_address_sk#7] + +(11) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#10, hd_income_band_sk#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_demo_sk), IsNotNull(hd_income_band_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 3] +Input [2]: [hd_demo_sk#10, hd_income_band_sk#11] + +(13) Filter [codegen id : 3] +Input [2]: [hd_demo_sk#10, hd_income_band_sk#11] +Condition : (isnotnull(hd_demo_sk#10) AND isnotnull(hd_income_band_sk#11)) + +(14) Scan parquet default.income_band +Output [3]: [ib_income_band_sk#12, ib_lower_bound#13, ib_upper_bound#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/income_band] +PushedFilters: [IsNotNull(ib_lower_bound), IsNotNull(ib_upper_bound), GreaterThanOrEqual(ib_lower_bound,38128), LessThanOrEqual(ib_upper_bound,88128), IsNotNull(ib_income_band_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 2] +Input [3]: [ib_income_band_sk#12, ib_lower_bound#13, ib_upper_bound#14] + +(16) Filter [codegen id : 2] +Input [3]: [ib_income_band_sk#12, ib_lower_bound#13, ib_upper_bound#14] +Condition : ((((isnotnull(ib_lower_bound#13) AND isnotnull(ib_upper_bound#14)) AND (ib_lower_bound#13 >= 38128)) AND (ib_upper_bound#14 <= 88128)) AND isnotnull(ib_income_band_sk#12)) + +(17) Project [codegen id : 2] +Output [1]: [ib_income_band_sk#12] +Input [3]: [ib_income_band_sk#12, ib_lower_bound#13, ib_upper_bound#14] + +(18) BroadcastExchange +Input [1]: [ib_income_band_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(19) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [hd_income_band_sk#11] +Right keys [1]: [ib_income_band_sk#12] +Join condition: None + +(20) Project [codegen id : 3] +Output [1]: [hd_demo_sk#10] +Input [3]: [hd_demo_sk#10, hd_income_band_sk#11, ib_income_band_sk#12] + +(21) BroadcastExchange +Input [1]: [hd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [c_current_hdemo_sk#3] +Right keys [1]: [hd_demo_sk#10] +Join condition: None + +(23) Project [codegen id : 4] +Output [4]: [c_customer_id#1, c_current_cdemo_sk#2, c_first_name#5, c_last_name#6] +Input [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_first_name#5, c_last_name#6, hd_demo_sk#10] + +(24) BroadcastExchange +Input [4]: [c_customer_id#1, c_current_cdemo_sk#2, c_first_name#5, c_last_name#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#17] + +(25) Scan parquet default.customer_demographics +Output [1]: [cd_demo_sk#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(26) ColumnarToRow +Input [1]: [cd_demo_sk#18] + +(27) Filter +Input [1]: [cd_demo_sk#18] +Condition : isnotnull(cd_demo_sk#18) + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#18] +Join condition: None + +(29) Project [codegen id : 5] +Output [4]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#18] +Input [5]: [c_customer_id#1, c_current_cdemo_sk#2, c_first_name#5, c_last_name#6, cd_demo_sk#18] + +(30) BroadcastExchange +Input [4]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[3, int, true] as bigint)),false), [id=#19] + +(31) Scan parquet default.store_returns +Output [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_cdemo_sk)] +ReadSchema: struct + +(32) ColumnarToRow +Input [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] + +(33) Filter +Input [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] +Condition : isnotnull(sr_cdemo_sk#20) + +(34) Project +Output [1]: [sr_cdemo_sk#20] +Input [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] + +(35) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cd_demo_sk#18] +Right keys [1]: [sr_cdemo_sk#20] +Join condition: None + +(36) Project [codegen id : 6] +Output [3]: [c_customer_id#1 AS customer_id#22, concat(c_last_name#6, , , c_first_name#5) AS customername#23, c_customer_id#1] +Input [5]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#18, sr_cdemo_sk#20] + +(37) TakeOrderedAndProject +Input [3]: [customer_id#22, customername#23, c_customer_id#1] +Arguments: 100, [c_customer_id#1 ASC NULLS FIRST], [customer_id#22, customername#23] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/simplified.txt new file mode 100644 index 0000000000000..d44ebc0e5b05f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84.sf100/simplified.txt @@ -0,0 +1,54 @@ +TakeOrderedAndProject [c_customer_id,customer_id,customername] + WholeStageCodegen (6) + Project [c_customer_id,c_last_name,c_first_name] + BroadcastHashJoin [cd_demo_sk,sr_cdemo_sk] + InputAdapter + BroadcastExchange #1 + WholeStageCodegen (5) + Project [c_customer_id,c_first_name,c_last_name,cd_demo_sk] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (4) + Project [c_customer_id,c_current_cdemo_sk,c_first_name,c_last_name] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_first_name,c_last_name] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Filter [c_current_addr_sk,c_current_cdemo_sk,c_current_hdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [ca_address_sk] + Filter [ca_city,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [hd_demo_sk] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Filter [hd_demo_sk,hd_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_income_band_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [ib_income_band_sk] + Filter [ib_lower_bound,ib_upper_bound,ib_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.income_band [ib_income_band_sk,ib_lower_bound,ib_upper_bound] + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk] + Project [sr_cdemo_sk] + Filter [sr_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_cdemo_sk,sr_returned_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84/explain.txt new file mode 100644 index 0000000000000..d5b84f52f4b00 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84/explain.txt @@ -0,0 +1,205 @@ +== Physical Plan == +TakeOrderedAndProject (37) ++- * Project (36) + +- * BroadcastHashJoin Inner BuildLeft (35) + :- BroadcastExchange (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (22) + : : +- * BroadcastHashJoin Inner BuildRight (21) + : : :- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.customer_address (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.customer_demographics (11) + : : +- BroadcastExchange (20) + : : +- * Filter (19) + : : +- * ColumnarToRow (18) + : : +- Scan parquet default.household_demographics (17) + : +- BroadcastExchange (27) + : +- * Project (26) + : +- * Filter (25) + : +- * ColumnarToRow (24) + : +- Scan parquet default.income_band (23) + +- * Project (34) + +- * Filter (33) + +- * ColumnarToRow (32) + +- Scan parquet default.store_returns (31) + + +(1) Scan parquet default.customer +Output [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6] + +(3) Filter [codegen id : 5] +Input [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6] +Condition : ((isnotnull(c_current_addr_sk#4) AND isnotnull(c_current_cdemo_sk#2)) AND isnotnull(c_current_hdemo_sk#3)) + +(4) Scan parquet default.customer_address +Output [2]: [ca_address_sk#7, ca_city#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_city), EqualTo(ca_city,Edgewood), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [ca_address_sk#7, ca_city#8] + +(6) Filter [codegen id : 1] +Input [2]: [ca_address_sk#7, ca_city#8] +Condition : ((isnotnull(ca_city#8) AND (ca_city#8 = Edgewood)) AND isnotnull(ca_address_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [ca_address_sk#7] +Input [2]: [ca_address_sk#7, ca_city#8] + +(8) BroadcastExchange +Input [1]: [ca_address_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [c_current_addr_sk#4] +Right keys [1]: [ca_address_sk#7] +Join condition: None + +(10) Project [codegen id : 5] +Output [5]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_first_name#5, c_last_name#6] +Input [7]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, c_first_name#5, c_last_name#6, ca_address_sk#7] + +(11) Scan parquet default.customer_demographics +Output [1]: [cd_demo_sk#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [1]: [cd_demo_sk#10] + +(13) Filter [codegen id : 2] +Input [1]: [cd_demo_sk#10] +Condition : isnotnull(cd_demo_sk#10) + +(14) BroadcastExchange +Input [1]: [cd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(16) Project [codegen id : 5] +Output [5]: [c_customer_id#1, c_current_hdemo_sk#3, c_first_name#5, c_last_name#6, cd_demo_sk#10] +Input [6]: [c_customer_id#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_first_name#5, c_last_name#6, cd_demo_sk#10] + +(17) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#12, hd_income_band_sk#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_demo_sk), IsNotNull(hd_income_band_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [2]: [hd_demo_sk#12, hd_income_band_sk#13] + +(19) Filter [codegen id : 3] +Input [2]: [hd_demo_sk#12, hd_income_band_sk#13] +Condition : (isnotnull(hd_demo_sk#12) AND isnotnull(hd_income_band_sk#13)) + +(20) BroadcastExchange +Input [2]: [hd_demo_sk#12, hd_income_band_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(21) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [c_current_hdemo_sk#3] +Right keys [1]: [hd_demo_sk#12] +Join condition: None + +(22) Project [codegen id : 5] +Output [5]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#10, hd_income_band_sk#13] +Input [7]: [c_customer_id#1, c_current_hdemo_sk#3, c_first_name#5, c_last_name#6, cd_demo_sk#10, hd_demo_sk#12, hd_income_band_sk#13] + +(23) Scan parquet default.income_band +Output [3]: [ib_income_band_sk#15, ib_lower_bound#16, ib_upper_bound#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/income_band] +PushedFilters: [IsNotNull(ib_lower_bound), IsNotNull(ib_upper_bound), GreaterThanOrEqual(ib_lower_bound,38128), LessThanOrEqual(ib_upper_bound,88128), IsNotNull(ib_income_band_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [3]: [ib_income_band_sk#15, ib_lower_bound#16, ib_upper_bound#17] + +(25) Filter [codegen id : 4] +Input [3]: [ib_income_band_sk#15, ib_lower_bound#16, ib_upper_bound#17] +Condition : ((((isnotnull(ib_lower_bound#16) AND isnotnull(ib_upper_bound#17)) AND (ib_lower_bound#16 >= 38128)) AND (ib_upper_bound#17 <= 88128)) AND isnotnull(ib_income_band_sk#15)) + +(26) Project [codegen id : 4] +Output [1]: [ib_income_band_sk#15] +Input [3]: [ib_income_band_sk#15, ib_lower_bound#16, ib_upper_bound#17] + +(27) BroadcastExchange +Input [1]: [ib_income_band_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [hd_income_band_sk#13] +Right keys [1]: [ib_income_band_sk#15] +Join condition: None + +(29) Project [codegen id : 5] +Output [4]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#10] +Input [6]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#10, hd_income_band_sk#13, ib_income_band_sk#15] + +(30) BroadcastExchange +Input [4]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[3, int, true] as bigint)),false), [id=#19] + +(31) Scan parquet default.store_returns +Output [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_cdemo_sk)] +ReadSchema: struct + +(32) ColumnarToRow +Input [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] + +(33) Filter +Input [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] +Condition : isnotnull(sr_cdemo_sk#20) + +(34) Project +Output [1]: [sr_cdemo_sk#20] +Input [2]: [sr_cdemo_sk#20, sr_returned_date_sk#21] + +(35) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cd_demo_sk#10] +Right keys [1]: [sr_cdemo_sk#20] +Join condition: None + +(36) Project [codegen id : 6] +Output [3]: [c_customer_id#1 AS customer_id#22, concat(c_last_name#6, , , c_first_name#5) AS customername#23, c_customer_id#1] +Input [5]: [c_customer_id#1, c_first_name#5, c_last_name#6, cd_demo_sk#10, sr_cdemo_sk#20] + +(37) TakeOrderedAndProject +Input [3]: [customer_id#22, customername#23, c_customer_id#1] +Arguments: 100, [c_customer_id#1 ASC NULLS FIRST], [customer_id#22, customername#23] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84/simplified.txt new file mode 100644 index 0000000000000..f0116eb8d8df9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q84/simplified.txt @@ -0,0 +1,54 @@ +TakeOrderedAndProject [c_customer_id,customer_id,customername] + WholeStageCodegen (6) + Project [c_customer_id,c_last_name,c_first_name] + BroadcastHashJoin [cd_demo_sk,sr_cdemo_sk] + InputAdapter + BroadcastExchange #1 + WholeStageCodegen (5) + Project [c_customer_id,c_first_name,c_last_name,cd_demo_sk] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [c_customer_id,c_first_name,c_last_name,cd_demo_sk,hd_income_band_sk] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [c_customer_id,c_current_hdemo_sk,c_first_name,c_last_name,cd_demo_sk] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_first_name,c_last_name] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Filter [c_current_addr_sk,c_current_cdemo_sk,c_current_hdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_id,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [ca_address_sk] + Filter [ca_city,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_city] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [hd_demo_sk,hd_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_income_band_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Project [ib_income_band_sk] + Filter [ib_lower_bound,ib_upper_bound,ib_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.income_band [ib_income_band_sk,ib_lower_bound,ib_upper_bound] + Project [sr_cdemo_sk] + Filter [sr_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_cdemo_sk,sr_returned_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt new file mode 100644 index 0000000000000..d002f987ff3fd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/explain.txt @@ -0,0 +1,333 @@ +== Physical Plan == +TakeOrderedAndProject (58) ++- * HashAggregate (57) + +- Exchange (56) + +- * HashAggregate (55) + +- * Project (54) + +- * BroadcastHashJoin Inner BuildRight (53) + :- * Project (48) + : +- * BroadcastHashJoin Inner BuildRight (47) + : :- * Project (41) + : : +- * BroadcastHashJoin Inner BuildRight (40) + : : :- * Project (34) + : : : +- * SortMergeJoin Inner (33) + : : : :- * Sort (27) + : : : : +- Exchange (26) + : : : : +- * Project (25) + : : : : +- * BroadcastHashJoin Inner BuildRight (24) + : : : : :- * Project (19) + : : : : : +- * SortMergeJoin Inner (18) + : : : : : :- * Sort (11) + : : : : : : +- Exchange (10) + : : : : : : +- * Project (9) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.web_sales (1) + : : : : : : +- BroadcastExchange (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.web_page (4) + : : : : : +- * Sort (17) + : : : : : +- Exchange (16) + : : : : : +- * Project (15) + : : : : : +- * Filter (14) + : : : : : +- * ColumnarToRow (13) + : : : : : +- Scan parquet default.web_returns (12) + : : : : +- BroadcastExchange (23) + : : : : +- * Filter (22) + : : : : +- * ColumnarToRow (21) + : : : : +- Scan parquet default.customer_demographics (20) + : : : +- * Sort (32) + : : : +- Exchange (31) + : : : +- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.customer_demographics (28) + : : +- BroadcastExchange (39) + : : +- * Project (38) + : : +- * Filter (37) + : : +- * ColumnarToRow (36) + : : +- Scan parquet default.customer_address (35) + : +- BroadcastExchange (46) + : +- * Project (45) + : +- * Filter (44) + : +- * ColumnarToRow (43) + : +- Scan parquet default.date_dim (42) + +- BroadcastExchange (52) + +- * Filter (51) + +- * ColumnarToRow (50) + +- Scan parquet default.reason (49) + + +(1) Scan parquet default.web_sales +Output [7]: [ws_item_sk#1, ws_web_page_sk#2, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#7), dynamicpruningexpression(ws_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_page_sk), Or(Or(And(GreaterThanOrEqual(ws_sales_price,100.00),LessThanOrEqual(ws_sales_price,150.00)),And(GreaterThanOrEqual(ws_sales_price,50.00),LessThanOrEqual(ws_sales_price,100.00))),And(GreaterThanOrEqual(ws_sales_price,150.00),LessThanOrEqual(ws_sales_price,200.00))), Or(Or(And(GreaterThanOrEqual(ws_net_profit,100.00),LessThanOrEqual(ws_net_profit,200.00)),And(GreaterThanOrEqual(ws_net_profit,150.00),LessThanOrEqual(ws_net_profit,300.00))),And(GreaterThanOrEqual(ws_net_profit,50.00),LessThanOrEqual(ws_net_profit,250.00)))] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [7]: [ws_item_sk#1, ws_web_page_sk#2, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] + +(3) Filter [codegen id : 2] +Input [7]: [ws_item_sk#1, ws_web_page_sk#2, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] +Condition : ((((isnotnull(ws_item_sk#1) AND isnotnull(ws_order_number#3)) AND isnotnull(ws_web_page_sk#2)) AND ((((ws_sales_price#5 >= 100.00) AND (ws_sales_price#5 <= 150.00)) OR ((ws_sales_price#5 >= 50.00) AND (ws_sales_price#5 <= 100.00))) OR ((ws_sales_price#5 >= 150.00) AND (ws_sales_price#5 <= 200.00)))) AND ((((ws_net_profit#6 >= 100.00) AND (ws_net_profit#6 <= 200.00)) OR ((ws_net_profit#6 >= 150.00) AND (ws_net_profit#6 <= 300.00))) OR ((ws_net_profit#6 >= 50.00) AND (ws_net_profit#6 <= 250.00)))) + +(4) Scan parquet default.web_page +Output [1]: [wp_web_page_sk#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_page] +PushedFilters: [IsNotNull(wp_web_page_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [1]: [wp_web_page_sk#9] + +(6) Filter [codegen id : 1] +Input [1]: [wp_web_page_sk#9] +Condition : isnotnull(wp_web_page_sk#9) + +(7) BroadcastExchange +Input [1]: [wp_web_page_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ws_web_page_sk#2] +Right keys [1]: [wp_web_page_sk#9] +Join condition: None + +(9) Project [codegen id : 2] +Output [6]: [ws_item_sk#1, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] +Input [8]: [ws_item_sk#1, ws_web_page_sk#2, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wp_web_page_sk#9] + +(10) Exchange +Input [6]: [ws_item_sk#1, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] +Arguments: hashpartitioning(ws_item_sk#1, ws_order_number#3, 5), ENSURE_REQUIREMENTS, [id=#11] + +(11) Sort [codegen id : 3] +Input [6]: [ws_item_sk#1, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] +Arguments: [ws_item_sk#1 ASC NULLS FIRST, ws_order_number#3 ASC NULLS FIRST], false, 0 + +(12) Scan parquet default.web_returns +Output [9]: [wr_item_sk#12, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_order_number#17, wr_fee#18, wr_refunded_cash#19, wr_returned_date_sk#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number), IsNotNull(wr_refunded_cdemo_sk), IsNotNull(wr_returning_cdemo_sk), IsNotNull(wr_refunded_addr_sk), IsNotNull(wr_reason_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 4] +Input [9]: [wr_item_sk#12, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_order_number#17, wr_fee#18, wr_refunded_cash#19, wr_returned_date_sk#20] + +(14) Filter [codegen id : 4] +Input [9]: [wr_item_sk#12, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_order_number#17, wr_fee#18, wr_refunded_cash#19, wr_returned_date_sk#20] +Condition : (((((isnotnull(wr_item_sk#12) AND isnotnull(wr_order_number#17)) AND isnotnull(wr_refunded_cdemo_sk#13)) AND isnotnull(wr_returning_cdemo_sk#15)) AND isnotnull(wr_refunded_addr_sk#14)) AND isnotnull(wr_reason_sk#16)) + +(15) Project [codegen id : 4] +Output [8]: [wr_item_sk#12, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_order_number#17, wr_fee#18, wr_refunded_cash#19] +Input [9]: [wr_item_sk#12, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_order_number#17, wr_fee#18, wr_refunded_cash#19, wr_returned_date_sk#20] + +(16) Exchange +Input [8]: [wr_item_sk#12, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_order_number#17, wr_fee#18, wr_refunded_cash#19] +Arguments: hashpartitioning(wr_item_sk#12, wr_order_number#17, 5), ENSURE_REQUIREMENTS, [id=#21] + +(17) Sort [codegen id : 5] +Input [8]: [wr_item_sk#12, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_order_number#17, wr_fee#18, wr_refunded_cash#19] +Arguments: [wr_item_sk#12 ASC NULLS FIRST, wr_order_number#17 ASC NULLS FIRST], false, 0 + +(18) SortMergeJoin [codegen id : 7] +Left keys [2]: [ws_item_sk#1, ws_order_number#3] +Right keys [2]: [wr_item_sk#12, wr_order_number#17] +Join condition: None + +(19) Project [codegen id : 7] +Output [10]: [ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19] +Input [14]: [ws_item_sk#1, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wr_item_sk#12, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_order_number#17, wr_fee#18, wr_refunded_cash#19] + +(20) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#22, cd_marital_status#23, cd_education_status#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), Or(Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,Advanced Degree )),And(EqualTo(cd_marital_status,S),EqualTo(cd_education_status,College ))),And(EqualTo(cd_marital_status,W),EqualTo(cd_education_status,2 yr Degree )))] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [3]: [cd_demo_sk#22, cd_marital_status#23, cd_education_status#24] + +(22) Filter [codegen id : 6] +Input [3]: [cd_demo_sk#22, cd_marital_status#23, cd_education_status#24] +Condition : (((isnotnull(cd_demo_sk#22) AND isnotnull(cd_marital_status#23)) AND isnotnull(cd_education_status#24)) AND ((((cd_marital_status#23 = M) AND (cd_education_status#24 = Advanced Degree )) OR ((cd_marital_status#23 = S) AND (cd_education_status#24 = College ))) OR ((cd_marital_status#23 = W) AND (cd_education_status#24 = 2 yr Degree )))) + +(23) BroadcastExchange +Input [3]: [cd_demo_sk#22, cd_marital_status#23, cd_education_status#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#25] + +(24) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [wr_refunded_cdemo_sk#13] +Right keys [1]: [cd_demo_sk#22] +Join condition: ((((((cd_marital_status#23 = M) AND (cd_education_status#24 = Advanced Degree )) AND (ws_sales_price#5 >= 100.00)) AND (ws_sales_price#5 <= 150.00)) OR ((((cd_marital_status#23 = S) AND (cd_education_status#24 = College )) AND (ws_sales_price#5 >= 50.00)) AND (ws_sales_price#5 <= 100.00))) OR ((((cd_marital_status#23 = W) AND (cd_education_status#24 = 2 yr Degree )) AND (ws_sales_price#5 >= 150.00)) AND (ws_sales_price#5 <= 200.00))) + +(25) Project [codegen id : 7] +Output [10]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, cd_marital_status#23, cd_education_status#24] +Input [13]: [ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_cdemo_sk#13, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, cd_demo_sk#22, cd_marital_status#23, cd_education_status#24] + +(26) Exchange +Input [10]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, cd_marital_status#23, cd_education_status#24] +Arguments: hashpartitioning(wr_returning_cdemo_sk#15, cd_marital_status#23, cd_education_status#24, 5), ENSURE_REQUIREMENTS, [id=#26] + +(27) Sort [codegen id : 8] +Input [10]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, cd_marital_status#23, cd_education_status#24] +Arguments: [wr_returning_cdemo_sk#15 ASC NULLS FIRST, cd_marital_status#23 ASC NULLS FIRST, cd_education_status#24 ASC NULLS FIRST], false, 0 + +(28) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), IsNotNull(cd_marital_status), IsNotNull(cd_education_status)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 9] +Input [3]: [cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] + +(30) Filter [codegen id : 9] +Input [3]: [cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] +Condition : ((isnotnull(cd_demo_sk#27) AND isnotnull(cd_marital_status#28)) AND isnotnull(cd_education_status#29)) + +(31) Exchange +Input [3]: [cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] +Arguments: hashpartitioning(cd_demo_sk#27, cd_marital_status#28, cd_education_status#29, 5), ENSURE_REQUIREMENTS, [id=#30] + +(32) Sort [codegen id : 10] +Input [3]: [cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] +Arguments: [cd_demo_sk#27 ASC NULLS FIRST, cd_marital_status#28 ASC NULLS FIRST, cd_education_status#29 ASC NULLS FIRST], false, 0 + +(33) SortMergeJoin [codegen id : 14] +Left keys [3]: [wr_returning_cdemo_sk#15, cd_marital_status#23, cd_education_status#24] +Right keys [3]: [cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] +Join condition: None + +(34) Project [codegen id : 14] +Output [7]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#14, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19] +Input [13]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#14, wr_returning_cdemo_sk#15, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, cd_marital_status#23, cd_education_status#24, cd_demo_sk#27, cd_marital_status#28, cd_education_status#29] + +(35) Scan parquet default.customer_address +Output [3]: [ca_address_sk#31, ca_state#32, ca_country#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), EqualTo(ca_country,United States), IsNotNull(ca_address_sk), Or(Or(In(ca_state, [IN,OH,NJ]),In(ca_state, [WI,CT,KY])),In(ca_state, [LA,IA,AR]))] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 11] +Input [3]: [ca_address_sk#31, ca_state#32, ca_country#33] + +(37) Filter [codegen id : 11] +Input [3]: [ca_address_sk#31, ca_state#32, ca_country#33] +Condition : (((isnotnull(ca_country#33) AND (ca_country#33 = United States)) AND isnotnull(ca_address_sk#31)) AND ((ca_state#32 IN (IN,OH,NJ) OR ca_state#32 IN (WI,CT,KY)) OR ca_state#32 IN (LA,IA,AR))) + +(38) Project [codegen id : 11] +Output [2]: [ca_address_sk#31, ca_state#32] +Input [3]: [ca_address_sk#31, ca_state#32, ca_country#33] + +(39) BroadcastExchange +Input [2]: [ca_address_sk#31, ca_state#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#34] + +(40) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [wr_refunded_addr_sk#14] +Right keys [1]: [ca_address_sk#31] +Join condition: ((((ca_state#32 IN (IN,OH,NJ) AND (ws_net_profit#6 >= 100.00)) AND (ws_net_profit#6 <= 200.00)) OR ((ca_state#32 IN (WI,CT,KY) AND (ws_net_profit#6 >= 150.00)) AND (ws_net_profit#6 <= 300.00))) OR ((ca_state#32 IN (LA,IA,AR) AND (ws_net_profit#6 >= 50.00)) AND (ws_net_profit#6 <= 250.00))) + +(41) Project [codegen id : 14] +Output [5]: [ws_quantity#4, ws_sold_date_sk#7, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19] +Input [9]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#14, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, ca_address_sk#31, ca_state#32] + +(42) Scan parquet default.date_dim +Output [2]: [d_date_sk#35, d_year#36] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(43) ColumnarToRow [codegen id : 12] +Input [2]: [d_date_sk#35, d_year#36] + +(44) Filter [codegen id : 12] +Input [2]: [d_date_sk#35, d_year#36] +Condition : ((isnotnull(d_year#36) AND (d_year#36 = 2000)) AND isnotnull(d_date_sk#35)) + +(45) Project [codegen id : 12] +Output [1]: [d_date_sk#35] +Input [2]: [d_date_sk#35, d_year#36] + +(46) BroadcastExchange +Input [1]: [d_date_sk#35] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#37] + +(47) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#7] +Right keys [1]: [d_date_sk#35] +Join condition: None + +(48) Project [codegen id : 14] +Output [4]: [ws_quantity#4, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19] +Input [6]: [ws_quantity#4, ws_sold_date_sk#7, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, d_date_sk#35] + +(49) Scan parquet default.reason +Output [2]: [r_reason_sk#38, r_reason_desc#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/reason] +PushedFilters: [IsNotNull(r_reason_sk)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 13] +Input [2]: [r_reason_sk#38, r_reason_desc#39] + +(51) Filter [codegen id : 13] +Input [2]: [r_reason_sk#38, r_reason_desc#39] +Condition : isnotnull(r_reason_sk#38) + +(52) BroadcastExchange +Input [2]: [r_reason_sk#38, r_reason_desc#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40] + +(53) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [wr_reason_sk#16] +Right keys [1]: [r_reason_sk#38] +Join condition: None + +(54) Project [codegen id : 14] +Output [4]: [ws_quantity#4, wr_fee#18, wr_refunded_cash#19, r_reason_desc#39] +Input [6]: [ws_quantity#4, wr_reason_sk#16, wr_fee#18, wr_refunded_cash#19, r_reason_sk#38, r_reason_desc#39] + +(55) HashAggregate [codegen id : 14] +Input [4]: [ws_quantity#4, wr_fee#18, wr_refunded_cash#19, r_reason_desc#39] +Keys [1]: [r_reason_desc#39] +Functions [3]: [partial_avg(ws_quantity#4), partial_avg(UnscaledValue(wr_refunded_cash#19)), partial_avg(UnscaledValue(wr_fee#18))] +Aggregate Attributes [6]: [sum#41, count#42, sum#43, count#44, sum#45, count#46] +Results [7]: [r_reason_desc#39, sum#47, count#48, sum#49, count#50, sum#51, count#52] + +(56) Exchange +Input [7]: [r_reason_desc#39, sum#47, count#48, sum#49, count#50, sum#51, count#52] +Arguments: hashpartitioning(r_reason_desc#39, 5), ENSURE_REQUIREMENTS, [id=#53] + +(57) HashAggregate [codegen id : 15] +Input [7]: [r_reason_desc#39, sum#47, count#48, sum#49, count#50, sum#51, count#52] +Keys [1]: [r_reason_desc#39] +Functions [3]: [avg(ws_quantity#4), avg(UnscaledValue(wr_refunded_cash#19)), avg(UnscaledValue(wr_fee#18))] +Aggregate Attributes [3]: [avg(ws_quantity#4)#54, avg(UnscaledValue(wr_refunded_cash#19))#55, avg(UnscaledValue(wr_fee#18))#56] +Results [4]: [substr(r_reason_desc#39, 1, 20) AS substr(r_reason_desc, 1, 20)#57, avg(ws_quantity#4)#54 AS avg(ws_quantity)#58, cast((avg(UnscaledValue(wr_refunded_cash#19))#55 / 100.0) as decimal(11,6)) AS avg(wr_refunded_cash)#59, cast((avg(UnscaledValue(wr_fee#18))#56 / 100.0) as decimal(11,6)) AS avg(wr_fee)#60] + +(58) TakeOrderedAndProject +Input [4]: [substr(r_reason_desc, 1, 20)#57, avg(ws_quantity)#58, avg(wr_refunded_cash)#59, avg(wr_fee)#60] +Arguments: 100, [substr(r_reason_desc, 1, 20)#57 ASC NULLS FIRST, avg(ws_quantity)#58 ASC NULLS FIRST, avg(wr_refunded_cash)#59 ASC NULLS FIRST, avg(wr_fee)#60 ASC NULLS FIRST], [substr(r_reason_desc, 1, 20)#57, avg(ws_quantity)#58, avg(wr_refunded_cash)#59, avg(wr_fee)#60] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (59) + + +(59) ReusedExchange [Reuses operator id: 46] +Output [1]: [d_date_sk#35] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt new file mode 100644 index 0000000000000..135c097574bd2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85.sf100/simplified.txt @@ -0,0 +1,97 @@ +TakeOrderedAndProject [substr(r_reason_desc, 1, 20),avg(ws_quantity),avg(wr_refunded_cash),avg(wr_fee)] + WholeStageCodegen (15) + HashAggregate [r_reason_desc,sum,count,sum,count,sum,count] [avg(ws_quantity),avg(UnscaledValue(wr_refunded_cash)),avg(UnscaledValue(wr_fee)),substr(r_reason_desc, 1, 20),avg(ws_quantity),avg(wr_refunded_cash),avg(wr_fee),sum,count,sum,count,sum,count] + InputAdapter + Exchange [r_reason_desc] #1 + WholeStageCodegen (14) + HashAggregate [r_reason_desc,ws_quantity,wr_refunded_cash,wr_fee] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [ws_quantity,wr_fee,wr_refunded_cash,r_reason_desc] + BroadcastHashJoin [wr_reason_sk,r_reason_sk] + Project [ws_quantity,wr_reason_sk,wr_fee,wr_refunded_cash] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_quantity,ws_sold_date_sk,wr_reason_sk,wr_fee,wr_refunded_cash] + BroadcastHashJoin [wr_refunded_addr_sk,ca_address_sk,ca_state,ws_net_profit] + Project [ws_quantity,ws_net_profit,ws_sold_date_sk,wr_refunded_addr_sk,wr_reason_sk,wr_fee,wr_refunded_cash] + SortMergeJoin [wr_returning_cdemo_sk,cd_marital_status,cd_education_status,cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + WholeStageCodegen (8) + Sort [wr_returning_cdemo_sk,cd_marital_status,cd_education_status] + InputAdapter + Exchange [wr_returning_cdemo_sk,cd_marital_status,cd_education_status] #2 + WholeStageCodegen (7) + Project [ws_quantity,ws_net_profit,ws_sold_date_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_fee,wr_refunded_cash,cd_marital_status,cd_education_status] + BroadcastHashJoin [wr_refunded_cdemo_sk,cd_demo_sk,cd_marital_status,cd_education_status,ws_sales_price] + Project [ws_quantity,ws_sales_price,ws_net_profit,ws_sold_date_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_fee,wr_refunded_cash] + SortMergeJoin [ws_item_sk,ws_order_number,wr_item_sk,wr_order_number] + InputAdapter + WholeStageCodegen (3) + Sort [ws_item_sk,ws_order_number] + InputAdapter + Exchange [ws_item_sk,ws_order_number] #3 + WholeStageCodegen (2) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit,ws_sold_date_sk] + BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] + Filter [ws_item_sk,ws_order_number,ws_web_page_sk,ws_sales_price,ws_net_profit] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_web_page_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Filter [wp_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_page [wp_web_page_sk] + InputAdapter + WholeStageCodegen (5) + Sort [wr_item_sk,wr_order_number] + InputAdapter + Exchange [wr_item_sk,wr_order_number] #6 + WholeStageCodegen (4) + Project [wr_item_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_order_number,wr_fee,wr_refunded_cash] + Filter [wr_item_sk,wr_order_number,wr_refunded_cdemo_sk,wr_returning_cdemo_sk,wr_refunded_addr_sk,wr_reason_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_order_number,wr_fee,wr_refunded_cash,wr_returned_date_sk] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (6) + Filter [cd_demo_sk,cd_marital_status,cd_education_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + WholeStageCodegen (10) + Sort [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + Exchange [cd_demo_sk,cd_marital_status,cd_education_status] #8 + WholeStageCodegen (9) + Filter [cd_demo_sk,cd_marital_status,cd_education_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (11) + Project [ca_address_sk,ca_state] + Filter [ca_country,ca_address_sk,ca_state] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_country] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (12) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (13) + Filter [r_reason_sk] + ColumnarToRow + InputAdapter + Scan parquet default.reason [r_reason_sk,r_reason_desc] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85/explain.txt new file mode 100644 index 0000000000000..b244c6f3810c6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85/explain.txt @@ -0,0 +1,303 @@ +== Physical Plan == +TakeOrderedAndProject (52) ++- * HashAggregate (51) + +- Exchange (50) + +- * HashAggregate (49) + +- * Project (48) + +- * BroadcastHashJoin Inner BuildRight (47) + :- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Project (35) + : : +- * BroadcastHashJoin Inner BuildRight (34) + : : :- * Project (28) + : : : +- * BroadcastHashJoin Inner BuildRight (27) + : : : :- * Project (22) + : : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : : :- * Project (16) + : : : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : : : :- * Project (10) + : : : : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : : : : :- BroadcastExchange (4) + : : : : : : : +- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.web_sales (1) + : : : : : : +- * Project (8) + : : : : : : +- * Filter (7) + : : : : : : +- * ColumnarToRow (6) + : : : : : : +- Scan parquet default.web_returns (5) + : : : : : +- BroadcastExchange (14) + : : : : : +- * Filter (13) + : : : : : +- * ColumnarToRow (12) + : : : : : +- Scan parquet default.web_page (11) + : : : : +- BroadcastExchange (20) + : : : : +- * Filter (19) + : : : : +- * ColumnarToRow (18) + : : : : +- Scan parquet default.customer_demographics (17) + : : : +- BroadcastExchange (26) + : : : +- * Filter (25) + : : : +- * ColumnarToRow (24) + : : : +- Scan parquet default.customer_demographics (23) + : : +- BroadcastExchange (33) + : : +- * Project (32) + : : +- * Filter (31) + : : +- * ColumnarToRow (30) + : : +- Scan parquet default.customer_address (29) + : +- BroadcastExchange (40) + : +- * Project (39) + : +- * Filter (38) + : +- * ColumnarToRow (37) + : +- Scan parquet default.date_dim (36) + +- BroadcastExchange (46) + +- * Filter (45) + +- * ColumnarToRow (44) + +- Scan parquet default.reason (43) + + +(1) Scan parquet default.web_sales +Output [7]: [ws_item_sk#1, ws_web_page_sk#2, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#7), dynamicpruningexpression(ws_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_page_sk), Or(Or(And(GreaterThanOrEqual(ws_sales_price,100.00),LessThanOrEqual(ws_sales_price,150.00)),And(GreaterThanOrEqual(ws_sales_price,50.00),LessThanOrEqual(ws_sales_price,100.00))),And(GreaterThanOrEqual(ws_sales_price,150.00),LessThanOrEqual(ws_sales_price,200.00))), Or(Or(And(GreaterThanOrEqual(ws_net_profit,100.00),LessThanOrEqual(ws_net_profit,200.00)),And(GreaterThanOrEqual(ws_net_profit,150.00),LessThanOrEqual(ws_net_profit,300.00))),And(GreaterThanOrEqual(ws_net_profit,50.00),LessThanOrEqual(ws_net_profit,250.00)))] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [7]: [ws_item_sk#1, ws_web_page_sk#2, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] + +(3) Filter [codegen id : 1] +Input [7]: [ws_item_sk#1, ws_web_page_sk#2, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] +Condition : ((((isnotnull(ws_item_sk#1) AND isnotnull(ws_order_number#3)) AND isnotnull(ws_web_page_sk#2)) AND ((((ws_sales_price#5 >= 100.00) AND (ws_sales_price#5 <= 150.00)) OR ((ws_sales_price#5 >= 50.00) AND (ws_sales_price#5 <= 100.00))) OR ((ws_sales_price#5 >= 150.00) AND (ws_sales_price#5 <= 200.00)))) AND ((((ws_net_profit#6 >= 100.00) AND (ws_net_profit#6 <= 200.00)) OR ((ws_net_profit#6 >= 150.00) AND (ws_net_profit#6 <= 300.00))) OR ((ws_net_profit#6 >= 50.00) AND (ws_net_profit#6 <= 250.00)))) + +(4) BroadcastExchange +Input [7]: [ws_item_sk#1, ws_web_page_sk#2, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[2, int, false] as bigint) & 4294967295))),false), [id=#9] + +(5) Scan parquet default.web_returns +Output [9]: [wr_item_sk#10, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_order_number#15, wr_fee#16, wr_refunded_cash#17, wr_returned_date_sk#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number), IsNotNull(wr_refunded_cdemo_sk), IsNotNull(wr_returning_cdemo_sk), IsNotNull(wr_refunded_addr_sk), IsNotNull(wr_reason_sk)] +ReadSchema: struct + +(6) ColumnarToRow +Input [9]: [wr_item_sk#10, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_order_number#15, wr_fee#16, wr_refunded_cash#17, wr_returned_date_sk#18] + +(7) Filter +Input [9]: [wr_item_sk#10, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_order_number#15, wr_fee#16, wr_refunded_cash#17, wr_returned_date_sk#18] +Condition : (((((isnotnull(wr_item_sk#10) AND isnotnull(wr_order_number#15)) AND isnotnull(wr_refunded_cdemo_sk#11)) AND isnotnull(wr_returning_cdemo_sk#13)) AND isnotnull(wr_refunded_addr_sk#12)) AND isnotnull(wr_reason_sk#14)) + +(8) Project +Output [8]: [wr_item_sk#10, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_order_number#15, wr_fee#16, wr_refunded_cash#17] +Input [9]: [wr_item_sk#10, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_order_number#15, wr_fee#16, wr_refunded_cash#17, wr_returned_date_sk#18] + +(9) BroadcastHashJoin [codegen id : 8] +Left keys [2]: [ws_item_sk#1, ws_order_number#3] +Right keys [2]: [wr_item_sk#10, wr_order_number#15] +Join condition: None + +(10) Project [codegen id : 8] +Output [11]: [ws_web_page_sk#2, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_fee#16, wr_refunded_cash#17] +Input [15]: [ws_item_sk#1, ws_web_page_sk#2, ws_order_number#3, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wr_item_sk#10, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_order_number#15, wr_fee#16, wr_refunded_cash#17] + +(11) Scan parquet default.web_page +Output [1]: [wp_web_page_sk#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_page] +PushedFilters: [IsNotNull(wp_web_page_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [1]: [wp_web_page_sk#19] + +(13) Filter [codegen id : 2] +Input [1]: [wp_web_page_sk#19] +Condition : isnotnull(wp_web_page_sk#19) + +(14) BroadcastExchange +Input [1]: [wp_web_page_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(15) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_web_page_sk#2] +Right keys [1]: [wp_web_page_sk#19] +Join condition: None + +(16) Project [codegen id : 8] +Output [10]: [ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_fee#16, wr_refunded_cash#17] +Input [12]: [ws_web_page_sk#2, ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_fee#16, wr_refunded_cash#17, wp_web_page_sk#19] + +(17) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#21, cd_marital_status#22, cd_education_status#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), Or(Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,Advanced Degree )),And(EqualTo(cd_marital_status,S),EqualTo(cd_education_status,College ))),And(EqualTo(cd_marital_status,W),EqualTo(cd_education_status,2 yr Degree )))] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [3]: [cd_demo_sk#21, cd_marital_status#22, cd_education_status#23] + +(19) Filter [codegen id : 3] +Input [3]: [cd_demo_sk#21, cd_marital_status#22, cd_education_status#23] +Condition : (((isnotnull(cd_demo_sk#21) AND isnotnull(cd_marital_status#22)) AND isnotnull(cd_education_status#23)) AND ((((cd_marital_status#22 = M) AND (cd_education_status#23 = Advanced Degree )) OR ((cd_marital_status#22 = S) AND (cd_education_status#23 = College ))) OR ((cd_marital_status#22 = W) AND (cd_education_status#23 = 2 yr Degree )))) + +(20) BroadcastExchange +Input [3]: [cd_demo_sk#21, cd_marital_status#22, cd_education_status#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(21) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [wr_refunded_cdemo_sk#11] +Right keys [1]: [cd_demo_sk#21] +Join condition: ((((((cd_marital_status#22 = M) AND (cd_education_status#23 = Advanced Degree )) AND (ws_sales_price#5 >= 100.00)) AND (ws_sales_price#5 <= 150.00)) OR ((((cd_marital_status#22 = S) AND (cd_education_status#23 = College )) AND (ws_sales_price#5 >= 50.00)) AND (ws_sales_price#5 <= 100.00))) OR ((((cd_marital_status#22 = W) AND (cd_education_status#23 = 2 yr Degree )) AND (ws_sales_price#5 >= 150.00)) AND (ws_sales_price#5 <= 200.00))) + +(22) Project [codegen id : 8] +Output [10]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_fee#16, wr_refunded_cash#17, cd_marital_status#22, cd_education_status#23] +Input [13]: [ws_quantity#4, ws_sales_price#5, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_cdemo_sk#11, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_fee#16, wr_refunded_cash#17, cd_demo_sk#21, cd_marital_status#22, cd_education_status#23] + +(23) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#25, cd_marital_status#26, cd_education_status#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), IsNotNull(cd_marital_status), IsNotNull(cd_education_status)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [3]: [cd_demo_sk#25, cd_marital_status#26, cd_education_status#27] + +(25) Filter [codegen id : 4] +Input [3]: [cd_demo_sk#25, cd_marital_status#26, cd_education_status#27] +Condition : ((isnotnull(cd_demo_sk#25) AND isnotnull(cd_marital_status#26)) AND isnotnull(cd_education_status#27)) + +(26) BroadcastExchange +Input [3]: [cd_demo_sk#25, cd_marital_status#26, cd_education_status#27] +Arguments: HashedRelationBroadcastMode(List(input[0, int, false], input[1, string, false], input[2, string, false]),false), [id=#28] + +(27) BroadcastHashJoin [codegen id : 8] +Left keys [3]: [wr_returning_cdemo_sk#13, cd_marital_status#22, cd_education_status#23] +Right keys [3]: [cd_demo_sk#25, cd_marital_status#26, cd_education_status#27] +Join condition: None + +(28) Project [codegen id : 8] +Output [7]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#12, wr_reason_sk#14, wr_fee#16, wr_refunded_cash#17] +Input [13]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#12, wr_returning_cdemo_sk#13, wr_reason_sk#14, wr_fee#16, wr_refunded_cash#17, cd_marital_status#22, cd_education_status#23, cd_demo_sk#25, cd_marital_status#26, cd_education_status#27] + +(29) Scan parquet default.customer_address +Output [3]: [ca_address_sk#29, ca_state#30, ca_country#31] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_country), EqualTo(ca_country,United States), IsNotNull(ca_address_sk), Or(Or(In(ca_state, [IN,OH,NJ]),In(ca_state, [WI,CT,KY])),In(ca_state, [LA,IA,AR]))] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [3]: [ca_address_sk#29, ca_state#30, ca_country#31] + +(31) Filter [codegen id : 5] +Input [3]: [ca_address_sk#29, ca_state#30, ca_country#31] +Condition : (((isnotnull(ca_country#31) AND (ca_country#31 = United States)) AND isnotnull(ca_address_sk#29)) AND ((ca_state#30 IN (IN,OH,NJ) OR ca_state#30 IN (WI,CT,KY)) OR ca_state#30 IN (LA,IA,AR))) + +(32) Project [codegen id : 5] +Output [2]: [ca_address_sk#29, ca_state#30] +Input [3]: [ca_address_sk#29, ca_state#30, ca_country#31] + +(33) BroadcastExchange +Input [2]: [ca_address_sk#29, ca_state#30] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#32] + +(34) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [wr_refunded_addr_sk#12] +Right keys [1]: [ca_address_sk#29] +Join condition: ((((ca_state#30 IN (IN,OH,NJ) AND (ws_net_profit#6 >= 100.00)) AND (ws_net_profit#6 <= 200.00)) OR ((ca_state#30 IN (WI,CT,KY) AND (ws_net_profit#6 >= 150.00)) AND (ws_net_profit#6 <= 300.00))) OR ((ca_state#30 IN (LA,IA,AR) AND (ws_net_profit#6 >= 50.00)) AND (ws_net_profit#6 <= 250.00))) + +(35) Project [codegen id : 8] +Output [5]: [ws_quantity#4, ws_sold_date_sk#7, wr_reason_sk#14, wr_fee#16, wr_refunded_cash#17] +Input [9]: [ws_quantity#4, ws_net_profit#6, ws_sold_date_sk#7, wr_refunded_addr_sk#12, wr_reason_sk#14, wr_fee#16, wr_refunded_cash#17, ca_address_sk#29, ca_state#30] + +(36) Scan parquet default.date_dim +Output [2]: [d_date_sk#33, d_year#34] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 6] +Input [2]: [d_date_sk#33, d_year#34] + +(38) Filter [codegen id : 6] +Input [2]: [d_date_sk#33, d_year#34] +Condition : ((isnotnull(d_year#34) AND (d_year#34 = 2000)) AND isnotnull(d_date_sk#33)) + +(39) Project [codegen id : 6] +Output [1]: [d_date_sk#33] +Input [2]: [d_date_sk#33, d_year#34] + +(40) BroadcastExchange +Input [1]: [d_date_sk#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] + +(41) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_sold_date_sk#7] +Right keys [1]: [d_date_sk#33] +Join condition: None + +(42) Project [codegen id : 8] +Output [4]: [ws_quantity#4, wr_reason_sk#14, wr_fee#16, wr_refunded_cash#17] +Input [6]: [ws_quantity#4, ws_sold_date_sk#7, wr_reason_sk#14, wr_fee#16, wr_refunded_cash#17, d_date_sk#33] + +(43) Scan parquet default.reason +Output [2]: [r_reason_sk#36, r_reason_desc#37] +Batched: true +Location [not included in comparison]/{warehouse_dir}/reason] +PushedFilters: [IsNotNull(r_reason_sk)] +ReadSchema: struct + +(44) ColumnarToRow [codegen id : 7] +Input [2]: [r_reason_sk#36, r_reason_desc#37] + +(45) Filter [codegen id : 7] +Input [2]: [r_reason_sk#36, r_reason_desc#37] +Condition : isnotnull(r_reason_sk#36) + +(46) BroadcastExchange +Input [2]: [r_reason_sk#36, r_reason_desc#37] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#38] + +(47) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [wr_reason_sk#14] +Right keys [1]: [r_reason_sk#36] +Join condition: None + +(48) Project [codegen id : 8] +Output [4]: [ws_quantity#4, wr_fee#16, wr_refunded_cash#17, r_reason_desc#37] +Input [6]: [ws_quantity#4, wr_reason_sk#14, wr_fee#16, wr_refunded_cash#17, r_reason_sk#36, r_reason_desc#37] + +(49) HashAggregate [codegen id : 8] +Input [4]: [ws_quantity#4, wr_fee#16, wr_refunded_cash#17, r_reason_desc#37] +Keys [1]: [r_reason_desc#37] +Functions [3]: [partial_avg(ws_quantity#4), partial_avg(UnscaledValue(wr_refunded_cash#17)), partial_avg(UnscaledValue(wr_fee#16))] +Aggregate Attributes [6]: [sum#39, count#40, sum#41, count#42, sum#43, count#44] +Results [7]: [r_reason_desc#37, sum#45, count#46, sum#47, count#48, sum#49, count#50] + +(50) Exchange +Input [7]: [r_reason_desc#37, sum#45, count#46, sum#47, count#48, sum#49, count#50] +Arguments: hashpartitioning(r_reason_desc#37, 5), ENSURE_REQUIREMENTS, [id=#51] + +(51) HashAggregate [codegen id : 9] +Input [7]: [r_reason_desc#37, sum#45, count#46, sum#47, count#48, sum#49, count#50] +Keys [1]: [r_reason_desc#37] +Functions [3]: [avg(ws_quantity#4), avg(UnscaledValue(wr_refunded_cash#17)), avg(UnscaledValue(wr_fee#16))] +Aggregate Attributes [3]: [avg(ws_quantity#4)#52, avg(UnscaledValue(wr_refunded_cash#17))#53, avg(UnscaledValue(wr_fee#16))#54] +Results [4]: [substr(r_reason_desc#37, 1, 20) AS substr(r_reason_desc, 1, 20)#55, avg(ws_quantity#4)#52 AS avg(ws_quantity)#56, cast((avg(UnscaledValue(wr_refunded_cash#17))#53 / 100.0) as decimal(11,6)) AS avg(wr_refunded_cash)#57, cast((avg(UnscaledValue(wr_fee#16))#54 / 100.0) as decimal(11,6)) AS avg(wr_fee)#58] + +(52) TakeOrderedAndProject +Input [4]: [substr(r_reason_desc, 1, 20)#55, avg(ws_quantity)#56, avg(wr_refunded_cash)#57, avg(wr_fee)#58] +Arguments: 100, [substr(r_reason_desc, 1, 20)#55 ASC NULLS FIRST, avg(ws_quantity)#56 ASC NULLS FIRST, avg(wr_refunded_cash)#57 ASC NULLS FIRST, avg(wr_fee)#58 ASC NULLS FIRST], [substr(r_reason_desc, 1, 20)#55, avg(ws_quantity)#56, avg(wr_refunded_cash)#57, avg(wr_fee)#58] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (53) + + +(53) ReusedExchange [Reuses operator id: 40] +Output [1]: [d_date_sk#33] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85/simplified.txt new file mode 100644 index 0000000000000..932ed71fbd57d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q85/simplified.txt @@ -0,0 +1,79 @@ +TakeOrderedAndProject [substr(r_reason_desc, 1, 20),avg(ws_quantity),avg(wr_refunded_cash),avg(wr_fee)] + WholeStageCodegen (9) + HashAggregate [r_reason_desc,sum,count,sum,count,sum,count] [avg(ws_quantity),avg(UnscaledValue(wr_refunded_cash)),avg(UnscaledValue(wr_fee)),substr(r_reason_desc, 1, 20),avg(ws_quantity),avg(wr_refunded_cash),avg(wr_fee),sum,count,sum,count,sum,count] + InputAdapter + Exchange [r_reason_desc] #1 + WholeStageCodegen (8) + HashAggregate [r_reason_desc,ws_quantity,wr_refunded_cash,wr_fee] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [ws_quantity,wr_fee,wr_refunded_cash,r_reason_desc] + BroadcastHashJoin [wr_reason_sk,r_reason_sk] + Project [ws_quantity,wr_reason_sk,wr_fee,wr_refunded_cash] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_quantity,ws_sold_date_sk,wr_reason_sk,wr_fee,wr_refunded_cash] + BroadcastHashJoin [wr_refunded_addr_sk,ca_address_sk,ca_state,ws_net_profit] + Project [ws_quantity,ws_net_profit,ws_sold_date_sk,wr_refunded_addr_sk,wr_reason_sk,wr_fee,wr_refunded_cash] + BroadcastHashJoin [wr_returning_cdemo_sk,cd_marital_status,cd_education_status,cd_demo_sk,cd_marital_status,cd_education_status] + Project [ws_quantity,ws_net_profit,ws_sold_date_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_fee,wr_refunded_cash,cd_marital_status,cd_education_status] + BroadcastHashJoin [wr_refunded_cdemo_sk,cd_demo_sk,cd_marital_status,cd_education_status,ws_sales_price] + Project [ws_quantity,ws_sales_price,ws_net_profit,ws_sold_date_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_fee,wr_refunded_cash] + BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] + Project [ws_web_page_sk,ws_quantity,ws_sales_price,ws_net_profit,ws_sold_date_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_fee,wr_refunded_cash] + BroadcastHashJoin [ws_item_sk,ws_order_number,wr_item_sk,wr_order_number] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ws_item_sk,ws_order_number,ws_web_page_sk,ws_sales_price,ws_net_profit] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_web_page_sk,ws_order_number,ws_quantity,ws_sales_price,ws_net_profit,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + Project [wr_item_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_order_number,wr_fee,wr_refunded_cash] + Filter [wr_item_sk,wr_order_number,wr_refunded_cdemo_sk,wr_returning_cdemo_sk,wr_refunded_addr_sk,wr_reason_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_refunded_cdemo_sk,wr_refunded_addr_sk,wr_returning_cdemo_sk,wr_reason_sk,wr_order_number,wr_fee,wr_refunded_cash,wr_returned_date_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [wp_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_page [wp_web_page_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [cd_demo_sk,cd_marital_status,cd_education_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Filter [cd_demo_sk,cd_marital_status,cd_education_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (5) + Project [ca_address_sk,ca_state] + Filter [ca_country,ca_address_sk,ca_state] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_country] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (6) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (7) + Filter [r_reason_sk] + ColumnarToRow + InputAdapter + Scan parquet default.reason [r_reason_sk,r_reason_desc] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/explain.txt new file mode 100644 index 0000000000000..447a40326a9c0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/explain.txt @@ -0,0 +1,153 @@ +== Physical Plan == +TakeOrderedAndProject (25) ++- * Project (24) + +- Window (23) + +- * Sort (22) + +- Exchange (21) + +- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Expand (17) + +- * Project (16) + +- * BroadcastHashJoin Inner BuildRight (15) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- BroadcastExchange (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3] +Condition : isnotnull(ws_item_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 3] +Output [2]: [ws_item_sk#1, ws_net_paid#2] +Input [4]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3, d_date_sk#5] + +(11) Scan parquet default.item +Output [3]: [i_item_sk#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [i_item_sk#8, i_class#9, i_category#10] + +(13) Filter [codegen id : 2] +Input [3]: [i_item_sk#8, i_class#9, i_category#10] +Condition : isnotnull(i_item_sk#8) + +(14) BroadcastExchange +Input [3]: [i_item_sk#8, i_class#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_item_sk#1] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [ws_net_paid#2, i_category#10, i_class#9] +Input [5]: [ws_item_sk#1, ws_net_paid#2, i_item_sk#8, i_class#9, i_category#10] + +(17) Expand [codegen id : 3] +Input [3]: [ws_net_paid#2, i_category#10, i_class#9] +Arguments: [List(ws_net_paid#2, i_category#10, i_class#9, 0), List(ws_net_paid#2, i_category#10, null, 1), List(ws_net_paid#2, null, null, 3)], [ws_net_paid#2, i_category#12, i_class#13, spark_grouping_id#14] + +(18) HashAggregate [codegen id : 3] +Input [4]: [ws_net_paid#2, i_category#12, i_class#13, spark_grouping_id#14] +Keys [3]: [i_category#12, i_class#13, spark_grouping_id#14] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#2))] +Aggregate Attributes [1]: [sum#15] +Results [4]: [i_category#12, i_class#13, spark_grouping_id#14, sum#16] + +(19) Exchange +Input [4]: [i_category#12, i_class#13, spark_grouping_id#14, sum#16] +Arguments: hashpartitioning(i_category#12, i_class#13, spark_grouping_id#14, 5), ENSURE_REQUIREMENTS, [id=#17] + +(20) HashAggregate [codegen id : 4] +Input [4]: [i_category#12, i_class#13, spark_grouping_id#14, sum#16] +Keys [3]: [i_category#12, i_class#13, spark_grouping_id#14] +Functions [1]: [sum(UnscaledValue(ws_net_paid#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#2))#18] +Results [7]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#2))#18,17,2) AS total_sum#19, i_category#12, i_class#13, (cast((shiftright(spark_grouping_id#14, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#14, 0) & 1) as tinyint)) AS lochierarchy#20, (cast((shiftright(spark_grouping_id#14, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#14, 0) & 1) as tinyint)) AS _w1#21, CASE WHEN (cast((shiftright(spark_grouping_id#14, 0) & 1) as tinyint) = 0) THEN i_category#12 END AS _w2#22, MakeDecimal(sum(UnscaledValue(ws_net_paid#2))#18,17,2) AS _w3#23] + +(21) Exchange +Input [7]: [total_sum#19, i_category#12, i_class#13, lochierarchy#20, _w1#21, _w2#22, _w3#23] +Arguments: hashpartitioning(_w1#21, _w2#22, 5), ENSURE_REQUIREMENTS, [id=#24] + +(22) Sort [codegen id : 5] +Input [7]: [total_sum#19, i_category#12, i_class#13, lochierarchy#20, _w1#21, _w2#22, _w3#23] +Arguments: [_w1#21 ASC NULLS FIRST, _w2#22 ASC NULLS FIRST, _w3#23 DESC NULLS LAST], false, 0 + +(23) Window +Input [7]: [total_sum#19, i_category#12, i_class#13, lochierarchy#20, _w1#21, _w2#22, _w3#23] +Arguments: [rank(_w3#23) windowspecdefinition(_w1#21, _w2#22, _w3#23 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#25], [_w1#21, _w2#22], [_w3#23 DESC NULLS LAST] + +(24) Project [codegen id : 6] +Output [5]: [total_sum#19, i_category#12, i_class#13, lochierarchy#20, rank_within_parent#25] +Input [8]: [total_sum#19, i_category#12, i_class#13, lochierarchy#20, _w1#21, _w2#22, _w3#23, rank_within_parent#25] + +(25) TakeOrderedAndProject +Input [5]: [total_sum#19, i_category#12, i_class#13, lochierarchy#20, rank_within_parent#25] +Arguments: 100, [lochierarchy#20 DESC NULLS LAST, CASE WHEN (lochierarchy#20 = 0) THEN i_category#12 END ASC NULLS FIRST, rank_within_parent#25 ASC NULLS FIRST], [total_sum#19, i_category#12, i_class#13, lochierarchy#20, rank_within_parent#25] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (26) + + +(26) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/simplified.txt new file mode 100644 index 0000000000000..428ebafa39063 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86.sf100/simplified.txt @@ -0,0 +1,41 @@ +TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,total_sum,i_class] + WholeStageCodegen (6) + Project [total_sum,i_category,i_class,lochierarchy,rank_within_parent] + InputAdapter + Window [_w3,_w1,_w2] + WholeStageCodegen (5) + Sort [_w1,_w2,_w3] + InputAdapter + Exchange [_w1,_w2] #1 + WholeStageCodegen (4) + HashAggregate [i_category,i_class,spark_grouping_id,sum] [sum(UnscaledValue(ws_net_paid)),total_sum,lochierarchy,_w1,_w2,_w3,sum] + InputAdapter + Exchange [i_category,i_class,spark_grouping_id] #2 + WholeStageCodegen (3) + HashAggregate [i_category,i_class,spark_grouping_id,ws_net_paid] [sum,sum] + Expand [ws_net_paid,i_category,i_class] + Project [ws_net_paid,i_category,i_class] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_net_paid] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_net_paid,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86/explain.txt new file mode 100644 index 0000000000000..447a40326a9c0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86/explain.txt @@ -0,0 +1,153 @@ +== Physical Plan == +TakeOrderedAndProject (25) ++- * Project (24) + +- Window (23) + +- * Sort (22) + +- Exchange (21) + +- * HashAggregate (20) + +- Exchange (19) + +- * HashAggregate (18) + +- * Expand (17) + +- * Project (16) + +- * BroadcastHashJoin Inner BuildRight (15) + :- * Project (10) + : +- * BroadcastHashJoin Inner BuildRight (9) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- BroadcastExchange (8) + : +- * Project (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.date_dim (4) + +- BroadcastExchange (14) + +- * Filter (13) + +- * ColumnarToRow (12) + +- Scan parquet default.item (11) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3] +Condition : isnotnull(ws_item_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 3] +Output [2]: [ws_item_sk#1, ws_net_paid#2] +Input [4]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3, d_date_sk#5] + +(11) Scan parquet default.item +Output [3]: [i_item_sk#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [i_item_sk#8, i_class#9, i_category#10] + +(13) Filter [codegen id : 2] +Input [3]: [i_item_sk#8, i_class#9, i_category#10] +Condition : isnotnull(i_item_sk#8) + +(14) BroadcastExchange +Input [3]: [i_item_sk#8, i_class#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_item_sk#1] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [ws_net_paid#2, i_category#10, i_class#9] +Input [5]: [ws_item_sk#1, ws_net_paid#2, i_item_sk#8, i_class#9, i_category#10] + +(17) Expand [codegen id : 3] +Input [3]: [ws_net_paid#2, i_category#10, i_class#9] +Arguments: [List(ws_net_paid#2, i_category#10, i_class#9, 0), List(ws_net_paid#2, i_category#10, null, 1), List(ws_net_paid#2, null, null, 3)], [ws_net_paid#2, i_category#12, i_class#13, spark_grouping_id#14] + +(18) HashAggregate [codegen id : 3] +Input [4]: [ws_net_paid#2, i_category#12, i_class#13, spark_grouping_id#14] +Keys [3]: [i_category#12, i_class#13, spark_grouping_id#14] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#2))] +Aggregate Attributes [1]: [sum#15] +Results [4]: [i_category#12, i_class#13, spark_grouping_id#14, sum#16] + +(19) Exchange +Input [4]: [i_category#12, i_class#13, spark_grouping_id#14, sum#16] +Arguments: hashpartitioning(i_category#12, i_class#13, spark_grouping_id#14, 5), ENSURE_REQUIREMENTS, [id=#17] + +(20) HashAggregate [codegen id : 4] +Input [4]: [i_category#12, i_class#13, spark_grouping_id#14, sum#16] +Keys [3]: [i_category#12, i_class#13, spark_grouping_id#14] +Functions [1]: [sum(UnscaledValue(ws_net_paid#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#2))#18] +Results [7]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#2))#18,17,2) AS total_sum#19, i_category#12, i_class#13, (cast((shiftright(spark_grouping_id#14, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#14, 0) & 1) as tinyint)) AS lochierarchy#20, (cast((shiftright(spark_grouping_id#14, 1) & 1) as tinyint) + cast((shiftright(spark_grouping_id#14, 0) & 1) as tinyint)) AS _w1#21, CASE WHEN (cast((shiftright(spark_grouping_id#14, 0) & 1) as tinyint) = 0) THEN i_category#12 END AS _w2#22, MakeDecimal(sum(UnscaledValue(ws_net_paid#2))#18,17,2) AS _w3#23] + +(21) Exchange +Input [7]: [total_sum#19, i_category#12, i_class#13, lochierarchy#20, _w1#21, _w2#22, _w3#23] +Arguments: hashpartitioning(_w1#21, _w2#22, 5), ENSURE_REQUIREMENTS, [id=#24] + +(22) Sort [codegen id : 5] +Input [7]: [total_sum#19, i_category#12, i_class#13, lochierarchy#20, _w1#21, _w2#22, _w3#23] +Arguments: [_w1#21 ASC NULLS FIRST, _w2#22 ASC NULLS FIRST, _w3#23 DESC NULLS LAST], false, 0 + +(23) Window +Input [7]: [total_sum#19, i_category#12, i_class#13, lochierarchy#20, _w1#21, _w2#22, _w3#23] +Arguments: [rank(_w3#23) windowspecdefinition(_w1#21, _w2#22, _w3#23 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#25], [_w1#21, _w2#22], [_w3#23 DESC NULLS LAST] + +(24) Project [codegen id : 6] +Output [5]: [total_sum#19, i_category#12, i_class#13, lochierarchy#20, rank_within_parent#25] +Input [8]: [total_sum#19, i_category#12, i_class#13, lochierarchy#20, _w1#21, _w2#22, _w3#23, rank_within_parent#25] + +(25) TakeOrderedAndProject +Input [5]: [total_sum#19, i_category#12, i_class#13, lochierarchy#20, rank_within_parent#25] +Arguments: 100, [lochierarchy#20 DESC NULLS LAST, CASE WHEN (lochierarchy#20 = 0) THEN i_category#12 END ASC NULLS FIRST, rank_within_parent#25 ASC NULLS FIRST], [total_sum#19, i_category#12, i_class#13, lochierarchy#20, rank_within_parent#25] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (26) + + +(26) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86/simplified.txt new file mode 100644 index 0000000000000..428ebafa39063 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q86/simplified.txt @@ -0,0 +1,41 @@ +TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,total_sum,i_class] + WholeStageCodegen (6) + Project [total_sum,i_category,i_class,lochierarchy,rank_within_parent] + InputAdapter + Window [_w3,_w1,_w2] + WholeStageCodegen (5) + Sort [_w1,_w2,_w3] + InputAdapter + Exchange [_w1,_w2] #1 + WholeStageCodegen (4) + HashAggregate [i_category,i_class,spark_grouping_id,sum] [sum(UnscaledValue(ws_net_paid)),total_sum,lochierarchy,_w1,_w2,_w3,sum] + InputAdapter + Exchange [i_category,i_class,spark_grouping_id] #2 + WholeStageCodegen (3) + HashAggregate [i_category,i_class,spark_grouping_id,ws_net_paid] [sum,sum] + Expand [ws_net_paid,i_category,i_class] + Project [ws_net_paid,i_category,i_class] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_net_paid] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_net_paid,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_class,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/explain.txt new file mode 100644 index 0000000000000..92895cb566fd2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/explain.txt @@ -0,0 +1,425 @@ +== Physical Plan == +* HashAggregate (71) ++- Exchange (70) + +- * HashAggregate (69) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- SortMergeJoin LeftAnti (65) + :- * Sort (47) + : +- Exchange (46) + : +- * HashAggregate (45) + : +- Exchange (44) + : +- * HashAggregate (43) + : +- SortMergeJoin LeftAnti (42) + : :- * Sort (24) + : : +- Exchange (23) + : : +- * HashAggregate (22) + : : +- Exchange (21) + : : +- * HashAggregate (20) + : : +- * Project (19) + : : +- * SortMergeJoin Inner (18) + : : :- * Sort (12) + : : : +- Exchange (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- * Sort (17) + : : +- Exchange (16) + : : +- * Filter (15) + : : +- * ColumnarToRow (14) + : : +- Scan parquet default.customer (13) + : +- * Sort (41) + : +- Exchange (40) + : +- * HashAggregate (39) + : +- Exchange (38) + : +- * HashAggregate (37) + : +- * Project (36) + : +- * SortMergeJoin Inner (35) + : :- * Sort (32) + : : +- Exchange (31) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.catalog_sales (25) + : : +- ReusedExchange (28) + : +- * Sort (34) + : +- ReusedExchange (33) + +- * Sort (64) + +- Exchange (63) + +- * HashAggregate (62) + +- Exchange (61) + +- * HashAggregate (60) + +- * Project (59) + +- * SortMergeJoin Inner (58) + :- * Sort (55) + : +- Exchange (54) + : +- * Project (53) + : +- * BroadcastHashJoin Inner BuildRight (52) + : :- * Filter (50) + : : +- * ColumnarToRow (49) + : : +- Scan parquet default.web_sales (48) + : +- ReusedExchange (51) + +- * Sort (57) + +- ReusedExchange (56) + + +(1) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#1, ss_sold_date_sk#2] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#2), dynamicpruningexpression(ss_sold_date_sk#2 IN dynamicpruning#3)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [2]: [ss_customer_sk#1, ss_sold_date_sk#2] + +(3) Filter [codegen id : 2] +Input [2]: [ss_customer_sk#1, ss_sold_date_sk#2] +Condition : isnotnull(ss_customer_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_date#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_date#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_date#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#4)) + +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#4, d_date#5] +Input [3]: [d_date_sk#4, d_date#5, d_month_seq#6] + +(8) BroadcastExchange +Input [2]: [d_date_sk#4, d_date#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#2] +Right keys [1]: [d_date_sk#4] +Join condition: None + +(10) Project [codegen id : 2] +Output [2]: [ss_customer_sk#1, d_date#5] +Input [4]: [ss_customer_sk#1, ss_sold_date_sk#2, d_date_sk#4, d_date#5] + +(11) Exchange +Input [2]: [ss_customer_sk#1, d_date#5] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#8] + +(12) Sort [codegen id : 3] +Input [2]: [ss_customer_sk#1, d_date#5] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.customer +Output [3]: [c_customer_sk#9, c_first_name#10, c_last_name#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 4] +Input [3]: [c_customer_sk#9, c_first_name#10, c_last_name#11] + +(15) Filter [codegen id : 4] +Input [3]: [c_customer_sk#9, c_first_name#10, c_last_name#11] +Condition : isnotnull(c_customer_sk#9) + +(16) Exchange +Input [3]: [c_customer_sk#9, c_first_name#10, c_last_name#11] +Arguments: hashpartitioning(c_customer_sk#9, 5), ENSURE_REQUIREMENTS, [id=#12] + +(17) Sort [codegen id : 5] +Input [3]: [c_customer_sk#9, c_first_name#10, c_last_name#11] +Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 + +(18) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#9] +Join condition: None + +(19) Project [codegen id : 6] +Output [3]: [c_last_name#11, c_first_name#10, d_date#5] +Input [5]: [ss_customer_sk#1, d_date#5, c_customer_sk#9, c_first_name#10, c_last_name#11] + +(20) HashAggregate [codegen id : 6] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Keys [3]: [c_last_name#11, c_first_name#10, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#11, c_first_name#10, d_date#5] + +(21) Exchange +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: hashpartitioning(c_last_name#11, c_first_name#10, d_date#5, 5), ENSURE_REQUIREMENTS, [id=#13] + +(22) HashAggregate [codegen id : 7] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Keys [3]: [c_last_name#11, c_first_name#10, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#11, c_first_name#10, d_date#5] + +(23) Exchange +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: hashpartitioning(coalesce(c_last_name#11, ), isnull(c_last_name#11), coalesce(c_first_name#10, ), isnull(c_first_name#10), coalesce(d_date#5, 1970-01-01), isnull(d_date#5), 5), ENSURE_REQUIREMENTS, [id=#14] + +(24) Sort [codegen id : 8] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: [coalesce(c_last_name#11, ) ASC NULLS FIRST, isnull(c_last_name#11) ASC NULLS FIRST, coalesce(c_first_name#10, ) ASC NULLS FIRST, isnull(c_first_name#10) ASC NULLS FIRST, coalesce(d_date#5, 1970-01-01) ASC NULLS FIRST, isnull(d_date#5) ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.catalog_sales +Output [2]: [cs_bill_customer_sk#15, cs_sold_date_sk#16] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#16), dynamicpruningexpression(cs_sold_date_sk#16 IN dynamicpruning#3)] +PushedFilters: [IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 10] +Input [2]: [cs_bill_customer_sk#15, cs_sold_date_sk#16] + +(27) Filter [codegen id : 10] +Input [2]: [cs_bill_customer_sk#15, cs_sold_date_sk#16] +Condition : isnotnull(cs_bill_customer_sk#15) + +(28) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#17, d_date#18] + +(29) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#16] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(30) Project [codegen id : 10] +Output [2]: [cs_bill_customer_sk#15, d_date#18] +Input [4]: [cs_bill_customer_sk#15, cs_sold_date_sk#16, d_date_sk#17, d_date#18] + +(31) Exchange +Input [2]: [cs_bill_customer_sk#15, d_date#18] +Arguments: hashpartitioning(cs_bill_customer_sk#15, 5), ENSURE_REQUIREMENTS, [id=#19] + +(32) Sort [codegen id : 11] +Input [2]: [cs_bill_customer_sk#15, d_date#18] +Arguments: [cs_bill_customer_sk#15 ASC NULLS FIRST], false, 0 + +(33) ReusedExchange [Reuses operator id: 16] +Output [3]: [c_customer_sk#20, c_first_name#21, c_last_name#22] + +(34) Sort [codegen id : 13] +Input [3]: [c_customer_sk#20, c_first_name#21, c_last_name#22] +Arguments: [c_customer_sk#20 ASC NULLS FIRST], false, 0 + +(35) SortMergeJoin [codegen id : 14] +Left keys [1]: [cs_bill_customer_sk#15] +Right keys [1]: [c_customer_sk#20] +Join condition: None + +(36) Project [codegen id : 14] +Output [3]: [c_last_name#22, c_first_name#21, d_date#18] +Input [5]: [cs_bill_customer_sk#15, d_date#18, c_customer_sk#20, c_first_name#21, c_last_name#22] + +(37) HashAggregate [codegen id : 14] +Input [3]: [c_last_name#22, c_first_name#21, d_date#18] +Keys [3]: [c_last_name#22, c_first_name#21, d_date#18] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#22, c_first_name#21, d_date#18] + +(38) Exchange +Input [3]: [c_last_name#22, c_first_name#21, d_date#18] +Arguments: hashpartitioning(c_last_name#22, c_first_name#21, d_date#18, 5), ENSURE_REQUIREMENTS, [id=#23] + +(39) HashAggregate [codegen id : 15] +Input [3]: [c_last_name#22, c_first_name#21, d_date#18] +Keys [3]: [c_last_name#22, c_first_name#21, d_date#18] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#22, c_first_name#21, d_date#18] + +(40) Exchange +Input [3]: [c_last_name#22, c_first_name#21, d_date#18] +Arguments: hashpartitioning(coalesce(c_last_name#22, ), isnull(c_last_name#22), coalesce(c_first_name#21, ), isnull(c_first_name#21), coalesce(d_date#18, 1970-01-01), isnull(d_date#18), 5), ENSURE_REQUIREMENTS, [id=#24] + +(41) Sort [codegen id : 16] +Input [3]: [c_last_name#22, c_first_name#21, d_date#18] +Arguments: [coalesce(c_last_name#22, ) ASC NULLS FIRST, isnull(c_last_name#22) ASC NULLS FIRST, coalesce(c_first_name#21, ) ASC NULLS FIRST, isnull(c_first_name#21) ASC NULLS FIRST, coalesce(d_date#18, 1970-01-01) ASC NULLS FIRST, isnull(d_date#18) ASC NULLS FIRST], false, 0 + +(42) SortMergeJoin +Left keys [6]: [coalesce(c_last_name#11, ), isnull(c_last_name#11), coalesce(c_first_name#10, ), isnull(c_first_name#10), coalesce(d_date#5, 1970-01-01), isnull(d_date#5)] +Right keys [6]: [coalesce(c_last_name#22, ), isnull(c_last_name#22), coalesce(c_first_name#21, ), isnull(c_first_name#21), coalesce(d_date#18, 1970-01-01), isnull(d_date#18)] +Join condition: None + +(43) HashAggregate [codegen id : 17] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Keys [3]: [c_last_name#11, c_first_name#10, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#11, c_first_name#10, d_date#5] + +(44) Exchange +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: hashpartitioning(c_last_name#11, c_first_name#10, d_date#5, 5), ENSURE_REQUIREMENTS, [id=#25] + +(45) HashAggregate [codegen id : 18] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Keys [3]: [c_last_name#11, c_first_name#10, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#11, c_first_name#10, d_date#5] + +(46) Exchange +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: hashpartitioning(coalesce(c_last_name#11, ), isnull(c_last_name#11), coalesce(c_first_name#10, ), isnull(c_first_name#10), coalesce(d_date#5, 1970-01-01), isnull(d_date#5), 5), ENSURE_REQUIREMENTS, [id=#26] + +(47) Sort [codegen id : 19] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: [coalesce(c_last_name#11, ) ASC NULLS FIRST, isnull(c_last_name#11) ASC NULLS FIRST, coalesce(c_first_name#10, ) ASC NULLS FIRST, isnull(c_first_name#10) ASC NULLS FIRST, coalesce(d_date#5, 1970-01-01) ASC NULLS FIRST, isnull(d_date#5) ASC NULLS FIRST], false, 0 + +(48) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#27, ws_sold_date_sk#28] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#28), dynamicpruningexpression(ws_sold_date_sk#28 IN dynamicpruning#3)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 21] +Input [2]: [ws_bill_customer_sk#27, ws_sold_date_sk#28] + +(50) Filter [codegen id : 21] +Input [2]: [ws_bill_customer_sk#27, ws_sold_date_sk#28] +Condition : isnotnull(ws_bill_customer_sk#27) + +(51) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#29, d_date#30] + +(52) BroadcastHashJoin [codegen id : 21] +Left keys [1]: [ws_sold_date_sk#28] +Right keys [1]: [d_date_sk#29] +Join condition: None + +(53) Project [codegen id : 21] +Output [2]: [ws_bill_customer_sk#27, d_date#30] +Input [4]: [ws_bill_customer_sk#27, ws_sold_date_sk#28, d_date_sk#29, d_date#30] + +(54) Exchange +Input [2]: [ws_bill_customer_sk#27, d_date#30] +Arguments: hashpartitioning(ws_bill_customer_sk#27, 5), ENSURE_REQUIREMENTS, [id=#31] + +(55) Sort [codegen id : 22] +Input [2]: [ws_bill_customer_sk#27, d_date#30] +Arguments: [ws_bill_customer_sk#27 ASC NULLS FIRST], false, 0 + +(56) ReusedExchange [Reuses operator id: 16] +Output [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] + +(57) Sort [codegen id : 24] +Input [3]: [c_customer_sk#32, c_first_name#33, c_last_name#34] +Arguments: [c_customer_sk#32 ASC NULLS FIRST], false, 0 + +(58) SortMergeJoin [codegen id : 25] +Left keys [1]: [ws_bill_customer_sk#27] +Right keys [1]: [c_customer_sk#32] +Join condition: None + +(59) Project [codegen id : 25] +Output [3]: [c_last_name#34, c_first_name#33, d_date#30] +Input [5]: [ws_bill_customer_sk#27, d_date#30, c_customer_sk#32, c_first_name#33, c_last_name#34] + +(60) HashAggregate [codegen id : 25] +Input [3]: [c_last_name#34, c_first_name#33, d_date#30] +Keys [3]: [c_last_name#34, c_first_name#33, d_date#30] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#34, c_first_name#33, d_date#30] + +(61) Exchange +Input [3]: [c_last_name#34, c_first_name#33, d_date#30] +Arguments: hashpartitioning(c_last_name#34, c_first_name#33, d_date#30, 5), ENSURE_REQUIREMENTS, [id=#35] + +(62) HashAggregate [codegen id : 26] +Input [3]: [c_last_name#34, c_first_name#33, d_date#30] +Keys [3]: [c_last_name#34, c_first_name#33, d_date#30] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#34, c_first_name#33, d_date#30] + +(63) Exchange +Input [3]: [c_last_name#34, c_first_name#33, d_date#30] +Arguments: hashpartitioning(coalesce(c_last_name#34, ), isnull(c_last_name#34), coalesce(c_first_name#33, ), isnull(c_first_name#33), coalesce(d_date#30, 1970-01-01), isnull(d_date#30), 5), ENSURE_REQUIREMENTS, [id=#36] + +(64) Sort [codegen id : 27] +Input [3]: [c_last_name#34, c_first_name#33, d_date#30] +Arguments: [coalesce(c_last_name#34, ) ASC NULLS FIRST, isnull(c_last_name#34) ASC NULLS FIRST, coalesce(c_first_name#33, ) ASC NULLS FIRST, isnull(c_first_name#33) ASC NULLS FIRST, coalesce(d_date#30, 1970-01-01) ASC NULLS FIRST, isnull(d_date#30) ASC NULLS FIRST], false, 0 + +(65) SortMergeJoin +Left keys [6]: [coalesce(c_last_name#11, ), isnull(c_last_name#11), coalesce(c_first_name#10, ), isnull(c_first_name#10), coalesce(d_date#5, 1970-01-01), isnull(d_date#5)] +Right keys [6]: [coalesce(c_last_name#34, ), isnull(c_last_name#34), coalesce(c_first_name#33, ), isnull(c_first_name#33), coalesce(d_date#30, 1970-01-01), isnull(d_date#30)] +Join condition: None + +(66) HashAggregate [codegen id : 28] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Keys [3]: [c_last_name#11, c_first_name#10, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#11, c_first_name#10, d_date#5] + +(67) Exchange +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Arguments: hashpartitioning(c_last_name#11, c_first_name#10, d_date#5, 5), ENSURE_REQUIREMENTS, [id=#37] + +(68) HashAggregate [codegen id : 29] +Input [3]: [c_last_name#11, c_first_name#10, d_date#5] +Keys [3]: [c_last_name#11, c_first_name#10, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results: [] + +(69) HashAggregate [codegen id : 29] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#38] +Results [1]: [count#39] + +(70) Exchange +Input [1]: [count#39] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#40] + +(71) HashAggregate [codegen id : 30] +Input [1]: [count#39] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#41] +Results [1]: [count(1)#41 AS count(1)#42] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#2 IN dynamicpruning#3 +ReusedExchange (72) + + +(72) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#4, d_date#5] + +Subquery:2 Hosting operator id = 25 Hosting Expression = cs_sold_date_sk#16 IN dynamicpruning#3 + +Subquery:3 Hosting operator id = 48 Hosting Expression = ws_sold_date_sk#28 IN dynamicpruning#3 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/simplified.txt new file mode 100644 index 0000000000000..2978f51532d83 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87.sf100/simplified.txt @@ -0,0 +1,133 @@ +WholeStageCodegen (30) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #1 + WholeStageCodegen (29) + HashAggregate [count,count] + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #2 + WholeStageCodegen (28) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + SortMergeJoin [c_last_name,c_first_name,d_date,c_last_name,c_first_name,d_date] + WholeStageCodegen (19) + Sort [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #3 + WholeStageCodegen (18) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #4 + WholeStageCodegen (17) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + SortMergeJoin [c_last_name,c_first_name,d_date,c_last_name,c_first_name,d_date] + WholeStageCodegen (8) + Sort [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #5 + WholeStageCodegen (7) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #6 + WholeStageCodegen (6) + HashAggregate [c_last_name,c_first_name,d_date] + Project [c_last_name,c_first_name,d_date] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #7 + WholeStageCodegen (2) + Project [ss_customer_sk,d_date] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date] #8 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (1) + Project [d_date_sk,d_date] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_month_seq] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #9 + WholeStageCodegen (4) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name] + WholeStageCodegen (16) + Sort [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #10 + WholeStageCodegen (15) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #11 + WholeStageCodegen (14) + HashAggregate [c_last_name,c_first_name,d_date] + Project [c_last_name,c_first_name,d_date] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (11) + Sort [cs_bill_customer_sk] + InputAdapter + Exchange [cs_bill_customer_sk] #12 + WholeStageCodegen (10) + Project [cs_bill_customer_sk,d_date] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_date] #8 + InputAdapter + WholeStageCodegen (13) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_first_name,c_last_name] #9 + WholeStageCodegen (27) + Sort [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #13 + WholeStageCodegen (26) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #14 + WholeStageCodegen (25) + HashAggregate [c_last_name,c_first_name,d_date] + Project [c_last_name,c_first_name,d_date] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (22) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #15 + WholeStageCodegen (21) + Project [ws_bill_customer_sk,d_date] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_date] #8 + InputAdapter + WholeStageCodegen (24) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_first_name,c_last_name] #9 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87/explain.txt new file mode 100644 index 0000000000000..27e16b75638a8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87/explain.txt @@ -0,0 +1,340 @@ +== Physical Plan == +* HashAggregate (54) ++- Exchange (53) + +- * HashAggregate (52) + +- * HashAggregate (51) + +- * HashAggregate (50) + +- * BroadcastHashJoin LeftAnti BuildRight (49) + :- * HashAggregate (35) + : +- * HashAggregate (34) + : +- * BroadcastHashJoin LeftAnti BuildRight (33) + : :- * HashAggregate (19) + : : +- Exchange (18) + : : +- * HashAggregate (17) + : : +- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.customer (11) + : +- BroadcastExchange (32) + : +- * HashAggregate (31) + : +- Exchange (30) + : +- * HashAggregate (29) + : +- * Project (28) + : +- * BroadcastHashJoin Inner BuildRight (27) + : :- * Project (25) + : : +- * BroadcastHashJoin Inner BuildRight (24) + : : :- * Filter (22) + : : : +- * ColumnarToRow (21) + : : : +- Scan parquet default.catalog_sales (20) + : : +- ReusedExchange (23) + : +- ReusedExchange (26) + +- BroadcastExchange (48) + +- * HashAggregate (47) + +- Exchange (46) + +- * HashAggregate (45) + +- * Project (44) + +- * BroadcastHashJoin Inner BuildRight (43) + :- * Project (41) + : +- * BroadcastHashJoin Inner BuildRight (40) + : :- * Filter (38) + : : +- * ColumnarToRow (37) + : : +- Scan parquet default.web_sales (36) + : +- ReusedExchange (39) + +- ReusedExchange (42) + + +(1) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#1, ss_sold_date_sk#2] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#2), dynamicpruningexpression(ss_sold_date_sk#2 IN dynamicpruning#3)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [2]: [ss_customer_sk#1, ss_sold_date_sk#2] + +(3) Filter [codegen id : 3] +Input [2]: [ss_customer_sk#1, ss_sold_date_sk#2] +Condition : isnotnull(ss_customer_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#4, d_date#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#4, d_date#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#4, d_date#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#4)) + +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#4, d_date#5] +Input [3]: [d_date_sk#4, d_date#5, d_month_seq#6] + +(8) BroadcastExchange +Input [2]: [d_date_sk#4, d_date#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#2] +Right keys [1]: [d_date_sk#4] +Join condition: None + +(10) Project [codegen id : 3] +Output [2]: [ss_customer_sk#1, d_date#5] +Input [4]: [ss_customer_sk#1, ss_sold_date_sk#2, d_date_sk#4, d_date#5] + +(11) Scan parquet default.customer +Output [3]: [c_customer_sk#8, c_first_name#9, c_last_name#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [c_customer_sk#8, c_first_name#9, c_last_name#10] + +(13) Filter [codegen id : 2] +Input [3]: [c_customer_sk#8, c_first_name#9, c_last_name#10] +Condition : isnotnull(c_customer_sk#8) + +(14) BroadcastExchange +Input [3]: [c_customer_sk#8, c_first_name#9, c_last_name#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#8] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [c_last_name#10, c_first_name#9, d_date#5] +Input [5]: [ss_customer_sk#1, d_date#5, c_customer_sk#8, c_first_name#9, c_last_name#10] + +(17) HashAggregate [codegen id : 3] +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Keys [3]: [c_last_name#10, c_first_name#9, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#10, c_first_name#9, d_date#5] + +(18) Exchange +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Arguments: hashpartitioning(c_last_name#10, c_first_name#9, d_date#5, 5), ENSURE_REQUIREMENTS, [id=#12] + +(19) HashAggregate [codegen id : 12] +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Keys [3]: [c_last_name#10, c_first_name#9, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#10, c_first_name#9, d_date#5] + +(20) Scan parquet default.catalog_sales +Output [2]: [cs_bill_customer_sk#13, cs_sold_date_sk#14] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#14), dynamicpruningexpression(cs_sold_date_sk#14 IN dynamicpruning#3)] +PushedFilters: [IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [2]: [cs_bill_customer_sk#13, cs_sold_date_sk#14] + +(22) Filter [codegen id : 6] +Input [2]: [cs_bill_customer_sk#13, cs_sold_date_sk#14] +Condition : isnotnull(cs_bill_customer_sk#13) + +(23) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#15, d_date#16] + +(24) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#14] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(25) Project [codegen id : 6] +Output [2]: [cs_bill_customer_sk#13, d_date#16] +Input [4]: [cs_bill_customer_sk#13, cs_sold_date_sk#14, d_date_sk#15, d_date#16] + +(26) ReusedExchange [Reuses operator id: 14] +Output [3]: [c_customer_sk#17, c_first_name#18, c_last_name#19] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_bill_customer_sk#13] +Right keys [1]: [c_customer_sk#17] +Join condition: None + +(28) Project [codegen id : 6] +Output [3]: [c_last_name#19, c_first_name#18, d_date#16] +Input [5]: [cs_bill_customer_sk#13, d_date#16, c_customer_sk#17, c_first_name#18, c_last_name#19] + +(29) HashAggregate [codegen id : 6] +Input [3]: [c_last_name#19, c_first_name#18, d_date#16] +Keys [3]: [c_last_name#19, c_first_name#18, d_date#16] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#19, c_first_name#18, d_date#16] + +(30) Exchange +Input [3]: [c_last_name#19, c_first_name#18, d_date#16] +Arguments: hashpartitioning(c_last_name#19, c_first_name#18, d_date#16, 5), ENSURE_REQUIREMENTS, [id=#20] + +(31) HashAggregate [codegen id : 7] +Input [3]: [c_last_name#19, c_first_name#18, d_date#16] +Keys [3]: [c_last_name#19, c_first_name#18, d_date#16] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#19, c_first_name#18, d_date#16] + +(32) BroadcastExchange +Input [3]: [c_last_name#19, c_first_name#18, d_date#16] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, string, true], ), isnull(input[0, string, true]), coalesce(input[1, string, true], ), isnull(input[1, string, true]), coalesce(input[2, date, true], 1970-01-01), isnull(input[2, date, true])),false), [id=#21] + +(33) BroadcastHashJoin [codegen id : 12] +Left keys [6]: [coalesce(c_last_name#10, ), isnull(c_last_name#10), coalesce(c_first_name#9, ), isnull(c_first_name#9), coalesce(d_date#5, 1970-01-01), isnull(d_date#5)] +Right keys [6]: [coalesce(c_last_name#19, ), isnull(c_last_name#19), coalesce(c_first_name#18, ), isnull(c_first_name#18), coalesce(d_date#16, 1970-01-01), isnull(d_date#16)] +Join condition: None + +(34) HashAggregate [codegen id : 12] +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Keys [3]: [c_last_name#10, c_first_name#9, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#10, c_first_name#9, d_date#5] + +(35) HashAggregate [codegen id : 12] +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Keys [3]: [c_last_name#10, c_first_name#9, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#10, c_first_name#9, d_date#5] + +(36) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#22, ws_sold_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#23), dynamicpruningexpression(ws_sold_date_sk#23 IN dynamicpruning#3)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 10] +Input [2]: [ws_bill_customer_sk#22, ws_sold_date_sk#23] + +(38) Filter [codegen id : 10] +Input [2]: [ws_bill_customer_sk#22, ws_sold_date_sk#23] +Condition : isnotnull(ws_bill_customer_sk#22) + +(39) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#24, d_date#25] + +(40) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#23] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(41) Project [codegen id : 10] +Output [2]: [ws_bill_customer_sk#22, d_date#25] +Input [4]: [ws_bill_customer_sk#22, ws_sold_date_sk#23, d_date_sk#24, d_date#25] + +(42) ReusedExchange [Reuses operator id: 14] +Output [3]: [c_customer_sk#26, c_first_name#27, c_last_name#28] + +(43) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_bill_customer_sk#22] +Right keys [1]: [c_customer_sk#26] +Join condition: None + +(44) Project [codegen id : 10] +Output [3]: [c_last_name#28, c_first_name#27, d_date#25] +Input [5]: [ws_bill_customer_sk#22, d_date#25, c_customer_sk#26, c_first_name#27, c_last_name#28] + +(45) HashAggregate [codegen id : 10] +Input [3]: [c_last_name#28, c_first_name#27, d_date#25] +Keys [3]: [c_last_name#28, c_first_name#27, d_date#25] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#28, c_first_name#27, d_date#25] + +(46) Exchange +Input [3]: [c_last_name#28, c_first_name#27, d_date#25] +Arguments: hashpartitioning(c_last_name#28, c_first_name#27, d_date#25, 5), ENSURE_REQUIREMENTS, [id=#29] + +(47) HashAggregate [codegen id : 11] +Input [3]: [c_last_name#28, c_first_name#27, d_date#25] +Keys [3]: [c_last_name#28, c_first_name#27, d_date#25] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#28, c_first_name#27, d_date#25] + +(48) BroadcastExchange +Input [3]: [c_last_name#28, c_first_name#27, d_date#25] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, string, true], ), isnull(input[0, string, true]), coalesce(input[1, string, true], ), isnull(input[1, string, true]), coalesce(input[2, date, true], 1970-01-01), isnull(input[2, date, true])),false), [id=#30] + +(49) BroadcastHashJoin [codegen id : 12] +Left keys [6]: [coalesce(c_last_name#10, ), isnull(c_last_name#10), coalesce(c_first_name#9, ), isnull(c_first_name#9), coalesce(d_date#5, 1970-01-01), isnull(d_date#5)] +Right keys [6]: [coalesce(c_last_name#28, ), isnull(c_last_name#28), coalesce(c_first_name#27, ), isnull(c_first_name#27), coalesce(d_date#25, 1970-01-01), isnull(d_date#25)] +Join condition: None + +(50) HashAggregate [codegen id : 12] +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Keys [3]: [c_last_name#10, c_first_name#9, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results [3]: [c_last_name#10, c_first_name#9, d_date#5] + +(51) HashAggregate [codegen id : 12] +Input [3]: [c_last_name#10, c_first_name#9, d_date#5] +Keys [3]: [c_last_name#10, c_first_name#9, d_date#5] +Functions: [] +Aggregate Attributes: [] +Results: [] + +(52) HashAggregate [codegen id : 12] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#31] +Results [1]: [count#32] + +(53) Exchange +Input [1]: [count#32] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#33] + +(54) HashAggregate [codegen id : 13] +Input [1]: [count#32] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#34] +Results [1]: [count(1)#34 AS count(1)#35] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#2 IN dynamicpruning#3 +ReusedExchange (55) + + +(55) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#4, d_date#5] + +Subquery:2 Hosting operator id = 20 Hosting Expression = cs_sold_date_sk#14 IN dynamicpruning#3 + +Subquery:3 Hosting operator id = 36 Hosting Expression = ws_sold_date_sk#23 IN dynamicpruning#3 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87/simplified.txt new file mode 100644 index 0000000000000..ce0c20ab01d79 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q87/simplified.txt @@ -0,0 +1,84 @@ +WholeStageCodegen (13) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #1 + WholeStageCodegen (12) + HashAggregate [count,count] + HashAggregate [c_last_name,c_first_name,d_date] + HashAggregate [c_last_name,c_first_name,d_date] + BroadcastHashJoin [c_last_name,c_first_name,d_date,c_last_name,c_first_name,d_date] + HashAggregate [c_last_name,c_first_name,d_date] + HashAggregate [c_last_name,c_first_name,d_date] + BroadcastHashJoin [c_last_name,c_first_name,d_date,c_last_name,c_first_name,d_date] + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #2 + WholeStageCodegen (3) + HashAggregate [c_last_name,c_first_name,d_date] + Project [c_last_name,c_first_name,d_date] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,d_date] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk,d_date] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_month_seq] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #6 + WholeStageCodegen (6) + HashAggregate [c_last_name,c_first_name,d_date] + Project [c_last_name,c_first_name,d_date] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + Project [cs_bill_customer_sk,d_date] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_date] #3 + InputAdapter + ReusedExchange [c_customer_sk,c_first_name,c_last_name] #4 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (11) + HashAggregate [c_last_name,c_first_name,d_date] + InputAdapter + Exchange [c_last_name,c_first_name,d_date] #8 + WholeStageCodegen (10) + HashAggregate [c_last_name,c_first_name,d_date] + Project [c_last_name,c_first_name,d_date] + BroadcastHashJoin [ws_bill_customer_sk,c_customer_sk] + Project [ws_bill_customer_sk,d_date] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_date] #3 + InputAdapter + ReusedExchange [c_customer_sk,c_first_name,c_last_name] #4 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/explain.txt new file mode 100644 index 0000000000000..e72928545d080 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/explain.txt @@ -0,0 +1,1000 @@ +== Physical Plan == +* BroadcastNestedLoopJoin Inner BuildRight (182) +:- * BroadcastNestedLoopJoin Inner BuildRight (160) +: :- * BroadcastNestedLoopJoin Inner BuildRight (138) +: : :- * BroadcastNestedLoopJoin Inner BuildRight (116) +: : : :- * BroadcastNestedLoopJoin Inner BuildRight (94) +: : : : :- * BroadcastNestedLoopJoin Inner BuildRight (72) +: : : : : :- * BroadcastNestedLoopJoin Inner BuildRight (50) +: : : : : : :- * HashAggregate (28) +: : : : : : : +- Exchange (27) +: : : : : : : +- * HashAggregate (26) +: : : : : : : +- * Project (25) +: : : : : : : +- * BroadcastHashJoin Inner BuildRight (24) +: : : : : : : :- * Project (18) +: : : : : : : : +- * BroadcastHashJoin Inner BuildRight (17) +: : : : : : : : :- * Project (11) +: : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (10) +: : : : : : : : : :- * Project (4) +: : : : : : : : : : +- * Filter (3) +: : : : : : : : : : +- * ColumnarToRow (2) +: : : : : : : : : : +- Scan parquet default.store_sales (1) +: : : : : : : : : +- BroadcastExchange (9) +: : : : : : : : : +- * Project (8) +: : : : : : : : : +- * Filter (7) +: : : : : : : : : +- * ColumnarToRow (6) +: : : : : : : : : +- Scan parquet default.time_dim (5) +: : : : : : : : +- BroadcastExchange (16) +: : : : : : : : +- * Project (15) +: : : : : : : : +- * Filter (14) +: : : : : : : : +- * ColumnarToRow (13) +: : : : : : : : +- Scan parquet default.store (12) +: : : : : : : +- BroadcastExchange (23) +: : : : : : : +- * Project (22) +: : : : : : : +- * Filter (21) +: : : : : : : +- * ColumnarToRow (20) +: : : : : : : +- Scan parquet default.household_demographics (19) +: : : : : : +- BroadcastExchange (49) +: : : : : : +- * HashAggregate (48) +: : : : : : +- Exchange (47) +: : : : : : +- * HashAggregate (46) +: : : : : : +- * Project (45) +: : : : : : +- * BroadcastHashJoin Inner BuildRight (44) +: : : : : : :- * Project (42) +: : : : : : : +- * BroadcastHashJoin Inner BuildRight (41) +: : : : : : : :- * Project (39) +: : : : : : : : +- * BroadcastHashJoin Inner BuildRight (38) +: : : : : : : : :- * Project (32) +: : : : : : : : : +- * Filter (31) +: : : : : : : : : +- * ColumnarToRow (30) +: : : : : : : : : +- Scan parquet default.store_sales (29) +: : : : : : : : +- BroadcastExchange (37) +: : : : : : : : +- * Project (36) +: : : : : : : : +- * Filter (35) +: : : : : : : : +- * ColumnarToRow (34) +: : : : : : : : +- Scan parquet default.time_dim (33) +: : : : : : : +- ReusedExchange (40) +: : : : : : +- ReusedExchange (43) +: : : : : +- BroadcastExchange (71) +: : : : : +- * HashAggregate (70) +: : : : : +- Exchange (69) +: : : : : +- * HashAggregate (68) +: : : : : +- * Project (67) +: : : : : +- * BroadcastHashJoin Inner BuildRight (66) +: : : : : :- * Project (64) +: : : : : : +- * BroadcastHashJoin Inner BuildRight (63) +: : : : : : :- * Project (61) +: : : : : : : +- * BroadcastHashJoin Inner BuildRight (60) +: : : : : : : :- * Project (54) +: : : : : : : : +- * Filter (53) +: : : : : : : : +- * ColumnarToRow (52) +: : : : : : : : +- Scan parquet default.store_sales (51) +: : : : : : : +- BroadcastExchange (59) +: : : : : : : +- * Project (58) +: : : : : : : +- * Filter (57) +: : : : : : : +- * ColumnarToRow (56) +: : : : : : : +- Scan parquet default.time_dim (55) +: : : : : : +- ReusedExchange (62) +: : : : : +- ReusedExchange (65) +: : : : +- BroadcastExchange (93) +: : : : +- * HashAggregate (92) +: : : : +- Exchange (91) +: : : : +- * HashAggregate (90) +: : : : +- * Project (89) +: : : : +- * BroadcastHashJoin Inner BuildRight (88) +: : : : :- * Project (86) +: : : : : +- * BroadcastHashJoin Inner BuildRight (85) +: : : : : :- * Project (83) +: : : : : : +- * BroadcastHashJoin Inner BuildRight (82) +: : : : : : :- * Project (76) +: : : : : : : +- * Filter (75) +: : : : : : : +- * ColumnarToRow (74) +: : : : : : : +- Scan parquet default.store_sales (73) +: : : : : : +- BroadcastExchange (81) +: : : : : : +- * Project (80) +: : : : : : +- * Filter (79) +: : : : : : +- * ColumnarToRow (78) +: : : : : : +- Scan parquet default.time_dim (77) +: : : : : +- ReusedExchange (84) +: : : : +- ReusedExchange (87) +: : : +- BroadcastExchange (115) +: : : +- * HashAggregate (114) +: : : +- Exchange (113) +: : : +- * HashAggregate (112) +: : : +- * Project (111) +: : : +- * BroadcastHashJoin Inner BuildRight (110) +: : : :- * Project (108) +: : : : +- * BroadcastHashJoin Inner BuildRight (107) +: : : : :- * Project (105) +: : : : : +- * BroadcastHashJoin Inner BuildRight (104) +: : : : : :- * Project (98) +: : : : : : +- * Filter (97) +: : : : : : +- * ColumnarToRow (96) +: : : : : : +- Scan parquet default.store_sales (95) +: : : : : +- BroadcastExchange (103) +: : : : : +- * Project (102) +: : : : : +- * Filter (101) +: : : : : +- * ColumnarToRow (100) +: : : : : +- Scan parquet default.time_dim (99) +: : : : +- ReusedExchange (106) +: : : +- ReusedExchange (109) +: : +- BroadcastExchange (137) +: : +- * HashAggregate (136) +: : +- Exchange (135) +: : +- * HashAggregate (134) +: : +- * Project (133) +: : +- * BroadcastHashJoin Inner BuildRight (132) +: : :- * Project (130) +: : : +- * BroadcastHashJoin Inner BuildRight (129) +: : : :- * Project (127) +: : : : +- * BroadcastHashJoin Inner BuildRight (126) +: : : : :- * Project (120) +: : : : : +- * Filter (119) +: : : : : +- * ColumnarToRow (118) +: : : : : +- Scan parquet default.store_sales (117) +: : : : +- BroadcastExchange (125) +: : : : +- * Project (124) +: : : : +- * Filter (123) +: : : : +- * ColumnarToRow (122) +: : : : +- Scan parquet default.time_dim (121) +: : : +- ReusedExchange (128) +: : +- ReusedExchange (131) +: +- BroadcastExchange (159) +: +- * HashAggregate (158) +: +- Exchange (157) +: +- * HashAggregate (156) +: +- * Project (155) +: +- * BroadcastHashJoin Inner BuildRight (154) +: :- * Project (152) +: : +- * BroadcastHashJoin Inner BuildRight (151) +: : :- * Project (149) +: : : +- * BroadcastHashJoin Inner BuildRight (148) +: : : :- * Project (142) +: : : : +- * Filter (141) +: : : : +- * ColumnarToRow (140) +: : : : +- Scan parquet default.store_sales (139) +: : : +- BroadcastExchange (147) +: : : +- * Project (146) +: : : +- * Filter (145) +: : : +- * ColumnarToRow (144) +: : : +- Scan parquet default.time_dim (143) +: : +- ReusedExchange (150) +: +- ReusedExchange (153) ++- BroadcastExchange (181) + +- * HashAggregate (180) + +- Exchange (179) + +- * HashAggregate (178) + +- * Project (177) + +- * BroadcastHashJoin Inner BuildRight (176) + :- * Project (174) + : +- * BroadcastHashJoin Inner BuildRight (173) + : :- * Project (171) + : : +- * BroadcastHashJoin Inner BuildRight (170) + : : :- * Project (164) + : : : +- * Filter (163) + : : : +- * ColumnarToRow (162) + : : : +- Scan parquet default.store_sales (161) + : : +- BroadcastExchange (169) + : : +- * Project (168) + : : +- * Filter (167) + : : +- * ColumnarToRow (166) + : : +- Scan parquet default.time_dim (165) + : +- ReusedExchange (172) + +- ReusedExchange (175) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) + +(4) Project [codegen id : 4] +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] + +(5) Scan parquet default.time_dim +Output [3]: [t_time_sk#5, t_hour#6, t_minute#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,8), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [t_time_sk#5, t_hour#6, t_minute#7] + +(7) Filter [codegen id : 1] +Input [3]: [t_time_sk#5, t_hour#6, t_minute#7] +Condition : ((((isnotnull(t_hour#6) AND isnotnull(t_minute#7)) AND (t_hour#6 = 8)) AND (t_minute#7 >= 30)) AND isnotnull(t_time_sk#5)) + +(8) Project [codegen id : 1] +Output [1]: [t_time_sk#5] +Input [3]: [t_time_sk#5, t_hour#6, t_minute#7] + +(9) BroadcastExchange +Input [1]: [t_time_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(10) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#5] +Join condition: None + +(11) Project [codegen id : 4] +Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#5] + +(12) Scan parquet default.store +Output [2]: [s_store_sk#9, s_store_name#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_name), EqualTo(s_store_name,ese), IsNotNull(s_store_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#9, s_store_name#10] + +(14) Filter [codegen id : 2] +Input [2]: [s_store_sk#9, s_store_name#10] +Condition : ((isnotnull(s_store_name#10) AND (s_store_name#10 = ese)) AND isnotnull(s_store_sk#9)) + +(15) Project [codegen id : 2] +Output [1]: [s_store_sk#9] +Input [2]: [s_store_sk#9, s_store_name#10] + +(16) BroadcastExchange +Input [1]: [s_store_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(17) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#9] +Join condition: None + +(18) Project [codegen id : 4] +Output [1]: [ss_hdemo_sk#2] +Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#9] + +(19) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#12, hd_dep_count#13, hd_vehicle_count#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(Or(And(EqualTo(hd_dep_count,4),LessThanOrEqual(hd_vehicle_count,6)),And(EqualTo(hd_dep_count,2),LessThanOrEqual(hd_vehicle_count,4))),And(EqualTo(hd_dep_count,0),LessThanOrEqual(hd_vehicle_count,2))), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 3] +Input [3]: [hd_demo_sk#12, hd_dep_count#13, hd_vehicle_count#14] + +(21) Filter [codegen id : 3] +Input [3]: [hd_demo_sk#12, hd_dep_count#13, hd_vehicle_count#14] +Condition : (((((hd_dep_count#13 = 4) AND (hd_vehicle_count#14 <= 6)) OR ((hd_dep_count#13 = 2) AND (hd_vehicle_count#14 <= 4))) OR ((hd_dep_count#13 = 0) AND (hd_vehicle_count#14 <= 2))) AND isnotnull(hd_demo_sk#12)) + +(22) Project [codegen id : 3] +Output [1]: [hd_demo_sk#12] +Input [3]: [hd_demo_sk#12, hd_dep_count#13, hd_vehicle_count#14] + +(23) BroadcastExchange +Input [1]: [hd_demo_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(24) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#12] +Join condition: None + +(25) Project [codegen id : 4] +Output: [] +Input [2]: [ss_hdemo_sk#2, hd_demo_sk#12] + +(26) HashAggregate [codegen id : 4] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#16] +Results [1]: [count#17] + +(27) Exchange +Input [1]: [count#17] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#18] + +(28) HashAggregate [codegen id : 40] +Input [1]: [count#17] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#19] +Results [1]: [count(1)#19 AS h8_30_to_9#20] + +(29) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#21, ss_hdemo_sk#22, ss_store_sk#23, ss_sold_date_sk#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 8] +Input [4]: [ss_sold_time_sk#21, ss_hdemo_sk#22, ss_store_sk#23, ss_sold_date_sk#24] + +(31) Filter [codegen id : 8] +Input [4]: [ss_sold_time_sk#21, ss_hdemo_sk#22, ss_store_sk#23, ss_sold_date_sk#24] +Condition : ((isnotnull(ss_hdemo_sk#22) AND isnotnull(ss_sold_time_sk#21)) AND isnotnull(ss_store_sk#23)) + +(32) Project [codegen id : 8] +Output [3]: [ss_sold_time_sk#21, ss_hdemo_sk#22, ss_store_sk#23] +Input [4]: [ss_sold_time_sk#21, ss_hdemo_sk#22, ss_store_sk#23, ss_sold_date_sk#24] + +(33) Scan parquet default.time_dim +Output [3]: [t_time_sk#25, t_hour#26, t_minute#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,9), LessThan(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 5] +Input [3]: [t_time_sk#25, t_hour#26, t_minute#27] + +(35) Filter [codegen id : 5] +Input [3]: [t_time_sk#25, t_hour#26, t_minute#27] +Condition : ((((isnotnull(t_hour#26) AND isnotnull(t_minute#27)) AND (t_hour#26 = 9)) AND (t_minute#27 < 30)) AND isnotnull(t_time_sk#25)) + +(36) Project [codegen id : 5] +Output [1]: [t_time_sk#25] +Input [3]: [t_time_sk#25, t_hour#26, t_minute#27] + +(37) BroadcastExchange +Input [1]: [t_time_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#28] + +(38) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_sold_time_sk#21] +Right keys [1]: [t_time_sk#25] +Join condition: None + +(39) Project [codegen id : 8] +Output [2]: [ss_hdemo_sk#22, ss_store_sk#23] +Input [4]: [ss_sold_time_sk#21, ss_hdemo_sk#22, ss_store_sk#23, t_time_sk#25] + +(40) ReusedExchange [Reuses operator id: 16] +Output [1]: [s_store_sk#29] + +(41) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_store_sk#23] +Right keys [1]: [s_store_sk#29] +Join condition: None + +(42) Project [codegen id : 8] +Output [1]: [ss_hdemo_sk#22] +Input [3]: [ss_hdemo_sk#22, ss_store_sk#23, s_store_sk#29] + +(43) ReusedExchange [Reuses operator id: 23] +Output [1]: [hd_demo_sk#30] + +(44) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_hdemo_sk#22] +Right keys [1]: [hd_demo_sk#30] +Join condition: None + +(45) Project [codegen id : 8] +Output: [] +Input [2]: [ss_hdemo_sk#22, hd_demo_sk#30] + +(46) HashAggregate [codegen id : 8] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#31] +Results [1]: [count#32] + +(47) Exchange +Input [1]: [count#32] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#33] + +(48) HashAggregate [codegen id : 9] +Input [1]: [count#32] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#34] +Results [1]: [count(1)#34 AS h9_to_9_30#35] + +(49) BroadcastExchange +Input [1]: [h9_to_9_30#35] +Arguments: IdentityBroadcastMode, [id=#36] + +(50) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + +(51) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#37, ss_hdemo_sk#38, ss_store_sk#39, ss_sold_date_sk#40] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 13] +Input [4]: [ss_sold_time_sk#37, ss_hdemo_sk#38, ss_store_sk#39, ss_sold_date_sk#40] + +(53) Filter [codegen id : 13] +Input [4]: [ss_sold_time_sk#37, ss_hdemo_sk#38, ss_store_sk#39, ss_sold_date_sk#40] +Condition : ((isnotnull(ss_hdemo_sk#38) AND isnotnull(ss_sold_time_sk#37)) AND isnotnull(ss_store_sk#39)) + +(54) Project [codegen id : 13] +Output [3]: [ss_sold_time_sk#37, ss_hdemo_sk#38, ss_store_sk#39] +Input [4]: [ss_sold_time_sk#37, ss_hdemo_sk#38, ss_store_sk#39, ss_sold_date_sk#40] + +(55) Scan parquet default.time_dim +Output [3]: [t_time_sk#41, t_hour#42, t_minute#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,9), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(56) ColumnarToRow [codegen id : 10] +Input [3]: [t_time_sk#41, t_hour#42, t_minute#43] + +(57) Filter [codegen id : 10] +Input [3]: [t_time_sk#41, t_hour#42, t_minute#43] +Condition : ((((isnotnull(t_hour#42) AND isnotnull(t_minute#43)) AND (t_hour#42 = 9)) AND (t_minute#43 >= 30)) AND isnotnull(t_time_sk#41)) + +(58) Project [codegen id : 10] +Output [1]: [t_time_sk#41] +Input [3]: [t_time_sk#41, t_hour#42, t_minute#43] + +(59) BroadcastExchange +Input [1]: [t_time_sk#41] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] + +(60) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_sold_time_sk#37] +Right keys [1]: [t_time_sk#41] +Join condition: None + +(61) Project [codegen id : 13] +Output [2]: [ss_hdemo_sk#38, ss_store_sk#39] +Input [4]: [ss_sold_time_sk#37, ss_hdemo_sk#38, ss_store_sk#39, t_time_sk#41] + +(62) ReusedExchange [Reuses operator id: 16] +Output [1]: [s_store_sk#45] + +(63) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_store_sk#39] +Right keys [1]: [s_store_sk#45] +Join condition: None + +(64) Project [codegen id : 13] +Output [1]: [ss_hdemo_sk#38] +Input [3]: [ss_hdemo_sk#38, ss_store_sk#39, s_store_sk#45] + +(65) ReusedExchange [Reuses operator id: 23] +Output [1]: [hd_demo_sk#46] + +(66) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_hdemo_sk#38] +Right keys [1]: [hd_demo_sk#46] +Join condition: None + +(67) Project [codegen id : 13] +Output: [] +Input [2]: [ss_hdemo_sk#38, hd_demo_sk#46] + +(68) HashAggregate [codegen id : 13] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#47] +Results [1]: [count#48] + +(69) Exchange +Input [1]: [count#48] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#49] + +(70) HashAggregate [codegen id : 14] +Input [1]: [count#48] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#50] +Results [1]: [count(1)#50 AS h9_30_to_10#51] + +(71) BroadcastExchange +Input [1]: [h9_30_to_10#51] +Arguments: IdentityBroadcastMode, [id=#52] + +(72) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + +(73) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#53, ss_hdemo_sk#54, ss_store_sk#55, ss_sold_date_sk#56] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(74) ColumnarToRow [codegen id : 18] +Input [4]: [ss_sold_time_sk#53, ss_hdemo_sk#54, ss_store_sk#55, ss_sold_date_sk#56] + +(75) Filter [codegen id : 18] +Input [4]: [ss_sold_time_sk#53, ss_hdemo_sk#54, ss_store_sk#55, ss_sold_date_sk#56] +Condition : ((isnotnull(ss_hdemo_sk#54) AND isnotnull(ss_sold_time_sk#53)) AND isnotnull(ss_store_sk#55)) + +(76) Project [codegen id : 18] +Output [3]: [ss_sold_time_sk#53, ss_hdemo_sk#54, ss_store_sk#55] +Input [4]: [ss_sold_time_sk#53, ss_hdemo_sk#54, ss_store_sk#55, ss_sold_date_sk#56] + +(77) Scan parquet default.time_dim +Output [3]: [t_time_sk#57, t_hour#58, t_minute#59] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,10), LessThan(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(78) ColumnarToRow [codegen id : 15] +Input [3]: [t_time_sk#57, t_hour#58, t_minute#59] + +(79) Filter [codegen id : 15] +Input [3]: [t_time_sk#57, t_hour#58, t_minute#59] +Condition : ((((isnotnull(t_hour#58) AND isnotnull(t_minute#59)) AND (t_hour#58 = 10)) AND (t_minute#59 < 30)) AND isnotnull(t_time_sk#57)) + +(80) Project [codegen id : 15] +Output [1]: [t_time_sk#57] +Input [3]: [t_time_sk#57, t_hour#58, t_minute#59] + +(81) BroadcastExchange +Input [1]: [t_time_sk#57] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#60] + +(82) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [ss_sold_time_sk#53] +Right keys [1]: [t_time_sk#57] +Join condition: None + +(83) Project [codegen id : 18] +Output [2]: [ss_hdemo_sk#54, ss_store_sk#55] +Input [4]: [ss_sold_time_sk#53, ss_hdemo_sk#54, ss_store_sk#55, t_time_sk#57] + +(84) ReusedExchange [Reuses operator id: 16] +Output [1]: [s_store_sk#61] + +(85) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [ss_store_sk#55] +Right keys [1]: [s_store_sk#61] +Join condition: None + +(86) Project [codegen id : 18] +Output [1]: [ss_hdemo_sk#54] +Input [3]: [ss_hdemo_sk#54, ss_store_sk#55, s_store_sk#61] + +(87) ReusedExchange [Reuses operator id: 23] +Output [1]: [hd_demo_sk#62] + +(88) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [ss_hdemo_sk#54] +Right keys [1]: [hd_demo_sk#62] +Join condition: None + +(89) Project [codegen id : 18] +Output: [] +Input [2]: [ss_hdemo_sk#54, hd_demo_sk#62] + +(90) HashAggregate [codegen id : 18] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#63] +Results [1]: [count#64] + +(91) Exchange +Input [1]: [count#64] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#65] + +(92) HashAggregate [codegen id : 19] +Input [1]: [count#64] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#66] +Results [1]: [count(1)#66 AS h10_to_10_30#67] + +(93) BroadcastExchange +Input [1]: [h10_to_10_30#67] +Arguments: IdentityBroadcastMode, [id=#68] + +(94) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + +(95) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#69, ss_hdemo_sk#70, ss_store_sk#71, ss_sold_date_sk#72] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(96) ColumnarToRow [codegen id : 23] +Input [4]: [ss_sold_time_sk#69, ss_hdemo_sk#70, ss_store_sk#71, ss_sold_date_sk#72] + +(97) Filter [codegen id : 23] +Input [4]: [ss_sold_time_sk#69, ss_hdemo_sk#70, ss_store_sk#71, ss_sold_date_sk#72] +Condition : ((isnotnull(ss_hdemo_sk#70) AND isnotnull(ss_sold_time_sk#69)) AND isnotnull(ss_store_sk#71)) + +(98) Project [codegen id : 23] +Output [3]: [ss_sold_time_sk#69, ss_hdemo_sk#70, ss_store_sk#71] +Input [4]: [ss_sold_time_sk#69, ss_hdemo_sk#70, ss_store_sk#71, ss_sold_date_sk#72] + +(99) Scan parquet default.time_dim +Output [3]: [t_time_sk#73, t_hour#74, t_minute#75] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,10), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(100) ColumnarToRow [codegen id : 20] +Input [3]: [t_time_sk#73, t_hour#74, t_minute#75] + +(101) Filter [codegen id : 20] +Input [3]: [t_time_sk#73, t_hour#74, t_minute#75] +Condition : ((((isnotnull(t_hour#74) AND isnotnull(t_minute#75)) AND (t_hour#74 = 10)) AND (t_minute#75 >= 30)) AND isnotnull(t_time_sk#73)) + +(102) Project [codegen id : 20] +Output [1]: [t_time_sk#73] +Input [3]: [t_time_sk#73, t_hour#74, t_minute#75] + +(103) BroadcastExchange +Input [1]: [t_time_sk#73] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#76] + +(104) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [ss_sold_time_sk#69] +Right keys [1]: [t_time_sk#73] +Join condition: None + +(105) Project [codegen id : 23] +Output [2]: [ss_hdemo_sk#70, ss_store_sk#71] +Input [4]: [ss_sold_time_sk#69, ss_hdemo_sk#70, ss_store_sk#71, t_time_sk#73] + +(106) ReusedExchange [Reuses operator id: 16] +Output [1]: [s_store_sk#77] + +(107) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [ss_store_sk#71] +Right keys [1]: [s_store_sk#77] +Join condition: None + +(108) Project [codegen id : 23] +Output [1]: [ss_hdemo_sk#70] +Input [3]: [ss_hdemo_sk#70, ss_store_sk#71, s_store_sk#77] + +(109) ReusedExchange [Reuses operator id: 23] +Output [1]: [hd_demo_sk#78] + +(110) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [ss_hdemo_sk#70] +Right keys [1]: [hd_demo_sk#78] +Join condition: None + +(111) Project [codegen id : 23] +Output: [] +Input [2]: [ss_hdemo_sk#70, hd_demo_sk#78] + +(112) HashAggregate [codegen id : 23] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#79] +Results [1]: [count#80] + +(113) Exchange +Input [1]: [count#80] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#81] + +(114) HashAggregate [codegen id : 24] +Input [1]: [count#80] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#82] +Results [1]: [count(1)#82 AS h10_30_to_11#83] + +(115) BroadcastExchange +Input [1]: [h10_30_to_11#83] +Arguments: IdentityBroadcastMode, [id=#84] + +(116) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + +(117) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#85, ss_hdemo_sk#86, ss_store_sk#87, ss_sold_date_sk#88] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(118) ColumnarToRow [codegen id : 28] +Input [4]: [ss_sold_time_sk#85, ss_hdemo_sk#86, ss_store_sk#87, ss_sold_date_sk#88] + +(119) Filter [codegen id : 28] +Input [4]: [ss_sold_time_sk#85, ss_hdemo_sk#86, ss_store_sk#87, ss_sold_date_sk#88] +Condition : ((isnotnull(ss_hdemo_sk#86) AND isnotnull(ss_sold_time_sk#85)) AND isnotnull(ss_store_sk#87)) + +(120) Project [codegen id : 28] +Output [3]: [ss_sold_time_sk#85, ss_hdemo_sk#86, ss_store_sk#87] +Input [4]: [ss_sold_time_sk#85, ss_hdemo_sk#86, ss_store_sk#87, ss_sold_date_sk#88] + +(121) Scan parquet default.time_dim +Output [3]: [t_time_sk#89, t_hour#90, t_minute#91] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,11), LessThan(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(122) ColumnarToRow [codegen id : 25] +Input [3]: [t_time_sk#89, t_hour#90, t_minute#91] + +(123) Filter [codegen id : 25] +Input [3]: [t_time_sk#89, t_hour#90, t_minute#91] +Condition : ((((isnotnull(t_hour#90) AND isnotnull(t_minute#91)) AND (t_hour#90 = 11)) AND (t_minute#91 < 30)) AND isnotnull(t_time_sk#89)) + +(124) Project [codegen id : 25] +Output [1]: [t_time_sk#89] +Input [3]: [t_time_sk#89, t_hour#90, t_minute#91] + +(125) BroadcastExchange +Input [1]: [t_time_sk#89] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#92] + +(126) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ss_sold_time_sk#85] +Right keys [1]: [t_time_sk#89] +Join condition: None + +(127) Project [codegen id : 28] +Output [2]: [ss_hdemo_sk#86, ss_store_sk#87] +Input [4]: [ss_sold_time_sk#85, ss_hdemo_sk#86, ss_store_sk#87, t_time_sk#89] + +(128) ReusedExchange [Reuses operator id: 16] +Output [1]: [s_store_sk#93] + +(129) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ss_store_sk#87] +Right keys [1]: [s_store_sk#93] +Join condition: None + +(130) Project [codegen id : 28] +Output [1]: [ss_hdemo_sk#86] +Input [3]: [ss_hdemo_sk#86, ss_store_sk#87, s_store_sk#93] + +(131) ReusedExchange [Reuses operator id: 23] +Output [1]: [hd_demo_sk#94] + +(132) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ss_hdemo_sk#86] +Right keys [1]: [hd_demo_sk#94] +Join condition: None + +(133) Project [codegen id : 28] +Output: [] +Input [2]: [ss_hdemo_sk#86, hd_demo_sk#94] + +(134) HashAggregate [codegen id : 28] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#95] +Results [1]: [count#96] + +(135) Exchange +Input [1]: [count#96] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#97] + +(136) HashAggregate [codegen id : 29] +Input [1]: [count#96] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#98] +Results [1]: [count(1)#98 AS h11_to_11_30#99] + +(137) BroadcastExchange +Input [1]: [h11_to_11_30#99] +Arguments: IdentityBroadcastMode, [id=#100] + +(138) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + +(139) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#101, ss_hdemo_sk#102, ss_store_sk#103, ss_sold_date_sk#104] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(140) ColumnarToRow [codegen id : 33] +Input [4]: [ss_sold_time_sk#101, ss_hdemo_sk#102, ss_store_sk#103, ss_sold_date_sk#104] + +(141) Filter [codegen id : 33] +Input [4]: [ss_sold_time_sk#101, ss_hdemo_sk#102, ss_store_sk#103, ss_sold_date_sk#104] +Condition : ((isnotnull(ss_hdemo_sk#102) AND isnotnull(ss_sold_time_sk#101)) AND isnotnull(ss_store_sk#103)) + +(142) Project [codegen id : 33] +Output [3]: [ss_sold_time_sk#101, ss_hdemo_sk#102, ss_store_sk#103] +Input [4]: [ss_sold_time_sk#101, ss_hdemo_sk#102, ss_store_sk#103, ss_sold_date_sk#104] + +(143) Scan parquet default.time_dim +Output [3]: [t_time_sk#105, t_hour#106, t_minute#107] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,11), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(144) ColumnarToRow [codegen id : 30] +Input [3]: [t_time_sk#105, t_hour#106, t_minute#107] + +(145) Filter [codegen id : 30] +Input [3]: [t_time_sk#105, t_hour#106, t_minute#107] +Condition : ((((isnotnull(t_hour#106) AND isnotnull(t_minute#107)) AND (t_hour#106 = 11)) AND (t_minute#107 >= 30)) AND isnotnull(t_time_sk#105)) + +(146) Project [codegen id : 30] +Output [1]: [t_time_sk#105] +Input [3]: [t_time_sk#105, t_hour#106, t_minute#107] + +(147) BroadcastExchange +Input [1]: [t_time_sk#105] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#108] + +(148) BroadcastHashJoin [codegen id : 33] +Left keys [1]: [ss_sold_time_sk#101] +Right keys [1]: [t_time_sk#105] +Join condition: None + +(149) Project [codegen id : 33] +Output [2]: [ss_hdemo_sk#102, ss_store_sk#103] +Input [4]: [ss_sold_time_sk#101, ss_hdemo_sk#102, ss_store_sk#103, t_time_sk#105] + +(150) ReusedExchange [Reuses operator id: 16] +Output [1]: [s_store_sk#109] + +(151) BroadcastHashJoin [codegen id : 33] +Left keys [1]: [ss_store_sk#103] +Right keys [1]: [s_store_sk#109] +Join condition: None + +(152) Project [codegen id : 33] +Output [1]: [ss_hdemo_sk#102] +Input [3]: [ss_hdemo_sk#102, ss_store_sk#103, s_store_sk#109] + +(153) ReusedExchange [Reuses operator id: 23] +Output [1]: [hd_demo_sk#110] + +(154) BroadcastHashJoin [codegen id : 33] +Left keys [1]: [ss_hdemo_sk#102] +Right keys [1]: [hd_demo_sk#110] +Join condition: None + +(155) Project [codegen id : 33] +Output: [] +Input [2]: [ss_hdemo_sk#102, hd_demo_sk#110] + +(156) HashAggregate [codegen id : 33] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#111] +Results [1]: [count#112] + +(157) Exchange +Input [1]: [count#112] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#113] + +(158) HashAggregate [codegen id : 34] +Input [1]: [count#112] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#114] +Results [1]: [count(1)#114 AS h11_30_to_12#115] + +(159) BroadcastExchange +Input [1]: [h11_30_to_12#115] +Arguments: IdentityBroadcastMode, [id=#116] + +(160) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + +(161) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#117, ss_hdemo_sk#118, ss_store_sk#119, ss_sold_date_sk#120] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(162) ColumnarToRow [codegen id : 38] +Input [4]: [ss_sold_time_sk#117, ss_hdemo_sk#118, ss_store_sk#119, ss_sold_date_sk#120] + +(163) Filter [codegen id : 38] +Input [4]: [ss_sold_time_sk#117, ss_hdemo_sk#118, ss_store_sk#119, ss_sold_date_sk#120] +Condition : ((isnotnull(ss_hdemo_sk#118) AND isnotnull(ss_sold_time_sk#117)) AND isnotnull(ss_store_sk#119)) + +(164) Project [codegen id : 38] +Output [3]: [ss_sold_time_sk#117, ss_hdemo_sk#118, ss_store_sk#119] +Input [4]: [ss_sold_time_sk#117, ss_hdemo_sk#118, ss_store_sk#119, ss_sold_date_sk#120] + +(165) Scan parquet default.time_dim +Output [3]: [t_time_sk#121, t_hour#122, t_minute#123] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,12), LessThan(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(166) ColumnarToRow [codegen id : 35] +Input [3]: [t_time_sk#121, t_hour#122, t_minute#123] + +(167) Filter [codegen id : 35] +Input [3]: [t_time_sk#121, t_hour#122, t_minute#123] +Condition : ((((isnotnull(t_hour#122) AND isnotnull(t_minute#123)) AND (t_hour#122 = 12)) AND (t_minute#123 < 30)) AND isnotnull(t_time_sk#121)) + +(168) Project [codegen id : 35] +Output [1]: [t_time_sk#121] +Input [3]: [t_time_sk#121, t_hour#122, t_minute#123] + +(169) BroadcastExchange +Input [1]: [t_time_sk#121] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#124] + +(170) BroadcastHashJoin [codegen id : 38] +Left keys [1]: [ss_sold_time_sk#117] +Right keys [1]: [t_time_sk#121] +Join condition: None + +(171) Project [codegen id : 38] +Output [2]: [ss_hdemo_sk#118, ss_store_sk#119] +Input [4]: [ss_sold_time_sk#117, ss_hdemo_sk#118, ss_store_sk#119, t_time_sk#121] + +(172) ReusedExchange [Reuses operator id: 16] +Output [1]: [s_store_sk#125] + +(173) BroadcastHashJoin [codegen id : 38] +Left keys [1]: [ss_store_sk#119] +Right keys [1]: [s_store_sk#125] +Join condition: None + +(174) Project [codegen id : 38] +Output [1]: [ss_hdemo_sk#118] +Input [3]: [ss_hdemo_sk#118, ss_store_sk#119, s_store_sk#125] + +(175) ReusedExchange [Reuses operator id: 23] +Output [1]: [hd_demo_sk#126] + +(176) BroadcastHashJoin [codegen id : 38] +Left keys [1]: [ss_hdemo_sk#118] +Right keys [1]: [hd_demo_sk#126] +Join condition: None + +(177) Project [codegen id : 38] +Output: [] +Input [2]: [ss_hdemo_sk#118, hd_demo_sk#126] + +(178) HashAggregate [codegen id : 38] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#127] +Results [1]: [count#128] + +(179) Exchange +Input [1]: [count#128] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#129] + +(180) HashAggregate [codegen id : 39] +Input [1]: [count#128] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#130] +Results [1]: [count(1)#130 AS h12_to_12_30#131] + +(181) BroadcastExchange +Input [1]: [h12_to_12_30#131] +Arguments: IdentityBroadcastMode, [id=#132] + +(182) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/simplified.txt new file mode 100644 index 0000000000000..41fef687d30be --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88.sf100/simplified.txt @@ -0,0 +1,265 @@ +WholeStageCodegen (40) + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + HashAggregate [count] [count(1),h8_30_to_9,count] + InputAdapter + Exchange #1 + WholeStageCodegen (4) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_hdemo_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_store_name,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + HashAggregate [count] [count(1),h9_to_9_30,count] + InputAdapter + Exchange #6 + WholeStageCodegen (8) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_hdemo_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (5) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #3 + InputAdapter + ReusedExchange [hd_demo_sk] #4 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (14) + HashAggregate [count] [count(1),h9_30_to_10,count] + InputAdapter + Exchange #9 + WholeStageCodegen (13) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_hdemo_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (10) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #3 + InputAdapter + ReusedExchange [hd_demo_sk] #4 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (19) + HashAggregate [count] [count(1),h10_to_10_30,count] + InputAdapter + Exchange #12 + WholeStageCodegen (18) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_hdemo_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (15) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #3 + InputAdapter + ReusedExchange [hd_demo_sk] #4 + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (24) + HashAggregate [count] [count(1),h10_30_to_11,count] + InputAdapter + Exchange #15 + WholeStageCodegen (23) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_hdemo_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (20) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #3 + InputAdapter + ReusedExchange [hd_demo_sk] #4 + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (29) + HashAggregate [count] [count(1),h11_to_11_30,count] + InputAdapter + Exchange #18 + WholeStageCodegen (28) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_hdemo_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #19 + WholeStageCodegen (25) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #3 + InputAdapter + ReusedExchange [hd_demo_sk] #4 + InputAdapter + BroadcastExchange #20 + WholeStageCodegen (34) + HashAggregate [count] [count(1),h11_30_to_12,count] + InputAdapter + Exchange #21 + WholeStageCodegen (33) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_hdemo_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #22 + WholeStageCodegen (30) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #3 + InputAdapter + ReusedExchange [hd_demo_sk] #4 + InputAdapter + BroadcastExchange #23 + WholeStageCodegen (39) + HashAggregate [count] [count(1),h12_to_12_30,count] + InputAdapter + Exchange #24 + WholeStageCodegen (38) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_hdemo_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #25 + WholeStageCodegen (35) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #3 + InputAdapter + ReusedExchange [hd_demo_sk] #4 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88/explain.txt new file mode 100644 index 0000000000000..9f56c71154a66 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88/explain.txt @@ -0,0 +1,1000 @@ +== Physical Plan == +* BroadcastNestedLoopJoin Inner BuildRight (182) +:- * BroadcastNestedLoopJoin Inner BuildRight (160) +: :- * BroadcastNestedLoopJoin Inner BuildRight (138) +: : :- * BroadcastNestedLoopJoin Inner BuildRight (116) +: : : :- * BroadcastNestedLoopJoin Inner BuildRight (94) +: : : : :- * BroadcastNestedLoopJoin Inner BuildRight (72) +: : : : : :- * BroadcastNestedLoopJoin Inner BuildRight (50) +: : : : : : :- * HashAggregate (28) +: : : : : : : +- Exchange (27) +: : : : : : : +- * HashAggregate (26) +: : : : : : : +- * Project (25) +: : : : : : : +- * BroadcastHashJoin Inner BuildRight (24) +: : : : : : : :- * Project (18) +: : : : : : : : +- * BroadcastHashJoin Inner BuildRight (17) +: : : : : : : : :- * Project (11) +: : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (10) +: : : : : : : : : :- * Project (4) +: : : : : : : : : : +- * Filter (3) +: : : : : : : : : : +- * ColumnarToRow (2) +: : : : : : : : : : +- Scan parquet default.store_sales (1) +: : : : : : : : : +- BroadcastExchange (9) +: : : : : : : : : +- * Project (8) +: : : : : : : : : +- * Filter (7) +: : : : : : : : : +- * ColumnarToRow (6) +: : : : : : : : : +- Scan parquet default.household_demographics (5) +: : : : : : : : +- BroadcastExchange (16) +: : : : : : : : +- * Project (15) +: : : : : : : : +- * Filter (14) +: : : : : : : : +- * ColumnarToRow (13) +: : : : : : : : +- Scan parquet default.time_dim (12) +: : : : : : : +- BroadcastExchange (23) +: : : : : : : +- * Project (22) +: : : : : : : +- * Filter (21) +: : : : : : : +- * ColumnarToRow (20) +: : : : : : : +- Scan parquet default.store (19) +: : : : : : +- BroadcastExchange (49) +: : : : : : +- * HashAggregate (48) +: : : : : : +- Exchange (47) +: : : : : : +- * HashAggregate (46) +: : : : : : +- * Project (45) +: : : : : : +- * BroadcastHashJoin Inner BuildRight (44) +: : : : : : :- * Project (42) +: : : : : : : +- * BroadcastHashJoin Inner BuildRight (41) +: : : : : : : :- * Project (35) +: : : : : : : : +- * BroadcastHashJoin Inner BuildRight (34) +: : : : : : : : :- * Project (32) +: : : : : : : : : +- * Filter (31) +: : : : : : : : : +- * ColumnarToRow (30) +: : : : : : : : : +- Scan parquet default.store_sales (29) +: : : : : : : : +- ReusedExchange (33) +: : : : : : : +- BroadcastExchange (40) +: : : : : : : +- * Project (39) +: : : : : : : +- * Filter (38) +: : : : : : : +- * ColumnarToRow (37) +: : : : : : : +- Scan parquet default.time_dim (36) +: : : : : : +- ReusedExchange (43) +: : : : : +- BroadcastExchange (71) +: : : : : +- * HashAggregate (70) +: : : : : +- Exchange (69) +: : : : : +- * HashAggregate (68) +: : : : : +- * Project (67) +: : : : : +- * BroadcastHashJoin Inner BuildRight (66) +: : : : : :- * Project (64) +: : : : : : +- * BroadcastHashJoin Inner BuildRight (63) +: : : : : : :- * Project (57) +: : : : : : : +- * BroadcastHashJoin Inner BuildRight (56) +: : : : : : : :- * Project (54) +: : : : : : : : +- * Filter (53) +: : : : : : : : +- * ColumnarToRow (52) +: : : : : : : : +- Scan parquet default.store_sales (51) +: : : : : : : +- ReusedExchange (55) +: : : : : : +- BroadcastExchange (62) +: : : : : : +- * Project (61) +: : : : : : +- * Filter (60) +: : : : : : +- * ColumnarToRow (59) +: : : : : : +- Scan parquet default.time_dim (58) +: : : : : +- ReusedExchange (65) +: : : : +- BroadcastExchange (93) +: : : : +- * HashAggregate (92) +: : : : +- Exchange (91) +: : : : +- * HashAggregate (90) +: : : : +- * Project (89) +: : : : +- * BroadcastHashJoin Inner BuildRight (88) +: : : : :- * Project (86) +: : : : : +- * BroadcastHashJoin Inner BuildRight (85) +: : : : : :- * Project (79) +: : : : : : +- * BroadcastHashJoin Inner BuildRight (78) +: : : : : : :- * Project (76) +: : : : : : : +- * Filter (75) +: : : : : : : +- * ColumnarToRow (74) +: : : : : : : +- Scan parquet default.store_sales (73) +: : : : : : +- ReusedExchange (77) +: : : : : +- BroadcastExchange (84) +: : : : : +- * Project (83) +: : : : : +- * Filter (82) +: : : : : +- * ColumnarToRow (81) +: : : : : +- Scan parquet default.time_dim (80) +: : : : +- ReusedExchange (87) +: : : +- BroadcastExchange (115) +: : : +- * HashAggregate (114) +: : : +- Exchange (113) +: : : +- * HashAggregate (112) +: : : +- * Project (111) +: : : +- * BroadcastHashJoin Inner BuildRight (110) +: : : :- * Project (108) +: : : : +- * BroadcastHashJoin Inner BuildRight (107) +: : : : :- * Project (101) +: : : : : +- * BroadcastHashJoin Inner BuildRight (100) +: : : : : :- * Project (98) +: : : : : : +- * Filter (97) +: : : : : : +- * ColumnarToRow (96) +: : : : : : +- Scan parquet default.store_sales (95) +: : : : : +- ReusedExchange (99) +: : : : +- BroadcastExchange (106) +: : : : +- * Project (105) +: : : : +- * Filter (104) +: : : : +- * ColumnarToRow (103) +: : : : +- Scan parquet default.time_dim (102) +: : : +- ReusedExchange (109) +: : +- BroadcastExchange (137) +: : +- * HashAggregate (136) +: : +- Exchange (135) +: : +- * HashAggregate (134) +: : +- * Project (133) +: : +- * BroadcastHashJoin Inner BuildRight (132) +: : :- * Project (130) +: : : +- * BroadcastHashJoin Inner BuildRight (129) +: : : :- * Project (123) +: : : : +- * BroadcastHashJoin Inner BuildRight (122) +: : : : :- * Project (120) +: : : : : +- * Filter (119) +: : : : : +- * ColumnarToRow (118) +: : : : : +- Scan parquet default.store_sales (117) +: : : : +- ReusedExchange (121) +: : : +- BroadcastExchange (128) +: : : +- * Project (127) +: : : +- * Filter (126) +: : : +- * ColumnarToRow (125) +: : : +- Scan parquet default.time_dim (124) +: : +- ReusedExchange (131) +: +- BroadcastExchange (159) +: +- * HashAggregate (158) +: +- Exchange (157) +: +- * HashAggregate (156) +: +- * Project (155) +: +- * BroadcastHashJoin Inner BuildRight (154) +: :- * Project (152) +: : +- * BroadcastHashJoin Inner BuildRight (151) +: : :- * Project (145) +: : : +- * BroadcastHashJoin Inner BuildRight (144) +: : : :- * Project (142) +: : : : +- * Filter (141) +: : : : +- * ColumnarToRow (140) +: : : : +- Scan parquet default.store_sales (139) +: : : +- ReusedExchange (143) +: : +- BroadcastExchange (150) +: : +- * Project (149) +: : +- * Filter (148) +: : +- * ColumnarToRow (147) +: : +- Scan parquet default.time_dim (146) +: +- ReusedExchange (153) ++- BroadcastExchange (181) + +- * HashAggregate (180) + +- Exchange (179) + +- * HashAggregate (178) + +- * Project (177) + +- * BroadcastHashJoin Inner BuildRight (176) + :- * Project (174) + : +- * BroadcastHashJoin Inner BuildRight (173) + : :- * Project (167) + : : +- * BroadcastHashJoin Inner BuildRight (166) + : : :- * Project (164) + : : : +- * Filter (163) + : : : +- * ColumnarToRow (162) + : : : +- Scan parquet default.store_sales (161) + : : +- ReusedExchange (165) + : +- BroadcastExchange (172) + : +- * Project (171) + : +- * Filter (170) + : +- * ColumnarToRow (169) + : +- Scan parquet default.time_dim (168) + +- ReusedExchange (175) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) + +(4) Project [codegen id : 4] +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] + +(5) Scan parquet default.household_demographics +Output [3]: [hd_demo_sk#5, hd_dep_count#6, hd_vehicle_count#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [Or(Or(And(EqualTo(hd_dep_count,4),LessThanOrEqual(hd_vehicle_count,6)),And(EqualTo(hd_dep_count,2),LessThanOrEqual(hd_vehicle_count,4))),And(EqualTo(hd_dep_count,0),LessThanOrEqual(hd_vehicle_count,2))), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [hd_demo_sk#5, hd_dep_count#6, hd_vehicle_count#7] + +(7) Filter [codegen id : 1] +Input [3]: [hd_demo_sk#5, hd_dep_count#6, hd_vehicle_count#7] +Condition : (((((hd_dep_count#6 = 4) AND (hd_vehicle_count#7 <= 6)) OR ((hd_dep_count#6 = 2) AND (hd_vehicle_count#7 <= 4))) OR ((hd_dep_count#6 = 0) AND (hd_vehicle_count#7 <= 2))) AND isnotnull(hd_demo_sk#5)) + +(8) Project [codegen id : 1] +Output [1]: [hd_demo_sk#5] +Input [3]: [hd_demo_sk#5, hd_dep_count#6, hd_vehicle_count#7] + +(9) BroadcastExchange +Input [1]: [hd_demo_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(10) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#5] +Join condition: None + +(11) Project [codegen id : 4] +Output [2]: [ss_sold_time_sk#1, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, hd_demo_sk#5] + +(12) Scan parquet default.time_dim +Output [3]: [t_time_sk#9, t_hour#10, t_minute#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,8), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 2] +Input [3]: [t_time_sk#9, t_hour#10, t_minute#11] + +(14) Filter [codegen id : 2] +Input [3]: [t_time_sk#9, t_hour#10, t_minute#11] +Condition : ((((isnotnull(t_hour#10) AND isnotnull(t_minute#11)) AND (t_hour#10 = 8)) AND (t_minute#11 >= 30)) AND isnotnull(t_time_sk#9)) + +(15) Project [codegen id : 2] +Output [1]: [t_time_sk#9] +Input [3]: [t_time_sk#9, t_hour#10, t_minute#11] + +(16) BroadcastExchange +Input [1]: [t_time_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(17) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#9] +Join condition: None + +(18) Project [codegen id : 4] +Output [1]: [ss_store_sk#3] +Input [3]: [ss_sold_time_sk#1, ss_store_sk#3, t_time_sk#9] + +(19) Scan parquet default.store +Output [2]: [s_store_sk#13, s_store_name#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_name), EqualTo(s_store_name,ese), IsNotNull(s_store_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#13, s_store_name#14] + +(21) Filter [codegen id : 3] +Input [2]: [s_store_sk#13, s_store_name#14] +Condition : ((isnotnull(s_store_name#14) AND (s_store_name#14 = ese)) AND isnotnull(s_store_sk#13)) + +(22) Project [codegen id : 3] +Output [1]: [s_store_sk#13] +Input [2]: [s_store_sk#13, s_store_name#14] + +(23) BroadcastExchange +Input [1]: [s_store_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(24) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#13] +Join condition: None + +(25) Project [codegen id : 4] +Output: [] +Input [2]: [ss_store_sk#3, s_store_sk#13] + +(26) HashAggregate [codegen id : 4] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#16] +Results [1]: [count#17] + +(27) Exchange +Input [1]: [count#17] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#18] + +(28) HashAggregate [codegen id : 40] +Input [1]: [count#17] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#19] +Results [1]: [count(1)#19 AS h8_30_to_9#20] + +(29) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#21, ss_hdemo_sk#22, ss_store_sk#23, ss_sold_date_sk#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 8] +Input [4]: [ss_sold_time_sk#21, ss_hdemo_sk#22, ss_store_sk#23, ss_sold_date_sk#24] + +(31) Filter [codegen id : 8] +Input [4]: [ss_sold_time_sk#21, ss_hdemo_sk#22, ss_store_sk#23, ss_sold_date_sk#24] +Condition : ((isnotnull(ss_hdemo_sk#22) AND isnotnull(ss_sold_time_sk#21)) AND isnotnull(ss_store_sk#23)) + +(32) Project [codegen id : 8] +Output [3]: [ss_sold_time_sk#21, ss_hdemo_sk#22, ss_store_sk#23] +Input [4]: [ss_sold_time_sk#21, ss_hdemo_sk#22, ss_store_sk#23, ss_sold_date_sk#24] + +(33) ReusedExchange [Reuses operator id: 9] +Output [1]: [hd_demo_sk#25] + +(34) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_hdemo_sk#22] +Right keys [1]: [hd_demo_sk#25] +Join condition: None + +(35) Project [codegen id : 8] +Output [2]: [ss_sold_time_sk#21, ss_store_sk#23] +Input [4]: [ss_sold_time_sk#21, ss_hdemo_sk#22, ss_store_sk#23, hd_demo_sk#25] + +(36) Scan parquet default.time_dim +Output [3]: [t_time_sk#26, t_hour#27, t_minute#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,9), LessThan(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 6] +Input [3]: [t_time_sk#26, t_hour#27, t_minute#28] + +(38) Filter [codegen id : 6] +Input [3]: [t_time_sk#26, t_hour#27, t_minute#28] +Condition : ((((isnotnull(t_hour#27) AND isnotnull(t_minute#28)) AND (t_hour#27 = 9)) AND (t_minute#28 < 30)) AND isnotnull(t_time_sk#26)) + +(39) Project [codegen id : 6] +Output [1]: [t_time_sk#26] +Input [3]: [t_time_sk#26, t_hour#27, t_minute#28] + +(40) BroadcastExchange +Input [1]: [t_time_sk#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] + +(41) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_sold_time_sk#21] +Right keys [1]: [t_time_sk#26] +Join condition: None + +(42) Project [codegen id : 8] +Output [1]: [ss_store_sk#23] +Input [3]: [ss_sold_time_sk#21, ss_store_sk#23, t_time_sk#26] + +(43) ReusedExchange [Reuses operator id: 23] +Output [1]: [s_store_sk#30] + +(44) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ss_store_sk#23] +Right keys [1]: [s_store_sk#30] +Join condition: None + +(45) Project [codegen id : 8] +Output: [] +Input [2]: [ss_store_sk#23, s_store_sk#30] + +(46) HashAggregate [codegen id : 8] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#31] +Results [1]: [count#32] + +(47) Exchange +Input [1]: [count#32] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#33] + +(48) HashAggregate [codegen id : 9] +Input [1]: [count#32] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#34] +Results [1]: [count(1)#34 AS h9_to_9_30#35] + +(49) BroadcastExchange +Input [1]: [h9_to_9_30#35] +Arguments: IdentityBroadcastMode, [id=#36] + +(50) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + +(51) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#37, ss_hdemo_sk#38, ss_store_sk#39, ss_sold_date_sk#40] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 13] +Input [4]: [ss_sold_time_sk#37, ss_hdemo_sk#38, ss_store_sk#39, ss_sold_date_sk#40] + +(53) Filter [codegen id : 13] +Input [4]: [ss_sold_time_sk#37, ss_hdemo_sk#38, ss_store_sk#39, ss_sold_date_sk#40] +Condition : ((isnotnull(ss_hdemo_sk#38) AND isnotnull(ss_sold_time_sk#37)) AND isnotnull(ss_store_sk#39)) + +(54) Project [codegen id : 13] +Output [3]: [ss_sold_time_sk#37, ss_hdemo_sk#38, ss_store_sk#39] +Input [4]: [ss_sold_time_sk#37, ss_hdemo_sk#38, ss_store_sk#39, ss_sold_date_sk#40] + +(55) ReusedExchange [Reuses operator id: 9] +Output [1]: [hd_demo_sk#41] + +(56) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_hdemo_sk#38] +Right keys [1]: [hd_demo_sk#41] +Join condition: None + +(57) Project [codegen id : 13] +Output [2]: [ss_sold_time_sk#37, ss_store_sk#39] +Input [4]: [ss_sold_time_sk#37, ss_hdemo_sk#38, ss_store_sk#39, hd_demo_sk#41] + +(58) Scan parquet default.time_dim +Output [3]: [t_time_sk#42, t_hour#43, t_minute#44] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,9), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(59) ColumnarToRow [codegen id : 11] +Input [3]: [t_time_sk#42, t_hour#43, t_minute#44] + +(60) Filter [codegen id : 11] +Input [3]: [t_time_sk#42, t_hour#43, t_minute#44] +Condition : ((((isnotnull(t_hour#43) AND isnotnull(t_minute#44)) AND (t_hour#43 = 9)) AND (t_minute#44 >= 30)) AND isnotnull(t_time_sk#42)) + +(61) Project [codegen id : 11] +Output [1]: [t_time_sk#42] +Input [3]: [t_time_sk#42, t_hour#43, t_minute#44] + +(62) BroadcastExchange +Input [1]: [t_time_sk#42] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#45] + +(63) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_sold_time_sk#37] +Right keys [1]: [t_time_sk#42] +Join condition: None + +(64) Project [codegen id : 13] +Output [1]: [ss_store_sk#39] +Input [3]: [ss_sold_time_sk#37, ss_store_sk#39, t_time_sk#42] + +(65) ReusedExchange [Reuses operator id: 23] +Output [1]: [s_store_sk#46] + +(66) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_store_sk#39] +Right keys [1]: [s_store_sk#46] +Join condition: None + +(67) Project [codegen id : 13] +Output: [] +Input [2]: [ss_store_sk#39, s_store_sk#46] + +(68) HashAggregate [codegen id : 13] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#47] +Results [1]: [count#48] + +(69) Exchange +Input [1]: [count#48] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#49] + +(70) HashAggregate [codegen id : 14] +Input [1]: [count#48] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#50] +Results [1]: [count(1)#50 AS h9_30_to_10#51] + +(71) BroadcastExchange +Input [1]: [h9_30_to_10#51] +Arguments: IdentityBroadcastMode, [id=#52] + +(72) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + +(73) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#53, ss_hdemo_sk#54, ss_store_sk#55, ss_sold_date_sk#56] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(74) ColumnarToRow [codegen id : 18] +Input [4]: [ss_sold_time_sk#53, ss_hdemo_sk#54, ss_store_sk#55, ss_sold_date_sk#56] + +(75) Filter [codegen id : 18] +Input [4]: [ss_sold_time_sk#53, ss_hdemo_sk#54, ss_store_sk#55, ss_sold_date_sk#56] +Condition : ((isnotnull(ss_hdemo_sk#54) AND isnotnull(ss_sold_time_sk#53)) AND isnotnull(ss_store_sk#55)) + +(76) Project [codegen id : 18] +Output [3]: [ss_sold_time_sk#53, ss_hdemo_sk#54, ss_store_sk#55] +Input [4]: [ss_sold_time_sk#53, ss_hdemo_sk#54, ss_store_sk#55, ss_sold_date_sk#56] + +(77) ReusedExchange [Reuses operator id: 9] +Output [1]: [hd_demo_sk#57] + +(78) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [ss_hdemo_sk#54] +Right keys [1]: [hd_demo_sk#57] +Join condition: None + +(79) Project [codegen id : 18] +Output [2]: [ss_sold_time_sk#53, ss_store_sk#55] +Input [4]: [ss_sold_time_sk#53, ss_hdemo_sk#54, ss_store_sk#55, hd_demo_sk#57] + +(80) Scan parquet default.time_dim +Output [3]: [t_time_sk#58, t_hour#59, t_minute#60] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,10), LessThan(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(81) ColumnarToRow [codegen id : 16] +Input [3]: [t_time_sk#58, t_hour#59, t_minute#60] + +(82) Filter [codegen id : 16] +Input [3]: [t_time_sk#58, t_hour#59, t_minute#60] +Condition : ((((isnotnull(t_hour#59) AND isnotnull(t_minute#60)) AND (t_hour#59 = 10)) AND (t_minute#60 < 30)) AND isnotnull(t_time_sk#58)) + +(83) Project [codegen id : 16] +Output [1]: [t_time_sk#58] +Input [3]: [t_time_sk#58, t_hour#59, t_minute#60] + +(84) BroadcastExchange +Input [1]: [t_time_sk#58] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#61] + +(85) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [ss_sold_time_sk#53] +Right keys [1]: [t_time_sk#58] +Join condition: None + +(86) Project [codegen id : 18] +Output [1]: [ss_store_sk#55] +Input [3]: [ss_sold_time_sk#53, ss_store_sk#55, t_time_sk#58] + +(87) ReusedExchange [Reuses operator id: 23] +Output [1]: [s_store_sk#62] + +(88) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [ss_store_sk#55] +Right keys [1]: [s_store_sk#62] +Join condition: None + +(89) Project [codegen id : 18] +Output: [] +Input [2]: [ss_store_sk#55, s_store_sk#62] + +(90) HashAggregate [codegen id : 18] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#63] +Results [1]: [count#64] + +(91) Exchange +Input [1]: [count#64] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#65] + +(92) HashAggregate [codegen id : 19] +Input [1]: [count#64] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#66] +Results [1]: [count(1)#66 AS h10_to_10_30#67] + +(93) BroadcastExchange +Input [1]: [h10_to_10_30#67] +Arguments: IdentityBroadcastMode, [id=#68] + +(94) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + +(95) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#69, ss_hdemo_sk#70, ss_store_sk#71, ss_sold_date_sk#72] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(96) ColumnarToRow [codegen id : 23] +Input [4]: [ss_sold_time_sk#69, ss_hdemo_sk#70, ss_store_sk#71, ss_sold_date_sk#72] + +(97) Filter [codegen id : 23] +Input [4]: [ss_sold_time_sk#69, ss_hdemo_sk#70, ss_store_sk#71, ss_sold_date_sk#72] +Condition : ((isnotnull(ss_hdemo_sk#70) AND isnotnull(ss_sold_time_sk#69)) AND isnotnull(ss_store_sk#71)) + +(98) Project [codegen id : 23] +Output [3]: [ss_sold_time_sk#69, ss_hdemo_sk#70, ss_store_sk#71] +Input [4]: [ss_sold_time_sk#69, ss_hdemo_sk#70, ss_store_sk#71, ss_sold_date_sk#72] + +(99) ReusedExchange [Reuses operator id: 9] +Output [1]: [hd_demo_sk#73] + +(100) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [ss_hdemo_sk#70] +Right keys [1]: [hd_demo_sk#73] +Join condition: None + +(101) Project [codegen id : 23] +Output [2]: [ss_sold_time_sk#69, ss_store_sk#71] +Input [4]: [ss_sold_time_sk#69, ss_hdemo_sk#70, ss_store_sk#71, hd_demo_sk#73] + +(102) Scan parquet default.time_dim +Output [3]: [t_time_sk#74, t_hour#75, t_minute#76] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,10), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(103) ColumnarToRow [codegen id : 21] +Input [3]: [t_time_sk#74, t_hour#75, t_minute#76] + +(104) Filter [codegen id : 21] +Input [3]: [t_time_sk#74, t_hour#75, t_minute#76] +Condition : ((((isnotnull(t_hour#75) AND isnotnull(t_minute#76)) AND (t_hour#75 = 10)) AND (t_minute#76 >= 30)) AND isnotnull(t_time_sk#74)) + +(105) Project [codegen id : 21] +Output [1]: [t_time_sk#74] +Input [3]: [t_time_sk#74, t_hour#75, t_minute#76] + +(106) BroadcastExchange +Input [1]: [t_time_sk#74] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#77] + +(107) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [ss_sold_time_sk#69] +Right keys [1]: [t_time_sk#74] +Join condition: None + +(108) Project [codegen id : 23] +Output [1]: [ss_store_sk#71] +Input [3]: [ss_sold_time_sk#69, ss_store_sk#71, t_time_sk#74] + +(109) ReusedExchange [Reuses operator id: 23] +Output [1]: [s_store_sk#78] + +(110) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [ss_store_sk#71] +Right keys [1]: [s_store_sk#78] +Join condition: None + +(111) Project [codegen id : 23] +Output: [] +Input [2]: [ss_store_sk#71, s_store_sk#78] + +(112) HashAggregate [codegen id : 23] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#79] +Results [1]: [count#80] + +(113) Exchange +Input [1]: [count#80] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#81] + +(114) HashAggregate [codegen id : 24] +Input [1]: [count#80] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#82] +Results [1]: [count(1)#82 AS h10_30_to_11#83] + +(115) BroadcastExchange +Input [1]: [h10_30_to_11#83] +Arguments: IdentityBroadcastMode, [id=#84] + +(116) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + +(117) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#85, ss_hdemo_sk#86, ss_store_sk#87, ss_sold_date_sk#88] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(118) ColumnarToRow [codegen id : 28] +Input [4]: [ss_sold_time_sk#85, ss_hdemo_sk#86, ss_store_sk#87, ss_sold_date_sk#88] + +(119) Filter [codegen id : 28] +Input [4]: [ss_sold_time_sk#85, ss_hdemo_sk#86, ss_store_sk#87, ss_sold_date_sk#88] +Condition : ((isnotnull(ss_hdemo_sk#86) AND isnotnull(ss_sold_time_sk#85)) AND isnotnull(ss_store_sk#87)) + +(120) Project [codegen id : 28] +Output [3]: [ss_sold_time_sk#85, ss_hdemo_sk#86, ss_store_sk#87] +Input [4]: [ss_sold_time_sk#85, ss_hdemo_sk#86, ss_store_sk#87, ss_sold_date_sk#88] + +(121) ReusedExchange [Reuses operator id: 9] +Output [1]: [hd_demo_sk#89] + +(122) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ss_hdemo_sk#86] +Right keys [1]: [hd_demo_sk#89] +Join condition: None + +(123) Project [codegen id : 28] +Output [2]: [ss_sold_time_sk#85, ss_store_sk#87] +Input [4]: [ss_sold_time_sk#85, ss_hdemo_sk#86, ss_store_sk#87, hd_demo_sk#89] + +(124) Scan parquet default.time_dim +Output [3]: [t_time_sk#90, t_hour#91, t_minute#92] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,11), LessThan(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(125) ColumnarToRow [codegen id : 26] +Input [3]: [t_time_sk#90, t_hour#91, t_minute#92] + +(126) Filter [codegen id : 26] +Input [3]: [t_time_sk#90, t_hour#91, t_minute#92] +Condition : ((((isnotnull(t_hour#91) AND isnotnull(t_minute#92)) AND (t_hour#91 = 11)) AND (t_minute#92 < 30)) AND isnotnull(t_time_sk#90)) + +(127) Project [codegen id : 26] +Output [1]: [t_time_sk#90] +Input [3]: [t_time_sk#90, t_hour#91, t_minute#92] + +(128) BroadcastExchange +Input [1]: [t_time_sk#90] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#93] + +(129) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ss_sold_time_sk#85] +Right keys [1]: [t_time_sk#90] +Join condition: None + +(130) Project [codegen id : 28] +Output [1]: [ss_store_sk#87] +Input [3]: [ss_sold_time_sk#85, ss_store_sk#87, t_time_sk#90] + +(131) ReusedExchange [Reuses operator id: 23] +Output [1]: [s_store_sk#94] + +(132) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ss_store_sk#87] +Right keys [1]: [s_store_sk#94] +Join condition: None + +(133) Project [codegen id : 28] +Output: [] +Input [2]: [ss_store_sk#87, s_store_sk#94] + +(134) HashAggregate [codegen id : 28] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#95] +Results [1]: [count#96] + +(135) Exchange +Input [1]: [count#96] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#97] + +(136) HashAggregate [codegen id : 29] +Input [1]: [count#96] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#98] +Results [1]: [count(1)#98 AS h11_to_11_30#99] + +(137) BroadcastExchange +Input [1]: [h11_to_11_30#99] +Arguments: IdentityBroadcastMode, [id=#100] + +(138) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + +(139) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#101, ss_hdemo_sk#102, ss_store_sk#103, ss_sold_date_sk#104] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(140) ColumnarToRow [codegen id : 33] +Input [4]: [ss_sold_time_sk#101, ss_hdemo_sk#102, ss_store_sk#103, ss_sold_date_sk#104] + +(141) Filter [codegen id : 33] +Input [4]: [ss_sold_time_sk#101, ss_hdemo_sk#102, ss_store_sk#103, ss_sold_date_sk#104] +Condition : ((isnotnull(ss_hdemo_sk#102) AND isnotnull(ss_sold_time_sk#101)) AND isnotnull(ss_store_sk#103)) + +(142) Project [codegen id : 33] +Output [3]: [ss_sold_time_sk#101, ss_hdemo_sk#102, ss_store_sk#103] +Input [4]: [ss_sold_time_sk#101, ss_hdemo_sk#102, ss_store_sk#103, ss_sold_date_sk#104] + +(143) ReusedExchange [Reuses operator id: 9] +Output [1]: [hd_demo_sk#105] + +(144) BroadcastHashJoin [codegen id : 33] +Left keys [1]: [ss_hdemo_sk#102] +Right keys [1]: [hd_demo_sk#105] +Join condition: None + +(145) Project [codegen id : 33] +Output [2]: [ss_sold_time_sk#101, ss_store_sk#103] +Input [4]: [ss_sold_time_sk#101, ss_hdemo_sk#102, ss_store_sk#103, hd_demo_sk#105] + +(146) Scan parquet default.time_dim +Output [3]: [t_time_sk#106, t_hour#107, t_minute#108] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,11), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(147) ColumnarToRow [codegen id : 31] +Input [3]: [t_time_sk#106, t_hour#107, t_minute#108] + +(148) Filter [codegen id : 31] +Input [3]: [t_time_sk#106, t_hour#107, t_minute#108] +Condition : ((((isnotnull(t_hour#107) AND isnotnull(t_minute#108)) AND (t_hour#107 = 11)) AND (t_minute#108 >= 30)) AND isnotnull(t_time_sk#106)) + +(149) Project [codegen id : 31] +Output [1]: [t_time_sk#106] +Input [3]: [t_time_sk#106, t_hour#107, t_minute#108] + +(150) BroadcastExchange +Input [1]: [t_time_sk#106] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#109] + +(151) BroadcastHashJoin [codegen id : 33] +Left keys [1]: [ss_sold_time_sk#101] +Right keys [1]: [t_time_sk#106] +Join condition: None + +(152) Project [codegen id : 33] +Output [1]: [ss_store_sk#103] +Input [3]: [ss_sold_time_sk#101, ss_store_sk#103, t_time_sk#106] + +(153) ReusedExchange [Reuses operator id: 23] +Output [1]: [s_store_sk#110] + +(154) BroadcastHashJoin [codegen id : 33] +Left keys [1]: [ss_store_sk#103] +Right keys [1]: [s_store_sk#110] +Join condition: None + +(155) Project [codegen id : 33] +Output: [] +Input [2]: [ss_store_sk#103, s_store_sk#110] + +(156) HashAggregate [codegen id : 33] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#111] +Results [1]: [count#112] + +(157) Exchange +Input [1]: [count#112] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#113] + +(158) HashAggregate [codegen id : 34] +Input [1]: [count#112] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#114] +Results [1]: [count(1)#114 AS h11_30_to_12#115] + +(159) BroadcastExchange +Input [1]: [h11_30_to_12#115] +Arguments: IdentityBroadcastMode, [id=#116] + +(160) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + +(161) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#117, ss_hdemo_sk#118, ss_store_sk#119, ss_sold_date_sk#120] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(162) ColumnarToRow [codegen id : 38] +Input [4]: [ss_sold_time_sk#117, ss_hdemo_sk#118, ss_store_sk#119, ss_sold_date_sk#120] + +(163) Filter [codegen id : 38] +Input [4]: [ss_sold_time_sk#117, ss_hdemo_sk#118, ss_store_sk#119, ss_sold_date_sk#120] +Condition : ((isnotnull(ss_hdemo_sk#118) AND isnotnull(ss_sold_time_sk#117)) AND isnotnull(ss_store_sk#119)) + +(164) Project [codegen id : 38] +Output [3]: [ss_sold_time_sk#117, ss_hdemo_sk#118, ss_store_sk#119] +Input [4]: [ss_sold_time_sk#117, ss_hdemo_sk#118, ss_store_sk#119, ss_sold_date_sk#120] + +(165) ReusedExchange [Reuses operator id: 9] +Output [1]: [hd_demo_sk#121] + +(166) BroadcastHashJoin [codegen id : 38] +Left keys [1]: [ss_hdemo_sk#118] +Right keys [1]: [hd_demo_sk#121] +Join condition: None + +(167) Project [codegen id : 38] +Output [2]: [ss_sold_time_sk#117, ss_store_sk#119] +Input [4]: [ss_sold_time_sk#117, ss_hdemo_sk#118, ss_store_sk#119, hd_demo_sk#121] + +(168) Scan parquet default.time_dim +Output [3]: [t_time_sk#122, t_hour#123, t_minute#124] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,12), LessThan(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(169) ColumnarToRow [codegen id : 36] +Input [3]: [t_time_sk#122, t_hour#123, t_minute#124] + +(170) Filter [codegen id : 36] +Input [3]: [t_time_sk#122, t_hour#123, t_minute#124] +Condition : ((((isnotnull(t_hour#123) AND isnotnull(t_minute#124)) AND (t_hour#123 = 12)) AND (t_minute#124 < 30)) AND isnotnull(t_time_sk#122)) + +(171) Project [codegen id : 36] +Output [1]: [t_time_sk#122] +Input [3]: [t_time_sk#122, t_hour#123, t_minute#124] + +(172) BroadcastExchange +Input [1]: [t_time_sk#122] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#125] + +(173) BroadcastHashJoin [codegen id : 38] +Left keys [1]: [ss_sold_time_sk#117] +Right keys [1]: [t_time_sk#122] +Join condition: None + +(174) Project [codegen id : 38] +Output [1]: [ss_store_sk#119] +Input [3]: [ss_sold_time_sk#117, ss_store_sk#119, t_time_sk#122] + +(175) ReusedExchange [Reuses operator id: 23] +Output [1]: [s_store_sk#126] + +(176) BroadcastHashJoin [codegen id : 38] +Left keys [1]: [ss_store_sk#119] +Right keys [1]: [s_store_sk#126] +Join condition: None + +(177) Project [codegen id : 38] +Output: [] +Input [2]: [ss_store_sk#119, s_store_sk#126] + +(178) HashAggregate [codegen id : 38] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#127] +Results [1]: [count#128] + +(179) Exchange +Input [1]: [count#128] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#129] + +(180) HashAggregate [codegen id : 39] +Input [1]: [count#128] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#130] +Results [1]: [count(1)#130 AS h12_to_12_30#131] + +(181) BroadcastExchange +Input [1]: [h12_to_12_30#131] +Arguments: IdentityBroadcastMode, [id=#132] + +(182) BroadcastNestedLoopJoin [codegen id : 40] +Join condition: None + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88/simplified.txt new file mode 100644 index 0000000000000..4bbd80c7a884e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q88/simplified.txt @@ -0,0 +1,265 @@ +WholeStageCodegen (40) + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + BroadcastNestedLoopJoin + HashAggregate [count] [count(1),h8_30_to_9,count] + InputAdapter + Exchange #1 + WholeStageCodegen (4) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_store_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_vehicle_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [s_store_sk] + Filter [s_store_name,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + HashAggregate [count] [count(1),h9_to_9_30,count] + InputAdapter + Exchange #6 + WholeStageCodegen (8) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_store_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [hd_demo_sk] #2 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (6) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #4 + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (14) + HashAggregate [count] [count(1),h9_30_to_10,count] + InputAdapter + Exchange #9 + WholeStageCodegen (13) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_store_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [hd_demo_sk] #2 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (11) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #4 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (19) + HashAggregate [count] [count(1),h10_to_10_30,count] + InputAdapter + Exchange #12 + WholeStageCodegen (18) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_store_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [hd_demo_sk] #2 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (16) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #4 + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (24) + HashAggregate [count] [count(1),h10_30_to_11,count] + InputAdapter + Exchange #15 + WholeStageCodegen (23) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_store_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [hd_demo_sk] #2 + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (21) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #4 + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (29) + HashAggregate [count] [count(1),h11_to_11_30,count] + InputAdapter + Exchange #18 + WholeStageCodegen (28) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_store_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [hd_demo_sk] #2 + InputAdapter + BroadcastExchange #19 + WholeStageCodegen (26) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #4 + InputAdapter + BroadcastExchange #20 + WholeStageCodegen (34) + HashAggregate [count] [count(1),h11_30_to_12,count] + InputAdapter + Exchange #21 + WholeStageCodegen (33) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_store_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [hd_demo_sk] #2 + InputAdapter + BroadcastExchange #22 + WholeStageCodegen (31) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #4 + InputAdapter + BroadcastExchange #23 + WholeStageCodegen (39) + HashAggregate [count] [count(1),h12_to_12_30,count] + InputAdapter + Exchange #24 + WholeStageCodegen (38) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_store_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + ReusedExchange [hd_demo_sk] #2 + InputAdapter + BroadcastExchange #25 + WholeStageCodegen (36) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + ReusedExchange [s_store_sk] #4 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/explain.txt new file mode 100644 index 0000000000000..b3d0c07cd80fe --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/explain.txt @@ -0,0 +1,186 @@ +== Physical Plan == +TakeOrderedAndProject (31) ++- * Project (30) + +- * Filter (29) + +- Window (28) + +- * Sort (27) + +- Exchange (26) + +- * HashAggregate (25) + +- Exchange (24) + +- * HashAggregate (23) + +- * Project (22) + +- * BroadcastHashJoin Inner BuildRight (21) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (9) + : : +- * BroadcastHashJoin Inner BuildLeft (8) + : : :- BroadcastExchange (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.store_sales (5) + : +- BroadcastExchange (14) + : +- * Project (13) + : +- * Filter (12) + : +- * ColumnarToRow (11) + : +- Scan parquet default.date_dim (10) + +- BroadcastExchange (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.store (17) + + +(1) Scan parquet default.item +Output [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(In(i_category, [Books ,Electronics ,Sports ]),In(i_class, [computers ,stereo ,football ])),And(In(i_category, [Men ,Jewelry ,Women ]),In(i_class, [shirts ,birdal ,dresses ]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] + +(3) Filter [codegen id : 1] +Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] +Condition : (((i_category#4 IN (Books ,Electronics ,Sports ) AND i_class#3 IN (computers ,stereo ,football )) OR (i_category#4 IN (Men ,Jewelry ,Women ) AND i_class#3 IN (shirts ,birdal ,dresses ))) AND isnotnull(i_item_sk#1)) + +(4) BroadcastExchange +Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#5] + +(5) Scan parquet default.store_sales +Output [4]: [ss_item_sk#6, ss_store_sk#7, ss_sales_price#8, ss_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#9), dynamicpruningexpression(ss_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow +Input [4]: [ss_item_sk#6, ss_store_sk#7, ss_sales_price#8, ss_sold_date_sk#9] + +(7) Filter +Input [4]: [ss_item_sk#6, ss_store_sk#7, ss_sales_price#8, ss_sold_date_sk#9] +Condition : (isnotnull(ss_item_sk#6) AND isnotnull(ss_store_sk#7)) + +(8) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#6] +Join condition: None + +(9) Project [codegen id : 4] +Output [6]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#7, ss_sales_price#8, ss_sold_date_sk#9] +Input [8]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, ss_item_sk#6, ss_store_sk#7, ss_sales_price#8, ss_sold_date_sk#9] + +(10) Scan parquet default.date_dim +Output [3]: [d_date_sk#11, d_year#12, d_moy#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(12) Filter [codegen id : 2] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] +Condition : ((isnotnull(d_year#12) AND (d_year#12 = 1999)) AND isnotnull(d_date_sk#11)) + +(13) Project [codegen id : 2] +Output [2]: [d_date_sk#11, d_moy#13] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(14) BroadcastExchange +Input [2]: [d_date_sk#11, d_moy#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#9] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(16) Project [codegen id : 4] +Output [6]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#7, ss_sales_price#8, d_moy#13] +Input [8]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#7, ss_sales_price#8, ss_sold_date_sk#9, d_date_sk#11, d_moy#13] + +(17) Scan parquet default.store +Output [3]: [s_store_sk#15, s_store_name#16, s_company_name#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [3]: [s_store_sk#15, s_store_name#16, s_company_name#17] + +(19) Filter [codegen id : 3] +Input [3]: [s_store_sk#15, s_store_name#16, s_company_name#17] +Condition : isnotnull(s_store_sk#15) + +(20) BroadcastExchange +Input [3]: [s_store_sk#15, s_store_name#16, s_company_name#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#7] +Right keys [1]: [s_store_sk#15] +Join condition: None + +(22) Project [codegen id : 4] +Output [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#8, d_moy#13, s_store_name#16, s_company_name#17] +Input [9]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#7, ss_sales_price#8, d_moy#13, s_store_sk#15, s_store_name#16, s_company_name#17] + +(23) HashAggregate [codegen id : 4] +Input [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#8, d_moy#13, s_store_name#16, s_company_name#17] +Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#8))] +Aggregate Attributes [1]: [sum#19] +Results [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum#20] + +(24) Exchange +Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum#20] +Arguments: hashpartitioning(i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, 5), ENSURE_REQUIREMENTS, [id=#21] + +(25) HashAggregate [codegen id : 5] +Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum#20] +Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13] +Functions [1]: [sum(UnscaledValue(ss_sales_price#8))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#8))#22] +Results [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, MakeDecimal(sum(UnscaledValue(ss_sales_price#8))#22,17,2) AS sum_sales#23, MakeDecimal(sum(UnscaledValue(ss_sales_price#8))#22,17,2) AS _w0#24] + +(26) Exchange +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24] +Arguments: hashpartitioning(i_category#4, i_brand#2, s_store_name#16, s_company_name#17, 5), ENSURE_REQUIREMENTS, [id=#25] + +(27) Sort [codegen id : 6] +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24] +Arguments: [i_category#4 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, s_store_name#16 ASC NULLS FIRST, s_company_name#17 ASC NULLS FIRST], false, 0 + +(28) Window +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24] +Arguments: [avg(_w0#24) windowspecdefinition(i_category#4, i_brand#2, s_store_name#16, s_company_name#17, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#26], [i_category#4, i_brand#2, s_store_name#16, s_company_name#17] + +(29) Filter [codegen id : 7] +Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24, avg_monthly_sales#26] +Condition : (isnotnull(avg_monthly_sales#26) AND (NOT (avg_monthly_sales#26 = 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#23 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000))) + +(30) Project [codegen id : 7] +Output [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, avg_monthly_sales#26] +Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24, avg_monthly_sales#26] + +(31) TakeOrderedAndProject +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, avg_monthly_sales#26] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#23 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#16 ASC NULLS FIRST], [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, avg_monthly_sales#26] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 5 Hosting Expression = ss_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (32) + + +(32) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#11, d_moy#13] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/simplified.txt new file mode 100644 index 0000000000000..e4a9b0edb9ded --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89.sf100/simplified.txt @@ -0,0 +1,50 @@ +TakeOrderedAndProject [sum_sales,avg_monthly_sales,s_store_name,i_category,i_class,i_brand,s_company_name,d_moy] + WholeStageCodegen (7) + Project [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,sum_sales,avg_monthly_sales] + Filter [avg_monthly_sales,sum_sales] + InputAdapter + Window [_w0,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (6) + Sort [i_category,i_brand,s_store_name,s_company_name] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name] #1 + WholeStageCodegen (5) + HashAggregate [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy] #2 + WholeStageCodegen (4) + HashAggregate [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,ss_sales_price] [sum,sum] + Project [i_brand,i_class,i_category,ss_sales_price,d_moy,s_store_name,s_company_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_brand,i_class,i_category,ss_store_sk,ss_sales_price,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_brand,i_class,i_category,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [i_category,i_class,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category] + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_moy] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk,d_moy] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_company_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89/explain.txt new file mode 100644 index 0000000000000..f61c8e6945003 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89/explain.txt @@ -0,0 +1,186 @@ +== Physical Plan == +TakeOrderedAndProject (31) ++- * Project (30) + +- * Filter (29) + +- Window (28) + +- * Sort (27) + +- Exchange (26) + +- * HashAggregate (25) + +- Exchange (24) + +- * HashAggregate (23) + +- * Project (22) + +- * BroadcastHashJoin Inner BuildRight (21) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (9) + : : +- * BroadcastHashJoin Inner BuildRight (8) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- BroadcastExchange (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.store_sales (4) + : +- BroadcastExchange (14) + : +- * Project (13) + : +- * Filter (12) + : +- * ColumnarToRow (11) + : +- Scan parquet default.date_dim (10) + +- BroadcastExchange (20) + +- * Filter (19) + +- * ColumnarToRow (18) + +- Scan parquet default.store (17) + + +(1) Scan parquet default.item +Output [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [Or(And(In(i_category, [Books ,Electronics ,Sports ]),In(i_class, [computers ,stereo ,football ])),And(In(i_category, [Men ,Jewelry ,Women ]),In(i_class, [shirts ,birdal ,dresses ]))), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] + +(3) Filter [codegen id : 4] +Input [4]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4] +Condition : (((i_category#4 IN (Books ,Electronics ,Sports ) AND i_class#3 IN (computers ,stereo ,football )) OR (i_category#4 IN (Men ,Jewelry ,Women ) AND i_class#3 IN (shirts ,birdal ,dresses ))) AND isnotnull(i_item_sk#1)) + +(4) Scan parquet default.store_sales +Output [4]: [ss_item_sk#5, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#5, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8] + +(6) Filter [codegen id : 1] +Input [4]: [ss_item_sk#5, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8] +Condition : (isnotnull(ss_item_sk#5) AND isnotnull(ss_store_sk#6)) + +(7) BroadcastExchange +Input [4]: [ss_item_sk#5, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] + +(8) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#5] +Join condition: None + +(9) Project [codegen id : 4] +Output [6]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8] +Input [8]: [i_item_sk#1, i_brand#2, i_class#3, i_category#4, ss_item_sk#5, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8] + +(10) Scan parquet default.date_dim +Output [3]: [d_date_sk#11, d_year#12, d_moy#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(12) Filter [codegen id : 2] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] +Condition : ((isnotnull(d_year#12) AND (d_year#12 = 1999)) AND isnotnull(d_date_sk#11)) + +(13) Project [codegen id : 2] +Output [2]: [d_date_sk#11, d_moy#13] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(14) BroadcastExchange +Input [2]: [d_date_sk#11, d_moy#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(16) Project [codegen id : 4] +Output [6]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, d_moy#13] +Input [8]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, ss_sold_date_sk#8, d_date_sk#11, d_moy#13] + +(17) Scan parquet default.store +Output [3]: [s_store_sk#15, s_store_name#16, s_company_name#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [3]: [s_store_sk#15, s_store_name#16, s_company_name#17] + +(19) Filter [codegen id : 3] +Input [3]: [s_store_sk#15, s_store_name#16, s_company_name#17] +Condition : isnotnull(s_store_sk#15) + +(20) BroadcastExchange +Input [3]: [s_store_sk#15, s_store_name#16, s_company_name#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#6] +Right keys [1]: [s_store_sk#15] +Join condition: None + +(22) Project [codegen id : 4] +Output [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#7, d_moy#13, s_store_name#16, s_company_name#17] +Input [9]: [i_brand#2, i_class#3, i_category#4, ss_store_sk#6, ss_sales_price#7, d_moy#13, s_store_sk#15, s_store_name#16, s_company_name#17] + +(23) HashAggregate [codegen id : 4] +Input [7]: [i_brand#2, i_class#3, i_category#4, ss_sales_price#7, d_moy#13, s_store_name#16, s_company_name#17] +Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#7))] +Aggregate Attributes [1]: [sum#19] +Results [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum#20] + +(24) Exchange +Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum#20] +Arguments: hashpartitioning(i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, 5), ENSURE_REQUIREMENTS, [id=#21] + +(25) HashAggregate [codegen id : 5] +Input [7]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum#20] +Keys [6]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13] +Functions [1]: [sum(UnscaledValue(ss_sales_price#7))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#7))#22] +Results [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#22,17,2) AS sum_sales#23, MakeDecimal(sum(UnscaledValue(ss_sales_price#7))#22,17,2) AS _w0#24] + +(26) Exchange +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24] +Arguments: hashpartitioning(i_category#4, i_brand#2, s_store_name#16, s_company_name#17, 5), ENSURE_REQUIREMENTS, [id=#25] + +(27) Sort [codegen id : 6] +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24] +Arguments: [i_category#4 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, s_store_name#16 ASC NULLS FIRST, s_company_name#17 ASC NULLS FIRST], false, 0 + +(28) Window +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24] +Arguments: [avg(_w0#24) windowspecdefinition(i_category#4, i_brand#2, s_store_name#16, s_company_name#17, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#26], [i_category#4, i_brand#2, s_store_name#16, s_company_name#17] + +(29) Filter [codegen id : 7] +Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24, avg_monthly_sales#26] +Condition : (isnotnull(avg_monthly_sales#26) AND (NOT (avg_monthly_sales#26 = 0.000000) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#23 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000))) + +(30) Project [codegen id : 7] +Output [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, avg_monthly_sales#26] +Input [9]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, _w0#24, avg_monthly_sales#26] + +(31) TakeOrderedAndProject +Input [8]: [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, avg_monthly_sales#26] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#23 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, s_store_name#16 ASC NULLS FIRST], [i_category#4, i_class#3, i_brand#2, s_store_name#16, s_company_name#17, d_moy#13, sum_sales#23, avg_monthly_sales#26] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (32) + + +(32) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#11, d_moy#13] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89/simplified.txt new file mode 100644 index 0000000000000..b96445eec6223 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q89/simplified.txt @@ -0,0 +1,50 @@ +TakeOrderedAndProject [sum_sales,avg_monthly_sales,s_store_name,i_category,i_class,i_brand,s_company_name,d_moy] + WholeStageCodegen (7) + Project [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,sum_sales,avg_monthly_sales] + Filter [avg_monthly_sales,sum_sales] + InputAdapter + Window [_w0,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (6) + Sort [i_category,i_brand,s_store_name,s_company_name] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name] #1 + WholeStageCodegen (5) + HashAggregate [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy] #2 + WholeStageCodegen (4) + HashAggregate [i_category,i_class,i_brand,s_store_name,s_company_name,d_moy,ss_sales_price] [sum,sum] + Project [i_brand,i_class,i_category,ss_sales_price,d_moy,s_store_name,s_company_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_brand,i_class,i_category,ss_store_sk,ss_sales_price,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_brand,i_class,i_category,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + Filter [i_category,i_class,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_moy] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk,d_moy] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_company_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q9.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q9.sf100/explain.txt new file mode 100644 index 0000000000000..8736c9861a5ce --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q9.sf100/explain.txt @@ -0,0 +1,718 @@ +== Physical Plan == +* Project (4) ++- * Filter (3) + +- * ColumnarToRow (2) + +- Scan parquet default.reason (1) + + +(1) Scan parquet default.reason +Output [1]: [r_reason_sk#1] +Batched: true +Location [not included in comparison]/{warehouse_dir}/reason] +PushedFilters: [IsNotNull(r_reason_sk), EqualTo(r_reason_sk,1)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [1]: [r_reason_sk#1] + +(3) Filter [codegen id : 1] +Input [1]: [r_reason_sk#1] +Condition : (isnotnull(r_reason_sk#1) AND (r_reason_sk#1 = 1)) + +(4) Project [codegen id : 1] +Output [5]: [CASE WHEN (Subquery scalar-subquery#2, [id=#3] > 62316685) THEN Subquery scalar-subquery#4, [id=#5] ELSE Subquery scalar-subquery#6, [id=#7] END AS bucket1#8, CASE WHEN (Subquery scalar-subquery#9, [id=#10] > 19045798) THEN Subquery scalar-subquery#11, [id=#12] ELSE Subquery scalar-subquery#13, [id=#14] END AS bucket2#15, CASE WHEN (Subquery scalar-subquery#16, [id=#17] > 365541424) THEN Subquery scalar-subquery#18, [id=#19] ELSE Subquery scalar-subquery#20, [id=#21] END AS bucket3#22, CASE WHEN (Subquery scalar-subquery#23, [id=#24] > 216357808) THEN Subquery scalar-subquery#25, [id=#26] ELSE Subquery scalar-subquery#27, [id=#28] END AS bucket4#29, CASE WHEN (Subquery scalar-subquery#30, [id=#31] > 184483884) THEN Subquery scalar-subquery#32, [id=#33] ELSE Subquery scalar-subquery#34, [id=#35] END AS bucket5#36] +Input [1]: [r_reason_sk#1] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#2, [id=#3] +* HashAggregate (11) ++- Exchange (10) + +- * HashAggregate (9) + +- * Project (8) + +- * Filter (7) + +- * ColumnarToRow (6) + +- Scan parquet default.store_sales (5) + + +(5) Scan parquet default.store_sales +Output [2]: [ss_quantity#37, ss_sold_date_sk#38] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,1), LessThanOrEqual(ss_quantity,20)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [2]: [ss_quantity#37, ss_sold_date_sk#38] + +(7) Filter [codegen id : 1] +Input [2]: [ss_quantity#37, ss_sold_date_sk#38] +Condition : ((isnotnull(ss_quantity#37) AND (ss_quantity#37 >= 1)) AND (ss_quantity#37 <= 20)) + +(8) Project [codegen id : 1] +Output: [] +Input [2]: [ss_quantity#37, ss_sold_date_sk#38] + +(9) HashAggregate [codegen id : 1] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#39] +Results [1]: [count#40] + +(10) Exchange +Input [1]: [count#40] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#41] + +(11) HashAggregate [codegen id : 2] +Input [1]: [count#40] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#42] +Results [1]: [count(1)#42 AS count(1)#43] + +Subquery:2 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#4, [id=#5] +* HashAggregate (18) ++- Exchange (17) + +- * HashAggregate (16) + +- * Project (15) + +- * Filter (14) + +- * ColumnarToRow (13) + +- Scan parquet default.store_sales (12) + + +(12) Scan parquet default.store_sales +Output [3]: [ss_quantity#44, ss_ext_discount_amt#45, ss_sold_date_sk#46] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,1), LessThanOrEqual(ss_quantity,20)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#44, ss_ext_discount_amt#45, ss_sold_date_sk#46] + +(14) Filter [codegen id : 1] +Input [3]: [ss_quantity#44, ss_ext_discount_amt#45, ss_sold_date_sk#46] +Condition : ((isnotnull(ss_quantity#44) AND (ss_quantity#44 >= 1)) AND (ss_quantity#44 <= 20)) + +(15) Project [codegen id : 1] +Output [1]: [ss_ext_discount_amt#45] +Input [3]: [ss_quantity#44, ss_ext_discount_amt#45, ss_sold_date_sk#46] + +(16) HashAggregate [codegen id : 1] +Input [1]: [ss_ext_discount_amt#45] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_ext_discount_amt#45))] +Aggregate Attributes [2]: [sum#47, count#48] +Results [2]: [sum#49, count#50] + +(17) Exchange +Input [2]: [sum#49, count#50] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#51] + +(18) HashAggregate [codegen id : 2] +Input [2]: [sum#49, count#50] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_ext_discount_amt#45))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_ext_discount_amt#45))#52] +Results [1]: [cast((avg(UnscaledValue(ss_ext_discount_amt#45))#52 / 100.0) as decimal(11,6)) AS avg(ss_ext_discount_amt)#53] + +Subquery:3 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#6, [id=#7] +* HashAggregate (25) ++- Exchange (24) + +- * HashAggregate (23) + +- * Project (22) + +- * Filter (21) + +- * ColumnarToRow (20) + +- Scan parquet default.store_sales (19) + + +(19) Scan parquet default.store_sales +Output [3]: [ss_quantity#54, ss_net_paid#55, ss_sold_date_sk#56] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,1), LessThanOrEqual(ss_quantity,20)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#54, ss_net_paid#55, ss_sold_date_sk#56] + +(21) Filter [codegen id : 1] +Input [3]: [ss_quantity#54, ss_net_paid#55, ss_sold_date_sk#56] +Condition : ((isnotnull(ss_quantity#54) AND (ss_quantity#54 >= 1)) AND (ss_quantity#54 <= 20)) + +(22) Project [codegen id : 1] +Output [1]: [ss_net_paid#55] +Input [3]: [ss_quantity#54, ss_net_paid#55, ss_sold_date_sk#56] + +(23) HashAggregate [codegen id : 1] +Input [1]: [ss_net_paid#55] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_net_paid#55))] +Aggregate Attributes [2]: [sum#57, count#58] +Results [2]: [sum#59, count#60] + +(24) Exchange +Input [2]: [sum#59, count#60] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#61] + +(25) HashAggregate [codegen id : 2] +Input [2]: [sum#59, count#60] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_net_paid#55))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_paid#55))#62] +Results [1]: [cast((avg(UnscaledValue(ss_net_paid#55))#62 / 100.0) as decimal(11,6)) AS avg(ss_net_paid)#63] + +Subquery:4 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#9, [id=#10] +* HashAggregate (32) ++- Exchange (31) + +- * HashAggregate (30) + +- * Project (29) + +- * Filter (28) + +- * ColumnarToRow (27) + +- Scan parquet default.store_sales (26) + + +(26) Scan parquet default.store_sales +Output [2]: [ss_quantity#64, ss_sold_date_sk#65] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,21), LessThanOrEqual(ss_quantity,40)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 1] +Input [2]: [ss_quantity#64, ss_sold_date_sk#65] + +(28) Filter [codegen id : 1] +Input [2]: [ss_quantity#64, ss_sold_date_sk#65] +Condition : ((isnotnull(ss_quantity#64) AND (ss_quantity#64 >= 21)) AND (ss_quantity#64 <= 40)) + +(29) Project [codegen id : 1] +Output: [] +Input [2]: [ss_quantity#64, ss_sold_date_sk#65] + +(30) HashAggregate [codegen id : 1] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#66] +Results [1]: [count#67] + +(31) Exchange +Input [1]: [count#67] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#68] + +(32) HashAggregate [codegen id : 2] +Input [1]: [count#67] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#69] +Results [1]: [count(1)#69 AS count(1)#70] + +Subquery:5 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#11, [id=#12] +* HashAggregate (39) ++- Exchange (38) + +- * HashAggregate (37) + +- * Project (36) + +- * Filter (35) + +- * ColumnarToRow (34) + +- Scan parquet default.store_sales (33) + + +(33) Scan parquet default.store_sales +Output [3]: [ss_quantity#71, ss_ext_discount_amt#72, ss_sold_date_sk#73] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,21), LessThanOrEqual(ss_quantity,40)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#71, ss_ext_discount_amt#72, ss_sold_date_sk#73] + +(35) Filter [codegen id : 1] +Input [3]: [ss_quantity#71, ss_ext_discount_amt#72, ss_sold_date_sk#73] +Condition : ((isnotnull(ss_quantity#71) AND (ss_quantity#71 >= 21)) AND (ss_quantity#71 <= 40)) + +(36) Project [codegen id : 1] +Output [1]: [ss_ext_discount_amt#72] +Input [3]: [ss_quantity#71, ss_ext_discount_amt#72, ss_sold_date_sk#73] + +(37) HashAggregate [codegen id : 1] +Input [1]: [ss_ext_discount_amt#72] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_ext_discount_amt#72))] +Aggregate Attributes [2]: [sum#74, count#75] +Results [2]: [sum#76, count#77] + +(38) Exchange +Input [2]: [sum#76, count#77] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#78] + +(39) HashAggregate [codegen id : 2] +Input [2]: [sum#76, count#77] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_ext_discount_amt#72))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_ext_discount_amt#72))#79] +Results [1]: [cast((avg(UnscaledValue(ss_ext_discount_amt#72))#79 / 100.0) as decimal(11,6)) AS avg(ss_ext_discount_amt)#80] + +Subquery:6 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#13, [id=#14] +* HashAggregate (46) ++- Exchange (45) + +- * HashAggregate (44) + +- * Project (43) + +- * Filter (42) + +- * ColumnarToRow (41) + +- Scan parquet default.store_sales (40) + + +(40) Scan parquet default.store_sales +Output [3]: [ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#83] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,21), LessThanOrEqual(ss_quantity,40)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#83] + +(42) Filter [codegen id : 1] +Input [3]: [ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#83] +Condition : ((isnotnull(ss_quantity#81) AND (ss_quantity#81 >= 21)) AND (ss_quantity#81 <= 40)) + +(43) Project [codegen id : 1] +Output [1]: [ss_net_paid#82] +Input [3]: [ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#83] + +(44) HashAggregate [codegen id : 1] +Input [1]: [ss_net_paid#82] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_net_paid#82))] +Aggregate Attributes [2]: [sum#84, count#85] +Results [2]: [sum#86, count#87] + +(45) Exchange +Input [2]: [sum#86, count#87] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#88] + +(46) HashAggregate [codegen id : 2] +Input [2]: [sum#86, count#87] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_net_paid#82))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_paid#82))#89] +Results [1]: [cast((avg(UnscaledValue(ss_net_paid#82))#89 / 100.0) as decimal(11,6)) AS avg(ss_net_paid)#90] + +Subquery:7 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#16, [id=#17] +* HashAggregate (53) ++- Exchange (52) + +- * HashAggregate (51) + +- * Project (50) + +- * Filter (49) + +- * ColumnarToRow (48) + +- Scan parquet default.store_sales (47) + + +(47) Scan parquet default.store_sales +Output [2]: [ss_quantity#91, ss_sold_date_sk#92] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,41), LessThanOrEqual(ss_quantity,60)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 1] +Input [2]: [ss_quantity#91, ss_sold_date_sk#92] + +(49) Filter [codegen id : 1] +Input [2]: [ss_quantity#91, ss_sold_date_sk#92] +Condition : ((isnotnull(ss_quantity#91) AND (ss_quantity#91 >= 41)) AND (ss_quantity#91 <= 60)) + +(50) Project [codegen id : 1] +Output: [] +Input [2]: [ss_quantity#91, ss_sold_date_sk#92] + +(51) HashAggregate [codegen id : 1] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#93] +Results [1]: [count#94] + +(52) Exchange +Input [1]: [count#94] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#95] + +(53) HashAggregate [codegen id : 2] +Input [1]: [count#94] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#96] +Results [1]: [count(1)#96 AS count(1)#97] + +Subquery:8 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#18, [id=#19] +* HashAggregate (60) ++- Exchange (59) + +- * HashAggregate (58) + +- * Project (57) + +- * Filter (56) + +- * ColumnarToRow (55) + +- Scan parquet default.store_sales (54) + + +(54) Scan parquet default.store_sales +Output [3]: [ss_quantity#98, ss_ext_discount_amt#99, ss_sold_date_sk#100] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,41), LessThanOrEqual(ss_quantity,60)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#98, ss_ext_discount_amt#99, ss_sold_date_sk#100] + +(56) Filter [codegen id : 1] +Input [3]: [ss_quantity#98, ss_ext_discount_amt#99, ss_sold_date_sk#100] +Condition : ((isnotnull(ss_quantity#98) AND (ss_quantity#98 >= 41)) AND (ss_quantity#98 <= 60)) + +(57) Project [codegen id : 1] +Output [1]: [ss_ext_discount_amt#99] +Input [3]: [ss_quantity#98, ss_ext_discount_amt#99, ss_sold_date_sk#100] + +(58) HashAggregate [codegen id : 1] +Input [1]: [ss_ext_discount_amt#99] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_ext_discount_amt#99))] +Aggregate Attributes [2]: [sum#101, count#102] +Results [2]: [sum#103, count#104] + +(59) Exchange +Input [2]: [sum#103, count#104] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#105] + +(60) HashAggregate [codegen id : 2] +Input [2]: [sum#103, count#104] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_ext_discount_amt#99))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_ext_discount_amt#99))#106] +Results [1]: [cast((avg(UnscaledValue(ss_ext_discount_amt#99))#106 / 100.0) as decimal(11,6)) AS avg(ss_ext_discount_amt)#107] + +Subquery:9 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#20, [id=#21] +* HashAggregate (67) ++- Exchange (66) + +- * HashAggregate (65) + +- * Project (64) + +- * Filter (63) + +- * ColumnarToRow (62) + +- Scan parquet default.store_sales (61) + + +(61) Scan parquet default.store_sales +Output [3]: [ss_quantity#108, ss_net_paid#109, ss_sold_date_sk#110] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,41), LessThanOrEqual(ss_quantity,60)] +ReadSchema: struct + +(62) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#108, ss_net_paid#109, ss_sold_date_sk#110] + +(63) Filter [codegen id : 1] +Input [3]: [ss_quantity#108, ss_net_paid#109, ss_sold_date_sk#110] +Condition : ((isnotnull(ss_quantity#108) AND (ss_quantity#108 >= 41)) AND (ss_quantity#108 <= 60)) + +(64) Project [codegen id : 1] +Output [1]: [ss_net_paid#109] +Input [3]: [ss_quantity#108, ss_net_paid#109, ss_sold_date_sk#110] + +(65) HashAggregate [codegen id : 1] +Input [1]: [ss_net_paid#109] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_net_paid#109))] +Aggregate Attributes [2]: [sum#111, count#112] +Results [2]: [sum#113, count#114] + +(66) Exchange +Input [2]: [sum#113, count#114] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#115] + +(67) HashAggregate [codegen id : 2] +Input [2]: [sum#113, count#114] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_net_paid#109))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_paid#109))#116] +Results [1]: [cast((avg(UnscaledValue(ss_net_paid#109))#116 / 100.0) as decimal(11,6)) AS avg(ss_net_paid)#117] + +Subquery:10 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#23, [id=#24] +* HashAggregate (74) ++- Exchange (73) + +- * HashAggregate (72) + +- * Project (71) + +- * Filter (70) + +- * ColumnarToRow (69) + +- Scan parquet default.store_sales (68) + + +(68) Scan parquet default.store_sales +Output [2]: [ss_quantity#118, ss_sold_date_sk#119] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,61), LessThanOrEqual(ss_quantity,80)] +ReadSchema: struct + +(69) ColumnarToRow [codegen id : 1] +Input [2]: [ss_quantity#118, ss_sold_date_sk#119] + +(70) Filter [codegen id : 1] +Input [2]: [ss_quantity#118, ss_sold_date_sk#119] +Condition : ((isnotnull(ss_quantity#118) AND (ss_quantity#118 >= 61)) AND (ss_quantity#118 <= 80)) + +(71) Project [codegen id : 1] +Output: [] +Input [2]: [ss_quantity#118, ss_sold_date_sk#119] + +(72) HashAggregate [codegen id : 1] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#120] +Results [1]: [count#121] + +(73) Exchange +Input [1]: [count#121] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#122] + +(74) HashAggregate [codegen id : 2] +Input [1]: [count#121] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#123] +Results [1]: [count(1)#123 AS count(1)#124] + +Subquery:11 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#25, [id=#26] +* HashAggregate (81) ++- Exchange (80) + +- * HashAggregate (79) + +- * Project (78) + +- * Filter (77) + +- * ColumnarToRow (76) + +- Scan parquet default.store_sales (75) + + +(75) Scan parquet default.store_sales +Output [3]: [ss_quantity#125, ss_ext_discount_amt#126, ss_sold_date_sk#127] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,61), LessThanOrEqual(ss_quantity,80)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#125, ss_ext_discount_amt#126, ss_sold_date_sk#127] + +(77) Filter [codegen id : 1] +Input [3]: [ss_quantity#125, ss_ext_discount_amt#126, ss_sold_date_sk#127] +Condition : ((isnotnull(ss_quantity#125) AND (ss_quantity#125 >= 61)) AND (ss_quantity#125 <= 80)) + +(78) Project [codegen id : 1] +Output [1]: [ss_ext_discount_amt#126] +Input [3]: [ss_quantity#125, ss_ext_discount_amt#126, ss_sold_date_sk#127] + +(79) HashAggregate [codegen id : 1] +Input [1]: [ss_ext_discount_amt#126] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_ext_discount_amt#126))] +Aggregate Attributes [2]: [sum#128, count#129] +Results [2]: [sum#130, count#131] + +(80) Exchange +Input [2]: [sum#130, count#131] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#132] + +(81) HashAggregate [codegen id : 2] +Input [2]: [sum#130, count#131] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_ext_discount_amt#126))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_ext_discount_amt#126))#133] +Results [1]: [cast((avg(UnscaledValue(ss_ext_discount_amt#126))#133 / 100.0) as decimal(11,6)) AS avg(ss_ext_discount_amt)#134] + +Subquery:12 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#27, [id=#28] +* HashAggregate (88) ++- Exchange (87) + +- * HashAggregate (86) + +- * Project (85) + +- * Filter (84) + +- * ColumnarToRow (83) + +- Scan parquet default.store_sales (82) + + +(82) Scan parquet default.store_sales +Output [3]: [ss_quantity#135, ss_net_paid#136, ss_sold_date_sk#137] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,61), LessThanOrEqual(ss_quantity,80)] +ReadSchema: struct + +(83) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#135, ss_net_paid#136, ss_sold_date_sk#137] + +(84) Filter [codegen id : 1] +Input [3]: [ss_quantity#135, ss_net_paid#136, ss_sold_date_sk#137] +Condition : ((isnotnull(ss_quantity#135) AND (ss_quantity#135 >= 61)) AND (ss_quantity#135 <= 80)) + +(85) Project [codegen id : 1] +Output [1]: [ss_net_paid#136] +Input [3]: [ss_quantity#135, ss_net_paid#136, ss_sold_date_sk#137] + +(86) HashAggregate [codegen id : 1] +Input [1]: [ss_net_paid#136] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_net_paid#136))] +Aggregate Attributes [2]: [sum#138, count#139] +Results [2]: [sum#140, count#141] + +(87) Exchange +Input [2]: [sum#140, count#141] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#142] + +(88) HashAggregate [codegen id : 2] +Input [2]: [sum#140, count#141] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_net_paid#136))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_paid#136))#143] +Results [1]: [cast((avg(UnscaledValue(ss_net_paid#136))#143 / 100.0) as decimal(11,6)) AS avg(ss_net_paid)#144] + +Subquery:13 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#30, [id=#31] +* HashAggregate (95) ++- Exchange (94) + +- * HashAggregate (93) + +- * Project (92) + +- * Filter (91) + +- * ColumnarToRow (90) + +- Scan parquet default.store_sales (89) + + +(89) Scan parquet default.store_sales +Output [2]: [ss_quantity#145, ss_sold_date_sk#146] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,81), LessThanOrEqual(ss_quantity,100)] +ReadSchema: struct + +(90) ColumnarToRow [codegen id : 1] +Input [2]: [ss_quantity#145, ss_sold_date_sk#146] + +(91) Filter [codegen id : 1] +Input [2]: [ss_quantity#145, ss_sold_date_sk#146] +Condition : ((isnotnull(ss_quantity#145) AND (ss_quantity#145 >= 81)) AND (ss_quantity#145 <= 100)) + +(92) Project [codegen id : 1] +Output: [] +Input [2]: [ss_quantity#145, ss_sold_date_sk#146] + +(93) HashAggregate [codegen id : 1] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#147] +Results [1]: [count#148] + +(94) Exchange +Input [1]: [count#148] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#149] + +(95) HashAggregate [codegen id : 2] +Input [1]: [count#148] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#150] +Results [1]: [count(1)#150 AS count(1)#151] + +Subquery:14 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#32, [id=#33] +* HashAggregate (102) ++- Exchange (101) + +- * HashAggregate (100) + +- * Project (99) + +- * Filter (98) + +- * ColumnarToRow (97) + +- Scan parquet default.store_sales (96) + + +(96) Scan parquet default.store_sales +Output [3]: [ss_quantity#152, ss_ext_discount_amt#153, ss_sold_date_sk#154] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,81), LessThanOrEqual(ss_quantity,100)] +ReadSchema: struct + +(97) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#152, ss_ext_discount_amt#153, ss_sold_date_sk#154] + +(98) Filter [codegen id : 1] +Input [3]: [ss_quantity#152, ss_ext_discount_amt#153, ss_sold_date_sk#154] +Condition : ((isnotnull(ss_quantity#152) AND (ss_quantity#152 >= 81)) AND (ss_quantity#152 <= 100)) + +(99) Project [codegen id : 1] +Output [1]: [ss_ext_discount_amt#153] +Input [3]: [ss_quantity#152, ss_ext_discount_amt#153, ss_sold_date_sk#154] + +(100) HashAggregate [codegen id : 1] +Input [1]: [ss_ext_discount_amt#153] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_ext_discount_amt#153))] +Aggregate Attributes [2]: [sum#155, count#156] +Results [2]: [sum#157, count#158] + +(101) Exchange +Input [2]: [sum#157, count#158] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#159] + +(102) HashAggregate [codegen id : 2] +Input [2]: [sum#157, count#158] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_ext_discount_amt#153))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_ext_discount_amt#153))#160] +Results [1]: [cast((avg(UnscaledValue(ss_ext_discount_amt#153))#160 / 100.0) as decimal(11,6)) AS avg(ss_ext_discount_amt)#161] + +Subquery:15 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#34, [id=#35] +* HashAggregate (109) ++- Exchange (108) + +- * HashAggregate (107) + +- * Project (106) + +- * Filter (105) + +- * ColumnarToRow (104) + +- Scan parquet default.store_sales (103) + + +(103) Scan parquet default.store_sales +Output [3]: [ss_quantity#162, ss_net_paid#163, ss_sold_date_sk#164] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,81), LessThanOrEqual(ss_quantity,100)] +ReadSchema: struct + +(104) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#162, ss_net_paid#163, ss_sold_date_sk#164] + +(105) Filter [codegen id : 1] +Input [3]: [ss_quantity#162, ss_net_paid#163, ss_sold_date_sk#164] +Condition : ((isnotnull(ss_quantity#162) AND (ss_quantity#162 >= 81)) AND (ss_quantity#162 <= 100)) + +(106) Project [codegen id : 1] +Output [1]: [ss_net_paid#163] +Input [3]: [ss_quantity#162, ss_net_paid#163, ss_sold_date_sk#164] + +(107) HashAggregate [codegen id : 1] +Input [1]: [ss_net_paid#163] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_net_paid#163))] +Aggregate Attributes [2]: [sum#165, count#166] +Results [2]: [sum#167, count#168] + +(108) Exchange +Input [2]: [sum#167, count#168] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#169] + +(109) HashAggregate [codegen id : 2] +Input [2]: [sum#167, count#168] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_net_paid#163))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_paid#163))#170] +Results [1]: [cast((avg(UnscaledValue(ss_net_paid#163))#170 / 100.0) as decimal(11,6)) AS avg(ss_net_paid)#171] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q9.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q9.sf100/simplified.txt new file mode 100644 index 0000000000000..1c42d8f2638c6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q9.sf100/simplified.txt @@ -0,0 +1,186 @@ +WholeStageCodegen (1) + Project + Subquery #1 + WholeStageCodegen (2) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #1 + WholeStageCodegen (1) + HashAggregate [count,count] + Project + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_sold_date_sk] + Subquery #2 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_ext_discount_amt)),avg(ss_ext_discount_amt),sum,count] + InputAdapter + Exchange #2 + WholeStageCodegen (1) + HashAggregate [ss_ext_discount_amt] [sum,count,sum,count] + Project [ss_ext_discount_amt] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_ext_discount_amt,ss_sold_date_sk] + Subquery #3 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_net_paid)),avg(ss_net_paid),sum,count] + InputAdapter + Exchange #3 + WholeStageCodegen (1) + HashAggregate [ss_net_paid] [sum,count,sum,count] + Project [ss_net_paid] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_net_paid,ss_sold_date_sk] + Subquery #4 + WholeStageCodegen (2) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #4 + WholeStageCodegen (1) + HashAggregate [count,count] + Project + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_sold_date_sk] + Subquery #5 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_ext_discount_amt)),avg(ss_ext_discount_amt),sum,count] + InputAdapter + Exchange #5 + WholeStageCodegen (1) + HashAggregate [ss_ext_discount_amt] [sum,count,sum,count] + Project [ss_ext_discount_amt] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_ext_discount_amt,ss_sold_date_sk] + Subquery #6 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_net_paid)),avg(ss_net_paid),sum,count] + InputAdapter + Exchange #6 + WholeStageCodegen (1) + HashAggregate [ss_net_paid] [sum,count,sum,count] + Project [ss_net_paid] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_net_paid,ss_sold_date_sk] + Subquery #7 + WholeStageCodegen (2) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #7 + WholeStageCodegen (1) + HashAggregate [count,count] + Project + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_sold_date_sk] + Subquery #8 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_ext_discount_amt)),avg(ss_ext_discount_amt),sum,count] + InputAdapter + Exchange #8 + WholeStageCodegen (1) + HashAggregate [ss_ext_discount_amt] [sum,count,sum,count] + Project [ss_ext_discount_amt] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_ext_discount_amt,ss_sold_date_sk] + Subquery #9 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_net_paid)),avg(ss_net_paid),sum,count] + InputAdapter + Exchange #9 + WholeStageCodegen (1) + HashAggregate [ss_net_paid] [sum,count,sum,count] + Project [ss_net_paid] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_net_paid,ss_sold_date_sk] + Subquery #10 + WholeStageCodegen (2) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #10 + WholeStageCodegen (1) + HashAggregate [count,count] + Project + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_sold_date_sk] + Subquery #11 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_ext_discount_amt)),avg(ss_ext_discount_amt),sum,count] + InputAdapter + Exchange #11 + WholeStageCodegen (1) + HashAggregate [ss_ext_discount_amt] [sum,count,sum,count] + Project [ss_ext_discount_amt] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_ext_discount_amt,ss_sold_date_sk] + Subquery #12 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_net_paid)),avg(ss_net_paid),sum,count] + InputAdapter + Exchange #12 + WholeStageCodegen (1) + HashAggregate [ss_net_paid] [sum,count,sum,count] + Project [ss_net_paid] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_net_paid,ss_sold_date_sk] + Subquery #13 + WholeStageCodegen (2) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #13 + WholeStageCodegen (1) + HashAggregate [count,count] + Project + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_sold_date_sk] + Subquery #14 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_ext_discount_amt)),avg(ss_ext_discount_amt),sum,count] + InputAdapter + Exchange #14 + WholeStageCodegen (1) + HashAggregate [ss_ext_discount_amt] [sum,count,sum,count] + Project [ss_ext_discount_amt] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_ext_discount_amt,ss_sold_date_sk] + Subquery #15 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_net_paid)),avg(ss_net_paid),sum,count] + InputAdapter + Exchange #15 + WholeStageCodegen (1) + HashAggregate [ss_net_paid] [sum,count,sum,count] + Project [ss_net_paid] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_net_paid,ss_sold_date_sk] + Filter [r_reason_sk] + ColumnarToRow + InputAdapter + Scan parquet default.reason [r_reason_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q9/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q9/explain.txt new file mode 100644 index 0000000000000..8736c9861a5ce --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q9/explain.txt @@ -0,0 +1,718 @@ +== Physical Plan == +* Project (4) ++- * Filter (3) + +- * ColumnarToRow (2) + +- Scan parquet default.reason (1) + + +(1) Scan parquet default.reason +Output [1]: [r_reason_sk#1] +Batched: true +Location [not included in comparison]/{warehouse_dir}/reason] +PushedFilters: [IsNotNull(r_reason_sk), EqualTo(r_reason_sk,1)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [1]: [r_reason_sk#1] + +(3) Filter [codegen id : 1] +Input [1]: [r_reason_sk#1] +Condition : (isnotnull(r_reason_sk#1) AND (r_reason_sk#1 = 1)) + +(4) Project [codegen id : 1] +Output [5]: [CASE WHEN (Subquery scalar-subquery#2, [id=#3] > 62316685) THEN Subquery scalar-subquery#4, [id=#5] ELSE Subquery scalar-subquery#6, [id=#7] END AS bucket1#8, CASE WHEN (Subquery scalar-subquery#9, [id=#10] > 19045798) THEN Subquery scalar-subquery#11, [id=#12] ELSE Subquery scalar-subquery#13, [id=#14] END AS bucket2#15, CASE WHEN (Subquery scalar-subquery#16, [id=#17] > 365541424) THEN Subquery scalar-subquery#18, [id=#19] ELSE Subquery scalar-subquery#20, [id=#21] END AS bucket3#22, CASE WHEN (Subquery scalar-subquery#23, [id=#24] > 216357808) THEN Subquery scalar-subquery#25, [id=#26] ELSE Subquery scalar-subquery#27, [id=#28] END AS bucket4#29, CASE WHEN (Subquery scalar-subquery#30, [id=#31] > 184483884) THEN Subquery scalar-subquery#32, [id=#33] ELSE Subquery scalar-subquery#34, [id=#35] END AS bucket5#36] +Input [1]: [r_reason_sk#1] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#2, [id=#3] +* HashAggregate (11) ++- Exchange (10) + +- * HashAggregate (9) + +- * Project (8) + +- * Filter (7) + +- * ColumnarToRow (6) + +- Scan parquet default.store_sales (5) + + +(5) Scan parquet default.store_sales +Output [2]: [ss_quantity#37, ss_sold_date_sk#38] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,1), LessThanOrEqual(ss_quantity,20)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [2]: [ss_quantity#37, ss_sold_date_sk#38] + +(7) Filter [codegen id : 1] +Input [2]: [ss_quantity#37, ss_sold_date_sk#38] +Condition : ((isnotnull(ss_quantity#37) AND (ss_quantity#37 >= 1)) AND (ss_quantity#37 <= 20)) + +(8) Project [codegen id : 1] +Output: [] +Input [2]: [ss_quantity#37, ss_sold_date_sk#38] + +(9) HashAggregate [codegen id : 1] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#39] +Results [1]: [count#40] + +(10) Exchange +Input [1]: [count#40] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#41] + +(11) HashAggregate [codegen id : 2] +Input [1]: [count#40] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#42] +Results [1]: [count(1)#42 AS count(1)#43] + +Subquery:2 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#4, [id=#5] +* HashAggregate (18) ++- Exchange (17) + +- * HashAggregate (16) + +- * Project (15) + +- * Filter (14) + +- * ColumnarToRow (13) + +- Scan parquet default.store_sales (12) + + +(12) Scan parquet default.store_sales +Output [3]: [ss_quantity#44, ss_ext_discount_amt#45, ss_sold_date_sk#46] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,1), LessThanOrEqual(ss_quantity,20)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#44, ss_ext_discount_amt#45, ss_sold_date_sk#46] + +(14) Filter [codegen id : 1] +Input [3]: [ss_quantity#44, ss_ext_discount_amt#45, ss_sold_date_sk#46] +Condition : ((isnotnull(ss_quantity#44) AND (ss_quantity#44 >= 1)) AND (ss_quantity#44 <= 20)) + +(15) Project [codegen id : 1] +Output [1]: [ss_ext_discount_amt#45] +Input [3]: [ss_quantity#44, ss_ext_discount_amt#45, ss_sold_date_sk#46] + +(16) HashAggregate [codegen id : 1] +Input [1]: [ss_ext_discount_amt#45] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_ext_discount_amt#45))] +Aggregate Attributes [2]: [sum#47, count#48] +Results [2]: [sum#49, count#50] + +(17) Exchange +Input [2]: [sum#49, count#50] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#51] + +(18) HashAggregate [codegen id : 2] +Input [2]: [sum#49, count#50] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_ext_discount_amt#45))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_ext_discount_amt#45))#52] +Results [1]: [cast((avg(UnscaledValue(ss_ext_discount_amt#45))#52 / 100.0) as decimal(11,6)) AS avg(ss_ext_discount_amt)#53] + +Subquery:3 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#6, [id=#7] +* HashAggregate (25) ++- Exchange (24) + +- * HashAggregate (23) + +- * Project (22) + +- * Filter (21) + +- * ColumnarToRow (20) + +- Scan parquet default.store_sales (19) + + +(19) Scan parquet default.store_sales +Output [3]: [ss_quantity#54, ss_net_paid#55, ss_sold_date_sk#56] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,1), LessThanOrEqual(ss_quantity,20)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#54, ss_net_paid#55, ss_sold_date_sk#56] + +(21) Filter [codegen id : 1] +Input [3]: [ss_quantity#54, ss_net_paid#55, ss_sold_date_sk#56] +Condition : ((isnotnull(ss_quantity#54) AND (ss_quantity#54 >= 1)) AND (ss_quantity#54 <= 20)) + +(22) Project [codegen id : 1] +Output [1]: [ss_net_paid#55] +Input [3]: [ss_quantity#54, ss_net_paid#55, ss_sold_date_sk#56] + +(23) HashAggregate [codegen id : 1] +Input [1]: [ss_net_paid#55] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_net_paid#55))] +Aggregate Attributes [2]: [sum#57, count#58] +Results [2]: [sum#59, count#60] + +(24) Exchange +Input [2]: [sum#59, count#60] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#61] + +(25) HashAggregate [codegen id : 2] +Input [2]: [sum#59, count#60] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_net_paid#55))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_paid#55))#62] +Results [1]: [cast((avg(UnscaledValue(ss_net_paid#55))#62 / 100.0) as decimal(11,6)) AS avg(ss_net_paid)#63] + +Subquery:4 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#9, [id=#10] +* HashAggregate (32) ++- Exchange (31) + +- * HashAggregate (30) + +- * Project (29) + +- * Filter (28) + +- * ColumnarToRow (27) + +- Scan parquet default.store_sales (26) + + +(26) Scan parquet default.store_sales +Output [2]: [ss_quantity#64, ss_sold_date_sk#65] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,21), LessThanOrEqual(ss_quantity,40)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 1] +Input [2]: [ss_quantity#64, ss_sold_date_sk#65] + +(28) Filter [codegen id : 1] +Input [2]: [ss_quantity#64, ss_sold_date_sk#65] +Condition : ((isnotnull(ss_quantity#64) AND (ss_quantity#64 >= 21)) AND (ss_quantity#64 <= 40)) + +(29) Project [codegen id : 1] +Output: [] +Input [2]: [ss_quantity#64, ss_sold_date_sk#65] + +(30) HashAggregate [codegen id : 1] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#66] +Results [1]: [count#67] + +(31) Exchange +Input [1]: [count#67] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#68] + +(32) HashAggregate [codegen id : 2] +Input [1]: [count#67] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#69] +Results [1]: [count(1)#69 AS count(1)#70] + +Subquery:5 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#11, [id=#12] +* HashAggregate (39) ++- Exchange (38) + +- * HashAggregate (37) + +- * Project (36) + +- * Filter (35) + +- * ColumnarToRow (34) + +- Scan parquet default.store_sales (33) + + +(33) Scan parquet default.store_sales +Output [3]: [ss_quantity#71, ss_ext_discount_amt#72, ss_sold_date_sk#73] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,21), LessThanOrEqual(ss_quantity,40)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#71, ss_ext_discount_amt#72, ss_sold_date_sk#73] + +(35) Filter [codegen id : 1] +Input [3]: [ss_quantity#71, ss_ext_discount_amt#72, ss_sold_date_sk#73] +Condition : ((isnotnull(ss_quantity#71) AND (ss_quantity#71 >= 21)) AND (ss_quantity#71 <= 40)) + +(36) Project [codegen id : 1] +Output [1]: [ss_ext_discount_amt#72] +Input [3]: [ss_quantity#71, ss_ext_discount_amt#72, ss_sold_date_sk#73] + +(37) HashAggregate [codegen id : 1] +Input [1]: [ss_ext_discount_amt#72] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_ext_discount_amt#72))] +Aggregate Attributes [2]: [sum#74, count#75] +Results [2]: [sum#76, count#77] + +(38) Exchange +Input [2]: [sum#76, count#77] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#78] + +(39) HashAggregate [codegen id : 2] +Input [2]: [sum#76, count#77] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_ext_discount_amt#72))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_ext_discount_amt#72))#79] +Results [1]: [cast((avg(UnscaledValue(ss_ext_discount_amt#72))#79 / 100.0) as decimal(11,6)) AS avg(ss_ext_discount_amt)#80] + +Subquery:6 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#13, [id=#14] +* HashAggregate (46) ++- Exchange (45) + +- * HashAggregate (44) + +- * Project (43) + +- * Filter (42) + +- * ColumnarToRow (41) + +- Scan parquet default.store_sales (40) + + +(40) Scan parquet default.store_sales +Output [3]: [ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#83] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,21), LessThanOrEqual(ss_quantity,40)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#83] + +(42) Filter [codegen id : 1] +Input [3]: [ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#83] +Condition : ((isnotnull(ss_quantity#81) AND (ss_quantity#81 >= 21)) AND (ss_quantity#81 <= 40)) + +(43) Project [codegen id : 1] +Output [1]: [ss_net_paid#82] +Input [3]: [ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#83] + +(44) HashAggregate [codegen id : 1] +Input [1]: [ss_net_paid#82] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_net_paid#82))] +Aggregate Attributes [2]: [sum#84, count#85] +Results [2]: [sum#86, count#87] + +(45) Exchange +Input [2]: [sum#86, count#87] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#88] + +(46) HashAggregate [codegen id : 2] +Input [2]: [sum#86, count#87] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_net_paid#82))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_paid#82))#89] +Results [1]: [cast((avg(UnscaledValue(ss_net_paid#82))#89 / 100.0) as decimal(11,6)) AS avg(ss_net_paid)#90] + +Subquery:7 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#16, [id=#17] +* HashAggregate (53) ++- Exchange (52) + +- * HashAggregate (51) + +- * Project (50) + +- * Filter (49) + +- * ColumnarToRow (48) + +- Scan parquet default.store_sales (47) + + +(47) Scan parquet default.store_sales +Output [2]: [ss_quantity#91, ss_sold_date_sk#92] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,41), LessThanOrEqual(ss_quantity,60)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 1] +Input [2]: [ss_quantity#91, ss_sold_date_sk#92] + +(49) Filter [codegen id : 1] +Input [2]: [ss_quantity#91, ss_sold_date_sk#92] +Condition : ((isnotnull(ss_quantity#91) AND (ss_quantity#91 >= 41)) AND (ss_quantity#91 <= 60)) + +(50) Project [codegen id : 1] +Output: [] +Input [2]: [ss_quantity#91, ss_sold_date_sk#92] + +(51) HashAggregate [codegen id : 1] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#93] +Results [1]: [count#94] + +(52) Exchange +Input [1]: [count#94] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#95] + +(53) HashAggregate [codegen id : 2] +Input [1]: [count#94] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#96] +Results [1]: [count(1)#96 AS count(1)#97] + +Subquery:8 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#18, [id=#19] +* HashAggregate (60) ++- Exchange (59) + +- * HashAggregate (58) + +- * Project (57) + +- * Filter (56) + +- * ColumnarToRow (55) + +- Scan parquet default.store_sales (54) + + +(54) Scan parquet default.store_sales +Output [3]: [ss_quantity#98, ss_ext_discount_amt#99, ss_sold_date_sk#100] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,41), LessThanOrEqual(ss_quantity,60)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#98, ss_ext_discount_amt#99, ss_sold_date_sk#100] + +(56) Filter [codegen id : 1] +Input [3]: [ss_quantity#98, ss_ext_discount_amt#99, ss_sold_date_sk#100] +Condition : ((isnotnull(ss_quantity#98) AND (ss_quantity#98 >= 41)) AND (ss_quantity#98 <= 60)) + +(57) Project [codegen id : 1] +Output [1]: [ss_ext_discount_amt#99] +Input [3]: [ss_quantity#98, ss_ext_discount_amt#99, ss_sold_date_sk#100] + +(58) HashAggregate [codegen id : 1] +Input [1]: [ss_ext_discount_amt#99] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_ext_discount_amt#99))] +Aggregate Attributes [2]: [sum#101, count#102] +Results [2]: [sum#103, count#104] + +(59) Exchange +Input [2]: [sum#103, count#104] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#105] + +(60) HashAggregate [codegen id : 2] +Input [2]: [sum#103, count#104] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_ext_discount_amt#99))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_ext_discount_amt#99))#106] +Results [1]: [cast((avg(UnscaledValue(ss_ext_discount_amt#99))#106 / 100.0) as decimal(11,6)) AS avg(ss_ext_discount_amt)#107] + +Subquery:9 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#20, [id=#21] +* HashAggregate (67) ++- Exchange (66) + +- * HashAggregate (65) + +- * Project (64) + +- * Filter (63) + +- * ColumnarToRow (62) + +- Scan parquet default.store_sales (61) + + +(61) Scan parquet default.store_sales +Output [3]: [ss_quantity#108, ss_net_paid#109, ss_sold_date_sk#110] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,41), LessThanOrEqual(ss_quantity,60)] +ReadSchema: struct + +(62) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#108, ss_net_paid#109, ss_sold_date_sk#110] + +(63) Filter [codegen id : 1] +Input [3]: [ss_quantity#108, ss_net_paid#109, ss_sold_date_sk#110] +Condition : ((isnotnull(ss_quantity#108) AND (ss_quantity#108 >= 41)) AND (ss_quantity#108 <= 60)) + +(64) Project [codegen id : 1] +Output [1]: [ss_net_paid#109] +Input [3]: [ss_quantity#108, ss_net_paid#109, ss_sold_date_sk#110] + +(65) HashAggregate [codegen id : 1] +Input [1]: [ss_net_paid#109] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_net_paid#109))] +Aggregate Attributes [2]: [sum#111, count#112] +Results [2]: [sum#113, count#114] + +(66) Exchange +Input [2]: [sum#113, count#114] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#115] + +(67) HashAggregate [codegen id : 2] +Input [2]: [sum#113, count#114] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_net_paid#109))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_paid#109))#116] +Results [1]: [cast((avg(UnscaledValue(ss_net_paid#109))#116 / 100.0) as decimal(11,6)) AS avg(ss_net_paid)#117] + +Subquery:10 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#23, [id=#24] +* HashAggregate (74) ++- Exchange (73) + +- * HashAggregate (72) + +- * Project (71) + +- * Filter (70) + +- * ColumnarToRow (69) + +- Scan parquet default.store_sales (68) + + +(68) Scan parquet default.store_sales +Output [2]: [ss_quantity#118, ss_sold_date_sk#119] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,61), LessThanOrEqual(ss_quantity,80)] +ReadSchema: struct + +(69) ColumnarToRow [codegen id : 1] +Input [2]: [ss_quantity#118, ss_sold_date_sk#119] + +(70) Filter [codegen id : 1] +Input [2]: [ss_quantity#118, ss_sold_date_sk#119] +Condition : ((isnotnull(ss_quantity#118) AND (ss_quantity#118 >= 61)) AND (ss_quantity#118 <= 80)) + +(71) Project [codegen id : 1] +Output: [] +Input [2]: [ss_quantity#118, ss_sold_date_sk#119] + +(72) HashAggregate [codegen id : 1] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#120] +Results [1]: [count#121] + +(73) Exchange +Input [1]: [count#121] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#122] + +(74) HashAggregate [codegen id : 2] +Input [1]: [count#121] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#123] +Results [1]: [count(1)#123 AS count(1)#124] + +Subquery:11 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#25, [id=#26] +* HashAggregate (81) ++- Exchange (80) + +- * HashAggregate (79) + +- * Project (78) + +- * Filter (77) + +- * ColumnarToRow (76) + +- Scan parquet default.store_sales (75) + + +(75) Scan parquet default.store_sales +Output [3]: [ss_quantity#125, ss_ext_discount_amt#126, ss_sold_date_sk#127] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,61), LessThanOrEqual(ss_quantity,80)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#125, ss_ext_discount_amt#126, ss_sold_date_sk#127] + +(77) Filter [codegen id : 1] +Input [3]: [ss_quantity#125, ss_ext_discount_amt#126, ss_sold_date_sk#127] +Condition : ((isnotnull(ss_quantity#125) AND (ss_quantity#125 >= 61)) AND (ss_quantity#125 <= 80)) + +(78) Project [codegen id : 1] +Output [1]: [ss_ext_discount_amt#126] +Input [3]: [ss_quantity#125, ss_ext_discount_amt#126, ss_sold_date_sk#127] + +(79) HashAggregate [codegen id : 1] +Input [1]: [ss_ext_discount_amt#126] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_ext_discount_amt#126))] +Aggregate Attributes [2]: [sum#128, count#129] +Results [2]: [sum#130, count#131] + +(80) Exchange +Input [2]: [sum#130, count#131] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#132] + +(81) HashAggregate [codegen id : 2] +Input [2]: [sum#130, count#131] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_ext_discount_amt#126))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_ext_discount_amt#126))#133] +Results [1]: [cast((avg(UnscaledValue(ss_ext_discount_amt#126))#133 / 100.0) as decimal(11,6)) AS avg(ss_ext_discount_amt)#134] + +Subquery:12 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#27, [id=#28] +* HashAggregate (88) ++- Exchange (87) + +- * HashAggregate (86) + +- * Project (85) + +- * Filter (84) + +- * ColumnarToRow (83) + +- Scan parquet default.store_sales (82) + + +(82) Scan parquet default.store_sales +Output [3]: [ss_quantity#135, ss_net_paid#136, ss_sold_date_sk#137] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,61), LessThanOrEqual(ss_quantity,80)] +ReadSchema: struct + +(83) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#135, ss_net_paid#136, ss_sold_date_sk#137] + +(84) Filter [codegen id : 1] +Input [3]: [ss_quantity#135, ss_net_paid#136, ss_sold_date_sk#137] +Condition : ((isnotnull(ss_quantity#135) AND (ss_quantity#135 >= 61)) AND (ss_quantity#135 <= 80)) + +(85) Project [codegen id : 1] +Output [1]: [ss_net_paid#136] +Input [3]: [ss_quantity#135, ss_net_paid#136, ss_sold_date_sk#137] + +(86) HashAggregate [codegen id : 1] +Input [1]: [ss_net_paid#136] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_net_paid#136))] +Aggregate Attributes [2]: [sum#138, count#139] +Results [2]: [sum#140, count#141] + +(87) Exchange +Input [2]: [sum#140, count#141] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#142] + +(88) HashAggregate [codegen id : 2] +Input [2]: [sum#140, count#141] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_net_paid#136))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_paid#136))#143] +Results [1]: [cast((avg(UnscaledValue(ss_net_paid#136))#143 / 100.0) as decimal(11,6)) AS avg(ss_net_paid)#144] + +Subquery:13 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#30, [id=#31] +* HashAggregate (95) ++- Exchange (94) + +- * HashAggregate (93) + +- * Project (92) + +- * Filter (91) + +- * ColumnarToRow (90) + +- Scan parquet default.store_sales (89) + + +(89) Scan parquet default.store_sales +Output [2]: [ss_quantity#145, ss_sold_date_sk#146] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,81), LessThanOrEqual(ss_quantity,100)] +ReadSchema: struct + +(90) ColumnarToRow [codegen id : 1] +Input [2]: [ss_quantity#145, ss_sold_date_sk#146] + +(91) Filter [codegen id : 1] +Input [2]: [ss_quantity#145, ss_sold_date_sk#146] +Condition : ((isnotnull(ss_quantity#145) AND (ss_quantity#145 >= 81)) AND (ss_quantity#145 <= 100)) + +(92) Project [codegen id : 1] +Output: [] +Input [2]: [ss_quantity#145, ss_sold_date_sk#146] + +(93) HashAggregate [codegen id : 1] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#147] +Results [1]: [count#148] + +(94) Exchange +Input [1]: [count#148] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#149] + +(95) HashAggregate [codegen id : 2] +Input [1]: [count#148] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#150] +Results [1]: [count(1)#150 AS count(1)#151] + +Subquery:14 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#32, [id=#33] +* HashAggregate (102) ++- Exchange (101) + +- * HashAggregate (100) + +- * Project (99) + +- * Filter (98) + +- * ColumnarToRow (97) + +- Scan parquet default.store_sales (96) + + +(96) Scan parquet default.store_sales +Output [3]: [ss_quantity#152, ss_ext_discount_amt#153, ss_sold_date_sk#154] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,81), LessThanOrEqual(ss_quantity,100)] +ReadSchema: struct + +(97) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#152, ss_ext_discount_amt#153, ss_sold_date_sk#154] + +(98) Filter [codegen id : 1] +Input [3]: [ss_quantity#152, ss_ext_discount_amt#153, ss_sold_date_sk#154] +Condition : ((isnotnull(ss_quantity#152) AND (ss_quantity#152 >= 81)) AND (ss_quantity#152 <= 100)) + +(99) Project [codegen id : 1] +Output [1]: [ss_ext_discount_amt#153] +Input [3]: [ss_quantity#152, ss_ext_discount_amt#153, ss_sold_date_sk#154] + +(100) HashAggregate [codegen id : 1] +Input [1]: [ss_ext_discount_amt#153] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_ext_discount_amt#153))] +Aggregate Attributes [2]: [sum#155, count#156] +Results [2]: [sum#157, count#158] + +(101) Exchange +Input [2]: [sum#157, count#158] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#159] + +(102) HashAggregate [codegen id : 2] +Input [2]: [sum#157, count#158] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_ext_discount_amt#153))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_ext_discount_amt#153))#160] +Results [1]: [cast((avg(UnscaledValue(ss_ext_discount_amt#153))#160 / 100.0) as decimal(11,6)) AS avg(ss_ext_discount_amt)#161] + +Subquery:15 Hosting operator id = 4 Hosting Expression = Subquery scalar-subquery#34, [id=#35] +* HashAggregate (109) ++- Exchange (108) + +- * HashAggregate (107) + +- * Project (106) + +- * Filter (105) + +- * ColumnarToRow (104) + +- Scan parquet default.store_sales (103) + + +(103) Scan parquet default.store_sales +Output [3]: [ss_quantity#162, ss_net_paid#163, ss_sold_date_sk#164] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_quantity), GreaterThanOrEqual(ss_quantity,81), LessThanOrEqual(ss_quantity,100)] +ReadSchema: struct + +(104) ColumnarToRow [codegen id : 1] +Input [3]: [ss_quantity#162, ss_net_paid#163, ss_sold_date_sk#164] + +(105) Filter [codegen id : 1] +Input [3]: [ss_quantity#162, ss_net_paid#163, ss_sold_date_sk#164] +Condition : ((isnotnull(ss_quantity#162) AND (ss_quantity#162 >= 81)) AND (ss_quantity#162 <= 100)) + +(106) Project [codegen id : 1] +Output [1]: [ss_net_paid#163] +Input [3]: [ss_quantity#162, ss_net_paid#163, ss_sold_date_sk#164] + +(107) HashAggregate [codegen id : 1] +Input [1]: [ss_net_paid#163] +Keys: [] +Functions [1]: [partial_avg(UnscaledValue(ss_net_paid#163))] +Aggregate Attributes [2]: [sum#165, count#166] +Results [2]: [sum#167, count#168] + +(108) Exchange +Input [2]: [sum#167, count#168] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#169] + +(109) HashAggregate [codegen id : 2] +Input [2]: [sum#167, count#168] +Keys: [] +Functions [1]: [avg(UnscaledValue(ss_net_paid#163))] +Aggregate Attributes [1]: [avg(UnscaledValue(ss_net_paid#163))#170] +Results [1]: [cast((avg(UnscaledValue(ss_net_paid#163))#170 / 100.0) as decimal(11,6)) AS avg(ss_net_paid)#171] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q9/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q9/simplified.txt new file mode 100644 index 0000000000000..1c42d8f2638c6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q9/simplified.txt @@ -0,0 +1,186 @@ +WholeStageCodegen (1) + Project + Subquery #1 + WholeStageCodegen (2) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #1 + WholeStageCodegen (1) + HashAggregate [count,count] + Project + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_sold_date_sk] + Subquery #2 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_ext_discount_amt)),avg(ss_ext_discount_amt),sum,count] + InputAdapter + Exchange #2 + WholeStageCodegen (1) + HashAggregate [ss_ext_discount_amt] [sum,count,sum,count] + Project [ss_ext_discount_amt] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_ext_discount_amt,ss_sold_date_sk] + Subquery #3 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_net_paid)),avg(ss_net_paid),sum,count] + InputAdapter + Exchange #3 + WholeStageCodegen (1) + HashAggregate [ss_net_paid] [sum,count,sum,count] + Project [ss_net_paid] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_net_paid,ss_sold_date_sk] + Subquery #4 + WholeStageCodegen (2) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #4 + WholeStageCodegen (1) + HashAggregate [count,count] + Project + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_sold_date_sk] + Subquery #5 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_ext_discount_amt)),avg(ss_ext_discount_amt),sum,count] + InputAdapter + Exchange #5 + WholeStageCodegen (1) + HashAggregate [ss_ext_discount_amt] [sum,count,sum,count] + Project [ss_ext_discount_amt] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_ext_discount_amt,ss_sold_date_sk] + Subquery #6 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_net_paid)),avg(ss_net_paid),sum,count] + InputAdapter + Exchange #6 + WholeStageCodegen (1) + HashAggregate [ss_net_paid] [sum,count,sum,count] + Project [ss_net_paid] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_net_paid,ss_sold_date_sk] + Subquery #7 + WholeStageCodegen (2) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #7 + WholeStageCodegen (1) + HashAggregate [count,count] + Project + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_sold_date_sk] + Subquery #8 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_ext_discount_amt)),avg(ss_ext_discount_amt),sum,count] + InputAdapter + Exchange #8 + WholeStageCodegen (1) + HashAggregate [ss_ext_discount_amt] [sum,count,sum,count] + Project [ss_ext_discount_amt] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_ext_discount_amt,ss_sold_date_sk] + Subquery #9 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_net_paid)),avg(ss_net_paid),sum,count] + InputAdapter + Exchange #9 + WholeStageCodegen (1) + HashAggregate [ss_net_paid] [sum,count,sum,count] + Project [ss_net_paid] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_net_paid,ss_sold_date_sk] + Subquery #10 + WholeStageCodegen (2) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #10 + WholeStageCodegen (1) + HashAggregate [count,count] + Project + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_sold_date_sk] + Subquery #11 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_ext_discount_amt)),avg(ss_ext_discount_amt),sum,count] + InputAdapter + Exchange #11 + WholeStageCodegen (1) + HashAggregate [ss_ext_discount_amt] [sum,count,sum,count] + Project [ss_ext_discount_amt] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_ext_discount_amt,ss_sold_date_sk] + Subquery #12 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_net_paid)),avg(ss_net_paid),sum,count] + InputAdapter + Exchange #12 + WholeStageCodegen (1) + HashAggregate [ss_net_paid] [sum,count,sum,count] + Project [ss_net_paid] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_net_paid,ss_sold_date_sk] + Subquery #13 + WholeStageCodegen (2) + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #13 + WholeStageCodegen (1) + HashAggregate [count,count] + Project + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_sold_date_sk] + Subquery #14 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_ext_discount_amt)),avg(ss_ext_discount_amt),sum,count] + InputAdapter + Exchange #14 + WholeStageCodegen (1) + HashAggregate [ss_ext_discount_amt] [sum,count,sum,count] + Project [ss_ext_discount_amt] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_ext_discount_amt,ss_sold_date_sk] + Subquery #15 + WholeStageCodegen (2) + HashAggregate [sum,count] [avg(UnscaledValue(ss_net_paid)),avg(ss_net_paid),sum,count] + InputAdapter + Exchange #15 + WholeStageCodegen (1) + HashAggregate [ss_net_paid] [sum,count,sum,count] + Project [ss_net_paid] + Filter [ss_quantity] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_net_paid,ss_sold_date_sk] + Filter [r_reason_sk] + ColumnarToRow + InputAdapter + Scan parquet default.reason [r_reason_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q90.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q90.sf100/explain.txt new file mode 100644 index 0000000000000..5226fce4ef512 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q90.sf100/explain.txt @@ -0,0 +1,290 @@ +== Physical Plan == +* Sort (52) ++- * Project (51) + +- * BroadcastNestedLoopJoin Inner BuildRight (50) + :- * HashAggregate (28) + : +- Exchange (27) + : +- * HashAggregate (26) + : +- * Project (25) + : +- * BroadcastHashJoin Inner BuildRight (24) + : :- * Project (18) + : : +- * BroadcastHashJoin Inner BuildRight (17) + : : :- * Project (11) + : : : +- * BroadcastHashJoin Inner BuildRight (10) + : : : :- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.web_sales (1) + : : : +- BroadcastExchange (9) + : : : +- * Project (8) + : : : +- * Filter (7) + : : : +- * ColumnarToRow (6) + : : : +- Scan parquet default.web_page (5) + : : +- BroadcastExchange (16) + : : +- * Project (15) + : : +- * Filter (14) + : : +- * ColumnarToRow (13) + : : +- Scan parquet default.household_demographics (12) + : +- BroadcastExchange (23) + : +- * Project (22) + : +- * Filter (21) + : +- * ColumnarToRow (20) + : +- Scan parquet default.time_dim (19) + +- BroadcastExchange (49) + +- * HashAggregate (48) + +- Exchange (47) + +- * HashAggregate (46) + +- * Project (45) + +- * BroadcastHashJoin Inner BuildRight (44) + :- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Project (35) + : : +- * BroadcastHashJoin Inner BuildRight (34) + : : :- * Project (32) + : : : +- * Filter (31) + : : : +- * ColumnarToRow (30) + : : : +- Scan parquet default.web_sales (29) + : : +- ReusedExchange (33) + : +- ReusedExchange (36) + +- BroadcastExchange (43) + +- * Project (42) + +- * Filter (41) + +- * ColumnarToRow (40) + +- Scan parquet default.time_dim (39) + + +(1) Scan parquet default.web_sales +Output [4]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, ws_web_page_sk#3, ws_sold_date_sk#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_ship_hdemo_sk), IsNotNull(ws_sold_time_sk), IsNotNull(ws_web_page_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, ws_web_page_sk#3, ws_sold_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, ws_web_page_sk#3, ws_sold_date_sk#4] +Condition : ((isnotnull(ws_ship_hdemo_sk#2) AND isnotnull(ws_sold_time_sk#1)) AND isnotnull(ws_web_page_sk#3)) + +(4) Project [codegen id : 4] +Output [3]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, ws_web_page_sk#3] +Input [4]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, ws_web_page_sk#3, ws_sold_date_sk#4] + +(5) Scan parquet default.web_page +Output [2]: [wp_web_page_sk#5, wp_char_count#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_page] +PushedFilters: [IsNotNull(wp_char_count), GreaterThanOrEqual(wp_char_count,5000), LessThanOrEqual(wp_char_count,5200), IsNotNull(wp_web_page_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [2]: [wp_web_page_sk#5, wp_char_count#6] + +(7) Filter [codegen id : 1] +Input [2]: [wp_web_page_sk#5, wp_char_count#6] +Condition : (((isnotnull(wp_char_count#6) AND (wp_char_count#6 >= 5000)) AND (wp_char_count#6 <= 5200)) AND isnotnull(wp_web_page_sk#5)) + +(8) Project [codegen id : 1] +Output [1]: [wp_web_page_sk#5] +Input [2]: [wp_web_page_sk#5, wp_char_count#6] + +(9) BroadcastExchange +Input [1]: [wp_web_page_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(10) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_web_page_sk#3] +Right keys [1]: [wp_web_page_sk#5] +Join condition: None + +(11) Project [codegen id : 4] +Output [2]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2] +Input [4]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, ws_web_page_sk#3, wp_web_page_sk#5] + +(12) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#8, hd_dep_count#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_dep_count), EqualTo(hd_dep_count,6), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 2] +Input [2]: [hd_demo_sk#8, hd_dep_count#9] + +(14) Filter [codegen id : 2] +Input [2]: [hd_demo_sk#8, hd_dep_count#9] +Condition : ((isnotnull(hd_dep_count#9) AND (hd_dep_count#9 = 6)) AND isnotnull(hd_demo_sk#8)) + +(15) Project [codegen id : 2] +Output [1]: [hd_demo_sk#8] +Input [2]: [hd_demo_sk#8, hd_dep_count#9] + +(16) BroadcastExchange +Input [1]: [hd_demo_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(17) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_ship_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#8] +Join condition: None + +(18) Project [codegen id : 4] +Output [1]: [ws_sold_time_sk#1] +Input [3]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, hd_demo_sk#8] + +(19) Scan parquet default.time_dim +Output [2]: [t_time_sk#11, t_hour#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), GreaterThanOrEqual(t_hour,8), LessThanOrEqual(t_hour,9), IsNotNull(t_time_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 3] +Input [2]: [t_time_sk#11, t_hour#12] + +(21) Filter [codegen id : 3] +Input [2]: [t_time_sk#11, t_hour#12] +Condition : (((isnotnull(t_hour#12) AND (t_hour#12 >= 8)) AND (t_hour#12 <= 9)) AND isnotnull(t_time_sk#11)) + +(22) Project [codegen id : 3] +Output [1]: [t_time_sk#11] +Input [2]: [t_time_sk#11, t_hour#12] + +(23) BroadcastExchange +Input [1]: [t_time_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(24) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_sold_time_sk#1] +Right keys [1]: [t_time_sk#11] +Join condition: None + +(25) Project [codegen id : 4] +Output: [] +Input [2]: [ws_sold_time_sk#1, t_time_sk#11] + +(26) HashAggregate [codegen id : 4] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#14] +Results [1]: [count#15] + +(27) Exchange +Input [1]: [count#15] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#16] + +(28) HashAggregate [codegen id : 10] +Input [1]: [count#15] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#17] +Results [1]: [count(1)#17 AS amc#18] + +(29) Scan parquet default.web_sales +Output [4]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, ws_web_page_sk#21, ws_sold_date_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_ship_hdemo_sk), IsNotNull(ws_sold_time_sk), IsNotNull(ws_web_page_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 8] +Input [4]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, ws_web_page_sk#21, ws_sold_date_sk#22] + +(31) Filter [codegen id : 8] +Input [4]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, ws_web_page_sk#21, ws_sold_date_sk#22] +Condition : ((isnotnull(ws_ship_hdemo_sk#20) AND isnotnull(ws_sold_time_sk#19)) AND isnotnull(ws_web_page_sk#21)) + +(32) Project [codegen id : 8] +Output [3]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, ws_web_page_sk#21] +Input [4]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, ws_web_page_sk#21, ws_sold_date_sk#22] + +(33) ReusedExchange [Reuses operator id: 9] +Output [1]: [wp_web_page_sk#23] + +(34) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_web_page_sk#21] +Right keys [1]: [wp_web_page_sk#23] +Join condition: None + +(35) Project [codegen id : 8] +Output [2]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20] +Input [4]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, ws_web_page_sk#21, wp_web_page_sk#23] + +(36) ReusedExchange [Reuses operator id: 16] +Output [1]: [hd_demo_sk#24] + +(37) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_ship_hdemo_sk#20] +Right keys [1]: [hd_demo_sk#24] +Join condition: None + +(38) Project [codegen id : 8] +Output [1]: [ws_sold_time_sk#19] +Input [3]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, hd_demo_sk#24] + +(39) Scan parquet default.time_dim +Output [2]: [t_time_sk#25, t_hour#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), GreaterThanOrEqual(t_hour,19), LessThanOrEqual(t_hour,20), IsNotNull(t_time_sk)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 7] +Input [2]: [t_time_sk#25, t_hour#26] + +(41) Filter [codegen id : 7] +Input [2]: [t_time_sk#25, t_hour#26] +Condition : (((isnotnull(t_hour#26) AND (t_hour#26 >= 19)) AND (t_hour#26 <= 20)) AND isnotnull(t_time_sk#25)) + +(42) Project [codegen id : 7] +Output [1]: [t_time_sk#25] +Input [2]: [t_time_sk#25, t_hour#26] + +(43) BroadcastExchange +Input [1]: [t_time_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] + +(44) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_sold_time_sk#19] +Right keys [1]: [t_time_sk#25] +Join condition: None + +(45) Project [codegen id : 8] +Output: [] +Input [2]: [ws_sold_time_sk#19, t_time_sk#25] + +(46) HashAggregate [codegen id : 8] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#28] +Results [1]: [count#29] + +(47) Exchange +Input [1]: [count#29] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#30] + +(48) HashAggregate [codegen id : 9] +Input [1]: [count#29] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#31] +Results [1]: [count(1)#31 AS pmc#32] + +(49) BroadcastExchange +Input [1]: [pmc#32] +Arguments: IdentityBroadcastMode, [id=#33] + +(50) BroadcastNestedLoopJoin [codegen id : 10] +Join condition: None + +(51) Project [codegen id : 10] +Output [1]: [CheckOverflow((promote_precision(cast(amc#18 as decimal(15,4))) / promote_precision(cast(pmc#32 as decimal(15,4)))), DecimalType(35,20), true) AS am_pm_ratio#34] +Input [2]: [amc#18, pmc#32] + +(52) Sort [codegen id : 10] +Input [1]: [am_pm_ratio#34] +Arguments: [am_pm_ratio#34 ASC NULLS FIRST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q90.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q90.sf100/simplified.txt new file mode 100644 index 0000000000000..6fed86d7cea43 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q90.sf100/simplified.txt @@ -0,0 +1,75 @@ +WholeStageCodegen (10) + Sort [am_pm_ratio] + Project [amc,pmc] + BroadcastNestedLoopJoin + HashAggregate [count] [count(1),amc,count] + InputAdapter + Exchange #1 + WholeStageCodegen (4) + HashAggregate [count,count] + Project + BroadcastHashJoin [ws_sold_time_sk,t_time_sk] + Project [ws_sold_time_sk] + BroadcastHashJoin [ws_ship_hdemo_sk,hd_demo_sk] + Project [ws_sold_time_sk,ws_ship_hdemo_sk] + BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] + Project [ws_sold_time_sk,ws_ship_hdemo_sk,ws_web_page_sk] + Filter [ws_ship_hdemo_sk,ws_sold_time_sk,ws_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_time_sk,ws_ship_hdemo_sk,ws_web_page_sk,ws_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [wp_web_page_sk] + Filter [wp_char_count,wp_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_page [wp_web_page_sk,wp_char_count] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [t_time_sk] + Filter [t_hour,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + HashAggregate [count] [count(1),pmc,count] + InputAdapter + Exchange #6 + WholeStageCodegen (8) + HashAggregate [count,count] + Project + BroadcastHashJoin [ws_sold_time_sk,t_time_sk] + Project [ws_sold_time_sk] + BroadcastHashJoin [ws_ship_hdemo_sk,hd_demo_sk] + Project [ws_sold_time_sk,ws_ship_hdemo_sk] + BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] + Project [ws_sold_time_sk,ws_ship_hdemo_sk,ws_web_page_sk] + Filter [ws_ship_hdemo_sk,ws_sold_time_sk,ws_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_time_sk,ws_ship_hdemo_sk,ws_web_page_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [wp_web_page_sk] #2 + InputAdapter + ReusedExchange [hd_demo_sk] #3 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (7) + Project [t_time_sk] + Filter [t_hour,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q90/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q90/explain.txt new file mode 100644 index 0000000000000..e369a027040d3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q90/explain.txt @@ -0,0 +1,290 @@ +== Physical Plan == +* Sort (52) ++- * Project (51) + +- * BroadcastNestedLoopJoin Inner BuildRight (50) + :- * HashAggregate (28) + : +- Exchange (27) + : +- * HashAggregate (26) + : +- * Project (25) + : +- * BroadcastHashJoin Inner BuildRight (24) + : :- * Project (18) + : : +- * BroadcastHashJoin Inner BuildRight (17) + : : :- * Project (11) + : : : +- * BroadcastHashJoin Inner BuildRight (10) + : : : :- * Project (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.web_sales (1) + : : : +- BroadcastExchange (9) + : : : +- * Project (8) + : : : +- * Filter (7) + : : : +- * ColumnarToRow (6) + : : : +- Scan parquet default.household_demographics (5) + : : +- BroadcastExchange (16) + : : +- * Project (15) + : : +- * Filter (14) + : : +- * ColumnarToRow (13) + : : +- Scan parquet default.time_dim (12) + : +- BroadcastExchange (23) + : +- * Project (22) + : +- * Filter (21) + : +- * ColumnarToRow (20) + : +- Scan parquet default.web_page (19) + +- BroadcastExchange (49) + +- * HashAggregate (48) + +- Exchange (47) + +- * HashAggregate (46) + +- * Project (45) + +- * BroadcastHashJoin Inner BuildRight (44) + :- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Project (35) + : : +- * BroadcastHashJoin Inner BuildRight (34) + : : :- * Project (32) + : : : +- * Filter (31) + : : : +- * ColumnarToRow (30) + : : : +- Scan parquet default.web_sales (29) + : : +- ReusedExchange (33) + : +- BroadcastExchange (40) + : +- * Project (39) + : +- * Filter (38) + : +- * ColumnarToRow (37) + : +- Scan parquet default.time_dim (36) + +- ReusedExchange (43) + + +(1) Scan parquet default.web_sales +Output [4]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, ws_web_page_sk#3, ws_sold_date_sk#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_ship_hdemo_sk), IsNotNull(ws_sold_time_sk), IsNotNull(ws_web_page_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, ws_web_page_sk#3, ws_sold_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, ws_web_page_sk#3, ws_sold_date_sk#4] +Condition : ((isnotnull(ws_ship_hdemo_sk#2) AND isnotnull(ws_sold_time_sk#1)) AND isnotnull(ws_web_page_sk#3)) + +(4) Project [codegen id : 4] +Output [3]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, ws_web_page_sk#3] +Input [4]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, ws_web_page_sk#3, ws_sold_date_sk#4] + +(5) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#5, hd_dep_count#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_dep_count), EqualTo(hd_dep_count,6), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [2]: [hd_demo_sk#5, hd_dep_count#6] + +(7) Filter [codegen id : 1] +Input [2]: [hd_demo_sk#5, hd_dep_count#6] +Condition : ((isnotnull(hd_dep_count#6) AND (hd_dep_count#6 = 6)) AND isnotnull(hd_demo_sk#5)) + +(8) Project [codegen id : 1] +Output [1]: [hd_demo_sk#5] +Input [2]: [hd_demo_sk#5, hd_dep_count#6] + +(9) BroadcastExchange +Input [1]: [hd_demo_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(10) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_ship_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#5] +Join condition: None + +(11) Project [codegen id : 4] +Output [2]: [ws_sold_time_sk#1, ws_web_page_sk#3] +Input [4]: [ws_sold_time_sk#1, ws_ship_hdemo_sk#2, ws_web_page_sk#3, hd_demo_sk#5] + +(12) Scan parquet default.time_dim +Output [2]: [t_time_sk#8, t_hour#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), GreaterThanOrEqual(t_hour,8), LessThanOrEqual(t_hour,9), IsNotNull(t_time_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 2] +Input [2]: [t_time_sk#8, t_hour#9] + +(14) Filter [codegen id : 2] +Input [2]: [t_time_sk#8, t_hour#9] +Condition : (((isnotnull(t_hour#9) AND (t_hour#9 >= 8)) AND (t_hour#9 <= 9)) AND isnotnull(t_time_sk#8)) + +(15) Project [codegen id : 2] +Output [1]: [t_time_sk#8] +Input [2]: [t_time_sk#8, t_hour#9] + +(16) BroadcastExchange +Input [1]: [t_time_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(17) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_sold_time_sk#1] +Right keys [1]: [t_time_sk#8] +Join condition: None + +(18) Project [codegen id : 4] +Output [1]: [ws_web_page_sk#3] +Input [3]: [ws_sold_time_sk#1, ws_web_page_sk#3, t_time_sk#8] + +(19) Scan parquet default.web_page +Output [2]: [wp_web_page_sk#11, wp_char_count#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_page] +PushedFilters: [IsNotNull(wp_char_count), GreaterThanOrEqual(wp_char_count,5000), LessThanOrEqual(wp_char_count,5200), IsNotNull(wp_web_page_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 3] +Input [2]: [wp_web_page_sk#11, wp_char_count#12] + +(21) Filter [codegen id : 3] +Input [2]: [wp_web_page_sk#11, wp_char_count#12] +Condition : (((isnotnull(wp_char_count#12) AND (wp_char_count#12 >= 5000)) AND (wp_char_count#12 <= 5200)) AND isnotnull(wp_web_page_sk#11)) + +(22) Project [codegen id : 3] +Output [1]: [wp_web_page_sk#11] +Input [2]: [wp_web_page_sk#11, wp_char_count#12] + +(23) BroadcastExchange +Input [1]: [wp_web_page_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(24) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_web_page_sk#3] +Right keys [1]: [wp_web_page_sk#11] +Join condition: None + +(25) Project [codegen id : 4] +Output: [] +Input [2]: [ws_web_page_sk#3, wp_web_page_sk#11] + +(26) HashAggregate [codegen id : 4] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#14] +Results [1]: [count#15] + +(27) Exchange +Input [1]: [count#15] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#16] + +(28) HashAggregate [codegen id : 10] +Input [1]: [count#15] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#17] +Results [1]: [count(1)#17 AS amc#18] + +(29) Scan parquet default.web_sales +Output [4]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, ws_web_page_sk#21, ws_sold_date_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_ship_hdemo_sk), IsNotNull(ws_sold_time_sk), IsNotNull(ws_web_page_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 8] +Input [4]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, ws_web_page_sk#21, ws_sold_date_sk#22] + +(31) Filter [codegen id : 8] +Input [4]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, ws_web_page_sk#21, ws_sold_date_sk#22] +Condition : ((isnotnull(ws_ship_hdemo_sk#20) AND isnotnull(ws_sold_time_sk#19)) AND isnotnull(ws_web_page_sk#21)) + +(32) Project [codegen id : 8] +Output [3]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, ws_web_page_sk#21] +Input [4]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, ws_web_page_sk#21, ws_sold_date_sk#22] + +(33) ReusedExchange [Reuses operator id: 9] +Output [1]: [hd_demo_sk#23] + +(34) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_ship_hdemo_sk#20] +Right keys [1]: [hd_demo_sk#23] +Join condition: None + +(35) Project [codegen id : 8] +Output [2]: [ws_sold_time_sk#19, ws_web_page_sk#21] +Input [4]: [ws_sold_time_sk#19, ws_ship_hdemo_sk#20, ws_web_page_sk#21, hd_demo_sk#23] + +(36) Scan parquet default.time_dim +Output [2]: [t_time_sk#24, t_hour#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), GreaterThanOrEqual(t_hour,19), LessThanOrEqual(t_hour,20), IsNotNull(t_time_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 6] +Input [2]: [t_time_sk#24, t_hour#25] + +(38) Filter [codegen id : 6] +Input [2]: [t_time_sk#24, t_hour#25] +Condition : (((isnotnull(t_hour#25) AND (t_hour#25 >= 19)) AND (t_hour#25 <= 20)) AND isnotnull(t_time_sk#24)) + +(39) Project [codegen id : 6] +Output [1]: [t_time_sk#24] +Input [2]: [t_time_sk#24, t_hour#25] + +(40) BroadcastExchange +Input [1]: [t_time_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] + +(41) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_sold_time_sk#19] +Right keys [1]: [t_time_sk#24] +Join condition: None + +(42) Project [codegen id : 8] +Output [1]: [ws_web_page_sk#21] +Input [3]: [ws_sold_time_sk#19, ws_web_page_sk#21, t_time_sk#24] + +(43) ReusedExchange [Reuses operator id: 23] +Output [1]: [wp_web_page_sk#27] + +(44) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_web_page_sk#21] +Right keys [1]: [wp_web_page_sk#27] +Join condition: None + +(45) Project [codegen id : 8] +Output: [] +Input [2]: [ws_web_page_sk#21, wp_web_page_sk#27] + +(46) HashAggregate [codegen id : 8] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#28] +Results [1]: [count#29] + +(47) Exchange +Input [1]: [count#29] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#30] + +(48) HashAggregate [codegen id : 9] +Input [1]: [count#29] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#31] +Results [1]: [count(1)#31 AS pmc#32] + +(49) BroadcastExchange +Input [1]: [pmc#32] +Arguments: IdentityBroadcastMode, [id=#33] + +(50) BroadcastNestedLoopJoin [codegen id : 10] +Join condition: None + +(51) Project [codegen id : 10] +Output [1]: [CheckOverflow((promote_precision(cast(amc#18 as decimal(15,4))) / promote_precision(cast(pmc#32 as decimal(15,4)))), DecimalType(35,20), true) AS am_pm_ratio#34] +Input [2]: [amc#18, pmc#32] + +(52) Sort [codegen id : 10] +Input [1]: [am_pm_ratio#34] +Arguments: [am_pm_ratio#34 ASC NULLS FIRST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q90/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q90/simplified.txt new file mode 100644 index 0000000000000..0964189da3cfb --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q90/simplified.txt @@ -0,0 +1,75 @@ +WholeStageCodegen (10) + Sort [am_pm_ratio] + Project [amc,pmc] + BroadcastNestedLoopJoin + HashAggregate [count] [count(1),amc,count] + InputAdapter + Exchange #1 + WholeStageCodegen (4) + HashAggregate [count,count] + Project + BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] + Project [ws_web_page_sk] + BroadcastHashJoin [ws_sold_time_sk,t_time_sk] + Project [ws_sold_time_sk,ws_web_page_sk] + BroadcastHashJoin [ws_ship_hdemo_sk,hd_demo_sk] + Project [ws_sold_time_sk,ws_ship_hdemo_sk,ws_web_page_sk] + Filter [ws_ship_hdemo_sk,ws_sold_time_sk,ws_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_time_sk,ws_ship_hdemo_sk,ws_web_page_sk,ws_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [t_time_sk] + Filter [t_hour,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [wp_web_page_sk] + Filter [wp_char_count,wp_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_page [wp_web_page_sk,wp_char_count] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + HashAggregate [count] [count(1),pmc,count] + InputAdapter + Exchange #6 + WholeStageCodegen (8) + HashAggregate [count,count] + Project + BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] + Project [ws_web_page_sk] + BroadcastHashJoin [ws_sold_time_sk,t_time_sk] + Project [ws_sold_time_sk,ws_web_page_sk] + BroadcastHashJoin [ws_ship_hdemo_sk,hd_demo_sk] + Project [ws_sold_time_sk,ws_ship_hdemo_sk,ws_web_page_sk] + Filter [ws_ship_hdemo_sk,ws_sold_time_sk,ws_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_sold_time_sk,ws_ship_hdemo_sk,ws_web_page_sk,ws_sold_date_sk] + InputAdapter + ReusedExchange [hd_demo_sk] #2 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (6) + Project [t_time_sk] + Filter [t_hour,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour] + InputAdapter + ReusedExchange [wp_web_page_sk] #4 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/explain.txt new file mode 100644 index 0000000000000..ef2ddc2466f18 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/explain.txt @@ -0,0 +1,275 @@ +== Physical Plan == +* Sort (47) ++- Exchange (46) + +- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * Project (42) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (36) + : +- * BroadcastHashJoin Inner BuildRight (35) + : :- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.customer_demographics (4) + : : : +- BroadcastExchange (14) + : : : +- * Project (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.household_demographics (10) + : : +- BroadcastExchange (21) + : : +- * Project (20) + : : +- * Filter (19) + : : +- * ColumnarToRow (18) + : : +- Scan parquet default.customer_address (17) + : +- BroadcastExchange (34) + : +- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Filter (26) + : : +- * ColumnarToRow (25) + : : +- Scan parquet default.catalog_returns (24) + : +- BroadcastExchange (31) + : +- * Project (30) + : +- * Filter (29) + : +- * ColumnarToRow (28) + : +- Scan parquet default.date_dim (27) + +- BroadcastExchange (40) + +- * Filter (39) + +- * ColumnarToRow (38) + +- Scan parquet default.call_center (37) + + +(1) Scan parquet default.customer +Output [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 7] +Input [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4] + +(3) Filter [codegen id : 7] +Input [4]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4] +Condition : (((isnotnull(c_customer_sk#1) AND isnotnull(c_current_addr_sk#4)) AND isnotnull(c_current_cdemo_sk#2)) AND isnotnull(c_current_hdemo_sk#3)) + +(4) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,Unknown )),And(EqualTo(cd_marital_status,W),EqualTo(cd_education_status,Advanced Degree ))), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] + +(6) Filter [codegen id : 1] +Input [3]: [cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] +Condition : ((((cd_marital_status#6 = M) AND (cd_education_status#7 = Unknown )) OR ((cd_marital_status#6 = W) AND (cd_education_status#7 = Advanced Degree ))) AND isnotnull(cd_demo_sk#5)) + +(7) BroadcastExchange +Input [3]: [cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] + +(8) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#5] +Join condition: None + +(9) Project [codegen id : 7] +Output [5]: [c_customer_sk#1, c_current_hdemo_sk#3, c_current_addr_sk#4, cd_marital_status#6, cd_education_status#7] +Input [7]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_hdemo_sk#3, c_current_addr_sk#4, cd_demo_sk#5, cd_marital_status#6, cd_education_status#7] + +(10) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#9, hd_buy_potential#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_buy_potential), StringStartsWith(hd_buy_potential,Unknown), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [hd_demo_sk#9, hd_buy_potential#10] + +(12) Filter [codegen id : 2] +Input [2]: [hd_demo_sk#9, hd_buy_potential#10] +Condition : ((isnotnull(hd_buy_potential#10) AND StartsWith(hd_buy_potential#10, Unknown)) AND isnotnull(hd_demo_sk#9)) + +(13) Project [codegen id : 2] +Output [1]: [hd_demo_sk#9] +Input [2]: [hd_demo_sk#9, hd_buy_potential#10] + +(14) BroadcastExchange +Input [1]: [hd_demo_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_hdemo_sk#3] +Right keys [1]: [hd_demo_sk#9] +Join condition: None + +(16) Project [codegen id : 7] +Output [4]: [c_customer_sk#1, c_current_addr_sk#4, cd_marital_status#6, cd_education_status#7] +Input [6]: [c_customer_sk#1, c_current_hdemo_sk#3, c_current_addr_sk#4, cd_marital_status#6, cd_education_status#7, hd_demo_sk#9] + +(17) Scan parquet default.customer_address +Output [2]: [ca_address_sk#12, ca_gmt_offset#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_gmt_offset), EqualTo(ca_gmt_offset,-7.00), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [2]: [ca_address_sk#12, ca_gmt_offset#13] + +(19) Filter [codegen id : 3] +Input [2]: [ca_address_sk#12, ca_gmt_offset#13] +Condition : ((isnotnull(ca_gmt_offset#13) AND (ca_gmt_offset#13 = -7.00)) AND isnotnull(ca_address_sk#12)) + +(20) Project [codegen id : 3] +Output [1]: [ca_address_sk#12] +Input [2]: [ca_address_sk#12, ca_gmt_offset#13] + +(21) BroadcastExchange +Input [1]: [ca_address_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(22) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_addr_sk#4] +Right keys [1]: [ca_address_sk#12] +Join condition: None + +(23) Project [codegen id : 7] +Output [3]: [c_customer_sk#1, cd_marital_status#6, cd_education_status#7] +Input [5]: [c_customer_sk#1, c_current_addr_sk#4, cd_marital_status#6, cd_education_status#7, ca_address_sk#12] + +(24) Scan parquet default.catalog_returns +Output [4]: [cr_returning_customer_sk#15, cr_call_center_sk#16, cr_net_loss#17, cr_returned_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#18), dynamicpruningexpression(cr_returned_date_sk#18 IN dynamicpruning#19)] +PushedFilters: [IsNotNull(cr_call_center_sk), IsNotNull(cr_returning_customer_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 5] +Input [4]: [cr_returning_customer_sk#15, cr_call_center_sk#16, cr_net_loss#17, cr_returned_date_sk#18] + +(26) Filter [codegen id : 5] +Input [4]: [cr_returning_customer_sk#15, cr_call_center_sk#16, cr_net_loss#17, cr_returned_date_sk#18] +Condition : (isnotnull(cr_call_center_sk#16) AND isnotnull(cr_returning_customer_sk#15)) + +(27) Scan parquet default.date_dim +Output [3]: [d_date_sk#20, d_year#21, d_moy#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 4] +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] + +(29) Filter [codegen id : 4] +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] +Condition : ((((isnotnull(d_year#21) AND isnotnull(d_moy#22)) AND (d_year#21 = 1998)) AND (d_moy#22 = 11)) AND isnotnull(d_date_sk#20)) + +(30) Project [codegen id : 4] +Output [1]: [d_date_sk#20] +Input [3]: [d_date_sk#20, d_year#21, d_moy#22] + +(31) BroadcastExchange +Input [1]: [d_date_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] + +(32) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cr_returned_date_sk#18] +Right keys [1]: [d_date_sk#20] +Join condition: None + +(33) Project [codegen id : 5] +Output [3]: [cr_returning_customer_sk#15, cr_call_center_sk#16, cr_net_loss#17] +Input [5]: [cr_returning_customer_sk#15, cr_call_center_sk#16, cr_net_loss#17, cr_returned_date_sk#18, d_date_sk#20] + +(34) BroadcastExchange +Input [3]: [cr_returning_customer_sk#15, cr_call_center_sk#16, cr_net_loss#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(35) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [cr_returning_customer_sk#15] +Join condition: None + +(36) Project [codegen id : 7] +Output [4]: [cd_marital_status#6, cd_education_status#7, cr_call_center_sk#16, cr_net_loss#17] +Input [6]: [c_customer_sk#1, cd_marital_status#6, cd_education_status#7, cr_returning_customer_sk#15, cr_call_center_sk#16, cr_net_loss#17] + +(37) Scan parquet default.call_center +Output [4]: [cc_call_center_sk#25, cc_call_center_id#26, cc_name#27, cc_manager#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_call_center_sk)] +ReadSchema: struct + +(38) ColumnarToRow [codegen id : 6] +Input [4]: [cc_call_center_sk#25, cc_call_center_id#26, cc_name#27, cc_manager#28] + +(39) Filter [codegen id : 6] +Input [4]: [cc_call_center_sk#25, cc_call_center_id#26, cc_name#27, cc_manager#28] +Condition : isnotnull(cc_call_center_sk#25) + +(40) BroadcastExchange +Input [4]: [cc_call_center_sk#25, cc_call_center_id#26, cc_name#27, cc_manager#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(41) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cr_call_center_sk#16] +Right keys [1]: [cc_call_center_sk#25] +Join condition: None + +(42) Project [codegen id : 7] +Output [6]: [cc_call_center_id#26, cc_name#27, cc_manager#28, cr_net_loss#17, cd_marital_status#6, cd_education_status#7] +Input [8]: [cd_marital_status#6, cd_education_status#7, cr_call_center_sk#16, cr_net_loss#17, cc_call_center_sk#25, cc_call_center_id#26, cc_name#27, cc_manager#28] + +(43) HashAggregate [codegen id : 7] +Input [6]: [cc_call_center_id#26, cc_name#27, cc_manager#28, cr_net_loss#17, cd_marital_status#6, cd_education_status#7] +Keys [5]: [cc_call_center_id#26, cc_name#27, cc_manager#28, cd_marital_status#6, cd_education_status#7] +Functions [1]: [partial_sum(UnscaledValue(cr_net_loss#17))] +Aggregate Attributes [1]: [sum#30] +Results [6]: [cc_call_center_id#26, cc_name#27, cc_manager#28, cd_marital_status#6, cd_education_status#7, sum#31] + +(44) Exchange +Input [6]: [cc_call_center_id#26, cc_name#27, cc_manager#28, cd_marital_status#6, cd_education_status#7, sum#31] +Arguments: hashpartitioning(cc_call_center_id#26, cc_name#27, cc_manager#28, cd_marital_status#6, cd_education_status#7, 5), ENSURE_REQUIREMENTS, [id=#32] + +(45) HashAggregate [codegen id : 8] +Input [6]: [cc_call_center_id#26, cc_name#27, cc_manager#28, cd_marital_status#6, cd_education_status#7, sum#31] +Keys [5]: [cc_call_center_id#26, cc_name#27, cc_manager#28, cd_marital_status#6, cd_education_status#7] +Functions [1]: [sum(UnscaledValue(cr_net_loss#17))] +Aggregate Attributes [1]: [sum(UnscaledValue(cr_net_loss#17))#33] +Results [4]: [cc_call_center_id#26 AS Call_Center#34, cc_name#27 AS Call_Center_Name#35, cc_manager#28 AS Manager#36, MakeDecimal(sum(UnscaledValue(cr_net_loss#17))#33,17,2) AS Returns_Loss#37] + +(46) Exchange +Input [4]: [Call_Center#34, Call_Center_Name#35, Manager#36, Returns_Loss#37] +Arguments: rangepartitioning(Returns_Loss#37 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#38] + +(47) Sort [codegen id : 9] +Input [4]: [Call_Center#34, Call_Center_Name#35, Manager#36, Returns_Loss#37] +Arguments: [Returns_Loss#37 DESC NULLS LAST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 24 Hosting Expression = cr_returned_date_sk#18 IN dynamicpruning#19 +ReusedExchange (48) + + +(48) ReusedExchange [Reuses operator id: 31] +Output [1]: [d_date_sk#20] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/simplified.txt new file mode 100644 index 0000000000000..03ef76bc63897 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91.sf100/simplified.txt @@ -0,0 +1,73 @@ +WholeStageCodegen (9) + Sort [Returns_Loss] + InputAdapter + Exchange [Returns_Loss] #1 + WholeStageCodegen (8) + HashAggregate [cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status,sum] [sum(UnscaledValue(cr_net_loss)),Call_Center,Call_Center_Name,Manager,Returns_Loss,sum] + InputAdapter + Exchange [cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status] #2 + WholeStageCodegen (7) + HashAggregate [cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status,cr_net_loss] [sum,sum] + Project [cc_call_center_id,cc_name,cc_manager,cr_net_loss,cd_marital_status,cd_education_status] + BroadcastHashJoin [cr_call_center_sk,cc_call_center_sk] + Project [cd_marital_status,cd_education_status,cr_call_center_sk,cr_net_loss] + BroadcastHashJoin [c_customer_sk,cr_returning_customer_sk] + Project [c_customer_sk,cd_marital_status,cd_education_status] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_customer_sk,c_current_addr_sk,cd_marital_status,cd_education_status] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [c_customer_sk,c_current_hdemo_sk,c_current_addr_sk,cd_marital_status,cd_education_status] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Filter [c_customer_sk,c_current_addr_sk,c_current_cdemo_sk,c_current_hdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [hd_demo_sk] + Filter [hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [ca_address_sk] + Filter [ca_gmt_offset,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_gmt_offset] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Project [cr_returning_customer_sk,cr_call_center_sk,cr_net_loss] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + Filter [cr_call_center_sk,cr_returning_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_returning_customer_sk,cr_call_center_sk,cr_net_loss,cr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #7 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (6) + Filter [cc_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.call_center [cc_call_center_sk,cc_call_center_id,cc_name,cc_manager] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91/explain.txt new file mode 100644 index 0000000000000..fc0da4adf7b16 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91/explain.txt @@ -0,0 +1,275 @@ +== Physical Plan == +* Sort (47) ++- Exchange (46) + +- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * Project (42) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (35) + : +- * BroadcastHashJoin Inner BuildRight (34) + : :- * Project (29) + : : +- * BroadcastHashJoin Inner BuildRight (28) + : : :- * Project (22) + : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : :- * Project (16) + : : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : : :- * Project (9) + : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : :- * Filter (3) + : : : : : : +- * ColumnarToRow (2) + : : : : : : +- Scan parquet default.call_center (1) + : : : : : +- BroadcastExchange (7) + : : : : : +- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.catalog_returns (4) + : : : : +- BroadcastExchange (14) + : : : : +- * Project (13) + : : : : +- * Filter (12) + : : : : +- * ColumnarToRow (11) + : : : : +- Scan parquet default.date_dim (10) + : : : +- BroadcastExchange (20) + : : : +- * Filter (19) + : : : +- * ColumnarToRow (18) + : : : +- Scan parquet default.customer (17) + : : +- BroadcastExchange (27) + : : +- * Project (26) + : : +- * Filter (25) + : : +- * ColumnarToRow (24) + : : +- Scan parquet default.customer_address (23) + : +- BroadcastExchange (33) + : +- * Filter (32) + : +- * ColumnarToRow (31) + : +- Scan parquet default.customer_demographics (30) + +- BroadcastExchange (40) + +- * Project (39) + +- * Filter (38) + +- * ColumnarToRow (37) + +- Scan parquet default.household_demographics (36) + + +(1) Scan parquet default.call_center +Output [4]: [cc_call_center_sk#1, cc_call_center_id#2, cc_name#3, cc_manager#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_call_center_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 7] +Input [4]: [cc_call_center_sk#1, cc_call_center_id#2, cc_name#3, cc_manager#4] + +(3) Filter [codegen id : 7] +Input [4]: [cc_call_center_sk#1, cc_call_center_id#2, cc_name#3, cc_manager#4] +Condition : isnotnull(cc_call_center_sk#1) + +(4) Scan parquet default.catalog_returns +Output [4]: [cr_returning_customer_sk#5, cr_call_center_sk#6, cr_net_loss#7, cr_returned_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#8), dynamicpruningexpression(cr_returned_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(cr_call_center_sk), IsNotNull(cr_returning_customer_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cr_returning_customer_sk#5, cr_call_center_sk#6, cr_net_loss#7, cr_returned_date_sk#8] + +(6) Filter [codegen id : 1] +Input [4]: [cr_returning_customer_sk#5, cr_call_center_sk#6, cr_net_loss#7, cr_returned_date_sk#8] +Condition : (isnotnull(cr_call_center_sk#6) AND isnotnull(cr_returning_customer_sk#5)) + +(7) BroadcastExchange +Input [4]: [cr_returning_customer_sk#5, cr_call_center_sk#6, cr_net_loss#7, cr_returned_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#10] + +(8) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cc_call_center_sk#1] +Right keys [1]: [cr_call_center_sk#6] +Join condition: None + +(9) Project [codegen id : 7] +Output [6]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cr_returning_customer_sk#5, cr_net_loss#7, cr_returned_date_sk#8] +Input [8]: [cc_call_center_sk#1, cc_call_center_id#2, cc_name#3, cc_manager#4, cr_returning_customer_sk#5, cr_call_center_sk#6, cr_net_loss#7, cr_returned_date_sk#8] + +(10) Scan parquet default.date_dim +Output [3]: [d_date_sk#11, d_year#12, d_moy#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,1998), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(12) Filter [codegen id : 2] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] +Condition : ((((isnotnull(d_year#12) AND isnotnull(d_moy#13)) AND (d_year#12 = 1998)) AND (d_moy#13 = 11)) AND isnotnull(d_date_sk#11)) + +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#11] +Input [3]: [d_date_sk#11, d_year#12, d_moy#13] + +(14) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cr_returned_date_sk#8] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(16) Project [codegen id : 7] +Output [5]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cr_returning_customer_sk#5, cr_net_loss#7] +Input [7]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cr_returning_customer_sk#5, cr_net_loss#7, cr_returned_date_sk#8, d_date_sk#11] + +(17) Scan parquet default.customer +Output [4]: [c_customer_sk#15, c_current_cdemo_sk#16, c_current_hdemo_sk#17, c_current_addr_sk#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [4]: [c_customer_sk#15, c_current_cdemo_sk#16, c_current_hdemo_sk#17, c_current_addr_sk#18] + +(19) Filter [codegen id : 3] +Input [4]: [c_customer_sk#15, c_current_cdemo_sk#16, c_current_hdemo_sk#17, c_current_addr_sk#18] +Condition : (((isnotnull(c_customer_sk#15) AND isnotnull(c_current_addr_sk#18)) AND isnotnull(c_current_cdemo_sk#16)) AND isnotnull(c_current_hdemo_sk#17)) + +(20) BroadcastExchange +Input [4]: [c_customer_sk#15, c_current_cdemo_sk#16, c_current_hdemo_sk#17, c_current_addr_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#19] + +(21) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cr_returning_customer_sk#5] +Right keys [1]: [c_customer_sk#15] +Join condition: None + +(22) Project [codegen id : 7] +Output [7]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cr_net_loss#7, c_current_cdemo_sk#16, c_current_hdemo_sk#17, c_current_addr_sk#18] +Input [9]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cr_returning_customer_sk#5, cr_net_loss#7, c_customer_sk#15, c_current_cdemo_sk#16, c_current_hdemo_sk#17, c_current_addr_sk#18] + +(23) Scan parquet default.customer_address +Output [2]: [ca_address_sk#20, ca_gmt_offset#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_gmt_offset), EqualTo(ca_gmt_offset,-7.00), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [2]: [ca_address_sk#20, ca_gmt_offset#21] + +(25) Filter [codegen id : 4] +Input [2]: [ca_address_sk#20, ca_gmt_offset#21] +Condition : ((isnotnull(ca_gmt_offset#21) AND (ca_gmt_offset#21 = -7.00)) AND isnotnull(ca_address_sk#20)) + +(26) Project [codegen id : 4] +Output [1]: [ca_address_sk#20] +Input [2]: [ca_address_sk#20, ca_gmt_offset#21] + +(27) BroadcastExchange +Input [1]: [ca_address_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] + +(28) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_addr_sk#18] +Right keys [1]: [ca_address_sk#20] +Join condition: None + +(29) Project [codegen id : 7] +Output [6]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cr_net_loss#7, c_current_cdemo_sk#16, c_current_hdemo_sk#17] +Input [8]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cr_net_loss#7, c_current_cdemo_sk#16, c_current_hdemo_sk#17, c_current_addr_sk#18, ca_address_sk#20] + +(30) Scan parquet default.customer_demographics +Output [3]: [cd_demo_sk#23, cd_marital_status#24, cd_education_status#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [Or(And(EqualTo(cd_marital_status,M),EqualTo(cd_education_status,Unknown )),And(EqualTo(cd_marital_status,W),EqualTo(cd_education_status,Advanced Degree ))), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 5] +Input [3]: [cd_demo_sk#23, cd_marital_status#24, cd_education_status#25] + +(32) Filter [codegen id : 5] +Input [3]: [cd_demo_sk#23, cd_marital_status#24, cd_education_status#25] +Condition : ((((cd_marital_status#24 = M) AND (cd_education_status#25 = Unknown )) OR ((cd_marital_status#24 = W) AND (cd_education_status#25 = Advanced Degree ))) AND isnotnull(cd_demo_sk#23)) + +(33) BroadcastExchange +Input [3]: [cd_demo_sk#23, cd_marital_status#24, cd_education_status#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#26] + +(34) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_cdemo_sk#16] +Right keys [1]: [cd_demo_sk#23] +Join condition: None + +(35) Project [codegen id : 7] +Output [7]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cr_net_loss#7, c_current_hdemo_sk#17, cd_marital_status#24, cd_education_status#25] +Input [9]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cr_net_loss#7, c_current_cdemo_sk#16, c_current_hdemo_sk#17, cd_demo_sk#23, cd_marital_status#24, cd_education_status#25] + +(36) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#27, hd_buy_potential#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_buy_potential), StringStartsWith(hd_buy_potential,Unknown), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 6] +Input [2]: [hd_demo_sk#27, hd_buy_potential#28] + +(38) Filter [codegen id : 6] +Input [2]: [hd_demo_sk#27, hd_buy_potential#28] +Condition : ((isnotnull(hd_buy_potential#28) AND StartsWith(hd_buy_potential#28, Unknown)) AND isnotnull(hd_demo_sk#27)) + +(39) Project [codegen id : 6] +Output [1]: [hd_demo_sk#27] +Input [2]: [hd_demo_sk#27, hd_buy_potential#28] + +(40) BroadcastExchange +Input [1]: [hd_demo_sk#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] + +(41) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_hdemo_sk#17] +Right keys [1]: [hd_demo_sk#27] +Join condition: None + +(42) Project [codegen id : 7] +Output [6]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cr_net_loss#7, cd_marital_status#24, cd_education_status#25] +Input [8]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cr_net_loss#7, c_current_hdemo_sk#17, cd_marital_status#24, cd_education_status#25, hd_demo_sk#27] + +(43) HashAggregate [codegen id : 7] +Input [6]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cr_net_loss#7, cd_marital_status#24, cd_education_status#25] +Keys [5]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cd_marital_status#24, cd_education_status#25] +Functions [1]: [partial_sum(UnscaledValue(cr_net_loss#7))] +Aggregate Attributes [1]: [sum#30] +Results [6]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cd_marital_status#24, cd_education_status#25, sum#31] + +(44) Exchange +Input [6]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cd_marital_status#24, cd_education_status#25, sum#31] +Arguments: hashpartitioning(cc_call_center_id#2, cc_name#3, cc_manager#4, cd_marital_status#24, cd_education_status#25, 5), ENSURE_REQUIREMENTS, [id=#32] + +(45) HashAggregate [codegen id : 8] +Input [6]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cd_marital_status#24, cd_education_status#25, sum#31] +Keys [5]: [cc_call_center_id#2, cc_name#3, cc_manager#4, cd_marital_status#24, cd_education_status#25] +Functions [1]: [sum(UnscaledValue(cr_net_loss#7))] +Aggregate Attributes [1]: [sum(UnscaledValue(cr_net_loss#7))#33] +Results [4]: [cc_call_center_id#2 AS Call_Center#34, cc_name#3 AS Call_Center_Name#35, cc_manager#4 AS Manager#36, MakeDecimal(sum(UnscaledValue(cr_net_loss#7))#33,17,2) AS Returns_Loss#37] + +(46) Exchange +Input [4]: [Call_Center#34, Call_Center_Name#35, Manager#36, Returns_Loss#37] +Arguments: rangepartitioning(Returns_Loss#37 DESC NULLS LAST, 5), ENSURE_REQUIREMENTS, [id=#38] + +(47) Sort [codegen id : 9] +Input [4]: [Call_Center#34, Call_Center_Name#35, Manager#36, Returns_Loss#37] +Arguments: [Returns_Loss#37 DESC NULLS LAST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = cr_returned_date_sk#8 IN dynamicpruning#9 +ReusedExchange (48) + + +(48) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91/simplified.txt new file mode 100644 index 0000000000000..885d4127c6ff7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q91/simplified.txt @@ -0,0 +1,73 @@ +WholeStageCodegen (9) + Sort [Returns_Loss] + InputAdapter + Exchange [Returns_Loss] #1 + WholeStageCodegen (8) + HashAggregate [cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status,sum] [sum(UnscaledValue(cr_net_loss)),Call_Center,Call_Center_Name,Manager,Returns_Loss,sum] + InputAdapter + Exchange [cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status] #2 + WholeStageCodegen (7) + HashAggregate [cc_call_center_id,cc_name,cc_manager,cd_marital_status,cd_education_status,cr_net_loss] [sum,sum] + Project [cc_call_center_id,cc_name,cc_manager,cr_net_loss,cd_marital_status,cd_education_status] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [cc_call_center_id,cc_name,cc_manager,cr_net_loss,c_current_hdemo_sk,cd_marital_status,cd_education_status] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [cc_call_center_id,cc_name,cc_manager,cr_net_loss,c_current_cdemo_sk,c_current_hdemo_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [cc_call_center_id,cc_name,cc_manager,cr_net_loss,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk] + BroadcastHashJoin [cr_returning_customer_sk,c_customer_sk] + Project [cc_call_center_id,cc_name,cc_manager,cr_returning_customer_sk,cr_net_loss] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + Project [cc_call_center_id,cc_name,cc_manager,cr_returning_customer_sk,cr_net_loss,cr_returned_date_sk] + BroadcastHashJoin [cc_call_center_sk,cr_call_center_sk] + Filter [cc_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.call_center [cc_call_center_sk,cc_call_center_id,cc_name,cc_manager] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Filter [cr_call_center_sk,cr_returning_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_returning_customer_sk,cr_call_center_sk,cr_net_loss,cr_returned_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [c_customer_sk,c_current_addr_sk,c_current_cdemo_sk,c_current_hdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Project [ca_address_sk] + Filter [ca_gmt_offset,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_gmt_offset] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (5) + Filter [cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (6) + Project [hd_demo_sk] + Filter [hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/explain.txt new file mode 100644 index 0000000000000..94e76ced527a0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/explain.txt @@ -0,0 +1,210 @@ +== Physical Plan == +* Sort (34) ++- * HashAggregate (33) + +- Exchange (32) + +- * HashAggregate (31) + +- * Project (30) + +- * BroadcastHashJoin Inner BuildRight (29) + :- * Project (27) + : +- * BroadcastHashJoin Inner BuildLeft (26) + : :- BroadcastExchange (22) + : : +- * Project (21) + : : +- * BroadcastHashJoin Inner BuildLeft (20) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.item (1) + : : +- * Filter (19) + : : +- * HashAggregate (18) + : : +- Exchange (17) + : : +- * HashAggregate (16) + : : +- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.web_sales (6) + : : +- BroadcastExchange (13) + : : +- * Project (12) + : : +- * Filter (11) + : : +- * ColumnarToRow (10) + : : +- Scan parquet default.date_dim (9) + : +- * Filter (25) + : +- * ColumnarToRow (24) + : +- Scan parquet default.web_sales (23) + +- ReusedExchange (28) + + +(1) Scan parquet default.item +Output [2]: [i_item_sk#1, i_manufact_id#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,350), IsNotNull(i_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [2]: [i_item_sk#1, i_manufact_id#2] + +(3) Filter [codegen id : 1] +Input [2]: [i_item_sk#1, i_manufact_id#2] +Condition : ((isnotnull(i_manufact_id#2) AND (i_manufact_id#2 = 350)) AND isnotnull(i_item_sk#1)) + +(4) Project [codegen id : 1] +Output [1]: [i_item_sk#1] +Input [2]: [i_item_sk#1, i_manufact_id#2] + +(5) BroadcastExchange +Input [1]: [i_item_sk#1] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#3] + +(6) Scan parquet default.web_sales +Output [3]: [ws_item_sk#4, ws_ext_discount_amt#5, ws_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#6), dynamicpruningexpression(ws_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [3]: [ws_item_sk#4, ws_ext_discount_amt#5, ws_sold_date_sk#6] + +(8) Filter [codegen id : 3] +Input [3]: [ws_item_sk#4, ws_ext_discount_amt#5, ws_sold_date_sk#6] +Condition : isnotnull(ws_item_sk#4) + +(9) Scan parquet default.date_dim +Output [2]: [d_date_sk#8, d_date#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-01-27), LessThanOrEqual(d_date,2000-04-26), IsNotNull(d_date_sk)] +ReadSchema: struct + +(10) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#8, d_date#9] + +(11) Filter [codegen id : 2] +Input [2]: [d_date_sk#8, d_date#9] +Condition : (((isnotnull(d_date#9) AND (d_date#9 >= 2000-01-27)) AND (d_date#9 <= 2000-04-26)) AND isnotnull(d_date_sk#8)) + +(12) Project [codegen id : 2] +Output [1]: [d_date_sk#8] +Input [2]: [d_date_sk#8, d_date#9] + +(13) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(15) Project [codegen id : 3] +Output [2]: [ws_item_sk#4, ws_ext_discount_amt#5] +Input [4]: [ws_item_sk#4, ws_ext_discount_amt#5, ws_sold_date_sk#6, d_date_sk#8] + +(16) HashAggregate [codegen id : 3] +Input [2]: [ws_item_sk#4, ws_ext_discount_amt#5] +Keys [1]: [ws_item_sk#4] +Functions [1]: [partial_avg(UnscaledValue(ws_ext_discount_amt#5))] +Aggregate Attributes [2]: [sum#11, count#12] +Results [3]: [ws_item_sk#4, sum#13, count#14] + +(17) Exchange +Input [3]: [ws_item_sk#4, sum#13, count#14] +Arguments: hashpartitioning(ws_item_sk#4, 5), ENSURE_REQUIREMENTS, [id=#15] + +(18) HashAggregate +Input [3]: [ws_item_sk#4, sum#13, count#14] +Keys [1]: [ws_item_sk#4] +Functions [1]: [avg(UnscaledValue(ws_ext_discount_amt#5))] +Aggregate Attributes [1]: [avg(UnscaledValue(ws_ext_discount_amt#5))#16] +Results [2]: [CheckOverflow((1.300000 * promote_precision(cast((avg(UnscaledValue(ws_ext_discount_amt#5))#16 / 100.0) as decimal(11,6)))), DecimalType(14,7), true) AS (1.3 * avg(ws_ext_discount_amt))#17, ws_item_sk#4] + +(19) Filter +Input [2]: [(1.3 * avg(ws_ext_discount_amt))#17, ws_item_sk#4] +Condition : isnotnull((1.3 * avg(ws_ext_discount_amt))#17) + +(20) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ws_item_sk#4] +Join condition: None + +(21) Project [codegen id : 4] +Output [2]: [i_item_sk#1, (1.3 * avg(ws_ext_discount_amt))#17] +Input [3]: [i_item_sk#1, (1.3 * avg(ws_ext_discount_amt))#17, ws_item_sk#4] + +(22) BroadcastExchange +Input [2]: [i_item_sk#1, (1.3 * avg(ws_ext_discount_amt))#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(23) Scan parquet default.web_sales +Output [3]: [ws_item_sk#19, ws_ext_discount_amt#20, ws_sold_date_sk#21] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#21), dynamicpruningexpression(ws_sold_date_sk#21 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_ext_discount_amt)] +ReadSchema: struct + +(24) ColumnarToRow +Input [3]: [ws_item_sk#19, ws_ext_discount_amt#20, ws_sold_date_sk#21] + +(25) Filter +Input [3]: [ws_item_sk#19, ws_ext_discount_amt#20, ws_sold_date_sk#21] +Condition : (isnotnull(ws_item_sk#19) AND isnotnull(ws_ext_discount_amt#20)) + +(26) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ws_item_sk#19] +Join condition: (cast(ws_ext_discount_amt#20 as decimal(14,7)) > (1.3 * avg(ws_ext_discount_amt))#17) + +(27) Project [codegen id : 6] +Output [2]: [ws_ext_discount_amt#20, ws_sold_date_sk#21] +Input [5]: [i_item_sk#1, (1.3 * avg(ws_ext_discount_amt))#17, ws_item_sk#19, ws_ext_discount_amt#20, ws_sold_date_sk#21] + +(28) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#22] + +(29) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#21] +Right keys [1]: [d_date_sk#22] +Join condition: None + +(30) Project [codegen id : 6] +Output [1]: [ws_ext_discount_amt#20] +Input [3]: [ws_ext_discount_amt#20, ws_sold_date_sk#21, d_date_sk#22] + +(31) HashAggregate [codegen id : 6] +Input [1]: [ws_ext_discount_amt#20] +Keys: [] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_discount_amt#20))] +Aggregate Attributes [1]: [sum#23] +Results [1]: [sum#24] + +(32) Exchange +Input [1]: [sum#24] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#25] + +(33) HashAggregate [codegen id : 7] +Input [1]: [sum#24] +Keys: [] +Functions [1]: [sum(UnscaledValue(ws_ext_discount_amt#20))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_discount_amt#20))#26] +Results [1]: [MakeDecimal(sum(UnscaledValue(ws_ext_discount_amt#20))#26,17,2) AS Excess Discount Amount #27] + +(34) Sort [codegen id : 7] +Input [1]: [Excess Discount Amount #27] +Arguments: [Excess Discount Amount #27 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ws_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 13] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 23 Hosting Expression = ws_sold_date_sk#21 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/simplified.txt new file mode 100644 index 0000000000000..e83a3e67e5c6f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92.sf100/simplified.txt @@ -0,0 +1,53 @@ +WholeStageCodegen (7) + Sort [Excess Discount Amount ] + HashAggregate [sum] [sum(UnscaledValue(ws_ext_discount_amt)),Excess Discount Amount ,sum] + InputAdapter + Exchange #1 + WholeStageCodegen (6) + HashAggregate [ws_ext_discount_amt] [sum,sum] + Project [ws_ext_discount_amt] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_ext_discount_amt,ws_sold_date_sk] + BroadcastHashJoin [i_item_sk,ws_item_sk,ws_ext_discount_amt,(1.3 * avg(ws_ext_discount_amt))] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (4) + Project [i_item_sk,(1.3 * avg(ws_ext_discount_amt))] + BroadcastHashJoin [i_item_sk,ws_item_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk] + Filter [i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_manufact_id] + Filter [(1.3 * avg(ws_ext_discount_amt))] + HashAggregate [ws_item_sk,sum,count] [avg(UnscaledValue(ws_ext_discount_amt)),(1.3 * avg(ws_ext_discount_amt)),sum,count] + InputAdapter + Exchange [ws_item_sk] #4 + WholeStageCodegen (3) + HashAggregate [ws_item_sk,ws_ext_discount_amt] [sum,count,sum,count] + Project [ws_item_sk,ws_ext_discount_amt] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_ext_discount_amt,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + Filter [ws_item_sk,ws_ext_discount_amt] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_ext_discount_amt,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92/explain.txt new file mode 100644 index 0000000000000..46953fe184f28 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92/explain.txt @@ -0,0 +1,210 @@ +== Physical Plan == +* Sort (34) ++- * HashAggregate (33) + +- Exchange (32) + +- * HashAggregate (31) + +- * Project (30) + +- * BroadcastHashJoin Inner BuildRight (29) + :- * Project (27) + : +- * BroadcastHashJoin Inner BuildRight (26) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.web_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.item (4) + : +- BroadcastExchange (25) + : +- * Filter (24) + : +- * HashAggregate (23) + : +- Exchange (22) + : +- * HashAggregate (21) + : +- * Project (20) + : +- * BroadcastHashJoin Inner BuildRight (19) + : :- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.web_sales (11) + : +- BroadcastExchange (18) + : +- * Project (17) + : +- * Filter (16) + : +- * ColumnarToRow (15) + : +- Scan parquet default.date_dim (14) + +- ReusedExchange (28) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_ext_discount_amt#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_ext_discount_amt)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 6] +Input [3]: [ws_item_sk#1, ws_ext_discount_amt#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 6] +Input [3]: [ws_item_sk#1, ws_ext_discount_amt#2, ws_sold_date_sk#3] +Condition : (isnotnull(ws_item_sk#1) AND isnotnull(ws_ext_discount_amt#2)) + +(4) Scan parquet default.item +Output [2]: [i_item_sk#5, i_manufact_id#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_manufact_id), EqualTo(i_manufact_id,350), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [i_item_sk#5, i_manufact_id#6] + +(6) Filter [codegen id : 1] +Input [2]: [i_item_sk#5, i_manufact_id#6] +Condition : ((isnotnull(i_manufact_id#6) AND (i_manufact_id#6 = 350)) AND isnotnull(i_item_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [i_item_sk#5] +Input [2]: [i_item_sk#5, i_manufact_id#6] + +(8) BroadcastExchange +Input [1]: [i_item_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(10) Project [codegen id : 6] +Output [3]: [ws_ext_discount_amt#2, ws_sold_date_sk#3, i_item_sk#5] +Input [4]: [ws_item_sk#1, ws_ext_discount_amt#2, ws_sold_date_sk#3, i_item_sk#5] + +(11) Scan parquet default.web_sales +Output [3]: [ws_item_sk#8, ws_ext_discount_amt#9, ws_sold_date_sk#10] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#10), dynamicpruningexpression(ws_sold_date_sk#10 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 3] +Input [3]: [ws_item_sk#8, ws_ext_discount_amt#9, ws_sold_date_sk#10] + +(13) Filter [codegen id : 3] +Input [3]: [ws_item_sk#8, ws_ext_discount_amt#9, ws_sold_date_sk#10] +Condition : isnotnull(ws_item_sk#8) + +(14) Scan parquet default.date_dim +Output [2]: [d_date_sk#11, d_date#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,2000-01-27), LessThanOrEqual(d_date,2000-04-26), IsNotNull(d_date_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#11, d_date#12] + +(16) Filter [codegen id : 2] +Input [2]: [d_date_sk#11, d_date#12] +Condition : (((isnotnull(d_date#12) AND (d_date#12 >= 2000-01-27)) AND (d_date#12 <= 2000-04-26)) AND isnotnull(d_date_sk#11)) + +(17) Project [codegen id : 2] +Output [1]: [d_date_sk#11] +Input [2]: [d_date_sk#11, d_date#12] + +(18) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(19) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#10] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(20) Project [codegen id : 3] +Output [2]: [ws_item_sk#8, ws_ext_discount_amt#9] +Input [4]: [ws_item_sk#8, ws_ext_discount_amt#9, ws_sold_date_sk#10, d_date_sk#11] + +(21) HashAggregate [codegen id : 3] +Input [2]: [ws_item_sk#8, ws_ext_discount_amt#9] +Keys [1]: [ws_item_sk#8] +Functions [1]: [partial_avg(UnscaledValue(ws_ext_discount_amt#9))] +Aggregate Attributes [2]: [sum#14, count#15] +Results [3]: [ws_item_sk#8, sum#16, count#17] + +(22) Exchange +Input [3]: [ws_item_sk#8, sum#16, count#17] +Arguments: hashpartitioning(ws_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#18] + +(23) HashAggregate [codegen id : 4] +Input [3]: [ws_item_sk#8, sum#16, count#17] +Keys [1]: [ws_item_sk#8] +Functions [1]: [avg(UnscaledValue(ws_ext_discount_amt#9))] +Aggregate Attributes [1]: [avg(UnscaledValue(ws_ext_discount_amt#9))#19] +Results [2]: [CheckOverflow((1.300000 * promote_precision(cast((avg(UnscaledValue(ws_ext_discount_amt#9))#19 / 100.0) as decimal(11,6)))), DecimalType(14,7), true) AS (1.3 * avg(ws_ext_discount_amt))#20, ws_item_sk#8] + +(24) Filter [codegen id : 4] +Input [2]: [(1.3 * avg(ws_ext_discount_amt))#20, ws_item_sk#8] +Condition : isnotnull((1.3 * avg(ws_ext_discount_amt))#20) + +(25) BroadcastExchange +Input [2]: [(1.3 * avg(ws_ext_discount_amt))#20, ws_item_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#21] + +(26) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [i_item_sk#5] +Right keys [1]: [ws_item_sk#8] +Join condition: (cast(ws_ext_discount_amt#2 as decimal(14,7)) > (1.3 * avg(ws_ext_discount_amt))#20) + +(27) Project [codegen id : 6] +Output [2]: [ws_ext_discount_amt#2, ws_sold_date_sk#3] +Input [5]: [ws_ext_discount_amt#2, ws_sold_date_sk#3, i_item_sk#5, (1.3 * avg(ws_ext_discount_amt))#20, ws_item_sk#8] + +(28) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#22] + +(29) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#22] +Join condition: None + +(30) Project [codegen id : 6] +Output [1]: [ws_ext_discount_amt#2] +Input [3]: [ws_ext_discount_amt#2, ws_sold_date_sk#3, d_date_sk#22] + +(31) HashAggregate [codegen id : 6] +Input [1]: [ws_ext_discount_amt#2] +Keys: [] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_discount_amt#2))] +Aggregate Attributes [1]: [sum#23] +Results [1]: [sum#24] + +(32) Exchange +Input [1]: [sum#24] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#25] + +(33) HashAggregate [codegen id : 7] +Input [1]: [sum#24] +Keys: [] +Functions [1]: [sum(UnscaledValue(ws_ext_discount_amt#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_discount_amt#2))#26] +Results [1]: [MakeDecimal(sum(UnscaledValue(ws_ext_discount_amt#2))#26,17,2) AS Excess Discount Amount #27] + +(34) Sort [codegen id : 7] +Input [1]: [Excess Discount Amount #27] +Arguments: [Excess Discount Amount #27 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (35) + + +(35) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#22] + +Subquery:2 Hosting operator id = 11 Hosting Expression = ws_sold_date_sk#10 IN dynamicpruning#4 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92/simplified.txt new file mode 100644 index 0000000000000..0df713c0e075e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q92/simplified.txt @@ -0,0 +1,53 @@ +WholeStageCodegen (7) + Sort [Excess Discount Amount ] + HashAggregate [sum] [sum(UnscaledValue(ws_ext_discount_amt)),Excess Discount Amount ,sum] + InputAdapter + Exchange #1 + WholeStageCodegen (6) + HashAggregate [ws_ext_discount_amt] [sum,sum] + Project [ws_ext_discount_amt] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_ext_discount_amt,ws_sold_date_sk] + BroadcastHashJoin [i_item_sk,ws_item_sk,ws_ext_discount_amt,(1.3 * avg(ws_ext_discount_amt))] + Project [ws_ext_discount_amt,ws_sold_date_sk,i_item_sk] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk,ws_ext_discount_amt] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_ext_discount_amt,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [i_item_sk] + Filter [i_manufact_id,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_manufact_id] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Filter [(1.3 * avg(ws_ext_discount_amt))] + HashAggregate [ws_item_sk,sum,count] [avg(UnscaledValue(ws_ext_discount_amt)),(1.3 * avg(ws_ext_discount_amt)),sum,count] + InputAdapter + Exchange [ws_item_sk] #5 + WholeStageCodegen (3) + HashAggregate [ws_item_sk,ws_ext_discount_amt] [sum,count,sum,count] + Project [ws_item_sk,ws_ext_discount_amt] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_ext_discount_amt,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + ReusedExchange [d_date_sk] #2 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93.sf100/explain.txt new file mode 100644 index 0000000000000..01b7b7f5e20c8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93.sf100/explain.txt @@ -0,0 +1,136 @@ +== Physical Plan == +TakeOrderedAndProject (24) ++- * HashAggregate (23) + +- Exchange (22) + +- * HashAggregate (21) + +- * Project (20) + +- * SortMergeJoin Inner (19) + :- * Sort (13) + : +- Exchange (12) + : +- * Project (11) + : +- * BroadcastHashJoin Inner BuildRight (10) + : :- * Project (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_returns (1) + : +- BroadcastExchange (9) + : +- * Project (8) + : +- * Filter (7) + : +- * ColumnarToRow (6) + : +- Scan parquet default.reason (5) + +- * Sort (18) + +- Exchange (17) + +- * Project (16) + +- * ColumnarToRow (15) + +- Scan parquet default.store_sales (14) + + +(1) Scan parquet default.store_returns +Output [5]: [sr_item_sk#1, sr_reason_sk#2, sr_ticket_number#3, sr_return_quantity#4, sr_returned_date_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number), IsNotNull(sr_reason_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [5]: [sr_item_sk#1, sr_reason_sk#2, sr_ticket_number#3, sr_return_quantity#4, sr_returned_date_sk#5] + +(3) Filter [codegen id : 2] +Input [5]: [sr_item_sk#1, sr_reason_sk#2, sr_ticket_number#3, sr_return_quantity#4, sr_returned_date_sk#5] +Condition : ((isnotnull(sr_item_sk#1) AND isnotnull(sr_ticket_number#3)) AND isnotnull(sr_reason_sk#2)) + +(4) Project [codegen id : 2] +Output [4]: [sr_item_sk#1, sr_reason_sk#2, sr_ticket_number#3, sr_return_quantity#4] +Input [5]: [sr_item_sk#1, sr_reason_sk#2, sr_ticket_number#3, sr_return_quantity#4, sr_returned_date_sk#5] + +(5) Scan parquet default.reason +Output [2]: [r_reason_sk#6, r_reason_desc#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/reason] +PushedFilters: [IsNotNull(r_reason_desc), EqualTo(r_reason_desc,reason 28 ), IsNotNull(r_reason_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [2]: [r_reason_sk#6, r_reason_desc#7] + +(7) Filter [codegen id : 1] +Input [2]: [r_reason_sk#6, r_reason_desc#7] +Condition : ((isnotnull(r_reason_desc#7) AND (r_reason_desc#7 = reason 28 )) AND isnotnull(r_reason_sk#6)) + +(8) Project [codegen id : 1] +Output [1]: [r_reason_sk#6] +Input [2]: [r_reason_sk#6, r_reason_desc#7] + +(9) BroadcastExchange +Input [1]: [r_reason_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(10) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [sr_reason_sk#2] +Right keys [1]: [r_reason_sk#6] +Join condition: None + +(11) Project [codegen id : 2] +Output [3]: [sr_item_sk#1, sr_ticket_number#3, sr_return_quantity#4] +Input [5]: [sr_item_sk#1, sr_reason_sk#2, sr_ticket_number#3, sr_return_quantity#4, r_reason_sk#6] + +(12) Exchange +Input [3]: [sr_item_sk#1, sr_ticket_number#3, sr_return_quantity#4] +Arguments: hashpartitioning(sr_item_sk#1, sr_ticket_number#3, 5), ENSURE_REQUIREMENTS, [id=#9] + +(13) Sort [codegen id : 3] +Input [3]: [sr_item_sk#1, sr_ticket_number#3, sr_return_quantity#4] +Arguments: [sr_item_sk#1 ASC NULLS FIRST, sr_ticket_number#3 ASC NULLS FIRST], false, 0 + +(14) Scan parquet default.store_sales +Output [6]: [ss_item_sk#10, ss_customer_sk#11, ss_ticket_number#12, ss_quantity#13, ss_sales_price#14, ss_sold_date_sk#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 4] +Input [6]: [ss_item_sk#10, ss_customer_sk#11, ss_ticket_number#12, ss_quantity#13, ss_sales_price#14, ss_sold_date_sk#15] + +(16) Project [codegen id : 4] +Output [5]: [ss_item_sk#10, ss_customer_sk#11, ss_ticket_number#12, ss_quantity#13, ss_sales_price#14] +Input [6]: [ss_item_sk#10, ss_customer_sk#11, ss_ticket_number#12, ss_quantity#13, ss_sales_price#14, ss_sold_date_sk#15] + +(17) Exchange +Input [5]: [ss_item_sk#10, ss_customer_sk#11, ss_ticket_number#12, ss_quantity#13, ss_sales_price#14] +Arguments: hashpartitioning(ss_item_sk#10, ss_ticket_number#12, 5), ENSURE_REQUIREMENTS, [id=#16] + +(18) Sort [codegen id : 5] +Input [5]: [ss_item_sk#10, ss_customer_sk#11, ss_ticket_number#12, ss_quantity#13, ss_sales_price#14] +Arguments: [ss_item_sk#10 ASC NULLS FIRST, ss_ticket_number#12 ASC NULLS FIRST], false, 0 + +(19) SortMergeJoin [codegen id : 6] +Left keys [2]: [sr_item_sk#1, sr_ticket_number#3] +Right keys [2]: [ss_item_sk#10, ss_ticket_number#12] +Join condition: None + +(20) Project [codegen id : 6] +Output [2]: [ss_customer_sk#11, CASE WHEN isnotnull(sr_return_quantity#4) THEN CheckOverflow((promote_precision(cast(cast((ss_quantity#13 - sr_return_quantity#4) as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#14 as decimal(12,2)))), DecimalType(18,2), true) ELSE CheckOverflow((promote_precision(cast(cast(ss_quantity#13 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#14 as decimal(12,2)))), DecimalType(18,2), true) END AS act_sales#17] +Input [8]: [sr_item_sk#1, sr_ticket_number#3, sr_return_quantity#4, ss_item_sk#10, ss_customer_sk#11, ss_ticket_number#12, ss_quantity#13, ss_sales_price#14] + +(21) HashAggregate [codegen id : 6] +Input [2]: [ss_customer_sk#11, act_sales#17] +Keys [1]: [ss_customer_sk#11] +Functions [1]: [partial_sum(act_sales#17)] +Aggregate Attributes [2]: [sum#18, isEmpty#19] +Results [3]: [ss_customer_sk#11, sum#20, isEmpty#21] + +(22) Exchange +Input [3]: [ss_customer_sk#11, sum#20, isEmpty#21] +Arguments: hashpartitioning(ss_customer_sk#11, 5), ENSURE_REQUIREMENTS, [id=#22] + +(23) HashAggregate [codegen id : 7] +Input [3]: [ss_customer_sk#11, sum#20, isEmpty#21] +Keys [1]: [ss_customer_sk#11] +Functions [1]: [sum(act_sales#17)] +Aggregate Attributes [1]: [sum(act_sales#17)#23] +Results [2]: [ss_customer_sk#11, sum(act_sales#17)#23 AS sumsales#24] + +(24) TakeOrderedAndProject +Input [2]: [ss_customer_sk#11, sumsales#24] +Arguments: 100, [sumsales#24 ASC NULLS FIRST, ss_customer_sk#11 ASC NULLS FIRST], [ss_customer_sk#11, sumsales#24] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93.sf100/simplified.txt new file mode 100644 index 0000000000000..17464e295b1dd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93.sf100/simplified.txt @@ -0,0 +1,40 @@ +TakeOrderedAndProject [sumsales,ss_customer_sk] + WholeStageCodegen (7) + HashAggregate [ss_customer_sk,sum,isEmpty] [sum(act_sales),sumsales,sum,isEmpty] + InputAdapter + Exchange [ss_customer_sk] #1 + WholeStageCodegen (6) + HashAggregate [ss_customer_sk,act_sales] [sum,isEmpty,sum,isEmpty] + Project [ss_customer_sk,sr_return_quantity,ss_quantity,ss_sales_price] + SortMergeJoin [sr_item_sk,sr_ticket_number,ss_item_sk,ss_ticket_number] + InputAdapter + WholeStageCodegen (3) + Sort [sr_item_sk,sr_ticket_number] + InputAdapter + Exchange [sr_item_sk,sr_ticket_number] #2 + WholeStageCodegen (2) + Project [sr_item_sk,sr_ticket_number,sr_return_quantity] + BroadcastHashJoin [sr_reason_sk,r_reason_sk] + Project [sr_item_sk,sr_reason_sk,sr_ticket_number,sr_return_quantity] + Filter [sr_item_sk,sr_ticket_number,sr_reason_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_reason_sk,sr_ticket_number,sr_return_quantity,sr_returned_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [r_reason_sk] + Filter [r_reason_desc,r_reason_sk] + ColumnarToRow + InputAdapter + Scan parquet default.reason [r_reason_sk,r_reason_desc] + InputAdapter + WholeStageCodegen (5) + Sort [ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_item_sk,ss_ticket_number] #4 + WholeStageCodegen (4) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_sales_price] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_sales_price,ss_sold_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93/explain.txt new file mode 100644 index 0000000000000..54b9ae752c7a0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93/explain.txt @@ -0,0 +1,136 @@ +== Physical Plan == +TakeOrderedAndProject (24) ++- * HashAggregate (23) + +- Exchange (22) + +- * HashAggregate (21) + +- * Project (20) + +- * BroadcastHashJoin Inner BuildRight (19) + :- * Project (13) + : +- * SortMergeJoin Inner (12) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Project (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- * Sort (11) + : +- Exchange (10) + : +- * Project (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.store_returns (6) + +- BroadcastExchange (18) + +- * Project (17) + +- * Filter (16) + +- * ColumnarToRow (15) + +- Scan parquet default.reason (14) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_sales_price#5, ss_sold_date_sk#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_sales_price#5, ss_sold_date_sk#6] + +(3) Project [codegen id : 1] +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_sales_price#5] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_sales_price#5, ss_sold_date_sk#6] + +(4) Exchange +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_sales_price#5] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#3, 5), ENSURE_REQUIREMENTS, [id=#7] + +(5) Sort [codegen id : 2] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_sales_price#5] +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#3 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_returns +Output [5]: [sr_item_sk#8, sr_reason_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number), IsNotNull(sr_reason_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [5]: [sr_item_sk#8, sr_reason_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] + +(8) Filter [codegen id : 3] +Input [5]: [sr_item_sk#8, sr_reason_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] +Condition : ((isnotnull(sr_item_sk#8) AND isnotnull(sr_ticket_number#10)) AND isnotnull(sr_reason_sk#9)) + +(9) Project [codegen id : 3] +Output [4]: [sr_item_sk#8, sr_reason_sk#9, sr_ticket_number#10, sr_return_quantity#11] +Input [5]: [sr_item_sk#8, sr_reason_sk#9, sr_ticket_number#10, sr_return_quantity#11, sr_returned_date_sk#12] + +(10) Exchange +Input [4]: [sr_item_sk#8, sr_reason_sk#9, sr_ticket_number#10, sr_return_quantity#11] +Arguments: hashpartitioning(sr_item_sk#8, sr_ticket_number#10, 5), ENSURE_REQUIREMENTS, [id=#13] + +(11) Sort [codegen id : 4] +Input [4]: [sr_item_sk#8, sr_reason_sk#9, sr_ticket_number#10, sr_return_quantity#11] +Arguments: [sr_item_sk#8 ASC NULLS FIRST, sr_ticket_number#10 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 6] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#3] +Right keys [2]: [sr_item_sk#8, sr_ticket_number#10] +Join condition: None + +(13) Project [codegen id : 6] +Output [5]: [ss_customer_sk#2, ss_quantity#4, ss_sales_price#5, sr_reason_sk#9, sr_return_quantity#11] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_sales_price#5, sr_item_sk#8, sr_reason_sk#9, sr_ticket_number#10, sr_return_quantity#11] + +(14) Scan parquet default.reason +Output [2]: [r_reason_sk#14, r_reason_desc#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/reason] +PushedFilters: [IsNotNull(r_reason_desc), EqualTo(r_reason_desc,reason 28 ), IsNotNull(r_reason_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 5] +Input [2]: [r_reason_sk#14, r_reason_desc#15] + +(16) Filter [codegen id : 5] +Input [2]: [r_reason_sk#14, r_reason_desc#15] +Condition : ((isnotnull(r_reason_desc#15) AND (r_reason_desc#15 = reason 28 )) AND isnotnull(r_reason_sk#14)) + +(17) Project [codegen id : 5] +Output [1]: [r_reason_sk#14] +Input [2]: [r_reason_sk#14, r_reason_desc#15] + +(18) BroadcastExchange +Input [1]: [r_reason_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(19) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [sr_reason_sk#9] +Right keys [1]: [r_reason_sk#14] +Join condition: None + +(20) Project [codegen id : 6] +Output [2]: [ss_customer_sk#2, CASE WHEN isnotnull(sr_return_quantity#11) THEN CheckOverflow((promote_precision(cast(cast((ss_quantity#4 - sr_return_quantity#11) as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#5 as decimal(12,2)))), DecimalType(18,2), true) ELSE CheckOverflow((promote_precision(cast(cast(ss_quantity#4 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_sales_price#5 as decimal(12,2)))), DecimalType(18,2), true) END AS act_sales#17] +Input [6]: [ss_customer_sk#2, ss_quantity#4, ss_sales_price#5, sr_reason_sk#9, sr_return_quantity#11, r_reason_sk#14] + +(21) HashAggregate [codegen id : 6] +Input [2]: [ss_customer_sk#2, act_sales#17] +Keys [1]: [ss_customer_sk#2] +Functions [1]: [partial_sum(act_sales#17)] +Aggregate Attributes [2]: [sum#18, isEmpty#19] +Results [3]: [ss_customer_sk#2, sum#20, isEmpty#21] + +(22) Exchange +Input [3]: [ss_customer_sk#2, sum#20, isEmpty#21] +Arguments: hashpartitioning(ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#22] + +(23) HashAggregate [codegen id : 7] +Input [3]: [ss_customer_sk#2, sum#20, isEmpty#21] +Keys [1]: [ss_customer_sk#2] +Functions [1]: [sum(act_sales#17)] +Aggregate Attributes [1]: [sum(act_sales#17)#23] +Results [2]: [ss_customer_sk#2, sum(act_sales#17)#23 AS sumsales#24] + +(24) TakeOrderedAndProject +Input [2]: [ss_customer_sk#2, sumsales#24] +Arguments: 100, [sumsales#24 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST], [ss_customer_sk#2, sumsales#24] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93/simplified.txt new file mode 100644 index 0000000000000..0d9aec90a2da4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q93/simplified.txt @@ -0,0 +1,40 @@ +TakeOrderedAndProject [sumsales,ss_customer_sk] + WholeStageCodegen (7) + HashAggregate [ss_customer_sk,sum,isEmpty] [sum(act_sales),sumsales,sum,isEmpty] + InputAdapter + Exchange [ss_customer_sk] #1 + WholeStageCodegen (6) + HashAggregate [ss_customer_sk,act_sales] [sum,isEmpty,sum,isEmpty] + Project [ss_customer_sk,sr_return_quantity,ss_quantity,ss_sales_price] + BroadcastHashJoin [sr_reason_sk,r_reason_sk] + Project [ss_customer_sk,ss_quantity,ss_sales_price,sr_reason_sk,sr_return_quantity] + SortMergeJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_item_sk,ss_ticket_number] #2 + WholeStageCodegen (1) + Project [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_sales_price] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_sales_price,ss_sold_date_sk] + InputAdapter + WholeStageCodegen (4) + Sort [sr_item_sk,sr_ticket_number] + InputAdapter + Exchange [sr_item_sk,sr_ticket_number] #3 + WholeStageCodegen (3) + Project [sr_item_sk,sr_reason_sk,sr_ticket_number,sr_return_quantity] + Filter [sr_item_sk,sr_ticket_number,sr_reason_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_reason_sk,sr_ticket_number,sr_return_quantity,sr_returned_date_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (5) + Project [r_reason_sk] + Filter [r_reason_desc,r_reason_sk] + ColumnarToRow + InputAdapter + Scan parquet default.reason [r_reason_sk,r_reason_desc] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt new file mode 100644 index 0000000000000..e06516011e4ec --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/explain.txt @@ -0,0 +1,260 @@ +== Physical Plan == +* Sort (46) ++- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * HashAggregate (42) + +- * HashAggregate (41) + +- * Project (40) + +- * BroadcastHashJoin Inner BuildRight (39) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Project (26) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- SortMergeJoin LeftAnti (19) + : : : :- * Project (13) + : : : : +- * SortMergeJoin LeftSemi (12) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * ColumnarToRow (8) + : : : : +- Scan parquet default.web_sales (7) + : : : +- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.web_returns (14) + : : +- BroadcastExchange (24) + : : +- * Project (23) + : : +- * Filter (22) + : : +- * ColumnarToRow (21) + : : +- Scan parquet default.customer_address (20) + : +- BroadcastExchange (31) + : +- * Project (30) + : +- * Filter (29) + : +- * ColumnarToRow (28) + : +- Scan parquet default.web_site (27) + +- BroadcastExchange (38) + +- * Project (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.date_dim (34) + + +(1) Scan parquet default.web_sales +Output [8]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ws_sold_date_sk#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_ship_date_sk), IsNotNull(ws_ship_addr_sk), IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [8]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ws_sold_date_sk#8] + +(3) Filter [codegen id : 1] +Input [8]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ws_sold_date_sk#8] +Condition : ((isnotnull(ws_ship_date_sk#1) AND isnotnull(ws_ship_addr_sk#2)) AND isnotnull(ws_web_site_sk#3)) + +(4) Project [codegen id : 1] +Output [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [8]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ws_sold_date_sk#8] + +(5) Exchange +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Arguments: hashpartitioning(ws_order_number#5, 5), ENSURE_REQUIREMENTS, [id=#9] + +(6) Sort [codegen id : 2] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Arguments: [ws_order_number#5 ASC NULLS FIRST], false, 0 + +(7) Scan parquet default.web_sales +Output [3]: [ws_warehouse_sk#10, ws_order_number#11, ws_sold_date_sk#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 3] +Input [3]: [ws_warehouse_sk#10, ws_order_number#11, ws_sold_date_sk#12] + +(9) Project [codegen id : 3] +Output [2]: [ws_warehouse_sk#10, ws_order_number#11] +Input [3]: [ws_warehouse_sk#10, ws_order_number#11, ws_sold_date_sk#12] + +(10) Exchange +Input [2]: [ws_warehouse_sk#10, ws_order_number#11] +Arguments: hashpartitioning(ws_order_number#11, 5), ENSURE_REQUIREMENTS, [id=#13] + +(11) Sort [codegen id : 4] +Input [2]: [ws_warehouse_sk#10, ws_order_number#11] +Arguments: [ws_order_number#11 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 5] +Left keys [1]: [ws_order_number#5] +Right keys [1]: [ws_order_number#11] +Join condition: NOT (ws_warehouse_sk#4 = ws_warehouse_sk#10) + +(13) Project [codegen id : 5] +Output [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] + +(14) Scan parquet default.web_returns +Output [2]: [wr_order_number#14, wr_returned_date_sk#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 6] +Input [2]: [wr_order_number#14, wr_returned_date_sk#15] + +(16) Project [codegen id : 6] +Output [1]: [wr_order_number#14] +Input [2]: [wr_order_number#14, wr_returned_date_sk#15] + +(17) Exchange +Input [1]: [wr_order_number#14] +Arguments: hashpartitioning(wr_order_number#14, 5), ENSURE_REQUIREMENTS, [id=#16] + +(18) Sort [codegen id : 7] +Input [1]: [wr_order_number#14] +Arguments: [wr_order_number#14 ASC NULLS FIRST], false, 0 + +(19) SortMergeJoin +Left keys [1]: [ws_order_number#5] +Right keys [1]: [wr_order_number#14] +Join condition: None + +(20) Scan parquet default.customer_address +Output [2]: [ca_address_sk#17, ca_state#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 8] +Input [2]: [ca_address_sk#17, ca_state#18] + +(22) Filter [codegen id : 8] +Input [2]: [ca_address_sk#17, ca_state#18] +Condition : ((isnotnull(ca_state#18) AND (ca_state#18 = IL)) AND isnotnull(ca_address_sk#17)) + +(23) Project [codegen id : 8] +Output [1]: [ca_address_sk#17] +Input [2]: [ca_address_sk#17, ca_state#18] + +(24) BroadcastExchange +Input [1]: [ca_address_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] + +(25) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ws_ship_addr_sk#2] +Right keys [1]: [ca_address_sk#17] +Join condition: None + +(26) Project [codegen id : 11] +Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ca_address_sk#17] + +(27) Scan parquet default.web_site +Output [2]: [web_site_sk#20, web_company_name#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri ), IsNotNull(web_site_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 9] +Input [2]: [web_site_sk#20, web_company_name#21] + +(29) Filter [codegen id : 9] +Input [2]: [web_site_sk#20, web_company_name#21] +Condition : ((isnotnull(web_company_name#21) AND (web_company_name#21 = pri )) AND isnotnull(web_site_sk#20)) + +(30) Project [codegen id : 9] +Output [1]: [web_site_sk#20] +Input [2]: [web_site_sk#20, web_company_name#21] + +(31) BroadcastExchange +Input [1]: [web_site_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] + +(32) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ws_web_site_sk#3] +Right keys [1]: [web_site_sk#20] +Join condition: None + +(33) Project [codegen id : 11] +Output [4]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#20] + +(34) Scan parquet default.date_dim +Output [2]: [d_date_sk#23, d_date#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 10] +Input [2]: [d_date_sk#23, d_date#24] + +(36) Filter [codegen id : 10] +Input [2]: [d_date_sk#23, d_date#24] +Condition : (((isnotnull(d_date#24) AND (d_date#24 >= 1999-02-01)) AND (d_date#24 <= 1999-04-02)) AND isnotnull(d_date_sk#23)) + +(37) Project [codegen id : 10] +Output [1]: [d_date_sk#23] +Input [2]: [d_date_sk#23, d_date#24] + +(38) BroadcastExchange +Input [1]: [d_date_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] + +(39) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ws_ship_date_sk#1] +Right keys [1]: [d_date_sk#23] +Join condition: None + +(40) Project [codegen id : 11] +Output [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [5]: [ws_ship_date_sk#1, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#23] + +(41) HashAggregate [codegen id : 11] +Input [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Keys [1]: [ws_order_number#5] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#6)), partial_sum(UnscaledValue(ws_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27] +Results [3]: [ws_order_number#5, sum#28, sum#29] + +(42) HashAggregate [codegen id : 11] +Input [3]: [ws_order_number#5, sum#28, sum#29] +Keys [1]: [ws_order_number#5] +Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27] +Results [3]: [ws_order_number#5, sum#28, sum#29] + +(43) HashAggregate [codegen id : 11] +Input [3]: [ws_order_number#5, sum#28, sum#29] +Keys: [] +Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7)), partial_count(distinct ws_order_number#5)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27, count(ws_order_number#5)#30] +Results [3]: [sum#28, sum#29, count#31] + +(44) Exchange +Input [3]: [sum#28, sum#29, count#31] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#32] + +(45) HashAggregate [codegen id : 12] +Input [3]: [sum#28, sum#29, count#31] +Keys: [] +Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#6)), sum(UnscaledValue(ws_net_profit#7)), count(distinct ws_order_number#5)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27, count(ws_order_number#5)#30] +Results [3]: [count(ws_order_number#5)#30 AS order count #33, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#6))#26,17,2) AS total shipping cost #34, MakeDecimal(sum(UnscaledValue(ws_net_profit#7))#27,17,2) AS total net profit #35] + +(46) Sort [codegen id : 12] +Input [3]: [order count #33, total shipping cost #34, total net profit #35] +Arguments: [order count #33 ASC NULLS FIRST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt new file mode 100644 index 0000000000000..b3c313fb5ded6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94.sf100/simplified.txt @@ -0,0 +1,74 @@ +WholeStageCodegen (12) + Sort [order count ] + HashAggregate [sum,sum,count] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),order count ,total shipping cost ,total net profit ,sum,sum,count] + InputAdapter + Exchange #1 + WholeStageCodegen (11) + HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),sum,sum,count,sum,sum,count] + HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] + HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] + Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + Project [ws_ship_date_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_ship_date_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] + InputAdapter + SortMergeJoin [ws_order_number,wr_order_number] + WholeStageCodegen (5) + Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #2 + WholeStageCodegen (1) + Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,ws_sold_date_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #3 + WholeStageCodegen (3) + Project [ws_warehouse_sk,ws_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number,ws_sold_date_sk] + WholeStageCodegen (7) + Sort [wr_order_number] + InputAdapter + Exchange [wr_order_number] #4 + WholeStageCodegen (6) + Project [wr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_order_number,wr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (8) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (9) + Project [web_site_sk] + Filter [web_company_name,web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_company_name] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (10) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/explain.txt new file mode 100644 index 0000000000000..2d8c00cc4c936 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/explain.txt @@ -0,0 +1,260 @@ +== Physical Plan == +* Sort (46) ++- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * HashAggregate (42) + +- * HashAggregate (41) + +- * Project (40) + +- * BroadcastHashJoin Inner BuildRight (39) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Project (26) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- SortMergeJoin LeftAnti (19) + : : : :- * Project (13) + : : : : +- * SortMergeJoin LeftSemi (12) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * ColumnarToRow (8) + : : : : +- Scan parquet default.web_sales (7) + : : : +- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.web_returns (14) + : : +- BroadcastExchange (24) + : : +- * Project (23) + : : +- * Filter (22) + : : +- * ColumnarToRow (21) + : : +- Scan parquet default.date_dim (20) + : +- BroadcastExchange (31) + : +- * Project (30) + : +- * Filter (29) + : +- * ColumnarToRow (28) + : +- Scan parquet default.customer_address (27) + +- BroadcastExchange (38) + +- * Project (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.web_site (34) + + +(1) Scan parquet default.web_sales +Output [8]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ws_sold_date_sk#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_ship_date_sk), IsNotNull(ws_ship_addr_sk), IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [8]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ws_sold_date_sk#8] + +(3) Filter [codegen id : 1] +Input [8]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ws_sold_date_sk#8] +Condition : ((isnotnull(ws_ship_date_sk#1) AND isnotnull(ws_ship_addr_sk#2)) AND isnotnull(ws_web_site_sk#3)) + +(4) Project [codegen id : 1] +Output [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [8]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ws_sold_date_sk#8] + +(5) Exchange +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Arguments: hashpartitioning(ws_order_number#5, 5), ENSURE_REQUIREMENTS, [id=#9] + +(6) Sort [codegen id : 2] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Arguments: [ws_order_number#5 ASC NULLS FIRST], false, 0 + +(7) Scan parquet default.web_sales +Output [3]: [ws_warehouse_sk#10, ws_order_number#11, ws_sold_date_sk#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 3] +Input [3]: [ws_warehouse_sk#10, ws_order_number#11, ws_sold_date_sk#12] + +(9) Project [codegen id : 3] +Output [2]: [ws_warehouse_sk#10, ws_order_number#11] +Input [3]: [ws_warehouse_sk#10, ws_order_number#11, ws_sold_date_sk#12] + +(10) Exchange +Input [2]: [ws_warehouse_sk#10, ws_order_number#11] +Arguments: hashpartitioning(ws_order_number#11, 5), ENSURE_REQUIREMENTS, [id=#13] + +(11) Sort [codegen id : 4] +Input [2]: [ws_warehouse_sk#10, ws_order_number#11] +Arguments: [ws_order_number#11 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 5] +Left keys [1]: [ws_order_number#5] +Right keys [1]: [ws_order_number#11] +Join condition: NOT (ws_warehouse_sk#4 = ws_warehouse_sk#10) + +(13) Project [codegen id : 5] +Output [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_warehouse_sk#4, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] + +(14) Scan parquet default.web_returns +Output [2]: [wr_order_number#14, wr_returned_date_sk#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 6] +Input [2]: [wr_order_number#14, wr_returned_date_sk#15] + +(16) Project [codegen id : 6] +Output [1]: [wr_order_number#14] +Input [2]: [wr_order_number#14, wr_returned_date_sk#15] + +(17) Exchange +Input [1]: [wr_order_number#14] +Arguments: hashpartitioning(wr_order_number#14, 5), ENSURE_REQUIREMENTS, [id=#16] + +(18) Sort [codegen id : 7] +Input [1]: [wr_order_number#14] +Arguments: [wr_order_number#14 ASC NULLS FIRST], false, 0 + +(19) SortMergeJoin +Left keys [1]: [ws_order_number#5] +Right keys [1]: [wr_order_number#14] +Join condition: None + +(20) Scan parquet default.date_dim +Output [2]: [d_date_sk#17, d_date#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 8] +Input [2]: [d_date_sk#17, d_date#18] + +(22) Filter [codegen id : 8] +Input [2]: [d_date_sk#17, d_date#18] +Condition : (((isnotnull(d_date#18) AND (d_date#18 >= 1999-02-01)) AND (d_date#18 <= 1999-04-02)) AND isnotnull(d_date_sk#17)) + +(23) Project [codegen id : 8] +Output [1]: [d_date_sk#17] +Input [2]: [d_date_sk#17, d_date#18] + +(24) BroadcastExchange +Input [1]: [d_date_sk#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#19] + +(25) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ws_ship_date_sk#1] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(26) Project [codegen id : 11] +Output [5]: [ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, d_date_sk#17] + +(27) Scan parquet default.customer_address +Output [2]: [ca_address_sk#20, ca_state#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 9] +Input [2]: [ca_address_sk#20, ca_state#21] + +(29) Filter [codegen id : 9] +Input [2]: [ca_address_sk#20, ca_state#21] +Condition : ((isnotnull(ca_state#21) AND (ca_state#21 = IL)) AND isnotnull(ca_address_sk#20)) + +(30) Project [codegen id : 9] +Output [1]: [ca_address_sk#20] +Input [2]: [ca_address_sk#20, ca_state#21] + +(31) BroadcastExchange +Input [1]: [ca_address_sk#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] + +(32) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ws_ship_addr_sk#2] +Right keys [1]: [ca_address_sk#20] +Join condition: None + +(33) Project [codegen id : 11] +Output [4]: [ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [6]: [ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, ca_address_sk#20] + +(34) Scan parquet default.web_site +Output [2]: [web_site_sk#23, web_company_name#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri ), IsNotNull(web_site_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 10] +Input [2]: [web_site_sk#23, web_company_name#24] + +(36) Filter [codegen id : 10] +Input [2]: [web_site_sk#23, web_company_name#24] +Condition : ((isnotnull(web_company_name#24) AND (web_company_name#24 = pri )) AND isnotnull(web_site_sk#23)) + +(37) Project [codegen id : 10] +Output [1]: [web_site_sk#23] +Input [2]: [web_site_sk#23, web_company_name#24] + +(38) BroadcastExchange +Input [1]: [web_site_sk#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] + +(39) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ws_web_site_sk#3] +Right keys [1]: [web_site_sk#23] +Join condition: None + +(40) Project [codegen id : 11] +Output [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Input [5]: [ws_web_site_sk#3, ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7, web_site_sk#23] + +(41) HashAggregate [codegen id : 11] +Input [3]: [ws_order_number#5, ws_ext_ship_cost#6, ws_net_profit#7] +Keys [1]: [ws_order_number#5] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#6)), partial_sum(UnscaledValue(ws_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27] +Results [3]: [ws_order_number#5, sum#28, sum#29] + +(42) HashAggregate [codegen id : 11] +Input [3]: [ws_order_number#5, sum#28, sum#29] +Keys [1]: [ws_order_number#5] +Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27] +Results [3]: [ws_order_number#5, sum#28, sum#29] + +(43) HashAggregate [codegen id : 11] +Input [3]: [ws_order_number#5, sum#28, sum#29] +Keys: [] +Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#6)), merge_sum(UnscaledValue(ws_net_profit#7)), partial_count(distinct ws_order_number#5)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27, count(ws_order_number#5)#30] +Results [3]: [sum#28, sum#29, count#31] + +(44) Exchange +Input [3]: [sum#28, sum#29, count#31] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#32] + +(45) HashAggregate [codegen id : 12] +Input [3]: [sum#28, sum#29, count#31] +Keys: [] +Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#6)), sum(UnscaledValue(ws_net_profit#7)), count(distinct ws_order_number#5)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#6))#26, sum(UnscaledValue(ws_net_profit#7))#27, count(ws_order_number#5)#30] +Results [3]: [count(ws_order_number#5)#30 AS order count #33, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#6))#26,17,2) AS total shipping cost #34, MakeDecimal(sum(UnscaledValue(ws_net_profit#7))#27,17,2) AS total net profit #35] + +(46) Sort [codegen id : 12] +Input [3]: [order count #33, total shipping cost #34, total net profit #35] +Arguments: [order count #33 ASC NULLS FIRST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/simplified.txt new file mode 100644 index 0000000000000..cecad61df0774 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q94/simplified.txt @@ -0,0 +1,74 @@ +WholeStageCodegen (12) + Sort [order count ] + HashAggregate [sum,sum,count] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),order count ,total shipping cost ,total net profit ,sum,sum,count] + InputAdapter + Exchange #1 + WholeStageCodegen (11) + HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),sum,sum,count,sum,sum,count] + HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] + HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] + Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] + Project [ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + InputAdapter + SortMergeJoin [ws_order_number,wr_order_number] + WholeStageCodegen (5) + Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #2 + WholeStageCodegen (1) + Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_warehouse_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,ws_sold_date_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #3 + WholeStageCodegen (3) + Project [ws_warehouse_sk,ws_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number,ws_sold_date_sk] + WholeStageCodegen (7) + Sort [wr_order_number] + InputAdapter + Exchange [wr_order_number] #4 + WholeStageCodegen (6) + Project [wr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_order_number,wr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (8) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (9) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (10) + Project [web_site_sk] + Filter [web_company_name,web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_company_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt new file mode 100644 index 0000000000000..c9da298194fb8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/explain.txt @@ -0,0 +1,322 @@ +== Physical Plan == +* Sort (58) ++- * HashAggregate (57) + +- Exchange (56) + +- * HashAggregate (55) + +- * HashAggregate (54) + +- * HashAggregate (53) + +- * Project (52) + +- * BroadcastHashJoin Inner BuildRight (51) + :- * Project (45) + : +- * BroadcastHashJoin Inner BuildRight (44) + : :- * Project (38) + : : +- * BroadcastHashJoin Inner BuildRight (37) + : : :- * SortMergeJoin LeftSemi (31) + : : : :- * SortMergeJoin LeftSemi (17) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- * Project (16) + : : : : +- * SortMergeJoin Inner (15) + : : : : :- * Sort (12) + : : : : : +- Exchange (11) + : : : : : +- * Project (10) + : : : : : +- * Filter (9) + : : : : : +- * ColumnarToRow (8) + : : : : : +- Scan parquet default.web_sales (7) + : : : : +- * Sort (14) + : : : : +- ReusedExchange (13) + : : : +- * Project (30) + : : : +- * SortMergeJoin Inner (29) + : : : :- * SortMergeJoin Inner (26) + : : : : :- * Sort (23) + : : : : : +- Exchange (22) + : : : : : +- * Project (21) + : : : : : +- * Filter (20) + : : : : : +- * ColumnarToRow (19) + : : : : : +- Scan parquet default.web_returns (18) + : : : : +- * Sort (25) + : : : : +- ReusedExchange (24) + : : : +- * Sort (28) + : : : +- ReusedExchange (27) + : : +- BroadcastExchange (36) + : : +- * Project (35) + : : +- * Filter (34) + : : +- * ColumnarToRow (33) + : : +- Scan parquet default.customer_address (32) + : +- BroadcastExchange (43) + : +- * Project (42) + : +- * Filter (41) + : +- * ColumnarToRow (40) + : +- Scan parquet default.web_site (39) + +- BroadcastExchange (50) + +- * Project (49) + +- * Filter (48) + +- * ColumnarToRow (47) + +- Scan parquet default.date_dim (46) + + +(1) Scan parquet default.web_sales +Output [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ws_sold_date_sk#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_ship_date_sk), IsNotNull(ws_ship_addr_sk), IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ws_sold_date_sk#7] + +(3) Filter [codegen id : 1] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ws_sold_date_sk#7] +Condition : ((isnotnull(ws_ship_date_sk#1) AND isnotnull(ws_ship_addr_sk#2)) AND isnotnull(ws_web_site_sk#3)) + +(4) Project [codegen id : 1] +Output [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ws_sold_date_sk#7] + +(5) Exchange +Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Arguments: hashpartitioning(ws_order_number#4, 5), ENSURE_REQUIREMENTS, [id=#8] + +(6) Sort [codegen id : 2] +Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Arguments: [ws_order_number#4 ASC NULLS FIRST], false, 0 + +(7) Scan parquet default.web_sales +Output [3]: [ws_warehouse_sk#9, ws_order_number#10, ws_sold_date_sk#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_order_number), IsNotNull(ws_warehouse_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 3] +Input [3]: [ws_warehouse_sk#9, ws_order_number#10, ws_sold_date_sk#11] + +(9) Filter [codegen id : 3] +Input [3]: [ws_warehouse_sk#9, ws_order_number#10, ws_sold_date_sk#11] +Condition : (isnotnull(ws_order_number#10) AND isnotnull(ws_warehouse_sk#9)) + +(10) Project [codegen id : 3] +Output [2]: [ws_warehouse_sk#9, ws_order_number#10] +Input [3]: [ws_warehouse_sk#9, ws_order_number#10, ws_sold_date_sk#11] + +(11) Exchange +Input [2]: [ws_warehouse_sk#9, ws_order_number#10] +Arguments: hashpartitioning(ws_order_number#10, 5), ENSURE_REQUIREMENTS, [id=#12] + +(12) Sort [codegen id : 4] +Input [2]: [ws_warehouse_sk#9, ws_order_number#10] +Arguments: [ws_order_number#10 ASC NULLS FIRST], false, 0 + +(13) ReusedExchange [Reuses operator id: 11] +Output [2]: [ws_warehouse_sk#13, ws_order_number#14] + +(14) Sort [codegen id : 6] +Input [2]: [ws_warehouse_sk#13, ws_order_number#14] +Arguments: [ws_order_number#14 ASC NULLS FIRST], false, 0 + +(15) SortMergeJoin [codegen id : 7] +Left keys [1]: [ws_order_number#10] +Right keys [1]: [ws_order_number#14] +Join condition: NOT (ws_warehouse_sk#9 = ws_warehouse_sk#13) + +(16) Project [codegen id : 7] +Output [1]: [ws_order_number#10] +Input [4]: [ws_warehouse_sk#9, ws_order_number#10, ws_warehouse_sk#13, ws_order_number#14] + +(17) SortMergeJoin [codegen id : 8] +Left keys [1]: [ws_order_number#4] +Right keys [1]: [ws_order_number#10] +Join condition: None + +(18) Scan parquet default.web_returns +Output [2]: [wr_order_number#15, wr_returned_date_sk#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 9] +Input [2]: [wr_order_number#15, wr_returned_date_sk#16] + +(20) Filter [codegen id : 9] +Input [2]: [wr_order_number#15, wr_returned_date_sk#16] +Condition : isnotnull(wr_order_number#15) + +(21) Project [codegen id : 9] +Output [1]: [wr_order_number#15] +Input [2]: [wr_order_number#15, wr_returned_date_sk#16] + +(22) Exchange +Input [1]: [wr_order_number#15] +Arguments: hashpartitioning(wr_order_number#15, 5), ENSURE_REQUIREMENTS, [id=#17] + +(23) Sort [codegen id : 10] +Input [1]: [wr_order_number#15] +Arguments: [wr_order_number#15 ASC NULLS FIRST], false, 0 + +(24) ReusedExchange [Reuses operator id: 11] +Output [2]: [ws_warehouse_sk#18, ws_order_number#19] + +(25) Sort [codegen id : 12] +Input [2]: [ws_warehouse_sk#18, ws_order_number#19] +Arguments: [ws_order_number#19 ASC NULLS FIRST], false, 0 + +(26) SortMergeJoin [codegen id : 13] +Left keys [1]: [wr_order_number#15] +Right keys [1]: [ws_order_number#19] +Join condition: None + +(27) ReusedExchange [Reuses operator id: 11] +Output [2]: [ws_warehouse_sk#20, ws_order_number#21] + +(28) Sort [codegen id : 15] +Input [2]: [ws_warehouse_sk#20, ws_order_number#21] +Arguments: [ws_order_number#21 ASC NULLS FIRST], false, 0 + +(29) SortMergeJoin [codegen id : 16] +Left keys [1]: [ws_order_number#19] +Right keys [1]: [ws_order_number#21] +Join condition: NOT (ws_warehouse_sk#18 = ws_warehouse_sk#20) + +(30) Project [codegen id : 16] +Output [1]: [wr_order_number#15] +Input [5]: [wr_order_number#15, ws_warehouse_sk#18, ws_order_number#19, ws_warehouse_sk#20, ws_order_number#21] + +(31) SortMergeJoin [codegen id : 20] +Left keys [1]: [ws_order_number#4] +Right keys [1]: [wr_order_number#15] +Join condition: None + +(32) Scan parquet default.customer_address +Output [2]: [ca_address_sk#22, ca_state#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(33) ColumnarToRow [codegen id : 17] +Input [2]: [ca_address_sk#22, ca_state#23] + +(34) Filter [codegen id : 17] +Input [2]: [ca_address_sk#22, ca_state#23] +Condition : ((isnotnull(ca_state#23) AND (ca_state#23 = IL)) AND isnotnull(ca_address_sk#22)) + +(35) Project [codegen id : 17] +Output [1]: [ca_address_sk#22] +Input [2]: [ca_address_sk#22, ca_state#23] + +(36) BroadcastExchange +Input [1]: [ca_address_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(37) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [ws_ship_addr_sk#2] +Right keys [1]: [ca_address_sk#22] +Join condition: None + +(38) Project [codegen id : 20] +Output [5]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ca_address_sk#22] + +(39) Scan parquet default.web_site +Output [2]: [web_site_sk#25, web_company_name#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri ), IsNotNull(web_site_sk)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 18] +Input [2]: [web_site_sk#25, web_company_name#26] + +(41) Filter [codegen id : 18] +Input [2]: [web_site_sk#25, web_company_name#26] +Condition : ((isnotnull(web_company_name#26) AND (web_company_name#26 = pri )) AND isnotnull(web_site_sk#25)) + +(42) Project [codegen id : 18] +Output [1]: [web_site_sk#25] +Input [2]: [web_site_sk#25, web_company_name#26] + +(43) BroadcastExchange +Input [1]: [web_site_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] + +(44) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [ws_web_site_sk#3] +Right keys [1]: [web_site_sk#25] +Join condition: None + +(45) Project [codegen id : 20] +Output [4]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [6]: [ws_ship_date_sk#1, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#25] + +(46) Scan parquet default.date_dim +Output [2]: [d_date_sk#28, d_date#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 19] +Input [2]: [d_date_sk#28, d_date#29] + +(48) Filter [codegen id : 19] +Input [2]: [d_date_sk#28, d_date#29] +Condition : (((isnotnull(d_date#29) AND (d_date#29 >= 1999-02-01)) AND (d_date#29 <= 1999-04-02)) AND isnotnull(d_date_sk#28)) + +(49) Project [codegen id : 19] +Output [1]: [d_date_sk#28] +Input [2]: [d_date_sk#28, d_date#29] + +(50) BroadcastExchange +Input [1]: [d_date_sk#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30] + +(51) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [ws_ship_date_sk#1] +Right keys [1]: [d_date_sk#28] +Join condition: None + +(52) Project [codegen id : 20] +Output [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [5]: [ws_ship_date_sk#1, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#28] + +(53) HashAggregate [codegen id : 20] +Input [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Keys [1]: [ws_order_number#4] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#5)), partial_sum(UnscaledValue(ws_net_profit#6))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32] +Results [3]: [ws_order_number#4, sum#33, sum#34] + +(54) HashAggregate [codegen id : 20] +Input [3]: [ws_order_number#4, sum#33, sum#34] +Keys [1]: [ws_order_number#4] +Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#5)), merge_sum(UnscaledValue(ws_net_profit#6))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32] +Results [3]: [ws_order_number#4, sum#33, sum#34] + +(55) HashAggregate [codegen id : 20] +Input [3]: [ws_order_number#4, sum#33, sum#34] +Keys: [] +Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#5)), merge_sum(UnscaledValue(ws_net_profit#6)), partial_count(distinct ws_order_number#4)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32, count(ws_order_number#4)#35] +Results [3]: [sum#33, sum#34, count#36] + +(56) Exchange +Input [3]: [sum#33, sum#34, count#36] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#37] + +(57) HashAggregate [codegen id : 21] +Input [3]: [sum#33, sum#34, count#36] +Keys: [] +Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#5)), sum(UnscaledValue(ws_net_profit#6)), count(distinct ws_order_number#4)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32, count(ws_order_number#4)#35] +Results [3]: [count(ws_order_number#4)#35 AS order count #38, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#5))#31,17,2) AS total shipping cost #39, MakeDecimal(sum(UnscaledValue(ws_net_profit#6))#32,17,2) AS total net profit #40] + +(58) Sort [codegen id : 21] +Input [3]: [order count #38, total shipping cost #39, total net profit #40] +Arguments: [order count #38 ASC NULLS FIRST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt new file mode 100644 index 0000000000000..28d164854629b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95.sf100/simplified.txt @@ -0,0 +1,102 @@ +WholeStageCodegen (21) + Sort [order count ] + HashAggregate [sum,sum,count] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),order count ,total shipping cost ,total net profit ,sum,sum,count] + InputAdapter + Exchange #1 + WholeStageCodegen (20) + HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),sum,sum,count,sum,sum,count] + HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] + HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] + Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + Project [ws_ship_date_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_ship_date_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] + SortMergeJoin [ws_order_number,wr_order_number] + InputAdapter + WholeStageCodegen (8) + SortMergeJoin [ws_order_number,ws_order_number] + InputAdapter + WholeStageCodegen (2) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #2 + WholeStageCodegen (1) + Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,ws_sold_date_sk] + InputAdapter + WholeStageCodegen (7) + Project [ws_order_number] + SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #3 + WholeStageCodegen (3) + Project [ws_warehouse_sk,ws_order_number] + Filter [ws_order_number,ws_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number,ws_sold_date_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ws_order_number] + InputAdapter + ReusedExchange [ws_warehouse_sk,ws_order_number] #3 + InputAdapter + WholeStageCodegen (16) + Project [wr_order_number] + SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] + InputAdapter + WholeStageCodegen (13) + SortMergeJoin [wr_order_number,ws_order_number] + InputAdapter + WholeStageCodegen (10) + Sort [wr_order_number] + InputAdapter + Exchange [wr_order_number] #4 + WholeStageCodegen (9) + Project [wr_order_number] + Filter [wr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_order_number,wr_returned_date_sk] + InputAdapter + WholeStageCodegen (12) + Sort [ws_order_number] + InputAdapter + ReusedExchange [ws_warehouse_sk,ws_order_number] #3 + InputAdapter + WholeStageCodegen (15) + Sort [ws_order_number] + InputAdapter + ReusedExchange [ws_warehouse_sk,ws_order_number] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (17) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (18) + Project [web_site_sk] + Filter [web_company_name,web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_company_name] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (19) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/explain.txt new file mode 100644 index 0000000000000..253132c88e2c5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/explain.txt @@ -0,0 +1,327 @@ +== Physical Plan == +* Sort (59) ++- * HashAggregate (58) + +- Exchange (57) + +- * HashAggregate (56) + +- * HashAggregate (55) + +- * HashAggregate (54) + +- * Project (53) + +- * BroadcastHashJoin Inner BuildRight (52) + :- * Project (46) + : +- * BroadcastHashJoin Inner BuildRight (45) + : :- * Project (39) + : : +- * BroadcastHashJoin Inner BuildRight (38) + : : :- * SortMergeJoin LeftSemi (32) + : : : :- * SortMergeJoin LeftSemi (17) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.web_sales (1) + : : : : +- * Project (16) + : : : : +- * SortMergeJoin Inner (15) + : : : : :- * Sort (12) + : : : : : +- Exchange (11) + : : : : : +- * Project (10) + : : : : : +- * Filter (9) + : : : : : +- * ColumnarToRow (8) + : : : : : +- Scan parquet default.web_sales (7) + : : : : +- * Sort (14) + : : : : +- ReusedExchange (13) + : : : +- * Project (31) + : : : +- * SortMergeJoin Inner (30) + : : : :- * Sort (23) + : : : : +- Exchange (22) + : : : : +- * Project (21) + : : : : +- * Filter (20) + : : : : +- * ColumnarToRow (19) + : : : : +- Scan parquet default.web_returns (18) + : : : +- * Project (29) + : : : +- * SortMergeJoin Inner (28) + : : : :- * Sort (25) + : : : : +- ReusedExchange (24) + : : : +- * Sort (27) + : : : +- ReusedExchange (26) + : : +- BroadcastExchange (37) + : : +- * Project (36) + : : +- * Filter (35) + : : +- * ColumnarToRow (34) + : : +- Scan parquet default.date_dim (33) + : +- BroadcastExchange (44) + : +- * Project (43) + : +- * Filter (42) + : +- * ColumnarToRow (41) + : +- Scan parquet default.customer_address (40) + +- BroadcastExchange (51) + +- * Project (50) + +- * Filter (49) + +- * ColumnarToRow (48) + +- Scan parquet default.web_site (47) + + +(1) Scan parquet default.web_sales +Output [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ws_sold_date_sk#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_ship_date_sk), IsNotNull(ws_ship_addr_sk), IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ws_sold_date_sk#7] + +(3) Filter [codegen id : 1] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ws_sold_date_sk#7] +Condition : ((isnotnull(ws_ship_date_sk#1) AND isnotnull(ws_ship_addr_sk#2)) AND isnotnull(ws_web_site_sk#3)) + +(4) Project [codegen id : 1] +Output [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ws_sold_date_sk#7] + +(5) Exchange +Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Arguments: hashpartitioning(ws_order_number#4, 5), ENSURE_REQUIREMENTS, [id=#8] + +(6) Sort [codegen id : 2] +Input [6]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Arguments: [ws_order_number#4 ASC NULLS FIRST], false, 0 + +(7) Scan parquet default.web_sales +Output [3]: [ws_warehouse_sk#9, ws_order_number#10, ws_sold_date_sk#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_order_number), IsNotNull(ws_warehouse_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 3] +Input [3]: [ws_warehouse_sk#9, ws_order_number#10, ws_sold_date_sk#11] + +(9) Filter [codegen id : 3] +Input [3]: [ws_warehouse_sk#9, ws_order_number#10, ws_sold_date_sk#11] +Condition : (isnotnull(ws_order_number#10) AND isnotnull(ws_warehouse_sk#9)) + +(10) Project [codegen id : 3] +Output [2]: [ws_warehouse_sk#9, ws_order_number#10] +Input [3]: [ws_warehouse_sk#9, ws_order_number#10, ws_sold_date_sk#11] + +(11) Exchange +Input [2]: [ws_warehouse_sk#9, ws_order_number#10] +Arguments: hashpartitioning(ws_order_number#10, 5), ENSURE_REQUIREMENTS, [id=#12] + +(12) Sort [codegen id : 4] +Input [2]: [ws_warehouse_sk#9, ws_order_number#10] +Arguments: [ws_order_number#10 ASC NULLS FIRST], false, 0 + +(13) ReusedExchange [Reuses operator id: 11] +Output [2]: [ws_warehouse_sk#13, ws_order_number#14] + +(14) Sort [codegen id : 6] +Input [2]: [ws_warehouse_sk#13, ws_order_number#14] +Arguments: [ws_order_number#14 ASC NULLS FIRST], false, 0 + +(15) SortMergeJoin [codegen id : 7] +Left keys [1]: [ws_order_number#10] +Right keys [1]: [ws_order_number#14] +Join condition: NOT (ws_warehouse_sk#9 = ws_warehouse_sk#13) + +(16) Project [codegen id : 7] +Output [1]: [ws_order_number#10] +Input [4]: [ws_warehouse_sk#9, ws_order_number#10, ws_warehouse_sk#13, ws_order_number#14] + +(17) SortMergeJoin [codegen id : 8] +Left keys [1]: [ws_order_number#4] +Right keys [1]: [ws_order_number#10] +Join condition: None + +(18) Scan parquet default.web_returns +Output [2]: [wr_order_number#15, wr_returned_date_sk#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 9] +Input [2]: [wr_order_number#15, wr_returned_date_sk#16] + +(20) Filter [codegen id : 9] +Input [2]: [wr_order_number#15, wr_returned_date_sk#16] +Condition : isnotnull(wr_order_number#15) + +(21) Project [codegen id : 9] +Output [1]: [wr_order_number#15] +Input [2]: [wr_order_number#15, wr_returned_date_sk#16] + +(22) Exchange +Input [1]: [wr_order_number#15] +Arguments: hashpartitioning(wr_order_number#15, 5), ENSURE_REQUIREMENTS, [id=#17] + +(23) Sort [codegen id : 10] +Input [1]: [wr_order_number#15] +Arguments: [wr_order_number#15 ASC NULLS FIRST], false, 0 + +(24) ReusedExchange [Reuses operator id: 11] +Output [2]: [ws_warehouse_sk#18, ws_order_number#19] + +(25) Sort [codegen id : 12] +Input [2]: [ws_warehouse_sk#18, ws_order_number#19] +Arguments: [ws_order_number#19 ASC NULLS FIRST], false, 0 + +(26) ReusedExchange [Reuses operator id: 11] +Output [2]: [ws_warehouse_sk#20, ws_order_number#21] + +(27) Sort [codegen id : 14] +Input [2]: [ws_warehouse_sk#20, ws_order_number#21] +Arguments: [ws_order_number#21 ASC NULLS FIRST], false, 0 + +(28) SortMergeJoin [codegen id : 15] +Left keys [1]: [ws_order_number#19] +Right keys [1]: [ws_order_number#21] +Join condition: NOT (ws_warehouse_sk#18 = ws_warehouse_sk#20) + +(29) Project [codegen id : 15] +Output [1]: [ws_order_number#19] +Input [4]: [ws_warehouse_sk#18, ws_order_number#19, ws_warehouse_sk#20, ws_order_number#21] + +(30) SortMergeJoin [codegen id : 16] +Left keys [1]: [wr_order_number#15] +Right keys [1]: [ws_order_number#19] +Join condition: None + +(31) Project [codegen id : 16] +Output [1]: [wr_order_number#15] +Input [2]: [wr_order_number#15, ws_order_number#19] + +(32) SortMergeJoin [codegen id : 20] +Left keys [1]: [ws_order_number#4] +Right keys [1]: [wr_order_number#15] +Join condition: None + +(33) Scan parquet default.date_dim +Output [2]: [d_date_sk#22, d_date#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-01), LessThanOrEqual(d_date,1999-04-02), IsNotNull(d_date_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 17] +Input [2]: [d_date_sk#22, d_date#23] + +(35) Filter [codegen id : 17] +Input [2]: [d_date_sk#22, d_date#23] +Condition : (((isnotnull(d_date#23) AND (d_date#23 >= 1999-02-01)) AND (d_date#23 <= 1999-04-02)) AND isnotnull(d_date_sk#22)) + +(36) Project [codegen id : 17] +Output [1]: [d_date_sk#22] +Input [2]: [d_date_sk#22, d_date#23] + +(37) BroadcastExchange +Input [1]: [d_date_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(38) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [ws_ship_date_sk#1] +Right keys [1]: [d_date_sk#22] +Join condition: None + +(39) Project [codegen id : 20] +Output [5]: [ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [7]: [ws_ship_date_sk#1, ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, d_date_sk#22] + +(40) Scan parquet default.customer_address +Output [2]: [ca_address_sk#25, ca_state#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_state), EqualTo(ca_state,IL), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 18] +Input [2]: [ca_address_sk#25, ca_state#26] + +(42) Filter [codegen id : 18] +Input [2]: [ca_address_sk#25, ca_state#26] +Condition : ((isnotnull(ca_state#26) AND (ca_state#26 = IL)) AND isnotnull(ca_address_sk#25)) + +(43) Project [codegen id : 18] +Output [1]: [ca_address_sk#25] +Input [2]: [ca_address_sk#25, ca_state#26] + +(44) BroadcastExchange +Input [1]: [ca_address_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] + +(45) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [ws_ship_addr_sk#2] +Right keys [1]: [ca_address_sk#25] +Join condition: None + +(46) Project [codegen id : 20] +Output [4]: [ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [6]: [ws_ship_addr_sk#2, ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, ca_address_sk#25] + +(47) Scan parquet default.web_site +Output [2]: [web_site_sk#28, web_company_name#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_company_name), EqualTo(web_company_name,pri ), IsNotNull(web_site_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 19] +Input [2]: [web_site_sk#28, web_company_name#29] + +(49) Filter [codegen id : 19] +Input [2]: [web_site_sk#28, web_company_name#29] +Condition : ((isnotnull(web_company_name#29) AND (web_company_name#29 = pri )) AND isnotnull(web_site_sk#28)) + +(50) Project [codegen id : 19] +Output [1]: [web_site_sk#28] +Input [2]: [web_site_sk#28, web_company_name#29] + +(51) BroadcastExchange +Input [1]: [web_site_sk#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30] + +(52) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [ws_web_site_sk#3] +Right keys [1]: [web_site_sk#28] +Join condition: None + +(53) Project [codegen id : 20] +Output [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Input [5]: [ws_web_site_sk#3, ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6, web_site_sk#28] + +(54) HashAggregate [codegen id : 20] +Input [3]: [ws_order_number#4, ws_ext_ship_cost#5, ws_net_profit#6] +Keys [1]: [ws_order_number#4] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_ship_cost#5)), partial_sum(UnscaledValue(ws_net_profit#6))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32] +Results [3]: [ws_order_number#4, sum#33, sum#34] + +(55) HashAggregate [codegen id : 20] +Input [3]: [ws_order_number#4, sum#33, sum#34] +Keys [1]: [ws_order_number#4] +Functions [2]: [merge_sum(UnscaledValue(ws_ext_ship_cost#5)), merge_sum(UnscaledValue(ws_net_profit#6))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32] +Results [3]: [ws_order_number#4, sum#33, sum#34] + +(56) HashAggregate [codegen id : 20] +Input [3]: [ws_order_number#4, sum#33, sum#34] +Keys: [] +Functions [3]: [merge_sum(UnscaledValue(ws_ext_ship_cost#5)), merge_sum(UnscaledValue(ws_net_profit#6)), partial_count(distinct ws_order_number#4)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32, count(ws_order_number#4)#35] +Results [3]: [sum#33, sum#34, count#36] + +(57) Exchange +Input [3]: [sum#33, sum#34, count#36] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#37] + +(58) HashAggregate [codegen id : 21] +Input [3]: [sum#33, sum#34, count#36] +Keys: [] +Functions [3]: [sum(UnscaledValue(ws_ext_ship_cost#5)), sum(UnscaledValue(ws_net_profit#6)), count(distinct ws_order_number#4)] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_ship_cost#5))#31, sum(UnscaledValue(ws_net_profit#6))#32, count(ws_order_number#4)#35] +Results [3]: [count(ws_order_number#4)#35 AS order count #38, MakeDecimal(sum(UnscaledValue(ws_ext_ship_cost#5))#31,17,2) AS total shipping cost #39, MakeDecimal(sum(UnscaledValue(ws_net_profit#6))#32,17,2) AS total net profit #40] + +(59) Sort [codegen id : 21] +Input [3]: [order count #38, total shipping cost #39, total net profit #40] +Arguments: [order count #38 ASC NULLS FIRST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/simplified.txt new file mode 100644 index 0000000000000..4d40e31545a21 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q95/simplified.txt @@ -0,0 +1,103 @@ +WholeStageCodegen (21) + Sort [order count ] + HashAggregate [sum,sum,count] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),order count ,total shipping cost ,total net profit ,sum,sum,count] + InputAdapter + Exchange #1 + WholeStageCodegen (20) + HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),count(ws_order_number),sum,sum,count,sum,sum,count] + HashAggregate [ws_order_number] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] + HashAggregate [ws_order_number,ws_ext_ship_cost,ws_net_profit] [sum(UnscaledValue(ws_ext_ship_cost)),sum(UnscaledValue(ws_net_profit)),sum,sum,sum,sum] + Project [ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_addr_sk,ca_address_sk] + Project [ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + BroadcastHashJoin [ws_ship_date_sk,d_date_sk] + SortMergeJoin [ws_order_number,wr_order_number] + InputAdapter + WholeStageCodegen (8) + SortMergeJoin [ws_order_number,ws_order_number] + InputAdapter + WholeStageCodegen (2) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #2 + WholeStageCodegen (1) + Project [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit] + Filter [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_ship_date_sk,ws_ship_addr_sk,ws_web_site_sk,ws_order_number,ws_ext_ship_cost,ws_net_profit,ws_sold_date_sk] + InputAdapter + WholeStageCodegen (7) + Project [ws_order_number] + SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ws_order_number] + InputAdapter + Exchange [ws_order_number] #3 + WholeStageCodegen (3) + Project [ws_warehouse_sk,ws_order_number] + Filter [ws_order_number,ws_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_warehouse_sk,ws_order_number,ws_sold_date_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ws_order_number] + InputAdapter + ReusedExchange [ws_warehouse_sk,ws_order_number] #3 + InputAdapter + WholeStageCodegen (16) + Project [wr_order_number] + SortMergeJoin [wr_order_number,ws_order_number] + InputAdapter + WholeStageCodegen (10) + Sort [wr_order_number] + InputAdapter + Exchange [wr_order_number] #4 + WholeStageCodegen (9) + Project [wr_order_number] + Filter [wr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_order_number,wr_returned_date_sk] + InputAdapter + WholeStageCodegen (15) + Project [ws_order_number] + SortMergeJoin [ws_order_number,ws_order_number,ws_warehouse_sk,ws_warehouse_sk] + InputAdapter + WholeStageCodegen (12) + Sort [ws_order_number] + InputAdapter + ReusedExchange [ws_warehouse_sk,ws_order_number] #3 + InputAdapter + WholeStageCodegen (14) + Sort [ws_order_number] + InputAdapter + ReusedExchange [ws_warehouse_sk,ws_order_number] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (17) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (18) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (19) + Project [web_site_sk] + Filter [web_company_name,web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_company_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/explain.txt new file mode 100644 index 0000000000000..fdf792d409716 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/explain.txt @@ -0,0 +1,165 @@ +== Physical Plan == +* Sort (29) ++- * HashAggregate (28) + +- Exchange (27) + +- * HashAggregate (26) + +- * Project (25) + +- * BroadcastHashJoin Inner BuildRight (24) + :- * Project (18) + : +- * BroadcastHashJoin Inner BuildRight (17) + : :- * Project (11) + : : +- * BroadcastHashJoin Inner BuildRight (10) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (9) + : : +- * Project (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.time_dim (5) + : +- BroadcastExchange (16) + : +- * Project (15) + : +- * Filter (14) + : +- * ColumnarToRow (13) + : +- Scan parquet default.store (12) + +- BroadcastExchange (23) + +- * Project (22) + +- * Filter (21) + +- * ColumnarToRow (20) + +- Scan parquet default.household_demographics (19) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) + +(4) Project [codegen id : 4] +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] + +(5) Scan parquet default.time_dim +Output [3]: [t_time_sk#5, t_hour#6, t_minute#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,20), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [t_time_sk#5, t_hour#6, t_minute#7] + +(7) Filter [codegen id : 1] +Input [3]: [t_time_sk#5, t_hour#6, t_minute#7] +Condition : ((((isnotnull(t_hour#6) AND isnotnull(t_minute#7)) AND (t_hour#6 = 20)) AND (t_minute#7 >= 30)) AND isnotnull(t_time_sk#5)) + +(8) Project [codegen id : 1] +Output [1]: [t_time_sk#5] +Input [3]: [t_time_sk#5, t_hour#6, t_minute#7] + +(9) BroadcastExchange +Input [1]: [t_time_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(10) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#5] +Join condition: None + +(11) Project [codegen id : 4] +Output [2]: [ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, t_time_sk#5] + +(12) Scan parquet default.store +Output [2]: [s_store_sk#9, s_store_name#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_name), EqualTo(s_store_name,ese), IsNotNull(s_store_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#9, s_store_name#10] + +(14) Filter [codegen id : 2] +Input [2]: [s_store_sk#9, s_store_name#10] +Condition : ((isnotnull(s_store_name#10) AND (s_store_name#10 = ese)) AND isnotnull(s_store_sk#9)) + +(15) Project [codegen id : 2] +Output [1]: [s_store_sk#9] +Input [2]: [s_store_sk#9, s_store_name#10] + +(16) BroadcastExchange +Input [1]: [s_store_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(17) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#9] +Join condition: None + +(18) Project [codegen id : 4] +Output [1]: [ss_hdemo_sk#2] +Input [3]: [ss_hdemo_sk#2, ss_store_sk#3, s_store_sk#9] + +(19) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#12, hd_dep_count#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_dep_count), EqualTo(hd_dep_count,7), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 3] +Input [2]: [hd_demo_sk#12, hd_dep_count#13] + +(21) Filter [codegen id : 3] +Input [2]: [hd_demo_sk#12, hd_dep_count#13] +Condition : ((isnotnull(hd_dep_count#13) AND (hd_dep_count#13 = 7)) AND isnotnull(hd_demo_sk#12)) + +(22) Project [codegen id : 3] +Output [1]: [hd_demo_sk#12] +Input [2]: [hd_demo_sk#12, hd_dep_count#13] + +(23) BroadcastExchange +Input [1]: [hd_demo_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(24) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#12] +Join condition: None + +(25) Project [codegen id : 4] +Output: [] +Input [2]: [ss_hdemo_sk#2, hd_demo_sk#12] + +(26) HashAggregate [codegen id : 4] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#15] +Results [1]: [count#16] + +(27) Exchange +Input [1]: [count#16] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#17] + +(28) HashAggregate [codegen id : 5] +Input [1]: [count#16] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#18] +Results [1]: [count(1)#18 AS count(1)#19] + +(29) Sort [codegen id : 5] +Input [1]: [count(1)#19] +Arguments: [count(1)#19 ASC NULLS FIRST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/simplified.txt new file mode 100644 index 0000000000000..365c608815766 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96.sf100/simplified.txt @@ -0,0 +1,42 @@ +WholeStageCodegen (5) + Sort [count(1)] + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #1 + WholeStageCodegen (4) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_hdemo_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_hdemo_sk,ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_store_name,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96/explain.txt new file mode 100644 index 0000000000000..80ef7641eef1c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96/explain.txt @@ -0,0 +1,165 @@ +== Physical Plan == +* Sort (29) ++- * HashAggregate (28) + +- Exchange (27) + +- * HashAggregate (26) + +- * Project (25) + +- * BroadcastHashJoin Inner BuildRight (24) + :- * Project (18) + : +- * BroadcastHashJoin Inner BuildRight (17) + : :- * Project (11) + : : +- * BroadcastHashJoin Inner BuildRight (10) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (9) + : : +- * Project (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.household_demographics (5) + : +- BroadcastExchange (16) + : +- * Project (15) + : +- * Filter (14) + : +- * ColumnarToRow (13) + : +- Scan parquet default.time_dim (12) + +- BroadcastExchange (23) + +- * Project (22) + +- * Filter (21) + +- * ColumnarToRow (20) + +- Scan parquet default.store (19) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_hdemo_sk), IsNotNull(ss_sold_time_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] +Condition : ((isnotnull(ss_hdemo_sk#2) AND isnotnull(ss_sold_time_sk#1)) AND isnotnull(ss_store_sk#3)) + +(4) Project [codegen id : 4] +Output [3]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_sold_date_sk#4] + +(5) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#5, hd_dep_count#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_dep_count), EqualTo(hd_dep_count,7), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [2]: [hd_demo_sk#5, hd_dep_count#6] + +(7) Filter [codegen id : 1] +Input [2]: [hd_demo_sk#5, hd_dep_count#6] +Condition : ((isnotnull(hd_dep_count#6) AND (hd_dep_count#6 = 7)) AND isnotnull(hd_demo_sk#5)) + +(8) Project [codegen id : 1] +Output [1]: [hd_demo_sk#5] +Input [2]: [hd_demo_sk#5, hd_dep_count#6] + +(9) BroadcastExchange +Input [1]: [hd_demo_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(10) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#5] +Join condition: None + +(11) Project [codegen id : 4] +Output [2]: [ss_sold_time_sk#1, ss_store_sk#3] +Input [4]: [ss_sold_time_sk#1, ss_hdemo_sk#2, ss_store_sk#3, hd_demo_sk#5] + +(12) Scan parquet default.time_dim +Output [3]: [t_time_sk#8, t_hour#9, t_minute#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/time_dim] +PushedFilters: [IsNotNull(t_hour), IsNotNull(t_minute), EqualTo(t_hour,20), GreaterThanOrEqual(t_minute,30), IsNotNull(t_time_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 2] +Input [3]: [t_time_sk#8, t_hour#9, t_minute#10] + +(14) Filter [codegen id : 2] +Input [3]: [t_time_sk#8, t_hour#9, t_minute#10] +Condition : ((((isnotnull(t_hour#9) AND isnotnull(t_minute#10)) AND (t_hour#9 = 20)) AND (t_minute#10 >= 30)) AND isnotnull(t_time_sk#8)) + +(15) Project [codegen id : 2] +Output [1]: [t_time_sk#8] +Input [3]: [t_time_sk#8, t_hour#9, t_minute#10] + +(16) BroadcastExchange +Input [1]: [t_time_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(17) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_time_sk#1] +Right keys [1]: [t_time_sk#8] +Join condition: None + +(18) Project [codegen id : 4] +Output [1]: [ss_store_sk#3] +Input [3]: [ss_sold_time_sk#1, ss_store_sk#3, t_time_sk#8] + +(19) Scan parquet default.store +Output [2]: [s_store_sk#12, s_store_name#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_name), EqualTo(s_store_name,ese), IsNotNull(s_store_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#12, s_store_name#13] + +(21) Filter [codegen id : 3] +Input [2]: [s_store_sk#12, s_store_name#13] +Condition : ((isnotnull(s_store_name#13) AND (s_store_name#13 = ese)) AND isnotnull(s_store_sk#12)) + +(22) Project [codegen id : 3] +Output [1]: [s_store_sk#12] +Input [2]: [s_store_sk#12, s_store_name#13] + +(23) BroadcastExchange +Input [1]: [s_store_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(24) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#12] +Join condition: None + +(25) Project [codegen id : 4] +Output: [] +Input [2]: [ss_store_sk#3, s_store_sk#12] + +(26) HashAggregate [codegen id : 4] +Input: [] +Keys: [] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#15] +Results [1]: [count#16] + +(27) Exchange +Input [1]: [count#16] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#17] + +(28) HashAggregate [codegen id : 5] +Input [1]: [count#16] +Keys: [] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#18] +Results [1]: [count(1)#18 AS count(1)#19] + +(29) Sort [codegen id : 5] +Input [1]: [count(1)#19] +Arguments: [count(1)#19 ASC NULLS FIRST], true, 0 + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96/simplified.txt new file mode 100644 index 0000000000000..d783eb06cbc9c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q96/simplified.txt @@ -0,0 +1,42 @@ +WholeStageCodegen (5) + Sort [count(1)] + HashAggregate [count] [count(1),count(1),count] + InputAdapter + Exchange #1 + WholeStageCodegen (4) + HashAggregate [count,count] + Project + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk] + BroadcastHashJoin [ss_sold_time_sk,t_time_sk] + Project [ss_sold_time_sk,ss_store_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk] + Filter [ss_hdemo_sk,ss_sold_time_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_sold_time_sk,ss_hdemo_sk,ss_store_sk,ss_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [hd_demo_sk] + Filter [hd_dep_count,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_dep_count] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [t_time_sk] + Filter [t_hour,t_minute,t_time_sk] + ColumnarToRow + InputAdapter + Scan parquet default.time_dim [t_time_sk,t_hour,t_minute] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [s_store_sk] + Filter [s_store_name,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q97.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q97.sf100/explain.txt new file mode 100644 index 0000000000000..c01f3465ed693 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q97.sf100/explain.txt @@ -0,0 +1,176 @@ +== Physical Plan == +* HashAggregate (27) ++- Exchange (26) + +- * HashAggregate (25) + +- * Project (24) + +- SortMergeJoin FullOuter (23) + :- * Sort (13) + : +- * HashAggregate (12) + : +- Exchange (11) + : +- * HashAggregate (10) + : +- * Project (9) + : +- * BroadcastHashJoin Inner BuildRight (8) + : :- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (7) + : +- * Project (6) + : +- * Filter (5) + : +- * ColumnarToRow (4) + : +- Scan parquet default.date_dim (3) + +- * Sort (22) + +- * HashAggregate (21) + +- Exchange (20) + +- * HashAggregate (19) + +- * Project (18) + +- * BroadcastHashJoin Inner BuildRight (17) + :- * ColumnarToRow (15) + : +- Scan parquet default.catalog_sales (14) + +- ReusedExchange (16) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3] + +(3) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(4) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(5) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#5)) + +(6) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(7) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(9) Project [codegen id : 2] +Output [2]: [ss_item_sk#1, ss_customer_sk#2] +Input [4]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3, d_date_sk#5] + +(10) HashAggregate [codegen id : 2] +Input [2]: [ss_item_sk#1, ss_customer_sk#2] +Keys [2]: [ss_customer_sk#2, ss_item_sk#1] +Functions: [] +Aggregate Attributes: [] +Results [2]: [ss_customer_sk#2, ss_item_sk#1] + +(11) Exchange +Input [2]: [ss_customer_sk#2, ss_item_sk#1] +Arguments: hashpartitioning(ss_customer_sk#2, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#8] + +(12) HashAggregate [codegen id : 3] +Input [2]: [ss_customer_sk#2, ss_item_sk#1] +Keys [2]: [ss_customer_sk#2, ss_item_sk#1] +Functions: [] +Aggregate Attributes: [] +Results [2]: [ss_customer_sk#2 AS customer_sk#9, ss_item_sk#1 AS item_sk#10] + +(13) Sort [codegen id : 3] +Input [2]: [customer_sk#9, item_sk#10] +Arguments: [customer_sk#9 ASC NULLS FIRST, item_sk#10 ASC NULLS FIRST], false, 0 + +(14) Scan parquet default.catalog_sales +Output [3]: [cs_bill_customer_sk#11, cs_item_sk#12, cs_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#13), dynamicpruningexpression(cs_sold_date_sk#13 IN dynamicpruning#4)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 5] +Input [3]: [cs_bill_customer_sk#11, cs_item_sk#12, cs_sold_date_sk#13] + +(16) ReusedExchange [Reuses operator id: 7] +Output [1]: [d_date_sk#14] + +(17) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_sold_date_sk#13] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(18) Project [codegen id : 5] +Output [2]: [cs_bill_customer_sk#11, cs_item_sk#12] +Input [4]: [cs_bill_customer_sk#11, cs_item_sk#12, cs_sold_date_sk#13, d_date_sk#14] + +(19) HashAggregate [codegen id : 5] +Input [2]: [cs_bill_customer_sk#11, cs_item_sk#12] +Keys [2]: [cs_bill_customer_sk#11, cs_item_sk#12] +Functions: [] +Aggregate Attributes: [] +Results [2]: [cs_bill_customer_sk#11, cs_item_sk#12] + +(20) Exchange +Input [2]: [cs_bill_customer_sk#11, cs_item_sk#12] +Arguments: hashpartitioning(cs_bill_customer_sk#11, cs_item_sk#12, 5), ENSURE_REQUIREMENTS, [id=#15] + +(21) HashAggregate [codegen id : 6] +Input [2]: [cs_bill_customer_sk#11, cs_item_sk#12] +Keys [2]: [cs_bill_customer_sk#11, cs_item_sk#12] +Functions: [] +Aggregate Attributes: [] +Results [2]: [cs_bill_customer_sk#11 AS customer_sk#16, cs_item_sk#12 AS item_sk#17] + +(22) Sort [codegen id : 6] +Input [2]: [customer_sk#16, item_sk#17] +Arguments: [customer_sk#16 ASC NULLS FIRST, item_sk#17 ASC NULLS FIRST], false, 0 + +(23) SortMergeJoin +Left keys [2]: [customer_sk#9, item_sk#10] +Right keys [2]: [customer_sk#16, item_sk#17] +Join condition: None + +(24) Project [codegen id : 7] +Output [2]: [customer_sk#9, customer_sk#16] +Input [4]: [customer_sk#9, item_sk#10, customer_sk#16, item_sk#17] + +(25) HashAggregate [codegen id : 7] +Input [2]: [customer_sk#9, customer_sk#16] +Keys: [] +Functions [3]: [partial_sum(CASE WHEN (isnotnull(customer_sk#9) AND isnull(customer_sk#16)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (isnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (isnotnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END)] +Aggregate Attributes [3]: [sum#18, sum#19, sum#20] +Results [3]: [sum#21, sum#22, sum#23] + +(26) Exchange +Input [3]: [sum#21, sum#22, sum#23] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#24] + +(27) HashAggregate [codegen id : 8] +Input [3]: [sum#21, sum#22, sum#23] +Keys: [] +Functions [3]: [sum(CASE WHEN (isnotnull(customer_sk#9) AND isnull(customer_sk#16)) THEN 1 ELSE 0 END), sum(CASE WHEN (isnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END), sum(CASE WHEN (isnotnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END)] +Aggregate Attributes [3]: [sum(CASE WHEN (isnotnull(customer_sk#9) AND isnull(customer_sk#16)) THEN 1 ELSE 0 END)#25, sum(CASE WHEN (isnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END)#26, sum(CASE WHEN (isnotnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END)#27] +Results [3]: [sum(CASE WHEN (isnotnull(customer_sk#9) AND isnull(customer_sk#16)) THEN 1 ELSE 0 END)#25 AS store_only#28, sum(CASE WHEN (isnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END)#26 AS catalog_only#29, sum(CASE WHEN (isnotnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END)#27 AS store_and_catalog#30] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (28) + + +(28) ReusedExchange [Reuses operator id: 7] +Output [1]: [d_date_sk#5] + +Subquery:2 Hosting operator id = 14 Hosting Expression = cs_sold_date_sk#13 IN dynamicpruning#4 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q97.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q97.sf100/simplified.txt new file mode 100644 index 0000000000000..5aba214f237d7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q97.sf100/simplified.txt @@ -0,0 +1,46 @@ +WholeStageCodegen (8) + HashAggregate [sum,sum,sum] [sum(CASE WHEN (isnotnull(customer_sk) AND isnull(customer_sk)) THEN 1 ELSE 0 END),sum(CASE WHEN (isnull(customer_sk) AND isnotnull(customer_sk)) THEN 1 ELSE 0 END),sum(CASE WHEN (isnotnull(customer_sk) AND isnotnull(customer_sk)) THEN 1 ELSE 0 END),store_only,catalog_only,store_and_catalog,sum,sum,sum] + InputAdapter + Exchange #1 + WholeStageCodegen (7) + HashAggregate [customer_sk,customer_sk] [sum,sum,sum,sum,sum,sum] + Project [customer_sk,customer_sk] + InputAdapter + SortMergeJoin [customer_sk,item_sk,customer_sk,item_sk] + WholeStageCodegen (3) + Sort [customer_sk,item_sk] + HashAggregate [ss_customer_sk,ss_item_sk] [customer_sk,item_sk] + InputAdapter + Exchange [ss_customer_sk,ss_item_sk] #2 + WholeStageCodegen (2) + HashAggregate [ss_customer_sk,ss_item_sk] + Project [ss_item_sk,ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + WholeStageCodegen (6) + Sort [customer_sk,item_sk] + HashAggregate [cs_bill_customer_sk,cs_item_sk] [customer_sk,item_sk] + InputAdapter + Exchange [cs_bill_customer_sk,cs_item_sk] #4 + WholeStageCodegen (5) + HashAggregate [cs_bill_customer_sk,cs_item_sk] + Project [cs_bill_customer_sk,cs_item_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q97/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q97/explain.txt new file mode 100644 index 0000000000000..c01f3465ed693 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q97/explain.txt @@ -0,0 +1,176 @@ +== Physical Plan == +* HashAggregate (27) ++- Exchange (26) + +- * HashAggregate (25) + +- * Project (24) + +- SortMergeJoin FullOuter (23) + :- * Sort (13) + : +- * HashAggregate (12) + : +- Exchange (11) + : +- * HashAggregate (10) + : +- * Project (9) + : +- * BroadcastHashJoin Inner BuildRight (8) + : :- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (7) + : +- * Project (6) + : +- * Filter (5) + : +- * ColumnarToRow (4) + : +- Scan parquet default.date_dim (3) + +- * Sort (22) + +- * HashAggregate (21) + +- Exchange (20) + +- * HashAggregate (19) + +- * Project (18) + +- * BroadcastHashJoin Inner BuildRight (17) + :- * ColumnarToRow (15) + : +- Scan parquet default.catalog_sales (14) + +- ReusedExchange (16) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3] + +(3) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(4) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(5) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#5)) + +(6) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(7) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(9) Project [codegen id : 2] +Output [2]: [ss_item_sk#1, ss_customer_sk#2] +Input [4]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3, d_date_sk#5] + +(10) HashAggregate [codegen id : 2] +Input [2]: [ss_item_sk#1, ss_customer_sk#2] +Keys [2]: [ss_customer_sk#2, ss_item_sk#1] +Functions: [] +Aggregate Attributes: [] +Results [2]: [ss_customer_sk#2, ss_item_sk#1] + +(11) Exchange +Input [2]: [ss_customer_sk#2, ss_item_sk#1] +Arguments: hashpartitioning(ss_customer_sk#2, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#8] + +(12) HashAggregate [codegen id : 3] +Input [2]: [ss_customer_sk#2, ss_item_sk#1] +Keys [2]: [ss_customer_sk#2, ss_item_sk#1] +Functions: [] +Aggregate Attributes: [] +Results [2]: [ss_customer_sk#2 AS customer_sk#9, ss_item_sk#1 AS item_sk#10] + +(13) Sort [codegen id : 3] +Input [2]: [customer_sk#9, item_sk#10] +Arguments: [customer_sk#9 ASC NULLS FIRST, item_sk#10 ASC NULLS FIRST], false, 0 + +(14) Scan parquet default.catalog_sales +Output [3]: [cs_bill_customer_sk#11, cs_item_sk#12, cs_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#13), dynamicpruningexpression(cs_sold_date_sk#13 IN dynamicpruning#4)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 5] +Input [3]: [cs_bill_customer_sk#11, cs_item_sk#12, cs_sold_date_sk#13] + +(16) ReusedExchange [Reuses operator id: 7] +Output [1]: [d_date_sk#14] + +(17) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_sold_date_sk#13] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(18) Project [codegen id : 5] +Output [2]: [cs_bill_customer_sk#11, cs_item_sk#12] +Input [4]: [cs_bill_customer_sk#11, cs_item_sk#12, cs_sold_date_sk#13, d_date_sk#14] + +(19) HashAggregate [codegen id : 5] +Input [2]: [cs_bill_customer_sk#11, cs_item_sk#12] +Keys [2]: [cs_bill_customer_sk#11, cs_item_sk#12] +Functions: [] +Aggregate Attributes: [] +Results [2]: [cs_bill_customer_sk#11, cs_item_sk#12] + +(20) Exchange +Input [2]: [cs_bill_customer_sk#11, cs_item_sk#12] +Arguments: hashpartitioning(cs_bill_customer_sk#11, cs_item_sk#12, 5), ENSURE_REQUIREMENTS, [id=#15] + +(21) HashAggregate [codegen id : 6] +Input [2]: [cs_bill_customer_sk#11, cs_item_sk#12] +Keys [2]: [cs_bill_customer_sk#11, cs_item_sk#12] +Functions: [] +Aggregate Attributes: [] +Results [2]: [cs_bill_customer_sk#11 AS customer_sk#16, cs_item_sk#12 AS item_sk#17] + +(22) Sort [codegen id : 6] +Input [2]: [customer_sk#16, item_sk#17] +Arguments: [customer_sk#16 ASC NULLS FIRST, item_sk#17 ASC NULLS FIRST], false, 0 + +(23) SortMergeJoin +Left keys [2]: [customer_sk#9, item_sk#10] +Right keys [2]: [customer_sk#16, item_sk#17] +Join condition: None + +(24) Project [codegen id : 7] +Output [2]: [customer_sk#9, customer_sk#16] +Input [4]: [customer_sk#9, item_sk#10, customer_sk#16, item_sk#17] + +(25) HashAggregate [codegen id : 7] +Input [2]: [customer_sk#9, customer_sk#16] +Keys: [] +Functions [3]: [partial_sum(CASE WHEN (isnotnull(customer_sk#9) AND isnull(customer_sk#16)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (isnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (isnotnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END)] +Aggregate Attributes [3]: [sum#18, sum#19, sum#20] +Results [3]: [sum#21, sum#22, sum#23] + +(26) Exchange +Input [3]: [sum#21, sum#22, sum#23] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#24] + +(27) HashAggregate [codegen id : 8] +Input [3]: [sum#21, sum#22, sum#23] +Keys: [] +Functions [3]: [sum(CASE WHEN (isnotnull(customer_sk#9) AND isnull(customer_sk#16)) THEN 1 ELSE 0 END), sum(CASE WHEN (isnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END), sum(CASE WHEN (isnotnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END)] +Aggregate Attributes [3]: [sum(CASE WHEN (isnotnull(customer_sk#9) AND isnull(customer_sk#16)) THEN 1 ELSE 0 END)#25, sum(CASE WHEN (isnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END)#26, sum(CASE WHEN (isnotnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END)#27] +Results [3]: [sum(CASE WHEN (isnotnull(customer_sk#9) AND isnull(customer_sk#16)) THEN 1 ELSE 0 END)#25 AS store_only#28, sum(CASE WHEN (isnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END)#26 AS catalog_only#29, sum(CASE WHEN (isnotnull(customer_sk#9) AND isnotnull(customer_sk#16)) THEN 1 ELSE 0 END)#27 AS store_and_catalog#30] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (28) + + +(28) ReusedExchange [Reuses operator id: 7] +Output [1]: [d_date_sk#5] + +Subquery:2 Hosting operator id = 14 Hosting Expression = cs_sold_date_sk#13 IN dynamicpruning#4 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q97/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q97/simplified.txt new file mode 100644 index 0000000000000..5aba214f237d7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q97/simplified.txt @@ -0,0 +1,46 @@ +WholeStageCodegen (8) + HashAggregate [sum,sum,sum] [sum(CASE WHEN (isnotnull(customer_sk) AND isnull(customer_sk)) THEN 1 ELSE 0 END),sum(CASE WHEN (isnull(customer_sk) AND isnotnull(customer_sk)) THEN 1 ELSE 0 END),sum(CASE WHEN (isnotnull(customer_sk) AND isnotnull(customer_sk)) THEN 1 ELSE 0 END),store_only,catalog_only,store_and_catalog,sum,sum,sum] + InputAdapter + Exchange #1 + WholeStageCodegen (7) + HashAggregate [customer_sk,customer_sk] [sum,sum,sum,sum,sum,sum] + Project [customer_sk,customer_sk] + InputAdapter + SortMergeJoin [customer_sk,item_sk,customer_sk,item_sk] + WholeStageCodegen (3) + Sort [customer_sk,item_sk] + HashAggregate [ss_customer_sk,ss_item_sk] [customer_sk,item_sk] + InputAdapter + Exchange [ss_customer_sk,ss_item_sk] #2 + WholeStageCodegen (2) + HashAggregate [ss_customer_sk,ss_item_sk] + Project [ss_item_sk,ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + WholeStageCodegen (6) + Sort [customer_sk,item_sk] + HashAggregate [cs_bill_customer_sk,cs_item_sk] [customer_sk,item_sk] + InputAdapter + Exchange [cs_bill_customer_sk,cs_item_sk] #4 + WholeStageCodegen (5) + HashAggregate [cs_bill_customer_sk,cs_item_sk] + Project [cs_bill_customer_sk,cs_item_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt new file mode 100644 index 0000000000000..91f246ce2aa12 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/explain.txt @@ -0,0 +1,173 @@ +== Physical Plan == +* Project (29) ++- * Sort (28) + +- Exchange (27) + +- * Project (26) + +- Window (25) + +- * Sort (24) + +- Exchange (23) + +- * HashAggregate (22) + +- Exchange (21) + +- * HashAggregate (20) + +- * Project (19) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) + +- * Filter (15) + +- * ColumnarToRow (14) + +- Scan parquet default.date_dim (13) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 1] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Exchange +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#5] + +(5) Sort [codegen id : 2] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.item +Output [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports ,Books ,Home ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] + +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Condition : (i_category#11 IN (Sports ,Books ,Home ) AND isnotnull(i_item_sk#6)) + +(9) Exchange +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Arguments: hashpartitioning(i_item_sk#6, 5), ENSURE_REQUIREMENTS, [id=#12] + +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 + +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#6] +Join condition: None + +(12) Project [codegen id : 6] +Output [7]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Input [9]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] + +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#13, d_date#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#13, d_date#14] + +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#13, d_date#14] +Condition : (((isnotnull(d_date#14) AND (d_date#14 >= 1999-02-22)) AND (d_date#14 <= 1999-03-24)) AND isnotnull(d_date_sk#13)) + +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#13] +Input [2]: [d_date_sk#13, d_date#14] + +(17) BroadcastExchange +Input [1]: [d_date_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#13] +Join condition: None + +(19) Project [codegen id : 6] +Output [6]: [ss_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Input [8]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11, d_date_sk#13] + +(20) HashAggregate [codegen id : 6] +Input [6]: [ss_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#16] +Results [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] + +(21) Exchange +Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] +Arguments: hashpartitioning(i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, 5), ENSURE_REQUIREMENTS, [id=#18] + +(22) HashAggregate [codegen id : 7] +Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] +Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#19] +Results [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#19,17,2) AS itemrevenue#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#19,17,2) AS _w0#21, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#19,17,2) AS _w1#22, i_item_id#7] + +(23) Exchange +Input [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, i_item_id#7] +Arguments: hashpartitioning(i_class#10, 5), ENSURE_REQUIREMENTS, [id=#23] + +(24) Sort [codegen id : 8] +Input [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, i_item_id#7] +Arguments: [i_class#10 ASC NULLS FIRST], false, 0 + +(25) Window +Input [8]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, i_item_id#7] +Arguments: [sum(_w1#22) windowspecdefinition(i_class#10, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#24], [i_class#10] + +(26) Project [codegen id : 9] +Output [7]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#21) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#24)), DecimalType(38,17), true) AS revenueratio#25, i_item_id#7] +Input [9]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, i_item_id#7, _we0#24] + +(27) Exchange +Input [7]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25, i_item_id#7] +Arguments: rangepartitioning(i_category#11 ASC NULLS FIRST, i_class#10 ASC NULLS FIRST, i_item_id#7 ASC NULLS FIRST, i_item_desc#8 ASC NULLS FIRST, revenueratio#25 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#26] + +(28) Sort [codegen id : 10] +Input [7]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25, i_item_id#7] +Arguments: [i_category#11 ASC NULLS FIRST, i_class#10 ASC NULLS FIRST, i_item_id#7 ASC NULLS FIRST, i_item_desc#8 ASC NULLS FIRST, revenueratio#25 ASC NULLS FIRST], true, 0 + +(29) Project [codegen id : 10] +Output [6]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25] +Input [7]: [i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25, i_item_id#7] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (30) + + +(30) ReusedExchange [Reuses operator id: 17] +Output [1]: [d_date_sk#13] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt new file mode 100644 index 0000000000000..54ad1aead4c6d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98.sf100/simplified.txt @@ -0,0 +1,53 @@ +WholeStageCodegen (10) + Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,revenueratio] + Sort [i_category,i_class,i_item_id,i_item_desc,revenueratio] + InputAdapter + Exchange [i_category,i_class,i_item_id,i_item_desc,revenueratio] #1 + WholeStageCodegen (9) + Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0,i_item_id] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (8) + Sort [i_class] + InputAdapter + Exchange [i_class] #2 + WholeStageCodegen (7) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(ss_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #3 + WholeStageCodegen (6) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_ext_sales_price,ss_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #6 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98/explain.txt new file mode 100644 index 0000000000000..1507b5ccbc0ae --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98/explain.txt @@ -0,0 +1,158 @@ +== Physical Plan == +* Project (26) ++- * Sort (25) + +- Exchange (24) + +- * Project (23) + +- Window (22) + +- * Sort (21) + +- Exchange (20) + +- * HashAggregate (19) + +- Exchange (18) + +- * HashAggregate (17) + +- * Project (16) + +- * BroadcastHashJoin Inner BuildRight (15) + :- * Project (9) + : +- * BroadcastHashJoin Inner BuildRight (8) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) + +- BroadcastExchange (14) + +- * Project (13) + +- * Filter (12) + +- * ColumnarToRow (11) + +- Scan parquet default.date_dim (10) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports ,Books ,Home ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports ,Books ,Home ) AND isnotnull(i_item_sk#5)) + +(7) BroadcastExchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(9) Project [codegen id : 3] +Output [7]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 1999-02-22)) AND (d_date#13 <= 1999-03-24)) AND isnotnull(d_date_sk#12)) + +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] + +(14) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#12] +Join condition: None + +(16) Project [codegen id : 3] +Output [6]: [ss_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] + +(17) HashAggregate [codegen id : 3] +Input [6]: [ss_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#15] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] + +(18) Exchange +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), ENSURE_REQUIREMENTS, [id=#17] + +(19) HashAggregate [codegen id : 4] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#18] +Results [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#18,17,2) AS _w1#21, i_item_id#6] + +(20) Exchange +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: hashpartitioning(i_class#9, 5), ENSURE_REQUIREMENTS, [id=#22] + +(21) Sort [codegen id : 5] +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 + +(22) Window +Input [8]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] + +(23) Project [codegen id : 6] +Output [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24, i_item_id#6] +Input [9]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, i_item_id#6, _we0#23] + +(24) Exchange +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] +Arguments: rangepartitioning(i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#25] + +(25) Sort [codegen id : 7] +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] +Arguments: [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 + +(26) Project [codegen id : 7] +Output [6]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Input [7]: [i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24, i_item_id#6] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (27) + + +(27) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98/simplified.txt new file mode 100644 index 0000000000000..67205dff3ad35 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q98/simplified.txt @@ -0,0 +1,44 @@ +WholeStageCodegen (7) + Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,revenueratio] + Sort [i_category,i_class,i_item_id,i_item_desc,revenueratio] + InputAdapter + Exchange [i_category,i_class,i_item_id,i_item_desc,revenueratio] #1 + WholeStageCodegen (6) + Project [i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0,i_item_id] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (5) + Sort [i_class] + InputAdapter + Exchange [i_class] #2 + WholeStageCodegen (4) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(ss_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #3 + WholeStageCodegen (3) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_ext_sales_price,ss_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/explain.txt new file mode 100644 index 0000000000000..1b955ee3bd96c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/explain.txt @@ -0,0 +1,183 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * HashAggregate (31) + +- Exchange (30) + +- * HashAggregate (29) + +- * Project (28) + +- * BroadcastHashJoin Inner BuildRight (27) + :- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.ship_mode (11) + : +- BroadcastExchange (20) + : +- * Filter (19) + : +- * ColumnarToRow (18) + : +- Scan parquet default.call_center (17) + +- BroadcastExchange (26) + +- * Filter (25) + +- * ColumnarToRow (24) + +- Scan parquet default.warehouse (23) + + +(1) Scan parquet default.catalog_sales +Output [5]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_ship_mode_sk#3, cs_warehouse_sk#4, cs_sold_date_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_ship_mode_sk), IsNotNull(cs_call_center_sk), IsNotNull(cs_ship_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [5]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_ship_mode_sk#3, cs_warehouse_sk#4, cs_sold_date_sk#5] + +(3) Filter [codegen id : 5] +Input [5]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_ship_mode_sk#3, cs_warehouse_sk#4, cs_sold_date_sk#5] +Condition : (((isnotnull(cs_warehouse_sk#4) AND isnotnull(cs_ship_mode_sk#3)) AND isnotnull(cs_call_center_sk#2)) AND isnotnull(cs_ship_date_sk#1)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_month_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] +Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1200)) AND (d_month_seq#7 <= 1211)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_month_seq#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_ship_date_sk#1] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 5] +Output [5]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_ship_mode_sk#3, cs_warehouse_sk#4, cs_sold_date_sk#5] +Input [6]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_ship_mode_sk#3, cs_warehouse_sk#4, cs_sold_date_sk#5, d_date_sk#6] + +(11) Scan parquet default.ship_mode +Output [2]: [sm_ship_mode_sk#9, sm_type#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/ship_mode] +PushedFilters: [IsNotNull(sm_ship_mode_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [sm_ship_mode_sk#9, sm_type#10] + +(13) Filter [codegen id : 2] +Input [2]: [sm_ship_mode_sk#9, sm_type#10] +Condition : isnotnull(sm_ship_mode_sk#9) + +(14) BroadcastExchange +Input [2]: [sm_ship_mode_sk#9, sm_type#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_ship_mode_sk#3] +Right keys [1]: [sm_ship_mode_sk#9] +Join condition: None + +(16) Project [codegen id : 5] +Output [5]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_warehouse_sk#4, cs_sold_date_sk#5, sm_type#10] +Input [7]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_ship_mode_sk#3, cs_warehouse_sk#4, cs_sold_date_sk#5, sm_ship_mode_sk#9, sm_type#10] + +(17) Scan parquet default.call_center +Output [2]: [cc_call_center_sk#12, cc_name#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_call_center_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [2]: [cc_call_center_sk#12, cc_name#13] + +(19) Filter [codegen id : 3] +Input [2]: [cc_call_center_sk#12, cc_name#13] +Condition : isnotnull(cc_call_center_sk#12) + +(20) BroadcastExchange +Input [2]: [cc_call_center_sk#12, cc_name#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(21) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_call_center_sk#2] +Right keys [1]: [cc_call_center_sk#12] +Join condition: None + +(22) Project [codegen id : 5] +Output [5]: [cs_ship_date_sk#1, cs_warehouse_sk#4, cs_sold_date_sk#5, sm_type#10, cc_name#13] +Input [7]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_warehouse_sk#4, cs_sold_date_sk#5, sm_type#10, cc_call_center_sk#12, cc_name#13] + +(23) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#15, w_warehouse_name#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] + +(25) Filter [codegen id : 4] +Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] +Condition : isnotnull(w_warehouse_sk#15) + +(26) BroadcastExchange +Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(27) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_warehouse_sk#4] +Right keys [1]: [w_warehouse_sk#15] +Join condition: None + +(28) Project [codegen id : 5] +Output [5]: [cs_ship_date_sk#1, cs_sold_date_sk#5, sm_type#10, cc_name#13, substr(w_warehouse_name#16, 1, 20) AS _groupingexpression#18] +Input [7]: [cs_ship_date_sk#1, cs_warehouse_sk#4, cs_sold_date_sk#5, sm_type#10, cc_name#13, w_warehouse_sk#15, w_warehouse_name#16] + +(29) HashAggregate [codegen id : 5] +Input [5]: [cs_ship_date_sk#1, cs_sold_date_sk#5, sm_type#10, cc_name#13, _groupingexpression#18] +Keys [3]: [_groupingexpression#18, sm_type#10, cc_name#13] +Functions [5]: [partial_sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 30) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 60) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 90) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum#19, sum#20, sum#21, sum#22, sum#23] +Results [8]: [_groupingexpression#18, sm_type#10, cc_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] + +(30) Exchange +Input [8]: [_groupingexpression#18, sm_type#10, cc_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] +Arguments: hashpartitioning(_groupingexpression#18, sm_type#10, cc_name#13, 5), ENSURE_REQUIREMENTS, [id=#29] + +(31) HashAggregate [codegen id : 6] +Input [8]: [_groupingexpression#18, sm_type#10, cc_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] +Keys [3]: [_groupingexpression#18, sm_type#10, cc_name#13] +Functions [5]: [sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 30) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END), sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 60) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END), sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 90) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END), sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END)#30, sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 30) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END)#31, sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 60) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END)#32, sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 90) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END)#33, sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)#34] +Results [8]: [_groupingexpression#18 AS substr(w_warehouse_name, 1, 20)#35, sm_type#10, cc_name#13, sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END)#30 AS 30 days #36, sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 30) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END)#31 AS 31 - 60 days #37, sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 60) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END)#32 AS 61 - 90 days #38, sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 90) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END)#33 AS 91 - 120 days #39, sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)#34 AS >120 days #40] + +(32) TakeOrderedAndProject +Input [8]: [substr(w_warehouse_name, 1, 20)#35, sm_type#10, cc_name#13, 30 days #36, 31 - 60 days #37, 61 - 90 days #38, 91 - 120 days #39, >120 days #40] +Arguments: 100, [substr(w_warehouse_name, 1, 20)#35 ASC NULLS FIRST, sm_type#10 ASC NULLS FIRST, cc_name#13 ASC NULLS FIRST], [substr(w_warehouse_name, 1, 20)#35, sm_type#10, cc_name#13, 30 days #36, 31 - 60 days #37, 61 - 90 days #38, 91 - 120 days #39, >120 days #40] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/simplified.txt new file mode 100644 index 0000000000000..f8abda81b72bc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99.sf100/simplified.txt @@ -0,0 +1,48 @@ +TakeOrderedAndProject [substr(w_warehouse_name, 1, 20),sm_type,cc_name,30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ] + WholeStageCodegen (6) + HashAggregate [_groupingexpression,sm_type,cc_name,sum,sum,sum,sum,sum] [sum(CASE WHEN ((cs_ship_date_sk - cs_sold_date_sk) <= 30) THEN 1 ELSE 0 END),sum(CASE WHEN (((cs_ship_date_sk - cs_sold_date_sk) > 30) AND ((cs_ship_date_sk - cs_sold_date_sk) <= 60)) THEN 1 ELSE 0 END),sum(CASE WHEN (((cs_ship_date_sk - cs_sold_date_sk) > 60) AND ((cs_ship_date_sk - cs_sold_date_sk) <= 90)) THEN 1 ELSE 0 END),sum(CASE WHEN (((cs_ship_date_sk - cs_sold_date_sk) > 90) AND ((cs_ship_date_sk - cs_sold_date_sk) <= 120)) THEN 1 ELSE 0 END),sum(CASE WHEN ((cs_ship_date_sk - cs_sold_date_sk) > 120) THEN 1 ELSE 0 END),substr(w_warehouse_name, 1, 20),30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ,sum,sum,sum,sum,sum] + InputAdapter + Exchange [_groupingexpression,sm_type,cc_name] #1 + WholeStageCodegen (5) + HashAggregate [_groupingexpression,sm_type,cc_name,cs_ship_date_sk,cs_sold_date_sk] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [cs_ship_date_sk,cs_sold_date_sk,sm_type,cc_name,w_warehouse_name] + BroadcastHashJoin [cs_warehouse_sk,w_warehouse_sk] + Project [cs_ship_date_sk,cs_warehouse_sk,cs_sold_date_sk,sm_type,cc_name] + BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] + Project [cs_ship_date_sk,cs_call_center_sk,cs_warehouse_sk,cs_sold_date_sk,sm_type] + BroadcastHashJoin [cs_ship_mode_sk,sm_ship_mode_sk] + Project [cs_ship_date_sk,cs_call_center_sk,cs_ship_mode_sk,cs_warehouse_sk,cs_sold_date_sk] + BroadcastHashJoin [cs_ship_date_sk,d_date_sk] + Filter [cs_warehouse_sk,cs_ship_mode_sk,cs_call_center_sk,cs_ship_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_date_sk,cs_call_center_sk,cs_ship_mode_sk,cs_warehouse_sk,cs_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [sm_ship_mode_sk] + ColumnarToRow + InputAdapter + Scan parquet default.ship_mode [sm_ship_mode_sk,sm_type] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [cc_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.call_center [cc_call_center_sk,cc_name] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99/explain.txt new file mode 100644 index 0000000000000..1431623539828 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99/explain.txt @@ -0,0 +1,183 @@ +== Physical Plan == +TakeOrderedAndProject (32) ++- * HashAggregate (31) + +- Exchange (30) + +- * HashAggregate (29) + +- * Project (28) + +- * BroadcastHashJoin Inner BuildRight (27) + :- * Project (21) + : +- * BroadcastHashJoin Inner BuildRight (20) + : :- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.catalog_sales (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.warehouse (4) + : : +- BroadcastExchange (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.ship_mode (10) + : +- BroadcastExchange (19) + : +- * Filter (18) + : +- * ColumnarToRow (17) + : +- Scan parquet default.call_center (16) + +- BroadcastExchange (26) + +- * Project (25) + +- * Filter (24) + +- * ColumnarToRow (23) + +- Scan parquet default.date_dim (22) + + +(1) Scan parquet default.catalog_sales +Output [5]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_ship_mode_sk#3, cs_warehouse_sk#4, cs_sold_date_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_warehouse_sk), IsNotNull(cs_ship_mode_sk), IsNotNull(cs_call_center_sk), IsNotNull(cs_ship_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [5]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_ship_mode_sk#3, cs_warehouse_sk#4, cs_sold_date_sk#5] + +(3) Filter [codegen id : 5] +Input [5]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_ship_mode_sk#3, cs_warehouse_sk#4, cs_sold_date_sk#5] +Condition : (((isnotnull(cs_warehouse_sk#4) AND isnotnull(cs_ship_mode_sk#3)) AND isnotnull(cs_call_center_sk#2)) AND isnotnull(cs_ship_date_sk#1)) + +(4) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#6, w_warehouse_name#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [w_warehouse_sk#6, w_warehouse_name#7] + +(6) Filter [codegen id : 1] +Input [2]: [w_warehouse_sk#6, w_warehouse_name#7] +Condition : isnotnull(w_warehouse_sk#6) + +(7) BroadcastExchange +Input [2]: [w_warehouse_sk#6, w_warehouse_name#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] + +(8) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_warehouse_sk#4] +Right keys [1]: [w_warehouse_sk#6] +Join condition: None + +(9) Project [codegen id : 5] +Output [5]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_ship_mode_sk#3, cs_sold_date_sk#5, w_warehouse_name#7] +Input [7]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_ship_mode_sk#3, cs_warehouse_sk#4, cs_sold_date_sk#5, w_warehouse_sk#6, w_warehouse_name#7] + +(10) Scan parquet default.ship_mode +Output [2]: [sm_ship_mode_sk#9, sm_type#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/ship_mode] +PushedFilters: [IsNotNull(sm_ship_mode_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [sm_ship_mode_sk#9, sm_type#10] + +(12) Filter [codegen id : 2] +Input [2]: [sm_ship_mode_sk#9, sm_type#10] +Condition : isnotnull(sm_ship_mode_sk#9) + +(13) BroadcastExchange +Input [2]: [sm_ship_mode_sk#9, sm_type#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(14) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_ship_mode_sk#3] +Right keys [1]: [sm_ship_mode_sk#9] +Join condition: None + +(15) Project [codegen id : 5] +Output [5]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_sold_date_sk#5, w_warehouse_name#7, sm_type#10] +Input [7]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_ship_mode_sk#3, cs_sold_date_sk#5, w_warehouse_name#7, sm_ship_mode_sk#9, sm_type#10] + +(16) Scan parquet default.call_center +Output [2]: [cc_call_center_sk#12, cc_name#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_call_center_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [2]: [cc_call_center_sk#12, cc_name#13] + +(18) Filter [codegen id : 3] +Input [2]: [cc_call_center_sk#12, cc_name#13] +Condition : isnotnull(cc_call_center_sk#12) + +(19) BroadcastExchange +Input [2]: [cc_call_center_sk#12, cc_name#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(20) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_call_center_sk#2] +Right keys [1]: [cc_call_center_sk#12] +Join condition: None + +(21) Project [codegen id : 5] +Output [5]: [cs_ship_date_sk#1, cs_sold_date_sk#5, w_warehouse_name#7, sm_type#10, cc_name#13] +Input [7]: [cs_ship_date_sk#1, cs_call_center_sk#2, cs_sold_date_sk#5, w_warehouse_name#7, sm_type#10, cc_call_center_sk#12, cc_name#13] + +(22) Scan parquet default.date_dim +Output [2]: [d_date_sk#15, d_month_seq#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#15, d_month_seq#16] + +(24) Filter [codegen id : 4] +Input [2]: [d_date_sk#15, d_month_seq#16] +Condition : (((isnotnull(d_month_seq#16) AND (d_month_seq#16 >= 1200)) AND (d_month_seq#16 <= 1211)) AND isnotnull(d_date_sk#15)) + +(25) Project [codegen id : 4] +Output [1]: [d_date_sk#15] +Input [2]: [d_date_sk#15, d_month_seq#16] + +(26) BroadcastExchange +Input [1]: [d_date_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(27) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [cs_ship_date_sk#1] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(28) Project [codegen id : 5] +Output [5]: [cs_ship_date_sk#1, cs_sold_date_sk#5, sm_type#10, cc_name#13, substr(w_warehouse_name#7, 1, 20) AS _groupingexpression#18] +Input [6]: [cs_ship_date_sk#1, cs_sold_date_sk#5, w_warehouse_name#7, sm_type#10, cc_name#13, d_date_sk#15] + +(29) HashAggregate [codegen id : 5] +Input [5]: [cs_ship_date_sk#1, cs_sold_date_sk#5, sm_type#10, cc_name#13, _groupingexpression#18] +Keys [3]: [_groupingexpression#18, sm_type#10, cc_name#13] +Functions [5]: [partial_sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 30) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 60) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 90) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END), partial_sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum#19, sum#20, sum#21, sum#22, sum#23] +Results [8]: [_groupingexpression#18, sm_type#10, cc_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] + +(30) Exchange +Input [8]: [_groupingexpression#18, sm_type#10, cc_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] +Arguments: hashpartitioning(_groupingexpression#18, sm_type#10, cc_name#13, 5), ENSURE_REQUIREMENTS, [id=#29] + +(31) HashAggregate [codegen id : 6] +Input [8]: [_groupingexpression#18, sm_type#10, cc_name#13, sum#24, sum#25, sum#26, sum#27, sum#28] +Keys [3]: [_groupingexpression#18, sm_type#10, cc_name#13] +Functions [5]: [sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END), sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 30) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END), sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 60) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END), sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 90) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END), sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)] +Aggregate Attributes [5]: [sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END)#30, sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 30) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END)#31, sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 60) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END)#32, sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 90) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END)#33, sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)#34] +Results [8]: [_groupingexpression#18 AS substr(w_warehouse_name, 1, 20)#35, sm_type#10, cc_name#13, sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 30) THEN 1 ELSE 0 END)#30 AS 30 days #36, sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 30) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 60)) THEN 1 ELSE 0 END)#31 AS 31 - 60 days #37, sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 60) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 90)) THEN 1 ELSE 0 END)#32 AS 61 - 90 days #38, sum(CASE WHEN (((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 90) AND ((cs_ship_date_sk#1 - cs_sold_date_sk#5) <= 120)) THEN 1 ELSE 0 END)#33 AS 91 - 120 days #39, sum(CASE WHEN ((cs_ship_date_sk#1 - cs_sold_date_sk#5) > 120) THEN 1 ELSE 0 END)#34 AS >120 days #40] + +(32) TakeOrderedAndProject +Input [8]: [substr(w_warehouse_name, 1, 20)#35, sm_type#10, cc_name#13, 30 days #36, 31 - 60 days #37, 61 - 90 days #38, 91 - 120 days #39, >120 days #40] +Arguments: 100, [substr(w_warehouse_name, 1, 20)#35 ASC NULLS FIRST, sm_type#10 ASC NULLS FIRST, cc_name#13 ASC NULLS FIRST], [substr(w_warehouse_name, 1, 20)#35, sm_type#10, cc_name#13, 30 days #36, 31 - 60 days #37, 61 - 90 days #38, 91 - 120 days #39, >120 days #40] + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99/simplified.txt new file mode 100644 index 0000000000000..8c9e90042e5b3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v1_4/q99/simplified.txt @@ -0,0 +1,48 @@ +TakeOrderedAndProject [substr(w_warehouse_name, 1, 20),sm_type,cc_name,30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ] + WholeStageCodegen (6) + HashAggregate [_groupingexpression,sm_type,cc_name,sum,sum,sum,sum,sum] [sum(CASE WHEN ((cs_ship_date_sk - cs_sold_date_sk) <= 30) THEN 1 ELSE 0 END),sum(CASE WHEN (((cs_ship_date_sk - cs_sold_date_sk) > 30) AND ((cs_ship_date_sk - cs_sold_date_sk) <= 60)) THEN 1 ELSE 0 END),sum(CASE WHEN (((cs_ship_date_sk - cs_sold_date_sk) > 60) AND ((cs_ship_date_sk - cs_sold_date_sk) <= 90)) THEN 1 ELSE 0 END),sum(CASE WHEN (((cs_ship_date_sk - cs_sold_date_sk) > 90) AND ((cs_ship_date_sk - cs_sold_date_sk) <= 120)) THEN 1 ELSE 0 END),sum(CASE WHEN ((cs_ship_date_sk - cs_sold_date_sk) > 120) THEN 1 ELSE 0 END),substr(w_warehouse_name, 1, 20),30 days ,31 - 60 days ,61 - 90 days ,91 - 120 days ,>120 days ,sum,sum,sum,sum,sum] + InputAdapter + Exchange [_groupingexpression,sm_type,cc_name] #1 + WholeStageCodegen (5) + HashAggregate [_groupingexpression,sm_type,cc_name,cs_ship_date_sk,cs_sold_date_sk] [sum,sum,sum,sum,sum,sum,sum,sum,sum,sum] + Project [cs_ship_date_sk,cs_sold_date_sk,sm_type,cc_name,w_warehouse_name] + BroadcastHashJoin [cs_ship_date_sk,d_date_sk] + Project [cs_ship_date_sk,cs_sold_date_sk,w_warehouse_name,sm_type,cc_name] + BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] + Project [cs_ship_date_sk,cs_call_center_sk,cs_sold_date_sk,w_warehouse_name,sm_type] + BroadcastHashJoin [cs_ship_mode_sk,sm_ship_mode_sk] + Project [cs_ship_date_sk,cs_call_center_sk,cs_ship_mode_sk,cs_sold_date_sk,w_warehouse_name] + BroadcastHashJoin [cs_warehouse_sk,w_warehouse_sk] + Filter [cs_warehouse_sk,cs_ship_mode_sk,cs_call_center_sk,cs_ship_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_date_sk,cs_call_center_sk,cs_ship_mode_sk,cs_warehouse_sk,cs_sold_date_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [sm_ship_mode_sk] + ColumnarToRow + InputAdapter + Scan parquet default.ship_mode [sm_ship_mode_sk,sm_type] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [cc_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.call_center [cc_call_center_sk,cc_name] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/explain.txt new file mode 100644 index 0000000000000..60b02bac254bb --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/explain.txt @@ -0,0 +1,285 @@ +== Physical Plan == +TakeOrderedAndProject (49) ++- * HashAggregate (48) + +- Exchange (47) + +- * HashAggregate (46) + +- * Project (45) + +- * BroadcastHashJoin Inner BuildLeft (44) + :- BroadcastExchange (40) + : +- * Project (39) + : +- * BroadcastHashJoin Inner BuildRight (38) + : :- * Project (32) + : : +- * SortMergeJoin LeftSemi (31) + : : :- * SortMergeJoin LeftSemi (17) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer (1) + : : : +- * Sort (16) + : : : +- Exchange (15) + : : : +- * Project (14) + : : : +- * BroadcastHashJoin Inner BuildRight (13) + : : : :- * ColumnarToRow (7) + : : : : +- Scan parquet default.store_sales (6) + : : : +- BroadcastExchange (12) + : : : +- * Project (11) + : : : +- * Filter (10) + : : : +- * ColumnarToRow (9) + : : : +- Scan parquet default.date_dim (8) + : : +- * Sort (30) + : : +- Exchange (29) + : : +- Union (28) + : : :- * Project (22) + : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : :- * ColumnarToRow (19) + : : : : +- Scan parquet default.web_sales (18) + : : : +- ReusedExchange (20) + : : +- * Project (27) + : : +- * BroadcastHashJoin Inner BuildRight (26) + : : :- * ColumnarToRow (24) + : : : +- Scan parquet default.catalog_sales (23) + : : +- ReusedExchange (25) + : +- BroadcastExchange (37) + : +- * Project (36) + : +- * Filter (35) + : +- * ColumnarToRow (34) + : +- Scan parquet default.customer_address (33) + +- * Filter (43) + +- * ColumnarToRow (42) + +- Scan parquet default.customer_demographics (41) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(3) Filter [codegen id : 1] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Condition : (isnotnull(c_current_addr_sk#3) AND isnotnull(c_current_cdemo_sk#2)) + +(4) Exchange +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: hashpartitioning(c_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#4] + +(5) Sort [codegen id : 2] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ss_customer_sk#5, ss_sold_date_sk#6] + +(8) Scan parquet default.date_dim +Output [3]: [d_date_sk#8, d_year#9, d_moy#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2002), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,7), IsNotNull(d_date_sk)] +ReadSchema: struct + +(9) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(10) Filter [codegen id : 3] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] +Condition : (((((isnotnull(d_year#9) AND isnotnull(d_moy#10)) AND (d_year#9 = 2002)) AND (d_moy#10 >= 4)) AND (d_moy#10 <= 7)) AND isnotnull(d_date_sk#8)) + +(11) Project [codegen id : 3] +Output [1]: [d_date_sk#8] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(12) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(13) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(14) Project [codegen id : 4] +Output [1]: [ss_customer_sk#5] +Input [3]: [ss_customer_sk#5, ss_sold_date_sk#6, d_date_sk#8] + +(15) Exchange +Input [1]: [ss_customer_sk#5] +Arguments: hashpartitioning(ss_customer_sk#5, 5), ENSURE_REQUIREMENTS, [id=#12] + +(16) Sort [codegen id : 5] +Input [1]: [ss_customer_sk#5] +Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 + +(17) SortMergeJoin [codegen id : 6] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#5] +Join condition: None + +(18) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#13, ws_sold_date_sk#14] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#14), dynamicpruningexpression(ws_sold_date_sk#14 IN dynamicpruning#7)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 8] +Input [2]: [ws_bill_customer_sk#13, ws_sold_date_sk#14] + +(20) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#15] + +(21) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_sold_date_sk#14] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(22) Project [codegen id : 8] +Output [1]: [ws_bill_customer_sk#13 AS customer_sk#16] +Input [3]: [ws_bill_customer_sk#13, ws_sold_date_sk#14, d_date_sk#15] + +(23) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#17, cs_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#7)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 10] +Input [2]: [cs_ship_customer_sk#17, cs_sold_date_sk#18] + +(25) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#19] + +(26) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#19] +Join condition: None + +(27) Project [codegen id : 10] +Output [1]: [cs_ship_customer_sk#17 AS customer_sk#20] +Input [3]: [cs_ship_customer_sk#17, cs_sold_date_sk#18, d_date_sk#19] + +(28) Union + +(29) Exchange +Input [1]: [customer_sk#16] +Arguments: hashpartitioning(customer_sk#16, 5), ENSURE_REQUIREMENTS, [id=#21] + +(30) Sort [codegen id : 11] +Input [1]: [customer_sk#16] +Arguments: [customer_sk#16 ASC NULLS FIRST], false, 0 + +(31) SortMergeJoin [codegen id : 13] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customer_sk#16] +Join condition: None + +(32) Project [codegen id : 13] +Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(33) Scan parquet default.customer_address +Output [2]: [ca_address_sk#22, ca_county#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_county, [Walker County,Richland County,Gaines County,Douglas County,Dona Ana County]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 12] +Input [2]: [ca_address_sk#22, ca_county#23] + +(35) Filter [codegen id : 12] +Input [2]: [ca_address_sk#22, ca_county#23] +Condition : (ca_county#23 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#22)) + +(36) Project [codegen id : 12] +Output [1]: [ca_address_sk#22] +Input [2]: [ca_address_sk#22, ca_county#23] + +(37) BroadcastExchange +Input [1]: [ca_address_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(38) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#22] +Join condition: None + +(39) Project [codegen id : 13] +Output [1]: [c_current_cdemo_sk#2] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#22] + +(40) BroadcastExchange +Input [1]: [c_current_cdemo_sk#2] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#25] + +(41) Scan parquet default.customer_demographics +Output [9]: [cd_demo_sk#26, cd_gender#27, cd_marital_status#28, cd_education_status#29, cd_purchase_estimate#30, cd_credit_rating#31, cd_dep_count#32, cd_dep_employed_count#33, cd_dep_college_count#34] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(42) ColumnarToRow +Input [9]: [cd_demo_sk#26, cd_gender#27, cd_marital_status#28, cd_education_status#29, cd_purchase_estimate#30, cd_credit_rating#31, cd_dep_count#32, cd_dep_employed_count#33, cd_dep_college_count#34] + +(43) Filter +Input [9]: [cd_demo_sk#26, cd_gender#27, cd_marital_status#28, cd_education_status#29, cd_purchase_estimate#30, cd_credit_rating#31, cd_dep_count#32, cd_dep_employed_count#33, cd_dep_college_count#34] +Condition : isnotnull(cd_demo_sk#26) + +(44) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#26] +Join condition: None + +(45) Project [codegen id : 14] +Output [8]: [cd_gender#27, cd_marital_status#28, cd_education_status#29, cd_purchase_estimate#30, cd_credit_rating#31, cd_dep_count#32, cd_dep_employed_count#33, cd_dep_college_count#34] +Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#26, cd_gender#27, cd_marital_status#28, cd_education_status#29, cd_purchase_estimate#30, cd_credit_rating#31, cd_dep_count#32, cd_dep_employed_count#33, cd_dep_college_count#34] + +(46) HashAggregate [codegen id : 14] +Input [8]: [cd_gender#27, cd_marital_status#28, cd_education_status#29, cd_purchase_estimate#30, cd_credit_rating#31, cd_dep_count#32, cd_dep_employed_count#33, cd_dep_college_count#34] +Keys [8]: [cd_gender#27, cd_marital_status#28, cd_education_status#29, cd_purchase_estimate#30, cd_credit_rating#31, cd_dep_count#32, cd_dep_employed_count#33, cd_dep_college_count#34] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#35] +Results [9]: [cd_gender#27, cd_marital_status#28, cd_education_status#29, cd_purchase_estimate#30, cd_credit_rating#31, cd_dep_count#32, cd_dep_employed_count#33, cd_dep_college_count#34, count#36] + +(47) Exchange +Input [9]: [cd_gender#27, cd_marital_status#28, cd_education_status#29, cd_purchase_estimate#30, cd_credit_rating#31, cd_dep_count#32, cd_dep_employed_count#33, cd_dep_college_count#34, count#36] +Arguments: hashpartitioning(cd_gender#27, cd_marital_status#28, cd_education_status#29, cd_purchase_estimate#30, cd_credit_rating#31, cd_dep_count#32, cd_dep_employed_count#33, cd_dep_college_count#34, 5), ENSURE_REQUIREMENTS, [id=#37] + +(48) HashAggregate [codegen id : 15] +Input [9]: [cd_gender#27, cd_marital_status#28, cd_education_status#29, cd_purchase_estimate#30, cd_credit_rating#31, cd_dep_count#32, cd_dep_employed_count#33, cd_dep_college_count#34, count#36] +Keys [8]: [cd_gender#27, cd_marital_status#28, cd_education_status#29, cd_purchase_estimate#30, cd_credit_rating#31, cd_dep_count#32, cd_dep_employed_count#33, cd_dep_college_count#34] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#38] +Results [14]: [cd_gender#27, cd_marital_status#28, cd_education_status#29, count(1)#38 AS cnt1#39, cd_purchase_estimate#30, count(1)#38 AS cnt2#40, cd_credit_rating#31, count(1)#38 AS cnt3#41, cd_dep_count#32, count(1)#38 AS cnt4#42, cd_dep_employed_count#33, count(1)#38 AS cnt5#43, cd_dep_college_count#34, count(1)#38 AS cnt6#44] + +(49) TakeOrderedAndProject +Input [14]: [cd_gender#27, cd_marital_status#28, cd_education_status#29, cnt1#39, cd_purchase_estimate#30, cnt2#40, cd_credit_rating#31, cnt3#41, cd_dep_count#32, cnt4#42, cd_dep_employed_count#33, cnt5#43, cd_dep_college_count#34, cnt6#44] +Arguments: 100, [cd_gender#27 ASC NULLS FIRST, cd_marital_status#28 ASC NULLS FIRST, cd_education_status#29 ASC NULLS FIRST, cd_purchase_estimate#30 ASC NULLS FIRST, cd_credit_rating#31 ASC NULLS FIRST, cd_dep_count#32 ASC NULLS FIRST, cd_dep_employed_count#33 ASC NULLS FIRST, cd_dep_college_count#34 ASC NULLS FIRST], [cd_gender#27, cd_marital_status#28, cd_education_status#29, cnt1#39, cd_purchase_estimate#30, cnt2#40, cd_credit_rating#31, cnt3#41, cd_dep_count#32, cnt4#42, cd_dep_employed_count#33, cnt5#43, cd_dep_college_count#34, cnt6#44] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (50) + + +(50) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 18 Hosting Expression = ws_sold_date_sk#14 IN dynamicpruning#7 + +Subquery:3 Hosting operator id = 23 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/simplified.txt new file mode 100644 index 0000000000000..433cb374a4c75 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a.sf100/simplified.txt @@ -0,0 +1,86 @@ +TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,cnt2,cnt3,cnt4,cnt5,cnt6] + WholeStageCodegen (15) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count] [count(1),cnt1,cnt2,cnt3,cnt4,cnt5,cnt6,count] + InputAdapter + Exchange [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 + WholeStageCodegen (14) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,count] + Project [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (13) + Project [c_current_cdemo_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + SortMergeJoin [c_customer_sk,customer_sk] + InputAdapter + WholeStageCodegen (6) + SortMergeJoin [c_customer_sk,ss_customer_sk] + InputAdapter + WholeStageCodegen (2) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #3 + WholeStageCodegen (1) + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (5) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #4 + WholeStageCodegen (4) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + WholeStageCodegen (11) + Sort [customer_sk] + InputAdapter + Exchange [customer_sk] #6 + Union + WholeStageCodegen (8) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + WholeStageCodegen (10) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (12) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/explain.txt new file mode 100644 index 0000000000000..62054fe96dd5c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/explain.txt @@ -0,0 +1,265 @@ +== Physical Plan == +TakeOrderedAndProject (45) ++- * HashAggregate (44) + +- Exchange (43) + +- * HashAggregate (42) + +- * Project (41) + +- * BroadcastHashJoin Inner BuildRight (40) + :- * Project (35) + : +- * BroadcastHashJoin Inner BuildRight (34) + : :- * Project (28) + : : +- * BroadcastHashJoin LeftSemi BuildRight (27) + : : :- * BroadcastHashJoin LeftSemi BuildRight (14) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer (1) + : : : +- BroadcastExchange (13) + : : : +- * Project (12) + : : : +- * BroadcastHashJoin Inner BuildRight (11) + : : : :- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (10) + : : : +- * Project (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.date_dim (6) + : : +- BroadcastExchange (26) + : : +- Union (25) + : : :- * Project (19) + : : : +- * BroadcastHashJoin Inner BuildRight (18) + : : : :- * ColumnarToRow (16) + : : : : +- Scan parquet default.web_sales (15) + : : : +- ReusedExchange (17) + : : +- * Project (24) + : : +- * BroadcastHashJoin Inner BuildRight (23) + : : :- * ColumnarToRow (21) + : : : +- Scan parquet default.catalog_sales (20) + : : +- ReusedExchange (22) + : +- BroadcastExchange (33) + : +- * Project (32) + : +- * Filter (31) + : +- * ColumnarToRow (30) + : +- Scan parquet default.customer_address (29) + +- BroadcastExchange (39) + +- * Filter (38) + +- * ColumnarToRow (37) + +- Scan parquet default.customer_demographics (36) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(3) Filter [codegen id : 9] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Condition : (isnotnull(c_current_addr_sk#3) AND isnotnull(c_current_cdemo_sk#2)) + +(4) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 2] +Input [2]: [ss_customer_sk#4, ss_sold_date_sk#5] + +(6) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_moy#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2002), GreaterThanOrEqual(d_moy,4), LessThanOrEqual(d_moy,7), IsNotNull(d_date_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] + +(8) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] +Condition : (((((isnotnull(d_year#8) AND isnotnull(d_moy#9)) AND (d_year#8 = 2002)) AND (d_moy#9 >= 4)) AND (d_moy#9 <= 7)) AND isnotnull(d_date_sk#7)) + +(9) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_moy#9] + +(10) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(11) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(12) Project [codegen id : 2] +Output [1]: [ss_customer_sk#4] +Input [3]: [ss_customer_sk#4, ss_sold_date_sk#5, d_date_sk#7] + +(13) BroadcastExchange +Input [1]: [ss_customer_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(14) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#4] +Join condition: None + +(15) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#12, ws_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#13), dynamicpruningexpression(ws_sold_date_sk#13 IN dynamicpruning#6)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 4] +Input [2]: [ws_bill_customer_sk#12, ws_sold_date_sk#13] + +(17) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#14] + +(18) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_sold_date_sk#13] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(19) Project [codegen id : 4] +Output [1]: [ws_bill_customer_sk#12 AS customer_sk#15] +Input [3]: [ws_bill_customer_sk#12, ws_sold_date_sk#13, d_date_sk#14] + +(20) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#16, cs_sold_date_sk#17] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#17), dynamicpruningexpression(cs_sold_date_sk#17 IN dynamicpruning#6)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [2]: [cs_ship_customer_sk#16, cs_sold_date_sk#17] + +(22) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#18] + +(23) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#17] +Right keys [1]: [d_date_sk#18] +Join condition: None + +(24) Project [codegen id : 6] +Output [1]: [cs_ship_customer_sk#16 AS customer_sk#19] +Input [3]: [cs_ship_customer_sk#16, cs_sold_date_sk#17, d_date_sk#18] + +(25) Union + +(26) BroadcastExchange +Input [1]: [customer_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] + +(27) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customer_sk#15] +Join condition: None + +(28) Project [codegen id : 9] +Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(29) Scan parquet default.customer_address +Output [2]: [ca_address_sk#21, ca_county#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_county, [Walker County,Richland County,Gaines County,Douglas County,Dona Ana County]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#21, ca_county#22] + +(31) Filter [codegen id : 7] +Input [2]: [ca_address_sk#21, ca_county#22] +Condition : (ca_county#22 IN (Walker County,Richland County,Gaines County,Douglas County,Dona Ana County) AND isnotnull(ca_address_sk#21)) + +(32) Project [codegen id : 7] +Output [1]: [ca_address_sk#21] +Input [2]: [ca_address_sk#21, ca_county#22] + +(33) BroadcastExchange +Input [1]: [ca_address_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] + +(34) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#21] +Join condition: None + +(35) Project [codegen id : 9] +Output [1]: [c_current_cdemo_sk#2] +Input [3]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#21] + +(36) Scan parquet default.customer_demographics +Output [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 8] +Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] + +(38) Filter [codegen id : 8] +Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Condition : isnotnull(cd_demo_sk#24) + +(39) BroadcastExchange +Input [9]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#33] + +(40) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#24] +Join condition: None + +(41) Project [codegen id : 9] +Output [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Input [10]: [c_current_cdemo_sk#2, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] + +(42) HashAggregate [codegen id : 9] +Input [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Keys [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#34] +Results [9]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, count#35] + +(43) Exchange +Input [9]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, count#35] +Arguments: hashpartitioning(cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, 5), ENSURE_REQUIREMENTS, [id=#36] + +(44) HashAggregate [codegen id : 10] +Input [9]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, count#35] +Keys [8]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cd_purchase_estimate#28, cd_credit_rating#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#37] +Results [14]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, count(1)#37 AS cnt1#38, cd_purchase_estimate#28, count(1)#37 AS cnt2#39, cd_credit_rating#29, count(1)#37 AS cnt3#40, cd_dep_count#30, count(1)#37 AS cnt4#41, cd_dep_employed_count#31, count(1)#37 AS cnt5#42, cd_dep_college_count#32, count(1)#37 AS cnt6#43] + +(45) TakeOrderedAndProject +Input [14]: [cd_gender#25, cd_marital_status#26, cd_education_status#27, cnt1#38, cd_purchase_estimate#28, cnt2#39, cd_credit_rating#29, cnt3#40, cd_dep_count#30, cnt4#41, cd_dep_employed_count#31, cnt5#42, cd_dep_college_count#32, cnt6#43] +Arguments: 100, [cd_gender#25 ASC NULLS FIRST, cd_marital_status#26 ASC NULLS FIRST, cd_education_status#27 ASC NULLS FIRST, cd_purchase_estimate#28 ASC NULLS FIRST, cd_credit_rating#29 ASC NULLS FIRST, cd_dep_count#30 ASC NULLS FIRST, cd_dep_employed_count#31 ASC NULLS FIRST, cd_dep_college_count#32 ASC NULLS FIRST], [cd_gender#25, cd_marital_status#26, cd_education_status#27, cnt1#38, cd_purchase_estimate#28, cnt2#39, cd_credit_rating#29, cnt3#40, cd_dep_count#30, cnt4#41, cd_dep_employed_count#31, cnt5#42, cd_dep_college_count#32, cnt6#43] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (46) + + +(46) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#7] + +Subquery:2 Hosting operator id = 15 Hosting Expression = ws_sold_date_sk#13 IN dynamicpruning#6 + +Subquery:3 Hosting operator id = 20 Hosting Expression = cs_sold_date_sk#17 IN dynamicpruning#6 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/simplified.txt new file mode 100644 index 0000000000000..5077b91e30c1b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q10a/simplified.txt @@ -0,0 +1,72 @@ +TakeOrderedAndProject [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,cnt2,cnt3,cnt4,cnt5,cnt6] + WholeStageCodegen (10) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count] [count(1),cnt1,cnt2,cnt3,cnt4,cnt5,cnt6,count] + InputAdapter + Exchange [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 + WholeStageCodegen (9) + HashAggregate [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,count] + Project [cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [c_current_cdemo_sk] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + BroadcastHashJoin [c_customer_sk,customer_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #4 + Union + WholeStageCodegen (4) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + WholeStageCodegen (6) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + Project [ca_address_sk] + Filter [ca_county,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (8) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status,cd_purchase_estimate,cd_credit_rating,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/explain.txt new file mode 100644 index 0000000000000..453a35d8d5175 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/explain.txt @@ -0,0 +1,502 @@ +== Physical Plan == +TakeOrderedAndProject (86) ++- * Project (85) + +- * SortMergeJoin Inner (84) + :- * Project (66) + : +- * SortMergeJoin Inner (65) + : :- * SortMergeJoin Inner (45) + : : :- * Sort (24) + : : : +- Exchange (23) + : : : +- * Filter (22) + : : : +- * HashAggregate (21) + : : : +- Exchange (20) + : : : +- * HashAggregate (19) + : : : +- * Project (18) + : : : +- * SortMergeJoin Inner (17) + : : : :- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- * Sort (16) + : : : +- Exchange (15) + : : : +- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.customer (12) + : : +- * Sort (44) + : : +- Exchange (43) + : : +- * HashAggregate (42) + : : +- Exchange (41) + : : +- * HashAggregate (40) + : : +- * Project (39) + : : +- * SortMergeJoin Inner (38) + : : :- * Sort (35) + : : : +- Exchange (34) + : : : +- * Project (33) + : : : +- * BroadcastHashJoin Inner BuildRight (32) + : : : :- * Filter (27) + : : : : +- * ColumnarToRow (26) + : : : : +- Scan parquet default.store_sales (25) + : : : +- BroadcastExchange (31) + : : : +- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.date_dim (28) + : : +- * Sort (37) + : : +- ReusedExchange (36) + : +- * Sort (64) + : +- Exchange (63) + : +- * Project (62) + : +- * Filter (61) + : +- * HashAggregate (60) + : +- Exchange (59) + : +- * HashAggregate (58) + : +- * Project (57) + : +- * SortMergeJoin Inner (56) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Project (51) + : : +- * BroadcastHashJoin Inner BuildRight (50) + : : :- * Filter (48) + : : : +- * ColumnarToRow (47) + : : : +- Scan parquet default.web_sales (46) + : : +- ReusedExchange (49) + : +- * Sort (55) + : +- ReusedExchange (54) + +- * Sort (83) + +- Exchange (82) + +- * HashAggregate (81) + +- Exchange (80) + +- * HashAggregate (79) + +- * Project (78) + +- * SortMergeJoin Inner (77) + :- * Sort (74) + : +- Exchange (73) + : +- * Project (72) + : +- * BroadcastHashJoin Inner BuildRight (71) + : :- * Filter (69) + : : +- * ColumnarToRow (68) + : : +- Scan parquet default.web_sales (67) + : +- ReusedExchange (70) + +- * Sort (76) + +- ReusedExchange (75) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 2] +Input [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_customer_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_year#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_year#7] +Condition : ((isnotnull(d_year#7) AND (d_year#7 = 2001)) AND isnotnull(d_date_sk#6)) + +(7) BroadcastExchange +Input [2]: [d_date_sk#6, d_year#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#8] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(9) Project [codegen id : 2] +Output [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7] +Input [6]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, ss_sold_date_sk#4, d_date_sk#6, d_year#7] + +(10) Exchange +Input [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] + +(11) Sort [codegen id : 3] +Input [4]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(12) Scan parquet default.customer +Output [8]: [c_customer_sk#10, c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 4] +Input [8]: [c_customer_sk#10, c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] + +(14) Filter [codegen id : 4] +Input [8]: [c_customer_sk#10, c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] +Condition : (isnotnull(c_customer_sk#10) AND isnotnull(c_customer_id#11)) + +(15) Exchange +Input [8]: [c_customer_sk#10, c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] +Arguments: hashpartitioning(c_customer_sk#10, 5), ENSURE_REQUIREMENTS, [id=#18] + +(16) Sort [codegen id : 5] +Input [8]: [c_customer_sk#10, c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] +Arguments: [c_customer_sk#10 ASC NULLS FIRST], false, 0 + +(17) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#10] +Join condition: None + +(18) Project [codegen id : 6] +Output [10]: [c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7] +Input [12]: [ss_customer_sk#1, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7, c_customer_sk#10, c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] + +(19) HashAggregate [codegen id : 6] +Input [10]: [c_customer_id#11, c_first_name#12, c_last_name#13, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17, ss_ext_discount_amt#2, ss_ext_list_price#3, d_year#7] +Keys [8]: [c_customer_id#11, c_first_name#12, c_last_name#13, d_year#7, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#19] +Results [9]: [c_customer_id#11, c_first_name#12, c_last_name#13, d_year#7, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17, sum#20] + +(20) Exchange +Input [9]: [c_customer_id#11, c_first_name#12, c_last_name#13, d_year#7, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17, sum#20] +Arguments: hashpartitioning(c_customer_id#11, c_first_name#12, c_last_name#13, d_year#7, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17, 5), ENSURE_REQUIREMENTS, [id=#21] + +(21) HashAggregate [codegen id : 7] +Input [9]: [c_customer_id#11, c_first_name#12, c_last_name#13, d_year#7, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17, sum#20] +Keys [8]: [c_customer_id#11, c_first_name#12, c_last_name#13, d_year#7, c_preferred_cust_flag#14, c_birth_country#15, c_login#16, c_email_address#17] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))#22] +Results [2]: [c_customer_id#11 AS customer_id#23, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#3 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#2 as decimal(8,2)))), DecimalType(8,2), true)))#22,18,2) AS year_total#24] + +(22) Filter [codegen id : 7] +Input [2]: [customer_id#23, year_total#24] +Condition : (isnotnull(year_total#24) AND (year_total#24 > 0.00)) + +(23) Exchange +Input [2]: [customer_id#23, year_total#24] +Arguments: hashpartitioning(customer_id#23, 5), ENSURE_REQUIREMENTS, [id=#25] + +(24) Sort [codegen id : 8] +Input [2]: [customer_id#23, year_total#24] +Arguments: [customer_id#23 ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, ss_sold_date_sk#29] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#29), dynamicpruningexpression(ss_sold_date_sk#29 IN dynamicpruning#30)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 10] +Input [4]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, ss_sold_date_sk#29] + +(27) Filter [codegen id : 10] +Input [4]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, ss_sold_date_sk#29] +Condition : isnotnull(ss_customer_sk#26) + +(28) Scan parquet default.date_dim +Output [2]: [d_date_sk#31, d_year#32] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#31, d_year#32] + +(30) Filter [codegen id : 9] +Input [2]: [d_date_sk#31, d_year#32] +Condition : ((isnotnull(d_year#32) AND (d_year#32 = 2002)) AND isnotnull(d_date_sk#31)) + +(31) BroadcastExchange +Input [2]: [d_date_sk#31, d_year#32] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#33] + +(32) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#29] +Right keys [1]: [d_date_sk#31] +Join condition: None + +(33) Project [codegen id : 10] +Output [4]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, d_year#32] +Input [6]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, ss_sold_date_sk#29, d_date_sk#31, d_year#32] + +(34) Exchange +Input [4]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, d_year#32] +Arguments: hashpartitioning(ss_customer_sk#26, 5), ENSURE_REQUIREMENTS, [id=#34] + +(35) Sort [codegen id : 11] +Input [4]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, d_year#32] +Arguments: [ss_customer_sk#26 ASC NULLS FIRST], false, 0 + +(36) ReusedExchange [Reuses operator id: 15] +Output [8]: [c_customer_sk#35, c_customer_id#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42] + +(37) Sort [codegen id : 13] +Input [8]: [c_customer_sk#35, c_customer_id#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42] +Arguments: [c_customer_sk#35 ASC NULLS FIRST], false, 0 + +(38) SortMergeJoin [codegen id : 14] +Left keys [1]: [ss_customer_sk#26] +Right keys [1]: [c_customer_sk#35] +Join condition: None + +(39) Project [codegen id : 14] +Output [10]: [c_customer_id#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42, ss_ext_discount_amt#27, ss_ext_list_price#28, d_year#32] +Input [12]: [ss_customer_sk#26, ss_ext_discount_amt#27, ss_ext_list_price#28, d_year#32, c_customer_sk#35, c_customer_id#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42] + +(40) HashAggregate [codegen id : 14] +Input [10]: [c_customer_id#36, c_first_name#37, c_last_name#38, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42, ss_ext_discount_amt#27, ss_ext_list_price#28, d_year#32] +Keys [8]: [c_customer_id#36, c_first_name#37, c_last_name#38, d_year#32, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#28 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#27 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#43] +Results [9]: [c_customer_id#36, c_first_name#37, c_last_name#38, d_year#32, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42, sum#44] + +(41) Exchange +Input [9]: [c_customer_id#36, c_first_name#37, c_last_name#38, d_year#32, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42, sum#44] +Arguments: hashpartitioning(c_customer_id#36, c_first_name#37, c_last_name#38, d_year#32, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42, 5), ENSURE_REQUIREMENTS, [id=#45] + +(42) HashAggregate [codegen id : 15] +Input [9]: [c_customer_id#36, c_first_name#37, c_last_name#38, d_year#32, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42, sum#44] +Keys [8]: [c_customer_id#36, c_first_name#37, c_last_name#38, d_year#32, c_preferred_cust_flag#39, c_birth_country#40, c_login#41, c_email_address#42] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#28 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#27 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#28 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#27 as decimal(8,2)))), DecimalType(8,2), true)))#46] +Results [5]: [c_customer_id#36 AS customer_id#47, c_first_name#37 AS customer_first_name#48, c_last_name#38 AS customer_last_name#49, c_email_address#42 AS customer_email_address#50, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#28 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#27 as decimal(8,2)))), DecimalType(8,2), true)))#46,18,2) AS year_total#51] + +(43) Exchange +Input [5]: [customer_id#47, customer_first_name#48, customer_last_name#49, customer_email_address#50, year_total#51] +Arguments: hashpartitioning(customer_id#47, 5), ENSURE_REQUIREMENTS, [id=#52] + +(44) Sort [codegen id : 16] +Input [5]: [customer_id#47, customer_first_name#48, customer_last_name#49, customer_email_address#50, year_total#51] +Arguments: [customer_id#47 ASC NULLS FIRST], false, 0 + +(45) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#23] +Right keys [1]: [customer_id#47] +Join condition: None + +(46) Scan parquet default.web_sales +Output [4]: [ws_bill_customer_sk#53, ws_ext_discount_amt#54, ws_ext_list_price#55, ws_sold_date_sk#56] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#56), dynamicpruningexpression(ws_sold_date_sk#56 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 19] +Input [4]: [ws_bill_customer_sk#53, ws_ext_discount_amt#54, ws_ext_list_price#55, ws_sold_date_sk#56] + +(48) Filter [codegen id : 19] +Input [4]: [ws_bill_customer_sk#53, ws_ext_discount_amt#54, ws_ext_list_price#55, ws_sold_date_sk#56] +Condition : isnotnull(ws_bill_customer_sk#53) + +(49) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#57, d_year#58] + +(50) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [ws_sold_date_sk#56] +Right keys [1]: [d_date_sk#57] +Join condition: None + +(51) Project [codegen id : 19] +Output [4]: [ws_bill_customer_sk#53, ws_ext_discount_amt#54, ws_ext_list_price#55, d_year#58] +Input [6]: [ws_bill_customer_sk#53, ws_ext_discount_amt#54, ws_ext_list_price#55, ws_sold_date_sk#56, d_date_sk#57, d_year#58] + +(52) Exchange +Input [4]: [ws_bill_customer_sk#53, ws_ext_discount_amt#54, ws_ext_list_price#55, d_year#58] +Arguments: hashpartitioning(ws_bill_customer_sk#53, 5), ENSURE_REQUIREMENTS, [id=#59] + +(53) Sort [codegen id : 20] +Input [4]: [ws_bill_customer_sk#53, ws_ext_discount_amt#54, ws_ext_list_price#55, d_year#58] +Arguments: [ws_bill_customer_sk#53 ASC NULLS FIRST], false, 0 + +(54) ReusedExchange [Reuses operator id: 15] +Output [8]: [c_customer_sk#60, c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67] + +(55) Sort [codegen id : 22] +Input [8]: [c_customer_sk#60, c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67] +Arguments: [c_customer_sk#60 ASC NULLS FIRST], false, 0 + +(56) SortMergeJoin [codegen id : 23] +Left keys [1]: [ws_bill_customer_sk#53] +Right keys [1]: [c_customer_sk#60] +Join condition: None + +(57) Project [codegen id : 23] +Output [10]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67, ws_ext_discount_amt#54, ws_ext_list_price#55, d_year#58] +Input [12]: [ws_bill_customer_sk#53, ws_ext_discount_amt#54, ws_ext_list_price#55, d_year#58, c_customer_sk#60, c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67] + +(58) HashAggregate [codegen id : 23] +Input [10]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67, ws_ext_discount_amt#54, ws_ext_list_price#55, d_year#58] +Keys [8]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67, d_year#58] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#55 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#54 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#68] +Results [9]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67, d_year#58, sum#69] + +(59) Exchange +Input [9]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67, d_year#58, sum#69] +Arguments: hashpartitioning(c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67, d_year#58, 5), ENSURE_REQUIREMENTS, [id=#70] + +(60) HashAggregate [codegen id : 24] +Input [9]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67, d_year#58, sum#69] +Keys [8]: [c_customer_id#61, c_first_name#62, c_last_name#63, c_preferred_cust_flag#64, c_birth_country#65, c_login#66, c_email_address#67, d_year#58] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#55 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#54 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#55 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#54 as decimal(8,2)))), DecimalType(8,2), true)))#71] +Results [2]: [c_customer_id#61 AS customer_id#72, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#55 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#54 as decimal(8,2)))), DecimalType(8,2), true)))#71,18,2) AS year_total#73] + +(61) Filter [codegen id : 24] +Input [2]: [customer_id#72, year_total#73] +Condition : (isnotnull(year_total#73) AND (year_total#73 > 0.00)) + +(62) Project [codegen id : 24] +Output [2]: [customer_id#72 AS customer_id#74, year_total#73 AS year_total#75] +Input [2]: [customer_id#72, year_total#73] + +(63) Exchange +Input [2]: [customer_id#74, year_total#75] +Arguments: hashpartitioning(customer_id#74, 5), ENSURE_REQUIREMENTS, [id=#76] + +(64) Sort [codegen id : 25] +Input [2]: [customer_id#74, year_total#75] +Arguments: [customer_id#74 ASC NULLS FIRST], false, 0 + +(65) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#23] +Right keys [1]: [customer_id#74] +Join condition: None + +(66) Project [codegen id : 26] +Output [8]: [customer_id#23, year_total#24, customer_id#47, customer_first_name#48, customer_last_name#49, customer_email_address#50, year_total#51, year_total#75] +Input [9]: [customer_id#23, year_total#24, customer_id#47, customer_first_name#48, customer_last_name#49, customer_email_address#50, year_total#51, customer_id#74, year_total#75] + +(67) Scan parquet default.web_sales +Output [4]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_list_price#79, ws_sold_date_sk#80] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#80), dynamicpruningexpression(ws_sold_date_sk#80 IN dynamicpruning#30)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(68) ColumnarToRow [codegen id : 28] +Input [4]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_list_price#79, ws_sold_date_sk#80] + +(69) Filter [codegen id : 28] +Input [4]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_list_price#79, ws_sold_date_sk#80] +Condition : isnotnull(ws_bill_customer_sk#77) + +(70) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#81, d_year#82] + +(71) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#80] +Right keys [1]: [d_date_sk#81] +Join condition: None + +(72) Project [codegen id : 28] +Output [4]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_list_price#79, d_year#82] +Input [6]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_list_price#79, ws_sold_date_sk#80, d_date_sk#81, d_year#82] + +(73) Exchange +Input [4]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_list_price#79, d_year#82] +Arguments: hashpartitioning(ws_bill_customer_sk#77, 5), ENSURE_REQUIREMENTS, [id=#83] + +(74) Sort [codegen id : 29] +Input [4]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_list_price#79, d_year#82] +Arguments: [ws_bill_customer_sk#77 ASC NULLS FIRST], false, 0 + +(75) ReusedExchange [Reuses operator id: 15] +Output [8]: [c_customer_sk#84, c_customer_id#85, c_first_name#86, c_last_name#87, c_preferred_cust_flag#88, c_birth_country#89, c_login#90, c_email_address#91] + +(76) Sort [codegen id : 31] +Input [8]: [c_customer_sk#84, c_customer_id#85, c_first_name#86, c_last_name#87, c_preferred_cust_flag#88, c_birth_country#89, c_login#90, c_email_address#91] +Arguments: [c_customer_sk#84 ASC NULLS FIRST], false, 0 + +(77) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_customer_sk#77] +Right keys [1]: [c_customer_sk#84] +Join condition: None + +(78) Project [codegen id : 32] +Output [10]: [c_customer_id#85, c_first_name#86, c_last_name#87, c_preferred_cust_flag#88, c_birth_country#89, c_login#90, c_email_address#91, ws_ext_discount_amt#78, ws_ext_list_price#79, d_year#82] +Input [12]: [ws_bill_customer_sk#77, ws_ext_discount_amt#78, ws_ext_list_price#79, d_year#82, c_customer_sk#84, c_customer_id#85, c_first_name#86, c_last_name#87, c_preferred_cust_flag#88, c_birth_country#89, c_login#90, c_email_address#91] + +(79) HashAggregate [codegen id : 32] +Input [10]: [c_customer_id#85, c_first_name#86, c_last_name#87, c_preferred_cust_flag#88, c_birth_country#89, c_login#90, c_email_address#91, ws_ext_discount_amt#78, ws_ext_list_price#79, d_year#82] +Keys [8]: [c_customer_id#85, c_first_name#86, c_last_name#87, c_preferred_cust_flag#88, c_birth_country#89, c_login#90, c_email_address#91, d_year#82] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#92] +Results [9]: [c_customer_id#85, c_first_name#86, c_last_name#87, c_preferred_cust_flag#88, c_birth_country#89, c_login#90, c_email_address#91, d_year#82, sum#93] + +(80) Exchange +Input [9]: [c_customer_id#85, c_first_name#86, c_last_name#87, c_preferred_cust_flag#88, c_birth_country#89, c_login#90, c_email_address#91, d_year#82, sum#93] +Arguments: hashpartitioning(c_customer_id#85, c_first_name#86, c_last_name#87, c_preferred_cust_flag#88, c_birth_country#89, c_login#90, c_email_address#91, d_year#82, 5), ENSURE_REQUIREMENTS, [id=#94] + +(81) HashAggregate [codegen id : 33] +Input [9]: [c_customer_id#85, c_first_name#86, c_last_name#87, c_preferred_cust_flag#88, c_birth_country#89, c_login#90, c_email_address#91, d_year#82, sum#93] +Keys [8]: [c_customer_id#85, c_first_name#86, c_last_name#87, c_preferred_cust_flag#88, c_birth_country#89, c_login#90, c_email_address#91, d_year#82] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(8,2)))), DecimalType(8,2), true)))#95] +Results [2]: [c_customer_id#85 AS customer_id#96, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#79 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#78 as decimal(8,2)))), DecimalType(8,2), true)))#95,18,2) AS year_total#97] + +(82) Exchange +Input [2]: [customer_id#96, year_total#97] +Arguments: hashpartitioning(customer_id#96, 5), ENSURE_REQUIREMENTS, [id=#98] + +(83) Sort [codegen id : 34] +Input [2]: [customer_id#96, year_total#97] +Arguments: [customer_id#96 ASC NULLS FIRST], false, 0 + +(84) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#23] +Right keys [1]: [customer_id#96] +Join condition: (CASE WHEN (year_total#75 > 0.00) THEN CheckOverflow((promote_precision(year_total#97) / promote_precision(year_total#75)), DecimalType(38,20), true) ELSE 0E-20 END > CASE WHEN (year_total#24 > 0.00) THEN CheckOverflow((promote_precision(year_total#51) / promote_precision(year_total#24)), DecimalType(38,20), true) ELSE 0E-20 END) + +(85) Project [codegen id : 35] +Output [4]: [customer_id#47, customer_first_name#48, customer_last_name#49, customer_email_address#50] +Input [10]: [customer_id#23, year_total#24, customer_id#47, customer_first_name#48, customer_last_name#49, customer_email_address#50, year_total#51, year_total#75, customer_id#96, year_total#97] + +(86) TakeOrderedAndProject +Input [4]: [customer_id#47, customer_first_name#48, customer_last_name#49, customer_email_address#50] +Arguments: 100, [customer_id#47 ASC NULLS FIRST, customer_first_name#48 ASC NULLS FIRST, customer_last_name#49 ASC NULLS FIRST, customer_email_address#50 ASC NULLS FIRST], [customer_id#47, customer_first_name#48, customer_last_name#49, customer_email_address#50] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (87) + + +(87) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#6, d_year#7] + +Subquery:2 Hosting operator id = 25 Hosting Expression = ss_sold_date_sk#29 IN dynamicpruning#30 +ReusedExchange (88) + + +(88) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#31, d_year#32] + +Subquery:3 Hosting operator id = 46 Hosting Expression = ws_sold_date_sk#56 IN dynamicpruning#5 + +Subquery:4 Hosting operator id = 67 Hosting Expression = ws_sold_date_sk#80 IN dynamicpruning#30 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/simplified.txt new file mode 100644 index 0000000000000..67f6c90f67792 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11.sf100/simplified.txt @@ -0,0 +1,163 @@ +TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,customer_email_address] + WholeStageCodegen (35) + Project [customer_id,customer_first_name,customer_last_name,customer_email_address] + SortMergeJoin [customer_id,customer_id,year_total,year_total,year_total,year_total] + InputAdapter + WholeStageCodegen (26) + Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,customer_email_address,year_total,year_total] + SortMergeJoin [customer_id,customer_id] + InputAdapter + WholeStageCodegen (17) + SortMergeJoin [customer_id,customer_id] + InputAdapter + WholeStageCodegen (8) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #1 + WholeStageCodegen (7) + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #3 + WholeStageCodegen (2) + Project [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + WholeStageCodegen (16) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #6 + WholeStageCodegen (15) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,customer_first_name,customer_last_name,customer_email_address,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #7 + WholeStageCodegen (14) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #8 + WholeStageCodegen (10) + Project [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (9) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (13) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 + InputAdapter + WholeStageCodegen (25) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #10 + WholeStageCodegen (24) + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #11 + WholeStageCodegen (23) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,d_year] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (20) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #12 + WholeStageCodegen (19) + Project [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 + InputAdapter + WholeStageCodegen (22) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 + InputAdapter + WholeStageCodegen (34) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #13 + WholeStageCodegen (33) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #14 + WholeStageCodegen (32) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,d_year] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (29) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #15 + WholeStageCodegen (28) + Project [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year] #9 + InputAdapter + WholeStageCodegen (31) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/explain.txt new file mode 100644 index 0000000000000..17d16033bb5be --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/explain.txt @@ -0,0 +1,471 @@ +== Physical Plan == +TakeOrderedAndProject (78) ++- * Project (77) + +- * BroadcastHashJoin Inner BuildRight (76) + :- * Project (59) + : +- * BroadcastHashJoin Inner BuildRight (58) + : :- * BroadcastHashJoin Inner BuildRight (39) + : : :- * Filter (19) + : : : +- * HashAggregate (18) + : : : +- Exchange (17) + : : : +- * HashAggregate (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (38) + : : +- * HashAggregate (37) + : : +- Exchange (36) + : : +- * HashAggregate (35) + : : +- * Project (34) + : : +- * BroadcastHashJoin Inner BuildRight (33) + : : :- * Project (28) + : : : +- * BroadcastHashJoin Inner BuildRight (27) + : : : :- * Filter (22) + : : : : +- * ColumnarToRow (21) + : : : : +- Scan parquet default.customer (20) + : : : +- BroadcastExchange (26) + : : : +- * Filter (25) + : : : +- * ColumnarToRow (24) + : : : +- Scan parquet default.store_sales (23) + : : +- BroadcastExchange (32) + : : +- * Filter (31) + : : +- * ColumnarToRow (30) + : : +- Scan parquet default.date_dim (29) + : +- BroadcastExchange (57) + : +- * Project (56) + : +- * Filter (55) + : +- * HashAggregate (54) + : +- Exchange (53) + : +- * HashAggregate (52) + : +- * Project (51) + : +- * BroadcastHashJoin Inner BuildRight (50) + : :- * Project (48) + : : +- * BroadcastHashJoin Inner BuildRight (47) + : : :- * Filter (42) + : : : +- * ColumnarToRow (41) + : : : +- Scan parquet default.customer (40) + : : +- BroadcastExchange (46) + : : +- * Filter (45) + : : +- * ColumnarToRow (44) + : : +- Scan parquet default.web_sales (43) + : +- ReusedExchange (49) + +- BroadcastExchange (75) + +- * HashAggregate (74) + +- Exchange (73) + +- * HashAggregate (72) + +- * Project (71) + +- * BroadcastHashJoin Inner BuildRight (70) + :- * Project (68) + : +- * BroadcastHashJoin Inner BuildRight (67) + : :- * Filter (62) + : : +- * ColumnarToRow (61) + : : +- Scan parquet default.customer (60) + : +- BroadcastExchange (66) + : +- * Filter (65) + : +- * ColumnarToRow (64) + : +- Scan parquet default.web_sales (63) + +- ReusedExchange (69) + + +(1) Scan parquet default.customer +Output [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] + +(3) Filter [codegen id : 3] +Input [8]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) + +(4) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#12), dynamicpruningexpression(ss_sold_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12] + +(6) Filter [codegen id : 1] +Input [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12] +Condition : isnotnull(ss_customer_sk#9) + +(7) BroadcastExchange +Input [4]: [ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#9] +Join condition: None + +(9) Project [codegen id : 3] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12] +Input [12]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_customer_sk#9, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#15, d_year#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] +Condition : ((isnotnull(d_year#16) AND (d_year#16 = 2001)) AND isnotnull(d_date_sk#15)) + +(13) BroadcastExchange +Input [2]: [d_date_sk#15, d_year#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#12] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(15) Project [codegen id : 3] +Output [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, d_year#16] +Input [12]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, ss_sold_date_sk#12, d_date_sk#15, d_year#16] + +(16) HashAggregate [codegen id : 3] +Input [10]: [c_customer_id#2, c_first_name#3, c_last_name#4, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, ss_ext_discount_amt#10, ss_ext_list_price#11, d_year#16] +Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#18] +Results [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#19] + +(17) Exchange +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#19] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, 5), ENSURE_REQUIREMENTS, [id=#20] + +(18) HashAggregate [codegen id : 16] +Input [9]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8, sum#19] +Keys [8]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#16, c_preferred_cust_flag#5, c_birth_country#6, c_login#7, c_email_address#8] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))#21] +Results [2]: [c_customer_id#2 AS customer_id#22, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#11 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#10 as decimal(8,2)))), DecimalType(8,2), true)))#21,18,2) AS year_total#23] + +(19) Filter [codegen id : 16] +Input [2]: [customer_id#22, year_total#23] +Condition : (isnotnull(year_total#23) AND (year_total#23 > 0.00)) + +(20) Scan parquet default.customer +Output [8]: [c_customer_sk#24, c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [8]: [c_customer_sk#24, c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31] + +(22) Filter [codegen id : 6] +Input [8]: [c_customer_sk#24, c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31] +Condition : (isnotnull(c_customer_sk#24) AND isnotnull(c_customer_id#25)) + +(23) Scan parquet default.store_sales +Output [4]: [ss_customer_sk#32, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#35), dynamicpruningexpression(ss_sold_date_sk#35 IN dynamicpruning#36)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [4]: [ss_customer_sk#32, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35] + +(25) Filter [codegen id : 4] +Input [4]: [ss_customer_sk#32, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35] +Condition : isnotnull(ss_customer_sk#32) + +(26) BroadcastExchange +Input [4]: [ss_customer_sk#32, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#37] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [c_customer_sk#24] +Right keys [1]: [ss_customer_sk#32] +Join condition: None + +(28) Project [codegen id : 6] +Output [10]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35] +Input [12]: [c_customer_sk#24, c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_customer_sk#32, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35] + +(29) Scan parquet default.date_dim +Output [2]: [d_date_sk#38, d_year#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#38, d_year#39] + +(31) Filter [codegen id : 5] +Input [2]: [d_date_sk#38, d_year#39] +Condition : ((isnotnull(d_year#39) AND (d_year#39 = 2002)) AND isnotnull(d_date_sk#38)) + +(32) BroadcastExchange +Input [2]: [d_date_sk#38, d_year#39] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#40] + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#35] +Right keys [1]: [d_date_sk#38] +Join condition: None + +(34) Project [codegen id : 6] +Output [10]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_ext_discount_amt#33, ss_ext_list_price#34, d_year#39] +Input [12]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_ext_discount_amt#33, ss_ext_list_price#34, ss_sold_date_sk#35, d_date_sk#38, d_year#39] + +(35) HashAggregate [codegen id : 6] +Input [10]: [c_customer_id#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, ss_ext_discount_amt#33, ss_ext_list_price#34, d_year#39] +Keys [8]: [c_customer_id#25, c_first_name#26, c_last_name#27, d_year#39, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#34 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#33 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#41] +Results [9]: [c_customer_id#25, c_first_name#26, c_last_name#27, d_year#39, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, sum#42] + +(36) Exchange +Input [9]: [c_customer_id#25, c_first_name#26, c_last_name#27, d_year#39, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, sum#42] +Arguments: hashpartitioning(c_customer_id#25, c_first_name#26, c_last_name#27, d_year#39, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, 5), ENSURE_REQUIREMENTS, [id=#43] + +(37) HashAggregate [codegen id : 7] +Input [9]: [c_customer_id#25, c_first_name#26, c_last_name#27, d_year#39, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31, sum#42] +Keys [8]: [c_customer_id#25, c_first_name#26, c_last_name#27, d_year#39, c_preferred_cust_flag#28, c_birth_country#29, c_login#30, c_email_address#31] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#34 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#33 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#34 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#33 as decimal(8,2)))), DecimalType(8,2), true)))#44] +Results [5]: [c_customer_id#25 AS customer_id#45, c_first_name#26 AS customer_first_name#46, c_last_name#27 AS customer_last_name#47, c_email_address#31 AS customer_email_address#48, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price#34 as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt#33 as decimal(8,2)))), DecimalType(8,2), true)))#44,18,2) AS year_total#49] + +(38) BroadcastExchange +Input [5]: [customer_id#45, customer_first_name#46, customer_last_name#47, customer_email_address#48, year_total#49] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#50] + +(39) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#22] +Right keys [1]: [customer_id#45] +Join condition: None + +(40) Scan parquet default.customer +Output [8]: [c_customer_sk#51, c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 10] +Input [8]: [c_customer_sk#51, c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58] + +(42) Filter [codegen id : 10] +Input [8]: [c_customer_sk#51, c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58] +Condition : (isnotnull(c_customer_sk#51) AND isnotnull(c_customer_id#52)) + +(43) Scan parquet default.web_sales +Output [4]: [ws_bill_customer_sk#59, ws_ext_discount_amt#60, ws_ext_list_price#61, ws_sold_date_sk#62] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#62), dynamicpruningexpression(ws_sold_date_sk#62 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(44) ColumnarToRow [codegen id : 8] +Input [4]: [ws_bill_customer_sk#59, ws_ext_discount_amt#60, ws_ext_list_price#61, ws_sold_date_sk#62] + +(45) Filter [codegen id : 8] +Input [4]: [ws_bill_customer_sk#59, ws_ext_discount_amt#60, ws_ext_list_price#61, ws_sold_date_sk#62] +Condition : isnotnull(ws_bill_customer_sk#59) + +(46) BroadcastExchange +Input [4]: [ws_bill_customer_sk#59, ws_ext_discount_amt#60, ws_ext_list_price#61, ws_sold_date_sk#62] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#63] + +(47) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [c_customer_sk#51] +Right keys [1]: [ws_bill_customer_sk#59] +Join condition: None + +(48) Project [codegen id : 10] +Output [10]: [c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58, ws_ext_discount_amt#60, ws_ext_list_price#61, ws_sold_date_sk#62] +Input [12]: [c_customer_sk#51, c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58, ws_bill_customer_sk#59, ws_ext_discount_amt#60, ws_ext_list_price#61, ws_sold_date_sk#62] + +(49) ReusedExchange [Reuses operator id: 13] +Output [2]: [d_date_sk#64, d_year#65] + +(50) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#62] +Right keys [1]: [d_date_sk#64] +Join condition: None + +(51) Project [codegen id : 10] +Output [10]: [c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58, ws_ext_discount_amt#60, ws_ext_list_price#61, d_year#65] +Input [12]: [c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58, ws_ext_discount_amt#60, ws_ext_list_price#61, ws_sold_date_sk#62, d_date_sk#64, d_year#65] + +(52) HashAggregate [codegen id : 10] +Input [10]: [c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58, ws_ext_discount_amt#60, ws_ext_list_price#61, d_year#65] +Keys [8]: [c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58, d_year#65] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#61 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#60 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#66] +Results [9]: [c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58, d_year#65, sum#67] + +(53) Exchange +Input [9]: [c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58, d_year#65, sum#67] +Arguments: hashpartitioning(c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58, d_year#65, 5), ENSURE_REQUIREMENTS, [id=#68] + +(54) HashAggregate [codegen id : 11] +Input [9]: [c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58, d_year#65, sum#67] +Keys [8]: [c_customer_id#52, c_first_name#53, c_last_name#54, c_preferred_cust_flag#55, c_birth_country#56, c_login#57, c_email_address#58, d_year#65] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#61 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#60 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#61 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#60 as decimal(8,2)))), DecimalType(8,2), true)))#69] +Results [2]: [c_customer_id#52 AS customer_id#70, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#61 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#60 as decimal(8,2)))), DecimalType(8,2), true)))#69,18,2) AS year_total#71] + +(55) Filter [codegen id : 11] +Input [2]: [customer_id#70, year_total#71] +Condition : (isnotnull(year_total#71) AND (year_total#71 > 0.00)) + +(56) Project [codegen id : 11] +Output [2]: [customer_id#70 AS customer_id#72, year_total#71 AS year_total#73] +Input [2]: [customer_id#70, year_total#71] + +(57) BroadcastExchange +Input [2]: [customer_id#72, year_total#73] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#74] + +(58) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#22] +Right keys [1]: [customer_id#72] +Join condition: None + +(59) Project [codegen id : 16] +Output [8]: [customer_id#22, year_total#23, customer_id#45, customer_first_name#46, customer_last_name#47, customer_email_address#48, year_total#49, year_total#73] +Input [9]: [customer_id#22, year_total#23, customer_id#45, customer_first_name#46, customer_last_name#47, customer_email_address#48, year_total#49, customer_id#72, year_total#73] + +(60) Scan parquet default.customer +Output [8]: [c_customer_sk#75, c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(61) ColumnarToRow [codegen id : 14] +Input [8]: [c_customer_sk#75, c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82] + +(62) Filter [codegen id : 14] +Input [8]: [c_customer_sk#75, c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82] +Condition : (isnotnull(c_customer_sk#75) AND isnotnull(c_customer_id#76)) + +(63) Scan parquet default.web_sales +Output [4]: [ws_bill_customer_sk#83, ws_ext_discount_amt#84, ws_ext_list_price#85, ws_sold_date_sk#86] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#86), dynamicpruningexpression(ws_sold_date_sk#86 IN dynamicpruning#36)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(64) ColumnarToRow [codegen id : 12] +Input [4]: [ws_bill_customer_sk#83, ws_ext_discount_amt#84, ws_ext_list_price#85, ws_sold_date_sk#86] + +(65) Filter [codegen id : 12] +Input [4]: [ws_bill_customer_sk#83, ws_ext_discount_amt#84, ws_ext_list_price#85, ws_sold_date_sk#86] +Condition : isnotnull(ws_bill_customer_sk#83) + +(66) BroadcastExchange +Input [4]: [ws_bill_customer_sk#83, ws_ext_discount_amt#84, ws_ext_list_price#85, ws_sold_date_sk#86] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#87] + +(67) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [c_customer_sk#75] +Right keys [1]: [ws_bill_customer_sk#83] +Join condition: None + +(68) Project [codegen id : 14] +Output [10]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, ws_ext_discount_amt#84, ws_ext_list_price#85, ws_sold_date_sk#86] +Input [12]: [c_customer_sk#75, c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, ws_bill_customer_sk#83, ws_ext_discount_amt#84, ws_ext_list_price#85, ws_sold_date_sk#86] + +(69) ReusedExchange [Reuses operator id: 32] +Output [2]: [d_date_sk#88, d_year#89] + +(70) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#86] +Right keys [1]: [d_date_sk#88] +Join condition: None + +(71) Project [codegen id : 14] +Output [10]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, ws_ext_discount_amt#84, ws_ext_list_price#85, d_year#89] +Input [12]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, ws_ext_discount_amt#84, ws_ext_list_price#85, ws_sold_date_sk#86, d_date_sk#88, d_year#89] + +(72) HashAggregate [codegen id : 14] +Input [10]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, ws_ext_discount_amt#84, ws_ext_list_price#85, d_year#89] +Keys [8]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, d_year#89] +Functions [1]: [partial_sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#85 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#84 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum#90] +Results [9]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, d_year#89, sum#91] + +(73) Exchange +Input [9]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, d_year#89, sum#91] +Arguments: hashpartitioning(c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, d_year#89, 5), ENSURE_REQUIREMENTS, [id=#92] + +(74) HashAggregate [codegen id : 15] +Input [9]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, d_year#89, sum#91] +Keys [8]: [c_customer_id#76, c_first_name#77, c_last_name#78, c_preferred_cust_flag#79, c_birth_country#80, c_login#81, c_email_address#82, d_year#89] +Functions [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#85 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#84 as decimal(8,2)))), DecimalType(8,2), true)))] +Aggregate Attributes [1]: [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#85 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#84 as decimal(8,2)))), DecimalType(8,2), true)))#93] +Results [2]: [c_customer_id#76 AS customer_id#94, MakeDecimal(sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price#85 as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt#84 as decimal(8,2)))), DecimalType(8,2), true)))#93,18,2) AS year_total#95] + +(75) BroadcastExchange +Input [2]: [customer_id#94, year_total#95] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#96] + +(76) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#22] +Right keys [1]: [customer_id#94] +Join condition: (CASE WHEN (year_total#73 > 0.00) THEN CheckOverflow((promote_precision(year_total#95) / promote_precision(year_total#73)), DecimalType(38,20), true) ELSE 0E-20 END > CASE WHEN (year_total#23 > 0.00) THEN CheckOverflow((promote_precision(year_total#49) / promote_precision(year_total#23)), DecimalType(38,20), true) ELSE 0E-20 END) + +(77) Project [codegen id : 16] +Output [4]: [customer_id#45, customer_first_name#46, customer_last_name#47, customer_email_address#48] +Input [10]: [customer_id#22, year_total#23, customer_id#45, customer_first_name#46, customer_last_name#47, customer_email_address#48, year_total#49, year_total#73, customer_id#94, year_total#95] + +(78) TakeOrderedAndProject +Input [4]: [customer_id#45, customer_first_name#46, customer_last_name#47, customer_email_address#48] +Arguments: 100, [customer_id#45 ASC NULLS FIRST, customer_first_name#46 ASC NULLS FIRST, customer_last_name#47 ASC NULLS FIRST, customer_email_address#48 ASC NULLS FIRST], [customer_id#45, customer_first_name#46, customer_last_name#47, customer_email_address#48] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#12 IN dynamicpruning#13 +ReusedExchange (79) + + +(79) ReusedExchange [Reuses operator id: 13] +Output [2]: [d_date_sk#15, d_year#16] + +Subquery:2 Hosting operator id = 23 Hosting Expression = ss_sold_date_sk#35 IN dynamicpruning#36 +ReusedExchange (80) + + +(80) ReusedExchange [Reuses operator id: 32] +Output [2]: [d_date_sk#38, d_year#39] + +Subquery:3 Hosting operator id = 43 Hosting Expression = ws_sold_date_sk#62 IN dynamicpruning#13 + +Subquery:4 Hosting operator id = 63 Hosting Expression = ws_sold_date_sk#86 IN dynamicpruning#36 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/simplified.txt new file mode 100644 index 0000000000000..310c68c06e5f0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q11/simplified.txt @@ -0,0 +1,123 @@ +TakeOrderedAndProject [customer_id,customer_first_name,customer_last_name,customer_email_address] + WholeStageCodegen (16) + Project [customer_id,customer_first_name,customer_last_name,customer_email_address] + BroadcastHashJoin [customer_id,customer_id,year_total,year_total,year_total,year_total] + Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,customer_email_address,year_total,year_total] + BroadcastHashJoin [customer_id,customer_id] + BroadcastHashJoin [customer_id,customer_id] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (7) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ss_ext_list_price as decimal(8,2))) - promote_precision(cast(ss_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,customer_first_name,customer_last_name,customer_email_address,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] #5 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_list_price,ss_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_ext_discount_amt,ss_ext_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #7 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (5) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (11) + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #9 + WholeStageCodegen (10) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (8) + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (15) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,sum] [sum(UnscaledValue(CheckOverflow((promote_precision(cast(ws_ext_list_price as decimal(8,2))) - promote_precision(cast(ws_ext_discount_amt as decimal(8,2)))), DecimalType(8,2), true))),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year] #12 + WholeStageCodegen (14) + HashAggregate [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,d_year,ws_ext_list_price,ws_ext_discount_amt] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name,c_preferred_cust_flag,c_birth_country,c_login,c_email_address] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (12) + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_ext_discount_amt,ws_ext_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt new file mode 100644 index 0000000000000..d4acaa2cec459 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/explain.txt @@ -0,0 +1,163 @@ +== Physical Plan == +TakeOrderedAndProject (27) ++- * Project (26) + +- Window (25) + +- * Sort (24) + +- Exchange (23) + +- * HashAggregate (22) + +- Exchange (21) + +- * HashAggregate (20) + +- * Project (19) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) + +- * Filter (15) + +- * ColumnarToRow (14) + +- Scan parquet default.date_dim (13) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 1] +Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] +Condition : isnotnull(ws_item_sk#1) + +(4) Exchange +Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] +Arguments: hashpartitioning(ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#5] + +(5) Sort [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] +Arguments: [ws_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.item +Output [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports ,Books ,Home ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] + +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Condition : (i_category#11 IN (Sports ,Books ,Home ) AND isnotnull(i_item_sk#6)) + +(9) Exchange +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Arguments: hashpartitioning(i_item_sk#6, 5), ENSURE_REQUIREMENTS, [id=#12] + +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 + +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [ws_item_sk#1] +Right keys [1]: [i_item_sk#6] +Join condition: None + +(12) Project [codegen id : 6] +Output [7]: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Input [9]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] + +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#13, d_date#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#13, d_date#14] + +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#13, d_date#14] +Condition : (((isnotnull(d_date#14) AND (d_date#14 >= 1999-02-22)) AND (d_date#14 <= 1999-03-24)) AND isnotnull(d_date_sk#13)) + +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#13] +Input [2]: [d_date_sk#13, d_date#14] + +(17) BroadcastExchange +Input [1]: [d_date_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#13] +Join condition: None + +(19) Project [codegen id : 6] +Output [6]: [ws_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Input [8]: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11, d_date_sk#13] + +(20) HashAggregate [codegen id : 6] +Input [6]: [ws_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#16] +Results [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] + +(21) Exchange +Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] +Arguments: hashpartitioning(i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, 5), ENSURE_REQUIREMENTS, [id=#18] + +(22) HashAggregate [codegen id : 7] +Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] +Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#2))#19] +Results [8]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#19,17,2) AS itemrevenue#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#19,17,2) AS _w0#21, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#19,17,2) AS _w1#22] + +(23) Exchange +Input [8]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22] +Arguments: hashpartitioning(i_class#10, 5), ENSURE_REQUIREMENTS, [id=#23] + +(24) Sort [codegen id : 8] +Input [8]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22] +Arguments: [i_class#10 ASC NULLS FIRST], false, 0 + +(25) Window +Input [8]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22] +Arguments: [sum(_w1#22) windowspecdefinition(i_class#10, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#24], [i_class#10] + +(26) Project [codegen id : 9] +Output [7]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#21) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#24)), DecimalType(38,17), true) AS revenueratio#25] +Input [9]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, _we0#24] + +(27) TakeOrderedAndProject +Input [7]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25] +Arguments: 100, [i_category#11 ASC NULLS FIRST, i_class#10 ASC NULLS FIRST, i_item_id#7 ASC NULLS FIRST, i_item_desc#8 ASC NULLS FIRST, revenueratio#25 ASC NULLS FIRST], [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (28) + + +(28) ReusedExchange [Reuses operator id: 17] +Output [1]: [d_date_sk#13] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/simplified.txt new file mode 100644 index 0000000000000..801a70eda99ae --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12.sf100/simplified.txt @@ -0,0 +1,49 @@ +TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_current_price,itemrevenue] + WholeStageCodegen (9) + Project [i_item_id,i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (8) + Sort [i_class] + InputAdapter + Exchange [i_class] #1 + WholeStageCodegen (7) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(ws_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #2 + WholeStageCodegen (6) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_ext_sales_price,ws_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [ws_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ws_item_sk] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (1) + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_ext_sales_price,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12/explain.txt new file mode 100644 index 0000000000000..f6dd412f5c4b1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12/explain.txt @@ -0,0 +1,148 @@ +== Physical Plan == +TakeOrderedAndProject (24) ++- * Project (23) + +- Window (22) + +- * Sort (21) + +- Exchange (20) + +- * HashAggregate (19) + +- Exchange (18) + +- * HashAggregate (17) + +- * Project (16) + +- * BroadcastHashJoin Inner BuildRight (15) + :- * Project (9) + : +- * BroadcastHashJoin Inner BuildRight (8) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.web_sales (1) + : +- BroadcastExchange (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) + +- BroadcastExchange (14) + +- * Project (13) + +- * Filter (12) + +- * ColumnarToRow (11) + +- Scan parquet default.date_dim (10) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3] +Condition : isnotnull(ws_item_sk#1) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports ,Books ,Home ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports ,Books ,Home ) AND isnotnull(i_item_sk#5)) + +(7) BroadcastExchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(9) Project [codegen id : 3] +Output [7]: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [ws_item_sk#1, ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 1999-02-22)) AND (d_date#13 <= 1999-03-24)) AND isnotnull(d_date_sk#12)) + +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] + +(14) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#12] +Join condition: None + +(16) Project [codegen id : 3] +Output [6]: [ws_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [ws_ext_sales_price#2, ws_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] + +(17) HashAggregate [codegen id : 3] +Input [6]: [ws_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [partial_sum(UnscaledValue(ws_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#15] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] + +(18) Exchange +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), ENSURE_REQUIREMENTS, [id=#17] + +(19) HashAggregate [codegen id : 4] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [sum(UnscaledValue(ws_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_ext_sales_price#2))#18] +Results [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#2))#18,17,2) AS _w1#21] + +(20) Exchange +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: hashpartitioning(i_class#9, 5), ENSURE_REQUIREMENTS, [id=#22] + +(21) Sort [codegen id : 5] +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 + +(22) Window +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] + +(23) Project [codegen id : 6] +Output [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] +Input [9]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, _we0#23] + +(24) TakeOrderedAndProject +Input [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (25) + + +(25) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12/simplified.txt new file mode 100644 index 0000000000000..d4a9cb9eca9a9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q12/simplified.txt @@ -0,0 +1,40 @@ +TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_current_price,itemrevenue] + WholeStageCodegen (6) + Project [i_item_id,i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (5) + Sort [i_class] + InputAdapter + Exchange [i_class] #1 + WholeStageCodegen (4) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(ws_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #2 + WholeStageCodegen (3) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ws_ext_sales_price] [sum,sum] + Project [ws_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_ext_sales_price,ws_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_ext_sales_price,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/explain.txt new file mode 100644 index 0000000000000..e1ce480288a45 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/explain.txt @@ -0,0 +1,869 @@ +== Physical Plan == +TakeOrderedAndProject (116) ++- * BroadcastHashJoin Inner BuildRight (115) + :- * Project (90) + : +- * Filter (89) + : +- * HashAggregate (88) + : +- Exchange (87) + : +- * HashAggregate (86) + : +- * Project (85) + : +- * BroadcastHashJoin Inner BuildRight (84) + : :- * Project (74) + : : +- * BroadcastHashJoin Inner BuildRight (73) + : : :- * SortMergeJoin LeftSemi (67) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Sort (66) + : : : +- Exchange (65) + : : : +- * Project (64) + : : : +- * BroadcastHashJoin Inner BuildRight (63) + : : : :- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.item (6) + : : : +- BroadcastExchange (62) + : : : +- * HashAggregate (61) + : : : +- Exchange (60) + : : : +- * HashAggregate (59) + : : : +- * SortMergeJoin LeftSemi (58) + : : : :- * Sort (46) + : : : : +- Exchange (45) + : : : : +- * HashAggregate (44) + : : : : +- Exchange (43) + : : : : +- * HashAggregate (42) + : : : : +- * Project (41) + : : : : +- * BroadcastHashJoin Inner BuildRight (40) + : : : : :- * Project (18) + : : : : : +- * BroadcastHashJoin Inner BuildRight (17) + : : : : : :- * Filter (11) + : : : : : : +- * ColumnarToRow (10) + : : : : : : +- Scan parquet default.store_sales (9) + : : : : : +- BroadcastExchange (16) + : : : : : +- * Project (15) + : : : : : +- * Filter (14) + : : : : : +- * ColumnarToRow (13) + : : : : : +- Scan parquet default.date_dim (12) + : : : : +- BroadcastExchange (39) + : : : : +- * SortMergeJoin LeftSemi (38) + : : : : :- * Sort (23) + : : : : : +- Exchange (22) + : : : : : +- * Filter (21) + : : : : : +- * ColumnarToRow (20) + : : : : : +- Scan parquet default.item (19) + : : : : +- * Sort (37) + : : : : +- Exchange (36) + : : : : +- * Project (35) + : : : : +- * BroadcastHashJoin Inner BuildRight (34) + : : : : :- * Project (29) + : : : : : +- * BroadcastHashJoin Inner BuildRight (28) + : : : : : :- * Filter (26) + : : : : : : +- * ColumnarToRow (25) + : : : : : : +- Scan parquet default.catalog_sales (24) + : : : : : +- ReusedExchange (27) + : : : : +- BroadcastExchange (33) + : : : : +- * Filter (32) + : : : : +- * ColumnarToRow (31) + : : : : +- Scan parquet default.item (30) + : : : +- * Sort (57) + : : : +- Exchange (56) + : : : +- * Project (55) + : : : +- * BroadcastHashJoin Inner BuildRight (54) + : : : :- * Project (52) + : : : : +- * BroadcastHashJoin Inner BuildRight (51) + : : : : :- * Filter (49) + : : : : : +- * ColumnarToRow (48) + : : : : : +- Scan parquet default.web_sales (47) + : : : : +- ReusedExchange (50) + : : : +- ReusedExchange (53) + : : +- BroadcastExchange (72) + : : +- * Project (71) + : : +- * Filter (70) + : : +- * ColumnarToRow (69) + : : +- Scan parquet default.date_dim (68) + : +- BroadcastExchange (83) + : +- * SortMergeJoin LeftSemi (82) + : :- * Sort (79) + : : +- Exchange (78) + : : +- * Filter (77) + : : +- * ColumnarToRow (76) + : : +- Scan parquet default.item (75) + : +- * Sort (81) + : +- ReusedExchange (80) + +- BroadcastExchange (114) + +- * Project (113) + +- * Filter (112) + +- * HashAggregate (111) + +- Exchange (110) + +- * HashAggregate (109) + +- * Project (108) + +- * BroadcastHashJoin Inner BuildRight (107) + :- * Project (105) + : +- * BroadcastHashJoin Inner BuildRight (104) + : :- * SortMergeJoin LeftSemi (98) + : : :- * Sort (95) + : : : +- Exchange (94) + : : : +- * Filter (93) + : : : +- * ColumnarToRow (92) + : : : +- Scan parquet default.store_sales (91) + : : +- * Sort (97) + : : +- ReusedExchange (96) + : +- BroadcastExchange (103) + : +- * Project (102) + : +- * Filter (101) + : +- * ColumnarToRow (100) + : +- Scan parquet default.date_dim (99) + +- ReusedExchange (106) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 1] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_item_sk#1) + +(4) Exchange +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#6] + +(5) Sort [codegen id : 2] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.item +Output [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 20] +Input [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10] + +(8) Filter [codegen id : 20] +Input [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10] +Condition : ((isnotnull(i_brand_id#8) AND isnotnull(i_class_id#9)) AND isnotnull(i_category_id#10)) + +(9) Scan parquet default.store_sales +Output [2]: [ss_item_sk#11, ss_sold_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#12), dynamicpruningexpression(ss_sold_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(10) ColumnarToRow [codegen id : 11] +Input [2]: [ss_item_sk#11, ss_sold_date_sk#12] + +(11) Filter [codegen id : 11] +Input [2]: [ss_item_sk#11, ss_sold_date_sk#12] +Condition : isnotnull(ss_item_sk#11) + +(12) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1998), LessThanOrEqual(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#14, d_year#15] + +(14) Filter [codegen id : 3] +Input [2]: [d_date_sk#14, d_year#15] +Condition : (((isnotnull(d_year#15) AND (d_year#15 >= 1998)) AND (d_year#15 <= 2000)) AND isnotnull(d_date_sk#14)) + +(15) Project [codegen id : 3] +Output [1]: [d_date_sk#14] +Input [2]: [d_date_sk#14, d_year#15] + +(16) BroadcastExchange +Input [1]: [d_date_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(17) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_sold_date_sk#12] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(18) Project [codegen id : 11] +Output [1]: [ss_item_sk#11] +Input [3]: [ss_item_sk#11, ss_sold_date_sk#12, d_date_sk#14] + +(19) Scan parquet default.item +Output [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 4] +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] + +(21) Filter [codegen id : 4] +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Condition : (((isnotnull(i_item_sk#17) AND isnotnull(i_brand_id#18)) AND isnotnull(i_class_id#19)) AND isnotnull(i_category_id#20)) + +(22) Exchange +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Arguments: hashpartitioning(coalesce(i_brand_id#18, 0), isnull(i_brand_id#18), coalesce(i_class_id#19, 0), isnull(i_class_id#19), coalesce(i_category_id#20, 0), isnull(i_category_id#20), 5), ENSURE_REQUIREMENTS, [id=#21] + +(23) Sort [codegen id : 5] +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Arguments: [coalesce(i_brand_id#18, 0) ASC NULLS FIRST, isnull(i_brand_id#18) ASC NULLS FIRST, coalesce(i_class_id#19, 0) ASC NULLS FIRST, isnull(i_class_id#19) ASC NULLS FIRST, coalesce(i_category_id#20, 0) ASC NULLS FIRST, isnull(i_category_id#20) ASC NULLS FIRST], false, 0 + +(24) Scan parquet default.catalog_sales +Output [2]: [cs_item_sk#22, cs_sold_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#23), dynamicpruningexpression(cs_sold_date_sk#23 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 8] +Input [2]: [cs_item_sk#22, cs_sold_date_sk#23] + +(26) Filter [codegen id : 8] +Input [2]: [cs_item_sk#22, cs_sold_date_sk#23] +Condition : isnotnull(cs_item_sk#22) + +(27) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#24] + +(28) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_sold_date_sk#23] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(29) Project [codegen id : 8] +Output [1]: [cs_item_sk#22] +Input [3]: [cs_item_sk#22, cs_sold_date_sk#23, d_date_sk#24] + +(30) Scan parquet default.item +Output [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 7] +Input [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] + +(32) Filter [codegen id : 7] +Input [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] +Condition : isnotnull(i_item_sk#25) + +(33) BroadcastExchange +Input [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(34) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_item_sk#22] +Right keys [1]: [i_item_sk#25] +Join condition: None + +(35) Project [codegen id : 8] +Output [3]: [i_brand_id#26, i_class_id#27, i_category_id#28] +Input [5]: [cs_item_sk#22, i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] + +(36) Exchange +Input [3]: [i_brand_id#26, i_class_id#27, i_category_id#28] +Arguments: hashpartitioning(coalesce(i_brand_id#26, 0), isnull(i_brand_id#26), coalesce(i_class_id#27, 0), isnull(i_class_id#27), coalesce(i_category_id#28, 0), isnull(i_category_id#28), 5), ENSURE_REQUIREMENTS, [id=#30] + +(37) Sort [codegen id : 9] +Input [3]: [i_brand_id#26, i_class_id#27, i_category_id#28] +Arguments: [coalesce(i_brand_id#26, 0) ASC NULLS FIRST, isnull(i_brand_id#26) ASC NULLS FIRST, coalesce(i_class_id#27, 0) ASC NULLS FIRST, isnull(i_class_id#27) ASC NULLS FIRST, coalesce(i_category_id#28, 0) ASC NULLS FIRST, isnull(i_category_id#28) ASC NULLS FIRST], false, 0 + +(38) SortMergeJoin [codegen id : 10] +Left keys [6]: [coalesce(i_brand_id#18, 0), isnull(i_brand_id#18), coalesce(i_class_id#19, 0), isnull(i_class_id#19), coalesce(i_category_id#20, 0), isnull(i_category_id#20)] +Right keys [6]: [coalesce(i_brand_id#26, 0), isnull(i_brand_id#26), coalesce(i_class_id#27, 0), isnull(i_class_id#27), coalesce(i_category_id#28, 0), isnull(i_category_id#28)] +Join condition: None + +(39) BroadcastExchange +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_item_sk#11] +Right keys [1]: [i_item_sk#17] +Join condition: None + +(41) Project [codegen id : 11] +Output [3]: [i_brand_id#18 AS brand_id#32, i_class_id#19 AS class_id#33, i_category_id#20 AS category_id#34] +Input [5]: [ss_item_sk#11, i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] + +(42) HashAggregate [codegen id : 11] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(43) Exchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: hashpartitioning(brand_id#32, class_id#33, category_id#34, 5), ENSURE_REQUIREMENTS, [id=#35] + +(44) HashAggregate [codegen id : 12] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(45) Exchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: hashpartitioning(coalesce(brand_id#32, 0), isnull(brand_id#32), coalesce(class_id#33, 0), isnull(class_id#33), coalesce(category_id#34, 0), isnull(category_id#34), 5), ENSURE_REQUIREMENTS, [id=#36] + +(46) Sort [codegen id : 13] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: [coalesce(brand_id#32, 0) ASC NULLS FIRST, isnull(brand_id#32) ASC NULLS FIRST, coalesce(class_id#33, 0) ASC NULLS FIRST, isnull(class_id#33) ASC NULLS FIRST, coalesce(category_id#34, 0) ASC NULLS FIRST, isnull(category_id#34) ASC NULLS FIRST], false, 0 + +(47) Scan parquet default.web_sales +Output [2]: [ws_item_sk#37, ws_sold_date_sk#38] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#38), dynamicpruningexpression(ws_sold_date_sk#38 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 16] +Input [2]: [ws_item_sk#37, ws_sold_date_sk#38] + +(49) Filter [codegen id : 16] +Input [2]: [ws_item_sk#37, ws_sold_date_sk#38] +Condition : isnotnull(ws_item_sk#37) + +(50) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#39] + +(51) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [ws_sold_date_sk#38] +Right keys [1]: [d_date_sk#39] +Join condition: None + +(52) Project [codegen id : 16] +Output [1]: [ws_item_sk#37] +Input [3]: [ws_item_sk#37, ws_sold_date_sk#38, d_date_sk#39] + +(53) ReusedExchange [Reuses operator id: 33] +Output [4]: [i_item_sk#40, i_brand_id#41, i_class_id#42, i_category_id#43] + +(54) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [ws_item_sk#37] +Right keys [1]: [i_item_sk#40] +Join condition: None + +(55) Project [codegen id : 16] +Output [3]: [i_brand_id#41, i_class_id#42, i_category_id#43] +Input [5]: [ws_item_sk#37, i_item_sk#40, i_brand_id#41, i_class_id#42, i_category_id#43] + +(56) Exchange +Input [3]: [i_brand_id#41, i_class_id#42, i_category_id#43] +Arguments: hashpartitioning(coalesce(i_brand_id#41, 0), isnull(i_brand_id#41), coalesce(i_class_id#42, 0), isnull(i_class_id#42), coalesce(i_category_id#43, 0), isnull(i_category_id#43), 5), ENSURE_REQUIREMENTS, [id=#44] + +(57) Sort [codegen id : 17] +Input [3]: [i_brand_id#41, i_class_id#42, i_category_id#43] +Arguments: [coalesce(i_brand_id#41, 0) ASC NULLS FIRST, isnull(i_brand_id#41) ASC NULLS FIRST, coalesce(i_class_id#42, 0) ASC NULLS FIRST, isnull(i_class_id#42) ASC NULLS FIRST, coalesce(i_category_id#43, 0) ASC NULLS FIRST, isnull(i_category_id#43) ASC NULLS FIRST], false, 0 + +(58) SortMergeJoin [codegen id : 18] +Left keys [6]: [coalesce(brand_id#32, 0), isnull(brand_id#32), coalesce(class_id#33, 0), isnull(class_id#33), coalesce(category_id#34, 0), isnull(category_id#34)] +Right keys [6]: [coalesce(i_brand_id#41, 0), isnull(i_brand_id#41), coalesce(i_class_id#42, 0), isnull(i_class_id#42), coalesce(i_category_id#43, 0), isnull(i_category_id#43)] +Join condition: None + +(59) HashAggregate [codegen id : 18] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(60) Exchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: hashpartitioning(brand_id#32, class_id#33, category_id#34, 5), ENSURE_REQUIREMENTS, [id=#45] + +(61) HashAggregate [codegen id : 19] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(62) BroadcastExchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#46] + +(63) BroadcastHashJoin [codegen id : 20] +Left keys [3]: [i_brand_id#8, i_class_id#9, i_category_id#10] +Right keys [3]: [brand_id#32, class_id#33, category_id#34] +Join condition: None + +(64) Project [codegen id : 20] +Output [1]: [i_item_sk#7 AS ss_item_sk#47] +Input [7]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, brand_id#32, class_id#33, category_id#34] + +(65) Exchange +Input [1]: [ss_item_sk#47] +Arguments: hashpartitioning(ss_item_sk#47, 5), ENSURE_REQUIREMENTS, [id=#48] + +(66) Sort [codegen id : 21] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(67) SortMergeJoin [codegen id : 45] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(68) Scan parquet default.date_dim +Output [2]: [d_date_sk#49, d_week_seq#50] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(69) ColumnarToRow [codegen id : 22] +Input [2]: [d_date_sk#49, d_week_seq#50] + +(70) Filter [codegen id : 22] +Input [2]: [d_date_sk#49, d_week_seq#50] +Condition : ((isnotnull(d_week_seq#50) AND (d_week_seq#50 = Subquery scalar-subquery#51, [id=#52])) AND isnotnull(d_date_sk#49)) + +(71) Project [codegen id : 22] +Output [1]: [d_date_sk#49] +Input [2]: [d_date_sk#49, d_week_seq#50] + +(72) BroadcastExchange +Input [1]: [d_date_sk#49] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#53] + +(73) BroadcastHashJoin [codegen id : 45] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#49] +Join condition: None + +(74) Project [codegen id : 45] +Output [3]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3] +Input [5]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, d_date_sk#49] + +(75) Scan parquet default.item +Output [4]: [i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 23] +Input [4]: [i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] + +(77) Filter [codegen id : 23] +Input [4]: [i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] +Condition : (((isnotnull(i_item_sk#54) AND isnotnull(i_brand_id#55)) AND isnotnull(i_class_id#56)) AND isnotnull(i_category_id#57)) + +(78) Exchange +Input [4]: [i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] +Arguments: hashpartitioning(i_item_sk#54, 5), ENSURE_REQUIREMENTS, [id=#58] + +(79) Sort [codegen id : 24] +Input [4]: [i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] +Arguments: [i_item_sk#54 ASC NULLS FIRST], false, 0 + +(80) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#47] + +(81) Sort [codegen id : 43] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(82) SortMergeJoin [codegen id : 44] +Left keys [1]: [i_item_sk#54] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(83) BroadcastExchange +Input [4]: [i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#59] + +(84) BroadcastHashJoin [codegen id : 45] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#54] +Join condition: None + +(85) Project [codegen id : 45] +Output [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#55, i_class_id#56, i_category_id#57] +Input [7]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, i_item_sk#54, i_brand_id#55, i_class_id#56, i_category_id#57] + +(86) HashAggregate [codegen id : 45] +Input [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#55, i_class_id#56, i_category_id#57] +Keys [3]: [i_brand_id#55, i_class_id#56, i_category_id#57] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#60, isEmpty#61, count#62] +Results [6]: [i_brand_id#55, i_class_id#56, i_category_id#57, sum#63, isEmpty#64, count#65] + +(87) Exchange +Input [6]: [i_brand_id#55, i_class_id#56, i_category_id#57, sum#63, isEmpty#64, count#65] +Arguments: hashpartitioning(i_brand_id#55, i_class_id#56, i_category_id#57, 5), ENSURE_REQUIREMENTS, [id=#66] + +(88) HashAggregate [codegen id : 92] +Input [6]: [i_brand_id#55, i_class_id#56, i_category_id#57, sum#63, isEmpty#64, count#65] +Keys [3]: [i_brand_id#55, i_class_id#56, i_category_id#57] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#67, count(1)#68] +Results [6]: [i_brand_id#55, i_class_id#56, i_category_id#57, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#67 AS sales#69, count(1)#68 AS number_sales#70, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#67 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#71] + +(89) Filter [codegen id : 92] +Input [6]: [i_brand_id#55, i_class_id#56, i_category_id#57, sales#69, number_sales#70, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#71] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#71) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#71 as decimal(32,6)) > cast(Subquery scalar-subquery#72, [id=#73] as decimal(32,6)))) + +(90) Project [codegen id : 92] +Output [6]: [store AS channel#74, i_brand_id#55, i_class_id#56, i_category_id#57, sales#69, number_sales#70] +Input [6]: [i_brand_id#55, i_class_id#56, i_category_id#57, sales#69, number_sales#70, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#71] + +(91) Scan parquet default.store_sales +Output [4]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, ss_sold_date_sk#78] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#78), dynamicpruningexpression(ss_sold_date_sk#78 IN dynamicpruning#79)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(92) ColumnarToRow [codegen id : 46] +Input [4]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, ss_sold_date_sk#78] + +(93) Filter [codegen id : 46] +Input [4]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, ss_sold_date_sk#78] +Condition : isnotnull(ss_item_sk#75) + +(94) Exchange +Input [4]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, ss_sold_date_sk#78] +Arguments: hashpartitioning(ss_item_sk#75, 5), ENSURE_REQUIREMENTS, [id=#80] + +(95) Sort [codegen id : 47] +Input [4]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, ss_sold_date_sk#78] +Arguments: [ss_item_sk#75 ASC NULLS FIRST], false, 0 + +(96) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#47] + +(97) Sort [codegen id : 66] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(98) SortMergeJoin [codegen id : 90] +Left keys [1]: [ss_item_sk#75] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(99) Scan parquet default.date_dim +Output [2]: [d_date_sk#81, d_week_seq#82] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(100) ColumnarToRow [codegen id : 67] +Input [2]: [d_date_sk#81, d_week_seq#82] + +(101) Filter [codegen id : 67] +Input [2]: [d_date_sk#81, d_week_seq#82] +Condition : ((isnotnull(d_week_seq#82) AND (d_week_seq#82 = Subquery scalar-subquery#83, [id=#84])) AND isnotnull(d_date_sk#81)) + +(102) Project [codegen id : 67] +Output [1]: [d_date_sk#81] +Input [2]: [d_date_sk#81, d_week_seq#82] + +(103) BroadcastExchange +Input [1]: [d_date_sk#81] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#85] + +(104) BroadcastHashJoin [codegen id : 90] +Left keys [1]: [ss_sold_date_sk#78] +Right keys [1]: [d_date_sk#81] +Join condition: None + +(105) Project [codegen id : 90] +Output [3]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77] +Input [5]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, ss_sold_date_sk#78, d_date_sk#81] + +(106) ReusedExchange [Reuses operator id: 83] +Output [4]: [i_item_sk#86, i_brand_id#87, i_class_id#88, i_category_id#89] + +(107) BroadcastHashJoin [codegen id : 90] +Left keys [1]: [ss_item_sk#75] +Right keys [1]: [i_item_sk#86] +Join condition: None + +(108) Project [codegen id : 90] +Output [5]: [ss_quantity#76, ss_list_price#77, i_brand_id#87, i_class_id#88, i_category_id#89] +Input [7]: [ss_item_sk#75, ss_quantity#76, ss_list_price#77, i_item_sk#86, i_brand_id#87, i_class_id#88, i_category_id#89] + +(109) HashAggregate [codegen id : 90] +Input [5]: [ss_quantity#76, ss_list_price#77, i_brand_id#87, i_class_id#88, i_category_id#89] +Keys [3]: [i_brand_id#87, i_class_id#88, i_category_id#89] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#90, isEmpty#91, count#92] +Results [6]: [i_brand_id#87, i_class_id#88, i_category_id#89, sum#93, isEmpty#94, count#95] + +(110) Exchange +Input [6]: [i_brand_id#87, i_class_id#88, i_category_id#89, sum#93, isEmpty#94, count#95] +Arguments: hashpartitioning(i_brand_id#87, i_class_id#88, i_category_id#89, 5), ENSURE_REQUIREMENTS, [id=#96] + +(111) HashAggregate [codegen id : 91] +Input [6]: [i_brand_id#87, i_class_id#88, i_category_id#89, sum#93, isEmpty#94, count#95] +Keys [3]: [i_brand_id#87, i_class_id#88, i_category_id#89] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#97, count(1)#98] +Results [6]: [i_brand_id#87, i_class_id#88, i_category_id#89, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#97 AS sales#99, count(1)#98 AS number_sales#100, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#97 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#101] + +(112) Filter [codegen id : 91] +Input [6]: [i_brand_id#87, i_class_id#88, i_category_id#89, sales#99, number_sales#100, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#101] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#101) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#101 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#72, [id=#73] as decimal(32,6)))) + +(113) Project [codegen id : 91] +Output [6]: [store AS channel#102, i_brand_id#87, i_class_id#88, i_category_id#89, sales#99, number_sales#100] +Input [6]: [i_brand_id#87, i_class_id#88, i_category_id#89, sales#99, number_sales#100, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#76 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#77 as decimal(12,2)))), DecimalType(18,2), true))#101] + +(114) BroadcastExchange +Input [6]: [channel#102, i_brand_id#87, i_class_id#88, i_category_id#89, sales#99, number_sales#100] +Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true]),false), [id=#103] + +(115) BroadcastHashJoin [codegen id : 92] +Left keys [3]: [i_brand_id#55, i_class_id#56, i_category_id#57] +Right keys [3]: [i_brand_id#87, i_class_id#88, i_category_id#89] +Join condition: None + +(116) TakeOrderedAndProject +Input [12]: [channel#74, i_brand_id#55, i_class_id#56, i_category_id#57, sales#69, number_sales#70, channel#102, i_brand_id#87, i_class_id#88, i_category_id#89, sales#99, number_sales#100] +Arguments: 100, [i_brand_id#55 ASC NULLS FIRST, i_class_id#56 ASC NULLS FIRST, i_category_id#57 ASC NULLS FIRST], [channel#74, i_brand_id#55, i_class_id#56, i_category_id#57, sales#69, number_sales#70, channel#102, i_brand_id#87, i_class_id#88, i_category_id#89, sales#99, number_sales#100] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 89 Hosting Expression = Subquery scalar-subquery#72, [id=#73] +* HashAggregate (139) ++- Exchange (138) + +- * HashAggregate (137) + +- Union (136) + :- * Project (125) + : +- * BroadcastHashJoin Inner BuildRight (124) + : :- * ColumnarToRow (118) + : : +- Scan parquet default.store_sales (117) + : +- BroadcastExchange (123) + : +- * Project (122) + : +- * Filter (121) + : +- * ColumnarToRow (120) + : +- Scan parquet default.date_dim (119) + :- * Project (130) + : +- * BroadcastHashJoin Inner BuildRight (129) + : :- * ColumnarToRow (127) + : : +- Scan parquet default.catalog_sales (126) + : +- ReusedExchange (128) + +- * Project (135) + +- * BroadcastHashJoin Inner BuildRight (134) + :- * ColumnarToRow (132) + : +- Scan parquet default.web_sales (131) + +- ReusedExchange (133) + + +(117) Scan parquet default.store_sales +Output [3]: [ss_quantity#104, ss_list_price#105, ss_sold_date_sk#106] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#106), dynamicpruningexpression(ss_sold_date_sk#106 IN dynamicpruning#107)] +ReadSchema: struct + +(118) ColumnarToRow [codegen id : 2] +Input [3]: [ss_quantity#104, ss_list_price#105, ss_sold_date_sk#106] + +(119) Scan parquet default.date_dim +Output [2]: [d_date_sk#108, d_year#109] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1998), LessThanOrEqual(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(120) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#108, d_year#109] + +(121) Filter [codegen id : 1] +Input [2]: [d_date_sk#108, d_year#109] +Condition : (((isnotnull(d_year#109) AND (d_year#109 >= 1998)) AND (d_year#109 <= 2000)) AND isnotnull(d_date_sk#108)) + +(122) Project [codegen id : 1] +Output [1]: [d_date_sk#108] +Input [2]: [d_date_sk#108, d_year#109] + +(123) BroadcastExchange +Input [1]: [d_date_sk#108] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#110] + +(124) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#106] +Right keys [1]: [d_date_sk#108] +Join condition: None + +(125) Project [codegen id : 2] +Output [2]: [ss_quantity#104 AS quantity#111, ss_list_price#105 AS list_price#112] +Input [4]: [ss_quantity#104, ss_list_price#105, ss_sold_date_sk#106, d_date_sk#108] + +(126) Scan parquet default.catalog_sales +Output [3]: [cs_quantity#113, cs_list_price#114, cs_sold_date_sk#115] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#115), dynamicpruningexpression(cs_sold_date_sk#115 IN dynamicpruning#107)] +ReadSchema: struct + +(127) ColumnarToRow [codegen id : 4] +Input [3]: [cs_quantity#113, cs_list_price#114, cs_sold_date_sk#115] + +(128) ReusedExchange [Reuses operator id: 123] +Output [1]: [d_date_sk#116] + +(129) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#115] +Right keys [1]: [d_date_sk#116] +Join condition: None + +(130) Project [codegen id : 4] +Output [2]: [cs_quantity#113 AS quantity#117, cs_list_price#114 AS list_price#118] +Input [4]: [cs_quantity#113, cs_list_price#114, cs_sold_date_sk#115, d_date_sk#116] + +(131) Scan parquet default.web_sales +Output [3]: [ws_quantity#119, ws_list_price#120, ws_sold_date_sk#121] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#121), dynamicpruningexpression(ws_sold_date_sk#121 IN dynamicpruning#107)] +ReadSchema: struct + +(132) ColumnarToRow [codegen id : 6] +Input [3]: [ws_quantity#119, ws_list_price#120, ws_sold_date_sk#121] + +(133) ReusedExchange [Reuses operator id: 123] +Output [1]: [d_date_sk#122] + +(134) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#121] +Right keys [1]: [d_date_sk#122] +Join condition: None + +(135) Project [codegen id : 6] +Output [2]: [ws_quantity#119 AS quantity#123, ws_list_price#120 AS list_price#124] +Input [4]: [ws_quantity#119, ws_list_price#120, ws_sold_date_sk#121, d_date_sk#122] + +(136) Union + +(137) HashAggregate [codegen id : 7] +Input [2]: [quantity#111, list_price#112] +Keys: [] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#111 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#112 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#125, count#126] +Results [2]: [sum#127, count#128] + +(138) Exchange +Input [2]: [sum#127, count#128] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#129] + +(139) HashAggregate [codegen id : 8] +Input [2]: [sum#127, count#128] +Keys: [] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#111 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#112 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#111 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#112 as decimal(12,2)))), DecimalType(18,2), true))#130] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#111 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#112 as decimal(12,2)))), DecimalType(18,2), true))#130 AS average_sales#131] + +Subquery:2 Hosting operator id = 117 Hosting Expression = ss_sold_date_sk#106 IN dynamicpruning#107 +ReusedExchange (140) + + +(140) ReusedExchange [Reuses operator id: 123] +Output [1]: [d_date_sk#108] + +Subquery:3 Hosting operator id = 126 Hosting Expression = cs_sold_date_sk#115 IN dynamicpruning#107 + +Subquery:4 Hosting operator id = 131 Hosting Expression = ws_sold_date_sk#121 IN dynamicpruning#107 + +Subquery:5 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (141) + + +(141) ReusedExchange [Reuses operator id: 72] +Output [1]: [d_date_sk#49] + +Subquery:6 Hosting operator id = 9 Hosting Expression = ss_sold_date_sk#12 IN dynamicpruning#13 +ReusedExchange (142) + + +(142) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#14] + +Subquery:7 Hosting operator id = 24 Hosting Expression = cs_sold_date_sk#23 IN dynamicpruning#13 + +Subquery:8 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#38 IN dynamicpruning#13 + +Subquery:9 Hosting operator id = 70 Hosting Expression = Subquery scalar-subquery#51, [id=#52] +* Project (146) ++- * Filter (145) + +- * ColumnarToRow (144) + +- Scan parquet default.date_dim (143) + + +(143) Scan parquet default.date_dim +Output [4]: [d_week_seq#132, d_year#133, d_moy#134, d_dom#135] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1999), EqualTo(d_moy,12), EqualTo(d_dom,16)] +ReadSchema: struct + +(144) ColumnarToRow [codegen id : 1] +Input [4]: [d_week_seq#132, d_year#133, d_moy#134, d_dom#135] + +(145) Filter [codegen id : 1] +Input [4]: [d_week_seq#132, d_year#133, d_moy#134, d_dom#135] +Condition : (((((isnotnull(d_year#133) AND isnotnull(d_moy#134)) AND isnotnull(d_dom#135)) AND (d_year#133 = 1999)) AND (d_moy#134 = 12)) AND (d_dom#135 = 16)) + +(146) Project [codegen id : 1] +Output [1]: [d_week_seq#132] +Input [4]: [d_week_seq#132, d_year#133, d_moy#134, d_dom#135] + +Subquery:10 Hosting operator id = 112 Hosting Expression = ReusedSubquery Subquery scalar-subquery#72, [id=#73] + +Subquery:11 Hosting operator id = 91 Hosting Expression = ss_sold_date_sk#78 IN dynamicpruning#79 +ReusedExchange (147) + + +(147) ReusedExchange [Reuses operator id: 103] +Output [1]: [d_date_sk#81] + +Subquery:12 Hosting operator id = 101 Hosting Expression = Subquery scalar-subquery#83, [id=#84] +* Project (151) ++- * Filter (150) + +- * ColumnarToRow (149) + +- Scan parquet default.date_dim (148) + + +(148) Scan parquet default.date_dim +Output [4]: [d_week_seq#136, d_year#137, d_moy#138, d_dom#139] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1998), EqualTo(d_moy,12), EqualTo(d_dom,16)] +ReadSchema: struct + +(149) ColumnarToRow [codegen id : 1] +Input [4]: [d_week_seq#136, d_year#137, d_moy#138, d_dom#139] + +(150) Filter [codegen id : 1] +Input [4]: [d_week_seq#136, d_year#137, d_moy#138, d_dom#139] +Condition : (((((isnotnull(d_year#137) AND isnotnull(d_moy#138)) AND isnotnull(d_dom#139)) AND (d_year#137 = 1998)) AND (d_moy#138 = 12)) AND (d_dom#139 = 16)) + +(151) Project [codegen id : 1] +Output [1]: [d_week_seq#136] +Input [4]: [d_week_seq#136, d_year#137, d_moy#138, d_dom#139] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/simplified.txt new file mode 100644 index 0000000000000..6a8fcada7a61b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14.sf100/simplified.txt @@ -0,0 +1,261 @@ +TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_sales,channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + WholeStageCodegen (92) + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id] + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + Subquery #4 + WholeStageCodegen (8) + HashAggregate [sum,count] [avg(CheckOverflow((promote_precision(cast(cast(quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price as decimal(12,2)))), DecimalType(18,2), true)),average_sales,sum,count] + InputAdapter + Exchange #18 + WholeStageCodegen (7) + HashAggregate [quantity,list_price] [sum,count,sum,count] + InputAdapter + Union + WholeStageCodegen (2) + Project [ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #5 + ReusedExchange [d_date_sk] #19 + InputAdapter + BroadcastExchange #19 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + WholeStageCodegen (4) + Project [cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_quantity,cs_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #5 + InputAdapter + ReusedExchange [d_date_sk] #19 + WholeStageCodegen (6) + Project [ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #5 + InputAdapter + ReusedExchange [d_date_sk] #19 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #1 + WholeStageCodegen (45) + HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + SortMergeJoin [ss_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #2 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + WholeStageCodegen (21) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (20) + Project [i_item_sk] + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id] + Filter [i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (19) + HashAggregate [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #6 + WholeStageCodegen (18) + HashAggregate [brand_id,class_id,category_id] + SortMergeJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (13) + Sort [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #7 + WholeStageCodegen (12) + HashAggregate [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #8 + WholeStageCodegen (11) + HashAggregate [brand_id,class_id,category_id] + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (10) + SortMergeJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (5) + Sort [i_brand_id,i_class_id,i_category_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #11 + WholeStageCodegen (4) + Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (9) + Sort [i_brand_id,i_class_id,i_category_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #12 + WholeStageCodegen (8) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk] #9 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (7) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (17) + Sort [i_brand_id,i_class_id,i_category_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #14 + WholeStageCodegen (16) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk] #9 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #13 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (22) + Project [d_date_sk] + Filter [d_week_seq,d_date_sk] + Subquery #3 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (44) + SortMergeJoin [i_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (24) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #16 + WholeStageCodegen (23) + Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (43) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk] #17 + InputAdapter + BroadcastExchange #20 + WholeStageCodegen (91) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #4 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #21 + WholeStageCodegen (90) + HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + SortMergeJoin [ss_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (47) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #22 + WholeStageCodegen (46) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #6 + ReusedExchange [d_date_sk] #23 + InputAdapter + WholeStageCodegen (66) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk] #17 + InputAdapter + BroadcastExchange #23 + WholeStageCodegen (67) + Project [d_date_sk] + Filter [d_week_seq,d_date_sk] + Subquery #7 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #15 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/explain.txt new file mode 100644 index 0000000000000..bdafb17d69d45 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/explain.txt @@ -0,0 +1,789 @@ +== Physical Plan == +TakeOrderedAndProject (100) ++- * BroadcastHashJoin Inner BuildRight (99) + :- * Project (77) + : +- * Filter (76) + : +- * HashAggregate (75) + : +- Exchange (74) + : +- * HashAggregate (73) + : +- * Project (72) + : +- * BroadcastHashJoin Inner BuildRight (71) + : :- * Project (65) + : : +- * BroadcastHashJoin Inner BuildRight (64) + : : :- * BroadcastHashJoin LeftSemi BuildRight (57) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (56) + : : : +- * Project (55) + : : : +- * BroadcastHashJoin Inner BuildRight (54) + : : : :- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.item (4) + : : : +- BroadcastExchange (53) + : : : +- * HashAggregate (52) + : : : +- * HashAggregate (51) + : : : +- * BroadcastHashJoin LeftSemi BuildRight (50) + : : : :- * HashAggregate (39) + : : : : +- Exchange (38) + : : : : +- * HashAggregate (37) + : : : : +- * Project (36) + : : : : +- * BroadcastHashJoin Inner BuildRight (35) + : : : : :- * Project (33) + : : : : : +- * BroadcastHashJoin Inner BuildRight (32) + : : : : : :- * Filter (9) + : : : : : : +- * ColumnarToRow (8) + : : : : : : +- Scan parquet default.store_sales (7) + : : : : : +- BroadcastExchange (31) + : : : : : +- * BroadcastHashJoin LeftSemi BuildRight (30) + : : : : : :- * Filter (12) + : : : : : : +- * ColumnarToRow (11) + : : : : : : +- Scan parquet default.item (10) + : : : : : +- BroadcastExchange (29) + : : : : : +- * Project (28) + : : : : : +- * BroadcastHashJoin Inner BuildRight (27) + : : : : : :- * Project (21) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : : : : :- * Filter (15) + : : : : : : : +- * ColumnarToRow (14) + : : : : : : : +- Scan parquet default.catalog_sales (13) + : : : : : : +- BroadcastExchange (19) + : : : : : : +- * Filter (18) + : : : : : : +- * ColumnarToRow (17) + : : : : : : +- Scan parquet default.item (16) + : : : : : +- BroadcastExchange (26) + : : : : : +- * Project (25) + : : : : : +- * Filter (24) + : : : : : +- * ColumnarToRow (23) + : : : : : +- Scan parquet default.date_dim (22) + : : : : +- ReusedExchange (34) + : : : +- BroadcastExchange (49) + : : : +- * Project (48) + : : : +- * BroadcastHashJoin Inner BuildRight (47) + : : : :- * Project (45) + : : : : +- * BroadcastHashJoin Inner BuildRight (44) + : : : : :- * Filter (42) + : : : : : +- * ColumnarToRow (41) + : : : : : +- Scan parquet default.web_sales (40) + : : : : +- ReusedExchange (43) + : : : +- ReusedExchange (46) + : : +- BroadcastExchange (63) + : : +- * BroadcastHashJoin LeftSemi BuildRight (62) + : : :- * Filter (60) + : : : +- * ColumnarToRow (59) + : : : +- Scan parquet default.item (58) + : : +- ReusedExchange (61) + : +- BroadcastExchange (70) + : +- * Project (69) + : +- * Filter (68) + : +- * ColumnarToRow (67) + : +- Scan parquet default.date_dim (66) + +- BroadcastExchange (98) + +- * Project (97) + +- * Filter (96) + +- * HashAggregate (95) + +- Exchange (94) + +- * HashAggregate (93) + +- * Project (92) + +- * BroadcastHashJoin Inner BuildRight (91) + :- * Project (85) + : +- * BroadcastHashJoin Inner BuildRight (84) + : :- * BroadcastHashJoin LeftSemi BuildRight (82) + : : :- * Filter (80) + : : : +- * ColumnarToRow (79) + : : : +- Scan parquet default.store_sales (78) + : : +- ReusedExchange (81) + : +- ReusedExchange (83) + +- BroadcastExchange (90) + +- * Project (89) + +- * Filter (88) + +- * ColumnarToRow (87) + +- Scan parquet default.date_dim (86) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 25] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 25] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 11] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] + +(6) Filter [codegen id : 11] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Condition : ((isnotnull(i_brand_id#7) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) + +(7) Scan parquet default.store_sales +Output [2]: [ss_item_sk#10, ss_sold_date_sk#11] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#11), dynamicpruningexpression(ss_sold_date_sk#11 IN dynamicpruning#12)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 6] +Input [2]: [ss_item_sk#10, ss_sold_date_sk#11] + +(9) Filter [codegen id : 6] +Input [2]: [ss_item_sk#10, ss_sold_date_sk#11] +Condition : isnotnull(ss_item_sk#10) + +(10) Scan parquet default.item +Output [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 4] +Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] + +(12) Filter [codegen id : 4] +Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] +Condition : (((isnotnull(i_item_sk#13) AND isnotnull(i_brand_id#14)) AND isnotnull(i_class_id#15)) AND isnotnull(i_category_id#16)) + +(13) Scan parquet default.catalog_sales +Output [2]: [cs_item_sk#17, cs_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#12)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 3] +Input [2]: [cs_item_sk#17, cs_sold_date_sk#18] + +(15) Filter [codegen id : 3] +Input [2]: [cs_item_sk#17, cs_sold_date_sk#18] +Condition : isnotnull(cs_item_sk#17) + +(16) Scan parquet default.item +Output [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] + +(18) Filter [codegen id : 1] +Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] +Condition : isnotnull(i_item_sk#19) + +(19) BroadcastExchange +Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(20) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_item_sk#17] +Right keys [1]: [i_item_sk#19] +Join condition: None + +(21) Project [codegen id : 3] +Output [4]: [cs_sold_date_sk#18, i_brand_id#20, i_class_id#21, i_category_id#22] +Input [6]: [cs_item_sk#17, cs_sold_date_sk#18, i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] + +(22) Scan parquet default.date_dim +Output [2]: [d_date_sk#24, d_year#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1998), LessThanOrEqual(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#24, d_year#25] + +(24) Filter [codegen id : 2] +Input [2]: [d_date_sk#24, d_year#25] +Condition : (((isnotnull(d_year#25) AND (d_year#25 >= 1998)) AND (d_year#25 <= 2000)) AND isnotnull(d_date_sk#24)) + +(25) Project [codegen id : 2] +Output [1]: [d_date_sk#24] +Input [2]: [d_date_sk#24, d_year#25] + +(26) BroadcastExchange +Input [1]: [d_date_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] + +(27) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(28) Project [codegen id : 3] +Output [3]: [i_brand_id#20, i_class_id#21, i_category_id#22] +Input [5]: [cs_sold_date_sk#18, i_brand_id#20, i_class_id#21, i_category_id#22, d_date_sk#24] + +(29) BroadcastExchange +Input [3]: [i_brand_id#20, i_class_id#21, i_category_id#22] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [id=#27] + +(30) BroadcastHashJoin [codegen id : 4] +Left keys [6]: [coalesce(i_brand_id#14, 0), isnull(i_brand_id#14), coalesce(i_class_id#15, 0), isnull(i_class_id#15), coalesce(i_category_id#16, 0), isnull(i_category_id#16)] +Right keys [6]: [coalesce(i_brand_id#20, 0), isnull(i_brand_id#20), coalesce(i_class_id#21, 0), isnull(i_class_id#21), coalesce(i_category_id#22, 0), isnull(i_category_id#22)] +Join condition: None + +(31) BroadcastExchange +Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#28] + +(32) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#10] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(33) Project [codegen id : 6] +Output [4]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16] +Input [6]: [ss_item_sk#10, ss_sold_date_sk#11, i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] + +(34) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#29] + +(35) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#11] +Right keys [1]: [d_date_sk#29] +Join condition: None + +(36) Project [codegen id : 6] +Output [3]: [i_brand_id#14 AS brand_id#30, i_class_id#15 AS class_id#31, i_category_id#16 AS category_id#32] +Input [5]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16, d_date_sk#29] + +(37) HashAggregate [codegen id : 6] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(38) Exchange +Input [3]: [brand_id#30, class_id#31, category_id#32] +Arguments: hashpartitioning(brand_id#30, class_id#31, category_id#32, 5), ENSURE_REQUIREMENTS, [id=#33] + +(39) HashAggregate [codegen id : 10] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(40) Scan parquet default.web_sales +Output [2]: [ws_item_sk#34, ws_sold_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#35), dynamicpruningexpression(ws_sold_date_sk#35 IN dynamicpruning#12)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 9] +Input [2]: [ws_item_sk#34, ws_sold_date_sk#35] + +(42) Filter [codegen id : 9] +Input [2]: [ws_item_sk#34, ws_sold_date_sk#35] +Condition : isnotnull(ws_item_sk#34) + +(43) ReusedExchange [Reuses operator id: 19] +Output [4]: [i_item_sk#36, i_brand_id#37, i_class_id#38, i_category_id#39] + +(44) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ws_item_sk#34] +Right keys [1]: [i_item_sk#36] +Join condition: None + +(45) Project [codegen id : 9] +Output [4]: [ws_sold_date_sk#35, i_brand_id#37, i_class_id#38, i_category_id#39] +Input [6]: [ws_item_sk#34, ws_sold_date_sk#35, i_item_sk#36, i_brand_id#37, i_class_id#38, i_category_id#39] + +(46) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#40] + +(47) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ws_sold_date_sk#35] +Right keys [1]: [d_date_sk#40] +Join condition: None + +(48) Project [codegen id : 9] +Output [3]: [i_brand_id#37, i_class_id#38, i_category_id#39] +Input [5]: [ws_sold_date_sk#35, i_brand_id#37, i_class_id#38, i_category_id#39, d_date_sk#40] + +(49) BroadcastExchange +Input [3]: [i_brand_id#37, i_class_id#38, i_category_id#39] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [id=#41] + +(50) BroadcastHashJoin [codegen id : 10] +Left keys [6]: [coalesce(brand_id#30, 0), isnull(brand_id#30), coalesce(class_id#31, 0), isnull(class_id#31), coalesce(category_id#32, 0), isnull(category_id#32)] +Right keys [6]: [coalesce(i_brand_id#37, 0), isnull(i_brand_id#37), coalesce(i_class_id#38, 0), isnull(i_class_id#38), coalesce(i_category_id#39, 0), isnull(i_category_id#39)] +Join condition: None + +(51) HashAggregate [codegen id : 10] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(52) HashAggregate [codegen id : 10] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(53) BroadcastExchange +Input [3]: [brand_id#30, class_id#31, category_id#32] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#42] + +(54) BroadcastHashJoin [codegen id : 11] +Left keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Right keys [3]: [brand_id#30, class_id#31, category_id#32] +Join condition: None + +(55) Project [codegen id : 11] +Output [1]: [i_item_sk#6 AS ss_item_sk#43] +Input [7]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, brand_id#30, class_id#31, category_id#32] + +(56) BroadcastExchange +Input [1]: [ss_item_sk#43] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] + +(57) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(58) Scan parquet default.item +Output [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(59) ColumnarToRow [codegen id : 23] +Input [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] + +(60) Filter [codegen id : 23] +Input [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] +Condition : (((isnotnull(i_item_sk#45) AND isnotnull(i_brand_id#46)) AND isnotnull(i_class_id#47)) AND isnotnull(i_category_id#48)) + +(61) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#43] + +(62) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [i_item_sk#45] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(63) BroadcastExchange +Input [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#49] + +(64) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#45] +Join condition: None + +(65) Project [codegen id : 25] +Output [6]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#46, i_class_id#47, i_category_id#48] +Input [8]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] + +(66) Scan parquet default.date_dim +Output [2]: [d_date_sk#50, d_week_seq#51] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(67) ColumnarToRow [codegen id : 24] +Input [2]: [d_date_sk#50, d_week_seq#51] + +(68) Filter [codegen id : 24] +Input [2]: [d_date_sk#50, d_week_seq#51] +Condition : ((isnotnull(d_week_seq#51) AND (d_week_seq#51 = Subquery scalar-subquery#52, [id=#53])) AND isnotnull(d_date_sk#50)) + +(69) Project [codegen id : 24] +Output [1]: [d_date_sk#50] +Input [2]: [d_date_sk#50, d_week_seq#51] + +(70) BroadcastExchange +Input [1]: [d_date_sk#50] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#54] + +(71) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#50] +Join condition: None + +(72) Project [codegen id : 25] +Output [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#46, i_class_id#47, i_category_id#48] +Input [7]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#46, i_class_id#47, i_category_id#48, d_date_sk#50] + +(73) HashAggregate [codegen id : 25] +Input [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#46, i_class_id#47, i_category_id#48] +Keys [3]: [i_brand_id#46, i_class_id#47, i_category_id#48] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#55, isEmpty#56, count#57] +Results [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum#58, isEmpty#59, count#60] + +(74) Exchange +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum#58, isEmpty#59, count#60] +Arguments: hashpartitioning(i_brand_id#46, i_class_id#47, i_category_id#48, 5), ENSURE_REQUIREMENTS, [id=#61] + +(75) HashAggregate [codegen id : 52] +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum#58, isEmpty#59, count#60] +Keys [3]: [i_brand_id#46, i_class_id#47, i_category_id#48] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#62, count(1)#63] +Results [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#62 AS sales#64, count(1)#63 AS number_sales#65, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#62 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66] + +(76) Filter [codegen id : 52] +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sales#64, number_sales#65, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66 as decimal(32,6)) > cast(Subquery scalar-subquery#67, [id=#68] as decimal(32,6)))) + +(77) Project [codegen id : 52] +Output [6]: [store AS channel#69, i_brand_id#46, i_class_id#47, i_category_id#48, sales#64, number_sales#65] +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sales#64, number_sales#65, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66] + +(78) Scan parquet default.store_sales +Output [4]: [ss_item_sk#70, ss_quantity#71, ss_list_price#72, ss_sold_date_sk#73] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#73), dynamicpruningexpression(ss_sold_date_sk#73 IN dynamicpruning#74)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(79) ColumnarToRow [codegen id : 50] +Input [4]: [ss_item_sk#70, ss_quantity#71, ss_list_price#72, ss_sold_date_sk#73] + +(80) Filter [codegen id : 50] +Input [4]: [ss_item_sk#70, ss_quantity#71, ss_list_price#72, ss_sold_date_sk#73] +Condition : isnotnull(ss_item_sk#70) + +(81) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#43] + +(82) BroadcastHashJoin [codegen id : 50] +Left keys [1]: [ss_item_sk#70] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(83) ReusedExchange [Reuses operator id: 63] +Output [4]: [i_item_sk#75, i_brand_id#76, i_class_id#77, i_category_id#78] + +(84) BroadcastHashJoin [codegen id : 50] +Left keys [1]: [ss_item_sk#70] +Right keys [1]: [i_item_sk#75] +Join condition: None + +(85) Project [codegen id : 50] +Output [6]: [ss_quantity#71, ss_list_price#72, ss_sold_date_sk#73, i_brand_id#76, i_class_id#77, i_category_id#78] +Input [8]: [ss_item_sk#70, ss_quantity#71, ss_list_price#72, ss_sold_date_sk#73, i_item_sk#75, i_brand_id#76, i_class_id#77, i_category_id#78] + +(86) Scan parquet default.date_dim +Output [2]: [d_date_sk#79, d_week_seq#80] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(87) ColumnarToRow [codegen id : 49] +Input [2]: [d_date_sk#79, d_week_seq#80] + +(88) Filter [codegen id : 49] +Input [2]: [d_date_sk#79, d_week_seq#80] +Condition : ((isnotnull(d_week_seq#80) AND (d_week_seq#80 = Subquery scalar-subquery#81, [id=#82])) AND isnotnull(d_date_sk#79)) + +(89) Project [codegen id : 49] +Output [1]: [d_date_sk#79] +Input [2]: [d_date_sk#79, d_week_seq#80] + +(90) BroadcastExchange +Input [1]: [d_date_sk#79] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#83] + +(91) BroadcastHashJoin [codegen id : 50] +Left keys [1]: [ss_sold_date_sk#73] +Right keys [1]: [d_date_sk#79] +Join condition: None + +(92) Project [codegen id : 50] +Output [5]: [ss_quantity#71, ss_list_price#72, i_brand_id#76, i_class_id#77, i_category_id#78] +Input [7]: [ss_quantity#71, ss_list_price#72, ss_sold_date_sk#73, i_brand_id#76, i_class_id#77, i_category_id#78, d_date_sk#79] + +(93) HashAggregate [codegen id : 50] +Input [5]: [ss_quantity#71, ss_list_price#72, i_brand_id#76, i_class_id#77, i_category_id#78] +Keys [3]: [i_brand_id#76, i_class_id#77, i_category_id#78] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#84, isEmpty#85, count#86] +Results [6]: [i_brand_id#76, i_class_id#77, i_category_id#78, sum#87, isEmpty#88, count#89] + +(94) Exchange +Input [6]: [i_brand_id#76, i_class_id#77, i_category_id#78, sum#87, isEmpty#88, count#89] +Arguments: hashpartitioning(i_brand_id#76, i_class_id#77, i_category_id#78, 5), ENSURE_REQUIREMENTS, [id=#90] + +(95) HashAggregate [codegen id : 51] +Input [6]: [i_brand_id#76, i_class_id#77, i_category_id#78, sum#87, isEmpty#88, count#89] +Keys [3]: [i_brand_id#76, i_class_id#77, i_category_id#78] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#91, count(1)#92] +Results [6]: [i_brand_id#76, i_class_id#77, i_category_id#78, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#91 AS sales#93, count(1)#92 AS number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#91 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#95] + +(96) Filter [codegen id : 51] +Input [6]: [i_brand_id#76, i_class_id#77, i_category_id#78, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#95] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#95) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#95 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#67, [id=#68] as decimal(32,6)))) + +(97) Project [codegen id : 51] +Output [6]: [store AS channel#96, i_brand_id#76, i_class_id#77, i_category_id#78, sales#93, number_sales#94] +Input [6]: [i_brand_id#76, i_class_id#77, i_category_id#78, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#71 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#72 as decimal(12,2)))), DecimalType(18,2), true))#95] + +(98) BroadcastExchange +Input [6]: [channel#96, i_brand_id#76, i_class_id#77, i_category_id#78, sales#93, number_sales#94] +Arguments: HashedRelationBroadcastMode(List(input[1, int, true], input[2, int, true], input[3, int, true]),false), [id=#97] + +(99) BroadcastHashJoin [codegen id : 52] +Left keys [3]: [i_brand_id#46, i_class_id#47, i_category_id#48] +Right keys [3]: [i_brand_id#76, i_class_id#77, i_category_id#78] +Join condition: None + +(100) TakeOrderedAndProject +Input [12]: [channel#69, i_brand_id#46, i_class_id#47, i_category_id#48, sales#64, number_sales#65, channel#96, i_brand_id#76, i_class_id#77, i_category_id#78, sales#93, number_sales#94] +Arguments: 100, [i_brand_id#46 ASC NULLS FIRST, i_class_id#47 ASC NULLS FIRST, i_category_id#48 ASC NULLS FIRST], [channel#69, i_brand_id#46, i_class_id#47, i_category_id#48, sales#64, number_sales#65, channel#96, i_brand_id#76, i_class_id#77, i_category_id#78, sales#93, number_sales#94] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 76 Hosting Expression = Subquery scalar-subquery#67, [id=#68] +* HashAggregate (123) ++- Exchange (122) + +- * HashAggregate (121) + +- Union (120) + :- * Project (109) + : +- * BroadcastHashJoin Inner BuildRight (108) + : :- * ColumnarToRow (102) + : : +- Scan parquet default.store_sales (101) + : +- BroadcastExchange (107) + : +- * Project (106) + : +- * Filter (105) + : +- * ColumnarToRow (104) + : +- Scan parquet default.date_dim (103) + :- * Project (114) + : +- * BroadcastHashJoin Inner BuildRight (113) + : :- * ColumnarToRow (111) + : : +- Scan parquet default.catalog_sales (110) + : +- ReusedExchange (112) + +- * Project (119) + +- * BroadcastHashJoin Inner BuildRight (118) + :- * ColumnarToRow (116) + : +- Scan parquet default.web_sales (115) + +- ReusedExchange (117) + + +(101) Scan parquet default.store_sales +Output [3]: [ss_quantity#98, ss_list_price#99, ss_sold_date_sk#100] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#100), dynamicpruningexpression(ss_sold_date_sk#100 IN dynamicpruning#101)] +ReadSchema: struct + +(102) ColumnarToRow [codegen id : 2] +Input [3]: [ss_quantity#98, ss_list_price#99, ss_sold_date_sk#100] + +(103) Scan parquet default.date_dim +Output [2]: [d_date_sk#102, d_year#103] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1998), LessThanOrEqual(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(104) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#102, d_year#103] + +(105) Filter [codegen id : 1] +Input [2]: [d_date_sk#102, d_year#103] +Condition : (((isnotnull(d_year#103) AND (d_year#103 >= 1998)) AND (d_year#103 <= 2000)) AND isnotnull(d_date_sk#102)) + +(106) Project [codegen id : 1] +Output [1]: [d_date_sk#102] +Input [2]: [d_date_sk#102, d_year#103] + +(107) BroadcastExchange +Input [1]: [d_date_sk#102] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#104] + +(108) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#100] +Right keys [1]: [d_date_sk#102] +Join condition: None + +(109) Project [codegen id : 2] +Output [2]: [ss_quantity#98 AS quantity#105, ss_list_price#99 AS list_price#106] +Input [4]: [ss_quantity#98, ss_list_price#99, ss_sold_date_sk#100, d_date_sk#102] + +(110) Scan parquet default.catalog_sales +Output [3]: [cs_quantity#107, cs_list_price#108, cs_sold_date_sk#109] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#109), dynamicpruningexpression(cs_sold_date_sk#109 IN dynamicpruning#101)] +ReadSchema: struct + +(111) ColumnarToRow [codegen id : 4] +Input [3]: [cs_quantity#107, cs_list_price#108, cs_sold_date_sk#109] + +(112) ReusedExchange [Reuses operator id: 107] +Output [1]: [d_date_sk#110] + +(113) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#109] +Right keys [1]: [d_date_sk#110] +Join condition: None + +(114) Project [codegen id : 4] +Output [2]: [cs_quantity#107 AS quantity#111, cs_list_price#108 AS list_price#112] +Input [4]: [cs_quantity#107, cs_list_price#108, cs_sold_date_sk#109, d_date_sk#110] + +(115) Scan parquet default.web_sales +Output [3]: [ws_quantity#113, ws_list_price#114, ws_sold_date_sk#115] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#115), dynamicpruningexpression(ws_sold_date_sk#115 IN dynamicpruning#101)] +ReadSchema: struct + +(116) ColumnarToRow [codegen id : 6] +Input [3]: [ws_quantity#113, ws_list_price#114, ws_sold_date_sk#115] + +(117) ReusedExchange [Reuses operator id: 107] +Output [1]: [d_date_sk#116] + +(118) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#115] +Right keys [1]: [d_date_sk#116] +Join condition: None + +(119) Project [codegen id : 6] +Output [2]: [ws_quantity#113 AS quantity#117, ws_list_price#114 AS list_price#118] +Input [4]: [ws_quantity#113, ws_list_price#114, ws_sold_date_sk#115, d_date_sk#116] + +(120) Union + +(121) HashAggregate [codegen id : 7] +Input [2]: [quantity#105, list_price#106] +Keys: [] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#105 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#106 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#119, count#120] +Results [2]: [sum#121, count#122] + +(122) Exchange +Input [2]: [sum#121, count#122] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#123] + +(123) HashAggregate [codegen id : 8] +Input [2]: [sum#121, count#122] +Keys: [] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#105 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#106 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#105 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#106 as decimal(12,2)))), DecimalType(18,2), true))#124] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#105 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#106 as decimal(12,2)))), DecimalType(18,2), true))#124 AS average_sales#125] + +Subquery:2 Hosting operator id = 101 Hosting Expression = ss_sold_date_sk#100 IN dynamicpruning#101 +ReusedExchange (124) + + +(124) ReusedExchange [Reuses operator id: 107] +Output [1]: [d_date_sk#102] + +Subquery:3 Hosting operator id = 110 Hosting Expression = cs_sold_date_sk#109 IN dynamicpruning#101 + +Subquery:4 Hosting operator id = 115 Hosting Expression = ws_sold_date_sk#115 IN dynamicpruning#101 + +Subquery:5 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (125) + + +(125) ReusedExchange [Reuses operator id: 70] +Output [1]: [d_date_sk#50] + +Subquery:6 Hosting operator id = 7 Hosting Expression = ss_sold_date_sk#11 IN dynamicpruning#12 +ReusedExchange (126) + + +(126) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#29] + +Subquery:7 Hosting operator id = 13 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#12 + +Subquery:8 Hosting operator id = 40 Hosting Expression = ws_sold_date_sk#35 IN dynamicpruning#12 + +Subquery:9 Hosting operator id = 68 Hosting Expression = Subquery scalar-subquery#52, [id=#53] +* Project (130) ++- * Filter (129) + +- * ColumnarToRow (128) + +- Scan parquet default.date_dim (127) + + +(127) Scan parquet default.date_dim +Output [4]: [d_week_seq#126, d_year#127, d_moy#128, d_dom#129] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1999), EqualTo(d_moy,12), EqualTo(d_dom,16)] +ReadSchema: struct + +(128) ColumnarToRow [codegen id : 1] +Input [4]: [d_week_seq#126, d_year#127, d_moy#128, d_dom#129] + +(129) Filter [codegen id : 1] +Input [4]: [d_week_seq#126, d_year#127, d_moy#128, d_dom#129] +Condition : (((((isnotnull(d_year#127) AND isnotnull(d_moy#128)) AND isnotnull(d_dom#129)) AND (d_year#127 = 1999)) AND (d_moy#128 = 12)) AND (d_dom#129 = 16)) + +(130) Project [codegen id : 1] +Output [1]: [d_week_seq#126] +Input [4]: [d_week_seq#126, d_year#127, d_moy#128, d_dom#129] + +Subquery:10 Hosting operator id = 96 Hosting Expression = ReusedSubquery Subquery scalar-subquery#67, [id=#68] + +Subquery:11 Hosting operator id = 78 Hosting Expression = ss_sold_date_sk#73 IN dynamicpruning#74 +ReusedExchange (131) + + +(131) ReusedExchange [Reuses operator id: 90] +Output [1]: [d_date_sk#79] + +Subquery:12 Hosting operator id = 88 Hosting Expression = Subquery scalar-subquery#81, [id=#82] +* Project (135) ++- * Filter (134) + +- * ColumnarToRow (133) + +- Scan parquet default.date_dim (132) + + +(132) Scan parquet default.date_dim +Output [4]: [d_week_seq#130, d_year#131, d_moy#132, d_dom#133] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), IsNotNull(d_dom), EqualTo(d_year,1998), EqualTo(d_moy,12), EqualTo(d_dom,16)] +ReadSchema: struct + +(133) ColumnarToRow [codegen id : 1] +Input [4]: [d_week_seq#130, d_year#131, d_moy#132, d_dom#133] + +(134) Filter [codegen id : 1] +Input [4]: [d_week_seq#130, d_year#131, d_moy#132, d_dom#133] +Condition : (((((isnotnull(d_year#131) AND isnotnull(d_moy#132)) AND isnotnull(d_dom#133)) AND (d_year#131 = 1998)) AND (d_moy#132 = 12)) AND (d_dom#133 = 16)) + +(135) Project [codegen id : 1] +Output [1]: [d_week_seq#130] +Input [4]: [d_week_seq#130, d_year#131, d_moy#132, d_dom#133] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/simplified.txt new file mode 100644 index 0000000000000..cb9b410ea8568 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14/simplified.txt @@ -0,0 +1,213 @@ +TakeOrderedAndProject [i_brand_id,i_class_id,i_category_id,channel,sales,number_sales,channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] + WholeStageCodegen (52) + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id] + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + Subquery #4 + WholeStageCodegen (8) + HashAggregate [sum,count] [avg(CheckOverflow((promote_precision(cast(cast(quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price as decimal(12,2)))), DecimalType(18,2), true)),average_sales,sum,count] + InputAdapter + Exchange #13 + WholeStageCodegen (7) + HashAggregate [quantity,list_price] [sum,count,sum,count] + InputAdapter + Union + WholeStageCodegen (2) + Project [ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #5 + ReusedExchange [d_date_sk] #14 + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + WholeStageCodegen (4) + Project [cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_quantity,cs_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #5 + InputAdapter + ReusedExchange [d_date_sk] #14 + WholeStageCodegen (6) + Project [ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #5 + InputAdapter + ReusedExchange [d_date_sk] #14 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #1 + WholeStageCodegen (25) + HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_quantity,ss_list_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + BroadcastHashJoin [ss_item_sk,ss_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (11) + Project [i_item_sk] + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id] + Filter [i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (10) + HashAggregate [brand_id,class_id,category_id] + HashAggregate [brand_id,class_id,category_id] + BroadcastHashJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] + HashAggregate [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #5 + WholeStageCodegen (6) + HashAggregate [brand_id,class_id,category_id] + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (4) + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id] + Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (3) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (1) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (9) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #9 + InputAdapter + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (23) + BroadcastHashJoin [i_item_sk,ss_item_sk] + Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + ReusedExchange [ss_item_sk] #12 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (24) + Project [d_date_sk] + Filter [d_week_seq,d_date_sk] + Subquery #3 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (51) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #4 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #16 + WholeStageCodegen (50) + HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_quantity,ss_list_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + BroadcastHashJoin [ss_item_sk,ss_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #6 + ReusedExchange [d_date_sk] #17 + InputAdapter + ReusedExchange [ss_item_sk] #12 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #11 + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (49) + Project [d_date_sk] + Filter [d_week_seq,d_date_sk] + Subquery #7 + WholeStageCodegen (1) + Project [d_week_seq] + Filter [d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_week_seq,d_year,d_moy,d_dom] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/explain.txt new file mode 100644 index 0000000000000..ef5f915e1b17e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/explain.txt @@ -0,0 +1,1432 @@ +== Physical Plan == +TakeOrderedAndProject (213) ++- * HashAggregate (212) + +- Exchange (211) + +- * HashAggregate (210) + +- Union (209) + :- * HashAggregate (132) + : +- Exchange (131) + : +- * HashAggregate (130) + : +- Union (129) + : :- * Project (90) + : : +- * Filter (89) + : : +- * HashAggregate (88) + : : +- Exchange (87) + : : +- * HashAggregate (86) + : : +- * Project (85) + : : +- * BroadcastHashJoin Inner BuildRight (84) + : : :- * Project (74) + : : : +- * BroadcastHashJoin Inner BuildRight (73) + : : : :- * SortMergeJoin LeftSemi (67) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- * Sort (66) + : : : : +- Exchange (65) + : : : : +- * Project (64) + : : : : +- * BroadcastHashJoin Inner BuildRight (63) + : : : : :- * Filter (8) + : : : : : +- * ColumnarToRow (7) + : : : : : +- Scan parquet default.item (6) + : : : : +- BroadcastExchange (62) + : : : : +- * HashAggregate (61) + : : : : +- Exchange (60) + : : : : +- * HashAggregate (59) + : : : : +- * SortMergeJoin LeftSemi (58) + : : : : :- * Sort (46) + : : : : : +- Exchange (45) + : : : : : +- * HashAggregate (44) + : : : : : +- Exchange (43) + : : : : : +- * HashAggregate (42) + : : : : : +- * Project (41) + : : : : : +- * BroadcastHashJoin Inner BuildRight (40) + : : : : : :- * Project (18) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (17) + : : : : : : :- * Filter (11) + : : : : : : : +- * ColumnarToRow (10) + : : : : : : : +- Scan parquet default.store_sales (9) + : : : : : : +- BroadcastExchange (16) + : : : : : : +- * Project (15) + : : : : : : +- * Filter (14) + : : : : : : +- * ColumnarToRow (13) + : : : : : : +- Scan parquet default.date_dim (12) + : : : : : +- BroadcastExchange (39) + : : : : : +- * SortMergeJoin LeftSemi (38) + : : : : : :- * Sort (23) + : : : : : : +- Exchange (22) + : : : : : : +- * Filter (21) + : : : : : : +- * ColumnarToRow (20) + : : : : : : +- Scan parquet default.item (19) + : : : : : +- * Sort (37) + : : : : : +- Exchange (36) + : : : : : +- * Project (35) + : : : : : +- * BroadcastHashJoin Inner BuildRight (34) + : : : : : :- * Project (29) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (28) + : : : : : : :- * Filter (26) + : : : : : : : +- * ColumnarToRow (25) + : : : : : : : +- Scan parquet default.catalog_sales (24) + : : : : : : +- ReusedExchange (27) + : : : : : +- BroadcastExchange (33) + : : : : : +- * Filter (32) + : : : : : +- * ColumnarToRow (31) + : : : : : +- Scan parquet default.item (30) + : : : : +- * Sort (57) + : : : : +- Exchange (56) + : : : : +- * Project (55) + : : : : +- * BroadcastHashJoin Inner BuildRight (54) + : : : : :- * Project (52) + : : : : : +- * BroadcastHashJoin Inner BuildRight (51) + : : : : : :- * Filter (49) + : : : : : : +- * ColumnarToRow (48) + : : : : : : +- Scan parquet default.web_sales (47) + : : : : : +- ReusedExchange (50) + : : : : +- ReusedExchange (53) + : : : +- BroadcastExchange (72) + : : : +- * Project (71) + : : : +- * Filter (70) + : : : +- * ColumnarToRow (69) + : : : +- Scan parquet default.date_dim (68) + : : +- BroadcastExchange (83) + : : +- * SortMergeJoin LeftSemi (82) + : : :- * Sort (79) + : : : +- Exchange (78) + : : : +- * Filter (77) + : : : +- * ColumnarToRow (76) + : : : +- Scan parquet default.item (75) + : : +- * Sort (81) + : : +- ReusedExchange (80) + : :- * Project (109) + : : +- * Filter (108) + : : +- * HashAggregate (107) + : : +- Exchange (106) + : : +- * HashAggregate (105) + : : +- * Project (104) + : : +- * BroadcastHashJoin Inner BuildRight (103) + : : :- * Project (101) + : : : +- * BroadcastHashJoin Inner BuildRight (100) + : : : :- * SortMergeJoin LeftSemi (98) + : : : : :- * Sort (95) + : : : : : +- Exchange (94) + : : : : : +- * Filter (93) + : : : : : +- * ColumnarToRow (92) + : : : : : +- Scan parquet default.catalog_sales (91) + : : : : +- * Sort (97) + : : : : +- ReusedExchange (96) + : : : +- ReusedExchange (99) + : : +- ReusedExchange (102) + : +- * Project (128) + : +- * Filter (127) + : +- * HashAggregate (126) + : +- Exchange (125) + : +- * HashAggregate (124) + : +- * Project (123) + : +- * BroadcastHashJoin Inner BuildRight (122) + : :- * Project (120) + : : +- * BroadcastHashJoin Inner BuildRight (119) + : : :- * SortMergeJoin LeftSemi (117) + : : : :- * Sort (114) + : : : : +- Exchange (113) + : : : : +- * Filter (112) + : : : : +- * ColumnarToRow (111) + : : : : +- Scan parquet default.web_sales (110) + : : : +- * Sort (116) + : : : +- ReusedExchange (115) + : : +- ReusedExchange (118) + : +- ReusedExchange (121) + :- * HashAggregate (151) + : +- Exchange (150) + : +- * HashAggregate (149) + : +- * HashAggregate (148) + : +- Exchange (147) + : +- * HashAggregate (146) + : +- Union (145) + : :- * Project (136) + : : +- * Filter (135) + : : +- * HashAggregate (134) + : : +- ReusedExchange (133) + : :- * Project (140) + : : +- * Filter (139) + : : +- * HashAggregate (138) + : : +- ReusedExchange (137) + : +- * Project (144) + : +- * Filter (143) + : +- * HashAggregate (142) + : +- ReusedExchange (141) + :- * HashAggregate (170) + : +- Exchange (169) + : +- * HashAggregate (168) + : +- * HashAggregate (167) + : +- Exchange (166) + : +- * HashAggregate (165) + : +- Union (164) + : :- * Project (155) + : : +- * Filter (154) + : : +- * HashAggregate (153) + : : +- ReusedExchange (152) + : :- * Project (159) + : : +- * Filter (158) + : : +- * HashAggregate (157) + : : +- ReusedExchange (156) + : +- * Project (163) + : +- * Filter (162) + : +- * HashAggregate (161) + : +- ReusedExchange (160) + :- * HashAggregate (189) + : +- Exchange (188) + : +- * HashAggregate (187) + : +- * HashAggregate (186) + : +- Exchange (185) + : +- * HashAggregate (184) + : +- Union (183) + : :- * Project (174) + : : +- * Filter (173) + : : +- * HashAggregate (172) + : : +- ReusedExchange (171) + : :- * Project (178) + : : +- * Filter (177) + : : +- * HashAggregate (176) + : : +- ReusedExchange (175) + : +- * Project (182) + : +- * Filter (181) + : +- * HashAggregate (180) + : +- ReusedExchange (179) + +- * HashAggregate (208) + +- Exchange (207) + +- * HashAggregate (206) + +- * HashAggregate (205) + +- Exchange (204) + +- * HashAggregate (203) + +- Union (202) + :- * Project (193) + : +- * Filter (192) + : +- * HashAggregate (191) + : +- ReusedExchange (190) + :- * Project (197) + : +- * Filter (196) + : +- * HashAggregate (195) + : +- ReusedExchange (194) + +- * Project (201) + +- * Filter (200) + +- * HashAggregate (199) + +- ReusedExchange (198) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 1] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_item_sk#1) + +(4) Exchange +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#6] + +(5) Sort [codegen id : 2] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.item +Output [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 20] +Input [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10] + +(8) Filter [codegen id : 20] +Input [4]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10] +Condition : ((isnotnull(i_brand_id#8) AND isnotnull(i_class_id#9)) AND isnotnull(i_category_id#10)) + +(9) Scan parquet default.store_sales +Output [2]: [ss_item_sk#11, ss_sold_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#12), dynamicpruningexpression(ss_sold_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(10) ColumnarToRow [codegen id : 11] +Input [2]: [ss_item_sk#11, ss_sold_date_sk#12] + +(11) Filter [codegen id : 11] +Input [2]: [ss_item_sk#11, ss_sold_date_sk#12] +Condition : isnotnull(ss_item_sk#11) + +(12) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#14, d_year#15] + +(14) Filter [codegen id : 3] +Input [2]: [d_date_sk#14, d_year#15] +Condition : (((isnotnull(d_year#15) AND (d_year#15 >= 1999)) AND (d_year#15 <= 2001)) AND isnotnull(d_date_sk#14)) + +(15) Project [codegen id : 3] +Output [1]: [d_date_sk#14] +Input [2]: [d_date_sk#14, d_year#15] + +(16) BroadcastExchange +Input [1]: [d_date_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(17) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_sold_date_sk#12] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(18) Project [codegen id : 11] +Output [1]: [ss_item_sk#11] +Input [3]: [ss_item_sk#11, ss_sold_date_sk#12, d_date_sk#14] + +(19) Scan parquet default.item +Output [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 4] +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] + +(21) Filter [codegen id : 4] +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Condition : (((isnotnull(i_item_sk#17) AND isnotnull(i_brand_id#18)) AND isnotnull(i_class_id#19)) AND isnotnull(i_category_id#20)) + +(22) Exchange +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Arguments: hashpartitioning(coalesce(i_brand_id#18, 0), isnull(i_brand_id#18), coalesce(i_class_id#19, 0), isnull(i_class_id#19), coalesce(i_category_id#20, 0), isnull(i_category_id#20), 5), ENSURE_REQUIREMENTS, [id=#21] + +(23) Sort [codegen id : 5] +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Arguments: [coalesce(i_brand_id#18, 0) ASC NULLS FIRST, isnull(i_brand_id#18) ASC NULLS FIRST, coalesce(i_class_id#19, 0) ASC NULLS FIRST, isnull(i_class_id#19) ASC NULLS FIRST, coalesce(i_category_id#20, 0) ASC NULLS FIRST, isnull(i_category_id#20) ASC NULLS FIRST], false, 0 + +(24) Scan parquet default.catalog_sales +Output [2]: [cs_item_sk#22, cs_sold_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#23), dynamicpruningexpression(cs_sold_date_sk#23 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 8] +Input [2]: [cs_item_sk#22, cs_sold_date_sk#23] + +(26) Filter [codegen id : 8] +Input [2]: [cs_item_sk#22, cs_sold_date_sk#23] +Condition : isnotnull(cs_item_sk#22) + +(27) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#24] + +(28) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_sold_date_sk#23] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(29) Project [codegen id : 8] +Output [1]: [cs_item_sk#22] +Input [3]: [cs_item_sk#22, cs_sold_date_sk#23, d_date_sk#24] + +(30) Scan parquet default.item +Output [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 7] +Input [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] + +(32) Filter [codegen id : 7] +Input [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] +Condition : isnotnull(i_item_sk#25) + +(33) BroadcastExchange +Input [4]: [i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(34) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [cs_item_sk#22] +Right keys [1]: [i_item_sk#25] +Join condition: None + +(35) Project [codegen id : 8] +Output [3]: [i_brand_id#26, i_class_id#27, i_category_id#28] +Input [5]: [cs_item_sk#22, i_item_sk#25, i_brand_id#26, i_class_id#27, i_category_id#28] + +(36) Exchange +Input [3]: [i_brand_id#26, i_class_id#27, i_category_id#28] +Arguments: hashpartitioning(coalesce(i_brand_id#26, 0), isnull(i_brand_id#26), coalesce(i_class_id#27, 0), isnull(i_class_id#27), coalesce(i_category_id#28, 0), isnull(i_category_id#28), 5), ENSURE_REQUIREMENTS, [id=#30] + +(37) Sort [codegen id : 9] +Input [3]: [i_brand_id#26, i_class_id#27, i_category_id#28] +Arguments: [coalesce(i_brand_id#26, 0) ASC NULLS FIRST, isnull(i_brand_id#26) ASC NULLS FIRST, coalesce(i_class_id#27, 0) ASC NULLS FIRST, isnull(i_class_id#27) ASC NULLS FIRST, coalesce(i_category_id#28, 0) ASC NULLS FIRST, isnull(i_category_id#28) ASC NULLS FIRST], false, 0 + +(38) SortMergeJoin [codegen id : 10] +Left keys [6]: [coalesce(i_brand_id#18, 0), isnull(i_brand_id#18), coalesce(i_class_id#19, 0), isnull(i_class_id#19), coalesce(i_category_id#20, 0), isnull(i_category_id#20)] +Right keys [6]: [coalesce(i_brand_id#26, 0), isnull(i_brand_id#26), coalesce(i_class_id#27, 0), isnull(i_class_id#27), coalesce(i_category_id#28, 0), isnull(i_category_id#28)] +Join condition: None + +(39) BroadcastExchange +Input [4]: [i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_item_sk#11] +Right keys [1]: [i_item_sk#17] +Join condition: None + +(41) Project [codegen id : 11] +Output [3]: [i_brand_id#18 AS brand_id#32, i_class_id#19 AS class_id#33, i_category_id#20 AS category_id#34] +Input [5]: [ss_item_sk#11, i_item_sk#17, i_brand_id#18, i_class_id#19, i_category_id#20] + +(42) HashAggregate [codegen id : 11] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(43) Exchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: hashpartitioning(brand_id#32, class_id#33, category_id#34, 5), ENSURE_REQUIREMENTS, [id=#35] + +(44) HashAggregate [codegen id : 12] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(45) Exchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: hashpartitioning(coalesce(brand_id#32, 0), isnull(brand_id#32), coalesce(class_id#33, 0), isnull(class_id#33), coalesce(category_id#34, 0), isnull(category_id#34), 5), ENSURE_REQUIREMENTS, [id=#36] + +(46) Sort [codegen id : 13] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: [coalesce(brand_id#32, 0) ASC NULLS FIRST, isnull(brand_id#32) ASC NULLS FIRST, coalesce(class_id#33, 0) ASC NULLS FIRST, isnull(class_id#33) ASC NULLS FIRST, coalesce(category_id#34, 0) ASC NULLS FIRST, isnull(category_id#34) ASC NULLS FIRST], false, 0 + +(47) Scan parquet default.web_sales +Output [2]: [ws_item_sk#37, ws_sold_date_sk#38] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#38), dynamicpruningexpression(ws_sold_date_sk#38 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 16] +Input [2]: [ws_item_sk#37, ws_sold_date_sk#38] + +(49) Filter [codegen id : 16] +Input [2]: [ws_item_sk#37, ws_sold_date_sk#38] +Condition : isnotnull(ws_item_sk#37) + +(50) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#39] + +(51) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [ws_sold_date_sk#38] +Right keys [1]: [d_date_sk#39] +Join condition: None + +(52) Project [codegen id : 16] +Output [1]: [ws_item_sk#37] +Input [3]: [ws_item_sk#37, ws_sold_date_sk#38, d_date_sk#39] + +(53) ReusedExchange [Reuses operator id: 33] +Output [4]: [i_item_sk#40, i_brand_id#41, i_class_id#42, i_category_id#43] + +(54) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [ws_item_sk#37] +Right keys [1]: [i_item_sk#40] +Join condition: None + +(55) Project [codegen id : 16] +Output [3]: [i_brand_id#41, i_class_id#42, i_category_id#43] +Input [5]: [ws_item_sk#37, i_item_sk#40, i_brand_id#41, i_class_id#42, i_category_id#43] + +(56) Exchange +Input [3]: [i_brand_id#41, i_class_id#42, i_category_id#43] +Arguments: hashpartitioning(coalesce(i_brand_id#41, 0), isnull(i_brand_id#41), coalesce(i_class_id#42, 0), isnull(i_class_id#42), coalesce(i_category_id#43, 0), isnull(i_category_id#43), 5), ENSURE_REQUIREMENTS, [id=#44] + +(57) Sort [codegen id : 17] +Input [3]: [i_brand_id#41, i_class_id#42, i_category_id#43] +Arguments: [coalesce(i_brand_id#41, 0) ASC NULLS FIRST, isnull(i_brand_id#41) ASC NULLS FIRST, coalesce(i_class_id#42, 0) ASC NULLS FIRST, isnull(i_class_id#42) ASC NULLS FIRST, coalesce(i_category_id#43, 0) ASC NULLS FIRST, isnull(i_category_id#43) ASC NULLS FIRST], false, 0 + +(58) SortMergeJoin [codegen id : 18] +Left keys [6]: [coalesce(brand_id#32, 0), isnull(brand_id#32), coalesce(class_id#33, 0), isnull(class_id#33), coalesce(category_id#34, 0), isnull(category_id#34)] +Right keys [6]: [coalesce(i_brand_id#41, 0), isnull(i_brand_id#41), coalesce(i_class_id#42, 0), isnull(i_class_id#42), coalesce(i_category_id#43, 0), isnull(i_category_id#43)] +Join condition: None + +(59) HashAggregate [codegen id : 18] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(60) Exchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: hashpartitioning(brand_id#32, class_id#33, category_id#34, 5), ENSURE_REQUIREMENTS, [id=#45] + +(61) HashAggregate [codegen id : 19] +Input [3]: [brand_id#32, class_id#33, category_id#34] +Keys [3]: [brand_id#32, class_id#33, category_id#34] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#32, class_id#33, category_id#34] + +(62) BroadcastExchange +Input [3]: [brand_id#32, class_id#33, category_id#34] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#46] + +(63) BroadcastHashJoin [codegen id : 20] +Left keys [3]: [i_brand_id#8, i_class_id#9, i_category_id#10] +Right keys [3]: [brand_id#32, class_id#33, category_id#34] +Join condition: None + +(64) Project [codegen id : 20] +Output [1]: [i_item_sk#7 AS ss_item_sk#47] +Input [7]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, brand_id#32, class_id#33, category_id#34] + +(65) Exchange +Input [1]: [ss_item_sk#47] +Arguments: hashpartitioning(ss_item_sk#47, 5), ENSURE_REQUIREMENTS, [id=#48] + +(66) Sort [codegen id : 21] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(67) SortMergeJoin [codegen id : 45] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(68) Scan parquet default.date_dim +Output [3]: [d_date_sk#49, d_year#50, d_moy#51] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct + +(69) ColumnarToRow [codegen id : 22] +Input [3]: [d_date_sk#49, d_year#50, d_moy#51] + +(70) Filter [codegen id : 22] +Input [3]: [d_date_sk#49, d_year#50, d_moy#51] +Condition : ((((isnotnull(d_year#50) AND isnotnull(d_moy#51)) AND (d_year#50 = 2000)) AND (d_moy#51 = 11)) AND isnotnull(d_date_sk#49)) + +(71) Project [codegen id : 22] +Output [1]: [d_date_sk#49] +Input [3]: [d_date_sk#49, d_year#50, d_moy#51] + +(72) BroadcastExchange +Input [1]: [d_date_sk#49] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#52] + +(73) BroadcastHashJoin [codegen id : 45] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#49] +Join condition: None + +(74) Project [codegen id : 45] +Output [3]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3] +Input [5]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, d_date_sk#49] + +(75) Scan parquet default.item +Output [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 23] +Input [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] + +(77) Filter [codegen id : 23] +Input [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] +Condition : isnotnull(i_item_sk#53) + +(78) Exchange +Input [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] +Arguments: hashpartitioning(i_item_sk#53, 5), ENSURE_REQUIREMENTS, [id=#57] + +(79) Sort [codegen id : 24] +Input [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] +Arguments: [i_item_sk#53 ASC NULLS FIRST], false, 0 + +(80) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#47] + +(81) Sort [codegen id : 43] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(82) SortMergeJoin [codegen id : 44] +Left keys [1]: [i_item_sk#53] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(83) BroadcastExchange +Input [4]: [i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#58] + +(84) BroadcastHashJoin [codegen id : 45] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#53] +Join condition: None + +(85) Project [codegen id : 45] +Output [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#54, i_class_id#55, i_category_id#56] +Input [7]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, i_item_sk#53, i_brand_id#54, i_class_id#55, i_category_id#56] + +(86) HashAggregate [codegen id : 45] +Input [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#54, i_class_id#55, i_category_id#56] +Keys [3]: [i_brand_id#54, i_class_id#55, i_category_id#56] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#59, isEmpty#60, count#61] +Results [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum#62, isEmpty#63, count#64] + +(87) Exchange +Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum#62, isEmpty#63, count#64] +Arguments: hashpartitioning(i_brand_id#54, i_class_id#55, i_category_id#56, 5), ENSURE_REQUIREMENTS, [id=#65] + +(88) HashAggregate [codegen id : 46] +Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum#62, isEmpty#63, count#64] +Keys [3]: [i_brand_id#54, i_class_id#55, i_category_id#56] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66, count(1)#67] +Results [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66 AS sales#68, count(1)#67 AS number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#66 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#70] + +(89) Filter [codegen id : 46] +Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sales#68, number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#70] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#70) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#70 as decimal(32,6)) > cast(Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(90) Project [codegen id : 46] +Output [6]: [store AS channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sales#68, number_sales#69] +Input [6]: [i_brand_id#54, i_class_id#55, i_category_id#56, sales#68, number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#70] + +(91) Scan parquet default.catalog_sales +Output [4]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, cs_sold_date_sk#77] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#77), dynamicpruningexpression(cs_sold_date_sk#77 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(92) ColumnarToRow [codegen id : 47] +Input [4]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, cs_sold_date_sk#77] + +(93) Filter [codegen id : 47] +Input [4]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, cs_sold_date_sk#77] +Condition : isnotnull(cs_item_sk#74) + +(94) Exchange +Input [4]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, cs_sold_date_sk#77] +Arguments: hashpartitioning(cs_item_sk#74, 5), ENSURE_REQUIREMENTS, [id=#78] + +(95) Sort [codegen id : 48] +Input [4]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, cs_sold_date_sk#77] +Arguments: [cs_item_sk#74 ASC NULLS FIRST], false, 0 + +(96) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#47] + +(97) Sort [codegen id : 67] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(98) SortMergeJoin [codegen id : 91] +Left keys [1]: [cs_item_sk#74] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(99) ReusedExchange [Reuses operator id: 72] +Output [1]: [d_date_sk#79] + +(100) BroadcastHashJoin [codegen id : 91] +Left keys [1]: [cs_sold_date_sk#77] +Right keys [1]: [d_date_sk#79] +Join condition: None + +(101) Project [codegen id : 91] +Output [3]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76] +Input [5]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, cs_sold_date_sk#77, d_date_sk#79] + +(102) ReusedExchange [Reuses operator id: 83] +Output [4]: [i_item_sk#80, i_brand_id#81, i_class_id#82, i_category_id#83] + +(103) BroadcastHashJoin [codegen id : 91] +Left keys [1]: [cs_item_sk#74] +Right keys [1]: [i_item_sk#80] +Join condition: None + +(104) Project [codegen id : 91] +Output [5]: [cs_quantity#75, cs_list_price#76, i_brand_id#81, i_class_id#82, i_category_id#83] +Input [7]: [cs_item_sk#74, cs_quantity#75, cs_list_price#76, i_item_sk#80, i_brand_id#81, i_class_id#82, i_category_id#83] + +(105) HashAggregate [codegen id : 91] +Input [5]: [cs_quantity#75, cs_list_price#76, i_brand_id#81, i_class_id#82, i_category_id#83] +Keys [3]: [i_brand_id#81, i_class_id#82, i_category_id#83] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#84, isEmpty#85, count#86] +Results [6]: [i_brand_id#81, i_class_id#82, i_category_id#83, sum#87, isEmpty#88, count#89] + +(106) Exchange +Input [6]: [i_brand_id#81, i_class_id#82, i_category_id#83, sum#87, isEmpty#88, count#89] +Arguments: hashpartitioning(i_brand_id#81, i_class_id#82, i_category_id#83, 5), ENSURE_REQUIREMENTS, [id=#90] + +(107) HashAggregate [codegen id : 92] +Input [6]: [i_brand_id#81, i_class_id#82, i_category_id#83, sum#87, isEmpty#88, count#89] +Keys [3]: [i_brand_id#81, i_class_id#82, i_category_id#83] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#91, count(1)#92] +Results [6]: [i_brand_id#81, i_class_id#82, i_category_id#83, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#91 AS sales#93, count(1)#92 AS number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#91 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#95] + +(108) Filter [codegen id : 92] +Input [6]: [i_brand_id#81, i_class_id#82, i_category_id#83, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#95] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#95) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#95 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(109) Project [codegen id : 92] +Output [6]: [catalog AS channel#96, i_brand_id#81, i_class_id#82, i_category_id#83, sales#93, number_sales#94] +Input [6]: [i_brand_id#81, i_class_id#82, i_category_id#83, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#75 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#76 as decimal(12,2)))), DecimalType(18,2), true))#95] + +(110) Scan parquet default.web_sales +Output [4]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, ws_sold_date_sk#100] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#100), dynamicpruningexpression(ws_sold_date_sk#100 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(111) ColumnarToRow [codegen id : 93] +Input [4]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, ws_sold_date_sk#100] + +(112) Filter [codegen id : 93] +Input [4]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, ws_sold_date_sk#100] +Condition : isnotnull(ws_item_sk#97) + +(113) Exchange +Input [4]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, ws_sold_date_sk#100] +Arguments: hashpartitioning(ws_item_sk#97, 5), ENSURE_REQUIREMENTS, [id=#101] + +(114) Sort [codegen id : 94] +Input [4]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, ws_sold_date_sk#100] +Arguments: [ws_item_sk#97 ASC NULLS FIRST], false, 0 + +(115) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#47] + +(116) Sort [codegen id : 113] +Input [1]: [ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST], false, 0 + +(117) SortMergeJoin [codegen id : 137] +Left keys [1]: [ws_item_sk#97] +Right keys [1]: [ss_item_sk#47] +Join condition: None + +(118) ReusedExchange [Reuses operator id: 72] +Output [1]: [d_date_sk#102] + +(119) BroadcastHashJoin [codegen id : 137] +Left keys [1]: [ws_sold_date_sk#100] +Right keys [1]: [d_date_sk#102] +Join condition: None + +(120) Project [codegen id : 137] +Output [3]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99] +Input [5]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, ws_sold_date_sk#100, d_date_sk#102] + +(121) ReusedExchange [Reuses operator id: 83] +Output [4]: [i_item_sk#103, i_brand_id#104, i_class_id#105, i_category_id#106] + +(122) BroadcastHashJoin [codegen id : 137] +Left keys [1]: [ws_item_sk#97] +Right keys [1]: [i_item_sk#103] +Join condition: None + +(123) Project [codegen id : 137] +Output [5]: [ws_quantity#98, ws_list_price#99, i_brand_id#104, i_class_id#105, i_category_id#106] +Input [7]: [ws_item_sk#97, ws_quantity#98, ws_list_price#99, i_item_sk#103, i_brand_id#104, i_class_id#105, i_category_id#106] + +(124) HashAggregate [codegen id : 137] +Input [5]: [ws_quantity#98, ws_list_price#99, i_brand_id#104, i_class_id#105, i_category_id#106] +Keys [3]: [i_brand_id#104, i_class_id#105, i_category_id#106] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#107, isEmpty#108, count#109] +Results [6]: [i_brand_id#104, i_class_id#105, i_category_id#106, sum#110, isEmpty#111, count#112] + +(125) Exchange +Input [6]: [i_brand_id#104, i_class_id#105, i_category_id#106, sum#110, isEmpty#111, count#112] +Arguments: hashpartitioning(i_brand_id#104, i_class_id#105, i_category_id#106, 5), ENSURE_REQUIREMENTS, [id=#113] + +(126) HashAggregate [codegen id : 138] +Input [6]: [i_brand_id#104, i_class_id#105, i_category_id#106, sum#110, isEmpty#111, count#112] +Keys [3]: [i_brand_id#104, i_class_id#105, i_category_id#106] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#114, count(1)#115] +Results [6]: [i_brand_id#104, i_class_id#105, i_category_id#106, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#114 AS sales#116, count(1)#115 AS number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#114 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#118] + +(127) Filter [codegen id : 138] +Input [6]: [i_brand_id#104, i_class_id#105, i_category_id#106, sales#116, number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#118] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#118) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#118 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(128) Project [codegen id : 138] +Output [6]: [web AS channel#119, i_brand_id#104, i_class_id#105, i_category_id#106, sales#116, number_sales#117] +Input [6]: [i_brand_id#104, i_class_id#105, i_category_id#106, sales#116, number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#98 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#99 as decimal(12,2)))), DecimalType(18,2), true))#118] + +(129) Union + +(130) HashAggregate [codegen id : 139] +Input [6]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sales#68, number_sales#69] +Keys [4]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56] +Functions [2]: [partial_sum(sales#68), partial_sum(number_sales#69)] +Aggregate Attributes [3]: [sum#120, isEmpty#121, sum#122] +Results [7]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum#123, isEmpty#124, sum#125] + +(131) Exchange +Input [7]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum#123, isEmpty#124, sum#125] +Arguments: hashpartitioning(channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, 5), ENSURE_REQUIREMENTS, [id=#126] + +(132) HashAggregate [codegen id : 140] +Input [7]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum#123, isEmpty#124, sum#125] +Keys [4]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56] +Functions [2]: [sum(sales#68), sum(number_sales#69)] +Aggregate Attributes [2]: [sum(sales#68)#127, sum(number_sales#69)#128] +Results [6]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum(sales#68)#127 AS sum_sales#129, sum(number_sales#69)#128 AS number_sales#130] + +(133) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#131, i_class_id#132, i_category_id#133, sum#134, isEmpty#135, count#136] + +(134) HashAggregate [codegen id : 186] +Input [6]: [i_brand_id#131, i_class_id#132, i_category_id#133, sum#134, isEmpty#135, count#136] +Keys [3]: [i_brand_id#131, i_class_id#132, i_category_id#133] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#137 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#138 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#137 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#138 as decimal(12,2)))), DecimalType(18,2), true))#139, count(1)#140] +Results [6]: [i_brand_id#131, i_class_id#132, i_category_id#133, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#137 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#138 as decimal(12,2)))), DecimalType(18,2), true))#139 AS sales#68, count(1)#140 AS number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#137 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#138 as decimal(12,2)))), DecimalType(18,2), true))#139 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#137 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#138 as decimal(12,2)))), DecimalType(18,2), true))#141] + +(135) Filter [codegen id : 186] +Input [6]: [i_brand_id#131, i_class_id#132, i_category_id#133, sales#68, number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#137 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#138 as decimal(12,2)))), DecimalType(18,2), true))#141] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#137 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#138 as decimal(12,2)))), DecimalType(18,2), true))#141) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#137 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#138 as decimal(12,2)))), DecimalType(18,2), true))#141 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(136) Project [codegen id : 186] +Output [6]: [store AS channel#73, i_brand_id#131, i_class_id#132, i_category_id#133, sales#68, number_sales#69] +Input [6]: [i_brand_id#131, i_class_id#132, i_category_id#133, sales#68, number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#137 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#138 as decimal(12,2)))), DecimalType(18,2), true))#141] + +(137) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#142, i_class_id#143, i_category_id#144, sum#145, isEmpty#146, count#147] + +(138) HashAggregate [codegen id : 232] +Input [6]: [i_brand_id#142, i_class_id#143, i_category_id#144, sum#145, isEmpty#146, count#147] +Keys [3]: [i_brand_id#142, i_class_id#143, i_category_id#144] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#148 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#149 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#148 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#149 as decimal(12,2)))), DecimalType(18,2), true))#150, count(1)#151] +Results [6]: [i_brand_id#142, i_class_id#143, i_category_id#144, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#148 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#149 as decimal(12,2)))), DecimalType(18,2), true))#150 AS sales#93, count(1)#151 AS number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#148 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#149 as decimal(12,2)))), DecimalType(18,2), true))#150 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#148 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#149 as decimal(12,2)))), DecimalType(18,2), true))#152] + +(139) Filter [codegen id : 232] +Input [6]: [i_brand_id#142, i_class_id#143, i_category_id#144, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#148 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#149 as decimal(12,2)))), DecimalType(18,2), true))#152] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#148 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#149 as decimal(12,2)))), DecimalType(18,2), true))#152) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#148 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#149 as decimal(12,2)))), DecimalType(18,2), true))#152 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(140) Project [codegen id : 232] +Output [6]: [catalog AS channel#96, i_brand_id#142, i_class_id#143, i_category_id#144, sales#93, number_sales#94] +Input [6]: [i_brand_id#142, i_class_id#143, i_category_id#144, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#148 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#149 as decimal(12,2)))), DecimalType(18,2), true))#152] + +(141) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#153, i_class_id#154, i_category_id#155, sum#156, isEmpty#157, count#158] + +(142) HashAggregate [codegen id : 278] +Input [6]: [i_brand_id#153, i_class_id#154, i_category_id#155, sum#156, isEmpty#157, count#158] +Keys [3]: [i_brand_id#153, i_class_id#154, i_category_id#155] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#159 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#160 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#159 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#160 as decimal(12,2)))), DecimalType(18,2), true))#161, count(1)#162] +Results [6]: [i_brand_id#153, i_class_id#154, i_category_id#155, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#159 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#160 as decimal(12,2)))), DecimalType(18,2), true))#161 AS sales#116, count(1)#162 AS number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#159 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#160 as decimal(12,2)))), DecimalType(18,2), true))#161 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#159 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#160 as decimal(12,2)))), DecimalType(18,2), true))#163] + +(143) Filter [codegen id : 278] +Input [6]: [i_brand_id#153, i_class_id#154, i_category_id#155, sales#116, number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#159 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#160 as decimal(12,2)))), DecimalType(18,2), true))#163] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#159 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#160 as decimal(12,2)))), DecimalType(18,2), true))#163) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#159 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#160 as decimal(12,2)))), DecimalType(18,2), true))#163 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(144) Project [codegen id : 278] +Output [6]: [web AS channel#119, i_brand_id#153, i_class_id#154, i_category_id#155, sales#116, number_sales#117] +Input [6]: [i_brand_id#153, i_class_id#154, i_category_id#155, sales#116, number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#159 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#160 as decimal(12,2)))), DecimalType(18,2), true))#163] + +(145) Union + +(146) HashAggregate [codegen id : 279] +Input [6]: [channel#73, i_brand_id#131, i_class_id#132, i_category_id#133, sales#68, number_sales#69] +Keys [4]: [channel#73, i_brand_id#131, i_class_id#132, i_category_id#133] +Functions [2]: [partial_sum(sales#68), partial_sum(number_sales#69)] +Aggregate Attributes [3]: [sum#164, isEmpty#165, sum#166] +Results [7]: [channel#73, i_brand_id#131, i_class_id#132, i_category_id#133, sum#167, isEmpty#168, sum#169] + +(147) Exchange +Input [7]: [channel#73, i_brand_id#131, i_class_id#132, i_category_id#133, sum#167, isEmpty#168, sum#169] +Arguments: hashpartitioning(channel#73, i_brand_id#131, i_class_id#132, i_category_id#133, 5), ENSURE_REQUIREMENTS, [id=#170] + +(148) HashAggregate [codegen id : 280] +Input [7]: [channel#73, i_brand_id#131, i_class_id#132, i_category_id#133, sum#167, isEmpty#168, sum#169] +Keys [4]: [channel#73, i_brand_id#131, i_class_id#132, i_category_id#133] +Functions [2]: [sum(sales#68), sum(number_sales#69)] +Aggregate Attributes [2]: [sum(sales#68)#171, sum(number_sales#69)#172] +Results [5]: [channel#73, i_brand_id#131, i_class_id#132, sum(sales#68)#171 AS sum_sales#129, sum(number_sales#69)#172 AS number_sales#130] + +(149) HashAggregate [codegen id : 280] +Input [5]: [channel#73, i_brand_id#131, i_class_id#132, sum_sales#129, number_sales#130] +Keys [3]: [channel#73, i_brand_id#131, i_class_id#132] +Functions [2]: [partial_sum(sum_sales#129), partial_sum(number_sales#130)] +Aggregate Attributes [3]: [sum#173, isEmpty#174, sum#175] +Results [6]: [channel#73, i_brand_id#131, i_class_id#132, sum#176, isEmpty#177, sum#178] + +(150) Exchange +Input [6]: [channel#73, i_brand_id#131, i_class_id#132, sum#176, isEmpty#177, sum#178] +Arguments: hashpartitioning(channel#73, i_brand_id#131, i_class_id#132, 5), ENSURE_REQUIREMENTS, [id=#179] + +(151) HashAggregate [codegen id : 281] +Input [6]: [channel#73, i_brand_id#131, i_class_id#132, sum#176, isEmpty#177, sum#178] +Keys [3]: [channel#73, i_brand_id#131, i_class_id#132] +Functions [2]: [sum(sum_sales#129), sum(number_sales#130)] +Aggregate Attributes [2]: [sum(sum_sales#129)#180, sum(number_sales#130)#181] +Results [6]: [channel#73, i_brand_id#131, i_class_id#132, null AS i_category_id#182, sum(sum_sales#129)#180 AS sum(sum_sales)#183, sum(number_sales#130)#181 AS sum(number_sales)#184] + +(152) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#185, i_class_id#186, i_category_id#187, sum#188, isEmpty#189, count#190] + +(153) HashAggregate [codegen id : 327] +Input [6]: [i_brand_id#185, i_class_id#186, i_category_id#187, sum#188, isEmpty#189, count#190] +Keys [3]: [i_brand_id#185, i_class_id#186, i_category_id#187] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#191 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#192 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#191 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#192 as decimal(12,2)))), DecimalType(18,2), true))#193, count(1)#194] +Results [6]: [i_brand_id#185, i_class_id#186, i_category_id#187, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#191 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#192 as decimal(12,2)))), DecimalType(18,2), true))#193 AS sales#68, count(1)#194 AS number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#191 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#192 as decimal(12,2)))), DecimalType(18,2), true))#193 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#191 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#192 as decimal(12,2)))), DecimalType(18,2), true))#195] + +(154) Filter [codegen id : 327] +Input [6]: [i_brand_id#185, i_class_id#186, i_category_id#187, sales#68, number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#191 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#192 as decimal(12,2)))), DecimalType(18,2), true))#195] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#191 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#192 as decimal(12,2)))), DecimalType(18,2), true))#195) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#191 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#192 as decimal(12,2)))), DecimalType(18,2), true))#195 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(155) Project [codegen id : 327] +Output [6]: [store AS channel#73, i_brand_id#185, i_class_id#186, i_category_id#187, sales#68, number_sales#69] +Input [6]: [i_brand_id#185, i_class_id#186, i_category_id#187, sales#68, number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#191 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#192 as decimal(12,2)))), DecimalType(18,2), true))#195] + +(156) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#196, i_class_id#197, i_category_id#198, sum#199, isEmpty#200, count#201] + +(157) HashAggregate [codegen id : 373] +Input [6]: [i_brand_id#196, i_class_id#197, i_category_id#198, sum#199, isEmpty#200, count#201] +Keys [3]: [i_brand_id#196, i_class_id#197, i_category_id#198] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#202 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#203 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#202 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#203 as decimal(12,2)))), DecimalType(18,2), true))#204, count(1)#205] +Results [6]: [i_brand_id#196, i_class_id#197, i_category_id#198, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#202 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#203 as decimal(12,2)))), DecimalType(18,2), true))#204 AS sales#93, count(1)#205 AS number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#202 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#203 as decimal(12,2)))), DecimalType(18,2), true))#204 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#202 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#203 as decimal(12,2)))), DecimalType(18,2), true))#206] + +(158) Filter [codegen id : 373] +Input [6]: [i_brand_id#196, i_class_id#197, i_category_id#198, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#202 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#203 as decimal(12,2)))), DecimalType(18,2), true))#206] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#202 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#203 as decimal(12,2)))), DecimalType(18,2), true))#206) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#202 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#203 as decimal(12,2)))), DecimalType(18,2), true))#206 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(159) Project [codegen id : 373] +Output [6]: [catalog AS channel#96, i_brand_id#196, i_class_id#197, i_category_id#198, sales#93, number_sales#94] +Input [6]: [i_brand_id#196, i_class_id#197, i_category_id#198, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#202 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#203 as decimal(12,2)))), DecimalType(18,2), true))#206] + +(160) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#207, i_class_id#208, i_category_id#209, sum#210, isEmpty#211, count#212] + +(161) HashAggregate [codegen id : 419] +Input [6]: [i_brand_id#207, i_class_id#208, i_category_id#209, sum#210, isEmpty#211, count#212] +Keys [3]: [i_brand_id#207, i_class_id#208, i_category_id#209] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#213 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#214 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#213 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#214 as decimal(12,2)))), DecimalType(18,2), true))#215, count(1)#216] +Results [6]: [i_brand_id#207, i_class_id#208, i_category_id#209, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#213 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#214 as decimal(12,2)))), DecimalType(18,2), true))#215 AS sales#116, count(1)#216 AS number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#213 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#214 as decimal(12,2)))), DecimalType(18,2), true))#215 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#213 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#214 as decimal(12,2)))), DecimalType(18,2), true))#217] + +(162) Filter [codegen id : 419] +Input [6]: [i_brand_id#207, i_class_id#208, i_category_id#209, sales#116, number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#213 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#214 as decimal(12,2)))), DecimalType(18,2), true))#217] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#213 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#214 as decimal(12,2)))), DecimalType(18,2), true))#217) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#213 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#214 as decimal(12,2)))), DecimalType(18,2), true))#217 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(163) Project [codegen id : 419] +Output [6]: [web AS channel#119, i_brand_id#207, i_class_id#208, i_category_id#209, sales#116, number_sales#117] +Input [6]: [i_brand_id#207, i_class_id#208, i_category_id#209, sales#116, number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#213 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#214 as decimal(12,2)))), DecimalType(18,2), true))#217] + +(164) Union + +(165) HashAggregate [codegen id : 420] +Input [6]: [channel#73, i_brand_id#185, i_class_id#186, i_category_id#187, sales#68, number_sales#69] +Keys [4]: [channel#73, i_brand_id#185, i_class_id#186, i_category_id#187] +Functions [2]: [partial_sum(sales#68), partial_sum(number_sales#69)] +Aggregate Attributes [3]: [sum#218, isEmpty#219, sum#220] +Results [7]: [channel#73, i_brand_id#185, i_class_id#186, i_category_id#187, sum#221, isEmpty#222, sum#223] + +(166) Exchange +Input [7]: [channel#73, i_brand_id#185, i_class_id#186, i_category_id#187, sum#221, isEmpty#222, sum#223] +Arguments: hashpartitioning(channel#73, i_brand_id#185, i_class_id#186, i_category_id#187, 5), ENSURE_REQUIREMENTS, [id=#224] + +(167) HashAggregate [codegen id : 421] +Input [7]: [channel#73, i_brand_id#185, i_class_id#186, i_category_id#187, sum#221, isEmpty#222, sum#223] +Keys [4]: [channel#73, i_brand_id#185, i_class_id#186, i_category_id#187] +Functions [2]: [sum(sales#68), sum(number_sales#69)] +Aggregate Attributes [2]: [sum(sales#68)#225, sum(number_sales#69)#226] +Results [4]: [channel#73, i_brand_id#185, sum(sales#68)#225 AS sum_sales#129, sum(number_sales#69)#226 AS number_sales#130] + +(168) HashAggregate [codegen id : 421] +Input [4]: [channel#73, i_brand_id#185, sum_sales#129, number_sales#130] +Keys [2]: [channel#73, i_brand_id#185] +Functions [2]: [partial_sum(sum_sales#129), partial_sum(number_sales#130)] +Aggregate Attributes [3]: [sum#227, isEmpty#228, sum#229] +Results [5]: [channel#73, i_brand_id#185, sum#230, isEmpty#231, sum#232] + +(169) Exchange +Input [5]: [channel#73, i_brand_id#185, sum#230, isEmpty#231, sum#232] +Arguments: hashpartitioning(channel#73, i_brand_id#185, 5), ENSURE_REQUIREMENTS, [id=#233] + +(170) HashAggregate [codegen id : 422] +Input [5]: [channel#73, i_brand_id#185, sum#230, isEmpty#231, sum#232] +Keys [2]: [channel#73, i_brand_id#185] +Functions [2]: [sum(sum_sales#129), sum(number_sales#130)] +Aggregate Attributes [2]: [sum(sum_sales#129)#234, sum(number_sales#130)#235] +Results [6]: [channel#73, i_brand_id#185, null AS i_class_id#236, null AS i_category_id#237, sum(sum_sales#129)#234 AS sum(sum_sales)#238, sum(number_sales#130)#235 AS sum(number_sales)#239] + +(171) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#240, i_class_id#241, i_category_id#242, sum#243, isEmpty#244, count#245] + +(172) HashAggregate [codegen id : 468] +Input [6]: [i_brand_id#240, i_class_id#241, i_category_id#242, sum#243, isEmpty#244, count#245] +Keys [3]: [i_brand_id#240, i_class_id#241, i_category_id#242] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#246 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#247 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#246 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#247 as decimal(12,2)))), DecimalType(18,2), true))#248, count(1)#249] +Results [6]: [i_brand_id#240, i_class_id#241, i_category_id#242, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#246 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#247 as decimal(12,2)))), DecimalType(18,2), true))#248 AS sales#68, count(1)#249 AS number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#246 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#247 as decimal(12,2)))), DecimalType(18,2), true))#248 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#246 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#247 as decimal(12,2)))), DecimalType(18,2), true))#250] + +(173) Filter [codegen id : 468] +Input [6]: [i_brand_id#240, i_class_id#241, i_category_id#242, sales#68, number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#246 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#247 as decimal(12,2)))), DecimalType(18,2), true))#250] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#246 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#247 as decimal(12,2)))), DecimalType(18,2), true))#250) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#246 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#247 as decimal(12,2)))), DecimalType(18,2), true))#250 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(174) Project [codegen id : 468] +Output [6]: [store AS channel#73, i_brand_id#240, i_class_id#241, i_category_id#242, sales#68, number_sales#69] +Input [6]: [i_brand_id#240, i_class_id#241, i_category_id#242, sales#68, number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#246 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#247 as decimal(12,2)))), DecimalType(18,2), true))#250] + +(175) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#251, i_class_id#252, i_category_id#253, sum#254, isEmpty#255, count#256] + +(176) HashAggregate [codegen id : 514] +Input [6]: [i_brand_id#251, i_class_id#252, i_category_id#253, sum#254, isEmpty#255, count#256] +Keys [3]: [i_brand_id#251, i_class_id#252, i_category_id#253] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#257 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#258 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#257 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#258 as decimal(12,2)))), DecimalType(18,2), true))#259, count(1)#260] +Results [6]: [i_brand_id#251, i_class_id#252, i_category_id#253, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#257 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#258 as decimal(12,2)))), DecimalType(18,2), true))#259 AS sales#93, count(1)#260 AS number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#257 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#258 as decimal(12,2)))), DecimalType(18,2), true))#259 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#257 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#258 as decimal(12,2)))), DecimalType(18,2), true))#261] + +(177) Filter [codegen id : 514] +Input [6]: [i_brand_id#251, i_class_id#252, i_category_id#253, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#257 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#258 as decimal(12,2)))), DecimalType(18,2), true))#261] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#257 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#258 as decimal(12,2)))), DecimalType(18,2), true))#261) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#257 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#258 as decimal(12,2)))), DecimalType(18,2), true))#261 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(178) Project [codegen id : 514] +Output [6]: [catalog AS channel#96, i_brand_id#251, i_class_id#252, i_category_id#253, sales#93, number_sales#94] +Input [6]: [i_brand_id#251, i_class_id#252, i_category_id#253, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#257 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#258 as decimal(12,2)))), DecimalType(18,2), true))#261] + +(179) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#262, i_class_id#263, i_category_id#264, sum#265, isEmpty#266, count#267] + +(180) HashAggregate [codegen id : 560] +Input [6]: [i_brand_id#262, i_class_id#263, i_category_id#264, sum#265, isEmpty#266, count#267] +Keys [3]: [i_brand_id#262, i_class_id#263, i_category_id#264] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#268 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#269 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#268 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#269 as decimal(12,2)))), DecimalType(18,2), true))#270, count(1)#271] +Results [6]: [i_brand_id#262, i_class_id#263, i_category_id#264, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#268 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#269 as decimal(12,2)))), DecimalType(18,2), true))#270 AS sales#116, count(1)#271 AS number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#268 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#269 as decimal(12,2)))), DecimalType(18,2), true))#270 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#268 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#269 as decimal(12,2)))), DecimalType(18,2), true))#272] + +(181) Filter [codegen id : 560] +Input [6]: [i_brand_id#262, i_class_id#263, i_category_id#264, sales#116, number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#268 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#269 as decimal(12,2)))), DecimalType(18,2), true))#272] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#268 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#269 as decimal(12,2)))), DecimalType(18,2), true))#272) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#268 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#269 as decimal(12,2)))), DecimalType(18,2), true))#272 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(182) Project [codegen id : 560] +Output [6]: [web AS channel#119, i_brand_id#262, i_class_id#263, i_category_id#264, sales#116, number_sales#117] +Input [6]: [i_brand_id#262, i_class_id#263, i_category_id#264, sales#116, number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#268 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#269 as decimal(12,2)))), DecimalType(18,2), true))#272] + +(183) Union + +(184) HashAggregate [codegen id : 561] +Input [6]: [channel#73, i_brand_id#240, i_class_id#241, i_category_id#242, sales#68, number_sales#69] +Keys [4]: [channel#73, i_brand_id#240, i_class_id#241, i_category_id#242] +Functions [2]: [partial_sum(sales#68), partial_sum(number_sales#69)] +Aggregate Attributes [3]: [sum#273, isEmpty#274, sum#275] +Results [7]: [channel#73, i_brand_id#240, i_class_id#241, i_category_id#242, sum#276, isEmpty#277, sum#278] + +(185) Exchange +Input [7]: [channel#73, i_brand_id#240, i_class_id#241, i_category_id#242, sum#276, isEmpty#277, sum#278] +Arguments: hashpartitioning(channel#73, i_brand_id#240, i_class_id#241, i_category_id#242, 5), ENSURE_REQUIREMENTS, [id=#279] + +(186) HashAggregate [codegen id : 562] +Input [7]: [channel#73, i_brand_id#240, i_class_id#241, i_category_id#242, sum#276, isEmpty#277, sum#278] +Keys [4]: [channel#73, i_brand_id#240, i_class_id#241, i_category_id#242] +Functions [2]: [sum(sales#68), sum(number_sales#69)] +Aggregate Attributes [2]: [sum(sales#68)#280, sum(number_sales#69)#281] +Results [3]: [channel#73, sum(sales#68)#280 AS sum_sales#129, sum(number_sales#69)#281 AS number_sales#130] + +(187) HashAggregate [codegen id : 562] +Input [3]: [channel#73, sum_sales#129, number_sales#130] +Keys [1]: [channel#73] +Functions [2]: [partial_sum(sum_sales#129), partial_sum(number_sales#130)] +Aggregate Attributes [3]: [sum#282, isEmpty#283, sum#284] +Results [4]: [channel#73, sum#285, isEmpty#286, sum#287] + +(188) Exchange +Input [4]: [channel#73, sum#285, isEmpty#286, sum#287] +Arguments: hashpartitioning(channel#73, 5), ENSURE_REQUIREMENTS, [id=#288] + +(189) HashAggregate [codegen id : 563] +Input [4]: [channel#73, sum#285, isEmpty#286, sum#287] +Keys [1]: [channel#73] +Functions [2]: [sum(sum_sales#129), sum(number_sales#130)] +Aggregate Attributes [2]: [sum(sum_sales#129)#289, sum(number_sales#130)#290] +Results [6]: [channel#73, null AS i_brand_id#291, null AS i_class_id#292, null AS i_category_id#293, sum(sum_sales#129)#289 AS sum(sum_sales)#294, sum(number_sales#130)#290 AS sum(number_sales)#295] + +(190) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#296, i_class_id#297, i_category_id#298, sum#299, isEmpty#300, count#301] + +(191) HashAggregate [codegen id : 609] +Input [6]: [i_brand_id#296, i_class_id#297, i_category_id#298, sum#299, isEmpty#300, count#301] +Keys [3]: [i_brand_id#296, i_class_id#297, i_category_id#298] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#302 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#303 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#302 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#303 as decimal(12,2)))), DecimalType(18,2), true))#304, count(1)#305] +Results [6]: [i_brand_id#296, i_class_id#297, i_category_id#298, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#302 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#303 as decimal(12,2)))), DecimalType(18,2), true))#304 AS sales#68, count(1)#305 AS number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#302 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#303 as decimal(12,2)))), DecimalType(18,2), true))#304 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#302 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#303 as decimal(12,2)))), DecimalType(18,2), true))#306] + +(192) Filter [codegen id : 609] +Input [6]: [i_brand_id#296, i_class_id#297, i_category_id#298, sales#68, number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#302 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#303 as decimal(12,2)))), DecimalType(18,2), true))#306] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#302 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#303 as decimal(12,2)))), DecimalType(18,2), true))#306) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#302 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#303 as decimal(12,2)))), DecimalType(18,2), true))#306 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(193) Project [codegen id : 609] +Output [6]: [store AS channel#73, i_brand_id#296, i_class_id#297, i_category_id#298, sales#68, number_sales#69] +Input [6]: [i_brand_id#296, i_class_id#297, i_category_id#298, sales#68, number_sales#69, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#302 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#303 as decimal(12,2)))), DecimalType(18,2), true))#306] + +(194) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#307, i_class_id#308, i_category_id#309, sum#310, isEmpty#311, count#312] + +(195) HashAggregate [codegen id : 655] +Input [6]: [i_brand_id#307, i_class_id#308, i_category_id#309, sum#310, isEmpty#311, count#312] +Keys [3]: [i_brand_id#307, i_class_id#308, i_category_id#309] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#313 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#314 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#313 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#314 as decimal(12,2)))), DecimalType(18,2), true))#315, count(1)#316] +Results [6]: [i_brand_id#307, i_class_id#308, i_category_id#309, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#313 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#314 as decimal(12,2)))), DecimalType(18,2), true))#315 AS sales#93, count(1)#316 AS number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#313 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#314 as decimal(12,2)))), DecimalType(18,2), true))#315 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#313 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#314 as decimal(12,2)))), DecimalType(18,2), true))#317] + +(196) Filter [codegen id : 655] +Input [6]: [i_brand_id#307, i_class_id#308, i_category_id#309, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#313 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#314 as decimal(12,2)))), DecimalType(18,2), true))#317] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#313 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#314 as decimal(12,2)))), DecimalType(18,2), true))#317) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#313 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#314 as decimal(12,2)))), DecimalType(18,2), true))#317 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(197) Project [codegen id : 655] +Output [6]: [catalog AS channel#96, i_brand_id#307, i_class_id#308, i_category_id#309, sales#93, number_sales#94] +Input [6]: [i_brand_id#307, i_class_id#308, i_category_id#309, sales#93, number_sales#94, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#313 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#314 as decimal(12,2)))), DecimalType(18,2), true))#317] + +(198) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#318, i_class_id#319, i_category_id#320, sum#321, isEmpty#322, count#323] + +(199) HashAggregate [codegen id : 701] +Input [6]: [i_brand_id#318, i_class_id#319, i_category_id#320, sum#321, isEmpty#322, count#323] +Keys [3]: [i_brand_id#318, i_class_id#319, i_category_id#320] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#324 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#325 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#324 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#325 as decimal(12,2)))), DecimalType(18,2), true))#326, count(1)#327] +Results [6]: [i_brand_id#318, i_class_id#319, i_category_id#320, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#324 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#325 as decimal(12,2)))), DecimalType(18,2), true))#326 AS sales#116, count(1)#327 AS number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#324 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#325 as decimal(12,2)))), DecimalType(18,2), true))#326 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#324 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#325 as decimal(12,2)))), DecimalType(18,2), true))#328] + +(200) Filter [codegen id : 701] +Input [6]: [i_brand_id#318, i_class_id#319, i_category_id#320, sales#116, number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#324 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#325 as decimal(12,2)))), DecimalType(18,2), true))#328] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#324 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#325 as decimal(12,2)))), DecimalType(18,2), true))#328) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#324 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#325 as decimal(12,2)))), DecimalType(18,2), true))#328 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#71, [id=#72] as decimal(32,6)))) + +(201) Project [codegen id : 701] +Output [6]: [web AS channel#119, i_brand_id#318, i_class_id#319, i_category_id#320, sales#116, number_sales#117] +Input [6]: [i_brand_id#318, i_class_id#319, i_category_id#320, sales#116, number_sales#117, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#324 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#325 as decimal(12,2)))), DecimalType(18,2), true))#328] + +(202) Union + +(203) HashAggregate [codegen id : 702] +Input [6]: [channel#73, i_brand_id#296, i_class_id#297, i_category_id#298, sales#68, number_sales#69] +Keys [4]: [channel#73, i_brand_id#296, i_class_id#297, i_category_id#298] +Functions [2]: [partial_sum(sales#68), partial_sum(number_sales#69)] +Aggregate Attributes [3]: [sum#329, isEmpty#330, sum#331] +Results [7]: [channel#73, i_brand_id#296, i_class_id#297, i_category_id#298, sum#332, isEmpty#333, sum#334] + +(204) Exchange +Input [7]: [channel#73, i_brand_id#296, i_class_id#297, i_category_id#298, sum#332, isEmpty#333, sum#334] +Arguments: hashpartitioning(channel#73, i_brand_id#296, i_class_id#297, i_category_id#298, 5), ENSURE_REQUIREMENTS, [id=#335] + +(205) HashAggregate [codegen id : 703] +Input [7]: [channel#73, i_brand_id#296, i_class_id#297, i_category_id#298, sum#332, isEmpty#333, sum#334] +Keys [4]: [channel#73, i_brand_id#296, i_class_id#297, i_category_id#298] +Functions [2]: [sum(sales#68), sum(number_sales#69)] +Aggregate Attributes [2]: [sum(sales#68)#336, sum(number_sales#69)#337] +Results [2]: [sum(sales#68)#336 AS sum_sales#129, sum(number_sales#69)#337 AS number_sales#130] + +(206) HashAggregate [codegen id : 703] +Input [2]: [sum_sales#129, number_sales#130] +Keys: [] +Functions [2]: [partial_sum(sum_sales#129), partial_sum(number_sales#130)] +Aggregate Attributes [3]: [sum#338, isEmpty#339, sum#340] +Results [3]: [sum#341, isEmpty#342, sum#343] + +(207) Exchange +Input [3]: [sum#341, isEmpty#342, sum#343] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#344] + +(208) HashAggregate [codegen id : 704] +Input [3]: [sum#341, isEmpty#342, sum#343] +Keys: [] +Functions [2]: [sum(sum_sales#129), sum(number_sales#130)] +Aggregate Attributes [2]: [sum(sum_sales#129)#345, sum(number_sales#130)#346] +Results [6]: [null AS channel#347, null AS i_brand_id#348, null AS i_class_id#349, null AS i_category_id#350, sum(sum_sales#129)#345 AS sum(sum_sales)#351, sum(number_sales#130)#346 AS sum(number_sales)#352] + +(209) Union + +(210) HashAggregate [codegen id : 705] +Input [6]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum_sales#129, number_sales#130] +Keys [6]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum_sales#129, number_sales#130] +Functions: [] +Aggregate Attributes: [] +Results [6]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum_sales#129, number_sales#130] + +(211) Exchange +Input [6]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum_sales#129, number_sales#130] +Arguments: hashpartitioning(channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum_sales#129, number_sales#130, 5), ENSURE_REQUIREMENTS, [id=#353] + +(212) HashAggregate [codegen id : 706] +Input [6]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum_sales#129, number_sales#130] +Keys [6]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum_sales#129, number_sales#130] +Functions: [] +Aggregate Attributes: [] +Results [6]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum_sales#129, number_sales#130] + +(213) TakeOrderedAndProject +Input [6]: [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum_sales#129, number_sales#130] +Arguments: 100, [channel#73 ASC NULLS FIRST, i_brand_id#54 ASC NULLS FIRST, i_class_id#55 ASC NULLS FIRST, i_category_id#56 ASC NULLS FIRST], [channel#73, i_brand_id#54, i_class_id#55, i_category_id#56, sum_sales#129, number_sales#130] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 89 Hosting Expression = Subquery scalar-subquery#71, [id=#72] +* HashAggregate (240) ++- Exchange (239) + +- * HashAggregate (238) + +- Union (237) + :- * Project (222) + : +- * BroadcastHashJoin Inner BuildRight (221) + : :- * ColumnarToRow (215) + : : +- Scan parquet default.store_sales (214) + : +- BroadcastExchange (220) + : +- * Project (219) + : +- * Filter (218) + : +- * ColumnarToRow (217) + : +- Scan parquet default.date_dim (216) + :- * Project (231) + : +- * BroadcastHashJoin Inner BuildRight (230) + : :- * ColumnarToRow (224) + : : +- Scan parquet default.catalog_sales (223) + : +- BroadcastExchange (229) + : +- * Project (228) + : +- * Filter (227) + : +- * ColumnarToRow (226) + : +- Scan parquet default.date_dim (225) + +- * Project (236) + +- * BroadcastHashJoin Inner BuildRight (235) + :- * ColumnarToRow (233) + : +- Scan parquet default.web_sales (232) + +- ReusedExchange (234) + + +(214) Scan parquet default.store_sales +Output [3]: [ss_quantity#354, ss_list_price#355, ss_sold_date_sk#356] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#356), dynamicpruningexpression(ss_sold_date_sk#356 IN dynamicpruning#357)] +ReadSchema: struct + +(215) ColumnarToRow [codegen id : 2] +Input [3]: [ss_quantity#354, ss_list_price#355, ss_sold_date_sk#356] + +(216) Scan parquet default.date_dim +Output [2]: [d_date_sk#358, d_year#359] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(217) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#358, d_year#359] + +(218) Filter [codegen id : 1] +Input [2]: [d_date_sk#358, d_year#359] +Condition : (((isnotnull(d_year#359) AND (d_year#359 >= 1999)) AND (d_year#359 <= 2001)) AND isnotnull(d_date_sk#358)) + +(219) Project [codegen id : 1] +Output [1]: [d_date_sk#358] +Input [2]: [d_date_sk#358, d_year#359] + +(220) BroadcastExchange +Input [1]: [d_date_sk#358] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#360] + +(221) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#356] +Right keys [1]: [d_date_sk#358] +Join condition: None + +(222) Project [codegen id : 2] +Output [2]: [ss_quantity#354 AS quantity#361, ss_list_price#355 AS list_price#362] +Input [4]: [ss_quantity#354, ss_list_price#355, ss_sold_date_sk#356, d_date_sk#358] + +(223) Scan parquet default.catalog_sales +Output [3]: [cs_quantity#363, cs_list_price#364, cs_sold_date_sk#365] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#365), dynamicpruningexpression(cs_sold_date_sk#365 IN dynamicpruning#366)] +ReadSchema: struct + +(224) ColumnarToRow [codegen id : 4] +Input [3]: [cs_quantity#363, cs_list_price#364, cs_sold_date_sk#365] + +(225) Scan parquet default.date_dim +Output [2]: [d_date_sk#367, d_year#368] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1998), LessThanOrEqual(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(226) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#367, d_year#368] + +(227) Filter [codegen id : 3] +Input [2]: [d_date_sk#367, d_year#368] +Condition : (((isnotnull(d_year#368) AND (d_year#368 >= 1998)) AND (d_year#368 <= 2000)) AND isnotnull(d_date_sk#367)) + +(228) Project [codegen id : 3] +Output [1]: [d_date_sk#367] +Input [2]: [d_date_sk#367, d_year#368] + +(229) BroadcastExchange +Input [1]: [d_date_sk#367] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#369] + +(230) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#365] +Right keys [1]: [d_date_sk#367] +Join condition: None + +(231) Project [codegen id : 4] +Output [2]: [cs_quantity#363 AS quantity#370, cs_list_price#364 AS list_price#371] +Input [4]: [cs_quantity#363, cs_list_price#364, cs_sold_date_sk#365, d_date_sk#367] + +(232) Scan parquet default.web_sales +Output [3]: [ws_quantity#372, ws_list_price#373, ws_sold_date_sk#374] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#374), dynamicpruningexpression(ws_sold_date_sk#374 IN dynamicpruning#366)] +ReadSchema: struct + +(233) ColumnarToRow [codegen id : 6] +Input [3]: [ws_quantity#372, ws_list_price#373, ws_sold_date_sk#374] + +(234) ReusedExchange [Reuses operator id: 229] +Output [1]: [d_date_sk#375] + +(235) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#374] +Right keys [1]: [d_date_sk#375] +Join condition: None + +(236) Project [codegen id : 6] +Output [2]: [ws_quantity#372 AS quantity#376, ws_list_price#373 AS list_price#377] +Input [4]: [ws_quantity#372, ws_list_price#373, ws_sold_date_sk#374, d_date_sk#375] + +(237) Union + +(238) HashAggregate [codegen id : 7] +Input [2]: [quantity#361, list_price#362] +Keys: [] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#361 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#362 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#378, count#379] +Results [2]: [sum#380, count#381] + +(239) Exchange +Input [2]: [sum#380, count#381] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#382] + +(240) HashAggregate [codegen id : 8] +Input [2]: [sum#380, count#381] +Keys: [] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#361 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#362 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#361 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#362 as decimal(12,2)))), DecimalType(18,2), true))#383] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#361 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#362 as decimal(12,2)))), DecimalType(18,2), true))#383 AS average_sales#384] + +Subquery:2 Hosting operator id = 214 Hosting Expression = ss_sold_date_sk#356 IN dynamicpruning#357 +ReusedExchange (241) + + +(241) ReusedExchange [Reuses operator id: 220] +Output [1]: [d_date_sk#358] + +Subquery:3 Hosting operator id = 223 Hosting Expression = cs_sold_date_sk#365 IN dynamicpruning#366 +ReusedExchange (242) + + +(242) ReusedExchange [Reuses operator id: 229] +Output [1]: [d_date_sk#367] + +Subquery:4 Hosting operator id = 232 Hosting Expression = ws_sold_date_sk#374 IN dynamicpruning#366 + +Subquery:5 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (243) + + +(243) ReusedExchange [Reuses operator id: 72] +Output [1]: [d_date_sk#49] + +Subquery:6 Hosting operator id = 9 Hosting Expression = ss_sold_date_sk#12 IN dynamicpruning#13 +ReusedExchange (244) + + +(244) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#14] + +Subquery:7 Hosting operator id = 24 Hosting Expression = cs_sold_date_sk#23 IN dynamicpruning#13 + +Subquery:8 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#38 IN dynamicpruning#13 + +Subquery:9 Hosting operator id = 108 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:10 Hosting operator id = 91 Hosting Expression = cs_sold_date_sk#77 IN dynamicpruning#5 + +Subquery:11 Hosting operator id = 127 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:12 Hosting operator id = 110 Hosting Expression = ws_sold_date_sk#100 IN dynamicpruning#5 + +Subquery:13 Hosting operator id = 135 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:14 Hosting operator id = 139 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:15 Hosting operator id = 143 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:16 Hosting operator id = 154 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:17 Hosting operator id = 158 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:18 Hosting operator id = 162 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:19 Hosting operator id = 173 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:20 Hosting operator id = 177 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:21 Hosting operator id = 181 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:22 Hosting operator id = 192 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:23 Hosting operator id = 196 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + +Subquery:24 Hosting operator id = 200 Hosting Expression = ReusedSubquery Subquery scalar-subquery#71, [id=#72] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/simplified.txt new file mode 100644 index 0000000000000..0a9fa7cbf3498 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a.sf100/simplified.txt @@ -0,0 +1,430 @@ +TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + WholeStageCodegen (706) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] #1 + WholeStageCodegen (705) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + InputAdapter + Union + WholeStageCodegen (140) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id] #2 + WholeStageCodegen (139) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + InputAdapter + Union + WholeStageCodegen (46) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + Subquery #3 + WholeStageCodegen (8) + HashAggregate [sum,count] [avg(CheckOverflow((promote_precision(cast(cast(quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price as decimal(12,2)))), DecimalType(18,2), true)),average_sales,sum,count] + InputAdapter + Exchange #20 + WholeStageCodegen (7) + HashAggregate [quantity,list_price] [sum,count,sum,count] + InputAdapter + Union + WholeStageCodegen (2) + Project [ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #4 + ReusedExchange [d_date_sk] #21 + InputAdapter + BroadcastExchange #21 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + WholeStageCodegen (4) + Project [cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_quantity,cs_list_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #5 + ReusedExchange [d_date_sk] #22 + InputAdapter + BroadcastExchange #22 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + WholeStageCodegen (6) + Project [ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #5 + InputAdapter + ReusedExchange [d_date_sk] #22 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #3 + WholeStageCodegen (45) + HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + SortMergeJoin [ss_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + WholeStageCodegen (21) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #6 + WholeStageCodegen (20) + Project [i_item_sk] + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id] + Filter [i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (19) + HashAggregate [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #8 + WholeStageCodegen (18) + HashAggregate [brand_id,class_id,category_id] + SortMergeJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (13) + Sort [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #9 + WholeStageCodegen (12) + HashAggregate [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #10 + WholeStageCodegen (11) + HashAggregate [brand_id,class_id,category_id] + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #11 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (10) + SortMergeJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (5) + Sort [i_brand_id,i_class_id,i_category_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #13 + WholeStageCodegen (4) + Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (9) + Sort [i_brand_id,i_class_id,i_category_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #14 + WholeStageCodegen (8) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk] #11 + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (7) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (17) + Sort [i_brand_id,i_class_id,i_category_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #16 + WholeStageCodegen (16) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk] #11 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #15 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (22) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (44) + SortMergeJoin [i_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (24) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #18 + WholeStageCodegen (23) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + WholeStageCodegen (43) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk] #19 + WholeStageCodegen (92) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #23 + WholeStageCodegen (91) + HashAggregate [i_brand_id,i_class_id,i_category_id,cs_quantity,cs_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [cs_quantity,cs_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + SortMergeJoin [cs_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (48) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #24 + WholeStageCodegen (47) + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (67) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk] #19 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #17 + WholeStageCodegen (138) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #25 + WholeStageCodegen (137) + HashAggregate [i_brand_id,i_class_id,i_category_id,ws_quantity,ws_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ws_quantity,ws_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + SortMergeJoin [ws_item_sk,ss_item_sk] + InputAdapter + WholeStageCodegen (94) + Sort [ws_item_sk] + InputAdapter + Exchange [ws_item_sk] #26 + WholeStageCodegen (93) + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (113) + Sort [ss_item_sk] + InputAdapter + ReusedExchange [ss_item_sk] #19 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #17 + WholeStageCodegen (281) + HashAggregate [channel,i_brand_id,i_class_id,sum,isEmpty,sum] [sum(sum_sales),sum(number_salesL),i_category_id,sum(sum_sales),sum(number_sales),sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id] #27 + WholeStageCodegen (280) + HashAggregate [channel,i_brand_id,i_class_id,sum_sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id] #28 + WholeStageCodegen (279) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + InputAdapter + Union + WholeStageCodegen (186) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #29 + WholeStageCodegen (232) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #30 + WholeStageCodegen (278) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #31 + WholeStageCodegen (422) + HashAggregate [channel,i_brand_id,sum,isEmpty,sum] [sum(sum_sales),sum(number_salesL),i_class_id,i_category_id,sum(sum_sales),sum(number_sales),sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id] #32 + WholeStageCodegen (421) + HashAggregate [channel,i_brand_id,sum_sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id] #33 + WholeStageCodegen (420) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + InputAdapter + Union + WholeStageCodegen (327) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #29 + WholeStageCodegen (373) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #30 + WholeStageCodegen (419) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #31 + WholeStageCodegen (563) + HashAggregate [channel,sum,isEmpty,sum] [sum(sum_sales),sum(number_salesL),i_brand_id,i_class_id,i_category_id,sum(sum_sales),sum(number_sales),sum,isEmpty,sum] + InputAdapter + Exchange [channel] #34 + WholeStageCodegen (562) + HashAggregate [channel,sum_sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id] #35 + WholeStageCodegen (561) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + InputAdapter + Union + WholeStageCodegen (468) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #29 + WholeStageCodegen (514) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #30 + WholeStageCodegen (560) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #31 + WholeStageCodegen (704) + HashAggregate [sum,isEmpty,sum] [sum(sum_sales),sum(number_salesL),channel,i_brand_id,i_class_id,i_category_id,sum(sum_sales),sum(number_sales),sum,isEmpty,sum] + InputAdapter + Exchange #36 + WholeStageCodegen (703) + HashAggregate [sum_sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id] #37 + WholeStageCodegen (702) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + InputAdapter + Union + WholeStageCodegen (609) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #29 + WholeStageCodegen (655) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #30 + WholeStageCodegen (701) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #31 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/explain.txt new file mode 100644 index 0000000000000..755973f79e493 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/explain.txt @@ -0,0 +1,1337 @@ +== Physical Plan == +TakeOrderedAndProject (194) ++- * HashAggregate (193) + +- Exchange (192) + +- * HashAggregate (191) + +- Union (190) + :- * HashAggregate (113) + : +- Exchange (112) + : +- * HashAggregate (111) + : +- Union (110) + : :- * Project (77) + : : +- * Filter (76) + : : +- * HashAggregate (75) + : : +- Exchange (74) + : : +- * HashAggregate (73) + : : +- * Project (72) + : : +- * BroadcastHashJoin Inner BuildRight (71) + : : :- * Project (65) + : : : +- * BroadcastHashJoin Inner BuildRight (64) + : : : :- * BroadcastHashJoin LeftSemi BuildRight (57) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (56) + : : : : +- * Project (55) + : : : : +- * BroadcastHashJoin Inner BuildRight (54) + : : : : :- * Filter (6) + : : : : : +- * ColumnarToRow (5) + : : : : : +- Scan parquet default.item (4) + : : : : +- BroadcastExchange (53) + : : : : +- * HashAggregate (52) + : : : : +- * HashAggregate (51) + : : : : +- * BroadcastHashJoin LeftSemi BuildRight (50) + : : : : :- * HashAggregate (39) + : : : : : +- Exchange (38) + : : : : : +- * HashAggregate (37) + : : : : : +- * Project (36) + : : : : : +- * BroadcastHashJoin Inner BuildRight (35) + : : : : : :- * Project (33) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (32) + : : : : : : :- * Filter (9) + : : : : : : : +- * ColumnarToRow (8) + : : : : : : : +- Scan parquet default.store_sales (7) + : : : : : : +- BroadcastExchange (31) + : : : : : : +- * BroadcastHashJoin LeftSemi BuildRight (30) + : : : : : : :- * Filter (12) + : : : : : : : +- * ColumnarToRow (11) + : : : : : : : +- Scan parquet default.item (10) + : : : : : : +- BroadcastExchange (29) + : : : : : : +- * Project (28) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (27) + : : : : : : :- * Project (21) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : : : : : :- * Filter (15) + : : : : : : : : +- * ColumnarToRow (14) + : : : : : : : : +- Scan parquet default.catalog_sales (13) + : : : : : : : +- BroadcastExchange (19) + : : : : : : : +- * Filter (18) + : : : : : : : +- * ColumnarToRow (17) + : : : : : : : +- Scan parquet default.item (16) + : : : : : : +- BroadcastExchange (26) + : : : : : : +- * Project (25) + : : : : : : +- * Filter (24) + : : : : : : +- * ColumnarToRow (23) + : : : : : : +- Scan parquet default.date_dim (22) + : : : : : +- ReusedExchange (34) + : : : : +- BroadcastExchange (49) + : : : : +- * Project (48) + : : : : +- * BroadcastHashJoin Inner BuildRight (47) + : : : : :- * Project (45) + : : : : : +- * BroadcastHashJoin Inner BuildRight (44) + : : : : : :- * Filter (42) + : : : : : : +- * ColumnarToRow (41) + : : : : : : +- Scan parquet default.web_sales (40) + : : : : : +- ReusedExchange (43) + : : : : +- ReusedExchange (46) + : : : +- BroadcastExchange (63) + : : : +- * BroadcastHashJoin LeftSemi BuildRight (62) + : : : :- * Filter (60) + : : : : +- * ColumnarToRow (59) + : : : : +- Scan parquet default.item (58) + : : : +- ReusedExchange (61) + : : +- BroadcastExchange (70) + : : +- * Project (69) + : : +- * Filter (68) + : : +- * ColumnarToRow (67) + : : +- Scan parquet default.date_dim (66) + : :- * Project (93) + : : +- * Filter (92) + : : +- * HashAggregate (91) + : : +- Exchange (90) + : : +- * HashAggregate (89) + : : +- * Project (88) + : : +- * BroadcastHashJoin Inner BuildRight (87) + : : :- * Project (85) + : : : +- * BroadcastHashJoin Inner BuildRight (84) + : : : :- * BroadcastHashJoin LeftSemi BuildRight (82) + : : : : :- * Filter (80) + : : : : : +- * ColumnarToRow (79) + : : : : : +- Scan parquet default.catalog_sales (78) + : : : : +- ReusedExchange (81) + : : : +- ReusedExchange (83) + : : +- ReusedExchange (86) + : +- * Project (109) + : +- * Filter (108) + : +- * HashAggregate (107) + : +- Exchange (106) + : +- * HashAggregate (105) + : +- * Project (104) + : +- * BroadcastHashJoin Inner BuildRight (103) + : :- * Project (101) + : : +- * BroadcastHashJoin Inner BuildRight (100) + : : :- * BroadcastHashJoin LeftSemi BuildRight (98) + : : : :- * Filter (96) + : : : : +- * ColumnarToRow (95) + : : : : +- Scan parquet default.web_sales (94) + : : : +- ReusedExchange (97) + : : +- ReusedExchange (99) + : +- ReusedExchange (102) + :- * HashAggregate (132) + : +- Exchange (131) + : +- * HashAggregate (130) + : +- * HashAggregate (129) + : +- Exchange (128) + : +- * HashAggregate (127) + : +- Union (126) + : :- * Project (117) + : : +- * Filter (116) + : : +- * HashAggregate (115) + : : +- ReusedExchange (114) + : :- * Project (121) + : : +- * Filter (120) + : : +- * HashAggregate (119) + : : +- ReusedExchange (118) + : +- * Project (125) + : +- * Filter (124) + : +- * HashAggregate (123) + : +- ReusedExchange (122) + :- * HashAggregate (151) + : +- Exchange (150) + : +- * HashAggregate (149) + : +- * HashAggregate (148) + : +- Exchange (147) + : +- * HashAggregate (146) + : +- Union (145) + : :- * Project (136) + : : +- * Filter (135) + : : +- * HashAggregate (134) + : : +- ReusedExchange (133) + : :- * Project (140) + : : +- * Filter (139) + : : +- * HashAggregate (138) + : : +- ReusedExchange (137) + : +- * Project (144) + : +- * Filter (143) + : +- * HashAggregate (142) + : +- ReusedExchange (141) + :- * HashAggregate (170) + : +- Exchange (169) + : +- * HashAggregate (168) + : +- * HashAggregate (167) + : +- Exchange (166) + : +- * HashAggregate (165) + : +- Union (164) + : :- * Project (155) + : : +- * Filter (154) + : : +- * HashAggregate (153) + : : +- ReusedExchange (152) + : :- * Project (159) + : : +- * Filter (158) + : : +- * HashAggregate (157) + : : +- ReusedExchange (156) + : +- * Project (163) + : +- * Filter (162) + : +- * HashAggregate (161) + : +- ReusedExchange (160) + +- * HashAggregate (189) + +- Exchange (188) + +- * HashAggregate (187) + +- * HashAggregate (186) + +- Exchange (185) + +- * HashAggregate (184) + +- Union (183) + :- * Project (174) + : +- * Filter (173) + : +- * HashAggregate (172) + : +- ReusedExchange (171) + :- * Project (178) + : +- * Filter (177) + : +- * HashAggregate (176) + : +- ReusedExchange (175) + +- * Project (182) + +- * Filter (181) + +- * HashAggregate (180) + +- ReusedExchange (179) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 25] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 25] +Input [4]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 11] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] + +(6) Filter [codegen id : 11] +Input [4]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9] +Condition : ((isnotnull(i_brand_id#7) AND isnotnull(i_class_id#8)) AND isnotnull(i_category_id#9)) + +(7) Scan parquet default.store_sales +Output [2]: [ss_item_sk#10, ss_sold_date_sk#11] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#11), dynamicpruningexpression(ss_sold_date_sk#11 IN dynamicpruning#12)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 6] +Input [2]: [ss_item_sk#10, ss_sold_date_sk#11] + +(9) Filter [codegen id : 6] +Input [2]: [ss_item_sk#10, ss_sold_date_sk#11] +Condition : isnotnull(ss_item_sk#10) + +(10) Scan parquet default.item +Output [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 4] +Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] + +(12) Filter [codegen id : 4] +Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] +Condition : (((isnotnull(i_item_sk#13) AND isnotnull(i_brand_id#14)) AND isnotnull(i_class_id#15)) AND isnotnull(i_category_id#16)) + +(13) Scan parquet default.catalog_sales +Output [2]: [cs_item_sk#17, cs_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#12)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 3] +Input [2]: [cs_item_sk#17, cs_sold_date_sk#18] + +(15) Filter [codegen id : 3] +Input [2]: [cs_item_sk#17, cs_sold_date_sk#18] +Condition : isnotnull(cs_item_sk#17) + +(16) Scan parquet default.item +Output [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 1] +Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] + +(18) Filter [codegen id : 1] +Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] +Condition : isnotnull(i_item_sk#19) + +(19) BroadcastExchange +Input [4]: [i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(20) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_item_sk#17] +Right keys [1]: [i_item_sk#19] +Join condition: None + +(21) Project [codegen id : 3] +Output [4]: [cs_sold_date_sk#18, i_brand_id#20, i_class_id#21, i_category_id#22] +Input [6]: [cs_item_sk#17, cs_sold_date_sk#18, i_item_sk#19, i_brand_id#20, i_class_id#21, i_category_id#22] + +(22) Scan parquet default.date_dim +Output [2]: [d_date_sk#24, d_year#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#24, d_year#25] + +(24) Filter [codegen id : 2] +Input [2]: [d_date_sk#24, d_year#25] +Condition : (((isnotnull(d_year#25) AND (d_year#25 >= 1999)) AND (d_year#25 <= 2001)) AND isnotnull(d_date_sk#24)) + +(25) Project [codegen id : 2] +Output [1]: [d_date_sk#24] +Input [2]: [d_date_sk#24, d_year#25] + +(26) BroadcastExchange +Input [1]: [d_date_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] + +(27) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(28) Project [codegen id : 3] +Output [3]: [i_brand_id#20, i_class_id#21, i_category_id#22] +Input [5]: [cs_sold_date_sk#18, i_brand_id#20, i_class_id#21, i_category_id#22, d_date_sk#24] + +(29) BroadcastExchange +Input [3]: [i_brand_id#20, i_class_id#21, i_category_id#22] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [id=#27] + +(30) BroadcastHashJoin [codegen id : 4] +Left keys [6]: [coalesce(i_brand_id#14, 0), isnull(i_brand_id#14), coalesce(i_class_id#15, 0), isnull(i_class_id#15), coalesce(i_category_id#16, 0), isnull(i_category_id#16)] +Right keys [6]: [coalesce(i_brand_id#20, 0), isnull(i_brand_id#20), coalesce(i_class_id#21, 0), isnull(i_class_id#21), coalesce(i_category_id#22, 0), isnull(i_category_id#22)] +Join condition: None + +(31) BroadcastExchange +Input [4]: [i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#28] + +(32) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#10] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(33) Project [codegen id : 6] +Output [4]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16] +Input [6]: [ss_item_sk#10, ss_sold_date_sk#11, i_item_sk#13, i_brand_id#14, i_class_id#15, i_category_id#16] + +(34) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#29] + +(35) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#11] +Right keys [1]: [d_date_sk#29] +Join condition: None + +(36) Project [codegen id : 6] +Output [3]: [i_brand_id#14 AS brand_id#30, i_class_id#15 AS class_id#31, i_category_id#16 AS category_id#32] +Input [5]: [ss_sold_date_sk#11, i_brand_id#14, i_class_id#15, i_category_id#16, d_date_sk#29] + +(37) HashAggregate [codegen id : 6] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(38) Exchange +Input [3]: [brand_id#30, class_id#31, category_id#32] +Arguments: hashpartitioning(brand_id#30, class_id#31, category_id#32, 5), ENSURE_REQUIREMENTS, [id=#33] + +(39) HashAggregate [codegen id : 10] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(40) Scan parquet default.web_sales +Output [2]: [ws_item_sk#34, ws_sold_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#35), dynamicpruningexpression(ws_sold_date_sk#35 IN dynamicpruning#12)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 9] +Input [2]: [ws_item_sk#34, ws_sold_date_sk#35] + +(42) Filter [codegen id : 9] +Input [2]: [ws_item_sk#34, ws_sold_date_sk#35] +Condition : isnotnull(ws_item_sk#34) + +(43) ReusedExchange [Reuses operator id: 19] +Output [4]: [i_item_sk#36, i_brand_id#37, i_class_id#38, i_category_id#39] + +(44) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ws_item_sk#34] +Right keys [1]: [i_item_sk#36] +Join condition: None + +(45) Project [codegen id : 9] +Output [4]: [ws_sold_date_sk#35, i_brand_id#37, i_class_id#38, i_category_id#39] +Input [6]: [ws_item_sk#34, ws_sold_date_sk#35, i_item_sk#36, i_brand_id#37, i_class_id#38, i_category_id#39] + +(46) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#40] + +(47) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ws_sold_date_sk#35] +Right keys [1]: [d_date_sk#40] +Join condition: None + +(48) Project [codegen id : 9] +Output [3]: [i_brand_id#37, i_class_id#38, i_category_id#39] +Input [5]: [ws_sold_date_sk#35, i_brand_id#37, i_class_id#38, i_category_id#39, d_date_sk#40] + +(49) BroadcastExchange +Input [3]: [i_brand_id#37, i_class_id#38, i_category_id#39] +Arguments: HashedRelationBroadcastMode(List(coalesce(input[0, int, true], 0), isnull(input[0, int, true]), coalesce(input[1, int, true], 0), isnull(input[1, int, true]), coalesce(input[2, int, true], 0), isnull(input[2, int, true])),false), [id=#41] + +(50) BroadcastHashJoin [codegen id : 10] +Left keys [6]: [coalesce(brand_id#30, 0), isnull(brand_id#30), coalesce(class_id#31, 0), isnull(class_id#31), coalesce(category_id#32, 0), isnull(category_id#32)] +Right keys [6]: [coalesce(i_brand_id#37, 0), isnull(i_brand_id#37), coalesce(i_class_id#38, 0), isnull(i_class_id#38), coalesce(i_category_id#39, 0), isnull(i_category_id#39)] +Join condition: None + +(51) HashAggregate [codegen id : 10] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(52) HashAggregate [codegen id : 10] +Input [3]: [brand_id#30, class_id#31, category_id#32] +Keys [3]: [brand_id#30, class_id#31, category_id#32] +Functions: [] +Aggregate Attributes: [] +Results [3]: [brand_id#30, class_id#31, category_id#32] + +(53) BroadcastExchange +Input [3]: [brand_id#30, class_id#31, category_id#32] +Arguments: HashedRelationBroadcastMode(List(input[0, int, true], input[1, int, true], input[2, int, true]),false), [id=#42] + +(54) BroadcastHashJoin [codegen id : 11] +Left keys [3]: [i_brand_id#7, i_class_id#8, i_category_id#9] +Right keys [3]: [brand_id#30, class_id#31, category_id#32] +Join condition: None + +(55) Project [codegen id : 11] +Output [1]: [i_item_sk#6 AS ss_item_sk#43] +Input [7]: [i_item_sk#6, i_brand_id#7, i_class_id#8, i_category_id#9, brand_id#30, class_id#31, category_id#32] + +(56) BroadcastExchange +Input [1]: [ss_item_sk#43] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#44] + +(57) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(58) Scan parquet default.item +Output [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(59) ColumnarToRow [codegen id : 23] +Input [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] + +(60) Filter [codegen id : 23] +Input [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] +Condition : isnotnull(i_item_sk#45) + +(61) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#43] + +(62) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [i_item_sk#45] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(63) BroadcastExchange +Input [4]: [i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#49] + +(64) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#45] +Join condition: None + +(65) Project [codegen id : 25] +Output [6]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#46, i_class_id#47, i_category_id#48] +Input [8]: [ss_item_sk#1, ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_item_sk#45, i_brand_id#46, i_class_id#47, i_category_id#48] + +(66) Scan parquet default.date_dim +Output [3]: [d_date_sk#50, d_year#51, d_moy#52] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,11), IsNotNull(d_date_sk)] +ReadSchema: struct + +(67) ColumnarToRow [codegen id : 24] +Input [3]: [d_date_sk#50, d_year#51, d_moy#52] + +(68) Filter [codegen id : 24] +Input [3]: [d_date_sk#50, d_year#51, d_moy#52] +Condition : ((((isnotnull(d_year#51) AND isnotnull(d_moy#52)) AND (d_year#51 = 2000)) AND (d_moy#52 = 11)) AND isnotnull(d_date_sk#50)) + +(69) Project [codegen id : 24] +Output [1]: [d_date_sk#50] +Input [3]: [d_date_sk#50, d_year#51, d_moy#52] + +(70) BroadcastExchange +Input [1]: [d_date_sk#50] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#53] + +(71) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#50] +Join condition: None + +(72) Project [codegen id : 25] +Output [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#46, i_class_id#47, i_category_id#48] +Input [7]: [ss_quantity#2, ss_list_price#3, ss_sold_date_sk#4, i_brand_id#46, i_class_id#47, i_category_id#48, d_date_sk#50] + +(73) HashAggregate [codegen id : 25] +Input [5]: [ss_quantity#2, ss_list_price#3, i_brand_id#46, i_class_id#47, i_category_id#48] +Keys [3]: [i_brand_id#46, i_class_id#47, i_category_id#48] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#54, isEmpty#55, count#56] +Results [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum#57, isEmpty#58, count#59] + +(74) Exchange +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum#57, isEmpty#58, count#59] +Arguments: hashpartitioning(i_brand_id#46, i_class_id#47, i_category_id#48, 5), ENSURE_REQUIREMENTS, [id=#60] + +(75) HashAggregate [codegen id : 26] +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum#57, isEmpty#58, count#59] +Keys [3]: [i_brand_id#46, i_class_id#47, i_category_id#48] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#61, count(1)#62] +Results [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#61 AS sales#63, count(1)#62 AS number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#61 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#65] + +(76) Filter [codegen id : 26] +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sales#63, number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#65] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#65) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#65 as decimal(32,6)) > cast(Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(77) Project [codegen id : 26] +Output [6]: [store AS channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sales#63, number_sales#64] +Input [6]: [i_brand_id#46, i_class_id#47, i_category_id#48, sales#63, number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#2 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#3 as decimal(12,2)))), DecimalType(18,2), true))#65] + +(78) Scan parquet default.catalog_sales +Output [4]: [cs_item_sk#69, cs_quantity#70, cs_list_price#71, cs_sold_date_sk#72] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#72), dynamicpruningexpression(cs_sold_date_sk#72 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(79) ColumnarToRow [codegen id : 51] +Input [4]: [cs_item_sk#69, cs_quantity#70, cs_list_price#71, cs_sold_date_sk#72] + +(80) Filter [codegen id : 51] +Input [4]: [cs_item_sk#69, cs_quantity#70, cs_list_price#71, cs_sold_date_sk#72] +Condition : isnotnull(cs_item_sk#69) + +(81) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#43] + +(82) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [cs_item_sk#69] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(83) ReusedExchange [Reuses operator id: 63] +Output [4]: [i_item_sk#73, i_brand_id#74, i_class_id#75, i_category_id#76] + +(84) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [cs_item_sk#69] +Right keys [1]: [i_item_sk#73] +Join condition: None + +(85) Project [codegen id : 51] +Output [6]: [cs_quantity#70, cs_list_price#71, cs_sold_date_sk#72, i_brand_id#74, i_class_id#75, i_category_id#76] +Input [8]: [cs_item_sk#69, cs_quantity#70, cs_list_price#71, cs_sold_date_sk#72, i_item_sk#73, i_brand_id#74, i_class_id#75, i_category_id#76] + +(86) ReusedExchange [Reuses operator id: 70] +Output [1]: [d_date_sk#77] + +(87) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [cs_sold_date_sk#72] +Right keys [1]: [d_date_sk#77] +Join condition: None + +(88) Project [codegen id : 51] +Output [5]: [cs_quantity#70, cs_list_price#71, i_brand_id#74, i_class_id#75, i_category_id#76] +Input [7]: [cs_quantity#70, cs_list_price#71, cs_sold_date_sk#72, i_brand_id#74, i_class_id#75, i_category_id#76, d_date_sk#77] + +(89) HashAggregate [codegen id : 51] +Input [5]: [cs_quantity#70, cs_list_price#71, i_brand_id#74, i_class_id#75, i_category_id#76] +Keys [3]: [i_brand_id#74, i_class_id#75, i_category_id#76] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#78, isEmpty#79, count#80] +Results [6]: [i_brand_id#74, i_class_id#75, i_category_id#76, sum#81, isEmpty#82, count#83] + +(90) Exchange +Input [6]: [i_brand_id#74, i_class_id#75, i_category_id#76, sum#81, isEmpty#82, count#83] +Arguments: hashpartitioning(i_brand_id#74, i_class_id#75, i_category_id#76, 5), ENSURE_REQUIREMENTS, [id=#84] + +(91) HashAggregate [codegen id : 52] +Input [6]: [i_brand_id#74, i_class_id#75, i_category_id#76, sum#81, isEmpty#82, count#83] +Keys [3]: [i_brand_id#74, i_class_id#75, i_category_id#76] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#85, count(1)#86] +Results [6]: [i_brand_id#74, i_class_id#75, i_category_id#76, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#85 AS sales#87, count(1)#86 AS number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#85 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#89] + +(92) Filter [codegen id : 52] +Input [6]: [i_brand_id#74, i_class_id#75, i_category_id#76, sales#87, number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#89] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#89) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#89 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(93) Project [codegen id : 52] +Output [6]: [catalog AS channel#90, i_brand_id#74, i_class_id#75, i_category_id#76, sales#87, number_sales#88] +Input [6]: [i_brand_id#74, i_class_id#75, i_category_id#76, sales#87, number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#70 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#71 as decimal(12,2)))), DecimalType(18,2), true))#89] + +(94) Scan parquet default.web_sales +Output [4]: [ws_item_sk#91, ws_quantity#92, ws_list_price#93, ws_sold_date_sk#94] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#94), dynamicpruningexpression(ws_sold_date_sk#94 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(95) ColumnarToRow [codegen id : 77] +Input [4]: [ws_item_sk#91, ws_quantity#92, ws_list_price#93, ws_sold_date_sk#94] + +(96) Filter [codegen id : 77] +Input [4]: [ws_item_sk#91, ws_quantity#92, ws_list_price#93, ws_sold_date_sk#94] +Condition : isnotnull(ws_item_sk#91) + +(97) ReusedExchange [Reuses operator id: unknown] +Output [1]: [ss_item_sk#43] + +(98) BroadcastHashJoin [codegen id : 77] +Left keys [1]: [ws_item_sk#91] +Right keys [1]: [ss_item_sk#43] +Join condition: None + +(99) ReusedExchange [Reuses operator id: 63] +Output [4]: [i_item_sk#95, i_brand_id#96, i_class_id#97, i_category_id#98] + +(100) BroadcastHashJoin [codegen id : 77] +Left keys [1]: [ws_item_sk#91] +Right keys [1]: [i_item_sk#95] +Join condition: None + +(101) Project [codegen id : 77] +Output [6]: [ws_quantity#92, ws_list_price#93, ws_sold_date_sk#94, i_brand_id#96, i_class_id#97, i_category_id#98] +Input [8]: [ws_item_sk#91, ws_quantity#92, ws_list_price#93, ws_sold_date_sk#94, i_item_sk#95, i_brand_id#96, i_class_id#97, i_category_id#98] + +(102) ReusedExchange [Reuses operator id: 70] +Output [1]: [d_date_sk#99] + +(103) BroadcastHashJoin [codegen id : 77] +Left keys [1]: [ws_sold_date_sk#94] +Right keys [1]: [d_date_sk#99] +Join condition: None + +(104) Project [codegen id : 77] +Output [5]: [ws_quantity#92, ws_list_price#93, i_brand_id#96, i_class_id#97, i_category_id#98] +Input [7]: [ws_quantity#92, ws_list_price#93, ws_sold_date_sk#94, i_brand_id#96, i_class_id#97, i_category_id#98, d_date_sk#99] + +(105) HashAggregate [codegen id : 77] +Input [5]: [ws_quantity#92, ws_list_price#93, i_brand_id#96, i_class_id#97, i_category_id#98] +Keys [3]: [i_brand_id#96, i_class_id#97, i_category_id#98] +Functions [2]: [partial_sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true)), partial_count(1)] +Aggregate Attributes [3]: [sum#100, isEmpty#101, count#102] +Results [6]: [i_brand_id#96, i_class_id#97, i_category_id#98, sum#103, isEmpty#104, count#105] + +(106) Exchange +Input [6]: [i_brand_id#96, i_class_id#97, i_category_id#98, sum#103, isEmpty#104, count#105] +Arguments: hashpartitioning(i_brand_id#96, i_class_id#97, i_category_id#98, 5), ENSURE_REQUIREMENTS, [id=#106] + +(107) HashAggregate [codegen id : 78] +Input [6]: [i_brand_id#96, i_class_id#97, i_category_id#98, sum#103, isEmpty#104, count#105] +Keys [3]: [i_brand_id#96, i_class_id#97, i_category_id#98] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#107, count(1)#108] +Results [6]: [i_brand_id#96, i_class_id#97, i_category_id#98, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#107 AS sales#109, count(1)#108 AS number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#107 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#111] + +(108) Filter [codegen id : 78] +Input [6]: [i_brand_id#96, i_class_id#97, i_category_id#98, sales#109, number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#111] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#111) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#111 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(109) Project [codegen id : 78] +Output [6]: [web AS channel#112, i_brand_id#96, i_class_id#97, i_category_id#98, sales#109, number_sales#110] +Input [6]: [i_brand_id#96, i_class_id#97, i_category_id#98, sales#109, number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#92 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#93 as decimal(12,2)))), DecimalType(18,2), true))#111] + +(110) Union + +(111) HashAggregate [codegen id : 79] +Input [6]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sales#63, number_sales#64] +Keys [4]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48] +Functions [2]: [partial_sum(sales#63), partial_sum(number_sales#64)] +Aggregate Attributes [3]: [sum#113, isEmpty#114, sum#115] +Results [7]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum#116, isEmpty#117, sum#118] + +(112) Exchange +Input [7]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum#116, isEmpty#117, sum#118] +Arguments: hashpartitioning(channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, 5), ENSURE_REQUIREMENTS, [id=#119] + +(113) HashAggregate [codegen id : 80] +Input [7]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum#116, isEmpty#117, sum#118] +Keys [4]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48] +Functions [2]: [sum(sales#63), sum(number_sales#64)] +Aggregate Attributes [2]: [sum(sales#63)#120, sum(number_sales#64)#121] +Results [6]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum(sales#63)#120 AS sum_sales#122, sum(number_sales#64)#121 AS number_sales#123] + +(114) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#124, i_class_id#125, i_category_id#126, sum#127, isEmpty#128, count#129] + +(115) HashAggregate [codegen id : 106] +Input [6]: [i_brand_id#124, i_class_id#125, i_category_id#126, sum#127, isEmpty#128, count#129] +Keys [3]: [i_brand_id#124, i_class_id#125, i_category_id#126] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#130 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#131 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#130 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#131 as decimal(12,2)))), DecimalType(18,2), true))#132, count(1)#133] +Results [6]: [i_brand_id#124, i_class_id#125, i_category_id#126, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#130 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#131 as decimal(12,2)))), DecimalType(18,2), true))#132 AS sales#63, count(1)#133 AS number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#130 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#131 as decimal(12,2)))), DecimalType(18,2), true))#132 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#130 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#131 as decimal(12,2)))), DecimalType(18,2), true))#134] + +(116) Filter [codegen id : 106] +Input [6]: [i_brand_id#124, i_class_id#125, i_category_id#126, sales#63, number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#130 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#131 as decimal(12,2)))), DecimalType(18,2), true))#134] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#130 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#131 as decimal(12,2)))), DecimalType(18,2), true))#134) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#130 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#131 as decimal(12,2)))), DecimalType(18,2), true))#134 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(117) Project [codegen id : 106] +Output [6]: [store AS channel#68, i_brand_id#124, i_class_id#125, i_category_id#126, sales#63, number_sales#64] +Input [6]: [i_brand_id#124, i_class_id#125, i_category_id#126, sales#63, number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#130 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#131 as decimal(12,2)))), DecimalType(18,2), true))#134] + +(118) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#135, i_class_id#136, i_category_id#137, sum#138, isEmpty#139, count#140] + +(119) HashAggregate [codegen id : 132] +Input [6]: [i_brand_id#135, i_class_id#136, i_category_id#137, sum#138, isEmpty#139, count#140] +Keys [3]: [i_brand_id#135, i_class_id#136, i_category_id#137] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#141 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#142 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#141 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#142 as decimal(12,2)))), DecimalType(18,2), true))#143, count(1)#144] +Results [6]: [i_brand_id#135, i_class_id#136, i_category_id#137, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#141 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#142 as decimal(12,2)))), DecimalType(18,2), true))#143 AS sales#87, count(1)#144 AS number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#141 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#142 as decimal(12,2)))), DecimalType(18,2), true))#143 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#141 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#142 as decimal(12,2)))), DecimalType(18,2), true))#145] + +(120) Filter [codegen id : 132] +Input [6]: [i_brand_id#135, i_class_id#136, i_category_id#137, sales#87, number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#141 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#142 as decimal(12,2)))), DecimalType(18,2), true))#145] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#141 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#142 as decimal(12,2)))), DecimalType(18,2), true))#145) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#141 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#142 as decimal(12,2)))), DecimalType(18,2), true))#145 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(121) Project [codegen id : 132] +Output [6]: [catalog AS channel#90, i_brand_id#135, i_class_id#136, i_category_id#137, sales#87, number_sales#88] +Input [6]: [i_brand_id#135, i_class_id#136, i_category_id#137, sales#87, number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#141 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#142 as decimal(12,2)))), DecimalType(18,2), true))#145] + +(122) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#146, i_class_id#147, i_category_id#148, sum#149, isEmpty#150, count#151] + +(123) HashAggregate [codegen id : 158] +Input [6]: [i_brand_id#146, i_class_id#147, i_category_id#148, sum#149, isEmpty#150, count#151] +Keys [3]: [i_brand_id#146, i_class_id#147, i_category_id#148] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#152 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#153 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#152 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#153 as decimal(12,2)))), DecimalType(18,2), true))#154, count(1)#155] +Results [6]: [i_brand_id#146, i_class_id#147, i_category_id#148, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#152 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#153 as decimal(12,2)))), DecimalType(18,2), true))#154 AS sales#109, count(1)#155 AS number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#152 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#153 as decimal(12,2)))), DecimalType(18,2), true))#154 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#152 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#153 as decimal(12,2)))), DecimalType(18,2), true))#156] + +(124) Filter [codegen id : 158] +Input [6]: [i_brand_id#146, i_class_id#147, i_category_id#148, sales#109, number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#152 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#153 as decimal(12,2)))), DecimalType(18,2), true))#156] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#152 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#153 as decimal(12,2)))), DecimalType(18,2), true))#156) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#152 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#153 as decimal(12,2)))), DecimalType(18,2), true))#156 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(125) Project [codegen id : 158] +Output [6]: [web AS channel#112, i_brand_id#146, i_class_id#147, i_category_id#148, sales#109, number_sales#110] +Input [6]: [i_brand_id#146, i_class_id#147, i_category_id#148, sales#109, number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#152 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#153 as decimal(12,2)))), DecimalType(18,2), true))#156] + +(126) Union + +(127) HashAggregate [codegen id : 159] +Input [6]: [channel#68, i_brand_id#124, i_class_id#125, i_category_id#126, sales#63, number_sales#64] +Keys [4]: [channel#68, i_brand_id#124, i_class_id#125, i_category_id#126] +Functions [2]: [partial_sum(sales#63), partial_sum(number_sales#64)] +Aggregate Attributes [3]: [sum#157, isEmpty#158, sum#159] +Results [7]: [channel#68, i_brand_id#124, i_class_id#125, i_category_id#126, sum#160, isEmpty#161, sum#162] + +(128) Exchange +Input [7]: [channel#68, i_brand_id#124, i_class_id#125, i_category_id#126, sum#160, isEmpty#161, sum#162] +Arguments: hashpartitioning(channel#68, i_brand_id#124, i_class_id#125, i_category_id#126, 5), ENSURE_REQUIREMENTS, [id=#163] + +(129) HashAggregate [codegen id : 160] +Input [7]: [channel#68, i_brand_id#124, i_class_id#125, i_category_id#126, sum#160, isEmpty#161, sum#162] +Keys [4]: [channel#68, i_brand_id#124, i_class_id#125, i_category_id#126] +Functions [2]: [sum(sales#63), sum(number_sales#64)] +Aggregate Attributes [2]: [sum(sales#63)#164, sum(number_sales#64)#165] +Results [5]: [channel#68, i_brand_id#124, i_class_id#125, sum(sales#63)#164 AS sum_sales#122, sum(number_sales#64)#165 AS number_sales#123] + +(130) HashAggregate [codegen id : 160] +Input [5]: [channel#68, i_brand_id#124, i_class_id#125, sum_sales#122, number_sales#123] +Keys [3]: [channel#68, i_brand_id#124, i_class_id#125] +Functions [2]: [partial_sum(sum_sales#122), partial_sum(number_sales#123)] +Aggregate Attributes [3]: [sum#166, isEmpty#167, sum#168] +Results [6]: [channel#68, i_brand_id#124, i_class_id#125, sum#169, isEmpty#170, sum#171] + +(131) Exchange +Input [6]: [channel#68, i_brand_id#124, i_class_id#125, sum#169, isEmpty#170, sum#171] +Arguments: hashpartitioning(channel#68, i_brand_id#124, i_class_id#125, 5), ENSURE_REQUIREMENTS, [id=#172] + +(132) HashAggregate [codegen id : 161] +Input [6]: [channel#68, i_brand_id#124, i_class_id#125, sum#169, isEmpty#170, sum#171] +Keys [3]: [channel#68, i_brand_id#124, i_class_id#125] +Functions [2]: [sum(sum_sales#122), sum(number_sales#123)] +Aggregate Attributes [2]: [sum(sum_sales#122)#173, sum(number_sales#123)#174] +Results [6]: [channel#68, i_brand_id#124, i_class_id#125, null AS i_category_id#175, sum(sum_sales#122)#173 AS sum(sum_sales)#176, sum(number_sales#123)#174 AS sum(number_sales)#177] + +(133) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#178, i_class_id#179, i_category_id#180, sum#181, isEmpty#182, count#183] + +(134) HashAggregate [codegen id : 187] +Input [6]: [i_brand_id#178, i_class_id#179, i_category_id#180, sum#181, isEmpty#182, count#183] +Keys [3]: [i_brand_id#178, i_class_id#179, i_category_id#180] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#184 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#185 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#184 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#185 as decimal(12,2)))), DecimalType(18,2), true))#186, count(1)#187] +Results [6]: [i_brand_id#178, i_class_id#179, i_category_id#180, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#184 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#185 as decimal(12,2)))), DecimalType(18,2), true))#186 AS sales#63, count(1)#187 AS number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#184 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#185 as decimal(12,2)))), DecimalType(18,2), true))#186 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#184 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#185 as decimal(12,2)))), DecimalType(18,2), true))#188] + +(135) Filter [codegen id : 187] +Input [6]: [i_brand_id#178, i_class_id#179, i_category_id#180, sales#63, number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#184 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#185 as decimal(12,2)))), DecimalType(18,2), true))#188] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#184 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#185 as decimal(12,2)))), DecimalType(18,2), true))#188) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#184 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#185 as decimal(12,2)))), DecimalType(18,2), true))#188 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(136) Project [codegen id : 187] +Output [6]: [store AS channel#68, i_brand_id#178, i_class_id#179, i_category_id#180, sales#63, number_sales#64] +Input [6]: [i_brand_id#178, i_class_id#179, i_category_id#180, sales#63, number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#184 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#185 as decimal(12,2)))), DecimalType(18,2), true))#188] + +(137) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#189, i_class_id#190, i_category_id#191, sum#192, isEmpty#193, count#194] + +(138) HashAggregate [codegen id : 213] +Input [6]: [i_brand_id#189, i_class_id#190, i_category_id#191, sum#192, isEmpty#193, count#194] +Keys [3]: [i_brand_id#189, i_class_id#190, i_category_id#191] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#195 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#196 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#195 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#196 as decimal(12,2)))), DecimalType(18,2), true))#197, count(1)#198] +Results [6]: [i_brand_id#189, i_class_id#190, i_category_id#191, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#195 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#196 as decimal(12,2)))), DecimalType(18,2), true))#197 AS sales#87, count(1)#198 AS number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#195 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#196 as decimal(12,2)))), DecimalType(18,2), true))#197 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#195 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#196 as decimal(12,2)))), DecimalType(18,2), true))#199] + +(139) Filter [codegen id : 213] +Input [6]: [i_brand_id#189, i_class_id#190, i_category_id#191, sales#87, number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#195 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#196 as decimal(12,2)))), DecimalType(18,2), true))#199] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#195 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#196 as decimal(12,2)))), DecimalType(18,2), true))#199) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#195 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#196 as decimal(12,2)))), DecimalType(18,2), true))#199 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(140) Project [codegen id : 213] +Output [6]: [catalog AS channel#90, i_brand_id#189, i_class_id#190, i_category_id#191, sales#87, number_sales#88] +Input [6]: [i_brand_id#189, i_class_id#190, i_category_id#191, sales#87, number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#195 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#196 as decimal(12,2)))), DecimalType(18,2), true))#199] + +(141) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#200, i_class_id#201, i_category_id#202, sum#203, isEmpty#204, count#205] + +(142) HashAggregate [codegen id : 239] +Input [6]: [i_brand_id#200, i_class_id#201, i_category_id#202, sum#203, isEmpty#204, count#205] +Keys [3]: [i_brand_id#200, i_class_id#201, i_category_id#202] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#206 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#207 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#206 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#207 as decimal(12,2)))), DecimalType(18,2), true))#208, count(1)#209] +Results [6]: [i_brand_id#200, i_class_id#201, i_category_id#202, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#206 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#207 as decimal(12,2)))), DecimalType(18,2), true))#208 AS sales#109, count(1)#209 AS number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#206 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#207 as decimal(12,2)))), DecimalType(18,2), true))#208 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#206 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#207 as decimal(12,2)))), DecimalType(18,2), true))#210] + +(143) Filter [codegen id : 239] +Input [6]: [i_brand_id#200, i_class_id#201, i_category_id#202, sales#109, number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#206 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#207 as decimal(12,2)))), DecimalType(18,2), true))#210] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#206 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#207 as decimal(12,2)))), DecimalType(18,2), true))#210) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#206 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#207 as decimal(12,2)))), DecimalType(18,2), true))#210 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(144) Project [codegen id : 239] +Output [6]: [web AS channel#112, i_brand_id#200, i_class_id#201, i_category_id#202, sales#109, number_sales#110] +Input [6]: [i_brand_id#200, i_class_id#201, i_category_id#202, sales#109, number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#206 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#207 as decimal(12,2)))), DecimalType(18,2), true))#210] + +(145) Union + +(146) HashAggregate [codegen id : 240] +Input [6]: [channel#68, i_brand_id#178, i_class_id#179, i_category_id#180, sales#63, number_sales#64] +Keys [4]: [channel#68, i_brand_id#178, i_class_id#179, i_category_id#180] +Functions [2]: [partial_sum(sales#63), partial_sum(number_sales#64)] +Aggregate Attributes [3]: [sum#211, isEmpty#212, sum#213] +Results [7]: [channel#68, i_brand_id#178, i_class_id#179, i_category_id#180, sum#214, isEmpty#215, sum#216] + +(147) Exchange +Input [7]: [channel#68, i_brand_id#178, i_class_id#179, i_category_id#180, sum#214, isEmpty#215, sum#216] +Arguments: hashpartitioning(channel#68, i_brand_id#178, i_class_id#179, i_category_id#180, 5), ENSURE_REQUIREMENTS, [id=#217] + +(148) HashAggregate [codegen id : 241] +Input [7]: [channel#68, i_brand_id#178, i_class_id#179, i_category_id#180, sum#214, isEmpty#215, sum#216] +Keys [4]: [channel#68, i_brand_id#178, i_class_id#179, i_category_id#180] +Functions [2]: [sum(sales#63), sum(number_sales#64)] +Aggregate Attributes [2]: [sum(sales#63)#218, sum(number_sales#64)#219] +Results [4]: [channel#68, i_brand_id#178, sum(sales#63)#218 AS sum_sales#122, sum(number_sales#64)#219 AS number_sales#123] + +(149) HashAggregate [codegen id : 241] +Input [4]: [channel#68, i_brand_id#178, sum_sales#122, number_sales#123] +Keys [2]: [channel#68, i_brand_id#178] +Functions [2]: [partial_sum(sum_sales#122), partial_sum(number_sales#123)] +Aggregate Attributes [3]: [sum#220, isEmpty#221, sum#222] +Results [5]: [channel#68, i_brand_id#178, sum#223, isEmpty#224, sum#225] + +(150) Exchange +Input [5]: [channel#68, i_brand_id#178, sum#223, isEmpty#224, sum#225] +Arguments: hashpartitioning(channel#68, i_brand_id#178, 5), ENSURE_REQUIREMENTS, [id=#226] + +(151) HashAggregate [codegen id : 242] +Input [5]: [channel#68, i_brand_id#178, sum#223, isEmpty#224, sum#225] +Keys [2]: [channel#68, i_brand_id#178] +Functions [2]: [sum(sum_sales#122), sum(number_sales#123)] +Aggregate Attributes [2]: [sum(sum_sales#122)#227, sum(number_sales#123)#228] +Results [6]: [channel#68, i_brand_id#178, null AS i_class_id#229, null AS i_category_id#230, sum(sum_sales#122)#227 AS sum(sum_sales)#231, sum(number_sales#123)#228 AS sum(number_sales)#232] + +(152) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#233, i_class_id#234, i_category_id#235, sum#236, isEmpty#237, count#238] + +(153) HashAggregate [codegen id : 268] +Input [6]: [i_brand_id#233, i_class_id#234, i_category_id#235, sum#236, isEmpty#237, count#238] +Keys [3]: [i_brand_id#233, i_class_id#234, i_category_id#235] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#239 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#240 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#239 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#240 as decimal(12,2)))), DecimalType(18,2), true))#241, count(1)#242] +Results [6]: [i_brand_id#233, i_class_id#234, i_category_id#235, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#239 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#240 as decimal(12,2)))), DecimalType(18,2), true))#241 AS sales#63, count(1)#242 AS number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#239 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#240 as decimal(12,2)))), DecimalType(18,2), true))#241 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#239 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#240 as decimal(12,2)))), DecimalType(18,2), true))#243] + +(154) Filter [codegen id : 268] +Input [6]: [i_brand_id#233, i_class_id#234, i_category_id#235, sales#63, number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#239 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#240 as decimal(12,2)))), DecimalType(18,2), true))#243] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#239 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#240 as decimal(12,2)))), DecimalType(18,2), true))#243) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#239 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#240 as decimal(12,2)))), DecimalType(18,2), true))#243 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(155) Project [codegen id : 268] +Output [6]: [store AS channel#68, i_brand_id#233, i_class_id#234, i_category_id#235, sales#63, number_sales#64] +Input [6]: [i_brand_id#233, i_class_id#234, i_category_id#235, sales#63, number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#239 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#240 as decimal(12,2)))), DecimalType(18,2), true))#243] + +(156) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#244, i_class_id#245, i_category_id#246, sum#247, isEmpty#248, count#249] + +(157) HashAggregate [codegen id : 294] +Input [6]: [i_brand_id#244, i_class_id#245, i_category_id#246, sum#247, isEmpty#248, count#249] +Keys [3]: [i_brand_id#244, i_class_id#245, i_category_id#246] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#250 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#251 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#250 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#251 as decimal(12,2)))), DecimalType(18,2), true))#252, count(1)#253] +Results [6]: [i_brand_id#244, i_class_id#245, i_category_id#246, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#250 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#251 as decimal(12,2)))), DecimalType(18,2), true))#252 AS sales#87, count(1)#253 AS number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#250 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#251 as decimal(12,2)))), DecimalType(18,2), true))#252 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#250 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#251 as decimal(12,2)))), DecimalType(18,2), true))#254] + +(158) Filter [codegen id : 294] +Input [6]: [i_brand_id#244, i_class_id#245, i_category_id#246, sales#87, number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#250 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#251 as decimal(12,2)))), DecimalType(18,2), true))#254] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#250 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#251 as decimal(12,2)))), DecimalType(18,2), true))#254) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#250 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#251 as decimal(12,2)))), DecimalType(18,2), true))#254 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(159) Project [codegen id : 294] +Output [6]: [catalog AS channel#90, i_brand_id#244, i_class_id#245, i_category_id#246, sales#87, number_sales#88] +Input [6]: [i_brand_id#244, i_class_id#245, i_category_id#246, sales#87, number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#250 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#251 as decimal(12,2)))), DecimalType(18,2), true))#254] + +(160) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#255, i_class_id#256, i_category_id#257, sum#258, isEmpty#259, count#260] + +(161) HashAggregate [codegen id : 320] +Input [6]: [i_brand_id#255, i_class_id#256, i_category_id#257, sum#258, isEmpty#259, count#260] +Keys [3]: [i_brand_id#255, i_class_id#256, i_category_id#257] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#262 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#262 as decimal(12,2)))), DecimalType(18,2), true))#263, count(1)#264] +Results [6]: [i_brand_id#255, i_class_id#256, i_category_id#257, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#262 as decimal(12,2)))), DecimalType(18,2), true))#263 AS sales#109, count(1)#264 AS number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#262 as decimal(12,2)))), DecimalType(18,2), true))#263 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#262 as decimal(12,2)))), DecimalType(18,2), true))#265] + +(162) Filter [codegen id : 320] +Input [6]: [i_brand_id#255, i_class_id#256, i_category_id#257, sales#109, number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#262 as decimal(12,2)))), DecimalType(18,2), true))#265] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#262 as decimal(12,2)))), DecimalType(18,2), true))#265) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#262 as decimal(12,2)))), DecimalType(18,2), true))#265 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(163) Project [codegen id : 320] +Output [6]: [web AS channel#112, i_brand_id#255, i_class_id#256, i_category_id#257, sales#109, number_sales#110] +Input [6]: [i_brand_id#255, i_class_id#256, i_category_id#257, sales#109, number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#261 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#262 as decimal(12,2)))), DecimalType(18,2), true))#265] + +(164) Union + +(165) HashAggregate [codegen id : 321] +Input [6]: [channel#68, i_brand_id#233, i_class_id#234, i_category_id#235, sales#63, number_sales#64] +Keys [4]: [channel#68, i_brand_id#233, i_class_id#234, i_category_id#235] +Functions [2]: [partial_sum(sales#63), partial_sum(number_sales#64)] +Aggregate Attributes [3]: [sum#266, isEmpty#267, sum#268] +Results [7]: [channel#68, i_brand_id#233, i_class_id#234, i_category_id#235, sum#269, isEmpty#270, sum#271] + +(166) Exchange +Input [7]: [channel#68, i_brand_id#233, i_class_id#234, i_category_id#235, sum#269, isEmpty#270, sum#271] +Arguments: hashpartitioning(channel#68, i_brand_id#233, i_class_id#234, i_category_id#235, 5), ENSURE_REQUIREMENTS, [id=#272] + +(167) HashAggregate [codegen id : 322] +Input [7]: [channel#68, i_brand_id#233, i_class_id#234, i_category_id#235, sum#269, isEmpty#270, sum#271] +Keys [4]: [channel#68, i_brand_id#233, i_class_id#234, i_category_id#235] +Functions [2]: [sum(sales#63), sum(number_sales#64)] +Aggregate Attributes [2]: [sum(sales#63)#273, sum(number_sales#64)#274] +Results [3]: [channel#68, sum(sales#63)#273 AS sum_sales#122, sum(number_sales#64)#274 AS number_sales#123] + +(168) HashAggregate [codegen id : 322] +Input [3]: [channel#68, sum_sales#122, number_sales#123] +Keys [1]: [channel#68] +Functions [2]: [partial_sum(sum_sales#122), partial_sum(number_sales#123)] +Aggregate Attributes [3]: [sum#275, isEmpty#276, sum#277] +Results [4]: [channel#68, sum#278, isEmpty#279, sum#280] + +(169) Exchange +Input [4]: [channel#68, sum#278, isEmpty#279, sum#280] +Arguments: hashpartitioning(channel#68, 5), ENSURE_REQUIREMENTS, [id=#281] + +(170) HashAggregate [codegen id : 323] +Input [4]: [channel#68, sum#278, isEmpty#279, sum#280] +Keys [1]: [channel#68] +Functions [2]: [sum(sum_sales#122), sum(number_sales#123)] +Aggregate Attributes [2]: [sum(sum_sales#122)#282, sum(number_sales#123)#283] +Results [6]: [channel#68, null AS i_brand_id#284, null AS i_class_id#285, null AS i_category_id#286, sum(sum_sales#122)#282 AS sum(sum_sales)#287, sum(number_sales#123)#283 AS sum(number_sales)#288] + +(171) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#289, i_class_id#290, i_category_id#291, sum#292, isEmpty#293, count#294] + +(172) HashAggregate [codegen id : 349] +Input [6]: [i_brand_id#289, i_class_id#290, i_category_id#291, sum#292, isEmpty#293, count#294] +Keys [3]: [i_brand_id#289, i_class_id#290, i_category_id#291] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#295 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#296 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#295 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#296 as decimal(12,2)))), DecimalType(18,2), true))#297, count(1)#298] +Results [6]: [i_brand_id#289, i_class_id#290, i_category_id#291, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#295 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#296 as decimal(12,2)))), DecimalType(18,2), true))#297 AS sales#63, count(1)#298 AS number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#295 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#296 as decimal(12,2)))), DecimalType(18,2), true))#297 AS sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#295 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#296 as decimal(12,2)))), DecimalType(18,2), true))#299] + +(173) Filter [codegen id : 349] +Input [6]: [i_brand_id#289, i_class_id#290, i_category_id#291, sales#63, number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#295 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#296 as decimal(12,2)))), DecimalType(18,2), true))#299] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#295 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#296 as decimal(12,2)))), DecimalType(18,2), true))#299) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#295 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#296 as decimal(12,2)))), DecimalType(18,2), true))#299 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(174) Project [codegen id : 349] +Output [6]: [store AS channel#68, i_brand_id#289, i_class_id#290, i_category_id#291, sales#63, number_sales#64] +Input [6]: [i_brand_id#289, i_class_id#290, i_category_id#291, sales#63, number_sales#64, sum(CheckOverflow((promote_precision(cast(cast(ss_quantity#295 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price#296 as decimal(12,2)))), DecimalType(18,2), true))#299] + +(175) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#300, i_class_id#301, i_category_id#302, sum#303, isEmpty#304, count#305] + +(176) HashAggregate [codegen id : 375] +Input [6]: [i_brand_id#300, i_class_id#301, i_category_id#302, sum#303, isEmpty#304, count#305] +Keys [3]: [i_brand_id#300, i_class_id#301, i_category_id#302] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#306 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#307 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#306 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#307 as decimal(12,2)))), DecimalType(18,2), true))#308, count(1)#309] +Results [6]: [i_brand_id#300, i_class_id#301, i_category_id#302, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#306 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#307 as decimal(12,2)))), DecimalType(18,2), true))#308 AS sales#87, count(1)#309 AS number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#306 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#307 as decimal(12,2)))), DecimalType(18,2), true))#308 AS sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#306 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#307 as decimal(12,2)))), DecimalType(18,2), true))#310] + +(177) Filter [codegen id : 375] +Input [6]: [i_brand_id#300, i_class_id#301, i_category_id#302, sales#87, number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#306 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#307 as decimal(12,2)))), DecimalType(18,2), true))#310] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#306 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#307 as decimal(12,2)))), DecimalType(18,2), true))#310) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#306 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#307 as decimal(12,2)))), DecimalType(18,2), true))#310 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(178) Project [codegen id : 375] +Output [6]: [catalog AS channel#90, i_brand_id#300, i_class_id#301, i_category_id#302, sales#87, number_sales#88] +Input [6]: [i_brand_id#300, i_class_id#301, i_category_id#302, sales#87, number_sales#88, sum(CheckOverflow((promote_precision(cast(cast(cs_quantity#306 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price#307 as decimal(12,2)))), DecimalType(18,2), true))#310] + +(179) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_brand_id#311, i_class_id#312, i_category_id#313, sum#314, isEmpty#315, count#316] + +(180) HashAggregate [codegen id : 401] +Input [6]: [i_brand_id#311, i_class_id#312, i_category_id#313, sum#314, isEmpty#315, count#316] +Keys [3]: [i_brand_id#311, i_class_id#312, i_category_id#313] +Functions [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#317 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#318 as decimal(12,2)))), DecimalType(18,2), true)), count(1)] +Aggregate Attributes [2]: [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#317 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#318 as decimal(12,2)))), DecimalType(18,2), true))#319, count(1)#320] +Results [6]: [i_brand_id#311, i_class_id#312, i_category_id#313, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#317 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#318 as decimal(12,2)))), DecimalType(18,2), true))#319 AS sales#109, count(1)#320 AS number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#317 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#318 as decimal(12,2)))), DecimalType(18,2), true))#319 AS sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#317 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#318 as decimal(12,2)))), DecimalType(18,2), true))#321] + +(181) Filter [codegen id : 401] +Input [6]: [i_brand_id#311, i_class_id#312, i_category_id#313, sales#109, number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#317 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#318 as decimal(12,2)))), DecimalType(18,2), true))#321] +Condition : (isnotnull(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#317 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#318 as decimal(12,2)))), DecimalType(18,2), true))#321) AND (cast(sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#317 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#318 as decimal(12,2)))), DecimalType(18,2), true))#321 as decimal(32,6)) > cast(ReusedSubquery Subquery scalar-subquery#66, [id=#67] as decimal(32,6)))) + +(182) Project [codegen id : 401] +Output [6]: [web AS channel#112, i_brand_id#311, i_class_id#312, i_category_id#313, sales#109, number_sales#110] +Input [6]: [i_brand_id#311, i_class_id#312, i_category_id#313, sales#109, number_sales#110, sum(CheckOverflow((promote_precision(cast(cast(ws_quantity#317 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price#318 as decimal(12,2)))), DecimalType(18,2), true))#321] + +(183) Union + +(184) HashAggregate [codegen id : 402] +Input [6]: [channel#68, i_brand_id#289, i_class_id#290, i_category_id#291, sales#63, number_sales#64] +Keys [4]: [channel#68, i_brand_id#289, i_class_id#290, i_category_id#291] +Functions [2]: [partial_sum(sales#63), partial_sum(number_sales#64)] +Aggregate Attributes [3]: [sum#322, isEmpty#323, sum#324] +Results [7]: [channel#68, i_brand_id#289, i_class_id#290, i_category_id#291, sum#325, isEmpty#326, sum#327] + +(185) Exchange +Input [7]: [channel#68, i_brand_id#289, i_class_id#290, i_category_id#291, sum#325, isEmpty#326, sum#327] +Arguments: hashpartitioning(channel#68, i_brand_id#289, i_class_id#290, i_category_id#291, 5), ENSURE_REQUIREMENTS, [id=#328] + +(186) HashAggregate [codegen id : 403] +Input [7]: [channel#68, i_brand_id#289, i_class_id#290, i_category_id#291, sum#325, isEmpty#326, sum#327] +Keys [4]: [channel#68, i_brand_id#289, i_class_id#290, i_category_id#291] +Functions [2]: [sum(sales#63), sum(number_sales#64)] +Aggregate Attributes [2]: [sum(sales#63)#329, sum(number_sales#64)#330] +Results [2]: [sum(sales#63)#329 AS sum_sales#122, sum(number_sales#64)#330 AS number_sales#123] + +(187) HashAggregate [codegen id : 403] +Input [2]: [sum_sales#122, number_sales#123] +Keys: [] +Functions [2]: [partial_sum(sum_sales#122), partial_sum(number_sales#123)] +Aggregate Attributes [3]: [sum#331, isEmpty#332, sum#333] +Results [3]: [sum#334, isEmpty#335, sum#336] + +(188) Exchange +Input [3]: [sum#334, isEmpty#335, sum#336] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#337] + +(189) HashAggregate [codegen id : 404] +Input [3]: [sum#334, isEmpty#335, sum#336] +Keys: [] +Functions [2]: [sum(sum_sales#122), sum(number_sales#123)] +Aggregate Attributes [2]: [sum(sum_sales#122)#338, sum(number_sales#123)#339] +Results [6]: [null AS channel#340, null AS i_brand_id#341, null AS i_class_id#342, null AS i_category_id#343, sum(sum_sales#122)#338 AS sum(sum_sales)#344, sum(number_sales#123)#339 AS sum(number_sales)#345] + +(190) Union + +(191) HashAggregate [codegen id : 405] +Input [6]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum_sales#122, number_sales#123] +Keys [6]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum_sales#122, number_sales#123] +Functions: [] +Aggregate Attributes: [] +Results [6]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum_sales#122, number_sales#123] + +(192) Exchange +Input [6]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum_sales#122, number_sales#123] +Arguments: hashpartitioning(channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum_sales#122, number_sales#123, 5), ENSURE_REQUIREMENTS, [id=#346] + +(193) HashAggregate [codegen id : 406] +Input [6]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum_sales#122, number_sales#123] +Keys [6]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum_sales#122, number_sales#123] +Functions: [] +Aggregate Attributes: [] +Results [6]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum_sales#122, number_sales#123] + +(194) TakeOrderedAndProject +Input [6]: [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum_sales#122, number_sales#123] +Arguments: 100, [channel#68 ASC NULLS FIRST, i_brand_id#46 ASC NULLS FIRST, i_class_id#47 ASC NULLS FIRST, i_category_id#48 ASC NULLS FIRST], [channel#68, i_brand_id#46, i_class_id#47, i_category_id#48, sum_sales#122, number_sales#123] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 76 Hosting Expression = Subquery scalar-subquery#66, [id=#67] +* HashAggregate (221) ++- Exchange (220) + +- * HashAggregate (219) + +- Union (218) + :- * Project (203) + : +- * BroadcastHashJoin Inner BuildRight (202) + : :- * ColumnarToRow (196) + : : +- Scan parquet default.store_sales (195) + : +- BroadcastExchange (201) + : +- * Project (200) + : +- * Filter (199) + : +- * ColumnarToRow (198) + : +- Scan parquet default.date_dim (197) + :- * Project (212) + : +- * BroadcastHashJoin Inner BuildRight (211) + : :- * ColumnarToRow (205) + : : +- Scan parquet default.catalog_sales (204) + : +- BroadcastExchange (210) + : +- * Project (209) + : +- * Filter (208) + : +- * ColumnarToRow (207) + : +- Scan parquet default.date_dim (206) + +- * Project (217) + +- * BroadcastHashJoin Inner BuildRight (216) + :- * ColumnarToRow (214) + : +- Scan parquet default.web_sales (213) + +- ReusedExchange (215) + + +(195) Scan parquet default.store_sales +Output [3]: [ss_quantity#347, ss_list_price#348, ss_sold_date_sk#349] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#349), dynamicpruningexpression(ss_sold_date_sk#349 IN dynamicpruning#350)] +ReadSchema: struct + +(196) ColumnarToRow [codegen id : 2] +Input [3]: [ss_quantity#347, ss_list_price#348, ss_sold_date_sk#349] + +(197) Scan parquet default.date_dim +Output [2]: [d_date_sk#351, d_year#352] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1999), LessThanOrEqual(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(198) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#351, d_year#352] + +(199) Filter [codegen id : 1] +Input [2]: [d_date_sk#351, d_year#352] +Condition : (((isnotnull(d_year#352) AND (d_year#352 >= 1999)) AND (d_year#352 <= 2001)) AND isnotnull(d_date_sk#351)) + +(200) Project [codegen id : 1] +Output [1]: [d_date_sk#351] +Input [2]: [d_date_sk#351, d_year#352] + +(201) BroadcastExchange +Input [1]: [d_date_sk#351] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#353] + +(202) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#349] +Right keys [1]: [d_date_sk#351] +Join condition: None + +(203) Project [codegen id : 2] +Output [2]: [ss_quantity#347 AS quantity#354, ss_list_price#348 AS list_price#355] +Input [4]: [ss_quantity#347, ss_list_price#348, ss_sold_date_sk#349, d_date_sk#351] + +(204) Scan parquet default.catalog_sales +Output [3]: [cs_quantity#356, cs_list_price#357, cs_sold_date_sk#358] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#358), dynamicpruningexpression(cs_sold_date_sk#358 IN dynamicpruning#359)] +ReadSchema: struct + +(205) ColumnarToRow [codegen id : 4] +Input [3]: [cs_quantity#356, cs_list_price#357, cs_sold_date_sk#358] + +(206) Scan parquet default.date_dim +Output [2]: [d_date_sk#360, d_year#361] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), GreaterThanOrEqual(d_year,1998), LessThanOrEqual(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(207) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#360, d_year#361] + +(208) Filter [codegen id : 3] +Input [2]: [d_date_sk#360, d_year#361] +Condition : (((isnotnull(d_year#361) AND (d_year#361 >= 1998)) AND (d_year#361 <= 2000)) AND isnotnull(d_date_sk#360)) + +(209) Project [codegen id : 3] +Output [1]: [d_date_sk#360] +Input [2]: [d_date_sk#360, d_year#361] + +(210) BroadcastExchange +Input [1]: [d_date_sk#360] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#362] + +(211) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#358] +Right keys [1]: [d_date_sk#360] +Join condition: None + +(212) Project [codegen id : 4] +Output [2]: [cs_quantity#356 AS quantity#363, cs_list_price#357 AS list_price#364] +Input [4]: [cs_quantity#356, cs_list_price#357, cs_sold_date_sk#358, d_date_sk#360] + +(213) Scan parquet default.web_sales +Output [3]: [ws_quantity#365, ws_list_price#366, ws_sold_date_sk#367] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#367), dynamicpruningexpression(ws_sold_date_sk#367 IN dynamicpruning#359)] +ReadSchema: struct + +(214) ColumnarToRow [codegen id : 6] +Input [3]: [ws_quantity#365, ws_list_price#366, ws_sold_date_sk#367] + +(215) ReusedExchange [Reuses operator id: 210] +Output [1]: [d_date_sk#368] + +(216) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ws_sold_date_sk#367] +Right keys [1]: [d_date_sk#368] +Join condition: None + +(217) Project [codegen id : 6] +Output [2]: [ws_quantity#365 AS quantity#369, ws_list_price#366 AS list_price#370] +Input [4]: [ws_quantity#365, ws_list_price#366, ws_sold_date_sk#367, d_date_sk#368] + +(218) Union + +(219) HashAggregate [codegen id : 7] +Input [2]: [quantity#354, list_price#355] +Keys: [] +Functions [1]: [partial_avg(CheckOverflow((promote_precision(cast(cast(quantity#354 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#355 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [2]: [sum#371, count#372] +Results [2]: [sum#373, count#374] + +(220) Exchange +Input [2]: [sum#373, count#374] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#375] + +(221) HashAggregate [codegen id : 8] +Input [2]: [sum#373, count#374] +Keys: [] +Functions [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#354 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#355 as decimal(12,2)))), DecimalType(18,2), true))] +Aggregate Attributes [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#354 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#355 as decimal(12,2)))), DecimalType(18,2), true))#376] +Results [1]: [avg(CheckOverflow((promote_precision(cast(cast(quantity#354 as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price#355 as decimal(12,2)))), DecimalType(18,2), true))#376 AS average_sales#377] + +Subquery:2 Hosting operator id = 195 Hosting Expression = ss_sold_date_sk#349 IN dynamicpruning#350 +ReusedExchange (222) + + +(222) ReusedExchange [Reuses operator id: 201] +Output [1]: [d_date_sk#351] + +Subquery:3 Hosting operator id = 204 Hosting Expression = cs_sold_date_sk#358 IN dynamicpruning#359 +ReusedExchange (223) + + +(223) ReusedExchange [Reuses operator id: 210] +Output [1]: [d_date_sk#360] + +Subquery:4 Hosting operator id = 213 Hosting Expression = ws_sold_date_sk#367 IN dynamicpruning#359 + +Subquery:5 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (224) + + +(224) ReusedExchange [Reuses operator id: 70] +Output [1]: [d_date_sk#50] + +Subquery:6 Hosting operator id = 7 Hosting Expression = ss_sold_date_sk#11 IN dynamicpruning#12 +ReusedExchange (225) + + +(225) ReusedExchange [Reuses operator id: 26] +Output [1]: [d_date_sk#29] + +Subquery:7 Hosting operator id = 13 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#12 + +Subquery:8 Hosting operator id = 40 Hosting Expression = ws_sold_date_sk#35 IN dynamicpruning#12 + +Subquery:9 Hosting operator id = 92 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:10 Hosting operator id = 78 Hosting Expression = cs_sold_date_sk#72 IN dynamicpruning#5 + +Subquery:11 Hosting operator id = 108 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:12 Hosting operator id = 94 Hosting Expression = ws_sold_date_sk#94 IN dynamicpruning#5 + +Subquery:13 Hosting operator id = 116 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:14 Hosting operator id = 120 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:15 Hosting operator id = 124 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:16 Hosting operator id = 135 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:17 Hosting operator id = 139 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:18 Hosting operator id = 143 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:19 Hosting operator id = 154 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:20 Hosting operator id = 158 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:21 Hosting operator id = 162 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:22 Hosting operator id = 173 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:23 Hosting operator id = 177 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + +Subquery:24 Hosting operator id = 181 Hosting Expression = ReusedSubquery Subquery scalar-subquery#66, [id=#67] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/simplified.txt new file mode 100644 index 0000000000000..e351f9e687027 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q14a/simplified.txt @@ -0,0 +1,373 @@ +TakeOrderedAndProject [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + WholeStageCodegen (406) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] #1 + WholeStageCodegen (405) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum_sales,number_sales] + InputAdapter + Union + WholeStageCodegen (80) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id] #2 + WholeStageCodegen (79) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + InputAdapter + Union + WholeStageCodegen (26) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + Subquery #3 + WholeStageCodegen (8) + HashAggregate [sum,count] [avg(CheckOverflow((promote_precision(cast(cast(quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(list_price as decimal(12,2)))), DecimalType(18,2), true)),average_sales,sum,count] + InputAdapter + Exchange #15 + WholeStageCodegen (7) + HashAggregate [quantity,list_price] [sum,count,sum,count] + InputAdapter + Union + WholeStageCodegen (2) + Project [ss_quantity,ss_list_price] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #4 + ReusedExchange [d_date_sk] #16 + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + WholeStageCodegen (4) + Project [cs_quantity,cs_list_price] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_quantity,cs_list_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #5 + ReusedExchange [d_date_sk] #17 + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + WholeStageCodegen (6) + Project [ws_quantity,ws_list_price] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #5 + InputAdapter + ReusedExchange [d_date_sk] #17 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #3 + WholeStageCodegen (25) + HashAggregate [i_brand_id,i_class_id,i_category_id,ss_quantity,ss_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ss_quantity,ss_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_quantity,ss_list_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + BroadcastHashJoin [ss_item_sk,ss_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_quantity,ss_list_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (11) + Project [i_item_sk] + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,brand_id,class_id,category_id] + Filter [i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (10) + HashAggregate [brand_id,class_id,category_id] + HashAggregate [brand_id,class_id,category_id] + BroadcastHashJoin [brand_id,class_id,category_id,i_brand_id,i_class_id,i_category_id] + HashAggregate [brand_id,class_id,category_id] + InputAdapter + Exchange [brand_id,class_id,category_id] #7 + WholeStageCodegen (6) + HashAggregate [brand_id,class_id,category_id] + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk] #8 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (4) + BroadcastHashJoin [i_brand_id,i_class_id,i_category_id,i_brand_id,i_class_id,i_category_id] + Filter [i_item_sk,i_brand_id,i_class_id,i_category_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (3) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (1) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + ReusedExchange [d_date_sk] #8 + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (9) + Project [i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #11 + InputAdapter + ReusedExchange [d_date_sk] #8 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (23) + BroadcastHashJoin [i_item_sk,ss_item_sk] + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id] + InputAdapter + ReusedExchange [ss_item_sk] #14 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (24) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (52) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #18 + WholeStageCodegen (51) + HashAggregate [i_brand_id,i_class_id,i_category_id,cs_quantity,cs_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [cs_quantity,cs_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_quantity,cs_list_price,cs_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + BroadcastHashJoin [cs_item_sk,ss_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_quantity,cs_list_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [ss_item_sk] #14 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #13 + InputAdapter + ReusedExchange [d_date_sk] #4 + WholeStageCodegen (78) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id] #19 + WholeStageCodegen (77) + HashAggregate [i_brand_id,i_class_id,i_category_id,ws_quantity,ws_list_price] [sum,isEmpty,count,sum,isEmpty,count] + Project [ws_quantity,ws_list_price,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_quantity,ws_list_price,ws_sold_date_sk,i_brand_id,i_class_id,i_category_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + BroadcastHashJoin [ws_item_sk,ss_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_quantity,ws_list_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [ss_item_sk] #14 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id] #13 + InputAdapter + ReusedExchange [d_date_sk] #4 + WholeStageCodegen (161) + HashAggregate [channel,i_brand_id,i_class_id,sum,isEmpty,sum] [sum(sum_sales),sum(number_salesL),i_category_id,sum(sum_sales),sum(number_sales),sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id] #20 + WholeStageCodegen (160) + HashAggregate [channel,i_brand_id,i_class_id,sum_sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id] #21 + WholeStageCodegen (159) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + InputAdapter + Union + WholeStageCodegen (106) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #22 + WholeStageCodegen (132) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #23 + WholeStageCodegen (158) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #24 + WholeStageCodegen (242) + HashAggregate [channel,i_brand_id,sum,isEmpty,sum] [sum(sum_sales),sum(number_salesL),i_class_id,i_category_id,sum(sum_sales),sum(number_sales),sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id] #25 + WholeStageCodegen (241) + HashAggregate [channel,i_brand_id,sum_sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id] #26 + WholeStageCodegen (240) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + InputAdapter + Union + WholeStageCodegen (187) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #22 + WholeStageCodegen (213) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #23 + WholeStageCodegen (239) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #24 + WholeStageCodegen (323) + HashAggregate [channel,sum,isEmpty,sum] [sum(sum_sales),sum(number_salesL),i_brand_id,i_class_id,i_category_id,sum(sum_sales),sum(number_sales),sum,isEmpty,sum] + InputAdapter + Exchange [channel] #27 + WholeStageCodegen (322) + HashAggregate [channel,sum_sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id] #28 + WholeStageCodegen (321) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + InputAdapter + Union + WholeStageCodegen (268) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #22 + WholeStageCodegen (294) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #23 + WholeStageCodegen (320) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #24 + WholeStageCodegen (404) + HashAggregate [sum,isEmpty,sum] [sum(sum_sales),sum(number_salesL),channel,i_brand_id,i_class_id,i_category_id,sum(sum_sales),sum(number_sales),sum,isEmpty,sum] + InputAdapter + Exchange #29 + WholeStageCodegen (403) + HashAggregate [sum_sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sum,isEmpty,sum] [sum(sales),sum(number_salesL),sum_sales,number_sales,sum,isEmpty,sum] + InputAdapter + Exchange [channel,i_brand_id,i_class_id,i_category_id] #30 + WholeStageCodegen (402) + HashAggregate [channel,i_brand_id,i_class_id,i_category_id,sales,number_sales] [sum,isEmpty,sum,sum,isEmpty,sum] + InputAdapter + Union + WholeStageCodegen (349) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ss_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #22 + WholeStageCodegen (375) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(cs_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(cs_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #23 + WholeStageCodegen (401) + Project [i_brand_id,i_class_id,i_category_id,sales,number_sales] + Filter [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true))] + ReusedSubquery [average_sales] #3 + HashAggregate [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] [sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),count(1),sales,number_sales,sum(CheckOverflow((promote_precision(cast(cast(ws_quantity as decimal(10,0)) as decimal(12,2))) * promote_precision(cast(ws_list_price as decimal(12,2)))), DecimalType(18,2), true)),sum,isEmpty,count] + InputAdapter + ReusedExchange [i_brand_id,i_class_id,i_category_id,sum,isEmpty,count] #24 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/explain.txt new file mode 100644 index 0000000000000..35e3304de7082 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/explain.txt @@ -0,0 +1,894 @@ +== Physical Plan == +TakeOrderedAndProject (160) ++- Union (159) + :- * HashAggregate (51) + : +- Exchange (50) + : +- * HashAggregate (49) + : +- * Project (48) + : +- * SortMergeJoin Inner (47) + : :- * Sort (25) + : : +- Exchange (24) + : : +- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Project (17) + : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.customer_demographics (4) + : : : +- BroadcastExchange (15) + : : : +- * Project (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.date_dim (11) + : : +- BroadcastExchange (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.item (18) + : +- * Sort (46) + : +- Exchange (45) + : +- * Project (44) + : +- * SortMergeJoin Inner (43) + : :- * Sort (37) + : : +- Exchange (36) + : : +- * Project (35) + : : +- * BroadcastHashJoin Inner BuildRight (34) + : : :- * Project (29) + : : : +- * Filter (28) + : : : +- * ColumnarToRow (27) + : : : +- Scan parquet default.customer (26) + : : +- BroadcastExchange (33) + : : +- * Filter (32) + : : +- * ColumnarToRow (31) + : : +- Scan parquet default.customer_address (30) + : +- * Sort (42) + : +- Exchange (41) + : +- * Filter (40) + : +- * ColumnarToRow (39) + : +- Scan parquet default.customer_demographics (38) + :- * HashAggregate (76) + : +- Exchange (75) + : +- * HashAggregate (74) + : +- * Project (73) + : +- * SortMergeJoin Inner (72) + : :- * Sort (53) + : : +- ReusedExchange (52) + : +- * Sort (71) + : +- Exchange (70) + : +- * Project (69) + : +- * SortMergeJoin Inner (68) + : :- * Sort (65) + : : +- Exchange (64) + : : +- * Project (63) + : : +- * BroadcastHashJoin Inner BuildRight (62) + : : :- * Project (57) + : : : +- * Filter (56) + : : : +- * ColumnarToRow (55) + : : : +- Scan parquet default.customer (54) + : : +- BroadcastExchange (61) + : : +- * Filter (60) + : : +- * ColumnarToRow (59) + : : +- Scan parquet default.customer_address (58) + : +- * Sort (67) + : +- ReusedExchange (66) + :- * HashAggregate (102) + : +- Exchange (101) + : +- * HashAggregate (100) + : +- * Project (99) + : +- * SortMergeJoin Inner (98) + : :- * Sort (78) + : : +- ReusedExchange (77) + : +- * Sort (97) + : +- Exchange (96) + : +- * Project (95) + : +- * SortMergeJoin Inner (94) + : :- * Sort (91) + : : +- Exchange (90) + : : +- * Project (89) + : : +- * BroadcastHashJoin Inner BuildRight (88) + : : :- * Project (82) + : : : +- * Filter (81) + : : : +- * ColumnarToRow (80) + : : : +- Scan parquet default.customer (79) + : : +- BroadcastExchange (87) + : : +- * Project (86) + : : +- * Filter (85) + : : +- * ColumnarToRow (84) + : : +- Scan parquet default.customer_address (83) + : +- * Sort (93) + : +- ReusedExchange (92) + :- * HashAggregate (137) + : +- Exchange (136) + : +- * HashAggregate (135) + : +- * Project (134) + : +- * BroadcastHashJoin Inner BuildRight (133) + : :- * Project (131) + : : +- * BroadcastHashJoin Inner BuildRight (130) + : : :- * Project (111) + : : : +- * BroadcastHashJoin Inner BuildRight (110) + : : : :- * Project (108) + : : : : +- * BroadcastHashJoin Inner BuildRight (107) + : : : : :- * Filter (105) + : : : : : +- * ColumnarToRow (104) + : : : : : +- Scan parquet default.catalog_sales (103) + : : : : +- ReusedExchange (106) + : : : +- ReusedExchange (109) + : : +- BroadcastExchange (129) + : : +- * Project (128) + : : +- * BroadcastHashJoin Inner BuildLeft (127) + : : :- BroadcastExchange (123) + : : : +- * Project (122) + : : : +- * BroadcastHashJoin Inner BuildRight (121) + : : : :- * Project (115) + : : : : +- * Filter (114) + : : : : +- * ColumnarToRow (113) + : : : : +- Scan parquet default.customer (112) + : : : +- BroadcastExchange (120) + : : : +- * Project (119) + : : : +- * Filter (118) + : : : +- * ColumnarToRow (117) + : : : +- Scan parquet default.customer_address (116) + : : +- * Filter (126) + : : +- * ColumnarToRow (125) + : : +- Scan parquet default.customer_demographics (124) + : +- ReusedExchange (132) + +- * HashAggregate (158) + +- Exchange (157) + +- * HashAggregate (156) + +- * Project (155) + +- * BroadcastHashJoin Inner BuildRight (154) + :- * Project (152) + : +- * BroadcastHashJoin Inner BuildRight (151) + : :- * Project (146) + : : +- * BroadcastHashJoin Inner BuildRight (145) + : : :- * Project (143) + : : : +- * BroadcastHashJoin Inner BuildRight (142) + : : : :- * Filter (140) + : : : : +- * ColumnarToRow (139) + : : : : +- Scan parquet default.catalog_sales (138) + : : : +- ReusedExchange (141) + : : +- ReusedExchange (144) + : +- BroadcastExchange (150) + : +- * Filter (149) + : +- * ColumnarToRow (148) + : +- Scan parquet default.item (147) + +- ReusedExchange (153) + + +(1) Scan parquet default.catalog_sales +Output [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#9), dynamicpruningexpression(cs_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9] + +(3) Filter [codegen id : 4] +Input [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9] +Condition : ((isnotnull(cs_bill_cdemo_sk#2) AND isnotnull(cs_bill_customer_sk#1)) AND isnotnull(cs_item_sk#3)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_education_status,College ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] +Condition : ((((isnotnull(cd_gender#12) AND isnotnull(cd_education_status#13)) AND (cd_gender#12 = M)) AND (cd_education_status#13 = College )) AND isnotnull(cd_demo_sk#11)) + +(7) Project [codegen id : 1] +Output [2]: [cd_demo_sk#11, cd_dep_count#14] +Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] + +(8) BroadcastExchange +Input [2]: [cd_demo_sk#11, cd_dep_count#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_bill_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#11] +Join condition: None + +(10) Project [codegen id : 4] +Output [9]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14] +Input [11]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_demo_sk#11, cd_dep_count#14] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#16, d_year#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#16, d_year#17] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#16, d_year#17] +Condition : ((isnotnull(d_year#17) AND (d_year#17 = 2001)) AND isnotnull(d_date_sk#16)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#16] +Input [2]: [d_date_sk#16, d_year#17] + +(15) BroadcastExchange +Input [1]: [d_date_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#9] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(17) Project [codegen id : 4] +Output [8]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14] +Input [10]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, d_date_sk#16] + +(18) Scan parquet default.item +Output [2]: [i_item_sk#19, i_item_id#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_sk#19, i_item_id#20] + +(20) Filter [codegen id : 3] +Input [2]: [i_item_sk#19, i_item_id#20] +Condition : isnotnull(i_item_sk#19) + +(21) BroadcastExchange +Input [2]: [i_item_sk#19, i_item_id#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_item_sk#3] +Right keys [1]: [i_item_sk#19] +Join condition: None + +(23) Project [codegen id : 4] +Output [8]: [cs_bill_customer_sk#1, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_id#20] +Input [10]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_sk#19, i_item_id#20] + +(24) Exchange +Input [8]: [cs_bill_customer_sk#1, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_id#20] +Arguments: hashpartitioning(cs_bill_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#22] + +(25) Sort [codegen id : 5] +Input [8]: [cs_bill_customer_sk#1, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_id#20] +Arguments: [cs_bill_customer_sk#1 ASC NULLS FIRST], false, 0 + +(26) Scan parquet default.customer +Output [5]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_month#26, c_birth_year#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [In(c_birth_month, [9,5,12,4,1,10]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 7] +Input [5]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_month#26, c_birth_year#27] + +(28) Filter [codegen id : 7] +Input [5]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_month#26, c_birth_year#27] +Condition : (((c_birth_month#26 IN (9,5,12,4,1,10) AND isnotnull(c_customer_sk#23)) AND isnotnull(c_current_cdemo_sk#24)) AND isnotnull(c_current_addr_sk#25)) + +(29) Project [codegen id : 7] +Output [4]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_year#27] +Input [5]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_month#26, c_birth_year#27] + +(30) Scan parquet default.customer_address +Output [4]: [ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 6] +Input [4]: [ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31] + +(32) Filter [codegen id : 6] +Input [4]: [ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31] +Condition : (ca_state#30 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#28)) + +(33) BroadcastExchange +Input [4]: [ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#32] + +(34) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_addr_sk#25] +Right keys [1]: [ca_address_sk#28] +Join condition: None + +(35) Project [codegen id : 7] +Output [6]: [c_customer_sk#23, c_current_cdemo_sk#24, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] +Input [8]: [c_customer_sk#23, c_current_cdemo_sk#24, c_current_addr_sk#25, c_birth_year#27, ca_address_sk#28, ca_county#29, ca_state#30, ca_country#31] + +(36) Exchange +Input [6]: [c_customer_sk#23, c_current_cdemo_sk#24, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] +Arguments: hashpartitioning(c_current_cdemo_sk#24, 5), ENSURE_REQUIREMENTS, [id=#33] + +(37) Sort [codegen id : 8] +Input [6]: [c_customer_sk#23, c_current_cdemo_sk#24, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] +Arguments: [c_current_cdemo_sk#24 ASC NULLS FIRST], false, 0 + +(38) Scan parquet default.customer_demographics +Output [1]: [cd_demo_sk#34] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 9] +Input [1]: [cd_demo_sk#34] + +(40) Filter [codegen id : 9] +Input [1]: [cd_demo_sk#34] +Condition : isnotnull(cd_demo_sk#34) + +(41) Exchange +Input [1]: [cd_demo_sk#34] +Arguments: hashpartitioning(cd_demo_sk#34, 5), ENSURE_REQUIREMENTS, [id=#35] + +(42) Sort [codegen id : 10] +Input [1]: [cd_demo_sk#34] +Arguments: [cd_demo_sk#34 ASC NULLS FIRST], false, 0 + +(43) SortMergeJoin [codegen id : 11] +Left keys [1]: [c_current_cdemo_sk#24] +Right keys [1]: [cd_demo_sk#34] +Join condition: None + +(44) Project [codegen id : 11] +Output [5]: [c_customer_sk#23, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] +Input [7]: [c_customer_sk#23, c_current_cdemo_sk#24, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31, cd_demo_sk#34] + +(45) Exchange +Input [5]: [c_customer_sk#23, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] +Arguments: hashpartitioning(c_customer_sk#23, 5), ENSURE_REQUIREMENTS, [id=#36] + +(46) Sort [codegen id : 12] +Input [5]: [c_customer_sk#23, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] +Arguments: [c_customer_sk#23 ASC NULLS FIRST], false, 0 + +(47) SortMergeJoin [codegen id : 13] +Left keys [1]: [cs_bill_customer_sk#1] +Right keys [1]: [c_customer_sk#23] +Join condition: None + +(48) Project [codegen id : 13] +Output [11]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, cast(cs_quantity#4 as decimal(12,2)) AS agg1#37, cast(cs_list_price#5 as decimal(12,2)) AS agg2#38, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#39, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#40, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#41, cast(c_birth_year#27 as decimal(12,2)) AS agg6#42, cast(cd_dep_count#14 as decimal(12,2)) AS agg7#43] +Input [13]: [cs_bill_customer_sk#1, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, i_item_id#20, c_customer_sk#23, c_birth_year#27, ca_county#29, ca_state#30, ca_country#31] + +(49) HashAggregate [codegen id : 13] +Input [11]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, agg1#37, agg2#38, agg3#39, agg4#40, agg5#41, agg6#42, agg7#43] +Keys [4]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29] +Functions [7]: [partial_avg(agg1#37), partial_avg(agg2#38), partial_avg(agg3#39), partial_avg(agg4#40), partial_avg(agg5#41), partial_avg(agg6#42), partial_avg(agg7#43)] +Aggregate Attributes [14]: [sum#44, count#45, sum#46, count#47, sum#48, count#49, sum#50, count#51, sum#52, count#53, sum#54, count#55, sum#56, count#57] +Results [18]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69, sum#70, count#71] + +(50) Exchange +Input [18]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69, sum#70, count#71] +Arguments: hashpartitioning(i_item_id#20, ca_country#31, ca_state#30, ca_county#29, 5), ENSURE_REQUIREMENTS, [id=#72] + +(51) HashAggregate [codegen id : 14] +Input [18]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69, sum#70, count#71] +Keys [4]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29] +Functions [7]: [avg(agg1#37), avg(agg2#38), avg(agg3#39), avg(agg4#40), avg(agg5#41), avg(agg6#42), avg(agg7#43)] +Aggregate Attributes [7]: [avg(agg1#37)#73, avg(agg2#38)#74, avg(agg3#39)#75, avg(agg4#40)#76, avg(agg5#41)#77, avg(agg6#42)#78, avg(agg7#43)#79] +Results [11]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, avg(agg1#37)#73 AS agg1#80, avg(agg2#38)#74 AS agg2#81, avg(agg3#39)#75 AS agg3#82, avg(agg4#40)#76 AS agg4#83, avg(agg5#41)#77 AS agg5#84, avg(agg6#42)#78 AS agg6#85, avg(agg7#43)#79 AS agg7#86] + +(52) ReusedExchange [Reuses operator id: unknown] +Output [8]: [cs_bill_customer_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cd_dep_count#93, i_item_id#94] + +(53) Sort [codegen id : 19] +Input [8]: [cs_bill_customer_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cd_dep_count#93, i_item_id#94] +Arguments: [cs_bill_customer_sk#87 ASC NULLS FIRST], false, 0 + +(54) Scan parquet default.customer +Output [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_current_addr_sk#97, c_birth_month#98, c_birth_year#99] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [In(c_birth_month, [9,5,12,4,1,10]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 21] +Input [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_current_addr_sk#97, c_birth_month#98, c_birth_year#99] + +(56) Filter [codegen id : 21] +Input [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_current_addr_sk#97, c_birth_month#98, c_birth_year#99] +Condition : (((c_birth_month#98 IN (9,5,12,4,1,10) AND isnotnull(c_customer_sk#95)) AND isnotnull(c_current_cdemo_sk#96)) AND isnotnull(c_current_addr_sk#97)) + +(57) Project [codegen id : 21] +Output [4]: [c_customer_sk#95, c_current_cdemo_sk#96, c_current_addr_sk#97, c_birth_year#99] +Input [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_current_addr_sk#97, c_birth_month#98, c_birth_year#99] + +(58) Scan parquet default.customer_address +Output [3]: [ca_address_sk#100, ca_state#101, ca_country#102] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(59) ColumnarToRow [codegen id : 20] +Input [3]: [ca_address_sk#100, ca_state#101, ca_country#102] + +(60) Filter [codegen id : 20] +Input [3]: [ca_address_sk#100, ca_state#101, ca_country#102] +Condition : (ca_state#101 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#100)) + +(61) BroadcastExchange +Input [3]: [ca_address_sk#100, ca_state#101, ca_country#102] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#103] + +(62) BroadcastHashJoin [codegen id : 21] +Left keys [1]: [c_current_addr_sk#97] +Right keys [1]: [ca_address_sk#100] +Join condition: None + +(63) Project [codegen id : 21] +Output [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_birth_year#99, ca_state#101, ca_country#102] +Input [7]: [c_customer_sk#95, c_current_cdemo_sk#96, c_current_addr_sk#97, c_birth_year#99, ca_address_sk#100, ca_state#101, ca_country#102] + +(64) Exchange +Input [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_birth_year#99, ca_state#101, ca_country#102] +Arguments: hashpartitioning(c_current_cdemo_sk#96, 5), ENSURE_REQUIREMENTS, [id=#104] + +(65) Sort [codegen id : 22] +Input [5]: [c_customer_sk#95, c_current_cdemo_sk#96, c_birth_year#99, ca_state#101, ca_country#102] +Arguments: [c_current_cdemo_sk#96 ASC NULLS FIRST], false, 0 + +(66) ReusedExchange [Reuses operator id: 41] +Output [1]: [cd_demo_sk#105] + +(67) Sort [codegen id : 24] +Input [1]: [cd_demo_sk#105] +Arguments: [cd_demo_sk#105 ASC NULLS FIRST], false, 0 + +(68) SortMergeJoin [codegen id : 25] +Left keys [1]: [c_current_cdemo_sk#96] +Right keys [1]: [cd_demo_sk#105] +Join condition: None + +(69) Project [codegen id : 25] +Output [4]: [c_customer_sk#95, c_birth_year#99, ca_state#101, ca_country#102] +Input [6]: [c_customer_sk#95, c_current_cdemo_sk#96, c_birth_year#99, ca_state#101, ca_country#102, cd_demo_sk#105] + +(70) Exchange +Input [4]: [c_customer_sk#95, c_birth_year#99, ca_state#101, ca_country#102] +Arguments: hashpartitioning(c_customer_sk#95, 5), ENSURE_REQUIREMENTS, [id=#106] + +(71) Sort [codegen id : 26] +Input [4]: [c_customer_sk#95, c_birth_year#99, ca_state#101, ca_country#102] +Arguments: [c_customer_sk#95 ASC NULLS FIRST], false, 0 + +(72) SortMergeJoin [codegen id : 27] +Left keys [1]: [cs_bill_customer_sk#87] +Right keys [1]: [c_customer_sk#95] +Join condition: None + +(73) Project [codegen id : 27] +Output [10]: [i_item_id#94, ca_country#102, ca_state#101, cast(cs_quantity#88 as decimal(12,2)) AS agg1#37, cast(cs_list_price#89 as decimal(12,2)) AS agg2#38, cast(cs_coupon_amt#91 as decimal(12,2)) AS agg3#39, cast(cs_sales_price#90 as decimal(12,2)) AS agg4#40, cast(cs_net_profit#92 as decimal(12,2)) AS agg5#41, cast(c_birth_year#99 as decimal(12,2)) AS agg6#42, cast(cd_dep_count#93 as decimal(12,2)) AS agg7#43] +Input [12]: [cs_bill_customer_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cd_dep_count#93, i_item_id#94, c_customer_sk#95, c_birth_year#99, ca_state#101, ca_country#102] + +(74) HashAggregate [codegen id : 27] +Input [10]: [i_item_id#94, ca_country#102, ca_state#101, agg1#37, agg2#38, agg3#39, agg4#40, agg5#41, agg6#42, agg7#43] +Keys [3]: [i_item_id#94, ca_country#102, ca_state#101] +Functions [7]: [partial_avg(agg1#37), partial_avg(agg2#38), partial_avg(agg3#39), partial_avg(agg4#40), partial_avg(agg5#41), partial_avg(agg6#42), partial_avg(agg7#43)] +Aggregate Attributes [14]: [sum#107, count#108, sum#109, count#110, sum#111, count#112, sum#113, count#114, sum#115, count#116, sum#117, count#118, sum#119, count#120] +Results [17]: [i_item_id#94, ca_country#102, ca_state#101, sum#121, count#122, sum#123, count#124, sum#125, count#126, sum#127, count#128, sum#129, count#130, sum#131, count#132, sum#133, count#134] + +(75) Exchange +Input [17]: [i_item_id#94, ca_country#102, ca_state#101, sum#121, count#122, sum#123, count#124, sum#125, count#126, sum#127, count#128, sum#129, count#130, sum#131, count#132, sum#133, count#134] +Arguments: hashpartitioning(i_item_id#94, ca_country#102, ca_state#101, 5), ENSURE_REQUIREMENTS, [id=#135] + +(76) HashAggregate [codegen id : 28] +Input [17]: [i_item_id#94, ca_country#102, ca_state#101, sum#121, count#122, sum#123, count#124, sum#125, count#126, sum#127, count#128, sum#129, count#130, sum#131, count#132, sum#133, count#134] +Keys [3]: [i_item_id#94, ca_country#102, ca_state#101] +Functions [7]: [avg(agg1#37), avg(agg2#38), avg(agg3#39), avg(agg4#40), avg(agg5#41), avg(agg6#42), avg(agg7#43)] +Aggregate Attributes [7]: [avg(agg1#37)#136, avg(agg2#38)#137, avg(agg3#39)#138, avg(agg4#40)#139, avg(agg5#41)#140, avg(agg6#42)#141, avg(agg7#43)#142] +Results [11]: [i_item_id#94, ca_country#102, ca_state#101, null AS county#143, avg(agg1#37)#136 AS agg1#144, avg(agg2#38)#137 AS agg2#145, avg(agg3#39)#138 AS agg3#146, avg(agg4#40)#139 AS agg4#147, avg(agg5#41)#140 AS agg5#148, avg(agg6#42)#141 AS agg6#149, avg(agg7#43)#142 AS agg7#150] + +(77) ReusedExchange [Reuses operator id: unknown] +Output [8]: [cs_bill_customer_sk#151, cs_quantity#152, cs_list_price#153, cs_sales_price#154, cs_coupon_amt#155, cs_net_profit#156, cd_dep_count#157, i_item_id#158] + +(78) Sort [codegen id : 33] +Input [8]: [cs_bill_customer_sk#151, cs_quantity#152, cs_list_price#153, cs_sales_price#154, cs_coupon_amt#155, cs_net_profit#156, cd_dep_count#157, i_item_id#158] +Arguments: [cs_bill_customer_sk#151 ASC NULLS FIRST], false, 0 + +(79) Scan parquet default.customer +Output [5]: [c_customer_sk#159, c_current_cdemo_sk#160, c_current_addr_sk#161, c_birth_month#162, c_birth_year#163] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [In(c_birth_month, [9,5,12,4,1,10]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(80) ColumnarToRow [codegen id : 35] +Input [5]: [c_customer_sk#159, c_current_cdemo_sk#160, c_current_addr_sk#161, c_birth_month#162, c_birth_year#163] + +(81) Filter [codegen id : 35] +Input [5]: [c_customer_sk#159, c_current_cdemo_sk#160, c_current_addr_sk#161, c_birth_month#162, c_birth_year#163] +Condition : (((c_birth_month#162 IN (9,5,12,4,1,10) AND isnotnull(c_customer_sk#159)) AND isnotnull(c_current_cdemo_sk#160)) AND isnotnull(c_current_addr_sk#161)) + +(82) Project [codegen id : 35] +Output [4]: [c_customer_sk#159, c_current_cdemo_sk#160, c_current_addr_sk#161, c_birth_year#163] +Input [5]: [c_customer_sk#159, c_current_cdemo_sk#160, c_current_addr_sk#161, c_birth_month#162, c_birth_year#163] + +(83) Scan parquet default.customer_address +Output [3]: [ca_address_sk#164, ca_state#165, ca_country#166] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(84) ColumnarToRow [codegen id : 34] +Input [3]: [ca_address_sk#164, ca_state#165, ca_country#166] + +(85) Filter [codegen id : 34] +Input [3]: [ca_address_sk#164, ca_state#165, ca_country#166] +Condition : (ca_state#165 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#164)) + +(86) Project [codegen id : 34] +Output [2]: [ca_address_sk#164, ca_country#166] +Input [3]: [ca_address_sk#164, ca_state#165, ca_country#166] + +(87) BroadcastExchange +Input [2]: [ca_address_sk#164, ca_country#166] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#167] + +(88) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [c_current_addr_sk#161] +Right keys [1]: [ca_address_sk#164] +Join condition: None + +(89) Project [codegen id : 35] +Output [4]: [c_customer_sk#159, c_current_cdemo_sk#160, c_birth_year#163, ca_country#166] +Input [6]: [c_customer_sk#159, c_current_cdemo_sk#160, c_current_addr_sk#161, c_birth_year#163, ca_address_sk#164, ca_country#166] + +(90) Exchange +Input [4]: [c_customer_sk#159, c_current_cdemo_sk#160, c_birth_year#163, ca_country#166] +Arguments: hashpartitioning(c_current_cdemo_sk#160, 5), ENSURE_REQUIREMENTS, [id=#168] + +(91) Sort [codegen id : 36] +Input [4]: [c_customer_sk#159, c_current_cdemo_sk#160, c_birth_year#163, ca_country#166] +Arguments: [c_current_cdemo_sk#160 ASC NULLS FIRST], false, 0 + +(92) ReusedExchange [Reuses operator id: 41] +Output [1]: [cd_demo_sk#169] + +(93) Sort [codegen id : 38] +Input [1]: [cd_demo_sk#169] +Arguments: [cd_demo_sk#169 ASC NULLS FIRST], false, 0 + +(94) SortMergeJoin [codegen id : 39] +Left keys [1]: [c_current_cdemo_sk#160] +Right keys [1]: [cd_demo_sk#169] +Join condition: None + +(95) Project [codegen id : 39] +Output [3]: [c_customer_sk#159, c_birth_year#163, ca_country#166] +Input [5]: [c_customer_sk#159, c_current_cdemo_sk#160, c_birth_year#163, ca_country#166, cd_demo_sk#169] + +(96) Exchange +Input [3]: [c_customer_sk#159, c_birth_year#163, ca_country#166] +Arguments: hashpartitioning(c_customer_sk#159, 5), ENSURE_REQUIREMENTS, [id=#170] + +(97) Sort [codegen id : 40] +Input [3]: [c_customer_sk#159, c_birth_year#163, ca_country#166] +Arguments: [c_customer_sk#159 ASC NULLS FIRST], false, 0 + +(98) SortMergeJoin [codegen id : 41] +Left keys [1]: [cs_bill_customer_sk#151] +Right keys [1]: [c_customer_sk#159] +Join condition: None + +(99) Project [codegen id : 41] +Output [9]: [i_item_id#158, ca_country#166, cast(cs_quantity#152 as decimal(12,2)) AS agg1#37, cast(cs_list_price#153 as decimal(12,2)) AS agg2#38, cast(cs_coupon_amt#155 as decimal(12,2)) AS agg3#39, cast(cs_sales_price#154 as decimal(12,2)) AS agg4#40, cast(cs_net_profit#156 as decimal(12,2)) AS agg5#41, cast(c_birth_year#163 as decimal(12,2)) AS agg6#42, cast(cd_dep_count#157 as decimal(12,2)) AS agg7#43] +Input [11]: [cs_bill_customer_sk#151, cs_quantity#152, cs_list_price#153, cs_sales_price#154, cs_coupon_amt#155, cs_net_profit#156, cd_dep_count#157, i_item_id#158, c_customer_sk#159, c_birth_year#163, ca_country#166] + +(100) HashAggregate [codegen id : 41] +Input [9]: [i_item_id#158, ca_country#166, agg1#37, agg2#38, agg3#39, agg4#40, agg5#41, agg6#42, agg7#43] +Keys [2]: [i_item_id#158, ca_country#166] +Functions [7]: [partial_avg(agg1#37), partial_avg(agg2#38), partial_avg(agg3#39), partial_avg(agg4#40), partial_avg(agg5#41), partial_avg(agg6#42), partial_avg(agg7#43)] +Aggregate Attributes [14]: [sum#171, count#172, sum#173, count#174, sum#175, count#176, sum#177, count#178, sum#179, count#180, sum#181, count#182, sum#183, count#184] +Results [16]: [i_item_id#158, ca_country#166, sum#185, count#186, sum#187, count#188, sum#189, count#190, sum#191, count#192, sum#193, count#194, sum#195, count#196, sum#197, count#198] + +(101) Exchange +Input [16]: [i_item_id#158, ca_country#166, sum#185, count#186, sum#187, count#188, sum#189, count#190, sum#191, count#192, sum#193, count#194, sum#195, count#196, sum#197, count#198] +Arguments: hashpartitioning(i_item_id#158, ca_country#166, 5), ENSURE_REQUIREMENTS, [id=#199] + +(102) HashAggregate [codegen id : 42] +Input [16]: [i_item_id#158, ca_country#166, sum#185, count#186, sum#187, count#188, sum#189, count#190, sum#191, count#192, sum#193, count#194, sum#195, count#196, sum#197, count#198] +Keys [2]: [i_item_id#158, ca_country#166] +Functions [7]: [avg(agg1#37), avg(agg2#38), avg(agg3#39), avg(agg4#40), avg(agg5#41), avg(agg6#42), avg(agg7#43)] +Aggregate Attributes [7]: [avg(agg1#37)#200, avg(agg2#38)#201, avg(agg3#39)#202, avg(agg4#40)#203, avg(agg5#41)#204, avg(agg6#42)#205, avg(agg7#43)#206] +Results [11]: [i_item_id#158, ca_country#166, null AS ca_state#207, null AS county#208, avg(agg1#37)#200 AS agg1#209, avg(agg2#38)#201 AS agg2#210, avg(agg3#39)#202 AS agg3#211, avg(agg4#40)#203 AS agg4#212, avg(agg5#41)#204 AS agg5#213, avg(agg6#42)#205 AS agg6#214, avg(agg7#43)#206 AS agg7#215] + +(103) Scan parquet default.catalog_sales +Output [9]: [cs_bill_customer_sk#216, cs_bill_cdemo_sk#217, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cs_sold_date_sk#224] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#224), dynamicpruningexpression(cs_sold_date_sk#224 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(104) ColumnarToRow [codegen id : 49] +Input [9]: [cs_bill_customer_sk#216, cs_bill_cdemo_sk#217, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cs_sold_date_sk#224] + +(105) Filter [codegen id : 49] +Input [9]: [cs_bill_customer_sk#216, cs_bill_cdemo_sk#217, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cs_sold_date_sk#224] +Condition : ((isnotnull(cs_bill_cdemo_sk#217) AND isnotnull(cs_bill_customer_sk#216)) AND isnotnull(cs_item_sk#218)) + +(106) ReusedExchange [Reuses operator id: 8] +Output [2]: [cd_demo_sk#225, cd_dep_count#226] + +(107) BroadcastHashJoin [codegen id : 49] +Left keys [1]: [cs_bill_cdemo_sk#217] +Right keys [1]: [cd_demo_sk#225] +Join condition: None + +(108) Project [codegen id : 49] +Output [9]: [cs_bill_customer_sk#216, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cs_sold_date_sk#224, cd_dep_count#226] +Input [11]: [cs_bill_customer_sk#216, cs_bill_cdemo_sk#217, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cs_sold_date_sk#224, cd_demo_sk#225, cd_dep_count#226] + +(109) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#227] + +(110) BroadcastHashJoin [codegen id : 49] +Left keys [1]: [cs_sold_date_sk#224] +Right keys [1]: [d_date_sk#227] +Join condition: None + +(111) Project [codegen id : 49] +Output [8]: [cs_bill_customer_sk#216, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cd_dep_count#226] +Input [10]: [cs_bill_customer_sk#216, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cs_sold_date_sk#224, cd_dep_count#226, d_date_sk#227] + +(112) Scan parquet default.customer +Output [5]: [c_customer_sk#228, c_current_cdemo_sk#229, c_current_addr_sk#230, c_birth_month#231, c_birth_year#232] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [In(c_birth_month, [9,5,12,4,1,10]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(113) ColumnarToRow [codegen id : 46] +Input [5]: [c_customer_sk#228, c_current_cdemo_sk#229, c_current_addr_sk#230, c_birth_month#231, c_birth_year#232] + +(114) Filter [codegen id : 46] +Input [5]: [c_customer_sk#228, c_current_cdemo_sk#229, c_current_addr_sk#230, c_birth_month#231, c_birth_year#232] +Condition : (((c_birth_month#231 IN (9,5,12,4,1,10) AND isnotnull(c_customer_sk#228)) AND isnotnull(c_current_cdemo_sk#229)) AND isnotnull(c_current_addr_sk#230)) + +(115) Project [codegen id : 46] +Output [4]: [c_customer_sk#228, c_current_cdemo_sk#229, c_current_addr_sk#230, c_birth_year#232] +Input [5]: [c_customer_sk#228, c_current_cdemo_sk#229, c_current_addr_sk#230, c_birth_month#231, c_birth_year#232] + +(116) Scan parquet default.customer_address +Output [2]: [ca_address_sk#233, ca_state#234] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(117) ColumnarToRow [codegen id : 45] +Input [2]: [ca_address_sk#233, ca_state#234] + +(118) Filter [codegen id : 45] +Input [2]: [ca_address_sk#233, ca_state#234] +Condition : (ca_state#234 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#233)) + +(119) Project [codegen id : 45] +Output [1]: [ca_address_sk#233] +Input [2]: [ca_address_sk#233, ca_state#234] + +(120) BroadcastExchange +Input [1]: [ca_address_sk#233] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#235] + +(121) BroadcastHashJoin [codegen id : 46] +Left keys [1]: [c_current_addr_sk#230] +Right keys [1]: [ca_address_sk#233] +Join condition: None + +(122) Project [codegen id : 46] +Output [3]: [c_customer_sk#228, c_current_cdemo_sk#229, c_birth_year#232] +Input [5]: [c_customer_sk#228, c_current_cdemo_sk#229, c_current_addr_sk#230, c_birth_year#232, ca_address_sk#233] + +(123) BroadcastExchange +Input [3]: [c_customer_sk#228, c_current_cdemo_sk#229, c_birth_year#232] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, true] as bigint)),false), [id=#236] + +(124) Scan parquet default.customer_demographics +Output [1]: [cd_demo_sk#237] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(125) ColumnarToRow +Input [1]: [cd_demo_sk#237] + +(126) Filter +Input [1]: [cd_demo_sk#237] +Condition : isnotnull(cd_demo_sk#237) + +(127) BroadcastHashJoin [codegen id : 47] +Left keys [1]: [c_current_cdemo_sk#229] +Right keys [1]: [cd_demo_sk#237] +Join condition: None + +(128) Project [codegen id : 47] +Output [2]: [c_customer_sk#228, c_birth_year#232] +Input [4]: [c_customer_sk#228, c_current_cdemo_sk#229, c_birth_year#232, cd_demo_sk#237] + +(129) BroadcastExchange +Input [2]: [c_customer_sk#228, c_birth_year#232] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#238] + +(130) BroadcastHashJoin [codegen id : 49] +Left keys [1]: [cs_bill_customer_sk#216] +Right keys [1]: [c_customer_sk#228] +Join condition: None + +(131) Project [codegen id : 49] +Output [8]: [cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cd_dep_count#226, c_birth_year#232] +Input [10]: [cs_bill_customer_sk#216, cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cd_dep_count#226, c_customer_sk#228, c_birth_year#232] + +(132) ReusedExchange [Reuses operator id: 21] +Output [2]: [i_item_sk#239, i_item_id#240] + +(133) BroadcastHashJoin [codegen id : 49] +Left keys [1]: [cs_item_sk#218] +Right keys [1]: [i_item_sk#239] +Join condition: None + +(134) Project [codegen id : 49] +Output [8]: [i_item_id#240, cast(cs_quantity#219 as decimal(12,2)) AS agg1#37, cast(cs_list_price#220 as decimal(12,2)) AS agg2#38, cast(cs_coupon_amt#222 as decimal(12,2)) AS agg3#39, cast(cs_sales_price#221 as decimal(12,2)) AS agg4#40, cast(cs_net_profit#223 as decimal(12,2)) AS agg5#41, cast(c_birth_year#232 as decimal(12,2)) AS agg6#42, cast(cd_dep_count#226 as decimal(12,2)) AS agg7#43] +Input [10]: [cs_item_sk#218, cs_quantity#219, cs_list_price#220, cs_sales_price#221, cs_coupon_amt#222, cs_net_profit#223, cd_dep_count#226, c_birth_year#232, i_item_sk#239, i_item_id#240] + +(135) HashAggregate [codegen id : 49] +Input [8]: [i_item_id#240, agg1#37, agg2#38, agg3#39, agg4#40, agg5#41, agg6#42, agg7#43] +Keys [1]: [i_item_id#240] +Functions [7]: [partial_avg(agg1#37), partial_avg(agg2#38), partial_avg(agg3#39), partial_avg(agg4#40), partial_avg(agg5#41), partial_avg(agg6#42), partial_avg(agg7#43)] +Aggregate Attributes [14]: [sum#241, count#242, sum#243, count#244, sum#245, count#246, sum#247, count#248, sum#249, count#250, sum#251, count#252, sum#253, count#254] +Results [15]: [i_item_id#240, sum#255, count#256, sum#257, count#258, sum#259, count#260, sum#261, count#262, sum#263, count#264, sum#265, count#266, sum#267, count#268] + +(136) Exchange +Input [15]: [i_item_id#240, sum#255, count#256, sum#257, count#258, sum#259, count#260, sum#261, count#262, sum#263, count#264, sum#265, count#266, sum#267, count#268] +Arguments: hashpartitioning(i_item_id#240, 5), ENSURE_REQUIREMENTS, [id=#269] + +(137) HashAggregate [codegen id : 50] +Input [15]: [i_item_id#240, sum#255, count#256, sum#257, count#258, sum#259, count#260, sum#261, count#262, sum#263, count#264, sum#265, count#266, sum#267, count#268] +Keys [1]: [i_item_id#240] +Functions [7]: [avg(agg1#37), avg(agg2#38), avg(agg3#39), avg(agg4#40), avg(agg5#41), avg(agg6#42), avg(agg7#43)] +Aggregate Attributes [7]: [avg(agg1#37)#270, avg(agg2#38)#271, avg(agg3#39)#272, avg(agg4#40)#273, avg(agg5#41)#274, avg(agg6#42)#275, avg(agg7#43)#276] +Results [11]: [i_item_id#240, null AS ca_country#277, null AS ca_state#278, null AS county#279, avg(agg1#37)#270 AS agg1#280, avg(agg2#38)#271 AS agg2#281, avg(agg3#39)#272 AS agg3#282, avg(agg4#40)#273 AS agg4#283, avg(agg5#41)#274 AS agg5#284, avg(agg6#42)#275 AS agg6#285, avg(agg7#43)#276 AS agg7#286] + +(138) Scan parquet default.catalog_sales +Output [9]: [cs_bill_customer_sk#287, cs_bill_cdemo_sk#288, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cs_sold_date_sk#295] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#295), dynamicpruningexpression(cs_sold_date_sk#295 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(139) ColumnarToRow [codegen id : 57] +Input [9]: [cs_bill_customer_sk#287, cs_bill_cdemo_sk#288, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cs_sold_date_sk#295] + +(140) Filter [codegen id : 57] +Input [9]: [cs_bill_customer_sk#287, cs_bill_cdemo_sk#288, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cs_sold_date_sk#295] +Condition : ((isnotnull(cs_bill_cdemo_sk#288) AND isnotnull(cs_bill_customer_sk#287)) AND isnotnull(cs_item_sk#289)) + +(141) ReusedExchange [Reuses operator id: 8] +Output [2]: [cd_demo_sk#296, cd_dep_count#297] + +(142) BroadcastHashJoin [codegen id : 57] +Left keys [1]: [cs_bill_cdemo_sk#288] +Right keys [1]: [cd_demo_sk#296] +Join condition: None + +(143) Project [codegen id : 57] +Output [9]: [cs_bill_customer_sk#287, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cs_sold_date_sk#295, cd_dep_count#297] +Input [11]: [cs_bill_customer_sk#287, cs_bill_cdemo_sk#288, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cs_sold_date_sk#295, cd_demo_sk#296, cd_dep_count#297] + +(144) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#298] + +(145) BroadcastHashJoin [codegen id : 57] +Left keys [1]: [cs_sold_date_sk#295] +Right keys [1]: [d_date_sk#298] +Join condition: None + +(146) Project [codegen id : 57] +Output [8]: [cs_bill_customer_sk#287, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cd_dep_count#297] +Input [10]: [cs_bill_customer_sk#287, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cs_sold_date_sk#295, cd_dep_count#297, d_date_sk#298] + +(147) Scan parquet default.item +Output [1]: [i_item_sk#299] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(148) ColumnarToRow [codegen id : 53] +Input [1]: [i_item_sk#299] + +(149) Filter [codegen id : 53] +Input [1]: [i_item_sk#299] +Condition : isnotnull(i_item_sk#299) + +(150) BroadcastExchange +Input [1]: [i_item_sk#299] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#300] + +(151) BroadcastHashJoin [codegen id : 57] +Left keys [1]: [cs_item_sk#289] +Right keys [1]: [i_item_sk#299] +Join condition: None + +(152) Project [codegen id : 57] +Output [7]: [cs_bill_customer_sk#287, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cd_dep_count#297] +Input [9]: [cs_bill_customer_sk#287, cs_item_sk#289, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cd_dep_count#297, i_item_sk#299] + +(153) ReusedExchange [Reuses operator id: 129] +Output [2]: [c_customer_sk#301, c_birth_year#302] + +(154) BroadcastHashJoin [codegen id : 57] +Left keys [1]: [cs_bill_customer_sk#287] +Right keys [1]: [c_customer_sk#301] +Join condition: None + +(155) Project [codegen id : 57] +Output [7]: [cast(cs_quantity#290 as decimal(12,2)) AS agg1#37, cast(cs_list_price#291 as decimal(12,2)) AS agg2#38, cast(cs_coupon_amt#293 as decimal(12,2)) AS agg3#39, cast(cs_sales_price#292 as decimal(12,2)) AS agg4#40, cast(cs_net_profit#294 as decimal(12,2)) AS agg5#41, cast(c_birth_year#302 as decimal(12,2)) AS agg6#42, cast(cd_dep_count#297 as decimal(12,2)) AS agg7#43] +Input [9]: [cs_bill_customer_sk#287, cs_quantity#290, cs_list_price#291, cs_sales_price#292, cs_coupon_amt#293, cs_net_profit#294, cd_dep_count#297, c_customer_sk#301, c_birth_year#302] + +(156) HashAggregate [codegen id : 57] +Input [7]: [agg1#37, agg2#38, agg3#39, agg4#40, agg5#41, agg6#42, agg7#43] +Keys: [] +Functions [7]: [partial_avg(agg1#37), partial_avg(agg2#38), partial_avg(agg3#39), partial_avg(agg4#40), partial_avg(agg5#41), partial_avg(agg6#42), partial_avg(agg7#43)] +Aggregate Attributes [14]: [sum#303, count#304, sum#305, count#306, sum#307, count#308, sum#309, count#310, sum#311, count#312, sum#313, count#314, sum#315, count#316] +Results [14]: [sum#317, count#318, sum#319, count#320, sum#321, count#322, sum#323, count#324, sum#325, count#326, sum#327, count#328, sum#329, count#330] + +(157) Exchange +Input [14]: [sum#317, count#318, sum#319, count#320, sum#321, count#322, sum#323, count#324, sum#325, count#326, sum#327, count#328, sum#329, count#330] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#331] + +(158) HashAggregate [codegen id : 58] +Input [14]: [sum#317, count#318, sum#319, count#320, sum#321, count#322, sum#323, count#324, sum#325, count#326, sum#327, count#328, sum#329, count#330] +Keys: [] +Functions [7]: [avg(agg1#37), avg(agg2#38), avg(agg3#39), avg(agg4#40), avg(agg5#41), avg(agg6#42), avg(agg7#43)] +Aggregate Attributes [7]: [avg(agg1#37)#332, avg(agg2#38)#333, avg(agg3#39)#334, avg(agg4#40)#335, avg(agg5#41)#336, avg(agg6#42)#337, avg(agg7#43)#338] +Results [11]: [null AS i_item_id#339, null AS ca_country#340, null AS ca_state#341, null AS county#342, avg(agg1#37)#332 AS agg1#343, avg(agg2#38)#333 AS agg2#344, avg(agg3#39)#334 AS agg3#345, avg(agg4#40)#335 AS agg4#346, avg(agg5#41)#336 AS agg5#347, avg(agg6#42)#337 AS agg6#348, avg(agg7#43)#338 AS agg7#349] + +(159) Union + +(160) TakeOrderedAndProject +Input [11]: [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, agg1#80, agg2#81, agg3#82, agg4#83, agg5#84, agg6#85, agg7#86] +Arguments: 100, [ca_country#31 ASC NULLS FIRST, ca_state#30 ASC NULLS FIRST, ca_county#29 ASC NULLS FIRST, i_item_id#20 ASC NULLS FIRST], [i_item_id#20, ca_country#31, ca_state#30, ca_county#29, agg1#80, agg2#81, agg3#82, agg4#83, agg5#84, agg6#85, agg7#86] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (161) + + +(161) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#16] + +Subquery:2 Hosting operator id = 103 Hosting Expression = cs_sold_date_sk#224 IN dynamicpruning#10 + +Subquery:3 Hosting operator id = 138 Hosting Expression = cs_sold_date_sk#295 IN dynamicpruning#10 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/simplified.txt new file mode 100644 index 0000000000000..13aa887abaa2d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a.sf100/simplified.txt @@ -0,0 +1,266 @@ +TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7] + Union + WholeStageCodegen (14) + HashAggregate [i_item_id,ca_country,ca_state,ca_county,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,ca_country,ca_state,ca_county] #1 + WholeStageCodegen (13) + HashAggregate [i_item_id,ca_country,ca_state,ca_county,agg1,agg2,agg3,agg4,agg5,agg6,agg7] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,ca_country,ca_state,ca_county,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (5) + Sort [cs_bill_customer_sk] + InputAdapter + Exchange [cs_bill_customer_sk] #2 + WholeStageCodegen (4) + Project [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,i_item_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [cd_demo_sk,cd_dep_count] + Filter [cd_gender,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_education_status,cd_dep_count] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + InputAdapter + WholeStageCodegen (12) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #6 + WholeStageCodegen (11) + Project [c_customer_sk,c_birth_year,ca_county,ca_state,ca_country] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (8) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #7 + WholeStageCodegen (7) + Project [c_customer_sk,c_current_cdemo_sk,c_birth_year,ca_county,ca_state,ca_country] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + Filter [c_birth_month,c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_month,c_birth_year] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (6) + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county,ca_state,ca_country] + InputAdapter + WholeStageCodegen (10) + Sort [cd_demo_sk] + InputAdapter + Exchange [cd_demo_sk] #9 + WholeStageCodegen (9) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk] + WholeStageCodegen (28) + HashAggregate [i_item_id,ca_country,ca_state,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),county,agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,ca_country,ca_state] #10 + WholeStageCodegen (27) + HashAggregate [i_item_id,ca_country,ca_state,agg1,agg2,agg3,agg4,agg5,agg6,agg7] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,ca_country,ca_state,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (19) + Sort [cs_bill_customer_sk] + InputAdapter + ReusedExchange [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,i_item_id] #11 + InputAdapter + WholeStageCodegen (26) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #12 + WholeStageCodegen (25) + Project [c_customer_sk,c_birth_year,ca_state,ca_country] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (22) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #13 + WholeStageCodegen (21) + Project [c_customer_sk,c_current_cdemo_sk,c_birth_year,ca_state,ca_country] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + Filter [c_birth_month,c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_month,c_birth_year] + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (20) + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_country] + InputAdapter + WholeStageCodegen (24) + Sort [cd_demo_sk] + InputAdapter + ReusedExchange [cd_demo_sk] #9 + WholeStageCodegen (42) + HashAggregate [i_item_id,ca_country,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),ca_state,county,agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,ca_country] #15 + WholeStageCodegen (41) + HashAggregate [i_item_id,ca_country,agg1,agg2,agg3,agg4,agg5,agg6,agg7] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,ca_country,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] + SortMergeJoin [cs_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (33) + Sort [cs_bill_customer_sk] + InputAdapter + ReusedExchange [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,i_item_id] #11 + InputAdapter + WholeStageCodegen (40) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #16 + WholeStageCodegen (39) + Project [c_customer_sk,c_birth_year,ca_country] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (36) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #17 + WholeStageCodegen (35) + Project [c_customer_sk,c_current_cdemo_sk,c_birth_year,ca_country] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + Filter [c_birth_month,c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_month,c_birth_year] + InputAdapter + BroadcastExchange #18 + WholeStageCodegen (34) + Project [ca_address_sk,ca_country] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_country] + InputAdapter + WholeStageCodegen (38) + Sort [cd_demo_sk] + InputAdapter + ReusedExchange [cd_demo_sk] #9 + WholeStageCodegen (50) + HashAggregate [i_item_id,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),ca_country,ca_state,county,agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id] #19 + WholeStageCodegen (49) + HashAggregate [i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [cd_demo_sk,cd_dep_count] #4 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #20 + WholeStageCodegen (47) + Project [c_customer_sk,c_birth_year] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + BroadcastExchange #21 + WholeStageCodegen (46) + Project [c_customer_sk,c_current_cdemo_sk,c_birth_year] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + Filter [c_birth_month,c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_month,c_birth_year] + InputAdapter + BroadcastExchange #22 + WholeStageCodegen (45) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk] + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 + WholeStageCodegen (58) + HashAggregate [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),i_item_id,ca_country,ca_state,county,agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange #23 + WholeStageCodegen (57) + HashAggregate [agg1,agg2,agg3,agg4,agg5,agg6,agg7] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + Project [cs_bill_customer_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [cd_demo_sk,cd_dep_count] #4 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #24 + WholeStageCodegen (53) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_birth_year] #20 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/explain.txt new file mode 100644 index 0000000000000..8e3c5958d2831 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/explain.txt @@ -0,0 +1,879 @@ +== Physical Plan == +TakeOrderedAndProject (157) ++- Union (156) + :- * HashAggregate (45) + : +- Exchange (44) + : +- * HashAggregate (43) + : +- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Project (36) + : : +- * BroadcastHashJoin Inner BuildRight (35) + : : :- * Project (29) + : : : +- * BroadcastHashJoin Inner BuildRight (28) + : : : :- * Project (23) + : : : : +- * BroadcastHashJoin Inner BuildRight (22) + : : : : :- * Project (17) + : : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : : :- * Project (10) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : : :- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.catalog_sales (1) + : : : : : : +- BroadcastExchange (8) + : : : : : : +- * Project (7) + : : : : : : +- * Filter (6) + : : : : : : +- * ColumnarToRow (5) + : : : : : : +- Scan parquet default.customer_demographics (4) + : : : : : +- BroadcastExchange (15) + : : : : : +- * Project (14) + : : : : : +- * Filter (13) + : : : : : +- * ColumnarToRow (12) + : : : : : +- Scan parquet default.customer (11) + : : : : +- BroadcastExchange (21) + : : : : +- * Filter (20) + : : : : +- * ColumnarToRow (19) + : : : : +- Scan parquet default.customer_demographics (18) + : : : +- BroadcastExchange (27) + : : : +- * Filter (26) + : : : +- * ColumnarToRow (25) + : : : +- Scan parquet default.customer_address (24) + : : +- BroadcastExchange (34) + : : +- * Project (33) + : : +- * Filter (32) + : : +- * ColumnarToRow (31) + : : +- Scan parquet default.date_dim (30) + : +- BroadcastExchange (40) + : +- * Filter (39) + : +- * ColumnarToRow (38) + : +- Scan parquet default.item (37) + :- * HashAggregate (72) + : +- Exchange (71) + : +- * HashAggregate (70) + : +- * Project (69) + : +- * BroadcastHashJoin Inner BuildRight (68) + : :- * Project (66) + : : +- * BroadcastHashJoin Inner BuildRight (65) + : : :- * Project (63) + : : : +- * BroadcastHashJoin Inner BuildRight (62) + : : : :- * Project (57) + : : : : +- * BroadcastHashJoin Inner BuildRight (56) + : : : : :- * Project (54) + : : : : : +- * BroadcastHashJoin Inner BuildRight (53) + : : : : : :- * Project (51) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (50) + : : : : : : :- * Filter (48) + : : : : : : : +- * ColumnarToRow (47) + : : : : : : : +- Scan parquet default.catalog_sales (46) + : : : : : : +- ReusedExchange (49) + : : : : : +- ReusedExchange (52) + : : : : +- ReusedExchange (55) + : : : +- BroadcastExchange (61) + : : : +- * Filter (60) + : : : +- * ColumnarToRow (59) + : : : +- Scan parquet default.customer_address (58) + : : +- ReusedExchange (64) + : +- ReusedExchange (67) + :- * HashAggregate (100) + : +- Exchange (99) + : +- * HashAggregate (98) + : +- * Project (97) + : +- * BroadcastHashJoin Inner BuildRight (96) + : :- * Project (94) + : : +- * BroadcastHashJoin Inner BuildRight (93) + : : :- * Project (91) + : : : +- * BroadcastHashJoin Inner BuildRight (90) + : : : :- * Project (84) + : : : : +- * BroadcastHashJoin Inner BuildRight (83) + : : : : :- * Project (81) + : : : : : +- * BroadcastHashJoin Inner BuildRight (80) + : : : : : :- * Project (78) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (77) + : : : : : : :- * Filter (75) + : : : : : : : +- * ColumnarToRow (74) + : : : : : : : +- Scan parquet default.catalog_sales (73) + : : : : : : +- ReusedExchange (76) + : : : : : +- ReusedExchange (79) + : : : : +- ReusedExchange (82) + : : : +- BroadcastExchange (89) + : : : +- * Project (88) + : : : +- * Filter (87) + : : : +- * ColumnarToRow (86) + : : : +- Scan parquet default.customer_address (85) + : : +- ReusedExchange (92) + : +- ReusedExchange (95) + :- * HashAggregate (128) + : +- Exchange (127) + : +- * HashAggregate (126) + : +- * Project (125) + : +- * BroadcastHashJoin Inner BuildRight (124) + : :- * Project (122) + : : +- * BroadcastHashJoin Inner BuildRight (121) + : : :- * Project (119) + : : : +- * BroadcastHashJoin Inner BuildRight (118) + : : : :- * Project (112) + : : : : +- * BroadcastHashJoin Inner BuildRight (111) + : : : : :- * Project (109) + : : : : : +- * BroadcastHashJoin Inner BuildRight (108) + : : : : : :- * Project (106) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (105) + : : : : : : :- * Filter (103) + : : : : : : : +- * ColumnarToRow (102) + : : : : : : : +- Scan parquet default.catalog_sales (101) + : : : : : : +- ReusedExchange (104) + : : : : : +- ReusedExchange (107) + : : : : +- ReusedExchange (110) + : : : +- BroadcastExchange (117) + : : : +- * Project (116) + : : : +- * Filter (115) + : : : +- * ColumnarToRow (114) + : : : +- Scan parquet default.customer_address (113) + : : +- ReusedExchange (120) + : +- ReusedExchange (123) + +- * HashAggregate (155) + +- Exchange (154) + +- * HashAggregate (153) + +- * Project (152) + +- * BroadcastHashJoin Inner BuildRight (151) + :- * Project (146) + : +- * BroadcastHashJoin Inner BuildRight (145) + : :- * Project (143) + : : +- * BroadcastHashJoin Inner BuildRight (142) + : : :- * Project (140) + : : : +- * BroadcastHashJoin Inner BuildRight (139) + : : : :- * Project (137) + : : : : +- * BroadcastHashJoin Inner BuildRight (136) + : : : : :- * Project (134) + : : : : : +- * BroadcastHashJoin Inner BuildRight (133) + : : : : : :- * Filter (131) + : : : : : : +- * ColumnarToRow (130) + : : : : : : +- Scan parquet default.catalog_sales (129) + : : : : : +- ReusedExchange (132) + : : : : +- ReusedExchange (135) + : : : +- ReusedExchange (138) + : : +- ReusedExchange (141) + : +- ReusedExchange (144) + +- BroadcastExchange (150) + +- * Filter (149) + +- * ColumnarToRow (148) + +- Scan parquet default.item (147) + + +(1) Scan parquet default.catalog_sales +Output [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#9), dynamicpruningexpression(cs_sold_date_sk#9 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 7] +Input [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9] + +(3) Filter [codegen id : 7] +Input [9]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9] +Condition : ((isnotnull(cs_bill_cdemo_sk#2) AND isnotnull(cs_bill_customer_sk#1)) AND isnotnull(cs_item_sk#3)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_education_status), EqualTo(cd_gender,M), EqualTo(cd_education_status,College ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] +Condition : ((((isnotnull(cd_gender#12) AND isnotnull(cd_education_status#13)) AND (cd_gender#12 = M)) AND (cd_education_status#13 = College )) AND isnotnull(cd_demo_sk#11)) + +(7) Project [codegen id : 1] +Output [2]: [cd_demo_sk#11, cd_dep_count#14] +Input [4]: [cd_demo_sk#11, cd_gender#12, cd_education_status#13, cd_dep_count#14] + +(8) BroadcastExchange +Input [2]: [cd_demo_sk#11, cd_dep_count#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(9) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cs_bill_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#11] +Join condition: None + +(10) Project [codegen id : 7] +Output [9]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14] +Input [11]: [cs_bill_customer_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_demo_sk#11, cd_dep_count#14] + +(11) Scan parquet default.customer +Output [5]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_month#19, c_birth_year#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [In(c_birth_month, [9,5,12,4,1,10]), IsNotNull(c_customer_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [5]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_month#19, c_birth_year#20] + +(13) Filter [codegen id : 2] +Input [5]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_month#19, c_birth_year#20] +Condition : (((c_birth_month#19 IN (9,5,12,4,1,10) AND isnotnull(c_customer_sk#16)) AND isnotnull(c_current_cdemo_sk#17)) AND isnotnull(c_current_addr_sk#18)) + +(14) Project [codegen id : 2] +Output [4]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20] +Input [5]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_month#19, c_birth_year#20] + +(15) BroadcastExchange +Input [4]: [c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(16) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cs_bill_customer_sk#1] +Right keys [1]: [c_customer_sk#16] +Join condition: None + +(17) Project [codegen id : 7] +Output [11]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20] +Input [13]: [cs_bill_customer_sk#1, cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_customer_sk#16, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20] + +(18) Scan parquet default.customer_demographics +Output [1]: [cd_demo_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [1]: [cd_demo_sk#22] + +(20) Filter [codegen id : 3] +Input [1]: [cd_demo_sk#22] +Condition : isnotnull(cd_demo_sk#22) + +(21) BroadcastExchange +Input [1]: [cd_demo_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(22) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_cdemo_sk#17] +Right keys [1]: [cd_demo_sk#22] +Join condition: None + +(23) Project [codegen id : 7] +Output [10]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_current_addr_sk#18, c_birth_year#20] +Input [12]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_current_cdemo_sk#17, c_current_addr_sk#18, c_birth_year#20, cd_demo_sk#22] + +(24) Scan parquet default.customer_address +Output [4]: [ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [4]: [ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27] + +(26) Filter [codegen id : 4] +Input [4]: [ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27] +Condition : (ca_state#26 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#24)) + +(27) BroadcastExchange +Input [4]: [ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#28] + +(28) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_current_addr_sk#18] +Right keys [1]: [ca_address_sk#24] +Join condition: None + +(29) Project [codegen id : 7] +Output [12]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_birth_year#20, ca_county#25, ca_state#26, ca_country#27] +Input [14]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_current_addr_sk#18, c_birth_year#20, ca_address_sk#24, ca_county#25, ca_state#26, ca_country#27] + +(30) Scan parquet default.date_dim +Output [2]: [d_date_sk#29, d_year#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#29, d_year#30] + +(32) Filter [codegen id : 5] +Input [2]: [d_date_sk#29, d_year#30] +Condition : ((isnotnull(d_year#30) AND (d_year#30 = 2001)) AND isnotnull(d_date_sk#29)) + +(33) Project [codegen id : 5] +Output [1]: [d_date_sk#29] +Input [2]: [d_date_sk#29, d_year#30] + +(34) BroadcastExchange +Input [1]: [d_date_sk#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#31] + +(35) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cs_sold_date_sk#9] +Right keys [1]: [d_date_sk#29] +Join condition: None + +(36) Project [codegen id : 7] +Output [11]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, ca_county#25, ca_state#26, ca_country#27] +Input [13]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cs_sold_date_sk#9, cd_dep_count#14, c_birth_year#20, ca_county#25, ca_state#26, ca_country#27, d_date_sk#29] + +(37) Scan parquet default.item +Output [2]: [i_item_sk#32, i_item_id#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(38) ColumnarToRow [codegen id : 6] +Input [2]: [i_item_sk#32, i_item_id#33] + +(39) Filter [codegen id : 6] +Input [2]: [i_item_sk#32, i_item_id#33] +Condition : isnotnull(i_item_sk#32) + +(40) BroadcastExchange +Input [2]: [i_item_sk#32, i_item_id#33] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#34] + +(41) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [cs_item_sk#3] +Right keys [1]: [i_item_sk#32] +Join condition: None + +(42) Project [codegen id : 7] +Output [11]: [i_item_id#33, ca_country#27, ca_state#26, ca_county#25, cast(cs_quantity#4 as decimal(12,2)) AS agg1#35, cast(cs_list_price#5 as decimal(12,2)) AS agg2#36, cast(cs_coupon_amt#7 as decimal(12,2)) AS agg3#37, cast(cs_sales_price#6 as decimal(12,2)) AS agg4#38, cast(cs_net_profit#8 as decimal(12,2)) AS agg5#39, cast(c_birth_year#20 as decimal(12,2)) AS agg6#40, cast(cd_dep_count#14 as decimal(12,2)) AS agg7#41] +Input [13]: [cs_item_sk#3, cs_quantity#4, cs_list_price#5, cs_sales_price#6, cs_coupon_amt#7, cs_net_profit#8, cd_dep_count#14, c_birth_year#20, ca_county#25, ca_state#26, ca_country#27, i_item_sk#32, i_item_id#33] + +(43) HashAggregate [codegen id : 7] +Input [11]: [i_item_id#33, ca_country#27, ca_state#26, ca_county#25, agg1#35, agg2#36, agg3#37, agg4#38, agg5#39, agg6#40, agg7#41] +Keys [4]: [i_item_id#33, ca_country#27, ca_state#26, ca_county#25] +Functions [7]: [partial_avg(agg1#35), partial_avg(agg2#36), partial_avg(agg3#37), partial_avg(agg4#38), partial_avg(agg5#39), partial_avg(agg6#40), partial_avg(agg7#41)] +Aggregate Attributes [14]: [sum#42, count#43, sum#44, count#45, sum#46, count#47, sum#48, count#49, sum#50, count#51, sum#52, count#53, sum#54, count#55] +Results [18]: [i_item_id#33, ca_country#27, ca_state#26, ca_county#25, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69] + +(44) Exchange +Input [18]: [i_item_id#33, ca_country#27, ca_state#26, ca_county#25, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69] +Arguments: hashpartitioning(i_item_id#33, ca_country#27, ca_state#26, ca_county#25, 5), ENSURE_REQUIREMENTS, [id=#70] + +(45) HashAggregate [codegen id : 8] +Input [18]: [i_item_id#33, ca_country#27, ca_state#26, ca_county#25, sum#56, count#57, sum#58, count#59, sum#60, count#61, sum#62, count#63, sum#64, count#65, sum#66, count#67, sum#68, count#69] +Keys [4]: [i_item_id#33, ca_country#27, ca_state#26, ca_county#25] +Functions [7]: [avg(agg1#35), avg(agg2#36), avg(agg3#37), avg(agg4#38), avg(agg5#39), avg(agg6#40), avg(agg7#41)] +Aggregate Attributes [7]: [avg(agg1#35)#71, avg(agg2#36)#72, avg(agg3#37)#73, avg(agg4#38)#74, avg(agg5#39)#75, avg(agg6#40)#76, avg(agg7#41)#77] +Results [11]: [i_item_id#33, ca_country#27, ca_state#26, ca_county#25, avg(agg1#35)#71 AS agg1#78, avg(agg2#36)#72 AS agg2#79, avg(agg3#37)#73 AS agg3#80, avg(agg4#38)#74 AS agg4#81, avg(agg5#39)#75 AS agg5#82, avg(agg6#40)#76 AS agg6#83, avg(agg7#41)#77 AS agg7#84] + +(46) Scan parquet default.catalog_sales +Output [9]: [cs_bill_customer_sk#85, cs_bill_cdemo_sk#86, cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cs_sold_date_sk#93] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#93), dynamicpruningexpression(cs_sold_date_sk#93 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 15] +Input [9]: [cs_bill_customer_sk#85, cs_bill_cdemo_sk#86, cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cs_sold_date_sk#93] + +(48) Filter [codegen id : 15] +Input [9]: [cs_bill_customer_sk#85, cs_bill_cdemo_sk#86, cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cs_sold_date_sk#93] +Condition : ((isnotnull(cs_bill_cdemo_sk#86) AND isnotnull(cs_bill_customer_sk#85)) AND isnotnull(cs_item_sk#87)) + +(49) ReusedExchange [Reuses operator id: 8] +Output [2]: [cd_demo_sk#94, cd_dep_count#95] + +(50) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [cs_bill_cdemo_sk#86] +Right keys [1]: [cd_demo_sk#94] +Join condition: None + +(51) Project [codegen id : 15] +Output [9]: [cs_bill_customer_sk#85, cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cs_sold_date_sk#93, cd_dep_count#95] +Input [11]: [cs_bill_customer_sk#85, cs_bill_cdemo_sk#86, cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cs_sold_date_sk#93, cd_demo_sk#94, cd_dep_count#95] + +(52) ReusedExchange [Reuses operator id: 15] +Output [4]: [c_customer_sk#96, c_current_cdemo_sk#97, c_current_addr_sk#98, c_birth_year#99] + +(53) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [cs_bill_customer_sk#85] +Right keys [1]: [c_customer_sk#96] +Join condition: None + +(54) Project [codegen id : 15] +Output [11]: [cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cs_sold_date_sk#93, cd_dep_count#95, c_current_cdemo_sk#97, c_current_addr_sk#98, c_birth_year#99] +Input [13]: [cs_bill_customer_sk#85, cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cs_sold_date_sk#93, cd_dep_count#95, c_customer_sk#96, c_current_cdemo_sk#97, c_current_addr_sk#98, c_birth_year#99] + +(55) ReusedExchange [Reuses operator id: 21] +Output [1]: [cd_demo_sk#100] + +(56) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [c_current_cdemo_sk#97] +Right keys [1]: [cd_demo_sk#100] +Join condition: None + +(57) Project [codegen id : 15] +Output [10]: [cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cs_sold_date_sk#93, cd_dep_count#95, c_current_addr_sk#98, c_birth_year#99] +Input [12]: [cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cs_sold_date_sk#93, cd_dep_count#95, c_current_cdemo_sk#97, c_current_addr_sk#98, c_birth_year#99, cd_demo_sk#100] + +(58) Scan parquet default.customer_address +Output [3]: [ca_address_sk#101, ca_state#102, ca_country#103] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(59) ColumnarToRow [codegen id : 12] +Input [3]: [ca_address_sk#101, ca_state#102, ca_country#103] + +(60) Filter [codegen id : 12] +Input [3]: [ca_address_sk#101, ca_state#102, ca_country#103] +Condition : (ca_state#102 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#101)) + +(61) BroadcastExchange +Input [3]: [ca_address_sk#101, ca_state#102, ca_country#103] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#104] + +(62) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [c_current_addr_sk#98] +Right keys [1]: [ca_address_sk#101] +Join condition: None + +(63) Project [codegen id : 15] +Output [11]: [cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cs_sold_date_sk#93, cd_dep_count#95, c_birth_year#99, ca_state#102, ca_country#103] +Input [13]: [cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cs_sold_date_sk#93, cd_dep_count#95, c_current_addr_sk#98, c_birth_year#99, ca_address_sk#101, ca_state#102, ca_country#103] + +(64) ReusedExchange [Reuses operator id: 34] +Output [1]: [d_date_sk#105] + +(65) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [cs_sold_date_sk#93] +Right keys [1]: [d_date_sk#105] +Join condition: None + +(66) Project [codegen id : 15] +Output [10]: [cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cd_dep_count#95, c_birth_year#99, ca_state#102, ca_country#103] +Input [12]: [cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cs_sold_date_sk#93, cd_dep_count#95, c_birth_year#99, ca_state#102, ca_country#103, d_date_sk#105] + +(67) ReusedExchange [Reuses operator id: 40] +Output [2]: [i_item_sk#106, i_item_id#107] + +(68) BroadcastHashJoin [codegen id : 15] +Left keys [1]: [cs_item_sk#87] +Right keys [1]: [i_item_sk#106] +Join condition: None + +(69) Project [codegen id : 15] +Output [10]: [i_item_id#107, ca_country#103, ca_state#102, cast(cs_quantity#88 as decimal(12,2)) AS agg1#35, cast(cs_list_price#89 as decimal(12,2)) AS agg2#36, cast(cs_coupon_amt#91 as decimal(12,2)) AS agg3#37, cast(cs_sales_price#90 as decimal(12,2)) AS agg4#38, cast(cs_net_profit#92 as decimal(12,2)) AS agg5#39, cast(c_birth_year#99 as decimal(12,2)) AS agg6#40, cast(cd_dep_count#95 as decimal(12,2)) AS agg7#41] +Input [12]: [cs_item_sk#87, cs_quantity#88, cs_list_price#89, cs_sales_price#90, cs_coupon_amt#91, cs_net_profit#92, cd_dep_count#95, c_birth_year#99, ca_state#102, ca_country#103, i_item_sk#106, i_item_id#107] + +(70) HashAggregate [codegen id : 15] +Input [10]: [i_item_id#107, ca_country#103, ca_state#102, agg1#35, agg2#36, agg3#37, agg4#38, agg5#39, agg6#40, agg7#41] +Keys [3]: [i_item_id#107, ca_country#103, ca_state#102] +Functions [7]: [partial_avg(agg1#35), partial_avg(agg2#36), partial_avg(agg3#37), partial_avg(agg4#38), partial_avg(agg5#39), partial_avg(agg6#40), partial_avg(agg7#41)] +Aggregate Attributes [14]: [sum#108, count#109, sum#110, count#111, sum#112, count#113, sum#114, count#115, sum#116, count#117, sum#118, count#119, sum#120, count#121] +Results [17]: [i_item_id#107, ca_country#103, ca_state#102, sum#122, count#123, sum#124, count#125, sum#126, count#127, sum#128, count#129, sum#130, count#131, sum#132, count#133, sum#134, count#135] + +(71) Exchange +Input [17]: [i_item_id#107, ca_country#103, ca_state#102, sum#122, count#123, sum#124, count#125, sum#126, count#127, sum#128, count#129, sum#130, count#131, sum#132, count#133, sum#134, count#135] +Arguments: hashpartitioning(i_item_id#107, ca_country#103, ca_state#102, 5), ENSURE_REQUIREMENTS, [id=#136] + +(72) HashAggregate [codegen id : 16] +Input [17]: [i_item_id#107, ca_country#103, ca_state#102, sum#122, count#123, sum#124, count#125, sum#126, count#127, sum#128, count#129, sum#130, count#131, sum#132, count#133, sum#134, count#135] +Keys [3]: [i_item_id#107, ca_country#103, ca_state#102] +Functions [7]: [avg(agg1#35), avg(agg2#36), avg(agg3#37), avg(agg4#38), avg(agg5#39), avg(agg6#40), avg(agg7#41)] +Aggregate Attributes [7]: [avg(agg1#35)#137, avg(agg2#36)#138, avg(agg3#37)#139, avg(agg4#38)#140, avg(agg5#39)#141, avg(agg6#40)#142, avg(agg7#41)#143] +Results [11]: [i_item_id#107, ca_country#103, ca_state#102, null AS county#144, avg(agg1#35)#137 AS agg1#145, avg(agg2#36)#138 AS agg2#146, avg(agg3#37)#139 AS agg3#147, avg(agg4#38)#140 AS agg4#148, avg(agg5#39)#141 AS agg5#149, avg(agg6#40)#142 AS agg6#150, avg(agg7#41)#143 AS agg7#151] + +(73) Scan parquet default.catalog_sales +Output [9]: [cs_bill_customer_sk#152, cs_bill_cdemo_sk#153, cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cs_sold_date_sk#160] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#160), dynamicpruningexpression(cs_sold_date_sk#160 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(74) ColumnarToRow [codegen id : 23] +Input [9]: [cs_bill_customer_sk#152, cs_bill_cdemo_sk#153, cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cs_sold_date_sk#160] + +(75) Filter [codegen id : 23] +Input [9]: [cs_bill_customer_sk#152, cs_bill_cdemo_sk#153, cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cs_sold_date_sk#160] +Condition : ((isnotnull(cs_bill_cdemo_sk#153) AND isnotnull(cs_bill_customer_sk#152)) AND isnotnull(cs_item_sk#154)) + +(76) ReusedExchange [Reuses operator id: 8] +Output [2]: [cd_demo_sk#161, cd_dep_count#162] + +(77) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [cs_bill_cdemo_sk#153] +Right keys [1]: [cd_demo_sk#161] +Join condition: None + +(78) Project [codegen id : 23] +Output [9]: [cs_bill_customer_sk#152, cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cs_sold_date_sk#160, cd_dep_count#162] +Input [11]: [cs_bill_customer_sk#152, cs_bill_cdemo_sk#153, cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cs_sold_date_sk#160, cd_demo_sk#161, cd_dep_count#162] + +(79) ReusedExchange [Reuses operator id: 15] +Output [4]: [c_customer_sk#163, c_current_cdemo_sk#164, c_current_addr_sk#165, c_birth_year#166] + +(80) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [cs_bill_customer_sk#152] +Right keys [1]: [c_customer_sk#163] +Join condition: None + +(81) Project [codegen id : 23] +Output [11]: [cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cs_sold_date_sk#160, cd_dep_count#162, c_current_cdemo_sk#164, c_current_addr_sk#165, c_birth_year#166] +Input [13]: [cs_bill_customer_sk#152, cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cs_sold_date_sk#160, cd_dep_count#162, c_customer_sk#163, c_current_cdemo_sk#164, c_current_addr_sk#165, c_birth_year#166] + +(82) ReusedExchange [Reuses operator id: 21] +Output [1]: [cd_demo_sk#167] + +(83) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [c_current_cdemo_sk#164] +Right keys [1]: [cd_demo_sk#167] +Join condition: None + +(84) Project [codegen id : 23] +Output [10]: [cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cs_sold_date_sk#160, cd_dep_count#162, c_current_addr_sk#165, c_birth_year#166] +Input [12]: [cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cs_sold_date_sk#160, cd_dep_count#162, c_current_cdemo_sk#164, c_current_addr_sk#165, c_birth_year#166, cd_demo_sk#167] + +(85) Scan parquet default.customer_address +Output [3]: [ca_address_sk#168, ca_state#169, ca_country#170] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(86) ColumnarToRow [codegen id : 20] +Input [3]: [ca_address_sk#168, ca_state#169, ca_country#170] + +(87) Filter [codegen id : 20] +Input [3]: [ca_address_sk#168, ca_state#169, ca_country#170] +Condition : (ca_state#169 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#168)) + +(88) Project [codegen id : 20] +Output [2]: [ca_address_sk#168, ca_country#170] +Input [3]: [ca_address_sk#168, ca_state#169, ca_country#170] + +(89) BroadcastExchange +Input [2]: [ca_address_sk#168, ca_country#170] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#171] + +(90) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [c_current_addr_sk#165] +Right keys [1]: [ca_address_sk#168] +Join condition: None + +(91) Project [codegen id : 23] +Output [10]: [cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cs_sold_date_sk#160, cd_dep_count#162, c_birth_year#166, ca_country#170] +Input [12]: [cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cs_sold_date_sk#160, cd_dep_count#162, c_current_addr_sk#165, c_birth_year#166, ca_address_sk#168, ca_country#170] + +(92) ReusedExchange [Reuses operator id: 34] +Output [1]: [d_date_sk#172] + +(93) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [cs_sold_date_sk#160] +Right keys [1]: [d_date_sk#172] +Join condition: None + +(94) Project [codegen id : 23] +Output [9]: [cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cd_dep_count#162, c_birth_year#166, ca_country#170] +Input [11]: [cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cs_sold_date_sk#160, cd_dep_count#162, c_birth_year#166, ca_country#170, d_date_sk#172] + +(95) ReusedExchange [Reuses operator id: 40] +Output [2]: [i_item_sk#173, i_item_id#174] + +(96) BroadcastHashJoin [codegen id : 23] +Left keys [1]: [cs_item_sk#154] +Right keys [1]: [i_item_sk#173] +Join condition: None + +(97) Project [codegen id : 23] +Output [9]: [i_item_id#174, ca_country#170, cast(cs_quantity#155 as decimal(12,2)) AS agg1#35, cast(cs_list_price#156 as decimal(12,2)) AS agg2#36, cast(cs_coupon_amt#158 as decimal(12,2)) AS agg3#37, cast(cs_sales_price#157 as decimal(12,2)) AS agg4#38, cast(cs_net_profit#159 as decimal(12,2)) AS agg5#39, cast(c_birth_year#166 as decimal(12,2)) AS agg6#40, cast(cd_dep_count#162 as decimal(12,2)) AS agg7#41] +Input [11]: [cs_item_sk#154, cs_quantity#155, cs_list_price#156, cs_sales_price#157, cs_coupon_amt#158, cs_net_profit#159, cd_dep_count#162, c_birth_year#166, ca_country#170, i_item_sk#173, i_item_id#174] + +(98) HashAggregate [codegen id : 23] +Input [9]: [i_item_id#174, ca_country#170, agg1#35, agg2#36, agg3#37, agg4#38, agg5#39, agg6#40, agg7#41] +Keys [2]: [i_item_id#174, ca_country#170] +Functions [7]: [partial_avg(agg1#35), partial_avg(agg2#36), partial_avg(agg3#37), partial_avg(agg4#38), partial_avg(agg5#39), partial_avg(agg6#40), partial_avg(agg7#41)] +Aggregate Attributes [14]: [sum#175, count#176, sum#177, count#178, sum#179, count#180, sum#181, count#182, sum#183, count#184, sum#185, count#186, sum#187, count#188] +Results [16]: [i_item_id#174, ca_country#170, sum#189, count#190, sum#191, count#192, sum#193, count#194, sum#195, count#196, sum#197, count#198, sum#199, count#200, sum#201, count#202] + +(99) Exchange +Input [16]: [i_item_id#174, ca_country#170, sum#189, count#190, sum#191, count#192, sum#193, count#194, sum#195, count#196, sum#197, count#198, sum#199, count#200, sum#201, count#202] +Arguments: hashpartitioning(i_item_id#174, ca_country#170, 5), ENSURE_REQUIREMENTS, [id=#203] + +(100) HashAggregate [codegen id : 24] +Input [16]: [i_item_id#174, ca_country#170, sum#189, count#190, sum#191, count#192, sum#193, count#194, sum#195, count#196, sum#197, count#198, sum#199, count#200, sum#201, count#202] +Keys [2]: [i_item_id#174, ca_country#170] +Functions [7]: [avg(agg1#35), avg(agg2#36), avg(agg3#37), avg(agg4#38), avg(agg5#39), avg(agg6#40), avg(agg7#41)] +Aggregate Attributes [7]: [avg(agg1#35)#204, avg(agg2#36)#205, avg(agg3#37)#206, avg(agg4#38)#207, avg(agg5#39)#208, avg(agg6#40)#209, avg(agg7#41)#210] +Results [11]: [i_item_id#174, ca_country#170, null AS ca_state#211, null AS county#212, avg(agg1#35)#204 AS agg1#213, avg(agg2#36)#205 AS agg2#214, avg(agg3#37)#206 AS agg3#215, avg(agg4#38)#207 AS agg4#216, avg(agg5#39)#208 AS agg5#217, avg(agg6#40)#209 AS agg6#218, avg(agg7#41)#210 AS agg7#219] + +(101) Scan parquet default.catalog_sales +Output [9]: [cs_bill_customer_sk#220, cs_bill_cdemo_sk#221, cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cs_sold_date_sk#228] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#228), dynamicpruningexpression(cs_sold_date_sk#228 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(102) ColumnarToRow [codegen id : 31] +Input [9]: [cs_bill_customer_sk#220, cs_bill_cdemo_sk#221, cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cs_sold_date_sk#228] + +(103) Filter [codegen id : 31] +Input [9]: [cs_bill_customer_sk#220, cs_bill_cdemo_sk#221, cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cs_sold_date_sk#228] +Condition : ((isnotnull(cs_bill_cdemo_sk#221) AND isnotnull(cs_bill_customer_sk#220)) AND isnotnull(cs_item_sk#222)) + +(104) ReusedExchange [Reuses operator id: 8] +Output [2]: [cd_demo_sk#229, cd_dep_count#230] + +(105) BroadcastHashJoin [codegen id : 31] +Left keys [1]: [cs_bill_cdemo_sk#221] +Right keys [1]: [cd_demo_sk#229] +Join condition: None + +(106) Project [codegen id : 31] +Output [9]: [cs_bill_customer_sk#220, cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cs_sold_date_sk#228, cd_dep_count#230] +Input [11]: [cs_bill_customer_sk#220, cs_bill_cdemo_sk#221, cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cs_sold_date_sk#228, cd_demo_sk#229, cd_dep_count#230] + +(107) ReusedExchange [Reuses operator id: 15] +Output [4]: [c_customer_sk#231, c_current_cdemo_sk#232, c_current_addr_sk#233, c_birth_year#234] + +(108) BroadcastHashJoin [codegen id : 31] +Left keys [1]: [cs_bill_customer_sk#220] +Right keys [1]: [c_customer_sk#231] +Join condition: None + +(109) Project [codegen id : 31] +Output [11]: [cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cs_sold_date_sk#228, cd_dep_count#230, c_current_cdemo_sk#232, c_current_addr_sk#233, c_birth_year#234] +Input [13]: [cs_bill_customer_sk#220, cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cs_sold_date_sk#228, cd_dep_count#230, c_customer_sk#231, c_current_cdemo_sk#232, c_current_addr_sk#233, c_birth_year#234] + +(110) ReusedExchange [Reuses operator id: 21] +Output [1]: [cd_demo_sk#235] + +(111) BroadcastHashJoin [codegen id : 31] +Left keys [1]: [c_current_cdemo_sk#232] +Right keys [1]: [cd_demo_sk#235] +Join condition: None + +(112) Project [codegen id : 31] +Output [10]: [cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cs_sold_date_sk#228, cd_dep_count#230, c_current_addr_sk#233, c_birth_year#234] +Input [12]: [cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cs_sold_date_sk#228, cd_dep_count#230, c_current_cdemo_sk#232, c_current_addr_sk#233, c_birth_year#234, cd_demo_sk#235] + +(113) Scan parquet default.customer_address +Output [2]: [ca_address_sk#236, ca_state#237] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [In(ca_state, [ND,WI,AL,NC,OK,MS,TN]), IsNotNull(ca_address_sk)] +ReadSchema: struct + +(114) ColumnarToRow [codegen id : 28] +Input [2]: [ca_address_sk#236, ca_state#237] + +(115) Filter [codegen id : 28] +Input [2]: [ca_address_sk#236, ca_state#237] +Condition : (ca_state#237 IN (ND,WI,AL,NC,OK,MS,TN) AND isnotnull(ca_address_sk#236)) + +(116) Project [codegen id : 28] +Output [1]: [ca_address_sk#236] +Input [2]: [ca_address_sk#236, ca_state#237] + +(117) BroadcastExchange +Input [1]: [ca_address_sk#236] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#238] + +(118) BroadcastHashJoin [codegen id : 31] +Left keys [1]: [c_current_addr_sk#233] +Right keys [1]: [ca_address_sk#236] +Join condition: None + +(119) Project [codegen id : 31] +Output [9]: [cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cs_sold_date_sk#228, cd_dep_count#230, c_birth_year#234] +Input [11]: [cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cs_sold_date_sk#228, cd_dep_count#230, c_current_addr_sk#233, c_birth_year#234, ca_address_sk#236] + +(120) ReusedExchange [Reuses operator id: 34] +Output [1]: [d_date_sk#239] + +(121) BroadcastHashJoin [codegen id : 31] +Left keys [1]: [cs_sold_date_sk#228] +Right keys [1]: [d_date_sk#239] +Join condition: None + +(122) Project [codegen id : 31] +Output [8]: [cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cd_dep_count#230, c_birth_year#234] +Input [10]: [cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cs_sold_date_sk#228, cd_dep_count#230, c_birth_year#234, d_date_sk#239] + +(123) ReusedExchange [Reuses operator id: 40] +Output [2]: [i_item_sk#240, i_item_id#241] + +(124) BroadcastHashJoin [codegen id : 31] +Left keys [1]: [cs_item_sk#222] +Right keys [1]: [i_item_sk#240] +Join condition: None + +(125) Project [codegen id : 31] +Output [8]: [i_item_id#241, cast(cs_quantity#223 as decimal(12,2)) AS agg1#35, cast(cs_list_price#224 as decimal(12,2)) AS agg2#36, cast(cs_coupon_amt#226 as decimal(12,2)) AS agg3#37, cast(cs_sales_price#225 as decimal(12,2)) AS agg4#38, cast(cs_net_profit#227 as decimal(12,2)) AS agg5#39, cast(c_birth_year#234 as decimal(12,2)) AS agg6#40, cast(cd_dep_count#230 as decimal(12,2)) AS agg7#41] +Input [10]: [cs_item_sk#222, cs_quantity#223, cs_list_price#224, cs_sales_price#225, cs_coupon_amt#226, cs_net_profit#227, cd_dep_count#230, c_birth_year#234, i_item_sk#240, i_item_id#241] + +(126) HashAggregate [codegen id : 31] +Input [8]: [i_item_id#241, agg1#35, agg2#36, agg3#37, agg4#38, agg5#39, agg6#40, agg7#41] +Keys [1]: [i_item_id#241] +Functions [7]: [partial_avg(agg1#35), partial_avg(agg2#36), partial_avg(agg3#37), partial_avg(agg4#38), partial_avg(agg5#39), partial_avg(agg6#40), partial_avg(agg7#41)] +Aggregate Attributes [14]: [sum#242, count#243, sum#244, count#245, sum#246, count#247, sum#248, count#249, sum#250, count#251, sum#252, count#253, sum#254, count#255] +Results [15]: [i_item_id#241, sum#256, count#257, sum#258, count#259, sum#260, count#261, sum#262, count#263, sum#264, count#265, sum#266, count#267, sum#268, count#269] + +(127) Exchange +Input [15]: [i_item_id#241, sum#256, count#257, sum#258, count#259, sum#260, count#261, sum#262, count#263, sum#264, count#265, sum#266, count#267, sum#268, count#269] +Arguments: hashpartitioning(i_item_id#241, 5), ENSURE_REQUIREMENTS, [id=#270] + +(128) HashAggregate [codegen id : 32] +Input [15]: [i_item_id#241, sum#256, count#257, sum#258, count#259, sum#260, count#261, sum#262, count#263, sum#264, count#265, sum#266, count#267, sum#268, count#269] +Keys [1]: [i_item_id#241] +Functions [7]: [avg(agg1#35), avg(agg2#36), avg(agg3#37), avg(agg4#38), avg(agg5#39), avg(agg6#40), avg(agg7#41)] +Aggregate Attributes [7]: [avg(agg1#35)#271, avg(agg2#36)#272, avg(agg3#37)#273, avg(agg4#38)#274, avg(agg5#39)#275, avg(agg6#40)#276, avg(agg7#41)#277] +Results [11]: [i_item_id#241, null AS ca_country#278, null AS ca_state#279, null AS county#280, avg(agg1#35)#271 AS agg1#281, avg(agg2#36)#272 AS agg2#282, avg(agg3#37)#273 AS agg3#283, avg(agg4#38)#274 AS agg4#284, avg(agg5#39)#275 AS agg5#285, avg(agg6#40)#276 AS agg6#286, avg(agg7#41)#277 AS agg7#287] + +(129) Scan parquet default.catalog_sales +Output [9]: [cs_bill_customer_sk#288, cs_bill_cdemo_sk#289, cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cs_sold_date_sk#296] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#296), dynamicpruningexpression(cs_sold_date_sk#296 IN dynamicpruning#10)] +PushedFilters: [IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_customer_sk), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(130) ColumnarToRow [codegen id : 39] +Input [9]: [cs_bill_customer_sk#288, cs_bill_cdemo_sk#289, cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cs_sold_date_sk#296] + +(131) Filter [codegen id : 39] +Input [9]: [cs_bill_customer_sk#288, cs_bill_cdemo_sk#289, cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cs_sold_date_sk#296] +Condition : ((isnotnull(cs_bill_cdemo_sk#289) AND isnotnull(cs_bill_customer_sk#288)) AND isnotnull(cs_item_sk#290)) + +(132) ReusedExchange [Reuses operator id: 8] +Output [2]: [cd_demo_sk#297, cd_dep_count#298] + +(133) BroadcastHashJoin [codegen id : 39] +Left keys [1]: [cs_bill_cdemo_sk#289] +Right keys [1]: [cd_demo_sk#297] +Join condition: None + +(134) Project [codegen id : 39] +Output [9]: [cs_bill_customer_sk#288, cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cs_sold_date_sk#296, cd_dep_count#298] +Input [11]: [cs_bill_customer_sk#288, cs_bill_cdemo_sk#289, cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cs_sold_date_sk#296, cd_demo_sk#297, cd_dep_count#298] + +(135) ReusedExchange [Reuses operator id: 15] +Output [4]: [c_customer_sk#299, c_current_cdemo_sk#300, c_current_addr_sk#301, c_birth_year#302] + +(136) BroadcastHashJoin [codegen id : 39] +Left keys [1]: [cs_bill_customer_sk#288] +Right keys [1]: [c_customer_sk#299] +Join condition: None + +(137) Project [codegen id : 39] +Output [11]: [cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cs_sold_date_sk#296, cd_dep_count#298, c_current_cdemo_sk#300, c_current_addr_sk#301, c_birth_year#302] +Input [13]: [cs_bill_customer_sk#288, cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cs_sold_date_sk#296, cd_dep_count#298, c_customer_sk#299, c_current_cdemo_sk#300, c_current_addr_sk#301, c_birth_year#302] + +(138) ReusedExchange [Reuses operator id: 21] +Output [1]: [cd_demo_sk#303] + +(139) BroadcastHashJoin [codegen id : 39] +Left keys [1]: [c_current_cdemo_sk#300] +Right keys [1]: [cd_demo_sk#303] +Join condition: None + +(140) Project [codegen id : 39] +Output [10]: [cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cs_sold_date_sk#296, cd_dep_count#298, c_current_addr_sk#301, c_birth_year#302] +Input [12]: [cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cs_sold_date_sk#296, cd_dep_count#298, c_current_cdemo_sk#300, c_current_addr_sk#301, c_birth_year#302, cd_demo_sk#303] + +(141) ReusedExchange [Reuses operator id: 117] +Output [1]: [ca_address_sk#304] + +(142) BroadcastHashJoin [codegen id : 39] +Left keys [1]: [c_current_addr_sk#301] +Right keys [1]: [ca_address_sk#304] +Join condition: None + +(143) Project [codegen id : 39] +Output [9]: [cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cs_sold_date_sk#296, cd_dep_count#298, c_birth_year#302] +Input [11]: [cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cs_sold_date_sk#296, cd_dep_count#298, c_current_addr_sk#301, c_birth_year#302, ca_address_sk#304] + +(144) ReusedExchange [Reuses operator id: 34] +Output [1]: [d_date_sk#305] + +(145) BroadcastHashJoin [codegen id : 39] +Left keys [1]: [cs_sold_date_sk#296] +Right keys [1]: [d_date_sk#305] +Join condition: None + +(146) Project [codegen id : 39] +Output [8]: [cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cd_dep_count#298, c_birth_year#302] +Input [10]: [cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cs_sold_date_sk#296, cd_dep_count#298, c_birth_year#302, d_date_sk#305] + +(147) Scan parquet default.item +Output [1]: [i_item_sk#306] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(148) ColumnarToRow [codegen id : 38] +Input [1]: [i_item_sk#306] + +(149) Filter [codegen id : 38] +Input [1]: [i_item_sk#306] +Condition : isnotnull(i_item_sk#306) + +(150) BroadcastExchange +Input [1]: [i_item_sk#306] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#307] + +(151) BroadcastHashJoin [codegen id : 39] +Left keys [1]: [cs_item_sk#290] +Right keys [1]: [i_item_sk#306] +Join condition: None + +(152) Project [codegen id : 39] +Output [7]: [cast(cs_quantity#291 as decimal(12,2)) AS agg1#35, cast(cs_list_price#292 as decimal(12,2)) AS agg2#36, cast(cs_coupon_amt#294 as decimal(12,2)) AS agg3#37, cast(cs_sales_price#293 as decimal(12,2)) AS agg4#38, cast(cs_net_profit#295 as decimal(12,2)) AS agg5#39, cast(c_birth_year#302 as decimal(12,2)) AS agg6#40, cast(cd_dep_count#298 as decimal(12,2)) AS agg7#41] +Input [9]: [cs_item_sk#290, cs_quantity#291, cs_list_price#292, cs_sales_price#293, cs_coupon_amt#294, cs_net_profit#295, cd_dep_count#298, c_birth_year#302, i_item_sk#306] + +(153) HashAggregate [codegen id : 39] +Input [7]: [agg1#35, agg2#36, agg3#37, agg4#38, agg5#39, agg6#40, agg7#41] +Keys: [] +Functions [7]: [partial_avg(agg1#35), partial_avg(agg2#36), partial_avg(agg3#37), partial_avg(agg4#38), partial_avg(agg5#39), partial_avg(agg6#40), partial_avg(agg7#41)] +Aggregate Attributes [14]: [sum#308, count#309, sum#310, count#311, sum#312, count#313, sum#314, count#315, sum#316, count#317, sum#318, count#319, sum#320, count#321] +Results [14]: [sum#322, count#323, sum#324, count#325, sum#326, count#327, sum#328, count#329, sum#330, count#331, sum#332, count#333, sum#334, count#335] + +(154) Exchange +Input [14]: [sum#322, count#323, sum#324, count#325, sum#326, count#327, sum#328, count#329, sum#330, count#331, sum#332, count#333, sum#334, count#335] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#336] + +(155) HashAggregate [codegen id : 40] +Input [14]: [sum#322, count#323, sum#324, count#325, sum#326, count#327, sum#328, count#329, sum#330, count#331, sum#332, count#333, sum#334, count#335] +Keys: [] +Functions [7]: [avg(agg1#35), avg(agg2#36), avg(agg3#37), avg(agg4#38), avg(agg5#39), avg(agg6#40), avg(agg7#41)] +Aggregate Attributes [7]: [avg(agg1#35)#337, avg(agg2#36)#338, avg(agg3#37)#339, avg(agg4#38)#340, avg(agg5#39)#341, avg(agg6#40)#342, avg(agg7#41)#343] +Results [11]: [null AS i_item_id#344, null AS ca_country#345, null AS ca_state#346, null AS county#347, avg(agg1#35)#337 AS agg1#348, avg(agg2#36)#338 AS agg2#349, avg(agg3#37)#339 AS agg3#350, avg(agg4#38)#340 AS agg4#351, avg(agg5#39)#341 AS agg5#352, avg(agg6#40)#342 AS agg6#353, avg(agg7#41)#343 AS agg7#354] + +(156) Union + +(157) TakeOrderedAndProject +Input [11]: [i_item_id#33, ca_country#27, ca_state#26, ca_county#25, agg1#78, agg2#79, agg3#80, agg4#81, agg5#82, agg6#83, agg7#84] +Arguments: 100, [ca_country#27 ASC NULLS FIRST, ca_state#26 ASC NULLS FIRST, ca_county#25 ASC NULLS FIRST, i_item_id#33 ASC NULLS FIRST], [i_item_id#33, ca_country#27, ca_state#26, ca_county#25, agg1#78, agg2#79, agg3#80, agg4#81, agg5#82, agg6#83, agg7#84] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#9 IN dynamicpruning#10 +ReusedExchange (158) + + +(158) ReusedExchange [Reuses operator id: 34] +Output [1]: [d_date_sk#29] + +Subquery:2 Hosting operator id = 46 Hosting Expression = cs_sold_date_sk#93 IN dynamicpruning#10 + +Subquery:3 Hosting operator id = 73 Hosting Expression = cs_sold_date_sk#160 IN dynamicpruning#10 + +Subquery:4 Hosting operator id = 101 Hosting Expression = cs_sold_date_sk#228 IN dynamicpruning#10 + +Subquery:5 Hosting operator id = 129 Hosting Expression = cs_sold_date_sk#296 IN dynamicpruning#10 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/simplified.txt new file mode 100644 index 0000000000000..abc243f55d639 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q18a/simplified.txt @@ -0,0 +1,233 @@ +TakeOrderedAndProject [ca_country,ca_state,ca_county,i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7] + Union + WholeStageCodegen (8) + HashAggregate [i_item_id,ca_country,ca_state,ca_county,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,ca_country,ca_state,ca_county] #1 + WholeStageCodegen (7) + HashAggregate [i_item_id,ca_country,ca_state,ca_county,agg1,agg2,agg3,agg4,agg5,agg6,agg7] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,ca_country,ca_state,ca_county,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year,ca_county,ca_state,ca_country] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_birth_year,ca_county,ca_state,ca_country] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_addr_sk,c_birth_year] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [cd_demo_sk,cd_dep_count] + Filter [cd_gender,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_education_status,cd_dep_count] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + Filter [c_birth_month,c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_month,c_birth_year] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_county,ca_state,ca_country] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (6) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + WholeStageCodegen (16) + HashAggregate [i_item_id,ca_country,ca_state,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),county,agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,ca_country,ca_state] #8 + WholeStageCodegen (15) + HashAggregate [i_item_id,ca_country,ca_state,agg1,agg2,agg3,agg4,agg5,agg6,agg7] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,ca_country,ca_state,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year,ca_state,ca_country] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_birth_year,ca_state,ca_country] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_addr_sk,c_birth_year] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [cd_demo_sk,cd_dep_count] #3 + InputAdapter + ReusedExchange [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] #4 + InputAdapter + ReusedExchange [cd_demo_sk] #5 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (12) + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_country] + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #7 + WholeStageCodegen (24) + HashAggregate [i_item_id,ca_country,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),ca_state,county,agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,ca_country] #10 + WholeStageCodegen (23) + HashAggregate [i_item_id,ca_country,agg1,agg2,agg3,agg4,agg5,agg6,agg7] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,ca_country,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year,ca_country] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_birth_year,ca_country] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_addr_sk,c_birth_year] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [cd_demo_sk,cd_dep_count] #3 + InputAdapter + ReusedExchange [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] #4 + InputAdapter + ReusedExchange [cd_demo_sk] #5 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (20) + Project [ca_address_sk,ca_country] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_country] + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #7 + WholeStageCodegen (32) + HashAggregate [i_item_id,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),ca_country,ca_state,county,agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id] #12 + WholeStageCodegen (31) + HashAggregate [i_item_id,agg1,agg2,agg3,agg4,agg5,agg6,agg7] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_birth_year] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_addr_sk,c_birth_year] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [cd_demo_sk,cd_dep_count] #3 + InputAdapter + ReusedExchange [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] #4 + InputAdapter + ReusedExchange [cd_demo_sk] #5 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (28) + Project [ca_address_sk] + Filter [ca_state,ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #7 + WholeStageCodegen (40) + HashAggregate [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(agg2),avg(agg3),avg(agg4),avg(agg5),avg(agg6),avg(agg7),i_item_id,ca_country,ca_state,county,agg1,agg2,agg3,agg4,agg5,agg6,agg7,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange #14 + WholeStageCodegen (39) + HashAggregate [agg1,agg2,agg3,agg4,agg5,agg6,agg7] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [cs_quantity,cs_list_price,cs_coupon_amt,cs_sales_price,cs_net_profit,c_birth_year,cd_dep_count] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cd_dep_count,c_birth_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_birth_year] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_addr_sk,c_birth_year] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] + BroadcastHashJoin [cs_bill_customer_sk,c_customer_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk,cd_dep_count] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Filter [cs_bill_cdemo_sk,cs_bill_customer_sk,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_bill_cdemo_sk,cs_item_sk,cs_quantity,cs_list_price,cs_sales_price,cs_coupon_amt,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [cd_demo_sk,cd_dep_count] #3 + InputAdapter + ReusedExchange [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk,c_birth_year] #4 + InputAdapter + ReusedExchange [cd_demo_sk] #5 + InputAdapter + ReusedExchange [ca_address_sk] #13 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (38) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt new file mode 100644 index 0000000000000..d9b14fcfb5bf9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/explain.txt @@ -0,0 +1,163 @@ +== Physical Plan == +TakeOrderedAndProject (27) ++- * Project (26) + +- Window (25) + +- * Sort (24) + +- Exchange (23) + +- * HashAggregate (22) + +- Exchange (21) + +- * HashAggregate (20) + +- * Project (19) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.catalog_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) + +- * Filter (15) + +- * ColumnarToRow (14) + +- Scan parquet default.date_dim (13) + + +(1) Scan parquet default.catalog_sales +Output [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#3), dynamicpruningexpression(cs_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] + +(3) Filter [codegen id : 1] +Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] +Condition : isnotnull(cs_item_sk#1) + +(4) Exchange +Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] +Arguments: hashpartitioning(cs_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#5] + +(5) Sort [codegen id : 2] +Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] +Arguments: [cs_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.item +Output [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports ,Books ,Home ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] + +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Condition : (i_category#11 IN (Sports ,Books ,Home ) AND isnotnull(i_item_sk#6)) + +(9) Exchange +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Arguments: hashpartitioning(i_item_sk#6, 5), ENSURE_REQUIREMENTS, [id=#12] + +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 + +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [cs_item_sk#1] +Right keys [1]: [i_item_sk#6] +Join condition: None + +(12) Project [codegen id : 6] +Output [7]: [cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Input [9]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] + +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#13, d_date#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#13, d_date#14] + +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#13, d_date#14] +Condition : (((isnotnull(d_date#14) AND (d_date#14 >= 1999-02-22)) AND (d_date#14 <= 1999-03-24)) AND isnotnull(d_date_sk#13)) + +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#13] +Input [2]: [d_date_sk#13, d_date#14] + +(17) BroadcastExchange +Input [1]: [d_date_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#3] +Right keys [1]: [d_date_sk#13] +Join condition: None + +(19) Project [codegen id : 6] +Output [6]: [cs_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Input [8]: [cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11, d_date_sk#13] + +(20) HashAggregate [codegen id : 6] +Input [6]: [cs_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#16] +Results [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] + +(21) Exchange +Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] +Arguments: hashpartitioning(i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, 5), ENSURE_REQUIREMENTS, [id=#18] + +(22) HashAggregate [codegen id : 7] +Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] +Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#2))#19] +Results [8]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#19,17,2) AS itemrevenue#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#19,17,2) AS _w0#21, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#19,17,2) AS _w1#22] + +(23) Exchange +Input [8]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22] +Arguments: hashpartitioning(i_class#10, 5), ENSURE_REQUIREMENTS, [id=#23] + +(24) Sort [codegen id : 8] +Input [8]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22] +Arguments: [i_class#10 ASC NULLS FIRST], false, 0 + +(25) Window +Input [8]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22] +Arguments: [sum(_w1#22) windowspecdefinition(i_class#10, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#24], [i_class#10] + +(26) Project [codegen id : 9] +Output [7]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#21) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#24)), DecimalType(38,17), true) AS revenueratio#25] +Input [9]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, _we0#24] + +(27) TakeOrderedAndProject +Input [7]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25] +Arguments: 100, [i_category#11 ASC NULLS FIRST, i_class#10 ASC NULLS FIRST, i_item_id#7 ASC NULLS FIRST, i_item_desc#8 ASC NULLS FIRST, revenueratio#25 ASC NULLS FIRST], [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (28) + + +(28) ReusedExchange [Reuses operator id: 17] +Output [1]: [d_date_sk#13] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt new file mode 100644 index 0000000000000..69e0754aed6d8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20.sf100/simplified.txt @@ -0,0 +1,49 @@ +TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_current_price,itemrevenue] + WholeStageCodegen (9) + Project [i_item_id,i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (8) + Sort [i_class] + InputAdapter + Exchange [i_class] #1 + WholeStageCodegen (7) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(cs_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #2 + WholeStageCodegen (6) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,cs_ext_sales_price] [sum,sum] + Project [cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_ext_sales_price,cs_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [cs_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #3 + WholeStageCodegen (1) + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20/explain.txt new file mode 100644 index 0000000000000..c6a345be29c9d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20/explain.txt @@ -0,0 +1,148 @@ +== Physical Plan == +TakeOrderedAndProject (24) ++- * Project (23) + +- Window (22) + +- * Sort (21) + +- Exchange (20) + +- * HashAggregate (19) + +- Exchange (18) + +- * HashAggregate (17) + +- * Project (16) + +- * BroadcastHashJoin Inner BuildRight (15) + :- * Project (9) + : +- * BroadcastHashJoin Inner BuildRight (8) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.catalog_sales (1) + : +- BroadcastExchange (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) + +- BroadcastExchange (14) + +- * Project (13) + +- * Filter (12) + +- * ColumnarToRow (11) + +- Scan parquet default.date_dim (10) + + +(1) Scan parquet default.catalog_sales +Output [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#3), dynamicpruningexpression(cs_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3] +Condition : isnotnull(cs_item_sk#1) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports ,Books ,Home ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports ,Books ,Home ) AND isnotnull(i_item_sk#5)) + +(7) BroadcastExchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(9) Project [codegen id : 3] +Output [7]: [cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [cs_item_sk#1, cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 1999-02-22)) AND (d_date#13 <= 1999-03-24)) AND isnotnull(d_date_sk#12)) + +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] + +(14) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#3] +Right keys [1]: [d_date_sk#12] +Join condition: None + +(16) Project [codegen id : 3] +Output [6]: [cs_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [cs_ext_sales_price#2, cs_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] + +(17) HashAggregate [codegen id : 3] +Input [6]: [cs_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [partial_sum(UnscaledValue(cs_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#15] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] + +(18) Exchange +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), ENSURE_REQUIREMENTS, [id=#17] + +(19) HashAggregate [codegen id : 4] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [sum(UnscaledValue(cs_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_ext_sales_price#2))#18] +Results [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#2))#18,17,2) AS _w1#21] + +(20) Exchange +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: hashpartitioning(i_class#9, 5), ENSURE_REQUIREMENTS, [id=#22] + +(21) Sort [codegen id : 5] +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 + +(22) Window +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] + +(23) Project [codegen id : 6] +Output [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] +Input [9]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, _we0#23] + +(24) TakeOrderedAndProject +Input [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Arguments: 100, [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (25) + + +(25) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20/simplified.txt new file mode 100644 index 0000000000000..2d49ed4224fc3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q20/simplified.txt @@ -0,0 +1,40 @@ +TakeOrderedAndProject [i_category,i_class,i_item_id,i_item_desc,revenueratio,i_current_price,itemrevenue] + WholeStageCodegen (6) + Project [i_item_id,i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (5) + Sort [i_class] + InputAdapter + Exchange [i_class] #1 + WholeStageCodegen (4) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(cs_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #2 + WholeStageCodegen (3) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,cs_ext_sales_price] [sum,sum] + Project [cs_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_ext_sales_price,cs_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_ext_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22.sf100/explain.txt new file mode 100644 index 0000000000000..8f9ec9e9cd68a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22.sf100/explain.txt @@ -0,0 +1,168 @@ +== Physical Plan == +TakeOrderedAndProject (28) ++- * HashAggregate (27) + +- Exchange (26) + +- * HashAggregate (25) + +- * Expand (24) + +- * BroadcastNestedLoopJoin Inner BuildRight (23) + :- * Project (19) + : +- * SortMergeJoin Inner (18) + : :- * Sort (12) + : : +- Exchange (11) + : : +- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.inventory (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- * Sort (17) + : +- Exchange (16) + : +- * Filter (15) + : +- * ColumnarToRow (14) + : +- Scan parquet default.item (13) + +- BroadcastExchange (22) + +- * ColumnarToRow (21) + +- Scan parquet default.warehouse (20) + + +(1) Scan parquet default.inventory +Output [3]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#3), dynamicpruningexpression(inv_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(inv_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3] +Condition : isnotnull(inv_item_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [inv_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 2] +Output [2]: [inv_item_sk#1, inv_quantity_on_hand#2] +Input [4]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3, d_date_sk#5] + +(11) Exchange +Input [2]: [inv_item_sk#1, inv_quantity_on_hand#2] +Arguments: hashpartitioning(inv_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#8] + +(12) Sort [codegen id : 3] +Input [2]: [inv_item_sk#1, inv_quantity_on_hand#2] +Arguments: [inv_item_sk#1 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.item +Output [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 4] +Input [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] + +(15) Filter [codegen id : 4] +Input [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Condition : isnotnull(i_item_sk#9) + +(16) Exchange +Input [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Arguments: hashpartitioning(i_item_sk#9, 5), ENSURE_REQUIREMENTS, [id=#14] + +(17) Sort [codegen id : 5] +Input [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Arguments: [i_item_sk#9 ASC NULLS FIRST], false, 0 + +(18) SortMergeJoin [codegen id : 7] +Left keys [1]: [inv_item_sk#1] +Right keys [1]: [i_item_sk#9] +Join condition: None + +(19) Project [codegen id : 7] +Output [5]: [inv_quantity_on_hand#2, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Input [7]: [inv_item_sk#1, inv_quantity_on_hand#2, i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] + +(20) Scan parquet default.warehouse +Output: [] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +ReadSchema: struct<> + +(21) ColumnarToRow [codegen id : 6] +Input: [] + +(22) BroadcastExchange +Input: [] +Arguments: IdentityBroadcastMode, [id=#15] + +(23) BroadcastNestedLoopJoin [codegen id : 7] +Join condition: None + +(24) Expand [codegen id : 7] +Input [5]: [inv_quantity_on_hand#2, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Arguments: [List(inv_quantity_on_hand#2, i_product_name#13, i_brand#10, i_class#11, i_category#12, 0), List(inv_quantity_on_hand#2, i_product_name#13, i_brand#10, i_class#11, null, 1), List(inv_quantity_on_hand#2, i_product_name#13, i_brand#10, null, null, 3), List(inv_quantity_on_hand#2, i_product_name#13, null, null, null, 7), List(inv_quantity_on_hand#2, null, null, null, null, 15)], [inv_quantity_on_hand#2, i_product_name#16, i_brand#17, i_class#18, i_category#19, spark_grouping_id#20] + +(25) HashAggregate [codegen id : 7] +Input [6]: [inv_quantity_on_hand#2, i_product_name#16, i_brand#17, i_class#18, i_category#19, spark_grouping_id#20] +Keys [5]: [i_product_name#16, i_brand#17, i_class#18, i_category#19, spark_grouping_id#20] +Functions [1]: [partial_avg(inv_quantity_on_hand#2)] +Aggregate Attributes [2]: [sum#21, count#22] +Results [7]: [i_product_name#16, i_brand#17, i_class#18, i_category#19, spark_grouping_id#20, sum#23, count#24] + +(26) Exchange +Input [7]: [i_product_name#16, i_brand#17, i_class#18, i_category#19, spark_grouping_id#20, sum#23, count#24] +Arguments: hashpartitioning(i_product_name#16, i_brand#17, i_class#18, i_category#19, spark_grouping_id#20, 5), ENSURE_REQUIREMENTS, [id=#25] + +(27) HashAggregate [codegen id : 8] +Input [7]: [i_product_name#16, i_brand#17, i_class#18, i_category#19, spark_grouping_id#20, sum#23, count#24] +Keys [5]: [i_product_name#16, i_brand#17, i_class#18, i_category#19, spark_grouping_id#20] +Functions [1]: [avg(inv_quantity_on_hand#2)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#2)#26] +Results [5]: [i_product_name#16, i_brand#17, i_class#18, i_category#19, avg(inv_quantity_on_hand#2)#26 AS qoh#27] + +(28) TakeOrderedAndProject +Input [5]: [i_product_name#16, i_brand#17, i_class#18, i_category#19, qoh#27] +Arguments: 100, [qoh#27 ASC NULLS FIRST, i_product_name#16 ASC NULLS FIRST, i_brand#17 ASC NULLS FIRST, i_class#18 ASC NULLS FIRST, i_category#19 ASC NULLS FIRST], [i_product_name#16, i_brand#17, i_class#18, i_category#19, qoh#27] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#3 IN dynamicpruning#4 +ReusedExchange (29) + + +(29) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22.sf100/simplified.txt new file mode 100644 index 0000000000000..ca9a5d0546027 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22.sf100/simplified.txt @@ -0,0 +1,49 @@ +TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] + WholeStageCodegen (8) + HashAggregate [i_product_name,i_brand,i_class,i_category,spark_grouping_id,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + Exchange [i_product_name,i_brand,i_class,i_category,spark_grouping_id] #1 + WholeStageCodegen (7) + HashAggregate [i_product_name,i_brand,i_class,i_category,spark_grouping_id,inv_quantity_on_hand] [sum,count,sum,count] + Expand [inv_quantity_on_hand,i_product_name,i_brand,i_class,i_category] + BroadcastNestedLoopJoin + Project [inv_quantity_on_hand,i_brand,i_class,i_category,i_product_name] + SortMergeJoin [inv_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [inv_item_sk] + InputAdapter + Exchange [inv_item_sk] #2 + WholeStageCodegen (2) + Project [inv_item_sk,inv_quantity_on_hand] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Filter [inv_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + WholeStageCodegen (5) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #4 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_product_name] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (6) + ColumnarToRow + InputAdapter + Scan parquet default.warehouse diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22/explain.txt new file mode 100644 index 0000000000000..7cd7526e9da63 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22/explain.txt @@ -0,0 +1,153 @@ +== Physical Plan == +TakeOrderedAndProject (25) ++- * HashAggregate (24) + +- Exchange (23) + +- * HashAggregate (22) + +- * Expand (21) + +- * BroadcastNestedLoopJoin Inner BuildRight (20) + :- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.inventory (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.item (11) + +- BroadcastExchange (19) + +- * ColumnarToRow (18) + +- Scan parquet default.warehouse (17) + + +(1) Scan parquet default.inventory +Output [3]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#3), dynamicpruningexpression(inv_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(inv_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [3]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3] + +(3) Filter [codegen id : 4] +Input [3]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3] +Condition : isnotnull(inv_item_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1200), LessThanOrEqual(d_month_seq,1211), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1200)) AND (d_month_seq#6 <= 1211)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 4] +Output [2]: [inv_item_sk#1, inv_quantity_on_hand#2] +Input [4]: [inv_item_sk#1, inv_quantity_on_hand#2, inv_date_sk#3, d_date_sk#5] + +(11) Scan parquet default.item +Output [5]: [i_item_sk#8, i_brand#9, i_class#10, i_category#11, i_product_name#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [5]: [i_item_sk#8, i_brand#9, i_class#10, i_category#11, i_product_name#12] + +(13) Filter [codegen id : 2] +Input [5]: [i_item_sk#8, i_brand#9, i_class#10, i_category#11, i_product_name#12] +Condition : isnotnull(i_item_sk#8) + +(14) BroadcastExchange +Input [5]: [i_item_sk#8, i_brand#9, i_class#10, i_category#11, i_product_name#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_item_sk#1] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(16) Project [codegen id : 4] +Output [5]: [inv_quantity_on_hand#2, i_brand#9, i_class#10, i_category#11, i_product_name#12] +Input [7]: [inv_item_sk#1, inv_quantity_on_hand#2, i_item_sk#8, i_brand#9, i_class#10, i_category#11, i_product_name#12] + +(17) Scan parquet default.warehouse +Output: [] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +ReadSchema: struct<> + +(18) ColumnarToRow [codegen id : 3] +Input: [] + +(19) BroadcastExchange +Input: [] +Arguments: IdentityBroadcastMode, [id=#14] + +(20) BroadcastNestedLoopJoin [codegen id : 4] +Join condition: None + +(21) Expand [codegen id : 4] +Input [5]: [inv_quantity_on_hand#2, i_brand#9, i_class#10, i_category#11, i_product_name#12] +Arguments: [List(inv_quantity_on_hand#2, i_product_name#12, i_brand#9, i_class#10, i_category#11, 0), List(inv_quantity_on_hand#2, i_product_name#12, i_brand#9, i_class#10, null, 1), List(inv_quantity_on_hand#2, i_product_name#12, i_brand#9, null, null, 3), List(inv_quantity_on_hand#2, i_product_name#12, null, null, null, 7), List(inv_quantity_on_hand#2, null, null, null, null, 15)], [inv_quantity_on_hand#2, i_product_name#15, i_brand#16, i_class#17, i_category#18, spark_grouping_id#19] + +(22) HashAggregate [codegen id : 4] +Input [6]: [inv_quantity_on_hand#2, i_product_name#15, i_brand#16, i_class#17, i_category#18, spark_grouping_id#19] +Keys [5]: [i_product_name#15, i_brand#16, i_class#17, i_category#18, spark_grouping_id#19] +Functions [1]: [partial_avg(inv_quantity_on_hand#2)] +Aggregate Attributes [2]: [sum#20, count#21] +Results [7]: [i_product_name#15, i_brand#16, i_class#17, i_category#18, spark_grouping_id#19, sum#22, count#23] + +(23) Exchange +Input [7]: [i_product_name#15, i_brand#16, i_class#17, i_category#18, spark_grouping_id#19, sum#22, count#23] +Arguments: hashpartitioning(i_product_name#15, i_brand#16, i_class#17, i_category#18, spark_grouping_id#19, 5), ENSURE_REQUIREMENTS, [id=#24] + +(24) HashAggregate [codegen id : 5] +Input [7]: [i_product_name#15, i_brand#16, i_class#17, i_category#18, spark_grouping_id#19, sum#22, count#23] +Keys [5]: [i_product_name#15, i_brand#16, i_class#17, i_category#18, spark_grouping_id#19] +Functions [1]: [avg(inv_quantity_on_hand#2)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#2)#25] +Results [5]: [i_product_name#15, i_brand#16, i_class#17, i_category#18, avg(inv_quantity_on_hand#2)#25 AS qoh#26] + +(25) TakeOrderedAndProject +Input [5]: [i_product_name#15, i_brand#16, i_class#17, i_category#18, qoh#26] +Arguments: 100, [qoh#26 ASC NULLS FIRST, i_product_name#15 ASC NULLS FIRST, i_brand#16 ASC NULLS FIRST, i_class#17 ASC NULLS FIRST, i_category#18 ASC NULLS FIRST], [i_product_name#15, i_brand#16, i_class#17, i_category#18, qoh#26] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#3 IN dynamicpruning#4 +ReusedExchange (26) + + +(26) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22/simplified.txt new file mode 100644 index 0000000000000..c8ef4786f2a76 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22/simplified.txt @@ -0,0 +1,40 @@ +TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] + WholeStageCodegen (5) + HashAggregate [i_product_name,i_brand,i_class,i_category,spark_grouping_id,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + Exchange [i_product_name,i_brand,i_class,i_category,spark_grouping_id] #1 + WholeStageCodegen (4) + HashAggregate [i_product_name,i_brand,i_class,i_category,spark_grouping_id,inv_quantity_on_hand] [sum,count,sum,count] + Expand [inv_quantity_on_hand,i_product_name,i_brand,i_class,i_category] + BroadcastNestedLoopJoin + Project [inv_quantity_on_hand,i_brand,i_class,i_category,i_product_name] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Project [inv_item_sk,inv_quantity_on_hand] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Filter [inv_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_product_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + ColumnarToRow + InputAdapter + Scan parquet default.warehouse diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt new file mode 100644 index 0000000000000..f5a7a9135cf29 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/explain.txt @@ -0,0 +1,327 @@ +== Physical Plan == +TakeOrderedAndProject (52) ++- Union (51) + :- * HashAggregate (30) + : +- * HashAggregate (29) + : +- * HashAggregate (28) + : +- Exchange (27) + : +- * HashAggregate (26) + : +- * Project (25) + : +- * SortMergeJoin Inner (24) + : :- * Sort (18) + : : +- Exchange (17) + : : +- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.inventory (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.warehouse (4) + : : +- BroadcastExchange (14) + : : +- * Project (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.date_dim (10) + : +- * Sort (23) + : +- Exchange (22) + : +- * Filter (21) + : +- * ColumnarToRow (20) + : +- Scan parquet default.item (19) + :- * HashAggregate (35) + : +- Exchange (34) + : +- * HashAggregate (33) + : +- * HashAggregate (32) + : +- ReusedExchange (31) + :- * HashAggregate (40) + : +- Exchange (39) + : +- * HashAggregate (38) + : +- * HashAggregate (37) + : +- ReusedExchange (36) + :- * HashAggregate (45) + : +- Exchange (44) + : +- * HashAggregate (43) + : +- * HashAggregate (42) + : +- ReusedExchange (41) + +- * HashAggregate (50) + +- Exchange (49) + +- * HashAggregate (48) + +- * HashAggregate (47) + +- ReusedExchange (46) + + +(1) Scan parquet default.inventory +Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Condition : (isnotnull(inv_item_sk#1) AND isnotnull(inv_warehouse_sk#2)) + +(4) Scan parquet default.warehouse +Output [1]: [w_warehouse_sk#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [1]: [w_warehouse_sk#6] + +(6) Filter [codegen id : 1] +Input [1]: [w_warehouse_sk#6] +Condition : isnotnull(w_warehouse_sk#6) + +(7) BroadcastExchange +Input [1]: [w_warehouse_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_warehouse_sk#2] +Right keys [1]: [w_warehouse_sk#6] +Join condition: None + +(9) Project [codegen id : 3] +Output [3]: [inv_item_sk#1, inv_quantity_on_hand#3, inv_date_sk#4] +Input [5]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, w_warehouse_sk#6] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#8, d_month_seq#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#8, d_month_seq#9] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#8, d_month_seq#9] +Condition : (((isnotnull(d_month_seq#9) AND (d_month_seq#9 >= 1212)) AND (d_month_seq#9 <= 1223)) AND isnotnull(d_date_sk#8)) + +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#8] +Input [2]: [d_date_sk#8, d_month_seq#9] + +(14) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [inv_date_sk#4] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(16) Project [codegen id : 3] +Output [2]: [inv_item_sk#1, inv_quantity_on_hand#3] +Input [4]: [inv_item_sk#1, inv_quantity_on_hand#3, inv_date_sk#4, d_date_sk#8] + +(17) Exchange +Input [2]: [inv_item_sk#1, inv_quantity_on_hand#3] +Arguments: hashpartitioning(inv_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#11] + +(18) Sort [codegen id : 4] +Input [2]: [inv_item_sk#1, inv_quantity_on_hand#3] +Arguments: [inv_item_sk#1 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.item +Output [5]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15, i_product_name#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 5] +Input [5]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15, i_product_name#16] + +(21) Filter [codegen id : 5] +Input [5]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15, i_product_name#16] +Condition : isnotnull(i_item_sk#12) + +(22) Exchange +Input [5]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15, i_product_name#16] +Arguments: hashpartitioning(i_item_sk#12, 5), ENSURE_REQUIREMENTS, [id=#17] + +(23) Sort [codegen id : 6] +Input [5]: [i_item_sk#12, i_brand#13, i_class#14, i_category#15, i_product_name#16] +Arguments: [i_item_sk#12 ASC NULLS FIRST], false, 0 + +(24) SortMergeJoin [codegen id : 7] +Left keys [1]: [inv_item_sk#1] +Right keys [1]: [i_item_sk#12] +Join condition: None + +(25) Project [codegen id : 7] +Output [5]: [inv_quantity_on_hand#3, i_brand#13, i_class#14, i_category#15, i_product_name#16] +Input [7]: [inv_item_sk#1, inv_quantity_on_hand#3, i_item_sk#12, i_brand#13, i_class#14, i_category#15, i_product_name#16] + +(26) HashAggregate [codegen id : 7] +Input [5]: [inv_quantity_on_hand#3, i_brand#13, i_class#14, i_category#15, i_product_name#16] +Keys [4]: [i_product_name#16, i_brand#13, i_class#14, i_category#15] +Functions [1]: [partial_avg(inv_quantity_on_hand#3)] +Aggregate Attributes [2]: [sum#18, count#19] +Results [6]: [i_product_name#16, i_brand#13, i_class#14, i_category#15, sum#20, count#21] + +(27) Exchange +Input [6]: [i_product_name#16, i_brand#13, i_class#14, i_category#15, sum#20, count#21] +Arguments: hashpartitioning(i_product_name#16, i_brand#13, i_class#14, i_category#15, 5), ENSURE_REQUIREMENTS, [id=#22] + +(28) HashAggregate [codegen id : 8] +Input [6]: [i_product_name#16, i_brand#13, i_class#14, i_category#15, sum#20, count#21] +Keys [4]: [i_product_name#16, i_brand#13, i_class#14, i_category#15] +Functions [1]: [avg(inv_quantity_on_hand#3)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#3)#23] +Results [5]: [i_product_name#16, i_brand#13, i_class#14, i_category#15, avg(inv_quantity_on_hand#3)#23 AS qoh#24] + +(29) HashAggregate [codegen id : 8] +Input [5]: [i_product_name#16, i_brand#13, i_class#14, i_category#15, qoh#24] +Keys [4]: [i_product_name#16, i_brand#13, i_class#14, i_category#15] +Functions [1]: [partial_avg(qoh#24)] +Aggregate Attributes [2]: [sum#25, count#26] +Results [6]: [i_product_name#16, i_brand#13, i_class#14, i_category#15, sum#27, count#28] + +(30) HashAggregate [codegen id : 8] +Input [6]: [i_product_name#16, i_brand#13, i_class#14, i_category#15, sum#27, count#28] +Keys [4]: [i_product_name#16, i_brand#13, i_class#14, i_category#15] +Functions [1]: [avg(qoh#24)] +Aggregate Attributes [1]: [avg(qoh#24)#29] +Results [5]: [i_product_name#16, i_brand#13, i_class#14, i_category#15, avg(qoh#24)#29 AS qoh#30] + +(31) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_product_name#31, i_brand#32, i_class#33, i_category#34, sum#35, count#36] + +(32) HashAggregate [codegen id : 16] +Input [6]: [i_product_name#31, i_brand#32, i_class#33, i_category#34, sum#35, count#36] +Keys [4]: [i_product_name#31, i_brand#32, i_class#33, i_category#34] +Functions [1]: [avg(inv_quantity_on_hand#37)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#37)#38] +Results [4]: [i_product_name#31, i_brand#32, i_class#33, avg(inv_quantity_on_hand#37)#38 AS qoh#24] + +(33) HashAggregate [codegen id : 16] +Input [4]: [i_product_name#31, i_brand#32, i_class#33, qoh#24] +Keys [3]: [i_product_name#31, i_brand#32, i_class#33] +Functions [1]: [partial_avg(qoh#24)] +Aggregate Attributes [2]: [sum#39, count#40] +Results [5]: [i_product_name#31, i_brand#32, i_class#33, sum#41, count#42] + +(34) Exchange +Input [5]: [i_product_name#31, i_brand#32, i_class#33, sum#41, count#42] +Arguments: hashpartitioning(i_product_name#31, i_brand#32, i_class#33, 5), ENSURE_REQUIREMENTS, [id=#43] + +(35) HashAggregate [codegen id : 17] +Input [5]: [i_product_name#31, i_brand#32, i_class#33, sum#41, count#42] +Keys [3]: [i_product_name#31, i_brand#32, i_class#33] +Functions [1]: [avg(qoh#24)] +Aggregate Attributes [1]: [avg(qoh#24)#44] +Results [5]: [i_product_name#31, i_brand#32, i_class#33, null AS i_category#45, avg(qoh#24)#44 AS qoh#46] + +(36) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_product_name#47, i_brand#48, i_class#49, i_category#50, sum#51, count#52] + +(37) HashAggregate [codegen id : 25] +Input [6]: [i_product_name#47, i_brand#48, i_class#49, i_category#50, sum#51, count#52] +Keys [4]: [i_product_name#47, i_brand#48, i_class#49, i_category#50] +Functions [1]: [avg(inv_quantity_on_hand#53)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#53)#54] +Results [3]: [i_product_name#47, i_brand#48, avg(inv_quantity_on_hand#53)#54 AS qoh#24] + +(38) HashAggregate [codegen id : 25] +Input [3]: [i_product_name#47, i_brand#48, qoh#24] +Keys [2]: [i_product_name#47, i_brand#48] +Functions [1]: [partial_avg(qoh#24)] +Aggregate Attributes [2]: [sum#55, count#56] +Results [4]: [i_product_name#47, i_brand#48, sum#57, count#58] + +(39) Exchange +Input [4]: [i_product_name#47, i_brand#48, sum#57, count#58] +Arguments: hashpartitioning(i_product_name#47, i_brand#48, 5), ENSURE_REQUIREMENTS, [id=#59] + +(40) HashAggregate [codegen id : 26] +Input [4]: [i_product_name#47, i_brand#48, sum#57, count#58] +Keys [2]: [i_product_name#47, i_brand#48] +Functions [1]: [avg(qoh#24)] +Aggregate Attributes [1]: [avg(qoh#24)#60] +Results [5]: [i_product_name#47, i_brand#48, null AS i_class#61, null AS i_category#62, avg(qoh#24)#60 AS qoh#63] + +(41) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_product_name#64, i_brand#65, i_class#66, i_category#67, sum#68, count#69] + +(42) HashAggregate [codegen id : 34] +Input [6]: [i_product_name#64, i_brand#65, i_class#66, i_category#67, sum#68, count#69] +Keys [4]: [i_product_name#64, i_brand#65, i_class#66, i_category#67] +Functions [1]: [avg(inv_quantity_on_hand#70)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#70)#71] +Results [2]: [i_product_name#64, avg(inv_quantity_on_hand#70)#71 AS qoh#24] + +(43) HashAggregate [codegen id : 34] +Input [2]: [i_product_name#64, qoh#24] +Keys [1]: [i_product_name#64] +Functions [1]: [partial_avg(qoh#24)] +Aggregate Attributes [2]: [sum#72, count#73] +Results [3]: [i_product_name#64, sum#74, count#75] + +(44) Exchange +Input [3]: [i_product_name#64, sum#74, count#75] +Arguments: hashpartitioning(i_product_name#64, 5), ENSURE_REQUIREMENTS, [id=#76] + +(45) HashAggregate [codegen id : 35] +Input [3]: [i_product_name#64, sum#74, count#75] +Keys [1]: [i_product_name#64] +Functions [1]: [avg(qoh#24)] +Aggregate Attributes [1]: [avg(qoh#24)#77] +Results [5]: [i_product_name#64, null AS i_brand#78, null AS i_class#79, null AS i_category#80, avg(qoh#24)#77 AS qoh#81] + +(46) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_product_name#82, i_brand#83, i_class#84, i_category#85, sum#86, count#87] + +(47) HashAggregate [codegen id : 43] +Input [6]: [i_product_name#82, i_brand#83, i_class#84, i_category#85, sum#86, count#87] +Keys [4]: [i_product_name#82, i_brand#83, i_class#84, i_category#85] +Functions [1]: [avg(inv_quantity_on_hand#88)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#88)#89] +Results [1]: [avg(inv_quantity_on_hand#88)#89 AS qoh#24] + +(48) HashAggregate [codegen id : 43] +Input [1]: [qoh#24] +Keys: [] +Functions [1]: [partial_avg(qoh#24)] +Aggregate Attributes [2]: [sum#90, count#91] +Results [2]: [sum#92, count#93] + +(49) Exchange +Input [2]: [sum#92, count#93] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#94] + +(50) HashAggregate [codegen id : 44] +Input [2]: [sum#92, count#93] +Keys: [] +Functions [1]: [avg(qoh#24)] +Aggregate Attributes [1]: [avg(qoh#24)#95] +Results [5]: [null AS i_product_name#96, null AS i_brand#97, null AS i_class#98, null AS i_category#99, avg(qoh#24)#95 AS qoh#100] + +(51) Union + +(52) TakeOrderedAndProject +Input [5]: [i_product_name#16, i_brand#13, i_class#14, i_category#15, qoh#30] +Arguments: 100, [qoh#30 ASC NULLS FIRST, i_product_name#16 ASC NULLS FIRST, i_brand#13 ASC NULLS FIRST, i_class#14 ASC NULLS FIRST, i_category#15 ASC NULLS FIRST], [i_product_name#16, i_brand#13, i_class#14, i_category#15, qoh#30] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5 +ReusedExchange (53) + + +(53) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#8] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt new file mode 100644 index 0000000000000..492883dbb392b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a.sf100/simplified.txt @@ -0,0 +1,89 @@ +TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] + Union + WholeStageCodegen (8) + HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(qoh),qoh,sum,count] + HashAggregate [i_product_name,i_brand,i_class,i_category,qoh] [sum,count,sum,count] + HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + Exchange [i_product_name,i_brand,i_class,i_category] #1 + WholeStageCodegen (7) + HashAggregate [i_product_name,i_brand,i_class,i_category,inv_quantity_on_hand] [sum,count,sum,count] + Project [inv_quantity_on_hand,i_brand,i_class,i_category,i_product_name] + SortMergeJoin [inv_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [inv_item_sk] + InputAdapter + Exchange [inv_item_sk] #2 + WholeStageCodegen (3) + Project [inv_item_sk,inv_quantity_on_hand] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Project [inv_item_sk,inv_quantity_on_hand,inv_date_sk] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Filter [inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #5 + WholeStageCodegen (5) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_product_name] + WholeStageCodegen (17) + HashAggregate [i_product_name,i_brand,i_class,sum,count] [avg(qoh),i_category,qoh,sum,count] + InputAdapter + Exchange [i_product_name,i_brand,i_class] #6 + WholeStageCodegen (16) + HashAggregate [i_product_name,i_brand,i_class,qoh] [sum,count,sum,count] + HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + ReusedExchange [i_product_name,i_brand,i_class,i_category,sum,count] #7 + WholeStageCodegen (26) + HashAggregate [i_product_name,i_brand,sum,count] [avg(qoh),i_class,i_category,qoh,sum,count] + InputAdapter + Exchange [i_product_name,i_brand] #8 + WholeStageCodegen (25) + HashAggregate [i_product_name,i_brand,qoh] [sum,count,sum,count] + HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + ReusedExchange [i_product_name,i_brand,i_class,i_category,sum,count] #7 + WholeStageCodegen (35) + HashAggregate [i_product_name,sum,count] [avg(qoh),i_brand,i_class,i_category,qoh,sum,count] + InputAdapter + Exchange [i_product_name] #9 + WholeStageCodegen (34) + HashAggregate [i_product_name,qoh] [sum,count,sum,count] + HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + ReusedExchange [i_product_name,i_brand,i_class,i_category,sum,count] #7 + WholeStageCodegen (44) + HashAggregate [sum,count] [avg(qoh),i_product_name,i_brand,i_class,i_category,qoh,sum,count] + InputAdapter + Exchange #10 + WholeStageCodegen (43) + HashAggregate [qoh] [sum,count,sum,count] + HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + ReusedExchange [i_product_name,i_brand,i_class,i_category,sum,count] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/explain.txt new file mode 100644 index 0000000000000..527d2eb5e86a4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/explain.txt @@ -0,0 +1,312 @@ +== Physical Plan == +TakeOrderedAndProject (49) ++- Union (48) + :- * HashAggregate (27) + : +- * HashAggregate (26) + : +- * HashAggregate (25) + : +- Exchange (24) + : +- * HashAggregate (23) + : +- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.inventory (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.item (11) + : +- BroadcastExchange (20) + : +- * Filter (19) + : +- * ColumnarToRow (18) + : +- Scan parquet default.warehouse (17) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * HashAggregate (29) + : +- ReusedExchange (28) + :- * HashAggregate (37) + : +- Exchange (36) + : +- * HashAggregate (35) + : +- * HashAggregate (34) + : +- ReusedExchange (33) + :- * HashAggregate (42) + : +- Exchange (41) + : +- * HashAggregate (40) + : +- * HashAggregate (39) + : +- ReusedExchange (38) + +- * HashAggregate (47) + +- Exchange (46) + +- * HashAggregate (45) + +- * HashAggregate (44) + +- ReusedExchange (43) + + +(1) Scan parquet default.inventory +Output [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#4), dynamicpruningexpression(inv_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] + +(3) Filter [codegen id : 4] +Input [4]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4] +Condition : (isnotnull(inv_item_sk#1) AND isnotnull(inv_warehouse_sk#2)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_month_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_month_seq#7] +Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1212)) AND (d_month_seq#7 <= 1223)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_month_seq#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 4] +Output [3]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3] +Input [5]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, inv_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.item +Output [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] + +(13) Filter [codegen id : 2] +Input [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Condition : isnotnull(i_item_sk#9) + +(14) BroadcastExchange +Input [5]: [i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_item_sk#1] +Right keys [1]: [i_item_sk#9] +Join condition: None + +(16) Project [codegen id : 4] +Output [6]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Input [8]: [inv_item_sk#1, inv_warehouse_sk#2, inv_quantity_on_hand#3, i_item_sk#9, i_brand#10, i_class#11, i_category#12, i_product_name#13] + +(17) Scan parquet default.warehouse +Output [1]: [w_warehouse_sk#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [1]: [w_warehouse_sk#15] + +(19) Filter [codegen id : 3] +Input [1]: [w_warehouse_sk#15] +Condition : isnotnull(w_warehouse_sk#15) + +(20) BroadcastExchange +Input [1]: [w_warehouse_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [inv_warehouse_sk#2] +Right keys [1]: [w_warehouse_sk#15] +Join condition: None + +(22) Project [codegen id : 4] +Output [5]: [inv_quantity_on_hand#3, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Input [7]: [inv_warehouse_sk#2, inv_quantity_on_hand#3, i_brand#10, i_class#11, i_category#12, i_product_name#13, w_warehouse_sk#15] + +(23) HashAggregate [codegen id : 4] +Input [5]: [inv_quantity_on_hand#3, i_brand#10, i_class#11, i_category#12, i_product_name#13] +Keys [4]: [i_product_name#13, i_brand#10, i_class#11, i_category#12] +Functions [1]: [partial_avg(inv_quantity_on_hand#3)] +Aggregate Attributes [2]: [sum#17, count#18] +Results [6]: [i_product_name#13, i_brand#10, i_class#11, i_category#12, sum#19, count#20] + +(24) Exchange +Input [6]: [i_product_name#13, i_brand#10, i_class#11, i_category#12, sum#19, count#20] +Arguments: hashpartitioning(i_product_name#13, i_brand#10, i_class#11, i_category#12, 5), ENSURE_REQUIREMENTS, [id=#21] + +(25) HashAggregate [codegen id : 5] +Input [6]: [i_product_name#13, i_brand#10, i_class#11, i_category#12, sum#19, count#20] +Keys [4]: [i_product_name#13, i_brand#10, i_class#11, i_category#12] +Functions [1]: [avg(inv_quantity_on_hand#3)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#3)#22] +Results [5]: [i_product_name#13, i_brand#10, i_class#11, i_category#12, avg(inv_quantity_on_hand#3)#22 AS qoh#23] + +(26) HashAggregate [codegen id : 5] +Input [5]: [i_product_name#13, i_brand#10, i_class#11, i_category#12, qoh#23] +Keys [4]: [i_product_name#13, i_brand#10, i_class#11, i_category#12] +Functions [1]: [partial_avg(qoh#23)] +Aggregate Attributes [2]: [sum#24, count#25] +Results [6]: [i_product_name#13, i_brand#10, i_class#11, i_category#12, sum#26, count#27] + +(27) HashAggregate [codegen id : 5] +Input [6]: [i_product_name#13, i_brand#10, i_class#11, i_category#12, sum#26, count#27] +Keys [4]: [i_product_name#13, i_brand#10, i_class#11, i_category#12] +Functions [1]: [avg(qoh#23)] +Aggregate Attributes [1]: [avg(qoh#23)#28] +Results [5]: [i_product_name#13, i_brand#10, i_class#11, i_category#12, avg(qoh#23)#28 AS qoh#29] + +(28) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_product_name#30, i_brand#31, i_class#32, i_category#33, sum#34, count#35] + +(29) HashAggregate [codegen id : 10] +Input [6]: [i_product_name#30, i_brand#31, i_class#32, i_category#33, sum#34, count#35] +Keys [4]: [i_product_name#30, i_brand#31, i_class#32, i_category#33] +Functions [1]: [avg(inv_quantity_on_hand#36)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#36)#37] +Results [4]: [i_product_name#30, i_brand#31, i_class#32, avg(inv_quantity_on_hand#36)#37 AS qoh#23] + +(30) HashAggregate [codegen id : 10] +Input [4]: [i_product_name#30, i_brand#31, i_class#32, qoh#23] +Keys [3]: [i_product_name#30, i_brand#31, i_class#32] +Functions [1]: [partial_avg(qoh#23)] +Aggregate Attributes [2]: [sum#38, count#39] +Results [5]: [i_product_name#30, i_brand#31, i_class#32, sum#40, count#41] + +(31) Exchange +Input [5]: [i_product_name#30, i_brand#31, i_class#32, sum#40, count#41] +Arguments: hashpartitioning(i_product_name#30, i_brand#31, i_class#32, 5), ENSURE_REQUIREMENTS, [id=#42] + +(32) HashAggregate [codegen id : 11] +Input [5]: [i_product_name#30, i_brand#31, i_class#32, sum#40, count#41] +Keys [3]: [i_product_name#30, i_brand#31, i_class#32] +Functions [1]: [avg(qoh#23)] +Aggregate Attributes [1]: [avg(qoh#23)#43] +Results [5]: [i_product_name#30, i_brand#31, i_class#32, null AS i_category#44, avg(qoh#23)#43 AS qoh#45] + +(33) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_product_name#46, i_brand#47, i_class#48, i_category#49, sum#50, count#51] + +(34) HashAggregate [codegen id : 16] +Input [6]: [i_product_name#46, i_brand#47, i_class#48, i_category#49, sum#50, count#51] +Keys [4]: [i_product_name#46, i_brand#47, i_class#48, i_category#49] +Functions [1]: [avg(inv_quantity_on_hand#52)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#52)#53] +Results [3]: [i_product_name#46, i_brand#47, avg(inv_quantity_on_hand#52)#53 AS qoh#23] + +(35) HashAggregate [codegen id : 16] +Input [3]: [i_product_name#46, i_brand#47, qoh#23] +Keys [2]: [i_product_name#46, i_brand#47] +Functions [1]: [partial_avg(qoh#23)] +Aggregate Attributes [2]: [sum#54, count#55] +Results [4]: [i_product_name#46, i_brand#47, sum#56, count#57] + +(36) Exchange +Input [4]: [i_product_name#46, i_brand#47, sum#56, count#57] +Arguments: hashpartitioning(i_product_name#46, i_brand#47, 5), ENSURE_REQUIREMENTS, [id=#58] + +(37) HashAggregate [codegen id : 17] +Input [4]: [i_product_name#46, i_brand#47, sum#56, count#57] +Keys [2]: [i_product_name#46, i_brand#47] +Functions [1]: [avg(qoh#23)] +Aggregate Attributes [1]: [avg(qoh#23)#59] +Results [5]: [i_product_name#46, i_brand#47, null AS i_class#60, null AS i_category#61, avg(qoh#23)#59 AS qoh#62] + +(38) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_product_name#63, i_brand#64, i_class#65, i_category#66, sum#67, count#68] + +(39) HashAggregate [codegen id : 22] +Input [6]: [i_product_name#63, i_brand#64, i_class#65, i_category#66, sum#67, count#68] +Keys [4]: [i_product_name#63, i_brand#64, i_class#65, i_category#66] +Functions [1]: [avg(inv_quantity_on_hand#69)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#69)#70] +Results [2]: [i_product_name#63, avg(inv_quantity_on_hand#69)#70 AS qoh#23] + +(40) HashAggregate [codegen id : 22] +Input [2]: [i_product_name#63, qoh#23] +Keys [1]: [i_product_name#63] +Functions [1]: [partial_avg(qoh#23)] +Aggregate Attributes [2]: [sum#71, count#72] +Results [3]: [i_product_name#63, sum#73, count#74] + +(41) Exchange +Input [3]: [i_product_name#63, sum#73, count#74] +Arguments: hashpartitioning(i_product_name#63, 5), ENSURE_REQUIREMENTS, [id=#75] + +(42) HashAggregate [codegen id : 23] +Input [3]: [i_product_name#63, sum#73, count#74] +Keys [1]: [i_product_name#63] +Functions [1]: [avg(qoh#23)] +Aggregate Attributes [1]: [avg(qoh#23)#76] +Results [5]: [i_product_name#63, null AS i_brand#77, null AS i_class#78, null AS i_category#79, avg(qoh#23)#76 AS qoh#80] + +(43) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_product_name#81, i_brand#82, i_class#83, i_category#84, sum#85, count#86] + +(44) HashAggregate [codegen id : 28] +Input [6]: [i_product_name#81, i_brand#82, i_class#83, i_category#84, sum#85, count#86] +Keys [4]: [i_product_name#81, i_brand#82, i_class#83, i_category#84] +Functions [1]: [avg(inv_quantity_on_hand#87)] +Aggregate Attributes [1]: [avg(inv_quantity_on_hand#87)#88] +Results [1]: [avg(inv_quantity_on_hand#87)#88 AS qoh#23] + +(45) HashAggregate [codegen id : 28] +Input [1]: [qoh#23] +Keys: [] +Functions [1]: [partial_avg(qoh#23)] +Aggregate Attributes [2]: [sum#89, count#90] +Results [2]: [sum#91, count#92] + +(46) Exchange +Input [2]: [sum#91, count#92] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#93] + +(47) HashAggregate [codegen id : 29] +Input [2]: [sum#91, count#92] +Keys: [] +Functions [1]: [avg(qoh#23)] +Aggregate Attributes [1]: [avg(qoh#23)#94] +Results [5]: [null AS i_product_name#95, null AS i_brand#96, null AS i_class#97, null AS i_category#98, avg(qoh#23)#94 AS qoh#99] + +(48) Union + +(49) TakeOrderedAndProject +Input [5]: [i_product_name#13, i_brand#10, i_class#11, i_category#12, qoh#29] +Arguments: 100, [qoh#29 ASC NULLS FIRST, i_product_name#13 ASC NULLS FIRST, i_brand#10 ASC NULLS FIRST, i_class#11 ASC NULLS FIRST, i_category#12 ASC NULLS FIRST], [i_product_name#13, i_brand#10, i_class#11, i_category#12, qoh#29] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = inv_date_sk#4 IN dynamicpruning#5 +ReusedExchange (50) + + +(50) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/simplified.txt new file mode 100644 index 0000000000000..6b124d3ceed7a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q22a/simplified.txt @@ -0,0 +1,80 @@ +TakeOrderedAndProject [qoh,i_product_name,i_brand,i_class,i_category] + Union + WholeStageCodegen (5) + HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(qoh),qoh,sum,count] + HashAggregate [i_product_name,i_brand,i_class,i_category,qoh] [sum,count,sum,count] + HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + Exchange [i_product_name,i_brand,i_class,i_category] #1 + WholeStageCodegen (4) + HashAggregate [i_product_name,i_brand,i_class,i_category,inv_quantity_on_hand] [sum,count,sum,count] + Project [inv_quantity_on_hand,i_brand,i_class,i_category,i_product_name] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [inv_warehouse_sk,inv_quantity_on_hand,i_brand,i_class,i_category,i_product_name] + BroadcastHashJoin [inv_item_sk,i_item_sk] + Project [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand] + BroadcastHashJoin [inv_date_sk,d_date_sk] + Filter [inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_product_name] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk] + WholeStageCodegen (11) + HashAggregate [i_product_name,i_brand,i_class,sum,count] [avg(qoh),i_category,qoh,sum,count] + InputAdapter + Exchange [i_product_name,i_brand,i_class] #5 + WholeStageCodegen (10) + HashAggregate [i_product_name,i_brand,i_class,qoh] [sum,count,sum,count] + HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + ReusedExchange [i_product_name,i_brand,i_class,i_category,sum,count] #6 + WholeStageCodegen (17) + HashAggregate [i_product_name,i_brand,sum,count] [avg(qoh),i_class,i_category,qoh,sum,count] + InputAdapter + Exchange [i_product_name,i_brand] #7 + WholeStageCodegen (16) + HashAggregate [i_product_name,i_brand,qoh] [sum,count,sum,count] + HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + ReusedExchange [i_product_name,i_brand,i_class,i_category,sum,count] #6 + WholeStageCodegen (23) + HashAggregate [i_product_name,sum,count] [avg(qoh),i_brand,i_class,i_category,qoh,sum,count] + InputAdapter + Exchange [i_product_name] #8 + WholeStageCodegen (22) + HashAggregate [i_product_name,qoh] [sum,count,sum,count] + HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + ReusedExchange [i_product_name,i_brand,i_class,i_category,sum,count] #6 + WholeStageCodegen (29) + HashAggregate [sum,count] [avg(qoh),i_product_name,i_brand,i_class,i_category,qoh,sum,count] + InputAdapter + Exchange #9 + WholeStageCodegen (28) + HashAggregate [qoh] [sum,count,sum,count] + HashAggregate [i_product_name,i_brand,i_class,i_category,sum,count] [avg(inv_quantity_on_hand),qoh,sum,count] + InputAdapter + ReusedExchange [i_product_name,i_brand,i_class,i_category,sum,count] #6 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt new file mode 100644 index 0000000000000..7cdc8074e74e1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/explain.txt @@ -0,0 +1,552 @@ +== Physical Plan == +* Sort (49) ++- Exchange (48) + +- * Project (47) + +- * Filter (46) + +- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * HashAggregate (42) + +- Exchange (41) + +- * HashAggregate (40) + +- * Project (39) + +- * SortMergeJoin Inner (38) + :- * Sort (31) + : +- Exchange (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (23) + : : +- * BroadcastHashJoin Inner BuildLeft (22) + : : :- BroadcastExchange (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildLeft (15) + : : : :- BroadcastExchange (11) + : : : : +- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : : :- BroadcastExchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store (1) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.customer_address (6) + : : : +- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.customer (12) + : : +- * Project (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.store_sales (18) + : +- BroadcastExchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.item (24) + +- * Sort (37) + +- Exchange (36) + +- * Project (35) + +- * Filter (34) + +- * ColumnarToRow (33) + +- Scan parquet default.store_returns (32) + + +(1) Scan parquet default.store +Output [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] + +(3) Filter [codegen id : 1] +Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] +Condition : (((isnotnull(s_market_id#3) AND (s_market_id#3 = 8)) AND isnotnull(s_store_sk#1)) AND isnotnull(s_zip#5)) + +(4) Project [codegen id : 1] +Output [4]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5] +Input [5]: [s_store_sk#1, s_store_name#2, s_market_id#3, s_state#4, s_zip#5] + +(5) BroadcastExchange +Input [4]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5] +Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#6] + +(6) Scan parquet default.customer_address +Output [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(7) ColumnarToRow +Input [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] + +(8) Filter +Input [4]: [ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] +Condition : ((isnotnull(ca_address_sk#7) AND isnotnull(ca_country#10)) AND isnotnull(ca_zip#9)) + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [s_zip#5] +Right keys [1]: [ca_zip#9] +Join condition: None + +(10) Project [codegen id : 2] +Output [6]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10] +Input [8]: [s_store_sk#1, s_store_name#2, s_state#4, s_zip#5, ca_address_sk#7, ca_state#8, ca_zip#9, ca_country#10] + +(11) BroadcastExchange +Input [6]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10] +Arguments: HashedRelationBroadcastMode(List(input[3, int, true], upper(input[5, string, true])),false), [id=#11] + +(12) Scan parquet default.customer +Output [5]: [c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_birth_country)] +ReadSchema: struct + +(13) ColumnarToRow +Input [5]: [c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] + +(14) Filter +Input [5]: [c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] +Condition : ((isnotnull(c_customer_sk#12) AND isnotnull(c_current_addr_sk#13)) AND isnotnull(c_birth_country#16)) + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [2]: [ca_address_sk#7, upper(ca_country#10)] +Right keys [2]: [c_current_addr_sk#13, c_birth_country#16] +Join condition: None + +(16) Project [codegen id : 3] +Output [7]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] +Input [11]: [s_store_sk#1, s_store_name#2, s_state#4, ca_address_sk#7, ca_state#8, ca_country#10, c_customer_sk#12, c_current_addr_sk#13, c_first_name#14, c_last_name#15, c_birth_country#16] + +(17) BroadcastExchange +Input [7]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, true] as bigint), 32) | (cast(input[4, int, true] as bigint) & 4294967295))),false), [id=#17] + +(18) Scan parquet default.store_sales +Output [6]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22, ss_sold_date_sk#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(19) ColumnarToRow +Input [6]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22, ss_sold_date_sk#23] + +(20) Filter +Input [6]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22, ss_sold_date_sk#23] +Condition : (((isnotnull(ss_ticket_number#21) AND isnotnull(ss_item_sk#18)) AND isnotnull(ss_store_sk#20)) AND isnotnull(ss_customer_sk#19)) + +(21) Project +Output [5]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] +Input [6]: [ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22, ss_sold_date_sk#23] + +(22) BroadcastHashJoin [codegen id : 5] +Left keys [2]: [s_store_sk#1, c_customer_sk#12] +Right keys [2]: [ss_store_sk#20, ss_customer_sk#19] +Join condition: None + +(23) Project [codegen id : 5] +Output [8]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22] +Input [12]: [s_store_sk#1, s_store_name#2, s_state#4, ca_state#8, c_customer_sk#12, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_customer_sk#19, ss_store_sk#20, ss_ticket_number#21, ss_net_paid#22] + +(24) Scan parquet default.item +Output [6]: [i_item_sk#24, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_color), EqualTo(i_color,pale ), IsNotNull(i_item_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [6]: [i_item_sk#24, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29] + +(26) Filter [codegen id : 4] +Input [6]: [i_item_sk#24, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29] +Condition : ((isnotnull(i_color#27) AND (i_color#27 = pale )) AND isnotnull(i_item_sk#24)) + +(27) BroadcastExchange +Input [6]: [i_item_sk#24, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#30] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#18] +Right keys [1]: [i_item_sk#24] +Join condition: None + +(29) Project [codegen id : 5] +Output [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29] +Input [14]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_item_sk#24, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29] + +(30) Exchange +Input [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29] +Arguments: hashpartitioning(ss_ticket_number#21, ss_item_sk#18, 5), ENSURE_REQUIREMENTS, [id=#31] + +(31) Sort [codegen id : 6] +Input [13]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29] +Arguments: [ss_ticket_number#21 ASC NULLS FIRST, ss_item_sk#18 ASC NULLS FIRST], false, 0 + +(32) Scan parquet default.store_returns +Output [3]: [sr_item_sk#32, sr_ticket_number#33, sr_returned_date_sk#34] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(33) ColumnarToRow [codegen id : 7] +Input [3]: [sr_item_sk#32, sr_ticket_number#33, sr_returned_date_sk#34] + +(34) Filter [codegen id : 7] +Input [3]: [sr_item_sk#32, sr_ticket_number#33, sr_returned_date_sk#34] +Condition : (isnotnull(sr_ticket_number#33) AND isnotnull(sr_item_sk#32)) + +(35) Project [codegen id : 7] +Output [2]: [sr_item_sk#32, sr_ticket_number#33] +Input [3]: [sr_item_sk#32, sr_ticket_number#33, sr_returned_date_sk#34] + +(36) Exchange +Input [2]: [sr_item_sk#32, sr_ticket_number#33] +Arguments: hashpartitioning(sr_ticket_number#33, sr_item_sk#32, 5), ENSURE_REQUIREMENTS, [id=#35] + +(37) Sort [codegen id : 8] +Input [2]: [sr_item_sk#32, sr_ticket_number#33] +Arguments: [sr_ticket_number#33 ASC NULLS FIRST, sr_item_sk#32 ASC NULLS FIRST], false, 0 + +(38) SortMergeJoin [codegen id : 9] +Left keys [2]: [ss_ticket_number#21, ss_item_sk#18] +Right keys [2]: [sr_ticket_number#33, sr_item_sk#32] +Join condition: None + +(39) Project [codegen id : 9] +Output [11]: [ss_net_paid#22, s_store_name#2, s_state#4, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29, c_first_name#14, c_last_name#15, ca_state#8] +Input [15]: [s_store_name#2, s_state#4, ca_state#8, c_first_name#14, c_last_name#15, ss_item_sk#18, ss_ticket_number#21, ss_net_paid#22, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29, sr_item_sk#32, sr_ticket_number#33] + +(40) HashAggregate [codegen id : 9] +Input [11]: [ss_net_paid#22, s_store_name#2, s_state#4, i_current_price#25, i_size#26, i_color#27, i_units#28, i_manager_id#29, c_first_name#14, c_last_name#15, ca_state#8] +Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#27, i_current_price#25, i_manager_id#29, i_units#28, i_size#26] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#22))] +Aggregate Attributes [1]: [sum#36] +Results [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#27, i_current_price#25, i_manager_id#29, i_units#28, i_size#26, sum#37] + +(41) Exchange +Input [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#27, i_current_price#25, i_manager_id#29, i_units#28, i_size#26, sum#37] +Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#27, i_current_price#25, i_manager_id#29, i_units#28, i_size#26, 5), ENSURE_REQUIREMENTS, [id=#38] + +(42) HashAggregate [codegen id : 10] +Input [11]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#27, i_current_price#25, i_manager_id#29, i_units#28, i_size#26, sum#37] +Keys [10]: [c_last_name#15, c_first_name#14, s_store_name#2, ca_state#8, s_state#4, i_color#27, i_current_price#25, i_manager_id#29, i_units#28, i_size#26] +Functions [1]: [sum(UnscaledValue(ss_net_paid#22))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#22))#39] +Results [4]: [c_last_name#15, c_first_name#14, s_store_name#2, MakeDecimal(sum(UnscaledValue(ss_net_paid#22))#39,17,2) AS netpaid#40] + +(43) HashAggregate [codegen id : 10] +Input [4]: [c_last_name#15, c_first_name#14, s_store_name#2, netpaid#40] +Keys [3]: [c_last_name#15, c_first_name#14, s_store_name#2] +Functions [1]: [partial_sum(netpaid#40)] +Aggregate Attributes [2]: [sum#41, isEmpty#42] +Results [5]: [c_last_name#15, c_first_name#14, s_store_name#2, sum#43, isEmpty#44] + +(44) Exchange +Input [5]: [c_last_name#15, c_first_name#14, s_store_name#2, sum#43, isEmpty#44] +Arguments: hashpartitioning(c_last_name#15, c_first_name#14, s_store_name#2, 5), ENSURE_REQUIREMENTS, [id=#45] + +(45) HashAggregate [codegen id : 11] +Input [5]: [c_last_name#15, c_first_name#14, s_store_name#2, sum#43, isEmpty#44] +Keys [3]: [c_last_name#15, c_first_name#14, s_store_name#2] +Functions [1]: [sum(netpaid#40)] +Aggregate Attributes [1]: [sum(netpaid#40)#46] +Results [5]: [c_last_name#15, c_first_name#14, s_store_name#2, sum(netpaid#40)#46 AS paid#47, sum(netpaid#40)#46 AS sum(netpaid#40)#48] + +(46) Filter [codegen id : 11] +Input [5]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#47, sum(netpaid#40)#48] +Condition : (isnotnull(sum(netpaid#40)#48) AND (cast(sum(netpaid#40)#48 as decimal(33,8)) > cast(Subquery scalar-subquery#49, [id=#50] as decimal(33,8)))) + +(47) Project [codegen id : 11] +Output [4]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#47] +Input [5]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#47, sum(netpaid#40)#48] + +(48) Exchange +Input [4]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#47] +Arguments: rangepartitioning(c_last_name#15 ASC NULLS FIRST, c_first_name#14 ASC NULLS FIRST, s_store_name#2 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#51] + +(49) Sort [codegen id : 12] +Input [4]: [c_last_name#15, c_first_name#14, s_store_name#2, paid#47] +Arguments: [c_last_name#15 ASC NULLS FIRST, c_first_name#14 ASC NULLS FIRST, s_store_name#2 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 46 Hosting Expression = Subquery scalar-subquery#49, [id=#50] +* HashAggregate (97) ++- Exchange (96) + +- * HashAggregate (95) + +- * HashAggregate (94) + +- Exchange (93) + +- * HashAggregate (92) + +- * Project (91) + +- * SortMergeJoin Inner (90) + :- * Sort (83) + : +- Exchange (82) + : +- * Project (81) + : +- * SortMergeJoin Inner (80) + : :- * Sort (74) + : : +- Exchange (73) + : : +- * Project (72) + : : +- * BroadcastHashJoin Inner BuildLeft (71) + : : :- BroadcastExchange (66) + : : : +- * Project (65) + : : : +- * BroadcastHashJoin Inner BuildLeft (64) + : : : :- BroadcastExchange (60) + : : : : +- * Project (59) + : : : : +- * BroadcastHashJoin Inner BuildLeft (58) + : : : : :- BroadcastExchange (54) + : : : : : +- * Project (53) + : : : : : +- * Filter (52) + : : : : : +- * ColumnarToRow (51) + : : : : : +- Scan parquet default.store (50) + : : : : +- * Filter (57) + : : : : +- * ColumnarToRow (56) + : : : : +- Scan parquet default.customer_address (55) + : : : +- * Filter (63) + : : : +- * ColumnarToRow (62) + : : : +- Scan parquet default.customer (61) + : : +- * Project (70) + : : +- * Filter (69) + : : +- * ColumnarToRow (68) + : : +- Scan parquet default.store_sales (67) + : +- * Sort (79) + : +- Exchange (78) + : +- * Filter (77) + : +- * ColumnarToRow (76) + : +- Scan parquet default.item (75) + +- * Sort (89) + +- Exchange (88) + +- * Project (87) + +- * Filter (86) + +- * ColumnarToRow (85) + +- Scan parquet default.store_returns (84) + + +(50) Scan parquet default.store +Output [5]: [s_store_sk#52, s_store_name#53, s_market_id#54, s_state#55, s_zip#56] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(51) ColumnarToRow [codegen id : 1] +Input [5]: [s_store_sk#52, s_store_name#53, s_market_id#54, s_state#55, s_zip#56] + +(52) Filter [codegen id : 1] +Input [5]: [s_store_sk#52, s_store_name#53, s_market_id#54, s_state#55, s_zip#56] +Condition : (((isnotnull(s_market_id#54) AND (s_market_id#54 = 8)) AND isnotnull(s_store_sk#52)) AND isnotnull(s_zip#56)) + +(53) Project [codegen id : 1] +Output [4]: [s_store_sk#52, s_store_name#53, s_state#55, s_zip#56] +Input [5]: [s_store_sk#52, s_store_name#53, s_market_id#54, s_state#55, s_zip#56] + +(54) BroadcastExchange +Input [4]: [s_store_sk#52, s_store_name#53, s_state#55, s_zip#56] +Arguments: HashedRelationBroadcastMode(List(input[3, string, true]),false), [id=#57] + +(55) Scan parquet default.customer_address +Output [4]: [ca_address_sk#58, ca_state#59, ca_zip#60, ca_country#61] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(56) ColumnarToRow +Input [4]: [ca_address_sk#58, ca_state#59, ca_zip#60, ca_country#61] + +(57) Filter +Input [4]: [ca_address_sk#58, ca_state#59, ca_zip#60, ca_country#61] +Condition : ((isnotnull(ca_address_sk#58) AND isnotnull(ca_country#61)) AND isnotnull(ca_zip#60)) + +(58) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [s_zip#56] +Right keys [1]: [ca_zip#60] +Join condition: None + +(59) Project [codegen id : 2] +Output [6]: [s_store_sk#52, s_store_name#53, s_state#55, ca_address_sk#58, ca_state#59, ca_country#61] +Input [8]: [s_store_sk#52, s_store_name#53, s_state#55, s_zip#56, ca_address_sk#58, ca_state#59, ca_zip#60, ca_country#61] + +(60) BroadcastExchange +Input [6]: [s_store_sk#52, s_store_name#53, s_state#55, ca_address_sk#58, ca_state#59, ca_country#61] +Arguments: HashedRelationBroadcastMode(List(input[3, int, true], upper(input[5, string, true])),false), [id=#62] + +(61) Scan parquet default.customer +Output [5]: [c_customer_sk#63, c_current_addr_sk#64, c_first_name#65, c_last_name#66, c_birth_country#67] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_birth_country)] +ReadSchema: struct + +(62) ColumnarToRow +Input [5]: [c_customer_sk#63, c_current_addr_sk#64, c_first_name#65, c_last_name#66, c_birth_country#67] + +(63) Filter +Input [5]: [c_customer_sk#63, c_current_addr_sk#64, c_first_name#65, c_last_name#66, c_birth_country#67] +Condition : ((isnotnull(c_customer_sk#63) AND isnotnull(c_current_addr_sk#64)) AND isnotnull(c_birth_country#67)) + +(64) BroadcastHashJoin [codegen id : 3] +Left keys [2]: [ca_address_sk#58, upper(ca_country#61)] +Right keys [2]: [c_current_addr_sk#64, c_birth_country#67] +Join condition: None + +(65) Project [codegen id : 3] +Output [7]: [s_store_sk#52, s_store_name#53, s_state#55, ca_state#59, c_customer_sk#63, c_first_name#65, c_last_name#66] +Input [11]: [s_store_sk#52, s_store_name#53, s_state#55, ca_address_sk#58, ca_state#59, ca_country#61, c_customer_sk#63, c_current_addr_sk#64, c_first_name#65, c_last_name#66, c_birth_country#67] + +(66) BroadcastExchange +Input [7]: [s_store_sk#52, s_store_name#53, s_state#55, ca_state#59, c_customer_sk#63, c_first_name#65, c_last_name#66] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, true] as bigint), 32) | (cast(input[4, int, true] as bigint) & 4294967295))),false), [id=#68] + +(67) Scan parquet default.store_sales +Output [6]: [ss_item_sk#69, ss_customer_sk#70, ss_store_sk#71, ss_ticket_number#72, ss_net_paid#73, ss_sold_date_sk#74] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(68) ColumnarToRow +Input [6]: [ss_item_sk#69, ss_customer_sk#70, ss_store_sk#71, ss_ticket_number#72, ss_net_paid#73, ss_sold_date_sk#74] + +(69) Filter +Input [6]: [ss_item_sk#69, ss_customer_sk#70, ss_store_sk#71, ss_ticket_number#72, ss_net_paid#73, ss_sold_date_sk#74] +Condition : (((isnotnull(ss_ticket_number#72) AND isnotnull(ss_item_sk#69)) AND isnotnull(ss_store_sk#71)) AND isnotnull(ss_customer_sk#70)) + +(70) Project +Output [5]: [ss_item_sk#69, ss_customer_sk#70, ss_store_sk#71, ss_ticket_number#72, ss_net_paid#73] +Input [6]: [ss_item_sk#69, ss_customer_sk#70, ss_store_sk#71, ss_ticket_number#72, ss_net_paid#73, ss_sold_date_sk#74] + +(71) BroadcastHashJoin [codegen id : 4] +Left keys [2]: [s_store_sk#52, c_customer_sk#63] +Right keys [2]: [ss_store_sk#71, ss_customer_sk#70] +Join condition: None + +(72) Project [codegen id : 4] +Output [8]: [s_store_name#53, s_state#55, ca_state#59, c_first_name#65, c_last_name#66, ss_item_sk#69, ss_ticket_number#72, ss_net_paid#73] +Input [12]: [s_store_sk#52, s_store_name#53, s_state#55, ca_state#59, c_customer_sk#63, c_first_name#65, c_last_name#66, ss_item_sk#69, ss_customer_sk#70, ss_store_sk#71, ss_ticket_number#72, ss_net_paid#73] + +(73) Exchange +Input [8]: [s_store_name#53, s_state#55, ca_state#59, c_first_name#65, c_last_name#66, ss_item_sk#69, ss_ticket_number#72, ss_net_paid#73] +Arguments: hashpartitioning(ss_item_sk#69, 5), ENSURE_REQUIREMENTS, [id=#75] + +(74) Sort [codegen id : 5] +Input [8]: [s_store_name#53, s_state#55, ca_state#59, c_first_name#65, c_last_name#66, ss_item_sk#69, ss_ticket_number#72, ss_net_paid#73] +Arguments: [ss_item_sk#69 ASC NULLS FIRST], false, 0 + +(75) Scan parquet default.item +Output [6]: [i_item_sk#76, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 6] +Input [6]: [i_item_sk#76, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81] + +(77) Filter [codegen id : 6] +Input [6]: [i_item_sk#76, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81] +Condition : isnotnull(i_item_sk#76) + +(78) Exchange +Input [6]: [i_item_sk#76, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81] +Arguments: hashpartitioning(i_item_sk#76, 5), ENSURE_REQUIREMENTS, [id=#82] + +(79) Sort [codegen id : 7] +Input [6]: [i_item_sk#76, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81] +Arguments: [i_item_sk#76 ASC NULLS FIRST], false, 0 + +(80) SortMergeJoin [codegen id : 8] +Left keys [1]: [ss_item_sk#69] +Right keys [1]: [i_item_sk#76] +Join condition: None + +(81) Project [codegen id : 8] +Output [13]: [s_store_name#53, s_state#55, ca_state#59, c_first_name#65, c_last_name#66, ss_item_sk#69, ss_ticket_number#72, ss_net_paid#73, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81] +Input [14]: [s_store_name#53, s_state#55, ca_state#59, c_first_name#65, c_last_name#66, ss_item_sk#69, ss_ticket_number#72, ss_net_paid#73, i_item_sk#76, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81] + +(82) Exchange +Input [13]: [s_store_name#53, s_state#55, ca_state#59, c_first_name#65, c_last_name#66, ss_item_sk#69, ss_ticket_number#72, ss_net_paid#73, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81] +Arguments: hashpartitioning(ss_ticket_number#72, ss_item_sk#69, 5), ENSURE_REQUIREMENTS, [id=#83] + +(83) Sort [codegen id : 9] +Input [13]: [s_store_name#53, s_state#55, ca_state#59, c_first_name#65, c_last_name#66, ss_item_sk#69, ss_ticket_number#72, ss_net_paid#73, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81] +Arguments: [ss_ticket_number#72 ASC NULLS FIRST, ss_item_sk#69 ASC NULLS FIRST], false, 0 + +(84) Scan parquet default.store_returns +Output [3]: [sr_item_sk#84, sr_ticket_number#85, sr_returned_date_sk#86] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(85) ColumnarToRow [codegen id : 10] +Input [3]: [sr_item_sk#84, sr_ticket_number#85, sr_returned_date_sk#86] + +(86) Filter [codegen id : 10] +Input [3]: [sr_item_sk#84, sr_ticket_number#85, sr_returned_date_sk#86] +Condition : (isnotnull(sr_ticket_number#85) AND isnotnull(sr_item_sk#84)) + +(87) Project [codegen id : 10] +Output [2]: [sr_item_sk#84, sr_ticket_number#85] +Input [3]: [sr_item_sk#84, sr_ticket_number#85, sr_returned_date_sk#86] + +(88) Exchange +Input [2]: [sr_item_sk#84, sr_ticket_number#85] +Arguments: hashpartitioning(sr_ticket_number#85, sr_item_sk#84, 5), ENSURE_REQUIREMENTS, [id=#87] + +(89) Sort [codegen id : 11] +Input [2]: [sr_item_sk#84, sr_ticket_number#85] +Arguments: [sr_ticket_number#85 ASC NULLS FIRST, sr_item_sk#84 ASC NULLS FIRST], false, 0 + +(90) SortMergeJoin [codegen id : 12] +Left keys [2]: [ss_ticket_number#72, ss_item_sk#69] +Right keys [2]: [sr_ticket_number#85, sr_item_sk#84] +Join condition: None + +(91) Project [codegen id : 12] +Output [11]: [ss_net_paid#73, s_store_name#53, s_state#55, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81, c_first_name#65, c_last_name#66, ca_state#59] +Input [15]: [s_store_name#53, s_state#55, ca_state#59, c_first_name#65, c_last_name#66, ss_item_sk#69, ss_ticket_number#72, ss_net_paid#73, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81, sr_item_sk#84, sr_ticket_number#85] + +(92) HashAggregate [codegen id : 12] +Input [11]: [ss_net_paid#73, s_store_name#53, s_state#55, i_current_price#77, i_size#78, i_color#79, i_units#80, i_manager_id#81, c_first_name#65, c_last_name#66, ca_state#59] +Keys [10]: [c_last_name#66, c_first_name#65, s_store_name#53, ca_state#59, s_state#55, i_color#79, i_current_price#77, i_manager_id#81, i_units#80, i_size#78] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#73))] +Aggregate Attributes [1]: [sum#88] +Results [11]: [c_last_name#66, c_first_name#65, s_store_name#53, ca_state#59, s_state#55, i_color#79, i_current_price#77, i_manager_id#81, i_units#80, i_size#78, sum#89] + +(93) Exchange +Input [11]: [c_last_name#66, c_first_name#65, s_store_name#53, ca_state#59, s_state#55, i_color#79, i_current_price#77, i_manager_id#81, i_units#80, i_size#78, sum#89] +Arguments: hashpartitioning(c_last_name#66, c_first_name#65, s_store_name#53, ca_state#59, s_state#55, i_color#79, i_current_price#77, i_manager_id#81, i_units#80, i_size#78, 5), ENSURE_REQUIREMENTS, [id=#90] + +(94) HashAggregate [codegen id : 13] +Input [11]: [c_last_name#66, c_first_name#65, s_store_name#53, ca_state#59, s_state#55, i_color#79, i_current_price#77, i_manager_id#81, i_units#80, i_size#78, sum#89] +Keys [10]: [c_last_name#66, c_first_name#65, s_store_name#53, ca_state#59, s_state#55, i_color#79, i_current_price#77, i_manager_id#81, i_units#80, i_size#78] +Functions [1]: [sum(UnscaledValue(ss_net_paid#73))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#73))#91] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#73))#91,17,2) AS netpaid#40] + +(95) HashAggregate [codegen id : 13] +Input [1]: [netpaid#40] +Keys: [] +Functions [1]: [partial_avg(netpaid#40)] +Aggregate Attributes [2]: [sum#92, count#93] +Results [2]: [sum#94, count#95] + +(96) Exchange +Input [2]: [sum#94, count#95] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#96] + +(97) HashAggregate [codegen id : 14] +Input [2]: [sum#94, count#95] +Keys: [] +Functions [1]: [avg(netpaid#40)] +Aggregate Attributes [1]: [avg(netpaid#40)#97] +Results [1]: [CheckOverflow((0.050000 * promote_precision(avg(netpaid#40)#97)), DecimalType(24,8), true) AS (0.05 * avg(netpaid))#98] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/simplified.txt new file mode 100644 index 0000000000000..3feab0ac8cab5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24.sf100/simplified.txt @@ -0,0 +1,160 @@ +WholeStageCodegen (12) + Sort [c_last_name,c_first_name,s_store_name] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name] #1 + WholeStageCodegen (11) + Project [c_last_name,c_first_name,s_store_name,paid] + Filter [sum(netpaid)] + Subquery #1 + WholeStageCodegen (14) + HashAggregate [sum,count] [avg(netpaid),(0.05 * avg(netpaid)),sum,count] + InputAdapter + Exchange #10 + WholeStageCodegen (13) + HashAggregate [netpaid] [sum,count,sum,count] + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #11 + WholeStageCodegen (12) + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] + Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (9) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #12 + WholeStageCodegen (8) + Project [s_store_name,s_state,ca_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (5) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #13 + WholeStageCodegen (4) + Project [s_store_name,s_state,ca_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid] + BroadcastHashJoin [s_store_sk,c_customer_sk,ss_store_sk,ss_customer_sk] + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (3) + Project [s_store_sk,s_store_name,s_state,ca_state,c_customer_sk,c_first_name,c_last_name] + BroadcastHashJoin [ca_address_sk,ca_country,c_current_addr_sk,c_birth_country] + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (2) + Project [s_store_sk,s_store_name,s_state,ca_address_sk,ca_state,ca_country] + BroadcastHashJoin [s_zip,ca_zip] + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (1) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + Filter [ca_address_sk,ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip,ca_country] + Filter [c_customer_sk,c_current_addr_sk,c_birth_country] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name,c_birth_country] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk] + InputAdapter + WholeStageCodegen (7) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #17 + WholeStageCodegen (6) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + InputAdapter + WholeStageCodegen (11) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #18 + WholeStageCodegen (10) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + HashAggregate [c_last_name,c_first_name,s_store_name,sum,isEmpty] [sum(netpaid),paid,sum(netpaid),sum,isEmpty] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name] #2 + WholeStageCodegen (10) + HashAggregate [c_last_name,c_first_name,s_store_name,netpaid] [sum,isEmpty,sum,isEmpty] + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #3 + WholeStageCodegen (9) + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] + Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #4 + WholeStageCodegen (5) + Project [s_store_name,s_state,ca_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid,i_current_price,i_size,i_color,i_units,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [s_store_name,s_state,ca_state,c_first_name,c_last_name,ss_item_sk,ss_ticket_number,ss_net_paid] + BroadcastHashJoin [s_store_sk,c_customer_sk,ss_store_sk,ss_customer_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [s_store_sk,s_store_name,s_state,ca_state,c_customer_sk,c_first_name,c_last_name] + BroadcastHashJoin [ca_address_sk,ca_country,c_current_addr_sk,c_birth_country] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (2) + Project [s_store_sk,s_store_name,s_state,ca_address_sk,ca_state,ca_country] + BroadcastHashJoin [s_zip,ca_zip] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (1) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + Filter [ca_address_sk,ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip,ca_country] + Filter [c_customer_sk,c_current_addr_sk,c_birth_country] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name,c_birth_country] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (4) + Filter [i_color,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + InputAdapter + WholeStageCodegen (8) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #9 + WholeStageCodegen (7) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24/explain.txt new file mode 100644 index 0000000000000..2686a277825d4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24/explain.txt @@ -0,0 +1,537 @@ +== Physical Plan == +* Sort (49) ++- Exchange (48) + +- * Project (47) + +- * Filter (46) + +- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * HashAggregate (42) + +- Exchange (41) + +- * HashAggregate (40) + +- * Project (39) + +- * BroadcastHashJoin Inner BuildRight (38) + :- * Project (33) + : +- * BroadcastHashJoin Inner BuildRight (32) + : :- * Project (27) + : : +- * BroadcastHashJoin Inner BuildRight (26) + : : :- * Project (21) + : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : :- * Project (14) + : : : : +- * SortMergeJoin Inner (13) + : : : : :- * Sort (6) + : : : : : +- Exchange (5) + : : : : : +- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- * Sort (12) + : : : : +- Exchange (11) + : : : : +- * Project (10) + : : : : +- * Filter (9) + : : : : +- * ColumnarToRow (8) + : : : : +- Scan parquet default.store_returns (7) + : : : +- BroadcastExchange (19) + : : : +- * Project (18) + : : : +- * Filter (17) + : : : +- * ColumnarToRow (16) + : : : +- Scan parquet default.store (15) + : : +- BroadcastExchange (25) + : : +- * Filter (24) + : : +- * ColumnarToRow (23) + : : +- Scan parquet default.item (22) + : +- BroadcastExchange (31) + : +- * Filter (30) + : +- * ColumnarToRow (29) + : +- Scan parquet default.customer (28) + +- BroadcastExchange (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.customer_address (34) + + +(1) Scan parquet default.store_sales +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] + +(3) Filter [codegen id : 1] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] +Condition : (((isnotnull(ss_ticket_number#4) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_customer_sk#2)) + +(4) Project [codegen id : 1] +Output [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, ss_sold_date_sk#6] + +(5) Exchange +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Arguments: hashpartitioning(ss_ticket_number#4, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#7] + +(6) Sort [codegen id : 2] +Input [5]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5] +Arguments: [ss_ticket_number#4 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(7) Scan parquet default.store_returns +Output [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 3] +Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] + +(9) Filter [codegen id : 3] +Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] +Condition : (isnotnull(sr_ticket_number#9) AND isnotnull(sr_item_sk#8)) + +(10) Project [codegen id : 3] +Output [2]: [sr_item_sk#8, sr_ticket_number#9] +Input [3]: [sr_item_sk#8, sr_ticket_number#9, sr_returned_date_sk#10] + +(11) Exchange +Input [2]: [sr_item_sk#8, sr_ticket_number#9] +Arguments: hashpartitioning(sr_ticket_number#9, sr_item_sk#8, 5), ENSURE_REQUIREMENTS, [id=#11] + +(12) Sort [codegen id : 4] +Input [2]: [sr_item_sk#8, sr_ticket_number#9] +Arguments: [sr_ticket_number#9 ASC NULLS FIRST, sr_item_sk#8 ASC NULLS FIRST], false, 0 + +(13) SortMergeJoin [codegen id : 9] +Left keys [2]: [ss_ticket_number#4, ss_item_sk#1] +Right keys [2]: [sr_ticket_number#9, sr_item_sk#8] +Join condition: None + +(14) Project [codegen id : 9] +Output [4]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_net_paid#5, sr_item_sk#8, sr_ticket_number#9] + +(15) Scan parquet default.store +Output [5]: [s_store_sk#12, s_store_name#13, s_market_id#14, s_state#15, s_zip#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 5] +Input [5]: [s_store_sk#12, s_store_name#13, s_market_id#14, s_state#15, s_zip#16] + +(17) Filter [codegen id : 5] +Input [5]: [s_store_sk#12, s_store_name#13, s_market_id#14, s_state#15, s_zip#16] +Condition : (((isnotnull(s_market_id#14) AND (s_market_id#14 = 8)) AND isnotnull(s_store_sk#12)) AND isnotnull(s_zip#16)) + +(18) Project [codegen id : 5] +Output [4]: [s_store_sk#12, s_store_name#13, s_state#15, s_zip#16] +Input [5]: [s_store_sk#12, s_store_name#13, s_market_id#14, s_state#15, s_zip#16] + +(19) BroadcastExchange +Input [4]: [s_store_sk#12, s_store_name#13, s_state#15, s_zip#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(20) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#12] +Join condition: None + +(21) Project [codegen id : 9] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16] +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_store_sk#3, ss_net_paid#5, s_store_sk#12, s_store_name#13, s_state#15, s_zip#16] + +(22) Scan parquet default.item +Output [6]: [i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_color), EqualTo(i_color,pale ), IsNotNull(i_item_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 6] +Input [6]: [i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] + +(24) Filter [codegen id : 6] +Input [6]: [i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] +Condition : ((isnotnull(i_color#21) AND (i_color#21 = pale )) AND isnotnull(i_item_sk#18)) + +(25) BroadcastExchange +Input [6]: [i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(26) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#18] +Join condition: None + +(27) Project [codegen id : 9] +Output [10]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_item_sk#18, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23] + +(28) Scan parquet default.customer +Output [5]: [c_customer_sk#25, c_current_addr_sk#26, c_first_name#27, c_last_name#28, c_birth_country#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_birth_country)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 7] +Input [5]: [c_customer_sk#25, c_current_addr_sk#26, c_first_name#27, c_last_name#28, c_birth_country#29] + +(30) Filter [codegen id : 7] +Input [5]: [c_customer_sk#25, c_current_addr_sk#26, c_first_name#27, c_last_name#28, c_birth_country#29] +Condition : ((isnotnull(c_customer_sk#25) AND isnotnull(c_current_addr_sk#26)) AND isnotnull(c_birth_country#29)) + +(31) BroadcastExchange +Input [5]: [c_customer_sk#25, c_current_addr_sk#26, c_first_name#27, c_last_name#28, c_birth_country#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#30] + +(32) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#25] +Join condition: None + +(33) Project [codegen id : 9] +Output [13]: [ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_current_addr_sk#26, c_first_name#27, c_last_name#28, c_birth_country#29] +Input [15]: [ss_customer_sk#2, ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_customer_sk#25, c_current_addr_sk#26, c_first_name#27, c_last_name#28, c_birth_country#29] + +(34) Scan parquet default.customer_address +Output [4]: [ca_address_sk#31, ca_state#32, ca_zip#33, ca_country#34] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 8] +Input [4]: [ca_address_sk#31, ca_state#32, ca_zip#33, ca_country#34] + +(36) Filter [codegen id : 8] +Input [4]: [ca_address_sk#31, ca_state#32, ca_zip#33, ca_country#34] +Condition : ((isnotnull(ca_address_sk#31) AND isnotnull(ca_country#34)) AND isnotnull(ca_zip#33)) + +(37) BroadcastExchange +Input [4]: [ca_address_sk#31, ca_state#32, ca_zip#33, ca_country#34] +Arguments: HashedRelationBroadcastMode(List(input[0, int, false], upper(input[3, string, false]), input[2, string, false]),false), [id=#35] + +(38) BroadcastHashJoin [codegen id : 9] +Left keys [3]: [c_current_addr_sk#26, c_birth_country#29, s_zip#16] +Right keys [3]: [ca_address_sk#31, upper(ca_country#34), ca_zip#33] +Join condition: None + +(39) Project [codegen id : 9] +Output [11]: [ss_net_paid#5, s_store_name#13, s_state#15, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_first_name#27, c_last_name#28, ca_state#32] +Input [17]: [ss_net_paid#5, s_store_name#13, s_state#15, s_zip#16, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_current_addr_sk#26, c_first_name#27, c_last_name#28, c_birth_country#29, ca_address_sk#31, ca_state#32, ca_zip#33, ca_country#34] + +(40) HashAggregate [codegen id : 9] +Input [11]: [ss_net_paid#5, s_store_name#13, s_state#15, i_current_price#19, i_size#20, i_color#21, i_units#22, i_manager_id#23, c_first_name#27, c_last_name#28, ca_state#32] +Keys [10]: [c_last_name#28, c_first_name#27, s_store_name#13, ca_state#32, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum#36] +Results [11]: [c_last_name#28, c_first_name#27, s_store_name#13, ca_state#32, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20, sum#37] + +(41) Exchange +Input [11]: [c_last_name#28, c_first_name#27, s_store_name#13, ca_state#32, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20, sum#37] +Arguments: hashpartitioning(c_last_name#28, c_first_name#27, s_store_name#13, ca_state#32, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20, 5), ENSURE_REQUIREMENTS, [id=#38] + +(42) HashAggregate [codegen id : 10] +Input [11]: [c_last_name#28, c_first_name#27, s_store_name#13, ca_state#32, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20, sum#37] +Keys [10]: [c_last_name#28, c_first_name#27, s_store_name#13, ca_state#32, s_state#15, i_color#21, i_current_price#19, i_manager_id#23, i_units#22, i_size#20] +Functions [1]: [sum(UnscaledValue(ss_net_paid#5))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#5))#39] +Results [4]: [c_last_name#28, c_first_name#27, s_store_name#13, MakeDecimal(sum(UnscaledValue(ss_net_paid#5))#39,17,2) AS netpaid#40] + +(43) HashAggregate [codegen id : 10] +Input [4]: [c_last_name#28, c_first_name#27, s_store_name#13, netpaid#40] +Keys [3]: [c_last_name#28, c_first_name#27, s_store_name#13] +Functions [1]: [partial_sum(netpaid#40)] +Aggregate Attributes [2]: [sum#41, isEmpty#42] +Results [5]: [c_last_name#28, c_first_name#27, s_store_name#13, sum#43, isEmpty#44] + +(44) Exchange +Input [5]: [c_last_name#28, c_first_name#27, s_store_name#13, sum#43, isEmpty#44] +Arguments: hashpartitioning(c_last_name#28, c_first_name#27, s_store_name#13, 5), ENSURE_REQUIREMENTS, [id=#45] + +(45) HashAggregate [codegen id : 11] +Input [5]: [c_last_name#28, c_first_name#27, s_store_name#13, sum#43, isEmpty#44] +Keys [3]: [c_last_name#28, c_first_name#27, s_store_name#13] +Functions [1]: [sum(netpaid#40)] +Aggregate Attributes [1]: [sum(netpaid#40)#46] +Results [5]: [c_last_name#28, c_first_name#27, s_store_name#13, sum(netpaid#40)#46 AS paid#47, sum(netpaid#40)#46 AS sum(netpaid#40)#48] + +(46) Filter [codegen id : 11] +Input [5]: [c_last_name#28, c_first_name#27, s_store_name#13, paid#47, sum(netpaid#40)#48] +Condition : (isnotnull(sum(netpaid#40)#48) AND (cast(sum(netpaid#40)#48 as decimal(33,8)) > cast(Subquery scalar-subquery#49, [id=#50] as decimal(33,8)))) + +(47) Project [codegen id : 11] +Output [4]: [c_last_name#28, c_first_name#27, s_store_name#13, paid#47] +Input [5]: [c_last_name#28, c_first_name#27, s_store_name#13, paid#47, sum(netpaid#40)#48] + +(48) Exchange +Input [4]: [c_last_name#28, c_first_name#27, s_store_name#13, paid#47] +Arguments: rangepartitioning(c_last_name#28 ASC NULLS FIRST, c_first_name#27 ASC NULLS FIRST, s_store_name#13 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#51] + +(49) Sort [codegen id : 12] +Input [4]: [c_last_name#28, c_first_name#27, s_store_name#13, paid#47] +Arguments: [c_last_name#28 ASC NULLS FIRST, c_first_name#27 ASC NULLS FIRST, s_store_name#13 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 46 Hosting Expression = Subquery scalar-subquery#49, [id=#50] +* HashAggregate (94) ++- Exchange (93) + +- * HashAggregate (92) + +- * HashAggregate (91) + +- Exchange (90) + +- * HashAggregate (89) + +- * Project (88) + +- * BroadcastHashJoin Inner BuildRight (87) + :- * Project (82) + : +- * BroadcastHashJoin Inner BuildRight (81) + : :- * Project (76) + : : +- * BroadcastHashJoin Inner BuildRight (75) + : : :- * Project (70) + : : : +- * BroadcastHashJoin Inner BuildRight (69) + : : : :- * Project (63) + : : : : +- * SortMergeJoin Inner (62) + : : : : :- * Sort (55) + : : : : : +- Exchange (54) + : : : : : +- * Project (53) + : : : : : +- * Filter (52) + : : : : : +- * ColumnarToRow (51) + : : : : : +- Scan parquet default.store_sales (50) + : : : : +- * Sort (61) + : : : : +- Exchange (60) + : : : : +- * Project (59) + : : : : +- * Filter (58) + : : : : +- * ColumnarToRow (57) + : : : : +- Scan parquet default.store_returns (56) + : : : +- BroadcastExchange (68) + : : : +- * Project (67) + : : : +- * Filter (66) + : : : +- * ColumnarToRow (65) + : : : +- Scan parquet default.store (64) + : : +- BroadcastExchange (74) + : : +- * Filter (73) + : : +- * ColumnarToRow (72) + : : +- Scan parquet default.item (71) + : +- BroadcastExchange (80) + : +- * Filter (79) + : +- * ColumnarToRow (78) + : +- Scan parquet default.customer (77) + +- BroadcastExchange (86) + +- * Filter (85) + +- * ColumnarToRow (84) + +- Scan parquet default.customer_address (83) + + +(50) Scan parquet default.store_sales +Output [6]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_ticket_number#55, ss_net_paid#56, ss_sold_date_sk#57] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_sales] +PushedFilters: [IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(51) ColumnarToRow [codegen id : 1] +Input [6]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_ticket_number#55, ss_net_paid#56, ss_sold_date_sk#57] + +(52) Filter [codegen id : 1] +Input [6]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_ticket_number#55, ss_net_paid#56, ss_sold_date_sk#57] +Condition : (((isnotnull(ss_ticket_number#55) AND isnotnull(ss_item_sk#52)) AND isnotnull(ss_store_sk#54)) AND isnotnull(ss_customer_sk#53)) + +(53) Project [codegen id : 1] +Output [5]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_ticket_number#55, ss_net_paid#56] +Input [6]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_ticket_number#55, ss_net_paid#56, ss_sold_date_sk#57] + +(54) Exchange +Input [5]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_ticket_number#55, ss_net_paid#56] +Arguments: hashpartitioning(ss_ticket_number#55, ss_item_sk#52, 5), ENSURE_REQUIREMENTS, [id=#58] + +(55) Sort [codegen id : 2] +Input [5]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_ticket_number#55, ss_net_paid#56] +Arguments: [ss_ticket_number#55 ASC NULLS FIRST, ss_item_sk#52 ASC NULLS FIRST], false, 0 + +(56) Scan parquet default.store_returns +Output [3]: [sr_item_sk#59, sr_ticket_number#60, sr_returned_date_sk#61] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(57) ColumnarToRow [codegen id : 3] +Input [3]: [sr_item_sk#59, sr_ticket_number#60, sr_returned_date_sk#61] + +(58) Filter [codegen id : 3] +Input [3]: [sr_item_sk#59, sr_ticket_number#60, sr_returned_date_sk#61] +Condition : (isnotnull(sr_ticket_number#60) AND isnotnull(sr_item_sk#59)) + +(59) Project [codegen id : 3] +Output [2]: [sr_item_sk#59, sr_ticket_number#60] +Input [3]: [sr_item_sk#59, sr_ticket_number#60, sr_returned_date_sk#61] + +(60) Exchange +Input [2]: [sr_item_sk#59, sr_ticket_number#60] +Arguments: hashpartitioning(sr_ticket_number#60, sr_item_sk#59, 5), ENSURE_REQUIREMENTS, [id=#62] + +(61) Sort [codegen id : 4] +Input [2]: [sr_item_sk#59, sr_ticket_number#60] +Arguments: [sr_ticket_number#60 ASC NULLS FIRST, sr_item_sk#59 ASC NULLS FIRST], false, 0 + +(62) SortMergeJoin [codegen id : 9] +Left keys [2]: [ss_ticket_number#55, ss_item_sk#52] +Right keys [2]: [sr_ticket_number#60, sr_item_sk#59] +Join condition: None + +(63) Project [codegen id : 9] +Output [4]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_net_paid#56] +Input [7]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_ticket_number#55, ss_net_paid#56, sr_item_sk#59, sr_ticket_number#60] + +(64) Scan parquet default.store +Output [5]: [s_store_sk#63, s_store_name#64, s_market_id#65, s_state#66, s_zip#67] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_market_id), EqualTo(s_market_id,8), IsNotNull(s_store_sk), IsNotNull(s_zip)] +ReadSchema: struct + +(65) ColumnarToRow [codegen id : 5] +Input [5]: [s_store_sk#63, s_store_name#64, s_market_id#65, s_state#66, s_zip#67] + +(66) Filter [codegen id : 5] +Input [5]: [s_store_sk#63, s_store_name#64, s_market_id#65, s_state#66, s_zip#67] +Condition : (((isnotnull(s_market_id#65) AND (s_market_id#65 = 8)) AND isnotnull(s_store_sk#63)) AND isnotnull(s_zip#67)) + +(67) Project [codegen id : 5] +Output [4]: [s_store_sk#63, s_store_name#64, s_state#66, s_zip#67] +Input [5]: [s_store_sk#63, s_store_name#64, s_market_id#65, s_state#66, s_zip#67] + +(68) BroadcastExchange +Input [4]: [s_store_sk#63, s_store_name#64, s_state#66, s_zip#67] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#68] + +(69) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#54] +Right keys [1]: [s_store_sk#63] +Join condition: None + +(70) Project [codegen id : 9] +Output [6]: [ss_item_sk#52, ss_customer_sk#53, ss_net_paid#56, s_store_name#64, s_state#66, s_zip#67] +Input [8]: [ss_item_sk#52, ss_customer_sk#53, ss_store_sk#54, ss_net_paid#56, s_store_sk#63, s_store_name#64, s_state#66, s_zip#67] + +(71) Scan parquet default.item +Output [6]: [i_item_sk#69, i_current_price#70, i_size#71, i_color#72, i_units#73, i_manager_id#74] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(72) ColumnarToRow [codegen id : 6] +Input [6]: [i_item_sk#69, i_current_price#70, i_size#71, i_color#72, i_units#73, i_manager_id#74] + +(73) Filter [codegen id : 6] +Input [6]: [i_item_sk#69, i_current_price#70, i_size#71, i_color#72, i_units#73, i_manager_id#74] +Condition : isnotnull(i_item_sk#69) + +(74) BroadcastExchange +Input [6]: [i_item_sk#69, i_current_price#70, i_size#71, i_color#72, i_units#73, i_manager_id#74] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#75] + +(75) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#52] +Right keys [1]: [i_item_sk#69] +Join condition: None + +(76) Project [codegen id : 9] +Output [10]: [ss_customer_sk#53, ss_net_paid#56, s_store_name#64, s_state#66, s_zip#67, i_current_price#70, i_size#71, i_color#72, i_units#73, i_manager_id#74] +Input [12]: [ss_item_sk#52, ss_customer_sk#53, ss_net_paid#56, s_store_name#64, s_state#66, s_zip#67, i_item_sk#69, i_current_price#70, i_size#71, i_color#72, i_units#73, i_manager_id#74] + +(77) Scan parquet default.customer +Output [5]: [c_customer_sk#76, c_current_addr_sk#77, c_first_name#78, c_last_name#79, c_birth_country#80] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_current_addr_sk), IsNotNull(c_birth_country)] +ReadSchema: struct + +(78) ColumnarToRow [codegen id : 7] +Input [5]: [c_customer_sk#76, c_current_addr_sk#77, c_first_name#78, c_last_name#79, c_birth_country#80] + +(79) Filter [codegen id : 7] +Input [5]: [c_customer_sk#76, c_current_addr_sk#77, c_first_name#78, c_last_name#79, c_birth_country#80] +Condition : ((isnotnull(c_customer_sk#76) AND isnotnull(c_current_addr_sk#77)) AND isnotnull(c_birth_country#80)) + +(80) BroadcastExchange +Input [5]: [c_customer_sk#76, c_current_addr_sk#77, c_first_name#78, c_last_name#79, c_birth_country#80] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#81] + +(81) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_customer_sk#53] +Right keys [1]: [c_customer_sk#76] +Join condition: None + +(82) Project [codegen id : 9] +Output [13]: [ss_net_paid#56, s_store_name#64, s_state#66, s_zip#67, i_current_price#70, i_size#71, i_color#72, i_units#73, i_manager_id#74, c_current_addr_sk#77, c_first_name#78, c_last_name#79, c_birth_country#80] +Input [15]: [ss_customer_sk#53, ss_net_paid#56, s_store_name#64, s_state#66, s_zip#67, i_current_price#70, i_size#71, i_color#72, i_units#73, i_manager_id#74, c_customer_sk#76, c_current_addr_sk#77, c_first_name#78, c_last_name#79, c_birth_country#80] + +(83) Scan parquet default.customer_address +Output [4]: [ca_address_sk#82, ca_state#83, ca_zip#84, ca_country#85] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk), IsNotNull(ca_country), IsNotNull(ca_zip)] +ReadSchema: struct + +(84) ColumnarToRow [codegen id : 8] +Input [4]: [ca_address_sk#82, ca_state#83, ca_zip#84, ca_country#85] + +(85) Filter [codegen id : 8] +Input [4]: [ca_address_sk#82, ca_state#83, ca_zip#84, ca_country#85] +Condition : ((isnotnull(ca_address_sk#82) AND isnotnull(ca_country#85)) AND isnotnull(ca_zip#84)) + +(86) BroadcastExchange +Input [4]: [ca_address_sk#82, ca_state#83, ca_zip#84, ca_country#85] +Arguments: HashedRelationBroadcastMode(List(input[0, int, false], upper(input[3, string, false]), input[2, string, false]),false), [id=#86] + +(87) BroadcastHashJoin [codegen id : 9] +Left keys [3]: [c_current_addr_sk#77, c_birth_country#80, s_zip#67] +Right keys [3]: [ca_address_sk#82, upper(ca_country#85), ca_zip#84] +Join condition: None + +(88) Project [codegen id : 9] +Output [11]: [ss_net_paid#56, s_store_name#64, s_state#66, i_current_price#70, i_size#71, i_color#72, i_units#73, i_manager_id#74, c_first_name#78, c_last_name#79, ca_state#83] +Input [17]: [ss_net_paid#56, s_store_name#64, s_state#66, s_zip#67, i_current_price#70, i_size#71, i_color#72, i_units#73, i_manager_id#74, c_current_addr_sk#77, c_first_name#78, c_last_name#79, c_birth_country#80, ca_address_sk#82, ca_state#83, ca_zip#84, ca_country#85] + +(89) HashAggregate [codegen id : 9] +Input [11]: [ss_net_paid#56, s_store_name#64, s_state#66, i_current_price#70, i_size#71, i_color#72, i_units#73, i_manager_id#74, c_first_name#78, c_last_name#79, ca_state#83] +Keys [10]: [c_last_name#79, c_first_name#78, s_store_name#64, ca_state#83, s_state#66, i_color#72, i_current_price#70, i_manager_id#74, i_units#73, i_size#71] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#56))] +Aggregate Attributes [1]: [sum#87] +Results [11]: [c_last_name#79, c_first_name#78, s_store_name#64, ca_state#83, s_state#66, i_color#72, i_current_price#70, i_manager_id#74, i_units#73, i_size#71, sum#88] + +(90) Exchange +Input [11]: [c_last_name#79, c_first_name#78, s_store_name#64, ca_state#83, s_state#66, i_color#72, i_current_price#70, i_manager_id#74, i_units#73, i_size#71, sum#88] +Arguments: hashpartitioning(c_last_name#79, c_first_name#78, s_store_name#64, ca_state#83, s_state#66, i_color#72, i_current_price#70, i_manager_id#74, i_units#73, i_size#71, 5), ENSURE_REQUIREMENTS, [id=#89] + +(91) HashAggregate [codegen id : 10] +Input [11]: [c_last_name#79, c_first_name#78, s_store_name#64, ca_state#83, s_state#66, i_color#72, i_current_price#70, i_manager_id#74, i_units#73, i_size#71, sum#88] +Keys [10]: [c_last_name#79, c_first_name#78, s_store_name#64, ca_state#83, s_state#66, i_color#72, i_current_price#70, i_manager_id#74, i_units#73, i_size#71] +Functions [1]: [sum(UnscaledValue(ss_net_paid#56))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#56))#90] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_paid#56))#90,17,2) AS netpaid#40] + +(92) HashAggregate [codegen id : 10] +Input [1]: [netpaid#40] +Keys: [] +Functions [1]: [partial_avg(netpaid#40)] +Aggregate Attributes [2]: [sum#91, count#92] +Results [2]: [sum#93, count#94] + +(93) Exchange +Input [2]: [sum#93, count#94] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#95] + +(94) HashAggregate [codegen id : 11] +Input [2]: [sum#93, count#94] +Keys: [] +Functions [1]: [avg(netpaid#40)] +Aggregate Attributes [1]: [avg(netpaid#40)#96] +Results [1]: [CheckOverflow((0.050000 * promote_precision(avg(netpaid#40)#96)), DecimalType(24,8), true) AS (0.05 * avg(netpaid))#97] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24/simplified.txt new file mode 100644 index 0000000000000..6309ec999ce77 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q24/simplified.txt @@ -0,0 +1,151 @@ +WholeStageCodegen (12) + Sort [c_last_name,c_first_name,s_store_name] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name] #1 + WholeStageCodegen (11) + Project [c_last_name,c_first_name,s_store_name,paid] + Filter [sum(netpaid)] + Subquery #1 + WholeStageCodegen (11) + HashAggregate [sum,count] [avg(netpaid),(0.05 * avg(netpaid)),sum,count] + InputAdapter + Exchange #10 + WholeStageCodegen (10) + HashAggregate [netpaid] [sum,count,sum,count] + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #11 + WholeStageCodegen (9) + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] + Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + BroadcastHashJoin [c_current_addr_sk,c_birth_country,s_zip,ca_address_sk,ca_country,ca_zip] + Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_current_addr_sk,c_first_name,c_last_name,c_birth_country] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_net_paid] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #12 + WholeStageCodegen (1) + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk] + InputAdapter + WholeStageCodegen (4) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #13 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (5) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (6) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (7) + Filter [c_customer_sk,c_current_addr_sk,c_birth_country] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name,c_birth_country] + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (8) + Filter [ca_address_sk,ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip,ca_country] + HashAggregate [c_last_name,c_first_name,s_store_name,sum,isEmpty] [sum(netpaid),paid,sum(netpaid),sum,isEmpty] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name] #2 + WholeStageCodegen (10) + HashAggregate [c_last_name,c_first_name,s_store_name,netpaid] [sum,isEmpty,sum,isEmpty] + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,sum] [sum(UnscaledValue(ss_net_paid)),netpaid,sum] + InputAdapter + Exchange [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size] #3 + WholeStageCodegen (9) + HashAggregate [c_last_name,c_first_name,s_store_name,ca_state,s_state,i_color,i_current_price,i_manager_id,i_units,i_size,ss_net_paid] [sum,sum] + Project [ss_net_paid,s_store_name,s_state,i_current_price,i_size,i_color,i_units,i_manager_id,c_first_name,c_last_name,ca_state] + BroadcastHashJoin [c_current_addr_sk,c_birth_country,s_zip,ca_address_sk,ca_country,ca_zip] + Project [ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id,c_current_addr_sk,c_first_name,c_last_name,c_birth_country] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip,i_current_price,i_size,i_color,i_units,i_manager_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_net_paid,s_store_name,s_state,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_net_paid] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #4 + WholeStageCodegen (1) + Project [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid] + Filter [ss_ticket_number,ss_item_sk,ss_store_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_store_sk,ss_ticket_number,ss_net_paid,ss_sold_date_sk] + InputAdapter + WholeStageCodegen (4) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #5 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Project [s_store_sk,s_store_name,s_state,s_zip] + Filter [s_market_id,s_store_sk,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_market_id,s_state,s_zip] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (6) + Filter [i_color,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_size,i_color,i_units,i_manager_id] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (7) + Filter [c_customer_sk,c_current_addr_sk,c_birth_country] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk,c_first_name,c_last_name,c_birth_country] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (8) + Filter [ca_address_sk,ca_country,ca_zip] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state,ca_zip,ca_country] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt new file mode 100644 index 0000000000000..1fb9533024b2f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/explain.txt @@ -0,0 +1,445 @@ +== Physical Plan == +TakeOrderedAndProject (77) ++- Union (76) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Project (17) + : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.customer_demographics (4) + : : : +- BroadcastExchange (15) + : : : +- * Project (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.date_dim (11) + : : +- BroadcastExchange (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.store (18) + : +- BroadcastExchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.item (24) + :- * HashAggregate (54) + : +- Exchange (53) + : +- * HashAggregate (52) + : +- * Project (51) + : +- * BroadcastHashJoin Inner BuildRight (50) + : :- * Project (48) + : : +- * BroadcastHashJoin Inner BuildRight (47) + : : :- * Project (45) + : : : +- * BroadcastHashJoin Inner BuildRight (44) + : : : :- * Project (38) + : : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : : :- * Filter (35) + : : : : : +- * ColumnarToRow (34) + : : : : : +- Scan parquet default.store_sales (33) + : : : : +- ReusedExchange (36) + : : : +- BroadcastExchange (43) + : : : +- * Project (42) + : : : +- * Filter (41) + : : : +- * ColumnarToRow (40) + : : : +- Scan parquet default.store (39) + : : +- ReusedExchange (46) + : +- ReusedExchange (49) + +- * HashAggregate (75) + +- Exchange (74) + +- * HashAggregate (73) + +- * Project (72) + +- * BroadcastHashJoin Inner BuildRight (71) + :- * Project (66) + : +- * BroadcastHashJoin Inner BuildRight (65) + : :- * Project (63) + : : +- * BroadcastHashJoin Inner BuildRight (62) + : : :- * Project (60) + : : : +- * BroadcastHashJoin Inner BuildRight (59) + : : : :- * Filter (57) + : : : : +- * ColumnarToRow (56) + : : : : +- Scan parquet default.store_sales (55) + : : : +- ReusedExchange (58) + : : +- ReusedExchange (61) + : +- ReusedExchange (64) + +- BroadcastExchange (70) + +- * Filter (69) + +- * ColumnarToRow (68) + +- Scan parquet default.item (67) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_cdemo_sk#2) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,F), EqualTo(cd_marital_status,W), EqualTo(cd_education_status,Primary ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Condition : ((((((isnotnull(cd_gender#11) AND isnotnull(cd_marital_status#12)) AND isnotnull(cd_education_status#13)) AND (cd_gender#11 = F)) AND (cd_marital_status#12 = W)) AND (cd_education_status#13 = Primary )) AND isnotnull(cd_demo_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#10] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(8) BroadcastExchange +Input [1]: [cd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, cd_demo_sk#10] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#15, d_year#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1998), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] +Condition : ((isnotnull(d_year#16) AND (d_year#16 = 1998)) AND isnotnull(d_date_sk#15)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#15] +Input [2]: [d_date_sk#15, d_year#16] + +(15) BroadcastExchange +Input [1]: [d_date_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#15] + +(18) Scan parquet default.store +Output [2]: [s_store_sk#18, s_state#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#18, s_state#19] + +(20) Filter [codegen id : 3] +Input [2]: [s_store_sk#18, s_state#19] +Condition : ((isnotnull(s_state#19) AND (s_state#19 = TN)) AND isnotnull(s_store_sk#18)) + +(21) BroadcastExchange +Input [2]: [s_store_sk#18, s_state#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(22) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#18] +Join condition: None + +(23) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#19] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#18, s_state#19] + +(24) Scan parquet default.item +Output [2]: [i_item_sk#21, i_item_id#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#21, i_item_id#22] + +(26) Filter [codegen id : 4] +Input [2]: [i_item_sk#21, i_item_id#22] +Condition : isnotnull(i_item_sk#21) + +(27) BroadcastExchange +Input [2]: [i_item_sk#21, i_item_id#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#21] +Join condition: None + +(29) Project [codegen id : 5] +Output [6]: [i_item_id#22, s_state#19, ss_quantity#4 AS agg1#24, ss_list_price#5 AS agg2#25, ss_coupon_amt#7 AS agg3#26, ss_sales_price#6 AS agg4#27] +Input [8]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#19, i_item_sk#21, i_item_id#22] + +(30) HashAggregate [codegen id : 5] +Input [6]: [i_item_id#22, s_state#19, agg1#24, agg2#25, agg3#26, agg4#27] +Keys [2]: [i_item_id#22, s_state#19] +Functions [4]: [partial_avg(agg1#24), partial_avg(UnscaledValue(agg2#25)), partial_avg(UnscaledValue(agg3#26)), partial_avg(UnscaledValue(agg4#27))] +Aggregate Attributes [8]: [sum#28, count#29, sum#30, count#31, sum#32, count#33, sum#34, count#35] +Results [10]: [i_item_id#22, s_state#19, sum#36, count#37, sum#38, count#39, sum#40, count#41, sum#42, count#43] + +(31) Exchange +Input [10]: [i_item_id#22, s_state#19, sum#36, count#37, sum#38, count#39, sum#40, count#41, sum#42, count#43] +Arguments: hashpartitioning(i_item_id#22, s_state#19, 5), ENSURE_REQUIREMENTS, [id=#44] + +(32) HashAggregate [codegen id : 6] +Input [10]: [i_item_id#22, s_state#19, sum#36, count#37, sum#38, count#39, sum#40, count#41, sum#42, count#43] +Keys [2]: [i_item_id#22, s_state#19] +Functions [4]: [avg(agg1#24), avg(UnscaledValue(agg2#25)), avg(UnscaledValue(agg3#26)), avg(UnscaledValue(agg4#27))] +Aggregate Attributes [4]: [avg(agg1#24)#45, avg(UnscaledValue(agg2#25))#46, avg(UnscaledValue(agg3#26))#47, avg(UnscaledValue(agg4#27))#48] +Results [7]: [i_item_id#22, s_state#19, 0 AS g_state#49, avg(agg1#24)#45 AS agg1#50, cast((avg(UnscaledValue(agg2#25))#46 / 100.0) as decimal(11,6)) AS agg2#51, cast((avg(UnscaledValue(agg3#26))#47 / 100.0) as decimal(11,6)) AS agg3#52, cast((avg(UnscaledValue(agg4#27))#48 / 100.0) as decimal(11,6)) AS agg4#53] + +(33) Scan parquet default.store_sales +Output [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#61), dynamicpruningexpression(ss_sold_date_sk#61 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] + +(35) Filter [codegen id : 11] +Input [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] +Condition : ((isnotnull(ss_cdemo_sk#55) AND isnotnull(ss_store_sk#56)) AND isnotnull(ss_item_sk#54)) + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [cd_demo_sk#62] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_cdemo_sk#55] +Right keys [1]: [cd_demo_sk#62] +Join condition: None + +(38) Project [codegen id : 11] +Output [7]: [ss_item_sk#54, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] +Input [9]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61, cd_demo_sk#62] + +(39) Scan parquet default.store +Output [2]: [s_store_sk#63, s_state#64] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] +ReadSchema: struct + +(40) ColumnarToRow [codegen id : 8] +Input [2]: [s_store_sk#63, s_state#64] + +(41) Filter [codegen id : 8] +Input [2]: [s_store_sk#63, s_state#64] +Condition : ((isnotnull(s_state#64) AND (s_state#64 = TN)) AND isnotnull(s_store_sk#63)) + +(42) Project [codegen id : 8] +Output [1]: [s_store_sk#63] +Input [2]: [s_store_sk#63, s_state#64] + +(43) BroadcastExchange +Input [1]: [s_store_sk#63] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#65] + +(44) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_store_sk#56] +Right keys [1]: [s_store_sk#63] +Join condition: None + +(45) Project [codegen id : 11] +Output [6]: [ss_item_sk#54, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] +Input [8]: [ss_item_sk#54, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61, s_store_sk#63] + +(46) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#66] + +(47) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_sold_date_sk#61] +Right keys [1]: [d_date_sk#66] +Join condition: None + +(48) Project [codegen id : 11] +Output [5]: [ss_item_sk#54, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60] +Input [7]: [ss_item_sk#54, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61, d_date_sk#66] + +(49) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#67, i_item_id#68] + +(50) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_item_sk#54] +Right keys [1]: [i_item_sk#67] +Join condition: None + +(51) Project [codegen id : 11] +Output [5]: [i_item_id#68, ss_quantity#57 AS agg1#24, ss_list_price#58 AS agg2#25, ss_coupon_amt#60 AS agg3#26, ss_sales_price#59 AS agg4#27] +Input [7]: [ss_item_sk#54, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, i_item_sk#67, i_item_id#68] + +(52) HashAggregate [codegen id : 11] +Input [5]: [i_item_id#68, agg1#24, agg2#25, agg3#26, agg4#27] +Keys [1]: [i_item_id#68] +Functions [4]: [partial_avg(agg1#24), partial_avg(UnscaledValue(agg2#25)), partial_avg(UnscaledValue(agg3#26)), partial_avg(UnscaledValue(agg4#27))] +Aggregate Attributes [8]: [sum#69, count#70, sum#71, count#72, sum#73, count#74, sum#75, count#76] +Results [9]: [i_item_id#68, sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84] + +(53) Exchange +Input [9]: [i_item_id#68, sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84] +Arguments: hashpartitioning(i_item_id#68, 5), ENSURE_REQUIREMENTS, [id=#85] + +(54) HashAggregate [codegen id : 12] +Input [9]: [i_item_id#68, sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84] +Keys [1]: [i_item_id#68] +Functions [4]: [avg(agg1#24), avg(UnscaledValue(agg2#25)), avg(UnscaledValue(agg3#26)), avg(UnscaledValue(agg4#27))] +Aggregate Attributes [4]: [avg(agg1#24)#86, avg(UnscaledValue(agg2#25))#87, avg(UnscaledValue(agg3#26))#88, avg(UnscaledValue(agg4#27))#89] +Results [7]: [i_item_id#68, null AS s_state#90, 1 AS g_state#91, avg(agg1#24)#86 AS agg1#92, cast((avg(UnscaledValue(agg2#25))#87 / 100.0) as decimal(11,6)) AS agg2#93, cast((avg(UnscaledValue(agg3#26))#88 / 100.0) as decimal(11,6)) AS agg3#94, cast((avg(UnscaledValue(agg4#27))#89 / 100.0) as decimal(11,6)) AS agg4#95] + +(55) Scan parquet default.store_sales +Output [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#103), dynamicpruningexpression(ss_sold_date_sk#103 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(56) ColumnarToRow [codegen id : 17] +Input [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] + +(57) Filter [codegen id : 17] +Input [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] +Condition : ((isnotnull(ss_cdemo_sk#97) AND isnotnull(ss_store_sk#98)) AND isnotnull(ss_item_sk#96)) + +(58) ReusedExchange [Reuses operator id: 8] +Output [1]: [cd_demo_sk#104] + +(59) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_cdemo_sk#97] +Right keys [1]: [cd_demo_sk#104] +Join condition: None + +(60) Project [codegen id : 17] +Output [7]: [ss_item_sk#96, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] +Input [9]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103, cd_demo_sk#104] + +(61) ReusedExchange [Reuses operator id: 43] +Output [1]: [s_store_sk#105] + +(62) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_store_sk#98] +Right keys [1]: [s_store_sk#105] +Join condition: None + +(63) Project [codegen id : 17] +Output [6]: [ss_item_sk#96, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] +Input [8]: [ss_item_sk#96, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103, s_store_sk#105] + +(64) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#106] + +(65) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_sold_date_sk#103] +Right keys [1]: [d_date_sk#106] +Join condition: None + +(66) Project [codegen id : 17] +Output [5]: [ss_item_sk#96, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102] +Input [7]: [ss_item_sk#96, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103, d_date_sk#106] + +(67) Scan parquet default.item +Output [1]: [i_item_sk#107] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(68) ColumnarToRow [codegen id : 16] +Input [1]: [i_item_sk#107] + +(69) Filter [codegen id : 16] +Input [1]: [i_item_sk#107] +Condition : isnotnull(i_item_sk#107) + +(70) BroadcastExchange +Input [1]: [i_item_sk#107] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#108] + +(71) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_item_sk#96] +Right keys [1]: [i_item_sk#107] +Join condition: None + +(72) Project [codegen id : 17] +Output [4]: [ss_quantity#99 AS agg1#24, ss_list_price#100 AS agg2#25, ss_coupon_amt#102 AS agg3#26, ss_sales_price#101 AS agg4#27] +Input [6]: [ss_item_sk#96, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, i_item_sk#107] + +(73) HashAggregate [codegen id : 17] +Input [4]: [agg1#24, agg2#25, agg3#26, agg4#27] +Keys: [] +Functions [4]: [partial_avg(agg1#24), partial_avg(UnscaledValue(agg2#25)), partial_avg(UnscaledValue(agg3#26)), partial_avg(UnscaledValue(agg4#27))] +Aggregate Attributes [8]: [sum#109, count#110, sum#111, count#112, sum#113, count#114, sum#115, count#116] +Results [8]: [sum#117, count#118, sum#119, count#120, sum#121, count#122, sum#123, count#124] + +(74) Exchange +Input [8]: [sum#117, count#118, sum#119, count#120, sum#121, count#122, sum#123, count#124] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#125] + +(75) HashAggregate [codegen id : 18] +Input [8]: [sum#117, count#118, sum#119, count#120, sum#121, count#122, sum#123, count#124] +Keys: [] +Functions [4]: [avg(agg1#24), avg(UnscaledValue(agg2#25)), avg(UnscaledValue(agg3#26)), avg(UnscaledValue(agg4#27))] +Aggregate Attributes [4]: [avg(agg1#24)#126, avg(UnscaledValue(agg2#25))#127, avg(UnscaledValue(agg3#26))#128, avg(UnscaledValue(agg4#27))#129] +Results [7]: [null AS i_item_id#130, null AS s_state#131, 1 AS g_state#132, avg(agg1#24)#126 AS agg1#133, cast((avg(UnscaledValue(agg2#25))#127 / 100.0) as decimal(11,6)) AS agg2#134, cast((avg(UnscaledValue(agg3#26))#128 / 100.0) as decimal(11,6)) AS agg3#135, cast((avg(UnscaledValue(agg4#27))#129 / 100.0) as decimal(11,6)) AS agg4#136] + +(76) Union + +(77) TakeOrderedAndProject +Input [7]: [i_item_id#22, s_state#19, g_state#49, agg1#50, agg2#51, agg3#52, agg4#53] +Arguments: 100, [i_item_id#22 ASC NULLS FIRST, s_state#19 ASC NULLS FIRST], [i_item_id#22, s_state#19, g_state#49, agg1#50, agg2#51, agg3#52, agg4#53] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (78) + + +(78) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#15] + +Subquery:2 Hosting operator id = 33 Hosting Expression = ss_sold_date_sk#61 IN dynamicpruning#9 + +Subquery:3 Hosting operator id = 55 Hosting Expression = ss_sold_date_sk#103 IN dynamicpruning#9 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt new file mode 100644 index 0000000000000..e134318874eb8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a.sf100/simplified.txt @@ -0,0 +1,117 @@ +TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] + Union + WholeStageCodegen (6) + HashAggregate [i_item_id,s_state,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,s_state] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,s_state,agg1,agg2,agg3,agg4] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,s_state,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [cd_demo_sk] + Filter [cd_gender,cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + WholeStageCodegen (12) + HashAggregate [i_item_id,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),s_state,g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id] #6 + WholeStageCodegen (11) + HashAggregate [i_item_id,agg1,agg2,agg3,agg4] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [cd_demo_sk] #3 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (8) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 + WholeStageCodegen (18) + HashAggregate [sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),i_item_id,s_state,g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange #8 + WholeStageCodegen (17) + HashAggregate [agg1,agg2,agg3,agg4] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [cd_demo_sk] #3 + InputAdapter + ReusedExchange [s_store_sk] #7 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (16) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/explain.txt new file mode 100644 index 0000000000000..f05f4e9f2e43e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/explain.txt @@ -0,0 +1,445 @@ +== Physical Plan == +TakeOrderedAndProject (77) ++- Union (76) + :- * HashAggregate (32) + : +- Exchange (31) + : +- * HashAggregate (30) + : +- * Project (29) + : +- * BroadcastHashJoin Inner BuildRight (28) + : :- * Project (23) + : : +- * BroadcastHashJoin Inner BuildRight (22) + : : :- * Project (17) + : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.customer_demographics (4) + : : : +- BroadcastExchange (15) + : : : +- * Project (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.date_dim (11) + : : +- BroadcastExchange (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.store (18) + : +- BroadcastExchange (27) + : +- * Filter (26) + : +- * ColumnarToRow (25) + : +- Scan parquet default.item (24) + :- * HashAggregate (54) + : +- Exchange (53) + : +- * HashAggregate (52) + : +- * Project (51) + : +- * BroadcastHashJoin Inner BuildRight (50) + : :- * Project (48) + : : +- * BroadcastHashJoin Inner BuildRight (47) + : : :- * Project (41) + : : : +- * BroadcastHashJoin Inner BuildRight (40) + : : : :- * Project (38) + : : : : +- * BroadcastHashJoin Inner BuildRight (37) + : : : : :- * Filter (35) + : : : : : +- * ColumnarToRow (34) + : : : : : +- Scan parquet default.store_sales (33) + : : : : +- ReusedExchange (36) + : : : +- ReusedExchange (39) + : : +- BroadcastExchange (46) + : : +- * Project (45) + : : +- * Filter (44) + : : +- * ColumnarToRow (43) + : : +- Scan parquet default.store (42) + : +- ReusedExchange (49) + +- * HashAggregate (75) + +- Exchange (74) + +- * HashAggregate (73) + +- * Project (72) + +- * BroadcastHashJoin Inner BuildRight (71) + :- * Project (66) + : +- * BroadcastHashJoin Inner BuildRight (65) + : :- * Project (63) + : : +- * BroadcastHashJoin Inner BuildRight (62) + : : :- * Project (60) + : : : +- * BroadcastHashJoin Inner BuildRight (59) + : : : :- * Filter (57) + : : : : +- * ColumnarToRow (56) + : : : : +- Scan parquet default.store_sales (55) + : : : +- ReusedExchange (58) + : : +- ReusedExchange (61) + : +- ReusedExchange (64) + +- BroadcastExchange (70) + +- * Filter (69) + +- * ColumnarToRow (68) + +- Scan parquet default.item (67) + + +(1) Scan parquet default.store_sales +Output [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] + +(3) Filter [codegen id : 5] +Input [8]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Condition : ((isnotnull(ss_cdemo_sk#2) AND isnotnull(ss_store_sk#3)) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.customer_demographics +Output [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_gender), IsNotNull(cd_marital_status), IsNotNull(cd_education_status), EqualTo(cd_gender,F), EqualTo(cd_marital_status,W), EqualTo(cd_education_status,Primary ), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(6) Filter [codegen id : 1] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] +Condition : ((((((isnotnull(cd_gender#11) AND isnotnull(cd_marital_status#12)) AND isnotnull(cd_education_status#13)) AND (cd_gender#11 = F)) AND (cd_marital_status#12 = W)) AND (cd_education_status#13 = Primary )) AND isnotnull(cd_demo_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [cd_demo_sk#10] +Input [4]: [cd_demo_sk#10, cd_gender#11, cd_marital_status#12, cd_education_status#13] + +(8) BroadcastExchange +Input [1]: [cd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(9) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#10] +Join condition: None + +(10) Project [codegen id : 5] +Output [7]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8] +Input [9]: [ss_item_sk#1, ss_cdemo_sk#2, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, cd_demo_sk#10] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#15, d_year#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1998), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#15, d_year#16] +Condition : ((isnotnull(d_year#16) AND (d_year#16 = 1998)) AND isnotnull(d_date_sk#15)) + +(14) Project [codegen id : 2] +Output [1]: [d_date_sk#15] +Input [2]: [d_date_sk#15, d_year#16] + +(15) BroadcastExchange +Input [1]: [d_date_sk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(16) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(17) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, ss_sold_date_sk#8, d_date_sk#15] + +(18) Scan parquet default.store +Output [2]: [s_store_sk#18, s_state#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#18, s_state#19] + +(20) Filter [codegen id : 3] +Input [2]: [s_store_sk#18, s_state#19] +Condition : ((isnotnull(s_state#19) AND (s_state#19 = TN)) AND isnotnull(s_store_sk#18)) + +(21) BroadcastExchange +Input [2]: [s_store_sk#18, s_state#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(22) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#18] +Join condition: None + +(23) Project [codegen id : 5] +Output [6]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#19] +Input [8]: [ss_item_sk#1, ss_store_sk#3, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_store_sk#18, s_state#19] + +(24) Scan parquet default.item +Output [2]: [i_item_sk#21, i_item_id#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(25) ColumnarToRow [codegen id : 4] +Input [2]: [i_item_sk#21, i_item_id#22] + +(26) Filter [codegen id : 4] +Input [2]: [i_item_sk#21, i_item_id#22] +Condition : isnotnull(i_item_sk#21) + +(27) BroadcastExchange +Input [2]: [i_item_sk#21, i_item_id#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(28) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#21] +Join condition: None + +(29) Project [codegen id : 5] +Output [6]: [i_item_id#22, s_state#19, ss_quantity#4 AS agg1#24, ss_list_price#5 AS agg2#25, ss_coupon_amt#7 AS agg3#26, ss_sales_price#6 AS agg4#27] +Input [8]: [ss_item_sk#1, ss_quantity#4, ss_list_price#5, ss_sales_price#6, ss_coupon_amt#7, s_state#19, i_item_sk#21, i_item_id#22] + +(30) HashAggregate [codegen id : 5] +Input [6]: [i_item_id#22, s_state#19, agg1#24, agg2#25, agg3#26, agg4#27] +Keys [2]: [i_item_id#22, s_state#19] +Functions [4]: [partial_avg(agg1#24), partial_avg(UnscaledValue(agg2#25)), partial_avg(UnscaledValue(agg3#26)), partial_avg(UnscaledValue(agg4#27))] +Aggregate Attributes [8]: [sum#28, count#29, sum#30, count#31, sum#32, count#33, sum#34, count#35] +Results [10]: [i_item_id#22, s_state#19, sum#36, count#37, sum#38, count#39, sum#40, count#41, sum#42, count#43] + +(31) Exchange +Input [10]: [i_item_id#22, s_state#19, sum#36, count#37, sum#38, count#39, sum#40, count#41, sum#42, count#43] +Arguments: hashpartitioning(i_item_id#22, s_state#19, 5), ENSURE_REQUIREMENTS, [id=#44] + +(32) HashAggregate [codegen id : 6] +Input [10]: [i_item_id#22, s_state#19, sum#36, count#37, sum#38, count#39, sum#40, count#41, sum#42, count#43] +Keys [2]: [i_item_id#22, s_state#19] +Functions [4]: [avg(agg1#24), avg(UnscaledValue(agg2#25)), avg(UnscaledValue(agg3#26)), avg(UnscaledValue(agg4#27))] +Aggregate Attributes [4]: [avg(agg1#24)#45, avg(UnscaledValue(agg2#25))#46, avg(UnscaledValue(agg3#26))#47, avg(UnscaledValue(agg4#27))#48] +Results [7]: [i_item_id#22, s_state#19, 0 AS g_state#49, avg(agg1#24)#45 AS agg1#50, cast((avg(UnscaledValue(agg2#25))#46 / 100.0) as decimal(11,6)) AS agg2#51, cast((avg(UnscaledValue(agg3#26))#47 / 100.0) as decimal(11,6)) AS agg3#52, cast((avg(UnscaledValue(agg4#27))#48 / 100.0) as decimal(11,6)) AS agg4#53] + +(33) Scan parquet default.store_sales +Output [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#61), dynamicpruningexpression(ss_sold_date_sk#61 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 11] +Input [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] + +(35) Filter [codegen id : 11] +Input [8]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] +Condition : ((isnotnull(ss_cdemo_sk#55) AND isnotnull(ss_store_sk#56)) AND isnotnull(ss_item_sk#54)) + +(36) ReusedExchange [Reuses operator id: 8] +Output [1]: [cd_demo_sk#62] + +(37) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_cdemo_sk#55] +Right keys [1]: [cd_demo_sk#62] +Join condition: None + +(38) Project [codegen id : 11] +Output [7]: [ss_item_sk#54, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61] +Input [9]: [ss_item_sk#54, ss_cdemo_sk#55, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61, cd_demo_sk#62] + +(39) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#63] + +(40) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_sold_date_sk#61] +Right keys [1]: [d_date_sk#63] +Join condition: None + +(41) Project [codegen id : 11] +Output [6]: [ss_item_sk#54, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60] +Input [8]: [ss_item_sk#54, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, ss_sold_date_sk#61, d_date_sk#63] + +(42) Scan parquet default.store +Output [2]: [s_store_sk#64, s_state#65] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] +ReadSchema: struct + +(43) ColumnarToRow [codegen id : 9] +Input [2]: [s_store_sk#64, s_state#65] + +(44) Filter [codegen id : 9] +Input [2]: [s_store_sk#64, s_state#65] +Condition : ((isnotnull(s_state#65) AND (s_state#65 = TN)) AND isnotnull(s_store_sk#64)) + +(45) Project [codegen id : 9] +Output [1]: [s_store_sk#64] +Input [2]: [s_store_sk#64, s_state#65] + +(46) BroadcastExchange +Input [1]: [s_store_sk#64] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#66] + +(47) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_store_sk#56] +Right keys [1]: [s_store_sk#64] +Join condition: None + +(48) Project [codegen id : 11] +Output [5]: [ss_item_sk#54, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60] +Input [7]: [ss_item_sk#54, ss_store_sk#56, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, s_store_sk#64] + +(49) ReusedExchange [Reuses operator id: 27] +Output [2]: [i_item_sk#67, i_item_id#68] + +(50) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [ss_item_sk#54] +Right keys [1]: [i_item_sk#67] +Join condition: None + +(51) Project [codegen id : 11] +Output [5]: [i_item_id#68, ss_quantity#57 AS agg1#24, ss_list_price#58 AS agg2#25, ss_coupon_amt#60 AS agg3#26, ss_sales_price#59 AS agg4#27] +Input [7]: [ss_item_sk#54, ss_quantity#57, ss_list_price#58, ss_sales_price#59, ss_coupon_amt#60, i_item_sk#67, i_item_id#68] + +(52) HashAggregate [codegen id : 11] +Input [5]: [i_item_id#68, agg1#24, agg2#25, agg3#26, agg4#27] +Keys [1]: [i_item_id#68] +Functions [4]: [partial_avg(agg1#24), partial_avg(UnscaledValue(agg2#25)), partial_avg(UnscaledValue(agg3#26)), partial_avg(UnscaledValue(agg4#27))] +Aggregate Attributes [8]: [sum#69, count#70, sum#71, count#72, sum#73, count#74, sum#75, count#76] +Results [9]: [i_item_id#68, sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84] + +(53) Exchange +Input [9]: [i_item_id#68, sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84] +Arguments: hashpartitioning(i_item_id#68, 5), ENSURE_REQUIREMENTS, [id=#85] + +(54) HashAggregate [codegen id : 12] +Input [9]: [i_item_id#68, sum#77, count#78, sum#79, count#80, sum#81, count#82, sum#83, count#84] +Keys [1]: [i_item_id#68] +Functions [4]: [avg(agg1#24), avg(UnscaledValue(agg2#25)), avg(UnscaledValue(agg3#26)), avg(UnscaledValue(agg4#27))] +Aggregate Attributes [4]: [avg(agg1#24)#86, avg(UnscaledValue(agg2#25))#87, avg(UnscaledValue(agg3#26))#88, avg(UnscaledValue(agg4#27))#89] +Results [7]: [i_item_id#68, null AS s_state#90, 1 AS g_state#91, avg(agg1#24)#86 AS agg1#92, cast((avg(UnscaledValue(agg2#25))#87 / 100.0) as decimal(11,6)) AS agg2#93, cast((avg(UnscaledValue(agg3#26))#88 / 100.0) as decimal(11,6)) AS agg3#94, cast((avg(UnscaledValue(agg4#27))#89 / 100.0) as decimal(11,6)) AS agg4#95] + +(55) Scan parquet default.store_sales +Output [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#103), dynamicpruningexpression(ss_sold_date_sk#103 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_cdemo_sk), IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(56) ColumnarToRow [codegen id : 17] +Input [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] + +(57) Filter [codegen id : 17] +Input [8]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] +Condition : ((isnotnull(ss_cdemo_sk#97) AND isnotnull(ss_store_sk#98)) AND isnotnull(ss_item_sk#96)) + +(58) ReusedExchange [Reuses operator id: 8] +Output [1]: [cd_demo_sk#104] + +(59) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_cdemo_sk#97] +Right keys [1]: [cd_demo_sk#104] +Join condition: None + +(60) Project [codegen id : 17] +Output [7]: [ss_item_sk#96, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103] +Input [9]: [ss_item_sk#96, ss_cdemo_sk#97, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103, cd_demo_sk#104] + +(61) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#105] + +(62) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_sold_date_sk#103] +Right keys [1]: [d_date_sk#105] +Join condition: None + +(63) Project [codegen id : 17] +Output [6]: [ss_item_sk#96, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102] +Input [8]: [ss_item_sk#96, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, ss_sold_date_sk#103, d_date_sk#105] + +(64) ReusedExchange [Reuses operator id: 46] +Output [1]: [s_store_sk#106] + +(65) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_store_sk#98] +Right keys [1]: [s_store_sk#106] +Join condition: None + +(66) Project [codegen id : 17] +Output [5]: [ss_item_sk#96, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102] +Input [7]: [ss_item_sk#96, ss_store_sk#98, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, s_store_sk#106] + +(67) Scan parquet default.item +Output [1]: [i_item_sk#107] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(68) ColumnarToRow [codegen id : 16] +Input [1]: [i_item_sk#107] + +(69) Filter [codegen id : 16] +Input [1]: [i_item_sk#107] +Condition : isnotnull(i_item_sk#107) + +(70) BroadcastExchange +Input [1]: [i_item_sk#107] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#108] + +(71) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_item_sk#96] +Right keys [1]: [i_item_sk#107] +Join condition: None + +(72) Project [codegen id : 17] +Output [4]: [ss_quantity#99 AS agg1#24, ss_list_price#100 AS agg2#25, ss_coupon_amt#102 AS agg3#26, ss_sales_price#101 AS agg4#27] +Input [6]: [ss_item_sk#96, ss_quantity#99, ss_list_price#100, ss_sales_price#101, ss_coupon_amt#102, i_item_sk#107] + +(73) HashAggregate [codegen id : 17] +Input [4]: [agg1#24, agg2#25, agg3#26, agg4#27] +Keys: [] +Functions [4]: [partial_avg(agg1#24), partial_avg(UnscaledValue(agg2#25)), partial_avg(UnscaledValue(agg3#26)), partial_avg(UnscaledValue(agg4#27))] +Aggregate Attributes [8]: [sum#109, count#110, sum#111, count#112, sum#113, count#114, sum#115, count#116] +Results [8]: [sum#117, count#118, sum#119, count#120, sum#121, count#122, sum#123, count#124] + +(74) Exchange +Input [8]: [sum#117, count#118, sum#119, count#120, sum#121, count#122, sum#123, count#124] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#125] + +(75) HashAggregate [codegen id : 18] +Input [8]: [sum#117, count#118, sum#119, count#120, sum#121, count#122, sum#123, count#124] +Keys: [] +Functions [4]: [avg(agg1#24), avg(UnscaledValue(agg2#25)), avg(UnscaledValue(agg3#26)), avg(UnscaledValue(agg4#27))] +Aggregate Attributes [4]: [avg(agg1#24)#126, avg(UnscaledValue(agg2#25))#127, avg(UnscaledValue(agg3#26))#128, avg(UnscaledValue(agg4#27))#129] +Results [7]: [null AS i_item_id#130, null AS s_state#131, 1 AS g_state#132, avg(agg1#24)#126 AS agg1#133, cast((avg(UnscaledValue(agg2#25))#127 / 100.0) as decimal(11,6)) AS agg2#134, cast((avg(UnscaledValue(agg3#26))#128 / 100.0) as decimal(11,6)) AS agg3#135, cast((avg(UnscaledValue(agg4#27))#129 / 100.0) as decimal(11,6)) AS agg4#136] + +(76) Union + +(77) TakeOrderedAndProject +Input [7]: [i_item_id#22, s_state#19, g_state#49, agg1#50, agg2#51, agg3#52, agg4#53] +Arguments: 100, [i_item_id#22 ASC NULLS FIRST, s_state#19 ASC NULLS FIRST], [i_item_id#22, s_state#19, g_state#49, agg1#50, agg2#51, agg3#52, agg4#53] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (78) + + +(78) ReusedExchange [Reuses operator id: 15] +Output [1]: [d_date_sk#15] + +Subquery:2 Hosting operator id = 33 Hosting Expression = ss_sold_date_sk#61 IN dynamicpruning#9 + +Subquery:3 Hosting operator id = 55 Hosting Expression = ss_sold_date_sk#103 IN dynamicpruning#9 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/simplified.txt new file mode 100644 index 0000000000000..ac6635c260051 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q27a/simplified.txt @@ -0,0 +1,117 @@ +TakeOrderedAndProject [i_item_id,s_state,g_state,agg1,agg2,agg3,agg4] + Union + WholeStageCodegen (6) + HashAggregate [i_item_id,s_state,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id,s_state] #1 + WholeStageCodegen (5) + HashAggregate [i_item_id,s_state,agg1,agg2,agg3,agg4] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,s_state,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [cd_demo_sk] + Filter [cd_gender,cd_marital_status,cd_education_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_education_status] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id] + WholeStageCodegen (12) + HashAggregate [i_item_id,sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),s_state,g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange [i_item_id] #6 + WholeStageCodegen (11) + HashAggregate [i_item_id,agg1,agg2,agg3,agg4] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [i_item_id,ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [cd_demo_sk] #3 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (9) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + ReusedExchange [i_item_sk,i_item_id] #5 + WholeStageCodegen (18) + HashAggregate [sum,count,sum,count,sum,count,sum,count] [avg(agg1),avg(UnscaledValue(agg2)),avg(UnscaledValue(agg3)),avg(UnscaledValue(agg4)),i_item_id,s_state,g_state,agg1,agg2,agg3,agg4,sum,count,sum,count,sum,count,sum,count] + InputAdapter + Exchange #8 + WholeStageCodegen (17) + HashAggregate [agg1,agg2,agg3,agg4] [sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count,sum,count] + Project [ss_quantity,ss_list_price,ss_coupon_amt,ss_sales_price] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Filter [ss_cdemo_sk,ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_cdemo_sk,ss_store_sk,ss_quantity,ss_list_price,ss_sales_price,ss_coupon_amt,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [cd_demo_sk] #3 + InputAdapter + ReusedExchange [d_date_sk] #2 + InputAdapter + ReusedExchange [s_store_sk] #7 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (16) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/explain.txt new file mode 100644 index 0000000000000..f6151f4d79ec1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/explain.txt @@ -0,0 +1,229 @@ +== Physical Plan == +* Sort (39) ++- Exchange (38) + +- * Project (37) + +- * SortMergeJoin Inner (36) + :- * Sort (30) + : +- Exchange (29) + : +- * Filter (28) + : +- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.household_demographics (18) + +- * Sort (35) + +- Exchange (34) + +- * Filter (33) + +- * ColumnarToRow (32) + +- Scan parquet default.customer (31) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Condition : ((isnotnull(ss_store_sk#3) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_dom#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] +Condition : (((((d_dom#9 >= 1) AND (d_dom#9 <= 3)) OR ((d_dom#9 >= 25) AND (d_dom#9 <= 28))) AND d_year#8 IN (1999,2000,2001)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4] +Input [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#11, s_county#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_county), EqualTo(s_county,Williamson County), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] +Condition : ((isnotnull(s_county#12) AND (s_county#12 = Williamson County)) AND isnotnull(s_store_sk#11)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#11] +Input [2]: [s_store_sk#11, s_county#12] + +(15) BroadcastExchange +Input [1]: [s_store_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#11] +Join condition: None + +(17) Project [codegen id : 4] +Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#11] + +(18) Scan parquet default.household_demographics +Output [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000 ),EqualTo(hd_buy_potential,unknown )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(20) Filter [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Condition : (((((isnotnull(hd_vehicle_count#17) AND isnotnull(hd_dep_count#16)) AND ((hd_buy_potential#15 = >10000 ) OR (hd_buy_potential#15 = unknown ))) AND (hd_vehicle_count#17 > 0)) AND ((cast(hd_dep_count#16 as double) / cast(hd_vehicle_count#17 as double)) > 1.2)) AND isnotnull(hd_demo_sk#14)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#14] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#14] +Join condition: None + +(24) Project [codegen id : 4] +Output [2]: [ss_customer_sk#1, ss_ticket_number#4] +Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#14] + +(25) HashAggregate [codegen id : 4] +Input [2]: [ss_customer_sk#1, ss_ticket_number#4] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#19] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] + +(26) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) HashAggregate [codegen id : 5] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#22] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#22 AS cnt#23] + +(28) Filter [codegen id : 5] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Condition : ((cnt#23 >= 15) AND (cnt#23 <= 20)) + +(29) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#24] + +(30) Sort [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(31) Scan parquet default.customer +Output [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 7] +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] + +(33) Filter [codegen id : 7] +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Condition : isnotnull(c_customer_sk#25) + +(34) Exchange +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Arguments: hashpartitioning(c_customer_sk#25, 5), ENSURE_REQUIREMENTS, [id=#30] + +(35) Sort [codegen id : 8] +Input [5]: [c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] +Arguments: [c_customer_sk#25 ASC NULLS FIRST], false, 0 + +(36) SortMergeJoin [codegen id : 9] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#25] +Join condition: None + +(37) Project [codegen id : 9] +Output [6]: [c_last_name#28, c_first_name#27, c_salutation#26, c_preferred_cust_flag#29, ss_ticket_number#4, cnt#23] +Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23, c_customer_sk#25, c_salutation#26, c_first_name#27, c_last_name#28, c_preferred_cust_flag#29] + +(38) Exchange +Input [6]: [c_last_name#28, c_first_name#27, c_salutation#26, c_preferred_cust_flag#29, ss_ticket_number#4, cnt#23] +Arguments: rangepartitioning(c_last_name#28 ASC NULLS FIRST, c_first_name#27 ASC NULLS FIRST, c_salutation#26 ASC NULLS FIRST, c_preferred_cust_flag#29 DESC NULLS LAST, ss_ticket_number#4 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#31] + +(39) Sort [codegen id : 10] +Input [6]: [c_last_name#28, c_first_name#27, c_salutation#26, c_preferred_cust_flag#29, ss_ticket_number#4, cnt#23] +Arguments: [c_last_name#28 ASC NULLS FIRST, c_first_name#27 ASC NULLS FIRST, c_salutation#26 ASC NULLS FIRST, c_preferred_cust_flag#29 DESC NULLS LAST, ss_ticket_number#4 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (40) + + +(40) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/simplified.txt new file mode 100644 index 0000000000000..537cfdff2e1eb --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34.sf100/simplified.txt @@ -0,0 +1,65 @@ +WholeStageCodegen (10) + Sort [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number] + InputAdapter + Exchange [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number] #1 + WholeStageCodegen (9) + Project [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number,cnt] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #2 + WholeStageCodegen (5) + Filter [cnt] + HashAggregate [ss_ticket_number,ss_customer_sk,count] [count(1),cnt,count] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk] #3 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk] [count,count] + Project [ss_customer_sk,ss_ticket_number] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_county,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_vehicle_count,hd_dep_count,hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential,hd_dep_count,hd_vehicle_count] + InputAdapter + WholeStageCodegen (8) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #7 + WholeStageCodegen (7) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34/explain.txt new file mode 100644 index 0000000000000..e4d14f842f5a9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34/explain.txt @@ -0,0 +1,214 @@ +== Physical Plan == +* Sort (36) ++- Exchange (35) + +- * Project (34) + +- * BroadcastHashJoin Inner BuildRight (33) + :- * Filter (28) + : +- * HashAggregate (27) + : +- Exchange (26) + : +- * HashAggregate (25) + : +- * Project (24) + : +- * BroadcastHashJoin Inner BuildRight (23) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (22) + : +- * Project (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.household_demographics (18) + +- BroadcastExchange (32) + +- * Filter (31) + +- * ColumnarToRow (30) + +- Scan parquet default.customer (29) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5] +Condition : ((isnotnull(ss_store_sk#3) AND isnotnull(ss_hdemo_sk#2)) AND isnotnull(ss_customer_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_dom#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(And(GreaterThanOrEqual(d_dom,1),LessThanOrEqual(d_dom,3)),And(GreaterThanOrEqual(d_dom,25),LessThanOrEqual(d_dom,28))), In(d_year, [1999,2000,2001]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] +Condition : (((((d_dom#9 >= 1) AND (d_dom#9 <= 3)) OR ((d_dom#9 >= 25) AND (d_dom#9 <= 28))) AND d_year#8 IN (1999,2000,2001)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_dom#9] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4] +Input [6]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#11, s_county#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_county), EqualTo(s_county,Williamson County), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#11, s_county#12] +Condition : ((isnotnull(s_county#12) AND (s_county#12 = Williamson County)) AND isnotnull(s_store_sk#11)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#11] +Input [2]: [s_store_sk#11, s_county#12] + +(15) BroadcastExchange +Input [1]: [s_store_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#3] +Right keys [1]: [s_store_sk#11] +Join condition: None + +(17) Project [codegen id : 4] +Output [3]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4] +Input [5]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_store_sk#3, ss_ticket_number#4, s_store_sk#11] + +(18) Scan parquet default.household_demographics +Output [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_vehicle_count), IsNotNull(hd_dep_count), Or(EqualTo(hd_buy_potential,>10000 ),EqualTo(hd_buy_potential,unknown )), GreaterThan(hd_vehicle_count,0), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(20) Filter [codegen id : 3] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] +Condition : (((((isnotnull(hd_vehicle_count#17) AND isnotnull(hd_dep_count#16)) AND ((hd_buy_potential#15 = >10000 ) OR (hd_buy_potential#15 = unknown ))) AND (hd_vehicle_count#17 > 0)) AND ((cast(hd_dep_count#16 as double) / cast(hd_vehicle_count#17 as double)) > 1.2)) AND isnotnull(hd_demo_sk#14)) + +(21) Project [codegen id : 3] +Output [1]: [hd_demo_sk#14] +Input [4]: [hd_demo_sk#14, hd_buy_potential#15, hd_dep_count#16, hd_vehicle_count#17] + +(22) BroadcastExchange +Input [1]: [hd_demo_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(23) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_hdemo_sk#2] +Right keys [1]: [hd_demo_sk#14] +Join condition: None + +(24) Project [codegen id : 4] +Output [2]: [ss_customer_sk#1, ss_ticket_number#4] +Input [4]: [ss_customer_sk#1, ss_hdemo_sk#2, ss_ticket_number#4, hd_demo_sk#14] + +(25) HashAggregate [codegen id : 4] +Input [2]: [ss_customer_sk#1, ss_ticket_number#4] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#19] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] + +(26) Exchange +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Arguments: hashpartitioning(ss_ticket_number#4, ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) HashAggregate [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, count#20] +Keys [2]: [ss_ticket_number#4, ss_customer_sk#1] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#22] +Results [3]: [ss_ticket_number#4, ss_customer_sk#1, count(1)#22 AS cnt#23] + +(28) Filter [codegen id : 6] +Input [3]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23] +Condition : ((cnt#23 >= 15) AND (cnt#23 <= 20)) + +(29) Scan parquet default.customer +Output [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] + +(31) Filter [codegen id : 5] +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Condition : isnotnull(c_customer_sk#24) + +(32) BroadcastExchange +Input [5]: [c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#29] + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#24] +Join condition: None + +(34) Project [codegen id : 6] +Output [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Input [8]: [ss_ticket_number#4, ss_customer_sk#1, cnt#23, c_customer_sk#24, c_salutation#25, c_first_name#26, c_last_name#27, c_preferred_cust_flag#28] + +(35) Exchange +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Arguments: rangepartitioning(c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, ss_ticket_number#4 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#30] + +(36) Sort [codegen id : 7] +Input [6]: [c_last_name#27, c_first_name#26, c_salutation#25, c_preferred_cust_flag#28, ss_ticket_number#4, cnt#23] +Arguments: [c_last_name#27 ASC NULLS FIRST, c_first_name#26 ASC NULLS FIRST, c_salutation#25 ASC NULLS FIRST, c_preferred_cust_flag#28 DESC NULLS LAST, ss_ticket_number#4 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (37) + + +(37) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34/simplified.txt new file mode 100644 index 0000000000000..ab6398796def0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q34/simplified.txt @@ -0,0 +1,56 @@ +WholeStageCodegen (7) + Sort [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number] + InputAdapter + Exchange [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number] #1 + WholeStageCodegen (6) + Project [c_last_name,c_first_name,c_salutation,c_preferred_cust_flag,ss_ticket_number,cnt] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Filter [cnt] + HashAggregate [ss_ticket_number,ss_customer_sk,count] [count(1),cnt,count] + InputAdapter + Exchange [ss_ticket_number,ss_customer_sk] #2 + WholeStageCodegen (4) + HashAggregate [ss_ticket_number,ss_customer_sk] [count,count] + Project [ss_customer_sk,ss_ticket_number] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_ticket_number] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_hdemo_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_hdemo_sk,ss_store_sk,ss_ticket_number,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_dom,d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_dom] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_county,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Project [hd_demo_sk] + Filter [hd_vehicle_count,hd_dep_count,hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential,hd_dep_count,hd_vehicle_count] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (5) + Filter [c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_salutation,c_first_name,c_last_name,c_preferred_cust_flag] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/explain.txt new file mode 100644 index 0000000000000..7c032590fe404 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/explain.txt @@ -0,0 +1,328 @@ +== Physical Plan == +TakeOrderedAndProject (57) ++- * HashAggregate (56) + +- Exchange (55) + +- * HashAggregate (54) + +- * Project (53) + +- * SortMergeJoin Inner (52) + :- * Sort (46) + : +- Exchange (45) + : +- * Project (44) + : +- * SortMergeJoin Inner (43) + : :- * Sort (37) + : : +- Exchange (36) + : : +- * Project (35) + : : +- * Filter (34) + : : +- SortMergeJoin ExistenceJoin(exists#1) (33) + : : :- SortMergeJoin ExistenceJoin(exists#2) (25) + : : : :- * SortMergeJoin LeftSemi (17) + : : : : :- * Sort (5) + : : : : : +- Exchange (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- * Sort (16) + : : : : +- Exchange (15) + : : : : +- * Project (14) + : : : : +- * BroadcastHashJoin Inner BuildRight (13) + : : : : :- * ColumnarToRow (7) + : : : : : +- Scan parquet default.store_sales (6) + : : : : +- BroadcastExchange (12) + : : : : +- * Project (11) + : : : : +- * Filter (10) + : : : : +- * ColumnarToRow (9) + : : : : +- Scan parquet default.date_dim (8) + : : : +- * Sort (24) + : : : +- Exchange (23) + : : : +- * Project (22) + : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : :- * ColumnarToRow (19) + : : : : +- Scan parquet default.web_sales (18) + : : : +- ReusedExchange (20) + : : +- * Sort (32) + : : +- Exchange (31) + : : +- * Project (30) + : : +- * BroadcastHashJoin Inner BuildRight (29) + : : :- * ColumnarToRow (27) + : : : +- Scan parquet default.catalog_sales (26) + : : +- ReusedExchange (28) + : +- * Sort (42) + : +- Exchange (41) + : +- * Filter (40) + : +- * ColumnarToRow (39) + : +- Scan parquet default.customer_address (38) + +- * Sort (51) + +- Exchange (50) + +- * Filter (49) + +- * ColumnarToRow (48) + +- Scan parquet default.customer_demographics (47) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] + +(3) Filter [codegen id : 1] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4)) + +(4) Exchange +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: hashpartitioning(c_customer_sk#3, 5), ENSURE_REQUIREMENTS, [id=#6] + +(5) Sort [codegen id : 2] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: [c_customer_sk#3 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ss_customer_sk#7, ss_sold_date_sk#8] + +(8) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_qoy#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,2002), LessThan(d_qoy,4), IsNotNull(d_date_sk)] +ReadSchema: struct + +(9) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#10, d_year#11, d_qoy#12] + +(10) Filter [codegen id : 3] +Input [3]: [d_date_sk#10, d_year#11, d_qoy#12] +Condition : ((((isnotnull(d_year#11) AND isnotnull(d_qoy#12)) AND (d_year#11 = 2002)) AND (d_qoy#12 < 4)) AND isnotnull(d_date_sk#10)) + +(11) Project [codegen id : 3] +Output [1]: [d_date_sk#10] +Input [3]: [d_date_sk#10, d_year#11, d_qoy#12] + +(12) BroadcastExchange +Input [1]: [d_date_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(13) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(14) Project [codegen id : 4] +Output [1]: [ss_customer_sk#7] +Input [3]: [ss_customer_sk#7, ss_sold_date_sk#8, d_date_sk#10] + +(15) Exchange +Input [1]: [ss_customer_sk#7] +Arguments: hashpartitioning(ss_customer_sk#7, 5), ENSURE_REQUIREMENTS, [id=#14] + +(16) Sort [codegen id : 5] +Input [1]: [ss_customer_sk#7] +Arguments: [ss_customer_sk#7 ASC NULLS FIRST], false, 0 + +(17) SortMergeJoin [codegen id : 6] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ss_customer_sk#7] +Join condition: None + +(18) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#15, ws_sold_date_sk#16] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#16), dynamicpruningexpression(ws_sold_date_sk#16 IN dynamicpruning#9)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 8] +Input [2]: [ws_bill_customer_sk#15, ws_sold_date_sk#16] + +(20) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#17] + +(21) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_sold_date_sk#16] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(22) Project [codegen id : 8] +Output [1]: [ws_bill_customer_sk#15] +Input [3]: [ws_bill_customer_sk#15, ws_sold_date_sk#16, d_date_sk#17] + +(23) Exchange +Input [1]: [ws_bill_customer_sk#15] +Arguments: hashpartitioning(ws_bill_customer_sk#15, 5), ENSURE_REQUIREMENTS, [id=#18] + +(24) Sort [codegen id : 9] +Input [1]: [ws_bill_customer_sk#15] +Arguments: [ws_bill_customer_sk#15 ASC NULLS FIRST], false, 0 + +(25) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ws_bill_customer_sk#15] +Join condition: None + +(26) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#19, cs_sold_date_sk#20] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#20), dynamicpruningexpression(cs_sold_date_sk#20 IN dynamicpruning#9)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 11] +Input [2]: [cs_ship_customer_sk#19, cs_sold_date_sk#20] + +(28) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#21] + +(29) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [cs_sold_date_sk#20] +Right keys [1]: [d_date_sk#21] +Join condition: None + +(30) Project [codegen id : 11] +Output [1]: [cs_ship_customer_sk#19] +Input [3]: [cs_ship_customer_sk#19, cs_sold_date_sk#20, d_date_sk#21] + +(31) Exchange +Input [1]: [cs_ship_customer_sk#19] +Arguments: hashpartitioning(cs_ship_customer_sk#19, 5), ENSURE_REQUIREMENTS, [id=#22] + +(32) Sort [codegen id : 12] +Input [1]: [cs_ship_customer_sk#19] +Arguments: [cs_ship_customer_sk#19 ASC NULLS FIRST], false, 0 + +(33) SortMergeJoin +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [cs_ship_customer_sk#19] +Join condition: None + +(34) Filter [codegen id : 13] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] +Condition : (exists#2 OR exists#1) + +(35) Project [codegen id : 13] +Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] + +(36) Exchange +Input [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: hashpartitioning(c_current_addr_sk#5, 5), ENSURE_REQUIREMENTS, [id=#23] + +(37) Sort [codegen id : 14] +Input [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Arguments: [c_current_addr_sk#5 ASC NULLS FIRST], false, 0 + +(38) Scan parquet default.customer_address +Output [2]: [ca_address_sk#24, ca_state#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 15] +Input [2]: [ca_address_sk#24, ca_state#25] + +(40) Filter [codegen id : 15] +Input [2]: [ca_address_sk#24, ca_state#25] +Condition : isnotnull(ca_address_sk#24) + +(41) Exchange +Input [2]: [ca_address_sk#24, ca_state#25] +Arguments: hashpartitioning(ca_address_sk#24, 5), ENSURE_REQUIREMENTS, [id=#26] + +(42) Sort [codegen id : 16] +Input [2]: [ca_address_sk#24, ca_state#25] +Arguments: [ca_address_sk#24 ASC NULLS FIRST], false, 0 + +(43) SortMergeJoin [codegen id : 17] +Left keys [1]: [c_current_addr_sk#5] +Right keys [1]: [ca_address_sk#24] +Join condition: None + +(44) Project [codegen id : 17] +Output [2]: [c_current_cdemo_sk#4, ca_state#25] +Input [4]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#24, ca_state#25] + +(45) Exchange +Input [2]: [c_current_cdemo_sk#4, ca_state#25] +Arguments: hashpartitioning(c_current_cdemo_sk#4, 5), ENSURE_REQUIREMENTS, [id=#27] + +(46) Sort [codegen id : 18] +Input [2]: [c_current_cdemo_sk#4, ca_state#25] +Arguments: [c_current_cdemo_sk#4 ASC NULLS FIRST], false, 0 + +(47) Scan parquet default.customer_demographics +Output [6]: [cd_demo_sk#28, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 19] +Input [6]: [cd_demo_sk#28, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] + +(49) Filter [codegen id : 19] +Input [6]: [cd_demo_sk#28, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Condition : isnotnull(cd_demo_sk#28) + +(50) Exchange +Input [6]: [cd_demo_sk#28, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Arguments: hashpartitioning(cd_demo_sk#28, 5), ENSURE_REQUIREMENTS, [id=#34] + +(51) Sort [codegen id : 20] +Input [6]: [cd_demo_sk#28, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Arguments: [cd_demo_sk#28 ASC NULLS FIRST], false, 0 + +(52) SortMergeJoin [codegen id : 21] +Left keys [1]: [c_current_cdemo_sk#4] +Right keys [1]: [cd_demo_sk#28] +Join condition: None + +(53) Project [codegen id : 21] +Output [6]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Input [8]: [c_current_cdemo_sk#4, ca_state#25, cd_demo_sk#28, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] + +(54) HashAggregate [codegen id : 21] +Input [6]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Keys [6]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Functions [10]: [partial_count(1), partial_avg(cd_dep_count#31), partial_max(cd_dep_count#31), partial_sum(cd_dep_count#31), partial_avg(cd_dep_employed_count#32), partial_max(cd_dep_employed_count#32), partial_sum(cd_dep_employed_count#32), partial_avg(cd_dep_college_count#33), partial_max(cd_dep_college_count#33), partial_sum(cd_dep_college_count#33)] +Aggregate Attributes [13]: [count#35, sum#36, count#37, max#38, sum#39, sum#40, count#41, max#42, sum#43, sum#44, count#45, max#46, sum#47] +Results [19]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#48, sum#49, count#50, max#51, sum#52, sum#53, count#54, max#55, sum#56, sum#57, count#58, max#59, sum#60] + +(55) Exchange +Input [19]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#48, sum#49, count#50, max#51, sum#52, sum#53, count#54, max#55, sum#56, sum#57, count#58, max#59, sum#60] +Arguments: hashpartitioning(ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, 5), ENSURE_REQUIREMENTS, [id=#61] + +(56) HashAggregate [codegen id : 22] +Input [19]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33, count#48, sum#49, count#50, max#51, sum#52, sum#53, count#54, max#55, sum#56, sum#57, count#58, max#59, sum#60] +Keys [6]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cd_dep_employed_count#32, cd_dep_college_count#33] +Functions [10]: [count(1), avg(cd_dep_count#31), max(cd_dep_count#31), sum(cd_dep_count#31), avg(cd_dep_employed_count#32), max(cd_dep_employed_count#32), sum(cd_dep_employed_count#32), avg(cd_dep_college_count#33), max(cd_dep_college_count#33), sum(cd_dep_college_count#33)] +Aggregate Attributes [10]: [count(1)#62, avg(cd_dep_count#31)#63, max(cd_dep_count#31)#64, sum(cd_dep_count#31)#65, avg(cd_dep_employed_count#32)#66, max(cd_dep_employed_count#32)#67, sum(cd_dep_employed_count#32)#68, avg(cd_dep_college_count#33)#69, max(cd_dep_college_count#33)#70, sum(cd_dep_college_count#33)#71] +Results [18]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, count(1)#62 AS cnt1#72, avg(cd_dep_count#31)#63 AS avg(cd_dep_count)#73, max(cd_dep_count#31)#64 AS max(cd_dep_count)#74, sum(cd_dep_count#31)#65 AS sum(cd_dep_count)#75, cd_dep_employed_count#32, count(1)#62 AS cnt2#76, avg(cd_dep_employed_count#32)#66 AS avg(cd_dep_employed_count)#77, max(cd_dep_employed_count#32)#67 AS max(cd_dep_employed_count)#78, sum(cd_dep_employed_count#32)#68 AS sum(cd_dep_employed_count)#79, cd_dep_college_count#33, count(1)#62 AS cnt3#80, avg(cd_dep_college_count#33)#69 AS avg(cd_dep_college_count)#81, max(cd_dep_college_count#33)#70 AS max(cd_dep_college_count)#82, sum(cd_dep_college_count#33)#71 AS sum(cd_dep_college_count)#83] + +(57) TakeOrderedAndProject +Input [18]: [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cnt1#72, avg(cd_dep_count)#73, max(cd_dep_count)#74, sum(cd_dep_count)#75, cd_dep_employed_count#32, cnt2#76, avg(cd_dep_employed_count)#77, max(cd_dep_employed_count)#78, sum(cd_dep_employed_count)#79, cd_dep_college_count#33, cnt3#80, avg(cd_dep_college_count)#81, max(cd_dep_college_count)#82, sum(cd_dep_college_count)#83] +Arguments: 100, [ca_state#25 ASC NULLS FIRST, cd_gender#29 ASC NULLS FIRST, cd_marital_status#30 ASC NULLS FIRST, cd_dep_count#31 ASC NULLS FIRST, cd_dep_employed_count#32 ASC NULLS FIRST, cd_dep_college_count#33 ASC NULLS FIRST], [ca_state#25, cd_gender#29, cd_marital_status#30, cd_dep_count#31, cnt1#72, avg(cd_dep_count)#73, max(cd_dep_count)#74, sum(cd_dep_count)#75, cd_dep_employed_count#32, cnt2#76, avg(cd_dep_employed_count)#77, max(cd_dep_employed_count)#78, sum(cd_dep_employed_count)#79, cd_dep_college_count#33, cnt3#80, avg(cd_dep_college_count)#81, max(cd_dep_college_count)#82, sum(cd_dep_college_count)#83] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (58) + + +(58) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#10] + +Subquery:2 Hosting operator id = 18 Hosting Expression = ws_sold_date_sk#16 IN dynamicpruning#9 + +Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#20 IN dynamicpruning#9 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/simplified.txt new file mode 100644 index 0000000000000..6dc49f8dce3e5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35.sf100/simplified.txt @@ -0,0 +1,107 @@ +TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count)] + WholeStageCodegen (22) + HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] [count(1),avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count),cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count),count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] + InputAdapter + Exchange [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 + WholeStageCodegen (21) + HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] + Project [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (18) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #2 + WholeStageCodegen (17) + Project [c_current_cdemo_sk,ca_state] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (14) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #3 + WholeStageCodegen (13) + Project [c_current_cdemo_sk,c_current_addr_sk] + Filter [exists,exists] + InputAdapter + SortMergeJoin [c_customer_sk,cs_ship_customer_sk] + SortMergeJoin [c_customer_sk,ws_bill_customer_sk] + WholeStageCodegen (6) + SortMergeJoin [c_customer_sk,ss_customer_sk] + InputAdapter + WholeStageCodegen (2) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #4 + WholeStageCodegen (1) + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (5) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #5 + WholeStageCodegen (4) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_qoy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + WholeStageCodegen (9) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #7 + WholeStageCodegen (8) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #6 + WholeStageCodegen (12) + Sort [cs_ship_customer_sk] + InputAdapter + Exchange [cs_ship_customer_sk] #8 + WholeStageCodegen (11) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #6 + InputAdapter + WholeStageCodegen (16) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #9 + WholeStageCodegen (15) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + WholeStageCodegen (20) + Sort [cd_demo_sk] + InputAdapter + Exchange [cd_demo_sk] #10 + WholeStageCodegen (19) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35/explain.txt new file mode 100644 index 0000000000000..642bf989159d3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35/explain.txt @@ -0,0 +1,273 @@ +== Physical Plan == +TakeOrderedAndProject (46) ++- * HashAggregate (45) + +- Exchange (44) + +- * HashAggregate (43) + +- * Project (42) + +- * BroadcastHashJoin Inner BuildRight (41) + :- * Project (36) + : +- * BroadcastHashJoin Inner BuildRight (35) + : :- * Project (30) + : : +- * Filter (29) + : : +- * BroadcastHashJoin ExistenceJoin(exists#1) BuildRight (28) + : : :- * BroadcastHashJoin ExistenceJoin(exists#2) BuildRight (21) + : : : :- * BroadcastHashJoin LeftSemi BuildRight (14) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (13) + : : : : +- * Project (12) + : : : : +- * BroadcastHashJoin Inner BuildRight (11) + : : : : :- * ColumnarToRow (5) + : : : : : +- Scan parquet default.store_sales (4) + : : : : +- BroadcastExchange (10) + : : : : +- * Project (9) + : : : : +- * Filter (8) + : : : : +- * ColumnarToRow (7) + : : : : +- Scan parquet default.date_dim (6) + : : : +- BroadcastExchange (20) + : : : +- * Project (19) + : : : +- * BroadcastHashJoin Inner BuildRight (18) + : : : :- * ColumnarToRow (16) + : : : : +- Scan parquet default.web_sales (15) + : : : +- ReusedExchange (17) + : : +- BroadcastExchange (27) + : : +- * Project (26) + : : +- * BroadcastHashJoin Inner BuildRight (25) + : : :- * ColumnarToRow (23) + : : : +- Scan parquet default.catalog_sales (22) + : : +- ReusedExchange (24) + : +- BroadcastExchange (34) + : +- * Filter (33) + : +- * ColumnarToRow (32) + : +- Scan parquet default.customer_address (31) + +- BroadcastExchange (40) + +- * Filter (39) + +- * ColumnarToRow (38) + +- Scan parquet default.customer_demographics (37) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] + +(3) Filter [codegen id : 9] +Input [3]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5] +Condition : (isnotnull(c_current_addr_sk#5) AND isnotnull(c_current_cdemo_sk#4)) + +(4) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 2] +Input [2]: [ss_customer_sk#6, ss_sold_date_sk#7] + +(6) Scan parquet default.date_dim +Output [3]: [d_date_sk#9, d_year#10, d_qoy#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,2002), LessThan(d_qoy,4), IsNotNull(d_date_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] + +(8) Filter [codegen id : 1] +Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] +Condition : ((((isnotnull(d_year#10) AND isnotnull(d_qoy#11)) AND (d_year#10 = 2002)) AND (d_qoy#11 < 4)) AND isnotnull(d_date_sk#9)) + +(9) Project [codegen id : 1] +Output [1]: [d_date_sk#9] +Input [3]: [d_date_sk#9, d_year#10, d_qoy#11] + +(10) BroadcastExchange +Input [1]: [d_date_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(11) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#9] +Join condition: None + +(12) Project [codegen id : 2] +Output [1]: [ss_customer_sk#6] +Input [3]: [ss_customer_sk#6, ss_sold_date_sk#7, d_date_sk#9] + +(13) BroadcastExchange +Input [1]: [ss_customer_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(14) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ss_customer_sk#6] +Join condition: None + +(15) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#14, ws_sold_date_sk#15] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#15), dynamicpruningexpression(ws_sold_date_sk#15 IN dynamicpruning#8)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 4] +Input [2]: [ws_bill_customer_sk#14, ws_sold_date_sk#15] + +(17) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#16] + +(18) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_sold_date_sk#15] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(19) Project [codegen id : 4] +Output [1]: [ws_bill_customer_sk#14] +Input [3]: [ws_bill_customer_sk#14, ws_sold_date_sk#15, d_date_sk#16] + +(20) BroadcastExchange +Input [1]: [ws_bill_customer_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(21) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ws_bill_customer_sk#14] +Join condition: None + +(22) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#18, cs_sold_date_sk#19] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#19), dynamicpruningexpression(cs_sold_date_sk#19 IN dynamicpruning#8)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 6] +Input [2]: [cs_ship_customer_sk#18, cs_sold_date_sk#19] + +(24) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#20] + +(25) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#19] +Right keys [1]: [d_date_sk#20] +Join condition: None + +(26) Project [codegen id : 6] +Output [1]: [cs_ship_customer_sk#18] +Input [3]: [cs_ship_customer_sk#18, cs_sold_date_sk#19, d_date_sk#20] + +(27) BroadcastExchange +Input [1]: [cs_ship_customer_sk#18] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(28) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [cs_ship_customer_sk#18] +Join condition: None + +(29) Filter [codegen id : 9] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] +Condition : (exists#2 OR exists#1) + +(30) Project [codegen id : 9] +Output [2]: [c_current_cdemo_sk#4, c_current_addr_sk#5] +Input [5]: [c_customer_sk#3, c_current_cdemo_sk#4, c_current_addr_sk#5, exists#2, exists#1] + +(31) Scan parquet default.customer_address +Output [2]: [ca_address_sk#22, ca_state#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(32) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#22, ca_state#23] + +(33) Filter [codegen id : 7] +Input [2]: [ca_address_sk#22, ca_state#23] +Condition : isnotnull(ca_address_sk#22) + +(34) BroadcastExchange +Input [2]: [ca_address_sk#22, ca_state#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(35) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_addr_sk#5] +Right keys [1]: [ca_address_sk#22] +Join condition: None + +(36) Project [codegen id : 9] +Output [2]: [c_current_cdemo_sk#4, ca_state#23] +Input [4]: [c_current_cdemo_sk#4, c_current_addr_sk#5, ca_address_sk#22, ca_state#23] + +(37) Scan parquet default.customer_demographics +Output [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(38) ColumnarToRow [codegen id : 8] +Input [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] + +(39) Filter [codegen id : 8] +Input [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Condition : isnotnull(cd_demo_sk#25) + +(40) BroadcastExchange +Input [6]: [cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#31] + +(41) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_cdemo_sk#4] +Right keys [1]: [cd_demo_sk#25] +Join condition: None + +(42) Project [codegen id : 9] +Output [6]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Input [8]: [c_current_cdemo_sk#4, ca_state#23, cd_demo_sk#25, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] + +(43) HashAggregate [codegen id : 9] +Input [6]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Keys [6]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Functions [10]: [partial_count(1), partial_avg(cd_dep_count#28), partial_max(cd_dep_count#28), partial_sum(cd_dep_count#28), partial_avg(cd_dep_employed_count#29), partial_max(cd_dep_employed_count#29), partial_sum(cd_dep_employed_count#29), partial_avg(cd_dep_college_count#30), partial_max(cd_dep_college_count#30), partial_sum(cd_dep_college_count#30)] +Aggregate Attributes [13]: [count#32, sum#33, count#34, max#35, sum#36, sum#37, count#38, max#39, sum#40, sum#41, count#42, max#43, sum#44] +Results [19]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] + +(44) Exchange +Input [19]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] +Arguments: hashpartitioning(ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, 5), ENSURE_REQUIREMENTS, [id=#58] + +(45) HashAggregate [codegen id : 10] +Input [19]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30, count#45, sum#46, count#47, max#48, sum#49, sum#50, count#51, max#52, sum#53, sum#54, count#55, max#56, sum#57] +Keys [6]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cd_dep_employed_count#29, cd_dep_college_count#30] +Functions [10]: [count(1), avg(cd_dep_count#28), max(cd_dep_count#28), sum(cd_dep_count#28), avg(cd_dep_employed_count#29), max(cd_dep_employed_count#29), sum(cd_dep_employed_count#29), avg(cd_dep_college_count#30), max(cd_dep_college_count#30), sum(cd_dep_college_count#30)] +Aggregate Attributes [10]: [count(1)#59, avg(cd_dep_count#28)#60, max(cd_dep_count#28)#61, sum(cd_dep_count#28)#62, avg(cd_dep_employed_count#29)#63, max(cd_dep_employed_count#29)#64, sum(cd_dep_employed_count#29)#65, avg(cd_dep_college_count#30)#66, max(cd_dep_college_count#30)#67, sum(cd_dep_college_count#30)#68] +Results [18]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, count(1)#59 AS cnt1#69, avg(cd_dep_count#28)#60 AS avg(cd_dep_count)#70, max(cd_dep_count#28)#61 AS max(cd_dep_count)#71, sum(cd_dep_count#28)#62 AS sum(cd_dep_count)#72, cd_dep_employed_count#29, count(1)#59 AS cnt2#73, avg(cd_dep_employed_count#29)#63 AS avg(cd_dep_employed_count)#74, max(cd_dep_employed_count#29)#64 AS max(cd_dep_employed_count)#75, sum(cd_dep_employed_count#29)#65 AS sum(cd_dep_employed_count)#76, cd_dep_college_count#30, count(1)#59 AS cnt3#77, avg(cd_dep_college_count#30)#66 AS avg(cd_dep_college_count)#78, max(cd_dep_college_count#30)#67 AS max(cd_dep_college_count)#79, sum(cd_dep_college_count#30)#68 AS sum(cd_dep_college_count)#80] + +(46) TakeOrderedAndProject +Input [18]: [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cnt1#69, avg(cd_dep_count)#70, max(cd_dep_count)#71, sum(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, avg(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, sum(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, avg(cd_dep_college_count)#78, max(cd_dep_college_count)#79, sum(cd_dep_college_count)#80] +Arguments: 100, [ca_state#23 ASC NULLS FIRST, cd_gender#26 ASC NULLS FIRST, cd_marital_status#27 ASC NULLS FIRST, cd_dep_count#28 ASC NULLS FIRST, cd_dep_employed_count#29 ASC NULLS FIRST, cd_dep_college_count#30 ASC NULLS FIRST], [ca_state#23, cd_gender#26, cd_marital_status#27, cd_dep_count#28, cnt1#69, avg(cd_dep_count)#70, max(cd_dep_count)#71, sum(cd_dep_count)#72, cd_dep_employed_count#29, cnt2#73, avg(cd_dep_employed_count)#74, max(cd_dep_employed_count)#75, sum(cd_dep_employed_count)#76, cd_dep_college_count#30, cnt3#77, avg(cd_dep_college_count)#78, max(cd_dep_college_count)#79, sum(cd_dep_college_count)#80] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (47) + + +(47) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#9] + +Subquery:2 Hosting operator id = 15 Hosting Expression = ws_sold_date_sk#15 IN dynamicpruning#8 + +Subquery:3 Hosting operator id = 22 Hosting Expression = cs_sold_date_sk#19 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35/simplified.txt new file mode 100644 index 0000000000000..c6c9e1da58c26 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35/simplified.txt @@ -0,0 +1,74 @@ +TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count)] + WholeStageCodegen (10) + HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] [count(1),avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count),cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count),count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] + InputAdapter + Exchange [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 + WholeStageCodegen (9) + HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] + Project [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [c_current_cdemo_sk,ca_state] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + Filter [exists,exists] + BroadcastHashJoin [c_customer_sk,cs_ship_customer_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_qoy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (6) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (8) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/explain.txt new file mode 100644 index 0000000000000..8e71d6c5c0965 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/explain.txt @@ -0,0 +1,310 @@ +== Physical Plan == +TakeOrderedAndProject (54) ++- * HashAggregate (53) + +- Exchange (52) + +- * HashAggregate (51) + +- * Project (50) + +- * SortMergeJoin Inner (49) + :- * Sort (43) + : +- Exchange (42) + : +- * Project (41) + : +- * SortMergeJoin Inner (40) + : :- * Sort (34) + : : +- Exchange (33) + : : +- * Project (32) + : : +- * SortMergeJoin LeftSemi (31) + : : :- * SortMergeJoin LeftSemi (17) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer (1) + : : : +- * Sort (16) + : : : +- Exchange (15) + : : : +- * Project (14) + : : : +- * BroadcastHashJoin Inner BuildRight (13) + : : : :- * ColumnarToRow (7) + : : : : +- Scan parquet default.store_sales (6) + : : : +- BroadcastExchange (12) + : : : +- * Project (11) + : : : +- * Filter (10) + : : : +- * ColumnarToRow (9) + : : : +- Scan parquet default.date_dim (8) + : : +- * Sort (30) + : : +- Exchange (29) + : : +- Union (28) + : : :- * Project (22) + : : : +- * BroadcastHashJoin Inner BuildRight (21) + : : : :- * ColumnarToRow (19) + : : : : +- Scan parquet default.web_sales (18) + : : : +- ReusedExchange (20) + : : +- * Project (27) + : : +- * BroadcastHashJoin Inner BuildRight (26) + : : :- * ColumnarToRow (24) + : : : +- Scan parquet default.catalog_sales (23) + : : +- ReusedExchange (25) + : +- * Sort (39) + : +- Exchange (38) + : +- * Filter (37) + : +- * ColumnarToRow (36) + : +- Scan parquet default.customer_address (35) + +- * Sort (48) + +- Exchange (47) + +- * Filter (46) + +- * ColumnarToRow (45) + +- Scan parquet default.customer_demographics (44) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(3) Filter [codegen id : 1] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Condition : (isnotnull(c_current_addr_sk#3) AND isnotnull(c_current_cdemo_sk#2)) + +(4) Exchange +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: hashpartitioning(c_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#4] + +(5) Sort [codegen id : 2] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: [c_customer_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#5, ss_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#6), dynamicpruningexpression(ss_sold_date_sk#6 IN dynamicpruning#7)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 4] +Input [2]: [ss_customer_sk#5, ss_sold_date_sk#6] + +(8) Scan parquet default.date_dim +Output [3]: [d_date_sk#8, d_year#9, d_qoy#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,1999), LessThan(d_qoy,4), IsNotNull(d_date_sk)] +ReadSchema: struct + +(9) ColumnarToRow [codegen id : 3] +Input [3]: [d_date_sk#8, d_year#9, d_qoy#10] + +(10) Filter [codegen id : 3] +Input [3]: [d_date_sk#8, d_year#9, d_qoy#10] +Condition : ((((isnotnull(d_year#9) AND isnotnull(d_qoy#10)) AND (d_year#9 = 1999)) AND (d_qoy#10 < 4)) AND isnotnull(d_date_sk#8)) + +(11) Project [codegen id : 3] +Output [1]: [d_date_sk#8] +Input [3]: [d_date_sk#8, d_year#9, d_qoy#10] + +(12) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(13) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(14) Project [codegen id : 4] +Output [1]: [ss_customer_sk#5] +Input [3]: [ss_customer_sk#5, ss_sold_date_sk#6, d_date_sk#8] + +(15) Exchange +Input [1]: [ss_customer_sk#5] +Arguments: hashpartitioning(ss_customer_sk#5, 5), ENSURE_REQUIREMENTS, [id=#12] + +(16) Sort [codegen id : 5] +Input [1]: [ss_customer_sk#5] +Arguments: [ss_customer_sk#5 ASC NULLS FIRST], false, 0 + +(17) SortMergeJoin [codegen id : 6] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#5] +Join condition: None + +(18) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#13, ws_sold_date_sk#14] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#14), dynamicpruningexpression(ws_sold_date_sk#14 IN dynamicpruning#7)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 8] +Input [2]: [ws_bill_customer_sk#13, ws_sold_date_sk#14] + +(20) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#15] + +(21) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [ws_sold_date_sk#14] +Right keys [1]: [d_date_sk#15] +Join condition: None + +(22) Project [codegen id : 8] +Output [1]: [ws_bill_customer_sk#13 AS customsk#16] +Input [3]: [ws_bill_customer_sk#13, ws_sold_date_sk#14, d_date_sk#15] + +(23) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#17, cs_sold_date_sk#18] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#18), dynamicpruningexpression(cs_sold_date_sk#18 IN dynamicpruning#7)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 10] +Input [2]: [cs_ship_customer_sk#17, cs_sold_date_sk#18] + +(25) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#19] + +(26) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#18] +Right keys [1]: [d_date_sk#19] +Join condition: None + +(27) Project [codegen id : 10] +Output [1]: [cs_ship_customer_sk#17 AS customsk#20] +Input [3]: [cs_ship_customer_sk#17, cs_sold_date_sk#18, d_date_sk#19] + +(28) Union + +(29) Exchange +Input [1]: [customsk#16] +Arguments: hashpartitioning(customsk#16, 5), ENSURE_REQUIREMENTS, [id=#21] + +(30) Sort [codegen id : 11] +Input [1]: [customsk#16] +Arguments: [customsk#16 ASC NULLS FIRST], false, 0 + +(31) SortMergeJoin [codegen id : 12] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customsk#16] +Join condition: None + +(32) Project [codegen id : 12] +Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(33) Exchange +Input [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: hashpartitioning(c_current_addr_sk#3, 5), ENSURE_REQUIREMENTS, [id=#22] + +(34) Sort [codegen id : 13] +Input [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Arguments: [c_current_addr_sk#3 ASC NULLS FIRST], false, 0 + +(35) Scan parquet default.customer_address +Output [2]: [ca_address_sk#23, ca_state#24] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 14] +Input [2]: [ca_address_sk#23, ca_state#24] + +(37) Filter [codegen id : 14] +Input [2]: [ca_address_sk#23, ca_state#24] +Condition : isnotnull(ca_address_sk#23) + +(38) Exchange +Input [2]: [ca_address_sk#23, ca_state#24] +Arguments: hashpartitioning(ca_address_sk#23, 5), ENSURE_REQUIREMENTS, [id=#25] + +(39) Sort [codegen id : 15] +Input [2]: [ca_address_sk#23, ca_state#24] +Arguments: [ca_address_sk#23 ASC NULLS FIRST], false, 0 + +(40) SortMergeJoin [codegen id : 16] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#23] +Join condition: None + +(41) Project [codegen id : 16] +Output [2]: [c_current_cdemo_sk#2, ca_state#24] +Input [4]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#23, ca_state#24] + +(42) Exchange +Input [2]: [c_current_cdemo_sk#2, ca_state#24] +Arguments: hashpartitioning(c_current_cdemo_sk#2, 5), ENSURE_REQUIREMENTS, [id=#26] + +(43) Sort [codegen id : 17] +Input [2]: [c_current_cdemo_sk#2, ca_state#24] +Arguments: [c_current_cdemo_sk#2 ASC NULLS FIRST], false, 0 + +(44) Scan parquet default.customer_demographics +Output [6]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(45) ColumnarToRow [codegen id : 18] +Input [6]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] + +(46) Filter [codegen id : 18] +Input [6]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Condition : isnotnull(cd_demo_sk#27) + +(47) Exchange +Input [6]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Arguments: hashpartitioning(cd_demo_sk#27, 5), ENSURE_REQUIREMENTS, [id=#33] + +(48) Sort [codegen id : 19] +Input [6]: [cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Arguments: [cd_demo_sk#27 ASC NULLS FIRST], false, 0 + +(49) SortMergeJoin [codegen id : 20] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#27] +Join condition: None + +(50) Project [codegen id : 20] +Output [6]: [ca_state#24, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Input [8]: [c_current_cdemo_sk#2, ca_state#24, cd_demo_sk#27, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] + +(51) HashAggregate [codegen id : 20] +Input [6]: [ca_state#24, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Keys [6]: [ca_state#24, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Functions [10]: [partial_count(1), partial_avg(cd_dep_count#30), partial_max(cd_dep_count#30), partial_sum(cd_dep_count#30), partial_avg(cd_dep_employed_count#31), partial_max(cd_dep_employed_count#31), partial_sum(cd_dep_employed_count#31), partial_avg(cd_dep_college_count#32), partial_max(cd_dep_college_count#32), partial_sum(cd_dep_college_count#32)] +Aggregate Attributes [13]: [count#34, sum#35, count#36, max#37, sum#38, sum#39, count#40, max#41, sum#42, sum#43, count#44, max#45, sum#46] +Results [19]: [ca_state#24, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, count#47, sum#48, count#49, max#50, sum#51, sum#52, count#53, max#54, sum#55, sum#56, count#57, max#58, sum#59] + +(52) Exchange +Input [19]: [ca_state#24, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, count#47, sum#48, count#49, max#50, sum#51, sum#52, count#53, max#54, sum#55, sum#56, count#57, max#58, sum#59] +Arguments: hashpartitioning(ca_state#24, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, 5), ENSURE_REQUIREMENTS, [id=#60] + +(53) HashAggregate [codegen id : 21] +Input [19]: [ca_state#24, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32, count#47, sum#48, count#49, max#50, sum#51, sum#52, count#53, max#54, sum#55, sum#56, count#57, max#58, sum#59] +Keys [6]: [ca_state#24, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cd_dep_employed_count#31, cd_dep_college_count#32] +Functions [10]: [count(1), avg(cd_dep_count#30), max(cd_dep_count#30), sum(cd_dep_count#30), avg(cd_dep_employed_count#31), max(cd_dep_employed_count#31), sum(cd_dep_employed_count#31), avg(cd_dep_college_count#32), max(cd_dep_college_count#32), sum(cd_dep_college_count#32)] +Aggregate Attributes [10]: [count(1)#61, avg(cd_dep_count#30)#62, max(cd_dep_count#30)#63, sum(cd_dep_count#30)#64, avg(cd_dep_employed_count#31)#65, max(cd_dep_employed_count#31)#66, sum(cd_dep_employed_count#31)#67, avg(cd_dep_college_count#32)#68, max(cd_dep_college_count#32)#69, sum(cd_dep_college_count#32)#70] +Results [18]: [ca_state#24, cd_gender#28, cd_marital_status#29, cd_dep_count#30, count(1)#61 AS cnt1#71, avg(cd_dep_count#30)#62 AS avg(cd_dep_count)#72, max(cd_dep_count#30)#63 AS max(cd_dep_count)#73, sum(cd_dep_count#30)#64 AS sum(cd_dep_count)#74, cd_dep_employed_count#31, count(1)#61 AS cnt2#75, avg(cd_dep_employed_count#31)#65 AS avg(cd_dep_employed_count)#76, max(cd_dep_employed_count#31)#66 AS max(cd_dep_employed_count)#77, sum(cd_dep_employed_count#31)#67 AS sum(cd_dep_employed_count)#78, cd_dep_college_count#32, count(1)#61 AS cnt3#79, avg(cd_dep_college_count#32)#68 AS avg(cd_dep_college_count)#80, max(cd_dep_college_count#32)#69 AS max(cd_dep_college_count)#81, sum(cd_dep_college_count#32)#70 AS sum(cd_dep_college_count)#82] + +(54) TakeOrderedAndProject +Input [18]: [ca_state#24, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cnt1#71, avg(cd_dep_count)#72, max(cd_dep_count)#73, sum(cd_dep_count)#74, cd_dep_employed_count#31, cnt2#75, avg(cd_dep_employed_count)#76, max(cd_dep_employed_count)#77, sum(cd_dep_employed_count)#78, cd_dep_college_count#32, cnt3#79, avg(cd_dep_college_count)#80, max(cd_dep_college_count)#81, sum(cd_dep_college_count)#82] +Arguments: 100, [ca_state#24 ASC NULLS FIRST, cd_gender#28 ASC NULLS FIRST, cd_marital_status#29 ASC NULLS FIRST, cd_dep_count#30 ASC NULLS FIRST, cd_dep_employed_count#31 ASC NULLS FIRST, cd_dep_college_count#32 ASC NULLS FIRST], [ca_state#24, cd_gender#28, cd_marital_status#29, cd_dep_count#30, cnt1#71, avg(cd_dep_count)#72, max(cd_dep_count)#73, sum(cd_dep_count)#74, cd_dep_employed_count#31, cnt2#75, avg(cd_dep_employed_count)#76, max(cd_dep_employed_count)#77, sum(cd_dep_employed_count)#78, cd_dep_college_count#32, cnt3#79, avg(cd_dep_college_count)#80, max(cd_dep_college_count)#81, sum(cd_dep_college_count)#82] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 6 Hosting Expression = ss_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (55) + + +(55) ReusedExchange [Reuses operator id: 12] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 18 Hosting Expression = ws_sold_date_sk#14 IN dynamicpruning#7 + +Subquery:3 Hosting operator id = 23 Hosting Expression = cs_sold_date_sk#18 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/simplified.txt new file mode 100644 index 0000000000000..840b465af0747 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a.sf100/simplified.txt @@ -0,0 +1,103 @@ +TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count)] + WholeStageCodegen (21) + HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] [count(1),avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count),cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count),count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] + InputAdapter + Exchange [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 + WholeStageCodegen (20) + HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] + Project [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (17) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #2 + WholeStageCodegen (16) + Project [c_current_cdemo_sk,ca_state] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (13) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #3 + WholeStageCodegen (12) + Project [c_current_cdemo_sk,c_current_addr_sk] + SortMergeJoin [c_customer_sk,customsk] + InputAdapter + WholeStageCodegen (6) + SortMergeJoin [c_customer_sk,ss_customer_sk] + InputAdapter + WholeStageCodegen (2) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #4 + WholeStageCodegen (1) + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (5) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #5 + WholeStageCodegen (4) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_year,d_qoy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + WholeStageCodegen (11) + Sort [customsk] + InputAdapter + Exchange [customsk] #7 + Union + WholeStageCodegen (8) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #6 + WholeStageCodegen (10) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #6 + InputAdapter + WholeStageCodegen (15) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #8 + WholeStageCodegen (14) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + WholeStageCodegen (19) + Sort [cd_demo_sk] + InputAdapter + Exchange [cd_demo_sk] #9 + WholeStageCodegen (18) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/explain.txt new file mode 100644 index 0000000000000..57710f427f0f8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/explain.txt @@ -0,0 +1,260 @@ +== Physical Plan == +TakeOrderedAndProject (44) ++- * HashAggregate (43) + +- Exchange (42) + +- * HashAggregate (41) + +- * Project (40) + +- * BroadcastHashJoin Inner BuildRight (39) + :- * Project (34) + : +- * BroadcastHashJoin Inner BuildRight (33) + : :- * Project (28) + : : +- * BroadcastHashJoin LeftSemi BuildRight (27) + : : :- * BroadcastHashJoin LeftSemi BuildRight (14) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer (1) + : : : +- BroadcastExchange (13) + : : : +- * Project (12) + : : : +- * BroadcastHashJoin Inner BuildRight (11) + : : : :- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (10) + : : : +- * Project (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.date_dim (6) + : : +- BroadcastExchange (26) + : : +- Union (25) + : : :- * Project (19) + : : : +- * BroadcastHashJoin Inner BuildRight (18) + : : : :- * ColumnarToRow (16) + : : : : +- Scan parquet default.web_sales (15) + : : : +- ReusedExchange (17) + : : +- * Project (24) + : : +- * BroadcastHashJoin Inner BuildRight (23) + : : :- * ColumnarToRow (21) + : : : +- Scan parquet default.catalog_sales (20) + : : +- ReusedExchange (22) + : +- BroadcastExchange (32) + : +- * Filter (31) + : +- * ColumnarToRow (30) + : +- Scan parquet default.customer_address (29) + +- BroadcastExchange (38) + +- * Filter (37) + +- * ColumnarToRow (36) + +- Scan parquet default.customer_demographics (35) + + +(1) Scan parquet default.customer +Output [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_current_cdemo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(3) Filter [codegen id : 9] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] +Condition : (isnotnull(c_current_addr_sk#3) AND isnotnull(c_current_cdemo_sk#2)) + +(4) Scan parquet default.store_sales +Output [2]: [ss_customer_sk#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 2] +Input [2]: [ss_customer_sk#4, ss_sold_date_sk#5] + +(6) Scan parquet default.date_dim +Output [3]: [d_date_sk#7, d_year#8, d_qoy#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_qoy), EqualTo(d_year,1999), LessThan(d_qoy,4), IsNotNull(d_date_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_qoy#9] + +(8) Filter [codegen id : 1] +Input [3]: [d_date_sk#7, d_year#8, d_qoy#9] +Condition : ((((isnotnull(d_year#8) AND isnotnull(d_qoy#9)) AND (d_year#8 = 1999)) AND (d_qoy#9 < 4)) AND isnotnull(d_date_sk#7)) + +(9) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [3]: [d_date_sk#7, d_year#8, d_qoy#9] + +(10) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#10] + +(11) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(12) Project [codegen id : 2] +Output [1]: [ss_customer_sk#4] +Input [3]: [ss_customer_sk#4, ss_sold_date_sk#5, d_date_sk#7] + +(13) BroadcastExchange +Input [1]: [ss_customer_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(14) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#4] +Join condition: None + +(15) Scan parquet default.web_sales +Output [2]: [ws_bill_customer_sk#12, ws_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#13), dynamicpruningexpression(ws_sold_date_sk#13 IN dynamicpruning#6)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 4] +Input [2]: [ws_bill_customer_sk#12, ws_sold_date_sk#13] + +(17) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#14] + +(18) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ws_sold_date_sk#13] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(19) Project [codegen id : 4] +Output [1]: [ws_bill_customer_sk#12 AS customsk#15] +Input [3]: [ws_bill_customer_sk#12, ws_sold_date_sk#13, d_date_sk#14] + +(20) Scan parquet default.catalog_sales +Output [2]: [cs_ship_customer_sk#16, cs_sold_date_sk#17] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#17), dynamicpruningexpression(cs_sold_date_sk#17 IN dynamicpruning#6)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [2]: [cs_ship_customer_sk#16, cs_sold_date_sk#17] + +(22) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#18] + +(23) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [cs_sold_date_sk#17] +Right keys [1]: [d_date_sk#18] +Join condition: None + +(24) Project [codegen id : 6] +Output [1]: [cs_ship_customer_sk#16 AS customsk#19] +Input [3]: [cs_ship_customer_sk#16, cs_sold_date_sk#17, d_date_sk#18] + +(25) Union + +(26) BroadcastExchange +Input [1]: [customsk#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#20] + +(27) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [customsk#15] +Join condition: None + +(28) Project [codegen id : 9] +Output [2]: [c_current_cdemo_sk#2, c_current_addr_sk#3] +Input [3]: [c_customer_sk#1, c_current_cdemo_sk#2, c_current_addr_sk#3] + +(29) Scan parquet default.customer_address +Output [2]: [ca_address_sk#21, ca_state#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#21, ca_state#22] + +(31) Filter [codegen id : 7] +Input [2]: [ca_address_sk#21, ca_state#22] +Condition : isnotnull(ca_address_sk#21) + +(32) BroadcastExchange +Input [2]: [ca_address_sk#21, ca_state#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#23] + +(33) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_addr_sk#3] +Right keys [1]: [ca_address_sk#21] +Join condition: None + +(34) Project [codegen id : 9] +Output [2]: [c_current_cdemo_sk#2, ca_state#22] +Input [4]: [c_current_cdemo_sk#2, c_current_addr_sk#3, ca_address_sk#21, ca_state#22] + +(35) Scan parquet default.customer_demographics +Output [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 8] +Input [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] + +(37) Filter [codegen id : 8] +Input [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Condition : isnotnull(cd_demo_sk#24) + +(38) BroadcastExchange +Input [6]: [cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#30] + +(39) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [c_current_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#24] +Join condition: None + +(40) Project [codegen id : 9] +Output [6]: [ca_state#22, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Input [8]: [c_current_cdemo_sk#2, ca_state#22, cd_demo_sk#24, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] + +(41) HashAggregate [codegen id : 9] +Input [6]: [ca_state#22, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Keys [6]: [ca_state#22, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Functions [10]: [partial_count(1), partial_avg(cd_dep_count#27), partial_max(cd_dep_count#27), partial_sum(cd_dep_count#27), partial_avg(cd_dep_employed_count#28), partial_max(cd_dep_employed_count#28), partial_sum(cd_dep_employed_count#28), partial_avg(cd_dep_college_count#29), partial_max(cd_dep_college_count#29), partial_sum(cd_dep_college_count#29)] +Aggregate Attributes [13]: [count#31, sum#32, count#33, max#34, sum#35, sum#36, count#37, max#38, sum#39, sum#40, count#41, max#42, sum#43] +Results [19]: [ca_state#22, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#44, sum#45, count#46, max#47, sum#48, sum#49, count#50, max#51, sum#52, sum#53, count#54, max#55, sum#56] + +(42) Exchange +Input [19]: [ca_state#22, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#44, sum#45, count#46, max#47, sum#48, sum#49, count#50, max#51, sum#52, sum#53, count#54, max#55, sum#56] +Arguments: hashpartitioning(ca_state#22, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, 5), ENSURE_REQUIREMENTS, [id=#57] + +(43) HashAggregate [codegen id : 10] +Input [19]: [ca_state#22, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29, count#44, sum#45, count#46, max#47, sum#48, sum#49, count#50, max#51, sum#52, sum#53, count#54, max#55, sum#56] +Keys [6]: [ca_state#22, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cd_dep_employed_count#28, cd_dep_college_count#29] +Functions [10]: [count(1), avg(cd_dep_count#27), max(cd_dep_count#27), sum(cd_dep_count#27), avg(cd_dep_employed_count#28), max(cd_dep_employed_count#28), sum(cd_dep_employed_count#28), avg(cd_dep_college_count#29), max(cd_dep_college_count#29), sum(cd_dep_college_count#29)] +Aggregate Attributes [10]: [count(1)#58, avg(cd_dep_count#27)#59, max(cd_dep_count#27)#60, sum(cd_dep_count#27)#61, avg(cd_dep_employed_count#28)#62, max(cd_dep_employed_count#28)#63, sum(cd_dep_employed_count#28)#64, avg(cd_dep_college_count#29)#65, max(cd_dep_college_count#29)#66, sum(cd_dep_college_count#29)#67] +Results [18]: [ca_state#22, cd_gender#25, cd_marital_status#26, cd_dep_count#27, count(1)#58 AS cnt1#68, avg(cd_dep_count#27)#59 AS avg(cd_dep_count)#69, max(cd_dep_count#27)#60 AS max(cd_dep_count)#70, sum(cd_dep_count#27)#61 AS sum(cd_dep_count)#71, cd_dep_employed_count#28, count(1)#58 AS cnt2#72, avg(cd_dep_employed_count#28)#62 AS avg(cd_dep_employed_count)#73, max(cd_dep_employed_count#28)#63 AS max(cd_dep_employed_count)#74, sum(cd_dep_employed_count#28)#64 AS sum(cd_dep_employed_count)#75, cd_dep_college_count#29, count(1)#58 AS cnt3#76, avg(cd_dep_college_count#29)#65 AS avg(cd_dep_college_count)#77, max(cd_dep_college_count#29)#66 AS max(cd_dep_college_count)#78, sum(cd_dep_college_count#29)#67 AS sum(cd_dep_college_count)#79] + +(44) TakeOrderedAndProject +Input [18]: [ca_state#22, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cnt1#68, avg(cd_dep_count)#69, max(cd_dep_count)#70, sum(cd_dep_count)#71, cd_dep_employed_count#28, cnt2#72, avg(cd_dep_employed_count)#73, max(cd_dep_employed_count)#74, sum(cd_dep_employed_count)#75, cd_dep_college_count#29, cnt3#76, avg(cd_dep_college_count)#77, max(cd_dep_college_count)#78, sum(cd_dep_college_count)#79] +Arguments: 100, [ca_state#22 ASC NULLS FIRST, cd_gender#25 ASC NULLS FIRST, cd_marital_status#26 ASC NULLS FIRST, cd_dep_count#27 ASC NULLS FIRST, cd_dep_employed_count#28 ASC NULLS FIRST, cd_dep_college_count#29 ASC NULLS FIRST], [ca_state#22, cd_gender#25, cd_marital_status#26, cd_dep_count#27, cnt1#68, avg(cd_dep_count)#69, max(cd_dep_count)#70, sum(cd_dep_count)#71, cd_dep_employed_count#28, cnt2#72, avg(cd_dep_employed_count)#73, max(cd_dep_employed_count)#74, sum(cd_dep_employed_count)#75, cd_dep_college_count#29, cnt3#76, avg(cd_dep_college_count)#77, max(cd_dep_college_count)#78, sum(cd_dep_college_count)#79] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (45) + + +(45) ReusedExchange [Reuses operator id: 10] +Output [1]: [d_date_sk#7] + +Subquery:2 Hosting operator id = 15 Hosting Expression = ws_sold_date_sk#13 IN dynamicpruning#6 + +Subquery:3 Hosting operator id = 20 Hosting Expression = cs_sold_date_sk#17 IN dynamicpruning#6 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/simplified.txt new file mode 100644 index 0000000000000..1ab7d548e59dd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q35a/simplified.txt @@ -0,0 +1,71 @@ +TakeOrderedAndProject [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count)] + WholeStageCodegen (10) + HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] [count(1),avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count),cnt1,avg(cd_dep_count),max(cd_dep_count),sum(cd_dep_count),cnt2,avg(cd_dep_employed_count),max(cd_dep_employed_count),sum(cd_dep_employed_count),cnt3,avg(cd_dep_college_count),max(cd_dep_college_count),sum(cd_dep_college_count),count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] + InputAdapter + Exchange [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] #1 + WholeStageCodegen (9) + HashAggregate [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] [count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum,count,sum,count,max,sum,sum,count,max,sum,sum,count,max,sum] + Project [ca_state,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk] + Project [c_current_cdemo_sk,ca_state] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [c_current_cdemo_sk,c_current_addr_sk] + BroadcastHashJoin [c_customer_sk,customsk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_current_addr_sk,c_current_cdemo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (2) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_qoy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_qoy] + InputAdapter + BroadcastExchange #4 + Union + WholeStageCodegen (4) + Project [ws_bill_customer_sk] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + WholeStageCodegen (6) + Project [cs_ship_customer_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_customer_sk,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (8) + Filter [cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_gender,cd_marital_status,cd_dep_count,cd_dep_employed_count,cd_dep_college_count] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/explain.txt new file mode 100644 index 0000000000000..79037befbd6b5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/explain.txt @@ -0,0 +1,276 @@ +== Physical Plan == +TakeOrderedAndProject (45) ++- * Project (44) + +- Window (43) + +- * Sort (42) + +- Exchange (41) + +- * HashAggregate (40) + +- Exchange (39) + +- * HashAggregate (38) + +- Union (37) + :- * HashAggregate (26) + : +- Exchange (25) + : +- * HashAggregate (24) + : +- * Project (23) + : +- * BroadcastHashJoin Inner BuildRight (22) + : :- * Project (17) + : : +- * BroadcastHashJoin Inner BuildRight (16) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (15) + : : +- * Project (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (21) + : +- * Filter (20) + : +- * ColumnarToRow (19) + : +- Scan parquet default.item (18) + :- * HashAggregate (31) + : +- Exchange (30) + : +- * HashAggregate (29) + : +- * HashAggregate (28) + : +- ReusedExchange (27) + +- * HashAggregate (36) + +- Exchange (35) + +- * HashAggregate (34) + +- * HashAggregate (33) + +- ReusedExchange (32) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5] +Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_store_sk#2)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_year#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#7, d_year#8] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#7, d_year#8] +Condition : ((isnotnull(d_year#8) AND (d_year#8 = 2001)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [2]: [d_date_sk#7, d_year#8] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4] +Input [6]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#10, s_state#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#10, s_state#11] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#10, s_state#11] +Condition : ((isnotnull(s_state#11) AND (s_state#11 = TN)) AND isnotnull(s_store_sk#10)) + +(14) Project [codegen id : 2] +Output [1]: [s_store_sk#10] +Input [2]: [s_store_sk#10, s_state#11] + +(15) BroadcastExchange +Input [1]: [s_store_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#10] +Join condition: None + +(17) Project [codegen id : 4] +Output [3]: [ss_item_sk#1, ss_ext_sales_price#3, ss_net_profit#4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, s_store_sk#10] + +(18) Scan parquet default.item +Output [3]: [i_item_sk#13, i_class#14, i_category#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [3]: [i_item_sk#13, i_class#14, i_category#15] + +(20) Filter [codegen id : 3] +Input [3]: [i_item_sk#13, i_class#14, i_category#15] +Condition : isnotnull(i_item_sk#13) + +(21) BroadcastExchange +Input [3]: [i_item_sk#13, i_class#14, i_category#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#13] +Join condition: None + +(23) Project [codegen id : 4] +Output [4]: [ss_ext_sales_price#3, ss_net_profit#4, i_class#14, i_category#15] +Input [6]: [ss_item_sk#1, ss_ext_sales_price#3, ss_net_profit#4, i_item_sk#13, i_class#14, i_category#15] + +(24) HashAggregate [codegen id : 4] +Input [4]: [ss_ext_sales_price#3, ss_net_profit#4, i_class#14, i_category#15] +Keys [2]: [i_category#15, i_class#14] +Functions [2]: [partial_sum(UnscaledValue(ss_net_profit#4)), partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [2]: [sum#17, sum#18] +Results [4]: [i_category#15, i_class#14, sum#19, sum#20] + +(25) Exchange +Input [4]: [i_category#15, i_class#14, sum#19, sum#20] +Arguments: hashpartitioning(i_category#15, i_class#14, 5), ENSURE_REQUIREMENTS, [id=#21] + +(26) HashAggregate [codegen id : 5] +Input [4]: [i_category#15, i_class#14, sum#19, sum#20] +Keys [2]: [i_category#15, i_class#14] +Functions [2]: [sum(UnscaledValue(ss_net_profit#4)), sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#4))#22, sum(UnscaledValue(ss_ext_sales_price#3))#23] +Results [6]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#4))#22,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#23,17,2))), DecimalType(37,20), true) as decimal(38,20)) AS gross_margin#24, i_category#15, i_class#14, 0 AS t_category#25, 0 AS t_class#26, 0 AS lochierarchy#27] + +(27) ReusedExchange [Reuses operator id: unknown] +Output [4]: [i_category#28, i_class#29, sum#30, sum#31] + +(28) HashAggregate [codegen id : 10] +Input [4]: [i_category#28, i_class#29, sum#30, sum#31] +Keys [2]: [i_category#28, i_class#29] +Functions [2]: [sum(UnscaledValue(ss_net_profit#32)), sum(UnscaledValue(ss_ext_sales_price#33))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#32))#34, sum(UnscaledValue(ss_ext_sales_price#33))#35] +Results [3]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#32))#34,17,2) AS ss_net_profit#36, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#33))#35,17,2) AS ss_ext_sales_price#37, i_category#28] + +(29) HashAggregate [codegen id : 10] +Input [3]: [ss_net_profit#36, ss_ext_sales_price#37, i_category#28] +Keys [1]: [i_category#28] +Functions [2]: [partial_sum(ss_net_profit#36), partial_sum(ss_ext_sales_price#37)] +Aggregate Attributes [4]: [sum#38, isEmpty#39, sum#40, isEmpty#41] +Results [5]: [i_category#28, sum#42, isEmpty#43, sum#44, isEmpty#45] + +(30) Exchange +Input [5]: [i_category#28, sum#42, isEmpty#43, sum#44, isEmpty#45] +Arguments: hashpartitioning(i_category#28, 5), ENSURE_REQUIREMENTS, [id=#46] + +(31) HashAggregate [codegen id : 11] +Input [5]: [i_category#28, sum#42, isEmpty#43, sum#44, isEmpty#45] +Keys [1]: [i_category#28] +Functions [2]: [sum(ss_net_profit#36), sum(ss_ext_sales_price#37)] +Aggregate Attributes [2]: [sum(ss_net_profit#36)#47, sum(ss_ext_sales_price#37)#48] +Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#36)#47) / promote_precision(sum(ss_ext_sales_price#37)#48)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#49, i_category#28, null AS i_class#50, 0 AS t_category#51, 1 AS t_class#52, 1 AS lochierarchy#53] + +(32) ReusedExchange [Reuses operator id: unknown] +Output [4]: [i_category#54, i_class#55, sum#56, sum#57] + +(33) HashAggregate [codegen id : 16] +Input [4]: [i_category#54, i_class#55, sum#56, sum#57] +Keys [2]: [i_category#54, i_class#55] +Functions [2]: [sum(UnscaledValue(ss_net_profit#58)), sum(UnscaledValue(ss_ext_sales_price#59))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#58))#60, sum(UnscaledValue(ss_ext_sales_price#59))#61] +Results [2]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#58))#60,17,2) AS ss_net_profit#36, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#59))#61,17,2) AS ss_ext_sales_price#37] + +(34) HashAggregate [codegen id : 16] +Input [2]: [ss_net_profit#36, ss_ext_sales_price#37] +Keys: [] +Functions [2]: [partial_sum(ss_net_profit#36), partial_sum(ss_ext_sales_price#37)] +Aggregate Attributes [4]: [sum#62, isEmpty#63, sum#64, isEmpty#65] +Results [4]: [sum#66, isEmpty#67, sum#68, isEmpty#69] + +(35) Exchange +Input [4]: [sum#66, isEmpty#67, sum#68, isEmpty#69] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#70] + +(36) HashAggregate [codegen id : 17] +Input [4]: [sum#66, isEmpty#67, sum#68, isEmpty#69] +Keys: [] +Functions [2]: [sum(ss_net_profit#36), sum(ss_ext_sales_price#37)] +Aggregate Attributes [2]: [sum(ss_net_profit#36)#71, sum(ss_ext_sales_price#37)#72] +Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#36)#71) / promote_precision(sum(ss_ext_sales_price#37)#72)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#73, null AS i_category#74, null AS i_class#75, 1 AS t_category#76, 1 AS t_class#77, 2 AS lochierarchy#78] + +(37) Union + +(38) HashAggregate [codegen id : 18] +Input [6]: [gross_margin#24, i_category#15, i_class#14, t_category#25, t_class#26, lochierarchy#27] +Keys [6]: [gross_margin#24, i_category#15, i_class#14, t_category#25, t_class#26, lochierarchy#27] +Functions: [] +Aggregate Attributes: [] +Results [6]: [gross_margin#24, i_category#15, i_class#14, t_category#25, t_class#26, lochierarchy#27] + +(39) Exchange +Input [6]: [gross_margin#24, i_category#15, i_class#14, t_category#25, t_class#26, lochierarchy#27] +Arguments: hashpartitioning(gross_margin#24, i_category#15, i_class#14, t_category#25, t_class#26, lochierarchy#27, 5), ENSURE_REQUIREMENTS, [id=#79] + +(40) HashAggregate [codegen id : 19] +Input [6]: [gross_margin#24, i_category#15, i_class#14, t_category#25, t_class#26, lochierarchy#27] +Keys [6]: [gross_margin#24, i_category#15, i_class#14, t_category#25, t_class#26, lochierarchy#27] +Functions: [] +Aggregate Attributes: [] +Results [5]: [gross_margin#24, i_category#15, i_class#14, lochierarchy#27, CASE WHEN (t_class#26 = 0) THEN i_category#15 END AS _w0#80] + +(41) Exchange +Input [5]: [gross_margin#24, i_category#15, i_class#14, lochierarchy#27, _w0#80] +Arguments: hashpartitioning(lochierarchy#27, _w0#80, 5), ENSURE_REQUIREMENTS, [id=#81] + +(42) Sort [codegen id : 20] +Input [5]: [gross_margin#24, i_category#15, i_class#14, lochierarchy#27, _w0#80] +Arguments: [lochierarchy#27 ASC NULLS FIRST, _w0#80 ASC NULLS FIRST, gross_margin#24 ASC NULLS FIRST], false, 0 + +(43) Window +Input [5]: [gross_margin#24, i_category#15, i_class#14, lochierarchy#27, _w0#80] +Arguments: [rank(gross_margin#24) windowspecdefinition(lochierarchy#27, _w0#80, gross_margin#24 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#82], [lochierarchy#27, _w0#80], [gross_margin#24 ASC NULLS FIRST] + +(44) Project [codegen id : 21] +Output [5]: [gross_margin#24, i_category#15, i_class#14, lochierarchy#27, rank_within_parent#82] +Input [6]: [gross_margin#24, i_category#15, i_class#14, lochierarchy#27, _w0#80, rank_within_parent#82] + +(45) TakeOrderedAndProject +Input [5]: [gross_margin#24, i_category#15, i_class#14, lochierarchy#27, rank_within_parent#82] +Arguments: 100, [lochierarchy#27 DESC NULLS LAST, CASE WHEN (lochierarchy#27 = 0) THEN i_category#15 END ASC NULLS FIRST, rank_within_parent#82 ASC NULLS FIRST], [gross_margin#24, i_category#15, i_class#14, lochierarchy#27, rank_within_parent#82] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (46) + + +(46) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/simplified.txt new file mode 100644 index 0000000000000..3a32a26cb0a75 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a.sf100/simplified.txt @@ -0,0 +1,76 @@ +TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i_class] + WholeStageCodegen (21) + Project [gross_margin,i_category,i_class,lochierarchy,rank_within_parent] + InputAdapter + Window [gross_margin,lochierarchy,_w0] + WholeStageCodegen (20) + Sort [lochierarchy,_w0,gross_margin] + InputAdapter + Exchange [lochierarchy,_w0] #1 + WholeStageCodegen (19) + HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] [_w0] + InputAdapter + Exchange [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] #2 + WholeStageCodegen (18) + HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] + InputAdapter + Union + WholeStageCodegen (5) + HashAggregate [i_category,i_class,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(ss_ext_sales_price)),gross_margin,t_category,t_class,lochierarchy,sum,sum] + InputAdapter + Exchange [i_category,i_class] #3 + WholeStageCodegen (4) + HashAggregate [i_category,i_class,ss_net_profit,ss_ext_sales_price] [sum,sum,sum,sum] + Project [ss_ext_sales_price,ss_net_profit,i_class,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_ext_sales_price,ss_net_profit] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_class,i_category] + WholeStageCodegen (11) + HashAggregate [i_category,sum,isEmpty,sum,isEmpty] [sum(ss_net_profit),sum(ss_ext_sales_price),gross_margin,i_class,t_category,t_class,lochierarchy,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [i_category] #7 + WholeStageCodegen (10) + HashAggregate [i_category,ss_net_profit,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(ss_ext_sales_price)),ss_net_profit,ss_ext_sales_price,sum,sum] + InputAdapter + ReusedExchange [i_category,i_class,sum,sum] #8 + WholeStageCodegen (17) + HashAggregate [sum,isEmpty,sum,isEmpty] [sum(ss_net_profit),sum(ss_ext_sales_price),gross_margin,i_category,i_class,t_category,t_class,lochierarchy,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange #9 + WholeStageCodegen (16) + HashAggregate [ss_net_profit,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(ss_ext_sales_price)),ss_net_profit,ss_ext_sales_price,sum,sum] + InputAdapter + ReusedExchange [i_category,i_class,sum,sum] #8 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/explain.txt new file mode 100644 index 0000000000000..bc2931129868b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/explain.txt @@ -0,0 +1,276 @@ +== Physical Plan == +TakeOrderedAndProject (45) ++- * Project (44) + +- Window (43) + +- * Sort (42) + +- Exchange (41) + +- * HashAggregate (40) + +- Exchange (39) + +- * HashAggregate (38) + +- Union (37) + :- * HashAggregate (26) + : +- Exchange (25) + : +- * HashAggregate (24) + : +- * Project (23) + : +- * BroadcastHashJoin Inner BuildRight (22) + : :- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.item (11) + : +- BroadcastExchange (21) + : +- * Project (20) + : +- * Filter (19) + : +- * ColumnarToRow (18) + : +- Scan parquet default.store (17) + :- * HashAggregate (31) + : +- Exchange (30) + : +- * HashAggregate (29) + : +- * HashAggregate (28) + : +- ReusedExchange (27) + +- * HashAggregate (36) + +- Exchange (35) + +- * HashAggregate (34) + +- * HashAggregate (33) + +- ReusedExchange (32) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5] +Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_store_sk#2)) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#7, d_year#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#7, d_year#8] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#7, d_year#8] +Condition : ((isnotnull(d_year#8) AND (d_year#8 = 2001)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#7] +Input [2]: [d_date_sk#7, d_year#8] + +(8) BroadcastExchange +Input [1]: [d_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#9] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4] +Input [6]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, ss_sold_date_sk#5, d_date_sk#7] + +(11) Scan parquet default.item +Output [3]: [i_item_sk#10, i_class#11, i_category#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [i_item_sk#10, i_class#11, i_category#12] + +(13) Filter [codegen id : 2] +Input [3]: [i_item_sk#10, i_class#11, i_category#12] +Condition : isnotnull(i_item_sk#10) + +(14) BroadcastExchange +Input [3]: [i_item_sk#10, i_class#11, i_category#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#10] +Join condition: None + +(16) Project [codegen id : 4] +Output [5]: [ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, i_class#11, i_category#12] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, i_item_sk#10, i_class#11, i_category#12] + +(17) Scan parquet default.store +Output [2]: [s_store_sk#14, s_state#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_state), EqualTo(s_state,TN), IsNotNull(s_store_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#14, s_state#15] + +(19) Filter [codegen id : 3] +Input [2]: [s_store_sk#14, s_state#15] +Condition : ((isnotnull(s_state#15) AND (s_state#15 = TN)) AND isnotnull(s_store_sk#14)) + +(20) Project [codegen id : 3] +Output [1]: [s_store_sk#14] +Input [2]: [s_store_sk#14, s_state#15] + +(21) BroadcastExchange +Input [1]: [s_store_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#16] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#14] +Join condition: None + +(23) Project [codegen id : 4] +Output [4]: [ss_ext_sales_price#3, ss_net_profit#4, i_class#11, i_category#12] +Input [6]: [ss_store_sk#2, ss_ext_sales_price#3, ss_net_profit#4, i_class#11, i_category#12, s_store_sk#14] + +(24) HashAggregate [codegen id : 4] +Input [4]: [ss_ext_sales_price#3, ss_net_profit#4, i_class#11, i_category#12] +Keys [2]: [i_category#12, i_class#11] +Functions [2]: [partial_sum(UnscaledValue(ss_net_profit#4)), partial_sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [2]: [sum#17, sum#18] +Results [4]: [i_category#12, i_class#11, sum#19, sum#20] + +(25) Exchange +Input [4]: [i_category#12, i_class#11, sum#19, sum#20] +Arguments: hashpartitioning(i_category#12, i_class#11, 5), ENSURE_REQUIREMENTS, [id=#21] + +(26) HashAggregate [codegen id : 5] +Input [4]: [i_category#12, i_class#11, sum#19, sum#20] +Keys [2]: [i_category#12, i_class#11] +Functions [2]: [sum(UnscaledValue(ss_net_profit#4)), sum(UnscaledValue(ss_ext_sales_price#3))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#4))#22, sum(UnscaledValue(ss_ext_sales_price#3))#23] +Results [6]: [cast(CheckOverflow((promote_precision(MakeDecimal(sum(UnscaledValue(ss_net_profit#4))#22,17,2)) / promote_precision(MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#3))#23,17,2))), DecimalType(37,20), true) as decimal(38,20)) AS gross_margin#24, i_category#12, i_class#11, 0 AS t_category#25, 0 AS t_class#26, 0 AS lochierarchy#27] + +(27) ReusedExchange [Reuses operator id: unknown] +Output [4]: [i_category#28, i_class#29, sum#30, sum#31] + +(28) HashAggregate [codegen id : 10] +Input [4]: [i_category#28, i_class#29, sum#30, sum#31] +Keys [2]: [i_category#28, i_class#29] +Functions [2]: [sum(UnscaledValue(ss_net_profit#32)), sum(UnscaledValue(ss_ext_sales_price#33))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#32))#34, sum(UnscaledValue(ss_ext_sales_price#33))#35] +Results [3]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#32))#34,17,2) AS ss_net_profit#36, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#33))#35,17,2) AS ss_ext_sales_price#37, i_category#28] + +(29) HashAggregate [codegen id : 10] +Input [3]: [ss_net_profit#36, ss_ext_sales_price#37, i_category#28] +Keys [1]: [i_category#28] +Functions [2]: [partial_sum(ss_net_profit#36), partial_sum(ss_ext_sales_price#37)] +Aggregate Attributes [4]: [sum#38, isEmpty#39, sum#40, isEmpty#41] +Results [5]: [i_category#28, sum#42, isEmpty#43, sum#44, isEmpty#45] + +(30) Exchange +Input [5]: [i_category#28, sum#42, isEmpty#43, sum#44, isEmpty#45] +Arguments: hashpartitioning(i_category#28, 5), ENSURE_REQUIREMENTS, [id=#46] + +(31) HashAggregate [codegen id : 11] +Input [5]: [i_category#28, sum#42, isEmpty#43, sum#44, isEmpty#45] +Keys [1]: [i_category#28] +Functions [2]: [sum(ss_net_profit#36), sum(ss_ext_sales_price#37)] +Aggregate Attributes [2]: [sum(ss_net_profit#36)#47, sum(ss_ext_sales_price#37)#48] +Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#36)#47) / promote_precision(sum(ss_ext_sales_price#37)#48)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#49, i_category#28, null AS i_class#50, 0 AS t_category#51, 1 AS t_class#52, 1 AS lochierarchy#53] + +(32) ReusedExchange [Reuses operator id: unknown] +Output [4]: [i_category#54, i_class#55, sum#56, sum#57] + +(33) HashAggregate [codegen id : 16] +Input [4]: [i_category#54, i_class#55, sum#56, sum#57] +Keys [2]: [i_category#54, i_class#55] +Functions [2]: [sum(UnscaledValue(ss_net_profit#58)), sum(UnscaledValue(ss_ext_sales_price#59))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_net_profit#58))#60, sum(UnscaledValue(ss_ext_sales_price#59))#61] +Results [2]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#58))#60,17,2) AS ss_net_profit#36, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#59))#61,17,2) AS ss_ext_sales_price#37] + +(34) HashAggregate [codegen id : 16] +Input [2]: [ss_net_profit#36, ss_ext_sales_price#37] +Keys: [] +Functions [2]: [partial_sum(ss_net_profit#36), partial_sum(ss_ext_sales_price#37)] +Aggregate Attributes [4]: [sum#62, isEmpty#63, sum#64, isEmpty#65] +Results [4]: [sum#66, isEmpty#67, sum#68, isEmpty#69] + +(35) Exchange +Input [4]: [sum#66, isEmpty#67, sum#68, isEmpty#69] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#70] + +(36) HashAggregate [codegen id : 17] +Input [4]: [sum#66, isEmpty#67, sum#68, isEmpty#69] +Keys: [] +Functions [2]: [sum(ss_net_profit#36), sum(ss_ext_sales_price#37)] +Aggregate Attributes [2]: [sum(ss_net_profit#36)#71, sum(ss_ext_sales_price#37)#72] +Results [6]: [cast(CheckOverflow((promote_precision(sum(ss_net_profit#36)#71) / promote_precision(sum(ss_ext_sales_price#37)#72)), DecimalType(38,11), true) as decimal(38,20)) AS gross_margin#73, null AS i_category#74, null AS i_class#75, 1 AS t_category#76, 1 AS t_class#77, 2 AS lochierarchy#78] + +(37) Union + +(38) HashAggregate [codegen id : 18] +Input [6]: [gross_margin#24, i_category#12, i_class#11, t_category#25, t_class#26, lochierarchy#27] +Keys [6]: [gross_margin#24, i_category#12, i_class#11, t_category#25, t_class#26, lochierarchy#27] +Functions: [] +Aggregate Attributes: [] +Results [6]: [gross_margin#24, i_category#12, i_class#11, t_category#25, t_class#26, lochierarchy#27] + +(39) Exchange +Input [6]: [gross_margin#24, i_category#12, i_class#11, t_category#25, t_class#26, lochierarchy#27] +Arguments: hashpartitioning(gross_margin#24, i_category#12, i_class#11, t_category#25, t_class#26, lochierarchy#27, 5), ENSURE_REQUIREMENTS, [id=#79] + +(40) HashAggregate [codegen id : 19] +Input [6]: [gross_margin#24, i_category#12, i_class#11, t_category#25, t_class#26, lochierarchy#27] +Keys [6]: [gross_margin#24, i_category#12, i_class#11, t_category#25, t_class#26, lochierarchy#27] +Functions: [] +Aggregate Attributes: [] +Results [5]: [gross_margin#24, i_category#12, i_class#11, lochierarchy#27, CASE WHEN (t_class#26 = 0) THEN i_category#12 END AS _w0#80] + +(41) Exchange +Input [5]: [gross_margin#24, i_category#12, i_class#11, lochierarchy#27, _w0#80] +Arguments: hashpartitioning(lochierarchy#27, _w0#80, 5), ENSURE_REQUIREMENTS, [id=#81] + +(42) Sort [codegen id : 20] +Input [5]: [gross_margin#24, i_category#12, i_class#11, lochierarchy#27, _w0#80] +Arguments: [lochierarchy#27 ASC NULLS FIRST, _w0#80 ASC NULLS FIRST, gross_margin#24 ASC NULLS FIRST], false, 0 + +(43) Window +Input [5]: [gross_margin#24, i_category#12, i_class#11, lochierarchy#27, _w0#80] +Arguments: [rank(gross_margin#24) windowspecdefinition(lochierarchy#27, _w0#80, gross_margin#24 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#82], [lochierarchy#27, _w0#80], [gross_margin#24 ASC NULLS FIRST] + +(44) Project [codegen id : 21] +Output [5]: [gross_margin#24, i_category#12, i_class#11, lochierarchy#27, rank_within_parent#82] +Input [6]: [gross_margin#24, i_category#12, i_class#11, lochierarchy#27, _w0#80, rank_within_parent#82] + +(45) TakeOrderedAndProject +Input [5]: [gross_margin#24, i_category#12, i_class#11, lochierarchy#27, rank_within_parent#82] +Arguments: 100, [lochierarchy#27 DESC NULLS LAST, CASE WHEN (lochierarchy#27 = 0) THEN i_category#12 END ASC NULLS FIRST, rank_within_parent#82 ASC NULLS FIRST], [gross_margin#24, i_category#12, i_class#11, lochierarchy#27, rank_within_parent#82] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (46) + + +(46) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#7] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/simplified.txt new file mode 100644 index 0000000000000..7cccdf955a9c4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q36a/simplified.txt @@ -0,0 +1,76 @@ +TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,gross_margin,i_class] + WholeStageCodegen (21) + Project [gross_margin,i_category,i_class,lochierarchy,rank_within_parent] + InputAdapter + Window [gross_margin,lochierarchy,_w0] + WholeStageCodegen (20) + Sort [lochierarchy,_w0,gross_margin] + InputAdapter + Exchange [lochierarchy,_w0] #1 + WholeStageCodegen (19) + HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] [_w0] + InputAdapter + Exchange [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] #2 + WholeStageCodegen (18) + HashAggregate [gross_margin,i_category,i_class,t_category,t_class,lochierarchy] + InputAdapter + Union + WholeStageCodegen (5) + HashAggregate [i_category,i_class,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(ss_ext_sales_price)),gross_margin,t_category,t_class,lochierarchy,sum,sum] + InputAdapter + Exchange [i_category,i_class] #3 + WholeStageCodegen (4) + HashAggregate [i_category,i_class,ss_net_profit,ss_ext_sales_price] [sum,sum,sum,sum] + Project [ss_ext_sales_price,ss_net_profit,i_class,i_category] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_ext_sales_price,ss_net_profit,i_class,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_class,i_category] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Project [s_store_sk] + Filter [s_state,s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + WholeStageCodegen (11) + HashAggregate [i_category,sum,isEmpty,sum,isEmpty] [sum(ss_net_profit),sum(ss_ext_sales_price),gross_margin,i_class,t_category,t_class,lochierarchy,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [i_category] #7 + WholeStageCodegen (10) + HashAggregate [i_category,ss_net_profit,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(ss_ext_sales_price)),ss_net_profit,ss_ext_sales_price,sum,sum] + InputAdapter + ReusedExchange [i_category,i_class,sum,sum] #8 + WholeStageCodegen (17) + HashAggregate [sum,isEmpty,sum,isEmpty] [sum(ss_net_profit),sum(ss_ext_sales_price),gross_margin,i_category,i_class,t_category,t_class,lochierarchy,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange #9 + WholeStageCodegen (16) + HashAggregate [ss_net_profit,ss_ext_sales_price] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,sum,sum] [sum(UnscaledValue(ss_net_profit)),sum(UnscaledValue(ss_ext_sales_price)),ss_net_profit,ss_ext_sales_price,sum,sum] + InputAdapter + ReusedExchange [i_category,i_class,sum,sum] #8 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q47.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q47.sf100/explain.txt new file mode 100644 index 0000000000000..636fa32f94212 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q47.sf100/explain.txt @@ -0,0 +1,314 @@ +== Physical Plan == +TakeOrderedAndProject (56) ++- * Project (55) + +- * SortMergeJoin Inner (54) + :- * Project (47) + : +- * SortMergeJoin Inner (46) + : :- * Sort (37) + : : +- Exchange (36) + : : +- * Filter (35) + : : +- Window (34) + : : +- * Sort (33) + : : +- Exchange (32) + : : +- * Project (31) + : : +- Window (30) + : : +- * Sort (29) + : : +- Exchange (28) + : : +- * HashAggregate (27) + : : +- Exchange (26) + : : +- * HashAggregate (25) + : : +- * Project (24) + : : +- * SortMergeJoin Inner (23) + : : :- * Sort (17) + : : : +- Exchange (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.store (10) + : : +- * Sort (22) + : : +- Exchange (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.item (18) + : +- * Sort (45) + : +- Exchange (44) + : +- * Project (43) + : +- Window (42) + : +- * Sort (41) + : +- Exchange (40) + : +- * HashAggregate (39) + : +- ReusedExchange (38) + +- * Sort (53) + +- Exchange (52) + +- * Project (51) + +- Window (50) + +- * Sort (49) + +- ReusedExchange (48) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4] +Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_store_sk#2)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(Or(EqualTo(d_year,1999),And(EqualTo(d_year,1998),EqualTo(d_moy,12))),And(EqualTo(d_year,2000),EqualTo(d_moy,1))), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((d_year#7 = 1999) OR ((d_year#7 = 1998) AND (d_moy#8 = 12))) OR ((d_year#7 = 2000) AND (d_moy#8 = 1))) AND isnotnull(d_date_sk#6)) + +(7) BroadcastExchange +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(9) Project [codegen id : 3] +Output [5]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, d_year#7, d_moy#8] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, ss_sold_date_sk#4, d_date_sk#6, d_year#7, d_moy#8] + +(10) Scan parquet default.store +Output [3]: [s_store_sk#10, s_store_name#11, s_company_name#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_name), IsNotNull(s_company_name)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [s_store_sk#10, s_store_name#11, s_company_name#12] + +(12) Filter [codegen id : 2] +Input [3]: [s_store_sk#10, s_store_name#11, s_company_name#12] +Condition : ((isnotnull(s_store_sk#10) AND isnotnull(s_store_name#11)) AND isnotnull(s_company_name#12)) + +(13) BroadcastExchange +Input [3]: [s_store_sk#10, s_store_name#11, s_company_name#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#10] +Join condition: None + +(15) Project [codegen id : 3] +Output [6]: [ss_item_sk#1, ss_sales_price#3, d_year#7, d_moy#8, s_store_name#11, s_company_name#12] +Input [8]: [ss_item_sk#1, ss_store_sk#2, ss_sales_price#3, d_year#7, d_moy#8, s_store_sk#10, s_store_name#11, s_company_name#12] + +(16) Exchange +Input [6]: [ss_item_sk#1, ss_sales_price#3, d_year#7, d_moy#8, s_store_name#11, s_company_name#12] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#14] + +(17) Sort [codegen id : 4] +Input [6]: [ss_item_sk#1, ss_sales_price#3, d_year#7, d_moy#8, s_store_name#11, s_company_name#12] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(18) Scan parquet default.item +Output [3]: [i_item_sk#15, i_brand#16, i_category#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_category), IsNotNull(i_brand)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 5] +Input [3]: [i_item_sk#15, i_brand#16, i_category#17] + +(20) Filter [codegen id : 5] +Input [3]: [i_item_sk#15, i_brand#16, i_category#17] +Condition : ((isnotnull(i_item_sk#15) AND isnotnull(i_category#17)) AND isnotnull(i_brand#16)) + +(21) Exchange +Input [3]: [i_item_sk#15, i_brand#16, i_category#17] +Arguments: hashpartitioning(i_item_sk#15, 5), ENSURE_REQUIREMENTS, [id=#18] + +(22) Sort [codegen id : 6] +Input [3]: [i_item_sk#15, i_brand#16, i_category#17] +Arguments: [i_item_sk#15 ASC NULLS FIRST], false, 0 + +(23) SortMergeJoin [codegen id : 7] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#15] +Join condition: None + +(24) Project [codegen id : 7] +Output [7]: [i_brand#16, i_category#17, ss_sales_price#3, d_year#7, d_moy#8, s_store_name#11, s_company_name#12] +Input [9]: [ss_item_sk#1, ss_sales_price#3, d_year#7, d_moy#8, s_store_name#11, s_company_name#12, i_item_sk#15, i_brand#16, i_category#17] + +(25) HashAggregate [codegen id : 7] +Input [7]: [i_brand#16, i_category#17, ss_sales_price#3, d_year#7, d_moy#8, s_store_name#11, s_company_name#12] +Keys [6]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#3))] +Aggregate Attributes [1]: [sum#19] +Results [7]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum#20] + +(26) Exchange +Input [7]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum#20] +Arguments: hashpartitioning(i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, 5), ENSURE_REQUIREMENTS, [id=#21] + +(27) HashAggregate [codegen id : 8] +Input [7]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum#20] +Keys [6]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8] +Functions [1]: [sum(UnscaledValue(ss_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#3))#22] +Results [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#22,17,2) AS sum_sales#23, MakeDecimal(sum(UnscaledValue(ss_sales_price#3))#22,17,2) AS _w0#24] + +(28) Exchange +Input [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, _w0#24] +Arguments: hashpartitioning(i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, 5), ENSURE_REQUIREMENTS, [id=#25] + +(29) Sort [codegen id : 9] +Input [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, _w0#24] +Arguments: [i_category#17 ASC NULLS FIRST, i_brand#16 ASC NULLS FIRST, s_store_name#11 ASC NULLS FIRST, s_company_name#12 ASC NULLS FIRST, d_year#7 ASC NULLS FIRST], false, 0 + +(30) Window +Input [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, _w0#24] +Arguments: [avg(_w0#24) windowspecdefinition(i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#26], [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7] + +(31) Project [codegen id : 10] +Output [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26] +Input [9]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, _w0#24, avg_monthly_sales#26] + +(32) Exchange +Input [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26] +Arguments: hashpartitioning(i_category#17, i_brand#16, s_store_name#11, s_company_name#12, 5), ENSURE_REQUIREMENTS, [id=#27] + +(33) Sort [codegen id : 11] +Input [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26] +Arguments: [i_category#17 ASC NULLS FIRST, i_brand#16 ASC NULLS FIRST, s_store_name#11 ASC NULLS FIRST, s_company_name#12 ASC NULLS FIRST, d_year#7 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST], false, 0 + +(34) Window +Input [8]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26] +Arguments: [rank(d_year#7, d_moy#8) windowspecdefinition(i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#28], [i_category#17, i_brand#16, s_store_name#11, s_company_name#12], [d_year#7 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST] + +(35) Filter [codegen id : 12] +Input [9]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26, rn#28] +Condition : ((((isnotnull(d_year#7) AND isnotnull(avg_monthly_sales#26)) AND (d_year#7 = 1999)) AND (avg_monthly_sales#26 > 0.000000)) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#23 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)) + +(36) Exchange +Input [9]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26, rn#28] +Arguments: hashpartitioning(i_category#17, i_brand#16, s_store_name#11, s_company_name#12, rn#28, 5), ENSURE_REQUIREMENTS, [id=#29] + +(37) Sort [codegen id : 13] +Input [9]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26, rn#28] +Arguments: [i_category#17 ASC NULLS FIRST, i_brand#16 ASC NULLS FIRST, s_store_name#11 ASC NULLS FIRST, s_company_name#12 ASC NULLS FIRST, rn#28 ASC NULLS FIRST], false, 0 + +(38) ReusedExchange [Reuses operator id: unknown] +Output [7]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, sum#36] + +(39) HashAggregate [codegen id : 21] +Input [7]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, sum#36] +Keys [6]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35] +Functions [1]: [sum(UnscaledValue(ss_sales_price#37))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#37))#38] +Results [7]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, MakeDecimal(sum(UnscaledValue(ss_sales_price#37))#38,17,2) AS sum_sales#39] + +(40) Exchange +Input [7]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, sum_sales#39] +Arguments: hashpartitioning(i_category#30, i_brand#31, s_store_name#32, s_company_name#33, 5), ENSURE_REQUIREMENTS, [id=#40] + +(41) Sort [codegen id : 22] +Input [7]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, sum_sales#39] +Arguments: [i_category#30 ASC NULLS FIRST, i_brand#31 ASC NULLS FIRST, s_store_name#32 ASC NULLS FIRST, s_company_name#33 ASC NULLS FIRST, d_year#34 ASC NULLS FIRST, d_moy#35 ASC NULLS FIRST], false, 0 + +(42) Window +Input [7]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, sum_sales#39] +Arguments: [rank(d_year#34, d_moy#35) windowspecdefinition(i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34 ASC NULLS FIRST, d_moy#35 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#41], [i_category#30, i_brand#31, s_store_name#32, s_company_name#33], [d_year#34 ASC NULLS FIRST, d_moy#35 ASC NULLS FIRST] + +(43) Project [codegen id : 23] +Output [6]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, sum_sales#39, rn#41] +Input [8]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, d_year#34, d_moy#35, sum_sales#39, rn#41] + +(44) Exchange +Input [6]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, sum_sales#39, rn#41] +Arguments: hashpartitioning(i_category#30, i_brand#31, s_store_name#32, s_company_name#33, (rn#41 + 1), 5), ENSURE_REQUIREMENTS, [id=#42] + +(45) Sort [codegen id : 24] +Input [6]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, sum_sales#39, rn#41] +Arguments: [i_category#30 ASC NULLS FIRST, i_brand#31 ASC NULLS FIRST, s_store_name#32 ASC NULLS FIRST, s_company_name#33 ASC NULLS FIRST, (rn#41 + 1) ASC NULLS FIRST], false, 0 + +(46) SortMergeJoin [codegen id : 25] +Left keys [5]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, rn#28] +Right keys [5]: [i_category#30, i_brand#31, s_store_name#32, s_company_name#33, (rn#41 + 1)] +Join condition: None + +(47) Project [codegen id : 25] +Output [10]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26, rn#28, sum_sales#39] +Input [15]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26, rn#28, i_category#30, i_brand#31, s_store_name#32, s_company_name#33, sum_sales#39, rn#41] + +(48) ReusedExchange [Reuses operator id: 40] +Output [7]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, d_year#47, d_moy#48, sum_sales#49] + +(49) Sort [codegen id : 34] +Input [7]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, d_year#47, d_moy#48, sum_sales#49] +Arguments: [i_category#43 ASC NULLS FIRST, i_brand#44 ASC NULLS FIRST, s_store_name#45 ASC NULLS FIRST, s_company_name#46 ASC NULLS FIRST, d_year#47 ASC NULLS FIRST, d_moy#48 ASC NULLS FIRST], false, 0 + +(50) Window +Input [7]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, d_year#47, d_moy#48, sum_sales#49] +Arguments: [rank(d_year#47, d_moy#48) windowspecdefinition(i_category#43, i_brand#44, s_store_name#45, s_company_name#46, d_year#47 ASC NULLS FIRST, d_moy#48 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#50], [i_category#43, i_brand#44, s_store_name#45, s_company_name#46], [d_year#47 ASC NULLS FIRST, d_moy#48 ASC NULLS FIRST] + +(51) Project [codegen id : 35] +Output [6]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, sum_sales#49, rn#50] +Input [8]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, d_year#47, d_moy#48, sum_sales#49, rn#50] + +(52) Exchange +Input [6]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, sum_sales#49, rn#50] +Arguments: hashpartitioning(i_category#43, i_brand#44, s_store_name#45, s_company_name#46, (rn#50 - 1), 5), ENSURE_REQUIREMENTS, [id=#51] + +(53) Sort [codegen id : 36] +Input [6]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, sum_sales#49, rn#50] +Arguments: [i_category#43 ASC NULLS FIRST, i_brand#44 ASC NULLS FIRST, s_store_name#45 ASC NULLS FIRST, s_company_name#46 ASC NULLS FIRST, (rn#50 - 1) ASC NULLS FIRST], false, 0 + +(54) SortMergeJoin [codegen id : 37] +Left keys [5]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, rn#28] +Right keys [5]: [i_category#43, i_brand#44, s_store_name#45, s_company_name#46, (rn#50 - 1)] +Join condition: None + +(55) Project [codegen id : 37] +Output [7]: [i_category#17, d_year#7, d_moy#8, avg_monthly_sales#26, sum_sales#23, sum_sales#39 AS psum#52, sum_sales#49 AS nsum#53] +Input [16]: [i_category#17, i_brand#16, s_store_name#11, s_company_name#12, d_year#7, d_moy#8, sum_sales#23, avg_monthly_sales#26, rn#28, sum_sales#39, i_category#43, i_brand#44, s_store_name#45, s_company_name#46, sum_sales#49, rn#50] + +(56) TakeOrderedAndProject +Input [7]: [i_category#17, d_year#7, d_moy#8, avg_monthly_sales#26, sum_sales#23, psum#52, nsum#53] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#23 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#26 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST], [i_category#17, d_year#7, d_moy#8, avg_monthly_sales#26, sum_sales#23, psum#52, nsum#53] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (57) + + +(57) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q47.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q47.sf100/simplified.txt new file mode 100644 index 0000000000000..0ebb78eb49ff0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q47.sf100/simplified.txt @@ -0,0 +1,107 @@ +TakeOrderedAndProject [sum_sales,avg_monthly_sales,d_moy,i_category,d_year,psum,nsum] + WholeStageCodegen (37) + Project [i_category,d_year,d_moy,avg_monthly_sales,sum_sales,sum_sales,sum_sales] + SortMergeJoin [i_category,i_brand,s_store_name,s_company_name,rn,i_category,i_brand,s_store_name,s_company_name,rn] + InputAdapter + WholeStageCodegen (25) + Project [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum_sales,avg_monthly_sales,rn,sum_sales] + SortMergeJoin [i_category,i_brand,s_store_name,s_company_name,rn,i_category,i_brand,s_store_name,s_company_name,rn] + InputAdapter + WholeStageCodegen (13) + Sort [i_category,i_brand,s_store_name,s_company_name,rn] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,rn] #1 + WholeStageCodegen (12) + Filter [d_year,avg_monthly_sales,sum_sales] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (11) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name] #2 + WholeStageCodegen (10) + Project [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum_sales,avg_monthly_sales] + InputAdapter + Window [_w0,i_category,i_brand,s_store_name,s_company_name,d_year] + WholeStageCodegen (9) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,d_year] #3 + WholeStageCodegen (8) + HashAggregate [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] #4 + WholeStageCodegen (7) + HashAggregate [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,ss_sales_price] [sum,sum] + Project [i_brand,i_category,ss_sales_price,d_year,d_moy,s_store_name,s_company_name] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #5 + WholeStageCodegen (3) + Project [ss_item_sk,ss_sales_price,d_year,d_moy,s_store_name,s_company_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_sales_price,d_year,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (2) + Filter [s_store_sk,s_store_name,s_company_name] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_company_name] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #8 + WholeStageCodegen (5) + Filter [i_item_sk,i_category,i_brand] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_category] + InputAdapter + WholeStageCodegen (24) + Sort [i_category,i_brand,s_store_name,s_company_name,rn] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,rn] #9 + WholeStageCodegen (23) + Project [i_category,i_brand,s_store_name,s_company_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (22) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name] #10 + WholeStageCodegen (21) + HashAggregate [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,sum] + InputAdapter + ReusedExchange [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum] #11 + InputAdapter + WholeStageCodegen (36) + Sort [i_category,i_brand,s_store_name,s_company_name,rn] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,rn] #12 + WholeStageCodegen (35) + Project [i_category,i_brand,s_store_name,s_company_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (34) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] + InputAdapter + ReusedExchange [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum_sales] #10 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q47/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q47/explain.txt new file mode 100644 index 0000000000000..734eec1be3565 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q47/explain.txt @@ -0,0 +1,279 @@ +== Physical Plan == +TakeOrderedAndProject (49) ++- * Project (48) + +- * BroadcastHashJoin Inner BuildRight (47) + :- * Project (41) + : +- * BroadcastHashJoin Inner BuildRight (40) + : :- * Filter (32) + : : +- Window (31) + : : +- * Sort (30) + : : +- Exchange (29) + : : +- * Project (28) + : : +- Window (27) + : : +- * Sort (26) + : : +- Exchange (25) + : : +- * HashAggregate (24) + : : +- Exchange (23) + : : +- * HashAggregate (22) + : : +- * Project (21) + : : +- * BroadcastHashJoin Inner BuildRight (20) + : : :- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.item (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (19) + : : +- * Filter (18) + : : +- * ColumnarToRow (17) + : : +- Scan parquet default.store (16) + : +- BroadcastExchange (39) + : +- * Project (38) + : +- Window (37) + : +- * Sort (36) + : +- Exchange (35) + : +- * HashAggregate (34) + : +- ReusedExchange (33) + +- BroadcastExchange (46) + +- * Project (45) + +- Window (44) + +- * Sort (43) + +- ReusedExchange (42) + + +(1) Scan parquet default.item +Output [3]: [i_item_sk#1, i_brand#2, i_category#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_category), IsNotNull(i_brand)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [3]: [i_item_sk#1, i_brand#2, i_category#3] + +(3) Filter [codegen id : 4] +Input [3]: [i_item_sk#1, i_brand#2, i_category#3] +Condition : ((isnotnull(i_item_sk#1) AND isnotnull(i_category#3)) AND isnotnull(i_brand#2)) + +(4) Scan parquet default.store_sales +Output [4]: [ss_item_sk#4, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_store_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [ss_item_sk#4, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] + +(6) Filter [codegen id : 1] +Input [4]: [ss_item_sk#4, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] +Condition : (isnotnull(ss_item_sk#4) AND isnotnull(ss_store_sk#5)) + +(7) BroadcastExchange +Input [4]: [ss_item_sk#4, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] + +(8) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [ss_item_sk#4] +Join condition: None + +(9) Project [codegen id : 4] +Output [5]: [i_brand#2, i_category#3, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] +Input [7]: [i_item_sk#1, i_brand#2, i_category#3, ss_item_sk#4, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7] + +(10) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(Or(EqualTo(d_year,1999),And(EqualTo(d_year,1998),EqualTo(d_moy,12))),And(EqualTo(d_year,2000),EqualTo(d_moy,1))), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(12) Filter [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Condition : ((((d_year#11 = 1999) OR ((d_year#11 = 1998) AND (d_moy#12 = 12))) OR ((d_year#11 = 2000) AND (d_moy#12 = 1))) AND isnotnull(d_date_sk#10)) + +(13) BroadcastExchange +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(15) Project [codegen id : 4] +Output [6]: [i_brand#2, i_category#3, ss_store_sk#5, ss_sales_price#6, d_year#11, d_moy#12] +Input [8]: [i_brand#2, i_category#3, ss_store_sk#5, ss_sales_price#6, ss_sold_date_sk#7, d_date_sk#10, d_year#11, d_moy#12] + +(16) Scan parquet default.store +Output [3]: [s_store_sk#14, s_store_name#15, s_company_name#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_name), IsNotNull(s_company_name)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [3]: [s_store_sk#14, s_store_name#15, s_company_name#16] + +(18) Filter [codegen id : 3] +Input [3]: [s_store_sk#14, s_store_name#15, s_company_name#16] +Condition : ((isnotnull(s_store_sk#14) AND isnotnull(s_store_name#15)) AND isnotnull(s_company_name#16)) + +(19) BroadcastExchange +Input [3]: [s_store_sk#14, s_store_name#15, s_company_name#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(20) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#5] +Right keys [1]: [s_store_sk#14] +Join condition: None + +(21) Project [codegen id : 4] +Output [7]: [i_brand#2, i_category#3, ss_sales_price#6, d_year#11, d_moy#12, s_store_name#15, s_company_name#16] +Input [9]: [i_brand#2, i_category#3, ss_store_sk#5, ss_sales_price#6, d_year#11, d_moy#12, s_store_sk#14, s_store_name#15, s_company_name#16] + +(22) HashAggregate [codegen id : 4] +Input [7]: [i_brand#2, i_category#3, ss_sales_price#6, d_year#11, d_moy#12, s_store_name#15, s_company_name#16] +Keys [6]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [1]: [sum#18] +Results [7]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum#19] + +(23) Exchange +Input [7]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum#19] +Arguments: hashpartitioning(i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, 5), ENSURE_REQUIREMENTS, [id=#20] + +(24) HashAggregate [codegen id : 5] +Input [7]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum#19] +Keys [6]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12] +Functions [1]: [sum(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#6))#21] +Results [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, MakeDecimal(sum(UnscaledValue(ss_sales_price#6))#21,17,2) AS sum_sales#22, MakeDecimal(sum(UnscaledValue(ss_sales_price#6))#21,17,2) AS _w0#23] + +(25) Exchange +Input [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, _w0#23] +Arguments: hashpartitioning(i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, 5), ENSURE_REQUIREMENTS, [id=#24] + +(26) Sort [codegen id : 6] +Input [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, _w0#23] +Arguments: [i_category#3 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST, s_company_name#16 ASC NULLS FIRST, d_year#11 ASC NULLS FIRST], false, 0 + +(27) Window +Input [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, _w0#23] +Arguments: [avg(_w0#23) windowspecdefinition(i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#25], [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11] + +(28) Project [codegen id : 7] +Output [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Input [9]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, _w0#23, avg_monthly_sales#25] + +(29) Exchange +Input [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Arguments: hashpartitioning(i_category#3, i_brand#2, s_store_name#15, s_company_name#16, 5), ENSURE_REQUIREMENTS, [id=#26] + +(30) Sort [codegen id : 8] +Input [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Arguments: [i_category#3 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, s_store_name#15 ASC NULLS FIRST, s_company_name#16 ASC NULLS FIRST, d_year#11 ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST], false, 0 + +(31) Window +Input [8]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25] +Arguments: [rank(d_year#11, d_moy#12) windowspecdefinition(i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11 ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#27], [i_category#3, i_brand#2, s_store_name#15, s_company_name#16], [d_year#11 ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST] + +(32) Filter [codegen id : 23] +Input [9]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25, rn#27] +Condition : ((((isnotnull(d_year#11) AND isnotnull(avg_monthly_sales#25)) AND (d_year#11 = 1999)) AND (avg_monthly_sales#25 > 0.000000)) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)) + +(33) ReusedExchange [Reuses operator id: unknown] +Output [7]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, sum#34] + +(34) HashAggregate [codegen id : 13] +Input [7]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, sum#34] +Keys [6]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33] +Functions [1]: [sum(UnscaledValue(ss_sales_price#35))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#35))#36] +Results [7]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, MakeDecimal(sum(UnscaledValue(ss_sales_price#35))#36,17,2) AS sum_sales#37] + +(35) Exchange +Input [7]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, sum_sales#37] +Arguments: hashpartitioning(i_category#28, i_brand#29, s_store_name#30, s_company_name#31, 5), ENSURE_REQUIREMENTS, [id=#38] + +(36) Sort [codegen id : 14] +Input [7]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, sum_sales#37] +Arguments: [i_category#28 ASC NULLS FIRST, i_brand#29 ASC NULLS FIRST, s_store_name#30 ASC NULLS FIRST, s_company_name#31 ASC NULLS FIRST, d_year#32 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST], false, 0 + +(37) Window +Input [7]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, sum_sales#37] +Arguments: [rank(d_year#32, d_moy#33) windowspecdefinition(i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#39], [i_category#28, i_brand#29, s_store_name#30, s_company_name#31], [d_year#32 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST] + +(38) Project [codegen id : 15] +Output [6]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, sum_sales#37, rn#39] +Input [8]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, d_year#32, d_moy#33, sum_sales#37, rn#39] + +(39) BroadcastExchange +Input [6]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, sum_sales#37, rn#39] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true], input[1, string, true], input[2, string, true], input[3, string, true], (input[5, int, false] + 1)),false), [id=#40] + +(40) BroadcastHashJoin [codegen id : 23] +Left keys [5]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, rn#27] +Right keys [5]: [i_category#28, i_brand#29, s_store_name#30, s_company_name#31, (rn#39 + 1)] +Join condition: None + +(41) Project [codegen id : 23] +Output [10]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25, rn#27, sum_sales#37] +Input [15]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25, rn#27, i_category#28, i_brand#29, s_store_name#30, s_company_name#31, sum_sales#37, rn#39] + +(42) ReusedExchange [Reuses operator id: 35] +Output [7]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, d_year#45, d_moy#46, sum_sales#47] + +(43) Sort [codegen id : 21] +Input [7]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, d_year#45, d_moy#46, sum_sales#47] +Arguments: [i_category#41 ASC NULLS FIRST, i_brand#42 ASC NULLS FIRST, s_store_name#43 ASC NULLS FIRST, s_company_name#44 ASC NULLS FIRST, d_year#45 ASC NULLS FIRST, d_moy#46 ASC NULLS FIRST], false, 0 + +(44) Window +Input [7]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, d_year#45, d_moy#46, sum_sales#47] +Arguments: [rank(d_year#45, d_moy#46) windowspecdefinition(i_category#41, i_brand#42, s_store_name#43, s_company_name#44, d_year#45 ASC NULLS FIRST, d_moy#46 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#48], [i_category#41, i_brand#42, s_store_name#43, s_company_name#44], [d_year#45 ASC NULLS FIRST, d_moy#46 ASC NULLS FIRST] + +(45) Project [codegen id : 22] +Output [6]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, sum_sales#47, rn#48] +Input [8]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, d_year#45, d_moy#46, sum_sales#47, rn#48] + +(46) BroadcastExchange +Input [6]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, sum_sales#47, rn#48] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true], input[1, string, true], input[2, string, true], input[3, string, true], (input[5, int, false] - 1)),false), [id=#49] + +(47) BroadcastHashJoin [codegen id : 23] +Left keys [5]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, rn#27] +Right keys [5]: [i_category#41, i_brand#42, s_store_name#43, s_company_name#44, (rn#48 - 1)] +Join condition: None + +(48) Project [codegen id : 23] +Output [7]: [i_category#3, d_year#11, d_moy#12, avg_monthly_sales#25, sum_sales#22, sum_sales#37 AS psum#50, sum_sales#47 AS nsum#51] +Input [16]: [i_category#3, i_brand#2, s_store_name#15, s_company_name#16, d_year#11, d_moy#12, sum_sales#22, avg_monthly_sales#25, rn#27, sum_sales#37, i_category#41, i_brand#42, s_store_name#43, s_company_name#44, sum_sales#47, rn#48] + +(49) TakeOrderedAndProject +Input [7]: [i_category#3, d_year#11, d_moy#12, avg_monthly_sales#25, sum_sales#22, psum#50, nsum#51] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST], [i_category#3, d_year#11, d_moy#12, avg_monthly_sales#25, sum_sales#22, psum#50, nsum#51] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (50) + + +(50) ReusedExchange [Reuses operator id: 13] +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q47/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q47/simplified.txt new file mode 100644 index 0000000000000..d649a3b21237d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q47/simplified.txt @@ -0,0 +1,84 @@ +TakeOrderedAndProject [sum_sales,avg_monthly_sales,d_moy,i_category,d_year,psum,nsum] + WholeStageCodegen (23) + Project [i_category,d_year,d_moy,avg_monthly_sales,sum_sales,sum_sales,sum_sales] + BroadcastHashJoin [i_category,i_brand,s_store_name,s_company_name,rn,i_category,i_brand,s_store_name,s_company_name,rn] + Project [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum_sales,avg_monthly_sales,rn,sum_sales] + BroadcastHashJoin [i_category,i_brand,s_store_name,s_company_name,rn,i_category,i_brand,s_store_name,s_company_name,rn] + Filter [d_year,avg_monthly_sales,sum_sales] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (8) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name] #1 + WholeStageCodegen (7) + Project [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum_sales,avg_monthly_sales] + InputAdapter + Window [_w0,i_category,i_brand,s_store_name,s_company_name,d_year] + WholeStageCodegen (6) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,d_year] #2 + WholeStageCodegen (5) + HashAggregate [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] #3 + WholeStageCodegen (4) + HashAggregate [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,ss_sales_price] [sum,sum] + Project [i_brand,i_category,ss_sales_price,d_year,d_moy,s_store_name,s_company_name] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [i_brand,i_category,ss_store_sk,ss_sales_price,d_year,d_moy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [i_brand,i_category,ss_store_sk,ss_sales_price,ss_sold_date_sk] + BroadcastHashJoin [i_item_sk,ss_item_sk] + Filter [i_item_sk,i_category,i_brand] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Filter [s_store_sk,s_store_name,s_company_name] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_company_name] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (15) + Project [i_category,i_brand,s_store_name,s_company_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (14) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,s_store_name,s_company_name] #8 + WholeStageCodegen (13) + HashAggregate [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum] [sum(UnscaledValue(ss_sales_price)),sum_sales,sum] + InputAdapter + ReusedExchange [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum] #9 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (22) + Project [i_category,i_brand,s_store_name,s_company_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,s_store_name,s_company_name] + WholeStageCodegen (21) + Sort [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy] + InputAdapter + ReusedExchange [i_category,i_brand,s_store_name,s_company_name,d_year,d_moy,sum_sales] #8 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt new file mode 100644 index 0000000000000..b7c20b4826bb6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/explain.txt @@ -0,0 +1,510 @@ +== Physical Plan == +TakeOrderedAndProject (90) ++- * HashAggregate (89) + +- Exchange (88) + +- * HashAggregate (87) + +- Union (86) + :- * Project (31) + : +- * Filter (30) + : +- Window (29) + : +- * Sort (28) + : +- Window (27) + : +- * Sort (26) + : +- Exchange (25) + : +- * HashAggregate (24) + : +- Exchange (23) + : +- * HashAggregate (22) + : +- * Project (21) + : +- * SortMergeJoin Inner (20) + : :- * Sort (13) + : : +- Exchange (12) + : : +- * Project (11) + : : +- * BroadcastHashJoin Inner BuildRight (10) + : : :- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.web_sales (1) + : : +- BroadcastExchange (9) + : : +- * Project (8) + : : +- * Filter (7) + : : +- * ColumnarToRow (6) + : : +- Scan parquet default.date_dim (5) + : +- * Sort (19) + : +- Exchange (18) + : +- * Project (17) + : +- * Filter (16) + : +- * ColumnarToRow (15) + : +- Scan parquet default.web_returns (14) + :- * Project (58) + : +- * Filter (57) + : +- Window (56) + : +- * Sort (55) + : +- Window (54) + : +- * Sort (53) + : +- Exchange (52) + : +- * HashAggregate (51) + : +- Exchange (50) + : +- * HashAggregate (49) + : +- * Project (48) + : +- * SortMergeJoin Inner (47) + : :- * Sort (40) + : : +- Exchange (39) + : : +- * Project (38) + : : +- * BroadcastHashJoin Inner BuildRight (37) + : : :- * Project (35) + : : : +- * Filter (34) + : : : +- * ColumnarToRow (33) + : : : +- Scan parquet default.catalog_sales (32) + : : +- ReusedExchange (36) + : +- * Sort (46) + : +- Exchange (45) + : +- * Project (44) + : +- * Filter (43) + : +- * ColumnarToRow (42) + : +- Scan parquet default.catalog_returns (41) + +- * Project (85) + +- * Filter (84) + +- Window (83) + +- * Sort (82) + +- Window (81) + +- * Sort (80) + +- Exchange (79) + +- * HashAggregate (78) + +- Exchange (77) + +- * HashAggregate (76) + +- * Project (75) + +- * SortMergeJoin Inner (74) + :- * Sort (67) + : +- Exchange (66) + : +- * Project (65) + : +- * BroadcastHashJoin Inner BuildRight (64) + : :- * Project (62) + : : +- * Filter (61) + : : +- * ColumnarToRow (60) + : : +- Scan parquet default.store_sales (59) + : +- ReusedExchange (63) + +- * Sort (73) + +- Exchange (72) + +- * Project (71) + +- * Filter (70) + +- * ColumnarToRow (69) + +- Scan parquet default.store_returns (68) + + +(1) Scan parquet default.web_sales +Output [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#6), dynamicpruningexpression(ws_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ws_net_profit), IsNotNull(ws_net_paid), IsNotNull(ws_quantity), GreaterThan(ws_net_profit,1.00), GreaterThan(ws_net_paid,0.00), GreaterThan(ws_quantity,0), IsNotNull(ws_order_number), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] + +(3) Filter [codegen id : 2] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] +Condition : (((((((isnotnull(ws_net_profit#5) AND isnotnull(ws_net_paid#4)) AND isnotnull(ws_quantity#3)) AND (ws_net_profit#5 > 1.00)) AND (ws_net_paid#4 > 0.00)) AND (ws_quantity#3 > 0)) AND isnotnull(ws_order_number#2)) AND isnotnull(ws_item_sk#1)) + +(4) Project [codegen id : 2] +Output [5]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] + +(5) Scan parquet default.date_dim +Output [3]: [d_date_sk#8, d_year#9, d_moy#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,12), IsNotNull(d_date_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(7) Filter [codegen id : 1] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] +Condition : ((((isnotnull(d_year#9) AND isnotnull(d_moy#10)) AND (d_year#9 = 2001)) AND (d_moy#10 = 12)) AND isnotnull(d_date_sk#8)) + +(8) Project [codegen id : 1] +Output [1]: [d_date_sk#8] +Input [3]: [d_date_sk#8, d_year#9, d_moy#10] + +(9) BroadcastExchange +Input [1]: [d_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#11] + +(10) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ws_sold_date_sk#6] +Right keys [1]: [d_date_sk#8] +Join condition: None + +(11) Project [codegen id : 2] +Output [4]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6, d_date_sk#8] + +(12) Exchange +Input [4]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4] +Arguments: hashpartitioning(ws_order_number#2, ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#12] + +(13) Sort [codegen id : 3] +Input [4]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4] +Arguments: [ws_order_number#2 ASC NULLS FIRST, ws_item_sk#1 ASC NULLS FIRST], false, 0 + +(14) Scan parquet default.web_returns +Output [5]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16, wr_returned_date_sk#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_return_amt), GreaterThan(wr_return_amt,10000.00), IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 4] +Input [5]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16, wr_returned_date_sk#17] + +(16) Filter [codegen id : 4] +Input [5]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16, wr_returned_date_sk#17] +Condition : (((isnotnull(wr_return_amt#16) AND (wr_return_amt#16 > 10000.00)) AND isnotnull(wr_order_number#14)) AND isnotnull(wr_item_sk#13)) + +(17) Project [codegen id : 4] +Output [4]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16] +Input [5]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16, wr_returned_date_sk#17] + +(18) Exchange +Input [4]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16] +Arguments: hashpartitioning(wr_order_number#14, wr_item_sk#13, 5), ENSURE_REQUIREMENTS, [id=#18] + +(19) Sort [codegen id : 5] +Input [4]: [wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16] +Arguments: [wr_order_number#14 ASC NULLS FIRST, wr_item_sk#13 ASC NULLS FIRST], false, 0 + +(20) SortMergeJoin [codegen id : 6] +Left keys [2]: [ws_order_number#2, ws_item_sk#1] +Right keys [2]: [wr_order_number#14, wr_item_sk#13] +Join condition: None + +(21) Project [codegen id : 6] +Output [5]: [ws_item_sk#1, ws_quantity#3, ws_net_paid#4, wr_return_quantity#15, wr_return_amt#16] +Input [8]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, wr_item_sk#13, wr_order_number#14, wr_return_quantity#15, wr_return_amt#16] + +(22) HashAggregate [codegen id : 6] +Input [5]: [ws_item_sk#1, ws_quantity#3, ws_net_paid#4, wr_return_quantity#15, wr_return_amt#16] +Keys [1]: [ws_item_sk#1] +Functions [4]: [partial_sum(coalesce(wr_return_quantity#15, 0)), partial_sum(coalesce(ws_quantity#3, 0)), partial_sum(coalesce(cast(wr_return_amt#16 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))] +Aggregate Attributes [6]: [sum#19, sum#20, sum#21, isEmpty#22, sum#23, isEmpty#24] +Results [7]: [ws_item_sk#1, sum#25, sum#26, sum#27, isEmpty#28, sum#29, isEmpty#30] + +(23) Exchange +Input [7]: [ws_item_sk#1, sum#25, sum#26, sum#27, isEmpty#28, sum#29, isEmpty#30] +Arguments: hashpartitioning(ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#31] + +(24) HashAggregate [codegen id : 7] +Input [7]: [ws_item_sk#1, sum#25, sum#26, sum#27, isEmpty#28, sum#29, isEmpty#30] +Keys [1]: [ws_item_sk#1] +Functions [4]: [sum(coalesce(wr_return_quantity#15, 0)), sum(coalesce(ws_quantity#3, 0)), sum(coalesce(cast(wr_return_amt#16 as decimal(12,2)), 0.00)), sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(coalesce(wr_return_quantity#15, 0))#32, sum(coalesce(ws_quantity#3, 0))#33, sum(coalesce(cast(wr_return_amt#16 as decimal(12,2)), 0.00))#34, sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))#35] +Results [3]: [ws_item_sk#1 AS item#36, CheckOverflow((promote_precision(cast(sum(coalesce(wr_return_quantity#15, 0))#32 as decimal(15,4))) / promote_precision(cast(sum(coalesce(ws_quantity#3, 0))#33 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#37, CheckOverflow((promote_precision(cast(sum(coalesce(cast(wr_return_amt#16 as decimal(12,2)), 0.00))#34 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))#35 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#38] + +(25) Exchange +Input [3]: [item#36, return_ratio#37, currency_ratio#38] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#39] + +(26) Sort [codegen id : 8] +Input [3]: [item#36, return_ratio#37, currency_ratio#38] +Arguments: [return_ratio#37 ASC NULLS FIRST], false, 0 + +(27) Window +Input [3]: [item#36, return_ratio#37, currency_ratio#38] +Arguments: [rank(return_ratio#37) windowspecdefinition(return_ratio#37 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS return_rank#40], [return_ratio#37 ASC NULLS FIRST] + +(28) Sort [codegen id : 9] +Input [4]: [item#36, return_ratio#37, currency_ratio#38, return_rank#40] +Arguments: [currency_ratio#38 ASC NULLS FIRST], false, 0 + +(29) Window +Input [4]: [item#36, return_ratio#37, currency_ratio#38, return_rank#40] +Arguments: [rank(currency_ratio#38) windowspecdefinition(currency_ratio#38 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS currency_rank#41], [currency_ratio#38 ASC NULLS FIRST] + +(30) Filter [codegen id : 10] +Input [5]: [item#36, return_ratio#37, currency_ratio#38, return_rank#40, currency_rank#41] +Condition : ((return_rank#40 <= 10) OR (currency_rank#41 <= 10)) + +(31) Project [codegen id : 10] +Output [5]: [web AS channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Input [5]: [item#36, return_ratio#37, currency_ratio#38, return_rank#40, currency_rank#41] + +(32) Scan parquet default.catalog_sales +Output [6]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cs_net_profit#47, cs_sold_date_sk#48] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#48), dynamicpruningexpression(cs_sold_date_sk#48 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(cs_net_profit), IsNotNull(cs_net_paid), IsNotNull(cs_quantity), GreaterThan(cs_net_profit,1.00), GreaterThan(cs_net_paid,0.00), GreaterThan(cs_quantity,0), IsNotNull(cs_order_number), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(33) ColumnarToRow [codegen id : 12] +Input [6]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cs_net_profit#47, cs_sold_date_sk#48] + +(34) Filter [codegen id : 12] +Input [6]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cs_net_profit#47, cs_sold_date_sk#48] +Condition : (((((((isnotnull(cs_net_profit#47) AND isnotnull(cs_net_paid#46)) AND isnotnull(cs_quantity#45)) AND (cs_net_profit#47 > 1.00)) AND (cs_net_paid#46 > 0.00)) AND (cs_quantity#45 > 0)) AND isnotnull(cs_order_number#44)) AND isnotnull(cs_item_sk#43)) + +(35) Project [codegen id : 12] +Output [5]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cs_sold_date_sk#48] +Input [6]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cs_net_profit#47, cs_sold_date_sk#48] + +(36) ReusedExchange [Reuses operator id: 9] +Output [1]: [d_date_sk#49] + +(37) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [cs_sold_date_sk#48] +Right keys [1]: [d_date_sk#49] +Join condition: None + +(38) Project [codegen id : 12] +Output [4]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46] +Input [6]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cs_sold_date_sk#48, d_date_sk#49] + +(39) Exchange +Input [4]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46] +Arguments: hashpartitioning(cs_order_number#44, cs_item_sk#43, 5), ENSURE_REQUIREMENTS, [id=#50] + +(40) Sort [codegen id : 13] +Input [4]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46] +Arguments: [cs_order_number#44 ASC NULLS FIRST, cs_item_sk#43 ASC NULLS FIRST], false, 0 + +(41) Scan parquet default.catalog_returns +Output [5]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54, cr_returned_date_sk#55] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_return_amount), GreaterThan(cr_return_amount,10000.00), IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(42) ColumnarToRow [codegen id : 14] +Input [5]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54, cr_returned_date_sk#55] + +(43) Filter [codegen id : 14] +Input [5]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54, cr_returned_date_sk#55] +Condition : (((isnotnull(cr_return_amount#54) AND (cr_return_amount#54 > 10000.00)) AND isnotnull(cr_order_number#52)) AND isnotnull(cr_item_sk#51)) + +(44) Project [codegen id : 14] +Output [4]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54] +Input [5]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54, cr_returned_date_sk#55] + +(45) Exchange +Input [4]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54] +Arguments: hashpartitioning(cr_order_number#52, cr_item_sk#51, 5), ENSURE_REQUIREMENTS, [id=#56] + +(46) Sort [codegen id : 15] +Input [4]: [cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54] +Arguments: [cr_order_number#52 ASC NULLS FIRST, cr_item_sk#51 ASC NULLS FIRST], false, 0 + +(47) SortMergeJoin [codegen id : 16] +Left keys [2]: [cs_order_number#44, cs_item_sk#43] +Right keys [2]: [cr_order_number#52, cr_item_sk#51] +Join condition: None + +(48) Project [codegen id : 16] +Output [5]: [cs_item_sk#43, cs_quantity#45, cs_net_paid#46, cr_return_quantity#53, cr_return_amount#54] +Input [8]: [cs_item_sk#43, cs_order_number#44, cs_quantity#45, cs_net_paid#46, cr_item_sk#51, cr_order_number#52, cr_return_quantity#53, cr_return_amount#54] + +(49) HashAggregate [codegen id : 16] +Input [5]: [cs_item_sk#43, cs_quantity#45, cs_net_paid#46, cr_return_quantity#53, cr_return_amount#54] +Keys [1]: [cs_item_sk#43] +Functions [4]: [partial_sum(coalesce(cr_return_quantity#53, 0)), partial_sum(coalesce(cs_quantity#45, 0)), partial_sum(coalesce(cast(cr_return_amount#54 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(cs_net_paid#46 as decimal(12,2)), 0.00))] +Aggregate Attributes [6]: [sum#57, sum#58, sum#59, isEmpty#60, sum#61, isEmpty#62] +Results [7]: [cs_item_sk#43, sum#63, sum#64, sum#65, isEmpty#66, sum#67, isEmpty#68] + +(50) Exchange +Input [7]: [cs_item_sk#43, sum#63, sum#64, sum#65, isEmpty#66, sum#67, isEmpty#68] +Arguments: hashpartitioning(cs_item_sk#43, 5), ENSURE_REQUIREMENTS, [id=#69] + +(51) HashAggregate [codegen id : 17] +Input [7]: [cs_item_sk#43, sum#63, sum#64, sum#65, isEmpty#66, sum#67, isEmpty#68] +Keys [1]: [cs_item_sk#43] +Functions [4]: [sum(coalesce(cr_return_quantity#53, 0)), sum(coalesce(cs_quantity#45, 0)), sum(coalesce(cast(cr_return_amount#54 as decimal(12,2)), 0.00)), sum(coalesce(cast(cs_net_paid#46 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(coalesce(cr_return_quantity#53, 0))#70, sum(coalesce(cs_quantity#45, 0))#71, sum(coalesce(cast(cr_return_amount#54 as decimal(12,2)), 0.00))#72, sum(coalesce(cast(cs_net_paid#46 as decimal(12,2)), 0.00))#73] +Results [3]: [cs_item_sk#43 AS item#74, CheckOverflow((promote_precision(cast(sum(coalesce(cr_return_quantity#53, 0))#70 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cs_quantity#45, 0))#71 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#75, CheckOverflow((promote_precision(cast(sum(coalesce(cast(cr_return_amount#54 as decimal(12,2)), 0.00))#72 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(cs_net_paid#46 as decimal(12,2)), 0.00))#73 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#76] + +(52) Exchange +Input [3]: [item#74, return_ratio#75, currency_ratio#76] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#77] + +(53) Sort [codegen id : 18] +Input [3]: [item#74, return_ratio#75, currency_ratio#76] +Arguments: [return_ratio#75 ASC NULLS FIRST], false, 0 + +(54) Window +Input [3]: [item#74, return_ratio#75, currency_ratio#76] +Arguments: [rank(return_ratio#75) windowspecdefinition(return_ratio#75 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS return_rank#78], [return_ratio#75 ASC NULLS FIRST] + +(55) Sort [codegen id : 19] +Input [4]: [item#74, return_ratio#75, currency_ratio#76, return_rank#78] +Arguments: [currency_ratio#76 ASC NULLS FIRST], false, 0 + +(56) Window +Input [4]: [item#74, return_ratio#75, currency_ratio#76, return_rank#78] +Arguments: [rank(currency_ratio#76) windowspecdefinition(currency_ratio#76 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS currency_rank#79], [currency_ratio#76 ASC NULLS FIRST] + +(57) Filter [codegen id : 20] +Input [5]: [item#74, return_ratio#75, currency_ratio#76, return_rank#78, currency_rank#79] +Condition : ((return_rank#78 <= 10) OR (currency_rank#79 <= 10)) + +(58) Project [codegen id : 20] +Output [5]: [catalog AS channel#80, item#74, return_ratio#75, return_rank#78, currency_rank#79] +Input [5]: [item#74, return_ratio#75, currency_ratio#76, return_rank#78, currency_rank#79] + +(59) Scan parquet default.store_sales +Output [6]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, ss_net_profit#85, ss_sold_date_sk#86] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#86), dynamicpruningexpression(ss_sold_date_sk#86 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_net_profit), IsNotNull(ss_net_paid), IsNotNull(ss_quantity), GreaterThan(ss_net_profit,1.00), GreaterThan(ss_net_paid,0.00), GreaterThan(ss_quantity,0), IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(60) ColumnarToRow [codegen id : 22] +Input [6]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, ss_net_profit#85, ss_sold_date_sk#86] + +(61) Filter [codegen id : 22] +Input [6]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, ss_net_profit#85, ss_sold_date_sk#86] +Condition : (((((((isnotnull(ss_net_profit#85) AND isnotnull(ss_net_paid#84)) AND isnotnull(ss_quantity#83)) AND (ss_net_profit#85 > 1.00)) AND (ss_net_paid#84 > 0.00)) AND (ss_quantity#83 > 0)) AND isnotnull(ss_ticket_number#82)) AND isnotnull(ss_item_sk#81)) + +(62) Project [codegen id : 22] +Output [5]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, ss_sold_date_sk#86] +Input [6]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, ss_net_profit#85, ss_sold_date_sk#86] + +(63) ReusedExchange [Reuses operator id: 9] +Output [1]: [d_date_sk#87] + +(64) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [ss_sold_date_sk#86] +Right keys [1]: [d_date_sk#87] +Join condition: None + +(65) Project [codegen id : 22] +Output [4]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84] +Input [6]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, ss_sold_date_sk#86, d_date_sk#87] + +(66) Exchange +Input [4]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84] +Arguments: hashpartitioning(ss_ticket_number#82, ss_item_sk#81, 5), ENSURE_REQUIREMENTS, [id=#88] + +(67) Sort [codegen id : 23] +Input [4]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84] +Arguments: [ss_ticket_number#82 ASC NULLS FIRST, ss_item_sk#81 ASC NULLS FIRST], false, 0 + +(68) Scan parquet default.store_returns +Output [5]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92, sr_returned_date_sk#93] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_return_amt), GreaterThan(sr_return_amt,10000.00), IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(69) ColumnarToRow [codegen id : 24] +Input [5]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92, sr_returned_date_sk#93] + +(70) Filter [codegen id : 24] +Input [5]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92, sr_returned_date_sk#93] +Condition : (((isnotnull(sr_return_amt#92) AND (sr_return_amt#92 > 10000.00)) AND isnotnull(sr_ticket_number#90)) AND isnotnull(sr_item_sk#89)) + +(71) Project [codegen id : 24] +Output [4]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92] +Input [5]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92, sr_returned_date_sk#93] + +(72) Exchange +Input [4]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92] +Arguments: hashpartitioning(sr_ticket_number#90, sr_item_sk#89, 5), ENSURE_REQUIREMENTS, [id=#94] + +(73) Sort [codegen id : 25] +Input [4]: [sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92] +Arguments: [sr_ticket_number#90 ASC NULLS FIRST, sr_item_sk#89 ASC NULLS FIRST], false, 0 + +(74) SortMergeJoin [codegen id : 26] +Left keys [2]: [ss_ticket_number#82, ss_item_sk#81] +Right keys [2]: [sr_ticket_number#90, sr_item_sk#89] +Join condition: None + +(75) Project [codegen id : 26] +Output [5]: [ss_item_sk#81, ss_quantity#83, ss_net_paid#84, sr_return_quantity#91, sr_return_amt#92] +Input [8]: [ss_item_sk#81, ss_ticket_number#82, ss_quantity#83, ss_net_paid#84, sr_item_sk#89, sr_ticket_number#90, sr_return_quantity#91, sr_return_amt#92] + +(76) HashAggregate [codegen id : 26] +Input [5]: [ss_item_sk#81, ss_quantity#83, ss_net_paid#84, sr_return_quantity#91, sr_return_amt#92] +Keys [1]: [ss_item_sk#81] +Functions [4]: [partial_sum(coalesce(sr_return_quantity#91, 0)), partial_sum(coalesce(ss_quantity#83, 0)), partial_sum(coalesce(cast(sr_return_amt#92 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(ss_net_paid#84 as decimal(12,2)), 0.00))] +Aggregate Attributes [6]: [sum#95, sum#96, sum#97, isEmpty#98, sum#99, isEmpty#100] +Results [7]: [ss_item_sk#81, sum#101, sum#102, sum#103, isEmpty#104, sum#105, isEmpty#106] + +(77) Exchange +Input [7]: [ss_item_sk#81, sum#101, sum#102, sum#103, isEmpty#104, sum#105, isEmpty#106] +Arguments: hashpartitioning(ss_item_sk#81, 5), ENSURE_REQUIREMENTS, [id=#107] + +(78) HashAggregate [codegen id : 27] +Input [7]: [ss_item_sk#81, sum#101, sum#102, sum#103, isEmpty#104, sum#105, isEmpty#106] +Keys [1]: [ss_item_sk#81] +Functions [4]: [sum(coalesce(sr_return_quantity#91, 0)), sum(coalesce(ss_quantity#83, 0)), sum(coalesce(cast(sr_return_amt#92 as decimal(12,2)), 0.00)), sum(coalesce(cast(ss_net_paid#84 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(coalesce(sr_return_quantity#91, 0))#108, sum(coalesce(ss_quantity#83, 0))#109, sum(coalesce(cast(sr_return_amt#92 as decimal(12,2)), 0.00))#110, sum(coalesce(cast(ss_net_paid#84 as decimal(12,2)), 0.00))#111] +Results [3]: [ss_item_sk#81 AS item#112, CheckOverflow((promote_precision(cast(sum(coalesce(sr_return_quantity#91, 0))#108 as decimal(15,4))) / promote_precision(cast(sum(coalesce(ss_quantity#83, 0))#109 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#113, CheckOverflow((promote_precision(cast(sum(coalesce(cast(sr_return_amt#92 as decimal(12,2)), 0.00))#110 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(ss_net_paid#84 as decimal(12,2)), 0.00))#111 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#114] + +(79) Exchange +Input [3]: [item#112, return_ratio#113, currency_ratio#114] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#115] + +(80) Sort [codegen id : 28] +Input [3]: [item#112, return_ratio#113, currency_ratio#114] +Arguments: [return_ratio#113 ASC NULLS FIRST], false, 0 + +(81) Window +Input [3]: [item#112, return_ratio#113, currency_ratio#114] +Arguments: [rank(return_ratio#113) windowspecdefinition(return_ratio#113 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS return_rank#116], [return_ratio#113 ASC NULLS FIRST] + +(82) Sort [codegen id : 29] +Input [4]: [item#112, return_ratio#113, currency_ratio#114, return_rank#116] +Arguments: [currency_ratio#114 ASC NULLS FIRST], false, 0 + +(83) Window +Input [4]: [item#112, return_ratio#113, currency_ratio#114, return_rank#116] +Arguments: [rank(currency_ratio#114) windowspecdefinition(currency_ratio#114 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS currency_rank#117], [currency_ratio#114 ASC NULLS FIRST] + +(84) Filter [codegen id : 30] +Input [5]: [item#112, return_ratio#113, currency_ratio#114, return_rank#116, currency_rank#117] +Condition : ((return_rank#116 <= 10) OR (currency_rank#117 <= 10)) + +(85) Project [codegen id : 30] +Output [5]: [store AS channel#118, item#112, return_ratio#113, return_rank#116, currency_rank#117] +Input [5]: [item#112, return_ratio#113, currency_ratio#114, return_rank#116, currency_rank#117] + +(86) Union + +(87) HashAggregate [codegen id : 31] +Input [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Keys [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] + +(88) Exchange +Input [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Arguments: hashpartitioning(channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41, 5), ENSURE_REQUIREMENTS, [id=#119] + +(89) HashAggregate [codegen id : 32] +Input [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Keys [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] + +(90) TakeOrderedAndProject +Input [5]: [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] +Arguments: 100, [channel#42 ASC NULLS FIRST, return_rank#40 ASC NULLS FIRST, currency_rank#41 ASC NULLS FIRST, item#36 ASC NULLS FIRST], [channel#42, item#36, return_ratio#37, return_rank#40, currency_rank#41] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (91) + + +(91) ReusedExchange [Reuses operator id: 9] +Output [1]: [d_date_sk#8] + +Subquery:2 Hosting operator id = 32 Hosting Expression = cs_sold_date_sk#48 IN dynamicpruning#7 + +Subquery:3 Hosting operator id = 59 Hosting Expression = ss_sold_date_sk#86 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/simplified.txt new file mode 100644 index 0000000000000..60d16f8b606af --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49.sf100/simplified.txt @@ -0,0 +1,160 @@ +TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] + WholeStageCodegen (32) + HashAggregate [channel,item,return_ratio,return_rank,currency_rank] + InputAdapter + Exchange [channel,item,return_ratio,return_rank,currency_rank] #1 + WholeStageCodegen (31) + HashAggregate [channel,item,return_ratio,return_rank,currency_rank] + InputAdapter + Union + WholeStageCodegen (10) + Project [item,return_ratio,return_rank,currency_rank] + Filter [return_rank,currency_rank] + InputAdapter + Window [currency_ratio] + WholeStageCodegen (9) + Sort [currency_ratio] + InputAdapter + Window [return_ratio] + WholeStageCodegen (8) + Sort [return_ratio] + InputAdapter + Exchange #2 + WholeStageCodegen (7) + HashAggregate [ws_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(wr_return_quantity, 0)),sum(coalesce(ws_quantity, 0)),sum(coalesce(cast(wr_return_amt as decimal(12,2)), 0.00)),sum(coalesce(cast(ws_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (6) + HashAggregate [ws_item_sk,wr_return_quantity,ws_quantity,wr_return_amt,ws_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty] + Project [ws_item_sk,ws_quantity,ws_net_paid,wr_return_quantity,wr_return_amt] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #4 + WholeStageCodegen (2) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_sold_date_sk] + Filter [ws_net_profit,ws_net_paid,ws_quantity,ws_order_number,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_net_profit,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + WholeStageCodegen (5) + Sort [wr_order_number,wr_item_sk] + InputAdapter + Exchange [wr_order_number,wr_item_sk] #6 + WholeStageCodegen (4) + Project [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt] + Filter [wr_return_amt,wr_order_number,wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt,wr_returned_date_sk] + WholeStageCodegen (20) + Project [item,return_ratio,return_rank,currency_rank] + Filter [return_rank,currency_rank] + InputAdapter + Window [currency_ratio] + WholeStageCodegen (19) + Sort [currency_ratio] + InputAdapter + Window [return_ratio] + WholeStageCodegen (18) + Sort [return_ratio] + InputAdapter + Exchange #7 + WholeStageCodegen (17) + HashAggregate [cs_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(cr_return_quantity, 0)),sum(coalesce(cs_quantity, 0)),sum(coalesce(cast(cr_return_amount as decimal(12,2)), 0.00)),sum(coalesce(cast(cs_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [cs_item_sk] #8 + WholeStageCodegen (16) + HashAggregate [cs_item_sk,cr_return_quantity,cs_quantity,cr_return_amount,cs_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty] + Project [cs_item_sk,cs_quantity,cs_net_paid,cr_return_quantity,cr_return_amount] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (13) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #9 + WholeStageCodegen (12) + Project [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid,cs_sold_date_sk] + Filter [cs_net_profit,cs_net_paid,cs_quantity,cs_order_number,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + WholeStageCodegen (15) + Sort [cr_order_number,cr_item_sk] + InputAdapter + Exchange [cr_order_number,cr_item_sk] #10 + WholeStageCodegen (14) + Project [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount] + Filter [cr_return_amount,cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount,cr_returned_date_sk] + WholeStageCodegen (30) + Project [item,return_ratio,return_rank,currency_rank] + Filter [return_rank,currency_rank] + InputAdapter + Window [currency_ratio] + WholeStageCodegen (29) + Sort [currency_ratio] + InputAdapter + Window [return_ratio] + WholeStageCodegen (28) + Sort [return_ratio] + InputAdapter + Exchange #11 + WholeStageCodegen (27) + HashAggregate [ss_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(sr_return_quantity, 0)),sum(coalesce(ss_quantity, 0)),sum(coalesce(cast(sr_return_amt as decimal(12,2)), 0.00)),sum(coalesce(cast(ss_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [ss_item_sk] #12 + WholeStageCodegen (26) + HashAggregate [ss_item_sk,sr_return_quantity,ss_quantity,sr_return_amt,ss_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty] + Project [ss_item_sk,ss_quantity,ss_net_paid,sr_return_quantity,sr_return_amt] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (23) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #13 + WholeStageCodegen (22) + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid,ss_sold_date_sk] + Filter [ss_net_profit,ss_net_paid,ss_quantity,ss_ticket_number,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid,ss_net_profit,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + WholeStageCodegen (25) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #14 + WholeStageCodegen (24) + Project [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt] + Filter [sr_return_amt,sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt,sr_returned_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt new file mode 100644 index 0000000000000..1665244594850 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/explain.txt @@ -0,0 +1,465 @@ +== Physical Plan == +TakeOrderedAndProject (81) ++- * HashAggregate (80) + +- Exchange (79) + +- * HashAggregate (78) + +- Union (77) + :- * Project (28) + : +- * Filter (27) + : +- Window (26) + : +- * Sort (25) + : +- Window (24) + : +- * Sort (23) + : +- Exchange (22) + : +- * HashAggregate (21) + : +- Exchange (20) + : +- * HashAggregate (19) + : +- * Project (18) + : +- * BroadcastHashJoin Inner BuildRight (17) + : :- * Project (11) + : : +- * BroadcastHashJoin Inner BuildLeft (10) + : : :- BroadcastExchange (5) + : : : +- * Project (4) + : : : +- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.web_sales (1) + : : +- * Project (9) + : : +- * Filter (8) + : : +- * ColumnarToRow (7) + : : +- Scan parquet default.web_returns (6) + : +- BroadcastExchange (16) + : +- * Project (15) + : +- * Filter (14) + : +- * ColumnarToRow (13) + : +- Scan parquet default.date_dim (12) + :- * Project (52) + : +- * Filter (51) + : +- Window (50) + : +- * Sort (49) + : +- Window (48) + : +- * Sort (47) + : +- Exchange (46) + : +- * HashAggregate (45) + : +- Exchange (44) + : +- * HashAggregate (43) + : +- * Project (42) + : +- * BroadcastHashJoin Inner BuildRight (41) + : :- * Project (39) + : : +- * BroadcastHashJoin Inner BuildLeft (38) + : : :- BroadcastExchange (33) + : : : +- * Project (32) + : : : +- * Filter (31) + : : : +- * ColumnarToRow (30) + : : : +- Scan parquet default.catalog_sales (29) + : : +- * Project (37) + : : +- * Filter (36) + : : +- * ColumnarToRow (35) + : : +- Scan parquet default.catalog_returns (34) + : +- ReusedExchange (40) + +- * Project (76) + +- * Filter (75) + +- Window (74) + +- * Sort (73) + +- Window (72) + +- * Sort (71) + +- Exchange (70) + +- * HashAggregate (69) + +- Exchange (68) + +- * HashAggregate (67) + +- * Project (66) + +- * BroadcastHashJoin Inner BuildRight (65) + :- * Project (63) + : +- * BroadcastHashJoin Inner BuildLeft (62) + : :- BroadcastExchange (57) + : : +- * Project (56) + : : +- * Filter (55) + : : +- * ColumnarToRow (54) + : : +- Scan parquet default.store_sales (53) + : +- * Project (61) + : +- * Filter (60) + : +- * ColumnarToRow (59) + : +- Scan parquet default.store_returns (58) + +- ReusedExchange (64) + + +(1) Scan parquet default.web_sales +Output [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#6), dynamicpruningexpression(ws_sold_date_sk#6 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ws_net_profit), IsNotNull(ws_net_paid), IsNotNull(ws_quantity), GreaterThan(ws_net_profit,1.00), GreaterThan(ws_net_paid,0.00), GreaterThan(ws_quantity,0), IsNotNull(ws_order_number), IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] + +(3) Filter [codegen id : 1] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] +Condition : (((((((isnotnull(ws_net_profit#5) AND isnotnull(ws_net_paid#4)) AND isnotnull(ws_quantity#3)) AND (ws_net_profit#5 > 1.00)) AND (ws_net_paid#4 > 0.00)) AND (ws_quantity#3 > 0)) AND isnotnull(ws_order_number#2)) AND isnotnull(ws_item_sk#1)) + +(4) Project [codegen id : 1] +Output [5]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6] +Input [6]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_net_profit#5, ws_sold_date_sk#6] + +(5) BroadcastExchange +Input [5]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [id=#8] + +(6) Scan parquet default.web_returns +Output [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_return_amt), GreaterThan(wr_return_amt,10000.00), IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow +Input [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] + +(8) Filter +Input [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] +Condition : (((isnotnull(wr_return_amt#12) AND (wr_return_amt#12 > 10000.00)) AND isnotnull(wr_order_number#10)) AND isnotnull(wr_item_sk#9)) + +(9) Project +Output [4]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12] +Input [5]: [wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12, wr_returned_date_sk#13] + +(10) BroadcastHashJoin [codegen id : 3] +Left keys [2]: [ws_order_number#2, ws_item_sk#1] +Right keys [2]: [wr_order_number#10, wr_item_sk#9] +Join condition: None + +(11) Project [codegen id : 3] +Output [6]: [ws_item_sk#1, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6, wr_return_quantity#11, wr_return_amt#12] +Input [9]: [ws_item_sk#1, ws_order_number#2, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6, wr_item_sk#9, wr_order_number#10, wr_return_quantity#11, wr_return_amt#12] + +(12) Scan parquet default.date_dim +Output [3]: [d_date_sk#14, d_year#15, d_moy#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2001), EqualTo(d_moy,12), IsNotNull(d_date_sk)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#14, d_year#15, d_moy#16] + +(14) Filter [codegen id : 2] +Input [3]: [d_date_sk#14, d_year#15, d_moy#16] +Condition : ((((isnotnull(d_year#15) AND isnotnull(d_moy#16)) AND (d_year#15 = 2001)) AND (d_moy#16 = 12)) AND isnotnull(d_date_sk#14)) + +(15) Project [codegen id : 2] +Output [1]: [d_date_sk#14] +Input [3]: [d_date_sk#14, d_year#15, d_moy#16] + +(16) BroadcastExchange +Input [1]: [d_date_sk#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#17] + +(17) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#6] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(18) Project [codegen id : 3] +Output [5]: [ws_item_sk#1, ws_quantity#3, ws_net_paid#4, wr_return_quantity#11, wr_return_amt#12] +Input [7]: [ws_item_sk#1, ws_quantity#3, ws_net_paid#4, ws_sold_date_sk#6, wr_return_quantity#11, wr_return_amt#12, d_date_sk#14] + +(19) HashAggregate [codegen id : 3] +Input [5]: [ws_item_sk#1, ws_quantity#3, ws_net_paid#4, wr_return_quantity#11, wr_return_amt#12] +Keys [1]: [ws_item_sk#1] +Functions [4]: [partial_sum(coalesce(wr_return_quantity#11, 0)), partial_sum(coalesce(ws_quantity#3, 0)), partial_sum(coalesce(cast(wr_return_amt#12 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))] +Aggregate Attributes [6]: [sum#18, sum#19, sum#20, isEmpty#21, sum#22, isEmpty#23] +Results [7]: [ws_item_sk#1, sum#24, sum#25, sum#26, isEmpty#27, sum#28, isEmpty#29] + +(20) Exchange +Input [7]: [ws_item_sk#1, sum#24, sum#25, sum#26, isEmpty#27, sum#28, isEmpty#29] +Arguments: hashpartitioning(ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#30] + +(21) HashAggregate [codegen id : 4] +Input [7]: [ws_item_sk#1, sum#24, sum#25, sum#26, isEmpty#27, sum#28, isEmpty#29] +Keys [1]: [ws_item_sk#1] +Functions [4]: [sum(coalesce(wr_return_quantity#11, 0)), sum(coalesce(ws_quantity#3, 0)), sum(coalesce(cast(wr_return_amt#12 as decimal(12,2)), 0.00)), sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(coalesce(wr_return_quantity#11, 0))#31, sum(coalesce(ws_quantity#3, 0))#32, sum(coalesce(cast(wr_return_amt#12 as decimal(12,2)), 0.00))#33, sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))#34] +Results [3]: [ws_item_sk#1 AS item#35, CheckOverflow((promote_precision(cast(sum(coalesce(wr_return_quantity#11, 0))#31 as decimal(15,4))) / promote_precision(cast(sum(coalesce(ws_quantity#3, 0))#32 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#36, CheckOverflow((promote_precision(cast(sum(coalesce(cast(wr_return_amt#12 as decimal(12,2)), 0.00))#33 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(ws_net_paid#4 as decimal(12,2)), 0.00))#34 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#37] + +(22) Exchange +Input [3]: [item#35, return_ratio#36, currency_ratio#37] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#38] + +(23) Sort [codegen id : 5] +Input [3]: [item#35, return_ratio#36, currency_ratio#37] +Arguments: [return_ratio#36 ASC NULLS FIRST], false, 0 + +(24) Window +Input [3]: [item#35, return_ratio#36, currency_ratio#37] +Arguments: [rank(return_ratio#36) windowspecdefinition(return_ratio#36 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS return_rank#39], [return_ratio#36 ASC NULLS FIRST] + +(25) Sort [codegen id : 6] +Input [4]: [item#35, return_ratio#36, currency_ratio#37, return_rank#39] +Arguments: [currency_ratio#37 ASC NULLS FIRST], false, 0 + +(26) Window +Input [4]: [item#35, return_ratio#36, currency_ratio#37, return_rank#39] +Arguments: [rank(currency_ratio#37) windowspecdefinition(currency_ratio#37 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS currency_rank#40], [currency_ratio#37 ASC NULLS FIRST] + +(27) Filter [codegen id : 7] +Input [5]: [item#35, return_ratio#36, currency_ratio#37, return_rank#39, currency_rank#40] +Condition : ((return_rank#39 <= 10) OR (currency_rank#40 <= 10)) + +(28) Project [codegen id : 7] +Output [5]: [web AS channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Input [5]: [item#35, return_ratio#36, currency_ratio#37, return_rank#39, currency_rank#40] + +(29) Scan parquet default.catalog_sales +Output [6]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46, cs_sold_date_sk#47] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#47), dynamicpruningexpression(cs_sold_date_sk#47 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(cs_net_profit), IsNotNull(cs_net_paid), IsNotNull(cs_quantity), GreaterThan(cs_net_profit,1.00), GreaterThan(cs_net_paid,0.00), GreaterThan(cs_quantity,0), IsNotNull(cs_order_number), IsNotNull(cs_item_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 8] +Input [6]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46, cs_sold_date_sk#47] + +(31) Filter [codegen id : 8] +Input [6]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46, cs_sold_date_sk#47] +Condition : (((((((isnotnull(cs_net_profit#46) AND isnotnull(cs_net_paid#45)) AND isnotnull(cs_quantity#44)) AND (cs_net_profit#46 > 1.00)) AND (cs_net_paid#45 > 0.00)) AND (cs_quantity#44 > 0)) AND isnotnull(cs_order_number#43)) AND isnotnull(cs_item_sk#42)) + +(32) Project [codegen id : 8] +Output [5]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_sold_date_sk#47] +Input [6]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_net_profit#46, cs_sold_date_sk#47] + +(33) BroadcastExchange +Input [5]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_sold_date_sk#47] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [id=#48] + +(34) Scan parquet default.catalog_returns +Output [5]: [cr_item_sk#49, cr_order_number#50, cr_return_quantity#51, cr_return_amount#52, cr_returned_date_sk#53] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_return_amount), GreaterThan(cr_return_amount,10000.00), IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(35) ColumnarToRow +Input [5]: [cr_item_sk#49, cr_order_number#50, cr_return_quantity#51, cr_return_amount#52, cr_returned_date_sk#53] + +(36) Filter +Input [5]: [cr_item_sk#49, cr_order_number#50, cr_return_quantity#51, cr_return_amount#52, cr_returned_date_sk#53] +Condition : (((isnotnull(cr_return_amount#52) AND (cr_return_amount#52 > 10000.00)) AND isnotnull(cr_order_number#50)) AND isnotnull(cr_item_sk#49)) + +(37) Project +Output [4]: [cr_item_sk#49, cr_order_number#50, cr_return_quantity#51, cr_return_amount#52] +Input [5]: [cr_item_sk#49, cr_order_number#50, cr_return_quantity#51, cr_return_amount#52, cr_returned_date_sk#53] + +(38) BroadcastHashJoin [codegen id : 10] +Left keys [2]: [cs_order_number#43, cs_item_sk#42] +Right keys [2]: [cr_order_number#50, cr_item_sk#49] +Join condition: None + +(39) Project [codegen id : 10] +Output [6]: [cs_item_sk#42, cs_quantity#44, cs_net_paid#45, cs_sold_date_sk#47, cr_return_quantity#51, cr_return_amount#52] +Input [9]: [cs_item_sk#42, cs_order_number#43, cs_quantity#44, cs_net_paid#45, cs_sold_date_sk#47, cr_item_sk#49, cr_order_number#50, cr_return_quantity#51, cr_return_amount#52] + +(40) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#54] + +(41) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#47] +Right keys [1]: [d_date_sk#54] +Join condition: None + +(42) Project [codegen id : 10] +Output [5]: [cs_item_sk#42, cs_quantity#44, cs_net_paid#45, cr_return_quantity#51, cr_return_amount#52] +Input [7]: [cs_item_sk#42, cs_quantity#44, cs_net_paid#45, cs_sold_date_sk#47, cr_return_quantity#51, cr_return_amount#52, d_date_sk#54] + +(43) HashAggregate [codegen id : 10] +Input [5]: [cs_item_sk#42, cs_quantity#44, cs_net_paid#45, cr_return_quantity#51, cr_return_amount#52] +Keys [1]: [cs_item_sk#42] +Functions [4]: [partial_sum(coalesce(cr_return_quantity#51, 0)), partial_sum(coalesce(cs_quantity#44, 0)), partial_sum(coalesce(cast(cr_return_amount#52 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(cs_net_paid#45 as decimal(12,2)), 0.00))] +Aggregate Attributes [6]: [sum#55, sum#56, sum#57, isEmpty#58, sum#59, isEmpty#60] +Results [7]: [cs_item_sk#42, sum#61, sum#62, sum#63, isEmpty#64, sum#65, isEmpty#66] + +(44) Exchange +Input [7]: [cs_item_sk#42, sum#61, sum#62, sum#63, isEmpty#64, sum#65, isEmpty#66] +Arguments: hashpartitioning(cs_item_sk#42, 5), ENSURE_REQUIREMENTS, [id=#67] + +(45) HashAggregate [codegen id : 11] +Input [7]: [cs_item_sk#42, sum#61, sum#62, sum#63, isEmpty#64, sum#65, isEmpty#66] +Keys [1]: [cs_item_sk#42] +Functions [4]: [sum(coalesce(cr_return_quantity#51, 0)), sum(coalesce(cs_quantity#44, 0)), sum(coalesce(cast(cr_return_amount#52 as decimal(12,2)), 0.00)), sum(coalesce(cast(cs_net_paid#45 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(coalesce(cr_return_quantity#51, 0))#68, sum(coalesce(cs_quantity#44, 0))#69, sum(coalesce(cast(cr_return_amount#52 as decimal(12,2)), 0.00))#70, sum(coalesce(cast(cs_net_paid#45 as decimal(12,2)), 0.00))#71] +Results [3]: [cs_item_sk#42 AS item#72, CheckOverflow((promote_precision(cast(sum(coalesce(cr_return_quantity#51, 0))#68 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cs_quantity#44, 0))#69 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#73, CheckOverflow((promote_precision(cast(sum(coalesce(cast(cr_return_amount#52 as decimal(12,2)), 0.00))#70 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(cs_net_paid#45 as decimal(12,2)), 0.00))#71 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#74] + +(46) Exchange +Input [3]: [item#72, return_ratio#73, currency_ratio#74] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#75] + +(47) Sort [codegen id : 12] +Input [3]: [item#72, return_ratio#73, currency_ratio#74] +Arguments: [return_ratio#73 ASC NULLS FIRST], false, 0 + +(48) Window +Input [3]: [item#72, return_ratio#73, currency_ratio#74] +Arguments: [rank(return_ratio#73) windowspecdefinition(return_ratio#73 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS return_rank#76], [return_ratio#73 ASC NULLS FIRST] + +(49) Sort [codegen id : 13] +Input [4]: [item#72, return_ratio#73, currency_ratio#74, return_rank#76] +Arguments: [currency_ratio#74 ASC NULLS FIRST], false, 0 + +(50) Window +Input [4]: [item#72, return_ratio#73, currency_ratio#74, return_rank#76] +Arguments: [rank(currency_ratio#74) windowspecdefinition(currency_ratio#74 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS currency_rank#77], [currency_ratio#74 ASC NULLS FIRST] + +(51) Filter [codegen id : 14] +Input [5]: [item#72, return_ratio#73, currency_ratio#74, return_rank#76, currency_rank#77] +Condition : ((return_rank#76 <= 10) OR (currency_rank#77 <= 10)) + +(52) Project [codegen id : 14] +Output [5]: [catalog AS channel#78, item#72, return_ratio#73, return_rank#76, currency_rank#77] +Input [5]: [item#72, return_ratio#73, currency_ratio#74, return_rank#76, currency_rank#77] + +(53) Scan parquet default.store_sales +Output [6]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_net_profit#83, ss_sold_date_sk#84] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#84), dynamicpruningexpression(ss_sold_date_sk#84 IN dynamicpruning#7)] +PushedFilters: [IsNotNull(ss_net_profit), IsNotNull(ss_net_paid), IsNotNull(ss_quantity), GreaterThan(ss_net_profit,1.00), GreaterThan(ss_net_paid,0.00), GreaterThan(ss_quantity,0), IsNotNull(ss_ticket_number), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(54) ColumnarToRow [codegen id : 15] +Input [6]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_net_profit#83, ss_sold_date_sk#84] + +(55) Filter [codegen id : 15] +Input [6]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_net_profit#83, ss_sold_date_sk#84] +Condition : (((((((isnotnull(ss_net_profit#83) AND isnotnull(ss_net_paid#82)) AND isnotnull(ss_quantity#81)) AND (ss_net_profit#83 > 1.00)) AND (ss_net_paid#82 > 0.00)) AND (ss_quantity#81 > 0)) AND isnotnull(ss_ticket_number#80)) AND isnotnull(ss_item_sk#79)) + +(56) Project [codegen id : 15] +Output [5]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#84] +Input [6]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_net_profit#83, ss_sold_date_sk#84] + +(57) BroadcastExchange +Input [5]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#84] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, true] as bigint), 32) | (cast(input[0, int, true] as bigint) & 4294967295))),false), [id=#85] + +(58) Scan parquet default.store_returns +Output [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_return_amt), GreaterThan(sr_return_amt,10000.00), IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(59) ColumnarToRow +Input [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] + +(60) Filter +Input [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] +Condition : (((isnotnull(sr_return_amt#89) AND (sr_return_amt#89 > 10000.00)) AND isnotnull(sr_ticket_number#87)) AND isnotnull(sr_item_sk#86)) + +(61) Project +Output [4]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89] +Input [5]: [sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89, sr_returned_date_sk#90] + +(62) BroadcastHashJoin [codegen id : 17] +Left keys [2]: [ss_ticket_number#80, ss_item_sk#79] +Right keys [2]: [sr_ticket_number#87, sr_item_sk#86] +Join condition: None + +(63) Project [codegen id : 17] +Output [6]: [ss_item_sk#79, ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#84, sr_return_quantity#88, sr_return_amt#89] +Input [9]: [ss_item_sk#79, ss_ticket_number#80, ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#84, sr_item_sk#86, sr_ticket_number#87, sr_return_quantity#88, sr_return_amt#89] + +(64) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#91] + +(65) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ss_sold_date_sk#84] +Right keys [1]: [d_date_sk#91] +Join condition: None + +(66) Project [codegen id : 17] +Output [5]: [ss_item_sk#79, ss_quantity#81, ss_net_paid#82, sr_return_quantity#88, sr_return_amt#89] +Input [7]: [ss_item_sk#79, ss_quantity#81, ss_net_paid#82, ss_sold_date_sk#84, sr_return_quantity#88, sr_return_amt#89, d_date_sk#91] + +(67) HashAggregate [codegen id : 17] +Input [5]: [ss_item_sk#79, ss_quantity#81, ss_net_paid#82, sr_return_quantity#88, sr_return_amt#89] +Keys [1]: [ss_item_sk#79] +Functions [4]: [partial_sum(coalesce(sr_return_quantity#88, 0)), partial_sum(coalesce(ss_quantity#81, 0)), partial_sum(coalesce(cast(sr_return_amt#89 as decimal(12,2)), 0.00)), partial_sum(coalesce(cast(ss_net_paid#82 as decimal(12,2)), 0.00))] +Aggregate Attributes [6]: [sum#92, sum#93, sum#94, isEmpty#95, sum#96, isEmpty#97] +Results [7]: [ss_item_sk#79, sum#98, sum#99, sum#100, isEmpty#101, sum#102, isEmpty#103] + +(68) Exchange +Input [7]: [ss_item_sk#79, sum#98, sum#99, sum#100, isEmpty#101, sum#102, isEmpty#103] +Arguments: hashpartitioning(ss_item_sk#79, 5), ENSURE_REQUIREMENTS, [id=#104] + +(69) HashAggregate [codegen id : 18] +Input [7]: [ss_item_sk#79, sum#98, sum#99, sum#100, isEmpty#101, sum#102, isEmpty#103] +Keys [1]: [ss_item_sk#79] +Functions [4]: [sum(coalesce(sr_return_quantity#88, 0)), sum(coalesce(ss_quantity#81, 0)), sum(coalesce(cast(sr_return_amt#89 as decimal(12,2)), 0.00)), sum(coalesce(cast(ss_net_paid#82 as decimal(12,2)), 0.00))] +Aggregate Attributes [4]: [sum(coalesce(sr_return_quantity#88, 0))#105, sum(coalesce(ss_quantity#81, 0))#106, sum(coalesce(cast(sr_return_amt#89 as decimal(12,2)), 0.00))#107, sum(coalesce(cast(ss_net_paid#82 as decimal(12,2)), 0.00))#108] +Results [3]: [ss_item_sk#79 AS item#109, CheckOverflow((promote_precision(cast(sum(coalesce(sr_return_quantity#88, 0))#105 as decimal(15,4))) / promote_precision(cast(sum(coalesce(ss_quantity#81, 0))#106 as decimal(15,4)))), DecimalType(35,20), true) AS return_ratio#110, CheckOverflow((promote_precision(cast(sum(coalesce(cast(sr_return_amt#89 as decimal(12,2)), 0.00))#107 as decimal(15,4))) / promote_precision(cast(sum(coalesce(cast(ss_net_paid#82 as decimal(12,2)), 0.00))#108 as decimal(15,4)))), DecimalType(35,20), true) AS currency_ratio#111] + +(70) Exchange +Input [3]: [item#109, return_ratio#110, currency_ratio#111] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#112] + +(71) Sort [codegen id : 19] +Input [3]: [item#109, return_ratio#110, currency_ratio#111] +Arguments: [return_ratio#110 ASC NULLS FIRST], false, 0 + +(72) Window +Input [3]: [item#109, return_ratio#110, currency_ratio#111] +Arguments: [rank(return_ratio#110) windowspecdefinition(return_ratio#110 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS return_rank#113], [return_ratio#110 ASC NULLS FIRST] + +(73) Sort [codegen id : 20] +Input [4]: [item#109, return_ratio#110, currency_ratio#111, return_rank#113] +Arguments: [currency_ratio#111 ASC NULLS FIRST], false, 0 + +(74) Window +Input [4]: [item#109, return_ratio#110, currency_ratio#111, return_rank#113] +Arguments: [rank(currency_ratio#111) windowspecdefinition(currency_ratio#111 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS currency_rank#114], [currency_ratio#111 ASC NULLS FIRST] + +(75) Filter [codegen id : 21] +Input [5]: [item#109, return_ratio#110, currency_ratio#111, return_rank#113, currency_rank#114] +Condition : ((return_rank#113 <= 10) OR (currency_rank#114 <= 10)) + +(76) Project [codegen id : 21] +Output [5]: [store AS channel#115, item#109, return_ratio#110, return_rank#113, currency_rank#114] +Input [5]: [item#109, return_ratio#110, currency_ratio#111, return_rank#113, currency_rank#114] + +(77) Union + +(78) HashAggregate [codegen id : 22] +Input [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Keys [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] + +(79) Exchange +Input [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Arguments: hashpartitioning(channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40, 5), ENSURE_REQUIREMENTS, [id=#116] + +(80) HashAggregate [codegen id : 23] +Input [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Keys [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] + +(81) TakeOrderedAndProject +Input [5]: [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] +Arguments: 100, [channel#41 ASC NULLS FIRST, return_rank#39 ASC NULLS FIRST, currency_rank#40 ASC NULLS FIRST, item#35 ASC NULLS FIRST], [channel#41, item#35, return_ratio#36, return_rank#39, currency_rank#40] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#6 IN dynamicpruning#7 +ReusedExchange (82) + + +(82) ReusedExchange [Reuses operator id: 16] +Output [1]: [d_date_sk#14] + +Subquery:2 Hosting operator id = 29 Hosting Expression = cs_sold_date_sk#47 IN dynamicpruning#7 + +Subquery:3 Hosting operator id = 53 Hosting Expression = ss_sold_date_sk#84 IN dynamicpruning#7 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/simplified.txt new file mode 100644 index 0000000000000..0b548432d6fed --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q49/simplified.txt @@ -0,0 +1,133 @@ +TakeOrderedAndProject [channel,return_rank,currency_rank,item,return_ratio] + WholeStageCodegen (23) + HashAggregate [channel,item,return_ratio,return_rank,currency_rank] + InputAdapter + Exchange [channel,item,return_ratio,return_rank,currency_rank] #1 + WholeStageCodegen (22) + HashAggregate [channel,item,return_ratio,return_rank,currency_rank] + InputAdapter + Union + WholeStageCodegen (7) + Project [item,return_ratio,return_rank,currency_rank] + Filter [return_rank,currency_rank] + InputAdapter + Window [currency_ratio] + WholeStageCodegen (6) + Sort [currency_ratio] + InputAdapter + Window [return_ratio] + WholeStageCodegen (5) + Sort [return_ratio] + InputAdapter + Exchange #2 + WholeStageCodegen (4) + HashAggregate [ws_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(wr_return_quantity, 0)),sum(coalesce(ws_quantity, 0)),sum(coalesce(cast(wr_return_amt as decimal(12,2)), 0.00)),sum(coalesce(cast(ws_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [ws_item_sk] #3 + WholeStageCodegen (3) + HashAggregate [ws_item_sk,wr_return_quantity,ws_quantity,wr_return_amt,ws_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty] + Project [ws_item_sk,ws_quantity,ws_net_paid,wr_return_quantity,wr_return_amt] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_quantity,ws_net_paid,ws_sold_date_sk,wr_return_quantity,wr_return_amt] + BroadcastHashJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_sold_date_sk] + Filter [ws_net_profit,ws_net_paid,ws_quantity,ws_order_number,ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_net_paid,ws_net_profit,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + Project [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt] + Filter [wr_return_amt,wr_order_number,wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt,wr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + WholeStageCodegen (14) + Project [item,return_ratio,return_rank,currency_rank] + Filter [return_rank,currency_rank] + InputAdapter + Window [currency_ratio] + WholeStageCodegen (13) + Sort [currency_ratio] + InputAdapter + Window [return_ratio] + WholeStageCodegen (12) + Sort [return_ratio] + InputAdapter + Exchange #6 + WholeStageCodegen (11) + HashAggregate [cs_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(cr_return_quantity, 0)),sum(coalesce(cs_quantity, 0)),sum(coalesce(cast(cr_return_amount as decimal(12,2)), 0.00)),sum(coalesce(cast(cs_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [cs_item_sk] #7 + WholeStageCodegen (10) + HashAggregate [cs_item_sk,cr_return_quantity,cs_quantity,cr_return_amount,cs_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty] + Project [cs_item_sk,cs_quantity,cs_net_paid,cr_return_quantity,cr_return_amount] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_quantity,cs_net_paid,cs_sold_date_sk,cr_return_quantity,cr_return_amount] + BroadcastHashJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (8) + Project [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid,cs_sold_date_sk] + Filter [cs_net_profit,cs_net_paid,cs_quantity,cs_order_number,cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_net_paid,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + Project [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount] + Filter [cr_return_amount,cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount,cr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #5 + WholeStageCodegen (21) + Project [item,return_ratio,return_rank,currency_rank] + Filter [return_rank,currency_rank] + InputAdapter + Window [currency_ratio] + WholeStageCodegen (20) + Sort [currency_ratio] + InputAdapter + Window [return_ratio] + WholeStageCodegen (19) + Sort [return_ratio] + InputAdapter + Exchange #9 + WholeStageCodegen (18) + HashAggregate [ss_item_sk,sum,sum,sum,isEmpty,sum,isEmpty] [sum(coalesce(sr_return_quantity, 0)),sum(coalesce(ss_quantity, 0)),sum(coalesce(cast(sr_return_amt as decimal(12,2)), 0.00)),sum(coalesce(cast(ss_net_paid as decimal(12,2)), 0.00)),item,return_ratio,currency_ratio,sum,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [ss_item_sk] #10 + WholeStageCodegen (17) + HashAggregate [ss_item_sk,sr_return_quantity,ss_quantity,sr_return_amt,ss_net_paid] [sum,sum,sum,isEmpty,sum,isEmpty,sum,sum,sum,isEmpty,sum,isEmpty] + Project [ss_item_sk,ss_quantity,ss_net_paid,sr_return_quantity,sr_return_amt] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_quantity,ss_net_paid,ss_sold_date_sk,sr_return_quantity,sr_return_amt] + BroadcastHashJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (15) + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid,ss_sold_date_sk] + Filter [ss_net_profit,ss_net_paid,ss_quantity,ss_ticket_number,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_net_paid,ss_net_profit,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + Project [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt] + Filter [sr_return_amt,sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt,sr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q51a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q51a.sf100/explain.txt new file mode 100644 index 0000000000000..0a8fdb66edb77 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q51a.sf100/explain.txt @@ -0,0 +1,425 @@ +== Physical Plan == +TakeOrderedAndProject (74) ++- * Filter (73) + +- * HashAggregate (72) + +- * HashAggregate (71) + +- * Project (70) + +- * SortMergeJoin Inner (69) + :- Window (64) + : +- * Sort (63) + : +- Exchange (62) + : +- * Project (61) + : +- * Filter (60) + : +- SortMergeJoin FullOuter (59) + : :- * Sort (31) + : : +- Exchange (30) + : : +- * HashAggregate (29) + : : +- * HashAggregate (28) + : : +- * Project (27) + : : +- * SortMergeJoin Inner (26) + : : :- * Sort (19) + : : : +- Exchange (18) + : : : +- * Project (17) + : : : +- Window (16) + : : : +- * Sort (15) + : : : +- Exchange (14) + : : : +- * HashAggregate (13) + : : : +- Exchange (12) + : : : +- * HashAggregate (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.web_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- * Sort (25) + : : +- Exchange (24) + : : +- * Project (23) + : : +- Window (22) + : : +- * Sort (21) + : : +- ReusedExchange (20) + : +- * Sort (58) + : +- Exchange (57) + : +- * HashAggregate (56) + : +- * HashAggregate (55) + : +- * Project (54) + : +- * SortMergeJoin Inner (53) + : :- * Sort (46) + : : +- Exchange (45) + : : +- * Project (44) + : : +- Window (43) + : : +- * Sort (42) + : : +- Exchange (41) + : : +- * HashAggregate (40) + : : +- Exchange (39) + : : +- * HashAggregate (38) + : : +- * Project (37) + : : +- * BroadcastHashJoin Inner BuildRight (36) + : : :- * Filter (34) + : : : +- * ColumnarToRow (33) + : : : +- Scan parquet default.store_sales (32) + : : +- ReusedExchange (35) + : +- * Sort (52) + : +- Exchange (51) + : +- * Project (50) + : +- Window (49) + : +- * Sort (48) + : +- ReusedExchange (47) + +- * Project (68) + +- Window (67) + +- * Sort (66) + +- ReusedExchange (65) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3] +Condition : isnotnull(ws_item_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_date#6, d_month_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_date#6, d_month_seq#7] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_date#6, d_month_seq#7] +Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1212)) AND (d_month_seq#7 <= 1223)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#5, d_date#6] +Input [3]: [d_date_sk#5, d_date#6, d_month_seq#7] + +(8) BroadcastExchange +Input [2]: [d_date_sk#5, d_date#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 2] +Output [3]: [ws_item_sk#1, ws_sales_price#2, d_date#6] +Input [5]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3, d_date_sk#5, d_date#6] + +(11) HashAggregate [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_sales_price#2, d_date#6] +Keys [2]: [ws_item_sk#1, d_date#6] +Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#2))] +Aggregate Attributes [1]: [sum#9] +Results [3]: [ws_item_sk#1, d_date#6, sum#10] + +(12) Exchange +Input [3]: [ws_item_sk#1, d_date#6, sum#10] +Arguments: hashpartitioning(ws_item_sk#1, d_date#6, 5), ENSURE_REQUIREMENTS, [id=#11] + +(13) HashAggregate [codegen id : 3] +Input [3]: [ws_item_sk#1, d_date#6, sum#10] +Keys [2]: [ws_item_sk#1, d_date#6] +Functions [1]: [sum(UnscaledValue(ws_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#2))#12] +Results [4]: [ws_item_sk#1 AS item_sk#13, d_date#6, MakeDecimal(sum(UnscaledValue(ws_sales_price#2))#12,17,2) AS sumws#14, ws_item_sk#1] + +(14) Exchange +Input [4]: [item_sk#13, d_date#6, sumws#14, ws_item_sk#1] +Arguments: hashpartitioning(ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#15] + +(15) Sort [codegen id : 4] +Input [4]: [item_sk#13, d_date#6, sumws#14, ws_item_sk#1] +Arguments: [ws_item_sk#1 ASC NULLS FIRST, d_date#6 ASC NULLS FIRST], false, 0 + +(16) Window +Input [4]: [item_sk#13, d_date#6, sumws#14, ws_item_sk#1] +Arguments: [row_number() windowspecdefinition(ws_item_sk#1, d_date#6 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#16], [ws_item_sk#1], [d_date#6 ASC NULLS FIRST] + +(17) Project [codegen id : 5] +Output [4]: [item_sk#13, d_date#6, sumws#14, rk#16] +Input [5]: [item_sk#13, d_date#6, sumws#14, ws_item_sk#1, rk#16] + +(18) Exchange +Input [4]: [item_sk#13, d_date#6, sumws#14, rk#16] +Arguments: hashpartitioning(item_sk#13, 5), ENSURE_REQUIREMENTS, [id=#17] + +(19) Sort [codegen id : 6] +Input [4]: [item_sk#13, d_date#6, sumws#14, rk#16] +Arguments: [item_sk#13 ASC NULLS FIRST], false, 0 + +(20) ReusedExchange [Reuses operator id: unknown] +Output [4]: [item_sk#18, d_date#19, sumws#20, ws_item_sk#21] + +(21) Sort [codegen id : 10] +Input [4]: [item_sk#18, d_date#19, sumws#20, ws_item_sk#21] +Arguments: [ws_item_sk#21 ASC NULLS FIRST, d_date#19 ASC NULLS FIRST], false, 0 + +(22) Window +Input [4]: [item_sk#18, d_date#19, sumws#20, ws_item_sk#21] +Arguments: [row_number() windowspecdefinition(ws_item_sk#21, d_date#19 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#22], [ws_item_sk#21], [d_date#19 ASC NULLS FIRST] + +(23) Project [codegen id : 11] +Output [3]: [item_sk#18, sumws#20, rk#22] +Input [5]: [item_sk#18, d_date#19, sumws#20, ws_item_sk#21, rk#22] + +(24) Exchange +Input [3]: [item_sk#18, sumws#20, rk#22] +Arguments: hashpartitioning(item_sk#18, 5), ENSURE_REQUIREMENTS, [id=#23] + +(25) Sort [codegen id : 12] +Input [3]: [item_sk#18, sumws#20, rk#22] +Arguments: [item_sk#18 ASC NULLS FIRST], false, 0 + +(26) SortMergeJoin [codegen id : 13] +Left keys [1]: [item_sk#13] +Right keys [1]: [item_sk#18] +Join condition: (rk#16 >= rk#22) + +(27) Project [codegen id : 13] +Output [4]: [item_sk#13, d_date#6, sumws#14, sumws#20] +Input [7]: [item_sk#13, d_date#6, sumws#14, rk#16, item_sk#18, sumws#20, rk#22] + +(28) HashAggregate [codegen id : 13] +Input [4]: [item_sk#13, d_date#6, sumws#14, sumws#20] +Keys [3]: [item_sk#13, d_date#6, sumws#14] +Functions [1]: [partial_sum(sumws#20)] +Aggregate Attributes [2]: [sum#24, isEmpty#25] +Results [5]: [item_sk#13, d_date#6, sumws#14, sum#26, isEmpty#27] + +(29) HashAggregate [codegen id : 13] +Input [5]: [item_sk#13, d_date#6, sumws#14, sum#26, isEmpty#27] +Keys [3]: [item_sk#13, d_date#6, sumws#14] +Functions [1]: [sum(sumws#20)] +Aggregate Attributes [1]: [sum(sumws#20)#28] +Results [3]: [item_sk#13, d_date#6, sum(sumws#20)#28 AS cume_sales#29] + +(30) Exchange +Input [3]: [item_sk#13, d_date#6, cume_sales#29] +Arguments: hashpartitioning(item_sk#13, d_date#6, 5), ENSURE_REQUIREMENTS, [id=#30] + +(31) Sort [codegen id : 14] +Input [3]: [item_sk#13, d_date#6, cume_sales#29] +Arguments: [item_sk#13 ASC NULLS FIRST, d_date#6 ASC NULLS FIRST], false, 0 + +(32) Scan parquet default.store_sales +Output [3]: [ss_item_sk#31, ss_sales_price#32, ss_sold_date_sk#33] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#33), dynamicpruningexpression(ss_sold_date_sk#33 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(33) ColumnarToRow [codegen id : 16] +Input [3]: [ss_item_sk#31, ss_sales_price#32, ss_sold_date_sk#33] + +(34) Filter [codegen id : 16] +Input [3]: [ss_item_sk#31, ss_sales_price#32, ss_sold_date_sk#33] +Condition : isnotnull(ss_item_sk#31) + +(35) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#34, d_date#35] + +(36) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [ss_sold_date_sk#33] +Right keys [1]: [d_date_sk#34] +Join condition: None + +(37) Project [codegen id : 16] +Output [3]: [ss_item_sk#31, ss_sales_price#32, d_date#35] +Input [5]: [ss_item_sk#31, ss_sales_price#32, ss_sold_date_sk#33, d_date_sk#34, d_date#35] + +(38) HashAggregate [codegen id : 16] +Input [3]: [ss_item_sk#31, ss_sales_price#32, d_date#35] +Keys [2]: [ss_item_sk#31, d_date#35] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#32))] +Aggregate Attributes [1]: [sum#36] +Results [3]: [ss_item_sk#31, d_date#35, sum#37] + +(39) Exchange +Input [3]: [ss_item_sk#31, d_date#35, sum#37] +Arguments: hashpartitioning(ss_item_sk#31, d_date#35, 5), ENSURE_REQUIREMENTS, [id=#38] + +(40) HashAggregate [codegen id : 17] +Input [3]: [ss_item_sk#31, d_date#35, sum#37] +Keys [2]: [ss_item_sk#31, d_date#35] +Functions [1]: [sum(UnscaledValue(ss_sales_price#32))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#32))#39] +Results [4]: [ss_item_sk#31 AS item_sk#40, d_date#35, MakeDecimal(sum(UnscaledValue(ss_sales_price#32))#39,17,2) AS sumss#41, ss_item_sk#31] + +(41) Exchange +Input [4]: [item_sk#40, d_date#35, sumss#41, ss_item_sk#31] +Arguments: hashpartitioning(ss_item_sk#31, 5), ENSURE_REQUIREMENTS, [id=#42] + +(42) Sort [codegen id : 18] +Input [4]: [item_sk#40, d_date#35, sumss#41, ss_item_sk#31] +Arguments: [ss_item_sk#31 ASC NULLS FIRST, d_date#35 ASC NULLS FIRST], false, 0 + +(43) Window +Input [4]: [item_sk#40, d_date#35, sumss#41, ss_item_sk#31] +Arguments: [row_number() windowspecdefinition(ss_item_sk#31, d_date#35 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#43], [ss_item_sk#31], [d_date#35 ASC NULLS FIRST] + +(44) Project [codegen id : 19] +Output [4]: [item_sk#40, d_date#35, sumss#41, rk#43] +Input [5]: [item_sk#40, d_date#35, sumss#41, ss_item_sk#31, rk#43] + +(45) Exchange +Input [4]: [item_sk#40, d_date#35, sumss#41, rk#43] +Arguments: hashpartitioning(item_sk#40, 5), ENSURE_REQUIREMENTS, [id=#44] + +(46) Sort [codegen id : 20] +Input [4]: [item_sk#40, d_date#35, sumss#41, rk#43] +Arguments: [item_sk#40 ASC NULLS FIRST], false, 0 + +(47) ReusedExchange [Reuses operator id: unknown] +Output [4]: [item_sk#45, d_date#46, sumss#47, ss_item_sk#48] + +(48) Sort [codegen id : 24] +Input [4]: [item_sk#45, d_date#46, sumss#47, ss_item_sk#48] +Arguments: [ss_item_sk#48 ASC NULLS FIRST, d_date#46 ASC NULLS FIRST], false, 0 + +(49) Window +Input [4]: [item_sk#45, d_date#46, sumss#47, ss_item_sk#48] +Arguments: [row_number() windowspecdefinition(ss_item_sk#48, d_date#46 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#49], [ss_item_sk#48], [d_date#46 ASC NULLS FIRST] + +(50) Project [codegen id : 25] +Output [3]: [item_sk#45, sumss#47, rk#49] +Input [5]: [item_sk#45, d_date#46, sumss#47, ss_item_sk#48, rk#49] + +(51) Exchange +Input [3]: [item_sk#45, sumss#47, rk#49] +Arguments: hashpartitioning(item_sk#45, 5), ENSURE_REQUIREMENTS, [id=#50] + +(52) Sort [codegen id : 26] +Input [3]: [item_sk#45, sumss#47, rk#49] +Arguments: [item_sk#45 ASC NULLS FIRST], false, 0 + +(53) SortMergeJoin [codegen id : 27] +Left keys [1]: [item_sk#40] +Right keys [1]: [item_sk#45] +Join condition: (rk#43 >= rk#49) + +(54) Project [codegen id : 27] +Output [4]: [item_sk#40, d_date#35, sumss#41, sumss#47] +Input [7]: [item_sk#40, d_date#35, sumss#41, rk#43, item_sk#45, sumss#47, rk#49] + +(55) HashAggregate [codegen id : 27] +Input [4]: [item_sk#40, d_date#35, sumss#41, sumss#47] +Keys [3]: [item_sk#40, d_date#35, sumss#41] +Functions [1]: [partial_sum(sumss#47)] +Aggregate Attributes [2]: [sum#51, isEmpty#52] +Results [5]: [item_sk#40, d_date#35, sumss#41, sum#53, isEmpty#54] + +(56) HashAggregate [codegen id : 27] +Input [5]: [item_sk#40, d_date#35, sumss#41, sum#53, isEmpty#54] +Keys [3]: [item_sk#40, d_date#35, sumss#41] +Functions [1]: [sum(sumss#47)] +Aggregate Attributes [1]: [sum(sumss#47)#55] +Results [3]: [item_sk#40, d_date#35, sum(sumss#47)#55 AS cume_sales#56] + +(57) Exchange +Input [3]: [item_sk#40, d_date#35, cume_sales#56] +Arguments: hashpartitioning(item_sk#40, d_date#35, 5), ENSURE_REQUIREMENTS, [id=#57] + +(58) Sort [codegen id : 28] +Input [3]: [item_sk#40, d_date#35, cume_sales#56] +Arguments: [item_sk#40 ASC NULLS FIRST, d_date#35 ASC NULLS FIRST], false, 0 + +(59) SortMergeJoin +Left keys [2]: [item_sk#13, d_date#6] +Right keys [2]: [item_sk#40, d_date#35] +Join condition: None + +(60) Filter [codegen id : 29] +Input [6]: [item_sk#13, d_date#6, cume_sales#29, item_sk#40, d_date#35, cume_sales#56] +Condition : isnotnull(CASE WHEN isnotnull(item_sk#13) THEN item_sk#13 ELSE item_sk#40 END) + +(61) Project [codegen id : 29] +Output [4]: [CASE WHEN isnotnull(item_sk#13) THEN item_sk#13 ELSE item_sk#40 END AS item_sk#58, CASE WHEN isnotnull(d_date#6) THEN d_date#6 ELSE d_date#35 END AS d_date#59, cume_sales#29 AS web_sales#60, cume_sales#56 AS store_sales#61] +Input [6]: [item_sk#13, d_date#6, cume_sales#29, item_sk#40, d_date#35, cume_sales#56] + +(62) Exchange +Input [4]: [item_sk#58, d_date#59, web_sales#60, store_sales#61] +Arguments: hashpartitioning(item_sk#58, 5), ENSURE_REQUIREMENTS, [id=#62] + +(63) Sort [codegen id : 30] +Input [4]: [item_sk#58, d_date#59, web_sales#60, store_sales#61] +Arguments: [item_sk#58 ASC NULLS FIRST, d_date#59 ASC NULLS FIRST], false, 0 + +(64) Window +Input [4]: [item_sk#58, d_date#59, web_sales#60, store_sales#61] +Arguments: [row_number() windowspecdefinition(item_sk#58, d_date#59 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#63], [item_sk#58], [d_date#59 ASC NULLS FIRST] + +(65) ReusedExchange [Reuses operator id: unknown] +Output [4]: [item_sk#64, d_date#65, web_sales#66, store_sales#67] + +(66) Sort [codegen id : 60] +Input [4]: [item_sk#64, d_date#65, web_sales#66, store_sales#67] +Arguments: [item_sk#64 ASC NULLS FIRST, d_date#65 ASC NULLS FIRST], false, 0 + +(67) Window +Input [4]: [item_sk#64, d_date#65, web_sales#66, store_sales#67] +Arguments: [row_number() windowspecdefinition(item_sk#64, d_date#65 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#68], [item_sk#64], [d_date#65 ASC NULLS FIRST] + +(68) Project [codegen id : 61] +Output [4]: [item_sk#64, web_sales#66, store_sales#67, rk#68] +Input [5]: [item_sk#64, d_date#65, web_sales#66, store_sales#67, rk#68] + +(69) SortMergeJoin [codegen id : 62] +Left keys [1]: [item_sk#58] +Right keys [1]: [item_sk#64] +Join condition: (rk#63 >= rk#68) + +(70) Project [codegen id : 62] +Output [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, web_sales#66, store_sales#67] +Input [9]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, rk#63, item_sk#64, web_sales#66, store_sales#67, rk#68] + +(71) HashAggregate [codegen id : 62] +Input [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, web_sales#66, store_sales#67] +Keys [4]: [item_sk#58, d_date#59, web_sales#60, store_sales#61] +Functions [2]: [partial_max(web_sales#66), partial_max(store_sales#67)] +Aggregate Attributes [2]: [max#69, max#70] +Results [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, max#71, max#72] + +(72) HashAggregate [codegen id : 62] +Input [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, max#71, max#72] +Keys [4]: [item_sk#58, d_date#59, web_sales#60, store_sales#61] +Functions [2]: [max(web_sales#66), max(store_sales#67)] +Aggregate Attributes [2]: [max(web_sales#66)#73, max(store_sales#67)#74] +Results [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, max(web_sales#66)#73 AS web_cumulative#75, max(store_sales#67)#74 AS store_cumulative#76] + +(73) Filter [codegen id : 62] +Input [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, web_cumulative#75, store_cumulative#76] +Condition : ((isnotnull(web_cumulative#75) AND isnotnull(store_cumulative#76)) AND (web_cumulative#75 > store_cumulative#76)) + +(74) TakeOrderedAndProject +Input [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, web_cumulative#75, store_cumulative#76] +Arguments: 100, [item_sk#58 ASC NULLS FIRST, d_date#59 ASC NULLS FIRST], [item_sk#58, d_date#59, web_sales#60, store_sales#61, web_cumulative#75, store_cumulative#76] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (75) + + +(75) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#5, d_date#6] + +Subquery:2 Hosting operator id = 32 Hosting Expression = ss_sold_date_sk#33 IN dynamicpruning#4 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q51a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q51a.sf100/simplified.txt new file mode 100644 index 0000000000000..fe7a795bd98e2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q51a.sf100/simplified.txt @@ -0,0 +1,134 @@ +TakeOrderedAndProject [item_sk,d_date,web_sales,store_sales,web_cumulative,store_cumulative] + WholeStageCodegen (62) + Filter [web_cumulative,store_cumulative] + HashAggregate [item_sk,d_date,web_sales,store_sales,max,max] [max(web_sales),max(store_sales),web_cumulative,store_cumulative,max,max] + HashAggregate [item_sk,d_date,web_sales,store_sales,web_sales,store_sales] [max,max,max,max] + Project [item_sk,d_date,web_sales,store_sales,web_sales,store_sales] + SortMergeJoin [item_sk,item_sk,rk,rk] + InputAdapter + Window [item_sk,d_date] + WholeStageCodegen (30) + Sort [item_sk,d_date] + InputAdapter + Exchange [item_sk] #1 + WholeStageCodegen (29) + Project [item_sk,item_sk,d_date,d_date,cume_sales,cume_sales] + Filter [item_sk,item_sk] + InputAdapter + SortMergeJoin [item_sk,d_date,item_sk,d_date] + WholeStageCodegen (14) + Sort [item_sk,d_date] + InputAdapter + Exchange [item_sk,d_date] #2 + WholeStageCodegen (13) + HashAggregate [item_sk,d_date,sumws,sum,isEmpty] [sum(sumws),cume_sales,sum,isEmpty] + HashAggregate [item_sk,d_date,sumws,sumws] [sum,isEmpty,sum,isEmpty] + Project [item_sk,d_date,sumws,sumws] + SortMergeJoin [item_sk,item_sk,rk,rk] + InputAdapter + WholeStageCodegen (6) + Sort [item_sk] + InputAdapter + Exchange [item_sk] #3 + WholeStageCodegen (5) + Project [item_sk,d_date,sumws,rk] + InputAdapter + Window [ws_item_sk,d_date] + WholeStageCodegen (4) + Sort [ws_item_sk,d_date] + InputAdapter + Exchange [ws_item_sk] #4 + WholeStageCodegen (3) + HashAggregate [ws_item_sk,d_date,sum] [sum(UnscaledValue(ws_sales_price)),item_sk,sumws,sum] + InputAdapter + Exchange [ws_item_sk,d_date] #5 + WholeStageCodegen (2) + HashAggregate [ws_item_sk,d_date,ws_sales_price] [sum,sum] + Project [ws_item_sk,ws_sales_price,d_date] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_sales_price,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Project [d_date_sk,d_date] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_month_seq] + InputAdapter + WholeStageCodegen (12) + Sort [item_sk] + InputAdapter + Exchange [item_sk] #7 + WholeStageCodegen (11) + Project [item_sk,sumws,rk] + InputAdapter + Window [ws_item_sk,d_date] + WholeStageCodegen (10) + Sort [ws_item_sk,d_date] + InputAdapter + ReusedExchange [item_sk,d_date,sumws,ws_item_sk] #8 + WholeStageCodegen (28) + Sort [item_sk,d_date] + InputAdapter + Exchange [item_sk,d_date] #9 + WholeStageCodegen (27) + HashAggregate [item_sk,d_date,sumss,sum,isEmpty] [sum(sumss),cume_sales,sum,isEmpty] + HashAggregate [item_sk,d_date,sumss,sumss] [sum,isEmpty,sum,isEmpty] + Project [item_sk,d_date,sumss,sumss] + SortMergeJoin [item_sk,item_sk,rk,rk] + InputAdapter + WholeStageCodegen (20) + Sort [item_sk] + InputAdapter + Exchange [item_sk] #10 + WholeStageCodegen (19) + Project [item_sk,d_date,sumss,rk] + InputAdapter + Window [ss_item_sk,d_date] + WholeStageCodegen (18) + Sort [ss_item_sk,d_date] + InputAdapter + Exchange [ss_item_sk] #11 + WholeStageCodegen (17) + HashAggregate [ss_item_sk,d_date,sum] [sum(UnscaledValue(ss_sales_price)),item_sk,sumss,sum] + InputAdapter + Exchange [ss_item_sk,d_date] #12 + WholeStageCodegen (16) + HashAggregate [ss_item_sk,d_date,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_sales_price,d_date] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_date] #6 + InputAdapter + WholeStageCodegen (26) + Sort [item_sk] + InputAdapter + Exchange [item_sk] #13 + WholeStageCodegen (25) + Project [item_sk,sumss,rk] + InputAdapter + Window [ss_item_sk,d_date] + WholeStageCodegen (24) + Sort [ss_item_sk,d_date] + InputAdapter + ReusedExchange [item_sk,d_date,sumss,ss_item_sk] #14 + InputAdapter + WholeStageCodegen (61) + Project [item_sk,web_sales,store_sales,rk] + InputAdapter + Window [item_sk,d_date] + WholeStageCodegen (60) + Sort [item_sk,d_date] + InputAdapter + ReusedExchange [item_sk,d_date,web_sales,store_sales] #15 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q51a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q51a/explain.txt new file mode 100644 index 0000000000000..b7d3461ce34ea --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q51a/explain.txt @@ -0,0 +1,410 @@ +== Physical Plan == +TakeOrderedAndProject (71) ++- * Filter (70) + +- * HashAggregate (69) + +- * HashAggregate (68) + +- * Project (67) + +- * BroadcastHashJoin Inner BuildRight (66) + :- Window (60) + : +- * Sort (59) + : +- Exchange (58) + : +- * Project (57) + : +- * Filter (56) + : +- SortMergeJoin FullOuter (55) + : :- * Sort (29) + : : +- Exchange (28) + : : +- * HashAggregate (27) + : : +- Exchange (26) + : : +- * HashAggregate (25) + : : +- * Project (24) + : : +- * BroadcastHashJoin Inner BuildRight (23) + : : :- * Project (17) + : : : +- Window (16) + : : : +- * Sort (15) + : : : +- Exchange (14) + : : : +- * HashAggregate (13) + : : : +- Exchange (12) + : : : +- * HashAggregate (11) + : : : +- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.web_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (22) + : : +- * Project (21) + : : +- Window (20) + : : +- * Sort (19) + : : +- ReusedExchange (18) + : +- * Sort (54) + : +- Exchange (53) + : +- * HashAggregate (52) + : +- Exchange (51) + : +- * HashAggregate (50) + : +- * Project (49) + : +- * BroadcastHashJoin Inner BuildRight (48) + : :- * Project (42) + : : +- Window (41) + : : +- * Sort (40) + : : +- Exchange (39) + : : +- * HashAggregate (38) + : : +- Exchange (37) + : : +- * HashAggregate (36) + : : +- * Project (35) + : : +- * BroadcastHashJoin Inner BuildRight (34) + : : :- * Filter (32) + : : : +- * ColumnarToRow (31) + : : : +- Scan parquet default.store_sales (30) + : : +- ReusedExchange (33) + : +- BroadcastExchange (47) + : +- * Project (46) + : +- Window (45) + : +- * Sort (44) + : +- ReusedExchange (43) + +- BroadcastExchange (65) + +- * Project (64) + +- Window (63) + +- * Sort (62) + +- ReusedExchange (61) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3] +Condition : isnotnull(ws_item_sk#1) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#5, d_date#6, d_month_seq#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#5, d_date#6, d_month_seq#7] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#5, d_date#6, d_month_seq#7] +Condition : (((isnotnull(d_month_seq#7) AND (d_month_seq#7 >= 1212)) AND (d_month_seq#7 <= 1223)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [2]: [d_date_sk#5, d_date#6] +Input [3]: [d_date_sk#5, d_date#6, d_month_seq#7] + +(8) BroadcastExchange +Input [2]: [d_date_sk#5, d_date#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 2] +Output [3]: [ws_item_sk#1, ws_sales_price#2, d_date#6] +Input [5]: [ws_item_sk#1, ws_sales_price#2, ws_sold_date_sk#3, d_date_sk#5, d_date#6] + +(11) HashAggregate [codegen id : 2] +Input [3]: [ws_item_sk#1, ws_sales_price#2, d_date#6] +Keys [2]: [ws_item_sk#1, d_date#6] +Functions [1]: [partial_sum(UnscaledValue(ws_sales_price#2))] +Aggregate Attributes [1]: [sum#9] +Results [3]: [ws_item_sk#1, d_date#6, sum#10] + +(12) Exchange +Input [3]: [ws_item_sk#1, d_date#6, sum#10] +Arguments: hashpartitioning(ws_item_sk#1, d_date#6, 5), ENSURE_REQUIREMENTS, [id=#11] + +(13) HashAggregate [codegen id : 3] +Input [3]: [ws_item_sk#1, d_date#6, sum#10] +Keys [2]: [ws_item_sk#1, d_date#6] +Functions [1]: [sum(UnscaledValue(ws_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_sales_price#2))#12] +Results [4]: [ws_item_sk#1 AS item_sk#13, d_date#6, MakeDecimal(sum(UnscaledValue(ws_sales_price#2))#12,17,2) AS sumws#14, ws_item_sk#1] + +(14) Exchange +Input [4]: [item_sk#13, d_date#6, sumws#14, ws_item_sk#1] +Arguments: hashpartitioning(ws_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#15] + +(15) Sort [codegen id : 4] +Input [4]: [item_sk#13, d_date#6, sumws#14, ws_item_sk#1] +Arguments: [ws_item_sk#1 ASC NULLS FIRST, d_date#6 ASC NULLS FIRST], false, 0 + +(16) Window +Input [4]: [item_sk#13, d_date#6, sumws#14, ws_item_sk#1] +Arguments: [row_number() windowspecdefinition(ws_item_sk#1, d_date#6 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#16], [ws_item_sk#1], [d_date#6 ASC NULLS FIRST] + +(17) Project [codegen id : 10] +Output [4]: [item_sk#13, d_date#6, sumws#14, rk#16] +Input [5]: [item_sk#13, d_date#6, sumws#14, ws_item_sk#1, rk#16] + +(18) ReusedExchange [Reuses operator id: unknown] +Output [4]: [item_sk#17, d_date#18, sumws#19, ws_item_sk#20] + +(19) Sort [codegen id : 8] +Input [4]: [item_sk#17, d_date#18, sumws#19, ws_item_sk#20] +Arguments: [ws_item_sk#20 ASC NULLS FIRST, d_date#18 ASC NULLS FIRST], false, 0 + +(20) Window +Input [4]: [item_sk#17, d_date#18, sumws#19, ws_item_sk#20] +Arguments: [row_number() windowspecdefinition(ws_item_sk#20, d_date#18 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#21], [ws_item_sk#20], [d_date#18 ASC NULLS FIRST] + +(21) Project [codegen id : 9] +Output [3]: [item_sk#17, sumws#19, rk#21] +Input [5]: [item_sk#17, d_date#18, sumws#19, ws_item_sk#20, rk#21] + +(22) BroadcastExchange +Input [3]: [item_sk#17, sumws#19, rk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#22] + +(23) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [item_sk#13] +Right keys [1]: [item_sk#17] +Join condition: (rk#16 >= rk#21) + +(24) Project [codegen id : 10] +Output [4]: [item_sk#13, d_date#6, sumws#14, sumws#19] +Input [7]: [item_sk#13, d_date#6, sumws#14, rk#16, item_sk#17, sumws#19, rk#21] + +(25) HashAggregate [codegen id : 10] +Input [4]: [item_sk#13, d_date#6, sumws#14, sumws#19] +Keys [3]: [item_sk#13, d_date#6, sumws#14] +Functions [1]: [partial_sum(sumws#19)] +Aggregate Attributes [2]: [sum#23, isEmpty#24] +Results [5]: [item_sk#13, d_date#6, sumws#14, sum#25, isEmpty#26] + +(26) Exchange +Input [5]: [item_sk#13, d_date#6, sumws#14, sum#25, isEmpty#26] +Arguments: hashpartitioning(item_sk#13, d_date#6, sumws#14, 5), ENSURE_REQUIREMENTS, [id=#27] + +(27) HashAggregate [codegen id : 11] +Input [5]: [item_sk#13, d_date#6, sumws#14, sum#25, isEmpty#26] +Keys [3]: [item_sk#13, d_date#6, sumws#14] +Functions [1]: [sum(sumws#19)] +Aggregate Attributes [1]: [sum(sumws#19)#28] +Results [3]: [item_sk#13, d_date#6, sum(sumws#19)#28 AS cume_sales#29] + +(28) Exchange +Input [3]: [item_sk#13, d_date#6, cume_sales#29] +Arguments: hashpartitioning(item_sk#13, d_date#6, 5), ENSURE_REQUIREMENTS, [id=#30] + +(29) Sort [codegen id : 12] +Input [3]: [item_sk#13, d_date#6, cume_sales#29] +Arguments: [item_sk#13 ASC NULLS FIRST, d_date#6 ASC NULLS FIRST], false, 0 + +(30) Scan parquet default.store_sales +Output [3]: [ss_item_sk#31, ss_sales_price#32, ss_sold_date_sk#33] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#33), dynamicpruningexpression(ss_sold_date_sk#33 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 14] +Input [3]: [ss_item_sk#31, ss_sales_price#32, ss_sold_date_sk#33] + +(32) Filter [codegen id : 14] +Input [3]: [ss_item_sk#31, ss_sales_price#32, ss_sold_date_sk#33] +Condition : isnotnull(ss_item_sk#31) + +(33) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#34, d_date#35] + +(34) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ss_sold_date_sk#33] +Right keys [1]: [d_date_sk#34] +Join condition: None + +(35) Project [codegen id : 14] +Output [3]: [ss_item_sk#31, ss_sales_price#32, d_date#35] +Input [5]: [ss_item_sk#31, ss_sales_price#32, ss_sold_date_sk#33, d_date_sk#34, d_date#35] + +(36) HashAggregate [codegen id : 14] +Input [3]: [ss_item_sk#31, ss_sales_price#32, d_date#35] +Keys [2]: [ss_item_sk#31, d_date#35] +Functions [1]: [partial_sum(UnscaledValue(ss_sales_price#32))] +Aggregate Attributes [1]: [sum#36] +Results [3]: [ss_item_sk#31, d_date#35, sum#37] + +(37) Exchange +Input [3]: [ss_item_sk#31, d_date#35, sum#37] +Arguments: hashpartitioning(ss_item_sk#31, d_date#35, 5), ENSURE_REQUIREMENTS, [id=#38] + +(38) HashAggregate [codegen id : 15] +Input [3]: [ss_item_sk#31, d_date#35, sum#37] +Keys [2]: [ss_item_sk#31, d_date#35] +Functions [1]: [sum(UnscaledValue(ss_sales_price#32))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_sales_price#32))#39] +Results [4]: [ss_item_sk#31 AS item_sk#40, d_date#35, MakeDecimal(sum(UnscaledValue(ss_sales_price#32))#39,17,2) AS sumss#41, ss_item_sk#31] + +(39) Exchange +Input [4]: [item_sk#40, d_date#35, sumss#41, ss_item_sk#31] +Arguments: hashpartitioning(ss_item_sk#31, 5), ENSURE_REQUIREMENTS, [id=#42] + +(40) Sort [codegen id : 16] +Input [4]: [item_sk#40, d_date#35, sumss#41, ss_item_sk#31] +Arguments: [ss_item_sk#31 ASC NULLS FIRST, d_date#35 ASC NULLS FIRST], false, 0 + +(41) Window +Input [4]: [item_sk#40, d_date#35, sumss#41, ss_item_sk#31] +Arguments: [row_number() windowspecdefinition(ss_item_sk#31, d_date#35 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#43], [ss_item_sk#31], [d_date#35 ASC NULLS FIRST] + +(42) Project [codegen id : 22] +Output [4]: [item_sk#40, d_date#35, sumss#41, rk#43] +Input [5]: [item_sk#40, d_date#35, sumss#41, ss_item_sk#31, rk#43] + +(43) ReusedExchange [Reuses operator id: unknown] +Output [4]: [item_sk#44, d_date#45, sumss#46, ss_item_sk#47] + +(44) Sort [codegen id : 20] +Input [4]: [item_sk#44, d_date#45, sumss#46, ss_item_sk#47] +Arguments: [ss_item_sk#47 ASC NULLS FIRST, d_date#45 ASC NULLS FIRST], false, 0 + +(45) Window +Input [4]: [item_sk#44, d_date#45, sumss#46, ss_item_sk#47] +Arguments: [row_number() windowspecdefinition(ss_item_sk#47, d_date#45 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#48], [ss_item_sk#47], [d_date#45 ASC NULLS FIRST] + +(46) Project [codegen id : 21] +Output [3]: [item_sk#44, sumss#46, rk#48] +Input [5]: [item_sk#44, d_date#45, sumss#46, ss_item_sk#47, rk#48] + +(47) BroadcastExchange +Input [3]: [item_sk#44, sumss#46, rk#48] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#49] + +(48) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [item_sk#40] +Right keys [1]: [item_sk#44] +Join condition: (rk#43 >= rk#48) + +(49) Project [codegen id : 22] +Output [4]: [item_sk#40, d_date#35, sumss#41, sumss#46] +Input [7]: [item_sk#40, d_date#35, sumss#41, rk#43, item_sk#44, sumss#46, rk#48] + +(50) HashAggregate [codegen id : 22] +Input [4]: [item_sk#40, d_date#35, sumss#41, sumss#46] +Keys [3]: [item_sk#40, d_date#35, sumss#41] +Functions [1]: [partial_sum(sumss#46)] +Aggregate Attributes [2]: [sum#50, isEmpty#51] +Results [5]: [item_sk#40, d_date#35, sumss#41, sum#52, isEmpty#53] + +(51) Exchange +Input [5]: [item_sk#40, d_date#35, sumss#41, sum#52, isEmpty#53] +Arguments: hashpartitioning(item_sk#40, d_date#35, sumss#41, 5), ENSURE_REQUIREMENTS, [id=#54] + +(52) HashAggregate [codegen id : 23] +Input [5]: [item_sk#40, d_date#35, sumss#41, sum#52, isEmpty#53] +Keys [3]: [item_sk#40, d_date#35, sumss#41] +Functions [1]: [sum(sumss#46)] +Aggregate Attributes [1]: [sum(sumss#46)#55] +Results [3]: [item_sk#40, d_date#35, sum(sumss#46)#55 AS cume_sales#56] + +(53) Exchange +Input [3]: [item_sk#40, d_date#35, cume_sales#56] +Arguments: hashpartitioning(item_sk#40, d_date#35, 5), ENSURE_REQUIREMENTS, [id=#57] + +(54) Sort [codegen id : 24] +Input [3]: [item_sk#40, d_date#35, cume_sales#56] +Arguments: [item_sk#40 ASC NULLS FIRST, d_date#35 ASC NULLS FIRST], false, 0 + +(55) SortMergeJoin +Left keys [2]: [item_sk#13, d_date#6] +Right keys [2]: [item_sk#40, d_date#35] +Join condition: None + +(56) Filter [codegen id : 25] +Input [6]: [item_sk#13, d_date#6, cume_sales#29, item_sk#40, d_date#35, cume_sales#56] +Condition : isnotnull(CASE WHEN isnotnull(item_sk#13) THEN item_sk#13 ELSE item_sk#40 END) + +(57) Project [codegen id : 25] +Output [4]: [CASE WHEN isnotnull(item_sk#13) THEN item_sk#13 ELSE item_sk#40 END AS item_sk#58, CASE WHEN isnotnull(d_date#6) THEN d_date#6 ELSE d_date#35 END AS d_date#59, cume_sales#29 AS web_sales#60, cume_sales#56 AS store_sales#61] +Input [6]: [item_sk#13, d_date#6, cume_sales#29, item_sk#40, d_date#35, cume_sales#56] + +(58) Exchange +Input [4]: [item_sk#58, d_date#59, web_sales#60, store_sales#61] +Arguments: hashpartitioning(item_sk#58, 5), ENSURE_REQUIREMENTS, [id=#62] + +(59) Sort [codegen id : 26] +Input [4]: [item_sk#58, d_date#59, web_sales#60, store_sales#61] +Arguments: [item_sk#58 ASC NULLS FIRST, d_date#59 ASC NULLS FIRST], false, 0 + +(60) Window +Input [4]: [item_sk#58, d_date#59, web_sales#60, store_sales#61] +Arguments: [row_number() windowspecdefinition(item_sk#58, d_date#59 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#63], [item_sk#58], [d_date#59 ASC NULLS FIRST] + +(61) ReusedExchange [Reuses operator id: unknown] +Output [4]: [item_sk#64, d_date#65, web_sales#66, store_sales#67] + +(62) Sort [codegen id : 52] +Input [4]: [item_sk#64, d_date#65, web_sales#66, store_sales#67] +Arguments: [item_sk#64 ASC NULLS FIRST, d_date#65 ASC NULLS FIRST], false, 0 + +(63) Window +Input [4]: [item_sk#64, d_date#65, web_sales#66, store_sales#67] +Arguments: [row_number() windowspecdefinition(item_sk#64, d_date#65 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#68], [item_sk#64], [d_date#65 ASC NULLS FIRST] + +(64) Project [codegen id : 53] +Output [4]: [item_sk#64, web_sales#66, store_sales#67, rk#68] +Input [5]: [item_sk#64, d_date#65, web_sales#66, store_sales#67, rk#68] + +(65) BroadcastExchange +Input [4]: [item_sk#64, web_sales#66, store_sales#67, rk#68] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#69] + +(66) BroadcastHashJoin [codegen id : 54] +Left keys [1]: [item_sk#58] +Right keys [1]: [item_sk#64] +Join condition: (rk#63 >= rk#68) + +(67) Project [codegen id : 54] +Output [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, web_sales#66, store_sales#67] +Input [9]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, rk#63, item_sk#64, web_sales#66, store_sales#67, rk#68] + +(68) HashAggregate [codegen id : 54] +Input [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, web_sales#66, store_sales#67] +Keys [4]: [item_sk#58, d_date#59, web_sales#60, store_sales#61] +Functions [2]: [partial_max(web_sales#66), partial_max(store_sales#67)] +Aggregate Attributes [2]: [max#70, max#71] +Results [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, max#72, max#73] + +(69) HashAggregate [codegen id : 54] +Input [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, max#72, max#73] +Keys [4]: [item_sk#58, d_date#59, web_sales#60, store_sales#61] +Functions [2]: [max(web_sales#66), max(store_sales#67)] +Aggregate Attributes [2]: [max(web_sales#66)#74, max(store_sales#67)#75] +Results [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, max(web_sales#66)#74 AS web_cumulative#76, max(store_sales#67)#75 AS store_cumulative#77] + +(70) Filter [codegen id : 54] +Input [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, web_cumulative#76, store_cumulative#77] +Condition : ((isnotnull(web_cumulative#76) AND isnotnull(store_cumulative#77)) AND (web_cumulative#76 > store_cumulative#77)) + +(71) TakeOrderedAndProject +Input [6]: [item_sk#58, d_date#59, web_sales#60, store_sales#61, web_cumulative#76, store_cumulative#77] +Arguments: 100, [item_sk#58 ASC NULLS FIRST, d_date#59 ASC NULLS FIRST], [item_sk#58, d_date#59, web_sales#60, store_sales#61, web_cumulative#76, store_cumulative#77] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (72) + + +(72) ReusedExchange [Reuses operator id: 8] +Output [2]: [d_date_sk#5, d_date#6] + +Subquery:2 Hosting operator id = 30 Hosting Expression = ss_sold_date_sk#33 IN dynamicpruning#4 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q51a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q51a/simplified.txt new file mode 100644 index 0000000000000..0359376372a8b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q51a/simplified.txt @@ -0,0 +1,123 @@ +TakeOrderedAndProject [item_sk,d_date,web_sales,store_sales,web_cumulative,store_cumulative] + WholeStageCodegen (54) + Filter [web_cumulative,store_cumulative] + HashAggregate [item_sk,d_date,web_sales,store_sales,max,max] [max(web_sales),max(store_sales),web_cumulative,store_cumulative,max,max] + HashAggregate [item_sk,d_date,web_sales,store_sales,web_sales,store_sales] [max,max,max,max] + Project [item_sk,d_date,web_sales,store_sales,web_sales,store_sales] + BroadcastHashJoin [item_sk,item_sk,rk,rk] + InputAdapter + Window [item_sk,d_date] + WholeStageCodegen (26) + Sort [item_sk,d_date] + InputAdapter + Exchange [item_sk] #1 + WholeStageCodegen (25) + Project [item_sk,item_sk,d_date,d_date,cume_sales,cume_sales] + Filter [item_sk,item_sk] + InputAdapter + SortMergeJoin [item_sk,d_date,item_sk,d_date] + WholeStageCodegen (12) + Sort [item_sk,d_date] + InputAdapter + Exchange [item_sk,d_date] #2 + WholeStageCodegen (11) + HashAggregate [item_sk,d_date,sumws,sum,isEmpty] [sum(sumws),cume_sales,sum,isEmpty] + InputAdapter + Exchange [item_sk,d_date,sumws] #3 + WholeStageCodegen (10) + HashAggregate [item_sk,d_date,sumws,sumws] [sum,isEmpty,sum,isEmpty] + Project [item_sk,d_date,sumws,sumws] + BroadcastHashJoin [item_sk,item_sk,rk,rk] + Project [item_sk,d_date,sumws,rk] + InputAdapter + Window [ws_item_sk,d_date] + WholeStageCodegen (4) + Sort [ws_item_sk,d_date] + InputAdapter + Exchange [ws_item_sk] #4 + WholeStageCodegen (3) + HashAggregate [ws_item_sk,d_date,sum] [sum(UnscaledValue(ws_sales_price)),item_sk,sumws,sum] + InputAdapter + Exchange [ws_item_sk,d_date] #5 + WholeStageCodegen (2) + HashAggregate [ws_item_sk,d_date,ws_sales_price] [sum,sum] + Project [ws_item_sk,ws_sales_price,d_date] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_sales_price,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Project [d_date_sk,d_date] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_month_seq] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (9) + Project [item_sk,sumws,rk] + InputAdapter + Window [ws_item_sk,d_date] + WholeStageCodegen (8) + Sort [ws_item_sk,d_date] + InputAdapter + ReusedExchange [item_sk,d_date,sumws,ws_item_sk] #8 + WholeStageCodegen (24) + Sort [item_sk,d_date] + InputAdapter + Exchange [item_sk,d_date] #9 + WholeStageCodegen (23) + HashAggregate [item_sk,d_date,sumss,sum,isEmpty] [sum(sumss),cume_sales,sum,isEmpty] + InputAdapter + Exchange [item_sk,d_date,sumss] #10 + WholeStageCodegen (22) + HashAggregate [item_sk,d_date,sumss,sumss] [sum,isEmpty,sum,isEmpty] + Project [item_sk,d_date,sumss,sumss] + BroadcastHashJoin [item_sk,item_sk,rk,rk] + Project [item_sk,d_date,sumss,rk] + InputAdapter + Window [ss_item_sk,d_date] + WholeStageCodegen (16) + Sort [ss_item_sk,d_date] + InputAdapter + Exchange [ss_item_sk] #11 + WholeStageCodegen (15) + HashAggregate [ss_item_sk,d_date,sum] [sum(UnscaledValue(ss_sales_price)),item_sk,sumss,sum] + InputAdapter + Exchange [ss_item_sk,d_date] #12 + WholeStageCodegen (14) + HashAggregate [ss_item_sk,d_date,ss_sales_price] [sum,sum] + Project [ss_item_sk,ss_sales_price,d_date] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_date] #6 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (21) + Project [item_sk,sumss,rk] + InputAdapter + Window [ss_item_sk,d_date] + WholeStageCodegen (20) + Sort [ss_item_sk,d_date] + InputAdapter + ReusedExchange [item_sk,d_date,sumss,ss_item_sk] #14 + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (53) + Project [item_sk,web_sales,store_sales,rk] + InputAdapter + Window [item_sk,d_date] + WholeStageCodegen (52) + Sort [item_sk,d_date] + InputAdapter + ReusedExchange [item_sk,d_date,web_sales,store_sales] #16 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q57.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q57.sf100/explain.txt new file mode 100644 index 0000000000000..e3de4a7a053b1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q57.sf100/explain.txt @@ -0,0 +1,314 @@ +== Physical Plan == +TakeOrderedAndProject (56) ++- * Project (55) + +- * SortMergeJoin Inner (54) + :- * Project (47) + : +- * SortMergeJoin Inner (46) + : :- * Sort (37) + : : +- Exchange (36) + : : +- * Filter (35) + : : +- Window (34) + : : +- * Sort (33) + : : +- Exchange (32) + : : +- * Project (31) + : : +- Window (30) + : : +- * Sort (29) + : : +- Exchange (28) + : : +- * HashAggregate (27) + : : +- Exchange (26) + : : +- * HashAggregate (25) + : : +- * Project (24) + : : +- * SortMergeJoin Inner (23) + : : :- * Sort (17) + : : : +- Exchange (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.call_center (10) + : : +- * Sort (22) + : : +- Exchange (21) + : : +- * Filter (20) + : : +- * ColumnarToRow (19) + : : +- Scan parquet default.item (18) + : +- * Sort (45) + : +- Exchange (44) + : +- * Project (43) + : +- Window (42) + : +- * Sort (41) + : +- Exchange (40) + : +- * HashAggregate (39) + : +- ReusedExchange (38) + +- * Sort (53) + +- Exchange (52) + +- * Project (51) + +- Window (50) + +- * Sort (49) + +- ReusedExchange (48) + + +(1) Scan parquet default.catalog_sales +Output [4]: [cs_call_center_sk#1, cs_item_sk#2, cs_sales_price#3, cs_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#4), dynamicpruningexpression(cs_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_call_center_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [cs_call_center_sk#1, cs_item_sk#2, cs_sales_price#3, cs_sold_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [cs_call_center_sk#1, cs_item_sk#2, cs_sales_price#3, cs_sold_date_sk#4] +Condition : (isnotnull(cs_item_sk#2) AND isnotnull(cs_call_center_sk#1)) + +(4) Scan parquet default.date_dim +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(Or(EqualTo(d_year,1999),And(EqualTo(d_year,1998),EqualTo(d_moy,12))),And(EqualTo(d_year,2000),EqualTo(d_moy,1))), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] + +(6) Filter [codegen id : 1] +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Condition : ((((d_year#7 = 1999) OR ((d_year#7 = 1998) AND (d_moy#8 = 12))) OR ((d_year#7 = 2000) AND (d_moy#8 = 1))) AND isnotnull(d_date_sk#6)) + +(7) BroadcastExchange +Input [3]: [d_date_sk#6, d_year#7, d_moy#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(9) Project [codegen id : 3] +Output [5]: [cs_call_center_sk#1, cs_item_sk#2, cs_sales_price#3, d_year#7, d_moy#8] +Input [7]: [cs_call_center_sk#1, cs_item_sk#2, cs_sales_price#3, cs_sold_date_sk#4, d_date_sk#6, d_year#7, d_moy#8] + +(10) Scan parquet default.call_center +Output [2]: [cc_call_center_sk#10, cc_name#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_call_center_sk), IsNotNull(cc_name)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [cc_call_center_sk#10, cc_name#11] + +(12) Filter [codegen id : 2] +Input [2]: [cc_call_center_sk#10, cc_name#11] +Condition : (isnotnull(cc_call_center_sk#10) AND isnotnull(cc_name#11)) + +(13) BroadcastExchange +Input [2]: [cc_call_center_sk#10, cc_name#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_call_center_sk#1] +Right keys [1]: [cc_call_center_sk#10] +Join condition: None + +(15) Project [codegen id : 3] +Output [5]: [cs_item_sk#2, cs_sales_price#3, d_year#7, d_moy#8, cc_name#11] +Input [7]: [cs_call_center_sk#1, cs_item_sk#2, cs_sales_price#3, d_year#7, d_moy#8, cc_call_center_sk#10, cc_name#11] + +(16) Exchange +Input [5]: [cs_item_sk#2, cs_sales_price#3, d_year#7, d_moy#8, cc_name#11] +Arguments: hashpartitioning(cs_item_sk#2, 5), ENSURE_REQUIREMENTS, [id=#13] + +(17) Sort [codegen id : 4] +Input [5]: [cs_item_sk#2, cs_sales_price#3, d_year#7, d_moy#8, cc_name#11] +Arguments: [cs_item_sk#2 ASC NULLS FIRST], false, 0 + +(18) Scan parquet default.item +Output [3]: [i_item_sk#14, i_brand#15, i_category#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_category), IsNotNull(i_brand)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 5] +Input [3]: [i_item_sk#14, i_brand#15, i_category#16] + +(20) Filter [codegen id : 5] +Input [3]: [i_item_sk#14, i_brand#15, i_category#16] +Condition : ((isnotnull(i_item_sk#14) AND isnotnull(i_category#16)) AND isnotnull(i_brand#15)) + +(21) Exchange +Input [3]: [i_item_sk#14, i_brand#15, i_category#16] +Arguments: hashpartitioning(i_item_sk#14, 5), ENSURE_REQUIREMENTS, [id=#17] + +(22) Sort [codegen id : 6] +Input [3]: [i_item_sk#14, i_brand#15, i_category#16] +Arguments: [i_item_sk#14 ASC NULLS FIRST], false, 0 + +(23) SortMergeJoin [codegen id : 7] +Left keys [1]: [cs_item_sk#2] +Right keys [1]: [i_item_sk#14] +Join condition: None + +(24) Project [codegen id : 7] +Output [6]: [i_brand#15, i_category#16, cs_sales_price#3, d_year#7, d_moy#8, cc_name#11] +Input [8]: [cs_item_sk#2, cs_sales_price#3, d_year#7, d_moy#8, cc_name#11, i_item_sk#14, i_brand#15, i_category#16] + +(25) HashAggregate [codegen id : 7] +Input [6]: [i_brand#15, i_category#16, cs_sales_price#3, d_year#7, d_moy#8, cc_name#11] +Keys [5]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8] +Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#3))] +Aggregate Attributes [1]: [sum#18] +Results [6]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum#19] + +(26) Exchange +Input [6]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum#19] +Arguments: hashpartitioning(i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, 5), ENSURE_REQUIREMENTS, [id=#20] + +(27) HashAggregate [codegen id : 8] +Input [6]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum#19] +Keys [5]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8] +Functions [1]: [sum(UnscaledValue(cs_sales_price#3))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#3))#21] +Results [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, MakeDecimal(sum(UnscaledValue(cs_sales_price#3))#21,17,2) AS sum_sales#22, MakeDecimal(sum(UnscaledValue(cs_sales_price#3))#21,17,2) AS _w0#23] + +(28) Exchange +Input [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, _w0#23] +Arguments: hashpartitioning(i_category#16, i_brand#15, cc_name#11, d_year#7, 5), ENSURE_REQUIREMENTS, [id=#24] + +(29) Sort [codegen id : 9] +Input [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, _w0#23] +Arguments: [i_category#16 ASC NULLS FIRST, i_brand#15 ASC NULLS FIRST, cc_name#11 ASC NULLS FIRST, d_year#7 ASC NULLS FIRST], false, 0 + +(30) Window +Input [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, _w0#23] +Arguments: [avg(_w0#23) windowspecdefinition(i_category#16, i_brand#15, cc_name#11, d_year#7, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#25], [i_category#16, i_brand#15, cc_name#11, d_year#7] + +(31) Project [codegen id : 10] +Output [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25] +Input [8]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, _w0#23, avg_monthly_sales#25] + +(32) Exchange +Input [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25] +Arguments: hashpartitioning(i_category#16, i_brand#15, cc_name#11, 5), ENSURE_REQUIREMENTS, [id=#26] + +(33) Sort [codegen id : 11] +Input [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25] +Arguments: [i_category#16 ASC NULLS FIRST, i_brand#15 ASC NULLS FIRST, cc_name#11 ASC NULLS FIRST, d_year#7 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST], false, 0 + +(34) Window +Input [7]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25] +Arguments: [rank(d_year#7, d_moy#8) windowspecdefinition(i_category#16, i_brand#15, cc_name#11, d_year#7 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#27], [i_category#16, i_brand#15, cc_name#11], [d_year#7 ASC NULLS FIRST, d_moy#8 ASC NULLS FIRST] + +(35) Filter [codegen id : 12] +Input [8]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25, rn#27] +Condition : ((((isnotnull(d_year#7) AND isnotnull(avg_monthly_sales#25)) AND (d_year#7 = 1999)) AND (avg_monthly_sales#25 > 0.000000)) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)) + +(36) Exchange +Input [8]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25, rn#27] +Arguments: hashpartitioning(i_category#16, i_brand#15, cc_name#11, rn#27, 5), ENSURE_REQUIREMENTS, [id=#28] + +(37) Sort [codegen id : 13] +Input [8]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25, rn#27] +Arguments: [i_category#16 ASC NULLS FIRST, i_brand#15 ASC NULLS FIRST, cc_name#11 ASC NULLS FIRST, rn#27 ASC NULLS FIRST], false, 0 + +(38) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, sum#34] + +(39) HashAggregate [codegen id : 21] +Input [6]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, sum#34] +Keys [5]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33] +Functions [1]: [sum(UnscaledValue(cs_sales_price#35))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#35))#36] +Results [6]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, MakeDecimal(sum(UnscaledValue(cs_sales_price#35))#36,17,2) AS sum_sales#37] + +(40) Exchange +Input [6]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, sum_sales#37] +Arguments: hashpartitioning(i_category#29, i_brand#30, cc_name#31, 5), ENSURE_REQUIREMENTS, [id=#38] + +(41) Sort [codegen id : 22] +Input [6]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, sum_sales#37] +Arguments: [i_category#29 ASC NULLS FIRST, i_brand#30 ASC NULLS FIRST, cc_name#31 ASC NULLS FIRST, d_year#32 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST], false, 0 + +(42) Window +Input [6]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, sum_sales#37] +Arguments: [rank(d_year#32, d_moy#33) windowspecdefinition(i_category#29, i_brand#30, cc_name#31, d_year#32 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#39], [i_category#29, i_brand#30, cc_name#31], [d_year#32 ASC NULLS FIRST, d_moy#33 ASC NULLS FIRST] + +(43) Project [codegen id : 23] +Output [5]: [i_category#29, i_brand#30, cc_name#31, sum_sales#37, rn#39] +Input [7]: [i_category#29, i_brand#30, cc_name#31, d_year#32, d_moy#33, sum_sales#37, rn#39] + +(44) Exchange +Input [5]: [i_category#29, i_brand#30, cc_name#31, sum_sales#37, rn#39] +Arguments: hashpartitioning(i_category#29, i_brand#30, cc_name#31, (rn#39 + 1), 5), ENSURE_REQUIREMENTS, [id=#40] + +(45) Sort [codegen id : 24] +Input [5]: [i_category#29, i_brand#30, cc_name#31, sum_sales#37, rn#39] +Arguments: [i_category#29 ASC NULLS FIRST, i_brand#30 ASC NULLS FIRST, cc_name#31 ASC NULLS FIRST, (rn#39 + 1) ASC NULLS FIRST], false, 0 + +(46) SortMergeJoin [codegen id : 25] +Left keys [4]: [i_category#16, i_brand#15, cc_name#11, rn#27] +Right keys [4]: [i_category#29, i_brand#30, cc_name#31, (rn#39 + 1)] +Join condition: None + +(47) Project [codegen id : 25] +Output [9]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25, rn#27, sum_sales#37] +Input [13]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25, rn#27, i_category#29, i_brand#30, cc_name#31, sum_sales#37, rn#39] + +(48) ReusedExchange [Reuses operator id: 40] +Output [6]: [i_category#41, i_brand#42, cc_name#43, d_year#44, d_moy#45, sum_sales#46] + +(49) Sort [codegen id : 34] +Input [6]: [i_category#41, i_brand#42, cc_name#43, d_year#44, d_moy#45, sum_sales#46] +Arguments: [i_category#41 ASC NULLS FIRST, i_brand#42 ASC NULLS FIRST, cc_name#43 ASC NULLS FIRST, d_year#44 ASC NULLS FIRST, d_moy#45 ASC NULLS FIRST], false, 0 + +(50) Window +Input [6]: [i_category#41, i_brand#42, cc_name#43, d_year#44, d_moy#45, sum_sales#46] +Arguments: [rank(d_year#44, d_moy#45) windowspecdefinition(i_category#41, i_brand#42, cc_name#43, d_year#44 ASC NULLS FIRST, d_moy#45 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#47], [i_category#41, i_brand#42, cc_name#43], [d_year#44 ASC NULLS FIRST, d_moy#45 ASC NULLS FIRST] + +(51) Project [codegen id : 35] +Output [5]: [i_category#41, i_brand#42, cc_name#43, sum_sales#46, rn#47] +Input [7]: [i_category#41, i_brand#42, cc_name#43, d_year#44, d_moy#45, sum_sales#46, rn#47] + +(52) Exchange +Input [5]: [i_category#41, i_brand#42, cc_name#43, sum_sales#46, rn#47] +Arguments: hashpartitioning(i_category#41, i_brand#42, cc_name#43, (rn#47 - 1), 5), ENSURE_REQUIREMENTS, [id=#48] + +(53) Sort [codegen id : 36] +Input [5]: [i_category#41, i_brand#42, cc_name#43, sum_sales#46, rn#47] +Arguments: [i_category#41 ASC NULLS FIRST, i_brand#42 ASC NULLS FIRST, cc_name#43 ASC NULLS FIRST, (rn#47 - 1) ASC NULLS FIRST], false, 0 + +(54) SortMergeJoin [codegen id : 37] +Left keys [4]: [i_category#16, i_brand#15, cc_name#11, rn#27] +Right keys [4]: [i_category#41, i_brand#42, cc_name#43, (rn#47 - 1)] +Join condition: None + +(55) Project [codegen id : 37] +Output [8]: [i_category#16, i_brand#15, d_year#7, d_moy#8, avg_monthly_sales#25, sum_sales#22, sum_sales#37 AS psum#49, sum_sales#46 AS nsum#50] +Input [14]: [i_category#16, i_brand#15, cc_name#11, d_year#7, d_moy#8, sum_sales#22, avg_monthly_sales#25, rn#27, sum_sales#37, i_category#41, i_brand#42, cc_name#43, sum_sales#46, rn#47] + +(56) TakeOrderedAndProject +Input [8]: [i_category#16, i_brand#15, d_year#7, d_moy#8, avg_monthly_sales#25, sum_sales#22, psum#49, nsum#50] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#22 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#25 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, d_year#7 ASC NULLS FIRST], [i_category#16, i_brand#15, d_year#7, d_moy#8, avg_monthly_sales#25, sum_sales#22, psum#49, nsum#50] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (57) + + +(57) ReusedExchange [Reuses operator id: 7] +Output [3]: [d_date_sk#6, d_year#7, d_moy#8] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q57.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q57.sf100/simplified.txt new file mode 100644 index 0000000000000..1a4bc755694d0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q57.sf100/simplified.txt @@ -0,0 +1,107 @@ +TakeOrderedAndProject [sum_sales,avg_monthly_sales,d_year,i_category,i_brand,d_moy,psum,nsum] + WholeStageCodegen (37) + Project [i_category,i_brand,d_year,d_moy,avg_monthly_sales,sum_sales,sum_sales,sum_sales] + SortMergeJoin [i_category,i_brand,cc_name,rn,i_category,i_brand,cc_name,rn] + InputAdapter + WholeStageCodegen (25) + Project [i_category,i_brand,cc_name,d_year,d_moy,sum_sales,avg_monthly_sales,rn,sum_sales] + SortMergeJoin [i_category,i_brand,cc_name,rn,i_category,i_brand,cc_name,rn] + InputAdapter + WholeStageCodegen (13) + Sort [i_category,i_brand,cc_name,rn] + InputAdapter + Exchange [i_category,i_brand,cc_name,rn] #1 + WholeStageCodegen (12) + Filter [d_year,avg_monthly_sales,sum_sales] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,cc_name] + WholeStageCodegen (11) + Sort [i_category,i_brand,cc_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,cc_name] #2 + WholeStageCodegen (10) + Project [i_category,i_brand,cc_name,d_year,d_moy,sum_sales,avg_monthly_sales] + InputAdapter + Window [_w0,i_category,i_brand,cc_name,d_year] + WholeStageCodegen (9) + Sort [i_category,i_brand,cc_name,d_year] + InputAdapter + Exchange [i_category,i_brand,cc_name,d_year] #3 + WholeStageCodegen (8) + HashAggregate [i_category,i_brand,cc_name,d_year,d_moy,sum] [sum(UnscaledValue(cs_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_category,i_brand,cc_name,d_year,d_moy] #4 + WholeStageCodegen (7) + HashAggregate [i_category,i_brand,cc_name,d_year,d_moy,cs_sales_price] [sum,sum] + Project [i_brand,i_category,cs_sales_price,d_year,d_moy,cc_name] + SortMergeJoin [cs_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #5 + WholeStageCodegen (3) + Project [cs_item_sk,cs_sales_price,d_year,d_moy,cc_name] + BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] + Project [cs_call_center_sk,cs_item_sk,cs_sales_price,d_year,d_moy] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Filter [cs_item_sk,cs_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_call_center_sk,cs_item_sk,cs_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy] #6 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (2) + Filter [cc_call_center_sk,cc_name] + ColumnarToRow + InputAdapter + Scan parquet default.call_center [cc_call_center_sk,cc_name] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #8 + WholeStageCodegen (5) + Filter [i_item_sk,i_category,i_brand] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_category] + InputAdapter + WholeStageCodegen (24) + Sort [i_category,i_brand,cc_name,rn] + InputAdapter + Exchange [i_category,i_brand,cc_name,rn] #9 + WholeStageCodegen (23) + Project [i_category,i_brand,cc_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,cc_name] + WholeStageCodegen (22) + Sort [i_category,i_brand,cc_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,cc_name] #10 + WholeStageCodegen (21) + HashAggregate [i_category,i_brand,cc_name,d_year,d_moy,sum] [sum(UnscaledValue(cs_sales_price)),sum_sales,sum] + InputAdapter + ReusedExchange [i_category,i_brand,cc_name,d_year,d_moy,sum] #11 + InputAdapter + WholeStageCodegen (36) + Sort [i_category,i_brand,cc_name,rn] + InputAdapter + Exchange [i_category,i_brand,cc_name,rn] #12 + WholeStageCodegen (35) + Project [i_category,i_brand,cc_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,cc_name] + WholeStageCodegen (34) + Sort [i_category,i_brand,cc_name,d_year,d_moy] + InputAdapter + ReusedExchange [i_category,i_brand,cc_name,d_year,d_moy,sum_sales] #10 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q57/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q57/explain.txt new file mode 100644 index 0000000000000..a6742cf4ab1cf --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q57/explain.txt @@ -0,0 +1,279 @@ +== Physical Plan == +TakeOrderedAndProject (49) ++- * Project (48) + +- * BroadcastHashJoin Inner BuildRight (47) + :- * Project (41) + : +- * BroadcastHashJoin Inner BuildRight (40) + : :- * Filter (32) + : : +- Window (31) + : : +- * Sort (30) + : : +- Exchange (29) + : : +- * Project (28) + : : +- Window (27) + : : +- * Sort (26) + : : +- Exchange (25) + : : +- * HashAggregate (24) + : : +- Exchange (23) + : : +- * HashAggregate (22) + : : +- * Project (21) + : : +- * BroadcastHashJoin Inner BuildRight (20) + : : :- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.item (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.catalog_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (19) + : : +- * Filter (18) + : : +- * ColumnarToRow (17) + : : +- Scan parquet default.call_center (16) + : +- BroadcastExchange (39) + : +- * Project (38) + : +- Window (37) + : +- * Sort (36) + : +- Exchange (35) + : +- * HashAggregate (34) + : +- ReusedExchange (33) + +- BroadcastExchange (46) + +- * Project (45) + +- Window (44) + +- * Sort (43) + +- ReusedExchange (42) + + +(1) Scan parquet default.item +Output [3]: [i_item_sk#1, i_brand#2, i_category#3] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk), IsNotNull(i_category), IsNotNull(i_brand)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [3]: [i_item_sk#1, i_brand#2, i_category#3] + +(3) Filter [codegen id : 4] +Input [3]: [i_item_sk#1, i_brand#2, i_category#3] +Condition : ((isnotnull(i_item_sk#1) AND isnotnull(i_category#3)) AND isnotnull(i_brand#2)) + +(4) Scan parquet default.catalog_sales +Output [4]: [cs_call_center_sk#4, cs_item_sk#5, cs_sales_price#6, cs_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#7), dynamicpruningexpression(cs_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_call_center_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [cs_call_center_sk#4, cs_item_sk#5, cs_sales_price#6, cs_sold_date_sk#7] + +(6) Filter [codegen id : 1] +Input [4]: [cs_call_center_sk#4, cs_item_sk#5, cs_sales_price#6, cs_sold_date_sk#7] +Condition : (isnotnull(cs_item_sk#5) AND isnotnull(cs_call_center_sk#4)) + +(7) BroadcastExchange +Input [4]: [cs_call_center_sk#4, cs_item_sk#5, cs_sales_price#6, cs_sold_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#9] + +(8) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [i_item_sk#1] +Right keys [1]: [cs_item_sk#5] +Join condition: None + +(9) Project [codegen id : 4] +Output [5]: [i_brand#2, i_category#3, cs_call_center_sk#4, cs_sales_price#6, cs_sold_date_sk#7] +Input [7]: [i_item_sk#1, i_brand#2, i_category#3, cs_call_center_sk#4, cs_item_sk#5, cs_sales_price#6, cs_sold_date_sk#7] + +(10) Scan parquet default.date_dim +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [Or(Or(EqualTo(d_year,1999),And(EqualTo(d_year,1998),EqualTo(d_moy,12))),And(EqualTo(d_year,2000),EqualTo(d_moy,1))), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] + +(12) Filter [codegen id : 2] +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Condition : ((((d_year#11 = 1999) OR ((d_year#11 = 1998) AND (d_moy#12 = 12))) OR ((d_year#11 = 2000) AND (d_moy#12 = 1))) AND isnotnull(d_date_sk#10)) + +(13) BroadcastExchange +Input [3]: [d_date_sk#10, d_year#11, d_moy#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#13] + +(14) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_sold_date_sk#7] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(15) Project [codegen id : 4] +Output [6]: [i_brand#2, i_category#3, cs_call_center_sk#4, cs_sales_price#6, d_year#11, d_moy#12] +Input [8]: [i_brand#2, i_category#3, cs_call_center_sk#4, cs_sales_price#6, cs_sold_date_sk#7, d_date_sk#10, d_year#11, d_moy#12] + +(16) Scan parquet default.call_center +Output [2]: [cc_call_center_sk#14, cc_name#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/call_center] +PushedFilters: [IsNotNull(cc_call_center_sk), IsNotNull(cc_name)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [2]: [cc_call_center_sk#14, cc_name#15] + +(18) Filter [codegen id : 3] +Input [2]: [cc_call_center_sk#14, cc_name#15] +Condition : (isnotnull(cc_call_center_sk#14) AND isnotnull(cc_name#15)) + +(19) BroadcastExchange +Input [2]: [cc_call_center_sk#14, cc_name#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(20) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_call_center_sk#4] +Right keys [1]: [cc_call_center_sk#14] +Join condition: None + +(21) Project [codegen id : 4] +Output [6]: [i_brand#2, i_category#3, cs_sales_price#6, d_year#11, d_moy#12, cc_name#15] +Input [8]: [i_brand#2, i_category#3, cs_call_center_sk#4, cs_sales_price#6, d_year#11, d_moy#12, cc_call_center_sk#14, cc_name#15] + +(22) HashAggregate [codegen id : 4] +Input [6]: [i_brand#2, i_category#3, cs_sales_price#6, d_year#11, d_moy#12, cc_name#15] +Keys [5]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12] +Functions [1]: [partial_sum(UnscaledValue(cs_sales_price#6))] +Aggregate Attributes [1]: [sum#17] +Results [6]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum#18] + +(23) Exchange +Input [6]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum#18] +Arguments: hashpartitioning(i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, 5), ENSURE_REQUIREMENTS, [id=#19] + +(24) HashAggregate [codegen id : 5] +Input [6]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum#18] +Keys [5]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12] +Functions [1]: [sum(UnscaledValue(cs_sales_price#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#6))#20] +Results [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, MakeDecimal(sum(UnscaledValue(cs_sales_price#6))#20,17,2) AS sum_sales#21, MakeDecimal(sum(UnscaledValue(cs_sales_price#6))#20,17,2) AS _w0#22] + +(25) Exchange +Input [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, _w0#22] +Arguments: hashpartitioning(i_category#3, i_brand#2, cc_name#15, d_year#11, 5), ENSURE_REQUIREMENTS, [id=#23] + +(26) Sort [codegen id : 6] +Input [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, _w0#22] +Arguments: [i_category#3 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, cc_name#15 ASC NULLS FIRST, d_year#11 ASC NULLS FIRST], false, 0 + +(27) Window +Input [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, _w0#22] +Arguments: [avg(_w0#22) windowspecdefinition(i_category#3, i_brand#2, cc_name#15, d_year#11, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS avg_monthly_sales#24], [i_category#3, i_brand#2, cc_name#15, d_year#11] + +(28) Project [codegen id : 7] +Output [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24] +Input [8]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, _w0#22, avg_monthly_sales#24] + +(29) Exchange +Input [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24] +Arguments: hashpartitioning(i_category#3, i_brand#2, cc_name#15, 5), ENSURE_REQUIREMENTS, [id=#25] + +(30) Sort [codegen id : 8] +Input [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24] +Arguments: [i_category#3 ASC NULLS FIRST, i_brand#2 ASC NULLS FIRST, cc_name#15 ASC NULLS FIRST, d_year#11 ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST], false, 0 + +(31) Window +Input [7]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24] +Arguments: [rank(d_year#11, d_moy#12) windowspecdefinition(i_category#3, i_brand#2, cc_name#15, d_year#11 ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#26], [i_category#3, i_brand#2, cc_name#15], [d_year#11 ASC NULLS FIRST, d_moy#12 ASC NULLS FIRST] + +(32) Filter [codegen id : 23] +Input [8]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24, rn#26] +Condition : ((((isnotnull(d_year#11) AND isnotnull(avg_monthly_sales#24)) AND (d_year#11 = 1999)) AND (avg_monthly_sales#24 > 0.000000)) AND (CheckOverflow((promote_precision(abs(CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true), false)) / promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(38,16), true) > 0.1000000000000000)) + +(33) ReusedExchange [Reuses operator id: unknown] +Output [6]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, sum#32] + +(34) HashAggregate [codegen id : 13] +Input [6]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, sum#32] +Keys [5]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31] +Functions [1]: [sum(UnscaledValue(cs_sales_price#33))] +Aggregate Attributes [1]: [sum(UnscaledValue(cs_sales_price#33))#34] +Results [6]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, MakeDecimal(sum(UnscaledValue(cs_sales_price#33))#34,17,2) AS sum_sales#35] + +(35) Exchange +Input [6]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, sum_sales#35] +Arguments: hashpartitioning(i_category#27, i_brand#28, cc_name#29, 5), ENSURE_REQUIREMENTS, [id=#36] + +(36) Sort [codegen id : 14] +Input [6]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, sum_sales#35] +Arguments: [i_category#27 ASC NULLS FIRST, i_brand#28 ASC NULLS FIRST, cc_name#29 ASC NULLS FIRST, d_year#30 ASC NULLS FIRST, d_moy#31 ASC NULLS FIRST], false, 0 + +(37) Window +Input [6]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, sum_sales#35] +Arguments: [rank(d_year#30, d_moy#31) windowspecdefinition(i_category#27, i_brand#28, cc_name#29, d_year#30 ASC NULLS FIRST, d_moy#31 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#37], [i_category#27, i_brand#28, cc_name#29], [d_year#30 ASC NULLS FIRST, d_moy#31 ASC NULLS FIRST] + +(38) Project [codegen id : 15] +Output [5]: [i_category#27, i_brand#28, cc_name#29, sum_sales#35, rn#37] +Input [7]: [i_category#27, i_brand#28, cc_name#29, d_year#30, d_moy#31, sum_sales#35, rn#37] + +(39) BroadcastExchange +Input [5]: [i_category#27, i_brand#28, cc_name#29, sum_sales#35, rn#37] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true], input[1, string, true], input[2, string, true], (input[4, int, false] + 1)),false), [id=#38] + +(40) BroadcastHashJoin [codegen id : 23] +Left keys [4]: [i_category#3, i_brand#2, cc_name#15, rn#26] +Right keys [4]: [i_category#27, i_brand#28, cc_name#29, (rn#37 + 1)] +Join condition: None + +(41) Project [codegen id : 23] +Output [9]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24, rn#26, sum_sales#35] +Input [13]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24, rn#26, i_category#27, i_brand#28, cc_name#29, sum_sales#35, rn#37] + +(42) ReusedExchange [Reuses operator id: 35] +Output [6]: [i_category#39, i_brand#40, cc_name#41, d_year#42, d_moy#43, sum_sales#44] + +(43) Sort [codegen id : 21] +Input [6]: [i_category#39, i_brand#40, cc_name#41, d_year#42, d_moy#43, sum_sales#44] +Arguments: [i_category#39 ASC NULLS FIRST, i_brand#40 ASC NULLS FIRST, cc_name#41 ASC NULLS FIRST, d_year#42 ASC NULLS FIRST, d_moy#43 ASC NULLS FIRST], false, 0 + +(44) Window +Input [6]: [i_category#39, i_brand#40, cc_name#41, d_year#42, d_moy#43, sum_sales#44] +Arguments: [rank(d_year#42, d_moy#43) windowspecdefinition(i_category#39, i_brand#40, cc_name#41, d_year#42 ASC NULLS FIRST, d_moy#43 ASC NULLS FIRST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rn#45], [i_category#39, i_brand#40, cc_name#41], [d_year#42 ASC NULLS FIRST, d_moy#43 ASC NULLS FIRST] + +(45) Project [codegen id : 22] +Output [5]: [i_category#39, i_brand#40, cc_name#41, sum_sales#44, rn#45] +Input [7]: [i_category#39, i_brand#40, cc_name#41, d_year#42, d_moy#43, sum_sales#44, rn#45] + +(46) BroadcastExchange +Input [5]: [i_category#39, i_brand#40, cc_name#41, sum_sales#44, rn#45] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true], input[1, string, true], input[2, string, true], (input[4, int, false] - 1)),false), [id=#46] + +(47) BroadcastHashJoin [codegen id : 23] +Left keys [4]: [i_category#3, i_brand#2, cc_name#15, rn#26] +Right keys [4]: [i_category#39, i_brand#40, cc_name#41, (rn#45 - 1)] +Join condition: None + +(48) Project [codegen id : 23] +Output [8]: [i_category#3, i_brand#2, d_year#11, d_moy#12, avg_monthly_sales#24, sum_sales#21, sum_sales#35 AS psum#47, sum_sales#44 AS nsum#48] +Input [14]: [i_category#3, i_brand#2, cc_name#15, d_year#11, d_moy#12, sum_sales#21, avg_monthly_sales#24, rn#26, sum_sales#35, i_category#39, i_brand#40, cc_name#41, sum_sales#44, rn#45] + +(49) TakeOrderedAndProject +Input [8]: [i_category#3, i_brand#2, d_year#11, d_moy#12, avg_monthly_sales#24, sum_sales#21, psum#47, nsum#48] +Arguments: 100, [CheckOverflow((promote_precision(cast(sum_sales#21 as decimal(22,6))) - promote_precision(cast(avg_monthly_sales#24 as decimal(22,6)))), DecimalType(22,6), true) ASC NULLS FIRST, d_year#11 ASC NULLS FIRST], [i_category#3, i_brand#2, d_year#11, d_moy#12, avg_monthly_sales#24, sum_sales#21, psum#47, nsum#48] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = cs_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (50) + + +(50) ReusedExchange [Reuses operator id: 13] +Output [3]: [d_date_sk#10, d_year#11, d_moy#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q57/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q57/simplified.txt new file mode 100644 index 0000000000000..501fb09522772 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q57/simplified.txt @@ -0,0 +1,84 @@ +TakeOrderedAndProject [sum_sales,avg_monthly_sales,d_year,i_category,i_brand,d_moy,psum,nsum] + WholeStageCodegen (23) + Project [i_category,i_brand,d_year,d_moy,avg_monthly_sales,sum_sales,sum_sales,sum_sales] + BroadcastHashJoin [i_category,i_brand,cc_name,rn,i_category,i_brand,cc_name,rn] + Project [i_category,i_brand,cc_name,d_year,d_moy,sum_sales,avg_monthly_sales,rn,sum_sales] + BroadcastHashJoin [i_category,i_brand,cc_name,rn,i_category,i_brand,cc_name,rn] + Filter [d_year,avg_monthly_sales,sum_sales] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,cc_name] + WholeStageCodegen (8) + Sort [i_category,i_brand,cc_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,cc_name] #1 + WholeStageCodegen (7) + Project [i_category,i_brand,cc_name,d_year,d_moy,sum_sales,avg_monthly_sales] + InputAdapter + Window [_w0,i_category,i_brand,cc_name,d_year] + WholeStageCodegen (6) + Sort [i_category,i_brand,cc_name,d_year] + InputAdapter + Exchange [i_category,i_brand,cc_name,d_year] #2 + WholeStageCodegen (5) + HashAggregate [i_category,i_brand,cc_name,d_year,d_moy,sum] [sum(UnscaledValue(cs_sales_price)),sum_sales,_w0,sum] + InputAdapter + Exchange [i_category,i_brand,cc_name,d_year,d_moy] #3 + WholeStageCodegen (4) + HashAggregate [i_category,i_brand,cc_name,d_year,d_moy,cs_sales_price] [sum,sum] + Project [i_brand,i_category,cs_sales_price,d_year,d_moy,cc_name] + BroadcastHashJoin [cs_call_center_sk,cc_call_center_sk] + Project [i_brand,i_category,cs_call_center_sk,cs_sales_price,d_year,d_moy] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [i_brand,i_category,cs_call_center_sk,cs_sales_price,cs_sold_date_sk] + BroadcastHashJoin [i_item_sk,cs_item_sk] + Filter [i_item_sk,i_category,i_brand] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [cs_item_sk,cs_call_center_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_call_center_sk,cs_item_sk,cs_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy] #5 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [d_year,d_moy,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year,d_moy] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Filter [cc_call_center_sk,cc_name] + ColumnarToRow + InputAdapter + Scan parquet default.call_center [cc_call_center_sk,cc_name] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (15) + Project [i_category,i_brand,cc_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,cc_name] + WholeStageCodegen (14) + Sort [i_category,i_brand,cc_name,d_year,d_moy] + InputAdapter + Exchange [i_category,i_brand,cc_name] #8 + WholeStageCodegen (13) + HashAggregate [i_category,i_brand,cc_name,d_year,d_moy,sum] [sum(UnscaledValue(cs_sales_price)),sum_sales,sum] + InputAdapter + ReusedExchange [i_category,i_brand,cc_name,d_year,d_moy,sum] #9 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (22) + Project [i_category,i_brand,cc_name,sum_sales,rn] + InputAdapter + Window [d_year,d_moy,i_category,i_brand,cc_name] + WholeStageCodegen (21) + Sort [i_category,i_brand,cc_name,d_year,d_moy] + InputAdapter + ReusedExchange [i_category,i_brand,cc_name,d_year,d_moy,sum_sales] #8 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt new file mode 100644 index 0000000000000..e660800796abe --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/explain.txt @@ -0,0 +1,561 @@ +== Physical Plan == +TakeOrderedAndProject (94) ++- * HashAggregate (93) + +- Exchange (92) + +- * HashAggregate (91) + +- Union (90) + :- * HashAggregate (79) + : +- Exchange (78) + : +- * HashAggregate (77) + : +- Union (76) + : :- * HashAggregate (25) + : : +- Exchange (24) + : : +- * HashAggregate (23) + : : +- * Project (22) + : : +- * BroadcastHashJoin Inner BuildRight (21) + : : :- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- Union (9) + : : : : :- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- * Project (8) + : : : : +- * Filter (7) + : : : : +- * ColumnarToRow (6) + : : : : +- Scan parquet default.store_returns (5) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.store (10) + : : +- BroadcastExchange (20) + : : +- * Project (19) + : : +- * Filter (18) + : : +- * ColumnarToRow (17) + : : +- Scan parquet default.date_dim (16) + : :- * HashAggregate (46) + : : +- Exchange (45) + : : +- * HashAggregate (44) + : : +- * Project (43) + : : +- * BroadcastHashJoin Inner BuildRight (42) + : : :- * Project (40) + : : : +- * BroadcastHashJoin Inner BuildRight (39) + : : : :- Union (34) + : : : : :- * Project (29) + : : : : : +- * Filter (28) + : : : : : +- * ColumnarToRow (27) + : : : : : +- Scan parquet default.catalog_sales (26) + : : : : +- * Project (33) + : : : : +- * Filter (32) + : : : : +- * ColumnarToRow (31) + : : : : +- Scan parquet default.catalog_returns (30) + : : : +- BroadcastExchange (38) + : : : +- * Filter (37) + : : : +- * ColumnarToRow (36) + : : : +- Scan parquet default.catalog_page (35) + : : +- ReusedExchange (41) + : +- * HashAggregate (75) + : +- Exchange (74) + : +- * HashAggregate (73) + : +- * Project (72) + : +- * BroadcastHashJoin Inner BuildRight (71) + : :- * Project (69) + : : +- * BroadcastHashJoin Inner BuildRight (68) + : : :- Union (63) + : : : :- * Project (50) + : : : : +- * Filter (49) + : : : : +- * ColumnarToRow (48) + : : : : +- Scan parquet default.web_sales (47) + : : : +- * Project (62) + : : : +- * SortMergeJoin Inner (61) + : : : :- * Sort (54) + : : : : +- Exchange (53) + : : : : +- * ColumnarToRow (52) + : : : : +- Scan parquet default.web_returns (51) + : : : +- * Sort (60) + : : : +- Exchange (59) + : : : +- * Project (58) + : : : +- * Filter (57) + : : : +- * ColumnarToRow (56) + : : : +- Scan parquet default.web_sales (55) + : : +- BroadcastExchange (67) + : : +- * Filter (66) + : : +- * ColumnarToRow (65) + : : +- Scan parquet default.web_site (64) + : +- ReusedExchange (70) + :- * HashAggregate (84) + : +- Exchange (83) + : +- * HashAggregate (82) + : +- * HashAggregate (81) + : +- ReusedExchange (80) + +- * HashAggregate (89) + +- Exchange (88) + +- * HashAggregate (87) + +- * HashAggregate (86) + +- ReusedExchange (85) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 1] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_store_sk#1) + +(4) Project [codegen id : 1] +Output [6]: [ss_store_sk#1 AS store_sk#6, ss_sold_date_sk#4 AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] + +(5) Scan parquet default.store_returns +Output [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#15), dynamicpruningexpression(sr_returned_date_sk#15 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 2] +Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] + +(7) Filter [codegen id : 2] +Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] +Condition : isnotnull(sr_store_sk#12) + +(8) Project [codegen id : 2] +Output [6]: [sr_store_sk#12 AS store_sk#16, sr_returned_date_sk#15 AS date_sk#17, 0.00 AS sales_price#18, 0.00 AS profit#19, sr_return_amt#13 AS return_amt#20, sr_net_loss#14 AS net_loss#21] +Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] + +(9) Union + +(10) Scan parquet default.store +Output [2]: [s_store_sk#22, s_store_id#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#22, s_store_id#23] + +(12) Filter [codegen id : 3] +Input [2]: [s_store_sk#22, s_store_id#23] +Condition : isnotnull(s_store_sk#22) + +(13) BroadcastExchange +Input [2]: [s_store_sk#22, s_store_id#23] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#24] + +(14) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [store_sk#6] +Right keys [1]: [s_store_sk#22] +Join condition: None + +(15) Project [codegen id : 5] +Output [6]: [date_sk#7, sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#23] +Input [8]: [store_sk#6, date_sk#7, sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_sk#22, s_store_id#23] + +(16) Scan parquet default.date_dim +Output [2]: [d_date_sk#25, d_date#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1998-08-04), LessThanOrEqual(d_date,1998-08-18), IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#25, d_date#26] + +(18) Filter [codegen id : 4] +Input [2]: [d_date_sk#25, d_date#26] +Condition : (((isnotnull(d_date#26) AND (d_date#26 >= 1998-08-04)) AND (d_date#26 <= 1998-08-18)) AND isnotnull(d_date_sk#25)) + +(19) Project [codegen id : 4] +Output [1]: [d_date_sk#25] +Input [2]: [d_date_sk#25, d_date#26] + +(20) BroadcastExchange +Input [1]: [d_date_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] + +(21) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [date_sk#7] +Right keys [1]: [d_date_sk#25] +Join condition: None + +(22) Project [codegen id : 5] +Output [5]: [sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#23] +Input [7]: [date_sk#7, sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#23, d_date_sk#25] + +(23) HashAggregate [codegen id : 5] +Input [5]: [sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#23] +Keys [1]: [s_store_id#23] +Functions [4]: [partial_sum(UnscaledValue(sales_price#8)), partial_sum(UnscaledValue(return_amt#10)), partial_sum(UnscaledValue(profit#9)), partial_sum(UnscaledValue(net_loss#11))] +Aggregate Attributes [4]: [sum#28, sum#29, sum#30, sum#31] +Results [5]: [s_store_id#23, sum#32, sum#33, sum#34, sum#35] + +(24) Exchange +Input [5]: [s_store_id#23, sum#32, sum#33, sum#34, sum#35] +Arguments: hashpartitioning(s_store_id#23, 5), ENSURE_REQUIREMENTS, [id=#36] + +(25) HashAggregate [codegen id : 6] +Input [5]: [s_store_id#23, sum#32, sum#33, sum#34, sum#35] +Keys [1]: [s_store_id#23] +Functions [4]: [sum(UnscaledValue(sales_price#8)), sum(UnscaledValue(return_amt#10)), sum(UnscaledValue(profit#9)), sum(UnscaledValue(net_loss#11))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#8))#37, sum(UnscaledValue(return_amt#10))#38, sum(UnscaledValue(profit#9))#39, sum(UnscaledValue(net_loss#11))#40] +Results [5]: [store channel AS channel#41, concat(store, s_store_id#23) AS id#42, MakeDecimal(sum(UnscaledValue(sales_price#8))#37,17,2) AS sales#43, MakeDecimal(sum(UnscaledValue(return_amt#10))#38,17,2) AS returns#44, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#9))#39,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#11))#40,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#45] + +(26) Scan parquet default.catalog_sales +Output [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#49), dynamicpruningexpression(cs_sold_date_sk#49 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_catalog_page_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 7] +Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] + +(28) Filter [codegen id : 7] +Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] +Condition : isnotnull(cs_catalog_page_sk#46) + +(29) Project [codegen id : 7] +Output [6]: [cs_catalog_page_sk#46 AS page_sk#50, cs_sold_date_sk#49 AS date_sk#51, cs_ext_sales_price#47 AS sales_price#52, cs_net_profit#48 AS profit#53, 0.00 AS return_amt#54, 0.00 AS net_loss#55] +Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] + +(30) Scan parquet default.catalog_returns +Output [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#59), dynamicpruningexpression(cr_returned_date_sk#59 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cr_catalog_page_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 8] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(32) Filter [codegen id : 8] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Condition : isnotnull(cr_catalog_page_sk#56) + +(33) Project [codegen id : 8] +Output [6]: [cr_catalog_page_sk#56 AS page_sk#60, cr_returned_date_sk#59 AS date_sk#61, 0.00 AS sales_price#62, 0.00 AS profit#63, cr_return_amount#57 AS return_amt#64, cr_net_loss#58 AS net_loss#65] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(34) Union + +(35) Scan parquet default.catalog_page +Output [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_page] +PushedFilters: [IsNotNull(cp_catalog_page_sk)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 9] +Input [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] + +(37) Filter [codegen id : 9] +Input [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] +Condition : isnotnull(cp_catalog_page_sk#66) + +(38) BroadcastExchange +Input [2]: [cp_catalog_page_sk#66, cp_catalog_page_id#67] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#68] + +(39) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [page_sk#50] +Right keys [1]: [cp_catalog_page_sk#66] +Join condition: None + +(40) Project [codegen id : 11] +Output [6]: [date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67] +Input [8]: [page_sk#50, date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_sk#66, cp_catalog_page_id#67] + +(41) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#69] + +(42) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [date_sk#51] +Right keys [1]: [d_date_sk#69] +Join condition: None + +(43) Project [codegen id : 11] +Output [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67] +Input [7]: [date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67, d_date_sk#69] + +(44) HashAggregate [codegen id : 11] +Input [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#67] +Keys [1]: [cp_catalog_page_id#67] +Functions [4]: [partial_sum(UnscaledValue(sales_price#52)), partial_sum(UnscaledValue(return_amt#54)), partial_sum(UnscaledValue(profit#53)), partial_sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum#70, sum#71, sum#72, sum#73] +Results [5]: [cp_catalog_page_id#67, sum#74, sum#75, sum#76, sum#77] + +(45) Exchange +Input [5]: [cp_catalog_page_id#67, sum#74, sum#75, sum#76, sum#77] +Arguments: hashpartitioning(cp_catalog_page_id#67, 5), ENSURE_REQUIREMENTS, [id=#78] + +(46) HashAggregate [codegen id : 12] +Input [5]: [cp_catalog_page_id#67, sum#74, sum#75, sum#76, sum#77] +Keys [1]: [cp_catalog_page_id#67] +Functions [4]: [sum(UnscaledValue(sales_price#52)), sum(UnscaledValue(return_amt#54)), sum(UnscaledValue(profit#53)), sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#52))#79, sum(UnscaledValue(return_amt#54))#80, sum(UnscaledValue(profit#53))#81, sum(UnscaledValue(net_loss#55))#82] +Results [5]: [catalog channel AS channel#83, concat(catalog_page, cp_catalog_page_id#67) AS id#84, MakeDecimal(sum(UnscaledValue(sales_price#52))#79,17,2) AS sales#85, MakeDecimal(sum(UnscaledValue(return_amt#54))#80,17,2) AS returns#86, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#53))#81,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#55))#82,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#87] + +(47) Scan parquet default.web_sales +Output [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#91), dynamicpruningexpression(ws_sold_date_sk#91 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 13] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] + +(49) Filter [codegen id : 13] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] +Condition : isnotnull(ws_web_site_sk#88) + +(50) Project [codegen id : 13] +Output [6]: [ws_web_site_sk#88 AS wsr_web_site_sk#92, ws_sold_date_sk#91 AS date_sk#93, ws_ext_sales_price#89 AS sales_price#94, ws_net_profit#90 AS profit#95, 0.00 AS return_amt#96, 0.00 AS net_loss#97] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] + +(51) Scan parquet default.web_returns +Output [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#102), dynamicpruningexpression(wr_returned_date_sk#102 IN dynamicpruning#5)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 14] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] + +(53) Exchange +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Arguments: hashpartitioning(wr_item_sk#98, wr_order_number#99, 5), ENSURE_REQUIREMENTS, [id=#103] + +(54) Sort [codegen id : 15] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Arguments: [wr_item_sk#98 ASC NULLS FIRST, wr_order_number#99 ASC NULLS FIRST], false, 0 + +(55) Scan parquet default.web_sales +Output [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(56) ColumnarToRow [codegen id : 16] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] + +(57) Filter [codegen id : 16] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] +Condition : ((isnotnull(ws_item_sk#104) AND isnotnull(ws_order_number#106)) AND isnotnull(ws_web_site_sk#105)) + +(58) Project [codegen id : 16] +Output [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] + +(59) Exchange +Input [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Arguments: hashpartitioning(ws_item_sk#104, ws_order_number#106, 5), ENSURE_REQUIREMENTS, [id=#108] + +(60) Sort [codegen id : 17] +Input [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Arguments: [ws_item_sk#104 ASC NULLS FIRST, ws_order_number#106 ASC NULLS FIRST], false, 0 + +(61) SortMergeJoin [codegen id : 18] +Left keys [2]: [wr_item_sk#98, wr_order_number#99] +Right keys [2]: [ws_item_sk#104, ws_order_number#106] +Join condition: None + +(62) Project [codegen id : 18] +Output [6]: [ws_web_site_sk#105 AS wsr_web_site_sk#109, wr_returned_date_sk#102 AS date_sk#110, 0.00 AS sales_price#111, 0.00 AS profit#112, wr_return_amt#100 AS return_amt#113, wr_net_loss#101 AS net_loss#114] +Input [8]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102, ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] + +(63) Union + +(64) Scan parquet default.web_site +Output [2]: [web_site_sk#115, web_site_id#116] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_site_sk)] +ReadSchema: struct + +(65) ColumnarToRow [codegen id : 19] +Input [2]: [web_site_sk#115, web_site_id#116] + +(66) Filter [codegen id : 19] +Input [2]: [web_site_sk#115, web_site_id#116] +Condition : isnotnull(web_site_sk#115) + +(67) BroadcastExchange +Input [2]: [web_site_sk#115, web_site_id#116] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#117] + +(68) BroadcastHashJoin [codegen id : 21] +Left keys [1]: [wsr_web_site_sk#92] +Right keys [1]: [web_site_sk#115] +Join condition: None + +(69) Project [codegen id : 21] +Output [6]: [date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Input [8]: [wsr_web_site_sk#92, date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_sk#115, web_site_id#116] + +(70) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#118] + +(71) BroadcastHashJoin [codegen id : 21] +Left keys [1]: [date_sk#93] +Right keys [1]: [d_date_sk#118] +Join condition: None + +(72) Project [codegen id : 21] +Output [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Input [7]: [date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116, d_date_sk#118] + +(73) HashAggregate [codegen id : 21] +Input [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Keys [1]: [web_site_id#116] +Functions [4]: [partial_sum(UnscaledValue(sales_price#94)), partial_sum(UnscaledValue(return_amt#96)), partial_sum(UnscaledValue(profit#95)), partial_sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum#119, sum#120, sum#121, sum#122] +Results [5]: [web_site_id#116, sum#123, sum#124, sum#125, sum#126] + +(74) Exchange +Input [5]: [web_site_id#116, sum#123, sum#124, sum#125, sum#126] +Arguments: hashpartitioning(web_site_id#116, 5), ENSURE_REQUIREMENTS, [id=#127] + +(75) HashAggregate [codegen id : 22] +Input [5]: [web_site_id#116, sum#123, sum#124, sum#125, sum#126] +Keys [1]: [web_site_id#116] +Functions [4]: [sum(UnscaledValue(sales_price#94)), sum(UnscaledValue(return_amt#96)), sum(UnscaledValue(profit#95)), sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#94))#128, sum(UnscaledValue(return_amt#96))#129, sum(UnscaledValue(profit#95))#130, sum(UnscaledValue(net_loss#97))#131] +Results [5]: [web channel AS channel#132, concat(web_site, web_site_id#116) AS id#133, MakeDecimal(sum(UnscaledValue(sales_price#94))#128,17,2) AS sales#134, MakeDecimal(sum(UnscaledValue(return_amt#96))#129,17,2) AS returns#135, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#95))#130,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#97))#131,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#136] + +(76) Union + +(77) HashAggregate [codegen id : 23] +Input [5]: [channel#41, id#42, sales#43, returns#44, profit#45] +Keys [2]: [channel#41, id#42] +Functions [3]: [partial_sum(sales#43), partial_sum(returns#44), partial_sum(profit#45)] +Aggregate Attributes [6]: [sum#137, isEmpty#138, sum#139, isEmpty#140, sum#141, isEmpty#142] +Results [8]: [channel#41, id#42, sum#143, isEmpty#144, sum#145, isEmpty#146, sum#147, isEmpty#148] + +(78) Exchange +Input [8]: [channel#41, id#42, sum#143, isEmpty#144, sum#145, isEmpty#146, sum#147, isEmpty#148] +Arguments: hashpartitioning(channel#41, id#42, 5), ENSURE_REQUIREMENTS, [id=#149] + +(79) HashAggregate [codegen id : 24] +Input [8]: [channel#41, id#42, sum#143, isEmpty#144, sum#145, isEmpty#146, sum#147, isEmpty#148] +Keys [2]: [channel#41, id#42] +Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#45)] +Aggregate Attributes [3]: [sum(sales#43)#150, sum(returns#44)#151, sum(profit#45)#152] +Results [5]: [channel#41, id#42, cast(sum(sales#43)#150 as decimal(37,2)) AS sales#153, cast(sum(returns#44)#151 as decimal(37,2)) AS returns#154, cast(sum(profit#45)#152 as decimal(38,2)) AS profit#155] + +(80) ReusedExchange [Reuses operator id: unknown] +Output [8]: [channel#41, id#42, sum#156, isEmpty#157, sum#158, isEmpty#159, sum#160, isEmpty#161] + +(81) HashAggregate [codegen id : 48] +Input [8]: [channel#41, id#42, sum#156, isEmpty#157, sum#158, isEmpty#159, sum#160, isEmpty#161] +Keys [2]: [channel#41, id#42] +Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#45)] +Aggregate Attributes [3]: [sum(sales#43)#162, sum(returns#44)#163, sum(profit#45)#164] +Results [4]: [channel#41, sum(sales#43)#162 AS sales#165, sum(returns#44)#163 AS returns#166, sum(profit#45)#164 AS profit#167] + +(82) HashAggregate [codegen id : 48] +Input [4]: [channel#41, sales#165, returns#166, profit#167] +Keys [1]: [channel#41] +Functions [3]: [partial_sum(sales#165), partial_sum(returns#166), partial_sum(profit#167)] +Aggregate Attributes [6]: [sum#168, isEmpty#169, sum#170, isEmpty#171, sum#172, isEmpty#173] +Results [7]: [channel#41, sum#174, isEmpty#175, sum#176, isEmpty#177, sum#178, isEmpty#179] + +(83) Exchange +Input [7]: [channel#41, sum#174, isEmpty#175, sum#176, isEmpty#177, sum#178, isEmpty#179] +Arguments: hashpartitioning(channel#41, 5), ENSURE_REQUIREMENTS, [id=#180] + +(84) HashAggregate [codegen id : 49] +Input [7]: [channel#41, sum#174, isEmpty#175, sum#176, isEmpty#177, sum#178, isEmpty#179] +Keys [1]: [channel#41] +Functions [3]: [sum(sales#165), sum(returns#166), sum(profit#167)] +Aggregate Attributes [3]: [sum(sales#165)#181, sum(returns#166)#182, sum(profit#167)#183] +Results [5]: [channel#41, null AS id#184, sum(sales#165)#181 AS sum(sales)#185, sum(returns#166)#182 AS sum(returns)#186, sum(profit#167)#183 AS sum(profit)#187] + +(85) ReusedExchange [Reuses operator id: unknown] +Output [8]: [channel#41, id#42, sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] + +(86) HashAggregate [codegen id : 73] +Input [8]: [channel#41, id#42, sum#188, isEmpty#189, sum#190, isEmpty#191, sum#192, isEmpty#193] +Keys [2]: [channel#41, id#42] +Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#45)] +Aggregate Attributes [3]: [sum(sales#43)#194, sum(returns#44)#195, sum(profit#45)#196] +Results [3]: [sum(sales#43)#194 AS sales#165, sum(returns#44)#195 AS returns#166, sum(profit#45)#196 AS profit#167] + +(87) HashAggregate [codegen id : 73] +Input [3]: [sales#165, returns#166, profit#167] +Keys: [] +Functions [3]: [partial_sum(sales#165), partial_sum(returns#166), partial_sum(profit#167)] +Aggregate Attributes [6]: [sum#197, isEmpty#198, sum#199, isEmpty#200, sum#201, isEmpty#202] +Results [6]: [sum#203, isEmpty#204, sum#205, isEmpty#206, sum#207, isEmpty#208] + +(88) Exchange +Input [6]: [sum#203, isEmpty#204, sum#205, isEmpty#206, sum#207, isEmpty#208] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#209] + +(89) HashAggregate [codegen id : 74] +Input [6]: [sum#203, isEmpty#204, sum#205, isEmpty#206, sum#207, isEmpty#208] +Keys: [] +Functions [3]: [sum(sales#165), sum(returns#166), sum(profit#167)] +Aggregate Attributes [3]: [sum(sales#165)#210, sum(returns#166)#211, sum(profit#167)#212] +Results [5]: [null AS channel#213, null AS id#214, sum(sales#165)#210 AS sum(sales)#215, sum(returns#166)#211 AS sum(returns)#216, sum(profit#167)#212 AS sum(profit)#217] + +(90) Union + +(91) HashAggregate [codegen id : 75] +Input [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Keys [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#41, id#42, sales#153, returns#154, profit#155] + +(92) Exchange +Input [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Arguments: hashpartitioning(channel#41, id#42, sales#153, returns#154, profit#155, 5), ENSURE_REQUIREMENTS, [id=#218] + +(93) HashAggregate [codegen id : 76] +Input [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Keys [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#41, id#42, sales#153, returns#154, profit#155] + +(94) TakeOrderedAndProject +Input [5]: [channel#41, id#42, sales#153, returns#154, profit#155] +Arguments: 100, [channel#41 ASC NULLS FIRST, id#42 ASC NULLS FIRST], [channel#41, id#42, sales#153, returns#154, profit#155] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (95) + + +(95) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#25] + +Subquery:2 Hosting operator id = 5 Hosting Expression = sr_returned_date_sk#15 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#49 IN dynamicpruning#5 + +Subquery:4 Hosting operator id = 30 Hosting Expression = cr_returned_date_sk#59 IN dynamicpruning#5 + +Subquery:5 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#91 IN dynamicpruning#5 + +Subquery:6 Hosting operator id = 51 Hosting Expression = wr_returned_date_sk#102 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt new file mode 100644 index 0000000000000..558e8bcc406bc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a.sf100/simplified.txt @@ -0,0 +1,164 @@ +TakeOrderedAndProject [channel,id,sales,returns,profit] + WholeStageCodegen (76) + HashAggregate [channel,id,sales,returns,profit] + InputAdapter + Exchange [channel,id,sales,returns,profit] #1 + WholeStageCodegen (75) + HashAggregate [channel,id,sales,returns,profit] + InputAdapter + Union + WholeStageCodegen (24) + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel,id] #2 + WholeStageCodegen (23) + HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (6) + HashAggregate [s_store_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),channel,id,sales,returns,profit,sum,sum,sum,sum] + InputAdapter + Exchange [s_store_id] #3 + WholeStageCodegen (5) + HashAggregate [s_store_id,sales_price,return_amt,profit,net_loss] [sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,profit,return_amt,net_loss,s_store_id] + BroadcastHashJoin [date_sk,d_date_sk] + Project [date_sk,sales_price,profit,return_amt,net_loss,s_store_id] + BroadcastHashJoin [store_sk,s_store_sk] + InputAdapter + Union + WholeStageCodegen (1) + Project [ss_store_sk,ss_sold_date_sk,ss_ext_sales_price,ss_net_profit] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + WholeStageCodegen (2) + Project [sr_store_sk,sr_returned_date_sk,sr_return_amt,sr_net_loss] + Filter [sr_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_store_sk,sr_return_amt,sr_net_loss,sr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + WholeStageCodegen (12) + HashAggregate [cp_catalog_page_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),channel,id,sales,returns,profit,sum,sum,sum,sum] + InputAdapter + Exchange [cp_catalog_page_id] #6 + WholeStageCodegen (11) + HashAggregate [cp_catalog_page_id,sales_price,return_amt,profit,net_loss] [sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,profit,return_amt,net_loss,cp_catalog_page_id] + BroadcastHashJoin [date_sk,d_date_sk] + Project [date_sk,sales_price,profit,return_amt,net_loss,cp_catalog_page_id] + BroadcastHashJoin [page_sk,cp_catalog_page_sk] + InputAdapter + Union + WholeStageCodegen (7) + Project [cs_catalog_page_sk,cs_sold_date_sk,cs_ext_sales_price,cs_net_profit] + Filter [cs_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + WholeStageCodegen (8) + Project [cr_catalog_page_sk,cr_returned_date_sk,cr_return_amount,cr_net_loss] + Filter [cr_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_catalog_page_sk,cr_return_amount,cr_net_loss,cr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (9) + Filter [cp_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_page [cp_catalog_page_sk,cp_catalog_page_id] + InputAdapter + ReusedExchange [d_date_sk] #4 + WholeStageCodegen (22) + HashAggregate [web_site_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),channel,id,sales,returns,profit,sum,sum,sum,sum] + InputAdapter + Exchange [web_site_id] #8 + WholeStageCodegen (21) + HashAggregate [web_site_id,sales_price,return_amt,profit,net_loss] [sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,profit,return_amt,net_loss,web_site_id] + BroadcastHashJoin [date_sk,d_date_sk] + Project [date_sk,sales_price,profit,return_amt,net_loss,web_site_id] + BroadcastHashJoin [wsr_web_site_sk,web_site_sk] + InputAdapter + Union + WholeStageCodegen (13) + Project [ws_web_site_sk,ws_sold_date_sk,ws_ext_sales_price,ws_net_profit] + Filter [ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_web_site_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + WholeStageCodegen (18) + Project [ws_web_site_sk,wr_returned_date_sk,wr_return_amt,wr_net_loss] + SortMergeJoin [wr_item_sk,wr_order_number,ws_item_sk,ws_order_number] + InputAdapter + WholeStageCodegen (15) + Sort [wr_item_sk,wr_order_number] + InputAdapter + Exchange [wr_item_sk,wr_order_number] #9 + WholeStageCodegen (14) + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss,wr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (17) + Sort [ws_item_sk,ws_order_number] + InputAdapter + Exchange [ws_item_sk,ws_order_number] #10 + WholeStageCodegen (16) + Project [ws_item_sk,ws_web_site_sk,ws_order_number] + Filter [ws_item_sk,ws_order_number,ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_web_site_sk,ws_order_number,ws_sold_date_sk] + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (19) + Filter [web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_site_id] + InputAdapter + ReusedExchange [d_date_sk] #4 + WholeStageCodegen (49) + HashAggregate [channel,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),id,sum(sales),sum(returns),sum(profit),sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel] #12 + WholeStageCodegen (48) + HashAggregate [channel,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + ReusedExchange [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] #13 + WholeStageCodegen (74) + HashAggregate [sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),channel,id,sum(sales),sum(returns),sum(profit),sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange #14 + WholeStageCodegen (73) + HashAggregate [sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + ReusedExchange [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] #13 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt new file mode 100644 index 0000000000000..036b3cdcb22fe --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/explain.txt @@ -0,0 +1,546 @@ +== Physical Plan == +TakeOrderedAndProject (91) ++- * HashAggregate (90) + +- Exchange (89) + +- * HashAggregate (88) + +- Union (87) + :- * HashAggregate (76) + : +- Exchange (75) + : +- * HashAggregate (74) + : +- Union (73) + : :- * HashAggregate (25) + : : +- Exchange (24) + : : +- * HashAggregate (23) + : : +- * Project (22) + : : +- * BroadcastHashJoin Inner BuildRight (21) + : : :- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- Union (9) + : : : : :- * Project (4) + : : : : : +- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- * Project (8) + : : : : +- * Filter (7) + : : : : +- * ColumnarToRow (6) + : : : : +- Scan parquet default.store_returns (5) + : : : +- BroadcastExchange (14) + : : : +- * Project (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (20) + : : +- * Filter (19) + : : +- * ColumnarToRow (18) + : : +- Scan parquet default.store (17) + : :- * HashAggregate (46) + : : +- Exchange (45) + : : +- * HashAggregate (44) + : : +- * Project (43) + : : +- * BroadcastHashJoin Inner BuildRight (42) + : : :- * Project (37) + : : : +- * BroadcastHashJoin Inner BuildRight (36) + : : : :- Union (34) + : : : : :- * Project (29) + : : : : : +- * Filter (28) + : : : : : +- * ColumnarToRow (27) + : : : : : +- Scan parquet default.catalog_sales (26) + : : : : +- * Project (33) + : : : : +- * Filter (32) + : : : : +- * ColumnarToRow (31) + : : : : +- Scan parquet default.catalog_returns (30) + : : : +- ReusedExchange (35) + : : +- BroadcastExchange (41) + : : +- * Filter (40) + : : +- * ColumnarToRow (39) + : : +- Scan parquet default.catalog_page (38) + : +- * HashAggregate (72) + : +- Exchange (71) + : +- * HashAggregate (70) + : +- * Project (69) + : +- * BroadcastHashJoin Inner BuildRight (68) + : :- * Project (63) + : : +- * BroadcastHashJoin Inner BuildRight (62) + : : :- Union (60) + : : : :- * Project (50) + : : : : +- * Filter (49) + : : : : +- * ColumnarToRow (48) + : : : : +- Scan parquet default.web_sales (47) + : : : +- * Project (59) + : : : +- * BroadcastHashJoin Inner BuildLeft (58) + : : : :- BroadcastExchange (53) + : : : : +- * ColumnarToRow (52) + : : : : +- Scan parquet default.web_returns (51) + : : : +- * Project (57) + : : : +- * Filter (56) + : : : +- * ColumnarToRow (55) + : : : +- Scan parquet default.web_sales (54) + : : +- ReusedExchange (61) + : +- BroadcastExchange (67) + : +- * Filter (66) + : +- * ColumnarToRow (65) + : +- Scan parquet default.web_site (64) + :- * HashAggregate (81) + : +- Exchange (80) + : +- * HashAggregate (79) + : +- * HashAggregate (78) + : +- ReusedExchange (77) + +- * HashAggregate (86) + +- Exchange (85) + +- * HashAggregate (84) + +- * HashAggregate (83) + +- ReusedExchange (82) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 1] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_store_sk#1) + +(4) Project [codegen id : 1] +Output [6]: [ss_store_sk#1 AS store_sk#6, ss_sold_date_sk#4 AS date_sk#7, ss_ext_sales_price#2 AS sales_price#8, ss_net_profit#3 AS profit#9, 0.00 AS return_amt#10, 0.00 AS net_loss#11] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] + +(5) Scan parquet default.store_returns +Output [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#15), dynamicpruningexpression(sr_returned_date_sk#15 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_store_sk)] +ReadSchema: struct + +(6) ColumnarToRow [codegen id : 2] +Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] + +(7) Filter [codegen id : 2] +Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] +Condition : isnotnull(sr_store_sk#12) + +(8) Project [codegen id : 2] +Output [6]: [sr_store_sk#12 AS store_sk#16, sr_returned_date_sk#15 AS date_sk#17, 0.00 AS sales_price#18, 0.00 AS profit#19, sr_return_amt#13 AS return_amt#20, sr_net_loss#14 AS net_loss#21] +Input [4]: [sr_store_sk#12, sr_return_amt#13, sr_net_loss#14, sr_returned_date_sk#15] + +(9) Union + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#22, d_date#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1998-08-04), LessThanOrEqual(d_date,1998-08-18), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#22, d_date#23] + +(12) Filter [codegen id : 3] +Input [2]: [d_date_sk#22, d_date#23] +Condition : (((isnotnull(d_date#23) AND (d_date#23 >= 1998-08-04)) AND (d_date#23 <= 1998-08-18)) AND isnotnull(d_date_sk#22)) + +(13) Project [codegen id : 3] +Output [1]: [d_date_sk#22] +Input [2]: [d_date_sk#22, d_date#23] + +(14) BroadcastExchange +Input [1]: [d_date_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(15) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [date_sk#7] +Right keys [1]: [d_date_sk#22] +Join condition: None + +(16) Project [codegen id : 5] +Output [5]: [store_sk#6, sales_price#8, profit#9, return_amt#10, net_loss#11] +Input [7]: [store_sk#6, date_sk#7, sales_price#8, profit#9, return_amt#10, net_loss#11, d_date_sk#22] + +(17) Scan parquet default.store +Output [2]: [s_store_sk#25, s_store_id#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 4] +Input [2]: [s_store_sk#25, s_store_id#26] + +(19) Filter [codegen id : 4] +Input [2]: [s_store_sk#25, s_store_id#26] +Condition : isnotnull(s_store_sk#25) + +(20) BroadcastExchange +Input [2]: [s_store_sk#25, s_store_id#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(21) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [store_sk#6] +Right keys [1]: [s_store_sk#25] +Join condition: None + +(22) Project [codegen id : 5] +Output [5]: [sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#26] +Input [7]: [store_sk#6, sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_sk#25, s_store_id#26] + +(23) HashAggregate [codegen id : 5] +Input [5]: [sales_price#8, profit#9, return_amt#10, net_loss#11, s_store_id#26] +Keys [1]: [s_store_id#26] +Functions [4]: [partial_sum(UnscaledValue(sales_price#8)), partial_sum(UnscaledValue(return_amt#10)), partial_sum(UnscaledValue(profit#9)), partial_sum(UnscaledValue(net_loss#11))] +Aggregate Attributes [4]: [sum#28, sum#29, sum#30, sum#31] +Results [5]: [s_store_id#26, sum#32, sum#33, sum#34, sum#35] + +(24) Exchange +Input [5]: [s_store_id#26, sum#32, sum#33, sum#34, sum#35] +Arguments: hashpartitioning(s_store_id#26, 5), ENSURE_REQUIREMENTS, [id=#36] + +(25) HashAggregate [codegen id : 6] +Input [5]: [s_store_id#26, sum#32, sum#33, sum#34, sum#35] +Keys [1]: [s_store_id#26] +Functions [4]: [sum(UnscaledValue(sales_price#8)), sum(UnscaledValue(return_amt#10)), sum(UnscaledValue(profit#9)), sum(UnscaledValue(net_loss#11))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#8))#37, sum(UnscaledValue(return_amt#10))#38, sum(UnscaledValue(profit#9))#39, sum(UnscaledValue(net_loss#11))#40] +Results [5]: [store channel AS channel#41, concat(store, s_store_id#26) AS id#42, MakeDecimal(sum(UnscaledValue(sales_price#8))#37,17,2) AS sales#43, MakeDecimal(sum(UnscaledValue(return_amt#10))#38,17,2) AS returns#44, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#9))#39,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#11))#40,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#45] + +(26) Scan parquet default.catalog_sales +Output [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#49), dynamicpruningexpression(cs_sold_date_sk#49 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cs_catalog_page_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 7] +Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] + +(28) Filter [codegen id : 7] +Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] +Condition : isnotnull(cs_catalog_page_sk#46) + +(29) Project [codegen id : 7] +Output [6]: [cs_catalog_page_sk#46 AS page_sk#50, cs_sold_date_sk#49 AS date_sk#51, cs_ext_sales_price#47 AS sales_price#52, cs_net_profit#48 AS profit#53, 0.00 AS return_amt#54, 0.00 AS net_loss#55] +Input [4]: [cs_catalog_page_sk#46, cs_ext_sales_price#47, cs_net_profit#48, cs_sold_date_sk#49] + +(30) Scan parquet default.catalog_returns +Output [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#59), dynamicpruningexpression(cr_returned_date_sk#59 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(cr_catalog_page_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 8] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(32) Filter [codegen id : 8] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Condition : isnotnull(cr_catalog_page_sk#56) + +(33) Project [codegen id : 8] +Output [6]: [cr_catalog_page_sk#56 AS page_sk#60, cr_returned_date_sk#59 AS date_sk#61, 0.00 AS sales_price#62, 0.00 AS profit#63, cr_return_amount#57 AS return_amt#64, cr_net_loss#58 AS net_loss#65] +Input [4]: [cr_catalog_page_sk#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(34) Union + +(35) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#66] + +(36) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [date_sk#51] +Right keys [1]: [d_date_sk#66] +Join condition: None + +(37) Project [codegen id : 11] +Output [5]: [page_sk#50, sales_price#52, profit#53, return_amt#54, net_loss#55] +Input [7]: [page_sk#50, date_sk#51, sales_price#52, profit#53, return_amt#54, net_loss#55, d_date_sk#66] + +(38) Scan parquet default.catalog_page +Output [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_page] +PushedFilters: [IsNotNull(cp_catalog_page_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 10] +Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] + +(40) Filter [codegen id : 10] +Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Condition : isnotnull(cp_catalog_page_sk#67) + +(41) BroadcastExchange +Input [2]: [cp_catalog_page_sk#67, cp_catalog_page_id#68] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#69] + +(42) BroadcastHashJoin [codegen id : 11] +Left keys [1]: [page_sk#50] +Right keys [1]: [cp_catalog_page_sk#67] +Join condition: None + +(43) Project [codegen id : 11] +Output [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#68] +Input [7]: [page_sk#50, sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_sk#67, cp_catalog_page_id#68] + +(44) HashAggregate [codegen id : 11] +Input [5]: [sales_price#52, profit#53, return_amt#54, net_loss#55, cp_catalog_page_id#68] +Keys [1]: [cp_catalog_page_id#68] +Functions [4]: [partial_sum(UnscaledValue(sales_price#52)), partial_sum(UnscaledValue(return_amt#54)), partial_sum(UnscaledValue(profit#53)), partial_sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum#70, sum#71, sum#72, sum#73] +Results [5]: [cp_catalog_page_id#68, sum#74, sum#75, sum#76, sum#77] + +(45) Exchange +Input [5]: [cp_catalog_page_id#68, sum#74, sum#75, sum#76, sum#77] +Arguments: hashpartitioning(cp_catalog_page_id#68, 5), ENSURE_REQUIREMENTS, [id=#78] + +(46) HashAggregate [codegen id : 12] +Input [5]: [cp_catalog_page_id#68, sum#74, sum#75, sum#76, sum#77] +Keys [1]: [cp_catalog_page_id#68] +Functions [4]: [sum(UnscaledValue(sales_price#52)), sum(UnscaledValue(return_amt#54)), sum(UnscaledValue(profit#53)), sum(UnscaledValue(net_loss#55))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#52))#79, sum(UnscaledValue(return_amt#54))#80, sum(UnscaledValue(profit#53))#81, sum(UnscaledValue(net_loss#55))#82] +Results [5]: [catalog channel AS channel#83, concat(catalog_page, cp_catalog_page_id#68) AS id#84, MakeDecimal(sum(UnscaledValue(sales_price#52))#79,17,2) AS sales#85, MakeDecimal(sum(UnscaledValue(return_amt#54))#80,17,2) AS returns#86, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#53))#81,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#55))#82,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#87] + +(47) Scan parquet default.web_sales +Output [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#91), dynamicpruningexpression(ws_sold_date_sk#91 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 13] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] + +(49) Filter [codegen id : 13] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] +Condition : isnotnull(ws_web_site_sk#88) + +(50) Project [codegen id : 13] +Output [6]: [ws_web_site_sk#88 AS wsr_web_site_sk#92, ws_sold_date_sk#91 AS date_sk#93, ws_ext_sales_price#89 AS sales_price#94, ws_net_profit#90 AS profit#95, 0.00 AS return_amt#96, 0.00 AS net_loss#97] +Input [4]: [ws_web_site_sk#88, ws_ext_sales_price#89, ws_net_profit#90, ws_sold_date_sk#91] + +(51) Scan parquet default.web_returns +Output [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#102), dynamicpruningexpression(wr_returned_date_sk#102 IN dynamicpruning#5)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 14] +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] + +(53) BroadcastExchange +Input [5]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, true] as bigint), 32) | (cast(input[1, int, true] as bigint) & 4294967295))),false), [id=#103] + +(54) Scan parquet default.web_sales +Output [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_sales] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_order_number), IsNotNull(ws_web_site_sk)] +ReadSchema: struct + +(55) ColumnarToRow +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] + +(56) Filter +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] +Condition : ((isnotnull(ws_item_sk#104) AND isnotnull(ws_order_number#106)) AND isnotnull(ws_web_site_sk#105)) + +(57) Project +Output [3]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] +Input [4]: [ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106, ws_sold_date_sk#107] + +(58) BroadcastHashJoin [codegen id : 15] +Left keys [2]: [wr_item_sk#98, wr_order_number#99] +Right keys [2]: [ws_item_sk#104, ws_order_number#106] +Join condition: None + +(59) Project [codegen id : 15] +Output [6]: [ws_web_site_sk#105 AS wsr_web_site_sk#108, wr_returned_date_sk#102 AS date_sk#109, 0.00 AS sales_price#110, 0.00 AS profit#111, wr_return_amt#100 AS return_amt#112, wr_net_loss#101 AS net_loss#113] +Input [8]: [wr_item_sk#98, wr_order_number#99, wr_return_amt#100, wr_net_loss#101, wr_returned_date_sk#102, ws_item_sk#104, ws_web_site_sk#105, ws_order_number#106] + +(60) Union + +(61) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#114] + +(62) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [date_sk#93] +Right keys [1]: [d_date_sk#114] +Join condition: None + +(63) Project [codegen id : 18] +Output [5]: [wsr_web_site_sk#92, sales_price#94, profit#95, return_amt#96, net_loss#97] +Input [7]: [wsr_web_site_sk#92, date_sk#93, sales_price#94, profit#95, return_amt#96, net_loss#97, d_date_sk#114] + +(64) Scan parquet default.web_site +Output [2]: [web_site_sk#115, web_site_id#116] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_site_sk)] +ReadSchema: struct + +(65) ColumnarToRow [codegen id : 17] +Input [2]: [web_site_sk#115, web_site_id#116] + +(66) Filter [codegen id : 17] +Input [2]: [web_site_sk#115, web_site_id#116] +Condition : isnotnull(web_site_sk#115) + +(67) BroadcastExchange +Input [2]: [web_site_sk#115, web_site_id#116] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#117] + +(68) BroadcastHashJoin [codegen id : 18] +Left keys [1]: [wsr_web_site_sk#92] +Right keys [1]: [web_site_sk#115] +Join condition: None + +(69) Project [codegen id : 18] +Output [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Input [7]: [wsr_web_site_sk#92, sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_sk#115, web_site_id#116] + +(70) HashAggregate [codegen id : 18] +Input [5]: [sales_price#94, profit#95, return_amt#96, net_loss#97, web_site_id#116] +Keys [1]: [web_site_id#116] +Functions [4]: [partial_sum(UnscaledValue(sales_price#94)), partial_sum(UnscaledValue(return_amt#96)), partial_sum(UnscaledValue(profit#95)), partial_sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum#118, sum#119, sum#120, sum#121] +Results [5]: [web_site_id#116, sum#122, sum#123, sum#124, sum#125] + +(71) Exchange +Input [5]: [web_site_id#116, sum#122, sum#123, sum#124, sum#125] +Arguments: hashpartitioning(web_site_id#116, 5), ENSURE_REQUIREMENTS, [id=#126] + +(72) HashAggregate [codegen id : 19] +Input [5]: [web_site_id#116, sum#122, sum#123, sum#124, sum#125] +Keys [1]: [web_site_id#116] +Functions [4]: [sum(UnscaledValue(sales_price#94)), sum(UnscaledValue(return_amt#96)), sum(UnscaledValue(profit#95)), sum(UnscaledValue(net_loss#97))] +Aggregate Attributes [4]: [sum(UnscaledValue(sales_price#94))#127, sum(UnscaledValue(return_amt#96))#128, sum(UnscaledValue(profit#95))#129, sum(UnscaledValue(net_loss#97))#130] +Results [5]: [web channel AS channel#131, concat(web_site, web_site_id#116) AS id#132, MakeDecimal(sum(UnscaledValue(sales_price#94))#127,17,2) AS sales#133, MakeDecimal(sum(UnscaledValue(return_amt#96))#128,17,2) AS returns#134, CheckOverflow((promote_precision(cast(MakeDecimal(sum(UnscaledValue(profit#95))#129,17,2) as decimal(18,2))) - promote_precision(cast(MakeDecimal(sum(UnscaledValue(net_loss#97))#130,17,2) as decimal(18,2)))), DecimalType(18,2), true) AS profit#135] + +(73) Union + +(74) HashAggregate [codegen id : 20] +Input [5]: [channel#41, id#42, sales#43, returns#44, profit#45] +Keys [2]: [channel#41, id#42] +Functions [3]: [partial_sum(sales#43), partial_sum(returns#44), partial_sum(profit#45)] +Aggregate Attributes [6]: [sum#136, isEmpty#137, sum#138, isEmpty#139, sum#140, isEmpty#141] +Results [8]: [channel#41, id#42, sum#142, isEmpty#143, sum#144, isEmpty#145, sum#146, isEmpty#147] + +(75) Exchange +Input [8]: [channel#41, id#42, sum#142, isEmpty#143, sum#144, isEmpty#145, sum#146, isEmpty#147] +Arguments: hashpartitioning(channel#41, id#42, 5), ENSURE_REQUIREMENTS, [id=#148] + +(76) HashAggregate [codegen id : 21] +Input [8]: [channel#41, id#42, sum#142, isEmpty#143, sum#144, isEmpty#145, sum#146, isEmpty#147] +Keys [2]: [channel#41, id#42] +Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#45)] +Aggregate Attributes [3]: [sum(sales#43)#149, sum(returns#44)#150, sum(profit#45)#151] +Results [5]: [channel#41, id#42, cast(sum(sales#43)#149 as decimal(37,2)) AS sales#152, cast(sum(returns#44)#150 as decimal(37,2)) AS returns#153, cast(sum(profit#45)#151 as decimal(38,2)) AS profit#154] + +(77) ReusedExchange [Reuses operator id: unknown] +Output [8]: [channel#41, id#42, sum#155, isEmpty#156, sum#157, isEmpty#158, sum#159, isEmpty#160] + +(78) HashAggregate [codegen id : 42] +Input [8]: [channel#41, id#42, sum#155, isEmpty#156, sum#157, isEmpty#158, sum#159, isEmpty#160] +Keys [2]: [channel#41, id#42] +Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#45)] +Aggregate Attributes [3]: [sum(sales#43)#161, sum(returns#44)#162, sum(profit#45)#163] +Results [4]: [channel#41, sum(sales#43)#161 AS sales#164, sum(returns#44)#162 AS returns#165, sum(profit#45)#163 AS profit#166] + +(79) HashAggregate [codegen id : 42] +Input [4]: [channel#41, sales#164, returns#165, profit#166] +Keys [1]: [channel#41] +Functions [3]: [partial_sum(sales#164), partial_sum(returns#165), partial_sum(profit#166)] +Aggregate Attributes [6]: [sum#167, isEmpty#168, sum#169, isEmpty#170, sum#171, isEmpty#172] +Results [7]: [channel#41, sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] + +(80) Exchange +Input [7]: [channel#41, sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] +Arguments: hashpartitioning(channel#41, 5), ENSURE_REQUIREMENTS, [id=#179] + +(81) HashAggregate [codegen id : 43] +Input [7]: [channel#41, sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] +Keys [1]: [channel#41] +Functions [3]: [sum(sales#164), sum(returns#165), sum(profit#166)] +Aggregate Attributes [3]: [sum(sales#164)#180, sum(returns#165)#181, sum(profit#166)#182] +Results [5]: [channel#41, null AS id#183, sum(sales#164)#180 AS sum(sales)#184, sum(returns#165)#181 AS sum(returns)#185, sum(profit#166)#182 AS sum(profit)#186] + +(82) ReusedExchange [Reuses operator id: unknown] +Output [8]: [channel#41, id#42, sum#187, isEmpty#188, sum#189, isEmpty#190, sum#191, isEmpty#192] + +(83) HashAggregate [codegen id : 64] +Input [8]: [channel#41, id#42, sum#187, isEmpty#188, sum#189, isEmpty#190, sum#191, isEmpty#192] +Keys [2]: [channel#41, id#42] +Functions [3]: [sum(sales#43), sum(returns#44), sum(profit#45)] +Aggregate Attributes [3]: [sum(sales#43)#193, sum(returns#44)#194, sum(profit#45)#195] +Results [3]: [sum(sales#43)#193 AS sales#164, sum(returns#44)#194 AS returns#165, sum(profit#45)#195 AS profit#166] + +(84) HashAggregate [codegen id : 64] +Input [3]: [sales#164, returns#165, profit#166] +Keys: [] +Functions [3]: [partial_sum(sales#164), partial_sum(returns#165), partial_sum(profit#166)] +Aggregate Attributes [6]: [sum#196, isEmpty#197, sum#198, isEmpty#199, sum#200, isEmpty#201] +Results [6]: [sum#202, isEmpty#203, sum#204, isEmpty#205, sum#206, isEmpty#207] + +(85) Exchange +Input [6]: [sum#202, isEmpty#203, sum#204, isEmpty#205, sum#206, isEmpty#207] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#208] + +(86) HashAggregate [codegen id : 65] +Input [6]: [sum#202, isEmpty#203, sum#204, isEmpty#205, sum#206, isEmpty#207] +Keys: [] +Functions [3]: [sum(sales#164), sum(returns#165), sum(profit#166)] +Aggregate Attributes [3]: [sum(sales#164)#209, sum(returns#165)#210, sum(profit#166)#211] +Results [5]: [null AS channel#212, null AS id#213, sum(sales#164)#209 AS sum(sales)#214, sum(returns#165)#210 AS sum(returns)#215, sum(profit#166)#211 AS sum(profit)#216] + +(87) Union + +(88) HashAggregate [codegen id : 66] +Input [5]: [channel#41, id#42, sales#152, returns#153, profit#154] +Keys [5]: [channel#41, id#42, sales#152, returns#153, profit#154] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#41, id#42, sales#152, returns#153, profit#154] + +(89) Exchange +Input [5]: [channel#41, id#42, sales#152, returns#153, profit#154] +Arguments: hashpartitioning(channel#41, id#42, sales#152, returns#153, profit#154, 5), ENSURE_REQUIREMENTS, [id=#217] + +(90) HashAggregate [codegen id : 67] +Input [5]: [channel#41, id#42, sales#152, returns#153, profit#154] +Keys [5]: [channel#41, id#42, sales#152, returns#153, profit#154] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#41, id#42, sales#152, returns#153, profit#154] + +(91) TakeOrderedAndProject +Input [5]: [channel#41, id#42, sales#152, returns#153, profit#154] +Arguments: 100, [channel#41 ASC NULLS FIRST, id#42 ASC NULLS FIRST], [channel#41, id#42, sales#152, returns#153, profit#154] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (92) + + +(92) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#22] + +Subquery:2 Hosting operator id = 5 Hosting Expression = sr_returned_date_sk#15 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 26 Hosting Expression = cs_sold_date_sk#49 IN dynamicpruning#5 + +Subquery:4 Hosting operator id = 30 Hosting Expression = cr_returned_date_sk#59 IN dynamicpruning#5 + +Subquery:5 Hosting operator id = 47 Hosting Expression = ws_sold_date_sk#91 IN dynamicpruning#5 + +Subquery:6 Hosting operator id = 51 Hosting Expression = wr_returned_date_sk#102 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt new file mode 100644 index 0000000000000..0e98998fb31d5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q5a/simplified.txt @@ -0,0 +1,155 @@ +TakeOrderedAndProject [channel,id,sales,returns,profit] + WholeStageCodegen (67) + HashAggregate [channel,id,sales,returns,profit] + InputAdapter + Exchange [channel,id,sales,returns,profit] #1 + WholeStageCodegen (66) + HashAggregate [channel,id,sales,returns,profit] + InputAdapter + Union + WholeStageCodegen (21) + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel,id] #2 + WholeStageCodegen (20) + HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (6) + HashAggregate [s_store_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),channel,id,sales,returns,profit,sum,sum,sum,sum] + InputAdapter + Exchange [s_store_id] #3 + WholeStageCodegen (5) + HashAggregate [s_store_id,sales_price,return_amt,profit,net_loss] [sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,profit,return_amt,net_loss,s_store_id] + BroadcastHashJoin [store_sk,s_store_sk] + Project [store_sk,sales_price,profit,return_amt,net_loss] + BroadcastHashJoin [date_sk,d_date_sk] + InputAdapter + Union + WholeStageCodegen (1) + Project [ss_store_sk,ss_sold_date_sk,ss_ext_sales_price,ss_net_profit] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + WholeStageCodegen (2) + Project [sr_store_sk,sr_returned_date_sk,sr_return_amt,sr_net_loss] + Filter [sr_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_store_sk,sr_return_amt,sr_net_loss,sr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (4) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + WholeStageCodegen (12) + HashAggregate [cp_catalog_page_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),channel,id,sales,returns,profit,sum,sum,sum,sum] + InputAdapter + Exchange [cp_catalog_page_id] #6 + WholeStageCodegen (11) + HashAggregate [cp_catalog_page_id,sales_price,return_amt,profit,net_loss] [sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,profit,return_amt,net_loss,cp_catalog_page_id] + BroadcastHashJoin [page_sk,cp_catalog_page_sk] + Project [page_sk,sales_price,profit,return_amt,net_loss] + BroadcastHashJoin [date_sk,d_date_sk] + InputAdapter + Union + WholeStageCodegen (7) + Project [cs_catalog_page_sk,cs_sold_date_sk,cs_ext_sales_price,cs_net_profit] + Filter [cs_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + WholeStageCodegen (8) + Project [cr_catalog_page_sk,cr_returned_date_sk,cr_return_amount,cr_net_loss] + Filter [cr_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_catalog_page_sk,cr_return_amount,cr_net_loss,cr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (10) + Filter [cp_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_page [cp_catalog_page_sk,cp_catalog_page_id] + WholeStageCodegen (19) + HashAggregate [web_site_id,sum,sum,sum,sum] [sum(UnscaledValue(sales_price)),sum(UnscaledValue(return_amt)),sum(UnscaledValue(profit)),sum(UnscaledValue(net_loss)),channel,id,sales,returns,profit,sum,sum,sum,sum] + InputAdapter + Exchange [web_site_id] #8 + WholeStageCodegen (18) + HashAggregate [web_site_id,sales_price,return_amt,profit,net_loss] [sum,sum,sum,sum,sum,sum,sum,sum] + Project [sales_price,profit,return_amt,net_loss,web_site_id] + BroadcastHashJoin [wsr_web_site_sk,web_site_sk] + Project [wsr_web_site_sk,sales_price,profit,return_amt,net_loss] + BroadcastHashJoin [date_sk,d_date_sk] + InputAdapter + Union + WholeStageCodegen (13) + Project [ws_web_site_sk,ws_sold_date_sk,ws_ext_sales_price,ws_net_profit] + Filter [ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_web_site_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + WholeStageCodegen (15) + Project [ws_web_site_sk,wr_returned_date_sk,wr_return_amt,wr_net_loss] + BroadcastHashJoin [wr_item_sk,wr_order_number,ws_item_sk,ws_order_number] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (14) + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss,wr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + Project [ws_item_sk,ws_web_site_sk,ws_order_number] + Filter [ws_item_sk,ws_order_number,ws_web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_web_site_sk,ws_order_number,ws_sold_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (17) + Filter [web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_site_id] + WholeStageCodegen (43) + HashAggregate [channel,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),id,sum(sales),sum(returns),sum(profit),sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel] #11 + WholeStageCodegen (42) + HashAggregate [channel,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + ReusedExchange [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] #12 + WholeStageCodegen (65) + HashAggregate [sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),channel,id,sum(sales),sum(returns),sum(profit),sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange #13 + WholeStageCodegen (64) + HashAggregate [sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + ReusedExchange [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] #12 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/explain.txt new file mode 100644 index 0000000000000..3f2b62a7b8fa4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/explain.txt @@ -0,0 +1,339 @@ +== Physical Plan == +TakeOrderedAndProject (50) ++- * Project (49) + +- * Filter (48) + +- * HashAggregate (47) + +- Exchange (46) + +- * HashAggregate (45) + +- * Project (44) + +- * SortMergeJoin Inner (43) + :- * Sort (28) + : +- Exchange (27) + : +- * Project (26) + : +- * BroadcastHashJoin Inner BuildRight (25) + : :- * Project (19) + : : +- * BroadcastHashJoin Inner BuildRight (18) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (17) + : : +- * Project (16) + : : +- * Filter (15) + : : +- * BroadcastHashJoin LeftOuter BuildRight (14) + : : :- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.item (4) + : : +- BroadcastExchange (13) + : : +- * HashAggregate (12) + : : +- Exchange (11) + : : +- * HashAggregate (10) + : : +- * Filter (9) + : : +- * ColumnarToRow (8) + : : +- Scan parquet default.item (7) + : +- BroadcastExchange (24) + : +- * Project (23) + : +- * Filter (22) + : +- * ColumnarToRow (21) + : +- Scan parquet default.date_dim (20) + +- * Sort (42) + +- Exchange (41) + +- * Project (40) + +- * SortMergeJoin Inner (39) + :- * Sort (33) + : +- Exchange (32) + : +- * Filter (31) + : +- * ColumnarToRow (30) + : +- Scan parquet default.customer_address (29) + +- * Sort (38) + +- Exchange (37) + +- * Filter (36) + +- * ColumnarToRow (35) + +- Scan parquet default.customer (34) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 5] +Input [3]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 5] +Input [3]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3] +Condition : (isnotnull(ss_customer_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.item +Output [3]: [i_item_sk#5, i_current_price#6, i_category#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 3] +Input [3]: [i_item_sk#5, i_current_price#6, i_category#7] + +(6) Filter [codegen id : 3] +Input [3]: [i_item_sk#5, i_current_price#6, i_category#7] +Condition : (isnotnull(i_current_price#6) AND isnotnull(i_item_sk#5)) + +(7) Scan parquet default.item +Output [2]: [i_current_price#8, i_category#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category)] +ReadSchema: struct + +(8) ColumnarToRow [codegen id : 1] +Input [2]: [i_current_price#8, i_category#9] + +(9) Filter [codegen id : 1] +Input [2]: [i_current_price#8, i_category#9] +Condition : isnotnull(i_category#9) + +(10) HashAggregate [codegen id : 1] +Input [2]: [i_current_price#8, i_category#9] +Keys [1]: [i_category#9] +Functions [1]: [partial_avg(UnscaledValue(i_current_price#8))] +Aggregate Attributes [2]: [sum#10, count#11] +Results [3]: [i_category#9, sum#12, count#13] + +(11) Exchange +Input [3]: [i_category#9, sum#12, count#13] +Arguments: hashpartitioning(i_category#9, 5), ENSURE_REQUIREMENTS, [id=#14] + +(12) HashAggregate [codegen id : 2] +Input [3]: [i_category#9, sum#12, count#13] +Keys [1]: [i_category#9] +Functions [1]: [avg(UnscaledValue(i_current_price#8))] +Aggregate Attributes [1]: [avg(UnscaledValue(i_current_price#8))#15] +Results [2]: [cast((avg(UnscaledValue(i_current_price#8))#15 / 100.0) as decimal(11,6)) AS avg(i_current_price)#16, i_category#9] + +(13) BroadcastExchange +Input [2]: [avg(i_current_price)#16, i_category#9] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#17] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [i_category#7] +Right keys [1]: [i_category#9] +Join condition: None + +(15) Filter [codegen id : 3] +Input [5]: [i_item_sk#5, i_current_price#6, i_category#7, avg(i_current_price)#16, i_category#9] +Condition : (cast(i_current_price#6 as decimal(14,7)) > CheckOverflow((1.200000 * promote_precision(avg(i_current_price)#16)), DecimalType(14,7), true)) + +(16) Project [codegen id : 3] +Output [1]: [i_item_sk#5] +Input [5]: [i_item_sk#5, i_current_price#6, i_category#7, avg(i_current_price)#16, i_category#9] + +(17) BroadcastExchange +Input [1]: [i_item_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(18) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(19) Project [codegen id : 5] +Output [2]: [ss_customer_sk#2, ss_sold_date_sk#3] +Input [4]: [ss_item_sk#1, ss_customer_sk#2, ss_sold_date_sk#3, i_item_sk#5] + +(20) Scan parquet default.date_dim +Output [2]: [d_date_sk#19, d_month_seq#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 4] +Input [2]: [d_date_sk#19, d_month_seq#20] + +(22) Filter [codegen id : 4] +Input [2]: [d_date_sk#19, d_month_seq#20] +Condition : ((isnotnull(d_month_seq#20) AND (d_month_seq#20 = Subquery scalar-subquery#21, [id=#22])) AND isnotnull(d_date_sk#19)) + +(23) Project [codegen id : 4] +Output [1]: [d_date_sk#19] +Input [2]: [d_date_sk#19, d_month_seq#20] + +(24) BroadcastExchange +Input [1]: [d_date_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] + +(25) BroadcastHashJoin [codegen id : 5] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#19] +Join condition: None + +(26) Project [codegen id : 5] +Output [1]: [ss_customer_sk#2] +Input [3]: [ss_customer_sk#2, ss_sold_date_sk#3, d_date_sk#19] + +(27) Exchange +Input [1]: [ss_customer_sk#2] +Arguments: hashpartitioning(ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#24] + +(28) Sort [codegen id : 6] +Input [1]: [ss_customer_sk#2] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(29) Scan parquet default.customer_address +Output [2]: [ca_address_sk#25, ca_state#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#25, ca_state#26] + +(31) Filter [codegen id : 7] +Input [2]: [ca_address_sk#25, ca_state#26] +Condition : isnotnull(ca_address_sk#25) + +(32) Exchange +Input [2]: [ca_address_sk#25, ca_state#26] +Arguments: hashpartitioning(ca_address_sk#25, 5), ENSURE_REQUIREMENTS, [id=#27] + +(33) Sort [codegen id : 8] +Input [2]: [ca_address_sk#25, ca_state#26] +Arguments: [ca_address_sk#25 ASC NULLS FIRST], false, 0 + +(34) Scan parquet default.customer +Output [2]: [c_customer_sk#28, c_current_addr_sk#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_customer_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 9] +Input [2]: [c_customer_sk#28, c_current_addr_sk#29] + +(36) Filter [codegen id : 9] +Input [2]: [c_customer_sk#28, c_current_addr_sk#29] +Condition : (isnotnull(c_current_addr_sk#29) AND isnotnull(c_customer_sk#28)) + +(37) Exchange +Input [2]: [c_customer_sk#28, c_current_addr_sk#29] +Arguments: hashpartitioning(c_current_addr_sk#29, 5), ENSURE_REQUIREMENTS, [id=#30] + +(38) Sort [codegen id : 10] +Input [2]: [c_customer_sk#28, c_current_addr_sk#29] +Arguments: [c_current_addr_sk#29 ASC NULLS FIRST], false, 0 + +(39) SortMergeJoin [codegen id : 11] +Left keys [1]: [ca_address_sk#25] +Right keys [1]: [c_current_addr_sk#29] +Join condition: None + +(40) Project [codegen id : 11] +Output [2]: [ca_state#26, c_customer_sk#28] +Input [4]: [ca_address_sk#25, ca_state#26, c_customer_sk#28, c_current_addr_sk#29] + +(41) Exchange +Input [2]: [ca_state#26, c_customer_sk#28] +Arguments: hashpartitioning(c_customer_sk#28, 5), ENSURE_REQUIREMENTS, [id=#31] + +(42) Sort [codegen id : 12] +Input [2]: [ca_state#26, c_customer_sk#28] +Arguments: [c_customer_sk#28 ASC NULLS FIRST], false, 0 + +(43) SortMergeJoin [codegen id : 13] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#28] +Join condition: None + +(44) Project [codegen id : 13] +Output [1]: [ca_state#26] +Input [3]: [ss_customer_sk#2, ca_state#26, c_customer_sk#28] + +(45) HashAggregate [codegen id : 13] +Input [1]: [ca_state#26] +Keys [1]: [ca_state#26] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#32] +Results [2]: [ca_state#26, count#33] + +(46) Exchange +Input [2]: [ca_state#26, count#33] +Arguments: hashpartitioning(ca_state#26, 5), ENSURE_REQUIREMENTS, [id=#34] + +(47) HashAggregate [codegen id : 14] +Input [2]: [ca_state#26, count#33] +Keys [1]: [ca_state#26] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#35] +Results [4]: [ca_state#26 AS state#36, count(1)#35 AS cnt#37, count(1)#35 AS count(1)#38, ca_state#26] + +(48) Filter [codegen id : 14] +Input [4]: [state#36, cnt#37, count(1)#38, ca_state#26] +Condition : (count(1)#38 >= 10) + +(49) Project [codegen id : 14] +Output [3]: [state#36, cnt#37, ca_state#26] +Input [4]: [state#36, cnt#37, count(1)#38, ca_state#26] + +(50) TakeOrderedAndProject +Input [3]: [state#36, cnt#37, ca_state#26] +Arguments: 100, [cnt#37 ASC NULLS FIRST, ca_state#26 ASC NULLS FIRST], [state#36, cnt#37] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (51) + + +(51) ReusedExchange [Reuses operator id: 24] +Output [1]: [d_date_sk#19] + +Subquery:2 Hosting operator id = 22 Hosting Expression = Subquery scalar-subquery#21, [id=#22] +* HashAggregate (58) ++- Exchange (57) + +- * HashAggregate (56) + +- * Project (55) + +- * Filter (54) + +- * ColumnarToRow (53) + +- Scan parquet default.date_dim (52) + + +(52) Scan parquet default.date_dim +Output [3]: [d_month_seq#39, d_year#40, d_moy#41] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,1)] +ReadSchema: struct + +(53) ColumnarToRow [codegen id : 1] +Input [3]: [d_month_seq#39, d_year#40, d_moy#41] + +(54) Filter [codegen id : 1] +Input [3]: [d_month_seq#39, d_year#40, d_moy#41] +Condition : (((isnotnull(d_year#40) AND isnotnull(d_moy#41)) AND (d_year#40 = 2000)) AND (d_moy#41 = 1)) + +(55) Project [codegen id : 1] +Output [1]: [d_month_seq#39] +Input [3]: [d_month_seq#39, d_year#40, d_moy#41] + +(56) HashAggregate [codegen id : 1] +Input [1]: [d_month_seq#39] +Keys [1]: [d_month_seq#39] +Functions: [] +Aggregate Attributes: [] +Results [1]: [d_month_seq#39] + +(57) Exchange +Input [1]: [d_month_seq#39] +Arguments: hashpartitioning(d_month_seq#39, 5), ENSURE_REQUIREMENTS, [id=#42] + +(58) HashAggregate [codegen id : 2] +Input [1]: [d_month_seq#39] +Keys [1]: [d_month_seq#39] +Functions: [] +Aggregate Attributes: [] +Results [1]: [d_month_seq#39] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/simplified.txt new file mode 100644 index 0000000000000..f3badf6efe6b6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6.sf100/simplified.txt @@ -0,0 +1,97 @@ +TakeOrderedAndProject [cnt,ca_state,state] + WholeStageCodegen (14) + Project [state,cnt,ca_state] + Filter [count(1)] + HashAggregate [ca_state,count] [count(1),state,cnt,count(1),count] + InputAdapter + Exchange [ca_state] #1 + WholeStageCodegen (13) + HashAggregate [ca_state] [count,count] + Project [ca_state] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (6) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #2 + WholeStageCodegen (5) + Project [ss_customer_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_customer_sk,ss_sold_date_sk] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_customer_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [i_item_sk] + Filter [i_current_price,avg(i_current_price)] + BroadcastHashJoin [i_category,i_category] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_category] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + HashAggregate [i_category,sum,count] [avg(UnscaledValue(i_current_price)),avg(i_current_price),sum,count] + InputAdapter + Exchange [i_category] #6 + WholeStageCodegen (1) + HashAggregate [i_category,i_current_price] [sum,count,sum,count] + Filter [i_category] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_current_price,i_category] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (4) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + Subquery #2 + WholeStageCodegen (2) + HashAggregate [d_month_seq] + InputAdapter + Exchange [d_month_seq] #7 + WholeStageCodegen (1) + HashAggregate [d_month_seq] + Project [d_month_seq] + Filter [d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + WholeStageCodegen (12) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #8 + WholeStageCodegen (11) + Project [ca_state,c_customer_sk] + SortMergeJoin [ca_address_sk,c_current_addr_sk] + InputAdapter + WholeStageCodegen (8) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #9 + WholeStageCodegen (7) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + WholeStageCodegen (10) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #10 + WholeStageCodegen (9) + Filter [c_current_addr_sk,c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6/explain.txt new file mode 100644 index 0000000000000..b37db85388e0f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6/explain.txt @@ -0,0 +1,309 @@ +== Physical Plan == +TakeOrderedAndProject (44) ++- * Project (43) + +- * Filter (42) + +- * HashAggregate (41) + +- Exchange (40) + +- * HashAggregate (39) + +- * Project (38) + +- * BroadcastHashJoin Inner BuildRight (37) + :- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (15) + : : +- * BroadcastHashJoin Inner BuildRight (14) + : : :- * Project (9) + : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.customer_address (1) + : : : +- BroadcastExchange (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.customer (4) + : : +- BroadcastExchange (13) + : : +- * Filter (12) + : : +- * ColumnarToRow (11) + : : +- Scan parquet default.store_sales (10) + : +- BroadcastExchange (20) + : +- * Project (19) + : +- * Filter (18) + : +- * ColumnarToRow (17) + : +- Scan parquet default.date_dim (16) + +- BroadcastExchange (36) + +- * Project (35) + +- * Filter (34) + +- * BroadcastHashJoin LeftOuter BuildRight (33) + :- * Filter (25) + : +- * ColumnarToRow (24) + : +- Scan parquet default.item (23) + +- BroadcastExchange (32) + +- * HashAggregate (31) + +- Exchange (30) + +- * HashAggregate (29) + +- * Filter (28) + +- * ColumnarToRow (27) + +- Scan parquet default.item (26) + + +(1) Scan parquet default.customer_address +Output [2]: [ca_address_sk#1, ca_state#2] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 7] +Input [2]: [ca_address_sk#1, ca_state#2] + +(3) Filter [codegen id : 7] +Input [2]: [ca_address_sk#1, ca_state#2] +Condition : isnotnull(ca_address_sk#1) + +(4) Scan parquet default.customer +Output [2]: [c_customer_sk#3, c_current_addr_sk#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_current_addr_sk), IsNotNull(c_customer_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [c_customer_sk#3, c_current_addr_sk#4] + +(6) Filter [codegen id : 1] +Input [2]: [c_customer_sk#3, c_current_addr_sk#4] +Condition : (isnotnull(c_current_addr_sk#4) AND isnotnull(c_customer_sk#3)) + +(7) BroadcastExchange +Input [2]: [c_customer_sk#3, c_current_addr_sk#4] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#5] + +(8) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ca_address_sk#1] +Right keys [1]: [c_current_addr_sk#4] +Join condition: None + +(9) Project [codegen id : 7] +Output [2]: [ca_state#2, c_customer_sk#3] +Input [4]: [ca_address_sk#1, ca_state#2, c_customer_sk#3, c_current_addr_sk#4] + +(10) Scan parquet default.store_sales +Output [3]: [ss_item_sk#6, ss_customer_sk#7, ss_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#8), dynamicpruningexpression(ss_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(ss_customer_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [3]: [ss_item_sk#6, ss_customer_sk#7, ss_sold_date_sk#8] + +(12) Filter [codegen id : 2] +Input [3]: [ss_item_sk#6, ss_customer_sk#7, ss_sold_date_sk#8] +Condition : (isnotnull(ss_customer_sk#7) AND isnotnull(ss_item_sk#6)) + +(13) BroadcastExchange +Input [3]: [ss_item_sk#6, ss_customer_sk#7, ss_sold_date_sk#8] +Arguments: HashedRelationBroadcastMode(List(cast(input[1, int, false] as bigint)),false), [id=#10] + +(14) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [c_customer_sk#3] +Right keys [1]: [ss_customer_sk#7] +Join condition: None + +(15) Project [codegen id : 7] +Output [3]: [ca_state#2, ss_item_sk#6, ss_sold_date_sk#8] +Input [5]: [ca_state#2, c_customer_sk#3, ss_item_sk#6, ss_customer_sk#7, ss_sold_date_sk#8] + +(16) Scan parquet default.date_dim +Output [2]: [d_date_sk#11, d_month_seq#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#11, d_month_seq#12] + +(18) Filter [codegen id : 3] +Input [2]: [d_date_sk#11, d_month_seq#12] +Condition : ((isnotnull(d_month_seq#12) AND (d_month_seq#12 = Subquery scalar-subquery#13, [id=#14])) AND isnotnull(d_date_sk#11)) + +(19) Project [codegen id : 3] +Output [1]: [d_date_sk#11] +Input [2]: [d_date_sk#11, d_month_seq#12] + +(20) BroadcastExchange +Input [1]: [d_date_sk#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(21) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_sold_date_sk#8] +Right keys [1]: [d_date_sk#11] +Join condition: None + +(22) Project [codegen id : 7] +Output [2]: [ca_state#2, ss_item_sk#6] +Input [4]: [ca_state#2, ss_item_sk#6, ss_sold_date_sk#8, d_date_sk#11] + +(23) Scan parquet default.item +Output [3]: [i_item_sk#16, i_current_price#17, i_category#18] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), IsNotNull(i_item_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 6] +Input [3]: [i_item_sk#16, i_current_price#17, i_category#18] + +(25) Filter [codegen id : 6] +Input [3]: [i_item_sk#16, i_current_price#17, i_category#18] +Condition : (isnotnull(i_current_price#17) AND isnotnull(i_item_sk#16)) + +(26) Scan parquet default.item +Output [2]: [i_current_price#19, i_category#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 4] +Input [2]: [i_current_price#19, i_category#20] + +(28) Filter [codegen id : 4] +Input [2]: [i_current_price#19, i_category#20] +Condition : isnotnull(i_category#20) + +(29) HashAggregate [codegen id : 4] +Input [2]: [i_current_price#19, i_category#20] +Keys [1]: [i_category#20] +Functions [1]: [partial_avg(UnscaledValue(i_current_price#19))] +Aggregate Attributes [2]: [sum#21, count#22] +Results [3]: [i_category#20, sum#23, count#24] + +(30) Exchange +Input [3]: [i_category#20, sum#23, count#24] +Arguments: hashpartitioning(i_category#20, 5), ENSURE_REQUIREMENTS, [id=#25] + +(31) HashAggregate [codegen id : 5] +Input [3]: [i_category#20, sum#23, count#24] +Keys [1]: [i_category#20] +Functions [1]: [avg(UnscaledValue(i_current_price#19))] +Aggregate Attributes [1]: [avg(UnscaledValue(i_current_price#19))#26] +Results [2]: [cast((avg(UnscaledValue(i_current_price#19))#26 / 100.0) as decimal(11,6)) AS avg(i_current_price)#27, i_category#20] + +(32) BroadcastExchange +Input [2]: [avg(i_current_price)#27, i_category#20] +Arguments: HashedRelationBroadcastMode(List(input[1, string, true]),false), [id=#28] + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [i_category#18] +Right keys [1]: [i_category#20] +Join condition: None + +(34) Filter [codegen id : 6] +Input [5]: [i_item_sk#16, i_current_price#17, i_category#18, avg(i_current_price)#27, i_category#20] +Condition : (cast(i_current_price#17 as decimal(14,7)) > CheckOverflow((1.200000 * promote_precision(avg(i_current_price)#27)), DecimalType(14,7), true)) + +(35) Project [codegen id : 6] +Output [1]: [i_item_sk#16] +Input [5]: [i_item_sk#16, i_current_price#17, i_category#18, avg(i_current_price)#27, i_category#20] + +(36) BroadcastExchange +Input [1]: [i_item_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#29] + +(37) BroadcastHashJoin [codegen id : 7] +Left keys [1]: [ss_item_sk#6] +Right keys [1]: [i_item_sk#16] +Join condition: None + +(38) Project [codegen id : 7] +Output [1]: [ca_state#2] +Input [3]: [ca_state#2, ss_item_sk#6, i_item_sk#16] + +(39) HashAggregate [codegen id : 7] +Input [1]: [ca_state#2] +Keys [1]: [ca_state#2] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#30] +Results [2]: [ca_state#2, count#31] + +(40) Exchange +Input [2]: [ca_state#2, count#31] +Arguments: hashpartitioning(ca_state#2, 5), ENSURE_REQUIREMENTS, [id=#32] + +(41) HashAggregate [codegen id : 8] +Input [2]: [ca_state#2, count#31] +Keys [1]: [ca_state#2] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#33] +Results [4]: [ca_state#2 AS state#34, count(1)#33 AS cnt#35, count(1)#33 AS count(1)#36, ca_state#2] + +(42) Filter [codegen id : 8] +Input [4]: [state#34, cnt#35, count(1)#36, ca_state#2] +Condition : (count(1)#36 >= 10) + +(43) Project [codegen id : 8] +Output [3]: [state#34, cnt#35, ca_state#2] +Input [4]: [state#34, cnt#35, count(1)#36, ca_state#2] + +(44) TakeOrderedAndProject +Input [3]: [state#34, cnt#35, ca_state#2] +Arguments: 100, [cnt#35 ASC NULLS FIRST, ca_state#2 ASC NULLS FIRST], [state#34, cnt#35] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 10 Hosting Expression = ss_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (45) + + +(45) ReusedExchange [Reuses operator id: 20] +Output [1]: [d_date_sk#11] + +Subquery:2 Hosting operator id = 18 Hosting Expression = Subquery scalar-subquery#13, [id=#14] +* HashAggregate (52) ++- Exchange (51) + +- * HashAggregate (50) + +- * Project (49) + +- * Filter (48) + +- * ColumnarToRow (47) + +- Scan parquet default.date_dim (46) + + +(46) Scan parquet default.date_dim +Output [3]: [d_month_seq#37, d_year#38, d_moy#39] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), IsNotNull(d_moy), EqualTo(d_year,2000), EqualTo(d_moy,1)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 1] +Input [3]: [d_month_seq#37, d_year#38, d_moy#39] + +(48) Filter [codegen id : 1] +Input [3]: [d_month_seq#37, d_year#38, d_moy#39] +Condition : (((isnotnull(d_year#38) AND isnotnull(d_moy#39)) AND (d_year#38 = 2000)) AND (d_moy#39 = 1)) + +(49) Project [codegen id : 1] +Output [1]: [d_month_seq#37] +Input [3]: [d_month_seq#37, d_year#38, d_moy#39] + +(50) HashAggregate [codegen id : 1] +Input [1]: [d_month_seq#37] +Keys [1]: [d_month_seq#37] +Functions: [] +Aggregate Attributes: [] +Results [1]: [d_month_seq#37] + +(51) Exchange +Input [1]: [d_month_seq#37] +Arguments: hashpartitioning(d_month_seq#37, 5), ENSURE_REQUIREMENTS, [id=#40] + +(52) HashAggregate [codegen id : 2] +Input [1]: [d_month_seq#37] +Keys [1]: [d_month_seq#37] +Functions: [] +Aggregate Attributes: [] +Results [1]: [d_month_seq#37] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6/simplified.txt new file mode 100644 index 0000000000000..4ba09283e73cd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q6/simplified.txt @@ -0,0 +1,79 @@ +TakeOrderedAndProject [cnt,ca_state,state] + WholeStageCodegen (8) + Project [state,cnt,ca_state] + Filter [count(1)] + HashAggregate [ca_state,count] [count(1),state,cnt,count(1),count] + InputAdapter + Exchange [ca_state] #1 + WholeStageCodegen (7) + HashAggregate [ca_state] [count,count] + Project [ca_state] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ca_state,ss_item_sk] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ca_state,ss_item_sk,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Project [ca_state,c_customer_sk] + BroadcastHashJoin [ca_address_sk,c_current_addr_sk] + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_state] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [c_current_addr_sk,c_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_addr_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [ss_customer_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (3) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + Subquery #2 + WholeStageCodegen (2) + HashAggregate [d_month_seq] + InputAdapter + Exchange [d_month_seq] #5 + WholeStageCodegen (1) + HashAggregate [d_month_seq] + Project [d_month_seq] + Filter [d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_month_seq,d_year,d_moy] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (6) + Project [i_item_sk] + Filter [i_current_price,avg(i_current_price)] + BroadcastHashJoin [i_category,i_category] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_category] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (5) + HashAggregate [i_category,sum,count] [avg(UnscaledValue(i_current_price)),avg(i_current_price),sum,count] + InputAdapter + Exchange [i_category] #8 + WholeStageCodegen (4) + HashAggregate [i_category,i_current_price] [sum,count,sum,count] + Filter [i_category] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_current_price,i_category] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64.sf100/explain.txt new file mode 100644 index 0000000000000..ce584592dd831 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64.sf100/explain.txt @@ -0,0 +1,1162 @@ +== Physical Plan == +* Sort (215) ++- Exchange (214) + +- * Project (213) + +- * SortMergeJoin Inner (212) + :- * Sort (131) + : +- Exchange (130) + : +- * HashAggregate (129) + : +- Exchange (128) + : +- * HashAggregate (127) + : +- * Project (126) + : +- * BroadcastHashJoin Inner BuildRight (125) + : :- * Project (119) + : : +- * BroadcastHashJoin Inner BuildRight (118) + : : :- * Project (116) + : : : +- * BroadcastHashJoin Inner BuildRight (115) + : : : :- * Project (110) + : : : : +- * SortMergeJoin Inner (109) + : : : : :- * Sort (106) + : : : : : +- Exchange (105) + : : : : : +- * Project (104) + : : : : : +- * SortMergeJoin Inner (103) + : : : : : :- * Sort (97) + : : : : : : +- Exchange (96) + : : : : : : +- * Project (95) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (94) + : : : : : : :- * Project (92) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (91) + : : : : : : : :- * Project (86) + : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (85) + : : : : : : : : :- * Project (80) + : : : : : : : : : +- * SortMergeJoin Inner (79) + : : : : : : : : : :- * Sort (76) + : : : : : : : : : : +- Exchange (75) + : : : : : : : : : : +- * Project (74) + : : : : : : : : : : +- * SortMergeJoin Inner (73) + : : : : : : : : : : :- * Sort (67) + : : : : : : : : : : : +- Exchange (66) + : : : : : : : : : : : +- * Project (65) + : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (64) + : : : : : : : : : : : :- * Project (62) + : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (61) + : : : : : : : : : : : : :- * Project (56) + : : : : : : : : : : : : : +- * SortMergeJoin Inner (55) + : : : : : : : : : : : : : :- * Sort (49) + : : : : : : : : : : : : : : +- Exchange (48) + : : : : : : : : : : : : : : +- * Project (47) + : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (46) + : : : : : : : : : : : : : : :- * Project (41) + : : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (40) + : : : : : : : : : : : : : : : :- * Project (35) + : : : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (34) + : : : : : : : : : : : : : : : : :- * Project (13) + : : : : : : : : : : : : : : : : : +- * SortMergeJoin Inner (12) + : : : : : : : : : : : : : : : : : :- * Sort (5) + : : : : : : : : : : : : : : : : : : +- Exchange (4) + : : : : : : : : : : : : : : : : : : +- * Filter (3) + : : : : : : : : : : : : : : : : : : +- * ColumnarToRow (2) + : : : : : : : : : : : : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : : : : : : : : : : : : +- * Sort (11) + : : : : : : : : : : : : : : : : : +- Exchange (10) + : : : : : : : : : : : : : : : : : +- * Project (9) + : : : : : : : : : : : : : : : : : +- * Filter (8) + : : : : : : : : : : : : : : : : : +- * ColumnarToRow (7) + : : : : : : : : : : : : : : : : : +- Scan parquet default.store_returns (6) + : : : : : : : : : : : : : : : : +- BroadcastExchange (33) + : : : : : : : : : : : : : : : : +- * Project (32) + : : : : : : : : : : : : : : : : +- * Filter (31) + : : : : : : : : : : : : : : : : +- * HashAggregate (30) + : : : : : : : : : : : : : : : : +- Exchange (29) + : : : : : : : : : : : : : : : : +- * HashAggregate (28) + : : : : : : : : : : : : : : : : +- * Project (27) + : : : : : : : : : : : : : : : : +- * SortMergeJoin Inner (26) + : : : : : : : : : : : : : : : : :- * Sort (19) + : : : : : : : : : : : : : : : : : +- Exchange (18) + : : : : : : : : : : : : : : : : : +- * Project (17) + : : : : : : : : : : : : : : : : : +- * Filter (16) + : : : : : : : : : : : : : : : : : +- * ColumnarToRow (15) + : : : : : : : : : : : : : : : : : +- Scan parquet default.catalog_sales (14) + : : : : : : : : : : : : : : : : +- * Sort (25) + : : : : : : : : : : : : : : : : +- Exchange (24) + : : : : : : : : : : : : : : : : +- * Project (23) + : : : : : : : : : : : : : : : : +- * Filter (22) + : : : : : : : : : : : : : : : : +- * ColumnarToRow (21) + : : : : : : : : : : : : : : : : +- Scan parquet default.catalog_returns (20) + : : : : : : : : : : : : : : : +- BroadcastExchange (39) + : : : : : : : : : : : : : : : +- * Filter (38) + : : : : : : : : : : : : : : : +- * ColumnarToRow (37) + : : : : : : : : : : : : : : : +- Scan parquet default.date_dim (36) + : : : : : : : : : : : : : : +- BroadcastExchange (45) + : : : : : : : : : : : : : : +- * Filter (44) + : : : : : : : : : : : : : : +- * ColumnarToRow (43) + : : : : : : : : : : : : : : +- Scan parquet default.store (42) + : : : : : : : : : : : : : +- * Sort (54) + : : : : : : : : : : : : : +- Exchange (53) + : : : : : : : : : : : : : +- * Filter (52) + : : : : : : : : : : : : : +- * ColumnarToRow (51) + : : : : : : : : : : : : : +- Scan parquet default.customer (50) + : : : : : : : : : : : : +- BroadcastExchange (60) + : : : : : : : : : : : : +- * Filter (59) + : : : : : : : : : : : : +- * ColumnarToRow (58) + : : : : : : : : : : : : +- Scan parquet default.date_dim (57) + : : : : : : : : : : : +- ReusedExchange (63) + : : : : : : : : : : +- * Sort (72) + : : : : : : : : : : +- Exchange (71) + : : : : : : : : : : +- * Filter (70) + : : : : : : : : : : +- * ColumnarToRow (69) + : : : : : : : : : : +- Scan parquet default.customer_demographics (68) + : : : : : : : : : +- * Sort (78) + : : : : : : : : : +- ReusedExchange (77) + : : : : : : : : +- BroadcastExchange (84) + : : : : : : : : +- * Filter (83) + : : : : : : : : +- * ColumnarToRow (82) + : : : : : : : : +- Scan parquet default.promotion (81) + : : : : : : : +- BroadcastExchange (90) + : : : : : : : +- * Filter (89) + : : : : : : : +- * ColumnarToRow (88) + : : : : : : : +- Scan parquet default.household_demographics (87) + : : : : : : +- ReusedExchange (93) + : : : : : +- * Sort (102) + : : : : : +- Exchange (101) + : : : : : +- * Filter (100) + : : : : : +- * ColumnarToRow (99) + : : : : : +- Scan parquet default.customer_address (98) + : : : : +- * Sort (108) + : : : : +- ReusedExchange (107) + : : : +- BroadcastExchange (114) + : : : +- * Filter (113) + : : : +- * ColumnarToRow (112) + : : : +- Scan parquet default.income_band (111) + : : +- ReusedExchange (117) + : +- BroadcastExchange (124) + : +- * Project (123) + : +- * Filter (122) + : +- * ColumnarToRow (121) + : +- Scan parquet default.item (120) + +- * Sort (211) + +- Exchange (210) + +- * HashAggregate (209) + +- Exchange (208) + +- * HashAggregate (207) + +- * Project (206) + +- * BroadcastHashJoin Inner BuildRight (205) + :- * Project (203) + : +- * BroadcastHashJoin Inner BuildRight (202) + : :- * Project (200) + : : +- * BroadcastHashJoin Inner BuildRight (199) + : : :- * Project (197) + : : : +- * SortMergeJoin Inner (196) + : : : :- * Sort (193) + : : : : +- Exchange (192) + : : : : +- * Project (191) + : : : : +- * SortMergeJoin Inner (190) + : : : : :- * Sort (187) + : : : : : +- Exchange (186) + : : : : : +- * Project (185) + : : : : : +- * BroadcastHashJoin Inner BuildRight (184) + : : : : : :- * Project (182) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (181) + : : : : : : :- * Project (179) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (178) + : : : : : : : :- * Project (176) + : : : : : : : : +- * SortMergeJoin Inner (175) + : : : : : : : : :- * Sort (172) + : : : : : : : : : +- Exchange (171) + : : : : : : : : : +- * Project (170) + : : : : : : : : : +- * SortMergeJoin Inner (169) + : : : : : : : : : :- * Sort (166) + : : : : : : : : : : +- Exchange (165) + : : : : : : : : : : +- * Project (164) + : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (163) + : : : : : : : : : : :- * Project (161) + : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (160) + : : : : : : : : : : : :- * Project (158) + : : : : : : : : : : : : +- * SortMergeJoin Inner (157) + : : : : : : : : : : : : :- * Sort (154) + : : : : : : : : : : : : : +- Exchange (153) + : : : : : : : : : : : : : +- * Project (152) + : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (151) + : : : : : : : : : : : : : :- * Project (149) + : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (148) + : : : : : : : : : : : : : : :- * Project (143) + : : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (142) + : : : : : : : : : : : : : : : :- * Project (140) + : : : : : : : : : : : : : : : : +- * SortMergeJoin Inner (139) + : : : : : : : : : : : : : : : : :- * Sort (136) + : : : : : : : : : : : : : : : : : +- Exchange (135) + : : : : : : : : : : : : : : : : : +- * Filter (134) + : : : : : : : : : : : : : : : : : +- * ColumnarToRow (133) + : : : : : : : : : : : : : : : : : +- Scan parquet default.store_sales (132) + : : : : : : : : : : : : : : : : +- * Sort (138) + : : : : : : : : : : : : : : : : +- ReusedExchange (137) + : : : : : : : : : : : : : : : +- ReusedExchange (141) + : : : : : : : : : : : : : : +- BroadcastExchange (147) + : : : : : : : : : : : : : : +- * Filter (146) + : : : : : : : : : : : : : : +- * ColumnarToRow (145) + : : : : : : : : : : : : : : +- Scan parquet default.date_dim (144) + : : : : : : : : : : : : : +- ReusedExchange (150) + : : : : : : : : : : : : +- * Sort (156) + : : : : : : : : : : : : +- ReusedExchange (155) + : : : : : : : : : : : +- ReusedExchange (159) + : : : : : : : : : : +- ReusedExchange (162) + : : : : : : : : : +- * Sort (168) + : : : : : : : : : +- ReusedExchange (167) + : : : : : : : : +- * Sort (174) + : : : : : : : : +- ReusedExchange (173) + : : : : : : : +- ReusedExchange (177) + : : : : : : +- ReusedExchange (180) + : : : : : +- ReusedExchange (183) + : : : : +- * Sort (189) + : : : : +- ReusedExchange (188) + : : : +- * Sort (195) + : : : +- ReusedExchange (194) + : : +- ReusedExchange (198) + : +- ReusedExchange (201) + +- ReusedExchange (204) + + +(1) Scan parquet default.store_sales +Output [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#12), dynamicpruningexpression(ss_sold_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_promo_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] + +(3) Filter [codegen id : 1] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Condition : (((((((isnotnull(ss_item_sk#1) AND isnotnull(ss_ticket_number#8)) AND isnotnull(ss_store_sk#6)) AND isnotnull(ss_customer_sk#2)) AND isnotnull(ss_cdemo_sk#3)) AND isnotnull(ss_promo_sk#7)) AND isnotnull(ss_hdemo_sk#4)) AND isnotnull(ss_addr_sk#5)) + +(4) Exchange +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#8, 5), ENSURE_REQUIREMENTS, [id=#14] + +(5) Sort [codegen id : 2] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#8 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_returns +Output [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] + +(8) Filter [codegen id : 3] +Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] +Condition : (isnotnull(sr_item_sk#15) AND isnotnull(sr_ticket_number#16)) + +(9) Project [codegen id : 3] +Output [2]: [sr_item_sk#15, sr_ticket_number#16] +Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] + +(10) Exchange +Input [2]: [sr_item_sk#15, sr_ticket_number#16] +Arguments: hashpartitioning(sr_item_sk#15, sr_ticket_number#16, 5), ENSURE_REQUIREMENTS, [id=#18] + +(11) Sort [codegen id : 4] +Input [2]: [sr_item_sk#15, sr_ticket_number#16] +Arguments: [sr_item_sk#15 ASC NULLS FIRST, sr_ticket_number#16 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 13] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#8] +Right keys [2]: [sr_item_sk#15, sr_ticket_number#16] +Join condition: None + +(13) Project [codegen id : 13] +Output [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12, sr_item_sk#15, sr_ticket_number#16] + +(14) Scan parquet default.catalog_sales +Output [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_order_number)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 5] +Input [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] + +(16) Filter [codegen id : 5] +Input [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] +Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_order_number#20)) + +(17) Project [codegen id : 5] +Output [3]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21] +Input [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] + +(18) Exchange +Input [3]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21] +Arguments: hashpartitioning(cs_item_sk#19, cs_order_number#20, 5), ENSURE_REQUIREMENTS, [id=#23] + +(19) Sort [codegen id : 6] +Input [3]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21] +Arguments: [cs_item_sk#19 ASC NULLS FIRST, cs_order_number#20 ASC NULLS FIRST], false, 0 + +(20) Scan parquet default.catalog_returns +Output [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_order_number)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 7] +Input [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] + +(22) Filter [codegen id : 7] +Input [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] +Condition : (isnotnull(cr_item_sk#24) AND isnotnull(cr_order_number#25)) + +(23) Project [codegen id : 7] +Output [5]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Input [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] + +(24) Exchange +Input [5]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Arguments: hashpartitioning(cr_item_sk#24, cr_order_number#25, 5), ENSURE_REQUIREMENTS, [id=#30] + +(25) Sort [codegen id : 8] +Input [5]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Arguments: [cr_item_sk#24 ASC NULLS FIRST, cr_order_number#25 ASC NULLS FIRST], false, 0 + +(26) SortMergeJoin [codegen id : 9] +Left keys [2]: [cs_item_sk#19, cs_order_number#20] +Right keys [2]: [cr_item_sk#24, cr_order_number#25] +Join condition: None + +(27) Project [codegen id : 9] +Output [5]: [cs_item_sk#19, cs_ext_list_price#21, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Input [8]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] + +(28) HashAggregate [codegen id : 9] +Input [5]: [cs_item_sk#19, cs_ext_list_price#21, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Keys [1]: [cs_item_sk#19] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_list_price#21)), partial_sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))] +Aggregate Attributes [3]: [sum#31, sum#32, isEmpty#33] +Results [4]: [cs_item_sk#19, sum#34, sum#35, isEmpty#36] + +(29) Exchange +Input [4]: [cs_item_sk#19, sum#34, sum#35, isEmpty#36] +Arguments: hashpartitioning(cs_item_sk#19, 5), ENSURE_REQUIREMENTS, [id=#37] + +(30) HashAggregate [codegen id : 10] +Input [4]: [cs_item_sk#19, sum#34, sum#35, isEmpty#36] +Keys [1]: [cs_item_sk#19] +Functions [2]: [sum(UnscaledValue(cs_ext_list_price#21)), sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_list_price#21))#38, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#39] +Results [3]: [cs_item_sk#19, MakeDecimal(sum(UnscaledValue(cs_ext_list_price#21))#38,17,2) AS sum(cs_ext_list_price#21)#40, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#39 AS sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41] + +(31) Filter [codegen id : 10] +Input [3]: [cs_item_sk#19, sum(cs_ext_list_price#21)#40, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41] +Condition : (isnotnull(sum(cs_ext_list_price#21)#40) AND (cast(sum(cs_ext_list_price#21)#40 as decimal(21,2)) > CheckOverflow((2.00 * promote_precision(sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41)), DecimalType(21,2), true))) + +(32) Project [codegen id : 10] +Output [1]: [cs_item_sk#19] +Input [3]: [cs_item_sk#19, sum(cs_ext_list_price#21)#40, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41] + +(33) BroadcastExchange +Input [1]: [cs_item_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#42] + +(34) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [cs_item_sk#19] +Join condition: None + +(35) Project [codegen id : 13] +Output [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12, cs_item_sk#19] + +(36) Scan parquet default.date_dim +Output [2]: [d_date_sk#43, d_year#44] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 11] +Input [2]: [d_date_sk#43, d_year#44] + +(38) Filter [codegen id : 11] +Input [2]: [d_date_sk#43, d_year#44] +Condition : ((isnotnull(d_year#44) AND (d_year#44 = 1999)) AND isnotnull(d_date_sk#43)) + +(39) BroadcastExchange +Input [2]: [d_date_sk#43, d_year#44] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#45] + +(40) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_sold_date_sk#12] +Right keys [1]: [d_date_sk#43] +Join condition: None + +(41) Project [codegen id : 13] +Output [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44] +Input [13]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12, d_date_sk#43, d_year#44] + +(42) Scan parquet default.store +Output [3]: [s_store_sk#46, s_store_name#47, s_zip#48] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_name), IsNotNull(s_zip)] +ReadSchema: struct + +(43) ColumnarToRow [codegen id : 12] +Input [3]: [s_store_sk#46, s_store_name#47, s_zip#48] + +(44) Filter [codegen id : 12] +Input [3]: [s_store_sk#46, s_store_name#47, s_zip#48] +Condition : ((isnotnull(s_store_sk#46) AND isnotnull(s_store_name#47)) AND isnotnull(s_zip#48)) + +(45) BroadcastExchange +Input [3]: [s_store_sk#46, s_store_name#47, s_zip#48] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#49] + +(46) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ss_store_sk#6] +Right keys [1]: [s_store_sk#46] +Join condition: None + +(47) Project [codegen id : 13] +Output [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48] +Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_sk#46, s_store_name#47, s_zip#48] + +(48) Exchange +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48] +Arguments: hashpartitioning(ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#50] + +(49) Sort [codegen id : 14] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48] +Arguments: [ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(50) Scan parquet default.customer +Output [6]: [c_customer_sk#51, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_first_sales_date_sk), IsNotNull(c_first_shipto_date_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(51) ColumnarToRow [codegen id : 15] +Input [6]: [c_customer_sk#51, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] + +(52) Filter [codegen id : 15] +Input [6]: [c_customer_sk#51, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] +Condition : (((((isnotnull(c_customer_sk#51) AND isnotnull(c_first_sales_date_sk#56)) AND isnotnull(c_first_shipto_date_sk#55)) AND isnotnull(c_current_cdemo_sk#52)) AND isnotnull(c_current_hdemo_sk#53)) AND isnotnull(c_current_addr_sk#54)) + +(53) Exchange +Input [6]: [c_customer_sk#51, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] +Arguments: hashpartitioning(c_customer_sk#51, 5), ENSURE_REQUIREMENTS, [id=#57] + +(54) Sort [codegen id : 16] +Input [6]: [c_customer_sk#51, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] +Arguments: [c_customer_sk#51 ASC NULLS FIRST], false, 0 + +(55) SortMergeJoin [codegen id : 19] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#51] +Join condition: None + +(56) Project [codegen id : 19] +Output [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] +Input [18]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_customer_sk#51, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56] + +(57) Scan parquet default.date_dim +Output [2]: [d_date_sk#58, d_year#59] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(58) ColumnarToRow [codegen id : 17] +Input [2]: [d_date_sk#58, d_year#59] + +(59) Filter [codegen id : 17] +Input [2]: [d_date_sk#58, d_year#59] +Condition : isnotnull(d_date_sk#58) + +(60) BroadcastExchange +Input [2]: [d_date_sk#58, d_year#59] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#60] + +(61) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [c_first_sales_date_sk#56] +Right keys [1]: [d_date_sk#58] +Join condition: None + +(62) Project [codegen id : 19] +Output [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, d_year#59] +Input [18]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, c_first_sales_date_sk#56, d_date_sk#58, d_year#59] + +(63) ReusedExchange [Reuses operator id: 60] +Output [2]: [d_date_sk#61, d_year#62] + +(64) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [c_first_shipto_date_sk#55] +Right keys [1]: [d_date_sk#61] +Join condition: None + +(65) Project [codegen id : 19] +Output [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62] +Input [18]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, c_first_shipto_date_sk#55, d_year#59, d_date_sk#61, d_year#62] + +(66) Exchange +Input [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62] +Arguments: hashpartitioning(ss_cdemo_sk#3, 5), ENSURE_REQUIREMENTS, [id=#63] + +(67) Sort [codegen id : 20] +Input [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62] +Arguments: [ss_cdemo_sk#3 ASC NULLS FIRST], false, 0 + +(68) Scan parquet default.customer_demographics +Output [2]: [cd_demo_sk#64, cd_marital_status#65] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), IsNotNull(cd_marital_status)] +ReadSchema: struct + +(69) ColumnarToRow [codegen id : 21] +Input [2]: [cd_demo_sk#64, cd_marital_status#65] + +(70) Filter [codegen id : 21] +Input [2]: [cd_demo_sk#64, cd_marital_status#65] +Condition : (isnotnull(cd_demo_sk#64) AND isnotnull(cd_marital_status#65)) + +(71) Exchange +Input [2]: [cd_demo_sk#64, cd_marital_status#65] +Arguments: hashpartitioning(cd_demo_sk#64, 5), ENSURE_REQUIREMENTS, [id=#66] + +(72) Sort [codegen id : 22] +Input [2]: [cd_demo_sk#64, cd_marital_status#65] +Arguments: [cd_demo_sk#64 ASC NULLS FIRST], false, 0 + +(73) SortMergeJoin [codegen id : 23] +Left keys [1]: [ss_cdemo_sk#3] +Right keys [1]: [cd_demo_sk#64] +Join condition: None + +(74) Project [codegen id : 23] +Output [16]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, cd_marital_status#65] +Input [18]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, cd_demo_sk#64, cd_marital_status#65] + +(75) Exchange +Input [16]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, cd_marital_status#65] +Arguments: hashpartitioning(c_current_cdemo_sk#52, 5), ENSURE_REQUIREMENTS, [id=#67] + +(76) Sort [codegen id : 24] +Input [16]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, cd_marital_status#65] +Arguments: [c_current_cdemo_sk#52 ASC NULLS FIRST], false, 0 + +(77) ReusedExchange [Reuses operator id: 71] +Output [2]: [cd_demo_sk#68, cd_marital_status#69] + +(78) Sort [codegen id : 26] +Input [2]: [cd_demo_sk#68, cd_marital_status#69] +Arguments: [cd_demo_sk#68 ASC NULLS FIRST], false, 0 + +(79) SortMergeJoin [codegen id : 30] +Left keys [1]: [c_current_cdemo_sk#52] +Right keys [1]: [cd_demo_sk#68] +Join condition: NOT (cd_marital_status#65 = cd_marital_status#69) + +(80) Project [codegen id : 30] +Output [14]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62] +Input [18]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_cdemo_sk#52, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, cd_marital_status#65, cd_demo_sk#68, cd_marital_status#69] + +(81) Scan parquet default.promotion +Output [1]: [p_promo_sk#70] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_promo_sk)] +ReadSchema: struct + +(82) ColumnarToRow [codegen id : 27] +Input [1]: [p_promo_sk#70] + +(83) Filter [codegen id : 27] +Input [1]: [p_promo_sk#70] +Condition : isnotnull(p_promo_sk#70) + +(84) BroadcastExchange +Input [1]: [p_promo_sk#70] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#71] + +(85) BroadcastHashJoin [codegen id : 30] +Left keys [1]: [ss_promo_sk#7] +Right keys [1]: [p_promo_sk#70] +Join condition: None + +(86) Project [codegen id : 30] +Output [13]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62] +Input [15]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, p_promo_sk#70] + +(87) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#72, hd_income_band_sk#73] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_demo_sk), IsNotNull(hd_income_band_sk)] +ReadSchema: struct + +(88) ColumnarToRow [codegen id : 28] +Input [2]: [hd_demo_sk#72, hd_income_band_sk#73] + +(89) Filter [codegen id : 28] +Input [2]: [hd_demo_sk#72, hd_income_band_sk#73] +Condition : (isnotnull(hd_demo_sk#72) AND isnotnull(hd_income_band_sk#73)) + +(90) BroadcastExchange +Input [2]: [hd_demo_sk#72, hd_income_band_sk#73] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#74] + +(91) BroadcastHashJoin [codegen id : 30] +Left keys [1]: [ss_hdemo_sk#4] +Right keys [1]: [hd_demo_sk#72] +Join condition: None + +(92) Project [codegen id : 30] +Output [13]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73] +Input [15]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, hd_demo_sk#72, hd_income_band_sk#73] + +(93) ReusedExchange [Reuses operator id: 90] +Output [2]: [hd_demo_sk#75, hd_income_band_sk#76] + +(94) BroadcastHashJoin [codegen id : 30] +Left keys [1]: [c_current_hdemo_sk#53] +Right keys [1]: [hd_demo_sk#75] +Join condition: None + +(95) Project [codegen id : 30] +Output [13]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76] +Input [15]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_hdemo_sk#53, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_demo_sk#75, hd_income_band_sk#76] + +(96) Exchange +Input [13]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76] +Arguments: hashpartitioning(ss_addr_sk#5, 5), ENSURE_REQUIREMENTS, [id=#77] + +(97) Sort [codegen id : 31] +Input [13]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76] +Arguments: [ss_addr_sk#5 ASC NULLS FIRST], false, 0 + +(98) Scan parquet default.customer_address +Output [5]: [ca_address_sk#78, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(99) ColumnarToRow [codegen id : 32] +Input [5]: [ca_address_sk#78, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] + +(100) Filter [codegen id : 32] +Input [5]: [ca_address_sk#78, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Condition : isnotnull(ca_address_sk#78) + +(101) Exchange +Input [5]: [ca_address_sk#78, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Arguments: hashpartitioning(ca_address_sk#78, 5), ENSURE_REQUIREMENTS, [id=#83] + +(102) Sort [codegen id : 33] +Input [5]: [ca_address_sk#78, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Arguments: [ca_address_sk#78 ASC NULLS FIRST], false, 0 + +(103) SortMergeJoin [codegen id : 34] +Left keys [1]: [ss_addr_sk#5] +Right keys [1]: [ca_address_sk#78] +Join condition: None + +(104) Project [codegen id : 34] +Output [16]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Input [18]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_address_sk#78, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] + +(105) Exchange +Input [16]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Arguments: hashpartitioning(c_current_addr_sk#54, 5), ENSURE_REQUIREMENTS, [id=#84] + +(106) Sort [codegen id : 35] +Input [16]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82] +Arguments: [c_current_addr_sk#54 ASC NULLS FIRST], false, 0 + +(107) ReusedExchange [Reuses operator id: 101] +Output [5]: [ca_address_sk#85, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89] + +(108) Sort [codegen id : 37] +Input [5]: [ca_address_sk#85, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89] +Arguments: [ca_address_sk#85 ASC NULLS FIRST], false, 0 + +(109) SortMergeJoin [codegen id : 41] +Left keys [1]: [c_current_addr_sk#54] +Right keys [1]: [ca_address_sk#85] +Join condition: None + +(110) Project [codegen id : 41] +Output [19]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89] +Input [21]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, c_current_addr_sk#54, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_address_sk#85, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89] + +(111) Scan parquet default.income_band +Output [1]: [ib_income_band_sk#90] +Batched: true +Location [not included in comparison]/{warehouse_dir}/income_band] +PushedFilters: [IsNotNull(ib_income_band_sk)] +ReadSchema: struct + +(112) ColumnarToRow [codegen id : 38] +Input [1]: [ib_income_band_sk#90] + +(113) Filter [codegen id : 38] +Input [1]: [ib_income_band_sk#90] +Condition : isnotnull(ib_income_band_sk#90) + +(114) BroadcastExchange +Input [1]: [ib_income_band_sk#90] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#91] + +(115) BroadcastHashJoin [codegen id : 41] +Left keys [1]: [hd_income_band_sk#73] +Right keys [1]: [ib_income_band_sk#90] +Join condition: None + +(116) Project [codegen id : 41] +Output [18]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, d_year#59, d_year#62, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89] +Input [20]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, d_year#59, d_year#62, hd_income_band_sk#73, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, ib_income_band_sk#90] + +(117) ReusedExchange [Reuses operator id: 114] +Output [1]: [ib_income_band_sk#92] + +(118) BroadcastHashJoin [codegen id : 41] +Left keys [1]: [hd_income_band_sk#76] +Right keys [1]: [ib_income_band_sk#92] +Join condition: None + +(119) Project [codegen id : 41] +Output [17]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, d_year#59, d_year#62, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89] +Input [19]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, d_year#59, d_year#62, hd_income_band_sk#76, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, ib_income_band_sk#92] + +(120) Scan parquet default.item +Output [4]: [i_item_sk#93, i_current_price#94, i_color#95, i_product_name#96] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), In(i_color, [purple ,burlywood ,indian ,spring ,floral ,medium ]), GreaterThanOrEqual(i_current_price,64.00), LessThanOrEqual(i_current_price,74.00), GreaterThanOrEqual(i_current_price,65.00), LessThanOrEqual(i_current_price,79.00), IsNotNull(i_item_sk)] +ReadSchema: struct + +(121) ColumnarToRow [codegen id : 40] +Input [4]: [i_item_sk#93, i_current_price#94, i_color#95, i_product_name#96] + +(122) Filter [codegen id : 40] +Input [4]: [i_item_sk#93, i_current_price#94, i_color#95, i_product_name#96] +Condition : ((((((isnotnull(i_current_price#94) AND i_color#95 IN (purple ,burlywood ,indian ,spring ,floral ,medium )) AND (i_current_price#94 >= 64.00)) AND (i_current_price#94 <= 74.00)) AND (i_current_price#94 >= 65.00)) AND (i_current_price#94 <= 79.00)) AND isnotnull(i_item_sk#93)) + +(123) Project [codegen id : 40] +Output [2]: [i_item_sk#93, i_product_name#96] +Input [4]: [i_item_sk#93, i_current_price#94, i_color#95, i_product_name#96] + +(124) BroadcastExchange +Input [2]: [i_item_sk#93, i_product_name#96] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#97] + +(125) BroadcastHashJoin [codegen id : 41] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#93] +Join condition: None + +(126) Project [codegen id : 41] +Output [18]: [ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, d_year#59, d_year#62, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, i_item_sk#93, i_product_name#96] +Input [19]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, s_store_name#47, s_zip#48, d_year#59, d_year#62, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, i_item_sk#93, i_product_name#96] + +(127) HashAggregate [codegen id : 41] +Input [18]: [ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#44, d_year#59, d_year#62, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, i_item_sk#93, i_product_name#96] +Keys [15]: [i_product_name#96, i_item_sk#93, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, d_year#44, d_year#59, d_year#62] +Functions [4]: [partial_count(1), partial_sum(UnscaledValue(ss_wholesale_cost#9)), partial_sum(UnscaledValue(ss_list_price#10)), partial_sum(UnscaledValue(ss_coupon_amt#11))] +Aggregate Attributes [4]: [count#98, sum#99, sum#100, sum#101] +Results [19]: [i_product_name#96, i_item_sk#93, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, d_year#44, d_year#59, d_year#62, count#102, sum#103, sum#104, sum#105] + +(128) Exchange +Input [19]: [i_product_name#96, i_item_sk#93, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, d_year#44, d_year#59, d_year#62, count#102, sum#103, sum#104, sum#105] +Arguments: hashpartitioning(i_product_name#96, i_item_sk#93, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, d_year#44, d_year#59, d_year#62, 5), ENSURE_REQUIREMENTS, [id=#106] + +(129) HashAggregate [codegen id : 42] +Input [19]: [i_product_name#96, i_item_sk#93, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, d_year#44, d_year#59, d_year#62, count#102, sum#103, sum#104, sum#105] +Keys [15]: [i_product_name#96, i_item_sk#93, s_store_name#47, s_zip#48, ca_street_number#79, ca_street_name#80, ca_city#81, ca_zip#82, ca_street_number#86, ca_street_name#87, ca_city#88, ca_zip#89, d_year#44, d_year#59, d_year#62] +Functions [4]: [count(1), sum(UnscaledValue(ss_wholesale_cost#9)), sum(UnscaledValue(ss_list_price#10)), sum(UnscaledValue(ss_coupon_amt#11))] +Aggregate Attributes [4]: [count(1)#107, sum(UnscaledValue(ss_wholesale_cost#9))#108, sum(UnscaledValue(ss_list_price#10))#109, sum(UnscaledValue(ss_coupon_amt#11))#110] +Results [17]: [i_product_name#96 AS product_name#111, i_item_sk#93 AS item_sk#112, s_store_name#47 AS store_name#113, s_zip#48 AS store_zip#114, ca_street_number#79 AS b_street_number#115, ca_street_name#80 AS b_streen_name#116, ca_city#81 AS b_city#117, ca_zip#82 AS b_zip#118, ca_street_number#86 AS c_street_number#119, ca_street_name#87 AS c_street_name#120, ca_city#88 AS c_city#121, ca_zip#89 AS c_zip#122, d_year#44 AS syear#123, count(1)#107 AS cnt#124, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#9))#108,17,2) AS s1#125, MakeDecimal(sum(UnscaledValue(ss_list_price#10))#109,17,2) AS s2#126, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#11))#110,17,2) AS s3#127] + +(130) Exchange +Input [17]: [product_name#111, item_sk#112, store_name#113, store_zip#114, b_street_number#115, b_streen_name#116, b_city#117, b_zip#118, c_street_number#119, c_street_name#120, c_city#121, c_zip#122, syear#123, cnt#124, s1#125, s2#126, s3#127] +Arguments: hashpartitioning(item_sk#112, store_name#113, store_zip#114, 5), ENSURE_REQUIREMENTS, [id=#128] + +(131) Sort [codegen id : 43] +Input [17]: [product_name#111, item_sk#112, store_name#113, store_zip#114, b_street_number#115, b_streen_name#116, b_city#117, b_zip#118, c_street_number#119, c_street_name#120, c_city#121, c_zip#122, syear#123, cnt#124, s1#125, s2#126, s3#127] +Arguments: [item_sk#112 ASC NULLS FIRST, store_name#113 ASC NULLS FIRST, store_zip#114 ASC NULLS FIRST], false, 0 + +(132) Scan parquet default.store_sales +Output [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#140), dynamicpruningexpression(ss_sold_date_sk#140 IN dynamicpruning#141)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_promo_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(133) ColumnarToRow [codegen id : 44] +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] + +(134) Filter [codegen id : 44] +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] +Condition : (((((((isnotnull(ss_item_sk#129) AND isnotnull(ss_ticket_number#136)) AND isnotnull(ss_store_sk#134)) AND isnotnull(ss_customer_sk#130)) AND isnotnull(ss_cdemo_sk#131)) AND isnotnull(ss_promo_sk#135)) AND isnotnull(ss_hdemo_sk#132)) AND isnotnull(ss_addr_sk#133)) + +(135) Exchange +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] +Arguments: hashpartitioning(ss_item_sk#129, ss_ticket_number#136, 5), ENSURE_REQUIREMENTS, [id=#142] + +(136) Sort [codegen id : 45] +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] +Arguments: [ss_item_sk#129 ASC NULLS FIRST, ss_ticket_number#136 ASC NULLS FIRST], false, 0 + +(137) ReusedExchange [Reuses operator id: 10] +Output [2]: [sr_item_sk#143, sr_ticket_number#144] + +(138) Sort [codegen id : 47] +Input [2]: [sr_item_sk#143, sr_ticket_number#144] +Arguments: [sr_item_sk#143 ASC NULLS FIRST, sr_ticket_number#144 ASC NULLS FIRST], false, 0 + +(139) SortMergeJoin [codegen id : 56] +Left keys [2]: [ss_item_sk#129, ss_ticket_number#136] +Right keys [2]: [sr_item_sk#143, sr_ticket_number#144] +Join condition: None + +(140) Project [codegen id : 56] +Output [11]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] +Input [14]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_ticket_number#136, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140, sr_item_sk#143, sr_ticket_number#144] + +(141) ReusedExchange [Reuses operator id: 33] +Output [1]: [cs_item_sk#145] + +(142) BroadcastHashJoin [codegen id : 56] +Left keys [1]: [ss_item_sk#129] +Right keys [1]: [cs_item_sk#145] +Join condition: None + +(143) Project [codegen id : 56] +Output [11]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140] +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140, cs_item_sk#145] + +(144) Scan parquet default.date_dim +Output [2]: [d_date_sk#146, d_year#147] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(145) ColumnarToRow [codegen id : 54] +Input [2]: [d_date_sk#146, d_year#147] + +(146) Filter [codegen id : 54] +Input [2]: [d_date_sk#146, d_year#147] +Condition : ((isnotnull(d_year#147) AND (d_year#147 = 2000)) AND isnotnull(d_date_sk#146)) + +(147) BroadcastExchange +Input [2]: [d_date_sk#146, d_year#147] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#148] + +(148) BroadcastHashJoin [codegen id : 56] +Left keys [1]: [ss_sold_date_sk#140] +Right keys [1]: [d_date_sk#146] +Join condition: None + +(149) Project [codegen id : 56] +Output [11]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147] +Input [13]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, ss_sold_date_sk#140, d_date_sk#146, d_year#147] + +(150) ReusedExchange [Reuses operator id: 45] +Output [3]: [s_store_sk#149, s_store_name#150, s_zip#151] + +(151) BroadcastHashJoin [codegen id : 56] +Left keys [1]: [ss_store_sk#134] +Right keys [1]: [s_store_sk#149] +Join condition: None + +(152) Project [codegen id : 56] +Output [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151] +Input [14]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_store_sk#134, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_sk#149, s_store_name#150, s_zip#151] + +(153) Exchange +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151] +Arguments: hashpartitioning(ss_customer_sk#130, 5), ENSURE_REQUIREMENTS, [id=#152] + +(154) Sort [codegen id : 57] +Input [12]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151] +Arguments: [ss_customer_sk#130 ASC NULLS FIRST], false, 0 + +(155) ReusedExchange [Reuses operator id: 53] +Output [6]: [c_customer_sk#153, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, c_first_sales_date_sk#158] + +(156) Sort [codegen id : 59] +Input [6]: [c_customer_sk#153, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, c_first_sales_date_sk#158] +Arguments: [c_customer_sk#153 ASC NULLS FIRST], false, 0 + +(157) SortMergeJoin [codegen id : 62] +Left keys [1]: [ss_customer_sk#130] +Right keys [1]: [c_customer_sk#153] +Join condition: None + +(158) Project [codegen id : 62] +Output [16]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, c_first_sales_date_sk#158] +Input [18]: [ss_item_sk#129, ss_customer_sk#130, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_customer_sk#153, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, c_first_sales_date_sk#158] + +(159) ReusedExchange [Reuses operator id: 60] +Output [2]: [d_date_sk#159, d_year#160] + +(160) BroadcastHashJoin [codegen id : 62] +Left keys [1]: [c_first_sales_date_sk#158] +Right keys [1]: [d_date_sk#159] +Join condition: None + +(161) Project [codegen id : 62] +Output [16]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, d_year#160] +Input [18]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, c_first_sales_date_sk#158, d_date_sk#159, d_year#160] + +(162) ReusedExchange [Reuses operator id: 60] +Output [2]: [d_date_sk#161, d_year#162] + +(163) BroadcastHashJoin [codegen id : 62] +Left keys [1]: [c_first_shipto_date_sk#157] +Right keys [1]: [d_date_sk#161] +Join condition: None + +(164) Project [codegen id : 62] +Output [16]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162] +Input [18]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, c_first_shipto_date_sk#157, d_year#160, d_date_sk#161, d_year#162] + +(165) Exchange +Input [16]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162] +Arguments: hashpartitioning(ss_cdemo_sk#131, 5), ENSURE_REQUIREMENTS, [id=#163] + +(166) Sort [codegen id : 63] +Input [16]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162] +Arguments: [ss_cdemo_sk#131 ASC NULLS FIRST], false, 0 + +(167) ReusedExchange [Reuses operator id: 71] +Output [2]: [cd_demo_sk#164, cd_marital_status#165] + +(168) Sort [codegen id : 65] +Input [2]: [cd_demo_sk#164, cd_marital_status#165] +Arguments: [cd_demo_sk#164 ASC NULLS FIRST], false, 0 + +(169) SortMergeJoin [codegen id : 66] +Left keys [1]: [ss_cdemo_sk#131] +Right keys [1]: [cd_demo_sk#164] +Join condition: None + +(170) Project [codegen id : 66] +Output [16]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, cd_marital_status#165] +Input [18]: [ss_item_sk#129, ss_cdemo_sk#131, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, cd_demo_sk#164, cd_marital_status#165] + +(171) Exchange +Input [16]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, cd_marital_status#165] +Arguments: hashpartitioning(c_current_cdemo_sk#154, 5), ENSURE_REQUIREMENTS, [id=#166] + +(172) Sort [codegen id : 67] +Input [16]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, cd_marital_status#165] +Arguments: [c_current_cdemo_sk#154 ASC NULLS FIRST], false, 0 + +(173) ReusedExchange [Reuses operator id: 71] +Output [2]: [cd_demo_sk#167, cd_marital_status#168] + +(174) Sort [codegen id : 69] +Input [2]: [cd_demo_sk#167, cd_marital_status#168] +Arguments: [cd_demo_sk#167 ASC NULLS FIRST], false, 0 + +(175) SortMergeJoin [codegen id : 73] +Left keys [1]: [c_current_cdemo_sk#154] +Right keys [1]: [cd_demo_sk#167] +Join condition: NOT (cd_marital_status#165 = cd_marital_status#168) + +(176) Project [codegen id : 73] +Output [14]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162] +Input [18]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_cdemo_sk#154, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, cd_marital_status#165, cd_demo_sk#167, cd_marital_status#168] + +(177) ReusedExchange [Reuses operator id: 84] +Output [1]: [p_promo_sk#169] + +(178) BroadcastHashJoin [codegen id : 73] +Left keys [1]: [ss_promo_sk#135] +Right keys [1]: [p_promo_sk#169] +Join condition: None + +(179) Project [codegen id : 73] +Output [13]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162] +Input [15]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_promo_sk#135, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, p_promo_sk#169] + +(180) ReusedExchange [Reuses operator id: 90] +Output [2]: [hd_demo_sk#170, hd_income_band_sk#171] + +(181) BroadcastHashJoin [codegen id : 73] +Left keys [1]: [ss_hdemo_sk#132] +Right keys [1]: [hd_demo_sk#170] +Join condition: None + +(182) Project [codegen id : 73] +Output [13]: [ss_item_sk#129, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171] +Input [15]: [ss_item_sk#129, ss_hdemo_sk#132, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, hd_demo_sk#170, hd_income_band_sk#171] + +(183) ReusedExchange [Reuses operator id: 90] +Output [2]: [hd_demo_sk#172, hd_income_band_sk#173] + +(184) BroadcastHashJoin [codegen id : 73] +Left keys [1]: [c_current_hdemo_sk#155] +Right keys [1]: [hd_demo_sk#172] +Join condition: None + +(185) Project [codegen id : 73] +Output [13]: [ss_item_sk#129, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173] +Input [15]: [ss_item_sk#129, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_hdemo_sk#155, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_demo_sk#172, hd_income_band_sk#173] + +(186) Exchange +Input [13]: [ss_item_sk#129, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173] +Arguments: hashpartitioning(ss_addr_sk#133, 5), ENSURE_REQUIREMENTS, [id=#174] + +(187) Sort [codegen id : 74] +Input [13]: [ss_item_sk#129, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173] +Arguments: [ss_addr_sk#133 ASC NULLS FIRST], false, 0 + +(188) ReusedExchange [Reuses operator id: 101] +Output [5]: [ca_address_sk#175, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179] + +(189) Sort [codegen id : 76] +Input [5]: [ca_address_sk#175, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179] +Arguments: [ca_address_sk#175 ASC NULLS FIRST], false, 0 + +(190) SortMergeJoin [codegen id : 77] +Left keys [1]: [ss_addr_sk#133] +Right keys [1]: [ca_address_sk#175] +Join condition: None + +(191) Project [codegen id : 77] +Output [16]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179] +Input [18]: [ss_item_sk#129, ss_addr_sk#133, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_address_sk#175, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179] + +(192) Exchange +Input [16]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179] +Arguments: hashpartitioning(c_current_addr_sk#156, 5), ENSURE_REQUIREMENTS, [id=#180] + +(193) Sort [codegen id : 78] +Input [16]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179] +Arguments: [c_current_addr_sk#156 ASC NULLS FIRST], false, 0 + +(194) ReusedExchange [Reuses operator id: 101] +Output [5]: [ca_address_sk#181, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185] + +(195) Sort [codegen id : 80] +Input [5]: [ca_address_sk#181, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185] +Arguments: [ca_address_sk#181 ASC NULLS FIRST], false, 0 + +(196) SortMergeJoin [codegen id : 84] +Left keys [1]: [c_current_addr_sk#156] +Right keys [1]: [ca_address_sk#181] +Join condition: None + +(197) Project [codegen id : 84] +Output [19]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185] +Input [21]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, c_current_addr_sk#156, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_address_sk#181, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185] + +(198) ReusedExchange [Reuses operator id: 114] +Output [1]: [ib_income_band_sk#186] + +(199) BroadcastHashJoin [codegen id : 84] +Left keys [1]: [hd_income_band_sk#171] +Right keys [1]: [ib_income_band_sk#186] +Join condition: None + +(200) Project [codegen id : 84] +Output [18]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, d_year#160, d_year#162, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185] +Input [20]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, d_year#160, d_year#162, hd_income_band_sk#171, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, ib_income_band_sk#186] + +(201) ReusedExchange [Reuses operator id: 114] +Output [1]: [ib_income_band_sk#187] + +(202) BroadcastHashJoin [codegen id : 84] +Left keys [1]: [hd_income_band_sk#173] +Right keys [1]: [ib_income_band_sk#187] +Join condition: None + +(203) Project [codegen id : 84] +Output [17]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, d_year#160, d_year#162, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185] +Input [19]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, d_year#160, d_year#162, hd_income_band_sk#173, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, ib_income_band_sk#187] + +(204) ReusedExchange [Reuses operator id: 124] +Output [2]: [i_item_sk#188, i_product_name#189] + +(205) BroadcastHashJoin [codegen id : 84] +Left keys [1]: [ss_item_sk#129] +Right keys [1]: [i_item_sk#188] +Join condition: None + +(206) Project [codegen id : 84] +Output [18]: [ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, d_year#160, d_year#162, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, i_item_sk#188, i_product_name#189] +Input [19]: [ss_item_sk#129, ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, s_store_name#150, s_zip#151, d_year#160, d_year#162, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, i_item_sk#188, i_product_name#189] + +(207) HashAggregate [codegen id : 84] +Input [18]: [ss_wholesale_cost#137, ss_list_price#138, ss_coupon_amt#139, d_year#147, d_year#160, d_year#162, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, i_item_sk#188, i_product_name#189] +Keys [15]: [i_product_name#189, i_item_sk#188, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, d_year#147, d_year#160, d_year#162] +Functions [4]: [partial_count(1), partial_sum(UnscaledValue(ss_wholesale_cost#137)), partial_sum(UnscaledValue(ss_list_price#138)), partial_sum(UnscaledValue(ss_coupon_amt#139))] +Aggregate Attributes [4]: [count#190, sum#191, sum#192, sum#193] +Results [19]: [i_product_name#189, i_item_sk#188, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, d_year#147, d_year#160, d_year#162, count#194, sum#195, sum#196, sum#197] + +(208) Exchange +Input [19]: [i_product_name#189, i_item_sk#188, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, d_year#147, d_year#160, d_year#162, count#194, sum#195, sum#196, sum#197] +Arguments: hashpartitioning(i_product_name#189, i_item_sk#188, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, d_year#147, d_year#160, d_year#162, 5), ENSURE_REQUIREMENTS, [id=#198] + +(209) HashAggregate [codegen id : 85] +Input [19]: [i_product_name#189, i_item_sk#188, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, d_year#147, d_year#160, d_year#162, count#194, sum#195, sum#196, sum#197] +Keys [15]: [i_product_name#189, i_item_sk#188, s_store_name#150, s_zip#151, ca_street_number#176, ca_street_name#177, ca_city#178, ca_zip#179, ca_street_number#182, ca_street_name#183, ca_city#184, ca_zip#185, d_year#147, d_year#160, d_year#162] +Functions [4]: [count(1), sum(UnscaledValue(ss_wholesale_cost#137)), sum(UnscaledValue(ss_list_price#138)), sum(UnscaledValue(ss_coupon_amt#139))] +Aggregate Attributes [4]: [count(1)#199, sum(UnscaledValue(ss_wholesale_cost#137))#200, sum(UnscaledValue(ss_list_price#138))#201, sum(UnscaledValue(ss_coupon_amt#139))#202] +Results [8]: [i_item_sk#188 AS item_sk#203, s_store_name#150 AS store_name#204, s_zip#151 AS store_zip#205, d_year#147 AS syear#206, count(1)#199 AS cnt#207, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#137))#200,17,2) AS s1#208, MakeDecimal(sum(UnscaledValue(ss_list_price#138))#201,17,2) AS s2#209, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#139))#202,17,2) AS s3#210] + +(210) Exchange +Input [8]: [item_sk#203, store_name#204, store_zip#205, syear#206, cnt#207, s1#208, s2#209, s3#210] +Arguments: hashpartitioning(item_sk#203, store_name#204, store_zip#205, 5), ENSURE_REQUIREMENTS, [id=#211] + +(211) Sort [codegen id : 86] +Input [8]: [item_sk#203, store_name#204, store_zip#205, syear#206, cnt#207, s1#208, s2#209, s3#210] +Arguments: [item_sk#203 ASC NULLS FIRST, store_name#204 ASC NULLS FIRST, store_zip#205 ASC NULLS FIRST], false, 0 + +(212) SortMergeJoin [codegen id : 87] +Left keys [3]: [item_sk#112, store_name#113, store_zip#114] +Right keys [3]: [item_sk#203, store_name#204, store_zip#205] +Join condition: (cnt#207 <= cnt#124) + +(213) Project [codegen id : 87] +Output [21]: [product_name#111, store_name#113, store_zip#114, b_street_number#115, b_streen_name#116, b_city#117, b_zip#118, c_street_number#119, c_street_name#120, c_city#121, c_zip#122, syear#123, cnt#124, s1#125, s2#126, s3#127, s1#208, s2#209, s3#210, syear#206, cnt#207] +Input [25]: [product_name#111, item_sk#112, store_name#113, store_zip#114, b_street_number#115, b_streen_name#116, b_city#117, b_zip#118, c_street_number#119, c_street_name#120, c_city#121, c_zip#122, syear#123, cnt#124, s1#125, s2#126, s3#127, item_sk#203, store_name#204, store_zip#205, syear#206, cnt#207, s1#208, s2#209, s3#210] + +(214) Exchange +Input [21]: [product_name#111, store_name#113, store_zip#114, b_street_number#115, b_streen_name#116, b_city#117, b_zip#118, c_street_number#119, c_street_name#120, c_city#121, c_zip#122, syear#123, cnt#124, s1#125, s2#126, s3#127, s1#208, s2#209, s3#210, syear#206, cnt#207] +Arguments: rangepartitioning(product_name#111 ASC NULLS FIRST, store_name#113 ASC NULLS FIRST, cnt#207 ASC NULLS FIRST, s1#125 ASC NULLS FIRST, s1#208 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#212] + +(215) Sort [codegen id : 88] +Input [21]: [product_name#111, store_name#113, store_zip#114, b_street_number#115, b_streen_name#116, b_city#117, b_zip#118, c_street_number#119, c_street_name#120, c_city#121, c_zip#122, syear#123, cnt#124, s1#125, s2#126, s3#127, s1#208, s2#209, s3#210, syear#206, cnt#207] +Arguments: [product_name#111 ASC NULLS FIRST, store_name#113 ASC NULLS FIRST, cnt#207 ASC NULLS FIRST, s1#125 ASC NULLS FIRST, s1#208 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#12 IN dynamicpruning#13 +ReusedExchange (216) + + +(216) ReusedExchange [Reuses operator id: 39] +Output [2]: [d_date_sk#43, d_year#44] + +Subquery:2 Hosting operator id = 132 Hosting Expression = ss_sold_date_sk#140 IN dynamicpruning#141 +ReusedExchange (217) + + +(217) ReusedExchange [Reuses operator id: 147] +Output [2]: [d_date_sk#146, d_year#147] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64.sf100/simplified.txt new file mode 100644 index 0000000000000..22228c7657d26 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64.sf100/simplified.txt @@ -0,0 +1,379 @@ +WholeStageCodegen (88) + Sort [product_name,store_name,cnt,s1,s1] + InputAdapter + Exchange [product_name,store_name,cnt,s1,s1] #1 + WholeStageCodegen (87) + Project [product_name,store_name,store_zip,b_street_number,b_streen_name,b_city,b_zip,c_street_number,c_street_name,c_city,c_zip,syear,cnt,s1,s2,s3,s1,s2,s3,syear,cnt] + SortMergeJoin [item_sk,store_name,store_zip,item_sk,store_name,store_zip,cnt,cnt] + InputAdapter + WholeStageCodegen (43) + Sort [item_sk,store_name,store_zip] + InputAdapter + Exchange [item_sk,store_name,store_zip] #2 + WholeStageCodegen (42) + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,count,sum,sum,sum] [count(1),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_list_price)),sum(UnscaledValue(ss_coupon_amt)),product_name,item_sk,store_name,store_zip,b_street_number,b_streen_name,b_city,b_zip,c_street_number,c_street_name,c_city,c_zip,syear,cnt,s1,s2,s3,count,sum,sum,sum] + InputAdapter + Exchange [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year] #3 + WholeStageCodegen (41) + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,ss_wholesale_cost,ss_list_price,ss_coupon_amt] [count,sum,sum,sum,count,sum,sum,sum] + Project [ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,d_year,d_year,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,i_item_sk,i_product_name] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (35) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #4 + WholeStageCodegen (34) + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (31) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #5 + WholeStageCodegen (30) + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,hd_income_band_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk,cd_marital_status,cd_marital_status] + InputAdapter + WholeStageCodegen (24) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #6 + WholeStageCodegen (23) + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,cd_marital_status] + SortMergeJoin [ss_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (20) + Sort [ss_cdemo_sk] + InputAdapter + Exchange [ss_cdemo_sk] #7 + WholeStageCodegen (19) + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [c_first_shipto_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,d_year] + BroadcastHashJoin [c_first_sales_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (14) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #8 + WholeStageCodegen (13) + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_item_sk,cs_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SortMergeJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_item_sk,ss_ticket_number] #9 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_ticket_number,ss_store_sk,ss_customer_sk,ss_cdemo_sk,ss_promo_sk,ss_hdemo_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #10 + InputAdapter + WholeStageCodegen (4) + Sort [sr_item_sk,sr_ticket_number] + InputAdapter + Exchange [sr_item_sk,sr_ticket_number] #11 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (10) + Project [cs_item_sk] + Filter [sum(cs_ext_list_price),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true))] + HashAggregate [cs_item_sk,sum,sum,isEmpty] [sum(UnscaledValue(cs_ext_list_price)),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true)),sum(cs_ext_list_price),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true)),sum,sum,isEmpty] + InputAdapter + Exchange [cs_item_sk] #13 + WholeStageCodegen (9) + HashAggregate [cs_item_sk,cs_ext_list_price,cr_refunded_cash,cr_reversed_charge,cr_store_credit] [sum,sum,isEmpty,sum,sum,isEmpty] + Project [cs_item_sk,cs_ext_list_price,cr_refunded_cash,cr_reversed_charge,cr_store_credit] + SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] + InputAdapter + WholeStageCodegen (6) + Sort [cs_item_sk,cs_order_number] + InputAdapter + Exchange [cs_item_sk,cs_order_number] #14 + WholeStageCodegen (5) + Project [cs_item_sk,cs_order_number,cs_ext_list_price] + Filter [cs_item_sk,cs_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_ext_list_price,cs_sold_date_sk] + InputAdapter + WholeStageCodegen (8) + Sort [cr_item_sk,cr_order_number] + InputAdapter + Exchange [cr_item_sk,cr_order_number] #15 + WholeStageCodegen (7) + Project [cr_item_sk,cr_order_number,cr_refunded_cash,cr_reversed_charge,cr_store_credit] + Filter [cr_item_sk,cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_refunded_cash,cr_reversed_charge,cr_store_credit,cr_returned_date_sk] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (11) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (12) + Filter [s_store_sk,s_store_name,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_zip] + InputAdapter + WholeStageCodegen (16) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #17 + WholeStageCodegen (15) + Filter [c_customer_sk,c_first_sales_date_sk,c_first_shipto_date_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] + InputAdapter + BroadcastExchange #18 + WholeStageCodegen (17) + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + ReusedExchange [d_date_sk,d_year] #18 + InputAdapter + WholeStageCodegen (22) + Sort [cd_demo_sk] + InputAdapter + Exchange [cd_demo_sk] #19 + WholeStageCodegen (21) + Filter [cd_demo_sk,cd_marital_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status] + InputAdapter + WholeStageCodegen (26) + Sort [cd_demo_sk] + InputAdapter + ReusedExchange [cd_demo_sk,cd_marital_status] #19 + InputAdapter + BroadcastExchange #20 + WholeStageCodegen (27) + Filter [p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk] + InputAdapter + BroadcastExchange #21 + WholeStageCodegen (28) + Filter [hd_demo_sk,hd_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_income_band_sk] + InputAdapter + ReusedExchange [hd_demo_sk,hd_income_band_sk] #21 + InputAdapter + WholeStageCodegen (33) + Sort [ca_address_sk] + InputAdapter + Exchange [ca_address_sk] #22 + WholeStageCodegen (32) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] + InputAdapter + WholeStageCodegen (37) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] #22 + InputAdapter + BroadcastExchange #23 + WholeStageCodegen (38) + Filter [ib_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.income_band [ib_income_band_sk] + InputAdapter + ReusedExchange [ib_income_band_sk] #23 + InputAdapter + BroadcastExchange #24 + WholeStageCodegen (40) + Project [i_item_sk,i_product_name] + Filter [i_current_price,i_color,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_color,i_product_name] + InputAdapter + WholeStageCodegen (86) + Sort [item_sk,store_name,store_zip] + InputAdapter + Exchange [item_sk,store_name,store_zip] #25 + WholeStageCodegen (85) + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,count,sum,sum,sum] [count(1),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_list_price)),sum(UnscaledValue(ss_coupon_amt)),item_sk,store_name,store_zip,syear,cnt,s1,s2,s3,count,sum,sum,sum] + InputAdapter + Exchange [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year] #26 + WholeStageCodegen (84) + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,ss_wholesale_cost,ss_list_price,ss_coupon_amt] [count,sum,sum,sum,count,sum,sum,sum] + Project [ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,d_year,d_year,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,i_item_sk,i_product_name] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + SortMergeJoin [c_current_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (78) + Sort [c_current_addr_sk] + InputAdapter + Exchange [c_current_addr_sk] #27 + WholeStageCodegen (77) + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip] + SortMergeJoin [ss_addr_sk,ca_address_sk] + InputAdapter + WholeStageCodegen (74) + Sort [ss_addr_sk] + InputAdapter + Exchange [ss_addr_sk] #28 + WholeStageCodegen (73) + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,hd_income_band_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + SortMergeJoin [c_current_cdemo_sk,cd_demo_sk,cd_marital_status,cd_marital_status] + InputAdapter + WholeStageCodegen (67) + Sort [c_current_cdemo_sk] + InputAdapter + Exchange [c_current_cdemo_sk] #29 + WholeStageCodegen (66) + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,cd_marital_status] + SortMergeJoin [ss_cdemo_sk,cd_demo_sk] + InputAdapter + WholeStageCodegen (63) + Sort [ss_cdemo_sk] + InputAdapter + Exchange [ss_cdemo_sk] #30 + WholeStageCodegen (62) + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [c_first_shipto_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,d_year] + BroadcastHashJoin [c_first_sales_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (57) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #31 + WholeStageCodegen (56) + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_item_sk,cs_item_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SortMergeJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + WholeStageCodegen (45) + Sort [ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_item_sk,ss_ticket_number] #32 + WholeStageCodegen (44) + Filter [ss_item_sk,ss_ticket_number,ss_store_sk,ss_customer_sk,ss_cdemo_sk,ss_promo_sk,ss_hdemo_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #33 + InputAdapter + WholeStageCodegen (47) + Sort [sr_item_sk,sr_ticket_number] + InputAdapter + ReusedExchange [sr_item_sk,sr_ticket_number] #11 + InputAdapter + ReusedExchange [cs_item_sk] #12 + InputAdapter + BroadcastExchange #33 + WholeStageCodegen (54) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + ReusedExchange [s_store_sk,s_store_name,s_zip] #16 + InputAdapter + WholeStageCodegen (59) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] #17 + InputAdapter + ReusedExchange [d_date_sk,d_year] #18 + InputAdapter + ReusedExchange [d_date_sk,d_year] #18 + InputAdapter + WholeStageCodegen (65) + Sort [cd_demo_sk] + InputAdapter + ReusedExchange [cd_demo_sk,cd_marital_status] #19 + InputAdapter + WholeStageCodegen (69) + Sort [cd_demo_sk] + InputAdapter + ReusedExchange [cd_demo_sk,cd_marital_status] #19 + InputAdapter + ReusedExchange [p_promo_sk] #20 + InputAdapter + ReusedExchange [hd_demo_sk,hd_income_band_sk] #21 + InputAdapter + ReusedExchange [hd_demo_sk,hd_income_band_sk] #21 + InputAdapter + WholeStageCodegen (76) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] #22 + InputAdapter + WholeStageCodegen (80) + Sort [ca_address_sk] + InputAdapter + ReusedExchange [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] #22 + InputAdapter + ReusedExchange [ib_income_band_sk] #23 + InputAdapter + ReusedExchange [ib_income_band_sk] #23 + InputAdapter + ReusedExchange [i_item_sk,i_product_name] #24 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64/explain.txt new file mode 100644 index 0000000000000..8a0e66f7f44ed --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64/explain.txt @@ -0,0 +1,1038 @@ +== Physical Plan == +* Sort (189) ++- Exchange (188) + +- * Project (187) + +- * SortMergeJoin Inner (186) + :- * Sort (114) + : +- Exchange (113) + : +- * HashAggregate (112) + : +- * HashAggregate (111) + : +- * Project (110) + : +- * BroadcastHashJoin Inner BuildRight (109) + : :- * Project (103) + : : +- * BroadcastHashJoin Inner BuildRight (102) + : : :- * Project (100) + : : : +- * BroadcastHashJoin Inner BuildRight (99) + : : : :- * Project (94) + : : : : +- * BroadcastHashJoin Inner BuildRight (93) + : : : : :- * Project (91) + : : : : : +- * BroadcastHashJoin Inner BuildRight (90) + : : : : : :- * Project (85) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (84) + : : : : : : :- * Project (82) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (81) + : : : : : : : :- * Project (76) + : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (75) + : : : : : : : : :- * Project (70) + : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (69) + : : : : : : : : : :- * Project (67) + : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (66) + : : : : : : : : : : :- * Project (61) + : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (60) + : : : : : : : : : : : :- * Project (58) + : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (57) + : : : : : : : : : : : : :- * Project (52) + : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (51) + : : : : : : : : : : : : : :- * Project (46) + : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (45) + : : : : : : : : : : : : : : :- * Project (40) + : : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (39) + : : : : : : : : : : : : : : : :- * Project (34) + : : : : : : : : : : : : : : : : +- * SortMergeJoin Inner (33) + : : : : : : : : : : : : : : : : :- * Sort (12) + : : : : : : : : : : : : : : : : : +- Exchange (11) + : : : : : : : : : : : : : : : : : +- * Project (10) + : : : : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildLeft (9) + : : : : : : : : : : : : : : : : : :- BroadcastExchange (4) + : : : : : : : : : : : : : : : : : : +- * Filter (3) + : : : : : : : : : : : : : : : : : : +- * ColumnarToRow (2) + : : : : : : : : : : : : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : : : : : : : : : : : : +- * Project (8) + : : : : : : : : : : : : : : : : : +- * Filter (7) + : : : : : : : : : : : : : : : : : +- * ColumnarToRow (6) + : : : : : : : : : : : : : : : : : +- Scan parquet default.store_returns (5) + : : : : : : : : : : : : : : : : +- * Sort (32) + : : : : : : : : : : : : : : : : +- * Project (31) + : : : : : : : : : : : : : : : : +- * Filter (30) + : : : : : : : : : : : : : : : : +- * HashAggregate (29) + : : : : : : : : : : : : : : : : +- Exchange (28) + : : : : : : : : : : : : : : : : +- * HashAggregate (27) + : : : : : : : : : : : : : : : : +- * Project (26) + : : : : : : : : : : : : : : : : +- * SortMergeJoin Inner (25) + : : : : : : : : : : : : : : : : :- * Sort (18) + : : : : : : : : : : : : : : : : : +- Exchange (17) + : : : : : : : : : : : : : : : : : +- * Project (16) + : : : : : : : : : : : : : : : : : +- * Filter (15) + : : : : : : : : : : : : : : : : : +- * ColumnarToRow (14) + : : : : : : : : : : : : : : : : : +- Scan parquet default.catalog_sales (13) + : : : : : : : : : : : : : : : : +- * Sort (24) + : : : : : : : : : : : : : : : : +- Exchange (23) + : : : : : : : : : : : : : : : : +- * Project (22) + : : : : : : : : : : : : : : : : +- * Filter (21) + : : : : : : : : : : : : : : : : +- * ColumnarToRow (20) + : : : : : : : : : : : : : : : : +- Scan parquet default.catalog_returns (19) + : : : : : : : : : : : : : : : +- BroadcastExchange (38) + : : : : : : : : : : : : : : : +- * Filter (37) + : : : : : : : : : : : : : : : +- * ColumnarToRow (36) + : : : : : : : : : : : : : : : +- Scan parquet default.date_dim (35) + : : : : : : : : : : : : : : +- BroadcastExchange (44) + : : : : : : : : : : : : : : +- * Filter (43) + : : : : : : : : : : : : : : +- * ColumnarToRow (42) + : : : : : : : : : : : : : : +- Scan parquet default.store (41) + : : : : : : : : : : : : : +- BroadcastExchange (50) + : : : : : : : : : : : : : +- * Filter (49) + : : : : : : : : : : : : : +- * ColumnarToRow (48) + : : : : : : : : : : : : : +- Scan parquet default.customer (47) + : : : : : : : : : : : : +- BroadcastExchange (56) + : : : : : : : : : : : : +- * Filter (55) + : : : : : : : : : : : : +- * ColumnarToRow (54) + : : : : : : : : : : : : +- Scan parquet default.date_dim (53) + : : : : : : : : : : : +- ReusedExchange (59) + : : : : : : : : : : +- BroadcastExchange (65) + : : : : : : : : : : +- * Filter (64) + : : : : : : : : : : +- * ColumnarToRow (63) + : : : : : : : : : : +- Scan parquet default.customer_demographics (62) + : : : : : : : : : +- ReusedExchange (68) + : : : : : : : : +- BroadcastExchange (74) + : : : : : : : : +- * Filter (73) + : : : : : : : : +- * ColumnarToRow (72) + : : : : : : : : +- Scan parquet default.promotion (71) + : : : : : : : +- BroadcastExchange (80) + : : : : : : : +- * Filter (79) + : : : : : : : +- * ColumnarToRow (78) + : : : : : : : +- Scan parquet default.household_demographics (77) + : : : : : : +- ReusedExchange (83) + : : : : : +- BroadcastExchange (89) + : : : : : +- * Filter (88) + : : : : : +- * ColumnarToRow (87) + : : : : : +- Scan parquet default.customer_address (86) + : : : : +- ReusedExchange (92) + : : : +- BroadcastExchange (98) + : : : +- * Filter (97) + : : : +- * ColumnarToRow (96) + : : : +- Scan parquet default.income_band (95) + : : +- ReusedExchange (101) + : +- BroadcastExchange (108) + : +- * Project (107) + : +- * Filter (106) + : +- * ColumnarToRow (105) + : +- Scan parquet default.item (104) + +- * Sort (185) + +- Exchange (184) + +- * HashAggregate (183) + +- * HashAggregate (182) + +- * Project (181) + +- * BroadcastHashJoin Inner BuildRight (180) + :- * Project (178) + : +- * BroadcastHashJoin Inner BuildRight (177) + : :- * Project (175) + : : +- * BroadcastHashJoin Inner BuildRight (174) + : : :- * Project (172) + : : : +- * BroadcastHashJoin Inner BuildRight (171) + : : : :- * Project (169) + : : : : +- * BroadcastHashJoin Inner BuildRight (168) + : : : : :- * Project (166) + : : : : : +- * BroadcastHashJoin Inner BuildRight (165) + : : : : : :- * Project (163) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (162) + : : : : : : :- * Project (160) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (159) + : : : : : : : :- * Project (157) + : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (156) + : : : : : : : : :- * Project (154) + : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (153) + : : : : : : : : : :- * Project (151) + : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (150) + : : : : : : : : : : :- * Project (148) + : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (147) + : : : : : : : : : : : :- * Project (145) + : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (144) + : : : : : : : : : : : : :- * Project (142) + : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (141) + : : : : : : : : : : : : : :- * Project (139) + : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (138) + : : : : : : : : : : : : : : :- * Project (133) + : : : : : : : : : : : : : : : +- * SortMergeJoin Inner (132) + : : : : : : : : : : : : : : : :- * Sort (126) + : : : : : : : : : : : : : : : : +- Exchange (125) + : : : : : : : : : : : : : : : : +- * Project (124) + : : : : : : : : : : : : : : : : +- * BroadcastHashJoin Inner BuildLeft (123) + : : : : : : : : : : : : : : : : :- BroadcastExchange (118) + : : : : : : : : : : : : : : : : : +- * Filter (117) + : : : : : : : : : : : : : : : : : +- * ColumnarToRow (116) + : : : : : : : : : : : : : : : : : +- Scan parquet default.store_sales (115) + : : : : : : : : : : : : : : : : +- * Project (122) + : : : : : : : : : : : : : : : : +- * Filter (121) + : : : : : : : : : : : : : : : : +- * ColumnarToRow (120) + : : : : : : : : : : : : : : : : +- Scan parquet default.store_returns (119) + : : : : : : : : : : : : : : : +- * Sort (131) + : : : : : : : : : : : : : : : +- * Project (130) + : : : : : : : : : : : : : : : +- * Filter (129) + : : : : : : : : : : : : : : : +- * HashAggregate (128) + : : : : : : : : : : : : : : : +- ReusedExchange (127) + : : : : : : : : : : : : : : +- BroadcastExchange (137) + : : : : : : : : : : : : : : +- * Filter (136) + : : : : : : : : : : : : : : +- * ColumnarToRow (135) + : : : : : : : : : : : : : : +- Scan parquet default.date_dim (134) + : : : : : : : : : : : : : +- ReusedExchange (140) + : : : : : : : : : : : : +- ReusedExchange (143) + : : : : : : : : : : : +- ReusedExchange (146) + : : : : : : : : : : +- ReusedExchange (149) + : : : : : : : : : +- ReusedExchange (152) + : : : : : : : : +- ReusedExchange (155) + : : : : : : : +- ReusedExchange (158) + : : : : : : +- ReusedExchange (161) + : : : : : +- ReusedExchange (164) + : : : : +- ReusedExchange (167) + : : : +- ReusedExchange (170) + : : +- ReusedExchange (173) + : +- ReusedExchange (176) + +- ReusedExchange (179) + + +(1) Scan parquet default.store_sales +Output [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#12), dynamicpruningexpression(ss_sold_date_sk#12 IN dynamicpruning#13)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_promo_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] + +(3) Filter [codegen id : 1] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Condition : (((((((isnotnull(ss_item_sk#1) AND isnotnull(ss_ticket_number#8)) AND isnotnull(ss_store_sk#6)) AND isnotnull(ss_customer_sk#2)) AND isnotnull(ss_cdemo_sk#3)) AND isnotnull(ss_promo_sk#7)) AND isnotnull(ss_hdemo_sk#4)) AND isnotnull(ss_addr_sk#5)) + +(4) BroadcastExchange +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[7, int, false] as bigint) & 4294967295))),false), [id=#14] + +(5) Scan parquet default.store_returns +Output [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(6) ColumnarToRow +Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] + +(7) Filter +Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] +Condition : (isnotnull(sr_item_sk#15) AND isnotnull(sr_ticket_number#16)) + +(8) Project +Output [2]: [sr_item_sk#15, sr_ticket_number#16] +Input [3]: [sr_item_sk#15, sr_ticket_number#16, sr_returned_date_sk#17] + +(9) BroadcastHashJoin [codegen id : 2] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#8] +Right keys [2]: [sr_item_sk#15, sr_ticket_number#16] +Join condition: None + +(10) Project [codegen id : 2] +Output [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_ticket_number#8, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12, sr_item_sk#15, sr_ticket_number#16] + +(11) Exchange +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#18] + +(12) Sort [codegen id : 3] +Input [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(13) Scan parquet default.catalog_sales +Output [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_sales] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_order_number)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 4] +Input [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] + +(15) Filter [codegen id : 4] +Input [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] +Condition : (isnotnull(cs_item_sk#19) AND isnotnull(cs_order_number#20)) + +(16) Project [codegen id : 4] +Output [3]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21] +Input [4]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cs_sold_date_sk#22] + +(17) Exchange +Input [3]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21] +Arguments: hashpartitioning(cs_item_sk#19, cs_order_number#20, 5), ENSURE_REQUIREMENTS, [id=#23] + +(18) Sort [codegen id : 5] +Input [3]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21] +Arguments: [cs_item_sk#19 ASC NULLS FIRST, cs_order_number#20 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.catalog_returns +Output [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_order_number)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 6] +Input [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] + +(21) Filter [codegen id : 6] +Input [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] +Condition : (isnotnull(cr_item_sk#24) AND isnotnull(cr_order_number#25)) + +(22) Project [codegen id : 6] +Output [5]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Input [6]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28, cr_returned_date_sk#29] + +(23) Exchange +Input [5]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Arguments: hashpartitioning(cr_item_sk#24, cr_order_number#25, 5), ENSURE_REQUIREMENTS, [id=#30] + +(24) Sort [codegen id : 7] +Input [5]: [cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Arguments: [cr_item_sk#24 ASC NULLS FIRST, cr_order_number#25 ASC NULLS FIRST], false, 0 + +(25) SortMergeJoin [codegen id : 8] +Left keys [2]: [cs_item_sk#19, cs_order_number#20] +Right keys [2]: [cr_item_sk#24, cr_order_number#25] +Join condition: None + +(26) Project [codegen id : 8] +Output [5]: [cs_item_sk#19, cs_ext_list_price#21, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Input [8]: [cs_item_sk#19, cs_order_number#20, cs_ext_list_price#21, cr_item_sk#24, cr_order_number#25, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] + +(27) HashAggregate [codegen id : 8] +Input [5]: [cs_item_sk#19, cs_ext_list_price#21, cr_refunded_cash#26, cr_reversed_charge#27, cr_store_credit#28] +Keys [1]: [cs_item_sk#19] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_list_price#21)), partial_sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))] +Aggregate Attributes [3]: [sum#31, sum#32, isEmpty#33] +Results [4]: [cs_item_sk#19, sum#34, sum#35, isEmpty#36] + +(28) Exchange +Input [4]: [cs_item_sk#19, sum#34, sum#35, isEmpty#36] +Arguments: hashpartitioning(cs_item_sk#19, 5), ENSURE_REQUIREMENTS, [id=#37] + +(29) HashAggregate [codegen id : 9] +Input [4]: [cs_item_sk#19, sum#34, sum#35, isEmpty#36] +Keys [1]: [cs_item_sk#19] +Functions [2]: [sum(UnscaledValue(cs_ext_list_price#21)), sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_list_price#21))#38, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#39] +Results [3]: [cs_item_sk#19, MakeDecimal(sum(UnscaledValue(cs_ext_list_price#21))#38,17,2) AS sum(cs_ext_list_price#21)#40, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#39 AS sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41] + +(30) Filter [codegen id : 9] +Input [3]: [cs_item_sk#19, sum(cs_ext_list_price#21)#40, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41] +Condition : (isnotnull(sum(cs_ext_list_price#21)#40) AND (cast(sum(cs_ext_list_price#21)#40 as decimal(21,2)) > CheckOverflow((2.00 * promote_precision(sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41)), DecimalType(21,2), true))) + +(31) Project [codegen id : 9] +Output [1]: [cs_item_sk#19] +Input [3]: [cs_item_sk#19, sum(cs_ext_list_price#21)#40, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#26 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#27 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#28 as decimal(9,2)))), DecimalType(9,2), true))#41] + +(32) Sort [codegen id : 9] +Input [1]: [cs_item_sk#19] +Arguments: [cs_item_sk#19 ASC NULLS FIRST], false, 0 + +(33) SortMergeJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [cs_item_sk#19] +Join condition: None + +(34) Project [codegen id : 25] +Output [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12] +Input [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12, cs_item_sk#19] + +(35) Scan parquet default.date_dim +Output [2]: [d_date_sk#42, d_year#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,1999), IsNotNull(d_date_sk)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 10] +Input [2]: [d_date_sk#42, d_year#43] + +(37) Filter [codegen id : 10] +Input [2]: [d_date_sk#42, d_year#43] +Condition : ((isnotnull(d_year#43) AND (d_year#43 = 1999)) AND isnotnull(d_date_sk#42)) + +(38) BroadcastExchange +Input [2]: [d_date_sk#42, d_year#43] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#44] + +(39) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_sold_date_sk#12] +Right keys [1]: [d_date_sk#42] +Join condition: None + +(40) Project [codegen id : 25] +Output [11]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43] +Input [13]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, ss_sold_date_sk#12, d_date_sk#42, d_year#43] + +(41) Scan parquet default.store +Output [3]: [s_store_sk#45, s_store_name#46, s_zip#47] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk), IsNotNull(s_store_name), IsNotNull(s_zip)] +ReadSchema: struct + +(42) ColumnarToRow [codegen id : 11] +Input [3]: [s_store_sk#45, s_store_name#46, s_zip#47] + +(43) Filter [codegen id : 11] +Input [3]: [s_store_sk#45, s_store_name#46, s_zip#47] +Condition : ((isnotnull(s_store_sk#45) AND isnotnull(s_store_name#46)) AND isnotnull(s_zip#47)) + +(44) BroadcastExchange +Input [3]: [s_store_sk#45, s_store_name#46, s_zip#47] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#48] + +(45) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_store_sk#6] +Right keys [1]: [s_store_sk#45] +Join condition: None + +(46) Project [codegen id : 25] +Output [12]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47] +Input [14]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_store_sk#6, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_sk#45, s_store_name#46, s_zip#47] + +(47) Scan parquet default.customer +Output [6]: [c_customer_sk#49, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_first_sales_date_sk), IsNotNull(c_first_shipto_date_sk), IsNotNull(c_current_cdemo_sk), IsNotNull(c_current_hdemo_sk), IsNotNull(c_current_addr_sk)] +ReadSchema: struct + +(48) ColumnarToRow [codegen id : 12] +Input [6]: [c_customer_sk#49, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54] + +(49) Filter [codegen id : 12] +Input [6]: [c_customer_sk#49, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54] +Condition : (((((isnotnull(c_customer_sk#49) AND isnotnull(c_first_sales_date_sk#54)) AND isnotnull(c_first_shipto_date_sk#53)) AND isnotnull(c_current_cdemo_sk#50)) AND isnotnull(c_current_hdemo_sk#51)) AND isnotnull(c_current_addr_sk#52)) + +(50) BroadcastExchange +Input [6]: [c_customer_sk#49, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#55] + +(51) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_customer_sk#2] +Right keys [1]: [c_customer_sk#49] +Join condition: None + +(52) Project [codegen id : 25] +Output [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54] +Input [18]: [ss_item_sk#1, ss_customer_sk#2, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_customer_sk#49, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54] + +(53) Scan parquet default.date_dim +Output [2]: [d_date_sk#56, d_year#57] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date_sk)] +ReadSchema: struct + +(54) ColumnarToRow [codegen id : 13] +Input [2]: [d_date_sk#56, d_year#57] + +(55) Filter [codegen id : 13] +Input [2]: [d_date_sk#56, d_year#57] +Condition : isnotnull(d_date_sk#56) + +(56) BroadcastExchange +Input [2]: [d_date_sk#56, d_year#57] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#58] + +(57) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [c_first_sales_date_sk#54] +Right keys [1]: [d_date_sk#56] +Join condition: None + +(58) Project [codegen id : 25] +Output [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, d_year#57] +Input [18]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, c_first_sales_date_sk#54, d_date_sk#56, d_year#57] + +(59) ReusedExchange [Reuses operator id: 56] +Output [2]: [d_date_sk#59, d_year#60] + +(60) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [c_first_shipto_date_sk#53] +Right keys [1]: [d_date_sk#59] +Join condition: None + +(61) Project [codegen id : 25] +Output [16]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60] +Input [18]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, c_first_shipto_date_sk#53, d_year#57, d_date_sk#59, d_year#60] + +(62) Scan parquet default.customer_demographics +Output [2]: [cd_demo_sk#61, cd_marital_status#62] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_demo_sk), IsNotNull(cd_marital_status)] +ReadSchema: struct + +(63) ColumnarToRow [codegen id : 15] +Input [2]: [cd_demo_sk#61, cd_marital_status#62] + +(64) Filter [codegen id : 15] +Input [2]: [cd_demo_sk#61, cd_marital_status#62] +Condition : (isnotnull(cd_demo_sk#61) AND isnotnull(cd_marital_status#62)) + +(65) BroadcastExchange +Input [2]: [cd_demo_sk#61, cd_marital_status#62] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#63] + +(66) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_cdemo_sk#3] +Right keys [1]: [cd_demo_sk#61] +Join condition: None + +(67) Project [codegen id : 25] +Output [16]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, cd_marital_status#62] +Input [18]: [ss_item_sk#1, ss_cdemo_sk#3, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, cd_demo_sk#61, cd_marital_status#62] + +(68) ReusedExchange [Reuses operator id: 65] +Output [2]: [cd_demo_sk#64, cd_marital_status#65] + +(69) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [c_current_cdemo_sk#50] +Right keys [1]: [cd_demo_sk#64] +Join condition: NOT (cd_marital_status#62 = cd_marital_status#65) + +(70) Project [codegen id : 25] +Output [14]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60] +Input [18]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_cdemo_sk#50, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, cd_marital_status#62, cd_demo_sk#64, cd_marital_status#65] + +(71) Scan parquet default.promotion +Output [1]: [p_promo_sk#66] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_promo_sk)] +ReadSchema: struct + +(72) ColumnarToRow [codegen id : 17] +Input [1]: [p_promo_sk#66] + +(73) Filter [codegen id : 17] +Input [1]: [p_promo_sk#66] +Condition : isnotnull(p_promo_sk#66) + +(74) BroadcastExchange +Input [1]: [p_promo_sk#66] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#67] + +(75) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_promo_sk#7] +Right keys [1]: [p_promo_sk#66] +Join condition: None + +(76) Project [codegen id : 25] +Output [13]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60] +Input [15]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_promo_sk#7, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, p_promo_sk#66] + +(77) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#68, hd_income_band_sk#69] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_demo_sk), IsNotNull(hd_income_band_sk)] +ReadSchema: struct + +(78) ColumnarToRow [codegen id : 18] +Input [2]: [hd_demo_sk#68, hd_income_band_sk#69] + +(79) Filter [codegen id : 18] +Input [2]: [hd_demo_sk#68, hd_income_band_sk#69] +Condition : (isnotnull(hd_demo_sk#68) AND isnotnull(hd_income_band_sk#69)) + +(80) BroadcastExchange +Input [2]: [hd_demo_sk#68, hd_income_band_sk#69] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#70] + +(81) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_hdemo_sk#4] +Right keys [1]: [hd_demo_sk#68] +Join condition: None + +(82) Project [codegen id : 25] +Output [13]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, hd_income_band_sk#69] +Input [15]: [ss_item_sk#1, ss_hdemo_sk#4, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, hd_demo_sk#68, hd_income_band_sk#69] + +(83) ReusedExchange [Reuses operator id: 80] +Output [2]: [hd_demo_sk#71, hd_income_band_sk#72] + +(84) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [c_current_hdemo_sk#51] +Right keys [1]: [hd_demo_sk#71] +Join condition: None + +(85) Project [codegen id : 25] +Output [13]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_addr_sk#52, d_year#57, d_year#60, hd_income_band_sk#69, hd_income_band_sk#72] +Input [15]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_hdemo_sk#51, c_current_addr_sk#52, d_year#57, d_year#60, hd_income_band_sk#69, hd_demo_sk#71, hd_income_band_sk#72] + +(86) Scan parquet default.customer_address +Output [5]: [ca_address_sk#73, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_address] +PushedFilters: [IsNotNull(ca_address_sk)] +ReadSchema: struct + +(87) ColumnarToRow [codegen id : 20] +Input [5]: [ca_address_sk#73, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77] + +(88) Filter [codegen id : 20] +Input [5]: [ca_address_sk#73, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77] +Condition : isnotnull(ca_address_sk#73) + +(89) BroadcastExchange +Input [5]: [ca_address_sk#73, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#78] + +(90) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_addr_sk#5] +Right keys [1]: [ca_address_sk#73] +Join condition: None + +(91) Project [codegen id : 25] +Output [16]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_addr_sk#52, d_year#57, d_year#60, hd_income_band_sk#69, hd_income_band_sk#72, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77] +Input [18]: [ss_item_sk#1, ss_addr_sk#5, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_addr_sk#52, d_year#57, d_year#60, hd_income_band_sk#69, hd_income_band_sk#72, ca_address_sk#73, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77] + +(92) ReusedExchange [Reuses operator id: 89] +Output [5]: [ca_address_sk#79, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83] + +(93) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [c_current_addr_sk#52] +Right keys [1]: [ca_address_sk#79] +Join condition: None + +(94) Project [codegen id : 25] +Output [19]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, d_year#57, d_year#60, hd_income_band_sk#69, hd_income_band_sk#72, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83] +Input [21]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, c_current_addr_sk#52, d_year#57, d_year#60, hd_income_band_sk#69, hd_income_band_sk#72, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_address_sk#79, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83] + +(95) Scan parquet default.income_band +Output [1]: [ib_income_band_sk#84] +Batched: true +Location [not included in comparison]/{warehouse_dir}/income_band] +PushedFilters: [IsNotNull(ib_income_band_sk)] +ReadSchema: struct + +(96) ColumnarToRow [codegen id : 22] +Input [1]: [ib_income_band_sk#84] + +(97) Filter [codegen id : 22] +Input [1]: [ib_income_band_sk#84] +Condition : isnotnull(ib_income_band_sk#84) + +(98) BroadcastExchange +Input [1]: [ib_income_band_sk#84] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#85] + +(99) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [hd_income_band_sk#69] +Right keys [1]: [ib_income_band_sk#84] +Join condition: None + +(100) Project [codegen id : 25] +Output [18]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, d_year#57, d_year#60, hd_income_band_sk#72, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83] +Input [20]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, d_year#57, d_year#60, hd_income_band_sk#69, hd_income_band_sk#72, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, ib_income_band_sk#84] + +(101) ReusedExchange [Reuses operator id: 98] +Output [1]: [ib_income_band_sk#86] + +(102) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [hd_income_band_sk#72] +Right keys [1]: [ib_income_band_sk#86] +Join condition: None + +(103) Project [codegen id : 25] +Output [17]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, d_year#57, d_year#60, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83] +Input [19]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, d_year#57, d_year#60, hd_income_band_sk#72, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, ib_income_band_sk#86] + +(104) Scan parquet default.item +Output [4]: [i_item_sk#87, i_current_price#88, i_color#89, i_product_name#90] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), In(i_color, [purple ,burlywood ,indian ,spring ,floral ,medium ]), GreaterThanOrEqual(i_current_price,64.00), LessThanOrEqual(i_current_price,74.00), GreaterThanOrEqual(i_current_price,65.00), LessThanOrEqual(i_current_price,79.00), IsNotNull(i_item_sk)] +ReadSchema: struct + +(105) ColumnarToRow [codegen id : 24] +Input [4]: [i_item_sk#87, i_current_price#88, i_color#89, i_product_name#90] + +(106) Filter [codegen id : 24] +Input [4]: [i_item_sk#87, i_current_price#88, i_color#89, i_product_name#90] +Condition : ((((((isnotnull(i_current_price#88) AND i_color#89 IN (purple ,burlywood ,indian ,spring ,floral ,medium )) AND (i_current_price#88 >= 64.00)) AND (i_current_price#88 <= 74.00)) AND (i_current_price#88 >= 65.00)) AND (i_current_price#88 <= 79.00)) AND isnotnull(i_item_sk#87)) + +(107) Project [codegen id : 24] +Output [2]: [i_item_sk#87, i_product_name#90] +Input [4]: [i_item_sk#87, i_current_price#88, i_color#89, i_product_name#90] + +(108) BroadcastExchange +Input [2]: [i_item_sk#87, i_product_name#90] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#91] + +(109) BroadcastHashJoin [codegen id : 25] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#87] +Join condition: None + +(110) Project [codegen id : 25] +Output [18]: [ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, d_year#57, d_year#60, s_store_name#46, s_zip#47, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, i_item_sk#87, i_product_name#90] +Input [19]: [ss_item_sk#1, ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, s_store_name#46, s_zip#47, d_year#57, d_year#60, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, i_item_sk#87, i_product_name#90] + +(111) HashAggregate [codegen id : 25] +Input [18]: [ss_wholesale_cost#9, ss_list_price#10, ss_coupon_amt#11, d_year#43, d_year#57, d_year#60, s_store_name#46, s_zip#47, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, i_item_sk#87, i_product_name#90] +Keys [15]: [i_product_name#90, i_item_sk#87, s_store_name#46, s_zip#47, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, d_year#43, d_year#57, d_year#60] +Functions [4]: [partial_count(1), partial_sum(UnscaledValue(ss_wholesale_cost#9)), partial_sum(UnscaledValue(ss_list_price#10)), partial_sum(UnscaledValue(ss_coupon_amt#11))] +Aggregate Attributes [4]: [count#92, sum#93, sum#94, sum#95] +Results [19]: [i_product_name#90, i_item_sk#87, s_store_name#46, s_zip#47, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, d_year#43, d_year#57, d_year#60, count#96, sum#97, sum#98, sum#99] + +(112) HashAggregate [codegen id : 25] +Input [19]: [i_product_name#90, i_item_sk#87, s_store_name#46, s_zip#47, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, d_year#43, d_year#57, d_year#60, count#96, sum#97, sum#98, sum#99] +Keys [15]: [i_product_name#90, i_item_sk#87, s_store_name#46, s_zip#47, ca_street_number#74, ca_street_name#75, ca_city#76, ca_zip#77, ca_street_number#80, ca_street_name#81, ca_city#82, ca_zip#83, d_year#43, d_year#57, d_year#60] +Functions [4]: [count(1), sum(UnscaledValue(ss_wholesale_cost#9)), sum(UnscaledValue(ss_list_price#10)), sum(UnscaledValue(ss_coupon_amt#11))] +Aggregate Attributes [4]: [count(1)#100, sum(UnscaledValue(ss_wholesale_cost#9))#101, sum(UnscaledValue(ss_list_price#10))#102, sum(UnscaledValue(ss_coupon_amt#11))#103] +Results [17]: [i_product_name#90 AS product_name#104, i_item_sk#87 AS item_sk#105, s_store_name#46 AS store_name#106, s_zip#47 AS store_zip#107, ca_street_number#74 AS b_street_number#108, ca_street_name#75 AS b_streen_name#109, ca_city#76 AS b_city#110, ca_zip#77 AS b_zip#111, ca_street_number#80 AS c_street_number#112, ca_street_name#81 AS c_street_name#113, ca_city#82 AS c_city#114, ca_zip#83 AS c_zip#115, d_year#43 AS syear#116, count(1)#100 AS cnt#117, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#9))#101,17,2) AS s1#118, MakeDecimal(sum(UnscaledValue(ss_list_price#10))#102,17,2) AS s2#119, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#11))#103,17,2) AS s3#120] + +(113) Exchange +Input [17]: [product_name#104, item_sk#105, store_name#106, store_zip#107, b_street_number#108, b_streen_name#109, b_city#110, b_zip#111, c_street_number#112, c_street_name#113, c_city#114, c_zip#115, syear#116, cnt#117, s1#118, s2#119, s3#120] +Arguments: hashpartitioning(item_sk#105, store_name#106, store_zip#107, 5), ENSURE_REQUIREMENTS, [id=#121] + +(114) Sort [codegen id : 26] +Input [17]: [product_name#104, item_sk#105, store_name#106, store_zip#107, b_street_number#108, b_streen_name#109, b_city#110, b_zip#111, c_street_number#112, c_street_name#113, c_city#114, c_zip#115, syear#116, cnt#117, s1#118, s2#119, s3#120] +Arguments: [item_sk#105 ASC NULLS FIRST, store_name#106 ASC NULLS FIRST, store_zip#107 ASC NULLS FIRST], false, 0 + +(115) Scan parquet default.store_sales +Output [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_ticket_number#129, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#133), dynamicpruningexpression(ss_sold_date_sk#133 IN dynamicpruning#134)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_ticket_number), IsNotNull(ss_store_sk), IsNotNull(ss_customer_sk), IsNotNull(ss_cdemo_sk), IsNotNull(ss_promo_sk), IsNotNull(ss_hdemo_sk), IsNotNull(ss_addr_sk)] +ReadSchema: struct + +(116) ColumnarToRow [codegen id : 27] +Input [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_ticket_number#129, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] + +(117) Filter [codegen id : 27] +Input [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_ticket_number#129, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Condition : (((((((isnotnull(ss_item_sk#122) AND isnotnull(ss_ticket_number#129)) AND isnotnull(ss_store_sk#127)) AND isnotnull(ss_customer_sk#123)) AND isnotnull(ss_cdemo_sk#124)) AND isnotnull(ss_promo_sk#128)) AND isnotnull(ss_hdemo_sk#125)) AND isnotnull(ss_addr_sk#126)) + +(118) BroadcastExchange +Input [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_ticket_number#129, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[0, int, false] as bigint), 32) | (cast(input[7, int, false] as bigint) & 4294967295))),false), [id=#135] + +(119) Scan parquet default.store_returns +Output [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(120) ColumnarToRow +Input [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] + +(121) Filter +Input [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] +Condition : (isnotnull(sr_item_sk#136) AND isnotnull(sr_ticket_number#137)) + +(122) Project +Output [2]: [sr_item_sk#136, sr_ticket_number#137] +Input [3]: [sr_item_sk#136, sr_ticket_number#137, sr_returned_date_sk#138] + +(123) BroadcastHashJoin [codegen id : 28] +Left keys [2]: [ss_item_sk#122, ss_ticket_number#129] +Right keys [2]: [sr_item_sk#136, sr_ticket_number#137] +Join condition: None + +(124) Project [codegen id : 28] +Output [11]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Input [14]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_ticket_number#129, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133, sr_item_sk#136, sr_ticket_number#137] + +(125) Exchange +Input [11]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Arguments: hashpartitioning(ss_item_sk#122, 5), ENSURE_REQUIREMENTS, [id=#139] + +(126) Sort [codegen id : 29] +Input [11]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Arguments: [ss_item_sk#122 ASC NULLS FIRST], false, 0 + +(127) ReusedExchange [Reuses operator id: 28] +Output [4]: [cs_item_sk#140, sum#141, sum#142, isEmpty#143] + +(128) HashAggregate [codegen id : 35] +Input [4]: [cs_item_sk#140, sum#141, sum#142, isEmpty#143] +Keys [1]: [cs_item_sk#140] +Functions [2]: [sum(UnscaledValue(cs_ext_list_price#144)), sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_list_price#144))#148, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))#149] +Results [3]: [cs_item_sk#140, MakeDecimal(sum(UnscaledValue(cs_ext_list_price#144))#148,17,2) AS sum(cs_ext_list_price#144)#150, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))#149 AS sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))#151] + +(129) Filter [codegen id : 35] +Input [3]: [cs_item_sk#140, sum(cs_ext_list_price#144)#150, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))#151] +Condition : (isnotnull(sum(cs_ext_list_price#144)#150) AND (cast(sum(cs_ext_list_price#144)#150 as decimal(21,2)) > CheckOverflow((2.00 * promote_precision(sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))#151)), DecimalType(21,2), true))) + +(130) Project [codegen id : 35] +Output [1]: [cs_item_sk#140] +Input [3]: [cs_item_sk#140, sum(cs_ext_list_price#144)#150, sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash#145 as decimal(8,2))) + promote_precision(cast(cr_reversed_charge#146 as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit#147 as decimal(9,2)))), DecimalType(9,2), true))#151] + +(131) Sort [codegen id : 35] +Input [1]: [cs_item_sk#140] +Arguments: [cs_item_sk#140 ASC NULLS FIRST], false, 0 + +(132) SortMergeJoin [codegen id : 51] +Left keys [1]: [ss_item_sk#122] +Right keys [1]: [cs_item_sk#140] +Join condition: None + +(133) Project [codegen id : 51] +Output [11]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133] +Input [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133, cs_item_sk#140] + +(134) Scan parquet default.date_dim +Output [2]: [d_date_sk#152, d_year#153] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(135) ColumnarToRow [codegen id : 36] +Input [2]: [d_date_sk#152, d_year#153] + +(136) Filter [codegen id : 36] +Input [2]: [d_date_sk#152, d_year#153] +Condition : ((isnotnull(d_year#153) AND (d_year#153 = 2000)) AND isnotnull(d_date_sk#152)) + +(137) BroadcastExchange +Input [2]: [d_date_sk#152, d_year#153] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#154] + +(138) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_sold_date_sk#133] +Right keys [1]: [d_date_sk#152] +Join condition: None + +(139) Project [codegen id : 51] +Output [11]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153] +Input [13]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, ss_sold_date_sk#133, d_date_sk#152, d_year#153] + +(140) ReusedExchange [Reuses operator id: 44] +Output [3]: [s_store_sk#155, s_store_name#156, s_zip#157] + +(141) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_store_sk#127] +Right keys [1]: [s_store_sk#155] +Join condition: None + +(142) Project [codegen id : 51] +Output [12]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157] +Input [14]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_store_sk#127, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_sk#155, s_store_name#156, s_zip#157] + +(143) ReusedExchange [Reuses operator id: 50] +Output [6]: [c_customer_sk#158, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, c_first_shipto_date_sk#162, c_first_sales_date_sk#163] + +(144) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_customer_sk#123] +Right keys [1]: [c_customer_sk#158] +Join condition: None + +(145) Project [codegen id : 51] +Output [16]: [ss_item_sk#122, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, c_first_shipto_date_sk#162, c_first_sales_date_sk#163] +Input [18]: [ss_item_sk#122, ss_customer_sk#123, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_customer_sk#158, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, c_first_shipto_date_sk#162, c_first_sales_date_sk#163] + +(146) ReusedExchange [Reuses operator id: 56] +Output [2]: [d_date_sk#164, d_year#165] + +(147) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [c_first_sales_date_sk#163] +Right keys [1]: [d_date_sk#164] +Join condition: None + +(148) Project [codegen id : 51] +Output [16]: [ss_item_sk#122, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, c_first_shipto_date_sk#162, d_year#165] +Input [18]: [ss_item_sk#122, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, c_first_shipto_date_sk#162, c_first_sales_date_sk#163, d_date_sk#164, d_year#165] + +(149) ReusedExchange [Reuses operator id: 56] +Output [2]: [d_date_sk#166, d_year#167] + +(150) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [c_first_shipto_date_sk#162] +Right keys [1]: [d_date_sk#166] +Join condition: None + +(151) Project [codegen id : 51] +Output [16]: [ss_item_sk#122, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167] +Input [18]: [ss_item_sk#122, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, c_first_shipto_date_sk#162, d_year#165, d_date_sk#166, d_year#167] + +(152) ReusedExchange [Reuses operator id: 65] +Output [2]: [cd_demo_sk#168, cd_marital_status#169] + +(153) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_cdemo_sk#124] +Right keys [1]: [cd_demo_sk#168] +Join condition: None + +(154) Project [codegen id : 51] +Output [16]: [ss_item_sk#122, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, cd_marital_status#169] +Input [18]: [ss_item_sk#122, ss_cdemo_sk#124, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, cd_demo_sk#168, cd_marital_status#169] + +(155) ReusedExchange [Reuses operator id: 65] +Output [2]: [cd_demo_sk#170, cd_marital_status#171] + +(156) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [c_current_cdemo_sk#159] +Right keys [1]: [cd_demo_sk#170] +Join condition: NOT (cd_marital_status#169 = cd_marital_status#171) + +(157) Project [codegen id : 51] +Output [14]: [ss_item_sk#122, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167] +Input [18]: [ss_item_sk#122, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_cdemo_sk#159, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, cd_marital_status#169, cd_demo_sk#170, cd_marital_status#171] + +(158) ReusedExchange [Reuses operator id: 74] +Output [1]: [p_promo_sk#172] + +(159) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_promo_sk#128] +Right keys [1]: [p_promo_sk#172] +Join condition: None + +(160) Project [codegen id : 51] +Output [13]: [ss_item_sk#122, ss_hdemo_sk#125, ss_addr_sk#126, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167] +Input [15]: [ss_item_sk#122, ss_hdemo_sk#125, ss_addr_sk#126, ss_promo_sk#128, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, p_promo_sk#172] + +(161) ReusedExchange [Reuses operator id: 80] +Output [2]: [hd_demo_sk#173, hd_income_band_sk#174] + +(162) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_hdemo_sk#125] +Right keys [1]: [hd_demo_sk#173] +Join condition: None + +(163) Project [codegen id : 51] +Output [13]: [ss_item_sk#122, ss_addr_sk#126, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, hd_income_band_sk#174] +Input [15]: [ss_item_sk#122, ss_hdemo_sk#125, ss_addr_sk#126, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, hd_demo_sk#173, hd_income_band_sk#174] + +(164) ReusedExchange [Reuses operator id: 80] +Output [2]: [hd_demo_sk#175, hd_income_band_sk#176] + +(165) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [c_current_hdemo_sk#160] +Right keys [1]: [hd_demo_sk#175] +Join condition: None + +(166) Project [codegen id : 51] +Output [13]: [ss_item_sk#122, ss_addr_sk#126, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_addr_sk#161, d_year#165, d_year#167, hd_income_band_sk#174, hd_income_band_sk#176] +Input [15]: [ss_item_sk#122, ss_addr_sk#126, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_hdemo_sk#160, c_current_addr_sk#161, d_year#165, d_year#167, hd_income_band_sk#174, hd_demo_sk#175, hd_income_band_sk#176] + +(167) ReusedExchange [Reuses operator id: 89] +Output [5]: [ca_address_sk#177, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181] + +(168) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_addr_sk#126] +Right keys [1]: [ca_address_sk#177] +Join condition: None + +(169) Project [codegen id : 51] +Output [16]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_addr_sk#161, d_year#165, d_year#167, hd_income_band_sk#174, hd_income_band_sk#176, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181] +Input [18]: [ss_item_sk#122, ss_addr_sk#126, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_addr_sk#161, d_year#165, d_year#167, hd_income_band_sk#174, hd_income_band_sk#176, ca_address_sk#177, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181] + +(170) ReusedExchange [Reuses operator id: 89] +Output [5]: [ca_address_sk#182, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186] + +(171) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [c_current_addr_sk#161] +Right keys [1]: [ca_address_sk#182] +Join condition: None + +(172) Project [codegen id : 51] +Output [19]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, d_year#165, d_year#167, hd_income_band_sk#174, hd_income_band_sk#176, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186] +Input [21]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, c_current_addr_sk#161, d_year#165, d_year#167, hd_income_band_sk#174, hd_income_band_sk#176, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_address_sk#182, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186] + +(173) ReusedExchange [Reuses operator id: 98] +Output [1]: [ib_income_band_sk#187] + +(174) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [hd_income_band_sk#174] +Right keys [1]: [ib_income_band_sk#187] +Join condition: None + +(175) Project [codegen id : 51] +Output [18]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, d_year#165, d_year#167, hd_income_band_sk#176, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186] +Input [20]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, d_year#165, d_year#167, hd_income_band_sk#174, hd_income_band_sk#176, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, ib_income_band_sk#187] + +(176) ReusedExchange [Reuses operator id: 98] +Output [1]: [ib_income_band_sk#188] + +(177) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [hd_income_band_sk#176] +Right keys [1]: [ib_income_band_sk#188] +Join condition: None + +(178) Project [codegen id : 51] +Output [17]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, d_year#165, d_year#167, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186] +Input [19]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, d_year#165, d_year#167, hd_income_band_sk#176, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, ib_income_band_sk#188] + +(179) ReusedExchange [Reuses operator id: 108] +Output [2]: [i_item_sk#189, i_product_name#190] + +(180) BroadcastHashJoin [codegen id : 51] +Left keys [1]: [ss_item_sk#122] +Right keys [1]: [i_item_sk#189] +Join condition: None + +(181) Project [codegen id : 51] +Output [18]: [ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, d_year#165, d_year#167, s_store_name#156, s_zip#157, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, i_item_sk#189, i_product_name#190] +Input [19]: [ss_item_sk#122, ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, s_store_name#156, s_zip#157, d_year#165, d_year#167, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, i_item_sk#189, i_product_name#190] + +(182) HashAggregate [codegen id : 51] +Input [18]: [ss_wholesale_cost#130, ss_list_price#131, ss_coupon_amt#132, d_year#153, d_year#165, d_year#167, s_store_name#156, s_zip#157, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, i_item_sk#189, i_product_name#190] +Keys [15]: [i_product_name#190, i_item_sk#189, s_store_name#156, s_zip#157, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, d_year#153, d_year#165, d_year#167] +Functions [4]: [partial_count(1), partial_sum(UnscaledValue(ss_wholesale_cost#130)), partial_sum(UnscaledValue(ss_list_price#131)), partial_sum(UnscaledValue(ss_coupon_amt#132))] +Aggregate Attributes [4]: [count#191, sum#192, sum#193, sum#194] +Results [19]: [i_product_name#190, i_item_sk#189, s_store_name#156, s_zip#157, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, d_year#153, d_year#165, d_year#167, count#195, sum#196, sum#197, sum#198] + +(183) HashAggregate [codegen id : 51] +Input [19]: [i_product_name#190, i_item_sk#189, s_store_name#156, s_zip#157, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, d_year#153, d_year#165, d_year#167, count#195, sum#196, sum#197, sum#198] +Keys [15]: [i_product_name#190, i_item_sk#189, s_store_name#156, s_zip#157, ca_street_number#178, ca_street_name#179, ca_city#180, ca_zip#181, ca_street_number#183, ca_street_name#184, ca_city#185, ca_zip#186, d_year#153, d_year#165, d_year#167] +Functions [4]: [count(1), sum(UnscaledValue(ss_wholesale_cost#130)), sum(UnscaledValue(ss_list_price#131)), sum(UnscaledValue(ss_coupon_amt#132))] +Aggregate Attributes [4]: [count(1)#199, sum(UnscaledValue(ss_wholesale_cost#130))#200, sum(UnscaledValue(ss_list_price#131))#201, sum(UnscaledValue(ss_coupon_amt#132))#202] +Results [8]: [i_item_sk#189 AS item_sk#203, s_store_name#156 AS store_name#204, s_zip#157 AS store_zip#205, d_year#153 AS syear#206, count(1)#199 AS cnt#207, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#130))#200,17,2) AS s1#208, MakeDecimal(sum(UnscaledValue(ss_list_price#131))#201,17,2) AS s2#209, MakeDecimal(sum(UnscaledValue(ss_coupon_amt#132))#202,17,2) AS s3#210] + +(184) Exchange +Input [8]: [item_sk#203, store_name#204, store_zip#205, syear#206, cnt#207, s1#208, s2#209, s3#210] +Arguments: hashpartitioning(item_sk#203, store_name#204, store_zip#205, 5), ENSURE_REQUIREMENTS, [id=#211] + +(185) Sort [codegen id : 52] +Input [8]: [item_sk#203, store_name#204, store_zip#205, syear#206, cnt#207, s1#208, s2#209, s3#210] +Arguments: [item_sk#203 ASC NULLS FIRST, store_name#204 ASC NULLS FIRST, store_zip#205 ASC NULLS FIRST], false, 0 + +(186) SortMergeJoin [codegen id : 53] +Left keys [3]: [item_sk#105, store_name#106, store_zip#107] +Right keys [3]: [item_sk#203, store_name#204, store_zip#205] +Join condition: (cnt#207 <= cnt#117) + +(187) Project [codegen id : 53] +Output [21]: [product_name#104, store_name#106, store_zip#107, b_street_number#108, b_streen_name#109, b_city#110, b_zip#111, c_street_number#112, c_street_name#113, c_city#114, c_zip#115, syear#116, cnt#117, s1#118, s2#119, s3#120, s1#208, s2#209, s3#210, syear#206, cnt#207] +Input [25]: [product_name#104, item_sk#105, store_name#106, store_zip#107, b_street_number#108, b_streen_name#109, b_city#110, b_zip#111, c_street_number#112, c_street_name#113, c_city#114, c_zip#115, syear#116, cnt#117, s1#118, s2#119, s3#120, item_sk#203, store_name#204, store_zip#205, syear#206, cnt#207, s1#208, s2#209, s3#210] + +(188) Exchange +Input [21]: [product_name#104, store_name#106, store_zip#107, b_street_number#108, b_streen_name#109, b_city#110, b_zip#111, c_street_number#112, c_street_name#113, c_city#114, c_zip#115, syear#116, cnt#117, s1#118, s2#119, s3#120, s1#208, s2#209, s3#210, syear#206, cnt#207] +Arguments: rangepartitioning(product_name#104 ASC NULLS FIRST, store_name#106 ASC NULLS FIRST, cnt#207 ASC NULLS FIRST, s1#118 ASC NULLS FIRST, s1#208 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#212] + +(189) Sort [codegen id : 54] +Input [21]: [product_name#104, store_name#106, store_zip#107, b_street_number#108, b_streen_name#109, b_city#110, b_zip#111, c_street_number#112, c_street_name#113, c_city#114, c_zip#115, syear#116, cnt#117, s1#118, s2#119, s3#120, s1#208, s2#209, s3#210, syear#206, cnt#207] +Arguments: [product_name#104 ASC NULLS FIRST, store_name#106 ASC NULLS FIRST, cnt#207 ASC NULLS FIRST, s1#118 ASC NULLS FIRST, s1#208 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#12 IN dynamicpruning#13 +ReusedExchange (190) + + +(190) ReusedExchange [Reuses operator id: 38] +Output [2]: [d_date_sk#42, d_year#43] + +Subquery:2 Hosting operator id = 115 Hosting Expression = ss_sold_date_sk#133 IN dynamicpruning#134 +ReusedExchange (191) + + +(191) ReusedExchange [Reuses operator id: 137] +Output [2]: [d_date_sk#152, d_year#153] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64/simplified.txt new file mode 100644 index 0000000000000..2b44e5ed9d4de --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q64/simplified.txt @@ -0,0 +1,289 @@ +WholeStageCodegen (54) + Sort [product_name,store_name,cnt,s1,s1] + InputAdapter + Exchange [product_name,store_name,cnt,s1,s1] #1 + WholeStageCodegen (53) + Project [product_name,store_name,store_zip,b_street_number,b_streen_name,b_city,b_zip,c_street_number,c_street_name,c_city,c_zip,syear,cnt,s1,s2,s3,s1,s2,s3,syear,cnt] + SortMergeJoin [item_sk,store_name,store_zip,item_sk,store_name,store_zip,cnt,cnt] + InputAdapter + WholeStageCodegen (26) + Sort [item_sk,store_name,store_zip] + InputAdapter + Exchange [item_sk,store_name,store_zip] #2 + WholeStageCodegen (25) + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,count,sum,sum,sum] [count(1),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_list_price)),sum(UnscaledValue(ss_coupon_amt)),product_name,item_sk,store_name,store_zip,b_street_number,b_streen_name,b_city,b_zip,c_street_number,c_street_name,c_city,c_zip,syear,cnt,s1,s2,s3,count,sum,sum,sum] + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,ss_wholesale_cost,ss_list_price,ss_coupon_amt] [count,sum,sum,sum,count,sum,sum,sum] + Project [ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,d_year,d_year,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,i_item_sk,i_product_name] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,hd_income_band_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk,cd_marital_status,cd_marital_status] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,cd_marital_status] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [c_first_shipto_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,d_year] + BroadcastHashJoin [c_first_sales_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SortMergeJoin [ss_item_sk,cs_item_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #3 + WholeStageCodegen (2) + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_ticket_number,ss_store_sk,ss_customer_sk,ss_cdemo_sk,ss_promo_sk,ss_hdemo_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #5 + Project [sr_item_sk,sr_ticket_number] + Filter [sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + WholeStageCodegen (9) + Sort [cs_item_sk] + Project [cs_item_sk] + Filter [sum(cs_ext_list_price),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true))] + HashAggregate [cs_item_sk,sum,sum,isEmpty] [sum(UnscaledValue(cs_ext_list_price)),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true)),sum(cs_ext_list_price),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true)),sum,sum,isEmpty] + InputAdapter + Exchange [cs_item_sk] #6 + WholeStageCodegen (8) + HashAggregate [cs_item_sk,cs_ext_list_price,cr_refunded_cash,cr_reversed_charge,cr_store_credit] [sum,sum,isEmpty,sum,sum,isEmpty] + Project [cs_item_sk,cs_ext_list_price,cr_refunded_cash,cr_reversed_charge,cr_store_credit] + SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] + InputAdapter + WholeStageCodegen (5) + Sort [cs_item_sk,cs_order_number] + InputAdapter + Exchange [cs_item_sk,cs_order_number] #7 + WholeStageCodegen (4) + Project [cs_item_sk,cs_order_number,cs_ext_list_price] + Filter [cs_item_sk,cs_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_ext_list_price,cs_sold_date_sk] + InputAdapter + WholeStageCodegen (7) + Sort [cr_item_sk,cr_order_number] + InputAdapter + Exchange [cr_item_sk,cr_order_number] #8 + WholeStageCodegen (6) + Project [cr_item_sk,cr_order_number,cr_refunded_cash,cr_reversed_charge,cr_store_credit] + Filter [cr_item_sk,cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_refunded_cash,cr_reversed_charge,cr_store_credit,cr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (10) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (11) + Filter [s_store_sk,s_store_name,s_zip] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_name,s_zip] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (12) + Filter [c_customer_sk,c_first_sales_date_sk,c_first_shipto_date_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (13) + Filter [d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + ReusedExchange [d_date_sk,d_year] #11 + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (15) + Filter [cd_demo_sk,cd_marital_status] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status] + InputAdapter + ReusedExchange [cd_demo_sk,cd_marital_status] #12 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (17) + Filter [p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk] + InputAdapter + BroadcastExchange #14 + WholeStageCodegen (18) + Filter [hd_demo_sk,hd_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_income_band_sk] + InputAdapter + ReusedExchange [hd_demo_sk,hd_income_band_sk] #14 + InputAdapter + BroadcastExchange #15 + WholeStageCodegen (20) + Filter [ca_address_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_address [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] + InputAdapter + ReusedExchange [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] #15 + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (22) + Filter [ib_income_band_sk] + ColumnarToRow + InputAdapter + Scan parquet default.income_band [ib_income_band_sk] + InputAdapter + ReusedExchange [ib_income_band_sk] #16 + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (24) + Project [i_item_sk,i_product_name] + Filter [i_current_price,i_color,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price,i_color,i_product_name] + InputAdapter + WholeStageCodegen (52) + Sort [item_sk,store_name,store_zip] + InputAdapter + Exchange [item_sk,store_name,store_zip] #18 + WholeStageCodegen (51) + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,count,sum,sum,sum] [count(1),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_list_price)),sum(UnscaledValue(ss_coupon_amt)),item_sk,store_name,store_zip,syear,cnt,s1,s2,s3,count,sum,sum,sum] + HashAggregate [i_product_name,i_item_sk,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,d_year,d_year,d_year,ss_wholesale_cost,ss_list_price,ss_coupon_amt] [count,sum,sum,sum,count,sum,sum,sum] + Project [ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,d_year,d_year,s_store_name,s_zip,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip,i_item_sk,i_product_name] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [hd_income_band_sk,ib_income_band_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [c_current_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk,ca_street_number,ca_street_name,ca_city,ca_zip] + BroadcastHashJoin [ss_addr_sk,ca_address_sk] + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_addr_sk,d_year,d_year,hd_income_band_sk,hd_income_band_sk] + BroadcastHashJoin [c_current_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,hd_income_band_sk] + BroadcastHashJoin [ss_hdemo_sk,hd_demo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [c_current_cdemo_sk,cd_demo_sk,cd_marital_status,cd_marital_status] + Project [ss_item_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year,cd_marital_status] + BroadcastHashJoin [ss_cdemo_sk,cd_demo_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,d_year,d_year] + BroadcastHashJoin [c_first_shipto_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,d_year] + BroadcastHashJoin [c_first_sales_date_sk,d_date_sk] + Project [ss_item_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] + BroadcastHashJoin [ss_customer_sk,c_customer_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year,s_store_name,s_zip] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SortMergeJoin [ss_item_sk,cs_item_sk] + InputAdapter + WholeStageCodegen (29) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #19 + WholeStageCodegen (28) + Project [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + BroadcastHashJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + BroadcastExchange #20 + WholeStageCodegen (27) + Filter [ss_item_sk,ss_ticket_number,ss_store_sk,ss_customer_sk,ss_cdemo_sk,ss_promo_sk,ss_hdemo_sk,ss_addr_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_cdemo_sk,ss_hdemo_sk,ss_addr_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_wholesale_cost,ss_list_price,ss_coupon_amt,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #21 + Project [sr_item_sk,sr_ticket_number] + Filter [sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + WholeStageCodegen (35) + Sort [cs_item_sk] + Project [cs_item_sk] + Filter [sum(cs_ext_list_price),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true))] + HashAggregate [cs_item_sk,sum,sum,isEmpty] [sum(UnscaledValue(cs_ext_list_price)),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true)),sum(cs_ext_list_price),sum(CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(cast(cr_refunded_cash as decimal(8,2))) + promote_precision(cast(cr_reversed_charge as decimal(8,2)))), DecimalType(8,2), true) as decimal(9,2))) + promote_precision(cast(cr_store_credit as decimal(9,2)))), DecimalType(9,2), true)),sum,sum,isEmpty] + InputAdapter + ReusedExchange [cs_item_sk,sum,sum,isEmpty] #6 + InputAdapter + BroadcastExchange #21 + WholeStageCodegen (36) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + ReusedExchange [s_store_sk,s_store_name,s_zip] #9 + InputAdapter + ReusedExchange [c_customer_sk,c_current_cdemo_sk,c_current_hdemo_sk,c_current_addr_sk,c_first_shipto_date_sk,c_first_sales_date_sk] #10 + InputAdapter + ReusedExchange [d_date_sk,d_year] #11 + InputAdapter + ReusedExchange [d_date_sk,d_year] #11 + InputAdapter + ReusedExchange [cd_demo_sk,cd_marital_status] #12 + InputAdapter + ReusedExchange [cd_demo_sk,cd_marital_status] #12 + InputAdapter + ReusedExchange [p_promo_sk] #13 + InputAdapter + ReusedExchange [hd_demo_sk,hd_income_band_sk] #14 + InputAdapter + ReusedExchange [hd_demo_sk,hd_income_band_sk] #14 + InputAdapter + ReusedExchange [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] #15 + InputAdapter + ReusedExchange [ca_address_sk,ca_street_number,ca_street_name,ca_city,ca_zip] #15 + InputAdapter + ReusedExchange [ib_income_band_sk] #16 + InputAdapter + ReusedExchange [ib_income_band_sk] #16 + InputAdapter + ReusedExchange [i_item_sk,i_product_name] #17 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/explain.txt new file mode 100644 index 0000000000000..af8035e67b061 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/explain.txt @@ -0,0 +1,463 @@ +== Physical Plan == +TakeOrderedAndProject (74) ++- * Filter (73) + +- Window (72) + +- * Sort (71) + +- Exchange (70) + +- Union (69) + :- * HashAggregate (28) + : +- Exchange (27) + : +- * HashAggregate (26) + : +- * Project (25) + : +- * SortMergeJoin Inner (24) + : :- * Sort (18) + : : +- Exchange (17) + : : +- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- * Sort (23) + : +- Exchange (22) + : +- * Filter (21) + : +- * ColumnarToRow (20) + : +- Scan parquet default.item (19) + :- * HashAggregate (33) + : +- Exchange (32) + : +- * HashAggregate (31) + : +- * HashAggregate (30) + : +- ReusedExchange (29) + :- * HashAggregate (38) + : +- Exchange (37) + : +- * HashAggregate (36) + : +- * HashAggregate (35) + : +- ReusedExchange (34) + :- * HashAggregate (43) + : +- Exchange (42) + : +- * HashAggregate (41) + : +- * HashAggregate (40) + : +- ReusedExchange (39) + :- * HashAggregate (48) + : +- Exchange (47) + : +- * HashAggregate (46) + : +- * HashAggregate (45) + : +- ReusedExchange (44) + :- * HashAggregate (53) + : +- Exchange (52) + : +- * HashAggregate (51) + : +- * HashAggregate (50) + : +- ReusedExchange (49) + :- * HashAggregate (58) + : +- Exchange (57) + : +- * HashAggregate (56) + : +- * HashAggregate (55) + : +- ReusedExchange (54) + :- * HashAggregate (63) + : +- Exchange (62) + : +- * HashAggregate (61) + : +- * HashAggregate (60) + : +- ReusedExchange (59) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- * HashAggregate (65) + +- ReusedExchange (64) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 3] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5] +Condition : (isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] + +(6) Filter [codegen id : 1] +Input [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] +Condition : (((isnotnull(d_month_seq#8) AND (d_month_seq#8 >= 1212)) AND (d_month_seq#8 <= 1223)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [4]: [d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] +Input [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] + +(8) BroadcastExchange +Input [4]: [d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 3] +Output [7]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5, d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#13, s_store_id#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#13, s_store_id#14] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#13, s_store_id#14] +Condition : isnotnull(s_store_sk#13) + +(14) BroadcastExchange +Input [2]: [s_store_sk#13, s_store_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#13] +Join condition: None + +(16) Project [codegen id : 3] +Output [7]: [ss_item_sk#1, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_sk#13, s_store_id#14] + +(17) Exchange +Input [7]: [ss_item_sk#1, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#16] + +(18) Sort [codegen id : 4] +Input [7]: [ss_item_sk#1, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.item +Output [5]: [i_item_sk#17, i_brand#18, i_class#19, i_category#20, i_product_name#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 5] +Input [5]: [i_item_sk#17, i_brand#18, i_class#19, i_category#20, i_product_name#21] + +(21) Filter [codegen id : 5] +Input [5]: [i_item_sk#17, i_brand#18, i_class#19, i_category#20, i_product_name#21] +Condition : isnotnull(i_item_sk#17) + +(22) Exchange +Input [5]: [i_item_sk#17, i_brand#18, i_class#19, i_category#20, i_product_name#21] +Arguments: hashpartitioning(i_item_sk#17, 5), ENSURE_REQUIREMENTS, [id=#22] + +(23) Sort [codegen id : 6] +Input [5]: [i_item_sk#17, i_brand#18, i_class#19, i_category#20, i_product_name#21] +Arguments: [i_item_sk#17 ASC NULLS FIRST], false, 0 + +(24) SortMergeJoin [codegen id : 7] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#17] +Join condition: None + +(25) Project [codegen id : 7] +Output [10]: [ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14, i_brand#18, i_class#19, i_category#20, i_product_name#21] +Input [12]: [ss_item_sk#1, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14, i_item_sk#17, i_brand#18, i_class#19, i_category#20, i_product_name#21] + +(26) HashAggregate [codegen id : 7] +Input [10]: [ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14, i_brand#18, i_class#19, i_category#20, i_product_name#21] +Keys [8]: [i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14] +Functions [1]: [partial_sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [2]: [sum#23, isEmpty#24] +Results [10]: [i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sum#25, isEmpty#26] + +(27) Exchange +Input [10]: [i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sum#25, isEmpty#26] +Arguments: hashpartitioning(i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, 5), ENSURE_REQUIREMENTS, [id=#27] + +(28) HashAggregate [codegen id : 8] +Input [10]: [i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sum#25, isEmpty#26] +Keys [8]: [i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#28] +Results [9]: [i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, cast(sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#28 as decimal(38,2)) AS sumsales#29] + +(29) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#30, i_class#31, i_brand#32, i_product_name#33, d_year#34, d_qoy#35, d_moy#36, s_store_id#37, sum#38, isEmpty#39] + +(30) HashAggregate [codegen id : 16] +Input [10]: [i_category#30, i_class#31, i_brand#32, i_product_name#33, d_year#34, d_qoy#35, d_moy#36, s_store_id#37, sum#38, isEmpty#39] +Keys [8]: [i_category#30, i_class#31, i_brand#32, i_product_name#33, d_year#34, d_qoy#35, d_moy#36, s_store_id#37] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#40 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#41 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#40 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#41 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#42] +Results [8]: [i_category#30, i_class#31, i_brand#32, i_product_name#33, d_year#34, d_qoy#35, d_moy#36, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#40 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#41 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#42 AS sumsales#43] + +(31) HashAggregate [codegen id : 16] +Input [8]: [i_category#30, i_class#31, i_brand#32, i_product_name#33, d_year#34, d_qoy#35, d_moy#36, sumsales#43] +Keys [7]: [i_category#30, i_class#31, i_brand#32, i_product_name#33, d_year#34, d_qoy#35, d_moy#36] +Functions [1]: [partial_sum(sumsales#43)] +Aggregate Attributes [2]: [sum#44, isEmpty#45] +Results [9]: [i_category#30, i_class#31, i_brand#32, i_product_name#33, d_year#34, d_qoy#35, d_moy#36, sum#46, isEmpty#47] + +(32) Exchange +Input [9]: [i_category#30, i_class#31, i_brand#32, i_product_name#33, d_year#34, d_qoy#35, d_moy#36, sum#46, isEmpty#47] +Arguments: hashpartitioning(i_category#30, i_class#31, i_brand#32, i_product_name#33, d_year#34, d_qoy#35, d_moy#36, 5), ENSURE_REQUIREMENTS, [id=#48] + +(33) HashAggregate [codegen id : 17] +Input [9]: [i_category#30, i_class#31, i_brand#32, i_product_name#33, d_year#34, d_qoy#35, d_moy#36, sum#46, isEmpty#47] +Keys [7]: [i_category#30, i_class#31, i_brand#32, i_product_name#33, d_year#34, d_qoy#35, d_moy#36] +Functions [1]: [sum(sumsales#43)] +Aggregate Attributes [1]: [sum(sumsales#43)#49] +Results [9]: [i_category#30, i_class#31, i_brand#32, i_product_name#33, d_year#34, d_qoy#35, d_moy#36, null AS s_store_id#50, sum(sumsales#43)#49 AS sumsales#51] + +(34) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#52, i_class#53, i_brand#54, i_product_name#55, d_year#56, d_qoy#57, d_moy#58, s_store_id#59, sum#60, isEmpty#61] + +(35) HashAggregate [codegen id : 25] +Input [10]: [i_category#52, i_class#53, i_brand#54, i_product_name#55, d_year#56, d_qoy#57, d_moy#58, s_store_id#59, sum#60, isEmpty#61] +Keys [8]: [i_category#52, i_class#53, i_brand#54, i_product_name#55, d_year#56, d_qoy#57, d_moy#58, s_store_id#59] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#62 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#63 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#62 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#63 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#64] +Results [7]: [i_category#52, i_class#53, i_brand#54, i_product_name#55, d_year#56, d_qoy#57, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#62 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#63 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#64 AS sumsales#43] + +(36) HashAggregate [codegen id : 25] +Input [7]: [i_category#52, i_class#53, i_brand#54, i_product_name#55, d_year#56, d_qoy#57, sumsales#43] +Keys [6]: [i_category#52, i_class#53, i_brand#54, i_product_name#55, d_year#56, d_qoy#57] +Functions [1]: [partial_sum(sumsales#43)] +Aggregate Attributes [2]: [sum#65, isEmpty#66] +Results [8]: [i_category#52, i_class#53, i_brand#54, i_product_name#55, d_year#56, d_qoy#57, sum#67, isEmpty#68] + +(37) Exchange +Input [8]: [i_category#52, i_class#53, i_brand#54, i_product_name#55, d_year#56, d_qoy#57, sum#67, isEmpty#68] +Arguments: hashpartitioning(i_category#52, i_class#53, i_brand#54, i_product_name#55, d_year#56, d_qoy#57, 5), ENSURE_REQUIREMENTS, [id=#69] + +(38) HashAggregate [codegen id : 26] +Input [8]: [i_category#52, i_class#53, i_brand#54, i_product_name#55, d_year#56, d_qoy#57, sum#67, isEmpty#68] +Keys [6]: [i_category#52, i_class#53, i_brand#54, i_product_name#55, d_year#56, d_qoy#57] +Functions [1]: [sum(sumsales#43)] +Aggregate Attributes [1]: [sum(sumsales#43)#70] +Results [9]: [i_category#52, i_class#53, i_brand#54, i_product_name#55, d_year#56, d_qoy#57, null AS d_moy#71, null AS s_store_id#72, sum(sumsales#43)#70 AS sumsales#73] + +(39) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#74, i_class#75, i_brand#76, i_product_name#77, d_year#78, d_qoy#79, d_moy#80, s_store_id#81, sum#82, isEmpty#83] + +(40) HashAggregate [codegen id : 34] +Input [10]: [i_category#74, i_class#75, i_brand#76, i_product_name#77, d_year#78, d_qoy#79, d_moy#80, s_store_id#81, sum#82, isEmpty#83] +Keys [8]: [i_category#74, i_class#75, i_brand#76, i_product_name#77, d_year#78, d_qoy#79, d_moy#80, s_store_id#81] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#84 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#85 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#84 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#85 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#86] +Results [6]: [i_category#74, i_class#75, i_brand#76, i_product_name#77, d_year#78, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#84 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#85 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#86 AS sumsales#43] + +(41) HashAggregate [codegen id : 34] +Input [6]: [i_category#74, i_class#75, i_brand#76, i_product_name#77, d_year#78, sumsales#43] +Keys [5]: [i_category#74, i_class#75, i_brand#76, i_product_name#77, d_year#78] +Functions [1]: [partial_sum(sumsales#43)] +Aggregate Attributes [2]: [sum#87, isEmpty#88] +Results [7]: [i_category#74, i_class#75, i_brand#76, i_product_name#77, d_year#78, sum#89, isEmpty#90] + +(42) Exchange +Input [7]: [i_category#74, i_class#75, i_brand#76, i_product_name#77, d_year#78, sum#89, isEmpty#90] +Arguments: hashpartitioning(i_category#74, i_class#75, i_brand#76, i_product_name#77, d_year#78, 5), ENSURE_REQUIREMENTS, [id=#91] + +(43) HashAggregate [codegen id : 35] +Input [7]: [i_category#74, i_class#75, i_brand#76, i_product_name#77, d_year#78, sum#89, isEmpty#90] +Keys [5]: [i_category#74, i_class#75, i_brand#76, i_product_name#77, d_year#78] +Functions [1]: [sum(sumsales#43)] +Aggregate Attributes [1]: [sum(sumsales#43)#92] +Results [9]: [i_category#74, i_class#75, i_brand#76, i_product_name#77, d_year#78, null AS d_qoy#93, null AS d_moy#94, null AS s_store_id#95, sum(sumsales#43)#92 AS sumsales#96] + +(44) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#97, i_class#98, i_brand#99, i_product_name#100, d_year#101, d_qoy#102, d_moy#103, s_store_id#104, sum#105, isEmpty#106] + +(45) HashAggregate [codegen id : 43] +Input [10]: [i_category#97, i_class#98, i_brand#99, i_product_name#100, d_year#101, d_qoy#102, d_moy#103, s_store_id#104, sum#105, isEmpty#106] +Keys [8]: [i_category#97, i_class#98, i_brand#99, i_product_name#100, d_year#101, d_qoy#102, d_moy#103, s_store_id#104] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#107 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#108 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#107 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#108 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#109] +Results [5]: [i_category#97, i_class#98, i_brand#99, i_product_name#100, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#107 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#108 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#109 AS sumsales#43] + +(46) HashAggregate [codegen id : 43] +Input [5]: [i_category#97, i_class#98, i_brand#99, i_product_name#100, sumsales#43] +Keys [4]: [i_category#97, i_class#98, i_brand#99, i_product_name#100] +Functions [1]: [partial_sum(sumsales#43)] +Aggregate Attributes [2]: [sum#110, isEmpty#111] +Results [6]: [i_category#97, i_class#98, i_brand#99, i_product_name#100, sum#112, isEmpty#113] + +(47) Exchange +Input [6]: [i_category#97, i_class#98, i_brand#99, i_product_name#100, sum#112, isEmpty#113] +Arguments: hashpartitioning(i_category#97, i_class#98, i_brand#99, i_product_name#100, 5), ENSURE_REQUIREMENTS, [id=#114] + +(48) HashAggregate [codegen id : 44] +Input [6]: [i_category#97, i_class#98, i_brand#99, i_product_name#100, sum#112, isEmpty#113] +Keys [4]: [i_category#97, i_class#98, i_brand#99, i_product_name#100] +Functions [1]: [sum(sumsales#43)] +Aggregate Attributes [1]: [sum(sumsales#43)#115] +Results [9]: [i_category#97, i_class#98, i_brand#99, i_product_name#100, null AS d_year#116, null AS d_qoy#117, null AS d_moy#118, null AS s_store_id#119, sum(sumsales#43)#115 AS sumsales#120] + +(49) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#121, i_class#122, i_brand#123, i_product_name#124, d_year#125, d_qoy#126, d_moy#127, s_store_id#128, sum#129, isEmpty#130] + +(50) HashAggregate [codegen id : 52] +Input [10]: [i_category#121, i_class#122, i_brand#123, i_product_name#124, d_year#125, d_qoy#126, d_moy#127, s_store_id#128, sum#129, isEmpty#130] +Keys [8]: [i_category#121, i_class#122, i_brand#123, i_product_name#124, d_year#125, d_qoy#126, d_moy#127, s_store_id#128] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#131 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#132 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#131 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#132 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#133] +Results [4]: [i_category#121, i_class#122, i_brand#123, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#131 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#132 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#133 AS sumsales#43] + +(51) HashAggregate [codegen id : 52] +Input [4]: [i_category#121, i_class#122, i_brand#123, sumsales#43] +Keys [3]: [i_category#121, i_class#122, i_brand#123] +Functions [1]: [partial_sum(sumsales#43)] +Aggregate Attributes [2]: [sum#134, isEmpty#135] +Results [5]: [i_category#121, i_class#122, i_brand#123, sum#136, isEmpty#137] + +(52) Exchange +Input [5]: [i_category#121, i_class#122, i_brand#123, sum#136, isEmpty#137] +Arguments: hashpartitioning(i_category#121, i_class#122, i_brand#123, 5), ENSURE_REQUIREMENTS, [id=#138] + +(53) HashAggregate [codegen id : 53] +Input [5]: [i_category#121, i_class#122, i_brand#123, sum#136, isEmpty#137] +Keys [3]: [i_category#121, i_class#122, i_brand#123] +Functions [1]: [sum(sumsales#43)] +Aggregate Attributes [1]: [sum(sumsales#43)#139] +Results [9]: [i_category#121, i_class#122, i_brand#123, null AS i_product_name#140, null AS d_year#141, null AS d_qoy#142, null AS d_moy#143, null AS s_store_id#144, sum(sumsales#43)#139 AS sumsales#145] + +(54) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sum#154, isEmpty#155] + +(55) HashAggregate [codegen id : 61] +Input [10]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153, sum#154, isEmpty#155] +Keys [8]: [i_category#146, i_class#147, i_brand#148, i_product_name#149, d_year#150, d_qoy#151, d_moy#152, s_store_id#153] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#156 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#157 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#156 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#157 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#158] +Results [3]: [i_category#146, i_class#147, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#156 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#157 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#158 AS sumsales#43] + +(56) HashAggregate [codegen id : 61] +Input [3]: [i_category#146, i_class#147, sumsales#43] +Keys [2]: [i_category#146, i_class#147] +Functions [1]: [partial_sum(sumsales#43)] +Aggregate Attributes [2]: [sum#159, isEmpty#160] +Results [4]: [i_category#146, i_class#147, sum#161, isEmpty#162] + +(57) Exchange +Input [4]: [i_category#146, i_class#147, sum#161, isEmpty#162] +Arguments: hashpartitioning(i_category#146, i_class#147, 5), ENSURE_REQUIREMENTS, [id=#163] + +(58) HashAggregate [codegen id : 62] +Input [4]: [i_category#146, i_class#147, sum#161, isEmpty#162] +Keys [2]: [i_category#146, i_class#147] +Functions [1]: [sum(sumsales#43)] +Aggregate Attributes [1]: [sum(sumsales#43)#164] +Results [9]: [i_category#146, i_class#147, null AS i_brand#165, null AS i_product_name#166, null AS d_year#167, null AS d_qoy#168, null AS d_moy#169, null AS s_store_id#170, sum(sumsales#43)#164 AS sumsales#171] + +(59) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#172, i_class#173, i_brand#174, i_product_name#175, d_year#176, d_qoy#177, d_moy#178, s_store_id#179, sum#180, isEmpty#181] + +(60) HashAggregate [codegen id : 70] +Input [10]: [i_category#172, i_class#173, i_brand#174, i_product_name#175, d_year#176, d_qoy#177, d_moy#178, s_store_id#179, sum#180, isEmpty#181] +Keys [8]: [i_category#172, i_class#173, i_brand#174, i_product_name#175, d_year#176, d_qoy#177, d_moy#178, s_store_id#179] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#182 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#183 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#182 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#183 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#184] +Results [2]: [i_category#172, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#182 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#183 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#184 AS sumsales#43] + +(61) HashAggregate [codegen id : 70] +Input [2]: [i_category#172, sumsales#43] +Keys [1]: [i_category#172] +Functions [1]: [partial_sum(sumsales#43)] +Aggregate Attributes [2]: [sum#185, isEmpty#186] +Results [3]: [i_category#172, sum#187, isEmpty#188] + +(62) Exchange +Input [3]: [i_category#172, sum#187, isEmpty#188] +Arguments: hashpartitioning(i_category#172, 5), ENSURE_REQUIREMENTS, [id=#189] + +(63) HashAggregate [codegen id : 71] +Input [3]: [i_category#172, sum#187, isEmpty#188] +Keys [1]: [i_category#172] +Functions [1]: [sum(sumsales#43)] +Aggregate Attributes [1]: [sum(sumsales#43)#190] +Results [9]: [i_category#172, null AS i_class#191, null AS i_brand#192, null AS i_product_name#193, null AS d_year#194, null AS d_qoy#195, null AS d_moy#196, null AS s_store_id#197, sum(sumsales#43)#190 AS sumsales#198] + +(64) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#199, i_class#200, i_brand#201, i_product_name#202, d_year#203, d_qoy#204, d_moy#205, s_store_id#206, sum#207, isEmpty#208] + +(65) HashAggregate [codegen id : 79] +Input [10]: [i_category#199, i_class#200, i_brand#201, i_product_name#202, d_year#203, d_qoy#204, d_moy#205, s_store_id#206, sum#207, isEmpty#208] +Keys [8]: [i_category#199, i_class#200, i_brand#201, i_product_name#202, d_year#203, d_qoy#204, d_moy#205, s_store_id#206] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#209 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#210 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#209 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#210 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#211] +Results [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#209 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#210 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#211 AS sumsales#43] + +(66) HashAggregate [codegen id : 79] +Input [1]: [sumsales#43] +Keys: [] +Functions [1]: [partial_sum(sumsales#43)] +Aggregate Attributes [2]: [sum#212, isEmpty#213] +Results [2]: [sum#214, isEmpty#215] + +(67) Exchange +Input [2]: [sum#214, isEmpty#215] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#216] + +(68) HashAggregate [codegen id : 80] +Input [2]: [sum#214, isEmpty#215] +Keys: [] +Functions [1]: [sum(sumsales#43)] +Aggregate Attributes [1]: [sum(sumsales#43)#217] +Results [9]: [null AS i_category#218, null AS i_class#219, null AS i_brand#220, null AS i_product_name#221, null AS d_year#222, null AS d_qoy#223, null AS d_moy#224, null AS s_store_id#225, sum(sumsales#43)#217 AS sumsales#226] + +(69) Union + +(70) Exchange +Input [9]: [i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sumsales#29] +Arguments: hashpartitioning(i_category#20, 5), ENSURE_REQUIREMENTS, [id=#227] + +(71) Sort [codegen id : 81] +Input [9]: [i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sumsales#29] +Arguments: [i_category#20 ASC NULLS FIRST, sumsales#29 DESC NULLS LAST], false, 0 + +(72) Window +Input [9]: [i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sumsales#29] +Arguments: [rank(sumsales#29) windowspecdefinition(i_category#20, sumsales#29 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#228], [i_category#20], [sumsales#29 DESC NULLS LAST] + +(73) Filter [codegen id : 82] +Input [10]: [i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sumsales#29, rk#228] +Condition : (rk#228 <= 100) + +(74) TakeOrderedAndProject +Input [10]: [i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sumsales#29, rk#228] +Arguments: 100, [i_category#20 ASC NULLS FIRST, i_class#19 ASC NULLS FIRST, i_brand#18 ASC NULLS FIRST, i_product_name#21 ASC NULLS FIRST, d_year#9 ASC NULLS FIRST, d_qoy#11 ASC NULLS FIRST, d_moy#10 ASC NULLS FIRST, s_store_id#14 ASC NULLS FIRST, sumsales#29 ASC NULLS FIRST, rk#228 ASC NULLS FIRST], [i_category#20, i_class#19, i_brand#18, i_product_name#21, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sumsales#29, rk#228] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (75) + + +(75) ReusedExchange [Reuses operator id: 8] +Output [4]: [d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/simplified.txt new file mode 100644 index 0000000000000..a3354d7b32d61 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a.sf100/simplified.txt @@ -0,0 +1,131 @@ +TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,rk] + WholeStageCodegen (82) + Filter [rk] + InputAdapter + Window [sumsales,i_category] + WholeStageCodegen (81) + Sort [i_category,sumsales] + InputAdapter + Exchange [i_category] #1 + Union + WholeStageCodegen (8) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id] #2 + WholeStageCodegen (7) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,ss_sales_price,ss_quantity] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,d_year,d_moy,d_qoy,s_store_id,i_brand,i_class,i_category,i_product_name] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #3 + WholeStageCodegen (3) + Project [ss_item_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy,s_store_id] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy,d_qoy] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk,d_year,d_moy,d_qoy] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq,d_year,d_moy,d_qoy] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + InputAdapter + WholeStageCodegen (6) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #6 + WholeStageCodegen (5) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_product_name] + WholeStageCodegen (17) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,sum,isEmpty] [sum(sumsales),s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy] #7 + WholeStageCodegen (16) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #8 + WholeStageCodegen (26) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,sum,isEmpty] [sum(sumsales),d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy] #9 + WholeStageCodegen (25) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #8 + WholeStageCodegen (35) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,sum,isEmpty] [sum(sumsales),d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand,i_product_name,d_year] #10 + WholeStageCodegen (34) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #8 + WholeStageCodegen (44) + HashAggregate [i_category,i_class,i_brand,i_product_name,sum,isEmpty] [sum(sumsales),d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand,i_product_name] #11 + WholeStageCodegen (43) + HashAggregate [i_category,i_class,i_brand,i_product_name,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #8 + WholeStageCodegen (53) + HashAggregate [i_category,i_class,i_brand,sum,isEmpty] [sum(sumsales),i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand] #12 + WholeStageCodegen (52) + HashAggregate [i_category,i_class,i_brand,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #8 + WholeStageCodegen (62) + HashAggregate [i_category,i_class,sum,isEmpty] [sum(sumsales),i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class] #13 + WholeStageCodegen (61) + HashAggregate [i_category,i_class,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #8 + WholeStageCodegen (71) + HashAggregate [i_category,sum,isEmpty] [sum(sumsales),i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category] #14 + WholeStageCodegen (70) + HashAggregate [i_category,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #8 + WholeStageCodegen (80) + HashAggregate [sum,isEmpty] [sum(sumsales),i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange #15 + WholeStageCodegen (79) + HashAggregate [sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #8 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/explain.txt new file mode 100644 index 0000000000000..e10a5ea0aff0b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/explain.txt @@ -0,0 +1,448 @@ +== Physical Plan == +TakeOrderedAndProject (71) ++- * Filter (70) + +- Window (69) + +- * Sort (68) + +- Exchange (67) + +- Union (66) + :- * HashAggregate (25) + : +- Exchange (24) + : +- * HashAggregate (23) + : +- * Project (22) + : +- * BroadcastHashJoin Inner BuildRight (21) + : :- * Project (16) + : : +- * BroadcastHashJoin Inner BuildRight (15) + : : :- * Project (10) + : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : :- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- BroadcastExchange (8) + : : : +- * Project (7) + : : : +- * Filter (6) + : : : +- * ColumnarToRow (5) + : : : +- Scan parquet default.date_dim (4) + : : +- BroadcastExchange (14) + : : +- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (20) + : +- * Filter (19) + : +- * ColumnarToRow (18) + : +- Scan parquet default.item (17) + :- * HashAggregate (30) + : +- Exchange (29) + : +- * HashAggregate (28) + : +- * HashAggregate (27) + : +- ReusedExchange (26) + :- * HashAggregate (35) + : +- Exchange (34) + : +- * HashAggregate (33) + : +- * HashAggregate (32) + : +- ReusedExchange (31) + :- * HashAggregate (40) + : +- Exchange (39) + : +- * HashAggregate (38) + : +- * HashAggregate (37) + : +- ReusedExchange (36) + :- * HashAggregate (45) + : +- Exchange (44) + : +- * HashAggregate (43) + : +- * HashAggregate (42) + : +- ReusedExchange (41) + :- * HashAggregate (50) + : +- Exchange (49) + : +- * HashAggregate (48) + : +- * HashAggregate (47) + : +- ReusedExchange (46) + :- * HashAggregate (55) + : +- Exchange (54) + : +- * HashAggregate (53) + : +- * HashAggregate (52) + : +- ReusedExchange (51) + :- * HashAggregate (60) + : +- Exchange (59) + : +- * HashAggregate (58) + : +- * HashAggregate (57) + : +- ReusedExchange (56) + +- * HashAggregate (65) + +- Exchange (64) + +- * HashAggregate (63) + +- * HashAggregate (62) + +- ReusedExchange (61) + + +(1) Scan parquet default.store_sales +Output [5]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#5), dynamicpruningexpression(ss_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5] + +(3) Filter [codegen id : 4] +Input [5]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5] +Condition : (isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) + +(4) Scan parquet default.date_dim +Output [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] + +(6) Filter [codegen id : 1] +Input [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] +Condition : (((isnotnull(d_month_seq#8) AND (d_month_seq#8 >= 1212)) AND (d_month_seq#8 <= 1223)) AND isnotnull(d_date_sk#7)) + +(7) Project [codegen id : 1] +Output [4]: [d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] +Input [5]: [d_date_sk#7, d_month_seq#8, d_year#9, d_moy#10, d_qoy#11] + +(8) BroadcastExchange +Input [4]: [d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#5] +Right keys [1]: [d_date_sk#7] +Join condition: None + +(10) Project [codegen id : 4] +Output [7]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, ss_sold_date_sk#5, d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] + +(11) Scan parquet default.store +Output [2]: [s_store_sk#13, s_store_id#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#13, s_store_id#14] + +(13) Filter [codegen id : 2] +Input [2]: [s_store_sk#13, s_store_id#14] +Condition : isnotnull(s_store_sk#13) + +(14) BroadcastExchange +Input [2]: [s_store_sk#13, s_store_id#14] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#15] + +(15) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#13] +Join condition: None + +(16) Project [codegen id : 4] +Output [7]: [ss_item_sk#1, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_sk#13, s_store_id#14] + +(17) Scan parquet default.item +Output [5]: [i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 3] +Input [5]: [i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] + +(19) Filter [codegen id : 3] +Input [5]: [i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] +Condition : isnotnull(i_item_sk#16) + +(20) BroadcastExchange +Input [5]: [i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#16] +Join condition: None + +(22) Project [codegen id : 4] +Output [10]: [ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14, i_brand#17, i_class#18, i_category#19, i_product_name#20] +Input [12]: [ss_item_sk#1, ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14, i_item_sk#16, i_brand#17, i_class#18, i_category#19, i_product_name#20] + +(23) HashAggregate [codegen id : 4] +Input [10]: [ss_quantity#3, ss_sales_price#4, d_year#9, d_moy#10, d_qoy#11, s_store_id#14, i_brand#17, i_class#18, i_category#19, i_product_name#20] +Keys [8]: [i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14] +Functions [1]: [partial_sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [2]: [sum#22, isEmpty#23] +Results [10]: [i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sum#24, isEmpty#25] + +(24) Exchange +Input [10]: [i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sum#24, isEmpty#25] +Arguments: hashpartitioning(i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, 5), ENSURE_REQUIREMENTS, [id=#26] + +(25) HashAggregate [codegen id : 5] +Input [10]: [i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sum#24, isEmpty#25] +Keys [8]: [i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#27] +Results [9]: [i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, cast(sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#4 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#3 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#27 as decimal(38,2)) AS sumsales#28] + +(26) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#29, i_class#30, i_brand#31, i_product_name#32, d_year#33, d_qoy#34, d_moy#35, s_store_id#36, sum#37, isEmpty#38] + +(27) HashAggregate [codegen id : 10] +Input [10]: [i_category#29, i_class#30, i_brand#31, i_product_name#32, d_year#33, d_qoy#34, d_moy#35, s_store_id#36, sum#37, isEmpty#38] +Keys [8]: [i_category#29, i_class#30, i_brand#31, i_product_name#32, d_year#33, d_qoy#34, d_moy#35, s_store_id#36] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#39 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#40 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#39 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#40 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#41] +Results [8]: [i_category#29, i_class#30, i_brand#31, i_product_name#32, d_year#33, d_qoy#34, d_moy#35, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#39 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#40 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#41 AS sumsales#42] + +(28) HashAggregate [codegen id : 10] +Input [8]: [i_category#29, i_class#30, i_brand#31, i_product_name#32, d_year#33, d_qoy#34, d_moy#35, sumsales#42] +Keys [7]: [i_category#29, i_class#30, i_brand#31, i_product_name#32, d_year#33, d_qoy#34, d_moy#35] +Functions [1]: [partial_sum(sumsales#42)] +Aggregate Attributes [2]: [sum#43, isEmpty#44] +Results [9]: [i_category#29, i_class#30, i_brand#31, i_product_name#32, d_year#33, d_qoy#34, d_moy#35, sum#45, isEmpty#46] + +(29) Exchange +Input [9]: [i_category#29, i_class#30, i_brand#31, i_product_name#32, d_year#33, d_qoy#34, d_moy#35, sum#45, isEmpty#46] +Arguments: hashpartitioning(i_category#29, i_class#30, i_brand#31, i_product_name#32, d_year#33, d_qoy#34, d_moy#35, 5), ENSURE_REQUIREMENTS, [id=#47] + +(30) HashAggregate [codegen id : 11] +Input [9]: [i_category#29, i_class#30, i_brand#31, i_product_name#32, d_year#33, d_qoy#34, d_moy#35, sum#45, isEmpty#46] +Keys [7]: [i_category#29, i_class#30, i_brand#31, i_product_name#32, d_year#33, d_qoy#34, d_moy#35] +Functions [1]: [sum(sumsales#42)] +Aggregate Attributes [1]: [sum(sumsales#42)#48] +Results [9]: [i_category#29, i_class#30, i_brand#31, i_product_name#32, d_year#33, d_qoy#34, d_moy#35, null AS s_store_id#49, sum(sumsales#42)#48 AS sumsales#50] + +(31) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#51, i_class#52, i_brand#53, i_product_name#54, d_year#55, d_qoy#56, d_moy#57, s_store_id#58, sum#59, isEmpty#60] + +(32) HashAggregate [codegen id : 16] +Input [10]: [i_category#51, i_class#52, i_brand#53, i_product_name#54, d_year#55, d_qoy#56, d_moy#57, s_store_id#58, sum#59, isEmpty#60] +Keys [8]: [i_category#51, i_class#52, i_brand#53, i_product_name#54, d_year#55, d_qoy#56, d_moy#57, s_store_id#58] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#61 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#62 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#61 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#62 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#63] +Results [7]: [i_category#51, i_class#52, i_brand#53, i_product_name#54, d_year#55, d_qoy#56, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#61 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#62 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#63 AS sumsales#42] + +(33) HashAggregate [codegen id : 16] +Input [7]: [i_category#51, i_class#52, i_brand#53, i_product_name#54, d_year#55, d_qoy#56, sumsales#42] +Keys [6]: [i_category#51, i_class#52, i_brand#53, i_product_name#54, d_year#55, d_qoy#56] +Functions [1]: [partial_sum(sumsales#42)] +Aggregate Attributes [2]: [sum#64, isEmpty#65] +Results [8]: [i_category#51, i_class#52, i_brand#53, i_product_name#54, d_year#55, d_qoy#56, sum#66, isEmpty#67] + +(34) Exchange +Input [8]: [i_category#51, i_class#52, i_brand#53, i_product_name#54, d_year#55, d_qoy#56, sum#66, isEmpty#67] +Arguments: hashpartitioning(i_category#51, i_class#52, i_brand#53, i_product_name#54, d_year#55, d_qoy#56, 5), ENSURE_REQUIREMENTS, [id=#68] + +(35) HashAggregate [codegen id : 17] +Input [8]: [i_category#51, i_class#52, i_brand#53, i_product_name#54, d_year#55, d_qoy#56, sum#66, isEmpty#67] +Keys [6]: [i_category#51, i_class#52, i_brand#53, i_product_name#54, d_year#55, d_qoy#56] +Functions [1]: [sum(sumsales#42)] +Aggregate Attributes [1]: [sum(sumsales#42)#69] +Results [9]: [i_category#51, i_class#52, i_brand#53, i_product_name#54, d_year#55, d_qoy#56, null AS d_moy#70, null AS s_store_id#71, sum(sumsales#42)#69 AS sumsales#72] + +(36) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#73, i_class#74, i_brand#75, i_product_name#76, d_year#77, d_qoy#78, d_moy#79, s_store_id#80, sum#81, isEmpty#82] + +(37) HashAggregate [codegen id : 22] +Input [10]: [i_category#73, i_class#74, i_brand#75, i_product_name#76, d_year#77, d_qoy#78, d_moy#79, s_store_id#80, sum#81, isEmpty#82] +Keys [8]: [i_category#73, i_class#74, i_brand#75, i_product_name#76, d_year#77, d_qoy#78, d_moy#79, s_store_id#80] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#83 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#84 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#83 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#84 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#85] +Results [6]: [i_category#73, i_class#74, i_brand#75, i_product_name#76, d_year#77, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#83 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#84 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#85 AS sumsales#42] + +(38) HashAggregate [codegen id : 22] +Input [6]: [i_category#73, i_class#74, i_brand#75, i_product_name#76, d_year#77, sumsales#42] +Keys [5]: [i_category#73, i_class#74, i_brand#75, i_product_name#76, d_year#77] +Functions [1]: [partial_sum(sumsales#42)] +Aggregate Attributes [2]: [sum#86, isEmpty#87] +Results [7]: [i_category#73, i_class#74, i_brand#75, i_product_name#76, d_year#77, sum#88, isEmpty#89] + +(39) Exchange +Input [7]: [i_category#73, i_class#74, i_brand#75, i_product_name#76, d_year#77, sum#88, isEmpty#89] +Arguments: hashpartitioning(i_category#73, i_class#74, i_brand#75, i_product_name#76, d_year#77, 5), ENSURE_REQUIREMENTS, [id=#90] + +(40) HashAggregate [codegen id : 23] +Input [7]: [i_category#73, i_class#74, i_brand#75, i_product_name#76, d_year#77, sum#88, isEmpty#89] +Keys [5]: [i_category#73, i_class#74, i_brand#75, i_product_name#76, d_year#77] +Functions [1]: [sum(sumsales#42)] +Aggregate Attributes [1]: [sum(sumsales#42)#91] +Results [9]: [i_category#73, i_class#74, i_brand#75, i_product_name#76, d_year#77, null AS d_qoy#92, null AS d_moy#93, null AS s_store_id#94, sum(sumsales#42)#91 AS sumsales#95] + +(41) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#96, i_class#97, i_brand#98, i_product_name#99, d_year#100, d_qoy#101, d_moy#102, s_store_id#103, sum#104, isEmpty#105] + +(42) HashAggregate [codegen id : 28] +Input [10]: [i_category#96, i_class#97, i_brand#98, i_product_name#99, d_year#100, d_qoy#101, d_moy#102, s_store_id#103, sum#104, isEmpty#105] +Keys [8]: [i_category#96, i_class#97, i_brand#98, i_product_name#99, d_year#100, d_qoy#101, d_moy#102, s_store_id#103] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#106 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#107 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#106 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#107 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#108] +Results [5]: [i_category#96, i_class#97, i_brand#98, i_product_name#99, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#106 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#107 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#108 AS sumsales#42] + +(43) HashAggregate [codegen id : 28] +Input [5]: [i_category#96, i_class#97, i_brand#98, i_product_name#99, sumsales#42] +Keys [4]: [i_category#96, i_class#97, i_brand#98, i_product_name#99] +Functions [1]: [partial_sum(sumsales#42)] +Aggregate Attributes [2]: [sum#109, isEmpty#110] +Results [6]: [i_category#96, i_class#97, i_brand#98, i_product_name#99, sum#111, isEmpty#112] + +(44) Exchange +Input [6]: [i_category#96, i_class#97, i_brand#98, i_product_name#99, sum#111, isEmpty#112] +Arguments: hashpartitioning(i_category#96, i_class#97, i_brand#98, i_product_name#99, 5), ENSURE_REQUIREMENTS, [id=#113] + +(45) HashAggregate [codegen id : 29] +Input [6]: [i_category#96, i_class#97, i_brand#98, i_product_name#99, sum#111, isEmpty#112] +Keys [4]: [i_category#96, i_class#97, i_brand#98, i_product_name#99] +Functions [1]: [sum(sumsales#42)] +Aggregate Attributes [1]: [sum(sumsales#42)#114] +Results [9]: [i_category#96, i_class#97, i_brand#98, i_product_name#99, null AS d_year#115, null AS d_qoy#116, null AS d_moy#117, null AS s_store_id#118, sum(sumsales#42)#114 AS sumsales#119] + +(46) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#120, i_class#121, i_brand#122, i_product_name#123, d_year#124, d_qoy#125, d_moy#126, s_store_id#127, sum#128, isEmpty#129] + +(47) HashAggregate [codegen id : 34] +Input [10]: [i_category#120, i_class#121, i_brand#122, i_product_name#123, d_year#124, d_qoy#125, d_moy#126, s_store_id#127, sum#128, isEmpty#129] +Keys [8]: [i_category#120, i_class#121, i_brand#122, i_product_name#123, d_year#124, d_qoy#125, d_moy#126, s_store_id#127] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#130 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#131 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#130 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#131 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#132] +Results [4]: [i_category#120, i_class#121, i_brand#122, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#130 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#131 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#132 AS sumsales#42] + +(48) HashAggregate [codegen id : 34] +Input [4]: [i_category#120, i_class#121, i_brand#122, sumsales#42] +Keys [3]: [i_category#120, i_class#121, i_brand#122] +Functions [1]: [partial_sum(sumsales#42)] +Aggregate Attributes [2]: [sum#133, isEmpty#134] +Results [5]: [i_category#120, i_class#121, i_brand#122, sum#135, isEmpty#136] + +(49) Exchange +Input [5]: [i_category#120, i_class#121, i_brand#122, sum#135, isEmpty#136] +Arguments: hashpartitioning(i_category#120, i_class#121, i_brand#122, 5), ENSURE_REQUIREMENTS, [id=#137] + +(50) HashAggregate [codegen id : 35] +Input [5]: [i_category#120, i_class#121, i_brand#122, sum#135, isEmpty#136] +Keys [3]: [i_category#120, i_class#121, i_brand#122] +Functions [1]: [sum(sumsales#42)] +Aggregate Attributes [1]: [sum(sumsales#42)#138] +Results [9]: [i_category#120, i_class#121, i_brand#122, null AS i_product_name#139, null AS d_year#140, null AS d_qoy#141, null AS d_moy#142, null AS s_store_id#143, sum(sumsales#42)#138 AS sumsales#144] + +(51) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sum#153, isEmpty#154] + +(52) HashAggregate [codegen id : 40] +Input [10]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152, sum#153, isEmpty#154] +Keys [8]: [i_category#145, i_class#146, i_brand#147, i_product_name#148, d_year#149, d_qoy#150, d_moy#151, s_store_id#152] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#155 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#156 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#155 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#156 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#157] +Results [3]: [i_category#145, i_class#146, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#155 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#156 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#157 AS sumsales#42] + +(53) HashAggregate [codegen id : 40] +Input [3]: [i_category#145, i_class#146, sumsales#42] +Keys [2]: [i_category#145, i_class#146] +Functions [1]: [partial_sum(sumsales#42)] +Aggregate Attributes [2]: [sum#158, isEmpty#159] +Results [4]: [i_category#145, i_class#146, sum#160, isEmpty#161] + +(54) Exchange +Input [4]: [i_category#145, i_class#146, sum#160, isEmpty#161] +Arguments: hashpartitioning(i_category#145, i_class#146, 5), ENSURE_REQUIREMENTS, [id=#162] + +(55) HashAggregate [codegen id : 41] +Input [4]: [i_category#145, i_class#146, sum#160, isEmpty#161] +Keys [2]: [i_category#145, i_class#146] +Functions [1]: [sum(sumsales#42)] +Aggregate Attributes [1]: [sum(sumsales#42)#163] +Results [9]: [i_category#145, i_class#146, null AS i_brand#164, null AS i_product_name#165, null AS d_year#166, null AS d_qoy#167, null AS d_moy#168, null AS s_store_id#169, sum(sumsales#42)#163 AS sumsales#170] + +(56) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#171, i_class#172, i_brand#173, i_product_name#174, d_year#175, d_qoy#176, d_moy#177, s_store_id#178, sum#179, isEmpty#180] + +(57) HashAggregate [codegen id : 46] +Input [10]: [i_category#171, i_class#172, i_brand#173, i_product_name#174, d_year#175, d_qoy#176, d_moy#177, s_store_id#178, sum#179, isEmpty#180] +Keys [8]: [i_category#171, i_class#172, i_brand#173, i_product_name#174, d_year#175, d_qoy#176, d_moy#177, s_store_id#178] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#181 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#182 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#181 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#182 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#183] +Results [2]: [i_category#171, sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#181 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#182 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#183 AS sumsales#42] + +(58) HashAggregate [codegen id : 46] +Input [2]: [i_category#171, sumsales#42] +Keys [1]: [i_category#171] +Functions [1]: [partial_sum(sumsales#42)] +Aggregate Attributes [2]: [sum#184, isEmpty#185] +Results [3]: [i_category#171, sum#186, isEmpty#187] + +(59) Exchange +Input [3]: [i_category#171, sum#186, isEmpty#187] +Arguments: hashpartitioning(i_category#171, 5), ENSURE_REQUIREMENTS, [id=#188] + +(60) HashAggregate [codegen id : 47] +Input [3]: [i_category#171, sum#186, isEmpty#187] +Keys [1]: [i_category#171] +Functions [1]: [sum(sumsales#42)] +Aggregate Attributes [1]: [sum(sumsales#42)#189] +Results [9]: [i_category#171, null AS i_class#190, null AS i_brand#191, null AS i_product_name#192, null AS d_year#193, null AS d_qoy#194, null AS d_moy#195, null AS s_store_id#196, sum(sumsales#42)#189 AS sumsales#197] + +(61) ReusedExchange [Reuses operator id: unknown] +Output [10]: [i_category#198, i_class#199, i_brand#200, i_product_name#201, d_year#202, d_qoy#203, d_moy#204, s_store_id#205, sum#206, isEmpty#207] + +(62) HashAggregate [codegen id : 52] +Input [10]: [i_category#198, i_class#199, i_brand#200, i_product_name#201, d_year#202, d_qoy#203, d_moy#204, s_store_id#205, sum#206, isEmpty#207] +Keys [8]: [i_category#198, i_class#199, i_brand#200, i_product_name#201, d_year#202, d_qoy#203, d_moy#204, s_store_id#205] +Functions [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#208 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#209 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))] +Aggregate Attributes [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#208 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#209 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#210] +Results [1]: [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price#208 as decimal(12,2))) * promote_precision(cast(cast(ss_quantity#209 as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00))#210 AS sumsales#42] + +(63) HashAggregate [codegen id : 52] +Input [1]: [sumsales#42] +Keys: [] +Functions [1]: [partial_sum(sumsales#42)] +Aggregate Attributes [2]: [sum#211, isEmpty#212] +Results [2]: [sum#213, isEmpty#214] + +(64) Exchange +Input [2]: [sum#213, isEmpty#214] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#215] + +(65) HashAggregate [codegen id : 53] +Input [2]: [sum#213, isEmpty#214] +Keys: [] +Functions [1]: [sum(sumsales#42)] +Aggregate Attributes [1]: [sum(sumsales#42)#216] +Results [9]: [null AS i_category#217, null AS i_class#218, null AS i_brand#219, null AS i_product_name#220, null AS d_year#221, null AS d_qoy#222, null AS d_moy#223, null AS s_store_id#224, sum(sumsales#42)#216 AS sumsales#225] + +(66) Union + +(67) Exchange +Input [9]: [i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sumsales#28] +Arguments: hashpartitioning(i_category#19, 5), ENSURE_REQUIREMENTS, [id=#226] + +(68) Sort [codegen id : 54] +Input [9]: [i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sumsales#28] +Arguments: [i_category#19 ASC NULLS FIRST, sumsales#28 DESC NULLS LAST], false, 0 + +(69) Window +Input [9]: [i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sumsales#28] +Arguments: [rank(sumsales#28) windowspecdefinition(i_category#19, sumsales#28 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rk#227], [i_category#19], [sumsales#28 DESC NULLS LAST] + +(70) Filter [codegen id : 55] +Input [10]: [i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sumsales#28, rk#227] +Condition : (rk#227 <= 100) + +(71) TakeOrderedAndProject +Input [10]: [i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sumsales#28, rk#227] +Arguments: 100, [i_category#19 ASC NULLS FIRST, i_class#18 ASC NULLS FIRST, i_brand#17 ASC NULLS FIRST, i_product_name#20 ASC NULLS FIRST, d_year#9 ASC NULLS FIRST, d_qoy#11 ASC NULLS FIRST, d_moy#10 ASC NULLS FIRST, s_store_id#14 ASC NULLS FIRST, sumsales#28 ASC NULLS FIRST, rk#227 ASC NULLS FIRST], [i_category#19, i_class#18, i_brand#17, i_product_name#20, d_year#9, d_qoy#11, d_moy#10, s_store_id#14, sumsales#28, rk#227] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (72) + + +(72) ReusedExchange [Reuses operator id: 8] +Output [4]: [d_date_sk#7, d_year#9, d_moy#10, d_qoy#11] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/simplified.txt new file mode 100644 index 0000000000000..c5735c20728c5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q67a/simplified.txt @@ -0,0 +1,122 @@ +TakeOrderedAndProject [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,rk] + WholeStageCodegen (55) + Filter [rk] + InputAdapter + Window [sumsales,i_category] + WholeStageCodegen (54) + Sort [i_category,sumsales] + InputAdapter + Exchange [i_category] #1 + Union + WholeStageCodegen (5) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id] #2 + WholeStageCodegen (4) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,ss_sales_price,ss_quantity] [sum,isEmpty,sum,isEmpty] + Project [ss_quantity,ss_sales_price,d_year,d_moy,d_qoy,s_store_id,i_brand,i_class,i_category,i_product_name] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy,s_store_id] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,d_year,d_moy,d_qoy] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk,ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_quantity,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year,d_moy,d_qoy] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (1) + Project [d_date_sk,d_year,d_moy,d_qoy] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq,d_year,d_moy,d_qoy] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (3) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand,i_class,i_category,i_product_name] + WholeStageCodegen (11) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,sum,isEmpty] [sum(sumsales),s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy] #6 + WholeStageCodegen (10) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #7 + WholeStageCodegen (17) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,sum,isEmpty] [sum(sumsales),d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy] #8 + WholeStageCodegen (16) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #7 + WholeStageCodegen (23) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,sum,isEmpty] [sum(sumsales),d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand,i_product_name,d_year] #9 + WholeStageCodegen (22) + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #7 + WholeStageCodegen (29) + HashAggregate [i_category,i_class,i_brand,i_product_name,sum,isEmpty] [sum(sumsales),d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand,i_product_name] #10 + WholeStageCodegen (28) + HashAggregate [i_category,i_class,i_brand,i_product_name,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #7 + WholeStageCodegen (35) + HashAggregate [i_category,i_class,i_brand,sum,isEmpty] [sum(sumsales),i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class,i_brand] #11 + WholeStageCodegen (34) + HashAggregate [i_category,i_class,i_brand,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #7 + WholeStageCodegen (41) + HashAggregate [i_category,i_class,sum,isEmpty] [sum(sumsales),i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category,i_class] #12 + WholeStageCodegen (40) + HashAggregate [i_category,i_class,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #7 + WholeStageCodegen (47) + HashAggregate [i_category,sum,isEmpty] [sum(sumsales),i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange [i_category] #13 + WholeStageCodegen (46) + HashAggregate [i_category,sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #7 + WholeStageCodegen (53) + HashAggregate [sum,isEmpty] [sum(sumsales),i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sumsales,sum,isEmpty] + InputAdapter + Exchange #14 + WholeStageCodegen (52) + HashAggregate [sumsales] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] [sum(coalesce(CheckOverflow((promote_precision(cast(ss_sales_price as decimal(12,2))) * promote_precision(cast(cast(ss_quantity as decimal(10,0)) as decimal(12,2)))), DecimalType(18,2), true), 0.00)),sumsales,sum,isEmpty] + InputAdapter + ReusedExchange [i_category,i_class,i_brand,i_product_name,d_year,d_qoy,d_moy,s_store_id,sum,isEmpty] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/explain.txt new file mode 100644 index 0000000000000..35ed13e84c742 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/explain.txt @@ -0,0 +1,363 @@ +== Physical Plan == +TakeOrderedAndProject (60) ++- * Project (59) + +- Window (58) + +- * Sort (57) + +- Exchange (56) + +- * HashAggregate (55) + +- Exchange (54) + +- * HashAggregate (53) + +- Union (52) + :- * HashAggregate (41) + : +- Exchange (40) + : +- * HashAggregate (39) + : +- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (36) + : +- * BroadcastHashJoin LeftSemi BuildRight (35) + : :- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (34) + : +- * Project (33) + : +- * Filter (32) + : +- Window (31) + : +- * Sort (30) + : +- Exchange (29) + : +- * HashAggregate (28) + : +- Exchange (27) + : +- * HashAggregate (26) + : +- * Project (25) + : +- * BroadcastHashJoin Inner BuildRight (24) + : :- * Project (19) + : : +- * BroadcastHashJoin Inner BuildRight (18) + : : :- * Filter (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.store_sales (14) + : : +- ReusedExchange (17) + : +- BroadcastExchange (23) + : +- * Filter (22) + : +- * ColumnarToRow (21) + : +- Scan parquet default.store (20) + :- * HashAggregate (46) + : +- Exchange (45) + : +- * HashAggregate (44) + : +- * HashAggregate (43) + : +- ReusedExchange (42) + +- * HashAggregate (51) + +- Exchange (50) + +- * HashAggregate (49) + +- * HashAggregate (48) + +- ReusedExchange (47) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 9] +Input [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1212)) AND (d_month_seq#6 <= 1223)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 9] +Output [2]: [ss_store_sk#1, ss_net_profit#2] +Input [4]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3, d_date_sk#5] + +(11) Scan parquet default.store +Output [3]: [s_store_sk#8, s_county#9, s_state#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 8] +Input [3]: [s_store_sk#8, s_county#9, s_state#10] + +(13) Filter [codegen id : 8] +Input [3]: [s_store_sk#8, s_county#9, s_state#10] +Condition : isnotnull(s_store_sk#8) + +(14) Scan parquet default.store_sales +Output [3]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#13), dynamicpruningexpression(ss_sold_date_sk#13 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 4] +Input [3]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13] + +(16) Filter [codegen id : 4] +Input [3]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13] +Condition : isnotnull(ss_store_sk#11) + +(17) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#14] + +(18) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#13] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(19) Project [codegen id : 4] +Output [2]: [ss_store_sk#11, ss_net_profit#12] +Input [4]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13, d_date_sk#14] + +(20) Scan parquet default.store +Output [2]: [s_store_sk#15, s_state#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 3] +Input [2]: [s_store_sk#15, s_state#16] + +(22) Filter [codegen id : 3] +Input [2]: [s_store_sk#15, s_state#16] +Condition : isnotnull(s_store_sk#15) + +(23) BroadcastExchange +Input [2]: [s_store_sk#15, s_state#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(24) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#11] +Right keys [1]: [s_store_sk#15] +Join condition: None + +(25) Project [codegen id : 4] +Output [2]: [ss_net_profit#12, s_state#16] +Input [4]: [ss_store_sk#11, ss_net_profit#12, s_store_sk#15, s_state#16] + +(26) HashAggregate [codegen id : 4] +Input [2]: [ss_net_profit#12, s_state#16] +Keys [1]: [s_state#16] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#12))] +Aggregate Attributes [1]: [sum#18] +Results [2]: [s_state#16, sum#19] + +(27) Exchange +Input [2]: [s_state#16, sum#19] +Arguments: hashpartitioning(s_state#16, 5), ENSURE_REQUIREMENTS, [id=#20] + +(28) HashAggregate [codegen id : 5] +Input [2]: [s_state#16, sum#19] +Keys [1]: [s_state#16] +Functions [1]: [sum(UnscaledValue(ss_net_profit#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#12))#21] +Results [3]: [s_state#16 AS s_state#22, s_state#16, MakeDecimal(sum(UnscaledValue(ss_net_profit#12))#21,17,2) AS _w2#23] + +(29) Exchange +Input [3]: [s_state#22, s_state#16, _w2#23] +Arguments: hashpartitioning(s_state#16, 5), ENSURE_REQUIREMENTS, [id=#24] + +(30) Sort [codegen id : 6] +Input [3]: [s_state#22, s_state#16, _w2#23] +Arguments: [s_state#16 ASC NULLS FIRST, _w2#23 DESC NULLS LAST], false, 0 + +(31) Window +Input [3]: [s_state#22, s_state#16, _w2#23] +Arguments: [rank(_w2#23) windowspecdefinition(s_state#16, _w2#23 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS ranking#25], [s_state#16], [_w2#23 DESC NULLS LAST] + +(32) Filter [codegen id : 7] +Input [4]: [s_state#22, s_state#16, _w2#23, ranking#25] +Condition : (ranking#25 <= 5) + +(33) Project [codegen id : 7] +Output [1]: [s_state#22] +Input [4]: [s_state#22, s_state#16, _w2#23, ranking#25] + +(34) BroadcastExchange +Input [1]: [s_state#22] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#26] + +(35) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [s_state#10] +Right keys [1]: [s_state#22] +Join condition: None + +(36) BroadcastExchange +Input [3]: [s_store_sk#8, s_county#9, s_state#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(37) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#8] +Join condition: None + +(38) Project [codegen id : 9] +Output [3]: [ss_net_profit#2, s_county#9, s_state#10] +Input [5]: [ss_store_sk#1, ss_net_profit#2, s_store_sk#8, s_county#9, s_state#10] + +(39) HashAggregate [codegen id : 9] +Input [3]: [ss_net_profit#2, s_county#9, s_state#10] +Keys [2]: [s_state#10, s_county#9] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum#28] +Results [3]: [s_state#10, s_county#9, sum#29] + +(40) Exchange +Input [3]: [s_state#10, s_county#9, sum#29] +Arguments: hashpartitioning(s_state#10, s_county#9, 5), ENSURE_REQUIREMENTS, [id=#30] + +(41) HashAggregate [codegen id : 10] +Input [3]: [s_state#10, s_county#9, sum#29] +Keys [2]: [s_state#10, s_county#9] +Functions [1]: [sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#2))#31] +Results [6]: [cast(MakeDecimal(sum(UnscaledValue(ss_net_profit#2))#31,17,2) as decimal(27,2)) AS total_sum#32, s_state#10, s_county#9, 0 AS g_state#33, 0 AS g_county#34, 0 AS lochierarchy#35] + +(42) ReusedExchange [Reuses operator id: unknown] +Output [3]: [s_state#36, s_county#37, sum#38] + +(43) HashAggregate [codegen id : 20] +Input [3]: [s_state#36, s_county#37, sum#38] +Keys [2]: [s_state#36, s_county#37] +Functions [1]: [sum(UnscaledValue(ss_net_profit#39))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#39))#40] +Results [2]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#39))#40,17,2) AS total_sum#41, s_state#36] + +(44) HashAggregate [codegen id : 20] +Input [2]: [total_sum#41, s_state#36] +Keys [1]: [s_state#36] +Functions [1]: [partial_sum(total_sum#41)] +Aggregate Attributes [2]: [sum#42, isEmpty#43] +Results [3]: [s_state#36, sum#44, isEmpty#45] + +(45) Exchange +Input [3]: [s_state#36, sum#44, isEmpty#45] +Arguments: hashpartitioning(s_state#36, 5), ENSURE_REQUIREMENTS, [id=#46] + +(46) HashAggregate [codegen id : 21] +Input [3]: [s_state#36, sum#44, isEmpty#45] +Keys [1]: [s_state#36] +Functions [1]: [sum(total_sum#41)] +Aggregate Attributes [1]: [sum(total_sum#41)#47] +Results [6]: [sum(total_sum#41)#47 AS total_sum#48, s_state#36, null AS s_county#49, 0 AS g_state#50, 1 AS g_county#51, 1 AS lochierarchy#52] + +(47) ReusedExchange [Reuses operator id: unknown] +Output [3]: [s_state#53, s_county#54, sum#55] + +(48) HashAggregate [codegen id : 31] +Input [3]: [s_state#53, s_county#54, sum#55] +Keys [2]: [s_state#53, s_county#54] +Functions [1]: [sum(UnscaledValue(ss_net_profit#56))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#56))#57] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#56))#57,17,2) AS total_sum#41] + +(49) HashAggregate [codegen id : 31] +Input [1]: [total_sum#41] +Keys: [] +Functions [1]: [partial_sum(total_sum#41)] +Aggregate Attributes [2]: [sum#58, isEmpty#59] +Results [2]: [sum#60, isEmpty#61] + +(50) Exchange +Input [2]: [sum#60, isEmpty#61] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#62] + +(51) HashAggregate [codegen id : 32] +Input [2]: [sum#60, isEmpty#61] +Keys: [] +Functions [1]: [sum(total_sum#41)] +Aggregate Attributes [1]: [sum(total_sum#41)#63] +Results [6]: [sum(total_sum#41)#63 AS total_sum#64, null AS s_state#65, null AS s_county#66, 1 AS g_state#67, 1 AS g_county#68, 2 AS lochierarchy#69] + +(52) Union + +(53) HashAggregate [codegen id : 33] +Input [6]: [total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35] +Keys [6]: [total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35] +Functions: [] +Aggregate Attributes: [] +Results [6]: [total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35] + +(54) Exchange +Input [6]: [total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35] +Arguments: hashpartitioning(total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35, 5), ENSURE_REQUIREMENTS, [id=#70] + +(55) HashAggregate [codegen id : 34] +Input [6]: [total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35] +Keys [6]: [total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35] +Functions: [] +Aggregate Attributes: [] +Results [5]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, CASE WHEN (g_county#34 = 0) THEN s_state#10 END AS _w0#71] + +(56) Exchange +Input [5]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, _w0#71] +Arguments: hashpartitioning(lochierarchy#35, _w0#71, 5), ENSURE_REQUIREMENTS, [id=#72] + +(57) Sort [codegen id : 35] +Input [5]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, _w0#71] +Arguments: [lochierarchy#35 ASC NULLS FIRST, _w0#71 ASC NULLS FIRST, total_sum#32 DESC NULLS LAST], false, 0 + +(58) Window +Input [5]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, _w0#71] +Arguments: [rank(total_sum#32) windowspecdefinition(lochierarchy#35, _w0#71, total_sum#32 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#73], [lochierarchy#35, _w0#71], [total_sum#32 DESC NULLS LAST] + +(59) Project [codegen id : 36] +Output [5]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, rank_within_parent#73] +Input [6]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, _w0#71, rank_within_parent#73] + +(60) TakeOrderedAndProject +Input [5]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, rank_within_parent#73] +Arguments: 100, [lochierarchy#35 DESC NULLS LAST, CASE WHEN (lochierarchy#35 = 0) THEN s_state#10 END ASC NULLS FIRST, rank_within_parent#73 ASC NULLS FIRST], [total_sum#32, s_state#10, s_county#9, lochierarchy#35, rank_within_parent#73] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (61) + + +(61) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + +Subquery:2 Hosting operator id = 14 Hosting Expression = ss_sold_date_sk#13 IN dynamicpruning#4 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/simplified.txt new file mode 100644 index 0000000000000..c1b7cfef5638c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a.sf100/simplified.txt @@ -0,0 +1,102 @@ +TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_county] + WholeStageCodegen (36) + Project [total_sum,s_state,s_county,lochierarchy,rank_within_parent] + InputAdapter + Window [total_sum,lochierarchy,_w0] + WholeStageCodegen (35) + Sort [lochierarchy,_w0,total_sum] + InputAdapter + Exchange [lochierarchy,_w0] #1 + WholeStageCodegen (34) + HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] [_w0] + InputAdapter + Exchange [total_sum,s_state,s_county,g_state,g_county,lochierarchy] #2 + WholeStageCodegen (33) + HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] + InputAdapter + Union + WholeStageCodegen (10) + HashAggregate [s_state,s_county,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,g_state,g_county,lochierarchy,sum] + InputAdapter + Exchange [s_state,s_county] #3 + WholeStageCodegen (9) + HashAggregate [s_state,s_county,ss_net_profit] [sum,sum] + Project [ss_net_profit,s_county,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (8) + BroadcastHashJoin [s_state,s_state] + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county,s_state] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Project [s_state] + Filter [ranking] + InputAdapter + Window [_w2,s_state] + WholeStageCodegen (6) + Sort [s_state,_w2] + InputAdapter + Exchange [s_state] #7 + WholeStageCodegen (5) + HashAggregate [s_state,sum] [sum(UnscaledValue(ss_net_profit)),s_state,_w2,sum] + InputAdapter + Exchange [s_state] #8 + WholeStageCodegen (4) + HashAggregate [s_state,ss_net_profit] [sum,sum] + Project [ss_net_profit,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_net_profit,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (3) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + WholeStageCodegen (21) + HashAggregate [s_state,sum,isEmpty] [sum(total_sum),total_sum,s_county,g_state,g_county,lochierarchy,sum,isEmpty] + InputAdapter + Exchange [s_state] #10 + WholeStageCodegen (20) + HashAggregate [s_state,total_sum] [sum,isEmpty,sum,isEmpty] + HashAggregate [s_state,s_county,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,sum] + InputAdapter + ReusedExchange [s_state,s_county,sum] #11 + WholeStageCodegen (32) + HashAggregate [sum,isEmpty] [sum(total_sum),total_sum,s_state,s_county,g_state,g_county,lochierarchy,sum,isEmpty] + InputAdapter + Exchange #12 + WholeStageCodegen (31) + HashAggregate [total_sum] [sum,isEmpty,sum,isEmpty] + HashAggregate [s_state,s_county,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,sum] + InputAdapter + ReusedExchange [s_state,s_county,sum] #11 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/explain.txt new file mode 100644 index 0000000000000..df0ee68806062 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/explain.txt @@ -0,0 +1,363 @@ +== Physical Plan == +TakeOrderedAndProject (60) ++- * Project (59) + +- Window (58) + +- * Sort (57) + +- Exchange (56) + +- * HashAggregate (55) + +- Exchange (54) + +- * HashAggregate (53) + +- Union (52) + :- * HashAggregate (41) + : +- Exchange (40) + : +- * HashAggregate (39) + : +- * Project (38) + : +- * BroadcastHashJoin Inner BuildRight (37) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.store_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (36) + : +- * BroadcastHashJoin LeftSemi BuildRight (35) + : :- * Filter (13) + : : +- * ColumnarToRow (12) + : : +- Scan parquet default.store (11) + : +- BroadcastExchange (34) + : +- * Project (33) + : +- * Filter (32) + : +- Window (31) + : +- * Sort (30) + : +- Exchange (29) + : +- * HashAggregate (28) + : +- Exchange (27) + : +- * HashAggregate (26) + : +- * Project (25) + : +- * BroadcastHashJoin Inner BuildRight (24) + : :- * Project (22) + : : +- * BroadcastHashJoin Inner BuildRight (21) + : : :- * Filter (16) + : : : +- * ColumnarToRow (15) + : : : +- Scan parquet default.store_sales (14) + : : +- BroadcastExchange (20) + : : +- * Filter (19) + : : +- * ColumnarToRow (18) + : : +- Scan parquet default.store (17) + : +- ReusedExchange (23) + :- * HashAggregate (46) + : +- Exchange (45) + : +- * HashAggregate (44) + : +- * HashAggregate (43) + : +- ReusedExchange (42) + +- * HashAggregate (51) + +- Exchange (50) + +- * HashAggregate (49) + +- * HashAggregate (48) + +- ReusedExchange (47) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 9] +Input [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 9] +Input [3]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1212)) AND (d_month_seq#6 <= 1223)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 9] +Output [2]: [ss_store_sk#1, ss_net_profit#2] +Input [4]: [ss_store_sk#1, ss_net_profit#2, ss_sold_date_sk#3, d_date_sk#5] + +(11) Scan parquet default.store +Output [3]: [s_store_sk#8, s_county#9, s_state#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 8] +Input [3]: [s_store_sk#8, s_county#9, s_state#10] + +(13) Filter [codegen id : 8] +Input [3]: [s_store_sk#8, s_county#9, s_state#10] +Condition : isnotnull(s_store_sk#8) + +(14) Scan parquet default.store_sales +Output [3]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#13), dynamicpruningexpression(ss_sold_date_sk#13 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 4] +Input [3]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13] + +(16) Filter [codegen id : 4] +Input [3]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13] +Condition : isnotnull(ss_store_sk#11) + +(17) Scan parquet default.store +Output [2]: [s_store_sk#14, s_state#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(18) ColumnarToRow [codegen id : 2] +Input [2]: [s_store_sk#14, s_state#15] + +(19) Filter [codegen id : 2] +Input [2]: [s_store_sk#14, s_state#15] +Condition : isnotnull(s_store_sk#14) + +(20) BroadcastExchange +Input [2]: [s_store_sk#14, s_state#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(21) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_store_sk#11] +Right keys [1]: [s_store_sk#14] +Join condition: None + +(22) Project [codegen id : 4] +Output [3]: [ss_net_profit#12, ss_sold_date_sk#13, s_state#15] +Input [5]: [ss_store_sk#11, ss_net_profit#12, ss_sold_date_sk#13, s_store_sk#14, s_state#15] + +(23) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#17] + +(24) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [ss_sold_date_sk#13] +Right keys [1]: [d_date_sk#17] +Join condition: None + +(25) Project [codegen id : 4] +Output [2]: [ss_net_profit#12, s_state#15] +Input [4]: [ss_net_profit#12, ss_sold_date_sk#13, s_state#15, d_date_sk#17] + +(26) HashAggregate [codegen id : 4] +Input [2]: [ss_net_profit#12, s_state#15] +Keys [1]: [s_state#15] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#12))] +Aggregate Attributes [1]: [sum#18] +Results [2]: [s_state#15, sum#19] + +(27) Exchange +Input [2]: [s_state#15, sum#19] +Arguments: hashpartitioning(s_state#15, 5), ENSURE_REQUIREMENTS, [id=#20] + +(28) HashAggregate [codegen id : 5] +Input [2]: [s_state#15, sum#19] +Keys [1]: [s_state#15] +Functions [1]: [sum(UnscaledValue(ss_net_profit#12))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#12))#21] +Results [3]: [s_state#15 AS s_state#22, s_state#15, MakeDecimal(sum(UnscaledValue(ss_net_profit#12))#21,17,2) AS _w2#23] + +(29) Exchange +Input [3]: [s_state#22, s_state#15, _w2#23] +Arguments: hashpartitioning(s_state#15, 5), ENSURE_REQUIREMENTS, [id=#24] + +(30) Sort [codegen id : 6] +Input [3]: [s_state#22, s_state#15, _w2#23] +Arguments: [s_state#15 ASC NULLS FIRST, _w2#23 DESC NULLS LAST], false, 0 + +(31) Window +Input [3]: [s_state#22, s_state#15, _w2#23] +Arguments: [rank(_w2#23) windowspecdefinition(s_state#15, _w2#23 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS ranking#25], [s_state#15], [_w2#23 DESC NULLS LAST] + +(32) Filter [codegen id : 7] +Input [4]: [s_state#22, s_state#15, _w2#23, ranking#25] +Condition : (ranking#25 <= 5) + +(33) Project [codegen id : 7] +Output [1]: [s_state#22] +Input [4]: [s_state#22, s_state#15, _w2#23, ranking#25] + +(34) BroadcastExchange +Input [1]: [s_state#22] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#26] + +(35) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [s_state#10] +Right keys [1]: [s_state#22] +Join condition: None + +(36) BroadcastExchange +Input [3]: [s_store_sk#8, s_county#9, s_state#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(37) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#8] +Join condition: None + +(38) Project [codegen id : 9] +Output [3]: [ss_net_profit#2, s_county#9, s_state#10] +Input [5]: [ss_store_sk#1, ss_net_profit#2, s_store_sk#8, s_county#9, s_state#10] + +(39) HashAggregate [codegen id : 9] +Input [3]: [ss_net_profit#2, s_county#9, s_state#10] +Keys [2]: [s_state#10, s_county#9] +Functions [1]: [partial_sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum#28] +Results [3]: [s_state#10, s_county#9, sum#29] + +(40) Exchange +Input [3]: [s_state#10, s_county#9, sum#29] +Arguments: hashpartitioning(s_state#10, s_county#9, 5), ENSURE_REQUIREMENTS, [id=#30] + +(41) HashAggregate [codegen id : 10] +Input [3]: [s_state#10, s_county#9, sum#29] +Keys [2]: [s_state#10, s_county#9] +Functions [1]: [sum(UnscaledValue(ss_net_profit#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#2))#31] +Results [6]: [cast(MakeDecimal(sum(UnscaledValue(ss_net_profit#2))#31,17,2) as decimal(27,2)) AS total_sum#32, s_state#10, s_county#9, 0 AS g_state#33, 0 AS g_county#34, 0 AS lochierarchy#35] + +(42) ReusedExchange [Reuses operator id: unknown] +Output [3]: [s_state#36, s_county#37, sum#38] + +(43) HashAggregate [codegen id : 20] +Input [3]: [s_state#36, s_county#37, sum#38] +Keys [2]: [s_state#36, s_county#37] +Functions [1]: [sum(UnscaledValue(ss_net_profit#39))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#39))#40] +Results [2]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#39))#40,17,2) AS total_sum#41, s_state#36] + +(44) HashAggregate [codegen id : 20] +Input [2]: [total_sum#41, s_state#36] +Keys [1]: [s_state#36] +Functions [1]: [partial_sum(total_sum#41)] +Aggregate Attributes [2]: [sum#42, isEmpty#43] +Results [3]: [s_state#36, sum#44, isEmpty#45] + +(45) Exchange +Input [3]: [s_state#36, sum#44, isEmpty#45] +Arguments: hashpartitioning(s_state#36, 5), ENSURE_REQUIREMENTS, [id=#46] + +(46) HashAggregate [codegen id : 21] +Input [3]: [s_state#36, sum#44, isEmpty#45] +Keys [1]: [s_state#36] +Functions [1]: [sum(total_sum#41)] +Aggregate Attributes [1]: [sum(total_sum#41)#47] +Results [6]: [sum(total_sum#41)#47 AS total_sum#48, s_state#36, null AS s_county#49, 0 AS g_state#50, 1 AS g_county#51, 1 AS lochierarchy#52] + +(47) ReusedExchange [Reuses operator id: unknown] +Output [3]: [s_state#53, s_county#54, sum#55] + +(48) HashAggregate [codegen id : 31] +Input [3]: [s_state#53, s_county#54, sum#55] +Keys [2]: [s_state#53, s_county#54] +Functions [1]: [sum(UnscaledValue(ss_net_profit#56))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_profit#56))#57] +Results [1]: [MakeDecimal(sum(UnscaledValue(ss_net_profit#56))#57,17,2) AS total_sum#41] + +(49) HashAggregate [codegen id : 31] +Input [1]: [total_sum#41] +Keys: [] +Functions [1]: [partial_sum(total_sum#41)] +Aggregate Attributes [2]: [sum#58, isEmpty#59] +Results [2]: [sum#60, isEmpty#61] + +(50) Exchange +Input [2]: [sum#60, isEmpty#61] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#62] + +(51) HashAggregate [codegen id : 32] +Input [2]: [sum#60, isEmpty#61] +Keys: [] +Functions [1]: [sum(total_sum#41)] +Aggregate Attributes [1]: [sum(total_sum#41)#63] +Results [6]: [sum(total_sum#41)#63 AS total_sum#64, null AS s_state#65, null AS s_county#66, 1 AS g_state#67, 1 AS g_county#68, 2 AS lochierarchy#69] + +(52) Union + +(53) HashAggregate [codegen id : 33] +Input [6]: [total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35] +Keys [6]: [total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35] +Functions: [] +Aggregate Attributes: [] +Results [6]: [total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35] + +(54) Exchange +Input [6]: [total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35] +Arguments: hashpartitioning(total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35, 5), ENSURE_REQUIREMENTS, [id=#70] + +(55) HashAggregate [codegen id : 34] +Input [6]: [total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35] +Keys [6]: [total_sum#32, s_state#10, s_county#9, g_state#33, g_county#34, lochierarchy#35] +Functions: [] +Aggregate Attributes: [] +Results [5]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, CASE WHEN (g_county#34 = 0) THEN s_state#10 END AS _w0#71] + +(56) Exchange +Input [5]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, _w0#71] +Arguments: hashpartitioning(lochierarchy#35, _w0#71, 5), ENSURE_REQUIREMENTS, [id=#72] + +(57) Sort [codegen id : 35] +Input [5]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, _w0#71] +Arguments: [lochierarchy#35 ASC NULLS FIRST, _w0#71 ASC NULLS FIRST, total_sum#32 DESC NULLS LAST], false, 0 + +(58) Window +Input [5]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, _w0#71] +Arguments: [rank(total_sum#32) windowspecdefinition(lochierarchy#35, _w0#71, total_sum#32 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#73], [lochierarchy#35, _w0#71], [total_sum#32 DESC NULLS LAST] + +(59) Project [codegen id : 36] +Output [5]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, rank_within_parent#73] +Input [6]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, _w0#71, rank_within_parent#73] + +(60) TakeOrderedAndProject +Input [5]: [total_sum#32, s_state#10, s_county#9, lochierarchy#35, rank_within_parent#73] +Arguments: 100, [lochierarchy#35 DESC NULLS LAST, CASE WHEN (lochierarchy#35 = 0) THEN s_state#10 END ASC NULLS FIRST, rank_within_parent#73 ASC NULLS FIRST], [total_sum#32, s_state#10, s_county#9, lochierarchy#35, rank_within_parent#73] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (61) + + +(61) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + +Subquery:2 Hosting operator id = 14 Hosting Expression = ss_sold_date_sk#13 IN dynamicpruning#4 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/simplified.txt new file mode 100644 index 0000000000000..cd1e7e69e65d0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q70a/simplified.txt @@ -0,0 +1,102 @@ +TakeOrderedAndProject [lochierarchy,s_state,rank_within_parent,total_sum,s_county] + WholeStageCodegen (36) + Project [total_sum,s_state,s_county,lochierarchy,rank_within_parent] + InputAdapter + Window [total_sum,lochierarchy,_w0] + WholeStageCodegen (35) + Sort [lochierarchy,_w0,total_sum] + InputAdapter + Exchange [lochierarchy,_w0] #1 + WholeStageCodegen (34) + HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] [_w0] + InputAdapter + Exchange [total_sum,s_state,s_county,g_state,g_county,lochierarchy] #2 + WholeStageCodegen (33) + HashAggregate [total_sum,s_state,s_county,g_state,g_county,lochierarchy] + InputAdapter + Union + WholeStageCodegen (10) + HashAggregate [s_state,s_county,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,g_state,g_county,lochierarchy,sum] + InputAdapter + Exchange [s_state,s_county] #3 + WholeStageCodegen (9) + HashAggregate [s_state,s_county,ss_net_profit] [sum,sum] + Project [ss_net_profit,s_county,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (8) + BroadcastHashJoin [s_state,s_state] + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_county,s_state] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + Project [s_state] + Filter [ranking] + InputAdapter + Window [_w2,s_state] + WholeStageCodegen (6) + Sort [s_state,_w2] + InputAdapter + Exchange [s_state] #7 + WholeStageCodegen (5) + HashAggregate [s_state,sum] [sum(UnscaledValue(ss_net_profit)),s_state,_w2,sum] + InputAdapter + Exchange [s_state] #8 + WholeStageCodegen (4) + HashAggregate [s_state,ss_net_profit] [sum,sum] + Project [ss_net_profit,s_state] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_net_profit,ss_sold_date_sk,s_state] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_net_profit,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_state] + InputAdapter + ReusedExchange [d_date_sk] #4 + WholeStageCodegen (21) + HashAggregate [s_state,sum,isEmpty] [sum(total_sum),total_sum,s_county,g_state,g_county,lochierarchy,sum,isEmpty] + InputAdapter + Exchange [s_state] #10 + WholeStageCodegen (20) + HashAggregate [s_state,total_sum] [sum,isEmpty,sum,isEmpty] + HashAggregate [s_state,s_county,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,sum] + InputAdapter + ReusedExchange [s_state,s_county,sum] #11 + WholeStageCodegen (32) + HashAggregate [sum,isEmpty] [sum(total_sum),total_sum,s_state,s_county,g_state,g_county,lochierarchy,sum,isEmpty] + InputAdapter + Exchange #12 + WholeStageCodegen (31) + HashAggregate [total_sum] [sum,isEmpty,sum,isEmpty] + HashAggregate [s_state,s_county,sum] [sum(UnscaledValue(ss_net_profit)),total_sum,sum] + InputAdapter + ReusedExchange [s_state,s_county,sum] #11 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/explain.txt new file mode 100644 index 0000000000000..c22dec073af41 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/explain.txt @@ -0,0 +1,453 @@ +== Physical Plan == +TakeOrderedAndProject (80) ++- * HashAggregate (79) + +- Exchange (78) + +- * HashAggregate (77) + +- * Project (76) + +- * SortMergeJoin LeftOuter (75) + :- * Sort (68) + : +- Exchange (67) + : +- * Project (66) + : +- * BroadcastHashJoin LeftOuter BuildRight (65) + : :- * Project (60) + : : +- * SortMergeJoin Inner (59) + : : :- * Sort (47) + : : : +- Exchange (46) + : : : +- * Project (45) + : : : +- * BroadcastHashJoin Inner BuildRight (44) + : : : :- * Project (32) + : : : : +- * SortMergeJoin Inner (31) + : : : : :- * Sort (25) + : : : : : +- Exchange (24) + : : : : : +- * Project (23) + : : : : : +- * BroadcastHashJoin Inner BuildRight (22) + : : : : : :- * Project (17) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (16) + : : : : : : :- * Project (10) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : : : : :- * Filter (3) + : : : : : : : : +- * ColumnarToRow (2) + : : : : : : : : +- Scan parquet default.catalog_sales (1) + : : : : : : : +- BroadcastExchange (8) + : : : : : : : +- * Project (7) + : : : : : : : +- * Filter (6) + : : : : : : : +- * ColumnarToRow (5) + : : : : : : : +- Scan parquet default.household_demographics (4) + : : : : : : +- BroadcastExchange (15) + : : : : : : +- * Project (14) + : : : : : : +- * Filter (13) + : : : : : : +- * ColumnarToRow (12) + : : : : : : +- Scan parquet default.customer_demographics (11) + : : : : : +- BroadcastExchange (21) + : : : : : +- * Filter (20) + : : : : : +- * ColumnarToRow (19) + : : : : : +- Scan parquet default.date_dim (18) + : : : : +- * Sort (30) + : : : : +- Exchange (29) + : : : : +- * Filter (28) + : : : : +- * ColumnarToRow (27) + : : : : +- Scan parquet default.item (26) + : : : +- BroadcastExchange (43) + : : : +- * Project (42) + : : : +- * BroadcastHashJoin Inner BuildLeft (41) + : : : :- BroadcastExchange (37) + : : : : +- * Project (36) + : : : : +- * Filter (35) + : : : : +- * ColumnarToRow (34) + : : : : +- Scan parquet default.date_dim (33) + : : : +- * Filter (40) + : : : +- * ColumnarToRow (39) + : : : +- Scan parquet default.date_dim (38) + : : +- * Sort (58) + : : +- Exchange (57) + : : +- * Project (56) + : : +- * BroadcastHashJoin Inner BuildRight (55) + : : :- * Filter (50) + : : : +- * ColumnarToRow (49) + : : : +- Scan parquet default.inventory (48) + : : +- BroadcastExchange (54) + : : +- * Filter (53) + : : +- * ColumnarToRow (52) + : : +- Scan parquet default.warehouse (51) + : +- BroadcastExchange (64) + : +- * Filter (63) + : +- * ColumnarToRow (62) + : +- Scan parquet default.promotion (61) + +- * Sort (74) + +- Exchange (73) + +- * Project (72) + +- * Filter (71) + +- * ColumnarToRow (70) + +- Scan parquet default.catalog_returns (69) + + +(1) Scan parquet default.catalog_sales +Output [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#8), dynamicpruningexpression(cs_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(cs_quantity), IsNotNull(cs_item_sk), IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_hdemo_sk), IsNotNull(cs_ship_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 4] +Input [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] + +(3) Filter [codegen id : 4] +Input [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] +Condition : ((((isnotnull(cs_quantity#7) AND isnotnull(cs_item_sk#4)) AND isnotnull(cs_bill_cdemo_sk#2)) AND isnotnull(cs_bill_hdemo_sk#3)) AND isnotnull(cs_ship_date_sk#1)) + +(4) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#10, hd_buy_potential#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_buy_potential), EqualTo(hd_buy_potential,1001-5000 ), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [hd_demo_sk#10, hd_buy_potential#11] + +(6) Filter [codegen id : 1] +Input [2]: [hd_demo_sk#10, hd_buy_potential#11] +Condition : ((isnotnull(hd_buy_potential#11) AND (hd_buy_potential#11 = 1001-5000 )) AND isnotnull(hd_demo_sk#10)) + +(7) Project [codegen id : 1] +Output [1]: [hd_demo_sk#10] +Input [2]: [hd_demo_sk#10, hd_buy_potential#11] + +(8) BroadcastExchange +Input [1]: [hd_demo_sk#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#12] + +(9) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_bill_hdemo_sk#3] +Right keys [1]: [hd_demo_sk#10] +Join condition: None + +(10) Project [codegen id : 4] +Output [7]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] +Input [9]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, hd_demo_sk#10] + +(11) Scan parquet default.customer_demographics +Output [2]: [cd_demo_sk#13, cd_marital_status#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_marital_status), EqualTo(cd_marital_status,M), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [cd_demo_sk#13, cd_marital_status#14] + +(13) Filter [codegen id : 2] +Input [2]: [cd_demo_sk#13, cd_marital_status#14] +Condition : ((isnotnull(cd_marital_status#14) AND (cd_marital_status#14 = M)) AND isnotnull(cd_demo_sk#13)) + +(14) Project [codegen id : 2] +Output [1]: [cd_demo_sk#13] +Input [2]: [cd_demo_sk#13, cd_marital_status#14] + +(15) BroadcastExchange +Input [1]: [cd_demo_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(16) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_bill_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#13] +Join condition: None + +(17) Project [codegen id : 4] +Output [6]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] +Input [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, cd_demo_sk#13] + +(18) Scan parquet default.date_dim +Output [2]: [d_date_sk#16, d_date#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), IsNotNull(d_date_sk)] +ReadSchema: struct + +(19) ColumnarToRow [codegen id : 3] +Input [2]: [d_date_sk#16, d_date#17] + +(20) Filter [codegen id : 3] +Input [2]: [d_date_sk#16, d_date#17] +Condition : (isnotnull(d_date#17) AND isnotnull(d_date_sk#16)) + +(21) BroadcastExchange +Input [2]: [d_date_sk#16, d_date#17] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#18] + +(22) BroadcastHashJoin [codegen id : 4] +Left keys [1]: [cs_ship_date_sk#1] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(23) Project [codegen id : 4] +Output [6]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date#17] +Input [8]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date_sk#16, d_date#17] + +(24) Exchange +Input [6]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date#17] +Arguments: hashpartitioning(cs_item_sk#4, 5), ENSURE_REQUIREMENTS, [id=#19] + +(25) Sort [codegen id : 5] +Input [6]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date#17] +Arguments: [cs_item_sk#4 ASC NULLS FIRST], false, 0 + +(26) Scan parquet default.item +Output [2]: [i_item_sk#20, i_item_desc#21] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(27) ColumnarToRow [codegen id : 6] +Input [2]: [i_item_sk#20, i_item_desc#21] + +(28) Filter [codegen id : 6] +Input [2]: [i_item_sk#20, i_item_desc#21] +Condition : isnotnull(i_item_sk#20) + +(29) Exchange +Input [2]: [i_item_sk#20, i_item_desc#21] +Arguments: hashpartitioning(i_item_sk#20, 5), ENSURE_REQUIREMENTS, [id=#22] + +(30) Sort [codegen id : 7] +Input [2]: [i_item_sk#20, i_item_desc#21] +Arguments: [i_item_sk#20 ASC NULLS FIRST], false, 0 + +(31) SortMergeJoin [codegen id : 10] +Left keys [1]: [cs_item_sk#4] +Right keys [1]: [i_item_sk#20] +Join condition: None + +(32) Project [codegen id : 10] +Output [7]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date#17, i_item_desc#21] +Input [8]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date#17, i_item_sk#20, i_item_desc#21] + +(33) Scan parquet default.date_dim +Output [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_year#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk), IsNotNull(d_week_seq), IsNotNull(d_date)] +ReadSchema: struct + +(34) ColumnarToRow [codegen id : 8] +Input [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_year#26] + +(35) Filter [codegen id : 8] +Input [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_year#26] +Condition : ((((isnotnull(d_year#26) AND (d_year#26 = 2001)) AND isnotnull(d_date_sk#23)) AND isnotnull(d_week_seq#25)) AND isnotnull(d_date#24)) + +(36) Project [codegen id : 8] +Output [3]: [d_date_sk#23, d_date#24, d_week_seq#25] +Input [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_year#26] + +(37) BroadcastExchange +Input [3]: [d_date_sk#23, d_date#24, d_week_seq#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[2, int, true] as bigint)),false), [id=#27] + +(38) Scan parquet default.date_dim +Output [2]: [d_date_sk#28, d_week_seq#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(39) ColumnarToRow +Input [2]: [d_date_sk#28, d_week_seq#29] + +(40) Filter +Input [2]: [d_date_sk#28, d_week_seq#29] +Condition : (isnotnull(d_week_seq#29) AND isnotnull(d_date_sk#28)) + +(41) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [d_week_seq#25] +Right keys [1]: [d_week_seq#29] +Join condition: None + +(42) Project [codegen id : 9] +Output [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_date_sk#28] +Input [5]: [d_date_sk#23, d_date#24, d_week_seq#25, d_date_sk#28, d_week_seq#29] + +(43) BroadcastExchange +Input [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_date_sk#28] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#30] + +(44) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#8] +Right keys [1]: [d_date_sk#23] +Join condition: (d_date#17 > d_date#24 + 5 days) + +(45) Project [codegen id : 10] +Output [7]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, i_item_desc#21, d_week_seq#25, d_date_sk#28] +Input [11]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, d_date#17, i_item_desc#21, d_date_sk#23, d_date#24, d_week_seq#25, d_date_sk#28] + +(46) Exchange +Input [7]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, i_item_desc#21, d_week_seq#25, d_date_sk#28] +Arguments: hashpartitioning(cs_item_sk#4, d_date_sk#28, 5), ENSURE_REQUIREMENTS, [id=#31] + +(47) Sort [codegen id : 11] +Input [7]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, i_item_desc#21, d_week_seq#25, d_date_sk#28] +Arguments: [cs_item_sk#4 ASC NULLS FIRST, d_date_sk#28 ASC NULLS FIRST], false, 0 + +(48) Scan parquet default.inventory +Output [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#35), dynamicpruningexpression(true)] +PushedFilters: [IsNotNull(inv_quantity_on_hand), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(49) ColumnarToRow [codegen id : 13] +Input [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35] + +(50) Filter [codegen id : 13] +Input [4]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35] +Condition : ((isnotnull(inv_quantity_on_hand#34) AND isnotnull(inv_item_sk#32)) AND isnotnull(inv_warehouse_sk#33)) + +(51) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#36, w_warehouse_name#37] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(52) ColumnarToRow [codegen id : 12] +Input [2]: [w_warehouse_sk#36, w_warehouse_name#37] + +(53) Filter [codegen id : 12] +Input [2]: [w_warehouse_sk#36, w_warehouse_name#37] +Condition : isnotnull(w_warehouse_sk#36) + +(54) BroadcastExchange +Input [2]: [w_warehouse_sk#36, w_warehouse_name#37] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#38] + +(55) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [inv_warehouse_sk#33] +Right keys [1]: [w_warehouse_sk#36] +Join condition: None + +(56) Project [codegen id : 13] +Output [4]: [inv_item_sk#32, inv_quantity_on_hand#34, inv_date_sk#35, w_warehouse_name#37] +Input [6]: [inv_item_sk#32, inv_warehouse_sk#33, inv_quantity_on_hand#34, inv_date_sk#35, w_warehouse_sk#36, w_warehouse_name#37] + +(57) Exchange +Input [4]: [inv_item_sk#32, inv_quantity_on_hand#34, inv_date_sk#35, w_warehouse_name#37] +Arguments: hashpartitioning(inv_item_sk#32, inv_date_sk#35, 5), ENSURE_REQUIREMENTS, [id=#39] + +(58) Sort [codegen id : 14] +Input [4]: [inv_item_sk#32, inv_quantity_on_hand#34, inv_date_sk#35, w_warehouse_name#37] +Arguments: [inv_item_sk#32 ASC NULLS FIRST, inv_date_sk#35 ASC NULLS FIRST], false, 0 + +(59) SortMergeJoin [codegen id : 16] +Left keys [2]: [cs_item_sk#4, d_date_sk#28] +Right keys [2]: [inv_item_sk#32, inv_date_sk#35] +Join condition: (inv_quantity_on_hand#34 < cs_quantity#7) + +(60) Project [codegen id : 16] +Output [6]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, w_warehouse_name#37, i_item_desc#21, d_week_seq#25] +Input [11]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, i_item_desc#21, d_week_seq#25, d_date_sk#28, inv_item_sk#32, inv_quantity_on_hand#34, inv_date_sk#35, w_warehouse_name#37] + +(61) Scan parquet default.promotion +Output [1]: [p_promo_sk#40] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_promo_sk)] +ReadSchema: struct + +(62) ColumnarToRow [codegen id : 15] +Input [1]: [p_promo_sk#40] + +(63) Filter [codegen id : 15] +Input [1]: [p_promo_sk#40] +Condition : isnotnull(p_promo_sk#40) + +(64) BroadcastExchange +Input [1]: [p_promo_sk#40] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#41] + +(65) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [cs_promo_sk#5] +Right keys [1]: [p_promo_sk#40] +Join condition: None + +(66) Project [codegen id : 16] +Output [5]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#37, i_item_desc#21, d_week_seq#25] +Input [7]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, w_warehouse_name#37, i_item_desc#21, d_week_seq#25, p_promo_sk#40] + +(67) Exchange +Input [5]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#37, i_item_desc#21, d_week_seq#25] +Arguments: hashpartitioning(cs_item_sk#4, cs_order_number#6, 5), ENSURE_REQUIREMENTS, [id=#42] + +(68) Sort [codegen id : 17] +Input [5]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#37, i_item_desc#21, d_week_seq#25] +Arguments: [cs_item_sk#4 ASC NULLS FIRST, cs_order_number#6 ASC NULLS FIRST], false, 0 + +(69) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#43, cr_order_number#44, cr_returned_date_sk#45] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_order_number)] +ReadSchema: struct + +(70) ColumnarToRow [codegen id : 18] +Input [3]: [cr_item_sk#43, cr_order_number#44, cr_returned_date_sk#45] + +(71) Filter [codegen id : 18] +Input [3]: [cr_item_sk#43, cr_order_number#44, cr_returned_date_sk#45] +Condition : (isnotnull(cr_item_sk#43) AND isnotnull(cr_order_number#44)) + +(72) Project [codegen id : 18] +Output [2]: [cr_item_sk#43, cr_order_number#44] +Input [3]: [cr_item_sk#43, cr_order_number#44, cr_returned_date_sk#45] + +(73) Exchange +Input [2]: [cr_item_sk#43, cr_order_number#44] +Arguments: hashpartitioning(cr_item_sk#43, cr_order_number#44, 5), ENSURE_REQUIREMENTS, [id=#46] + +(74) Sort [codegen id : 19] +Input [2]: [cr_item_sk#43, cr_order_number#44] +Arguments: [cr_item_sk#43 ASC NULLS FIRST, cr_order_number#44 ASC NULLS FIRST], false, 0 + +(75) SortMergeJoin [codegen id : 20] +Left keys [2]: [cs_item_sk#4, cs_order_number#6] +Right keys [2]: [cr_item_sk#43, cr_order_number#44] +Join condition: None + +(76) Project [codegen id : 20] +Output [3]: [w_warehouse_name#37, i_item_desc#21, d_week_seq#25] +Input [7]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#37, i_item_desc#21, d_week_seq#25, cr_item_sk#43, cr_order_number#44] + +(77) HashAggregate [codegen id : 20] +Input [3]: [w_warehouse_name#37, i_item_desc#21, d_week_seq#25] +Keys [3]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#47] +Results [4]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25, count#48] + +(78) Exchange +Input [4]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25, count#48] +Arguments: hashpartitioning(i_item_desc#21, w_warehouse_name#37, d_week_seq#25, 5), ENSURE_REQUIREMENTS, [id=#49] + +(79) HashAggregate [codegen id : 21] +Input [4]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25, count#48] +Keys [3]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#50] +Results [6]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25, count(1)#50 AS no_promo#51, count(1)#50 AS promo#52, count(1)#50 AS total_cnt#53] + +(80) TakeOrderedAndProject +Input [6]: [i_item_desc#21, w_warehouse_name#37, d_week_seq#25, no_promo#51, promo#52, total_cnt#53] +Arguments: 100, [total_cnt#53 DESC NULLS LAST, i_item_desc#21 ASC NULLS FIRST, w_warehouse_name#37 ASC NULLS FIRST, d_week_seq#25 ASC NULLS FIRST], [i_item_desc#21, w_warehouse_name#37, d_week_seq#25, no_promo#51, promo#52, total_cnt#53] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (81) + + +(81) ReusedExchange [Reuses operator id: 43] +Output [4]: [d_date_sk#23, d_date#24, d_week_seq#25, d_date_sk#28] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/simplified.txt new file mode 100644 index 0000000000000..da6b79ca3c79d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72.sf100/simplified.txt @@ -0,0 +1,134 @@ +TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_promo,promo] + WholeStageCodegen (21) + HashAggregate [i_item_desc,w_warehouse_name,d_week_seq,count] [count(1),no_promo,promo,total_cnt,count] + InputAdapter + Exchange [i_item_desc,w_warehouse_name,d_week_seq] #1 + WholeStageCodegen (20) + HashAggregate [i_item_desc,w_warehouse_name,d_week_seq] [count,count] + Project [w_warehouse_name,i_item_desc,d_week_seq] + SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] + InputAdapter + WholeStageCodegen (17) + Sort [cs_item_sk,cs_order_number] + InputAdapter + Exchange [cs_item_sk,cs_order_number] #2 + WholeStageCodegen (16) + Project [cs_item_sk,cs_order_number,w_warehouse_name,i_item_desc,d_week_seq] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_item_sk,cs_promo_sk,cs_order_number,w_warehouse_name,i_item_desc,d_week_seq] + SortMergeJoin [cs_item_sk,d_date_sk,inv_item_sk,inv_date_sk,inv_quantity_on_hand,cs_quantity] + InputAdapter + WholeStageCodegen (11) + Sort [cs_item_sk,d_date_sk] + InputAdapter + Exchange [cs_item_sk,d_date_sk] #3 + WholeStageCodegen (10) + Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,i_item_desc,d_week_seq,d_date_sk] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk,d_date,d_date] + Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,cs_sold_date_sk,d_date,i_item_desc] + SortMergeJoin [cs_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (5) + Sort [cs_item_sk] + InputAdapter + Exchange [cs_item_sk] #4 + WholeStageCodegen (4) + Project [cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,cs_sold_date_sk,d_date] + BroadcastHashJoin [cs_ship_date_sk,d_date_sk] + Project [cs_ship_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,cs_sold_date_sk] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Project [cs_ship_date_sk,cs_bill_cdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,cs_sold_date_sk] + BroadcastHashJoin [cs_bill_hdemo_sk,hd_demo_sk] + Filter [cs_quantity,cs_item_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_ship_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date,d_week_seq,d_date_sk] #5 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Project [hd_demo_sk] + Filter [hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (2) + Project [cd_demo_sk] + Filter [cd_marital_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (3) + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + WholeStageCodegen (7) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #9 + WholeStageCodegen (6) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_desc] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (9) + Project [d_date_sk,d_date,d_week_seq,d_date_sk] + BroadcastHashJoin [d_week_seq,d_week_seq] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (8) + Project [d_date_sk,d_date,d_week_seq] + Filter [d_year,d_date_sk,d_week_seq,d_date] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_week_seq,d_year] + Filter [d_week_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] + InputAdapter + WholeStageCodegen (14) + Sort [inv_item_sk,inv_date_sk] + InputAdapter + Exchange [inv_item_sk,inv_date_sk] #11 + WholeStageCodegen (13) + Project [inv_item_sk,inv_quantity_on_hand,inv_date_sk,w_warehouse_name] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Filter [inv_quantity_on_hand,inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (12) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (15) + Filter [p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk] + InputAdapter + WholeStageCodegen (19) + Sort [cr_item_sk,cr_order_number] + InputAdapter + Exchange [cr_item_sk,cr_order_number] #14 + WholeStageCodegen (18) + Project [cr_item_sk,cr_order_number] + Filter [cr_item_sk,cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_returned_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72/explain.txt new file mode 100644 index 0000000000000..ee861169d77a4 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72/explain.txt @@ -0,0 +1,423 @@ +== Physical Plan == +TakeOrderedAndProject (74) ++- * HashAggregate (73) + +- Exchange (72) + +- * HashAggregate (71) + +- * Project (70) + +- * SortMergeJoin LeftOuter (69) + :- * Sort (62) + : +- Exchange (61) + : +- * Project (60) + : +- * BroadcastHashJoin LeftOuter BuildRight (59) + : :- * Project (54) + : : +- * BroadcastHashJoin Inner BuildRight (53) + : : :- * Project (48) + : : : +- * BroadcastHashJoin Inner BuildRight (47) + : : : :- * Project (42) + : : : : +- * BroadcastHashJoin Inner BuildRight (41) + : : : : :- * Project (35) + : : : : : +- * BroadcastHashJoin Inner BuildRight (34) + : : : : : :- * Project (28) + : : : : : : +- * BroadcastHashJoin Inner BuildRight (27) + : : : : : : :- * Project (21) + : : : : : : : +- * BroadcastHashJoin Inner BuildRight (20) + : : : : : : : :- * Project (15) + : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : : : : : : :- * Project (9) + : : : : : : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : : : : : : :- * Filter (3) + : : : : : : : : : : +- * ColumnarToRow (2) + : : : : : : : : : : +- Scan parquet default.catalog_sales (1) + : : : : : : : : : +- BroadcastExchange (7) + : : : : : : : : : +- * Filter (6) + : : : : : : : : : +- * ColumnarToRow (5) + : : : : : : : : : +- Scan parquet default.inventory (4) + : : : : : : : : +- BroadcastExchange (13) + : : : : : : : : +- * Filter (12) + : : : : : : : : +- * ColumnarToRow (11) + : : : : : : : : +- Scan parquet default.warehouse (10) + : : : : : : : +- BroadcastExchange (19) + : : : : : : : +- * Filter (18) + : : : : : : : +- * ColumnarToRow (17) + : : : : : : : +- Scan parquet default.item (16) + : : : : : : +- BroadcastExchange (26) + : : : : : : +- * Project (25) + : : : : : : +- * Filter (24) + : : : : : : +- * ColumnarToRow (23) + : : : : : : +- Scan parquet default.customer_demographics (22) + : : : : : +- BroadcastExchange (33) + : : : : : +- * Project (32) + : : : : : +- * Filter (31) + : : : : : +- * ColumnarToRow (30) + : : : : : +- Scan parquet default.household_demographics (29) + : : : : +- BroadcastExchange (40) + : : : : +- * Project (39) + : : : : +- * Filter (38) + : : : : +- * ColumnarToRow (37) + : : : : +- Scan parquet default.date_dim (36) + : : : +- BroadcastExchange (46) + : : : +- * Filter (45) + : : : +- * ColumnarToRow (44) + : : : +- Scan parquet default.date_dim (43) + : : +- BroadcastExchange (52) + : : +- * Filter (51) + : : +- * ColumnarToRow (50) + : : +- Scan parquet default.date_dim (49) + : +- BroadcastExchange (58) + : +- * Filter (57) + : +- * ColumnarToRow (56) + : +- Scan parquet default.promotion (55) + +- * Sort (68) + +- Exchange (67) + +- * Project (66) + +- * Filter (65) + +- * ColumnarToRow (64) + +- Scan parquet default.catalog_returns (63) + + +(1) Scan parquet default.catalog_sales +Output [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#8), dynamicpruningexpression(cs_sold_date_sk#8 IN dynamicpruning#9)] +PushedFilters: [IsNotNull(cs_quantity), IsNotNull(cs_item_sk), IsNotNull(cs_bill_cdemo_sk), IsNotNull(cs_bill_hdemo_sk), IsNotNull(cs_ship_date_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 10] +Input [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] + +(3) Filter [codegen id : 10] +Input [8]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8] +Condition : ((((isnotnull(cs_quantity#7) AND isnotnull(cs_item_sk#4)) AND isnotnull(cs_bill_cdemo_sk#2)) AND isnotnull(cs_bill_hdemo_sk#3)) AND isnotnull(cs_ship_date_sk#1)) + +(4) Scan parquet default.inventory +Output [4]: [inv_item_sk#10, inv_warehouse_sk#11, inv_quantity_on_hand#12, inv_date_sk#13] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(inv_date_sk#13)] +PushedFilters: [IsNotNull(inv_quantity_on_hand), IsNotNull(inv_item_sk), IsNotNull(inv_warehouse_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [4]: [inv_item_sk#10, inv_warehouse_sk#11, inv_quantity_on_hand#12, inv_date_sk#13] + +(6) Filter [codegen id : 1] +Input [4]: [inv_item_sk#10, inv_warehouse_sk#11, inv_quantity_on_hand#12, inv_date_sk#13] +Condition : ((isnotnull(inv_quantity_on_hand#12) AND isnotnull(inv_item_sk#10)) AND isnotnull(inv_warehouse_sk#11)) + +(7) BroadcastExchange +Input [4]: [inv_item_sk#10, inv_warehouse_sk#11, inv_quantity_on_hand#12, inv_date_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#14] + +(8) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_item_sk#4] +Right keys [1]: [inv_item_sk#10] +Join condition: (inv_quantity_on_hand#12 < cs_quantity#7) + +(9) Project [codegen id : 10] +Output [9]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_warehouse_sk#11, inv_date_sk#13] +Input [12]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_quantity#7, cs_sold_date_sk#8, inv_item_sk#10, inv_warehouse_sk#11, inv_quantity_on_hand#12, inv_date_sk#13] + +(10) Scan parquet default.warehouse +Output [2]: [w_warehouse_sk#15, w_warehouse_name#16] +Batched: true +Location [not included in comparison]/{warehouse_dir}/warehouse] +PushedFilters: [IsNotNull(w_warehouse_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] + +(12) Filter [codegen id : 2] +Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] +Condition : isnotnull(w_warehouse_sk#15) + +(13) BroadcastExchange +Input [2]: [w_warehouse_sk#15, w_warehouse_name#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#17] + +(14) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [inv_warehouse_sk#11] +Right keys [1]: [w_warehouse_sk#15] +Join condition: None + +(15) Project [codegen id : 10] +Output [9]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16] +Input [11]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_warehouse_sk#11, inv_date_sk#13, w_warehouse_sk#15, w_warehouse_name#16] + +(16) Scan parquet default.item +Output [2]: [i_item_sk#18, i_item_desc#19] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(17) ColumnarToRow [codegen id : 3] +Input [2]: [i_item_sk#18, i_item_desc#19] + +(18) Filter [codegen id : 3] +Input [2]: [i_item_sk#18, i_item_desc#19] +Condition : isnotnull(i_item_sk#18) + +(19) BroadcastExchange +Input [2]: [i_item_sk#18, i_item_desc#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#20] + +(20) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_item_sk#4] +Right keys [1]: [i_item_sk#18] +Join condition: None + +(21) Project [codegen id : 10] +Output [10]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19] +Input [11]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_sk#18, i_item_desc#19] + +(22) Scan parquet default.customer_demographics +Output [2]: [cd_demo_sk#21, cd_marital_status#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer_demographics] +PushedFilters: [IsNotNull(cd_marital_status), EqualTo(cd_marital_status,M), IsNotNull(cd_demo_sk)] +ReadSchema: struct + +(23) ColumnarToRow [codegen id : 4] +Input [2]: [cd_demo_sk#21, cd_marital_status#22] + +(24) Filter [codegen id : 4] +Input [2]: [cd_demo_sk#21, cd_marital_status#22] +Condition : ((isnotnull(cd_marital_status#22) AND (cd_marital_status#22 = M)) AND isnotnull(cd_demo_sk#21)) + +(25) Project [codegen id : 4] +Output [1]: [cd_demo_sk#21] +Input [2]: [cd_demo_sk#21, cd_marital_status#22] + +(26) BroadcastExchange +Input [1]: [cd_demo_sk#21] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#23] + +(27) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_bill_cdemo_sk#2] +Right keys [1]: [cd_demo_sk#21] +Join condition: None + +(28) Project [codegen id : 10] +Output [9]: [cs_ship_date_sk#1, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19] +Input [11]: [cs_ship_date_sk#1, cs_bill_cdemo_sk#2, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19, cd_demo_sk#21] + +(29) Scan parquet default.household_demographics +Output [2]: [hd_demo_sk#24, hd_buy_potential#25] +Batched: true +Location [not included in comparison]/{warehouse_dir}/household_demographics] +PushedFilters: [IsNotNull(hd_buy_potential), EqualTo(hd_buy_potential,1001-5000 ), IsNotNull(hd_demo_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [2]: [hd_demo_sk#24, hd_buy_potential#25] + +(31) Filter [codegen id : 5] +Input [2]: [hd_demo_sk#24, hd_buy_potential#25] +Condition : ((isnotnull(hd_buy_potential#25) AND (hd_buy_potential#25 = 1001-5000 )) AND isnotnull(hd_demo_sk#24)) + +(32) Project [codegen id : 5] +Output [1]: [hd_demo_sk#24] +Input [2]: [hd_demo_sk#24, hd_buy_potential#25] + +(33) BroadcastExchange +Input [1]: [hd_demo_sk#24] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#26] + +(34) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_bill_hdemo_sk#3] +Right keys [1]: [hd_demo_sk#24] +Join condition: None + +(35) Project [codegen id : 10] +Output [8]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19] +Input [10]: [cs_ship_date_sk#1, cs_bill_hdemo_sk#3, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19, hd_demo_sk#24] + +(36) Scan parquet default.date_dim +Output [4]: [d_date_sk#27, d_date#28, d_week_seq#29, d_year#30] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk), IsNotNull(d_week_seq), IsNotNull(d_date)] +ReadSchema: struct + +(37) ColumnarToRow [codegen id : 6] +Input [4]: [d_date_sk#27, d_date#28, d_week_seq#29, d_year#30] + +(38) Filter [codegen id : 6] +Input [4]: [d_date_sk#27, d_date#28, d_week_seq#29, d_year#30] +Condition : ((((isnotnull(d_year#30) AND (d_year#30 = 2001)) AND isnotnull(d_date_sk#27)) AND isnotnull(d_week_seq#29)) AND isnotnull(d_date#28)) + +(39) Project [codegen id : 6] +Output [3]: [d_date_sk#27, d_date#28, d_week_seq#29] +Input [4]: [d_date_sk#27, d_date#28, d_week_seq#29, d_year#30] + +(40) BroadcastExchange +Input [3]: [d_date_sk#27, d_date#28, d_week_seq#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#31] + +(41) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#8] +Right keys [1]: [d_date_sk#27] +Join condition: None + +(42) Project [codegen id : 10] +Output [9]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19, d_date#28, d_week_seq#29] +Input [11]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, cs_sold_date_sk#8, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19, d_date_sk#27, d_date#28, d_week_seq#29] + +(43) Scan parquet default.date_dim +Output [2]: [d_date_sk#32, d_week_seq#33] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_week_seq), IsNotNull(d_date_sk)] +ReadSchema: struct + +(44) ColumnarToRow [codegen id : 7] +Input [2]: [d_date_sk#32, d_week_seq#33] + +(45) Filter [codegen id : 7] +Input [2]: [d_date_sk#32, d_week_seq#33] +Condition : (isnotnull(d_week_seq#33) AND isnotnull(d_date_sk#32)) + +(46) BroadcastExchange +Input [2]: [d_date_sk#32, d_week_seq#33] +Arguments: HashedRelationBroadcastMode(List((shiftleft(cast(input[1, int, false] as bigint), 32) | (cast(input[0, int, false] as bigint) & 4294967295))),false), [id=#34] + +(47) BroadcastHashJoin [codegen id : 10] +Left keys [2]: [d_week_seq#29, inv_date_sk#13] +Right keys [2]: [d_week_seq#33, d_date_sk#32] +Join condition: None + +(48) Project [codegen id : 10] +Output [8]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_date#28, d_week_seq#29] +Input [11]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, inv_date_sk#13, w_warehouse_name#16, i_item_desc#19, d_date#28, d_week_seq#29, d_date_sk#32, d_week_seq#33] + +(49) Scan parquet default.date_dim +Output [2]: [d_date_sk#35, d_date#36] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), IsNotNull(d_date_sk)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 8] +Input [2]: [d_date_sk#35, d_date#36] + +(51) Filter [codegen id : 8] +Input [2]: [d_date_sk#35, d_date#36] +Condition : (isnotnull(d_date#36) AND isnotnull(d_date_sk#35)) + +(52) BroadcastExchange +Input [2]: [d_date_sk#35, d_date#36] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#37] + +(53) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_ship_date_sk#1] +Right keys [1]: [d_date_sk#35] +Join condition: (d_date#36 > d_date#28 + 5 days) + +(54) Project [codegen id : 10] +Output [6]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_week_seq#29] +Input [10]: [cs_ship_date_sk#1, cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_date#28, d_week_seq#29, d_date_sk#35, d_date#36] + +(55) Scan parquet default.promotion +Output [1]: [p_promo_sk#38] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_promo_sk)] +ReadSchema: struct + +(56) ColumnarToRow [codegen id : 9] +Input [1]: [p_promo_sk#38] + +(57) Filter [codegen id : 9] +Input [1]: [p_promo_sk#38] +Condition : isnotnull(p_promo_sk#38) + +(58) BroadcastExchange +Input [1]: [p_promo_sk#38] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#39] + +(59) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_promo_sk#5] +Right keys [1]: [p_promo_sk#38] +Join condition: None + +(60) Project [codegen id : 10] +Output [5]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_week_seq#29] +Input [7]: [cs_item_sk#4, cs_promo_sk#5, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_week_seq#29, p_promo_sk#38] + +(61) Exchange +Input [5]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_week_seq#29] +Arguments: hashpartitioning(cs_item_sk#4, cs_order_number#6, 5), ENSURE_REQUIREMENTS, [id=#40] + +(62) Sort [codegen id : 11] +Input [5]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_week_seq#29] +Arguments: [cs_item_sk#4 ASC NULLS FIRST, cs_order_number#6 ASC NULLS FIRST], false, 0 + +(63) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#41, cr_order_number#42, cr_returned_date_sk#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_order_number)] +ReadSchema: struct + +(64) ColumnarToRow [codegen id : 12] +Input [3]: [cr_item_sk#41, cr_order_number#42, cr_returned_date_sk#43] + +(65) Filter [codegen id : 12] +Input [3]: [cr_item_sk#41, cr_order_number#42, cr_returned_date_sk#43] +Condition : (isnotnull(cr_item_sk#41) AND isnotnull(cr_order_number#42)) + +(66) Project [codegen id : 12] +Output [2]: [cr_item_sk#41, cr_order_number#42] +Input [3]: [cr_item_sk#41, cr_order_number#42, cr_returned_date_sk#43] + +(67) Exchange +Input [2]: [cr_item_sk#41, cr_order_number#42] +Arguments: hashpartitioning(cr_item_sk#41, cr_order_number#42, 5), ENSURE_REQUIREMENTS, [id=#44] + +(68) Sort [codegen id : 13] +Input [2]: [cr_item_sk#41, cr_order_number#42] +Arguments: [cr_item_sk#41 ASC NULLS FIRST, cr_order_number#42 ASC NULLS FIRST], false, 0 + +(69) SortMergeJoin [codegen id : 14] +Left keys [2]: [cs_item_sk#4, cs_order_number#6] +Right keys [2]: [cr_item_sk#41, cr_order_number#42] +Join condition: None + +(70) Project [codegen id : 14] +Output [3]: [w_warehouse_name#16, i_item_desc#19, d_week_seq#29] +Input [7]: [cs_item_sk#4, cs_order_number#6, w_warehouse_name#16, i_item_desc#19, d_week_seq#29, cr_item_sk#41, cr_order_number#42] + +(71) HashAggregate [codegen id : 14] +Input [3]: [w_warehouse_name#16, i_item_desc#19, d_week_seq#29] +Keys [3]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29] +Functions [1]: [partial_count(1)] +Aggregate Attributes [1]: [count#45] +Results [4]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29, count#46] + +(72) Exchange +Input [4]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29, count#46] +Arguments: hashpartitioning(i_item_desc#19, w_warehouse_name#16, d_week_seq#29, 5), ENSURE_REQUIREMENTS, [id=#47] + +(73) HashAggregate [codegen id : 15] +Input [4]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29, count#46] +Keys [3]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29] +Functions [1]: [count(1)] +Aggregate Attributes [1]: [count(1)#48] +Results [6]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29, count(1)#48 AS no_promo#49, count(1)#48 AS promo#50, count(1)#48 AS total_cnt#51] + +(74) TakeOrderedAndProject +Input [6]: [i_item_desc#19, w_warehouse_name#16, d_week_seq#29, no_promo#49, promo#50, total_cnt#51] +Arguments: 100, [total_cnt#51 DESC NULLS LAST, i_item_desc#19 ASC NULLS FIRST, w_warehouse_name#16 ASC NULLS FIRST, d_week_seq#29 ASC NULLS FIRST], [i_item_desc#19, w_warehouse_name#16, d_week_seq#29, no_promo#49, promo#50, total_cnt#51] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#8 IN dynamicpruning#9 +ReusedExchange (75) + + +(75) ReusedExchange [Reuses operator id: 40] +Output [3]: [d_date_sk#27, d_date#28, d_week_seq#29] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72/simplified.txt new file mode 100644 index 0000000000000..92800d31b82f1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q72/simplified.txt @@ -0,0 +1,116 @@ +TakeOrderedAndProject [total_cnt,i_item_desc,w_warehouse_name,d_week_seq,no_promo,promo] + WholeStageCodegen (15) + HashAggregate [i_item_desc,w_warehouse_name,d_week_seq,count] [count(1),no_promo,promo,total_cnt,count] + InputAdapter + Exchange [i_item_desc,w_warehouse_name,d_week_seq] #1 + WholeStageCodegen (14) + HashAggregate [i_item_desc,w_warehouse_name,d_week_seq] [count,count] + Project [w_warehouse_name,i_item_desc,d_week_seq] + SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] + InputAdapter + WholeStageCodegen (11) + Sort [cs_item_sk,cs_order_number] + InputAdapter + Exchange [cs_item_sk,cs_order_number] #2 + WholeStageCodegen (10) + Project [cs_item_sk,cs_order_number,w_warehouse_name,i_item_desc,d_week_seq] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_item_sk,cs_promo_sk,cs_order_number,w_warehouse_name,i_item_desc,d_week_seq] + BroadcastHashJoin [cs_ship_date_sk,d_date_sk,d_date,d_date] + Project [cs_ship_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,w_warehouse_name,i_item_desc,d_date,d_week_seq] + BroadcastHashJoin [d_week_seq,inv_date_sk,d_week_seq,d_date_sk] + Project [cs_ship_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,inv_date_sk,w_warehouse_name,i_item_desc,d_date,d_week_seq] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_ship_date_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_sold_date_sk,inv_date_sk,w_warehouse_name,i_item_desc] + BroadcastHashJoin [cs_bill_hdemo_sk,hd_demo_sk] + Project [cs_ship_date_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_sold_date_sk,inv_date_sk,w_warehouse_name,i_item_desc] + BroadcastHashJoin [cs_bill_cdemo_sk,cd_demo_sk] + Project [cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_sold_date_sk,inv_date_sk,w_warehouse_name,i_item_desc] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_sold_date_sk,inv_date_sk,w_warehouse_name] + BroadcastHashJoin [inv_warehouse_sk,w_warehouse_sk] + Project [cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_sold_date_sk,inv_warehouse_sk,inv_date_sk] + BroadcastHashJoin [cs_item_sk,inv_item_sk,inv_quantity_on_hand,cs_quantity] + Filter [cs_quantity,cs_item_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_ship_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_ship_date_sk,cs_bill_cdemo_sk,cs_bill_hdemo_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_quantity,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_date,d_week_seq] #3 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [inv_quantity_on_hand,inv_item_sk,inv_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.inventory [inv_item_sk,inv_warehouse_sk,inv_quantity_on_hand,inv_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [w_warehouse_sk] + ColumnarToRow + InputAdapter + Scan parquet default.warehouse [w_warehouse_sk,w_warehouse_name] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (3) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_desc] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (4) + Project [cd_demo_sk] + Filter [cd_marital_status,cd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.customer_demographics [cd_demo_sk,cd_marital_status] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (5) + Project [hd_demo_sk] + Filter [hd_buy_potential,hd_demo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.household_demographics [hd_demo_sk,hd_buy_potential] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (6) + Project [d_date_sk,d_date,d_week_seq] + Filter [d_year,d_date_sk,d_week_seq,d_date] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date,d_week_seq,d_year] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (7) + Filter [d_week_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_week_seq] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (8) + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (9) + Filter [p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk] + InputAdapter + WholeStageCodegen (13) + Sort [cr_item_sk,cr_order_number] + InputAdapter + Exchange [cr_item_sk,cr_order_number] #12 + WholeStageCodegen (12) + Project [cr_item_sk,cr_order_number] + Filter [cr_item_sk,cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_returned_date_sk] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/explain.txt new file mode 100644 index 0000000000000..7eea8040043d6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/explain.txt @@ -0,0 +1,502 @@ +== Physical Plan == +TakeOrderedAndProject (86) ++- * Project (85) + +- * SortMergeJoin Inner (84) + :- * Project (66) + : +- * SortMergeJoin Inner (65) + : :- * SortMergeJoin Inner (45) + : : :- * Sort (24) + : : : +- Exchange (23) + : : : +- * Filter (22) + : : : +- * HashAggregate (21) + : : : +- Exchange (20) + : : : +- * HashAggregate (19) + : : : +- * Project (18) + : : : +- * SortMergeJoin Inner (17) + : : : :- * Sort (11) + : : : : +- Exchange (10) + : : : : +- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- * Sort (16) + : : : +- Exchange (15) + : : : +- * Filter (14) + : : : +- * ColumnarToRow (13) + : : : +- Scan parquet default.customer (12) + : : +- * Sort (44) + : : +- Exchange (43) + : : +- * HashAggregate (42) + : : +- Exchange (41) + : : +- * HashAggregate (40) + : : +- * Project (39) + : : +- * SortMergeJoin Inner (38) + : : :- * Sort (35) + : : : +- Exchange (34) + : : : +- * Project (33) + : : : +- * BroadcastHashJoin Inner BuildRight (32) + : : : :- * Filter (27) + : : : : +- * ColumnarToRow (26) + : : : : +- Scan parquet default.store_sales (25) + : : : +- BroadcastExchange (31) + : : : +- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.date_dim (28) + : : +- * Sort (37) + : : +- ReusedExchange (36) + : +- * Sort (64) + : +- Exchange (63) + : +- * Project (62) + : +- * Filter (61) + : +- * HashAggregate (60) + : +- Exchange (59) + : +- * HashAggregate (58) + : +- * Project (57) + : +- * SortMergeJoin Inner (56) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Project (51) + : : +- * BroadcastHashJoin Inner BuildRight (50) + : : :- * Filter (48) + : : : +- * ColumnarToRow (47) + : : : +- Scan parquet default.web_sales (46) + : : +- ReusedExchange (49) + : +- * Sort (55) + : +- ReusedExchange (54) + +- * Sort (83) + +- Exchange (82) + +- * HashAggregate (81) + +- Exchange (80) + +- * HashAggregate (79) + +- * Project (78) + +- * SortMergeJoin Inner (77) + :- * Sort (74) + : +- Exchange (73) + : +- * Project (72) + : +- * BroadcastHashJoin Inner BuildRight (71) + : :- * Filter (69) + : : +- * ColumnarToRow (68) + : : +- Scan parquet default.web_sales (67) + : +- ReusedExchange (70) + +- * Sort (76) + +- ReusedExchange (75) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_customer_sk#1, ss_net_paid#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 2] +Input [3]: [ss_customer_sk#1, ss_net_paid#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 2] +Input [3]: [ss_customer_sk#1, ss_net_paid#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_customer_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_year#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_year#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_year#6] +Condition : (((isnotnull(d_year#6) AND (d_year#6 = 2001)) AND d_year#6 IN (2001,2002)) AND isnotnull(d_date_sk#5)) + +(7) BroadcastExchange +Input [2]: [d_date_sk#5, d_year#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#7] + +(8) BroadcastHashJoin [codegen id : 2] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(9) Project [codegen id : 2] +Output [3]: [ss_customer_sk#1, ss_net_paid#2, d_year#6] +Input [5]: [ss_customer_sk#1, ss_net_paid#2, ss_sold_date_sk#3, d_date_sk#5, d_year#6] + +(10) Exchange +Input [3]: [ss_customer_sk#1, ss_net_paid#2, d_year#6] +Arguments: hashpartitioning(ss_customer_sk#1, 5), ENSURE_REQUIREMENTS, [id=#8] + +(11) Sort [codegen id : 3] +Input [3]: [ss_customer_sk#1, ss_net_paid#2, d_year#6] +Arguments: [ss_customer_sk#1 ASC NULLS FIRST], false, 0 + +(12) Scan parquet default.customer +Output [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(13) ColumnarToRow [codegen id : 4] +Input [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12] + +(14) Filter [codegen id : 4] +Input [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12] +Condition : (isnotnull(c_customer_sk#9) AND isnotnull(c_customer_id#10)) + +(15) Exchange +Input [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12] +Arguments: hashpartitioning(c_customer_sk#9, 5), ENSURE_REQUIREMENTS, [id=#13] + +(16) Sort [codegen id : 5] +Input [4]: [c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12] +Arguments: [c_customer_sk#9 ASC NULLS FIRST], false, 0 + +(17) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_customer_sk#1] +Right keys [1]: [c_customer_sk#9] +Join condition: None + +(18) Project [codegen id : 6] +Output [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, ss_net_paid#2, d_year#6] +Input [7]: [ss_customer_sk#1, ss_net_paid#2, d_year#6, c_customer_sk#9, c_customer_id#10, c_first_name#11, c_last_name#12] + +(19) HashAggregate [codegen id : 6] +Input [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, ss_net_paid#2, d_year#6] +Keys [4]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#2))] +Aggregate Attributes [1]: [sum#14] +Results [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, sum#15] + +(20) Exchange +Input [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, sum#15] +Arguments: hashpartitioning(c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, 5), ENSURE_REQUIREMENTS, [id=#16] + +(21) HashAggregate [codegen id : 7] +Input [5]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6, sum#15] +Keys [4]: [c_customer_id#10, c_first_name#11, c_last_name#12, d_year#6] +Functions [1]: [sum(UnscaledValue(ss_net_paid#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#2))#17] +Results [2]: [c_customer_id#10 AS customer_id#18, MakeDecimal(sum(UnscaledValue(ss_net_paid#2))#17,17,2) AS year_total#19] + +(22) Filter [codegen id : 7] +Input [2]: [customer_id#18, year_total#19] +Condition : (isnotnull(year_total#19) AND (year_total#19 > 0.00)) + +(23) Exchange +Input [2]: [customer_id#18, year_total#19] +Arguments: hashpartitioning(customer_id#18, 5), ENSURE_REQUIREMENTS, [id=#20] + +(24) Sort [codegen id : 8] +Input [2]: [customer_id#18, year_total#19] +Arguments: [customer_id#18 ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.store_sales +Output [3]: [ss_customer_sk#21, ss_net_paid#22, ss_sold_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#23), dynamicpruningexpression(ss_sold_date_sk#23 IN dynamicpruning#24)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 10] +Input [3]: [ss_customer_sk#21, ss_net_paid#22, ss_sold_date_sk#23] + +(27) Filter [codegen id : 10] +Input [3]: [ss_customer_sk#21, ss_net_paid#22, ss_sold_date_sk#23] +Condition : isnotnull(ss_customer_sk#21) + +(28) Scan parquet default.date_dim +Output [2]: [d_date_sk#25, d_year#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 9] +Input [2]: [d_date_sk#25, d_year#26] + +(30) Filter [codegen id : 9] +Input [2]: [d_date_sk#25, d_year#26] +Condition : (((isnotnull(d_year#26) AND (d_year#26 = 2002)) AND d_year#26 IN (2001,2002)) AND isnotnull(d_date_sk#25)) + +(31) BroadcastExchange +Input [2]: [d_date_sk#25, d_year#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(32) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#23] +Right keys [1]: [d_date_sk#25] +Join condition: None + +(33) Project [codegen id : 10] +Output [3]: [ss_customer_sk#21, ss_net_paid#22, d_year#26] +Input [5]: [ss_customer_sk#21, ss_net_paid#22, ss_sold_date_sk#23, d_date_sk#25, d_year#26] + +(34) Exchange +Input [3]: [ss_customer_sk#21, ss_net_paid#22, d_year#26] +Arguments: hashpartitioning(ss_customer_sk#21, 5), ENSURE_REQUIREMENTS, [id=#28] + +(35) Sort [codegen id : 11] +Input [3]: [ss_customer_sk#21, ss_net_paid#22, d_year#26] +Arguments: [ss_customer_sk#21 ASC NULLS FIRST], false, 0 + +(36) ReusedExchange [Reuses operator id: 15] +Output [4]: [c_customer_sk#29, c_customer_id#30, c_first_name#31, c_last_name#32] + +(37) Sort [codegen id : 13] +Input [4]: [c_customer_sk#29, c_customer_id#30, c_first_name#31, c_last_name#32] +Arguments: [c_customer_sk#29 ASC NULLS FIRST], false, 0 + +(38) SortMergeJoin [codegen id : 14] +Left keys [1]: [ss_customer_sk#21] +Right keys [1]: [c_customer_sk#29] +Join condition: None + +(39) Project [codegen id : 14] +Output [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, ss_net_paid#22, d_year#26] +Input [7]: [ss_customer_sk#21, ss_net_paid#22, d_year#26, c_customer_sk#29, c_customer_id#30, c_first_name#31, c_last_name#32] + +(40) HashAggregate [codegen id : 14] +Input [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, ss_net_paid#22, d_year#26] +Keys [4]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#22))] +Aggregate Attributes [1]: [sum#33] +Results [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26, sum#34] + +(41) Exchange +Input [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26, sum#34] +Arguments: hashpartitioning(c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26, 5), ENSURE_REQUIREMENTS, [id=#35] + +(42) HashAggregate [codegen id : 15] +Input [5]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26, sum#34] +Keys [4]: [c_customer_id#30, c_first_name#31, c_last_name#32, d_year#26] +Functions [1]: [sum(UnscaledValue(ss_net_paid#22))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#22))#36] +Results [4]: [c_customer_id#30 AS customer_id#37, c_first_name#31 AS customer_first_name#38, c_last_name#32 AS customer_last_name#39, MakeDecimal(sum(UnscaledValue(ss_net_paid#22))#36,17,2) AS year_total#40] + +(43) Exchange +Input [4]: [customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40] +Arguments: hashpartitioning(customer_id#37, 5), ENSURE_REQUIREMENTS, [id=#41] + +(44) Sort [codegen id : 16] +Input [4]: [customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40] +Arguments: [customer_id#37 ASC NULLS FIRST], false, 0 + +(45) SortMergeJoin [codegen id : 17] +Left keys [1]: [customer_id#18] +Right keys [1]: [customer_id#37] +Join condition: None + +(46) Scan parquet default.web_sales +Output [3]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#44), dynamicpruningexpression(ws_sold_date_sk#44 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 19] +Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44] + +(48) Filter [codegen id : 19] +Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44] +Condition : isnotnull(ws_bill_customer_sk#42) + +(49) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#45, d_year#46] + +(50) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [ws_sold_date_sk#44] +Right keys [1]: [d_date_sk#45] +Join condition: None + +(51) Project [codegen id : 19] +Output [3]: [ws_bill_customer_sk#42, ws_net_paid#43, d_year#46] +Input [5]: [ws_bill_customer_sk#42, ws_net_paid#43, ws_sold_date_sk#44, d_date_sk#45, d_year#46] + +(52) Exchange +Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, d_year#46] +Arguments: hashpartitioning(ws_bill_customer_sk#42, 5), ENSURE_REQUIREMENTS, [id=#47] + +(53) Sort [codegen id : 20] +Input [3]: [ws_bill_customer_sk#42, ws_net_paid#43, d_year#46] +Arguments: [ws_bill_customer_sk#42 ASC NULLS FIRST], false, 0 + +(54) ReusedExchange [Reuses operator id: 15] +Output [4]: [c_customer_sk#48, c_customer_id#49, c_first_name#50, c_last_name#51] + +(55) Sort [codegen id : 22] +Input [4]: [c_customer_sk#48, c_customer_id#49, c_first_name#50, c_last_name#51] +Arguments: [c_customer_sk#48 ASC NULLS FIRST], false, 0 + +(56) SortMergeJoin [codegen id : 23] +Left keys [1]: [ws_bill_customer_sk#42] +Right keys [1]: [c_customer_sk#48] +Join condition: None + +(57) Project [codegen id : 23] +Output [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, ws_net_paid#43, d_year#46] +Input [7]: [ws_bill_customer_sk#42, ws_net_paid#43, d_year#46, c_customer_sk#48, c_customer_id#49, c_first_name#50, c_last_name#51] + +(58) HashAggregate [codegen id : 23] +Input [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, ws_net_paid#43, d_year#46] +Keys [4]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#43))] +Aggregate Attributes [1]: [sum#52] +Results [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46, sum#53] + +(59) Exchange +Input [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46, sum#53] +Arguments: hashpartitioning(c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46, 5), ENSURE_REQUIREMENTS, [id=#54] + +(60) HashAggregate [codegen id : 24] +Input [5]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46, sum#53] +Keys [4]: [c_customer_id#49, c_first_name#50, c_last_name#51, d_year#46] +Functions [1]: [sum(UnscaledValue(ws_net_paid#43))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#43))#55] +Results [2]: [c_customer_id#49 AS customer_id#56, MakeDecimal(sum(UnscaledValue(ws_net_paid#43))#55,17,2) AS year_total#57] + +(61) Filter [codegen id : 24] +Input [2]: [customer_id#56, year_total#57] +Condition : (isnotnull(year_total#57) AND (year_total#57 > 0.00)) + +(62) Project [codegen id : 24] +Output [2]: [customer_id#56 AS customer_id#58, year_total#57 AS year_total#59] +Input [2]: [customer_id#56, year_total#57] + +(63) Exchange +Input [2]: [customer_id#58, year_total#59] +Arguments: hashpartitioning(customer_id#58, 5), ENSURE_REQUIREMENTS, [id=#60] + +(64) Sort [codegen id : 25] +Input [2]: [customer_id#58, year_total#59] +Arguments: [customer_id#58 ASC NULLS FIRST], false, 0 + +(65) SortMergeJoin [codegen id : 26] +Left keys [1]: [customer_id#18] +Right keys [1]: [customer_id#58] +Join condition: None + +(66) Project [codegen id : 26] +Output [7]: [customer_id#18, year_total#19, customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40, year_total#59] +Input [8]: [customer_id#18, year_total#19, customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40, customer_id#58, year_total#59] + +(67) Scan parquet default.web_sales +Output [3]: [ws_bill_customer_sk#61, ws_net_paid#62, ws_sold_date_sk#63] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#63), dynamicpruningexpression(ws_sold_date_sk#63 IN dynamicpruning#24)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(68) ColumnarToRow [codegen id : 28] +Input [3]: [ws_bill_customer_sk#61, ws_net_paid#62, ws_sold_date_sk#63] + +(69) Filter [codegen id : 28] +Input [3]: [ws_bill_customer_sk#61, ws_net_paid#62, ws_sold_date_sk#63] +Condition : isnotnull(ws_bill_customer_sk#61) + +(70) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#64, d_year#65] + +(71) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [ws_sold_date_sk#63] +Right keys [1]: [d_date_sk#64] +Join condition: None + +(72) Project [codegen id : 28] +Output [3]: [ws_bill_customer_sk#61, ws_net_paid#62, d_year#65] +Input [5]: [ws_bill_customer_sk#61, ws_net_paid#62, ws_sold_date_sk#63, d_date_sk#64, d_year#65] + +(73) Exchange +Input [3]: [ws_bill_customer_sk#61, ws_net_paid#62, d_year#65] +Arguments: hashpartitioning(ws_bill_customer_sk#61, 5), ENSURE_REQUIREMENTS, [id=#66] + +(74) Sort [codegen id : 29] +Input [3]: [ws_bill_customer_sk#61, ws_net_paid#62, d_year#65] +Arguments: [ws_bill_customer_sk#61 ASC NULLS FIRST], false, 0 + +(75) ReusedExchange [Reuses operator id: 15] +Output [4]: [c_customer_sk#67, c_customer_id#68, c_first_name#69, c_last_name#70] + +(76) Sort [codegen id : 31] +Input [4]: [c_customer_sk#67, c_customer_id#68, c_first_name#69, c_last_name#70] +Arguments: [c_customer_sk#67 ASC NULLS FIRST], false, 0 + +(77) SortMergeJoin [codegen id : 32] +Left keys [1]: [ws_bill_customer_sk#61] +Right keys [1]: [c_customer_sk#67] +Join condition: None + +(78) Project [codegen id : 32] +Output [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, ws_net_paid#62, d_year#65] +Input [7]: [ws_bill_customer_sk#61, ws_net_paid#62, d_year#65, c_customer_sk#67, c_customer_id#68, c_first_name#69, c_last_name#70] + +(79) HashAggregate [codegen id : 32] +Input [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, ws_net_paid#62, d_year#65] +Keys [4]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#62))] +Aggregate Attributes [1]: [sum#71] +Results [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65, sum#72] + +(80) Exchange +Input [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65, sum#72] +Arguments: hashpartitioning(c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65, 5), ENSURE_REQUIREMENTS, [id=#73] + +(81) HashAggregate [codegen id : 33] +Input [5]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65, sum#72] +Keys [4]: [c_customer_id#68, c_first_name#69, c_last_name#70, d_year#65] +Functions [1]: [sum(UnscaledValue(ws_net_paid#62))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#62))#74] +Results [2]: [c_customer_id#68 AS customer_id#75, MakeDecimal(sum(UnscaledValue(ws_net_paid#62))#74,17,2) AS year_total#76] + +(82) Exchange +Input [2]: [customer_id#75, year_total#76] +Arguments: hashpartitioning(customer_id#75, 5), ENSURE_REQUIREMENTS, [id=#77] + +(83) Sort [codegen id : 34] +Input [2]: [customer_id#75, year_total#76] +Arguments: [customer_id#75 ASC NULLS FIRST], false, 0 + +(84) SortMergeJoin [codegen id : 35] +Left keys [1]: [customer_id#18] +Right keys [1]: [customer_id#75] +Join condition: (CASE WHEN (year_total#59 > 0.00) THEN CheckOverflow((promote_precision(year_total#76) / promote_precision(year_total#59)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#19 > 0.00) THEN CheckOverflow((promote_precision(year_total#40) / promote_precision(year_total#19)), DecimalType(37,20), true) ELSE null END) + +(85) Project [codegen id : 35] +Output [3]: [customer_id#37, customer_first_name#38, customer_last_name#39] +Input [9]: [customer_id#18, year_total#19, customer_id#37, customer_first_name#38, customer_last_name#39, year_total#40, year_total#59, customer_id#75, year_total#76] + +(86) TakeOrderedAndProject +Input [3]: [customer_id#37, customer_first_name#38, customer_last_name#39] +Arguments: 100, [customer_first_name#38 ASC NULLS FIRST, customer_id#37 ASC NULLS FIRST, customer_last_name#39 ASC NULLS FIRST], [customer_id#37, customer_first_name#38, customer_last_name#39] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (87) + + +(87) ReusedExchange [Reuses operator id: 7] +Output [2]: [d_date_sk#5, d_year#6] + +Subquery:2 Hosting operator id = 25 Hosting Expression = ss_sold_date_sk#23 IN dynamicpruning#24 +ReusedExchange (88) + + +(88) ReusedExchange [Reuses operator id: 31] +Output [2]: [d_date_sk#25, d_year#26] + +Subquery:3 Hosting operator id = 46 Hosting Expression = ws_sold_date_sk#44 IN dynamicpruning#4 + +Subquery:4 Hosting operator id = 67 Hosting Expression = ws_sold_date_sk#63 IN dynamicpruning#24 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/simplified.txt new file mode 100644 index 0000000000000..7152af691bd03 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74.sf100/simplified.txt @@ -0,0 +1,163 @@ +TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] + WholeStageCodegen (35) + Project [customer_id,customer_first_name,customer_last_name] + SortMergeJoin [customer_id,customer_id,year_total,year_total,year_total,year_total] + InputAdapter + WholeStageCodegen (26) + Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,year_total,year_total] + SortMergeJoin [customer_id,customer_id] + InputAdapter + WholeStageCodegen (17) + SortMergeJoin [customer_id,customer_id] + InputAdapter + WholeStageCodegen (8) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #1 + WholeStageCodegen (7) + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #2 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (3) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #3 + WholeStageCodegen (2) + Project [ss_customer_sk,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_net_paid,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (5) + Sort [c_customer_sk] + InputAdapter + Exchange [c_customer_sk] #5 + WholeStageCodegen (4) + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + WholeStageCodegen (16) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #6 + WholeStageCodegen (15) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,customer_first_name,customer_last_name,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #7 + WholeStageCodegen (14) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + SortMergeJoin [ss_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_customer_sk] + InputAdapter + Exchange [ss_customer_sk] #8 + WholeStageCodegen (10) + Project [ss_customer_sk,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_net_paid,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #9 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (9) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (13) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name] #5 + InputAdapter + WholeStageCodegen (25) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #10 + WholeStageCodegen (24) + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ws_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #11 + WholeStageCodegen (23) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ws_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ws_net_paid,d_year] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (20) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #12 + WholeStageCodegen (19) + Project [ws_bill_customer_sk,ws_net_paid,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_net_paid,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year] #4 + InputAdapter + WholeStageCodegen (22) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name] #5 + InputAdapter + WholeStageCodegen (34) + Sort [customer_id] + InputAdapter + Exchange [customer_id] #13 + WholeStageCodegen (33) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ws_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #14 + WholeStageCodegen (32) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ws_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ws_net_paid,d_year] + SortMergeJoin [ws_bill_customer_sk,c_customer_sk] + InputAdapter + WholeStageCodegen (29) + Sort [ws_bill_customer_sk] + InputAdapter + Exchange [ws_bill_customer_sk] #15 + WholeStageCodegen (28) + Project [ws_bill_customer_sk,ws_net_paid,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_net_paid,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year] #9 + InputAdapter + WholeStageCodegen (31) + Sort [c_customer_sk] + InputAdapter + ReusedExchange [c_customer_sk,c_customer_id,c_first_name,c_last_name] #5 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/explain.txt new file mode 100644 index 0000000000000..3ee6b56189888 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/explain.txt @@ -0,0 +1,471 @@ +== Physical Plan == +TakeOrderedAndProject (78) ++- * Project (77) + +- * BroadcastHashJoin Inner BuildRight (76) + :- * Project (59) + : +- * BroadcastHashJoin Inner BuildRight (58) + : :- * BroadcastHashJoin Inner BuildRight (39) + : : :- * Filter (19) + : : : +- * HashAggregate (18) + : : : +- Exchange (17) + : : : +- * HashAggregate (16) + : : : +- * Project (15) + : : : +- * BroadcastHashJoin Inner BuildRight (14) + : : : :- * Project (9) + : : : : +- * BroadcastHashJoin Inner BuildRight (8) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.customer (1) + : : : : +- BroadcastExchange (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.store_sales (4) + : : : +- BroadcastExchange (13) + : : : +- * Filter (12) + : : : +- * ColumnarToRow (11) + : : : +- Scan parquet default.date_dim (10) + : : +- BroadcastExchange (38) + : : +- * HashAggregate (37) + : : +- Exchange (36) + : : +- * HashAggregate (35) + : : +- * Project (34) + : : +- * BroadcastHashJoin Inner BuildRight (33) + : : :- * Project (28) + : : : +- * BroadcastHashJoin Inner BuildRight (27) + : : : :- * Filter (22) + : : : : +- * ColumnarToRow (21) + : : : : +- Scan parquet default.customer (20) + : : : +- BroadcastExchange (26) + : : : +- * Filter (25) + : : : +- * ColumnarToRow (24) + : : : +- Scan parquet default.store_sales (23) + : : +- BroadcastExchange (32) + : : +- * Filter (31) + : : +- * ColumnarToRow (30) + : : +- Scan parquet default.date_dim (29) + : +- BroadcastExchange (57) + : +- * Project (56) + : +- * Filter (55) + : +- * HashAggregate (54) + : +- Exchange (53) + : +- * HashAggregate (52) + : +- * Project (51) + : +- * BroadcastHashJoin Inner BuildRight (50) + : :- * Project (48) + : : +- * BroadcastHashJoin Inner BuildRight (47) + : : :- * Filter (42) + : : : +- * ColumnarToRow (41) + : : : +- Scan parquet default.customer (40) + : : +- BroadcastExchange (46) + : : +- * Filter (45) + : : +- * ColumnarToRow (44) + : : +- Scan parquet default.web_sales (43) + : +- ReusedExchange (49) + +- BroadcastExchange (75) + +- * HashAggregate (74) + +- Exchange (73) + +- * HashAggregate (72) + +- * Project (71) + +- * BroadcastHashJoin Inner BuildRight (70) + :- * Project (68) + : +- * BroadcastHashJoin Inner BuildRight (67) + : :- * Filter (62) + : : +- * ColumnarToRow (61) + : : +- Scan parquet default.customer (60) + : +- BroadcastExchange (66) + : +- * Filter (65) + : +- * ColumnarToRow (64) + : +- Scan parquet default.web_sales (63) + +- ReusedExchange (69) + + +(1) Scan parquet default.customer +Output [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] + +(3) Filter [codegen id : 3] +Input [4]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4] +Condition : (isnotnull(c_customer_sk#1) AND isnotnull(c_customer_id#2)) + +(4) Scan parquet default.store_sales +Output [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7] + +(6) Filter [codegen id : 1] +Input [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7] +Condition : isnotnull(ss_customer_sk#5) + +(7) BroadcastExchange +Input [3]: [ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#9] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [c_customer_sk#1] +Right keys [1]: [ss_customer_sk#5] +Join condition: None + +(9) Project [codegen id : 3] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, ss_sold_date_sk#7] +Input [7]: [c_customer_sk#1, c_customer_id#2, c_first_name#3, c_last_name#4, ss_customer_sk#5, ss_net_paid#6, ss_sold_date_sk#7] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#10, d_year#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#10, d_year#11] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#10, d_year#11] +Condition : (((isnotnull(d_year#11) AND (d_year#11 = 2001)) AND d_year#11 IN (2001,2002)) AND isnotnull(d_date_sk#10)) + +(13) BroadcastExchange +Input [2]: [d_date_sk#10, d_year#11] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#12] + +(14) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#10] +Join condition: None + +(15) Project [codegen id : 3] +Output [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, d_year#11] +Input [7]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, ss_sold_date_sk#7, d_date_sk#10, d_year#11] + +(16) HashAggregate [codegen id : 3] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, ss_net_paid#6, d_year#11] +Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#11] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#6))] +Aggregate Attributes [1]: [sum#13] +Results [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#11, sum#14] + +(17) Exchange +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#11, sum#14] +Arguments: hashpartitioning(c_customer_id#2, c_first_name#3, c_last_name#4, d_year#11, 5), ENSURE_REQUIREMENTS, [id=#15] + +(18) HashAggregate [codegen id : 16] +Input [5]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#11, sum#14] +Keys [4]: [c_customer_id#2, c_first_name#3, c_last_name#4, d_year#11] +Functions [1]: [sum(UnscaledValue(ss_net_paid#6))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#6))#16] +Results [2]: [c_customer_id#2 AS customer_id#17, MakeDecimal(sum(UnscaledValue(ss_net_paid#6))#16,17,2) AS year_total#18] + +(19) Filter [codegen id : 16] +Input [2]: [customer_id#17, year_total#18] +Condition : (isnotnull(year_total#18) AND (year_total#18 > 0.00)) + +(20) Scan parquet default.customer +Output [4]: [c_customer_sk#19, c_customer_id#20, c_first_name#21, c_last_name#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [4]: [c_customer_sk#19, c_customer_id#20, c_first_name#21, c_last_name#22] + +(22) Filter [codegen id : 6] +Input [4]: [c_customer_sk#19, c_customer_id#20, c_first_name#21, c_last_name#22] +Condition : (isnotnull(c_customer_sk#19) AND isnotnull(c_customer_id#20)) + +(23) Scan parquet default.store_sales +Output [3]: [ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#25), dynamicpruningexpression(ss_sold_date_sk#25 IN dynamicpruning#26)] +PushedFilters: [IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(24) ColumnarToRow [codegen id : 4] +Input [3]: [ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25] + +(25) Filter [codegen id : 4] +Input [3]: [ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25] +Condition : isnotnull(ss_customer_sk#23) + +(26) BroadcastExchange +Input [3]: [ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [c_customer_sk#19] +Right keys [1]: [ss_customer_sk#23] +Join condition: None + +(28) Project [codegen id : 6] +Output [5]: [c_customer_id#20, c_first_name#21, c_last_name#22, ss_net_paid#24, ss_sold_date_sk#25] +Input [7]: [c_customer_sk#19, c_customer_id#20, c_first_name#21, c_last_name#22, ss_customer_sk#23, ss_net_paid#24, ss_sold_date_sk#25] + +(29) Scan parquet default.date_dim +Output [2]: [d_date_sk#28, d_year#29] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), In(d_year, [2001,2002]), IsNotNull(d_date_sk)] +ReadSchema: struct + +(30) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#28, d_year#29] + +(31) Filter [codegen id : 5] +Input [2]: [d_date_sk#28, d_year#29] +Condition : (((isnotnull(d_year#29) AND (d_year#29 = 2002)) AND d_year#29 IN (2001,2002)) AND isnotnull(d_date_sk#28)) + +(32) BroadcastExchange +Input [2]: [d_date_sk#28, d_year#29] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#30] + +(33) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#25] +Right keys [1]: [d_date_sk#28] +Join condition: None + +(34) Project [codegen id : 6] +Output [5]: [c_customer_id#20, c_first_name#21, c_last_name#22, ss_net_paid#24, d_year#29] +Input [7]: [c_customer_id#20, c_first_name#21, c_last_name#22, ss_net_paid#24, ss_sold_date_sk#25, d_date_sk#28, d_year#29] + +(35) HashAggregate [codegen id : 6] +Input [5]: [c_customer_id#20, c_first_name#21, c_last_name#22, ss_net_paid#24, d_year#29] +Keys [4]: [c_customer_id#20, c_first_name#21, c_last_name#22, d_year#29] +Functions [1]: [partial_sum(UnscaledValue(ss_net_paid#24))] +Aggregate Attributes [1]: [sum#31] +Results [5]: [c_customer_id#20, c_first_name#21, c_last_name#22, d_year#29, sum#32] + +(36) Exchange +Input [5]: [c_customer_id#20, c_first_name#21, c_last_name#22, d_year#29, sum#32] +Arguments: hashpartitioning(c_customer_id#20, c_first_name#21, c_last_name#22, d_year#29, 5), ENSURE_REQUIREMENTS, [id=#33] + +(37) HashAggregate [codegen id : 7] +Input [5]: [c_customer_id#20, c_first_name#21, c_last_name#22, d_year#29, sum#32] +Keys [4]: [c_customer_id#20, c_first_name#21, c_last_name#22, d_year#29] +Functions [1]: [sum(UnscaledValue(ss_net_paid#24))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_net_paid#24))#34] +Results [4]: [c_customer_id#20 AS customer_id#35, c_first_name#21 AS customer_first_name#36, c_last_name#22 AS customer_last_name#37, MakeDecimal(sum(UnscaledValue(ss_net_paid#24))#34,17,2) AS year_total#38] + +(38) BroadcastExchange +Input [4]: [customer_id#35, customer_first_name#36, customer_last_name#37, year_total#38] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#39] + +(39) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#17] +Right keys [1]: [customer_id#35] +Join condition: None + +(40) Scan parquet default.customer +Output [4]: [c_customer_sk#40, c_customer_id#41, c_first_name#42, c_last_name#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(41) ColumnarToRow [codegen id : 10] +Input [4]: [c_customer_sk#40, c_customer_id#41, c_first_name#42, c_last_name#43] + +(42) Filter [codegen id : 10] +Input [4]: [c_customer_sk#40, c_customer_id#41, c_first_name#42, c_last_name#43] +Condition : (isnotnull(c_customer_sk#40) AND isnotnull(c_customer_id#41)) + +(43) Scan parquet default.web_sales +Output [3]: [ws_bill_customer_sk#44, ws_net_paid#45, ws_sold_date_sk#46] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#46), dynamicpruningexpression(ws_sold_date_sk#46 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(44) ColumnarToRow [codegen id : 8] +Input [3]: [ws_bill_customer_sk#44, ws_net_paid#45, ws_sold_date_sk#46] + +(45) Filter [codegen id : 8] +Input [3]: [ws_bill_customer_sk#44, ws_net_paid#45, ws_sold_date_sk#46] +Condition : isnotnull(ws_bill_customer_sk#44) + +(46) BroadcastExchange +Input [3]: [ws_bill_customer_sk#44, ws_net_paid#45, ws_sold_date_sk#46] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#47] + +(47) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [c_customer_sk#40] +Right keys [1]: [ws_bill_customer_sk#44] +Join condition: None + +(48) Project [codegen id : 10] +Output [5]: [c_customer_id#41, c_first_name#42, c_last_name#43, ws_net_paid#45, ws_sold_date_sk#46] +Input [7]: [c_customer_sk#40, c_customer_id#41, c_first_name#42, c_last_name#43, ws_bill_customer_sk#44, ws_net_paid#45, ws_sold_date_sk#46] + +(49) ReusedExchange [Reuses operator id: 13] +Output [2]: [d_date_sk#48, d_year#49] + +(50) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ws_sold_date_sk#46] +Right keys [1]: [d_date_sk#48] +Join condition: None + +(51) Project [codegen id : 10] +Output [5]: [c_customer_id#41, c_first_name#42, c_last_name#43, ws_net_paid#45, d_year#49] +Input [7]: [c_customer_id#41, c_first_name#42, c_last_name#43, ws_net_paid#45, ws_sold_date_sk#46, d_date_sk#48, d_year#49] + +(52) HashAggregate [codegen id : 10] +Input [5]: [c_customer_id#41, c_first_name#42, c_last_name#43, ws_net_paid#45, d_year#49] +Keys [4]: [c_customer_id#41, c_first_name#42, c_last_name#43, d_year#49] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#45))] +Aggregate Attributes [1]: [sum#50] +Results [5]: [c_customer_id#41, c_first_name#42, c_last_name#43, d_year#49, sum#51] + +(53) Exchange +Input [5]: [c_customer_id#41, c_first_name#42, c_last_name#43, d_year#49, sum#51] +Arguments: hashpartitioning(c_customer_id#41, c_first_name#42, c_last_name#43, d_year#49, 5), ENSURE_REQUIREMENTS, [id=#52] + +(54) HashAggregate [codegen id : 11] +Input [5]: [c_customer_id#41, c_first_name#42, c_last_name#43, d_year#49, sum#51] +Keys [4]: [c_customer_id#41, c_first_name#42, c_last_name#43, d_year#49] +Functions [1]: [sum(UnscaledValue(ws_net_paid#45))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#45))#53] +Results [2]: [c_customer_id#41 AS customer_id#54, MakeDecimal(sum(UnscaledValue(ws_net_paid#45))#53,17,2) AS year_total#55] + +(55) Filter [codegen id : 11] +Input [2]: [customer_id#54, year_total#55] +Condition : (isnotnull(year_total#55) AND (year_total#55 > 0.00)) + +(56) Project [codegen id : 11] +Output [2]: [customer_id#54 AS customer_id#56, year_total#55 AS year_total#57] +Input [2]: [customer_id#54, year_total#55] + +(57) BroadcastExchange +Input [2]: [customer_id#56, year_total#57] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#58] + +(58) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#17] +Right keys [1]: [customer_id#56] +Join condition: None + +(59) Project [codegen id : 16] +Output [7]: [customer_id#17, year_total#18, customer_id#35, customer_first_name#36, customer_last_name#37, year_total#38, year_total#57] +Input [8]: [customer_id#17, year_total#18, customer_id#35, customer_first_name#36, customer_last_name#37, year_total#38, customer_id#56, year_total#57] + +(60) Scan parquet default.customer +Output [4]: [c_customer_sk#59, c_customer_id#60, c_first_name#61, c_last_name#62] +Batched: true +Location [not included in comparison]/{warehouse_dir}/customer] +PushedFilters: [IsNotNull(c_customer_sk), IsNotNull(c_customer_id)] +ReadSchema: struct + +(61) ColumnarToRow [codegen id : 14] +Input [4]: [c_customer_sk#59, c_customer_id#60, c_first_name#61, c_last_name#62] + +(62) Filter [codegen id : 14] +Input [4]: [c_customer_sk#59, c_customer_id#60, c_first_name#61, c_last_name#62] +Condition : (isnotnull(c_customer_sk#59) AND isnotnull(c_customer_id#60)) + +(63) Scan parquet default.web_sales +Output [3]: [ws_bill_customer_sk#63, ws_net_paid#64, ws_sold_date_sk#65] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#65), dynamicpruningexpression(ws_sold_date_sk#65 IN dynamicpruning#26)] +PushedFilters: [IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(64) ColumnarToRow [codegen id : 12] +Input [3]: [ws_bill_customer_sk#63, ws_net_paid#64, ws_sold_date_sk#65] + +(65) Filter [codegen id : 12] +Input [3]: [ws_bill_customer_sk#63, ws_net_paid#64, ws_sold_date_sk#65] +Condition : isnotnull(ws_bill_customer_sk#63) + +(66) BroadcastExchange +Input [3]: [ws_bill_customer_sk#63, ws_net_paid#64, ws_sold_date_sk#65] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#66] + +(67) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [c_customer_sk#59] +Right keys [1]: [ws_bill_customer_sk#63] +Join condition: None + +(68) Project [codegen id : 14] +Output [5]: [c_customer_id#60, c_first_name#61, c_last_name#62, ws_net_paid#64, ws_sold_date_sk#65] +Input [7]: [c_customer_sk#59, c_customer_id#60, c_first_name#61, c_last_name#62, ws_bill_customer_sk#63, ws_net_paid#64, ws_sold_date_sk#65] + +(69) ReusedExchange [Reuses operator id: 32] +Output [2]: [d_date_sk#67, d_year#68] + +(70) BroadcastHashJoin [codegen id : 14] +Left keys [1]: [ws_sold_date_sk#65] +Right keys [1]: [d_date_sk#67] +Join condition: None + +(71) Project [codegen id : 14] +Output [5]: [c_customer_id#60, c_first_name#61, c_last_name#62, ws_net_paid#64, d_year#68] +Input [7]: [c_customer_id#60, c_first_name#61, c_last_name#62, ws_net_paid#64, ws_sold_date_sk#65, d_date_sk#67, d_year#68] + +(72) HashAggregate [codegen id : 14] +Input [5]: [c_customer_id#60, c_first_name#61, c_last_name#62, ws_net_paid#64, d_year#68] +Keys [4]: [c_customer_id#60, c_first_name#61, c_last_name#62, d_year#68] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#64))] +Aggregate Attributes [1]: [sum#69] +Results [5]: [c_customer_id#60, c_first_name#61, c_last_name#62, d_year#68, sum#70] + +(73) Exchange +Input [5]: [c_customer_id#60, c_first_name#61, c_last_name#62, d_year#68, sum#70] +Arguments: hashpartitioning(c_customer_id#60, c_first_name#61, c_last_name#62, d_year#68, 5), ENSURE_REQUIREMENTS, [id=#71] + +(74) HashAggregate [codegen id : 15] +Input [5]: [c_customer_id#60, c_first_name#61, c_last_name#62, d_year#68, sum#70] +Keys [4]: [c_customer_id#60, c_first_name#61, c_last_name#62, d_year#68] +Functions [1]: [sum(UnscaledValue(ws_net_paid#64))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#64))#72] +Results [2]: [c_customer_id#60 AS customer_id#73, MakeDecimal(sum(UnscaledValue(ws_net_paid#64))#72,17,2) AS year_total#74] + +(75) BroadcastExchange +Input [2]: [customer_id#73, year_total#74] +Arguments: HashedRelationBroadcastMode(List(input[0, string, true]),false), [id=#75] + +(76) BroadcastHashJoin [codegen id : 16] +Left keys [1]: [customer_id#17] +Right keys [1]: [customer_id#73] +Join condition: (CASE WHEN (year_total#57 > 0.00) THEN CheckOverflow((promote_precision(year_total#74) / promote_precision(year_total#57)), DecimalType(37,20), true) ELSE null END > CASE WHEN (year_total#18 > 0.00) THEN CheckOverflow((promote_precision(year_total#38) / promote_precision(year_total#18)), DecimalType(37,20), true) ELSE null END) + +(77) Project [codegen id : 16] +Output [3]: [customer_id#35, customer_first_name#36, customer_last_name#37] +Input [9]: [customer_id#17, year_total#18, customer_id#35, customer_first_name#36, customer_last_name#37, year_total#38, year_total#57, customer_id#73, year_total#74] + +(78) TakeOrderedAndProject +Input [3]: [customer_id#35, customer_first_name#36, customer_last_name#37] +Arguments: 100, [customer_first_name#36 ASC NULLS FIRST, customer_id#35 ASC NULLS FIRST, customer_last_name#37 ASC NULLS FIRST], [customer_id#35, customer_first_name#36, customer_last_name#37] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 4 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (79) + + +(79) ReusedExchange [Reuses operator id: 13] +Output [2]: [d_date_sk#10, d_year#11] + +Subquery:2 Hosting operator id = 23 Hosting Expression = ss_sold_date_sk#25 IN dynamicpruning#26 +ReusedExchange (80) + + +(80) ReusedExchange [Reuses operator id: 32] +Output [2]: [d_date_sk#28, d_year#29] + +Subquery:3 Hosting operator id = 43 Hosting Expression = ws_sold_date_sk#46 IN dynamicpruning#8 + +Subquery:4 Hosting operator id = 63 Hosting Expression = ws_sold_date_sk#65 IN dynamicpruning#26 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/simplified.txt new file mode 100644 index 0000000000000..1304bdd334213 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q74/simplified.txt @@ -0,0 +1,123 @@ +TakeOrderedAndProject [customer_first_name,customer_id,customer_last_name] + WholeStageCodegen (16) + Project [customer_id,customer_first_name,customer_last_name] + BroadcastHashJoin [customer_id,customer_id,year_total,year_total,year_total,year_total] + Project [customer_id,year_total,customer_id,customer_first_name,customer_last_name,year_total,year_total] + BroadcastHashJoin [customer_id,customer_id] + BroadcastHashJoin [customer_id,customer_id] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #1 + WholeStageCodegen (3) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #2 + WholeStageCodegen (1) + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_net_paid,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (7) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ss_net_paid)),customer_id,customer_first_name,customer_last_name,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #5 + WholeStageCodegen (6) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ss_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,ss_net_paid,ss_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ss_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (4) + Filter [ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_customer_sk,ss_net_paid,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #7 + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (5) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (11) + Project [customer_id,year_total] + Filter [year_total] + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ws_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #9 + WholeStageCodegen (10) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ws_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ws_net_paid,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,ws_net_paid,ws_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #10 + WholeStageCodegen (8) + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_net_paid,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + BroadcastExchange #11 + WholeStageCodegen (15) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,sum] [sum(UnscaledValue(ws_net_paid)),customer_id,year_total,sum] + InputAdapter + Exchange [c_customer_id,c_first_name,c_last_name,d_year] #12 + WholeStageCodegen (14) + HashAggregate [c_customer_id,c_first_name,c_last_name,d_year,ws_net_paid] [sum,sum] + Project [c_customer_id,c_first_name,c_last_name,ws_net_paid,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [c_customer_id,c_first_name,c_last_name,ws_net_paid,ws_sold_date_sk] + BroadcastHashJoin [c_customer_sk,ws_bill_customer_sk] + Filter [c_customer_sk,c_customer_id] + ColumnarToRow + InputAdapter + Scan parquet default.customer [c_customer_sk,c_customer_id,c_first_name,c_last_name] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (12) + Filter [ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_bill_customer_sk,ws_net_paid,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [d_date_sk,d_year] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt new file mode 100644 index 0000000000000..eb5287bfa8850 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/explain.txt @@ -0,0 +1,750 @@ +== Physical Plan == +TakeOrderedAndProject (133) ++- * Project (132) + +- * SortMergeJoin Inner (131) + :- * Sort (73) + : +- Exchange (72) + : +- * HashAggregate (71) + : +- Exchange (70) + : +- * HashAggregate (69) + : +- * HashAggregate (68) + : +- Exchange (67) + : +- * HashAggregate (66) + : +- Union (65) + : :- * Project (26) + : : +- * SortMergeJoin LeftOuter (25) + : : :- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.item (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.date_dim (11) + : : +- * Sort (24) + : : +- Exchange (23) + : : +- * Project (22) + : : +- * Filter (21) + : : +- * ColumnarToRow (20) + : : +- Scan parquet default.catalog_returns (19) + : :- * Project (45) + : : +- * SortMergeJoin LeftOuter (44) + : : :- * Sort (37) + : : : +- Exchange (36) + : : : +- * Project (35) + : : : +- * BroadcastHashJoin Inner BuildRight (34) + : : : :- * Project (32) + : : : : +- * BroadcastHashJoin Inner BuildRight (31) + : : : : :- * Filter (29) + : : : : : +- * ColumnarToRow (28) + : : : : : +- Scan parquet default.store_sales (27) + : : : : +- ReusedExchange (30) + : : : +- ReusedExchange (33) + : : +- * Sort (43) + : : +- Exchange (42) + : : +- * Project (41) + : : +- * Filter (40) + : : +- * ColumnarToRow (39) + : : +- Scan parquet default.store_returns (38) + : +- * Project (64) + : +- * SortMergeJoin LeftOuter (63) + : :- * Sort (56) + : : +- Exchange (55) + : : +- * Project (54) + : : +- * BroadcastHashJoin Inner BuildRight (53) + : : :- * Project (51) + : : : +- * BroadcastHashJoin Inner BuildRight (50) + : : : :- * Filter (48) + : : : : +- * ColumnarToRow (47) + : : : : +- Scan parquet default.web_sales (46) + : : : +- ReusedExchange (49) + : : +- ReusedExchange (52) + : +- * Sort (62) + : +- Exchange (61) + : +- * Project (60) + : +- * Filter (59) + : +- * ColumnarToRow (58) + : +- Scan parquet default.web_returns (57) + +- * Sort (130) + +- Exchange (129) + +- * HashAggregate (128) + +- Exchange (127) + +- * HashAggregate (126) + +- * HashAggregate (125) + +- Exchange (124) + +- * HashAggregate (123) + +- Union (122) + :- * Project (91) + : +- * SortMergeJoin LeftOuter (90) + : :- * Sort (87) + : : +- Exchange (86) + : : +- * Project (85) + : : +- * BroadcastHashJoin Inner BuildRight (84) + : : :- * Project (79) + : : : +- * BroadcastHashJoin Inner BuildRight (78) + : : : :- * Filter (76) + : : : : +- * ColumnarToRow (75) + : : : : +- Scan parquet default.catalog_sales (74) + : : : +- ReusedExchange (77) + : : +- BroadcastExchange (83) + : : +- * Filter (82) + : : +- * ColumnarToRow (81) + : : +- Scan parquet default.date_dim (80) + : +- * Sort (89) + : +- ReusedExchange (88) + :- * Project (106) + : +- * SortMergeJoin LeftOuter (105) + : :- * Sort (102) + : : +- Exchange (101) + : : +- * Project (100) + : : +- * BroadcastHashJoin Inner BuildRight (99) + : : :- * Project (97) + : : : +- * BroadcastHashJoin Inner BuildRight (96) + : : : :- * Filter (94) + : : : : +- * ColumnarToRow (93) + : : : : +- Scan parquet default.store_sales (92) + : : : +- ReusedExchange (95) + : : +- ReusedExchange (98) + : +- * Sort (104) + : +- ReusedExchange (103) + +- * Project (121) + +- * SortMergeJoin LeftOuter (120) + :- * Sort (117) + : +- Exchange (116) + : +- * Project (115) + : +- * BroadcastHashJoin Inner BuildRight (114) + : :- * Project (112) + : : +- * BroadcastHashJoin Inner BuildRight (111) + : : :- * Filter (109) + : : : +- * ColumnarToRow (108) + : : : +- Scan parquet default.web_sales (107) + : : +- ReusedExchange (110) + : +- ReusedExchange (113) + +- * Sort (119) + +- ReusedExchange (118) + + +(1) Scan parquet default.catalog_sales +Output [5]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [5]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5] + +(3) Filter [codegen id : 3] +Input [5]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5] +Condition : isnotnull(cs_item_sk#1) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Books ), IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id), IsNotNull(i_manufact_id)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] + +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] +Condition : ((((((isnotnull(i_category#11) AND (i_category#11 = Books )) AND isnotnull(i_item_sk#7)) AND isnotnull(i_brand_id#8)) AND isnotnull(i_class_id#9)) AND isnotnull(i_category_id#10)) AND isnotnull(i_manufact_id#12)) + +(7) Project [codegen id : 1] +Output [5]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Input [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] + +(8) BroadcastExchange +Input [5]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_item_sk#1] +Right keys [1]: [i_item_sk#7] +Join condition: None + +(10) Project [codegen id : 3] +Output [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Input [10]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5, i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#14, d_year#15] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#14, d_year#15] +Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2002)) AND isnotnull(d_date_sk#14)) + +(14) BroadcastExchange +Input [2]: [d_date_sk#14, d_year#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#5] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(16) Project [codegen id : 3] +Output [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15] +Input [11]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_date_sk#14, d_year#15] + +(17) Exchange +Input [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15] +Arguments: hashpartitioning(cs_order_number#2, cs_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#17] + +(18) Sort [codegen id : 4] +Input [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15] +Arguments: [cs_order_number#2 ASC NULLS FIRST, cs_item_sk#1 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.catalog_returns +Output [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 5] +Input [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] + +(21) Filter [codegen id : 5] +Input [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] +Condition : (isnotnull(cr_order_number#19) AND isnotnull(cr_item_sk#18)) + +(22) Project [codegen id : 5] +Output [4]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] +Input [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] + +(23) Exchange +Input [4]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] +Arguments: hashpartitioning(cr_order_number#19, cr_item_sk#18, 5), ENSURE_REQUIREMENTS, [id=#23] + +(24) Sort [codegen id : 6] +Input [4]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] +Arguments: [cr_order_number#19 ASC NULLS FIRST, cr_item_sk#18 ASC NULLS FIRST], false, 0 + +(25) SortMergeJoin [codegen id : 7] +Left keys [2]: [cs_order_number#2, cs_item_sk#1] +Right keys [2]: [cr_order_number#19, cr_item_sk#18] +Join condition: None + +(26) Project [codegen id : 7] +Output [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, (cs_quantity#3 - coalesce(cr_return_quantity#20, 0)) AS sales_cnt#24, CheckOverflow((promote_precision(cast(cs_ext_sales_price#4 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#21, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#25] +Input [13]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15, cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] + +(27) Scan parquet default.store_sales +Output [5]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#30), dynamicpruningexpression(ss_sold_date_sk#30 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 10] +Input [5]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30] + +(29) Filter [codegen id : 10] +Input [5]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30] +Condition : isnotnull(ss_item_sk#26) + +(30) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#31, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35] + +(31) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_item_sk#26] +Right keys [1]: [i_item_sk#31] +Join condition: None + +(32) Project [codegen id : 10] +Output [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35] +Input [10]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30, i_item_sk#31, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35] + +(33) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#36, d_year#37] + +(34) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#30] +Right keys [1]: [d_date_sk#36] +Join condition: None + +(35) Project [codegen id : 10] +Output [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] +Input [11]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_date_sk#36, d_year#37] + +(36) Exchange +Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] +Arguments: hashpartitioning(ss_ticket_number#27, ss_item_sk#26, 5), ENSURE_REQUIREMENTS, [id=#38] + +(37) Sort [codegen id : 11] +Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] +Arguments: [ss_ticket_number#27 ASC NULLS FIRST, ss_item_sk#26 ASC NULLS FIRST], false, 0 + +(38) Scan parquet default.store_returns +Output [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 12] +Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] + +(40) Filter [codegen id : 12] +Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] +Condition : (isnotnull(sr_ticket_number#40) AND isnotnull(sr_item_sk#39)) + +(41) Project [codegen id : 12] +Output [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] +Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] + +(42) Exchange +Input [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] +Arguments: hashpartitioning(sr_ticket_number#40, sr_item_sk#39, 5), ENSURE_REQUIREMENTS, [id=#44] + +(43) Sort [codegen id : 13] +Input [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] +Arguments: [sr_ticket_number#40 ASC NULLS FIRST, sr_item_sk#39 ASC NULLS FIRST], false, 0 + +(44) SortMergeJoin [codegen id : 14] +Left keys [2]: [ss_ticket_number#27, ss_item_sk#26] +Right keys [2]: [sr_ticket_number#40, sr_item_sk#39] +Join condition: None + +(45) Project [codegen id : 14] +Output [7]: [d_year#37, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, (ss_quantity#28 - coalesce(sr_return_quantity#41, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#29 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#42, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#46] +Input [13]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37, sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] + +(46) Scan parquet default.web_sales +Output [5]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#51), dynamicpruningexpression(ws_sold_date_sk#51 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 17] +Input [5]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51] + +(48) Filter [codegen id : 17] +Input [5]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51] +Condition : isnotnull(ws_item_sk#47) + +(49) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#52, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56] + +(50) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_item_sk#47] +Right keys [1]: [i_item_sk#52] +Join condition: None + +(51) Project [codegen id : 17] +Output [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56] +Input [10]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51, i_item_sk#52, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56] + +(52) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#57, d_year#58] + +(53) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#51] +Right keys [1]: [d_date_sk#57] +Join condition: None + +(54) Project [codegen id : 17] +Output [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] +Input [11]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_date_sk#57, d_year#58] + +(55) Exchange +Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] +Arguments: hashpartitioning(ws_order_number#48, ws_item_sk#47, 5), ENSURE_REQUIREMENTS, [id=#59] + +(56) Sort [codegen id : 18] +Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] +Arguments: [ws_order_number#48 ASC NULLS FIRST, ws_item_sk#47 ASC NULLS FIRST], false, 0 + +(57) Scan parquet default.web_returns +Output [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct + +(58) ColumnarToRow [codegen id : 19] +Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] + +(59) Filter [codegen id : 19] +Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] +Condition : (isnotnull(wr_order_number#61) AND isnotnull(wr_item_sk#60)) + +(60) Project [codegen id : 19] +Output [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] +Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] + +(61) Exchange +Input [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] +Arguments: hashpartitioning(wr_order_number#61, wr_item_sk#60, 5), ENSURE_REQUIREMENTS, [id=#65] + +(62) Sort [codegen id : 20] +Input [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] +Arguments: [wr_order_number#61 ASC NULLS FIRST, wr_item_sk#60 ASC NULLS FIRST], false, 0 + +(63) SortMergeJoin [codegen id : 21] +Left keys [2]: [ws_order_number#48, ws_item_sk#47] +Right keys [2]: [wr_order_number#61, wr_item_sk#60] +Join condition: None + +(64) Project [codegen id : 21] +Output [7]: [d_year#58, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, (ws_quantity#49 - coalesce(wr_return_quantity#62, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#50 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#63, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58, wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] + +(65) Union + +(66) HashAggregate [codegen id : 22] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] + +(67) Exchange +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Arguments: hashpartitioning(d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#68] + +(68) HashAggregate [codegen id : 23] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] + +(69) HashAggregate [codegen id : 23] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Keys [5]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Functions [2]: [partial_sum(sales_cnt#24), partial_sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum#69, sum#70] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum#71, sum#72] + +(70) Exchange +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum#71, sum#72] +Arguments: hashpartitioning(d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, 5), ENSURE_REQUIREMENTS, [id=#73] + +(71) HashAggregate [codegen id : 24] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum#71, sum#72] +Keys [5]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Functions [2]: [sum(sales_cnt#24), sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum(sales_cnt#24)#74, sum(UnscaledValue(sales_amt#25))#75] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum(sales_cnt#24)#74 AS sales_cnt#76, MakeDecimal(sum(UnscaledValue(sales_amt#25))#75,18,2) AS sales_amt#77] + +(72) Exchange +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77] +Arguments: hashpartitioning(i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, 5), ENSURE_REQUIREMENTS, [id=#78] + +(73) Sort [codegen id : 25] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77] +Arguments: [i_brand_id#8 ASC NULLS FIRST, i_class_id#9 ASC NULLS FIRST, i_category_id#10 ASC NULLS FIRST, i_manufact_id#12 ASC NULLS FIRST], false, 0 + +(74) Scan parquet default.catalog_sales +Output [5]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#83), dynamicpruningexpression(cs_sold_date_sk#83 IN dynamicpruning#84)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(75) ColumnarToRow [codegen id : 28] +Input [5]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83] + +(76) Filter [codegen id : 28] +Input [5]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83] +Condition : isnotnull(cs_item_sk#79) + +(77) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#85, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] + +(78) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [cs_item_sk#79] +Right keys [1]: [i_item_sk#85] +Join condition: None + +(79) Project [codegen id : 28] +Output [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Input [10]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83, i_item_sk#85, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] + +(80) Scan parquet default.date_dim +Output [2]: [d_date_sk#90, d_year#91] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(81) ColumnarToRow [codegen id : 27] +Input [2]: [d_date_sk#90, d_year#91] + +(82) Filter [codegen id : 27] +Input [2]: [d_date_sk#90, d_year#91] +Condition : ((isnotnull(d_year#91) AND (d_year#91 = 2001)) AND isnotnull(d_date_sk#90)) + +(83) BroadcastExchange +Input [2]: [d_date_sk#90, d_year#91] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#92] + +(84) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [cs_sold_date_sk#83] +Right keys [1]: [d_date_sk#90] +Join condition: None + +(85) Project [codegen id : 28] +Output [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91] +Input [11]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_date_sk#90, d_year#91] + +(86) Exchange +Input [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91] +Arguments: hashpartitioning(cs_order_number#80, cs_item_sk#79, 5), ENSURE_REQUIREMENTS, [id=#93] + +(87) Sort [codegen id : 29] +Input [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91] +Arguments: [cs_order_number#80 ASC NULLS FIRST, cs_item_sk#79 ASC NULLS FIRST], false, 0 + +(88) ReusedExchange [Reuses operator id: 23] +Output [4]: [cr_item_sk#94, cr_order_number#95, cr_return_quantity#96, cr_return_amount#97] + +(89) Sort [codegen id : 31] +Input [4]: [cr_item_sk#94, cr_order_number#95, cr_return_quantity#96, cr_return_amount#97] +Arguments: [cr_order_number#95 ASC NULLS FIRST, cr_item_sk#94 ASC NULLS FIRST], false, 0 + +(90) SortMergeJoin [codegen id : 32] +Left keys [2]: [cs_order_number#80, cs_item_sk#79] +Right keys [2]: [cr_order_number#95, cr_item_sk#94] +Join condition: None + +(91) Project [codegen id : 32] +Output [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, (cs_quantity#81 - coalesce(cr_return_quantity#96, 0)) AS sales_cnt#24, CheckOverflow((promote_precision(cast(cs_ext_sales_price#82 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#97, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#25] +Input [13]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91, cr_item_sk#94, cr_order_number#95, cr_return_quantity#96, cr_return_amount#97] + +(92) Scan parquet default.store_sales +Output [5]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#102), dynamicpruningexpression(ss_sold_date_sk#102 IN dynamicpruning#84)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(93) ColumnarToRow [codegen id : 35] +Input [5]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102] + +(94) Filter [codegen id : 35] +Input [5]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102] +Condition : isnotnull(ss_item_sk#98) + +(95) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#103, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107] + +(96) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [ss_item_sk#98] +Right keys [1]: [i_item_sk#103] +Join condition: None + +(97) Project [codegen id : 35] +Output [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107] +Input [10]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102, i_item_sk#103, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107] + +(98) ReusedExchange [Reuses operator id: 83] +Output [2]: [d_date_sk#108, d_year#109] + +(99) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [ss_sold_date_sk#102] +Right keys [1]: [d_date_sk#108] +Join condition: None + +(100) Project [codegen id : 35] +Output [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] +Input [11]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_date_sk#108, d_year#109] + +(101) Exchange +Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] +Arguments: hashpartitioning(ss_ticket_number#99, ss_item_sk#98, 5), ENSURE_REQUIREMENTS, [id=#110] + +(102) Sort [codegen id : 36] +Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] +Arguments: [ss_ticket_number#99 ASC NULLS FIRST, ss_item_sk#98 ASC NULLS FIRST], false, 0 + +(103) ReusedExchange [Reuses operator id: 42] +Output [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] + +(104) Sort [codegen id : 38] +Input [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] +Arguments: [sr_ticket_number#112 ASC NULLS FIRST, sr_item_sk#111 ASC NULLS FIRST], false, 0 + +(105) SortMergeJoin [codegen id : 39] +Left keys [2]: [ss_ticket_number#99, ss_item_sk#98] +Right keys [2]: [sr_ticket_number#112, sr_item_sk#111] +Join condition: None + +(106) Project [codegen id : 39] +Output [7]: [d_year#109, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, (ss_quantity#100 - coalesce(sr_return_quantity#113, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#101 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#114, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#46] +Input [13]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109, sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] + +(107) Scan parquet default.web_sales +Output [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#119), dynamicpruningexpression(ws_sold_date_sk#119 IN dynamicpruning#84)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(108) ColumnarToRow [codegen id : 42] +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] + +(109) Filter [codegen id : 42] +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] +Condition : isnotnull(ws_item_sk#115) + +(110) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] + +(111) BroadcastHashJoin [codegen id : 42] +Left keys [1]: [ws_item_sk#115] +Right keys [1]: [i_item_sk#120] +Join condition: None + +(112) Project [codegen id : 42] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] +Input [10]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] + +(113) ReusedExchange [Reuses operator id: 83] +Output [2]: [d_date_sk#125, d_year#126] + +(114) BroadcastHashJoin [codegen id : 42] +Left keys [1]: [ws_sold_date_sk#119] +Right keys [1]: [d_date_sk#125] +Join condition: None + +(115) Project [codegen id : 42] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Input [11]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_date_sk#125, d_year#126] + +(116) Exchange +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: hashpartitioning(ws_order_number#116, ws_item_sk#115, 5), ENSURE_REQUIREMENTS, [id=#127] + +(117) Sort [codegen id : 43] +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: [ws_order_number#116 ASC NULLS FIRST, ws_item_sk#115 ASC NULLS FIRST], false, 0 + +(118) ReusedExchange [Reuses operator id: 61] +Output [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] + +(119) Sort [codegen id : 45] +Input [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] +Arguments: [wr_order_number#129 ASC NULLS FIRST, wr_item_sk#128 ASC NULLS FIRST], false, 0 + +(120) SortMergeJoin [codegen id : 46] +Left keys [2]: [ws_order_number#116, ws_item_sk#115] +Right keys [2]: [wr_order_number#129, wr_item_sk#128] +Join condition: None + +(121) Project [codegen id : 46] +Output [7]: [d_year#126, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, (ws_quantity#117 - coalesce(wr_return_quantity#130, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#118 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#131, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126, wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] + +(122) Union + +(123) HashAggregate [codegen id : 47] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] + +(124) Exchange +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#132] + +(125) HashAggregate [codegen id : 48] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] + +(126) HashAggregate [codegen id : 48] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Functions [2]: [partial_sum(sales_cnt#24), partial_sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum#133, sum#134] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] + +(127) Exchange +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#137] + +(128) HashAggregate [codegen id : 49] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] +Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Functions [2]: [sum(sales_cnt#24), sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum(sales_cnt#24)#138, sum(UnscaledValue(sales_amt#25))#139] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum(sales_cnt#24)#138 AS sales_cnt#140, MakeDecimal(sum(UnscaledValue(sales_amt#25))#139,18,2) AS sales_amt#141] + +(129) Exchange +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] +Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#142] + +(130) Sort [codegen id : 50] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] +Arguments: [i_brand_id#86 ASC NULLS FIRST, i_class_id#87 ASC NULLS FIRST, i_category_id#88 ASC NULLS FIRST, i_manufact_id#89 ASC NULLS FIRST], false, 0 + +(131) SortMergeJoin [codegen id : 51] +Left keys [4]: [i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Right keys [4]: [i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#76 as decimal(17,2))) / promote_precision(cast(sales_cnt#140 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) + +(132) Project [codegen id : 51] +Output [10]: [d_year#91 AS prev_year#143, d_year#15 AS year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#140 AS prev_yr_cnt#145, sales_cnt#76 AS curr_yr_cnt#146, (sales_cnt#76 - sales_cnt#140) AS sales_cnt_diff#147, CheckOverflow((promote_precision(cast(sales_amt#77 as decimal(19,2))) - promote_precision(cast(sales_amt#141 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#148] +Input [14]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77, d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] + +(133) TakeOrderedAndProject +Input [10]: [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] +Arguments: 100, [sales_cnt_diff#147 ASC NULLS FIRST, sales_amt_diff#148 ASC NULLS FIRST], [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (134) + + +(134) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#14, d_year#15] + +Subquery:2 Hosting operator id = 27 Hosting Expression = ss_sold_date_sk#30 IN dynamicpruning#6 + +Subquery:3 Hosting operator id = 46 Hosting Expression = ws_sold_date_sk#51 IN dynamicpruning#6 + +Subquery:4 Hosting operator id = 74 Hosting Expression = cs_sold_date_sk#83 IN dynamicpruning#84 +ReusedExchange (135) + + +(135) ReusedExchange [Reuses operator id: 83] +Output [2]: [d_date_sk#90, d_year#91] + +Subquery:5 Hosting operator id = 92 Hosting Expression = ss_sold_date_sk#102 IN dynamicpruning#84 + +Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#119 IN dynamicpruning#84 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/simplified.txt new file mode 100644 index 0000000000000..1e5555b76b4e5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75.sf100/simplified.txt @@ -0,0 +1,238 @@ +TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i_class_id,i_category_id,i_manufact_id,prev_yr_cnt,curr_yr_cnt] + WholeStageCodegen (51) + Project [d_year,d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_cnt,sales_amt,sales_amt] + SortMergeJoin [i_brand_id,i_class_id,i_category_id,i_manufact_id,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_cnt] + InputAdapter + WholeStageCodegen (25) + Sort [i_brand_id,i_class_id,i_category_id,i_manufact_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id,i_manufact_id] #1 + WholeStageCodegen (24) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sum,sum] [sum(sales_cnt),sum(UnscaledValue(sales_amt)),sales_cnt,sales_amt,sum,sum] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id] #2 + WholeStageCodegen (23) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] [sum,sum,sum,sum] + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] #3 + WholeStageCodegen (22) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Union + WholeStageCodegen (7) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #4 + WholeStageCodegen (3) + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #5 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Project [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + Filter [i_category,i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id,i_category,i_manufact_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (6) + Sort [cr_order_number,cr_item_sk] + InputAdapter + Exchange [cr_order_number,cr_item_sk] #7 + WholeStageCodegen (5) + Project [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount] + Filter [cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount,cr_returned_date_sk] + WholeStageCodegen (14) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ss_quantity,sr_return_quantity,ss_ext_sales_price,sr_return_amt] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #8 + WholeStageCodegen (10) + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #5 + InputAdapter + WholeStageCodegen (13) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #9 + WholeStageCodegen (12) + Project [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt,sr_returned_date_sk] + WholeStageCodegen (21) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ws_quantity,wr_return_quantity,ws_ext_sales_price,wr_return_amt] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (18) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #10 + WholeStageCodegen (17) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #5 + InputAdapter + WholeStageCodegen (20) + Sort [wr_order_number,wr_item_sk] + InputAdapter + Exchange [wr_order_number,wr_item_sk] #11 + WholeStageCodegen (19) + Project [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt] + Filter [wr_order_number,wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt,wr_returned_date_sk] + InputAdapter + WholeStageCodegen (50) + Sort [i_brand_id,i_class_id,i_category_id,i_manufact_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id,i_manufact_id] #12 + WholeStageCodegen (49) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sum,sum] [sum(sales_cnt),sum(UnscaledValue(sales_amt)),sales_cnt,sales_amt,sum,sum] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id] #13 + WholeStageCodegen (48) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] [sum,sum,sum,sum] + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] #14 + WholeStageCodegen (47) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Union + WholeStageCodegen (32) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (29) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #15 + WholeStageCodegen (28) + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #16 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (27) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (31) + Sort [cr_order_number,cr_item_sk] + InputAdapter + ReusedExchange [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount] #7 + WholeStageCodegen (39) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ss_quantity,sr_return_quantity,ss_ext_sales_price,sr_return_amt] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (36) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #17 + WholeStageCodegen (35) + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #16 + InputAdapter + WholeStageCodegen (38) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + ReusedExchange [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt] #9 + WholeStageCodegen (46) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ws_quantity,wr_return_quantity,ws_ext_sales_price,wr_return_amt] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (43) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #18 + WholeStageCodegen (42) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #16 + InputAdapter + WholeStageCodegen (45) + Sort [wr_order_number,wr_item_sk] + InputAdapter + ReusedExchange [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt] #11 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt new file mode 100644 index 0000000000000..eb5287bfa8850 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/explain.txt @@ -0,0 +1,750 @@ +== Physical Plan == +TakeOrderedAndProject (133) ++- * Project (132) + +- * SortMergeJoin Inner (131) + :- * Sort (73) + : +- Exchange (72) + : +- * HashAggregate (71) + : +- Exchange (70) + : +- * HashAggregate (69) + : +- * HashAggregate (68) + : +- Exchange (67) + : +- * HashAggregate (66) + : +- Union (65) + : :- * Project (26) + : : +- * SortMergeJoin LeftOuter (25) + : : :- * Sort (18) + : : : +- Exchange (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.catalog_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.item (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.date_dim (11) + : : +- * Sort (24) + : : +- Exchange (23) + : : +- * Project (22) + : : +- * Filter (21) + : : +- * ColumnarToRow (20) + : : +- Scan parquet default.catalog_returns (19) + : :- * Project (45) + : : +- * SortMergeJoin LeftOuter (44) + : : :- * Sort (37) + : : : +- Exchange (36) + : : : +- * Project (35) + : : : +- * BroadcastHashJoin Inner BuildRight (34) + : : : :- * Project (32) + : : : : +- * BroadcastHashJoin Inner BuildRight (31) + : : : : :- * Filter (29) + : : : : : +- * ColumnarToRow (28) + : : : : : +- Scan parquet default.store_sales (27) + : : : : +- ReusedExchange (30) + : : : +- ReusedExchange (33) + : : +- * Sort (43) + : : +- Exchange (42) + : : +- * Project (41) + : : +- * Filter (40) + : : +- * ColumnarToRow (39) + : : +- Scan parquet default.store_returns (38) + : +- * Project (64) + : +- * SortMergeJoin LeftOuter (63) + : :- * Sort (56) + : : +- Exchange (55) + : : +- * Project (54) + : : +- * BroadcastHashJoin Inner BuildRight (53) + : : :- * Project (51) + : : : +- * BroadcastHashJoin Inner BuildRight (50) + : : : :- * Filter (48) + : : : : +- * ColumnarToRow (47) + : : : : +- Scan parquet default.web_sales (46) + : : : +- ReusedExchange (49) + : : +- ReusedExchange (52) + : +- * Sort (62) + : +- Exchange (61) + : +- * Project (60) + : +- * Filter (59) + : +- * ColumnarToRow (58) + : +- Scan parquet default.web_returns (57) + +- * Sort (130) + +- Exchange (129) + +- * HashAggregate (128) + +- Exchange (127) + +- * HashAggregate (126) + +- * HashAggregate (125) + +- Exchange (124) + +- * HashAggregate (123) + +- Union (122) + :- * Project (91) + : +- * SortMergeJoin LeftOuter (90) + : :- * Sort (87) + : : +- Exchange (86) + : : +- * Project (85) + : : +- * BroadcastHashJoin Inner BuildRight (84) + : : :- * Project (79) + : : : +- * BroadcastHashJoin Inner BuildRight (78) + : : : :- * Filter (76) + : : : : +- * ColumnarToRow (75) + : : : : +- Scan parquet default.catalog_sales (74) + : : : +- ReusedExchange (77) + : : +- BroadcastExchange (83) + : : +- * Filter (82) + : : +- * ColumnarToRow (81) + : : +- Scan parquet default.date_dim (80) + : +- * Sort (89) + : +- ReusedExchange (88) + :- * Project (106) + : +- * SortMergeJoin LeftOuter (105) + : :- * Sort (102) + : : +- Exchange (101) + : : +- * Project (100) + : : +- * BroadcastHashJoin Inner BuildRight (99) + : : :- * Project (97) + : : : +- * BroadcastHashJoin Inner BuildRight (96) + : : : :- * Filter (94) + : : : : +- * ColumnarToRow (93) + : : : : +- Scan parquet default.store_sales (92) + : : : +- ReusedExchange (95) + : : +- ReusedExchange (98) + : +- * Sort (104) + : +- ReusedExchange (103) + +- * Project (121) + +- * SortMergeJoin LeftOuter (120) + :- * Sort (117) + : +- Exchange (116) + : +- * Project (115) + : +- * BroadcastHashJoin Inner BuildRight (114) + : :- * Project (112) + : : +- * BroadcastHashJoin Inner BuildRight (111) + : : :- * Filter (109) + : : : +- * ColumnarToRow (108) + : : : +- Scan parquet default.web_sales (107) + : : +- ReusedExchange (110) + : +- ReusedExchange (113) + +- * Sort (119) + +- ReusedExchange (118) + + +(1) Scan parquet default.catalog_sales +Output [5]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#5), dynamicpruningexpression(cs_sold_date_sk#5 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [5]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5] + +(3) Filter [codegen id : 3] +Input [5]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5] +Condition : isnotnull(cs_item_sk#1) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_category), EqualTo(i_category,Books ), IsNotNull(i_item_sk), IsNotNull(i_brand_id), IsNotNull(i_class_id), IsNotNull(i_category_id), IsNotNull(i_manufact_id)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] + +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] +Condition : ((((((isnotnull(i_category#11) AND (i_category#11 = Books )) AND isnotnull(i_item_sk#7)) AND isnotnull(i_brand_id#8)) AND isnotnull(i_class_id#9)) AND isnotnull(i_category_id#10)) AND isnotnull(i_manufact_id#12)) + +(7) Project [codegen id : 1] +Output [5]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Input [6]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_category#11, i_manufact_id#12] + +(8) BroadcastExchange +Input [5]: [i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#13] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_item_sk#1] +Right keys [1]: [i_item_sk#7] +Join condition: None + +(10) Project [codegen id : 3] +Output [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Input [10]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5, i_item_sk#7, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] + +(11) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2002), IsNotNull(d_date_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#14, d_year#15] + +(13) Filter [codegen id : 2] +Input [2]: [d_date_sk#14, d_year#15] +Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2002)) AND isnotnull(d_date_sk#14)) + +(14) BroadcastExchange +Input [2]: [d_date_sk#14, d_year#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [cs_sold_date_sk#5] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(16) Project [codegen id : 3] +Output [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15] +Input [11]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, cs_sold_date_sk#5, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_date_sk#14, d_year#15] + +(17) Exchange +Input [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15] +Arguments: hashpartitioning(cs_order_number#2, cs_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#17] + +(18) Sort [codegen id : 4] +Input [9]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15] +Arguments: [cs_order_number#2 ASC NULLS FIRST, cs_item_sk#1 ASC NULLS FIRST], false, 0 + +(19) Scan parquet default.catalog_returns +Output [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(20) ColumnarToRow [codegen id : 5] +Input [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] + +(21) Filter [codegen id : 5] +Input [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] +Condition : (isnotnull(cr_order_number#19) AND isnotnull(cr_item_sk#18)) + +(22) Project [codegen id : 5] +Output [4]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] +Input [5]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21, cr_returned_date_sk#22] + +(23) Exchange +Input [4]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] +Arguments: hashpartitioning(cr_order_number#19, cr_item_sk#18, 5), ENSURE_REQUIREMENTS, [id=#23] + +(24) Sort [codegen id : 6] +Input [4]: [cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] +Arguments: [cr_order_number#19 ASC NULLS FIRST, cr_item_sk#18 ASC NULLS FIRST], false, 0 + +(25) SortMergeJoin [codegen id : 7] +Left keys [2]: [cs_order_number#2, cs_item_sk#1] +Right keys [2]: [cr_order_number#19, cr_item_sk#18] +Join condition: None + +(26) Project [codegen id : 7] +Output [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, (cs_quantity#3 - coalesce(cr_return_quantity#20, 0)) AS sales_cnt#24, CheckOverflow((promote_precision(cast(cs_ext_sales_price#4 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#21, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#25] +Input [13]: [cs_item_sk#1, cs_order_number#2, cs_quantity#3, cs_ext_sales_price#4, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, d_year#15, cr_item_sk#18, cr_order_number#19, cr_return_quantity#20, cr_return_amount#21] + +(27) Scan parquet default.store_sales +Output [5]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#30), dynamicpruningexpression(ss_sold_date_sk#30 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 10] +Input [5]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30] + +(29) Filter [codegen id : 10] +Input [5]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30] +Condition : isnotnull(ss_item_sk#26) + +(30) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#31, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35] + +(31) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_item_sk#26] +Right keys [1]: [i_item_sk#31] +Join condition: None + +(32) Project [codegen id : 10] +Output [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35] +Input [10]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30, i_item_sk#31, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35] + +(33) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#36, d_year#37] + +(34) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [ss_sold_date_sk#30] +Right keys [1]: [d_date_sk#36] +Join condition: None + +(35) Project [codegen id : 10] +Output [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] +Input [11]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, ss_sold_date_sk#30, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_date_sk#36, d_year#37] + +(36) Exchange +Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] +Arguments: hashpartitioning(ss_ticket_number#27, ss_item_sk#26, 5), ENSURE_REQUIREMENTS, [id=#38] + +(37) Sort [codegen id : 11] +Input [9]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37] +Arguments: [ss_ticket_number#27 ASC NULLS FIRST, ss_item_sk#26 ASC NULLS FIRST], false, 0 + +(38) Scan parquet default.store_returns +Output [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(39) ColumnarToRow [codegen id : 12] +Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] + +(40) Filter [codegen id : 12] +Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] +Condition : (isnotnull(sr_ticket_number#40) AND isnotnull(sr_item_sk#39)) + +(41) Project [codegen id : 12] +Output [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] +Input [5]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42, sr_returned_date_sk#43] + +(42) Exchange +Input [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] +Arguments: hashpartitioning(sr_ticket_number#40, sr_item_sk#39, 5), ENSURE_REQUIREMENTS, [id=#44] + +(43) Sort [codegen id : 13] +Input [4]: [sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] +Arguments: [sr_ticket_number#40 ASC NULLS FIRST, sr_item_sk#39 ASC NULLS FIRST], false, 0 + +(44) SortMergeJoin [codegen id : 14] +Left keys [2]: [ss_ticket_number#27, ss_item_sk#26] +Right keys [2]: [sr_ticket_number#40, sr_item_sk#39] +Join condition: None + +(45) Project [codegen id : 14] +Output [7]: [d_year#37, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, (ss_quantity#28 - coalesce(sr_return_quantity#41, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#29 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#42, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#46] +Input [13]: [ss_item_sk#26, ss_ticket_number#27, ss_quantity#28, ss_ext_sales_price#29, i_brand_id#32, i_class_id#33, i_category_id#34, i_manufact_id#35, d_year#37, sr_item_sk#39, sr_ticket_number#40, sr_return_quantity#41, sr_return_amt#42] + +(46) Scan parquet default.web_sales +Output [5]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#51), dynamicpruningexpression(ws_sold_date_sk#51 IN dynamicpruning#6)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(47) ColumnarToRow [codegen id : 17] +Input [5]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51] + +(48) Filter [codegen id : 17] +Input [5]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51] +Condition : isnotnull(ws_item_sk#47) + +(49) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#52, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56] + +(50) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_item_sk#47] +Right keys [1]: [i_item_sk#52] +Join condition: None + +(51) Project [codegen id : 17] +Output [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56] +Input [10]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51, i_item_sk#52, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56] + +(52) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#57, d_year#58] + +(53) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#51] +Right keys [1]: [d_date_sk#57] +Join condition: None + +(54) Project [codegen id : 17] +Output [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] +Input [11]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, ws_sold_date_sk#51, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_date_sk#57, d_year#58] + +(55) Exchange +Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] +Arguments: hashpartitioning(ws_order_number#48, ws_item_sk#47, 5), ENSURE_REQUIREMENTS, [id=#59] + +(56) Sort [codegen id : 18] +Input [9]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58] +Arguments: [ws_order_number#48 ASC NULLS FIRST, ws_item_sk#47 ASC NULLS FIRST], false, 0 + +(57) Scan parquet default.web_returns +Output [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct + +(58) ColumnarToRow [codegen id : 19] +Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] + +(59) Filter [codegen id : 19] +Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] +Condition : (isnotnull(wr_order_number#61) AND isnotnull(wr_item_sk#60)) + +(60) Project [codegen id : 19] +Output [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] +Input [5]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63, wr_returned_date_sk#64] + +(61) Exchange +Input [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] +Arguments: hashpartitioning(wr_order_number#61, wr_item_sk#60, 5), ENSURE_REQUIREMENTS, [id=#65] + +(62) Sort [codegen id : 20] +Input [4]: [wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] +Arguments: [wr_order_number#61 ASC NULLS FIRST, wr_item_sk#60 ASC NULLS FIRST], false, 0 + +(63) SortMergeJoin [codegen id : 21] +Left keys [2]: [ws_order_number#48, ws_item_sk#47] +Right keys [2]: [wr_order_number#61, wr_item_sk#60] +Join condition: None + +(64) Project [codegen id : 21] +Output [7]: [d_year#58, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, (ws_quantity#49 - coalesce(wr_return_quantity#62, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#50 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#63, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ws_item_sk#47, ws_order_number#48, ws_quantity#49, ws_ext_sales_price#50, i_brand_id#53, i_class_id#54, i_category_id#55, i_manufact_id#56, d_year#58, wr_item_sk#60, wr_order_number#61, wr_return_quantity#62, wr_return_amt#63] + +(65) Union + +(66) HashAggregate [codegen id : 22] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] + +(67) Exchange +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Arguments: hashpartitioning(d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#68] + +(68) HashAggregate [codegen id : 23] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] + +(69) HashAggregate [codegen id : 23] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#24, sales_amt#25] +Keys [5]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Functions [2]: [partial_sum(sales_cnt#24), partial_sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum#69, sum#70] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum#71, sum#72] + +(70) Exchange +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum#71, sum#72] +Arguments: hashpartitioning(d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, 5), ENSURE_REQUIREMENTS, [id=#73] + +(71) HashAggregate [codegen id : 24] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum#71, sum#72] +Keys [5]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Functions [2]: [sum(sales_cnt#24), sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum(sales_cnt#24)#74, sum(UnscaledValue(sales_amt#25))#75] +Results [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sum(sales_cnt#24)#74 AS sales_cnt#76, MakeDecimal(sum(UnscaledValue(sales_amt#25))#75,18,2) AS sales_amt#77] + +(72) Exchange +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77] +Arguments: hashpartitioning(i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, 5), ENSURE_REQUIREMENTS, [id=#78] + +(73) Sort [codegen id : 25] +Input [7]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77] +Arguments: [i_brand_id#8 ASC NULLS FIRST, i_class_id#9 ASC NULLS FIRST, i_category_id#10 ASC NULLS FIRST, i_manufact_id#12 ASC NULLS FIRST], false, 0 + +(74) Scan parquet default.catalog_sales +Output [5]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#83), dynamicpruningexpression(cs_sold_date_sk#83 IN dynamicpruning#84)] +PushedFilters: [IsNotNull(cs_item_sk)] +ReadSchema: struct + +(75) ColumnarToRow [codegen id : 28] +Input [5]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83] + +(76) Filter [codegen id : 28] +Input [5]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83] +Condition : isnotnull(cs_item_sk#79) + +(77) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#85, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] + +(78) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [cs_item_sk#79] +Right keys [1]: [i_item_sk#85] +Join condition: None + +(79) Project [codegen id : 28] +Output [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Input [10]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83, i_item_sk#85, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] + +(80) Scan parquet default.date_dim +Output [2]: [d_date_sk#90, d_year#91] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2001), IsNotNull(d_date_sk)] +ReadSchema: struct + +(81) ColumnarToRow [codegen id : 27] +Input [2]: [d_date_sk#90, d_year#91] + +(82) Filter [codegen id : 27] +Input [2]: [d_date_sk#90, d_year#91] +Condition : ((isnotnull(d_year#91) AND (d_year#91 = 2001)) AND isnotnull(d_date_sk#90)) + +(83) BroadcastExchange +Input [2]: [d_date_sk#90, d_year#91] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#92] + +(84) BroadcastHashJoin [codegen id : 28] +Left keys [1]: [cs_sold_date_sk#83] +Right keys [1]: [d_date_sk#90] +Join condition: None + +(85) Project [codegen id : 28] +Output [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91] +Input [11]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, cs_sold_date_sk#83, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_date_sk#90, d_year#91] + +(86) Exchange +Input [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91] +Arguments: hashpartitioning(cs_order_number#80, cs_item_sk#79, 5), ENSURE_REQUIREMENTS, [id=#93] + +(87) Sort [codegen id : 29] +Input [9]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91] +Arguments: [cs_order_number#80 ASC NULLS FIRST, cs_item_sk#79 ASC NULLS FIRST], false, 0 + +(88) ReusedExchange [Reuses operator id: 23] +Output [4]: [cr_item_sk#94, cr_order_number#95, cr_return_quantity#96, cr_return_amount#97] + +(89) Sort [codegen id : 31] +Input [4]: [cr_item_sk#94, cr_order_number#95, cr_return_quantity#96, cr_return_amount#97] +Arguments: [cr_order_number#95 ASC NULLS FIRST, cr_item_sk#94 ASC NULLS FIRST], false, 0 + +(90) SortMergeJoin [codegen id : 32] +Left keys [2]: [cs_order_number#80, cs_item_sk#79] +Right keys [2]: [cr_order_number#95, cr_item_sk#94] +Join condition: None + +(91) Project [codegen id : 32] +Output [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, (cs_quantity#81 - coalesce(cr_return_quantity#96, 0)) AS sales_cnt#24, CheckOverflow((promote_precision(cast(cs_ext_sales_price#82 as decimal(8,2))) - promote_precision(cast(coalesce(cr_return_amount#97, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#25] +Input [13]: [cs_item_sk#79, cs_order_number#80, cs_quantity#81, cs_ext_sales_price#82, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, d_year#91, cr_item_sk#94, cr_order_number#95, cr_return_quantity#96, cr_return_amount#97] + +(92) Scan parquet default.store_sales +Output [5]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#102), dynamicpruningexpression(ss_sold_date_sk#102 IN dynamicpruning#84)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(93) ColumnarToRow [codegen id : 35] +Input [5]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102] + +(94) Filter [codegen id : 35] +Input [5]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102] +Condition : isnotnull(ss_item_sk#98) + +(95) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#103, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107] + +(96) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [ss_item_sk#98] +Right keys [1]: [i_item_sk#103] +Join condition: None + +(97) Project [codegen id : 35] +Output [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107] +Input [10]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102, i_item_sk#103, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107] + +(98) ReusedExchange [Reuses operator id: 83] +Output [2]: [d_date_sk#108, d_year#109] + +(99) BroadcastHashJoin [codegen id : 35] +Left keys [1]: [ss_sold_date_sk#102] +Right keys [1]: [d_date_sk#108] +Join condition: None + +(100) Project [codegen id : 35] +Output [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] +Input [11]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, ss_sold_date_sk#102, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_date_sk#108, d_year#109] + +(101) Exchange +Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] +Arguments: hashpartitioning(ss_ticket_number#99, ss_item_sk#98, 5), ENSURE_REQUIREMENTS, [id=#110] + +(102) Sort [codegen id : 36] +Input [9]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109] +Arguments: [ss_ticket_number#99 ASC NULLS FIRST, ss_item_sk#98 ASC NULLS FIRST], false, 0 + +(103) ReusedExchange [Reuses operator id: 42] +Output [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] + +(104) Sort [codegen id : 38] +Input [4]: [sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] +Arguments: [sr_ticket_number#112 ASC NULLS FIRST, sr_item_sk#111 ASC NULLS FIRST], false, 0 + +(105) SortMergeJoin [codegen id : 39] +Left keys [2]: [ss_ticket_number#99, ss_item_sk#98] +Right keys [2]: [sr_ticket_number#112, sr_item_sk#111] +Join condition: None + +(106) Project [codegen id : 39] +Output [7]: [d_year#109, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, (ss_quantity#100 - coalesce(sr_return_quantity#113, 0)) AS sales_cnt#45, CheckOverflow((promote_precision(cast(ss_ext_sales_price#101 as decimal(8,2))) - promote_precision(cast(coalesce(sr_return_amt#114, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#46] +Input [13]: [ss_item_sk#98, ss_ticket_number#99, ss_quantity#100, ss_ext_sales_price#101, i_brand_id#104, i_class_id#105, i_category_id#106, i_manufact_id#107, d_year#109, sr_item_sk#111, sr_ticket_number#112, sr_return_quantity#113, sr_return_amt#114] + +(107) Scan parquet default.web_sales +Output [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#119), dynamicpruningexpression(ws_sold_date_sk#119 IN dynamicpruning#84)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(108) ColumnarToRow [codegen id : 42] +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] + +(109) Filter [codegen id : 42] +Input [5]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119] +Condition : isnotnull(ws_item_sk#115) + +(110) ReusedExchange [Reuses operator id: 8] +Output [5]: [i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] + +(111) BroadcastHashJoin [codegen id : 42] +Left keys [1]: [ws_item_sk#115] +Right keys [1]: [i_item_sk#120] +Join condition: None + +(112) Project [codegen id : 42] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] +Input [10]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_item_sk#120, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124] + +(113) ReusedExchange [Reuses operator id: 83] +Output [2]: [d_date_sk#125, d_year#126] + +(114) BroadcastHashJoin [codegen id : 42] +Left keys [1]: [ws_sold_date_sk#119] +Right keys [1]: [d_date_sk#125] +Join condition: None + +(115) Project [codegen id : 42] +Output [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Input [11]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, ws_sold_date_sk#119, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_date_sk#125, d_year#126] + +(116) Exchange +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: hashpartitioning(ws_order_number#116, ws_item_sk#115, 5), ENSURE_REQUIREMENTS, [id=#127] + +(117) Sort [codegen id : 43] +Input [9]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126] +Arguments: [ws_order_number#116 ASC NULLS FIRST, ws_item_sk#115 ASC NULLS FIRST], false, 0 + +(118) ReusedExchange [Reuses operator id: 61] +Output [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] + +(119) Sort [codegen id : 45] +Input [4]: [wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] +Arguments: [wr_order_number#129 ASC NULLS FIRST, wr_item_sk#128 ASC NULLS FIRST], false, 0 + +(120) SortMergeJoin [codegen id : 46] +Left keys [2]: [ws_order_number#116, ws_item_sk#115] +Right keys [2]: [wr_order_number#129, wr_item_sk#128] +Join condition: None + +(121) Project [codegen id : 46] +Output [7]: [d_year#126, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, (ws_quantity#117 - coalesce(wr_return_quantity#130, 0)) AS sales_cnt#66, CheckOverflow((promote_precision(cast(ws_ext_sales_price#118 as decimal(8,2))) - promote_precision(cast(coalesce(wr_return_amt#131, 0.00) as decimal(8,2)))), DecimalType(8,2), true) AS sales_amt#67] +Input [13]: [ws_item_sk#115, ws_order_number#116, ws_quantity#117, ws_ext_sales_price#118, i_brand_id#121, i_class_id#122, i_category_id#123, i_manufact_id#124, d_year#126, wr_item_sk#128, wr_order_number#129, wr_return_quantity#130, wr_return_amt#131] + +(122) Union + +(123) HashAggregate [codegen id : 47] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] + +(124) Exchange +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25, 5), ENSURE_REQUIREMENTS, [id=#132] + +(125) HashAggregate [codegen id : 48] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Keys [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Functions: [] +Aggregate Attributes: [] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] + +(126) HashAggregate [codegen id : 48] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#24, sales_amt#25] +Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Functions [2]: [partial_sum(sales_cnt#24), partial_sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum#133, sum#134] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] + +(127) Exchange +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] +Arguments: hashpartitioning(d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#137] + +(128) HashAggregate [codegen id : 49] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum#135, sum#136] +Keys [5]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Functions [2]: [sum(sales_cnt#24), sum(UnscaledValue(sales_amt#25))] +Aggregate Attributes [2]: [sum(sales_cnt#24)#138, sum(UnscaledValue(sales_amt#25))#139] +Results [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sum(sales_cnt#24)#138 AS sales_cnt#140, MakeDecimal(sum(UnscaledValue(sales_amt#25))#139,18,2) AS sales_amt#141] + +(129) Exchange +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] +Arguments: hashpartitioning(i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, 5), ENSURE_REQUIREMENTS, [id=#142] + +(130) Sort [codegen id : 50] +Input [7]: [d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] +Arguments: [i_brand_id#86 ASC NULLS FIRST, i_class_id#87 ASC NULLS FIRST, i_category_id#88 ASC NULLS FIRST, i_manufact_id#89 ASC NULLS FIRST], false, 0 + +(131) SortMergeJoin [codegen id : 51] +Left keys [4]: [i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12] +Right keys [4]: [i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89] +Join condition: (CheckOverflow((promote_precision(cast(sales_cnt#76 as decimal(17,2))) / promote_precision(cast(sales_cnt#140 as decimal(17,2)))), DecimalType(37,20), true) < 0.90000000000000000000) + +(132) Project [codegen id : 51] +Output [10]: [d_year#91 AS prev_year#143, d_year#15 AS year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#140 AS prev_yr_cnt#145, sales_cnt#76 AS curr_yr_cnt#146, (sales_cnt#76 - sales_cnt#140) AS sales_cnt_diff#147, CheckOverflow((promote_precision(cast(sales_amt#77 as decimal(19,2))) - promote_precision(cast(sales_amt#141 as decimal(19,2)))), DecimalType(19,2), true) AS sales_amt_diff#148] +Input [14]: [d_year#15, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, sales_cnt#76, sales_amt#77, d_year#91, i_brand_id#86, i_class_id#87, i_category_id#88, i_manufact_id#89, sales_cnt#140, sales_amt#141] + +(133) TakeOrderedAndProject +Input [10]: [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] +Arguments: 100, [sales_cnt_diff#147 ASC NULLS FIRST, sales_amt_diff#148 ASC NULLS FIRST], [prev_year#143, year#144, i_brand_id#8, i_class_id#9, i_category_id#10, i_manufact_id#12, prev_yr_cnt#145, curr_yr_cnt#146, sales_cnt_diff#147, sales_amt_diff#148] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = cs_sold_date_sk#5 IN dynamicpruning#6 +ReusedExchange (134) + + +(134) ReusedExchange [Reuses operator id: 14] +Output [2]: [d_date_sk#14, d_year#15] + +Subquery:2 Hosting operator id = 27 Hosting Expression = ss_sold_date_sk#30 IN dynamicpruning#6 + +Subquery:3 Hosting operator id = 46 Hosting Expression = ws_sold_date_sk#51 IN dynamicpruning#6 + +Subquery:4 Hosting operator id = 74 Hosting Expression = cs_sold_date_sk#83 IN dynamicpruning#84 +ReusedExchange (135) + + +(135) ReusedExchange [Reuses operator id: 83] +Output [2]: [d_date_sk#90, d_year#91] + +Subquery:5 Hosting operator id = 92 Hosting Expression = ss_sold_date_sk#102 IN dynamicpruning#84 + +Subquery:6 Hosting operator id = 107 Hosting Expression = ws_sold_date_sk#119 IN dynamicpruning#84 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/simplified.txt new file mode 100644 index 0000000000000..1e5555b76b4e5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q75/simplified.txt @@ -0,0 +1,238 @@ +TakeOrderedAndProject [sales_cnt_diff,sales_amt_diff,prev_year,year,i_brand_id,i_class_id,i_category_id,i_manufact_id,prev_yr_cnt,curr_yr_cnt] + WholeStageCodegen (51) + Project [d_year,d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_cnt,sales_amt,sales_amt] + SortMergeJoin [i_brand_id,i_class_id,i_category_id,i_manufact_id,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_cnt] + InputAdapter + WholeStageCodegen (25) + Sort [i_brand_id,i_class_id,i_category_id,i_manufact_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id,i_manufact_id] #1 + WholeStageCodegen (24) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sum,sum] [sum(sales_cnt),sum(UnscaledValue(sales_amt)),sales_cnt,sales_amt,sum,sum] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id] #2 + WholeStageCodegen (23) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] [sum,sum,sum,sum] + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] #3 + WholeStageCodegen (22) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Union + WholeStageCodegen (7) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (4) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #4 + WholeStageCodegen (3) + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #5 + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (1) + Project [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + Filter [i_category,i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_brand_id,i_class_id,i_category_id,i_category,i_manufact_id] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (6) + Sort [cr_order_number,cr_item_sk] + InputAdapter + Exchange [cr_order_number,cr_item_sk] #7 + WholeStageCodegen (5) + Project [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount] + Filter [cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount,cr_returned_date_sk] + WholeStageCodegen (14) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ss_quantity,sr_return_quantity,ss_ext_sales_price,sr_return_amt] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (11) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #8 + WholeStageCodegen (10) + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #5 + InputAdapter + WholeStageCodegen (13) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #9 + WholeStageCodegen (12) + Project [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt,sr_returned_date_sk] + WholeStageCodegen (21) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ws_quantity,wr_return_quantity,ws_ext_sales_price,wr_return_amt] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (18) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #10 + WholeStageCodegen (17) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #5 + InputAdapter + WholeStageCodegen (20) + Sort [wr_order_number,wr_item_sk] + InputAdapter + Exchange [wr_order_number,wr_item_sk] #11 + WholeStageCodegen (19) + Project [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt] + Filter [wr_order_number,wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt,wr_returned_date_sk] + InputAdapter + WholeStageCodegen (50) + Sort [i_brand_id,i_class_id,i_category_id,i_manufact_id] + InputAdapter + Exchange [i_brand_id,i_class_id,i_category_id,i_manufact_id] #12 + WholeStageCodegen (49) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sum,sum] [sum(sales_cnt),sum(UnscaledValue(sales_amt)),sales_cnt,sales_amt,sum,sum] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id] #13 + WholeStageCodegen (48) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] [sum,sum,sum,sum] + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Exchange [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] #14 + WholeStageCodegen (47) + HashAggregate [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,sales_cnt,sales_amt] + InputAdapter + Union + WholeStageCodegen (32) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,cs_quantity,cr_return_quantity,cs_ext_sales_price,cr_return_amount] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (29) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #15 + WholeStageCodegen (28) + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Filter [cs_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_item_sk,cs_order_number,cs_quantity,cs_ext_sales_price,cs_sold_date_sk] + SubqueryBroadcast [d_date_sk] #2 + ReusedExchange [d_date_sk,d_year] #16 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + BroadcastExchange #16 + WholeStageCodegen (27) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (31) + Sort [cr_order_number,cr_item_sk] + InputAdapter + ReusedExchange [cr_item_sk,cr_order_number,cr_return_quantity,cr_return_amount] #7 + WholeStageCodegen (39) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ss_quantity,sr_return_quantity,ss_ext_sales_price,sr_return_amt] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (36) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #17 + WholeStageCodegen (35) + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ticket_number,ss_quantity,ss_ext_sales_price,ss_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #16 + InputAdapter + WholeStageCodegen (38) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + ReusedExchange [sr_item_sk,sr_ticket_number,sr_return_quantity,sr_return_amt] #9 + WholeStageCodegen (46) + Project [d_year,i_brand_id,i_class_id,i_category_id,i_manufact_id,ws_quantity,wr_return_quantity,ws_ext_sales_price,wr_return_amt] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (43) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #18 + WholeStageCodegen (42) + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,i_brand_id,i_class_id,i_category_id,i_manufact_id,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_order_number,ws_quantity,ws_ext_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #2 + InputAdapter + ReusedExchange [i_item_sk,i_brand_id,i_class_id,i_category_id,i_manufact_id] #6 + InputAdapter + ReusedExchange [d_date_sk,d_year] #16 + InputAdapter + WholeStageCodegen (45) + Sort [wr_order_number,wr_item_sk] + InputAdapter + ReusedExchange [wr_item_sk,wr_order_number,wr_return_quantity,wr_return_amt] #11 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt new file mode 100644 index 0000000000000..4c884e185904f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/explain.txt @@ -0,0 +1,619 @@ +== Physical Plan == +TakeOrderedAndProject (102) ++- * HashAggregate (101) + +- Exchange (100) + +- * HashAggregate (99) + +- Union (98) + :- * HashAggregate (87) + : +- Exchange (86) + : +- * HashAggregate (85) + : +- Union (84) + : :- * Project (34) + : : +- * BroadcastHashJoin LeftOuter BuildRight (33) + : : :- * HashAggregate (19) + : : : +- Exchange (18) + : : : +- * HashAggregate (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.store (11) + : : +- BroadcastExchange (32) + : : +- * HashAggregate (31) + : : +- Exchange (30) + : : +- * HashAggregate (29) + : : +- * Project (28) + : : +- * BroadcastHashJoin Inner BuildRight (27) + : : :- * Project (25) + : : : +- * BroadcastHashJoin Inner BuildRight (24) + : : : :- * Filter (22) + : : : : +- * ColumnarToRow (21) + : : : : +- Scan parquet default.store_returns (20) + : : : +- ReusedExchange (23) + : : +- ReusedExchange (26) + : :- * Project (53) + : : +- * BroadcastNestedLoopJoin Inner BuildRight (52) + : : :- * HashAggregate (42) + : : : +- Exchange (41) + : : : +- * HashAggregate (40) + : : : +- * Project (39) + : : : +- * BroadcastHashJoin Inner BuildRight (38) + : : : :- * ColumnarToRow (36) + : : : : +- Scan parquet default.catalog_sales (35) + : : : +- ReusedExchange (37) + : : +- BroadcastExchange (51) + : : +- * HashAggregate (50) + : : +- Exchange (49) + : : +- * HashAggregate (48) + : : +- * Project (47) + : : +- * BroadcastHashJoin Inner BuildRight (46) + : : :- * ColumnarToRow (44) + : : : +- Scan parquet default.catalog_returns (43) + : : +- ReusedExchange (45) + : +- * Project (83) + : +- * BroadcastHashJoin LeftOuter BuildRight (82) + : :- * HashAggregate (68) + : : +- Exchange (67) + : : +- * HashAggregate (66) + : : +- * Project (65) + : : +- * BroadcastHashJoin Inner BuildRight (64) + : : :- * Project (59) + : : : +- * BroadcastHashJoin Inner BuildRight (58) + : : : :- * Filter (56) + : : : : +- * ColumnarToRow (55) + : : : : +- Scan parquet default.web_sales (54) + : : : +- ReusedExchange (57) + : : +- BroadcastExchange (63) + : : +- * Filter (62) + : : +- * ColumnarToRow (61) + : : +- Scan parquet default.web_page (60) + : +- BroadcastExchange (81) + : +- * HashAggregate (80) + : +- Exchange (79) + : +- * HashAggregate (78) + : +- * Project (77) + : +- * BroadcastHashJoin Inner BuildRight (76) + : :- * Project (74) + : : +- * BroadcastHashJoin Inner BuildRight (73) + : : :- * Filter (71) + : : : +- * ColumnarToRow (70) + : : : +- Scan parquet default.web_returns (69) + : : +- ReusedExchange (72) + : +- ReusedExchange (75) + :- * HashAggregate (92) + : +- Exchange (91) + : +- * HashAggregate (90) + : +- * HashAggregate (89) + : +- ReusedExchange (88) + +- * HashAggregate (97) + +- Exchange (96) + +- * HashAggregate (95) + +- * HashAggregate (94) + +- ReusedExchange (93) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_date#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1998-08-04), LessThanOrEqual(d_date,1998-09-03), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_date#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_date#7] +Condition : (((isnotnull(d_date#7) AND (d_date#7 >= 1998-08-04)) AND (d_date#7 <= 1998-09-03)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_date#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3] +Input [5]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.store +Output [1]: [s_store_sk#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [1]: [s_store_sk#9] + +(13) Filter [codegen id : 2] +Input [1]: [s_store_sk#9] +Condition : isnotnull(s_store_sk#9) + +(14) BroadcastExchange +Input [1]: [s_store_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#9] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#9] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#9] + +(17) HashAggregate [codegen id : 3] +Input [3]: [ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#9] +Keys [1]: [s_store_sk#9] +Functions [2]: [partial_sum(UnscaledValue(ss_ext_sales_price#2)), partial_sum(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [2]: [sum#11, sum#12] +Results [3]: [s_store_sk#9, sum#13, sum#14] + +(18) Exchange +Input [3]: [s_store_sk#9, sum#13, sum#14] +Arguments: hashpartitioning(s_store_sk#9, 5), ENSURE_REQUIREMENTS, [id=#15] + +(19) HashAggregate [codegen id : 8] +Input [3]: [s_store_sk#9, sum#13, sum#14] +Keys [1]: [s_store_sk#9] +Functions [2]: [sum(UnscaledValue(ss_ext_sales_price#2)), sum(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_ext_sales_price#2))#16, sum(UnscaledValue(ss_net_profit#3))#17] +Results [3]: [s_store_sk#9, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#16,17,2) AS sales#18, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#17,17,2) AS profit#19] + +(20) Scan parquet default.store_returns +Output [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#23), dynamicpruningexpression(sr_returned_date_sk#23 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_store_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] + +(22) Filter [codegen id : 6] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] +Condition : isnotnull(sr_store_sk#20) + +(23) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#24] + +(24) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [sr_returned_date_sk#23] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(25) Project [codegen id : 6] +Output [3]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] +Input [5]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, d_date_sk#24] + +(26) ReusedExchange [Reuses operator id: 14] +Output [1]: [s_store_sk#25] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [sr_store_sk#20] +Right keys [1]: [s_store_sk#25] +Join condition: None + +(28) Project [codegen id : 6] +Output [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, s_store_sk#25] + +(29) HashAggregate [codegen id : 6] +Input [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] +Keys [1]: [s_store_sk#25] +Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#21)), partial_sum(UnscaledValue(sr_net_loss#22))] +Aggregate Attributes [2]: [sum#26, sum#27] +Results [3]: [s_store_sk#25, sum#28, sum#29] + +(30) Exchange +Input [3]: [s_store_sk#25, sum#28, sum#29] +Arguments: hashpartitioning(s_store_sk#25, 5), ENSURE_REQUIREMENTS, [id=#30] + +(31) HashAggregate [codegen id : 7] +Input [3]: [s_store_sk#25, sum#28, sum#29] +Keys [1]: [s_store_sk#25] +Functions [2]: [sum(UnscaledValue(sr_return_amt#21)), sum(UnscaledValue(sr_net_loss#22))] +Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#31, sum(UnscaledValue(sr_net_loss#22))#32] +Results [3]: [s_store_sk#25, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#31,17,2) AS returns#33, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#32,17,2) AS profit_loss#34] + +(32) BroadcastExchange +Input [3]: [s_store_sk#25, returns#33, profit_loss#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] + +(33) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [s_store_sk#9] +Right keys [1]: [s_store_sk#25] +Join condition: None + +(34) Project [codegen id : 8] +Output [5]: [store channel AS channel#36, s_store_sk#9 AS id#37, sales#18, coalesce(returns#33, 0.00) AS returns#38, CheckOverflow((promote_precision(cast(profit#19 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#34, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#39] +Input [6]: [s_store_sk#9, sales#18, profit#19, s_store_sk#25, returns#33, profit_loss#34] + +(35) Scan parquet default.catalog_sales +Output [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#43), dynamicpruningexpression(cs_sold_date_sk#43 IN dynamicpruning#5)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 10] +Input [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] + +(37) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#44] + +(38) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#43] +Right keys [1]: [d_date_sk#44] +Join condition: None + +(39) Project [codegen id : 10] +Output [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Input [5]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43, d_date_sk#44] + +(40) HashAggregate [codegen id : 10] +Input [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#41)), partial_sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum#45, sum#46] +Results [3]: [cs_call_center_sk#40, sum#47, sum#48] + +(41) Exchange +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Arguments: hashpartitioning(cs_call_center_sk#40, 5), ENSURE_REQUIREMENTS, [id=#49] + +(42) HashAggregate [codegen id : 14] +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#41)), sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#41))#50, sum(UnscaledValue(cs_net_profit#42))#51] +Results [3]: [cs_call_center_sk#40, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#41))#50,17,2) AS sales#52, MakeDecimal(sum(UnscaledValue(cs_net_profit#42))#51,17,2) AS profit#53] + +(43) Scan parquet default.catalog_returns +Output [3]: [cr_return_amount#54, cr_net_loss#55, cr_returned_date_sk#56] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#56), dynamicpruningexpression(cr_returned_date_sk#56 IN dynamicpruning#5)] +ReadSchema: struct + +(44) ColumnarToRow [codegen id : 12] +Input [3]: [cr_return_amount#54, cr_net_loss#55, cr_returned_date_sk#56] + +(45) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#57] + +(46) BroadcastHashJoin [codegen id : 12] +Left keys [1]: [cr_returned_date_sk#56] +Right keys [1]: [d_date_sk#57] +Join condition: None + +(47) Project [codegen id : 12] +Output [2]: [cr_return_amount#54, cr_net_loss#55] +Input [4]: [cr_return_amount#54, cr_net_loss#55, cr_returned_date_sk#56, d_date_sk#57] + +(48) HashAggregate [codegen id : 12] +Input [2]: [cr_return_amount#54, cr_net_loss#55] +Keys: [] +Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#54)), partial_sum(UnscaledValue(cr_net_loss#55))] +Aggregate Attributes [2]: [sum#58, sum#59] +Results [2]: [sum#60, sum#61] + +(49) Exchange +Input [2]: [sum#60, sum#61] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#62] + +(50) HashAggregate [codegen id : 13] +Input [2]: [sum#60, sum#61] +Keys: [] +Functions [2]: [sum(UnscaledValue(cr_return_amount#54)), sum(UnscaledValue(cr_net_loss#55))] +Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#54))#63, sum(UnscaledValue(cr_net_loss#55))#64] +Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#54))#63,17,2) AS returns#65, MakeDecimal(sum(UnscaledValue(cr_net_loss#55))#64,17,2) AS profit_loss#66] + +(51) BroadcastExchange +Input [2]: [returns#65, profit_loss#66] +Arguments: IdentityBroadcastMode, [id=#67] + +(52) BroadcastNestedLoopJoin [codegen id : 14] +Join condition: None + +(53) Project [codegen id : 14] +Output [5]: [catalog channel AS channel#68, cs_call_center_sk#40 AS id#69, sales#52, returns#65, CheckOverflow((promote_precision(cast(profit#53 as decimal(18,2))) - promote_precision(cast(profit_loss#66 as decimal(18,2)))), DecimalType(18,2), true) AS profit#70] +Input [5]: [cs_call_center_sk#40, sales#52, profit#53, returns#65, profit_loss#66] + +(54) Scan parquet default.web_sales +Output [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#74), dynamicpruningexpression(ws_sold_date_sk#74 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_web_page_sk)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 17] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] + +(56) Filter [codegen id : 17] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] +Condition : isnotnull(ws_web_page_sk#71) + +(57) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#75] + +(58) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#74] +Right keys [1]: [d_date_sk#75] +Join condition: None + +(59) Project [codegen id : 17] +Output [3]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73] +Input [5]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74, d_date_sk#75] + +(60) Scan parquet default.web_page +Output [1]: [wp_web_page_sk#76] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_page] +PushedFilters: [IsNotNull(wp_web_page_sk)] +ReadSchema: struct + +(61) ColumnarToRow [codegen id : 16] +Input [1]: [wp_web_page_sk#76] + +(62) Filter [codegen id : 16] +Input [1]: [wp_web_page_sk#76] +Condition : isnotnull(wp_web_page_sk#76) + +(63) BroadcastExchange +Input [1]: [wp_web_page_sk#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#77] + +(64) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_web_page_sk#71] +Right keys [1]: [wp_web_page_sk#76] +Join condition: None + +(65) Project [codegen id : 17] +Output [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] + +(66) HashAggregate [codegen id : 17] +Input [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#72)), partial_sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum#78, sum#79] +Results [3]: [wp_web_page_sk#76, sum#80, sum#81] + +(67) Exchange +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Arguments: hashpartitioning(wp_web_page_sk#76, 5), ENSURE_REQUIREMENTS, [id=#82] + +(68) HashAggregate [codegen id : 22] +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#72)), sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#72))#83, sum(UnscaledValue(ws_net_profit#73))#84] +Results [3]: [wp_web_page_sk#76, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#72))#83,17,2) AS sales#85, MakeDecimal(sum(UnscaledValue(ws_net_profit#73))#84,17,2) AS profit#86] + +(69) Scan parquet default.web_returns +Output [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#90), dynamicpruningexpression(wr_returned_date_sk#90 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(wr_web_page_sk)] +ReadSchema: struct + +(70) ColumnarToRow [codegen id : 20] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] + +(71) Filter [codegen id : 20] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] +Condition : isnotnull(wr_web_page_sk#87) + +(72) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#91] + +(73) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [wr_returned_date_sk#90] +Right keys [1]: [d_date_sk#91] +Join condition: None + +(74) Project [codegen id : 20] +Output [3]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89] +Input [5]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90, d_date_sk#91] + +(75) ReusedExchange [Reuses operator id: 63] +Output [1]: [wp_web_page_sk#92] + +(76) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [wr_web_page_sk#87] +Right keys [1]: [wp_web_page_sk#92] +Join condition: None + +(77) Project [codegen id : 20] +Output [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] + +(78) HashAggregate [codegen id : 20] +Input [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Keys [1]: [wp_web_page_sk#92] +Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#88)), partial_sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum#93, sum#94] +Results [3]: [wp_web_page_sk#92, sum#95, sum#96] + +(79) Exchange +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Arguments: hashpartitioning(wp_web_page_sk#92, 5), ENSURE_REQUIREMENTS, [id=#97] + +(80) HashAggregate [codegen id : 21] +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Keys [1]: [wp_web_page_sk#92] +Functions [2]: [sum(UnscaledValue(wr_return_amt#88)), sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#88))#98, sum(UnscaledValue(wr_net_loss#89))#99] +Results [3]: [wp_web_page_sk#92, MakeDecimal(sum(UnscaledValue(wr_return_amt#88))#98,17,2) AS returns#100, MakeDecimal(sum(UnscaledValue(wr_net_loss#89))#99,17,2) AS profit_loss#101] + +(81) BroadcastExchange +Input [3]: [wp_web_page_sk#92, returns#100, profit_loss#101] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#102] + +(82) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [wp_web_page_sk#76] +Right keys [1]: [wp_web_page_sk#92] +Join condition: None + +(83) Project [codegen id : 22] +Output [5]: [web channel AS channel#103, wp_web_page_sk#76 AS id#104, sales#85, coalesce(returns#100, 0.00) AS returns#105, CheckOverflow((promote_precision(cast(profit#86 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#101, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#106] +Input [6]: [wp_web_page_sk#76, sales#85, profit#86, wp_web_page_sk#92, returns#100, profit_loss#101] + +(84) Union + +(85) HashAggregate [codegen id : 23] +Input [5]: [channel#36, id#37, sales#18, returns#38, profit#39] +Keys [2]: [channel#36, id#37] +Functions [3]: [partial_sum(sales#18), partial_sum(returns#38), partial_sum(profit#39)] +Aggregate Attributes [6]: [sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] +Results [8]: [channel#36, id#37, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118] + +(86) Exchange +Input [8]: [channel#36, id#37, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118] +Arguments: hashpartitioning(channel#36, id#37, 5), ENSURE_REQUIREMENTS, [id=#119] + +(87) HashAggregate [codegen id : 24] +Input [8]: [channel#36, id#37, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118] +Keys [2]: [channel#36, id#37] +Functions [3]: [sum(sales#18), sum(returns#38), sum(profit#39)] +Aggregate Attributes [3]: [sum(sales#18)#120, sum(returns#38)#121, sum(profit#39)#122] +Results [5]: [channel#36, id#37, cast(sum(sales#18)#120 as decimal(37,2)) AS sales#123, cast(sum(returns#38)#121 as decimal(37,2)) AS returns#124, cast(sum(profit#39)#122 as decimal(38,2)) AS profit#125] + +(88) ReusedExchange [Reuses operator id: unknown] +Output [8]: [channel#36, id#37, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] + +(89) HashAggregate [codegen id : 48] +Input [8]: [channel#36, id#37, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] +Keys [2]: [channel#36, id#37] +Functions [3]: [sum(sales#18), sum(returns#38), sum(profit#39)] +Aggregate Attributes [3]: [sum(sales#18)#132, sum(returns#38)#133, sum(profit#39)#134] +Results [4]: [channel#36, sum(sales#18)#132 AS sales#135, sum(returns#38)#133 AS returns#136, sum(profit#39)#134 AS profit#137] + +(90) HashAggregate [codegen id : 48] +Input [4]: [channel#36, sales#135, returns#136, profit#137] +Keys [1]: [channel#36] +Functions [3]: [partial_sum(sales#135), partial_sum(returns#136), partial_sum(profit#137)] +Aggregate Attributes [6]: [sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] +Results [7]: [channel#36, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] + +(91) Exchange +Input [7]: [channel#36, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] +Arguments: hashpartitioning(channel#36, 5), ENSURE_REQUIREMENTS, [id=#150] + +(92) HashAggregate [codegen id : 49] +Input [7]: [channel#36, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] +Keys [1]: [channel#36] +Functions [3]: [sum(sales#135), sum(returns#136), sum(profit#137)] +Aggregate Attributes [3]: [sum(sales#135)#151, sum(returns#136)#152, sum(profit#137)#153] +Results [5]: [channel#36, null AS id#154, sum(sales#135)#151 AS sales#155, sum(returns#136)#152 AS returns#156, sum(profit#137)#153 AS profit#157] + +(93) ReusedExchange [Reuses operator id: unknown] +Output [8]: [channel#36, id#37, sum#158, isEmpty#159, sum#160, isEmpty#161, sum#162, isEmpty#163] + +(94) HashAggregate [codegen id : 73] +Input [8]: [channel#36, id#37, sum#158, isEmpty#159, sum#160, isEmpty#161, sum#162, isEmpty#163] +Keys [2]: [channel#36, id#37] +Functions [3]: [sum(sales#18), sum(returns#38), sum(profit#39)] +Aggregate Attributes [3]: [sum(sales#18)#164, sum(returns#38)#165, sum(profit#39)#166] +Results [3]: [sum(sales#18)#164 AS sales#135, sum(returns#38)#165 AS returns#136, sum(profit#39)#166 AS profit#137] + +(95) HashAggregate [codegen id : 73] +Input [3]: [sales#135, returns#136, profit#137] +Keys: [] +Functions [3]: [partial_sum(sales#135), partial_sum(returns#136), partial_sum(profit#137)] +Aggregate Attributes [6]: [sum#167, isEmpty#168, sum#169, isEmpty#170, sum#171, isEmpty#172] +Results [6]: [sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] + +(96) Exchange +Input [6]: [sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#179] + +(97) HashAggregate [codegen id : 74] +Input [6]: [sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] +Keys: [] +Functions [3]: [sum(sales#135), sum(returns#136), sum(profit#137)] +Aggregate Attributes [3]: [sum(sales#135)#180, sum(returns#136)#181, sum(profit#137)#182] +Results [5]: [null AS channel#183, null AS id#184, sum(sales#135)#180 AS sales#185, sum(returns#136)#181 AS returns#186, sum(profit#137)#182 AS profit#187] + +(98) Union + +(99) HashAggregate [codegen id : 75] +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Keys [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#36, id#37, sales#123, returns#124, profit#125] + +(100) Exchange +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Arguments: hashpartitioning(channel#36, id#37, sales#123, returns#124, profit#125, 5), ENSURE_REQUIREMENTS, [id=#188] + +(101) HashAggregate [codegen id : 76] +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Keys [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#36, id#37, sales#123, returns#124, profit#125] + +(102) TakeOrderedAndProject +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Arguments: 100, [channel#36 ASC NULLS FIRST, id#37 ASC NULLS FIRST], [channel#36, id#37, sales#123, returns#124, profit#125] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (103) + + +(103) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 20 Hosting Expression = sr_returned_date_sk#23 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 35 Hosting Expression = cs_sold_date_sk#43 IN dynamicpruning#5 + +Subquery:4 Hosting operator id = 43 Hosting Expression = cr_returned_date_sk#56 IN dynamicpruning#5 + +Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#74 IN dynamicpruning#5 + +Subquery:6 Hosting operator id = 69 Hosting Expression = wr_returned_date_sk#90 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt new file mode 100644 index 0000000000000..4cadc7fb960a2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a.sf100/simplified.txt @@ -0,0 +1,168 @@ +TakeOrderedAndProject [channel,id,sales,returns,profit] + WholeStageCodegen (76) + HashAggregate [channel,id,sales,returns,profit] + InputAdapter + Exchange [channel,id,sales,returns,profit] #1 + WholeStageCodegen (75) + HashAggregate [channel,id,sales,returns,profit] + InputAdapter + Union + WholeStageCodegen (24) + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel,id] #2 + WholeStageCodegen (23) + HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (8) + Project [s_store_sk,sales,returns,profit,profit_loss] + BroadcastHashJoin [s_store_sk,s_store_sk] + HashAggregate [s_store_sk,sum,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(UnscaledValue(ss_net_profit)),sales,profit,sum,sum] + InputAdapter + Exchange [s_store_sk] #3 + WholeStageCodegen (3) + HashAggregate [s_store_sk,ss_ext_sales_price,ss_net_profit] [sum,sum,sum,sum] + Project [ss_ext_sales_price,ss_net_profit,s_store_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_ext_sales_price,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + HashAggregate [s_store_sk,sum,sum] [sum(UnscaledValue(sr_return_amt)),sum(UnscaledValue(sr_net_loss)),returns,profit_loss,sum,sum] + InputAdapter + Exchange [s_store_sk] #7 + WholeStageCodegen (6) + HashAggregate [s_store_sk,sr_return_amt,sr_net_loss] [sum,sum,sum,sum] + Project [sr_return_amt,sr_net_loss,s_store_sk] + BroadcastHashJoin [sr_store_sk,s_store_sk] + Project [sr_store_sk,sr_return_amt,sr_net_loss] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_store_sk,sr_return_amt,sr_net_loss,sr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + ReusedExchange [s_store_sk] #5 + WholeStageCodegen (14) + Project [cs_call_center_sk,sales,returns,profit,profit_loss] + BroadcastNestedLoopJoin + HashAggregate [cs_call_center_sk,sum,sum] [sum(UnscaledValue(cs_ext_sales_price)),sum(UnscaledValue(cs_net_profit)),sales,profit,sum,sum] + InputAdapter + Exchange [cs_call_center_sk] #8 + WholeStageCodegen (10) + HashAggregate [cs_call_center_sk,cs_ext_sales_price,cs_net_profit] [sum,sum,sum,sum] + Project [cs_call_center_sk,cs_ext_sales_price,cs_net_profit] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_call_center_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (13) + HashAggregate [sum,sum] [sum(UnscaledValue(cr_return_amount)),sum(UnscaledValue(cr_net_loss)),returns,profit_loss,sum,sum] + InputAdapter + Exchange #10 + WholeStageCodegen (12) + HashAggregate [cr_return_amount,cr_net_loss] [sum,sum,sum,sum] + Project [cr_return_amount,cr_net_loss] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_return_amount,cr_net_loss,cr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + WholeStageCodegen (22) + Project [wp_web_page_sk,sales,returns,profit,profit_loss] + BroadcastHashJoin [wp_web_page_sk,wp_web_page_sk] + HashAggregate [wp_web_page_sk,sum,sum] [sum(UnscaledValue(ws_ext_sales_price)),sum(UnscaledValue(ws_net_profit)),sales,profit,sum,sum] + InputAdapter + Exchange [wp_web_page_sk] #11 + WholeStageCodegen (17) + HashAggregate [wp_web_page_sk,ws_ext_sales_price,ws_net_profit] [sum,sum,sum,sum] + Project [ws_ext_sales_price,ws_net_profit,wp_web_page_sk] + BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] + Project [ws_web_page_sk,ws_ext_sales_price,ws_net_profit] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_web_page_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (16) + Filter [wp_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_page [wp_web_page_sk] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (21) + HashAggregate [wp_web_page_sk,sum,sum] [sum(UnscaledValue(wr_return_amt)),sum(UnscaledValue(wr_net_loss)),returns,profit_loss,sum,sum] + InputAdapter + Exchange [wp_web_page_sk] #14 + WholeStageCodegen (20) + HashAggregate [wp_web_page_sk,wr_return_amt,wr_net_loss] [sum,sum,sum,sum] + Project [wr_return_amt,wr_net_loss,wp_web_page_sk] + BroadcastHashJoin [wr_web_page_sk,wp_web_page_sk] + Project [wr_web_page_sk,wr_return_amt,wr_net_loss] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + Filter [wr_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_web_page_sk,wr_return_amt,wr_net_loss,wr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + ReusedExchange [wp_web_page_sk] #12 + WholeStageCodegen (49) + HashAggregate [channel,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),id,sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel] #15 + WholeStageCodegen (48) + HashAggregate [channel,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + ReusedExchange [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] #16 + WholeStageCodegen (74) + HashAggregate [sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),channel,id,sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange #17 + WholeStageCodegen (73) + HashAggregate [sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + ReusedExchange [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] #16 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt new file mode 100644 index 0000000000000..c74b44df70a65 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/explain.txt @@ -0,0 +1,619 @@ +== Physical Plan == +TakeOrderedAndProject (102) ++- * HashAggregate (101) + +- Exchange (100) + +- * HashAggregate (99) + +- Union (98) + :- * HashAggregate (87) + : +- Exchange (86) + : +- * HashAggregate (85) + : +- Union (84) + : :- * Project (34) + : : +- * BroadcastHashJoin LeftOuter BuildRight (33) + : : :- * HashAggregate (19) + : : : +- Exchange (18) + : : : +- * HashAggregate (17) + : : : +- * Project (16) + : : : +- * BroadcastHashJoin Inner BuildRight (15) + : : : :- * Project (10) + : : : : +- * BroadcastHashJoin Inner BuildRight (9) + : : : : :- * Filter (3) + : : : : : +- * ColumnarToRow (2) + : : : : : +- Scan parquet default.store_sales (1) + : : : : +- BroadcastExchange (8) + : : : : +- * Project (7) + : : : : +- * Filter (6) + : : : : +- * ColumnarToRow (5) + : : : : +- Scan parquet default.date_dim (4) + : : : +- BroadcastExchange (14) + : : : +- * Filter (13) + : : : +- * ColumnarToRow (12) + : : : +- Scan parquet default.store (11) + : : +- BroadcastExchange (32) + : : +- * HashAggregate (31) + : : +- Exchange (30) + : : +- * HashAggregate (29) + : : +- * Project (28) + : : +- * BroadcastHashJoin Inner BuildRight (27) + : : :- * Project (25) + : : : +- * BroadcastHashJoin Inner BuildRight (24) + : : : :- * Filter (22) + : : : : +- * ColumnarToRow (21) + : : : : +- Scan parquet default.store_returns (20) + : : : +- ReusedExchange (23) + : : +- ReusedExchange (26) + : :- * Project (53) + : : +- * BroadcastNestedLoopJoin Inner BuildLeft (52) + : : :- BroadcastExchange (43) + : : : +- * HashAggregate (42) + : : : +- Exchange (41) + : : : +- * HashAggregate (40) + : : : +- * Project (39) + : : : +- * BroadcastHashJoin Inner BuildRight (38) + : : : :- * ColumnarToRow (36) + : : : : +- Scan parquet default.catalog_sales (35) + : : : +- ReusedExchange (37) + : : +- * HashAggregate (51) + : : +- Exchange (50) + : : +- * HashAggregate (49) + : : +- * Project (48) + : : +- * BroadcastHashJoin Inner BuildRight (47) + : : :- * ColumnarToRow (45) + : : : +- Scan parquet default.catalog_returns (44) + : : +- ReusedExchange (46) + : +- * Project (83) + : +- * BroadcastHashJoin LeftOuter BuildRight (82) + : :- * HashAggregate (68) + : : +- Exchange (67) + : : +- * HashAggregate (66) + : : +- * Project (65) + : : +- * BroadcastHashJoin Inner BuildRight (64) + : : :- * Project (59) + : : : +- * BroadcastHashJoin Inner BuildRight (58) + : : : :- * Filter (56) + : : : : +- * ColumnarToRow (55) + : : : : +- Scan parquet default.web_sales (54) + : : : +- ReusedExchange (57) + : : +- BroadcastExchange (63) + : : +- * Filter (62) + : : +- * ColumnarToRow (61) + : : +- Scan parquet default.web_page (60) + : +- BroadcastExchange (81) + : +- * HashAggregate (80) + : +- Exchange (79) + : +- * HashAggregate (78) + : +- * Project (77) + : +- * BroadcastHashJoin Inner BuildRight (76) + : :- * Project (74) + : : +- * BroadcastHashJoin Inner BuildRight (73) + : : :- * Filter (71) + : : : +- * ColumnarToRow (70) + : : : +- Scan parquet default.web_returns (69) + : : +- ReusedExchange (72) + : +- ReusedExchange (75) + :- * HashAggregate (92) + : +- Exchange (91) + : +- * HashAggregate (90) + : +- * HashAggregate (89) + : +- ReusedExchange (88) + +- * HashAggregate (97) + +- Exchange (96) + +- * HashAggregate (95) + +- * HashAggregate (94) + +- ReusedExchange (93) + + +(1) Scan parquet default.store_sales +Output [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#4), dynamicpruningexpression(ss_sold_date_sk#4 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ss_store_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] + +(3) Filter [codegen id : 3] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4] +Condition : isnotnull(ss_store_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#6, d_date#7] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1998-08-04), LessThanOrEqual(d_date,1998-09-03), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#6, d_date#7] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#6, d_date#7] +Condition : (((isnotnull(d_date#7) AND (d_date#7 >= 1998-08-04)) AND (d_date#7 <= 1998-09-03)) AND isnotnull(d_date_sk#6)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#6] +Input [2]: [d_date_sk#6, d_date#7] + +(8) BroadcastExchange +Input [1]: [d_date_sk#6] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#8] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#4] +Right keys [1]: [d_date_sk#6] +Join condition: None + +(10) Project [codegen id : 3] +Output [3]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3] +Input [5]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, ss_sold_date_sk#4, d_date_sk#6] + +(11) Scan parquet default.store +Output [1]: [s_store_sk#9] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [1]: [s_store_sk#9] + +(13) Filter [codegen id : 2] +Input [1]: [s_store_sk#9] +Condition : isnotnull(s_store_sk#9) + +(14) BroadcastExchange +Input [1]: [s_store_sk#9] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#10] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_store_sk#1] +Right keys [1]: [s_store_sk#9] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#9] +Input [4]: [ss_store_sk#1, ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#9] + +(17) HashAggregate [codegen id : 3] +Input [3]: [ss_ext_sales_price#2, ss_net_profit#3, s_store_sk#9] +Keys [1]: [s_store_sk#9] +Functions [2]: [partial_sum(UnscaledValue(ss_ext_sales_price#2)), partial_sum(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [2]: [sum#11, sum#12] +Results [3]: [s_store_sk#9, sum#13, sum#14] + +(18) Exchange +Input [3]: [s_store_sk#9, sum#13, sum#14] +Arguments: hashpartitioning(s_store_sk#9, 5), ENSURE_REQUIREMENTS, [id=#15] + +(19) HashAggregate [codegen id : 8] +Input [3]: [s_store_sk#9, sum#13, sum#14] +Keys [1]: [s_store_sk#9] +Functions [2]: [sum(UnscaledValue(ss_ext_sales_price#2)), sum(UnscaledValue(ss_net_profit#3))] +Aggregate Attributes [2]: [sum(UnscaledValue(ss_ext_sales_price#2))#16, sum(UnscaledValue(ss_net_profit#3))#17] +Results [3]: [s_store_sk#9, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#16,17,2) AS sales#18, MakeDecimal(sum(UnscaledValue(ss_net_profit#3))#17,17,2) AS profit#19] + +(20) Scan parquet default.store_returns +Output [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(sr_returned_date_sk#23), dynamicpruningexpression(sr_returned_date_sk#23 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(sr_store_sk)] +ReadSchema: struct + +(21) ColumnarToRow [codegen id : 6] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] + +(22) Filter [codegen id : 6] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23] +Condition : isnotnull(sr_store_sk#20) + +(23) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#24] + +(24) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [sr_returned_date_sk#23] +Right keys [1]: [d_date_sk#24] +Join condition: None + +(25) Project [codegen id : 6] +Output [3]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22] +Input [5]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, sr_returned_date_sk#23, d_date_sk#24] + +(26) ReusedExchange [Reuses operator id: 14] +Output [1]: [s_store_sk#25] + +(27) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [sr_store_sk#20] +Right keys [1]: [s_store_sk#25] +Join condition: None + +(28) Project [codegen id : 6] +Output [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] +Input [4]: [sr_store_sk#20, sr_return_amt#21, sr_net_loss#22, s_store_sk#25] + +(29) HashAggregate [codegen id : 6] +Input [3]: [sr_return_amt#21, sr_net_loss#22, s_store_sk#25] +Keys [1]: [s_store_sk#25] +Functions [2]: [partial_sum(UnscaledValue(sr_return_amt#21)), partial_sum(UnscaledValue(sr_net_loss#22))] +Aggregate Attributes [2]: [sum#26, sum#27] +Results [3]: [s_store_sk#25, sum#28, sum#29] + +(30) Exchange +Input [3]: [s_store_sk#25, sum#28, sum#29] +Arguments: hashpartitioning(s_store_sk#25, 5), ENSURE_REQUIREMENTS, [id=#30] + +(31) HashAggregate [codegen id : 7] +Input [3]: [s_store_sk#25, sum#28, sum#29] +Keys [1]: [s_store_sk#25] +Functions [2]: [sum(UnscaledValue(sr_return_amt#21)), sum(UnscaledValue(sr_net_loss#22))] +Aggregate Attributes [2]: [sum(UnscaledValue(sr_return_amt#21))#31, sum(UnscaledValue(sr_net_loss#22))#32] +Results [3]: [s_store_sk#25, MakeDecimal(sum(UnscaledValue(sr_return_amt#21))#31,17,2) AS returns#33, MakeDecimal(sum(UnscaledValue(sr_net_loss#22))#32,17,2) AS profit_loss#34] + +(32) BroadcastExchange +Input [3]: [s_store_sk#25, returns#33, profit_loss#34] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#35] + +(33) BroadcastHashJoin [codegen id : 8] +Left keys [1]: [s_store_sk#9] +Right keys [1]: [s_store_sk#25] +Join condition: None + +(34) Project [codegen id : 8] +Output [5]: [store channel AS channel#36, s_store_sk#9 AS id#37, sales#18, coalesce(returns#33, 0.00) AS returns#38, CheckOverflow((promote_precision(cast(profit#19 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#34, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#39] +Input [6]: [s_store_sk#9, sales#18, profit#19, s_store_sk#25, returns#33, profit_loss#34] + +(35) Scan parquet default.catalog_sales +Output [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#43), dynamicpruningexpression(cs_sold_date_sk#43 IN dynamicpruning#5)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 10] +Input [4]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43] + +(37) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#44] + +(38) BroadcastHashJoin [codegen id : 10] +Left keys [1]: [cs_sold_date_sk#43] +Right keys [1]: [d_date_sk#44] +Join condition: None + +(39) Project [codegen id : 10] +Output [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Input [5]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42, cs_sold_date_sk#43, d_date_sk#44] + +(40) HashAggregate [codegen id : 10] +Input [3]: [cs_call_center_sk#40, cs_ext_sales_price#41, cs_net_profit#42] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [partial_sum(UnscaledValue(cs_ext_sales_price#41)), partial_sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum#45, sum#46] +Results [3]: [cs_call_center_sk#40, sum#47, sum#48] + +(41) Exchange +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Arguments: hashpartitioning(cs_call_center_sk#40, 5), ENSURE_REQUIREMENTS, [id=#49] + +(42) HashAggregate [codegen id : 11] +Input [3]: [cs_call_center_sk#40, sum#47, sum#48] +Keys [1]: [cs_call_center_sk#40] +Functions [2]: [sum(UnscaledValue(cs_ext_sales_price#41)), sum(UnscaledValue(cs_net_profit#42))] +Aggregate Attributes [2]: [sum(UnscaledValue(cs_ext_sales_price#41))#50, sum(UnscaledValue(cs_net_profit#42))#51] +Results [3]: [cs_call_center_sk#40, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#41))#50,17,2) AS sales#52, MakeDecimal(sum(UnscaledValue(cs_net_profit#42))#51,17,2) AS profit#53] + +(43) BroadcastExchange +Input [3]: [cs_call_center_sk#40, sales#52, profit#53] +Arguments: IdentityBroadcastMode, [id=#54] + +(44) Scan parquet default.catalog_returns +Output [3]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cr_returned_date_sk#57), dynamicpruningexpression(cr_returned_date_sk#57 IN dynamicpruning#5)] +ReadSchema: struct + +(45) ColumnarToRow [codegen id : 13] +Input [3]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57] + +(46) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#58] + +(47) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [cr_returned_date_sk#57] +Right keys [1]: [d_date_sk#58] +Join condition: None + +(48) Project [codegen id : 13] +Output [2]: [cr_return_amount#55, cr_net_loss#56] +Input [4]: [cr_return_amount#55, cr_net_loss#56, cr_returned_date_sk#57, d_date_sk#58] + +(49) HashAggregate [codegen id : 13] +Input [2]: [cr_return_amount#55, cr_net_loss#56] +Keys: [] +Functions [2]: [partial_sum(UnscaledValue(cr_return_amount#55)), partial_sum(UnscaledValue(cr_net_loss#56))] +Aggregate Attributes [2]: [sum#59, sum#60] +Results [2]: [sum#61, sum#62] + +(50) Exchange +Input [2]: [sum#61, sum#62] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#63] + +(51) HashAggregate +Input [2]: [sum#61, sum#62] +Keys: [] +Functions [2]: [sum(UnscaledValue(cr_return_amount#55)), sum(UnscaledValue(cr_net_loss#56))] +Aggregate Attributes [2]: [sum(UnscaledValue(cr_return_amount#55))#64, sum(UnscaledValue(cr_net_loss#56))#65] +Results [2]: [MakeDecimal(sum(UnscaledValue(cr_return_amount#55))#64,17,2) AS returns#66, MakeDecimal(sum(UnscaledValue(cr_net_loss#56))#65,17,2) AS profit_loss#67] + +(52) BroadcastNestedLoopJoin [codegen id : 14] +Join condition: None + +(53) Project [codegen id : 14] +Output [5]: [catalog channel AS channel#68, cs_call_center_sk#40 AS id#69, sales#52, returns#66, CheckOverflow((promote_precision(cast(profit#53 as decimal(18,2))) - promote_precision(cast(profit_loss#67 as decimal(18,2)))), DecimalType(18,2), true) AS profit#70] +Input [5]: [cs_call_center_sk#40, sales#52, profit#53, returns#66, profit_loss#67] + +(54) Scan parquet default.web_sales +Output [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#74), dynamicpruningexpression(ws_sold_date_sk#74 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(ws_web_page_sk)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 17] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] + +(56) Filter [codegen id : 17] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74] +Condition : isnotnull(ws_web_page_sk#71) + +(57) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#75] + +(58) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_sold_date_sk#74] +Right keys [1]: [d_date_sk#75] +Join condition: None + +(59) Project [codegen id : 17] +Output [3]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73] +Input [5]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, ws_sold_date_sk#74, d_date_sk#75] + +(60) Scan parquet default.web_page +Output [1]: [wp_web_page_sk#76] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_page] +PushedFilters: [IsNotNull(wp_web_page_sk)] +ReadSchema: struct + +(61) ColumnarToRow [codegen id : 16] +Input [1]: [wp_web_page_sk#76] + +(62) Filter [codegen id : 16] +Input [1]: [wp_web_page_sk#76] +Condition : isnotnull(wp_web_page_sk#76) + +(63) BroadcastExchange +Input [1]: [wp_web_page_sk#76] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#77] + +(64) BroadcastHashJoin [codegen id : 17] +Left keys [1]: [ws_web_page_sk#71] +Right keys [1]: [wp_web_page_sk#76] +Join condition: None + +(65) Project [codegen id : 17] +Output [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Input [4]: [ws_web_page_sk#71, ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] + +(66) HashAggregate [codegen id : 17] +Input [3]: [ws_ext_sales_price#72, ws_net_profit#73, wp_web_page_sk#76] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [partial_sum(UnscaledValue(ws_ext_sales_price#72)), partial_sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum#78, sum#79] +Results [3]: [wp_web_page_sk#76, sum#80, sum#81] + +(67) Exchange +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Arguments: hashpartitioning(wp_web_page_sk#76, 5), ENSURE_REQUIREMENTS, [id=#82] + +(68) HashAggregate [codegen id : 22] +Input [3]: [wp_web_page_sk#76, sum#80, sum#81] +Keys [1]: [wp_web_page_sk#76] +Functions [2]: [sum(UnscaledValue(ws_ext_sales_price#72)), sum(UnscaledValue(ws_net_profit#73))] +Aggregate Attributes [2]: [sum(UnscaledValue(ws_ext_sales_price#72))#83, sum(UnscaledValue(ws_net_profit#73))#84] +Results [3]: [wp_web_page_sk#76, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#72))#83,17,2) AS sales#85, MakeDecimal(sum(UnscaledValue(ws_net_profit#73))#84,17,2) AS profit#86] + +(69) Scan parquet default.web_returns +Output [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(wr_returned_date_sk#90), dynamicpruningexpression(wr_returned_date_sk#90 IN dynamicpruning#5)] +PushedFilters: [IsNotNull(wr_web_page_sk)] +ReadSchema: struct + +(70) ColumnarToRow [codegen id : 20] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] + +(71) Filter [codegen id : 20] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90] +Condition : isnotnull(wr_web_page_sk#87) + +(72) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#91] + +(73) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [wr_returned_date_sk#90] +Right keys [1]: [d_date_sk#91] +Join condition: None + +(74) Project [codegen id : 20] +Output [3]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89] +Input [5]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wr_returned_date_sk#90, d_date_sk#91] + +(75) ReusedExchange [Reuses operator id: 63] +Output [1]: [wp_web_page_sk#92] + +(76) BroadcastHashJoin [codegen id : 20] +Left keys [1]: [wr_web_page_sk#87] +Right keys [1]: [wp_web_page_sk#92] +Join condition: None + +(77) Project [codegen id : 20] +Output [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Input [4]: [wr_web_page_sk#87, wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] + +(78) HashAggregate [codegen id : 20] +Input [3]: [wr_return_amt#88, wr_net_loss#89, wp_web_page_sk#92] +Keys [1]: [wp_web_page_sk#92] +Functions [2]: [partial_sum(UnscaledValue(wr_return_amt#88)), partial_sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum#93, sum#94] +Results [3]: [wp_web_page_sk#92, sum#95, sum#96] + +(79) Exchange +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Arguments: hashpartitioning(wp_web_page_sk#92, 5), ENSURE_REQUIREMENTS, [id=#97] + +(80) HashAggregate [codegen id : 21] +Input [3]: [wp_web_page_sk#92, sum#95, sum#96] +Keys [1]: [wp_web_page_sk#92] +Functions [2]: [sum(UnscaledValue(wr_return_amt#88)), sum(UnscaledValue(wr_net_loss#89))] +Aggregate Attributes [2]: [sum(UnscaledValue(wr_return_amt#88))#98, sum(UnscaledValue(wr_net_loss#89))#99] +Results [3]: [wp_web_page_sk#92, MakeDecimal(sum(UnscaledValue(wr_return_amt#88))#98,17,2) AS returns#100, MakeDecimal(sum(UnscaledValue(wr_net_loss#89))#99,17,2) AS profit_loss#101] + +(81) BroadcastExchange +Input [3]: [wp_web_page_sk#92, returns#100, profit_loss#101] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#102] + +(82) BroadcastHashJoin [codegen id : 22] +Left keys [1]: [wp_web_page_sk#76] +Right keys [1]: [wp_web_page_sk#92] +Join condition: None + +(83) Project [codegen id : 22] +Output [5]: [web channel AS channel#103, wp_web_page_sk#76 AS id#104, sales#85, coalesce(returns#100, 0.00) AS returns#105, CheckOverflow((promote_precision(cast(profit#86 as decimal(18,2))) - promote_precision(cast(coalesce(profit_loss#101, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS profit#106] +Input [6]: [wp_web_page_sk#76, sales#85, profit#86, wp_web_page_sk#92, returns#100, profit_loss#101] + +(84) Union + +(85) HashAggregate [codegen id : 23] +Input [5]: [channel#36, id#37, sales#18, returns#38, profit#39] +Keys [2]: [channel#36, id#37] +Functions [3]: [partial_sum(sales#18), partial_sum(returns#38), partial_sum(profit#39)] +Aggregate Attributes [6]: [sum#107, isEmpty#108, sum#109, isEmpty#110, sum#111, isEmpty#112] +Results [8]: [channel#36, id#37, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118] + +(86) Exchange +Input [8]: [channel#36, id#37, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118] +Arguments: hashpartitioning(channel#36, id#37, 5), ENSURE_REQUIREMENTS, [id=#119] + +(87) HashAggregate [codegen id : 24] +Input [8]: [channel#36, id#37, sum#113, isEmpty#114, sum#115, isEmpty#116, sum#117, isEmpty#118] +Keys [2]: [channel#36, id#37] +Functions [3]: [sum(sales#18), sum(returns#38), sum(profit#39)] +Aggregate Attributes [3]: [sum(sales#18)#120, sum(returns#38)#121, sum(profit#39)#122] +Results [5]: [channel#36, id#37, cast(sum(sales#18)#120 as decimal(37,2)) AS sales#123, cast(sum(returns#38)#121 as decimal(37,2)) AS returns#124, cast(sum(profit#39)#122 as decimal(38,2)) AS profit#125] + +(88) ReusedExchange [Reuses operator id: unknown] +Output [8]: [channel#36, id#37, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] + +(89) HashAggregate [codegen id : 48] +Input [8]: [channel#36, id#37, sum#126, isEmpty#127, sum#128, isEmpty#129, sum#130, isEmpty#131] +Keys [2]: [channel#36, id#37] +Functions [3]: [sum(sales#18), sum(returns#38), sum(profit#39)] +Aggregate Attributes [3]: [sum(sales#18)#132, sum(returns#38)#133, sum(profit#39)#134] +Results [4]: [channel#36, sum(sales#18)#132 AS sales#135, sum(returns#38)#133 AS returns#136, sum(profit#39)#134 AS profit#137] + +(90) HashAggregate [codegen id : 48] +Input [4]: [channel#36, sales#135, returns#136, profit#137] +Keys [1]: [channel#36] +Functions [3]: [partial_sum(sales#135), partial_sum(returns#136), partial_sum(profit#137)] +Aggregate Attributes [6]: [sum#138, isEmpty#139, sum#140, isEmpty#141, sum#142, isEmpty#143] +Results [7]: [channel#36, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] + +(91) Exchange +Input [7]: [channel#36, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] +Arguments: hashpartitioning(channel#36, 5), ENSURE_REQUIREMENTS, [id=#150] + +(92) HashAggregate [codegen id : 49] +Input [7]: [channel#36, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] +Keys [1]: [channel#36] +Functions [3]: [sum(sales#135), sum(returns#136), sum(profit#137)] +Aggregate Attributes [3]: [sum(sales#135)#151, sum(returns#136)#152, sum(profit#137)#153] +Results [5]: [channel#36, null AS id#154, sum(sales#135)#151 AS sales#155, sum(returns#136)#152 AS returns#156, sum(profit#137)#153 AS profit#157] + +(93) ReusedExchange [Reuses operator id: unknown] +Output [8]: [channel#36, id#37, sum#158, isEmpty#159, sum#160, isEmpty#161, sum#162, isEmpty#163] + +(94) HashAggregate [codegen id : 73] +Input [8]: [channel#36, id#37, sum#158, isEmpty#159, sum#160, isEmpty#161, sum#162, isEmpty#163] +Keys [2]: [channel#36, id#37] +Functions [3]: [sum(sales#18), sum(returns#38), sum(profit#39)] +Aggregate Attributes [3]: [sum(sales#18)#164, sum(returns#38)#165, sum(profit#39)#166] +Results [3]: [sum(sales#18)#164 AS sales#135, sum(returns#38)#165 AS returns#136, sum(profit#39)#166 AS profit#137] + +(95) HashAggregate [codegen id : 73] +Input [3]: [sales#135, returns#136, profit#137] +Keys: [] +Functions [3]: [partial_sum(sales#135), partial_sum(returns#136), partial_sum(profit#137)] +Aggregate Attributes [6]: [sum#167, isEmpty#168, sum#169, isEmpty#170, sum#171, isEmpty#172] +Results [6]: [sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] + +(96) Exchange +Input [6]: [sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#179] + +(97) HashAggregate [codegen id : 74] +Input [6]: [sum#173, isEmpty#174, sum#175, isEmpty#176, sum#177, isEmpty#178] +Keys: [] +Functions [3]: [sum(sales#135), sum(returns#136), sum(profit#137)] +Aggregate Attributes [3]: [sum(sales#135)#180, sum(returns#136)#181, sum(profit#137)#182] +Results [5]: [null AS channel#183, null AS id#184, sum(sales#135)#180 AS sales#185, sum(returns#136)#181 AS returns#186, sum(profit#137)#182 AS profit#187] + +(98) Union + +(99) HashAggregate [codegen id : 75] +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Keys [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#36, id#37, sales#123, returns#124, profit#125] + +(100) Exchange +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Arguments: hashpartitioning(channel#36, id#37, sales#123, returns#124, profit#125, 5), ENSURE_REQUIREMENTS, [id=#188] + +(101) HashAggregate [codegen id : 76] +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Keys [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#36, id#37, sales#123, returns#124, profit#125] + +(102) TakeOrderedAndProject +Input [5]: [channel#36, id#37, sales#123, returns#124, profit#125] +Arguments: 100, [channel#36 ASC NULLS FIRST, id#37 ASC NULLS FIRST], [channel#36, id#37, sales#123, returns#124, profit#125] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#4 IN dynamicpruning#5 +ReusedExchange (103) + + +(103) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#6] + +Subquery:2 Hosting operator id = 20 Hosting Expression = sr_returned_date_sk#23 IN dynamicpruning#5 + +Subquery:3 Hosting operator id = 35 Hosting Expression = cs_sold_date_sk#43 IN dynamicpruning#5 + +Subquery:4 Hosting operator id = 44 Hosting Expression = cr_returned_date_sk#57 IN dynamicpruning#5 + +Subquery:5 Hosting operator id = 54 Hosting Expression = ws_sold_date_sk#74 IN dynamicpruning#5 + +Subquery:6 Hosting operator id = 69 Hosting Expression = wr_returned_date_sk#90 IN dynamicpruning#5 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt new file mode 100644 index 0000000000000..6248fbf0129bc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q77a/simplified.txt @@ -0,0 +1,168 @@ +TakeOrderedAndProject [channel,id,sales,returns,profit] + WholeStageCodegen (76) + HashAggregate [channel,id,sales,returns,profit] + InputAdapter + Exchange [channel,id,sales,returns,profit] #1 + WholeStageCodegen (75) + HashAggregate [channel,id,sales,returns,profit] + InputAdapter + Union + WholeStageCodegen (24) + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel,id] #2 + WholeStageCodegen (23) + HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (8) + Project [s_store_sk,sales,returns,profit,profit_loss] + BroadcastHashJoin [s_store_sk,s_store_sk] + HashAggregate [s_store_sk,sum,sum] [sum(UnscaledValue(ss_ext_sales_price)),sum(UnscaledValue(ss_net_profit)),sales,profit,sum,sum] + InputAdapter + Exchange [s_store_sk] #3 + WholeStageCodegen (3) + HashAggregate [s_store_sk,ss_ext_sales_price,ss_net_profit] [sum,sum,sum,sum] + Project [ss_ext_sales_price,ss_net_profit,s_store_sk] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_ext_sales_price,ss_net_profit] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Filter [ss_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk] + InputAdapter + BroadcastExchange #6 + WholeStageCodegen (7) + HashAggregate [s_store_sk,sum,sum] [sum(UnscaledValue(sr_return_amt)),sum(UnscaledValue(sr_net_loss)),returns,profit_loss,sum,sum] + InputAdapter + Exchange [s_store_sk] #7 + WholeStageCodegen (6) + HashAggregate [s_store_sk,sr_return_amt,sr_net_loss] [sum,sum,sum,sum] + Project [sr_return_amt,sr_net_loss,s_store_sk] + BroadcastHashJoin [sr_store_sk,s_store_sk] + Project [sr_store_sk,sr_return_amt,sr_net_loss] + BroadcastHashJoin [sr_returned_date_sk,d_date_sk] + Filter [sr_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_store_sk,sr_return_amt,sr_net_loss,sr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + ReusedExchange [s_store_sk] #5 + WholeStageCodegen (14) + Project [cs_call_center_sk,sales,returns,profit,profit_loss] + BroadcastNestedLoopJoin + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (11) + HashAggregate [cs_call_center_sk,sum,sum] [sum(UnscaledValue(cs_ext_sales_price)),sum(UnscaledValue(cs_net_profit)),sales,profit,sum,sum] + InputAdapter + Exchange [cs_call_center_sk] #9 + WholeStageCodegen (10) + HashAggregate [cs_call_center_sk,cs_ext_sales_price,cs_net_profit] [sum,sum,sum,sum] + Project [cs_call_center_sk,cs_ext_sales_price,cs_net_profit] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_call_center_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + HashAggregate [sum,sum] [sum(UnscaledValue(cr_return_amount)),sum(UnscaledValue(cr_net_loss)),returns,profit_loss,sum,sum] + InputAdapter + Exchange #10 + WholeStageCodegen (13) + HashAggregate [cr_return_amount,cr_net_loss] [sum,sum,sum,sum] + Project [cr_return_amount,cr_net_loss] + BroadcastHashJoin [cr_returned_date_sk,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_return_amount,cr_net_loss,cr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + WholeStageCodegen (22) + Project [wp_web_page_sk,sales,returns,profit,profit_loss] + BroadcastHashJoin [wp_web_page_sk,wp_web_page_sk] + HashAggregate [wp_web_page_sk,sum,sum] [sum(UnscaledValue(ws_ext_sales_price)),sum(UnscaledValue(ws_net_profit)),sales,profit,sum,sum] + InputAdapter + Exchange [wp_web_page_sk] #11 + WholeStageCodegen (17) + HashAggregate [wp_web_page_sk,ws_ext_sales_price,ws_net_profit] [sum,sum,sum,sum] + Project [ws_ext_sales_price,ws_net_profit,wp_web_page_sk] + BroadcastHashJoin [ws_web_page_sk,wp_web_page_sk] + Project [ws_web_page_sk,ws_ext_sales_price,ws_net_profit] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_web_page_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #12 + WholeStageCodegen (16) + Filter [wp_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_page [wp_web_page_sk] + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (21) + HashAggregate [wp_web_page_sk,sum,sum] [sum(UnscaledValue(wr_return_amt)),sum(UnscaledValue(wr_net_loss)),returns,profit_loss,sum,sum] + InputAdapter + Exchange [wp_web_page_sk] #14 + WholeStageCodegen (20) + HashAggregate [wp_web_page_sk,wr_return_amt,wr_net_loss] [sum,sum,sum,sum] + Project [wr_return_amt,wr_net_loss,wp_web_page_sk] + BroadcastHashJoin [wr_web_page_sk,wp_web_page_sk] + Project [wr_web_page_sk,wr_return_amt,wr_net_loss] + BroadcastHashJoin [wr_returned_date_sk,d_date_sk] + Filter [wr_web_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_web_page_sk,wr_return_amt,wr_net_loss,wr_returned_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + ReusedExchange [d_date_sk] #4 + InputAdapter + ReusedExchange [wp_web_page_sk] #12 + WholeStageCodegen (49) + HashAggregate [channel,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),id,sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel] #15 + WholeStageCodegen (48) + HashAggregate [channel,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + ReusedExchange [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] #16 + WholeStageCodegen (74) + HashAggregate [sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),channel,id,sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange #17 + WholeStageCodegen (73) + HashAggregate [sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + ReusedExchange [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] #16 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt new file mode 100644 index 0000000000000..5694b16800d8e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/explain.txt @@ -0,0 +1,423 @@ +== Physical Plan == +TakeOrderedAndProject (73) ++- * Project (72) + +- * SortMergeJoin Inner (71) + :- * Project (48) + : +- * SortMergeJoin Inner (47) + : :- * Sort (24) + : : +- * HashAggregate (23) + : : +- Exchange (22) + : : +- * HashAggregate (21) + : : +- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Project (14) + : : : +- * Filter (13) + : : : +- * SortMergeJoin LeftOuter (12) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Sort (11) + : : : +- Exchange (10) + : : : +- * Project (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_returns (6) + : : +- BroadcastExchange (18) + : : +- * Filter (17) + : : +- * ColumnarToRow (16) + : : +- Scan parquet default.date_dim (15) + : +- * Sort (46) + : +- * Filter (45) + : +- * HashAggregate (44) + : +- Exchange (43) + : +- * HashAggregate (42) + : +- * Project (41) + : +- * BroadcastHashJoin Inner BuildRight (40) + : :- * Project (38) + : : +- * Filter (37) + : : +- * SortMergeJoin LeftOuter (36) + : : :- * Sort (29) + : : : +- Exchange (28) + : : : +- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.web_sales (25) + : : +- * Sort (35) + : : +- Exchange (34) + : : +- * Project (33) + : : +- * Filter (32) + : : +- * ColumnarToRow (31) + : : +- Scan parquet default.web_returns (30) + : +- ReusedExchange (39) + +- * Sort (70) + +- * Filter (69) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- * Project (65) + +- * BroadcastHashJoin Inner BuildRight (64) + :- * Project (62) + : +- * Filter (61) + : +- * SortMergeJoin LeftOuter (60) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Filter (51) + : : +- * ColumnarToRow (50) + : : +- Scan parquet default.catalog_sales (49) + : +- * Sort (59) + : +- Exchange (58) + : +- * Project (57) + : +- * Filter (56) + : +- * ColumnarToRow (55) + : +- Scan parquet default.catalog_returns (54) + +- ReusedExchange (63) + + +(1) Scan parquet default.store_sales +Output [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] + +(3) Filter [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_customer_sk#2)) + +(4) Exchange +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Arguments: hashpartitioning(ss_ticket_number#3, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] + +(5) Sort [codegen id : 2] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Arguments: [ss_ticket_number#3 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_returns +Output [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] + +(8) Filter [codegen id : 3] +Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] +Condition : (isnotnull(sr_ticket_number#11) AND isnotnull(sr_item_sk#10)) + +(9) Project [codegen id : 3] +Output [2]: [sr_item_sk#10, sr_ticket_number#11] +Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] + +(10) Exchange +Input [2]: [sr_item_sk#10, sr_ticket_number#11] +Arguments: hashpartitioning(sr_ticket_number#11, sr_item_sk#10, 5), ENSURE_REQUIREMENTS, [id=#13] + +(11) Sort [codegen id : 4] +Input [2]: [sr_item_sk#10, sr_ticket_number#11] +Arguments: [sr_ticket_number#11 ASC NULLS FIRST, sr_item_sk#10 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 6] +Left keys [2]: [ss_ticket_number#3, ss_item_sk#1] +Right keys [2]: [sr_ticket_number#11, sr_item_sk#10] +Join condition: None + +(13) Filter [codegen id : 6] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7, sr_item_sk#10, sr_ticket_number#11] +Condition : isnull(sr_ticket_number#11) + +(14) Project [codegen id : 6] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7, sr_item_sk#10, sr_ticket_number#11] + +(15) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#14, d_year#15] + +(17) Filter [codegen id : 5] +Input [2]: [d_date_sk#14, d_year#15] +Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2000)) AND isnotnull(d_date_sk#14)) + +(18) BroadcastExchange +Input [2]: [d_date_sk#14, d_year#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(19) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(20) Project [codegen id : 6] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#15] +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7, d_date_sk#14, d_year#15] + +(21) HashAggregate [codegen id : 6] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#15] +Keys [3]: [d_year#15, ss_item_sk#1, ss_customer_sk#2] +Functions [3]: [partial_sum(ss_quantity#4), partial_sum(UnscaledValue(ss_wholesale_cost#5)), partial_sum(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [3]: [sum#17, sum#18, sum#19] +Results [6]: [d_year#15, ss_item_sk#1, ss_customer_sk#2, sum#20, sum#21, sum#22] + +(22) Exchange +Input [6]: [d_year#15, ss_item_sk#1, ss_customer_sk#2, sum#20, sum#21, sum#22] +Arguments: hashpartitioning(d_year#15, ss_item_sk#1, ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#23] + +(23) HashAggregate [codegen id : 7] +Input [6]: [d_year#15, ss_item_sk#1, ss_customer_sk#2, sum#20, sum#21, sum#22] +Keys [3]: [d_year#15, ss_item_sk#1, ss_customer_sk#2] +Functions [3]: [sum(ss_quantity#4), sum(UnscaledValue(ss_wholesale_cost#5)), sum(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [3]: [sum(ss_quantity#4)#24, sum(UnscaledValue(ss_wholesale_cost#5))#25, sum(UnscaledValue(ss_sales_price#6))#26] +Results [6]: [d_year#15 AS ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, sum(ss_quantity#4)#24 AS ss_qty#28, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#5))#25,17,2) AS ss_wc#29, MakeDecimal(sum(UnscaledValue(ss_sales_price#6))#26,17,2) AS ss_sp#30] + +(24) Sort [codegen id : 7] +Input [6]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] +Arguments: [ss_sold_year#27 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.web_sales +Output [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#37), dynamicpruningexpression(ws_sold_date_sk#37 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 8] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] + +(27) Filter [codegen id : 8] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Condition : (isnotnull(ws_item_sk#31) AND isnotnull(ws_bill_customer_sk#32)) + +(28) Exchange +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Arguments: hashpartitioning(ws_order_number#33, ws_item_sk#31, 5), ENSURE_REQUIREMENTS, [id=#38] + +(29) Sort [codegen id : 9] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Arguments: [ws_order_number#33 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST], false, 0 + +(30) Scan parquet default.web_returns +Output [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 10] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] + +(32) Filter [codegen id : 10] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] +Condition : (isnotnull(wr_order_number#40) AND isnotnull(wr_item_sk#39)) + +(33) Project [codegen id : 10] +Output [2]: [wr_item_sk#39, wr_order_number#40] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] + +(34) Exchange +Input [2]: [wr_item_sk#39, wr_order_number#40] +Arguments: hashpartitioning(wr_order_number#40, wr_item_sk#39, 5), ENSURE_REQUIREMENTS, [id=#42] + +(35) Sort [codegen id : 11] +Input [2]: [wr_item_sk#39, wr_order_number#40] +Arguments: [wr_order_number#40 ASC NULLS FIRST, wr_item_sk#39 ASC NULLS FIRST], false, 0 + +(36) SortMergeJoin [codegen id : 13] +Left keys [2]: [ws_order_number#33, ws_item_sk#31] +Right keys [2]: [wr_order_number#40, wr_item_sk#39] +Join condition: None + +(37) Filter [codegen id : 13] +Input [9]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, wr_item_sk#39, wr_order_number#40] +Condition : isnull(wr_order_number#40) + +(38) Project [codegen id : 13] +Output [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Input [9]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, wr_item_sk#39, wr_order_number#40] + +(39) ReusedExchange [Reuses operator id: 18] +Output [2]: [d_date_sk#43, d_year#44] + +(40) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ws_sold_date_sk#37] +Right keys [1]: [d_date_sk#43] +Join condition: None + +(41) Project [codegen id : 13] +Output [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, d_year#44] +Input [8]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, d_date_sk#43, d_year#44] + +(42) HashAggregate [codegen id : 13] +Input [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, d_year#44] +Keys [3]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32] +Functions [3]: [partial_sum(ws_quantity#34), partial_sum(UnscaledValue(ws_wholesale_cost#35)), partial_sum(UnscaledValue(ws_sales_price#36))] +Aggregate Attributes [3]: [sum#45, sum#46, sum#47] +Results [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] + +(43) Exchange +Input [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] +Arguments: hashpartitioning(d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, 5), ENSURE_REQUIREMENTS, [id=#51] + +(44) HashAggregate [codegen id : 14] +Input [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] +Keys [3]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32] +Functions [3]: [sum(ws_quantity#34), sum(UnscaledValue(ws_wholesale_cost#35)), sum(UnscaledValue(ws_sales_price#36))] +Aggregate Attributes [3]: [sum(ws_quantity#34)#52, sum(UnscaledValue(ws_wholesale_cost#35))#53, sum(UnscaledValue(ws_sales_price#36))#54] +Results [6]: [d_year#44 AS ws_sold_year#55, ws_item_sk#31, ws_bill_customer_sk#32 AS ws_customer_sk#56, sum(ws_quantity#34)#52 AS ws_qty#57, MakeDecimal(sum(UnscaledValue(ws_wholesale_cost#35))#53,17,2) AS ws_wc#58, MakeDecimal(sum(UnscaledValue(ws_sales_price#36))#54,17,2) AS ws_sp#59] + +(45) Filter [codegen id : 14] +Input [6]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] +Condition : (coalesce(ws_qty#57, 0) > 0) + +(46) Sort [codegen id : 14] +Input [6]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] +Arguments: [ws_sold_year#55 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST, ws_customer_sk#56 ASC NULLS FIRST], false, 0 + +(47) SortMergeJoin [codegen id : 15] +Left keys [3]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2] +Right keys [3]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56] +Join condition: None + +(48) Project [codegen id : 15] +Output [9]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, ws_wc#58, ws_sp#59] +Input [12]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] + +(49) Scan parquet default.catalog_sales +Output [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#66), dynamicpruningexpression(cs_sold_date_sk#66 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 16] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] + +(51) Filter [codegen id : 16] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Condition : (isnotnull(cs_item_sk#61) AND isnotnull(cs_bill_customer_sk#60)) + +(52) Exchange +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Arguments: hashpartitioning(cs_order_number#62, cs_item_sk#61, 5), ENSURE_REQUIREMENTS, [id=#67] + +(53) Sort [codegen id : 17] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Arguments: [cs_order_number#62 ASC NULLS FIRST, cs_item_sk#61 ASC NULLS FIRST], false, 0 + +(54) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 18] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] + +(56) Filter [codegen id : 18] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] +Condition : (isnotnull(cr_order_number#69) AND isnotnull(cr_item_sk#68)) + +(57) Project [codegen id : 18] +Output [2]: [cr_item_sk#68, cr_order_number#69] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] + +(58) Exchange +Input [2]: [cr_item_sk#68, cr_order_number#69] +Arguments: hashpartitioning(cr_order_number#69, cr_item_sk#68, 5), ENSURE_REQUIREMENTS, [id=#71] + +(59) Sort [codegen id : 19] +Input [2]: [cr_item_sk#68, cr_order_number#69] +Arguments: [cr_order_number#69 ASC NULLS FIRST, cr_item_sk#68 ASC NULLS FIRST], false, 0 + +(60) SortMergeJoin [codegen id : 21] +Left keys [2]: [cs_order_number#62, cs_item_sk#61] +Right keys [2]: [cr_order_number#69, cr_item_sk#68] +Join condition: None + +(61) Filter [codegen id : 21] +Input [9]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, cr_item_sk#68, cr_order_number#69] +Condition : isnull(cr_order_number#69) + +(62) Project [codegen id : 21] +Output [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Input [9]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, cr_item_sk#68, cr_order_number#69] + +(63) ReusedExchange [Reuses operator id: 18] +Output [2]: [d_date_sk#72, d_year#73] + +(64) BroadcastHashJoin [codegen id : 21] +Left keys [1]: [cs_sold_date_sk#66] +Right keys [1]: [d_date_sk#72] +Join condition: None + +(65) Project [codegen id : 21] +Output [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, d_year#73] +Input [8]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, d_date_sk#72, d_year#73] + +(66) HashAggregate [codegen id : 21] +Input [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, d_year#73] +Keys [3]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60] +Functions [3]: [partial_sum(cs_quantity#63), partial_sum(UnscaledValue(cs_wholesale_cost#64)), partial_sum(UnscaledValue(cs_sales_price#65))] +Aggregate Attributes [3]: [sum#74, sum#75, sum#76] +Results [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] + +(67) Exchange +Input [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] +Arguments: hashpartitioning(d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, 5), ENSURE_REQUIREMENTS, [id=#80] + +(68) HashAggregate [codegen id : 22] +Input [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] +Keys [3]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60] +Functions [3]: [sum(cs_quantity#63), sum(UnscaledValue(cs_wholesale_cost#64)), sum(UnscaledValue(cs_sales_price#65))] +Aggregate Attributes [3]: [sum(cs_quantity#63)#81, sum(UnscaledValue(cs_wholesale_cost#64))#82, sum(UnscaledValue(cs_sales_price#65))#83] +Results [6]: [d_year#73 AS cs_sold_year#84, cs_item_sk#61, cs_bill_customer_sk#60 AS cs_customer_sk#85, sum(cs_quantity#63)#81 AS cs_qty#86, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#64))#82,17,2) AS cs_wc#87, MakeDecimal(sum(UnscaledValue(cs_sales_price#65))#83,17,2) AS cs_sp#88] + +(69) Filter [codegen id : 22] +Input [6]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] +Condition : (coalesce(cs_qty#86, 0) > 0) + +(70) Sort [codegen id : 22] +Input [6]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] +Arguments: [cs_sold_year#84 ASC NULLS FIRST, cs_item_sk#61 ASC NULLS FIRST, cs_customer_sk#85 ASC NULLS FIRST], false, 0 + +(71) SortMergeJoin [codegen id : 23] +Left keys [3]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2] +Right keys [3]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85] +Join condition: None + +(72) Project [codegen id : 23] +Output [13]: [round((cast(ss_qty#28 as double) / cast(coalesce((ws_qty#57 + cs_qty#86), 1) as double)), 2) AS ratio#89, ss_qty#28 AS store_qty#90, ss_wc#29 AS store_wholesale_cost#91, ss_sp#30 AS store_sales_price#92, (coalesce(ws_qty#57, 0) + coalesce(cs_qty#86, 0)) AS other_chan_qty#93, CheckOverflow((promote_precision(cast(coalesce(ws_wc#58, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#87, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#94, CheckOverflow((promote_precision(cast(coalesce(ws_sp#59, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#88, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#95, ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] +Input [15]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, ws_wc#58, ws_sp#59, cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] + +(73) TakeOrderedAndProject +Input [13]: [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95, ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] +Arguments: 100, [ss_sold_year#27 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST, ss_qty#28 DESC NULLS LAST, ss_wc#29 DESC NULLS LAST, ss_sp#30 DESC NULLS LAST, other_chan_qty#93 ASC NULLS FIRST, other_chan_wholesale_cost#94 ASC NULLS FIRST, other_chan_sales_price#95 ASC NULLS FIRST, ratio#89 ASC NULLS FIRST], [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (74) + + +(74) ReusedExchange [Reuses operator id: 18] +Output [2]: [d_date_sk#14, d_year#15] + +Subquery:2 Hosting operator id = 25 Hosting Expression = ws_sold_date_sk#37 IN dynamicpruning#8 + +Subquery:3 Hosting operator id = 49 Hosting Expression = cs_sold_date_sk#66 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt new file mode 100644 index 0000000000000..cb9ca4f3d3d32 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78.sf100/simplified.txt @@ -0,0 +1,127 @@ +TakeOrderedAndProject [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,other_chan_qty,other_chan_wholesale_cost,other_chan_sales_price,ratio,store_qty,store_wholesale_cost,store_sales_price] + WholeStageCodegen (23) + Project [ss_qty,ws_qty,cs_qty,ss_wc,ss_sp,ws_wc,cs_wc,ws_sp,cs_sp,ss_sold_year,ss_item_sk,ss_customer_sk] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,cs_sold_year,cs_item_sk,cs_customer_sk] + InputAdapter + WholeStageCodegen (15) + Project [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,ws_qty,ws_wc,ws_sp] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,ws_sold_year,ws_item_sk,ws_customer_sk] + InputAdapter + WholeStageCodegen (7) + Sort [ss_sold_year,ss_item_sk,ss_customer_sk] + HashAggregate [d_year,ss_item_sk,ss_customer_sk,sum,sum,sum] [sum(ss_quantity),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_sales_price)),ss_sold_year,ss_qty,ss_wc,ss_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,ss_item_sk,ss_customer_sk] #1 + WholeStageCodegen (6) + HashAggregate [d_year,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,ss_sold_date_sk] + Filter [sr_ticket_number] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #2 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + WholeStageCodegen (4) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #4 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (5) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (14) + Sort [ws_sold_year,ws_item_sk,ws_customer_sk] + Filter [ws_qty] + HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,sum,sum,sum] [sum(ws_quantity),sum(UnscaledValue(ws_wholesale_cost)),sum(UnscaledValue(ws_sales_price)),ws_sold_year,ws_customer_sk,ws_qty,ws_wc,ws_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,ws_item_sk,ws_bill_customer_sk] #5 + WholeStageCodegen (13) + HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] + Filter [wr_order_number] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (9) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #6 + WholeStageCodegen (8) + Filter [ws_item_sk,ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_order_number,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (11) + Sort [wr_order_number,wr_item_sk] + InputAdapter + Exchange [wr_order_number,wr_item_sk] #7 + WholeStageCodegen (10) + Project [wr_item_sk,wr_order_number] + Filter [wr_order_number,wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + WholeStageCodegen (22) + Sort [cs_sold_year,cs_item_sk,cs_customer_sk] + Filter [cs_qty] + HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,sum,sum,sum] [sum(cs_quantity),sum(UnscaledValue(cs_wholesale_cost)),sum(UnscaledValue(cs_sales_price)),cs_sold_year,cs_customer_sk,cs_qty,cs_wc,cs_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #8 + WholeStageCodegen (21) + HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,cs_quantity,cs_wholesale_cost,cs_sales_price] [sum,sum,sum,sum,sum,sum] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] + Filter [cr_order_number] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (17) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #9 + WholeStageCodegen (16) + Filter [cs_item_sk,cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (19) + Sort [cr_order_number,cr_item_sk] + InputAdapter + Exchange [cr_order_number,cr_item_sk] #10 + WholeStageCodegen (18) + Project [cr_item_sk,cr_order_number] + Filter [cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78/explain.txt new file mode 100644 index 0000000000000..5694b16800d8e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78/explain.txt @@ -0,0 +1,423 @@ +== Physical Plan == +TakeOrderedAndProject (73) ++- * Project (72) + +- * SortMergeJoin Inner (71) + :- * Project (48) + : +- * SortMergeJoin Inner (47) + : :- * Sort (24) + : : +- * HashAggregate (23) + : : +- Exchange (22) + : : +- * HashAggregate (21) + : : +- * Project (20) + : : +- * BroadcastHashJoin Inner BuildRight (19) + : : :- * Project (14) + : : : +- * Filter (13) + : : : +- * SortMergeJoin LeftOuter (12) + : : : :- * Sort (5) + : : : : +- Exchange (4) + : : : : +- * Filter (3) + : : : : +- * ColumnarToRow (2) + : : : : +- Scan parquet default.store_sales (1) + : : : +- * Sort (11) + : : : +- Exchange (10) + : : : +- * Project (9) + : : : +- * Filter (8) + : : : +- * ColumnarToRow (7) + : : : +- Scan parquet default.store_returns (6) + : : +- BroadcastExchange (18) + : : +- * Filter (17) + : : +- * ColumnarToRow (16) + : : +- Scan parquet default.date_dim (15) + : +- * Sort (46) + : +- * Filter (45) + : +- * HashAggregate (44) + : +- Exchange (43) + : +- * HashAggregate (42) + : +- * Project (41) + : +- * BroadcastHashJoin Inner BuildRight (40) + : :- * Project (38) + : : +- * Filter (37) + : : +- * SortMergeJoin LeftOuter (36) + : : :- * Sort (29) + : : : +- Exchange (28) + : : : +- * Filter (27) + : : : +- * ColumnarToRow (26) + : : : +- Scan parquet default.web_sales (25) + : : +- * Sort (35) + : : +- Exchange (34) + : : +- * Project (33) + : : +- * Filter (32) + : : +- * ColumnarToRow (31) + : : +- Scan parquet default.web_returns (30) + : +- ReusedExchange (39) + +- * Sort (70) + +- * Filter (69) + +- * HashAggregate (68) + +- Exchange (67) + +- * HashAggregate (66) + +- * Project (65) + +- * BroadcastHashJoin Inner BuildRight (64) + :- * Project (62) + : +- * Filter (61) + : +- * SortMergeJoin LeftOuter (60) + : :- * Sort (53) + : : +- Exchange (52) + : : +- * Filter (51) + : : +- * ColumnarToRow (50) + : : +- Scan parquet default.catalog_sales (49) + : +- * Sort (59) + : +- Exchange (58) + : +- * Project (57) + : +- * Filter (56) + : +- * ColumnarToRow (55) + : +- Scan parquet default.catalog_returns (54) + +- ReusedExchange (63) + + +(1) Scan parquet default.store_sales +Output [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_item_sk), IsNotNull(ss_customer_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] + +(3) Filter [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Condition : (isnotnull(ss_item_sk#1) AND isnotnull(ss_customer_sk#2)) + +(4) Exchange +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Arguments: hashpartitioning(ss_ticket_number#3, ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#9] + +(5) Sort [codegen id : 2] +Input [7]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Arguments: [ss_ticket_number#3 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_returns +Output [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_ticket_number), IsNotNull(sr_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] + +(8) Filter [codegen id : 3] +Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] +Condition : (isnotnull(sr_ticket_number#11) AND isnotnull(sr_item_sk#10)) + +(9) Project [codegen id : 3] +Output [2]: [sr_item_sk#10, sr_ticket_number#11] +Input [3]: [sr_item_sk#10, sr_ticket_number#11, sr_returned_date_sk#12] + +(10) Exchange +Input [2]: [sr_item_sk#10, sr_ticket_number#11] +Arguments: hashpartitioning(sr_ticket_number#11, sr_item_sk#10, 5), ENSURE_REQUIREMENTS, [id=#13] + +(11) Sort [codegen id : 4] +Input [2]: [sr_item_sk#10, sr_ticket_number#11] +Arguments: [sr_ticket_number#11 ASC NULLS FIRST, sr_item_sk#10 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 6] +Left keys [2]: [ss_ticket_number#3, ss_item_sk#1] +Right keys [2]: [sr_ticket_number#11, sr_item_sk#10] +Join condition: None + +(13) Filter [codegen id : 6] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7, sr_item_sk#10, sr_ticket_number#11] +Condition : isnull(sr_ticket_number#11) + +(14) Project [codegen id : 6] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7] +Input [9]: [ss_item_sk#1, ss_customer_sk#2, ss_ticket_number#3, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7, sr_item_sk#10, sr_ticket_number#11] + +(15) Scan parquet default.date_dim +Output [2]: [d_date_sk#14, d_year#15] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_year), EqualTo(d_year,2000), IsNotNull(d_date_sk)] +ReadSchema: struct + +(16) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#14, d_year#15] + +(17) Filter [codegen id : 5] +Input [2]: [d_date_sk#14, d_year#15] +Condition : ((isnotnull(d_year#15) AND (d_year#15 = 2000)) AND isnotnull(d_date_sk#14)) + +(18) BroadcastExchange +Input [2]: [d_date_sk#14, d_year#15] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#16] + +(19) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#14] +Join condition: None + +(20) Project [codegen id : 6] +Output [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#15] +Input [8]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, ss_sold_date_sk#7, d_date_sk#14, d_year#15] + +(21) HashAggregate [codegen id : 6] +Input [6]: [ss_item_sk#1, ss_customer_sk#2, ss_quantity#4, ss_wholesale_cost#5, ss_sales_price#6, d_year#15] +Keys [3]: [d_year#15, ss_item_sk#1, ss_customer_sk#2] +Functions [3]: [partial_sum(ss_quantity#4), partial_sum(UnscaledValue(ss_wholesale_cost#5)), partial_sum(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [3]: [sum#17, sum#18, sum#19] +Results [6]: [d_year#15, ss_item_sk#1, ss_customer_sk#2, sum#20, sum#21, sum#22] + +(22) Exchange +Input [6]: [d_year#15, ss_item_sk#1, ss_customer_sk#2, sum#20, sum#21, sum#22] +Arguments: hashpartitioning(d_year#15, ss_item_sk#1, ss_customer_sk#2, 5), ENSURE_REQUIREMENTS, [id=#23] + +(23) HashAggregate [codegen id : 7] +Input [6]: [d_year#15, ss_item_sk#1, ss_customer_sk#2, sum#20, sum#21, sum#22] +Keys [3]: [d_year#15, ss_item_sk#1, ss_customer_sk#2] +Functions [3]: [sum(ss_quantity#4), sum(UnscaledValue(ss_wholesale_cost#5)), sum(UnscaledValue(ss_sales_price#6))] +Aggregate Attributes [3]: [sum(ss_quantity#4)#24, sum(UnscaledValue(ss_wholesale_cost#5))#25, sum(UnscaledValue(ss_sales_price#6))#26] +Results [6]: [d_year#15 AS ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, sum(ss_quantity#4)#24 AS ss_qty#28, MakeDecimal(sum(UnscaledValue(ss_wholesale_cost#5))#25,17,2) AS ss_wc#29, MakeDecimal(sum(UnscaledValue(ss_sales_price#6))#26,17,2) AS ss_sp#30] + +(24) Sort [codegen id : 7] +Input [6]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] +Arguments: [ss_sold_year#27 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST], false, 0 + +(25) Scan parquet default.web_sales +Output [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#37), dynamicpruningexpression(ws_sold_date_sk#37 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_item_sk), IsNotNull(ws_bill_customer_sk)] +ReadSchema: struct + +(26) ColumnarToRow [codegen id : 8] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] + +(27) Filter [codegen id : 8] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Condition : (isnotnull(ws_item_sk#31) AND isnotnull(ws_bill_customer_sk#32)) + +(28) Exchange +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Arguments: hashpartitioning(ws_order_number#33, ws_item_sk#31, 5), ENSURE_REQUIREMENTS, [id=#38] + +(29) Sort [codegen id : 9] +Input [7]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Arguments: [ws_order_number#33 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST], false, 0 + +(30) Scan parquet default.web_returns +Output [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_order_number), IsNotNull(wr_item_sk)] +ReadSchema: struct + +(31) ColumnarToRow [codegen id : 10] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] + +(32) Filter [codegen id : 10] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] +Condition : (isnotnull(wr_order_number#40) AND isnotnull(wr_item_sk#39)) + +(33) Project [codegen id : 10] +Output [2]: [wr_item_sk#39, wr_order_number#40] +Input [3]: [wr_item_sk#39, wr_order_number#40, wr_returned_date_sk#41] + +(34) Exchange +Input [2]: [wr_item_sk#39, wr_order_number#40] +Arguments: hashpartitioning(wr_order_number#40, wr_item_sk#39, 5), ENSURE_REQUIREMENTS, [id=#42] + +(35) Sort [codegen id : 11] +Input [2]: [wr_item_sk#39, wr_order_number#40] +Arguments: [wr_order_number#40 ASC NULLS FIRST, wr_item_sk#39 ASC NULLS FIRST], false, 0 + +(36) SortMergeJoin [codegen id : 13] +Left keys [2]: [ws_order_number#33, ws_item_sk#31] +Right keys [2]: [wr_order_number#40, wr_item_sk#39] +Join condition: None + +(37) Filter [codegen id : 13] +Input [9]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, wr_item_sk#39, wr_order_number#40] +Condition : isnull(wr_order_number#40) + +(38) Project [codegen id : 13] +Output [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37] +Input [9]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_order_number#33, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, wr_item_sk#39, wr_order_number#40] + +(39) ReusedExchange [Reuses operator id: 18] +Output [2]: [d_date_sk#43, d_year#44] + +(40) BroadcastHashJoin [codegen id : 13] +Left keys [1]: [ws_sold_date_sk#37] +Right keys [1]: [d_date_sk#43] +Join condition: None + +(41) Project [codegen id : 13] +Output [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, d_year#44] +Input [8]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, ws_sold_date_sk#37, d_date_sk#43, d_year#44] + +(42) HashAggregate [codegen id : 13] +Input [6]: [ws_item_sk#31, ws_bill_customer_sk#32, ws_quantity#34, ws_wholesale_cost#35, ws_sales_price#36, d_year#44] +Keys [3]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32] +Functions [3]: [partial_sum(ws_quantity#34), partial_sum(UnscaledValue(ws_wholesale_cost#35)), partial_sum(UnscaledValue(ws_sales_price#36))] +Aggregate Attributes [3]: [sum#45, sum#46, sum#47] +Results [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] + +(43) Exchange +Input [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] +Arguments: hashpartitioning(d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, 5), ENSURE_REQUIREMENTS, [id=#51] + +(44) HashAggregate [codegen id : 14] +Input [6]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32, sum#48, sum#49, sum#50] +Keys [3]: [d_year#44, ws_item_sk#31, ws_bill_customer_sk#32] +Functions [3]: [sum(ws_quantity#34), sum(UnscaledValue(ws_wholesale_cost#35)), sum(UnscaledValue(ws_sales_price#36))] +Aggregate Attributes [3]: [sum(ws_quantity#34)#52, sum(UnscaledValue(ws_wholesale_cost#35))#53, sum(UnscaledValue(ws_sales_price#36))#54] +Results [6]: [d_year#44 AS ws_sold_year#55, ws_item_sk#31, ws_bill_customer_sk#32 AS ws_customer_sk#56, sum(ws_quantity#34)#52 AS ws_qty#57, MakeDecimal(sum(UnscaledValue(ws_wholesale_cost#35))#53,17,2) AS ws_wc#58, MakeDecimal(sum(UnscaledValue(ws_sales_price#36))#54,17,2) AS ws_sp#59] + +(45) Filter [codegen id : 14] +Input [6]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] +Condition : (coalesce(ws_qty#57, 0) > 0) + +(46) Sort [codegen id : 14] +Input [6]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] +Arguments: [ws_sold_year#55 ASC NULLS FIRST, ws_item_sk#31 ASC NULLS FIRST, ws_customer_sk#56 ASC NULLS FIRST], false, 0 + +(47) SortMergeJoin [codegen id : 15] +Left keys [3]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2] +Right keys [3]: [ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56] +Join condition: None + +(48) Project [codegen id : 15] +Output [9]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, ws_wc#58, ws_sp#59] +Input [12]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_sold_year#55, ws_item_sk#31, ws_customer_sk#56, ws_qty#57, ws_wc#58, ws_sp#59] + +(49) Scan parquet default.catalog_sales +Output [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#66), dynamicpruningexpression(cs_sold_date_sk#66 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_item_sk), IsNotNull(cs_bill_customer_sk)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 16] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] + +(51) Filter [codegen id : 16] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Condition : (isnotnull(cs_item_sk#61) AND isnotnull(cs_bill_customer_sk#60)) + +(52) Exchange +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Arguments: hashpartitioning(cs_order_number#62, cs_item_sk#61, 5), ENSURE_REQUIREMENTS, [id=#67] + +(53) Sort [codegen id : 17] +Input [7]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Arguments: [cs_order_number#62 ASC NULLS FIRST, cs_item_sk#61 ASC NULLS FIRST], false, 0 + +(54) Scan parquet default.catalog_returns +Output [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_order_number), IsNotNull(cr_item_sk)] +ReadSchema: struct + +(55) ColumnarToRow [codegen id : 18] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] + +(56) Filter [codegen id : 18] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] +Condition : (isnotnull(cr_order_number#69) AND isnotnull(cr_item_sk#68)) + +(57) Project [codegen id : 18] +Output [2]: [cr_item_sk#68, cr_order_number#69] +Input [3]: [cr_item_sk#68, cr_order_number#69, cr_returned_date_sk#70] + +(58) Exchange +Input [2]: [cr_item_sk#68, cr_order_number#69] +Arguments: hashpartitioning(cr_order_number#69, cr_item_sk#68, 5), ENSURE_REQUIREMENTS, [id=#71] + +(59) Sort [codegen id : 19] +Input [2]: [cr_item_sk#68, cr_order_number#69] +Arguments: [cr_order_number#69 ASC NULLS FIRST, cr_item_sk#68 ASC NULLS FIRST], false, 0 + +(60) SortMergeJoin [codegen id : 21] +Left keys [2]: [cs_order_number#62, cs_item_sk#61] +Right keys [2]: [cr_order_number#69, cr_item_sk#68] +Join condition: None + +(61) Filter [codegen id : 21] +Input [9]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, cr_item_sk#68, cr_order_number#69] +Condition : isnull(cr_order_number#69) + +(62) Project [codegen id : 21] +Output [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66] +Input [9]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_order_number#62, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, cr_item_sk#68, cr_order_number#69] + +(63) ReusedExchange [Reuses operator id: 18] +Output [2]: [d_date_sk#72, d_year#73] + +(64) BroadcastHashJoin [codegen id : 21] +Left keys [1]: [cs_sold_date_sk#66] +Right keys [1]: [d_date_sk#72] +Join condition: None + +(65) Project [codegen id : 21] +Output [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, d_year#73] +Input [8]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, cs_sold_date_sk#66, d_date_sk#72, d_year#73] + +(66) HashAggregate [codegen id : 21] +Input [6]: [cs_bill_customer_sk#60, cs_item_sk#61, cs_quantity#63, cs_wholesale_cost#64, cs_sales_price#65, d_year#73] +Keys [3]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60] +Functions [3]: [partial_sum(cs_quantity#63), partial_sum(UnscaledValue(cs_wholesale_cost#64)), partial_sum(UnscaledValue(cs_sales_price#65))] +Aggregate Attributes [3]: [sum#74, sum#75, sum#76] +Results [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] + +(67) Exchange +Input [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] +Arguments: hashpartitioning(d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, 5), ENSURE_REQUIREMENTS, [id=#80] + +(68) HashAggregate [codegen id : 22] +Input [6]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60, sum#77, sum#78, sum#79] +Keys [3]: [d_year#73, cs_item_sk#61, cs_bill_customer_sk#60] +Functions [3]: [sum(cs_quantity#63), sum(UnscaledValue(cs_wholesale_cost#64)), sum(UnscaledValue(cs_sales_price#65))] +Aggregate Attributes [3]: [sum(cs_quantity#63)#81, sum(UnscaledValue(cs_wholesale_cost#64))#82, sum(UnscaledValue(cs_sales_price#65))#83] +Results [6]: [d_year#73 AS cs_sold_year#84, cs_item_sk#61, cs_bill_customer_sk#60 AS cs_customer_sk#85, sum(cs_quantity#63)#81 AS cs_qty#86, MakeDecimal(sum(UnscaledValue(cs_wholesale_cost#64))#82,17,2) AS cs_wc#87, MakeDecimal(sum(UnscaledValue(cs_sales_price#65))#83,17,2) AS cs_sp#88] + +(69) Filter [codegen id : 22] +Input [6]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] +Condition : (coalesce(cs_qty#86, 0) > 0) + +(70) Sort [codegen id : 22] +Input [6]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] +Arguments: [cs_sold_year#84 ASC NULLS FIRST, cs_item_sk#61 ASC NULLS FIRST, cs_customer_sk#85 ASC NULLS FIRST], false, 0 + +(71) SortMergeJoin [codegen id : 23] +Left keys [3]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2] +Right keys [3]: [cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85] +Join condition: None + +(72) Project [codegen id : 23] +Output [13]: [round((cast(ss_qty#28 as double) / cast(coalesce((ws_qty#57 + cs_qty#86), 1) as double)), 2) AS ratio#89, ss_qty#28 AS store_qty#90, ss_wc#29 AS store_wholesale_cost#91, ss_sp#30 AS store_sales_price#92, (coalesce(ws_qty#57, 0) + coalesce(cs_qty#86, 0)) AS other_chan_qty#93, CheckOverflow((promote_precision(cast(coalesce(ws_wc#58, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_wc#87, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_wholesale_cost#94, CheckOverflow((promote_precision(cast(coalesce(ws_sp#59, 0.00) as decimal(18,2))) + promote_precision(cast(coalesce(cs_sp#88, 0.00) as decimal(18,2)))), DecimalType(18,2), true) AS other_chan_sales_price#95, ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] +Input [15]: [ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30, ws_qty#57, ws_wc#58, ws_sp#59, cs_sold_year#84, cs_item_sk#61, cs_customer_sk#85, cs_qty#86, cs_wc#87, cs_sp#88] + +(73) TakeOrderedAndProject +Input [13]: [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95, ss_sold_year#27, ss_item_sk#1, ss_customer_sk#2, ss_qty#28, ss_wc#29, ss_sp#30] +Arguments: 100, [ss_sold_year#27 ASC NULLS FIRST, ss_item_sk#1 ASC NULLS FIRST, ss_customer_sk#2 ASC NULLS FIRST, ss_qty#28 DESC NULLS LAST, ss_wc#29 DESC NULLS LAST, ss_sp#30 DESC NULLS LAST, other_chan_qty#93 ASC NULLS FIRST, other_chan_wholesale_cost#94 ASC NULLS FIRST, other_chan_sales_price#95 ASC NULLS FIRST, ratio#89 ASC NULLS FIRST], [ratio#89, store_qty#90, store_wholesale_cost#91, store_sales_price#92, other_chan_qty#93, other_chan_wholesale_cost#94, other_chan_sales_price#95] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (74) + + +(74) ReusedExchange [Reuses operator id: 18] +Output [2]: [d_date_sk#14, d_year#15] + +Subquery:2 Hosting operator id = 25 Hosting Expression = ws_sold_date_sk#37 IN dynamicpruning#8 + +Subquery:3 Hosting operator id = 49 Hosting Expression = cs_sold_date_sk#66 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78/simplified.txt new file mode 100644 index 0000000000000..cb9ca4f3d3d32 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q78/simplified.txt @@ -0,0 +1,127 @@ +TakeOrderedAndProject [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,other_chan_qty,other_chan_wholesale_cost,other_chan_sales_price,ratio,store_qty,store_wholesale_cost,store_sales_price] + WholeStageCodegen (23) + Project [ss_qty,ws_qty,cs_qty,ss_wc,ss_sp,ws_wc,cs_wc,ws_sp,cs_sp,ss_sold_year,ss_item_sk,ss_customer_sk] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,cs_sold_year,cs_item_sk,cs_customer_sk] + InputAdapter + WholeStageCodegen (15) + Project [ss_sold_year,ss_item_sk,ss_customer_sk,ss_qty,ss_wc,ss_sp,ws_qty,ws_wc,ws_sp] + SortMergeJoin [ss_sold_year,ss_item_sk,ss_customer_sk,ws_sold_year,ws_item_sk,ws_customer_sk] + InputAdapter + WholeStageCodegen (7) + Sort [ss_sold_year,ss_item_sk,ss_customer_sk] + HashAggregate [d_year,ss_item_sk,ss_customer_sk,sum,sum,sum] [sum(ss_quantity),sum(UnscaledValue(ss_wholesale_cost)),sum(UnscaledValue(ss_sales_price)),ss_sold_year,ss_qty,ss_wc,ss_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,ss_item_sk,ss_customer_sk] #1 + WholeStageCodegen (6) + HashAggregate [d_year,ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,d_year] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_customer_sk,ss_quantity,ss_wholesale_cost,ss_sales_price,ss_sold_date_sk] + Filter [sr_ticket_number] + SortMergeJoin [ss_ticket_number,ss_item_sk,sr_ticket_number,sr_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_ticket_number,ss_item_sk] + InputAdapter + Exchange [ss_ticket_number,ss_item_sk] #2 + WholeStageCodegen (1) + Filter [ss_item_sk,ss_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_customer_sk,ss_ticket_number,ss_quantity,ss_wholesale_cost,ss_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + WholeStageCodegen (4) + Sort [sr_ticket_number,sr_item_sk] + InputAdapter + Exchange [sr_ticket_number,sr_item_sk] #4 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number] + Filter [sr_ticket_number,sr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_returned_date_sk] + InputAdapter + BroadcastExchange #3 + WholeStageCodegen (5) + Filter [d_year,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_year] + InputAdapter + WholeStageCodegen (14) + Sort [ws_sold_year,ws_item_sk,ws_customer_sk] + Filter [ws_qty] + HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,sum,sum,sum] [sum(ws_quantity),sum(UnscaledValue(ws_wholesale_cost)),sum(UnscaledValue(ws_sales_price)),ws_sold_year,ws_customer_sk,ws_qty,ws_wc,ws_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,ws_item_sk,ws_bill_customer_sk] #5 + WholeStageCodegen (13) + HashAggregate [d_year,ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price] [sum,sum,sum,sum,sum,sum] + Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,d_year] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_bill_customer_sk,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] + Filter [wr_order_number] + SortMergeJoin [ws_order_number,ws_item_sk,wr_order_number,wr_item_sk] + InputAdapter + WholeStageCodegen (9) + Sort [ws_order_number,ws_item_sk] + InputAdapter + Exchange [ws_order_number,ws_item_sk] #6 + WholeStageCodegen (8) + Filter [ws_item_sk,ws_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_bill_customer_sk,ws_order_number,ws_quantity,ws_wholesale_cost,ws_sales_price,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (11) + Sort [wr_order_number,wr_item_sk] + InputAdapter + Exchange [wr_order_number,wr_item_sk] #7 + WholeStageCodegen (10) + Project [wr_item_sk,wr_order_number] + Filter [wr_order_number,wr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 + InputAdapter + WholeStageCodegen (22) + Sort [cs_sold_year,cs_item_sk,cs_customer_sk] + Filter [cs_qty] + HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,sum,sum,sum] [sum(cs_quantity),sum(UnscaledValue(cs_wholesale_cost)),sum(UnscaledValue(cs_sales_price)),cs_sold_year,cs_customer_sk,cs_qty,cs_wc,cs_sp,sum,sum,sum] + InputAdapter + Exchange [d_year,cs_item_sk,cs_bill_customer_sk] #8 + WholeStageCodegen (21) + HashAggregate [d_year,cs_item_sk,cs_bill_customer_sk,cs_quantity,cs_wholesale_cost,cs_sales_price] [sum,sum,sum,sum,sum,sum] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,d_year] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_bill_customer_sk,cs_item_sk,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] + Filter [cr_order_number] + SortMergeJoin [cs_order_number,cs_item_sk,cr_order_number,cr_item_sk] + InputAdapter + WholeStageCodegen (17) + Sort [cs_order_number,cs_item_sk] + InputAdapter + Exchange [cs_order_number,cs_item_sk] #9 + WholeStageCodegen (16) + Filter [cs_item_sk,cs_bill_customer_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_bill_customer_sk,cs_item_sk,cs_order_number,cs_quantity,cs_wholesale_cost,cs_sales_price,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (19) + Sort [cr_order_number,cr_item_sk] + InputAdapter + Exchange [cr_order_number,cr_item_sk] #10 + WholeStageCodegen (18) + Project [cr_item_sk,cr_order_number] + Filter [cr_order_number,cr_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk,d_year] #3 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt new file mode 100644 index 0000000000000..61cae9d5bf5be --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/explain.txt @@ -0,0 +1,715 @@ +== Physical Plan == +TakeOrderedAndProject (124) ++- * HashAggregate (123) + +- Exchange (122) + +- * HashAggregate (121) + +- Union (120) + :- * HashAggregate (109) + : +- Exchange (108) + : +- * HashAggregate (107) + : +- Union (106) + : :- * HashAggregate (43) + : : +- Exchange (42) + : : +- * HashAggregate (41) + : : +- * Project (40) + : : +- * BroadcastHashJoin Inner BuildRight (39) + : : :- * Project (34) + : : : +- * BroadcastHashJoin Inner BuildRight (33) + : : : :- * Project (27) + : : : : +- * BroadcastHashJoin Inner BuildRight (26) + : : : : :- * Project (20) + : : : : : +- * BroadcastHashJoin Inner BuildRight (19) + : : : : : :- * Project (13) + : : : : : : +- * SortMergeJoin LeftOuter (12) + : : : : : : :- * Sort (5) + : : : : : : : +- Exchange (4) + : : : : : : : +- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : +- * Sort (11) + : : : : : : +- Exchange (10) + : : : : : : +- * Project (9) + : : : : : : +- * Filter (8) + : : : : : : +- * ColumnarToRow (7) + : : : : : : +- Scan parquet default.store_returns (6) + : : : : : +- BroadcastExchange (18) + : : : : : +- * Project (17) + : : : : : +- * Filter (16) + : : : : : +- * ColumnarToRow (15) + : : : : : +- Scan parquet default.item (14) + : : : : +- BroadcastExchange (25) + : : : : +- * Project (24) + : : : : +- * Filter (23) + : : : : +- * ColumnarToRow (22) + : : : : +- Scan parquet default.promotion (21) + : : : +- BroadcastExchange (32) + : : : +- * Project (31) + : : : +- * Filter (30) + : : : +- * ColumnarToRow (29) + : : : +- Scan parquet default.date_dim (28) + : : +- BroadcastExchange (38) + : : +- * Filter (37) + : : +- * ColumnarToRow (36) + : : +- Scan parquet default.store (35) + : :- * HashAggregate (74) + : : +- Exchange (73) + : : +- * HashAggregate (72) + : : +- * Project (71) + : : +- * BroadcastHashJoin Inner BuildRight (70) + : : :- * Project (65) + : : : +- * BroadcastHashJoin Inner BuildRight (64) + : : : :- * Project (62) + : : : : +- * BroadcastHashJoin Inner BuildRight (61) + : : : : :- * Project (59) + : : : : : +- * BroadcastHashJoin Inner BuildRight (58) + : : : : : :- * Project (56) + : : : : : : +- * SortMergeJoin LeftOuter (55) + : : : : : : :- * Sort (48) + : : : : : : : +- Exchange (47) + : : : : : : : +- * Filter (46) + : : : : : : : +- * ColumnarToRow (45) + : : : : : : : +- Scan parquet default.catalog_sales (44) + : : : : : : +- * Sort (54) + : : : : : : +- Exchange (53) + : : : : : : +- * Project (52) + : : : : : : +- * Filter (51) + : : : : : : +- * ColumnarToRow (50) + : : : : : : +- Scan parquet default.catalog_returns (49) + : : : : : +- ReusedExchange (57) + : : : : +- ReusedExchange (60) + : : : +- ReusedExchange (63) + : : +- BroadcastExchange (69) + : : +- * Filter (68) + : : +- * ColumnarToRow (67) + : : +- Scan parquet default.catalog_page (66) + : +- * HashAggregate (105) + : +- Exchange (104) + : +- * HashAggregate (103) + : +- * Project (102) + : +- * BroadcastHashJoin Inner BuildRight (101) + : :- * Project (96) + : : +- * BroadcastHashJoin Inner BuildRight (95) + : : :- * Project (93) + : : : +- * BroadcastHashJoin Inner BuildRight (92) + : : : :- * Project (90) + : : : : +- * BroadcastHashJoin Inner BuildRight (89) + : : : : :- * Project (87) + : : : : : +- * SortMergeJoin LeftOuter (86) + : : : : : :- * Sort (79) + : : : : : : +- Exchange (78) + : : : : : : +- * Filter (77) + : : : : : : +- * ColumnarToRow (76) + : : : : : : +- Scan parquet default.web_sales (75) + : : : : : +- * Sort (85) + : : : : : +- Exchange (84) + : : : : : +- * Project (83) + : : : : : +- * Filter (82) + : : : : : +- * ColumnarToRow (81) + : : : : : +- Scan parquet default.web_returns (80) + : : : : +- ReusedExchange (88) + : : : +- ReusedExchange (91) + : : +- ReusedExchange (94) + : +- BroadcastExchange (100) + : +- * Filter (99) + : +- * ColumnarToRow (98) + : +- Scan parquet default.web_site (97) + :- * HashAggregate (114) + : +- Exchange (113) + : +- * HashAggregate (112) + : +- * HashAggregate (111) + : +- ReusedExchange (110) + +- * HashAggregate (119) + +- Exchange (118) + +- * HashAggregate (117) + +- * HashAggregate (116) + +- ReusedExchange (115) + + +(1) Scan parquet default.store_sales +Output [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_item_sk), IsNotNull(ss_promo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] + +(3) Filter [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Condition : ((isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_promo_sk#3)) + +(4) Exchange +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#9] + +(5) Sort [codegen id : 2] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_returns +Output [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] + +(8) Filter [codegen id : 3] +Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] +Condition : (isnotnull(sr_item_sk#10) AND isnotnull(sr_ticket_number#11)) + +(9) Project [codegen id : 3] +Output [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] +Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] + +(10) Exchange +Input [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] +Arguments: hashpartitioning(sr_item_sk#10, sr_ticket_number#11, 5), ENSURE_REQUIREMENTS, [id=#15] + +(11) Sort [codegen id : 4] +Input [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] +Arguments: [sr_item_sk#10 ASC NULLS FIRST, sr_ticket_number#11 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 9] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#4] +Right keys [2]: [sr_item_sk#10, sr_ticket_number#11] +Join condition: None + +(13) Project [codegen id : 9] +Output [8]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13] +Input [11]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] + +(14) Scan parquet default.item +Output [2]: [i_item_sk#16, i_current_price#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThan(i_current_price,50.00), IsNotNull(i_item_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 5] +Input [2]: [i_item_sk#16, i_current_price#17] + +(16) Filter [codegen id : 5] +Input [2]: [i_item_sk#16, i_current_price#17] +Condition : ((isnotnull(i_current_price#17) AND (i_current_price#17 > 50.00)) AND isnotnull(i_item_sk#16)) + +(17) Project [codegen id : 5] +Output [1]: [i_item_sk#16] +Input [2]: [i_item_sk#16, i_current_price#17] + +(18) BroadcastExchange +Input [1]: [i_item_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(19) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#16] +Join condition: None + +(20) Project [codegen id : 9] +Output [7]: [ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13, i_item_sk#16] + +(21) Scan parquet default.promotion +Output [2]: [p_promo_sk#19, p_channel_tv#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_channel_tv), EqualTo(p_channel_tv,N), IsNotNull(p_promo_sk)] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 6] +Input [2]: [p_promo_sk#19, p_channel_tv#20] + +(23) Filter [codegen id : 6] +Input [2]: [p_promo_sk#19, p_channel_tv#20] +Condition : ((isnotnull(p_channel_tv#20) AND (p_channel_tv#20 = N)) AND isnotnull(p_promo_sk#19)) + +(24) Project [codegen id : 6] +Output [1]: [p_promo_sk#19] +Input [2]: [p_promo_sk#19, p_channel_tv#20] + +(25) BroadcastExchange +Input [1]: [p_promo_sk#19] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#21] + +(26) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_promo_sk#3] +Right keys [1]: [p_promo_sk#19] +Join condition: None + +(27) Project [codegen id : 9] +Output [6]: [ss_store_sk#2, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13] +Input [8]: [ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13, p_promo_sk#19] + +(28) Scan parquet default.date_dim +Output [2]: [d_date_sk#22, d_date#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1998-08-04), LessThanOrEqual(d_date,1998-09-03), IsNotNull(d_date_sk)] +ReadSchema: struct + +(29) ColumnarToRow [codegen id : 7] +Input [2]: [d_date_sk#22, d_date#23] + +(30) Filter [codegen id : 7] +Input [2]: [d_date_sk#22, d_date#23] +Condition : (((isnotnull(d_date#23) AND (d_date#23 >= 1998-08-04)) AND (d_date#23 <= 1998-09-03)) AND isnotnull(d_date_sk#22)) + +(31) Project [codegen id : 7] +Output [1]: [d_date_sk#22] +Input [2]: [d_date_sk#22, d_date#23] + +(32) BroadcastExchange +Input [1]: [d_date_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(33) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#22] +Join condition: None + +(34) Project [codegen id : 9] +Output [5]: [ss_store_sk#2, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13] +Input [7]: [ss_store_sk#2, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13, d_date_sk#22] + +(35) Scan parquet default.store +Output [2]: [s_store_sk#25, s_store_id#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(36) ColumnarToRow [codegen id : 8] +Input [2]: [s_store_sk#25, s_store_id#26] + +(37) Filter [codegen id : 8] +Input [2]: [s_store_sk#25, s_store_id#26] +Condition : isnotnull(s_store_sk#25) + +(38) BroadcastExchange +Input [2]: [s_store_sk#25, s_store_id#26] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#27] + +(39) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#25] +Join condition: None + +(40) Project [codegen id : 9] +Output [5]: [ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#26] +Input [7]: [ss_store_sk#2, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_sk#25, s_store_id#26] + +(41) HashAggregate [codegen id : 9] +Input [5]: [ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#26] +Keys [1]: [s_store_id#26] +Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#5)), partial_sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00)), partial_sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [5]: [sum#28, sum#29, isEmpty#30, sum#31, isEmpty#32] +Results [6]: [s_store_id#26, sum#33, sum#34, isEmpty#35, sum#36, isEmpty#37] + +(42) Exchange +Input [6]: [s_store_id#26, sum#33, sum#34, isEmpty#35, sum#36, isEmpty#37] +Arguments: hashpartitioning(s_store_id#26, 5), ENSURE_REQUIREMENTS, [id=#38] + +(43) HashAggregate [codegen id : 10] +Input [6]: [s_store_id#26, sum#33, sum#34, isEmpty#35, sum#36, isEmpty#37] +Keys [1]: [s_store_id#26] +Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#5)), sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00)), sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#5))#39, sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00))#40, sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#41] +Results [5]: [store channel AS channel#42, concat(store, s_store_id#26) AS id#43, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#39,17,2) AS sales#44, sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00))#40 AS returns#45, sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#41 AS profit#46] + +(44) Scan parquet default.catalog_sales +Output [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#53), dynamicpruningexpression(cs_sold_date_sk#53 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_catalog_page_sk), IsNotNull(cs_item_sk), IsNotNull(cs_promo_sk)] +ReadSchema: struct + +(45) ColumnarToRow [codegen id : 11] +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] + +(46) Filter [codegen id : 11] +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Condition : ((isnotnull(cs_catalog_page_sk#47) AND isnotnull(cs_item_sk#48)) AND isnotnull(cs_promo_sk#49)) + +(47) Exchange +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Arguments: hashpartitioning(cs_item_sk#48, cs_order_number#50, 5), ENSURE_REQUIREMENTS, [id=#54] + +(48) Sort [codegen id : 12] +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Arguments: [cs_item_sk#48 ASC NULLS FIRST, cs_order_number#50 ASC NULLS FIRST], false, 0 + +(49) Scan parquet default.catalog_returns +Output [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_order_number)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 13] +Input [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(51) Filter [codegen id : 13] +Input [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Condition : (isnotnull(cr_item_sk#55) AND isnotnull(cr_order_number#56)) + +(52) Project [codegen id : 13] +Output [4]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] +Input [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(53) Exchange +Input [4]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] +Arguments: hashpartitioning(cr_item_sk#55, cr_order_number#56, 5), ENSURE_REQUIREMENTS, [id=#60] + +(54) Sort [codegen id : 14] +Input [4]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] +Arguments: [cr_item_sk#55 ASC NULLS FIRST, cr_order_number#56 ASC NULLS FIRST], false, 0 + +(55) SortMergeJoin [codegen id : 19] +Left keys [2]: [cs_item_sk#48, cs_order_number#50] +Right keys [2]: [cr_item_sk#55, cr_order_number#56] +Join condition: None + +(56) Project [codegen id : 19] +Output [8]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58] +Input [11]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] + +(57) ReusedExchange [Reuses operator id: 18] +Output [1]: [i_item_sk#61] + +(58) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_item_sk#48] +Right keys [1]: [i_item_sk#61] +Join condition: None + +(59) Project [codegen id : 19] +Output [7]: [cs_catalog_page_sk#47, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58] +Input [9]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58, i_item_sk#61] + +(60) ReusedExchange [Reuses operator id: 25] +Output [1]: [p_promo_sk#62] + +(61) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_promo_sk#49] +Right keys [1]: [p_promo_sk#62] +Join condition: None + +(62) Project [codegen id : 19] +Output [6]: [cs_catalog_page_sk#47, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58] +Input [8]: [cs_catalog_page_sk#47, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58, p_promo_sk#62] + +(63) ReusedExchange [Reuses operator id: 32] +Output [1]: [d_date_sk#63] + +(64) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_sold_date_sk#53] +Right keys [1]: [d_date_sk#63] +Join condition: None + +(65) Project [codegen id : 19] +Output [5]: [cs_catalog_page_sk#47, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58] +Input [7]: [cs_catalog_page_sk#47, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58, d_date_sk#63] + +(66) Scan parquet default.catalog_page +Output [2]: [cp_catalog_page_sk#64, cp_catalog_page_id#65] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_page] +PushedFilters: [IsNotNull(cp_catalog_page_sk)] +ReadSchema: struct + +(67) ColumnarToRow [codegen id : 18] +Input [2]: [cp_catalog_page_sk#64, cp_catalog_page_id#65] + +(68) Filter [codegen id : 18] +Input [2]: [cp_catalog_page_sk#64, cp_catalog_page_id#65] +Condition : isnotnull(cp_catalog_page_sk#64) + +(69) BroadcastExchange +Input [2]: [cp_catalog_page_sk#64, cp_catalog_page_id#65] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#66] + +(70) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_catalog_page_sk#47] +Right keys [1]: [cp_catalog_page_sk#64] +Join condition: None + +(71) Project [codegen id : 19] +Output [5]: [cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#65] +Input [7]: [cs_catalog_page_sk#47, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_sk#64, cp_catalog_page_id#65] + +(72) HashAggregate [codegen id : 19] +Input [5]: [cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#65] +Keys [1]: [cp_catalog_page_id#65] +Functions [3]: [partial_sum(UnscaledValue(cs_ext_sales_price#51)), partial_sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00)), partial_sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [5]: [sum#67, sum#68, isEmpty#69, sum#70, isEmpty#71] +Results [6]: [cp_catalog_page_id#65, sum#72, sum#73, isEmpty#74, sum#75, isEmpty#76] + +(73) Exchange +Input [6]: [cp_catalog_page_id#65, sum#72, sum#73, isEmpty#74, sum#75, isEmpty#76] +Arguments: hashpartitioning(cp_catalog_page_id#65, 5), ENSURE_REQUIREMENTS, [id=#77] + +(74) HashAggregate [codegen id : 20] +Input [6]: [cp_catalog_page_id#65, sum#72, sum#73, isEmpty#74, sum#75, isEmpty#76] +Keys [1]: [cp_catalog_page_id#65] +Functions [3]: [sum(UnscaledValue(cs_ext_sales_price#51)), sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00)), sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_sales_price#51))#78, sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00))#79, sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#80] +Results [5]: [catalog channel AS channel#81, concat(catalog_page, cp_catalog_page_id#65) AS id#82, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#51))#78,17,2) AS sales#83, sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00))#79 AS returns#84, sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#80 AS profit#85] + +(75) Scan parquet default.web_sales +Output [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#92), dynamicpruningexpression(ws_sold_date_sk#92 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_web_site_sk), IsNotNull(ws_item_sk), IsNotNull(ws_promo_sk)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 21] +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] + +(77) Filter [codegen id : 21] +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Condition : ((isnotnull(ws_web_site_sk#87) AND isnotnull(ws_item_sk#86)) AND isnotnull(ws_promo_sk#88)) + +(78) Exchange +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Arguments: hashpartitioning(ws_item_sk#86, ws_order_number#89, 5), ENSURE_REQUIREMENTS, [id=#93] + +(79) Sort [codegen id : 22] +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Arguments: [ws_item_sk#86 ASC NULLS FIRST, ws_order_number#89 ASC NULLS FIRST], false, 0 + +(80) Scan parquet default.web_returns +Output [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number)] +ReadSchema: struct + +(81) ColumnarToRow [codegen id : 23] +Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] + +(82) Filter [codegen id : 23] +Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] +Condition : (isnotnull(wr_item_sk#94) AND isnotnull(wr_order_number#95)) + +(83) Project [codegen id : 23] +Output [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] +Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] + +(84) Exchange +Input [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] +Arguments: hashpartitioning(wr_item_sk#94, wr_order_number#95, 5), ENSURE_REQUIREMENTS, [id=#99] + +(85) Sort [codegen id : 24] +Input [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] +Arguments: [wr_item_sk#94 ASC NULLS FIRST, wr_order_number#95 ASC NULLS FIRST], false, 0 + +(86) SortMergeJoin [codegen id : 29] +Left keys [2]: [ws_item_sk#86, ws_order_number#89] +Right keys [2]: [wr_item_sk#94, wr_order_number#95] +Join condition: None + +(87) Project [codegen id : 29] +Output [8]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97] +Input [11]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] + +(88) ReusedExchange [Reuses operator id: 18] +Output [1]: [i_item_sk#100] + +(89) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_item_sk#86] +Right keys [1]: [i_item_sk#100] +Join condition: None + +(90) Project [codegen id : 29] +Output [7]: [ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97] +Input [9]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97, i_item_sk#100] + +(91) ReusedExchange [Reuses operator id: 25] +Output [1]: [p_promo_sk#101] + +(92) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_promo_sk#88] +Right keys [1]: [p_promo_sk#101] +Join condition: None + +(93) Project [codegen id : 29] +Output [6]: [ws_web_site_sk#87, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97] +Input [8]: [ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97, p_promo_sk#101] + +(94) ReusedExchange [Reuses operator id: 32] +Output [1]: [d_date_sk#102] + +(95) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_sold_date_sk#92] +Right keys [1]: [d_date_sk#102] +Join condition: None + +(96) Project [codegen id : 29] +Output [5]: [ws_web_site_sk#87, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97] +Input [7]: [ws_web_site_sk#87, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97, d_date_sk#102] + +(97) Scan parquet default.web_site +Output [2]: [web_site_sk#103, web_site_id#104] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_site_sk)] +ReadSchema: struct + +(98) ColumnarToRow [codegen id : 28] +Input [2]: [web_site_sk#103, web_site_id#104] + +(99) Filter [codegen id : 28] +Input [2]: [web_site_sk#103, web_site_id#104] +Condition : isnotnull(web_site_sk#103) + +(100) BroadcastExchange +Input [2]: [web_site_sk#103, web_site_id#104] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#105] + +(101) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_web_site_sk#87] +Right keys [1]: [web_site_sk#103] +Join condition: None + +(102) Project [codegen id : 29] +Output [5]: [ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#104] +Input [7]: [ws_web_site_sk#87, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_sk#103, web_site_id#104] + +(103) HashAggregate [codegen id : 29] +Input [5]: [ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#104] +Keys [1]: [web_site_id#104] +Functions [3]: [partial_sum(UnscaledValue(ws_ext_sales_price#90)), partial_sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00)), partial_sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [5]: [sum#106, sum#107, isEmpty#108, sum#109, isEmpty#110] +Results [6]: [web_site_id#104, sum#111, sum#112, isEmpty#113, sum#114, isEmpty#115] + +(104) Exchange +Input [6]: [web_site_id#104, sum#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Arguments: hashpartitioning(web_site_id#104, 5), ENSURE_REQUIREMENTS, [id=#116] + +(105) HashAggregate [codegen id : 30] +Input [6]: [web_site_id#104, sum#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Keys [1]: [web_site_id#104] +Functions [3]: [sum(UnscaledValue(ws_ext_sales_price#90)), sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00)), sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_sales_price#90))#117, sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00))#118, sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#119] +Results [5]: [web channel AS channel#120, concat(web_site, web_site_id#104) AS id#121, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#90))#117,17,2) AS sales#122, sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00))#118 AS returns#123, sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#119 AS profit#124] + +(106) Union + +(107) HashAggregate [codegen id : 31] +Input [5]: [channel#42, id#43, sales#44, returns#45, profit#46] +Keys [2]: [channel#42, id#43] +Functions [3]: [partial_sum(sales#44), partial_sum(returns#45), partial_sum(profit#46)] +Aggregate Attributes [6]: [sum#125, isEmpty#126, sum#127, isEmpty#128, sum#129, isEmpty#130] +Results [8]: [channel#42, id#43, sum#131, isEmpty#132, sum#133, isEmpty#134, sum#135, isEmpty#136] + +(108) Exchange +Input [8]: [channel#42, id#43, sum#131, isEmpty#132, sum#133, isEmpty#134, sum#135, isEmpty#136] +Arguments: hashpartitioning(channel#42, id#43, 5), ENSURE_REQUIREMENTS, [id=#137] + +(109) HashAggregate [codegen id : 32] +Input [8]: [channel#42, id#43, sum#131, isEmpty#132, sum#133, isEmpty#134, sum#135, isEmpty#136] +Keys [2]: [channel#42, id#43] +Functions [3]: [sum(sales#44), sum(returns#45), sum(profit#46)] +Aggregate Attributes [3]: [sum(sales#44)#138, sum(returns#45)#139, sum(profit#46)#140] +Results [5]: [channel#42, id#43, cast(sum(sales#44)#138 as decimal(37,2)) AS sales#141, cast(sum(returns#45)#139 as decimal(38,2)) AS returns#142, cast(sum(profit#46)#140 as decimal(38,2)) AS profit#143] + +(110) ReusedExchange [Reuses operator id: unknown] +Output [8]: [channel#42, id#43, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] + +(111) HashAggregate [codegen id : 64] +Input [8]: [channel#42, id#43, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] +Keys [2]: [channel#42, id#43] +Functions [3]: [sum(sales#44), sum(returns#45), sum(profit#46)] +Aggregate Attributes [3]: [sum(sales#44)#150, sum(returns#45)#151, sum(profit#46)#152] +Results [4]: [channel#42, sum(sales#44)#150 AS sales#153, sum(returns#45)#151 AS returns#154, sum(profit#46)#152 AS profit#155] + +(112) HashAggregate [codegen id : 64] +Input [4]: [channel#42, sales#153, returns#154, profit#155] +Keys [1]: [channel#42] +Functions [3]: [partial_sum(sales#153), partial_sum(returns#154), partial_sum(profit#155)] +Aggregate Attributes [6]: [sum#156, isEmpty#157, sum#158, isEmpty#159, sum#160, isEmpty#161] +Results [7]: [channel#42, sum#162, isEmpty#163, sum#164, isEmpty#165, sum#166, isEmpty#167] + +(113) Exchange +Input [7]: [channel#42, sum#162, isEmpty#163, sum#164, isEmpty#165, sum#166, isEmpty#167] +Arguments: hashpartitioning(channel#42, 5), ENSURE_REQUIREMENTS, [id=#168] + +(114) HashAggregate [codegen id : 65] +Input [7]: [channel#42, sum#162, isEmpty#163, sum#164, isEmpty#165, sum#166, isEmpty#167] +Keys [1]: [channel#42] +Functions [3]: [sum(sales#153), sum(returns#154), sum(profit#155)] +Aggregate Attributes [3]: [sum(sales#153)#169, sum(returns#154)#170, sum(profit#155)#171] +Results [5]: [channel#42, null AS id#172, sum(sales#153)#169 AS sales#173, sum(returns#154)#170 AS returns#174, sum(profit#155)#171 AS profit#175] + +(115) ReusedExchange [Reuses operator id: unknown] +Output [8]: [channel#42, id#43, sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] + +(116) HashAggregate [codegen id : 97] +Input [8]: [channel#42, id#43, sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] +Keys [2]: [channel#42, id#43] +Functions [3]: [sum(sales#44), sum(returns#45), sum(profit#46)] +Aggregate Attributes [3]: [sum(sales#44)#182, sum(returns#45)#183, sum(profit#46)#184] +Results [3]: [sum(sales#44)#182 AS sales#153, sum(returns#45)#183 AS returns#154, sum(profit#46)#184 AS profit#155] + +(117) HashAggregate [codegen id : 97] +Input [3]: [sales#153, returns#154, profit#155] +Keys: [] +Functions [3]: [partial_sum(sales#153), partial_sum(returns#154), partial_sum(profit#155)] +Aggregate Attributes [6]: [sum#185, isEmpty#186, sum#187, isEmpty#188, sum#189, isEmpty#190] +Results [6]: [sum#191, isEmpty#192, sum#193, isEmpty#194, sum#195, isEmpty#196] + +(118) Exchange +Input [6]: [sum#191, isEmpty#192, sum#193, isEmpty#194, sum#195, isEmpty#196] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#197] + +(119) HashAggregate [codegen id : 98] +Input [6]: [sum#191, isEmpty#192, sum#193, isEmpty#194, sum#195, isEmpty#196] +Keys: [] +Functions [3]: [sum(sales#153), sum(returns#154), sum(profit#155)] +Aggregate Attributes [3]: [sum(sales#153)#198, sum(returns#154)#199, sum(profit#155)#200] +Results [5]: [null AS channel#201, null AS id#202, sum(sales#153)#198 AS sales#203, sum(returns#154)#199 AS returns#204, sum(profit#155)#200 AS profit#205] + +(120) Union + +(121) HashAggregate [codegen id : 99] +Input [5]: [channel#42, id#43, sales#141, returns#142, profit#143] +Keys [5]: [channel#42, id#43, sales#141, returns#142, profit#143] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#42, id#43, sales#141, returns#142, profit#143] + +(122) Exchange +Input [5]: [channel#42, id#43, sales#141, returns#142, profit#143] +Arguments: hashpartitioning(channel#42, id#43, sales#141, returns#142, profit#143, 5), ENSURE_REQUIREMENTS, [id=#206] + +(123) HashAggregate [codegen id : 100] +Input [5]: [channel#42, id#43, sales#141, returns#142, profit#143] +Keys [5]: [channel#42, id#43, sales#141, returns#142, profit#143] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#42, id#43, sales#141, returns#142, profit#143] + +(124) TakeOrderedAndProject +Input [5]: [channel#42, id#43, sales#141, returns#142, profit#143] +Arguments: 100, [channel#42 ASC NULLS FIRST, id#43 ASC NULLS FIRST], [channel#42, id#43, sales#141, returns#142, profit#143] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (125) + + +(125) ReusedExchange [Reuses operator id: 32] +Output [1]: [d_date_sk#22] + +Subquery:2 Hosting operator id = 44 Hosting Expression = cs_sold_date_sk#53 IN dynamicpruning#8 + +Subquery:3 Hosting operator id = 75 Hosting Expression = ws_sold_date_sk#92 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/simplified.txt new file mode 100644 index 0000000000000..e73825fd5ad7c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a.sf100/simplified.txt @@ -0,0 +1,207 @@ +TakeOrderedAndProject [channel,id,sales,returns,profit] + WholeStageCodegen (100) + HashAggregate [channel,id,sales,returns,profit] + InputAdapter + Exchange [channel,id,sales,returns,profit] #1 + WholeStageCodegen (99) + HashAggregate [channel,id,sales,returns,profit] + InputAdapter + Union + WholeStageCodegen (32) + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel,id] #2 + WholeStageCodegen (31) + HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (10) + HashAggregate [s_store_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(ss_ext_sales_price)),sum(coalesce(cast(sr_return_amt as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(ss_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),channel,id,sales,returns,profit,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [s_store_id] #3 + WholeStageCodegen (9) + HashAggregate [s_store_id,ss_ext_sales_price,sr_return_amt,ss_net_profit,sr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] + Project [ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss,s_store_id] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_store_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_store_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk,sr_return_amt,sr_net_loss] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk,sr_return_amt,sr_net_loss] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk,sr_return_amt,sr_net_loss] + SortMergeJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_item_sk,ss_ticket_number] #4 + WholeStageCodegen (1) + Filter [ss_store_sk,ss_item_sk,ss_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + WholeStageCodegen (4) + Sort [sr_item_sk,sr_ticket_number] + InputAdapter + Exchange [sr_item_sk,sr_ticket_number] #6 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number,sr_return_amt,sr_net_loss] + Filter [sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_amt,sr_net_loss,sr_returned_date_sk] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (5) + Project [i_item_sk] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (6) + Project [p_promo_sk] + Filter [p_channel_tv,p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk,p_channel_tv] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (7) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (8) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + WholeStageCodegen (20) + HashAggregate [cp_catalog_page_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(cs_ext_sales_price)),sum(coalesce(cast(cr_return_amount as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(cs_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),channel,id,sales,returns,profit,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [cp_catalog_page_id] #10 + WholeStageCodegen (19) + HashAggregate [cp_catalog_page_id,cs_ext_sales_price,cr_return_amount,cs_net_profit,cr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] + Project [cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss,cp_catalog_page_id] + BroadcastHashJoin [cs_catalog_page_sk,cp_catalog_page_sk] + Project [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_catalog_page_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk,cr_return_amount,cr_net_loss] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_catalog_page_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk,cr_return_amount,cr_net_loss] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk,cr_return_amount,cr_net_loss] + SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] + InputAdapter + WholeStageCodegen (12) + Sort [cs_item_sk,cs_order_number] + InputAdapter + Exchange [cs_item_sk,cs_order_number] #11 + WholeStageCodegen (11) + Filter [cs_catalog_page_sk,cs_item_sk,cs_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (14) + Sort [cr_item_sk,cr_order_number] + InputAdapter + Exchange [cr_item_sk,cr_order_number] #12 + WholeStageCodegen (13) + Project [cr_item_sk,cr_order_number,cr_return_amount,cr_net_loss] + Filter [cr_item_sk,cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_amount,cr_net_loss,cr_returned_date_sk] + InputAdapter + ReusedExchange [i_item_sk] #7 + InputAdapter + ReusedExchange [p_promo_sk] #8 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (18) + Filter [cp_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_page [cp_catalog_page_sk,cp_catalog_page_id] + WholeStageCodegen (30) + HashAggregate [web_site_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(ws_ext_sales_price)),sum(coalesce(cast(wr_return_amt as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(ws_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),channel,id,sales,returns,profit,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [web_site_id] #14 + WholeStageCodegen (29) + HashAggregate [web_site_id,ws_ext_sales_price,wr_return_amt,ws_net_profit,wr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] + Project [ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss,web_site_id] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_web_site_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_web_site_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk,wr_return_amt,wr_net_loss] + BroadcastHashJoin [ws_promo_sk,p_promo_sk] + Project [ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk,wr_return_amt,wr_net_loss] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk,wr_return_amt,wr_net_loss] + SortMergeJoin [ws_item_sk,ws_order_number,wr_item_sk,wr_order_number] + InputAdapter + WholeStageCodegen (22) + Sort [ws_item_sk,ws_order_number] + InputAdapter + Exchange [ws_item_sk,ws_order_number] #15 + WholeStageCodegen (21) + Filter [ws_web_site_sk,ws_item_sk,ws_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_order_number,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (24) + Sort [wr_item_sk,wr_order_number] + InputAdapter + Exchange [wr_item_sk,wr_order_number] #16 + WholeStageCodegen (23) + Project [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss] + Filter [wr_item_sk,wr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss,wr_returned_date_sk] + InputAdapter + ReusedExchange [i_item_sk] #7 + InputAdapter + ReusedExchange [p_promo_sk] #8 + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (28) + Filter [web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_site_id] + WholeStageCodegen (65) + HashAggregate [channel,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),id,sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel] #18 + WholeStageCodegen (64) + HashAggregate [channel,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + ReusedExchange [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] #19 + WholeStageCodegen (98) + HashAggregate [sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),channel,id,sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange #20 + WholeStageCodegen (97) + HashAggregate [sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + ReusedExchange [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] #19 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt new file mode 100644 index 0000000000000..845d05e05b9bf --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/explain.txt @@ -0,0 +1,715 @@ +== Physical Plan == +TakeOrderedAndProject (124) ++- * HashAggregate (123) + +- Exchange (122) + +- * HashAggregate (121) + +- Union (120) + :- * HashAggregate (109) + : +- Exchange (108) + : +- * HashAggregate (107) + : +- Union (106) + : :- * HashAggregate (43) + : : +- Exchange (42) + : : +- * HashAggregate (41) + : : +- * Project (40) + : : +- * BroadcastHashJoin Inner BuildRight (39) + : : :- * Project (33) + : : : +- * BroadcastHashJoin Inner BuildRight (32) + : : : :- * Project (26) + : : : : +- * BroadcastHashJoin Inner BuildRight (25) + : : : : :- * Project (20) + : : : : : +- * BroadcastHashJoin Inner BuildRight (19) + : : : : : :- * Project (13) + : : : : : : +- * SortMergeJoin LeftOuter (12) + : : : : : : :- * Sort (5) + : : : : : : : +- Exchange (4) + : : : : : : : +- * Filter (3) + : : : : : : : +- * ColumnarToRow (2) + : : : : : : : +- Scan parquet default.store_sales (1) + : : : : : : +- * Sort (11) + : : : : : : +- Exchange (10) + : : : : : : +- * Project (9) + : : : : : : +- * Filter (8) + : : : : : : +- * ColumnarToRow (7) + : : : : : : +- Scan parquet default.store_returns (6) + : : : : : +- BroadcastExchange (18) + : : : : : +- * Project (17) + : : : : : +- * Filter (16) + : : : : : +- * ColumnarToRow (15) + : : : : : +- Scan parquet default.date_dim (14) + : : : : +- BroadcastExchange (24) + : : : : +- * Filter (23) + : : : : +- * ColumnarToRow (22) + : : : : +- Scan parquet default.store (21) + : : : +- BroadcastExchange (31) + : : : +- * Project (30) + : : : +- * Filter (29) + : : : +- * ColumnarToRow (28) + : : : +- Scan parquet default.item (27) + : : +- BroadcastExchange (38) + : : +- * Project (37) + : : +- * Filter (36) + : : +- * ColumnarToRow (35) + : : +- Scan parquet default.promotion (34) + : :- * HashAggregate (74) + : : +- Exchange (73) + : : +- * HashAggregate (72) + : : +- * Project (71) + : : +- * BroadcastHashJoin Inner BuildRight (70) + : : :- * Project (68) + : : : +- * BroadcastHashJoin Inner BuildRight (67) + : : : :- * Project (65) + : : : : +- * BroadcastHashJoin Inner BuildRight (64) + : : : : :- * Project (59) + : : : : : +- * BroadcastHashJoin Inner BuildRight (58) + : : : : : :- * Project (56) + : : : : : : +- * SortMergeJoin LeftOuter (55) + : : : : : : :- * Sort (48) + : : : : : : : +- Exchange (47) + : : : : : : : +- * Filter (46) + : : : : : : : +- * ColumnarToRow (45) + : : : : : : : +- Scan parquet default.catalog_sales (44) + : : : : : : +- * Sort (54) + : : : : : : +- Exchange (53) + : : : : : : +- * Project (52) + : : : : : : +- * Filter (51) + : : : : : : +- * ColumnarToRow (50) + : : : : : : +- Scan parquet default.catalog_returns (49) + : : : : : +- ReusedExchange (57) + : : : : +- BroadcastExchange (63) + : : : : +- * Filter (62) + : : : : +- * ColumnarToRow (61) + : : : : +- Scan parquet default.catalog_page (60) + : : : +- ReusedExchange (66) + : : +- ReusedExchange (69) + : +- * HashAggregate (105) + : +- Exchange (104) + : +- * HashAggregate (103) + : +- * Project (102) + : +- * BroadcastHashJoin Inner BuildRight (101) + : :- * Project (99) + : : +- * BroadcastHashJoin Inner BuildRight (98) + : : :- * Project (96) + : : : +- * BroadcastHashJoin Inner BuildRight (95) + : : : :- * Project (90) + : : : : +- * BroadcastHashJoin Inner BuildRight (89) + : : : : :- * Project (87) + : : : : : +- * SortMergeJoin LeftOuter (86) + : : : : : :- * Sort (79) + : : : : : : +- Exchange (78) + : : : : : : +- * Filter (77) + : : : : : : +- * ColumnarToRow (76) + : : : : : : +- Scan parquet default.web_sales (75) + : : : : : +- * Sort (85) + : : : : : +- Exchange (84) + : : : : : +- * Project (83) + : : : : : +- * Filter (82) + : : : : : +- * ColumnarToRow (81) + : : : : : +- Scan parquet default.web_returns (80) + : : : : +- ReusedExchange (88) + : : : +- BroadcastExchange (94) + : : : +- * Filter (93) + : : : +- * ColumnarToRow (92) + : : : +- Scan parquet default.web_site (91) + : : +- ReusedExchange (97) + : +- ReusedExchange (100) + :- * HashAggregate (114) + : +- Exchange (113) + : +- * HashAggregate (112) + : +- * HashAggregate (111) + : +- ReusedExchange (110) + +- * HashAggregate (119) + +- Exchange (118) + +- * HashAggregate (117) + +- * HashAggregate (116) + +- ReusedExchange (115) + + +(1) Scan parquet default.store_sales +Output [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#7), dynamicpruningexpression(ss_sold_date_sk#7 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ss_store_sk), IsNotNull(ss_item_sk), IsNotNull(ss_promo_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] + +(3) Filter [codegen id : 1] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Condition : ((isnotnull(ss_store_sk#2) AND isnotnull(ss_item_sk#1)) AND isnotnull(ss_promo_sk#3)) + +(4) Exchange +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Arguments: hashpartitioning(ss_item_sk#1, ss_ticket_number#4, 5), ENSURE_REQUIREMENTS, [id=#9] + +(5) Sort [codegen id : 2] +Input [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7] +Arguments: [ss_item_sk#1 ASC NULLS FIRST, ss_ticket_number#4 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.store_returns +Output [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store_returns] +PushedFilters: [IsNotNull(sr_item_sk), IsNotNull(sr_ticket_number)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] + +(8) Filter [codegen id : 3] +Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] +Condition : (isnotnull(sr_item_sk#10) AND isnotnull(sr_ticket_number#11)) + +(9) Project [codegen id : 3] +Output [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] +Input [5]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13, sr_returned_date_sk#14] + +(10) Exchange +Input [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] +Arguments: hashpartitioning(sr_item_sk#10, sr_ticket_number#11, 5), ENSURE_REQUIREMENTS, [id=#15] + +(11) Sort [codegen id : 4] +Input [4]: [sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] +Arguments: [sr_item_sk#10 ASC NULLS FIRST, sr_ticket_number#11 ASC NULLS FIRST], false, 0 + +(12) SortMergeJoin [codegen id : 9] +Left keys [2]: [ss_item_sk#1, ss_ticket_number#4] +Right keys [2]: [sr_item_sk#10, sr_ticket_number#11] +Join condition: None + +(13) Project [codegen id : 9] +Output [8]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13] +Input [11]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ticket_number#4, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_item_sk#10, sr_ticket_number#11, sr_return_amt#12, sr_net_loss#13] + +(14) Scan parquet default.date_dim +Output [2]: [d_date_sk#16, d_date#17] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1998-08-04), LessThanOrEqual(d_date,1998-09-03), IsNotNull(d_date_sk)] +ReadSchema: struct + +(15) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#16, d_date#17] + +(16) Filter [codegen id : 5] +Input [2]: [d_date_sk#16, d_date#17] +Condition : (((isnotnull(d_date#17) AND (d_date#17 >= 1998-08-04)) AND (d_date#17 <= 1998-09-03)) AND isnotnull(d_date_sk#16)) + +(17) Project [codegen id : 5] +Output [1]: [d_date_sk#16] +Input [2]: [d_date_sk#16, d_date#17] + +(18) BroadcastExchange +Input [1]: [d_date_sk#16] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#18] + +(19) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_sold_date_sk#7] +Right keys [1]: [d_date_sk#16] +Join condition: None + +(20) Project [codegen id : 9] +Output [7]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, ss_sold_date_sk#7, sr_return_amt#12, sr_net_loss#13, d_date_sk#16] + +(21) Scan parquet default.store +Output [2]: [s_store_sk#19, s_store_id#20] +Batched: true +Location [not included in comparison]/{warehouse_dir}/store] +PushedFilters: [IsNotNull(s_store_sk)] +ReadSchema: struct + +(22) ColumnarToRow [codegen id : 6] +Input [2]: [s_store_sk#19, s_store_id#20] + +(23) Filter [codegen id : 6] +Input [2]: [s_store_sk#19, s_store_id#20] +Condition : isnotnull(s_store_sk#19) + +(24) BroadcastExchange +Input [2]: [s_store_sk#19, s_store_id#20] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#21] + +(25) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_store_sk#2] +Right keys [1]: [s_store_sk#19] +Join condition: None + +(26) Project [codegen id : 9] +Output [7]: [ss_item_sk#1, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#20] +Input [9]: [ss_item_sk#1, ss_store_sk#2, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_sk#19, s_store_id#20] + +(27) Scan parquet default.item +Output [2]: [i_item_sk#22, i_current_price#23] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_current_price), GreaterThan(i_current_price,50.00), IsNotNull(i_item_sk)] +ReadSchema: struct + +(28) ColumnarToRow [codegen id : 7] +Input [2]: [i_item_sk#22, i_current_price#23] + +(29) Filter [codegen id : 7] +Input [2]: [i_item_sk#22, i_current_price#23] +Condition : ((isnotnull(i_current_price#23) AND (i_current_price#23 > 50.00)) AND isnotnull(i_item_sk#22)) + +(30) Project [codegen id : 7] +Output [1]: [i_item_sk#22] +Input [2]: [i_item_sk#22, i_current_price#23] + +(31) BroadcastExchange +Input [1]: [i_item_sk#22] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#24] + +(32) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#22] +Join condition: None + +(33) Project [codegen id : 9] +Output [6]: [ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#20] +Input [8]: [ss_item_sk#1, ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#20, i_item_sk#22] + +(34) Scan parquet default.promotion +Output [2]: [p_promo_sk#25, p_channel_tv#26] +Batched: true +Location [not included in comparison]/{warehouse_dir}/promotion] +PushedFilters: [IsNotNull(p_channel_tv), EqualTo(p_channel_tv,N), IsNotNull(p_promo_sk)] +ReadSchema: struct + +(35) ColumnarToRow [codegen id : 8] +Input [2]: [p_promo_sk#25, p_channel_tv#26] + +(36) Filter [codegen id : 8] +Input [2]: [p_promo_sk#25, p_channel_tv#26] +Condition : ((isnotnull(p_channel_tv#26) AND (p_channel_tv#26 = N)) AND isnotnull(p_promo_sk#25)) + +(37) Project [codegen id : 8] +Output [1]: [p_promo_sk#25] +Input [2]: [p_promo_sk#25, p_channel_tv#26] + +(38) BroadcastExchange +Input [1]: [p_promo_sk#25] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#27] + +(39) BroadcastHashJoin [codegen id : 9] +Left keys [1]: [ss_promo_sk#3] +Right keys [1]: [p_promo_sk#25] +Join condition: None + +(40) Project [codegen id : 9] +Output [5]: [ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#20] +Input [7]: [ss_promo_sk#3, ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#20, p_promo_sk#25] + +(41) HashAggregate [codegen id : 9] +Input [5]: [ss_ext_sales_price#5, ss_net_profit#6, sr_return_amt#12, sr_net_loss#13, s_store_id#20] +Keys [1]: [s_store_id#20] +Functions [3]: [partial_sum(UnscaledValue(ss_ext_sales_price#5)), partial_sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00)), partial_sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [5]: [sum#28, sum#29, isEmpty#30, sum#31, isEmpty#32] +Results [6]: [s_store_id#20, sum#33, sum#34, isEmpty#35, sum#36, isEmpty#37] + +(42) Exchange +Input [6]: [s_store_id#20, sum#33, sum#34, isEmpty#35, sum#36, isEmpty#37] +Arguments: hashpartitioning(s_store_id#20, 5), ENSURE_REQUIREMENTS, [id=#38] + +(43) HashAggregate [codegen id : 10] +Input [6]: [s_store_id#20, sum#33, sum#34, isEmpty#35, sum#36, isEmpty#37] +Keys [1]: [s_store_id#20] +Functions [3]: [sum(UnscaledValue(ss_ext_sales_price#5)), sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00)), sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [3]: [sum(UnscaledValue(ss_ext_sales_price#5))#39, sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00))#40, sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#41] +Results [5]: [store channel AS channel#42, concat(store, s_store_id#20) AS id#43, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#5))#39,17,2) AS sales#44, sum(coalesce(cast(sr_return_amt#12 as decimal(12,2)), 0.00))#40 AS returns#45, sum(CheckOverflow((promote_precision(cast(ss_net_profit#6 as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss#13 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#41 AS profit#46] + +(44) Scan parquet default.catalog_sales +Output [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(cs_sold_date_sk#53), dynamicpruningexpression(cs_sold_date_sk#53 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(cs_catalog_page_sk), IsNotNull(cs_item_sk), IsNotNull(cs_promo_sk)] +ReadSchema: struct + +(45) ColumnarToRow [codegen id : 11] +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] + +(46) Filter [codegen id : 11] +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Condition : ((isnotnull(cs_catalog_page_sk#47) AND isnotnull(cs_item_sk#48)) AND isnotnull(cs_promo_sk#49)) + +(47) Exchange +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Arguments: hashpartitioning(cs_item_sk#48, cs_order_number#50, 5), ENSURE_REQUIREMENTS, [id=#54] + +(48) Sort [codegen id : 12] +Input [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53] +Arguments: [cs_item_sk#48 ASC NULLS FIRST, cs_order_number#50 ASC NULLS FIRST], false, 0 + +(49) Scan parquet default.catalog_returns +Output [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_returns] +PushedFilters: [IsNotNull(cr_item_sk), IsNotNull(cr_order_number)] +ReadSchema: struct + +(50) ColumnarToRow [codegen id : 13] +Input [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(51) Filter [codegen id : 13] +Input [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] +Condition : (isnotnull(cr_item_sk#55) AND isnotnull(cr_order_number#56)) + +(52) Project [codegen id : 13] +Output [4]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] +Input [5]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58, cr_returned_date_sk#59] + +(53) Exchange +Input [4]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] +Arguments: hashpartitioning(cr_item_sk#55, cr_order_number#56, 5), ENSURE_REQUIREMENTS, [id=#60] + +(54) Sort [codegen id : 14] +Input [4]: [cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] +Arguments: [cr_item_sk#55 ASC NULLS FIRST, cr_order_number#56 ASC NULLS FIRST], false, 0 + +(55) SortMergeJoin [codegen id : 19] +Left keys [2]: [cs_item_sk#48, cs_order_number#50] +Right keys [2]: [cr_item_sk#55, cr_order_number#56] +Join condition: None + +(56) Project [codegen id : 19] +Output [8]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58] +Input [11]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_order_number#50, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_item_sk#55, cr_order_number#56, cr_return_amount#57, cr_net_loss#58] + +(57) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#61] + +(58) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_sold_date_sk#53] +Right keys [1]: [d_date_sk#61] +Join condition: None + +(59) Project [codegen id : 19] +Output [7]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58] +Input [9]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cs_sold_date_sk#53, cr_return_amount#57, cr_net_loss#58, d_date_sk#61] + +(60) Scan parquet default.catalog_page +Output [2]: [cp_catalog_page_sk#62, cp_catalog_page_id#63] +Batched: true +Location [not included in comparison]/{warehouse_dir}/catalog_page] +PushedFilters: [IsNotNull(cp_catalog_page_sk)] +ReadSchema: struct + +(61) ColumnarToRow [codegen id : 16] +Input [2]: [cp_catalog_page_sk#62, cp_catalog_page_id#63] + +(62) Filter [codegen id : 16] +Input [2]: [cp_catalog_page_sk#62, cp_catalog_page_id#63] +Condition : isnotnull(cp_catalog_page_sk#62) + +(63) BroadcastExchange +Input [2]: [cp_catalog_page_sk#62, cp_catalog_page_id#63] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#64] + +(64) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_catalog_page_sk#47] +Right keys [1]: [cp_catalog_page_sk#62] +Join condition: None + +(65) Project [codegen id : 19] +Output [7]: [cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#63] +Input [9]: [cs_catalog_page_sk#47, cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_sk#62, cp_catalog_page_id#63] + +(66) ReusedExchange [Reuses operator id: 31] +Output [1]: [i_item_sk#65] + +(67) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_item_sk#48] +Right keys [1]: [i_item_sk#65] +Join condition: None + +(68) Project [codegen id : 19] +Output [6]: [cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#63] +Input [8]: [cs_item_sk#48, cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#63, i_item_sk#65] + +(69) ReusedExchange [Reuses operator id: 38] +Output [1]: [p_promo_sk#66] + +(70) BroadcastHashJoin [codegen id : 19] +Left keys [1]: [cs_promo_sk#49] +Right keys [1]: [p_promo_sk#66] +Join condition: None + +(71) Project [codegen id : 19] +Output [5]: [cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#63] +Input [7]: [cs_promo_sk#49, cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#63, p_promo_sk#66] + +(72) HashAggregate [codegen id : 19] +Input [5]: [cs_ext_sales_price#51, cs_net_profit#52, cr_return_amount#57, cr_net_loss#58, cp_catalog_page_id#63] +Keys [1]: [cp_catalog_page_id#63] +Functions [3]: [partial_sum(UnscaledValue(cs_ext_sales_price#51)), partial_sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00)), partial_sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [5]: [sum#67, sum#68, isEmpty#69, sum#70, isEmpty#71] +Results [6]: [cp_catalog_page_id#63, sum#72, sum#73, isEmpty#74, sum#75, isEmpty#76] + +(73) Exchange +Input [6]: [cp_catalog_page_id#63, sum#72, sum#73, isEmpty#74, sum#75, isEmpty#76] +Arguments: hashpartitioning(cp_catalog_page_id#63, 5), ENSURE_REQUIREMENTS, [id=#77] + +(74) HashAggregate [codegen id : 20] +Input [6]: [cp_catalog_page_id#63, sum#72, sum#73, isEmpty#74, sum#75, isEmpty#76] +Keys [1]: [cp_catalog_page_id#63] +Functions [3]: [sum(UnscaledValue(cs_ext_sales_price#51)), sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00)), sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [3]: [sum(UnscaledValue(cs_ext_sales_price#51))#78, sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00))#79, sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#80] +Results [5]: [catalog channel AS channel#81, concat(catalog_page, cp_catalog_page_id#63) AS id#82, MakeDecimal(sum(UnscaledValue(cs_ext_sales_price#51))#78,17,2) AS sales#83, sum(coalesce(cast(cr_return_amount#57 as decimal(12,2)), 0.00))#79 AS returns#84, sum(CheckOverflow((promote_precision(cast(cs_net_profit#52 as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss#58 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#80 AS profit#85] + +(75) Scan parquet default.web_sales +Output [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#92), dynamicpruningexpression(ws_sold_date_sk#92 IN dynamicpruning#8)] +PushedFilters: [IsNotNull(ws_web_site_sk), IsNotNull(ws_item_sk), IsNotNull(ws_promo_sk)] +ReadSchema: struct + +(76) ColumnarToRow [codegen id : 21] +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] + +(77) Filter [codegen id : 21] +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Condition : ((isnotnull(ws_web_site_sk#87) AND isnotnull(ws_item_sk#86)) AND isnotnull(ws_promo_sk#88)) + +(78) Exchange +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Arguments: hashpartitioning(ws_item_sk#86, ws_order_number#89, 5), ENSURE_REQUIREMENTS, [id=#93] + +(79) Sort [codegen id : 22] +Input [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92] +Arguments: [ws_item_sk#86 ASC NULLS FIRST, ws_order_number#89 ASC NULLS FIRST], false, 0 + +(80) Scan parquet default.web_returns +Output [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_returns] +PushedFilters: [IsNotNull(wr_item_sk), IsNotNull(wr_order_number)] +ReadSchema: struct + +(81) ColumnarToRow [codegen id : 23] +Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] + +(82) Filter [codegen id : 23] +Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] +Condition : (isnotnull(wr_item_sk#94) AND isnotnull(wr_order_number#95)) + +(83) Project [codegen id : 23] +Output [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] +Input [5]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97, wr_returned_date_sk#98] + +(84) Exchange +Input [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] +Arguments: hashpartitioning(wr_item_sk#94, wr_order_number#95, 5), ENSURE_REQUIREMENTS, [id=#99] + +(85) Sort [codegen id : 24] +Input [4]: [wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] +Arguments: [wr_item_sk#94 ASC NULLS FIRST, wr_order_number#95 ASC NULLS FIRST], false, 0 + +(86) SortMergeJoin [codegen id : 29] +Left keys [2]: [ws_item_sk#86, ws_order_number#89] +Right keys [2]: [wr_item_sk#94, wr_order_number#95] +Join condition: None + +(87) Project [codegen id : 29] +Output [8]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97] +Input [11]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_order_number#89, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_item_sk#94, wr_order_number#95, wr_return_amt#96, wr_net_loss#97] + +(88) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#100] + +(89) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_sold_date_sk#92] +Right keys [1]: [d_date_sk#100] +Join condition: None + +(90) Project [codegen id : 29] +Output [7]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97] +Input [9]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, ws_sold_date_sk#92, wr_return_amt#96, wr_net_loss#97, d_date_sk#100] + +(91) Scan parquet default.web_site +Output [2]: [web_site_sk#101, web_site_id#102] +Batched: true +Location [not included in comparison]/{warehouse_dir}/web_site] +PushedFilters: [IsNotNull(web_site_sk)] +ReadSchema: struct + +(92) ColumnarToRow [codegen id : 26] +Input [2]: [web_site_sk#101, web_site_id#102] + +(93) Filter [codegen id : 26] +Input [2]: [web_site_sk#101, web_site_id#102] +Condition : isnotnull(web_site_sk#101) + +(94) BroadcastExchange +Input [2]: [web_site_sk#101, web_site_id#102] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#103] + +(95) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_web_site_sk#87] +Right keys [1]: [web_site_sk#101] +Join condition: None + +(96) Project [codegen id : 29] +Output [7]: [ws_item_sk#86, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#102] +Input [9]: [ws_item_sk#86, ws_web_site_sk#87, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_sk#101, web_site_id#102] + +(97) ReusedExchange [Reuses operator id: 31] +Output [1]: [i_item_sk#104] + +(98) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_item_sk#86] +Right keys [1]: [i_item_sk#104] +Join condition: None + +(99) Project [codegen id : 29] +Output [6]: [ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#102] +Input [8]: [ws_item_sk#86, ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#102, i_item_sk#104] + +(100) ReusedExchange [Reuses operator id: 38] +Output [1]: [p_promo_sk#105] + +(101) BroadcastHashJoin [codegen id : 29] +Left keys [1]: [ws_promo_sk#88] +Right keys [1]: [p_promo_sk#105] +Join condition: None + +(102) Project [codegen id : 29] +Output [5]: [ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#102] +Input [7]: [ws_promo_sk#88, ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#102, p_promo_sk#105] + +(103) HashAggregate [codegen id : 29] +Input [5]: [ws_ext_sales_price#90, ws_net_profit#91, wr_return_amt#96, wr_net_loss#97, web_site_id#102] +Keys [1]: [web_site_id#102] +Functions [3]: [partial_sum(UnscaledValue(ws_ext_sales_price#90)), partial_sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00)), partial_sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [5]: [sum#106, sum#107, isEmpty#108, sum#109, isEmpty#110] +Results [6]: [web_site_id#102, sum#111, sum#112, isEmpty#113, sum#114, isEmpty#115] + +(104) Exchange +Input [6]: [web_site_id#102, sum#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Arguments: hashpartitioning(web_site_id#102, 5), ENSURE_REQUIREMENTS, [id=#116] + +(105) HashAggregate [codegen id : 30] +Input [6]: [web_site_id#102, sum#111, sum#112, isEmpty#113, sum#114, isEmpty#115] +Keys [1]: [web_site_id#102] +Functions [3]: [sum(UnscaledValue(ws_ext_sales_price#90)), sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00)), sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))] +Aggregate Attributes [3]: [sum(UnscaledValue(ws_ext_sales_price#90))#117, sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00))#118, sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#119] +Results [5]: [web channel AS channel#120, concat(web_site, web_site_id#102) AS id#121, MakeDecimal(sum(UnscaledValue(ws_ext_sales_price#90))#117,17,2) AS sales#122, sum(coalesce(cast(wr_return_amt#96 as decimal(12,2)), 0.00))#118 AS returns#123, sum(CheckOverflow((promote_precision(cast(ws_net_profit#91 as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss#97 as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true))#119 AS profit#124] + +(106) Union + +(107) HashAggregate [codegen id : 31] +Input [5]: [channel#42, id#43, sales#44, returns#45, profit#46] +Keys [2]: [channel#42, id#43] +Functions [3]: [partial_sum(sales#44), partial_sum(returns#45), partial_sum(profit#46)] +Aggregate Attributes [6]: [sum#125, isEmpty#126, sum#127, isEmpty#128, sum#129, isEmpty#130] +Results [8]: [channel#42, id#43, sum#131, isEmpty#132, sum#133, isEmpty#134, sum#135, isEmpty#136] + +(108) Exchange +Input [8]: [channel#42, id#43, sum#131, isEmpty#132, sum#133, isEmpty#134, sum#135, isEmpty#136] +Arguments: hashpartitioning(channel#42, id#43, 5), ENSURE_REQUIREMENTS, [id=#137] + +(109) HashAggregate [codegen id : 32] +Input [8]: [channel#42, id#43, sum#131, isEmpty#132, sum#133, isEmpty#134, sum#135, isEmpty#136] +Keys [2]: [channel#42, id#43] +Functions [3]: [sum(sales#44), sum(returns#45), sum(profit#46)] +Aggregate Attributes [3]: [sum(sales#44)#138, sum(returns#45)#139, sum(profit#46)#140] +Results [5]: [channel#42, id#43, cast(sum(sales#44)#138 as decimal(37,2)) AS sales#141, cast(sum(returns#45)#139 as decimal(38,2)) AS returns#142, cast(sum(profit#46)#140 as decimal(38,2)) AS profit#143] + +(110) ReusedExchange [Reuses operator id: unknown] +Output [8]: [channel#42, id#43, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] + +(111) HashAggregate [codegen id : 64] +Input [8]: [channel#42, id#43, sum#144, isEmpty#145, sum#146, isEmpty#147, sum#148, isEmpty#149] +Keys [2]: [channel#42, id#43] +Functions [3]: [sum(sales#44), sum(returns#45), sum(profit#46)] +Aggregate Attributes [3]: [sum(sales#44)#150, sum(returns#45)#151, sum(profit#46)#152] +Results [4]: [channel#42, sum(sales#44)#150 AS sales#153, sum(returns#45)#151 AS returns#154, sum(profit#46)#152 AS profit#155] + +(112) HashAggregate [codegen id : 64] +Input [4]: [channel#42, sales#153, returns#154, profit#155] +Keys [1]: [channel#42] +Functions [3]: [partial_sum(sales#153), partial_sum(returns#154), partial_sum(profit#155)] +Aggregate Attributes [6]: [sum#156, isEmpty#157, sum#158, isEmpty#159, sum#160, isEmpty#161] +Results [7]: [channel#42, sum#162, isEmpty#163, sum#164, isEmpty#165, sum#166, isEmpty#167] + +(113) Exchange +Input [7]: [channel#42, sum#162, isEmpty#163, sum#164, isEmpty#165, sum#166, isEmpty#167] +Arguments: hashpartitioning(channel#42, 5), ENSURE_REQUIREMENTS, [id=#168] + +(114) HashAggregate [codegen id : 65] +Input [7]: [channel#42, sum#162, isEmpty#163, sum#164, isEmpty#165, sum#166, isEmpty#167] +Keys [1]: [channel#42] +Functions [3]: [sum(sales#153), sum(returns#154), sum(profit#155)] +Aggregate Attributes [3]: [sum(sales#153)#169, sum(returns#154)#170, sum(profit#155)#171] +Results [5]: [channel#42, null AS id#172, sum(sales#153)#169 AS sales#173, sum(returns#154)#170 AS returns#174, sum(profit#155)#171 AS profit#175] + +(115) ReusedExchange [Reuses operator id: unknown] +Output [8]: [channel#42, id#43, sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] + +(116) HashAggregate [codegen id : 97] +Input [8]: [channel#42, id#43, sum#176, isEmpty#177, sum#178, isEmpty#179, sum#180, isEmpty#181] +Keys [2]: [channel#42, id#43] +Functions [3]: [sum(sales#44), sum(returns#45), sum(profit#46)] +Aggregate Attributes [3]: [sum(sales#44)#182, sum(returns#45)#183, sum(profit#46)#184] +Results [3]: [sum(sales#44)#182 AS sales#153, sum(returns#45)#183 AS returns#154, sum(profit#46)#184 AS profit#155] + +(117) HashAggregate [codegen id : 97] +Input [3]: [sales#153, returns#154, profit#155] +Keys: [] +Functions [3]: [partial_sum(sales#153), partial_sum(returns#154), partial_sum(profit#155)] +Aggregate Attributes [6]: [sum#185, isEmpty#186, sum#187, isEmpty#188, sum#189, isEmpty#190] +Results [6]: [sum#191, isEmpty#192, sum#193, isEmpty#194, sum#195, isEmpty#196] + +(118) Exchange +Input [6]: [sum#191, isEmpty#192, sum#193, isEmpty#194, sum#195, isEmpty#196] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#197] + +(119) HashAggregate [codegen id : 98] +Input [6]: [sum#191, isEmpty#192, sum#193, isEmpty#194, sum#195, isEmpty#196] +Keys: [] +Functions [3]: [sum(sales#153), sum(returns#154), sum(profit#155)] +Aggregate Attributes [3]: [sum(sales#153)#198, sum(returns#154)#199, sum(profit#155)#200] +Results [5]: [null AS channel#201, null AS id#202, sum(sales#153)#198 AS sales#203, sum(returns#154)#199 AS returns#204, sum(profit#155)#200 AS profit#205] + +(120) Union + +(121) HashAggregate [codegen id : 99] +Input [5]: [channel#42, id#43, sales#141, returns#142, profit#143] +Keys [5]: [channel#42, id#43, sales#141, returns#142, profit#143] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#42, id#43, sales#141, returns#142, profit#143] + +(122) Exchange +Input [5]: [channel#42, id#43, sales#141, returns#142, profit#143] +Arguments: hashpartitioning(channel#42, id#43, sales#141, returns#142, profit#143, 5), ENSURE_REQUIREMENTS, [id=#206] + +(123) HashAggregate [codegen id : 100] +Input [5]: [channel#42, id#43, sales#141, returns#142, profit#143] +Keys [5]: [channel#42, id#43, sales#141, returns#142, profit#143] +Functions: [] +Aggregate Attributes: [] +Results [5]: [channel#42, id#43, sales#141, returns#142, profit#143] + +(124) TakeOrderedAndProject +Input [5]: [channel#42, id#43, sales#141, returns#142, profit#143] +Arguments: 100, [channel#42 ASC NULLS FIRST, id#43 ASC NULLS FIRST], [channel#42, id#43, sales#141, returns#142, profit#143] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#7 IN dynamicpruning#8 +ReusedExchange (125) + + +(125) ReusedExchange [Reuses operator id: 18] +Output [1]: [d_date_sk#16] + +Subquery:2 Hosting operator id = 44 Hosting Expression = cs_sold_date_sk#53 IN dynamicpruning#8 + +Subquery:3 Hosting operator id = 75 Hosting Expression = ws_sold_date_sk#92 IN dynamicpruning#8 + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/simplified.txt new file mode 100644 index 0000000000000..30b609e21c467 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q80a/simplified.txt @@ -0,0 +1,207 @@ +TakeOrderedAndProject [channel,id,sales,returns,profit] + WholeStageCodegen (100) + HashAggregate [channel,id,sales,returns,profit] + InputAdapter + Exchange [channel,id,sales,returns,profit] #1 + WholeStageCodegen (99) + HashAggregate [channel,id,sales,returns,profit] + InputAdapter + Union + WholeStageCodegen (32) + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel,id] #2 + WholeStageCodegen (31) + HashAggregate [channel,id,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Union + WholeStageCodegen (10) + HashAggregate [s_store_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(ss_ext_sales_price)),sum(coalesce(cast(sr_return_amt as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(ss_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(sr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),channel,id,sales,returns,profit,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [s_store_id] #3 + WholeStageCodegen (9) + HashAggregate [s_store_id,ss_ext_sales_price,sr_return_amt,ss_net_profit,sr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] + Project [ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss,s_store_id] + BroadcastHashJoin [ss_promo_sk,p_promo_sk] + Project [ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss,s_store_id] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Project [ss_item_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss,s_store_id] + BroadcastHashJoin [ss_store_sk,s_store_sk] + Project [ss_item_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,sr_return_amt,sr_net_loss] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_item_sk,ss_store_sk,ss_promo_sk,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk,sr_return_amt,sr_net_loss] + SortMergeJoin [ss_item_sk,ss_ticket_number,sr_item_sk,sr_ticket_number] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk,ss_ticket_number] + InputAdapter + Exchange [ss_item_sk,ss_ticket_number] #4 + WholeStageCodegen (1) + Filter [ss_store_sk,ss_item_sk,ss_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_store_sk,ss_promo_sk,ss_ticket_number,ss_ext_sales_price,ss_net_profit,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + WholeStageCodegen (4) + Sort [sr_item_sk,sr_ticket_number] + InputAdapter + Exchange [sr_item_sk,sr_ticket_number] #6 + WholeStageCodegen (3) + Project [sr_item_sk,sr_ticket_number,sr_return_amt,sr_net_loss] + Filter [sr_item_sk,sr_ticket_number] + ColumnarToRow + InputAdapter + Scan parquet default.store_returns [sr_item_sk,sr_ticket_number,sr_return_amt,sr_net_loss,sr_returned_date_sk] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] + InputAdapter + BroadcastExchange #7 + WholeStageCodegen (6) + Filter [s_store_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store [s_store_sk,s_store_id] + InputAdapter + BroadcastExchange #8 + WholeStageCodegen (7) + Project [i_item_sk] + Filter [i_current_price,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_current_price] + InputAdapter + BroadcastExchange #9 + WholeStageCodegen (8) + Project [p_promo_sk] + Filter [p_channel_tv,p_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.promotion [p_promo_sk,p_channel_tv] + WholeStageCodegen (20) + HashAggregate [cp_catalog_page_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(cs_ext_sales_price)),sum(coalesce(cast(cr_return_amount as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(cs_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(cr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),channel,id,sales,returns,profit,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [cp_catalog_page_id] #10 + WholeStageCodegen (19) + HashAggregate [cp_catalog_page_id,cs_ext_sales_price,cr_return_amount,cs_net_profit,cr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] + Project [cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss,cp_catalog_page_id] + BroadcastHashJoin [cs_promo_sk,p_promo_sk] + Project [cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss,cp_catalog_page_id] + BroadcastHashJoin [cs_item_sk,i_item_sk] + Project [cs_item_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss,cp_catalog_page_id] + BroadcastHashJoin [cs_catalog_page_sk,cp_catalog_page_sk] + Project [cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cr_return_amount,cr_net_loss] + BroadcastHashJoin [cs_sold_date_sk,d_date_sk] + Project [cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk,cr_return_amount,cr_net_loss] + SortMergeJoin [cs_item_sk,cs_order_number,cr_item_sk,cr_order_number] + InputAdapter + WholeStageCodegen (12) + Sort [cs_item_sk,cs_order_number] + InputAdapter + Exchange [cs_item_sk,cs_order_number] #11 + WholeStageCodegen (11) + Filter [cs_catalog_page_sk,cs_item_sk,cs_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_sales [cs_catalog_page_sk,cs_item_sk,cs_promo_sk,cs_order_number,cs_ext_sales_price,cs_net_profit,cs_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (14) + Sort [cr_item_sk,cr_order_number] + InputAdapter + Exchange [cr_item_sk,cr_order_number] #12 + WholeStageCodegen (13) + Project [cr_item_sk,cr_order_number,cr_return_amount,cr_net_loss] + Filter [cr_item_sk,cr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_returns [cr_item_sk,cr_order_number,cr_return_amount,cr_net_loss,cr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #13 + WholeStageCodegen (16) + Filter [cp_catalog_page_sk] + ColumnarToRow + InputAdapter + Scan parquet default.catalog_page [cp_catalog_page_sk,cp_catalog_page_id] + InputAdapter + ReusedExchange [i_item_sk] #8 + InputAdapter + ReusedExchange [p_promo_sk] #9 + WholeStageCodegen (30) + HashAggregate [web_site_id,sum,sum,isEmpty,sum,isEmpty] [sum(UnscaledValue(ws_ext_sales_price)),sum(coalesce(cast(wr_return_amt as decimal(12,2)), 0.00)),sum(CheckOverflow((promote_precision(cast(ws_net_profit as decimal(13,2))) - promote_precision(cast(coalesce(cast(wr_net_loss as decimal(12,2)), 0.00) as decimal(13,2)))), DecimalType(13,2), true)),channel,id,sales,returns,profit,sum,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [web_site_id] #14 + WholeStageCodegen (29) + HashAggregate [web_site_id,ws_ext_sales_price,wr_return_amt,ws_net_profit,wr_net_loss] [sum,sum,isEmpty,sum,isEmpty,sum,sum,isEmpty,sum,isEmpty] + Project [ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss,web_site_id] + BroadcastHashJoin [ws_promo_sk,p_promo_sk] + Project [ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss,web_site_id] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss,web_site_id] + BroadcastHashJoin [ws_web_site_sk,web_site_sk] + Project [ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,wr_return_amt,wr_net_loss] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Project [ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk,wr_return_amt,wr_net_loss] + SortMergeJoin [ws_item_sk,ws_order_number,wr_item_sk,wr_order_number] + InputAdapter + WholeStageCodegen (22) + Sort [ws_item_sk,ws_order_number] + InputAdapter + Exchange [ws_item_sk,ws_order_number] #15 + WholeStageCodegen (21) + Filter [ws_web_site_sk,ws_item_sk,ws_promo_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_web_site_sk,ws_promo_sk,ws_order_number,ws_ext_sales_price,ws_net_profit,ws_sold_date_sk] + ReusedSubquery [d_date_sk] #1 + InputAdapter + WholeStageCodegen (24) + Sort [wr_item_sk,wr_order_number] + InputAdapter + Exchange [wr_item_sk,wr_order_number] #16 + WholeStageCodegen (23) + Project [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss] + Filter [wr_item_sk,wr_order_number] + ColumnarToRow + InputAdapter + Scan parquet default.web_returns [wr_item_sk,wr_order_number,wr_return_amt,wr_net_loss,wr_returned_date_sk] + InputAdapter + ReusedExchange [d_date_sk] #5 + InputAdapter + BroadcastExchange #17 + WholeStageCodegen (26) + Filter [web_site_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_site [web_site_sk,web_site_id] + InputAdapter + ReusedExchange [i_item_sk] #8 + InputAdapter + ReusedExchange [p_promo_sk] #9 + WholeStageCodegen (65) + HashAggregate [channel,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),id,sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange [channel] #18 + WholeStageCodegen (64) + HashAggregate [channel,sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + ReusedExchange [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] #19 + WholeStageCodegen (98) + HashAggregate [sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),channel,id,sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + Exchange #20 + WholeStageCodegen (97) + HashAggregate [sales,returns,profit] [sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty,sum,isEmpty] + HashAggregate [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] [sum(sales),sum(returns),sum(profit),sales,returns,profit,sum,isEmpty,sum,isEmpty,sum,isEmpty] + InputAdapter + ReusedExchange [channel,id,sum,isEmpty,sum,isEmpty,sum,isEmpty] #19 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/explain.txt new file mode 100644 index 0000000000000..64f6270e81183 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/explain.txt @@ -0,0 +1,238 @@ +== Physical Plan == +TakeOrderedAndProject (38) ++- * Project (37) + +- Window (36) + +- * Sort (35) + +- Exchange (34) + +- * HashAggregate (33) + +- Exchange (32) + +- * HashAggregate (31) + +- Union (30) + :- * HashAggregate (19) + : +- Exchange (18) + : +- * HashAggregate (17) + : +- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.web_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.item (11) + :- * HashAggregate (24) + : +- Exchange (23) + : +- * HashAggregate (22) + : +- * HashAggregate (21) + : +- ReusedExchange (20) + +- * HashAggregate (29) + +- Exchange (28) + +- * HashAggregate (27) + +- * HashAggregate (26) + +- ReusedExchange (25) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3] +Condition : isnotnull(ws_item_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1212)) AND (d_month_seq#6 <= 1223)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 3] +Output [2]: [ws_item_sk#1, ws_net_paid#2] +Input [4]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3, d_date_sk#5] + +(11) Scan parquet default.item +Output [3]: [i_item_sk#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [i_item_sk#8, i_class#9, i_category#10] + +(13) Filter [codegen id : 2] +Input [3]: [i_item_sk#8, i_class#9, i_category#10] +Condition : isnotnull(i_item_sk#8) + +(14) BroadcastExchange +Input [3]: [i_item_sk#8, i_class#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_item_sk#1] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [ws_net_paid#2, i_class#9, i_category#10] +Input [5]: [ws_item_sk#1, ws_net_paid#2, i_item_sk#8, i_class#9, i_category#10] + +(17) HashAggregate [codegen id : 3] +Input [3]: [ws_net_paid#2, i_class#9, i_category#10] +Keys [2]: [i_category#10, i_class#9] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#2))] +Aggregate Attributes [1]: [sum#12] +Results [3]: [i_category#10, i_class#9, sum#13] + +(18) Exchange +Input [3]: [i_category#10, i_class#9, sum#13] +Arguments: hashpartitioning(i_category#10, i_class#9, 5), ENSURE_REQUIREMENTS, [id=#14] + +(19) HashAggregate [codegen id : 4] +Input [3]: [i_category#10, i_class#9, sum#13] +Keys [2]: [i_category#10, i_class#9] +Functions [1]: [sum(UnscaledValue(ws_net_paid#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#2))#15] +Results [6]: [cast(MakeDecimal(sum(UnscaledValue(ws_net_paid#2))#15,17,2) as decimal(27,2)) AS total_sum#16, i_category#10, i_class#9, 0 AS g_category#17, 0 AS g_class#18, 0 AS lochierarchy#19] + +(20) ReusedExchange [Reuses operator id: unknown] +Output [3]: [i_category#20, i_class#21, sum#22] + +(21) HashAggregate [codegen id : 8] +Input [3]: [i_category#20, i_class#21, sum#22] +Keys [2]: [i_category#20, i_class#21] +Functions [1]: [sum(UnscaledValue(ws_net_paid#23))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#23))#24] +Results [2]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#23))#24,17,2) AS total_sum#25, i_category#20] + +(22) HashAggregate [codegen id : 8] +Input [2]: [total_sum#25, i_category#20] +Keys [1]: [i_category#20] +Functions [1]: [partial_sum(total_sum#25)] +Aggregate Attributes [2]: [sum#26, isEmpty#27] +Results [3]: [i_category#20, sum#28, isEmpty#29] + +(23) Exchange +Input [3]: [i_category#20, sum#28, isEmpty#29] +Arguments: hashpartitioning(i_category#20, 5), ENSURE_REQUIREMENTS, [id=#30] + +(24) HashAggregate [codegen id : 9] +Input [3]: [i_category#20, sum#28, isEmpty#29] +Keys [1]: [i_category#20] +Functions [1]: [sum(total_sum#25)] +Aggregate Attributes [1]: [sum(total_sum#25)#31] +Results [6]: [sum(total_sum#25)#31 AS total_sum#32, i_category#20, null AS i_class#33, 0 AS g_category#34, 1 AS g_class#35, 1 AS lochierarchy#36] + +(25) ReusedExchange [Reuses operator id: unknown] +Output [3]: [i_category#37, i_class#38, sum#39] + +(26) HashAggregate [codegen id : 13] +Input [3]: [i_category#37, i_class#38, sum#39] +Keys [2]: [i_category#37, i_class#38] +Functions [1]: [sum(UnscaledValue(ws_net_paid#40))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#40))#41] +Results [1]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#40))#41,17,2) AS total_sum#25] + +(27) HashAggregate [codegen id : 13] +Input [1]: [total_sum#25] +Keys: [] +Functions [1]: [partial_sum(total_sum#25)] +Aggregate Attributes [2]: [sum#42, isEmpty#43] +Results [2]: [sum#44, isEmpty#45] + +(28) Exchange +Input [2]: [sum#44, isEmpty#45] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#46] + +(29) HashAggregate [codegen id : 14] +Input [2]: [sum#44, isEmpty#45] +Keys: [] +Functions [1]: [sum(total_sum#25)] +Aggregate Attributes [1]: [sum(total_sum#25)#47] +Results [6]: [sum(total_sum#25)#47 AS total_sum#48, null AS i_category#49, null AS i_class#50, 1 AS g_category#51, 1 AS g_class#52, 2 AS lochierarchy#53] + +(30) Union + +(31) HashAggregate [codegen id : 15] +Input [6]: [total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19] +Keys [6]: [total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19] +Functions: [] +Aggregate Attributes: [] +Results [6]: [total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19] + +(32) Exchange +Input [6]: [total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19] +Arguments: hashpartitioning(total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19, 5), ENSURE_REQUIREMENTS, [id=#54] + +(33) HashAggregate [codegen id : 16] +Input [6]: [total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19] +Keys [6]: [total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19] +Functions: [] +Aggregate Attributes: [] +Results [5]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, CASE WHEN (g_class#18 = 0) THEN i_category#10 END AS _w0#55] + +(34) Exchange +Input [5]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, _w0#55] +Arguments: hashpartitioning(lochierarchy#19, _w0#55, 5), ENSURE_REQUIREMENTS, [id=#56] + +(35) Sort [codegen id : 17] +Input [5]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, _w0#55] +Arguments: [lochierarchy#19 ASC NULLS FIRST, _w0#55 ASC NULLS FIRST, total_sum#16 DESC NULLS LAST], false, 0 + +(36) Window +Input [5]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, _w0#55] +Arguments: [rank(total_sum#16) windowspecdefinition(lochierarchy#19, _w0#55, total_sum#16 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#57], [lochierarchy#19, _w0#55], [total_sum#16 DESC NULLS LAST] + +(37) Project [codegen id : 18] +Output [5]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, rank_within_parent#57] +Input [6]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, _w0#55, rank_within_parent#57] + +(38) TakeOrderedAndProject +Input [5]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, rank_within_parent#57] +Arguments: 100, [lochierarchy#19 DESC NULLS LAST, CASE WHEN (lochierarchy#19 = 0) THEN i_category#10 END ASC NULLS FIRST, rank_within_parent#57 ASC NULLS FIRST], [total_sum#16, i_category#10, i_class#9, lochierarchy#19, rank_within_parent#57] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (39) + + +(39) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/simplified.txt new file mode 100644 index 0000000000000..6070dbc29fa6f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a.sf100/simplified.txt @@ -0,0 +1,66 @@ +TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,total_sum,i_class] + WholeStageCodegen (18) + Project [total_sum,i_category,i_class,lochierarchy,rank_within_parent] + InputAdapter + Window [total_sum,lochierarchy,_w0] + WholeStageCodegen (17) + Sort [lochierarchy,_w0,total_sum] + InputAdapter + Exchange [lochierarchy,_w0] #1 + WholeStageCodegen (16) + HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] [_w0] + InputAdapter + Exchange [total_sum,i_category,i_class,g_category,g_class,lochierarchy] #2 + WholeStageCodegen (15) + HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] + InputAdapter + Union + WholeStageCodegen (4) + HashAggregate [i_category,i_class,sum] [sum(UnscaledValue(ws_net_paid)),total_sum,g_category,g_class,lochierarchy,sum] + InputAdapter + Exchange [i_category,i_class] #3 + WholeStageCodegen (3) + HashAggregate [i_category,i_class,ws_net_paid] [sum,sum] + Project [ws_net_paid,i_class,i_category] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_net_paid] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_net_paid,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_class,i_category] + WholeStageCodegen (9) + HashAggregate [i_category,sum,isEmpty] [sum(total_sum),total_sum,i_class,g_category,g_class,lochierarchy,sum,isEmpty] + InputAdapter + Exchange [i_category] #6 + WholeStageCodegen (8) + HashAggregate [i_category,total_sum] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,sum] [sum(UnscaledValue(ws_net_paid)),total_sum,sum] + InputAdapter + ReusedExchange [i_category,i_class,sum] #7 + WholeStageCodegen (14) + HashAggregate [sum,isEmpty] [sum(total_sum),total_sum,i_category,i_class,g_category,g_class,lochierarchy,sum,isEmpty] + InputAdapter + Exchange #8 + WholeStageCodegen (13) + HashAggregate [total_sum] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,sum] [sum(UnscaledValue(ws_net_paid)),total_sum,sum] + InputAdapter + ReusedExchange [i_category,i_class,sum] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/explain.txt new file mode 100644 index 0000000000000..64f6270e81183 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/explain.txt @@ -0,0 +1,238 @@ +== Physical Plan == +TakeOrderedAndProject (38) ++- * Project (37) + +- Window (36) + +- * Sort (35) + +- Exchange (34) + +- * HashAggregate (33) + +- Exchange (32) + +- * HashAggregate (31) + +- Union (30) + :- * HashAggregate (19) + : +- Exchange (18) + : +- * HashAggregate (17) + : +- * Project (16) + : +- * BroadcastHashJoin Inner BuildRight (15) + : :- * Project (10) + : : +- * BroadcastHashJoin Inner BuildRight (9) + : : :- * Filter (3) + : : : +- * ColumnarToRow (2) + : : : +- Scan parquet default.web_sales (1) + : : +- BroadcastExchange (8) + : : +- * Project (7) + : : +- * Filter (6) + : : +- * ColumnarToRow (5) + : : +- Scan parquet default.date_dim (4) + : +- BroadcastExchange (14) + : +- * Filter (13) + : +- * ColumnarToRow (12) + : +- Scan parquet default.item (11) + :- * HashAggregate (24) + : +- Exchange (23) + : +- * HashAggregate (22) + : +- * HashAggregate (21) + : +- ReusedExchange (20) + +- * HashAggregate (29) + +- Exchange (28) + +- * HashAggregate (27) + +- * HashAggregate (26) + +- ReusedExchange (25) + + +(1) Scan parquet default.web_sales +Output [3]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ws_sold_date_sk#3), dynamicpruningexpression(ws_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ws_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3] +Condition : isnotnull(ws_item_sk#1) + +(4) Scan parquet default.date_dim +Output [2]: [d_date_sk#5, d_month_seq#6] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_month_seq), GreaterThanOrEqual(d_month_seq,1212), LessThanOrEqual(d_month_seq,1223), IsNotNull(d_date_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(6) Filter [codegen id : 1] +Input [2]: [d_date_sk#5, d_month_seq#6] +Condition : (((isnotnull(d_month_seq#6) AND (d_month_seq#6 >= 1212)) AND (d_month_seq#6 <= 1223)) AND isnotnull(d_date_sk#5)) + +(7) Project [codegen id : 1] +Output [1]: [d_date_sk#5] +Input [2]: [d_date_sk#5, d_month_seq#6] + +(8) BroadcastExchange +Input [1]: [d_date_sk#5] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#7] + +(9) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_sold_date_sk#3] +Right keys [1]: [d_date_sk#5] +Join condition: None + +(10) Project [codegen id : 3] +Output [2]: [ws_item_sk#1, ws_net_paid#2] +Input [4]: [ws_item_sk#1, ws_net_paid#2, ws_sold_date_sk#3, d_date_sk#5] + +(11) Scan parquet default.item +Output [3]: [i_item_sk#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [IsNotNull(i_item_sk)] +ReadSchema: struct + +(12) ColumnarToRow [codegen id : 2] +Input [3]: [i_item_sk#8, i_class#9, i_category#10] + +(13) Filter [codegen id : 2] +Input [3]: [i_item_sk#8, i_class#9, i_category#10] +Condition : isnotnull(i_item_sk#8) + +(14) BroadcastExchange +Input [3]: [i_item_sk#8, i_class#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ws_item_sk#1] +Right keys [1]: [i_item_sk#8] +Join condition: None + +(16) Project [codegen id : 3] +Output [3]: [ws_net_paid#2, i_class#9, i_category#10] +Input [5]: [ws_item_sk#1, ws_net_paid#2, i_item_sk#8, i_class#9, i_category#10] + +(17) HashAggregate [codegen id : 3] +Input [3]: [ws_net_paid#2, i_class#9, i_category#10] +Keys [2]: [i_category#10, i_class#9] +Functions [1]: [partial_sum(UnscaledValue(ws_net_paid#2))] +Aggregate Attributes [1]: [sum#12] +Results [3]: [i_category#10, i_class#9, sum#13] + +(18) Exchange +Input [3]: [i_category#10, i_class#9, sum#13] +Arguments: hashpartitioning(i_category#10, i_class#9, 5), ENSURE_REQUIREMENTS, [id=#14] + +(19) HashAggregate [codegen id : 4] +Input [3]: [i_category#10, i_class#9, sum#13] +Keys [2]: [i_category#10, i_class#9] +Functions [1]: [sum(UnscaledValue(ws_net_paid#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#2))#15] +Results [6]: [cast(MakeDecimal(sum(UnscaledValue(ws_net_paid#2))#15,17,2) as decimal(27,2)) AS total_sum#16, i_category#10, i_class#9, 0 AS g_category#17, 0 AS g_class#18, 0 AS lochierarchy#19] + +(20) ReusedExchange [Reuses operator id: unknown] +Output [3]: [i_category#20, i_class#21, sum#22] + +(21) HashAggregate [codegen id : 8] +Input [3]: [i_category#20, i_class#21, sum#22] +Keys [2]: [i_category#20, i_class#21] +Functions [1]: [sum(UnscaledValue(ws_net_paid#23))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#23))#24] +Results [2]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#23))#24,17,2) AS total_sum#25, i_category#20] + +(22) HashAggregate [codegen id : 8] +Input [2]: [total_sum#25, i_category#20] +Keys [1]: [i_category#20] +Functions [1]: [partial_sum(total_sum#25)] +Aggregate Attributes [2]: [sum#26, isEmpty#27] +Results [3]: [i_category#20, sum#28, isEmpty#29] + +(23) Exchange +Input [3]: [i_category#20, sum#28, isEmpty#29] +Arguments: hashpartitioning(i_category#20, 5), ENSURE_REQUIREMENTS, [id=#30] + +(24) HashAggregate [codegen id : 9] +Input [3]: [i_category#20, sum#28, isEmpty#29] +Keys [1]: [i_category#20] +Functions [1]: [sum(total_sum#25)] +Aggregate Attributes [1]: [sum(total_sum#25)#31] +Results [6]: [sum(total_sum#25)#31 AS total_sum#32, i_category#20, null AS i_class#33, 0 AS g_category#34, 1 AS g_class#35, 1 AS lochierarchy#36] + +(25) ReusedExchange [Reuses operator id: unknown] +Output [3]: [i_category#37, i_class#38, sum#39] + +(26) HashAggregate [codegen id : 13] +Input [3]: [i_category#37, i_class#38, sum#39] +Keys [2]: [i_category#37, i_class#38] +Functions [1]: [sum(UnscaledValue(ws_net_paid#40))] +Aggregate Attributes [1]: [sum(UnscaledValue(ws_net_paid#40))#41] +Results [1]: [MakeDecimal(sum(UnscaledValue(ws_net_paid#40))#41,17,2) AS total_sum#25] + +(27) HashAggregate [codegen id : 13] +Input [1]: [total_sum#25] +Keys: [] +Functions [1]: [partial_sum(total_sum#25)] +Aggregate Attributes [2]: [sum#42, isEmpty#43] +Results [2]: [sum#44, isEmpty#45] + +(28) Exchange +Input [2]: [sum#44, isEmpty#45] +Arguments: SinglePartition, ENSURE_REQUIREMENTS, [id=#46] + +(29) HashAggregate [codegen id : 14] +Input [2]: [sum#44, isEmpty#45] +Keys: [] +Functions [1]: [sum(total_sum#25)] +Aggregate Attributes [1]: [sum(total_sum#25)#47] +Results [6]: [sum(total_sum#25)#47 AS total_sum#48, null AS i_category#49, null AS i_class#50, 1 AS g_category#51, 1 AS g_class#52, 2 AS lochierarchy#53] + +(30) Union + +(31) HashAggregate [codegen id : 15] +Input [6]: [total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19] +Keys [6]: [total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19] +Functions: [] +Aggregate Attributes: [] +Results [6]: [total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19] + +(32) Exchange +Input [6]: [total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19] +Arguments: hashpartitioning(total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19, 5), ENSURE_REQUIREMENTS, [id=#54] + +(33) HashAggregate [codegen id : 16] +Input [6]: [total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19] +Keys [6]: [total_sum#16, i_category#10, i_class#9, g_category#17, g_class#18, lochierarchy#19] +Functions: [] +Aggregate Attributes: [] +Results [5]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, CASE WHEN (g_class#18 = 0) THEN i_category#10 END AS _w0#55] + +(34) Exchange +Input [5]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, _w0#55] +Arguments: hashpartitioning(lochierarchy#19, _w0#55, 5), ENSURE_REQUIREMENTS, [id=#56] + +(35) Sort [codegen id : 17] +Input [5]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, _w0#55] +Arguments: [lochierarchy#19 ASC NULLS FIRST, _w0#55 ASC NULLS FIRST, total_sum#16 DESC NULLS LAST], false, 0 + +(36) Window +Input [5]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, _w0#55] +Arguments: [rank(total_sum#16) windowspecdefinition(lochierarchy#19, _w0#55, total_sum#16 DESC NULLS LAST, specifiedwindowframe(RowFrame, unboundedpreceding$(), currentrow$())) AS rank_within_parent#57], [lochierarchy#19, _w0#55], [total_sum#16 DESC NULLS LAST] + +(37) Project [codegen id : 18] +Output [5]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, rank_within_parent#57] +Input [6]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, _w0#55, rank_within_parent#57] + +(38) TakeOrderedAndProject +Input [5]: [total_sum#16, i_category#10, i_class#9, lochierarchy#19, rank_within_parent#57] +Arguments: 100, [lochierarchy#19 DESC NULLS LAST, CASE WHEN (lochierarchy#19 = 0) THEN i_category#10 END ASC NULLS FIRST, rank_within_parent#57 ASC NULLS FIRST], [total_sum#16, i_category#10, i_class#9, lochierarchy#19, rank_within_parent#57] + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ws_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (39) + + +(39) ReusedExchange [Reuses operator id: 8] +Output [1]: [d_date_sk#5] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/simplified.txt new file mode 100644 index 0000000000000..6070dbc29fa6f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q86a/simplified.txt @@ -0,0 +1,66 @@ +TakeOrderedAndProject [lochierarchy,i_category,rank_within_parent,total_sum,i_class] + WholeStageCodegen (18) + Project [total_sum,i_category,i_class,lochierarchy,rank_within_parent] + InputAdapter + Window [total_sum,lochierarchy,_w0] + WholeStageCodegen (17) + Sort [lochierarchy,_w0,total_sum] + InputAdapter + Exchange [lochierarchy,_w0] #1 + WholeStageCodegen (16) + HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] [_w0] + InputAdapter + Exchange [total_sum,i_category,i_class,g_category,g_class,lochierarchy] #2 + WholeStageCodegen (15) + HashAggregate [total_sum,i_category,i_class,g_category,g_class,lochierarchy] + InputAdapter + Union + WholeStageCodegen (4) + HashAggregate [i_category,i_class,sum] [sum(UnscaledValue(ws_net_paid)),total_sum,g_category,g_class,lochierarchy,sum] + InputAdapter + Exchange [i_category,i_class] #3 + WholeStageCodegen (3) + HashAggregate [i_category,i_class,ws_net_paid] [sum,sum] + Project [ws_net_paid,i_class,i_category] + BroadcastHashJoin [ws_item_sk,i_item_sk] + Project [ws_item_sk,ws_net_paid] + BroadcastHashJoin [ws_sold_date_sk,d_date_sk] + Filter [ws_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.web_sales [ws_item_sk,ws_net_paid,ws_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (1) + Project [d_date_sk] + Filter [d_month_seq,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_month_seq] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (2) + Filter [i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_class,i_category] + WholeStageCodegen (9) + HashAggregate [i_category,sum,isEmpty] [sum(total_sum),total_sum,i_class,g_category,g_class,lochierarchy,sum,isEmpty] + InputAdapter + Exchange [i_category] #6 + WholeStageCodegen (8) + HashAggregate [i_category,total_sum] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,sum] [sum(UnscaledValue(ws_net_paid)),total_sum,sum] + InputAdapter + ReusedExchange [i_category,i_class,sum] #7 + WholeStageCodegen (14) + HashAggregate [sum,isEmpty] [sum(total_sum),total_sum,i_category,i_class,g_category,g_class,lochierarchy,sum,isEmpty] + InputAdapter + Exchange #8 + WholeStageCodegen (13) + HashAggregate [total_sum] [sum,isEmpty,sum,isEmpty] + HashAggregate [i_category,i_class,sum] [sum(UnscaledValue(ws_net_paid)),total_sum,sum] + InputAdapter + ReusedExchange [i_category,i_class,sum] #7 diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt new file mode 100644 index 0000000000000..33d4b7d49e1d0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/explain.txt @@ -0,0 +1,168 @@ +== Physical Plan == +* Sort (28) ++- Exchange (27) + +- * Project (26) + +- Window (25) + +- * Sort (24) + +- Exchange (23) + +- * HashAggregate (22) + +- Exchange (21) + +- * HashAggregate (20) + +- * Project (19) + +- * BroadcastHashJoin Inner BuildRight (18) + :- * Project (12) + : +- * SortMergeJoin Inner (11) + : :- * Sort (5) + : : +- Exchange (4) + : : +- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- * Sort (10) + : +- Exchange (9) + : +- * Filter (8) + : +- * ColumnarToRow (7) + : +- Scan parquet default.item (6) + +- BroadcastExchange (17) + +- * Project (16) + +- * Filter (15) + +- * ColumnarToRow (14) + +- Scan parquet default.date_dim (13) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 1] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 1] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Exchange +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Arguments: hashpartitioning(ss_item_sk#1, 5), ENSURE_REQUIREMENTS, [id=#5] + +(5) Sort [codegen id : 2] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Arguments: [ss_item_sk#1 ASC NULLS FIRST], false, 0 + +(6) Scan parquet default.item +Output [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports ,Books ,Home ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(7) ColumnarToRow [codegen id : 3] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] + +(8) Filter [codegen id : 3] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Condition : (i_category#11 IN (Sports ,Books ,Home ) AND isnotnull(i_item_sk#6)) + +(9) Exchange +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Arguments: hashpartitioning(i_item_sk#6, 5), ENSURE_REQUIREMENTS, [id=#12] + +(10) Sort [codegen id : 4] +Input [6]: [i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Arguments: [i_item_sk#6 ASC NULLS FIRST], false, 0 + +(11) SortMergeJoin [codegen id : 6] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#6] +Join condition: None + +(12) Project [codegen id : 6] +Output [7]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Input [9]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_sk#6, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] + +(13) Scan parquet default.date_dim +Output [2]: [d_date_sk#13, d_date#14] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(14) ColumnarToRow [codegen id : 5] +Input [2]: [d_date_sk#13, d_date#14] + +(15) Filter [codegen id : 5] +Input [2]: [d_date_sk#13, d_date#14] +Condition : (((isnotnull(d_date#14) AND (d_date#14 >= 1999-02-22)) AND (d_date#14 <= 1999-03-24)) AND isnotnull(d_date_sk#13)) + +(16) Project [codegen id : 5] +Output [1]: [d_date_sk#13] +Input [2]: [d_date_sk#13, d_date#14] + +(17) BroadcastExchange +Input [1]: [d_date_sk#13] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#15] + +(18) BroadcastHashJoin [codegen id : 6] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#13] +Join condition: None + +(19) Project [codegen id : 6] +Output [6]: [ss_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Input [8]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11, d_date_sk#13] + +(20) HashAggregate [codegen id : 6] +Input [6]: [ss_ext_sales_price#2, i_item_id#7, i_item_desc#8, i_current_price#9, i_class#10, i_category#11] +Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#16] +Results [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] + +(21) Exchange +Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] +Arguments: hashpartitioning(i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, 5), ENSURE_REQUIREMENTS, [id=#18] + +(22) HashAggregate [codegen id : 7] +Input [6]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, sum#17] +Keys [5]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#19] +Results [8]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#19,17,2) AS itemrevenue#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#19,17,2) AS _w0#21, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#19,17,2) AS _w1#22] + +(23) Exchange +Input [8]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22] +Arguments: hashpartitioning(i_class#10, 5), ENSURE_REQUIREMENTS, [id=#23] + +(24) Sort [codegen id : 8] +Input [8]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22] +Arguments: [i_class#10 ASC NULLS FIRST], false, 0 + +(25) Window +Input [8]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22] +Arguments: [sum(_w1#22) windowspecdefinition(i_class#10, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#24], [i_class#10] + +(26) Project [codegen id : 9] +Output [7]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#21) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#24)), DecimalType(38,17), true) AS revenueratio#25] +Input [9]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, _w0#21, _w1#22, _we0#24] + +(27) Exchange +Input [7]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25] +Arguments: rangepartitioning(i_category#11 ASC NULLS FIRST, i_class#10 ASC NULLS FIRST, i_item_id#7 ASC NULLS FIRST, i_item_desc#8 ASC NULLS FIRST, revenueratio#25 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#26] + +(28) Sort [codegen id : 10] +Input [7]: [i_item_id#7, i_item_desc#8, i_category#11, i_class#10, i_current_price#9, itemrevenue#20, revenueratio#25] +Arguments: [i_category#11 ASC NULLS FIRST, i_class#10 ASC NULLS FIRST, i_item_id#7 ASC NULLS FIRST, i_item_desc#8 ASC NULLS FIRST, revenueratio#25 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (29) + + +(29) ReusedExchange [Reuses operator id: 17] +Output [1]: [d_date_sk#13] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/simplified.txt new file mode 100644 index 0000000000000..45e9e64099cb7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98.sf100/simplified.txt @@ -0,0 +1,52 @@ +WholeStageCodegen (10) + Sort [i_category,i_class,i_item_id,i_item_desc,revenueratio] + InputAdapter + Exchange [i_category,i_class,i_item_id,i_item_desc,revenueratio] #1 + WholeStageCodegen (9) + Project [i_item_id,i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (8) + Sort [i_class] + InputAdapter + Exchange [i_class] #2 + WholeStageCodegen (7) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(ss_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #3 + WholeStageCodegen (6) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_ext_sales_price,ss_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + SortMergeJoin [ss_item_sk,i_item_sk] + InputAdapter + WholeStageCodegen (2) + Sort [ss_item_sk] + InputAdapter + Exchange [ss_item_sk] #4 + WholeStageCodegen (1) + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #5 + InputAdapter + WholeStageCodegen (4) + Sort [i_item_sk] + InputAdapter + Exchange [i_item_sk] #6 + WholeStageCodegen (3) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (5) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98/explain.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98/explain.txt new file mode 100644 index 0000000000000..b7c5f4081a1f3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98/explain.txt @@ -0,0 +1,153 @@ +== Physical Plan == +* Sort (25) ++- Exchange (24) + +- * Project (23) + +- Window (22) + +- * Sort (21) + +- Exchange (20) + +- * HashAggregate (19) + +- Exchange (18) + +- * HashAggregate (17) + +- * Project (16) + +- * BroadcastHashJoin Inner BuildRight (15) + :- * Project (9) + : +- * BroadcastHashJoin Inner BuildRight (8) + : :- * Filter (3) + : : +- * ColumnarToRow (2) + : : +- Scan parquet default.store_sales (1) + : +- BroadcastExchange (7) + : +- * Filter (6) + : +- * ColumnarToRow (5) + : +- Scan parquet default.item (4) + +- BroadcastExchange (14) + +- * Project (13) + +- * Filter (12) + +- * ColumnarToRow (11) + +- Scan parquet default.date_dim (10) + + +(1) Scan parquet default.store_sales +Output [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Batched: true +Location: InMemoryFileIndex [] +PartitionFilters: [isnotnull(ss_sold_date_sk#3), dynamicpruningexpression(ss_sold_date_sk#3 IN dynamicpruning#4)] +PushedFilters: [IsNotNull(ss_item_sk)] +ReadSchema: struct + +(2) ColumnarToRow [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] + +(3) Filter [codegen id : 3] +Input [3]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3] +Condition : isnotnull(ss_item_sk#1) + +(4) Scan parquet default.item +Output [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Batched: true +Location [not included in comparison]/{warehouse_dir}/item] +PushedFilters: [In(i_category, [Sports ,Books ,Home ]), IsNotNull(i_item_sk)] +ReadSchema: struct + +(5) ColumnarToRow [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(6) Filter [codegen id : 1] +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Condition : (i_category#10 IN (Sports ,Books ,Home ) AND isnotnull(i_item_sk#5)) + +(7) BroadcastExchange +Input [6]: [i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, false] as bigint)),false), [id=#11] + +(8) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_item_sk#1] +Right keys [1]: [i_item_sk#5] +Join condition: None + +(9) Project [codegen id : 3] +Output [7]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [9]: [ss_item_sk#1, ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_sk#5, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] + +(10) Scan parquet default.date_dim +Output [2]: [d_date_sk#12, d_date#13] +Batched: true +Location [not included in comparison]/{warehouse_dir}/date_dim] +PushedFilters: [IsNotNull(d_date), GreaterThanOrEqual(d_date,1999-02-22), LessThanOrEqual(d_date,1999-03-24), IsNotNull(d_date_sk)] +ReadSchema: struct + +(11) ColumnarToRow [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] + +(12) Filter [codegen id : 2] +Input [2]: [d_date_sk#12, d_date#13] +Condition : (((isnotnull(d_date#13) AND (d_date#13 >= 1999-02-22)) AND (d_date#13 <= 1999-03-24)) AND isnotnull(d_date_sk#12)) + +(13) Project [codegen id : 2] +Output [1]: [d_date_sk#12] +Input [2]: [d_date_sk#12, d_date#13] + +(14) BroadcastExchange +Input [1]: [d_date_sk#12] +Arguments: HashedRelationBroadcastMode(List(cast(input[0, int, true] as bigint)),false), [id=#14] + +(15) BroadcastHashJoin [codegen id : 3] +Left keys [1]: [ss_sold_date_sk#3] +Right keys [1]: [d_date_sk#12] +Join condition: None + +(16) Project [codegen id : 3] +Output [6]: [ss_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Input [8]: [ss_ext_sales_price#2, ss_sold_date_sk#3, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10, d_date_sk#12] + +(17) HashAggregate [codegen id : 3] +Input [6]: [ss_ext_sales_price#2, i_item_id#6, i_item_desc#7, i_current_price#8, i_class#9, i_category#10] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [partial_sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum#15] +Results [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] + +(18) Exchange +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Arguments: hashpartitioning(i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, 5), ENSURE_REQUIREMENTS, [id=#17] + +(19) HashAggregate [codegen id : 4] +Input [6]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, sum#16] +Keys [5]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8] +Functions [1]: [sum(UnscaledValue(ss_ext_sales_price#2))] +Aggregate Attributes [1]: [sum(UnscaledValue(ss_ext_sales_price#2))#18] +Results [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#18,17,2) AS itemrevenue#19, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#18,17,2) AS _w0#20, MakeDecimal(sum(UnscaledValue(ss_ext_sales_price#2))#18,17,2) AS _w1#21] + +(20) Exchange +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: hashpartitioning(i_class#9, 5), ENSURE_REQUIREMENTS, [id=#22] + +(21) Sort [codegen id : 5] +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: [i_class#9 ASC NULLS FIRST], false, 0 + +(22) Window +Input [8]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21] +Arguments: [sum(_w1#21) windowspecdefinition(i_class#9, specifiedwindowframe(RowFrame, unboundedpreceding$(), unboundedfollowing$())) AS _we0#23], [i_class#9] + +(23) Project [codegen id : 6] +Output [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, CheckOverflow((promote_precision(cast(CheckOverflow((promote_precision(_w0#20) * 100.00), DecimalType(21,2), true) as decimal(27,2))) / promote_precision(_we0#23)), DecimalType(38,17), true) AS revenueratio#24] +Input [9]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, _w0#20, _w1#21, _we0#23] + +(24) Exchange +Input [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Arguments: rangepartitioning(i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST, 5), ENSURE_REQUIREMENTS, [id=#25] + +(25) Sort [codegen id : 7] +Input [7]: [i_item_id#6, i_item_desc#7, i_category#10, i_class#9, i_current_price#8, itemrevenue#19, revenueratio#24] +Arguments: [i_category#10 ASC NULLS FIRST, i_class#9 ASC NULLS FIRST, i_item_id#6 ASC NULLS FIRST, i_item_desc#7 ASC NULLS FIRST, revenueratio#24 ASC NULLS FIRST], true, 0 + +===== Subqueries ===== + +Subquery:1 Hosting operator id = 1 Hosting Expression = ss_sold_date_sk#3 IN dynamicpruning#4 +ReusedExchange (26) + + +(26) ReusedExchange [Reuses operator id: 14] +Output [1]: [d_date_sk#12] + + diff --git a/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98/simplified.txt b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98/simplified.txt new file mode 100644 index 0000000000000..68157d791c3fc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-plan-stability/approved-plans-v2_7/q98/simplified.txt @@ -0,0 +1,43 @@ +WholeStageCodegen (7) + Sort [i_category,i_class,i_item_id,i_item_desc,revenueratio] + InputAdapter + Exchange [i_category,i_class,i_item_id,i_item_desc,revenueratio] #1 + WholeStageCodegen (6) + Project [i_item_id,i_item_desc,i_category,i_class,i_current_price,itemrevenue,_w0,_we0] + InputAdapter + Window [_w1,i_class] + WholeStageCodegen (5) + Sort [i_class] + InputAdapter + Exchange [i_class] #2 + WholeStageCodegen (4) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,sum] [sum(UnscaledValue(ss_ext_sales_price)),itemrevenue,_w0,_w1,sum] + InputAdapter + Exchange [i_item_id,i_item_desc,i_category,i_class,i_current_price] #3 + WholeStageCodegen (3) + HashAggregate [i_item_id,i_item_desc,i_category,i_class,i_current_price,ss_ext_sales_price] [sum,sum] + Project [ss_ext_sales_price,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ss_sold_date_sk,d_date_sk] + Project [ss_ext_sales_price,ss_sold_date_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + BroadcastHashJoin [ss_item_sk,i_item_sk] + Filter [ss_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.store_sales [ss_item_sk,ss_ext_sales_price,ss_sold_date_sk] + SubqueryBroadcast [d_date_sk] #1 + ReusedExchange [d_date_sk] #4 + InputAdapter + BroadcastExchange #5 + WholeStageCodegen (1) + Filter [i_category,i_item_sk] + ColumnarToRow + InputAdapter + Scan parquet default.item [i_item_sk,i_item_id,i_item_desc,i_current_price,i_class,i_category] + InputAdapter + BroadcastExchange #4 + WholeStageCodegen (2) + Project [d_date_sk] + Filter [d_date,d_date_sk] + ColumnarToRow + InputAdapter + Scan parquet default.date_dim [d_date_sk,d_date] diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q1.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q1.sql.out new file mode 100644 index 0000000000000..d3b808c48dc2d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q1.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAAAABAAAA +AAAAAAAAAAAHBAAA +AAAAAAAAAAAMAAAA +AAAAAAAAAAAOAAAA +AAAAAAAAAABCBAAA +AAAAAAAAAABEAAAA +AAAAAAAAAABFAAAA +AAAAAAAAAACFBAAA +AAAAAAAAAACFBAAA +AAAAAAAAAADBBAAA +AAAAAAAAAADOAAAA +AAAAAAAAAADPAAAA +AAAAAAAAAAEABAAA +AAAAAAAAAAEEAAAA +AAAAAAAAAAEGBAAA +AAAAAAAAAAENAAAA +AAAAAAAAAAFCBAAA +AAAAAAAAAAFEBAAA +AAAAAAAAAAFGAAAA +AAAAAAAAAAFLAAAA +AAAAAAAAAAFPAAAA +AAAAAAAAAAGCAAAA +AAAAAAAAAAGEAAAA +AAAAAAAAAAGIBAAA +AAAAAAAAAAGOAAAA +AAAAAAAAAAHABAAA +AAAAAAAAAAHGBAAA +AAAAAAAAAAHHAAAA +AAAAAAAAAAHMAAAA +AAAAAAAAAAHPAAAA +AAAAAAAAAAHPAAAA +AAAAAAAAAAHPAAAA +AAAAAAAAAAJAAAAA +AAAAAAAAAAJEBAAA +AAAAAAAAAAJMAAAA +AAAAAAAAAAJPAAAA +AAAAAAAAAAKBBAAA +AAAAAAAAAAKGBAAA +AAAAAAAAAAKHBAAA +AAAAAAAAAAKLAAAA +AAAAAAAAAALCAAAA +AAAAAAAAAALJAAAA +AAAAAAAAAALJAAAA +AAAAAAAAAAMABAAA +AAAAAAAAAAMGAAAA +AAAAAAAAAAMLAAAA +AAAAAAAAAAMMAAAA +AAAAAAAAAANHBAAA +AAAAAAAAAANMAAAA +AAAAAAAAAAOBBAAA +AAAAAAAAAAPDAAAA +AAAAAAAAAAPKAAAA +AAAAAAAAAAPLAAAA +AAAAAAAAABANAAAA +AAAAAAAAABCCBAAA +AAAAAAAAABCGAAAA +AAAAAAAAABDABAAA +AAAAAAAAABDBAAAA +AAAAAAAAABDEAAAA +AAAAAAAAABDEBAAA +AAAAAAAAABDEBAAA +AAAAAAAAABDFBAAA +AAAAAAAAABDOAAAA +AAAAAAAAABDOAAAA +AAAAAAAAABEBBAAA +AAAAAAAAABEDAAAA +AAAAAAAAABEEAAAA +AAAAAAAAABEEBAAA +AAAAAAAAABEIBAAA +AAAAAAAAABEOAAAA +AAAAAAAAABFFBAAA +AAAAAAAAABFHAAAA +AAAAAAAAABFNAAAA +AAAAAAAAABFOAAAA +AAAAAAAAABGAAAAA +AAAAAAAAABHDBAAA +AAAAAAAAABHGAAAA +AAAAAAAAABHGBAAA +AAAAAAAAABHLAAAA +AAAAAAAAABIAAAAA +AAAAAAAAABIBAAAA +AAAAAAAAABIDBAAA +AAAAAAAAABIEBAAA +AAAAAAAAABKLAAAA +AAAAAAAAABKNAAAA +AAAAAAAAABKNAAAA +AAAAAAAAABLJAAAA +AAAAAAAAABLNAAAA +AAAAAAAAABMAAAAA +AAAAAAAAABMEBAAA +AAAAAAAAABMPAAAA +AAAAAAAAABNABAAA +AAAAAAAAABNBAAAA +AAAAAAAAABNEAAAA +AAAAAAAAABNEAAAA +AAAAAAAAABNGAAAA +AAAAAAAAABNNAAAA +AAAAAAAAABOEAAAA +AAAAAAAAABOGBAAA +AAAAAAAAABPABAAA diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q10.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q10.sql.out new file mode 100644 index 0000000000000..195c969028573 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q10.sql.out @@ -0,0 +1,11 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +F W 4 yr Degree 1 4000 1 Low Risk 1 4 1 6 1 4 1 +M D 4 yr Degree 1 1500 1 Low Risk 1 3 1 4 1 2 1 +M S College 1 4500 1 High Risk 1 3 1 4 1 3 1 +M S Primary 1 9500 1 Low Risk 1 3 1 0 1 6 1 +M S Secondary 1 3000 1 High Risk 1 1 1 1 1 4 1 +M U 4 yr Degree 1 2000 1 Low Risk 1 3 1 1 1 3 1 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q11.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q11.sql.out new file mode 100644 index 0000000000000..8e02562680cf9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q11.sql.out @@ -0,0 +1,99 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL +NULL +NULL +NULL +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +N +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y +Y diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q12.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q12.sql.out new file mode 100644 index 0000000000000..92e6e202b7a33 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q12.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +Precisely elderly bodies Books arts 1.40 11.21 0.01417562243122168 +Great, contemporary workers would not remove of course cultural values. Then due children might see positive seconds. Significant problems w Books arts 0.55 515.52 0.65190159462474560 +Forward psychological plants establish closely yet eastern changes. Likewise necessary techniques might drop. Pleasant operations like lonely things; dogs let regions. Forces might not result clearl Books arts 2.43 11462.46 14.49487110552909973 +Black, following services justify by a investors; dirty, different charts will fly however prizes. Temporary, l Books arts 5.56 3400.60 4.30023386615632740 +United, important objectives put similarly large, previous phenomena; old, present days receive. Happy detectives assi Books arts 1.26 784.30 0.99178774958137022 +Naturally new years put serious, negative vehicles. Fin Books arts 3.34 3319.96 4.19826043236027781 +Hard different differences would not paint even. Together suitable schemes marry directly only open women. Social ca Books arts 2.65 229.68 0.29044219090124839 +Anonymous, useful women provoke slightly present persons. Ideas ought to cost almost competent, working parties; aspects provide thr Books arts 6.73 5752.44 7.27425669029944833 +Powerful walls will find; there scottish decades must not Books arts 4.16 434.76 0.54977641464745189 +Careful privileges ought to live rather to a boards. Possible, broad p Books arts 3.93 969.48 1.22595739827125692 +Aside legitimate decisions may not stand probably sexual g Books arts 3.88 349.20 0.44158138742039332 +Specially interesting crews continue current, foreign directions; only social men would not call at least political children; circumstances could not understand now in a assessme Books arts 2.13 3343.99 4.22864760515441312 +Unlikely states take later in general extra inf Books arts 0.32 20046.98 25.35043883731064290 +Inches may lose from a problems. Firm, other corporations shall protect ashamed, important practices. Materials shall not make then by a police. Weeks used Books arts 0.84 11869.78 15.00994822673206253 +Relevant lips take so sure, manufacturing Books arts 8.80 5995.28 7.58134037907713537 +Extra, primitive weeks look obviou Books arts 1.18 425.89 0.53855984275049058 +More than key reasons should remain. Words used to offer slowly british Books arts 0.28 7814.52 9.88186306879843074 +Children may turn also above, historical aspects. Surveys migh Books arts 7.22 544.72 0.68882649872748182 +Trustees know operations. Now past issues cut today german governments. British lines go critical, individual structures. Tonight adequate problems should no Books arts 4.05 152.67 0.19305907908783347 +Floors could not go only for a years. Special reasons shape consequently black, concerned instances. Mutual depths encourage both simple teachers. Cards favour massive Books arts 1.83 503.10 0.63619586486597904 +Certain customers think exactly already necessary factories. Awkward doubts shall not forget fine Books arts 0.30 922.40 1.16642231316314662 +Deep, big areas take for a facilities. Words could replace certainly cases; lights test. Nevertheless practical arts cross. Fa Books arts 7.37 230.48 0.29145383210954253 +New, reluctant associations see more different, physical symptoms; useful pounds ought to give. Subjects Books business 9.02 306.85 0.37352072221391094 +Natural plans might not like n Books business 4.29 2484.54 3.02436752540117416 +Years shall want free objects. Old residents use absolutely so residential steps. Letters will share variables. Sure fres Books business 40.76 90.28 0.10989555418436330 +Simple, great shops glance from a years. Lessons deepen here previous clients. Increased, silent flights open more great rocks. Brill Books business 8.92 393.75 0.47930188812686144 +Groups must not put new, civil moves. Correct men laugh slightly total novels. Relatively public girls set even scott Books business 3.36 344.10 0.41886420242400767 +Just young degrees stop posts. More than tight artists buy to a arts. European, essential techniques ought to sell to a offences. Sentences be Books business 2.58 184.08 0.22407591508925118 +Junior, severe restrictions ought to want principles. Sure, Books business 9.77 1549.80 1.88653223166732663 +Remaining subjects handle even only certain ladies; eagerly literary days could not provide. Very different articles cut then. Boys see out of a houses. Governme Books business 9.03 6463.45 7.86779374936777799 +Russian windows should see in a weapons. New, considerable branches walk. English regions apply neither alone police; very new years w Books business 2.79 1635.60 1.99097439548011320 +Long groups used to create more tiny feet; tools used to dare still Books business 57.04 10558.62 12.85274032257534413 +Drugs must compensate dark, modest houses. Small pubs claim naturally accessible relationships. Distinguished Books business 1.66 31.78 0.03868498794837246 +Small, capable centres Books business 2.98 3219.72 3.91928349267255446 +Popular, different parameters might take open, used modules. Prisoners use pretty alternative lovers. Annual, professional others spend once true men. Other, small subsidies seem politically Books business 7.25 3862.88 4.70218584789203943 +Supreme, free uses handle even in the customers. Other minutes might not make of course social neighbours. So environmental rights come other, able sales Books business 8.08 10904.74 13.27406341976510738 +Sound, original activities consider quite to a attitudes. In order weak improvements marry available, hard studie Books business 71.27 385.84 0.46967324575204627 +Classic issues will draw as european, engl Books business 75.64 92.64 0.11276832232653319 +Again british shareholders see shares. American lives ought to establish horses. Then ideal conservatives might charge even nec Books business 2.44 5353.50 6.51667976657054660 +Departments could seek now for a commu Books business 5.93 6535.44 7.95542535045032467 +Paintings must not know primary, royal stands; similar, available others ough Books business 0.39 303.68 0.36966196161616580 +Most present eyes restore fat, central relationships; again considerable habits must face in a discussions. Engineers help at all direct occasions. Curiously del Books business 80.10 2096.55 2.55207713918062566 +Children would not mean in favour of a parts. Heavy, whole others shall mean on Books business 3.13 6646.96 8.09117581791421695 +White fees might combine reports. Tr Books business 2.09 500.56 0.60931899205277908 +Most new weeks go yet members. Also encouraging delegates make publications. Different competitors run resources; somehow common views m Books business 1.07 974.26 1.18594198736882801 +Only new systems might join late speeches. Materials could stay on a benefits. Corporate regulations must crawl definitely practical deaths. Windows might soothe despite a organisations. Old Books business 0.67 9075.35 11.04719337247520503 +Professional managers form later initial grounds. Conscious, big risks restore. American, full rises say for a systems. Already Books business 5.27 890.13 1.08353267219901759 +Memories can earn particularly over quick contexts; alone differences make separate years; irish men mea Books business 4.23 2059.92 2.50748836924516678 +Only, gothic Books business 1.68 4777.17 5.81512787530920297 +Silver, critical operations could help howev Books business 5.56 428.54 0.52165087273113702 +Else substantial problems slip months. Just unique corporations put vast areas. Supporters like far perfect chapters. Now young reports become wrong trials. Available ears shall Books computers 51.46 2456.28 1.26602601850774711 +At least remaining results shall keep cuts. Clients should meet policies. Glorious, local times could use enough; clever styles will live political parents. Single, gradual contracts will describe ho Books computers 9.51 10252.90 5.28459221471415324 +Years learn here. Days make too. Only moving systems avoid old groups; short movements cannot see respectiv Books computers 0.60 1761.68 0.90801240749618444 +Ga Books computers 5.53 7541.48 3.88706087988983530 +S Books computers 65.78 4566.02 2.35343695385979752 +Boxes batt Books computers 0.83 7844.04 4.04300760915510798 +Artists make times. Rather ready functions must pre Books computers 5.71 3694.01 1.90398194531071494 +Limited, capable cities shall try during the bodies. Specially economic services ought to prevent old area Books computers 2.93 96.18 0.04957349425150028 +Legs throw then. Old-fashioned develo Books computers 2.66 718.55 0.37035801928067716 +Important, educational variables used to appear months. A Books computers 2.47 9922.02 5.11404867366677942 +Men should not turn shadows. Different, single concessions guarantee only therefore alone products. Books computers 8.38 4194.24 2.16181256528813215 +Educational, white teachers should not fix. Considerable, other services might not cover today on a forms. Successful genes fall otherwise so Books computers 1.65 14569.68 7.50956485471198434 +Present Books computers 2.84 12393.53 6.38792460190056468 +Multiple, dark feet mean more complex girls; schools may not answer frequently blue assets. Spiritual, dry patients may reply personnel Books computers 2.04 371.40 0.19142852739662305 +Private teachers ap Books computers 5.27 4911.39 2.53144899076602182 +Daily numbers sense interesting players. General advantages would speak here. Shelves shall know with the reductions. Again wrong mothers provide ways; as hot pr Books computers 7.56 689.26 0.35526124607807325 +Inc, corporate ships slow evident degrees. Chosen, acute prices throw always. Budgets spend points. Commonly large events may mean. Bottles c Books computers 68.38 4.17 0.00214931868401701 +However old hours ma Books computers 8.84 451.53 0.23272946412330966 +Indeed other actions should provide after a ideas; exhibitio Books computers 6.95 8062.32 4.15551439149257400 +Perfect days find at all. Crimes might develop hopes. Much socialist grants drive current, useful walls. Emissions open naturally. Combinations shall not know. Tragic things shall not receive just Books computers 6.71 526.49 0.27136565802113105 +Human windows take right, variable steps. Years should buy often. Indeed thin figures may beat even up to a cars. Details may tell enough. Impossible, sufficient differences ought to return Books computers 4.47 1542.60 0.79509328584283986 +Left diff Books computers 0.74 5248.81 2.70536340572070289 +Friendly, hot computers tax elsewhere units. New, real officials should l Books computers 3.19 12378.72 6.38029117031536278 +Kinds relieve really major practices. Then capable reserves could not approve foundations. Pos Books computers 7.23 1786.41 0.92075884659828053 +Visible, average words shall not want quite only public boundaries. Cars must telephone proposals. German things ask abilities. Windows cut again favorite offi Books computers 6.75 25255.89 13.01749550563031296 +Only increased errors must submit as rich, main Books computers 6.94 2429.79 1.25237243291071818 +Meals ought to test. Round days might need most urban years. Political, english pages must see on a eyes. Only subsequent women may come better methods; difficult, social childr Books computers 7.23 6457.72 3.32846480866914548 +Systems cannot see fairly practitioners. Little ca Books computers 1.73 6197.59 3.19438752586978211 +Past beautiful others might not like more than legislative, small products. Close, wh Books computers 3.02 10232.30 5.27397447733028024 +Main problems wait properly. Everyday, foreign offenders can worry activities. Social, important shoes will afford okay physical parts. Very Books computers 1.40 2034.30 1.04852733786470188 +Schools offer quickly others. Further main buildings satisfy sadly great, productive figures. Years contribute acti Books computers 4.11 3975.90 2.04927485750197523 +Tiny, rare leaders mention old, precious areas; students will improve much multiple stars. Even confident solutions will include clearly single women. Please little rights will not mention harder com Books computers 1.45 11902.91 6.13504720795513872 +Guidelines should investigate so. Usual personnel look now old, modern aspects. Discussions could appear once br Books computers 2.44 640.06 0.32990237815154161 +Flat pleasant groups would go private, redundant eyes. Main devic Books computers 2.83 8359.41 4.30864175068552700 +Fine users go for a networks. Sympathetic, effective industries could not alter particularly other concepts; wooden women used to feel however Books computers 5.30 247.79 0.12771694885193653 +Real, domestic facilities turn often guilty symptoms. Winds get naturally intense islands. Products shall not travel a little clear shares; improved children may not apply wrong c Books computers 5.28 297.60 0.15339022550682558 +Then irish champions must look now forward good women. Future, big models sign. Then different o Books cooking 85.81 6496.48 10.66582432143788856 +Valuable studies should persist so concerned parties. Always polite songs include then from the holes. There conventional areas might not explain theore Books cooking 1.58 2088.03 3.42809662430915734 +Meanings occur in a things. Also essential features may not satisfy by the potatoes; happy words change childre Books cooking 3.46 1496.40 2.45676728237440221 +Then dominant goods should combine probably american items. Important artists guess only sill Books cooking 6.67 5638.06 9.25648312220250073 +Individual, remarkable services take by the interest Books cooking 6.05 0.00 0.00000000000000000 +Ultimately senior elections marry at l Books cooking 5.06 2060.48 3.38286544372280691 +Hence young effects shall not solve however months. In order small activities must not return almost national foods. International decades take contributions. Sessions must see Books cooking 1.43 242.28 0.39777170353760369 +Points trace so simple eyes. Short advisers shall not say limitations. Keys stretch in full now blue wings. Immediately strategic students would not make strangely for the players. Books cooking 1.69 12518.00 20.55186637313737424 +Great pp. will not r Books cooking 1.91 7268.22 11.93285558480304571 +Products may not resist further specif Books cooking 5.37 2.72 0.00446565557876128 +Somet Books cooking 7.34 580.58 0.95318761614603744 +Genetic properties might describe therefore leaves; right other organisers must not talk even lives; methods carry thus wrong minutes. Proud worke Books cooking 1.08 1445.15 2.37262579398781566 +Urgent agencies mean over as a plants; then Books cooking 6.47 1312.79 2.15531911295662354 +As light hundreds must establish on a services. Sometimes special results Books cooking 44.82 3513.30 5.76808372972867366 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q13.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q13.sql.out new file mode 100644 index 0000000000000..518f598f30aa6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q13.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +31.875 2306.480000 2168.643750 17349.15 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q14a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q14a.sql.out new file mode 100644 index 0000000000000..ae4502a8cd93c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q14a.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL NULL NULL 674681657.38 155667 +catalog NULL NULL NULL 235666845.52 46085 +catalog 1001001 NULL NULL 1698135.15 341 +catalog 1001001 1 NULL 1050210.86 214 +catalog 1001001 1 1 42507.62 8 +catalog 1001001 1 2 106083.96 19 +catalog 1001001 1 3 101297.49 22 +catalog 1001001 1 4 68779.51 25 +catalog 1001001 1 5 201671.76 31 +catalog 1001001 1 6 165473.64 25 +catalog 1001001 1 7 57452.17 9 +catalog 1001001 1 8 107124.01 25 +catalog 1001001 1 9 61121.32 18 +catalog 1001001 1 10 138699.38 32 +catalog 1001001 2 NULL 34937.77 4 +catalog 1001001 2 3 34937.77 4 +catalog 1001001 3 NULL 208126.74 43 +catalog 1001001 3 1 65982.89 13 +catalog 1001001 3 4 108943.96 20 +catalog 1001001 3 6 23652.37 7 +catalog 1001001 3 7 9547.52 3 +catalog 1001001 4 NULL 20486.85 5 +catalog 1001001 4 7 20486.85 5 +catalog 1001001 5 NULL 41532.27 8 +catalog 1001001 5 7 11217.24 4 +catalog 1001001 5 9 30315.03 4 +catalog 1001001 8 NULL 139099.45 25 +catalog 1001001 8 9 77814.57 15 +catalog 1001001 8 10 61284.88 10 +catalog 1001001 10 NULL 24174.96 5 +catalog 1001001 10 7 24174.96 5 +catalog 1001001 13 NULL 20891.29 3 +catalog 1001001 13 9 20891.29 3 +catalog 1001001 14 NULL 66038.13 14 +catalog 1001001 14 9 26363.83 7 +catalog 1001001 14 10 39674.30 7 +catalog 1001001 15 NULL 63699.54 12 +catalog 1001001 15 10 63699.54 12 +catalog 1001001 16 NULL 28937.29 8 +catalog 1001001 16 9 28937.29 8 +catalog 1001002 NULL NULL 3137545.73 657 +catalog 1001002 1 NULL 2597194.10 539 +catalog 1001002 1 1 2597194.10 539 +catalog 1001002 2 NULL 120152.76 28 +catalog 1001002 2 1 120152.76 28 +catalog 1001002 3 NULL 43520.49 11 +catalog 1001002 3 1 43520.49 11 +catalog 1001002 4 NULL 138778.24 30 +catalog 1001002 4 1 138778.24 30 +catalog 1001002 7 NULL 26096.94 4 +catalog 1001002 7 1 26096.94 4 +catalog 1001002 10 NULL 15192.85 6 +catalog 1001002 10 1 15192.85 6 +catalog 1001002 12 NULL 79002.90 17 +catalog 1001002 12 1 79002.90 17 +catalog 1001002 13 NULL 28858.71 5 +catalog 1001002 13 1 28858.71 5 +catalog 1001002 14 NULL 88748.74 17 +catalog 1001002 14 1 88748.74 17 +catalog 1002001 NULL NULL 1812816.55 357 +catalog 1002001 1 NULL 158520.06 30 +catalog 1002001 1 1 25188.03 6 +catalog 1002001 1 2 77805.61 11 +catalog 1002001 1 4 15320.55 6 +catalog 1002001 1 5 40205.87 7 +catalog 1002001 2 NULL 944972.06 193 +catalog 1002001 2 1 69392.20 14 +catalog 1002001 2 2 143259.76 24 +catalog 1002001 2 3 190639.48 38 +catalog 1002001 2 4 60154.92 11 +catalog 1002001 2 6 72905.53 16 +catalog 1002001 2 7 17237.62 3 +catalog 1002001 2 8 141091.32 36 +catalog 1002001 2 9 141603.60 25 +catalog 1002001 2 10 108687.63 26 +catalog 1002001 3 NULL 61348.83 9 +catalog 1002001 3 1 61348.83 9 +catalog 1002001 4 NULL 126215.12 28 +catalog 1002001 4 1 59437.19 12 +catalog 1002001 4 3 24792.24 9 +catalog 1002001 4 5 41985.69 7 +catalog 1002001 5 NULL 60039.55 7 +catalog 1002001 5 9 60039.55 7 +catalog 1002001 6 NULL 160520.59 27 +catalog 1002001 6 7 10403.70 5 +catalog 1002001 6 9 100458.19 15 +catalog 1002001 6 10 49658.70 7 +catalog 1002001 8 NULL 18830.90 5 +catalog 1002001 8 8 18830.90 5 +catalog 1002001 9 NULL 31370.49 5 +catalog 1002001 9 9 31370.49 5 +catalog 1002001 10 NULL 40164.96 9 +catalog 1002001 10 6 7759.96 5 +catalog 1002001 10 8 32405.00 4 +catalog 1002001 11 NULL 42852.27 11 +catalog 1002001 11 8 25836.23 7 +catalog 1002001 11 9 17016.04 4 +catalog 1002001 12 NULL 12275.20 4 +catalog 1002001 12 7 12275.20 4 +catalog 1002001 13 NULL 27702.27 5 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q14b.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q14b.sql.out new file mode 100644 index 0000000000000..cf254c3d32fdf --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q14b.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +store 1001001 1 1 618811.76 171 store 1001001 1 1 1120886.77 328 +store 1001002 1 1 679257.16 207 store 1001002 1 1 597317.93 174 +store 1002001 2 1 590902.05 166 store 1002001 2 1 1382457.19 367 +store 1002002 2 1 712644.78 166 store 1002002 2 1 686649.72 155 +store 1003001 3 1 567349.84 161 store 1003001 3 1 1120432.56 309 +store 1003002 3 1 775782.67 214 store 1003002 3 1 561917.26 173 +store 1004001 4 1 602670.66 187 store 1004001 4 1 1284658.68 355 +store 1004002 4 1 680693.19 185 store 1004002 4 1 572656.37 181 +store 2001001 1 2 721151.24 193 store 2001001 1 2 1206198.64 359 +store 2001002 1 2 815659.11 223 store 2001002 1 2 621816.55 166 +store 2002001 2 2 657826.11 158 store 2002001 2 2 1229089.24 366 +store 2002002 2 2 738888.97 213 store 2002002 2 2 701020.25 187 +store 2003001 3 2 856103.36 229 store 2003001 3 2 1517919.93 408 +store 2003002 3 2 1035024.58 255 store 2003002 3 2 693873.11 187 +store 2004001 4 2 818535.48 210 store 2004001 4 2 1584158.70 423 +store 2004002 4 2 902066.26 231 store 2004002 4 2 652868.55 184 +store 3001001 1 3 690099.22 187 store 3001001 1 3 1540182.88 363 +store 3001002 1 3 796955.01 238 store 3001002 1 3 690610.81 178 +store 3002001 2 3 601571.31 163 store 3002001 2 3 1332847.53 353 +store 3002002 2 3 889691.45 239 store 3002002 2 3 711790.52 187 +store 3003001 3 3 599641.77 168 store 3003001 3 3 1218300.45 329 +store 3003002 3 3 785846.50 222 store 3003002 3 3 727813.84 205 +store 3004001 4 3 636017.18 169 store 3004001 4 3 1300058.21 347 +store 3004002 4 3 850298.30 240 store 3004002 4 3 605722.91 192 +store 4001001 1 4 709294.08 189 store 4001001 1 4 1317772.16 332 +store 4001002 1 4 833503.02 203 store 4001002 1 4 651619.28 161 +store 4002001 2 4 633353.59 188 store 4002001 2 4 1235025.47 341 +store 4002002 2 4 928549.29 239 store 4002002 2 4 724613.68 193 +store 4003001 3 4 645858.10 173 store 4003001 3 4 1417068.83 390 +store 4003002 3 4 872089.82 236 store 4003002 3 4 707566.93 201 +store 4004001 4 4 657080.07 179 store 4004001 4 4 1279798.81 334 +store 4004002 4 4 836177.44 216 store 4004002 4 4 821961.41 198 +store 5001001 1 5 719353.50 186 store 5001001 1 5 1189108.84 310 +store 5001002 1 5 842595.01 234 store 5001002 1 5 788955.51 198 +store 5002001 2 5 773460.67 218 store 5002001 2 5 1274443.41 357 +store 5002002 2 5 910604.00 253 store 5002002 2 5 649585.02 178 +store 5003001 3 5 699927.22 177 store 5003001 3 5 1388232.27 389 +store 5003002 3 5 795797.08 221 store 5003002 3 5 640802.27 168 +store 5004001 4 5 746611.79 186 store 5004001 4 5 1149863.23 334 +store 5004002 4 5 661403.11 175 store 5004002 4 5 522457.04 139 +store 6001001 1 6 32952.14 10 store 6001001 1 6 100674.40 25 +store 6001002 1 6 32363.63 11 store 6001002 1 6 21192.44 6 +store 6001003 1 6 32105.72 12 store 6001003 1 6 49799.29 16 +store 6001004 1 6 69366.44 18 store 6001004 1 6 33159.67 12 +store 6001005 1 6 39316.28 13 store 6001005 1 6 176957.80 40 +store 6001006 1 6 33851.16 8 store 6001006 1 6 59928.72 18 +store 6001007 1 6 52934.26 10 store 6001007 1 6 68730.18 15 +store 6001008 1 6 61470.12 17 store 6001008 1 6 21110.81 7 +store 6002001 2 6 58059.46 12 store 6002001 2 6 118560.37 25 +store 6002002 2 6 45696.16 15 store 6002002 2 6 98188.35 25 +store 6002003 2 6 27662.18 10 store 6002003 2 6 52033.85 19 +store 6002004 2 6 49212.09 11 store 6002004 2 6 23087.83 7 +store 6002005 2 6 54618.54 15 store 6002005 2 6 94438.29 22 +store 6002006 2 6 4768.74 6 store 6002006 2 6 41696.39 7 +store 6002007 2 6 23765.55 6 store 6002007 2 6 100119.20 29 +store 6002008 2 6 26747.76 5 store 6002008 2 6 19965.51 3 +store 6003001 3 6 17874.97 4 store 6003001 3 6 39734.27 10 +store 6003004 3 6 36845.45 13 store 6003004 3 6 28332.73 5 +store 6003005 3 6 33876.00 12 store 6003005 3 6 149594.43 34 +store 6003006 3 6 78594.03 17 store 6003006 3 6 80057.92 16 +store 6003007 3 6 90969.04 23 store 6003007 3 6 130880.43 32 +store 6003008 3 6 51335.82 14 store 6003008 3 6 45068.89 16 +store 6004001 4 6 14673.04 4 store 6004001 4 6 84488.05 22 +store 6004002 4 6 41801.05 15 store 6004002 4 6 31527.39 12 +store 6004003 4 6 15735.99 8 store 6004003 4 6 102005.55 23 +store 6004004 4 6 70293.74 15 store 6004004 4 6 16694.72 7 +store 6004006 4 6 98506.28 26 store 6004006 4 6 40380.88 13 +store 6004007 4 6 7974.20 5 store 6004007 4 6 56390.64 19 +store 6004008 4 6 93726.06 22 store 6004008 4 6 49454.40 15 +store 6005001 5 6 25935.02 8 store 6005001 5 6 76459.38 18 +store 6005002 5 6 27560.91 8 store 6005002 5 6 29874.66 8 +store 6005003 5 6 76424.40 23 store 6005003 5 6 120380.82 37 +store 6005004 5 6 61026.67 15 store 6005004 5 6 32867.59 7 +store 6005005 5 6 49398.50 13 store 6005005 5 6 125117.31 33 +store 6005006 5 6 40539.82 9 store 6005006 5 6 24310.11 8 +store 6005007 5 6 18454.21 5 store 6005007 5 6 52454.65 14 +store 6005008 5 6 71116.83 19 store 6005008 5 6 40388.90 6 +store 6006001 6 6 26990.02 8 store 6006001 6 6 19931.96 5 +store 6006003 6 6 39807.40 6 store 6006003 6 6 100194.33 22 +store 6006004 6 6 126180.26 29 store 6006004 6 6 44060.41 16 +store 6006005 6 6 24214.85 8 store 6006005 6 6 79947.56 24 +store 6006006 6 6 59581.58 21 store 6006006 6 6 45979.99 11 +store 6006008 6 6 81635.42 14 store 6006008 6 6 26221.85 8 +store 6007001 7 6 15407.87 3 store 6007001 7 6 14185.50 7 +store 6007002 7 6 77223.28 17 store 6007002 7 6 21012.93 7 +store 6007003 7 6 30617.75 9 store 6007003 7 6 21503.75 7 +store 6007004 7 6 35752.37 11 store 6007004 7 6 39378.54 9 +store 6007005 7 6 49598.38 16 store 6007005 7 6 102247.83 29 +store 6007006 7 6 43099.21 12 store 6007006 7 6 17599.96 11 +store 6007007 7 6 36750.53 10 store 6007007 7 6 47280.71 19 +store 6007008 7 6 63116.82 21 store 6007008 7 6 16366.95 10 +store 6008001 8 6 78930.46 18 store 6008001 8 6 123392.71 36 +store 6008002 8 6 20148.09 5 store 6008002 8 6 98780.67 17 +store 6008004 8 6 41158.44 15 store 6008004 8 6 7371.54 4 +store 6008005 8 6 52094.82 11 store 6008005 8 6 153697.84 42 +store 6008006 8 6 40340.12 8 store 6008006 8 6 32564.87 11 +store 6008007 8 6 8554.42 2 store 6008007 8 6 40138.79 9 +store 6008008 8 6 26928.47 7 store 6008008 8 6 18485.16 4 +store 6009001 9 6 69811.04 16 store 6009001 9 6 136769.36 32 +store 6009002 9 6 31689.61 14 store 6009002 9 6 63253.41 19 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q15.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q15.sql.out new file mode 100644 index 0000000000000..7ec445691906f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q15.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL 2519.19 +30059 812.16 +30069 2248.42 +30150 157.03 +30162 2039.97 +30169 1670.46 +30191 544.76 +30399 638.05 +30411 771.09 +30499 1826.69 +30587 3142.51 +30945 159.37 +30965 331.74 +31087 1264.39 +31218 1221.13 +31289 366.49 +31387 1650.86 +31521 490.31 +31675 1909.58 +31711 458.28 +31749 1229.27 +31757 1207.80 +31904 1584.89 +31933 829.70 +31952 794.71 +32293 1025.43 +32477 95.37 +32808 1306.54 +32812 209.90 +32898 448.94 +33003 236.71 +33199 385.03 +33372 170.95 +33394 842.14 +33445 1084.78 +33511 447.67 +33604 616.64 +33951 2103.68 +33957 319.38 +34098 288.86 +34107 2903.74 +34167 717.59 +34244 694.54 +34289 185.70 +34338 411.46 +34466 1736.55 +34536 2259.62 +34593 346.48 +34694 592.38 +34843 461.27 +34854 448.63 +35038 1972.67 +35124 415.20 +35281 538.84 +35709 1008.27 +35752 1067.71 +35804 1004.19 +35817 418.39 +36060 659.72 +36074 509.22 +36098 2175.73 +36192 1679.14 +36277 554.20 +36534 982.64 +36557 437.46 +36787 2030.37 +36788 357.97 +36867 649.86 +36871 551.07 +36971 473.15 +36997 953.02 +37057 832.78 +37411 447.31 +37683 1675.77 +37745 689.08 +37752 871.12 +37838 1238.05 +37940 257.25 +38014 1047.08 +38059 374.46 +38075 1052.41 +38095 935.02 +38354 310.51 +38370 2677.66 +38371 1890.06 +38482 1035.92 +38579 1957.82 +38605 652.30 +38721 1593.98 +38784 739.06 +38828 832.91 +38877 669.68 +38883 1743.88 +39003 400.20 +39101 481.37 +39145 633.33 +39231 576.23 +39237 895.30 +39275 622.01 +39303 825.38 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q16.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q16.sql.out new file mode 100644 index 0000000000000..6de87c375ca54 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q16.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +280 1300478.25 -285761.26 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q17.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q17.sql.out new file mode 100644 index 0000000000000..a3facf3ecb9ec --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q17.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output + diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q18.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q18.sql.out new file mode 100644 index 0000000000000..cac227c379b81 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q18.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL NULL NULL 50.804533 99.251888 256.393484 49.082603 -338.277102 1957.826868 3.274912 +AAAAAAAAAACDAAAA NULL NULL NULL 8.000000 204.490000 0.000000 47.030000 -299.760000 1948.000000 2.000000 +AAAAAAAAAADCAAAA NULL NULL NULL 46.000000 178.690000 0.000000 146.520000 2502.860000 1962.000000 0.000000 +AAAAAAAAAAGBAAAA NULL NULL NULL 86.000000 1.520000 40.290000 0.660000 -97.910000 1945.000000 2.000000 +AAAAAAAAAAGCAAAA NULL NULL NULL 84.000000 41.920000 0.000000 8.380000 -640.080000 1945.000000 2.000000 +AAAAAAAAAAGEAAAA NULL NULL NULL 99.000000 107.550000 0.000000 65.600000 738.540000 1973.000000 3.000000 +AAAAAAAAAAJBAAAA NULL NULL NULL 97.000000 48.580000 0.000000 44.690000 534.470000 1984.000000 1.000000 +AAAAAAAAAAKAAAAA NULL NULL NULL 36.000000 164.023333 0.000000 57.763333 -1073.803333 1962.666667 2.333333 +AAAAAAAAAAOCAAAA NULL NULL NULL 82.000000 148.640000 0.000000 107.020000 4483.760000 1948.000000 6.000000 +AAAAAAAAAAODAAAA NULL NULL NULL 100.000000 80.700000 0.000000 64.560000 1505.000000 1981.000000 4.000000 +AAAAAAAAABADAAAA NULL NULL NULL 55.000000 134.120000 3189.310000 63.030000 -2198.210000 1945.000000 2.000000 +AAAAAAAAABCEAAAA NULL NULL NULL 25.000000 150.360000 85.690000 9.020000 -1702.940000 1948.000000 6.000000 +AAAAAAAAABDEAAAA NULL NULL NULL 24.000000 99.490000 0.000000 94.510000 562.560000 1958.000000 0.000000 +AAAAAAAAABFBAAAA NULL NULL NULL 2.000000 60.810000 0.000000 45.600000 -26.880000 1931.000000 6.000000 +AAAAAAAAABFCAAAA NULL NULL NULL 65.000000 45.000000 0.000000 23.310000 -1071.285000 1937.500000 3.000000 +AAAAAAAAABGBAAAA NULL NULL NULL 65.000000 20.450000 0.000000 0.810000 -401.050000 1983.000000 2.000000 +AAAAAAAAABJBAAAA NULL NULL NULL 42.000000 69.930000 0.000000 49.650000 260.820000 1943.000000 2.000000 +AAAAAAAAABNCAAAA NULL NULL NULL 81.000000 140.170000 0.000000 86.900000 1733.400000 1953.000000 4.000000 +AAAAAAAAACCBAAAA NULL NULL NULL 50.000000 99.750000 0.000000 75.810000 1109.000000 1945.000000 1.000000 +AAAAAAAAACCDAAAA NULL NULL NULL 71.000000 92.520000 0.000000 25.900000 -4026.410000 1928.000000 0.000000 +AAAAAAAAACDDAAAA NULL NULL NULL 29.000000 147.490000 0.000000 35.390000 -741.240000 1933.000000 5.000000 +AAAAAAAAACIBAAAA NULL NULL NULL 4.000000 38.470000 0.000000 35.770000 41.160000 1952.000000 2.000000 +AAAAAAAAACPDAAAA NULL NULL NULL 91.000000 86.510000 0.000000 20.760000 -1989.260000 1981.000000 3.000000 +AAAAAAAAADACAAAA NULL NULL NULL 53.000000 227.940000 0.000000 113.970000 1089.150000 1954.000000 6.000000 +AAAAAAAAADBDAAAA NULL NULL NULL 70.000000 35.050000 0.000000 29.440000 970.200000 1990.000000 2.000000 +AAAAAAAAADEEAAAA NULL NULL NULL 66.000000 85.760000 2913.510000 44.590000 -3553.050000 1926.000000 3.000000 +AAAAAAAAADJBAAAA NULL NULL NULL 28.000000 90.830000 0.000000 15.155000 -466.175000 1986.000000 1.000000 +AAAAAAAAADPBAAAA NULL NULL NULL 55.000000 47.460000 0.000000 18.500000 43.450000 1989.000000 2.000000 +AAAAAAAAAEABAAAA NULL NULL NULL 62.000000 89.450000 0.000000 61.720000 225.060000 1958.000000 0.000000 +AAAAAAAAAEBAAAAA NULL NULL NULL 93.000000 175.980000 0.000000 156.620000 6503.490000 1952.000000 6.000000 +AAAAAAAAAECCAAAA NULL NULL NULL 97.000000 179.380000 0.000000 127.350000 4183.610000 1952.000000 1.000000 +AAAAAAAAAEDDAAAA NULL NULL NULL 81.000000 104.250000 0.000000 53.160000 -92.340000 1982.000000 0.000000 +AAAAAAAAAEGDAAAA NULL NULL NULL 6.000000 170.770000 61.470000 102.460000 103.890000 1985.000000 0.000000 +AAAAAAAAAEGEAAAA NULL NULL NULL 97.000000 34.300000 0.000000 24.350000 392.850000 1976.000000 6.000000 +AAAAAAAAAEJDAAAA NULL NULL NULL 74.000000 168.330000 0.000000 143.080000 3926.440000 1930.000000 1.000000 +AAAAAAAAAENAAAAA NULL NULL NULL 15.000000 73.420000 0.000000 23.490000 -108.450000 1963.000000 2.000000 +AAAAAAAAAEPAAAAA NULL NULL NULL 34.000000 4.380000 0.000000 3.460000 67.320000 1952.000000 1.000000 +AAAAAAAAAEPDAAAA NULL NULL NULL 54.000000 99.220000 1013.550000 43.650000 -3909.570000 1958.000000 0.000000 +AAAAAAAAAFGAAAAA NULL NULL NULL 74.000000 90.960000 0.000000 0.900000 -4919.520000 1964.000000 6.000000 +AAAAAAAAAFGCAAAA NULL NULL NULL 79.000000 51.830000 0.000000 36.280000 787.630000 1975.000000 5.000000 +AAAAAAAAAFGDAAAA NULL NULL NULL 80.000000 38.080000 0.000000 0.000000 -1116.000000 1926.000000 0.000000 +AAAAAAAAAFHBAAAA NULL NULL NULL 57.000000 55.990000 0.000000 31.910000 320.340000 1970.000000 6.000000 +AAAAAAAAAFLBAAAA NULL NULL NULL 92.000000 44.330000 0.000000 41.220000 836.280000 1943.000000 3.000000 +AAAAAAAAAGBEAAAA NULL NULL NULL 6.000000 260.570000 0.000000 93.800000 14.220000 1970.000000 2.000000 +AAAAAAAAAGCAAAAA NULL NULL NULL 54.000000 231.920000 0.000000 48.700000 -2187.000000 1969.000000 5.000000 +AAAAAAAAAGCCAAAA NULL NULL NULL 80.000000 183.680000 0.000000 99.180000 475.200000 1946.000000 0.000000 +AAAAAAAAAGCDAAAA NULL NULL NULL 69.000000 143.220000 2478.280000 54.420000 -4676.620000 1970.000000 6.000000 +AAAAAAAAAGEDAAAA NULL NULL NULL 93.000000 60.830000 0.000000 52.310000 2769.540000 1942.000000 6.000000 +AAAAAAAAAGIDAAAA NULL NULL NULL 28.000000 75.550000 0.000000 9.060000 -1013.040000 1942.000000 6.000000 +AAAAAAAAAGJBAAAA NULL NULL NULL 36.000000 7.170000 0.000000 5.230000 65.880000 1984.000000 6.000000 +AAAAAAAAAGKAAAAA NULL NULL NULL 33.000000 95.840000 0.000000 4.790000 -1480.710000 1948.000000 6.000000 +AAAAAAAAAGLAAAAA NULL NULL NULL 85.000000 143.410000 570.460000 74.570000 276.990000 1948.000000 6.000000 +AAAAAAAAAGLCAAAA NULL NULL NULL 65.000000 13.730000 0.000000 3.980000 -176.800000 1976.000000 6.000000 +AAAAAAAAAHADAAAA NULL NULL NULL 52.000000 33.050000 0.000000 10.900000 -1054.560000 1936.000000 1.000000 +AAAAAAAAAHBCAAAA NULL NULL NULL 20.000000 187.740000 0.000000 31.910000 -994.400000 1947.000000 5.000000 +AAAAAAAAAHBDAAAA NULL NULL NULL 61.000000 83.490000 0.000000 59.270000 1201.700000 1945.000000 2.000000 +AAAAAAAAAHCBAAAA NULL NULL NULL 2.000000 136.960000 0.000000 0.000000 -95.780000 1970.000000 5.000000 +AAAAAAAAAHDEAAAA NULL NULL NULL 15.000000 31.950000 232.130000 16.290000 -164.630000 1934.000000 2.000000 +AAAAAAAAAHGAAAAA NULL NULL NULL 99.000000 100.770000 12.870000 1.000000 -9600.030000 1932.000000 4.000000 +AAAAAAAAAHHAAAAA NULL NULL NULL 18.000000 109.980000 0.000000 24.190000 -634.680000 1933.000000 2.000000 +AAAAAAAAAHIBAAAA NULL NULL NULL 86.000000 20.920000 0.000000 5.230000 -1332.140000 1990.000000 1.000000 +AAAAAAAAAHJDAAAA NULL NULL NULL 53.000000 88.370000 0.000000 37.990000 -1308.570000 1948.000000 2.000000 +AAAAAAAAAHMDAAAA NULL NULL NULL 68.000000 200.900000 546.440000 20.090000 -4993.640000 NULL 6.000000 +AAAAAAAAAHPDAAAA NULL NULL NULL 6.000000 73.210000 60.840000 13.170000 -276.660000 1936.000000 6.000000 +AAAAAAAAAIACAAAA NULL NULL NULL 1.000000 17.830000 0.000000 10.160000 1.940000 1935.000000 1.000000 +AAAAAAAAAIADAAAA NULL NULL NULL 100.000000 22.020000 0.000000 15.630000 -131.000000 1982.000000 0.000000 +AAAAAAAAAIEBAAAA NULL NULL NULL 4.000000 51.860000 0.000000 42.520000 -8.760000 1967.000000 4.000000 +AAAAAAAAAIEEAAAA NULL NULL NULL 64.000000 18.810000 0.000000 15.610000 468.480000 1930.000000 1.000000 +AAAAAAAAAINBAAAA NULL NULL NULL 6.000000 102.610000 2.950000 24.620000 -110.710000 1930.000000 2.000000 +AAAAAAAAAIODAAAA NULL NULL NULL 81.000000 42.490000 0.000000 12.740000 -339.390000 1990.000000 1.000000 +AAAAAAAAAJBEAAAA NULL NULL NULL 95.000000 118.220000 0.000000 15.360000 -3863.650000 1962.000000 0.000000 +AAAAAAAAAJDCAAAA NULL NULL NULL 85.000000 190.480000 0.000000 125.710000 4732.800000 1989.000000 2.000000 +AAAAAAAAAJEAAAAA NULL NULL NULL 36.000000 183.430000 0.000000 0.000000 -3318.480000 1942.000000 6.000000 +AAAAAAAAAJGCAAAA NULL NULL NULL 43.500000 39.415000 619.885000 28.940000 -340.325000 1960.000000 5.000000 +AAAAAAAAAJIAAAAA NULL NULL NULL 69.000000 118.330000 0.000000 61.530000 1117.110000 1970.000000 2.000000 +AAAAAAAAAJICAAAA NULL NULL NULL 39.333333 102.063333 0.000000 24.780000 -848.446667 1962.666667 2.333333 +AAAAAAAAAJIDAAAA NULL NULL NULL 75.000000 222.870000 6498.720000 180.520000 -42.720000 1935.000000 5.000000 +AAAAAAAAAJJBAAAA NULL NULL NULL 42.000000 103.240000 0.000000 43.360000 -149.940000 1932.000000 4.000000 +AAAAAAAAAJNAAAAA NULL NULL NULL 93.000000 14.470000 0.000000 13.740000 136.710000 1954.000000 0.000000 +AAAAAAAAAJOCAAAA NULL NULL NULL 24.000000 88.660000 0.000000 2.650000 -1000.320000 1927.000000 2.000000 +AAAAAAAAAJPBAAAA NULL NULL NULL 16.000000 159.510000 0.000000 121.220000 1085.920000 1983.000000 4.000000 +AAAAAAAAAKAEAAAA NULL NULL NULL 5.000000 178.480000 0.000000 57.110000 -160.650000 1990.000000 2.000000 +AAAAAAAAAKFCAAAA NULL NULL NULL 84.000000 284.260000 0.000000 247.300000 12760.440000 1984.000000 1.000000 +AAAAAAAAAKGDAAAA NULL NULL NULL 26.000000 132.060000 0.000000 64.700000 -291.200000 1930.000000 2.000000 +AAAAAAAAAKHCAAAA NULL NULL NULL 99.000000 97.000000 0.000000 19.400000 -3327.390000 1935.000000 1.000000 +AAAAAAAAALBEAAAA NULL NULL NULL 61.000000 7.760000 0.000000 2.630000 -125.050000 1981.000000 0.000000 +AAAAAAAAALFBAAAA NULL NULL NULL 58.000000 92.090000 0.000000 35.910000 -97.440000 1970.000000 3.000000 +AAAAAAAAALGCAAAA NULL NULL NULL 77.000000 36.240000 0.000000 18.840000 -66.220000 1983.000000 4.000000 +AAAAAAAAALLBAAAA NULL NULL NULL 82.000000 53.000000 0.000000 8.480000 -840.500000 1981.000000 4.000000 +AAAAAAAAALMDAAAA NULL NULL NULL 86.000000 32.020000 802.660000 17.610000 -1020.240000 1963.000000 6.000000 +AAAAAAAAALOAAAAA NULL NULL NULL 78.000000 91.520000 0.000000 73.210000 44.460000 1964.000000 6.000000 +AAAAAAAAAMBAAAAA NULL NULL NULL 79.000000 93.970000 0.000000 93.970000 4924.070000 1948.000000 2.000000 +AAAAAAAAAMDBAAAA NULL NULL NULL 15.000000 79.140000 0.000000 18.990000 -421.800000 1969.000000 2.000000 +AAAAAAAAAMEAAAAA NULL NULL NULL 10.000000 164.570000 0.000000 80.630000 -123.500000 1934.000000 5.000000 +AAAAAAAAAMFDAAAA NULL NULL NULL 2.000000 41.000000 0.000000 17.220000 -4.800000 1948.000000 6.000000 +AAAAAAAAAMGBAAAA NULL NULL NULL 66.000000 12.410000 0.000000 3.590000 -140.580000 1990.000000 0.000000 +AAAAAAAAAMLDAAAA NULL NULL NULL 70.000000 147.430000 297.020000 8.840000 -3444.920000 1943.000000 4.000000 +AAAAAAAAAMNAAAAA NULL NULL NULL 41.000000 53.225000 0.000000 37.950000 121.915000 1960.000000 5.000000 +AAAAAAAAANABAAAA NULL NULL NULL 94.000000 8.250000 30.830000 0.410000 -293.090000 1986.000000 6.000000 +AAAAAAAAANAEAAAA NULL NULL NULL 5.000000 47.390000 0.000000 9.470000 -151.800000 1931.000000 2.000000 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q19.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q19.sql.out new file mode 100644 index 0000000000000..29347b2d590bc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q19.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +10012006 importoamalgamalg #x 221 oughtableable 56586.14 +6015008 scholarbrand #x 66 callycally 46201.70 +4001001 amalgedu pack #x 950 barantin st 43315.50 +3002002 importoexporti #x 752 ableantiation 42749.12 +2003001 exportiimporto #x 586 callyeinganti 41753.03 +6009007 maxicorp #x 120 barableought 41183.43 +8010005 univmaxi #x 520 barableanti 40133.14 +7005005 scholarbrand #x 187 ationeingought 37940.95 +10004015 edu packunivamalg #x 439 n stpriese 36037.04 +9015005 scholarunivamalg #x 297 ationn stable 34881.18 +5003001 exportischolar #x 227 ationableable 34528.86 +2002001 importoimporto #x 536 callyprianti 34412.64 +7007003 brandbrand #x 759 n stantiation 33533.84 +7016003 corpnameless #x 271 oughtationable 32722.68 +10003006 exportiunivamalg #x 105 antibarought 31509.32 +3003001 exportiexporti #x 178 eingationought 30944.05 +2003001 exportiimporto #x 269 n stcallyable 30743.96 +7012007 importonameless #x 578 eingationanti 30629.71 +9010011 univunivamalg #x 27 ationable 30165.17 +1001001 amalgamalg #x 390 barn stpri 29510.42 +1004002 edu packamalg #x 86 callyeing 28798.78 +8016010 corpmaxi #x 745 antieseation 28399.44 +3003002 exportiexporti #x 52 ableanti 28330.70 +7002007 importobrand #x 261 oughtcallyable 28076.07 +2002001 importoimporto #x 364 esecallypri 27831.19 +5001002 amalgscholar #x 743 prieseation 27622.14 +8006009 corpnameless #x 148 eingeseought 26685.21 +2002001 importoimporto #x 68 eingcally 26391.94 +8004005 edu packnameless #x 192 ablen stought 26231.73 +1004001 edu packamalg #x 583 prieinganti 26107.88 +1001001 amalgamalg #x 282 ableeingable 26016.70 +8006009 corpnameless #x 319 n stoughtpri 25529.26 +6016003 corpbrand #x 110 baroughtought 25233.47 +9007003 brandmaxi #x 34 esepri 25164.92 +2004001 edu packimporto #x 5 anti 25083.59 +5002001 importoscholar #x 582 ableeinganti 24752.75 +3001001 amalgexporti #x 296 callyn stable 24732.94 +7007007 brandbrand #x 529 n stableanti 24268.11 +8010009 univmaxi #x 777 ationationation 24160.84 +8007002 brandnameless #x 192 ablen stought 23590.40 +8014006 edu packmaxi #x 4 ese 23430.31 +6005005 scholarcorp #x 129 n stableought 23382.47 +8015001 scholarmaxi #x 78 eingation 23235.50 +6004007 edu packcorp #x 158 eingantiought 23188.37 +9016003 corpunivamalg #x 304 esebarpri 23156.77 +10010013 univamalgamalg #x 591 oughtn stanti 23127.55 +2004001 edu packimporto #x 563 pricallyanti 22985.88 +2003002 exportiimporto #x 490 barn stese 22045.36 +1003002 exportiamalg #x 376 callyationpri 21890.84 +1004001 edu packamalg #x 39 n stpri 21878.31 +1001001 amalgamalg #x 760 barcallyation 21856.16 +9014002 edu packunivamalg #x 78 eingation 21725.66 +1004001 edu packamalg #x 366 callycallypri 21166.78 +1004001 edu packamalg #x 513 prioughtanti 21125.73 +1002001 importoamalg #x 942 ableesen st 21119.54 +5002002 importoscholar #x 102 ablebarought 21049.49 +5002001 importoscholar #x 75 antiation 20510.26 +8002004 importonameless #x 2 able 20401.46 +8011002 amalgmaxi #x 29 n stable 20270.33 +5001001 amalgscholar #x 127 ationableought 19976.77 +1001001 amalgamalg #x 522 ableableanti 19773.14 +7003005 exportibrand #x 45 antiese 19662.73 +1002001 importoamalg #x 361 oughtcallypri 19619.15 +7007002 brandbrand #x 410 baroughtese 18996.04 +NULL brandcorp #x NULL NULL 18842.73 +9008008 namelessmaxi #x 607 ationbarcally 18650.79 +8015010 scholarmaxi #x 410 baroughtese 18465.35 +10008005 namelessunivamalg #x 349 n stesepri 18229.28 +9001008 amalgmaxi #x 840 bareseeing 17824.97 +2004002 edu packimporto #x 314 eseoughtpri 17523.17 +4003001 exportiedu pack #x 873 priationeing 17462.90 +9007005 brandmaxi #x 546 callyeseanti 17405.98 +10013015 exportiamalgamalg #x 427 ationableese 17058.19 +3001001 amalgexporti #x 139 n stpriought 16994.07 +8015002 scholarmaxi #x 15 antiought 16963.84 +4003002 exportiedu pack #x 664 esecallycally 16936.98 +6005001 scholarcorp #x 404 esebarese 16500.58 +2003002 exportiimporto #x 333 pripripri 16133.68 +9006003 corpmaxi #x 494 esen stese 16104.95 +6009007 maxicorp #x 468 eingcallyese 16083.46 +4002002 importoedu pack #x 408 eingbarese 15980.04 +8012009 importomaxi #x 351 oughtantipri 15946.21 +4001002 amalgedu pack #x 102 ablebarought 15911.13 +6011007 amalgbrand #x 822 ableableeing 15556.11 +4004002 edu packedu pack #x 51 oughtanti 15506.23 +4003002 exportiedu pack #x 12 ableought 15452.21 +10010010 univamalgamalg #x 721 oughtableation 15210.55 +3001001 amalgexporti #x 574 eseationanti 14927.08 +3002002 importoexporti #x 382 ableeingpri 14658.43 +3001001 amalgexporti #x 142 ableeseought 14633.69 +10002014 importounivamalg #x 153 priantiought 14599.02 +1004001 edu packamalg #x 148 eingeseought 14327.50 +5003002 exportischolar #x 164 esecallyought 14289.22 +7008009 namelessbrand #x 532 ableprianti 14197.70 +4003001 exportiedu pack #x 258 eingantiable 14148.81 +7007001 brandbrand #x 281 oughteingable 13920.21 +2002001 importoimporto #x 258 eingantiable 13819.06 +8007007 brandnameless #x 423 priableese 13589.86 +4004001 edu packedu pack #x 456 callyantiese 13461.44 +8013009 exportimaxi #x 599 n stn stanti 13459.83 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q2.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q2.sql.out new file mode 100644 index 0000000000000..44e1f7bfef7fa --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q2.sql.out @@ -0,0 +1,2518 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +5270 3.18 1.63 2.25 1.64 3.41 3.62 3.72 +5270 3.18 1.63 2.25 1.64 3.41 3.62 3.72 +5270 3.18 1.63 2.25 1.64 3.41 3.62 3.72 +5270 3.18 1.63 2.25 1.64 3.41 3.62 3.72 +5270 3.18 1.63 2.25 1.64 3.41 3.62 3.72 +5270 3.18 1.63 2.25 1.64 3.41 3.62 3.72 +5270 3.18 1.63 2.25 1.64 3.41 3.62 3.72 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5271 1.00 1.15 1.23 0.82 1.06 0.85 0.95 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5272 1.22 0.86 1.29 0.95 0.98 1.00 0.84 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5273 1.20 0.99 1.15 0.86 0.91 1.19 0.90 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5274 0.97 0.95 1.08 1.19 0.97 0.89 0.96 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5275 0.99 0.89 1.42 1.00 0.84 1.11 0.98 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5276 0.97 1.06 1.16 0.86 0.98 1.25 1.13 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5277 0.91 0.91 1.02 0.95 1.00 1.05 0.90 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5278 0.96 0.94 1.29 1.04 0.95 2.06 1.46 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5279 0.87 0.86 0.88 0.99 0.38 0.83 0.77 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5280 0.96 0.89 0.73 1.09 1.09 0.91 1.21 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5281 0.99 1.03 1.09 0.86 0.92 1.13 1.01 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5282 0.97 0.89 1.08 1.10 1.15 0.86 1.33 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5283 1.27 0.85 1.07 0.88 1.23 0.93 1.27 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5284 1.06 0.92 0.95 1.04 0.95 1.29 0.89 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5285 1.10 1.20 0.97 1.14 1.11 1.12 0.95 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5286 1.09 1.17 1.17 0.86 1.12 1.39 1.00 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5287 0.94 1.00 0.99 0.76 1.10 0.90 0.96 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5288 0.95 1.07 1.40 1.05 0.94 0.94 1.01 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5289 0.99 1.20 0.90 0.95 1.01 0.82 0.76 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5290 1.05 1.10 1.04 1.22 0.97 0.98 0.98 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5291 0.78 1.28 0.90 0.99 0.97 1.09 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5292 1.13 0.79 1.17 1.07 0.88 0.85 0.91 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5293 1.29 0.96 0.89 0.87 0.97 0.89 1.06 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5294 1.18 1.05 1.25 0.98 0.88 1.02 0.69 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5295 0.87 1.08 1.03 1.01 0.88 1.27 1.12 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5296 0.74 1.11 0.96 1.12 1.00 1.25 1.02 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5297 1.04 0.97 0.98 0.79 0.90 0.90 1.03 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5298 0.80 0.78 0.94 1.04 1.26 0.91 0.90 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5299 0.87 1.00 1.14 1.13 1.07 1.20 1.01 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5300 0.53 0.41 0.98 0.67 0.80 0.56 0.41 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5301 0.95 1.05 0.38 0.50 0.76 1.10 1.14 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5302 1.03 0.80 0.85 1.12 1.00 0.96 1.01 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5303 0.77 1.23 0.94 1.09 0.98 0.96 0.98 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5304 0.96 0.82 1.13 1.04 1.07 1.24 1.00 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5305 1.01 0.96 0.91 0.91 0.90 1.15 1.09 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5306 0.83 0.99 0.97 1.04 0.90 1.00 1.03 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5307 0.97 0.99 0.89 0.88 1.07 1.02 0.94 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5308 0.93 0.95 1.10 0.97 1.10 0.89 1.04 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5309 1.20 0.90 1.05 1.11 0.96 1.05 1.06 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5310 0.97 1.10 1.12 1.06 0.96 1.03 0.87 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5311 1.09 0.88 1.06 1.01 0.91 1.10 1.03 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5312 1.06 0.93 0.78 0.99 1.03 0.87 1.07 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5313 0.62 0.78 1.13 1.03 1.13 1.04 0.85 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5314 0.98 1.16 0.71 0.57 0.70 1.07 1.06 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5315 1.10 1.09 0.99 1.02 1.11 1.00 1.02 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5316 1.01 1.07 1.09 1.01 1.08 1.03 0.87 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5317 0.96 1.04 0.94 0.99 1.09 0.95 0.88 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5318 0.94 1.00 1.18 0.94 0.87 1.02 1.11 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5319 0.97 0.96 0.96 1.12 1.00 0.93 0.88 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5320 1.06 0.94 0.97 1.14 0.96 0.90 1.04 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5321 0.96 1.01 0.96 1.03 0.97 0.95 0.89 +5322 4.54 4.72 0.99 1.74 1.43 4.36 5.11 +5322 4.54 4.72 0.99 1.74 1.43 4.36 5.11 +5322 4.54 4.72 0.99 1.74 1.43 4.36 5.11 +5322 4.54 4.72 0.99 1.74 1.43 4.36 5.11 +5322 4.54 4.72 0.99 1.74 1.43 4.36 5.11 +5322 4.54 4.72 0.99 1.74 1.43 4.36 5.11 +5322 4.54 4.72 0.99 1.74 1.43 4.36 5.11 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q20.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q20.sql.out new file mode 100644 index 0000000000000..3c2757f0645f7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q20.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL Books NULL NULL 9010.49 72.07596281370536693 +NULL Books NULL 6.35 1491.96 11.93436244638591899 +Precisely elderly bodies Books arts 1.40 4094.31 1.52075020571659240 +Close, precise teeth should go for a qualities. Political groups shall not become just important occasions. Trials mean ne Books arts 2.53 332.38 0.12345595555199313 +Abilities could affect cruel parts. Predominantly other events telephone strong signs. Accurate mate Books arts 25.69 2626.56 0.97558359291967949 +Average parents require also times. Children would not describe lightly purposes; large miles love now correct relations. Usual, german goals proceed literary, wooden visitors. Initial councils wil Books arts 1.24 12327.20 4.57869383019594946 +Great, contemporary workers would not remove of course cultural values. Then due children might see positive seconds. Significant problems w Books arts 0.55 343.80 0.12769768794384511 +Small objects stop etc mediterranean patterns; liberal, free initiatives would not leave less clear british attitudes; good, blue relationships find softly very Books arts 58.41 886.92 0.32942883476194038 +Newly national rights head curiously all electrical cells. Chinese, long values might not pull bad lines. High fun clothes ough Books arts 3.28 2219.85 0.82451923380495801 +Quick, easy studies must make always necessary systems. Upper, new persons should buy much physical technologies. English sciences hear solicitors. S Books arts 0.99 2050.16 0.76149125047979491 +Early, short v Books arts 75.57 5429.86 2.01681375177070042 +Black, following services justify by a investors; dirty, different charts will fly however prizes. Temporary, l Books arts 5.56 13539.35 5.02892289488801418 +Scientific, difficult polls would not achieve. Countries reach of course. Bad, new churches realize most english Books arts 3.98 143.88 0.05344137097545211 +United, important objectives put similarly large, previous phenomena; old, present days receive. Happy detectives assi Books arts 1.26 12297.15 4.56753235398096242 +Naturally new years put serious, negative vehicles. Fin Books arts 3.34 4587.47 1.70392470189572752 +Ago correct profits must not handle else. Healthy children may not go only ancient words. Later just characters ought to drink about. British parts must watch soon ago other clients. So vital d Books arts 4.03 5359.20 1.99056849688381241 +Much new waters Books arts 1.85 6718.63 2.49550179508480530 +Hard different differences would not paint even. Together suitable schemes marry directly only open women. Social ca Books arts 2.65 3208.60 1.19177080144450674 +Tall, following actions keep widely willing, secondary groups. Heads could afford however; agricultural, square pri Books arts 9.99 4780.52 1.77562929368618505 +Anonymous, useful women provoke slightly present persons. Ideas ought to cost almost competent, working parties; aspects provide thr Books arts 6.73 5622.46 2.08835119999055082 +Powerful walls will find; there scottish decades must not Books arts 4.16 7914.41 2.93965054810833964 +Too executive doors progress mainly seemingly possible parts; hundreds stay virtually simple workers. Sola Books arts 34.32 3029.48 1.12524023173973205 +Careful privileges ought to live rather to a boards. Possible, broad p Books arts 3.93 1450.99 0.53894144336718969 +Aside legitimate decisions may not stand probably sexual g Books arts 3.88 9619.83 3.57309496629679899 +Specially interesting crews continue current, foreign directions; only social men would not call at least political children; circumstances could not understand now in a assessme Books arts 2.13 13616.57 5.05760473160419719 +Unlikely states take later in general extra inf Books arts 0.32 11879.56 4.41242683475911751 +Sometimes careful things state probably so Books arts 5.08 25457.85 9.45581321995700176 +Circumstances would not use. Principles seem writers. Times go from a hands. Members find grounds. Central, only teachers pursue properly into a p Books arts 5.95 2567.54 0.95366178505916251 +Inches may lose from a problems. Firm, other corporations shall protect ashamed, important practices. Materials shall not make then by a police. Weeks used Books arts 0.84 1811.85 0.67297572978782944 +Systems cannot await regions. Home appropr Books arts 7.30 1730.16 0.64263360027028230 +Extra, primitive weeks look obviou Books arts 1.18 22.77 0.00845746467272063 +More than key reasons should remain. Words used to offer slowly british Books arts 0.28 10311.18 3.82988320527288194 +Children may turn also above, historical aspects. Surveys migh Books arts 7.22 11872.32 4.40973768042312729 +Trustees know operations. Now past issues cut today german governments. British lines go critical, individual structures. Tonight adequate problems should no Books arts 4.05 8348.99 3.10106666569599586 +Useful observers start often white colleagues; simple pro Books arts 3.47 7565.51 2.81005856636428042 +Members should say earnings. Detailed departments would not move just at the hopes. Figures can take. Actually open houses want. Good teachers combine the Books arts 3.09 4363.97 1.62091006182752106 +Major, senior words afford economic libraries; successful seconds need outside. Clinical, new ideas put now red c Books arts 5.87 9661.08 3.58841646026911898 +Likely states feel astonishingly working roads. Parents put so somewhere able policies. Others may rely shortly instead interesting bodies; bri Books arts 7.50 132.66 0.04927392461498107 +Floors could not go only for a years. Special reasons shape consequently black, concerned instances. Mutual depths encourage both simple teachers. Cards favour massive Books arts 1.83 20114.53 7.47114303396483641 +Accurate years want then other organisations. Simple lines mean as well so red results. Orthodox, central scales will not in Books arts 7.69 2153.04 0.79970398502215321 +Certain customers think exactly already necessary factories. Awkward doubts shall not forget fine Books arts 0.30 231.71 0.08606408165639427 +Visitors could not allow glad wages. Communist, real figures used to apply factors. Aggressive, optimistic days must mean about trees. Detailed courts consider really large pro Books arts 9.08 24425.09 9.07221501111207600 +Deep, big areas take for a facilities. Words could replace certainly cases; lights test. Nevertheless practical arts cross. Fa Books arts 7.37 4380.23 1.62694951617879192 +New, reluctant associations see more different, physical symptoms; useful pounds ought to give. Subjects Books business 9.02 3044.02 1.58609001939612781 +Imports involve most now indian women. Developments announce intimately in a copies. Projects Books business 3.26 472.29 0.24608723177265498 +Years shall want free objects. Old residents use absolutely so residential steps. Letters will share variables. Sure fres Books business 40.76 30227.05 15.74983814849696292 +Whole, important problems make. Indeed industrial members go skills. Soft Books business 3.22 137.92 0.07186336997625310 +Other, black houses flow. New soldiers put only eastern hours. Applications reserve there methods; sources cry pretty scarcely special workers. Never british opportunities Books business 8.20 736.96 0.38399383075478162 +Rows could not Books business 1.65 1290.88 0.67261446516056841 +Remaining subjects handle even only certain ladies; eagerly literary days could not provide. Very different articles cut then. Boys see out of a houses. Governme Books business 9.03 1065.30 0.55507575431918810 +White members see highly on a negotiations. Evident, passive colours can refer familiar, ugly factors; away small examinations shall prove Books business 17.97 1446.00 0.75343991433919646 +Manufacturing, ready concerns see already then new pupils. Both stable types used to manage otherw Books business 1.18 2635.71 1.37333963805184198 +Small, capable centres Books business 2.98 5029.45 2.62060053746422658 +Popular, different parameters might take open, used modules. Prisoners use pretty alternative lovers. Annual, professional others spend once true men. Other, small subsidies seem politically Books business 7.25 621.26 0.32370821658531756 +Supreme, free uses handle even in the customers. Other minutes might not make of course social neighbours. So environmental rights come other, able sales Books business 8.08 3950.22 2.05826654109334761 +Always other hours used to use. Women should jump then. Civil samples take therefore other offices. Concrete, major demands Books business 1.42 2013.79 1.04928752772968910 +Visual fragments Books business 6.77 930.13 0.48464527491308216 +Classic issues will draw as european, engl Books business 75.64 556.83 0.29013689315456070 +Again british shareholders see shares. American lives ought to establish horses. Then ideal conservatives might charge even nec Books business 2.44 1898.13 0.98902275560488173 +Confident, video-tape Books business 3.17 1131.00 0.58930881266779474 +Of course fundamental children will not deal still including a suppliers. More crucial powers will not keep enough. As good comments used to devote even convenient electric problems. Publi Books business 8.85 414.75 0.21610595053401226 +Departments could seek now for a commu Books business 5.93 9895.85 5.15624369039663714 +Paintings must not know primary, royal stands; similar, available others ough Books business 0.39 13809.44 7.19542412909562460 +Most present eyes restore fat, central relationships; again considerable habits must face in a discussions. Engineers help at all direct occasions. Curiously del Books business 80.10 9267.25 4.82871095861681771 +So white countries could secure more angry items. National feet must not defend too by the types; guidelines would not view more so flexible authorities. Critics will handle closely lig Books business 2.50 2542.50 1.32477246349059959 +Simple changes ought to vote almost sudden techniques. Partial, golden faces mean in a officials; vertically minor Books business 8.73 22710.22 11.83318548507904997 +Christian lines stand once deep formal aspirations. National, fine islands play together with a patterns. New journals lose etc positive armie Books business 4.89 11560.78 6.02375732565303988 +Children would not mean in favour of a parts. Heavy, whole others shall mean on Books business 3.13 9065.09 4.72337526492192700 +Lips will n Books business 8.48 541.62 0.28221170567385587 +White fees might combine reports. Tr Books business 2.09 37.60 0.01959152197728478 +Asleep children invite more. Wealthy forms could expect as. Indeed statistical examinations could la Books business 3.71 2082.24 1.08495347664844290 +Most new weeks go yet members. Also encouraging delegates make publications. Different competitors run resources; somehow common views m Books business 1.07 13412.42 6.98855641485568838 +Local, bloody names Books business 4.40 1997.44 1.04076834197626873 +Large, larg Books business 3.50 12097.82 6.30358261721370521 +Only, gothic Books business 1.68 5708.95 2.97465477106967886 +Low, large clouds will not visit for example as the notions. Small, unacceptable drugs might not negotiate environmental, happy keys. Books business 3.11 3020.85 1.57401726502874248 +Silver, critical operations could help howev Books business 5.56 2286.24 1.19124790439754116 +Terrible, psychiatric bones will destroy also used studies; solely usual windows should not make shares. Advances continue sufficiently. As key days might not use far artists. Offici Books business 5.83 6672.40 3.47666146918178041 +Too white addresses end by the talks. Hands get only companies. Statements know. Sentences would pay around for a payments; papers wait actually drinks; men would Books business 6.06 7609.35 3.96486031270882752 +New, big arguments may not win since by a tenant Books computers 1.00 904.16 0.32327741862037314 +Else substantial problems slip months. Just unique corporations put vast areas. Supporters like far perfect chapters. Now young reports become wrong trials. Available ears shall Books computers 51.46 18752.88 6.70498876094676063 +Cheap, desirable members take immediate, estimated debts; months must track typica Books computers 3.26 10027.86 3.58540600677589698 +Expert, scottish terms will ask quiet demands; poor bits attempt northern, dangerous si Books computers 2.66 7330.68 2.62104418148557444 +Gradually serious visitors bear no doubt technical hearts. Critics continue earlier soviet, standard minute Books computers 6.40 1711.84 0.61205894564136830 +Clear, general goods must know never women. Communications meet about. Other rewards spot wide in a skills. Relative, empty drawings facilitate too rooms. Still asian police end speedily comp Books computers 7.64 1292.04 0.46196177220211789 +At least remaining results shall keep cuts. Clients should meet policies. Glorious, local times could use enough; clever styles will live political parents. Single, gradual contracts will describe ho Books computers 9.51 3033.10 1.08446816760026298 +Environmental, new women pay again fingers. Different, uncomfortable records miss far russian, dependent members. Enough double men will go here immediatel Books computers 89.89 8553.39 3.05821739476786568 +Years learn here. Days make too. Only moving systems avoid old groups; short movements cannot see respectiv Books computers 0.60 3411.40 1.21972724504682903 +Magnetic Books computers 57.19 3569.09 1.27610843437421206 +Ga Books computers 5.53 2687.70 0.96097230360331899 +S Books computers 65.78 1613.04 0.57673355084432699 +Simple year Books computers 3.01 1262.79 0.45150359611088856 +Agricultural players shall smoke. So full reasons undertake Books computers 0.70 4408.27 1.57615261257037727 +Then basic years can encourage later traditions. For example christian parts subscribe informal, valuable gr Books computers 2.75 844.19 0.30183547604973987 +Boxes batt Books computers 0.83 15300.82 5.47072375727191844 +Separate, dead buildings think possibly english, net policies. Big divisions can use almost Books computers 9.46 12403.71 4.43487806374503246 +Artists make times. Rather ready functions must pre Books computers 5.71 1533.00 0.54811569052494252 +Advantages emerge moves; special, expected operations pass etc natural preferences; very posit Books computers 0.15 5241.45 1.87405152387603389 +Since other birds shall blame sudden Books computers 6.74 2098.16 0.75018552983158082 +Legs throw then. Old-fashioned develo Books computers 2.66 163.26 0.05837271209073850 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q21.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q21.sql.out new file mode 100644 index 0000000000000..9d7ddb1678a57 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q21.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +Just good amou AAAAAAAAAAEAAAAA 2473 2677 +Just good amou AAAAAAAAAAPBAAAA 2415 2071 +Just good amou AAAAAAAAACACAAAA 2792 2465 +Just good amou AAAAAAAAACGCAAAA 1396 2084 +Just good amou AAAAAAAAACKCAAAA 1974 1585 +Just good amou AAAAAAAAACPCAAAA 2131 1690 +Just good amou AAAAAAAAADACAAAA 2432 2093 +Just good amou AAAAAAAAADBBAAAA 1747 2529 +Just good amou AAAAAAAAADNAAAAA 2763 1862 +Just good amou AAAAAAAAAELBAAAA 2984 2371 +Just good amou AAAAAAAAAFFDAAAA 2858 2415 +Just good amou AAAAAAAAAFJDAAAA 2479 2176 +Just good amou AAAAAAAAAFLDAAAA 2892 2303 +Just good amou AAAAAAAAAGLDAAAA 2083 1892 +Just good amou AAAAAAAAAGPCAAAA 1596 1191 +Just good amou AAAAAAAAAHBAAAAA 2398 2956 +Just good amou AAAAAAAAAHPBAAAA 1775 2655 +Just good amou AAAAAAAAAINCAAAA 2296 2458 +Just good amou AAAAAAAAAJIDAAAA 2528 2552 +Just good amou AAAAAAAAAKABAAAA 1881 1465 +Just good amou AAAAAAAAALFEAAAA 2952 2933 +Just good amou AAAAAAAAALIDAAAA 1918 2438 +Just good amou AAAAAAAAALOAAAAA 1904 1396 +Just good amou AAAAAAAAALOBAAAA 1340 1570 +Just good amou AAAAAAAAALPAAAAA 2299 1692 +Just good amou AAAAAAAAANLCAAAA 3000 3113 +Just good amou AAAAAAAAAOMDAAAA 2294 1928 +Just good amou AAAAAAAABABCAAAA 2308 1807 +Just good amou AAAAAAAABAGAAAAA 2358 2308 +Just good amou AAAAAAAABCCCAAAA 1694 1863 +Just good amou AAAAAAAABECDAAAA 2361 1636 +Just good amou AAAAAAAABEMCAAAA 2644 2018 +Just good amou AAAAAAAABHACAAAA 1471 1982 +Just good amou AAAAAAAABHPCAAAA 1729 1481 +Just good amou AAAAAAAABKEBAAAA 2284 1940 +Just good amou AAAAAAAABLBDAAAA 1910 2399 +Just good amou AAAAAAAABMCBAAAA 2460 2407 +Just good amou AAAAAAAABMOBAAAA 2405 1669 +Just good amou AAAAAAAABNEBAAAA 2733 2113 +Just good amou AAAAAAAABOKDAAAA 3609 2690 +Just good amou AAAAAAAABONAAAAA 2096 2325 +Just good amou AAAAAAAABPPAAAAA 1788 1540 +Just good amou AAAAAAAACACEAAAA 1763 1240 +Just good amou AAAAAAAACAHCAAAA 1877 2693 +Just good amou AAAAAAAACALAAAAA 3249 2868 +Just good amou AAAAAAAACALBAAAA 1663 1528 +Just good amou AAAAAAAACBDBAAAA 2334 2813 +Just good amou AAAAAAAACBHBAAAA 1791 2015 +Just good amou AAAAAAAACCABAAAA 2715 2959 +Just good amou AAAAAAAACCJBAAAA 2461 1696 +Just good amou AAAAAAAACCPDAAAA 3129 2313 +Just good amou AAAAAAAACDGCAAAA 2114 1790 +Just good amou AAAAAAAACDIBAAAA 2874 3081 +Just good amou AAAAAAAACEHDAAAA 1616 1765 +Just good amou AAAAAAAACEICAAAA 2037 2461 +Just good amou AAAAAAAACFKDAAAA 2373 1698 +Just good amou AAAAAAAACGJDAAAA 2578 1814 +Just good amou AAAAAAAACGMAAAAA 2285 1553 +Just good amou AAAAAAAACHCDAAAA 2620 2504 +Just good amou AAAAAAAACIICAAAA 2800 2293 +Just good amou AAAAAAAACJBEAAAA 2718 2070 +Just good amou AAAAAAAACJGDAAAA 2153 1778 +Just good amou AAAAAAAACJNCAAAA 1482 1582 +Just good amou AAAAAAAACKBAAAAA 3122 2281 +Just good amou AAAAAAAACKCAAAAA 1664 1982 +Just good amou AAAAAAAACKHBAAAA 2222 1546 +Just good amou AAAAAAAACKHDAAAA 2312 1798 +Just good amou AAAAAAAACKKBAAAA 2463 1829 +Just good amou AAAAAAAACLDAAAAA 2523 2348 +Just good amou AAAAAAAACOLBAAAA 1630 2360 +Just good amou AAAAAAAACPFDAAAA 1863 1405 +Just good amou AAAAAAAACPKBAAAA 2088 2537 +Just good amou AAAAAAAACPLDAAAA 1982 1599 +Just good amou AAAAAAAADBECAAAA 3507 2356 +Just good amou AAAAAAAADBGAAAAA 1819 1772 +Just good amou AAAAAAAADCEEAAAA 2655 1843 +Just good amou AAAAAAAADDEAAAAA 2210 2733 +Just good amou AAAAAAAADDOCAAAA 2198 2067 +Just good amou AAAAAAAADEHCAAAA 3190 2928 +Just good amou AAAAAAAADFLDAAAA 2603 1991 +Just good amou AAAAAAAADHDAAAAA 1649 1777 +Just good amou AAAAAAAADIIAAAAA 1914 1818 +Just good amou AAAAAAAADIOAAAAA 2058 2133 +Just good amou AAAAAAAADJPBAAAA 2840 1910 +Just good amou AAAAAAAADLBEAAAA 2293 1578 +Just good amou AAAAAAAADLHBAAAA 1817 1316 +Just good amou AAAAAAAADMCCAAAA 1944 2028 +Just good amou AAAAAAAADPDBAAAA 1993 1430 +Just good amou AAAAAAAAECEDAAAA 1968 2076 +Just good amou AAAAAAAAEEOBAAAA 1992 1737 +Just good amou AAAAAAAAEEODAAAA 2938 2820 +Just good amou AAAAAAAAEFACAAAA 2213 2877 +Just good amou AAAAAAAAEGCCAAAA 2262 3212 +Just good amou AAAAAAAAEGCEAAAA 3052 2175 +Just good amou AAAAAAAAEIEDAAAA 1786 2175 +Just good amou AAAAAAAAEIHDAAAA 1938 1944 +Just good amou AAAAAAAAEINDAAAA 2402 2113 +Just good amou AAAAAAAAEKADAAAA 1327 1683 +Just good amou AAAAAAAAELKAAAAA 1817 2630 +Just good amou AAAAAAAAEMHCAAAA 2260 2878 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q22.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q22.sql.out new file mode 100644 index 0000000000000..e8a553dd5094e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q22.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +esepriableanti NULL NULL NULL 429.7808764940239 +esepriableanti importoamalg #x NULL NULL 429.7808764940239 +esepriableanti importoamalg #x fragrances NULL 429.7808764940239 +esepriableanti importoamalg #x fragrances Women 429.7808764940239 +n stbarn stbarought NULL NULL NULL 430.0122448979592 +n stbarn stbarought amalgimporto #x NULL NULL 430.0122448979592 +n stbarn stbarought amalgimporto #x accessories NULL 430.0122448979592 +n stbarn stbarought amalgimporto #x accessories Men 430.0122448979592 +antiationeing NULL NULL NULL 437.03614457831327 +antiationeing amalgexporti #x NULL NULL 437.03614457831327 +antiationeing amalgexporti #x newborn NULL 437.03614457831327 +antiationeing amalgexporti #x newborn Children 437.03614457831327 +n stpriantin st NULL NULL NULL 438.77868852459017 +n stpriantin st exportiexporti #x NULL NULL 438.77868852459017 +n stpriantin st exportiexporti #x toddlers NULL 438.77868852459017 +n stpriantin st exportiexporti #x toddlers Children 438.77868852459017 +eingprically NULL NULL NULL 439.97975708502025 +eingprically amalgbrand #x NULL NULL 439.97975708502025 +eingprically amalgbrand #x semi-precious NULL 439.97975708502025 +eingprically amalgbrand #x semi-precious Jewelry 439.97975708502025 +prieingable NULL NULL NULL 440.096 +prieingable exportiunivamalg #x NULL NULL 440.096 +prieingable exportiunivamalg #x self-help NULL 440.096 +prieingable exportiunivamalg #x self-help Books 440.096 +oughteingn stationought NULL NULL NULL 440.1497975708502 +oughteingn stationought amalgscholar #x NULL NULL 440.1497975708502 +oughteingn stationought amalgscholar #x rock NULL 440.1497975708502 +oughteingn stationought amalgscholar #x rock Music 440.1497975708502 +eingationbaroughtought NULL NULL NULL 440.9721115537849 +eingationbaroughtought maxicorp #x NULL NULL 440.9721115537849 +eingationbaroughtought maxicorp #x womens watch NULL 440.9721115537849 +eingationbaroughtought maxicorp #x womens watch Jewelry 440.9721115537849 +priantibarpri NULL NULL NULL 443.45849802371544 +priantibarpri exportiimporto #x NULL NULL 443.45849802371544 +priantibarpri exportiimporto #x pants NULL 443.45849802371544 +priantibarpri exportiimporto #x pants Men 443.45849802371544 +prioughtantiation NULL NULL NULL 443.8825910931174 +prioughtantiation corpmaxi #x NULL NULL 443.8825910931174 +prioughtantiation corpmaxi #x parenting NULL 443.8825910931174 +prioughtantiation corpmaxi #x parenting Books 443.8825910931174 +eseprieingoughtought NULL NULL NULL 445.2016129032258 +eseprieingoughtought importonameless #x NULL NULL 445.2016129032258 +eseprieingoughtought importonameless #x baseball NULL 445.2016129032258 +eseprieingoughtought importonameless #x baseball Sports 445.2016129032258 +eingpriationanti NULL NULL NULL 445.4920634920635 +eingpriationanti scholarunivamalg #x NULL NULL 445.4920634920635 +eingpriationanti scholarunivamalg #x fiction NULL 445.4920634920635 +eingpriationanti scholarunivamalg #x fiction Books 445.4920634920635 +antin stablecallyought NULL NULL NULL 445.54918032786884 +antin stablecallyought importoedu pack #x NULL NULL 445.54918032786884 +antin stablecallyought importoedu pack #x mens NULL 445.54918032786884 +antin stablecallyought importoedu pack #x mens Shoes 445.54918032786884 +callycallyn steing NULL NULL NULL 445.9012345679012 +callycallyn steing corpunivamalg #x NULL NULL 445.9012345679012 +callycallyn steing corpunivamalg #x mystery NULL 445.9012345679012 +callycallyn steing corpunivamalg #x mystery Books 445.9012345679012 +oughtpribarought NULL NULL NULL 446.125 +oughtpribarought exportinameless #x NULL NULL 446.125 +oughtpribarought exportinameless #x wallpaper NULL 446.125 +oughtpribarought exportinameless #x wallpaper Home 446.125 +oughtantioughtbarought NULL NULL NULL 446.1847389558233 +oughtantioughtbarought edu packmaxi #x NULL NULL 446.1847389558233 +oughtantioughtbarought edu packmaxi #x entertainments NULL 446.1847389558233 +oughtantioughtbarought edu packmaxi #x entertainments Books 446.1847389558233 +callyoughtn stcallyought NULL NULL NULL 446.43650793650795 +callyoughtn stcallyought exportischolar #x NULL NULL 446.43650793650795 +callyoughtn stcallyought exportischolar #x pop NULL 446.43650793650795 +callyoughtn stcallyought exportischolar #x pop Music 446.43650793650795 +ationeingationableought NULL NULL NULL 446.48192771084337 +ationeingationableought namelessnameless #x NULL NULL 446.48192771084337 +ationeingationableought namelessnameless #x outdoor NULL 446.48192771084337 +ationeingationableought namelessnameless #x outdoor Sports 446.48192771084337 +priantiableese NULL NULL NULL 446.85483870967744 +priantiableese exportiedu pack #x NULL NULL 446.85483870967744 +priantiableese exportiedu pack #x kids NULL 446.85483870967744 +priantiableese exportiedu pack #x kids Shoes 446.85483870967744 +prieseeseableought NULL NULL NULL 446.9186991869919 +prieseeseableought amalgscholar #x NULL NULL 446.9186991869919 +prieseeseableought amalgscholar #x rock NULL 446.9186991869919 +prieseeseableought amalgscholar #x rock Music 446.9186991869919 +ationableoughtcallyought NULL NULL NULL 447.165991902834 +ationableoughtcallyought exportischolar #x NULL NULL 447.165991902834 +ationableoughtcallyought exportischolar #x pop NULL 447.165991902834 +ationableoughtcallyought exportischolar #x pop Music 447.165991902834 +pripricallyese NULL NULL NULL 447.2550607287449 +pripricallyese edu packimporto #x NULL NULL 447.2550607287449 +pripricallyese edu packimporto #x sports-apparel NULL 447.2550607287449 +pripricallyese edu packimporto #x sports-apparel Men 447.2550607287449 +eingableationn st NULL NULL NULL 447.3541666666667 +eingableationn st namelessmaxi #x NULL NULL 447.3541666666667 +eingableationn st namelessmaxi #x romance NULL 447.3541666666667 +eingableationn st namelessmaxi #x romance Books 447.3541666666667 +n stantin stoughtought NULL NULL NULL 448.2396694214876 +n stantin stoughtought importoscholar #x NULL NULL 448.2396694214876 +n stantin stoughtought importoscholar #x country NULL 448.2396694214876 +n stantin stoughtought importoscholar #x country Music 448.2396694214876 +n steingbaranti NULL NULL NULL 448.702479338843 +n steingbaranti amalgamalg #x NULL NULL 448.702479338843 +n steingbaranti amalgamalg #x dresses NULL 448.702479338843 +n steingbaranti amalgamalg #x dresses Women 448.702479338843 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q23a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q23a.sql.out new file mode 100644 index 0000000000000..abc7f25b4469f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q23a.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q23b.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q23b.sql.out new file mode 100644 index 0000000000000..04ba480fbec45 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q23b.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output + diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q24a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q24a.sql.out new file mode 100644 index 0000000000000..e50b231441a5d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q24a.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output + diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q24b.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q24b.sql.out new file mode 100644 index 0000000000000..e50b231441a5d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q24b.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output + diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q25.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q25.sql.out new file mode 100644 index 0000000000000..24b42a129ba4d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q25.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output + diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q26.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q26.sql.out new file mode 100644 index 0000000000000..c6760949c1f40 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q26.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAAABDAAAA 84.0 18.790000 0.000000 17.280000 +AAAAAAAAAABEAAAA 76.0 145.970000 4732.320000 115.310000 +AAAAAAAAAACAAAAA 67.0 55.950000 1532.610000 48.670000 +AAAAAAAAAADBAAAA 34.333333333333336 70.963333 0.000000 20.753333 +AAAAAAAAAAEDAAAA 45.0 93.180000 0.000000 16.770000 +AAAAAAAAAAEEAAAA 46.666666666666664 73.350000 10.526667 15.433333 +AAAAAAAAAAFAAAAA 31.0 42.450000 0.000000 22.920000 +AAAAAAAAAAHAAAAA 42.0 9.700000 0.000000 0.480000 +AAAAAAAAAAHDAAAA 44.5 89.835000 0.000000 75.130000 +AAAAAAAAAAICAAAA 2.0 117.590000 68.420000 35.270000 +AAAAAAAAAAIDAAAA 11.0 6.310000 13.950000 1.510000 +AAAAAAAAAAKAAAAA 87.0 142.525000 0.000000 32.775000 +AAAAAAAAAALCAAAA 65.5 114.655000 0.000000 12.395000 +AAAAAAAAAAOAAAAA 91.0 42.190000 0.000000 30.790000 +AAAAAAAAAAPBAAAA 56.0 37.590000 0.000000 22.335000 +AAAAAAAAAAPCAAAA 35.0 49.890000 0.000000 30.430000 +AAAAAAAAABAAAAAA 87.0 77.640000 0.000000 29.500000 +AAAAAAAAABAEAAAA 79.0 34.720000 0.000000 30.900000 +AAAAAAAAABBAAAAA 16.0 53.500000 0.000000 26.515000 +AAAAAAAAABBDAAAA 79.0 91.570000 0.000000 0.910000 +AAAAAAAAABCEAAAA 100.0 106.260000 0.000000 26.560000 +AAAAAAAAABDAAAAA 58.0 3.020000 0.000000 2.080000 +AAAAAAAAABDBAAAA 21.0 72.850000 0.000000 57.550000 +AAAAAAAAABEAAAAA 71.0 70.970000 0.000000 48.250000 +AAAAAAAAABFCAAAA 33.0 284.590000 0.000000 36.990000 +AAAAAAAAABGAAAAA 54.5 77.980000 0.000000 51.590000 +AAAAAAAAABGBAAAA 84.0 18.370000 300.835000 14.035000 +AAAAAAAAABJDAAAA 42.0 41.960000 0.000000 8.810000 +AAAAAAAAABKCAAAA 27.0 62.695000 0.000000 24.770000 +AAAAAAAAABLBAAAA 62.0 112.810000 0.000000 54.795000 +AAAAAAAAABLCAAAA 42.0 206.490000 0.000000 61.940000 +AAAAAAAAABMAAAAA 45.5 158.505000 1467.465000 50.865000 +AAAAAAAAABMBAAAA 54.0 38.760000 0.000000 20.930000 +AAAAAAAAABNDAAAA 2.0 227.200000 0.000000 34.080000 +AAAAAAAAACBCAAAA 82.0 200.340000 0.000000 154.260000 +AAAAAAAAACCDAAAA 8.0 96.950000 0.000000 89.190000 +AAAAAAAAACDDAAAA 99.0 215.550000 5622.900000 66.820000 +AAAAAAAAACECAAAA 35.0 117.300000 0.000000 32.840000 +AAAAAAAAACEEAAAA 67.0 221.660000 2747.330000 164.020000 +AAAAAAAAACFAAAAA 81.0 16.420000 148.390000 2.290000 +AAAAAAAAACFBAAAA 23.0 148.690000 0.000000 96.640000 +AAAAAAAAACGAAAAA 71.5 182.975000 0.000000 89.260000 +AAAAAAAAACGDAAAA 38.0 111.060000 0.000000 43.310000 +AAAAAAAAACHBAAAA 62.0 199.820000 0.000000 67.930000 +AAAAAAAAACIDAAAA 73.0 184.700000 1925.030000 38.780000 +AAAAAAAAACJDAAAA 12.0 58.740000 319.710000 42.290000 +AAAAAAAAACLBAAAA 57.5 78.230000 391.295000 11.920000 +AAAAAAAAACLDAAAA 6.0 127.370000 0.000000 118.450000 +AAAAAAAAACMAAAAA 84.0 118.000000 0.000000 20.060000 +AAAAAAAAACNCAAAA 8.0 25.910000 99.840000 18.910000 +AAAAAAAAACODAAAA 49.0 106.120000 0.000000 6.360000 +AAAAAAAAADBBAAAA 77.0 166.050000 3605.600000 99.630000 +AAAAAAAAADCDAAAA 3.0 191.710000 0.000000 70.930000 +AAAAAAAAADDBAAAA 46.0 68.830000 0.000000 28.900000 +AAAAAAAAADEAAAAA 78.0 20.720000 0.000000 5.800000 +AAAAAAAAADEBAAAA 57.0 54.900000 0.000000 8.230000 +AAAAAAAAADFAAAAA 70.0 75.673333 777.880000 21.056667 +AAAAAAAAADFCAAAA 44.0 98.340000 182.190000 82.775000 +AAAAAAAAADFDAAAA 5.0 40.030000 0.000000 28.020000 +AAAAAAAAADGCAAAA 22.0 42.730000 0.000000 8.540000 +AAAAAAAAADKAAAAA 35.0 62.020000 0.000000 36.590000 +AAAAAAAAADMBAAAA 10.0 46.770000 0.000000 37.410000 +AAAAAAAAADNAAAAA 14.0 258.660000 0.000000 178.470000 +AAAAAAAAADNBAAAA 53.0 94.195000 0.000000 27.755000 +AAAAAAAAADNDAAAA 9.0 150.480000 0.000000 75.240000 +AAAAAAAAADOAAAAA 76.5 187.970000 310.730000 36.320000 +AAAAAAAAAEBDAAAA 7.0 68.300000 0.000000 15.700000 +AAAAAAAAAECEAAAA 81.0 241.650000 0.000000 9.660000 +AAAAAAAAAEDEAAAA 18.0 184.510000 979.740000 108.860000 +AAAAAAAAAEEDAAAA 81.0 72.050000 0.000000 56.910000 +AAAAAAAAAEGAAAAA 44.0 192.830000 0.000000 30.850000 +AAAAAAAAAEGBAAAA 39.0 6.230000 91.590000 3.050000 +AAAAAAAAAEGDAAAA 52.0 74.130000 0.000000 18.530000 +AAAAAAAAAEHAAAAA 68.0 72.870000 602.000000 59.020000 +AAAAAAAAAEHCAAAA 50.0 52.560000 0.000000 29.430000 +AAAAAAAAAEJBAAAA 66.0 66.110000 0.000000 5.940000 +AAAAAAAAAEKAAAAA 17.0 186.350000 339.590000 124.850000 +AAAAAAAAAEKCAAAA 93.0 57.210000 549.870000 6.290000 +AAAAAAAAAEKDAAAA 55.0 143.730000 0.000000 10.060000 +AAAAAAAAAELBAAAA 12.0 137.550000 0.000000 126.540000 +AAAAAAAAAEMBAAAA 100.0 52.750000 1092.980000 14.770000 +AAAAAAAAAENAAAAA 81.0 43.060000 2510.870000 32.290000 +AAAAAAAAAEPBAAAA 13.5 80.590000 0.000000 16.975000 +AAAAAAAAAFBEAAAA 93.0 115.340000 0.000000 42.670000 +AAAAAAAAAFCDAAAA 47.0 170.770000 0.000000 163.930000 +AAAAAAAAAFCEAAAA 73.0 91.970000 0.000000 59.780000 +AAAAAAAAAFDAAAAA 100.0 229.510000 2616.300000 68.850000 +AAAAAAAAAFDCAAAA 82.0 93.600000 0.000000 24.330000 +AAAAAAAAAFEEAAAA 61.0 245.950000 0.000000 199.210000 +AAAAAAAAAFFAAAAA 59.0 54.550000 555.140000 40.910000 +AAAAAAAAAFFBAAAA 65.0 142.570000 0.000000 69.850000 +AAAAAAAAAFFEAAAA 39.0 237.790000 681.580000 116.510000 +AAAAAAAAAFGCAAAA 45.0 205.590000 0.000000 47.280000 +AAAAAAAAAFHBAAAA 48.5 68.835000 0.000000 23.875000 +AAAAAAAAAFIAAAAA 72.0 84.430000 0.000000 0.000000 +AAAAAAAAAFIDAAAA 40.5 45.650000 1212.090000 17.425000 +AAAAAAAAAFJCAAAA 13.0 133.270000 0.000000 6.660000 +AAAAAAAAAFKCAAAA 5.0 178.640000 0.000000 105.390000 +AAAAAAAAAFNBAAAA 16.0 32.220000 0.000000 31.570000 +AAAAAAAAAFODAAAA 59.0 88.455000 138.365000 14.180000 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q27.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q27.sql.out new file mode 100644 index 0000000000000..4e402d0379f2e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q27.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL 1 50.20319480167863 76.358588 197.423228 38.217862 +AAAAAAAAAAABAAAA NULL 1 45.0 20.970000 0.000000 10.900000 +AAAAAAAAAAABAAAA TN 0 45.0 20.970000 0.000000 10.900000 +AAAAAAAAAAACAAAA NULL 1 4.0 60.970000 0.000000 35.970000 +AAAAAAAAAAACAAAA TN 0 4.0 60.970000 0.000000 35.970000 +AAAAAAAAAACDAAAA NULL 1 86.0 56.830000 0.000000 38.070000 +AAAAAAAAAACDAAAA TN 0 86.0 56.830000 0.000000 38.070000 +AAAAAAAAAADBAAAA NULL 1 61.0 40.060000 0.000000 7.210000 +AAAAAAAAAADBAAAA TN 0 61.0 40.060000 0.000000 7.210000 +AAAAAAAAAADCAAAA NULL 1 37.0 96.405000 0.000000 82.010000 +AAAAAAAAAADCAAAA TN 0 37.0 96.405000 0.000000 82.010000 +AAAAAAAAAADEAAAA NULL 1 23.0 96.010000 0.000000 57.600000 +AAAAAAAAAADEAAAA TN 0 23.0 96.010000 0.000000 57.600000 +AAAAAAAAAAEDAAAA NULL 1 64.0 10.940000 0.000000 10.390000 +AAAAAAAAAAEDAAAA TN 0 64.0 10.940000 0.000000 10.390000 +AAAAAAAAAAEEAAAA NULL 1 65.0 97.825000 0.000000 24.320000 +AAAAAAAAAAEEAAAA TN 0 65.0 97.825000 0.000000 24.320000 +AAAAAAAAAAFAAAAA NULL 1 71.0 88.080000 0.000000 10.560000 +AAAAAAAAAAFAAAAA TN 0 71.0 88.080000 0.000000 10.560000 +AAAAAAAAAAFCAAAA NULL 1 21.0 72.140000 0.000000 54.725000 +AAAAAAAAAAFCAAAA TN 0 21.0 72.140000 0.000000 54.725000 +AAAAAAAAAAGBAAAA NULL 1 23.0 97.980000 0.000000 45.070000 +AAAAAAAAAAGBAAAA TN 0 23.0 97.980000 0.000000 45.070000 +AAAAAAAAAAGCAAAA NULL 1 30.0 62.280000 0.000000 9.340000 +AAAAAAAAAAGCAAAA TN 0 30.0 62.280000 0.000000 9.340000 +AAAAAAAAAAHAAAAA NULL 1 30.0 91.910000 0.000000 52.380000 +AAAAAAAAAAHAAAAA TN 0 30.0 91.910000 0.000000 52.380000 +AAAAAAAAAAHBAAAA NULL 1 76.0 30.060000 345.610000 26.750000 +AAAAAAAAAAHBAAAA TN 0 76.0 30.060000 345.610000 26.750000 +AAAAAAAAAAHDAAAA NULL 1 60.0 49.390000 0.000000 19.155000 +AAAAAAAAAAHDAAAA TN 0 60.0 49.390000 0.000000 19.155000 +AAAAAAAAAAIAAAAA NULL 1 65.0 115.230000 0.000000 79.555000 +AAAAAAAAAAIAAAAA TN 0 65.0 115.230000 0.000000 79.555000 +AAAAAAAAAAICAAAA NULL 1 NULL NULL 262.480000 NULL +AAAAAAAAAAICAAAA TN 0 NULL NULL 262.480000 NULL +AAAAAAAAAAJCAAAA NULL 1 7.0 111.745000 0.000000 82.515000 +AAAAAAAAAAJCAAAA TN 0 7.0 111.745000 0.000000 82.515000 +AAAAAAAAAAKAAAAA NULL 1 31.5 51.350000 0.000000 36.555000 +AAAAAAAAAAKAAAAA TN 0 31.5 51.350000 0.000000 36.555000 +AAAAAAAAAAKBAAAA NULL 1 3.0 146.600000 0.000000 105.550000 +AAAAAAAAAAKBAAAA TN 0 3.0 146.600000 0.000000 105.550000 +AAAAAAAAAAKDAAAA NULL 1 69.0 34.660000 0.000000 11.090000 +AAAAAAAAAAKDAAAA TN 0 69.0 34.660000 0.000000 11.090000 +AAAAAAAAAALAAAAA NULL 1 97.0 14.270000 0.000000 12.410000 +AAAAAAAAAALAAAAA TN 0 97.0 14.270000 0.000000 12.410000 +AAAAAAAAAAMBAAAA NULL 1 68.5 70.250000 0.000000 34.085000 +AAAAAAAAAAMBAAAA TN 0 68.5 70.250000 0.000000 34.085000 +AAAAAAAAAAMCAAAA NULL 1 51.5 73.135000 0.000000 25.570000 +AAAAAAAAAAMCAAAA TN 0 51.5 73.135000 0.000000 25.570000 +AAAAAAAAAANAAAAA NULL 1 50.5 29.315000 9.580000 15.805000 +AAAAAAAAAANAAAAA TN 0 50.5 29.315000 9.580000 15.805000 +AAAAAAAAAAOCAAAA NULL 1 1.0 74.630000 0.000000 19.400000 +AAAAAAAAAAOCAAAA TN 0 1.0 74.630000 0.000000 19.400000 +AAAAAAAAAAODAAAA NULL 1 66.33333333333333 52.823333 1793.560000 28.406667 +AAAAAAAAAAODAAAA TN 0 66.33333333333333 52.823333 1793.560000 28.406667 +AAAAAAAAAAPBAAAA NULL 1 17.0 167.070000 0.000000 40.090000 +AAAAAAAAAAPBAAAA TN 0 17.0 167.070000 0.000000 40.090000 +AAAAAAAAABAAAAAA NULL 1 79.0 48.110000 0.000000 14.430000 +AAAAAAAAABAAAAAA TN 0 79.0 48.110000 0.000000 14.430000 +AAAAAAAAABAEAAAA NULL 1 16.5 26.370000 0.000000 9.325000 +AAAAAAAAABAEAAAA TN 0 16.5 26.370000 0.000000 9.325000 +AAAAAAAAABCBAAAA NULL 1 32.0 98.600000 0.000000 46.340000 +AAAAAAAAABCBAAAA TN 0 32.0 98.600000 0.000000 46.340000 +AAAAAAAAABFCAAAA NULL 1 24.0 101.420000 0.000000 3.040000 +AAAAAAAAABFCAAAA TN 0 24.0 101.420000 0.000000 3.040000 +AAAAAAAAABFEAAAA NULL 1 34.5 42.490000 131.055000 15.505000 +AAAAAAAAABFEAAAA TN 0 34.5 42.490000 131.055000 15.505000 +AAAAAAAAABGAAAAA NULL 1 57.666666666666664 94.343333 569.626667 56.296667 +AAAAAAAAABGAAAAA TN 0 57.666666666666664 94.343333 569.626667 56.296667 +AAAAAAAAABHCAAAA NULL 1 58.0 38.370000 0.000000 16.880000 +AAAAAAAAABHCAAAA TN 0 58.0 38.370000 0.000000 16.880000 +AAAAAAAAABHDAAAA NULL 1 43.0 10.290000 0.000000 3.800000 +AAAAAAAAABHDAAAA TN 0 43.0 10.290000 0.000000 3.800000 +AAAAAAAAABIBAAAA NULL 1 60.25 74.462500 0.000000 58.247500 +AAAAAAAAABIBAAAA TN 0 60.25 74.462500 0.000000 58.247500 +AAAAAAAAABJDAAAA NULL 1 64.5 28.405000 0.000000 22.080000 +AAAAAAAAABJDAAAA TN 0 64.5 28.405000 0.000000 22.080000 +AAAAAAAAABKCAAAA NULL 1 69.0 44.880000 518.585000 18.855000 +AAAAAAAAABKCAAAA TN 0 69.0 44.880000 518.585000 18.855000 +AAAAAAAAABLBAAAA NULL 1 18.0 43.495000 0.000000 24.660000 +AAAAAAAAABLBAAAA TN 0 18.0 43.495000 0.000000 24.660000 +AAAAAAAAABLCAAAA NULL 1 6.0 102.740000 0.000000 90.410000 +AAAAAAAAABLCAAAA TN 0 6.0 102.740000 0.000000 90.410000 +AAAAAAAAABMDAAAA NULL 1 50.5 32.745000 0.000000 12.005000 +AAAAAAAAABMDAAAA TN 0 50.5 32.745000 0.000000 12.005000 +AAAAAAAAABNAAAAA NULL 1 85.0 31.880000 0.000000 5.100000 +AAAAAAAAABNAAAAA TN 0 85.0 31.880000 0.000000 5.100000 +AAAAAAAAABOCAAAA NULL 1 60.0 113.590000 51.520000 1.130000 +AAAAAAAAABOCAAAA TN 0 60.0 113.590000 51.520000 1.130000 +AAAAAAAAABPAAAAA NULL 1 55.0 89.150000 3442.050000 76.440000 +AAAAAAAAABPAAAAA TN 0 55.0 89.150000 3442.050000 76.440000 +AAAAAAAAABPBAAAA NULL 1 80.0 16.010000 0.000000 9.440000 +AAAAAAAAABPBAAAA TN 0 80.0 16.010000 0.000000 9.440000 +AAAAAAAAABPDAAAA NULL 1 73.0 112.940000 2248.960000 99.380000 +AAAAAAAAABPDAAAA TN 0 73.0 112.940000 2248.960000 99.380000 +AAAAAAAAACAAAAAA NULL 1 61.0 101.820000 0.000000 90.610000 +AAAAAAAAACAAAAAA TN 0 61.0 101.820000 0.000000 90.610000 +AAAAAAAAACACAAAA NULL 1 86.0 101.500000 0.000000 57.850000 +AAAAAAAAACACAAAA TN 0 86.0 101.500000 0.000000 57.850000 +AAAAAAAAACADAAAA NULL 1 65.0 97.210000 0.000000 83.595000 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q28.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q28.sql.out new file mode 100644 index 0000000000000..5d3f3fa3c8602 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q28.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +78.045281 36383 9236 69.528580 35193 6542 133.847037 28274 9714 81.911887 31756 7687 61.160300 36338 8603 39.282627 29915 5210 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q29.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q29.sql.out new file mode 100644 index 0000000000000..467b5c3ba3eaf --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q29.sql.out @@ -0,0 +1,7 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAADIFDAAAA Now christian papers believe very major, new branches. Annual wars include harshly so-called sites. AAAAAAAAHAAAAAAA ation 11 10 13 +AAAAAAAANNBEAAAA Old forces shall not think more than foreign earnings. Controls could carry almos AAAAAAAACAAAAAAA able 56 25 10 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q3.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q3.sql.out new file mode 100644 index 0000000000000..65e15769d5b0f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q3.sql.out @@ -0,0 +1,88 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +1998 1004001 edu packamalg #x 65716.37 +1998 10001008 amalgunivamalg #x 34140.78 +1998 8012001 importomaxi #x 32669.34 +1998 2004001 edu packimporto #x 25130.97 +1998 10003014 exportiunivamalg #x 23720.25 +1998 5004001 edu packscholar #x 23713.55 +1998 9002008 importomaxi #x 22002.12 +1998 3003001 exportiexporti #x 21596.96 +1998 8014004 edu packmaxi #x 20442.12 +1998 9009005 maximaxi #x 19866.63 +1998 3002001 importoexporti #x 17347.94 +1998 3001001 amalgexporti #x 16882.10 +1998 2003001 exportiimporto #x 13095.00 +1998 8010001 univmaxi #x 12408.22 +1998 8007001 brandnameless #x 12021.05 +1998 6005005 scholarcorp #x 10366.33 +1998 8013008 exportimaxi #x 10008.30 +1998 10008008 namelessunivamalg #x 7909.24 +1998 1003002 exportiamalg #x 5046.65 +1999 1004001 edu packamalg #x 72111.20 +1999 8012001 importomaxi #x 45932.95 +1999 9009005 maximaxi #x 32382.90 +1999 1003002 exportiamalg #x 28586.32 +1999 8007001 brandnameless #x 27105.57 +1999 9002008 importomaxi #x 26746.44 +1999 5004001 edu packscholar #x 25906.67 +1999 8010001 univmaxi #x 23297.75 +1999 8013008 exportimaxi #x 20896.22 +1999 2004001 edu packimporto #x 18025.93 +1999 10003014 exportiunivamalg #x 16211.31 +1999 8014004 edu packmaxi #x 15207.49 +1999 3001001 amalgexporti #x 13536.73 +1999 10001008 amalgunivamalg #x 12980.62 +1999 3003001 exportiexporti #x 12753.61 +1999 10008008 namelessunivamalg #x 12446.57 +1999 2003001 exportiimporto #x 11284.94 +1999 3002001 importoexporti #x 9820.44 +1999 6005005 scholarcorp #x 5487.63 +2000 3002001 importoexporti #x 49567.04 +2000 1004001 edu packamalg #x 35173.68 +2000 6006004 corpcorp #x 31206.02 +2000 1003002 exportiamalg #x 30500.97 +2000 6005005 scholarcorp #x 30270.09 +2000 9001012 amalgmaxi #x 29107.66 +2000 8012001 importomaxi #x 26610.58 +2000 5004001 edu packscholar #x 26200.25 +2000 10003014 exportiunivamalg #x 23018.57 +2000 3001001 amalgexporti #x 20499.18 +2000 2004001 edu packimporto #x 19982.58 +2000 10015010 importoedu pack #x 18697.08 +2000 8007001 brandnameless #x 17315.93 +2000 8014004 edu packmaxi #x 16235.88 +2000 3003001 exportiexporti #x 14272.86 +2000 8013008 exportimaxi #x 10570.32 +2000 9002008 importomaxi #x 10262.91 +2001 1003002 exportiamalg #x 36559.22 +2001 9002008 importomaxi #x 25301.41 +2001 8013008 exportimaxi #x 21069.43 +2001 6005003 importoamalg #x 20705.88 +2001 9001012 amalgmaxi #x 18795.96 +2001 8012001 exportiedu pack #x 18477.27 +2001 6006004 corpcorp #x 18283.57 +2001 9003010 exportimaxi #x 17793.12 +2001 3002001 scholarmaxi #x 17206.42 +2001 10003014 exportiunivamalg #x 15781.84 +2001 10001003 edu packamalg #x 15683.42 +2001 8014004 edu packmaxi #x 13108.20 +2001 10015010 importoedu pack #x 11683.34 +2001 2002002 importoimporto #x 8532.67 +2002 1003002 exportiamalg #x 53079.32 +2002 9002008 importomaxi #x 39552.73 +2002 3002001 scholarmaxi #x 38802.50 +2002 9003010 exportimaxi #x 36257.87 +2002 5002001 importoscholar #x 36116.22 +2002 10015010 amalgunivamalg #x 28522.27 +2002 8012001 exportiedu pack #x 27777.47 +2002 8013008 exportimaxi #x 23919.27 +2002 2002002 importoimporto #x 21849.78 +2002 8014004 edu packmaxi #x 19276.30 +2002 10001003 edu packamalg #x 13837.38 +2002 10003014 exportiunivamalg #x 13106.68 +2002 9015001 scholarunivamalg #x 11700.36 +2002 6005003 importoamalg #x 6367.68 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q30.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q30.sql.out new file mode 100644 index 0000000000000..2a298679ad558 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q30.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAABEBBAAA Sir Carlton Miles N 23 9 1957 MALI NULL Carlton.Miles@4DbIUoznbr.org 2452588 12916.86 +AAAAAAAAABKGBAAA Miss Sharee Stevens Y 15 8 1992 SLOVAKIA NULL Sharee.Stevens@Z.edu 2452492 2480.80 +AAAAAAAAAEIPAAAA Mr. Chris Ryan Y 23 4 1931 TURKMENISTAN NULL Chris.Ryan@QlH9G0fkAR5.org 2452443 3469.95 +AAAAAAAAAHNKAAAA Sir Scott Garcia N 19 10 1952 WALLIS AND FUTUNA NULL Scott.Garcia@3pd6mnJYbKxb.org 2452611 2944.24 +AAAAAAAAAJDABAAA Sir Gerald Monroe Y 19 5 1985 LIECHTENSTEIN NULL Gerald.Monroe@opYT.org 2452632 4030.41 +AAAAAAAAAJJBAAAA Sir Jose Garcia Y 11 6 1977 AMERICAN SAMOA NULL Jose.Garcia@n1VrEIOg4f.com 2452406 4131.05 +AAAAAAAAALNKAAAA Dr. Wanda Devries N 6 2 1953 YEMEN NULL Wanda.Devries@lzbOovP.com 2452411 3197.25 +AAAAAAAAANPAAAAA NULL NULL Sanders NULL 12 10 NULL NULL NULL NULL 2452646 2091.90 +AAAAAAAAAOKPAAAA Mr. Brandon Foster N 28 4 1992 FRENCH POLYNESIA NULL Brandon.Foster@vKi8eFToOZHK.org 2452527 3706.08 +AAAAAAAABBEDAAAA Mr. James Pantoja Y 5 12 1982 NEPAL NULL James.Pantoja@LTZLj3ddIvIG0.edu 2452503 5668.25 +AAAAAAAABBIHAAAA Ms. Sherry Kennedy Y 3 8 1984 MOZAMBIQUE NULL Sherry.Kennedy@9hhBNI6.edu 2452481 1561.14 +AAAAAAAABBJMAAAA NULL Paul Lindsey N NULL 10 NULL NULL NULL Paul.Lindsey@bQo8Zt9XStF.edu NULL 3139.50 +AAAAAAAABBNFBAAA Mrs. Nellie Johnson Y 14 6 1962 BAHRAIN NULL Nellie.Johnson@U.com 2452411 1609.90 +AAAAAAAABDKOAAAA Dr. Vernita Bennett Y 12 3 1955 NICARAGUA NULL Vernita.Bennett@u2QKJHt.com 2452352 11315.85 +AAAAAAAABEJLAAAA Mr. Abel Lucero N 15 9 1930 CAPE VERDE NULL Abel.Lucero@txdlc3sekSyj7mLokv.org 2452461 4524.56 +AAAAAAAABFFHBAAA Mrs. Arlene Parrish N 18 9 1957 MALAWI NULL Arlene.Parrish@m5lX3mTVhbxAEz.org 2452433 3184.72 +AAAAAAAABGCFBAAA Sir Alberto Whitney Y 20 5 1946 MALAYSIA NULL Alberto.Whitney@En6lzc8TlV7vF.org 2452496 3806.56 +AAAAAAAABHAGBAAA Mrs. Minnie Thompson N 1 8 1976 NEW ZEALAND NULL Minnie.Thompson@7u.org 2452558 1871.31 +AAAAAAAABLMCAAAA Dr. Frank Price N 13 2 1962 SYRIAN ARAB REPUBLIC NULL Frank.Price@KO.org 2452372 1779.84 +AAAAAAAABNEGAAAA Ms. Laurel Olson Y 24 6 1960 BANGLADESH NULL Laurel.Olson@92YpV3hofMbNz.edu 2452508 4912.49 +AAAAAAAABNMIAAAA Mrs. Judi Lopes Y 21 2 1943 NICARAGUA NULL Judi.Lopes@DYAyBUb1E.org 2452297 8335.86 +AAAAAAAABOGDAAAA Ms. Laura Mcfadden N 29 3 1964 GREECE NULL Laura.Mcfadden@Ks.com 2452364 3942.35 +AAAAAAAABPECAAAA Mr. William Hoffman N 21 4 1991 PERU NULL William.Hoffman@m8E1N4.com 2452321 4550.73 +AAAAAAAACGHDAAAA Mr. Ricky Marshall N 11 7 1979 NAMIBIA NULL Ricky.Marshall@tJKkX.edu 2452610 10400.46 +AAAAAAAACIKBAAAA Ms. Virginia Lawson N 26 11 1929 PHILIPPINES NULL Virginia.Lawson@bdtmjhsnqQZx.edu 2452490 2164.20 +AAAAAAAACILFBAAA NULL Frederick NULL N 23 11 1954 NULL NULL Frederick.Lambert@BNHNh23xF7qIUJ30.edu NULL 3849.92 +AAAAAAAACLNHBAAA Dr. Gary Perez N 21 4 1992 MACAO NULL Gary.Perez@5dGey4.com 2452300 9647.56 +AAAAAAAACOEAAAAA Dr. David Saunders Y 6 12 1991 HAITI NULL David.Saunders@APTXJyYNgVa.edu 2452482 8357.76 +AAAAAAAADBIHAAAA Mr. John Sturm Y 5 8 1973 GUAM NULL John.Sturm@PnUSI7.com 2452457 7161.74 +AAAAAAAADCCCBAAA Ms. Antonia Miller N 1 5 1992 PALAU NULL Antonia.Miller@CsPe3fE38F.com 2452635 2688.66 +AAAAAAAADGIGBAAA Miss Margarita Park Y 20 1 1947 LITHUANIA NULL Margarita.Park@qb0FrD2Pk.org 2452462 1557.37 +AAAAAAAADGMJAAAA Mrs. Karen Olson Y 18 11 1974 ARGENTINA NULL Karen.Olson@Qe3bBGr.com 2452596 11849.40 +AAAAAAAADGOIAAAA NULL NULL NULL NULL 2 NULL 1977 NULL NULL Kathleen.Bell@B0Ze.com 2452322 3979.64 +AAAAAAAADHFBAAAA Mr. William Lopez N 12 1 1967 MALAYSIA NULL William.Lopez@9JMTYo5O22ZFskMMybp.org 2452435 2302.41 +AAAAAAAADJJMAAAA Mr. James Cooper Y 26 4 1982 TUNISIA NULL James.Cooper@KH.com 2452365 3388.66 +AAAAAAAADJPEBAAA Ms. Lizzie Neal Y 16 2 1939 MAURITIUS NULL Lizzie.Neal@ru9qksDH5rgLsRn.edu 2452433 1915.72 +AAAAAAAADKJCAAAA Dr. Daniel Green N 29 8 1970 AMERICAN SAMOA NULL Daniel.Green@GPktIG5Y.org 2452421 5675.02 +AAAAAAAADMFKAAAA Mr. Ray Gonzales N 22 2 1930 TURKMENISTAN NULL Ray.Gonzales@kH8kp.com 2452378 2294.25 +AAAAAAAADMHDAAAA Mr. Lee Stanley Y 9 3 1959 CZECH REPUBLIC NULL Lee.Stanley@rONmrEDug8q.com 2452451 1912.92 +AAAAAAAADMONAAAA Sir Joshua West Y 15 3 1987 ALAND ISLANDS NULL Joshua.West@5q4JZHUuo9h0e1ol.org 2452545 2870.00 +AAAAAAAADOBAAAAA Dr. Paul Yeager N 17 11 1946 EGYPT NULL Paul.Yeager@PKzHg.edu 2452571 3050.46 +AAAAAAAAEADIAAAA Dr. Gregory Carey Y 6 1 1937 SUDAN NULL Gregory.Carey@495UmqFpU0My0GB8.edu 2452330 5133.18 +AAAAAAAAECBEAAAA Ms. Megan Wilson N 1 12 1935 COMOROS NULL Megan.Wilson@mi.com 2452501 1622.24 +AAAAAAAAECIEAAAA Miss Danille Sanders Y 15 3 1942 OMAN NULL Danille.Sanders@dnjPPYBZQ.com 2452566 5474.66 +AAAAAAAAEEBEBAAA Dr. Jamie Jackson Y 21 11 1933 POLAND NULL Jamie.Jackson@dLUBOuU.com 2452365 1761.68 +AAAAAAAAEEGMAAAA Dr. NULL NULL N 5 NULL NULL NULL NULL NULL 2452438 2046.20 +AAAAAAAAEEJAAAAA Dr. Rhonda Anderson N 27 12 1942 ISLE OF MAN NULL Rhonda.Anderson@P2VN7VQxGjj.com 2452394 2888.50 +AAAAAAAAEENFAAAA Dr. James Brown N 27 9 1971 NEW CALEDONIA NULL James.Brown@dzkgBG43cs.org 2452466 2474.24 +AAAAAAAAEGDDBAAA Mr. Timothy Barajas N 8 10 1976 MAURITANIA NULL Timothy.Barajas@FFhEdu3MO4n.com 2452594 2209.06 +AAAAAAAAEGEGAAAA Mrs. Arthur Kirk Y 24 8 1972 SLOVAKIA NULL Arthur.Kirk@3eFiyMXiuRCqt1ofD.com 2452286 3189.74 +AAAAAAAAEGGKAAAA Miss Johanna Moses Y 3 5 1971 R�UNION NULL Johanna.Moses@AhPc5dGr7FubqU1Lyj.com 2452443 2842.06 +AAAAAAAAEGPPAAAA Mr. Michael Pringle Y 1 10 1990 JERSEY NULL Michael.Pringle@noEgytx7nOED.edu 2452398 1870.56 +AAAAAAAAEHFCBAAA Mrs. Lillian Yazzie N 14 1 1936 GEORGIA NULL Lillian.Yazzie@Hzg3QQh.com 2452555 1758.12 +AAAAAAAAEHLDAAAA Ms. NULL Brown NULL NULL 3 NULL NULL NULL NULL NULL 4483.20 +AAAAAAAAEHLNAAAA Mr. Gregory Wester Y 9 3 1946 SPAIN NULL Gregory.Wester@ko.com 2452535 2303.28 +AAAAAAAAEKCJAAAA Mrs. Keri Lawrence Y 31 10 1955 GUERNSEY NULL Keri.Lawrence@yIBxLUPgozYINi.com 2452523 1523.98 +AAAAAAAAEMELAAAA Dr. Steven Parker N 11 9 1936 MADAGASCAR NULL Steven.Parker@E6kIVz3.org 2452372 2106.30 +AAAAAAAAEMHBAAAA Mr. Brandon Ray Y 13 8 1976 ANTARCTICA NULL Brandon.Ray@OP6YgS6SQnuykF.org 2452290 2258.53 +AAAAAAAAFCPEBAAA Dr. Kristi Brennan Y NULL 11 NULL NULL NULL NULL 2452349 6815.00 +AAAAAAAAFDBAAAAA Mrs. Virginia Sims Y 16 4 1969 BULGARIA NULL Virginia.Sims@3qndx2y.edu 2452302 6723.52 +AAAAAAAAFGICAAAA Dr. Will Isbell N 1 10 1975 ERITREA NULL Will.Isbell@100I71HVxMaaTVZ5MH2m.org 2452482 1765.89 +AAAAAAAAFKGEBAAA Dr. Dorothy Hendricks N 14 9 1947 NAMIBIA NULL Dorothy.Hendricks@7X7OXy1xAs7hVN.org 2452562 2333.76 +AAAAAAAAFKNEAAAA Ms. Ruth Catron Y 2 3 1983 SAINT LUCIA NULL Ruth.Catron@g4krLkSRUFX60t4P.edu 2452401 1873.40 +AAAAAAAAFKOHBAAA Ms. Annie Stevens N 12 2 1933 KENYA NULL Annie.Stevens@e3vFdRXUEQ.org 2452504 4229.82 +AAAAAAAAFMDEAAAA Sir Dennis Mayfield N 5 1 1933 SOMALIA NULL Dennis.Mayfield@9DPHTIUxRlxd.edu 2452535 2849.00 +AAAAAAAAFMIPAAAA Dr. Michael Moran N 1 2 1940 SAINT HELENA NULL Michael.Moran@3.edu 2452411 3869.60 +AAAAAAAAFPKCBAAA Dr. William Terry Y 10 3 1991 GUATEMALA NULL William.Terry@jKyKRKfrxH.org 2452325 3550.05 +AAAAAAAAFPPGAAAA Ms. Margie Lee Y 22 10 1933 GUINEA NULL Margie.Lee@Tg2pE7.com 2452419 3288.60 +AAAAAAAAGBOAAAAA Mr. Micheal NULL NULL NULL NULL 1991 NULL NULL Micheal.Holland@4rhkIkNJy6fSU.edu 2452530 2676.00 +AAAAAAAAGIEDAAAA Miss Adriana Maxfield Y 6 1 1948 MONGOLIA NULL Adriana.Maxfield@Na4ize7RHB.com 2452415 4872.96 +AAAAAAAAGJJEAAAA Miss NULL Barnard N NULL NULL 1987 NULL NULL NULL NULL 1628.77 +AAAAAAAAGMJPAAAA Miss Deena Ferguson Y 8 9 1986 PHILIPPINES NULL Deena.Ferguson@19lazfjoSTXBorQ.edu 2452301 5713.74 +AAAAAAAAHANIAAAA Mr. Robert Rogers Y 5 7 1990 SOUTH AFRICA NULL Robert.Rogers@m77qeFKJfIO3rugyC.org 2452456 1638.00 +AAAAAAAAHCHKAAAA Dr. Harry Bearden Y 10 2 1957 CHINA NULL Harry.Bearden@kNxzQ3SYEmp.com 2452533 6455.11 +AAAAAAAAHHAKAAAA Dr. Jeremy Richter Y 8 8 1951 SOUTH AFRICA NULL Jeremy.Richter@hCAQGRgTCrU.edu 2452496 3764.21 +AAAAAAAAHIMLAAAA Dr. Kathleen Floyd N 16 12 1983 TURKMENISTAN NULL Kathleen.Floyd@ACpkOV2nlHDL.edu 2452644 5796.90 +AAAAAAAAHLMCAAAA Miss Adriana Case N 16 3 1959 GREECE NULL Adriana.Case@aRv.com 2452408 1740.52 +AAAAAAAAHMFBBAAA Dr. Katheryn White Y 21 7 1983 CAPE VERDE NULL Katheryn.White@dqdzeup0a7TYhnOB.edu 2452417 20518.95 +AAAAAAAAHMNFAAAA Dr. Stephen Belanger Y 10 11 1951 GUADELOUPE NULL Stephen.Belanger@emUp.edu 2452340 5734.80 +AAAAAAAAHNAOAAAA Mrs. Anita Gardner Y 27 6 1979 GEORGIA NULL Anita.Gardner@g.org 2452557 2921.42 +AAAAAAAAHOIBAAAA Miss Vera Forte N 20 9 1941 ZAMBIA NULL Vera.Forte@XxMnMUGRS.edu 2452549 2533.00 +AAAAAAAAHOOGAAAA Sir Jerry Rader Y 31 1 1948 PAPUA NEW GUINEA NULL Jerry.Rader@FAhBv4pGRIGB.com 2452327 3590.16 +AAAAAAAAHPGNAAAA Dr. Renae Richardson Y 4 8 1927 SYRIAN ARAB REPUBLIC NULL Renae.Richardson@eGnpquq6hFfm20r.com 2452426 6468.92 +AAAAAAAAIAGBBAAA Ms. Alexis Evans N 3 12 1966 LITHUANIA NULL Alexis.Evans@2cqJZnt7z8.edu 2452596 2043.99 +AAAAAAAAICGBAAAA Miss Gertrude Rodriguez Y 10 4 1932 SAN MARINO NULL Gertrude.Rodriguez@lj4qAeL9afqB9jS.com 2452447 2865.39 +AAAAAAAAIDFJAAAA Dr. Dixie Brown N 1 5 1983 FRENCH POLYNESIA NULL Dixie.Brown@PrD49KMoXd8SEMuCS.com 2452595 2135.70 +AAAAAAAAIJCHBAAA Dr. Karen Cosby Y 17 9 1963 IRAQ NULL Karen.Cosby@H17xf1rPlPtkdKTr.com 2452368 3731.50 +AAAAAAAAIJDEBAAA Mrs. Elisa Baldwin Y 14 5 1983 SWEDEN NULL Elisa.Baldwin@S.edu 2452579 3168.75 +AAAAAAAAILKLAAAA Ms. Janice Cannon N 11 12 1983 ARGENTINA NULL Janice.Cannon@lmR.org 2452353 2810.73 +AAAAAAAAINLKAAAA Ms. Mandy Anderson N 30 6 1958 MOZAMBIQUE NULL Mandy.Anderson@ONxvienlYHJpCe.org 2452539 9893.12 +AAAAAAAAIOGPAAAA Ms. Kathryn Cooper N 27 1 1982 ARGENTINA NULL Kathryn.Cooper@VBO8.com 2452457 1870.56 +AAAAAAAAJDKCAAAA Dr. Curtis Mcguire Y 10 5 1974 ETHIOPIA NULL Curtis.Mcguire@Vex25USDKvv.org 2452411 4900.15 +AAAAAAAAJFEFBAAA Ms. Nancy Hampton N 24 3 1946 WESTERN SAHARA NULL Nancy.Hampton@K8CudFMgtgyGyzS.com 2452309 6277.08 +AAAAAAAAJGNBAAAA Sir Robert Johnston N 14 5 1956 FAROE ISLANDS NULL Robert.Johnston@ccQCj7j.edu 2452631 2383.74 +AAAAAAAAJHHEBAAA Miss Else Carter Y 19 8 1963 NORFOLK ISLAND NULL Else.Carter@e.com 2452580 4210.60 +AAAAAAAAJHIBAAAA Mr. Edwin Christensen N 23 6 1947 URUGUAY NULL Edwin.Christensen@3fBqkiUX.com 2452485 5984.00 +AAAAAAAAJJFBBAAA Sir Michael Toney Y 2 6 1981 COSTA RICA NULL Michael.Toney@Oe1SH.edu 2452306 3453.63 +AAAAAAAAJKDCBAAA Dr. Robert James Y 8 11 1929 LEBANON NULL Robert.James@DSVGYuMQLZNo9oga1.edu 2452306 1922.62 +AAAAAAAAJLAGBAAA Mrs. Isabel Barber N 24 4 1964 ROMANIA NULL Isabel.Barber@0RSzJgpalSYmAoYJgnL.org 2452435 2562.91 +AAAAAAAAJLICBAAA Ms. Fumiko Ebert N 5 12 1956 NAURU NULL Fumiko.Ebert@8kz.com 2452309 2408.38 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q31.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q31.sql.out new file mode 100644 index 0000000000000..7ef2fb4948563 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q31.sql.out @@ -0,0 +1,66 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +Bedford city 2000 1.41895245428186244343 1.28647520475423955859 1.98397166014536480387 1.22052485500235683695 +Blaine County 2000 0.90103169326915114550 0.83066560812940517400 5.91832927336153981754 2.20534708400177561487 +Boone County 2000 1.10318140625440703802 1.01388129938545215917 2.93583104434541244580 0.81595222675278264090 +Bristol County 2000 2.03252306215265583168 0.84389707668347883239 1.88436946252627433938 0.50855932416819944462 +Buffalo County 2000 0.79851677786134640592 0.66608776395688494889 4.12963020014993273566 1.41417145222467738551 +Carlisle County 2000 1.69492598618078795489 1.25168931735787673049 1.50718182376907682203 0.88181897085363449075 +Carroll County 2000 1.35087769364534219248 1.29257051856006991407 2.20994529474585418644 1.48849785082428358420 +Cedar County 2000 1.73903789422605330870 0.46305877715234029287 8.77007422523370529780 3.61252572439703538764 +Clinton County 2000 1.74067151347304310575 1.41218893174550937759 1.44667681199587337982 1.25445563958487852628 +Colbert County 2000 1.18024333271178132777 0.83788572603247302022 0.54236640028023008306 0.42663333520116081271 +Crawford County 2000 1.31661755312891088929 0.94956543151027392277 2.05054841119621802578 1.32014748612874091613 +Cumberland County 2000 1.08524453978148728453 0.80144708440874338843 1.60419019384387788968 1.54733087343509046916 +Dillon County 2000 0.32644424794620832608 0.12281769967769250465 2.54843886762550432202 2.36794563665865531250 +Drew County 2000 1.33752592432768148542 0.42051684931974493150 4.42925583278116865936 3.59005466753091100322 +El Paso County 2000 1.33106683366793877022 0.52026046839940548659 6.85897871779069724650 3.52274370756107989319 +Escambia County 2000 1.29140013472373800933 1.22312591570259586531 4.94949857002487942979 1.90881493105514558681 +Essex County 2000 0.91140422255526176760 0.80397981840092167933 2.40581838121906819055 1.51850239999231343611 +Forsyth County 2000 0.68611318852553022140 0.65587408738915750878 3.37787340847752340465 1.32466135376522054649 +Franklin County 2000 1.23346105169430839663 1.16004116355148303419 3.11011280618208475383 1.72852883588875015022 +Fremont County 2000 2.08342397478237427534 0.99231216361555377660 4.64450632140050612837 1.66543397250235949142 +Gaines County 2000 0.18699408635518783605 0.15864149496085374898 4.38012199409197995027 3.26392730974685542866 +Gallatin County 2000 0.57267047178378396314 0.42960913482855774228 5.40426025792003986274 2.60129747557845045914 +Hale County 2000 1.13181285759861396698 0.37084472158598998345 2.76039662764995099764 2.04880905907673376536 +Howard County 2000 0.75689303418215066506 0.40416603686332285826 5.20017335230756289550 3.93113017208635232323 +Jennings County 2000 2.78984076175313855515 2.07599697431575122264 3.44972481162691656332 2.44378922187060355318 +Johnson County 2000 2.57795641894299816468 0.91616273582603658596 1.74313979276860348710 1.18351065602569093409 +Langlade County 2000 1.68676813359812642201 0.96428449439984805852 2.54522036089486624332 1.23454212891942526190 +Lee County 2000 1.30443690529253126871 0.72035286226320500421 2.23150088973480218462 1.84186089836441132231 +Limestone County 2000 3.32976919500999168869 0.75905050855357115484 1.82617549463146988019 1.71235192999491983271 +Lonoke County 2000 2.08982990182342723842 1.10340085014357551300 1.15539868818698913544 0.99289022395794532472 +Milam County 2000 2.28508195011379140646 0.46652927795640169049 0.78408081688146536737 0.47493776386092038861 +Mineral County 2000 3.34300539922925594005 2.45993211849872338822 2.20409211845792015572 1.08747970913885456325 +Mitchell County 2000 1.67453892386598503677 1.34365298077586851819 1.23346415770637208954 0.95073923197301166934 +Montgomery County 2000 1.56847414391333207258 0.83177598227578637405 2.13678203835469561935 2.10257648921068871721 +Moore County 2000 2.15694071746428807771 0.40796143296369785394 1.74966386964488096764 1.16471835770020727271 +Ottawa County 2000 1.75323872261604668329 0.83468698542567460304 1.61973935146544593444 1.42351390679742385404 +Pamlico County 2000 1.94782724762452970276 0.35933779785623271693 1.56217364489823888166 1.36537077933199287260 +Pawnee County 2000 1.78950195911489308028 1.16132303881758630677 3.42292675284956044317 0.55048211219399261479 +Pierce County 2000 2.54716933553443590360 1.41791053358023116142 1.22686753138250342480 1.16331445295301712751 +Pike County 2000 0.87756608639678817034 0.86487524757082952225 1.66450846493571420317 1.60752153195890666018 +Plymouth County 2000 0.42751024431730323179 0.24869467440858413355 1.77347026156010104138 0.95743334493327210261 +Pocahontas County 2000 1.81898673318791661987 1.68668175433656035469 2.78840493521175989923 2.31448886854618583141 +Pope County 2000 1.42325802767704214927 0.71289882499386886358 5.32400461162588232396 4.36612471915760924134 +Quitman County 2000 0.36883113368425186793 0.36314047030366149345 5.16370853507835506706 3.21226900707602706150 +Richland County 2000 3.25294641523656020681 1.07950401261765093476 2.63822689761623055166 1.41044850738739382893 +Rockland County 2000 0.42416114343500113082 0.20590865976918589352 3.77761891177163143690 3.03503154543555890597 +Salem city 2000 0.70139973333391227808 0.35839062570476603239 2.05906098316466157534 1.08354507133942051245 +Seminole County 2000 1.44053424523671633073 0.43123781775978624959 5.98509759915132505814 3.90425489309553190978 +Sherman County 2000 3.80549228460960365296 0.85018052505371507262 3.28429802752271011291 2.95060760395590827092 +Sioux County 2000 4.05794434246552571650 1.42665905155276116003 1.56803884104955881507 1.13419970938634791615 +Stafford County 2000 2.47320669600627229039 0.89946337873032839807 1.93845899918871104768 0.90136132522419968048 +Suffolk County 2000 2.42331649558212058212 1.82204858730891230166 6.53566355839665770211 1.95538998836281647012 +Sully County 2000 0.93205458749496189963 0.25090187329447210579 2.29778378271979174484 1.08802927271862880423 +Thomas County 2000 2.83931404059757943504 1.88036403728663893895 1.98634825955250608974 0.52141190626809911920 +Todd County 2000 2.82280525212475972969 0.89465756573513943151 3.16893938472753630323 1.86121311814899148488 +Valdez-Cordova Census Area 2000 1.25070886925917779038 0.59811263426251699657 1.22504083956972939990 0.84771422379395948262 +Waushara County 2000 7.21438509071107960599 3.30949368270859706271 0.60525565982701327843 0.60022615175317538544 +Wayne County 2000 0.94936213717458544629 0.78911846142834762231 2.95594340748058137863 1.96105182147450904414 +Williamson County 2000 6.40051753949925199369 0.73796090630650528678 2.74186195207121934591 2.27659084754941781749 +Woodford County 2000 1.66114001659859092820 0.55664623460469568767 1.82209706086687377022 1.17870749798601085737 +Wyoming County 2000 0.71452417457513699221 0.46814038549181972360 9.85342118017399816692 3.19644465036087064672 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q32.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q32.sql.out new file mode 100644 index 0000000000000..de81b93b81cc1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q32.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +1 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q33.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q33.sql.out new file mode 100644 index 0000000000000..668a1c44a6907 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q33.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +796 319.61 +820 445.38 +945 550.19 +753 655.92 +455 711.84 +564 739.49 +951 850.52 +776 1039.28 +676 1386.92 +911 1536.42 +832 1643.04 +925 1744.74 +701 1859.69 +707 1912.37 +780 2339.10 +891 2412.45 +890 3020.90 +870 3142.82 +656 3227.47 +681 3427.68 +985 3441.42 +881 3677.27 +717 3733.60 +854 3734.59 +449 4015.00 +965 4331.20 +960 4344.29 +621 4411.86 +756 4863.42 +918 5140.55 +795 5145.78 +833 5186.15 +976 5317.66 +696 5726.05 +853 5799.18 +770 5958.32 +722 6049.15 +362 6348.46 +399 6401.19 +973 6606.87 +715 6673.32 +708 6760.71 +537 7094.17 +724 7333.62 +375 7385.50 +444 7791.92 +716 7793.63 +887 7844.78 +464 7874.66 +709 7898.12 +978 7952.34 +893 8530.99 +677 8770.76 +595 8787.96 +869 9002.04 +338 9032.32 +738 9136.32 +429 9177.98 +650 9182.94 +901 9212.11 +921 9223.79 +946 9353.49 +858 9443.98 +905 9494.47 +568 9614.09 +389 9939.44 +836 9951.19 +821 9963.08 +728 10017.99 +679 10066.80 +721 10348.99 +910 10453.73 +698 10543.49 +777 10545.94 +675 10556.87 +783 10559.82 +624 10836.32 +763 10885.70 +730 10897.97 +463 10912.55 +534 10925.55 +913 10942.78 +970 11004.86 +846 11218.39 +742 11301.99 +794 11444.72 +442 11482.50 +393 11644.19 +706 11654.35 +577 11722.62 +929 11744.05 +733 11781.60 +896 11875.86 +807 11893.86 +386 12070.02 +865 12380.13 +561 12458.46 +552 12588.43 +683 12592.26 +997 12921.36 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q34.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q34.sql.out new file mode 100644 index 0000000000000..71b7844e8e93a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q34.sql.out @@ -0,0 +1,223 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL NULL Y 47915 15 +NULL NULL NULL NULL 126143 15 +NULL NULL NULL NULL 215293 15 +NULL NULL Mrs. N 120593 15 +NULL Rubin Sir NULL 30056 15 +Adler Justin Sir Y 226187 15 +Allen Rose Mrs. N 179476 16 +Anderson Marvin Dr. N 211012 16 +Andrews Jacob Mr. N 67111 16 +Andrews Samuel Dr. Y 139993 16 +Angel Kevin Mr. Y 106628 15 +Ashley Linda Mrs. Y 82173 15 +Baca Dorothy Mrs. N 64890 15 +Baker Jamie Dr. Y 9916 15 +Banks Leroy Sir N 206730 15 +Barber Dianna Mrs. Y 119959 16 +Barksdale Joann Miss Y 138994 15 +Barnes Ruth Dr. N 84038 15 +Barney Samuel Sir N 15288 15 +Barnhart Charley Mr. Y 166576 15 +Barone Seth Mr. Y 162374 15 +Barrett David Sir N 189879 15 +Bartels Elmer Sir Y 114760 16 +Bear Scott Sir Y 82291 15 +Beers Kendra Dr. NULL 137960 15 +Belcher James Sir Y 239470 16 +Bell Carrie Miss N 5527 15 +Bell Matthew Dr. N 20400 15 +Benjamin Consuelo Ms. Y 201086 15 +Bergman Joann Miss N 177052 15 +Brooks Robert Sir N 155576 16 +Byrd Kelly Sir N 165115 16 +Cagle Jennifer Miss N 163129 15 +Campbell Robert Mr. N 8964 15 +Cardona Robert Mr. N 200501 15 +Carter Wendy Ms. N 96439 15 +Carver Bernard Mr. Y 194943 16 +Chen Wanita Miss N 137713 16 +Christensen Larry Dr. Y 58094 15 +Cochrane Anne Mrs. N 208347 16 +Coleman Inez Dr. Y 88249 16 +Coleman John Mr. N 49444 15 +Colon Anna Dr. Y 143694 15 +Conley Roxie Dr. N 196663 15 +Cook Adam Ms. Y 167339 15 +Cote Justin Dr. N 93466 15 +Council Donald Sir Y 102958 15 +Cramer Linda Ms. N 126628 15 +Crittenden Amie Ms. N 138787 15 +Cruz James Mr. Y 201430 15 +Cuellar Oscar Mr. Y 86781 16 +Cullen Larry Mr. Y 221242 16 +Cushing Antonia Mrs. Y 118927 15 +Davis Gordon Dr. N 227822 15 +Davis Myrtle Dr. Y 37430 15 +Decker Vera Miss Y 75737 16 +Diamond Fernando Dr. N 216391 15 +Diaz Walton Mr. N 131135 16 +Dickinson Steven Mr. N 8057 16 +Douglas Lester Sir N 26043 15 +Dove Garry Dr. N 152171 16 +Drake Rosetta Dr. Y 238040 15 +Dumas Travis Mr. Y 94154 15 +Duncan Olivia Dr. Y 102032 15 +Durham Andrea Dr. Y 144734 15 +Dutton Gay Miss Y 110886 15 +Ellis Karen Miss N 229706 16 +Ely Cesar Dr. Y 36054 16 +Etheridge Mike Dr. N 19648 15 +Farmer Eugenia Miss Y 98187 16 +Farrow Kathy Miss Y 200078 15 +Faulkner Lakeisha Dr. Y 178393 16 +Faulkner Robert Dr. N 109423 15 +Felton David Mr. N 97807 16 +Ferreira Christine Mrs. Y 155822 15 +Finn Robert Mr. N 38057 15 +Finney Crystal Miss Y 158304 15 +Fischer Tamara Mrs. N 66790 15 +Foote Roy Sir N 68086 15 +Foreman Autumn Mrs. Y 164060 15 +Funk Marvin Sir Y 61516 15 +Garcia Christopher Sir Y 181616 16 +Garcia Karen Miss N 236987 15 +Garcia Robert Dr. N 172185 16 +Garland Michael Mr. N 234421 15 +Gaylord Keith Mr. Y 123333 16 +Gifford Mark Mr. N 225973 16 +Gilbert NULL Sir N 16844 15 +Gilmore Austin Dr. Y 239871 15 +Goldsmith Bernice Ms. Y 2347 15 +Good Nancy Dr. N 132655 15 +Goodman NULL NULL N 71903 15 +Gower Nettie Miss N 10576 15 +Gray Evelyn Miss N 157486 15 +Hammond Roger Sir Y 54884 16 +Hardin Kimberly Dr. N 192424 16 +Harp Vance Mr. N 199017 15 +Harper Madeline Dr. N 173835 16 +Harris Tammy Dr. N 217761 16 +Hartmann Joey Dr. N 230915 15 +Hayes David Sir N 82274 15 +Haynes Sara Miss Y 139168 16 +Heath Matthew Dr. N 30710 15 +Hennessey Debbie Dr. Y 79256 15 +Herman Stella Ms. Y 33801 16 +Hernandez Max Mr. N 16015 15 +Hernandez Ruth Ms. Y 97000 15 +Hess Joseph Sir N 151336 15 +Hodges Lucas Dr. Y 163325 15 +Holland Jeremiah Dr. N 95938 16 +Jackson William Mr. Y 16425 16 +Jameson Miguel Dr. N 9181 16 +Jarrell Thomas Mr. Y 85787 16 +Johnson Julia Dr. N 27560 15 +Jones Theresa Ms. N 219765 16 +Kelly Mark Mr. Y 17039 16 +Khan Hank Mr. N 177803 15 +Kim Charlotte Dr. Y 7208 16 +Kunz Sarah Dr. N 74568 15 +Lake Robert Sir N 13264 15 +Landry Rudolph Sir N 117581 15 +Lane Luis Sir N 232302 16 +Langford Darlene Mrs. N 214891 15 +Larson Kevin Mr. Y 35053 15 +Larson Thomas Mr. N 114265 15 +Lee Malik Dr. N 20122 16 +Leonard Orlando Dr. Y 133168 15 +Lincoln Anthony Miss Y 1407 16 +Lindsey Linda Dr. N 62687 16 +Lopez Karen Dr. Y 136008 15 +Lunsford Kevin Dr. N 159120 16 +Lynch Sylvia Ms. Y 115438 15 +Lyon Michael Mr. N 140323 15 +Maestas Mabel Mrs. N 184265 15 +Magana Diann Mrs. Y 19139 15 +Manning Annamarie Ms. N 4984 16 +Marshall Felipe Sir N 138890 15 +Martin Paul Dr. N 26115 16 +Martinez Earl Sir N 108982 15 +Martinez Robert Sir Y 157672 16 +Masterson Barbara Mrs. N 231070 15 +Mata Deborah Miss Y 4323 15 +Mccoy Debbie Dr. N 91552 15 +Mcgill Tony Sir N 110030 15 +Mckeon Christina Dr. N 26190 15 +Mcnamara Linda Dr. Y 7957 15 +Means Michael Mr. Y 226164 16 +Medina Joseph Sir Y 110246 15 +Meyers Zachary Mr. Y 59549 15 +Montgomery John Mr. Y 103718 15 +Moody Miranda Ms. Y 171671 15 +Moore Mark Dr. N 191471 15 +Moran Celia Ms. Y 200691 15 +Morgan Cecelia Mrs. N 200742 15 +Morrell Chad Mr. N 93790 15 +Morse Robert Mr. N 68627 16 +Neel Audrey Ms. Y 193308 15 +Neff Sheri Mrs. Y 52556 15 +Nelson Katherine Mrs. N 110232 15 +New Suzanne Miss N 5120 16 +Nielsen Veronica Mrs. N 23905 15 +Oakley George Mr. Y 177890 15 +Parker Barbar Dr. N 57241 15 +Parker Jeff Sir N 213566 16 +Pemberton Jennifer Mrs. Y 49875 16 +Perry Robert Mr. Y 153147 16 +Phillips David Dr. N 148883 15 +Phillips Georgia NULL Y 26878 15 +Phillips Stanley Sir N 31989 15 +Pinkston Brenda Dr. N 126440 15 +Pryor Dorothy Mrs. N 213779 16 +Reed William Dr. N 145002 15 +Reynolds Amelia Ms. Y 68440 15 +Rice David Dr. Y 70484 16 +Robertson Daniel Mr. N 40407 16 +Rosales NULL NULL Y 156406 16 +Russo Cheryl Miss N 81123 15 +Sanchez Bruce Sir Y 124479 15 +Schmitz Kaitlyn Miss N 105162 15 +Sebastian Homer Dr. Y 64994 15 +Sexton Jerry Sir N 91446 15 +Sierra David Sir Y 61810 15 +Simmons Joseph Dr. N 54185 15 +Simpson Michael Sir Y 186613 16 +Simpson Shalanda Dr. Y 181123 15 +Singleton Andrew Ms. N 45464 15 +Smith Danny Dr. Y 143297 15 +Smith Edward Sir Y 81178 16 +Smith Hung Sir N 44710 15 +Smith Kimberly Mrs. Y 174638 15 +Smith Vern Sir N 50960 15 +Sosa Leah Ms. Y 77106 16 +Sparks Erick Dr. N 220337 15 +Taylor Kenneth Dr. Y 194337 15 +Todd Linda Ms. Y 235816 15 +Trout Harley Mr. Y 214547 15 +Urban NULL NULL NULL 214898 15 +Varner Elsie Ms. N 199602 16 +Vazquez Bill Dr. Y 62049 15 +Velazquez William Dr. N 46239 15 +Wagner Barbara Ms. Y 233595 15 +Ward Anna Miss N 52941 16 +Watkins Rosa Miss Y 152190 16 +Welch James Dr. Y 51441 16 +West Teresa Ms. N 233179 16 +White Maurice Mr. N 10107 15 +Williams John Mr. Y 84783 15 +Williams Robert Mr. Y 41233 15 +Williamson Ruth Mrs. Y 86369 15 +Wilson Joel Sir Y 91826 16 +Wilson John Sir Y 26543 15 +Wilson Mariano Mr. Y 67472 16 +Winkler Jose Dr. Y 78400 15 +Winter Cora Mrs. N 8978 16 +Wood Marcia Ms. Y 219276 16 +Wood Michelle Mrs. N 39560 15 +Wright Richie Sir Y 106818 15 +Young William Mr. Y 51127 15 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q35.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q35.sql.out new file mode 100644 index 0000000000000..3307163872566 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q35.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL F D 1 0 0 0.0 2 1 2 2 2.0 2 1 2 2 2.0 +NULL F D 1 0 0 0.0 3 1 3 3 3.0 4 1 4 4 4.0 +NULL F D 1 0 0 0.0 5 1 5 5 5.0 2 1 2 2 2.0 +NULL F D 1 0 0 0.0 6 1 6 6 6.0 4 1 4 4 4.0 +NULL F D 1 1 1 1.0 1 1 1 1 1.0 1 1 1 1 1.0 +NULL F D 1 1 1 1.0 4 1 4 4 4.0 4 1 4 4 4.0 +NULL F D 1 1 1 1.0 4 1 4 4 4.0 5 1 5 5 5.0 +NULL F D 1 2 2 2.0 0 1 0 0 0.0 4 1 4 4 4.0 +NULL F D 1 2 2 2.0 1 1 1 1 1.0 3 1 3 3 3.0 +NULL F D 1 2 2 2.0 6 1 6 6 6.0 1 1 1 1 1.0 +NULL F D 1 3 3 3.0 3 1 3 3 3.0 2 1 2 2 2.0 +NULL F D 1 3 3 3.0 3 1 3 3 3.0 6 1 6 6 6.0 +NULL F D 1 3 3 3.0 4 1 4 4 4.0 1 1 1 1 1.0 +NULL F D 1 4 4 4.0 0 1 0 0 0.0 3 1 3 3 3.0 +NULL F D 1 4 4 4.0 1 1 1 1 1.0 1 1 1 1 1.0 +NULL F D 1 4 4 4.0 1 1 1 1 1.0 4 1 4 4 4.0 +NULL F D 1 4 4 4.0 5 1 5 5 5.0 6 1 6 6 6.0 +NULL F D 1 5 5 5.0 4 1 4 4 4.0 3 1 3 3 3.0 +NULL F D 1 5 5 5.0 5 1 5 5 5.0 2 1 2 2 2.0 +NULL F D 1 6 6 6.0 1 1 1 1 1.0 3 1 3 3 3.0 +NULL F D 1 6 6 6.0 2 1 2 2 2.0 2 1 2 2 2.0 +NULL F D 1 6 6 6.0 4 1 4 4 4.0 1 1 1 1 1.0 +NULL F M 1 0 0 0.0 5 1 5 5 5.0 5 1 5 5 5.0 +NULL F M 1 1 1 1.0 3 1 3 3 3.0 0 1 0 0 0.0 +NULL F M 1 1 1 1.0 6 1 6 6 6.0 0 1 0 0 0.0 +NULL F M 1 1 1 1.0 6 1 6 6 6.0 1 1 1 1 1.0 +NULL F M 1 2 2 2.0 2 1 2 2 2.0 6 1 6 6 6.0 +NULL F M 1 2 2 2.0 4 1 4 4 4.0 4 1 4 4 4.0 +NULL F M 1 3 3 3.0 2 1 2 2 2.0 1 1 1 1 1.0 +NULL F M 1 3 3 3.0 5 1 5 5 5.0 0 1 0 0 0.0 +NULL F M 1 3 3 3.0 5 1 5 5 5.0 1 1 1 1 1.0 +NULL F M 1 4 4 4.0 1 1 1 1 1.0 4 1 4 4 4.0 +NULL F M 1 4 4 4.0 2 1 2 2 2.0 1 1 1 1 1.0 +NULL F M 1 4 4 4.0 3 1 3 3 3.0 3 1 3 3 3.0 +NULL F M 1 5 5 5.0 2 1 2 2 2.0 2 1 2 2 2.0 +NULL F M 1 6 6 6.0 1 1 1 1 1.0 1 1 1 1 1.0 +NULL F M 1 6 6 6.0 5 1 5 5 5.0 6 1 6 6 6.0 +NULL F S 1 0 0 0.0 3 1 3 3 3.0 6 1 6 6 6.0 +NULL F S 1 1 1 1.0 0 1 0 0 0.0 4 1 4 4 4.0 +NULL F S 1 1 1 1.0 1 1 1 1 1.0 2 1 2 2 2.0 +NULL F S 1 1 1 1.0 2 1 2 2 2.0 6 1 6 6 6.0 +NULL F S 1 1 1 1.0 5 1 5 5 5.0 5 1 5 5 5.0 +NULL F S 1 2 2 2.0 0 1 0 0 0.0 3 1 3 3 3.0 +NULL F S 2 2 2 2.0 5 2 5 5 5.0 6 2 6 6 6.0 +NULL F S 1 3 3 3.0 0 1 0 0 0.0 4 1 4 4 4.0 +NULL F S 1 3 3 3.0 2 1 2 2 2.0 1 1 1 1 1.0 +NULL F S 1 3 3 3.0 2 1 2 2 2.0 5 1 5 5 5.0 +NULL F S 1 3 3 3.0 3 1 3 3 3.0 3 1 3 3 3.0 +NULL F S 1 4 4 4.0 1 1 1 1 1.0 4 1 4 4 4.0 +NULL F S 1 4 4 4.0 2 1 2 2 2.0 4 1 4 4 4.0 +NULL F S 1 5 5 5.0 6 1 6 6 6.0 0 1 0 0 0.0 +NULL F U 1 0 0 0.0 1 1 1 1 1.0 3 1 3 3 3.0 +NULL F U 1 0 0 0.0 3 1 3 3 3.0 0 1 0 0 0.0 +NULL F U 1 1 1 1.0 3 1 3 3 3.0 2 1 2 2 2.0 +NULL F U 1 1 1 1.0 5 1 5 5 5.0 6 1 6 6 6.0 +NULL F U 1 2 2 2.0 0 1 0 0 0.0 1 1 1 1 1.0 +NULL F U 1 2 2 2.0 4 1 4 4 4.0 4 1 4 4 4.0 +NULL F U 2 3 3 3.0 1 2 1 1 1.0 6 2 6 6 6.0 +NULL F U 1 4 4 4.0 0 1 0 0 0.0 4 1 4 4 4.0 +NULL F U 1 5 5 5.0 3 1 3 3 3.0 6 1 6 6 6.0 +NULL F U 1 6 6 6.0 2 1 2 2 2.0 2 1 2 2 2.0 +NULL F U 1 6 6 6.0 4 1 4 4 4.0 4 1 4 4 4.0 +NULL F U 1 6 6 6.0 5 1 5 5 5.0 0 1 0 0 0.0 +NULL F U 1 6 6 6.0 5 1 5 5 5.0 6 1 6 6 6.0 +NULL F W 1 0 0 0.0 0 1 0 0 0.0 4 1 4 4 4.0 +NULL F W 1 0 0 0.0 5 1 5 5 5.0 5 1 5 5 5.0 +NULL F W 1 1 1 1.0 3 1 3 3 3.0 4 1 4 4 4.0 +NULL F W 1 2 2 2.0 0 1 0 0 0.0 5 1 5 5 5.0 +NULL F W 1 3 3 3.0 3 1 3 3 3.0 6 1 6 6 6.0 +NULL F W 1 3 3 3.0 6 1 6 6 6.0 6 1 6 6 6.0 +NULL F W 1 4 4 4.0 3 1 3 3 3.0 1 1 1 1 1.0 +NULL F W 1 5 5 5.0 1 1 1 1 1.0 1 1 1 1 1.0 +NULL F W 1 5 5 5.0 1 1 1 1 1.0 4 1 4 4 4.0 +NULL F W 1 5 5 5.0 3 1 3 3 3.0 6 1 6 6 6.0 +NULL F W 1 5 5 5.0 4 1 4 4 4.0 6 1 6 6 6.0 +NULL F W 1 6 6 6.0 0 1 0 0 0.0 5 1 5 5 5.0 +NULL F W 1 6 6 6.0 2 1 2 2 2.0 3 1 3 3 3.0 +NULL F W 1 6 6 6.0 5 1 5 5 5.0 5 1 5 5 5.0 +NULL M D 1 0 0 0.0 3 1 3 3 3.0 0 1 0 0 0.0 +NULL M D 1 1 1 1.0 3 1 3 3 3.0 0 1 0 0 0.0 +NULL M D 1 1 1 1.0 3 1 3 3 3.0 2 1 2 2 2.0 +NULL M D 1 2 2 2.0 0 1 0 0 0.0 6 1 6 6 6.0 +NULL M D 1 2 2 2.0 4 1 4 4 4.0 4 1 4 4 4.0 +NULL M D 1 2 2 2.0 5 1 5 5 5.0 3 1 3 3 3.0 +NULL M D 1 3 3 3.0 1 1 1 1 1.0 5 1 5 5 5.0 +NULL M D 1 3 3 3.0 2 1 2 2 2.0 3 1 3 3 3.0 +NULL M D 1 4 4 4.0 5 1 5 5 5.0 2 1 2 2 2.0 +NULL M D 1 6 6 6.0 1 1 1 1 1.0 6 1 6 6 6.0 +NULL M D 1 6 6 6.0 3 1 3 3 3.0 1 1 1 1 1.0 +NULL M M 1 0 0 0.0 0 1 0 0 0.0 1 1 1 1 1.0 +NULL M M 2 0 0 0.0 1 2 1 1 1.0 2 2 2 2 2.0 +NULL M M 1 0 0 0.0 2 1 2 2 2.0 1 1 1 1 1.0 +NULL M M 1 0 0 0.0 3 1 3 3 3.0 5 1 5 5 5.0 +NULL M M 1 0 0 0.0 5 1 5 5 5.0 0 1 0 0 0.0 +NULL M M 1 1 1 1.0 0 1 0 0 0.0 1 1 1 1 1.0 +NULL M M 1 1 1 1.0 0 1 0 0 0.0 2 1 2 2 2.0 +NULL M M 1 2 2 2.0 6 1 6 6 6.0 5 1 5 5 5.0 +NULL M M 1 3 3 3.0 5 1 5 5 5.0 1 1 1 1 1.0 +NULL M M 1 3 3 3.0 6 1 6 6 6.0 4 1 4 4 4.0 +NULL M M 1 4 4 4.0 1 1 1 1 1.0 3 1 3 3 3.0 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q36.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q36.sql.out new file mode 100644 index 0000000000000..9fd97cbed90ed --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q36.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +-0.43310777864678831165 NULL NULL 2 1 +-0.44057752675240550259 Home NULL 1 1 +-0.43759152110176221048 Music NULL 1 2 +-0.43708103961494058652 NULL NULL 1 3 +-0.43616253138693450880 Shoes NULL 1 4 +-0.43567118609322457134 Children NULL 1 5 +-0.43423932351647837678 Sports NULL 1 6 +-0.43342977299642408093 Electronics NULL 1 7 +-0.43243283120699560700 Women NULL 1 8 +-0.43164166899823508408 Men NULL 1 9 +-0.42516187689954540402 Books NULL 1 10 +-0.42448713380832790884 Jewelry NULL 1 11 +-0.73902664238792748962 NULL shirts 0 1 +-0.61125804873635587486 NULL country 0 2 +-0.53129803597069255822 NULL dresses 0 3 +-0.51266635289382758517 NULL athletic 0 4 +-0.45290387783638603924 NULL mens 0 5 +-0.41288056661656330013 NULL accessories 0 6 +-0.40784754677005682440 NULL NULL 0 7 +-0.34254844860867375832 NULL baseball 0 8 +-0.32511461675631534897 NULL infants 0 9 +-0.44733955704648003493 Books computers 0 1 +-0.44221358112622373783 Books home repair 0 2 +-0.44131129175272951442 Books romance 0 3 +-0.43954111564375046074 Books history 0 4 +-0.43921337505389731821 Books mystery 0 5 +-0.43904020269360481109 Books sports 0 6 +-0.42821476999837619396 Books travel 0 7 +-0.42609067296303848297 Books cooking 0 8 +-0.42538995145338568328 Books fiction 0 9 +-0.42446563616188232944 Books arts 0 10 +-0.42424821311884350413 Books parenting 0 11 +-0.41822014479424203008 Books reference 0 12 +-0.41350839325516811781 Books business 0 13 +-0.40935208137315013129 Books science 0 14 +-0.40159380735731858928 Books self-help 0 15 +-0.36957884843305744526 Books entertainments 0 16 +-0.44602461556731552282 Children school-uniforms 0 1 +-0.44141106040000560852 Children toddlers 0 2 +-0.43479886701046623711 Children infants 0 3 +-0.41900662971936329442 Children newborn 0 4 +-0.41526603781609697786 Children NULL 0 5 +-0.45347482218635333366 Electronics personal 0 1 +-0.44349670349829474271 Electronics stereo 0 2 +-0.44262427232850112058 Electronics automotive 0 3 +-0.44115886172705231970 Electronics portable 0 4 +-0.43972786651639318010 Electronics memory 0 5 +-0.43889275271590953040 Electronics scanners 0 6 +-0.43879181695132886061 Electronics karoke 0 7 +-0.43743655149948399284 Electronics dvd/vcr players 0 8 +-0.43737666390514154910 Electronics cameras 0 9 +-0.43390499017233926812 Electronics wireless 0 10 +-0.43163869754114299547 Electronics audio 0 11 +-0.42958938669780912634 Electronics camcorders 0 12 +-0.42872845803629855724 Electronics musical 0 13 +-0.42228240153396399656 Electronics televisions 0 14 +-0.41893847772039275795 Electronics monitors 0 15 +-0.39793878022746331540 Electronics disk drives 0 16 +-0.49051156860507320113 Home NULL 0 1 +-0.48431476750686752965 Home blinds/shades 0 2 +-0.47545837941951440918 Home bathroom 0 3 +-0.45726228921216284093 Home rugs 0 4 +-0.45540507568891021759 Home furniture 0 5 +-0.45303572267019508501 Home flatware 0 6 +-0.44755542058111800358 Home tables 0 7 +-0.44419847780930149402 Home wallpaper 0 8 +-0.44092345226680695671 Home glassware 0 9 +-0.43877591834074789745 Home decor 0 10 +-0.43765482553654514822 Home accent 0 11 +-0.43188199218974854630 Home bedding 0 12 +-0.43107417904272222899 Home kids 0 13 +-0.42474436355625900935 Home lighting 0 14 +-0.41783311109052416746 Home curtains/drapes 0 15 +-0.41767111806961188479 Home mattresses 0 16 +-0.40562188698541221499 Home paint 0 17 +-0.45165056505480816921 Jewelry jewelry boxes 0 1 +-0.44372227804836590137 Jewelry estate 0 2 +-0.44251815032563188894 Jewelry gold 0 3 +-0.43978127753996883542 Jewelry consignment 0 4 +-0.43821750044359339153 Jewelry custom 0 5 +-0.43439645036479672989 Jewelry bracelets 0 6 +-0.43208398325687772942 Jewelry loose stones 0 7 +-0.43060897375114375156 Jewelry diamonds 0 8 +-0.42847505748860847066 Jewelry costume 0 9 +-0.42667449062277843561 Jewelry rings 0 10 +-0.41987969011585456826 Jewelry mens watch 0 11 +-0.41624621972944533035 Jewelry semi-precious 0 12 +-0.41148949162100715771 Jewelry womens watch 0 13 +-0.39725668174847694299 Jewelry birdal 0 14 +-0.39665274051903254057 Jewelry pendants 0 15 +-0.38423525233438861010 Jewelry earings 0 16 +-0.44464388887858793403 Men shirts 0 1 +-0.43719860800637369827 Men accessories 0 2 +-0.43164606665359630905 Men sports-apparel 0 3 +-0.41530906677293519754 Men pants 0 4 +-0.38332708894803499123 Men NULL 0 5 +-0.47339698705534020269 Music NULL 0 1 +-0.44193214675249008923 Music rock 0 2 +-0.44008174913565459246 Music country 0 3 +-0.43863444992223641373 Music pop 0 4 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q37.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q37.sql.out new file mode 100644 index 0000000000000..1782f9025fa1e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q37.sql.out @@ -0,0 +1,7 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAADHGDAAAA Necessary times believe probably. Cruel traders know ho 92.95 +AAAAAAAAFMLDAAAA Given groups please unfortu 84.79 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q38.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q38.sql.out new file mode 100644 index 0000000000000..7bcc92dc20802 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q38.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +104 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q39a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q39a.sql.out new file mode 100644 index 0000000000000..f2b8dc07af08d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q39a.sql.out @@ -0,0 +1,211 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +1 823 1 301.5 1.1271370519097714 1 823 2 399.25 1.0208768007427147 +1 1015 1 344.25 1.2511428113709673 1 1015 2 385.5 1.0470314051933909 +1 1555 1 264.25 1.2283186159550554 1 1555 2 308.25 1.058767914170086 +1 1691 1 116.33333333333333 1.0248470977646387 1 1691 2 304.75 1.1191291694661885 +1 1859 1 434.0 1.0498116619056204 1 1859 2 314.0 1.1900690532464868 +1 2239 1 322.5 1.0978977568088866 1 2239 2 382.75 1.0474268515036576 +1 3859 1 352.25 1.1782246058681007 1 3859 2 437.5 1.145917046540028 +1 4975 1 388.5 1.0001018617093298 1 4975 2 363.3333333333333 1.0038038922115327 +1 5109 1 370.75 1.1395542642353356 1 5109 2 322.25 1.1495609463470746 +1 5177 1 292.0 1.3461430973363442 1 5177 2 216.25 1.05761161489175 +1 6619 1 409.5 1.0040570532236324 1 6619 2 322.3333333333333 1.0619035677903699 +1 7535 1 428.25 1.0544682695099616 1 7535 2 391.5 1.222946431626478 +1 8283 1 194.25 1.2003971691624762 1 8283 2 400.6666666666667 1.1209666759436547 +1 8401 1 328.25 1.0063843177755347 1 8401 2 297.75 1.4183634329309731 +1 8547 1 328.25 1.1425055398027557 1 8547 2 264.5 1.0416250678095451 +1 8717 1 228.5 1.2085987127693683 1 8717 2 288.25 1.2149351569032296 +1 8933 1 361.0 1.1736874031675129 1 8933 2 433.0 1.0089048763341881 +1 8997 1 250.0 1.035266149354841 1 8997 2 430.6666666666667 1.1313205669952624 +1 9245 1 392.3333333333333 1.1119320768290193 1 9245 2 343.0 1.1904615139612167 +1 9621 1 277.6666666666667 1.2243644452469618 1 9621 2 337.25 1.2482331965937552 +1 10299 1 380.5 1.1949268339105126 1 10299 2 144.5 1.184591012875645 +1 10745 1 287.3333333333333 1.084129539111935 1 10745 2 335.6666666666667 1.1651939735017574 +1 11125 1 472.75 1.0530701492045889 1 11125 2 264.5 1.0730737223380644 +1 11859 1 256.5 1.4406552725835113 1 11859 2 370.75 1.1082243282754298 +1 12101 1 334.75 1.1423000747353222 1 12101 2 396.5 1.0099457859523537 +1 12259 1 326.5 1.219693210219279 1 12259 2 292.6666666666667 1.2808898286830026 +1 12641 1 321.25 1.1286221893301993 1 12641 2 279.25 1.129134558577743 +1 13043 1 260.5 1.355894484625015 1 13043 2 295.0 1.056210118409035 +1 13157 1 260.5 1.5242630430075292 1 13157 2 413.5 1.0422561797285326 +1 13293 1 325.25 1.1599721810918615 1 13293 2 345.75 1.0626233629994524 +1 13729 1 486.0 1.0680776434770018 1 13729 2 389.6666666666667 1.3522269473359647 +1 14137 1 427.0 1.0418229612154228 1 14137 2 387.5 1.0294855239302605 +1 14159 1 398.6666666666667 1.0001328196713188 1 14159 2 186.5 1.01269532733355 +1 14161 1 84.66666666666667 1.4291501268026987 1 14161 2 450.5 1.0059037693687187 +1 14911 1 397.6666666666667 1.1801953152598252 1 14911 2 195.0 1.0294118715204632 +1 14983 1 286.6666666666667 1.335077674103522 1 14983 2 138.25 1.0223829110804588 +1 15181 1 270.0 1.0247553155705627 1 15181 2 431.25 1.0014337967301454 +1 15425 1 311.5 1.0406385606636968 1 15425 2 348.25 1.1725274574998379 +1 15441 1 295.0 1.597573089984185 1 15441 2 296.0 1.534664092337063 +1 16601 1 428.5 1.0395250642903893 1 16601 2 397.75 1.108690797111687 +1 16895 1 197.25 1.6216484458744376 1 16895 2 201.33333333333334 1.001838963026182 +1 17285 1 291.5 1.221338355118313 1 17285 2 384.3333333333333 1.3166511804104957 +1 17399 1 335.25 1.18017157377048 1 17399 2 208.0 1.2199892235676928 +1 17521 1 248.0 1.1446287380504054 1 17521 2 321.25 1.1065301391790767 +2 39 1 306.75 1.3140265341053214 2 39 2 207.75 1.0612481315699458 +2 575 1 139.75 1.0651946548671536 2 575 2 390.0 1.2985907498394962 +2 577 1 398.3333333333333 1.0782049277126313 2 577 2 125.25 1.015309703853557 +2 795 1 445.0 1.008215213597613 2 795 2 226.0 1.0374761691860421 +2 977 1 383.0 1.0133755425339792 2 977 2 365.25 1.013000783116057 +2 993 1 361.0 1.0341824955539196 2 993 2 228.0 1.2304019216861168 +2 1367 1 402.0 1.143084675277277 2 1367 2 204.25 1.0427544150441603 +2 2863 1 366.5 1.0309651709854288 2 2863 2 216.75 1.213127273469588 +2 3041 1 330.75 1.0432879984065397 2 3041 2 397.25 1.0315273164376213 +2 3323 1 427.25 1.0090121310722835 2 3323 2 338.5 1.0459307196329675 +2 3999 1 422.0 1.0082188847601554 2 3999 2 403.25 1.0051474075339424 +2 4023 1 410.3333333333333 1.0275376199691826 2 4023 2 247.75 1.1609399487145424 +2 4331 1 384.75 1.064007972514113 2 4331 2 385.75 1.011321832432027 +2 5915 1 231.25 1.8705235468767831 2 5915 2 407.0 1.0885509926353207 +2 6275 1 420.6666666666667 1.008294829045718 2 6275 2 297.6666666666667 1.4615952762209015 +2 7087 1 494.5 1.0102112511298167 2 7087 2 148.5 1.7921780145107034 +2 7333 1 150.33333333333334 1.433050233356339 2 7333 2 214.75 1.0557216871980746 +2 7497 1 360.25 1.0793771564436658 2 7497 2 200.0 1.2799283834131763 +2 8825 1 381.5 1.097428368281076 2 8825 2 414.25 1.0153496363346763 +2 10795 1 393.3333333333333 1.0666650582315749 2 10795 2 322.75 1.0370108734399346 +2 10863 1 330.75 1.0627419399194518 2 10863 2 276.0 1.6689178243621974 +2 11073 1 274.0 1.6770433716259476 2 11073 2 359.0 1.0133649606830526 +2 11465 1 312.25 1.1867998857912492 2 11465 2 154.0 1.1105857906239676 +2 11853 1 292.25 1.0772136418065505 2 11853 2 401.5 1.0787107704829733 +2 12389 1 366.25 1.067334394007718 2 12389 2 278.5 1.1044576295014297 +2 13247 1 356.0 1.0660645893691494 2 13247 2 342.5 1.0634325916808434 +2 13661 1 293.0 1.2174529148923212 2 13661 2 412.25 1.048653193049242 +2 13923 1 335.75 1.2358541998052608 2 13923 2 100.75 1.0814570294681372 +2 14671 1 262.75 1.0250871002782607 2 14671 2 338.75 1.0628054504205149 +2 15397 1 297.6666666666667 1.2809438534554334 2 15397 2 492.75 1.0943752797356943 +2 15477 1 251.0 1.124353329693781 2 15477 2 307.6666666666667 1.3795297219800364 +2 15795 1 304.5 1.0607926164522463 2 15795 2 397.25 1.1176167493994051 +2 16603 1 293.3333333333333 1.387199822342635 2 16603 2 433.3333333333333 1.1660592106922516 +2 16969 1 364.6666666666667 1.1611696936141274 2 16969 2 375.3333333333333 1.0294034440006494 +2 17393 1 179.25 1.1070920857377156 2 17393 2 294.25 1.1481110921426008 +3 29 1 438.25 1.0131261466664097 3 29 2 344.0 1.1151530577310618 +3 247 1 321.0 1.0042014719826915 3 247 2 423.0 1.180182949214427 +3 953 1 338.75 1.1838346915880587 3 953 2 321.5 1.2363739805879619 +3 1541 1 110.0 1.1791578448793427 3 1541 2 273.75 1.197487924282276 +3 1649 1 360.6666666666667 1.1853733590339803 3 1649 2 334.25 1.1482623798952447 +3 2459 1 313.75 1.0048197369511642 3 2459 2 352.75 1.21947122536524 +3 2619 1 241.0 1.1159485992928209 3 2619 2 261.0 1.1099544779211474 +3 2707 1 375.25 1.1207806068743988 3 2707 2 290.75 1.0006820492941273 +3 2975 1 304.0 1.0591594463002163 3 2975 2 190.0 1.2046769431661426 +3 3315 1 271.75 1.555976998814345 3 3315 2 393.75 1.0196319345405949 +3 3393 1 260.0 1.5009563026568116 3 3393 2 470.25 1.129275872154205 +3 3597 1 304.0 1.2471400801439207 3 3597 2 364.0 1.057917059038131 +3 3661 1 331.25 1.2138186201312904 3 3661 2 398.25 1.0134502284121254 +3 3951 1 328.3333333333333 1.3920958631929026 3 3951 2 378.0 1.057830622993178 +3 4793 1 439.5 1.3208979917045633 3 4793 2 298.6666666666667 1.2536383791454593 +3 5221 1 395.25 1.012020609314844 3 5221 2 423.6666666666667 1.0742618083358388 +3 5857 1 331.5 1.1548423818657882 3 5857 2 394.3333333333333 1.101836576034495 +3 6045 1 313.5 1.1971443861134845 3 6045 2 67.25 1.2083633449201445 +3 6615 1 366.0 1.4103495908912012 3 6615 2 228.0 1.0322683130436006 +3 7071 1 182.75 1.402155194063468 3 7071 2 438.25 1.0176436798626307 +3 7211 1 355.25 1.2455338321801286 3 7211 2 462.0 1.0449517641148738 +3 8761 1 253.75 1.1207897246865177 3 8761 2 212.5 1.1557740307473354 +3 9305 1 350.6666666666667 1.3141448475357504 3 9305 2 387.3333333333333 1.043391324490137 +3 9373 1 179.75 1.3318949893741667 3 9373 2 321.25 1.1314604181366261 +3 9669 1 315.75 1.093783081996044 3 9669 2 321.0 1.1239703852823903 +3 9699 1 362.25 1.0269679854596525 3 9699 2 358.0 1.5025258842887776 +3 10301 1 348.5 1.2820855632941448 3 10301 2 318.5 1.289483896046129 +3 10427 1 241.33333333333334 1.5634035191786233 3 10427 2 381.25 1.0623056061004696 +3 11103 1 260.25 1.0537747255764836 3 11103 2 334.0 1.2702517027303248 +3 11141 1 251.0 1.0896833134701018 3 11141 2 272.0 1.1910327315841194 +3 12019 1 362.25 1.0966647561341047 3 12019 2 282.25 1.0983756663144604 +3 12743 1 276.5 1.005648259467935 3 12743 2 352.5 1.08876682930328 +3 12753 1 250.25 1.3386846981823803 3 12753 2 468.0 1.0383135087299893 +3 12931 1 322.75 1.1146291380437745 3 12931 2 320.0 1.17009448069376 +3 13487 1 308.25 1.2961991776642086 3 13487 2 293.25 1.0585525936033 +3 13555 1 373.25 1.0745070114317623 3 13555 2 152.75 1.412684197862033 +3 13581 1 292.75 1.1902035296028353 3 13581 2 253.0 1.155002663143799 +3 13829 1 233.5 1.1312399620732085 3 13829 2 444.25 1.0391188483200453 +3 13847 1 417.5 1.039525557170396 3 13847 2 263.5 1.4436108729741235 +3 14073 1 355.5 1.0476440697241391 3 14073 2 437.25 1.0172135605078851 +3 14767 1 311.5 1.0034195608338836 3 14767 2 339.0 1.2032144276415566 +3 14981 1 193.25 1.0060336654947306 3 14981 2 441.5 1.3661655364714043 +3 16331 1 272.0 1.1467170493846688 3 16331 2 339.25 1.2786638701439956 +3 16847 1 273.6666666666667 1.3346016934186173 3 16847 2 398.0 1.2041547394959626 +3 16987 1 358.0 1.101510614957325 3 16987 2 420.0 1.0848663494738469 +3 17613 1 424.3333333333333 1.0320925947787334 3 17613 2 390.75 1.0761214357356987 +3 17987 1 387.5 1.1128327233395303 3 17987 2 131.66666666666666 1.1227241574530091 +4 225 1 180.0 1.2847074573726138 4 225 2 366.5 1.112494070167504 +4 299 1 293.5 1.135267940218844 4 299 2 380.0 1.0485028679413595 +4 825 1 223.25 1.2488574716961685 4 825 2 254.0 1.5182802586094637 +4 1393 1 418.75 1.0408989038120988 4 1393 2 413.3333333333333 1.1020163503416796 +4 1523 1 363.25 1.0130673543588669 4 1523 2 253.5 1.2817761298828965 +4 1729 1 313.25 1.3148930771572687 4 1729 2 296.5 1.210664179669432 +4 2989 1 424.6666666666667 1.03767453099966 4 2989 2 123.75 1.4454541925191389 +4 3183 1 190.0 1.2520196057807818 4 3183 2 245.0 1.0300119488354766 +4 4175 1 395.0 1.042998032908585 4 4175 2 485.0 1.0145126110736231 +4 4293 1 285.0 1.042264740588342 4 4293 2 331.25 1.0702681575369872 +4 4573 1 243.75 1.4457774863358526 4 4573 2 431.25 1.0010829394909448 +4 4875 1 401.0 1.0066599946104444 4 4875 2 410.5 1.051550593497737 +4 5009 1 386.5 1.0301582587751055 4 5009 2 473.75 1.055073121585445 +4 5947 1 291.5 1.046282184237671 4 5947 2 320.5 1.1280002765664996 +4 6359 1 193.33333333333334 1.2483139639831744 4 6359 2 371.75 1.0993680760045068 +4 6517 1 289.0 1.0911931716633327 4 6517 2 148.0 1.0471156482980475 +4 8309 1 371.0 1.2845214196617782 4 8309 2 371.5 1.0748626938819539 +4 8339 1 392.75 1.0058445869354098 4 8339 2 345.75 1.2872431560206488 +4 9685 1 288.75 1.0017436994234579 4 9685 2 440.75 1.0083448738924952 +4 10255 1 373.5 1.1222827247788254 4 10255 2 352.0 1.1003307048901103 +4 10925 1 199.5 1.3875238422301213 4 10925 2 261.75 1.283642511996497 +4 11213 1 226.66666666666666 1.09984270658979 4 11213 2 413.5 1.0174813417315496 +4 11305 1 351.75 1.1922401157939606 4 11305 2 365.25 1.1258535465411879 +4 11473 1 394.6666666666667 1.0178948794541924 4 11473 2 212.66666666666666 1.195359710715888 +4 12353 1 340.25 1.164721531085477 4 12353 2 432.0 1.0523203480868901 +4 12783 1 329.5 1.0329266474827115 4 12783 2 187.0 1.2621302720196819 +4 12971 1 370.3333333333333 1.097620185659271 4 12971 2 278.0 1.4524982093215804 +4 13665 1 363.0 1.04089223995917 4 13665 2 332.6666666666667 1.1900176061910035 +4 13913 1 297.3333333333333 1.071040936419414 4 13913 2 316.25 1.3567449933143143 +4 15161 1 305.75 1.3571548565863678 4 15161 2 262.3333333333333 1.2292106140967536 +4 15401 1 341.0 1.0164918336889106 4 15401 2 337.25 1.0178529534898602 +4 15467 1 355.3333333333333 1.27670099607062 4 15467 2 416.6666666666667 1.1678517714162187 +4 16211 1 257.6666666666667 1.6381074811154002 4 16211 2 352.25 1.055236934125639 +4 16367 1 344.25 1.1865617643407205 4 16367 2 330.5 1.001436680208246 +4 16623 1 174.75 1.1547312605990323 4 16623 2 261.75 1.4692073123565808 +4 16753 1 283.6666666666667 1.4179905875607177 4 16753 2 331.0 1.0757450815976775 +4 16791 1 229.75 1.0415889892942085 4 16791 2 348.75 1.2365182061688882 +5 507 1 360.5 1.0016609878348282 5 507 2 397.25 1.1165805580468837 +5 1379 1 418.3333333333333 1.1593756930293735 5 1379 2 362.25 1.1381161323894302 +5 1451 1 259.75 1.0166115859746467 5 1451 2 186.5 1.3009837449067687 +5 1761 1 245.25 1.0674277258886877 5 1761 2 356.3333333333333 1.0319105846046546 +5 1919 1 558.0 1.051789656603646 5 1919 2 280.75 1.435982403616447 +5 2153 1 398.25 1.038369445511033 5 2153 2 322.0 1.2495167076207327 +5 2583 1 357.25 1.0689747703230787 5 2583 2 321.5 1.174109700061395 +5 2725 1 306.25 1.0685532393228003 5 2725 2 193.5 1.4095901314659105 +5 3547 1 357.0 1.1544864737016736 5 3547 2 343.75 1.2077817108886129 +5 3785 1 215.5 1.231057632809026 5 3785 2 460.0 1.048938011267006 +5 4445 1 327.3333333333333 1.0177488158574015 5 4445 2 414.75 1.046288264177383 +5 4601 1 327.25 1.15815714609041 5 4601 2 142.66666666666666 1.2197537262761011 +5 5019 1 341.6666666666667 1.2014886661438384 5 5019 2 363.5 1.1056740335885162 +5 5635 1 275.75 1.003161317494043 5 5635 2 195.33333333333334 1.49437494371756 +5 5725 1 308.6666666666667 1.2494665767967896 5 5725 2 315.5 1.4329959977644893 +5 5787 1 335.75 1.3581868619406905 5 5787 2 453.5 1.031825110180606 +5 8665 1 257.75 1.8119629759287612 5 8665 2 368.0 1.0243808356311228 +5 9037 1 189.75 1.0334701022027994 5 9037 2 326.0 1.1188906978754734 +5 9241 1 342.75 1.037524616861255 5 9241 2 174.5 1.1953290244295067 +5 9245 1 339.5 1.0092696575112496 5 9245 2 303.0 1.2214283206597227 +5 9789 1 391.25 1.0458503093728178 5 9789 2 343.75 1.070040394695916 +5 10775 1 439.5 1.2565424257262654 5 10775 2 330.75 1.3194508007529422 +5 10851 1 296.25 1.4450973535233087 5 10851 2 185.75 1.0920078306591938 +5 11409 1 337.5 1.2675445661798022 5 11409 2 267.5 1.2735562175240271 +5 11543 1 373.75 1.1069130009236565 5 11543 2 347.0 1.0384881272212296 +5 11907 1 312.0 1.1200627653353177 5 11907 2 130.0 1.0970913669588425 +5 12315 1 255.75 1.118436212304132 5 12315 2 329.25 1.1943065884369533 +5 12589 1 372.75 1.1109412437666168 5 12589 2 355.75 1.0853990131935114 +5 12853 1 306.75 1.4054585232279222 5 12853 2 174.75 1.0143495332647992 +5 13001 1 420.3333333333333 1.0350551797504086 5 13001 2 214.0 1.115488847819715 +5 13399 1 304.75 1.1656588906680398 5 13399 2 359.5 1.0278593838157082 +5 13809 1 338.0 1.3356560129512516 5 13809 2 254.25 1.3229081483155771 +5 13997 1 372.75 1.0067987273536196 5 13997 2 488.5 1.0136437168469898 +5 14683 1 313.75 1.0038487229336792 5 14683 2 344.5 1.1175817890990485 +5 14721 1 420.0 1.0064164891633403 5 14721 2 280.5 1.0511776533295065 +5 14891 1 445.25 1.0918502542585706 5 14891 2 420.3333333333333 1.1234936159879627 +5 15261 1 514.0 1.0718025790789742 5 15261 2 367.25 1.015824493979522 +5 15477 1 225.0 1.1250854562879289 5 15477 2 235.75 1.0790388329037188 +5 15655 1 367.5 1.100326204582237 5 15655 2 306.3333333333333 1.0511442359018315 +5 15673 1 351.25 1.0192896453224356 5 15673 2 389.6666666666667 1.0824061270803669 +5 15959 1 414.0 1.0773325961138016 5 15959 2 237.25 1.4024256583845858 +5 17339 1 399.25 1.0240754930004161 5 17339 2 265.5 1.1851526004436805 +5 17581 1 426.0 1.2083890532953205 5 17581 2 233.25 1.1436871765942431 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q39b.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q39b.sql.out new file mode 100644 index 0000000000000..a250c0afd3d44 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q39b.sql.out @@ -0,0 +1,15 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +1 13157 1 260.5 1.5242630430075292 1 13157 2 413.5 1.0422561797285326 +1 15441 1 295.0 1.597573089984185 1 15441 2 296.0 1.534664092337063 +1 16895 1 197.25 1.6216484458744376 1 16895 2 201.33333333333334 1.001838963026182 +2 5915 1 231.25 1.8705235468767831 2 5915 2 407.0 1.0885509926353207 +2 11073 1 274.0 1.6770433716259476 2 11073 2 359.0 1.0133649606830526 +3 3315 1 271.75 1.555976998814345 3 3315 2 393.75 1.0196319345405949 +3 3393 1 260.0 1.5009563026568116 3 3393 2 470.25 1.129275872154205 +3 10427 1 241.33333333333334 1.5634035191786233 3 10427 2 381.25 1.0623056061004696 +4 16211 1 257.6666666666667 1.6381074811154002 4 16211 2 352.25 1.055236934125639 +5 8665 1 257.75 1.8119629759287612 5 8665 2 368.0 1.0243808356311228 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q4.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q4.sql.out new file mode 100644 index 0000000000000..a9706ef782fde --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q4.sql.out @@ -0,0 +1,7 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAMHOLAAAA Terri Cook N COSTA RICA NULL Terri.Cook@Vz02fJPUlPO.edu +AAAAAAAANBECBAAA Michael Lombardi Y ZIMBABWE NULL Michael.Lombardi@J.com diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q40.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q40.sql.out new file mode 100644 index 0000000000000..db2d76e5d019e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q40.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +TN AAAAAAAAAAEAAAAA 51.75 -61.82 +TN AAAAAAAAAANDAAAA 131.09 324.87 +TN AAAAAAAAAAPBAAAA 50.90 146.62 +TN AAAAAAAAACACAAAA 113.63 89.13 +TN AAAAAAAAACGCAAAA 53.39 37.02 +TN AAAAAAAAACKCAAAA 65.49 99.60 +TN AAAAAAAAACPCAAAA 0.00 73.18 +TN AAAAAAAAADACAAAA 132.24 0.00 +TN AAAAAAAAADBBAAAA 211.20 0.00 +TN AAAAAAAAADNAAAAA 202.46 0.00 +TN AAAAAAAAAEFCAAAA 45.57 38.18 +TN AAAAAAAAAEGEAAAA -19.57 109.62 +TN AAAAAAAAAELBAAAA 34.98 144.32 +TN AAAAAAAAAFBEAAAA 130.26 3.53 +TN AAAAAAAAAFFDAAAA 27.12 104.61 +TN AAAAAAAAAFJDAAAA -41.08 0.00 +TN AAAAAAAAAFLDAAAA 89.24 0.00 +TN AAAAAAAAAFODAAAA 16.39 0.00 +TN AAAAAAAAAGEBAAAA 146.51 20.38 +TN AAAAAAAAAGIDAAAA 2.84 0.00 +TN AAAAAAAAAGLDAAAA -40.82 75.88 +TN AAAAAAAAAGPCAAAA 136.76 190.61 +TN AAAAAAAAAHBAAAAA 66.92 219.76 +TN AAAAAAAAAHPBAAAA 148.73 -316.99 +TN AAAAAAAAAIADAAAA 230.28 132.32 +TN AAAAAAAAAIGDAAAA 190.52 0.00 +TN AAAAAAAAAINCAAAA 207.61 208.83 +TN AAAAAAAAAJHDAAAA -39.87 215.04 +TN AAAAAAAAAJIDAAAA -351.64 142.38 +TN AAAAAAAAAJOAAAAA 58.56 0.00 +TN AAAAAAAAAKABAAAA 110.04 0.00 +TN AAAAAAAAAKFEAAAA -284.41 91.42 +TN AAAAAAAAALAAAAAA -4.78 133.34 +TN AAAAAAAAALDCAAAA 39.16 0.00 +TN AAAAAAAAALFEAAAA 27.83 212.44 +TN AAAAAAAAALIDAAAA 0.00 118.88 +TN AAAAAAAAALOAAAAA 4.18 0.00 +TN AAAAAAAAALOBAAAA 0.00 0.00 +TN AAAAAAAAALPAAAAA -30.21 10.95 +TN AAAAAAAAAMJBAAAA -24.54 85.92 +TN AAAAAAAAANLCAAAA 84.38 67.38 +TN AAAAAAAAANPAAAAA 74.98 3.48 +TN AAAAAAAAANPDAAAA 484.43 90.58 +TN AAAAAAAAAOFAAAAA 0.00 91.90 +TN AAAAAAAAAOMDAAAA 188.82 29.34 +TN AAAAAAAAAPPBAAAA 0.00 146.30 +TN AAAAAAAABABCAAAA 252.04 27.49 +TN AAAAAAAABADAAAAA 27.80 35.00 +TN AAAAAAAABAGAAAAA 17.30 2.53 +TN AAAAAAAABCCCAAAA -254.31 0.00 +TN AAAAAAAABDCBAAAA 38.34 101.58 +TN AAAAAAAABECDAAAA 223.68 112.52 +TN AAAAAAAABEMCAAAA 0.00 160.01 +TN AAAAAAAABGECAAAA 0.00 224.53 +TN AAAAAAAABGIBAAAA 105.83 0.00 +TN AAAAAAAABGNCAAAA 0.00 72.03 +TN AAAAAAAABHACAAAA 0.00 0.00 +TN AAAAAAAABHPCAAAA 97.28 190.95 +TN AAAAAAAABJFEAAAA 70.68 38.07 +TN AAAAAAAABJMAAAAA 31.23 140.56 +TN AAAAAAAABKEBAAAA 133.61 92.51 +TN AAAAAAAABLBDAAAA 50.89 37.68 +TN AAAAAAAABLEDAAAA -119.59 0.00 +TN AAAAAAAABLOCAAAA 112.88 62.95 +TN AAAAAAAABMCBAAAA 16.30 70.83 +TN AAAAAAAABMOBAAAA 54.02 130.38 +TN AAAAAAAABNEBAAAA 48.98 -803.52 +TN AAAAAAAABOKDAAAA 0.00 135.88 +TN AAAAAAAABONAAAAA 30.07 213.69 +TN AAAAAAAABPPAAAAA 4.77 91.54 +TN AAAAAAAACACEAAAA 244.10 0.00 +TN AAAAAAAACALAAAAA -832.53 0.00 +TN AAAAAAAACALBAAAA 0.00 -641.98 +TN AAAAAAAACBDBAAAA 45.72 145.13 +TN AAAAAAAACBHBAAAA 102.42 0.00 +TN AAAAAAAACBICAAAA 0.95 85.93 +TN AAAAAAAACBJCAAAA 89.33 143.00 +TN AAAAAAAACBNAAAAA 198.92 133.15 +TN AAAAAAAACCABAAAA 61.26 65.34 +TN AAAAAAAACCJBAAAA 4.84 0.00 +TN AAAAAAAACCPDAAAA 280.66 283.09 +TN AAAAAAAACDECAAAA -667.40 -693.66 +TN AAAAAAAACDIBAAAA 3.73 148.26 +TN AAAAAAAACEACAAAA 0.00 -978.31 +TN AAAAAAAACEHDAAAA 66.23 123.74 +TN AAAAAAAACEICAAAA 30.14 117.63 +TN AAAAAAAACEODAAAA 0.00 1.28 +TN AAAAAAAACFKDAAAA 0.00 325.59 +TN AAAAAAAACFLCAAAA 13.34 76.65 +TN AAAAAAAACGCBAAAA -1636.68 167.66 +TN AAAAAAAACGCDAAAA 0.00 8.58 +TN AAAAAAAACGJDAAAA -422.98 490.30 +TN AAAAAAAACGMAAAAA 142.04 196.75 +TN AAAAAAAACHCDAAAA -936.02 96.99 +TN AAAAAAAACIICAAAA -175.56 40.39 +TN AAAAAAAACIJBAAAA 0.00 16.71 +TN AAAAAAAACIMDAAAA 266.31 0.00 +TN AAAAAAAACJBEAAAA -5.33 22.57 +TN AAAAAAAACJDDAAAA 72.37 0.00 +TN AAAAAAAACJGCAAAA 4.59 237.09 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q41.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q41.sql.out new file mode 100644 index 0000000000000..aaaa39f72f03a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q41.sql.out @@ -0,0 +1,10 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +antieingeseableought +eingeseeseese +eseeingeseableought +oughtoughtablecally +priantin stoughtought diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q42.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q42.sql.out new file mode 100644 index 0000000000000..1b17f237b3d06 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q42.sql.out @@ -0,0 +1,16 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +2000 7 Home 494603.64 +2000 2 Men 390852.57 +2000 4 Shoes 378230.23 +2000 3 Children 359411.01 +2000 9 Books 319480.51 +2000 10 Electronics 317086.16 +2000 8 Sports 287853.86 +2000 6 Jewelry 278786.18 +2000 1 Women 245897.86 +2000 5 Music 189405.76 +2000 NULL NULL 39507.19 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q43.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q43.sql.out new file mode 100644 index 0000000000000..38e7f9316f5c0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q43.sql.out @@ -0,0 +1,11 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +able AAAAAAAACAAAAAAA 495537.85 454457.37 480383.13 468495.25 496050.12 471996.47 510311.54 +ation AAAAAAAAHAAAAAAA 485290.49 465106.17 462449.17 478799.15 521647.09 474980.87 484757.85 +bar AAAAAAAAKAAAAAAA 510374.60 458247.16 464054.12 473015.97 487045.12 495531.52 502011.00 +eing AAAAAAAAIAAAAAAA 513799.80 464451.67 440681.32 501857.36 476201.82 452754.56 481703.98 +ese AAAAAAAAEAAAAAAA 529524.71 460191.13 492178.33 458067.77 488508.48 477658.66 490178.23 +ought AAAAAAAABAAAAAAA 464514.26 460448.28 465249.85 482655.67 474754.90 479860.76 474064.44 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q44.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q44.sql.out new file mode 100644 index 0000000000000..959a3fe521152 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q44.sql.out @@ -0,0 +1,15 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +1 oughtantiought eingbarantiationought +2 barprin steing callyableationpri +3 ableoughtantipriought ablebarcallypriought +4 oughtcallyoughtation callyn steseable +5 oughteseesecally ableoughtbarn st +6 eingationationanti callyableoughtn st +7 ablecallyought barbarcallyableought +8 n steingprieseought eseeingationeseought +9 priprieinganti bareseprieseought +10 oughtcallybaroughtought eingcallyantipri diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q45.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q45.sql.out new file mode 100644 index 0000000000000..c807bbb5771ed --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q45.sql.out @@ -0,0 +1,25 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +12150 Montezuma 11.23 +20525 Ryan 57.27 +21087 Macedonia 23.20 +21933 Mount Pleasant 51.15 +22924 Belleville 25.42 +24289 NULL 17.89 +26098 Five Points 27.24 +45281 Bethel 113.11 +48014 Clifton 20.69 +48828 Greenwood 58.48 +50411 Cedar Grove 70.45 +51933 Mount Pleasant 23.43 +54536 Friendship 123.37 +58605 Antioch 95.49 +65817 Bridgeport 47.98 +65867 Riceville 11.06 +69843 Oakland 11.82 +71944 Gravel Hill 23.40 +76971 Wilson 111.77 +78048 Salem 188.36 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q46.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q46.sql.out new file mode 100644 index 0000000000000..b9f5ef0471ae9 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q46.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL Antioch Florence 19942 6675.56 -20224.05 +NULL NULL Antioch Jamestown 189909 188.04 4440.84 +NULL NULL Antioch Sulphur Springs 211628 0.00 1690.47 +NULL NULL Arlington Leesburg 112878 1749.37 -4137.65 +NULL NULL Arlington Mount Olive 186130 3625.05 -9174.03 +NULL NULL Arthur Bridgeport 89194 1207.33 -3747.04 +NULL NULL Ashland Antioch 25749 1184.60 -22285.21 +NULL NULL Ashland Cherry Valley 92172 2534.66 -5553.97 +NULL NULL Ashland Superior 91601 7305.88 -10487.66 +NULL NULL Belmont Hamilton 1029 935.93 -1026.72 +NULL NULL Bethel Oakwood 179326 2593.05 -13662.26 +NULL NULL Bethel Woodland 95034 407.35 -15767.89 +NULL NULL Bridgeport Riverside 23264 89.15 -6827.82 +NULL NULL Bridgeport Wildwood 90648 4796.33 -6445.14 +NULL NULL Brownsville Oak Grove 114024 2720.05 -18657.62 +NULL NULL Brunswick Valley View 153419 0.00 -13840.52 +NULL NULL Buena Vista Clearview 109316 257.04 -11539.44 +NULL NULL Buena Vista Deerfield 17940 0.00 -1431.61 +NULL NULL Bunker Hill Colfax 45044 2803.00 2310.74 +NULL NULL Cedar Grove Brownsville 17159 865.78 -9843.40 +NULL NULL Centerville Fairfield 11688 604.66 -7431.13 +NULL NULL Centerville Fisher 24700 330.27 -8639.65 +NULL NULL Centerville Glenwood 27267 0.00 -7024.69 +NULL NULL Clifton Springhill 190087 2987.19 -13925.26 +NULL NULL Clinton Edgewood 84531 8561.97 -28472.50 +NULL NULL Clinton Oakland 179459 879.23 -875.68 +NULL NULL Concord Lakewood 81197 1244.92 866.30 +NULL NULL Crossroads Mount Olive 229868 223.72 139.81 +NULL NULL Ellsworth Shiloh 103474 1412.84 -8861.07 +NULL NULL Enterprise Five Forks 234468 2248.50 -7218.60 +NULL NULL Enterprise Hillcrest 216432 529.37 -2245.35 +NULL NULL Fairfield Arlington 75875 565.09 -14322.52 +NULL NULL Fairview Friendship 172926 1897.88 -11040.49 +NULL NULL Fairview Mount Olive 127246 7793.58 -12492.10 +NULL NULL Farmington Springfield 222902 1213.28 -1240.73 +NULL NULL Fayette Kingston 32825 0.00 -6315.77 +NULL NULL Ferguson Belmont 238393 11864.37 -26448.01 +NULL NULL Five Forks Florence 224673 1507.52 -1549.30 +NULL NULL Five Forks Newport 131275 3957.94 -8960.42 +NULL NULL Five Points Brownsville 122401 166.11 -12890.14 +NULL NULL Five Points Shady Grove 127068 41.49 -3127.13 +NULL NULL Five Points Union 233626 243.82 -13369.20 +NULL NULL Florence Deerfield 181713 2673.95 -11875.68 +NULL NULL Forest Hills Shiloh 76517 2206.26 -20795.18 +NULL NULL Friendship Hamilton 49257 2542.47 14.28 +NULL NULL Friendship Lebanon 230509 7322.26 -3897.95 +NULL NULL Friendship Springdale 55155 187.12 -8555.50 +NULL NULL Glendale Liberty 127860 179.92 -9645.97 +NULL NULL Glendale Springfield 107410 236.04 -11521.38 +NULL NULL Glendale Stringtown 31383 0.00 -5195.83 +NULL NULL Glendale Union 3484 793.55 5358.57 +NULL NULL Glenwood Arlington 227159 236.19 -10529.52 +NULL NULL Glenwood Belmont 72581 1808.15 -7585.34 +NULL NULL Gravel Hill Farmington 62500 0.00 -1479.92 +NULL NULL Greenville Bethel 84058 225.62 -1544.42 +NULL NULL Greenville Marion 221320 669.39 -7120.33 +NULL NULL Greenville Spring Hill 47915 11384.61 -24018.75 +NULL NULL Greenwood Pleasant Hill 4709 822.69 -17295.72 +NULL NULL Greenwood Springdale 204972 263.33 3302.02 +NULL NULL Hamilton Cedar Grove 130494 0.00 -10426.22 +NULL NULL Hamilton Jackson 170132 5140.01 -20602.97 +NULL NULL Hamilton Jamestown 153509 2156.76 -9529.97 +NULL NULL Hardy Harmony 94856 6219.17 -11811.92 +NULL NULL Harmony Plainview 226229 9483.18 -21260.39 +NULL NULL Highland Park Clinton 75671 818.52 -17086.12 +NULL NULL Hillcrest Arlington 131958 608.34 -10931.94 +NULL NULL Hillcrest Berea 60399 764.60 -10177.35 +NULL NULL Hillcrest Harmony 196512 1.70 -9338.87 +NULL NULL Hillcrest Mount Olive 129867 7792.52 -10929.36 +NULL NULL Hillcrest Wilson 33115 4120.87 -17407.74 +NULL NULL Indian Village Golden 98530 284.90 -11785.95 +NULL NULL Jackson Florence 167217 254.54 -18883.41 +NULL NULL Jackson Pleasant Grove 172765 5569.64 -7776.84 +NULL NULL Jamestown Spring Valley 125125 4067.22 -8344.61 +NULL NULL Kingston Farmington 196244 0.00 -4449.03 +NULL NULL Kingston Highland 45785 5257.12 -21282.22 +NULL NULL Lakeside Ashley 233189 1043.83 -3335.36 +NULL NULL Lakeside Highland Park 194552 677.94 -11488.01 +NULL NULL Lakeside Jenkins 71469 434.92 -9825.80 +NULL NULL Lakeside Lakewood 181131 42.20 3148.24 +NULL NULL Lakeside Riverview 183085 116.06 -1892.62 +NULL NULL Lakeside Summit 200887 554.47 -8140.32 +NULL NULL Lakeview Greenfield 230719 0.00 -3529.16 +NULL NULL Lancaster Waterloo 197637 976.52 -11255.13 +NULL NULL Langdon Buena Vista 12247 1626.56 -12689.74 +NULL NULL Lebanon Mount Zion 2701 11616.00 -11748.63 +NULL NULL Lincoln Greenville 126303 0.00 -18688.05 +NULL NULL Louisville Kingston 215207 986.85 -9348.55 +NULL NULL Macedonia Ashland 81673 142.17 -56.02 +NULL NULL Macedonia Guthrie 132070 1459.41 -9746.92 +NULL NULL Maple Grove Five Points 40712 4051.76 -4016.52 +NULL NULL Marion Lakewood 203438 8203.21 -18846.98 +NULL NULL Midway Summerfield 117504 1027.47 -21021.42 +NULL NULL Mount Olive Salem 34593 910.10 -6410.67 +NULL NULL Mount Olive Springdale 73957 2276.08 -18160.48 +NULL NULL Mount Vernon Crossroads 216545 0.00 -10080.14 +NULL NULL Mount Vernon White Oak 25937 2221.06 -12575.90 +NULL NULL Murphy Buena Vista 17149 0.00 -39.90 +NULL NULL New Hope Farmington 38760 6931.68 -10392.42 +NULL NULL New Hope Hillcrest 119378 625.62 -15891.66 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q47.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q47.sql.out new file mode 100644 index 0000000000000..5cd532e0008c8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q47.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +Shoes exportiedu pack #x ation Unknown 1999 3 5607.487500 2197.48 3271.66 2831.67 +Shoes exportiedu pack #x ought Unknown 1999 2 5643.938333 2393.31 4463.11 2652.44 +Shoes exportiedu pack #x able Unknown 1999 4 5640.362500 2416.57 3348.90 2987.78 +Men amalgimporto #x ought Unknown 1999 6 4702.116667 1534.95 2666.37 2514.13 +Men edu packimporto #x eing Unknown 1999 7 5330.618333 2218.63 3182.74 7436.83 +Shoes exportiedu pack #x ese Unknown 1999 4 5338.852500 2233.60 3470.43 2832.41 +Music exportischolar #x ese Unknown 1999 5 5139.465000 2034.96 3149.72 3648.17 +Men exportiimporto #x eing Unknown 1999 7 5748.707500 2645.88 3432.67 7646.91 +Men importoimporto #x bar Unknown 1999 3 4915.190000 1815.92 2884.81 2956.00 +Women amalgamalg #x ation Unknown 1999 6 4586.300000 1508.07 2992.12 3059.37 +Shoes exportiedu pack #x eing Unknown 1999 4 5374.032500 2322.80 2484.06 3313.69 +Men importoimporto #x ese Unknown 1999 6 4596.057500 1577.69 2457.43 2439.68 +Men edu packimporto #x ation Unknown 1999 3 5839.670833 2825.07 3157.46 3531.36 +Men edu packimporto #x able Unknown 1999 4 5342.149167 2347.82 2787.31 3588.16 +Shoes exportiedu pack #x ought Unknown 1999 3 5643.938333 2652.44 2393.31 3008.88 +Men exportiimporto #x ought Unknown 1999 3 5475.719167 2515.22 2709.11 2702.85 +Shoes exportiedu pack #x ese Unknown 1999 6 5338.852500 2388.17 2832.41 4216.10 +Shoes exportiedu pack #x bar Unknown 1999 2 5065.706667 2119.85 3439.05 2640.59 +Shoes amalgedu pack #x ation Unknown 1999 2 4713.009167 1774.19 3366.21 1940.05 +Shoes exportiedu pack #x eing Unknown 1999 3 5374.032500 2484.06 2994.92 2322.80 +Men edu packimporto #x able Unknown 1999 7 5342.149167 2454.72 2766.42 7665.06 +Men amalgimporto #x ese Unknown 1999 4 4741.993333 1879.47 3419.59 2634.29 +Music exportischolar #x able Unknown 1999 4 4723.742500 1866.30 2384.82 2931.55 +Shoes importoedu pack #x ation Unknown 1999 4 4732.205000 1875.08 2686.46 3422.03 +Children importoexporti #x ese Unknown 1999 6 4849.967500 2002.59 2590.23 3380.67 +Men importoimporto #x ation Unknown 1999 6 4920.419167 2077.36 3402.55 3347.44 +Men importoimporto #x ese Unknown 1999 4 4596.057500 1762.17 2728.14 2457.43 +Children edu packexporti #x eing Unknown 1999 4 4739.001667 1923.04 2309.91 2849.64 +Music exportischolar #x ought Unknown 1999 3 4816.848333 2010.47 2539.57 2940.38 +Shoes edu packedu pack #x ese Unknown 1999 2 4707.697500 1903.70 2693.49 3474.34 +Shoes importoedu pack #x ought Unknown 1999 2 4443.995833 1642.32 3972.50 2319.04 +Men edu packimporto #x ation Unknown 1999 6 5839.670833 3053.78 3151.27 3622.65 +Shoes exportiedu pack #x ation Unknown 1999 4 5607.487500 2831.67 2197.48 4187.54 +Men edu packimporto #x ought Unknown 1999 3 5598.894167 2824.13 3154.80 3135.60 +Shoes amalgedu pack #x ation Unknown 1999 3 4713.009167 1940.05 1774.19 2496.18 +Men exportiimporto #x ought Unknown 1999 4 5475.719167 2702.85 2515.22 4364.56 +Shoes amalgedu pack #x ese Unknown 1999 4 4596.537500 1825.00 2777.56 3234.34 +Music importoscholar #x able Unknown 1999 6 4332.550833 1563.26 2484.37 2460.11 +Men edu packimporto #x ese Unknown 1999 2 5102.436667 2333.32 3417.85 2536.68 +Men exportiimporto #x ought Unknown 1999 2 5475.719167 2709.11 4740.72 2515.22 +Men exportiimporto #x ought Unknown 1999 6 5475.719167 2723.08 4364.56 4000.42 +Shoes exportiedu pack #x ese Unknown 1999 2 5338.852500 2587.72 3837.18 3470.43 +Children exportiexporti #x eing Unknown 1999 6 4426.704167 1683.86 2186.50 1970.76 +Shoes exportiedu pack #x ought Unknown 1999 6 5643.938333 2902.72 3046.01 3994.18 +Shoes exportiedu pack #x eing Unknown 1999 6 5374.032500 2637.31 3313.69 3158.65 +Men importoimporto #x ation Unknown 1999 3 4920.419167 2183.89 3598.63 2841.78 +Men edu packimporto #x eing Unknown 1999 3 5330.618333 2602.65 2613.45 2624.00 +Women edu packamalg #x eing Unknown 1999 6 4366.627500 1640.10 3159.43 2882.91 +Music exportischolar #x ese Unknown 1999 2 5139.465000 2413.63 4627.89 2773.28 +Men exportiimporto #x ese Unknown 1999 2 4929.611667 2207.89 3940.06 2246.76 +Women edu packamalg #x ese Unknown 1999 2 4551.444167 1833.08 3729.30 2940.96 +Men edu packimporto #x eing Unknown 1999 2 5330.618333 2613.45 3859.71 2602.65 +Children edu packexporti #x ese Unknown 1999 2 4640.935833 1927.95 3524.16 2584.03 +Children exportiexporti #x ese Unknown 1999 7 4565.828333 1853.57 2846.40 6447.36 +Women edu packamalg #x ese Unknown 1999 6 4551.444167 1840.98 2478.75 3174.74 +Men edu packimporto #x eing Unknown 1999 4 5330.618333 2624.00 2602.65 3722.18 +Children importoexporti #x able Unknown 1999 3 5024.325000 2319.29 2691.31 2350.53 +Children edu packexporti #x ought Unknown 1999 2 4836.831667 2132.80 3984.13 2182.12 +Children edu packexporti #x ese Unknown 1999 4 4640.935833 1950.03 2584.03 2919.51 +Shoes importoedu pack #x bar Unknown 1999 3 4791.740833 2100.87 2211.40 3278.75 +Men edu packimporto #x ation Unknown 1999 5 5839.670833 3151.27 3531.36 3053.78 +Men exportiimporto #x ese Unknown 1999 3 4929.611667 2246.76 2207.89 3208.14 +Men edu packimporto #x ation Unknown 1999 2 5839.670833 3157.46 3425.68 2825.07 +Men exportiimporto #x bar Unknown 1999 5 5311.965833 2631.11 2819.12 3022.54 +Music importoscholar #x ation Unknown 1999 2 4388.770833 1714.25 2228.69 2407.93 +Shoes importoedu pack #x ese Unknown 1999 2 4989.784167 2315.46 4430.70 2976.26 +Children importoexporti #x able Unknown 1999 4 5024.325000 2350.53 2319.29 2984.92 +Women amalgamalg #x ation Unknown 1999 3 4586.300000 1917.37 3282.12 2557.46 +Children edu packexporti #x ought Unknown 1999 3 4836.831667 2182.12 2132.80 3466.25 +Shoes exportiedu pack #x able Unknown 1999 5 5640.362500 2987.78 2416.57 3437.87 +Men importoimporto #x ought Unknown 1999 4 5071.261667 2425.64 2696.60 2641.17 +Shoes importoedu pack #x ought Unknown 1999 6 4443.995833 1801.87 2297.76 3078.40 +Children importoexporti #x ought Unknown 1999 2 4480.353333 1838.88 3250.53 2375.04 +Men edu packimporto #x ese Unknown 1999 7 5102.436667 2464.06 2798.80 6978.09 +Shoes exportiedu pack #x ought Unknown 1999 4 5643.938333 3008.88 2652.44 3046.01 +Men importoimporto #x ought Unknown 1999 2 5071.261667 2438.50 4282.24 2696.60 +Children edu packexporti #x ation Unknown 1999 6 4525.318333 1896.34 2883.95 2727.36 +Children amalgexporti #x ese Unknown 1999 4 4212.889167 1588.72 2296.49 3077.12 +Shoes importoedu pack #x eing Unknown 1999 4 4884.260000 2261.01 2502.36 3210.47 +Men exportiimporto #x eing Unknown 1999 3 5748.707500 3132.90 3747.34 3768.23 +Shoes exportiedu pack #x able Unknown 1999 2 5640.362500 3027.85 4285.15 3348.90 +Music edu packscholar #x ought Unknown 1999 3 4490.221667 1883.06 2321.31 2211.82 +Children exportiexporti #x able Unknown 1999 2 4423.506667 1816.43 3192.19 3334.11 +Music amalgscholar #x eing Unknown 1999 6 4894.035000 2288.21 3156.77 2845.45 +Music amalgscholar #x able Unknown 1999 5 4829.768333 2225.46 3380.94 2782.42 +Women edu packamalg #x ation Unknown 1999 3 4268.562500 1665.68 1758.65 2082.99 +Children exportiexporti #x bar Unknown 1999 3 4267.374167 1667.03 2579.77 2802.05 +Men exportiimporto #x able Unknown 1999 3 4987.821667 2387.78 2962.40 2928.83 +Women importoamalg #x bar Unknown 1999 3 4309.575833 1710.42 2004.22 2742.41 +Shoes exportiedu pack #x ought Unknown 1999 5 5643.938333 3046.01 3008.88 2902.72 +Music exportischolar #x bar Unknown 1999 4 4518.543333 1922.23 2683.26 2227.02 +Children amalgexporti #x bar Unknown 1999 3 4441.555000 1846.53 3827.47 3623.30 +Men exportiimporto #x eing Unknown 1999 5 5748.707500 3156.57 3768.23 3432.67 +Music importoscholar #x ese Unknown 1999 2 4302.831667 1712.70 3561.46 2414.41 +Women amalgamalg #x eing Unknown 1999 7 4494.382500 1904.98 2308.58 5603.14 +Women amalgamalg #x able Unknown 1999 4 4582.713333 1994.71 2408.40 2321.48 +Music edu packscholar #x able Unknown 1999 3 4426.623333 1840.51 2707.80 3147.10 +Shoes importoedu pack #x bar Unknown 1999 2 4791.740833 2211.40 3912.90 2100.87 +Shoes exportiedu pack #x able Unknown 1999 7 5640.362500 3062.31 3437.87 6376.30 +Children amalgexporti #x eing Unknown 1999 3 4733.152500 2155.79 2710.50 2685.74 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q48.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q48.sql.out new file mode 100644 index 0000000000000..c7fa3497c93f8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q48.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +28312 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q49.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q49.sql.out new file mode 100644 index 0000000000000..a1933e05565ca --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q49.sql.out @@ -0,0 +1,37 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +catalog 16735 0.50505050505050505051 1 1 +catalog 12633 0.69662921348314606742 2 2 +catalog 13967 0.70000000000000000000 3 3 +catalog 12819 0.70129870129870129870 4 8 +catalog 16155 0.72043010752688172043 5 4 +catalog 17681 0.75268817204301075269 6 5 +catalog 5975 0.76404494382022471910 7 6 +catalog 11451 0.76744186046511627907 8 7 +catalog 1689 0.80219780219780219780 9 9 +catalog 10311 0.81818181818181818182 10 10 +store 5111 0.78947368421052631579 1 1 +store 11073 0.83505154639175257732 2 3 +store 14429 0.84782608695652173913 3 2 +store 15927 0.86419753086419753086 4 4 +store 10171 0.86868686868686868687 5 5 +store 12783 0.88775510204081632653 6 6 +store 11075 0.89743589743589743590 7 7 +store 12889 0.95652173913043478261 8 8 +store 1939 0.99000000000000000000 9 9 +store 12975 1.00000000000000000000 10 10 +store 10455 1.00000000000000000000 10 10 +store 4333 1.00000000000000000000 10 10 +web 10485 0.48863636363636363636 1 1 +web 4483 0.52688172043010752688 2 2 +web 8833 0.58241758241758241758 3 3 +web 1165 0.61458333333333333333 4 4 +web 17197 0.73076923076923076923 5 5 +web 10319 0.73469387755102040816 6 6 +web 13159 0.75257731958762886598 7 7 +web 9629 0.77894736842105263158 8 8 +web 5909 0.78378378378378378378 9 9 +web 7057 0.86746987951807228916 10 10 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q5.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q5.sql.out new file mode 100644 index 0000000000000..0f752c2136fa6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q5.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL 113832751.85 3036754.81 -31846972.27 +catalog channel NULL 39549896.80 890805.91 -4700833.96 +catalog channel catalog_pageAAAAAAAAAAABAAAA 217002.51 0.00 13655.90 +catalog channel catalog_pageAAAAAAAAABABAAAA 79307.07 0.00 -3323.53 +catalog channel catalog_pageAAAAAAAAACABAAAA 109295.76 3505.20 8275.32 +catalog channel catalog_pageAAAAAAAAACJAAAAA 0.00 14.82 -113.03 +catalog channel catalog_pageAAAAAAAAADABAAAA 112264.38 0.00 -11845.75 +catalog channel catalog_pageAAAAAAAAADCBAAAA 111462.44 0.00 2684.17 +catalog channel catalog_pageAAAAAAAAAEABAAAA 60875.92 753.55 991.75 +catalog channel catalog_pageAAAAAAAAAECBAAAA 89060.07 0.00 7186.17 +catalog channel catalog_pageAAAAAAAAAEPAAAAA 0.00 2466.17 -1023.59 +catalog channel catalog_pageAAAAAAAAAFABAAAA 42313.54 0.00 -25310.58 +catalog channel catalog_pageAAAAAAAAAFCBAAAA 74908.61 0.00 -10384.86 +catalog channel catalog_pageAAAAAAAAAFPAAAAA 0.00 523.37 -422.16 +catalog channel catalog_pageAAAAAAAAAGABAAAA 120028.56 0.00 4694.80 +catalog channel catalog_pageAAAAAAAAAGBBAAAA 0.00 541.44 -170.28 +catalog channel catalog_pageAAAAAAAAAGCBAAAA 97228.89 0.00 -7579.73 +catalog channel catalog_pageAAAAAAAAAGPAAAAA 0.00 1814.55 -667.34 +catalog channel catalog_pageAAAAAAAAAHABAAAA 69941.58 0.00 -4444.41 +catalog channel catalog_pageAAAAAAAAAHBBAAAA 0.00 138.66 -128.30 +catalog channel catalog_pageAAAAAAAAAHCBAAAA 73967.17 0.00 -5904.39 +catalog channel catalog_pageAAAAAAAAAHPAAAAA 0.00 10125.01 -3291.39 +catalog channel catalog_pageAAAAAAAAAICBAAAA 95341.98 0.00 -10935.38 +catalog channel catalog_pageAAAAAAAAAIMAAAAA 0.00 247.30 -261.67 +catalog channel catalog_pageAAAAAAAAAJCBAAAA 91289.86 0.00 -38131.57 +catalog channel catalog_pageAAAAAAAAAJPAAAAA 0.00 19.98 -102.55 +catalog channel catalog_pageAAAAAAAAAKABAAAA 0.00 3460.18 -1790.30 +catalog channel catalog_pageAAAAAAAAAKCBAAAA 1409.22 0.00 -2367.32 +catalog channel catalog_pageAAAAAAAAAKPAAAAA 176800.33 2203.74 17358.83 +catalog channel catalog_pageAAAAAAAAALBBAAAA 0.00 1719.45 -223.86 +catalog channel catalog_pageAAAAAAAAALCBAAAA 9622.11 0.00 -995.37 +catalog channel catalog_pageAAAAAAAAALPAAAAA 226923.74 0.00 -17678.34 +catalog channel catalog_pageAAAAAAAAAMCBAAAA 1044.59 0.00 -371.42 +catalog channel catalog_pageAAAAAAAAAMPAAAAA 210026.33 0.00 -4598.43 +catalog channel catalog_pageAAAAAAAAANABAAAA 0.00 4859.01 -620.39 +catalog channel catalog_pageAAAAAAAAANPAAAAA 204079.30 6617.69 -43707.08 +catalog channel catalog_pageAAAAAAAAAOCBAAAA 3093.75 0.00 -3029.40 +catalog channel catalog_pageAAAAAAAAAOPAAAAA 205664.00 5.35 -7249.23 +catalog channel catalog_pageAAAAAAAAAPCBAAAA 11986.70 0.00 5352.16 +catalog channel catalog_pageAAAAAAAAAPPAAAAA 259979.15 0.00 15500.93 +catalog channel catalog_pageAAAAAAAABAABAAAA 205054.92 0.00 -13900.72 +catalog channel catalog_pageAAAAAAAABBABAAAA 123870.49 817.57 -35169.40 +catalog channel catalog_pageAAAAAAAABCABAAAA 110311.76 6.60 -2807.92 +catalog channel catalog_pageAAAAAAAABDABAAAA 54375.62 0.00 -16298.08 +catalog channel catalog_pageAAAAAAAABDCBAAAA 77225.26 0.00 -9404.24 +catalog channel catalog_pageAAAAAAAABDIAAAAA 0.00 2247.56 -536.43 +catalog channel catalog_pageAAAAAAAABDPAAAAA 0.00 13366.54 -4827.89 +catalog channel catalog_pageAAAAAAAABEABAAAA 83653.23 301.44 -14544.63 +catalog channel catalog_pageAAAAAAAABECBAAAA 102256.79 0.00 2795.53 +catalog channel catalog_pageAAAAAAAABEPAAAAA 0.00 4374.58 -3395.35 +catalog channel catalog_pageAAAAAAAABFABAAAA 77015.36 0.00 -4370.15 +catalog channel catalog_pageAAAAAAAABFBBAAAA 0.00 2435.93 -3450.68 +catalog channel catalog_pageAAAAAAAABFCBAAAA 105831.18 0.00 12908.55 +catalog channel catalog_pageAAAAAAAABFPAAAAA 0.00 203.00 -162.37 +catalog channel catalog_pageAAAAAAAABGABAAAA 72193.84 0.00 -10412.85 +catalog channel catalog_pageAAAAAAAABGCBAAAA 98074.44 0.00 -1396.21 +catalog channel catalog_pageAAAAAAAABGIAAAAA 0.00 500.56 -315.89 +catalog channel catalog_pageAAAAAAAABGPAAAAA 0.00 257.80 -125.00 +catalog channel catalog_pageAAAAAAAABHABAAAA 109670.37 0.00 17680.12 +catalog channel catalog_pageAAAAAAAABHBBAAAA 0.00 332.44 -218.41 +catalog channel catalog_pageAAAAAAAABHCBAAAA 73731.28 0.00 -14352.31 +catalog channel catalog_pageAAAAAAAABHPAAAAA 0.00 1366.24 -3867.70 +catalog channel catalog_pageAAAAAAAABICBAAAA 71039.47 0.00 2742.64 +catalog channel catalog_pageAAAAAAAABIPAAAAA 0.00 14223.07 -7591.98 +catalog channel catalog_pageAAAAAAAABJBBAAAA 0.00 96.66 -140.68 +catalog channel catalog_pageAAAAAAAABJCBAAAA 5619.24 0.00 -2531.23 +catalog channel catalog_pageAAAAAAAABJPAAAAA 0.00 3881.66 -2212.48 +catalog channel catalog_pageAAAAAAAABKCBAAAA 5420.99 0.00 -5691.26 +catalog channel catalog_pageAAAAAAAABKPAAAAA 161336.55 0.00 -513.02 +catalog channel catalog_pageAAAAAAAABLBBAAAA 0.00 303.27 -173.59 +catalog channel catalog_pageAAAAAAAABLCBAAAA 201.70 0.00 -393.37 +catalog channel catalog_pageAAAAAAAABLPAAAAA 162028.76 54.34 -54551.60 +catalog channel catalog_pageAAAAAAAABMABAAAA 0.00 163.32 -383.25 +catalog channel catalog_pageAAAAAAAABMBBAAAA 0.00 483.00 -4825.77 +catalog channel catalog_pageAAAAAAAABMCBAAAA 2213.59 0.00 -212.78 +catalog channel catalog_pageAAAAAAAABMPAAAAA 140634.77 138.84 -39261.21 +catalog channel catalog_pageAAAAAAAABNABAAAA 0.00 NULL NULL +catalog channel catalog_pageAAAAAAAABNBBAAAA 0.00 2152.88 -910.95 +catalog channel catalog_pageAAAAAAAABNCBAAAA 21066.23 0.00 5619.74 +catalog channel catalog_pageAAAAAAAABNPAAAAA 168937.50 0.00 -7428.35 +catalog channel catalog_pageAAAAAAAABOABAAAA 0.00 756.28 -521.22 +catalog channel catalog_pageAAAAAAAABOBBAAAA 0.00 289.38 -262.27 +catalog channel catalog_pageAAAAAAAABOCBAAAA 3380.37 0.00 337.45 +catalog channel catalog_pageAAAAAAAABOIAAAAA 0.00 553.08 -124.33 +catalog channel catalog_pageAAAAAAAABOPAAAAA 178060.89 453.33 -39647.59 +catalog channel catalog_pageAAAAAAAABPCBAAAA 308.43 0.00 -6294.87 +catalog channel catalog_pageAAAAAAAABPPAAAAA 230886.45 423.60 -7979.91 +catalog channel catalog_pageAAAAAAAACAABAAAA 143217.90 4739.60 -14933.90 +catalog channel catalog_pageAAAAAAAACABBAAAA 0.00 2902.35 -421.56 +catalog channel catalog_pageAAAAAAAACACBAAAA 0.00 275.93 -770.61 +catalog channel catalog_pageAAAAAAAACBABAAAA 82856.21 0.00 -33285.95 +catalog channel catalog_pageAAAAAAAACCABAAAA 87477.08 0.00 818.09 +catalog channel catalog_pageAAAAAAAACDABAAAA 83602.86 0.00 -33313.03 +catalog channel catalog_pageAAAAAAAACDCBAAAA 58195.74 0.00 -16518.32 +catalog channel catalog_pageAAAAAAAACDPAAAAA 0.00 317.65 -658.75 +catalog channel catalog_pageAAAAAAAACEABAAAA 51882.61 0.00 -18201.87 +catalog channel catalog_pageAAAAAAAACECBAAAA 87686.10 0.00 4983.58 +catalog channel catalog_pageAAAAAAAACEPAAAAA 0.00 9419.81 -3490.18 +catalog channel catalog_pageAAAAAAAACFABAAAA 100092.31 0.00 2640.22 +catalog channel catalog_pageAAAAAAAACFCBAAAA 82085.45 0.00 -6014.66 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q50.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q50.sql.out new file mode 100644 index 0000000000000..b1f112afefd8a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q50.sql.out @@ -0,0 +1,11 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct120 days :bigint> +-- !query output +able 1 666 Cedar Spruce Avenue Suite 10 Midway Williamson County TN 31904 78 53 68 63 103 +ation 1 405 3rd Wy Suite 220 Fairview Williamson County TN 35709 71 65 63 43 97 +bar 1 71 Cedar Blvd Suite B Midway Williamson County TN 31904 79 54 43 67 115 +eing 1 914 Lake 11th Road Suite T Midway Williamson County TN 31904 82 45 56 49 105 +ese 1 120 6th Lane Suite B Midway Williamson County TN 31904 63 52 68 43 108 +ought 1 32 3rd Street Suite 220 Midway Williamson County TN 31904 75 63 51 51 99 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q51.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q51.sql.out new file mode 100644 index 0000000000000..a342736812723 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q51.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +8 2000-01-16 NULL 20.83 35.36 20.83 +8 2000-01-18 83.21 NULL 83.21 20.83 +8 2000-02-11 NULL 69.88 83.21 69.88 +14 2000-01-14 NULL 31.65 183.58 31.65 +14 2000-01-29 NULL 63.92 183.58 63.92 +14 2000-02-10 NULL 103.12 183.58 103.12 +14 2000-02-15 NULL 157.03 183.58 157.03 +14 2000-02-16 NULL 183.40 183.58 183.40 +17 2000-05-24 439.75 NULL 439.75 398.92 +17 2000-06-09 NULL 407.77 439.75 407.77 +17 2000-06-13 NULL 408.53 439.75 408.53 +26 2000-01-14 124.68 NULL 124.68 61.34 +26 2000-01-29 NULL 72.77 124.68 72.77 +26 2000-02-06 126.41 NULL 126.41 72.77 +29 2000-02-05 160.79 NULL 160.79 141.46 +29 2000-02-06 167.35 NULL 167.35 141.46 +29 2000-02-07 214.40 NULL 214.40 141.46 +29 2000-02-15 NULL 164.35 214.40 164.35 +29 2000-02-18 NULL 172.82 214.40 172.82 +32 2000-01-21 59.48 NULL 59.48 6.20 +32 2000-01-25 NULL 10.50 59.48 10.50 +32 2000-02-03 NULL 38.01 59.48 38.01 +32 2000-02-09 109.67 NULL 109.67 38.01 +32 2000-02-23 NULL 43.04 109.67 43.04 +32 2000-02-26 NULL 81.08 109.67 81.08 +32 2000-03-05 NULL 99.43 109.67 99.43 +32 2000-03-06 NULL 99.43 109.67 99.43 +43 2000-04-09 172.09 NULL 172.09 169.55 +43 2000-04-23 257.19 NULL 257.19 207.76 +43 2000-04-24 272.83 NULL 272.83 207.76 +43 2000-05-15 NULL 221.70 272.83 221.70 +44 2000-01-02 75.87 26.58 75.87 26.58 +44 2000-01-05 125.14 NULL 125.14 26.58 +47 2000-02-14 148.00 NULL 148.00 74.22 +61 2000-01-19 140.35 75.64 140.35 75.64 +61 2000-01-28 231.75 NULL 231.75 75.64 +61 2000-02-04 NULL 156.79 231.75 156.79 +61 2000-02-27 NULL 224.70 231.75 224.70 +67 2000-01-01 88.63 46.38 88.63 46.38 +67 2000-01-02 NULL 53.21 88.63 53.21 +67 2000-01-04 185.14 100.85 185.14 100.85 +67 2000-01-29 309.98 NULL 309.98 100.85 +67 2000-02-14 NULL 148.29 309.98 148.29 +67 2000-02-20 NULL 174.01 309.98 174.01 +67 2000-03-05 NULL 199.85 309.98 199.85 +67 2000-03-07 NULL 284.98 309.98 284.98 +74 2000-01-06 71.82 NULL 71.82 9.01 +80 2000-03-16 NULL 67.38 169.88 67.38 +80 2000-04-10 NULL 137.63 169.88 137.63 +80 2000-07-01 309.57 NULL 309.57 273.52 +80 2000-07-02 455.94 NULL 455.94 273.52 +80 2000-07-25 NULL 443.48 455.94 443.48 +80 2000-08-04 NULL 443.48 455.94 443.48 +82 2000-01-01 85.75 64.27 85.75 64.27 +83 2000-01-08 134.96 NULL 134.96 8.10 +83 2000-02-01 NULL 52.54 134.96 52.54 +83 2000-02-27 NULL 76.22 134.96 76.22 +83 2000-03-01 NULL 112.53 134.96 112.53 +83 2000-03-02 248.36 NULL 248.36 112.53 +83 2000-03-05 NULL 118.07 248.36 118.07 +83 2000-03-16 250.29 NULL 250.29 118.07 +83 2000-03-19 NULL 163.65 250.29 163.65 +83 2000-04-07 289.65 NULL 289.65 163.65 +83 2000-04-08 NULL 201.68 289.65 201.68 +83 2000-04-10 357.89 NULL 357.89 201.68 +83 2000-04-20 364.69 NULL 364.69 201.68 +83 2000-04-26 371.15 NULL 371.15 201.68 +83 2000-05-06 NULL 206.29 371.15 206.29 +83 2000-05-27 NULL 228.07 371.15 228.07 +83 2000-06-06 393.25 NULL 393.25 228.07 +83 2000-06-09 NULL 235.88 393.25 235.88 +83 2000-06-10 NULL 299.68 393.25 299.68 +85 2000-01-16 48.36 NULL 48.36 42.45 +85 2000-01-18 NULL 47.47 48.36 47.47 +85 2000-02-02 126.73 NULL 126.73 47.47 +85 2000-04-01 NULL 47.47 126.73 47.47 +85 2000-04-08 NULL 58.91 126.73 58.91 +85 2000-04-15 NULL 69.74 126.73 69.74 +85 2000-05-01 NULL 93.80 126.73 93.80 +86 2000-01-16 NULL 19.92 38.25 19.92 +86 2000-01-17 NULL 34.32 38.25 34.32 +86 2000-05-06 257.78 NULL 257.78 204.60 +86 2000-05-08 NULL 222.06 257.78 222.06 +86 2000-05-12 NULL 235.00 257.78 235.00 +89 2000-02-01 143.30 NULL 143.30 125.19 +89 2000-02-11 273.46 NULL 273.46 125.19 +89 2000-03-01 NULL 131.53 273.46 131.53 +89 2000-03-24 NULL 200.30 273.46 200.30 +89 2000-04-04 NULL 212.25 273.46 212.25 +89 2000-04-05 NULL 265.57 273.46 265.57 +97 2000-01-22 114.93 NULL 114.93 55.81 +97 2000-01-31 NULL 60.35 114.93 60.35 +97 2000-03-07 263.86 NULL 263.86 220.68 +98 2000-02-10 NULL 1.04 42.10 1.04 +98 2000-02-23 44.27 NULL 44.27 1.04 +98 2000-02-24 274.58 NULL 274.58 1.04 +98 2000-02-29 301.60 NULL 301.60 1.04 +98 2000-03-13 309.78 NULL 309.78 1.04 +98 2000-03-17 335.79 NULL 335.79 1.04 +98 2000-03-27 NULL 37.67 335.79 37.67 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q52.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q52.sql.out new file mode 100644 index 0000000000000..568469bf9afa6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q52.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +2000 1002002 importoamalg #x 98247.74 +2000 4001001 amalgedu pack #x 97944.74 +2000 2004002 edu packimporto #x 90901.39 +2000 2004001 edu packimporto #x 89064.36 +2000 9003003 exportimaxi #x 67483.21 +2000 4004002 edu packedu pack #x 64713.03 +2000 2002002 importoimporto #x 61594.80 +2000 2001001 amalgimporto #x 57219.92 +2000 10016008 corpamalgamalg #x 56274.63 +2000 3002001 importoexporti #x 52756.72 +2000 3004001 edu packexporti #x 49336.05 +2000 4003001 exportiedu pack #x 47889.60 +2000 1004001 edu packbrand #x 46738.09 +2000 3003002 exportiexporti #x 46024.13 +2000 3004002 edu packexporti #x 42712.09 +2000 6003005 edu packmaxi #x 42381.36 +2000 9015011 exportibrand #x 41249.43 +2000 5001002 amalgscholar #x 40525.36 +2000 9003006 exportimaxi #x 40252.87 +2000 NULL NULL 39507.19 +2000 5002001 importoscholar #x 38829.75 +2000 3003001 exportiexporti #x 36506.92 +2000 4002001 importoedu pack #x 35994.46 +2000 9013003 exportiunivamalg #x 35549.32 +2000 6003004 exporticorp #x 34314.00 +2000 8010002 univmaxi #x 32664.31 +2000 6005004 scholarcorp #x 32175.90 +2000 7011006 amalgnameless #x 30979.02 +2000 10008016 namelessunivamalg #x 30424.25 +2000 10014001 edu packamalgamalg #x 30406.55 +2000 5003001 exportischolar #x 30278.44 +2000 10003008 exportiunivamalg #x 30127.51 +2000 7002002 importobrand #x 29602.59 +2000 7005006 scholarbrand #x 29319.83 +2000 9012009 importounivamalg #x 29204.86 +2000 1001001 importoexporti #x 28800.60 +2000 7011010 amalgnameless #x 28614.32 +2000 10007004 exportiamalg #x 28600.67 +2000 4001002 amalgedu pack #x 27963.59 +2000 4002001 edu packscholar #x 27934.37 +2000 10016002 corpamalgamalg #x 27695.20 +2000 7015008 scholarnameless #x 27490.44 +2000 8006010 corpnameless #x 27390.35 +2000 6008004 namelesscorp #x 27296.01 +2000 5002002 importoscholar #x 27037.76 +2000 8003006 exportinameless #x 26842.25 +2000 1003001 exportiamalg #x 26808.25 +2000 10001007 amalgunivamalg #x 26031.20 +2000 6011001 amalgbrand #x 25567.26 +2000 1001001 amalgamalg #x 25210.15 +2000 8002008 importonameless #x 24937.40 +2000 5004002 edu packscholar #x 24800.08 +2000 9007003 brandmaxi #x 24694.06 +2000 4002002 importoedu pack #x 23924.37 +2000 9008003 namelessmaxi #x 23871.65 +2000 3001001 amalgexporti #x 23023.19 +2000 10009002 maxiunivamalg #x 22932.13 +2000 8014006 edu packmaxi #x 22164.19 +2000 8008006 namelessnameless #x 22159.19 +2000 1002001 importoamalg #x 21952.87 +2000 10005002 edu packedu pack #x 21623.64 +2000 9016008 corpunivamalg #x 21503.39 +2000 8002007 importonameless #x 21370.99 +2000 7013002 exportinameless #x 21315.92 +2000 5003001 importonameless #x 21140.49 +2000 1003002 exportiamalg #x 20558.37 +2000 7014009 edu packedu pack #x 20518.93 +2000 4003001 corpnameless #x 20345.42 +2000 3002001 edu packedu pack #x 19948.39 +2000 6015004 scholarbrand #x 19806.27 +2000 7015004 scholarnameless #x 19805.86 +2000 10005002 exportiimporto #x 19553.70 +2000 6005003 amalgbrand #x 18383.14 +2000 10013010 exportiamalgamalg #x 18349.28 +2000 10010002 exportiexporti #x 18338.53 +2000 2002001 amalgimporto #x 18298.41 +2000 10009016 maxiunivamalg #x 17942.21 +2000 2002001 exportiexporti #x 17817.83 +2000 4003002 exportiedu pack #x 17709.48 +2000 9004008 edu packmaxi #x 17660.51 +2000 7006005 corpbrand #x 17628.79 +2000 10013006 exportiamalgamalg #x 17579.59 +2000 9002011 brandbrand #x 17177.90 +2000 2001001 exportiexporti #x 16270.97 +2000 6011003 amalgbrand #x 16222.01 +2000 8004002 edu packnameless #x 16054.52 +2000 10008008 importoexporti #x 15563.77 +2000 6002008 importocorp #x 15447.93 +2000 4003001 edu packimporto #x 15313.51 +2000 8015004 scholarmaxi #x 15299.50 +2000 8010001 univmaxi #x 15188.28 +2000 7016008 corpnameless #x 15123.33 +2000 6008001 namelesscorp #x 15096.05 +2000 7009003 maxibrand #x 15073.42 +2000 7015007 scholarnameless #x 14934.32 +2000 1001002 amalgamalg #x 14264.80 +2000 7010005 univnameless #x 14247.64 +2000 9005002 scholarmaxi #x 14062.39 +2000 7012008 importonameless #x 14043.20 +2000 9010002 univunivamalg #x 13922.13 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q53.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q53.sql.out new file mode 100644 index 0000000000000..8528e2da8bfe0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q53.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +132 119.11 258.580000 +132 222.31 258.580000 +132 342.09 258.580000 +132 350.81 258.580000 +612 77.21 301.970000 +612 174.17 301.970000 +612 248.75 301.970000 +612 707.75 301.970000 +650 240.94 329.890000 +650 451.30 329.890000 +483 175.17 341.280000 +483 284.63 341.280000 +483 379.24 341.280000 +483 526.08 341.280000 +39 83.05 347.250000 +39 201.75 347.250000 +39 249.20 347.250000 +39 855.00 347.250000 +659 270.05 357.907500 +659 301.12 357.907500 +659 521.64 357.907500 +487 194.22 363.632500 +487 213.65 363.632500 +487 489.98 363.632500 +487 556.68 363.632500 +423 156.29 372.700000 +423 323.98 372.700000 +423 607.23 372.700000 +872 117.67 375.220000 +872 118.10 375.220000 +872 880.58 375.220000 +556 245.39 386.777500 +556 311.12 386.777500 +556 446.09 386.777500 +556 544.51 386.777500 +179 308.69 388.540000 +179 438.91 388.540000 +274 40.68 390.370000 +274 140.57 390.370000 +274 283.26 390.370000 +274 1096.97 390.370000 +551 154.35 397.355000 +551 327.31 397.355000 +551 696.52 397.355000 +67 271.97 397.382500 +67 305.28 397.382500 +67 621.24 397.382500 +53 110.01 397.517500 +53 250.03 397.517500 +53 468.76 397.517500 +53 761.27 397.517500 +172 154.34 398.030000 +172 347.87 398.030000 +172 439.68 398.030000 +172 650.23 398.030000 +915 210.94 403.120000 +915 359.81 403.120000 +915 678.57 403.120000 +350 30.44 407.737500 +350 328.11 407.737500 +350 339.56 407.737500 +350 932.84 407.737500 +203 164.68 408.595000 +203 305.41 408.595000 +203 735.85 408.595000 +2 239.50 408.602500 +2 289.78 408.602500 +2 696.25 408.602500 +687 70.08 410.057500 +687 80.72 410.057500 +687 368.29 410.057500 +687 1121.14 410.057500 +113 76.68 414.170000 +113 268.47 414.170000 +113 531.42 414.170000 +113 780.11 414.170000 +161 224.11 416.682500 +161 298.25 416.682500 +161 480.46 416.682500 +161 663.91 416.682500 +233 284.33 421.205000 +233 320.60 421.205000 +233 322.01 421.205000 +233 757.88 421.205000 +743 173.26 430.360000 +743 198.59 430.360000 +743 565.04 430.360000 +743 784.55 430.360000 +581 51.95 432.642500 +581 247.90 432.642500 +581 509.07 432.642500 +581 921.65 432.642500 +107 254.35 434.100000 +107 348.41 434.100000 +107 388.70 434.100000 +107 744.94 434.100000 +359 163.98 436.225000 +359 215.17 436.225000 +359 379.98 436.225000 +359 985.77 436.225000 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q54.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q54.sql.out new file mode 100644 index 0000000000000..dd5f10b74372c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q54.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output + diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q55.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q55.sql.out new file mode 100644 index 0000000000000..9592803da4665 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q55.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +4002001 importoedu pack #x 141955.03 +2001001 amalgimporto #x 115066.00 +2003001 exportiimporto #x 96597.01 +5003002 exportischolar #x 93316.15 +1002001 importoamalg #x 85318.86 +2002001 importoimporto #x 85035.18 +3003001 exportiexporti #x 80017.81 +2004001 edu packimporto #x 68604.08 +9001008 amalgmaxi #x 60900.34 +4004001 edu packedu pack #x 58815.34 +4003002 exportiedu pack #x 56587.37 +6012003 importobrand #x 55151.38 +1001002 amalgamalg #x 54471.07 +3004001 edu packexporti #x 54057.61 +3001001 amalgexporti #x 52690.20 +4003001 exportiedu pack #x 51021.71 +5002002 importoscholar #x 46601.52 +8002007 importonameless #x 45983.92 +6016003 corpbrand #x 44911.30 +1003001 exportiamalg #x 44127.51 +6014003 edu packbrand #x 41310.31 +7014009 edu packnameless #x 40891.96 +7008004 namelessbrand #x 36589.35 +10001016 amalgunivamalg #x 36270.01 +6016004 corpbrand #x 36208.64 +9013011 exportiunivamalg #x 35794.13 +1003002 exportiamalg #x 35113.55 +1004002 edu packamalg #x 34667.61 +7016005 corpnameless #x 33397.41 +7014005 edu packnameless #x 33313.92 +7012010 importonameless #x 32862.88 +7012001 importonameless #x 32815.12 +6001007 amalgcorp #x 31948.28 +3002001 importoexporti #x 31518.29 +8015001 scholarmaxi #x 31235.19 +10012006 importoamalgamalg #x 31123.11 +6004004 edu packcorp #x 29839.27 +10009008 maxiunivamalg #x 29180.04 +5004001 edu packscholar #x 28912.61 +9006011 corpmaxi #x 26493.45 +8014004 edu packmaxi #x 26228.69 +9012008 importounivamalg #x 25354.49 +8015003 scholarmaxi #x 23994.34 +7013009 exportinameless #x 23887.30 +2004002 edu packimporto #x 23778.49 +6005005 scholarcorp #x 23243.88 +5001001 amalgscholar #x 23043.20 +8009007 maxinameless #x 22910.03 +8004009 edu packnameless #x 22679.38 +9016002 corpunivamalg #x 21881.94 +8003001 exportinameless #x 21655.96 +8004004 edu packnameless #x 20920.43 +10010007 univamalgamalg #x 20530.11 +8007004 brandnameless #x 19973.79 +9015005 scholarunivamalg #x 19929.31 +6004002 edu packcorp #x 19890.20 +10004005 edu packunivamalg #x 19819.04 +9014008 edu packunivamalg #x 19700.99 +5003001 exportischolar #x 19595.76 +7007006 brandbrand #x 19541.72 +8009001 maxinameless #x 19474.02 +2002002 importoimporto #x 19249.25 +8003002 exportinameless #x 18931.96 +9016011 corpunivamalg #x 18840.83 +10012011 importoamalgamalg #x 18632.17 +9004005 edu packmaxi #x 17997.32 +7003003 exportibrand #x 16699.26 +9011011 amalgunivamalg #x 16656.62 +10008002 namelessunivamalg #x 16609.49 +10016015 corpamalgamalg #x 16397.21 +8008001 namelessnameless #x 15538.37 +6004007 edu packcorp #x 15474.56 +7006001 corpbrand #x 15365.31 +6010003 univbrand #x 15337.21 +1001001 amalgamalg #x 14813.15 +9012003 importounivamalg #x 14033.76 +8015008 scholarmaxi #x 13408.30 +6002005 importocorp #x 13393.21 +7010009 univnameless #x 13359.47 +10010002 univamalgamalg #x 13288.24 +8014003 edu packmaxi #x 13137.78 +10001009 amalgunivamalg #x 12326.55 +5001002 amalgscholar #x 12319.21 +5002001 importoscholar #x 12023.80 +8005010 scholarnameless #x 12017.53 +6008005 namelesscorp #x 11908.45 +3001002 amalgexporti #x 11679.83 +10008006 namelessunivamalg #x 11503.15 +10014009 edu packamalgamalg #x 11462.45 +10007017 brandunivamalg #x 11188.38 +7002004 importobrand #x 10699.51 +7001006 amalgbrand #x 10166.47 +10004009 edu packunivamalg #x 9913.46 +10002011 importounivamalg #x 9828.64 +3003002 exportiexporti #x 9521.40 +10014017 edu packamalgamalg #x 9150.09 +6002003 importocorp #x 8810.78 +6001005 amalgcorp #x 8582.71 +4001001 amalgedu pack #x 8362.72 +8004002 edu packnameless #x 8010.27 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q56.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q56.sql.out new file mode 100644 index 0000000000000..f6d3a7470781c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q56.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAANMMDAAAA NULL +AAAAAAAAIMPDAAAA 0.00 +AAAAAAAAEGJBAAAA 0.59 +AAAAAAAAOGIDAAAA 3.92 +AAAAAAAAFLGAAAAA 17.01 +AAAAAAAAGPEEAAAA 21.60 +AAAAAAAACJCDAAAA 27.30 +AAAAAAAAAAEDAAAA 38.88 +AAAAAAAACPBEAAAA 46.20 +AAAAAAAAMGKBAAAA 50.79 +AAAAAAAACLHAAAAA 58.52 +AAAAAAAAKJOBAAAA 74.48 +AAAAAAAAGMEDAAAA 78.90 +AAAAAAAADGCCAAAA 84.81 +AAAAAAAALLDAAAAA 95.60 +AAAAAAAAONEDAAAA 100.91 +AAAAAAAAAKMAAAAA 102.75 +AAAAAAAAIJIAAAAA 103.53 +AAAAAAAAMLFDAAAA 112.10 +AAAAAAAAHDDAAAAA 113.62 +AAAAAAAAPBMDAAAA 117.80 +AAAAAAAAPFCDAAAA 119.56 +AAAAAAAALICBAAAA 119.68 +AAAAAAAAKAJAAAAA 126.21 +AAAAAAAAOIAAAAAA 127.82 +AAAAAAAAABDEAAAA 145.52 +AAAAAAAAOCKDAAAA 149.00 +AAAAAAAAEMECAAAA 154.20 +AAAAAAAAGOLDAAAA 172.12 +AAAAAAAAAGLDAAAA 173.46 +AAAAAAAAGBGEAAAA 178.20 +AAAAAAAAKOBDAAAA 183.60 +AAAAAAAAEGGDAAAA 187.32 +AAAAAAAAHDKCAAAA 227.76 +AAAAAAAAFDBEAAAA 236.91 +AAAAAAAAEICCAAAA 241.28 +AAAAAAAAAKAAAAAA 250.16 +AAAAAAAAOMBEAAAA 310.90 +AAAAAAAAANHCAAAA 320.32 +AAAAAAAAIJGAAAAA 336.00 +AAAAAAAAAFAAAAAA 336.28 +AAAAAAAAKFGBAAAA 380.37 +AAAAAAAAEACCAAAA 389.75 +AAAAAAAAIOMAAAAA 418.92 +AAAAAAAAEKODAAAA 448.26 +AAAAAAAAENDAAAAA 456.30 +AAAAAAAAAJGBAAAA 457.68 +AAAAAAAAIBEAAAAA 466.74 +AAAAAAAAOMEEAAAA 469.80 +AAAAAAAAMDIDAAAA 501.28 +AAAAAAAAPANDAAAA 519.27 +AAAAAAAAKKECAAAA 523.27 +AAAAAAAAKPABAAAA 564.00 +AAAAAAAABHMCAAAA 566.58 +AAAAAAAAGMGBAAAA 584.56 +AAAAAAAAGKNCAAAA 614.00 +AAAAAAAAGELBAAAA 625.04 +AAAAAAAAKGGDAAAA 642.63 +AAAAAAAAFLPAAAAA 680.48 +AAAAAAAAGJODAAAA 698.32 +AAAAAAAAIBDBAAAA 702.93 +AAAAAAAAGAFAAAAA 733.20 +AAAAAAAAMPEEAAAA 760.16 +AAAAAAAAMDFCAAAA 776.72 +AAAAAAAANPFEAAAA 778.00 +AAAAAAAAMHEAAAAA 778.27 +AAAAAAAAOHLDAAAA 801.88 +AAAAAAAAGIJDAAAA 815.74 +AAAAAAAAICOCAAAA 817.74 +AAAAAAAAAICAAAAA 823.35 +AAAAAAAAKCNAAAAA 833.31 +AAAAAAAACDGAAAAA 836.90 +AAAAAAAAAAKDAAAA 850.07 +AAAAAAAAFOJAAAAA 859.28 +AAAAAAAAMNLCAAAA 865.29 +AAAAAAAAOINCAAAA 865.60 +AAAAAAAAKGOBAAAA 875.20 +AAAAAAAAOFKAAAAA 882.60 +AAAAAAAAIGMCAAAA 886.89 +AAAAAAAAIIOBAAAA 892.05 +AAAAAAAAGOBBAAAA 909.74 +AAAAAAAAPNNCAAAA 981.72 +AAAAAAAAKPAAAAAA 1006.11 +AAAAAAAANDBCAAAA 1028.34 +AAAAAAAAABCCAAAA 1051.08 +AAAAAAAACJCEAAAA 1055.78 +AAAAAAAACEPCAAAA 1064.00 +AAAAAAAACGFEAAAA 1067.78 +AAAAAAAAMOIAAAAA 1073.80 +AAAAAAAAMIFDAAAA 1104.17 +AAAAAAAAAOHBAAAA 1104.40 +AAAAAAAAMGJBAAAA 1124.12 +AAAAAAAAAEFCAAAA 1134.68 +AAAAAAAAAJIDAAAA 1153.92 +AAAAAAAAFEKDAAAA 1156.54 +AAAAAAAAGIBEAAAA 1165.02 +AAAAAAAAKLBBAAAA 1181.93 +AAAAAAAAOBBAAAAA 1183.08 +AAAAAAAABEEEAAAA 1190.91 +AAAAAAAADHJAAAAA 1202.11 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q57.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q57.sql.out new file mode 100644 index 0000000000000..dc712720d3ac5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q57.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +Music amalgscholar #x Mid Atlantic 1999 2 6662.669167 1961.57 4348.07 3386.25 +Shoes amalgedu pack #x North Midwest 1999 2 6493.071667 2044.05 4348.88 3443.20 +Shoes exportiedu pack #x Mid Atlantic 1999 3 7416.141667 2980.15 4654.22 5157.83 +Children importoexporti #x North Midwest 1999 4 6577.143333 2152.15 3291.07 3659.32 +Shoes importoedu pack #x NY Metro 1999 6 6926.960833 2523.33 4014.93 4254.99 +Men importoimporto #x North Midwest 1999 2 6707.315833 2449.22 4311.11 3583.31 +Men amalgimporto #x North Midwest 1999 4 7098.680833 2965.42 3526.45 4923.53 +Men exportiimporto #x NY Metro 1999 2 7146.240000 3013.99 6183.83 5091.17 +Children amalgexporti #x North Midwest 1999 4 6364.467500 2270.79 3330.83 3817.50 +Men edu packimporto #x North Midwest 1999 4 7386.333333 3329.74 3488.01 4860.20 +Men edu packimporto #x North Midwest 1999 2 7386.333333 3347.65 4007.40 3488.01 +Music edu packscholar #x NY Metro 1999 7 6639.040000 2653.55 4219.52 10071.22 +Music amalgscholar #x North Midwest 1999 4 6719.304167 2739.33 3690.54 3872.98 +Men importoimporto #x NY Metro 1999 3 6610.034167 2645.24 3661.14 4282.01 +Music exportischolar #x NY Metro 1999 2 7043.051667 3115.83 4457.95 5258.95 +Men edu packimporto #x North Midwest 1999 3 7386.333333 3488.01 3347.65 3329.74 +Shoes exportiedu pack #x North Midwest 1999 3 7255.790000 3411.07 4194.64 3624.85 +Women exportiamalg #x Mid Atlantic 1999 2 5646.671667 1809.52 4198.70 2172.85 +Music importoscholar #x Mid Atlantic 1999 6 6279.081667 2456.98 4361.44 4256.24 +Children importoexporti #x Mid Atlantic 1999 7 6786.750000 2978.82 3942.59 7809.22 +Music exportischolar #x North Midwest 1999 2 7041.705833 3245.77 3608.31 4127.40 +Shoes importoedu pack #x Mid Atlantic 1999 2 6864.320833 3104.48 3135.52 3606.28 +Shoes importoedu pack #x Mid Atlantic 1999 1 6864.320833 3135.52 14580.30 3104.48 +Children edu packexporti #x Mid Atlantic 1999 5 6511.800833 2785.92 3956.90 3906.63 +Women amalgamalg #x Mid Atlantic 1999 2 6480.683333 2769.69 3353.67 3876.51 +Men exportiimporto #x NY Metro 1999 5 7146.240000 3440.57 3561.11 3971.13 +Women importoamalg #x NY Metro 1999 3 6512.794167 2808.28 3789.51 4335.27 +Men amalgimporto #x NY Metro 1999 2 6720.550000 3018.90 4328.03 3810.74 +Shoes exportiedu pack #x North Midwest 1999 7 7255.790000 3557.87 4937.98 9496.49 +Music exportischolar #x Mid Atlantic 1999 5 6791.260833 3096.02 3918.04 3801.90 +Men exportiimporto #x North Midwest 1999 1 7343.719167 3652.72 13689.13 3984.13 +Men importoimporto #x North Midwest 1999 5 6707.315833 3030.18 4977.33 4620.75 +Children exportiexporti #x NY Metro 1999 2 6386.880833 2717.07 4809.11 3355.48 +Men amalgimporto #x North Midwest 1999 2 7098.680833 3440.27 5293.69 3526.45 +Men importoimporto #x NY Metro 1999 5 6610.034167 2954.71 4282.01 3166.43 +Shoes exportiedu pack #x North Midwest 1999 4 7255.790000 3624.85 3411.07 5169.09 +Men exportiimporto #x North Midwest 1999 5 7343.719167 3727.75 3729.62 4580.93 +Men exportiimporto #x North Midwest 1999 4 7343.719167 3729.62 4033.37 3727.75 +Music edu packscholar #x North Midwest 1999 2 6489.175000 2875.98 4299.82 4028.97 +Men edu packimporto #x NY Metro 1999 1 7202.242500 3614.07 15582.63 4234.79 +Music importoscholar #x North Midwest 1999 2 5816.271667 2229.79 2919.29 4298.41 +Men exportiimporto #x NY Metro 1999 4 7146.240000 3561.11 5091.17 3440.57 +Shoes exportiedu pack #x NY Metro 1999 7 7073.462500 3493.41 4534.31 8701.59 +Music exportischolar #x Mid Atlantic 1999 3 6791.260833 3218.13 3847.87 3918.04 +Shoes edu packedu pack #x NY Metro 1999 4 6203.331667 2631.02 4424.18 4186.85 +Men amalgimporto #x North Midwest 1999 3 7098.680833 3526.45 3440.27 2965.42 +Men edu packimporto #x NY Metro 1999 3 7202.242500 3639.93 4234.79 4016.25 +Children amalgexporti #x North Midwest 1999 2 6364.467500 2825.09 4111.08 3330.83 +Shoes edu packedu pack #x North Midwest 1999 2 6464.239167 2928.99 4233.86 3840.97 +Shoes amalgedu pack #x North Midwest 1999 4 6493.071667 2962.20 3443.20 4212.60 +Music importoscholar #x NY Metro 1999 4 5707.844167 2179.41 3789.16 4317.53 +Shoes exportiedu pack #x Mid Atlantic 1999 1 7416.141667 3892.54 14170.68 4654.22 +Women importoamalg #x NY Metro 1999 5 6512.794167 2991.07 4335.27 4624.86 +Music exportischolar #x NY Metro 1999 4 7043.051667 3521.99 5258.95 4135.21 +Women edu packamalg #x Mid Atlantic 1999 2 6354.045833 2836.23 3719.67 3527.07 +Music amalgscholar #x NY Metro 1999 3 6123.475000 2617.39 3080.43 4919.93 +Shoes amalgedu pack #x Mid Atlantic 1999 7 6674.896667 3178.12 3342.98 8050.81 +Men amalgimporto #x Mid Atlantic 1999 5 6618.534167 3127.28 4291.66 4669.62 +Women amalgamalg #x North Midwest 1999 6 6874.250000 3387.53 4798.69 4329.48 +Women exportiamalg #x Mid Atlantic 1999 3 5646.671667 2172.85 1809.52 4461.31 +Children edu packexporti #x NY Metro 1999 2 6112.954167 2641.54 3567.58 3196.45 +Children amalgexporti #x NY Metro 1999 5 6294.100833 2834.48 3317.60 3803.79 +Women edu packamalg #x NY Metro 1999 5 6027.880000 2575.81 2750.96 4459.01 +Music exportischolar #x North Midwest 1999 6 7041.705833 3589.97 4134.03 4892.26 +Music exportischolar #x North Midwest 1999 4 7041.705833 3593.86 4127.40 4134.03 +Men importoimporto #x NY Metro 1999 6 6610.034167 3166.43 2954.71 3673.39 +Music exportischolar #x North Midwest 1999 1 7041.705833 3608.31 15046.54 3245.77 +Music edu packscholar #x Mid Atlantic 1999 2 6602.385000 3173.44 3434.91 3929.40 +Music amalgscholar #x NY Metro 1999 6 6123.475000 2699.75 4038.47 3330.87 +Children importoexporti #x Mid Atlantic 1999 4 6786.750000 3366.25 3847.60 4259.57 +Men edu packimporto #x Mid Atlantic 1999 1 7230.493333 3811.64 14668.93 4497.31 +Shoes importoedu pack #x Mid Atlantic 1999 5 6864.320833 3449.62 3869.15 3531.93 +Children edu packexporti #x North Midwest 1999 2 6739.498333 3328.01 4986.50 3623.32 +Children importoexporti #x Mid Atlantic 1999 1 6786.750000 3376.55 12504.93 5018.22 +Children edu packexporti #x NY Metro 1999 7 6112.954167 2711.04 3254.04 9465.10 +Shoes importoedu pack #x North Midwest 1999 3 6588.741667 3187.25 4283.21 3212.76 +Men importoimporto #x Mid Atlantic 1999 3 6702.415000 3310.55 3981.06 4901.56 +Men edu packimporto #x North Midwest 1999 1 7386.333333 4007.40 14005.45 3347.65 +Shoes importoedu pack #x North Midwest 1999 4 6588.741667 3212.76 3187.25 3974.78 +Shoes edu packedu pack #x NY Metro 1999 6 6203.331667 2835.78 4186.85 3192.53 +Men exportiimporto #x North Midwest 1999 2 7343.719167 3984.13 3652.72 4033.37 +Men amalgimporto #x NY Metro 1999 4 6720.550000 3364.32 3810.74 4333.58 +Children edu packexporti #x North Midwest 1999 4 6739.498333 3389.03 3623.32 3605.25 +Shoes importoedu pack #x Mid Atlantic 1999 6 6864.320833 3531.93 3449.62 4414.17 +Shoes amalgedu pack #x Mid Atlantic 1999 6 6674.896667 3342.98 4458.26 3178.12 +Children edu packexporti #x Mid Atlantic 1999 2 6511.800833 3185.28 3581.75 3410.75 +Children amalgexporti #x Mid Atlantic 1999 4 6854.405833 3541.62 3854.33 3938.42 +Men exportiimporto #x North Midwest 1999 3 7343.719167 4033.37 3984.13 3729.62 +Men amalgimporto #x Mid Atlantic 1999 3 6618.534167 3313.62 4044.36 4291.66 +Shoes exportiedu pack #x Mid Atlantic 1999 7 7416.141667 4121.24 4239.08 8658.42 +Women importoamalg #x Mid Atlantic 1999 6 6395.326667 3102.55 4234.22 3650.03 +Children importoexporti #x North Midwest 1999 3 6577.143333 3291.07 3773.61 2152.15 +Women edu packamalg #x NY Metro 1999 4 6027.880000 2750.96 3199.35 2575.81 +Music amalgscholar #x Mid Atlantic 1999 3 6662.669167 3386.25 1961.57 4799.18 +Men amalgimporto #x North Midwest 1999 6 7098.680833 3834.90 4923.53 4115.57 +Shoes importoedu pack #x Mid Atlantic 1999 3 6864.320833 3606.28 3104.48 3869.15 +Music exportischolar #x NY Metro 1999 6 7043.051667 3793.48 4135.21 5006.69 +Shoes edu packedu pack #x Mid Atlantic 1999 1 6711.753333 3473.10 15060.83 4085.86 +Men exportiimporto #x Mid Atlantic 1999 1 7419.459167 4188.88 16358.86 4366.77 +Women amalgamalg #x NY Metro 1999 2 6362.709167 3137.03 4180.91 3181.26 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q58.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q58.sql.out new file mode 100644 index 0000000000000..7e282de310b78 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q58.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAOEHBAAAA 4202.05 11.64402731132023188 3952.65 10.95293120074485419 3874.50 10.73637482126824727 4009.733333 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q59.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q59.sql.out new file mode 100644 index 0000000000000..020860f8baefd --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q59.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5271 0.74419775623719778195 0.74258389025810779226 0.18455097389041153754 0.11049123944133143765 2.01369701972914228390 0.74322255494522317957 0.71433787179231334416 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5272 0.84505990801516636507 1.64762915953700921988 0.38486496991736952802 0.68701158883293751293 1.56192545028377515216 1.16497445041784212487 0.46921185549145987093 +able AAAAAAAACAAAAAAA 5273 0.35130200745800939483 0.85485871077793239664 0.66980552712384851586 0.66252919917140464542 0.75558600483388711996 0.52111936828952912290 0.63215140490620731712 +able AAAAAAAACAAAAAAA 5273 0.35130200745800939483 0.85485871077793239664 0.66980552712384851586 0.66252919917140464542 0.75558600483388711996 0.52111936828952912290 0.63215140490620731712 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q60.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q60.sql.out new file mode 100644 index 0000000000000..632d983192f6f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q60.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAAABAAAAA 6334.66 +AAAAAAAAAACCAAAA 5389.16 +AAAAAAAAAADBAAAA 11655.98 +AAAAAAAAAAHAAAAA 5388.00 +AAAAAAAAAAHDAAAA 12685.87 +AAAAAAAAAAIAAAAA 8916.30 +AAAAAAAAAAKBAAAA 2140.04 +AAAAAAAAAAMBAAAA 22048.17 +AAAAAAAAAAPBAAAA 13195.87 +AAAAAAAAABAEAAAA 1071.67 +AAAAAAAAABBCAAAA 7064.02 +AAAAAAAAABEAAAAA 13239.06 +AAAAAAAAABFBAAAA 1877.72 +AAAAAAAAABFEAAAA 699.95 +AAAAAAAAABGAAAAA 8169.00 +AAAAAAAAABJAAAAA 10752.87 +AAAAAAAAABLBAAAA 5962.43 +AAAAAAAAABLCAAAA 18131.46 +AAAAAAAAABMBAAAA 12049.00 +AAAAAAAAABMDAAAA 18947.93 +AAAAAAAAABNDAAAA 8479.29 +AAAAAAAAACDCAAAA 13466.87 +AAAAAAAAACEEAAAA 7634.65 +AAAAAAAAACJCAAAA 51774.63 +AAAAAAAAACKBAAAA 18766.24 +AAAAAAAAACLBAAAA 16002.89 +AAAAAAAAACLDAAAA 12302.68 +AAAAAAAAACOBAAAA 2707.13 +AAAAAAAAADABAAAA 6234.38 +AAAAAAAAADBDAAAA 27724.30 +AAAAAAAAADEAAAAA 2867.87 +AAAAAAAAADFAAAAA 10667.94 +AAAAAAAAADFDAAAA 9051.70 +AAAAAAAAADGBAAAA 6502.68 +AAAAAAAAADGCAAAA 1174.33 +AAAAAAAAADHDAAAA 18882.96 +AAAAAAAAADNBAAAA 11526.41 +AAAAAAAAADPBAAAA 1026.20 +AAAAAAAAAEADAAAA 3582.21 +AAAAAAAAAECBAAAA 12360.25 +AAAAAAAAAECCAAAA 20954.85 +AAAAAAAAAEDAAAAA 8537.71 +AAAAAAAAAEECAAAA 10513.50 +AAAAAAAAAEEDAAAA 2561.17 +AAAAAAAAAEGAAAAA 7836.96 +AAAAAAAAAEGDAAAA 638.36 +AAAAAAAAAEJBAAAA 11429.14 +AAAAAAAAAELBAAAA 6543.86 +AAAAAAAAAEMDAAAA 13797.32 +AAAAAAAAAEOBAAAA 6699.66 +AAAAAAAAAFAAAAAA 1979.04 +AAAAAAAAAFCBAAAA 6157.90 +AAAAAAAAAFDAAAAA 14494.27 +AAAAAAAAAFEBAAAA 11552.54 +AAAAAAAAAFGAAAAA 13218.28 +AAAAAAAAAFGCAAAA 10293.39 +AAAAAAAAAFGDAAAA 6078.36 +AAAAAAAAAFJDAAAA 21440.62 +AAAAAAAAAFLBAAAA 11714.63 +AAAAAAAAAFNCAAAA 17910.15 +AAAAAAAAAGACAAAA 12212.53 +AAAAAAAAAGAEAAAA 17187.86 +AAAAAAAAAGBAAAAA 2753.50 +AAAAAAAAAGDBAAAA 5244.60 +AAAAAAAAAGDEAAAA 466.32 +AAAAAAAAAGEAAAAA 2030.78 +AAAAAAAAAGEBAAAA 673.70 +AAAAAAAAAGEDAAAA 4861.80 +AAAAAAAAAGIAAAAA 20717.88 +AAAAAAAAAGKAAAAA 4481.54 +AAAAAAAAAGLAAAAA 259.22 +AAAAAAAAAGNDAAAA 9371.85 +AAAAAAAAAGOAAAAA 12624.61 +AAAAAAAAAGODAAAA 15071.99 +AAAAAAAAAHBDAAAA 6674.73 +AAAAAAAAAHCCAAAA 4327.67 +AAAAAAAAAHECAAAA 13309.93 +AAAAAAAAAHGAAAAA 8277.89 +AAAAAAAAAHIBAAAA 6574.61 +AAAAAAAAAHICAAAA 4810.18 +AAAAAAAAAHJDAAAA 9151.90 +AAAAAAAAAHKAAAAA 424.72 +AAAAAAAAAHKCAAAA 23702.30 +AAAAAAAAAHKDAAAA 8747.48 +AAAAAAAAAHMBAAAA 17707.03 +AAAAAAAAAHMDAAAA 5608.89 +AAAAAAAAAHNAAAAA 9929.30 +AAAAAAAAAHOCAAAA 21257.55 +AAAAAAAAAIAAAAAA 36659.16 +AAAAAAAAAICEAAAA 23564.63 +AAAAAAAAAIDCAAAA 7648.02 +AAAAAAAAAIEBAAAA 6151.13 +AAAAAAAAAIEEAAAA 1406.98 +AAAAAAAAAIFBAAAA 2088.56 +AAAAAAAAAIGAAAAA 2468.08 +AAAAAAAAAIGCAAAA 1834.76 +AAAAAAAAAIGDAAAA 558.00 +AAAAAAAAAIIBAAAA 5422.03 +AAAAAAAAAILDAAAA 4833.43 +AAAAAAAAAIOAAAAA 8317.81 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q61.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q61.sql.out new file mode 100644 index 0000000000000..0a8af60ec1265 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q61.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +2574995.94 5792384.50 44.4548517108972997220 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q62.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q62.sql.out new file mode 100644 index 0000000000000..879eb4c6355ac --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q62.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct120 days :bigint> +-- !query output +Just good amou EXPRESS site_0 270 248 280 287 0 +Just good amou EXPRESS site_1 290 327 288 262 0 +Just good amou EXPRESS site_2 314 295 311 299 0 +Just good amou EXPRESS site_3 309 300 299 267 0 +Just good amou EXPRESS site_4 224 250 297 273 0 +Just good amou LIBRARY site_0 217 192 210 225 0 +Just good amou LIBRARY site_1 163 207 172 205 0 +Just good amou LIBRARY site_2 176 204 208 190 0 +Just good amou LIBRARY site_3 222 220 240 240 0 +Just good amou LIBRARY site_4 254 230 241 263 0 +Just good amou NEXT DAY site_0 311 275 303 291 0 +Just good amou NEXT DAY site_1 291 307 284 289 0 +Just good amou NEXT DAY site_2 275 299 323 279 0 +Just good amou NEXT DAY site_3 260 290 242 248 0 +Just good amou NEXT DAY site_4 233 285 271 281 0 +Just good amou OVERNIGHT site_0 242 262 221 248 0 +Just good amou OVERNIGHT site_1 251 245 249 233 0 +Just good amou OVERNIGHT site_2 198 226 209 204 0 +Just good amou OVERNIGHT site_3 168 199 184 175 0 +Just good amou OVERNIGHT site_4 237 231 193 207 0 +Just good amou REGULAR site_0 140 236 154 190 0 +Just good amou REGULAR site_1 189 190 205 194 0 +Just good amou REGULAR site_2 234 251 264 235 0 +Just good amou REGULAR site_3 229 251 244 243 0 +Just good amou REGULAR site_4 198 209 188 216 0 +Just good amou TWO DAY site_0 256 258 218 235 0 +Just good amou TWO DAY site_1 217 226 195 198 0 +Just good amou TWO DAY site_2 176 151 186 202 0 +Just good amou TWO DAY site_3 221 225 236 190 0 +Just good amou TWO DAY site_4 239 240 219 252 0 +Matches produce EXPRESS site_0 330 277 239 314 0 +Matches produce EXPRESS site_1 296 336 288 307 0 +Matches produce EXPRESS site_2 262 307 273 305 0 +Matches produce EXPRESS site_3 284 253 253 256 0 +Matches produce EXPRESS site_4 260 309 252 296 0 +Matches produce LIBRARY site_0 188 181 179 170 0 +Matches produce LIBRARY site_1 189 211 193 181 0 +Matches produce LIBRARY site_2 253 230 207 248 0 +Matches produce LIBRARY site_3 225 230 217 214 0 +Matches produce LIBRARY site_4 220 218 208 213 0 +Matches produce NEXT DAY site_0 296 286 328 316 0 +Matches produce NEXT DAY site_1 303 303 307 281 0 +Matches produce NEXT DAY site_2 271 258 253 256 0 +Matches produce NEXT DAY site_3 265 263 290 296 0 +Matches produce NEXT DAY site_4 312 312 291 311 0 +Matches produce OVERNIGHT site_0 217 254 216 258 0 +Matches produce OVERNIGHT site_1 214 187 229 230 0 +Matches produce OVERNIGHT site_2 171 176 188 174 0 +Matches produce OVERNIGHT site_3 181 218 193 219 0 +Matches produce OVERNIGHT site_4 244 216 237 234 0 +Matches produce REGULAR site_0 205 216 204 229 0 +Matches produce REGULAR site_1 230 232 229 244 0 +Matches produce REGULAR site_2 225 250 209 254 0 +Matches produce REGULAR site_3 230 212 212 195 0 +Matches produce REGULAR site_4 207 167 180 172 0 +Matches produce TWO DAY site_0 228 195 222 198 0 +Matches produce TWO DAY site_1 169 154 170 146 0 +Matches produce TWO DAY site_2 197 215 201 210 0 +Matches produce TWO DAY site_3 247 236 234 237 0 +Matches produce TWO DAY site_4 242 259 245 247 0 +Operations EXPRESS site_0 270 284 268 286 0 +Operations EXPRESS site_1 274 251 245 275 0 +Operations EXPRESS site_2 287 337 296 310 0 +Operations EXPRESS site_3 349 307 322 286 0 +Operations EXPRESS site_4 284 287 285 271 0 +Operations LIBRARY site_0 266 227 229 237 0 +Operations LIBRARY site_1 201 228 190 200 0 +Operations LIBRARY site_2 177 170 182 171 0 +Operations LIBRARY site_3 227 217 214 226 0 +Operations LIBRARY site_4 268 258 242 242 0 +Operations NEXT DAY site_0 269 255 273 257 0 +Operations NEXT DAY site_1 292 295 258 291 0 +Operations NEXT DAY site_2 296 327 305 294 0 +Operations NEXT DAY site_3 274 286 322 289 0 +Operations NEXT DAY site_4 311 270 243 255 0 +Operations OVERNIGHT site_0 217 205 193 227 0 +Operations OVERNIGHT site_1 221 243 232 237 0 +Operations OVERNIGHT site_2 247 243 235 238 0 +Operations OVERNIGHT site_3 242 218 205 223 0 +Operations OVERNIGHT site_4 181 172 192 186 0 +Operations REGULAR site_0 190 211 206 195 0 +Operations REGULAR site_1 166 173 173 174 0 +Operations REGULAR site_2 198 219 215 226 0 +Operations REGULAR site_3 255 234 239 215 0 +Operations REGULAR site_4 246 231 266 208 0 +Operations TWO DAY site_0 247 232 246 240 0 +Operations TWO DAY site_1 244 240 259 234 0 +Operations TWO DAY site_2 210 214 200 190 0 +Operations TWO DAY site_3 166 181 174 184 0 +Operations TWO DAY site_4 194 197 224 211 0 +Selective, EXPRESS site_0 290 275 273 332 0 +Selective, EXPRESS site_1 303 319 311 299 0 +Selective, EXPRESS site_2 299 238 268 261 0 +Selective, EXPRESS site_3 262 273 281 300 0 +Selective, EXPRESS site_4 285 298 291 300 0 +Selective, LIBRARY site_0 215 204 202 211 0 +Selective, LIBRARY site_1 221 253 243 240 0 +Selective, LIBRARY site_2 218 261 226 234 0 +Selective, LIBRARY site_3 178 189 233 217 0 +Selective, LIBRARY site_4 159 186 194 199 0 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q63.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q63.sql.out new file mode 100644 index 0000000000000..4c5123f2cc90b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q63.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +1 175.21 726.555833 +1 231.64 726.555833 +1 400.27 726.555833 +1 409.69 726.555833 +1 468.02 726.555833 +1 530.63 726.555833 +1 880.08 726.555833 +1 972.96 726.555833 +1 1028.83 726.555833 +1 1038.59 726.555833 +1 1820.16 726.555833 +2 392.91 1124.957500 +2 469.26 1124.957500 +2 654.97 1124.957500 +2 703.18 1124.957500 +2 726.27 1124.957500 +2 813.75 1124.957500 +2 819.59 1124.957500 +2 1248.04 1124.957500 +2 1253.65 1124.957500 +2 1690.71 1124.957500 +2 1961.13 1124.957500 +2 2766.03 1124.957500 +3 259.59 1110.663333 +3 530.95 1110.663333 +3 639.03 1110.663333 +3 727.70 1110.663333 +3 822.22 1110.663333 +3 853.58 1110.663333 +3 910.78 1110.663333 +3 1455.11 1110.663333 +3 1615.68 1110.663333 +3 1741.42 1110.663333 +3 2618.11 1110.663333 +4 465.88 1333.585833 +4 472.55 1333.585833 +4 685.93 1333.585833 +4 703.90 1333.585833 +4 773.55 1333.585833 +4 1535.08 1333.585833 +4 1900.09 1333.585833 +4 2557.73 1333.585833 +4 2842.07 1333.585833 +5 507.40 1378.418333 +5 604.37 1378.418333 +5 633.93 1378.418333 +5 830.17 1378.418333 +5 1013.51 1378.418333 +5 1093.85 1378.418333 +5 1223.10 1378.418333 +5 1735.77 1378.418333 +5 2024.74 1378.418333 +5 2065.17 1378.418333 +5 2319.65 1378.418333 +5 2489.36 1378.418333 +6 852.04 1879.384167 +6 975.86 1879.384167 +6 1082.92 1879.384167 +6 1121.29 1879.384167 +6 1133.12 1879.384167 +6 1558.44 1879.384167 +6 1581.26 1879.384167 +6 1654.62 1879.384167 +6 2408.41 1879.384167 +6 3334.37 1879.384167 +6 4855.76 1879.384167 +7 655.33 1433.785833 +7 691.77 1433.785833 +7 750.55 1433.785833 +7 862.94 1433.785833 +7 868.32 1433.785833 +7 992.39 1433.785833 +7 1209.78 1433.785833 +7 1694.72 1433.785833 +7 2081.47 1433.785833 +7 2257.98 1433.785833 +7 2383.35 1433.785833 +7 2756.83 1433.785833 +8 54.86 410.067500 +8 183.63 410.067500 +8 192.44 410.067500 +8 271.04 410.067500 +8 472.18 410.067500 +8 492.97 410.067500 +8 644.56 410.067500 +8 669.81 410.067500 +8 676.94 410.067500 +9 479.27 1306.207500 +9 572.00 1306.207500 +9 742.40 1306.207500 +9 759.92 1306.207500 +9 805.90 1306.207500 +9 993.12 1306.207500 +9 1030.85 1306.207500 +9 1764.83 1306.207500 +9 1826.50 1306.207500 +9 2065.07 1306.207500 +9 2158.76 1306.207500 +9 2475.87 1306.207500 +10 475.18 1442.284167 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q64.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q64.sql.out new file mode 100644 index 0000000000000..a803af3a52c21 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q64.sql.out @@ -0,0 +1,14 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +ablepricallyantiought ation 35709 996 NULL Bridgeport 65817 752 Lakeview Lincoln Friendship 74536 1999 1 15.78 24.93 0.00 17.09 26.31 0.00 2000 1 +ablepricallyantiought ation 35709 71 River River Friendship 34536 NULL NULL Newport NULL 1999 1 22.60 38.87 0.00 17.09 26.31 0.00 2000 1 +ablepricallyantiought bar 31904 128 East Franklin 19101 990 2nd Friendship 94536 1999 1 54.76 78.30 0.00 15.80 23.54 0.00 2000 1 +ationbarpri ation 35709 362 Central Ridge Oakland 69843 666 13th Ridge Shiloh 29275 1999 1 74.00 95.46 0.00 11.32 20.94 0.00 2000 1 +ationbarpri ese 31904 759 Elm Pine Belmont 20191 35 Madison Waterloo 31675 1999 1 12.92 22.22 0.00 24.15 36.70 0.00 2000 1 +ationbarpri ese 31904 759 Elm Pine Belmont 20191 35 Madison Waterloo 31675 1999 1 12.92 22.22 0.00 83.87 147.61 0.00 2000 1 +ationbarpri ought 31904 754 NULL NULL 65804 897 8th Ashland 54244 1999 1 74.70 90.38 0.00 12.02 12.74 0.00 2000 1 +ationbarpri ought 31904 754 NULL NULL 65804 897 8th Ashland 54244 1999 1 74.70 90.38 0.00 28.08 38.18 0.00 2000 1 +ationbarpri ought 31904 754 NULL NULL 65804 897 8th Ashland 54244 1999 1 74.70 90.38 0.00 56.60 63.39 0.00 2000 1 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q65.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q65.sql.out new file mode 100644 index 0000000000000..16a7d8785e484 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q65.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +able Academic concerns help during a courses. Hard, working-class types concentrate in a costs. Commercial shares work directly additional, ordinary orders. Profi 29.50 3.57 2.92 amalgamalg #x +able Available ministers s 20.59 7.69 3.99 exportiimporto #x +able Before main women cover so rive 35.39 4.63 2.36 importoamalg #x +able Days will lift for a months. Public differences could like 30.44 1.78 0.99 importoexporti #x +able Fields expire perhaps available schools. Common machines allow later employees; lawyers will pull worldwide objectives. Hidden orders may turn well fo 19.20 88.16 54.65 importoimporto #x +able General, sure features drop for the time being integrated proposals. Occasionally eastern generations might not arrive today ever vast opportunities. Soft attacks used to sell 31.34 1.16 0.90 exportiexporti #x +able Lost, individual parents rally. Then various differences shall fill never private strong courts. Successfully global directors clean medical 2.94 8.89 5.95 edu packimporto #x +able Members say then authorities. Various wome 32.82 1.34 1.17 amalgamalgamalg #x +able National, round fields would not accomp 32.77 0.17 0.05 amalgnameless #x +able New measures shall pay under a agencies; comparatively heavy police shall beat similarly concepts. However japanese times cannot check like a police. Long, long-term auth 21.49 1.87 1.19 amalgnameless #x +able Only concerned times used to know however in the trees. Developers might not wear in the times. Studies see far variations. Calculations must not transport hardl 32.50 0.15 0.12 corpmaxi #x +able Only, foreign problems make in a women. Naturally very countries will beli 13.72 7.58 5.15 scholarunivamalg #x +able Perfect grants fight highly as great minutes. Severe, available millions like counties. Young legs cook however from a years. Early armed services reject yet with 23.87 4.31 2.84 scholarnameless #x +able Popular, ethical types must see human, central steps. Other options spare products; large, odd machines must fill clear, public users. Away local teachers make l 25.26 8.08 5.73 amalgexporti #x +able Privileges cut perhaps reasons. Ideas finish times. Women envy general programmes. Hands shall unveil never to a facilities; official proposals conform. Scot 18.45 7.52 4.73 univmaxi #x +able Probably suitable compan 21.47 2.39 1.29 importobrand #x +able Royal speeches take evil, front margins. For example hard events ought to go angles. Possible, foreign lakes shall not reconsider. Other honours hear momen 7.23 8.13 2.84 scholarnameless #x +able Rules offer. Important, italian goo 9.19 4.06 2.51 scholarmaxi #x +able Ships could not introduce as. Complete equations take different, european names. Respondents would help fine styles; really formal workers 32.96 2.55 2.04 edu packunivamalg #x +able Stores visit values. Others cannot hang around rather civil brothers. Direct systems go then free, other instructions. Difficult, top feet will al 33.93 13.91 6.39 exportinameless #x +able Systematic 12.54 2.98 2.17 amalgbrand #x +able Times concentrate religious forms. Soon social agents understand again on a officials. Miles w 25.36 5.16 2.58 importoexporti #x +ation Areas establish in 28.85 93.54 69.21 amalgunivamalg #x +ation Arrangements 26.15 0.27 0.20 edu packunivamalg #x +ation Boring areas used to print; companies delegate lines. Clients shall amount also then 18.54 3.84 1.84 importoexporti #x +ation Deliberately ordinary procedures will not pay by a months. Feet reach very s 34.44 9.43 5.46 univunivamalg #x +ation Ears might remind far charges. Pleased years discharge oth 24.58 2.73 1.22 edu packbrand #x +ation However old figures ask only good, large sources. Yet naked researchers shall deal to a women. Right, common miles describe there also prime bags. Readily significant shares 21.02 7.78 4.97 brandbrand #x +ation Just possible women say. Reasonably strong employers light almost degrees. Palestinian, smart rules help really visual 33.67 3.71 2.26 scholarbrand #x +ation Local years may not seek formally hard, interesting properties. Local values serve. Nevertheless private tales c 28.58 8.36 5.68 corpunivamalg #x +ation Much present elements regard previously glorious homes. Important, royal judges can ad 12.98 8.12 6.41 edu packscholar #x +ation Police succeed schools; supplies calculate far countries; new words move shares; officers must complete years. Asian things may bear warm things. Aw 29.31 6.66 2.26 univnameless #x +ation Respondents see also. Sure, american horses must go actually election 34.94 0.85 0.50 exportiamalg #x +ation Small, japanese rights will not think enough on the cars. Very fond hospitals may choose originally. Right, other businesses relish. As large decades include federal tears. Usual, important quar 21.23 3.63 1.81 amalgscholar #x +ation Technical, open seats used to become accordingly. Real, actual qualifications may not carry highly interesting others. Wide, sexual knees may stay expenses. Labour, american 30.78 0.61 0.51 exportiedu pack #x +ation Ultimately good sets could go short, early examinations. Things ought to know relatively. Linguistic, applicable children establish curiou 35.23 6.22 3.54 importoimporto #x +ation Unacceptable flowers should not give reasonable, ethnic governments. Employees shall complain 35.82 8.39 5.87 corpmaxi #x +bar Also coming years need with a faces; fresh poems judge for example already thick choices. Hands help individual, relevant samples. Together british fingers would not spe 23.68 2.15 0.98 edu packexporti #x +bar Bad, recent right 31.34 0.96 0.57 importoimporto #x +bar Cards should strike largely in a concessions. Still true signs might talk; essentially ro 29.21 55.23 48.05 importoamalg #x +bar Cases must not spend on 14.60 1.30 1.17 importoimporto #x +bar Cold, old days stem thereby difficult, nuclear men; likely contents shall threaten often outer years. All real or 3.53 9.08 3.35 edu packnameless #x +bar Conscious, solar ambitions support outside countries; warm facilities rise occupations. Appropriate columns grow. Availabl 26.55 3.35 2.84 importonameless #x +bar General, legal businesses should use completely expensive teachers. Linguistic friends vote problem 0.21 0.53 0.32 scholarbrand #x +bar High, official employees shall not start too left circumstances. Patients used to touch obviously popular, senior members. British, impossible theories make only. Young, international wo 28.68 4.85 3.63 edu packmaxi #x +bar However old hours ma 22.18 8.84 5.65 exportimaxi #x +bar Illegal technologies might distinguish that on a change 12.14 2.73 1.28 namelessmaxi #x +bar Never various elements play other rights 30.37 0.37 0.28 edu packscholar #x +bar Newspapers would ensure certainly short inadequate problems. Bedrooms would argue however halfway bad coun 29.16 2.78 1.69 scholarcorp #x +bar Only groups will not prove united, furious results. Papers shall think in a opportunities; techniques decide that. American, initial forces might mean previous books. That delighted arts give so dimen 28.98 2.78 1.64 exportiimporto #x +bar Open prod 11.05 2.74 1.53 edu packunivamalg #x +bar Presidential, mild tests justify yesterday unusual points. Notable individuals can set only external trousers. Here french letters may photogra 27.05 2.44 2.17 importoimporto #x +bar Prices acquire more out of a christians. Efficiently local prices 20.48 2.11 0.78 exportimaxi #x +bar Rare, full workers stay plant 8.61 0.55 0.34 exportiimporto #x +bar Social pieces become; reservations rescue probably old hopes. Different, high records buy just general centuries. Recently industrial relationships cannot 16.63 9.15 5.03 importoedu pack #x +bar Though private depths accomplis 12.68 0.58 0.23 amalgamalgamalg #x +bar Thus certain stars appear totally even local guests. Urban friends might not take properly various vehicles 35.61 4.55 2.09 amalgunivamalg #x +bar Traditional legs pull at least better difficult circumstances; other, inner clients step burning arms; able, numerous weapons keep li 3.50 45.72 20.11 amalgscholar #x +bar Unknown topics ought to answer far present pictures. Estimated considerations might meet 32.53 2.55 1.32 exportiamalg #x +bar Widely splendid others deprive only. Different, main soldiers discover then other periods. Too main birds must change public, terrible houses. Different, armed females may foster; science 22.86 4.26 3.36 amalgunivamalg #x +eing Formerly central designers must not save. Scottish, small horses elicit men. British, fine companies pay little taxes; here pure lakes should benefit however small top countr 33.81 0.51 0.31 exportiamalg #x +eing Forms shall involve then normal bodies. Left words may find 11.97 2.02 0.64 edu packexporti #x +eing Front elections ensure to a adults; valuable moments decide in a aspects. Marked books stand rooms. Expectations ought 37.36 59.51 43.44 amalgimporto #x +eing Gradual volunteers keep bc months. Calls get pleasantly questions. Repre 12.82 1.61 1.07 edu packexporti #x +eing Gradually new flowers support suddenly. Left, light errors ought to steal other memories. Periods should not say never to a nurses; 31.57 2.05 1.12 edu packamalg #x +eing Great, possible children used to 11.87 4.00 2.60 namelessnameless #x +eing Neat, desirable words make especially gradu 25.33 7.11 3.76 amalgnameless #x +eing Never top observations spend appropriate, common states. Homes make. There available hospitals will appreciate away upon a years. Roots hang 31.15 2.07 0.84 edu packnameless #x +eing Often 21.89 7.85 4.16 amalgscholar #x +eing Poor years produce questions. Marine events ensure inner systems. Individuals could kill to a managers. Drugs should not authorise thankfully traditional, strong holders. Just amazing injuri 19.66 4.11 3.16 importoimporto #x +eing Sensibly foreign parties must not suffer well indian personal students. About private cattle handle th 4.79 2.42 1.01 amalgscholar #x +eing Silver, political interviews might know in common families. Far possible houses shall insist in a places. Whole, political gardens would adopt eggs. Others might live even offi 33.77 6.13 2.88 namelessmaxi #x +eing Social areas undergo actually within a plants. More communist days would play on a books. Later educational policies shoul 30.97 5.52 2.92 exportiunivamalg #x +eing Soon artificial notions think no longer lights; clearly late members could not trace good countries. Cultures can proceed away wealthy 0.98 2.38 1.68 exportibrand #x +ese Additional, interior police provide words. Different, long qualities answer really concerns; then other words state dry, political services. Awfully di 15.35 9.78 7.53 corpbrand #x +ese Concer 32.51 9.66 8.11 amalgamalg #x +ese Constitutional, good pupils might not begin below level devices. External savings fit hardly. Parents shall dry. Actually literary companies improve a 17.22 4.22 2.40 scholarunivamalg #x +ese Earnings feel possibilities. Single, poor problems make full, sho 29.18 2.75 1.62 maximaxi #x +ese Financial, likely artists assume now c 5.10 5.63 2.42 importoamalgamalg #x +ese Forces enter efficient things. S 23.42 2.64 0.81 amalgamalgamalg #x +ese Forward new lights should not meet once yesterday national buildings. Natural, australian eyes may not fetch progressively unfair 29.40 7.87 5.66 amalgimporto #x +ese Fresh respondents would not encourage in a years. 26.81 3.90 1.67 importoimporto #x +ese Goals ought to strengthen. Early industries would take. Early men could hear then. Difficult, new machines endorse 9.97 1.24 0.57 importoamalg #x +ese Identical solicitors must maintain sources. Factors take already unusual minutes. Just various sales sell agricultural, long states. 27.99 3.77 1.16 maxinameless #x +ese In order turkish meanings should involve nevertheless to a inches. Common, free colleagues may know other, safe services. So sure plates might go hidden, formidable powers. Domes 33.33 1.12 0.35 namelesscorp #x +ese Just associated missiles could 20.43 1.23 0.46 edu packedu pack #x +ese Meanwhile single companies shall go either in a statements. Vo 9.56 7.96 3.42 corpbrand #x +ese Models feel figures. Homes get still at the positions. Political, other makers will make there in the servants; necessary, technical markets should not cope also; warm, 32.66 6.16 4.49 univbrand #x +ese New interests must turn largely. High, essential females mark. Gradual police would not exercise old, national 23.00 6.87 2.33 edu packcorp #x +ese Parliamentary pieces shine never tragic patterns. Great human eyes would not get groups. Plant 9.58 6.03 4.82 scholarmaxi #x +ese Photographs get everywhere merely 13.94 3.75 2.96 exportiamalg #x +ese Plates shall think; new, economic pupils collect entirely. Really powerful books develop yet girls. Best unlik 33.09 3.44 2.99 namelessbrand #x +ese Proposals should involve more soviet, young islands. Little resources try even books. Fundamental systems end recent, total provisions. Working-class matte 30.46 5.15 3.60 exportischolar #x +ese Public operations need wonderfully improved routes; days may not admit for a circles. Able, wise girls lay later. Authorities know really reasons. Scottish accountants take customs. 2.20 1.40 0.99 amalgimporto #x +ese Sharply bright systems used to want. Other projects should benefit. Common parts use 35.01 1.16 0.39 importoexporti #x +ese Short, known programmes reject quite documents. Really interna 7.78 36.94 22.90 univamalgamalg #x +ese Small years could spend soon 31.85 0.55 0.39 importoscholar #x +ese Special gates decide mutually. Current, appropriate terms feel thus better royal arms. Children starve; likely girls make yesterday local workers. 26.14 2.93 1.11 exportischolar #x +ese There round authorities will show in a seasons. Other, far firms miss very mad, private lips. Powerful, m 16.77 5.93 4.44 importoamalg #x +ese Women get also chairs. Full, integrated paintings sit 1.47 6.34 2.15 scholarnameless #x diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q66.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q66.sql.out new file mode 100644 index 0000000000000..3287cb908761f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q66.sql.out @@ -0,0 +1,10 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +Just good amou 933435 Midway Williamson County TN United States DHL,BARIAN 2001 9246702.65 4973596.11 8243830.24 11536095.04 8848441.04 6589907.46 14946163.85 24260830.90 23156311.42 21897174.69 33046376.63 24591398.12 9.906102353136 5.328272573880 8.831713231238 12.358755606978 9.479439961004 7.059846116762 16.012002817550 25.990916239481 24.807631404437 23.458703273394 35.402975708003 26.345056827738 29452942.94 19052763.82 30303577.65 28563648.00 19179558.75 25111623.08 26955891.11 62345171.47 55967232.63 60120132.61 94483100.18 85104727.47 +Matches produce 198821 Midway Williamson County TN United States DHL,BARIAN 2001 8171037.69 7444707.30 8904945.91 8019953.83 13081755.25 8229030.48 11805829.83 25145588.96 15707862.93 18731722.90 27837144.77 33176280.56 41.097457964702 37.444270474447 44.788759285990 40.337559060662 65.796647486935 41.389141388486 59.379189471937 126.473506118569 79.005049416309 94.214006065758 140.011089220958 166.865072401809 25824877.19 17086383.78 24620145.44 28759520.46 24988081.00 21709799.17 25386565.52 54025360.94 54325725.26 59965431.57 75829271.22 85511883.03 +Operations 500020 Fairview Williamson County TN United States DHL,BARIAN 2001 10409399.91 16141530.81 8148742.71 6680962.19 11728095.96 9767093.38 11458408.56 20106135.67 25314120.67 22893962.36 35876332.21 28738513.96 20.817967101315 32.281770349186 16.296833546658 13.361389924403 23.455253709851 19.533405423783 22.915900483980 40.210662913483 50.626216291349 45.786093276269 71.749794428223 57.474728930843 18813981.10 29928354.06 20237634.01 22392433.57 25938775.04 28927292.16 25641922.14 60075246.63 49668486.97 68646750.13 88585464.12 75478344.38 +Selective, 720621 Fairview Williamson County TN United States DHL,BARIAN 2001 10540885.44 8098669.29 9370217.14 9753408.96 9006503.21 7725824.55 12918857.72 27286339.36 17315063.55 22573845.28 39002921.92 33502638.23 14.627502445808 11.238458621106 13.002975405935 13.534727630752 12.498252493335 10.721064956475 17.927395565769 37.865034962900 24.027975246350 31.325544606665 54.124042901886 46.491343202599 27419902.20 22882381.71 25735954.25 18682264.05 24373316.64 27192350.35 33019111.44 54462656.98 50994470.37 58509681.21 88329849.81 100833156.77 +Significantly 200313 Fairview Williamson County TN United States DHL,BARIAN 2001 9802846.67 12625248.69 6602477.32 11033269.92 6082390.20 15618748.55 5368995.93 19287503.44 21876336.16 23132474.86 35201297.49 21425392.36 48.937645934113 63.027605247787 32.960802943393 55.080149166554 30.364430666008 77.971717012875 26.803032903506 96.286828313689 109.210765951287 115.481645524754 175.731467703044 106.959570072836 23574229.26 27163084.88 24006453.37 23356164.02 19405795.41 35795815.91 25006450.52 58626312.30 57258316.63 60471338.55 83474267.08 73080652.01 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q67.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q67.sql.out new file mode 100644 index 0000000000000..dbb955dcae502 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q67.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL NULL NULL NULL NULL NULL NULL 672624.93 5 +NULL NULL NULL NULL NULL NULL NULL NULL 1328761.89 4 +NULL NULL NULL NULL NULL NULL NULL NULL 1867833.60 3 +NULL NULL NULL NULL NULL NULL NULL NULL 2951322.99 2 +NULL NULL NULL NULL NULL NULL NULL NULL 1012102066.67 1 +NULL NULL NULL NULL 2000 NULL NULL NULL 672624.93 5 +NULL NULL NULL NULL 2000 1 NULL NULL 109354.01 39 +NULL NULL NULL NULL 2000 1 1 NULL 56696.62 88 +NULL NULL NULL NULL 2000 2 NULL NULL 117554.43 24 +NULL NULL NULL NULL 2000 2 6 NULL 50119.54 93 +NULL NULL NULL NULL 2000 3 NULL NULL 147622.32 12 +NULL NULL NULL NULL 2000 3 8 NULL 64629.56 85 +NULL NULL NULL NULL 2000 3 9 NULL 59755.91 86 +NULL NULL NULL NULL 2000 4 NULL NULL 298094.17 7 +NULL NULL NULL NULL 2000 4 10 NULL 96651.33 58 +NULL NULL NULL NULL 2000 4 10 AAAAAAAAKAAAAAAA 41992.37 100 +NULL NULL NULL NULL 2000 4 11 NULL 110100.01 35 +NULL NULL NULL NULL 2000 4 12 NULL 91342.83 68 +NULL NULL NULL ationesebareing NULL NULL NULL NULL 136570.22 16 +NULL NULL NULL ationesebareing 2000 NULL NULL NULL 136570.22 16 +NULL NULL NULL ationesebareing 2000 4 NULL NULL 54262.81 90 +NULL NULL NULL eseationablebarought NULL NULL NULL NULL 106226.70 44 +NULL NULL NULL eseationablebarought 2000 NULL NULL NULL 106226.70 44 +NULL NULL NULL eseationablebarought 2000 4 NULL NULL 46143.77 96 +NULL NULL NULL n stought NULL NULL NULL NULL 90518.72 69 +NULL NULL NULL n stought 2000 NULL NULL NULL 90518.72 69 +NULL NULL NULL oughtableantiable NULL NULL NULL NULL 96782.30 52 +NULL NULL NULL oughtableantiable 2000 NULL NULL NULL 96782.30 52 +NULL NULL NULL oughtableantiable 2000 4 NULL NULL 49543.67 94 +NULL NULL NULL oughtablen stationought NULL NULL NULL NULL 105616.28 46 +NULL NULL NULL oughtablen stationought 2000 NULL NULL NULL 105616.28 46 +NULL NULL NULL oughtablen stationought 2000 4 NULL NULL 66351.81 84 +NULL NULL NULL oughteseoughtation NULL NULL NULL NULL 120422.74 22 +NULL NULL NULL oughteseoughtation 2000 NULL NULL NULL 120422.74 22 +NULL NULL NULL oughteseoughtation 2000 3 NULL NULL 51575.65 92 +NULL NULL NULL oughteseoughtation 2000 4 NULL NULL 53356.26 91 +NULL NULL brandcorp #x NULL NULL NULL NULL NULL 110558.31 32 +NULL NULL brandcorp #x esepriantieing NULL NULL NULL NULL 110558.31 32 +NULL NULL brandcorp #x esepriantieing 2000 NULL NULL NULL 110558.31 32 +NULL NULL brandcorp #x esepriantieing 2000 4 NULL NULL 57539.32 87 +NULL NULL corpamalgamalg #x NULL NULL NULL NULL NULL 178041.47 9 +NULL NULL corpamalgamalg #x callyationationantiought NULL NULL NULL NULL 178041.47 9 +NULL NULL corpamalgamalg #x callyationationantiought 2000 NULL NULL NULL 178041.47 9 +NULL NULL corpamalgamalg #x callyationationantiought 2000 4 NULL NULL 92734.16 59 +NULL NULL corpmaxi #x NULL NULL NULL NULL NULL 140599.56 13 +NULL NULL corpmaxi #x callyeingpri NULL NULL NULL NULL 140599.56 13 +NULL NULL corpmaxi #x callyeingpri 2000 NULL NULL NULL 140599.56 13 +NULL NULL corpmaxi #x callyeingpri 2000 4 NULL NULL 68417.63 83 +NULL NULL corpmaxi #x callyeingpri 2000 4 11 NULL 44322.49 99 +NULL NULL importoamalg #x NULL NULL NULL NULL NULL 109872.37 36 +NULL NULL importoamalg #x NULL NULL NULL NULL NULL 109872.37 36 +NULL NULL importoamalg #x NULL 2000 NULL NULL NULL 109872.37 36 +NULL accessories NULL NULL NULL NULL NULL NULL 102003.04 48 +NULL accessories NULL NULL NULL NULL NULL NULL 102003.04 48 +NULL accessories NULL prin stn stoughtought NULL NULL NULL NULL 102003.04 48 +NULL accessories NULL prin stn stoughtought 2000 NULL NULL NULL 102003.04 48 +NULL accessories NULL prin stn stoughtought 2000 4 NULL NULL 56122.71 89 +NULL athletic NULL NULL NULL NULL NULL NULL 72722.46 79 +NULL athletic NULL NULL NULL NULL NULL NULL 72722.46 79 +NULL athletic NULL NULL NULL NULL NULL NULL 72722.46 79 +NULL athletic NULL NULL 2000 NULL NULL NULL 72722.46 79 +NULL baseball NULL NULL NULL NULL NULL NULL 96654.08 54 +NULL baseball NULL NULL NULL NULL NULL NULL 96654.08 54 +NULL baseball NULL NULL NULL NULL NULL NULL 96654.08 54 +NULL baseball NULL NULL 2000 NULL NULL NULL 96654.08 54 +NULL baseball NULL NULL 2000 3 NULL NULL 44473.92 98 +NULL country NULL NULL NULL NULL NULL NULL 114628.36 25 +NULL country importoscholar #x NULL NULL NULL NULL NULL 114628.36 25 +NULL country importoscholar #x NULL NULL NULL NULL NULL 114628.36 25 +NULL country importoscholar #x NULL 2000 NULL NULL NULL 114628.36 25 +NULL country importoscholar #x NULL 2000 4 NULL NULL 44753.51 97 +NULL dresses NULL NULL NULL NULL NULL NULL 77687.53 72 +NULL dresses NULL NULL NULL NULL NULL NULL 192205.73 8 +NULL dresses NULL oughteingantieing NULL NULL NULL NULL 77687.53 72 +NULL dresses NULL oughteingantieing 2000 NULL NULL NULL 77687.53 72 +NULL dresses amalgamalg #x NULL NULL NULL NULL NULL 114518.20 29 +NULL dresses amalgamalg #x NULL NULL NULL NULL NULL 114518.20 29 +NULL dresses amalgamalg #x NULL 2000 NULL NULL NULL 114518.20 29 +NULL dresses amalgamalg #x NULL 2000 4 NULL NULL 49313.59 95 +NULL guns NULL NULL NULL NULL NULL NULL 92681.88 60 +NULL guns NULL NULL NULL NULL NULL NULL 92681.88 60 +NULL guns NULL NULL NULL NULL NULL NULL 92681.88 60 +NULL guns NULL NULL 2000 NULL NULL NULL 92681.88 60 +NULL infants NULL NULL NULL NULL NULL NULL 129135.94 18 +NULL infants importoexporti #x NULL NULL NULL NULL NULL 129135.94 18 +NULL infants importoexporti #x antiationeseese NULL NULL NULL NULL 129135.94 18 +NULL infants importoexporti #x antiationeseese 2000 NULL NULL NULL 129135.94 18 +NULL infants importoexporti #x antiationeseese 2000 4 NULL NULL 80824.80 71 +NULL lighting NULL NULL NULL NULL NULL NULL 107477.64 40 +NULL lighting NULL NULL NULL NULL NULL NULL 107477.64 40 +NULL lighting NULL NULL NULL NULL NULL NULL 107477.64 40 +NULL lighting NULL NULL 2000 NULL NULL NULL 107477.64 40 +NULL mens NULL NULL NULL NULL NULL NULL 91415.81 64 +NULL mens importoedu pack #x NULL NULL NULL NULL NULL 91415.81 64 +NULL mens importoedu pack #x oughtablen steseought NULL NULL NULL NULL 91415.81 64 +NULL mens importoedu pack #x oughtablen steseought 2000 NULL NULL NULL 91415.81 64 +NULL shirts NULL NULL NULL NULL NULL NULL 72876.08 75 +NULL shirts NULL NULL NULL NULL NULL NULL 72876.08 75 +NULL shirts NULL oughtcallyeseantiought NULL NULL NULL NULL 72876.08 75 +NULL shirts NULL oughtcallyeseantiought 2000 NULL NULL NULL 72876.08 75 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q68.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q68.sql.out new file mode 100644 index 0000000000000..11a564346ec52 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q68.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL Salem Lakeside 2203 23464.72 675.04 46100.94 +NULL Ira Riverdale Oak Ridge 10508 32911.54 938.79 59812.32 +NULL Rebecca Belmont Marion 13206 14180.52 1072.25 23887.85 +NULL NULL Pleasant Valley Lincoln 20829 16340.86 289.50 34809.84 +NULL Joel Oak Hill Clifton 21390 19561.57 939.54 46319.37 +NULL Max Stringtown Pine Grove 22049 20059.77 974.94 38268.07 +NULL NULL Bridgeport Riverside 23264 10699.95 496.36 29285.70 +NULL NULL White Oak Pleasant Hill 24860 16258.45 733.62 52186.60 +NULL Rebecca Union Hill Farmington 26031 7636.54 515.78 13443.39 +NULL Alecia Jamestown Oakdale 30174 29125.41 1118.58 69857.70 +NULL Raymond Bunker Hill Clifton 30655 27237.08 1237.59 51322.22 +NULL NULL Pleasant Valley Riley 30915 25079.14 998.46 35200.27 +NULL David Glendale Greenville 33716 15434.87 1012.60 30661.71 +NULL NULL New Hope Farmington 38760 29150.85 647.52 50433.60 +NULL Norma Hamilton Macedonia 41929 35397.41 1268.87 55360.80 +NULL NULL Wildwood Allison 45786 10448.67 492.27 32424.46 +NULL NULL Greenville Spring Hill 47915 26747.77 512.05 57910.19 +NULL Jerome Galena Georgetown 50559 33831.95 890.50 57970.13 +NULL NULL Woodlawn Springfield 59625 22470.48 828.96 54458.90 +NULL NULL Hillcrest Cordova 64306 10534.53 295.14 15380.96 +NULL John Stringtown Arlington 64522 21495.01 783.81 45067.59 +NULL NULL Gladstone Summit 66488 20881.36 605.92 32362.22 +NULL NULL Hopewell Riverdale 67278 24471.59 1549.17 48406.81 +NULL Russel Red Hill Woodland 82061 17750.10 1025.09 40565.68 +NULL NULL Mount Olive Maple Grove 82183 16184.99 573.72 44448.96 +NULL NULL Shady Grove Springdale 91775 17103.31 911.07 35127.63 +NULL NULL Indian Village Golden 98530 18842.65 1005.52 40742.92 +NULL NULL Greenfield Farmington 98985 13264.63 589.99 20576.04 +NULL Virginia Five Forks Oakland 106543 24859.75 1006.88 39693.34 +NULL NULL Scottsville Greenfield 107236 14638.50 802.00 35356.18 +NULL Virginia Oak Hill Amherst 109641 7667.92 271.98 30755.88 +NULL NULL Midway New Hope 113272 50295.57 2963.67 78595.37 +NULL William Valley View Providence 115559 29947.61 673.81 50883.54 +NULL NULL Newport Indian Village 120966 15268.90 721.76 27022.81 +NULL Robert Cedar Grove Riverside 122552 20398.86 1049.35 44761.40 +NULL NULL Jamestown Spring Valley 125125 31795.01 1364.75 52740.75 +NULL NULL Liberty Oakwood 128427 41495.05 2399.87 77105.28 +NULL Brandon Arlington Woodland 135601 43789.02 1493.45 66479.43 +NULL Juan Mount Pleasant Greenwood 138846 12326.46 472.96 25735.00 +NULL NULL Shirley Fairview 143290 19808.13 596.98 34256.82 +NULL NULL White Oak Ferguson 146537 5235.24 246.72 11343.46 +NULL Luther Greenville Hillcrest 149654 27079.37 939.22 41067.50 +NULL Michelle Fairview Hopewell 149783 29018.58 1426.60 48040.63 +NULL Angelica Barnes Plainview 151659 21082.45 306.14 40857.65 +NULL Donna Centerville Friendship 152588 20862.64 969.20 46304.16 +NULL Brian Oak Ridge Woodville 152862 22493.16 1611.93 43153.08 +NULL NULL Stringtown Liberty 158006 16267.97 450.16 25629.75 +NULL Daniel Globe Spring Valley 161922 15092.01 847.21 42715.60 +NULL Marlene Georgetown Oakland 163799 42790.16 1130.51 77449.21 +NULL Dean Lakeview New Hope 167847 24431.20 1333.52 38658.46 +NULL NULL Greenfield Hopewell 168370 13878.80 617.56 31230.84 +NULL Robert Four Points Farmington 176911 14828.21 674.85 32517.24 +NULL Betty Lakewood Sulphur Springs 178057 15008.49 693.61 25864.62 +NULL NULL Harmony Spring Valley 178332 10288.94 631.05 35516.38 +NULL NULL Enterprise Bunker Hill 182211 14072.57 405.42 33771.00 +NULL NULL Salem Valley View 187904 15702.34 439.59 41237.94 +NULL Faye Walnut Grove Oakland 189770 18527.90 1113.75 39987.40 +NULL Debra Green Acres Woodlawn 192040 9053.50 169.31 13181.96 +NULL NULL Salem Antioch 192673 5412.31 119.61 12746.52 +NULL NULL Mount Olive Mount Pleasant 197746 32038.93 1017.39 87608.72 +NULL Nancy Shady Grove Hillcrest 201415 14985.28 328.13 21957.26 +NULL Scott Hillcrest Louisville 203119 8629.88 329.70 14712.89 +NULL NULL Plainview Oak Grove 203425 33448.32 1632.67 62674.71 +NULL NULL Rocky Hill Providence 211665 15060.41 598.75 29385.31 +NULL Tonya Buena Vista Bunker Hill 213228 46912.33 2039.49 81223.03 +NULL Troy Plainview Ashland 216821 45620.34 2295.90 74013.12 +NULL Sandra Unionville Hopewell 221077 8341.60 527.66 17817.11 +NULL Robert Summit Five Points 224508 15607.69 500.96 37984.93 +NULL Rebecca Union Hill Mountain View 225489 35322.48 1859.03 58568.59 +NULL Jack Sunnyside Lakeview 231229 16186.51 577.86 30596.37 +NULL NULL Bethel Sunnyside 233081 13271.69 468.80 32129.60 +NULL Alice Oak Grove Marion 233656 30278.85 1490.14 65326.68 +NULL Shayne Riverview Crossroads 234750 20554.66 737.10 52975.61 +NULL Kevin Buena Vista Clifton 239837 28589.10 999.94 48962.74 +Aaron Nick Harmony Edgewood 73734 29649.48 959.10 56974.10 +Abney Janice Mount Zion Enterprise 27585 16154.82 636.94 37751.16 +Abraham Gerald Pleasant Grove Midway 1779 8661.58 330.60 14811.87 +Abrams Alma Fairfield Macedonia 33078 28262.54 808.09 48263.03 +Adame Brian Marion Forest Hills 142280 15398.91 717.67 52277.17 +Adams Adam The Meadows Glenwood 35054 33420.92 1477.44 37326.99 +Adams Paulette Tremont Lakeside 82644 25822.05 365.13 46273.62 +Adams Edwin Plainview Greenwood 108138 23483.91 982.40 35181.82 +Adams Nichole Edgewood Friendship 171894 20821.96 1333.70 48375.06 +Adams NULL Oakland Oak Ridge 173206 18700.18 1085.29 29361.60 +Adams Nichole Edgewood Green Acres 180862 17519.04 657.52 33555.87 +Adams Donna Plainview Liberty 219849 18150.78 448.49 22444.41 +Aguilar Jeannine Unionville Jackson 152737 34732.21 1299.63 56844.65 +Ahmed Jeffrey Stewart Edgewood 202936 27333.88 948.83 39990.68 +Albert Sally Nottingham Mount Zion 7000 11496.97 305.77 28524.27 +Albrecht Bob Marion Pleasant Hill 60194 23528.46 1101.20 43551.97 +Alcorn Jeffery Cedar Grove Salem 46467 17634.79 785.53 57718.43 +Alderman Melanie Edgewood Mount Zion 14230 28157.47 270.85 48818.21 +Aldridge Daniel Berlin Wilson 114445 15440.33 552.85 22637.40 +Alger Beverly Allentown Riverview 173449 24541.75 797.49 48511.28 +Allen Brittany Lincoln Hillcrest 10696 17579.89 595.90 46637.81 +Allen Yvette Providence Flatwoods 73587 8938.13 561.96 27604.45 +Allen Lori Hamilton Greenwood 138690 16085.88 579.59 35840.88 +Allison Anya Union Ashland 79895 9453.18 499.78 22112.21 +Alvarez Terrence Concord Spring Valley 32211 13206.58 470.82 33690.82 +Alvarez Marie Walnut Grove Red Hill 206011 25535.02 1344.58 63224.42 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q69.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q69.sql.out new file mode 100644 index 0000000000000..bd90d440c523c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q69.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +F D 2 yr Degree 1 500 1 Low Risk 1 +F D 2 yr Degree 1 3000 1 High Risk 1 +F D 2 yr Degree 1 4500 1 Good 1 +F D 2 yr Degree 1 5000 1 Low Risk 1 +F D 2 yr Degree 2 6000 2 High Risk 2 +F D 2 yr Degree 1 6500 1 Good 1 +F D 2 yr Degree 1 7000 1 High Risk 1 +F D 2 yr Degree 1 8500 1 High Risk 1 +F D 2 yr Degree 1 8500 1 Low Risk 1 +F D 4 yr Degree 1 1000 1 High Risk 1 +F D 4 yr Degree 1 2500 1 Good 1 +F D 4 yr Degree 1 3000 1 Low Risk 1 +F D 4 yr Degree 1 3500 1 High Risk 1 +F D 4 yr Degree 1 3500 1 Unknown 1 +F D 4 yr Degree 1 4000 1 Unknown 1 +F D 4 yr Degree 1 4500 1 Unknown 1 +F D 4 yr Degree 1 6500 1 High Risk 1 +F D 4 yr Degree 1 7500 1 High Risk 1 +F D 4 yr Degree 1 8500 1 Low Risk 1 +F D 4 yr Degree 1 9000 1 Low Risk 1 +F D 4 yr Degree 1 9000 1 Unknown 1 +F D 4 yr Degree 1 10000 1 High Risk 1 +F D Advanced Degree 2 1000 2 Unknown 2 +F D Advanced Degree 1 1500 1 High Risk 1 +F D Advanced Degree 1 1500 1 Unknown 1 +F D Advanced Degree 1 3000 1 Good 1 +F D Advanced Degree 1 3000 1 Unknown 1 +F D Advanced Degree 1 6000 1 Low Risk 1 +F D Advanced Degree 1 8000 1 Unknown 1 +F D College 1 1000 1 Low Risk 1 +F D College 1 2000 1 High Risk 1 +F D College 3 2500 3 High Risk 3 +F D College 1 4000 1 High Risk 1 +F D College 1 5500 1 High Risk 1 +F D College 2 7500 2 Unknown 2 +F D College 1 8000 1 Good 1 +F D College 1 9000 1 Unknown 1 +F D Primary 1 500 1 Good 1 +F D Primary 1 1000 1 Unknown 1 +F D Primary 1 1500 1 Good 1 +F D Primary 1 2000 1 High Risk 1 +F D Primary 2 2000 2 Unknown 2 +F D Primary 1 2500 1 Unknown 1 +F D Primary 1 4000 1 Low Risk 1 +F D Primary 1 5000 1 High Risk 1 +F D Primary 1 6000 1 Unknown 1 +F D Primary 1 6500 1 High Risk 1 +F D Primary 1 7500 1 High Risk 1 +F D Primary 1 7500 1 Unknown 1 +F D Primary 1 8000 1 Low Risk 1 +F D Primary 2 9500 2 Low Risk 2 +F D Secondary 1 1500 1 High Risk 1 +F D Secondary 1 2000 1 Unknown 1 +F D Secondary 1 2500 1 High Risk 1 +F D Secondary 2 4000 2 High Risk 2 +F D Secondary 1 5000 1 Low Risk 1 +F D Secondary 1 6000 1 High Risk 1 +F D Secondary 1 10000 1 Low Risk 1 +F D Unknown 1 2000 1 High Risk 1 +F D Unknown 1 5000 1 Low Risk 1 +F D Unknown 1 6500 1 Good 1 +F D Unknown 1 8000 1 Unknown 1 +F D Unknown 1 9000 1 High Risk 1 +F M 2 yr Degree 1 500 1 High Risk 1 +F M 2 yr Degree 1 4000 1 Unknown 1 +F M 2 yr Degree 1 4500 1 Low Risk 1 +F M 2 yr Degree 1 5000 1 Unknown 1 +F M 2 yr Degree 1 5500 1 Low Risk 1 +F M 2 yr Degree 1 9000 1 Low Risk 1 +F M 2 yr Degree 1 10000 1 Low Risk 1 +F M 4 yr Degree 1 500 1 High Risk 1 +F M 4 yr Degree 1 1000 1 Good 1 +F M 4 yr Degree 1 2500 1 Good 1 +F M 4 yr Degree 1 3500 1 Low Risk 1 +F M 4 yr Degree 1 4500 1 Good 1 +F M 4 yr Degree 1 7000 1 Good 1 +F M 4 yr Degree 1 7500 1 Good 1 +F M 4 yr Degree 1 7500 1 High Risk 1 +F M 4 yr Degree 1 8000 1 Unknown 1 +F M 4 yr Degree 1 8500 1 High Risk 1 +F M 4 yr Degree 1 9000 1 Unknown 1 +F M 4 yr Degree 1 10000 1 Unknown 1 +F M Advanced Degree 1 3000 1 Unknown 1 +F M Advanced Degree 1 4000 1 Low Risk 1 +F M Advanced Degree 1 4500 1 Unknown 1 +F M Advanced Degree 1 6000 1 Unknown 1 +F M Advanced Degree 1 6500 1 High Risk 1 +F M Advanced Degree 1 8500 1 Good 1 +F M Advanced Degree 1 8500 1 High Risk 1 +F M College 1 1500 1 Unknown 1 +F M College 1 4500 1 Low Risk 1 +F M College 1 7000 1 Unknown 1 +F M College 1 8500 1 High Risk 1 +F M College 1 8500 1 Low Risk 1 +F M College 1 8500 1 Unknown 1 +F M College 1 9500 1 Good 1 +F M Primary 1 500 1 Unknown 1 +F M Primary 1 1000 1 Good 1 +F M Primary 1 4500 1 Low Risk 1 +F M Primary 1 5000 1 High Risk 1 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q7.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q7.sql.out new file mode 100644 index 0000000000000..6c4ec28f8ddc3 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q7.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAAAACAAAA 60.0 52.450000 0.000000 13.630000 +AAAAAAAAAAAEAAAA 96.0 51.560000 0.000000 46.400000 +AAAAAAAAAABEAAAA 8.0 135.430000 0.000000 105.630000 +AAAAAAAAAACAAAAA 43.0 90.780000 0.000000 17.240000 +AAAAAAAAAACCAAAA 31.0 80.140000 0.000000 74.530000 +AAAAAAAAAADBAAAA 79.0 99.440000 2573.530000 90.490000 +AAAAAAAAAADCAAAA 68.0 115.045000 0.000000 72.910000 +AAAAAAAAAAEAAAAA 42.0 16.800000 0.000000 13.770000 +AAAAAAAAAAEDAAAA 42.5 52.175000 0.000000 21.300000 +AAAAAAAAAAFAAAAA 32.0 24.750000 0.000000 23.510000 +AAAAAAAAAAGBAAAA 48.0 119.350000 0.000000 59.670000 +AAAAAAAAAAGCAAAA 54.0 39.420000 964.260000 30.305000 +AAAAAAAAAAHBAAAA 59.333333333333336 86.790000 198.126667 47.576667 +AAAAAAAAAAHDAAAA 82.0 26.030000 981.850000 26.030000 +AAAAAAAAAAKAAAAA 51.666666666666664 47.246667 0.000000 5.333333 +AAAAAAAAAAKBAAAA 11.0 114.560000 0.000000 90.500000 +AAAAAAAAAAKDAAAA 27.0 23.140000 0.000000 20.820000 +AAAAAAAAAALAAAAA 38.0 83.580000 0.000000 51.810000 +AAAAAAAAAALCAAAA 51.0 26.610000 0.000000 19.950000 +AAAAAAAAAAMBAAAA 79.0 41.660000 0.000000 38.740000 +AAAAAAAAAAMCAAAA 70.0 83.210000 0.000000 49.090000 +AAAAAAAAAANAAAAA 2.5 97.780000 0.000000 77.765000 +AAAAAAAAAAOAAAAA 60.0 101.410000 1674.240000 43.600000 +AAAAAAAAAAOCAAAA 7.0 185.510000 0.000000 109.450000 +AAAAAAAAAAPBAAAA 51.5 57.890000 839.850000 52.465000 +AAAAAAAAABABAAAA 20.0 19.300000 0.000000 0.770000 +AAAAAAAAABADAAAA 95.0 100.800000 0.000000 35.280000 +AAAAAAAAABAEAAAA 55.0 2.220000 0.000000 2.080000 +AAAAAAAAABBAAAAA 46.0 61.386667 0.000000 27.306667 +AAAAAAAAABBDAAAA 35.0 166.510000 166.080000 158.180000 +AAAAAAAAABCBAAAA 32.0 33.820000 175.495000 13.025000 +AAAAAAAAABDDAAAA 38.666666666666664 48.240000 1.143333 27.163333 +AAAAAAAAABDEAAAA 8.0 135.240000 38.095000 18.845000 +AAAAAAAAABECAAAA 13.0 73.870000 0.000000 64.260000 +AAAAAAAAABEDAAAA 98.0 76.895000 0.000000 25.375000 +AAAAAAAAABGAAAAA 81.0 46.320000 0.000000 26.580000 +AAAAAAAAABGDAAAA 88.0 81.150000 0.000000 43.820000 +AAAAAAAAABGEAAAA 81.0 18.760000 0.000000 7.310000 +AAAAAAAAABHAAAAA 61.5 101.695000 224.313333 33.520000 +AAAAAAAAABHDAAAA 51.0 128.445000 0.000000 83.725000 +AAAAAAAAABIBAAAA 51.0 20.940000 0.000000 6.490000 +AAAAAAAAABICAAAA 82.5 62.635000 0.860000 27.015000 +AAAAAAAAABJAAAAA 18.333333333333332 76.346667 167.953333 44.930000 +AAAAAAAAABKAAAAA 77.0 122.740000 0.000000 98.190000 +AAAAAAAAABKDAAAA 42.0 125.690000 1504.230000 37.700000 +AAAAAAAAABLBAAAA 59.0 118.240000 72.480000 9.450000 +AAAAAAAAABMBAAAA 97.5 91.465000 0.000000 60.660000 +AAAAAAAAABMDAAAA 46.0 171.290000 0.000000 92.490000 +AAAAAAAAABNCAAAA 20.0 109.530000 0.000000 97.480000 +AAAAAAAAABPAAAAA 59.25 47.130000 62.827500 29.995000 +AAAAAAAAABPBAAAA 66.0 53.950000 30.970000 46.930000 +AAAAAAAAABPDAAAA 66.5 52.420000 0.000000 30.925000 +AAAAAAAAACAAAAAA 45.0 75.860000 0.000000 22.750000 +AAAAAAAAACBBAAAA 64.5 27.585000 0.000000 16.820000 +AAAAAAAAACBCAAAA 71.0 47.330000 0.000000 18.450000 +AAAAAAAAACCDAAAA 68.0 92.350000 0.000000 41.550000 +AAAAAAAAACDAAAAA 21.0 64.390000 59.620000 13.520000 +AAAAAAAAACDDAAAA 65.66666666666667 34.473333 23.316667 14.916667 +AAAAAAAAACEBAAAA 48.0 111.330000 0.000000 12.240000 +AAAAAAAAACECAAAA 67.5 36.365000 373.635000 26.500000 +AAAAAAAAACFBAAAA 9.0 19.600000 0.000000 1.370000 +AAAAAAAAACFDAAAA 26.0 18.350000 0.000000 13.390000 +AAAAAAAAACGCAAAA 60.5 100.270000 0.000000 45.862500 +AAAAAAAAACGDAAAA 58.5 32.805000 396.170000 12.550000 +AAAAAAAAACHBAAAA 97.0 5.380000 27.470000 0.480000 +AAAAAAAAACIAAAAA 57.0 56.880000 0.000000 52.750000 +AAAAAAAAACIBAAAA 58.0 26.060000 152.250000 12.500000 +AAAAAAAAACIDAAAA 71.0 4.020000 0.000000 2.210000 +AAAAAAAAACJAAAAA 30.0 46.910000 0.000000 8.910000 +AAAAAAAAACJDAAAA 63.5 112.305000 0.000000 30.610000 +AAAAAAAAACKCAAAA 50.666666666666664 63.280000 0.000000 26.126667 +AAAAAAAAACLAAAAA 95.0 22.310000 0.000000 0.000000 +AAAAAAAAACLBAAAA 88.0 27.450000 0.000000 23.880000 +AAAAAAAAACMAAAAA 86.0 90.600000 1511.530000 87.880000 +AAAAAAAAACNBAAAA 44.666666666666664 73.076667 52.400000 54.546667 +AAAAAAAAACNCAAAA 62.0 105.380000 0.000000 70.600000 +AAAAAAAAACOAAAAA 41.0 42.810000 412.370000 10.700000 +AAAAAAAAACOBAAAA 36.5 66.735000 14.770000 33.725000 +AAAAAAAAACODAAAA 25.0 65.280000 238.920000 39.820000 +AAAAAAAAACPAAAAA 88.0 164.900000 104.470000 14.840000 +AAAAAAAAACPDAAAA 10.0 78.550000 0.000000 10.990000 +AAAAAAAAADABAAAA 81.0 60.225000 0.000000 43.775000 +AAAAAAAAADBDAAAA 2.0 94.600000 0.000000 59.590000 +AAAAAAAAADCAAAAA 52.0 72.480000 98.720000 15.350000 +AAAAAAAAADCCAAAA 89.0 61.690000 0.000000 59.220000 +AAAAAAAAADCDAAAA 27.5 126.585000 0.000000 61.340000 +AAAAAAAAADDBAAAA 64.0 19.570000 934.160000 16.040000 +AAAAAAAAADDEAAAA 65.0 78.255000 348.165000 49.595000 +AAAAAAAAADEAAAAA 65.0 108.640000 0.000000 91.250000 +AAAAAAAAADEBAAAA 70.0 104.400000 1189.580000 45.930000 +AAAAAAAAADEDAAAA 31.0 130.200000 0.000000 76.810000 +AAAAAAAAADFAAAAA 80.0 5.240000 0.000000 1.310000 +AAAAAAAAADFCAAAA 14.0 9.110000 0.000000 6.650000 +AAAAAAAAADGCAAAA 10.0 84.260000 0.000000 9.260000 +AAAAAAAAADGEAAAA 37.333333333333336 34.403333 101.936667 17.150000 +AAAAAAAAADHBAAAA 32.333333333333336 65.606667 751.803333 54.530000 +AAAAAAAAADJBAAAA 57.0 63.110000 0.000000 47.960000 +AAAAAAAAADKBAAAA 44.0 44.980000 0.000000 3.590000 +AAAAAAAAADLAAAAA 21.0 17.740000 0.000000 9.930000 +AAAAAAAAADMBAAAA 29.0 102.770000 2052.360000 72.960000 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q70.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q70.sql.out new file mode 100644 index 0000000000000..a28271a34dcb1 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q70.sql.out @@ -0,0 +1,8 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +-439591881.24 NULL NULL 2 1 +-439591881.24 TN NULL 1 1 +-439591881.24 TN Williamson County 0 1 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q71.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q71.sql.out new file mode 100644 index 0000000000000..502ee6a80b7ad --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q71.sql.out @@ -0,0 +1,1195 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +10016002 corpamalgamalg #x 19 7 23183.08 +10005002 scholarunivamalg #x 8 8 17109.63 +8014006 edu packmaxi #x 9 53 16420.75 +3003002 exportiexporti #x 17 44 16337.23 +3001001 amalgexporti #x 17 46 16088.53 +4001001 amalgedu pack #x 9 28 15557.83 +6015001 scholarbrand #x 17 50 15411.90 +6007007 brandcorp #x 19 25 15067.50 +6007007 brandcorp #x 18 59 14974.32 +8014006 edu packmaxi #x 19 40 14889.35 +4004002 edu packedu pack #x 18 4 14418.00 +3002002 importoexporti #x 19 40 14063.50 +3003001 exportiexporti #x 19 58 13900.80 +7014010 edu packnameless #x 9 52 13795.60 +2004002 edu packimporto #x 19 17 13663.76 +9013003 exportiunivamalg #x 19 24 13511.26 +5001002 amalgscholar #x 9 41 13318.05 +7014003 edu packnameless #x 19 52 12754.50 +5002002 importoscholar #x 7 16 12584.65 +10005002 scholarunivamalg #x 17 19 12325.56 +4003001 exportiedu pack #x 17 0 12313.71 +1004001 edu packamalg #x 9 6 12311.28 +4001001 amalgedu pack #x 18 21 12299.94 +8004002 edu packnameless #x 9 3 12191.36 +10008006 namelessunivamalg #x 19 47 11971.67 +8001007 amalgnameless #x 19 36 11926.98 +9003003 exportimaxi #x 17 10 11905.95 +1003001 exportiamalg #x 17 48 11845.76 +6009008 maxicorp #x 17 1 11772.54 +6015003 scholarbrand #x 9 40 11755.64 +9003003 exportimaxi #x 19 3 11623.24 +9014011 edu packunivamalg #x 19 12 11407.38 +1001001 amalgamalg #x 17 38 11250.06 +7013007 exportinameless #x 7 27 11169.57 +5001002 amalgscholar #x 18 35 11152.35 +9016003 corpunivamalg #x 17 11 10903.08 +2002002 importoimporto #x 8 38 10861.98 +7009003 maxibrand #x 9 44 10687.08 +3002001 importoexporti #x 17 37 10580.80 +9008003 namelessmaxi #x 9 49 10517.90 +8001007 amalgnameless #x 9 22 10416.24 +7008005 namelessbrand #x 18 31 10196.64 +4004002 edu packedu pack #x 18 29 10166.76 +4003001 exportiedu pack #x 8 41 10118.45 +8012007 importomaxi #x 17 47 10079.52 +5001002 amalgscholar #x 9 11 9922.06 +4003002 exportiedu pack #x 9 8 9888.56 +7004005 edu packbrand #x 17 8 9600.00 +9008003 namelessmaxi #x 18 46 9599.75 +9007003 brandmaxi #x 18 23 9492.33 +7014003 edu packnameless #x 19 39 9431.61 +3004001 edu packexporti #x 18 53 9398.02 +3002001 importoexporti #x 17 51 9370.58 +3002001 importoexporti #x 9 58 9365.40 +1002001 importoamalg #x 8 59 9292.90 +7013002 exportinameless #x 6 23 9269.32 +7002009 importobrand #x 17 31 9114.30 +5003001 exportischolar #x 19 22 9074.52 +10007016 brandunivamalg #x 18 38 9003.20 +10005012 scholarunivamalg #x 18 6 8947.68 +9003003 exportimaxi #x 9 0 8849.28 +8002008 importonameless #x 18 59 8721.28 +8002007 importonameless #x 8 51 8694.00 +3004002 edu packexporti #x 8 18 8480.98 +5002002 importoscholar #x 9 33 8431.24 +3004001 edu packexporti #x 19 5 8427.36 +9003003 exportimaxi #x 8 35 8400.48 +4001001 amalgedu pack #x 17 37 8391.68 +9014011 edu packunivamalg #x 7 33 8367.30 +8002007 importonameless #x 19 52 8361.36 +10014005 edu packamalgamalg #x 9 4 8332.00 +10001003 amalgunivamalg #x 17 56 8299.50 +10011008 amalgamalgamalg #x 18 25 8223.96 +9016005 corpunivamalg #x 17 2 8104.92 +8001007 amalgnameless #x 19 42 8077.98 +10014001 edu packamalgamalg #x 19 52 8077.98 +2002002 importoimporto #x 17 52 8045.25 +8005009 scholarnameless #x 8 17 8033.28 +9013003 exportiunivamalg #x 19 38 7994.24 +5001002 amalgscholar #x 19 18 7980.48 +4003001 exportiedu pack #x 8 57 7973.82 +8006010 corpnameless #x 19 41 7864.08 +10005002 scholarunivamalg #x 6 44 7846.24 +4003001 exportiedu pack #x 19 19 7784.72 +9014011 edu packunivamalg #x 17 48 7677.20 +7014010 edu packnameless #x 9 29 7671.96 +4003001 exportiedu pack #x 19 29 7630.71 +4001001 amalgedu pack #x 9 33 7626.44 +2001001 amalgimporto #x 17 46 7444.64 +9004008 edu packmaxi #x 19 53 7429.73 +9010002 univunivamalg #x 17 25 7428.08 +2001001 amalgimporto #x 19 10 7387.20 +8010001 univmaxi #x 17 38 7327.00 +9003003 exportimaxi #x 17 49 7325.40 +4002001 importoedu pack #x 19 29 7273.80 +5001002 amalgscholar #x 19 31 7253.56 +10001007 amalgunivamalg #x 17 35 7188.16 +3002001 importoexporti #x 19 36 7184.41 +1004001 edu packamalg #x 9 39 7168.20 +8006010 corpnameless #x 6 45 7122.15 +9014008 edu packunivamalg #x 19 35 7048.58 +6015001 scholarbrand #x 19 45 7043.40 +7014001 edu packnameless #x 9 9 6921.20 +3001001 amalgexporti #x 17 58 6919.84 +7016008 corpnameless #x 18 20 6866.37 +4004002 edu packedu pack #x 9 23 6819.60 +7013002 exportinameless #x 8 4 6757.74 +4001001 amalgedu pack #x 18 20 6744.87 +7014010 edu packnameless #x 17 23 6714.90 +2002002 importoimporto #x 9 49 6696.46 +3003002 exportiexporti #x 17 19 6690.42 +4004002 edu packedu pack #x 18 45 6669.03 +8003006 exportinameless #x 9 46 6630.78 +9003003 exportimaxi #x 9 48 6603.20 +9003003 exportimaxi #x 8 28 6580.50 +7012007 importonameless #x 18 6 6548.40 +7015007 scholarnameless #x 17 32 6544.80 +3004001 edu packexporti #x 19 27 6510.42 +9001003 amalgmaxi #x 6 57 6506.50 +2001001 amalgimporto #x 19 8 6500.76 +9003003 exportimaxi #x 18 46 6443.99 +9016003 corpunivamalg #x 8 47 6398.37 +2004002 edu packimporto #x 9 25 6339.69 +9010002 univunivamalg #x 8 21 6302.19 +2004002 edu packimporto #x 19 48 6257.70 +5003001 exportischolar #x 17 44 6225.62 +10016002 corpamalgamalg #x 17 45 6222.80 +9004008 edu packmaxi #x 8 46 6201.78 +7015007 scholarnameless #x 8 18 6162.84 +4002001 importoedu pack #x 18 3 6101.83 +1002001 importoamalg #x 9 1 6058.89 +6008001 namelesscorp #x 17 19 6056.16 +3003002 exportiexporti #x 18 48 6054.30 +7010009 univnameless #x 9 8 6013.24 +9016005 corpunivamalg #x 19 14 5985.00 +7015004 scholarnameless #x 19 49 5981.96 +1004001 edu packamalg #x 19 55 5921.48 +7013007 exportinameless #x 7 0 5905.55 +1003001 exportiamalg #x 8 27 5891.34 +5004001 edu packscholar #x 18 15 5875.10 +8010002 univmaxi #x 17 24 5865.60 +8001007 amalgnameless #x 9 35 5839.47 +3004001 edu packexporti #x 8 45 5819.52 +2001001 amalgimporto #x 19 27 5797.79 +8002007 importonameless #x 19 30 5762.88 +9014008 edu packunivamalg #x 17 53 5754.24 +2003001 exportiimporto #x 8 49 5747.50 +7012007 importonameless #x 17 5 5701.60 +3002001 importoexporti #x 19 17 5699.90 +3003001 exportiexporti #x 8 39 5681.76 +7011010 amalgnameless #x 17 56 5639.04 +6008004 namelesscorp #x 8 42 5623.09 +1003001 exportiamalg #x 18 12 5598.45 +8001009 amalgnameless #x 18 33 5576.00 +7009003 maxibrand #x 17 30 5541.85 +10013006 exportiamalgamalg #x 9 48 5522.14 +10014005 edu packamalgamalg #x 7 45 5490.66 +7013002 exportinameless #x 19 13 5482.24 +9003003 exportimaxi #x 19 15 5480.13 +1004001 edu packamalg #x 18 0 5476.76 +3004001 edu packexporti #x 8 31 5466.72 +4002001 importoedu pack #x 18 42 5460.21 +7010005 univnameless #x 18 48 5435.52 +8008006 namelessnameless #x 8 40 5425.28 +1004001 edu packamalg #x 19 56 5418.16 +1003002 exportiamalg #x 18 52 5397.60 +4004002 edu packedu pack #x 17 21 5377.26 +2002002 importoimporto #x 8 18 5372.40 +1004001 edu packamalg #x 17 16 5341.47 +10015013 scholaramalgamalg #x 6 21 5340.06 +2001001 amalgimporto #x 18 33 5337.60 +6002008 importocorp #x 19 36 5328.99 +3004002 edu packexporti #x 18 33 5301.04 +9003003 exportimaxi #x 9 43 5298.43 +7009003 maxibrand #x 9 26 5193.32 +8010001 univmaxi #x 17 48 5172.16 +8001009 amalgnameless #x 17 1 5166.56 +7015007 scholarnameless #x 17 22 5156.10 +10005012 scholarunivamalg #x 9 16 5114.80 +3003001 exportiexporti #x 18 5 5092.80 +3003001 exportiexporti #x 17 41 5084.64 +9007003 brandmaxi #x 17 23 5045.62 +3002001 importoexporti #x 7 13 5010.32 +3002001 importoexporti #x 17 1 4992.44 +3004001 edu packexporti #x 17 11 4980.35 +4004002 edu packedu pack #x 8 43 4979.04 +10001007 amalgunivamalg #x 19 43 4955.52 +6007007 brandcorp #x 19 20 4942.00 +9014008 edu packunivamalg #x 8 24 4912.02 +5001001 amalgscholar #x 18 54 4879.18 +2001001 amalgimporto #x 18 49 4878.45 +7014010 edu packnameless #x 18 34 4873.60 +8001007 amalgnameless #x 19 41 4830.00 +3002001 importoexporti #x 9 44 4827.15 +4004001 edu packedu pack #x 7 3 4804.34 +4001001 amalgedu pack #x 19 28 4773.53 +4004002 edu packedu pack #x 17 26 4734.60 +6015003 scholarbrand #x 18 34 4665.65 +2004001 edu packimporto #x 17 12 4651.86 +5003001 exportischolar #x 18 4 4631.00 +NULL brandmaxi #x 17 37 4616.78 +4001001 amalgedu pack #x 7 32 4597.00 +4001001 amalgedu pack #x 17 13 4588.56 +6012005 importobrand #x 18 50 4575.60 +3002002 importoexporti #x 19 57 4570.02 +3002001 importoexporti #x 19 39 4528.04 +9016005 corpunivamalg #x 17 16 4526.48 +10008016 namelessunivamalg #x 8 28 4506.81 +2003002 exportiimporto #x 17 42 4484.11 +7015007 scholarnameless #x 18 19 4469.40 +3003002 exportiexporti #x 6 39 4465.80 +10005012 scholarunivamalg #x 18 59 4437.00 +1004001 edu packamalg #x 19 23 4432.40 +2003001 exportiimporto #x 17 19 4421.20 +3004002 edu packexporti #x 18 46 4403.07 +10011008 amalgamalgamalg #x 7 42 4402.30 +4003001 exportiedu pack #x 8 13 4392.08 +8005009 scholarnameless #x 18 0 4379.70 +4003001 exportiedu pack #x 19 50 4349.40 +7002009 importobrand #x 17 33 4341.12 +7006007 corpbrand #x 19 42 4310.33 +1003001 exportiamalg #x 17 21 4301.91 +10008007 namelessunivamalg #x 17 34 4292.47 +8015004 scholarmaxi #x 18 58 4180.80 +2002001 importoimporto #x 18 40 4176.56 +2002002 importoimporto #x 9 54 4173.54 +3001001 amalgexporti #x 9 4 4165.80 +2004001 edu packimporto #x 17 43 4164.04 +3002001 importoexporti #x 17 30 4151.64 +10011008 amalgamalgamalg #x 18 39 4149.63 +4004002 edu packedu pack #x 17 38 4133.66 +8001009 amalgnameless #x 6 43 4122.69 +3002001 importoexporti #x 19 22 4115.04 +3002001 importoexporti #x 19 18 4097.52 +4004002 edu packedu pack #x 19 45 4076.16 +1003001 exportiamalg #x 8 31 4075.59 +7015004 scholarnameless #x 17 5 4068.78 +6009008 maxicorp #x 17 18 4024.77 +7012007 importonameless #x 17 51 4005.99 +7009003 maxibrand #x 18 39 4005.48 +9013005 exportiunivamalg #x 8 42 3946.02 +1004001 edu packamalg #x 9 54 3944.02 +1002002 importoamalg #x 19 45 3925.44 +6005004 scholarcorp #x 9 37 3921.38 +8002007 importonameless #x 18 45 3842.84 +1002001 importoamalg #x 9 30 3842.56 +2002002 importoimporto #x 8 41 3837.18 +8013007 exportimaxi #x 17 41 3815.46 +10005012 scholarunivamalg #x 6 34 3806.53 +6005003 scholarcorp #x 19 28 3796.65 +4004002 edu packedu pack #x 18 28 3780.70 +4004001 edu packedu pack #x 19 7 3777.74 +3003001 exportiexporti #x 9 41 3754.92 +5001002 amalgscholar #x 8 15 3754.40 +1003001 exportiamalg #x 17 53 3748.70 +6007007 brandcorp #x 18 15 3697.20 +7015004 scholarnameless #x 7 52 3666.06 +9014008 edu packunivamalg #x 18 52 3645.18 +4003001 exportiedu pack #x 18 8 3619.35 +3001001 amalgexporti #x 19 54 3606.90 +6009008 maxicorp #x 18 19 3556.14 +5001002 amalgscholar #x 9 4 3522.24 +2004001 edu packimporto #x 17 55 3502.84 +6011001 amalgbrand #x 8 10 3499.45 +3003001 exportiexporti #x 19 55 3482.00 +2003001 exportiimporto #x 17 53 3472.00 +2001001 amalgimporto #x 19 53 3459.52 +2001001 amalgimporto #x 9 49 3457.48 +4001001 amalgedu pack #x 17 39 3433.56 +1004001 edu packamalg #x 19 50 3426.37 +6002008 importocorp #x 18 6 3412.64 +7014010 edu packnameless #x 9 18 3412.08 +7012008 importonameless #x 18 4 3410.74 +3002001 importoexporti #x 17 55 3405.60 +5002001 importoscholar #x 19 17 3400.38 +2001001 amalgimporto #x 17 57 3397.19 +10014001 edu packamalgamalg #x 19 31 3392.50 +7006007 corpbrand #x 17 10 3376.96 +10001003 amalgunivamalg #x 19 41 3352.25 +5001002 amalgscholar #x 19 44 3340.22 +8009005 maxinameless #x 9 24 3338.52 +4002002 importoedu pack #x 19 17 3331.64 +6011003 amalgbrand #x 9 50 3319.68 +4003002 exportiedu pack #x 19 38 3314.22 +1002001 importoamalg #x 19 46 3308.76 +NULL brandmaxi #x 17 53 3303.10 +3004001 edu packexporti #x 19 53 3300.96 +4001001 amalgedu pack #x 17 45 3295.24 +5002001 importoscholar #x 8 11 3271.52 +9012009 importounivamalg #x 17 7 3268.00 +8010001 univmaxi #x 17 31 3267.20 +8010001 univmaxi #x 17 39 3263.40 +9013003 exportiunivamalg #x 17 52 3260.32 +10011008 amalgamalgamalg #x 17 41 3255.54 +6003004 exporticorp #x 19 25 3249.90 +7013002 exportinameless #x 19 39 3219.00 +4003001 exportiedu pack #x 7 6 3211.20 +4001001 amalgedu pack #x 17 49 3193.61 +9009009 maximaxi #x 18 41 3176.58 +4002001 importoedu pack #x 19 11 3175.90 +2001001 amalgimporto #x 17 47 3157.44 +9014011 edu packunivamalg #x 8 58 3137.94 +3002001 importoexporti #x 19 8 3127.98 +7002009 importobrand #x 17 51 3104.96 +10001003 amalgunivamalg #x 17 0 3099.87 +6007007 brandcorp #x 17 2 3096.72 +7014010 edu packnameless #x 19 17 3081.42 +10005012 scholarunivamalg #x 8 39 3081.11 +5001002 amalgscholar #x 9 43 3079.14 +4002001 importoedu pack #x 6 35 3071.00 +4001001 amalgedu pack #x 18 56 3070.71 +7008005 namelessbrand #x 8 5 3070.54 +4003001 exportiedu pack #x 17 14 3060.92 +4004002 edu packedu pack #x 18 30 3026.87 +6015003 scholarbrand #x 19 16 3021.75 +1002001 importoamalg #x 18 23 3018.06 +1003001 exportiamalg #x 17 12 3016.20 +8008006 namelessnameless #x 9 19 3006.85 +8005004 scholarnameless #x 8 7 3004.80 +9008003 namelessmaxi #x 8 13 3004.80 +2004002 edu packimporto #x 17 25 2991.85 +8005009 scholarnameless #x 6 44 2991.08 +7016008 corpnameless #x 8 20 2987.85 +1002001 importoamalg #x 18 38 2983.83 +9016011 corpunivamalg #x 7 43 2923.80 +9016011 corpunivamalg #x 17 56 2910.60 +3003002 exportiexporti #x 17 37 2908.44 +1004001 edu packamalg #x 9 40 2907.30 +7011010 amalgnameless #x 9 39 2899.84 +8012007 importomaxi #x 8 37 2858.82 +4002001 importoedu pack #x 18 7 2846.40 +7010005 univnameless #x 19 20 2838.58 +7002002 importobrand #x 9 28 2829.06 +6011001 amalgbrand #x 19 23 2824.58 +10005012 scholarunivamalg #x 18 51 2800.24 +3001001 amalgexporti #x 18 58 2767.91 +9003003 exportimaxi #x 8 46 2762.53 +4003001 exportiedu pack #x 19 55 2748.48 +7014001 edu packnameless #x 17 15 2742.96 +5002001 importoscholar #x 19 14 2740.79 +7006005 corpbrand #x 17 5 2734.45 +5001002 amalgscholar #x 19 24 2708.16 +7015007 scholarnameless #x 18 6 2707.96 +3004001 edu packexporti #x 19 0 2705.12 +4001001 amalgedu pack #x 18 45 2693.82 +3003001 exportiexporti #x 19 15 2676.38 +7015007 scholarnameless #x 17 51 2675.55 +8010001 univmaxi #x 18 15 2671.00 +3004001 edu packexporti #x 18 37 2668.55 +9015011 scholarunivamalg #x 9 27 2666.22 +8002008 importonameless #x 18 53 2666.00 +6009008 maxicorp #x 19 14 2663.54 +3002001 importoexporti #x 19 47 2647.33 +5002001 importoscholar #x 19 37 2639.14 +3003001 exportiexporti #x 9 1 2634.17 +3004001 edu packexporti #x 18 51 2628.00 +3002001 importoexporti #x 19 30 2612.00 +2001001 amalgimporto #x 18 53 2610.58 +1003001 exportiamalg #x 17 44 2592.59 +3002001 importoexporti #x 9 47 2580.48 +10009010 maxiunivamalg #x 18 53 2579.82 +6008001 namelesscorp #x 17 29 2579.57 +8012007 importomaxi #x 17 52 2569.00 +2002002 importoimporto #x 18 55 2555.57 +8013007 exportimaxi #x 17 23 2545.20 +7006001 corpbrand #x 17 36 2531.43 +10014001 edu packamalgamalg #x 9 26 2527.24 +1003001 exportiamalg #x 17 2 2517.48 +9008003 namelessmaxi #x 8 35 2485.56 +8008006 namelessnameless #x 19 13 2475.20 +10003008 exportiunivamalg #x 8 6 2453.95 +1001001 amalgamalg #x 17 26 2448.16 +7010009 univnameless #x 18 53 2437.00 +9010002 univunivamalg #x 19 27 2435.80 +4001001 amalgedu pack #x 18 38 2431.24 +4004001 edu packedu pack #x 17 33 2426.48 +6012005 importobrand #x 17 41 2420.71 +8013007 exportimaxi #x 19 6 2420.00 +9016005 corpunivamalg #x 18 54 2415.70 +2003001 exportiimporto #x 6 25 2413.20 +2002002 importoimporto #x 18 6 2390.73 +9016008 corpunivamalg #x 17 9 2390.70 +10015013 scholaramalgamalg #x 8 28 2368.85 +4001001 amalgedu pack #x 17 20 2367.30 +8008006 namelessnameless #x 8 20 2363.24 +9012009 importounivamalg #x 8 3 2348.10 +1002002 importoamalg #x 9 44 2336.62 +6007007 brandcorp #x 9 23 2334.24 +1003001 exportiamalg #x 9 54 2325.44 +3004002 edu packexporti #x 9 16 2313.30 +4004001 edu packedu pack #x 19 17 2307.75 +3004001 edu packexporti #x 8 15 2299.77 +7004005 edu packbrand #x 9 34 2294.12 +4003002 exportiedu pack #x 18 55 2280.73 +6005004 scholarcorp #x 9 40 2279.25 +8015004 scholarmaxi #x 9 47 2276.40 +4004002 edu packedu pack #x 19 3 2271.28 +9015011 scholarunivamalg #x 17 54 2269.76 +1002001 importoamalg #x 19 39 2258.08 +6002008 importocorp #x 17 53 2247.20 +9013005 exportiunivamalg #x 7 55 2234.00 +1003002 exportiamalg #x 6 59 2231.46 +10016008 corpamalgamalg #x 17 17 2230.20 +4002001 importoedu pack #x 19 24 2220.00 +4004002 edu packedu pack #x 19 5 2215.50 +9004008 edu packmaxi #x 17 15 2206.40 +4004002 edu packedu pack #x 17 52 2204.16 +2002002 importoimporto #x 17 22 2199.69 +2003002 exportiimporto #x 17 14 2197.84 +8004002 edu packnameless #x 18 33 2188.04 +3003001 exportiexporti #x 17 58 2187.64 +6005003 scholarcorp #x 17 15 2180.85 +8001009 amalgnameless #x 18 41 2178.21 +2002001 importoimporto #x 17 34 2177.28 +6011003 amalgbrand #x 18 48 2176.72 +6008004 namelesscorp #x 17 17 2162.08 +5004002 edu packscholar #x 9 20 2158.40 +6005003 scholarcorp #x 18 7 2152.57 +8010001 univmaxi #x 18 21 2147.42 +9016003 corpunivamalg #x 9 4 2146.05 +9012009 importounivamalg #x 9 6 2138.08 +1003002 exportiamalg #x 9 22 2133.04 +4004002 edu packedu pack #x 18 15 2126.52 +8006010 corpnameless #x 18 41 2126.29 +7013007 exportinameless #x 9 51 2114.10 +10009016 maxiunivamalg #x 9 14 2113.20 +8004002 edu packnameless #x 8 32 2111.54 +3003002 exportiexporti #x 17 45 2106.00 +9008003 namelessmaxi #x 17 55 2100.24 +3004001 edu packexporti #x 8 7 2099.20 +9016011 corpunivamalg #x 19 3 2094.48 +9007003 brandmaxi #x 17 38 2081.01 +7013007 exportinameless #x 8 47 2079.36 +2004001 edu packimporto #x 8 45 2069.88 +2002002 importoimporto #x 8 39 2067.52 +7012007 importonameless #x 7 30 2056.54 +9001003 amalgmaxi #x 19 35 2046.96 +4002001 importoedu pack #x 7 52 2027.30 +9013003 exportiunivamalg #x 17 7 2015.02 +4003002 exportiedu pack #x 9 26 2007.44 +10009016 maxiunivamalg #x 9 57 1997.28 +10008006 namelessunivamalg #x 18 6 1989.49 +5002001 importoscholar #x 19 39 1969.54 +2004001 edu packimporto #x 17 47 1968.80 +9003003 exportimaxi #x 9 22 1964.48 +10009016 maxiunivamalg #x 9 47 1942.08 +2003001 exportiimporto #x 9 48 1919.01 +3003001 exportiexporti #x 18 44 1914.96 +10008016 namelessunivamalg #x 18 1 1902.04 +4003001 exportiedu pack #x 8 27 1899.78 +1003001 exportiamalg #x 7 16 1889.55 +1002001 importoamalg #x 17 40 1889.16 +3001001 amalgexporti #x 8 45 1888.80 +10003008 exportiunivamalg #x 17 42 1858.50 +4003002 exportiedu pack #x 17 55 1851.30 +3002001 importoexporti #x 18 39 1848.96 +8003006 exportinameless #x 8 57 1847.78 +4003001 exportiedu pack #x 18 10 1835.50 +9014011 edu packunivamalg #x 19 9 1816.08 +6012005 importobrand #x 19 32 1815.98 +7010005 univnameless #x 19 23 1815.60 +6011003 amalgbrand #x 8 50 1808.80 +4001002 amalgedu pack #x 17 10 1800.90 +2002002 importoimporto #x 19 0 1798.16 +7010005 univnameless #x 18 31 1789.30 +7002002 importobrand #x 19 33 1786.47 +4004002 edu packedu pack #x 18 14 1786.36 +1002001 importoamalg #x 17 53 1781.00 +8002008 importonameless #x 18 21 1770.21 +10014001 edu packamalgamalg #x 19 7 1760.54 +8003006 exportinameless #x 19 11 1749.55 +9004008 edu packmaxi #x 19 37 1748.25 +4001001 amalgedu pack #x 9 2 1743.00 +3004001 edu packexporti #x 18 21 1736.00 +7006001 corpbrand #x 9 59 1722.93 +7014001 edu packnameless #x 8 14 1720.33 +1002001 importoamalg #x 19 19 1708.92 +1003001 exportiamalg #x 17 55 1703.00 +1003001 exportiamalg #x 8 17 1697.28 +6005003 scholarcorp #x 19 13 1695.72 +2004002 edu packimporto #x 19 26 1693.89 +5003001 exportischolar #x 9 49 1690.08 +7011010 amalgnameless #x 19 13 1688.23 +10014005 edu packamalgamalg #x 17 18 1679.70 +1001001 amalgamalg #x 19 26 1678.27 +2003002 exportiimporto #x 18 10 1677.90 +9007003 brandmaxi #x 18 29 1676.16 +7013002 exportinameless #x 9 21 1674.33 +9004008 edu packmaxi #x 17 45 1667.47 +7012007 importonameless #x 9 9 1662.44 +9010002 univunivamalg #x 8 32 1636.20 +1004001 edu packamalg #x 19 48 1629.36 +6005004 scholarcorp #x 19 28 1623.60 +10014001 edu packamalgamalg #x 19 42 1622.88 +7002002 importobrand #x 19 43 1611.50 +6009008 maxicorp #x 8 40 1607.76 +10008016 namelessunivamalg #x 8 35 1606.32 +2004002 edu packimporto #x 19 41 1600.06 +8013007 exportimaxi #x 19 12 1597.52 +3002001 importoexporti #x 19 5 1597.32 +8013009 exportimaxi #x 8 38 1588.47 +6012005 importobrand #x 18 13 1569.12 +10013006 exportiamalgamalg #x 17 4 1565.76 +2001001 amalgimporto #x 18 22 1560.28 +5002001 importoscholar #x 18 23 1558.80 +1001001 amalgamalg #x 19 13 1542.42 +NULL brandmaxi #x 18 10 1538.24 +10011008 amalgamalgamalg #x 9 49 1536.50 +8014006 edu packmaxi #x 9 49 1534.26 +9013003 exportiunivamalg #x 7 55 1520.45 +7006007 corpbrand #x 8 43 1517.67 +2003001 exportiimporto #x 9 16 1512.00 +10011008 amalgamalgamalg #x 17 46 1506.54 +9016005 corpunivamalg #x 17 54 1505.28 +6012005 importobrand #x 9 47 1503.81 +1002002 importoamalg #x 17 3 1499.84 +9013005 exportiunivamalg #x 18 8 1499.40 +2002002 importoimporto #x 17 14 1483.50 +3001001 amalgexporti #x 17 17 1459.44 +9001003 amalgmaxi #x 19 55 1455.30 +9016011 corpunivamalg #x 18 49 1455.08 +9013003 exportiunivamalg #x 17 2 1443.52 +9003003 exportimaxi #x 9 20 1442.40 +7004005 edu packbrand #x 17 20 1432.67 +8002008 importonameless #x 17 42 1428.68 +9005002 scholarmaxi #x 7 32 1420.70 +10008007 namelessunivamalg #x 9 59 1406.40 +7011010 amalgnameless #x 17 19 1404.86 +7015007 scholarnameless #x 18 46 1402.40 +2001001 amalgimporto #x 17 23 1397.76 +10001007 amalgunivamalg #x 17 42 1388.49 +1003001 exportiamalg #x 17 57 1388.03 +7006001 corpbrand #x 19 58 1387.75 +10005002 scholarunivamalg #x 19 11 1382.68 +9001003 amalgmaxi #x 17 17 1382.16 +3002001 importoexporti #x 6 8 1379.81 +7004005 edu packbrand #x 17 33 1365.52 +3002001 importoexporti #x 18 0 1350.00 +7014003 edu packnameless #x 8 21 1349.76 +9016003 corpunivamalg #x 18 38 1340.64 +2004002 edu packimporto #x 9 4 1334.41 +4003001 exportiedu pack #x 17 55 1326.42 +1002001 importoamalg #x 18 51 1308.82 +6003004 exporticorp #x 17 39 1305.00 +1004001 edu packamalg #x 9 44 1304.91 +10005012 scholarunivamalg #x 6 30 1298.70 +10016008 corpamalgamalg #x 19 32 1293.44 +10008006 namelessunivamalg #x 8 20 1288.16 +3002001 importoexporti #x 19 25 1284.20 +9013005 exportiunivamalg #x 17 50 1269.05 +4003001 exportiedu pack #x 9 12 1266.16 +5001002 amalgscholar #x 17 40 1262.40 +1004001 edu packamalg #x 17 34 1257.90 +10008007 namelessunivamalg #x 8 13 1246.77 +4001001 amalgedu pack #x 9 56 1233.28 +7015007 scholarnameless #x 19 52 1218.28 +9003003 exportimaxi #x 8 39 1211.34 +4003001 exportiedu pack #x 18 3 1208.70 +5004001 edu packscholar #x 18 16 1197.76 +6003004 exporticorp #x 6 50 1195.92 +6002008 importocorp #x 9 14 1194.08 +3003001 exportiexporti #x 17 21 1192.50 +8001009 amalgnameless #x 19 49 1191.50 +6011003 amalgbrand #x 7 32 1189.59 +6009008 maxicorp #x 18 34 1179.80 +2004002 edu packimporto #x 7 19 1178.10 +9013005 exportiunivamalg #x 17 40 1173.15 +7006007 corpbrand #x 8 2 1166.66 +2002002 importoimporto #x 19 17 1162.28 +3001001 amalgexporti #x 18 25 1161.54 +2002001 importoimporto #x 9 59 1161.00 +8010001 univmaxi #x 19 55 1160.64 +4001001 amalgedu pack #x 17 51 1153.88 +9014008 edu packunivamalg #x 18 4 1153.00 +4001001 amalgedu pack #x 19 48 1151.94 +7011010 amalgnameless #x 8 40 1151.64 +5004001 edu packscholar #x 6 57 1148.68 +9004008 edu packmaxi #x 19 3 1140.21 +8001009 amalgnameless #x 17 27 1139.00 +8001007 amalgnameless #x 19 3 1135.20 +9015011 scholarunivamalg #x 9 36 1134.00 +9015011 scholarunivamalg #x 9 41 1133.76 +7010005 univnameless #x 19 8 1130.29 +1001001 amalgamalg #x 18 54 1129.80 +4001001 amalgedu pack #x 8 44 1129.80 +7016008 corpnameless #x 18 27 1128.50 +4002002 importoedu pack #x 17 24 1124.37 +5002002 importoscholar #x 19 20 1124.23 +4002001 importoedu pack #x 9 42 1120.98 +9013005 exportiunivamalg #x 17 16 1113.20 +7015007 scholarnameless #x 17 7 1111.10 +8001009 amalgnameless #x 19 40 1110.42 +2001001 amalgimporto #x 17 19 1108.80 +3004001 edu packexporti #x 18 56 1100.47 +4003001 exportiedu pack #x 9 44 1100.32 +8003006 exportinameless #x 17 54 1098.20 +8001007 amalgnameless #x 19 51 1097.28 +7002002 importobrand #x 17 27 1092.25 +2001001 amalgimporto #x 17 41 1090.98 +2004001 edu packimporto #x 17 14 1088.64 +3003001 exportiexporti #x 17 54 1080.64 +9007003 brandmaxi #x 17 2 1079.52 +1003001 exportiamalg #x 9 36 1079.10 +10008007 namelessunivamalg #x 17 12 1073.16 +6011001 amalgbrand #x 8 53 1071.84 +7008005 namelessbrand #x 19 55 1071.84 +3003001 exportiexporti #x 8 20 1064.85 +7015004 scholarnameless #x 19 59 1059.50 +4004002 edu packedu pack #x 18 19 1052.10 +2001001 amalgimporto #x 9 24 1050.07 +9013005 exportiunivamalg #x 17 19 1049.20 +4001001 amalgedu pack #x 9 3 1047.60 +1004001 edu packamalg #x 17 29 1041.70 +7009003 maxibrand #x 18 17 1040.98 +10008006 namelessunivamalg #x 8 21 1040.04 +9013005 exportiunivamalg #x 9 58 1032.46 +5001002 amalgscholar #x 19 7 1029.76 +9016011 corpunivamalg #x 17 51 1029.34 +1002001 importoamalg #x 18 53 1024.10 +5001001 amalgscholar #x 6 19 1012.69 +2002002 importoimporto #x 17 49 1001.90 +6012005 importobrand #x 17 38 1001.60 +2001001 amalgimporto #x 17 36 992.25 +7008005 namelessbrand #x 19 19 991.36 +5004001 edu packscholar #x 9 9 989.86 +2004001 edu packimporto #x 17 28 984.62 +2003002 exportiimporto #x 19 14 981.54 +3001001 amalgexporti #x 19 24 979.20 +8015004 scholarmaxi #x 9 32 973.50 +9010002 univunivamalg #x 17 40 969.15 +4001001 amalgedu pack #x 9 38 966.92 +3004002 edu packexporti #x 17 39 965.25 +2003001 exportiimporto #x 8 10 960.33 +2002002 importoimporto #x 18 51 958.86 +9016008 corpunivamalg #x 17 52 957.18 +7010005 univnameless #x 17 54 948.42 +9009009 maximaxi #x 8 10 939.60 +4003001 exportiedu pack #x 17 45 937.30 +2004001 edu packimporto #x 17 54 932.94 +9003003 exportimaxi #x 19 36 928.32 +4003002 exportiedu pack #x 9 48 924.80 +8002008 importonameless #x 19 54 915.38 +6002008 importocorp #x 9 0 914.64 +7006007 corpbrand #x 18 2 914.39 +7014010 edu packnameless #x 18 8 910.30 +3004002 edu packexporti #x 18 8 907.12 +5001002 amalgscholar #x 6 8 906.84 +2004001 edu packimporto #x 9 57 906.78 +8013007 exportimaxi #x 17 54 904.68 +7008005 namelessbrand #x 19 29 901.32 +1002001 importoamalg #x 17 45 898.82 +10013006 exportiamalgamalg #x 9 14 896.26 +1003001 exportiamalg #x 18 51 891.87 +9008003 namelessmaxi #x 17 24 890.40 +10008006 namelessunivamalg #x 18 37 889.76 +7014010 edu packnameless #x 8 15 888.12 +8008006 namelessnameless #x 19 3 884.00 +7011010 amalgnameless #x 8 20 883.96 +9013005 exportiunivamalg #x 18 52 883.35 +6015001 scholarbrand #x 9 55 881.45 +3004001 edu packexporti #x 18 0 876.68 +1003001 exportiamalg #x 19 56 874.50 +9014008 edu packunivamalg #x 8 10 873.30 +8003006 exportinameless #x 19 44 863.04 +2001001 amalgimporto #x 8 47 862.92 +3003001 exportiexporti #x 17 48 860.52 +7004005 edu packbrand #x 17 0 857.55 +8004002 edu packnameless #x 6 59 855.84 +8002008 importonameless #x 8 23 855.21 +5001002 amalgscholar #x 7 57 854.70 +6011001 amalgbrand #x 8 7 850.86 +8002007 importonameless #x 17 0 843.50 +2001001 amalgimporto #x 19 21 840.63 +3004001 edu packexporti #x 17 42 836.43 +2004001 edu packimporto #x 17 27 833.91 +4003001 exportiedu pack #x 6 35 825.24 +2001001 amalgimporto #x 9 45 822.00 +2004001 edu packimporto #x 9 15 817.02 +7012007 importonameless #x 19 21 814.45 +6012005 importobrand #x 17 53 805.65 +7011010 amalgnameless #x 18 34 802.80 +4001001 amalgedu pack #x 9 19 799.77 +7014010 edu packnameless #x 9 5 796.86 +4003002 exportiedu pack #x 18 59 794.58 +1001001 amalgamalg #x 17 49 793.50 +2001002 amalgimporto #x 7 46 789.96 +6005003 scholarcorp #x 17 22 788.72 +9013005 exportiunivamalg #x 19 43 788.67 +3004002 edu packexporti #x 19 6 788.12 +3002001 importoexporti #x 18 46 787.76 +9016011 corpunivamalg #x 8 49 787.71 +10014001 edu packamalgamalg #x 19 37 783.36 +1002002 importoamalg #x 18 18 781.60 +5002001 importoscholar #x 17 40 781.55 +5002002 importoscholar #x 18 34 779.22 +7002002 importobrand #x 18 17 773.22 +8013007 exportimaxi #x 7 56 772.80 +8014006 edu packmaxi #x 9 32 771.12 +8008006 namelessnameless #x 9 2 767.36 +5001001 amalgscholar #x 8 51 767.23 +2001001 amalgimporto #x 17 20 765.15 +2001002 amalgimporto #x 18 17 764.40 +9010002 univunivamalg #x 19 2 764.16 +2002002 importoimporto #x 18 46 757.80 +7012008 importonameless #x 17 57 751.74 +9003003 exportimaxi #x 19 24 749.84 +1002002 importoamalg #x 9 12 748.60 +1004001 edu packamalg #x 18 24 746.88 +4001001 amalgedu pack #x 19 46 743.38 +2004001 edu packimporto #x 17 18 742.14 +9013005 exportiunivamalg #x 18 49 739.25 +5004001 edu packscholar #x 17 50 736.65 +7008005 namelessbrand #x 18 7 734.16 +9013005 exportiunivamalg #x 6 58 733.04 +7004005 edu packbrand #x 19 38 728.64 +2004001 edu packimporto #x 19 35 723.36 +5004002 edu packscholar #x 19 57 723.18 +4003001 exportiedu pack #x 8 5 720.16 +8005004 scholarnameless #x 19 1 707.37 +5004002 edu packscholar #x 8 20 704.84 +4001002 amalgedu pack #x 9 46 701.68 +5002001 importoscholar #x 9 42 700.00 +2001001 amalgimporto #x 18 45 698.10 +7002009 importobrand #x 17 55 697.62 +1004001 edu packamalg #x 18 8 694.96 +4003001 exportiedu pack #x 9 11 693.24 +5004001 edu packscholar #x 18 18 693.00 +2004001 edu packimporto #x 9 38 689.92 +6008001 namelesscorp #x 18 21 689.22 +8001007 amalgnameless #x 17 23 685.44 +3002001 importoexporti #x 18 53 677.28 +5003001 exportischolar #x 8 32 675.90 +7009003 maxibrand #x 19 5 672.80 +9013003 exportiunivamalg #x 18 10 672.29 +9014011 edu packunivamalg #x 19 27 671.46 +4004002 edu packedu pack #x 7 46 670.32 +10005002 scholarunivamalg #x 17 42 669.28 +9003003 exportimaxi #x 9 44 666.39 +6005003 scholarcorp #x 9 26 665.28 +8005004 scholarnameless #x 9 14 664.74 +5001002 amalgscholar #x 18 32 657.69 +6011003 amalgbrand #x 9 53 657.57 +7006001 corpbrand #x 8 34 655.68 +6007007 brandcorp #x 17 39 653.90 +8008006 namelessnameless #x 6 9 648.45 +2003001 exportiimporto #x 17 54 645.00 +10008016 namelessunivamalg #x 9 53 638.52 +4003001 exportiedu pack #x 19 4 638.02 +8005004 scholarnameless #x 19 2 633.36 +4001002 amalgedu pack #x 19 11 630.36 +1003001 exportiamalg #x 17 4 629.68 +4004002 edu packedu pack #x 17 15 617.28 +4004002 edu packedu pack #x 18 8 615.36 +9016003 corpunivamalg #x 18 12 609.96 +6007007 brandcorp #x 18 14 607.62 +9016005 corpunivamalg #x 19 54 603.95 +8005009 scholarnameless #x 19 1 601.68 +9009009 maximaxi #x 18 47 598.50 +1002001 importoamalg #x 8 7 593.56 +2003002 exportiimporto #x 17 0 591.43 +3002001 importoexporti #x 17 11 587.94 +4003001 exportiedu pack #x 8 26 587.36 +3002001 importoexporti #x 19 13 586.08 +10013006 exportiamalgamalg #x 18 6 585.12 +9003003 exportimaxi #x 8 4 581.28 +3003001 exportiexporti #x 19 0 577.68 +9007003 brandmaxi #x 17 0 574.52 +3002002 importoexporti #x 9 53 570.78 +10009016 maxiunivamalg #x 19 4 570.57 +1003001 exportiamalg #x 17 59 560.34 +7002002 importobrand #x 8 58 560.28 +7006001 corpbrand #x 7 48 558.90 +NULL brandmaxi #x 18 7 555.45 +6015003 scholarbrand #x 18 2 555.30 +9003003 exportimaxi #x 19 54 546.96 +9003003 exportimaxi #x 9 51 541.80 +1002001 importoamalg #x 19 29 540.00 +6009008 maxicorp #x 17 8 537.37 +1002001 importoamalg #x 17 50 536.58 +7011010 amalgnameless #x 17 34 536.50 +8009005 maxinameless #x 18 44 535.78 +8009005 maxinameless #x 17 9 535.16 +3002001 importoexporti #x 17 44 530.42 +9007003 brandmaxi #x 8 40 529.72 +2001001 amalgimporto #x 9 54 529.55 +2003002 exportiimporto #x 8 41 527.80 +2002002 importoimporto #x 6 9 527.40 +9001003 amalgmaxi #x 17 22 517.16 +2002002 importoimporto #x 19 32 516.40 +3002002 importoexporti #x 9 58 515.78 +7006001 corpbrand #x 8 37 515.08 +4002001 importoedu pack #x 9 0 512.46 +4001001 amalgedu pack #x 18 10 511.88 +9003003 exportimaxi #x 18 59 510.95 +1002002 importoamalg #x 8 10 504.75 +4001001 amalgedu pack #x 9 57 500.32 +2003001 exportiimporto #x 19 55 499.92 +6011003 amalgbrand #x 9 24 498.96 +2001001 amalgimporto #x 19 0 498.18 +2004001 edu packimporto #x 9 35 497.09 +3004002 edu packexporti #x 18 40 495.95 +4001001 amalgedu pack #x 9 34 494.52 +5004002 edu packscholar #x 9 15 491.25 +4002001 importoedu pack #x 8 5 490.56 +10009016 maxiunivamalg #x 17 20 486.96 +7014003 edu packnameless #x 19 23 486.08 +4001001 amalgedu pack #x 9 32 484.72 +5004001 edu packscholar #x 17 24 484.47 +4002001 importoedu pack #x 9 9 477.28 +1004001 edu packamalg #x 8 5 476.13 +6011003 amalgbrand #x 19 9 474.96 +8001009 amalgnameless #x 7 52 473.55 +5001002 amalgscholar #x 17 3 470.64 +3003001 exportiexporti #x 18 10 470.25 +6011001 amalgbrand #x 19 2 467.52 +8009005 maxinameless #x 18 37 467.00 +7015004 scholarnameless #x 17 24 466.86 +1003001 exportiamalg #x 18 7 462.00 +5001002 amalgscholar #x 18 26 461.89 +2001001 amalgimporto #x 18 39 461.70 +9016005 corpunivamalg #x 19 30 458.64 +3002002 importoexporti #x 17 53 454.08 +7014003 edu packnameless #x 8 47 453.84 +2004001 edu packimporto #x 8 27 450.78 +8013007 exportimaxi #x 17 50 449.35 +9013005 exportiunivamalg #x 9 3 448.74 +3004001 edu packexporti #x 8 20 447.76 +3004001 edu packexporti #x 9 57 445.60 +2001002 amalgimporto #x 8 16 444.62 +5003001 exportischolar #x 18 23 443.56 +7010009 univnameless #x 17 24 440.88 +7013007 exportinameless #x 9 47 438.55 +5002001 importoscholar #x 9 45 432.48 +10016008 corpamalgamalg #x 18 41 430.55 +2004002 edu packimporto #x 18 10 430.08 +10009010 maxiunivamalg #x 8 26 429.00 +4003001 exportiedu pack #x 18 42 424.02 +NULL brandmaxi #x 17 16 422.31 +10001007 amalgunivamalg #x 9 36 419.76 +7008005 namelessbrand #x 17 44 419.12 +2004001 edu packimporto #x 8 54 417.34 +4004002 edu packedu pack #x 17 0 415.48 +4003001 exportiedu pack #x 17 9 415.32 +4003002 exportiedu pack #x 18 24 415.16 +4001001 amalgedu pack #x 19 54 414.72 +9014011 edu packunivamalg #x 8 32 413.76 +8001007 amalgnameless #x 19 43 409.08 +3002001 importoexporti #x 17 28 408.90 +4003001 exportiedu pack #x 19 48 406.90 +9013005 exportiunivamalg #x 17 9 400.20 +6003004 exporticorp #x 9 11 399.04 +3003002 exportiexporti #x 17 7 396.00 +10007016 brandunivamalg #x 9 16 394.80 +3002001 importoexporti #x 18 38 393.38 +4001002 amalgedu pack #x 8 57 392.60 +10015013 scholaramalgamalg #x 17 22 390.39 +3002001 importoexporti #x 17 5 390.18 +5004001 edu packscholar #x 9 47 384.09 +3001001 amalgexporti #x 19 19 380.60 +4004002 edu packedu pack #x 18 48 377.60 +7005006 scholarbrand #x 18 52 377.28 +10003008 exportiunivamalg #x 17 8 372.52 +8004002 edu packnameless #x 8 44 372.33 +2003001 exportiimporto #x 18 12 371.25 +3002002 importoexporti #x 19 35 370.59 +1002002 importoamalg #x 18 2 370.08 +6002008 importocorp #x 17 4 369.55 +4003001 exportiedu pack #x 18 51 362.70 +10009010 maxiunivamalg #x 17 40 360.36 +1002002 importoamalg #x 17 35 354.96 +3004001 edu packexporti #x 9 58 354.48 +10003008 exportiunivamalg #x 17 59 352.32 +4001001 amalgedu pack #x 18 48 350.46 +4001001 amalgedu pack #x 17 54 349.44 +4001001 amalgedu pack #x 17 14 347.51 +5001001 amalgscholar #x 19 20 346.40 +4003001 exportiedu pack #x 9 9 345.80 +4001001 amalgedu pack #x 17 21 344.75 +10014005 edu packamalgamalg #x 18 25 344.00 +8008006 namelessnameless #x 17 34 342.72 +9010002 univunivamalg #x 18 53 342.35 +8002007 importonameless #x 8 17 340.80 +1002001 importoamalg #x 7 36 333.32 +4001001 amalgedu pack #x 19 31 330.45 +4004002 edu packedu pack #x 18 44 329.04 +1003001 exportiamalg #x 18 41 326.83 +6008001 namelesscorp #x 19 54 325.65 +7013002 exportinameless #x 17 24 324.24 +4004002 edu packedu pack #x 8 0 323.50 +3002001 importoexporti #x 18 51 323.46 +10016008 corpamalgamalg #x 18 35 322.00 +10014005 edu packamalgamalg #x 17 51 320.76 +1003001 exportiamalg #x 9 56 320.40 +5002002 importoscholar #x 17 54 318.20 +3004001 edu packexporti #x 17 37 317.52 +10007016 brandunivamalg #x 9 6 315.75 +3003001 exportiexporti #x 17 32 314.72 +8010001 univmaxi #x 19 13 314.72 +4001001 amalgedu pack #x 8 0 312.13 +5004002 edu packscholar #x 18 11 310.80 +1002001 importoamalg #x 19 37 309.33 +1002001 importoamalg #x 6 21 308.34 +7006005 corpbrand #x 17 40 307.97 +4001001 amalgedu pack #x 17 18 307.05 +1002001 importoamalg #x 17 24 306.93 +2004001 edu packimporto #x 7 51 305.40 +2004002 edu packimporto #x 17 39 302.90 +9003003 exportimaxi #x 8 20 298.80 +4001001 amalgedu pack #x 19 32 296.38 +5003001 exportischolar #x 19 27 295.95 +2001001 amalgimporto #x 18 4 294.80 +10013006 exportiamalgamalg #x 9 41 290.03 +1002001 importoamalg #x 19 12 281.76 +7013002 exportinameless #x 17 0 279.00 +10005012 scholarunivamalg #x 9 50 275.52 +8010002 univmaxi #x 7 31 272.25 +10015013 scholaramalgamalg #x 7 13 270.28 +1003001 exportiamalg #x 8 47 269.50 +10014005 edu packamalgamalg #x 9 30 267.54 +7011010 amalgnameless #x 19 3 265.47 +9003003 exportimaxi #x 18 55 264.77 +9016003 corpunivamalg #x 9 6 264.64 +2002002 importoimporto #x 18 1 264.30 +1004001 edu packamalg #x 8 13 263.55 +4004001 edu packedu pack #x 6 8 261.08 +8004002 edu packnameless #x 9 56 258.30 +2002002 importoimporto #x 18 36 257.56 +3002001 importoexporti #x 19 20 256.14 +2003002 exportiimporto #x 17 57 255.50 +9010002 univunivamalg #x 19 30 254.52 +6007007 brandcorp #x 9 39 253.23 +9013005 exportiunivamalg #x 7 35 251.93 +3003001 exportiexporti #x 9 42 250.80 +10016002 corpamalgamalg #x 17 47 250.80 +7015007 scholarnameless #x 18 44 249.20 +3004002 edu packexporti #x 18 35 247.28 +8001007 amalgnameless #x 19 32 246.54 +9010002 univunivamalg #x 19 47 246.43 +3002001 importoexporti #x 9 5 244.62 +10016008 corpamalgamalg #x 19 0 243.09 +9009009 maximaxi #x 18 26 242.13 +9008003 namelessmaxi #x 18 9 241.86 +8001009 amalgnameless #x 17 46 241.83 +7013007 exportinameless #x 19 19 241.20 +1002002 importoamalg #x 18 49 241.08 +8005004 scholarnameless #x 8 16 239.98 +4002001 importoedu pack #x 8 45 239.44 +3004001 edu packexporti #x 9 26 237.60 +6012005 importobrand #x 18 8 235.32 +10016008 corpamalgamalg #x 17 27 232.70 +4003002 exportiedu pack #x 8 8 220.08 +1002002 importoamalg #x 18 29 219.36 +2003001 exportiimporto #x 18 31 218.00 +7014010 edu packnameless #x 17 7 217.80 +9005002 scholarmaxi #x 18 41 217.40 +9016003 corpunivamalg #x 17 3 217.00 +NULL brandmaxi #x 18 27 211.40 +2002002 importoimporto #x 17 42 208.98 +4001002 amalgedu pack #x 18 29 206.64 +3002001 importoexporti #x 18 1 205.55 +6009008 maxicorp #x 18 13 204.48 +4001001 amalgedu pack #x 19 35 203.76 +4003002 exportiedu pack #x 9 9 201.41 +1002002 importoamalg #x 6 7 200.80 +9014011 edu packunivamalg #x 17 27 200.72 +8006010 corpnameless #x 9 27 199.75 +3004001 edu packexporti #x 17 18 199.64 +8005009 scholarnameless #x 19 46 198.38 +3004001 edu packexporti #x 9 12 197.62 +6002008 importocorp #x 18 24 196.94 +8013009 exportimaxi #x 17 17 196.50 +10007016 brandunivamalg #x 9 7 188.63 +4002002 importoedu pack #x 17 54 188.25 +4002001 importoedu pack #x 19 55 187.29 +8009005 maxinameless #x 17 0 187.09 +4001001 amalgedu pack #x 17 33 186.10 +1003002 exportiamalg #x 7 56 179.82 +4001001 amalgedu pack #x 9 8 178.40 +3002002 importoexporti #x 17 16 177.30 +8003006 exportinameless #x 9 15 174.05 +9003003 exportimaxi #x 17 52 172.62 +9014011 edu packunivamalg #x 6 12 172.05 +2004001 edu packimporto #x 17 37 170.66 +10001003 amalgunivamalg #x 6 57 169.92 +7005006 scholarbrand #x 7 32 168.08 +6005003 scholarcorp #x 18 59 168.00 +6007007 brandcorp #x 17 22 166.74 +2004001 edu packimporto #x 17 58 165.69 +9003003 exportimaxi #x 8 13 164.78 +6011003 amalgbrand #x 9 43 163.40 +4004002 edu packedu pack #x 7 14 162.92 +2001001 amalgimporto #x 17 0 162.47 +2001002 amalgimporto #x 19 30 161.44 +7013002 exportinameless #x 19 29 160.95 +10011008 amalgamalgamalg #x 17 13 160.56 +9009009 maximaxi #x 17 35 160.40 +3002001 importoexporti #x 17 57 159.60 +2003001 exportiimporto #x 19 37 159.08 +7002009 importobrand #x 19 5 158.40 +7006007 corpbrand #x 8 38 158.16 +4003001 exportiedu pack #x 19 52 157.78 +10009016 maxiunivamalg #x 9 41 157.68 +10015013 scholaramalgamalg #x 17 32 157.62 +6015001 scholarbrand #x 17 0 157.28 +6008004 namelesscorp #x 17 42 156.80 +7013002 exportinameless #x 9 42 156.75 +10014001 edu packamalgamalg #x 18 27 156.18 +2001001 amalgimporto #x 8 5 155.75 +7010005 univnameless #x 9 33 154.64 +7013002 exportinameless #x 8 59 154.38 +5001002 amalgscholar #x 18 31 154.35 +10003008 exportiunivamalg #x 17 27 154.08 +6012005 importobrand #x 9 26 153.51 +10016002 corpamalgamalg #x 17 46 152.10 +5001002 amalgscholar #x 18 41 151.14 +8001009 amalgnameless #x 17 8 150.66 +6008004 namelesscorp #x 19 44 150.40 +6002008 importocorp #x 17 37 150.22 +8004002 edu packnameless #x 19 36 148.23 +8013007 exportimaxi #x 18 33 147.84 +6015003 scholarbrand #x 18 10 147.66 +4002001 importoedu pack #x 19 41 146.60 +4003001 exportiedu pack #x 17 42 146.32 +5003001 exportischolar #x 17 57 142.56 +4004002 edu packedu pack #x 17 4 141.24 +9015011 scholarunivamalg #x 7 56 139.16 +3003001 exportiexporti #x 17 25 135.24 +3003001 exportiexporti #x 9 36 133.92 +8004002 edu packnameless #x 19 42 133.70 +6008004 namelesscorp #x 19 16 132.81 +7014010 edu packnameless #x 17 30 132.46 +2001001 amalgimporto #x 18 6 132.25 +7004005 edu packbrand #x 17 37 132.22 +1003001 exportiamalg #x 19 29 131.58 +8002008 importonameless #x 17 2 131.22 +7012008 importonameless #x 17 53 130.18 +4001001 amalgedu pack #x 7 51 128.50 +8010001 univmaxi #x 17 17 127.28 +9014008 edu packunivamalg #x 9 53 126.70 +8002007 importonameless #x 17 21 126.00 +9004008 edu packmaxi #x 9 19 126.00 +7008005 namelessbrand #x 17 52 125.23 +9003003 exportimaxi #x 17 23 122.74 +6015001 scholarbrand #x 17 36 121.92 +3002002 importoexporti #x 9 40 119.60 +NULL brandmaxi #x 18 20 119.52 +4001001 amalgedu pack #x 19 29 119.38 +4003001 exportiedu pack #x 19 14 119.36 +7015004 scholarnameless #x 17 15 118.36 +2001001 amalgimporto #x 6 35 116.13 +9016005 corpunivamalg #x 9 58 116.09 +4002001 importoedu pack #x 19 19 114.52 +3001001 amalgexporti #x 19 20 114.00 +5001002 amalgscholar #x 19 42 113.04 +3002001 importoexporti #x 6 19 111.52 +3004001 edu packexporti #x 17 45 110.88 +1004001 edu packamalg #x 18 22 110.64 +1002001 importoamalg #x 7 52 110.25 +9003003 exportimaxi #x 18 58 109.34 +6005003 scholarcorp #x 9 27 106.75 +4003002 exportiedu pack #x 9 40 106.44 +8008006 namelessnameless #x 9 39 105.60 +6015003 scholarbrand #x 18 5 104.70 +4002001 importoedu pack #x 18 18 104.00 +7009003 maxibrand #x 18 33 102.00 +10014005 edu packamalgamalg #x 18 19 99.36 +8005004 scholarnameless #x 18 47 98.98 +6008004 namelesscorp #x 17 54 97.40 +2003001 exportiimporto #x 19 0 92.79 +10001007 amalgunivamalg #x 17 1 90.90 +1003001 exportiamalg #x 18 16 90.45 +4003001 exportiedu pack #x 17 4 88.83 +10016002 corpamalgamalg #x 9 14 87.36 +10008016 namelessunivamalg #x 18 7 87.06 +3002002 importoexporti #x 8 24 86.73 +8006010 corpnameless #x 19 44 85.60 +1003001 exportiamalg #x 8 29 84.15 +2001001 amalgimporto #x 18 25 84.04 +9008003 namelessmaxi #x 9 43 83.94 +4003002 exportiedu pack #x 18 2 82.94 +9003003 exportimaxi #x 18 29 81.88 +10003008 exportiunivamalg #x 18 51 81.80 +8006010 corpnameless #x 8 15 80.00 +5004001 edu packscholar #x 8 28 78.75 +10016002 corpamalgamalg #x 19 8 78.75 +8002007 importonameless #x 9 7 78.00 +8001007 amalgnameless #x 9 23 77.04 +3002001 importoexporti #x 6 57 76.38 +10001007 amalgunivamalg #x 8 36 76.20 +8015004 scholarmaxi #x 9 53 74.88 +3003001 exportiexporti #x 9 27 74.52 +9013005 exportiunivamalg #x 8 30 74.20 +9016011 corpunivamalg #x 9 14 72.80 +2002002 importoimporto #x 19 35 70.85 +8005004 scholarnameless #x 9 18 69.60 +9007003 brandmaxi #x 9 18 68.76 +9016008 corpunivamalg #x 9 0 68.64 +9005002 scholarmaxi #x 9 24 67.89 +2001001 amalgimporto #x 18 23 66.65 +5003001 exportischolar #x 17 1 66.36 +7008005 namelessbrand #x 18 3 66.30 +8003006 exportinameless #x 9 8 63.84 +7010005 univnameless #x 19 10 61.88 +4001001 amalgedu pack #x 19 20 60.90 +5002002 importoscholar #x 9 8 58.83 +4001001 amalgedu pack #x 18 27 58.66 +4003002 exportiedu pack #x 9 24 58.56 +3002001 importoexporti #x 9 50 58.32 +8005009 scholarnameless #x 19 10 58.29 +3003001 exportiexporti #x 9 4 57.89 +7014010 edu packnameless #x 9 59 56.76 +7012007 importonameless #x 8 53 55.98 +NULL brandmaxi #x 17 54 55.45 +10007016 brandunivamalg #x 17 11 53.72 +7002002 importobrand #x 7 35 53.52 +7010009 univnameless #x 17 40 53.16 +4002001 importoedu pack #x 8 49 52.87 +4004002 edu packedu pack #x 19 55 50.31 +4001001 amalgedu pack #x 17 46 50.12 +5002001 importoscholar #x 8 10 49.80 +9016005 corpunivamalg #x 19 28 49.50 +4002001 importoedu pack #x 9 22 49.44 +5002002 importoscholar #x 9 38 47.88 +2003001 exportiimporto #x 9 52 47.46 +7016008 corpnameless #x 19 40 47.32 +4004002 edu packedu pack #x 18 34 47.11 +10008006 namelessunivamalg #x 9 37 45.05 +10001003 amalgunivamalg #x 9 14 44.55 +2002002 importoimporto #x 8 9 44.32 +2002002 importoimporto #x 18 10 41.16 +7006007 corpbrand #x 18 6 40.32 +1003001 exportiamalg #x 8 39 38.22 +10001003 amalgunivamalg #x 17 11 37.84 +7012008 importonameless #x 17 1 37.44 +1002001 importoamalg #x 19 15 36.74 +3003001 exportiexporti #x 18 22 34.76 +4001001 amalgedu pack #x 8 32 32.23 +9013005 exportiunivamalg #x 19 33 29.85 +1002001 importoamalg #x 19 57 29.52 +10016002 corpamalgamalg #x 9 18 25.47 +6007007 brandcorp #x 9 11 24.77 +1003002 exportiamalg #x 19 43 24.43 +9004008 edu packmaxi #x 18 57 24.32 +10009016 maxiunivamalg #x 19 19 22.66 +10008006 namelessunivamalg #x 9 3 22.14 +3003001 exportiexporti #x 19 25 21.40 +2001001 amalgimporto #x 8 58 19.88 +3004001 edu packexporti #x 17 29 17.76 +6008001 namelesscorp #x 17 58 17.00 +9009009 maximaxi #x 9 38 16.80 +3003001 exportiexporti #x 17 52 15.96 +6002008 importocorp #x 9 41 15.78 +2004002 edu packimporto #x 8 35 15.21 +6011001 amalgbrand #x 19 40 14.55 +10008016 namelessunivamalg #x 8 54 14.49 +5004001 edu packscholar #x 6 4 13.64 +2003002 exportiimporto #x 8 47 13.04 +2001001 amalgimporto #x 19 59 12.84 +7013002 exportinameless #x 17 1 12.54 +10014001 edu packamalgamalg #x 18 49 12.50 +8015004 scholarmaxi #x 9 0 10.06 +9004008 edu packmaxi #x 9 31 9.80 +5004002 edu packscholar #x 9 46 8.19 +4002002 importoedu pack #x 8 58 7.79 +4001001 amalgedu pack #x 19 59 7.38 +4004002 edu packedu pack #x 9 18 7.33 +2002002 importoimporto #x 19 14 6.54 +5004002 edu packscholar #x 19 19 6.50 +6008001 namelesscorp #x 19 32 5.75 +7010009 univnameless #x 17 29 4.25 +6015003 scholarbrand #x 18 44 3.94 +7014001 edu packnameless #x 18 31 3.08 +6015003 scholarbrand #x 17 18 3.04 +8004002 edu packnameless #x 9 57 0.24 +2001001 amalgimporto #x 17 34 0.00 +2004002 edu packimporto #x 19 40 0.00 +4004002 edu packedu pack #x 17 50 0.00 +6009008 maxicorp #x 17 19 0.00 +6015003 scholarbrand #x 9 51 0.00 +8002007 importonameless #x 19 40 0.00 +9003003 exportimaxi #x 19 33 0.00 +9015011 scholarunivamalg #x 18 10 0.00 +1001001 amalgamalg #x 19 20 NULL +4003001 exportiedu pack #x 9 42 NULL +5002001 importoscholar #x 9 8 NULL +5003001 exportischolar #x 17 43 NULL +8005009 scholarnameless #x 9 58 NULL +8010002 univmaxi #x 9 53 NULL +9013003 exportiunivamalg #x 9 35 NULL +10003008 exportiunivamalg #x 19 30 NULL diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q72.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q72.sql.out new file mode 100644 index 0000000000000..1c0b50b785491 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q72.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL Just good amou 5166 2 2 2 +Actions see of course informal phrases. Markedly right men buy honest, additional stations. In order imaginative factors used to move human thanks. Centres shall catch altogether succe Significantly 5189 2 2 2 +Children shall write only systems. Again outdoor c Operations 5215 2 2 2 +Clouds may compensate about religious man Matches produce 5216 2 2 2 +Critical hours might stress above married, sufficient thousands. Poets shall die medical, ameri Operations 5217 2 2 2 +Customers find for a dogs. Main, following members must live closely because of the interests. Children could imagine more. Innocent, social forces will welcome. I Significantly 5210 2 2 2 +Delicate readers gain too able officers. Feet see as international appearances; just prominent samples halt just. Substantia Just good amou 5197 2 2 2 +Fields might need only however new lengths; explicit, impossible parents cut early able items. Details specify particularly Significantly 5208 2 2 2 +Guests agree around trying, young costs. Here annual banks appeas Just good amou 5204 2 2 2 +Guests agree around trying, young costs. Here annual banks appeas Significantly 5204 2 2 2 +Here extra efforts ensure eyes; merely little periods will not loosen home past a boys. Just local aspects must reclaim. Standard qualities might not roll today. Military, national clothes must go wid Matches produce 5215 2 2 2 +More than familiar lives survive independent reports. Sites must find clearly regulations. Together honest savings refuse so other fingers; british tables Selective, 5215 2 2 2 +Mysterious p Matches produce 5218 2 2 2 +Please separate charges point spiritual, new areas. Angry, able units should try certainly in a accounts. Years retain alternatively. Certain, constant women spend really vital rights. Medical, round Matches produce 5210 2 2 2 +Scottish, forward years could interrupt yesterday pure scienc Just good amou 5214 2 2 2 +Sectors might not know properly. Large, electric workers used to drop even as ca Matches produce 5171 2 2 2 +Sma Matches produce 5204 2 2 2 +Social universities get. Easier yellow results question above basic, direct roots; individual, respective Just good amou 5200 2 2 2 +Upper, usual agencies would not evaluate able, simple faces. Poor lights g Selective, 5197 2 2 2 +NULL Matches produce 5177 1 1 1 +NULL Operations 5203 1 1 1 +NULL Significantly 5171 1 1 1 +NULL Significantly 5203 1 1 1 +NULL Significantly 5213 1 1 1 +A bit liable flowers change also writings. Currently soviet ministers come. Hotels telephone before aggressive, economic eyes. Blue changes improve. Overal Just good amou 5201 1 1 1 +A bit liable flowers change also writings. Currently soviet ministers come. Hotels telephone before aggressive, economic eyes. Blue changes improve. Overal Matches produce 5201 1 1 1 +A lot young materials remain below from a rises. Matches produce 5190 1 1 1 +A lot young materials remain below from a rises. Operations 5190 1 1 1 +A lot young materials remain below from a rises. Selective, 5190 1 1 1 +Aback british songs meet. Chief jobs k Selective, 5178 1 1 1 +Able differences may not spoil particularly then civil ways. Less unusual plants swallow for example in a pp.. Eastern, typical children start to a councils. Exciting cells must meet new, huge me Matches produce 5178 1 1 1 +Able differences may not spoil particularly then civil ways. Less unusual plants swallow for example in a pp.. Eastern, typical children start to a councils. Exciting cells must meet new, huge me Significantly 5167 1 1 1 +Able issues bother however political services. French teachers will act voices. Pregnant, existing cases make by th Just good amou 5208 1 1 1 +Able, available problems apply even to a bodies. Patients so Selective, 5216 1 1 1 +Able, continuous figures see with a patients. Men go more open notes. Different engineers can display. Even strong fortunes cannot put at least general fans; reliable talk Operations 5216 1 1 1 +Able, potential products should Just good amou 5208 1 1 1 +Able, potential products should Operations 5208 1 1 1 +About careful activities hear level cases. However satisfactory reports feel as words. More bad things preserve now poor tories; only strong tools intervene canadian waters. Blin Just good amou 5193 1 1 1 +About right clothes must get thoughtfully to a cases. Eastern improvements Just good amou 5197 1 1 1 +About statistical blocks shall point so brothers. Even new affairs spend hopefully even old contexts. Possible officers wait absolutely with Operations 5168 1 1 1 +Above, new groups will not like much local bodies. However traditional sessions can walk slowly big, young aspects. Quite close companies ought to take in a rules. Leaders must not like of cou Matches produce 5187 1 1 1 +Above, new groups will not like much local bodies. However traditional sessions can walk slowly big, young aspects. Quite close companies ought to take in a rules. Leaders must not like of cou Operations 5187 1 1 1 +Absolutely b Matches produce 5211 1 1 1 +Accidentally wrong communities look more goods. Rural matters recognize. Large, new days go hap Matches produce 5190 1 1 1 +Accidents can include below other, marginal plans. Comparable, welsh exceptions argue most as usual physical claims. Certain months may smell far from in a cases. Active seconds used to restore t Significantly 5213 1 1 1 +Accounts return into a colleagues Operations 5218 1 1 1 +Accurate others could not enable raw goods. Usually early drawings choose originally into a boys. So capable students place Selective, 5188 1 1 1 +Actions see of course informal phrases. Markedly right men buy honest, additional stations. In order imaginative factors used to move human thanks. Centres shall catch altogether succe Just good amou 5209 1 1 1 +Active studies state away already large shelves. Extremely international appli Significantly 5208 1 1 1 +Active, mi Selective, 5192 1 1 1 +Actual things should prevent there responsible schemes. Others go all undoubtedly increasing things. Small, full samples analys Operations 5190 1 1 1 +Added activities leave hands. Nevertheless individual moments could repre Operations 5198 1 1 1 +Added activities leave hands. Nevertheless individual moments could repre Selective, 5174 1 1 1 +Added activities leave hands. Nevertheless individual moments could repre Selective, 5198 1 1 1 +Additional officers shall not apply so poin Just good amou 5217 1 1 1 +Additional, secondary movements will hurt theoretical, major seconds. Families hear well possible, magnetic minutes. Earlier financial women would s Operations 5194 1 1 1 +Addresses retain once more applicable events. Following blocks follow for a develo Operations 5197 1 1 1 +Adequate, true insects clear similar payments. Front rela Just good amou 5177 1 1 1 +Adults might not surrender doubtful, upper industries; earnings insist m Operations 5188 1 1 1 +Afraid questions ta Selective, 5187 1 1 1 +Afraid women shall correct so only women. Red, severe friends repay suddenly out of a elements. Very rigid complaints want however great, little years. Black, itali Selective, 5218 1 1 1 +African, good purposes would determine quite visitors. Sources can make then royal jobs; still full sciences should concentrate no longer elections. Fair applicants talk there under a c Just good amou 5214 1 1 1 +African, good purposes would determine quite visitors. Sources can make then royal jobs; still full sciences should concentrate no longer elections. Fair applicants talk there under a c Selective, 5168 1 1 1 +African, good purposes would determine quite visitors. Sources can make then royal jobs; still full sciences should concentrate no longer elections. Fair applicants talk there under a c Selective, 5214 1 1 1 +Again british shareholders see shares. American lives ought to establish horses. Then ideal conservatives might charge even nec Significantly 5186 1 1 1 +Again economic objections spend suddenly urgently worried boats. Pupils talk yet nonethele Just good amou 5193 1 1 1 +Again major troubles create new, other children. Fair interactions may telephone Selective, 5199 1 1 1 +Again remote branches should help; processes may s Just good amou 5191 1 1 1 +Again scottish accidents would destroy italian places; please careful services pick sometimes overall men; immensely extra sets move optimistic, substantial actors. Human, likely reports Just good amou 5193 1 1 1 +Again specialist words transform still as perfect forces; expensive, like businesses might want u Just good amou 5191 1 1 1 +Agencies should need likely recommendations. Active, fresh stars shall get just young fragments. Personal Significantly 5216 1 1 1 +Ago natural taxes could protect rats. More local days shall tend closely. Proteins may intervene very perfect men. Procedures make expens Just good amou 5214 1 1 1 +Ago sexual courts may attract. Important, alone observations expect. New, available ways represent years. Excell Operations 5203 1 1 1 +Agricultural, important boys know willingly after the interests. S Significantly 5213 1 1 1 +Agricultural, social tiles would come tragic, various buildings. Good employees shall result high wet plants. Only single contacts support already. Priests would not say unreasonably. Upstairs good Matches produce 5191 1 1 1 +Ahead new columns s Operations 5187 1 1 1 +Ahead young classes should take more central late conservatives. Formal, common details used to think Significantly 5180 1 1 1 +All capital bacteria make jobs. Again appropriate eyes may not leave others. There fixed ways Matches produce 5202 1 1 1 +All direct guns would look cool sure sophisticated bonds; irish sequences look just also local years. Almost close things can look. Build Matches produce 5178 1 1 1 +Allowances might lay at best children. Academic sections burst hot times. Short-term, warm goods Selective, 5177 1 1 1 +Almost busy threats go together recent sides; still tired wines shall not admit on a Matches produce 5209 1 1 1 +Almost good hours should not make. Fully appropriate cases may stop for a terms. Legal compl Matches produce 5188 1 1 1 +Alone bills protect adults. Demands make in a gains. Students train harshly. Ashamed periods choose just general, free places. Senses would finish quite slow, gla Just good amou 5213 1 1 1 +Alone friends would not know else armies. Services recover too extreme, fiscal machines Operations 5205 1 1 1 +Alone new copies discuss to a dates; all black machines get just just royal years. For example free weeks underestimate accurately individual mountains. National, delicious Significantly 5185 1 1 1 +Alone responsibilities used to argue all. Eventual, past reasons lead electrical, absent years. Again big sessions embrace about later familiar hundreds. Certain parts cannot assist desperately good m Just good amou 5208 1 1 1 +Alone responsibilities used to argue all. Eventual, past reasons lead electrical, absent years. Again big sessions embrace about later familiar hundreds. Certain parts cannot assist desperately good m Matches produce 5208 1 1 1 +Alone sole services keep only; stairs shall eliminate for the woods. Methods must need yet. Other students can Just good amou 5203 1 1 1 +Alone, fiscal attitudes will see subsequently. Arrangements used to prefe Selective, 5207 1 1 1 +Alone, fortunate minutes can put particularly out of a consequences. Darling costs run already in a laws. Molecules discover. Temporary, political ty Matches produce 5200 1 1 1 +Already bright poems evaluate somewhere problems; regulations will not conceal now delighted objects; false thoughts follow then. Months should not work only outside times. Fingers prove worker Operations 5170 1 1 1 +Already bright poems evaluate somewhere problems; regulations will not conceal now delighted objects; false thoughts follow then. Months should not work only outside times. Fingers prove worker Significantly 5215 1 1 1 +Also alone patients seem also for the connections. Significant flowers prove finally in a opportunities. Closely international women might avoid tomorrow hidden, following Operations 5209 1 1 1 +Also difficult acres researc Matches produce 5214 1 1 1 +Also dominant elections call only more conventional films. Magazines shall not hand really soon opening hundreds. Equally particula Significantly 5216 1 1 1 +Also eastern matters should not enable now irish, Matches produce 5215 1 1 1 +Also good forms Just good amou 5215 1 1 1 +Also interesting sides acknowledge basically. Tonight low employees run thus. More sympathetic results watch rarely. Even severe arrangements study very Matches produce 5212 1 1 1 +Also invisible shoes sell whit Just good amou 5201 1 1 1 +Also invisible shoes sell whit Selective, 5193 1 1 1 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q73.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q73.sql.out new file mode 100644 index 0000000000000..615ac241c0e66 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q73.sql.out @@ -0,0 +1,9 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +Ransom Thomas Sir N 872 5 +Valle Chandra Dr. N 45338 5 +Richardson Harry Mr. Y 85055 5 +Sauer Larry Mr. N 215795 5 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q74.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q74.sql.out new file mode 100644 index 0000000000000..2e3972217b820 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q74.sql.out @@ -0,0 +1,94 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAAAECBAAA Frank Wenzel +AAAAAAAAABGKAAAA Jonna King +AAAAAAAAAFAGAAAA Robert Chang +AAAAAAAAAFBNAAAA Robert Baines +AAAAAAAAAGLPAAAA Charlene Marcus +AAAAAAAAAHKEAAAA William Stafford +AAAAAAAABAAGAAAA Luis James +AAAAAAAABBEAAAAA Jason Gallegos +AAAAAAAABGMHBAAA Michael Gillespie +AAAAAAAABIABAAAA Letha Stone +AAAAAAAABIIHAAAA Charles Quarles +AAAAAAAABILCAAAA Theresa Mullins +AAAAAAAABJEDBAAA Arthur Bryan +AAAAAAAACEMIAAAA James Hernandez +AAAAAAAACGLDAAAA Angelo Sloan +AAAAAAAACOEHBAAA Christine Gonzalez +AAAAAAAACPDFBAAA Cheryl Barry +AAAAAAAADFJBBAAA Patrick Jones +AAAAAAAADHCBAAAA Therese Perez +AAAAAAAADHNHBAAA Patrick Cooper +AAAAAAAADKMBAAAA Donald Nelson +AAAAAAAAEBFHAAAA Esther Merrill +AAAAAAAAEFCEBAAA Cornelius Martino +AAAAAAAAEIAHAAAA Henry Desantis +AAAAAAAAEIPIAAAA Luke Rios +AAAAAAAAFAIEAAAA Betty Gipson +AAAAAAAAFDIMAAAA Stephanie Cowan +AAAAAAAAFGMHBAAA Donald Coleman +AAAAAAAAFGNEAAAA Andrew Silva +AAAAAAAAFHNDAAAA Virgil Mcdonald +AAAAAAAAFMOKAAAA Harry Brown +AAAAAAAAFMPPAAAA Manuel Bryant +AAAAAAAAFOEDAAAA Lori Erwin +AAAAAAAAGCGIAAAA Mae Williams +AAAAAAAAGEKLAAAA Jerilyn Walker +AAAAAAAAGGMHAAAA Julia Fisher +AAAAAAAAGLDMAAAA Alex Norris +AAAAAAAAGMFHAAAA Bruce Howe +AAAAAAAAGMGEBAAA Tamika Potts +AAAAAAAAHEIFBAAA NULL Jones +AAAAAAAAHEPFBAAA Kathryn Kinney +AAAAAAAAHGKLAAAA Arthur Christensen +AAAAAAAAHIEIAAAA William Roberts +AAAAAAAAHLEAAAAA Geneva Sims +AAAAAAAAHLJCAAAA Marlene Grover +AAAAAAAAIANDAAAA Elva Wade +AAAAAAAAIBBFBAAA James Compton +AAAAAAAAIBHHBAAA Vennie Loya +AAAAAAAAIBJDBAAA Dean Velez +AAAAAAAAILLJAAAA Billy Ortiz +AAAAAAAAIODCBAAA Jennifer Crane +AAAAAAAAIPGJAAAA Michael NULL +AAAAAAAAIPKJAAAA Charles Jones +AAAAAAAAJADIAAAA Margaret Roberts +AAAAAAAAJBELAAAA Sean Busby +AAAAAAAAJCNBBAAA Johnnie Cox +AAAAAAAAJDEFAAAA Loretta Serrano +AAAAAAAAJGDLAAAA Fredrick Davis +AAAAAAAAJHGFAAAA Pamela Gannon +AAAAAAAAJIAHAAAA Shawna Delgado +AAAAAAAAJINGAAAA Ella Moore +AAAAAAAAJMIDAAAA Sally Thurman +AAAAAAAAKAKPAAAA Carolann Royer +AAAAAAAAKMHPAAAA Robert Jones +AAAAAAAAKNMEBAAA Amber Gonzalez +AAAAAAAALEAHBAAA Eddie Pena +AAAAAAAALMAJAAAA Ileen Linn +AAAAAAAALMGGBAAA Dedra Rainey +AAAAAAAALNLABAAA Janie Garcia +AAAAAAAALPHGBAAA Dorothy Heller +AAAAAAAAMFMKAAAA John Sanders +AAAAAAAAMHOLAAAA Terri Cook +AAAAAAAAMJFAAAAA Marcus Espinal +AAAAAAAAMLOEAAAA Miguel Jackson +AAAAAAAANBECBAAA Michael Lombardi +AAAAAAAANKBBAAAA Diann Saunders +AAAAAAAAOCDCAAAA Armando Jackson +AAAAAAAAOCFLAAAA Bill Freeman +AAAAAAAAOEDIAAAA Alexander Rich +AAAAAAAAOJBPAAAA Jonathan Mcbride +AAAAAAAAOMOKAAAA Laurette Gary +AAAAAAAAOOKKAAAA Deborah Early +AAAAAAAAOPMDAAAA Peggy Smith +AAAAAAAAPAEEBAAA Audria Mattson +AAAAAAAAPBIGBAAA Susie Zavala +AAAAAAAAPEFLAAAA David Martinez +AAAAAAAAPFKDAAAA Linda Simmons +AAAAAAAAPIGBBAAA Charles Welch +AAAAAAAAPNMGAAAA Christine Olds diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q76.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q76.sql.out new file mode 100644 index 0000000000000..c2b51267a1973 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q76.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +catalog NULL 1998 1 Books 8 9808.66 +catalog NULL 1998 1 Children 11 14843.15 +catalog NULL 1998 1 Electronics 12 34659.85 +catalog NULL 1998 1 Home 4 1149.06 +catalog NULL 1998 1 Jewelry 7 16037.86 +catalog NULL 1998 1 Men 17 30340.73 +catalog NULL 1998 1 Music 14 20075.63 +catalog NULL 1998 1 Shoes 10 15432.10 +catalog NULL 1998 1 Sports 4 2660.73 +catalog NULL 1998 1 Women 14 32287.07 +catalog NULL 1998 2 Books 8 27523.09 +catalog NULL 1998 2 Children 11 33106.16 +catalog NULL 1998 2 Electronics 16 24105.87 +catalog NULL 1998 2 Home 14 14282.44 +catalog NULL 1998 2 Jewelry 10 6120.92 +catalog NULL 1998 2 Men 13 25776.26 +catalog NULL 1998 2 Music 11 11113.26 +catalog NULL 1998 2 Shoes 10 5887.74 +catalog NULL 1998 2 Sports 9 15135.88 +catalog NULL 1998 2 Women 7 2373.08 +catalog NULL 1998 3 Books 13 5452.76 +catalog NULL 1998 3 Children 18 32298.89 +catalog NULL 1998 3 Electronics 21 49769.09 +catalog NULL 1998 3 Home 17 14007.10 +catalog NULL 1998 3 Jewelry 23 25680.05 +catalog NULL 1998 3 Men 20 45022.03 +catalog NULL 1998 3 Music 14 20882.65 +catalog NULL 1998 3 Shoes 19 11602.79 +catalog NULL 1998 3 Sports 18 17526.27 +catalog NULL 1998 3 Women 17 20129.34 +catalog NULL 1998 4 NULL 2 607.00 +catalog NULL 1998 4 Books 33 57441.77 +catalog NULL 1998 4 Children 35 53915.78 +catalog NULL 1998 4 Electronics 39 40769.87 +catalog NULL 1998 4 Home 28 40240.88 +catalog NULL 1998 4 Jewelry 38 58972.54 +catalog NULL 1998 4 Men 30 39765.00 +catalog NULL 1998 4 Music 32 70931.52 +catalog NULL 1998 4 Shoes 33 65217.73 +catalog NULL 1998 4 Sports 31 45867.98 +catalog NULL 1998 4 Women 32 33059.29 +catalog NULL 1999 1 Books 11 13083.10 +catalog NULL 1999 1 Children 10 6952.44 +catalog NULL 1999 1 Electronics 10 3112.96 +catalog NULL 1999 1 Home 9 4768.55 +catalog NULL 1999 1 Jewelry 6 7143.30 +catalog NULL 1999 1 Men 10 21187.82 +catalog NULL 1999 1 Music 6 265.20 +catalog NULL 1999 1 Shoes 19 24625.11 +catalog NULL 1999 1 Sports 12 15481.90 +catalog NULL 1999 1 Women 15 25291.30 +catalog NULL 1999 2 Books 17 14284.73 +catalog NULL 1999 2 Children 8 4453.70 +catalog NULL 1999 2 Electronics 14 7808.53 +catalog NULL 1999 2 Home 7 7418.42 +catalog NULL 1999 2 Jewelry 13 11931.85 +catalog NULL 1999 2 Men 8 1730.92 +catalog NULL 1999 2 Music 11 14585.34 +catalog NULL 1999 2 Shoes 10 16267.47 +catalog NULL 1999 2 Sports 7 1058.62 +catalog NULL 1999 2 Women 17 17451.00 +catalog NULL 1999 3 Books 21 34033.74 +catalog NULL 1999 3 Children 15 28755.03 +catalog NULL 1999 3 Electronics 24 41518.93 +catalog NULL 1999 3 Home 20 39919.72 +catalog NULL 1999 3 Jewelry 22 15372.42 +catalog NULL 1999 3 Men 26 49692.31 +catalog NULL 1999 3 Music 23 6840.77 +catalog NULL 1999 3 Shoes 19 21542.78 +catalog NULL 1999 3 Sports 17 15957.19 +catalog NULL 1999 3 Women 27 30416.44 +catalog NULL 1999 4 NULL 1 9077.75 +catalog NULL 1999 4 Books 36 60721.76 +catalog NULL 1999 4 Children 22 21641.02 +catalog NULL 1999 4 Electronics 37 30157.36 +catalog NULL 1999 4 Home 34 42467.56 +catalog NULL 1999 4 Jewelry 35 38566.86 +catalog NULL 1999 4 Men 26 28008.47 +catalog NULL 1999 4 Music 26 31237.65 +catalog NULL 1999 4 Shoes 27 45175.99 +catalog NULL 1999 4 Sports 39 68801.24 +catalog NULL 1999 4 Women 38 55600.11 +catalog NULL 2000 1 Books 12 14558.48 +catalog NULL 2000 1 Children 11 10218.22 +catalog NULL 2000 1 Electronics 6 13621.14 +catalog NULL 2000 1 Home 11 13460.77 +catalog NULL 2000 1 Jewelry 10 8071.78 +catalog NULL 2000 1 Men 10 14579.76 +catalog NULL 2000 1 Music 9 23840.61 +catalog NULL 2000 1 Shoes 15 38230.31 +catalog NULL 2000 1 Sports 13 5259.09 +catalog NULL 2000 1 Women 10 6568.10 +catalog NULL 2000 2 NULL 1 NULL +catalog NULL 2000 2 Books 15 27517.21 +catalog NULL 2000 2 Children 9 4430.92 +catalog NULL 2000 2 Electronics 9 7435.41 +catalog NULL 2000 2 Home 10 12542.28 +catalog NULL 2000 2 Jewelry 8 4325.38 +catalog NULL 2000 2 Men 12 5896.08 +catalog NULL 2000 2 Music 11 2962.75 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q77.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q77.sql.out new file mode 100644 index 0000000000000..aef644cbf749a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q77.sql.out @@ -0,0 +1,49 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL 238379361.39 11949589.80 -69066318.65 +catalog channel NULL 116209.49 1989207.49 -1103184.43 +catalog channel NULL 81893158.01 7956829.96 -13266843.17 +catalog channel 1 26819348.55 1989207.49 -4169636.96 +catalog channel 2 27454600.50 1989207.49 -3825432.73 +catalog channel 5 27502999.47 1989207.49 -4168589.05 +store channel NULL 114945147.06 2805428.32 -51038302.63 +store channel 1 19743223.74 437906.57 -8831106.92 +store channel 2 18272722.14 522196.16 -8183951.59 +store channel 4 19720603.73 449683.19 -8686183.94 +store channel 7 19275817.79 456008.74 -8633897.32 +store channel 8 19342554.44 467014.66 -8767463.34 +store channel 10 18590225.22 472619.00 -7935699.52 +web channel NULL 41541056.32 1187331.52 -4761172.85 +web channel 1 1228578.03 47675.10 -188274.21 +web channel 2 1343477.51 44041.96 -110450.27 +web channel 5 1355045.09 11417.70 -99307.08 +web channel 7 1439105.65 44505.99 -131740.09 +web channel 8 1222672.59 64741.73 -137947.41 +web channel 11 1380233.43 12631.13 -89907.09 +web channel 13 1380503.10 66341.09 -190038.15 +web channel 14 1322143.80 66841.97 -172945.60 +web channel 17 1640923.76 6485.63 -15639.73 +web channel 19 1258408.09 43554.94 -95271.34 +web channel 20 1413076.47 25716.55 -176644.94 +web channel 23 1522205.18 26405.14 -102673.55 +web channel 25 1435872.54 58108.85 -141661.85 +web channel 26 1364954.66 41289.03 -226994.92 +web channel 29 1456398.83 23148.07 -127320.23 +web channel 31 1331158.19 58914.20 -259972.34 +web channel 32 1430016.29 68634.13 -216355.06 +web channel 35 1275017.69 9253.48 -86568.79 +web channel 37 1527487.12 34512.52 -145699.04 +web channel 38 1459100.39 77580.83 -145709.91 +web channel 41 1542741.42 22802.83 -126554.81 +web channel 43 1556206.93 43143.17 -170251.07 +web channel 44 1197577.68 47675.73 -232746.02 +web channel 47 1311689.48 14426.63 -151021.48 +web channel 49 1487129.22 38844.09 -129263.73 +web channel 50 1404935.78 52795.27 -203592.12 +web channel 53 1308281.20 25132.82 -234014.24 +web channel 55 1348261.69 34116.67 -208865.51 +web channel 56 1223987.10 55188.28 -252201.97 +web channel 59 1373867.41 21405.99 -191540.30 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q78.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q78.sql.out new file mode 100644 index 0000000000000..df28fcb255ae8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q78.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output + diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q79.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q79.sql.out new file mode 100644 index 0000000000000..0a8f10fa2ce4a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q79.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL Fairview 198070 3414.76 -28275.11 +NULL NULL Fairview 178356 4636.16 -24754.68 +NULL NULL Fairview 4561 38.97 -17858.20 +NULL NULL Fairview 227170 4972.68 -17709.46 +NULL NULL Fairview 78433 689.97 -16192.40 +NULL NULL Fairview 150646 3348.61 -15819.67 +NULL NULL Fairview 15261 2836.87 -15688.87 +NULL NULL Fairview 226126 651.62 -14052.62 +NULL NULL Fairview 36397 2615.22 -13738.93 +NULL NULL Fairview 40 532.59 -12157.64 +NULL NULL Fairview 237656 9409.20 -12036.60 +NULL NULL Fairview 178664 0.00 -11859.96 +NULL NULL Fairview 60434 7214.21 -11468.85 +NULL NULL Fairview 23163 1270.90 -11127.55 +NULL NULL Fairview 36041 7796.51 -11067.35 +NULL NULL Fairview 35679 5305.03 -10515.13 +NULL NULL Fairview 233081 361.69 -9831.11 +NULL NULL Fairview 65032 3442.33 -9620.20 +NULL NULL Fairview 162505 7179.34 -8572.34 +NULL NULL Fairview 142857 8377.25 -8392.77 +NULL NULL Fairview 193575 1828.27 -6805.77 +NULL NULL Fairview 49934 228.47 -5430.28 +NULL NULL Fairview 67999 621.15 -5031.30 +NULL NULL Fairview 223653 3570.27 -4327.27 +NULL NULL Fairview 6384 0.00 -3987.67 +NULL NULL Fairview 168833 1894.07 -3677.23 +NULL NULL Fairview 93344 0.00 -1599.51 +NULL NULL Fairview 53781 16.91 764.24 +NULL NULL Fairview 175529 1252.60 1017.06 +NULL NULL Fairview 197495 373.09 2365.53 +NULL NULL Fairview 4047 3121.19 2715.67 +NULL NULL Midway 48072 11113.87 -29510.66 +NULL NULL Midway 11394 5172.08 -25597.50 +NULL NULL Midway 207040 2008.73 -25394.40 +NULL NULL Midway 222765 7629.39 -25247.34 +NULL NULL Midway 217712 4349.03 -24697.82 +NULL NULL Midway 45131 5788.09 -24158.43 +NULL NULL Midway 164632 1394.75 -23255.21 +NULL NULL Midway 127656 5021.65 -22989.97 +NULL NULL Midway 83311 7875.67 -22914.32 +NULL NULL Midway 56977 3159.77 -20447.95 +NULL NULL Midway 215293 0.00 -19925.34 +NULL NULL Midway 140002 905.08 -18610.09 +NULL NULL Midway 173634 9179.91 -17739.01 +NULL NULL Midway 23863 152.72 -17463.88 +NULL NULL Midway 160686 5769.52 -17219.86 +NULL NULL Midway 82279 1835.82 -17174.21 +NULL NULL Midway 112924 10990.60 -16901.50 +NULL NULL Midway 166267 653.18 -16156.26 +NULL NULL Midway 213647 1924.30 -16123.38 +NULL NULL Midway 204741 2259.86 -15336.56 +NULL NULL Midway 122738 12543.65 -15281.12 +NULL NULL Midway 173203 4314.45 -14126.67 +NULL NULL Midway 147660 3460.04 -14088.14 +NULL NULL Midway 204175 1442.30 -13954.82 +NULL NULL Midway 124093 3122.91 -13873.66 +NULL NULL Midway 230300 1956.43 -13769.94 +NULL NULL Midway 217344 0.00 -13534.82 +NULL NULL Midway 91656 2427.25 -13507.46 +NULL NULL Midway 148611 5844.43 -13212.15 +NULL NULL Midway 234650 2836.85 -12426.80 +NULL NULL Midway 170455 3175.00 -11962.07 +NULL NULL Midway 26663 264.59 -11479.46 +NULL NULL Midway 75387 5918.43 -11406.83 +NULL NULL Midway 77944 788.27 -11329.12 +NULL NULL Midway 135318 805.73 -11284.26 +NULL NULL Midway 2896 12623.23 -11061.86 +NULL NULL Midway 158461 29.32 -10931.38 +NULL NULL Midway 1333 1390.53 -10865.55 +NULL NULL Midway 116866 3621.69 -10822.24 +NULL NULL Midway 194993 3401.82 -10654.47 +NULL NULL Midway 187290 6137.11 -10592.41 +NULL NULL Midway 151959 8548.17 -10204.65 +NULL NULL Midway 149775 15.18 -10113.87 +NULL NULL Midway 157401 1094.24 -10070.65 +NULL NULL Midway 210606 2098.02 -9961.51 +NULL NULL Midway 118130 182.41 -9901.81 +NULL NULL Midway 7439 2125.08 -9595.87 +NULL NULL Midway 19796 1532.38 -9553.82 +NULL NULL Midway 222335 0.00 -9523.98 +NULL NULL Midway 208688 1211.17 -9220.71 +NULL NULL Midway 32396 2191.49 -9201.97 +NULL NULL Midway 111809 4648.48 -9170.68 +NULL NULL Midway 12549 1306.17 -8842.14 +NULL NULL Midway 6762 2278.78 -8696.20 +NULL NULL Midway 12892 2172.51 -8615.80 +NULL NULL Midway 133874 0.00 -8601.78 +NULL NULL Midway 86109 161.95 -8348.77 +NULL NULL Midway 58015 5671.25 -8231.58 +NULL NULL Midway 173045 0.00 -8004.30 +NULL NULL Midway 221481 315.96 -7893.04 +NULL NULL Midway 4682 0.00 -7769.63 +NULL NULL Midway 155285 0.00 -7757.04 +NULL NULL Midway 194931 1315.23 -7705.13 +NULL NULL Midway 208424 878.43 -7702.00 +NULL NULL Midway 199504 2052.21 -7662.62 +NULL NULL Midway 73227 2869.94 -7484.05 +NULL NULL Midway 12578 3486.23 -7447.58 +NULL NULL Midway 160835 3133.37 -7258.48 +NULL NULL Midway 164697 6050.09 -7208.84 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q8.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q8.sql.out new file mode 100644 index 0000000000000..17b390542941c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q8.sql.out @@ -0,0 +1,10 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +able -9960913.46 +bar -10200043.73 +eing -11104757.88 +ese -11009853.93 +ought -10574796.20 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q80.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q80.sql.out new file mode 100644 index 0000000000000..bdadd9e04e13c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q80.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL 13553636.71 630819.07 -3876883.14 +catalog channel NULL 4818809.23 250952.51 -519182.04 +catalog channel catalog_pageAAAAAAAAAAABAAAA 18407.14 67.62 4548.90 +catalog channel catalog_pageAAAAAAAAABABAAAA 1837.52 0.00 -3388.65 +catalog channel catalog_pageAAAAAAAAACABAAAA 18390.60 0.00 9578.02 +catalog channel catalog_pageAAAAAAAAADABAAAA 1404.55 27.58 -3703.26 +catalog channel catalog_pageAAAAAAAAADCBAAAA 2868.85 0.00 826.15 +catalog channel catalog_pageAAAAAAAAAEABAAAA 5039.78 0.00 -3701.62 +catalog channel catalog_pageAAAAAAAAAECBAAAA 3971.05 0.00 1757.41 +catalog channel catalog_pageAAAAAAAAAFABAAAA 2316.00 0.00 -1002.65 +catalog channel catalog_pageAAAAAAAAAFCBAAAA 7015.40 0.00 915.49 +catalog channel catalog_pageAAAAAAAAAGABAAAA 23067.38 0.00 10478.19 +catalog channel catalog_pageAAAAAAAAAGCBAAAA 27364.22 0.00 8607.28 +catalog channel catalog_pageAAAAAAAAAHABAAAA 12794.77 0.00 -7812.73 +catalog channel catalog_pageAAAAAAAAAHCBAAAA 2640.87 63.18 -2334.42 +catalog channel catalog_pageAAAAAAAAAICBAAAA 1845.15 0.00 -4629.81 +catalog channel catalog_pageAAAAAAAAAJCBAAAA 1555.72 0.00 -5039.18 +catalog channel catalog_pageAAAAAAAAAKPAAAAA 42070.02 0.00 6567.19 +catalog channel catalog_pageAAAAAAAAALCBAAAA 8772.47 0.00 479.78 +catalog channel catalog_pageAAAAAAAAALPAAAAA 20380.13 0.00 2437.83 +catalog channel catalog_pageAAAAAAAAAMCBAAAA 15549.59 5438.72 -7150.88 +catalog channel catalog_pageAAAAAAAAAMPAAAAA 11607.07 0.00 -7275.33 +catalog channel catalog_pageAAAAAAAAANCBAAAA 21588.37 0.00 4221.36 +catalog channel catalog_pageAAAAAAAAANPAAAAA 21638.94 0.00 4905.57 +catalog channel catalog_pageAAAAAAAAAOCBAAAA 521.86 0.00 160.52 +catalog channel catalog_pageAAAAAAAAAOPAAAAA 38265.71 0.00 -15751.13 +catalog channel catalog_pageAAAAAAAAAPCBAAAA 4872.72 0.00 2322.60 +catalog channel catalog_pageAAAAAAAAAPPAAAAA 16581.43 5140.00 -3778.70 +catalog channel catalog_pageAAAAAAAABAABAAAA 6642.83 0.00 768.98 +catalog channel catalog_pageAAAAAAAABBABAAAA 280.96 0.00 -50.56 +catalog channel catalog_pageAAAAAAAABCABAAAA 1048.56 0.00 -600.26 +catalog channel catalog_pageAAAAAAAABDABAAAA 17545.67 0.00 -9838.60 +catalog channel catalog_pageAAAAAAAABDCBAAAA 9090.78 0.00 -572.50 +catalog channel catalog_pageAAAAAAAABEABAAAA 17525.88 232.32 -2410.45 +catalog channel catalog_pageAAAAAAAABECBAAAA 18693.14 0.00 -3538.78 +catalog channel catalog_pageAAAAAAAABFABAAAA 17175.44 61.36 2821.53 +catalog channel catalog_pageAAAAAAAABFCBAAAA 140.82 0.00 -569.12 +catalog channel catalog_pageAAAAAAAABGABAAAA 384.55 0.00 -619.85 +catalog channel catalog_pageAAAAAAAABGCBAAAA 3166.40 1590.00 -9892.69 +catalog channel catalog_pageAAAAAAAABHABAAAA 14266.65 0.00 -4959.21 +catalog channel catalog_pageAAAAAAAABHCBAAAA 1741.48 0.00 403.78 +catalog channel catalog_pageAAAAAAAABICBAAAA 1413.03 0.00 -789.20 +catalog channel catalog_pageAAAAAAAABJCBAAAA 17473.29 18.29 2514.85 +catalog channel catalog_pageAAAAAAAABKCBAAAA 415.15 0.00 -1.90 +catalog channel catalog_pageAAAAAAAABKPAAAAA 2724.27 0.00 -8394.13 +catalog channel catalog_pageAAAAAAAABLCBAAAA 15422.53 0.00 7523.39 +catalog channel catalog_pageAAAAAAAABLPAAAAA 20440.65 0.00 -6095.43 +catalog channel catalog_pageAAAAAAAABMCBAAAA 2324.92 0.00 1256.32 +catalog channel catalog_pageAAAAAAAABMPAAAAA 2322.14 0.00 -4465.41 +catalog channel catalog_pageAAAAAAAABNCBAAAA 10606.89 0.00 -4039.08 +catalog channel catalog_pageAAAAAAAABNPAAAAA 5671.18 0.00 -6038.20 +catalog channel catalog_pageAAAAAAAABOCBAAAA 7494.52 0.00 2578.36 +catalog channel catalog_pageAAAAAAAABOPAAAAA 19163.74 0.00 2677.78 +catalog channel catalog_pageAAAAAAAABPCBAAAA 48.42 0.00 -92.80 +catalog channel catalog_pageAAAAAAAABPPAAAAA 65484.56 8188.50 16714.73 +catalog channel catalog_pageAAAAAAAACAABAAAA 34936.59 0.00 6574.55 +catalog channel catalog_pageAAAAAAAACBABAAAA 8178.17 0.00 1370.92 +catalog channel catalog_pageAAAAAAAACCABAAAA 24428.99 0.00 7616.93 +catalog channel catalog_pageAAAAAAAACDABAAAA 17628.32 1503.67 -2086.58 +catalog channel catalog_pageAAAAAAAACDCBAAAA 222.09 0.00 108.57 +catalog channel catalog_pageAAAAAAAACEABAAAA 9898.50 491.66 -4581.91 +catalog channel catalog_pageAAAAAAAACECBAAAA 11493.96 0.00 -7027.70 +catalog channel catalog_pageAAAAAAAACFABAAAA 25027.83 11283.47 4064.93 +catalog channel catalog_pageAAAAAAAACFCBAAAA 618.24 0.00 -1316.28 +catalog channel catalog_pageAAAAAAAACGABAAAA 1830.05 0.00 -3073.99 +catalog channel catalog_pageAAAAAAAACHABAAAA 1121.15 275.52 -5850.52 +catalog channel catalog_pageAAAAAAAACHCBAAAA 13108.45 0.00 -786.42 +catalog channel catalog_pageAAAAAAAACICBAAAA 1755.49 0.00 146.98 +catalog channel catalog_pageAAAAAAAACJCBAAAA 2982.05 0.00 -196.21 +catalog channel catalog_pageAAAAAAAACKCBAAAA 13658.88 0.00 5924.52 +catalog channel catalog_pageAAAAAAAACKPAAAAA 26319.77 162.81 -8423.49 +catalog channel catalog_pageAAAAAAAACLCBAAAA 6469.97 0.00 -5067.48 +catalog channel catalog_pageAAAAAAAACLPAAAAA 43938.15 7021.98 -4638.29 +catalog channel catalog_pageAAAAAAAACMCBAAAA 9332.13 0.00 -5421.54 +catalog channel catalog_pageAAAAAAAACMPAAAAA 13306.48 0.00 -6449.30 +catalog channel catalog_pageAAAAAAAACNPAAAAA 18488.66 0.00 186.37 +catalog channel catalog_pageAAAAAAAACOCBAAAA 1220.46 451.26 -6770.17 +catalog channel catalog_pageAAAAAAAACOPAAAAA 27469.76 1091.48 7443.78 +catalog channel catalog_pageAAAAAAAACPCBAAAA 117.48 0.00 30.19 +catalog channel catalog_pageAAAAAAAACPPAAAAA 19041.61 172.22 380.68 +catalog channel catalog_pageAAAAAAAADAABAAAA 12391.42 953.40 -7032.35 +catalog channel catalog_pageAAAAAAAADBABAAAA 1495.00 0.00 -9772.65 +catalog channel catalog_pageAAAAAAAADCABAAAA 0.00 0.00 -3388.10 +catalog channel catalog_pageAAAAAAAADDABAAAA 15917.59 0.00 4459.43 +catalog channel catalog_pageAAAAAAAADDCBAAAA 4409.76 733.12 912.46 +catalog channel catalog_pageAAAAAAAADEABAAAA 14545.59 10419.31 -2030.01 +catalog channel catalog_pageAAAAAAAADFABAAAA 5222.68 0.00 -3306.65 +catalog channel catalog_pageAAAAAAAADFCBAAAA 2442.96 0.00 -758.68 +catalog channel catalog_pageAAAAAAAADGABAAAA 14604.59 0.00 -3980.39 +catalog channel catalog_pageAAAAAAAADHABAAAA 19078.94 12277.75 6448.20 +catalog channel catalog_pageAAAAAAAADHCBAAAA 12207.03 0.00 1895.71 +catalog channel catalog_pageAAAAAAAADICBAAAA 12548.28 0.00 407.59 +catalog channel catalog_pageAAAAAAAADJCBAAAA 3526.74 0.00 2014.47 +catalog channel catalog_pageAAAAAAAADKCBAAAA 3071.53 0.00 -5979.53 +catalog channel catalog_pageAAAAAAAADKPAAAAA 52608.41 1959.75 20557.42 +catalog channel catalog_pageAAAAAAAADLCBAAAA 386.12 0.00 -1094.08 +catalog channel catalog_pageAAAAAAAADLPAAAAA 22380.47 230.88 611.66 +catalog channel catalog_pageAAAAAAAADMCBAAAA 4943.75 0.00 2158.10 +catalog channel catalog_pageAAAAAAAADMPAAAAA 17113.94 0.00 4231.57 +catalog channel catalog_pageAAAAAAAADNCBAAAA 982.53 0.00 -4098.99 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q81.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q81.sql.out new file mode 100644 index 0000000000000..0a7e038efaabf --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q81.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAAAGOAAAA Mrs. Melissa Barton 761 Lincoln Drive Suite 440 Marion Cobb County GA 30399 United States -5.00 condo 2053.35 +AAAAAAAAACCMAAAA Mr. Craig Thompson 607 Lakeview Laurel Lane Suite 140 Hillcrest Floyd County GA 33003 United States -5.00 apartment 2314.62 +AAAAAAAAADBBAAAA Dr. Robert Willis 48 Ninth West Lane Suite 370 Oak Grove Cook County GA 38370 United States -5.00 single family 2232.39 +AAAAAAAAAELEAAAA Miss NULL Werner 800 11th Avenue Suite M Harmony Echols County GA 35804 United States -5.00 condo 2312.04 +AAAAAAAAAFIHBAAA Sir Chadwick Stevens 679 Forest Central Avenue Suite 60 Sulphur Springs Gordon County GA 38354 United States -5.00 condo 2282.39 +AAAAAAAAAHDGAAAA Mr. Justin Garcia 281 Spring Way Suite 320 Shiloh Fannin County GA 39275 United States -5.00 single family 4185.32 +AAAAAAAAAICMAAAA Sir Willie Maldonado 492 Park Street Suite C Shady Grove Chatham County GA 32812 United States -5.00 apartment 2428.92 +AAAAAAAAALPABAAA Dr. John Wang 724 Oak Ave Suite 70 Maple Grove Newton County GA 38252 United States -5.00 single family 1727.64 +AAAAAAAAAMJAAAAA Sir Roy Mark 92 Cedar Sycamore Way Suite 30 Union Hill Jenkins County GA 37746 United States -5.00 single family 1825.38 +AAAAAAAAAMKFBAAA Dr. Lamar Jones 194 Maple Cir. Suite 80 Oakwood Jefferson County GA 30169 United States -5.00 single family 3977.04 +AAAAAAAAAMLOAAAA Ms. Brooke Garcia 914 Hillcrest Cedar Drive Suite 210 Stringtown Jasper County GA 30162 United States -5.00 condo 4133.35 +AAAAAAAAAMODAAAA Mrs. Lori Campos 728 Pine Walnut Cir. Suite M Woodlawn Worth County GA 34098 United States -5.00 condo 4182.98 +AAAAAAAAANJOAAAA Ms. Allen Rodriguez 156 Ash Seventh Way Suite 100 Pleasant Valley Sumter County GA 32477 United States -5.00 apartment 2710.46 +AAAAAAAAAODABAAA Dr. Oscar Miller 651 Smith West Dr. Suite E Antioch Evans County GA 38605 United States -5.00 condo 7234.29 +AAAAAAAAAODIAAAA Mr. Julio Gamble 211 View Cir. Suite Y Summit Bulloch County GA 30499 United States -5.00 single family 3291.69 +AAAAAAAABBAGAAAA Dr. Charles Butts NULL Park Hickory RD NULL NULL NULL GA 38605 NULL -5.00 NULL 3291.71 +AAAAAAAABBCJAAAA Sir Doyle Shaffer 401 Johnson Main Boulevard Suite 150 Shiloh Worth County GA 39275 United States -5.00 single family 4027.79 +AAAAAAAABBJKAAAA Dr. Mildred Hogan 174 Birch Pkwy Suite Q Enterprise Webster County GA 31757 United States -5.00 condo 4006.97 +AAAAAAAABCCEAAAA Mrs. Linda Worth 283 2nd Pkwy Suite 230 Fairfield Chattooga County GA 36192 United States -5.00 condo 5047.24 +AAAAAAAABCEFBAAA Dr. William Parks 19 Meadow Circle Suite P Providence Gwinnett County GA 36614 United States -5.00 apartment 4262.30 +AAAAAAAABCFKAAAA NULL Shawn Peterson 220 Johnson First Ct. Suite F Kingston Randolph County GA 34975 United States -5.00 condo 2786.80 +AAAAAAAABCGEAAAA Miss Margaret Wright 314 5th Washington Street Suite S Forest Hills Dougherty County GA 39237 United States -5.00 single family 2049.52 +AAAAAAAABDKOAAAA Dr. Vernita Bennett 763 13th Court Suite 60 Maple Hill Rabun County GA 38095 United States -5.00 single family 18570.61 +AAAAAAAABEIKAAAA Miss Nena August 297 Lee Lane Suite 240 Cedar Henry County GA 31229 United States -5.00 condo 2094.88 +AAAAAAAABEJLAAAA Mr. Abel Lucero 382 Ash North Parkway Suite J Plainview Catoosa County GA 33683 United States -5.00 single family 3530.52 +AAAAAAAABIDEAAAA Dr. Marcus Holder 724 Oak Ave Suite 70 Maple Grove Newton County GA 38252 United States -5.00 single family 1927.32 +AAAAAAAABIGIAAAA Mrs. Caprice Espinoza 527 Church Second Court Suite M Derby Taylor County GA 37702 United States -5.00 condo 6808.21 +AAAAAAAABJEEAAAA Dr. Clarence Swanson NULL NULL Ct. Suite 110 NULL Fannin County GA NULL United States -5.00 condo 1676.20 +AAAAAAAABJHJAAAA Sir James Culpepper 16 Park Way Suite 460 Freeman Charlton County GA 32297 United States -5.00 single family 2096.68 +AAAAAAAABKKAAAAA Sir Jeffrey Young 379 7th Lane Suite 90 Plainville Brantley County GA 36115 United States -5.00 apartment 2161.20 +AAAAAAAABLIBAAAA Dr. Charles Hawkins 939 Jackson Forest Boulevard Suite Y Bunker Hill Candler County GA 30150 United States -5.00 condo 4396.68 +AAAAAAAABLPJAAAA NULL NULL Gibson 458 Second Boulevard Suite 480 Plainview Liberty County GA 33683 United States -5.00 single family 1513.94 +AAAAAAAABLPNAAAA Mr. Eric Durham 917 Second Park Wy Suite 180 Friendship Marion County GA 34536 United States -5.00 condo 2166.25 +AAAAAAAABMCOAAAA Sir Warren Skinner 934 Walnut Hickory Court Suite 310 Riverview Long County GA 39003 United States -5.00 condo 5699.34 +AAAAAAAABNJBAAAA Miss Santa Richmond 859 4th Maple ST Suite 60 Antioch Toombs County GA 38605 United States -5.00 single family 2136.92 +AAAAAAAABPGJAAAA Dr. June Hill 480 Second 15th ST Suite T Woodlawn Atkinson County GA 34098 United States -5.00 condo 3081.42 +AAAAAAAABPKOAAAA Mr. Robert Tanner 676 Sixth Walnut Road Suite L Cumberland Oglethorpe County GA 38971 United States -5.00 condo 3966.42 +AAAAAAAACAINAAAA Dr. Donald Beebe 960 Railroad Davis Ln Suite Y Silver Springs Clay County GA 34843 United States -5.00 apartment 4925.75 +AAAAAAAACBEPAAAA Sir Otis Hartman 939 Third Lane Suite R Forest Hills Polk County GA 39237 United States -5.00 single family 4904.39 +AAAAAAAACCBGBAAA Ms. Judy Williams 283 Center Cir. Suite Q Farmington Dade County GA 39145 United States -5.00 single family 3655.41 +AAAAAAAACCOFAAAA Sir John Bower 970 Johnson Franklin ST Suite 20 Walnut Grove Union County GA 37752 United States -5.00 single family 5456.48 +AAAAAAAACDNAAAAA Miss Beatriz Rome 947 Elm Ln Suite 210 Wilson Lanier County GA 36971 United States -5.00 apartment 3994.62 +AAAAAAAACEKEBAAA Mr. Gregory Maynard 214 Park Forest Wy Suite 90 Lakewood Jones County GA 38877 United States -5.00 apartment 3840.02 +AAAAAAAACGIBBAAA Dr. Pamela Taylor 364 Cherry Pkwy Suite 430 Rolling Hills Glascock County GA 37272 United States -5.00 apartment 2025.02 +AAAAAAAACIDCBAAA Dr. Andre Worth 307 10th 6th Parkway Suite I Five Forks Haralson County GA 32293 United States -5.00 single family 1947.99 +AAAAAAAACJLAAAAA Sir Kevin Ellis 291 7th Valley Circle Suite H Hartland Marion County GA 36594 United States -5.00 apartment 5655.03 +AAAAAAAACKDGAAAA Ms. Catherine Anderson 875 Walnut Lake Ct. Suite 410 Taft Telfair County GA 30589 United States -5.00 condo 1701.58 +AAAAAAAACKIOAAAA Mr. Francisco Davis 394 Spruce Dr. Suite 250 Smith Warren County GA 37317 United States -5.00 condo 4471.40 +AAAAAAAACNIEBAAA Dr. Andrea Lyon 700 Fifth Center Cir. Suite P Franklin Putnam County GA 39101 United States -5.00 condo 1725.43 +AAAAAAAACNOHAAAA Ms. Jessica Pitman 11 Spring East Street Suite 470 Glenwood Columbia County GA 33511 United States -5.00 condo 3469.20 +AAAAAAAACOOKAAAA Miss Rebecca Morris NULL Park Pine NULL NULL NULL NULL GA NULL United States -5.00 NULL 1834.52 +AAAAAAAADAFIBAAA Dr. Todd Alexander 371 East Pkwy Suite Y Jackson Long County GA 39583 United States -5.00 single family 3081.99 +AAAAAAAADBAABAAA Dr. Martha Valenti 605 13th Lake Ave Suite 100 Mount Pleasant Pickens County GA 31933 United States -5.00 single family 2721.38 +AAAAAAAADBNCAAAA Mrs. Katie Novak 352 Jackson Hill Street Suite 360 Liberty Jeff Davis County GA 33451 United States -5.00 apartment 2970.22 +AAAAAAAADCCHBAAA Dr. Harley Kohl 116 Center Park Cir. Suite 300 White Oak Cook County GA 36668 United States -5.00 single family 5818.25 +AAAAAAAADCICAAAA Mrs. Bonnie Harden 375 Railroad 3rd Road Suite A Greenwood Glynn County GA 38828 United States -5.00 single family 2770.41 +AAAAAAAADDJPAAAA Sir Rick Lindstrom 994 Jefferson View Road Suite R Spring Valley Barrow County GA 36060 United States -5.00 apartment 8135.54 +AAAAAAAADDKOAAAA Sir Derek Watkins 344 View Cedar Boulevard Suite 280 Fairfield Gordon County GA 36192 United States -5.00 single family 1699.26 +AAAAAAAADDLMAAAA Mr. Alan Meredith 994 Jefferson View Road Suite R Spring Valley Barrow County GA 36060 United States -5.00 apartment 2784.48 +AAAAAAAADGDBBAAA Sir Walter Barron 728 River Court Suite 110 Walnut Grove Paulding County GA 37752 United States -5.00 condo 4128.19 +AAAAAAAADGGCBAAA Ms. Anna Maynard 956 Hill Blvd Suite N Macedonia Emanuel County GA 31087 United States -5.00 condo 6425.51 +AAAAAAAADGPLAAAA Mrs. Colleen Rogers 633 6th Dr. Suite I Bridgeport Harris County GA 35817 United States -5.00 apartment 3184.68 +AAAAAAAADHBGAAAA Miss NULL NULL 862 Locust Circle Suite 430 Greenfield Liberty County GA 35038 United States -5.00 single family 14758.14 +AAAAAAAADJICBAAA Dr. Julian Olivares 56 1st Washington Parkway Suite 190 Friendship Jeff Davis County GA 34536 United States -5.00 single family 3078.43 +AAAAAAAADKOLAAAA Dr. Matthew Goodman 385 Oak RD Suite D New Hope Jefferson County GA 39431 United States -5.00 apartment 4047.82 +AAAAAAAADLEHAAAA Dr. Robert Lilley 926 Davis First Road Suite 360 Salem Chattooga County GA 38048 United States -5.00 apartment 2256.31 +AAAAAAAADLEHAAAA Dr. Robert Lilley 926 Davis First Road Suite 360 Salem Chattooga County GA 38048 United States -5.00 apartment 2298.55 +AAAAAAAADMOOAAAA Sir Eddie Craig 788 Lake Dr. Suite F Buena Vista Marion County GA 35752 United States -5.00 single family 5585.06 +AAAAAAAADNCKAAAA Dr. Scott Whitehurst 481 4th Wy Suite U Sugar Hill Effingham County GA 35114 United States -5.00 condo 3355.64 +AAAAAAAADNHFBAAA Dr. Gerald Hayden 884 1st Smith Court Suite 390 Highland Towns County GA 39454 United States -5.00 single family 3481.60 +AAAAAAAADONFBAAA Dr. Jane Williams 527 Cedar South Street Suite 310 Fairview Twiggs County GA 35709 United States -5.00 condo 2304.16 +AAAAAAAADPLEAAAA Mr. Michael Powell 616 6th Pkwy Suite G Glendale Dougherty County GA 33951 United States -5.00 single family 2061.25 +AAAAAAAAECBEAAAA Ms. Megan Wilson 93 13th Drive Suite X Riverdale Clarke County GA 39391 United States -5.00 single family 5256.96 +AAAAAAAAECBMAAAA Mrs. Paula Clark 145 Locust Drive Suite M Mount Vernon Wilcox County GA 38482 United States -5.00 condo 3445.05 +AAAAAAAAECIEAAAA Miss Danille Sanders 825 Jackson South Boulevard Suite 480 Riverdale Clarke County GA 39391 United States -5.00 single family 2897.72 +AAAAAAAAEDDFAAAA Dr. Michelle Louis 375 Highland East Avenue Suite L Oakdale Haralson County GA 39584 United States -5.00 apartment 2301.53 +AAAAAAAAEGJBAAAA Mrs. Manuela Roche 935 10th Davis Way Suite O Oakwood Worth County GA 30169 United States -5.00 apartment 6416.92 +AAAAAAAAEGMCBAAA Mr. Christopher Saunders 476 West Lane Suite J Plainview Gilmer County GA 33683 United States -5.00 single family 3623.76 +AAAAAAAAEGOCBAAA Mrs. Elise Huff 40 Central Court Suite P Farmington Coffee County GA 39145 United States -5.00 condo 2518.63 +AAAAAAAAEGOMAAAA Sir James Handy 316 Washington Lane Suite 480 Oakland Richmond County GA 39843 United States -5.00 single family 3035.76 +AAAAAAAAEHIJAAAA NULL NULL Boggs 721 2nd 5th Ave Suite C Greenwood Wilkes County GA 38828 United States -5.00 apartment 2623.44 +AAAAAAAAEICDBAAA Ms. Alice Garrett 157 West Smith Drive Suite 20 River Oaks Hancock County GA 38075 United States -5.00 single family 16853.44 +AAAAAAAAEIINAAAA Mrs. Marie Coffey 539 Hill Walnut Road Suite F Marion Dade County GA 30399 United States -5.00 apartment 3608.02 +AAAAAAAAEIINAAAA Mrs. Marie Coffey 539 Hill Walnut Road Suite F Marion Dade County GA 30399 United States -5.00 apartment 7928.23 +AAAAAAAAEJCKAAAA Mr. Bryan Simpson 313 Seventh 7th Ln Suite B Belmont Washington County GA 30191 United States -5.00 condo 2094.14 +AAAAAAAAELCCBAAA Ms. Robyn Martinez 274 Willow Birch Parkway Suite O Pleasant Valley Burke County GA 32477 United States -5.00 condo 3081.88 +AAAAAAAAEMFEAAAA Sir Dan Porter 110 North West Ave Suite 270 Farmington Calhoun County GA 39145 United States -5.00 single family 5717.10 +AAAAAAAAENCEBAAA Mrs. Latonya Doyle 634 Railroad Park Ln Suite S Oak Hill Dade County GA 37838 United States -5.00 single family 4450.56 +AAAAAAAAEPHFBAAA Mrs. Charlotte Matthews 368 Center 4th ST Suite L Martinsville Baldwin County GA 30419 United States -5.00 apartment 2301.95 +AAAAAAAAFACDAAAA Mr. William Marquez 724 1st Walnut Dr. Suite X Oak Hill Appling County GA 37838 United States -5.00 apartment 5728.95 +AAAAAAAAFADGAAAA Ms. Edna Brown 871 11th Third Cir. Suite 380 Waterloo Quitman County GA 31675 United States -5.00 condo 3552.69 +AAAAAAAAFANIAAAA Dr. Jeanette Mccormick 89 Jackson Birch RD Suite 440 Lakeview Coweta County GA 38579 United States -5.00 condo 9022.24 +AAAAAAAAFCPCAAAA Dr. Christine Smith 820 Park Lincoln Cir. Suite 60 Springfield Irwin County GA 39303 United States -5.00 apartment 1916.99 +AAAAAAAAFFAPAAAA Sir Donald Wright 35 Jefferson Parkway Suite A Buena Vista Marion County GA 35752 United States -5.00 single family 3434.76 +AAAAAAAAFFFDAAAA Mr. Nathan Pratt 317 Main Second Dr. Suite J Shaw Madison County GA 30618 United States -5.00 condo 3953.10 +AAAAAAAAFGJHAAAA NULL NULL Carey 605 13th Lake Ave Suite 100 Mount Pleasant Pickens County GA 31933 United States -5.00 single family 3349.63 +AAAAAAAAFGMKAAAA Mrs. Albert Bradshaw 774 15th 9th Blvd Suite I White Oak Peach County GA 36668 United States -5.00 single family 1695.86 +AAAAAAAAFKDJAAAA NULL NULL NULL 186 Spring Road Suite 290 Buena Vista Johnson County GA 35752 United States -5.00 condo 1919.82 +AAAAAAAAFLFNAAAA Mrs. Scarlet Cook 127 2nd Blvd Suite U Lebanon Columbia County GA 32898 United States -5.00 condo 2722.78 +AAAAAAAAFLHCAAAA Sir Patrick Taylor 635 Third Ave Suite H Kingston Wayne County GA 34975 United States -5.00 apartment 3413.14 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q82.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q82.sql.out new file mode 100644 index 0000000000000..9f526a8be98ca --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q82.sql.out @@ -0,0 +1,9 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAEIJBAAAA New games used to suggest. Annual, legal expenses see male pubs; almost early offences must come from the heads. En route small conditions underestimate e 64.55 +AAAAAAAAELDEAAAA Methods get hours. American, great schools l 89.24 +AAAAAAAAMOCDAAAA Colours think. Partial, rich things would not appeal extremely open students. New, working magis 66.03 +AAAAAAAAOIOBAAAA Just open variables used to mind well also new 65.54 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q83.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q83.sql.out new file mode 100644 index 0000000000000..2ccae595d52f2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q83.sql.out @@ -0,0 +1,32 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAAEFEAAAA 35 9.04392764857881 4 1.03359173126615 90 23.25581395348837 43.000000 +AAAAAAAAAFDDAAAA 11 8.94308943089431 21 17.073170731707318 9 7.317073170731707 13.666667 +AAAAAAAAAFKBAAAA 2 1.5151515151515151 3 2.2727272727272725 39 29.545454545454547 14.666667 +AAAAAAAABGOBAAAA 37 17.129629629629626 31 14.351851851851851 4 1.8518518518518516 24.000000 +AAAAAAAACIEAAAAA 34 26.35658914728682 6 4.651162790697675 3 2.3255813953488373 14.333333 +AAAAAAAACLLBAAAA 63 23.863636363636363 16 6.0606060606060606 9 3.4090909090909096 29.333333 +AAAAAAAADHDAAAAA 4 8.88888888888889 2 4.444444444444445 9 20.0 5.000000 +AAAAAAAADKNCAAAA 6 NULL 41 NULL NULL NULL NULL +AAAAAAAAEIABAAAA 56 13.82716049382716 27 6.666666666666667 52 12.839506172839506 45.000000 +AAAAAAAAFKICAAAA 73 15.904139433551197 29 6.318082788671024 51 11.11111111111111 51.000000 +AAAAAAAAGDHAAAAA 79 21.236559139784948 3 0.8064516129032258 42 11.29032258064516 41.333333 +AAAAAAAAGJEAAAAA 94 23.55889724310777 4 1.0025062656641603 35 8.771929824561402 44.333333 +AAAAAAAAHKEBAAAA 12 7.4074074074074066 10 6.172839506172839 32 19.753086419753085 18.000000 +AAAAAAAAICPBAAAA 19 13.768115942028986 20 14.492753623188406 7 5.072463768115942 15.333333 +AAAAAAAAJICAAAAA 15 5.319148936170213 49 17.375886524822697 30 10.638297872340425 31.333333 +AAAAAAAAKDMBAAAA 7 11.666666666666666 9 15.0 4 6.666666666666667 6.666667 +AAAAAAAAKEEBAAAA 18 6.382978723404255 29 10.28368794326241 47 16.666666666666664 31.333333 +AAAAAAAALJIAAAAA 1 0.32362459546925565 9 2.912621359223301 93 30.09708737864078 34.333333 +AAAAAAAALLJAAAAA 53 16.358024691358025 25 7.716049382716049 30 9.25925925925926 36.000000 +AAAAAAAALMDCAAAA 103 21.458333333333336 46 9.583333333333332 11 2.291666666666667 53.333333 +AAAAAAAALNDBAAAA 31 10.99290780141844 29 10.28368794326241 34 12.056737588652483 31.333333 +AAAAAAAAMLDDAAAA 1 0.32051282051282054 22 7.051282051282051 81 25.961538461538463 34.666667 +AAAAAAAANAFEAAAA 12 10.0 21 17.5 7 5.833333333333333 13.333333 +AAAAAAAANFNAAAAA 10 2.849002849002849 82 23.36182336182336 25 7.122507122507122 39.000000 +AAAAAAAANIDEAAAA 18 5.172413793103448 14 4.022988505747127 84 24.137931034482758 38.666667 +AAAAAAAAPDAEAAAA 61 29.04761904761905 7 3.3333333333333335 2 0.9523809523809523 23.333333 +AAAAAAAAPDFCAAAA 7 4.861111111111112 20 13.88888888888889 21 14.583333333333334 16.000000 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q84.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q84.sql.out new file mode 100644 index 0000000000000..4f956713021d5 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q84.sql.out @@ -0,0 +1,21 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAAAAKAAAA Perry , Lori +AAAAAAAAANFABAAA Harris , Alexander +AAAAAAAACHLDAAAA Phipps , Charles +AAAAAAAACIHPAAAA Nelson , Timothy +AAAAAAAACJOJAAAA Mata , Eva +AAAAAAAADEANAAAA Gaines , David +AAAAAAAAEJPOAAAA Wesley , Paul +AAAAAAAAFFKBAAAA Duncan , Diana +AAAAAAAAFOBCAAAA Null , Thomas +AAAAAAAAJFBBAAAA Jacob , Ross +AAAAAAAAJGFBBAAA Johnson , Windy +AAAAAAAALBGPAAAA Porter , Veronica +AAAAAAAANJBHAAAA Thompson , Kenneth +AAAAAAAANOLKAAAA Thomas , Billy +AAAAAAAAONJOAAAA Floyd , Janette +AAAAAAAAONLJAAAA Howard , Tommy diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q85.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q85.sql.out new file mode 100644 index 0000000000000..d46c5afed2b00 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q85.sql.out @@ -0,0 +1,8 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +Not the product that 10.0 177.330000 86.330000 +Not working any more 38.0 892.470000 14.940000 +reason 25 79.0 4640.200000 47.240000 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q86.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q86.sql.out new file mode 100644 index 0000000000000..4714aa00b0bfc --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q86.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +329088997.80 NULL NULL 2 1 +35430664.91 Books NULL 1 1 +34918777.34 Men NULL 1 2 +33760378.41 Children NULL 1 3 +33243530.17 Electronics NULL 1 4 +33145164.93 Home NULL 1 5 +32756827.42 Shoes NULL 1 6 +32285995.12 Music NULL 1 7 +31712254.78 Sports NULL 1 8 +30795989.18 Women NULL 1 9 +30076030.73 Jewelry NULL 1 10 +963384.81 NULL NULL 1 11 +615989.10 NULL NULL 0 1 +65752.25 NULL dresses 0 2 +54445.48 NULL lighting 0 3 +40391.44 NULL infants 0 4 +35471.06 NULL mens 0 5 +34067.03 NULL country 0 6 +34046.70 NULL accessories 0 7 +27537.73 NULL baseball 0 8 +26174.29 NULL guns 0 9 +17743.12 NULL athletic 0 10 +11766.61 NULL shirts 0 11 +2662546.58 Books computers 0 1 +2495626.03 Books parenting 0 2 +2425647.20 Books fiction 0 3 +2401196.81 Books sports 0 4 +2346704.09 Books history 0 5 +2302719.16 Books science 0 6 +2276270.78 Books self-help 0 7 +2257444.51 Books business 0 8 +2216374.08 Books home repair 0 9 +2206720.90 Books reference 0 10 +2149203.74 Books mystery 0 11 +2140640.32 Books travel 0 12 +2048647.89 Books romance 0 13 +1956865.76 Books cooking 0 14 +1859356.14 Books arts 0 15 +1617536.06 Books entertainments 0 16 +67164.86 Books NULL 0 17 +8836884.43 Children school-uniforms 0 1 +8760984.73 Children infants 0 2 +8142524.86 Children newborn 0 3 +7925776.25 Children toddlers 0 4 +94208.14 Children NULL 0 5 +2489469.99 Electronics disk drives 0 1 +2323648.66 Electronics personal 0 2 +2305415.91 Electronics camcorders 0 3 +2240199.44 Electronics karoke 0 4 +2235691.33 Electronics stereo 0 5 +2233058.51 Electronics televisions 0 6 +2113792.92 Electronics portable 0 7 +2092500.41 Electronics musical 0 8 +2088701.69 Electronics dvd/vcr players 0 9 +2081097.01 Electronics cameras 0 10 +2055973.50 Electronics automotive 0 11 +2021900.56 Electronics audio 0 12 +2006817.42 Electronics memory 0 13 +1729410.62 Electronics monitors 0 14 +1621759.97 Electronics wireless 0 15 +1604092.23 Electronics scanners 0 16 +2580794.04 Home mattresses 0 1 +2552960.47 Home glassware 0 2 +2479089.66 Home lighting 0 3 +2241963.26 Home bathroom 0 4 +2227778.30 Home bedding 0 5 +2201961.72 Home wallpaper 0 6 +2125093.38 Home rugs 0 7 +2029622.97 Home accent 0 8 +2005244.71 Home paint 0 9 +2004693.90 Home tables 0 10 +1882095.92 Home blinds/shades 0 11 +1833537.38 Home decor 0 12 +1805505.20 Home kids 0 13 +1761357.98 Home curtains/drapes 0 14 +1684930.79 Home flatware 0 15 +1596468.10 Home furniture 0 16 +132067.15 Home NULL 0 17 +2311781.76 Jewelry custom 0 1 +2143571.63 Jewelry birdal 0 2 +2116270.85 Jewelry loose stones 0 3 +2091585.73 Jewelry diamonds 0 4 +1929363.68 Jewelry bracelets 0 5 +1896051.77 Jewelry gold 0 6 +1858969.13 Jewelry costume 0 7 +1849246.62 Jewelry mens watch 0 8 +1845580.36 Jewelry estate 0 9 +1834863.97 Jewelry earings 0 10 +1809049.82 Jewelry womens watch 0 11 +1738077.18 Jewelry semi-precious 0 12 +1736010.32 Jewelry rings 0 13 +1703934.55 Jewelry consignment 0 14 +1608464.69 Jewelry pendants 0 15 +1603208.67 Jewelry jewelry boxes 0 16 +9509484.62 Men sports-apparel 0 1 +8897383.77 Men pants 0 2 +8508441.20 Men accessories 0 3 +7952307.23 Men shirts 0 4 +51160.52 Men NULL 0 5 +8668502.54 Music rock 0 1 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q87.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q87.sql.out new file mode 100644 index 0000000000000..cc6cf7d448318 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q87.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +47170 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q88.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q88.sql.out new file mode 100644 index 0000000000000..f2f9cd0812e84 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q88.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +2358 4664 4828 7447 6997 3886 4073 4923 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q89.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q89.sql.out new file mode 100644 index 0000000000000..7a48b3b50f536 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q89.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +Men shirts importoimporto #x bar Unknown 3 1815.92 4915.190000 +Women dresses amalgamalg #x ation Unknown 6 1508.07 4586.300000 +Men shirts importoimporto #x ese Unknown 6 1577.69 4596.057500 +Men shirts importoimporto #x ation Unknown 6 2077.36 4920.419167 +Men shirts importoimporto #x ese Unknown 4 1762.17 4596.057500 +Men shirts importoimporto #x ation Unknown 3 2183.89 4920.419167 +Women dresses amalgamalg #x ation Unknown 3 1917.37 4586.300000 +Men shirts importoimporto #x ought Unknown 4 2425.64 5071.261667 +Men shirts importoimporto #x ought Unknown 2 2438.50 5071.261667 +Women dresses amalgamalg #x eing Unknown 7 1904.98 4494.382500 +Women dresses amalgamalg #x able Unknown 4 1994.71 4582.713333 +Men shirts importoimporto #x eing Unknown 3 2458.87 5035.925833 +Women dresses amalgamalg #x ought Unknown 3 2138.31 4707.378333 +Men shirts importoimporto #x ought Unknown 7 2511.79 5071.261667 +Men shirts importoimporto #x eing Unknown 4 2528.19 5035.925833 +Men shirts importoimporto #x ought Unknown 5 2641.17 5071.261667 +Men shirts importoimporto #x able Unknown 7 2360.38 4779.735000 +Men shirts importoimporto #x bar Unknown 6 2521.43 4915.190000 +Men shirts importoimporto #x ought Unknown 3 2696.60 5071.261667 +Men shirts importoimporto #x eing Unknown 7 2689.88 5035.925833 +Women dresses amalgamalg #x ought Unknown 4 2396.08 4707.378333 +Men shirts importoimporto #x eing Unknown 6 2725.29 5035.925833 +Women dresses amalgamalg #x able Unknown 7 2299.82 4582.713333 +Women dresses amalgamalg #x able Unknown 5 2321.48 4582.713333 +Women dresses amalgamalg #x ought Unknown 7 2449.19 4707.378333 +Men shirts importoimporto #x eing Unknown 2 2784.04 5035.925833 +Women dresses amalgamalg #x ese Unknown 4 2254.90 4490.582500 +Women dresses amalgamalg #x ese Unknown 3 2257.13 4490.582500 +Women dresses amalgamalg #x ese Unknown 6 2257.18 4490.582500 +Women dresses amalgamalg #x bar Unknown 4 1998.31 4205.080833 +Men shirts importoimporto #x ese Unknown 2 2393.90 4596.057500 +Women dresses amalgamalg #x eing Unknown 6 2308.58 4494.382500 +Men shirts importoimporto #x eing Unknown 1 2856.92 5035.925833 +Women dresses amalgamalg #x able Unknown 3 2408.40 4582.713333 +Women dresses amalgamalg #x ese Unknown 5 2317.37 4490.582500 +Men shirts importoimporto #x ese Unknown 7 2439.68 4596.057500 +Women dresses amalgamalg #x ese Unknown 7 2341.06 4490.582500 +Men shirts importoimporto #x ese Unknown 5 2457.43 4596.057500 +Women dresses amalgamalg #x ought Unknown 6 2577.66 4707.378333 +Women dresses amalgamalg #x bar Unknown 3 2097.37 4205.080833 +Women dresses amalgamalg #x eing Unknown 5 2398.63 4494.382500 +Men shirts importoimporto #x ation Unknown 4 2841.78 4920.419167 +Men shirts importoimporto #x bar Unknown 2 2884.81 4915.190000 +Women dresses amalgamalg #x ation Unknown 4 2557.46 4586.300000 +Men shirts importoimporto #x bar Unknown 1 2926.69 4915.190000 +Women dresses amalgamalg #x eing Unknown 3 2528.38 4494.382500 +Women dresses amalgamalg #x able Unknown 2 2616.82 4582.713333 +Men shirts importoimporto #x bar Unknown 4 2956.00 4915.190000 +Men shirts importoimporto #x able Unknown 5 2829.72 4779.735000 +Women dresses amalgamalg #x ese Unknown 2 2586.26 4490.582500 +Men shirts importoimporto #x ese Unknown 3 2728.14 4596.057500 +Men shirts importoimporto #x able Unknown 2 2913.44 4779.735000 +Men shirts importoimporto #x ought Unknown 6 3210.96 5071.261667 +Women dresses amalgamalg #x eing Unknown 4 2647.58 4494.382500 +Women dresses amalgamalg #x bar Unknown 7 2407.85 4205.080833 +Women dresses amalgamalg #x bar Unknown 6 2427.96 4205.080833 +Women dresses amalgamalg #x ought Unknown 2 2933.33 4707.378333 +Women dresses amalgamalg #x ought Unknown 5 2946.43 4707.378333 +Women dresses amalgamalg #x bar Unknown 2 2465.92 4205.080833 +Men shirts importoimporto #x able Unknown 4 3120.21 4779.735000 +Men shirts importoimporto #x able Unknown 7 868.21 2511.135833 +Men shirts importoimporto #x ese Unknown 6 985.62 2603.736667 +Women dresses amalgamalg #x bar Unknown 5 2594.86 4205.080833 +Women dresses amalgamalg #x ation Unknown 5 2992.12 4586.300000 +Men shirts importoimporto #x able Unknown 3 3197.55 4779.735000 +Men shirts importoimporto #x ation Unknown 7 3347.44 4920.419167 +Women dresses amalgamalg #x ation Unknown 7 3059.37 4586.300000 +Men shirts importoimporto #x ation Unknown 5 3402.55 4920.419167 +Women dresses amalgamalg #x able Unknown 6 3085.16 4582.713333 +Men shirts importoimporto #x bar Unknown 7 3426.04 4915.190000 +Women dresses amalgamalg #x eing Unknown 2 3013.27 4494.382500 +Women dresses amalgamalg #x bar Unknown 2 512.15 1992.243333 +Men shirts importoimporto #x ese Unknown 2 1143.39 2603.736667 +Women dresses amalgamalg #x able Unknown 2 652.58 2089.189167 +Women dresses amalgamalg #x able Unknown 3 656.84 2089.189167 +Women dresses amalgamalg #x bar Unknown 3 564.90 1992.243333 +Men shirts importoimporto #x bar Unknown 5 3491.77 4915.190000 +Men shirts importoimporto #x ation Unknown 3 1075.39 2478.654167 +Women dresses amalgamalg #x ese Unknown 1 3107.05 4490.582500 +Men shirts importoimporto #x ought Unknown 2 1061.74 2425.509167 +Men shirts importoimporto #x eing Unknown 7 1040.11 2396.908333 +Men shirts importoimporto #x ese Unknown 1 3253.77 4596.057500 +Men shirts importoimporto #x able Unknown 2 1181.12 2511.135833 +Men shirts importoimporto #x ation Unknown 2 3598.63 4920.419167 +Women dresses amalgamalg #x eing Unknown 3 758.25 2074.660833 +Women dresses amalgamalg #x ese Unknown 5 782.25 2094.761667 +Men shirts importoimporto #x ese Unknown 4 1293.95 2603.736667 +Women dresses amalgamalg #x ation Unknown 2 3282.12 4586.300000 +Men shirts importoimporto #x able Unknown 3 1216.42 2511.135833 +Men shirts importoimporto #x able Unknown 6 3503.61 4779.735000 +Men shirts importoimporto #x ese Unknown 1 1333.77 2603.736667 +Men shirts importoimporto #x able Unknown 6 1243.07 2511.135833 +Women dresses amalgamalg #x ought Unknown 2 760.60 2026.577500 +Men shirts importoimporto #x bar Unknown 4 970.79 2234.079167 +Women dresses amalgamalg #x ese Unknown 4 832.51 2094.761667 +Men shirts importoimporto #x ation Unknown 6 1226.01 2478.654167 +Men shirts importoimporto #x ought Unknown 6 1205.46 2425.509167 +Women dresses amalgamalg #x ation Unknown 4 595.85 1797.562500 +Men shirts importoimporto #x bar Unknown 2 1036.00 2234.079167 +Women dresses amalgamalg #x eing Unknown 4 878.88 2074.660833 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q9.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q9.sql.out new file mode 100644 index 0000000000000..3331c24a2af4c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q9.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +358.920754 1040.839473 1718.531826 2401.883865 3085.520204 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q90.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q90.sql.out new file mode 100644 index 0000000000000..96a51e152051f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q90.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +0.58933333333333333333 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q91.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q91.sql.out new file mode 100644 index 0000000000000..4f59414d82c51 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q91.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output + diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q92.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q92.sql.out new file mode 100644 index 0000000000000..e01ed10078cd6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q92.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +39037.04 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q93.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q93.sql.out new file mode 100644 index 0000000000000..c311fa1002618 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q93.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +108 NULL +331 NULL +533 NULL +564 NULL +1391 NULL +1680 NULL +2096 NULL +2534 NULL +2766 NULL +2857 NULL +3400 NULL +3565 NULL +4075 NULL +4516 NULL +4888 NULL +4980 NULL +5111 NULL +5626 NULL +5743 NULL +6078 NULL +6760 NULL +6910 NULL +7034 NULL +7770 NULL +7791 NULL +8140 NULL +8364 NULL +8725 NULL +8913 NULL +8938 NULL +9203 NULL +9220 NULL +9860 NULL +10269 NULL +11218 NULL +11625 NULL +12405 NULL +12935 NULL +12954 NULL +13050 NULL +13298 NULL +13626 NULL +13730 NULL +14105 NULL +14422 NULL +14587 NULL +14627 NULL +14734 NULL +14958 NULL +15599 NULL +16142 NULL +16759 NULL +16918 NULL +17479 NULL +18540 NULL +18710 NULL +19327 NULL +19514 NULL +19917 NULL +20571 NULL +21532 NULL +22571 NULL +23925 NULL +25168 NULL +25250 NULL +25414 NULL +26175 NULL +26407 NULL +27166 NULL +27240 NULL +28852 NULL +29635 NULL +30207 NULL +30278 NULL +30438 NULL +30445 NULL +31204 NULL +31911 NULL +31987 NULL +32147 NULL +32154 NULL +32169 NULL +32291 NULL +32639 NULL +32646 NULL +33232 NULL +33313 NULL +33872 NULL +33951 NULL +34860 NULL +35502 NULL +35684 NULL +35774 NULL +35779 NULL +35957 NULL +36221 NULL +36333 NULL +36556 NULL +37254 NULL +37411 NULL diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q94.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q94.sql.out new file mode 100644 index 0000000000000..0c727d0b36846 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q94.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +38 84308.56 21690.18 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q95.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q95.sql.out new file mode 100644 index 0000000000000..9558536825f1b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q95.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +101 237942.25 -27171.32 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q96.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q96.sql.out new file mode 100644 index 0000000000000..574180c4d661f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q96.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +888 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q97.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q97.sql.out new file mode 100644 index 0000000000000..34652db5ee36f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q97.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +537833 285408 200 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q98.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q98.sql.out new file mode 100644 index 0000000000000..03160c0d31d44 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q98.sql.out @@ -0,0 +1,2534 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL Books NULL NULL 557.55 2.41577919115267179 +NULL Books NULL 6.35 361.02 1.56424464817493959 +Precisely elderly bodies Books arts 1.40 4303.08 1.75015577438987686 +Abilities could affect cruel parts. Predominantly other events telephone strong signs. Accurate mate Books arts 25.69 9236.96 3.75687156218529913 +Germa Books arts 5.82 3191.92 1.29822295179047002 +Great, contemporary workers would not remove of course cultural values. Then due children might see positive seconds. Significant problems w Books arts 0.55 2096.07 0.85251703756969175 +Small objects stop etc mediterranean patterns; liberal, free initiatives would not leave less clear british attitudes; good, blue relationships find softly very Books arts 58.41 5760.88 2.34307458786895754 +Newly national rights head curiously all electrical cells. Chinese, long values might not pull bad lines. High fun clothes ough Books arts 3.28 571.10 0.23227873122369528 +Forward psychological plants establish closely yet eastern changes. Likewise necessary techniques might drop. Pleasant operations like lonely things; dogs let regions. Forces might not result clearl Books arts 2.43 3457.82 1.40637023708618106 +Early, short v Books arts 75.57 850.08 0.34574593563060564 +Black, following services justify by a investors; dirty, different charts will fly however prizes. Temporary, l Books arts 5.56 4798.20 1.95153179505784395 +Scientific, difficult polls would not achieve. Countries reach of course. Bad, new churches realize most english Books arts 3.98 17.50 0.00711762878027433 +United, important objectives put similarly large, previous phenomena; old, present days receive. Happy detectives assi Books arts 1.26 11646.43 4.73685516316858938 +Naturally new years put serious, negative vehicles. Fin Books arts 3.34 20302.86 8.25761260902173683 +Ago correct profits must not handle else. Healthy children may not go only ancient words. Later just characters ought to drink about. British parts must watch soon ago other clients. So vital d Books arts 4.03 9410.73 3.82754758236520025 +Much new waters Books arts 1.85 2864.61 1.16509889030066491 +Tall, following actions keep widely willing, secondary groups. Heads could afford however; agricultural, square pri Books arts 9.99 1903.68 0.77426786036757875 +Anonymous, useful women provoke slightly present persons. Ideas ought to cost almost competent, working parties; aspects provide thr Books arts 6.73 7841.73 3.18940132200803357 +Powerful walls will find; there scottish decades must not Books arts 4.16 5934.47 2.41367739815283298 +Too executive doors progress mainly seemingly possible parts; hundreds stay virtually simple workers. Sola Books arts 34.32 10139.18 4.12382396436467639 +Careful privileges ought to live rather to a boards. Possible, broad p Books arts 3.93 10008.95 4.07085660459009779 +Aside legitimate decisions may not stand probably sexual g Books arts 3.88 874.84 0.35581636355058234 +Specially interesting crews continue current, foreign directions; only social men would not call at least political children; circumstances could not understand now in a assessme Books arts 2.13 15380.51 6.25558632178840388 +Unlikely states take later in general extra inf Books arts 0.32 6478.12 2.63479162023261224 +Sometimes careful things state probably so Books arts 5.08 17118.92 6.96263529595507190 +Circumstances would not use. Principles seem writers. Times go from a hands. Members find grounds. Central, only teachers pursue properly into a p Books arts 5.95 7863.28 3.19816617344888566 +Inches may lose from a problems. Firm, other corporations shall protect ashamed, important practices. Materials shall not make then by a police. Weeks used Books arts 0.84 6519.57 2.65165023240074772 +Systems cannot await regions. Home appropr Books arts 7.30 889.75 0.36188058327137607 +Relevant lips take so sure, manufacturing Books arts 8.80 932.33 0.37919879089789497 +Extra, primitive weeks look obviou Books arts 1.18 10006.38 4.06981132996350893 +More than key reasons should remain. Words used to offer slowly british Books arts 0.28 1075.86 0.43757554854548205 +Children may turn also above, historical aspects. Surveys migh Books arts 7.22 3864.60 1.57181646767132336 +Trustees know operations. Now past issues cut today german governments. British lines go critical, individual structures. Tonight adequate problems should no Books arts 4.05 3061.36 1.24512137387317768 +Useful observers start often white colleagues; simple pro Books arts 3.47 724.40 0.29462915933889837 +Members should say earnings. Detailed departments would not move just at the hopes. Figures can take. Actually open houses want. Good teachers combine the Books arts 3.09 7805.88 3.17482035104958588 +Major, senior words afford economic libraries; successful seconds need outside. Clinical, new ideas put now red c Books arts 5.87 616.62 0.25079270048530027 +Likely states feel astonishingly working roads. Parents put so somewhere able policies. Others may rely shortly instead interesting bodies; bri Books arts 7.50 8829.29 3.59106334933647431 +Floors could not go only for a years. Special reasons shape consequently black, concerned instances. Mutual depths encourage both simple teachers. Cards favour massive Books arts 1.83 6344.62 2.58049428068023382 +Accurate years want then other organisations. Simple lines mean as well so red results. Orthodox, central scales will not in Books arts 7.69 3640.38 1.48062134052200283 +Certain customers think exactly already necessary factories. Awkward doubts shall not forget fine Books arts 0.30 12867.38 5.23344195512721440 +Weak effects set far in the effects. Positive, true classes sell frankly ever open studies. Unique problems must mean as yet new genes. Essential businesses agree deep current stages. Not Books arts 4.40 4471.87 1.81880632077973420 +Visitors could not allow glad wages. Communist, real figures used to apply factors. Aggressive, optimistic days must mean about trees. Detailed courts consider really large pro Books arts 9.08 1737.00 0.70647549664780021 +Deep, big areas take for a facilities. Words could replace certainly cases; lights test. Nevertheless practical arts cross. Fa Books arts 7.37 8016.08 3.26031324074179520 +Similar situations come separate programmes. National, large others could not ask opportunities. Severe, large findings accept; twins go more. Tiny rights may see specifi Books arts 1.27 2413.11 0.98146406776958731 +Natural plans might not like n Books business 4.29 8813.76 2.98246237973343018 +Years shall want free objects. Old residents use absolutely so residential steps. Letters will share variables. Sure fres Books business 40.76 1861.77 0.62999888636816844 +Whole, important problems make. Indeed industrial members go skills. Soft Books business 3.22 6877.01 2.32709123121693768 +Cheap depths calm as in a traditi Books business 7.92 2554.82 0.86451804190159048 +Simple, great shops glance from a years. Lessons deepen here previous clients. Increased, silent flights open more great rocks. Brill Books business 8.92 8014.35 2.71195237594586375 +Just sudden ideas ought to serve full sources; uncertain, open qualifications shout questions; chronic, informal Books business 4.62 4172.49 1.41191664565564981 +Groups must not put new, civil moves. Correct men laugh slightly total novels. Relatively public girls set even scott Books business 3.36 414.96 0.14041709657333354 +Just young degrees stop posts. More than tight artists buy to a arts. European, essential techniques ought to sell to a offences. Sentences be Books business 2.58 6286.70 2.12733796276165399 +Other, black houses flow. New soldiers put only eastern hours. Applications reserve there methods; sources cry pretty scarcely special workers. Never british opportunities Books business 8.20 3426.05 1.15933100471146462 +Junior, severe restrictions ought to want principles. Sure, Books business 9.77 3899.69 1.31960465427044307 +Rows could not Books business 1.65 15875.48 5.37205708576254358 +Remaining subjects handle even only certain ladies; eagerly literary days could not provide. Very different articles cut then. Boys see out of a houses. Governme Books business 9.03 916.17 0.31002007751973922 +Manufacturing, ready concerns see already then new pupils. Both stable types used to manage otherw Books business 1.18 8723.00 2.95175036969632840 +Russian windows should see in a weapons. New, considerable branches walk. English regions apply neither alone police; very new years w Books business 2.79 8434.64 2.85417307557668685 +Long groups used to create more tiny feet; tools used to dare still Books business 57.04 795.66 0.26924105229308502 +Drugs must compensate dark, modest houses. Small pubs claim naturally accessible relationships. Distinguished Books business 1.66 11559.25 3.91150068335575881 +Small, capable centres Books business 2.98 19190.81 6.49392187461561344 +Popular, different parameters might take open, used modules. Prisoners use pretty alternative lovers. Annual, professional others spend once true men. Other, small subsidies seem politically Books business 7.25 1761.61 0.59610603791823330 +Supreme, free uses handle even in the customers. Other minutes might not make of course social neighbours. So environmental rights come other, able sales Books business 8.08 3500.18 1.18441563785437289 +Sound, original activities consider quite to a attitudes. In order weak improvements marry available, hard studie Books business 71.27 11431.86 3.86839355512056274 +Always other hours used to use. Women should jump then. Civil samples take therefore other offices. Concrete, major demands Books business 1.42 2038.40 0.68976819369356825 +Changes ensure different clients. Distinct, alone attacks think directly previous feelings. White children tell so medieval, responsible yea Books business 5.89 5116.38 1.73131681262259552 +Visual fragments Books business 6.77 2739.02 0.92684893931051673 +Classic issues will draw as european, engl Books business 75.64 14735.99 4.98646840884344817 +Again british shareholders see shares. American lives ought to establish horses. Then ideal conservatives might charge even nec Books business 2.44 9396.38 3.17961345165736401 +Critical cases tell anywhere to the circumstances. Dependent, new numbers must not Books business 3.72 726.75 0.24592279963049486 +Confident, video-tape Books business 3.17 6173.95 2.08918482116091330 +Of course fundamental children will not deal still including a suppliers. More crucial powers will not keep enough. As good comments used to devote even convenient electric problems. Publi Books business 8.85 2672.80 0.90444094785330122 +Departments could seek now for a commu Books business 5.93 3205.71 1.08477079876638965 +Paintings must not know primary, royal stands; similar, available others ough Books business 0.39 12939.97 4.37871847201185356 +Most present eyes restore fat, central relationships; again considerable habits must face in a discussions. Engineers help at all direct occasions. Curiously del Books business 80.10 6877.89 2.32738901183430931 +So white countries could secure more angry items. National feet must not defend too by the types; guidelines would not view more so flexible authorities. Critics will handle closely lig Books business 2.50 2135.27 0.72254774869901171 +Simple changes ought to vote almost sudden techniques. Partial, golden faces mean in a officials; vertically minor Books business 8.73 5996.87 2.02926323965617573 +Christian lines stand once deep formal aspirations. National, fine islands play together with a patterns. New journals lose etc positive armie Books business 4.89 6106.50 2.06636061361350790 +Children would not mean in favour of a parts. Heavy, whole others shall mean on Books business 3.13 5521.91 1.86854291917113983 +Lips will n Books business 8.48 7806.43 2.64159493735051117 +White fees might combine reports. Tr Books business 2.09 6566.98 2.22218108939451963 +Asleep children invite more. Wealthy forms could expect as. Indeed statistical examinations could la Books business 3.71 11535.83 3.90357565828889099 +Most new weeks go yet members. Also encouraging delegates make publications. Different competitors run resources; somehow common views m Books business 1.07 9334.32 3.15861315039135987 +Local, bloody names Books business 4.40 2927.75 0.99071273012477651 +Large, larg Books business 3.50 5826.76 1.97170021599584758 +Only new systems might join late speeches. Materials could stay on a benefits. Corporate regulations must crawl definitely practical deaths. Windows might soothe despite a organisations. Old Books business 0.67 123.41 0.04176034771571981 +Professional managers form later initial grounds. Conscious, big risks restore. American, full rises say for a systems. Already Books business 5.27 1616.40 0.54696885218126163 +Memories can earn particularly over quick contexts; alone differences make separate years; irish men mea Books business 4.23 6855.84 2.31992757704675870 +Only, gothic Books business 1.68 7807.37 2.64191302119179451 +Low, large clouds will not visit for example as the notions. Small, unacceptable drugs might not negotiate environmental, happy keys. Books business 3.11 3933.56 1.33106582416859905 +Silver, critical operations could help howev Books business 5.56 9087.69 3.07515674850230731 +Terrible, psychiatric bones will destroy also used studies; solely usual windows should not make shares. Advances continue sufficiently. As key days might not use far artists. Offici Books business 5.83 2024.32 0.68500370381562209 +Too white addresses end by the talks. Hands get only companies. Statements know. Sentences would pay around for a payments; papers wait actually drinks; men would Books business 6.06 5178.86 1.75245923645598158 +New, big arguments may not win since by a tenant Books computers 1.00 1686.72 0.45326198032962534 +Else substantial problems slip months. Just unique corporations put vast areas. Supporters like far perfect chapters. Now young reports become wrong trials. Available ears shall Books computers 51.46 471.00 0.12656895793922734 +Cheap, desirable members take immediate, estimated debts; months must track typica Books computers 3.26 7226.83 1.94202195818247621 +Expert, scottish terms will ask quiet demands; poor bits attempt northern, dangerous si Books computers 2.66 4463.91 1.19955931429829364 +Gradually serious visitors bear no doubt technical hearts. Critics continue earlier soviet, standard minute Books computers 6.40 3244.45 0.87186126451364360 +Clear, general goods must know never women. Communications meet about. Other rewards spot wide in a skills. Relative, empty drawings facilitate too rooms. Still asian police end speedily comp Books computers 7.64 5385.04 1.44708896233770017 +Wide, essential activities make steadily procedures. Modules Books computers 35.95 7285.54 1.95779873848101557 +At least remaining results shall keep cuts. Clients should meet policies. Glorious, local times could use enough; clever styles will live political parents. Single, gradual contracts will describe ho Books computers 9.51 14393.77 3.86795004186180949 +Environmental, new women pay again fingers. Different, uncomfortable records miss far russian, dependent members. Enough double men will go here immediatel Books computers 89.89 9487.37 2.54948308807619376 +Years learn here. Days make too. Only moving systems avoid old groups; short movements cannot see respectiv Books computers 0.60 1706.66 0.45862033493962150 +Magnetic Books computers 57.19 7638.33 2.05260184394042112 +Ga Books computers 5.53 7904.13 2.12402865714688954 +S Books computers 65.78 578.19 0.15537347301673430 +Simple year Books computers 3.01 5038.44 1.35394925783295241 +Agricultural players shall smoke. So full reasons undertake Books computers 0.70 5739.18 1.54225484506508439 +Then basic years can encourage later traditions. For example christian parts subscribe informal, valuable gr Books computers 2.75 11359.94 3.05268740563088364 +Boxes batt Books computers 0.83 6659.54 1.78957757569979198 +Blocks extend ev Books computers 9.29 11249.90 3.02311702743208836 +Separate, dead buildings think possibly english, net policies. Big divisions can use almost Books computers 9.46 3529.22 0.94838577014496795 +Artists make times. Rather ready functions must pre Books computers 5.71 7805.93 2.09763996995021836 +Limited, capable cities shall try during the bodies. Specially economic services ought to prevent old area Books computers 2.93 6458.26 1.73548882866368225 +Since other birds shall blame sudden Books computers 6.74 2404.97 0.64627292308939187 +Legs throw then. Old-fashioned develo Books computers 2.66 12518.22 3.36394492707854445 +Only careful men define judicial, special lawyers. Now able funds will not put too black, economic terms. Objectives know both points. Teeth pay. Books computers 9.85 911.50 0.24494183686115864 +Men should not turn shadows. Different, single concessions guarantee only therefore alone products. Books computers 8.38 11864.77 3.18834729318175442 +Educational, white teachers should not fix. Considerable, other services might not cover today on a forms. Successful genes fall otherwise so Books computers 1.65 7042.80 1.89256869845942737 +Women note days. Other, efficient qualificati Books computers 7.64 8012.26 2.15308577269247054 +Present Books computers 2.84 4786.32 1.28619858760866792 +Multiple, dark feet mean more complex girls; schools may not answer frequently blue assets. Spiritual, dry patients may reply personnel Books computers 2.04 2973.19 0.79896721880112808 +Private teachers ap Books computers 5.27 8109.35 2.17917617635769258 +Daily numbers sense interesting players. General advantages would speak here. Shelves shall know with the reductions. Again wrong mothers provide ways; as hot pr Books computers 7.56 13142.36 3.53166626340166409 +Inc, corporate ships slow evident degrees. Chosen, acute prices throw always. Budgets spend points. Commonly large events may mean. Bottles c Books computers 68.38 12405.10 3.33354687926095337 +European, possible problems ought to restore then unfair interests. States would sleep in respect of the questions. Ideal stages affect only pressures. About spanish employees might kno Books computers 3.42 6760.19 1.81662463645686890 +Upper others narrow deaths. Situations could e Books computers 5.42 10932.74 2.93788855460829783 +However old hours ma Books computers 8.84 5208.75 1.39971562561772907 +Indeed other actions should provide after a ideas; exhibitio Books computers 6.95 3949.76 1.06139491997885895 +Effective females must answer too english projects. Firm, political experiments see in terms of Books computers 0.76 246.87 0.06633986973770075 +Of course responsible fears tell. Now clear substances might develop at least independent civil tourists. Books computers 4.95 619.44 0.16645833398274943 +Perfect days find at all. Crimes might develop hopes. Much socialist grants drive current, useful walls. Emissions open naturally. Combinations shall not know. Tragic things shall not receive just Books computers 6.71 8038.78 2.16021233057898500 +Advantages apply almost on a services; materials defeat today individual ideas. Domestic divisions used to win smoothly irish talks. Subsequent quantities make only, automatic pounds. Flower Books computers 7.87 442.26 0.11884583298981461 +Close, historic tactics lead ago large, typical stars. Generally significant facilities check leading years; yesterday general years Books computers 3.87 8448.38 2.27028164092273769 +Internal seats used to sell dark words. Universal items show now in the roles. Most wonderf Books computers 2.57 870.24 0.23385428865612144 +Likely, separate attacks prefer seats. Informally equal women could use easy prime, big forces. Long technical women save conditions; fast alone rooms sell. Ne Books computers 3.77 344.40 0.09254851191989362 +Economic customs should not put unpleasant shops. Colonial, middle goods used to see. Closely explicit legs continue Books computers 3.32 8481.54 2.27919252551990282 +Human windows take right, variable steps. Years should buy often. Indeed thin figures may beat even up to a cars. Details may tell enough. Impossible, sufficient differences ought to return Books computers 4.47 5466.16 1.46888784528468556 +Left diff Books computers 0.74 3269.32 0.87854442796151745 +Male levels shall reduce else high, local conditions; further personal agencies control. Successful days wake eve Books computers 6.55 2376.38 0.63859010672531010 +Wide governments conform widely in proportion to a friends. So living rooms wear too clothes; most essential measures should not bring previously pains. Real accounts become also gue Books computers 9.35 11110.42 2.98563541755233586 +Places transform Books computers 3.10 5805.20 1.55999599708875273 +Appropriate effects beg passages. Running contracts must keep only upper sons. Safely available reports intend perhaps w Books computers 5.81 8969.60 2.41034591323077181 +Friendly, hot computers tax elsewhere units. New, real officials should l Books computers 3.19 2999.57 0.80605615534133364 +Perfect members state democratic schools. Genuine, enormous knees must afford around the implications. Matters will indicate with a months. Still regular machines would not l Books computers 4.07 2110.95 0.56726272136265806 +Kinds relieve really major practices. Then capable reserves could not approve foundations. Pos Books computers 7.23 1522.62 0.40916438797755059 +Only increased errors must submit as rich, main Books computers 6.94 8287.27 2.22698753303826016 +Meals ought to test. Round days might need most urban years. Political, english pages must see on a eyes. Only subsequent women may come better methods; difficult, social childr Books computers 7.23 15325.54 4.11833891222069241 +Systems cannot see fairly practitioners. Little ca Books computers 1.73 2428.71 0.65265242852777245 +Past beautiful others might not like more than legislative, small products. Close, wh Books computers 3.02 4174.86 1.12188467036552578 +Main problems wait properly. Everyday, foreign offenders can worry activities. Social, important shoes will afford okay physical parts. Very Books computers 1.40 939.26 0.25240161238640906 +Schools offer quickly others. Further main buildings satisfy sadly great, productive figures. Years contribute acti Books computers 4.11 885.92 0.23806787944271822 +Chief me Books computers 2.62 9675.59 2.60006230094948754 +Tiny, rare leaders mention old, precious areas; students will improve much multiple stars. Even confident solutions will include clearly single women. Please little rights will not mention harder com Books computers 1.45 3092.13 0.83092923972956056 +Guidelines should investigate so. Usual personnel look now old, modern aspects. Discussions could appear once br Books computers 2.44 9923.72 2.66674076280396839 +Flat pleasant groups would go private, redundant eyes. Main devic Books computers 2.83 2445.21 0.65708637291417851 +Popular, obvious copies should believe still difficult parts. Forms ought to soften characteristic Books computers 1.05 2156.19 0.57941979069847684 +Real, domestic facilities turn often guilty symptoms. Winds get naturally intense islands. Products shall not travel a little clear shares; improved children may not apply wrong c Books computers 5.28 1338.00 0.35955258115219995 +Directions would ask yet profits. Forthcoming, specified discussions ought Books cooking 0.58 5750.02 2.05632295473197783 +Then irish champions must look now forward good women. Future, big models sign. Then different o Books cooking 85.81 2279.71 0.81527020830049933 +Black ears see sensibly glad months. Equal members must afford approximately o Books cooking 8.37 10363.44 3.70617485886789408 +Considerable benefits should govern. Well experienced years provide please in an towns. Exc Books cooking 4.18 0.00 0.00000000000000000 +Valuable studies should persist so concerned parties. Always polite songs include then from the holes. There conventional areas might not explain theore Books cooking 1.58 1326.45 0.47436523408687831 +Meanings occur in a things. Also essential features may not satisfy by the potatoes; happy words change childre Books cooking 3.46 1262.55 0.45151330717055917 +Then dominant goods should combine probably american items. Important artists guess only sill Books cooking 6.67 5569.20 1.99165808110116677 +Libraries shall note still. Children would not concentrate. Local, public modes must mean low children. Outer, good years should vis Books cooking 1.42 2178.99 0.77925070784648269 +Children ought to miss historical effects. Honest girls may not think activities. Woo Books cooking 4.42 348.88 0.12476651428114901 +Single, past rates mark blue, evident discussions. Only literary children ought to publish exactly really recent themes; conscious, ready conditions would adopt advanced, ideal provisions. A Books cooking 4.99 9499.97 3.39738059698316657 +Standards could lead no longer ago great tactics; difficult lives might feel french, easy costs. Students drop certainly unabl Books cooking 3.05 16321.01 5.83672187356046718 +Individual, remarkable services take by the interest Books cooking 6.05 1054.65 0.37716408016112647 +Positions shall Books cooking 4.21 2629.53 0.94037288551281172 +Ultimately senior elections marry at l Books cooking 5.06 7756.87 2.77401293175881769 +Hence young effects shall not solve however months. In order small activities must not return almost national foods. International decades take contributions. Sessions must see Books cooking 1.43 19276.07 6.89351084309627374 +Members need for a regions. Leading needs go at least under the others; old police could play on a drinks. Very similar machines must consider fully effec Books cooking 9.86 10833.86 3.87440652490818908 +Mainly catholic activities could assume just fat, o Books cooking 2.68 2262.61 0.80915490391444210 +Points trace so simple eyes. Short advisers shall not say limitations. Keys stretch in full now blue wings. Immediately strategic students would not make strangely for the players. Books cooking 1.69 5132.94 1.83564271902740482 +Projects become more from a pupils. Details may precede generally; good, marvellous birds could suffer fair Books cooking 9.88 628.36 0.22471419087853357 +Great pp. will not r Books cooking 1.91 2941.23 1.05184308300603044 +New, general students raise therefore to a women; united letters would start black positio Books cooking 4.03 3747.49 1.34017789670793138 +Products may not resist further specif Books cooking 5.37 8721.33 3.11892325153523644 +Dramatic months deal broadly in a films. Almost new occasions may get together sources. Under dry orders wor Books cooking 3.92 1412.78 0.50523858073297895 +Thus certain stars appear totally even local guests. Urban friends might not take properly various vehicles Books cooking 4.55 1446.44 0.51727607462974425 +Somet Books cooking 7.34 6593.72 2.35804706645808830 +Genetic properties might describe therefore leaves; right other organisers must not talk even lives; methods carry thus wrong minutes. Proud worke Books cooking 1.08 119.92 0.04288580713309846 +Urgent agencies mean over as a plants; then Books cooking 6.47 9566.59 3.42120525067902230 +Men could require evolutionary falls; taxes teach dead parents; only financial servants might not buy eastern things. Different payments develop. New inhabitants might not eat w Books cooking 80.50 3855.42 1.37877583836799906 +Hours ought to cope thus into the eyes. Dark states reduce most for the feelings. National, tragic children shall establish enough typical boats. In order secret hours must mean; sin Books cooking 2.30 12966.63 4.63712802990534045 +Guests agree around trying, young costs. Here annual banks appeas Books cooking 58.88 8031.52 2.87223330308224573 +Wonderful qualities suffer of course light leaders. True clubs used to see early living operat Books cooking 9.91 4482.62 1.60307518988467144 +High big appeals may Books cooking 36.23 675.62 0.24161531867298181 +Final women should establish on a pupils. Full, northern years might not avoid full Books cooking 60.38 5877.02 2.10174071245298770 +Little part Books cooking 9.90 4729.36 1.69131438311366337 +Here other affairs afford directly effective leads. Plants cannot undertake as coming, huge photographs; d Books cooking 0.87 20785.39 7.43327407210001090 +Stairs might bring early others. Large forms rel Books cooking 1.88 2350.18 0.84047169953356678 +Now available m Books cooking 3.55 1102.96 0.39444070910208700 +Major instructions put flatly british, other democrats. Operations represent well upon a stores. Thousands will not appear surely Books cooking 1.29 582.88 0.20844962693245854 +New, single products raise too extreme, efficient minutes; hands support leaders. Additional, english things prefer halfway private, slow churches. High white things could f Books cooking 4.13 2472.08 0.88406559454294555 +Golden, sure days fill of course. Early free minutes must not express only, cap Books cooking 9.44 4521.21 1.61687575106934680 +Purposes hide tears. Small laws award good eyes. Books cooking 55.11 5382.78 1.92499053468895684 +Yet religious animals ensure also. Rough, real heads resist dead. Civil, evolutionary votes dissuade rapidly left cars. Buyers Books cooking 2.20 11624.81 4.15726617427380135 +Here comprehensive years should tend sensibly particular front sales. Official, coherent tears regulate animals. Rewards cannot w Books cooking 2.50 2499.59 0.89390372458156745 +Widely splendid others deprive only. Different, main soldiers discover then other periods. Too main birds must change public, terrible houses. Different, armed females may foster; science Books cooking 4.26 6853.89 2.45108909816104214 +New women add however. Scottish managers place mostly. Normal, financial purposes should lea Books cooking 4.74 319.20 0.11415234853973505 +Extra theories drop. Other resources shall know eventually anyway open students. Long-term, liable di Books cooking 6.96 5834.64 2.08658477093947276 +Special, public skills agree at a parent Books cooking 5.87 4713.66 1.68569974692295585 +Gentle fans cannot pay else can Books cooking 2.45 7576.48 2.70950183478800689 +Sound, new offices might equip hot, new reports; calculations fight great scientists. Professional, little issues learn of c Books cooking 66.16 6628.48 2.37047794250834265 +Well angry rebels drop in a methods. Studies argue most sometimes residential organisations. Rural, different children know o Books cooking 4.42 453.06 0.16202338041795852 +Half general features used to defend as ready medical pounds. Turkish, trying rooms secure with a ci Books cooking 7.08 683.53 0.24444409397670770 +African, elected carers would examine proba Books cooking 6.20 15598.69 5.57840569437117702 +Already accessible clubs match all enough o Books entertainments 5.00 1196.30 0.46493128593083651 +Likely, various days develop no longer. Officials say before agricultural, rare ho Books entertainments 2.67 23516.84 9.13960934734576042 +Less progressive experiences would silence as economic, soviet specialists. Alone legal brothers fight only ears. Methods could not return records. E Books entertainments 8.36 5931.28 2.30513887621487248 +Strict heads discuss as categories. Alone, specific markets wait single, human numbers. External, various changes want very relatively nuclear orders. Old, pre Books entertainments 2.32 4525.09 1.75863572068274594 +Instances used to lower out of a costs. Irish supporters sign in a types. Bad things shall participate clear Books entertainments 1.58 3570.57 1.38767006737947580 +Trustees may encourage today necessary, political tears; inner, foreign times pay in the historians. Areas may belie Books entertainments 1.79 17322.75 6.73233171726021741 +Rare, radical beds say over readers; han Books entertainments 7.10 7808.46 3.03468807902658165 +L Books entertainments 1.63 4264.23 1.65725481685601518 +Always constitutional advertisements go for a spaces. Cars spend bad difficulties. Rights encourage further great qualities. Blue, high homes would produce u Books entertainments 2.63 3974.52 1.54466161878945775 +Companies ought to record now detailed, good roads. Muscles shall not argue significantly territorial months. Clearly new periods could write in a committees. Figures will not find more there Books entertainments 3.07 7276.45 2.82792715498740725 +Falsely large trees shall reflect against a Books entertainments 0.70 957.09 0.37196446079707792 +Deep patterns shall find british, american expectations. Sufficient patients must see. English, large assets could not meet for the proceedings. White, chinese matches shal Books entertainments 0.56 1499.01 0.58257681762365897 +Particular, deliberate things rain however original ways. Virtually old deaths consider women. Notably w Books entertainments 9.71 1611.84 0.62642718708915783 +New, previous police outline right in a persons. Wealthy quest Books entertainments 2.07 5037.58 1.95781037146155928 +Doors cannot happen here severe, old rates. Inevitable, int Books entertainments 2.29 1047.84 0.40723363591888968 +Limitations respond. Bare rivers will not create yesterday. Well local persons may unders Books entertainments 8.95 2096.28 0.81470045646668390 +So perfect changes would twist again; legal standards like improvements; rights used to tell working stations. Official, immediate loans listen much possible pictures. Always d Books entertainments 6.32 1017.52 0.39545003933824690 +Prisons take angry, logical sums. Now old grounds cannot help so increased problems. Blue, negative designs would freeze. Small payments ask alike to a hundreds. Exte Books entertainments 2.62 11202.91 4.35391068500161131 +High, official employees shall not start too left circumstances. Patients used to touch obviously popular, senior members. British, impossible theories make only. Young, international wo Books entertainments 4.85 1041.70 0.40484737988309988 +Now old tears give. Other kids coincide up a animals; specific procedures remove future, french levels. Coming, strong values a Books entertainments 5.08 24460.84 9.50648649682223761 +Large women establish today polite, easy horses. Details sha Books entertainments 5.06 1748.58 0.67956996401650263 +Plans would not claim; most particular horses will not tell simply cases; more british enquiries could not smile blue men. Old, dangerous play Books entertainments 0.95 6942.27 2.69805108950854163 +Pieces threaten Books entertainments 0.69 1273.35 0.49487607869266126 +Cases can accept gmt sudden services; tools show all also capable meals; important, spatial days would not happen human, cold backs. Red, economic effects must s Books entertainments 9.58 1334.73 0.51873086622959576 +Financial gods might presume divine, tiny Books entertainments 8.42 731.84 0.28442306469583164 +Marginal, available teeth pay recently little services. Then british times could require more scottish fair tea Books entertainments 95.74 3018.65 1.17317130007115240 +Now complete others shall pass. Just front advantages could exercise more establish Books entertainments 6.51 5281.66 2.05266987849992639 +Young reasons could not say impossible experiences. Prisoners cancel particularly; forms might k Books entertainments 3.77 3626.88 1.40955444480216694 +Just particular actions seem very; necessarily poor eleme Books entertainments 0.26 6872.96 2.67111437845958545 +Japanese, efficient sports withdraw recently severe days; factors mean originally impossible items. Quiet workers become from a officers. Pieces explore. For example o Books entertainments 3.74 16796.75 6.52790652592057016 +Never able feet go on the provisions. Services play brown studies. Cruel, Books entertainments 9.79 12846.63 4.99272774870656373 +Internal claims speculate perhaps through a expectations. Immediate courts appeal to a councils; transactions materialise entirely; fine, serious conditions may not use to a types. Short, large lip Books entertainments 3.11 5231.34 2.03311346095579892 +Front, possible foundations hear well. Old, close inches change pointedly for the employees; odd, financial members work under on the arrangements; st Books entertainments 92.23 225.66 0.08770073893099771 +Local words co Books entertainments 2.95 9381.26 3.64594271959501737 +Hardly local women should tell easily tall, able issues. Important, available conditions could no Books entertainments 2.21 15740.54 6.11741996442846214 +General, raw tests would not buy heavy, considerable blues. High, regional modules meet often young, responsible calculations. Things hesitat Books entertainments 2.00 5567.90 2.16391449212931922 +H Books entertainments 4.80 2493.52 0.96908422644341674 +New hours borrow new poets. Youngsters mind especially. Laws must add there in a ends. Factors must not take strategic, royal tr Books entertainments 2.30 4109.90 1.59727584389128560 +Clear materials will ship evidently literally scottish targets. Residential heads make prominent times. Internal, open subjects feel subsequent Books entertainments 0.75 263.40 0.10236805208909332 +Other practices get feet. Numbers will not increase now large, simple foreigners. Flowers cover Books entertainments 1.00 315.51 0.12262013710945267 +Heavy, formal factors could want then truly serious players. Be Books entertainments 4.31 8757.62 3.40357061631163789 +Men call tonight particularly mental lines. Recent markets must dress children. Multiple relations should seem relatively about a arts. Funny, real proteins shall keep citie Books entertainments 5.20 3090.94 1.20126616144366780 +Dirty trials should get. Balls shall win later national programmes. Elements ought to explain apart poss Books entertainments 1.62 290.34 0.11283804192690719 +Subsequent, Books entertainments 1.29 9603.95 3.73248919461293761 +Countries turn more actually scientific patients. Good writers could not drag perhaps. Suddenly left months cannot announce more overall loans; beds transform far Books entertainments 1.32 2401.56 0.93334479565331415 +Royal, blue men used to convey jobs. Other, technical things would say as mere children; ab Books fiction 0.62 555.50 0.18274906106295868 +Exclusively ready fields invest right in a courts. Quite glad facts would not imitate usually by a types. More large managers can continue both small matters. Additional, basic scholars s Books fiction 1.11 3969.44 1.30587116641899316 +Dollars get on a years; separate economies can say. Firms know even sons. Simple, definite members will say most cold, big policies; main, true agents might repeat too. Elements know goods. Great Books fiction 5.03 149.04 0.04903135924540659 +Wild officials will not watch onl Books fiction 0.47 6954.51 2.28790310108543073 +Just minor eyes exc Books fiction 7.11 16681.12 5.48777500896227056 +Married circumstances face human, compulsory hours. Years make sometimes national problems. Difficulties should invest far running, medical centuries; perf Books fiction 2.71 10221.52 3.36268799754501063 +Other horses apply able schools; possible enquiries would not describe easily r Books fiction 3.83 10067.63 3.31206107944063852 +Firm, local examinations may not sponsor most rural charges. Countries shall help beautiful, different terms Books fiction 7.72 5090.34 1.67462620250444840 +As joint men would so Books fiction 2.13 2773.11 0.91230107781152357 +Pictures get with a conditions; still gross eyes go that. Personal beings contact thereafter in a systems. New, medium goals might not tell; as official years mu Books fiction 5.52 2061.58 0.67822107885899974 +Essential, alternative fans let unlikel Books fiction 1.52 2460.17 0.80934969856932323 +Basic changes may not see; afraid names seek in excess of a characteristics. Awful scientists shall not want now right eyes. Here used workers will not pray in part Books fiction 2.27 6034.24 1.98515156476786280 +Local companies would restrict yet most imaginative days. Married, str Books fiction 99.71 7003.69 2.30408239689654919 +Different stations may smell; weapons disguise cons Books fiction 1.47 1671.19 0.54979010505455611 +Private, quiet populations shall receive more somewhat proposed machines. Heads protect abroad parent Books fiction 74.86 3243.16 1.06693869464796593 +Circumstances should include parties. Good investigations fall as deposits. Characters might force at all convenient, special years; Books fiction 5.18 12.59 0.00414187340914968 +Old, official cases look enough; actual emotions go statistical, wild limits. Mental cities hear above mod Books fiction 2.55 769.44 0.25313130070978025 +Times should not get on a lists; different students undermine suddenly groups. Even actual modules may stay for a Books fiction 8.31 638.38 0.21001502358482729 +Techniques render eventually dark tiles. Only, other centres would bid at the falls. Sorry, full days write for a groups. Both Books fiction 2.99 6665.04 2.19267291079579140 +Towns see even afraid, mean factors. Soldiers spend areas; resu Books fiction 48.40 9444.91 3.10719790157362568 +Loud young standards remove enough green values; important students cannot receive particular police; significant authorities should not expect Books fiction 52.22 8870.17 2.91811924206809036 +Good, bad cats could not finance libraries. Concerned names get at Books fiction 0.13 5959.16 1.96045165566866039 +Years take critics. Again academic areas look high under a w Books fiction 90.57 742.90 0.24440013944855446 +Ambitious, isolated mines should Books fiction 9.67 5292.65 1.74118239070183305 +Wives must file upon a respects; anywhere growing wounds may not develop yet for a demands; quite key sides could not make fresh men. Dead times Books fiction 18.03 6121.11 2.01373016230978759 +Thus separate stars will touch lightly commercial great institutions. Personal, brief hands will not concern always smart rules. Dead Books fiction 4.96 2769.10 0.91098186316730672 +Difficult decisions retain concerns. Accordingly parliamentary cases worry only inadequate, good scores. Responsible adults exist still well silly Books fiction 2.74 2397.93 0.78887390818127904 +Necessarily royal losses ought to say courses. True, current Books fiction 0.62 5056.32 1.66343426180712733 +Others reflect much up to a paintings; twice narrow cases cannot wear however hard major wings. Popular bacteria go Books fiction 8.71 3061.36 1.00712991102736127 +Usually sure students give. Popular resources may give especially full, fine paintings. Ever possible borders shall not free. New bodies help apart. Further main readers could esca Books fiction 3.51 11100.42 3.65182958128620664 +Communications move afterwards different errors; warm goods give at all. Twins could return f Books fiction 0.34 5726.99 1.88407208859937665 +New, united books ought to earn things. Home domestic bands shal Books fiction 3.36 8480.61 2.78996132266631505 +Different, expensive years used to learn humans. Normally parliamentary cards benefit. Certain consequences used to encourage. More new proposals could not prom Books fiction 3.33 8887.28 2.92374811053755431 +Good levels ask quiet, particular objects. Previously rural re Books fiction 4.72 3395.05 1.11690765033626979 +Large hearts used to say annually. For example separate criteria should admit gay ministers. Growing, ordinary Books fiction 1.92 3430.77 1.12865885908724888 +Plans mi Books fiction 4.76 533.80 0.17561016884861808 +Citizens can b Books fiction 4.61 584.00 0.19212502549193136 +Personal, sympathetic text Books fiction 0.15 3428.40 1.12787917362420799 +Social, private books ought to demand merely social companies. Alive, swiss police will rest again victorian, married commentators. Standard, european territories attend to a comments. Books atte Books fiction 2.81 3504.94 1.15305939528714023 +Favourably present words can make small, economic cases. About eastern years give less views. Only possible workers may accept even requirements. Negative goods imp Books fiction 4.00 4392.10 1.44491836380669814 +Provinces complement more. Participants cannot lie swiftly then total muscles. Unions surprise perio Books fiction 2.17 1757.38 0.57814499537501769 +New, novel individuals used to pay at the rates. Especially social values sleep too unaware cattle. Also immediate changes give almost chains. Swee Books fiction 1.98 11006.58 3.62095798472428397 +Also good forms Books fiction 4.30 2992.89 0.98460456771326445 +Mo Books fiction 6.72 9516.74 3.13082862174671717 +Then wild sciences will know in a chemicals. Extremely Books fiction 5.84 10044.66 3.30450438109209457 +Likewise high penalties might afford never square, thin Books fiction 1.65 209.10 0.06878997059993638 +Enough little accountants light only important, great systems. Determined sk Books fiction 0.36 6117.14 2.01242410691389210 +Primary, good features assess then early, bad c Books fiction 4.63 2352.74 0.77400724739021675 +Mass attitudes may like occupational state Books fiction 6.40 528.87 0.17398829149300982 +Additional officers shall not apply so poin Books fiction 9.09 6890.24 2.26675947884507726 +In order financial glasses must kill convenient, important papers. Shy cities like below fragments. Patients ma Books fiction 6.94 8176.49 2.68991155767897573 +Goods keep points. Again sensitive windows must not cause closely female, individual powers; gaps derive suddenly sincerely other hands; other houses may not imagine under for a data Books fiction 7.80 6049.19 1.99006983382797303 +Pretty realistic facts may not work without a guidelines. Overall patterns t Books fiction 15.95 13032.24 4.28736205859069780 +Mechanically whole rooms might like then please specialist relatives. Als Books fiction 3.90 6774.40 2.22865029570640375 +Important enterprises could flow without a countries; ugly, previous things see even de Books fiction 0.82 887.04 0.29181949077459382 +Excellent, relevant concentrations seem exciting, local children. Units should not reinforce current lips; pure feet shall show always into a minutes. Commonly primit Books fiction 2.70 4113.69 1.35332670567791628 +Conservative, available Books fiction 2.01 2510.09 0.82577244047438695 +Black women treat really users. Expert, hard authorities should produce good indians; little, other details could waste. Ideas shall build. Low day Books fiction 0.72 9472.17 3.11616592930463604 +Houses appear again scientific tests. Naked pieces shall not believe experiences. Coming, good measu Books fiction 1.86 2113.81 0.69540376735462230 +Rates should not turn exactly enormous flowers. Happy practitioners should believe suddenly natural organisms; al Books fiction 2.51 3437.58 1.13089922111396129 +Constitutional, good pupils might not begin below level devices. External savings fit hardly. Parents shall dry. Actually literary companies improve a Books fiction 4.22 439.55 0.14460368999140142 +Eyes come no longer. Commercia Books fiction 0.20 5344.48 1.75823348671424196 +Famous authorities will demand at last growing teachers. Over immediate schools should go only so Books history 2.40 4151.41 1.32043953348399043 +Civil, english books could search either young institutions; incidentally major difficulties could not clinch little nevertheless old papers. Special subjects sail late workers. Low, national part Books history 1.01 1167.75 0.37142639855517278 +At first close areas may Books history 0.09 9795.83 3.11576095719008192 +Onwards current types may allow; other sectors might carry nowadays marginal conditions. Minutes add well faces. Urban, possible women could not oppose never markets; galleries must favour gently vehe Books history 59.17 3685.92 1.17238106697707767 +Weapons wi Books history 3.85 1690.46 0.53768483810882242 +Odd, only premises present previously obvious strengths. Widely different times should not ke Books history 1.88 8472.00 2.69469017217677053 +All female calls see ever fresh, widespread lawyers. Results could not want initially Books history 1.77 439.46 0.13977910092832903 +Logical suggestions should evacuate in common equivalent, distinctive women. Fruits know formal pensioners Books history 1.85 10800.83 3.43542144149575407 +Regular, elderly circumstances should not stop sole, different sites. New group Books history 2.98 383.28 0.12190992082057514 +Also quiet users fall. Other, current sources would c Books history 0.43 10191.59 3.24164039327845288 +Similarly legislative games could expect others. Central, special miles get all to a problems. Rights pass different, glad eyes. Most local tanks Books history 9.29 367.56 0.11690985831979388 +Military areas used to help sometimes sooner certain children. Unlikely proceedings say; wages recognize now managerial years. New events stay full, royal communities Books history 6.86 9156.39 2.91237419093692870 +Wildly sexual powers achieve local, comfortable songs; artistic, very shares might start. Miners used to sleep very italian partners. Book Books history 4.58 3997.52 1.27149172061851791 +Architects influence around enough visual interests. Days think already other issues. Regardless lucky rules mean to a shoulders. Women accept only. Books history 1.44 5541.90 1.76271287360557656 +Never possible applications will not contribute still bad, golden resources; force Books history 5.60 5573.65 1.77281160034856670 +Armed profits forget now s Books history 9.04 494.12 0.15716481443295395 +Hundreds go over electronic fa Books history 7.68 898.62 0.28582418348931652 +In short new acres marry perfectly for a c Books history 1.58 186.93 0.05945685008085502 +Hostile, certain contents would carry; others can get great, prime rates. Expensive, national shows produc Books history 1.95 3076.78 0.97863182577314023 +Origins help still already common hands. Probably official increases could inform more recent, Books history 34.26 5002.56 1.59116492772953555 +Safe films go behind amo Books history 4.48 6872.36 2.18589246360490448 +Ancient, yellow sets anger other men. Beautiful, vari Books history 3.24 2349.53 0.74731532108527947 +Wheels shall include tables; only central days shall see lovely, jewish artists. Genes ought to climb therefore; Books history 2.02 6800.22 2.16294688416429633 +Branches attend fair true banks. Rigid cigarettes like by a places. Stations shall not let thus. Kids hold into a achievements. Streets used to set twice actual, wonderful areas; surroundings r Books history 6.21 12377.05 3.93676994753783023 +Then sp Books history 1.91 8909.36 2.83380132582446085 +Parliamentary pieces shine never tragic patterns. Great human eyes would not get groups. Plant Books history 6.03 953.70 0.30334348645006918 +Tropical, different relations would not work eyes. Level customs might aff Books history 0.31 10335.72 3.28748384163962355 +Ready, imperial shops see impossible assumptions. Clinical holders ask. Other rules would not avoid at a panels. Unusual, particular rights cannot go yet golden substance Books history 4.56 2768.79 0.88066940531413131 +Very valid police should not like away pictures. New, special principles survive from a Books history 4.76 8944.55 2.84499421382716393 +Fully classical offices cannot go different, new roads; proceedings mean asian, only groups. Earlier academic affairs Books history 3.37 10650.60 3.38763776531939474 +Big, special things find however happy agencies. Current firms reduce especially at a eyes. Imports want reasons. Little controversial de Books history 4.36 1262.68 0.40162079634137920 +Additional, human standards should not dream also silly forms. More independent friends may believ Books history 4.39 5255.61 1.67165257504650106 +Confidential, full terms make incorrectly elderly, real methods; teeth slip much today unknown conditions. Years shall not undermine occasionally local, industrial lips; restrictions beat most things Books history 1.38 7182.03 2.28438924188842437 +Independently mean findings must not take today police. White, yellow features try even grateful examples. Sweet Books history 2.06 4957.80 1.57692810854792173 +Films cope Books history 1.22 14315.87 4.55345068403685835 +Hours used to use always local, upper budgets. Only royal strategies confuse already key windows. Open, short habits broadcast just. Working-class lights will display previous measures. Soviet scho Books history 0.75 4671.20 1.48576920824741861 +Opponents bring also waiting, other things. There massive characters contact Books history 58.48 1594.66 0.50721371930635138 +Boys form so go Books history 4.24 12750.46 4.05554051613940340 +Tomorrow soft actors could not go for the needs. Considerable times used to allow following visitors; months must not avoid about economic farmers. Tears start at firs Books history 1.76 10852.02 3.45170345163665691 +Years would land in a trees. Areas establish above civil tests. Within so-called thanks like just. Ill acts prevent. Most Books history 8.83 11890.89 3.78213697136863066 +Allegedly great plans respond able, cheap facts. Today local banks might allow at least tr Books history 7.32 75.87 0.02413198103907597 +Effects shall not come in short southern firms. High, afraid years smell anyway governors. Wages can think deep, educational participants. Quietly probable Books history 88.42 7756.02 2.46695831789500422 +Particularly particular contents destroy feet. Essential, fatal wo Books history 2.76 7308.24 2.32453287345481131 +Popular, current dogs shall not nominate respectively. More labour connections take further feet; holy, neighbouring months can leave. Attempts should investigate Books history 0.64 2234.94 0.71086766447176010 +Green discussions might offer most. Grateful feet ought to go still Books history 47.36 12676.50 4.03201604905557503 +Major, grateful charts talk system Books history 3.78 1685.71 0.53617400497404436 +Forward slight interests provide on a cases; successful areas must come internal, present en Books history 4.36 1180.89 0.37560584011116933 +Soon sure forests cope; guilty, e Books history 6.82 3323.19 1.05700748740275284 +Grey words need. English, swiss measures help separat Books history 3.59 4100.58 1.30427202859119708 +Parliamentary, monetary charges shall evaluate by a observations. Urgent, suitable problems give just at the rises; earlier big others stay always guilty terms. S Books history 1.16 6557.12 2.08562403467702379 +Lovely years help. Possible, good years must imagine even necessar Books history 35.72 11655.58 3.70729188822239413 +Other, current movements would get in a products. Books history 8.87 18347.84 5.83589992075918761 +Legal, independent teachers cut. Perhaps common wives might carry already states. Courts rally regions. Besides financial ways could not suffer notably political Books history 3.66 1239.86 0.39436243589177180 +Major, front faces wonder very desirable teachers. Prospective, national plans take industrial, separate locations. Capitalist children save head, economic features. Techniques l Books history 1.92 1668.04 0.53055370571267001 +Trends work to a co Books history 4.91 3816.03 1.21376517206465081 +Alone sole services keep only; stairs shall eliminate for the woods. Methods must need yet. Other students can Books home repair 2.39 1754.10 0.73033351855711644 +Alive reforms remember to a rocks. Neighbours could find together with a maps. So anxious circum Books home repair 2.84 819.94 0.34138855550180837 +Refugees can help as natural publications. Serious, active feet carry alone as well sharp coins. New reasons pay absolutely cautious changes. Practical memb Books home repair 4.33 4572.72 1.90388842538994214 +Above northern firms can restore either in a tories. Then natural children used to supply publicly chosen things; extra, available circumstances must pay Books home repair 0.40 2992.66 1.24601784826699738 +Here different Books home repair 4.50 3368.22 1.40238524820389416 +Chief Books home repair 4.04 3930.58 1.63652831729675090 +Black, relative workers make soft, important cases. Previous p Books home repair 9.53 10606.18 4.41596759469250173 +Taxes disregard earlier for the aims. In part heavy years continue less settings. Breasts accomplish. Weak, appropriate duties mu Books home repair 9.96 6044.52 2.51668408847207200 +Members defeat at all new, only bills; original abilities convince; already exciting systems lead shapes. New, real travellers should pursue again short vehicles. Important, only Books home repair 80.60 1171.18 0.48763012956144099 +Professional managers take at least at a applicants. Vulnerable areas must regulate more with a employees. Books home repair 0.38 2026.22 0.84363284987788637 +Completely foreign parties cope with the terms. Children would take terribly visual, total things. Yet good songs will work all right m Books home repair 2.78 1190.62 0.49572412853570149 +Activities bring brief, yellow practitioners. Polish representatives will not prevent for the examples. Annual, ashamed standards use Books home repair 7.44 5309.96 2.21084417661338922 +Perhaps european sectors may say practices. Just true years can tell interesting relations. Then private years could not persuade before quickly continuous levels; pale, constitu Books home repair 4.28 61.23 0.02549359862108901 +Chief levels must attack about for a parties. Branches complete really. Just following aims shall not arrive together experienced friends. Actually Books home repair 7.44 7424.19 3.09112069160056914 +States should not hold services. Western manufacturers could not mean even large exercises. Facilities maint Books home repair 7.52 5601.60 2.33227081554617381 +Free, particular nurses get either. Great, evolutionary million Books home repair 0.89 1230.96 0.51252000912323588 +Military, inc computers ought to maintain entirely even burning sections. Able, outer papers may not cause thus useless, pretty walls. Always im Books home repair 73.73 6564.64 2.73324019683073308 +Diverse, remaining bits ought to listen along a relationships. Distant stages jail relatively. Short, false applications could appear p Books home repair 1.52 1742.72 0.72559536483658741 +Houses help general, new attitudes. All central shoes cannot watch. Effects boost to a details. Figures get intently normal, common leaders. Ne Books home repair 1.01 19637.84 8.17637123542653418 +Even able courses should not vote. Appropriate findings might wait legal things. Sheer, interested levels inform in a meetings. Books home repair 2.99 3714.58 1.54659499536052312 +Tomorrow different years mean highly in a circumstances. Financial fi Books home repair 0.35 7727.05 3.21721886697837445 +Open, l Books home repair 6.35 1419.57 0.59104928620838367 +Expenses look away both complete manufacturers. Male advantages use here books. Right rich falls used to say; simple visitors mind records. Conventional profits might arrange Books home repair 7.60 414.17 0.17244298123299750 +European, local terms bring even everywhere working days; much nice choices grow merely major, black rates; final, other talks can know for example also industrial Books home repair 8.57 772.24 0.32152828024089140 +Internal exhibitions shall die soon direct movies; services could follow at once social, outer sciences Books home repair 2.25 1729.95 0.72027847353507987 +However broad boots may not obtain extraordinarily da Books home repair 2.68 2701.11 1.12462868155168622 +Political, standard statements damage as elegant preferences. Tremendous girl Books home repair 4.06 16118.92 6.71124084085324406 +British runs wish underneath appropriate pounds. Unable, complex results must not look at the origins. Extra employees find so early thanks. Competent Books home repair 5.60 15.48 0.00644522140542966 +New, immediate seconds may not give also lines; relevant groups break little golden, political eyebrows. Able cattle doub Books home repair 3.96 1518.63 0.63229370690747035 +Vast, delicate tem Books home repair 0.83 336.52 0.14011278471286747 +Corporate stones relieve together early things; forward line Books home repair 8.20 7293.74 3.03680679416269454 +Words should agree completely level times. Very gentle hours would not interpret. Gr Books home repair 8.23 3906.80 1.62662732472432730 +However great occupations find very academic homes. Surprised writings suit as free, short shows. Originally possible preparations should accept as yet similar children. Hours re Books home repair 1.86 2705.71 1.12654392822255033 +Members may not cut probably area Books home repair 0.87 8868.24 3.69236242096172529 +Similar seats would not see now light soldiers. Rather possible countries take white, proposed boys. Guilty, famous models would not invest often like a fears. Plainly new classes prevent little Books home repair 3.02 3962.44 1.64979348228234450 +External hours will not begin never old, empty word Books home repair 1.92 275.50 0.11470662126588312 +Sections will not kick for a systems. Political, lacking arms used to say other authorities. Savi Books home repair 53.64 8876.73 3.69589730014338536 +Planes play sometimes economic, wonderful comments. Responsible, primary costs can bring stra Books home repair 8.00 3496.76 1.45590390191538823 +Of course british lawyers shall describe at least extremely active men. Proposals may gain. Also lexical differences attend bad teams; academic, major contexts could not hold less stead Books home repair 4.97 855.34 0.35612762770802348 +Political, local children will distinguish as necessarily new managers. Directly resulting questions Books home repair 6.97 13643.34 5.68051337271024974 +Issues become at a materials; more complete others should apply seco Books home repair 3.96 2603.64 1.08404627002796343 +Real earnings exceed there from a shoulders. Practical days shall not spend now systems. Ages might not sit much. Probably Books home repair 0.86 1450.51 0.60393140185980444 +Scientific contracts transform only variable contacts; just important relations could tell generally on a values. Possible Books home repair 1.94 8305.21 3.45794039202767748 +Extraordinary, economic obligations intend multiple, public patients; again enthusiastic supporters should stop greatly labour, mad trus Books home repair 2.73 1640.87 0.68318930539582445 +Remarkably political plans would locate separate problems. Sensible areas will not join home social Books home repair 6.39 3591.09 1.49517894940726030 +Hours might need etc with the holders. Early demands drive usually; at all other responsibilities see so equally italian issues. Simple, senior operations must t Books home repair 6.30 4254.02 1.77119513973681346 +Spanish, unique colleagues put through a applications. Years will confront normally by no appearances; colleagues will not own still. Sympa Books home repair 2.68 5243.74 2.18327295171238458 +British demands can travel easy conditions. Inevitably small pat Books home repair 0.78 3069.27 1.27791503249632335 +Able prices would leave mainly in a matters. Ostensibly necessary schools get far private sales. Laboratories question possibly rare sectors. Likely hands could respond up to good Books home repair 2.22 5893.46 2.45378905323278233 +Systems cannot show. Global pains sha Books home repair 6.41 748.19 0.31151487101604752 +Dark, fun calculations must not take away interested feet. High, local films could show normal, visual glasses. Concerned, indian chiefs stick at least. Cultural condition Books home repair 1.87 2172.50 0.90453769401136507 +Sentences might treat in a persons. Prisoners look best heavy investigations. Western, emotio Books home repair 2.92 1731.95 0.72111118947893383 +Japane Books home repair 8.75 326.81 0.13606994880545649 +Democratic, sure places lose in a friends. Other, essential volunteers borrow other, other nurses; foreign hours get indeed enormous designers. Helpful, professional powers lower far from. C Books home repair 4.46 7443.09 3.09898985726998908 +Dutch, quick households ring fortunately small, automatic pubs; objectives st Books home repair 93.40 4131.30 1.72009968942193442 +Industrial, difficult children shall use crops; errors can reach frankly boards. Apparent, special arms may not see always other inter Books home repair 3.19 722.52 0.30082696187668193 +Suddenly various forms must not involve then local, other economies; continuing, still others cannot know directly only comprehensive products. Odd books go enough southern cases Books home repair 7.64 10446.87 4.34963760618481448 +Rather little years should not reach more new magistrates. Political speakers may lower considerably gates. Kinds would not depend well. Provisions raise. Almost difficult pensions pick yet organi Books mystery 4.25 327.20 0.10733361870342104 +Royal plants find however workers. About genetic peasants come welsh, marine men. So federal eyes develop. Home old services Books mystery 4.32 7859.96 2.57835559188307223 +White changes come much matters. Books mystery 3.16 3490.58 1.14503845591010823 +Later other operations see; expected, honest animals show respons Books mystery 2.82 18416.84 6.04140000697406092 +Royal advantages succumb again english, new regulat Books mystery 0.58 3081.67 1.01090095583671001 +Centra Books mystery 1.36 6619.98 2.17159660496416018 +Countries keep much french, addit Books mystery 4.87 25157.14 8.25246599152989476 +Always silver months must capture only left mass miles. Characteristics should fall total ways. Courses might work in a spirits; key sources would live again up the records; thoughts can inspect ofte Books mystery 9.69 3901.52 1.27984187054942315 +Primary, single engineers seem new centuries. Close ladies date. Necessary, likely hands cannot retain generally inc prices. Opini Books mystery 1.81 10328.03 3.38797320897766992 +A Books mystery 0.11 6325.20 2.07489793711148765 +Hills may not die reforms. Better Books mystery 5.64 2254.23 0.73947024232827876 +Only present circumstances cannot fall from a players. Sharp relations will blame late eyes. Closest different problems should not write i Books mystery 4.33 9175.56 3.00992071647421134 +Also strategic consultants proceed slightly eyes. Almost stran Books mystery 2.26 23865.71 7.82882951475068011 +Now top documents might mitigate usually ethnic sheets. Big times come partly high records. Social years can seek social, major r Books mystery 2.68 5730.79 1.87990962325604602 +Double workers ought to face with the objects. Satisfactory, other participants help politically urgent, Books mystery 3.56 2094.56 0.68709261733324441 +National specialists go practical chapters. Enough right women stare again for example literary cameras. Most industrial cells shall improve possible, availab Books mystery 3.03 4124.34 1.35293501516891054 +Fortunes could meet emotional meetings. Beautiful women replace beautifully in the things; less previous year Books mystery 5.11 102.48 0.03361720429317417 +Available solicitors emerge. Further true weeks manufacture changes; families save up to right things. Gre Books mystery 3.50 2151.90 0.70590224354490139 +Present, regular adults cannot l Books mystery 7.59 522.99 0.17155993045752497 +Especially simple sources absorb shortly accessible, new years; glad chapters restrict so southern districts. Modest, particular years could not discard only free men. Now black things could ge Books mystery 3.35 3104.40 1.01835723075458519 +Days must appear on the police. Direct, late developments should serve always for the papers. Meetings take yesterday women. Medium periods Books mystery 7.03 1997.98 0.65541082975874440 +Sufficient, whole judges may not show even almost vo Books mystery 75.13 1924.56 0.63132637289687040 +Words take here free goods. Efficient sales could not ask only. Please local women can talk less than useful permanent colleges. Always free members mus Books mystery 5.23 4082.90 1.33934117299571443 +Regional, able services should transfer old, social preferences. Other courts might talk a li Books mystery 1.16 954.39 0.31307497663312349 +Huge, difficult init Books mystery 34.65 621.18 0.20376985717051064 +Difficulties would offer changes. Payable pounds give electric, sure weeks. Tired houses shall not get together most important pools. Bones shall not give foreign, new troops. Books mystery 4.33 12111.11 3.97288894503419799 +Very dead processes may enable drugs. Early units work long police. Easily difficult opportunities ought to seem extra, common eyes. Just quiet subjects must finance ch Books mystery 4.70 475.66 0.15603395193297449 +Also rich lines want noticeably often social difficulties. Animals go; sexual, central cats ought to tolerate. Groups sha Books mystery 3.23 150.35 0.04932032265299313 +Also significant Books mystery 4.93 1060.69 0.34794528124245618 +Fine, sure centuries would not form now angry, dead insects; customers cannot pray totally as male laws. Unique procedures reinforce rarely also Books mystery 2.81 5986.79 1.96388702664258571 +Intermediate, subj Books mystery 9.70 10978.67 3.60140702827227219 +Hot eyes must invest patently common laws. Whole arts discourage small studies. Policies could need. Reasons hope really independent, international departments. Effective, afraid attitudes Books mystery 0.97 251.85 0.08261605094882821 +Prices find under way around the languages. Civil, effective products should last really at a hundreds. Main, capable groups will contribute; only indian regulations take now in a feet; total Books mystery 2.73 625.40 0.20515417217946063 +Advances accept. Lists must not act also old comments. Objectives shall know as to the months; live years can pay possible, inc attempts. Russian years see further pro Books mystery 1.42 15186.66 4.98178231607119854 +Clean systems can realise often s Books mystery 2.73 3145.42 1.03181329750035026 +Distinguished, huge levels return pretty characters. Months cannot ask right. Overseas studies c Books mystery 6.54 1642.06 0.53865599611289594 +Voluntary, clear techniques go. Before domestic students ought to live supreme, easy journalists; hands will run overseas such as the skills. Technical, official doctors would Books mystery 5.72 1966.05 0.64493661690666545 +Good, local rules follow normally high lines. Whole, male activities know again. Books mystery 4.01 5929.90 1.94522501696031914 +Years will appear original Books mystery 4.79 1653.40 0.54237593265353407 +Problems eat very in a persons; dead ideas happen british things. Short bags should test usually to a others. Also inner visitors expose nevertheless coming, peaceful me Books mystery 4.72 5511.42 1.80794820536188504 +Expensive rates take as at once white careers. Parts drive all weeks. Therefore other years s Books mystery 0.55 181.72 0.05961083493516403 +Furthermore little classes say spots. Like days used to provide costs. Friends Books mystery 4.03 13223.74 4.33787245413562633 +Years might give also. Ultimately private stars should make Books mystery 2.78 1284.36 0.42131725708412545 +Good, low facilities suggest too thereafter asian senses. Far holidays defend delicate members. Cautious reports treat on a talks Books mystery 0.25 5386.71 1.76703874451682502 +Strange, necessary weeks hope all. Dead sons know too. Heavy, social waters used to move pupils. Heels provide. Eastern trees used to allow currently bad children. Articles would not clear Books mystery 4.09 5477.40 1.79678839573997066 +Bitter, nice students like general books; maximum, holy members draw indeed sure, strong lines; forests must not adapt opposite, r Books mystery 6.38 2322.45 0.76184890818386367 +Everyday, low cases could contribute again through a developments. Useful, unable answers might not assign local da Books mystery 1.87 8562.04 2.80866362067065732 +Free, peaceful years should not help ahead animals. Then helpful others Books mystery 27.03 92.46 0.03033027623874789 +Howev Books mystery 3.41 6376.36 2.09168029631951644 +Sorry theories decide there wages. Books mystery 2.59 4969.90 1.63030975426079530 +Other courses discuss full leaves. Connections excuse; objective, international sessions go. All expensive surve Books mystery 3.01 1617.54 0.53061253544477894 +Banks will employ of course real, dead resources. Sisters shall not go short effects. Hopes run c Books mystery 3.63 4915.26 1.61238582722548074 +Seconds preve Books mystery 4.51 2037.80 0.66847325242613507 +Right developments would not seek variables; numbers like impatiently Books mystery 3.84 11928.22 3.91289430712261892 +Limits ought to eat less; actual costs would smash more main rules; magnetic, constitutional expressions can head years. Quickly western children may not wonder also useless, other millions; comm Books mystery 10.39 6043.00 1.98232597134710679 +British, quiet residents trace particularly. Years should reduce now libraries. Special, general figures gain Books mystery 2.22 6385.64 2.09472447719227850 +Most small ministers appear agencies. Industries review so much as solicitors. Far from distant children hear still terms. Particular, available days learn already long-t Books mystery 3.79 3704.73 1.21528752206334055 +Sizes could not continue home; obligations will not lack notably current buildings. Measures burn there then useful thousands. Historic, Books mystery 7.35 5443.06 1.78552361436382311 +Inches c Books parenting 0.16 4582.16 1.47127016656624148 +Certain signs prepare societies. Economic reasons can i Books parenting 0.98 1989.28 0.63873114796229133 +Golden dogs could hear only available feet. Big, serious patterns used to use here with a days; otherwise long reasons should not trave Books parenting 1.58 566.43 0.18187308178852684 +Luckily economic c Books parenting 9.18 122.92 0.03946796464425564 +Men become most so living studies; private nurses come frequently in a feet. Points will Books parenting 1.38 4878.48 1.56641454732922415 +Other changes mean. Miles form. Local, illegal authorities take again inside the figures. Players would love properly Books parenting 14.38 2483.90 0.79754700113786669 +Popular circumstances should not take relations. Secret questions should get after the players. Automatic methods cope please in a effects; unli Books parenting 5.60 9646.64 3.09740682115084758 +Original, able troops reduce jointly. Crowds move american feet. Cities move. Legs transfer loudly so central germans. Households could c Books parenting 4.02 877.39 0.28171817034838474 +Typical, right programmes tell against a reforms. Outside friends can inhibit again either military stairs. International men must launch legall Books parenting 65.75 4078.44 1.30953242534752647 +Favorite, small son Books parenting 1.77 4476.61 1.43737947613180297 +Improved loans read years. Now constant tears perform now local negotiations. Specifically concerned problems ought to know more than previous steep plants. Cont Books parenting 0.48 5231.60 1.67979664686696862 +So plain prisoners make improvements. Contemporary roots will resume in the computers. Firms accept modern, present names. Essential, collective sons cannot examine in the d Books parenting 5.38 18382.40 5.90234228178136019 +Soft friends could make clean, brave feet. Rapid standards should not spread problems. Careers use quantities; british, other visitors should pursue wide, sudden sh Books parenting 4.17 7509.00 2.41103926548743546 +Crazy years could cry even clergy. Other, philosophical sides might take years. Already senior hours cannot believe early strengths. Fields will not find little jewish councils. Events might not o Books parenting 1.37 8851.94 2.84223930160325602 +Prime, flexible records say upwards at least easy schools. Here good investors can spend more at a cus Books parenting 7.33 6260.65 2.01021081069035995 +Arms shall get thus famous, clear conditions. Royal languages might not understand in a films. Scientific, notable views would achieve like a years. Large, nervous students Books parenting 2.05 2365.43 0.75950787185536616 +Main contents set within a communities; rules date at Books parenting 1.39 1973.40 0.63363229278371356 +Leaders restructure so. Years used to go from a years. Shoulders supply thus original tracks. Securely necessary Books parenting 2.01 2314.86 0.74327052258706151 +Faces may occur existing houses. Ruling, annual arguments allow all but for a elections. Future, spanish subjects take. Then prim Books parenting 8.01 13033.96 4.18502987678687100 +High fields shall join then. Diffi Books parenting 1.11 3833.50 1.23088547399734770 +Narrow, Books parenting 7.17 950.12 0.30507079863163167 +Very strong arrangements should not cover parliamentary, fundamental implications. Parents renew then; major, basic structures settle; only long-te Books parenting 7.59 3460.43 1.11109769682656629 +Pretty eastern facts should not join. Too labour things mean in particular. Closer intensive problems Books parenting 1.18 11548.91 3.70820022420834975 +New friends must not gather by a blocks. Empty opportunities ought to remind else single families. Early years should not use suddenly abou Books parenting 4.28 11681.79 3.75086621137015165 +Source Books parenting 8.78 5480.98 1.75986922271292103 +Good countries need once again. Most economic patients appear there only real trees. Apparently jewish policies Books parenting 9.76 3680.94 1.18190050258400862 +Small, true kids can go genuine objectives. Scottish games give ever. Scientific, similar trees remark. Boot Books parenting 8.58 10853.90 3.48504182763005404 +Widespread lands get curious, certain reasons; issues ought to accept sales. Easy, other others might bomb large payments. Econo Books parenting 4.78 8024.99 2.57671673926541680 +Forces can measure now groups. Resources form rat Books parenting 4.43 6742.48 2.16491996627563242 +Equal voices build. High streets would harm simply individual, black methods. Substantial rooms land as current savings. Again very opportunit Books parenting 7.81 26.70 0.00857301217053063 +Overall, high heads cannot see explicit, bad bodies; opportunities can accommodate little leaders. Light times u Books parenting 6.61 13341.53 4.28378648177900984 +Meanwhile thorough roads put also more other trees. Never religious costs want just especially direct nights. Young, excellent aud Books parenting 2.67 3546.05 1.13858913135993082 +Common circles may win children. Tiny things must need as beside a words. Permanent yards remain fully. Slight, general ways avoid new, possible arts; therefore educational conditions ou Books parenting 4.26 9853.55 3.16384284917348778 +Sites will not manage most generally immense woods. Fine employers avoid in a men; reasons ought to think here; only corresponding areas Books parenting 58.45 12923.27 4.14948880123795580 +Records face long lips. Main researchers will know unequivocally ameri Books parenting 1.24 16478.74 5.29110256835243338 +Corners would not descend often plain new activities. Just local trusts think Books parenting 8.15 9940.76 3.19184481139790637 +Open, large roads might tell friends. Used, old arms will drop as good as natural others. Sad programmes participate Books parenting 4.27 2597.90 0.83415087332664917 +Days could meet just. Folk might alter possibly tories; serious, basic things wait suffici Books parenting 5.54 8776.83 2.81812248721641872 +Stations may not reme Books parenting 0.88 3316.92 1.06501855912645951 +Economic, free bits post quite issues. Perhaps back sales used to affect d Books parenting 0.09 19263.00 6.18509114010979749 +Genuine cities say. Practices prove together elsewhere simple Books parenting 1.52 1712.57 0.54988327538897554 +Se Books parenting 3.22 2194.90 0.70475297427332163 +Partners will not locate. General, other losses cannot restrict else protective kilometres; children carry unusual, long groups. Yet true reservations differ never long-term Books parenting 1.02 6482.66 2.08149524634502309 +Profits could not cling through a terms. Later democratic arms might not work all. Sometimes apparent arti Books parenting 6.57 0.00 0.00000000000000000 +Else emotional lives declare also c Books parenting 7.67 4780.68 1.53501227803042655 +Previous floors keep complex computers. Books parenting 9.60 5787.26 1.85821162599344996 +Lists used to miss little names. Prime roads should not help from the minutes; in order various exceptions help Books parenting 1.19 4186.16 1.34411987369994445 +Theories look. Just young regions Books parenting 45.83 1849.39 0.59381434374747746 +Foreign, simple stocks may draw still; Books parenting 2.55 18500.06 5.94012133091936148 +Careful, long customers may think about just professional meetings. Students could not drink. British, basic commentators remember espec Books reference 1.77 6207.69 2.15509748883540916 +Bills emerge later in a yards. Ev Books reference 2.72 1496.80 0.51963772696266090 +Examples will talk there estimated, short initiatives. Benefits ought to prove too negative Books reference 0.17 6141.90 2.13225745272044827 +Sorry services must not recall much main details. Sexual, major secrets will not go results. P Books reference 7.54 1423.78 0.49428768231887850 +Flexible, previous patterns must not manipulate essential, dull criteria. Much possible players will include firmly working, important duties. Far english busi Books reference 6.38 13587.29 4.71704201709145697 +Funds shall call more able countries. Books reference 0.39 913.90 0.31727479868464444 +Indivi Books reference 3.76 2162.13 0.75061752979541556 +Hitherto certain kinds evade also by a months. Poor points might make even just selective passengers. Old, general qualities could overcome over; recent variables might s Books reference 56.16 1298.61 0.45083294268504882 +Difficult, rapid sizes say so; initial banks stress high single sports; prisoners used to think likely firms. Good, current services must take human, precise persons. Signals m Books reference 7.77 9585.22 3.32766029745927077 +Royal, educational days can add black, long-term matters. Different executives should not remai Books reference 4.86 9194.30 3.19194625401709854 +Classical, labour books make in addition finally significant suggestions. Ethical figures could sell as the levels. Regardless plain scholars set in a companie Books reference 80.47 2466.20 0.85618022597228374 +Cruelly shared examples shall not investigate then in vit Books reference 0.28 610.19 0.21183708218555990 +Male, small legs allocate today to a programs. Video-taped circumstances afford short, royal changes. Planned, appropriate names can enter usual periods. Very consta Books reference 4.40 9663.14 3.35471145438399721 +Often other ideas must not understand possible, static groups. Late Books reference 8.13 705.22 0.24482824546272563 +Possible solutio Books reference 2.63 10773.86 3.74031542023913264 +Still short documents ought to give more longer individual parties. Brief, expensive reforms should give now. As perfect sect Books reference 1.16 4401.20 1.52794599405936875 +Great speeches would draw too particular, full things. Available, real lives shall like long, supreme skills. Grim men would n Books reference 4.95 7141.72 2.47936073450278901 +Ever only sides should not ensure clearly familiar, running points. Persons bear free, huge products. Organizations blame. Recent, parliamentary communities complain both perfect, l Books reference 5.85 4618.08 1.60323930660858167 +Dead, blue homes should write more small objectives. Systems could underpin all so blue exchanges. Better adult arts make very governments. Quick managers talk and Books reference 2.83 3913.25 1.35854645579678832 +Damp, happy roads Books reference 4.29 12407.36 4.30741070818241603 +Italian pati Books reference 4.42 7902.99 2.74364762146488472 +Classes used t Books reference 1.61 7530.59 2.61436308811313771 +Dangerous parents would not advise almost previous, important matters. Books reference 7.62 1064.34 0.36950241736734266 +Utterly free reasons control powers. Resources think too systematic sy Books reference 5.69 6131.92 2.12879273831966837 +Therefore secondary countries get eventually prospective lives. Directly complete wings see as g Books reference 6.19 4028.40 1.39852259439897325 +At present pink police would not endorse yet bright rules. Photographs shall te Books reference 5.24 7033.41 2.44175920977849331 +Equal, strong requirements use broadly remote pictures. Books reference 96.89 15194.39 5.27497212866393982 +Relative, possible papers may change only current, tropical services; following procedures bring ever delicious questions; never convenient women may want secondary ch Books reference 3.67 2.16 0.00074987806670186 +Eyes alleviate yet; major women get that blue scientists. Wild interests suffer forthwith years. Women might complete in a commitments. Japanese, victorian Books reference 8.24 12242.59 4.25020820399238554 +Clear points create however from a bases. Social, wrong rates contribute. More whole legs find now now unha Books reference 0.65 9377.23 3.25545328861977061 +Glad, certain others ought to protect narrow, american friends; thi Books reference 9.25 2557.68 0.88793895076019410 +Long son Books reference 6.53 13751.99 4.77422021967747397 +Historical arguments can point much big times. Lines bri Books reference 7.40 4482.72 1.55624694776193163 +Types shall serve quite possible emotions; hard weekends appear months. There difficult colours form probably. Rules know however green manufac Books reference 4.01 2684.41 0.93193526899775290 +Also real addresses give in a advantages. Perfect, interested humans could fall never at a years. Sophisticated interp Books reference 8.60 936.71 0.32519364993532475 +Much political attitudes must not understand more. Holy years shall not link large friends. Now occasional supporters may write also. Southern difficulties used Books reference 3.32 7569.18 2.62776021524000108 +Actions cannot go perhaps publications; huge, willing girls wo Books reference 9.60 2251.62 0.78168539469779966 +Successful solutions find clearly as socialist problems; individual systems Books reference 9.20 2974.66 1.03270013421081565 +Too nuclear windows ought to contemplate for example active, constitutional appeals. Again short partners clear to the issues. There political sheets end s Books reference 3.51 295.80 0.10269163524556059 +Cities regard only. Operations used to make later; personal, written years used to interfere for a agreements. Obvious, sufficient protests tell. Issues pay effective own Books reference 2.70 445.16 0.15454431489490789 +Here special fruits sti Books reference 2.31 6938.36 2.40876110318589515 +Years decide pot Books reference 4.03 15341.75 5.32613047677004465 +Structures drop home revolutionary, formal hands. Ears Books reference 3.42 1450.10 0.50342508542794934 +Predominantly on Books reference 8.46 11177.59 3.88047665721577287 +Really different purposes answ Books reference 81.85 4832.22 1.67758138494355241 +Kinds play sooner; old causes would publish. Great, Books reference 2.90 463.44 0.16089050520014402 +Relations preclude most primary records. Hardly common f Books reference 3.01 45.64 0.01584464581679305 +Particularly natural children put hardly. Parties weep into a days. Heavy hands will not take mad, lonely children. Ye Books reference 4.55 1000.50 0.34733935450704318 +Little, num Books reference 4.79 11088.98 3.84971429819241545 +Democratic, fresh operations shall not explain fully decisions; contra Books reference 1.68 140.25 0.04868999946987787 +As progressive minutes apply as firms. Involved, Books reference 4.35 18398.21 6.38722877109947712 +Both gross guns ought t Books romance 22.07 2932.20 1.53691964340235494 +Matters care too expressions; economic Books romance 5.87 4968.70 2.60435598941862117 +Internal, additional structures pretend trains. Useful payments should make fingers. Books romance 0.64 4689.33 2.45792353570560163 +Following, very poli Books romance 1.59 7979.33 4.18238490491430082 +Likely weapons see. Items improve half. Short, human resources depend white, local texts; fully permanent way Books romance 6.42 22088.52 11.57775059057560371 +Full days keep full, visible bottles. Big, domestic countr Books romance 4.62 11680.82 6.12252974184813303 +Teachers arise clear often old services. Other minutes could cost by a attempts; open conscious goods detect yet disastrous stones; thus slight men tell for a countries. Capitalist bodies wou Books romance 0.25 4832.22 2.53281967097801228 +New, small beds will come instead in a stories. Female, other systems could not Books romance 4.36 9867.04 5.17183261654620160 +Part-time architects buy. Silently national skills understand free parts. Only european millions shall not attend at all other informal words. Empty, redundant holes contain again acceptable relatio Books romance 1.12 1104.46 0.57890535071010332 +Similar consumers will live once on a eyes. More likely teams pass particularly. Just other workshops Books romance 3.59 1239.88 0.64988606761534406 +Future years can reform as before social suppliers; particular, judicial individuals resume vaguely remaining aff Books romance 0.52 6031.54 3.16144611757964666 +Crucial, different affairs could not forgo; public p Books romance 5.62 4775.42 2.50304781512054902 +For example new resources find perhaps necessary opportunities. Main systems move spontaneously necessary m Books romance 6.68 3560.08 1.86602444720136955 +Rather aware thanks may not work with a chi Books romance 2.35 2220.62 1.16394328440493058 +Islands meet only for Books romance 6.79 2450.58 1.28447736843630822 +Minutes will defend. Now new courses could know definitely international forces. There capital accounts should not lift more pro Books romance 72.49 1876.47 0.98355623874743093 +More simple principl Books romance 6.44 6567.15 3.44218738018203917 +Late, dark looks would not make citizens. Safe, great curtains use as by the children. Signs would prove neither romantic moveme Books romance 4.68 2862.64 1.50045960302479959 +Problems inherit. Sure edges must become enough revolutionary years. Systems burst however slowly strong issues; cultural site Books romance 1.60 775.70 0.40658501036327902 +Possible, common bars cannot rid mainly ultimate years. Drugs could bring of course large, good rules. S Books romance 3.33 273.51 0.14336092069673900 +Standard, geographical scales may hope equal, sure problems. Strong associati Books romance 7.58 4049.00 2.12229303462797052 +Probably just results receive perfectly on the countries. Bold girls will pass religious years. Here public conditions ought to consider most sources. Different, able years go rarely ita Books romance 5.44 1710.73 0.89668322132109361 +Even sure children build there imaginative novels. Real, quick members shall not exercise unlikely, vast times. Open regulations buy all catholic days. Domestic, palest Books romance 6.42 49.14 0.02575684853584057 +Silver, political interviews might know in common families. Far possible houses shall insist in a places. Whole, political gardens would adopt eggs. Others might live even offi Books romance 6.13 5432.94 2.84768849581419762 +Cultural, harsh conditions describe Books romance 4.72 1495.08 0.78364975801718601 +Distinctive hours work more federal, proper plants; crimes may ensure therefore; players work increasingly previous, genuine needs. Hostile, young schools will offer very new, implicit changes; Books romance 47.76 1911.06 1.00168666998175583 +Particular bombs could illustrate suddenly planes. Western months expect just special, relevant readers. Able demands ought to achieve for a cars. Suitable counties must stud Books romance 0.88 1663.75 0.87205854195166361 +Levels tear only. Colleagues may not see hot forests. So effective residents must help completely in a hands. However professional classes ought to seem very; political Books romance 4.81 1069.40 0.56052856785160575 +So only things know prac Books romance 2.71 3443.44 1.80488731221519852 +Ways used to contain only double cigarettes. Intensely increased feelings Books romance 76.83 18974.38 9.94546666099883214 +Views balance quite other degrees. Slow passages promote due major animals. Sons would say. Possible, other schemes cannot restart either important, new Books romance 3.75 745.80 0.39091285384676227 +Premier, good budgets could put high, slow members; traditions could not join however. Students laugh for a effects. Carefu Books romance 9.00 1184.75 0.62098954625228157 +Contacts remove basically blue, labour details. Full measures hold then families. G Books romance 66.85 845.81 0.44333333455635558 +Subject children would not like sufficiently great levels. Yet busy hotels must not help behind Books romance 9.33 1361.15 0.71345002817581182 +Large thoughts make Books romance 0.85 2228.59 1.16812077896802885 +Specially clinical muscles can pass causal, following changes. Dishes could use at present areas; even c Books romance 5.00 276.00 0.14466606015246230 +Teachers play apparent indians. Professional corners accept consequences; extensively necessary men will not know only economic clean stairs. Divisions could Books romance 0.78 379.40 0.19886341747044999 +Stages choose physically to a families Books romance 6.13 1969.70 1.03242296624023550 +Illegal technologies might distinguish that on a change Books romance 2.73 1019.24 0.53423708387607130 +As single women would get ideas. Rural classes may hear quite available, high sequen Books romance 1.38 894.27 0.46873375946573356 +Senior fans cook frequently. Fin Books romance 4.36 5607.44 2.93915308819320006 +Mammals take at all. Profound weeks must know parts. Too low earnings can share directly new gaps. Equal block Books romance 4.99 179.00 0.09382327814235780 +Fine, real rows could think short, united others. Twice moving molecules list enough really vague assessments. Days put with a lines. Importa Books romance 4.85 950.33 0.49811774255322283 +Associated words produce simply. Frantically tough forms take there across right years. Recent fears appear also fierce examples. Incredibly coastal te Books romance 2.28 99.82 0.05232089175514053 +Historical, new notes should say levels; largely low prisons present at once enough useful winners. Yet worthwhile sons give different, social beaches. Minutes want guns. Industrial Books romance 65.28 3120.61 1.63567519555208473 +Complete, foreign makers prevent conservative gardens; full prisoners would look so good goods. Then only cir Books romance 3.56 510.48 0.26756931299503245 +Local, strong letters should not make also ba Books romance 6.39 3270.83 1.71441336785680534 +At all chemical branches make as existing things. Directly civil students must not afford much beautiful companies. Past police offer well perhaps chan Books romance 36.28 3753.37 1.96733786302336027 +Minor democrats can wonder impatiently real backs. Early, Books romance 2.77 1091.04 0.57187122561138576 +Surely local universities may know perhaps primitive computers. About bad sides will provide carefully about a workshops. National, sheer references ought to develop already also long-t Books romance 5.58 112.88 0.05916632199278965 +Financial things will die only pai Books romance 1.33 1782.43 0.93426494781722240 +Debts should not go into a eyes. Legal troops pursue wholly friends. Inc families will meet never; potatoes should give all various users. New women st Books romance 4.80 6935.94 3.63548954077488907 +Also genuine men identify. Gradual, useful things used to see below patterns; superb, hidden ways would fail even huge yea Books romance 2.08 1555.12 0.81511986762426513 +Gains keep still. Possible, final clothes kill perhaps in the conclusions. Methods would proceed for a hopes. Other, particular ways find perhaps in a demands. Adverse, other men admit eviden Books romance 1.93 3352.42 1.75717896150839737 +Racial minutes used to come enough teenag Books romance 3.47 4982.66 2.61167315680894137 +Then modern features should improve otherwise available qualifications. Personal purposes go with a years. Ministers remove big arts. Linear, poli Books science 4.66 527.85 0.17402980157734269 +Organizations make enough horrible requirements. Grateful, only funds reassure anxiously yesterday great years. Extra Books science 5.13 36276.15 11.96008560479287668 +Ac Books science 1.13 11382.07 3.75261794759766011 +P Books science 7.15 115.77 0.03816885503193893 +Confident views gain to the resources. Jobs could direct kings. Attitudes might not support as aware jobs. Happy accounts cannot test. Professional, joint interests will support in Books science 78.67 7479.68 2.46601728949894583 +Continuous members shall look usually about careful supplies. More than negative sports become probably other leaves. L Books science 47.51 97.92 0.03228378927811575 +Obvious relationships put originally. Pounds give well central, british leaves. Differences ought to ask also central states. Tests grant for a chapters. Soon active heads should want Books science 4.26 2414.14 0.79593124027645368 +Gently independent fears call now statutory sciences. Friendly, quiet needs stumble too. So famous cattle teach too only services; public forces collect pure friends. Arms might make im Books science 4.68 5668.22 1.86878696958743084 +Later other words comfort historic, social birds. Large, english interests muster there ag Books science 1.74 2463.16 0.81209291664913785 +Ways create things. Popular opportunities regard eyes. Intact conditions show years. Variable banks could run legally. Sexual, mechanical dates shall not carry however fingers. Forms Books science 2.88 10151.52 3.34691107570034261 +Now educational levels lift perhaps men. Types use not. Very environments might go for sure at once common p Books science 71.85 6430.06 2.11996223535172516 +Little, able companies could not combine particles. Private kids participate in common; unable, only detectives introduce; very good skills go. Copies miss. Strategic m Books science 1.07 7269.76 2.39680759745174345 +Regular teachers serve together events. Other arms would not use. Dou Books science 3.59 8847.06 2.91683640493103230 +Aware parts hang experienced, new groups. Handsome, perfect forms will grasp tonight in terms of the tears. Effective, economic subjects deny in the o Books science 3.18 38.60 0.01272624863291736 +Just essential errors permit never too bad applications. Ideas could buy men. Anxious wives would not pull royal, common towns. Adults Books science 3.22 10051.00 3.31377007796508735 +Domestic copies cannot get additional victims. Pieces should not determine now british, gold depths. Local, available stocks punc Books science 3.99 3769.53 1.24279730593888526 +Complaints can involve very vital adults. A little practical initiatives remain traditionally important months. Clear new transactions create perhaps new, personal princip Books science 1.15 3928.72 1.29528154220505402 +Distinguished, assis Books science 6.29 16.68 0.00549932194811040 +Old prices help general trials. National, prime men ought to compete about a posts. Suspicious, extreme mistakes might not make gently other characters. Acc Books science 1.53 3227.96 1.06424408127232946 +Spanish ranks can deal all but conservatives. Local metres shall not go no longer with a processes Books science 2.91 4385.32 1.44582053510116972 +Particular ears ought to know streets; tears could pr Books science 1.38 4417.02 1.45627188436706299 +Useful examples might understand evidently. Royal shops ought to leave in order. Also huge experts stay continuous, long organisers. Often burning services flee global circumstances. Fine, ex Books science 2.78 7923.96 2.61249443309046200 +Accounts accept Books science 1.24 4454.22 1.46853655921536677 +Small years turn as beside a problems. Famous, significant attitudes defend again subtle machines. Pp. double less. Human men appear in a regions. Exclusively warm Books science 1.75 3606.79 1.18914265043316062 +Certain, long councillors smile then fresh eyes. Lights attend initially after a preferences; national genes admit. Wide single plans improve never Books science 2.09 2209.49 0.72845904383276100 +Problems could not find small, late years. Demands might get only normal, available communications. Quiet mothers leave women. Fair interes Books science 0.21 8916.11 2.93960188337929509 +Marks remember Books science 1.41 1407.04 0.46389484135906840 +Things prejudice unfortunately. Available lives used to get for an readers. Roughly good articles might express open years. Black m Books science 9.38 11566.26 3.81334457287478571 +Small, stupid members lack hands. Literary terms would understand sure ordinary acids. Lovely, Books science 0.22 2581.68 0.85116843447228203 +Conditions must like most still desperate concessions. Parts shall not raise sometimes places. Local, prof Books science 4.37 214.32 0.07066035251313079 +Male, major regulations could get. Books may not bring. Upper, musical girls take well special, curious parents. Criminal, equal knees stop just a Books science 3.41 7411.80 2.44363755485639582 +Courts receive high male limitations. Political, little parents may establish tomorrow unique minu Books science 9.26 10412.18 3.43284952048418299 +Local, contemporary tanks provoke yet. Well red quantities should spend only deaf new firms. Books science 2.13 6975.01 2.29962983101256232 +Young officers depend very well unnecessary players. Personnel will consider apart types. Most universal courses could enable arrangements. Magic, equal responsibilities detect; value Books science 5.89 6948.34 2.29083685041567357 +Pounds realise fairly formal, casual residents. Good areas shall stick etc disputes. So small police find variable, certain programs. Results think children; dogs will take prices. Old, traditi Books science 44.25 3791.67 1.25009676564698863 +Left times used to tell trees. Right t Books science 7.96 2094.92 0.69068582347334800 +So clear employees could tell experiments. Hands would control demands; well ethnic sites afford then bottom programmes; times flow easily premises. Alter Books science 1.28 10461.12 3.44898482121203209 +However major deb Books science 0.66 2219.28 0.73168676336945170 +Thereafter strange rates shall not inhibit now on a heroes; eyes may not provide. Books science 8.37 11495.90 3.79014719324234879 +Due proposed concepts afford indeed yesterda Books science 1.34 10405.19 3.43054494851671946 +Earnings feel possibilities. Single, poor problems make full, sho Books science 2.75 17541.34 5.78330192213830518 +Direct schemes rival pa Books science 78.33 9776.79 3.22336425833730836 +M Books science 42.63 5228.32 1.72375389255063431 +Clear spirits shall not co Books science 2.11 1098.47 0.36216068227463034 +New, political bish Books science 1.33 1836.00 0.60532104896467022 +Professionally uncomfortable groups would not protect again there dependent users. Standard fields avoid likely families. Independent, intact fortunes work in the Books science 8.28 64.98 0.02142361751727901 +Future, solar deaths stand much confident, prime horses. New, other hundr Books science 0.22 7461.07 2.45988165511918956 +Acts will not reflect as with the problems. General governments distract new, soft fires. Useful proposals restrict hard trees. Large, black customs go official Books science 3.05 12762.28 4.20766705707016963 +Royal, considerable rooms reply then often c Books science 0.79 3487.40 1.14978029747243514 +Symptoms could not take else. Now rich Books self-help 8.22 4725.36 1.53069603755177003 +Normal sports will not afford from a women. Nearly past families would permit Books self-help 4.46 6912.33 2.23912593775928744 +There main prices could bowl acres. Radical, domestic plants take long. Fresh developments wave sanctions. British, able men cover goals. There other men Books self-help 7.22 5298.60 1.71638690482244922 +Results Books self-help 0.29 6602.84 2.13887217578942752 +About statistical blocks shall point so brothers. Even new affairs spend hopefully even old contexts. Possible officers wait absolutely with Books self-help 3.51 7809.11 2.52962181374665694 +Facts shall provide al Books self-help 5.02 1138.39 0.36876112342521194 +Men shall accept yet. Indians can continue obviously global, efficient times. Profit Books self-help 5.85 4729.95 1.53218288613311888 +Proper, mutual feelings would bring right over the days. Prices ought to see thus electronic owners; most surprising definitions might not see in part big lads. Responsible, tory doors read good, a Books self-help 6.84 4062.63 1.31601648192708015 +Early alternatives lie meanwhile european, new makers. Suspicious purposes speak new, overseas critics. Generally important police must refer approximately virtually other firms. British, appointed c Books self-help 2.07 157.85 0.05113269031937184 +Settlements can see so scientific sales; jeans ought to disco Books self-help 0.78 10137.10 3.28373262614193372 +Now christian papers believe very major, new branches. Annual wars include harshly so-called sites. Books self-help 5.23 8239.18 2.66893531470105824 +Much g Books self-help 4.52 725.34 0.23496094771145497 +Particular prisoners wait at a wag Books self-help 1.99 210.35 0.06813912834133586 +Good others run considerably excelle Books self-help 2.72 567.97 0.18398374482542681 +Very concerned shares must form also rather nice gardens. Quietly available games may see quite. Short eyes repay. As useful variables should not produce there. Managers use so also total versions Books self-help 26.11 239.20 0.07748457094959609 +Creative churches like. Walls objec Books self-help 6.05 3579.99 1.15967386770001887 +Now environmental examples enter banks. Royal, new attitudes go prices; almost living tre Books self-help 7.75 779.81 0.25260553207443365 +Hot steps help right able councils. Provincial mammals ought to establish from a others; forests used to offer true, open practitioners. Key theories could not imagine exact, other races. Books self-help 4.63 8643.42 2.79988164814865324 +Aware, a Books self-help 2.74 1189.77 0.38540475743604073 +Cultural notes ignore usuall Books self-help 9.32 5567.49 1.80348902138865697 +Positive, recent adults cannot tell fortunately laboratories. Frequent performances may get labour buildings; vocational windows will talk; similar seeds must replace better. Other merch Books self-help 9.69 10154.63 3.28941115678050571 +Tonight single claims used to compete seriously. Frequently magic advances concentrate very political men. Again damp types will apply also pol Books self-help 0.56 8790.86 2.84764220475738421 +Areas increase well final, peculiar findings. Fat possibilities will say now at all sure dogs Books self-help 5.11 3770.90 1.22151575499093605 +Clearly legal servants should not investigate however early difficult women. Increased laboratories tell home samples. Still wooden institutions avoid undoubtedly. Policies will Books self-help 9.11 9124.75 2.95579991125554742 +Physical, political issues must not increase. Teeth go there particular prices. Words mi Books self-help 4.82 1881.44 0.60945890956274278 +Old, acceptable respects imply around banks. Rights will not spare so existing reasons. Old eggs must claim. Patients might not stop there military, Books self-help 7.89 15529.28 5.03043310182334282 +National, dreadful opportunities give. Lucky, low rules should start away from the girls. Available words will not leave now. Stor Books self-help 5.53 6895.58 2.23370007419989892 +Dominant, useful restaurants might not say contrary eyes. Modest years may not confirm again just other stage Books self-help 3.87 12631.86 4.09186560365955223 +Various Books self-help 6.24 3437.60 1.11354916846292444 +There political deta Books self-help 8.83 4867.67 1.57679482221664051 +Other, established programmes used to avoid good organisations. Forward, simple changes might enter straight. Papers cal Books self-help 1.63 3028.98 0.98118401218606844 +Cards insist sad males. Instruments turn later instructions. Economic, white Books self-help 2.64 3883.30 1.25792572896557903 +Other, precious services can stem; grounds will set in particular friendly factors. Ports will provide. So complete moments diversify morally different, open pupi Books self-help 6.72 NULL NULL +Metres must not go more soft attacks. Northern, central changes see all right inherent metres; women shall reduce together always private efforts. Extra, secret dates ought to sa Books self-help 36.51 215.49 0.06980413960672434 +Outside, remaining problems must come only new politicians. Readers would not tell right, modern products. Particular threats become legally among a beaches Books self-help 1.38 24121.05 7.81358365427991146 +In order excellent words could go old costs. Surp Books self-help 1.45 3398.74 1.10096116500514307 +Logic Books self-help 1.29 3676.91 1.19106937194932846 +Sufficiently great tears may see. Much short standards duck over a pap Books self-help 8.57 1508.73 0.48872615689291017 +Again right years welcome to the months. Once competitive years could benefit great, social projects. Actually old expectations must not spin Books self-help 2.42 1824.90 0.59114378564346952 +Actions need qualifications. Expert sales see. Guests look evidently dead roots. Activities Books self-help 2.20 1248.95 0.40457506223870418 +Still social transactions provide both most existing vi Books self-help 6.50 2330.32 0.75486557431129919 +Prime even Books self-help 4.28 3438.17 1.11373380979002005 +Confidential, japanese reports discuss ever forms. Initiatives say now pregnant, sad sites. Neither round eyes may ask more w Books self-help 1.72 3385.13 1.09655244840554440 +Clever, informal negotiations study sharply with a leaders. Professionals come noble officials. Plans continue pa Books self-help 4.69 2768.44 0.89678672909573497 +British, Books self-help 1.52 4014.40 1.30039323419756920 +Highly other times could stay no longer huge symbolic results. Most narrow police chan Books self-help 7.99 660.44 0.21393775099477944 +Hands can ensure. Dead schools concentrate by a years. Increased authorities should not stop natural, following guards. Principal years might secure. Long, criti Books self-help 4.23 4140.99 1.34139980542043446 +Rights could not talk. Miners shall clear various outcomes. Relative, western forms locate communist, local prices. Items would not disappear probably likely women. Bare conclusions mark in gener Books self-help 8.57 3116.42 1.00950863962684053 +Other changes shall seek Books self-help 2.51 2862.54 0.92726874467415049 +So ashamed periods could give there on the operations. Potatoes must order very noble systems; labour years should not escape so formal, ready Books self-help 1.94 11014.72 3.56802196208166835 +Also crucial weeks will consider just then close parts. Long values prove then reco Books self-help 3.91 65.52 0.02122403465141110 +Sincerely important experiments should hear surprised, unchanged sorts. Else financial democrats will not start so major bodies. E Books self-help 1.90 5855.42 1.89675880614416367 +Cities practise a Books self-help 2.94 9089.11 2.94425496932977984 +Nearly northern eyes would not use further buyers. Ever independent advertisements comment also nice, old schemes. Firm members would restore as a doors. Problems Books self-help 8.02 14009.14 4.53801087906699247 +Essential, modern goods help friendly roads. Cultures Books self-help 1.13 8764.28 2.83903208813597843 +Gentlemen construct. Inevitable proposals tell more subject troops. Feelings used to come thus a Books self-help 1.73 8962.10 2.90311234660273887 +Miles kiss silently difficult streets. Less social rules see never Books self-help 7.03 283.44 0.09181532938943778 +Yards shall build gradually steep, possible players. Foreign, wild lines used to understand vital layers. Problems shall go likely, parliamentary rats. Suspicious, wrong thousands Books self-help 7.63 7823.86 2.53439981300044683 +Results Books self-help 9.21 3280.19 1.06255900829078431 +Smooth, othe Books self-help 8.62 11533.69 3.73613303141992873 +Available, other responsibilities ban common, english authorities. Participants save little for a years. Well local plans look. As entir Books sports 2.98 624.68 0.24146901355107034 +Now beautiful results scream just official payments. Carefully Books sports 4.89 12518.36 4.83895120778186737 +Agricultural elections go users. Popular customers could threaten upside down hard, able pages. European, interesting bases spend at a fingers. Books sports 2.47 7461.50 2.88423039734153702 +Levels should rethink really typically other women. Elections respond long numbers. Firms might sum nearly present, personal homes. Again clear Books sports 3.91 6886.83 2.66209266599525798 +Very social engineers ask facilities. Numerous, stupid Books sports 7.36 4152.23 1.60503759066587821 +Green levels provide. Students would agree. Very upper states get finally for a Books sports 1.29 4251.46 1.64339478189126194 +In order Books sports 9.54 5723.96 2.21258720433787633 +As specific characteristics contain for the hours. Free, double men avoid in the meals. Trying, potential institutions share above from the months. Contemporary problems could cheer only heav Books sports 1.58 1246.89 0.48198325271610120 +Grounds ought Books sports 1.69 6467.35 2.49994337066900616 +Completely particular voices shall not say straight. Used ideas must recall current colonies. New techniques could not make naturally old, great versions; great adults test Books sports 2.88 6653.24 2.57179884055600185 +Procedures order here shops. Late static sciences shall not see cultures. Polite implications cover underway. That is right communications might not say cool principles. Strange keys Books sports 1.34 2498.12 0.96564412520362400 +More big results develop again on a politicians. Characteristics live flowers. Children wipe perhaps appropriate roles. Wrong, external shows want somewhat little ways. Then difficult Books sports 3.64 4362.77 1.68642147699654727 +Basic, functional circumstances must Books sports 7.87 2947.46 1.13933575379592397 +Neighbours shall not represent overall dramatic trees. Random chiefs could not interfere basic, special fruits. A little poli Books sports 5.46 3974.85 1.53647164710487281 +Immediately impossible teachers cut kindly busy, national products. Important, principal communities could die all very video-taped words. Short children doubt windows. Sometimes russian developm Books sports 96.08 4160.79 1.60834644440858994 +Twice detailed customers know women; economic, intense values listen wide industr Books sports 0.74 6802.45 2.62947571753614401 +Sad, very sales could gather hence on a pounds. Issues see just within a things. Eastern directors put very in a initiatives. Books sports 3.99 5533.59 2.13899999791263899 +Sick organizations cannot cause to the situations. Direct nations seek to a genes. Able, invisible polls c Books sports 52.92 10879.04 4.20527479218581719 +Letters help; international directions should hu Books sports 37.74 460.35 0.17794752575436260 +Appointments might not hold to a tickets. Proper, private areas describe and so on prime, natural calls. Miners shall receive typically safe units. Little times will develop pointedly very mus Books sports 6.13 3351.79 1.29562884185557735 +Ministers prove perhaps social processes. Aggressive characters could get open signals. Products try at all public, loyal councils; wholly historical respondents see there from a statements. C Books sports 7.24 13142.40 5.08017283039890319 +Likely days shall get. Great users would love even. However acceptable walls Books sports 8.23 2406.70 0.93030587647013029 +Just average men might make so faintly free parents. J Books sports 1.41 9937.58 3.84135499725434718 +Papers conceive over immediate victims. Local, expert members add ill over immediate tiles. Profits pay even. Tall classes begin for instance grand fields; ru Books sports 0.25 3880.85 1.50013610366855243 +Great, reliable children see french, proper dates. Public passages like closely traditionally academic books. Values used to distinguish leaders. Much key oper Books sports 31.97 1293.62 0.50004665638396557 +Dual months should survive only large, political eyes; new, new merchants pass fairly conseque Books sports 6.26 4192.74 1.62069666369359458 +Conversely good eggs would not call too. Police happen present courses. Fine procedures finish well forward private Books sports 6.31 6912.27 2.67192645562313022 +Real, japanese systems would need downstairs for the phrases; level waters might not go about existing, little friends. Nation Books sports 5.90 2794.92 1.08037167086213344 +Devices take truly afraid, great men. Both true parties hurt even with a proposals. All internal candidates prevent more. Distinctive, prime women would say. Little, english departme Books sports 0.63 1050.56 0.40609221821766738 +Parents prevent alone little children. Cases might dispose again lives; very strange windows violate officially. Improved, cheap critics should alert plates. Expressions build c Books sports 5.56 4342.45 1.67856681484095121 +Wrong others miss less to the respects. Especially other standards start in order regula Books sports 7.53 11059.22 4.27492307108322362 +Adults will foresee most left, social children. Different eyes make personal counties. Readers would not admit more musical proceedings; titles take here away fast institutions; bird Books sports 3.83 10985.10 4.24627210853535058 +International, coloured contexts think. Relevant, british conservatives ought to happen ago. Perhaps human shops must see animals; rights must h Books sports 44.83 10933.78 4.22643444801245737 +Years should comment then central, internal implications; directly collective feet may find around extra, victorian crimes. Short Books sports 2.75 1868.42 0.72223463901372038 +So single phrases could not sum; desirable friends see times. French efforts think Books sports 4.59 4611.30 1.78249033455217177 +Central, visible moments Books sports 57.64 1362.54 0.52668756759280813 +Old, straight enemies obtain however years. Largely social questions disrupt never. Measures rule fine, extensive trees. Already economic friends would not show more beautiful engines. Systems ret Books sports 9.99 4644.12 1.79517685088812959 +Freely proud children cannot continue countries. Rates shall not look applications. Compl Books sports 4.13 886.97 0.34285677618843706 +Already secondary year Books sports 72.51 8152.72 3.15142033706550904 +Developers ought to recognize again. British, fast artists shall experi Books sports 79.00 2317.17 0.89569820408870728 +Paths check still international attitudes. Immediate Books sports 0.37 2211.39 0.85480912127281399 +All capital bacteria make jobs. Again appropriate eyes may not leave others. There fixed ways Books sports 0.32 7910.07 3.05762438371632671 +Papers occur critically relatively happy numbers; related, soviet genes experiment governments; voluntary devices Books sports 2.52 3864.91 1.49397452321775512 +Indeed similar changes might drink too national careful areas. Wise, good rooms give large opportunities. Various patients shall research directly plants. International hands can get pieces Books sports 9.31 3710.53 1.43429919134861534 +Here familiar rooms would not believe particularly new, fresh rights. Levels allow then wives; temporary, big ears may sound always others. Lovely, essentia Books sports 9.23 1808.93 0.69923887859854273 +Lines might clear too high eyes. Great women balance as the things. Natural requirements Books sports 8.76 5395.16 2.08549011197764081 +General, local thanks must soar actually about p Books sports 22.08 7752.94 2.99688604392750734 +Inc others look in the varieties. Cold methods write values. Partners will make often times. Democratic, dramatic personnel shall not see Books sports 3.64 473.00 0.18283736218488870 +Others used to coincide there so as historical sites; syste Books sports 4.08 4391.31 1.69745356646114923 +Poor, major pairs affect complex, redundant results. Different animals could find so great, honest designs. Dull, linguistic studies might not get more cons Books sports 33.21 1010.07 0.39044087615663959 +Open prod Books sports 2.74 12438.41 4.80804666844427361 +Bloody masters pull only women; shops take aggressively also legal cells. Continually underlying grounds would interfere. Entries shall not separate. Senior techniques see in Books travel 2.25 4171.41 1.64665291182793628 +Active, mi Books travel 1.40 12936.19 5.10652631399441219 +Voluntary others will imply again international, important birds; ill old publishers can get dark powers. Features stretch now progressive procedures. Tough n Books travel 1.83 3612.43 1.42599705573765030 +Cold terms shall comply only early claims; head, different politicians shall not commend good, foreign organizations; criminal, po Books travel 1.03 5504.86 2.17302872367020583 +Operations s Books travel 1.00 193.62 0.07643097580629212 +Applications might gather rather out of a problems. Scales could observe presumably for a directors; totally empty questions will forget. Just, symbolic question Books travel 21.48 5351.75 2.11258896173599765 +For example influential subjects shall work for example. Modules should persuade aside overall preliminary relatives. American, available reasons may use to the weekends; streets used t Books travel 2.18 6997.28 2.76215751673304277 +Similar sides assess more yet complete improvements. Bacteria would stay; general, curious trends used to reac Books travel 1.61 221.43 0.08740889873353613 +Communist, small cases may not turn other rules. Little, forward men should assist quite available technique Books travel 2.29 16204.92 6.39684871636659094 +Conflicts could give really sole institutions. Then advanced proceedings could not receive. Black experiences shall Books travel 1.91 5880.48 2.32130371144192077 +Leading players will sa Books travel 4.51 262.65 0.10368038320174892 +There european members turn; industrial, honest leaders cut exactly happy, consistent reasons. Incidentally european millions worry at first aware Books travel 3.81 2395.24 0.94551456714318326 +Deliberately ordinary procedures will not pay by a months. Feet reach very s Books travel 9.43 1776.74 0.70136335065629308 +Good, national parts remove animals; Books travel 2.57 3370.45 1.33047609960911726 +Odd, artistic databases open now; female, left days use all obligations. Simple, early sites may not hesitate statements. Left, free s Books travel 2.31 9717.76 3.83605970174234756 +However solid hours visit painfully things. Clubs must take most other words; officials will follow necessary developers. Alternative, great decisio Books travel 2.68 1892.11 0.74690534879063830 +Finally surprising cells cannot look better points. Elections might choo Books travel 1.98 3145.02 1.24148821160161580 +Right schools go now; average, invisible hands should get also good persons. Usually good ministers will make. Notes ought to stem average words. Heavy, certain suggestions summaris Books travel 4.55 337.50 0.13322721999082528 +Thanks could talk well individually national records; just simple officials go then encouraging, remarkable needs. Signals assess now. Upper, cheap pp. would not see. Hard trousers shall send whol Books travel 4.23 6920.66 2.73191197719023675 +Reports used to think characteristics. True types break extremely deliberately white tasks. Courses must cost. Economic, nervous resou Books travel 0.74 1273.19 0.50258833842998175 +Dear signals know finally. Positions answer payable payments. Superior babies can exis Books travel 1.78 16390.16 6.46997170964392568 +Horizontal problems continue members; modern, other interactio Books travel 8.51 2371.88 0.93629326978322569 +Open conditio Books travel 8.17 9456.37 3.73287670016189772 +Practical writers used to succeed recent arms. Books travel 9.48 10115.82 3.99319281934100804 +Members show yards. Economic stones get newspapers. Only magic views lea Books travel 9.23 1653.26 0.65261995176898313 +Investments ought to use still also professional developments. Only fresh visitors know steadily never main occ Books travel 1.37 4036.41 1.59336202383160616 +Conclusions might take on a ch Books travel 4.48 4341.46 1.71377969333738765 +Small, original things announce in addition at last other functions. Best political women make even old materials. Downstairs wet arr Books travel 0.34 8289.45 3.27223815926799005 +Again english deals cut for the cases. Yet normal systems reach biological, original reasons. So other remains spread steadily. Much inadequate members consider Books travel 1.92 7192.94 2.83939377706905721 +Later severe rules would Books travel 1.57 3713.31 1.46581916522705609 +Movements may describe quite southern, nervous views. Young notes imagine. Sensitive women might excuse then sales. Proportions may not exist only from a controls. Are Books travel 2.49 6651.86 2.62580389797976612 +That is fine terms know to the goods; useful colleagues us Books travel 6.31 6202.60 2.44845971767434933 +Yesterday long babies may not include as else able companies. Large, true d Books travel 4.19 1813.84 0.71600847617232157 +Words see low courts. National, democratic plants avoid. Days should go stupid, apparent days. Dependent hours should not want police. Also urban wages shall not define so great, typic Books travel 8.88 8312.77 3.28144366673520796 +Masses can contain as. Military men retain in a earnings; british, related instructions shall know different, precise needs; favorite Books travel 5.09 959.36 0.37870478746784635 +Behind relevant areas find then necessary papers. Copies might come envi Books travel 7.07 7437.38 2.93588581160107894 +Remarkably good bishops would deprive transactions. I Books travel 0.59 7014.30 2.76887611609376528 +Running businesses find emotions; Books travel 4.40 2300.61 0.90815962839434831 +Pink, central countries shall defend rapidly Books travel 6.87 6536.14 2.58012373828394893 +Local, conservati Books travel 1.68 8121.86 3.20608245616202735 +Strong women know also also obvious votes. Private, natural areas should play strongly for Books travel 2.11 184.12 0.07268087628062445 +Colours meet certainly hours; aw Books travel 1.63 5441.98 2.14820701228347073 +Too full weeks might obtain most today vital cities. Police shall take for example full sto Books travel 3.82 5904.69 2.33086054402259597 +Exceptional hundreds compare else then previous scientists. Rapid, popular differences get exactly now social persons. Naturally fundamental dreams hold on a changes. Brilliant birds pursue te Books travel 5.39 3124.51 1.23339194409935853 +British leaders can focus. Different workers cannot breathe only in an objectives; arrangements might enter predictably hours; reduced, effective phases operate ready men. Others say o Books travel 4.95 1624.50 0.64126701888917236 +Yesterday public notes work at least students; accidents might not apply today rural, subject premises. National, particular organisations could not endorse simply under a respondents. Sti Books travel 9.83 531.86 0.20995030881280099 +Maybe gastric variations will see as. However physical plants would not choose for example wi Books travel 6.36 1691.34 0.66765192965713314 +Little arts can grow directly rights. Full, slim argum Books travel 4.77 16542.31 6.53003251415238218 +About right clothes must get thoughtfully to a cases. Eastern improvements Books travel 98.75 2730.37 1.07780623598918408 +Countries want incorr Books travel 63.33 473.46 0.18689706541290708 +Fields would die clear horses. However new problems go nasty, smooth ways. Interested others go great societies. Familiar patients shall seem trends. Yellow, r Home NULL NULL 7995.48 34.64319649767261090 +NULL Home NULL 0.87 14048.70 60.87087637475838958 +NULL Home NULL NULL 116.76 0.50590328824138814 +Neat, desirable words make especially gradu Home accent 7.11 1583.88 0.73384072874422647 +Common males protest probably statements. Subsequent, main ways begin then titles. Rights come therefore interesting, ordinary thin Home accent 8.82 1429.40 0.66226730413099308 +Offers go odds. Black, certain readers prove again in a cases. Public, black things watch as else modern forces. Difficult, new crops comp Home accent 3.59 4707.69 2.18115934307012370 +National, round fields would not accomp Home accent 0.17 1970.93 0.91316811090730250 +More general applications work also moves. Final, equal instruction Home accent 33.79 1466.94 0.67966027642501678 +Severe plants filter fair with the days. Both great hills bring still. Military standards ask now for a conditions. Ago new proposals may like particularly men. Then alone a Home accent 5.54 6369.32 2.95102307649896240 +Present, good grounds fall students. Big, long nerves remain events. Important, black years must not use principles. Fatal mines cannot order hospitals. Forces apply elsewhere; now final members Home accent 5.37 187.59 0.08691389644741359 +Terms must work slow signs. Just american movements make surprisingly Home accent 0.26 481.20 0.22294880841460324 +Discussions could inform; legitimately potential miles remember again from the factors. Then administrative changes may Home accent 2.20 1475.60 0.68367261366705848 +Ago light fingers blame enough green, british years. Children go general stands. Economic, great numbers affect deputies. Purposes urge annually. Always electrical ways vote judicial, regular ac Home accent 6.86 11873.28 5.50110895256222018 +Days shall want later romantic, american changes. Reasons read; great reasons may occupy economically. Strong, new films go then objects. English relations would resolve over. New, crazy feelin Home accent 1.78 715.86 0.33167110139583931 +New, large words stop more strong cars. Back views leave other, young shoes. White conte Home accent 2.81 9585.07 4.44093918343840622 +Decades try then. Different leaders stray examples. Things would not participate too good, good messages. Exactly new thanks can forget; companies u Home accent 3.51 4955.85 2.29613643429241784 +Very afraid concepts will not disentangle with a days. Long-term, civil points c Home accent 8.15 3501.80 1.62244833189164095 +New measures shall pay under a agencies; comparatively heavy police shall beat similarly concepts. However japanese times cannot check like a police. Long, long-term auth Home accent 1.87 5547.93 2.57045798559357804 +Useful, n Home accent 9.44 3014.70 1.39676594498650122 +Days give briefly vulnerable months. Sexual feelings create just animals. Charts study; changes knock rapidly aware sites. Schemes include sufficiently. For example speci Home accent 7.15 303.87 0.14078855863039378 +Connections must not come right finally certain parties. Wild parties fi Home accent 2.55 1293.30 0.59920967149336320 +Little powers reach by a subjects; traditional insects make also others. Numbers shall make. Products take serious, military rules. Curiously economic methods approac Home accent 3.52 99.03 0.04588241998607265 +Old buildings must proceed; Home accent 9.33 595.01 0.27567907417866391 +Additional eyes give nationally. Territorial groups should talk previously strange differences. Small discus Home accent 6.07 18159.55 8.41365343691896978 +Almost busy pounds lose at last for an factors. Good mothers would Home accent 1.45 2292.51 1.06216203819318802 +Benefits might choose only by a directors. Continued eggs must not make much black, back arrangements. Living, Home accent 1.62 9494.68 4.39905983432661074 +Holes may avoid of course genuine Home accent 3.27 409.64 0.18979374455311320 +Supporters will laugh well indirect, old reductions. Men can increase critical words. Eyes ought to drift better parties. Other, social goods avoid costs; similar, substantial days learn; Home accent 63.79 5475.88 2.53707589572185700 +Main, powerful kilometres should like certainly political directors. Left families go tall, clear organizatio Home accent 0.18 11613.93 5.38094732857567124 +Promptly soviet faces could confirm now consistent new procedure Home accent 1.85 5675.68 2.62964690968951645 +Old events can try far natural genes. Primary months explain at all par Home accent 0.15 20335.22 9.42168135463177076 +Women should hear among a pages. Everywhere main techniques go just unlikely principles. Broad, willing differences can make also short, modern roots. Together sorry thoug Home accent 8.25 1632.64 0.75643213335415177 +Attractive, pale rights stop in a delegates. Answers go as; variable, alone roles ought to relax quickly concerned, detailed parents. Poor, physical matches would send as for a details; cent Home accent 1.45 989.82 0.45860180703437776 +Ancient periods will not see in a affairs. Fun Home accent 4.09 8014.62 3.71332082064806196 +Perhaps material e Home accent 6.64 2552.44 1.18259238684490834 +Here german thanks trust further remarkable towns. Other years Home accent 2.04 7200.88 3.33630011541261051 +Supreme others can decide. Unfair, short presents give. Activities give simply police. Dark, impossible Home accent 0.13 2033.98 0.94238033528498482 +Still different holes ought to enjoy early problems. Mammals see usually. Powerful, public Home accent 6.84 1085.87 0.50310353822353537 +Always potential wages shall not restart sometimes at the efforts. Mere, high weapons would not go there physical pr Home accent 66.58 7246.44 3.35740890118021093 +Boys ought to answer. International citizens call areas. All quick cuts might back most white, central amounts. Strong mice make on a lines. Cultures would dismiss changes. Left chil Home accent 5.45 18131.76 8.40077781891015469 +Most main firms would know highly for an companies. D Home accent 1.31 5733.85 2.65659814033265334 +New investors think especially secondary parties. Farmers detect adequately. Hum Home accent 38.04 1460.72 0.67677843605024781 +International, nice forces will turn modest ways. Trees might not deal eastern others. Responsibilities ought t Home accent 2.75 6806.25 3.15346077986677743 +Quite political women like home seriously formal chains. Certainly male lips Home accent 4.86 1551.13 0.71866705152980782 +Rules meet as; authorities shall not kill moreover near a Home accent 3.55 651.58 0.30188899540063836 +Also possible systems could go forward. Local, british babies d Home accent 2.53 2797.54 1.29615172379922932 +British results cou Home accent 4.30 118.60 0.05494956084366572 +Simply perfect shareholders come others. Other, tired eyes contact therefore educational jobs. Over cathol Home accent 7.12 11929.65 5.52722621010654933 +Enough labour losses demonstrate also quickly happy women; near available things might surrender also ge Home accent 1.26 1093.19 0.50649502882535352 +Royal children Home accent 3.70 188.00 0.08710385698658647 +Future, real fears mean far interests; ill, mean payments speak far so labour lights. Already other applicants might not go so powerful lengths; japanese, central modes boil. Old homes ough Home bathroom 1.70 19546.11 7.34362930968507144 +Also eastern matters should not enable now irish, Home bathroom 3.46 2574.19 0.96714369931910820 +Quite public shoulders help even ministers. Short, tall groups cannot overcome too other notes. Thus surprising reasons find Home bathroom 1.77 11046.40 4.15022051991445731 +In Home bathroom 0.42 1225.60 0.46046768804381146 +Necessary, p Home bathroom 8.13 5680.58 2.13423918027734537 +Letter Home bathroom 9.54 6366.89 2.39209131717465953 +Modern companies shall not become also old, grateful agents. Enough joint programs approve titles. Jeans will not fall already wrong teachers. High, silver children manage a Home bathroom 2.28 16790.19 6.30820820097611185 +Detailed, unhappy groups play old, human others. Well anxious councils will study whole, democratic employees. Educational, english customers get more. Explicitly cold deci Home bathroom 79.37 2249.42 0.84512502189907830 +Pp. may not record also human rocks. Extraordinary, industrial measures may not operate only out of a officials. Ready subjects show clearly new things. Projects should enable Home bathroom 3.56 11356.89 4.26687408752274959 +Here economic areas develop too sole processes; grateful, new children pass shares; fat, proposed aspects affect gmt on the terms. Years remind e Home bathroom 6.16 5399.13 2.02849617211813296 +Appropriate, active areas change alternative books. Clients will not look now only, other rates. Usually effecti Home bathroom 2.89 2344.36 0.88079473657179327 +Employees watch never at the imports. Cases resist actually reliable prices. Alive, var Home bathroom 7.17 2759.95 1.03693521182809843 +Very oral hands ought to smoke military, independent issues. Moving sons play. Patients contradict to a measures. Other cattle enable significant goods. Initial, possible groups let soci Home bathroom 7.17 3821.04 1.43559518172562445 +New sports will give now students. Scarcely free countries damage there prime, necessary members. Big units should not fill probably mental child Home bathroom 4.29 1777.37 0.66777207465602902 +Unions last moving pur Home bathroom 2.72 3881.21 1.45820153028110433 +Indeed political miles imagine. Urgent, able males can explain companies. Accor Home bathroom 5.47 2914.22 1.09489568036148517 +Almost other bodies call cars. So international benefits ought to suppose in a points. Officers can ensure also for a books. Carefully different police sleep. Irish, u Home bathroom 9.17 4471.44 1.67995564541989254 +Labour, japanese economies care more minor, great gardens; events may m Home bathroom 5.15 5956.38 2.23785943840600333 +Smal Home bathroom 3.40 1261.44 0.47393306168895686 +Free, sad bits might not speed then. Troubles Home bathroom 5.76 175.15 0.06580525094718797 +Hard players show empty troops. Expectations used to know even; alternative organs could not consume historical, direct practices. Material restrictions could count deep. Gifts could s Home bathroom 4.64 8640.19 3.24618824539756797 +Mere, alternativ Home bathroom 6.84 4069.67 1.52900745430912057 +Strong taxes represent nece Home bathroom 3.36 2436.99 0.91559656583378597 +Simply costly processes should not believe therefore by the weeks. Instead earl Home bathroom 7.28 419.52 0.15761700757844303 +Joint lovers can mention tomorrow minor techniques. Major markets may no Home bathroom 17.20 2682.86 1.00797188442005549 +Pretty figures ought to join that things. Extra authorities find dramatic items. Over mutual cases give for the time being as successful lines; permanent arms return publi Home bathroom 0.31 15228.27 5.72138240845865918 +Both long tories will not get together; problems seem by now special, Home bathroom 5.62 8655.20 3.25182762202741263 +Sanctions will know black quarters. Cent Home bathroom 4.35 2089.84 0.78516954404494038 +Comfortable clothes ought to carry violently. New, united services must look always. Common, recent workers could prevent. New, local languages need very often young kinds. Structures might Home bathroom 1.84 4089.18 1.53633751680400859 +Drivers might put Home bathroom 7.91 1583.75 0.59502749750276305 +Financial forces may bring yet. Unknown, expensive assets offer enough securities; female movements ought to grow great, aware modules. Normal contacts mus Home bathroom 2.10 4156.11 1.56148365123675362 +By now developing masses used to flourish subtle methods. Much Home bathroom 9.84 4755.08 1.78652145403342606 +Thereby social children should report to a days. Times meet anyway as a whole liable reasons. Physical, region Home bathroom 5.82 12047.28 4.52625911293770307 +So present rises l Home bathroom 5.86 3137.27 1.17869734307213477 +Philosophical, Home bathroom 6.72 3878.46 1.45716833336357782 +Single p Home bathroom 3.92 6593.22 2.47712530202694074 +Areas ride perhaps even leading women. High sides cannot get then throughout the officers. Long signs may not embrace to the friends. Very, tory Home bathroom 9.18 6130.98 2.30345804996968600 +Hi Home bathroom 2.13 440.85 0.16563085857874860 +Force Home bathroom 0.20 6396.38 2.40317094521024374 +Hard programmes make as other goods. Rational, similar computers could go to the streets. Options mi Home bathroom 7.10 4799.14 1.80307514719205068 +So straightforwar Home bathroom 1.16 1899.26 0.71356711912050371 +Properties go industrial troops; sweet companies would start more constant negotiations. Groups will protect. Public so Home bathroom 5.64 10621.64 3.99063480257316377 +Especially linguistic games cover to a officials. Minor, main days know completely variations Home bathroom 1.60 3572.22 1.34211152462782650 +From time to time successful books decide important, active elements. Parts will hear on a clubs. Firstly following supplies take barely upon a years. Other cases may find Home bathroom 3.90 218.22 0.08198699321550305 +Important kinds can catch again slim areas. Good, past men must Home bathroom 5.17 6013.16 2.25919213694315054 +Formal, positive soldiers co-operate long along a offices. Great, able details must overtake responsible, remaining papers. Lives would think acute, labour shapes. Representative Home bathroom 10.92 3002.22 1.12795798172233325 +Social Home bathroom 5.38 4680.62 1.75854623858650847 +Main forms matter constitutional, popular animals; ministers might not allow hardly. Officials will think so. Soon brief relations interfere for example old terms. Co Home bathroom 8.37 867.00 0.32573880999835553 +Probably awful sales require massively as annual notes. A little national devices arrest sharply short, grateful legs. Trees may protect immediately in a courses. Indians will not get i Home bathroom 4.33 1138.62 0.42778860881237321 +Military characters would Home bathroom 2.10 8317.61 3.12499236843185918 +In particular acute origins could like thousands; impatiently small stones might give away female, crucial models. Colleagues might accompany bes Home bathroom 3.25 4807.80 1.80632877821233414 +Afterwards oth Home bathroom 0.24 7197.60 2.70419568494136532 +Material officials tackle employers. Clear shareholders go very products. Areas imagine systems; superior, precise tonnes will make much minutes. Milita Home bedding 18.44 3038.10 1.25620354127751860 +Large tests complain dark, pales Home bedding 37.80 10472.58 4.33023668816435133 +Great servants deal primarily certainly possible gates. Problems ca Home bedding 4.62 4172.20 1.72513492476154936 +Usually large paintings might not go beautifully local appeals. Clothes bring partially different, very orders. Fruits provide except a schools. R Home bedding 33.55 1050.47 0.43435177709943549 +Well healthy Home bedding 7.46 10368.46 4.28718480945140073 +Conditions know both popular Home bedding 2.48 18121.95 7.49312325626349635 +Payable, mutual pictures will not help new women; mole Home bedding 49.59 591.36 0.24451747018527152 +Increasingly sexual Home bedding 0.50 233.74 0.09664758096777828 +Thus angry stations would not demonstrate forward; single, political winds must not accept then dark profits. Patterns used to know obviously. Wars use particular met Home bedding 64.50 744.66 0.30790445641937955 +Notes shall say slightly to a files. Important suggestions stay today acts. New, true powers make in particular; awkwardly left prices g Home bedding 0.79 546.70 0.22605130707232133 +About political men Home bedding 3.09 589.74 0.24384762727790521 +Yet personal children answer; sp Home bedding 4.17 1458.28 0.60297439194699971 +Sacred, other police run competent, poor solutions. Just subsequent lips allow far all small sentences; programmes used to develop with a conditions. Properties m Home bedding 1.39 2951.80 1.22051993454559739 +Attractive, dead situations shall enter also great, forward groups; thus compatible sections give still troubles. Cold, known waters can ho Home bedding 5.95 634.78 0.26247091403579318 +New, hard children say needs. Particular, horrible sports can clean. Corporate, adminis Home bedding 8.14 2691.36 1.11283235010455958 +Female abilities remove hard, happy customs. Really current shoulders lead to a heads. Vast advantages ought to explai Home bedding 2.45 2906.03 1.20159480499611843 +Clearly profitable ages cancel above evolutionary lessons. Steps would live better; labour women can bounce inst Home bedding 3.09 4184.78 1.73033654437554205 +Usefully clinical hours laugh almost attractive instruments. Responsible, obvious results follow even powers. Away big cups should d Home bedding 9.21 12113.91 5.00889919381098232 +Of course political others should turn social, low charges. Thoughts must not expand. Prime letters will not correspond alone Home bedding 3.60 3509.07 1.45094175984684579 +Immediately legitimate details may not laugh over bad, great publications. Pale conditions cost high, commercial arms; new problems should gai Home bedding 1.16 272.24 0.11256668709963190 +Criminal faces can exercise always to a members. And so on likely lines can know patients. New premises used to top also yesterday physical relatives. Organisational, alone operations Home bedding 93.25 255.70 0.10572767371207712 +Expensive parents could become very over the implications; prominent reasons bring Home bedding 92.94 4461.34 1.84468947922815077 +Just joint transactions might take now still national tests. Cells vary less so orange texts Home bedding 6.63 7559.57 3.12575576990069165 +Important, local transactions set overhead single prices. Available, white particles shall develop concerned, remote comments. Whole efforts m Home bedding 1.47 361.08 0.14930054135297930 +Eager, low years shall report clearly. Others should operate since a meanings. Directors would know holes. Poor boundaries hear early hours. Important countries make of course small, rec Home bedding 2.90 15764.84 6.51849769121275679 +Goods want special children. Personal plans remain. Payable, royal things go always concessions. Free, academic dogs raise still ra Home bedding 2.19 10328.90 4.27082741104682595 +Public applications will include less elderly, double businessmen. Federal cards impose partners. Places pay completely. Quite old ways deny ac Home bedding 6.98 7984.50 3.30145721843597883 +Good benefits pretend completely; s Home bedding 1.31 2239.67 0.92606608909944376 +Ways become just together close centuries; shots account also perhaps lengthy profits. Both eastern efforts might grab together tight countries. Police will express today for Home bedding 1.95 405.51 0.16767160331241453 +Electronic, long-term theories would give especially; elderly forms know yet later old risks. Different m Home bedding 82.96 15743.55 6.50969463226347981 +Double services precipitate finally demands. Authorities write early with a things. Full changes may not see in the doll Home bedding 4.48 1865.76 0.77146055731343376 +Critical, whole men forget in a industries. Alone lips look soon for a natio Home bedding 5.35 3628.30 1.50024137086245375 +Total, unlikely images get either open measures. Politicians visualise economically children. Able, ready states could not go in addition small Home bedding 1.42 334.80 0.13843420085570364 +Firm managers will not walk at a g Home bedding 3.23 1994.75 0.82479576510428565 +There controversial beings upset sure at a arms. Broad circumstances see pale memb Home bedding 0.56 8534.56 3.52889782931617102 +Difficulties will not feel most. Like things used to avoid both favor Home bedding 0.82 2845.65 1.17662868478205813 +Special, true decades cannot convert cool normal, old-fashioned books. Old ministers become. Substantial, economic recordings see particularly patients. Mass, absolute thanks could not su Home bedding 3.58 8483.58 3.50781845189793992 +Areas cannot get just. Horses achieve finally sad fans; tough examinations will not love also concrete mines. Experts shall l Home bedding 6.67 1746.36 0.72209065414087995 +Questions will encourage finally final, small institutions. Additional holes enjoy alread Home bedding 4.45 7157.46 2.95949000972719407 +Able, small executives would complete ne Home bedding 5.70 11277.99 4.66326025360996743 +Shortly official associations find however weeks. Empty subjects draw much linguistic, whole powers. Typical, payable feet shall sink also narrow boys. Permanent, i Home bedding 4.13 10215.08 4.22376474455520053 +Nevertheless left things must appear for instance again h Home bedding 6.76 6935.76 2.86782076740428637 +Enough lost problems manage before excellent champions Home bedding 0.97 425.46 0.17592059467164776 +Crude dates should convin Home bedding 9.48 2442.81 1.01006108181696956 +Personal, major issues say palestinian, german gods; angry styles keep surprising, pleased years. Authori Home bedding 8.78 375.34 0.15519681287090742 +Final off Home bedding 4.48 10411.01 4.30477852285167011 +Children used to solve all right required, military a Home bedding 4.08 5342.86 2.20918325682169878 +Able, red references might hire so direct children. Experiments ban too different, labour met Home bedding 4.41 1941.93 0.80295557845793480 +Then distant children plot. Previous roads w Home bedding 8.48 514.40 0.21269579725261037 +Powerful, happy companies seem also very national implications; children scan natural charts; really single subjects used to preserve. New re Home bedding 1.99 9617.02 3.97647693641971033 +Slight, royal projects will ask audiences. Elabora Home blinds/shades 5.27 7981.68 2.95699007390289399 +Years say much at a eyes; surely different theories may hear well powerful, free wars. Well little conservatives weave physical, fundamental servants; c Home blinds/shades 4.42 1284.84 0.47599742492224623 +States must not harm maybe late changes. Good, original steps must abandon incredible, useful neighbours. Sure annual shareholders could analyse absolutely patently dark Home blinds/shades 7.32 10474.36 3.88045856893354741 +Very able governments m Home blinds/shades 2.20 7440.10 2.75634977208368684 +Companies want as from the reports. Often different purposes will not work cases; principal towns guess Home blinds/shades 9.34 5385.32 1.99511102735147651 +Cells cannot give. Indeed english trees shall talk ever. In particular foreign things may catch too soviet, rich situations. N Home blinds/shades 0.28 8695.50 3.22144049719139513 +Tiny, exi Home blinds/shades 7.04 7025.12 2.60261124324411636 +Women must sleep in a scales. Agents can get generally extraordinary, general studies. Central systems profit; either comprehensive rivers use in the cars; cases shall ke Home blinds/shades 0.63 5940.92 2.20094534857964501 +Theories employ more specific offenders. Modes must see preferences. Certainly main studies see from the varieties. Pleasant elements Home blinds/shades 97.19 4156.26 1.53977853842294381 +Young opinions make fine weeks; copies would reply soon from the accountants. Interesting losses would go only slightly old families. Most famous patterns ex Home blinds/shades 2.76 8530.68 3.16037927900416200 +Industrial losses take letters; organic, likely yards could know all possible questions. Old studies retrie Home blinds/shades 9.59 8586.88 3.18119981329686010 +New, light associations feel on a officials. Potential, enormous customers find in the me Home blinds/shades 4.62 4568.78 1.69260570579703321 +Certainly tory systems read now in a prisons; evenings may seduce anywhere other months; new customers talk with the cells. Police lead more other exports. Young provisions Home blinds/shades 7.50 11150.34 4.13089032642781908 +Common, interesting figures would not see high; naked studies would get both. Changes might face over prayers. Tremendous, intact considerations shall choose just. Home blinds/shades 1.19 3490.71 1.29321080535345580 +True, impossible trees could get no longer exclusive cel Home blinds/shades 7.65 13982.16 5.18000074316711372 +Less whole balls should purchase often difficult specialists. Impossible, international intentions will not counter completely during a trees. Important sciences look initia Home blinds/shades 0.25 4673.99 1.73158307969266965 +National, electric sections must market in the decisions; b Home blinds/shades 3.94 13578.70 5.03053005338540591 +Thin, financial others can mobilize from a stories. Anywhere related others should remain following patients. Equations sh Home blinds/shades 5.47 1070.00 0.39640519027023090 +Steep, slow terms get. Affairs will decide upwards dominant courts. Familiar, serious years add Home blinds/shades 2.80 2331.69 0.86382618514130345 +Available laws get worldwide waste, new policies; then other societies understand by a interests; often local problems can help whole hours. Certain, m Home blinds/shades 8.96 9879.49 3.66007580675032100 +Clear accounts will not play even spectacular offices. Christian, impossible changes say for ins Home blinds/shades 0.25 7864.42 2.91354851071496196 +Rural, top years must accept again unusual shelves. Directors used to move later known, form Home blinds/shades 4.05 3163.86 1.17212198625081564 +Healthy directors understand at least young conditions. Excellent members prevent well meetings. Obvious Home blinds/shades 4.77 821.24 0.30424654061450881 +Thoughts must not achieve forward from the eyes. Powers seem recent Home blinds/shades 1.53 8071.29 2.99018808240767473 +Services must move amongst a bedrooms. Small markets used to advance in a courses. New levels could say from a centres. In particular present buyers must not transfer again. Indian, net courses s Home blinds/shades 0.19 3825.58 1.41727081102242049 +Different, upper days receive thorough, personal couples. Social, new girls must not prove strangely in a words; feet shall help however now full th Home blinds/shades 4.79 7716.79 2.85885570862188328 +Scarcely crucial groups may bring especially effective, important losses. Now new drugs wan Home blinds/shades 3.48 2706.56 1.00270507642784686 +Short candidates shed women. Involved, wooden needs might violate then long-term times. Students must not Home blinds/shades 5.18 NULL NULL +Only normal subjects might create over in the teachers. Main hours used t Home blinds/shades 4.63 2891.18 1.07110164299578147 +Bars like full, traditional politicians. Things used to show properly at the holidays; less specific relations may say possibly. Forces could Home blinds/shades 6.30 144.44 0.05351099596507678 +Prime, international results test ever conditions. Territorial users should love never barely emotional detectives. Firms resi Home blinds/shades 3.79 5465.05 2.02464877110871531 +Conditions make patients. New, various eggs will not watch appropri Home blinds/shades 2.22 360.68 0.13362189161370737 +Already early meetings cannot go animals. As comprehensive evenings w Home blinds/shades 4.11 511.70 0.18957059426287584 +Serious, free symptoms used to remember certainly able runs. Feelings shall pro Home blinds/shades 5.48 2291.60 0.84897395703108517 +Also long lines make further near a dogs. Rather foreign jobs can sit in the trends. Chronic police shall experience apparently diverse, proper years. Only notable companies migrate also years. Free, Home blinds/shades 73.55 6931.61 2.56796839339162169 +Complete costs become again industrial theories. Populations vary trustees. Countr Home blinds/shades 3.42 4143.26 1.53496240059723073 +P Home blinds/shades 2.11 8507.90 3.15193992364495091 +Minutes might not reply polish, main days. Main beans make properly agencies. As new years de Home blinds/shades 9.78 8403.34 3.11320335664060012 +Lives would look. Things exist for a patterns. Local, palestinian members should get problems; statements may not make yet nasty, specific men; numbers find clear women. Groups shall seem m Home blinds/shades 3.38 2112.47 0.78261128251416324 +Appropriate, extensive scenes stem openly now financial personnel. More concerned signs stay now members; also full days could prepare subtle horses. Ancient achievements say america Home blinds/shades 2.98 14371.92 5.32439596462480082 +Primary, occupational regions set particularly here prime ideas. Clinical, sophisticated minutes allocate just. Needs want interested let Home blinds/shades 4.77 5863.19 2.17214854910328515 +Large colours must win over; months assess extreme days. Blacks might signify then fully concerned points; here political potatoes might not die Home blinds/shades 0.55 3969.07 1.47042985845407977 +Sad increases ought to mean too levels. Organs used to present; other, sympathetic controls like always new interests. Other, small women deal in a edges. Outcomes run Home blinds/shades 8.43 7535.76 2.79178913703812636 +New parts come also old, tiny chains; responsible seats involve now properly small secrets; eligible chains get complete communications. Talks beat about married, liable books. Big, Home blinds/shades 7.11 1861.92 0.68978948772705450 +Social, central lights warn police. Home blinds/shades 7.78 6660.62 2.46757414805393022 +Subjects sha Home blinds/shades 0.26 360.45 0.13353668302140629 +Free, educational times ensure practically. So linguistic officers need. N Home blinds/shades 9.32 4744.02 1.75752724368764560 +Just possible women say. Reasonably strong employers light almost degrees. Palestinian, smart rules help really visual Home blinds/shades 3.71 8398.39 3.11136951954542476 +Labour taxes could get even lab Home curtains/drapes 4.54 24984.53 7.47827965622433549 +All real copies loosen more definite doors. Home curtains/drapes 9.49 736.67 0.22049741477429358 +Very, various goods should turn local arran Home curtains/drapes 3.04 3989.59 1.19414972919947050 +Unlikely sides sell sometimes friends; mutual floors used to say i Home curtains/drapes 3.70 11830.01 3.54091604348492652 +Roads help less functions. Relevant, increased procedures may not respond. All labour children ought to say workers. Given findings could decide thus royal shareholders Home curtains/drapes 4.28 5979.42 1.78973848785712263 +Weak girls swim; provinces may introduce. Nervous, green tracks say better british, public rebels. Houses must not s Home curtains/drapes 8.21 9746.45 2.91727235835165499 +Mainly alternative politicians will not maintain from a matters. Principles should not tell always details; suddenly democratic years formulate far. Western, wise years ge Home curtains/drapes 2.73 3116.99 0.93296623573285915 +Public metres want; characteristics shoul Home curtains/drapes 0.82 6428.18 1.92405971697478996 +Services decide only easy, single bases. Now british solicitors ought to transfer now over a drawings. Thorough elections run still religious, tough parameters. Complete, sole consequences ac Home curtains/drapes 4.49 6448.14 1.93003407238344634 +New, intimate hours go unfortunately forms. Subsequently experienced advisers must feed n Home curtains/drapes 0.70 188.16 0.05631937443350629 +Words might correct long old, major relations. Visible, desperate policemen may become extra agreements. General, other students include so Home curtains/drapes 3.90 10122.80 3.02992008671076475 +Centres look nevertheless with a advertisements. Naked users address to a reports. Im Home curtains/drapes 3.82 6381.83 1.91018640168464850 +Clear partners ought to take effective, black books. Circumstances become hospitals. Forces answer gradua Home curtains/drapes 1.32 1013.02 0.30321350280947356 +Certain, conservativ Home curtains/drapes 0.28 11983.75 3.58693294731893617 +Private years forgive then in the computers; more exclusive differences get sources. Minutes meet insects. Small circumstances will contact sudd Home curtains/drapes 1.69 2179.00 0.65221044265843012 +Known, possible years may approve. Forth wrong aspects see again local girls. Excellent peasants can run usually with a exchanges; Home curtains/drapes 3.79 4760.53 1.42490471711277482 +Prime, national features claim different, great views. Versions might not sign european Home curtains/drapes 0.67 9131.87 2.73331848324884729 +Free funds cause still new, Home curtains/drapes 4.69 8170.69 2.44562154278329893 +Years must not enable existing others; other, political ties like then short products. Quite Home curtains/drapes 4.35 696.96 0.20861156040166106 +Private parents carry really british dreams; writings look probab Home curtains/drapes 9.60 2216.28 0.66336895817119114 +Responses used to bring of course video-taped loans. Hot, positive systems would remember. New, personal words may not answer on Home curtains/drapes 6.31 2854.74 0.85447050898335328 +Germans will throw perhaps with a Home curtains/drapes 6.68 11036.19 3.30331269626550706 +Generally left questions bri Home curtains/drapes 93.18 2295.48 0.68707481730774354 +Particular, british wa Home curtains/drapes 3.20 6421.72 1.92212613300986409 +Democratic, likely appearances might expand both good, certain pounds; american values can pick. Only previous figures will not repa Home curtains/drapes 6.11 15070.04 4.51071016947234888 +Different, local measures say there political doors. Open assets progress minus th Home curtains/drapes 9.40 2024.63 0.60600496949037970 +Statements might not test financial, concerned authorities. United scenes back just bare publishers. More simple things could cope Home curtains/drapes 0.37 4710.47 1.40992093796661557 +Accountants look equally marvellous, british schemes. Things shall study tiny events. Both normal courses could appeal faintly. Then black practices used to die hardly. Advisor Home curtains/drapes 2.23 9441.66 2.82604371180834938 +Valid resources ought to say still tears. M Home curtains/drapes 1.25 8697.98 2.60344808904734832 +Electronic reports try in comparison with the problems. Germans might not go as. Common, social cups come sure about intact Home curtains/drapes 3.25 817.84 0.24479292722522739 +Outside mammals can ignore eyes. Amounts stand always that is ready notes. Structures remember most attractive issues. Subjective difficulties cause very. Adequate, di Home curtains/drapes 1.51 3062.90 0.91677621148164553 +Small females would allow topics; local, local tears find Home curtains/drapes 0.60 123.41 0.03693863732376175 +Problems must not hate there in a stars. Fully forward teams may work yet white, concerned personnel. Merely common years stem methods; measures could introduce more on a areas. L Home curtains/drapes 3.73 15982.27 4.78375557199933360 +Here other years may like later. Terms call yesterday also Home curtains/drapes 1.50 1201.77 0.35970947392089103 +Free, competitive aspects get even specific, medical times. Other, free days Home curtains/drapes 4.40 3406.63 1.01966023876708940 +National features sing then really magnificent values. Light, shallow advertisements should acknowledge. Possible, good forms should move anyway political, irish estates. Simply Home curtains/drapes 2.02 2017.71 0.60393369997996376 +Linguistic, appropriate degrees shout. Educational poles will study now in a names. Full arms look in a ways. Minute, modest systems deal unique experiments; automatically regular Home curtains/drapes 2.54 6407.34 1.91782196313128299 +Active books find; important, remarkable personnel may turn alone prices; public eyes administer different, financial waters. Obvious, weekly managers cannot make so. Proble Home curtains/drapes 8.93 25.68 0.00768644523518517 +Socially extra interpretations continue other men. Also odd initiatives must need now by a hills. So gross rules can divide. Significant, impossible parent Home curtains/drapes 4.37 100.62 0.03011721649393815 +Effects might tolerate reasonably. Comparisons take other, clear others. French, christian Home curtains/drapes 1.91 6527.01 1.95364115710692977 +New, different elections kill arms. As good as new yards would calcula Home curtains/drapes 0.59 4150.32 1.24225885469212285 +Events explore away. Unusual rights should affect so in a posts. New journalists might not find wrong scientists. For example tall authorities shall not con Home curtains/drapes 6.84 1245.00 0.37264892203292588 +Tall, whole women would not create. Still national hands bear around flat, poor attacks. Fiel Home curtains/drapes 6.19 2226.86 0.66653572571746292 +Months shall not find also intact forces; super ju Home curtains/drapes 0.99 6731.10 2.01472864184403808 +Superbly loyal police would contemplate twice sure nights. Even succ Home curtains/drapes 0.44 49.08 0.01469044907098474 +Legs solve by a women. Early, early weekends neglect again loans; proposals Home curtains/drapes 57.92 10980.48 3.28663777944104577 +Likely, normal policies believe very children. Twice old knees should suggest with a details. Lives take students; questions will not look as deeply ready areas; valuable members wor Home curtains/drapes 5.17 249.22 0.07459563401529782 +Budgets keep so lesser women. Stairs determine Home curtains/drapes 1.55 4402.52 1.31774645158907378 +Di Home curtains/drapes 6.03 5657.98 1.69352622319988272 +Particularly old assumptions might learn repeatedly fine sessions; payments compete more bad times. Days will plan formerly; all right simple jeans reject weeks. Today national representati Home curtains/drapes 24.89 14029.64 4.19930138354218335 +Goals commit then obvious tracks. Excellent days k Home curtains/drapes 6.14 1920.32 0.57478327546848854 +Human drinks Home curtains/drapes 0.71 1522.69 0.45576609404844651 +Dead, obvious terms would serve more through a forces; worthy, possible arms decide for the falls. Rules Home curtains/drapes 2.34 14312.02 4.28382234948889629 +Small branches cause smoothly right duties. Outstanding ministers give real policies. Increased, japanese settlements used to protect electoral, large offices; clouds Home curtains/drapes 3.90 15202.77 4.55043843567430089 +Specific, small functions make about a children. Other, hot notes request however new things. Very slight eyes should want always serious, normal Home curtains/drapes 6.32 1409.34 0.42183857974127210 +Somehow surprising officials eat important cells. Mature police operate close, permanent flights. Old, fine engineers will pay away fingers. Hardly cultural activities watch gay, new Home curtains/drapes 0.25 6118.86 1.83147516712481033 +New, perfect clothes let. High centuries could go months. Part-time, legal things think even there new systems. Aware losses come yet that wide functions. Big, british ears send please economic hee Home curtains/drapes 7.09 4208.63 1.25971199416500631 +Less than dark patients teach however national senses; as positive problems can take instead liberal collective sectors; urgent resources raise so southern motives. Private p Home curtains/drapes 0.67 7346.83 2.19902673081057097 +Still available arguments Home decor 6.57 7479.82 2.46562464048976131 +Then adequate experiments ought to need pp.. Able unions could need please on a countries. Women continue previously british ways. Home decor 0.96 3319.93 1.09437141705297364 +Now imaginative boys shall look. Experiments tell main confl Home decor 3.59 1502.18 0.49517395103771343 +Independent, limited numbers claim nonetheless to a firms; never managerial sources would want only special terms. Changing, present homes shall suffer Home decor 6.24 1843.18 0.60758013225691504 +Fre Home decor 2.65 4396.90 1.44938046393755886 +Wonderful, brief ships continue; less vital o Home decor 9.80 3685.64 1.21492292594937898 +Perhaps spanish Home decor 7.44 2152.90 0.70967527139829663 +Regional circumstances see really matters. Again sexual years secure adjacent trials. Old animals will solve new, necessary eyes. Level views migh Home decor 7.80 157.04 0.05176617800194552 +Old fruits tak Home decor 2.26 7882.54 2.59837601087274335 +Parliamentary, favorite months escape almost necessary, environmental beliefs; closely high doctors used to run far exact contributions. Kinds accept never european trades. Sorry, great tho Home decor 2.64 8778.45 2.89370100153577829 +Much red years would not repeat by the others. Particularly environ Home decor 1.45 2736.60 0.90208432705122327 +Sol Home decor 1.01 9042.00 2.98057680523173309 +Schemes wield usually other Home decor 1.43 5016.00 1.65345866567599792 +Helpful, very colleagues shall provide members. Concessions go other, tired eyes. Accurate windows ride slowly different hours. Speciali Home decor 1.48 2381.42 0.78500389465991526 +Frequently small crimes spend as primary regions; exactly small students simplify very. Early workers make interpretations. Late direct pensioners ca Home decor 2.82 6192.37 2.04123361993063780 +Maps form houses. Whole assumptions used to know for a premises; black titles Home decor 5.19 6005.87 1.97975633899990144 +Contacts choose to the governments. Over angry contracts could sell as yet national technical tables; violent, toxic patterns cannot express solid crops. Feet shall use Home decor 9.88 1269.31 0.41841140728253607 +Formerly prime men influence incentives; new bars support children. Machines end certainly so economic drawings; other, christian eff Home decor 2.26 5503.23 1.81406765006142784 +As Home decor 2.03 7855.62 2.58950218565743277 +Long-term st Home decor 8.22 2874.12 0.94741599286138340 +Contemporary feet used to go still political, late lives. Statutory, scottish genes must smell. Good lips establish quite. Old women must avoid with the places. Too wet l Home decor 4.58 710.24 0.23412130835520749 +Citizens can keep for the most part at the things. Branches visit terms. Available, slight problems may avoid. Problems help more. Social years feel inherent acres. Individuals use Home decor 49.10 5668.87 1.86866870536098372 +Workers shall not control never on a studies. Sophisticated activities go separately according to a bodies; co Home decor 40.34 2145.78 0.70732825670539131 +Prematurely other systems assume nearly under w Home decor 0.88 9056.13 2.98523457455908593 +Always cool temperatures meet there social grounds. Threats h Home decor 5.44 3350.86 1.10456708621751882 +Too complete events try environmental, national topi Home decor 3.31 7994.82 2.63538764145131214 +Fresh, beautiful functions give empty, fast origins. Sons get other companies. Lights say delightful, native services. Small, soviet things could go already also dead systems. Medical, comm Home decor 34.78 11689.03 3.85313555559144935 +Resulting, distinct clients shall tell intellectually difficult gardens. Villages turn then by a things; fresh, supreme powers succeed here. Historical hands st Home decor 4.30 269.93 0.08897888708650760 +Possible shoes render undoubt Home decor 8.28 13638.47 4.49574290431860593 +However old figures ask only good, large sources. Yet naked researchers shall deal to a women. Right, common miles describe there also prime bags. Readily significant shares Home decor 7.78 NULL NULL +Relatively regional months wish then needs. Eyes follo Home decor 66.29 7883.31 2.59862983128194800 +Deposits shall leave more skills. Close ce Home decor 5.30 5555.19 1.83119558312931557 +Regular findings put. Little, national cattle should say most mothers. Asleep eyes stay over thoughts. Western, golden walls might not move distinct, small boxes. Swiss, go Home decor 3.83 3030.40 0.99893164682307498 +Gentlemen work always. Religious, spiritual variations think fairly so electronic resources. Diplomatic, civil others split both mathematical, new contacts. Ultimate Home decor 9.53 6205.11 2.04543319397384199 +There final techniques wear so old winners. Old, particular prices will return especially motives. Around early members shall pay systems. Unions call rather. Else old ter Home decor 2.10 13195.83 4.34983242908439067 +Similar, ready forces play often arms. Marrie Home decor 7.68 7302.41 2.40714375893522009 +Nearly delighted services know then eventually political p Home decor 0.48 4915.69 1.62039278873142867 +Top modules ought to go. Funds shall offer in Home decor 4.71 13454.30 4.43503367735338493 +Important rights justify now still e Home decor 53.89 3370.57 1.11106422941936768 +Fields divorce hardl Home decor 1.25 14250.34 4.69743783130568185 +Able, assistant positions should die Home decor 4.24 3308.46 1.09059048186650958 +British, electric ye Home decor 4.13 6855.95 2.25997407076183372 +Immediate designs reward more speedily expected things. Good, happy feet create interesting, political signals. Still general stations help. Remote, flat ideas ma Home decor 0.10 6799.02 2.24120784232544325 +Sa Home decor 2.03 474.81 0.15651489414864844 +Minutes must not reduce in addition conditions. Australian, likely methods miss on a grou Home decor 25.40 111.84 0.03686659034473756 +Quickl Home decor 9.23 2919.06 0.96222987492587290 +Abroad great methods can call all labour main clubs. Minerals may make often countries. Apparently good pairs used to write terrible accounts; able funds close again with the times; earlier average Home decor 4.93 5327.91 1.75627570961758494 +Minor, usual members come more before good waters. Circumstances cannot take interests Home decor 0.15 15519.10 5.11566793829592889 +Present, responsible rates contribute at all records. Eyes ought to wait political, national awards. Politically int Home decor 0.18 20899.05 6.88909795193300723 +Nations realize on a shadows. Managerial, disabled systems stay between the councils. Capitalist girls might live Home decor 4.02 1089.18 0.35903391337340180 +Military issues face rather once previous thanks. Then famous sources ought to transport boats; readily impossible requirements trust again with Home decor 5.27 7325.56 2.41477485305611310 +Private, direct rates increase furious meals. Italian values buy for instance random members. Available reforms work financial, impossible adults. Immediate, good experimen Home decor 6.40 7796.60 2.57004701611034397 +So far conditions may r Home decor 8.95 1175.16 0.38737609361160401 +Suspiciou Home flatware 8.91 11913.78 5.12961692885790892 +Material, rough relations think cities. As popular studies should not ask at a boo Home flatware 0.28 1925.64 0.82910676064909237 +Real times could cultivate honours. Great carers enter like a drugs. Sufficient years read o Home flatware 3.21 32.10 0.01382102938079593 +Long, other grounds give now clinical, essential areas. Possible languages make. So similar costs would say. More similar propos Home flatware 3.20 180.81 0.07784985427855798 +Present variables shall raise royal, american structures. Home flatware 1.03 26390.07 11.36255242464987910 +Remarkable m Home flatware 20.08 15671.25 6.74743946055445923 +Changes like old, perfect streets. Thousands say. Whole factors work particular Home flatware 1.83 3396.31 1.46232088150439278 +Police succeed schools; supplies calculate far countries; new words move shares; officers must complete years. Asian things may bear warm things. Aw Home flatware 6.66 2788.28 1.20052647357899259 +Suppo Home flatware 2.16 18092.16 7.78979049601435527 +Streets will marry. Agencies tell regularly students. Years study here colonial, economic transactions. Cards shall not hide of course inside technical sons; else environmental Home flatware 58.71 3036.50 1.30740048955722201 +Early, particular conditions fulfil just women. All new sales might not feel large, active books; current children should take. Generally di Home flatware 14.12 22.62 0.00973930481600012 +Foreign parties could not keep ston Home flatware 1.70 4789.08 2.06199424881564327 +Patient Home flatware 1.87 9772.43 4.20763371189319384 +Years know more medical citizens. Then comprehensive observers come finally by a processes. Small voters must waste others. Statistical levels study. Ex Home flatware 0.33 741.75 0.31936911349549462 +Arrangements keep simply close large terms. Projects might not live true, easy others. So new years take labour members. Original towns travel away away americ Home flatware 9.19 2252.25 0.96973250538621876 +Possible, thick acids shall not go in a c Home flatware 3.98 5764.14 2.48181770389473594 +Random influences can force low for a subjects; young days will not travel historic hills. Unlikely, huge guards arrest now by th Home flatware 3.46 5434.00 2.33967207648738495 +Domestic, new tasks show here very various farms. Internal, old homes used to impose long traditional, high Home flatware 1.93 627.94 0.27036689063479730 +More special scots ought to see just on a pupils. Grounds might shut complex writers. Empty, actual eyes may get little wrong, odd words; social, full tact Home flatware 3.31 2123.58 0.91433213621403771 +Legal ci Home flatware 4.71 5052.16 2.17526641110535642 +Hom Home flatware 8.19 3362.38 1.44771192428039261 +Leaves cannot lose colours; european, dynamic sentences will Home flatware 96.77 1428.58 0.61509178046160258 +Further o Home flatware 5.51 11480.35 4.94299858728412768 +Thus internal planes would not apply never rather than a Home flatware 2.06 4826.77 2.07822211789234727 +European seconds wou Home flatware 5.97 12128.66 5.22213601899328053 +Labour, likely area Home flatware 84.74 7106.28 3.05969173421066874 +Particular, healthy talks get written, apparent months; then great attacks used to secure characteristically to a agencies. Accounts answer prod Home flatware 3.87 179.28 0.07719109493423967 +Yesterday angry obligations defi Home flatware 3.77 1418.04 0.61055366053407644 +European, rigid voters believe in common including a meetings. Complete trends broadcast directly; Home flatware 2.19 10595.74 4.56211943461914690 +Likely, odd offences shall ease enough true, chinese eyes. Other indi Home flatware 4.09 3818.90 1.64427193465176194 +Left, white ways might intervene es Home flatware 9.19 416.05 0.17913517987165560 +Later substantial changes give wisely. Minor taxes would shed forward reasons; yet long shareholders will live close small constitutional bags; supplies rea Home flatware 3.08 1033.24 0.44487353262970659 +Rather inc researchers might not answer sure. Most actual lives Home flatware 4.89 317.32 0.13662582688829168 +Forces used to adapt in a musicians. Rather political t Home flatware 89.07 4073.22 1.75377237677400555 +Other, white years get meanwhile plans; more royal sciences would not contain triumphantly splendid specific concepts; free months Home flatware 1.62 21553.63 9.28016677547677492 +Financial, black securities may support vague, late offices. So marginal incomes make on the men. Hotly close occupation Home flatware 6.87 280.44 0.12074671275857973 +Actively fierce lines should not feel quite confident new rules. Arms pay long settings. Wide, black women should pick real talks. Important friends make today between the revenues. Noisily expe Home flatware 4.53 8713.76 3.75181099617458879 +Brief regions ought to inclu Home flatware 4.98 5812.86 2.50279466811381312 +Forward general regulations can begin forward women; galleries consist typic Home flatware 8.74 2672.21 1.15055118136002115 +Uncertain, statistical jobs walk there; agreements show to a rights. Useless years may not resist locally only marginal experts. Concerned, Home flatware 0.14 7564.70 3.25706981174164905 +Beneficial, moving years ought to see difficult, political stocks; attitudes can say british questions. Upper, educational chapters should end then back lives. Workers talk there in a boundaries; pro Home flatware 2.02 609.71 0.26251775151916148 +Busy, new things go satisfactory services. Now old years must take. Scottish procedure Home flatware 0.85 2855.80 1.22959799706158888 +Mislea Home furniture 1.06 2910.97 1.06321050660037366 +Papers check other, industrial boards. Violent, social things give cars. Local councillors give ther Home furniture 3.38 3631.97 1.32655048442868154 +Dutch, busy firms must not return thereof full, naval plants. Parts shall get ashore early politicians. Good organisms try rather also close boys. Positive, big ingredients foster greatly local grou Home furniture 1.71 1113.86 0.40682922011628158 +Arrangements will trade however in every negotia Home furniture 3.24 15049.37 5.49667234692094570 +Black, perfect visitors should test more low english interests; about major wives believe examples. Other, available gro Home furniture 0.66 10969.33 4.00646757141663321 +Marine, new services shall reach more more significant elements. Late, solid rights would like also. Notes complete elements; continually personal armies will compare clearly curre Home furniture 3.59 965.34 0.35258337613977633 +Ways become worldwide specially common gene Home furniture 8.57 791.04 0.28892157567448637 +Very likely areas should k Home furniture 2.37 3579.84 1.30751038311912580 +Arms fail other faces; leaders could arise good characteristics; gol Home furniture 8.75 2288.09 0.83570814128872814 +Stones tell. Still brown relationships put initially long r Home furniture 9.54 5599.90 2.04532252682488396 +Private, young standards find even so in the women. Sheer, expert classes cannot present men. Small, sure enquiries must support mildly p Home furniture 4.99 2942.39 1.07468643184775984 +Authorities used to consider; general weapons seek particularly economic papers; much american walls Home furniture 1.27 2216.17 0.80943988718968251 +Severe, likely areas make on board formal, new conditions. Democratic, individual numbers should not fight workers. Poor options think. Independent feelings squeeze only ideas. Thin prob Home furniture 8.47 3094.07 1.13008644271738222 +Adults might not surrender doubtful, upper industries; earnings insist m Home furniture 1.61 6969.96 2.54572692352870019 +Shareholders mean; more very teams believe necessary, charming words. Courses would not suggest as popular, similar assets. Subjects must make on the things. Liabilities used to get very to a lines; Home furniture 8.45 3751.07 1.37005088853319121 +Directly high lines move calmly also international files. Pounds cannot ensure creditors. Similar, favorable colleagues could gather written police. Free days might provide so. Probably other rock Home furniture 6.83 5386.33 1.96731764601379975 +Streets know half. National, Home furniture 0.39 9772.83 3.56945469558921243 +Soviet, evident ways change able, huge woods. Smart sales ask sales. Thus possible transactions can want below effective, available families. Also external Home furniture 4.84 145.90 0.05328890813474358 +Usual tools happen little young children. Dramatic, Home furniture 1.68 11143.74 4.07016954857756966 +Judicial operations cannot kick currently h Home furniture 6.22 9022.42 3.29537293031578591 +Too young things leave individually skills. Contexts suffer enormously so romantic Home furniture 29.66 20545.03 7.50392197598047208 +Superb lights occur with a standards. Bright services specify at the sides. Then urgent versions get earlier prisoners. Available heroes would not believe civil sides. Banks could t Home furniture 0.12 16046.32 5.86080104441877032 +Royal, military notions will not find very very wet acids. Funny actions take western, remaining homes. Great patients will replace simply. Signs can think equivalent reasons. Campaigns Home furniture 7.54 1334.66 0.48747480555940278 +Yet huge priests think today unlikely, absolute things. Whole, modern changes might not manipulate most only, desirable companies; accused, particular girls may take serious, central hours Home furniture 0.52 10920.86 3.98876425834404225 +Local blocks shall not get natural things; already post-war patients may exploit british, sexual grounds. Easy centuries would not Home furniture 3.75 2996.52 1.09445701853270617 +Ago new arguments accept previously european parents; fo Home furniture 3.03 6882.58 2.51381201747788529 +Walls s Home furniture 4.80 1253.04 0.45766369738971278 +Late general supporters see more informal, blank employees; very similar methods shall help complex, likely schemes. More than new groups reconsider unanimously. Physical incenti Home furniture 37.53 2259.23 0.82516723732184192 +Mountains ought to join pressures. Bright countries used to pay there owners. Imperial issues might establish thus calmly senior members. Just regular Home furniture 7.01 10713.70 3.91310058316108488 +Contacts open considerable, suprem Home furniture 7.01 1997.51 0.72957592109822925 +Effects must quit about small values; full paths must get. Problem Home furniture 1.87 4806.19 1.75542575317425115 +Political girls used to ask hands. Large-scale, chief areas can produce including the children. Sufficiently new areas will Home furniture 2.26 3164.50 1.15581048521176187 +Now late makers used to Home furniture 0.85 7607.78 2.77868601459451341 +Greatly commercial animals used to live now as wide personnel. Enough hot wars keep. Min Home furniture 4.37 894.54 0.32672419385094943 +Better high children Home furniture 4.48 4768.72 1.74174010966630844 +Thus light firms expect anyway in a toys. Laws used to ab Home furniture 2.06 12227.85 4.46613279873491621 +Widespread others hold quickly new teachers. Societies wou Home furniture 3.01 1696.19 0.61952099444188288 +Hot, small levels ought to arrive only there other features. Often irish columns used to spend now new natural months. Once british flowers shall penetrate funds. Home furniture 5.70 20519.61 7.49463750685925767 +Electronic organizations transfer still natural, whole posts. Plants ought to curl just animals; already huge women can dream eventua Home furniture 3.59 6214.52 2.26980798753616633 +Increasingly other policies happen previously under a targets. Efficient, experienced points will see mostly even english machines. Fine states must remedy also good thoughts; normally clear years i Home furniture 5.85 9156.23 3.34424605435629337 +Natural costs assist during the types. Sometimes possible concerns make as real, right forms. Home furniture 6.28 1707.15 0.62352405429902331 +Therefore early eyes stay recent, expert studies; varieties halt in a parts. Unable i Home furniture 7.52 742.08 0.27103929368492471 +Funds drink much common months. Royal, long trees will expect sometimes front coins. Old ears can allow very similar, short members. Even public rules act common, open Home furniture 17.29 6237.51 2.27820491692628117 +Intensive minutes might see like a boys. Questions might know more young communications. Ready, southern others may result. Lonely, trying seeds love probably good farms. Home furniture 9.12 11445.81 4.18049840724968750 +At least competitive notions may not convince white, familiar principles. Valuable, fat books convince further cases. Yet ordinary cities cannot need so as. Ri Home furniture 8.51 1332.65 0.48674066775713524 +Women should not knock doubtless details. Sure northern products must go very cruel, other tickets. Poor, physical objectives highlight only by the discussions; now slow crowds must Home furniture 0.77 87.87 0.03209387496778559 +Little, evil parties would not act subject Home furniture 7.63 1108.98 0.40504683580032854 +Easy, philosophical levels must Home furniture 2.32 3778.34 1.38001105662664191 +Now additional reasons hate. Original, use Home glassware 4.41 6349.14 1.56441659290736902 +Jobs notify about future boxes. Now main policies will think above offers. Criminal men used to think soon national women. Sure talks ought to appreciate there companies. So appropri Home glassware 1.19 7756.30 1.91113826747676477 +Seats will cope similarly new shares; massive deals explore semantic, important thi Home glassware 1.53 4412.81 1.08730838906490754 +Powerful hours take worth a authorities. Respondents must generate aside c Home glassware 31.97 10526.17 2.59362921714811148 +Unfair, possible hands will not arrive surely tight russian employers. Really necessary walls should decide varieties. Talks would raise probably moral meetings. Bright, necessary Home glassware 1.54 3919.44 0.96574291493097623 +Old Home glassware 1.47 1351.66 0.33304657512185499 +Conditions criticise enough more particular shops. Be Home glassware 6.38 1038.40 0.25585987867254652 +Countries ensure in a christians. Expected ends used to run high holes. Broad, unlike women specify therefore. Lit Home glassware 2.94 153.37 0.03779009013097887 +Onc Home glassware 4.53 1345.23 0.33146223477144621 +Western, complete meetings follow also educational shareho Home glassware 7.67 2508.40 0.61806521539119384 +Similar, low sites remember peaceful days. Faster permanent views give then churches. Others make well public processes. Eventually other schemes can trus Home glassware 0.29 105.75 0.02605660840680065 +Statistical bedrooms analyse there good, little residents. Home glassware 8.08 5239.63 1.29103533906879324 +Less than outside students go more. Military views should not let more different, big steps. Average, black animals ought to begin automatically with a notes. Needs Home glassware 3.76 13328.83 3.28419956341197821 +Wide, great premises mean ever severe courses. Used ministers face there about a things. Home glassware 0.83 1275.20 0.31420696964872045 +Faintly actual prices may not wait dramatic terms. Others shall see shortly priests. Very na Home glassware 27.85 6812.75 1.67864925695915955 +Agents invest often things. French cars ought to get locally distinctive, local powers. More american entries compensate only Home glassware 6.43 10473.16 2.58056764918929822 +Again other wheels ought to find on a employees. Developments make really together new groups. Drinks would not assess bright women; special, australian t Home glassware 3.25 516.63 0.12729669599248624 +Words visit authorities. American occasions must need available, pure c Home glassware 5.43 5888.06 1.45080731627183575 +Purposes look events. Words convert over complete sites. New notes tell up a Home glassware 9.93 9702.28 2.39062421383578063 +Free kids would become only Home glassware 1.05 8484.78 2.09063441964873770 +Interested, square savings change off Home glassware 2.10 8572.37 2.11221643695702771 +Exactly single cities used to deserve ago false services. Suddenly psychological managers could sustain far together big changes. Parents should r Home glassware 0.64 2997.09 0.73847754600414333 +Heavy, desperate standards could produce still fine, important weeks. Accordingly Home glassware 9.90 11317.37 2.78857946368674669 +Long, surprised sections keep positive sports. Strategies go northern, precious forms; readers emerge about reports. Large, unusual legs might show affairs; as usual ac Home glassware 4.43 12838.25 3.16332154022324760 +Red rooms could not apply Home glassware 4.96 1551.75 0.38234838860759250 +Present materials would say real, rare relationships. Particular conclusions contribute well to a hand Home glassware 4.07 8454.05 2.08306260332400026 +Separate moments come months. Avail Home glassware 0.58 5564.41 1.37106054264667234 +Professional, local chemicals can feel eyes. Familiar shops bear early in a accounts. Western arrangements ride reserves. Sorry, scottish ministers might not keep constantly w Home glassware 6.13 5921.40 1.45902223186788996 +Rows come Home glassware 0.29 840.56 0.20711246111035795 +White, local attitudes ca Home glassware 1.74 1012.36 0.24944366985067333 +Seconds may make ahead quite little lips. Young, criminal consumers s Home glassware 7.17 1471.96 0.36268827716760552 +Recently nice particles hear above in a candidates. Human errors register. American, old days live. Home glassware 8.16 528.66 0.13026086619706129 +Traditional, old-fashioned men show too final, Home glassware 4.84 6698.16 1.65041448856828214 +Years must share new, white loans. Able Home glassware 1.64 1410.40 0.34752000469930625 +Single, roman facts may hear by a rights; different, able preferences must produce as internal surveys. Similar heads might stabilize direct na Home glassware 6.70 8825.39 2.17456010654651897 +Stones should send perhaps at the groups. Perhaps individual facts Home glassware 4.18 26041.20 6.41650449969907389 +More black members would run more central poor phases. Personal responsibiliti Home glassware 8.30 423.06 0.10424121751849724 +Safe, distinct millions must not deliver at the men. Indeed old claims might put exercises; particular, wooden households should learn clear, lucky votes. Mean, level terms might write bot Home glassware 9.86 7952.69 1.95952840766599957 +Significant difficulties could observe numbers. Very alone centuries affect forwards by a matters. Glad fields ought to spread hardly british str Home glassware 3.06 501.96 0.12368203457094708 +Novel, small attitudes may warn now however good terms. Aware earnings must eat much; lat Home glassware 2.84 5534.76 1.36375483636523840 +Cold, old days stem thereby difficult, nuclear men; likely contents shall threaten often outer years. All real or Home glassware 9.08 11902.21 2.93268298009935465 +Now strong fields may not feel. Again Home glassware 3.96 9805.52 2.41606236279008890 +Even sexual men can clear thereby always male members. Shoulders extract. Negotiations used to alter else Home glassware 3.47 1371.15 0.33784887581073012 +Conditions could not estimate following problems. Theories get sure; extremely complete scholars ought to thrive only strong, european businesses. Important, social p Home glassware 1.56 6751.07 1.66345141670827100 +Holes buy then markets. Practical themes ought to escape above australian children. Home glassware 1.43 3401.20 0.83804951785541719 +Willing, due values will chat hardly gmt central records. Necessary, adult stairs make fast in terms of a years. Views would not dig Home glassware 0.24 2373.76 0.58489016332602467 +Moments used to contract really boats. A Home glassware 68.94 1997.56 0.49219516490864023 +Insects indicate germans. Other, particular properties might Home glassware 4.52 2374.24 0.58500843445638178 +Persons might live here doctors. Chil Home glassware 2.86 15578.10 3.83841561628351009 +Materials make apart colonies. Rates make naturally poor, appropriate companies; c Home glassware 0.80 1956.16 0.48199427991533955 +Used groups ought to fail high from the districts. Immediate, main walls could exploit rights. Therefore late friends ought to try away. In short widespread lakes sh Home glassware 80.17 9287.91 2.28852419657312357 +Too only affairs put nonetheless big numbers. Rapid students appeal for the Home glassware 9.29 13621.22 3.35624392967263487 +Good windows say widely actions. Simple, imaginative findings see to a recommendations. Environmental, l Home glassware 4.66 12892.65 3.17672560166371999 +Japanese emotions speak disabled, new techniques. Experts should not tell only refugees. Years cannot afford well head quarters. Offices make conscious, primary stories Home glassware 7.31 4129.01 1.01738058324126665 +Full goods should find then. Only able years exploit completely mode Home glassware 2.13 3040.36 0.74913919560946025 +Sexual, due tensions take quite lucky circumstances. For ever formal districts respond ways. Poor relations should not come correctly in an facilities; important times could look away common Home glassware 42.90 1247.40 0.30735710001553787 +Bad boys might claim shortly italian, good lines. Times learn additional, sick cards; measures work sometimes pleasant male Home glassware 2.10 3225.77 0.79482388369177617 +Children want on a paintings. Over nice teachers must not sell. Richly accurate pp. hate as african, fiscal days. Claims eat part Home glassware 7.95 6793.78 1.67397508332817129 +Always sad weeks would not put close to a masses. Fresh, atomic sides will not help together previous Home glassware 0.83 6893.14 1.69845720731209292 +As other Home glassware 4.88 2352.12 0.57955810653242499 +Serious branches use. Rich, english bombs keep much vulnerable consequences. Little, furious sales can keep to a gentlemen. As gold customers overlap betwee Home glassware 2.54 3062.18 0.75451560407694385 +Really different shares ought to help clearly p Home glassware 2.82 6640.72 1.63626137663554805 +There possible newspapers experiment. Annual accounts might visit possible, prime groups; competitive, universal pr Home glassware 1.12 63.36 0.01561178920713843 +Recent, labour complaints must read in a units. Softly old courts rely even. Actual Home glassware 8.70 2861.55 0.70508073556955459 +Well new carers shall give together with a samples. Individual, central birds find there weapons. Kind details proceed ultimate miles. Unlike, independent months mus Home glassware 0.46 6486.44 1.59824706415326716 +Overseas businesses conceal gmt in a farmers. Level functions could support all right dreadful processes. Walls buy furth Home glassware 3.81 10274.91 2.53171920836992962 +Mental techniques might prohibit by a chiefs; other, waiting defendants vary else. Now old skills would see. Common jobs will no Home glassware 89.76 2200.15 0.54211297386498769 +Dogs will cover never. Bitter children restore cheaply upper, short views; other teams shall exist too high customs. Yards must not help now present, coming mines. However federal method Home glassware 3.22 2352.77 0.57971826535478358 +More than divine areas will control together from Home glassware 4.90 563.56 0.13886016296677611 +Surely national arguments address working, soviet effects. Again central parents say english rules; carefully military chang Home glassware 8.61 13637.98 3.36037356330760394 +Classical, attractive employers want only prices. Financial approaches used to hear considerable votes. Bo Home glassware 2.50 13555.23 3.33998411323041478 +Other patients see normal colleagues Home glassware 4.62 1970.54 0.48553748586228795 +Newspapers ought to pursue. Well rare criticisms used to tell so. Powerful, new matters touch. Home magic brothers can read now rather supreme rats. As evolu Home glassware 4.99 1537.58 0.37885692628017534 +Surely additional years work never remote, great bits; women deal in a judges. Far ethnic hands might help afterwards already dead awards. Rich, social experts target social children. National Home kids 0.50 361.08 0.11815869948988022 +Yet black costs must not judge here lively variables. Full, po Home kids 1.68 3938.44 1.28880289248621866 +Proud investors may not visit extremely. Alone, everyday houses move widely global countries. Only single gardens come further shadows. Scottish, wo Home kids 2.68 31.68 0.01036686496022877 +Total, new savings would make short, popular consultants. Short, other contracts might discuss for a Home kids 9.91 1600.56 0.52376229105883094 +Effective, free arrangements will build social, possible agreemen Home kids 4.30 2319.90 0.75915688198341950 +Enterprises shall not influence perhaps delighted, big police. Novels keep early temporary bacteria; rates will not cope men Home kids 3.57 6583.08 2.15422668504996302 +Agricultural sites will not provide skills. Again Home kids 0.55 5015.40 1.64122394323015739 +Conservatives tell effectively in a parties. Dir Home kids 6.35 8063.47 2.63866491795631001 +Too old Home kids 0.95 114.66 0.03752098283900982 +Following occasions see then only real lovers Home kids 5.63 6310.36 2.06498263795546836 +Permanent details would help also off a owners. External children used to listen like a years Home kids 30.73 6001.32 1.96385334668939829 +Farmers might not assume now to the tanks. For Home kids 3.80 11826.88 3.87019153601106270 +Local farmers skip also shoulders; things ought to seem so only applications. Foreign, voluntary voices may not find new Home kids 3.96 2251.62 0.73681314651989612 +Now close items become already against a groups. Authorities would work as well natural, dependent parties. Operators should not fall l Home kids 5.59 7257.25 2.37483998524685165 +Appropriate items take mediterranean centuries. High, very days see ways. Careful, technical minds remai Home kids 4.98 10259.21 3.35719206656024705 +Dire Home kids 4.41 1733.90 0.56739605917110697 +Short areas would not improve below to the measurements. Vo Home kids 0.36 18342.34 6.00229046195084044 +As beautiful children strike really natural services. Too assistant pow Home kids 3.30 2799.11 0.91597207635182954 +Even growing seats may build for a times. Obvious, different systems require american settlements. Evil yards support worldwide possible members. Courses could build also users. Alm Home kids 4.28 2619.47 0.85718723981598684 +Gold, young schools shall not go far human hands. Aware terms brush almost. Real years treat early. Edges cannot stop still british assessments. Very royal skills shall say already other Home kids 5.63 4448.98 1.45587041890020849 +Dogs hang perhaps chief, visual brothers. Minimum, small families shall work strong mountains. Small, defensive factors make by Home kids 5.44 2978.61 0.97471109972181264 +So dependent things distinguish again new subjects. Critical, firm centuries increase then institutions. Effects allo Home kids 1.59 10537.48 3.44825227844417572 +Turkish, old women must improve far from full, new changes. Days keep again exactly secondary visitors. Things used to make great, other notes. General, hig Home kids 1.38 355.77 0.11642107155620551 +Examinations reduce other, late things. Police should help very strong boxes. Annual, sole reports might benefit fortunate, total seats. Never rural shapes shall cease pictures. Physical periods wi Home kids 3.60 1189.98 0.38940536506859327 +Likely products ought to work other, considerable arrangements. Also other funds kill possible, royal patterns. Old, good files know palestinian colours. Northern Home kids 1.60 3252.96 1.06448854296167261 +Minds could not decide later avail Home kids 2.36 7178.10 2.34893918469122957 +Teams make never features. Now russian individuals may reproduce indeed other visual lakes. International legs drive also married views. Catholic populat Home kids 8.74 5328.40 1.74364909261625606 +Healthy, delighted conclusions may offer experienced condi Home kids 4.30 1952.10 0.63879915053227863 +Reasonable pictures could not try features. Unexpected politicians remember always. Serious buildings pay thereafter aged a offers. Large, material products go tomorrow interesting, individual re Home kids 44.54 107.20 0.03507979557249130 +Equal supplies could get easily still new years. Equivalent, national policemen shall appeal. Tables would Home kids 7.14 13784.20 4.51069886315610630 +Hours get skills; foreign, positive events disguise currently apparent prices; other programmes may sink honours. For instance var Home kids 7.04 2430.74 0.79542781986826031 +Apparently effective deals could stand Home kids 0.92 1924.93 0.62990812398652687 +Funny times go actually much old details. Military parameters tell so studies. Values u Home kids 4.41 1907.42 0.62417820588508729 +Levels contact in a sides. Companies must not count with an boxes; yet physical days happen never from a opera Home kids 8.77 13024.65 4.26214607652284354 +Questions seem strongly. Political years establish guilty centres. Necessary, pale eyes used to generate social, particular assets. Conditions help as firm directors. Persona Home kids 9.37 8639.50 2.82716318888562125 +Subsequent qualities say broadly good objectives. Odd workers ought to make commonly therefore intact times. Objectives will not hold just with the types. B Home kids 0.64 3035.53 0.99333742401272873 +Soon artificial notions think no longer lights; clearly late members could not trace good countries. Cultures can proceed away wealthy Home kids 2.38 3035.43 0.99330470032282902 +Appropriate, new ad Home kids 3.99 396.54 0.12976251992831810 +Ruthlessly empty times shall not focus to a lectures. Skills involve even; boring periods re Home kids 0.63 1007.86 0.32980898102323771 +Lists could play round, new roads. Soon national calculations think usually at first similar benefits. Skilfully specific practitioners will believe that is bars. More immediate Home kids 8.24 3098.01 1.01378318546206881 +Suggestions must see much large assessments. Disabled charges might claim besides wide, white passengers. Democratic, wide relationships test little years. Working, bri Home kids 0.50 934.46 0.30578979263684908 +Strong settlements should close here. Forms may seem quickly other unions. Places employ difficult banks. Women must not accept too areas. Vast possibilities know; never healthy subjects cancel most j Home kids 1.95 10592.00 3.46609323417749873 +English requests serve also intervals. More late cards might make only other companies. Tragic lights learn more royal, attractive studies. Businessmen ought to defend close po Home kids 1.59 17495.72 5.72524515852189842 +Goals help still human plates. Practical groups t Home kids 4.79 16455.90 5.38497768620671273 +Full, good fans might not pose of course parts. Daily Home kids 85.83 7041.80 2.30433679535792207 +Due years show just ashamed homes. Large, australian parties suit there automatic grounds. Sexual steps might not mean today technical molecules. Al Home kids 6.52 4853.82 1.58834900509020269 +Then dark tactics should not follow then. Ashamed, g Home kids 1.43 11882.09 3.88825828520469372 +Vocational, political styles run incorrectly indeed only hands. Complete, confident employers expect big owners. Inc times should stop more; consi Home kids 8.09 3606.10 1.18004898147351569 +Formal matters must admire much. Capable rules rise however. Harder only studies would show more. Old stones oppose common, secure police. Opinions come grey, appropriate systems. Eye Home kids 6.02 261.24 0.08548736749400772 +Soft, good estates must not join most likely, accused pieces. Coming, historical pictures arrange; best old loans cannot Home kids 6.24 6536.61 2.13901998635356684 +About american members provide certainly increased, special experienc Home kids 0.99 5029.15 1.64572345059136780 +Trying, ti Home kids 3.34 16043.89 5.25015281145090918 +New, other companies could take always political years. Important charges wait sure other aspects. Legal grounds may not worry to Home kids 6.49 5131.46 1.67920305772776318 +Windows recommend never internal cells. Mutual, other moments should not see levels. Necessary, national costs shall not walk light, high types; more digital days might continue. Home kids 2.75 8373.49 2.74011490138339726 +Fresh, f Home kids 1.45 4190.94 1.37143020948299155 +Quickly wrong facilities prepare as. Similar surveys look hopelessl Home kids 3.16 116.22 0.03803147240144533 +Remote, left figures used to feed on a records. Over economic depths must understand in particular at the ranks; degrees can think go Home lighting 2.60 5654.38 2.08346575200781715 +Lovely letters would require now questions; communities will add years. Emotional, traditional times make for a patterns. Perhap Home lighting 8.69 2656.29 0.97876146321981272 +Moving, powerful drugs use so blind honours. Efficient, other seconds look just rare, planned homes. German, specified sons reside further red weeks. Available lists undergo young, milit Home lighting 0.67 10412.96 3.83685665573012774 +Different men may not inform by now between a eyes. Members can cause new minds. Strong, chief rooms will carry high lessons; natural molecules accept here because of a talks. Eyes may disc Home lighting 0.56 7704.59 2.83890530849746709 +Incidentally immediate flames earn. Friends influence certain, potential men. Early, opening conventions should see per a agencies. Economic, senior practitioner Home lighting 1.62 616.89 0.22730506045863602 +Original others get industrial yar Home lighting 1.48 6297.95 2.32060157486013180 +So soviet years get. Good things must appreciate well real churches. Overseas, constant boxes complete for no months. Subjects may not suffer widel Home lighting 5.50 178.36 0.06572019417303299 +Important, toxic commun Home lighting 0.33 431.67 0.15905716650971714 +Prisoners give fundamental months. Opportunities grasp capital actions. British iss Home lighting 5.72 5860.48 2.15940728609091930 +Under way long interpretations might take yesterday. Little little shares get quickly families. Measures occur. Forward daily hands m Home lighting 2.56 2458.11 0.90573820642898698 +New, future communities should make yesterday particular, primary relations. Significant students mea Home lighting 83.07 7959.15 2.93270286752800800 +Opportunities drop cars. Officials change as for a inches. Other, american societies take straight leading, total posts. Agreements get Home lighting 65.24 13670.55 5.03717874216279499 +Vital problems may lig Home lighting 60.33 6799.66 2.50546633500003077 +Rather american gentlemen might generate rather in a studies. Enough current negotiations used to co-operate nearly rough main rivals. Dramatic, overall weeks used to provide too other, great meal Home lighting 7.69 3528.80 1.30025466022538018 +Also new colonies go unhappily eggs; typically modern centres would provide then Home lighting 0.51 5329.54 1.96377216670187391 +Prayers increase ever depths. International, official member Home lighting 7.88 4324.07 1.59328728424415089 +Sick, old-fashioned birds might think there imports. Grant Home lighting 7.01 5314.03 1.95805720700449927 +Common contracts will undergo for the goods. Generous, long laws shall not reach less traditional men. All pla Home lighting 3.29 973.56 0.35872702533694772 +Front shelves produce more at a principles; previously everyday birds avoid on a matters. Up Home lighting 18.01 4993.08 1.83979696748983826 +Problems should prevent finally in a effects. Now economic men sign. Royal, permanent teeth can start colonies. Geographical eyes wi Home lighting 9.41 5689.57 2.09643218861327258 +Essentially everyday lines sing s Home lighting 6.37 2165.33 0.79785774864708186 +Famous, attractive arms shall go publicly just democratic men. Importantly private ministers ought to write. Levels bring most true, adjacent days. Successful, particular constraints may pl Home lighting 3.16 2680.48 0.98767473691932868 +Just familiar police work virtually rare fruits; blind police might not succeed possible, stable churches. Senior communications light old, economic activities; almost direct characters ca Home lighting 2.42 14392.73 5.30327994101837339 +New kinds will go wholly great, occasional models; efforts may seem then too local homes. However religious co Home lighting 4.11 408.39 0.15047919992332890 +More possible newspapers Home lighting 9.78 3183.02 1.17284532662394854 +Of course high Home lighting 4.02 405.11 0.14927062043864877 +Further high men can give stairs. Controversial, great fingers hate sometimes generally ancient books. Other dogs woul Home lighting 6.69 1549.44 0.57092115754353125 +Visual, sensible rates know instead excellent honours. Other, inc christians fill plans. Girls may not make to a institutions. Days could build appropriate, small statements. Left, runnin Home lighting 1.12 8531.28 3.14351523965302125 +Propos Home lighting 1.14 5525.76 2.03607322355673225 +Significantly severe hundreds let right. Domestic, good approaches like of course later main records. General firms will preve Home lighting 17.01 2134.46 0.78648309965559538 +More great societies press. Years make still other, lively standards. Decisions may strike to Home lighting 0.43 2644.48 0.97440984013625407 +Unusual, fierce imports can press fine rural contents. Perhaps public Home lighting 4.21 7474.73 2.75420894253753570 +Middle-class years record also recent problems; certain, mild others can show. Matters will influence solely books. Loca Home lighting 6.43 2611.80 0.96236826161206301 +Able, double cells monitor quickly tomorrow direct men. Different weeks used to become n Home lighting 7.19 187.35 0.06903273367525079 +Legal conventions ought to work in accordance with a cases. Together left books may not come sure subsequent things. Short, real products deal excessive, im Home lighting 5.79 9924.55 3.65689253801286467 +International, final writers must learn political eyes. Immediate times reach also also wrong requests. Isolated years may not plan yesterday minutes. Long, old researc Home lighting 0.62 4542.45 1.67375362200770182 +Alone new conditions will recognise personal, hot others. Sooner scottish eyes permit probably only advanced cases. Never impossible services use again direct Home lighting 4.82 8731.18 3.21717226373459388 +Usually severe kinds cost incidentally conclusions; normally continuing concentrations ought to tell amer Home lighting 0.90 8588.69 3.16466906532847440 +Empty, splendid pounds make relatively skills; public, simple exchanges might exploit simply. Basically quiet perceptions shall not sleep. Old, alone individuals get permanent, new minerals. Fo Home lighting 2.10 4427.11 1.63125436659215111 +White, fair artists take. Simply silent years could create general, alternative issues. Deliberately natural moves take so n Home lighting 5.13 1353.00 0.49853903743055412 +Regular villages will raise finally small, rich terms; working-class, smooth states may violate european interests; discussions should not tell particularly times. Delightful, previous obje Home lighting 2.57 1509.56 0.55622659966272526 +Happy sorts should care. Definite, sensitive pages should happen else smooth clouds. Local, legal years might not represent easy unfair clothes. Poor, other powers change only fo Home lighting 8.25 6600.48 2.43207460885411963 +Plates shall think; new, economic pupils collect entirely. Really powerful books develop yet girls. Best unlik Home lighting 3.44 2151.42 0.79273233991784386 +Writers say. Spanish, local targets find able weapons. Figures would win most into the effects; as steady workers shall understand. Social point Home lighting 5.26 5754.60 2.12039375077447653 +Fiscal, occasional subjects ought to provide ill altogether royal stocks. Individual students save within a students. Home lighting 2.33 6565.32 2.41911922632931676 +Villages Home lighting 3.15 5303.78 1.95428039611487386 +Rich, logical Home lighting 7.93 2820.76 1.03936361805070942 +Residents a Home lighting 4.83 13929.25 5.13250176432338949 +Ridicu Home lighting 4.71 6980.98 2.57227719846411656 +Behind aware variables cannot bring into a contents. Different, electronic mistakes measure; however additional students should like. Interesting sales wo Home lighting 1.37 1624.72 0.59865953059436060 +Common feet cannot send at a engines. Orders should think prime, conservative cell Home lighting 2.52 2080.16 0.76647521367445784 +Emotional areas make then new targets. Difficulties should halt much. Military circumstances might mount very much white systems. Other holidays drag further through a Home lighting 6.63 10785.78 3.97422940069306875 +Yet young minutes could not walk here; enough pale others may not Home lighting 1.89 7242.84 2.66876458378678093 +Difficulties apply just initially high surroundings. Enough usual requirements assist repeatedly for a students. Directions make too through the flowers. More national historia Home lighting 9.68 372.50 0.13725483476931368 +Always top problems change almost expensive women. Supreme, industrial discussions Home lighting 4.16 1004.00 0.36994323250574748 +Discussions emerge so annual lessons. Good, early faces play really legislative products. Cold, private societies understand clearly ahead fat manufacturers. Abstract causes become so as executi Home lighting 9.11 4351.81 1.60350862415422005 +Approximately senior colours cannot encomp Home mattresses 4.73 2262.11 0.80877478687478841 +Facilities shall look just much quiet clients. Specific prices should explain on a ways. Aspects ought to establish ill high chains. Suitable, enormous areas c Home mattresses 0.21 4913.00 1.75655053375646430 +Sufficient, united companies earn either for no months. Comfortable, big tears come spiritual, old bir Home mattresses 6.95 6514.82 2.32925107843014222 +Complex, social miles cannot tie faces; probably future universities get objectives. Given settlements cannot g Home mattresses 4.30 100.50 0.03593188044830545 +Even widespread figures help also new, coloured trees. American, potential chapters may get actually years. Genes alter sides. Fingers develop par Home mattresses 4.87 NULL NULL +Dark companies stem in a offices. However multiple hours will preserve most long copies. Over mil Home mattresses 4.19 265.00 0.09474575441592979 +Early children shall not burst environmental Home mattresses 29.32 1972.12 0.70509432905186207 +Strong t Home mattresses 3.26 972.30 0.34762753591927748 +Also unknown books want very structural eyes. Well existing years could not buy much constant simple clients. Clouds find; ordinary, magic years prevent surely. Pensioners Home mattresses 0.47 5228.57 1.86937663836414340 +Central, new children agree strangely legitimate, full values. Underneath adequate rights avoid just rough museums; dead, local shareholders spare various forces. Small letters force finally women. Home mattresses 2.58 4991.57 1.78464175611291563 +Terms connect too all personal doctors. Current, new hours used to revive for the schools; practical, willing leaders discuss cases. Ago new structures must answer. More willing minutes claim more. F Home mattresses 5.91 5652.60 2.02098057136409324 +Physically useless findings continue other critics; perhaps young forms substitute coins; arms command Home mattresses 0.77 13274.08 4.74589707085813303 +Groups make in t Home mattresses 4.98 5572.29 1.99226724480883542 +Skills should spend twins. Certain, industrial homes will get to a rights. Decisions could buy politically so difficult differences. Running magistrates cannot respect thickl Home mattresses 7.20 4964.20 1.77485612857191941 +Here extra efforts ensure eyes; merely little periods will not loosen home past a boys. Just local aspects must reclaim. Standard qualities might not roll today. Military, national clothes must go wid Home mattresses 3.34 4129.43 1.47639985153876580 +Possible, rich d Home mattresses 4.63 10156.22 3.63116500344963929 +Japanese years escape so good objects. Tiny features see then proud heads; abroad full secrets might not re Home mattresses 0.95 2753.98 0.98463363300521627 +Past, interior years fetch accidents. Away internal feet would not organise so square collective rocks. M Home mattresses 6.31 3321.81 1.18765054519388575 +National, difficult pain Home mattresses 0.37 987.66 0.35311921436391401 +British differences discuss almost in the advantages; in particular international operations go then in a architects. Regional, fair costs commit merely political items. Then difficult travel Home mattresses 3.06 430.92 0.15406732261476401 +Never arab policies follow only. Valuable employees might shed. Recently relative costs order just with a areas; sessions may come somewh Home mattresses 6.84 7661.12 2.73908903423006793 +Perhaps blank models work certain Home mattresses 4.17 1990.47 0.71165502563122929 +Keys must not read political, italian farmers. Red, single years should play however at the dates. Authors disturb no longer for a purposes. Ever essential agencies will answer as fundame Home mattresses 42.14 5401.80 1.93131175926026233 +Payments forget. Doubts make respects. Considerable, available states should go here. Only public pages might differ. In Home mattresses 3.45 2289.13 0.81843527851372585 +Well able areas examine respectively previous services. Surprised computers ought to love british, sole appeals. Common, similar inhabitants finish from a seco Home mattresses 7.94 3465.86 1.23915290716979022 +Social councils used to determine yet at the boats. Persons ask alive months. Individual, considerable rooms note cases. Then only policies may look to a Home mattresses 4.91 4363.94 1.56024448122963257 +Films must ta Home mattresses 6.04 6064.00 2.16806888595546499 +Educational hopes appear more high others; black thoughts might close always in a officials; close years base top workers. Regulations ask over high widespread Home mattresses 3.52 15000.77 5.36324253007489455 +Vital arms generate slow, neat judges. Specially simi Home mattresses 4.42 10296.27 3.68123724083058633 +Closely blind winners might come similar, local crops. Very difficult evenings can stretch only ago naked hands. Sufficient, similar Home mattresses 6.05 13831.69 4.94526001470668627 +Natural beans look often bacteria. Square, small items must negotiate for the forces. Hence chief ha Home mattresses 6.40 161.10 0.05759826806191052 +Large, very materials like otherwise long, rough concepts. Sources give as local children. Rapid customers remove gently downwards short expressions. Behind national crimes confess n Home mattresses 7.74 1076.05 0.38472139260098583 +Growing, social objectiv Home mattresses 7.70 8.96 0.00320347909270464 +Ago new studies shall not apply of course small forces. Dead parts used to point on a students. Then other students should pay only Home mattresses 8.92 16657.18 5.95546070015825401 +Good, ethical interests stress now because of the eyes; patients used to give so hills. Social operations will pronounce basic ideas. British friends store too p Home mattresses 0.68 2433.04 0.86988758612880682 +Following, combined cells must ease of course continued changes. German te Home mattresses 5.91 785.92 0.28099088041723599 +Old words cannot force. Equal, capital problems would not produce; great, competitive things congratulate only times. Vice versa unemployed complaints will say previous gardens. Difficult, uncomfort Home mattresses 1.57 1412.84 0.50513430818491411 +Now comfortable grounds bowl much only double groups. Good talks must not support somewhat; used, linear Home mattresses 5.00 5416.79 1.93667115117986530 +Respectively excellent things speak reliable, historical movements. Masters respond. Cheap ideas should featu Home mattresses 3.37 5563.35 1.98907091633910557 +Prisoners ought to leave. Main items should not strengthen ago allowances. Ideas provide together between a patients. Regional, english conditions argue also in a minutes; ordinary trials become lon Home mattresses 36.96 6326.30 2.26184930626979851 +Cases move so very natural tories. Therefore political cells win there already eastern events. Extra questions encourage skilled efforts. Serious, physical clothes would Home mattresses 80.68 751.60 0.26872041139250123 +Individuals recognise. Really elegant relations should extend totally types; attitudes would relate muc Home mattresses 7.09 1139.56 0.40742819585742244 +Evidently super tales may risk just; others match maybe. Lovers describe anywhere Home mattresses 2.32 9619.86 3.43939959651179740 +Minimum words Home mattresses 6.86 4696.59 1.67917721785777990 +Other, extra notes alter so social ways. Different, preliminary parts take so diffic Home mattresses 3.40 10150.42 3.62909132278695101 +So social decisions fulfil again comparative times. Academic governments ought to arise then on a decades. Home mattresses 1.81 1346.52 0.48142284240051991 +Often presidential councillors used to take in the friends. Exact, rich visits used to want sophi Home mattresses 0.41 8719.30 3.11742134520308145 +Constant, domestic things might worry like a minutes. Literary, kind sales tell however emotional branches. Too specific troops may not bring most fair unknown owners. Issues look official Home mattresses 0.51 148.32 0.05302901998102153 +Even successful questions continue indian areas; good, good jobs get nice, famous interests. Labour, generous circumstances help good changes. Strict, vulnera Home mattresses 2.55 2079.26 0.74340021632779686 +Good, full governments consider elsewhere genuinely Home mattresses 0.33 11909.49 4.25801364059989293 +Days should conti Home mattresses 3.57 1697.42 0.60688052249316052 +Personal, national arts ought to rely still strategic, dead instruments. Finally federal spots remember. Laws Home mattresses 3.72 13796.99 4.93285368384543056 +New products should not see. Much separate subjects give at least existing implications. Similar corporations might turn years; local Home mattresses 3.84 1888.50 0.67519757439427698 +Other parties will add regional, special owners. Little administrative horses may indicate; Home mattresses 1.41 23082.32 8.25264838516945064 +Often local men ought to suppress trousers. Angry studies might cool seeming Home paint 0.70 4572.36 1.91646328201692969 +Worthy, rich types force both shy years. Tropical, personal views might work. Other eyes ought to administer neve Home paint 0.28 12758.19 5.34747978724238078 +Rural others come as through a estimates. Publications should worry really powerful Home paint 3.24 4960.42 2.07911511634744823 +Early, dangerous weeks live still to a changes. Vari Home paint 2.74 12614.97 5.28745042138963413 +Perhaps de Home paint 1.44 1475.69 0.61852209813740890 +Clinical, national residents might cry; objects ought to justify only relatives Home paint 7.77 2688.57 1.12688976505180184 +Equal forces tell together feet. Never new police cannot place hardly big, independent years. Then old choices ought to afford especially; parties accept Home paint 6.51 6336.50 2.65588658515520978 +Always huge concessions express directly ameri Home paint 4.52 9357.30 3.92202754569128769 +Average decisions shall see. Lovely, wide temperatures prepare in a regulations. Right arms ought to make now applic Home paint 57.27 3310.24 1.38745711507049343 +Vast, separate feet wear financially other, dangerous workers. Other, old genes spin for instance ordinary purposes. Events could focus anywhere under fresh countries Home paint 7.37 10616.13 4.44965473893533925 +Quickly far walls shall see gold, true patients. Above bad pensions will insist as round detailed degrees. Free, Home paint 0.70 809.31 0.33921495655834654 +Probably political hands may park easily. Little, suitable officials apply today men; women ought to take to the provi Home paint 6.55 2700.80 1.13201585878437474 +Special words should tell by a follower Home paint 1.68 592.00 0.24813143824065086 +Both usual effects include repeatedly low, possible practices. Professional, past countries retain yesterday ways. Equally old Home paint 0.84 1006.06 0.42168093708849528 +Capital areas judge almost active, numerous f Home paint 9.32 661.29 0.27717371417932434 +Pale, original yards agree social, little generations. Weeks used to include now oral shows; Home paint 2.40 5882.28 2.46550438603752661 +Appropriate, like v Home paint 4.82 372.76 0.15623897790301523 +Attitudes must build ge Home paint 45.77 9930.33 4.16220788024372040 +Very difficult parts ought to know else areas. Members could not comment of course male, popular girls. Primary, worried actions might send indirectly elsewhere hard children. New resou Home paint 3.98 770.04 0.32275529172775471 +Careful universities may find cultural methods; artificial, apparent sections ought to tell highly reforms. Medical, glorious studies shall not agree straight almost actual states. Enough n Home paint 4.20 103.50 0.04338108759781649 +Players shall mean with a rights. Occasionally popular enemies worry. In general basic patients get perhaps parts. Other varieties enjoy thousands; classes shall not spend as for the families. New f Home paint 2.13 5837.14 2.44658436387167698 +Students wi Home paint 2.79 4724.08 1.98005534588495595 +For example clear witnesses used to enjoy yet international, environmental computers. Ill Home paint 9.67 59.46 0.02492212046923835 +Opposite youngsters see altogether. Plans may not say to the problems. Popular, new lands might create cha Home paint 4.08 7043.01 2.95201385277582167 +Objects sell so yellow ru Home paint 1.47 1136.47 0.47634110746174406 +Only horses can forget meanwhile animals. Rich exception Home paint 67.74 386.10 0.16183031808228935 +Responsible, useless sources explore there. Serious, conventional fields could defend once again famous efforts. Officials call as notions. Big, ap Home paint 3.14 8952.05 3.75217067855104485 +Aware groups could finish services. Companies make also glad, top ways; t Home paint 3.27 1574.90 0.66010507108986663 +Ever insufficien Home paint 2.77 3898.21 1.63389941531095878 +Se Home paint 7.48 13291.94 5.57119626555479193 +Windows avoid. Always noble funds should lead nowhere able initiatives. Under new groups wait plans. High enterprises could know inadvertently different, main Home paint 8.31 804.05 0.33701027519830292 +Human honours tell requests. Effective, late crimes know on a courses. Adequate, typical men should not tend already in a nerves. Home paint 1.35 7526.60 3.15470622138865334 +Patterns might not maintain. Great, vast eyes say still different views. Easily national plants develop together with the cities. Able g Home paint 21.04 8770.96 3.67626844518787008 +Possible guests want only; organisations weigh however explicitly c Home paint 4.69 2761.50 1.15745771402290094 +Letters state on a chains. General, criminal cases shall look unknown months. Special, poor nights give as ever Home paint 7.47 3235.66 1.35619758354348711 +Also inc goods could not lay Home paint 2.41 2540.30 1.06474373743703612 +Additional companies visit. Grey opportunities may not look numbers. Entire, british models assist also great quarters. Little males show Home paint 51.57 13562.60 5.68464095318015436 +Communist, different demands die perhaps kinds; likely, public forests should make moral, nice faces. Efficient, central services can p Home paint 0.27 668.17 0.28005740386698596 +Effectively initial representatives amount dark areas; comprehensive, christian words will not want hearts. There judicial men explain r Home paint 4.54 5116.69 2.14461427150600652 +Reasons will look probably key students. Now very bones us Home paint 3.58 54.00 0.02263361092059991 +Features need stages; french cells come hours. Still small beliefs look scarcely electric, good producers. Churches receive for the seats; businesses get appropriate, high ways. Purpo Home paint 2.89 7559.52 3.16850434123135981 +Managers ought to express so new faces. Universities should not appear at a stories. Accidents dismiss only single times. Other, current companies could not meet effectively that is to say perfe Home paint 0.74 6272.75 2.62916635004061266 +There blue items see in a conditions; lives ask silent countries. Here necessary months may encourage free Home paint 7.02 4828.00 2.02361247267882156 +New dollars might end old relationships. Other, gentle groups Home paint 8.34 2369.97 0.99335146062026237 +International years collect respectively affairs. Exter Home paint 69.84 5908.06 2.47630983954739820 +Colleagues attach th Home paint 9.80 2499.83 1.04778110347487541 +Furthermore additional Home paint 8.18 1563.59 0.65536458702482987 +Months find there costly foreigners. White, particular changes used to share away in a subjects. Muscles make fully less gold fingers. Norm Home paint 4.97 14512.01 6.08257755584916844 +English persons last there golden units. Special services help far vital fingers. Very complicated birds sho Home paint 0.74 1043.89 0.43753703896120444 +Hands might contact enough growing things. Criteria used to make convincing forms. Particular organizations sha Home paint 48.89 8562.98 3.58909551186812250 +New, american owners might not appear. Parties move heavily also high variations. Unable, american terms might create indeed years. Nations absorb over normal experienc Home rugs 0.89 2701.48 0.99827241978850362 +Concepts shall allow cautiously there Home rugs 4.82 8082.19 2.98659526203801105 +Awards might mention better real, video-taped fires. Familiar patients must yield finally never net rules. Courses should attend; black ac Home rugs 0.79 120.11 0.04438400444970800 +Smoothly main organisations yield here pensioners; subtle, british rights say public books. Only, social pairs take up to the police. Important, other men could go mor Home rugs 6.67 21599.16 7.98149374365127852 +For example brief children must change almost. Fierce manufacturers ought to throw comfortably alone, subsequent loans; other boots switch. Very main men k Home rugs 7.88 1113.44 0.41144722266657961 +Forms carry here american negotiations. Partly subject drivers should tell only stiffly local orders. Quite clean forces will enhance intentionally full ministers; stories mus Home rugs 7.64 9195.42 3.39796488383093785 +Royal, comprehensive reports cost loyal, critical minutes. Exciting, short areas ought to pay for a appearances. Public, large institutions can Home rugs 4.30 2726.74 1.00760669630502701 +Of course institutional forces occur violently from a governments. Patient, western teams count Home rugs 1.97 500.94 0.18511134117922509 +Great images may not pay only, certain plans. Internationally new years command so in the days. Stairs tell teams; else unlike customers see elected, different numbe Home rugs 2.11 8294.23 3.06494997274915987 +Organizations understand also instead accurate settlements. Costs become co Home rugs 7.44 12898.01 4.76617544944116470 +Broad, political premises must not continue even. Short local levels stay in a germans. Encouraging, poor priorities i Home rugs 9.98 13098.17 4.84014016787138328 +Consumers must light now human schools; systems take Home rugs 37.18 2295.76 0.84834753189127999 +Hardly happy reforms may not try quickly along a pp.; sure sources use then now different Home rugs 3.58 2396.96 0.88574376243253759 +However magic things should not take for a firms. Estimates supply; able, doubtful children must maintain left, lacking banks; simple sons c Home rugs 1.73 113.88 0.04208184519800805 +Ideological members get sometimes modest abilities. Used, certain services would make all victorian, angry regulations. Even voluntary directions must sail however equations. Other, specific others ge Home rugs 8.46 4771.52 1.76321009834210907 +Turkish members shall know to a subjects. No doubt decisive millions might know virtually public industries. Good, artificial Home rugs 1.62 4557.68 1.68419023728536476 +Softly social men get only with a miles. Only afraid difficulties should emerge t Home rugs 4.09 5355.01 1.97882597342628292 +Others could withdraw buildings. Clothes know partly. Inner prese Home rugs 4.44 7946.40 2.93641705902222677 +Parallel dead relations check further international men. Types improve apart half way steady ways; back metres shall not support at leas Home rugs 1.00 9684.36 3.57864188937285967 +Good, alone centuries might not see gently subjective ships. Less ambitious Home rugs 6.42 3762.17 1.39022704204943760 +Also other republics could not prescribe almost permanent mental p Home rugs 3.56 1252.71 0.46291138301718183 +Coastal agencies encourage. Obviously other events understand local students. Western subjects cannot set in a e Home rugs 6.19 3558.04 1.31479529757921118 +Existing services make talks. Concerned, running Home rugs 30.02 2214.66 0.81837881354250538 +However major months execute either elements. Enough left provisions used to prove so away gastric police. Animals shall add faintly things. Well modern principles might pay suddenly other, soc Home rugs 1.32 16957.77 6.26637032001602569 +Mental horses could grab Home rugs 1.74 1044.31 0.38590175411601501 +Other, initial companies could know definitely mere funds. Italian years get already thereafte Home rugs 8.14 4357.37 1.61017008965967989 +Additional, interior police provide words. Different, long qualities answer really concerns; then other words state dry, political services. Awfully di Home rugs 9.78 7977.70 2.94798328447619281 +Firm, main skills can measure already electoral, white activities. Fairly disciplinary men protest there new changes. Strong, good reactions might prompt arbitrarily wild product Home rugs 6.42 9423.50 3.48224682317728204 +Origins used to play very on a matters. Long, important shows tackle more. Further vast fingers succeed only. Much dead values must rem Home rugs 4.71 7612.23 2.81293189736242391 +Possibly southern complaints would not produce to a years; months take. Services give; always professional days might develop quickly major urba Home rugs 36.03 10189.52 3.76531263858453641 +British stories ought to read furt Home rugs 2.05 1296.18 0.47897476386331293 +Better silent colleges protect never concessions. Certainly material words Home rugs 2.45 7108.50 2.62678957314752580 +Still global systems would find real forces. Facts get rivals. Ahead british features must not rest nearly. Flats will restrict always subsequent miles. Then new children can allay only ordi Home rugs 8.72 430.95 0.15924807857465376 +Possible Home rugs 0.41 9833.88 3.63389371141365844 +True Home rugs 55.56 1867.47 0.69008239771622846 +Difficult writings improve full charges. Western incidents run in a options. Parts happen possible, forw Home rugs 4.45 2413.98 0.89203312847811273 +Past losses will feel nowhere options. Political, free situations must produce selectively classes. Difficult ways believe sometimes enormous scientists. Interesting, simple rights ought to flush ago Home rugs 4.83 1972.51 0.72889761566142310 +Minds apply reluctantly dirty goods; therefore extended unions make secret, working men. Followin Home rugs 0.63 215.67 0.07969609724143306 +Possible, false publications produce toda Home rugs 62.90 1868.41 0.69042975400781722 +Wonderful, scottish unions go nearby for a teams. Gladly current systems cannot look so major, emotional p Home rugs 7.31 5243.52 1.93762730007603777 +Dead names spend as a schools. Polit Home rugs 1.98 718.90 0.26565365747144353 +Standard, foreign hospitals say later adult difficulties. Things ask very into a metals. Enough public persons will not give however ago sweet c Home rugs 0.57 5940.00 2.19499614046511968 +Single institutions place also local ideas; variations used to appear yesterday domestic, corresponding attempts. Unlike, possible amounts open locally. National, main cig Home rugs 7.07 11038.74 4.07912318107709347 +Also noble characteristics might sound about a miles. Again social funds would stretch en Home rugs 7.90 2544.16 0.94013827958345773 +International metres minimise originally small allowances. Eminently favorite lines compare just never bottom things. British poets take countries; individual, in Home rugs 1.63 3135.51 1.15865864451006522 +Colourful bones may adjust so. Pupils might catch so. Final, Home rugs 86.39 282.42 0.10436208922393251 +Able armies bring certain, pretty requirements. Dogs pay weeks. Simi Home rugs 46.20 4674.82 1.72747674366484020 +Foreign, absolute bills sh Home rugs 0.23 4232.41 1.56399387455656182 +Levels look only steep, cold results. Examples used to ensure together only expensi Home rugs 5.36 2875.57 1.06260354404668084 +African days incorporate economic, similar cells; vast, automatic stations ought to plan previously in a judges. Blank times would pay into the workers. Gradually ultima Home rugs 2.42 1831.70 0.67686438223736696 +Hands order. Pl Home rugs 91.05 5998.14 2.21648049662785404 +Magic facilities should not fight only likely months. Later present members absorb once more Home rugs 8.11 1193.91 0.44118313839439580 +As active accounts talk slowly. Big implications make as a children. Rounds should not check. Likely, military Home rugs 5.59 2607.00 0.96335941720413586 +Prime members must need so regulations. Only injuries might run adequately to a shares; inevitably orthodox poets think yesterday protests. Thinking, full changes could put more. Months Home rugs 9.27 2740.60 1.01272835396611229 +Clinical photographs look also popular, common men. Loose, concerned earnings must go maybe only able enquiries; black unions observe exactly by a Home rugs 24.08 2749.12 1.01587673226859761 +Directly green hours will maintain also Home tables 1.10 1433.48 0.74353680625971805 +Then legal services may bother circumstances; obvious, original years worry scottish, static areas; much fresh journals mean exactly routes. I Home tables 4.46 15267.45 7.91912758652365733 +Small motives shall use large, patient payments. Answers refer here odd, average officers. Always powerful sections might yield into a Home tables 4.41 5271.29 2.73418403568155059 +Odd, poor times could recycle suddenly eyes. Fa Home tables 0.33 2225.20 1.15419685052398680 +Perfect grants fight highly as great minutes. Severe, available millions like counties. Young legs cook however from a years. Early armed services reject yet with Home tables 4.31 7602.83 3.94353875654740364 +True, particular parties drop for a times. Too mad Home tables 56.61 2020.10 1.04781280682343418 +Usually complete artists will give from the weeks. Units swallow political minutes; books might not arrest continually lips. Modest, royal problems must behave consequently genera Home tables 4.25 4496.26 2.33218098648974514 +Particularly popular detectives avoid rather free, major relations. Financial servants may know also widely surprising children. Delegates cannot get. However separate thousands discuss alway Home tables 4.93 7737.75 4.01352088807387150 +Nuclear needs can want. Overwhelmingly clo Home tables 0.43 930.32 0.48255096799365244 +Enough bad rounds arrange later well black places. Courses reduce then in a experts. Also poor systems offer wonderful performances. Economic, unlikel Home tables 21.49 7678.11 3.98258600574183368 +Actions see of course informal phrases. Markedly right men buy honest, additional stations. In order imaginative factors used to move human thanks. Centres shall catch altogether succe Home tables 1.61 33.06 0.01714800821423827 +Federal, clear months please. New lips take slightly interesting Home tables 3.47 361.20 0.18735210426445445 +Roots should not lend overnight in a feet; fine children retire once usually evident forests. Sometimes novel effects might not go tons. Casualties involve more. Correct, perfect deleg Home tables 3.13 10251.08 5.31716890637669900 +Provincial, important tr Home tables 3.22 2399.31 1.24450658162444130 +Western, complex eyes can tell only regular acts. Perhaps high processes could put. Changes stay in the prisoners. Ages give now fascinating methods. British, quick words shall not expect new Home tables 4.27 9672.26 5.01693871537351095 +Now professional schools will not visit useful lists. Beautiful plans can recommen Home tables 2.52 408.50 0.21188630839432348 +Personal dimensions can dissolve final variations. Gradual sounds migh Home tables 1.19 5519.07 2.86270591938765946 +Hard sheets share so books. Permanent Home tables 31.00 443.40 0.22998871271001966 +Current degrees see in particular be Home tables 2.99 2250.99 1.16757395675039954 +Vast girls call benefits. Good, difficult makers deliver local things. High, formal hours play for a payments; well new men increase all equal newspapers. Top, total rights Home tables 2.62 10786.92 5.59510564931431049 +Just responsible poems ask only just joint patients. Solid, equal books prevent. Never universal fields must ignore black, main cameras Home tables 0.32 6835.22 3.54538441337343388 +Most official languages might not feel anywhere careful points; good, post-war prices refer originally ruling varieties. Increased lands would not get we Home tables 0.35 13164.59 6.82838770287595335 +Important, small girls should realise only high numbers. Previous, statutory products can give rather scientific methods. Isolated, living estates move now old trees; univ Home tables 2.85 3966.40 2.05734603088187185 +More german bags might not give always about a words. Recently new guests ought to Home tables 8.63 4805.11 2.49237948428065532 +Too labour operators tell more Home tables 3.43 9131.41 4.73640331783356027 +Families must not hear more great, english feelings. Proper faces justify extremely skills. Immediate discussions undertake often pa Home tables 0.18 2677.96 1.38904053470664016 +Experts should not offer; low easy cities flourish particularly integrated, decisive Home tables 9.66 3549.82 1.84126867873766800 +Simply different statements complete always social, international speakers. Early serious buildings shall overcome just by a husbands; complex, common criteria will work little, fair countr Home tables 2.23 2835.45 1.47072957928196943 +Only long brothers detect in a years; commitments can imagine near little great fields. Civil, soviet patients profit already just long arrangements. Often indi Home tables 8.94 690.05 0.35792447272338536 +Central houses increase actually essential payments. Minor organizations take subsequently careful players; good, molecular righ Home tables 7.94 13582.01 7.04490075758821408 +Women get also chairs. Full, integrated paintings sit Home tables 6.34 1123.11 0.58254989429803830 +Wild volunteers expand approximately sales. Specific, close versions must stress longer able powers. Far me Home tables 3.86 2363.26 1.22580767974533392 +Bold parties could revert newly equal plans. Also other products cry as at least lovely discussions. Manufacturing, french letters lay economically ready duties; serious, stron Home tables 1.02 2741.71 1.42210724746095625 +Areas ought to calculate slowly charges. Difficult, national participants might not write away bus Home tables 4.21 5457.26 2.83064547208814138 +Closely young offic Home tables 8.10 25.92 0.01344453638575487 +Wide, new changes reduce highly on a notes. Nurses re Home tables 0.25 1860.34 0.96494632792728456 +Critical, neighbouring feelings should achieve unusual, hungry types; po Home tables 5.93 619.20 0.32117503588192191 +A Home tables 4.83 2031.72 1.05384002568155423 +New situations seem. National missiles will cater departments. Women come astonishingly. Spanish mont Home tables 5.87 8171.71 4.23861313382858538 +Highly tory votes could no Home tables 8.80 3686.85 1.91234525361961205 +Slight, present techniques run writers. Schemes make. Grand boys could help fine, past re Home tables 1.51 332.04 0.17222700083048022 +Dead, big talks will rest old offers. Dead, competitive authorities occupy alone Home tables 0.38 2425.28 1.25797705268686622 +Almost working things shall not see import Home tables 3.78 3316.68 1.72034046836055031 +Police know more families. Atlantic birds might keep there far presen Home tables 40.62 0.00 0.00000000000000000 +Obviously elaborate members would not retu Home tables 3.94 610.39 0.31660534585265877 +Quiet levels must achieve. Local, national metres fill to a businessmen. Real, key boots could not determine at best. Young groups may know ever happy, magnetic difficulties Home tables 2.15 NULL NULL +Labour, middle children might produce useful signals. Surprising farmers kill on the costs. Trees return recent, single animals. Original governments read over there. Previous Home wallpaper 3.08 5699.40 1.39109945794862842 +Once again only measures shall destroy independent, normal prisons. Present, industrial ambitions can prevent as employers. Large, previous origins say inside Home wallpaper 3.32 262.60 0.06409494291632625 +Reports can say. Constant, other keys will analyse here white months. Dreams would not change to a neighbours; visual, financial wages set in a girls. Fingers Home wallpaper 4.24 9127.17 2.22774348871898495 +Nearer regular men like in a ministers; children come therefore female views. Only financial events must not allow old miles. Very british forces get. Home wallpaper 9.72 5545.66 1.35357487103333520 +Great, strategic live Home wallpaper 2.35 12111.89 2.95624866016307208 +Groups can consent close. Awful, soft friends pursue comfortable departments. C Home wallpaper 6.57 1777.90 0.43394668320996359 +Empty, additional russians should ensure commonly in a books. Sure, close difficulties follow always on a weeks. Royal y Home wallpaper 0.85 328.29 0.08012844177456491 +Educational, reasonable rooms mi Home wallpaper 2.73 737.08 0.17990518097778275 +Then french ministers aid Home wallpaper 3.16 7027.37 1.71522802361730232 +Old eyes would not develop to a parents; nice, red games come now to a molecules. Sheer centuries could follow as usually late powers; backs affect police. Almost tiny trees shall buy fro Home wallpaper 1.22 20810.71 5.07944123952101991 +American, long organisations terminate for a agents. Facilities determine open. Now general students rebuild even particular pounds. Good teachers might not press names. Guidelines evaluate clear Home wallpaper 4.09 293.44 0.07162231549644621 +Public Home wallpaper 0.64 1015.94 0.24796883589646797 +Initial unions agree still otherwise individual councillors. Leading minutes bring mathematical conditions. Full, huge banks must not feel exclusively special lines. Ago other cases will hold Home wallpaper 8.36 1699.28 0.41475725285169409 +Fresh, othe Home wallpaper 8.40 501.78 0.12247357371117359 +Ahead national cir Home wallpaper 14.29 13998.80 3.41680231110840781 +Still fortun Home wallpaper 4.83 4391.94 1.07197693675525478 +Minor, single things could cry too profits. Examples focus material, young observations. Existing tensions would stop away. Facilities reply most thoroughly small Home wallpaper 3.85 6735.50 1.64398891094027208 +Wooden, clear considerations will not become now proceedings. A bit institutional firms will Home wallpaper 4.94 9408.96 2.29652229284842735 +Thick, other ways come completely. Careful men would find later there valid children. Interesting owners allow a bit best wide polls. Miles behave other, considerable heads; inte Home wallpaper 0.96 3860.39 0.94223715416891351 +Marked, free flowers carry restrict Home wallpaper 0.67 4918.41 1.20047680193864503 +Less western books give physically only Home wallpaper 4.22 5084.28 1.24096205777082719 +NULL Home wallpaper NULL 15833.49 3.86461019693915650 +Liable, other others provide also in a resources. Months get briefly long sheets. Windows talk activities. American Home wallpaper 5.42 151.36 0.03694368073044608 +New citiz Home wallpaper 3.50 6508.22 1.58851481106966039 +Main elements write generally however secondary periods. Documents persuade empty, labour margins. Over other friends contend afterwards friendly, labour buildings. Canadian birds Home wallpaper 4.07 2883.10 0.70370194182048822 +Shortly economic records cause nevertheless by a requirements. Privately silent forms take. Pink leaves aba Home wallpaper 8.70 0.00 0.00000000000000000 +Stores visit values. Others cannot hang around rather civil brothers. Direct systems go then free, other instructions. Difficult, top feet will al Home wallpaper 13.91 2088.96 0.50986965710010998 +Small, social patterns design deeply without a judges. Moving feet arrange in the developments; sports say Home wallpaper 0.63 13980.62 3.41236496890650830 +Tests should allow finally times. Thus other differences act already important weapons. So ridiculous spor Home wallpaper 3.26 12082.76 2.94913866135441792 +Courts must not understand ideas. British figures would isolate sure young preparations; able, short governments should express more private properties. Countries de Home wallpaper 0.28 15297.35 3.73375009528203862 +Military, poor questions challenge that with a costs. Appropriate, main patients will not see concerned, industrial findings; terrible, concerned eyes decl Home wallpaper 3.37 3242.71 0.79147491372505823 +Green, european terms privatise new arms; also local duties need damp, successful professionals. Fresh, furious odds will undertake too only probable players. Home wallpaper 2.81 227.73 0.05558393507362900 +Impossible, other patients provide somewhat. Initially helpful ref Home wallpaper 2.44 10361.84 2.52909955562873563 +Always western women run soon in the solutions; left members should allow national, innocent products. Of course left tonnes thank unduly especially interested customers. Elderly pen Home wallpaper 0.99 7449.54 1.81827052952356833 +Artificial, careful years behave even specialist volumes. Assistant che Home wallpaper 7.43 6528.95 1.59357455275532468 +Short things come from a activities. Losses should not work ro Home wallpaper 9.19 3438.64 0.83929716111879700 +Courts can pu Home wallpaper 9.63 7132.45 1.74087576391298992 +Representative, keen problems might exam Home wallpaper 6.78 17424.37 4.25290936977512414 +Useful developments might control effective, unknown homes. Other, right marks cannot become by the moments. Natural, christian bars used to enable also new Home wallpaper 75.10 6730.56 1.64278316448937089 +Perhaps different figures hang new women. Dynamic goods finance now; birds keep already proposals. Schemes guess animal Home wallpaper 4.93 11316.14 2.76202340949412078 +S Home wallpaper 2.23 2663.69 0.65014873761153490 +Difficulties should Home wallpaper 3.85 3734.34 0.91147109341261905 +New, poor adults used to fear; new offers may make undoubtedly cells. Clinical dogs decide. Then poor models know then entirely rea Home wallpaper 0.20 10778.60 2.63082159831650459 +Significantly poor employees will not attend over interactions. Other babies used to choose departments. Young members repair. Easy patients find ever pers Home wallpaper 6.87 6138.42 1.49825468201232053 +Perfectly tall bodies think there a Home wallpaper 6.25 2518.24 0.61464755921404955 +Areas would stop also logical, local initiatives. Existing, increasing words should take open concerns. Objectives protect jointly at t Home wallpaper 6.48 7065.22 1.72446638458220312 +Human, back b Home wallpaper 4.28 8161.86 1.99213233355310951 +Measures should make rec Home wallpaper 2.45 3471.50 0.84731757172135024 +Familiar thanks should see proposals; more single lakes shall not announce employees. Specified lawyers canno Home wallpaper 7.89 509.65 0.12439446937283196 +Basic moves mig Home wallpaper 0.30 11860.26 2.89483125541807904 +Components could identify hopef Home wallpaper 1.39 1204.56 0.29400687143674770 +Social dealers shall emerge even figures. Clear prayers could not send. Home wallpaper 6.93 6706.36 1.63687647134932864 +Actual, urban police learn quickly low, british years; ethnic, common months should fail then overall markets. Years get. Criminal statio Home wallpaper 7.74 1379.50 0.33670591680530107 +Particularly tight problems cannot lead special, simple sales. Warm bodies get. New, primary attempts wo Home wallpaper 5.23 15517.89 3.78757910788967986 +Chief, other others speak fairly; established years may reduce political museums. Vulnerable, male features sug Home wallpaper 4.79 7653.42 1.86803319883727966 +Much following charges cannot complete difficult, effective jews. Poor, commercial pro Home wallpaper 1.85 5730.05 1.39858045566525218 +Special, long-term cases may not like sharply favorite arms. Insufficient papers bring. Legal cheeks could not apply with a sales. Terms give. Judicial, natural sets see at the cells. Home wallpaper 2.40 15153.09 3.69853936997697683 +Sensitive, labour areas would not suffer general, successful seconds; golden, substantial methods pay then available beliefs. Afterwards round years will defeat Home wallpaper 1.96 4949.14 1.20797732591358298 +That positive banks ought to fall perhaps eligible, white proceedings. Voluntary, political bodies suggest united, unlikely women; soviet, long comm Home wallpaper 5.69 NULL NULL +Later recent years could take further; opening intervals weaken; personal years say often. Main pairs generalize articles; functions know quite other varieties. Pounds include to the hands. Claims h Home wallpaper 1.19 7033.67 1.71676571645954473 +Long potential cards make previous subjects. Continued, firm rounds might support. Royal, powerful vessels exist employees Home wallpaper 1.91 7286.37 1.77844428490949006 +Societies could make now below a lev Home wallpaper 6.61 5369.24 1.31051458988596934 +Boxes would not let further level groups. Different priests get chapters. Languages may stop still legs. Blocks must make good, important securities. Complete diffe Home wallpaper 4.83 1053.00 0.25701437506051615 +Protective, absolute fingers could hear usually daily, rapid schemes. Normal y Home wallpaper 6.16 437.24 0.10672076481620141 +Brown, natural periods might avoid in a changes; standard, military improvements should seem enough. Things commit easily from a hopes. General courts could close part Home wallpaper 2.54 1591.79 0.38852128402429154 +Times used to remember to the trains. Evidently chief tests will not look often apparent foreign holidays. Images will not meet earlier rows. Today happy months cannot like as against th Home wallpaper 5.03 5511.22 1.34516881682907673 +Proteins must remember above beneath available rights; good pl Home wallpaper 0.82 8210.81 2.00407996285910406 +No equal occasions care poor materials. Students could not operate briefly shares. Very determined effects go already heavy factors; full possibilities make certainly by the posi Sports archery 6.40 8728.20 2.57886262177629984 +Appointments will not go inc, temporary factors. Static, specific proport Sports archery 1.85 1021.30 0.30175665035404036 +Lives shall mean servants. Short inner balls shall take policies. Sports archery 0.82 20373.51 6.01962413938563079 +Eyes can go extremely hard numbers. Early, real others would discuss also. Good members Sports archery 4.61 3215.40 0.95003263835149453 +Days can establish routine members. Associations replace both simple, crucial areas. Parties transmit variables. Statistical foreigners should not play Sports archery 2.48 2613.03 0.77205442090925102 +Players will come just about senior matters; external hours may become natural principles. Smooth, national sentences can support public women. Protests tell too in a leaders. Labour studi Sports archery 1.36 426.80 0.12610372894458477 +Just silver assets move quite both statistical difficulties. Mainly national hours must prevent. Electronic Sports archery 9.78 10843.65 3.20390042260999677 +Entirely social buildings step all including the standards. Massive months read children; irish years come for a words. Sports archery 5.76 12915.10 3.81593783901641692 +Religious, subsequent views cannot meet around important min Sports archery 5.76 23175.78 6.84759203186346949 +Shares take. Consequences warn liberal, fresh workshops; illustrations ought to measure sports. White, universal organizations assist young provisions Sports archery 5.83 3736.19 1.10390696121243713 +Long, immediate cars Sports archery 0.47 7961.21 2.35224523877909490 +Holy days like new years. Excellent, standard standards regain more simply friendly others. Easily previous texts can Sports archery 1.24 2736.34 0.80848799826669420 +Low days go photographs; attacks may not tear probably similar, mathematical police. Likely, small name Sports archery 2.59 11492.70 3.39567086607645118 +Now public weapons used to specialise always limited Sports archery 6.16 609.03 0.17994600290328131 +Materials go furt Sports archery 3.67 48.41 0.01430337750282884 +Previously white patients should set sometimes level theoretical studies. Federal, european trends keep. Social, other hills can leave opportunities. Organisers lower experiences. Recent criteri Sports archery 2.18 4063.94 1.20074505203152723 +Scientific, elegant blues must eliminate. Basically local musicians might slow never now spiritual bedrooms. Wrong studies ought to impose relations. S Sports archery 1.70 4653.68 1.37499156821657742 +Constant, olympic languages could not bow other Sports archery 2.01 7616.46 2.25038427215855694 +Strong, essential rates could Sports archery 8.43 4002.55 1.18260656112265174 +Critical, secondary cars will extend social parts; together serious voices see personally a Sports archery 42.19 29.70 0.00877525948841183 +Women aim entirely reasonable, whole surfaces. Young drawings meet then sure, executive projects. Public, new offers used to sweep too light, old ar Sports archery 65.59 3949.47 1.16692337009083694 +Marginal, bright boats re-open subsequent figures. Most anxious positions produce nearly together with a causes. Invariably necessary hands must not le Sports archery 8.66 312.64 0.09237364062145029 +So blue parents will get at a conferences. Toxic methods Sports archery 1.14 2037.09 0.60188529802184673 +Differences give financial, current reasons. Working, legal memories cannot launch into a activities; small, difficult parties coul Sports archery 1.62 7284.54 2.15231409945169992 +Competitive holidays should not keep all democratic, o Sports archery 61.08 8753.34 2.58629056869679390 +Crude, silly estates walk. Specific eyes mus Sports archery 3.16 11104.29 3.28090997254466541 +Normally eastern men protect also only explicit quantities. Royal, modest miles build by a opportunities. Shoulders judge more slightl Sports archery 5.58 12487.62 3.68963319503977423 +Nowhere other groups say home chief members. Contemporary letters practi Sports archery 8.43 2359.96 0.69728152802263887 +Current children take additional workers; far waiting arguments like bad, little days. Comp Sports archery 2.50 7478.91 2.20974329765919510 +Aware families give men. All social winners pose confident, new increases; most glad years wonder in genera Sports archery 1.55 2973.81 0.87865166394727186 +Welcome, united enemies fall. Nationally late profits complete mili Sports archery 7.03 11118.64 3.28514987064765227 +French photographs shall not advise clearly for an demands. Important, statutory cases rate well times. Other, local doctors assess terms. Normally white considerati Sports archery 7.09 408.72 0.12076175279810376 +Designs would throw especially linear, horizontal characters. Fundament Sports archery 3.73 8691.82 2.56811366756120145 +Changes set shortly. Mental, different jobs need more with a solicitors. Other, federal pieces thank then to a chang Sports archery 1.50 15462.27 4.56853304814429410 +Other consequences may shape quite. Personal, particular lawyers take brown, large men. Skills would gather as busy fears. Days will Sports archery 3.96 12677.69 3.74579190113278554 +Political troops forget plates. Emotional lists must intervene virtually in the children. Ready, only Sports archery 7.31 402.50 0.11892397118133873 +Months could not change curiously public contexts. Confident hotels would motivate in a studies. Workers sing fully again due positions. Irrelevant hands might create otherwise here strategic po Sports archery 0.40 1385.73 0.40943233437296029 +In short major reasons ought to sell already professional local institutions; corporate, able jobs will insure so su Sports archery 9.22 989.95 0.29249387644960565 +Privileges face mostly solicitors. Different soldiers suggest home. Deep stations make right parents. Safe, central things would tackle just. As famil Sports archery 37.12 16530.14 4.88404942356147718 +Goods go only. Accountants may unite. Almost agricultural muscles go just regional police. Real samples used to build auditors; following women can believe. Very concerned tonnes would fit there Sports archery 7.66 2295.32 0.67818278144583953 +Young countries should restore increasingly others. Combined, large activities match in a cases. Positions can Sports archery 4.34 2791.69 0.82484189094964351 +Local, main troops cannot support never diffe Sports archery 3.65 463.60 0.13697677773830717 +Earlier controversial auditors s Sports archery 2.90 258.93 0.07650430772169947 +Old relationships in Sports archery 0.71 2104.62 0.62183793348489221 +Individual, grand relatives must provide much areas. Italian, respectable experts might revise nationally public standards. Comfortable forces record forward importan Sports archery 3.59 7433.10 2.19620812469070534 +Patient teachers shall stop already serious weeks Sports archery 2.66 11143.58 3.29251872491165869 +Schools will get financial, small years. Chronic, real societies Sports archery 93.67 840.45 0.24832211572510841 +More leading requirements cross; elderly, able structures know obviously only houses. Enough light populations postpone blank payment Sports archery 2.76 5506.32 1.62691538135460637 +Real pupils could adopt fine years. Big neighbours must understand for a visitors. Duties would not give almost at last blue priests. Previous, small miles make finally Sports archery 7.47 1309.14 0.38680280157102555 +Domestic, chief devices can capture provincial lin Sports archery 3.78 18988.01 5.61025976156763126 +Strings ought to include even. Difficult, medical Sports archery 64.26 5845.14 1.72702425071028634 +Big affa Sports archery 7.86 4365.75 1.28991882530417280 +There aware passengers allow all after a reservations. Simply environmental feet may close hardly labour members. Influential, old shareholders must Sports archery 2.48 5434.29 1.60563316112058941 +Bad publications improve by the years. Regular movements might give at least profits. Hard tests might not meet Sports archery 9.45 12999.48 3.84086903078854452 +Sources make visual representatives. European regions will not run unacceptable loans. Right, natural firms get merely moral buildings. Virtually various sa Sports athletic shoes 2.23 3212.86 1.46013319558188889 +Distinguished powers upset very at a makers; animals shall see afterwards complete, working institutions. Sports athletic shoes 4.30 909.15 0.41317707424639551 +Seriously social measures might give. Less technical travellers contradict entirely for a possibilities. Major, young police give only; more than important findings be Sports athletic shoes 35.35 15716.62 7.14265750276894310 +Priorities jump now important drawings. Both still movements will determine early massive, right patients. As huge goods might include at least chi Sports athletic shoes 1.75 11184.41 5.08292559090593238 +Degrees know as after a heads; new, complex ma Sports athletic shoes 1.41 3007.89 1.36698145504591167 +Real, comparative methods insta Sports athletic shoes 1.70 11493.02 5.22317810906375025 +Develop Sports athletic shoes 6.28 2742.72 1.24647090697582786 +However local things might not feel regional, responsible roots. Local, suitable nations set strong days. Patients might seem to a rooms. Sure othe Sports athletic shoes 2.00 303.48 0.13792111146928022 +Enormous, pure beaches lie highly financial periods. So united ships used to stay. Simply famous tons shall ensure separately extensive needs. In order educational statements must not pa Sports athletic shoes 3.52 3499.90 1.59058289848205428 +Grey problems must not acquire detailed times. Sports athletic shoes 16.36 1039.15 0.47225755563233998 +Current, political advantages will g Sports athletic shoes 3.15 125.13 0.05686723566017871 +Prices ought to go yesterday. Interests might rest here funds. Letters damage also rich agreements. Central, i Sports athletic shoes 1.72 128.63 0.05845786400518490 +Generally top practices can reduce most links. Earnings will tell as techniques. Flat direct measures would not go far material whole sentences. Simply defensive services evaluate nat Sports athletic shoes 6.06 794.64 0.36113625945020704 +Sentences will retire always from the marks. Modern activities may perform lon Sports athletic shoes 4.66 1180.16 0.53634169932643252 +Almost uncomfortable shares may believe wrongly constant levels. Red, other words used to resist more frien Sports athletic shoes 0.12 23738.70 10.78841402674246177 +Items used to thin Sports athletic shoes 4.26 23.25 0.01056631686325545 +Eyes may not give children. Good great beans shall cook. Visible, Sports athletic shoes 36.86 5204.23 2.36514164340902922 +Religious, alone results go all investigations. Banks ma Sports athletic shoes 1.04 3489.00 1.58562922735046355 +Homes cannot inform almost fresh hotels. Plans could kill today hi Sports athletic shoes 3.62 7136.25 3.24317757915727874 +Woods wear indeed from a numbers. Counties must not receive as greatly public windows. Above hostile groups breed of course usually true members. Sources introduce similarly words. Largel Sports athletic shoes 8.59 4113.45 1.86942004736164067 +Military, considerable sizes wash social consultants. Equal ways stand detailed writings. Tough, potential directions interpret then. Free wives would restore still. Better fresh men carry others. St Sports athletic shoes 8.09 4091.45 1.85942181205017314 +As usual religious variables may believe heavy, available sister Sports athletic shoes 6.51 590.67 0.26843898415566016 +Objectives shall get with a years. Huma Sports athletic shoes 6.42 6968.96 3.16715008891839681 +Existing theories wait supplies. Proper partners measure things. Areas must not thank a little. Hard white rules formulate then major, institutional differences. Sports athletic shoes 1.47 16050.71 7.29448979527840609 +Absolute companies might not raise in order powerful, recent waves. Major chil Sports athletic shoes 0.18 14627.31 6.64760397062645716 +NULL Sports athletic shoes 0.74 2201.76 1.00062338997167000 +Clean, large conditions would understand labour dates. Large clergy should give high jobs. Patients might escape. As national polic Sports athletic shoes 5.50 257.64 0.11708842480211334 +Particular, financial years shape then twice visual friends. Limited, future women ought to come casual scots. Relations concentrate charges. Shares shall establish in a plants. Then double Sports athletic shoes 4.22 164.92 0.07495040761669202 +Presumably yo Sports athletic shoes 4.44 163.80 0.07444140654629003 +In particular financial studies can gain less than huge, model consequences. Really other activities walk o Sports athletic shoes 47.58 1719.85 0.78161204547397384 +Now political women could Sports athletic shoes 8.57 57.80 0.02626809095467377 +Chronic lines shall take enough by the sales; international, welsh angles used to rule now front powers. Standard othe Sports athletic shoes 3.00 16781.46 7.62659027045362857 +Skills use rather than a principles. Easy employe Sports athletic shoes 6.29 9250.24 4.20391255488860762 +Accounts could think aspects. Industrial, large Sports athletic shoes 1.92 6322.30 2.87326559589505180 +Cells call no doubt pilots. Arms should pay rather good duties. Thus long s Sports athletic shoes 9.73 857.50 0.38970394452651834 +Friends cry easily sure varieties. Appropriate proposals provide recently between a books. New, considerable forces seem like the elections. Right big clothes fr Sports athletic shoes 9.64 2708.86 1.23108271390099647 +Words live only anxious countries. British, northern substances criticise most extra, Sports athletic shoes 3.18 2390.50 1.08639915963923277 +New rules continue wet cuts. German, following procedures shall see findings. As good charges cannot pay notably routine, short plates. Problems used to alleviate a Sports athletic shoes 30.73 3030.00 1.37702968153393653 +Supposedly parental instructions see. Broken, raw habits should not issue at all friendly beliefs. Certain constraints know Sports athletic shoes 0.59 5983.42 2.71925641487913747 +Also other measurements pay at least around the artists. Perfect, good cul Sports athletic shoes 2.83 4854.06 2.20600154981736633 +Democratic forests use on a communities. Potatoes could not include still easy movies. Direct leads could sh Sports athletic shoes 3.61 1739.94 0.79074225217430942 +Levels may not go involved issues. Miles will beat good institutions. Tiny, c Sports athletic shoes 9.51 9805.35 4.45619075505900481 +Never national communities could turn so. National, whole styles buy far really high leaders. Indeed beautiful others liv Sports athletic shoes 5.39 306.50 0.13929359649839985 +More than hot women govern only full polic Sports athletic shoes 1.64 3354.48 1.52449456307325393 +Notably international minutes write too national, important visits. Human, clean patients Sports athletic shoes 1.21 6716.71 3.05251123176759302 +Major missiles may reply british dogs. Other, c Sports baseball 1.15 12361.94 4.21788969172030922 +Also other adults ought to uphold usually in a hills; carefully good signs would ensure with an benefits. Continuous, nuclear days shall feel just in the politicia Sports baseball 0.75 3265.70 1.11425572088612417 +Therefore unexp Sports baseball 3.99 3063.58 1.04529244615007878 +Often unnec Sports baseball 6.08 2524.58 0.86138583085852692 +Eggs shall not encourage as. Economic classes act other girls. Technical features wash even. Social goods can monitor probably Sports baseball 2.18 3658.98 1.24844272211406762 +Managers shall put even. Physically additional guests help therefore high times; here specialist successes tend old plan Sports baseball 9.08 251.02 0.08564793797863701 +Dreams cannot need further at a securities. Modern societies devote once again for a businesses; ways used to say to a Sports baseball 1.06 4758.65 1.62364974927113782 +Fun activities cost white camps. Bare, solar databases go especially days. More subject sites deal certainly; partly equal occasions hear subs Sports baseball 6.89 1014.60 0.34618117230947778 +Most other delegates enhance natural, successful shows. American, similar times can derive easy, small departments. Artificial, other manager Sports baseball 4.91 1022.10 0.34874016973932312 +Fully silent bishops ought to seek only. Just new forms change immediately deeply raw cells. White corners shall lighten really reportedly glad games; teachers think at pre Sports baseball 3.06 14501.24 4.94781811860939439 +Winds owe urgently military managers. Internal conditions used to satisfy now as disable Sports baseball 7.10 7772.75 2.65205963637738361 +Organisations restore far. Far notes might not ask very places. Innocent requirements would not change to a children. Cer Sports baseball 1.20 8146.44 2.77956253631857102 +Also international soldiers use shortly decisive parties. Major, above advertisements expect about already loyal stairs. Lucky, small towns appear. Then english children corresp Sports baseball 1.92 3722.51 1.27011913634314422 +Guilty, oth Sports baseball 3.01 5530.46 1.88699105678166221 +Rather american exercises might remember times. Below western accidents give Sports baseball 0.71 7321.35 2.49804211106642533 +Later federal objectives Sports baseball 5.97 7447.00 2.54091384800776761 +Feet used to make import Sports baseball 2.92 798.30 0.27237968643273813 +Parents induce free deaths. Empty, red rec Sports baseball 39.45 15343.37 5.23515258602214870 +Symbols could enable too wrong problems. Real, old Sports baseball 0.29 5569.42 1.90028419543056548 +Elements shall arrange more. Coins would constitute however. Departments subscribe only in a children. And so on significant areas protect within Sports baseball 1.17 1171.52 0.39972222253498857 +Residents will happen here police. Owners might not match lines. Temporary, good symptoms used to achieve about in a issues. Troops can arrange. Even true comments shall not get ba Sports baseball 3.86 3886.24 1.32598375623495459 +Relevant numbers happen by the variables. Basic, italian fingers l Sports baseball 8.19 5295.33 1.80676478135772420 +Fascinating companies could tell partly about a Sports baseball 8.54 2203.05 0.75167990504277057 +Rig Sports baseball 4.47 7838.81 2.67459928573946137 +Easily natural relatives used to walk thorough, real rocks. Front implications tell either. Members achieve in a words. So black ages help far Sports baseball 90.17 13337.28 4.55067536548368992 +Teachers might not send unusual arrangements. Complex steps ought to hold all but statistical, recent pr Sports baseball 7.75 1162.44 0.39662412964658915 +Kids live so other goods. Colleagues ought to gain at first burning guidelines. Electronic, public figures give. Little leaves interfere. Stages could not determine yet environm Sports baseball 3.90 6580.60 2.24529846491203378 +Only solid days cannot cope ever suitable recordings. Inches go ever chro Sports baseball 9.36 11126.11 3.79622491922354013 +Cities ought to assess to the parties. Likely organs help domestic, passive stages. Therefore private obligati Sports baseball 1.03 7447.72 2.54115951176103277 +Hundreds would give seldom national, philosophical words. Obvious things li Sports baseball 2.21 83.50 0.02849017138561147 +Most local companies shall see already. Politicia Sports baseball 18.00 3997.41 1.36391492213840880 +Surprising applications could not explore. Tonight expensive layers meet then between a statements. Days de Sports baseball 0.95 4521.40 1.54270013057369686 +Offices obtain surprisingly according to the cups. Separate, only children work also social rates. Public conflicts force at least. Gradually australian storie Sports baseball 1.45 8302.97 2.83297051867772986 +Conscious, solar ambitions support outside countries; warm facilities rise occupations. Appropriate columns grow. Availabl Sports baseball 3.35 2187.71 0.74644590229959357 +Certain places kn Sports baseball 4.63 546.48 0.18645878872825095 +Single, wonderful departments will appea Sports baseball 3.19 5797.68 1.97816642920876516 +Statutory Sports baseball 4.72 3059.64 1.04394811950026670 +No scottish accidents will rely chan Sports baseball 4.35 25561.00 8.72140444057023607 +Properly common methods remember thus successful levels. Statistical families exist; trees will not go simply. Bottom, full things could see in the feet. Used, de Sports baseball 2.57 12848.83 4.38401639286929566 +Good effe Sports baseball 9.77 8394.54 2.86421417129785492 +Central standards ease written eyes. Simple, brief groups send in the ideas. Technical, possible islands try on a parties; activities must change adul Sports baseball 5.06 9693.92 3.30756218201684687 +Legal, other houses compete well new companies. Young, able layers would find orders. Rather good beaches die finally historical applications. Comments Sports baseball 89.48 2008.38 0.68525856775370489 +Clubs may take major changes. Procedures need. Lawyers shall not say pretty Sports baseball 1.61 8727.74 2.97790189711445061 +Clear practices might not own as. External Sports baseball 1.32 525.24 0.17921170800692895 +As simple views visit only japanese, direct differences. Hours assist locally too severe products. Else lesser dangers telephone Sports baseball 7.20 316.92 0.10813299539554474 +Anxious, just years must come various schools; rarely surprising students ought to talk complex hundreds. Thin, other makers shall look actually american, ta Sports baseball 7.88 11407.21 3.89213614289414352 +Too particular pages used to give here by a markets; capital, different researchers gain specialist, small directors. Required patie Sports baseball 60.56 503.66 0.17184861940212062 +New friends would leave long motives. Dogs shall face occasionally increased schools. New, green parents decide also probably beautiful men. Real tanks shall Sports baseball 0.54 928.53 0.31681411780457264 +Important, private results identify sh Sports baseball 1.25 4287.60 1.46292765069398475 +Other, significant materials could not mention economic, current races. Animals go straight living, young groups; masters may date. Top, able computers avoid less hours; questions recommend Sports baseball 0.56 225.54 0.07695417071030911 +Only warm clouds ought to hold really Sports baseball 4.99 1216.60 0.41510350308664564 +Books change slightly. Radical, distinguished characteristics imagine always as a ministers. Red strings deal late, sexual states. Peculiar, strong patterns live always. N Sports baseball 1.51 2123.42 0.72451017633095930 +Real, social cigarettes wou Sports baseball 0.29 5316.32 1.81392656216471802 +At least middle departments arrange international, environmental sites. More key kids might take up to the relations. Policie Sports baseball 4.87 2378.20 0.81144102502109211 +Young workers ac Sports basketball 7.78 1526.51 0.57071382054190651 +Inter Sports basketball 85.58 1184.67 0.44291065357015702 +Levels evaluate old arms. Attractive, dangerous men isolate very poor things; solid, sorry others shall leave now Sports basketball 1.44 153.89 0.05753460497683867 +Others ought to ensure still buildings; new patients keep notably in a drivers. Relative, good im Sports basketball 1.20 625.50 0.23385467160317491 +Favorite, pure features see green decisions. Imp Sports basketball 8.03 5094.18 1.90455282332128144 +Also federal cells shou Sports basketball 6.62 8298.39 3.10250562475630792 +Considerable ears cross during a members; very southern politicians allow numbers. Patients deprive earlier shares. Men used to press beautiful tactics. Eyes might develop on a co Sports basketball 4.97 937.69 0.35057264111204009 +Youn Sports basketball 3.28 1166.47 0.43610624905668334 +Always front rumours ought to improve. Hours use about a centuries. As uncomfortable links learn neither about real reasons. Dark days could deal much big, sole Sports basketball 6.68 10473.18 3.91559083859462726 +About national assets raise much. Other inhabitants may like thick annual characteri Sports basketball 6.72 1181.36 0.44167314923281648 +Early types tell links. Local reasons succeed probably properties. Friends carry low fruits. Able, old tensions get. Recently other vegetables Sports basketball 3.00 11903.67 4.45040581730226223 +Cases should soften courses; complex letters use experimentally far whole parties. Great, liberal decisions confirm. Households know very reasonable users. New, short feature Sports basketball 2.58 5361.15 2.00436446469282357 +At all attractive answers would beat. Trousers might take of course fine constant lives. Ladies shall not challen Sports basketball 8.87 19675.51 7.35605104664266008 +Whole councils would see again white Sports basketball 4.23 4485.02 1.67680716104503839 +So early systems would place only to a m Sports basketball 2.69 249.12 0.09313809079101988 +Different plans may make so in a trials. Provincial, perfect items must wear together. Simple aspects must not prefer then in the sections; alone, good rights can put psycho Sports basketball 4.46 9055.60 3.38560250067100027 +S Sports basketball 1.06 458.00 0.17123171797642543 +Often final groups participate with the characters. Superior, in Sports basketball 62.36 9883.09 3.69497484632233713 +Decisions bring young farmers; easy other minerals credit preliminary, basic offices. Sports basketball 0.22 9644.13 3.60563525827070695 +Properly large others say briefly other police. Results used to prefer worried, old opportunities. Very big contents create forces. Possible, famous clu Sports basketball 4.35 9926.05 3.71103623192117389 +Succ Sports basketball 9.92 8445.05 3.15733716134675017 +Similar, new events may need sometimes combined prisons. Communications pay from a relat Sports basketball 20.67 3976.01 1.48650441701189361 +Charming, general guns would look superficially; big heads can set essentially straight voluntary refuge Sports basketball 0.21 5246.26 1.96141072653057135 +Authorities might destroy however to the profits. S Sports basketball 2.28 2179.53 0.81485734995886139 +Favourably major feelings used to turn new, necessary years. Labour products go pr Sports basketball 7.28 256.36 0.09584489786121490 +Different organizations shall split; emotional, com Sports basketball 2.22 12749.88 4.76677697902460058 +Smooth years help more british, curious arms. Inter alia acute members must improve also in a years. Now regional Sports basketball 3.91 2159.38 0.80732390210465840 +Women may not represent very common muscles. More late stones smile again on the surveys. Topics must not find as variations. Economic boots Sports basketball 60.56 202.95 0.07587658769282869 +Heavy paintings s Sports basketball 4.08 4622.30 1.72813181223238268 +Huge, helpful heads think low policies. Absolute tons restore generally. Tradit Sports basketball 5.01 24011.93 8.97730136644032550 +White interests might Sports basketball 53.99 3630.36 1.35727681151287298 +Outstanding friends must reduce figures. Travellers Sports basketball 0.95 3994.52 1.49342472072312426 +Redundant, new writers draw sharp Sports basketball 4.80 9195.80 3.43801884752753924 +Clear members work national, personal operations. He Sports basketball 4.17 4072.64 1.52263131855788049 +Times remove other effects. Almost english conservatives can measure however new, normal r Sports basketball 7.65 1107.60 0.41409661753425504 +Now due eyes keep about. Then annual progr Sports basketball 0.83 3016.20 1.12766180733732398 +Addresses retain once more applicable events. Following blocks follow for a develo Sports basketball 70.89 268.59 0.10041730814691726 +Other, g Sports basketball 0.70 15012.84 5.61282616791528113 +Political aspects ought to say months. Of course Sports basketball 3.77 123.24 0.04607553913409317 +Fortunately favorite decisio Sports basketball 2.86 9079.28 3.39445570390611328 +Ancient, similar ways equip immediately. Never european leader Sports basketball 0.67 5371.94 2.00839850451152582 +No doubt established kinds ensure both comparative buildings. Threats attract almost traditional students; questions must not fight widely clean, minor relations. National, famous assets go commer Sports basketball 9.10 1401.61 0.52401765989724377 +Only social changes could achieve again soon go Sports basketball 9.05 4303.38 1.60889770852705168 +Early favorite contexts will save quite as empty pages. Unusual languages suffer soon actual cars; corporate businesses ought Sports basketball 54.80 7564.49 2.82812362077617992 +Recently free woods know Sports basketball 2.84 3637.05 1.35977799097414435 +Confidential members cannot modify either dirty organisations. Men might think increasingly failures. Internationa Sports basketball 1.70 6383.10 2.38643925549196761 +Old, poor pp. form seconds; bags know much; Sports basketball 9.50 5416.98 2.02523753634047386 +Comparatively unable miles show already; interesting drugs will not run parts. Yet political priests will run strangely left, d Sports basketball 4.52 1863.76 0.69680093165009314 +However comprehensive times ought to level even for a blacks. New employers see; far presidenti Sports basketball 4.48 4373.10 1.63496381197097391 +Areas expect. Organic, democratic resources would last previously. Cheap, residential fields cannot achieve seriously about Sports basketball 0.77 2524.50 0.94383072495957642 +Automatically competitive deaths jump wooden friends. Average, legal events know. Losses ought to cross. Conventional toys st Sports camping 4.38 8168.10 2.37504813353538829 +Only far tests take to a others. Appropriate comparisons will say fully musical personnel. Beautiful, administrative aspects get standards. Huge, sin Sports camping 1.74 11263.88 3.27521175920551774 +Cells give only serious walls; arrangemen Sports camping 0.18 151.45 0.04403729628970441 +Sorry eyes could shake obviously across a commentators; more other numbers may control schools. Children maintain. Powerful elements gather very then active opportun Sports camping 3.69 5210.19 1.51497313143383954 +A bit important Sports camping 3.97 2060.79 0.59921835471020101 +Straightforward deal Sports camping 4.48 14808.62 4.30592001704617007 +Whole services live since the wheels. Sports camping 2.26 8417.24 2.44749086709509087 +So-called, classical travellers contain capital, new paintings. Japanese stories Sports camping 6.17 18270.48 5.31252915889810863 +Financial, massive ideas might boil also leading companies. Even long Sports camping 9.92 4367.79 1.27002748340183563 +Groups should display of course possibly productive areas. Gro Sports camping 2.04 12234.96 3.55757384359644646 +However general jobs tell basic results. Issues lose critical husbands. Back, Sports camping 21.20 4822.68 1.40229638871199501 +Equal, different facts emphasise necessary inhabitants. Complex, active moves might put in a reports. Commercial groups can restrict curiously to a players; identical purposes cou Sports camping 8.94 13999.26 4.07058144903669396 +Always opposite skills take well in the prices. Colonial, weak issues shall deny more just respective funds; mental, creative patients would not play even in Sports camping 16.73 5674.31 1.64992585480113970 +Procedures find groups. Possible Sports camping 4.18 5862.76 1.70472168501437704 +Wild changes shall delay soon representatives; other countries die also legal, superb boys. Never video-taped sounds think substantially previous approa Sports camping 75.50 1678.45 0.48804489902577986 +Dear officers communicate much long interested relationships. Casualties position normal, good issues. Aspirations remind now quick words. Financial, l Sports camping 3.38 1526.49 0.44385930943064297 +Exceptions say richly normal losses; british, old individuals used to win. Childr Sports camping 4.27 4862.61 1.41390688221379690 +Then bad merch Sports camping 0.84 409.38 0.11903590858421386 +More fine pressures free there into the records; rights turn seconds; great areas ought to drain allegedly especially gothic dealers; programs speak even european, o Sports camping 2.25 4430.31 1.28820649802073507 +National systems must believe old issues. Long police would make able towns. Slow years earn exactly nearer the terms. Social, old comparisons shall survive wildly previous children Sports camping 2.12 4781.18 1.39022938444641077 +Well main goods share probably traditional times. Enorm Sports camping 5.17 3862.11 1.12299030949772389 +Terms reduce standards. Free things put Sports camping 2.60 1759.84 0.51171076594568109 +Players must argue away significantly national sides. Elections might Sports camping 3.53 14678.84 4.26818373238141050 +Labour, bright taxes could not shock still with a reasons. Dominant weapons will cause home; women say therefore bloody, complete areas; dem Sports camping 30.04 3575.90 1.03976868803138980 +Unable school Sports camping 2.63 9178.29 2.66878227905467845 +Still royal companies reach years. Complex, british plants must tell however such as a detectives. Ite Sports camping 6.35 8374.50 2.43506330655747472 +Just capitalist exceptions communicate Sports camping 7.91 397.64 0.11562225484739558 +Available tests forgive also policies. Almost local rights used to argue there new only men. Chi Sports camping 2.78 316.16 0.09193021852065332 +Never top observations spend appropriate, common states. Homes make. There available hospitals will appreciate away upon a years. Roots hang Sports camping 2.07 4784.91 1.39131396097437774 +Residents will l Sports camping 7.50 7103.96 2.06562688247083863 +Bold campaigns get with a numbers. Public, medical emotions recognize sources. Very single countries shall fit enough along with Sports camping 4.72 5615.05 1.63269475425225965 +Democrats may say again. There private services can think about fa Sports camping 1.65 18235.67 5.30240741387437400 +Different, ltd. students may not try scottish sheets. Almost likely schools may not order. Partly effective c Sports camping 3.91 11958.94 3.47731518052689077 +Certain, official generations might allow polish letters. Months provide equally product Sports camping 8.26 3715.04 1.08022659100761608 +Central, clear fingers must Sports camping 5.58 104.95 0.03051643608850761 +Always clinical doors Sports camping 33.45 2954.82 0.85917651913334019 +Available implications try only; magistrates must reduce quite black, ugly girls. Animals read. Chief pupils will manipulate easy more real seconds. Men might throw only british policies. Aspects ex Sports camping 6.42 12904.54 3.75226841506993789 +Affectionately sad chains answer sideways small, concerned documents. Interested minutes notice as a yards. Difficult c Sports camping 0.18 7683.32 2.23408807744213704 +Crucial sources make to a police. Great farmers make recent limitations. Yet indian colleagues should get. Mea Sports camping 7.95 1656.32 0.48161013265475868 +Good, white statements de Sports camping 8.79 4572.10 1.32943494464283601 +Conventional workers shall not take numbers. French, premier things could remember as to a gardens. Red districts ought to implement flowers. Fiscal, curious terms study much explicit words. Third Sports camping 3.61 5559.40 1.61651333768889187 +Fresh, electoral doors get at a teachers; children become more ministers; comfortable places shall not lift much safe, genuine procedures; official, extra beliefs break. Openly new days find ther Sports camping 1.27 4702.53 1.36736023057922522 +Much basic birds can light apparently. Normal, close teeth cannot expect as civil ends. Long principal conditions could not cover less more new officers. Efficient words get to a years. Real, able Sports camping 1.68 3665.26 1.06575200131265745 +Far specific clothes learn indeed times. Gastric, steady criteria imagine again in n Sports camping 50.85 6713.37 1.95205456449265676 +Grounds will take then by the boards. Historical candidates feel suitable numbers. Normally inevitable savings return systems. Psychological rooms would turn almost Sports camping 2.39 16931.42 4.92316909306983803 +Accounts listen firmly incredible trends. Votes must not exert away natural fears. Able terms reflect well golden others. British feet could not re Sports camping 8.64 12203.84 3.54852504425319390 +Labour patients shall Sports camping 2.75 7756.62 2.25540160545821715 +Powerful populations can produce honest lines; soviet, working-class feet w Sports camping 2.14 2940.02 0.85487310556392702 +Minutes can compete much mathematical areas; pages put for example more good passengers. Differences undertake to a parts. About conscious situations know light studies; mad, l Sports camping 1.46 2184.90 0.63530596674397594 +Visual, surprising parties earn resources. Particular, just situations can lose currently to a others. Social actors want loudly prime years. Fresh, other responsibilities obtain offices. Afraid t Sports camping 9.02 6215.95 1.80741916059417696 +Great explanations would not fill; sure, political powers let eventually horses. Continually public examples ask yet wrong, dependent officials. Early, g Sports camping 1.82 3966.35 1.15330029804337451 +Trustees could respond further precise surveys. Conditions would weigh. White areas secure particularly living costs. Strong, bare provisions can keep so useful, physical feet. Demanding, supreme Sports camping 4.48 9027.65 2.62498050742654327 +Just available years undertake social units. Alone long-term years communicate very huge workers. Relevant, false farmers start hardly bottom windows. Associations shall Sports camping 7.57 5611.89 1.63177591730095251 +Steps would make repeatedly short pairs. As good stages protect skills. Plants could not sweep observations. C Sports fishing 8.71 4424.59 1.05964726402462346 +Christ Sports fishing 9.05 1582.84 0.37907514038334286 +Almost personal matters may deal; major, australian offences happen prime, usual hours. Functions might visit at the followers. Championships shall smile observations; compani Sports fishing 2.61 1554.46 0.37227840004061759 +Accidentally wrong communities look more goods. Rural matters recognize. Large, new days go hap Sports fishing 1.32 4303.95 1.03075513030558269 +Problems ought to remove rapidly then new authorities. Half way exotic months bar systems. Front, new models cause too; difficult, full others comprehend eve Sports fishing 2.89 2105.84 0.50432867101214193 +Delightful, married guns should go much tremendous, clear networks. Again just hours shall know there. Large, whole years cannot want Sports fishing 9.33 2187.51 0.52388786001109799 +Very modern weeks must prevent hotly to a situations. Points look strongly regulations. Times take good groups. As af Sports fishing 68.83 2026.90 0.48542329107363830 +Members support general, mysterious programmes. Front times want with the services. Now new details should impose never cheap live activiti Sports fishing 4.96 11202.69 2.68293781078382606 +Tests shall see famous, good words; sexual, significant theo Sports fishing 8.63 11684.99 2.79844407813042221 +Personal, lacking artists cut pieces. Prices make quickly for a rooms. High, overall types ought to use together supposed women; reductions shall give prices. Lengthy, fundamental meas Sports fishing 9.23 13101.80 3.13775661107533389 +Other offices shall embark blindly resources. Spectacular copies may look also old, other offices. Properties fill better important others. Very wrong supplies will not own both aspects. Certainly Sports fishing 7.25 386.95 0.09267084833042791 +Sheets identify in a persons. Successful studies cannot solve for instance impressive governments; public buildings can move to a women. Substances sweep even on a tales; however great spac Sports fishing 4.50 5339.33 1.27871880247087137 +Inherent, public girls run. Opposite, similar players might adjust though central ties. Entirely small generations achieve rats. At all western boxes prosecute almost suspicious, ordinary v Sports fishing 0.46 2861.92 0.68540264699268189 +Difficult skills can tell specifically significant applicants. Irish women find si Sports fishing 8.65 0.00 0.00000000000000000 +Usually english commentators will indicate still dangerous, spiritu Sports fishing 9.90 13087.32 3.13428878865945433 +Early, associated parents continue stories. Alive, key costs will not supply. For example excellent wi Sports fishing 0.65 9375.15 2.24525934545809862 +Just left grounds would not shoot other, accessible readers. Long, true winners shall vary; male conditions must hear never local, clean studies. Major, generous pp. must not get always gre Sports fishing 3.62 8.19 0.00196142718135729 +Groups deserve also only members. Inevitable, rare dreams worry much old enquiries. Please clear nerves turn necessar Sports fishing 2.58 3603.80 0.86307585789687587 +Foreign advances expand never new, colonial players. Colours confess lines. Urgent, massive items sit then men. Different countries cut however. Effectively old ideas suggest only actually particul Sports fishing 4.19 20.28 0.00485686730621806 +Sole, public skills require long opportunities. Parents destroy how Sports fishing 4.84 1396.88 0.33453948731311060 +Courses try military parents. Fast, w Sports fishing 1.64 6454.18 1.54571478453878082 +New parties strengthen please at all current things. Similar teams must lead most real firms. Simply tiny planes will set moving advantages. Concerned, average memories use Sports fishing 2.13 5552.34 1.32973267352104439 +International, new heads succeed altogether. Inc men see about accord Sports fishing 4.11 4917.54 1.17770410517847910 +Illegal campaigns ought to become here western, certain abilities. Indirect teachers would not tend no longer long, main agreements. Twice sweet patients ought to enjoy Sports fishing 0.33 2469.18 0.59134514867689882 +Common, preliminary children will not maintain early further international Sports fishing 3.67 4265.38 1.02151798178483168 +Northern, de Sports fishing 15.22 1489.04 0.35661093163959266 +Unable occasions command more effective, other birds. Proper songs know in a ports. Later wealthy details look now hours. Aware, black issues Sports fishing 0.59 4257.58 1.01964995589782473 +Points can appoint even pregnant ideas. Other, basic bodies shall frighten too modern laws; features accompa Sports fishing 1.97 15202.78 3.64092135826557149 +Home available features need with a questions. Hard waters can operate still more content bands. Organic, large ideas contribute points. Difficult, right produc Sports fishing 2.47 7589.73 1.81766821992220870 +Collective, full signals will assume only services. Political villages think children. So old Sports fishing 2.56 2552.33 0.61125878361338953 +Industrial, slight needs would disturb too for a folk. Now known buildings ought to suggest so. Papers create colours. Good levels tell into a r Sports fishing 2.72 5261.10 1.25998346078618504 +Norma Sports fishing 1.01 8662.39 2.07456009786539724 +Onwards horizontal sports find. Normal, powerful eyes come american, commercial situations. Major, enormo Sports fishing 1.89 13071.78 3.13056710631534049 +Shoes give more now annual ch Sports fishing 1.18 6235.99 1.49346035270723652 +As modern women may find only with a bones. However simple minutes end changes. Catholic hands provide hard able rights. Weeks used to affect then tiny c Sports fishing 2.55 3728.50 0.89294032303915358 +Strong, southern weeks use to a exceptions. Shoulders write natural, particular courses. Cold, labour things will hang. New authorities may bu Sports fishing 1.08 5888.16 1.41015837267164344 +Automatically private stands go always easy terms. Well distinctive depar Sports fishing 1.17 5365.88 1.28507727520164501 +Internatio Sports fishing 1.86 8437.51 2.02070347459999698 +Apparent, Sports fishing 7.13 2649.10 0.63443427913719237 +Special, easy things invest here hot Sports fishing 4.61 8905.67 2.13282334630014721 +Leaves could not help accounts; maximum, supreme expenses may not build in a officers; r Sports fishing 0.44 13341.40 3.19513853447621392 +Still original workers solve merely villages. Only long years punish already. Scottish features should not take from th Sports fishing 4.81 3.50 0.00083821674416978 +Settlements must make significa Sports fishing 7.42 7154.29 1.71338447732755427 +Shortly new terms would recover yet satisfactory, previou Sports fishing 2.86 3393.96 0.81282117172642234 +Public, certain lives could not choose indeed in a tools. Then bad things gain women. Sports fishing 2.62 392.55 0.09401199512109957 +Circumstances cannot take lines. Modern goods would make corresponding tools. Subsequently toxic practices see annually alm Sports fishing 3.56 12846.92 3.07671527285990692 +Also normal groups must not keep possibly others. Rates will not depend centuries. Fields could indicate already in a months; important arti Sports fishing 64.57 16106.48 3.85734892161020958 +Crops shall argue already for the responses. Easy committees like as with a figures. Easy current groups should not meet nevertheless; evident, international forces sen Sports fishing 6.00 1274.25 0.30517076750238473 +Elements take further vital, typical Sports fishing 1.73 6796.42 1.62767801268868558 +Good, silent examples close so literary, financial years. Often foreign interests discourage best suddenly whi Sports fishing 4.19 4776.06 1.14382098947415311 +Projects support indeed in a departments. Populations involve even with a terms; fine, classical miles visit continuously crucial, great days. Steady, sc Sports fishing 0.68 7528.93 1.80310719762348789 +Directions use none the less. Military, new recordings pass yellow tasks. Frequently wor Sports fishing 1.49 1880.44 0.45034751268760788 +Poor networks explain personally to a funds. Already federal words accelerate companie Sports fishing 2.01 7024.79 1.68237045779327228 +Sectors might not know properly. Large, electric workers used to drop even as ca Sports fishing 6.89 1774.46 0.42496630967414683 +Old others will cut other activities. Sharp passages avoid allegedly orthodox, additional firms. High officers must form. Sports fishing 0.25 2612.13 0.62558031541377612 +Very acids should depend much a little christian tons. Warm rules defeat at large details. Banks should not seek then. Times can back stiffly ordinary, chemical Sports fishing 6.07 10778.84 2.58142976306486528 +Factors might assist now absent, voluntary demands; political companies might know no longer concerned things; autonomous, possible events can dry at Sports fishing 6.68 6637.53 1.58962536740836076 +Pale, other animals assist in a words. Is Sports fishing 3.40 1226.34 0.29369677772719206 +Necessary women know little international troops. Immediate, possible drugs can try effectively too gentle spots. Northern, german ideas tell to a areas. False appropriat Sports fishing 2.18 505.79 0.12113189915246708 +Western, social things will go in order. Warm, male cards used to describe. High, briti Sports fishing 0.51 2346.30 0.56191655624158939 +Different, common buildings could not comply even. Impossible transactions build always qualities. Police move tiles. Options must use just different stages; words Sports fishing 8.87 4167.10 0.99798085560854416 +Members like very. Then interested principles could remember yet important, new agents. Necessarily due assets generate across. Areas give anyway as social projects. Main, Sports fishing 1.79 7991.56 1.91390268686784986 +Blind sessions hurt traditionally public, various clothes. High, southern schools might not tal Sports fishing 1.43 1122.60 0.26885203342999968 +Practical roads mean either dishes. Necessary issues determine simply fund Sports fishing 3.40 4810.52 1.15207383204675046 +Just formal teams ask still, certain interests. Well l Sports fishing 9.79 2218.77 0.53137433298902583 +Books must work major, able forces. Clearly future teachers would measure certain, direct measures. Hard tears go main nurses. Cruel patients used to leave much only days. Yet social defence Sports fishing 8.56 1810.80 0.43366939438361253 +Comprehensive, able acts must not resign. British, red forces convict perhaps; years want as well problems Sports fishing 54.91 119.66 0.02865743303067322 +New companies must benefit always to a companies; adults might get yet international, comfortable indicators. Dual bones shall find ever like parents. Wars need new, heavy purposes Sports fishing 3.43 7734.29 1.85228896636140409 +Backs think now back, british wines. Very fine shows get often serious, fatal prisoners. Good terms ought to come far easy, obvious shoulders. Machines play more ac Sports fishing 2.94 7583.99 1.81629354446177025 +Tiny values allow equations. Sports fishing 4.39 7729.84 1.85122323364381680 +Ill, simple objects shall bear solid trees. Ears should use there minimum, inappropriate personnel. Available practices should not apply increasingly pr Sports fishing 7.87 15557.69 3.72591893102937088 +Sure reliable suppliers show upright other women. Maybe Sports fishing 1.11 12392.70 2.96793389870653577 +Much common times achieve existing, continuing positions. Los Sports fishing 8.20 9965.46 2.38663298152977430 +Good, whole facilities maintain for a points. More worthwhile directors battle annual hours. Yes Sports fishing 8.90 603.00 0.14441277049553697 +Rules offer. Important, italian goo Sports fishing 4.06 3150.39 0.75448847104715544 +Vital, similar activities change thickly. Seats would sit essentially brilliant words. Hig Sports fishing 68.38 6302.32 1.50934575746174558 +Even useless times make old, old studies. Early public employees must open together warm consequences. Sufficient, evident men would operate stars. Various, other sections control l Sports fishing 89.62 2679.48 0.64171000047658609 +A Sports fitness 7.12 10468.61 4.22441966945963305 +Fast bizarre situations fulfil all as political plans. Thus labour conventions run more part-time experiments. Early considerable own Sports fitness 0.81 5713.17 2.30544721056249987 +Other, cultural differences might take. Musical branches take only new defences. Sports fitness 3.76 18567.33 7.49251276543379958 +Increased machines claim Sports fitness 1.76 2327.22 0.93910786084875139 +New parties survive Sports fitness 1.06 5055.94 2.04023384036732070 +Abruptly real years cope together; significant accounts provide at a others. Twice competent languages cannot impose most protests. Identical leaders Sports fitness 3.76 11311.78 4.56466578930728034 +Clinical, real figures figure effects. Full, pleased bacteria used to fit immediately more main things. Windows will not present perhaps Sports fitness 4.25 1715.39 0.69221484579083182 +Concerned clothes comment less small probl Sports fitness 0.73 1855.00 0.74855195549816254 +Large, working matters oppose etc far remote aspects; today amer Sports fitness 3.52 11563.15 4.66610164108818229 +Physical questions confirm much to the marks. Irish, pleased eyes would know in an subsi Sports fitness 2.86 8639.15 3.48617392255630775 +Little, national services will buy young molecules. In part video-taped activities join now Sports fitness 5.91 408.38 0.16479441918401058 +Intelligent trends used to bother open. Bedrooms will not hit all senior, economic boys; objects would sum. Often blue times should deal in a Sports fitness 3.84 1925.10 0.77683955230701493 +Absolutely wild standards impose only so scottish schools. New, complex incomes can establish children. Certainly free groups will rest. Impressive teeth must go front s Sports fitness 4.00 2927.91 1.18150552885316716 +Policies think races. Loc Sports fitness 40.32 1793.89 0.72389211183212873 +Shares could release barely months. Aware writings used to use so very impossible authorities. Sports fitness 6.66 3449.47 1.39197170562385268 +Boys might not fill in a problems. Military, young ways will encourage somehow inner, large matters. Ways will begin today whole firm Sports fitness 3.62 2731.00 1.10204603259594711 +Corporate heroes examine forth technical, formal shares; buildings may not emphasize abo Sports fitness 68.11 4428.60 1.78708204319092324 +Below old resources could cover lo Sports fitness 2.86 2908.84 1.17381017263141516 +Running children may continue common, small wives; great, subtle teams shall change bad, good lines; others may want; parties used to like near a sty Sports fitness 2.32 2591.76 1.04585822974766455 +Labour, dominant dreams come. Please various symptoms cannot persuade so owners. Primary colours would argue once small posts. Live, asia Sports fitness 48.03 4332.46 1.74828647176149287 +Deep, light measures could ask around experimental sections. Days attend social, wise cases. Children should find; as Sports fitness 3.91 12590.50 5.08067029417769025 +Times force also years. Emotional solutions ought to allow elderly differences. Too urban parents shall accommodate so. Traditional, effective im Sports fitness 3.60 8417.45 3.39671086674286159 +Principal eyes should pay frequently relevant areas. Light police m Sports fitness 3.17 451.78 0.18230771021830721 +Original hands know as. So prime things might not identify. Less than little journals let very hard things; nurses see; large bodies name once political, national c Sports fitness 6.83 1540.63 0.62169358447392677 +Methods develop warm males. Governments depend please with the hospitals. At random tory weaknesses enter approximately simply young me Sports fitness 6.01 24.98 0.01008023064600760 +Also new activities would not drop immediately fina Sports fitness 6.42 9171.55 3.70101438676505262 +Beings should affect close projects. In common labour metres might call directly Sports fitness 2.85 837.90 0.33811950593633983 +Men could not escape so old victims. Tiny horses give together effective teeth; little, beneficial bones used to forget again days. Of course Sports fitness 71.90 2421.19 0.97702776772646693 +Regions see in the cop Sports fitness 1.90 8595.06 3.46838219440648889 +Asleep, fat topics pick into a rul Sports fitness 2.70 3452.62 1.39324283158601937 +Conscious, central results play above about the hands. Stages stay so available universities. Tomorrow professional birds decide; enthusiastically big views appear new window Sports fitness 9.62 412.47 0.16644486527456987 +Please positive sys Sports fitness 0.31 4494.44 1.81365059346046449 +Simply necessary girls could not take supreme hospitals. Issues ought to Sports fitness 93.50 342.93 0.13838324641454710 +Overseas campaigns must finance just. Researchers believe sure, positive days. Workers appear from a values. Periods can lift ago related, extens Sports fitness 8.92 691.02 0.27884871821473869 +Regular, gold effects take gently for a terms. Good, strong difficulties attract articles. Ultimate farmers develop Sports fitness 1.12 3313.24 1.33699853425052940 +Round prisoners go at all into a lives. Streets find again places. Kindly liable men offer plainly on a contents. Early accurate regions should no Sports fitness 4.49 3281.89 1.32434780443658472 +More Sports fitness 0.82 1089.45 0.43962799348650845 +Solid, romantic feet would come so equations. Only economic feet will n Sports fitness 0.36 6592.06 2.66010749528906595 +Only subjects think for a goods. Windows wo Sports fitness 3.66 9334.78 3.76688292352837611 +Special miles must ease under across a conditions. Points might continue australian, australian places. Entirely Sports fitness 3.17 0.00 0.00000000000000000 +Men mean also weapons. Individual proposals ought to mean farmers. Sometimes valuable eyes might take rights. Rough, different rewards cost real, alone ministers. Requirements may no Sports fitness 64.89 3913.00 1.57902091744706739 +Together working cases used to buy in a structures. Millions must Sports fitness 1.88 3472.20 1.40114398915402693 +Sure, coming sessions could not pass very. Concerned children pick on a individuals. Easy pairs shall return. Reports consider subsequently rough sites. Vital, normal w Sports fitness 2.27 5967.84 2.40821471811329074 +Girls move ways. Other, human actors should participate serious families. New di Sports fitness 4.79 10717.00 4.32465299572712017 +Quick reasons could set only distant a Sports fitness 1.29 968.12 0.39066744968025936 +So close miles would seem american, emotional horses. Other, alive operations ought to want further red layers. Parameters might faint bad, significant stations. So prime newspapers wou Sports fitness 2.97 9281.14 3.74523746428690903 +Royal speeches take evil, front margins. For example hard events ought to go angles. Possible, foreign lakes shall not reconsider. Other honours hear momen Sports fitness 8.13 0.00 0.00000000000000000 +Points force into the symptoms. Local, strong negotiations get examples. For the time being fat result Sports fitness 5.61 19543.75 7.88652953114135530 +Subject, dead qualifications benefit more real nurses. Up to special writers give most responses; social circumstances de Sports fitness 2.69 12178.65 4.91447561877503891 +Just ready clothes try live skills. Girls investigate up Sports football 1.80 3028.92 1.26615656780156976 +Mostly furious applications cut in a workers; successful, substantia Sports football 3.20 4690.04 1.96054202463322710 +Dynamic, technical problems cannot go important, general sources. Overall inevitable subjects may take. Recent ends would n Sports football 2.51 10300.92 4.30601584472305176 +Allowances might lay at best children. Academic sections burst hot times. Short-term, warm goods Sports football 4.96 652.80 0.27288505720219244 +Sophisticated, unfair questions may remove separate premises. Typical patterns intervene typically walls. Naked areas ought to return now military, necessary children; young met Sports football 33.19 7921.58 3.31139830182558766 +Only available cars could not allow during a films. Cuts might not grow also unfortunately poor names. Windows go at first so key effects. Leading, possible relationships used to rec Sports football 1.80 5455.78 2.28063853765713464 +Pupils talk tonight even expected rights. However federal costs may not borrow large decisions. Social, american soldiers repair legal, economi Sports football 11.06 1681.47 0.70289221374658476 +British components must go. Wrong, overseas jobs explain with a towns. Quite ideological habits may Sports football 0.63 8173.32 3.41663127409899441 +Girls would face criminal, special offenders. Healthy principles get very greek, ade Sports football 1.47 435.76 0.18215746404170861 +Delicate readers gain too able officers. Feet see as international appearances; just prominent samples halt just. Substantia Sports football 94.83 12471.06 5.21318309049015641 +Daily, level areas fetch known, other Sports football 69.68 818.79 0.34227260414611390 +More reasonable opp Sports football 3.70 3418.34 1.42894287137950754 +Awful eyes get now like a gentlemen. Final countries may become french, turkish sciences. French lives repeat great, big standards. Large, able roads cl Sports football 6.18 5009.22 2.09396643112494858 +Thanks may add suddenly strong weeks. Times abandon as files. Systems feel cheap targets. Green, formal events understand french, rea Sports football 0.97 2280.64 0.95335872680393409 +Miserable officers introduce clearly. Much mathematical eyes could change so before prominent plans. Prices i Sports football 4.67 20055.07 8.38346955291662626 +Else social offenders will not support mines. Gently intelligent expressions speed days. Sometimes old houses offer really important, local month Sports football 2.19 15388.53 6.43275105592471583 +Critics can cover only str Sports football 1.79 10295.54 4.30376688392686948 +Sources negotiate never books. Sports football 12.71 1473.07 0.61577633457848288 +Young, previous metals keep here due, equal churches. Strong temperatures avoid. Established, average children could help also technical aspects. Feelings navigate now weekl Sports football 1.45 8988.48 3.75738645674136449 +White, vital departments should become aga Sports football 2.88 4166.35 1.74162784631488126 +Daily, marked years may not save players. Then hot families please universally always parental opportunities. Closely medic Sports football 3.21 1605.80 0.67126045474154508 +Popular, strong farms worry certainly followers. New documents will argue considerably under a men. Catholic, exist Sports football 0.10 1110.81 0.46434352081919024 +Clearly great options cannot believe. Responsible products ought to condemn at a systems. Dull types assure; real ser Sports football 3.03 8226.16 3.43871958050610814 +Succ Sports football 4.47 9246.93 3.86542435967320677 +Almost busy threats go together recent sides; still tired wines shall not admit on a Sports football 3.88 7510.88 3.13971648045159802 +Economic, crude hands put available payments; irish months pay main, tropical members. Neither soft syste Sports football 4.23 2877.00 1.20265059676885365 +International, profitable schools sit rather di Sports football 81.85 205.56 0.08592869540208744 +Young features may seem actually for the plans. Unduly Sports football 9.86 3012.65 1.25935534249415605 +Standards must pa Sports football 3.63 836.01 0.34947095078370849 +Very aspects use then. Popular, weste Sports football 6.30 1501.17 0.62752276550278069 +Models may register still digital, professional birds. There necessary things can fail never irish forces. All corporate readers identify more Sports football 68.59 9190.37 3.84178100974159524 +Again sexual officials shall not Sports football 7.81 11678.56 4.88190029662873252 +Ages must answer even such as a citizens. Fatal candidates say also. Thus great friends create normally Sports football 19.60 1325.80 0.55421416795138901 +Successive, joint Sports football 4.67 4363.92 1.82421654231892103 +Democrats take before. Joint years woul Sports football 65.80 7674.39 3.20806733171252094 +Hours take so. Now new things want common, recent drugs. Ships will st Sports football 3.32 1013.26 0.42356543054640551 +Quiet, small objectives should stay as matches. In particular formal students allow then. Professional, other demands drop Sports football 1.58 2487.00 1.03962184016827912 +Super stars might like approximately stories. Major practices might allow more fresh decisions. Advanced organisations wield. Towns must not protect quickly. Active, righ Sports football 4.05 6655.69 2.78222785902276383 +Cheaply financial tales allow unfortunately safe, red meals. Who Sports football 2.91 5952.36 2.48822012727947644 +Hard figures will not help twice central principles. Collective, impor Sports football 2.33 468.64 0.19590204229049551 +Advanced, foreign stories would greet always corporate games. Recent dev Sports football 3.00 634.63 0.26528958923441696 +Very questions make secret stocks. Aggressive, major years qualify for example senio Sports football 4.39 292.60 0.12231336969571310 +Matters reserve more proper, concerned birds. True months result together more chemical columns. Social views reduce in a affairs. Medieval, serious sports may n Sports football 0.16 7175.77 2.99963297628642230 +Proud things mus Sports football 28.70 17469.96 7.30283552990198210 +Unacceptable flowers should not give reasonable, ethnic governments. Employees shall complain Sports golf 8.39 4100.46 1.45417454300510042 +Crucial products would carry silently double groups. Really full systems run usual structures. Financial departments must meet well c Sports golf 1.50 12212.90 4.33114535351326216 +Different hours must not know towards a weapons. Facilities shall not know items. Today established fl Sports golf 5.73 437.77 0.15524940852766344 +Educational terms must apply automatic, other objectives. Indeed financial sources pass very unacceptabl Sports golf 6.99 16143.50 5.72508126771211978 +More black mothers shall repea Sports golf 14.90 7660.56 2.71671747490846200 +Admini Sports golf 9.35 2840.01 1.00717242550345943 +Separate, rapid bodies will start too religious surveys. Geographical, loyal things involve in order. Notes need dead for a members; at last economic managers look once more nervous skills; joint Sports golf 6.57 2341.31 0.83031498887521685 +European quantities would wait Sports golf 0.73 9236.58 3.27563236818065546 +Wet, suitable projects shall follow voluntarily all of a sudden resulting negotiations. High, video-taped services should not take all full eyes; wrong representatives follow royal, full figures. Fre Sports golf 3.35 7298.73 2.58839919478975935 +Good, interior faces contribute with a rights. Social, certain versions pick furiously between a troops. Forward political countries bec Sports golf 7.89 4757.12 1.68705042898124194 +Great, new errors w Sports golf 3.21 791.01 0.28052135742391451 +Stairs say long words. Newspapers will go exceedingly. Other, empty numbers must not provide therefore environmental months. Entirely bare groups buy. New days Sports golf 20.77 1505.63 0.53395199982069557 +Labour parties worry far well clear files. Finally domestic generations would not announce too; continuous, possible patterns might conceal Sports golf 4.32 2152.66 0.76341273216794201 +Live processes review home at pres Sports golf 2.74 4204.30 1.49100004174076658 +Judicial models should not pick. Close dogs can refuse exactly. European, r Sports golf 5.70 6536.36 2.31803463902021193 +Pages could watch fundamental, literary components. Financial, royal elements should overcome environmental trustees. Shared areas Sports golf 3.07 4544.08 1.61149857756900853 +Demands could treat lines. Conditions suck studies. Documents could not hide local things; gold calls see together. Preferences may refuse indeed in a pieces. Old, unknown boys emerge more opposite, Sports golf 2.87 625.67 0.22188568753798383 +New sources play just. English groups evaluate here indian changes. Familiar, able authorities get direct important, emotional orde Sports golf 6.52 7170.18 2.54281061753176740 +Most angry years help intimate conditions. By far urgent police would agree Sports golf 1.81 13747.41 4.87533926785135024 +Then growing levels light sometimes human, fellow cities. Users may derive odd championships. Stages support right Sports golf 8.86 5586.76 1.98127141098295675 +Brown customers can detect too. Then human numbers cannot prepare never victorian long accountants; interests share open in the years. Full-time, underlying Sports golf 92.44 6716.33 2.38185864718140065 +Secondary, normal Sports golf 6.04 7486.01 2.65481559890393074 +Wishes might behave environmental regions. Statements conflict now nuclear Sports golf 7.46 16077.73 5.70175679687386128 +Horses say. Other peasants can keep at first large kilometres. Necessarily new miles separate for an poems; interestingly indian teeth used to make further. Sports golf 3.40 752.00 0.26668697081299062 +Russians receive then definit Sports golf 8.76 20347.14 7.21584724907956645 +Independent, scientific subsidies might contain. Here certain instructions shall not imagine exhibitions. Either other attitudes buy finally. Public, right p Sports golf 4.05 198.74 0.07048054332363531 +Married professionals clarify plans. All basic children could prove more religious big trees. Sports golf 4.01 7501.44 2.66028764672260686 +Roles shall not remember primary, inc years. Young feelings can s Sports golf 5.74 3892.36 1.38037459802347363 +Particular, complete artists belong much enough active cheeks; profits may see able, complete processes. Here available officials take aside at a eyebrows. Sports golf 4.07 10080.46 3.57490338005521200 +Poles decide over for a managers. Properly other views include slim functions. Bright, other minutes should talk exactly certain weeks. Sports golf 6.56 1356.03 0.48089831520151552 +Inevitably dead trees establish original, primary events. Other women ought to issue almost long medical achievements. Catholic, hard cars need here difficult humans. Great, Sports golf 0.80 5928.82 2.10257851900994022 +Strong changes stay. Future claims will not recoup fo Sports golf 2.23 9989.59 3.54267752229221140 +Impressive records lie easy origins. Social schools shall bend else different details. Novel chemicals present primarily by a bags. Molecules shall see repeated Sports golf 3.63 4279.32 1.51760490417479657 +Also major pieces resign never. Substan Sports golf 4.63 55.04 0.01951921658716357 +Assets may not engage heavily always formal groups. Local, genetic offices cannot keep still sad, annual troops; supreme, natural gaps can see. Nearl Sports golf 7.20 4005.33 1.42043793192339857 +So overall investor Sports golf 2.54 15395.25 5.45972418538390139 +Brothers appoint even. Sports golf 3.65 3103.75 1.10070436922981335 +Closely substantial instructions wait for a companies; members may bring then characters; recent views should indicate near early days; objectives could not arrive categories. High gains speak Sports golf 7.73 77.67 0.02754465029660237 +Neighbours shall send important, excellent games. Plain important ways note monthly, japanese figures; routinely Sports golf 4.81 616.44 0.21861238868079779 +Certainly persistent players move often respective minutes; amer Sports golf 7.78 74.48 0.02641335849222279 +Impossible, natural cases may wait then products. Political sectors go here sure consultants. Me Sports golf 2.14 2979.66 1.05669747267637717 +Classical, small perceptions finance again ideas. Obligations determine. Clear, useful crowds could take thus formal, genetic individuals. Int Sports golf 0.68 14169.23 5.02493221735711581 +Forward working birds ought to try already then public pounds. Black, similar hands cover still at a rights. Right contracts save for example general, able feet. Systems could not t Sports golf 8.61 291.36 0.10332701571286296 +Young, severe parts must not act therefore rath Sports golf 2.17 1012.25 0.35898123165618319 +Only concerned times used to know however in the trees. Developers might not wear in the times. Studies see far variations. Calculations must not transport hardl Sports golf 0.15 8494.93 3.01261588958563618 +Sales include easier from the times. Significant, young features should not keep hardly social Sports golf 4.30 403.10 0.14295414618978261 +Likely, exciting negotiations disrupt even communications; all normal girls may think about years; allegedly old hands end darkly musical years. Individual, similar Sports golf 4.26 9885.12 3.50562860229110351 +Basic differences stem Sports golf 0.88 12915.95 4.58047284663835931 +Continental issues need famous areas. Thus christian years shall agree just foreign negotiations. Sensitive centres may not assess large remains. Men eat from the ideas. Other, specific plants say Sports guns 0.19 6159.12 2.82446517920513238 +Revolutionary son Sports guns 4.83 7287.25 3.34180595233776919 +Businesses may keep also behind a workers. Early, previous objectives hit wet, bottom requests. Under true hours touch similar, long sources. Widely able attitudes must appear now politica Sports guns 2.73 6762.87 3.10133441571052580 +Occasional, biological questions make usually for a tools; parts will use between a machines. Languages swim alive commitments. Other russians shall finish b Sports guns 4.12 2865.32 1.31398585630415545 +Again dull trials ensure suddenly; communities should produce terms. Too extra notes might choose properly social, absolute talks Sports guns 6.99 8342.32 3.82564268171208874 +Only other packages shall not lift procedures. Available, only types result obviously rough parts. Deep, back boundaries assert english, blue police; findings will declare restaurants. Little, daily s Sports guns 2.81 10686.60 4.90068866722739088 +Complicated, right projects forget naturally british, true weapons. Employers step also as continuous tickets. Ev Sports guns 5.02 8567.83 3.92905764075860015 +Then vague profits used to buy tonnes. I Sports guns 0.44 2445.30 1.12137199838780706 +NULL Sports guns 8.03 272.49 0.12495916895296837 +Vital, possible communications go yet operational effects; Sports guns 1.48 11987.62 5.49731378371310009 +Now good properties see quite mere exceptions; long publications ought to make alone facilities. Certa Sports guns 4.20 3874.40 1.77673237253249895 +Negative patients may not get for a eyes. Past little questions perform highly only, afraid acts. Again co Sports guns 1.13 5931.38 2.72002758099107309 +Differences imagine up a feet. Tender methods shall complet Sports guns 93.05 1128.12 0.51733618730677336 +Annual communications use enough in a standards; only famous conservatives used to kill new, public children. Men dance so examples. Christian patients shall cause as busy te Sports guns 2.43 22127.23 10.14716236203600213 +Courts define so. Appropriate tables surprise well to a agreemen Sports guns 7.17 131.70 0.06039532662154917 +Examples should not monitor firms. Fo Sports guns 3.84 535.99 0.24579568045470114 +New years can lend elements. Other, typical figures return under a flowers. Due, following others used to reject in full strong, lik Sports guns 0.78 4193.11 1.92288722862630256 +Other aspects might appear quite good Sports guns 0.21 5214.14 2.39111380676146088 +Strong chips meet to a connections; necessary, suprem Sports guns 2.74 4156.55 1.90612144926955361 +Artistic children can stay significant Sports guns 5.71 4613.16 2.11551484402024129 +Old ideas must withdraw holy pensioners. Additional bo Sports guns 7.83 1028.06 0.47145041371715901 +High, capital clothes can show. Prob Sports guns 28.98 231.55 0.10618479786803121 +Settlements relocate colleagues. Well Sports guns 0.15 9689.92 4.44362857506971716 +Major, late transactions ought to determine interested, industrial group Sports guns 3.27 2963.68 1.35909203949698443 +Films exclude british, young members; spots decide other, poor agents. Black, Sports guns 7.63 834.49 0.38268258247848571 +Badly heavy reports shall keep there important, given women. Vice versa pure plants reliev Sports guns 2.78 1558.80 0.71483853559355238 +Upwards new instructions help enough firms. Funds see then. Mines might play girls; odd difficulties bid complaints. Others go slightly at a fees. Empty awards find necessarily fi Sports guns 5.31 4316.40 1.97942587569669586 +Political, appointed actors might not take formal resources. Possibly new programmes might not use in a waves. Racial, suspicious reader Sports guns 1.08 15990.81 7.33310700754088619 +Golden, royal counties work then jobs. Patterns would take efficiently compl Sports guns 42.09 2480.64 1.13757830698921593 +Girls help diverse, clear workers. Classes improve no longer Sports guns 3.07 147.44 0.06761341653060903 +Social, large demands may attend subsequent, french sales. Small, able others will react in a principles. Enormous procedures could not move terms. Important members take so Sports guns 6.84 266.10 0.12202882622622805 +Wooden, english birds say so to a states; key, video-taped trends check largely ago fast ways. Urban patients promote and so on political minu Sports guns 7.33 4309.42 1.97622496924401239 +Alone, fortunate minutes can put particularly out of a consequences. Darling costs run already in a laws. Molecules discover. Temporary, political ty Sports guns 5.47 1876.47 0.86051646579755789 +Good definitions deliver a bit international childre Sports guns 4.27 10401.45 4.76992384273130321 +Suggestions go instead reasonable figures. More fat practices imagine Sports guns 1.92 7358.08 3.37428735692853857 +However old days hold perhaps new, gentle bones. Rules achieve also. Fine, vocational proble Sports guns 7.68 1967.40 0.90221538037384845 +Chips ought to finish. Bottles may not clear. Right, white wives used to accommodate about a words. Courts choose well new, future rewards. Permanent tourists serve ahead polit Sports guns 5.55 2717.44 1.24617066343555491 +Cold clients see lengthy, only spirits; numbers must not want once again tall leads; once naked lads make. Minutes lose front expenses. Probably alive p Sports guns 0.47 3757.58 1.72316075479575351 +Right, vital dreams vary most; documents Sports guns 4.18 2652.80 1.21652788505425697 +Directly essential organisations introduce onwards atomic words. Much famous steps ma Sports guns 62.90 380.00 0.17426138281084803 +Today keen pages wil Sports guns 8.17 1181.16 0.54165940768647699 +Possible roots must reveal at least upper, previous populations. So gr Sports guns 3.01 21554.07 9.88432116684688198 +Unusually global cattle shall tempt great prices. Worlds would not sign certainly deposits. Contributions predict als Sports guns 4.06 1782.00 0.81719416886560838 +In full possible products bear to a components. Lovely boards help alongside at the possibilities. True, dry papers should disagree into a c Sports guns 0.52 763.63 0.35018742041012600 +Resources go in a records. Permanent, flat applications would work Sports guns 7.43 571.34 0.26200657488197345 +Negative in Sports hockey 1.63 5985.40 2.60825063748619267 +Modern facilities see; certain procedures lure for a features. Still dependent companies put little persons; procedures find to a employers. Public boards know almost also tory considerations. Sports hockey 8.87 6280.74 2.73695059793581544 +Contracts will improve just by a services. Strange, educational passengers resist only english days. Difficulties should debate then impressive, linguistic applications; fine, new eyes build; roya Sports hockey 6.73 11482.83 5.00385916858448520 +Following parts treat perhaps appearances. Coming studies perform loudly so professional streets. Lesser, elderly years wear equ Sports hockey 2.07 8396.19 3.65879772779683831 +Girls would not enhance here inner authorities. Commercial others might not think normally problems. Loudly bright peasants see yellow candidates. Comfortable sessions may Sports hockey 5.75 3982.08 1.73526626433003944 +Depen Sports hockey 3.19 1800.84 0.78474990443589989 +Then sophisticated numbers might not facilitate alway Sports hockey 1.14 1035.30 0.45115144935834786 +Speakers get more with a Sports hockey 37.55 4112.16 1.79195107118074348 +Public, available symptoms take somewhat in a minutes; nerves seem. Curious, certain islands contact again vital respects; mass rules might recognise primary, Sports hockey 8.68 334.35 0.14569930174148904 +Foreign children increase about so tall leaders. Available, domestic telecommunications mess subsequently primary characteristics. Cities risk businesses. Elegant views cannot use f Sports hockey 7.88 2922.03 1.27332953691545754 +All british ways trap stages. Accidents welcom Sports hockey 3.21 4828.96 2.10431015444169561 +Much catholic guests invite highest problems. Long men must assume maps. Passive applications want independen Sports hockey 5.63 10772.75 4.69442845172910449 +Eyes must increase roughly. Services should love now senior, rapid sales. Sports hockey 0.88 9712.50 4.23240457055245201 +International places Sports hockey 7.18 5185.35 2.25961380076336237 +Reasonable laws shall pay significant boys. Widespread operations would not run then words. Substantial paintings make stil Sports hockey 0.88 10680.29 4.65413726752387621 +Military, special factors may adopt often young names. Actually large-scale workers make here advantages. Precious, odd customers study in the careers; usual women win then firms. S Sports hockey 3.48 7195.62 3.13562676715146818 +Parts work only windows. Positive, vital eyes could happen without a minds; common payments must not investigate only important seeds. Here different Sports hockey 8.94 1422.63 0.61993778267233306 +Colleagues come so; great places finish only large years. Regulations would know genuinely most other services. Opi Sports hockey 9.08 3086.02 1.34479126412522810 +Main months answer weapons. Little, norma Sports hockey 1.15 619.92 0.27014180091396407 +Workers ought to widen late, close benefits. Final eyes restore yesterday high, public funds. Quickly educational days go perhap Sports hockey 3.55 11162.51 4.86427370325224722 +Then suspicious authorities can advertise perhaps important massive mammals. Easy lawyers will put. Respectively responsible pounds might acknowledge ti Sports hockey 4.00 4553.02 1.98406410891291892 +Flights might work bits. Appropriate powers ought to lie just very parental pounds Sports hockey 3.03 1200.96 0.52334091048140775 +Little hearts must not get here. Best professional hospitals achieve there foreign shoulders. Women should not forestall certainly able deals. Projects sound years. Facilities shall find dry, Sports hockey 47.20 1750.77 0.76293096010153065 +As able participants arise. As red years must make often versus a models. Alone techni Sports hockey 0.13 10294.75 4.48613096038042269 +Small regions allow so new deaths; slowly late attacks would install automatically acc Sports hockey 5.69 12283.72 5.35286205110801192 +Interesting, complete times join secure reports. Ancient, traditional markets go lessons. Rapid terms figh Sports hockey 3.26 12950.49 5.64341962078700893 +Reports may develop relevant, clear cells. Intently inc Sports hockey 7.52 1084.78 0.47271329009460889 +Forces trust together from the systems. Reasons exploit even mar Sports hockey 3.36 2768.45 1.20640416302146057 +Annual priests look often practical genes. Needs may n Sports hockey 0.72 2604.48 1.13495115118789706 +Tenants shall not know so realistic years. Recommendations tell. Successful, proposed actions used to link also. Holes will not become only later previo Sports hockey 5.91 6583.03 2.86867915161739080 +Then royal plans would afford certain, terrible days. Priests ought to care rarely Sports hockey 4.15 6918.52 3.01487522980268214 +Complete clubs engage to a classes; other, small estates rob sl Sports hockey 8.86 2201.70 0.95943218975395970 +Details accompany ok. Black savings go ju Sports hockey 7.28 15049.92 6.55828573430617849 +Issues recognise only previous Sports hockey 75.67 4488.20 1.95581757462584454 +Very old efforts bring sorry supporters. Almost other subjects sha Sports hockey 1.96 7640.40 3.32944801862022696 +Too female dates will achieve also national, capable statements. Actual, small lights see then cheap effects. Free peasants used Sports hockey 3.59 8586.28 3.74163302095681932 +As national managers shall respect years. Other police could not consider. Therefore true bodies continue in the factors. Special relations would reach on Sports hockey 3.94 1856.04 0.80880434276737946 +Tonight certain authorities hang with a cattle. Internationa Sports hockey 0.61 9094.17 3.96295564204694903 +Psychological, ill activities talk rather right windows. Leaders would know adequately sacred, ordinary offenders; important minutes could affect again norma Sports hockey 7.66 794.92 0.34640134272571996 +British observations speak great quantities. Personal, ready th Sports hockey 1.66 274.86 0.11977541521359557 +Late, chief standards guarantee publicly police. Also political years might come curious years. Systems may not follow so with a times. Central, silent towns must apologis Sports hockey 40.41 5501.55 2.39740389859694645 +Columns blame rapidly. English users may not get excellent, female manufactu Sports optics 0.25 1588.38 0.64760161773605996 +Softly old women ask perhaps as a questions; relevant needs used to fall. Entries would not call together questions. N Sports optics 3.85 6270.40 2.55651744787279515 +Projects mount in general perhaps busy things. Accounts will fail. Often d Sports optics 56.35 1751.04 0.71392005484868258 +Good duties cannot determine gifts. Today social others succeed really quick eggs. Asleep, liable observers understand more after a operations. States must wish just similar women. Questio Sports optics 4.66 2203.00 0.89818957923956490 +Solid police must lift increasingly western girls. However central days choose widely over a drivers. Able years release commonly christian, aware muscles; sometimes important Sports optics 2.47 24705.19 10.07260291018316218 +Mad, social circles could arrive increased eggs. Shareholders search very low carers. Fast, significant patients will not seize then capital memorie Sports optics 1.38 6498.54 2.64953286803063189 +Obvious eyes talk lives. Neutral, real guests must stay in a departments. Hands can drop in the rounds. Flexible, mutual margins may pass like women; large clubs try. Old, sure records would Sports optics 6.07 1813.00 0.73918189158480761 +Circumstances join by a members. Human, personal priests will not obtain again wide, statutory days. Whole, new kids shall not encourage Sports optics 4.53 6033.35 2.45986931362007665 +Nurses should see certainly eyes. Clubs shall go individual procedures. New, internal police might read too international children; healthy, sufficient years break well only new agent Sports optics 8.75 9654.45 3.93623530789351671 +Identical solicitors must maintain sources. Factors take already unusual minutes. Just various sales sell agricultural, long states. Sports optics 3.77 1573.11 0.64137585519634677 +New hotels join increases. Agencies might not prov Sports optics 40.19 2052.76 0.83693492541071686 +Aware, single times would ring to the men. Again double months cover that. Accurate politicians send so social hotels. Other, urban feelings upset just wild eyebrows. True, magnificent p Sports optics 3.24 642.52 0.26196312685111450 +Other, international colours s Sports optics 3.14 11101.71 4.52630060541973219 +Quick artists must hope tough teachers. Social conflicts find rapidly from a shareholders; other tools Sports optics 3.81 10100.29 4.11800963472427822 +New, able officers may believe often. Losses weep fast excellent, old hours. Able, only regulations shall not let by a countries. Dreams back a little. Sophisticated, Sports optics 8.41 1446.65 0.58981659319424265 +Acute, serious forms change just premises. Above causal buildings may pay so open, traditional consequen Sports optics 4.49 7490.92 3.05413812206865251 +Ago sexual courts may attract. Important, alone observations expect. New, available ways represent years. Excell Sports optics 8.59 3179.49 1.29631628928570322 +Bombs shall not help. Angles pull sometimes. Measures train still african pictures. Teachers wear by the motives. Attractive months shall give Sports optics 0.92 NULL NULL +Other, different problems spread importantly only likely commitment Sports optics 3.10 8596.18 3.50476590888223467 +Possible opponents can inform also foreign, new heads. Losses face most qualifications. High difficulties will not walk results. Direct, ou Sports optics 0.27 149.24 0.06084694180922046 +Drugs hold years. Cells might reconsider now. Wrong players meet too rapid, integrated parents. Complete, social women used to includ Sports optics 4.94 13154.62 5.36329668763339318 +Holidays will find soon so international expectations; furious children would not talk in order reasons; there current stones shall give as firms. Central drugs ought to love european, following Sports optics 9.08 13906.80 5.66996951455686841 +European nights accompany however expensi Sports optics 1.37 3255.97 1.32749810454682075 +Earnings used to connect of course. Only big branches show into the men. Tiny trousers mediate. Highest proposed m Sports optics 8.81 3903.78 1.59161802798176516 +Wild, other services change less at a hours. Inherently southern days would win almost remarkable, separate firms; strong, professional children might damage other fea Sports optics 1.25 10597.58 4.32076074496487887 +Industrial, sexual minutes must cure crowds. Sports optics 3.33 503.37 0.20522999931993635 +Sad recordings will borrow most long teachers; then bold shares show markets. Common, dark skills watch really to a le Sports optics 8.63 838.35 0.34180537165478404 +National, little grounds must not hate broadly. Teachers define abroad normally tall researchers. Cultures handle centres. Major addresses used to look Sports optics 1.61 12110.40 4.93755564249787867 +Excellent, difficult relations attempt. Boots dismantle really social sheets. Literary sp Sports optics 1.67 2628.08 1.07149980454285779 +Obvious clubs should finance at leas Sports optics 5.51 1283.02 0.52310267542258128 +Alleged books ought to go altogether different databases; artists will listen years. Forward cold others check effectively. Quite numerous d Sports optics 5.42 3201.52 1.30529818507809887 +Teams judge conscious shareholders. Else local areas imagine ea Sports optics 2.39 6080.10 2.47892985053766615 +Tall students should encompass much true women. Rough birds ought to protect as possible families. Political, dead proceedings Sports optics 1.06 5878.74 2.39683295826545608 +Natural, political manufacturers must not pr Sports optics 2.60 1879.45 0.76627435528906048 +Physical, nationa Sports optics 52.14 5315.52 2.16720139457080890 +Rules share briefly ago specific subsidies. Maybe new subjects should scor Sports optics 1.12 NULL NULL +Exchanges see with a costs. Possible controls achieve yet high similar machines. Rights would not sum suit Sports optics 4.85 337.31 0.13752534134057995 +Legal, local prices ask central instruments. Structures cover for a parents. International tourists should Sports optics 1.84 3778.91 1.54070702809086890 +Wings can go yellow, expected eyes. Sports optics 8.93 5543.20 2.26002926719961695 +Hot grounds shall pass. Impressive methods could change very basic voices. Concrete, desirable centres pay again in a ingredients. Positio Sports optics 1.04 2610.25 1.06423029923289799 +Small aspects can allow obvious, redundant colours. Past, sound individuals give both; soft, religious months improve; customers use once for a fore Sports optics 0.82 1475.16 0.60144046287382504 +Injuries answer so good issues. Aside aware definitions m Sports optics 1.71 6407.03 2.61222314111451179 +Scenes should not learn. Magistrates produce somewhat on a businesses; extremely national values see everywhere. Northern engines shall not aim; rom Sports optics 1.88 6498.82 2.64964702739612762 +Colonies give. Even formal payments may follow comparative, frequent years. Perhaps residential messages face times. Late houses talk then conditions. Officials may includ Sports optics 76.62 15211.44 6.20188692384379802 +Great structures should not survive even here various areas. Cultural results choose likely, female hours. Gold feelings ou Sports optics 9.72 3879.70 1.58180032254913297 +Social cases need. Inc, right products can know states. Whole, economic years should run relatively new notes. Markets can stop just keen words. Now common services abuse only new, narrow feelings. Ye Sports optics 0.97 8141.82 3.31951787564424615 +Only economic shares last too white patients. Ever environmental markets might come slightly w Sports outdoor 1.07 1920.21 0.69563739953531432 +Strict results wonder indeed ago possible factors; wrong tables survive for example known differences. Featur Sports outdoor 3.18 7506.80 2.71949986242738947 +Total, happy arrangements control indeed. Particularly internatio Sports outdoor 4.20 5584.92 2.02325746945009538 +Easy, local stages may not get elected, alone pages; clean mem Sports outdoor 1.93 11116.50 4.02719137590905246 +Public questions call under way far essential taxes; Sports outdoor 1.23 9780.48 3.54318937689479327 +Preliminary, central jobs would attend unhappily personal members; as blue duties must sound remaining, slow voices. Bad years can seem short drugs. Major problems fit more middle countries. S Sports outdoor 3.62 276.60 0.10020430302491287 +Houses decide quite. Elements cannot assume simply; simple, cruel days could know. Sports outdoor 7.17 NULL NULL +Principles take hardly perhaps financial women. Men revive so in a classes. Only domestic miles perform relations. Urgent, male developers relax major po Sports outdoor 2.50 7845.25 2.84211065909688245 +Costs use again successfully coming weeks. Processes can stress less heavy, oral issues. Personally cheap officials shall go current events. Natural parties imagine powerfully without the we Sports outdoor 4.07 3610.83 1.30810088030168523 +Ago natural taxes could protect rats. More local days shall tend closely. Proteins may intervene very perfect men. Procedures make expens Sports outdoor 8.79 12330.06 4.46682960432160944 +European Sports outdoor 29.44 11343.15 4.10930021640289375 +Numbers choose special bodies. Main pictures offset like a changes; beautiful, large elections must suspend. Electronic p Sports outdoor 5.79 6902.40 2.50054295444381268 +Yet green experiments think wonderful minutes. Scottish years may remove twice parental features. Good boundaries look please. French, e Sports outdoor 8.75 3992.78 1.44647048818442374 +Good products may say pp.. Substantial, front flats become actually. Bills tr Sports outdoor 9.06 3258.39 1.18042190503740363 +Modern personnel would keep Sports outdoor 0.48 6309.82 2.28586809585197296 +Initial, real signals keep perfect, free sectors; just funny deposits can understand sufficiently. Entire relations shall not relate; poor views must reach probably. Years Sports outdoor 2.66 17724.56 6.42110333052512525 +Unacceptable events must not persuade at least but for a companies; horses would try also crude skills. Turkish, new animals go further scottish lands. European elements believe Sports outdoor 9.19 702.52 0.25450298973630437 +Eyes should jump rapidly closer explicit things. Green, radical children could ensure middle consumers. Likely minutes think very pa Sports outdoor 2.37 8733.77 3.16399615195189179 +So competent candidates would enter suddenly almost cold situations; eyebrows could read enough rational sales. Impossible Sports outdoor 0.33 2072.27 0.75072440719246635 +However subsequent steps share terribly existing communications; less great responsibilities speed at all long-term mountains. Of Sports outdoor 4.39 3486.57 1.26308502096012459 +Industries give much proposals. Possible, strong goals ought to live most total criteria. The Sports outdoor 96.84 5462.95 1.97907121189424352 +Only single galleries discover in the countries. Clean front products ought to shoot even. Ready, educational questions ought to sense shortly tests. Sciences stop. Upright variou Sports outdoor 1.53 1332.46 0.48271231239542806 +Economic elements used to hear as Sports outdoor 0.40 396.48 0.14363341309948465 +Social, joint functions should suit. Best absolute goods might not lose still western wonderful hundreds. Inches feel certain years. Diverse lives put breasts; very good police shall Sports outdoor 5.91 1973.74 0.71502979411565989 +Trees work Sports outdoor 3.30 8407.66 3.04585578586565052 +Steps cannot stay only able transaction Sports outdoor 6.89 702.30 0.25442329000143278 +Stars divorce there s Sports outdoor 2.51 7314.38 2.64979157613652275 +Original women shall know here necessarily national goods. Accounts will make as. Independent members will find a little dreams. Short jobs assist widely new moments. Ago passive represen Sports outdoor 9.83 5957.43 2.15820723416379853 +Distinctive things used to pick today symbolic pictures. Helpful lips know still. Concerned theories must accommodate very in the ph Sports outdoor 27.94 9643.98 3.49373931412219527 +Even short boards can expel anywhere secure charming details. Specia Sports outdoor 6.91 8327.04 3.01664945575043550 +Ideas form on the needs. Firstly rough operations might begin worldwide obvious activities. Twins Sports outdoor 4.30 2362.14 0.85573605331622446 +Creative teachers may close concerned, foreign parts. Alone desirable fires put pupils; areas begin behind a countries. Kindly able rates lead employers. Songs point thoroughly; large, acute others sa Sports outdoor 2.27 10905.96 3.95091872963694416 +Obviously base children must seem most for a years. Just available Sports outdoor 5.16 5010.90 1.81530637030924041 +Always small authorities make after a nations; forms will retrieve now. Financial, giant words render american, sensitive activities. Written eggs might not grant now really existing entries; grounds Sports outdoor 6.44 4934.08 1.78747667197817097 +Apparently realistic minutes see. Ful Sports outdoor 2.79 3360.22 1.21731201413728388 +Less social teeth play instead as social children. Advances mean very now slow bases. Small fit managers must think about sites; full, civil weap Sports outdoor 96.73 8555.01 3.09923649465350631 +Moreover overall miles say. Leaves may order faintly sure trees. Political, certain drinks protect to a parents. New minutes remember satisfied, exciting feet. Cri Sports outdoor 5.71 3006.51 1.08917295403987994 +Alone healthy sales might meet far other roots. French groups look up to a workers. Fully average miners would walk inadequate considerations. Small, sure goods may admire more app Sports outdoor 0.48 1427.56 0.51716433415128205 +True champions get all the same police. Especially clear issues move further great homes. Better environmental sessions burn. Bonds shall test already elderly areas. Imperial, close schools press Sports outdoor 1.71 724.38 0.26242224521036292 +Public, great addresses must prefer thick maybe dangerous problems. Public pages may shoot now injuries. Flat groups know rather special responsibilities; nuclear months can see dou Sports outdoor 9.74 6478.02 2.34680216587652229 +Quite significant levels move chiefly dirty, actual beliefs. Away significant views bury. Practical proceedings build a bit. Funds think about prime s Sports outdoor 9.44 3562.95 1.29075531982145086 +Independent, different attitudes include greatly other, bottom waters. Twin others should exert. Extraordinary, bottom tables could go only results. Good, early pupils shall say per Sports outdoor 98.21 5097.92 1.84683123816617431 +Theories must not Sports outdoor 0.92 453.25 0.16419956741157541 +Great, possible children used to Sports outdoor 4.00 8014.65 2.90347945494800407 +Truly growing visitors shall not receive open, personal times. Large societies Sports outdoor 12.35 2130.34 0.77176151448334375 +So Sports outdoor 2.12 6574.51 2.38175774504815585 +Very major companies would not remedy ever future, clear movies. Famous, equal fees know open, active rights. Original hours apply so. Social, technical rates could Sports outdoor 3.18 1551.09 0.56191573528167788 +Social thousands choose especially blue claims. Social, right professionals can go tons. General projects must ma Sports outdoor 0.64 1598.82 0.57920695503359072 +Prominent, regional tonnes ought to replace extremely. Women could make very young, equal hours. Q Sports outdoor 4.73 NULL NULL +Most whole councils arise already so social customers. More sc Sports outdoor 2.11 1583.53 0.57366782346001546 +Various pockets can get. Areas conduct photographs. Ever Sports outdoor 1.85 1513.96 0.54846459366448694 +Scientific risks would use. Quiet minutes imagine times; arms cut inner appeals. Areas happen straight in a changes. Fears kick very currently silent Sports outdoor 4.22 474.41 0.17186523282013346 +Clothes realise almost necessary females. Foreign, cultural others may give bad ya Sports outdoor 7.21 4335.56 1.57064992054479841 +Heavy years could come much through a genes. Dealers come so sincerely educational characters. Studies must handle Sports outdoor 2.12 7347.30 2.66171755464548924 +Various, personal benefits must not remember at le Sports outdoor 0.34 6983.49 2.52991955217443519 +Losses try a little cho Sports outdoor 4.86 1698.82 0.61543410724794823 +Industr Sports outdoor 8.35 1902.72 0.68930127061302319 +Nearly cultural sheets might decide to a years. Loudly new marks create lives. Local, new arrangements must not face b Sports outdoor 1.39 431.65 0.15637450253327419 +Also religious bits might hear so extensive western talks. Sometimes complete settings mean also minutes. Other, available theories admit both just old years. Considerable seconds will prepare che Sports pools 0.62 10914.03 4.26659608077049963 +Other sports take prime tables; sources think in a priests. Fine, key eyes keep always important branches. Still local effects shall get much; black, final metho Sports pools 2.25 1716.96 0.67120713492996785 +Factors would impose that is free, liable thoughts; significant wives buy useful sports; russians make nearly outstanding animals. Problems write. Finally per Sports pools 2.04 10920.36 4.26907065278388765 +Popular systems associate evenly public rights. Unlike mothers experiment around languages. Chea Sports pools 8.52 3232.70 1.26375180848016674 +Subsequent feet can accept regardless. Individual, following arms hold prime officials. Assistant acids might not get however necessary times. Sometimes new times shall not take about. Small Sports pools 1.90 9375.14 3.66500143216343934 +Bonds will set ever into the nations. Distinguished, philosophical employees may not include. General, existing tiles must continue only quiet missiles. Small ve Sports pools 12.34 9502.98 3.71497762271502301 +Western products become grea Sports pools 8.19 12699.99 4.96477722342934165 +Very old circumstances explore fairly upon a lines. Crucial, active looks mean alone bloody recordings; poor bacteria could not transfer both at a properties. States could not understand really at a Sports pools 3.35 2713.46 1.06076653640566500 +Years ought to know then. Associated, simple activities would not indicate now for a brothers. Workers get organizations. S Sports pools 20.43 4211.26 1.64629796794635660 +Supreme injuries could think conditions. Basic, eventual c Sports pools 9.13 3177.04 1.24199277557887491 +Able systems merge from a areas. Most chief efforts must find never for the time being economic directors. Activities sit there. Available polic Sports pools 3.10 4811.17 1.88081937340474643 +Carers get m Sports pools 5.77 4684.53 1.83131229603105623 +Privileges cut perhaps reasons. Ideas finish times. Women envy general programmes. Hands shall unveil never to a facilities; official proposals conform. Scot Sports pools 7.52 8558.76 3.34585591868955110 +Central, clear awards announce. Single, very proposals help dry maps. New questions Sports pools 2.90 2934.22 1.14706772403213253 +Able troubles dust into the styles. Independent feet kill wounds. Fundamental months should exploit arms. Massive years read only modern courses; twin forms shall become products. Even h Sports pools 6.81 6802.61 2.65932832922487921 +Far good grounds change clearly rocks. Growing, Sports pools 1.99 5753.89 2.24935468595785151 +Secret, familiar questions ought to influence historical values. Central, net investors can hope. So chief arrangements shoul Sports pools 6.13 4628.51 1.80941252917639637 +Fine, high letters see now suddenly prime forces. Things used to know temporary men. Late, special methods provide fr Sports pools 2.85 2565.78 1.00303434131290940 +Directors could involve. No longer local patients see waste lovers. Only direct aims canno Sports pools 60.43 1100.10 0.43005950583383284 +Similarly direct changes can alienate men; ways surrender forms. Players must develop deep. Social, serious thousands walk. Thanks will not say organisations. Natur Sports pools 3.39 3166.29 1.23779030336024597 +Simple, environmental rights ought to detail thick disabled days; also old drinks move to a conditions. Sports pools 8.46 825.24 0.32260913243733498 +Previous, significant flats give all formally co Sports pools 2.82 6467.74 2.52841838765722572 +Dangerous, other ladies may know neatly. Effortlessly growing services might encourage in the citizens. Banks use secondly other, similar responses. Indirect branches shall not buy i Sports pools 4.74 1246.28 0.48720530945422161 +Literary, sensitive pages could not know now; very public program Sports pools 3.36 2399.19 0.93790970439184930 +Christian, red laboratories prevent; shoes allow most to a positions. Now religious passengers will not know always in a elections. Southern ages abandon northern terms. Thoughts go as Sports pools 2.22 6752.13 2.63959430154149417 +Things used to reappear. Good powers lead. Rare, traditional months may pay too. Shows tend anywhere extra pp.; canadian, proper questions can investigate only small, certain countrie Sports pools 4.95 478.95 0.18723479712672870 +Like records start clear, likely un Sports pools 0.52 127.98 0.05003092042233790 +Problems might introduce therefore now public details. Early future children shall annoy ever sharp services; civil lines must fly. Finally other serv Sports pools 4.38 3165.54 1.23749710762406255 +Exclusive, different friends find for the features. Procedures comprehend totally ey Sports pools 3.90 7853.37 3.07009946489432581 +Direct, different traders woul Sports pools 4.53 3602.83 1.40844585892492317 +Southern hours see Sports pools 7.73 2352.82 0.91978238934274937 +Unable centuries may think away individuals. True, additional feet appear generally recent, pri Sports pools 3.10 741.45 0.28985330479092388 +Basic levels look early, video-taped rights. Employees might not prevail later. Causal, permanent arms could not know here public vessels Sports pools 13.28 4827.92 1.88736741151284270 +Thus aware parties would conduct either at the poems. Things plan. Instead old organizations should show rather necessary, b Sports pools 77.38 4657.72 1.82083152578161976 +Thoughtfully fine Sports pools 4.43 6849.91 2.67781920698684657 +Types can scratch like a Sports pools 9.69 3733.27 1.45943846136194267 +Only sexual functions would avoid special pati Sports pools 8.64 4120.56 1.61084083025057563 +Still male versions will get in a colonies. Wide wages would com Sports pools 1.46 5664.01 2.21421810893363108 +Then available police rememb Sports pools 0.40 1103.32 0.43131829286118030 +Pressure Sports pools 5.42 3879.88 1.51675236387107660 +Consumers remind related, slight customers. Large purposes like with a systems; types must go programmes. Main followers shall reduce al Sports pools 15.70 1464.58 0.57254481506600755 +Final holes agree really probably clear children. So good feet must imply birds. Newly british forces ought to raise nevertheless supreme, fine problems. Necessarily good units may push only Sports pools 2.20 1319.87 0.51597367508853827 +Men make only. Flat, distant depths would assert local, Sports pools 7.24 10909.61 4.26486818056525871 +Apparently other offenders should approach Sports pools 0.36 15958.64 6.23867360438145453 +Workers relieve fast quite female photographs. Other, automatic shares want away right games. Sports pools 1.82 3069.94 1.20012442445188328 +Here ready critics stay services. Excellent years ought to Sports pools 55.17 2208.60 0.86340280391291993 +Never future depths c Sports pools 23.19 4555.50 1.78087090157806155 +Real ships suspend for instance worth the arms; ago econo Sports pools 3.46 38.42 0.01501944024555573 +Famous, busy shoes will not secure. Dark, extraordinary thousands might not look then. Numbers ought to e Sports pools 6.47 7750.63 3.02993555831368042 +Massive, military measures must get standards. Services make as well fine Sports pools 0.51 10656.29 4.16583838871194852 +Critics shall not print still black parents. Multiple, accessible responses exclude against a areas. Mo Sports pools 6.14 4995.43 1.95285170187028778 +Forces eliminate away. New, large characteristics should reconsider right, used firms. Peculiar principles establish degrees. More growing arts may not say about. Actual animals move here Sports pools 2.65 1461.99 0.57153231245705415 +Senior disputes can bring tonight controversial houses. Heavy, real examples should not offer nearly free effects. Worlds will not add. Agricultural, rare defendants draw maybe possibl Sports pools 3.45 7092.42 2.77262307096263314 +Free plans ca Sports sailing 0.98 6984.42 2.34770798957927730 +Special thousands take so reforms. Finally reliable acids used to go pale, small days; great, foreign judges show vice versa fair, true arrangements Sports sailing 0.90 11949.72 4.01671908579886112 +References should make private women. Additional, northern values ar Sports sailing 0.63 14040.42 4.71947652218060722 +More critical photographs balance just now serious values. Scottish, practical views suppl Sports sailing 5.19 2863.69 0.96258642703020159 +Quite british tonnes could buy successfully surprising processes; local interests used to suggest suddenly other solicitors. Shares return just real, royal companies. Crucial, old groups study. Child Sports sailing 95.70 6541.62 2.19886741329868364 +Then other rates may make more at once above councils. Camps could give Sports sailing 0.61 8648.26 2.90698284151853421 +Scottish, british colleagues enable about a workers. Most good persons could read with a years. Indeed specific damages believe organisations. Immediate facilitie Sports sailing 1.74 7276.84 2.44600058514380124 +Easy, natural leaves contin Sports sailing 1.73 12739.66 4.28224556463149924 +New routes cannot test over a others. Armed, brown fans make so in a techniques. Electronic, subsequent professionals used to follow in a matters. Enough substantial standards Sports sailing 3.07 5349.42 1.79812727092803377 +Open times ought to add actually soviet attitudes. Women must imagine of course inner streets. Rightly big records enable yesterday st Sports sailing 6.43 2470.80 0.83052234840580583 +External, definite securities might know then particular others; always local years must buy right children. British effects used to enable powerful, Sports sailing 5.35 NULL NULL +Important, broad investors can see dearly vulnerable troops. Eastern, poor lists need genuine facilities. Figures meet equally children. Other, defensive changes go old, new companies; Sports sailing 71.43 17348.99 5.83160268628332577 +Young, black boys spread too wealthy, major numbers. Profitable drawings might think better purposes. Industr Sports sailing 3.24 12918.54 4.34237339273690257 +Joint texts take only local, asleep shareholders. Detailed courses fast programmes. Soft students know settlements; just b Sports sailing 4.70 1007.64 0.33870306748730216 +Only american aspirations will not provide then on a subjec Sports sailing 9.32 2524.02 0.84841145289915090 +Equal songs will overcome slight contracts. Large, inner odds go even good women. Feet could not find hard strong models. Bloody machines see dark heads. Huge, only men make at the advis Sports sailing 2.07 2504.57 0.84187362722467586 +Prisoners raise both. Medical children sell; activities Sports sailing 1.25 8453.80 2.84161803017362852 +Benefits may hold Sports sailing 8.02 5687.08 1.91162661371688936 +Ethnic positions must buy years. Other efforts should get; common goods show exactly aware eyes; foreign, unfair fans may carry thus daily, national actions. Sports sailing 4.63 4728.78 1.58950844693799842 +Criteria shall announce far about other waves. Farmers see possibly; just english managers clean. Head files see both. Comparisons may n Sports sailing 4.18 1308.47 0.43982255836916981 +Connections present high secondary benefits. Levels could compete. Psychological students ought to wonder advanced seats. Of course rich functions would see items; unlikely id Sports sailing 9.39 2534.25 0.85185011390942748 +Well bad areas seem Sports sailing 0.39 2413.53 0.81127189717818704 +Blue, united ministers know childr Sports sailing 4.68 530.93 0.17846415348838210 +Dear, continuous problems Sports sailing 5.90 8982.06 3.01918470322237831 +Prices acquire more out of a christians. Efficiently local prices Sports sailing 2.11 8027.95 2.69847494207721747 +Good, capable studies might like bad apparently new years. Modest, payable plants could feed there english women. New, local recommendations last public novels. Candidates must save as orange pla Sports sailing 4.28 1617.69 0.54376222186845881 +Mothers may not obtain p Sports sailing 9.99 205.80 0.06917658220087212 +British figures can tell much white methods. New, french men could think marginally nuclear relatives. Electronic, differ Sports sailing 7.39 13316.13 4.47601730584304808 +Real appearances could join miles. A Sports sailing 2.44 1182.16 0.39736534700963551 +At present financial areas used to link very purposes. Likely members can retaliate true, blac Sports sailing 1.69 7800.18 2.62191347401165555 +Special birds will not answer especially then public walls. Most human areas could require major groups. Particularly diverse children could continue to the readers Sports sailing 4.71 7976.59 2.68121104867664997 +Students would rise broad obligations. Good, statistical children would not see. Gradually elegant cases can look w Sports sailing 4.63 391.82 0.13170441417855061 +Reliable stages cannot see similarly. Feelings repeat together significant, available notes. Rich, basic roots provide instinctively before the talks. Parties arrest there other investigations. Bom Sports sailing 7.89 7983.29 2.68346315315063365 +Demands can imagine also purely fresh eyebrows. Busy skills become almost; complete pa Sports sailing 4.98 12443.47 4.18268574013161433 +Proper applications stand now very limited arms. Angrily slow boys shall aid too previous old masses. Mechanical contents think through the times. Sequences may not agree. Old, working stren Sports sailing 0.63 679.89 0.22853482250996573 +Successful, able hearts cite then contents. Urban rights will use long important, suspicious ideas; police speak for a methods. Plans seek no longer good gardens Sports sailing 4.39 8675.35 2.91608873856334289 +Scientific packages make banks. Then important parents must get front, little bact Sports sailing 4.23 6135.42 2.06232937787597103 +Also long ways should not give only now good resources. Previous, economic units s Sports sailing 4.65 389.74 0.13100525338662731 +Social years attend. Bloody wee Sports sailing 1.94 3178.08 1.06826390845941533 +Capital, foreign problems Sports sailing 3.60 1277.78 0.42950657533834004 +Original, major nations should come once more now permanent feet. Prizes revise thus with the spots. Aside ordinary studies can learn l Sports sailing 1.46 7468.82 2.51053178169833686 +Industrial, open sites would throw before a men. Also p Sports sailing 7.20 1089.19 0.36611487642064095 +Loose patients used to look at all companies. Old, low centres may illustr Sports sailing 6.35 7701.71 2.58881426094401766 +Especially moral students used to keep guilty, bizarre things. Unknown trends reduce later terms; general mothers can find as right n Sports sailing 3.35 12086.74 4.06277630296680815 +Origins would come sales. Educational eyes could invite actually stupid, forei Sports sailing 3.77 9292.44 3.12351428331716300 +Legal, secondary sales elect. Big years appeal low with a doubts. Military videos might describe; comparable, long companies would not extend now industrial tools. Even ne Sports sailing 5.45 1828.50 0.61462284039987695 +Additional organisations will adopt usually schemes. Conventional problems should not create attacks. Generally european powers win very human, busy months; fai Sports sailing 0.87 6498.29 2.18430268391693540 +Wrong, local indians train excellent, comprehensive holidays. Meals c Sports sailing 60.65 1510.40 0.50769829813506926 +National shareholders learn. Effective proceedings will develop now other, informal days; new, big waves last americans. Solicitors ought to sue flames; interested conservatives might understand just Sports sailing 0.24 5784.43 1.94434935558887624 +Ambitious exceptions appoint. V Sports sailing 7.35 9044.55 3.04018977912972767 +Proceedings mi Sports sailing 7.11 4105.60 1.38003584005782598 +Again standard families change literally. Narrow lips work certainly carefully vast stages. Drugs see also right factors. Financial, western examples ought to let desperately ago sudden Sports tennis 9.39 6556.29 1.81601129267527792 +Late global concepts shall understand very quiet, upper heads. Already english buildings make women. Others try. Please minimal agreements conflict largely forthcoming police. Sports tennis 4.33 7426.08 2.05693237186122454 +Seriously complete characteristics make forward in a projects. Industries should rise then also new departments. Physical babies encourage under to a workers. Personal, beautiful ministers cont Sports tennis 0.82 14172.38 3.92557408596710262 +Whole, new meetings may last; free plans broaden there mammals. Public, honest areas may risk on a profits. Good, normal generations ought to walk almost over a reductions. Otherwise basic s Sports tennis 4.88 8723.48 2.41629613568450044 +Economic, content activit Sports tennis 5.07 16087.57 4.45605804375706699 +Women would come fair unaware, current bars. Villages may go then on a neighbours. Early numbers should not change however cr Sports tennis 2.92 13912.86 3.85369025369685708 +Women should leave also annual, marginal techniques; intellectual, appropriate factors could think profits. Neverthe Sports tennis 8.24 23633.13 6.54608489881669218 +Of course equal nee Sports tennis 3.49 11949.65 3.30990534944566741 +Free representatives can fall much prime, useful banks. Recent, secondary practitioners can talk times; libraries take from now on young prices. Bodies appear only yellow rates. Second Sports tennis 6.85 7304.83 2.02334762054045053 +Costly offices collect officially for a debts; readers greet. Women get by a write Sports tennis 3.22 2864.47 0.79342278446035080 +Rapidly main banks shall not bring extremely decades. For example main clothes might not see less. Certainly co Sports tennis 3.15 5004.38 1.38615140465694887 +Just able pounds should join then successful modern pieces. Associated, sorry clubs pay close issues. Resources will e Sports tennis 7.67 7567.71 2.09616213128028617 +Necessary times believe probably. Cruel traders know ho Sports tennis 92.95 7731.85 2.14162688247032202 +Funny, armed savings go yet thin Sports tennis 3.97 3362.82 0.93145957473422897 +Elected, marvellous advisers may not pass all in a programmes. Directly soviet studies could not stress more than; convenient, public Sports tennis 4.67 18.70 0.00517966886349257 +Men could remove only; economic, clear children raise public, extensive poli Sports tennis 5.04 2721.49 0.75381909172761457 +Able, common villages read. Only social grounds remember e Sports tennis 2.08 2677.23 0.74155961879188295 +Successful parties see once on a ideas. Scottish, natural men would not examine regulatory, multiple payments. Steadily loc Sports tennis 2.55 8031.03 2.22449604453340795 +Current, Sports tennis 0.47 18310.05 5.07165753336856247 +Years may speak to a Sports tennis 2.02 3056.11 0.84650469574375807 +Separate, comfortable consumers get. Tests work even high, different faces. Hars Sports tennis 8.09 11878.41 3.29017274998923903 +Much critical possibilities might ensure; hence northern ways may persuade much japanese, running notes. Small, ed Sports tennis 8.53 8171.42 2.26338233927916847 +As specific ears worry also labour components. Duly proper articles would attend more easy shapes; years wait head convention Sports tennis 0.85 11273.32 3.12257029904748936 +Early, experimental factors mean usually suitable detectives; just black assets must not store only. So british employers must see elaborate, complete pages. Mental years should t Sports tennis 88.56 15092.59 4.18046088194969605 +Social, substantial orders would not offset however to a colleagues. Small students give for sure husbands. Subjects shall not make generations; acceptable lights g Sports tennis 56.30 5682.58 1.57400442194147617 +I Sports tennis 1.04 4973.48 1.37759248658839698 +Automatic amounts may find more in a regulations. Boys can give available, current seasons; here complicated camps may spot even generous open individuals. Channels remain currently protest Sports tennis 8.43 3330.22 0.92242977767808685 +Points used to find cool typical managers. However military horses understand indeed inc periods. Coloured developments could make very roots. Sports tennis 8.52 11481.61 3.18026405453288334 +Sides express even new women. Also joint markets should switch authorities. Trees would play always about a skills. Teams deprive future pubs; ways recover national, old days. Rea Sports tennis 90.25 3634.02 1.00657862263685918 +Secret children will start in short familie Sports tennis 38.21 13612.04 3.77036683190456646 +Other, general countries keep successfully teachers. Major, traditional relationships could not become in a subjects. Constant observers wil Sports tennis 99.16 7979.51 2.21022564133302628 +Upper, industrial years shall opera Sports tennis 1.58 369.36 0.10230815462136981 +Afraid, spanish matt Sports tennis 3.06 141.37 0.03915774263272431 +Light, social animals resist instead then female societies. Also informal minutes shall not implement. Servants win. Hands will a Sports tennis 8.30 3341.21 0.92547387183903783 +Modest, educational principles would Sports tennis 6.42 18707.39 5.18171580215038800 +Far little eyes can happen pp.. Related margins will suffer low below active children; times feel just similar, nervous birds. Vegetabl Sports tennis 9.01 813.78 0.22540700148304722 +Then various shoes date good, bad shops. Here open rats match badly well dual games. No doubt small kids answer much points. Completely free services shall understand. Following patients Sports tennis 5.46 1154.69 0.31983485775327459 +Widely free parties would find in a problems. Men like parties; straight a Sports tennis 8.95 10297.10 2.85216942536199653 +Tired rights free. Paintings sell Sports tennis 8.06 5429.22 1.50382683353214583 +Meetings improve early women. Even likely variables might want approxi Sports tennis 2.56 7342.79 2.03386207134570068 +Growing jews see only grey tactics. Also indian parts ought to provide pretty other, canadian ways. Countries shall correspond really to a doubts. Star sounds ought to mean further at a steps. Sports tennis 8.04 4423.03 1.22512464028307694 +Else single arrangements will not keep approximately from a teachers. Large levels tolerate daily financial, critical others. Properties make a Sports tennis 0.30 5475.18 1.51655718545546767 +Equivalent, important points would not reject foreign, high mountains. Always alive cups mark near the games. Sons will not stay extremely. Unfortunatel Sports tennis 0.19 5314.97 1.47218099568968454 +Confidential companies can write highly; potentially new children mix sympathetically military, economic gains. Various, traditional designers make in a measurements. Individuals tell only se Sports tennis 7.12 1837.86 0.50906450360740392 +Examples show waves. Currently representative farmers should put like a customers. Both full rights practise with a police. Legal re Sports tennis 4.24 735.27 0.20366070188557120 +Part Sports tennis 6.53 4928.46 1.36512250304644856 +Great, big arts will not let brilliant pp.. Real, new or Sports tennis 0.88 13772.83 3.81490367450140978 +Inc presents cannot break often subjects. Of course capital services would pay. Systems cannot Sports tennis 9.67 3395.45 0.94049768141956387 +Parts may refuse primarily old holidays. Scottish, good tests handle however for the households; low measurements will remember into a calls; inc, genuine events used to think again r Sports tennis 6.88 733.87 0.20327291918990865 +Literary pai Sports tennis 2.68 3317.04 0.91877908058606374 +Themes would not reflect on the jeans. Traditional relations would not force mildly smal Sports tennis 9.89 1274.76 0.35309276365913303 diff --git a/sql/core/src/test/resources/tpcds-query-results/v1_4/q99.sql.out b/sql/core/src/test/resources/tpcds-query-results/v1_4/q99.sql.out new file mode 100644 index 0000000000000..2a7da81704380 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v1_4/q99.sql.out @@ -0,0 +1,95 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct120 days :bigint> +-- !query output +Just good amou EXPRESS Mid Atlantic 1260 1337 1352 0 0 +Just good amou EXPRESS NY Metro 1297 1268 1203 0 0 +Just good amou EXPRESS North Midwest 1291 1266 1327 0 0 +Just good amou LIBRARY Mid Atlantic 932 1025 970 0 0 +Just good amou LIBRARY NY Metro 918 973 922 0 0 +Just good amou LIBRARY North Midwest 899 945 970 0 0 +Just good amou NEXT DAY Mid Atlantic 1273 1356 1306 0 0 +Just good amou NEXT DAY NY Metro 1301 1304 1226 0 0 +Just good amou NEXT DAY North Midwest 1158 1250 1247 0 0 +Just good amou OVERNIGHT Mid Atlantic 1021 961 1055 0 0 +Just good amou OVERNIGHT NY Metro 852 992 977 0 0 +Just good amou OVERNIGHT North Midwest 858 993 982 0 0 +Just good amou REGULAR Mid Atlantic 948 982 993 0 0 +Just good amou REGULAR NY Metro 910 941 951 0 0 +Just good amou REGULAR North Midwest 880 948 993 0 0 +Just good amou TWO DAY Mid Atlantic 958 1030 981 0 0 +Just good amou TWO DAY NY Metro 891 907 907 0 0 +Just good amou TWO DAY North Midwest 924 886 955 0 0 +Matches produce EXPRESS Mid Atlantic 1216 1329 1314 0 0 +Matches produce EXPRESS NY Metro 1164 1301 1225 0 0 +Matches produce EXPRESS North Midwest 1246 1265 1264 0 0 +Matches produce LIBRARY Mid Atlantic 890 962 963 0 0 +Matches produce LIBRARY NY Metro 891 970 963 0 0 +Matches produce LIBRARY North Midwest 956 902 964 0 0 +Matches produce NEXT DAY Mid Atlantic 1339 1308 1245 0 0 +Matches produce NEXT DAY NY Metro 1218 1280 1177 0 0 +Matches produce NEXT DAY North Midwest 1265 1249 1309 0 0 +Matches produce OVERNIGHT Mid Atlantic 928 916 959 0 0 +Matches produce OVERNIGHT NY Metro 928 937 959 0 0 +Matches produce OVERNIGHT North Midwest 924 985 923 0 0 +Matches produce REGULAR Mid Atlantic 937 919 956 0 0 +Matches produce REGULAR NY Metro 920 970 942 0 0 +Matches produce REGULAR North Midwest 920 978 1033 0 0 +Matches produce TWO DAY Mid Atlantic 947 961 1010 0 0 +Matches produce TWO DAY NY Metro 870 950 1004 0 0 +Matches produce TWO DAY North Midwest 896 989 883 0 0 +Operations EXPRESS Mid Atlantic 1282 1274 1361 0 0 +Operations EXPRESS NY Metro 1183 1267 1206 0 0 +Operations EXPRESS North Midwest 1182 1297 1234 0 0 +Operations LIBRARY Mid Atlantic 955 1001 1015 0 0 +Operations LIBRARY NY Metro 917 948 930 0 0 +Operations LIBRARY North Midwest 890 926 977 0 0 +Operations NEXT DAY Mid Atlantic 1197 1322 1291 0 0 +Operations NEXT DAY NY Metro 1221 1238 1294 0 0 +Operations NEXT DAY North Midwest 1277 1295 1273 0 0 +Operations OVERNIGHT Mid Atlantic 904 1021 953 0 0 +Operations OVERNIGHT NY Metro 923 915 975 0 0 +Operations OVERNIGHT North Midwest 932 1010 987 0 0 +Operations REGULAR Mid Atlantic 953 1024 974 0 0 +Operations REGULAR NY Metro 902 892 901 0 0 +Operations REGULAR North Midwest 938 942 990 0 0 +Operations TWO DAY Mid Atlantic 964 990 1011 0 0 +Operations TWO DAY NY Metro 917 946 886 0 0 +Operations TWO DAY North Midwest 926 973 980 0 0 +Selective, EXPRESS Mid Atlantic 1307 1294 1263 0 0 +Selective, EXPRESS NY Metro 1186 1296 1230 0 0 +Selective, EXPRESS North Midwest 1203 1289 1271 0 0 +Selective, LIBRARY Mid Atlantic 1004 959 972 0 0 +Selective, LIBRARY NY Metro 932 940 931 0 0 +Selective, LIBRARY North Midwest 925 912 940 0 0 +Selective, NEXT DAY Mid Atlantic 1267 1309 1327 0 0 +Selective, NEXT DAY NY Metro 1244 1244 1261 0 0 +Selective, NEXT DAY North Midwest 1234 1268 1270 0 0 +Selective, OVERNIGHT Mid Atlantic 978 945 1068 0 0 +Selective, OVERNIGHT NY Metro 938 963 947 0 0 +Selective, OVERNIGHT North Midwest 882 936 932 0 0 +Selective, REGULAR Mid Atlantic 989 948 970 0 0 +Selective, REGULAR NY Metro 917 972 980 0 0 +Selective, REGULAR North Midwest 876 937 1001 0 0 +Selective, TWO DAY Mid Atlantic 951 974 972 0 0 +Selective, TWO DAY NY Metro 928 1007 934 0 0 +Selective, TWO DAY North Midwest 968 942 996 0 0 +Significantly EXPRESS Mid Atlantic 1260 1340 1298 0 0 +Significantly EXPRESS NY Metro 1231 1326 1236 0 0 +Significantly EXPRESS North Midwest 1200 1222 1233 0 0 +Significantly LIBRARY Mid Atlantic 949 1048 965 0 0 +Significantly LIBRARY NY Metro 908 963 915 0 0 +Significantly LIBRARY North Midwest 970 984 920 0 0 +Significantly NEXT DAY Mid Atlantic 1312 1347 1268 0 0 +Significantly NEXT DAY NY Metro 1198 1251 1190 0 0 +Significantly NEXT DAY North Midwest 1231 1232 1307 0 0 +Significantly OVERNIGHT Mid Atlantic 990 973 990 0 0 +Significantly OVERNIGHT NY Metro 891 925 954 0 0 +Significantly OVERNIGHT North Midwest 876 971 958 0 0 +Significantly REGULAR Mid Atlantic 942 1006 913 0 0 +Significantly REGULAR NY Metro 955 956 957 0 0 +Significantly REGULAR North Midwest 910 937 1001 0 0 +Significantly TWO DAY Mid Atlantic 957 1027 1018 0 0 +Significantly TWO DAY NY Metro 971 972 958 0 0 +Significantly TWO DAY North Midwest 885 977 919 0 0 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q10a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q10a.sql.out new file mode 100644 index 0000000000000..683a462c2ecc6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q10a.sql.out @@ -0,0 +1,9 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +F S Advanced Degree 1 4500 1 High Risk 1 2 1 0 1 0 1 +M D Unknown 1 5000 1 Unknown 1 5 1 4 1 6 1 +M M 2 yr Degree 1 2500 1 Unknown 1 2 1 0 1 4 1 +M W Primary 1 2000 1 Low Risk 1 2 1 3 1 4 1 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q11.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q11.sql.out new file mode 100644 index 0000000000000..f8a1d6edcd267 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q11.sql.out @@ -0,0 +1,99 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAAAECBAAA Frank Wenzel Frank.Wenzel@zhXN6.com +AAAAAAAAABGKAAAA Jonna King Jonna.King@aFu3Mu88XNgLh7lzUbBd.com +AAAAAAAAAFAGAAAA Robert Chang Robert.Chang@q5SPPnTKPgA2siE.org +AAAAAAAAAFBNAAAA Robert Baines Robert.Baines@FI8euotCCfA0dfsoy.com +AAAAAAAAAGLPAAAA Charlene Marcus Charlene.Marcus@XYRXjq9m6.com +AAAAAAAABAAGAAAA Luis James Luis.James@oLxkv69Mc9.edu +AAAAAAAABBEAAAAA Jason Gallegos Jason.Gallegos@sg0JhLIArOU5lOS.org +AAAAAAAABGMHBAAA Michael Gillespie Michael.Gillespie@J63SDK8lTkTx.edu +AAAAAAAABIABAAAA Letha Stone Letha.Stone@BkqMc.com +AAAAAAAABILCAAAA Theresa Mullins Theresa.Mullins@96UTbTai7sO.org +AAAAAAAABJEDBAAA Arthur Bryan Arthur.Bryan@ZvCpRQMEbZYcg.org +AAAAAAAABKDKAAAA Gerald Ruiz Gerald.Ruiz@kHcL2q.com +AAAAAAAACEMIAAAA James Hernandez James.Hernandez@gj0dkjapodlS.com +AAAAAAAACGLDAAAA Angelo Sloan Angelo.Sloan@dabad6klflJ.edu +AAAAAAAACKKIAAAA NULL NULL Lorraine.Miller@31f.edu +AAAAAAAACOEHBAAA Christine Gonzalez Christine.Gonzalez@oHMdrqfEDX.org +AAAAAAAACPDFBAAA Cheryl Barry Cheryl.Barry@b4id7Q6XJNsB.edu +AAAAAAAADFJBBAAA Patrick Jones Patrick.Jones@L0aUVXsdRxldn.com +AAAAAAAADHNHBAAA Patrick Cooper Patrick.Cooper@2kXFgCYx14V.edu +AAAAAAAADKMBAAAA Donald Nelson Donald.Nelson@b6TdhXbAelMn8oF.edu +AAAAAAAAEBFHAAAA Esther Merrill Esther.Merrill@hGu.edu +AAAAAAAAEBJNAAAA Alfred Glenn Alfred.Glenn@xCi0.edu +AAAAAAAAEFCEBAAA Cornelius Martino Cornelius.Martino@In2KFInUjUY.com +AAAAAAAAEIAHAAAA Henry Desantis Henry.Desantis@znTqdvjJGag4.edu +AAAAAAAAEIPIAAAA Luke Rios Luke.Rios@NgqF4xn2Qxgm00FR0.com +AAAAAAAAFAIEAAAA Betty Gipson Betty.Gipson@13Lp7iesLn.com +AAAAAAAAFDIMAAAA Stephanie Cowan Stephanie.Cowan@R80Njmu1D1n0d.com +AAAAAAAAFGMHBAAA Donald Coleman Donald.Coleman@S4KL45.org +AAAAAAAAFGNEAAAA Andrew Silva Andrew.Silva@hx4.edu +AAAAAAAAFHNDAAAA Virgil Mcdonald Virgil.Mcdonald@dUD.org +AAAAAAAAFMOKAAAA Harry Brown Harry.Brown@Clj2rtJAo.com +AAAAAAAAFMPPAAAA Manuel Bryant Manuel.Bryant@1LtMa1H0t8B5.edu +AAAAAAAAFOEDAAAA Lori Erwin Lori.Erwin@SkmpHUaEnhHBkQ.com +AAAAAAAAGCGIAAAA Mae Williams Mae.Williams@mfBvsN8VAQOX21Yh.org +AAAAAAAAGEKLAAAA Jerilyn Walker Jerilyn.Walker@hOIXjGj8unTzQ5J3Um.edu +AAAAAAAAGGMHAAAA Julia Fisher Julia.Fisher@eyrOB7M7abp.org +AAAAAAAAGHFDAAAA Laura Roy Laura.Roy@xb1d3mQ2.org +AAAAAAAAGLDMAAAA Alex Norris Alex.Norris@GABnCVFfjXxUV2Q.edu +AAAAAAAAGMFHAAAA Bruce Howe Bruce.Howe@yNj94o0DBJ.com +AAAAAAAAGMGEBAAA Tamika Potts Tamika.Potts@yzUu.edu +AAAAAAAAHBEABAAA Bonnie Cochran Bonnie.Cochran@D3oggm81Joopv.com +AAAAAAAAHEIFBAAA NULL Jones Ann.Jones@E1eNB.edu +AAAAAAAAHEPFBAAA Kathryn Kinney Kathryn.Kinney@Stq02g.com +AAAAAAAAHGKLAAAA Arthur Christensen Arthur.Christensen@VFNBhqKt1TAdrr.edu +AAAAAAAAHIEIAAAA William Roberts William.Roberts@ObeXEfeXMMgm.org +AAAAAAAAHLEAAAAA Geneva Sims Geneva.Sims@1E0ayoK5qFo.edu +AAAAAAAAHLJCAAAA Marlene Grover Marlene.Grover@F9DZzXQsJNYJ.org +AAAAAAAAHPMLAAAA Elizabeth Kennedy Elizabeth.Kennedy@A0YBfGbsbmc3om.edu +AAAAAAAAIANDAAAA Elva Wade Elva.Wade@4xZ1agk4PU9.edu +AAAAAAAAIBBFBAAA James Compton James.Compton@KzmxhGNiTqrp.com +AAAAAAAAIBJDBAAA Dean Velez Dean.Velez@ycRqZT5hVfX8ZZk.org +AAAAAAAAILLJAAAA Billy Ortiz Billy.Ortiz@AEcBAd1rTF.org +AAAAAAAAIODCBAAA Jennifer Crane Jennifer.Crane@Sbzbbg2f7tIl32aDBj.org +AAAAAAAAIPGJAAAA Michael NULL Michael.Connelly@K.edu +AAAAAAAAIPKJAAAA Charles Jones Charles.Jones@aZTRs91tA.org +AAAAAAAAJADIAAAA Margaret Roberts Margaret.Roberts@jp.edu +AAAAAAAAJBELAAAA Sean Busby Sean.Busby@HlbL26U77.edu +AAAAAAAAJCNBBAAA Johnnie Cox Johnnie.Cox@nNTlnRXjr5.edu +AAAAAAAAJDEFAAAA Loretta Serrano Loretta.Serrano@GYZpg38p40VgqS7L9.edu +AAAAAAAAJDKKAAAA Sharon Reynolds Sharon.Reynolds@tk5.org +AAAAAAAAJEDJAAAA David Taylor David.Taylor@kxn8ngym6u9XoC.org +AAAAAAAAJGDLAAAA Fredrick Davis Fredrick.Davis@fBIx4ZgRJ2.org +AAAAAAAAJHGFAAAA Pamela Gannon Pamela.Gannon@dx1Vy6KLG.org +AAAAAAAAJIAHAAAA Shawna Delgado Shawna.Delgado@Mu5QaTkI2N4tdINV.org +AAAAAAAAJILDBAAA Erica Reynolds Erica.Reynolds@NjAGMPr5SynCgvs.org +AAAAAAAAJMIDAAAA Sally Thurman Sally.Thurman@xTyyZ3qRIlqa8oBLYTNm.org +AAAAAAAAKAKPAAAA Carolann Royer Carolann.Royer@yVh8tzAJmV.com +AAAAAAAAKLHDAAAA Brittany Knox Brittany.Knox@ldm93PY1oSCUpHZQfy.org +AAAAAAAAKMHPAAAA Robert Jones Robert.Jones@rYXHiKMN4A.org +AAAAAAAAKNMEBAAA Amber Gonzalez Amber.Gonzalez@Va5m6mBBm.edu +AAAAAAAALEAHBAAA Eddie Pena Eddie.Pena@2L00HyEmYqdOy.org +AAAAAAAALMAJAAAA Ileen Linn Ileen.Linn@5FUTo7S.org +AAAAAAAALMGGBAAA Dedra Rainey Dedra.Rainey@ik6CKcRSdO6GBi.edu +AAAAAAAALNLABAAA Janie Garcia Janie.Garcia@IpXCI4cANG0F1M.org +AAAAAAAALPHGBAAA Dorothy Heller Dorothy.Heller@dXV5.edu +AAAAAAAAMFMKAAAA John Sanders John.Sanders@g.com +AAAAAAAAMHOLAAAA Terri Cook Terri.Cook@Vz02fJPUlPO.edu +AAAAAAAAMJFAAAAA Marcus Espinal Marcus.Espinal@zoIoG4RpC.com +AAAAAAAAMLOEAAAA Miguel Jackson Miguel.Jackson@i8Me4xM79.org +AAAAAAAANBECBAAA Michael Lombardi Michael.Lombardi@J.com +AAAAAAAANKBBAAAA Diann Saunders Diann.Saunders@g6OYMRl4DEBFz.org +AAAAAAAAOCDCAAAA Armando Jackson Armando.Jackson@IoY0Kf.edu +AAAAAAAAOEDIAAAA Alexander Rich Alexander.Rich@YT4HorlXiEXVj.org +AAAAAAAAOFFIAAAA Frank Milton Frank.Milton@satakl9QHE.edu +AAAAAAAAOJBPAAAA Jonathan Mcbride Jonathan.Mcbride@SjQzPb47cUO.com +AAAAAAAAOMOKAAAA Laurette Gary Laurette.Gary@bSgl2F0kEo2tf.org +AAAAAAAAOOKKAAAA Deborah Early Deborah.Early@Zpi3TmsGBi.edu +AAAAAAAAOPMDAAAA Peggy Smith Peggy.Smith@CfqGXuI6hH.org +AAAAAAAAOPPKAAAA Tina Johnson Tina.Johnson@LlITreSC2jD7.com +AAAAAAAAPAEEBAAA Audria Mattson Audria.Mattson@V6zU0l0A.com +AAAAAAAAPBIGBAAA Susie Zavala Susie.Zavala@C0UOUuL65F7kV.com +AAAAAAAAPEFLAAAA David Martinez David.Martinez@ghefIHRjR1N.com +AAAAAAAAPFKDAAAA Linda Simmons Linda.Simmons@P3L.com +AAAAAAAAPNMGAAAA Christine Olds Christine.Olds@acdIL3Bsp4QnMIc.org diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q12.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q12.sql.out new file mode 100644 index 0000000000000..e60df322b6489 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q12.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAAELBAAAA Precisely elderly bodies Books arts 1.40 11.21 0.01417562243122168 +AAAAAAAAALNCAAAA Great, contemporary workers would not remove of course cultural values. Then due children might see positive seconds. Significant problems w Books arts 0.55 515.52 0.65190159462474560 +AAAAAAAABKLDAAAA Forward psychological plants establish closely yet eastern changes. Likewise necessary techniques might drop. Pleasant operations like lonely things; dogs let regions. Forces might not result clearl Books arts 2.43 11462.46 14.49487110552909973 +AAAAAAAADLLDAAAA Black, following services justify by a investors; dirty, different charts will fly however prizes. Temporary, l Books arts 5.56 3400.60 4.30023386615632740 +AAAAAAAAFCIBAAAA United, important objectives put similarly large, previous phenomena; old, present days receive. Happy detectives assi Books arts 1.26 784.30 0.99178774958137022 +AAAAAAAAFFIBAAAA Naturally new years put serious, negative vehicles. Fin Books arts 3.34 3319.96 4.19826043236027781 +AAAAAAAAGHBAAAAA Hard different differences would not paint even. Together suitable schemes marry directly only open women. Social ca Books arts 2.65 229.68 0.29044219090124839 +AAAAAAAAGMFAAAAA Anonymous, useful women provoke slightly present persons. Ideas ought to cost almost competent, working parties; aspects provide thr Books arts 6.73 5752.44 7.27425669029944833 +AAAAAAAAHHEBAAAA Powerful walls will find; there scottish decades must not Books arts 4.16 434.76 0.54977641464745189 +AAAAAAAAIBOCAAAA Careful privileges ought to live rather to a boards. Possible, broad p Books arts 3.93 969.48 1.22595739827125692 +AAAAAAAAICMBAAAA Aside legitimate decisions may not stand probably sexual g Books arts 3.88 349.20 0.44158138742039332 +AAAAAAAAIFPBAAAA Specially interesting crews continue current, foreign directions; only social men would not call at least political children; circumstances could not understand now in a assessme Books arts 2.13 3343.99 4.22864760515441312 +AAAAAAAAIHNAAAAA Unlikely states take later in general extra inf Books arts 0.32 20046.98 25.35043883731064290 +AAAAAAAAJLHBAAAA Inches may lose from a problems. Firm, other corporations shall protect ashamed, important practices. Materials shall not make then by a police. Weeks used Books arts 0.84 11869.78 15.00994822673206253 +AAAAAAAAKHJDAAAA Relevant lips take so sure, manufacturing Books arts 8.80 5995.28 7.58134037907713537 +AAAAAAAAKHLBAAAA Extra, primitive weeks look obviou Books arts 1.18 425.89 0.53855984275049058 +AAAAAAAALCFBAAAA More than key reasons should remain. Words used to offer slowly british Books arts 0.28 7814.52 9.88186306879843074 +AAAAAAAALGEEAAAA Children may turn also above, historical aspects. Surveys migh Books arts 7.22 544.72 0.68882649872748182 +AAAAAAAALOKCAAAA Trustees know operations. Now past issues cut today german governments. British lines go critical, individual structures. Tonight adequate problems should no Books arts 4.05 152.67 0.19305907908783347 +AAAAAAAANMECAAAA Floors could not go only for a years. Special reasons shape consequently black, concerned instances. Mutual depths encourage both simple teachers. Cards favour massive Books arts 1.83 503.10 0.63619586486597904 +AAAAAAAAODBEAAAA Certain customers think exactly already necessary factories. Awkward doubts shall not forget fine Books arts 0.30 922.40 1.16642231316314662 +AAAAAAAAOODBAAAA Deep, big areas take for a facilities. Words could replace certainly cases; lights test. Nevertheless practical arts cross. Fa Books arts 7.37 230.48 0.29145383210954253 +AAAAAAAAAJJBAAAA New, reluctant associations see more different, physical symptoms; useful pounds ought to give. Subjects Books business 9.02 306.85 0.37352072221391094 +AAAAAAAABBLDAAAA Natural plans might not like n Books business 4.29 2484.54 3.02436752540117416 +AAAAAAAABINDAAAA Years shall want free objects. Old residents use absolutely so residential steps. Letters will share variables. Sure fres Books business 40.76 90.28 0.10989555418436330 +AAAAAAAACDDCAAAA Simple, great shops glance from a years. Lessons deepen here previous clients. Increased, silent flights open more great rocks. Brill Books business 8.92 393.75 0.47930188812686144 +AAAAAAAACGIDAAAA Groups must not put new, civil moves. Correct men laugh slightly total novels. Relatively public girls set even scott Books business 3.36 344.10 0.41886420242400767 +AAAAAAAACNEDAAAA Just young degrees stop posts. More than tight artists buy to a arts. European, essential techniques ought to sell to a offences. Sentences be Books business 2.58 184.08 0.22407591508925118 +AAAAAAAADEDAAAAA Junior, severe restrictions ought to want principles. Sure, Books business 9.77 1549.80 1.88653223166732663 +AAAAAAAAEEFDAAAA Remaining subjects handle even only certain ladies; eagerly literary days could not provide. Very different articles cut then. Boys see out of a houses. Governme Books business 9.03 6463.45 7.86779374936777799 +AAAAAAAAEGKCAAAA Russian windows should see in a weapons. New, considerable branches walk. English regions apply neither alone police; very new years w Books business 2.79 1635.60 1.99097439548011320 +AAAAAAAAEKDAAAAA Long groups used to create more tiny feet; tools used to dare still Books business 57.04 10558.62 12.85274032257534413 +AAAAAAAAEPLBAAAA Drugs must compensate dark, modest houses. Small pubs claim naturally accessible relationships. Distinguished Books business 1.66 31.78 0.03868498794837246 +AAAAAAAAFCGDAAAA Small, capable centres Books business 2.98 3219.72 3.91928349267255446 +AAAAAAAAFDLAAAAA Popular, different parameters might take open, used modules. Prisoners use pretty alternative lovers. Annual, professional others spend once true men. Other, small subsidies seem politically Books business 7.25 3862.88 4.70218584789203943 +AAAAAAAAFEGEAAAA Supreme, free uses handle even in the customers. Other minutes might not make of course social neighbours. So environmental rights come other, able sales Books business 8.08 10904.74 13.27406341976510738 +AAAAAAAAFHFCAAAA Sound, original activities consider quite to a attitudes. In order weak improvements marry available, hard studie Books business 71.27 385.84 0.46967324575204627 +AAAAAAAAHDLBAAAA Classic issues will draw as european, engl Books business 75.64 92.64 0.11276832232653319 +AAAAAAAAHJAAAAAA Again british shareholders see shares. American lives ought to establish horses. Then ideal conservatives might charge even nec Books business 2.44 5353.50 6.51667976657054660 +AAAAAAAAIMJAAAAA Departments could seek now for a commu Books business 5.93 6535.44 7.95542535045032467 +AAAAAAAAJFBEAAAA Paintings must not know primary, royal stands; similar, available others ough Books business 0.39 303.68 0.36966196161616580 +AAAAAAAAJJGBAAAA Most present eyes restore fat, central relationships; again considerable habits must face in a discussions. Engineers help at all direct occasions. Curiously del Books business 80.10 2096.55 2.55207713918062566 +AAAAAAAAKKDAAAAA Children would not mean in favour of a parts. Heavy, whole others shall mean on Books business 3.13 6646.96 8.09117581791421695 +AAAAAAAAKNJCAAAA White fees might combine reports. Tr Books business 2.09 500.56 0.60931899205277908 +AAAAAAAALDHBAAAA Most new weeks go yet members. Also encouraging delegates make publications. Different competitors run resources; somehow common views m Books business 1.07 974.26 1.18594198736882801 +AAAAAAAALOMDAAAA Only new systems might join late speeches. Materials could stay on a benefits. Corporate regulations must crawl definitely practical deaths. Windows might soothe despite a organisations. Old Books business 0.67 9075.35 11.04719337247520503 +AAAAAAAAMBECAAAA Professional managers form later initial grounds. Conscious, big risks restore. American, full rises say for a systems. Already Books business 5.27 890.13 1.08353267219901759 +AAAAAAAAMKGDAAAA Memories can earn particularly over quick contexts; alone differences make separate years; irish men mea Books business 4.23 2059.92 2.50748836924516678 +AAAAAAAANJLBAAAA Only, gothic Books business 1.68 4777.17 5.81512787530920297 +AAAAAAAAOAPAAAAA Silver, critical operations could help howev Books business 5.56 428.54 0.52165087273113702 +AAAAAAAAALNBAAAA Else substantial problems slip months. Just unique corporations put vast areas. Supporters like far perfect chapters. Now young reports become wrong trials. Available ears shall Books computers 51.46 2456.28 1.26602601850774711 +AAAAAAAACFMBAAAA At least remaining results shall keep cuts. Clients should meet policies. Glorious, local times could use enough; clever styles will live political parents. Single, gradual contracts will describe ho Books computers 9.51 10252.90 5.28459221471415324 +AAAAAAAACOFCAAAA Years learn here. Days make too. Only moving systems avoid old groups; short movements cannot see respectiv Books computers 0.60 1761.68 0.90801240749618444 +AAAAAAAADAHAAAAA Ga Books computers 5.53 7541.48 3.88706087988983530 +AAAAAAAADDBAAAAA S Books computers 65.78 4566.02 2.35343695385979752 +AAAAAAAAECHAAAAA Boxes batt Books computers 0.83 7844.04 4.04300760915510798 +AAAAAAAAEJECAAAA Artists make times. Rather ready functions must pre Books computers 5.71 3694.01 1.90398194531071494 +AAAAAAAAFDPCAAAA Limited, capable cities shall try during the bodies. Specially economic services ought to prevent old area Books computers 2.93 96.18 0.04957349425150028 +AAAAAAAAFHNAAAAA Legs throw then. Old-fashioned develo Books computers 2.66 718.55 0.37035801928067716 +AAAAAAAAFOCEAAAA Important, educational variables used to appear months. A Books computers 2.47 9922.02 5.11404867366677942 +AAAAAAAAGHEAAAAA Men should not turn shadows. Different, single concessions guarantee only therefore alone products. Books computers 8.38 4194.24 2.16181256528813215 +AAAAAAAAGIFEAAAA Educational, white teachers should not fix. Considerable, other services might not cover today on a forms. Successful genes fall otherwise so Books computers 1.65 14569.68 7.50956485471198434 +AAAAAAAAHGCEAAAA Present Books computers 2.84 12393.53 6.38792460190056468 +AAAAAAAAHHFDAAAA Multiple, dark feet mean more complex girls; schools may not answer frequently blue assets. Spiritual, dry patients may reply personnel Books computers 2.04 371.40 0.19142852739662305 +AAAAAAAAIBDEAAAA Private teachers ap Books computers 5.27 4911.39 2.53144899076602182 +AAAAAAAAIDCDAAAA Daily numbers sense interesting players. General advantages would speak here. Shelves shall know with the reductions. Again wrong mothers provide ways; as hot pr Books computers 7.56 689.26 0.35526124607807325 +AAAAAAAAIECAAAAA Inc, corporate ships slow evident degrees. Chosen, acute prices throw always. Budgets spend points. Commonly large events may mean. Bottles c Books computers 68.38 4.17 0.00214931868401701 +AAAAAAAAIOKCAAAA However old hours ma Books computers 8.84 451.53 0.23272946412330966 +AAAAAAAAJDOCAAAA Indeed other actions should provide after a ideas; exhibitio Books computers 6.95 8062.32 4.15551439149257400 +AAAAAAAAKDGEAAAA Perfect days find at all. Crimes might develop hopes. Much socialist grants drive current, useful walls. Emissions open naturally. Combinations shall not know. Tragic things shall not receive just Books computers 6.71 526.49 0.27136565802113105 +AAAAAAAAKOKBAAAA Human windows take right, variable steps. Years should buy often. Indeed thin figures may beat even up to a cars. Details may tell enough. Impossible, sufficient differences ought to return Books computers 4.47 1542.60 0.79509328584283986 +AAAAAAAAKPNDAAAA Left diff Books computers 0.74 5248.81 2.70536340572070289 +AAAAAAAAMDKBAAAA Friendly, hot computers tax elsewhere units. New, real officials should l Books computers 3.19 12378.72 6.38029117031536278 +AAAAAAAAMENDAAAA Kinds relieve really major practices. Then capable reserves could not approve foundations. Pos Books computers 7.23 1786.41 0.92075884659828053 +AAAAAAAAMJJCAAAA Visible, average words shall not want quite only public boundaries. Cars must telephone proposals. German things ask abilities. Windows cut again favorite offi Books computers 6.75 25255.89 13.01749550563031296 +AAAAAAAANANCAAAA Only increased errors must submit as rich, main Books computers 6.94 2429.79 1.25237243291071818 +AAAAAAAANFHDAAAA Meals ought to test. Round days might need most urban years. Political, english pages must see on a eyes. Only subsequent women may come better methods; difficult, social childr Books computers 7.23 6457.72 3.32846480866914548 +AAAAAAAANHFDAAAA Systems cannot see fairly practitioners. Little ca Books computers 1.73 6197.59 3.19438752586978211 +AAAAAAAANKLDAAAA Past beautiful others might not like more than legislative, small products. Close, wh Books computers 3.02 10232.30 5.27397447733028024 +AAAAAAAAOGDDAAAA Main problems wait properly. Everyday, foreign offenders can worry activities. Social, important shoes will afford okay physical parts. Very Books computers 1.40 2034.30 1.04852733786470188 +AAAAAAAAOGMDAAAA Schools offer quickly others. Further main buildings satisfy sadly great, productive figures. Years contribute acti Books computers 4.11 3975.90 2.04927485750197523 +AAAAAAAAOMDAAAAA Tiny, rare leaders mention old, precious areas; students will improve much multiple stars. Even confident solutions will include clearly single women. Please little rights will not mention harder com Books computers 1.45 11902.91 6.13504720795513872 +AAAAAAAAONDCAAAA Guidelines should investigate so. Usual personnel look now old, modern aspects. Discussions could appear once br Books computers 2.44 640.06 0.32990237815154161 +AAAAAAAAONHDAAAA Flat pleasant groups would go private, redundant eyes. Main devic Books computers 2.83 8359.41 4.30864175068552700 +AAAAAAAAOPNBAAAA Fine users go for a networks. Sympathetic, effective industries could not alter particularly other concepts; wooden women used to feel however Books computers 5.30 247.79 0.12771694885193653 +AAAAAAAAPAKAAAAA Real, domestic facilities turn often guilty symptoms. Winds get naturally intense islands. Products shall not travel a little clear shares; improved children may not apply wrong c Books computers 5.28 297.60 0.15339022550682558 +AAAAAAAAABIBAAAA Then irish champions must look now forward good women. Future, big models sign. Then different o Books cooking 85.81 6496.48 10.66582432143788856 +AAAAAAAAAGHBAAAA Valuable studies should persist so concerned parties. Always polite songs include then from the holes. There conventional areas might not explain theore Books cooking 1.58 2088.03 3.42809662430915734 +AAAAAAAAAIJCAAAA Meanings occur in a things. Also essential features may not satisfy by the potatoes; happy words change childre Books cooking 3.46 1496.40 2.45676728237440221 +AAAAAAAAAJDBAAAA Then dominant goods should combine probably american items. Important artists guess only sill Books cooking 6.67 5638.06 9.25648312220250073 +AAAAAAAADDNAAAAA Individual, remarkable services take by the interest Books cooking 6.05 0.00 0.00000000000000000 +AAAAAAAAEGFEAAAA Ultimately senior elections marry at l Books cooking 5.06 2060.48 3.38286544372280691 +AAAAAAAAEINDAAAA Hence young effects shall not solve however months. In order small activities must not return almost national foods. International decades take contributions. Sessions must see Books cooking 1.43 242.28 0.39777170353760369 +AAAAAAAAENDCAAAA Points trace so simple eyes. Short advisers shall not say limitations. Keys stretch in full now blue wings. Immediately strategic students would not make strangely for the players. Books cooking 1.69 12518.00 20.55186637313737424 +AAAAAAAAFDIAAAAA Great pp. will not r Books cooking 1.91 7268.22 11.93285558480304571 +AAAAAAAAGFGCAAAA Products may not resist further specif Books cooking 5.37 2.72 0.00446565557876128 +AAAAAAAAICAAAAAA Somet Books cooking 7.34 580.58 0.95318761614603744 +AAAAAAAAIFHDAAAA Genetic properties might describe therefore leaves; right other organisers must not talk even lives; methods carry thus wrong minutes. Proud worke Books cooking 1.08 1445.15 2.37262579398781566 +AAAAAAAAIHHDAAAA Urgent agencies mean over as a plants; then Books cooking 6.47 1312.79 2.15531911295662354 +AAAAAAAAILAEAAAA As light hundreds must establish on a services. Sometimes special results Books cooking 44.82 3513.30 5.76808372972867366 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q14.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q14.sql.out new file mode 100644 index 0000000000000..46b0ab1a3018d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q14.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +store 1001001 1 1 1217789.46 331 store 1001001 1 1 1234065.50 342 +store 1001002 1 1 553751.85 151 store 1001002 1 1 559183.12 158 +store 1002001 2 1 1249466.39 353 store 1002001 2 1 1576146.08 368 +store 1002002 2 1 547670.08 152 store 1002002 2 1 491380.52 130 +store 1003001 3 1 1167282.59 309 store 1003001 3 1 1045547.02 287 +store 1003002 3 1 789483.23 193 store 1003002 3 1 601149.89 165 +store 1004001 4 1 1522903.35 398 store 1004001 4 1 1062756.03 278 +store 1004002 4 1 541183.58 151 store 1004002 4 1 607217.67 151 +store 2001001 1 2 1145363.89 364 store 2001001 1 2 1303027.45 345 +store 2001002 1 2 627833.76 169 store 2001002 1 2 536535.24 161 +store 2002001 2 2 1440545.64 383 store 2002001 2 2 1329963.82 368 +store 2002002 2 2 747435.75 207 store 2002002 2 2 816248.81 208 +store 2003001 3 2 1388229.40 395 store 2003001 3 2 1469176.64 414 +store 2003002 3 2 716344.82 190 store 2003002 3 2 729626.91 181 +store 2004001 4 2 1613653.10 440 store 2004001 4 2 1488785.35 406 +store 2004002 4 2 657357.03 182 store 2004002 4 2 593298.47 162 +store 3001001 1 3 1282986.35 374 store 3001001 1 3 1519875.76 390 +store 3001002 1 3 673633.15 169 store 3001002 1 3 656845.65 177 +store 3002001 2 3 1333021.08 362 store 3002001 2 3 1241035.46 351 +store 3002002 2 3 748022.41 210 store 3002002 2 3 699267.97 190 +store 3003001 3 3 1134792.91 326 store 3003001 3 3 1020180.77 305 +store 3003002 3 3 802127.48 197 store 3003002 3 3 703596.57 195 +store 3004001 4 3 1385106.21 399 store 3004001 4 3 1338923.03 363 +store 3004002 4 3 732944.48 203 store 3004002 4 3 722668.95 194 +store 4001001 1 4 1157990.42 340 store 4001001 1 4 1349185.21 367 +store 4001002 1 4 621674.47 152 store 4001002 1 4 549243.01 154 +store 4002001 2 4 1568059.38 402 store 4002001 2 4 1452439.59 374 +store 4002002 2 4 694485.13 177 store 4002002 2 4 802206.88 214 +store 4003001 3 4 1593249.87 451 store 4003001 3 4 1456053.57 403 +store 4003002 3 4 662121.36 163 store 4003002 3 4 717341.48 189 +store 4004001 4 4 1248825.41 348 store 4004001 4 4 1389020.06 347 +store 4004002 4 4 718297.35 201 store 4004002 4 4 708937.79 199 +store 5001001 1 5 1273579.39 349 store 5001001 1 5 1253638.00 334 +store 5001002 1 5 825892.06 217 store 5001002 1 5 702168.77 206 +store 5002001 2 5 1486176.43 365 store 5002001 2 5 1243594.81 313 +store 5002002 2 5 633123.05 172 store 5002002 2 5 765400.35 202 +store 5003001 3 5 1477157.87 390 store 5003001 3 5 1314942.13 338 +store 5003002 3 5 697211.48 193 store 5003002 3 5 611056.63 180 +store 5004001 4 5 1287387.74 353 store 5004001 4 5 1459943.10 376 +store 5004002 4 5 587935.16 160 store 5004002 4 5 554584.12 154 +store 6001001 1 6 83017.27 25 store 6001001 1 6 53839.44 19 +store 6001002 1 6 38797.04 9 store 6001002 1 6 40326.43 9 +store 6001003 1 6 50457.02 12 store 6001003 1 6 53585.59 10 +store 6001004 1 6 85147.15 18 store 6001004 1 6 88513.17 27 +store 6001005 1 6 174523.58 45 store 6001005 1 6 96635.15 31 +store 6001006 1 6 61231.20 15 store 6001006 1 6 52077.07 12 +store 6001007 1 6 69263.80 19 store 6001007 1 6 51940.50 18 +store 6001008 1 6 7774.49 5 store 6001008 1 6 34176.00 11 +store 6002001 2 6 137288.11 36 store 6002001 2 6 158530.44 40 +store 6002002 2 6 32548.73 11 store 6002002 2 6 87976.59 21 +store 6002003 2 6 73606.51 23 store 6002003 2 6 75815.97 30 +store 6002004 2 6 53750.06 10 store 6002004 2 6 47235.26 13 +store 6002005 2 6 102178.51 28 store 6002005 2 6 65676.11 26 +store 6002006 2 6 54942.99 11 store 6002006 2 6 19627.43 5 +store 6002007 2 6 90084.17 30 store 6002007 2 6 92767.58 27 +store 6002008 2 6 39639.50 9 store 6002008 2 6 22406.00 6 +store 6003001 3 6 51483.85 13 store 6003001 3 6 54481.52 8 +store 6003003 3 6 47337.51 12 store 6003003 3 6 45051.71 13 +store 6003004 3 6 10107.64 5 store 6003004 3 6 32499.05 7 +store 6003005 3 6 66634.50 24 store 6003005 3 6 108128.10 28 +store 6003006 3 6 48367.44 18 store 6003006 3 6 40436.80 10 +store 6003007 3 6 81724.63 24 store 6003007 3 6 53676.25 15 +store 6003008 3 6 38023.42 10 store 6003008 3 6 86371.33 18 +store 6004001 4 6 46759.68 16 store 6004001 4 6 98037.79 25 +store 6004002 4 6 32304.25 8 store 6004002 4 6 31274.82 9 +store 6004003 4 6 69089.26 18 store 6004003 4 6 70840.13 21 +store 6004004 4 6 40891.73 9 store 6004004 4 6 37496.52 13 +store 6004005 4 6 47341.21 14 store 6004005 4 6 11576.16 4 +store 6004006 4 6 37823.00 15 store 6004006 4 6 95562.26 20 +store 6004007 4 6 107423.33 25 store 6004007 4 6 49625.35 14 +store 6004008 4 6 29725.16 11 store 6004008 4 6 80015.81 19 +store 6005001 5 6 57198.07 20 store 6005001 5 6 61313.19 22 +store 6005002 5 6 26742.25 7 store 6005002 5 6 8143.14 3 +store 6005003 5 6 220162.11 49 store 6005003 5 6 156718.19 37 +store 6005004 5 6 11571.97 5 store 6005004 5 6 47370.39 12 +store 6005005 5 6 98809.34 31 store 6005005 5 6 139898.64 34 +store 6005006 5 6 18108.22 5 store 6005006 5 6 23139.57 5 +store 6005007 5 6 74967.30 18 store 6005007 5 6 49412.83 17 +store 6005008 5 6 71048.66 14 store 6005008 5 6 35086.91 13 +store 6006001 6 6 33781.32 9 store 6006001 6 6 33793.98 13 +store 6006003 6 6 97264.81 19 store 6006003 6 6 68109.24 28 +store 6006004 6 6 68406.20 16 store 6006004 6 6 45670.46 17 +store 6006005 6 6 56934.37 15 store 6006005 6 6 80912.54 19 +store 6006006 6 6 9360.35 4 store 6006006 6 6 63735.59 18 +store 6006007 6 6 15367.23 7 store 6006007 6 6 35007.03 7 +store 6006008 6 6 32684.13 6 store 6006008 6 6 17541.68 5 +store 6007001 7 6 20878.30 5 store 6007001 7 6 31745.91 6 +store 6007002 7 6 22897.56 7 store 6007002 7 6 49259.06 10 +store 6007003 7 6 23239.07 10 store 6007003 7 6 58808.25 19 +store 6007004 7 6 47157.82 10 store 6007004 7 6 35948.03 11 +store 6007005 7 6 108100.32 27 store 6007005 7 6 61513.57 21 +store 6007006 7 6 49256.53 10 store 6007006 7 6 16532.02 5 +store 6007007 7 6 65032.83 21 store 6007007 7 6 110874.54 26 +store 6007008 7 6 56626.18 12 store 6007008 7 6 88630.08 17 +store 6008001 8 6 138363.66 40 store 6008001 8 6 118280.46 34 +store 6008002 8 6 59363.03 20 store 6008002 8 6 35498.23 9 +store 6008004 8 6 48538.79 12 store 6008004 8 6 15279.50 6 +store 6008005 8 6 107128.07 41 store 6008005 8 6 174087.69 43 +store 6008006 8 6 18420.16 7 store 6008006 8 6 19669.85 8 +store 6008007 8 6 33281.27 10 store 6008007 8 6 50246.87 12 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q14a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q14a.sql.out new file mode 100644 index 0000000000000..027c177ab7710 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q14a.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL NULL NULL 677178449.86 157050 +catalog NULL NULL NULL 235662013.22 46193 +catalog 1001001 NULL NULL 2553656.44 520 +catalog 1001001 1 NULL 2222983.82 453 +catalog 1001001 1 1 1860468.47 369 +catalog 1001001 1 2 33739.75 3 +catalog 1001001 1 3 49979.66 13 +catalog 1001001 1 4 49610.76 10 +catalog 1001001 1 5 61333.54 13 +catalog 1001001 1 6 31767.56 6 +catalog 1001001 1 7 19752.34 6 +catalog 1001001 1 8 43708.18 12 +catalog 1001001 1 9 36388.85 11 +catalog 1001001 1 10 36234.71 10 +catalog 1001001 2 NULL 41208.06 6 +catalog 1001001 2 3 41208.06 6 +catalog 1001001 3 NULL 85518.68 19 +catalog 1001001 3 1 11946.51 5 +catalog 1001001 3 4 32093.25 7 +catalog 1001001 3 6 6905.04 2 +catalog 1001001 3 7 34573.88 5 +catalog 1001001 4 NULL 22702.37 6 +catalog 1001001 4 7 22702.37 6 +catalog 1001001 5 NULL 15433.39 3 +catalog 1001001 5 9 15433.39 3 +catalog 1001001 8 NULL 22550.38 4 +catalog 1001001 8 9 22550.38 4 +catalog 1001001 10 NULL 29206.10 5 +catalog 1001001 10 7 29206.10 5 +catalog 1001001 13 NULL 9727.21 3 +catalog 1001001 13 9 9727.21 3 +catalog 1001001 14 NULL 80584.37 15 +catalog 1001001 14 9 17298.44 3 +catalog 1001001 14 10 63285.93 12 +catalog 1001001 16 NULL 23742.06 6 +catalog 1001001 16 9 23742.06 6 +catalog 1001002 NULL NULL 2674718.24 515 +catalog 1001002 1 NULL 2413496.48 456 +catalog 1001002 1 1 2413496.48 456 +catalog 1001002 2 NULL 40653.02 10 +catalog 1001002 2 1 40653.02 10 +catalog 1001002 3 NULL 55083.13 11 +catalog 1001002 3 1 55083.13 11 +catalog 1001002 4 NULL 59222.69 15 +catalog 1001002 4 1 59222.69 15 +catalog 1001002 7 NULL 23174.76 3 +catalog 1001002 7 1 23174.76 3 +catalog 1001002 10 NULL 40160.58 11 +catalog 1001002 10 1 40160.58 11 +catalog 1001002 12 NULL 25963.72 6 +catalog 1001002 12 1 25963.72 6 +catalog 1001002 13 NULL 11354.62 2 +catalog 1001002 13 1 11354.62 2 +catalog 1001002 14 NULL 5609.24 1 +catalog 1001002 14 1 5609.24 1 +catalog 1002001 NULL NULL 2907063.96 511 +catalog 1002001 1 NULL 88041.35 10 +catalog 1002001 1 1 38209.40 6 +catalog 1002001 1 5 49831.95 4 +catalog 1002001 2 NULL 2574507.86 463 +catalog 1002001 2 1 2132551.78 377 +catalog 1002001 2 3 34961.36 11 +catalog 1002001 2 4 50761.02 9 +catalog 1002001 2 6 99382.39 16 +catalog 1002001 2 7 43547.86 4 +catalog 1002001 2 8 104272.59 23 +catalog 1002001 2 9 62741.20 11 +catalog 1002001 2 10 46289.66 12 +catalog 1002001 3 NULL 44220.16 5 +catalog 1002001 3 1 44220.16 5 +catalog 1002001 4 NULL 86121.32 15 +catalog 1002001 4 1 28141.23 5 +catalog 1002001 4 3 29119.15 5 +catalog 1002001 4 5 28860.94 5 +catalog 1002001 5 NULL 26371.70 2 +catalog 1002001 5 9 26371.70 2 +catalog 1002001 6 NULL 32428.43 4 +catalog 1002001 6 10 32428.43 4 +catalog 1002001 8 NULL 19630.88 3 +catalog 1002001 8 8 19630.88 3 +catalog 1002001 10 NULL 20942.49 5 +catalog 1002001 10 8 20942.49 5 +catalog 1002001 11 NULL 6069.54 2 +catalog 1002001 11 8 6069.54 2 +catalog 1002001 12 NULL 8730.23 2 +catalog 1002001 12 7 8730.23 2 +catalog 1002002 NULL NULL 2695862.91 567 +catalog 1002002 1 NULL 79482.49 21 +catalog 1002002 1 1 79482.49 21 +catalog 1002002 2 NULL 2153480.10 444 +catalog 1002002 2 1 2153480.10 444 +catalog 1002002 3 NULL 64329.01 20 +catalog 1002002 3 1 64329.01 20 +catalog 1002002 4 NULL 98180.19 26 +catalog 1002002 4 1 98180.19 26 +catalog 1002002 7 NULL 45311.61 6 +catalog 1002002 7 1 45311.61 6 +catalog 1002002 8 NULL 16754.12 4 +catalog 1002002 8 1 16754.12 4 +catalog 1002002 9 NULL 30603.32 7 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q18a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q18a.sql.out new file mode 100644 index 0000000000000..40e6ac10e6a33 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q18a.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL NULL NULL 49.988822 101.021588 257.990037 51.117224 -216.279125 1957.948730 3.062849 +AAAAAAAAAAAEAAAA NULL NULL NULL 83.000000 14.310000 0.000000 7.580000 -377.650000 1980.000000 5.000000 +AAAAAAAAAABEAAAA NULL NULL NULL 45.000000 57.980000 0.000000 44.640000 -95.400000 1951.000000 1.000000 +AAAAAAAAAADBAAAA NULL NULL NULL 19.000000 232.670000 0.000000 62.820000 -679.630000 1933.000000 6.000000 +AAAAAAAAAAEDAAAA NULL NULL NULL 57.000000 119.920000 0.000000 119.920000 3329.940000 1946.000000 6.000000 +AAAAAAAAAAFAAAAA NULL NULL NULL 83.000000 141.350000 0.000000 12.720000 -6142.000000 1991.000000 4.000000 +AAAAAAAAAAHBAAAA NULL NULL NULL 97.000000 83.210000 0.000000 71.560000 431.650000 1924.000000 3.000000 +AAAAAAAAAAHDAAAA NULL NULL NULL 53.500000 97.390000 0.000000 52.640000 -6.425000 1974.000000 2.500000 +AAAAAAAAAAKAAAAA NULL NULL NULL 69.000000 127.490000 0.000000 101.990000 2660.640000 1948.000000 2.000000 +AAAAAAAAAALAAAAA NULL NULL NULL 88.000000 143.850000 0.000000 28.770000 -2337.280000 1944.000000 5.000000 +AAAAAAAAAALDAAAA NULL NULL NULL 19.000000 116.590000 0.000000 5.820000 -1366.290000 1949.000000 2.000000 +AAAAAAAAAAMBAAAA NULL NULL NULL 1.000000 37.170000 0.000000 30.100000 13.430000 1932.000000 2.000000 +AAAAAAAAAAOAAAAA NULL NULL NULL 87.000000 26.050000 0.000000 1.820000 -963.960000 1985.000000 4.000000 +AAAAAAAAABAEAAAA NULL NULL NULL 91.000000 67.860000 56.180000 8.820000 -4041.070000 1970.000000 0.000000 +AAAAAAAAABBDAAAA NULL NULL NULL 71.000000 31.880000 0.000000 15.300000 -23.430000 1979.000000 6.000000 +AAAAAAAAABCEAAAA NULL NULL NULL 65.000000 115.550000 0.000000 25.420000 -1641.900000 1973.000000 6.000000 +AAAAAAAAABDAAAAA NULL NULL NULL 71.000000 40.670000 0.000000 13.820000 -269.090000 1968.000000 0.000000 +AAAAAAAAABFCAAAA NULL NULL NULL 2.000000 237.540000 0.000000 35.630000 -101.500000 1932.000000 1.000000 +AAAAAAAAABGBAAAA NULL NULL NULL 25.500000 149.375000 0.000000 87.680000 -85.130000 1955.000000 4.000000 +AAAAAAAAABGEAAAA NULL NULL NULL 32.500000 237.875000 0.000000 107.305000 615.725000 1969.000000 3.000000 +AAAAAAAAABJDAAAA NULL NULL NULL 12.000000 118.140000 0.000000 54.340000 -405.960000 1971.000000 4.000000 +AAAAAAAAACAAAAAA NULL NULL NULL 40.000000 218.900000 0.000000 168.550000 3400.000000 1984.000000 2.000000 +AAAAAAAAACDCAAAA NULL NULL NULL 9.000000 27.400000 0.000000 18.630000 -11.070000 1982.000000 0.000000 +AAAAAAAAACDDAAAA NULL NULL NULL 9.000000 72.980000 0.000000 36.490000 85.140000 1925.000000 4.000000 +AAAAAAAAACGDAAAA NULL NULL NULL 100.000000 240.000000 0.000000 52.800000 -3171.000000 1984.000000 2.000000 +AAAAAAAAACJAAAAA NULL NULL NULL 89.000000 141.410000 0.000000 91.910000 3394.460000 1939.000000 5.000000 +AAAAAAAAACJCAAAA NULL NULL NULL 97.000000 68.650000 0.000000 60.410000 2160.190000 1979.000000 5.000000 +AAAAAAAAACMAAAAA NULL NULL NULL 36.000000 5.030000 0.000000 1.200000 -23.400000 1973.000000 6.000000 +AAAAAAAAACPDAAAA NULL NULL NULL 89.000000 165.880000 0.000000 48.100000 -1248.670000 1988.000000 5.000000 +AAAAAAAAADDEAAAA NULL NULL NULL 44.000000 152.720000 0.000000 138.970000 3326.400000 1930.000000 6.000000 +AAAAAAAAADFAAAAA NULL NULL NULL 52.000000 99.460000 465.420000 59.670000 242.820000 1945.000000 2.000000 +AAAAAAAAADGBAAAA NULL NULL NULL 51.000000 48.560000 0.000000 12.620000 -1473.390000 1935.000000 3.000000 +AAAAAAAAADIAAAAA NULL NULL NULL 27.000000 175.020000 0.000000 47.250000 -388.260000 1924.000000 3.000000 +AAAAAAAAADMCAAAA NULL NULL NULL 89.000000 161.440000 0.000000 35.510000 -4648.470000 1924.000000 6.000000 +AAAAAAAAADNAAAAA NULL NULL NULL 57.000000 107.880000 975.770000 24.810000 -2503.940000 1975.000000 2.000000 +AAAAAAAAADNBAAAA NULL NULL NULL 32.000000 52.410000 0.000000 33.540000 274.560000 1975.000000 5.000000 +AAAAAAAAADPBAAAA NULL NULL NULL 72.000000 65.940000 3.770000 1.310000 -3562.010000 1932.000000 5.000000 +AAAAAAAAAEABAAAA NULL NULL NULL 57.000000 200.610000 0.000000 24.070000 -4047.570000 1987.000000 5.000000 +AAAAAAAAAEADAAAA NULL NULL NULL 61.000000 28.010000 0.000000 18.480000 85.400000 1970.000000 2.000000 +AAAAAAAAAEAEAAAA NULL NULL NULL 95.000000 155.800000 0.000000 4.670000 -5184.150000 1966.000000 4.000000 +AAAAAAAAAEBDAAAA NULL NULL NULL 57.000000 257.970000 0.000000 36.110000 -2994.780000 1990.000000 4.000000 +AAAAAAAAAECCAAAA NULL NULL NULL 40.000000 81.220000 0.000000 51.160000 746.800000 1975.000000 1.000000 +AAAAAAAAAEDAAAAA NULL NULL NULL 63.000000 31.950000 564.530000 14.690000 -809.600000 1966.000000 6.000000 +AAAAAAAAAEJAAAAA NULL NULL NULL 83.000000 48.220000 202.630000 6.260000 -2670.220000 1944.000000 3.000000 +AAAAAAAAAEJDAAAA NULL NULL NULL 4.000000 39.860000 0.000000 0.790000 -66.480000 1958.000000 3.000000 +AAAAAAAAAELCAAAA NULL NULL NULL 34.000000 106.700000 0.000000 17.070000 -1481.040000 1925.000000 1.000000 +AAAAAAAAAENAAAAA NULL NULL NULL 49.000000 205.770000 0.000000 141.980000 3018.400000 1926.000000 2.000000 +AAAAAAAAAENCAAAA NULL NULL NULL 67.000000 121.280000 0.000000 115.210000 4025.360000 1947.000000 3.000000 +AAAAAAAAAEPAAAAA NULL NULL NULL 73.000000 85.250000 0.000000 3.410000 -4651.560000 1975.000000 1.000000 +AAAAAAAAAEPDAAAA NULL NULL NULL 28.000000 91.090000 0.000000 43.720000 -177.240000 1987.000000 5.000000 +AAAAAAAAAFADAAAA NULL NULL NULL 15.000000 109.790000 0.000000 62.580000 139.200000 1963.000000 4.000000 +AAAAAAAAAFCAAAAA NULL NULL NULL 23.000000 8.880000 0.000000 1.950000 -67.390000 1988.000000 0.000000 +AAAAAAAAAFCBAAAA NULL NULL NULL 74.000000 14.690000 0.000000 10.720000 -69.560000 1954.000000 3.000000 +AAAAAAAAAFHCAAAA NULL NULL NULL 53.000000 48.210000 350.520000 47.240000 5.640000 1960.000000 1.000000 +AAAAAAAAAFMCAAAA NULL NULL NULL 42.000000 56.730000 828.590000 53.320000 -380.870000 1944.000000 5.000000 +AAAAAAAAAFODAAAA NULL NULL NULL 15.000000 23.690000 0.000000 17.530000 139.950000 1973.000000 5.000000 +AAAAAAAAAFPAAAAA NULL NULL NULL 89.000000 126.010000 0.000000 75.600000 -507.300000 1938.000000 6.000000 +AAAAAAAAAGEBAAAA NULL NULL NULL 55.000000 78.640000 0.000000 7.070000 -1731.400000 1957.000000 0.000000 +AAAAAAAAAGEDAAAA NULL NULL NULL 19.000000 205.240000 0.000000 22.570000 -1223.600000 1935.000000 0.000000 +AAAAAAAAAGEEAAAA NULL NULL NULL 40.000000 128.550000 488.400000 48.840000 -882.800000 1934.000000 6.000000 +AAAAAAAAAGIDAAAA NULL NULL NULL 11.000000 125.030000 0.000000 13.750000 -753.610000 1935.000000 0.000000 +AAAAAAAAAGJCAAAA NULL NULL NULL 8.000000 190.590000 0.000000 142.940000 369.520000 1941.000000 4.000000 +AAAAAAAAAGKDAAAA NULL NULL NULL 80.000000 257.180000 0.000000 100.300000 953.600000 1960.000000 1.000000 +AAAAAAAAAGLAAAAA NULL NULL NULL 44.000000 58.460000 411.400000 9.350000 -1811.480000 1973.000000 6.000000 +AAAAAAAAAGMBAAAA NULL NULL NULL 86.000000 110.960000 0.000000 4.430000 -3732.400000 1946.000000 0.000000 +AAAAAAAAAGNBAAAA NULL NULL NULL 41.000000 133.900000 0.000000 1.330000 -3118.870000 1948.000000 5.000000 +AAAAAAAAAGPBAAAA NULL NULL NULL 45.000000 57.940000 876.960000 33.600000 -529.110000 1965.000000 6.000000 +AAAAAAAAAHAAAAAA NULL NULL NULL 20.000000 51.470000 0.000000 26.240000 -205.400000 1942.000000 5.000000 +AAAAAAAAAHBAAAAA NULL NULL NULL 50.500000 70.085000 0.000000 55.760000 724.565000 1957.000000 2.000000 +AAAAAAAAAHDEAAAA NULL NULL NULL 79.000000 21.510000 0.000000 7.950000 -631.210000 1943.000000 6.000000 +AAAAAAAAAHEDAAAA NULL NULL NULL 93.000000 23.200000 0.000000 2.320000 -1272.240000 1948.000000 5.000000 +AAAAAAAAAHFEAAAA NULL NULL NULL 75.000000 57.750000 508.650000 14.430000 -870.150000 1965.000000 6.000000 +AAAAAAAAAHGDAAAA NULL NULL NULL 71.000000 3.020000 0.000000 1.540000 -80.940000 1984.000000 2.000000 +AAAAAAAAAHIBAAAA NULL NULL NULL 30.500000 59.105000 0.000000 41.310000 452.755000 1957.500000 3.000000 +AAAAAAAAAHKAAAAA NULL NULL NULL 38.000000 89.720000 0.000000 20.630000 -1257.800000 1939.000000 5.000000 +AAAAAAAAAHKCAAAA NULL NULL NULL 71.000000 141.010000 0.000000 90.240000 2269.870000 1924.000000 0.000000 +AAAAAAAAAHNDAAAA NULL NULL NULL 51.000000 63.060000 0.000000 5.040000 -2107.830000 1975.000000 1.000000 +AAAAAAAAAIDAAAAA NULL NULL NULL 77.000000 36.770000 0.000000 26.100000 -72.380000 1986.000000 2.000000 +AAAAAAAAAIEEAAAA NULL NULL NULL 1.000000 145.160000 0.000000 133.540000 45.560000 1958.000000 3.000000 +AAAAAAAAAIIAAAAA NULL NULL NULL 53.000000 232.610000 0.000000 0.000000 -4466.840000 1971.000000 4.000000 +AAAAAAAAAIJAAAAA NULL NULL NULL 91.000000 62.950000 0.000000 26.430000 -107.380000 1935.000000 6.000000 +AAAAAAAAAIKBAAAA NULL NULL NULL 73.000000 6.890000 124.470000 2.890000 -280.690000 1935.000000 3.000000 +AAAAAAAAAILBAAAA NULL NULL NULL 7.000000 15.340000 0.000000 1.070000 -73.290000 1966.000000 4.000000 +AAAAAAAAAILDAAAA NULL NULL NULL 27.500000 69.010000 200.210000 38.180000 -143.600000 1974.000000 2.500000 +AAAAAAAAAIODAAAA NULL NULL NULL 99.000000 84.610000 663.300000 60.910000 -931.590000 1986.000000 1.000000 +AAAAAAAAAIPCAAAA NULL NULL NULL 96.000000 183.920000 0.000000 22.070000 -3887.040000 1924.000000 3.000000 +AAAAAAAAAJACAAAA NULL NULL NULL 62.000000 128.680000 0.000000 104.230000 2698.860000 1975.000000 4.000000 +AAAAAAAAAJAEAAAA NULL NULL NULL 81.000000 131.730000 0.000000 23.710000 -4963.680000 1968.000000 5.000000 +AAAAAAAAAJBAAAAA NULL NULL NULL 19.000000 113.950000 0.000000 79.760000 613.320000 1930.000000 2.000000 +AAAAAAAAAJBBAAAA NULL NULL NULL 60.500000 140.315000 1093.800000 51.610000 -1455.575000 1976.000000 2.500000 +AAAAAAAAAJBDAAAA NULL NULL NULL 4.000000 85.990000 82.520000 20.630000 -252.920000 1988.000000 5.000000 +AAAAAAAAAJDEAAAA NULL NULL NULL 21.000000 7.750000 38.220000 7.280000 42.000000 1948.000000 0.000000 +AAAAAAAAAJEAAAAA NULL NULL NULL 47.000000 95.750000 0.000000 44.040000 -1744.170000 1935.000000 0.000000 +AAAAAAAAAJEDAAAA NULL NULL NULL 27.000000 38.270000 0.000000 21.040000 -300.240000 1976.000000 6.000000 +AAAAAAAAAJFDAAAA NULL NULL NULL 82.000000 22.310000 0.000000 6.690000 -80.360000 1973.000000 5.000000 +AAAAAAAAAJGBAAAA NULL NULL NULL 64.000000 155.160000 0.000000 34.130000 -3623.040000 1975.000000 5.000000 +AAAAAAAAAJGCAAAA NULL NULL NULL 8.000000 2.080000 0.000000 1.200000 0.720000 1932.000000 0.000000 +AAAAAAAAAJJCAAAA NULL NULL NULL 61.000000 30.960000 0.000000 0.610000 -875.350000 1932.000000 2.000000 +AAAAAAAAAJKBAAAA NULL NULL NULL 13.000000 30.910000 0.000000 14.520000 43.680000 1928.000000 6.000000 +AAAAAAAAAJLCAAAA NULL NULL NULL 25.000000 7.330000 0.000000 0.580000 -116.500000 1970.000000 0.000000 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q20.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q20.sql.out new file mode 100644 index 0000000000000..49c6cf986ae4c --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q20.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAMJJBAAAA NULL Books NULL NULL 9010.49 72.07596281370536693 +AAAAAAAAMLGDAAAA NULL Books NULL 6.35 1491.96 11.93436244638591899 +AAAAAAAAAELBAAAA Precisely elderly bodies Books arts 1.40 4094.31 1.52075020571659240 +AAAAAAAAAFODAAAA Close, precise teeth should go for a qualities. Political groups shall not become just important occasions. Trials mean ne Books arts 2.53 332.38 0.12345595555199313 +AAAAAAAAAHMAAAAA Abilities could affect cruel parts. Predominantly other events telephone strong signs. Accurate mate Books arts 25.69 2626.56 0.97558359291967949 +AAAAAAAAAJOAAAAA Average parents require also times. Children would not describe lightly purposes; large miles love now correct relations. Usual, german goals proceed literary, wooden visitors. Initial councils wil Books arts 1.24 12327.20 4.57869383019594946 +AAAAAAAAALNCAAAA Great, contemporary workers would not remove of course cultural values. Then due children might see positive seconds. Significant problems w Books arts 0.55 343.80 0.12769768794384511 +AAAAAAAAANKAAAAA Small objects stop etc mediterranean patterns; liberal, free initiatives would not leave less clear british attitudes; good, blue relationships find softly very Books arts 58.41 886.92 0.32942883476194038 +AAAAAAAABGDAAAAA Newly national rights head curiously all electrical cells. Chinese, long values might not pull bad lines. High fun clothes ough Books arts 3.28 2219.85 0.82451923380495801 +AAAAAAAACBBAAAAA Quick, easy studies must make always necessary systems. Upper, new persons should buy much physical technologies. English sciences hear solicitors. S Books arts 0.99 2050.16 0.76149125047979491 +AAAAAAAACMFDAAAA Early, short v Books arts 75.57 5429.86 2.01681375177070042 +AAAAAAAADLLDAAAA Black, following services justify by a investors; dirty, different charts will fly however prizes. Temporary, l Books arts 5.56 13539.35 5.02892289488801418 +AAAAAAAAEIPCAAAA Scientific, difficult polls would not achieve. Countries reach of course. Bad, new churches realize most english Books arts 3.98 143.88 0.05344137097545211 +AAAAAAAAFCIBAAAA United, important objectives put similarly large, previous phenomena; old, present days receive. Happy detectives assi Books arts 1.26 12297.15 4.56753235398096242 +AAAAAAAAFFIBAAAA Naturally new years put serious, negative vehicles. Fin Books arts 3.34 4587.47 1.70392470189572752 +AAAAAAAAFJGCAAAA Ago correct profits must not handle else. Healthy children may not go only ancient words. Later just characters ought to drink about. British parts must watch soon ago other clients. So vital d Books arts 4.03 5359.20 1.99056849688381241 +AAAAAAAAFLNCAAAA Much new waters Books arts 1.85 6718.63 2.49550179508480530 +AAAAAAAAGHBAAAAA Hard different differences would not paint even. Together suitable schemes marry directly only open women. Social ca Books arts 2.65 3208.60 1.19177080144450674 +AAAAAAAAGLEBAAAA Tall, following actions keep widely willing, secondary groups. Heads could afford however; agricultural, square pri Books arts 9.99 4780.52 1.77562929368618505 +AAAAAAAAGMFAAAAA Anonymous, useful women provoke slightly present persons. Ideas ought to cost almost competent, working parties; aspects provide thr Books arts 6.73 5622.46 2.08835119999055082 +AAAAAAAAHHEBAAAA Powerful walls will find; there scottish decades must not Books arts 4.16 7914.41 2.93965054810833964 +AAAAAAAAHMCEAAAA Too executive doors progress mainly seemingly possible parts; hundreds stay virtually simple workers. Sola Books arts 34.32 3029.48 1.12524023173973205 +AAAAAAAAIBOCAAAA Careful privileges ought to live rather to a boards. Possible, broad p Books arts 3.93 1450.99 0.53894144336718969 +AAAAAAAAICMBAAAA Aside legitimate decisions may not stand probably sexual g Books arts 3.88 9619.83 3.57309496629679899 +AAAAAAAAIFPBAAAA Specially interesting crews continue current, foreign directions; only social men would not call at least political children; circumstances could not understand now in a assessme Books arts 2.13 13616.57 5.05760473160419719 +AAAAAAAAIHNAAAAA Unlikely states take later in general extra inf Books arts 0.32 11879.56 4.41242683475911751 +AAAAAAAAINFDAAAA Sometimes careful things state probably so Books arts 5.08 25457.85 9.45581321995700176 +AAAAAAAAJGHDAAAA Circumstances would not use. Principles seem writers. Times go from a hands. Members find grounds. Central, only teachers pursue properly into a p Books arts 5.95 2567.54 0.95366178505916251 +AAAAAAAAJLHBAAAA Inches may lose from a problems. Firm, other corporations shall protect ashamed, important practices. Materials shall not make then by a police. Weeks used Books arts 0.84 1811.85 0.67297572978782944 +AAAAAAAAKFGBAAAA Systems cannot await regions. Home appropr Books arts 7.30 1730.16 0.64263360027028230 +AAAAAAAAKHLBAAAA Extra, primitive weeks look obviou Books arts 1.18 22.77 0.00845746467272063 +AAAAAAAALCFBAAAA More than key reasons should remain. Words used to offer slowly british Books arts 0.28 10311.18 3.82988320527288194 +AAAAAAAALGEEAAAA Children may turn also above, historical aspects. Surveys migh Books arts 7.22 11872.32 4.40973768042312729 +AAAAAAAALOKCAAAA Trustees know operations. Now past issues cut today german governments. British lines go critical, individual structures. Tonight adequate problems should no Books arts 4.05 8348.99 3.10106666569599586 +AAAAAAAAMACDAAAA Useful observers start often white colleagues; simple pro Books arts 3.47 7565.51 2.81005856636428042 +AAAAAAAAMNPAAAAA Members should say earnings. Detailed departments would not move just at the hopes. Figures can take. Actually open houses want. Good teachers combine the Books arts 3.09 4363.97 1.62091006182752106 +AAAAAAAAMPFCAAAA Major, senior words afford economic libraries; successful seconds need outside. Clinical, new ideas put now red c Books arts 5.87 9661.08 3.58841646026911898 +AAAAAAAANABCAAAA Likely states feel astonishingly working roads. Parents put so somewhere able policies. Others may rely shortly instead interesting bodies; bri Books arts 7.50 132.66 0.04927392461498107 +AAAAAAAANMECAAAA Floors could not go only for a years. Special reasons shape consequently black, concerned instances. Mutual depths encourage both simple teachers. Cards favour massive Books arts 1.83 20114.53 7.47114303396483641 +AAAAAAAAOAHCAAAA Accurate years want then other organisations. Simple lines mean as well so red results. Orthodox, central scales will not in Books arts 7.69 2153.04 0.79970398502215321 +AAAAAAAAODBEAAAA Certain customers think exactly already necessary factories. Awkward doubts shall not forget fine Books arts 0.30 231.71 0.08606408165639427 +AAAAAAAAOKEDAAAA Visitors could not allow glad wages. Communist, real figures used to apply factors. Aggressive, optimistic days must mean about trees. Detailed courts consider really large pro Books arts 9.08 24425.09 9.07221501111207600 +AAAAAAAAOODBAAAA Deep, big areas take for a facilities. Words could replace certainly cases; lights test. Nevertheless practical arts cross. Fa Books arts 7.37 4380.23 1.62694951617879192 +AAAAAAAAAJJBAAAA New, reluctant associations see more different, physical symptoms; useful pounds ought to give. Subjects Books business 9.02 3044.02 1.58609001939612781 +AAAAAAAABDMAAAAA Imports involve most now indian women. Developments announce intimately in a copies. Projects Books business 3.26 472.29 0.24608723177265498 +AAAAAAAABINDAAAA Years shall want free objects. Old residents use absolutely so residential steps. Letters will share variables. Sure fres Books business 40.76 30227.05 15.74983814849696292 +AAAAAAAACAADAAAA Whole, important problems make. Indeed industrial members go skills. Soft Books business 3.22 137.92 0.07186336997625310 +AAAAAAAACPBBAAAA Other, black houses flow. New soldiers put only eastern hours. Applications reserve there methods; sources cry pretty scarcely special workers. Never british opportunities Books business 8.20 736.96 0.38399383075478162 +AAAAAAAAEBPAAAAA Rows could not Books business 1.65 1290.88 0.67261446516056841 +AAAAAAAAEEFDAAAA Remaining subjects handle even only certain ladies; eagerly literary days could not provide. Very different articles cut then. Boys see out of a houses. Governme Books business 9.03 1065.30 0.55507575431918810 +AAAAAAAAEFEEAAAA White members see highly on a negotiations. Evident, passive colours can refer familiar, ugly factors; away small examinations shall prove Books business 17.97 1446.00 0.75343991433919646 +AAAAAAAAEGCCAAAA Manufacturing, ready concerns see already then new pupils. Both stable types used to manage otherw Books business 1.18 2635.71 1.37333963805184198 +AAAAAAAAFCGDAAAA Small, capable centres Books business 2.98 5029.45 2.62060053746422658 +AAAAAAAAFDLAAAAA Popular, different parameters might take open, used modules. Prisoners use pretty alternative lovers. Annual, professional others spend once true men. Other, small subsidies seem politically Books business 7.25 621.26 0.32370821658531756 +AAAAAAAAFEGEAAAA Supreme, free uses handle even in the customers. Other minutes might not make of course social neighbours. So environmental rights come other, able sales Books business 8.08 3950.22 2.05826654109334761 +AAAAAAAAGIJAAAAA Always other hours used to use. Women should jump then. Civil samples take therefore other offices. Concrete, major demands Books business 1.42 2013.79 1.04928752772968910 +AAAAAAAAHDKCAAAA Visual fragments Books business 6.77 930.13 0.48464527491308216 +AAAAAAAAHDLBAAAA Classic issues will draw as european, engl Books business 75.64 556.83 0.29013689315456070 +AAAAAAAAHJAAAAAA Again british shareholders see shares. American lives ought to establish horses. Then ideal conservatives might charge even nec Books business 2.44 1898.13 0.98902275560488173 +AAAAAAAAHLKAAAAA Confident, video-tape Books business 3.17 1131.00 0.58930881266779474 +AAAAAAAAIHNDAAAA Of course fundamental children will not deal still including a suppliers. More crucial powers will not keep enough. As good comments used to devote even convenient electric problems. Publi Books business 8.85 414.75 0.21610595053401226 +AAAAAAAAIMJAAAAA Departments could seek now for a commu Books business 5.93 9895.85 5.15624369039663714 +AAAAAAAAJFBEAAAA Paintings must not know primary, royal stands; similar, available others ough Books business 0.39 13809.44 7.19542412909562460 +AAAAAAAAJJGBAAAA Most present eyes restore fat, central relationships; again considerable habits must face in a discussions. Engineers help at all direct occasions. Curiously del Books business 80.10 9267.25 4.82871095861681771 +AAAAAAAAKBMDAAAA So white countries could secure more angry items. National feet must not defend too by the types; guidelines would not view more so flexible authorities. Critics will handle closely lig Books business 2.50 2542.50 1.32477246349059959 +AAAAAAAAKJHDAAAA Simple changes ought to vote almost sudden techniques. Partial, golden faces mean in a officials; vertically minor Books business 8.73 22710.22 11.83318548507904997 +AAAAAAAAKJOBAAAA Christian lines stand once deep formal aspirations. National, fine islands play together with a patterns. New journals lose etc positive armie Books business 4.89 11560.78 6.02375732565303988 +AAAAAAAAKKDAAAAA Children would not mean in favour of a parts. Heavy, whole others shall mean on Books business 3.13 9065.09 4.72337526492192700 +AAAAAAAAKLCCAAAA Lips will n Books business 8.48 541.62 0.28221170567385587 +AAAAAAAAKNJCAAAA White fees might combine reports. Tr Books business 2.09 37.60 0.01959152197728478 +AAAAAAAALAJCAAAA Asleep children invite more. Wealthy forms could expect as. Indeed statistical examinations could la Books business 3.71 2082.24 1.08495347664844290 +AAAAAAAALDHBAAAA Most new weeks go yet members. Also encouraging delegates make publications. Different competitors run resources; somehow common views m Books business 1.07 13412.42 6.98855641485568838 +AAAAAAAALHMBAAAA Local, bloody names Books business 4.40 1997.44 1.04076834197626873 +AAAAAAAALJJCAAAA Large, larg Books business 3.50 12097.82 6.30358261721370521 +AAAAAAAANJLBAAAA Only, gothic Books business 1.68 5708.95 2.97465477106967886 +AAAAAAAANKCAAAAA Low, large clouds will not visit for example as the notions. Small, unacceptable drugs might not negotiate environmental, happy keys. Books business 3.11 3020.85 1.57401726502874248 +AAAAAAAAOAPAAAAA Silver, critical operations could help howev Books business 5.56 2286.24 1.19124790439754116 +AAAAAAAAOBAEAAAA Terrible, psychiatric bones will destroy also used studies; solely usual windows should not make shares. Advances continue sufficiently. As key days might not use far artists. Offici Books business 5.83 6672.40 3.47666146918178041 +AAAAAAAAOCHCAAAA Too white addresses end by the talks. Hands get only companies. Statements know. Sentences would pay around for a payments; papers wait actually drinks; men would Books business 6.06 7609.35 3.96486031270882752 +AAAAAAAAAGLDAAAA New, big arguments may not win since by a tenant Books computers 1.00 904.16 0.32327741862037314 +AAAAAAAAALNBAAAA Else substantial problems slip months. Just unique corporations put vast areas. Supporters like far perfect chapters. Now young reports become wrong trials. Available ears shall Books computers 51.46 18752.88 6.70498876094676063 +AAAAAAAABEBEAAAA Cheap, desirable members take immediate, estimated debts; months must track typica Books computers 3.26 10027.86 3.58540600677589698 +AAAAAAAABHOAAAAA Expert, scottish terms will ask quiet demands; poor bits attempt northern, dangerous si Books computers 2.66 7330.68 2.62104418148557444 +AAAAAAAACCDBAAAA Gradually serious visitors bear no doubt technical hearts. Critics continue earlier soviet, standard minute Books computers 6.40 1711.84 0.61205894564136830 +AAAAAAAACCPBAAAA Clear, general goods must know never women. Communications meet about. Other rewards spot wide in a skills. Relative, empty drawings facilitate too rooms. Still asian police end speedily comp Books computers 7.64 1292.04 0.46196177220211789 +AAAAAAAACFMBAAAA At least remaining results shall keep cuts. Clients should meet policies. Glorious, local times could use enough; clever styles will live political parents. Single, gradual contracts will describe ho Books computers 9.51 3033.10 1.08446816760026298 +AAAAAAAACLPDAAAA Environmental, new women pay again fingers. Different, uncomfortable records miss far russian, dependent members. Enough double men will go here immediatel Books computers 89.89 8553.39 3.05821739476786568 +AAAAAAAACOFCAAAA Years learn here. Days make too. Only moving systems avoid old groups; short movements cannot see respectiv Books computers 0.60 3411.40 1.21972724504682903 +AAAAAAAACONDAAAA Magnetic Books computers 57.19 3569.09 1.27610843437421206 +AAAAAAAADAHAAAAA Ga Books computers 5.53 2687.70 0.96097230360331899 +AAAAAAAADDBAAAAA S Books computers 65.78 1613.04 0.57673355084432699 +AAAAAAAAEAHCAAAA Simple year Books computers 3.01 1262.79 0.45150359611088856 +AAAAAAAAECEEAAAA Agricultural players shall smoke. So full reasons undertake Books computers 0.70 4408.27 1.57615261257037727 +AAAAAAAAECGEAAAA Then basic years can encourage later traditions. For example christian parts subscribe informal, valuable gr Books computers 2.75 844.19 0.30183547604973987 +AAAAAAAAECHAAAAA Boxes batt Books computers 0.83 15300.82 5.47072375727191844 +AAAAAAAAEIGCAAAA Separate, dead buildings think possibly english, net policies. Big divisions can use almost Books computers 9.46 12403.71 4.43487806374503246 +AAAAAAAAEJECAAAA Artists make times. Rather ready functions must pre Books computers 5.71 1533.00 0.54811569052494252 +AAAAAAAAEMKDAAAA Advantages emerge moves; special, expected operations pass etc natural preferences; very posit Books computers 0.15 5241.45 1.87405152387603389 +AAAAAAAAFGLAAAAA Since other birds shall blame sudden Books computers 6.74 2098.16 0.75018552983158082 +AAAAAAAAFHNAAAAA Legs throw then. Old-fashioned develo Books computers 2.66 163.26 0.05837271209073850 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q22.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q22.sql.out new file mode 100644 index 0000000000000..e8a553dd5094e --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q22.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +esepriableanti NULL NULL NULL 429.7808764940239 +esepriableanti importoamalg #x NULL NULL 429.7808764940239 +esepriableanti importoamalg #x fragrances NULL 429.7808764940239 +esepriableanti importoamalg #x fragrances Women 429.7808764940239 +n stbarn stbarought NULL NULL NULL 430.0122448979592 +n stbarn stbarought amalgimporto #x NULL NULL 430.0122448979592 +n stbarn stbarought amalgimporto #x accessories NULL 430.0122448979592 +n stbarn stbarought amalgimporto #x accessories Men 430.0122448979592 +antiationeing NULL NULL NULL 437.03614457831327 +antiationeing amalgexporti #x NULL NULL 437.03614457831327 +antiationeing amalgexporti #x newborn NULL 437.03614457831327 +antiationeing amalgexporti #x newborn Children 437.03614457831327 +n stpriantin st NULL NULL NULL 438.77868852459017 +n stpriantin st exportiexporti #x NULL NULL 438.77868852459017 +n stpriantin st exportiexporti #x toddlers NULL 438.77868852459017 +n stpriantin st exportiexporti #x toddlers Children 438.77868852459017 +eingprically NULL NULL NULL 439.97975708502025 +eingprically amalgbrand #x NULL NULL 439.97975708502025 +eingprically amalgbrand #x semi-precious NULL 439.97975708502025 +eingprically amalgbrand #x semi-precious Jewelry 439.97975708502025 +prieingable NULL NULL NULL 440.096 +prieingable exportiunivamalg #x NULL NULL 440.096 +prieingable exportiunivamalg #x self-help NULL 440.096 +prieingable exportiunivamalg #x self-help Books 440.096 +oughteingn stationought NULL NULL NULL 440.1497975708502 +oughteingn stationought amalgscholar #x NULL NULL 440.1497975708502 +oughteingn stationought amalgscholar #x rock NULL 440.1497975708502 +oughteingn stationought amalgscholar #x rock Music 440.1497975708502 +eingationbaroughtought NULL NULL NULL 440.9721115537849 +eingationbaroughtought maxicorp #x NULL NULL 440.9721115537849 +eingationbaroughtought maxicorp #x womens watch NULL 440.9721115537849 +eingationbaroughtought maxicorp #x womens watch Jewelry 440.9721115537849 +priantibarpri NULL NULL NULL 443.45849802371544 +priantibarpri exportiimporto #x NULL NULL 443.45849802371544 +priantibarpri exportiimporto #x pants NULL 443.45849802371544 +priantibarpri exportiimporto #x pants Men 443.45849802371544 +prioughtantiation NULL NULL NULL 443.8825910931174 +prioughtantiation corpmaxi #x NULL NULL 443.8825910931174 +prioughtantiation corpmaxi #x parenting NULL 443.8825910931174 +prioughtantiation corpmaxi #x parenting Books 443.8825910931174 +eseprieingoughtought NULL NULL NULL 445.2016129032258 +eseprieingoughtought importonameless #x NULL NULL 445.2016129032258 +eseprieingoughtought importonameless #x baseball NULL 445.2016129032258 +eseprieingoughtought importonameless #x baseball Sports 445.2016129032258 +eingpriationanti NULL NULL NULL 445.4920634920635 +eingpriationanti scholarunivamalg #x NULL NULL 445.4920634920635 +eingpriationanti scholarunivamalg #x fiction NULL 445.4920634920635 +eingpriationanti scholarunivamalg #x fiction Books 445.4920634920635 +antin stablecallyought NULL NULL NULL 445.54918032786884 +antin stablecallyought importoedu pack #x NULL NULL 445.54918032786884 +antin stablecallyought importoedu pack #x mens NULL 445.54918032786884 +antin stablecallyought importoedu pack #x mens Shoes 445.54918032786884 +callycallyn steing NULL NULL NULL 445.9012345679012 +callycallyn steing corpunivamalg #x NULL NULL 445.9012345679012 +callycallyn steing corpunivamalg #x mystery NULL 445.9012345679012 +callycallyn steing corpunivamalg #x mystery Books 445.9012345679012 +oughtpribarought NULL NULL NULL 446.125 +oughtpribarought exportinameless #x NULL NULL 446.125 +oughtpribarought exportinameless #x wallpaper NULL 446.125 +oughtpribarought exportinameless #x wallpaper Home 446.125 +oughtantioughtbarought NULL NULL NULL 446.1847389558233 +oughtantioughtbarought edu packmaxi #x NULL NULL 446.1847389558233 +oughtantioughtbarought edu packmaxi #x entertainments NULL 446.1847389558233 +oughtantioughtbarought edu packmaxi #x entertainments Books 446.1847389558233 +callyoughtn stcallyought NULL NULL NULL 446.43650793650795 +callyoughtn stcallyought exportischolar #x NULL NULL 446.43650793650795 +callyoughtn stcallyought exportischolar #x pop NULL 446.43650793650795 +callyoughtn stcallyought exportischolar #x pop Music 446.43650793650795 +ationeingationableought NULL NULL NULL 446.48192771084337 +ationeingationableought namelessnameless #x NULL NULL 446.48192771084337 +ationeingationableought namelessnameless #x outdoor NULL 446.48192771084337 +ationeingationableought namelessnameless #x outdoor Sports 446.48192771084337 +priantiableese NULL NULL NULL 446.85483870967744 +priantiableese exportiedu pack #x NULL NULL 446.85483870967744 +priantiableese exportiedu pack #x kids NULL 446.85483870967744 +priantiableese exportiedu pack #x kids Shoes 446.85483870967744 +prieseeseableought NULL NULL NULL 446.9186991869919 +prieseeseableought amalgscholar #x NULL NULL 446.9186991869919 +prieseeseableought amalgscholar #x rock NULL 446.9186991869919 +prieseeseableought amalgscholar #x rock Music 446.9186991869919 +ationableoughtcallyought NULL NULL NULL 447.165991902834 +ationableoughtcallyought exportischolar #x NULL NULL 447.165991902834 +ationableoughtcallyought exportischolar #x pop NULL 447.165991902834 +ationableoughtcallyought exportischolar #x pop Music 447.165991902834 +pripricallyese NULL NULL NULL 447.2550607287449 +pripricallyese edu packimporto #x NULL NULL 447.2550607287449 +pripricallyese edu packimporto #x sports-apparel NULL 447.2550607287449 +pripricallyese edu packimporto #x sports-apparel Men 447.2550607287449 +eingableationn st NULL NULL NULL 447.3541666666667 +eingableationn st namelessmaxi #x NULL NULL 447.3541666666667 +eingableationn st namelessmaxi #x romance NULL 447.3541666666667 +eingableationn st namelessmaxi #x romance Books 447.3541666666667 +n stantin stoughtought NULL NULL NULL 448.2396694214876 +n stantin stoughtought importoscholar #x NULL NULL 448.2396694214876 +n stantin stoughtought importoscholar #x country NULL 448.2396694214876 +n stantin stoughtought importoscholar #x country Music 448.2396694214876 +n steingbaranti NULL NULL NULL 448.702479338843 +n steingbaranti amalgamalg #x NULL NULL 448.702479338843 +n steingbaranti amalgamalg #x dresses NULL 448.702479338843 +n steingbaranti amalgamalg #x dresses Women 448.702479338843 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q22a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q22a.sql.out new file mode 100644 index 0000000000000..42f0ab7f6e1f0 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q22a.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +oughtn steingcally NULL NULL NULL 429.75206611570246 +oughtn steingcally exportiexporti #x NULL NULL 429.75206611570246 +oughtn steingcally exportiexporti #x toddlers NULL 429.75206611570246 +oughtn steingcally exportiexporti #x toddlers Children 429.75206611570246 +oughtcallypripriought NULL NULL NULL 433.04918032786884 +oughtcallypripriought corpunivamalg #x NULL NULL 433.04918032786884 +oughtcallypripriought corpunivamalg #x musical NULL 433.04918032786884 +oughtcallypripriought corpunivamalg #x musical Electronics 433.04918032786884 +oughtesecallyeseought NULL NULL NULL 434.8091286307054 +oughtesecallyeseought scholarbrand #x NULL NULL 434.8091286307054 +oughtesecallyeseought scholarbrand #x blinds/shades NULL 434.8091286307054 +oughtesecallyeseought scholarbrand #x blinds/shades Home 434.8091286307054 +antiesen stese NULL NULL NULL 436.39676113360326 +antiesen stese edu packexporti #x NULL NULL 436.39676113360326 +antiesen stese edu packexporti #x school-uniforms NULL 436.39676113360326 +antiesen stese edu packexporti #x school-uniforms Children 436.39676113360326 +priesecallyantiought NULL NULL NULL 440.51612903225805 +priesecallyantiought importounivamalg #x NULL NULL 440.51612903225805 +priesecallyantiought importounivamalg #x home repair NULL 440.51612903225805 +priesecallyantiought importounivamalg #x home repair Books 440.51612903225805 +prioughtableoughtought NULL NULL NULL 440.97478991596637 +prioughtableoughtought exportiunivamalg #x NULL NULL 440.97478991596637 +prioughtableoughtought exportiunivamalg #x dvd/vcr players NULL 440.97478991596637 +prioughtableoughtought exportiunivamalg #x dvd/vcr players Electronics 440.97478991596637 +antiablen stought NULL NULL NULL 441.520325203252 +antiablen stought amalgamalg #x NULL NULL 441.520325203252 +antiablen stought amalgamalg #x dresses NULL 441.520325203252 +antiablen stought amalgamalg #x dresses Women 441.520325203252 +n steingantianti NULL NULL NULL 442.4404761904762 +n steingantianti corpbrand #x NULL NULL 442.4404761904762 +n steingantianti corpbrand #x rugs NULL 442.4404761904762 +n steingantianti corpbrand #x rugs Home 442.4404761904762 +prieingation NULL NULL NULL 442.68595041322317 +prieingation importoamalg #x NULL NULL 442.68595041322317 +prieingation importoamalg #x fragrances NULL 442.68595041322317 +prieingation importoamalg #x fragrances Women 442.68595041322317 +n stesecallypri NULL NULL NULL 442.84 +n stesecallypri amalgimporto #x NULL NULL 442.84 +n stesecallypri amalgimporto #x accessories NULL 442.84 +n stesecallypri amalgimporto #x accessories Men 442.84 +n stn stcallyoughtought NULL NULL NULL 443.20883534136544 +n stn stcallyoughtought corpmaxi #x NULL NULL 443.20883534136544 +n stn stcallyoughtought corpmaxi #x golf NULL 443.20883534136544 +n stn stcallyoughtought corpmaxi #x golf Sports 443.20883534136544 +ationableprieing NULL NULL NULL 443.349593495935 +ationableprieing exportiamalg #x NULL NULL 443.349593495935 +ationableprieing exportiamalg #x maternity NULL 443.349593495935 +ationableprieing exportiamalg #x maternity Women 443.349593495935 +ationoughtesepri NULL NULL NULL 443.8292682926829 +ationoughtesepri edu packunivamalg #x NULL NULL 443.8292682926829 +ationoughtesepri edu packunivamalg #x sports NULL 443.8292682926829 +ationoughtesepri edu packunivamalg #x sports Books 443.8292682926829 +oughtbarcallycallyought NULL NULL NULL 444.5889328063241 +oughtbarcallycallyought corpmaxi #x NULL NULL 444.5889328063241 +oughtbarcallycallyought corpmaxi #x golf NULL 444.5889328063241 +oughtbarcallycallyought corpmaxi #x golf Sports 444.5889328063241 +n steingcallycally NULL NULL NULL 445.0833333333333 +n steingcallycally importoscholar #x NULL NULL 445.0833333333333 +n steingcallycally importoscholar #x country NULL 445.0833333333333 +n steingcallycally importoscholar #x country Music 445.0833333333333 +ationcallyoughteing NULL NULL NULL 445.83534136546183 +ationcallyoughteing amalgedu pack #x NULL NULL 445.83534136546183 +ationcallyoughteing amalgedu pack #x womens NULL 445.83534136546183 +ationcallyoughteing amalgedu pack #x womens Shoes 445.83534136546183 +antiablebarantiought NULL NULL NULL 446.05555555555554 +antiablebarantiought scholarbrand #x NULL NULL 446.05555555555554 +antiablebarantiought scholarbrand #x custom NULL 446.05555555555554 +antiablebarantiought scholarbrand #x custom Jewelry 446.05555555555554 +ationantiationeseought NULL NULL NULL 446.33870967741933 +ationantiationeseought amalgimporto #x NULL NULL 446.33870967741933 +ationantiationeseought amalgimporto #x accessories NULL 446.33870967741933 +ationantiationeseought amalgimporto #x accessories Men 446.33870967741933 +pricallypriationought NULL NULL NULL 446.96 +pricallypriationought maxibrand #x NULL NULL 446.96 +pricallypriationought maxibrand #x mattresses NULL 446.96 +pricallypriationought maxibrand #x mattresses Home 446.96 +ationcallyn stbarought NULL NULL NULL 446.9918032786885 +ationcallyn stbarought corpbrand #x NULL NULL 446.9918032786885 +ationcallyn stbarought corpbrand #x rugs NULL 446.9918032786885 +ationcallyn stbarought corpbrand #x rugs Home 446.9918032786885 +ationeseoughtpri NULL NULL NULL 447.0769230769231 +ationeseoughtpri edu packamalg #x NULL NULL 447.0769230769231 +ationeseoughtpri edu packamalg #x swimwear NULL 447.0769230769231 +ationeseoughtpri edu packamalg #x swimwear Women 447.0769230769231 +anticallyese NULL NULL NULL 447.4313725490196 +anticallyese amalgcorp #x NULL NULL 447.4313725490196 +anticallyese amalgcorp #x birdal NULL 447.4313725490196 +anticallyese amalgcorp #x birdal Jewelry 447.4313725490196 +n stpriprioughtought NULL NULL NULL 447.6375 +n stpriprioughtought scholarbrand #x NULL NULL 447.6375 +n stpriprioughtought scholarbrand #x blinds/shades NULL 447.6375 +n stpriprioughtought scholarbrand #x blinds/shades Home 447.6375 +oughtantioughteing NULL NULL NULL 448.08097165991904 +oughtantioughteing univmaxi #x NULL NULL 448.08097165991904 +oughtantioughteing univmaxi #x pools NULL 448.08097165991904 +oughtantioughteing univmaxi #x pools Sports 448.08097165991904 +n steseeseationought NULL NULL NULL 448.1769547325103 +n steseeseationought exportiunivamalg #x NULL NULL 448.1769547325103 +n steseeseationought exportiunivamalg #x self-help NULL 448.1769547325103 +n steseeseationought exportiunivamalg #x self-help Books 448.1769547325103 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q24.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q24.sql.out new file mode 100644 index 0000000000000..e50b231441a5d --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q24.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output + diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q27a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q27a.sql.out new file mode 100644 index 0000000000000..5032ce4890dce --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q27a.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL 1 49.916138404648706 75.425222 191.109448 37.896850 +AAAAAAAAAAABAAAA NULL 1 67.0 37.520000 0.000000 24.010000 +AAAAAAAAAAABAAAA TN 0 67.0 37.520000 0.000000 24.010000 +AAAAAAAAAAACAAAA NULL 1 34.0 89.610000 186.400000 32.250000 +AAAAAAAAAAACAAAA TN 0 34.0 89.610000 186.400000 32.250000 +AAAAAAAAAACCAAAA NULL 1 69.0 31.085000 0.000000 7.825000 +AAAAAAAAAACCAAAA TN 0 69.0 31.085000 0.000000 7.825000 +AAAAAAAAAACDAAAA NULL 1 36.0 107.280000 0.000000 54.063333 +AAAAAAAAAACDAAAA TN 0 36.0 107.280000 0.000000 54.063333 +AAAAAAAAAADBAAAA NULL 1 21.0 74.470000 0.000000 44.680000 +AAAAAAAAAADBAAAA TN 0 21.0 74.470000 0.000000 44.680000 +AAAAAAAAAAEBAAAA NULL 1 47.0 30.540000 125.010000 20.460000 +AAAAAAAAAAEBAAAA TN 0 47.0 30.540000 125.010000 20.460000 +AAAAAAAAAAEEAAAA NULL 1 26.5 100.840000 362.865000 44.030000 +AAAAAAAAAAEEAAAA TN 0 26.5 100.840000 362.865000 44.030000 +AAAAAAAAAAFCAAAA NULL 1 50.0 37.055000 0.000000 7.555000 +AAAAAAAAAAFCAAAA TN 0 50.0 37.055000 0.000000 7.555000 +AAAAAAAAAAGBAAAA NULL 1 14.0 55.130000 0.000000 50.160000 +AAAAAAAAAAGBAAAA TN 0 14.0 55.130000 0.000000 50.160000 +AAAAAAAAAAHBAAAA NULL 1 50.0 106.065000 0.000000 29.695000 +AAAAAAAAAAHBAAAA TN 0 50.0 106.065000 0.000000 29.695000 +AAAAAAAAAAIAAAAA NULL 1 67.0 68.610000 0.000000 26.405000 +AAAAAAAAAAIAAAAA TN 0 67.0 68.610000 0.000000 26.405000 +AAAAAAAAAAIDAAAA NULL 1 37.333333333333336 78.440000 0.000000 51.863333 +AAAAAAAAAAIDAAAA TN 0 37.333333333333336 78.440000 0.000000 51.863333 +AAAAAAAAAAJBAAAA NULL 1 55.0 131.290000 0.000000 36.760000 +AAAAAAAAAAJBAAAA TN 0 55.0 131.290000 0.000000 36.760000 +AAAAAAAAAAKBAAAA NULL 1 70.0 66.120000 0.000000 21.150000 +AAAAAAAAAAKBAAAA TN 0 70.0 66.120000 0.000000 21.150000 +AAAAAAAAAALCAAAA NULL 1 93.0 104.200000 0.000000 6.250000 +AAAAAAAAAALCAAAA TN 0 93.0 104.200000 0.000000 6.250000 +AAAAAAAAAALDAAAA NULL 1 61.5 150.645000 0.000000 57.335000 +AAAAAAAAAALDAAAA TN 0 61.5 150.645000 0.000000 57.335000 +AAAAAAAAAANAAAAA NULL 1 52.0 2.510000 0.000000 2.280000 +AAAAAAAAAANAAAAA TN 0 52.0 2.510000 0.000000 2.280000 +AAAAAAAAAAOAAAAA NULL 1 23.5 17.590000 0.000000 12.130000 +AAAAAAAAAAOAAAAA TN 0 23.5 17.590000 0.000000 12.130000 +AAAAAAAAAAOCAAAA NULL 1 30.0 22.380000 0.000000 4.690000 +AAAAAAAAAAOCAAAA TN 0 30.0 22.380000 0.000000 4.690000 +AAAAAAAAAAPCAAAA NULL 1 92.0 75.630000 0.000000 64.280000 +AAAAAAAAAAPCAAAA TN 0 92.0 75.630000 0.000000 64.280000 +AAAAAAAAABAAAAAA NULL 1 10.0 45.790000 0.000000 43.950000 +AAAAAAAAABAAAAAA TN 0 10.0 45.790000 0.000000 43.950000 +AAAAAAAAABABAAAA NULL 1 63.0 21.890000 0.000000 19.700000 +AAAAAAAAABABAAAA TN 0 63.0 21.890000 0.000000 19.700000 +AAAAAAAAABBAAAAA NULL 1 26.5 78.785000 0.000000 35.615000 +AAAAAAAAABBAAAAA TN 0 26.5 78.785000 0.000000 35.615000 +AAAAAAAAABBDAAAA NULL 1 14.0 67.910000 0.000000 36.670000 +AAAAAAAAABBDAAAA TN 0 14.0 67.910000 0.000000 36.670000 +AAAAAAAAABCBAAAA NULL 1 42.5 72.900000 0.000000 44.685000 +AAAAAAAAABCBAAAA TN 0 42.5 72.900000 0.000000 44.685000 +AAAAAAAAABCCAAAA NULL 1 50.0 90.835000 0.000000 42.605000 +AAAAAAAAABCCAAAA TN 0 50.0 90.835000 0.000000 42.605000 +AAAAAAAAABDBAAAA NULL 1 40.0 10.100000 0.000000 4.240000 +AAAAAAAAABDBAAAA TN 0 40.0 10.100000 0.000000 4.240000 +AAAAAAAAABDEAAAA NULL 1 67.0 85.420000 0.000000 31.600000 +AAAAAAAAABDEAAAA TN 0 67.0 85.420000 0.000000 31.600000 +AAAAAAAAABECAAAA NULL 1 78.5 36.280000 1673.320000 25.170000 +AAAAAAAAABECAAAA TN 0 78.5 36.280000 1673.320000 25.170000 +AAAAAAAAABEDAAAA NULL 1 60.0 92.410000 2270.190000 58.210000 +AAAAAAAAABEDAAAA TN 0 60.0 92.410000 2270.190000 58.210000 +AAAAAAAAABGAAAAA NULL 1 57.0 11.390000 201.900000 3.980000 +AAAAAAAAABGAAAAA TN 0 57.0 11.390000 201.900000 3.980000 +AAAAAAAAABGDAAAA NULL 1 74.0 174.750000 232.650000 5.240000 +AAAAAAAAABGDAAAA TN 0 74.0 174.750000 232.650000 5.240000 +AAAAAAAAABHDAAAA NULL 1 34.5 120.730000 0.000000 61.460000 +AAAAAAAAABHDAAAA TN 0 34.5 120.730000 0.000000 61.460000 +AAAAAAAAABIBAAAA NULL 1 4.0 12.680000 5.040000 10.520000 +AAAAAAAAABIBAAAA TN 0 4.0 12.680000 5.040000 10.520000 +AAAAAAAAABICAAAA NULL 1 20.5 22.420000 0.000000 20.300000 +AAAAAAAAABICAAAA TN 0 20.5 22.420000 0.000000 20.300000 +AAAAAAAAABJBAAAA NULL 1 38.0 2.850000 0.000000 0.880000 +AAAAAAAAABJBAAAA TN 0 38.0 2.850000 0.000000 0.880000 +AAAAAAAAABKCAAAA NULL 1 8.0 73.980000 0.000000 51.780000 +AAAAAAAAABKCAAAA TN 0 8.0 73.980000 0.000000 51.780000 +AAAAAAAAABLCAAAA NULL 1 49.0 96.580000 0.000000 28.970000 +AAAAAAAAABLCAAAA TN 0 49.0 96.580000 0.000000 28.970000 +AAAAAAAAABMAAAAA NULL 1 50.0 136.990000 838.320000 69.860000 +AAAAAAAAABMAAAAA TN 0 50.0 136.990000 838.320000 69.860000 +AAAAAAAAABMBAAAA NULL 1 76.0 120.520000 0.000000 83.150000 +AAAAAAAAABMBAAAA TN 0 76.0 120.520000 0.000000 83.150000 +AAAAAAAAABNAAAAA NULL 1 17.0 91.190000 0.000000 16.410000 +AAAAAAAAABNAAAAA TN 0 17.0 91.190000 0.000000 16.410000 +AAAAAAAAABNCAAAA NULL 1 61.0 13.080000 16.650000 0.650000 +AAAAAAAAABNCAAAA TN 0 61.0 13.080000 16.650000 0.650000 +AAAAAAAAABPAAAAA NULL 1 30.0 118.380000 623.160000 46.160000 +AAAAAAAAABPAAAAA TN 0 30.0 118.380000 623.160000 46.160000 +AAAAAAAAABPBAAAA NULL 1 30.0 NULL NULL 17.350000 +AAAAAAAAABPBAAAA TN 0 30.0 NULL NULL 17.350000 +AAAAAAAAACAAAAAA NULL 1 20.0 3.710000 0.000000 0.250000 +AAAAAAAAACAAAAAA TN 0 20.0 3.710000 0.000000 0.250000 +AAAAAAAAACACAAAA NULL 1 66.0 117.590000 0.000000 34.100000 +AAAAAAAAACACAAAA TN 0 66.0 117.590000 0.000000 34.100000 +AAAAAAAAACADAAAA NULL 1 79.0 171.850000 0.000000 127.160000 +AAAAAAAAACADAAAA TN 0 79.0 171.850000 0.000000 127.160000 +AAAAAAAAACBBAAAA NULL 1 81.0 88.700000 0.000000 13.300000 +AAAAAAAAACBBAAAA TN 0 81.0 88.700000 0.000000 13.300000 +AAAAAAAAACBCAAAA NULL 1 26.0 62.780000 1311.600000 61.520000 +AAAAAAAAACBCAAAA TN 0 26.0 62.780000 1311.600000 61.520000 +AAAAAAAAACBEAAAA NULL 1 60.0 84.015000 0.000000 33.495000 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q34.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q34.sql.out new file mode 100644 index 0000000000000..71b7844e8e93a --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q34.sql.out @@ -0,0 +1,223 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL NULL Y 47915 15 +NULL NULL NULL NULL 126143 15 +NULL NULL NULL NULL 215293 15 +NULL NULL Mrs. N 120593 15 +NULL Rubin Sir NULL 30056 15 +Adler Justin Sir Y 226187 15 +Allen Rose Mrs. N 179476 16 +Anderson Marvin Dr. N 211012 16 +Andrews Jacob Mr. N 67111 16 +Andrews Samuel Dr. Y 139993 16 +Angel Kevin Mr. Y 106628 15 +Ashley Linda Mrs. Y 82173 15 +Baca Dorothy Mrs. N 64890 15 +Baker Jamie Dr. Y 9916 15 +Banks Leroy Sir N 206730 15 +Barber Dianna Mrs. Y 119959 16 +Barksdale Joann Miss Y 138994 15 +Barnes Ruth Dr. N 84038 15 +Barney Samuel Sir N 15288 15 +Barnhart Charley Mr. Y 166576 15 +Barone Seth Mr. Y 162374 15 +Barrett David Sir N 189879 15 +Bartels Elmer Sir Y 114760 16 +Bear Scott Sir Y 82291 15 +Beers Kendra Dr. NULL 137960 15 +Belcher James Sir Y 239470 16 +Bell Carrie Miss N 5527 15 +Bell Matthew Dr. N 20400 15 +Benjamin Consuelo Ms. Y 201086 15 +Bergman Joann Miss N 177052 15 +Brooks Robert Sir N 155576 16 +Byrd Kelly Sir N 165115 16 +Cagle Jennifer Miss N 163129 15 +Campbell Robert Mr. N 8964 15 +Cardona Robert Mr. N 200501 15 +Carter Wendy Ms. N 96439 15 +Carver Bernard Mr. Y 194943 16 +Chen Wanita Miss N 137713 16 +Christensen Larry Dr. Y 58094 15 +Cochrane Anne Mrs. N 208347 16 +Coleman Inez Dr. Y 88249 16 +Coleman John Mr. N 49444 15 +Colon Anna Dr. Y 143694 15 +Conley Roxie Dr. N 196663 15 +Cook Adam Ms. Y 167339 15 +Cote Justin Dr. N 93466 15 +Council Donald Sir Y 102958 15 +Cramer Linda Ms. N 126628 15 +Crittenden Amie Ms. N 138787 15 +Cruz James Mr. Y 201430 15 +Cuellar Oscar Mr. Y 86781 16 +Cullen Larry Mr. Y 221242 16 +Cushing Antonia Mrs. Y 118927 15 +Davis Gordon Dr. N 227822 15 +Davis Myrtle Dr. Y 37430 15 +Decker Vera Miss Y 75737 16 +Diamond Fernando Dr. N 216391 15 +Diaz Walton Mr. N 131135 16 +Dickinson Steven Mr. N 8057 16 +Douglas Lester Sir N 26043 15 +Dove Garry Dr. N 152171 16 +Drake Rosetta Dr. Y 238040 15 +Dumas Travis Mr. Y 94154 15 +Duncan Olivia Dr. Y 102032 15 +Durham Andrea Dr. Y 144734 15 +Dutton Gay Miss Y 110886 15 +Ellis Karen Miss N 229706 16 +Ely Cesar Dr. Y 36054 16 +Etheridge Mike Dr. N 19648 15 +Farmer Eugenia Miss Y 98187 16 +Farrow Kathy Miss Y 200078 15 +Faulkner Lakeisha Dr. Y 178393 16 +Faulkner Robert Dr. N 109423 15 +Felton David Mr. N 97807 16 +Ferreira Christine Mrs. Y 155822 15 +Finn Robert Mr. N 38057 15 +Finney Crystal Miss Y 158304 15 +Fischer Tamara Mrs. N 66790 15 +Foote Roy Sir N 68086 15 +Foreman Autumn Mrs. Y 164060 15 +Funk Marvin Sir Y 61516 15 +Garcia Christopher Sir Y 181616 16 +Garcia Karen Miss N 236987 15 +Garcia Robert Dr. N 172185 16 +Garland Michael Mr. N 234421 15 +Gaylord Keith Mr. Y 123333 16 +Gifford Mark Mr. N 225973 16 +Gilbert NULL Sir N 16844 15 +Gilmore Austin Dr. Y 239871 15 +Goldsmith Bernice Ms. Y 2347 15 +Good Nancy Dr. N 132655 15 +Goodman NULL NULL N 71903 15 +Gower Nettie Miss N 10576 15 +Gray Evelyn Miss N 157486 15 +Hammond Roger Sir Y 54884 16 +Hardin Kimberly Dr. N 192424 16 +Harp Vance Mr. N 199017 15 +Harper Madeline Dr. N 173835 16 +Harris Tammy Dr. N 217761 16 +Hartmann Joey Dr. N 230915 15 +Hayes David Sir N 82274 15 +Haynes Sara Miss Y 139168 16 +Heath Matthew Dr. N 30710 15 +Hennessey Debbie Dr. Y 79256 15 +Herman Stella Ms. Y 33801 16 +Hernandez Max Mr. N 16015 15 +Hernandez Ruth Ms. Y 97000 15 +Hess Joseph Sir N 151336 15 +Hodges Lucas Dr. Y 163325 15 +Holland Jeremiah Dr. N 95938 16 +Jackson William Mr. Y 16425 16 +Jameson Miguel Dr. N 9181 16 +Jarrell Thomas Mr. Y 85787 16 +Johnson Julia Dr. N 27560 15 +Jones Theresa Ms. N 219765 16 +Kelly Mark Mr. Y 17039 16 +Khan Hank Mr. N 177803 15 +Kim Charlotte Dr. Y 7208 16 +Kunz Sarah Dr. N 74568 15 +Lake Robert Sir N 13264 15 +Landry Rudolph Sir N 117581 15 +Lane Luis Sir N 232302 16 +Langford Darlene Mrs. N 214891 15 +Larson Kevin Mr. Y 35053 15 +Larson Thomas Mr. N 114265 15 +Lee Malik Dr. N 20122 16 +Leonard Orlando Dr. Y 133168 15 +Lincoln Anthony Miss Y 1407 16 +Lindsey Linda Dr. N 62687 16 +Lopez Karen Dr. Y 136008 15 +Lunsford Kevin Dr. N 159120 16 +Lynch Sylvia Ms. Y 115438 15 +Lyon Michael Mr. N 140323 15 +Maestas Mabel Mrs. N 184265 15 +Magana Diann Mrs. Y 19139 15 +Manning Annamarie Ms. N 4984 16 +Marshall Felipe Sir N 138890 15 +Martin Paul Dr. N 26115 16 +Martinez Earl Sir N 108982 15 +Martinez Robert Sir Y 157672 16 +Masterson Barbara Mrs. N 231070 15 +Mata Deborah Miss Y 4323 15 +Mccoy Debbie Dr. N 91552 15 +Mcgill Tony Sir N 110030 15 +Mckeon Christina Dr. N 26190 15 +Mcnamara Linda Dr. Y 7957 15 +Means Michael Mr. Y 226164 16 +Medina Joseph Sir Y 110246 15 +Meyers Zachary Mr. Y 59549 15 +Montgomery John Mr. Y 103718 15 +Moody Miranda Ms. Y 171671 15 +Moore Mark Dr. N 191471 15 +Moran Celia Ms. Y 200691 15 +Morgan Cecelia Mrs. N 200742 15 +Morrell Chad Mr. N 93790 15 +Morse Robert Mr. N 68627 16 +Neel Audrey Ms. Y 193308 15 +Neff Sheri Mrs. Y 52556 15 +Nelson Katherine Mrs. N 110232 15 +New Suzanne Miss N 5120 16 +Nielsen Veronica Mrs. N 23905 15 +Oakley George Mr. Y 177890 15 +Parker Barbar Dr. N 57241 15 +Parker Jeff Sir N 213566 16 +Pemberton Jennifer Mrs. Y 49875 16 +Perry Robert Mr. Y 153147 16 +Phillips David Dr. N 148883 15 +Phillips Georgia NULL Y 26878 15 +Phillips Stanley Sir N 31989 15 +Pinkston Brenda Dr. N 126440 15 +Pryor Dorothy Mrs. N 213779 16 +Reed William Dr. N 145002 15 +Reynolds Amelia Ms. Y 68440 15 +Rice David Dr. Y 70484 16 +Robertson Daniel Mr. N 40407 16 +Rosales NULL NULL Y 156406 16 +Russo Cheryl Miss N 81123 15 +Sanchez Bruce Sir Y 124479 15 +Schmitz Kaitlyn Miss N 105162 15 +Sebastian Homer Dr. Y 64994 15 +Sexton Jerry Sir N 91446 15 +Sierra David Sir Y 61810 15 +Simmons Joseph Dr. N 54185 15 +Simpson Michael Sir Y 186613 16 +Simpson Shalanda Dr. Y 181123 15 +Singleton Andrew Ms. N 45464 15 +Smith Danny Dr. Y 143297 15 +Smith Edward Sir Y 81178 16 +Smith Hung Sir N 44710 15 +Smith Kimberly Mrs. Y 174638 15 +Smith Vern Sir N 50960 15 +Sosa Leah Ms. Y 77106 16 +Sparks Erick Dr. N 220337 15 +Taylor Kenneth Dr. Y 194337 15 +Todd Linda Ms. Y 235816 15 +Trout Harley Mr. Y 214547 15 +Urban NULL NULL NULL 214898 15 +Varner Elsie Ms. N 199602 16 +Vazquez Bill Dr. Y 62049 15 +Velazquez William Dr. N 46239 15 +Wagner Barbara Ms. Y 233595 15 +Ward Anna Miss N 52941 16 +Watkins Rosa Miss Y 152190 16 +Welch James Dr. Y 51441 16 +West Teresa Ms. N 233179 16 +White Maurice Mr. N 10107 15 +Williams John Mr. Y 84783 15 +Williams Robert Mr. Y 41233 15 +Williamson Ruth Mrs. Y 86369 15 +Wilson Joel Sir Y 91826 16 +Wilson John Sir Y 26543 15 +Wilson Mariano Mr. Y 67472 16 +Winkler Jose Dr. Y 78400 15 +Winter Cora Mrs. N 8978 16 +Wood Marcia Ms. Y 219276 16 +Wood Michelle Mrs. N 39560 15 +Wright Richie Sir Y 106818 15 +Young William Mr. Y 51127 15 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q35.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q35.sql.out new file mode 100644 index 0000000000000..0c6741654b7ee --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q35.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL F D 0 1 0.0 0 0 2 1 2.0 2 2 2 1 2.0 2 2 +NULL F D 0 1 0.0 0 0 3 1 3.0 3 3 4 1 4.0 4 4 +NULL F D 0 1 0.0 0 0 5 1 5.0 5 5 2 1 2.0 2 2 +NULL F D 0 1 0.0 0 0 6 1 6.0 6 6 4 1 4.0 4 4 +NULL F D 1 1 1.0 1 1 1 1 1.0 1 1 1 1 1.0 1 1 +NULL F D 1 1 1.0 1 1 4 1 4.0 4 4 4 1 4.0 4 4 +NULL F D 1 1 1.0 1 1 4 1 4.0 4 4 5 1 5.0 5 5 +NULL F D 2 1 2.0 2 2 0 1 0.0 0 0 4 1 4.0 4 4 +NULL F D 2 1 2.0 2 2 1 1 1.0 1 1 3 1 3.0 3 3 +NULL F D 2 1 2.0 2 2 6 1 6.0 6 6 1 1 1.0 1 1 +NULL F D 3 1 3.0 3 3 3 1 3.0 3 3 2 1 2.0 2 2 +NULL F D 3 1 3.0 3 3 3 1 3.0 3 3 6 1 6.0 6 6 +NULL F D 3 1 3.0 3 3 4 1 4.0 4 4 1 1 1.0 1 1 +NULL F D 4 1 4.0 4 4 0 1 0.0 0 0 3 1 3.0 3 3 +NULL F D 4 1 4.0 4 4 1 1 1.0 1 1 1 1 1.0 1 1 +NULL F D 4 1 4.0 4 4 1 1 1.0 1 1 4 1 4.0 4 4 +NULL F D 4 1 4.0 4 4 5 1 5.0 5 5 6 1 6.0 6 6 +NULL F D 5 1 5.0 5 5 4 1 4.0 4 4 3 1 3.0 3 3 +NULL F D 5 1 5.0 5 5 5 1 5.0 5 5 2 1 2.0 2 2 +NULL F D 6 1 6.0 6 6 1 1 1.0 1 1 3 1 3.0 3 3 +NULL F D 6 1 6.0 6 6 2 1 2.0 2 2 2 1 2.0 2 2 +NULL F D 6 1 6.0 6 6 4 1 4.0 4 4 1 1 1.0 1 1 +NULL F M 0 1 0.0 0 0 5 1 5.0 5 5 5 1 5.0 5 5 +NULL F M 1 1 1.0 1 1 3 1 3.0 3 3 0 1 0.0 0 0 +NULL F M 1 1 1.0 1 1 6 1 6.0 6 6 0 1 0.0 0 0 +NULL F M 1 1 1.0 1 1 6 1 6.0 6 6 1 1 1.0 1 1 +NULL F M 2 1 2.0 2 2 2 1 2.0 2 2 6 1 6.0 6 6 +NULL F M 2 1 2.0 2 2 4 1 4.0 4 4 4 1 4.0 4 4 +NULL F M 3 1 3.0 3 3 2 1 2.0 2 2 1 1 1.0 1 1 +NULL F M 3 1 3.0 3 3 5 1 5.0 5 5 0 1 0.0 0 0 +NULL F M 3 1 3.0 3 3 5 1 5.0 5 5 1 1 1.0 1 1 +NULL F M 4 1 4.0 4 4 1 1 1.0 1 1 4 1 4.0 4 4 +NULL F M 4 1 4.0 4 4 2 1 2.0 2 2 1 1 1.0 1 1 +NULL F M 4 1 4.0 4 4 3 1 3.0 3 3 3 1 3.0 3 3 +NULL F M 5 1 5.0 5 5 2 1 2.0 2 2 2 1 2.0 2 2 +NULL F M 6 1 6.0 6 6 1 1 1.0 1 1 1 1 1.0 1 1 +NULL F M 6 1 6.0 6 6 5 1 5.0 5 5 6 1 6.0 6 6 +NULL F S 0 1 0.0 0 0 3 1 3.0 3 3 6 1 6.0 6 6 +NULL F S 1 1 1.0 1 1 0 1 0.0 0 0 4 1 4.0 4 4 +NULL F S 1 1 1.0 1 1 1 1 1.0 1 1 2 1 2.0 2 2 +NULL F S 1 1 1.0 1 1 2 1 2.0 2 2 6 1 6.0 6 6 +NULL F S 1 1 1.0 1 1 5 1 5.0 5 5 5 1 5.0 5 5 +NULL F S 2 1 2.0 2 2 0 1 0.0 0 0 3 1 3.0 3 3 +NULL F S 2 2 2.0 2 4 5 2 5.0 5 10 6 2 6.0 6 12 +NULL F S 3 1 3.0 3 3 0 1 0.0 0 0 4 1 4.0 4 4 +NULL F S 3 1 3.0 3 3 2 1 2.0 2 2 1 1 1.0 1 1 +NULL F S 3 1 3.0 3 3 2 1 2.0 2 2 5 1 5.0 5 5 +NULL F S 3 1 3.0 3 3 3 1 3.0 3 3 3 1 3.0 3 3 +NULL F S 4 1 4.0 4 4 1 1 1.0 1 1 4 1 4.0 4 4 +NULL F S 4 1 4.0 4 4 2 1 2.0 2 2 4 1 4.0 4 4 +NULL F S 5 1 5.0 5 5 6 1 6.0 6 6 0 1 0.0 0 0 +NULL F U 0 1 0.0 0 0 1 1 1.0 1 1 3 1 3.0 3 3 +NULL F U 0 1 0.0 0 0 3 1 3.0 3 3 0 1 0.0 0 0 +NULL F U 1 1 1.0 1 1 3 1 3.0 3 3 2 1 2.0 2 2 +NULL F U 1 1 1.0 1 1 5 1 5.0 5 5 6 1 6.0 6 6 +NULL F U 2 1 2.0 2 2 0 1 0.0 0 0 1 1 1.0 1 1 +NULL F U 2 1 2.0 2 2 4 1 4.0 4 4 4 1 4.0 4 4 +NULL F U 3 2 3.0 3 6 1 2 1.0 1 2 6 2 6.0 6 12 +NULL F U 4 1 4.0 4 4 0 1 0.0 0 0 4 1 4.0 4 4 +NULL F U 5 1 5.0 5 5 3 1 3.0 3 3 6 1 6.0 6 6 +NULL F U 6 1 6.0 6 6 2 1 2.0 2 2 2 1 2.0 2 2 +NULL F U 6 1 6.0 6 6 4 1 4.0 4 4 4 1 4.0 4 4 +NULL F U 6 1 6.0 6 6 5 1 5.0 5 5 0 1 0.0 0 0 +NULL F U 6 1 6.0 6 6 5 1 5.0 5 5 6 1 6.0 6 6 +NULL F W 0 1 0.0 0 0 0 1 0.0 0 0 4 1 4.0 4 4 +NULL F W 0 1 0.0 0 0 5 1 5.0 5 5 5 1 5.0 5 5 +NULL F W 1 1 1.0 1 1 3 1 3.0 3 3 4 1 4.0 4 4 +NULL F W 2 1 2.0 2 2 0 1 0.0 0 0 5 1 5.0 5 5 +NULL F W 3 1 3.0 3 3 3 1 3.0 3 3 6 1 6.0 6 6 +NULL F W 3 1 3.0 3 3 6 1 6.0 6 6 6 1 6.0 6 6 +NULL F W 4 1 4.0 4 4 3 1 3.0 3 3 1 1 1.0 1 1 +NULL F W 5 1 5.0 5 5 1 1 1.0 1 1 1 1 1.0 1 1 +NULL F W 5 1 5.0 5 5 1 1 1.0 1 1 4 1 4.0 4 4 +NULL F W 5 1 5.0 5 5 3 1 3.0 3 3 6 1 6.0 6 6 +NULL F W 5 1 5.0 5 5 4 1 4.0 4 4 6 1 6.0 6 6 +NULL F W 6 1 6.0 6 6 0 1 0.0 0 0 5 1 5.0 5 5 +NULL F W 6 1 6.0 6 6 2 1 2.0 2 2 3 1 3.0 3 3 +NULL F W 6 1 6.0 6 6 5 1 5.0 5 5 5 1 5.0 5 5 +NULL M D 0 1 0.0 0 0 3 1 3.0 3 3 0 1 0.0 0 0 +NULL M D 1 1 1.0 1 1 3 1 3.0 3 3 0 1 0.0 0 0 +NULL M D 1 1 1.0 1 1 3 1 3.0 3 3 2 1 2.0 2 2 +NULL M D 2 1 2.0 2 2 0 1 0.0 0 0 6 1 6.0 6 6 +NULL M D 2 1 2.0 2 2 4 1 4.0 4 4 4 1 4.0 4 4 +NULL M D 2 1 2.0 2 2 5 1 5.0 5 5 3 1 3.0 3 3 +NULL M D 3 1 3.0 3 3 1 1 1.0 1 1 5 1 5.0 5 5 +NULL M D 3 1 3.0 3 3 2 1 2.0 2 2 3 1 3.0 3 3 +NULL M D 4 1 4.0 4 4 5 1 5.0 5 5 2 1 2.0 2 2 +NULL M D 6 1 6.0 6 6 1 1 1.0 1 1 6 1 6.0 6 6 +NULL M D 6 1 6.0 6 6 3 1 3.0 3 3 1 1 1.0 1 1 +NULL M M 0 1 0.0 0 0 0 1 0.0 0 0 1 1 1.0 1 1 +NULL M M 0 2 0.0 0 0 1 2 1.0 1 2 2 2 2.0 2 4 +NULL M M 0 1 0.0 0 0 2 1 2.0 2 2 1 1 1.0 1 1 +NULL M M 0 1 0.0 0 0 3 1 3.0 3 3 5 1 5.0 5 5 +NULL M M 0 1 0.0 0 0 5 1 5.0 5 5 0 1 0.0 0 0 +NULL M M 1 1 1.0 1 1 0 1 0.0 0 0 1 1 1.0 1 1 +NULL M M 1 1 1.0 1 1 0 1 0.0 0 0 2 1 2.0 2 2 +NULL M M 2 1 2.0 2 2 6 1 6.0 6 6 5 1 5.0 5 5 +NULL M M 3 1 3.0 3 3 5 1 5.0 5 5 1 1 1.0 1 1 +NULL M M 3 1 3.0 3 3 6 1 6.0 6 6 4 1 4.0 4 4 +NULL M M 4 1 4.0 4 4 1 1 1.0 1 1 3 1 3.0 3 3 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q35a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q35a.sql.out new file mode 100644 index 0000000000000..5d57fd93ef7d2 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q35a.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL F D 0 1 0.0 0 0 2 1 2.0 2 2 2 1 2.0 2 2 +NULL F D 1 1 1.0 1 1 1 1 1.0 1 1 1 1 1.0 1 1 +NULL F D 1 1 1.0 1 1 4 1 4.0 4 4 3 1 3.0 3 3 +NULL F D 1 1 1.0 1 1 4 1 4.0 4 4 6 1 6.0 6 6 +NULL F D 2 1 2.0 2 2 2 1 2.0 2 2 5 1 5.0 5 5 +NULL F D 2 1 2.0 2 2 6 1 6.0 6 6 3 1 3.0 3 3 +NULL F D 3 1 3.0 3 3 0 1 0.0 0 0 2 1 2.0 2 2 +NULL F D 3 1 3.0 3 3 6 1 6.0 6 6 3 1 3.0 3 3 +NULL F D 4 1 4.0 4 4 1 1 1.0 1 1 6 1 6.0 6 6 +NULL F D 4 1 4.0 4 4 3 1 3.0 3 3 1 1 1.0 1 1 +NULL F D 4 1 4.0 4 4 4 1 4.0 4 4 4 1 4.0 4 4 +NULL F D 4 2 4.0 4 8 5 2 5.0 5 10 4 2 4.0 4 8 +NULL F D 5 1 5.0 5 5 5 1 5.0 5 5 2 1 2.0 2 2 +NULL F D 5 1 5.0 5 5 6 1 6.0 6 6 4 1 4.0 4 4 +NULL F D 6 1 6.0 6 6 2 1 2.0 2 2 1 1 1.0 1 1 +NULL F D 6 1 6.0 6 6 3 1 3.0 3 3 0 1 0.0 0 0 +NULL F D 6 1 6.0 6 6 5 1 5.0 5 5 1 1 1.0 1 1 +NULL F D 6 1 6.0 6 6 5 1 5.0 5 5 4 1 4.0 4 4 +NULL F M 0 1 0.0 0 0 1 1 1.0 1 1 1 1 1.0 1 1 +NULL F M 0 1 0.0 0 0 2 1 2.0 2 2 6 1 6.0 6 6 +NULL F M 0 1 0.0 0 0 3 1 3.0 3 3 4 1 4.0 4 4 +NULL F M 0 1 0.0 0 0 5 1 5.0 5 5 3 1 3.0 3 3 +NULL F M 1 1 1.0 1 1 6 1 6.0 6 6 0 1 0.0 0 0 +NULL F M 1 1 1.0 1 1 6 1 6.0 6 6 3 1 3.0 3 3 +NULL F M 3 1 3.0 3 3 0 1 0.0 0 0 1 1 1.0 1 1 +NULL F M 3 1 3.0 3 3 1 1 1.0 1 1 4 1 4.0 4 4 +NULL F M 3 2 3.0 3 6 4 2 4.0 4 8 5 2 5.0 5 10 +NULL F M 3 1 3.0 3 3 5 1 5.0 5 5 6 1 6.0 6 6 +NULL F M 3 1 3.0 3 3 6 1 6.0 6 6 1 1 1.0 1 1 +NULL F M 4 1 4.0 4 4 3 1 3.0 3 3 2 1 2.0 2 2 +NULL F M 4 1 4.0 4 4 6 1 6.0 6 6 1 1 1.0 1 1 +NULL F M 4 1 4.0 4 4 6 1 6.0 6 6 4 1 4.0 4 4 +NULL F M 5 1 5.0 5 5 1 1 1.0 1 1 5 1 5.0 5 5 +NULL F M 5 1 5.0 5 5 2 1 2.0 2 2 2 1 2.0 2 2 +NULL F M 6 1 6.0 6 6 0 1 0.0 0 0 5 1 5.0 5 5 +NULL F M 6 1 6.0 6 6 1 1 1.0 1 1 4 1 4.0 4 4 +NULL F M 6 1 6.0 6 6 6 1 6.0 6 6 3 1 3.0 3 3 +NULL F S 0 1 0.0 0 0 3 1 3.0 3 3 3 1 3.0 3 3 +NULL F S 0 1 0.0 0 0 4 1 4.0 4 4 2 1 2.0 2 2 +NULL F S 0 1 0.0 0 0 5 1 5.0 5 5 1 1 1.0 1 1 +NULL F S 0 1 0.0 0 0 5 1 5.0 5 5 2 1 2.0 2 2 +NULL F S 1 1 1.0 1 1 1 1 1.0 1 1 4 1 4.0 4 4 +NULL F S 1 1 1.0 1 1 2 1 2.0 2 2 3 1 3.0 3 3 +NULL F S 1 1 1.0 1 1 3 1 3.0 3 3 6 1 6.0 6 6 +NULL F S 2 1 2.0 2 2 0 1 0.0 0 0 6 1 6.0 6 6 +NULL F S 2 1 2.0 2 2 5 1 5.0 5 5 4 1 4.0 4 4 +NULL F S 2 1 2.0 2 2 6 1 6.0 6 6 6 1 6.0 6 6 +NULL F S 4 1 4.0 4 4 3 1 3.0 3 3 5 1 5.0 5 5 +NULL F U 0 1 0.0 0 0 2 1 2.0 2 2 0 1 0.0 0 0 +NULL F U 0 1 0.0 0 0 3 1 3.0 3 3 0 1 0.0 0 0 +NULL F U 0 1 0.0 0 0 3 1 3.0 3 3 6 1 6.0 6 6 +NULL F U 0 1 0.0 0 0 6 1 6.0 6 6 6 1 6.0 6 6 +NULL F U 1 1 1.0 1 1 0 1 0.0 0 0 6 1 6.0 6 6 +NULL F U 1 1 1.0 1 1 3 1 3.0 3 3 5 1 5.0 5 5 +NULL F U 1 1 1.0 1 1 6 1 6.0 6 6 5 1 5.0 5 5 +NULL F U 2 1 2.0 2 2 0 1 0.0 0 0 5 1 5.0 5 5 +NULL F U 2 2 2.0 2 4 1 2 1.0 1 2 0 2 0.0 0 0 +NULL F U 2 1 2.0 2 2 3 1 3.0 3 3 4 1 4.0 4 4 +NULL F U 2 1 2.0 2 2 4 1 4.0 4 4 6 1 6.0 6 6 +NULL F U 3 1 3.0 3 3 0 1 0.0 0 0 6 1 6.0 6 6 +NULL F U 3 1 3.0 3 3 2 1 2.0 2 2 0 1 0.0 0 0 +NULL F U 4 1 4.0 4 4 0 1 0.0 0 0 6 1 6.0 6 6 +NULL F U 4 1 4.0 4 4 1 1 1.0 1 1 0 1 0.0 0 0 +NULL F U 5 1 5.0 5 5 0 1 0.0 0 0 2 1 2.0 2 2 +NULL F U 5 1 5.0 5 5 1 1 1.0 1 1 2 1 2.0 2 2 +NULL F U 5 1 5.0 5 5 4 1 4.0 4 4 4 1 4.0 4 4 +NULL F U 6 1 6.0 6 6 0 1 0.0 0 0 0 1 0.0 0 0 +NULL F U 6 1 6.0 6 6 6 1 6.0 6 6 4 1 4.0 4 4 +NULL F W 1 1 1.0 1 1 3 1 3.0 3 3 4 1 4.0 4 4 +NULL F W 3 1 3.0 3 3 4 1 4.0 4 4 1 1 1.0 1 1 +NULL F W 4 1 4.0 4 4 3 1 3.0 3 3 4 1 4.0 4 4 +NULL F W 4 1 4.0 4 4 5 1 5.0 5 5 3 1 3.0 3 3 +NULL F W 5 1 5.0 5 5 2 1 2.0 2 2 3 1 3.0 3 3 +NULL F W 6 1 6.0 6 6 2 1 2.0 2 2 0 1 0.0 0 0 +NULL F W 6 1 6.0 6 6 2 1 2.0 2 2 2 1 2.0 2 2 +NULL F W 6 1 6.0 6 6 2 1 2.0 2 2 3 1 3.0 3 3 +NULL F W 6 1 6.0 6 6 2 1 2.0 2 2 6 1 6.0 6 6 +NULL F W 6 1 6.0 6 6 4 1 4.0 4 4 6 1 6.0 6 6 +NULL F W 6 1 6.0 6 6 5 1 5.0 5 5 0 1 0.0 0 0 +NULL F W 6 1 6.0 6 6 6 1 6.0 6 6 5 1 5.0 5 5 +NULL M D 0 1 0.0 0 0 0 1 0.0 0 0 6 1 6.0 6 6 +NULL M D 0 1 0.0 0 0 3 1 3.0 3 3 0 1 0.0 0 0 +NULL M D 0 1 0.0 0 0 5 1 5.0 5 5 5 1 5.0 5 5 +NULL M D 1 1 1.0 1 1 2 1 2.0 2 2 0 1 0.0 0 0 +NULL M D 1 1 1.0 1 1 2 1 2.0 2 2 1 1 1.0 1 1 +NULL M D 1 1 1.0 1 1 2 1 2.0 2 2 6 1 6.0 6 6 +NULL M D 1 1 1.0 1 1 3 1 3.0 3 3 4 1 4.0 4 4 +NULL M D 2 1 2.0 2 2 1 1 1.0 1 1 0 1 0.0 0 0 +NULL M D 2 1 2.0 2 2 1 1 1.0 1 1 4 1 4.0 4 4 +NULL M D 2 1 2.0 2 2 4 1 4.0 4 4 6 1 6.0 6 6 +NULL M D 2 1 2.0 2 2 6 1 6.0 6 6 1 1 1.0 1 1 +NULL M D 3 1 3.0 3 3 0 1 0.0 0 0 6 1 6.0 6 6 +NULL M D 3 1 3.0 3 3 3 1 3.0 3 3 0 1 0.0 0 0 +NULL M D 3 1 3.0 3 3 3 1 3.0 3 3 3 1 3.0 3 3 +NULL M D 3 1 3.0 3 3 5 1 5.0 5 5 2 1 2.0 2 2 +NULL M D 3 1 3.0 3 3 5 1 5.0 5 5 5 1 5.0 5 5 +NULL M D 4 1 4.0 4 4 4 1 4.0 4 4 5 1 5.0 5 5 +NULL M D 4 1 4.0 4 4 6 1 6.0 6 6 5 1 5.0 5 5 +NULL M D 5 1 5.0 5 5 2 1 2.0 2 2 3 1 3.0 3 3 +NULL M D 6 1 6.0 6 6 3 1 3.0 3 3 1 1 1.0 1 1 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q36a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q36a.sql.out new file mode 100644 index 0000000000000..a74e6211b49af --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q36a.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +-0.43310777865000000000 NULL NULL 2 1 +-0.44057752675000000000 Home NULL 1 1 +-0.43759152110000000000 Music NULL 1 2 +-0.43708103961000000000 NULL NULL 1 3 +-0.43616253139000000000 Shoes NULL 1 4 +-0.43567118609000000000 Children NULL 1 5 +-0.43423932352000000000 Sports NULL 1 6 +-0.43342977300000000000 Electronics NULL 1 7 +-0.43243283121000000000 Women NULL 1 8 +-0.43164166900000000000 Men NULL 1 9 +-0.42516187690000000000 Books NULL 1 10 +-0.42448713381000000000 Jewelry NULL 1 11 +-0.73902664238792748962 NULL shirts 0 1 +-0.61125804873635587486 NULL country 0 2 +-0.53129803597069255822 NULL dresses 0 3 +-0.51266635289382758517 NULL athletic 0 4 +-0.45290387783638603924 NULL mens 0 5 +-0.41288056661656330013 NULL accessories 0 6 +-0.40784754677005682440 NULL NULL 0 7 +-0.34254844860867375832 NULL baseball 0 8 +-0.32511461675631534897 NULL infants 0 9 +-0.44733955704648003493 Books computers 0 1 +-0.44221358112622373783 Books home repair 0 2 +-0.44131129175272951442 Books romance 0 3 +-0.43954111564375046074 Books history 0 4 +-0.43921337505389731821 Books mystery 0 5 +-0.43904020269360481109 Books sports 0 6 +-0.42821476999837619396 Books travel 0 7 +-0.42609067296303848297 Books cooking 0 8 +-0.42538995145338568328 Books fiction 0 9 +-0.42446563616188232944 Books arts 0 10 +-0.42424821311884350413 Books parenting 0 11 +-0.41822014479424203008 Books reference 0 12 +-0.41350839325516811781 Books business 0 13 +-0.40935208137315013129 Books science 0 14 +-0.40159380735731858928 Books self-help 0 15 +-0.36957884843305744526 Books entertainments 0 16 +-0.44602461556731552282 Children school-uniforms 0 1 +-0.44141106040000560852 Children toddlers 0 2 +-0.43479886701046623711 Children infants 0 3 +-0.41900662971936329442 Children newborn 0 4 +-0.41526603781609697786 Children NULL 0 5 +-0.45347482218635333366 Electronics personal 0 1 +-0.44349670349829474271 Electronics stereo 0 2 +-0.44262427232850112058 Electronics automotive 0 3 +-0.44115886172705231970 Electronics portable 0 4 +-0.43972786651639318010 Electronics memory 0 5 +-0.43889275271590953040 Electronics scanners 0 6 +-0.43879181695132886061 Electronics karoke 0 7 +-0.43743655149948399284 Electronics dvd/vcr players 0 8 +-0.43737666390514154910 Electronics cameras 0 9 +-0.43390499017233926812 Electronics wireless 0 10 +-0.43163869754114299547 Electronics audio 0 11 +-0.42958938669780912634 Electronics camcorders 0 12 +-0.42872845803629855724 Electronics musical 0 13 +-0.42228240153396399656 Electronics televisions 0 14 +-0.41893847772039275795 Electronics monitors 0 15 +-0.39793878022746331540 Electronics disk drives 0 16 +-0.49051156860507320113 Home NULL 0 1 +-0.48431476750686752965 Home blinds/shades 0 2 +-0.47545837941951440918 Home bathroom 0 3 +-0.45726228921216284093 Home rugs 0 4 +-0.45540507568891021759 Home furniture 0 5 +-0.45303572267019508501 Home flatware 0 6 +-0.44755542058111800358 Home tables 0 7 +-0.44419847780930149402 Home wallpaper 0 8 +-0.44092345226680695671 Home glassware 0 9 +-0.43877591834074789745 Home decor 0 10 +-0.43765482553654514822 Home accent 0 11 +-0.43188199218974854630 Home bedding 0 12 +-0.43107417904272222899 Home kids 0 13 +-0.42474436355625900935 Home lighting 0 14 +-0.41783311109052416746 Home curtains/drapes 0 15 +-0.41767111806961188479 Home mattresses 0 16 +-0.40562188698541221499 Home paint 0 17 +-0.45165056505480816921 Jewelry jewelry boxes 0 1 +-0.44372227804836590137 Jewelry estate 0 2 +-0.44251815032563188894 Jewelry gold 0 3 +-0.43978127753996883542 Jewelry consignment 0 4 +-0.43821750044359339153 Jewelry custom 0 5 +-0.43439645036479672989 Jewelry bracelets 0 6 +-0.43208398325687772942 Jewelry loose stones 0 7 +-0.43060897375114375156 Jewelry diamonds 0 8 +-0.42847505748860847066 Jewelry costume 0 9 +-0.42667449062277843561 Jewelry rings 0 10 +-0.41987969011585456826 Jewelry mens watch 0 11 +-0.41624621972944533035 Jewelry semi-precious 0 12 +-0.41148949162100715771 Jewelry womens watch 0 13 +-0.39725668174847694299 Jewelry birdal 0 14 +-0.39665274051903254057 Jewelry pendants 0 15 +-0.38423525233438861010 Jewelry earings 0 16 +-0.44464388887858793403 Men shirts 0 1 +-0.43719860800637369827 Men accessories 0 2 +-0.43164606665359630905 Men sports-apparel 0 3 +-0.41530906677293519754 Men pants 0 4 +-0.38332708894803499123 Men NULL 0 5 +-0.47339698705534020269 Music NULL 0 1 +-0.44193214675249008923 Music rock 0 2 +-0.44008174913565459246 Music country 0 3 +-0.43863444992223641373 Music pop 0 4 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q47.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q47.sql.out new file mode 100644 index 0000000000000..0bdc42a4751cb --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q47.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +Shoes 1999 3 5607.487500 2197.48 3271.66 2831.67 +Shoes 1999 2 5643.938333 2393.31 4463.11 2652.44 +Shoes 1999 4 5640.362500 2416.57 3348.90 2987.78 +Men 1999 6 4702.116667 1534.95 2666.37 2514.13 +Men 1999 7 5330.618333 2218.63 3182.74 7436.83 +Shoes 1999 4 5338.852500 2233.60 3470.43 2832.41 +Music 1999 5 5139.465000 2034.96 3149.72 3648.17 +Men 1999 7 5748.707500 2645.88 3432.67 7646.91 +Men 1999 3 4915.190000 1815.92 2884.81 2956.00 +Women 1999 6 4586.300000 1508.07 2992.12 3059.37 +Shoes 1999 4 5374.032500 2322.80 2484.06 3313.69 +Men 1999 6 4596.057500 1577.69 2457.43 2439.68 +Men 1999 3 5839.670833 2825.07 3157.46 3531.36 +Men 1999 4 5342.149167 2347.82 2787.31 3588.16 +Shoes 1999 3 5643.938333 2652.44 2393.31 3008.88 +Men 1999 3 5475.719167 2515.22 2709.11 2702.85 +Shoes 1999 6 5338.852500 2388.17 2832.41 4216.10 +Shoes 1999 2 5065.706667 2119.85 3439.05 2640.59 +Shoes 1999 2 4713.009167 1774.19 3366.21 1940.05 +Shoes 1999 3 5374.032500 2484.06 2994.92 2322.80 +Men 1999 7 5342.149167 2454.72 2766.42 7665.06 +Men 1999 4 4741.993333 1879.47 3419.59 2634.29 +Music 1999 4 4723.742500 1866.30 2384.82 2931.55 +Shoes 1999 4 4732.205000 1875.08 2686.46 3422.03 +Children 1999 6 4849.967500 2002.59 2590.23 3380.67 +Men 1999 6 4920.419167 2077.36 3402.55 3347.44 +Men 1999 4 4596.057500 1762.17 2728.14 2457.43 +Children 1999 4 4739.001667 1923.04 2309.91 2849.64 +Music 1999 3 4816.848333 2010.47 2539.57 2940.38 +Shoes 1999 2 4707.697500 1903.70 2693.49 3474.34 +Shoes 1999 2 4443.995833 1642.32 3972.50 2319.04 +Men 1999 6 5839.670833 3053.78 3151.27 3622.65 +Shoes 1999 4 5607.487500 2831.67 2197.48 4187.54 +Men 1999 3 5598.894167 2824.13 3154.80 3135.60 +Shoes 1999 3 4713.009167 1940.05 1774.19 2496.18 +Men 1999 4 5475.719167 2702.85 2515.22 4364.56 +Shoes 1999 4 4596.537500 1825.00 2777.56 3234.34 +Music 1999 6 4332.550833 1563.26 2484.37 2460.11 +Men 1999 2 5102.436667 2333.32 3417.85 2536.68 +Men 1999 2 5475.719167 2709.11 4740.72 2515.22 +Men 1999 6 5475.719167 2723.08 4364.56 4000.42 +Shoes 1999 2 5338.852500 2587.72 3837.18 3470.43 +Children 1999 6 4426.704167 1683.86 2186.50 1970.76 +Shoes 1999 6 5643.938333 2902.72 3046.01 3994.18 +Shoes 1999 6 5374.032500 2637.31 3313.69 3158.65 +Men 1999 3 4920.419167 2183.89 3598.63 2841.78 +Men 1999 3 5330.618333 2602.65 2613.45 2624.00 +Women 1999 6 4366.627500 1640.10 3159.43 2882.91 +Music 1999 2 5139.465000 2413.63 4627.89 2773.28 +Men 1999 2 4929.611667 2207.89 3940.06 2246.76 +Women 1999 2 4551.444167 1833.08 3729.30 2940.96 +Men 1999 2 5330.618333 2613.45 3859.71 2602.65 +Children 1999 2 4640.935833 1927.95 3524.16 2584.03 +Children 1999 7 4565.828333 1853.57 2846.40 6447.36 +Women 1999 6 4551.444167 1840.98 2478.75 3174.74 +Men 1999 4 5330.618333 2624.00 2602.65 3722.18 +Children 1999 3 5024.325000 2319.29 2691.31 2350.53 +Children 1999 2 4836.831667 2132.80 3984.13 2182.12 +Children 1999 4 4640.935833 1950.03 2584.03 2919.51 +Shoes 1999 3 4791.740833 2100.87 2211.40 3278.75 +Men 1999 5 5839.670833 3151.27 3531.36 3053.78 +Men 1999 3 4929.611667 2246.76 2207.89 3208.14 +Men 1999 2 5839.670833 3157.46 3425.68 2825.07 +Men 1999 5 5311.965833 2631.11 2819.12 3022.54 +Music 1999 2 4388.770833 1714.25 2228.69 2407.93 +Shoes 1999 2 4989.784167 2315.46 4430.70 2976.26 +Children 1999 4 5024.325000 2350.53 2319.29 2984.92 +Women 1999 3 4586.300000 1917.37 3282.12 2557.46 +Children 1999 3 4836.831667 2182.12 2132.80 3466.25 +Shoes 1999 5 5640.362500 2987.78 2416.57 3437.87 +Men 1999 4 5071.261667 2425.64 2696.60 2641.17 +Shoes 1999 6 4443.995833 1801.87 2297.76 3078.40 +Children 1999 2 4480.353333 1838.88 3250.53 2375.04 +Men 1999 7 5102.436667 2464.06 2798.80 6978.09 +Shoes 1999 4 5643.938333 3008.88 2652.44 3046.01 +Men 1999 2 5071.261667 2438.50 4282.24 2696.60 +Children 1999 6 4525.318333 1896.34 2883.95 2727.36 +Children 1999 4 4212.889167 1588.72 2296.49 3077.12 +Shoes 1999 4 4884.260000 2261.01 2502.36 3210.47 +Men 1999 3 5748.707500 3132.90 3747.34 3768.23 +Shoes 1999 2 5640.362500 3027.85 4285.15 3348.90 +Music 1999 3 4490.221667 1883.06 2321.31 2211.82 +Children 1999 2 4423.506667 1816.43 3192.19 3334.11 +Music 1999 6 4894.035000 2288.21 3156.77 2845.45 +Music 1999 5 4829.768333 2225.46 3380.94 2782.42 +Women 1999 3 4268.562500 1665.68 1758.65 2082.99 +Children 1999 3 4267.374167 1667.03 2579.77 2802.05 +Men 1999 3 4987.821667 2387.78 2962.40 2928.83 +Women 1999 3 4309.575833 1710.42 2004.22 2742.41 +Shoes 1999 5 5643.938333 3046.01 3008.88 2902.72 +Music 1999 4 4518.543333 1922.23 2683.26 2227.02 +Children 1999 3 4441.555000 1846.53 3827.47 3623.30 +Men 1999 5 5748.707500 3156.57 3768.23 3432.67 +Music 1999 2 4302.831667 1712.70 3561.46 2414.41 +Women 1999 7 4494.382500 1904.98 2308.58 5603.14 +Women 1999 4 4582.713333 1994.71 2408.40 2321.48 +Music 1999 3 4426.623333 1840.51 2707.80 3147.10 +Shoes 1999 2 4791.740833 2211.40 3912.90 2100.87 +Shoes 1999 7 5640.362500 3062.31 3437.87 6376.30 +Children 1999 3 4733.152500 2155.79 2710.50 2685.74 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q49.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q49.sql.out new file mode 100644 index 0000000000000..31b31b7bdc02b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q49.sql.out @@ -0,0 +1,37 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +catalog 16735 0.50505050505050505051 1 1 +catalog 12633 0.69662921348314606742 2 2 +catalog 13967 0.70000000000000000000 3 3 +catalog 12819 0.70129870129870129870 4 8 +catalog 16155 0.72043010752688172043 5 4 +catalog 17681 0.75268817204301075269 6 5 +catalog 5975 0.76404494382022471910 7 6 +catalog 11451 0.76744186046511627907 8 7 +catalog 1689 0.80219780219780219780 9 9 +catalog 10311 0.81818181818181818182 10 10 +store 5111 0.78947368421052631579 1 1 +store 11073 0.83505154639175257732 2 3 +store 14429 0.84782608695652173913 3 2 +store 15927 0.86419753086419753086 4 4 +store 10171 0.86868686868686868687 5 5 +store 12783 0.88775510204081632653 6 6 +store 11075 0.89743589743589743590 7 7 +store 12889 0.95652173913043478261 8 8 +store 1939 0.99000000000000000000 9 9 +store 4333 1.00000000000000000000 10 10 +store 10455 1.00000000000000000000 10 10 +store 12975 1.00000000000000000000 10 10 +web 10485 0.48863636363636363636 1 1 +web 4483 0.52688172043010752688 2 2 +web 8833 0.58241758241758241758 3 3 +web 1165 0.61458333333333333333 4 4 +web 17197 0.73076923076923076923 5 5 +web 10319 0.73469387755102040816 6 6 +web 13159 0.75257731958762886598 7 7 +web 9629 0.77894736842105263158 8 8 +web 5909 0.78378378378378378378 9 9 +web 7057 0.86746987951807228916 10 10 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q51a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q51a.sql.out new file mode 100644 index 0000000000000..62b22b5ca706f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q51a.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +9 2001-01-20 155.31 NULL 155.31 4.26 +9 2001-02-01 168.10 28.81 168.10 28.81 +9 2001-02-04 NULL 34.51 168.10 34.51 +9 2001-02-15 NULL 144.79 168.10 144.79 +9 2001-04-02 249.70 NULL 249.70 181.21 +9 2001-04-09 NULL 183.64 249.70 183.64 +9 2001-04-17 260.21 230.47 260.21 230.47 +29 2001-01-07 145.14 NULL 145.14 12.18 +29 2001-01-10 NULL 53.52 145.14 53.52 +29 2001-01-11 NULL 55.81 145.14 55.81 +29 2001-02-05 NULL 88.85 145.14 88.85 +29 2001-02-08 NULL 140.80 145.14 140.80 +29 2001-02-28 215.28 NULL 215.28 212.84 +29 2001-03-30 340.91 NULL 340.91 279.82 +29 2001-04-07 NULL 306.91 340.91 306.91 +29 2001-05-26 392.06 389.83 392.06 389.83 +29 2001-06-12 NULL 391.96 392.06 391.96 +29 2001-06-29 580.42 NULL 580.42 407.31 +29 2001-07-08 NULL 429.12 580.42 429.12 +29 2001-07-12 NULL 444.37 580.42 444.37 +29 2001-07-26 NULL 501.13 580.42 501.13 +29 2001-07-28 NULL 523.55 580.42 523.55 +29 2001-07-31 NULL 547.65 580.42 547.65 +29 2001-09-15 755.81 NULL 755.81 710.20 +29 2001-09-16 NULL 742.83 755.81 742.83 +31 2001-01-23 160.83 143.12 160.83 143.12 +31 2001-01-24 247.53 NULL 247.53 143.12 +31 2001-02-04 NULL 143.12 247.53 143.12 +31 2001-02-07 NULL 166.46 247.53 166.46 +31 2001-02-15 NULL 224.58 247.53 224.58 +31 2001-02-22 NULL 243.99 247.53 243.99 +31 2001-02-26 NULL 245.24 247.53 245.24 +33 2001-02-06 143.86 NULL 143.86 100.10 +33 2001-03-06 260.39 NULL 260.39 100.10 +33 2001-03-08 311.65 NULL 311.65 100.10 +33 2001-03-17 NULL 166.59 311.65 166.59 +33 2001-04-04 NULL 195.94 311.65 195.94 +33 2001-04-11 NULL 218.41 311.65 218.41 +33 2001-04-15 NULL 258.16 311.65 258.16 +33 2001-04-26 NULL 260.73 311.65 260.73 +35 2001-04-11 218.63 NULL 218.63 175.11 +35 2001-04-13 NULL 200.14 218.63 200.14 +35 2001-04-15 NULL 213.01 218.63 213.01 +35 2001-04-21 236.74 NULL 236.74 213.01 +35 2001-05-12 250.14 NULL 250.14 213.01 +35 2001-06-03 315.73 NULL 315.73 213.01 +35 2001-06-09 NULL 213.01 315.73 213.01 +35 2001-06-12 350.47 NULL 350.47 213.01 +35 2001-06-16 NULL 240.39 350.47 240.39 +35 2001-06-29 NULL 251.30 350.47 251.30 +35 2001-07-03 NULL 251.62 350.47 251.62 +35 2001-07-06 NULL 279.62 350.47 279.62 +35 2001-07-10 NULL 281.30 350.47 281.30 +35 2001-07-19 NULL 285.09 350.47 285.09 +35 2001-07-22 NULL 306.31 350.47 306.31 +35 2001-07-28 421.29 NULL 421.29 306.31 +35 2001-07-29 434.60 NULL 434.60 306.31 +37 2001-03-07 104.29 NULL 104.29 100.87 +47 2001-01-01 7.00 5.55 7.00 5.55 +47 2001-01-15 72.85 NULL 72.85 48.96 +47 2001-01-22 NULL 58.39 72.85 58.39 +47 2001-02-17 139.16 NULL 139.16 119.31 +49 2001-05-05 361.90 NULL 361.90 340.45 +49 2001-05-21 397.02 NULL 397.02 340.45 +49 2001-05-25 479.86 NULL 479.86 340.45 +49 2001-06-03 NULL 350.29 479.86 350.29 +49 2001-06-10 488.44 NULL 488.44 350.29 +49 2001-06-20 NULL 362.21 488.44 362.21 +49 2001-06-28 527.37 NULL 527.37 362.21 +49 2001-07-19 NULL 490.09 527.37 490.09 +49 2001-07-23 532.83 NULL 532.83 490.09 +49 2001-07-26 NULL 511.76 532.83 511.76 +49 2001-07-31 556.70 NULL 556.70 511.76 +51 2001-03-24 142.03 NULL 142.03 141.46 +51 2001-04-11 221.62 NULL 221.62 208.13 +53 2001-02-01 150.99 NULL 150.99 15.99 +53 2001-02-03 NULL 92.68 150.99 92.68 +53 2001-02-09 NULL 96.53 150.99 96.53 +53 2001-02-18 NULL 98.68 150.99 98.68 +53 2001-02-20 NULL 129.22 150.99 129.22 +57 2001-03-15 147.84 NULL 147.84 108.81 +65 2001-01-07 NULL 7.39 143.43 7.39 +65 2001-01-08 NULL 21.35 143.43 21.35 +65 2001-01-16 NULL 102.46 143.43 102.46 +67 2001-02-02 120.54 13.19 120.54 13.19 +67 2001-02-19 219.36 NULL 219.36 120.94 +67 2001-03-12 NULL 203.25 219.36 203.25 +67 2001-04-13 330.07 NULL 330.07 277.79 +67 2001-04-23 NULL 284.23 330.07 284.23 +67 2001-04-27 NULL 290.21 330.07 290.21 +67 2001-04-28 NULL 320.26 330.07 320.26 +69 2001-02-22 54.17 NULL 54.17 36.00 +69 2001-02-27 NULL 45.08 54.17 45.08 +73 2001-01-18 184.35 NULL 184.35 178.75 +73 2001-01-19 185.11 NULL 185.11 178.75 +73 2001-02-09 NULL 180.42 185.11 180.42 +75 2001-01-15 NULL 9.11 19.68 9.11 +75 2001-01-31 36.37 NULL 36.37 9.11 +75 2001-02-03 NULL 14.06 36.37 14.06 +83 2001-02-03 72.95 NULL 72.95 55.10 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q57.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q57.sql.out new file mode 100644 index 0000000000000..ea23526b956ee --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q57.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +Music amalgscholar #x 1999 2 6662.669167 1961.57 4348.07 3386.25 +Shoes amalgedu pack #x 1999 2 6493.071667 2044.05 4348.88 3443.20 +Shoes exportiedu pack #x 1999 3 7416.141667 2980.15 4654.22 5157.83 +Children importoexporti #x 1999 4 6577.143333 2152.15 3291.07 3659.32 +Shoes importoedu pack #x 1999 6 6926.960833 2523.33 4014.93 4254.99 +Men importoimporto #x 1999 2 6707.315833 2449.22 4311.11 3583.31 +Men amalgimporto #x 1999 4 7098.680833 2965.42 3526.45 4923.53 +Men exportiimporto #x 1999 2 7146.240000 3013.99 6183.83 5091.17 +Children amalgexporti #x 1999 4 6364.467500 2270.79 3330.83 3817.50 +Men edu packimporto #x 1999 4 7386.333333 3329.74 3488.01 4860.20 +Men edu packimporto #x 1999 2 7386.333333 3347.65 4007.40 3488.01 +Music edu packscholar #x 1999 7 6639.040000 2653.55 4219.52 10071.22 +Music amalgscholar #x 1999 4 6719.304167 2739.33 3690.54 3872.98 +Men importoimporto #x 1999 3 6610.034167 2645.24 3661.14 4282.01 +Music exportischolar #x 1999 2 7043.051667 3115.83 4457.95 5258.95 +Men edu packimporto #x 1999 3 7386.333333 3488.01 3347.65 3329.74 +Shoes exportiedu pack #x 1999 3 7255.790000 3411.07 4194.64 3624.85 +Women exportiamalg #x 1999 2 5646.671667 1809.52 4198.70 2172.85 +Music importoscholar #x 1999 6 6279.081667 2456.98 4361.44 4256.24 +Children importoexporti #x 1999 7 6786.750000 2978.82 3942.59 7809.22 +Music exportischolar #x 1999 2 7041.705833 3245.77 3608.31 4127.40 +Shoes importoedu pack #x 1999 2 6864.320833 3104.48 3135.52 3606.28 +Shoes importoedu pack #x 1999 1 6864.320833 3135.52 14580.30 3104.48 +Children edu packexporti #x 1999 5 6511.800833 2785.92 3956.90 3906.63 +Women amalgamalg #x 1999 2 6480.683333 2769.69 3353.67 3876.51 +Men exportiimporto #x 1999 5 7146.240000 3440.57 3561.11 3971.13 +Women importoamalg #x 1999 3 6512.794167 2808.28 3789.51 4335.27 +Men amalgimporto #x 1999 2 6720.550000 3018.90 4328.03 3810.74 +Shoes exportiedu pack #x 1999 7 7255.790000 3557.87 4937.98 9496.49 +Music exportischolar #x 1999 5 6791.260833 3096.02 3918.04 3801.90 +Men exportiimporto #x 1999 1 7343.719167 3652.72 13689.13 3984.13 +Men importoimporto #x 1999 5 6707.315833 3030.18 4977.33 4620.75 +Children exportiexporti #x 1999 2 6386.880833 2717.07 4809.11 3355.48 +Men amalgimporto #x 1999 2 7098.680833 3440.27 5293.69 3526.45 +Men importoimporto #x 1999 5 6610.034167 2954.71 4282.01 3166.43 +Shoes exportiedu pack #x 1999 4 7255.790000 3624.85 3411.07 5169.09 +Men exportiimporto #x 1999 5 7343.719167 3727.75 3729.62 4580.93 +Men exportiimporto #x 1999 4 7343.719167 3729.62 4033.37 3727.75 +Music edu packscholar #x 1999 2 6489.175000 2875.98 4299.82 4028.97 +Men edu packimporto #x 1999 1 7202.242500 3614.07 15582.63 4234.79 +Music importoscholar #x 1999 2 5816.271667 2229.79 2919.29 4298.41 +Men exportiimporto #x 1999 4 7146.240000 3561.11 5091.17 3440.57 +Shoes exportiedu pack #x 1999 7 7073.462500 3493.41 4534.31 8701.59 +Music exportischolar #x 1999 3 6791.260833 3218.13 3847.87 3918.04 +Shoes edu packedu pack #x 1999 4 6203.331667 2631.02 4424.18 4186.85 +Men amalgimporto #x 1999 3 7098.680833 3526.45 3440.27 2965.42 +Men edu packimporto #x 1999 3 7202.242500 3639.93 4234.79 4016.25 +Children amalgexporti #x 1999 2 6364.467500 2825.09 4111.08 3330.83 +Shoes edu packedu pack #x 1999 2 6464.239167 2928.99 4233.86 3840.97 +Shoes amalgedu pack #x 1999 4 6493.071667 2962.20 3443.20 4212.60 +Music importoscholar #x 1999 4 5707.844167 2179.41 3789.16 4317.53 +Shoes exportiedu pack #x 1999 1 7416.141667 3892.54 14170.68 4654.22 +Women importoamalg #x 1999 5 6512.794167 2991.07 4335.27 4624.86 +Music exportischolar #x 1999 4 7043.051667 3521.99 5258.95 4135.21 +Women edu packamalg #x 1999 2 6354.045833 2836.23 3719.67 3527.07 +Music amalgscholar #x 1999 3 6123.475000 2617.39 3080.43 4919.93 +Shoes amalgedu pack #x 1999 7 6674.896667 3178.12 3342.98 8050.81 +Men amalgimporto #x 1999 5 6618.534167 3127.28 4291.66 4669.62 +Women amalgamalg #x 1999 6 6874.250000 3387.53 4798.69 4329.48 +Women exportiamalg #x 1999 3 5646.671667 2172.85 1809.52 4461.31 +Children edu packexporti #x 1999 2 6112.954167 2641.54 3567.58 3196.45 +Children amalgexporti #x 1999 5 6294.100833 2834.48 3317.60 3803.79 +Women edu packamalg #x 1999 5 6027.880000 2575.81 2750.96 4459.01 +Music exportischolar #x 1999 6 7041.705833 3589.97 4134.03 4892.26 +Music exportischolar #x 1999 4 7041.705833 3593.86 4127.40 4134.03 +Men importoimporto #x 1999 6 6610.034167 3166.43 2954.71 3673.39 +Music exportischolar #x 1999 1 7041.705833 3608.31 15046.54 3245.77 +Music edu packscholar #x 1999 2 6602.385000 3173.44 3434.91 3929.40 +Music amalgscholar #x 1999 6 6123.475000 2699.75 4038.47 3330.87 +Children importoexporti #x 1999 4 6786.750000 3366.25 3847.60 4259.57 +Men edu packimporto #x 1999 1 7230.493333 3811.64 14668.93 4497.31 +Shoes importoedu pack #x 1999 5 6864.320833 3449.62 3869.15 3531.93 +Children edu packexporti #x 1999 2 6739.498333 3328.01 4986.50 3623.32 +Children importoexporti #x 1999 1 6786.750000 3376.55 12504.93 5018.22 +Children edu packexporti #x 1999 7 6112.954167 2711.04 3254.04 9465.10 +Shoes importoedu pack #x 1999 3 6588.741667 3187.25 4283.21 3212.76 +Men importoimporto #x 1999 3 6702.415000 3310.55 3981.06 4901.56 +Men edu packimporto #x 1999 1 7386.333333 4007.40 14005.45 3347.65 +Shoes importoedu pack #x 1999 4 6588.741667 3212.76 3187.25 3974.78 +Shoes edu packedu pack #x 1999 6 6203.331667 2835.78 4186.85 3192.53 +Men exportiimporto #x 1999 2 7343.719167 3984.13 3652.72 4033.37 +Men amalgimporto #x 1999 4 6720.550000 3364.32 3810.74 4333.58 +Children edu packexporti #x 1999 4 6739.498333 3389.03 3623.32 3605.25 +Shoes importoedu pack #x 1999 6 6864.320833 3531.93 3449.62 4414.17 +Shoes amalgedu pack #x 1999 6 6674.896667 3342.98 4458.26 3178.12 +Children edu packexporti #x 1999 2 6511.800833 3185.28 3581.75 3410.75 +Children amalgexporti #x 1999 4 6854.405833 3541.62 3854.33 3938.42 +Men exportiimporto #x 1999 3 7343.719167 4033.37 3984.13 3729.62 +Men amalgimporto #x 1999 3 6618.534167 3313.62 4044.36 4291.66 +Shoes exportiedu pack #x 1999 7 7416.141667 4121.24 4239.08 8658.42 +Women importoamalg #x 1999 6 6395.326667 3102.55 4234.22 3650.03 +Children importoexporti #x 1999 3 6577.143333 3291.07 3773.61 2152.15 +Women edu packamalg #x 1999 4 6027.880000 2750.96 3199.35 2575.81 +Music amalgscholar #x 1999 3 6662.669167 3386.25 1961.57 4799.18 +Men amalgimporto #x 1999 6 7098.680833 3834.90 4923.53 4115.57 +Shoes importoedu pack #x 1999 3 6864.320833 3606.28 3104.48 3869.15 +Music exportischolar #x 1999 6 7043.051667 3793.48 4135.21 5006.69 +Shoes edu packedu pack #x 1999 1 6711.753333 3473.10 15060.83 4085.86 +Men exportiimporto #x 1999 1 7419.459167 4188.88 16358.86 4366.77 +Women amalgamalg #x 1999 2 6362.709167 3137.03 4180.91 3181.26 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q5a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q5a.sql.out new file mode 100644 index 0000000000000..600c51b691b35 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q5a.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL 115594110.84 2284876.41 -30784735.42 +catalog channel NULL 39386111.98 835889.43 -4413707.25 +catalog channel catalog_pageAAAAAAAAAABAAAAA 142709.95 0.00 -33829.11 +catalog channel catalog_pageAAAAAAAAAADAAAAA 78358.50 0.00 -9578.35 +catalog channel catalog_pageAAAAAAAAABAAAAAA 0.00 4176.90 -492.29 +catalog channel catalog_pageAAAAAAAAABBAAAAA 71027.83 0.00 -27264.22 +catalog channel catalog_pageAAAAAAAAABDAAAAA 93670.35 0.00 -3768.98 +catalog channel catalog_pageAAAAAAAAACAAAAAA 0.00 1776.17 -1252.65 +catalog channel catalog_pageAAAAAAAAACBAAAAA 112153.16 0.00 -19004.12 +catalog channel catalog_pageAAAAAAAAACDAAAAA 102298.11 0.00 -14768.21 +catalog channel catalog_pageAAAAAAAAADAAAAAA 0.00 8773.82 -4372.46 +catalog channel catalog_pageAAAAAAAAADBAAAAA 23722.97 0.00 -22193.13 +catalog channel catalog_pageAAAAAAAAADDAAAAA 47126.10 0.00 -6735.40 +catalog channel catalog_pageAAAAAAAAAEAAAAAA 0.00 6234.69 -2690.18 +catalog channel catalog_pageAAAAAAAAAEBAAAAA 45880.56 679.36 -16578.99 +catalog channel catalog_pageAAAAAAAAAEDAAAAA 66004.24 0.00 6074.29 +catalog channel catalog_pageAAAAAAAAAFAAAAAA 0.00 463.68 -1521.36 +catalog channel catalog_pageAAAAAAAAAFDAAAAA 88022.65 0.00 -769.81 +catalog channel catalog_pageAAAAAAAAAGAAAAAA 0.00 8947.80 -2922.65 +catalog channel catalog_pageAAAAAAAAAGDAAAAA 124552.05 0.00 24880.33 +catalog channel catalog_pageAAAAAAAAAHAAAAAA 188643.97 0.00 -33045.93 +catalog channel catalog_pageAAAAAAAAAIAAAAAA 219950.84 518.83 -1089.03 +catalog channel catalog_pageAAAAAAAAAJAAAAAA 196607.25 7494.81 -41407.88 +catalog channel catalog_pageAAAAAAAAAJCAAAAA 23556.72 0.00 -5599.24 +catalog channel catalog_pageAAAAAAAAAKAAAAAA 155095.31 0.00 -24248.39 +catalog channel catalog_pageAAAAAAAAAKCAAAAA 13054.83 0.00 -528.84 +catalog channel catalog_pageAAAAAAAAALAAAAAA 114177.20 1866.02 -48127.76 +catalog channel catalog_pageAAAAAAAAALCAAAAA 10602.13 0.00 -3956.02 +catalog channel catalog_pageAAAAAAAAAMAAAAAA 180993.77 144.00 -26262.58 +catalog channel catalog_pageAAAAAAAAAMCAAAAA 29191.46 0.00 -8019.34 +catalog channel catalog_pageAAAAAAAAANAAAAAA 202640.83 0.00 14603.23 +catalog channel catalog_pageAAAAAAAAANBAAAAA 0.00 3103.80 -1162.99 +catalog channel catalog_pageAAAAAAAAANCAAAAA 14627.25 61.80 1219.16 +catalog channel catalog_pageAAAAAAAAAOAAAAAA 49178.54 0.00 -27661.86 +catalog channel catalog_pageAAAAAAAAAOCAAAAA 9621.16 0.00 -4213.22 +catalog channel catalog_pageAAAAAAAAAPAAAAAA 142216.57 0.00 21113.94 +catalog channel catalog_pageAAAAAAAAAPBAAAAA 0.00 4876.83 -2903.30 +catalog channel catalog_pageAAAAAAAAAPCAAAAA 17230.02 689.60 -1816.99 +catalog channel catalog_pageAAAAAAAABAAAAAAA 0.00 1902.91 -1516.52 +catalog channel catalog_pageAAAAAAAABABAAAAA 100018.02 0.00 -9370.45 +catalog channel catalog_pageAAAAAAAABADAAAAA 115622.82 0.00 12126.64 +catalog channel catalog_pageAAAAAAAABBAAAAAA 0.00 1786.21 -891.28 +catalog channel catalog_pageAAAAAAAABBBAAAAA 76388.45 1153.20 2393.80 +catalog channel catalog_pageAAAAAAAABBCAAAAA 0.00 831.90 -1077.03 +catalog channel catalog_pageAAAAAAAABBDAAAAA 47684.96 0.00 -8371.50 +catalog channel catalog_pageAAAAAAAABCAAAAAA 0.00 4371.58 -4222.90 +catalog channel catalog_pageAAAAAAAABCBAAAAA 93859.97 1753.50 -1196.59 +catalog channel catalog_pageAAAAAAAABCDAAAAA 73347.51 0.00 -11342.92 +catalog channel catalog_pageAAAAAAAABDAAAAAA 0.00 3474.90 -1008.22 +catalog channel catalog_pageAAAAAAAABDBAAAAA 42173.47 0.00 -26341.79 +catalog channel catalog_pageAAAAAAAABDCAAAAA 0.00 305.46 -585.35 +catalog channel catalog_pageAAAAAAAABDDAAAAA 83810.14 0.00 -1482.89 +catalog channel catalog_pageAAAAAAAABEAAAAAA 0.00 347.39 -197.16 +catalog channel catalog_pageAAAAAAAABEBAAAAA 97527.42 0.00 2333.17 +catalog channel catalog_pageAAAAAAAABEDAAAAA 60506.22 0.00 -1212.87 +catalog channel catalog_pageAAAAAAAABFAAAAAA 0.00 6528.33 -2187.98 +catalog channel catalog_pageAAAAAAAABFDAAAAA 68737.67 0.00 -11721.44 +catalog channel catalog_pageAAAAAAAABHAAAAAA 199767.35 1044.68 -6811.92 +catalog channel catalog_pageAAAAAAAABIAAAAAA 205306.84 411.12 2555.23 +catalog channel catalog_pageAAAAAAAABICAAAAA 0.00 68.02 -99.54 +catalog channel catalog_pageAAAAAAAABJAAAAAA 187825.12 230.88 -21543.64 +catalog channel catalog_pageAAAAAAAABJBAAAAA 0.00 727.89 -209.17 +catalog channel catalog_pageAAAAAAAABJCAAAAA 14241.32 0.00 4283.83 +catalog channel catalog_pageAAAAAAAABKAAAAAA 215820.15 1121.48 -7030.88 +catalog channel catalog_pageAAAAAAAABKBAAAAA 0.00 3063.15 -3543.44 +catalog channel catalog_pageAAAAAAAABKCAAAAA 1871.32 0.00 -2063.64 +catalog channel catalog_pageAAAAAAAABLAAAAAA 171643.10 779.60 -15082.45 +catalog channel catalog_pageAAAAAAAABLCAAAAA 8855.03 0.00 3013.67 +catalog channel catalog_pageAAAAAAAABMAAAAAA 202476.57 1954.44 10034.15 +catalog channel catalog_pageAAAAAAAABMCAAAAA 13837.48 0.00 6008.90 +catalog channel catalog_pageAAAAAAAABNAAAAAA 197464.73 1397.02 -34977.14 +catalog channel catalog_pageAAAAAAAABNCAAAAA 14801.05 0.00 -6910.60 +catalog channel catalog_pageAAAAAAAABOAAAAAA 98871.66 0.00 -6493.20 +catalog channel catalog_pageAAAAAAAABOCAAAAA 15216.80 0.00 -5722.57 +catalog channel catalog_pageAAAAAAAABPAAAAAA 99238.38 100.20 -6353.28 +catalog channel catalog_pageAAAAAAAABPCAAAAA 26783.54 0.00 4129.36 +catalog channel catalog_pageAAAAAAAACAAAAAAA 0.00 8072.86 -3459.85 +catalog channel catalog_pageAAAAAAAACABAAAAA 139938.46 0.00 8612.80 +catalog channel catalog_pageAAAAAAAACADAAAAA 36613.51 0.00 -9705.44 +catalog channel catalog_pageAAAAAAAACBAAAAAA 0.00 9373.27 -7982.93 +catalog channel catalog_pageAAAAAAAACBBAAAAA 111531.45 55.38 -15921.86 +catalog channel catalog_pageAAAAAAAACBDAAAAA 103545.90 0.00 -168.10 +catalog channel catalog_pageAAAAAAAACCAAAAAA 0.00 3879.26 -1783.40 +catalog channel catalog_pageAAAAAAAACCBAAAAA 78290.87 0.00 -12841.84 +catalog channel catalog_pageAAAAAAAACCDAAAAA 37841.79 0.00 -26568.14 +catalog channel catalog_pageAAAAAAAACDAAAAAA 0.00 923.32 -1166.75 +catalog channel catalog_pageAAAAAAAACDBAAAAA 113988.86 212.31 -9856.53 +catalog channel catalog_pageAAAAAAAACDDAAAAA 64516.71 0.00 -27577.04 +catalog channel catalog_pageAAAAAAAACEAAAAAA 0.00 2955.12 -1700.94 +catalog channel catalog_pageAAAAAAAACEBAAAAA 91555.04 0.00 -23392.02 +catalog channel catalog_pageAAAAAAAACEDAAAAA 84993.13 0.00 -24259.30 +catalog channel catalog_pageAAAAAAAACFAAAAAA 0.00 6507.25 -3250.26 +catalog channel catalog_pageAAAAAAAACFDAAAAA 73749.97 0.00 1468.23 +catalog channel catalog_pageAAAAAAAACGAAAAAA 0.00 8814.60 -3790.45 +catalog channel catalog_pageAAAAAAAACHAAAAAA 157602.51 907.12 -50822.23 +catalog channel catalog_pageAAAAAAAACHCAAAAA 0.00 59.58 -63.15 +catalog channel catalog_pageAAAAAAAACIAAAAAA 132342.50 4686.24 -45195.01 +catalog channel catalog_pageAAAAAAAACIBAAAAA 0.00 6029.56 -3462.80 +catalog channel catalog_pageAAAAAAAACICAAAAA 0.00 530.41 -535.89 +catalog channel catalog_pageAAAAAAAACJAAAAAA 193536.42 2487.88 -29573.52 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q6.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q6.sql.out new file mode 100644 index 0000000000000..86d2d430218f7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q6.sql.out @@ -0,0 +1,51 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +VT 10 +MA 11 +NH 11 +NJ 14 +NV 16 +OR 16 +WY 16 +AK 20 +ME 22 +MD 26 +WA 29 +ID 31 +NM 31 +UT 36 +ND 38 +SC 41 +SD 43 +WV 44 +CA 52 +FL 53 +LA 56 +PA 57 +NY 59 +AR 61 +CO 61 +WI 61 +MT 66 +MS 68 +OK 68 +MN 71 +OH 75 +MO 79 +IL 80 +AL 81 +NC 81 +IA 82 +MI 84 +KS 86 +NE 86 +NULL 88 +IN 94 +TN 108 +KY 110 +VA 128 +GA 138 +TX 250 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q64.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q64.sql.out new file mode 100644 index 0000000000000..a803af3a52c21 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q64.sql.out @@ -0,0 +1,14 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +ablepricallyantiought ation 35709 996 NULL Bridgeport 65817 752 Lakeview Lincoln Friendship 74536 1999 1 15.78 24.93 0.00 17.09 26.31 0.00 2000 1 +ablepricallyantiought ation 35709 71 River River Friendship 34536 NULL NULL Newport NULL 1999 1 22.60 38.87 0.00 17.09 26.31 0.00 2000 1 +ablepricallyantiought bar 31904 128 East Franklin 19101 990 2nd Friendship 94536 1999 1 54.76 78.30 0.00 15.80 23.54 0.00 2000 1 +ationbarpri ation 35709 362 Central Ridge Oakland 69843 666 13th Ridge Shiloh 29275 1999 1 74.00 95.46 0.00 11.32 20.94 0.00 2000 1 +ationbarpri ese 31904 759 Elm Pine Belmont 20191 35 Madison Waterloo 31675 1999 1 12.92 22.22 0.00 24.15 36.70 0.00 2000 1 +ationbarpri ese 31904 759 Elm Pine Belmont 20191 35 Madison Waterloo 31675 1999 1 12.92 22.22 0.00 83.87 147.61 0.00 2000 1 +ationbarpri ought 31904 754 NULL NULL 65804 897 8th Ashland 54244 1999 1 74.70 90.38 0.00 12.02 12.74 0.00 2000 1 +ationbarpri ought 31904 754 NULL NULL 65804 897 8th Ashland 54244 1999 1 74.70 90.38 0.00 28.08 38.18 0.00 2000 1 +ationbarpri ought 31904 754 NULL NULL 65804 897 8th Ashland 54244 1999 1 74.70 90.38 0.00 56.60 63.39 0.00 2000 1 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q67a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q67a.sql.out new file mode 100644 index 0000000000000..2c460414e8623 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q67a.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL NULL NULL NULL NULL NULL NULL 681149.47 5 +NULL NULL NULL NULL NULL NULL NULL NULL 1474997.55 4 +NULL NULL NULL NULL NULL NULL NULL NULL 1577864.42 3 +NULL NULL NULL NULL NULL NULL NULL NULL 2536204.81 2 +NULL NULL NULL NULL NULL NULL NULL NULL 999668082.59 1 +NULL NULL NULL NULL 2001 NULL NULL NULL 681149.47 5 +NULL NULL NULL NULL 2001 1 NULL NULL 111437.42 32 +NULL NULL NULL NULL 2001 1 1 NULL 36235.73 90 +NULL NULL NULL NULL 2001 1 3 NULL 49252.88 77 +NULL NULL NULL NULL 2001 2 NULL NULL 78346.18 63 +NULL NULL NULL NULL 2001 2 6 NULL 34840.48 96 +NULL NULL NULL NULL 2001 3 NULL NULL 141691.87 12 +NULL NULL NULL NULL 2001 3 7 NULL 31988.52 100 +NULL NULL NULL NULL 2001 3 8 NULL 57778.28 69 +NULL NULL NULL NULL 2001 3 9 NULL 51925.07 73 +NULL NULL NULL NULL 2001 4 NULL NULL 349674.00 7 +NULL NULL NULL NULL 2001 4 10 NULL 89521.66 52 +NULL NULL NULL NULL 2001 4 11 NULL 107989.95 35 +NULL NULL NULL NULL 2001 4 11 AAAAAAAAHAAAAAAA 38673.65 85 +NULL NULL NULL NULL 2001 4 12 NULL 152162.39 11 +NULL NULL NULL NULL 2001 4 12 AAAAAAAACAAAAAAA 36936.71 88 +NULL NULL NULL NULL 2001 4 12 AAAAAAAAKAAAAAAA 35885.68 92 +NULL NULL NULL ationesebareing NULL NULL NULL NULL 130971.51 13 +NULL NULL NULL ationesebareing 2001 NULL NULL NULL 130971.51 13 +NULL NULL NULL ationesebareing 2001 3 NULL NULL 49334.88 76 +NULL NULL NULL ationesebareing 2001 4 NULL NULL 36033.41 91 +NULL NULL NULL n stcallyn stn st NULL NULL NULL NULL 110926.60 33 +NULL NULL NULL n stcallyn stn st 2001 NULL NULL NULL 110926.60 33 +NULL NULL NULL n stcallyn stn st 2001 3 NULL NULL 33118.05 98 +NULL NULL NULL n stcallyn stn st 2001 4 NULL NULL 41603.21 83 +NULL NULL NULL n stought NULL NULL NULL NULL 157465.43 9 +NULL NULL NULL n stought 2001 NULL NULL NULL 157465.43 9 +NULL NULL NULL n stought 2001 3 NULL NULL 46371.14 78 +NULL NULL NULL n stought 2001 4 NULL NULL 65619.67 66 +NULL NULL NULL n stought 2001 4 11 NULL 45528.69 79 +NULL NULL NULL oughtableantiable NULL NULL NULL NULL 103187.19 40 +NULL NULL NULL oughtableantiable 2001 NULL NULL NULL 103187.19 40 +NULL NULL NULL oughtableantiable 2001 4 NULL NULL 42408.80 82 +NULL NULL NULL oughtablen stationought NULL NULL NULL NULL 86348.22 57 +NULL NULL NULL oughtablen stationought 2001 NULL NULL NULL 86348.22 57 +NULL NULL NULL oughtablen stationought 2001 4 NULL NULL 35714.86 93 +NULL NULL NULL oughtesebaration NULL NULL NULL NULL 76325.38 64 +NULL NULL NULL oughtesebaration 2001 NULL NULL NULL 76325.38 64 +NULL NULL NULL oughtesebaration 2001 4 NULL NULL 36610.75 89 +NULL NULL NULL oughteseoughtation NULL NULL NULL NULL 128623.75 19 +NULL NULL NULL oughteseoughtation 2001 NULL NULL NULL 128623.75 19 +NULL NULL NULL oughteseoughtation 2001 3 NULL NULL 35495.82 94 +NULL NULL NULL oughteseoughtation 2001 4 NULL NULL 57203.17 70 +NULL NULL importoamalg #x NULL NULL NULL NULL NULL 102866.87 42 +NULL NULL importoamalg #x NULL NULL NULL NULL NULL 102866.87 42 +NULL NULL importoamalg #x NULL 2001 NULL NULL NULL 102866.87 42 +NULL NULL importoamalg #x NULL 2001 4 NULL NULL 51717.30 74 +NULL accessories NULL NULL NULL NULL NULL NULL 98994.39 48 +NULL accessories NULL NULL NULL NULL NULL NULL 98994.39 48 +NULL accessories NULL prin stn stoughtought NULL NULL NULL NULL 98994.39 48 +NULL accessories NULL prin stn stoughtought 2001 NULL NULL NULL 98994.39 48 +NULL accessories NULL prin stn stoughtought 2001 3 NULL NULL 37246.83 87 +NULL athletic NULL NULL NULL NULL NULL NULL 122120.16 21 +NULL athletic NULL NULL NULL NULL NULL NULL 122120.16 21 +NULL athletic NULL NULL NULL NULL NULL NULL 122120.16 21 +NULL athletic NULL NULL 2001 NULL NULL NULL 122120.16 21 +NULL athletic NULL NULL 2001 4 NULL NULL 63278.49 67 +NULL athletic NULL NULL 2001 4 11 NULL 38216.51 86 +NULL baseball NULL NULL NULL NULL NULL NULL 105806.96 36 +NULL baseball NULL NULL NULL NULL NULL NULL 105806.96 36 +NULL baseball NULL NULL NULL NULL NULL NULL 105806.96 36 +NULL baseball NULL NULL 2001 NULL NULL NULL 105806.96 36 +NULL baseball NULL NULL 2001 4 NULL NULL 58206.33 68 +NULL country NULL NULL NULL NULL NULL NULL 89164.69 53 +NULL country importoscholar #x NULL NULL NULL NULL NULL 89164.69 53 +NULL country importoscholar #x NULL NULL NULL NULL NULL 89164.69 53 +NULL country importoscholar #x NULL 2001 NULL NULL NULL 89164.69 53 +NULL country importoscholar #x NULL 2001 4 NULL NULL 55674.96 71 +NULL dresses NULL NULL NULL NULL NULL NULL 116126.30 25 +NULL dresses NULL NULL NULL NULL NULL NULL 217647.20 8 +NULL dresses NULL oughteingantieing NULL NULL NULL NULL 116126.30 25 +NULL dresses NULL oughteingantieing 2001 NULL NULL NULL 116126.30 25 +NULL dresses NULL oughteingantieing 2001 3 NULL NULL 35421.52 95 +NULL dresses NULL oughteingantieing 2001 4 NULL NULL 53283.33 72 +NULL dresses amalgamalg #x NULL NULL NULL NULL NULL 101520.90 45 +NULL dresses amalgamalg #x NULL NULL NULL NULL NULL 101520.90 45 +NULL dresses amalgamalg #x NULL 2001 NULL NULL NULL 101520.90 45 +NULL dresses amalgamalg #x NULL 2001 3 NULL NULL 32017.28 99 +NULL dresses amalgamalg #x NULL 2001 4 NULL NULL 34451.25 97 +NULL infants NULL NULL NULL NULL NULL NULL 128750.23 15 +NULL infants importoexporti #x NULL NULL NULL NULL NULL 128750.23 15 +NULL infants importoexporti #x antiationeseese NULL NULL NULL NULL 128750.23 15 +NULL infants importoexporti #x antiationeseese 2001 NULL NULL NULL 128750.23 15 +NULL infants importoexporti #x antiationeseese 2001 3 NULL NULL 40113.56 84 +NULL infants importoexporti #x antiationeseese 2001 4 NULL NULL 50724.87 75 +NULL mens NULL NULL NULL NULL NULL NULL 113853.60 28 +NULL mens importoedu pack #x NULL NULL NULL NULL NULL 113853.60 28 +NULL mens importoedu pack #x oughtablen steseought NULL NULL NULL NULL 113853.60 28 +NULL mens importoedu pack #x oughtablen steseought 2001 NULL NULL NULL 113853.60 28 +NULL mens importoedu pack #x oughtablen steseought 2001 3 NULL NULL 42447.63 81 +NULL mens importoedu pack #x oughtablen steseought 2001 4 NULL NULL 43089.74 80 +NULL shirts NULL NULL NULL NULL NULL NULL 82003.16 59 +NULL shirts NULL NULL NULL NULL NULL NULL 82003.16 59 +NULL shirts NULL oughtcallyeseantiought NULL NULL NULL NULL 82003.16 59 +NULL shirts NULL oughtcallyeseantiought 2001 NULL NULL NULL 82003.16 59 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q70a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q70a.sql.out new file mode 100644 index 0000000000000..067238b4407b6 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q70a.sql.out @@ -0,0 +1,8 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +-435656177.80 NULL NULL 2 1 +-435656177.80 TN NULL 1 1 +-435656177.80 TN Williamson County 0 1 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q72.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q72.sql.out new file mode 100644 index 0000000000000..f4050e94d4c53 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q72.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +Again perfect sons used to put always. Europea Significantly 5305 2 2 2 +Ago new arguments accept previously european parents; fo Selective, 5313 2 2 2 +Difficult, rapid sizes say so; initial banks stress high single sports; prisoners used to think likely firms. Good, current services must take human, precise persons. Signals m Selective, 5322 2 2 2 +Eventually soft issues will see pp.; possible children pay completely future tasks. Only women will not rehearse more old parts; different movements sponsor most. Please political allowance Significantly 5273 2 2 2 +Happy, nuclear obligations should not leave little payments. About able relationships impress thus only original a Significantly 5313 2 2 2 +Healthy, delighted conclusions may offer experienced condi Significantly 5305 2 2 2 +Hitherto certain kinds evade also by a months. Poor points might make even just selective passengers. Old, general qualities could overcome over; recent variables might s Just good amou 5280 2 2 2 +Ideas total sadly. International members contribute perhaps lucky cells. Texts would acknowled Selective, 5280 2 2 2 +Important audiences shall murder. Selective, 5322 2 2 2 +In order suitable conditions used to eat more on a americans. As open rates shall go sometimes big authorities. Tickets respond for example pregnant, good women. Banks could exploit also full, old cr Matches produce 5319 2 2 2 +Little, num Matches produce 5322 2 2 2 +National, l Operations 5318 2 2 2 +Obvious, present cells may not define appointed, military boys. Answers can get little. Over there comparative days become in a police. Particularly divine prop Just good amou 5322 2 2 2 +Outside, useful animals find again also british decisions; now small attitudes shall n Significantly 5322 2 2 2 +Particular, british wa Operations 5313 2 2 2 +Parts will recruit si Selective, 5322 2 2 2 +Rational, given goods would stay just equal materials. Very alternative months might not buy voc Just good amou 5319 2 2 2 +Royal, military notions will not find very very wet acids. Funny actions take western, remaining homes. Great patients will replace simply. Signs can think equivalent reasons. Campaigns Matches produce 5313 2 2 2 +Short companies get that is for a days. Early, special hands might keep to the women. Present blocks co-ordinate so sure results. Seasons lend still recent friends. Dead Just good amou 5273 2 2 2 +Short companies get that is for a days. Early, special hands might keep to the women. Present blocks co-ordinate so sure results. Seasons lend still recent friends. Dead Selective, 5273 2 2 2 +Specialist, identical factors should not answer so main shares. Sales might reduce then free hours. Ethic Just good amou 5306 2 2 2 +Then sp Selective, 5308 2 2 2 +NULL Just good amou 5297 1 1 1 +NULL Matches produce 5282 1 1 1 +NULL Operations 5308 1 1 1 +NULL Selective, 5318 1 1 1 +A bit important Significantly 5284 1 1 1 +A bit liable flowers change also writings. Currently soviet ministers come. Hotels telephone before aggressive, economic eyes. Blue changes improve. Overal Operations 5317 1 1 1 +A bit liable flowers change also writings. Currently soviet ministers come. Hotels telephone before aggressive, economic eyes. Blue changes improve. Overal Selective, 5317 1 1 1 +A little local letters think over like a children; nevertheless particular powers damage now suddenly absent prote Significantly 5317 1 1 1 +Able systems merge from a areas. Most chief efforts must find never for the time being economic directors. Activities sit there. Available polic Selective, 5305 1 1 1 +Able troubles dust into the styles. Independent feet kill wounds. Fundamental months should exploit arms. Massive years read only modern courses; twin forms shall become products. Even h Matches produce 5309 1 1 1 +Able troubles dust into the styles. Independent feet kill wounds. Fundamental months should exploit arms. Massive years read only modern courses; twin forms shall become products. Even h Operations 5309 1 1 1 +Able, active jobs might not play upstairs. Electoral crimes could not worry for the solutions. Wholly capitalist effects would not get Matches produce 5291 1 1 1 +Able, initial men cannot assume then rational, new references; shares could support physical, internati Operations 5304 1 1 1 +Able, reasonable standards make forward. Strategic, Just good amou 5319 1 1 1 +About military programmes identify all in a thousands; able sentences mean also flats. Branches know secrets; right, increased interactions tour a little. High, lov Selective, 5299 1 1 1 +About supreme days tell then for a consequences. Ill items force meals; years may not mean quite social structures. Goals Significantly 5311 1 1 1 +Above, new groups will not like much local bodies. However traditional sessions can walk slowly big, young aspects. Quite close companies ought to take in a rules. Leaders must not like of cou Just good amou 5314 1 1 1 +Above, new groups will not like much local bodies. However traditional sessions can walk slowly big, young aspects. Quite close companies ought to take in a rules. Leaders must not like of cou Matches produce 5314 1 1 1 +Above, new groups will not like much local bodies. However traditional sessions can walk slowly big, young aspects. Quite close companies ought to take in a rules. Leaders must not like of cou Matches produce 5315 1 1 1 +Absolute Matches produce 5322 1 1 1 +Absolutely angry odds put strongly. Telecommunications help only recent, Selective, 5316 1 1 1 +Ac Significantly 5306 1 1 1 +Accessible, likel Matches produce 5301 1 1 1 +Accessible, likel Selective, 5301 1 1 1 +Accessible, old walls profit here. Wars form therefore as effective servants. Secrets could not feel meanwhile regional theories. Perfect, new service Operations 5273 1 1 1 +Accidents can include below other, marginal plans. Comparable, welsh exceptions argue most as usual physical claims. Certain months may smell far from in a cases. Active seconds used to restore t Matches produce 5304 1 1 1 +Accidents fly bet Matches produce 5321 1 1 1 +Accounts rank only high plans. Days sho Just good amou 5302 1 1 1 +Accurately economic workers play clearly. Deliberately other stands recapture social, cultural prices. Full paths used to make twice alw Matches produce 5301 1 1 1 +Actions must not compare so economi Matches produce 5320 1 1 1 +Actions see of course informal phrases. Markedly right men buy honest, additional stations. In order imaginative factors used to move human thanks. Centres shall catch altogether succe Significantly 5289 1 1 1 +Actual arrangements should introduce never in a unions. Ultimately d Just good amou 5273 1 1 1 +Actual, possible sides employ here future hands. Powerful intervals ought to respond new, particular marks. Appointed, spiritual accidents sustain but modern, coming findings. Male, national year Selective, 5304 1 1 1 +Actually subtle subjects mark as tories. Yet possible areas Just good amou 5321 1 1 1 +Actually subtle subjects mark as tories. Yet possible areas Matches produce 5320 1 1 1 +Acutely possible kilometres cannot trim fully justly original visitors. Owners can transport from the connections. Then controversial girls might tell yet more big kinds. More typical houses g Just good amou 5272 1 1 1 +Acutely possible kilometres cannot trim fully justly original visitors. Owners can transport from the connections. Then controversial girls might tell yet more big kinds. More typical houses g Selective, 5318 1 1 1 +Additional companies visit. Grey opportunities may not look numbers. Entire, british models assist also great quarters. Little males show Just good amou 5284 1 1 1 +Additional companies visit. Grey opportunities may not look numbers. Entire, british models assist also great quarters. Little males show Selective, 5284 1 1 1 +Additional figures consult relationships. Sole addresses convict right, Operations 5322 1 1 1 +Advantages emerge moves; special, expected operations pass etc natural preferences; very posit Selective, 5313 1 1 1 +Afterwards defensive standards answer just almost informal officers. Now constant rights shall hear courses. Signs go on a budgets Just good amou 5280 1 1 1 +Afterwards oth Just good amou 5277 1 1 1 +Afterwards oth Selective, 5277 1 1 1 +Afterwards rich options go unlikely, welsh elections. Just gentle authors must not provi Operations 5285 1 1 1 +Afterwards written skills influence; english, level departments like just. Really legal rocks would Just good amou 5300 1 1 1 +Again Just good amou 5319 1 1 1 +Again brief things should remember only in a patients. Deals reply soon other points. Increasingly religious times necessitate farther troops. Both added programmes must come wonderfully solid pupi Matches produce 5308 1 1 1 +Again brief things should remember only in a patients. Deals reply soon other points. Increasingly religious times necessitate farther troops. Both added programmes must come wonderfully solid pupi Operations 5308 1 1 1 +Again brief things should remember only in a patients. Deals reply soon other points. Increasingly religious times necessitate farther troops. Both added programmes must come wonderfully solid pupi Selective, 5308 1 1 1 +Again new teeth heat delicately. Just future officers Just good amou 5319 1 1 1 +Again new teeth heat delicately. Just future officers Operations 5294 1 1 1 +Again new teeth heat delicately. Just future officers Significantly 5294 1 1 1 +Again old police could work in the skills. Points announce agents. Pieces conform slowly to a hea Significantly 5307 1 1 1 +Again scottish women shall ag Significantly 5308 1 1 1 +Agencies will not move criminal issues. Years mean very largel Selective, 5305 1 1 1 +Agents invest often things. French cars ought to get locally distinctive, local powers. More american entries compensate only Operations 5317 1 1 1 +Ago correct profits must not handle else. Healthy children may not go only ancient words. Later just characters ought to drink about. British parts must watch soon ago other clients. So vital d Just good amou 5317 1 1 1 +Ago correct profits must not handle else. Healthy children may not go only ancient words. Later just characters ought to drink about. British parts must watch soon ago other clients. So vital d Operations 5304 1 1 1 +Ago interested doctors meet really fair, cold minds. Fine children understand original procedures. So other services ought to Operations 5303 1 1 1 +Ago interested doctors meet really fair, cold minds. Fine children understand original procedures. So other services ought to Significantly 5303 1 1 1 +Ago new studies shall not apply of course small forces. Dead parts used to point on a students. Then other students should pay only Matches produce 5307 1 1 1 +Ago sexual courts may attract. Important, alone observations expect. New, available ways represent years. Excell Matches produce 5301 1 1 1 +Ahead national cir Matches produce 5320 1 1 1 +All attractive ways develop originally lucky sites. New, single sounds might excuse enough senior savings. Other bacteria live across a concerns. Dark minutes s Significantly 5316 1 1 1 +All capital bacteria make jobs. Again appropriate eyes may not leave others. There fixed ways Just good amou 5285 1 1 1 +All difficult emotions supervise. Mere Just good amou 5322 1 1 1 +All environmental lips cannot catch; social, broad authorities add for no customers. Interes Just good amou 5318 1 1 1 +All following systems develop home different words. Old minutes will come never independent, real duties. Policies used to distinguish all rats. E Matches produce 5311 1 1 1 +All full things will not administer quickly difficult women. Ready, new arrangements ma Just good amou 5284 1 1 1 +All full things will not administer quickly difficult women. Ready, new arrangements ma Significantly 5284 1 1 1 +All real fam Operations 5318 1 1 1 +All real fam Selective, 5318 1 1 1 +All right other details might distrib Selective, 5277 1 1 1 +Almost busy threats go together recent sides; still tired wines shall not admit on a Significantly 5300 1 1 1 +Alone arms happen again real documents. Paintings might not invite steps. Internal pairs may increase only rural rooms. Men must not deal here long, heavy patients; merely e Matches produce 5310 1 1 1 +Already early meetings cannot go animals. As comprehensive evenings w Just good amou 5320 1 1 1 +Already professional senses encourage broad theories. Nearly eastern eyes would describe correct, complex proposals. Friends change crimin Selective, 5291 1 1 1 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q74.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q74.sql.out new file mode 100644 index 0000000000000..ac13c0dabf0c7 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q74.sql.out @@ -0,0 +1,94 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAHEIFBAAA NULL Jones +AAAAAAAAGLDMAAAA Alex Norris +AAAAAAAAOEDIAAAA Alexander Rich +AAAAAAAAKNMEBAAA Amber Gonzalez +AAAAAAAAFGNEAAAA Andrew Silva +AAAAAAAACGLDAAAA Angelo Sloan +AAAAAAAAOCDCAAAA Armando Jackson +AAAAAAAABJEDBAAA Arthur Bryan +AAAAAAAAHGKLAAAA Arthur Christensen +AAAAAAAAPAEEBAAA Audria Mattson +AAAAAAAAFAIEAAAA Betty Gipson +AAAAAAAAOCFLAAAA Bill Freeman +AAAAAAAAILLJAAAA Billy Ortiz +AAAAAAAAGMFHAAAA Bruce Howe +AAAAAAAAKAKPAAAA Carolann Royer +AAAAAAAAAGLPAAAA Charlene Marcus +AAAAAAAABIIHAAAA Charles Quarles +AAAAAAAAIPKJAAAA Charles Jones +AAAAAAAAPIGBBAAA Charles Welch +AAAAAAAACPDFBAAA Cheryl Barry +AAAAAAAACOEHBAAA Christine Gonzalez +AAAAAAAAPNMGAAAA Christine Olds +AAAAAAAAEFCEBAAA Cornelius Martino +AAAAAAAAPEFLAAAA David Martinez +AAAAAAAAIBJDBAAA Dean Velez +AAAAAAAAOOKKAAAA Deborah Early +AAAAAAAALMGGBAAA Dedra Rainey +AAAAAAAANKBBAAAA Diann Saunders +AAAAAAAADKMBAAAA Donald Nelson +AAAAAAAAFGMHBAAA Donald Coleman +AAAAAAAALPHGBAAA Dorothy Heller +AAAAAAAALEAHBAAA Eddie Pena +AAAAAAAAJINGAAAA Ella Moore +AAAAAAAAIANDAAAA Elva Wade +AAAAAAAAEBFHAAAA Esther Merrill +AAAAAAAAAAECBAAA Frank Wenzel +AAAAAAAAJGDLAAAA Fredrick Davis +AAAAAAAAHLEAAAAA Geneva Sims +AAAAAAAAFMOKAAAA Harry Brown +AAAAAAAAEIAHAAAA Henry Desantis +AAAAAAAALMAJAAAA Ileen Linn +AAAAAAAACEMIAAAA James Hernandez +AAAAAAAAIBBFBAAA James Compton +AAAAAAAALNLABAAA Janie Garcia +AAAAAAAABBEAAAAA Jason Gallegos +AAAAAAAAIODCBAAA Jennifer Crane +AAAAAAAAGEKLAAAA Jerilyn Walker +AAAAAAAAMFMKAAAA John Sanders +AAAAAAAAJCNBBAAA Johnnie Cox +AAAAAAAAOJBPAAAA Jonathan Mcbride +AAAAAAAAABGKAAAA Jonna King +AAAAAAAAGGMHAAAA Julia Fisher +AAAAAAAAHEPFBAAA Kathryn Kinney +AAAAAAAAOMOKAAAA Laurette Gary +AAAAAAAABIABAAAA Letha Stone +AAAAAAAAPFKDAAAA Linda Simmons +AAAAAAAAJDEFAAAA Loretta Serrano +AAAAAAAAFOEDAAAA Lori Erwin +AAAAAAAABAAGAAAA Luis James +AAAAAAAAEIPIAAAA Luke Rios +AAAAAAAAGCGIAAAA Mae Williams +AAAAAAAAFMPPAAAA Manuel Bryant +AAAAAAAAMJFAAAAA Marcus Espinal +AAAAAAAAJADIAAAA Margaret Roberts +AAAAAAAAHLJCAAAA Marlene Grover +AAAAAAAABGMHBAAA Michael Gillespie +AAAAAAAAIPGJAAAA Michael NULL +AAAAAAAANBECBAAA Michael Lombardi +AAAAAAAAMLOEAAAA Miguel Jackson +AAAAAAAAJHGFAAAA Pamela Gannon +AAAAAAAADFJBBAAA Patrick Jones +AAAAAAAADHNHBAAA Patrick Cooper +AAAAAAAAOPMDAAAA Peggy Smith +AAAAAAAAAFAGAAAA Robert Chang +AAAAAAAAAFBNAAAA Robert Baines +AAAAAAAAKMHPAAAA Robert Jones +AAAAAAAAJMIDAAAA Sally Thurman +AAAAAAAAJBELAAAA Sean Busby +AAAAAAAAJIAHAAAA Shawna Delgado +AAAAAAAAFDIMAAAA Stephanie Cowan +AAAAAAAAPBIGBAAA Susie Zavala +AAAAAAAAGMGEBAAA Tamika Potts +AAAAAAAAMHOLAAAA Terri Cook +AAAAAAAABILCAAAA Theresa Mullins +AAAAAAAADHCBAAAA Therese Perez +AAAAAAAAIBHHBAAA Vennie Loya +AAAAAAAAFHNDAAAA Virgil Mcdonald +AAAAAAAAAHKEAAAA William Stafford +AAAAAAAAHIEIAAAA William Roberts diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q75.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q75.sql.out new file mode 100644 index 0000000000000..ca273a867c15b --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q75.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +2001 2002 7009003 16 9 545 6720 3891 -2829 -117008.58 +2001 2002 8005007 5 9 512 6454 4227 -2227 -135735.94 +2001 2002 9001010 1 9 456 5643 3436 -2207 -93617.05 +2001 2002 10013015 3 9 127 6225 4143 -2082 -14567.99 +2001 2002 9015004 10 9 118 7332 5259 -2073 -77291.51 +2001 2002 9004002 4 9 435 6625 4581 -2044 -122670.86 +2001 2002 9014004 3 9 306 5855 3858 -1997 -73620.65 +2001 2002 5002001 5 9 170 5700 3736 -1964 -109018.53 +2001 2002 9014010 1 9 987 6970 5148 -1822 -75086.23 +2001 2002 9015008 15 9 327 6526 4739 -1787 -93540.56 +2001 2002 9016002 16 9 197 6053 4343 -1710 -97667.31 +2001 2002 9015002 15 9 856 10449 8783 -1666 -20233.37 +2001 2002 3001001 1 9 380 6554 4895 -1659 -71747.73 +2001 2002 5002001 14 9 75 6649 5024 -1625 -114258.52 +2001 2002 9004008 4 9 787 6493 4911 -1582 -133842.63 +2001 2002 3001001 4 9 652 6331 4766 -1565 -74417.45 +2001 2002 5004001 11 9 963 6179 4628 -1551 -85648.92 +2001 2002 3004001 7 9 237 6097 4560 -1537 -118933.63 +2001 2002 1001001 8 9 271 5623 4128 -1495 -50180.45 +2001 2002 10004009 4 9 513 6500 5024 -1476 -67288.17 +2001 2002 4004001 10 9 126 5667 4194 -1473 -88247.10 +2001 2002 9007002 7 9 144 5474 4020 -1454 -42908.70 +2001 2002 9016008 16 9 53 6099 4671 -1428 -67851.70 +2001 2002 9007008 7 9 110 5655 4230 -1425 -28768.95 +2001 2002 9002008 2 9 97 5979 4581 -1398 -101148.97 +2001 2002 9008004 8 9 171 5952 4559 -1393 -41622.99 +2001 2002 10010001 10 9 368 5714 4353 -1361 -78871.35 +2001 2002 3003001 8 9 266 5785 4431 -1354 -99666.06 +2001 2002 9011002 11 9 581 6045 4721 -1324 -61169.99 +2001 2002 9012004 12 9 233 5370 4050 -1320 -135207.43 +2001 2002 9008008 8 9 84 5431 4114 -1317 -48625.72 +2001 2002 9010010 7 9 962 6123 4819 -1304 -34943.08 +2001 2002 9009008 9 9 135 5984 4698 -1286 -53184.41 +2001 2002 9014008 14 9 52 5835 4555 -1280 -47886.49 +2001 2002 9005008 5 9 326 5773 4494 -1279 -47219.15 +2001 2002 9011002 11 9 806 5487 4208 -1279 -34285.63 +2001 2002 1003001 3 9 57 5893 4631 -1262 -24156.11 +2001 2002 5003001 3 9 456 5617 4359 -1258 -46563.26 +2001 2002 9015008 15 9 829 4998 3781 -1217 15209.89 +2001 2002 7007001 7 9 211 6277 5071 -1206 -74262.01 +2001 2002 9011008 11 9 541 5654 4449 -1205 -50137.27 +2001 2002 6010001 4 9 91 6373 5169 -1204 -40582.11 +2001 2002 4003001 3 9 175 6106 4907 -1199 -84819.82 +2001 2002 9009008 9 9 83 5880 4689 -1191 -54463.08 +2001 2002 9014010 14 9 201 6106 4919 -1187 -5741.72 +2001 2002 9012010 16 9 173 6576 5390 -1186 -57504.67 +2001 2002 9014002 14 9 966 6066 4915 -1151 -31274.42 +2001 2002 9003004 2 9 29 5232 4084 -1148 -85408.38 +2001 2002 9008002 8 9 586 6212 5079 -1133 -45166.64 +2001 2002 9004010 4 9 87 5551 4428 -1123 -104064.28 +2001 2002 9013002 13 9 18 5087 3977 -1110 34375.04 +2001 2002 9001008 1 9 65 5429 4333 -1096 -112773.38 +2001 2002 8007003 4 9 290 6148 5075 -1073 -48541.94 +2001 2002 9004002 4 9 506 5503 4432 -1071 -47389.52 +2001 2002 9001009 1 9 73 5116 4053 -1063 -12805.29 +2001 2002 9003008 3 9 156 5719 4665 -1054 -27241.44 +2001 2002 9011008 11 9 324 5293 4253 -1040 -78455.59 +2001 2002 9011008 11 9 525 5269 4243 -1026 -8416.01 +2001 2002 9009004 9 9 599 5642 4622 -1020 -7244.59 +2001 2002 9004010 4 9 146 5387 4373 -1014 -96437.31 +2001 2002 9002010 2 9 64 4911 3898 -1013 -70357.40 +2001 2002 2003001 3 9 4 6089 5078 -1011 -14326.99 +2001 2002 9008002 8 9 433 5707 4697 -1010 -59856.93 +2001 2002 9015002 15 9 120 5419 4409 -1010 -25557.35 +2001 2002 9008010 3 9 64 6024 5020 -1004 15466.29 +2001 2002 1003001 5 9 139 6059 5060 -999 -23720.17 +2001 2002 9003002 3 9 281 5640 4651 -989 -62224.16 +2001 2002 9013008 13 9 660 5400 4411 -989 -6728.84 +2001 2002 9013002 13 9 30 4967 3997 -970 -74733.18 +2001 2002 6014001 14 9 977 5339 4369 -970 -34999.44 +2001 2002 8012009 12 9 149 5872 4905 -967 -25425.45 +2001 2002 9004009 4 9 618 5522 4576 -946 -59306.75 +2001 2002 7006009 8 9 116 5471 4528 -943 -65664.87 +2001 2002 9014010 15 9 151 5633 4701 -932 7429.42 +2001 2002 9003002 3 9 877 6303 5379 -924 -45324.79 +2001 2002 9006008 6 9 162 5169 4251 -918 -69642.81 +2001 2002 9008010 8 9 503 5526 4608 -918 -49021.02 +2001 2002 9005002 5 9 530 4962 4049 -913 -51406.91 +2001 2002 9010002 10 9 236 5107 4195 -912 -68196.83 +2001 2002 9015004 15 9 134 4996 4092 -904 -20839.46 +2001 2002 9009009 6 9 181 5283 4380 -903 -50577.89 +2001 2002 9009010 16 9 590 4684 3787 -897 -42032.78 +2001 2002 9006008 6 9 221 5238 4347 -891 -110703.28 +2001 2002 10009017 9 9 640 5562 4682 -880 -91021.88 +2001 2002 7013003 13 9 313 5161 4284 -877 -55538.42 +2001 2002 3004001 12 9 570 5053 4181 -872 -81469.82 +2001 2002 9009004 9 9 587 5131 4262 -869 -31202.41 +2001 2002 9010008 10 9 86 5074 4211 -863 -31897.54 +2001 2002 9006002 6 9 230 5616 4756 -860 -39142.42 +2001 2002 9001008 1 9 533 6196 5337 -859 -70174.46 +2001 2002 9004010 4 9 102 6146 5291 -855 -66567.87 +2001 2002 9002004 2 9 179 5203 4351 -852 -26624.64 +2001 2002 9016008 16 9 69 5922 5072 -850 -31016.10 +2001 2002 9008010 8 9 81 5520 4672 -848 -44217.60 +2001 2002 9001002 1 9 927 5858 5013 -845 8179.45 +2001 2002 1001001 1 9 116 5773 4930 -843 700.02 +2001 2002 9012008 12 9 274 6154 5316 -838 -85490.33 +2001 2002 6008007 8 9 22 5439 4605 -834 -25617.83 +2001 2002 9016008 16 9 601 6463 5633 -830 22715.94 +2001 2002 9001008 1 9 170 5970 5142 -828 -2265.18 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q77a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q77a.sql.out new file mode 100644 index 0000000000000..1f822ce67889f --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q77a.sql.out @@ -0,0 +1,49 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL 239062306.14 9940693.53 -67351905.74 +catalog channel NULL 81456313.49 6721169.80 -11963308.94 +catalog channel NULL 120443.39 1680292.45 -994006.90 +catalog channel 1 25511213.21 1680292.45 -4013845.35 +catalog channel 2 28320909.41 1680292.45 -3815679.20 +catalog channel 4 27503747.48 1680292.45 -3139777.49 +store channel NULL 114950675.73 2650053.56 -51250807.34 +store channel 1 19900057.08 430318.96 -9021290.46 +store channel 2 19357997.15 420826.73 -8260880.77 +store channel 4 18625533.75 413145.75 -8693775.33 +store channel 7 19392254.22 523129.28 -8781756.70 +store channel 8 18443448.06 453191.53 -8177970.58 +store channel 10 19231385.47 409441.31 -8315133.50 +web channel NULL 42655316.92 569470.17 -4137789.46 +web channel 1 1484216.46 22578.30 -145384.36 +web channel 2 1434288.77 8368.29 -74179.21 +web channel 4 1366508.91 23624.40 -200293.36 +web channel 7 1357762.92 40137.83 -123205.40 +web channel 8 1488902.03 21963.58 -135533.22 +web channel 10 1568120.92 11055.99 -148192.16 +web channel 13 1322895.39 16655.94 -110269.99 +web channel 14 1367483.46 8838.41 -184084.28 +web channel 16 1393205.82 26800.78 -87656.13 +web channel 19 1364048.12 13570.75 -121815.95 +web channel 20 1313170.80 14044.48 -194480.66 +web channel 22 1372505.20 19743.54 -82372.11 +web channel 25 1483839.68 17464.70 12637.58 +web channel 26 1351984.72 16290.97 -210017.25 +web channel 28 1515110.49 34693.25 -87241.61 +web channel 31 1472020.01 6383.43 -163741.34 +web channel 32 1371605.44 23901.58 -201414.74 +web channel 34 1550210.89 15290.60 -189498.78 +web channel 37 1292707.71 17894.26 -179114.08 +web channel 38 1271096.72 16767.70 -211804.95 +web channel 40 1529058.38 21329.09 -126745.86 +web channel 43 1489558.57 24760.75 -100645.79 +web channel 44 1506795.25 9375.29 -161279.12 +web channel 46 1311086.33 13347.60 -144246.40 +web channel 49 1492170.04 21268.41 -97796.30 +web channel 50 1486817.09 14070.53 -109583.01 +web channel 52 1564493.01 26771.44 -74766.72 +web channel 55 1330931.73 18908.13 -235881.43 +web channel 56 1448998.86 26396.32 -131860.48 +web channel 58 1353723.20 17173.83 -117322.35 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q78.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q78.sql.out new file mode 100644 index 0000000000000..df28fcb255ae8 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q78.sql.out @@ -0,0 +1,6 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output + diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q80a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q80a.sql.out new file mode 100644 index 0000000000000..2aeebd88f1d79 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q80a.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +NULL NULL 12394002.28 579360.90 -3565544.29 +catalog channel NULL 4336403.99 190045.19 -496576.74 +catalog channel catalog_pageAAAAAAAAAABAAAAA 4438.43 383.01 -4797.32 +catalog channel catalog_pageAAAAAAAAAADAAAAA 1459.86 0.00 -538.24 +catalog channel catalog_pageAAAAAAAAABBAAAAA 6092.40 0.00 -37.09 +catalog channel catalog_pageAAAAAAAAABDAAAAA 878.66 0.00 401.04 +catalog channel catalog_pageAAAAAAAAACBAAAAA 15564.33 0.00 -743.39 +catalog channel catalog_pageAAAAAAAAACDAAAAA 19434.58 0.00 -1241.86 +catalog channel catalog_pageAAAAAAAAADBAAAAA 3357.08 0.00 -223.80 +catalog channel catalog_pageAAAAAAAAADDAAAAA 17773.31 0.00 10583.67 +catalog channel catalog_pageAAAAAAAAAEBAAAAA 11505.75 0.00 1975.14 +catalog channel catalog_pageAAAAAAAAAEDAAAAA 14132.65 0.00 -3283.42 +catalog channel catalog_pageAAAAAAAAAFDAAAAA 8636.84 216.08 -1736.94 +catalog channel catalog_pageAAAAAAAAAGDAAAAA 17045.61 145.32 1162.68 +catalog channel catalog_pageAAAAAAAAAHAAAAAA 19082.44 2556.07 -16790.11 +catalog channel catalog_pageAAAAAAAAAIAAAAAA 7785.09 33.84 -3860.11 +catalog channel catalog_pageAAAAAAAAAJAAAAAA 33875.64 0.00 6085.44 +catalog channel catalog_pageAAAAAAAAAKAAAAAA 4069.90 3395.00 -57.06 +catalog channel catalog_pageAAAAAAAAALAAAAAA 10778.98 0.00 -6320.25 +catalog channel catalog_pageAAAAAAAAAMAAAAAA 23566.51 0.00 1270.50 +catalog channel catalog_pageAAAAAAAAANAAAAAA 11997.42 0.00 -7811.93 +catalog channel catalog_pageAAAAAAAAANCAAAAA 1574.03 0.00 170.61 +catalog channel catalog_pageAAAAAAAAAOAAAAAA 12768.66 0.00 -1180.46 +catalog channel catalog_pageAAAAAAAAAPAAAAAA 15591.17 0.00 617.97 +catalog channel catalog_pageAAAAAAAAAPCAAAAA 0.00 0.00 -2448.27 +catalog channel catalog_pageAAAAAAAABABAAAAA 22630.47 0.00 4803.56 +catalog channel catalog_pageAAAAAAAABADAAAAA 4689.30 0.00 1920.53 +catalog channel catalog_pageAAAAAAAABBBAAAAA 8799.41 1594.88 -1551.23 +catalog channel catalog_pageAAAAAAAABBDAAAAA 2900.27 0.00 -1813.33 +catalog channel catalog_pageAAAAAAAABCBAAAAA 19972.81 189.75 5730.83 +catalog channel catalog_pageAAAAAAAABCDAAAAA 24932.09 2122.08 3205.82 +catalog channel catalog_pageAAAAAAAABDBAAAAA 5321.51 0.00 143.34 +catalog channel catalog_pageAAAAAAAABDDAAAAA 2502.32 0.00 -1101.24 +catalog channel catalog_pageAAAAAAAABHAAAAAA 3734.33 0.00 -3819.22 +catalog channel catalog_pageAAAAAAAABIAAAAAA 37573.12 586.70 5857.09 +catalog channel catalog_pageAAAAAAAABJAAAAAA 12330.42 0.00 -1486.17 +catalog channel catalog_pageAAAAAAAABJCAAAAA 6097.67 0.00 3736.59 +catalog channel catalog_pageAAAAAAAABKAAAAAA 18001.80 41.67 -7542.13 +catalog channel catalog_pageAAAAAAAABLAAAAAA 21210.22 0.00 2386.64 +catalog channel catalog_pageAAAAAAAABMAAAAAA 27450.22 35.95 -6130.18 +catalog channel catalog_pageAAAAAAAABNAAAAAA 24544.71 0.00 -19634.16 +catalog channel catalog_pageAAAAAAAABNCAAAAA 1254.78 23.70 -2121.59 +catalog channel catalog_pageAAAAAAAABOAAAAAA 7397.94 0.00 -2259.68 +catalog channel catalog_pageAAAAAAAABPAAAAAA 23154.42 0.00 744.22 +catalog channel catalog_pageAAAAAAAACABAAAAA 4702.71 0.00 -13312.05 +catalog channel catalog_pageAAAAAAAACADAAAAA 1010.39 0.00 -2765.23 +catalog channel catalog_pageAAAAAAAACBBAAAAA 74.70 0.00 -1114.49 +catalog channel catalog_pageAAAAAAAACBDAAAAA 9217.35 0.00 3327.65 +catalog channel catalog_pageAAAAAAAACCBAAAAA 11097.18 0.00 3019.32 +catalog channel catalog_pageAAAAAAAACCDAAAAA 771.30 0.00 -365.85 +catalog channel catalog_pageAAAAAAAACDBAAAAA 3370.78 61.32 -1489.09 +catalog channel catalog_pageAAAAAAAACEBAAAAA 3646.15 0.00 1089.86 +catalog channel catalog_pageAAAAAAAACEDAAAAA 2402.24 0.00 -1262.38 +catalog channel catalog_pageAAAAAAAACFDAAAAA 2351.04 581.76 -3631.49 +catalog channel catalog_pageAAAAAAAACHAAAAAA 14363.16 72.40 -6022.88 +catalog channel catalog_pageAAAAAAAACIAAAAAA 17233.80 290.61 -1149.33 +catalog channel catalog_pageAAAAAAAACJAAAAAA 17334.55 0.00 -5325.06 +catalog channel catalog_pageAAAAAAAACKAAAAAA 33391.87 0.00 5427.63 +catalog channel catalog_pageAAAAAAAACLAAAAAA 29852.16 55.65 -4206.17 +catalog channel catalog_pageAAAAAAAACMAAAAAA 13596.19 0.00 1289.63 +catalog channel catalog_pageAAAAAAAACNAAAAAA 12652.74 2776.86 -10512.27 +catalog channel catalog_pageAAAAAAAACOAAAAAA 15417.46 0.00 8.02 +catalog channel catalog_pageAAAAAAAACPAAAAAA 6001.13 0.00 -948.15 +catalog channel catalog_pageAAAAAAAACPCAAAAA 6110.72 0.00 -34.56 +catalog channel catalog_pageAAAAAAAADABAAAAA 0.00 0.00 -674.57 +catalog channel catalog_pageAAAAAAAADADAAAAA 13815.26 0.00 4963.37 +catalog channel catalog_pageAAAAAAAADBBAAAAA 4417.61 0.00 1955.36 +catalog channel catalog_pageAAAAAAAADBDAAAAA 9645.90 0.00 2941.05 +catalog channel catalog_pageAAAAAAAADCBAAAAA 4124.08 0.00 -7880.15 +catalog channel catalog_pageAAAAAAAADCDAAAAA 20198.02 0.00 -3874.19 +catalog channel catalog_pageAAAAAAAADDBAAAAA 7697.49 875.52 3573.72 +catalog channel catalog_pageAAAAAAAADDDAAAAA 81.18 0.00 -40.95 +catalog channel catalog_pageAAAAAAAADEBAAAAA 7221.62 0.00 -2080.43 +catalog channel catalog_pageAAAAAAAADEDAAAAA 31633.70 0.00 1203.47 +catalog channel catalog_pageAAAAAAAADFDAAAAA 4486.06 0.00 -194.53 +catalog channel catalog_pageAAAAAAAADHAAAAAA 29478.34 0.00 2568.57 +catalog channel catalog_pageAAAAAAAADIAAAAAA 3541.34 0.00 -5860.49 +catalog channel catalog_pageAAAAAAAADJAAAAAA 27011.83 995.61 -13747.67 +catalog channel catalog_pageAAAAAAAADKAAAAAA 22422.65 0.00 10022.26 +catalog channel catalog_pageAAAAAAAADLAAAAAA 25580.22 1878.40 3693.93 +catalog channel catalog_pageAAAAAAAADMAAAAAA 14964.93 0.00 -3775.51 +catalog channel catalog_pageAAAAAAAADNAAAAAA 7954.26 7.41 -11362.44 +catalog channel catalog_pageAAAAAAAADOAAAAAA 20282.62 389.76 20.54 +catalog channel catalog_pageAAAAAAAADOCAAAAA 2056.15 1394.00 -96.79 +catalog channel catalog_pageAAAAAAAADPAAAAAA 2325.25 0.00 -3003.94 +catalog channel catalog_pageAAAAAAAADPCAAAAA 5.79 0.00 0.11 +catalog channel catalog_pageAAAAAAAAEABAAAAA 5870.11 0.00 -2224.89 +catalog channel catalog_pageAAAAAAAAEADAAAAA 15887.40 294.38 1553.93 +catalog channel catalog_pageAAAAAAAAEBBAAAAA 750.60 48.60 -1121.83 +catalog channel catalog_pageAAAAAAAAEBDAAAAA 2076.12 1787.04 -7886.05 +catalog channel catalog_pageAAAAAAAAECBAAAAA 18310.64 2076.12 1185.01 +catalog channel catalog_pageAAAAAAAAECDAAAAA 6384.54 0.00 -2290.17 +catalog channel catalog_pageAAAAAAAAEDBAAAAA 6470.98 0.00 3092.44 +catalog channel catalog_pageAAAAAAAAEDDAAAAA 7165.64 0.00 -169.94 +catalog channel catalog_pageAAAAAAAAEEBAAAAA 8572.26 697.82 -1507.83 +catalog channel catalog_pageAAAAAAAAEEDAAAAA 9693.59 811.58 -7987.68 +catalog channel catalog_pageAAAAAAAAEFDAAAAA 5850.24 0.00 2898.90 +catalog channel catalog_pageAAAAAAAAEHAAAAAA 18074.80 2563.92 -2315.60 +catalog channel catalog_pageAAAAAAAAEIAAAAAA 1842.65 0.00 -4113.10 +catalog channel catalog_pageAAAAAAAAEJAAAAAA 31976.85 194.76 4337.39 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q86a.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q86a.sql.out new file mode 100644 index 0000000000000..76865be96e9de --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q86a.sql.out @@ -0,0 +1,105 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +329332948.59 NULL NULL 2 1 +35765359.17 Books NULL 1 1 +34301963.73 Men NULL 1 2 +34299263.29 Home NULL 1 3 +34185638.04 Children NULL 1 4 +33632557.65 Electronics NULL 1 5 +32679955.12 Music NULL 1 6 +31276464.49 Women NULL 1 7 +30973438.42 Shoes NULL 1 8 +30893463.64 Jewelry NULL 1 9 +30492050.58 Sports NULL 1 10 +832794.46 NULL NULL 1 11 +487784.65 NULL NULL 0 1 +91077.43 NULL dresses 0 2 +48174.49 NULL athletic 0 3 +45303.17 NULL accessories 0 4 +38544.63 NULL country 0 5 +36691.45 NULL infants 0 6 +33102.66 NULL shirts 0 7 +31974.19 NULL baseball 0 8 +20141.79 NULL mens 0 9 +2788922.44 Books history 0 1 +2627303.83 Books fiction 0 2 +2559899.95 Books business 0 3 +2523972.68 Books sports 0 4 +2478882.85 Books parenting 0 5 +2454802.70 Books home repair 0 6 +2311733.05 Books science 0 7 +2267995.48 Books reference 0 8 +2199284.41 Books travel 0 9 +2143489.54 Books self-help 0 10 +2136284.47 Books romance 0 11 +2047067.66 Books computers 0 12 +2024086.51 Books mystery 0 13 +1841858.53 Books cooking 0 14 +1718405.56 Books arts 0 15 +1641369.51 Books entertainments 0 16 +9726340.87 Children school-uniforms 0 1 +8423026.60 Children infants 0 2 +8110705.74 Children toddlers 0 3 +7857828.46 Children newborn 0 4 +67736.37 Children NULL 0 5 +2545288.50 Electronics televisions 0 1 +2432288.94 Electronics memory 0 2 +2393855.24 Electronics stereo 0 3 +2322478.19 Electronics karoke 0 4 +2312404.32 Electronics audio 0 5 +2297793.09 Electronics automotive 0 6 +2175340.77 Electronics camcorders 0 7 +2155848.29 Electronics dvd/vcr players 0 8 +2151409.30 Electronics portable 0 9 +2126590.68 Electronics monitors 0 10 +2049010.73 Electronics personal 0 11 +1975162.86 Electronics disk drives 0 12 +1824298.91 Electronics wireless 0 13 +1747334.28 Electronics musical 0 14 +1647065.60 Electronics scanners 0 15 +1476387.95 Electronics cameras 0 16 +2878895.80 Home rugs 0 1 +2433373.20 Home wallpaper 0 2 +2394255.96 Home bedding 0 3 +2360342.61 Home mattresses 0 4 +2349809.40 Home paint 0 5 +2342593.19 Home tables 0 6 +2255327.66 Home accent 0 7 +2238644.85 Home lighting 0 8 +2195356.00 Home glassware 0 9 +2001058.99 Home curtains/drapes 0 10 +1995854.06 Home bathroom 0 11 +1932033.64 Home decor 0 12 +1789688.36 Home flatware 0 13 +1767061.55 Home blinds/shades 0 14 +1730423.41 Home kids 0 15 +1585801.82 Home furniture 0 16 +48742.79 Home NULL 0 17 +2309049.65 Jewelry loose stones 0 1 +2291438.75 Jewelry bracelets 0 2 +2204443.86 Jewelry custom 0 3 +1975110.14 Jewelry mens watch 0 4 +1964522.90 Jewelry diamonds 0 5 +1950628.31 Jewelry estate 0 6 +1950233.65 Jewelry womens watch 0 7 +1948966.11 Jewelry birdal 0 8 +1934844.79 Jewelry rings 0 9 +1920939.20 Jewelry gold 0 10 +1912539.77 Jewelry semi-precious 0 11 +1816107.81 Jewelry consignment 0 12 +1793972.84 Jewelry earings 0 13 +1783332.27 Jewelry pendants 0 14 +1720324.59 Jewelry costume 0 15 +1417009.00 Jewelry jewelry boxes 0 16 +8970878.34 Men sports-apparel 0 1 +8843683.02 Men pants 0 2 +8340416.89 Men accessories 0 3 +8054511.00 Men shirts 0 4 +92474.48 Men NULL 0 5 +8987804.92 Music rock 0 1 +8141376.53 Music country 0 2 +7793743.27 Music classical 0 3 +7727726.97 Music pop 0 4 diff --git a/sql/core/src/test/resources/tpcds-query-results/v2_7/q98.sql.out b/sql/core/src/test/resources/tpcds-query-results/v2_7/q98.sql.out new file mode 100644 index 0000000000000..efd1a7af3b008 --- /dev/null +++ b/sql/core/src/test/resources/tpcds-query-results/v2_7/q98.sql.out @@ -0,0 +1,2534 @@ +-- Automatically generated by TPCDSQueryTestSuite + +-- !query schema +struct +-- !query output +AAAAAAAAMJJBAAAA NULL Books NULL NULL 557.55 2.41577919115267179 +AAAAAAAAMLGDAAAA NULL Books NULL 6.35 361.02 1.56424464817493959 +AAAAAAAAAELBAAAA Precisely elderly bodies Books arts 1.40 4303.08 1.75015577438987686 +AAAAAAAAAHMAAAAA Abilities could affect cruel parts. Predominantly other events telephone strong signs. Accurate mate Books arts 25.69 9236.96 3.75687156218529913 +AAAAAAAAAIDDAAAA Germa Books arts 5.82 3191.92 1.29822295179047002 +AAAAAAAAALNCAAAA Great, contemporary workers would not remove of course cultural values. Then due children might see positive seconds. Significant problems w Books arts 0.55 2096.07 0.85251703756969175 +AAAAAAAAANKAAAAA Small objects stop etc mediterranean patterns; liberal, free initiatives would not leave less clear british attitudes; good, blue relationships find softly very Books arts 58.41 5760.88 2.34307458786895754 +AAAAAAAABGDAAAAA Newly national rights head curiously all electrical cells. Chinese, long values might not pull bad lines. High fun clothes ough Books arts 3.28 571.10 0.23227873122369528 +AAAAAAAABKLDAAAA Forward psychological plants establish closely yet eastern changes. Likewise necessary techniques might drop. Pleasant operations like lonely things; dogs let regions. Forces might not result clearl Books arts 2.43 3457.82 1.40637023708618106 +AAAAAAAACMFDAAAA Early, short v Books arts 75.57 850.08 0.34574593563060564 +AAAAAAAADLLDAAAA Black, following services justify by a investors; dirty, different charts will fly however prizes. Temporary, l Books arts 5.56 4798.20 1.95153179505784395 +AAAAAAAAEIPCAAAA Scientific, difficult polls would not achieve. Countries reach of course. Bad, new churches realize most english Books arts 3.98 17.50 0.00711762878027433 +AAAAAAAAFCIBAAAA United, important objectives put similarly large, previous phenomena; old, present days receive. Happy detectives assi Books arts 1.26 11646.43 4.73685516316858938 +AAAAAAAAFFIBAAAA Naturally new years put serious, negative vehicles. Fin Books arts 3.34 20302.86 8.25761260902173683 +AAAAAAAAFJGCAAAA Ago correct profits must not handle else. Healthy children may not go only ancient words. Later just characters ought to drink about. British parts must watch soon ago other clients. So vital d Books arts 4.03 9410.73 3.82754758236520025 +AAAAAAAAFLNCAAAA Much new waters Books arts 1.85 2864.61 1.16509889030066491 +AAAAAAAAGLEBAAAA Tall, following actions keep widely willing, secondary groups. Heads could afford however; agricultural, square pri Books arts 9.99 1903.68 0.77426786036757875 +AAAAAAAAGMFAAAAA Anonymous, useful women provoke slightly present persons. Ideas ought to cost almost competent, working parties; aspects provide thr Books arts 6.73 7841.73 3.18940132200803357 +AAAAAAAAHHEBAAAA Powerful walls will find; there scottish decades must not Books arts 4.16 5934.47 2.41367739815283298 +AAAAAAAAHMCEAAAA Too executive doors progress mainly seemingly possible parts; hundreds stay virtually simple workers. Sola Books arts 34.32 10139.18 4.12382396436467639 +AAAAAAAAIBOCAAAA Careful privileges ought to live rather to a boards. Possible, broad p Books arts 3.93 10008.95 4.07085660459009779 +AAAAAAAAICMBAAAA Aside legitimate decisions may not stand probably sexual g Books arts 3.88 874.84 0.35581636355058234 +AAAAAAAAIFPBAAAA Specially interesting crews continue current, foreign directions; only social men would not call at least political children; circumstances could not understand now in a assessme Books arts 2.13 15380.51 6.25558632178840388 +AAAAAAAAIHNAAAAA Unlikely states take later in general extra inf Books arts 0.32 6478.12 2.63479162023261224 +AAAAAAAAINFDAAAA Sometimes careful things state probably so Books arts 5.08 17118.92 6.96263529595507190 +AAAAAAAAJGHDAAAA Circumstances would not use. Principles seem writers. Times go from a hands. Members find grounds. Central, only teachers pursue properly into a p Books arts 5.95 7863.28 3.19816617344888566 +AAAAAAAAJLHBAAAA Inches may lose from a problems. Firm, other corporations shall protect ashamed, important practices. Materials shall not make then by a police. Weeks used Books arts 0.84 6519.57 2.65165023240074772 +AAAAAAAAKFGBAAAA Systems cannot await regions. Home appropr Books arts 7.30 889.75 0.36188058327137607 +AAAAAAAAKHJDAAAA Relevant lips take so sure, manufacturing Books arts 8.80 932.33 0.37919879089789497 +AAAAAAAAKHLBAAAA Extra, primitive weeks look obviou Books arts 1.18 10006.38 4.06981132996350893 +AAAAAAAALCFBAAAA More than key reasons should remain. Words used to offer slowly british Books arts 0.28 1075.86 0.43757554854548205 +AAAAAAAALGEEAAAA Children may turn also above, historical aspects. Surveys migh Books arts 7.22 3864.60 1.57181646767132336 +AAAAAAAALOKCAAAA Trustees know operations. Now past issues cut today german governments. British lines go critical, individual structures. Tonight adequate problems should no Books arts 4.05 3061.36 1.24512137387317768 +AAAAAAAAMACDAAAA Useful observers start often white colleagues; simple pro Books arts 3.47 724.40 0.29462915933889837 +AAAAAAAAMNPAAAAA Members should say earnings. Detailed departments would not move just at the hopes. Figures can take. Actually open houses want. Good teachers combine the Books arts 3.09 7805.88 3.17482035104958588 +AAAAAAAAMPFCAAAA Major, senior words afford economic libraries; successful seconds need outside. Clinical, new ideas put now red c Books arts 5.87 616.62 0.25079270048530027 +AAAAAAAANABCAAAA Likely states feel astonishingly working roads. Parents put so somewhere able policies. Others may rely shortly instead interesting bodies; bri Books arts 7.50 8829.29 3.59106334933647431 +AAAAAAAANMECAAAA Floors could not go only for a years. Special reasons shape consequently black, concerned instances. Mutual depths encourage both simple teachers. Cards favour massive Books arts 1.83 6344.62 2.58049428068023382 +AAAAAAAAOAHCAAAA Accurate years want then other organisations. Simple lines mean as well so red results. Orthodox, central scales will not in Books arts 7.69 3640.38 1.48062134052200283 +AAAAAAAAODBEAAAA Certain customers think exactly already necessary factories. Awkward doubts shall not forget fine Books arts 0.30 12867.38 5.23344195512721440 +AAAAAAAAOEIDAAAA Weak effects set far in the effects. Positive, true classes sell frankly ever open studies. Unique problems must mean as yet new genes. Essential businesses agree deep current stages. Not Books arts 4.40 4471.87 1.81880632077973420 +AAAAAAAAOKEDAAAA Visitors could not allow glad wages. Communist, real figures used to apply factors. Aggressive, optimistic days must mean about trees. Detailed courts consider really large pro Books arts 9.08 1737.00 0.70647549664780021 +AAAAAAAAOODBAAAA Deep, big areas take for a facilities. Words could replace certainly cases; lights test. Nevertheless practical arts cross. Fa Books arts 7.37 8016.08 3.26031324074179520 +AAAAAAAAPEBCAAAA Similar situations come separate programmes. National, large others could not ask opportunities. Severe, large findings accept; twins go more. Tiny rights may see specifi Books arts 1.27 2413.11 0.98146406776958731 +AAAAAAAABBLDAAAA Natural plans might not like n Books business 4.29 8813.76 2.98246237973343018 +AAAAAAAABINDAAAA Years shall want free objects. Old residents use absolutely so residential steps. Letters will share variables. Sure fres Books business 40.76 1861.77 0.62999888636816844 +AAAAAAAACAADAAAA Whole, important problems make. Indeed industrial members go skills. Soft Books business 3.22 6877.01 2.32709123121693768 +AAAAAAAACCMBAAAA Cheap depths calm as in a traditi Books business 7.92 2554.82 0.86451804190159048 +AAAAAAAACDDCAAAA Simple, great shops glance from a years. Lessons deepen here previous clients. Increased, silent flights open more great rocks. Brill Books business 8.92 8014.35 2.71195237594586375 +AAAAAAAACGCAAAAA Just sudden ideas ought to serve full sources; uncertain, open qualifications shout questions; chronic, informal Books business 4.62 4172.49 1.41191664565564981 +AAAAAAAACGIDAAAA Groups must not put new, civil moves. Correct men laugh slightly total novels. Relatively public girls set even scott Books business 3.36 414.96 0.14041709657333354 +AAAAAAAACNEDAAAA Just young degrees stop posts. More than tight artists buy to a arts. European, essential techniques ought to sell to a offences. Sentences be Books business 2.58 6286.70 2.12733796276165399 +AAAAAAAACPBBAAAA Other, black houses flow. New soldiers put only eastern hours. Applications reserve there methods; sources cry pretty scarcely special workers. Never british opportunities Books business 8.20 3426.05 1.15933100471146462 +AAAAAAAADEDAAAAA Junior, severe restrictions ought to want principles. Sure, Books business 9.77 3899.69 1.31960465427044307 +AAAAAAAAEBPAAAAA Rows could not Books business 1.65 15875.48 5.37205708576254358 +AAAAAAAAEEFDAAAA Remaining subjects handle even only certain ladies; eagerly literary days could not provide. Very different articles cut then. Boys see out of a houses. Governme Books business 9.03 916.17 0.31002007751973922 +AAAAAAAAEGCCAAAA Manufacturing, ready concerns see already then new pupils. Both stable types used to manage otherw Books business 1.18 8723.00 2.95175036969632840 +AAAAAAAAEGKCAAAA Russian windows should see in a weapons. New, considerable branches walk. English regions apply neither alone police; very new years w Books business 2.79 8434.64 2.85417307557668685 +AAAAAAAAEKDAAAAA Long groups used to create more tiny feet; tools used to dare still Books business 57.04 795.66 0.26924105229308502 +AAAAAAAAEPLBAAAA Drugs must compensate dark, modest houses. Small pubs claim naturally accessible relationships. Distinguished Books business 1.66 11559.25 3.91150068335575881 +AAAAAAAAFCGDAAAA Small, capable centres Books business 2.98 19190.81 6.49392187461561344 +AAAAAAAAFDLAAAAA Popular, different parameters might take open, used modules. Prisoners use pretty alternative lovers. Annual, professional others spend once true men. Other, small subsidies seem politically Books business 7.25 1761.61 0.59610603791823330 +AAAAAAAAFEGEAAAA Supreme, free uses handle even in the customers. Other minutes might not make of course social neighbours. So environmental rights come other, able sales Books business 8.08 3500.18 1.18441563785437289 +AAAAAAAAFHFCAAAA Sound, original activities consider quite to a attitudes. In order weak improvements marry available, hard studie Books business 71.27 11431.86 3.86839355512056274 +AAAAAAAAGIJAAAAA Always other hours used to use. Women should jump then. Civil samples take therefore other offices. Concrete, major demands Books business 1.42 2038.40 0.68976819369356825 +AAAAAAAAGLADAAAA Changes ensure different clients. Distinct, alone attacks think directly previous feelings. White children tell so medieval, responsible yea Books business 5.89 5116.38 1.73131681262259552 +AAAAAAAAHDKCAAAA Visual fragments Books business 6.77 2739.02 0.92684893931051673 +AAAAAAAAHDLBAAAA Classic issues will draw as european, engl Books business 75.64 14735.99 4.98646840884344817 +AAAAAAAAHJAAAAAA Again british shareholders see shares. American lives ought to establish horses. Then ideal conservatives might charge even nec Books business 2.44 9396.38 3.17961345165736401 +AAAAAAAAHKACAAAA Critical cases tell anywhere to the circumstances. Dependent, new numbers must not Books business 3.72 726.75 0.24592279963049486 +AAAAAAAAHLKAAAAA Confident, video-tape Books business 3.17 6173.95 2.08918482116091330 +AAAAAAAAIHNDAAAA Of course fundamental children will not deal still including a suppliers. More crucial powers will not keep enough. As good comments used to devote even convenient electric problems. Publi Books business 8.85 2672.80 0.90444094785330122 +AAAAAAAAIMJAAAAA Departments could seek now for a commu Books business 5.93 3205.71 1.08477079876638965 +AAAAAAAAJFBEAAAA Paintings must not know primary, royal stands; similar, available others ough Books business 0.39 12939.97 4.37871847201185356 +AAAAAAAAJJGBAAAA Most present eyes restore fat, central relationships; again considerable habits must face in a discussions. Engineers help at all direct occasions. Curiously del Books business 80.10 6877.89 2.32738901183430931 +AAAAAAAAKBMDAAAA So white countries could secure more angry items. National feet must not defend too by the types; guidelines would not view more so flexible authorities. Critics will handle closely lig Books business 2.50 2135.27 0.72254774869901171 +AAAAAAAAKJHDAAAA Simple changes ought to vote almost sudden techniques. Partial, golden faces mean in a officials; vertically minor Books business 8.73 5996.87 2.02926323965617573 +AAAAAAAAKJOBAAAA Christian lines stand once deep formal aspirations. National, fine islands play together with a patterns. New journals lose etc positive armie Books business 4.89 6106.50 2.06636061361350790 +AAAAAAAAKKDAAAAA Children would not mean in favour of a parts. Heavy, whole others shall mean on Books business 3.13 5521.91 1.86854291917113983 +AAAAAAAAKLCCAAAA Lips will n Books business 8.48 7806.43 2.64159493735051117 +AAAAAAAAKNJCAAAA White fees might combine reports. Tr Books business 2.09 6566.98 2.22218108939451963 +AAAAAAAALAJCAAAA Asleep children invite more. Wealthy forms could expect as. Indeed statistical examinations could la Books business 3.71 11535.83 3.90357565828889099 +AAAAAAAALDHBAAAA Most new weeks go yet members. Also encouraging delegates make publications. Different competitors run resources; somehow common views m Books business 1.07 9334.32 3.15861315039135987 +AAAAAAAALHMBAAAA Local, bloody names Books business 4.40 2927.75 0.99071273012477651 +AAAAAAAALJJCAAAA Large, larg Books business 3.50 5826.76 1.97170021599584758 +AAAAAAAALOMDAAAA Only new systems might join late speeches. Materials could stay on a benefits. Corporate regulations must crawl definitely practical deaths. Windows might soothe despite a organisations. Old Books business 0.67 123.41 0.04176034771571981 +AAAAAAAAMBECAAAA Professional managers form later initial grounds. Conscious, big risks restore. American, full rises say for a systems. Already Books business 5.27 1616.40 0.54696885218126163 +AAAAAAAAMKGDAAAA Memories can earn particularly over quick contexts; alone differences make separate years; irish men mea Books business 4.23 6855.84 2.31992757704675870 +AAAAAAAANJLBAAAA Only, gothic Books business 1.68 7807.37 2.64191302119179451 +AAAAAAAANKCAAAAA Low, large clouds will not visit for example as the notions. Small, unacceptable drugs might not negotiate environmental, happy keys. Books business 3.11 3933.56 1.33106582416859905 +AAAAAAAAOAPAAAAA Silver, critical operations could help howev Books business 5.56 9087.69 3.07515674850230731 +AAAAAAAAOBAEAAAA Terrible, psychiatric bones will destroy also used studies; solely usual windows should not make shares. Advances continue sufficiently. As key days might not use far artists. Offici Books business 5.83 2024.32 0.68500370381562209 +AAAAAAAAOCHCAAAA Too white addresses end by the talks. Hands get only companies. Statements know. Sentences would pay around for a payments; papers wait actually drinks; men would Books business 6.06 5178.86 1.75245923645598158 +AAAAAAAAAGLDAAAA New, big arguments may not win since by a tenant Books computers 1.00 1686.72 0.45326198032962534 +AAAAAAAAALNBAAAA Else substantial problems slip months. Just unique corporations put vast areas. Supporters like far perfect chapters. Now young reports become wrong trials. Available ears shall Books computers 51.46 471.00 0.12656895793922734 +AAAAAAAABEBEAAAA Cheap, desirable members take immediate, estimated debts; months must track typica Books computers 3.26 7226.83 1.94202195818247621 +AAAAAAAABHOAAAAA Expert, scottish terms will ask quiet demands; poor bits attempt northern, dangerous si Books computers 2.66 4463.91 1.19955931429829364 +AAAAAAAACCDBAAAA Gradually serious visitors bear no doubt technical hearts. Critics continue earlier soviet, standard minute Books computers 6.40 3244.45 0.87186126451364360 +AAAAAAAACCPBAAAA Clear, general goods must know never women. Communications meet about. Other rewards spot wide in a skills. Relative, empty drawings facilitate too rooms. Still asian police end speedily comp Books computers 7.64 5385.04 1.44708896233770017 +AAAAAAAACDFEAAAA Wide, essential activities make steadily procedures. Modules Books computers 35.95 7285.54 1.95779873848101557 +AAAAAAAACFMBAAAA At least remaining results shall keep cuts. Clients should meet policies. Glorious, local times could use enough; clever styles will live political parents. Single, gradual contracts will describe ho Books computers 9.51 14393.77 3.86795004186180949 +AAAAAAAACLPDAAAA Environmental, new women pay again fingers. Different, uncomfortable records miss far russian, dependent members. Enough double men will go here immediatel Books computers 89.89 9487.37 2.54948308807619376 +AAAAAAAACOFCAAAA Years learn here. Days make too. Only moving systems avoid old groups; short movements cannot see respectiv Books computers 0.60 1706.66 0.45862033493962150 +AAAAAAAACONDAAAA Magnetic Books computers 57.19 7638.33 2.05260184394042112 +AAAAAAAADAHAAAAA Ga Books computers 5.53 7904.13 2.12402865714688954 +AAAAAAAADDBAAAAA S Books computers 65.78 578.19 0.15537347301673430 +AAAAAAAAEAHCAAAA Simple year Books computers 3.01 5038.44 1.35394925783295241 +AAAAAAAAECEEAAAA Agricultural players shall smoke. So full reasons undertake Books computers 0.70 5739.18 1.54225484506508439 +AAAAAAAAECGEAAAA Then basic years can encourage later traditions. For example christian parts subscribe informal, valuable gr Books computers 2.75 11359.94 3.05268740563088364 +AAAAAAAAECHAAAAA Boxes batt Books computers 0.83 6659.54 1.78957757569979198 +AAAAAAAAEFFAAAAA Blocks extend ev Books computers 9.29 11249.90 3.02311702743208836 +AAAAAAAAEIGCAAAA Separate, dead buildings think possibly english, net policies. Big divisions can use almost Books computers 9.46 3529.22 0.94838577014496795 +AAAAAAAAEJECAAAA Artists make times. Rather ready functions must pre Books computers 5.71 7805.93 2.09763996995021836 +AAAAAAAAFDPCAAAA Limited, capable cities shall try during the bodies. Specially economic services ought to prevent old area Books computers 2.93 6458.26 1.73548882866368225 +AAAAAAAAFGLAAAAA Since other birds shall blame sudden Books computers 6.74 2404.97 0.64627292308939187 +AAAAAAAAFHNAAAAA Legs throw then. Old-fashioned develo Books computers 2.66 12518.22 3.36394492707854445 +AAAAAAAAFJBEAAAA Only careful men define judicial, special lawyers. Now able funds will not put too black, economic terms. Objectives know both points. Teeth pay. Books computers 9.85 911.50 0.24494183686115864 +AAAAAAAAGHEAAAAA Men should not turn shadows. Different, single concessions guarantee only therefore alone products. Books computers 8.38 11864.77 3.18834729318175442 +AAAAAAAAGIFEAAAA Educational, white teachers should not fix. Considerable, other services might not cover today on a forms. Successful genes fall otherwise so Books computers 1.65 7042.80 1.89256869845942737 +AAAAAAAAGKKAAAAA Women note days. Other, efficient qualificati Books computers 7.64 8012.26 2.15308577269247054 +AAAAAAAAHGCEAAAA Present Books computers 2.84 4786.32 1.28619858760866792 +AAAAAAAAHHFDAAAA Multiple, dark feet mean more complex girls; schools may not answer frequently blue assets. Spiritual, dry patients may reply personnel Books computers 2.04 2973.19 0.79896721880112808 +AAAAAAAAIBDEAAAA Private teachers ap Books computers 5.27 8109.35 2.17917617635769258 +AAAAAAAAIDCDAAAA Daily numbers sense interesting players. General advantages would speak here. Shelves shall know with the reductions. Again wrong mothers provide ways; as hot pr Books computers 7.56 13142.36 3.53166626340166409 +AAAAAAAAIECAAAAA Inc, corporate ships slow evident degrees. Chosen, acute prices throw always. Budgets spend points. Commonly large events may mean. Bottles c Books computers 68.38 12405.10 3.33354687926095337 +AAAAAAAAINGCAAAA European, possible problems ought to restore then unfair interests. States would sleep in respect of the questions. Ideal stages affect only pressures. About spanish employees might kno Books computers 3.42 6760.19 1.81662463645686890 +AAAAAAAAIOJBAAAA Upper others narrow deaths. Situations could e Books computers 5.42 10932.74 2.93788855460829783 +AAAAAAAAIOKCAAAA However old hours ma Books computers 8.84 5208.75 1.39971562561772907 +AAAAAAAAJDOCAAAA Indeed other actions should provide after a ideas; exhibitio Books computers 6.95 3949.76 1.06139491997885895 +AAAAAAAAJJFCAAAA Effective females must answer too english projects. Firm, political experiments see in terms of Books computers 0.76 246.87 0.06633986973770075 +AAAAAAAAJPBDAAAA Of course responsible fears tell. Now clear substances might develop at least independent civil tourists. Books computers 4.95 619.44 0.16645833398274943 +AAAAAAAAKDGEAAAA Perfect days find at all. Crimes might develop hopes. Much socialist grants drive current, useful walls. Emissions open naturally. Combinations shall not know. Tragic things shall not receive just Books computers 6.71 8038.78 2.16021233057898500 +AAAAAAAAKEAAAAAA Advantages apply almost on a services; materials defeat today individual ideas. Domestic divisions used to win smoothly irish talks. Subsequent quantities make only, automatic pounds. Flower Books computers 7.87 442.26 0.11884583298981461 +AAAAAAAAKJDBAAAA Close, historic tactics lead ago large, typical stars. Generally significant facilities check leading years; yesterday general years Books computers 3.87 8448.38 2.27028164092273769 +AAAAAAAAKJECAAAA Internal seats used to sell dark words. Universal items show now in the roles. Most wonderf Books computers 2.57 870.24 0.23385428865612144 +AAAAAAAAKKACAAAA Likely, separate attacks prefer seats. Informally equal women could use easy prime, big forces. Long technical women save conditions; fast alone rooms sell. Ne Books computers 3.77 344.40 0.09254851191989362 +AAAAAAAAKOJBAAAA Economic customs should not put unpleasant shops. Colonial, middle goods used to see. Closely explicit legs continue Books computers 3.32 8481.54 2.27919252551990282 +AAAAAAAAKOKBAAAA Human windows take right, variable steps. Years should buy often. Indeed thin figures may beat even up to a cars. Details may tell enough. Impossible, sufficient differences ought to return Books computers 4.47 5466.16 1.46888784528468556 +AAAAAAAAKPNDAAAA Left diff Books computers 0.74 3269.32 0.87854442796151745 +AAAAAAAALBNAAAAA Male levels shall reduce else high, local conditions; further personal agencies control. Successful days wake eve Books computers 6.55 2376.38 0.63859010672531010 +AAAAAAAALEJBAAAA Wide governments conform widely in proportion to a friends. So living rooms wear too clothes; most essential measures should not bring previously pains. Real accounts become also gue Books computers 9.35 11110.42 2.98563541755233586 +AAAAAAAALIHCAAAA Places transform Books computers 3.10 5805.20 1.55999599708875273 +AAAAAAAAMADEAAAA Appropriate effects beg passages. Running contracts must keep only upper sons. Safely available reports intend perhaps w Books computers 5.81 8969.60 2.41034591323077181 +AAAAAAAAMDKBAAAA Friendly, hot computers tax elsewhere units. New, real officials should l Books computers 3.19 2999.57 0.80605615534133364 +AAAAAAAAMELCAAAA Perfect members state democratic schools. Genuine, enormous knees must afford around the implications. Matters will indicate with a months. Still regular machines would not l Books computers 4.07 2110.95 0.56726272136265806 +AAAAAAAAMENDAAAA Kinds relieve really major practices. Then capable reserves could not approve foundations. Pos Books computers 7.23 1522.62 0.40916438797755059 +AAAAAAAANANCAAAA Only increased errors must submit as rich, main Books computers 6.94 8287.27 2.22698753303826016 +AAAAAAAANFHDAAAA Meals ought to test. Round days might need most urban years. Political, english pages must see on a eyes. Only subsequent women may come better methods; difficult, social childr Books computers 7.23 15325.54 4.11833891222069241 +AAAAAAAANHFDAAAA Systems cannot see fairly practitioners. Little ca Books computers 1.73 2428.71 0.65265242852777245 +AAAAAAAANKLDAAAA Past beautiful others might not like more than legislative, small products. Close, wh Books computers 3.02 4174.86 1.12188467036552578 +AAAAAAAAOGDDAAAA Main problems wait properly. Everyday, foreign offenders can worry activities. Social, important shoes will afford okay physical parts. Very Books computers 1.40 939.26 0.25240161238640906 +AAAAAAAAOGMDAAAA Schools offer quickly others. Further main buildings satisfy sadly great, productive figures. Years contribute acti Books computers 4.11 885.92 0.23806787944271822 +AAAAAAAAOKLAAAAA Chief me Books computers 2.62 9675.59 2.60006230094948754 +AAAAAAAAOMDAAAAA Tiny, rare leaders mention old, precious areas; students will improve much multiple stars. Even confident solutions will include clearly single women. Please little rights will not mention harder com Books computers 1.45 3092.13 0.83092923972956056 +AAAAAAAAONDCAAAA Guidelines should investigate so. Usual personnel look now old, modern aspects. Discussions could appear once br Books computers 2.44 9923.72 2.66674076280396839 +AAAAAAAAONHDAAAA Flat pleasant groups would go private, redundant eyes. Main devic Books computers 2.83 2445.21 0.65708637291417851 +AAAAAAAAOPDAAAAA Popular, obvious copies should believe still difficult parts. Forms ought to soften characteristic Books computers 1.05 2156.19 0.57941979069847684 +AAAAAAAAPAKAAAAA Real, domestic facilities turn often guilty symptoms. Winds get naturally intense islands. Products shall not travel a little clear shares; improved children may not apply wrong c Books computers 5.28 1338.00 0.35955258115219995 +AAAAAAAAAADCAAAA Directions would ask yet profits. Forthcoming, specified discussions ought Books cooking 0.58 5750.02 2.05632295473197783 +AAAAAAAAABIBAAAA Then irish champions must look now forward good women. Future, big models sign. Then different o Books cooking 85.81 2279.71 0.81527020830049933 +AAAAAAAAACLDAAAA Black ears see sensibly glad months. Equal members must afford approximately o Books cooking 8.37 10363.44 3.70617485886789408 +AAAAAAAAAEFBAAAA Considerable benefits should govern. Well experienced years provide please in an towns. Exc Books cooking 4.18 0.00 0.00000000000000000 +AAAAAAAAAGHBAAAA Valuable studies should persist so concerned parties. Always polite songs include then from the holes. There conventional areas might not explain theore Books cooking 1.58 1326.45 0.47436523408687831 +AAAAAAAAAIJCAAAA Meanings occur in a things. Also essential features may not satisfy by the potatoes; happy words change childre Books cooking 3.46 1262.55 0.45151330717055917 +AAAAAAAAAJDBAAAA Then dominant goods should combine probably american items. Important artists guess only sill Books cooking 6.67 5569.20 1.99165808110116677 +AAAAAAAACDIBAAAA Libraries shall note still. Children would not concentrate. Local, public modes must mean low children. Outer, good years should vis Books cooking 1.42 2178.99 0.77925070784648269 +AAAAAAAACJJAAAAA Children ought to miss historical effects. Honest girls may not think activities. Woo Books cooking 4.42 348.88 0.12476651428114901 +AAAAAAAACLFEAAAA Single, past rates mark blue, evident discussions. Only literary children ought to publish exactly really recent themes; conscious, ready conditions would adopt advanced, ideal provisions. A Books cooking 4.99 9499.97 3.39738059698316657 +AAAAAAAACPEEAAAA Standards could lead no longer ago great tactics; difficult lives might feel french, easy costs. Students drop certainly unabl Books cooking 3.05 16321.01 5.83672187356046718 +AAAAAAAADDNAAAAA Individual, remarkable services take by the interest Books cooking 6.05 1054.65 0.37716408016112647 +AAAAAAAADIGCAAAA Positions shall Books cooking 4.21 2629.53 0.94037288551281172 +AAAAAAAAEGFEAAAA Ultimately senior elections marry at l Books cooking 5.06 7756.87 2.77401293175881769 +AAAAAAAAEINDAAAA Hence young effects shall not solve however months. In order small activities must not return almost national foods. International decades take contributions. Sessions must see Books cooking 1.43 19276.07 6.89351084309627374 +AAAAAAAAEKJCAAAA Members need for a regions. Leading needs go at least under the others; old police could play on a drinks. Very similar machines must consider fully effec Books cooking 9.86 10833.86 3.87440652490818908 +AAAAAAAAEKPDAAAA Mainly catholic activities could assume just fat, o Books cooking 2.68 2262.61 0.80915490391444210 +AAAAAAAAENDCAAAA Points trace so simple eyes. Short advisers shall not say limitations. Keys stretch in full now blue wings. Immediately strategic students would not make strangely for the players. Books cooking 1.69 5132.94 1.83564271902740482 +AAAAAAAAEPJDAAAA Projects become more from a pupils. Details may precede generally; good, marvellous birds could suffer fair Books cooking 9.88 628.36 0.22471419087853357 +AAAAAAAAFDIAAAAA Great pp. will not r Books cooking 1.91 2941.23 1.05184308300603044 +AAAAAAAAFPEBAAAA New, general students raise therefore to a women; united letters would start black positio Books cooking 4.03 3747.49 1.34017789670793138 +AAAAAAAAGFGCAAAA Products may not resist further specif Books cooking 5.37 8721.33 3.11892325153523644 +AAAAAAAAHBGCAAAA Dramatic months deal broadly in a films. Almost new occasions may get together sources. Under dry orders wor Books cooking 3.92 1412.78 0.50523858073297895 +AAAAAAAAHCGEAAAA Thus certain stars appear totally even local guests. Urban friends might not take properly various vehicles Books cooking 4.55 1446.44 0.51727607462974425 +AAAAAAAAICAAAAAA Somet Books cooking 7.34 6593.72 2.35804706645808830 +AAAAAAAAIFHDAAAA Genetic properties might describe therefore leaves; right other organisers must not talk even lives; methods carry thus wrong minutes. Proud worke Books cooking 1.08 119.92 0.04288580713309846 +AAAAAAAAIHHDAAAA Urgent agencies mean over as a plants; then Books cooking 6.47 9566.59 3.42120525067902230 +AAAAAAAAIJJAAAAA Men could require evolutionary falls; taxes teach dead parents; only financial servants might not buy eastern things. Different payments develop. New inhabitants might not eat w Books cooking 80.50 3855.42 1.37877583836799906 +AAAAAAAAINMBAAAA Hours ought to cope thus into the eyes. Dark states reduce most for the feelings. National, tragic children shall establish enough typical boats. In order secret hours must mean; sin Books cooking 2.30 12966.63 4.63712802990534045 +AAAAAAAAJHGDAAAA Guests agree around trying, young costs. Here annual banks appeas Books cooking 58.88 8031.52 2.87223330308224573 +AAAAAAAAJIHBAAAA Wonderful qualities suffer of course light leaders. True clubs used to see early living operat Books cooking 9.91 4482.62 1.60307518988467144 +AAAAAAAAKABAAAAA High big appeals may Books cooking 36.23 675.62 0.24161531867298181 +AAAAAAAAKCGEAAAA Final women should establish on a pupils. Full, northern years might not avoid full Books cooking 60.38 5877.02 2.10174071245298770 +AAAAAAAAKECDAAAA Little part Books cooking 9.90 4729.36 1.69131438311366337 +AAAAAAAAKFIAAAAA Here other affairs afford directly effective leads. Plants cannot undertake as coming, huge photographs; d Books cooking 0.87 20785.39 7.43327407210001090 +AAAAAAAAKFNBAAAA Stairs might bring early others. Large forms rel Books cooking 1.88 2350.18 0.84047169953356678 +AAAAAAAAKHADAAAA Now available m Books cooking 3.55 1102.96 0.39444070910208700 +AAAAAAAAKJNDAAAA Major instructions put flatly british, other democrats. Operations represent well upon a stores. Thousands will not appear surely Books cooking 1.29 582.88 0.20844962693245854 +AAAAAAAAKLACAAAA New, single products raise too extreme, efficient minutes; hands support leaders. Additional, english things prefer halfway private, slow churches. High white things could f Books cooking 4.13 2472.08 0.88406559454294555 +AAAAAAAAKLEDAAAA Golden, sure days fill of course. Early free minutes must not express only, cap Books cooking 9.44 4521.21 1.61687575106934680 +AAAAAAAAKLOCAAAA Purposes hide tears. Small laws award good eyes. Books cooking 55.11 5382.78 1.92499053468895684 +AAAAAAAALCJDAAAA Yet religious animals ensure also. Rough, real heads resist dead. Civil, evolutionary votes dissuade rapidly left cars. Buyers Books cooking 2.20 11624.81 4.15726617427380135 +AAAAAAAALLNCAAAA Here comprehensive years should tend sensibly particular front sales. Official, coherent tears regulate animals. Rewards cannot w Books cooking 2.50 2499.59 0.89390372458156745 +AAAAAAAAMAODAAAA Widely splendid others deprive only. Different, main soldiers discover then other periods. Too main birds must change public, terrible houses. Different, armed females may foster; science Books cooking 4.26 6853.89 2.45108909816104214 +AAAAAAAAMGBDAAAA New women add however. Scottish managers place mostly. Normal, financial purposes should lea Books cooking 4.74 319.20 0.11415234853973505 +AAAAAAAAMINCAAAA Extra theories drop. Other resources shall know eventually anyway open students. Long-term, liable di Books cooking 6.96 5834.64 2.08658477093947276 +AAAAAAAAMJIAAAAA Special, public skills agree at a parent Books cooking 5.87 4713.66 1.68569974692295585 +AAAAAAAAMKGAAAAA Gentle fans cannot pay else can Books cooking 2.45 7576.48 2.70950183478800689 +AAAAAAAANHBBAAAA Sound, new offices might equip hot, new reports; calculations fight great scientists. Professional, little issues learn of c Books cooking 66.16 6628.48 2.37047794250834265 +AAAAAAAAOLDBAAAA Well angry rebels drop in a methods. Studies argue most sometimes residential organisations. Rural, different children know o Books cooking 4.42 453.06 0.16202338041795852 +AAAAAAAAPAFCAAAA Half general features used to defend as ready medical pounds. Turkish, trying rooms secure with a ci Books cooking 7.08 683.53 0.24444409397670770 +AAAAAAAAPHHCAAAA African, elected carers would examine proba Books cooking 6.20 15598.69 5.57840569437117702 +AAAAAAAAAFBEAAAA Already accessible clubs match all enough o Books entertainments 5.00 1196.30 0.46493128593083651 +AAAAAAAAAGKBAAAA Likely, various days develop no longer. Officials say before agricultural, rare ho Books entertainments 2.67 23516.84 9.13960934734576042 +AAAAAAAAAIKBAAAA Less progressive experiences would silence as economic, soviet specialists. Alone legal brothers fight only ears. Methods could not return records. E Books entertainments 8.36 5931.28 2.30513887621487248 +AAAAAAAAAJCDAAAA Strict heads discuss as categories. Alone, specific markets wait single, human numbers. External, various changes want very relatively nuclear orders. Old, pre Books entertainments 2.32 4525.09 1.75863572068274594 +AAAAAAAAAMFCAAAA Instances used to lower out of a costs. Irish supporters sign in a types. Bad things shall participate clear Books entertainments 1.58 3570.57 1.38767006737947580 +AAAAAAAAANJDAAAA Trustees may encourage today necessary, political tears; inner, foreign times pay in the historians. Areas may belie Books entertainments 1.79 17322.75 6.73233171726021741 +AAAAAAAABAJDAAAA Rare, radical beds say over readers; han Books entertainments 7.10 7808.46 3.03468807902658165 +AAAAAAAACKAEAAAA L Books entertainments 1.63 4264.23 1.65725481685601518 +AAAAAAAACLMDAAAA Always constitutional advertisements go for a spaces. Cars spend bad difficulties. Rights encourage further great qualities. Blue, high homes would produce u Books entertainments 2.63 3974.52 1.54466161878945775 +AAAAAAAACMOAAAAA Companies ought to record now detailed, good roads. Muscles shall not argue significantly territorial months. Clearly new periods could write in a committees. Figures will not find more there Books entertainments 3.07 7276.45 2.82792715498740725 +AAAAAAAACMPAAAAA Falsely large trees shall reflect against a Books entertainments 0.70 957.09 0.37196446079707792 +AAAAAAAAEGNDAAAA Deep patterns shall find british, american expectations. Sufficient patients must see. English, large assets could not meet for the proceedings. White, chinese matches shal Books entertainments 0.56 1499.01 0.58257681762365897 +AAAAAAAAEKGAAAAA Particular, deliberate things rain however original ways. Virtually old deaths consider women. Notably w Books entertainments 9.71 1611.84 0.62642718708915783 +AAAAAAAAEPCEAAAA New, previous police outline right in a persons. Wealthy quest Books entertainments 2.07 5037.58 1.95781037146155928 +AAAAAAAAFAKBAAAA Doors cannot happen here severe, old rates. Inevitable, int Books entertainments 2.29 1047.84 0.40723363591888968 +AAAAAAAAFGJCAAAA Limitations respond. Bare rivers will not create yesterday. Well local persons may unders Books entertainments 8.95 2096.28 0.81470045646668390 +AAAAAAAAGCBCAAAA So perfect changes would twist again; legal standards like improvements; rights used to tell working stations. Official, immediate loans listen much possible pictures. Always d Books entertainments 6.32 1017.52 0.39545003933824690 +AAAAAAAAHFABAAAA Prisons take angry, logical sums. Now old grounds cannot help so increased problems. Blue, negative designs would freeze. Small payments ask alike to a hundreds. Exte Books entertainments 2.62 11202.91 4.35391068500161131 +AAAAAAAAHGMAAAAA High, official employees shall not start too left circumstances. Patients used to touch obviously popular, senior members. British, impossible theories make only. Young, international wo Books entertainments 4.85 1041.70 0.40484737988309988 +AAAAAAAAHPPDAAAA Now old tears give. Other kids coincide up a animals; specific procedures remove future, french levels. Coming, strong values a Books entertainments 5.08 24460.84 9.50648649682223761 +AAAAAAAAIACBAAAA Large women establish today polite, easy horses. Details sha Books entertainments 5.06 1748.58 0.67956996401650263 +AAAAAAAAIDDAAAAA Plans would not claim; most particular horses will not tell simply cases; more british enquiries could not smile blue men. Old, dangerous play Books entertainments 0.95 6942.27 2.69805108950854163 +AAAAAAAAIKFAAAAA Pieces threaten Books entertainments 0.69 1273.35 0.49487607869266126 +AAAAAAAAINCCAAAA Cases can accept gmt sudden services; tools show all also capable meals; important, spatial days would not happen human, cold backs. Red, economic effects must s Books entertainments 9.58 1334.73 0.51873086622959576 +AAAAAAAAIPLAAAAA Financial gods might presume divine, tiny Books entertainments 8.42 731.84 0.28442306469583164 +AAAAAAAAKBFEAAAA Marginal, available teeth pay recently little services. Then british times could require more scottish fair tea Books entertainments 95.74 3018.65 1.17317130007115240 +AAAAAAAAKFGCAAAA Now complete others shall pass. Just front advantages could exercise more establish Books entertainments 6.51 5281.66 2.05266987849992639 +AAAAAAAAKKIDAAAA Young reasons could not say impossible experiences. Prisoners cancel particularly; forms might k Books entertainments 3.77 3626.88 1.40955444480216694 +AAAAAAAAKLNAAAAA Just particular actions seem very; necessarily poor eleme Books entertainments 0.26 6872.96 2.67111437845958545 +AAAAAAAAKMOCAAAA Japanese, efficient sports withdraw recently severe days; factors mean originally impossible items. Quiet workers become from a officers. Pieces explore. For example o Books entertainments 3.74 16796.75 6.52790652592057016 +AAAAAAAALMJCAAAA Never able feet go on the provisions. Services play brown studies. Cruel, Books entertainments 9.79 12846.63 4.99272774870656373 +AAAAAAAAMDOCAAAA Internal claims speculate perhaps through a expectations. Immediate courts appeal to a councils; transactions materialise entirely; fine, serious conditions may not use to a types. Short, large lip Books entertainments 3.11 5231.34 2.03311346095579892 +AAAAAAAAMJABAAAA Front, possible foundations hear well. Old, close inches change pointedly for the employees; odd, financial members work under on the arrangements; st Books entertainments 92.23 225.66 0.08770073893099771 +AAAAAAAAMJDCAAAA Local words co Books entertainments 2.95 9381.26 3.64594271959501737 +AAAAAAAAMOFBAAAA Hardly local women should tell easily tall, able issues. Important, available conditions could no Books entertainments 2.21 15740.54 6.11741996442846214 +AAAAAAAAMOHBAAAA General, raw tests would not buy heavy, considerable blues. High, regional modules meet often young, responsible calculations. Things hesitat Books entertainments 2.00 5567.90 2.16391449212931922 +AAAAAAAAOAODAAAA H Books entertainments 4.80 2493.52 0.96908422644341674 +AAAAAAAAOBODAAAA New hours borrow new poets. Youngsters mind especially. Laws must add there in a ends. Factors must not take strategic, royal tr Books entertainments 2.30 4109.90 1.59727584389128560 +AAAAAAAAOEGCAAAA Clear materials will ship evidently literally scottish targets. Residential heads make prominent times. Internal, open subjects feel subsequent Books entertainments 0.75 263.40 0.10236805208909332 +AAAAAAAAOEMBAAAA Other practices get feet. Numbers will not increase now large, simple foreigners. Flowers cover Books entertainments 1.00 315.51 0.12262013710945267 +AAAAAAAAOFEAAAAA Heavy, formal factors could want then truly serious players. Be Books entertainments 4.31 8757.62 3.40357061631163789 +AAAAAAAAPCKBAAAA Men call tonight particularly mental lines. Recent markets must dress children. Multiple relations should seem relatively about a arts. Funny, real proteins shall keep citie Books entertainments 5.20 3090.94 1.20126616144366780 +AAAAAAAAPEGAAAAA Dirty trials should get. Balls shall win later national programmes. Elements ought to explain apart poss Books entertainments 1.62 290.34 0.11283804192690719 +AAAAAAAAPFIAAAAA Subsequent, Books entertainments 1.29 9603.95 3.73248919461293761 +AAAAAAAAPNPAAAAA Countries turn more actually scientific patients. Good writers could not drag perhaps. Suddenly left months cannot announce more overall loans; beds transform far Books entertainments 1.32 2401.56 0.93334479565331415 +AAAAAAAAACCEAAAA Royal, blue men used to convey jobs. Other, technical things would say as mere children; ab Books fiction 0.62 555.50 0.18274906106295868 +AAAAAAAAAEGEAAAA Exclusively ready fields invest right in a courts. Quite glad facts would not imitate usually by a types. More large managers can continue both small matters. Additional, basic scholars s Books fiction 1.11 3969.44 1.30587116641899316 +AAAAAAAAAIDCAAAA Dollars get on a years; separate economies can say. Firms know even sons. Simple, definite members will say most cold, big policies; main, true agents might repeat too. Elements know goods. Great Books fiction 5.03 149.04 0.04903135924540659 +AAAAAAAAAMOCAAAA Wild officials will not watch onl Books fiction 0.47 6954.51 2.28790310108543073 +AAAAAAAAAODAAAAA Just minor eyes exc Books fiction 7.11 16681.12 5.48777500896227056 +AAAAAAAABGFEAAAA Married circumstances face human, compulsory hours. Years make sometimes national problems. Difficulties should invest far running, medical centuries; perf Books fiction 2.71 10221.52 3.36268799754501063 +AAAAAAAABJAAAAAA Other horses apply able schools; possible enquiries would not describe easily r Books fiction 3.83 10067.63 3.31206107944063852 +AAAAAAAABKFAAAAA Firm, local examinations may not sponsor most rural charges. Countries shall help beautiful, different terms Books fiction 7.72 5090.34 1.67462620250444840 +AAAAAAAABOJBAAAA As joint men would so Books fiction 2.13 2773.11 0.91230107781152357 +AAAAAAAABPGDAAAA Pictures get with a conditions; still gross eyes go that. Personal beings contact thereafter in a systems. New, medium goals might not tell; as official years mu Books fiction 5.52 2061.58 0.67822107885899974 +AAAAAAAACEBDAAAA Essential, alternative fans let unlikel Books fiction 1.52 2460.17 0.80934969856932323 +AAAAAAAACMNBAAAA Basic changes may not see; afraid names seek in excess of a characteristics. Awful scientists shall not want now right eyes. Here used workers will not pray in part Books fiction 2.27 6034.24 1.98515156476786280 +AAAAAAAACNBBAAAA Local companies would restrict yet most imaginative days. Married, str Books fiction 99.71 7003.69 2.30408239689654919 +AAAAAAAADCGCAAAA Different stations may smell; weapons disguise cons Books fiction 1.47 1671.19 0.54979010505455611 +AAAAAAAADCODAAAA Private, quiet populations shall receive more somewhat proposed machines. Heads protect abroad parent Books fiction 74.86 3243.16 1.06693869464796593 +AAAAAAAADDBDAAAA Circumstances should include parties. Good investigations fall as deposits. Characters might force at all convenient, special years; Books fiction 5.18 12.59 0.00414187340914968 +AAAAAAAADNMAAAAA Old, official cases look enough; actual emotions go statistical, wild limits. Mental cities hear above mod Books fiction 2.55 769.44 0.25313130070978025 +AAAAAAAADPHDAAAA Times should not get on a lists; different students undermine suddenly groups. Even actual modules may stay for a Books fiction 8.31 638.38 0.21001502358482729 +AAAAAAAAEBJAAAAA Techniques render eventually dark tiles. Only, other centres would bid at the falls. Sorry, full days write for a groups. Both Books fiction 2.99 6665.04 2.19267291079579140 +AAAAAAAAEEEEAAAA Towns see even afraid, mean factors. Soldiers spend areas; resu Books fiction 48.40 9444.91 3.10719790157362568 +AAAAAAAAEJDEAAAA Loud young standards remove enough green values; important students cannot receive particular police; significant authorities should not expect Books fiction 52.22 8870.17 2.91811924206809036 +AAAAAAAAFHDBAAAA Good, bad cats could not finance libraries. Concerned names get at Books fiction 0.13 5959.16 1.96045165566866039 +AAAAAAAAFMHBAAAA Years take critics. Again academic areas look high under a w Books fiction 90.57 742.90 0.24440013944855446 +AAAAAAAAGFHBAAAA Ambitious, isolated mines should Books fiction 9.67 5292.65 1.74118239070183305 +AAAAAAAAGFODAAAA Wives must file upon a respects; anywhere growing wounds may not develop yet for a demands; quite key sides could not make fresh men. Dead times Books fiction 18.03 6121.11 2.01373016230978759 +AAAAAAAAGIOAAAAA Thus separate stars will touch lightly commercial great institutions. Personal, brief hands will not concern always smart rules. Dead Books fiction 4.96 2769.10 0.91098186316730672 +AAAAAAAAHDHCAAAA Difficult decisions retain concerns. Accordingly parliamentary cases worry only inadequate, good scores. Responsible adults exist still well silly Books fiction 2.74 2397.93 0.78887390818127904 +AAAAAAAAHFFCAAAA Necessarily royal losses ought to say courses. True, current Books fiction 0.62 5056.32 1.66343426180712733 +AAAAAAAAIBMCAAAA Others reflect much up to a paintings; twice narrow cases cannot wear however hard major wings. Popular bacteria go Books fiction 8.71 3061.36 1.00712991102736127 +AAAAAAAAIFBAAAAA Usually sure students give. Popular resources may give especially full, fine paintings. Ever possible borders shall not free. New bodies help apart. Further main readers could esca Books fiction 3.51 11100.42 3.65182958128620664 +AAAAAAAAIGADAAAA Communications move afterwards different errors; warm goods give at all. Twins could return f Books fiction 0.34 5726.99 1.88407208859937665 +AAAAAAAAIJPDAAAA New, united books ought to earn things. Home domestic bands shal Books fiction 3.36 8480.61 2.78996132266631505 +AAAAAAAAIMOAAAAA Different, expensive years used to learn humans. Normally parliamentary cards benefit. Certain consequences used to encourage. More new proposals could not prom Books fiction 3.33 8887.28 2.92374811053755431 +AAAAAAAAIOMDAAAA Good levels ask quiet, particular objects. Previously rural re Books fiction 4.72 3395.05 1.11690765033626979 +AAAAAAAAJHGAAAAA Large hearts used to say annually. For example separate criteria should admit gay ministers. Growing, ordinary Books fiction 1.92 3430.77 1.12865885908724888 +AAAAAAAAJHIBAAAA Plans mi Books fiction 4.76 533.80 0.17561016884861808 +AAAAAAAAJJBAAAAA Citizens can b Books fiction 4.61 584.00 0.19212502549193136 +AAAAAAAAJKFEAAAA Personal, sympathetic text Books fiction 0.15 3428.40 1.12787917362420799 +AAAAAAAAJLODAAAA Social, private books ought to demand merely social companies. Alive, swiss police will rest again victorian, married commentators. Standard, european territories attend to a comments. Books atte Books fiction 2.81 3504.94 1.15305939528714023 +AAAAAAAAJOKBAAAA Favourably present words can make small, economic cases. About eastern years give less views. Only possible workers may accept even requirements. Negative goods imp Books fiction 4.00 4392.10 1.44491836380669814 +AAAAAAAAKDGAAAAA Provinces complement more. Participants cannot lie swiftly then total muscles. Unions surprise perio Books fiction 2.17 1757.38 0.57814499537501769 +AAAAAAAAKGGBAAAA New, novel individuals used to pay at the rates. Especially social values sleep too unaware cattle. Also immediate changes give almost chains. Swee Books fiction 1.98 11006.58 3.62095798472428397 +AAAAAAAAKHNCAAAA Also good forms Books fiction 4.30 2992.89 0.98460456771326445 +AAAAAAAAKIJCAAAA Mo Books fiction 6.72 9516.74 3.13082862174671717 +AAAAAAAAKMMAAAAA Then wild sciences will know in a chemicals. Extremely Books fiction 5.84 10044.66 3.30450438109209457 +AAAAAAAAKNJAAAAA Likewise high penalties might afford never square, thin Books fiction 1.65 209.10 0.06878997059993638 +AAAAAAAALDNBAAAA Enough little accountants light only important, great systems. Determined sk Books fiction 0.36 6117.14 2.01242410691389210 +AAAAAAAALGFAAAAA Primary, good features assess then early, bad c Books fiction 4.63 2352.74 0.77400724739021675 +AAAAAAAALHNDAAAA Mass attitudes may like occupational state Books fiction 6.40 528.87 0.17398829149300982 +AAAAAAAALIOBAAAA Additional officers shall not apply so poin Books fiction 9.09 6890.24 2.26675947884507726 +AAAAAAAAMAEAAAAA In order financial glasses must kill convenient, important papers. Shy cities like below fragments. Patients ma Books fiction 6.94 8176.49 2.68991155767897573 +AAAAAAAAMBOBAAAA Goods keep points. Again sensitive windows must not cause closely female, individual powers; gaps derive suddenly sincerely other hands; other houses may not imagine under for a data Books fiction 7.80 6049.19 1.99006983382797303 +AAAAAAAAMFPDAAAA Pretty realistic facts may not work without a guidelines. Overall patterns t Books fiction 15.95 13032.24 4.28736205859069780 +AAAAAAAAMOODAAAA Mechanically whole rooms might like then please specialist relatives. Als Books fiction 3.90 6774.40 2.22865029570640375 +AAAAAAAANGNCAAAA Important enterprises could flow without a countries; ugly, previous things see even de Books fiction 0.82 887.04 0.29181949077459382 +AAAAAAAANIEDAAAA Excellent, relevant concentrations seem exciting, local children. Units should not reinforce current lips; pure feet shall show always into a minutes. Commonly primit Books fiction 2.70 4113.69 1.35332670567791628 +AAAAAAAANLEDAAAA Conservative, available Books fiction 2.01 2510.09 0.82577244047438695 +AAAAAAAANOAEAAAA Black women treat really users. Expert, hard authorities should produce good indians; little, other details could waste. Ideas shall build. Low day Books fiction 0.72 9472.17 3.11616592930463604 +AAAAAAAANOBAAAAA Houses appear again scientific tests. Naked pieces shall not believe experiences. Coming, good measu Books fiction 1.86 2113.81 0.69540376735462230 +AAAAAAAAPFODAAAA Rates should not turn exactly enormous flowers. Happy practitioners should believe suddenly natural organisms; al Books fiction 2.51 3437.58 1.13089922111396129 +AAAAAAAAPJKAAAAA Constitutional, good pupils might not begin below level devices. External savings fit hardly. Parents shall dry. Actually literary companies improve a Books fiction 4.22 439.55 0.14460368999140142 +AAAAAAAAPPHDAAAA Eyes come no longer. Commercia Books fiction 0.20 5344.48 1.75823348671424196 +AAAAAAAAAAJBAAAA Famous authorities will demand at last growing teachers. Over immediate schools should go only so Books history 2.40 4151.41 1.32043953348399043 +AAAAAAAAAFCDAAAA Civil, english books could search either young institutions; incidentally major difficulties could not clinch little nevertheless old papers. Special subjects sail late workers. Low, national part Books history 1.01 1167.75 0.37142639855517278 +AAAAAAAAALGDAAAA At first close areas may Books history 0.09 9795.83 3.11576095719008192 +AAAAAAAAALPCAAAA Onwards current types may allow; other sectors might carry nowadays marginal conditions. Minutes add well faces. Urban, possible women could not oppose never markets; galleries must favour gently vehe Books history 59.17 3685.92 1.17238106697707767 +AAAAAAAAANBDAAAA Weapons wi Books history 3.85 1690.46 0.53768483810882242 +AAAAAAAAAPFDAAAA Odd, only premises present previously obvious strengths. Widely different times should not ke Books history 1.88 8472.00 2.69469017217677053 +AAAAAAAABAJAAAAA All female calls see ever fresh, widespread lawyers. Results could not want initially Books history 1.77 439.46 0.13977910092832903 +AAAAAAAABHDCAAAA Logical suggestions should evacuate in common equivalent, distinctive women. Fruits know formal pensioners Books history 1.85 10800.83 3.43542144149575407 +AAAAAAAABJCEAAAA Regular, elderly circumstances should not stop sole, different sites. New group Books history 2.98 383.28 0.12190992082057514 +AAAAAAAABKDCAAAA Also quiet users fall. Other, current sources would c Books history 0.43 10191.59 3.24164039327845288 +AAAAAAAABLLCAAAA Similarly legislative games could expect others. Central, special miles get all to a problems. Rights pass different, glad eyes. Most local tanks Books history 9.29 367.56 0.11690985831979388 +AAAAAAAACAJDAAAA Military areas used to help sometimes sooner certain children. Unlikely proceedings say; wages recognize now managerial years. New events stay full, royal communities Books history 6.86 9156.39 2.91237419093692870 +AAAAAAAADANAAAAA Wildly sexual powers achieve local, comfortable songs; artistic, very shares might start. Miners used to sleep very italian partners. Book Books history 4.58 3997.52 1.27149172061851791 +AAAAAAAADJPBAAAA Architects influence around enough visual interests. Days think already other issues. Regardless lucky rules mean to a shoulders. Women accept only. Books history 1.44 5541.90 1.76271287360557656 +AAAAAAAADNIBAAAA Never possible applications will not contribute still bad, golden resources; force Books history 5.60 5573.65 1.77281160034856670 +AAAAAAAAEIMBAAAA Armed profits forget now s Books history 9.04 494.12 0.15716481443295395 +AAAAAAAAEJAAAAAA Hundreds go over electronic fa Books history 7.68 898.62 0.28582418348931652 +AAAAAAAAEJCCAAAA In short new acres marry perfectly for a c Books history 1.58 186.93 0.05945685008085502 +AAAAAAAAEMGBAAAA Hostile, certain contents would carry; others can get great, prime rates. Expensive, national shows produc Books history 1.95 3076.78 0.97863182577314023 +AAAAAAAAFLAAAAAA Origins help still already common hands. Probably official increases could inform more recent, Books history 34.26 5002.56 1.59116492772953555 +AAAAAAAAGBGEAAAA Safe films go behind amo Books history 4.48 6872.36 2.18589246360490448 +AAAAAAAAGEBCAAAA Ancient, yellow sets anger other men. Beautiful, vari Books history 3.24 2349.53 0.74731532108527947 +AAAAAAAAGEDDAAAA Wheels shall include tables; only central days shall see lovely, jewish artists. Genes ought to climb therefore; Books history 2.02 6800.22 2.16294688416429633 +AAAAAAAAGMEAAAAA Branches attend fair true banks. Rigid cigarettes like by a places. Stations shall not let thus. Kids hold into a achievements. Streets used to set twice actual, wonderful areas; surroundings r Books history 6.21 12377.05 3.93676994753783023 +AAAAAAAAHIICAAAA Then sp Books history 1.91 8909.36 2.83380132582446085 +AAAAAAAAHKBEAAAA Parliamentary pieces shine never tragic patterns. Great human eyes would not get groups. Plant Books history 6.03 953.70 0.30334348645006918 +AAAAAAAAHOEDAAAA Tropical, different relations would not work eyes. Level customs might aff Books history 0.31 10335.72 3.28748384163962355 +AAAAAAAAHONAAAAA Ready, imperial shops see impossible assumptions. Clinical holders ask. Other rules would not avoid at a panels. Unusual, particular rights cannot go yet golden substance Books history 4.56 2768.79 0.88066940531413131 +AAAAAAAAIAPCAAAA Very valid police should not like away pictures. New, special principles survive from a Books history 4.76 8944.55 2.84499421382716393 +AAAAAAAAIEHBAAAA Fully classical offices cannot go different, new roads; proceedings mean asian, only groups. Earlier academic affairs Books history 3.37 10650.60 3.38763776531939474 +AAAAAAAAIHCCAAAA Big, special things find however happy agencies. Current firms reduce especially at a eyes. Imports want reasons. Little controversial de Books history 4.36 1262.68 0.40162079634137920 +AAAAAAAAIJBEAAAA Additional, human standards should not dream also silly forms. More independent friends may believ Books history 4.39 5255.61 1.67165257504650106 +AAAAAAAAIKGCAAAA Confidential, full terms make incorrectly elderly, real methods; teeth slip much today unknown conditions. Years shall not undermine occasionally local, industrial lips; restrictions beat most things Books history 1.38 7182.03 2.28438924188842437 +AAAAAAAAIKOAAAAA Independently mean findings must not take today police. White, yellow features try even grateful examples. Sweet Books history 2.06 4957.80 1.57692810854792173 +AAAAAAAAINEEAAAA Films cope Books history 1.22 14315.87 4.55345068403685835 +AAAAAAAAINKAAAAA Hours used to use always local, upper budgets. Only royal strategies confuse already key windows. Open, short habits broadcast just. Working-class lights will display previous measures. Soviet scho Books history 0.75 4671.20 1.48576920824741861 +AAAAAAAAJENCAAAA Opponents bring also waiting, other things. There massive characters contact Books history 58.48 1594.66 0.50721371930635138 +AAAAAAAAJGICAAAA Boys form so go Books history 4.24 12750.46 4.05554051613940340 +AAAAAAAAKADBAAAA Tomorrow soft actors could not go for the needs. Considerable times used to allow following visitors; months must not avoid about economic farmers. Tears start at firs Books history 1.76 10852.02 3.45170345163665691 +AAAAAAAAKCACAAAA Years would land in a trees. Areas establish above civil tests. Within so-called thanks like just. Ill acts prevent. Most Books history 8.83 11890.89 3.78213697136863066 +AAAAAAAAKDBAAAAA Allegedly great plans respond able, cheap facts. Today local banks might allow at least tr Books history 7.32 75.87 0.02413198103907597 +AAAAAAAAKMCEAAAA Effects shall not come in short southern firms. High, afraid years smell anyway governors. Wages can think deep, educational participants. Quietly probable Books history 88.42 7756.02 2.46695831789500422 +AAAAAAAAKOPBAAAA Particularly particular contents destroy feet. Essential, fatal wo Books history 2.76 7308.24 2.32453287345481131 +AAAAAAAALGCAAAAA Popular, current dogs shall not nominate respectively. More labour connections take further feet; holy, neighbouring months can leave. Attempts should investigate Books history 0.64 2234.94 0.71086766447176010 +AAAAAAAALKABAAAA Green discussions might offer most. Grateful feet ought to go still Books history 47.36 12676.50 4.03201604905557503 +AAAAAAAAMEPDAAAA Major, grateful charts talk system Books history 3.78 1685.71 0.53617400497404436 +AAAAAAAAMMEDAAAA Forward slight interests provide on a cases; successful areas must come internal, present en Books history 4.36 1180.89 0.37560584011116933 +AAAAAAAANCDEAAAA Soon sure forests cope; guilty, e Books history 6.82 3323.19 1.05700748740275284 +AAAAAAAANHACAAAA Grey words need. English, swiss measures help separat Books history 3.59 4100.58 1.30427202859119708 +AAAAAAAANHIAAAAA Parliamentary, monetary charges shall evaluate by a observations. Urgent, suitable problems give just at the rises; earlier big others stay always guilty terms. S Books history 1.16 6557.12 2.08562403467702379 +AAAAAAAANJJDAAAA Lovely years help. Possible, good years must imagine even necessar Books history 35.72 11655.58 3.70729188822239413 +AAAAAAAAOCBCAAAA Other, current movements would get in a products. Books history 8.87 18347.84 5.83589992075918761 +AAAAAAAAOPNCAAAA Legal, independent teachers cut. Perhaps common wives might carry already states. Courts rally regions. Besides financial ways could not suffer notably political Books history 3.66 1239.86 0.39436243589177180 +AAAAAAAAPINBAAAA Major, front faces wonder very desirable teachers. Prospective, national plans take industrial, separate locations. Capitalist children save head, economic features. Techniques l Books history 1.92 1668.04 0.53055370571267001 +AAAAAAAAPONBAAAA Trends work to a co Books history 4.91 3816.03 1.21376517206465081 +AAAAAAAAAFFDAAAA Alone sole services keep only; stairs shall eliminate for the woods. Methods must need yet. Other students can Books home repair 2.39 1754.10 0.73033351855711644 +AAAAAAAAAFMCAAAA Alive reforms remember to a rocks. Neighbours could find together with a maps. So anxious circum Books home repair 2.84 819.94 0.34138855550180837 +AAAAAAAAAJFDAAAA Refugees can help as natural publications. Serious, active feet carry alone as well sharp coins. New reasons pay absolutely cautious changes. Practical memb Books home repair 4.33 4572.72 1.90388842538994214 +AAAAAAAAAPKDAAAA Above northern firms can restore either in a tories. Then natural children used to supply publicly chosen things; extra, available circumstances must pay Books home repair 0.40 2992.66 1.24601784826699738 +AAAAAAAABHNBAAAA Here different Books home repair 4.50 3368.22 1.40238524820389416 +AAAAAAAABJMDAAAA Chief Books home repair 4.04 3930.58 1.63652831729675090 +AAAAAAAACALDAAAA Black, relative workers make soft, important cases. Previous p Books home repair 9.53 10606.18 4.41596759469250173 +AAAAAAAACDEEAAAA Taxes disregard earlier for the aims. In part heavy years continue less settings. Breasts accomplish. Weak, appropriate duties mu Books home repair 9.96 6044.52 2.51668408847207200 +AAAAAAAACHACAAAA Members defeat at all new, only bills; original abilities convince; already exciting systems lead shapes. New, real travellers should pursue again short vehicles. Important, only Books home repair 80.60 1171.18 0.48763012956144099 +AAAAAAAACHNDAAAA Professional managers take at least at a applicants. Vulnerable areas must regulate more with a employees. Books home repair 0.38 2026.22 0.84363284987788637 +AAAAAAAACIKAAAAA Completely foreign parties cope with the terms. Children would take terribly visual, total things. Yet good songs will work all right m Books home repair 2.78 1190.62 0.49572412853570149 +AAAAAAAACLLBAAAA Activities bring brief, yellow practitioners. Polish representatives will not prevent for the examples. Annual, ashamed standards use Books home repair 7.44 5309.96 2.21084417661338922 +AAAAAAAADABDAAAA Perhaps european sectors may say practices. Just true years can tell interesting relations. Then private years could not persuade before quickly continuous levels; pale, constitu Books home repair 4.28 61.23 0.02549359862108901 +AAAAAAAADAGBAAAA Chief levels must attack about for a parties. Branches complete really. Just following aims shall not arrive together experienced friends. Actually Books home repair 7.44 7424.19 3.09112069160056914 +AAAAAAAADHHCAAAA States should not hold services. Western manufacturers could not mean even large exercises. Facilities maint Books home repair 7.52 5601.60 2.33227081554617381 +AAAAAAAAEECEAAAA Free, particular nurses get either. Great, evolutionary million Books home repair 0.89 1230.96 0.51252000912323588 +AAAAAAAAFKGBAAAA Military, inc computers ought to maintain entirely even burning sections. Able, outer papers may not cause thus useless, pretty walls. Always im Books home repair 73.73 6564.64 2.73324019683073308 +AAAAAAAAGGDBAAAA Diverse, remaining bits ought to listen along a relationships. Distant stages jail relatively. Short, false applications could appear p Books home repair 1.52 1742.72 0.72559536483658741 +AAAAAAAAGKKCAAAA Houses help general, new attitudes. All central shoes cannot watch. Effects boost to a details. Figures get intently normal, common leaders. Ne Books home repair 1.01 19637.84 8.17637123542653418 +AAAAAAAAGNNAAAAA Even able courses should not vote. Appropriate findings might wait legal things. Sheer, interested levels inform in a meetings. Books home repair 2.99 3714.58 1.54659499536052312 +AAAAAAAAHAAAAAAA Tomorrow different years mean highly in a circumstances. Financial fi Books home repair 0.35 7727.05 3.21721886697837445 +AAAAAAAAHEHBAAAA Open, l Books home repair 6.35 1419.57 0.59104928620838367 +AAAAAAAAHGECAAAA Expenses look away both complete manufacturers. Male advantages use here books. Right rich falls used to say; simple visitors mind records. Conventional profits might arrange Books home repair 7.60 414.17 0.17244298123299750 +AAAAAAAAHGFBAAAA European, local terms bring even everywhere working days; much nice choices grow merely major, black rates; final, other talks can know for example also industrial Books home repair 8.57 772.24 0.32152828024089140 +AAAAAAAAIAIDAAAA Internal exhibitions shall die soon direct movies; services could follow at once social, outer sciences Books home repair 2.25 1729.95 0.72027847353507987 +AAAAAAAAIDEEAAAA However broad boots may not obtain extraordinarily da Books home repair 2.68 2701.11 1.12462868155168622 +AAAAAAAAIDPDAAAA Political, standard statements damage as elegant preferences. Tremendous girl Books home repair 4.06 16118.92 6.71124084085324406 +AAAAAAAAIHHBAAAA British runs wish underneath appropriate pounds. Unable, complex results must not look at the origins. Extra employees find so early thanks. Competent Books home repair 5.60 15.48 0.00644522140542966 +AAAAAAAAIJLDAAAA New, immediate seconds may not give also lines; relevant groups break little golden, political eyebrows. Able cattle doub Books home repair 3.96 1518.63 0.63229370690747035 +AAAAAAAAJJHAAAAA Vast, delicate tem Books home repair 0.83 336.52 0.14011278471286747 +AAAAAAAAKDEAAAAA Corporate stones relieve together early things; forward line Books home repair 8.20 7293.74 3.03680679416269454 +AAAAAAAAKDLBAAAA Words should agree completely level times. Very gentle hours would not interpret. Gr Books home repair 8.23 3906.80 1.62662732472432730 +AAAAAAAAKHGAAAAA However great occupations find very academic homes. Surprised writings suit as free, short shows. Originally possible preparations should accept as yet similar children. Hours re Books home repair 1.86 2705.71 1.12654392822255033 +AAAAAAAAKNGDAAAA Members may not cut probably area Books home repair 0.87 8868.24 3.69236242096172529 +AAAAAAAAKPJAAAAA Similar seats would not see now light soldiers. Rather possible countries take white, proposed boys. Guilty, famous models would not invest often like a fears. Plainly new classes prevent little Books home repair 3.02 3962.44 1.64979348228234450 +AAAAAAAALBABAAAA External hours will not begin never old, empty word Books home repair 1.92 275.50 0.11470662126588312 +AAAAAAAALBCCAAAA Sections will not kick for a systems. Political, lacking arms used to say other authorities. Savi Books home repair 53.64 8876.73 3.69589730014338536 +AAAAAAAALBNDAAAA Planes play sometimes economic, wonderful comments. Responsible, primary costs can bring stra Books home repair 8.00 3496.76 1.45590390191538823 +AAAAAAAALEBAAAAA Of course british lawyers shall describe at least extremely active men. Proposals may gain. Also lexical differences attend bad teams; academic, major contexts could not hold less stead Books home repair 4.97 855.34 0.35612762770802348 +AAAAAAAALJLAAAAA Political, local children will distinguish as necessarily new managers. Directly resulting questions Books home repair 6.97 13643.34 5.68051337271024974 +AAAAAAAALJNBAAAA Issues become at a materials; more complete others should apply seco Books home repair 3.96 2603.64 1.08404627002796343 +AAAAAAAALNICAAAA Real earnings exceed there from a shoulders. Practical days shall not spend now systems. Ages might not sit much. Probably Books home repair 0.86 1450.51 0.60393140185980444 +AAAAAAAALOPAAAAA Scientific contracts transform only variable contacts; just important relations could tell generally on a values. Possible Books home repair 1.94 8305.21 3.45794039202767748 +AAAAAAAALPKBAAAA Extraordinary, economic obligations intend multiple, public patients; again enthusiastic supporters should stop greatly labour, mad trus Books home repair 2.73 1640.87 0.68318930539582445 +AAAAAAAAMBGEAAAA Remarkably political plans would locate separate problems. Sensible areas will not join home social Books home repair 6.39 3591.09 1.49517894940726030 +AAAAAAAAMCFDAAAA Hours might need etc with the holders. Early demands drive usually; at all other responsibilities see so equally italian issues. Simple, senior operations must t Books home repair 6.30 4254.02 1.77119513973681346 +AAAAAAAAMOEEAAAA Spanish, unique colleagues put through a applications. Years will confront normally by no appearances; colleagues will not own still. Sympa Books home repair 2.68 5243.74 2.18327295171238458 +AAAAAAAANCICAAAA British demands can travel easy conditions. Inevitably small pat Books home repair 0.78 3069.27 1.27791503249632335 +AAAAAAAANMFEAAAA Able prices would leave mainly in a matters. Ostensibly necessary schools get far private sales. Laboratories question possibly rare sectors. Likely hands could respond up to good Books home repair 2.22 5893.46 2.45378905323278233 +AAAAAAAAOFKCAAAA Systems cannot show. Global pains sha Books home repair 6.41 748.19 0.31151487101604752 +AAAAAAAAOGJAAAAA Dark, fun calculations must not take away interested feet. High, local films could show normal, visual glasses. Concerned, indian chiefs stick at least. Cultural condition Books home repair 1.87 2172.50 0.90453769401136507 +AAAAAAAAOHGBAAAA Sentences might treat in a persons. Prisoners look best heavy investigations. Western, emotio Books home repair 2.92 1731.95 0.72111118947893383 +AAAAAAAAOOOCAAAA Japane Books home repair 8.75 326.81 0.13606994880545649 +AAAAAAAAOPDCAAAA Democratic, sure places lose in a friends. Other, essential volunteers borrow other, other nurses; foreign hours get indeed enormous designers. Helpful, professional powers lower far from. C Books home repair 4.46 7443.09 3.09898985726998908 +AAAAAAAAPHADAAAA Dutch, quick households ring fortunately small, automatic pubs; objectives st Books home repair 93.40 4131.30 1.72009968942193442 +AAAAAAAAPLACAAAA Industrial, difficult children shall use crops; errors can reach frankly boards. Apparent, special arms may not see always other inter Books home repair 3.19 722.52 0.30082696187668193 +AAAAAAAAPMKDAAAA Suddenly various forms must not involve then local, other economies; continuing, still others cannot know directly only comprehensive products. Odd books go enough southern cases Books home repair 7.64 10446.87 4.34963760618481448 +AAAAAAAAAAICAAAA Rather little years should not reach more new magistrates. Political speakers may lower considerably gates. Kinds would not depend well. Provisions raise. Almost difficult pensions pick yet organi Books mystery 4.25 327.20 0.10733361870342104 +AAAAAAAAAANBAAAA Royal plants find however workers. About genetic peasants come welsh, marine men. So federal eyes develop. Home old services Books mystery 4.32 7859.96 2.57835559188307223 +AAAAAAAAADIAAAAA White changes come much matters. Books mystery 3.16 3490.58 1.14503845591010823 +AAAAAAAAAEMAAAAA Later other operations see; expected, honest animals show respons Books mystery 2.82 18416.84 6.04140000697406092 +AAAAAAAAAENDAAAA Royal advantages succumb again english, new regulat Books mystery 0.58 3081.67 1.01090095583671001 +AAAAAAAAAFEBAAAA Centra Books mystery 1.36 6619.98 2.17159660496416018 +AAAAAAAABEBBAAAA Countries keep much french, addit Books mystery 4.87 25157.14 8.25246599152989476 +AAAAAAAABHODAAAA Always silver months must capture only left mass miles. Characteristics should fall total ways. Courses might work in a spirits; key sources would live again up the records; thoughts can inspect ofte Books mystery 9.69 3901.52 1.27984187054942315 +AAAAAAAACDLBAAAA Primary, single engineers seem new centuries. Close ladies date. Necessary, likely hands cannot retain generally inc prices. Opini Books mystery 1.81 10328.03 3.38797320897766992 +AAAAAAAACGMCAAAA A Books mystery 0.11 6325.20 2.07489793711148765 +AAAAAAAACHLAAAAA Hills may not die reforms. Better Books mystery 5.64 2254.23 0.73947024232827876 +AAAAAAAACHLDAAAA Only present circumstances cannot fall from a players. Sharp relations will blame late eyes. Closest different problems should not write i Books mystery 4.33 9175.56 3.00992071647421134 +AAAAAAAACJMAAAAA Also strategic consultants proceed slightly eyes. Almost stran Books mystery 2.26 23865.71 7.82882951475068011 +AAAAAAAACMLBAAAA Now top documents might mitigate usually ethnic sheets. Big times come partly high records. Social years can seek social, major r Books mystery 2.68 5730.79 1.87990962325604602 +AAAAAAAACNOAAAAA Double workers ought to face with the objects. Satisfactory, other participants help politically urgent, Books mystery 3.56 2094.56 0.68709261733324441 +AAAAAAAADBBCAAAA National specialists go practical chapters. Enough right women stare again for example literary cameras. Most industrial cells shall improve possible, availab Books mystery 3.03 4124.34 1.35293501516891054 +AAAAAAAADEFBAAAA Fortunes could meet emotional meetings. Beautiful women replace beautifully in the things; less previous year Books mystery 5.11 102.48 0.03361720429317417 +AAAAAAAADJEAAAAA Available solicitors emerge. Further true weeks manufacture changes; families save up to right things. Gre Books mystery 3.50 2151.90 0.70590224354490139 +AAAAAAAAECCAAAAA Present, regular adults cannot l Books mystery 7.59 522.99 0.17155993045752497 +AAAAAAAAEDPBAAAA Especially simple sources absorb shortly accessible, new years; glad chapters restrict so southern districts. Modest, particular years could not discard only free men. Now black things could ge Books mystery 3.35 3104.40 1.01835723075458519 +AAAAAAAAEHBEAAAA Days must appear on the police. Direct, late developments should serve always for the papers. Meetings take yesterday women. Medium periods Books mystery 7.03 1997.98 0.65541082975874440 +AAAAAAAAEIDBAAAA Sufficient, whole judges may not show even almost vo Books mystery 75.13 1924.56 0.63132637289687040 +AAAAAAAAEIDCAAAA Words take here free goods. Efficient sales could not ask only. Please local women can talk less than useful permanent colleges. Always free members mus Books mystery 5.23 4082.90 1.33934117299571443 +AAAAAAAAEKFDAAAA Regional, able services should transfer old, social preferences. Other courts might talk a li Books mystery 1.16 954.39 0.31307497663312349 +AAAAAAAAEMAEAAAA Huge, difficult init Books mystery 34.65 621.18 0.20376985717051064 +AAAAAAAAENCDAAAA Difficulties would offer changes. Payable pounds give electric, sure weeks. Tired houses shall not get together most important pools. Bones shall not give foreign, new troops. Books mystery 4.33 12111.11 3.97288894503419799 +AAAAAAAAFMACAAAA Very dead processes may enable drugs. Early units work long police. Easily difficult opportunities ought to seem extra, common eyes. Just quiet subjects must finance ch Books mystery 4.70 475.66 0.15603395193297449 +AAAAAAAAGADCAAAA Also rich lines want noticeably often social difficulties. Animals go; sexual, central cats ought to tolerate. Groups sha Books mystery 3.23 150.35 0.04932032265299313 +AAAAAAAAGDFDAAAA Also significant Books mystery 4.93 1060.69 0.34794528124245618 +AAAAAAAAGGEEAAAA Fine, sure centuries would not form now angry, dead insects; customers cannot pray totally as male laws. Unique procedures reinforce rarely also Books mystery 2.81 5986.79 1.96388702664258571 +AAAAAAAAGGOCAAAA Intermediate, subj Books mystery 9.70 10978.67 3.60140702827227219 +AAAAAAAAGHMBAAAA Hot eyes must invest patently common laws. Whole arts discourage small studies. Policies could need. Reasons hope really independent, international departments. Effective, afraid attitudes Books mystery 0.97 251.85 0.08261605094882821 +AAAAAAAAGPFDAAAA Prices find under way around the languages. Civil, effective products should last really at a hundreds. Main, capable groups will contribute; only indian regulations take now in a feet; total Books mystery 2.73 625.40 0.20515417217946063 +AAAAAAAAHLEDAAAA Advances accept. Lists must not act also old comments. Objectives shall know as to the months; live years can pay possible, inc attempts. Russian years see further pro Books mystery 1.42 15186.66 4.98178231607119854 +AAAAAAAAIABCAAAA Clean systems can realise often s Books mystery 2.73 3145.42 1.03181329750035026 +AAAAAAAAIJCAAAAA Distinguished, huge levels return pretty characters. Months cannot ask right. Overseas studies c Books mystery 6.54 1642.06 0.53865599611289594 +AAAAAAAAIKNBAAAA Voluntary, clear techniques go. Before domestic students ought to live supreme, easy journalists; hands will run overseas such as the skills. Technical, official doctors would Books mystery 5.72 1966.05 0.64493661690666545 +AAAAAAAAIPDAAAAA Good, local rules follow normally high lines. Whole, male activities know again. Books mystery 4.01 5929.90 1.94522501696031914 +AAAAAAAAJABDAAAA Years will appear original Books mystery 4.79 1653.40 0.54237593265353407 +AAAAAAAAJBJDAAAA Problems eat very in a persons; dead ideas happen british things. Short bags should test usually to a others. Also inner visitors expose nevertheless coming, peaceful me Books mystery 4.72 5511.42 1.80794820536188504 +AAAAAAAAJOBEAAAA Expensive rates take as at once white careers. Parts drive all weeks. Therefore other years s Books mystery 0.55 181.72 0.05961083493516403 +AAAAAAAAKFDCAAAA Furthermore little classes say spots. Like days used to provide costs. Friends Books mystery 4.03 13223.74 4.33787245413562633 +AAAAAAAAKIABAAAA Years might give also. Ultimately private stars should make Books mystery 2.78 1284.36 0.42131725708412545 +AAAAAAAAKIKDAAAA Good, low facilities suggest too thereafter asian senses. Far holidays defend delicate members. Cautious reports treat on a talks Books mystery 0.25 5386.71 1.76703874451682502 +AAAAAAAAKNLDAAAA Strange, necessary weeks hope all. Dead sons know too. Heavy, social waters used to move pupils. Heels provide. Eastern trees used to allow currently bad children. Articles would not clear Books mystery 4.09 5477.40 1.79678839573997066 +AAAAAAAALFFBAAAA Bitter, nice students like general books; maximum, holy members draw indeed sure, strong lines; forests must not adapt opposite, r Books mystery 6.38 2322.45 0.76184890818386367 +AAAAAAAALPOAAAAA Everyday, low cases could contribute again through a developments. Useful, unable answers might not assign local da Books mystery 1.87 8562.04 2.80866362067065732 +AAAAAAAAMJLAAAAA Free, peaceful years should not help ahead animals. Then helpful others Books mystery 27.03 92.46 0.03033027623874789 +AAAAAAAANIHDAAAA Howev Books mystery 3.41 6376.36 2.09168029631951644 +AAAAAAAANPECAAAA Sorry theories decide there wages. Books mystery 2.59 4969.90 1.63030975426079530 +AAAAAAAAOEEDAAAA Other courses discuss full leaves. Connections excuse; objective, international sessions go. All expensive surve Books mystery 3.01 1617.54 0.53061253544477894 +AAAAAAAAOEHBAAAA Banks will employ of course real, dead resources. Sisters shall not go short effects. Hopes run c Books mystery 3.63 4915.26 1.61238582722548074 +AAAAAAAAOEMCAAAA Seconds preve Books mystery 4.51 2037.80 0.66847325242613507 +AAAAAAAAOGLDAAAA Right developments would not seek variables; numbers like impatiently Books mystery 3.84 11928.22 3.91289430712261892 +AAAAAAAAOIAAAAAA Limits ought to eat less; actual costs would smash more main rules; magnetic, constitutional expressions can head years. Quickly western children may not wonder also useless, other millions; comm Books mystery 10.39 6043.00 1.98232597134710679 +AAAAAAAAOOGDAAAA British, quiet residents trace particularly. Years should reduce now libraries. Special, general figures gain Books mystery 2.22 6385.64 2.09472447719227850 +AAAAAAAAPNKCAAAA Most small ministers appear agencies. Industries review so much as solicitors. Far from distant children hear still terms. Particular, available days learn already long-t Books mystery 3.79 3704.73 1.21528752206334055 +AAAAAAAAPPEDAAAA Sizes could not continue home; obligations will not lack notably current buildings. Measures burn there then useful thousands. Historic, Books mystery 7.35 5443.06 1.78552361436382311 +AAAAAAAAAAABAAAA Inches c Books parenting 0.16 4582.16 1.47127016656624148 +AAAAAAAAAAFCAAAA Certain signs prepare societies. Economic reasons can i Books parenting 0.98 1989.28 0.63873114796229133 +AAAAAAAAADLCAAAA Golden dogs could hear only available feet. Big, serious patterns used to use here with a days; otherwise long reasons should not trave Books parenting 1.58 566.43 0.18187308178852684 +AAAAAAAABCEDAAAA Luckily economic c Books parenting 9.18 122.92 0.03946796464425564 +AAAAAAAABEMCAAAA Men become most so living studies; private nurses come frequently in a feet. Points will Books parenting 1.38 4878.48 1.56641454732922415 +AAAAAAAACCOCAAAA Other changes mean. Miles form. Local, illegal authorities take again inside the figures. Players would love properly Books parenting 14.38 2483.90 0.79754700113786669 +AAAAAAAACPIAAAAA Popular circumstances should not take relations. Secret questions should get after the players. Automatic methods cope please in a effects; unli Books parenting 5.60 9646.64 3.09740682115084758 +AAAAAAAADLKBAAAA Original, able troops reduce jointly. Crowds move american feet. Cities move. Legs transfer loudly so central germans. Households could c Books parenting 4.02 877.39 0.28171817034838474 +AAAAAAAAEFBAAAAA Typical, right programmes tell against a reforms. Outside friends can inhibit again either military stairs. International men must launch legall Books parenting 65.75 4078.44 1.30953242534752647 +AAAAAAAAEKGDAAAA Favorite, small son Books parenting 1.77 4476.61 1.43737947613180297 +AAAAAAAAELEBAAAA Improved loans read years. Now constant tears perform now local negotiations. Specifically concerned problems ought to know more than previous steep plants. Cont Books parenting 0.48 5231.60 1.67979664686696862 +AAAAAAAAGCJDAAAA So plain prisoners make improvements. Contemporary roots will resume in the computers. Firms accept modern, present names. Essential, collective sons cannot examine in the d Books parenting 5.38 18382.40 5.90234228178136019 +AAAAAAAAGEOCAAAA Soft friends could make clean, brave feet. Rapid standards should not spread problems. Careers use quantities; british, other visitors should pursue wide, sudden sh Books parenting 4.17 7509.00 2.41103926548743546 +AAAAAAAAHCDBAAAA Crazy years could cry even clergy. Other, philosophical sides might take years. Already senior hours cannot believe early strengths. Fields will not find little jewish councils. Events might not o Books parenting 1.37 8851.94 2.84223930160325602 +AAAAAAAAHIEDAAAA Prime, flexible records say upwards at least easy schools. Here good investors can spend more at a cus Books parenting 7.33 6260.65 2.01021081069035995 +AAAAAAAAHMOBAAAA Arms shall get thus famous, clear conditions. Royal languages might not understand in a films. Scientific, notable views would achieve like a years. Large, nervous students Books parenting 2.05 2365.43 0.75950787185536616 +AAAAAAAAIBOAAAAA Main contents set within a communities; rules date at Books parenting 1.39 1973.40 0.63363229278371356 +AAAAAAAAICADAAAA Leaders restructure so. Years used to go from a years. Shoulders supply thus original tracks. Securely necessary Books parenting 2.01 2314.86 0.74327052258706151 +AAAAAAAAICBDAAAA Faces may occur existing houses. Ruling, annual arguments allow all but for a elections. Future, spanish subjects take. Then prim Books parenting 8.01 13033.96 4.18502987678687100 +AAAAAAAAIIKDAAAA High fields shall join then. Diffi Books parenting 1.11 3833.50 1.23088547399734770 +AAAAAAAAINOCAAAA Narrow, Books parenting 7.17 950.12 0.30507079863163167 +AAAAAAAAJFNBAAAA Very strong arrangements should not cover parliamentary, fundamental implications. Parents renew then; major, basic structures settle; only long-te Books parenting 7.59 3460.43 1.11109769682656629 +AAAAAAAAJLLAAAAA Pretty eastern facts should not join. Too labour things mean in particular. Closer intensive problems Books parenting 1.18 11548.91 3.70820022420834975 +AAAAAAAAJNFBAAAA New friends must not gather by a blocks. Empty opportunities ought to remind else single families. Early years should not use suddenly abou Books parenting 4.28 11681.79 3.75086621137015165 +AAAAAAAAKBJDAAAA Source Books parenting 8.78 5480.98 1.75986922271292103 +AAAAAAAAKDPAAAAA Good countries need once again. Most economic patients appear there only real trees. Apparently jewish policies Books parenting 9.76 3680.94 1.18190050258400862 +AAAAAAAAKGNCAAAA Small, true kids can go genuine objectives. Scottish games give ever. Scientific, similar trees remark. Boot Books parenting 8.58 10853.90 3.48504182763005404 +AAAAAAAAKHDDAAAA Widespread lands get curious, certain reasons; issues ought to accept sales. Easy, other others might bomb large payments. Econo Books parenting 4.78 8024.99 2.57671673926541680 +AAAAAAAAKHJAAAAA Forces can measure now groups. Resources form rat Books parenting 4.43 6742.48 2.16491996627563242 +AAAAAAAAKNFAAAAA Equal voices build. High streets would harm simply individual, black methods. Substantial rooms land as current savings. Again very opportunit Books parenting 7.81 26.70 0.00857301217053063 +AAAAAAAALEICAAAA Overall, high heads cannot see explicit, bad bodies; opportunities can accommodate little leaders. Light times u Books parenting 6.61 13341.53 4.28378648177900984 +AAAAAAAAMABDAAAA Meanwhile thorough roads put also more other trees. Never religious costs want just especially direct nights. Young, excellent aud Books parenting 2.67 3546.05 1.13858913135993082 +AAAAAAAAMAFCAAAA Common circles may win children. Tiny things must need as beside a words. Permanent yards remain fully. Slight, general ways avoid new, possible arts; therefore educational conditions ou Books parenting 4.26 9853.55 3.16384284917348778 +AAAAAAAAMCFBAAAA Sites will not manage most generally immense woods. Fine employers avoid in a men; reasons ought to think here; only corresponding areas Books parenting 58.45 12923.27 4.14948880123795580 +AAAAAAAAMGCDAAAA Records face long lips. Main researchers will know unequivocally ameri Books parenting 1.24 16478.74 5.29110256835243338 +AAAAAAAAMLACAAAA Corners would not descend often plain new activities. Just local trusts think Books parenting 8.15 9940.76 3.19184481139790637 +AAAAAAAAMMJBAAAA Open, large roads might tell friends. Used, old arms will drop as good as natural others. Sad programmes participate Books parenting 4.27 2597.90 0.83415087332664917 +AAAAAAAAMNKDAAAA Days could meet just. Folk might alter possibly tories; serious, basic things wait suffici Books parenting 5.54 8776.83 2.81812248721641872 +AAAAAAAAMPBEAAAA Stations may not reme Books parenting 0.88 3316.92 1.06501855912645951 +AAAAAAAAMPNAAAAA Economic, free bits post quite issues. Perhaps back sales used to affect d Books parenting 0.09 19263.00 6.18509114010979749 +AAAAAAAANDECAAAA Genuine cities say. Practices prove together elsewhere simple Books parenting 1.52 1712.57 0.54988327538897554 +AAAAAAAANPFEAAAA Se Books parenting 3.22 2194.90 0.70475297427332163 +AAAAAAAAOCAEAAAA Partners will not locate. General, other losses cannot restrict else protective kilometres; children carry unusual, long groups. Yet true reservations differ never long-term Books parenting 1.02 6482.66 2.08149524634502309 +AAAAAAAAOFDDAAAA Profits could not cling through a terms. Later democratic arms might not work all. Sometimes apparent arti Books parenting 6.57 0.00 0.00000000000000000 +AAAAAAAAOFICAAAA Else emotional lives declare also c Books parenting 7.67 4780.68 1.53501227803042655 +AAAAAAAAOKJCAAAA Previous floors keep complex computers. Books parenting 9.60 5787.26 1.85821162599344996 +AAAAAAAAOKKBAAAA Lists used to miss little names. Prime roads should not help from the minutes; in order various exceptions help Books parenting 1.19 4186.16 1.34411987369994445 +AAAAAAAAONDEAAAA Theories look. Just young regions Books parenting 45.83 1849.39 0.59381434374747746 +AAAAAAAAPCGCAAAA Foreign, simple stocks may draw still; Books parenting 2.55 18500.06 5.94012133091936148 +AAAAAAAAAKICAAAA Careful, long customers may think about just professional meetings. Students could not drink. British, basic commentators remember espec Books reference 1.77 6207.69 2.15509748883540916 +AAAAAAAAALADAAAA Bills emerge later in a yards. Ev Books reference 2.72 1496.80 0.51963772696266090 +AAAAAAAACEDCAAAA Examples will talk there estimated, short initiatives. Benefits ought to prove too negative Books reference 0.17 6141.90 2.13225745272044827 +AAAAAAAACGFDAAAA Sorry services must not recall much main details. Sexual, major secrets will not go results. P Books reference 7.54 1423.78 0.49428768231887850 +AAAAAAAACGMDAAAA Flexible, previous patterns must not manipulate essential, dull criteria. Much possible players will include firmly working, important duties. Far english busi Books reference 6.38 13587.29 4.71704201709145697 +AAAAAAAACLJBAAAA Funds shall call more able countries. Books reference 0.39 913.90 0.31727479868464444 +AAAAAAAACNAEAAAA Indivi Books reference 3.76 2162.13 0.75061752979541556 +AAAAAAAACOOBAAAA Hitherto certain kinds evade also by a months. Poor points might make even just selective passengers. Old, general qualities could overcome over; recent variables might s Books reference 56.16 1298.61 0.45083294268504882 +AAAAAAAADAJBAAAA Difficult, rapid sizes say so; initial banks stress high single sports; prisoners used to think likely firms. Good, current services must take human, precise persons. Signals m Books reference 7.77 9585.22 3.32766029745927077 +AAAAAAAAEDAEAAAA Royal, educational days can add black, long-term matters. Different executives should not remai Books reference 4.86 9194.30 3.19194625401709854 +AAAAAAAAEEDCAAAA Classical, labour books make in addition finally significant suggestions. Ethical figures could sell as the levels. Regardless plain scholars set in a companie Books reference 80.47 2466.20 0.85618022597228374 +AAAAAAAAEHNCAAAA Cruelly shared examples shall not investigate then in vit Books reference 0.28 610.19 0.21183708218555990 +AAAAAAAAEJABAAAA Male, small legs allocate today to a programs. Video-taped circumstances afford short, royal changes. Planned, appropriate names can enter usual periods. Very consta Books reference 4.40 9663.14 3.35471145438399721 +AAAAAAAAELGBAAAA Often other ideas must not understand possible, static groups. Late Books reference 8.13 705.22 0.24482824546272563 +AAAAAAAAENCEAAAA Possible solutio Books reference 2.63 10773.86 3.74031542023913264 +AAAAAAAAFGKBAAAA Still short documents ought to give more longer individual parties. Brief, expensive reforms should give now. As perfect sect Books reference 1.16 4401.20 1.52794599405936875 +AAAAAAAAGLODAAAA Great speeches would draw too particular, full things. Available, real lives shall like long, supreme skills. Grim men would n Books reference 4.95 7141.72 2.47936073450278901 +AAAAAAAAGPGBAAAA Ever only sides should not ensure clearly familiar, running points. Persons bear free, huge products. Organizations blame. Recent, parliamentary communities complain both perfect, l Books reference 5.85 4618.08 1.60323930660858167 +AAAAAAAAHJBCAAAA Dead, blue homes should write more small objectives. Systems could underpin all so blue exchanges. Better adult arts make very governments. Quick managers talk and Books reference 2.83 3913.25 1.35854645579678832 +AAAAAAAAHKEBAAAA Damp, happy roads Books reference 4.29 12407.36 4.30741070818241603 +AAAAAAAAIEPCAAAA Italian pati Books reference 4.42 7902.99 2.74364762146488472 +AAAAAAAAIFNDAAAA Classes used t Books reference 1.61 7530.59 2.61436308811313771 +AAAAAAAAIIECAAAA Dangerous parents would not advise almost previous, important matters. Books reference 7.62 1064.34 0.36950241736734266 +AAAAAAAAIMACAAAA Utterly free reasons control powers. Resources think too systematic sy Books reference 5.69 6131.92 2.12879273831966837 +AAAAAAAAINEAAAAA Therefore secondary countries get eventually prospective lives. Directly complete wings see as g Books reference 6.19 4028.40 1.39852259439897325 +AAAAAAAAJEFEAAAA At present pink police would not endorse yet bright rules. Photographs shall te Books reference 5.24 7033.41 2.44175920977849331 +AAAAAAAAJOGCAAAA Equal, strong requirements use broadly remote pictures. Books reference 96.89 15194.39 5.27497212866393982 +AAAAAAAAKAMAAAAA Relative, possible papers may change only current, tropical services; following procedures bring ever delicious questions; never convenient women may want secondary ch Books reference 3.67 2.16 0.00074987806670186 +AAAAAAAAKELAAAAA Eyes alleviate yet; major women get that blue scientists. Wild interests suffer forthwith years. Women might complete in a commitments. Japanese, victorian Books reference 8.24 12242.59 4.25020820399238554 +AAAAAAAAKFHAAAAA Clear points create however from a bases. Social, wrong rates contribute. More whole legs find now now unha Books reference 0.65 9377.23 3.25545328861977061 +AAAAAAAAKGCCAAAA Glad, certain others ought to protect narrow, american friends; thi Books reference 9.25 2557.68 0.88793895076019410 +AAAAAAAAKMJBAAAA Long son Books reference 6.53 13751.99 4.77422021967747397 +AAAAAAAAKNPDAAAA Historical arguments can point much big times. Lines bri Books reference 7.40 4482.72 1.55624694776193163 +AAAAAAAALDIAAAAA Types shall serve quite possible emotions; hard weekends appear months. There difficult colours form probably. Rules know however green manufac Books reference 4.01 2684.41 0.93193526899775290 +AAAAAAAALHBAAAAA Also real addresses give in a advantages. Perfect, interested humans could fall never at a years. Sophisticated interp Books reference 8.60 936.71 0.32519364993532475 +AAAAAAAAMAMBAAAA Much political attitudes must not understand more. Holy years shall not link large friends. Now occasional supporters may write also. Southern difficulties used Books reference 3.32 7569.18 2.62776021524000108 +AAAAAAAAMDGCAAAA Actions cannot go perhaps publications; huge, willing girls wo Books reference 9.60 2251.62 0.78168539469779966 +AAAAAAAAMHHAAAAA Successful solutions find clearly as socialist problems; individual systems Books reference 9.20 2974.66 1.03270013421081565 +AAAAAAAAMKOCAAAA Too nuclear windows ought to contemplate for example active, constitutional appeals. Again short partners clear to the issues. There political sheets end s Books reference 3.51 295.80 0.10269163524556059 +AAAAAAAAMLJDAAAA Cities regard only. Operations used to make later; personal, written years used to interfere for a agreements. Obvious, sufficient protests tell. Issues pay effective own Books reference 2.70 445.16 0.15454431489490789 +AAAAAAAAMPPBAAAA Here special fruits sti Books reference 2.31 6938.36 2.40876110318589515 +AAAAAAAANCABAAAA Years decide pot Books reference 4.03 15341.75 5.32613047677004465 +AAAAAAAANINDAAAA Structures drop home revolutionary, formal hands. Ears Books reference 3.42 1450.10 0.50342508542794934 +AAAAAAAAOAFDAAAA Predominantly on Books reference 8.46 11177.59 3.88047665721577287 +AAAAAAAAOIPBAAAA Really different purposes answ Books reference 81.85 4832.22 1.67758138494355241 +AAAAAAAAOKBDAAAA Kinds play sooner; old causes would publish. Great, Books reference 2.90 463.44 0.16089050520014402 +AAAAAAAAOMPAAAAA Relations preclude most primary records. Hardly common f Books reference 3.01 45.64 0.01584464581679305 +AAAAAAAAPDEAAAAA Particularly natural children put hardly. Parties weep into a days. Heavy hands will not take mad, lonely children. Ye Books reference 4.55 1000.50 0.34733935450704318 +AAAAAAAAPEKCAAAA Little, num Books reference 4.79 11088.98 3.84971429819241545 +AAAAAAAAPFFAAAAA Democratic, fresh operations shall not explain fully decisions; contra Books reference 1.68 140.25 0.04868999946987787 +AAAAAAAAPOIDAAAA As progressive minutes apply as firms. Involved, Books reference 4.35 18398.21 6.38722877109947712 +AAAAAAAAAAGCAAAA Both gross guns ought t Books romance 22.07 2932.20 1.53691964340235494 +AAAAAAAAAAJCAAAA Matters care too expressions; economic Books romance 5.87 4968.70 2.60435598941862117 +AAAAAAAAACNCAAAA Internal, additional structures pretend trains. Useful payments should make fingers. Books romance 0.64 4689.33 2.45792353570560163 +AAAAAAAAADEEAAAA Following, very poli Books romance 1.59 7979.33 4.18238490491430082 +AAAAAAAAAGBDAAAA Likely weapons see. Items improve half. Short, human resources depend white, local texts; fully permanent way Books romance 6.42 22088.52 11.57775059057560371 +AAAAAAAAALIAAAAA Full days keep full, visible bottles. Big, domestic countr Books romance 4.62 11680.82 6.12252974184813303 +AAAAAAAAANADAAAA Teachers arise clear often old services. Other minutes could cost by a attempts; open conscious goods detect yet disastrous stones; thus slight men tell for a countries. Capitalist bodies wou Books romance 0.25 4832.22 2.53281967097801228 +AAAAAAAABCBDAAAA New, small beds will come instead in a stories. Female, other systems could not Books romance 4.36 9867.04 5.17183261654620160 +AAAAAAAACFGAAAAA Part-time architects buy. Silently national skills understand free parts. Only european millions shall not attend at all other informal words. Empty, redundant holes contain again acceptable relatio Books romance 1.12 1104.46 0.57890535071010332 +AAAAAAAACFJAAAAA Similar consumers will live once on a eyes. More likely teams pass particularly. Just other workshops Books romance 3.59 1239.88 0.64988606761534406 +AAAAAAAACGKCAAAA Future years can reform as before social suppliers; particular, judicial individuals resume vaguely remaining aff Books romance 0.52 6031.54 3.16144611757964666 +AAAAAAAACHJCAAAA Crucial, different affairs could not forgo; public p Books romance 5.62 4775.42 2.50304781512054902 +AAAAAAAACIDBAAAA For example new resources find perhaps necessary opportunities. Main systems move spontaneously necessary m Books romance 6.68 3560.08 1.86602444720136955 +AAAAAAAACIJDAAAA Rather aware thanks may not work with a chi Books romance 2.35 2220.62 1.16394328440493058 +AAAAAAAAEGDDAAAA Islands meet only for Books romance 6.79 2450.58 1.28447736843630822 +AAAAAAAAEIKBAAAA Minutes will defend. Now new courses could know definitely international forces. There capital accounts should not lift more pro Books romance 72.49 1876.47 0.98355623874743093 +AAAAAAAAFLJDAAAA More simple principl Books romance 6.44 6567.15 3.44218738018203917 +AAAAAAAAFOECAAAA Late, dark looks would not make citizens. Safe, great curtains use as by the children. Signs would prove neither romantic moveme Books romance 4.68 2862.64 1.50045960302479959 +AAAAAAAAGBGBAAAA Problems inherit. Sure edges must become enough revolutionary years. Systems burst however slowly strong issues; cultural site Books romance 1.60 775.70 0.40658501036327902 +AAAAAAAAGDNDAAAA Possible, common bars cannot rid mainly ultimate years. Drugs could bring of course large, good rules. S Books romance 3.33 273.51 0.14336092069673900 +AAAAAAAAGFLAAAAA Standard, geographical scales may hope equal, sure problems. Strong associati Books romance 7.58 4049.00 2.12229303462797052 +AAAAAAAAGKDDAAAA Probably just results receive perfectly on the countries. Bold girls will pass religious years. Here public conditions ought to consider most sources. Different, able years go rarely ita Books romance 5.44 1710.73 0.89668322132109361 +AAAAAAAAGLMDAAAA Even sure children build there imaginative novels. Real, quick members shall not exercise unlikely, vast times. Open regulations buy all catholic days. Domestic, palest Books romance 6.42 49.14 0.02575684853584057 +AAAAAAAAGOPDAAAA Silver, political interviews might know in common families. Far possible houses shall insist in a places. Whole, political gardens would adopt eggs. Others might live even offi Books romance 6.13 5432.94 2.84768849581419762 +AAAAAAAAHHLAAAAA Cultural, harsh conditions describe Books romance 4.72 1495.08 0.78364975801718601 +AAAAAAAAIAACAAAA Distinctive hours work more federal, proper plants; crimes may ensure therefore; players work increasingly previous, genuine needs. Hostile, young schools will offer very new, implicit changes; Books romance 47.76 1911.06 1.00168666998175583 +AAAAAAAAIBFAAAAA Particular bombs could illustrate suddenly planes. Western months expect just special, relevant readers. Able demands ought to achieve for a cars. Suitable counties must stud Books romance 0.88 1663.75 0.87205854195166361 +AAAAAAAAICDAAAAA Levels tear only. Colleagues may not see hot forests. So effective residents must help completely in a hands. However professional classes ought to seem very; political Books romance 4.81 1069.40 0.56052856785160575 +AAAAAAAAIHBAAAAA So only things know prac Books romance 2.71 3443.44 1.80488731221519852 +AAAAAAAAIHDEAAAA Ways used to contain only double cigarettes. Intensely increased feelings Books romance 76.83 18974.38 9.94546666099883214 +AAAAAAAAIJFDAAAA Views balance quite other degrees. Slow passages promote due major animals. Sons would say. Possible, other schemes cannot restart either important, new Books romance 3.75 745.80 0.39091285384676227 +AAAAAAAAIKODAAAA Premier, good budgets could put high, slow members; traditions could not join however. Students laugh for a effects. Carefu Books romance 9.00 1184.75 0.62098954625228157 +AAAAAAAAILNCAAAA Contacts remove basically blue, labour details. Full measures hold then families. G Books romance 66.85 845.81 0.44333333455635558 +AAAAAAAAIMDCAAAA Subject children would not like sufficiently great levels. Yet busy hotels must not help behind Books romance 9.33 1361.15 0.71345002817581182 +AAAAAAAAJDMBAAAA Large thoughts make Books romance 0.85 2228.59 1.16812077896802885 +AAAAAAAAJGBAAAAA Specially clinical muscles can pass causal, following changes. Dishes could use at present areas; even c Books romance 5.00 276.00 0.14466606015246230 +AAAAAAAAJJPBAAAA Teachers play apparent indians. Professional corners accept consequences; extensively necessary men will not know only economic clean stairs. Divisions could Books romance 0.78 379.40 0.19886341747044999 +AAAAAAAAJLBBAAAA Stages choose physically to a families Books romance 6.13 1969.70 1.03242296624023550 +AAAAAAAAKBEBAAAA Illegal technologies might distinguish that on a change Books romance 2.73 1019.24 0.53423708387607130 +AAAAAAAAKBLBAAAA As single women would get ideas. Rural classes may hear quite available, high sequen Books romance 1.38 894.27 0.46873375946573356 +AAAAAAAALCADAAAA Senior fans cook frequently. Fin Books romance 4.36 5607.44 2.93915308819320006 +AAAAAAAALMLAAAAA Mammals take at all. Profound weeks must know parts. Too low earnings can share directly new gaps. Equal block Books romance 4.99 179.00 0.09382327814235780 +AAAAAAAAMABAAAAA Fine, real rows could think short, united others. Twice moving molecules list enough really vague assessments. Days put with a lines. Importa Books romance 4.85 950.33 0.49811774255322283 +AAAAAAAAMAOAAAAA Associated words produce simply. Frantically tough forms take there across right years. Recent fears appear also fierce examples. Incredibly coastal te Books romance 2.28 99.82 0.05232089175514053 +AAAAAAAAMDNBAAAA Historical, new notes should say levels; largely low prisons present at once enough useful winners. Yet worthwhile sons give different, social beaches. Minutes want guns. Industrial Books romance 65.28 3120.61 1.63567519555208473 +AAAAAAAAMHDAAAAA Complete, foreign makers prevent conservative gardens; full prisoners would look so good goods. Then only cir Books romance 3.56 510.48 0.26756931299503245 +AAAAAAAAMLEEAAAA Local, strong letters should not make also ba Books romance 6.39 3270.83 1.71441336785680534 +AAAAAAAANDMDAAAA At all chemical branches make as existing things. Directly civil students must not afford much beautiful companies. Past police offer well perhaps chan Books romance 36.28 3753.37 1.96733786302336027 +AAAAAAAANIKAAAAA Minor democrats can wonder impatiently real backs. Early, Books romance 2.77 1091.04 0.57187122561138576 +AAAAAAAANMGDAAAA Surely local universities may know perhaps primitive computers. About bad sides will provide carefully about a workshops. National, sheer references ought to develop already also long-t Books romance 5.58 112.88 0.05916632199278965 +AAAAAAAANNDCAAAA Financial things will die only pai Books romance 1.33 1782.43 0.93426494781722240 +AAAAAAAAODHCAAAA Debts should not go into a eyes. Legal troops pursue wholly friends. Inc families will meet never; potatoes should give all various users. New women st Books romance 4.80 6935.94 3.63548954077488907 +AAAAAAAAPDEDAAAA Also genuine men identify. Gradual, useful things used to see below patterns; superb, hidden ways would fail even huge yea Books romance 2.08 1555.12 0.81511986762426513 +AAAAAAAAPENCAAAA Gains keep still. Possible, final clothes kill perhaps in the conclusions. Methods would proceed for a hopes. Other, particular ways find perhaps in a demands. Adverse, other men admit eviden Books romance 1.93 3352.42 1.75717896150839737 +AAAAAAAAPLHBAAAA Racial minutes used to come enough teenag Books romance 3.47 4982.66 2.61167315680894137 +AAAAAAAAACCAAAAA Then modern features should improve otherwise available qualifications. Personal purposes go with a years. Ministers remove big arts. Linear, poli Books science 4.66 527.85 0.17402980157734269 +AAAAAAAAAEJDAAAA Organizations make enough horrible requirements. Grateful, only funds reassure anxiously yesterday great years. Extra Books science 5.13 36276.15 11.96008560479287668 +AAAAAAAAAGIDAAAA Ac Books science 1.13 11382.07 3.75261794759766011 +AAAAAAAAAIBBAAAA P Books science 7.15 115.77 0.03816885503193893 +AAAAAAAAAMOAAAAA Confident views gain to the resources. Jobs could direct kings. Attitudes might not support as aware jobs. Happy accounts cannot test. Professional, joint interests will support in Books science 78.67 7479.68 2.46601728949894583 +AAAAAAAAAPLDAAAA Continuous members shall look usually about careful supplies. More than negative sports become probably other leaves. L Books science 47.51 97.92 0.03228378927811575 +AAAAAAAABEGCAAAA Obvious relationships put originally. Pounds give well central, british leaves. Differences ought to ask also central states. Tests grant for a chapters. Soon active heads should want Books science 4.26 2414.14 0.79593124027645368 +AAAAAAAABEHBAAAA Gently independent fears call now statutory sciences. Friendly, quiet needs stumble too. So famous cattle teach too only services; public forces collect pure friends. Arms might make im Books science 4.68 5668.22 1.86878696958743084 +AAAAAAAACAECAAAA Later other words comfort historic, social birds. Large, english interests muster there ag Books science 1.74 2463.16 0.81209291664913785 +AAAAAAAACAOAAAAA Ways create things. Popular opportunities regard eyes. Intact conditions show years. Variable banks could run legally. Sexual, mechanical dates shall not carry however fingers. Forms Books science 2.88 10151.52 3.34691107570034261 +AAAAAAAACDKBAAAA Now educational levels lift perhaps men. Types use not. Very environments might go for sure at once common p Books science 71.85 6430.06 2.11996223535172516 +AAAAAAAADCEEAAAA Little, able companies could not combine particles. Private kids participate in common; unable, only detectives introduce; very good skills go. Copies miss. Strategic m Books science 1.07 7269.76 2.39680759745174345 +AAAAAAAADNCBAAAA Regular teachers serve together events. Other arms would not use. Dou Books science 3.59 8847.06 2.91683640493103230 +AAAAAAAAEEEBAAAA Aware parts hang experienced, new groups. Handsome, perfect forms will grasp tonight in terms of the tears. Effective, economic subjects deny in the o Books science 3.18 38.60 0.01272624863291736 +AAAAAAAAENIAAAAA Just essential errors permit never too bad applications. Ideas could buy men. Anxious wives would not pull royal, common towns. Adults Books science 3.22 10051.00 3.31377007796508735 +AAAAAAAAFCPAAAAA Domestic copies cannot get additional victims. Pieces should not determine now british, gold depths. Local, available stocks punc Books science 3.99 3769.53 1.24279730593888526 +AAAAAAAAFPOAAAAA Complaints can involve very vital adults. A little practical initiatives remain traditionally important months. Clear new transactions create perhaps new, personal princip Books science 1.15 3928.72 1.29528154220505402 +AAAAAAAAGCCDAAAA Distinguished, assis Books science 6.29 16.68 0.00549932194811040 +AAAAAAAAGCCEAAAA Old prices help general trials. National, prime men ought to compete about a posts. Suspicious, extreme mistakes might not make gently other characters. Acc Books science 1.53 3227.96 1.06424408127232946 +AAAAAAAAGEHDAAAA Spanish ranks can deal all but conservatives. Local metres shall not go no longer with a processes Books science 2.91 4385.32 1.44582053510116972 +AAAAAAAAGGBAAAAA Particular ears ought to know streets; tears could pr Books science 1.38 4417.02 1.45627188436706299 +AAAAAAAAGIAAAAAA Useful examples might understand evidently. Royal shops ought to leave in order. Also huge experts stay continuous, long organisers. Often burning services flee global circumstances. Fine, ex Books science 2.78 7923.96 2.61249443309046200 +AAAAAAAAGJGBAAAA Accounts accept Books science 1.24 4454.22 1.46853655921536677 +AAAAAAAAGKEDAAAA Small years turn as beside a problems. Famous, significant attitudes defend again subtle machines. Pp. double less. Human men appear in a regions. Exclusively warm Books science 1.75 3606.79 1.18914265043316062 +AAAAAAAAHFDEAAAA Certain, long councillors smile then fresh eyes. Lights attend initially after a preferences; national genes admit. Wide single plans improve never Books science 2.09 2209.49 0.72845904383276100 +AAAAAAAAHGDAAAAA Problems could not find small, late years. Demands might get only normal, available communications. Quiet mothers leave women. Fair interes Books science 0.21 8916.11 2.93960188337929509 +AAAAAAAAHJPDAAAA Marks remember Books science 1.41 1407.04 0.46389484135906840 +AAAAAAAAHMDDAAAA Things prejudice unfortunately. Available lives used to get for an readers. Roughly good articles might express open years. Black m Books science 9.38 11566.26 3.81334457287478571 +AAAAAAAAHNIDAAAA Small, stupid members lack hands. Literary terms would understand sure ordinary acids. Lovely, Books science 0.22 2581.68 0.85116843447228203 +AAAAAAAAIHEAAAAA Conditions must like most still desperate concessions. Parts shall not raise sometimes places. Local, prof Books science 4.37 214.32 0.07066035251313079 +AAAAAAAAIJHBAAAA Male, major regulations could get. Books may not bring. Upper, musical girls take well special, curious parents. Criminal, equal knees stop just a Books science 3.41 7411.80 2.44363755485639582 +AAAAAAAAILGAAAAA Courts receive high male limitations. Political, little parents may establish tomorrow unique minu Books science 9.26 10412.18 3.43284952048418299 +AAAAAAAAIMADAAAA Local, contemporary tanks provoke yet. Well red quantities should spend only deaf new firms. Books science 2.13 6975.01 2.29962983101256232 +AAAAAAAAIMMAAAAA Young officers depend very well unnecessary players. Personnel will consider apart types. Most universal courses could enable arrangements. Magic, equal responsibilities detect; value Books science 5.89 6948.34 2.29083685041567357 +AAAAAAAAIOHAAAAA Pounds realise fairly formal, casual residents. Good areas shall stick etc disputes. So small police find variable, certain programs. Results think children; dogs will take prices. Old, traditi Books science 44.25 3791.67 1.25009676564698863 +AAAAAAAAIOOBAAAA Left times used to tell trees. Right t Books science 7.96 2094.92 0.69068582347334800 +AAAAAAAAIPCBAAAA So clear employees could tell experiments. Hands would control demands; well ethnic sites afford then bottom programmes; times flow easily premises. Alter Books science 1.28 10461.12 3.44898482121203209 +AAAAAAAAJLLDAAAA However major deb Books science 0.66 2219.28 0.73168676336945170 +AAAAAAAAJNDDAAAA Thereafter strange rates shall not inhibit now on a heroes; eyes may not provide. Books science 8.37 11495.90 3.79014719324234879 +AAAAAAAALAPCAAAA Due proposed concepts afford indeed yesterda Books science 1.34 10405.19 3.43054494851671946 +AAAAAAAALKJBAAAA Earnings feel possibilities. Single, poor problems make full, sho Books science 2.75 17541.34 5.78330192213830518 +AAAAAAAALNGBAAAA Direct schemes rival pa Books science 78.33 9776.79 3.22336425833730836 +AAAAAAAAMBLCAAAA M Books science 42.63 5228.32 1.72375389255063431 +AAAAAAAAMCPCAAAA Clear spirits shall not co Books science 2.11 1098.47 0.36216068227463034 +AAAAAAAAMLBEAAAA New, political bish Books science 1.33 1836.00 0.60532104896467022 +AAAAAAAANKOAAAAA Professionally uncomfortable groups would not protect again there dependent users. Standard fields avoid likely families. Independent, intact fortunes work in the Books science 8.28 64.98 0.02142361751727901 +AAAAAAAAOIDEAAAA Future, solar deaths stand much confident, prime horses. New, other hundr Books science 0.22 7461.07 2.45988165511918956 +AAAAAAAAOPDDAAAA Acts will not reflect as with the problems. General governments distract new, soft fires. Useful proposals restrict hard trees. Large, black customs go official Books science 3.05 12762.28 4.20766705707016963 +AAAAAAAAPGEDAAAA Royal, considerable rooms reply then often c Books science 0.79 3487.40 1.14978029747243514 +AAAAAAAAAECEAAAA Symptoms could not take else. Now rich Books self-help 8.22 4725.36 1.53069603755177003 +AAAAAAAAAFHBAAAA Normal sports will not afford from a women. Nearly past families would permit Books self-help 4.46 6912.33 2.23912593775928744 +AAAAAAAABFOCAAAA There main prices could bowl acres. Radical, domestic plants take long. Fresh developments wave sanctions. British, able men cover goals. There other men Books self-help 7.22 5298.60 1.71638690482244922 +AAAAAAAACCGEAAAA Results Books self-help 0.29 6602.84 2.13887217578942752 +AAAAAAAACDACAAAA About statistical blocks shall point so brothers. Even new affairs spend hopefully even old contexts. Possible officers wait absolutely with Books self-help 3.51 7809.11 2.52962181374665694 +AAAAAAAACDJDAAAA Facts shall provide al Books self-help 5.02 1138.39 0.36876112342521194 +AAAAAAAACDLDAAAA Men shall accept yet. Indians can continue obviously global, efficient times. Profit Books self-help 5.85 4729.95 1.53218288613311888 +AAAAAAAACIDEAAAA Proper, mutual feelings would bring right over the days. Prices ought to see thus electronic owners; most surprising definitions might not see in part big lads. Responsible, tory doors read good, a Books self-help 6.84 4062.63 1.31601648192708015 +AAAAAAAACMIBAAAA Early alternatives lie meanwhile european, new makers. Suspicious purposes speak new, overseas critics. Generally important police must refer approximately virtually other firms. British, appointed c Books self-help 2.07 157.85 0.05113269031937184 +AAAAAAAACPGDAAAA Settlements can see so scientific sales; jeans ought to disco Books self-help 0.78 10137.10 3.28373262614193372 +AAAAAAAADIFDAAAA Now christian papers believe very major, new branches. Annual wars include harshly so-called sites. Books self-help 5.23 8239.18 2.66893531470105824 +AAAAAAAADNCEAAAA Much g Books self-help 4.52 725.34 0.23496094771145497 +AAAAAAAADPNAAAAA Particular prisoners wait at a wag Books self-help 1.99 210.35 0.06813912834133586 +AAAAAAAAEAAEAAAA Good others run considerably excelle Books self-help 2.72 567.97 0.18398374482542681 +AAAAAAAAECBBAAAA Very concerned shares must form also rather nice gardens. Quietly available games may see quite. Short eyes repay. As useful variables should not produce there. Managers use so also total versions Books self-help 26.11 239.20 0.07748457094959609 +AAAAAAAAEHBCAAAA Creative churches like. Walls objec Books self-help 6.05 3579.99 1.15967386770001887 +AAAAAAAAEJCEAAAA Now environmental examples enter banks. Royal, new attitudes go prices; almost living tre Books self-help 7.75 779.81 0.25260553207443365 +AAAAAAAAEJJBAAAA Hot steps help right able councils. Provincial mammals ought to establish from a others; forests used to offer true, open practitioners. Key theories could not imagine exact, other races. Books self-help 4.63 8643.42 2.79988164814865324 +AAAAAAAAENMCAAAA Aware, a Books self-help 2.74 1189.77 0.38540475743604073 +AAAAAAAAEOFDAAAA Cultural notes ignore usuall Books self-help 9.32 5567.49 1.80348902138865697 +AAAAAAAAEPICAAAA Positive, recent adults cannot tell fortunately laboratories. Frequent performances may get labour buildings; vocational windows will talk; similar seeds must replace better. Other merch Books self-help 9.69 10154.63 3.28941115678050571 +AAAAAAAAFEAEAAAA Tonight single claims used to compete seriously. Frequently magic advances concentrate very political men. Again damp types will apply also pol Books self-help 0.56 8790.86 2.84764220475738421 +AAAAAAAAFFGAAAAA Areas increase well final, peculiar findings. Fat possibilities will say now at all sure dogs Books self-help 5.11 3770.90 1.22151575499093605 +AAAAAAAAGEPAAAAA Clearly legal servants should not investigate however early difficult women. Increased laboratories tell home samples. Still wooden institutions avoid undoubtedly. Policies will Books self-help 9.11 9124.75 2.95579991125554742 +AAAAAAAAGKLBAAAA Physical, political issues must not increase. Teeth go there particular prices. Words mi Books self-help 4.82 1881.44 0.60945890956274278 +AAAAAAAAGLECAAAA Old, acceptable respects imply around banks. Rights will not spare so existing reasons. Old eggs must claim. Patients might not stop there military, Books self-help 7.89 15529.28 5.03043310182334282 +AAAAAAAAGNJBAAAA National, dreadful opportunities give. Lucky, low rules should start away from the girls. Available words will not leave now. Stor Books self-help 5.53 6895.58 2.23370007419989892 +AAAAAAAAGPFAAAAA Dominant, useful restaurants might not say contrary eyes. Modest years may not confirm again just other stage Books self-help 3.87 12631.86 4.09186560365955223 +AAAAAAAAHAFBAAAA Various Books self-help 6.24 3437.60 1.11354916846292444 +AAAAAAAAHBBEAAAA There political deta Books self-help 8.83 4867.67 1.57679482221664051 +AAAAAAAAICMDAAAA Other, established programmes used to avoid good organisations. Forward, simple changes might enter straight. Papers cal Books self-help 1.63 3028.98 0.98118401218606844 +AAAAAAAAIECDAAAA Cards insist sad males. Instruments turn later instructions. Economic, white Books self-help 2.64 3883.30 1.25792572896557903 +AAAAAAAAIEDBAAAA Other, precious services can stem; grounds will set in particular friendly factors. Ports will provide. So complete moments diversify morally different, open pupi Books self-help 6.72 NULL NULL +AAAAAAAAIHIDAAAA Metres must not go more soft attacks. Northern, central changes see all right inherent metres; women shall reduce together always private efforts. Extra, secret dates ought to sa Books self-help 36.51 215.49 0.06980413960672434 +AAAAAAAAIPODAAAA Outside, remaining problems must come only new politicians. Readers would not tell right, modern products. Particular threats become legally among a beaches Books self-help 1.38 24121.05 7.81358365427991146 +AAAAAAAAJCEEAAAA In order excellent words could go old costs. Surp Books self-help 1.45 3398.74 1.10096116500514307 +AAAAAAAAJCMCAAAA Logic Books self-help 1.29 3676.91 1.19106937194932846 +AAAAAAAAJJOCAAAA Sufficiently great tears may see. Much short standards duck over a pap Books self-help 8.57 1508.73 0.48872615689291017 +AAAAAAAAJMABAAAA Again right years welcome to the months. Once competitive years could benefit great, social projects. Actually old expectations must not spin Books self-help 2.42 1824.90 0.59114378564346952 +AAAAAAAAKCEAAAAA Actions need qualifications. Expert sales see. Guests look evidently dead roots. Activities Books self-help 2.20 1248.95 0.40457506223870418 +AAAAAAAAKDCEAAAA Still social transactions provide both most existing vi Books self-help 6.50 2330.32 0.75486557431129919 +AAAAAAAAKHEBAAAA Prime even Books self-help 4.28 3438.17 1.11373380979002005 +AAAAAAAAKHMAAAAA Confidential, japanese reports discuss ever forms. Initiatives say now pregnant, sad sites. Neither round eyes may ask more w Books self-help 1.72 3385.13 1.09655244840554440 +AAAAAAAAKLCAAAAA Clever, informal negotiations study sharply with a leaders. Professionals come noble officials. Plans continue pa Books self-help 4.69 2768.44 0.89678672909573497 +AAAAAAAAKLEAAAAA British, Books self-help 1.52 4014.40 1.30039323419756920 +AAAAAAAALBBAAAAA Highly other times could stay no longer huge symbolic results. Most narrow police chan Books self-help 7.99 660.44 0.21393775099477944 +AAAAAAAAMBHAAAAA Hands can ensure. Dead schools concentrate by a years. Increased authorities should not stop natural, following guards. Principal years might secure. Long, criti Books self-help 4.23 4140.99 1.34139980542043446 +AAAAAAAAMCODAAAA Rights could not talk. Miners shall clear various outcomes. Relative, western forms locate communist, local prices. Items would not disappear probably likely women. Bare conclusions mark in gener Books self-help 8.57 3116.42 1.00950863962684053 +AAAAAAAAMHEDAAAA Other changes shall seek Books self-help 2.51 2862.54 0.92726874467415049 +AAAAAAAAMLOBAAAA So ashamed periods could give there on the operations. Potatoes must order very noble systems; labour years should not escape so formal, ready Books self-help 1.94 11014.72 3.56802196208166835 +AAAAAAAANBMCAAAA Also crucial weeks will consider just then close parts. Long values prove then reco Books self-help 3.91 65.52 0.02122403465141110 +AAAAAAAANDDDAAAA Sincerely important experiments should hear surprised, unchanged sorts. Else financial democrats will not start so major bodies. E Books self-help 1.90 5855.42 1.89675880614416367 +AAAAAAAAOACAAAAA Cities practise a Books self-help 2.94 9089.11 2.94425496932977984 +AAAAAAAAOJMCAAAA Nearly northern eyes would not use further buyers. Ever independent advertisements comment also nice, old schemes. Firm members would restore as a doors. Problems Books self-help 8.02 14009.14 4.53801087906699247 +AAAAAAAAOKBEAAAA Essential, modern goods help friendly roads. Cultures Books self-help 1.13 8764.28 2.83903208813597843 +AAAAAAAAOLEDAAAA Gentlemen construct. Inevitable proposals tell more subject troops. Feelings used to come thus a Books self-help 1.73 8962.10 2.90311234660273887 +AAAAAAAAONJCAAAA Miles kiss silently difficult streets. Less social rules see never Books self-help 7.03 283.44 0.09181532938943778 +AAAAAAAAONPCAAAA Yards shall build gradually steep, possible players. Foreign, wild lines used to understand vital layers. Problems shall go likely, parliamentary rats. Suspicious, wrong thousands Books self-help 7.63 7823.86 2.53439981300044683 +AAAAAAAAPEECAAAA Results Books self-help 9.21 3280.19 1.06255900829078431 +AAAAAAAAPPNDAAAA Smooth, othe Books self-help 8.62 11533.69 3.73613303141992873 +AAAAAAAAABJAAAAA Available, other responsibilities ban common, english authorities. Participants save little for a years. Well local plans look. As entir Books sports 2.98 624.68 0.24146901355107034 +AAAAAAAAAIOAAAAA Now beautiful results scream just official payments. Carefully Books sports 4.89 12518.36 4.83895120778186737 +AAAAAAAAAJABAAAA Agricultural elections go users. Popular customers could threaten upside down hard, able pages. European, interesting bases spend at a fingers. Books sports 2.47 7461.50 2.88423039734153702 +AAAAAAAAALMDAAAA Levels should rethink really typically other women. Elections respond long numbers. Firms might sum nearly present, personal homes. Again clear Books sports 3.91 6886.83 2.66209266599525798 +AAAAAAAAAMGBAAAA Very social engineers ask facilities. Numerous, stupid Books sports 7.36 4152.23 1.60503759066587821 +AAAAAAAABAGAAAAA Green levels provide. Students would agree. Very upper states get finally for a Books sports 1.29 4251.46 1.64339478189126194 +AAAAAAAABLKAAAAA In order Books sports 9.54 5723.96 2.21258720433787633 +AAAAAAAABMIBAAAA As specific characteristics contain for the hours. Free, double men avoid in the meals. Trying, potential institutions share above from the months. Contemporary problems could cheer only heav Books sports 1.58 1246.89 0.48198325271610120 +AAAAAAAABNPCAAAA Grounds ought Books sports 1.69 6467.35 2.49994337066900616 +AAAAAAAABOPBAAAA Completely particular voices shall not say straight. Used ideas must recall current colonies. New techniques could not make naturally old, great versions; great adults test Books sports 2.88 6653.24 2.57179884055600185 +AAAAAAAACBHBAAAA Procedures order here shops. Late static sciences shall not see cultures. Polite implications cover underway. That is right communications might not say cool principles. Strange keys Books sports 1.34 2498.12 0.96564412520362400 +AAAAAAAACDJAAAAA More big results develop again on a politicians. Characteristics live flowers. Children wipe perhaps appropriate roles. Wrong, external shows want somewhat little ways. Then difficult Books sports 3.64 4362.77 1.68642147699654727 +AAAAAAAACGPAAAAA Basic, functional circumstances must Books sports 7.87 2947.46 1.13933575379592397 +AAAAAAAACLNAAAAA Neighbours shall not represent overall dramatic trees. Random chiefs could not interfere basic, special fruits. A little poli Books sports 5.46 3974.85 1.53647164710487281 +AAAAAAAACPDDAAAA Immediately impossible teachers cut kindly busy, national products. Important, principal communities could die all very video-taped words. Short children doubt windows. Sometimes russian developm Books sports 96.08 4160.79 1.60834644440858994 +AAAAAAAAFBKDAAAA Twice detailed customers know women; economic, intense values listen wide industr Books sports 0.74 6802.45 2.62947571753614401 +AAAAAAAAFIECAAAA Sad, very sales could gather hence on a pounds. Issues see just within a things. Eastern directors put very in a initiatives. Books sports 3.99 5533.59 2.13899999791263899 +AAAAAAAAGBBAAAAA Sick organizations cannot cause to the situations. Direct nations seek to a genes. Able, invisible polls c Books sports 52.92 10879.04 4.20527479218581719 +AAAAAAAAGBECAAAA Letters help; international directions should hu Books sports 37.74 460.35 0.17794752575436260 +AAAAAAAAGCFDAAAA Appointments might not hold to a tickets. Proper, private areas describe and so on prime, natural calls. Miners shall receive typically safe units. Little times will develop pointedly very mus Books sports 6.13 3351.79 1.29562884185557735 +AAAAAAAAGJJBAAAA Ministers prove perhaps social processes. Aggressive characters could get open signals. Products try at all public, loyal councils; wholly historical respondents see there from a statements. C Books sports 7.24 13142.40 5.08017283039890319 +AAAAAAAAGJKBAAAA Likely days shall get. Great users would love even. However acceptable walls Books sports 8.23 2406.70 0.93030587647013029 +AAAAAAAAGPODAAAA Just average men might make so faintly free parents. J Books sports 1.41 9937.58 3.84135499725434718 +AAAAAAAAHACBAAAA Papers conceive over immediate victims. Local, expert members add ill over immediate tiles. Profits pay even. Tall classes begin for instance grand fields; ru Books sports 0.25 3880.85 1.50013610366855243 +AAAAAAAAHEJCAAAA Great, reliable children see french, proper dates. Public passages like closely traditionally academic books. Values used to distinguish leaders. Much key oper Books sports 31.97 1293.62 0.50004665638396557 +AAAAAAAAHLHDAAAA Dual months should survive only large, political eyes; new, new merchants pass fairly conseque Books sports 6.26 4192.74 1.62069666369359458 +AAAAAAAAIACEAAAA Conversely good eggs would not call too. Police happen present courses. Fine procedures finish well forward private Books sports 6.31 6912.27 2.67192645562313022 +AAAAAAAAIAMDAAAA Real, japanese systems would need downstairs for the phrases; level waters might not go about existing, little friends. Nation Books sports 5.90 2794.92 1.08037167086213344 +AAAAAAAAIBLDAAAA Devices take truly afraid, great men. Both true parties hurt even with a proposals. All internal candidates prevent more. Distinctive, prime women would say. Little, english departme Books sports 0.63 1050.56 0.40609221821766738 +AAAAAAAAIHLCAAAA Parents prevent alone little children. Cases might dispose again lives; very strange windows violate officially. Improved, cheap critics should alert plates. Expressions build c Books sports 5.56 4342.45 1.67856681484095121 +AAAAAAAAJBBCAAAA Wrong others miss less to the respects. Especially other standards start in order regula Books sports 7.53 11059.22 4.27492307108322362 +AAAAAAAAJCCDAAAA Adults will foresee most left, social children. Different eyes make personal counties. Readers would not admit more musical proceedings; titles take here away fast institutions; bird Books sports 3.83 10985.10 4.24627210853535058 +AAAAAAAAKEOBAAAA International, coloured contexts think. Relevant, british conservatives ought to happen ago. Perhaps human shops must see animals; rights must h Books sports 44.83 10933.78 4.22643444801245737 +AAAAAAAAKMFBAAAA Years should comment then central, internal implications; directly collective feet may find around extra, victorian crimes. Short Books sports 2.75 1868.42 0.72223463901372038 +AAAAAAAAKNODAAAA So single phrases could not sum; desirable friends see times. French efforts think Books sports 4.59 4611.30 1.78249033455217177 +AAAAAAAALEHDAAAA Central, visible moments Books sports 57.64 1362.54 0.52668756759280813 +AAAAAAAALJLDAAAA Old, straight enemies obtain however years. Largely social questions disrupt never. Measures rule fine, extensive trees. Already economic friends would not show more beautiful engines. Systems ret Books sports 9.99 4644.12 1.79517685088812959 +AAAAAAAALNHAAAAA Freely proud children cannot continue countries. Rates shall not look applications. Compl Books sports 4.13 886.97 0.34285677618843706 +AAAAAAAAMDOAAAAA Already secondary year Books sports 72.51 8152.72 3.15142033706550904 +AAAAAAAAMLOAAAAA Developers ought to recognize again. British, fast artists shall experi Books sports 79.00 2317.17 0.89569820408870728 +AAAAAAAAMOFEAAAA Paths check still international attitudes. Immediate Books sports 0.37 2211.39 0.85480912127281399 +AAAAAAAANDFBAAAA All capital bacteria make jobs. Again appropriate eyes may not leave others. There fixed ways Books sports 0.32 7910.07 3.05762438371632671 +AAAAAAAANDNCAAAA Papers occur critically relatively happy numbers; related, soviet genes experiment governments; voluntary devices Books sports 2.52 3864.91 1.49397452321775512 +AAAAAAAANMJDAAAA Indeed similar changes might drink too national careful areas. Wise, good rooms give large opportunities. Various patients shall research directly plants. International hands can get pieces Books sports 9.31 3710.53 1.43429919134861534 +AAAAAAAAOCLBAAAA Here familiar rooms would not believe particularly new, fresh rights. Levels allow then wives; temporary, big ears may sound always others. Lovely, essentia Books sports 9.23 1808.93 0.69923887859854273 +AAAAAAAAOKLCAAAA Lines might clear too high eyes. Great women balance as the things. Natural requirements Books sports 8.76 5395.16 2.08549011197764081 +AAAAAAAAOLJBAAAA General, local thanks must soar actually about p Books sports 22.08 7752.94 2.99688604392750734 +AAAAAAAAOMFAAAAA Inc others look in the varieties. Cold methods write values. Partners will make often times. Democratic, dramatic personnel shall not see Books sports 3.64 473.00 0.18283736218488870 +AAAAAAAAOMKBAAAA Others used to coincide there so as historical sites; syste Books sports 4.08 4391.31 1.69745356646114923 +AAAAAAAAOMMAAAAA Poor, major pairs affect complex, redundant results. Different animals could find so great, honest designs. Dull, linguistic studies might not get more cons Books sports 33.21 1010.07 0.39044087615663959 +AAAAAAAAPLNBAAAA Open prod Books sports 2.74 12438.41 4.80804666844427361 +AAAAAAAAACIBAAAA Bloody masters pull only women; shops take aggressively also legal cells. Continually underlying grounds would interfere. Entries shall not separate. Senior techniques see in Books travel 2.25 4171.41 1.64665291182793628 +AAAAAAAAACKCAAAA Active, mi Books travel 1.40 12936.19 5.10652631399441219 +AAAAAAAAADDEAAAA Voluntary others will imply again international, important birds; ill old publishers can get dark powers. Features stretch now progressive procedures. Tough n Books travel 1.83 3612.43 1.42599705573765030 +AAAAAAAAAGAEAAAA Cold terms shall comply only early claims; head, different politicians shall not commend good, foreign organizations; criminal, po Books travel 1.03 5504.86 2.17302872367020583 +AAAAAAAACACEAAAA Operations s Books travel 1.00 193.62 0.07643097580629212 +AAAAAAAACBLAAAAA Applications might gather rather out of a problems. Scales could observe presumably for a directors; totally empty questions will forget. Just, symbolic question Books travel 21.48 5351.75 2.11258896173599765 +AAAAAAAACDDDAAAA For example influential subjects shall work for example. Modules should persuade aside overall preliminary relatives. American, available reasons may use to the weekends; streets used t Books travel 2.18 6997.28 2.76215751673304277 +AAAAAAAACGADAAAA Similar sides assess more yet complete improvements. Bacteria would stay; general, curious trends used to reac Books travel 1.61 221.43 0.08740889873353613 +AAAAAAAACHBBAAAA Communist, small cases may not turn other rules. Little, forward men should assist quite available technique Books travel 2.29 16204.92 6.39684871636659094 +AAAAAAAACPDCAAAA Conflicts could give really sole institutions. Then advanced proceedings could not receive. Black experiences shall Books travel 1.91 5880.48 2.32130371144192077 +AAAAAAAADACCAAAA Leading players will sa Books travel 4.51 262.65 0.10368038320174892 +AAAAAAAADADBAAAA There european members turn; industrial, honest leaders cut exactly happy, consistent reasons. Incidentally european millions worry at first aware Books travel 3.81 2395.24 0.94551456714318326 +AAAAAAAADEPDAAAA Deliberately ordinary procedures will not pay by a months. Feet reach very s Books travel 9.43 1776.74 0.70136335065629308 +AAAAAAAAEEHCAAAA Good, national parts remove animals; Books travel 2.57 3370.45 1.33047609960911726 +AAAAAAAAEIICAAAA Odd, artistic databases open now; female, left days use all obligations. Simple, early sites may not hesitate statements. Left, free s Books travel 2.31 9717.76 3.83605970174234756 +AAAAAAAAEJPAAAAA However solid hours visit painfully things. Clubs must take most other words; officials will follow necessary developers. Alternative, great decisio Books travel 2.68 1892.11 0.74690534879063830 +AAAAAAAAFEBAAAAA Finally surprising cells cannot look better points. Elections might choo Books travel 1.98 3145.02 1.24148821160161580 +AAAAAAAAFGBEAAAA Right schools go now; average, invisible hands should get also good persons. Usually good ministers will make. Notes ought to stem average words. Heavy, certain suggestions summaris Books travel 4.55 337.50 0.13322721999082528 +AAAAAAAAGEEDAAAA Thanks could talk well individually national records; just simple officials go then encouraging, remarkable needs. Signals assess now. Upper, cheap pp. would not see. Hard trousers shall send whol Books travel 4.23 6920.66 2.73191197719023675 +AAAAAAAAGFHCAAAA Reports used to think characteristics. True types break extremely deliberately white tasks. Courses must cost. Economic, nervous resou Books travel 0.74 1273.19 0.50258833842998175 +AAAAAAAAGMGCAAAA Dear signals know finally. Positions answer payable payments. Superior babies can exis Books travel 1.78 16390.16 6.46997170964392568 +AAAAAAAAGNFBAAAA Horizontal problems continue members; modern, other interactio Books travel 8.51 2371.88 0.93629326978322569 +AAAAAAAAHAECAAAA Open conditio Books travel 8.17 9456.37 3.73287670016189772 +AAAAAAAAIACAAAAA Practical writers used to succeed recent arms. Books travel 9.48 10115.82 3.99319281934100804 +AAAAAAAAIFJAAAAA Members show yards. Economic stones get newspapers. Only magic views lea Books travel 9.23 1653.26 0.65261995176898313 +AAAAAAAAIGDAAAAA Investments ought to use still also professional developments. Only fresh visitors know steadily never main occ Books travel 1.37 4036.41 1.59336202383160616 +AAAAAAAAIGEEAAAA Conclusions might take on a ch Books travel 4.48 4341.46 1.71377969333738765 +AAAAAAAAILBCAAAA Small, original things announce in addition at last other functions. Best political women make even old materials. Downstairs wet arr Books travel 0.34 8289.45 3.27223815926799005 +AAAAAAAAIMLAAAAA Again english deals cut for the cases. Yet normal systems reach biological, original reasons. So other remains spread steadily. Much inadequate members consider Books travel 1.92 7192.94 2.83939377706905721 +AAAAAAAAINFCAAAA Later severe rules would Books travel 1.57 3713.31 1.46581916522705609 +AAAAAAAAINIDAAAA Movements may describe quite southern, nervous views. Young notes imagine. Sensitive women might excuse then sales. Proportions may not exist only from a controls. Are Books travel 2.49 6651.86 2.62580389797976612 +AAAAAAAAJGKDAAAA That is fine terms know to the goods; useful colleagues us Books travel 6.31 6202.60 2.44845971767434933 +AAAAAAAAKBODAAAA Yesterday long babies may not include as else able companies. Large, true d Books travel 4.19 1813.84 0.71600847617232157 +AAAAAAAAKEKBAAAA Words see low courts. National, democratic plants avoid. Days should go stupid, apparent days. Dependent hours should not want police. Also urban wages shall not define so great, typic Books travel 8.88 8312.77 3.28144366673520796 +AAAAAAAAKGPBAAAA Masses can contain as. Military men retain in a earnings; british, related instructions shall know different, precise needs; favorite Books travel 5.09 959.36 0.37870478746784635 +AAAAAAAAKIIAAAAA Behind relevant areas find then necessary papers. Copies might come envi Books travel 7.07 7437.38 2.93588581160107894 +AAAAAAAAKLHBAAAA Remarkably good bishops would deprive transactions. I Books travel 0.59 7014.30 2.76887611609376528 +AAAAAAAAKNEEAAAA Running businesses find emotions; Books travel 4.40 2300.61 0.90815962839434831 +AAAAAAAALJDCAAAA Pink, central countries shall defend rapidly Books travel 6.87 6536.14 2.58012373828394893 +AAAAAAAALNEAAAAA Local, conservati Books travel 1.68 8121.86 3.20608245616202735 +AAAAAAAALNHDAAAA Strong women know also also obvious votes. Private, natural areas should play strongly for Books travel 2.11 184.12 0.07268087628062445 +AAAAAAAAMENAAAAA Colours meet certainly hours; aw Books travel 1.63 5441.98 2.14820701228347073 +AAAAAAAAMHJAAAAA Too full weeks might obtain most today vital cities. Police shall take for example full sto Books travel 3.82 5904.69 2.33086054402259597 +AAAAAAAAMKAAAAAA Exceptional hundreds compare else then previous scientists. Rapid, popular differences get exactly now social persons. Naturally fundamental dreams hold on a changes. Brilliant birds pursue te Books travel 5.39 3124.51 1.23339194409935853 +AAAAAAAAOBIDAAAA British leaders can focus. Different workers cannot breathe only in an objectives; arrangements might enter predictably hours; reduced, effective phases operate ready men. Others say o Books travel 4.95 1624.50 0.64126701888917236 +AAAAAAAAOHHBAAAA Yesterday public notes work at least students; accidents might not apply today rural, subject premises. National, particular organisations could not endorse simply under a respondents. Sti Books travel 9.83 531.86 0.20995030881280099 +AAAAAAAAONIAAAAA Maybe gastric variations will see as. However physical plants would not choose for example wi Books travel 6.36 1691.34 0.66765192965713314 +AAAAAAAAPMICAAAA Little arts can grow directly rights. Full, slim argum Books travel 4.77 16542.31 6.53003251415238218 +AAAAAAAAPMNDAAAA About right clothes must get thoughtfully to a cases. Eastern improvements Books travel 98.75 2730.37 1.07780623598918408 +AAAAAAAAPPDEAAAA Countries want incorr Books travel 63.33 473.46 0.18689706541290708 +AAAAAAAADKHCAAAA Fields would die clear horses. However new problems go nasty, smooth ways. Interested others go great societies. Familiar patients shall seem trends. Yellow, r Home NULL NULL 7995.48 34.64319649767261090 +AAAAAAAAGAMCAAAA NULL Home NULL 0.87 14048.70 60.87087637475838958 +AAAAAAAAHGGDAAAA NULL Home NULL NULL 116.76 0.50590328824138814 +AAAAAAAAAEPBAAAA Neat, desirable words make especially gradu Home accent 7.11 1583.88 0.73384072874422647 +AAAAAAAABCDBAAAA Common males protest probably statements. Subsequent, main ways begin then titles. Rights come therefore interesting, ordinary thin Home accent 8.82 1429.40 0.66226730413099308 +AAAAAAAABCNAAAAA Offers go odds. Black, certain readers prove again in a cases. Public, black things watch as else modern forces. Difficult, new crops comp Home accent 3.59 4707.69 2.18115934307012370 +AAAAAAAABDMDAAAA National, round fields would not accomp Home accent 0.17 1970.93 0.91316811090730250 +AAAAAAAABDPDAAAA More general applications work also moves. Final, equal instruction Home accent 33.79 1466.94 0.67966027642501678 +AAAAAAAABIDBAAAA Severe plants filter fair with the days. Both great hills bring still. Military standards ask now for a conditions. Ago new proposals may like particularly men. Then alone a Home accent 5.54 6369.32 2.95102307649896240 +AAAAAAAABMNCAAAA Present, good grounds fall students. Big, long nerves remain events. Important, black years must not use principles. Fatal mines cannot order hospitals. Forces apply elsewhere; now final members Home accent 5.37 187.59 0.08691389644741359 +AAAAAAAACBIAAAAA Terms must work slow signs. Just american movements make surprisingly Home accent 0.26 481.20 0.22294880841460324 +AAAAAAAACBIDAAAA Discussions could inform; legitimately potential miles remember again from the factors. Then administrative changes may Home accent 2.20 1475.60 0.68367261366705848 +AAAAAAAACLEDAAAA Ago light fingers blame enough green, british years. Children go general stands. Economic, great numbers affect deputies. Purposes urge annually. Always electrical ways vote judicial, regular ac Home accent 6.86 11873.28 5.50110895256222018 +AAAAAAAADCIDAAAA Days shall want later romantic, american changes. Reasons read; great reasons may occupy economically. Strong, new films go then objects. English relations would resolve over. New, crazy feelin Home accent 1.78 715.86 0.33167110139583931 +AAAAAAAADIJCAAAA New, large words stop more strong cars. Back views leave other, young shoes. White conte Home accent 2.81 9585.07 4.44093918343840622 +AAAAAAAADKJDAAAA Decades try then. Different leaders stray examples. Things would not participate too good, good messages. Exactly new thanks can forget; companies u Home accent 3.51 4955.85 2.29613643429241784 +AAAAAAAADNPDAAAA Very afraid concepts will not disentangle with a days. Long-term, civil points c Home accent 8.15 3501.80 1.62244833189164095 +AAAAAAAAEEPAAAAA New measures shall pay under a agencies; comparatively heavy police shall beat similarly concepts. However japanese times cannot check like a police. Long, long-term auth Home accent 1.87 5547.93 2.57045798559357804 +AAAAAAAAELJCAAAA Useful, n Home accent 9.44 3014.70 1.39676594498650122 +AAAAAAAAFAJCAAAA Days give briefly vulnerable months. Sexual feelings create just animals. Charts study; changes knock rapidly aware sites. Schemes include sufficiently. For example speci Home accent 7.15 303.87 0.14078855863039378 +AAAAAAAAFKLCAAAA Connections must not come right finally certain parties. Wild parties fi Home accent 2.55 1293.30 0.59920967149336320 +AAAAAAAAFOADAAAA Little powers reach by a subjects; traditional insects make also others. Numbers shall make. Products take serious, military rules. Curiously economic methods approac Home accent 3.52 99.03 0.04588241998607265 +AAAAAAAAGCJAAAAA Old buildings must proceed; Home accent 9.33 595.01 0.27567907417866391 +AAAAAAAAGEPDAAAA Additional eyes give nationally. Territorial groups should talk previously strange differences. Small discus Home accent 6.07 18159.55 8.41365343691896978 +AAAAAAAAGHFBAAAA Almost busy pounds lose at last for an factors. Good mothers would Home accent 1.45 2292.51 1.06216203819318802 +AAAAAAAAGKMDAAAA Benefits might choose only by a directors. Continued eggs must not make much black, back arrangements. Living, Home accent 1.62 9494.68 4.39905983432661074 +AAAAAAAAGNOBAAAA Holes may avoid of course genuine Home accent 3.27 409.64 0.18979374455311320 +AAAAAAAAGOEEAAAA Supporters will laugh well indirect, old reductions. Men can increase critical words. Eyes ought to drift better parties. Other, social goods avoid costs; similar, substantial days learn; Home accent 63.79 5475.88 2.53707589572185700 +AAAAAAAAHKFAAAAA Main, powerful kilometres should like certainly political directors. Left families go tall, clear organizatio Home accent 0.18 11613.93 5.38094732857567124 +AAAAAAAAHOAEAAAA Promptly soviet faces could confirm now consistent new procedure Home accent 1.85 5675.68 2.62964690968951645 +AAAAAAAAHPCEAAAA Old events can try far natural genes. Primary months explain at all par Home accent 0.15 20335.22 9.42168135463177076 +AAAAAAAAIEODAAAA Women should hear among a pages. Everywhere main techniques go just unlikely principles. Broad, willing differences can make also short, modern roots. Together sorry thoug Home accent 8.25 1632.64 0.75643213335415177 +AAAAAAAAIKDBAAAA Attractive, pale rights stop in a delegates. Answers go as; variable, alone roles ought to relax quickly concerned, detailed parents. Poor, physical matches would send as for a details; cent Home accent 1.45 989.82 0.45860180703437776 +AAAAAAAAILOBAAAA Ancient periods will not see in a affairs. Fun Home accent 4.09 8014.62 3.71332082064806196 +AAAAAAAAJNKCAAAA Perhaps material e Home accent 6.64 2552.44 1.18259238684490834 +AAAAAAAAKMBDAAAA Here german thanks trust further remarkable towns. Other years Home accent 2.04 7200.88 3.33630011541261051 +AAAAAAAAKOEAAAAA Supreme others can decide. Unfair, short presents give. Activities give simply police. Dark, impossible Home accent 0.13 2033.98 0.94238033528498482 +AAAAAAAAKOEBAAAA Still different holes ought to enjoy early problems. Mammals see usually. Powerful, public Home accent 6.84 1085.87 0.50310353822353537 +AAAAAAAALGMCAAAA Always potential wages shall not restart sometimes at the efforts. Mere, high weapons would not go there physical pr Home accent 66.58 7246.44 3.35740890118021093 +AAAAAAAALIMDAAAA Boys ought to answer. International citizens call areas. All quick cuts might back most white, central amounts. Strong mice make on a lines. Cultures would dismiss changes. Left chil Home accent 5.45 18131.76 8.40077781891015469 +AAAAAAAALOADAAAA Most main firms would know highly for an companies. D Home accent 1.31 5733.85 2.65659814033265334 +AAAAAAAAMBBDAAAA New investors think especially secondary parties. Farmers detect adequately. Hum Home accent 38.04 1460.72 0.67677843605024781 +AAAAAAAAMDCAAAAA International, nice forces will turn modest ways. Trees might not deal eastern others. Responsibilities ought t Home accent 2.75 6806.25 3.15346077986677743 +AAAAAAAAMOFDAAAA Quite political women like home seriously formal chains. Certainly male lips Home accent 4.86 1551.13 0.71866705152980782 +AAAAAAAANGKCAAAA Rules meet as; authorities shall not kill moreover near a Home accent 3.55 651.58 0.30188899540063836 +AAAAAAAANMBCAAAA Also possible systems could go forward. Local, british babies d Home accent 2.53 2797.54 1.29615172379922932 +AAAAAAAAOCADAAAA British results cou Home accent 4.30 118.60 0.05494956084366572 +AAAAAAAAOFFEAAAA Simply perfect shareholders come others. Other, tired eyes contact therefore educational jobs. Over cathol Home accent 7.12 11929.65 5.52722621010654933 +AAAAAAAAOIKDAAAA Enough labour losses demonstrate also quickly happy women; near available things might surrender also ge Home accent 1.26 1093.19 0.50649502882535352 +AAAAAAAAPABAAAAA Royal children Home accent 3.70 188.00 0.08710385698658647 +AAAAAAAAAALAAAAA Future, real fears mean far interests; ill, mean payments speak far so labour lights. Already other applicants might not go so powerful lengths; japanese, central modes boil. Old homes ough Home bathroom 1.70 19546.11 7.34362930968507144 +AAAAAAAAAAOAAAAA Also eastern matters should not enable now irish, Home bathroom 3.46 2574.19 0.96714369931910820 +AAAAAAAAABFEAAAA Quite public shoulders help even ministers. Short, tall groups cannot overcome too other notes. Thus surprising reasons find Home bathroom 1.77 11046.40 4.15022051991445731 +AAAAAAAAAEHCAAAA In Home bathroom 0.42 1225.60 0.46046768804381146 +AAAAAAAAAHKDAAAA Necessary, p Home bathroom 8.13 5680.58 2.13423918027734537 +AAAAAAAAAJCAAAAA Letter Home bathroom 9.54 6366.89 2.39209131717465953 +AAAAAAAAALCEAAAA Modern companies shall not become also old, grateful agents. Enough joint programs approve titles. Jeans will not fall already wrong teachers. High, silver children manage a Home bathroom 2.28 16790.19 6.30820820097611185 +AAAAAAAAANBAAAAA Detailed, unhappy groups play old, human others. Well anxious councils will study whole, democratic employees. Educational, english customers get more. Explicitly cold deci Home bathroom 79.37 2249.42 0.84512502189907830 +AAAAAAAAAPICAAAA Pp. may not record also human rocks. Extraordinary, industrial measures may not operate only out of a officials. Ready subjects show clearly new things. Projects should enable Home bathroom 3.56 11356.89 4.26687408752274959 +AAAAAAAABLEAAAAA Here economic areas develop too sole processes; grateful, new children pass shares; fat, proposed aspects affect gmt on the terms. Years remind e Home bathroom 6.16 5399.13 2.02849617211813296 +AAAAAAAACGECAAAA Appropriate, active areas change alternative books. Clients will not look now only, other rates. Usually effecti Home bathroom 2.89 2344.36 0.88079473657179327 +AAAAAAAACLKCAAAA Employees watch never at the imports. Cases resist actually reliable prices. Alive, var Home bathroom 7.17 2759.95 1.03693521182809843 +AAAAAAAACONAAAAA Very oral hands ought to smoke military, independent issues. Moving sons play. Patients contradict to a measures. Other cattle enable significant goods. Initial, possible groups let soci Home bathroom 7.17 3821.04 1.43559518172562445 +AAAAAAAADHLBAAAA New sports will give now students. Scarcely free countries damage there prime, necessary members. Big units should not fill probably mental child Home bathroom 4.29 1777.37 0.66777207465602902 +AAAAAAAAEABDAAAA Unions last moving pur Home bathroom 2.72 3881.21 1.45820153028110433 +AAAAAAAAEBAAAAAA Indeed political miles imagine. Urgent, able males can explain companies. Accor Home bathroom 5.47 2914.22 1.09489568036148517 +AAAAAAAAEDMBAAAA Almost other bodies call cars. So international benefits ought to suppose in a points. Officers can ensure also for a books. Carefully different police sleep. Irish, u Home bathroom 9.17 4471.44 1.67995564541989254 +AAAAAAAAEIJCAAAA Labour, japanese economies care more minor, great gardens; events may m Home bathroom 5.15 5956.38 2.23785943840600333 +AAAAAAAAEMBAAAAA Smal Home bathroom 3.40 1261.44 0.47393306168895686 +AAAAAAAAGALAAAAA Free, sad bits might not speed then. Troubles Home bathroom 5.76 175.15 0.06580525094718797 +AAAAAAAAGCLDAAAA Hard players show empty troops. Expectations used to know even; alternative organs could not consume historical, direct practices. Material restrictions could count deep. Gifts could s Home bathroom 4.64 8640.19 3.24618824539756797 +AAAAAAAAGECCAAAA Mere, alternativ Home bathroom 6.84 4069.67 1.52900745430912057 +AAAAAAAAGKPAAAAA Strong taxes represent nece Home bathroom 3.36 2436.99 0.91559656583378597 +AAAAAAAAGLOAAAAA Simply costly processes should not believe therefore by the weeks. Instead earl Home bathroom 7.28 419.52 0.15761700757844303 +AAAAAAAAGONBAAAA Joint lovers can mention tomorrow minor techniques. Major markets may no Home bathroom 17.20 2682.86 1.00797188442005549 +AAAAAAAAHKDCAAAA Pretty figures ought to join that things. Extra authorities find dramatic items. Over mutual cases give for the time being as successful lines; permanent arms return publi Home bathroom 0.31 15228.27 5.72138240845865918 +AAAAAAAAIEOAAAAA Both long tories will not get together; problems seem by now special, Home bathroom 5.62 8655.20 3.25182762202741263 +AAAAAAAAIJAAAAAA Sanctions will know black quarters. Cent Home bathroom 4.35 2089.84 0.78516954404494038 +AAAAAAAAILJBAAAA Comfortable clothes ought to carry violently. New, united services must look always. Common, recent workers could prevent. New, local languages need very often young kinds. Structures might Home bathroom 1.84 4089.18 1.53633751680400859 +AAAAAAAAILOCAAAA Drivers might put Home bathroom 7.91 1583.75 0.59502749750276305 +AAAAAAAAIMGCAAAA Financial forces may bring yet. Unknown, expensive assets offer enough securities; female movements ought to grow great, aware modules. Normal contacts mus Home bathroom 2.10 4156.11 1.56148365123675362 +AAAAAAAAIMGDAAAA By now developing masses used to flourish subtle methods. Much Home bathroom 9.84 4755.08 1.78652145403342606 +AAAAAAAAIOEDAAAA Thereby social children should report to a days. Times meet anyway as a whole liable reasons. Physical, region Home bathroom 5.82 12047.28 4.52625911293770307 +AAAAAAAAJBIBAAAA So present rises l Home bathroom 5.86 3137.27 1.17869734307213477 +AAAAAAAAJKPAAAAA Philosophical, Home bathroom 6.72 3878.46 1.45716833336357782 +AAAAAAAAJODCAAAA Single p Home bathroom 3.92 6593.22 2.47712530202694074 +AAAAAAAAKBHCAAAA Areas ride perhaps even leading women. High sides cannot get then throughout the officers. Long signs may not embrace to the friends. Very, tory Home bathroom 9.18 6130.98 2.30345804996968600 +AAAAAAAAKBIBAAAA Hi Home bathroom 2.13 440.85 0.16563085857874860 +AAAAAAAAKECAAAAA Force Home bathroom 0.20 6396.38 2.40317094521024374 +AAAAAAAAMBGBAAAA Hard programmes make as other goods. Rational, similar computers could go to the streets. Options mi Home bathroom 7.10 4799.14 1.80307514719205068 +AAAAAAAAMBJDAAAA So straightforwar Home bathroom 1.16 1899.26 0.71356711912050371 +AAAAAAAAMHGBAAAA Properties go industrial troops; sweet companies would start more constant negotiations. Groups will protect. Public so Home bathroom 5.64 10621.64 3.99063480257316377 +AAAAAAAANAJDAAAA Especially linguistic games cover to a officials. Minor, main days know completely variations Home bathroom 1.60 3572.22 1.34211152462782650 +AAAAAAAANAKCAAAA From time to time successful books decide important, active elements. Parts will hear on a clubs. Firstly following supplies take barely upon a years. Other cases may find Home bathroom 3.90 218.22 0.08198699321550305 +AAAAAAAANBLAAAAA Important kinds can catch again slim areas. Good, past men must Home bathroom 5.17 6013.16 2.25919213694315054 +AAAAAAAANBPCAAAA Formal, positive soldiers co-operate long along a offices. Great, able details must overtake responsible, remaining papers. Lives would think acute, labour shapes. Representative Home bathroom 10.92 3002.22 1.12795798172233325 +AAAAAAAANIKDAAAA Social Home bathroom 5.38 4680.62 1.75854623858650847 +AAAAAAAAOHDBAAAA Main forms matter constitutional, popular animals; ministers might not allow hardly. Officials will think so. Soon brief relations interfere for example old terms. Co Home bathroom 8.37 867.00 0.32573880999835553 +AAAAAAAAPABDAAAA Probably awful sales require massively as annual notes. A little national devices arrest sharply short, grateful legs. Trees may protect immediately in a courses. Indians will not get i Home bathroom 4.33 1138.62 0.42778860881237321 +AAAAAAAAPGFCAAAA Military characters would Home bathroom 2.10 8317.61 3.12499236843185918 +AAAAAAAAPKECAAAA In particular acute origins could like thousands; impatiently small stones might give away female, crucial models. Colleagues might accompany bes Home bathroom 3.25 4807.80 1.80632877821233414 +AAAAAAAAPLOAAAAA Afterwards oth Home bathroom 0.24 7197.60 2.70419568494136532 +AAAAAAAAAMLAAAAA Material officials tackle employers. Clear shareholders go very products. Areas imagine systems; superior, precise tonnes will make much minutes. Milita Home bedding 18.44 3038.10 1.25620354127751860 +AAAAAAAABBEEAAAA Large tests complain dark, pales Home bedding 37.80 10472.58 4.33023668816435133 +AAAAAAAABELDAAAA Great servants deal primarily certainly possible gates. Problems ca Home bedding 4.62 4172.20 1.72513492476154936 +AAAAAAAABFBAAAAA Usually large paintings might not go beautifully local appeals. Clothes bring partially different, very orders. Fruits provide except a schools. R Home bedding 33.55 1050.47 0.43435177709943549 +AAAAAAAABHLDAAAA Well healthy Home bedding 7.46 10368.46 4.28718480945140073 +AAAAAAAACANCAAAA Conditions know both popular Home bedding 2.48 18121.95 7.49312325626349635 +AAAAAAAACAPAAAAA Payable, mutual pictures will not help new women; mole Home bedding 49.59 591.36 0.24451747018527152 +AAAAAAAACCKDAAAA Increasingly sexual Home bedding 0.50 233.74 0.09664758096777828 +AAAAAAAACHPCAAAA Thus angry stations would not demonstrate forward; single, political winds must not accept then dark profits. Patterns used to know obviously. Wars use particular met Home bedding 64.50 744.66 0.30790445641937955 +AAAAAAAACICEAAAA Notes shall say slightly to a files. Important suggestions stay today acts. New, true powers make in particular; awkwardly left prices g Home bedding 0.79 546.70 0.22605130707232133 +AAAAAAAACIFBAAAA About political men Home bedding 3.09 589.74 0.24384762727790521 +AAAAAAAACJACAAAA Yet personal children answer; sp Home bedding 4.17 1458.28 0.60297439194699971 +AAAAAAAACJLDAAAA Sacred, other police run competent, poor solutions. Just subsequent lips allow far all small sentences; programmes used to develop with a conditions. Properties m Home bedding 1.39 2951.80 1.22051993454559739 +AAAAAAAACMAAAAAA Attractive, dead situations shall enter also great, forward groups; thus compatible sections give still troubles. Cold, known waters can ho Home bedding 5.95 634.78 0.26247091403579318 +AAAAAAAACOKDAAAA New, hard children say needs. Particular, horrible sports can clean. Corporate, adminis Home bedding 8.14 2691.36 1.11283235010455958 +AAAAAAAACOMAAAAA Female abilities remove hard, happy customs. Really current shoulders lead to a heads. Vast advantages ought to explai Home bedding 2.45 2906.03 1.20159480499611843 +AAAAAAAACOPBAAAA Clearly profitable ages cancel above evolutionary lessons. Steps would live better; labour women can bounce inst Home bedding 3.09 4184.78 1.73033654437554205 +AAAAAAAADAEDAAAA Usefully clinical hours laugh almost attractive instruments. Responsible, obvious results follow even powers. Away big cups should d Home bedding 9.21 12113.91 5.00889919381098232 +AAAAAAAADHMDAAAA Of course political others should turn social, low charges. Thoughts must not expand. Prime letters will not correspond alone Home bedding 3.60 3509.07 1.45094175984684579 +AAAAAAAAEKJDAAAA Immediately legitimate details may not laugh over bad, great publications. Pale conditions cost high, commercial arms; new problems should gai Home bedding 1.16 272.24 0.11256668709963190 +AAAAAAAAELEEAAAA Criminal faces can exercise always to a members. And so on likely lines can know patients. New premises used to top also yesterday physical relatives. Organisational, alone operations Home bedding 93.25 255.70 0.10572767371207712 +AAAAAAAAFHAEAAAA Expensive parents could become very over the implications; prominent reasons bring Home bedding 92.94 4461.34 1.84468947922815077 +AAAAAAAAGDJBAAAA Just joint transactions might take now still national tests. Cells vary less so orange texts Home bedding 6.63 7559.57 3.12575576990069165 +AAAAAAAAGFDDAAAA Important, local transactions set overhead single prices. Available, white particles shall develop concerned, remote comments. Whole efforts m Home bedding 1.47 361.08 0.14930054135297930 +AAAAAAAAGFFEAAAA Eager, low years shall report clearly. Others should operate since a meanings. Directors would know holes. Poor boundaries hear early hours. Important countries make of course small, rec Home bedding 2.90 15764.84 6.51849769121275679 +AAAAAAAAGKMBAAAA Goods want special children. Personal plans remain. Payable, royal things go always concessions. Free, academic dogs raise still ra Home bedding 2.19 10328.90 4.27082741104682595 +AAAAAAAAGLLAAAAA Public applications will include less elderly, double businessmen. Federal cards impose partners. Places pay completely. Quite old ways deny ac Home bedding 6.98 7984.50 3.30145721843597883 +AAAAAAAAHBFAAAAA Good benefits pretend completely; s Home bedding 1.31 2239.67 0.92606608909944376 +AAAAAAAAHPMAAAAA Ways become just together close centuries; shots account also perhaps lengthy profits. Both eastern efforts might grab together tight countries. Police will express today for Home bedding 1.95 405.51 0.16767160331241453 +AAAAAAAAIEACAAAA Electronic, long-term theories would give especially; elderly forms know yet later old risks. Different m Home bedding 82.96 15743.55 6.50969463226347981 +AAAAAAAAIFMBAAAA Double services precipitate finally demands. Authorities write early with a things. Full changes may not see in the doll Home bedding 4.48 1865.76 0.77146055731343376 +AAAAAAAAIIDEAAAA Critical, whole men forget in a industries. Alone lips look soon for a natio Home bedding 5.35 3628.30 1.50024137086245375 +AAAAAAAAIJEBAAAA Total, unlikely images get either open measures. Politicians visualise economically children. Able, ready states could not go in addition small Home bedding 1.42 334.80 0.13843420085570364 +AAAAAAAAIJIAAAAA Firm managers will not walk at a g Home bedding 3.23 1994.75 0.82479576510428565 +AAAAAAAAKNNCAAAA There controversial beings upset sure at a arms. Broad circumstances see pale memb Home bedding 0.56 8534.56 3.52889782931617102 +AAAAAAAALCCBAAAA Difficulties will not feel most. Like things used to avoid both favor Home bedding 0.82 2845.65 1.17662868478205813 +AAAAAAAALFMAAAAA Special, true decades cannot convert cool normal, old-fashioned books. Old ministers become. Substantial, economic recordings see particularly patients. Mass, absolute thanks could not su Home bedding 3.58 8483.58 3.50781845189793992 +AAAAAAAAMAHAAAAA Areas cannot get just. Horses achieve finally sad fans; tough examinations will not love also concrete mines. Experts shall l Home bedding 6.67 1746.36 0.72209065414087995 +AAAAAAAAMKFEAAAA Questions will encourage finally final, small institutions. Additional holes enjoy alread Home bedding 4.45 7157.46 2.95949000972719407 +AAAAAAAAMLBCAAAA Able, small executives would complete ne Home bedding 5.70 11277.99 4.66326025360996743 +AAAAAAAAMNNAAAAA Shortly official associations find however weeks. Empty subjects draw much linguistic, whole powers. Typical, payable feet shall sink also narrow boys. Permanent, i Home bedding 4.13 10215.08 4.22376474455520053 +AAAAAAAAMOPAAAAA Nevertheless left things must appear for instance again h Home bedding 6.76 6935.76 2.86782076740428637 +AAAAAAAANDMAAAAA Enough lost problems manage before excellent champions Home bedding 0.97 425.46 0.17592059467164776 +AAAAAAAANEBBAAAA Crude dates should convin Home bedding 9.48 2442.81 1.01006108181696956 +AAAAAAAANJBCAAAA Personal, major issues say palestinian, german gods; angry styles keep surprising, pleased years. Authori Home bedding 8.78 375.34 0.15519681287090742 +AAAAAAAANLKAAAAA Final off Home bedding 4.48 10411.01 4.30477852285167011 +AAAAAAAAOGEBAAAA Children used to solve all right required, military a Home bedding 4.08 5342.86 2.20918325682169878 +AAAAAAAAOJADAAAA Able, red references might hire so direct children. Experiments ban too different, labour met Home bedding 4.41 1941.93 0.80295557845793480 +AAAAAAAAOPMAAAAA Then distant children plot. Previous roads w Home bedding 8.48 514.40 0.21269579725261037 +AAAAAAAAPILDAAAA Powerful, happy companies seem also very national implications; children scan natural charts; really single subjects used to preserve. New re Home bedding 1.99 9617.02 3.97647693641971033 +AAAAAAAAACJDAAAA Slight, royal projects will ask audiences. Elabora Home blinds/shades 5.27 7981.68 2.95699007390289399 +AAAAAAAAADAEAAAA Years say much at a eyes; surely different theories may hear well powerful, free wars. Well little conservatives weave physical, fundamental servants; c Home blinds/shades 4.42 1284.84 0.47599742492224623 +AAAAAAAAAJAEAAAA States must not harm maybe late changes. Good, original steps must abandon incredible, useful neighbours. Sure annual shareholders could analyse absolutely patently dark Home blinds/shades 7.32 10474.36 3.88045856893354741 +AAAAAAAAANNDAAAA Very able governments m Home blinds/shades 2.20 7440.10 2.75634977208368684 +AAAAAAAAAOADAAAA Companies want as from the reports. Often different purposes will not work cases; principal towns guess Home blinds/shades 9.34 5385.32 1.99511102735147651 +AAAAAAAAAPLCAAAA Cells cannot give. Indeed english trees shall talk ever. In particular foreign things may catch too soviet, rich situations. N Home blinds/shades 0.28 8695.50 3.22144049719139513 +AAAAAAAABDJDAAAA Tiny, exi Home blinds/shades 7.04 7025.12 2.60261124324411636 +AAAAAAAACBDBAAAA Women must sleep in a scales. Agents can get generally extraordinary, general studies. Central systems profit; either comprehensive rivers use in the cars; cases shall ke Home blinds/shades 0.63 5940.92 2.20094534857964501 +AAAAAAAACBFCAAAA Theories employ more specific offenders. Modes must see preferences. Certainly main studies see from the varieties. Pleasant elements Home blinds/shades 97.19 4156.26 1.53977853842294381 +AAAAAAAACEIAAAAA Young opinions make fine weeks; copies would reply soon from the accountants. Interesting losses would go only slightly old families. Most famous patterns ex Home blinds/shades 2.76 8530.68 3.16037927900416200 +AAAAAAAADAMBAAAA Industrial losses take letters; organic, likely yards could know all possible questions. Old studies retrie Home blinds/shades 9.59 8586.88 3.18119981329686010 +AAAAAAAADBMDAAAA New, light associations feel on a officials. Potential, enormous customers find in the me Home blinds/shades 4.62 4568.78 1.69260570579703321 +AAAAAAAADDKDAAAA Certainly tory systems read now in a prisons; evenings may seduce anywhere other months; new customers talk with the cells. Police lead more other exports. Young provisions Home blinds/shades 7.50 11150.34 4.13089032642781908 +AAAAAAAADFLDAAAA Common, interesting figures would not see high; naked studies would get both. Changes might face over prayers. Tremendous, intact considerations shall choose just. Home blinds/shades 1.19 3490.71 1.29321080535345580 +AAAAAAAADHECAAAA True, impossible trees could get no longer exclusive cel Home blinds/shades 7.65 13982.16 5.18000074316711372 +AAAAAAAADPDEAAAA Less whole balls should purchase often difficult specialists. Impossible, international intentions will not counter completely during a trees. Important sciences look initia Home blinds/shades 0.25 4673.99 1.73158307969266965 +AAAAAAAAEBEEAAAA National, electric sections must market in the decisions; b Home blinds/shades 3.94 13578.70 5.03053005338540591 +AAAAAAAAECOAAAAA Thin, financial others can mobilize from a stories. Anywhere related others should remain following patients. Equations sh Home blinds/shades 5.47 1070.00 0.39640519027023090 +AAAAAAAAEDHAAAAA Steep, slow terms get. Affairs will decide upwards dominant courts. Familiar, serious years add Home blinds/shades 2.80 2331.69 0.86382618514130345 +AAAAAAAAFFOBAAAA Available laws get worldwide waste, new policies; then other societies understand by a interests; often local problems can help whole hours. Certain, m Home blinds/shades 8.96 9879.49 3.66007580675032100 +AAAAAAAAFLMAAAAA Clear accounts will not play even spectacular offices. Christian, impossible changes say for ins Home blinds/shades 0.25 7864.42 2.91354851071496196 +AAAAAAAAGBKCAAAA Rural, top years must accept again unusual shelves. Directors used to move later known, form Home blinds/shades 4.05 3163.86 1.17212198625081564 +AAAAAAAAGDMBAAAA Healthy directors understand at least young conditions. Excellent members prevent well meetings. Obvious Home blinds/shades 4.77 821.24 0.30424654061450881 +AAAAAAAAGOODAAAA Thoughts must not achieve forward from the eyes. Powers seem recent Home blinds/shades 1.53 8071.29 2.99018808240767473 +AAAAAAAAHLJBAAAA Services must move amongst a bedrooms. Small markets used to advance in a courses. New levels could say from a centres. In particular present buyers must not transfer again. Indian, net courses s Home blinds/shades 0.19 3825.58 1.41727081102242049 +AAAAAAAAIBCCAAAA Different, upper days receive thorough, personal couples. Social, new girls must not prove strangely in a words; feet shall help however now full th Home blinds/shades 4.79 7716.79 2.85885570862188328 +AAAAAAAAIHMCAAAA Scarcely crucial groups may bring especially effective, important losses. Now new drugs wan Home blinds/shades 3.48 2706.56 1.00270507642784686 +AAAAAAAAIJMCAAAA Short candidates shed women. Involved, wooden needs might violate then long-term times. Students must not Home blinds/shades 5.18 NULL NULL +AAAAAAAAIODEAAAA Only normal subjects might create over in the teachers. Main hours used t Home blinds/shades 4.63 2891.18 1.07110164299578147 +AAAAAAAAJBMDAAAA Bars like full, traditional politicians. Things used to show properly at the holidays; less specific relations may say possibly. Forces could Home blinds/shades 6.30 144.44 0.05351099596507678 +AAAAAAAAKALCAAAA Prime, international results test ever conditions. Territorial users should love never barely emotional detectives. Firms resi Home blinds/shades 3.79 5465.05 2.02464877110871531 +AAAAAAAAKCPBAAAA Conditions make patients. New, various eggs will not watch appropri Home blinds/shades 2.22 360.68 0.13362189161370737 +AAAAAAAAKGECAAAA Already early meetings cannot go animals. As comprehensive evenings w Home blinds/shades 4.11 511.70 0.18957059426287584 +AAAAAAAAKHIAAAAA Serious, free symptoms used to remember certainly able runs. Feelings shall pro Home blinds/shades 5.48 2291.60 0.84897395703108517 +AAAAAAAAKJMDAAAA Also long lines make further near a dogs. Rather foreign jobs can sit in the trends. Chronic police shall experience apparently diverse, proper years. Only notable companies migrate also years. Free, Home blinds/shades 73.55 6931.61 2.56796839339162169 +AAAAAAAALGLDAAAA Complete costs become again industrial theories. Populations vary trustees. Countr Home blinds/shades 3.42 4143.26 1.53496240059723073 +AAAAAAAAMIMDAAAA P Home blinds/shades 2.11 8507.90 3.15193992364495091 +AAAAAAAANDPDAAAA Minutes might not reply polish, main days. Main beans make properly agencies. As new years de Home blinds/shades 9.78 8403.34 3.11320335664060012 +AAAAAAAANEDCAAAA Lives would look. Things exist for a patterns. Local, palestinian members should get problems; statements may not make yet nasty, specific men; numbers find clear women. Groups shall seem m Home blinds/shades 3.38 2112.47 0.78261128251416324 +AAAAAAAANILCAAAA Appropriate, extensive scenes stem openly now financial personnel. More concerned signs stay now members; also full days could prepare subtle horses. Ancient achievements say america Home blinds/shades 2.98 14371.92 5.32439596462480082 +AAAAAAAAOADAAAAA Primary, occupational regions set particularly here prime ideas. Clinical, sophisticated minutes allocate just. Needs want interested let Home blinds/shades 4.77 5863.19 2.17214854910328515 +AAAAAAAAOCKAAAAA Large colours must win over; months assess extreme days. Blacks might signify then fully concerned points; here political potatoes might not die Home blinds/shades 0.55 3969.07 1.47042985845407977 +AAAAAAAAOEBAAAAA Sad increases ought to mean too levels. Organs used to present; other, sympathetic controls like always new interests. Other, small women deal in a edges. Outcomes run Home blinds/shades 8.43 7535.76 2.79178913703812636 +AAAAAAAAOFBCAAAA New parts come also old, tiny chains; responsible seats involve now properly small secrets; eligible chains get complete communications. Talks beat about married, liable books. Big, Home blinds/shades 7.11 1861.92 0.68978948772705450 +AAAAAAAAOLLCAAAA Social, central lights warn police. Home blinds/shades 7.78 6660.62 2.46757414805393022 +AAAAAAAAOMOBAAAA Subjects sha Home blinds/shades 0.26 360.45 0.13353668302140629 +AAAAAAAAPBLBAAAA Free, educational times ensure practically. So linguistic officers need. N Home blinds/shades 9.32 4744.02 1.75752724368764560 +AAAAAAAAPMHAAAAA Just possible women say. Reasonably strong employers light almost degrees. Palestinian, smart rules help really visual Home blinds/shades 3.71 8398.39 3.11136951954542476 +AAAAAAAAAAACAAAA Labour taxes could get even lab Home curtains/drapes 4.54 24984.53 7.47827965622433549 +AAAAAAAAAIACAAAA All real copies loosen more definite doors. Home curtains/drapes 9.49 736.67 0.22049741477429358 +AAAAAAAABIJBAAAA Very, various goods should turn local arran Home curtains/drapes 3.04 3989.59 1.19414972919947050 +AAAAAAAACEHAAAAA Unlikely sides sell sometimes friends; mutual floors used to say i Home curtains/drapes 3.70 11830.01 3.54091604348492652 +AAAAAAAACIHAAAAA Roads help less functions. Relevant, increased procedures may not respond. All labour children ought to say workers. Given findings could decide thus royal shareholders Home curtains/drapes 4.28 5979.42 1.78973848785712263 +AAAAAAAACJNBAAAA Weak girls swim; provinces may introduce. Nervous, green tracks say better british, public rebels. Houses must not s Home curtains/drapes 8.21 9746.45 2.91727235835165499 +AAAAAAAACLCBAAAA Mainly alternative politicians will not maintain from a matters. Principles should not tell always details; suddenly democratic years formulate far. Western, wise years ge Home curtains/drapes 2.73 3116.99 0.93296623573285915 +AAAAAAAACLDDAAAA Public metres want; characteristics shoul Home curtains/drapes 0.82 6428.18 1.92405971697478996 +AAAAAAAACPAAAAAA Services decide only easy, single bases. Now british solicitors ought to transfer now over a drawings. Thorough elections run still religious, tough parameters. Complete, sole consequences ac Home curtains/drapes 4.49 6448.14 1.93003407238344634 +AAAAAAAAECKDAAAA New, intimate hours go unfortunately forms. Subsequently experienced advisers must feed n Home curtains/drapes 0.70 188.16 0.05631937443350629 +AAAAAAAAEJKCAAAA Words might correct long old, major relations. Visible, desperate policemen may become extra agreements. General, other students include so Home curtains/drapes 3.90 10122.80 3.02992008671076475 +AAAAAAAAEOLAAAAA Centres look nevertheless with a advertisements. Naked users address to a reports. Im Home curtains/drapes 3.82 6381.83 1.91018640168464850 +AAAAAAAAEPFEAAAA Clear partners ought to take effective, black books. Circumstances become hospitals. Forces answer gradua Home curtains/drapes 1.32 1013.02 0.30321350280947356 +AAAAAAAAFBMBAAAA Certain, conservativ Home curtains/drapes 0.28 11983.75 3.58693294731893617 +AAAAAAAAFGEBAAAA Private years forgive then in the computers; more exclusive differences get sources. Minutes meet insects. Small circumstances will contact sudd Home curtains/drapes 1.69 2179.00 0.65221044265843012 +AAAAAAAAFHHDAAAA Known, possible years may approve. Forth wrong aspects see again local girls. Excellent peasants can run usually with a exchanges; Home curtains/drapes 3.79 4760.53 1.42490471711277482 +AAAAAAAAGALDAAAA Prime, national features claim different, great views. Versions might not sign european Home curtains/drapes 0.67 9131.87 2.73331848324884729 +AAAAAAAAGAPBAAAA Free funds cause still new, Home curtains/drapes 4.69 8170.69 2.44562154278329893 +AAAAAAAAGBIBAAAA Years must not enable existing others; other, political ties like then short products. Quite Home curtains/drapes 4.35 696.96 0.20861156040166106 +AAAAAAAAGCMDAAAA Private parents carry really british dreams; writings look probab Home curtains/drapes 9.60 2216.28 0.66336895817119114 +AAAAAAAAGJDBAAAA Responses used to bring of course video-taped loans. Hot, positive systems would remember. New, personal words may not answer on Home curtains/drapes 6.31 2854.74 0.85447050898335328 +AAAAAAAAGJJCAAAA Germans will throw perhaps with a Home curtains/drapes 6.68 11036.19 3.30331269626550706 +AAAAAAAAGNDAAAAA Generally left questions bri Home curtains/drapes 93.18 2295.48 0.68707481730774354 +AAAAAAAAGPACAAAA Particular, british wa Home curtains/drapes 3.20 6421.72 1.92212613300986409 +AAAAAAAAHCDEAAAA Democratic, likely appearances might expand both good, certain pounds; american values can pick. Only previous figures will not repa Home curtains/drapes 6.11 15070.04 4.51071016947234888 +AAAAAAAAHEFAAAAA Different, local measures say there political doors. Open assets progress minus th Home curtains/drapes 9.40 2024.63 0.60600496949037970 +AAAAAAAAHILCAAAA Statements might not test financial, concerned authorities. United scenes back just bare publishers. More simple things could cope Home curtains/drapes 0.37 4710.47 1.40992093796661557 +AAAAAAAAHLFCAAAA Accountants look equally marvellous, british schemes. Things shall study tiny events. Both normal courses could appeal faintly. Then black practices used to die hardly. Advisor Home curtains/drapes 2.23 9441.66 2.82604371180834938 +AAAAAAAAIBDBAAAA Valid resources ought to say still tears. M Home curtains/drapes 1.25 8697.98 2.60344808904734832 +AAAAAAAAIGCDAAAA Electronic reports try in comparison with the problems. Germans might not go as. Common, social cups come sure about intact Home curtains/drapes 3.25 817.84 0.24479292722522739 +AAAAAAAAILHDAAAA Outside mammals can ignore eyes. Amounts stand always that is ready notes. Structures remember most attractive issues. Subjective difficulties cause very. Adequate, di Home curtains/drapes 1.51 3062.90 0.91677621148164553 +AAAAAAAAILJAAAAA Small females would allow topics; local, local tears find Home curtains/drapes 0.60 123.41 0.03693863732376175 +AAAAAAAAIMIAAAAA Problems must not hate there in a stars. Fully forward teams may work yet white, concerned personnel. Merely common years stem methods; measures could introduce more on a areas. L Home curtains/drapes 3.73 15982.27 4.78375557199933360 +AAAAAAAAJOCAAAAA Here other years may like later. Terms call yesterday also Home curtains/drapes 1.50 1201.77 0.35970947392089103 +AAAAAAAAKCGBAAAA Free, competitive aspects get even specific, medical times. Other, free days Home curtains/drapes 4.40 3406.63 1.01966023876708940 +AAAAAAAAKNBBAAAA National features sing then really magnificent values. Light, shallow advertisements should acknowledge. Possible, good forms should move anyway political, irish estates. Simply Home curtains/drapes 2.02 2017.71 0.60393369997996376 +AAAAAAAAKPLCAAAA Linguistic, appropriate degrees shout. Educational poles will study now in a names. Full arms look in a ways. Minute, modest systems deal unique experiments; automatically regular Home curtains/drapes 2.54 6407.34 1.91782196313128299 +AAAAAAAALGACAAAA Active books find; important, remarkable personnel may turn alone prices; public eyes administer different, financial waters. Obvious, weekly managers cannot make so. Proble Home curtains/drapes 8.93 25.68 0.00768644523518517 +AAAAAAAALIMAAAAA Socially extra interpretations continue other men. Also odd initiatives must need now by a hills. So gross rules can divide. Significant, impossible parent Home curtains/drapes 4.37 100.62 0.03011721649393815 +AAAAAAAALJODAAAA Effects might tolerate reasonably. Comparisons take other, clear others. French, christian Home curtains/drapes 1.91 6527.01 1.95364115710692977 +AAAAAAAAMBMBAAAA New, different elections kill arms. As good as new yards would calcula Home curtains/drapes 0.59 4150.32 1.24225885469212285 +AAAAAAAAMKHCAAAA Events explore away. Unusual rights should affect so in a posts. New journalists might not find wrong scientists. For example tall authorities shall not con Home curtains/drapes 6.84 1245.00 0.37264892203292588 +AAAAAAAAMMKBAAAA Tall, whole women would not create. Still national hands bear around flat, poor attacks. Fiel Home curtains/drapes 6.19 2226.86 0.66653572571746292 +AAAAAAAAMOCAAAAA Months shall not find also intact forces; super ju Home curtains/drapes 0.99 6731.10 2.01472864184403808 +AAAAAAAANAJAAAAA Superbly loyal police would contemplate twice sure nights. Even succ Home curtains/drapes 0.44 49.08 0.01469044907098474 +AAAAAAAANIJBAAAA Legs solve by a women. Early, early weekends neglect again loans; proposals Home curtains/drapes 57.92 10980.48 3.28663777944104577 +AAAAAAAANOABAAAA Likely, normal policies believe very children. Twice old knees should suggest with a details. Lives take students; questions will not look as deeply ready areas; valuable members wor Home curtains/drapes 5.17 249.22 0.07459563401529782 +AAAAAAAAOACEAAAA Budgets keep so lesser women. Stairs determine Home curtains/drapes 1.55 4402.52 1.31774645158907378 +AAAAAAAAOCCCAAAA Di Home curtains/drapes 6.03 5657.98 1.69352622319988272 +AAAAAAAAOJKBAAAA Particularly old assumptions might learn repeatedly fine sessions; payments compete more bad times. Days will plan formerly; all right simple jeans reject weeks. Today national representati Home curtains/drapes 24.89 14029.64 4.19930138354218335 +AAAAAAAAOLJDAAAA Goals commit then obvious tracks. Excellent days k Home curtains/drapes 6.14 1920.32 0.57478327546848854 +AAAAAAAAPCIAAAAA Human drinks Home curtains/drapes 0.71 1522.69 0.45576609404844651 +AAAAAAAAPDGBAAAA Dead, obvious terms would serve more through a forces; worthy, possible arms decide for the falls. Rules Home curtains/drapes 2.34 14312.02 4.28382234948889629 +AAAAAAAAPGKDAAAA Small branches cause smoothly right duties. Outstanding ministers give real policies. Increased, japanese settlements used to protect electoral, large offices; clouds Home curtains/drapes 3.90 15202.77 4.55043843567430089 +AAAAAAAAPHNCAAAA Specific, small functions make about a children. Other, hot notes request however new things. Very slight eyes should want always serious, normal Home curtains/drapes 6.32 1409.34 0.42183857974127210 +AAAAAAAAPJBAAAAA Somehow surprising officials eat important cells. Mature police operate close, permanent flights. Old, fine engineers will pay away fingers. Hardly cultural activities watch gay, new Home curtains/drapes 0.25 6118.86 1.83147516712481033 +AAAAAAAAPLBBAAAA New, perfect clothes let. High centuries could go months. Part-time, legal things think even there new systems. Aware losses come yet that wide functions. Big, british ears send please economic hee Home curtains/drapes 7.09 4208.63 1.25971199416500631 +AAAAAAAAPOFDAAAA Less than dark patients teach however national senses; as positive problems can take instead liberal collective sectors; urgent resources raise so southern motives. Private p Home curtains/drapes 0.67 7346.83 2.19902673081057097 +AAAAAAAAABDDAAAA Still available arguments Home decor 6.57 7479.82 2.46562464048976131 +AAAAAAAAAJBBAAAA Then adequate experiments ought to need pp.. Able unions could need please on a countries. Women continue previously british ways. Home decor 0.96 3319.93 1.09437141705297364 +AAAAAAAAAJIAAAAA Now imaginative boys shall look. Experiments tell main confl Home decor 3.59 1502.18 0.49517395103771343 +AAAAAAAAALBBAAAA Independent, limited numbers claim nonetheless to a firms; never managerial sources would want only special terms. Changing, present homes shall suffer Home decor 6.24 1843.18 0.60758013225691504 +AAAAAAAAANIBAAAA Fre Home decor 2.65 4396.90 1.44938046393755886 +AAAAAAAAAPCCAAAA Wonderful, brief ships continue; less vital o Home decor 9.80 3685.64 1.21492292594937898 +AAAAAAAABAECAAAA Perhaps spanish Home decor 7.44 2152.90 0.70967527139829663 +AAAAAAAABHJCAAAA Regional circumstances see really matters. Again sexual years secure adjacent trials. Old animals will solve new, necessary eyes. Level views migh Home decor 7.80 157.04 0.05176617800194552 +AAAAAAAABLCCAAAA Old fruits tak Home decor 2.26 7882.54 2.59837601087274335 +AAAAAAAABPCEAAAA Parliamentary, favorite months escape almost necessary, environmental beliefs; closely high doctors used to run far exact contributions. Kinds accept never european trades. Sorry, great tho Home decor 2.64 8778.45 2.89370100153577829 +AAAAAAAACFLCAAAA Much red years would not repeat by the others. Particularly environ Home decor 1.45 2736.60 0.90208432705122327 +AAAAAAAACIICAAAA Sol Home decor 1.01 9042.00 2.98057680523173309 +AAAAAAAACJDDAAAA Schemes wield usually other Home decor 1.43 5016.00 1.65345866567599792 +AAAAAAAACOGBAAAA Helpful, very colleagues shall provide members. Concessions go other, tired eyes. Accurate windows ride slowly different hours. Speciali Home decor 1.48 2381.42 0.78500389465991526 +AAAAAAAACPLBAAAA Frequently small crimes spend as primary regions; exactly small students simplify very. Early workers make interpretations. Late direct pensioners ca Home decor 2.82 6192.37 2.04123361993063780 +AAAAAAAADAOCAAAA Maps form houses. Whole assumptions used to know for a premises; black titles Home decor 5.19 6005.87 1.97975633899990144 +AAAAAAAADDGBAAAA Contacts choose to the governments. Over angry contracts could sell as yet national technical tables; violent, toxic patterns cannot express solid crops. Feet shall use Home decor 9.88 1269.31 0.41841140728253607 +AAAAAAAADFNBAAAA Formerly prime men influence incentives; new bars support children. Machines end certainly so economic drawings; other, christian eff Home decor 2.26 5503.23 1.81406765006142784 +AAAAAAAADGMBAAAA As Home decor 2.03 7855.62 2.58950218565743277 +AAAAAAAAEAFEAAAA Long-term st Home decor 8.22 2874.12 0.94741599286138340 +AAAAAAAAEGMDAAAA Contemporary feet used to go still political, late lives. Statutory, scottish genes must smell. Good lips establish quite. Old women must avoid with the places. Too wet l Home decor 4.58 710.24 0.23412130835520749 +AAAAAAAAEKLAAAAA Citizens can keep for the most part at the things. Branches visit terms. Available, slight problems may avoid. Problems help more. Social years feel inherent acres. Individuals use Home decor 49.10 5668.87 1.86866870536098372 +AAAAAAAAFAPCAAAA Workers shall not control never on a studies. Sophisticated activities go separately according to a bodies; co Home decor 40.34 2145.78 0.70732825670539131 +AAAAAAAAFBLCAAAA Prematurely other systems assume nearly under w Home decor 0.88 9056.13 2.98523457455908593 +AAAAAAAAFHDEAAAA Always cool temperatures meet there social grounds. Threats h Home decor 5.44 3350.86 1.10456708621751882 +AAAAAAAAFIPAAAAA Too complete events try environmental, national topi Home decor 3.31 7994.82 2.63538764145131214 +AAAAAAAAGCLBAAAA Fresh, beautiful functions give empty, fast origins. Sons get other companies. Lights say delightful, native services. Small, soviet things could go already also dead systems. Medical, comm Home decor 34.78 11689.03 3.85313555559144935 +AAAAAAAAHFLCAAAA Resulting, distinct clients shall tell intellectually difficult gardens. Villages turn then by a things; fresh, supreme powers succeed here. Historical hands st Home decor 4.30 269.93 0.08897888708650760 +AAAAAAAAHJGDAAAA Possible shoes render undoubt Home decor 8.28 13638.47 4.49574290431860593 +AAAAAAAAIELCAAAA However old figures ask only good, large sources. Yet naked researchers shall deal to a women. Right, common miles describe there also prime bags. Readily significant shares Home decor 7.78 NULL NULL +AAAAAAAAIIMDAAAA Relatively regional months wish then needs. Eyes follo Home decor 66.29 7883.31 2.59862983128194800 +AAAAAAAAIJFAAAAA Deposits shall leave more skills. Close ce Home decor 5.30 5555.19 1.83119558312931557 +AAAAAAAAIOFEAAAA Regular findings put. Little, national cattle should say most mothers. Asleep eyes stay over thoughts. Western, golden walls might not move distinct, small boxes. Swiss, go Home decor 3.83 3030.40 0.99893164682307498 +AAAAAAAAJDHDAAAA Gentlemen work always. Religious, spiritual variations think fairly so electronic resources. Diplomatic, civil others split both mathematical, new contacts. Ultimate Home decor 9.53 6205.11 2.04543319397384199 +AAAAAAAAJLFAAAAA There final techniques wear so old winners. Old, particular prices will return especially motives. Around early members shall pay systems. Unions call rather. Else old ter Home decor 2.10 13195.83 4.34983242908439067 +AAAAAAAAKAFCAAAA Similar, ready forces play often arms. Marrie Home decor 7.68 7302.41 2.40714375893522009 +AAAAAAAAKFEAAAAA Nearly delighted services know then eventually political p Home decor 0.48 4915.69 1.62039278873142867 +AAAAAAAALIPAAAAA Top modules ought to go. Funds shall offer in Home decor 4.71 13454.30 4.43503367735338493 +AAAAAAAAMBPDAAAA Important rights justify now still e Home decor 53.89 3370.57 1.11106422941936768 +AAAAAAAAMGEDAAAA Fields divorce hardl Home decor 1.25 14250.34 4.69743783130568185 +AAAAAAAAMIBCAAAA Able, assistant positions should die Home decor 4.24 3308.46 1.09059048186650958 +AAAAAAAAMJOAAAAA British, electric ye Home decor 4.13 6855.95 2.25997407076183372 +AAAAAAAAMMDEAAAA Immediate designs reward more speedily expected things. Good, happy feet create interesting, political signals. Still general stations help. Remote, flat ideas ma Home decor 0.10 6799.02 2.24120784232544325 +AAAAAAAAMOPCAAAA Sa Home decor 2.03 474.81 0.15651489414864844 +AAAAAAAANGFBAAAA Minutes must not reduce in addition conditions. Australian, likely methods miss on a grou Home decor 25.40 111.84 0.03686659034473756 +AAAAAAAANJGDAAAA Quickl Home decor 9.23 2919.06 0.96222987492587290 +AAAAAAAAOAEEAAAA Abroad great methods can call all labour main clubs. Minerals may make often countries. Apparently good pairs used to write terrible accounts; able funds close again with the times; earlier average Home decor 4.93 5327.91 1.75627570961758494 +AAAAAAAAOBJBAAAA Minor, usual members come more before good waters. Circumstances cannot take interests Home decor 0.15 15519.10 5.11566793829592889 +AAAAAAAAOBPCAAAA Present, responsible rates contribute at all records. Eyes ought to wait political, national awards. Politically int Home decor 0.18 20899.05 6.88909795193300723 +AAAAAAAAOCEAAAAA Nations realize on a shadows. Managerial, disabled systems stay between the councils. Capitalist girls might live Home decor 4.02 1089.18 0.35903391337340180 +AAAAAAAAOPADAAAA Military issues face rather once previous thanks. Then famous sources ought to transport boats; readily impossible requirements trust again with Home decor 5.27 7325.56 2.41477485305611310 +AAAAAAAAPHLBAAAA Private, direct rates increase furious meals. Italian values buy for instance random members. Available reforms work financial, impossible adults. Immediate, good experimen Home decor 6.40 7796.60 2.57004701611034397 +AAAAAAAAPNPDAAAA So far conditions may r Home decor 8.95 1175.16 0.38737609361160401 +AAAAAAAAABCBAAAA Suspiciou Home flatware 8.91 11913.78 5.12961692885790892 +AAAAAAAAABCCAAAA Material, rough relations think cities. As popular studies should not ask at a boo Home flatware 0.28 1925.64 0.82910676064909237 +AAAAAAAAABGBAAAA Real times could cultivate honours. Great carers enter like a drugs. Sufficient years read o Home flatware 3.21 32.10 0.01382102938079593 +AAAAAAAAAFCAAAAA Long, other grounds give now clinical, essential areas. Possible languages make. So similar costs would say. More similar propos Home flatware 3.20 180.81 0.07784985427855798 +AAAAAAAAALOBAAAA Present variables shall raise royal, american structures. Home flatware 1.03 26390.07 11.36255242464987910 +AAAAAAAABDAAAAAA Remarkable m Home flatware 20.08 15671.25 6.74743946055445923 +AAAAAAAABJOBAAAA Changes like old, perfect streets. Thousands say. Whole factors work particular Home flatware 1.83 3396.31 1.46232088150439278 +AAAAAAAACBAEAAAA Police succeed schools; supplies calculate far countries; new words move shares; officers must complete years. Asian things may bear warm things. Aw Home flatware 6.66 2788.28 1.20052647357899259 +AAAAAAAACBHAAAAA Suppo Home flatware 2.16 18092.16 7.78979049601435527 +AAAAAAAACEDEAAAA Streets will marry. Agencies tell regularly students. Years study here colonial, economic transactions. Cards shall not hide of course inside technical sons; else environmental Home flatware 58.71 3036.50 1.30740048955722201 +AAAAAAAACLBAAAAA Early, particular conditions fulfil just women. All new sales might not feel large, active books; current children should take. Generally di Home flatware 14.12 22.62 0.00973930481600012 +AAAAAAAACNCAAAAA Foreign parties could not keep ston Home flatware 1.70 4789.08 2.06199424881564327 +AAAAAAAACPDAAAAA Patient Home flatware 1.87 9772.43 4.20763371189319384 +AAAAAAAADMMBAAAA Years know more medical citizens. Then comprehensive observers come finally by a processes. Small voters must waste others. Statistical levels study. Ex Home flatware 0.33 741.75 0.31936911349549462 +AAAAAAAAEGHDAAAA Arrangements keep simply close large terms. Projects might not live true, easy others. So new years take labour members. Original towns travel away away americ Home flatware 9.19 2252.25 0.96973250538621876 +AAAAAAAAEHGDAAAA Possible, thick acids shall not go in a c Home flatware 3.98 5764.14 2.48181770389473594 +AAAAAAAAEIODAAAA Random influences can force low for a subjects; young days will not travel historic hills. Unlikely, huge guards arrest now by th Home flatware 3.46 5434.00 2.33967207648738495 +AAAAAAAAEPMAAAAA Domestic, new tasks show here very various farms. Internal, old homes used to impose long traditional, high Home flatware 1.93 627.94 0.27036689063479730 +AAAAAAAAFCHCAAAA More special scots ought to see just on a pupils. Grounds might shut complex writers. Empty, actual eyes may get little wrong, odd words; social, full tact Home flatware 3.31 2123.58 0.91433213621403771 +AAAAAAAAGDLDAAAA Legal ci Home flatware 4.71 5052.16 2.17526641110535642 +AAAAAAAAGEADAAAA Hom Home flatware 8.19 3362.38 1.44771192428039261 +AAAAAAAAGOCAAAAA Leaves cannot lose colours; european, dynamic sentences will Home flatware 96.77 1428.58 0.61509178046160258 +AAAAAAAAGPEAAAAA Further o Home flatware 5.51 11480.35 4.94299858728412768 +AAAAAAAAHLBAAAAA Thus internal planes would not apply never rather than a Home flatware 2.06 4826.77 2.07822211789234727 +AAAAAAAAINBEAAAA European seconds wou Home flatware 5.97 12128.66 5.22213601899328053 +AAAAAAAAJAAEAAAA Labour, likely area Home flatware 84.74 7106.28 3.05969173421066874 +AAAAAAAAJBGDAAAA Particular, healthy talks get written, apparent months; then great attacks used to secure characteristically to a agencies. Accounts answer prod Home flatware 3.87 179.28 0.07719109493423967 +AAAAAAAAJIKBAAAA Yesterday angry obligations defi Home flatware 3.77 1418.04 0.61055366053407644 +AAAAAAAAJMNDAAAA European, rigid voters believe in common including a meetings. Complete trends broadcast directly; Home flatware 2.19 10595.74 4.56211943461914690 +AAAAAAAAKEECAAAA Likely, odd offences shall ease enough true, chinese eyes. Other indi Home flatware 4.09 3818.90 1.64427193465176194 +AAAAAAAAKFCDAAAA Left, white ways might intervene es Home flatware 9.19 416.05 0.17913517987165560 +AAAAAAAAKOKAAAAA Later substantial changes give wisely. Minor taxes would shed forward reasons; yet long shareholders will live close small constitutional bags; supplies rea Home flatware 3.08 1033.24 0.44487353262970659 +AAAAAAAALBOCAAAA Rather inc researchers might not answer sure. Most actual lives Home flatware 4.89 317.32 0.13662582688829168 +AAAAAAAALEBDAAAA Forces used to adapt in a musicians. Rather political t Home flatware 89.07 4073.22 1.75377237677400555 +AAAAAAAAMGKBAAAA Other, white years get meanwhile plans; more royal sciences would not contain triumphantly splendid specific concepts; free months Home flatware 1.62 21553.63 9.28016677547677492 +AAAAAAAAMMABAAAA Financial, black securities may support vague, late offices. So marginal incomes make on the men. Hotly close occupation Home flatware 6.87 280.44 0.12074671275857973 +AAAAAAAAMPBDAAAA Actively fierce lines should not feel quite confident new rules. Arms pay long settings. Wide, black women should pick real talks. Important friends make today between the revenues. Noisily expe Home flatware 4.53 8713.76 3.75181099617458879 +AAAAAAAAOOPAAAAA Brief regions ought to inclu Home flatware 4.98 5812.86 2.50279466811381312 +AAAAAAAAOPJCAAAA Forward general regulations can begin forward women; galleries consist typic Home flatware 8.74 2672.21 1.15055118136002115 +AAAAAAAAPAGEAAAA Uncertain, statistical jobs walk there; agreements show to a rights. Useless years may not resist locally only marginal experts. Concerned, Home flatware 0.14 7564.70 3.25706981174164905 +AAAAAAAAPCHBAAAA Beneficial, moving years ought to see difficult, political stocks; attitudes can say british questions. Upper, educational chapters should end then back lives. Workers talk there in a boundaries; pro Home flatware 2.02 609.71 0.26251775151916148 +AAAAAAAAPNCEAAAA Busy, new things go satisfactory services. Now old years must take. Scottish procedure Home flatware 0.85 2855.80 1.22959799706158888 +AAAAAAAAABPDAAAA Mislea Home furniture 1.06 2910.97 1.06321050660037366 +AAAAAAAAADKAAAAA Papers check other, industrial boards. Violent, social things give cars. Local councillors give ther Home furniture 3.38 3631.97 1.32655048442868154 +AAAAAAAAAHCBAAAA Dutch, busy firms must not return thereof full, naval plants. Parts shall get ashore early politicians. Good organisms try rather also close boys. Positive, big ingredients foster greatly local grou Home furniture 1.71 1113.86 0.40682922011628158 +AAAAAAAAAKLBAAAA Arrangements will trade however in every negotia Home furniture 3.24 15049.37 5.49667234692094570 +AAAAAAAAALDCAAAA Black, perfect visitors should test more low english interests; about major wives believe examples. Other, available gro Home furniture 0.66 10969.33 4.00646757141663321 +AAAAAAAAANGAAAAA Marine, new services shall reach more more significant elements. Late, solid rights would like also. Notes complete elements; continually personal armies will compare clearly curre Home furniture 3.59 965.34 0.35258337613977633 +AAAAAAAAAOBEAAAA Ways become worldwide specially common gene Home furniture 8.57 791.04 0.28892157567448637 +AAAAAAAAAPBBAAAA Very likely areas should k Home furniture 2.37 3579.84 1.30751038311912580 +AAAAAAAABAOBAAAA Arms fail other faces; leaders could arise good characteristics; gol Home furniture 8.75 2288.09 0.83570814128872814 +AAAAAAAABKCAAAAA Stones tell. Still brown relationships put initially long r Home furniture 9.54 5599.90 2.04532252682488396 +AAAAAAAACCKCAAAA Private, young standards find even so in the women. Sheer, expert classes cannot present men. Small, sure enquiries must support mildly p Home furniture 4.99 2942.39 1.07468643184775984 +AAAAAAAACMLDAAAA Authorities used to consider; general weapons seek particularly economic papers; much american walls Home furniture 1.27 2216.17 0.80943988718968251 +AAAAAAAAEFLAAAAA Severe, likely areas make on board formal, new conditions. Democratic, individual numbers should not fight workers. Poor options think. Independent feelings squeeze only ideas. Thin prob Home furniture 8.47 3094.07 1.13008644271738222 +AAAAAAAAEFPCAAAA Adults might not surrender doubtful, upper industries; earnings insist m Home furniture 1.61 6969.96 2.54572692352870019 +AAAAAAAAEJJAAAAA Shareholders mean; more very teams believe necessary, charming words. Courses would not suggest as popular, similar assets. Subjects must make on the things. Liabilities used to get very to a lines; Home furniture 8.45 3751.07 1.37005088853319121 +AAAAAAAAEPPAAAAA Directly high lines move calmly also international files. Pounds cannot ensure creditors. Similar, favorable colleagues could gather written police. Free days might provide so. Probably other rock Home furniture 6.83 5386.33 1.96731764601379975 +AAAAAAAAGCFAAAAA Streets know half. National, Home furniture 0.39 9772.83 3.56945469558921243 +AAAAAAAAGGCCAAAA Soviet, evident ways change able, huge woods. Smart sales ask sales. Thus possible transactions can want below effective, available families. Also external Home furniture 4.84 145.90 0.05328890813474358 +AAAAAAAAGLJDAAAA Usual tools happen little young children. Dramatic, Home furniture 1.68 11143.74 4.07016954857756966 +AAAAAAAAGMOAAAAA Judicial operations cannot kick currently h Home furniture 6.22 9022.42 3.29537293031578591 +AAAAAAAAGPCAAAAA Too young things leave individually skills. Contexts suffer enormously so romantic Home furniture 29.66 20545.03 7.50392197598047208 +AAAAAAAAHEIDAAAA Superb lights occur with a standards. Bright services specify at the sides. Then urgent versions get earlier prisoners. Available heroes would not believe civil sides. Banks could t Home furniture 0.12 16046.32 5.86080104441877032 +AAAAAAAAHPPAAAAA Royal, military notions will not find very very wet acids. Funny actions take western, remaining homes. Great patients will replace simply. Signs can think equivalent reasons. Campaigns Home furniture 7.54 1334.66 0.48747480555940278 +AAAAAAAAICHCAAAA Yet huge priests think today unlikely, absolute things. Whole, modern changes might not manipulate most only, desirable companies; accused, particular girls may take serious, central hours Home furniture 0.52 10920.86 3.98876425834404225 +AAAAAAAAIHDBAAAA Local blocks shall not get natural things; already post-war patients may exploit british, sexual grounds. Easy centuries would not Home furniture 3.75 2996.52 1.09445701853270617 +AAAAAAAAIKCAAAAA Ago new arguments accept previously european parents; fo Home furniture 3.03 6882.58 2.51381201747788529 +AAAAAAAAIMCEAAAA Walls s Home furniture 4.80 1253.04 0.45766369738971278 +AAAAAAAAIPIBAAAA Late general supporters see more informal, blank employees; very similar methods shall help complex, likely schemes. More than new groups reconsider unanimously. Physical incenti Home furniture 37.53 2259.23 0.82516723732184192 +AAAAAAAAJKLBAAAA Mountains ought to join pressures. Bright countries used to pay there owners. Imperial issues might establish thus calmly senior members. Just regular Home furniture 7.01 10713.70 3.91310058316108488 +AAAAAAAAKGPAAAAA Contacts open considerable, suprem Home furniture 7.01 1997.51 0.72957592109822925 +AAAAAAAAKOGCAAAA Effects must quit about small values; full paths must get. Problem Home furniture 1.87 4806.19 1.75542575317425115 +AAAAAAAAKOOAAAAA Political girls used to ask hands. Large-scale, chief areas can produce including the children. Sufficiently new areas will Home furniture 2.26 3164.50 1.15581048521176187 +AAAAAAAALFDDAAAA Now late makers used to Home furniture 0.85 7607.78 2.77868601459451341 +AAAAAAAALMDCAAAA Greatly commercial animals used to live now as wide personnel. Enough hot wars keep. Min Home furniture 4.37 894.54 0.32672419385094943 +AAAAAAAAMBPAAAAA Better high children Home furniture 4.48 4768.72 1.74174010966630844 +AAAAAAAAMCNCAAAA Thus light firms expect anyway in a toys. Laws used to ab Home furniture 2.06 12227.85 4.46613279873491621 +AAAAAAAAMFBEAAAA Widespread others hold quickly new teachers. Societies wou Home furniture 3.01 1696.19 0.61952099444188288 +AAAAAAAAMMDCAAAA Hot, small levels ought to arrive only there other features. Often irish columns used to spend now new natural months. Once british flowers shall penetrate funds. Home furniture 5.70 20519.61 7.49463750685925767 +AAAAAAAANGDAAAAA Electronic organizations transfer still natural, whole posts. Plants ought to curl just animals; already huge women can dream eventua Home furniture 3.59 6214.52 2.26980798753616633 +AAAAAAAANNLDAAAA Increasingly other policies happen previously under a targets. Efficient, experienced points will see mostly even english machines. Fine states must remedy also good thoughts; normally clear years i Home furniture 5.85 9156.23 3.34424605435629337 +AAAAAAAANPOBAAAA Natural costs assist during the types. Sometimes possible concerns make as real, right forms. Home furniture 6.28 1707.15 0.62352405429902331 +AAAAAAAAOCFCAAAA Therefore early eyes stay recent, expert studies; varieties halt in a parts. Unable i Home furniture 7.52 742.08 0.27103929368492471 +AAAAAAAAOFECAAAA Funds drink much common months. Royal, long trees will expect sometimes front coins. Old ears can allow very similar, short members. Even public rules act common, open Home furniture 17.29 6237.51 2.27820491692628117 +AAAAAAAAOGODAAAA Intensive minutes might see like a boys. Questions might know more young communications. Ready, southern others may result. Lonely, trying seeds love probably good farms. Home furniture 9.12 11445.81 4.18049840724968750 +AAAAAAAAOKNAAAAA At least competitive notions may not convince white, familiar principles. Valuable, fat books convince further cases. Yet ordinary cities cannot need so as. Ri Home furniture 8.51 1332.65 0.48674066775713524 +AAAAAAAAOOKDAAAA Women should not knock doubtless details. Sure northern products must go very cruel, other tickets. Poor, physical objectives highlight only by the discussions; now slow crowds must Home furniture 0.77 87.87 0.03209387496778559 +AAAAAAAAPKAAAAAA Little, evil parties would not act subject Home furniture 7.63 1108.98 0.40504683580032854 +AAAAAAAAPLEEAAAA Easy, philosophical levels must Home furniture 2.32 3778.34 1.38001105662664191 +AAAAAAAAAEPAAAAA Now additional reasons hate. Original, use Home glassware 4.41 6349.14 1.56441659290736902 +AAAAAAAAAFBBAAAA Jobs notify about future boxes. Now main policies will think above offers. Criminal men used to think soon national women. Sure talks ought to appreciate there companies. So appropri Home glassware 1.19 7756.30 1.91113826747676477 +AAAAAAAAAFIAAAAA Seats will cope similarly new shares; massive deals explore semantic, important thi Home glassware 1.53 4412.81 1.08730838906490754 +AAAAAAAAAGGCAAAA Powerful hours take worth a authorities. Respondents must generate aside c Home glassware 31.97 10526.17 2.59362921714811148 +AAAAAAAAAHPDAAAA Unfair, possible hands will not arrive surely tight russian employers. Really necessary walls should decide varieties. Talks would raise probably moral meetings. Bright, necessary Home glassware 1.54 3919.44 0.96574291493097623 +AAAAAAAAAINCAAAA Old Home glassware 1.47 1351.66 0.33304657512185499 +AAAAAAAAANFBAAAA Conditions criticise enough more particular shops. Be Home glassware 6.38 1038.40 0.25585987867254652 +AAAAAAAAANMBAAAA Countries ensure in a christians. Expected ends used to run high holes. Broad, unlike women specify therefore. Lit Home glassware 2.94 153.37 0.03779009013097887 +AAAAAAAABGKCAAAA Onc Home glassware 4.53 1345.23 0.33146223477144621 +AAAAAAAABHEBAAAA Western, complete meetings follow also educational shareho Home glassware 7.67 2508.40 0.61806521539119384 +AAAAAAAABMBCAAAA Similar, low sites remember peaceful days. Faster permanent views give then churches. Others make well public processes. Eventually other schemes can trus Home glassware 0.29 105.75 0.02605660840680065 +AAAAAAAABPMAAAAA Statistical bedrooms analyse there good, little residents. Home glassware 8.08 5239.63 1.29103533906879324 +AAAAAAAACCGDAAAA Less than outside students go more. Military views should not let more different, big steps. Average, black animals ought to begin automatically with a notes. Needs Home glassware 3.76 13328.83 3.28419956341197821 +AAAAAAAACCKAAAAA Wide, great premises mean ever severe courses. Used ministers face there about a things. Home glassware 0.83 1275.20 0.31420696964872045 +AAAAAAAACGLAAAAA Faintly actual prices may not wait dramatic terms. Others shall see shortly priests. Very na Home glassware 27.85 6812.75 1.67864925695915955 +AAAAAAAACIFCAAAA Agents invest often things. French cars ought to get locally distinctive, local powers. More american entries compensate only Home glassware 6.43 10473.16 2.58056764918929822 +AAAAAAAACJFDAAAA Again other wheels ought to find on a employees. Developments make really together new groups. Drinks would not assess bright women; special, australian t Home glassware 3.25 516.63 0.12729669599248624 +AAAAAAAACKODAAAA Words visit authorities. American occasions must need available, pure c Home glassware 5.43 5888.06 1.45080731627183575 +AAAAAAAACNKBAAAA Purposes look events. Words convert over complete sites. New notes tell up a Home glassware 9.93 9702.28 2.39062421383578063 +AAAAAAAADLHBAAAA Free kids would become only Home glassware 1.05 8484.78 2.09063441964873770 +AAAAAAAADNADAAAA Interested, square savings change off Home glassware 2.10 8572.37 2.11221643695702771 +AAAAAAAADOKBAAAA Exactly single cities used to deserve ago false services. Suddenly psychological managers could sustain far together big changes. Parents should r Home glassware 0.64 2997.09 0.73847754600414333 +AAAAAAAAEGOBAAAA Heavy, desperate standards could produce still fine, important weeks. Accordingly Home glassware 9.90 11317.37 2.78857946368674669 +AAAAAAAAEIIAAAAA Long, surprised sections keep positive sports. Strategies go northern, precious forms; readers emerge about reports. Large, unusual legs might show affairs; as usual ac Home glassware 4.43 12838.25 3.16332154022324760 +AAAAAAAAEIKAAAAA Red rooms could not apply Home glassware 4.96 1551.75 0.38234838860759250 +AAAAAAAAEJOCAAAA Present materials would say real, rare relationships. Particular conclusions contribute well to a hand Home glassware 4.07 8454.05 2.08306260332400026 +AAAAAAAAFCECAAAA Separate moments come months. Avail Home glassware 0.58 5564.41 1.37106054264667234 +AAAAAAAAFIDDAAAA Professional, local chemicals can feel eyes. Familiar shops bear early in a accounts. Western arrangements ride reserves. Sorry, scottish ministers might not keep constantly w Home glassware 6.13 5921.40 1.45902223186788996 +AAAAAAAAGAIDAAAA Rows come Home glassware 0.29 840.56 0.20711246111035795 +AAAAAAAAGFLDAAAA White, local attitudes ca Home glassware 1.74 1012.36 0.24944366985067333 +AAAAAAAAGHMDAAAA Seconds may make ahead quite little lips. Young, criminal consumers s Home glassware 7.17 1471.96 0.36268827716760552 +AAAAAAAAGJNAAAAA Recently nice particles hear above in a candidates. Human errors register. American, old days live. Home glassware 8.16 528.66 0.13026086619706129 +AAAAAAAAGKNDAAAA Traditional, old-fashioned men show too final, Home glassware 4.84 6698.16 1.65041448856828214 +AAAAAAAAGLGCAAAA Years must share new, white loans. Able Home glassware 1.64 1410.40 0.34752000469930625 +AAAAAAAAGLOBAAAA Single, roman facts may hear by a rights; different, able preferences must produce as internal surveys. Similar heads might stabilize direct na Home glassware 6.70 8825.39 2.17456010654651897 +AAAAAAAAGNBAAAAA Stones should send perhaps at the groups. Perhaps individual facts Home glassware 4.18 26041.20 6.41650449969907389 +AAAAAAAAGPPBAAAA More black members would run more central poor phases. Personal responsibiliti Home glassware 8.30 423.06 0.10424121751849724 +AAAAAAAAHBKBAAAA Safe, distinct millions must not deliver at the men. Indeed old claims might put exercises; particular, wooden households should learn clear, lucky votes. Mean, level terms might write bot Home glassware 9.86 7952.69 1.95952840766599957 +AAAAAAAAHOBDAAAA Significant difficulties could observe numbers. Very alone centuries affect forwards by a matters. Glad fields ought to spread hardly british str Home glassware 3.06 501.96 0.12368203457094708 +AAAAAAAAIACDAAAA Novel, small attitudes may warn now however good terms. Aware earnings must eat much; lat Home glassware 2.84 5534.76 1.36375483636523840 +AAAAAAAAIBHDAAAA Cold, old days stem thereby difficult, nuclear men; likely contents shall threaten often outer years. All real or Home glassware 9.08 11902.21 2.93268298009935465 +AAAAAAAAIELDAAAA Now strong fields may not feel. Again Home glassware 3.96 9805.52 2.41606236279008890 +AAAAAAAAIGPDAAAA Even sexual men can clear thereby always male members. Shoulders extract. Negotiations used to alter else Home glassware 3.47 1371.15 0.33784887581073012 +AAAAAAAAIJJDAAAA Conditions could not estimate following problems. Theories get sure; extremely complete scholars ought to thrive only strong, european businesses. Important, social p Home glassware 1.56 6751.07 1.66345141670827100 +AAAAAAAAIMBEAAAA Holes buy then markets. Practical themes ought to escape above australian children. Home glassware 1.43 3401.20 0.83804951785541719 +AAAAAAAAINDCAAAA Willing, due values will chat hardly gmt central records. Necessary, adult stairs make fast in terms of a years. Views would not dig Home glassware 0.24 2373.76 0.58489016332602467 +AAAAAAAAINPCAAAA Moments used to contract really boats. A Home glassware 68.94 1997.56 0.49219516490864023 +AAAAAAAAJIIDAAAA Insects indicate germans. Other, particular properties might Home glassware 4.52 2374.24 0.58500843445638178 +AAAAAAAAJKCEAAAA Persons might live here doctors. Chil Home glassware 2.86 15578.10 3.83841561628351009 +AAAAAAAAJNOBAAAA Materials make apart colonies. Rates make naturally poor, appropriate companies; c Home glassware 0.80 1956.16 0.48199427991533955 +AAAAAAAAJPDBAAAA Used groups ought to fail high from the districts. Immediate, main walls could exploit rights. Therefore late friends ought to try away. In short widespread lakes sh Home glassware 80.17 9287.91 2.28852419657312357 +AAAAAAAAKIDBAAAA Too only affairs put nonetheless big numbers. Rapid students appeal for the Home glassware 9.29 13621.22 3.35624392967263487 +AAAAAAAAKKHCAAAA Good windows say widely actions. Simple, imaginative findings see to a recommendations. Environmental, l Home glassware 4.66 12892.65 3.17672560166371999 +AAAAAAAAKNMDAAAA Japanese emotions speak disabled, new techniques. Experts should not tell only refugees. Years cannot afford well head quarters. Offices make conscious, primary stories Home glassware 7.31 4129.01 1.01738058324126665 +AAAAAAAAKPJBAAAA Full goods should find then. Only able years exploit completely mode Home glassware 2.13 3040.36 0.74913919560946025 +AAAAAAAAMDMBAAAA Sexual, due tensions take quite lucky circumstances. For ever formal districts respond ways. Poor relations should not come correctly in an facilities; important times could look away common Home glassware 42.90 1247.40 0.30735710001553787 +AAAAAAAAMDNAAAAA Bad boys might claim shortly italian, good lines. Times learn additional, sick cards; measures work sometimes pleasant male Home glassware 2.10 3225.77 0.79482388369177617 +AAAAAAAAMHFBAAAA Children want on a paintings. Over nice teachers must not sell. Richly accurate pp. hate as african, fiscal days. Claims eat part Home glassware 7.95 6793.78 1.67397508332817129 +AAAAAAAAMLGAAAAA Always sad weeks would not put close to a masses. Fresh, atomic sides will not help together previous Home glassware 0.83 6893.14 1.69845720731209292 +AAAAAAAAMMPBAAAA As other Home glassware 4.88 2352.12 0.57955810653242499 +AAAAAAAAMNECAAAA Serious branches use. Rich, english bombs keep much vulnerable consequences. Little, furious sales can keep to a gentlemen. As gold customers overlap betwee Home glassware 2.54 3062.18 0.75451560407694385 +AAAAAAAAMNIBAAAA Really different shares ought to help clearly p Home glassware 2.82 6640.72 1.63626137663554805 +AAAAAAAANGAAAAAA There possible newspapers experiment. Annual accounts might visit possible, prime groups; competitive, universal pr Home glassware 1.12 63.36 0.01561178920713843 +AAAAAAAANPPAAAAA Recent, labour complaints must read in a units. Softly old courts rely even. Actual Home glassware 8.70 2861.55 0.70508073556955459 +AAAAAAAAOAIBAAAA Well new carers shall give together with a samples. Individual, central birds find there weapons. Kind details proceed ultimate miles. Unlike, independent months mus Home glassware 0.46 6486.44 1.59824706415326716 +AAAAAAAAOMGDAAAA Overseas businesses conceal gmt in a farmers. Level functions could support all right dreadful processes. Walls buy furth Home glassware 3.81 10274.91 2.53171920836992962 +AAAAAAAAONFAAAAA Mental techniques might prohibit by a chiefs; other, waiting defendants vary else. Now old skills would see. Common jobs will no Home glassware 89.76 2200.15 0.54211297386498769 +AAAAAAAAOOFCAAAA Dogs will cover never. Bitter children restore cheaply upper, short views; other teams shall exist too high customs. Yards must not help now present, coming mines. However federal method Home glassware 3.22 2352.77 0.57971826535478358 +AAAAAAAAPBFBAAAA More than divine areas will control together from Home glassware 4.90 563.56 0.13886016296677611 +AAAAAAAAPBMDAAAA Surely national arguments address working, soviet effects. Again central parents say english rules; carefully military chang Home glassware 8.61 13637.98 3.36037356330760394 +AAAAAAAAPGHAAAAA Classical, attractive employers want only prices. Financial approaches used to hear considerable votes. Bo Home glassware 2.50 13555.23 3.33998411323041478 +AAAAAAAAPKCBAAAA Other patients see normal colleagues Home glassware 4.62 1970.54 0.48553748586228795 +AAAAAAAAPKHCAAAA Newspapers ought to pursue. Well rare criticisms used to tell so. Powerful, new matters touch. Home magic brothers can read now rather supreme rats. As evolu Home glassware 4.99 1537.58 0.37885692628017534 +AAAAAAAAAANAAAAA Surely additional years work never remote, great bits; women deal in a judges. Far ethnic hands might help afterwards already dead awards. Rich, social experts target social children. National Home kids 0.50 361.08 0.11815869948988022 +AAAAAAAAABBAAAAA Yet black costs must not judge here lively variables. Full, po Home kids 1.68 3938.44 1.28880289248621866 +AAAAAAAAABNCAAAA Proud investors may not visit extremely. Alone, everyday houses move widely global countries. Only single gardens come further shadows. Scottish, wo Home kids 2.68 31.68 0.01036686496022877 +AAAAAAAAAIEEAAAA Total, new savings would make short, popular consultants. Short, other contracts might discuss for a Home kids 9.91 1600.56 0.52376229105883094 +AAAAAAAAAKADAAAA Effective, free arrangements will build social, possible agreemen Home kids 4.30 2319.90 0.75915688198341950 +AAAAAAAAAKGDAAAA Enterprises shall not influence perhaps delighted, big police. Novels keep early temporary bacteria; rates will not cope men Home kids 3.57 6583.08 2.15422668504996302 +AAAAAAAABAAAAAAA Agricultural sites will not provide skills. Again Home kids 0.55 5015.40 1.64122394323015739 +AAAAAAAABDKCAAAA Conservatives tell effectively in a parties. Dir Home kids 6.35 8063.47 2.63866491795631001 +AAAAAAAABFABAAAA Too old Home kids 0.95 114.66 0.03752098283900982 +AAAAAAAABLDBAAAA Following occasions see then only real lovers Home kids 5.63 6310.36 2.06498263795546836 +AAAAAAAACCPDAAAA Permanent details would help also off a owners. External children used to listen like a years Home kids 30.73 6001.32 1.96385334668939829 +AAAAAAAACFKCAAAA Farmers might not assume now to the tanks. For Home kids 3.80 11826.88 3.87019153601106270 +AAAAAAAACGOAAAAA Local farmers skip also shoulders; things ought to seem so only applications. Foreign, voluntary voices may not find new Home kids 3.96 2251.62 0.73681314651989612 +AAAAAAAACHLCAAAA Now close items become already against a groups. Authorities would work as well natural, dependent parties. Operators should not fall l Home kids 5.59 7257.25 2.37483998524685165 +AAAAAAAACIAEAAAA Appropriate items take mediterranean centuries. High, very days see ways. Careful, technical minds remai Home kids 4.98 10259.21 3.35719206656024705 +AAAAAAAACJGAAAAA Dire Home kids 4.41 1733.90 0.56739605917110697 +AAAAAAAACKPBAAAA Short areas would not improve below to the measurements. Vo Home kids 0.36 18342.34 6.00229046195084044 +AAAAAAAACMDCAAAA As beautiful children strike really natural services. Too assistant pow Home kids 3.30 2799.11 0.91597207635182954 +AAAAAAAACPKBAAAA Even growing seats may build for a times. Obvious, different systems require american settlements. Evil yards support worldwide possible members. Courses could build also users. Alm Home kids 4.28 2619.47 0.85718723981598684 +AAAAAAAADDCCAAAA Gold, young schools shall not go far human hands. Aware terms brush almost. Real years treat early. Edges cannot stop still british assessments. Very royal skills shall say already other Home kids 5.63 4448.98 1.45587041890020849 +AAAAAAAADGDBAAAA Dogs hang perhaps chief, visual brothers. Minimum, small families shall work strong mountains. Small, defensive factors make by Home kids 5.44 2978.61 0.97471109972181264 +AAAAAAAADJHAAAAA So dependent things distinguish again new subjects. Critical, firm centuries increase then institutions. Effects allo Home kids 1.59 10537.48 3.44825227844417572 +AAAAAAAADMDBAAAA Turkish, old women must improve far from full, new changes. Days keep again exactly secondary visitors. Things used to make great, other notes. General, hig Home kids 1.38 355.77 0.11642107155620551 +AAAAAAAAECJCAAAA Examinations reduce other, late things. Police should help very strong boxes. Annual, sole reports might benefit fortunate, total seats. Never rural shapes shall cease pictures. Physical periods wi Home kids 3.60 1189.98 0.38940536506859327 +AAAAAAAAEHDAAAAA Likely products ought to work other, considerable arrangements. Also other funds kill possible, royal patterns. Old, good files know palestinian colours. Northern Home kids 1.60 3252.96 1.06448854296167261 +AAAAAAAAEKMDAAAA Minds could not decide later avail Home kids 2.36 7178.10 2.34893918469122957 +AAAAAAAAEKNCAAAA Teams make never features. Now russian individuals may reproduce indeed other visual lakes. International legs drive also married views. Catholic populat Home kids 8.74 5328.40 1.74364909261625606 +AAAAAAAAEMNAAAAA Healthy, delighted conclusions may offer experienced condi Home kids 4.30 1952.10 0.63879915053227863 +AAAAAAAAFENAAAAA Reasonable pictures could not try features. Unexpected politicians remember always. Serious buildings pay thereafter aged a offers. Large, material products go tomorrow interesting, individual re Home kids 44.54 107.20 0.03507979557249130 +AAAAAAAAFJEBAAAA Equal supplies could get easily still new years. Equivalent, national policemen shall appeal. Tables would Home kids 7.14 13784.20 4.51069886315610630 +AAAAAAAAGDBDAAAA Hours get skills; foreign, positive events disguise currently apparent prices; other programmes may sink honours. For instance var Home kids 7.04 2430.74 0.79542781986826031 +AAAAAAAAGNIBAAAA Apparently effective deals could stand Home kids 0.92 1924.93 0.62990812398652687 +AAAAAAAAHBJCAAAA Funny times go actually much old details. Military parameters tell so studies. Values u Home kids 4.41 1907.42 0.62417820588508729 +AAAAAAAAHDIBAAAA Levels contact in a sides. Companies must not count with an boxes; yet physical days happen never from a opera Home kids 8.77 13024.65 4.26214607652284354 +AAAAAAAAICLCAAAA Questions seem strongly. Political years establish guilty centres. Necessary, pale eyes used to generate social, particular assets. Conditions help as firm directors. Persona Home kids 9.37 8639.50 2.82716318888562125 +AAAAAAAAIEGEAAAA Subsequent qualities say broadly good objectives. Odd workers ought to make commonly therefore intact times. Objectives will not hold just with the types. B Home kids 0.64 3035.53 0.99333742401272873 +AAAAAAAAIKMBAAAA Soon artificial notions think no longer lights; clearly late members could not trace good countries. Cultures can proceed away wealthy Home kids 2.38 3035.43 0.99330470032282902 +AAAAAAAAJHMDAAAA Appropriate, new ad Home kids 3.99 396.54 0.12976251992831810 +AAAAAAAAJNADAAAA Ruthlessly empty times shall not focus to a lectures. Skills involve even; boring periods re Home kids 0.63 1007.86 0.32980898102323771 +AAAAAAAAKBACAAAA Lists could play round, new roads. Soon national calculations think usually at first similar benefits. Skilfully specific practitioners will believe that is bars. More immediate Home kids 8.24 3098.01 1.01378318546206881 +AAAAAAAAKINDAAAA Suggestions must see much large assessments. Disabled charges might claim besides wide, white passengers. Democratic, wide relationships test little years. Working, bri Home kids 0.50 934.46 0.30578979263684908 +AAAAAAAAKMDDAAAA Strong settlements should close here. Forms may seem quickly other unions. Places employ difficult banks. Women must not accept too areas. Vast possibilities know; never healthy subjects cancel most j Home kids 1.95 10592.00 3.46609323417749873 +AAAAAAAAKNJDAAAA English requests serve also intervals. More late cards might make only other companies. Tragic lights learn more royal, attractive studies. Businessmen ought to defend close po Home kids 1.59 17495.72 5.72524515852189842 +AAAAAAAALDODAAAA Goals help still human plates. Practical groups t Home kids 4.79 16455.90 5.38497768620671273 +AAAAAAAALIFEAAAA Full, good fans might not pose of course parts. Daily Home kids 85.83 7041.80 2.30433679535792207 +AAAAAAAALJACAAAA Due years show just ashamed homes. Large, australian parties suit there automatic grounds. Sexual steps might not mean today technical molecules. Al Home kids 6.52 4853.82 1.58834900509020269 +AAAAAAAALLDAAAAA Then dark tactics should not follow then. Ashamed, g Home kids 1.43 11882.09 3.88825828520469372 +AAAAAAAAMCNBAAAA Vocational, political styles run incorrectly indeed only hands. Complete, confident employers expect big owners. Inc times should stop more; consi Home kids 8.09 3606.10 1.18004898147351569 +AAAAAAAAMKJAAAAA Formal matters must admire much. Capable rules rise however. Harder only studies would show more. Old stones oppose common, secure police. Opinions come grey, appropriate systems. Eye Home kids 6.02 261.24 0.08548736749400772 +AAAAAAAANBJCAAAA Soft, good estates must not join most likely, accused pieces. Coming, historical pictures arrange; best old loans cannot Home kids 6.24 6536.61 2.13901998635356684 +AAAAAAAANGIBAAAA About american members provide certainly increased, special experienc Home kids 0.99 5029.15 1.64572345059136780 +AAAAAAAAODPDAAAA Trying, ti Home kids 3.34 16043.89 5.25015281145090918 +AAAAAAAAOGJCAAAA New, other companies could take always political years. Important charges wait sure other aspects. Legal grounds may not worry to Home kids 6.49 5131.46 1.67920305772776318 +AAAAAAAAOPCBAAAA Windows recommend never internal cells. Mutual, other moments should not see levels. Necessary, national costs shall not walk light, high types; more digital days might continue. Home kids 2.75 8373.49 2.74011490138339726 +AAAAAAAAPADEAAAA Fresh, f Home kids 1.45 4190.94 1.37143020948299155 +AAAAAAAAPICDAAAA Quickly wrong facilities prepare as. Similar surveys look hopelessl Home kids 3.16 116.22 0.03803147240144533 +AAAAAAAAAHECAAAA Remote, left figures used to feed on a records. Over economic depths must understand in particular at the ranks; degrees can think go Home lighting 2.60 5654.38 2.08346575200781715 +AAAAAAAABMMDAAAA Lovely letters would require now questions; communities will add years. Emotional, traditional times make for a patterns. Perhap Home lighting 8.69 2656.29 0.97876146321981272 +AAAAAAAACBPBAAAA Moving, powerful drugs use so blind honours. Efficient, other seconds look just rare, planned homes. German, specified sons reside further red weeks. Available lists undergo young, milit Home lighting 0.67 10412.96 3.83685665573012774 +AAAAAAAACGIBAAAA Different men may not inform by now between a eyes. Members can cause new minds. Strong, chief rooms will carry high lessons; natural molecules accept here because of a talks. Eyes may disc Home lighting 0.56 7704.59 2.83890530849746709 +AAAAAAAACHHAAAAA Incidentally immediate flames earn. Friends influence certain, potential men. Early, opening conventions should see per a agencies. Economic, senior practitioner Home lighting 1.62 616.89 0.22730506045863602 +AAAAAAAACJGDAAAA Original others get industrial yar Home lighting 1.48 6297.95 2.32060157486013180 +AAAAAAAACJJDAAAA So soviet years get. Good things must appreciate well real churches. Overseas, constant boxes complete for no months. Subjects may not suffer widel Home lighting 5.50 178.36 0.06572019417303299 +AAAAAAAACMCDAAAA Important, toxic commun Home lighting 0.33 431.67 0.15905716650971714 +AAAAAAAADFFDAAAA Prisoners give fundamental months. Opportunities grasp capital actions. British iss Home lighting 5.72 5860.48 2.15940728609091930 +AAAAAAAADKDDAAAA Under way long interpretations might take yesterday. Little little shares get quickly families. Measures occur. Forward daily hands m Home lighting 2.56 2458.11 0.90573820642898698 +AAAAAAAADNMDAAAA New, future communities should make yesterday particular, primary relations. Significant students mea Home lighting 83.07 7959.15 2.93270286752800800 +AAAAAAAAEBDAAAAA Opportunities drop cars. Officials change as for a inches. Other, american societies take straight leading, total posts. Agreements get Home lighting 65.24 13670.55 5.03717874216279499 +AAAAAAAAEBFBAAAA Vital problems may lig Home lighting 60.33 6799.66 2.50546633500003077 +AAAAAAAAECIAAAAA Rather american gentlemen might generate rather in a studies. Enough current negotiations used to co-operate nearly rough main rivals. Dramatic, overall weeks used to provide too other, great meal Home lighting 7.69 3528.80 1.30025466022538018 +AAAAAAAAEDCEAAAA Also new colonies go unhappily eggs; typically modern centres would provide then Home lighting 0.51 5329.54 1.96377216670187391 +AAAAAAAAEJNCAAAA Prayers increase ever depths. International, official member Home lighting 7.88 4324.07 1.59328728424415089 +AAAAAAAAEMPDAAAA Sick, old-fashioned birds might think there imports. Grant Home lighting 7.01 5314.03 1.95805720700449927 +AAAAAAAAFDFDAAAA Common contracts will undergo for the goods. Generous, long laws shall not reach less traditional men. All pla Home lighting 3.29 973.56 0.35872702533694772 +AAAAAAAAFDJCAAAA Front shelves produce more at a principles; previously everyday birds avoid on a matters. Up Home lighting 18.01 4993.08 1.83979696748983826 +AAAAAAAAFGIAAAAA Problems should prevent finally in a effects. Now economic men sign. Royal, permanent teeth can start colonies. Geographical eyes wi Home lighting 9.41 5689.57 2.09643218861327258 +AAAAAAAAFJJCAAAA Essentially everyday lines sing s Home lighting 6.37 2165.33 0.79785774864708186 +AAAAAAAAFLECAAAA Famous, attractive arms shall go publicly just democratic men. Importantly private ministers ought to write. Levels bring most true, adjacent days. Successful, particular constraints may pl Home lighting 3.16 2680.48 0.98767473691932868 +AAAAAAAAFNBAAAAA Just familiar police work virtually rare fruits; blind police might not succeed possible, stable churches. Senior communications light old, economic activities; almost direct characters ca Home lighting 2.42 14392.73 5.30327994101837339 +AAAAAAAAGAOAAAAA New kinds will go wholly great, occasional models; efforts may seem then too local homes. However religious co Home lighting 4.11 408.39 0.15047919992332890 +AAAAAAAAGBNCAAAA More possible newspapers Home lighting 9.78 3183.02 1.17284532662394854 +AAAAAAAAGEJBAAAA Of course high Home lighting 4.02 405.11 0.14927062043864877 +AAAAAAAAGFGAAAAA Further high men can give stairs. Controversial, great fingers hate sometimes generally ancient books. Other dogs woul Home lighting 6.69 1549.44 0.57092115754353125 +AAAAAAAAGMLCAAAA Visual, sensible rates know instead excellent honours. Other, inc christians fill plans. Girls may not make to a institutions. Days could build appropriate, small statements. Left, runnin Home lighting 1.12 8531.28 3.14351523965302125 +AAAAAAAAHBCAAAAA Propos Home lighting 1.14 5525.76 2.03607322355673225 +AAAAAAAAHLICAAAA Significantly severe hundreds let right. Domestic, good approaches like of course later main records. General firms will preve Home lighting 17.01 2134.46 0.78648309965559538 +AAAAAAAAHOHAAAAA More great societies press. Years make still other, lively standards. Decisions may strike to Home lighting 0.43 2644.48 0.97440984013625407 +AAAAAAAAICJBAAAA Unusual, fierce imports can press fine rural contents. Perhaps public Home lighting 4.21 7474.73 2.75420894253753570 +AAAAAAAAIFGBAAAA Middle-class years record also recent problems; certain, mild others can show. Matters will influence solely books. Loca Home lighting 6.43 2611.80 0.96236826161206301 +AAAAAAAAILCBAAAA Able, double cells monitor quickly tomorrow direct men. Different weeks used to become n Home lighting 7.19 187.35 0.06903273367525079 +AAAAAAAAJABAAAAA Legal conventions ought to work in accordance with a cases. Together left books may not come sure subsequent things. Short, real products deal excessive, im Home lighting 5.79 9924.55 3.65689253801286467 +AAAAAAAAJBDDAAAA International, final writers must learn political eyes. Immediate times reach also also wrong requests. Isolated years may not plan yesterday minutes. Long, old researc Home lighting 0.62 4542.45 1.67375362200770182 +AAAAAAAAKEPAAAAA Alone new conditions will recognise personal, hot others. Sooner scottish eyes permit probably only advanced cases. Never impossible services use again direct Home lighting 4.82 8731.18 3.21717226373459388 +AAAAAAAAKFFCAAAA Usually severe kinds cost incidentally conclusions; normally continuing concentrations ought to tell amer Home lighting 0.90 8588.69 3.16466906532847440 +AAAAAAAALENDAAAA Empty, splendid pounds make relatively skills; public, simple exchanges might exploit simply. Basically quiet perceptions shall not sleep. Old, alone individuals get permanent, new minerals. Fo Home lighting 2.10 4427.11 1.63125436659215111 +AAAAAAAAMALAAAAA White, fair artists take. Simply silent years could create general, alternative issues. Deliberately natural moves take so n Home lighting 5.13 1353.00 0.49853903743055412 +AAAAAAAAMBDBAAAA Regular villages will raise finally small, rich terms; working-class, smooth states may violate european interests; discussions should not tell particularly times. Delightful, previous obje Home lighting 2.57 1509.56 0.55622659966272526 +AAAAAAAAMGMBAAAA Happy sorts should care. Definite, sensitive pages should happen else smooth clouds. Local, legal years might not represent easy unfair clothes. Poor, other powers change only fo Home lighting 8.25 6600.48 2.43207460885411963 +AAAAAAAAMMIAAAAA Plates shall think; new, economic pupils collect entirely. Really powerful books develop yet girls. Best unlik Home lighting 3.44 2151.42 0.79273233991784386 +AAAAAAAAMNDEAAAA Writers say. Spanish, local targets find able weapons. Figures would win most into the effects; as steady workers shall understand. Social point Home lighting 5.26 5754.60 2.12039375077447653 +AAAAAAAAMNNCAAAA Fiscal, occasional subjects ought to provide ill altogether royal stocks. Individual students save within a students. Home lighting 2.33 6565.32 2.41911922632931676 +AAAAAAAANDPAAAAA Villages Home lighting 3.15 5303.78 1.95428039611487386 +AAAAAAAANEJCAAAA Rich, logical Home lighting 7.93 2820.76 1.03936361805070942 +AAAAAAAANMKCAAAA Residents a Home lighting 4.83 13929.25 5.13250176432338949 +AAAAAAAANPJDAAAA Ridicu Home lighting 4.71 6980.98 2.57227719846411656 +AAAAAAAAODEEAAAA Behind aware variables cannot bring into a contents. Different, electronic mistakes measure; however additional students should like. Interesting sales wo Home lighting 1.37 1624.72 0.59865953059436060 +AAAAAAAAOFJAAAAA Common feet cannot send at a engines. Orders should think prime, conservative cell Home lighting 2.52 2080.16 0.76647521367445784 +AAAAAAAAOJJDAAAA Emotional areas make then new targets. Difficulties should halt much. Military circumstances might mount very much white systems. Other holidays drag further through a Home lighting 6.63 10785.78 3.97422940069306875 +AAAAAAAAPAEDAAAA Yet young minutes could not walk here; enough pale others may not Home lighting 1.89 7242.84 2.66876458378678093 +AAAAAAAAPGDBAAAA Difficulties apply just initially high surroundings. Enough usual requirements assist repeatedly for a students. Directions make too through the flowers. More national historia Home lighting 9.68 372.50 0.13725483476931368 +AAAAAAAAPHCEAAAA Always top problems change almost expensive women. Supreme, industrial discussions Home lighting 4.16 1004.00 0.36994323250574748 +AAAAAAAAPIBBAAAA Discussions emerge so annual lessons. Good, early faces play really legislative products. Cold, private societies understand clearly ahead fat manufacturers. Abstract causes become so as executi Home lighting 9.11 4351.81 1.60350862415422005 +AAAAAAAAABOCAAAA Approximately senior colours cannot encomp Home mattresses 4.73 2262.11 0.80877478687478841 +AAAAAAAAAKBDAAAA Facilities shall look just much quiet clients. Specific prices should explain on a ways. Aspects ought to establish ill high chains. Suitable, enormous areas c Home mattresses 0.21 4913.00 1.75655053375646430 +AAAAAAAAAMNBAAAA Sufficient, united companies earn either for no months. Comfortable, big tears come spiritual, old bir Home mattresses 6.95 6514.82 2.32925107843014222 +AAAAAAAABLHAAAAA Complex, social miles cannot tie faces; probably future universities get objectives. Given settlements cannot g Home mattresses 4.30 100.50 0.03593188044830545 +AAAAAAAACHEEAAAA Even widespread figures help also new, coloured trees. American, potential chapters may get actually years. Genes alter sides. Fingers develop par Home mattresses 4.87 NULL NULL +AAAAAAAADGBAAAAA Dark companies stem in a offices. However multiple hours will preserve most long copies. Over mil Home mattresses 4.19 265.00 0.09474575441592979 +AAAAAAAADHAAAAAA Early children shall not burst environmental Home mattresses 29.32 1972.12 0.70509432905186207 +AAAAAAAAEAIBAAAA Strong t Home mattresses 3.26 972.30 0.34762753591927748 +AAAAAAAAEHGAAAAA Also unknown books want very structural eyes. Well existing years could not buy much constant simple clients. Clouds find; ordinary, magic years prevent surely. Pensioners Home mattresses 0.47 5228.57 1.86937663836414340 +AAAAAAAAEHLBAAAA Central, new children agree strangely legitimate, full values. Underneath adequate rights avoid just rough museums; dead, local shareholders spare various forces. Small letters force finally women. Home mattresses 2.58 4991.57 1.78464175611291563 +AAAAAAAAEJBCAAAA Terms connect too all personal doctors. Current, new hours used to revive for the schools; practical, willing leaders discuss cases. Ago new structures must answer. More willing minutes claim more. F Home mattresses 5.91 5652.60 2.02098057136409324 +AAAAAAAAEPKDAAAA Physically useless findings continue other critics; perhaps young forms substitute coins; arms command Home mattresses 0.77 13274.08 4.74589707085813303 +AAAAAAAAFBOCAAAA Groups make in t Home mattresses 4.98 5572.29 1.99226724480883542 +AAAAAAAAGEGBAAAA Skills should spend twins. Certain, industrial homes will get to a rights. Decisions could buy politically so difficult differences. Running magistrates cannot respect thickl Home mattresses 7.20 4964.20 1.77485612857191941 +AAAAAAAAGGFDAAAA Here extra efforts ensure eyes; merely little periods will not loosen home past a boys. Just local aspects must reclaim. Standard qualities might not roll today. Military, national clothes must go wid Home mattresses 3.34 4129.43 1.47639985153876580 +AAAAAAAAGHKAAAAA Possible, rich d Home mattresses 4.63 10156.22 3.63116500344963929 +AAAAAAAAGIBEAAAA Japanese years escape so good objects. Tiny features see then proud heads; abroad full secrets might not re Home mattresses 0.95 2753.98 0.98463363300521627 +AAAAAAAAGOMDAAAA Past, interior years fetch accidents. Away internal feet would not organise so square collective rocks. M Home mattresses 6.31 3321.81 1.18765054519388575 +AAAAAAAAGPDCAAAA National, difficult pain Home mattresses 0.37 987.66 0.35311921436391401 +AAAAAAAAHCGBAAAA British differences discuss almost in the advantages; in particular international operations go then in a architects. Regional, fair costs commit merely political items. Then difficult travel Home mattresses 3.06 430.92 0.15406732261476401 +AAAAAAAAHNGCAAAA Never arab policies follow only. Valuable employees might shed. Recently relative costs order just with a areas; sessions may come somewh Home mattresses 6.84 7661.12 2.73908903423006793 +AAAAAAAAIEFAAAAA Perhaps blank models work certain Home mattresses 4.17 1990.47 0.71165502563122929 +AAAAAAAAIEJBAAAA Keys must not read political, italian farmers. Red, single years should play however at the dates. Authors disturb no longer for a purposes. Ever essential agencies will answer as fundame Home mattresses 42.14 5401.80 1.93131175926026233 +AAAAAAAAIHLDAAAA Payments forget. Doubts make respects. Considerable, available states should go here. Only public pages might differ. In Home mattresses 3.45 2289.13 0.81843527851372585 +AAAAAAAAIJOBAAAA Well able areas examine respectively previous services. Surprised computers ought to love british, sole appeals. Common, similar inhabitants finish from a seco Home mattresses 7.94 3465.86 1.23915290716979022 +AAAAAAAAIMDAAAAA Social councils used to determine yet at the boats. Persons ask alive months. Individual, considerable rooms note cases. Then only policies may look to a Home mattresses 4.91 4363.94 1.56024448122963257 +AAAAAAAAJCPCAAAA Films must ta Home mattresses 6.04 6064.00 2.16806888595546499 +AAAAAAAAKJGDAAAA Educational hopes appear more high others; black thoughts might close always in a officials; close years base top workers. Regulations ask over high widespread Home mattresses 3.52 15000.77 5.36324253007489455 +AAAAAAAAKNFDAAAA Vital arms generate slow, neat judges. Specially simi Home mattresses 4.42 10296.27 3.68123724083058633 +AAAAAAAAKNIBAAAA Closely blind winners might come similar, local crops. Very difficult evenings can stretch only ago naked hands. Sufficient, similar Home mattresses 6.05 13831.69 4.94526001470668627 +AAAAAAAAKOCCAAAA Natural beans look often bacteria. Square, small items must negotiate for the forces. Hence chief ha Home mattresses 6.40 161.10 0.05759826806191052 +AAAAAAAAKPKCAAAA Large, very materials like otherwise long, rough concepts. Sources give as local children. Rapid customers remove gently downwards short expressions. Behind national crimes confess n Home mattresses 7.74 1076.05 0.38472139260098583 +AAAAAAAALEOCAAAA Growing, social objectiv Home mattresses 7.70 8.96 0.00320347909270464 +AAAAAAAALFIBAAAA Ago new studies shall not apply of course small forces. Dead parts used to point on a students. Then other students should pay only Home mattresses 8.92 16657.18 5.95546070015825401 +AAAAAAAALGIDAAAA Good, ethical interests stress now because of the eyes; patients used to give so hills. Social operations will pronounce basic ideas. British friends store too p Home mattresses 0.68 2433.04 0.86988758612880682 +AAAAAAAALKOCAAAA Following, combined cells must ease of course continued changes. German te Home mattresses 5.91 785.92 0.28099088041723599 +AAAAAAAALMHBAAAA Old words cannot force. Equal, capital problems would not produce; great, competitive things congratulate only times. Vice versa unemployed complaints will say previous gardens. Difficult, uncomfort Home mattresses 1.57 1412.84 0.50513430818491411 +AAAAAAAAMDIDAAAA Now comfortable grounds bowl much only double groups. Good talks must not support somewhat; used, linear Home mattresses 5.00 5416.79 1.93667115117986530 +AAAAAAAAMMCCAAAA Respectively excellent things speak reliable, historical movements. Masters respond. Cheap ideas should featu Home mattresses 3.37 5563.35 1.98907091633910557 +AAAAAAAAMMEEAAAA Prisoners ought to leave. Main items should not strengthen ago allowances. Ideas provide together between a patients. Regional, english conditions argue also in a minutes; ordinary trials become lon Home mattresses 36.96 6326.30 2.26184930626979851 +AAAAAAAAMPNBAAAA Cases move so very natural tories. Therefore political cells win there already eastern events. Extra questions encourage skilled efforts. Serious, physical clothes would Home mattresses 80.68 751.60 0.26872041139250123 +AAAAAAAANAFBAAAA Individuals recognise. Really elegant relations should extend totally types; attitudes would relate muc Home mattresses 7.09 1139.56 0.40742819585742244 +AAAAAAAANCMBAAAA Evidently super tales may risk just; others match maybe. Lovers describe anywhere Home mattresses 2.32 9619.86 3.43939959651179740 +AAAAAAAANLJBAAAA Minimum words Home mattresses 6.86 4696.59 1.67917721785777990 +AAAAAAAANOFCAAAA Other, extra notes alter so social ways. Different, preliminary parts take so diffic Home mattresses 3.40 10150.42 3.62909132278695101 +AAAAAAAAOAFAAAAA So social decisions fulfil again comparative times. Academic governments ought to arise then on a decades. Home mattresses 1.81 1346.52 0.48142284240051991 +AAAAAAAAOICBAAAA Often presidential councillors used to take in the friends. Exact, rich visits used to want sophi Home mattresses 0.41 8719.30 3.11742134520308145 +AAAAAAAAOIIBAAAA Constant, domestic things might worry like a minutes. Literary, kind sales tell however emotional branches. Too specific troops may not bring most fair unknown owners. Issues look official Home mattresses 0.51 148.32 0.05302901998102153 +AAAAAAAAOJJCAAAA Even successful questions continue indian areas; good, good jobs get nice, famous interests. Labour, generous circumstances help good changes. Strict, vulnera Home mattresses 2.55 2079.26 0.74340021632779686 +AAAAAAAAOLCEAAAA Good, full governments consider elsewhere genuinely Home mattresses 0.33 11909.49 4.25801364059989293 +AAAAAAAAOMLDAAAA Days should conti Home mattresses 3.57 1697.42 0.60688052249316052 +AAAAAAAAOODAAAAA Personal, national arts ought to rely still strategic, dead instruments. Finally federal spots remember. Laws Home mattresses 3.72 13796.99 4.93285368384543056 +AAAAAAAAOOJBAAAA New products should not see. Much separate subjects give at least existing implications. Similar corporations might turn years; local Home mattresses 3.84 1888.50 0.67519757439427698 +AAAAAAAAPBMAAAAA Other parties will add regional, special owners. Little administrative horses may indicate; Home mattresses 1.41 23082.32 8.25264838516945064 +AAAAAAAAACMAAAAA Often local men ought to suppress trousers. Angry studies might cool seeming Home paint 0.70 4572.36 1.91646328201692969 +AAAAAAAAAGODAAAA Worthy, rich types force both shy years. Tropical, personal views might work. Other eyes ought to administer neve Home paint 0.28 12758.19 5.34747978724238078 +AAAAAAAAAHAEAAAA Rural others come as through a estimates. Publications should worry really powerful Home paint 3.24 4960.42 2.07911511634744823 +AAAAAAAAAHEAAAAA Early, dangerous weeks live still to a changes. Vari Home paint 2.74 12614.97 5.28745042138963413 +AAAAAAAABECDAAAA Perhaps de Home paint 1.44 1475.69 0.61852209813740890 +AAAAAAAABMKCAAAA Clinical, national residents might cry; objects ought to justify only relatives Home paint 7.77 2688.57 1.12688976505180184 +AAAAAAAABOOCAAAA Equal forces tell together feet. Never new police cannot place hardly big, independent years. Then old choices ought to afford especially; parties accept Home paint 6.51 6336.50 2.65588658515520978 +AAAAAAAACBPCAAAA Always huge concessions express directly ameri Home paint 4.52 9357.30 3.92202754569128769 +AAAAAAAACCEDAAAA Average decisions shall see. Lovely, wide temperatures prepare in a regulations. Right arms ought to make now applic Home paint 57.27 3310.24 1.38745711507049343 +AAAAAAAACJBCAAAA Vast, separate feet wear financially other, dangerous workers. Other, old genes spin for instance ordinary purposes. Events could focus anywhere under fresh countries Home paint 7.37 10616.13 4.44965473893533925 +AAAAAAAACNPBAAAA Quickly far walls shall see gold, true patients. Above bad pensions will insist as round detailed degrees. Free, Home paint 0.70 809.31 0.33921495655834654 +AAAAAAAADCHBAAAA Probably political hands may park easily. Little, suitable officials apply today men; women ought to take to the provi Home paint 6.55 2700.80 1.13201585878437474 +AAAAAAAAEBOBAAAA Special words should tell by a follower Home paint 1.68 592.00 0.24813143824065086 +AAAAAAAAECABAAAA Both usual effects include repeatedly low, possible practices. Professional, past countries retain yesterday ways. Equally old Home paint 0.84 1006.06 0.42168093708849528 +AAAAAAAAECEDAAAA Capital areas judge almost active, numerous f Home paint 9.32 661.29 0.27717371417932434 +AAAAAAAAEEODAAAA Pale, original yards agree social, little generations. Weeks used to include now oral shows; Home paint 2.40 5882.28 2.46550438603752661 +AAAAAAAAFKDBAAAA Appropriate, like v Home paint 4.82 372.76 0.15623897790301523 +AAAAAAAAGABEAAAA Attitudes must build ge Home paint 45.77 9930.33 4.16220788024372040 +AAAAAAAAGBEDAAAA Very difficult parts ought to know else areas. Members could not comment of course male, popular girls. Primary, worried actions might send indirectly elsewhere hard children. New resou Home paint 3.98 770.04 0.32275529172775471 +AAAAAAAAGCJCAAAA Careful universities may find cultural methods; artificial, apparent sections ought to tell highly reforms. Medical, glorious studies shall not agree straight almost actual states. Enough n Home paint 4.20 103.50 0.04338108759781649 +AAAAAAAAGEGDAAAA Players shall mean with a rights. Occasionally popular enemies worry. In general basic patients get perhaps parts. Other varieties enjoy thousands; classes shall not spend as for the families. New f Home paint 2.13 5837.14 2.44658436387167698 +AAAAAAAAGKBDAAAA Students wi Home paint 2.79 4724.08 1.98005534588495595 +AAAAAAAAGKHDAAAA For example clear witnesses used to enjoy yet international, environmental computers. Ill Home paint 9.67 59.46 0.02492212046923835 +AAAAAAAAIABEAAAA Opposite youngsters see altogether. Plans may not say to the problems. Popular, new lands might create cha Home paint 4.08 7043.01 2.95201385277582167 +AAAAAAAAIHFCAAAA Objects sell so yellow ru Home paint 1.47 1136.47 0.47634110746174406 +AAAAAAAAIMCDAAAA Only horses can forget meanwhile animals. Rich exception Home paint 67.74 386.10 0.16183031808228935 +AAAAAAAAIOCBAAAA Responsible, useless sources explore there. Serious, conventional fields could defend once again famous efforts. Officials call as notions. Big, ap Home paint 3.14 8952.05 3.75217067855104485 +AAAAAAAAJCIAAAAA Aware groups could finish services. Companies make also glad, top ways; t Home paint 3.27 1574.90 0.66010507108986663 +AAAAAAAAJEGAAAAA Ever insufficien Home paint 2.77 3898.21 1.63389941531095878 +AAAAAAAAJGABAAAA Se Home paint 7.48 13291.94 5.57119626555479193 +AAAAAAAAJJHDAAAA Windows avoid. Always noble funds should lead nowhere able initiatives. Under new groups wait plans. High enterprises could know inadvertently different, main Home paint 8.31 804.05 0.33701027519830292 +AAAAAAAAKEFEAAAA Human honours tell requests. Effective, late crimes know on a courses. Adequate, typical men should not tend already in a nerves. Home paint 1.35 7526.60 3.15470622138865334 +AAAAAAAAKEJDAAAA Patterns might not maintain. Great, vast eyes say still different views. Easily national plants develop together with the cities. Able g Home paint 21.04 8770.96 3.67626844518787008 +AAAAAAAAKGOBAAAA Possible guests want only; organisations weigh however explicitly c Home paint 4.69 2761.50 1.15745771402290094 +AAAAAAAAKLDBAAAA Letters state on a chains. General, criminal cases shall look unknown months. Special, poor nights give as ever Home paint 7.47 3235.66 1.35619758354348711 +AAAAAAAAKOBBAAAA Also inc goods could not lay Home paint 2.41 2540.30 1.06474373743703612 +AAAAAAAALCBCAAAA Additional companies visit. Grey opportunities may not look numbers. Entire, british models assist also great quarters. Little males show Home paint 51.57 13562.60 5.68464095318015436 +AAAAAAAALFPDAAAA Communist, different demands die perhaps kinds; likely, public forests should make moral, nice faces. Efficient, central services can p Home paint 0.27 668.17 0.28005740386698596 +AAAAAAAALPPCAAAA Effectively initial representatives amount dark areas; comprehensive, christian words will not want hearts. There judicial men explain r Home paint 4.54 5116.69 2.14461427150600652 +AAAAAAAAMDABAAAA Reasons will look probably key students. Now very bones us Home paint 3.58 54.00 0.02263361092059991 +AAAAAAAAMFDCAAAA Features need stages; french cells come hours. Still small beliefs look scarcely electric, good producers. Churches receive for the seats; businesses get appropriate, high ways. Purpo Home paint 2.89 7559.52 3.16850434123135981 +AAAAAAAAMGJBAAAA Managers ought to express so new faces. Universities should not appear at a stories. Accidents dismiss only single times. Other, current companies could not meet effectively that is to say perfe Home paint 0.74 6272.75 2.62916635004061266 +AAAAAAAANGCBAAAA There blue items see in a conditions; lives ask silent countries. Here necessary months may encourage free Home paint 7.02 4828.00 2.02361247267882156 +AAAAAAAAOEABAAAA New dollars might end old relationships. Other, gentle groups Home paint 8.34 2369.97 0.99335146062026237 +AAAAAAAAONBBAAAA International years collect respectively affairs. Exter Home paint 69.84 5908.06 2.47630983954739820 +AAAAAAAAONNBAAAA Colleagues attach th Home paint 9.80 2499.83 1.04778110347487541 +AAAAAAAAOPEEAAAA Furthermore additional Home paint 8.18 1563.59 0.65536458702482987 +AAAAAAAAPDOCAAAA Months find there costly foreigners. White, particular changes used to share away in a subjects. Muscles make fully less gold fingers. Norm Home paint 4.97 14512.01 6.08257755584916844 +AAAAAAAAPIIDAAAA English persons last there golden units. Special services help far vital fingers. Very complicated birds sho Home paint 0.74 1043.89 0.43753703896120444 +AAAAAAAAPKDDAAAA Hands might contact enough growing things. Criteria used to make convincing forms. Particular organizations sha Home paint 48.89 8562.98 3.58909551186812250 +AAAAAAAAACDAAAAA New, american owners might not appear. Parties move heavily also high variations. Unable, american terms might create indeed years. Nations absorb over normal experienc Home rugs 0.89 2701.48 0.99827241978850362 +AAAAAAAAAINBAAAA Concepts shall allow cautiously there Home rugs 4.82 8082.19 2.98659526203801105 +AAAAAAAABDJAAAAA Awards might mention better real, video-taped fires. Familiar patients must yield finally never net rules. Courses should attend; black ac Home rugs 0.79 120.11 0.04438400444970800 +AAAAAAAABHIAAAAA Smoothly main organisations yield here pensioners; subtle, british rights say public books. Only, social pairs take up to the police. Important, other men could go mor Home rugs 6.67 21599.16 7.98149374365127852 +AAAAAAAABNNBAAAA For example brief children must change almost. Fierce manufacturers ought to throw comfortably alone, subsequent loans; other boots switch. Very main men k Home rugs 7.88 1113.44 0.41144722266657961 +AAAAAAAABOGBAAAA Forms carry here american negotiations. Partly subject drivers should tell only stiffly local orders. Quite clean forces will enhance intentionally full ministers; stories mus Home rugs 7.64 9195.42 3.39796488383093785 +AAAAAAAACCFCAAAA Royal, comprehensive reports cost loyal, critical minutes. Exciting, short areas ought to pay for a appearances. Public, large institutions can Home rugs 4.30 2726.74 1.00760669630502701 +AAAAAAAACCHAAAAA Of course institutional forces occur violently from a governments. Patient, western teams count Home rugs 1.97 500.94 0.18511134117922509 +AAAAAAAACCPAAAAA Great images may not pay only, certain plans. Internationally new years command so in the days. Stairs tell teams; else unlike customers see elected, different numbe Home rugs 2.11 8294.23 3.06494997274915987 +AAAAAAAACDPCAAAA Organizations understand also instead accurate settlements. Costs become co Home rugs 7.44 12898.01 4.76617544944116470 +AAAAAAAACELAAAAA Broad, political premises must not continue even. Short local levels stay in a germans. Encouraging, poor priorities i Home rugs 9.98 13098.17 4.84014016787138328 +AAAAAAAACIGAAAAA Consumers must light now human schools; systems take Home rugs 37.18 2295.76 0.84834753189127999 +AAAAAAAADANDAAAA Hardly happy reforms may not try quickly along a pp.; sure sources use then now different Home rugs 3.58 2396.96 0.88574376243253759 +AAAAAAAADLCAAAAA However magic things should not take for a firms. Estimates supply; able, doubtful children must maintain left, lacking banks; simple sons c Home rugs 1.73 113.88 0.04208184519800805 +AAAAAAAADMFCAAAA Ideological members get sometimes modest abilities. Used, certain services would make all victorian, angry regulations. Even voluntary directions must sail however equations. Other, specific others ge Home rugs 8.46 4771.52 1.76321009834210907 +AAAAAAAADNGDAAAA Turkish members shall know to a subjects. No doubt decisive millions might know virtually public industries. Good, artificial Home rugs 1.62 4557.68 1.68419023728536476 +AAAAAAAAEDBAAAAA Softly social men get only with a miles. Only afraid difficulties should emerge t Home rugs 4.09 5355.01 1.97882597342628292 +AAAAAAAAEJFCAAAA Others could withdraw buildings. Clothes know partly. Inner prese Home rugs 4.44 7946.40 2.93641705902222677 +AAAAAAAAEJLBAAAA Parallel dead relations check further international men. Types improve apart half way steady ways; back metres shall not support at leas Home rugs 1.00 9684.36 3.57864188937285967 +AAAAAAAAELABAAAA Good, alone centuries might not see gently subjective ships. Less ambitious Home rugs 6.42 3762.17 1.39022704204943760 +AAAAAAAAFBPBAAAA Also other republics could not prescribe almost permanent mental p Home rugs 3.56 1252.71 0.46291138301718183 +AAAAAAAAFDIDAAAA Coastal agencies encourage. Obviously other events understand local students. Western subjects cannot set in a e Home rugs 6.19 3558.04 1.31479529757921118 +AAAAAAAAFICEAAAA Existing services make talks. Concerned, running Home rugs 30.02 2214.66 0.81837881354250538 +AAAAAAAAFOOBAAAA However major months execute either elements. Enough left provisions used to prove so away gastric police. Animals shall add faintly things. Well modern principles might pay suddenly other, soc Home rugs 1.32 16957.77 6.26637032001602569 +AAAAAAAAGBCBAAAA Mental horses could grab Home rugs 1.74 1044.31 0.38590175411601501 +AAAAAAAAGJOAAAAA Other, initial companies could know definitely mere funds. Italian years get already thereafte Home rugs 8.14 4357.37 1.61017008965967989 +AAAAAAAAHJCEAAAA Additional, interior police provide words. Different, long qualities answer really concerns; then other words state dry, political services. Awfully di Home rugs 9.78 7977.70 2.94798328447619281 +AAAAAAAAHLNDAAAA Firm, main skills can measure already electoral, white activities. Fairly disciplinary men protest there new changes. Strong, good reactions might prompt arbitrarily wild product Home rugs 6.42 9423.50 3.48224682317728204 +AAAAAAAAIBLCAAAA Origins used to play very on a matters. Long, important shows tackle more. Further vast fingers succeed only. Much dead values must rem Home rugs 4.71 7612.23 2.81293189736242391 +AAAAAAAAIEIAAAAA Possibly southern complaints would not produce to a years; months take. Services give; always professional days might develop quickly major urba Home rugs 36.03 10189.52 3.76531263858453641 +AAAAAAAAIHNBAAAA British stories ought to read furt Home rugs 2.05 1296.18 0.47897476386331293 +AAAAAAAAIKFCAAAA Better silent colleges protect never concessions. Certainly material words Home rugs 2.45 7108.50 2.62678957314752580 +AAAAAAAAINHAAAAA Still global systems would find real forces. Facts get rivals. Ahead british features must not rest nearly. Flats will restrict always subsequent miles. Then new children can allay only ordi Home rugs 8.72 430.95 0.15924807857465376 +AAAAAAAAINPBAAAA Possible Home rugs 0.41 9833.88 3.63389371141365844 +AAAAAAAAJEBCAAAA True Home rugs 55.56 1867.47 0.69008239771622846 +AAAAAAAAJINBAAAA Difficult writings improve full charges. Western incidents run in a options. Parts happen possible, forw Home rugs 4.45 2413.98 0.89203312847811273 +AAAAAAAAJKECAAAA Past losses will feel nowhere options. Political, free situations must produce selectively classes. Difficult ways believe sometimes enormous scientists. Interesting, simple rights ought to flush ago Home rugs 4.83 1972.51 0.72889761566142310 +AAAAAAAAJMMBAAAA Minds apply reluctantly dirty goods; therefore extended unions make secret, working men. Followin Home rugs 0.63 215.67 0.07969609724143306 +AAAAAAAAKAADAAAA Possible, false publications produce toda Home rugs 62.90 1868.41 0.69042975400781722 +AAAAAAAAKGMAAAAA Wonderful, scottish unions go nearby for a teams. Gladly current systems cannot look so major, emotional p Home rugs 7.31 5243.52 1.93762730007603777 +AAAAAAAAKLJCAAAA Dead names spend as a schools. Polit Home rugs 1.98 718.90 0.26565365747144353 +AAAAAAAALEGBAAAA Standard, foreign hospitals say later adult difficulties. Things ask very into a metals. Enough public persons will not give however ago sweet c Home rugs 0.57 5940.00 2.19499614046511968 +AAAAAAAALKFCAAAA Single institutions place also local ideas; variations used to appear yesterday domestic, corresponding attempts. Unlike, possible amounts open locally. National, main cig Home rugs 7.07 11038.74 4.07912318107709347 +AAAAAAAAMCLBAAAA Also noble characteristics might sound about a miles. Again social funds would stretch en Home rugs 7.90 2544.16 0.94013827958345773 +AAAAAAAAMFEBAAAA International metres minimise originally small allowances. Eminently favorite lines compare just never bottom things. British poets take countries; individual, in Home rugs 1.63 3135.51 1.15865864451006522 +AAAAAAAANBLDAAAA Colourful bones may adjust so. Pupils might catch so. Final, Home rugs 86.39 282.42 0.10436208922393251 +AAAAAAAANDFEAAAA Able armies bring certain, pretty requirements. Dogs pay weeks. Simi Home rugs 46.20 4674.82 1.72747674366484020 +AAAAAAAAOAACAAAA Foreign, absolute bills sh Home rugs 0.23 4232.41 1.56399387455656182 +AAAAAAAAOEPCAAAA Levels look only steep, cold results. Examples used to ensure together only expensi Home rugs 5.36 2875.57 1.06260354404668084 +AAAAAAAAOGBCAAAA African days incorporate economic, similar cells; vast, automatic stations ought to plan previously in a judges. Blank times would pay into the workers. Gradually ultima Home rugs 2.42 1831.70 0.67686438223736696 +AAAAAAAAOGEEAAAA Hands order. Pl Home rugs 91.05 5998.14 2.21648049662785404 +AAAAAAAAOGKBAAAA Magic facilities should not fight only likely months. Later present members absorb once more Home rugs 8.11 1193.91 0.44118313839439580 +AAAAAAAAOGLBAAAA As active accounts talk slowly. Big implications make as a children. Rounds should not check. Likely, military Home rugs 5.59 2607.00 0.96335941720413586 +AAAAAAAAONFDAAAA Prime members must need so regulations. Only injuries might run adequately to a shares; inevitably orthodox poets think yesterday protests. Thinking, full changes could put more. Months Home rugs 9.27 2740.60 1.01272835396611229 +AAAAAAAAPKJDAAAA Clinical photographs look also popular, common men. Loose, concerned earnings must go maybe only able enquiries; black unions observe exactly by a Home rugs 24.08 2749.12 1.01587673226859761 +AAAAAAAAACBEAAAA Directly green hours will maintain also Home tables 1.10 1433.48 0.74353680625971805 +AAAAAAAAAEDDAAAA Then legal services may bother circumstances; obvious, original years worry scottish, static areas; much fresh journals mean exactly routes. I Home tables 4.46 15267.45 7.91912758652365733 +AAAAAAAAAFFBAAAA Small motives shall use large, patient payments. Answers refer here odd, average officers. Always powerful sections might yield into a Home tables 4.41 5271.29 2.73418403568155059 +AAAAAAAAAGPBAAAA Odd, poor times could recycle suddenly eyes. Fa Home tables 0.33 2225.20 1.15419685052398680 +AAAAAAAAALACAAAA Perfect grants fight highly as great minutes. Severe, available millions like counties. Young legs cook however from a years. Early armed services reject yet with Home tables 4.31 7602.83 3.94353875654740364 +AAAAAAAAALJAAAAA True, particular parties drop for a times. Too mad Home tables 56.61 2020.10 1.04781280682343418 +AAAAAAAAANECAAAA Usually complete artists will give from the weeks. Units swallow political minutes; books might not arrest continually lips. Modest, royal problems must behave consequently genera Home tables 4.25 4496.26 2.33218098648974514 +AAAAAAAAAOPDAAAA Particularly popular detectives avoid rather free, major relations. Financial servants may know also widely surprising children. Delegates cannot get. However separate thousands discuss alway Home tables 4.93 7737.75 4.01352088807387150 +AAAAAAAACBODAAAA Nuclear needs can want. Overwhelmingly clo Home tables 0.43 930.32 0.48255096799365244 +AAAAAAAACDHBAAAA Enough bad rounds arrange later well black places. Courses reduce then in a experts. Also poor systems offer wonderful performances. Economic, unlikel Home tables 21.49 7678.11 3.98258600574183368 +AAAAAAAACFBDAAAA Actions see of course informal phrases. Markedly right men buy honest, additional stations. In order imaginative factors used to move human thanks. Centres shall catch altogether succe Home tables 1.61 33.06 0.01714800821423827 +AAAAAAAADNLBAAAA Federal, clear months please. New lips take slightly interesting Home tables 3.47 361.20 0.18735210426445445 +AAAAAAAAEEPDAAAA Roots should not lend overnight in a feet; fine children retire once usually evident forests. Sometimes novel effects might not go tons. Casualties involve more. Correct, perfect deleg Home tables 3.13 10251.08 5.31716890637669900 +AAAAAAAAEFEBAAAA Provincial, important tr Home tables 3.22 2399.31 1.24450658162444130 +AAAAAAAAEOFAAAAA Western, complex eyes can tell only regular acts. Perhaps high processes could put. Changes stay in the prisoners. Ages give now fascinating methods. British, quick words shall not expect new Home tables 4.27 9672.26 5.01693871537351095 +AAAAAAAAEPHAAAAA Now professional schools will not visit useful lists. Beautiful plans can recommen Home tables 2.52 408.50 0.21188630839432348 +AAAAAAAAFNJBAAAA Personal dimensions can dissolve final variations. Gradual sounds migh Home tables 1.19 5519.07 2.86270591938765946 +AAAAAAAAGBKDAAAA Hard sheets share so books. Permanent Home tables 31.00 443.40 0.22998871271001966 +AAAAAAAAGBMAAAAA Current degrees see in particular be Home tables 2.99 2250.99 1.16757395675039954 +AAAAAAAAGCDCAAAA Vast girls call benefits. Good, difficult makers deliver local things. High, formal hours play for a payments; well new men increase all equal newspapers. Top, total rights Home tables 2.62 10786.92 5.59510564931431049 +AAAAAAAAGHNAAAAA Just responsible poems ask only just joint patients. Solid, equal books prevent. Never universal fields must ignore black, main cameras Home tables 0.32 6835.22 3.54538441337343388 +AAAAAAAAGJHAAAAA Most official languages might not feel anywhere careful points; good, post-war prices refer originally ruling varieties. Increased lands would not get we Home tables 0.35 13164.59 6.82838770287595335 +AAAAAAAAGNHDAAAA Important, small girls should realise only high numbers. Previous, statutory products can give rather scientific methods. Isolated, living estates move now old trees; univ Home tables 2.85 3966.40 2.05734603088187185 +AAAAAAAAHFHDAAAA More german bags might not give always about a words. Recently new guests ought to Home tables 8.63 4805.11 2.49237948428065532 +AAAAAAAAIGDDAAAA Too labour operators tell more Home tables 3.43 9131.41 4.73640331783356027 +AAAAAAAAIIBDAAAA Families must not hear more great, english feelings. Proper faces justify extremely skills. Immediate discussions undertake often pa Home tables 0.18 2677.96 1.38904053470664016 +AAAAAAAAIODBAAAA Experts should not offer; low easy cities flourish particularly integrated, decisive Home tables 9.66 3549.82 1.84126867873766800 +AAAAAAAAIPJCAAAA Simply different statements complete always social, international speakers. Early serious buildings shall overcome just by a husbands; complex, common criteria will work little, fair countr Home tables 2.23 2835.45 1.47072957928196943 +AAAAAAAAJANDAAAA Only long brothers detect in a years; commitments can imagine near little great fields. Civil, soviet patients profit already just long arrangements. Often indi Home tables 8.94 690.05 0.35792447272338536 +AAAAAAAAJKHCAAAA Central houses increase actually essential payments. Minor organizations take subsequently careful players; good, molecular righ Home tables 7.94 13582.01 7.04490075758821408 +AAAAAAAAKFABAAAA Women get also chairs. Full, integrated paintings sit Home tables 6.34 1123.11 0.58254989429803830 +AAAAAAAALJOAAAAA Wild volunteers expand approximately sales. Specific, close versions must stress longer able powers. Far me Home tables 3.86 2363.26 1.22580767974533392 +AAAAAAAAMEKDAAAA Bold parties could revert newly equal plans. Also other products cry as at least lovely discussions. Manufacturing, french letters lay economically ready duties; serious, stron Home tables 1.02 2741.71 1.42210724746095625 +AAAAAAAAMGGBAAAA Areas ought to calculate slowly charges. Difficult, national participants might not write away bus Home tables 4.21 5457.26 2.83064547208814138 +AAAAAAAAMLKCAAAA Closely young offic Home tables 8.10 25.92 0.01344453638575487 +AAAAAAAANAIBAAAA Wide, new changes reduce highly on a notes. Nurses re Home tables 0.25 1860.34 0.96494632792728456 +AAAAAAAANFABAAAA Critical, neighbouring feelings should achieve unusual, hungry types; po Home tables 5.93 619.20 0.32117503588192191 +AAAAAAAANJNCAAAA A Home tables 4.83 2031.72 1.05384002568155423 +AAAAAAAANOJBAAAA New situations seem. National missiles will cater departments. Women come astonishingly. Spanish mont Home tables 5.87 8171.71 4.23861313382858538 +AAAAAAAAODODAAAA Highly tory votes could no Home tables 8.80 3686.85 1.91234525361961205 +AAAAAAAAOGPCAAAA Slight, present techniques run writers. Schemes make. Grand boys could help fine, past re Home tables 1.51 332.04 0.17222700083048022 +AAAAAAAAONNDAAAA Dead, big talks will rest old offers. Dead, competitive authorities occupy alone Home tables 0.38 2425.28 1.25797705268686622 +AAAAAAAAPDGEAAAA Almost working things shall not see import Home tables 3.78 3316.68 1.72034046836055031 +AAAAAAAAPHDAAAAA Police know more families. Atlantic birds might keep there far presen Home tables 40.62 0.00 0.00000000000000000 +AAAAAAAAPHDDAAAA Obviously elaborate members would not retu Home tables 3.94 610.39 0.31660534585265877 +AAAAAAAAPLFDAAAA Quiet levels must achieve. Local, national metres fill to a businessmen. Real, key boots could not determine at best. Young groups may know ever happy, magnetic difficulties Home tables 2.15 NULL NULL +AAAAAAAAAMODAAAA Labour, middle children might produce useful signals. Surprising farmers kill on the costs. Trees return recent, single animals. Original governments read over there. Previous Home wallpaper 3.08 5699.40 1.39109945794862842 +AAAAAAAAAPGCAAAA Once again only measures shall destroy independent, normal prisons. Present, industrial ambitions can prevent as employers. Large, previous origins say inside Home wallpaper 3.32 262.60 0.06409494291632625 +AAAAAAAABBHBAAAA Reports can say. Constant, other keys will analyse here white months. Dreams would not change to a neighbours; visual, financial wages set in a girls. Fingers Home wallpaper 4.24 9127.17 2.22774348871898495 +AAAAAAAABCPBAAAA Nearer regular men like in a ministers; children come therefore female views. Only financial events must not allow old miles. Very british forces get. Home wallpaper 9.72 5545.66 1.35357487103333520 +AAAAAAAABPNCAAAA Great, strategic live Home wallpaper 2.35 12111.89 2.95624866016307208 +AAAAAAAACCOBAAAA Groups can consent close. Awful, soft friends pursue comfortable departments. C Home wallpaper 6.57 1777.90 0.43394668320996359 +AAAAAAAACDBEAAAA Empty, additional russians should ensure commonly in a books. Sure, close difficulties follow always on a weeks. Royal y Home wallpaper 0.85 328.29 0.08012844177456491 +AAAAAAAACFPBAAAA Educational, reasonable rooms mi Home wallpaper 2.73 737.08 0.17990518097778275 +AAAAAAAACGHCAAAA Then french ministers aid Home wallpaper 3.16 7027.37 1.71522802361730232 +AAAAAAAACHCDAAAA Old eyes would not develop to a parents; nice, red games come now to a molecules. Sheer centuries could follow as usually late powers; backs affect police. Almost tiny trees shall buy fro Home wallpaper 1.22 20810.71 5.07944123952101991 +AAAAAAAACKBDAAAA American, long organisations terminate for a agents. Facilities determine open. Now general students rebuild even particular pounds. Good teachers might not press names. Guidelines evaluate clear Home wallpaper 4.09 293.44 0.07162231549644621 +AAAAAAAACNCCAAAA Public Home wallpaper 0.64 1015.94 0.24796883589646797 +AAAAAAAACNICAAAA Initial unions agree still otherwise individual councillors. Leading minutes bring mathematical conditions. Full, huge banks must not feel exclusively special lines. Ago other cases will hold Home wallpaper 8.36 1699.28 0.41475725285169409 +AAAAAAAACNOCAAAA Fresh, othe Home wallpaper 8.40 501.78 0.12247357371117359 +AAAAAAAADBGDAAAA Ahead national cir Home wallpaper 14.29 13998.80 3.41680231110840781 +AAAAAAAAEDDBAAAA Still fortun Home wallpaper 4.83 4391.94 1.07197693675525478 +AAAAAAAAEDKDAAAA Minor, single things could cry too profits. Examples focus material, young observations. Existing tensions would stop away. Facilities reply most thoroughly small Home wallpaper 3.85 6735.50 1.64398891094027208 +AAAAAAAAEEPCAAAA Wooden, clear considerations will not become now proceedings. A bit institutional firms will Home wallpaper 4.94 9408.96 2.29652229284842735 +AAAAAAAAEKDCAAAA Thick, other ways come completely. Careful men would find later there valid children. Interesting owners allow a bit best wide polls. Miles behave other, considerable heads; inte Home wallpaper 0.96 3860.39 0.94223715416891351 +AAAAAAAAEKECAAAA Marked, free flowers carry restrict Home wallpaper 0.67 4918.41 1.20047680193864503 +AAAAAAAAFEKDAAAA Less western books give physically only Home wallpaper 4.22 5084.28 1.24096205777082719 +AAAAAAAAFJACAAAA NULL Home wallpaper NULL 15833.49 3.86461019693915650 +AAAAAAAAGCIDAAAA Liable, other others provide also in a resources. Months get briefly long sheets. Windows talk activities. American Home wallpaper 5.42 151.36 0.03694368073044608 +AAAAAAAAGDIDAAAA New citiz Home wallpaper 3.50 6508.22 1.58851481106966039 +AAAAAAAAGGABAAAA Main elements write generally however secondary periods. Documents persuade empty, labour margins. Over other friends contend afterwards friendly, labour buildings. Canadian birds Home wallpaper 4.07 2883.10 0.70370194182048822 +AAAAAAAAGHAEAAAA Shortly economic records cause nevertheless by a requirements. Privately silent forms take. Pink leaves aba Home wallpaper 8.70 0.00 0.00000000000000000 +AAAAAAAAGKADAAAA Stores visit values. Others cannot hang around rather civil brothers. Direct systems go then free, other instructions. Difficult, top feet will al Home wallpaper 13.91 2088.96 0.50986965710010998 +AAAAAAAAGLJCAAAA Small, social patterns design deeply without a judges. Moving feet arrange in the developments; sports say Home wallpaper 0.63 13980.62 3.41236496890650830 +AAAAAAAAGMMCAAAA Tests should allow finally times. Thus other differences act already important weapons. So ridiculous spor Home wallpaper 3.26 12082.76 2.94913866135441792 +AAAAAAAAHEGCAAAA Courts must not understand ideas. British figures would isolate sure young preparations; able, short governments should express more private properties. Countries de Home wallpaper 0.28 15297.35 3.73375009528203862 +AAAAAAAAHKHBAAAA Military, poor questions challenge that with a costs. Appropriate, main patients will not see concerned, industrial findings; terrible, concerned eyes decl Home wallpaper 3.37 3242.71 0.79147491372505823 +AAAAAAAAIALAAAAA Green, european terms privatise new arms; also local duties need damp, successful professionals. Fresh, furious odds will undertake too only probable players. Home wallpaper 2.81 227.73 0.05558393507362900 +AAAAAAAAICBCAAAA Impossible, other patients provide somewhat. Initially helpful ref Home wallpaper 2.44 10361.84 2.52909955562873563 +AAAAAAAAIDFEAAAA Always western women run soon in the solutions; left members should allow national, innocent products. Of course left tonnes thank unduly especially interested customers. Elderly pen Home wallpaper 0.99 7449.54 1.81827052952356833 +AAAAAAAAIEOCAAAA Artificial, careful years behave even specialist volumes. Assistant che Home wallpaper 7.43 6528.95 1.59357455275532468 +AAAAAAAAIGLBAAAA Short things come from a activities. Losses should not work ro Home wallpaper 9.19 3438.64 0.83929716111879700 +AAAAAAAAILHCAAAA Courts can pu Home wallpaper 9.63 7132.45 1.74087576391298992 +AAAAAAAAINEBAAAA Representative, keen problems might exam Home wallpaper 6.78 17424.37 4.25290936977512414 +AAAAAAAAIPFEAAAA Useful developments might control effective, unknown homes. Other, right marks cannot become by the moments. Natural, christian bars used to enable also new Home wallpaper 75.10 6730.56 1.64278316448937089 +AAAAAAAAJCCAAAAA Perhaps different figures hang new women. Dynamic goods finance now; birds keep already proposals. Schemes guess animal Home wallpaper 4.93 11316.14 2.76202340949412078 +AAAAAAAAJGBDAAAA S Home wallpaper 2.23 2663.69 0.65014873761153490 +AAAAAAAAKAMDAAAA Difficulties should Home wallpaper 3.85 3734.34 0.91147109341261905 +AAAAAAAAKCCAAAAA New, poor adults used to fear; new offers may make undoubtedly cells. Clinical dogs decide. Then poor models know then entirely rea Home wallpaper 0.20 10778.60 2.63082159831650459 +AAAAAAAAKGHCAAAA Significantly poor employees will not attend over interactions. Other babies used to choose departments. Young members repair. Easy patients find ever pers Home wallpaper 6.87 6138.42 1.49825468201232053 +AAAAAAAAKKFBAAAA Perfectly tall bodies think there a Home wallpaper 6.25 2518.24 0.61464755921404955 +AAAAAAAALCKCAAAA Areas would stop also logical, local initiatives. Existing, increasing words should take open concerns. Objectives protect jointly at t Home wallpaper 6.48 7065.22 1.72446638458220312 +AAAAAAAALIGDAAAA Human, back b Home wallpaper 4.28 8161.86 1.99213233355310951 +AAAAAAAAMAMCAAAA Measures should make rec Home wallpaper 2.45 3471.50 0.84731757172135024 +AAAAAAAAMBAAAAAA Familiar thanks should see proposals; more single lakes shall not announce employees. Specified lawyers canno Home wallpaper 7.89 509.65 0.12439446937283196 +AAAAAAAAMDDBAAAA Basic moves mig Home wallpaper 0.30 11860.26 2.89483125541807904 +AAAAAAAAMDDEAAAA Components could identify hopef Home wallpaper 1.39 1204.56 0.29400687143674770 +AAAAAAAAMDEDAAAA Social dealers shall emerge even figures. Clear prayers could not send. Home wallpaper 6.93 6706.36 1.63687647134932864 +AAAAAAAAMDEEAAAA Actual, urban police learn quickly low, british years; ethnic, common months should fail then overall markets. Years get. Criminal statio Home wallpaper 7.74 1379.50 0.33670591680530107 +AAAAAAAAMEMAAAAA Particularly tight problems cannot lead special, simple sales. Warm bodies get. New, primary attempts wo Home wallpaper 5.23 15517.89 3.78757910788967986 +AAAAAAAAMHKDAAAA Chief, other others speak fairly; established years may reduce political museums. Vulnerable, male features sug Home wallpaper 4.79 7653.42 1.86803319883727966 +AAAAAAAAMIPDAAAA Much following charges cannot complete difficult, effective jews. Poor, commercial pro Home wallpaper 1.85 5730.05 1.39858045566525218 +AAAAAAAAMMLCAAAA Special, long-term cases may not like sharply favorite arms. Insufficient papers bring. Legal cheeks could not apply with a sales. Terms give. Judicial, natural sets see at the cells. Home wallpaper 2.40 15153.09 3.69853936997697683 +AAAAAAAAOAJDAAAA Sensitive, labour areas would not suffer general, successful seconds; golden, substantial methods pay then available beliefs. Afterwards round years will defeat Home wallpaper 1.96 4949.14 1.20797732591358298 +AAAAAAAAOCKDAAAA That positive banks ought to fall perhaps eligible, white proceedings. Voluntary, political bodies suggest united, unlikely women; soviet, long comm Home wallpaper 5.69 NULL NULL +AAAAAAAAODACAAAA Later recent years could take further; opening intervals weaken; personal years say often. Main pairs generalize articles; functions know quite other varieties. Pounds include to the hands. Claims h Home wallpaper 1.19 7033.67 1.71676571645954473 +AAAAAAAAODCEAAAA Long potential cards make previous subjects. Continued, firm rounds might support. Royal, powerful vessels exist employees Home wallpaper 1.91 7286.37 1.77844428490949006 +AAAAAAAAOGIDAAAA Societies could make now below a lev Home wallpaper 6.61 5369.24 1.31051458988596934 +AAAAAAAAOGPDAAAA Boxes would not let further level groups. Different priests get chapters. Languages may stop still legs. Blocks must make good, important securities. Complete diffe Home wallpaper 4.83 1053.00 0.25701437506051615 +AAAAAAAAOMBEAAAA Protective, absolute fingers could hear usually daily, rapid schemes. Normal y Home wallpaper 6.16 437.24 0.10672076481620141 +AAAAAAAAONGBAAAA Brown, natural periods might avoid in a changes; standard, military improvements should seem enough. Things commit easily from a hopes. General courts could close part Home wallpaper 2.54 1591.79 0.38852128402429154 +AAAAAAAAOOMBAAAA Times used to remember to the trains. Evidently chief tests will not look often apparent foreign holidays. Images will not meet earlier rows. Today happy months cannot like as against th Home wallpaper 5.03 5511.22 1.34516881682907673 +AAAAAAAAPCIDAAAA Proteins must remember above beneath available rights; good pl Home wallpaper 0.82 8210.81 2.00407996285910406 +AAAAAAAAADKDAAAA No equal occasions care poor materials. Students could not operate briefly shares. Very determined effects go already heavy factors; full possibilities make certainly by the posi Sports archery 6.40 8728.20 2.57886262177629984 +AAAAAAAAAEJBAAAA Appointments will not go inc, temporary factors. Static, specific proport Sports archery 1.85 1021.30 0.30175665035404036 +AAAAAAAAAMIAAAAA Lives shall mean servants. Short inner balls shall take policies. Sports archery 0.82 20373.51 6.01962413938563079 +AAAAAAAABAFBAAAA Eyes can go extremely hard numbers. Early, real others would discuss also. Good members Sports archery 4.61 3215.40 0.95003263835149453 +AAAAAAAACDFDAAAA Days can establish routine members. Associations replace both simple, crucial areas. Parties transmit variables. Statistical foreigners should not play Sports archery 2.48 2613.03 0.77205442090925102 +AAAAAAAACECCAAAA Players will come just about senior matters; external hours may become natural principles. Smooth, national sentences can support public women. Protests tell too in a leaders. Labour studi Sports archery 1.36 426.80 0.12610372894458477 +AAAAAAAACIIBAAAA Just silver assets move quite both statistical difficulties. Mainly national hours must prevent. Electronic Sports archery 9.78 10843.65 3.20390042260999677 +AAAAAAAADGNDAAAA Entirely social buildings step all including the standards. Massive months read children; irish years come for a words. Sports archery 5.76 12915.10 3.81593783901641692 +AAAAAAAAEAEDAAAA Religious, subsequent views cannot meet around important min Sports archery 5.76 23175.78 6.84759203186346949 +AAAAAAAAEFIAAAAA Shares take. Consequences warn liberal, fresh workshops; illustrations ought to measure sports. White, universal organizations assist young provisions Sports archery 5.83 3736.19 1.10390696121243713 +AAAAAAAAEHDDAAAA Long, immediate cars Sports archery 0.47 7961.21 2.35224523877909490 +AAAAAAAAEHGCAAAA Holy days like new years. Excellent, standard standards regain more simply friendly others. Easily previous texts can Sports archery 1.24 2736.34 0.80848799826669420 +AAAAAAAAEIEBAAAA Low days go photographs; attacks may not tear probably similar, mathematical police. Likely, small name Sports archery 2.59 11492.70 3.39567086607645118 +AAAAAAAAEMADAAAA Now public weapons used to specialise always limited Sports archery 6.16 609.03 0.17994600290328131 +AAAAAAAAFADCAAAA Materials go furt Sports archery 3.67 48.41 0.01430337750282884 +AAAAAAAAFHBAAAAA Previously white patients should set sometimes level theoretical studies. Federal, european trends keep. Social, other hills can leave opportunities. Organisers lower experiences. Recent criteri Sports archery 2.18 4063.94 1.20074505203152723 +AAAAAAAAFLFBAAAA Scientific, elegant blues must eliminate. Basically local musicians might slow never now spiritual bedrooms. Wrong studies ought to impose relations. S Sports archery 1.70 4653.68 1.37499156821657742 +AAAAAAAAGAKDAAAA Constant, olympic languages could not bow other Sports archery 2.01 7616.46 2.25038427215855694 +AAAAAAAAGDNAAAAA Strong, essential rates could Sports archery 8.43 4002.55 1.18260656112265174 +AAAAAAAAGEMDAAAA Critical, secondary cars will extend social parts; together serious voices see personally a Sports archery 42.19 29.70 0.00877525948841183 +AAAAAAAAGNGBAAAA Women aim entirely reasonable, whole surfaces. Young drawings meet then sure, executive projects. Public, new offers used to sweep too light, old ar Sports archery 65.59 3949.47 1.16692337009083694 +AAAAAAAAHADDAAAA Marginal, bright boats re-open subsequent figures. Most anxious positions produce nearly together with a causes. Invariably necessary hands must not le Sports archery 8.66 312.64 0.09237364062145029 +AAAAAAAAHCAEAAAA So blue parents will get at a conferences. Toxic methods Sports archery 1.14 2037.09 0.60188529802184673 +AAAAAAAAHCEAAAAA Differences give financial, current reasons. Working, legal memories cannot launch into a activities; small, difficult parties coul Sports archery 1.62 7284.54 2.15231409945169992 +AAAAAAAAHFAEAAAA Competitive holidays should not keep all democratic, o Sports archery 61.08 8753.34 2.58629056869679390 +AAAAAAAAHKMCAAAA Crude, silly estates walk. Specific eyes mus Sports archery 3.16 11104.29 3.28090997254466541 +AAAAAAAAHMKCAAAA Normally eastern men protect also only explicit quantities. Royal, modest miles build by a opportunities. Shoulders judge more slightl Sports archery 5.58 12487.62 3.68963319503977423 +AAAAAAAAICGBAAAA Nowhere other groups say home chief members. Contemporary letters practi Sports archery 8.43 2359.96 0.69728152802263887 +AAAAAAAAIHCAAAAA Current children take additional workers; far waiting arguments like bad, little days. Comp Sports archery 2.50 7478.91 2.20974329765919510 +AAAAAAAAIIDBAAAA Aware families give men. All social winners pose confident, new increases; most glad years wonder in genera Sports archery 1.55 2973.81 0.87865166394727186 +AAAAAAAAIJGAAAAA Welcome, united enemies fall. Nationally late profits complete mili Sports archery 7.03 11118.64 3.28514987064765227 +AAAAAAAAILDDAAAA French photographs shall not advise clearly for an demands. Important, statutory cases rate well times. Other, local doctors assess terms. Normally white considerati Sports archery 7.09 408.72 0.12076175279810376 +AAAAAAAAILFBAAAA Designs would throw especially linear, horizontal characters. Fundament Sports archery 3.73 8691.82 2.56811366756120145 +AAAAAAAAILPAAAAA Changes set shortly. Mental, different jobs need more with a solicitors. Other, federal pieces thank then to a chang Sports archery 1.50 15462.27 4.56853304814429410 +AAAAAAAAIMJDAAAA Other consequences may shape quite. Personal, particular lawyers take brown, large men. Skills would gather as busy fears. Days will Sports archery 3.96 12677.69 3.74579190113278554 +AAAAAAAAIPADAAAA Political troops forget plates. Emotional lists must intervene virtually in the children. Ready, only Sports archery 7.31 402.50 0.11892397118133873 +AAAAAAAAJDNAAAAA Months could not change curiously public contexts. Confident hotels would motivate in a studies. Workers sing fully again due positions. Irrelevant hands might create otherwise here strategic po Sports archery 0.40 1385.73 0.40943233437296029 +AAAAAAAAJJNDAAAA In short major reasons ought to sell already professional local institutions; corporate, able jobs will insure so su Sports archery 9.22 989.95 0.29249387644960565 +AAAAAAAAKAECAAAA Privileges face mostly solicitors. Different soldiers suggest home. Deep stations make right parents. Safe, central things would tackle just. As famil Sports archery 37.12 16530.14 4.88404942356147718 +AAAAAAAAKGCBAAAA Goods go only. Accountants may unite. Almost agricultural muscles go just regional police. Real samples used to build auditors; following women can believe. Very concerned tonnes would fit there Sports archery 7.66 2295.32 0.67818278144583953 +AAAAAAAAKIPCAAAA Young countries should restore increasingly others. Combined, large activities match in a cases. Positions can Sports archery 4.34 2791.69 0.82484189094964351 +AAAAAAAAKJEDAAAA Local, main troops cannot support never diffe Sports archery 3.65 463.60 0.13697677773830717 +AAAAAAAAKKHBAAAA Earlier controversial auditors s Sports archery 2.90 258.93 0.07650430772169947 +AAAAAAAAKNBEAAAA Old relationships in Sports archery 0.71 2104.62 0.62183793348489221 +AAAAAAAAKPABAAAA Individual, grand relatives must provide much areas. Italian, respectable experts might revise nationally public standards. Comfortable forces record forward importan Sports archery 3.59 7433.10 2.19620812469070534 +AAAAAAAAMCKBAAAA Patient teachers shall stop already serious weeks Sports archery 2.66 11143.58 3.29251872491165869 +AAAAAAAAMGEAAAAA Schools will get financial, small years. Chronic, real societies Sports archery 93.67 840.45 0.24832211572510841 +AAAAAAAAMIFEAAAA More leading requirements cross; elderly, able structures know obviously only houses. Enough light populations postpone blank payment Sports archery 2.76 5506.32 1.62691538135460637 +AAAAAAAANDOBAAAA Real pupils could adopt fine years. Big neighbours must understand for a visitors. Duties would not give almost at last blue priests. Previous, small miles make finally Sports archery 7.47 1309.14 0.38680280157102555 +AAAAAAAANKJCAAAA Domestic, chief devices can capture provincial lin Sports archery 3.78 18988.01 5.61025976156763126 +AAAAAAAANOHAAAAA Strings ought to include even. Difficult, medical Sports archery 64.26 5845.14 1.72702425071028634 +AAAAAAAAOAGAAAAA Big affa Sports archery 7.86 4365.75 1.28991882530417280 +AAAAAAAAOILBAAAA There aware passengers allow all after a reservations. Simply environmental feet may close hardly labour members. Influential, old shareholders must Sports archery 2.48 5434.29 1.60563316112058941 +AAAAAAAAOKNBAAAA Bad publications improve by the years. Regular movements might give at least profits. Hard tests might not meet Sports archery 9.45 12999.48 3.84086903078854452 +AAAAAAAAAGCAAAAA Sources make visual representatives. European regions will not run unacceptable loans. Right, natural firms get merely moral buildings. Virtually various sa Sports athletic shoes 2.23 3212.86 1.46013319558188889 +AAAAAAAAAJLCAAAA Distinguished powers upset very at a makers; animals shall see afterwards complete, working institutions. Sports athletic shoes 4.30 909.15 0.41317707424639551 +AAAAAAAAAKEDAAAA Seriously social measures might give. Less technical travellers contradict entirely for a possibilities. Major, young police give only; more than important findings be Sports athletic shoes 35.35 15716.62 7.14265750276894310 +AAAAAAAAAOECAAAA Priorities jump now important drawings. Both still movements will determine early massive, right patients. As huge goods might include at least chi Sports athletic shoes 1.75 11184.41 5.08292559090593238 +AAAAAAAABCCCAAAA Degrees know as after a heads; new, complex ma Sports athletic shoes 1.41 3007.89 1.36698145504591167 +AAAAAAAACCFEAAAA Real, comparative methods insta Sports athletic shoes 1.70 11493.02 5.22317810906375025 +AAAAAAAACFNDAAAA Develop Sports athletic shoes 6.28 2742.72 1.24647090697582786 +AAAAAAAADOGCAAAA However local things might not feel regional, responsible roots. Local, suitable nations set strong days. Patients might seem to a rooms. Sure othe Sports athletic shoes 2.00 303.48 0.13792111146928022 +AAAAAAAAEBIDAAAA Enormous, pure beaches lie highly financial periods. So united ships used to stay. Simply famous tons shall ensure separately extensive needs. In order educational statements must not pa Sports athletic shoes 3.52 3499.90 1.59058289848205428 +AAAAAAAAECBDAAAA Grey problems must not acquire detailed times. Sports athletic shoes 16.36 1039.15 0.47225755563233998 +AAAAAAAAECBEAAAA Current, political advantages will g Sports athletic shoes 3.15 125.13 0.05686723566017871 +AAAAAAAAEGLCAAAA Prices ought to go yesterday. Interests might rest here funds. Letters damage also rich agreements. Central, i Sports athletic shoes 1.72 128.63 0.05845786400518490 +AAAAAAAAELIAAAAA Generally top practices can reduce most links. Earnings will tell as techniques. Flat direct measures would not go far material whole sentences. Simply defensive services evaluate nat Sports athletic shoes 6.06 794.64 0.36113625945020704 +AAAAAAAAELNBAAAA Sentences will retire always from the marks. Modern activities may perform lon Sports athletic shoes 4.66 1180.16 0.53634169932643252 +AAAAAAAAENFEAAAA Almost uncomfortable shares may believe wrongly constant levels. Red, other words used to resist more frien Sports athletic shoes 0.12 23738.70 10.78841402674246177 +AAAAAAAAFHMBAAAA Items used to thin Sports athletic shoes 4.26 23.25 0.01056631686325545 +AAAAAAAAGNCCAAAA Eyes may not give children. Good great beans shall cook. Visible, Sports athletic shoes 36.86 5204.23 2.36514164340902922 +AAAAAAAAGNPAAAAA Religious, alone results go all investigations. Banks ma Sports athletic shoes 1.04 3489.00 1.58562922735046355 +AAAAAAAAHFNDAAAA Homes cannot inform almost fresh hotels. Plans could kill today hi Sports athletic shoes 3.62 7136.25 3.24317757915727874 +AAAAAAAAHJFEAAAA Woods wear indeed from a numbers. Counties must not receive as greatly public windows. Above hostile groups breed of course usually true members. Sources introduce similarly words. Largel Sports athletic shoes 8.59 4113.45 1.86942004736164067 +AAAAAAAAHOFCAAAA Military, considerable sizes wash social consultants. Equal ways stand detailed writings. Tough, potential directions interpret then. Free wives would restore still. Better fresh men carry others. St Sports athletic shoes 8.09 4091.45 1.85942181205017314 +AAAAAAAAIGKCAAAA As usual religious variables may believe heavy, available sister Sports athletic shoes 6.51 590.67 0.26843898415566016 +AAAAAAAAIIFEAAAA Objectives shall get with a years. Huma Sports athletic shoes 6.42 6968.96 3.16715008891839681 +AAAAAAAAJFCDAAAA Existing theories wait supplies. Proper partners measure things. Areas must not thank a little. Hard white rules formulate then major, institutional differences. Sports athletic shoes 1.47 16050.71 7.29448979527840609 +AAAAAAAAJLCAAAAA Absolute companies might not raise in order powerful, recent waves. Major chil Sports athletic shoes 0.18 14627.31 6.64760397062645716 +AAAAAAAAKAJBAAAA NULL Sports athletic shoes 0.74 2201.76 1.00062338997167000 +AAAAAAAAKAOBAAAA Clean, large conditions would understand labour dates. Large clergy should give high jobs. Patients might escape. As national polic Sports athletic shoes 5.50 257.64 0.11708842480211334 +AAAAAAAAKCAEAAAA Particular, financial years shape then twice visual friends. Limited, future women ought to come casual scots. Relations concentrate charges. Shares shall establish in a plants. Then double Sports athletic shoes 4.22 164.92 0.07495040761669202 +AAAAAAAAKGKDAAAA Presumably yo Sports athletic shoes 4.44 163.80 0.07444140654629003 +AAAAAAAAKIBBAAAA In particular financial studies can gain less than huge, model consequences. Really other activities walk o Sports athletic shoes 47.58 1719.85 0.78161204547397384 +AAAAAAAAKIEDAAAA Now political women could Sports athletic shoes 8.57 57.80 0.02626809095467377 +AAAAAAAAKIFCAAAA Chronic lines shall take enough by the sales; international, welsh angles used to rule now front powers. Standard othe Sports athletic shoes 3.00 16781.46 7.62659027045362857 +AAAAAAAAKLABAAAA Skills use rather than a principles. Easy employe Sports athletic shoes 6.29 9250.24 4.20391255488860762 +AAAAAAAAKLNDAAAA Accounts could think aspects. Industrial, large Sports athletic shoes 1.92 6322.30 2.87326559589505180 +AAAAAAAAKMECAAAA Cells call no doubt pilots. Arms should pay rather good duties. Thus long s Sports athletic shoes 9.73 857.50 0.38970394452651834 +AAAAAAAAMDHAAAAA Friends cry easily sure varieties. Appropriate proposals provide recently between a books. New, considerable forces seem like the elections. Right big clothes fr Sports athletic shoes 9.64 2708.86 1.23108271390099647 +AAAAAAAAMPHBAAAA Words live only anxious countries. British, northern substances criticise most extra, Sports athletic shoes 3.18 2390.50 1.08639915963923277 +AAAAAAAANCCCAAAA New rules continue wet cuts. German, following procedures shall see findings. As good charges cannot pay notably routine, short plates. Problems used to alleviate a Sports athletic shoes 30.73 3030.00 1.37702968153393653 +AAAAAAAANCNAAAAA Supposedly parental instructions see. Broken, raw habits should not issue at all friendly beliefs. Certain constraints know Sports athletic shoes 0.59 5983.42 2.71925641487913747 +AAAAAAAANGOBAAAA Also other measurements pay at least around the artists. Perfect, good cul Sports athletic shoes 2.83 4854.06 2.20600154981736633 +AAAAAAAANLBAAAAA Democratic forests use on a communities. Potatoes could not include still easy movies. Direct leads could sh Sports athletic shoes 3.61 1739.94 0.79074225217430942 +AAAAAAAAOAPCAAAA Levels may not go involved issues. Miles will beat good institutions. Tiny, c Sports athletic shoes 9.51 9805.35 4.45619075505900481 +AAAAAAAAPCODAAAA Never national communities could turn so. National, whole styles buy far really high leaders. Indeed beautiful others liv Sports athletic shoes 5.39 306.50 0.13929359649839985 +AAAAAAAAPDABAAAA More than hot women govern only full polic Sports athletic shoes 1.64 3354.48 1.52449456307325393 +AAAAAAAAPIFAAAAA Notably international minutes write too national, important visits. Human, clean patients Sports athletic shoes 1.21 6716.71 3.05251123176759302 +AAAAAAAAAJIDAAAA Major missiles may reply british dogs. Other, c Sports baseball 1.15 12361.94 4.21788969172030922 +AAAAAAAAALEBAAAA Also other adults ought to uphold usually in a hills; carefully good signs would ensure with an benefits. Continuous, nuclear days shall feel just in the politicia Sports baseball 0.75 3265.70 1.11425572088612417 +AAAAAAAAANCBAAAA Therefore unexp Sports baseball 3.99 3063.58 1.04529244615007878 +AAAAAAAAAOMCAAAA Often unnec Sports baseball 6.08 2524.58 0.86138583085852692 +AAAAAAAABDOBAAAA Eggs shall not encourage as. Economic classes act other girls. Technical features wash even. Social goods can monitor probably Sports baseball 2.18 3658.98 1.24844272211406762 +AAAAAAAACBGCAAAA Managers shall put even. Physically additional guests help therefore high times; here specialist successes tend old plan Sports baseball 9.08 251.02 0.08564793797863701 +AAAAAAAACGMAAAAA Dreams cannot need further at a securities. Modern societies devote once again for a businesses; ways used to say to a Sports baseball 1.06 4758.65 1.62364974927113782 +AAAAAAAACJJCAAAA Fun activities cost white camps. Bare, solar databases go especially days. More subject sites deal certainly; partly equal occasions hear subs Sports baseball 6.89 1014.60 0.34618117230947778 +AAAAAAAADDLCAAAA Most other delegates enhance natural, successful shows. American, similar times can derive easy, small departments. Artificial, other manager Sports baseball 4.91 1022.10 0.34874016973932312 +AAAAAAAAEHFAAAAA Fully silent bishops ought to seek only. Just new forms change immediately deeply raw cells. White corners shall lighten really reportedly glad games; teachers think at pre Sports baseball 3.06 14501.24 4.94781811860939439 +AAAAAAAAEHFEAAAA Winds owe urgently military managers. Internal conditions used to satisfy now as disable Sports baseball 7.10 7772.75 2.65205963637738361 +AAAAAAAAEHNBAAAA Organisations restore far. Far notes might not ask very places. Innocent requirements would not change to a children. Cer Sports baseball 1.20 8146.44 2.77956253631857102 +AAAAAAAAEHOAAAAA Also international soldiers use shortly decisive parties. Major, above advertisements expect about already loyal stairs. Lucky, small towns appear. Then english children corresp Sports baseball 1.92 3722.51 1.27011913634314422 +AAAAAAAAEIKDAAAA Guilty, oth Sports baseball 3.01 5530.46 1.88699105678166221 +AAAAAAAAFOIBAAAA Rather american exercises might remember times. Below western accidents give Sports baseball 0.71 7321.35 2.49804211106642533 +AAAAAAAAFOMDAAAA Later federal objectives Sports baseball 5.97 7447.00 2.54091384800776761 +AAAAAAAAGFKCAAAA Feet used to make import Sports baseball 2.92 798.30 0.27237968643273813 +AAAAAAAAGKHCAAAA Parents induce free deaths. Empty, red rec Sports baseball 39.45 15343.37 5.23515258602214870 +AAAAAAAAGKMAAAAA Symbols could enable too wrong problems. Real, old Sports baseball 0.29 5569.42 1.90028419543056548 +AAAAAAAAGLNCAAAA Elements shall arrange more. Coins would constitute however. Departments subscribe only in a children. And so on significant areas protect within Sports baseball 1.17 1171.52 0.39972222253498857 +AAAAAAAAHDFBAAAA Residents will happen here police. Owners might not match lines. Temporary, good symptoms used to achieve about in a issues. Troops can arrange. Even true comments shall not get ba Sports baseball 3.86 3886.24 1.32598375623495459 +AAAAAAAAHMMAAAAA Relevant numbers happen by the variables. Basic, italian fingers l Sports baseball 8.19 5295.33 1.80676478135772420 +AAAAAAAAHNDCAAAA Fascinating companies could tell partly about a Sports baseball 8.54 2203.05 0.75167990504277057 +AAAAAAAAIAOBAAAA Rig Sports baseball 4.47 7838.81 2.67459928573946137 +AAAAAAAAIBNAAAAA Easily natural relatives used to walk thorough, real rocks. Front implications tell either. Members achieve in a words. So black ages help far Sports baseball 90.17 13337.28 4.55067536548368992 +AAAAAAAAIFAAAAAA Teachers might not send unusual arrangements. Complex steps ought to hold all but statistical, recent pr Sports baseball 7.75 1162.44 0.39662412964658915 +AAAAAAAAIGCEAAAA Kids live so other goods. Colleagues ought to gain at first burning guidelines. Electronic, public figures give. Little leaves interfere. Stages could not determine yet environm Sports baseball 3.90 6580.60 2.24529846491203378 +AAAAAAAAIHACAAAA Only solid days cannot cope ever suitable recordings. Inches go ever chro Sports baseball 9.36 11126.11 3.79622491922354013 +AAAAAAAAJCEBAAAA Cities ought to assess to the parties. Likely organs help domestic, passive stages. Therefore private obligati Sports baseball 1.03 7447.72 2.54115951176103277 +AAAAAAAAJFKBAAAA Hundreds would give seldom national, philosophical words. Obvious things li Sports baseball 2.21 83.50 0.02849017138561147 +AAAAAAAAKDOCAAAA Most local companies shall see already. Politicia Sports baseball 18.00 3997.41 1.36391492213840880 +AAAAAAAAKEJAAAAA Surprising applications could not explore. Tonight expensive layers meet then between a statements. Days de Sports baseball 0.95 4521.40 1.54270013057369686 +AAAAAAAAKJDDAAAA Offices obtain surprisingly according to the cups. Separate, only children work also social rates. Public conflicts force at least. Gradually australian storie Sports baseball 1.45 8302.97 2.83297051867772986 +AAAAAAAAKKOAAAAA Conscious, solar ambitions support outside countries; warm facilities rise occupations. Appropriate columns grow. Availabl Sports baseball 3.35 2187.71 0.74644590229959357 +AAAAAAAAKLHAAAAA Certain places kn Sports baseball 4.63 546.48 0.18645878872825095 +AAAAAAAAKMDAAAAA Single, wonderful departments will appea Sports baseball 3.19 5797.68 1.97816642920876516 +AAAAAAAAKNMAAAAA Statutory Sports baseball 4.72 3059.64 1.04394811950026670 +AAAAAAAAKNPCAAAA No scottish accidents will rely chan Sports baseball 4.35 25561.00 8.72140444057023607 +AAAAAAAALKHAAAAA Properly common methods remember thus successful levels. Statistical families exist; trees will not go simply. Bottom, full things could see in the feet. Used, de Sports baseball 2.57 12848.83 4.38401639286929566 +AAAAAAAALOGAAAAA Good effe Sports baseball 9.77 8394.54 2.86421417129785492 +AAAAAAAALPIAAAAA Central standards ease written eyes. Simple, brief groups send in the ideas. Technical, possible islands try on a parties; activities must change adul Sports baseball 5.06 9693.92 3.30756218201684687 +AAAAAAAAMBFEAAAA Legal, other houses compete well new companies. Young, able layers would find orders. Rather good beaches die finally historical applications. Comments Sports baseball 89.48 2008.38 0.68525856775370489 +AAAAAAAAMHBAAAAA Clubs may take major changes. Procedures need. Lawyers shall not say pretty Sports baseball 1.61 8727.74 2.97790189711445061 +AAAAAAAAMKECAAAA Clear practices might not own as. External Sports baseball 1.32 525.24 0.17921170800692895 +AAAAAAAAMLNBAAAA As simple views visit only japanese, direct differences. Hours assist locally too severe products. Else lesser dangers telephone Sports baseball 7.20 316.92 0.10813299539554474 +AAAAAAAANBEBAAAA Anxious, just years must come various schools; rarely surprising students ought to talk complex hundreds. Thin, other makers shall look actually american, ta Sports baseball 7.88 11407.21 3.89213614289414352 +AAAAAAAANCKAAAAA Too particular pages used to give here by a markets; capital, different researchers gain specialist, small directors. Required patie Sports baseball 60.56 503.66 0.17184861940212062 +AAAAAAAANEODAAAA New friends would leave long motives. Dogs shall face occasionally increased schools. New, green parents decide also probably beautiful men. Real tanks shall Sports baseball 0.54 928.53 0.31681411780457264 +AAAAAAAANNKBAAAA Important, private results identify sh Sports baseball 1.25 4287.60 1.46292765069398475 +AAAAAAAAOCNAAAAA Other, significant materials could not mention economic, current races. Animals go straight living, young groups; masters may date. Top, able computers avoid less hours; questions recommend Sports baseball 0.56 225.54 0.07695417071030911 +AAAAAAAAOLFCAAAA Only warm clouds ought to hold really Sports baseball 4.99 1216.60 0.41510350308664564 +AAAAAAAAOOEAAAAA Books change slightly. Radical, distinguished characteristics imagine always as a ministers. Red strings deal late, sexual states. Peculiar, strong patterns live always. N Sports baseball 1.51 2123.42 0.72451017633095930 +AAAAAAAAOONAAAAA Real, social cigarettes wou Sports baseball 0.29 5316.32 1.81392656216471802 +AAAAAAAAPLODAAAA At least middle departments arrange international, environmental sites. More key kids might take up to the relations. Policie Sports baseball 4.87 2378.20 0.81144102502109211 +AAAAAAAAABKDAAAA Young workers ac Sports basketball 7.78 1526.51 0.57071382054190651 +AAAAAAAAADCAAAAA Inter Sports basketball 85.58 1184.67 0.44291065357015702 +AAAAAAAAAIADAAAA Levels evaluate old arms. Attractive, dangerous men isolate very poor things; solid, sorry others shall leave now Sports basketball 1.44 153.89 0.05753460497683867 +AAAAAAAABEJCAAAA Others ought to ensure still buildings; new patients keep notably in a drivers. Relative, good im Sports basketball 1.20 625.50 0.23385467160317491 +AAAAAAAABHCAAAAA Favorite, pure features see green decisions. Imp Sports basketball 8.03 5094.18 1.90455282332128144 +AAAAAAAABIHDAAAA Also federal cells shou Sports basketball 6.62 8298.39 3.10250562475630792 +AAAAAAAACAMCAAAA Considerable ears cross during a members; very southern politicians allow numbers. Patients deprive earlier shares. Men used to press beautiful tactics. Eyes might develop on a co Sports basketball 4.97 937.69 0.35057264111204009 +AAAAAAAACBKDAAAA Youn Sports basketball 3.28 1166.47 0.43610624905668334 +AAAAAAAACECDAAAA Always front rumours ought to improve. Hours use about a centuries. As uncomfortable links learn neither about real reasons. Dark days could deal much big, sole Sports basketball 6.68 10473.18 3.91559083859462726 +AAAAAAAACIFEAAAA About national assets raise much. Other inhabitants may like thick annual characteri Sports basketball 6.72 1181.36 0.44167314923281648 +AAAAAAAACKABAAAA Early types tell links. Local reasons succeed probably properties. Friends carry low fruits. Able, old tensions get. Recently other vegetables Sports basketball 3.00 11903.67 4.45040581730226223 +AAAAAAAACKKDAAAA Cases should soften courses; complex letters use experimentally far whole parties. Great, liberal decisions confirm. Households know very reasonable users. New, short feature Sports basketball 2.58 5361.15 2.00436446469282357 +AAAAAAAACMJAAAAA At all attractive answers would beat. Trousers might take of course fine constant lives. Ladies shall not challen Sports basketball 8.87 19675.51 7.35605104664266008 +AAAAAAAACPGAAAAA Whole councils would see again white Sports basketball 4.23 4485.02 1.67680716104503839 +AAAAAAAADGNAAAAA So early systems would place only to a m Sports basketball 2.69 249.12 0.09313809079101988 +AAAAAAAAEILCAAAA Different plans may make so in a trials. Provincial, perfect items must wear together. Simple aspects must not prefer then in the sections; alone, good rights can put psycho Sports basketball 4.46 9055.60 3.38560250067100027 +AAAAAAAAENEBAAAA S Sports basketball 1.06 458.00 0.17123171797642543 +AAAAAAAAFEDEAAAA Often final groups participate with the characters. Superior, in Sports basketball 62.36 9883.09 3.69497484632233713 +AAAAAAAAFKMBAAAA Decisions bring young farmers; easy other minerals credit preliminary, basic offices. Sports basketball 0.22 9644.13 3.60563525827070695 +AAAAAAAAFMCDAAAA Properly large others say briefly other police. Results used to prefer worried, old opportunities. Very big contents create forces. Possible, famous clu Sports basketball 4.35 9926.05 3.71103623192117389 +AAAAAAAAHPIBAAAA Succ Sports basketball 9.92 8445.05 3.15733716134675017 +AAAAAAAAIBBBAAAA Similar, new events may need sometimes combined prisons. Communications pay from a relat Sports basketball 20.67 3976.01 1.48650441701189361 +AAAAAAAAIBFCAAAA Charming, general guns would look superficially; big heads can set essentially straight voluntary refuge Sports basketball 0.21 5246.26 1.96141072653057135 +AAAAAAAAICGEAAAA Authorities might destroy however to the profits. S Sports basketball 2.28 2179.53 0.81485734995886139 +AAAAAAAAINLDAAAA Favourably major feelings used to turn new, necessary years. Labour products go pr Sports basketball 7.28 256.36 0.09584489786121490 +AAAAAAAAIOKDAAAA Different organizations shall split; emotional, com Sports basketball 2.22 12749.88 4.76677697902460058 +AAAAAAAAJGLCAAAA Smooth years help more british, curious arms. Inter alia acute members must improve also in a years. Now regional Sports basketball 3.91 2159.38 0.80732390210465840 +AAAAAAAAJNMAAAAA Women may not represent very common muscles. More late stones smile again on the surveys. Topics must not find as variations. Economic boots Sports basketball 60.56 202.95 0.07587658769282869 +AAAAAAAAKACBAAAA Heavy paintings s Sports basketball 4.08 4622.30 1.72813181223238268 +AAAAAAAAKADAAAAA Huge, helpful heads think low policies. Absolute tons restore generally. Tradit Sports basketball 5.01 24011.93 8.97730136644032550 +AAAAAAAAKDDDAAAA White interests might Sports basketball 53.99 3630.36 1.35727681151287298 +AAAAAAAAKOJCAAAA Outstanding friends must reduce figures. Travellers Sports basketball 0.95 3994.52 1.49342472072312426 +AAAAAAAALAEEAAAA Redundant, new writers draw sharp Sports basketball 4.80 9195.80 3.43801884752753924 +AAAAAAAALJEEAAAA Clear members work national, personal operations. He Sports basketball 4.17 4072.64 1.52263131855788049 +AAAAAAAALKKAAAAA Times remove other effects. Almost english conservatives can measure however new, normal r Sports basketball 7.65 1107.60 0.41409661753425504 +AAAAAAAAMHCCAAAA Now due eyes keep about. Then annual progr Sports basketball 0.83 3016.20 1.12766180733732398 +AAAAAAAAMHPBAAAA Addresses retain once more applicable events. Following blocks follow for a develo Sports basketball 70.89 268.59 0.10041730814691726 +AAAAAAAAMKFCAAAA Other, g Sports basketball 0.70 15012.84 5.61282616791528113 +AAAAAAAAMNFBAAAA Political aspects ought to say months. Of course Sports basketball 3.77 123.24 0.04607553913409317 +AAAAAAAANNHBAAAA Fortunately favorite decisio Sports basketball 2.86 9079.28 3.39445570390611328 +AAAAAAAANOEDAAAA Ancient, similar ways equip immediately. Never european leader Sports basketball 0.67 5371.94 2.00839850451152582 +AAAAAAAAOCJAAAAA No doubt established kinds ensure both comparative buildings. Threats attract almost traditional students; questions must not fight widely clean, minor relations. National, famous assets go commer Sports basketball 9.10 1401.61 0.52401765989724377 +AAAAAAAAODJCAAAA Only social changes could achieve again soon go Sports basketball 9.05 4303.38 1.60889770852705168 +AAAAAAAAOEFCAAAA Early favorite contexts will save quite as empty pages. Unusual languages suffer soon actual cars; corporate businesses ought Sports basketball 54.80 7564.49 2.82812362077617992 +AAAAAAAAOHGCAAAA Recently free woods know Sports basketball 2.84 3637.05 1.35977799097414435 +AAAAAAAAOJLBAAAA Confidential members cannot modify either dirty organisations. Men might think increasingly failures. Internationa Sports basketball 1.70 6383.10 2.38643925549196761 +AAAAAAAAOLMDAAAA Old, poor pp. form seconds; bags know much; Sports basketball 9.50 5416.98 2.02523753634047386 +AAAAAAAAPLEBAAAA Comparatively unable miles show already; interesting drugs will not run parts. Yet political priests will run strangely left, d Sports basketball 4.52 1863.76 0.69680093165009314 +AAAAAAAAPNOBAAAA However comprehensive times ought to level even for a blacks. New employers see; far presidenti Sports basketball 4.48 4373.10 1.63496381197097391 +AAAAAAAAPPGBAAAA Areas expect. Organic, democratic resources would last previously. Cheap, residential fields cannot achieve seriously about Sports basketball 0.77 2524.50 0.94383072495957642 +AAAAAAAAACAAAAAA Automatically competitive deaths jump wooden friends. Average, legal events know. Losses ought to cross. Conventional toys st Sports camping 4.38 8168.10 2.37504813353538829 +AAAAAAAAANABAAAA Only far tests take to a others. Appropriate comparisons will say fully musical personnel. Beautiful, administrative aspects get standards. Huge, sin Sports camping 1.74 11263.88 3.27521175920551774 +AAAAAAAABCABAAAA Cells give only serious walls; arrangemen Sports camping 0.18 151.45 0.04403729628970441 +AAAAAAAABGCBAAAA Sorry eyes could shake obviously across a commentators; more other numbers may control schools. Children maintain. Powerful elements gather very then active opportun Sports camping 3.69 5210.19 1.51497313143383954 +AAAAAAAABHCDAAAA A bit important Sports camping 3.97 2060.79 0.59921835471020101 +AAAAAAAABHEEAAAA Straightforward deal Sports camping 4.48 14808.62 4.30592001704617007 +AAAAAAAACCNCAAAA Whole services live since the wheels. Sports camping 2.26 8417.24 2.44749086709509087 +AAAAAAAACFDEAAAA So-called, classical travellers contain capital, new paintings. Japanese stories Sports camping 6.17 18270.48 5.31252915889810863 +AAAAAAAACIABAAAA Financial, massive ideas might boil also leading companies. Even long Sports camping 9.92 4367.79 1.27002748340183563 +AAAAAAAACLOCAAAA Groups should display of course possibly productive areas. Gro Sports camping 2.04 12234.96 3.55757384359644646 +AAAAAAAACOJAAAAA However general jobs tell basic results. Issues lose critical husbands. Back, Sports camping 21.20 4822.68 1.40229638871199501 +AAAAAAAADBIBAAAA Equal, different facts emphasise necessary inhabitants. Complex, active moves might put in a reports. Commercial groups can restrict curiously to a players; identical purposes cou Sports camping 8.94 13999.26 4.07058144903669396 +AAAAAAAADCLDAAAA Always opposite skills take well in the prices. Colonial, weak issues shall deny more just respective funds; mental, creative patients would not play even in Sports camping 16.73 5674.31 1.64992585480113970 +AAAAAAAADJFCAAAA Procedures find groups. Possible Sports camping 4.18 5862.76 1.70472168501437704 +AAAAAAAADKIBAAAA Wild changes shall delay soon representatives; other countries die also legal, superb boys. Never video-taped sounds think substantially previous approa Sports camping 75.50 1678.45 0.48804489902577986 +AAAAAAAAEADDAAAA Dear officers communicate much long interested relationships. Casualties position normal, good issues. Aspirations remind now quick words. Financial, l Sports camping 3.38 1526.49 0.44385930943064297 +AAAAAAAAEGBCAAAA Exceptions say richly normal losses; british, old individuals used to win. Childr Sports camping 4.27 4862.61 1.41390688221379690 +AAAAAAAAEGCEAAAA Then bad merch Sports camping 0.84 409.38 0.11903590858421386 +AAAAAAAAEGKAAAAA More fine pressures free there into the records; rights turn seconds; great areas ought to drain allegedly especially gothic dealers; programs speak even european, o Sports camping 2.25 4430.31 1.28820649802073507 +AAAAAAAAEJGAAAAA National systems must believe old issues. Long police would make able towns. Slow years earn exactly nearer the terms. Social, old comparisons shall survive wildly previous children Sports camping 2.12 4781.18 1.39022938444641077 +AAAAAAAAEMKCAAAA Well main goods share probably traditional times. Enorm Sports camping 5.17 3862.11 1.12299030949772389 +AAAAAAAAEOKAAAAA Terms reduce standards. Free things put Sports camping 2.60 1759.84 0.51171076594568109 +AAAAAAAAEPAAAAAA Players must argue away significantly national sides. Elections might Sports camping 3.53 14678.84 4.26818373238141050 +AAAAAAAAFDBBAAAA Labour, bright taxes could not shock still with a reasons. Dominant weapons will cause home; women say therefore bloody, complete areas; dem Sports camping 30.04 3575.90 1.03976868803138980 +AAAAAAAAFJODAAAA Unable school Sports camping 2.63 9178.29 2.66878227905467845 +AAAAAAAAFLMDAAAA Still royal companies reach years. Complex, british plants must tell however such as a detectives. Ite Sports camping 6.35 8374.50 2.43506330655747472 +AAAAAAAAFNHDAAAA Just capitalist exceptions communicate Sports camping 7.91 397.64 0.11562225484739558 +AAAAAAAAFPNBAAAA Available tests forgive also policies. Almost local rights used to argue there new only men. Chi Sports camping 2.78 316.16 0.09193021852065332 +AAAAAAAAGNGDAAAA Never top observations spend appropriate, common states. Homes make. There available hospitals will appreciate away upon a years. Roots hang Sports camping 2.07 4784.91 1.39131396097437774 +AAAAAAAAHEBBAAAA Residents will l Sports camping 7.50 7103.96 2.06562688247083863 +AAAAAAAAHGIBAAAA Bold campaigns get with a numbers. Public, medical emotions recognize sources. Very single countries shall fit enough along with Sports camping 4.72 5615.05 1.63269475425225965 +AAAAAAAAHGJDAAAA Democrats may say again. There private services can think about fa Sports camping 1.65 18235.67 5.30240741387437400 +AAAAAAAAHKNBAAAA Different, ltd. students may not try scottish sheets. Almost likely schools may not order. Partly effective c Sports camping 3.91 11958.94 3.47731518052689077 +AAAAAAAAIIHCAAAA Certain, official generations might allow polish letters. Months provide equally product Sports camping 8.26 3715.04 1.08022659100761608 +AAAAAAAAIKDCAAAA Central, clear fingers must Sports camping 5.58 104.95 0.03051643608850761 +AAAAAAAAILADAAAA Always clinical doors Sports camping 33.45 2954.82 0.85917651913334019 +AAAAAAAAJMICAAAA Available implications try only; magistrates must reduce quite black, ugly girls. Animals read. Chief pupils will manipulate easy more real seconds. Men might throw only british policies. Aspects ex Sports camping 6.42 12904.54 3.75226841506993789 +AAAAAAAAKCJBAAAA Affectionately sad chains answer sideways small, concerned documents. Interested minutes notice as a yards. Difficult c Sports camping 0.18 7683.32 2.23408807744213704 +AAAAAAAALALAAAAA Crucial sources make to a police. Great farmers make recent limitations. Yet indian colleagues should get. Mea Sports camping 7.95 1656.32 0.48161013265475868 +AAAAAAAALDKBAAAA Good, white statements de Sports camping 8.79 4572.10 1.32943494464283601 +AAAAAAAALHICAAAA Conventional workers shall not take numbers. French, premier things could remember as to a gardens. Red districts ought to implement flowers. Fiscal, curious terms study much explicit words. Third Sports camping 3.61 5559.40 1.61651333768889187 +AAAAAAAAMBGDAAAA Fresh, electoral doors get at a teachers; children become more ministers; comfortable places shall not lift much safe, genuine procedures; official, extra beliefs break. Openly new days find ther Sports camping 1.27 4702.53 1.36736023057922522 +AAAAAAAAMELBAAAA Much basic birds can light apparently. Normal, close teeth cannot expect as civil ends. Long principal conditions could not cover less more new officers. Efficient words get to a years. Real, able Sports camping 1.68 3665.26 1.06575200131265745 +AAAAAAAAMMOAAAAA Far specific clothes learn indeed times. Gastric, steady criteria imagine again in n Sports camping 50.85 6713.37 1.95205456449265676 +AAAAAAAANGMAAAAA Grounds will take then by the boards. Historical candidates feel suitable numbers. Normally inevitable savings return systems. Psychological rooms would turn almost Sports camping 2.39 16931.42 4.92316909306983803 +AAAAAAAANJJAAAAA Accounts listen firmly incredible trends. Votes must not exert away natural fears. Able terms reflect well golden others. British feet could not re Sports camping 8.64 12203.84 3.54852504425319390 +AAAAAAAAOBLCAAAA Labour patients shall Sports camping 2.75 7756.62 2.25540160545821715 +AAAAAAAAOHPBAAAA Powerful populations can produce honest lines; soviet, working-class feet w Sports camping 2.14 2940.02 0.85487310556392702 +AAAAAAAAOKHDAAAA Minutes can compete much mathematical areas; pages put for example more good passengers. Differences undertake to a parts. About conscious situations know light studies; mad, l Sports camping 1.46 2184.90 0.63530596674397594 +AAAAAAAAOLDEAAAA Visual, surprising parties earn resources. Particular, just situations can lose currently to a others. Social actors want loudly prime years. Fresh, other responsibilities obtain offices. Afraid t Sports camping 9.02 6215.95 1.80741916059417696 +AAAAAAAAONBDAAAA Great explanations would not fill; sure, political powers let eventually horses. Continually public examples ask yet wrong, dependent officials. Early, g Sports camping 1.82 3966.35 1.15330029804337451 +AAAAAAAAONHBAAAA Trustees could respond further precise surveys. Conditions would weigh. White areas secure particularly living costs. Strong, bare provisions can keep so useful, physical feet. Demanding, supreme Sports camping 4.48 9027.65 2.62498050742654327 +AAAAAAAAPBAAAAAA Just available years undertake social units. Alone long-term years communicate very huge workers. Relevant, false farmers start hardly bottom windows. Associations shall Sports camping 7.57 5611.89 1.63177591730095251 +AAAAAAAAABGAAAAA Steps would make repeatedly short pairs. As good stages protect skills. Plants could not sweep observations. C Sports fishing 8.71 4424.59 1.05964726402462346 +AAAAAAAAACDDAAAA Christ Sports fishing 9.05 1582.84 0.37907514038334286 +AAAAAAAAAFIBAAAA Almost personal matters may deal; major, australian offences happen prime, usual hours. Functions might visit at the followers. Championships shall smile observations; compani Sports fishing 2.61 1554.46 0.37227840004061759 +AAAAAAAAAGICAAAA Accidentally wrong communities look more goods. Rural matters recognize. Large, new days go hap Sports fishing 1.32 4303.95 1.03075513030558269 +AAAAAAAAAGMCAAAA Problems ought to remove rapidly then new authorities. Half way exotic months bar systems. Front, new models cause too; difficult, full others comprehend eve Sports fishing 2.89 2105.84 0.50432867101214193 +AAAAAAAAAJPBAAAA Delightful, married guns should go much tremendous, clear networks. Again just hours shall know there. Large, whole years cannot want Sports fishing 9.33 2187.51 0.52388786001109799 +AAAAAAAAALDAAAAA Very modern weeks must prevent hotly to a situations. Points look strongly regulations. Times take good groups. As af Sports fishing 68.83 2026.90 0.48542329107363830 +AAAAAAAABEFDAAAA Members support general, mysterious programmes. Front times want with the services. Now new details should impose never cheap live activiti Sports fishing 4.96 11202.69 2.68293781078382606 +AAAAAAAABHGCAAAA Tests shall see famous, good words; sexual, significant theo Sports fishing 8.63 11684.99 2.79844407813042221 +AAAAAAAACBEEAAAA Personal, lacking artists cut pieces. Prices make quickly for a rooms. High, overall types ought to use together supposed women; reductions shall give prices. Lengthy, fundamental meas Sports fishing 9.23 13101.80 3.13775661107533389 +AAAAAAAACEMBAAAA Other offices shall embark blindly resources. Spectacular copies may look also old, other offices. Properties fill better important others. Very wrong supplies will not own both aspects. Certainly Sports fishing 7.25 386.95 0.09267084833042791 +AAAAAAAACKDBAAAA Sheets identify in a persons. Successful studies cannot solve for instance impressive governments; public buildings can move to a women. Substances sweep even on a tales; however great spac Sports fishing 4.50 5339.33 1.27871880247087137 +AAAAAAAACLCEAAAA Inherent, public girls run. Opposite, similar players might adjust though central ties. Entirely small generations achieve rats. At all western boxes prosecute almost suspicious, ordinary v Sports fishing 0.46 2861.92 0.68540264699268189 +AAAAAAAACPJAAAAA Difficult skills can tell specifically significant applicants. Irish women find si Sports fishing 8.65 0.00 0.00000000000000000 +AAAAAAAADCPCAAAA Usually english commentators will indicate still dangerous, spiritu Sports fishing 9.90 13087.32 3.13428878865945433 +AAAAAAAADDDBAAAA Early, associated parents continue stories. Alive, key costs will not supply. For example excellent wi Sports fishing 0.65 9375.15 2.24525934545809862 +AAAAAAAADEDDAAAA Just left grounds would not shoot other, accessible readers. Long, true winners shall vary; male conditions must hear never local, clean studies. Major, generous pp. must not get always gre Sports fishing 3.62 8.19 0.00196142718135729 +AAAAAAAADFMCAAAA Groups deserve also only members. Inevitable, rare dreams worry much old enquiries. Please clear nerves turn necessar Sports fishing 2.58 3603.80 0.86307585789687587 +AAAAAAAADFPCAAAA Foreign advances expand never new, colonial players. Colours confess lines. Urgent, massive items sit then men. Different countries cut however. Effectively old ideas suggest only actually particul Sports fishing 4.19 20.28 0.00485686730621806 +AAAAAAAADGICAAAA Sole, public skills require long opportunities. Parents destroy how Sports fishing 4.84 1396.88 0.33453948731311060 +AAAAAAAADKFBAAAA Courses try military parents. Fast, w Sports fishing 1.64 6454.18 1.54571478453878082 +AAAAAAAADLIAAAAA New parties strengthen please at all current things. Similar teams must lead most real firms. Simply tiny planes will set moving advantages. Concerned, average memories use Sports fishing 2.13 5552.34 1.32973267352104439 +AAAAAAAADOHBAAAA International, new heads succeed altogether. Inc men see about accord Sports fishing 4.11 4917.54 1.17770410517847910 +AAAAAAAAEABAAAAA Illegal campaigns ought to become here western, certain abilities. Indirect teachers would not tend no longer long, main agreements. Twice sweet patients ought to enjoy Sports fishing 0.33 2469.18 0.59134514867689882 +AAAAAAAAEAOBAAAA Common, preliminary children will not maintain early further international Sports fishing 3.67 4265.38 1.02151798178483168 +AAAAAAAAEBGCAAAA Northern, de Sports fishing 15.22 1489.04 0.35661093163959266 +AAAAAAAAEJHDAAAA Unable occasions command more effective, other birds. Proper songs know in a ports. Later wealthy details look now hours. Aware, black issues Sports fishing 0.59 4257.58 1.01964995589782473 +AAAAAAAAFEICAAAA Points can appoint even pregnant ideas. Other, basic bodies shall frighten too modern laws; features accompa Sports fishing 1.97 15202.78 3.64092135826557149 +AAAAAAAAFFMAAAAA Home available features need with a questions. Hard waters can operate still more content bands. Organic, large ideas contribute points. Difficult, right produc Sports fishing 2.47 7589.73 1.81766821992220870 +AAAAAAAAFJCAAAAA Collective, full signals will assume only services. Political villages think children. So old Sports fishing 2.56 2552.33 0.61125878361338953 +AAAAAAAAGDABAAAA Industrial, slight needs would disturb too for a folk. Now known buildings ought to suggest so. Papers create colours. Good levels tell into a r Sports fishing 2.72 5261.10 1.25998346078618504 +AAAAAAAAGNJAAAAA Norma Sports fishing 1.01 8662.39 2.07456009786539724 +AAAAAAAAGOCBAAAA Onwards horizontal sports find. Normal, powerful eyes come american, commercial situations. Major, enormo Sports fishing 1.89 13071.78 3.13056710631534049 +AAAAAAAAHACEAAAA Shoes give more now annual ch Sports fishing 1.18 6235.99 1.49346035270723652 +AAAAAAAAHIJBAAAA As modern women may find only with a bones. However simple minutes end changes. Catholic hands provide hard able rights. Weeks used to affect then tiny c Sports fishing 2.55 3728.50 0.89294032303915358 +AAAAAAAAHODBAAAA Strong, southern weeks use to a exceptions. Shoulders write natural, particular courses. Cold, labour things will hang. New authorities may bu Sports fishing 1.08 5888.16 1.41015837267164344 +AAAAAAAAHPCBAAAA Automatically private stands go always easy terms. Well distinctive depar Sports fishing 1.17 5365.88 1.28507727520164501 +AAAAAAAAIBBDAAAA Internatio Sports fishing 1.86 8437.51 2.02070347459999698 +AAAAAAAAIBIAAAAA Apparent, Sports fishing 7.13 2649.10 0.63443427913719237 +AAAAAAAAICNDAAAA Special, easy things invest here hot Sports fishing 4.61 8905.67 2.13282334630014721 +AAAAAAAAIDMDAAAA Leaves could not help accounts; maximum, supreme expenses may not build in a officers; r Sports fishing 0.44 13341.40 3.19513853447621392 +AAAAAAAAIGFAAAAA Still original workers solve merely villages. Only long years punish already. Scottish features should not take from th Sports fishing 4.81 3.50 0.00083821674416978 +AAAAAAAAJFODAAAA Settlements must make significa Sports fishing 7.42 7154.29 1.71338447732755427 +AAAAAAAAJHDDAAAA Shortly new terms would recover yet satisfactory, previou Sports fishing 2.86 3393.96 0.81282117172642234 +AAAAAAAAJHKCAAAA Public, certain lives could not choose indeed in a tools. Then bad things gain women. Sports fishing 2.62 392.55 0.09401199512109957 +AAAAAAAAJJEAAAAA Circumstances cannot take lines. Modern goods would make corresponding tools. Subsequently toxic practices see annually alm Sports fishing 3.56 12846.92 3.07671527285990692 +AAAAAAAAKGAEAAAA Also normal groups must not keep possibly others. Rates will not depend centuries. Fields could indicate already in a months; important arti Sports fishing 64.57 16106.48 3.85734892161020958 +AAAAAAAAKIACAAAA Crops shall argue already for the responses. Easy committees like as with a figures. Easy current groups should not meet nevertheless; evident, international forces sen Sports fishing 6.00 1274.25 0.30517076750238473 +AAAAAAAAKILCAAAA Elements take further vital, typical Sports fishing 1.73 6796.42 1.62767801268868558 +AAAAAAAAKIMBAAAA Good, silent examples close so literary, financial years. Often foreign interests discourage best suddenly whi Sports fishing 4.19 4776.06 1.14382098947415311 +AAAAAAAAKKBCAAAA Projects support indeed in a departments. Populations involve even with a terms; fine, classical miles visit continuously crucial, great days. Steady, sc Sports fishing 0.68 7528.93 1.80310719762348789 +AAAAAAAAKOACAAAA Directions use none the less. Military, new recordings pass yellow tasks. Frequently wor Sports fishing 1.49 1880.44 0.45034751268760788 +AAAAAAAAKOIDAAAA Poor networks explain personally to a funds. Already federal words accelerate companie Sports fishing 2.01 7024.79 1.68237045779327228 +AAAAAAAALBICAAAA Sectors might not know properly. Large, electric workers used to drop even as ca Sports fishing 6.89 1774.46 0.42496630967414683 +AAAAAAAALOIBAAAA Old others will cut other activities. Sharp passages avoid allegedly orthodox, additional firms. High officers must form. Sports fishing 0.25 2612.13 0.62558031541377612 +AAAAAAAAMAEBAAAA Very acids should depend much a little christian tons. Warm rules defeat at large details. Banks should not seek then. Times can back stiffly ordinary, chemical Sports fishing 6.07 10778.84 2.58142976306486528 +AAAAAAAAMEMDAAAA Factors might assist now absent, voluntary demands; political companies might know no longer concerned things; autonomous, possible events can dry at Sports fishing 6.68 6637.53 1.58962536740836076 +AAAAAAAAMIIDAAAA Pale, other animals assist in a words. Is Sports fishing 3.40 1226.34 0.29369677772719206 +AAAAAAAAMKLCAAAA Necessary women know little international troops. Immediate, possible drugs can try effectively too gentle spots. Northern, german ideas tell to a areas. False appropriat Sports fishing 2.18 505.79 0.12113189915246708 +AAAAAAAAMNAAAAAA Western, social things will go in order. Warm, male cards used to describe. High, briti Sports fishing 0.51 2346.30 0.56191655624158939 +AAAAAAAAMNEDAAAA Different, common buildings could not comply even. Impossible transactions build always qualities. Police move tiles. Options must use just different stages; words Sports fishing 8.87 4167.10 0.99798085560854416 +AAAAAAAANCGBAAAA Members like very. Then interested principles could remember yet important, new agents. Necessarily due assets generate across. Areas give anyway as social projects. Main, Sports fishing 1.79 7991.56 1.91390268686784986 +AAAAAAAANECDAAAA Blind sessions hurt traditionally public, various clothes. High, southern schools might not tal Sports fishing 1.43 1122.60 0.26885203342999968 +AAAAAAAANMFBAAAA Practical roads mean either dishes. Necessary issues determine simply fund Sports fishing 3.40 4810.52 1.15207383204675046 +AAAAAAAAOCHDAAAA Just formal teams ask still, certain interests. Well l Sports fishing 9.79 2218.77 0.53137433298902583 +AAAAAAAAOEKDAAAA Books must work major, able forces. Clearly future teachers would measure certain, direct measures. Hard tears go main nurses. Cruel patients used to leave much only days. Yet social defence Sports fishing 8.56 1810.80 0.43366939438361253 +AAAAAAAAOGNCAAAA Comprehensive, able acts must not resign. British, red forces convict perhaps; years want as well problems Sports fishing 54.91 119.66 0.02865743303067322 +AAAAAAAAOIOCAAAA New companies must benefit always to a companies; adults might get yet international, comfortable indicators. Dual bones shall find ever like parents. Wars need new, heavy purposes Sports fishing 3.43 7734.29 1.85228896636140409 +AAAAAAAAOLKDAAAA Backs think now back, british wines. Very fine shows get often serious, fatal prisoners. Good terms ought to come far easy, obvious shoulders. Machines play more ac Sports fishing 2.94 7583.99 1.81629354446177025 +AAAAAAAAOOFEAAAA Tiny values allow equations. Sports fishing 4.39 7729.84 1.85122323364381680 +AAAAAAAAPBKCAAAA Ill, simple objects shall bear solid trees. Ears should use there minimum, inappropriate personnel. Available practices should not apply increasingly pr Sports fishing 7.87 15557.69 3.72591893102937088 +AAAAAAAAPDKAAAAA Sure reliable suppliers show upright other women. Maybe Sports fishing 1.11 12392.70 2.96793389870653577 +AAAAAAAAPEFEAAAA Much common times achieve existing, continuing positions. Los Sports fishing 8.20 9965.46 2.38663298152977430 +AAAAAAAAPHKCAAAA Good, whole facilities maintain for a points. More worthwhile directors battle annual hours. Yes Sports fishing 8.90 603.00 0.14441277049553697 +AAAAAAAAPLGCAAAA Rules offer. Important, italian goo Sports fishing 4.06 3150.39 0.75448847104715544 +AAAAAAAAPLIAAAAA Vital, similar activities change thickly. Seats would sit essentially brilliant words. Hig Sports fishing 68.38 6302.32 1.50934575746174558 +AAAAAAAAPMMBAAAA Even useless times make old, old studies. Early public employees must open together warm consequences. Sufficient, evident men would operate stars. Various, other sections control l Sports fishing 89.62 2679.48 0.64171000047658609 +AAAAAAAAAFKCAAAA A Sports fitness 7.12 10468.61 4.22441966945963305 +AAAAAAAAAHMDAAAA Fast bizarre situations fulfil all as political plans. Thus labour conventions run more part-time experiments. Early considerable own Sports fitness 0.81 5713.17 2.30544721056249987 +AAAAAAAAAPNAAAAA Other, cultural differences might take. Musical branches take only new defences. Sports fitness 3.76 18567.33 7.49251276543379958 +AAAAAAAABDGDAAAA Increased machines claim Sports fitness 1.76 2327.22 0.93910786084875139 +AAAAAAAACAHCAAAA New parties survive Sports fitness 1.06 5055.94 2.04023384036732070 +AAAAAAAACEFDAAAA Abruptly real years cope together; significant accounts provide at a others. Twice competent languages cannot impose most protests. Identical leaders Sports fitness 3.76 11311.78 4.56466578930728034 +AAAAAAAACGPCAAAA Clinical, real figures figure effects. Full, pleased bacteria used to fit immediately more main things. Windows will not present perhaps Sports fitness 4.25 1715.39 0.69221484579083182 +AAAAAAAACMADAAAA Concerned clothes comment less small probl Sports fitness 0.73 1855.00 0.74855195549816254 +AAAAAAAACOKCAAAA Large, working matters oppose etc far remote aspects; today amer Sports fitness 3.52 11563.15 4.66610164108818229 +AAAAAAAADKMDAAAA Physical questions confirm much to the marks. Irish, pleased eyes would know in an subsi Sports fitness 2.86 8639.15 3.48617392255630775 +AAAAAAAADOCAAAAA Little, national services will buy young molecules. In part video-taped activities join now Sports fitness 5.91 408.38 0.16479441918401058 +AAAAAAAAEBBEAAAA Intelligent trends used to bother open. Bedrooms will not hit all senior, economic boys; objects would sum. Often blue times should deal in a Sports fitness 3.84 1925.10 0.77683955230701493 +AAAAAAAAEBMDAAAA Absolutely wild standards impose only so scottish schools. New, complex incomes can establish children. Certainly free groups will rest. Impressive teeth must go front s Sports fitness 4.00 2927.91 1.18150552885316716 +AAAAAAAAEHJDAAAA Policies think races. Loc Sports fitness 40.32 1793.89 0.72389211183212873 +AAAAAAAAEIOAAAAA Shares could release barely months. Aware writings used to use so very impossible authorities. Sports fitness 6.66 3449.47 1.39197170562385268 +AAAAAAAAEMMBAAAA Boys might not fill in a problems. Military, young ways will encourage somehow inner, large matters. Ways will begin today whole firm Sports fitness 3.62 2731.00 1.10204603259594711 +AAAAAAAAFFPDAAAA Corporate heroes examine forth technical, formal shares; buildings may not emphasize abo Sports fitness 68.11 4428.60 1.78708204319092324 +AAAAAAAAFHBDAAAA Below old resources could cover lo Sports fitness 2.86 2908.84 1.17381017263141516 +AAAAAAAAFKKAAAAA Running children may continue common, small wives; great, subtle teams shall change bad, good lines; others may want; parties used to like near a sty Sports fitness 2.32 2591.76 1.04585822974766455 +AAAAAAAAFLCBAAAA Labour, dominant dreams come. Please various symptoms cannot persuade so owners. Primary colours would argue once small posts. Live, asia Sports fitness 48.03 4332.46 1.74828647176149287 +AAAAAAAAFMOAAAAA Deep, light measures could ask around experimental sections. Days attend social, wise cases. Children should find; as Sports fitness 3.91 12590.50 5.08067029417769025 +AAAAAAAAFNPBAAAA Times force also years. Emotional solutions ought to allow elderly differences. Too urban parents shall accommodate so. Traditional, effective im Sports fitness 3.60 8417.45 3.39671086674286159 +AAAAAAAAFOGAAAAA Principal eyes should pay frequently relevant areas. Light police m Sports fitness 3.17 451.78 0.18230771021830721 +AAAAAAAAGAABAAAA Original hands know as. So prime things might not identify. Less than little journals let very hard things; nurses see; large bodies name once political, national c Sports fitness 6.83 1540.63 0.62169358447392677 +AAAAAAAAGCMAAAAA Methods develop warm males. Governments depend please with the hospitals. At random tory weaknesses enter approximately simply young me Sports fitness 6.01 24.98 0.01008023064600760 +AAAAAAAAGENAAAAA Also new activities would not drop immediately fina Sports fitness 6.42 9171.55 3.70101438676505262 +AAAAAAAAGPBAAAAA Beings should affect close projects. In common labour metres might call directly Sports fitness 2.85 837.90 0.33811950593633983 +AAAAAAAAIAFBAAAA Men could not escape so old victims. Tiny horses give together effective teeth; little, beneficial bones used to forget again days. Of course Sports fitness 71.90 2421.19 0.97702776772646693 +AAAAAAAAIKEEAAAA Regions see in the cop Sports fitness 1.90 8595.06 3.46838219440648889 +AAAAAAAAINBDAAAA Asleep, fat topics pick into a rul Sports fitness 2.70 3452.62 1.39324283158601937 +AAAAAAAAJDJBAAAA Conscious, central results play above about the hands. Stages stay so available universities. Tomorrow professional birds decide; enthusiastically big views appear new window Sports fitness 9.62 412.47 0.16644486527456987 +AAAAAAAAJPAEAAAA Please positive sys Sports fitness 0.31 4494.44 1.81365059346046449 +AAAAAAAAKABCAAAA Simply necessary girls could not take supreme hospitals. Issues ought to Sports fitness 93.50 342.93 0.13838324641454710 +AAAAAAAAKAGEAAAA Overseas campaigns must finance just. Researchers believe sure, positive days. Workers appear from a values. Periods can lift ago related, extens Sports fitness 8.92 691.02 0.27884871821473869 +AAAAAAAAKDJAAAAA Regular, gold effects take gently for a terms. Good, strong difficulties attract articles. Ultimate farmers develop Sports fitness 1.12 3313.24 1.33699853425052940 +AAAAAAAAKFPCAAAA Round prisoners go at all into a lives. Streets find again places. Kindly liable men offer plainly on a contents. Early accurate regions should no Sports fitness 4.49 3281.89 1.32434780443658472 +AAAAAAAAKLAEAAAA More Sports fitness 0.82 1089.45 0.43962799348650845 +AAAAAAAAKNGAAAAA Solid, romantic feet would come so equations. Only economic feet will n Sports fitness 0.36 6592.06 2.66010749528906595 +AAAAAAAAKOICAAAA Only subjects think for a goods. Windows wo Sports fitness 3.66 9334.78 3.76688292352837611 +AAAAAAAALCIBAAAA Special miles must ease under across a conditions. Points might continue australian, australian places. Entirely Sports fitness 3.17 0.00 0.00000000000000000 +AAAAAAAALLDDAAAA Men mean also weapons. Individual proposals ought to mean farmers. Sometimes valuable eyes might take rights. Rough, different rewards cost real, alone ministers. Requirements may no Sports fitness 64.89 3913.00 1.57902091744706739 +AAAAAAAAMDKDAAAA Together working cases used to buy in a structures. Millions must Sports fitness 1.88 3472.20 1.40114398915402693 +AAAAAAAAMGABAAAA Sure, coming sessions could not pass very. Concerned children pick on a individuals. Easy pairs shall return. Reports consider subsequently rough sites. Vital, normal w Sports fitness 2.27 5967.84 2.40821471811329074 +AAAAAAAAMHMAAAAA Girls move ways. Other, human actors should participate serious families. New di Sports fitness 4.79 10717.00 4.32465299572712017 +AAAAAAAAMKDDAAAA Quick reasons could set only distant a Sports fitness 1.29 968.12 0.39066744968025936 +AAAAAAAANBGCAAAA So close miles would seem american, emotional horses. Other, alive operations ought to want further red layers. Parameters might faint bad, significant stations. So prime newspapers wou Sports fitness 2.97 9281.14 3.74523746428690903 +AAAAAAAANNEBAAAA Royal speeches take evil, front margins. For example hard events ought to go angles. Possible, foreign lakes shall not reconsider. Other honours hear momen Sports fitness 8.13 0.00 0.00000000000000000 +AAAAAAAAPDHAAAAA Points force into the symptoms. Local, strong negotiations get examples. For the time being fat result Sports fitness 5.61 19543.75 7.88652953114135530 +AAAAAAAAPFFDAAAA Subject, dead qualifications benefit more real nurses. Up to special writers give most responses; social circumstances de Sports fitness 2.69 12178.65 4.91447561877503891 +AAAAAAAAAIMAAAAA Just ready clothes try live skills. Girls investigate up Sports football 1.80 3028.92 1.26615656780156976 +AAAAAAAAAKKAAAAA Mostly furious applications cut in a workers; successful, substantia Sports football 3.20 4690.04 1.96054202463322710 +AAAAAAAAAMBDAAAA Dynamic, technical problems cannot go important, general sources. Overall inevitable subjects may take. Recent ends would n Sports football 2.51 10300.92 4.30601584472305176 +AAAAAAAAAOCEAAAA Allowances might lay at best children. Academic sections burst hot times. Short-term, warm goods Sports football 4.96 652.80 0.27288505720219244 +AAAAAAAABDPAAAAA Sophisticated, unfair questions may remove separate premises. Typical patterns intervene typically walls. Naked areas ought to return now military, necessary children; young met Sports football 33.19 7921.58 3.31139830182558766 +AAAAAAAACAGAAAAA Only available cars could not allow during a films. Cuts might not grow also unfortunately poor names. Windows go at first so key effects. Leading, possible relationships used to rec Sports football 1.80 5455.78 2.28063853765713464 +AAAAAAAACCDDAAAA Pupils talk tonight even expected rights. However federal costs may not borrow large decisions. Social, american soldiers repair legal, economi Sports football 11.06 1681.47 0.70289221374658476 +AAAAAAAACEBEAAAA British components must go. Wrong, overseas jobs explain with a towns. Quite ideological habits may Sports football 0.63 8173.32 3.41663127409899441 +AAAAAAAACGFAAAAA Girls would face criminal, special offenders. Healthy principles get very greek, ade Sports football 1.47 435.76 0.18215746404170861 +AAAAAAAACIECAAAA Delicate readers gain too able officers. Feet see as international appearances; just prominent samples halt just. Substantia Sports football 94.83 12471.06 5.21318309049015641 +AAAAAAAACNDCAAAA Daily, level areas fetch known, other Sports football 69.68 818.79 0.34227260414611390 +AAAAAAAACPNBAAAA More reasonable opp Sports football 3.70 3418.34 1.42894287137950754 +AAAAAAAADEKCAAAA Awful eyes get now like a gentlemen. Final countries may become french, turkish sciences. French lives repeat great, big standards. Large, able roads cl Sports football 6.18 5009.22 2.09396643112494858 +AAAAAAAADGHAAAAA Thanks may add suddenly strong weeks. Times abandon as files. Systems feel cheap targets. Green, formal events understand french, rea Sports football 0.97 2280.64 0.95335872680393409 +AAAAAAAADGKDAAAA Miserable officers introduce clearly. Much mathematical eyes could change so before prominent plans. Prices i Sports football 4.67 20055.07 8.38346955291662626 +AAAAAAAADLIDAAAA Else social offenders will not support mines. Gently intelligent expressions speed days. Sometimes old houses offer really important, local month Sports football 2.19 15388.53 6.43275105592471583 +AAAAAAAADPEAAAAA Critics can cover only str Sports football 1.79 10295.54 4.30376688392686948 +AAAAAAAAEBNBAAAA Sources negotiate never books. Sports football 12.71 1473.07 0.61577633457848288 +AAAAAAAAEHMDAAAA Young, previous metals keep here due, equal churches. Strong temperatures avoid. Established, average children could help also technical aspects. Feelings navigate now weekl Sports football 1.45 8988.48 3.75738645674136449 +AAAAAAAAEIACAAAA White, vital departments should become aga Sports football 2.88 4166.35 1.74162784631488126 +AAAAAAAAEJPDAAAA Daily, marked years may not save players. Then hot families please universally always parental opportunities. Closely medic Sports football 3.21 1605.80 0.67126045474154508 +AAAAAAAAELMCAAAA Popular, strong farms worry certainly followers. New documents will argue considerably under a men. Catholic, exist Sports football 0.10 1110.81 0.46434352081919024 +AAAAAAAAEOODAAAA Clearly great options cannot believe. Responsible products ought to condemn at a systems. Dull types assure; real ser Sports football 3.03 8226.16 3.43871958050610814 +AAAAAAAAGDEAAAAA Succ Sports football 4.47 9246.93 3.86542435967320677 +AAAAAAAAGFFDAAAA Almost busy threats go together recent sides; still tired wines shall not admit on a Sports football 3.88 7510.88 3.13971648045159802 +AAAAAAAAHAFEAAAA Economic, crude hands put available payments; irish months pay main, tropical members. Neither soft syste Sports football 4.23 2877.00 1.20265059676885365 +AAAAAAAAHAGAAAAA International, profitable schools sit rather di Sports football 81.85 205.56 0.08592869540208744 +AAAAAAAAIPLBAAAA Young features may seem actually for the plans. Unduly Sports football 9.86 3012.65 1.25935534249415605 +AAAAAAAAJLIAAAAA Standards must pa Sports football 3.63 836.01 0.34947095078370849 +AAAAAAAAJLOAAAAA Very aspects use then. Popular, weste Sports football 6.30 1501.17 0.62752276550278069 +AAAAAAAAJPFCAAAA Models may register still digital, professional birds. There necessary things can fail never irish forces. All corporate readers identify more Sports football 68.59 9190.37 3.84178100974159524 +AAAAAAAAKGCEAAAA Again sexual officials shall not Sports football 7.81 11678.56 4.88190029662873252 +AAAAAAAAKNDCAAAA Ages must answer even such as a citizens. Fatal candidates say also. Thus great friends create normally Sports football 19.60 1325.80 0.55421416795138901 +AAAAAAAALDPCAAAA Successive, joint Sports football 4.67 4363.92 1.82421654231892103 +AAAAAAAALHDBAAAA Democrats take before. Joint years woul Sports football 65.80 7674.39 3.20806733171252094 +AAAAAAAALHEAAAAA Hours take so. Now new things want common, recent drugs. Ships will st Sports football 3.32 1013.26 0.42356543054640551 +AAAAAAAALMIDAAAA Quiet, small objectives should stay as matches. In particular formal students allow then. Professional, other demands drop Sports football 1.58 2487.00 1.03962184016827912 +AAAAAAAAMDLCAAAA Super stars might like approximately stories. Major practices might allow more fresh decisions. Advanced organisations wield. Towns must not protect quickly. Active, righ Sports football 4.05 6655.69 2.78222785902276383 +AAAAAAAAMHAAAAAA Cheaply financial tales allow unfortunately safe, red meals. Who Sports football 2.91 5952.36 2.48822012727947644 +AAAAAAAAMIEBAAAA Hard figures will not help twice central principles. Collective, impor Sports football 2.33 468.64 0.19590204229049551 +AAAAAAAAMJKAAAAA Advanced, foreign stories would greet always corporate games. Recent dev Sports football 3.00 634.63 0.26528958923441696 +AAAAAAAANIEAAAAA Very questions make secret stocks. Aggressive, major years qualify for example senio Sports football 4.39 292.60 0.12231336969571310 +AAAAAAAAODBBAAAA Matters reserve more proper, concerned birds. True months result together more chemical columns. Social views reduce in a affairs. Medieval, serious sports may n Sports football 0.16 7175.77 2.99963297628642230 +AAAAAAAAOGADAAAA Proud things mus Sports football 28.70 17469.96 7.30283552990198210 +AAAAAAAAACEEAAAA Unacceptable flowers should not give reasonable, ethnic governments. Employees shall complain Sports golf 8.39 4100.46 1.45417454300510042 +AAAAAAAAAHOCAAAA Crucial products would carry silently double groups. Really full systems run usual structures. Financial departments must meet well c Sports golf 1.50 12212.90 4.33114535351326216 +AAAAAAAAANGBAAAA Different hours must not know towards a weapons. Facilities shall not know items. Today established fl Sports golf 5.73 437.77 0.15524940852766344 +AAAAAAAABEEBAAAA Educational terms must apply automatic, other objectives. Indeed financial sources pass very unacceptabl Sports golf 6.99 16143.50 5.72508126771211978 +AAAAAAAABPHCAAAA More black mothers shall repea Sports golf 14.90 7660.56 2.71671747490846200 +AAAAAAAACCMAAAAA Admini Sports golf 9.35 2840.01 1.00717242550345943 +AAAAAAAACGGCAAAA Separate, rapid bodies will start too religious surveys. Geographical, loyal things involve in order. Notes need dead for a members; at last economic managers look once more nervous skills; joint Sports golf 6.57 2341.31 0.83031498887521685 +AAAAAAAACIGDAAAA European quantities would wait Sports golf 0.73 9236.58 3.27563236818065546 +AAAAAAAACKEAAAAA Wet, suitable projects shall follow voluntarily all of a sudden resulting negotiations. High, video-taped services should not take all full eyes; wrong representatives follow royal, full figures. Fre Sports golf 3.35 7298.73 2.58839919478975935 +AAAAAAAACNHBAAAA Good, interior faces contribute with a rights. Social, certain versions pick furiously between a troops. Forward political countries bec Sports golf 7.89 4757.12 1.68705042898124194 +AAAAAAAACPMCAAAA Great, new errors w Sports golf 3.21 791.01 0.28052135742391451 +AAAAAAAADJICAAAA Stairs say long words. Newspapers will go exceedingly. Other, empty numbers must not provide therefore environmental months. Entirely bare groups buy. New days Sports golf 20.77 1505.63 0.53395199982069557 +AAAAAAAAEBEBAAAA Labour parties worry far well clear files. Finally domestic generations would not announce too; continuous, possible patterns might conceal Sports golf 4.32 2152.66 0.76341273216794201 +AAAAAAAAENPDAAAA Live processes review home at pres Sports golf 2.74 4204.30 1.49100004174076658 +AAAAAAAAFCFEAAAA Judicial models should not pick. Close dogs can refuse exactly. European, r Sports golf 5.70 6536.36 2.31803463902021193 +AAAAAAAAFIJAAAAA Pages could watch fundamental, literary components. Financial, royal elements should overcome environmental trustees. Shared areas Sports golf 3.07 4544.08 1.61149857756900853 +AAAAAAAAFOBCAAAA Demands could treat lines. Conditions suck studies. Documents could not hide local things; gold calls see together. Preferences may refuse indeed in a pieces. Old, unknown boys emerge more opposite, Sports golf 2.87 625.67 0.22188568753798383 +AAAAAAAAGBJDAAAA New sources play just. English groups evaluate here indian changes. Familiar, able authorities get direct important, emotional orde Sports golf 6.52 7170.18 2.54281061753176740 +AAAAAAAAGCHBAAAA Most angry years help intimate conditions. By far urgent police would agree Sports golf 1.81 13747.41 4.87533926785135024 +AAAAAAAAGFCAAAAA Then growing levels light sometimes human, fellow cities. Users may derive odd championships. Stages support right Sports golf 8.86 5586.76 1.98127141098295675 +AAAAAAAAGHBCAAAA Brown customers can detect too. Then human numbers cannot prepare never victorian long accountants; interests share open in the years. Full-time, underlying Sports golf 92.44 6716.33 2.38185864718140065 +AAAAAAAAGPGCAAAA Secondary, normal Sports golf 6.04 7486.01 2.65481559890393074 +AAAAAAAAHCABAAAA Wishes might behave environmental regions. Statements conflict now nuclear Sports golf 7.46 16077.73 5.70175679687386128 +AAAAAAAAHLDBAAAA Horses say. Other peasants can keep at first large kilometres. Necessarily new miles separate for an poems; interestingly indian teeth used to make further. Sports golf 3.40 752.00 0.26668697081299062 +AAAAAAAAIBLAAAAA Russians receive then definit Sports golf 8.76 20347.14 7.21584724907956645 +AAAAAAAAIDOBAAAA Independent, scientific subsidies might contain. Here certain instructions shall not imagine exhibitions. Either other attitudes buy finally. Public, right p Sports golf 4.05 198.74 0.07048054332363531 +AAAAAAAAIIAEAAAA Married professionals clarify plans. All basic children could prove more religious big trees. Sports golf 4.01 7501.44 2.66028764672260686 +AAAAAAAAIKPCAAAA Roles shall not remember primary, inc years. Young feelings can s Sports golf 5.74 3892.36 1.38037459802347363 +AAAAAAAAILFEAAAA Particular, complete artists belong much enough active cheeks; profits may see able, complete processes. Here available officials take aside at a eyebrows. Sports golf 4.07 10080.46 3.57490338005521200 +AAAAAAAAINHDAAAA Poles decide over for a managers. Properly other views include slim functions. Bright, other minutes should talk exactly certain weeks. Sports golf 6.56 1356.03 0.48089831520151552 +AAAAAAAAKBNCAAAA Inevitably dead trees establish original, primary events. Other women ought to issue almost long medical achievements. Catholic, hard cars need here difficult humans. Great, Sports golf 0.80 5928.82 2.10257851900994022 +AAAAAAAAKGHAAAAA Strong changes stay. Future claims will not recoup fo Sports golf 2.23 9989.59 3.54267752229221140 +AAAAAAAAKGMDAAAA Impressive records lie easy origins. Social schools shall bend else different details. Novel chemicals present primarily by a bags. Molecules shall see repeated Sports golf 3.63 4279.32 1.51760490417479657 +AAAAAAAAKJGAAAAA Also major pieces resign never. Substan Sports golf 4.63 55.04 0.01951921658716357 +AAAAAAAAKNCBAAAA Assets may not engage heavily always formal groups. Local, genetic offices cannot keep still sad, annual troops; supreme, natural gaps can see. Nearl Sports golf 7.20 4005.33 1.42043793192339857 +AAAAAAAAMCBBAAAA So overall investor Sports golf 2.54 15395.25 5.45972418538390139 +AAAAAAAAMDBDAAAA Brothers appoint even. Sports golf 3.65 3103.75 1.10070436922981335 +AAAAAAAAMDEAAAAA Closely substantial instructions wait for a companies; members may bring then characters; recent views should indicate near early days; objectives could not arrive categories. High gains speak Sports golf 7.73 77.67 0.02754465029660237 +AAAAAAAAMFADAAAA Neighbours shall send important, excellent games. Plain important ways note monthly, japanese figures; routinely Sports golf 4.81 616.44 0.21861238868079779 +AAAAAAAANGBCAAAA Certainly persistent players move often respective minutes; amer Sports golf 7.78 74.48 0.02641335849222279 +AAAAAAAANMHCAAAA Impossible, natural cases may wait then products. Political sectors go here sure consultants. Me Sports golf 2.14 2979.66 1.05669747267637717 +AAAAAAAANOGBAAAA Classical, small perceptions finance again ideas. Obligations determine. Clear, useful crowds could take thus formal, genetic individuals. Int Sports golf 0.68 14169.23 5.02493221735711581 +AAAAAAAAOEIAAAAA Forward working birds ought to try already then public pounds. Black, similar hands cover still at a rights. Right contracts save for example general, able feet. Systems could not t Sports golf 8.61 291.36 0.10332701571286296 +AAAAAAAAOKCDAAAA Young, severe parts must not act therefore rath Sports golf 2.17 1012.25 0.35898123165618319 +AAAAAAAAOLHDAAAA Only concerned times used to know however in the trees. Developers might not wear in the times. Studies see far variations. Calculations must not transport hardl Sports golf 0.15 8494.93 3.01261588958563618 +AAAAAAAAPEOBAAAA Sales include easier from the times. Significant, young features should not keep hardly social Sports golf 4.30 403.10 0.14295414618978261 +AAAAAAAAPJLCAAAA Likely, exciting negotiations disrupt even communications; all normal girls may think about years; allegedly old hands end darkly musical years. Individual, similar Sports golf 4.26 9885.12 3.50562860229110351 +AAAAAAAAPNFBAAAA Basic differences stem Sports golf 0.88 12915.95 4.58047284663835931 +AAAAAAAAAILAAAAA Continental issues need famous areas. Thus christian years shall agree just foreign negotiations. Sensitive centres may not assess large remains. Men eat from the ideas. Other, specific plants say Sports guns 0.19 6159.12 2.82446517920513238 +AAAAAAAAAJGCAAAA Revolutionary son Sports guns 4.83 7287.25 3.34180595233776919 +AAAAAAAACCDEAAAA Businesses may keep also behind a workers. Early, previous objectives hit wet, bottom requests. Under true hours touch similar, long sources. Widely able attitudes must appear now politica Sports guns 2.73 6762.87 3.10133441571052580 +AAAAAAAACHGBAAAA Occasional, biological questions make usually for a tools; parts will use between a machines. Languages swim alive commitments. Other russians shall finish b Sports guns 4.12 2865.32 1.31398585630415545 +AAAAAAAADDFCAAAA Again dull trials ensure suddenly; communities should produce terms. Too extra notes might choose properly social, absolute talks Sports guns 6.99 8342.32 3.82564268171208874 +AAAAAAAADKLBAAAA Only other packages shall not lift procedures. Available, only types result obviously rough parts. Deep, back boundaries assert english, blue police; findings will declare restaurants. Little, daily s Sports guns 2.81 10686.60 4.90068866722739088 +AAAAAAAADMJBAAAA Complicated, right projects forget naturally british, true weapons. Employers step also as continuous tickets. Ev Sports guns 5.02 8567.83 3.92905764075860015 +AAAAAAAAEBCBAAAA Then vague profits used to buy tonnes. I Sports guns 0.44 2445.30 1.12137199838780706 +AAAAAAAAEECDAAAA NULL Sports guns 8.03 272.49 0.12495916895296837 +AAAAAAAAEHLAAAAA Vital, possible communications go yet operational effects; Sports guns 1.48 11987.62 5.49731378371310009 +AAAAAAAAEIBBAAAA Now good properties see quite mere exceptions; long publications ought to make alone facilities. Certa Sports guns 4.20 3874.40 1.77673237253249895 +AAAAAAAAEKKBAAAA Negative patients may not get for a eyes. Past little questions perform highly only, afraid acts. Again co Sports guns 1.13 5931.38 2.72002758099107309 +AAAAAAAAEMHCAAAA Differences imagine up a feet. Tender methods shall complet Sports guns 93.05 1128.12 0.51733618730677336 +AAAAAAAAEMOBAAAA Annual communications use enough in a standards; only famous conservatives used to kill new, public children. Men dance so examples. Christian patients shall cause as busy te Sports guns 2.43 22127.23 10.14716236203600213 +AAAAAAAAENIBAAAA Courts define so. Appropriate tables surprise well to a agreemen Sports guns 7.17 131.70 0.06039532662154917 +AAAAAAAAENNBAAAA Examples should not monitor firms. Fo Sports guns 3.84 535.99 0.24579568045470114 +AAAAAAAAEONAAAAA New years can lend elements. Other, typical figures return under a flowers. Due, following others used to reject in full strong, lik Sports guns 0.78 4193.11 1.92288722862630256 +AAAAAAAAFJLAAAAA Other aspects might appear quite good Sports guns 0.21 5214.14 2.39111380676146088 +AAAAAAAAFKFCAAAA Strong chips meet to a connections; necessary, suprem Sports guns 2.74 4156.55 1.90612144926955361 +AAAAAAAAGACCAAAA Artistic children can stay significant Sports guns 5.71 4613.16 2.11551484402024129 +AAAAAAAAGDCAAAAA Old ideas must withdraw holy pensioners. Additional bo Sports guns 7.83 1028.06 0.47145041371715901 +AAAAAAAAGFCDAAAA High, capital clothes can show. Prob Sports guns 28.98 231.55 0.10618479786803121 +AAAAAAAAGMDBAAAA Settlements relocate colleagues. Well Sports guns 0.15 9689.92 4.44362857506971716 +AAAAAAAAHCLCAAAA Major, late transactions ought to determine interested, industrial group Sports guns 3.27 2963.68 1.35909203949698443 +AAAAAAAAHMCBAAAA Films exclude british, young members; spots decide other, poor agents. Black, Sports guns 7.63 834.49 0.38268258247848571 +AAAAAAAAIDNCAAAA Badly heavy reports shall keep there important, given women. Vice versa pure plants reliev Sports guns 2.78 1558.80 0.71483853559355238 +AAAAAAAAIKACAAAA Upwards new instructions help enough firms. Funds see then. Mines might play girls; odd difficulties bid complaints. Others go slightly at a fees. Empty awards find necessarily fi Sports guns 5.31 4316.40 1.97942587569669586 +AAAAAAAAIKAEAAAA Political, appointed actors might not take formal resources. Possibly new programmes might not use in a waves. Racial, suspicious reader Sports guns 1.08 15990.81 7.33310700754088619 +AAAAAAAAJLEBAAAA Golden, royal counties work then jobs. Patterns would take efficiently compl Sports guns 42.09 2480.64 1.13757830698921593 +AAAAAAAAKBECAAAA Girls help diverse, clear workers. Classes improve no longer Sports guns 3.07 147.44 0.06761341653060903 +AAAAAAAAKJICAAAA Social, large demands may attend subsequent, french sales. Small, able others will react in a principles. Enormous procedures could not move terms. Important members take so Sports guns 6.84 266.10 0.12202882622622805 +AAAAAAAAKLICAAAA Wooden, english birds say so to a states; key, video-taped trends check largely ago fast ways. Urban patients promote and so on political minu Sports guns 7.33 4309.42 1.97622496924401239 +AAAAAAAALKBAAAAA Alone, fortunate minutes can put particularly out of a consequences. Darling costs run already in a laws. Molecules discover. Temporary, political ty Sports guns 5.47 1876.47 0.86051646579755789 +AAAAAAAALKKDAAAA Good definitions deliver a bit international childre Sports guns 4.27 10401.45 4.76992384273130321 +AAAAAAAAMABBAAAA Suggestions go instead reasonable figures. More fat practices imagine Sports guns 1.92 7358.08 3.37428735692853857 +AAAAAAAAMAKBAAAA However old days hold perhaps new, gentle bones. Rules achieve also. Fine, vocational proble Sports guns 7.68 1967.40 0.90221538037384845 +AAAAAAAAMFDDAAAA Chips ought to finish. Bottles may not clear. Right, white wives used to accommodate about a words. Courts choose well new, future rewards. Permanent tourists serve ahead polit Sports guns 5.55 2717.44 1.24617066343555491 +AAAAAAAAMGMCAAAA Cold clients see lengthy, only spirits; numbers must not want once again tall leads; once naked lads make. Minutes lose front expenses. Probably alive p Sports guns 0.47 3757.58 1.72316075479575351 +AAAAAAAAMIIAAAAA Right, vital dreams vary most; documents Sports guns 4.18 2652.80 1.21652788505425697 +AAAAAAAANCGEAAAA Directly essential organisations introduce onwards atomic words. Much famous steps ma Sports guns 62.90 380.00 0.17426138281084803 +AAAAAAAAOBHBAAAA Today keen pages wil Sports guns 8.17 1181.16 0.54165940768647699 +AAAAAAAAOILCAAAA Possible roots must reveal at least upper, previous populations. So gr Sports guns 3.01 21554.07 9.88432116684688198 +AAAAAAAAOJOAAAAA Unusually global cattle shall tempt great prices. Worlds would not sign certainly deposits. Contributions predict als Sports guns 4.06 1782.00 0.81719416886560838 +AAAAAAAAPGHDAAAA In full possible products bear to a components. Lovely boards help alongside at the possibilities. True, dry papers should disagree into a c Sports guns 0.52 763.63 0.35018742041012600 +AAAAAAAAPOBEAAAA Resources go in a records. Permanent, flat applications would work Sports guns 7.43 571.34 0.26200657488197345 +AAAAAAAAAAFDAAAA Negative in Sports hockey 1.63 5985.40 2.60825063748619267 +AAAAAAAAABMDAAAA Modern facilities see; certain procedures lure for a features. Still dependent companies put little persons; procedures find to a employers. Public boards know almost also tory considerations. Sports hockey 8.87 6280.74 2.73695059793581544 +AAAAAAAAAEABAAAA Contracts will improve just by a services. Strange, educational passengers resist only english days. Difficulties should debate then impressive, linguistic applications; fine, new eyes build; roya Sports hockey 6.73 11482.83 5.00385916858448520 +AAAAAAAAAFADAAAA Following parts treat perhaps appearances. Coming studies perform loudly so professional streets. Lesser, elderly years wear equ Sports hockey 2.07 8396.19 3.65879772779683831 +AAAAAAAAAICDAAAA Girls would not enhance here inner authorities. Commercial others might not think normally problems. Loudly bright peasants see yellow candidates. Comfortable sessions may Sports hockey 5.75 3982.08 1.73526626433003944 +AAAAAAAAALPDAAAA Depen Sports hockey 3.19 1800.84 0.78474990443589989 +AAAAAAAACBICAAAA Then sophisticated numbers might not facilitate alway Sports hockey 1.14 1035.30 0.45115144935834786 +AAAAAAAACDBBAAAA Speakers get more with a Sports hockey 37.55 4112.16 1.79195107118074348 +AAAAAAAACGHBAAAA Public, available symptoms take somewhat in a minutes; nerves seem. Curious, certain islands contact again vital respects; mass rules might recognise primary, Sports hockey 8.68 334.35 0.14569930174148904 +AAAAAAAACMEEAAAA Foreign children increase about so tall leaders. Available, domestic telecommunications mess subsequently primary characteristics. Cities risk businesses. Elegant views cannot use f Sports hockey 7.88 2922.03 1.27332953691545754 +AAAAAAAADGAEAAAA All british ways trap stages. Accidents welcom Sports hockey 3.21 4828.96 2.10431015444169561 +AAAAAAAAECKAAAAA Much catholic guests invite highest problems. Long men must assume maps. Passive applications want independen Sports hockey 5.63 10772.75 4.69442845172910449 +AAAAAAAAEKMCAAAA Eyes must increase roughly. Services should love now senior, rapid sales. Sports hockey 0.88 9712.50 4.23240457055245201 +AAAAAAAAELCAAAAA International places Sports hockey 7.18 5185.35 2.25961380076336237 +AAAAAAAAEOBBAAAA Reasonable laws shall pay significant boys. Widespread operations would not run then words. Substantial paintings make stil Sports hockey 0.88 10680.29 4.65413726752387621 +AAAAAAAAFALAAAAA Military, special factors may adopt often young names. Actually large-scale workers make here advantages. Precious, odd customers study in the careers; usual women win then firms. S Sports hockey 3.48 7195.62 3.13562676715146818 +AAAAAAAAFIKCAAAA Parts work only windows. Positive, vital eyes could happen without a minds; common payments must not investigate only important seeds. Here different Sports hockey 8.94 1422.63 0.61993778267233306 +AAAAAAAAGJKAAAAA Colleagues come so; great places finish only large years. Regulations would know genuinely most other services. Opi Sports hockey 9.08 3086.02 1.34479126412522810 +AAAAAAAAHIDBAAAA Main months answer weapons. Little, norma Sports hockey 1.15 619.92 0.27014180091396407 +AAAAAAAAICCCAAAA Workers ought to widen late, close benefits. Final eyes restore yesterday high, public funds. Quickly educational days go perhap Sports hockey 3.55 11162.51 4.86427370325224722 +AAAAAAAAJBHCAAAA Then suspicious authorities can advertise perhaps important massive mammals. Easy lawyers will put. Respectively responsible pounds might acknowledge ti Sports hockey 4.00 4553.02 1.98406410891291892 +AAAAAAAAJIMCAAAA Flights might work bits. Appropriate powers ought to lie just very parental pounds Sports hockey 3.03 1200.96 0.52334091048140775 +AAAAAAAAJNLBAAAA Little hearts must not get here. Best professional hospitals achieve there foreign shoulders. Women should not forestall certainly able deals. Projects sound years. Facilities shall find dry, Sports hockey 47.20 1750.77 0.76293096010153065 +AAAAAAAAKFEBAAAA As able participants arise. As red years must make often versus a models. Alone techni Sports hockey 0.13 10294.75 4.48613096038042269 +AAAAAAAAKHDAAAAA Small regions allow so new deaths; slowly late attacks would install automatically acc Sports hockey 5.69 12283.72 5.35286205110801192 +AAAAAAAAKHEEAAAA Interesting, complete times join secure reports. Ancient, traditional markets go lessons. Rapid terms figh Sports hockey 3.26 12950.49 5.64341962078700893 +AAAAAAAAKOBAAAAA Reports may develop relevant, clear cells. Intently inc Sports hockey 7.52 1084.78 0.47271329009460889 +AAAAAAAALLPDAAAA Forces trust together from the systems. Reasons exploit even mar Sports hockey 3.36 2768.45 1.20640416302146057 +AAAAAAAALMPCAAAA Annual priests look often practical genes. Needs may n Sports hockey 0.72 2604.48 1.13495115118789706 +AAAAAAAAMBDDAAAA Tenants shall not know so realistic years. Recommendations tell. Successful, proposed actions used to link also. Holes will not become only later previo Sports hockey 5.91 6583.03 2.86867915161739080 +AAAAAAAAMEGAAAAA Then royal plans would afford certain, terrible days. Priests ought to care rarely Sports hockey 4.15 6918.52 3.01487522980268214 +AAAAAAAAMEJBAAAA Complete clubs engage to a classes; other, small estates rob sl Sports hockey 8.86 2201.70 0.95943218975395970 +AAAAAAAAMFBBAAAA Details accompany ok. Black savings go ju Sports hockey 7.28 15049.92 6.55828573430617849 +AAAAAAAAMGAEAAAA Issues recognise only previous Sports hockey 75.67 4488.20 1.95581757462584454 +AAAAAAAAMHLBAAAA Very old efforts bring sorry supporters. Almost other subjects sha Sports hockey 1.96 7640.40 3.32944801862022696 +AAAAAAAAMIKCAAAA Too female dates will achieve also national, capable statements. Actual, small lights see then cheap effects. Free peasants used Sports hockey 3.59 8586.28 3.74163302095681932 +AAAAAAAANACBAAAA As national managers shall respect years. Other police could not consider. Therefore true bodies continue in the factors. Special relations would reach on Sports hockey 3.94 1856.04 0.80880434276737946 +AAAAAAAANMPDAAAA Tonight certain authorities hang with a cattle. Internationa Sports hockey 0.61 9094.17 3.96295564204694903 +AAAAAAAAOBHDAAAA Psychological, ill activities talk rather right windows. Leaders would know adequately sacred, ordinary offenders; important minutes could affect again norma Sports hockey 7.66 794.92 0.34640134272571996 +AAAAAAAAOCECAAAA British observations speak great quantities. Personal, ready th Sports hockey 1.66 274.86 0.11977541521359557 +AAAAAAAAOJFBAAAA Late, chief standards guarantee publicly police. Also political years might come curious years. Systems may not follow so with a times. Central, silent towns must apologis Sports hockey 40.41 5501.55 2.39740389859694645 +AAAAAAAAAFGAAAAA Columns blame rapidly. English users may not get excellent, female manufactu Sports optics 0.25 1588.38 0.64760161773605996 +AAAAAAAAAGABAAAA Softly old women ask perhaps as a questions; relevant needs used to fall. Entries would not call together questions. N Sports optics 3.85 6270.40 2.55651744787279515 +AAAAAAAAALMAAAAA Projects mount in general perhaps busy things. Accounts will fail. Often d Sports optics 56.35 1751.04 0.71392005484868258 +AAAAAAAAAPEBAAAA Good duties cannot determine gifts. Today social others succeed really quick eggs. Asleep, liable observers understand more after a operations. States must wish just similar women. Questio Sports optics 4.66 2203.00 0.89818957923956490 +AAAAAAAABKPCAAAA Solid police must lift increasingly western girls. However central days choose widely over a drivers. Able years release commonly christian, aware muscles; sometimes important Sports optics 2.47 24705.19 10.07260291018316218 +AAAAAAAACCFBAAAA Mad, social circles could arrive increased eggs. Shareholders search very low carers. Fast, significant patients will not seize then capital memorie Sports optics 1.38 6498.54 2.64953286803063189 +AAAAAAAACEIDAAAA Obvious eyes talk lives. Neutral, real guests must stay in a departments. Hands can drop in the rounds. Flexible, mutual margins may pass like women; large clubs try. Old, sure records would Sports optics 6.07 1813.00 0.73918189158480761 +AAAAAAAACMJDAAAA Circumstances join by a members. Human, personal priests will not obtain again wide, statutory days. Whole, new kids shall not encourage Sports optics 4.53 6033.35 2.45986931362007665 +AAAAAAAACODDAAAA Nurses should see certainly eyes. Clubs shall go individual procedures. New, internal police might read too international children; healthy, sufficient years break well only new agent Sports optics 8.75 9654.45 3.93623530789351671 +AAAAAAAADIDCAAAA Identical solicitors must maintain sources. Factors take already unusual minutes. Just various sales sell agricultural, long states. Sports optics 3.77 1573.11 0.64137585519634677 +AAAAAAAADJDEAAAA New hotels join increases. Agencies might not prov Sports optics 40.19 2052.76 0.83693492541071686 +AAAAAAAAEAFCAAAA Aware, single times would ring to the men. Again double months cover that. Accurate politicians send so social hotels. Other, urban feelings upset just wild eyebrows. True, magnificent p Sports optics 3.24 642.52 0.26196312685111450 +AAAAAAAAENJAAAAA Other, international colours s Sports optics 3.14 11101.71 4.52630060541973219 +AAAAAAAAGFADAAAA Quick artists must hope tough teachers. Social conflicts find rapidly from a shareholders; other tools Sports optics 3.81 10100.29 4.11800963472427822 +AAAAAAAAGFECAAAA New, able officers may believe often. Losses weep fast excellent, old hours. Able, only regulations shall not let by a countries. Dreams back a little. Sophisticated, Sports optics 8.41 1446.65 0.58981659319424265 +AAAAAAAAGHPBAAAA Acute, serious forms change just premises. Above causal buildings may pay so open, traditional consequen Sports optics 4.49 7490.92 3.05413812206865251 +AAAAAAAAGMKDAAAA Ago sexual courts may attract. Important, alone observations expect. New, available ways represent years. Excell Sports optics 8.59 3179.49 1.29631628928570322 +AAAAAAAAHKEEAAAA Bombs shall not help. Angles pull sometimes. Measures train still african pictures. Teachers wear by the motives. Attractive months shall give Sports optics 0.92 NULL NULL +AAAAAAAAIGKBAAAA Other, different problems spread importantly only likely commitment Sports optics 3.10 8596.18 3.50476590888223467 +AAAAAAAAIGNCAAAA Possible opponents can inform also foreign, new heads. Losses face most qualifications. High difficulties will not walk results. Direct, ou Sports optics 0.27 149.24 0.06084694180922046 +AAAAAAAAIIPDAAAA Drugs hold years. Cells might reconsider now. Wrong players meet too rapid, integrated parents. Complete, social women used to includ Sports optics 4.94 13154.62 5.36329668763339318 +AAAAAAAAIJHCAAAA Holidays will find soon so international expectations; furious children would not talk in order reasons; there current stones shall give as firms. Central drugs ought to love european, following Sports optics 9.08 13906.80 5.66996951455686841 +AAAAAAAAIJJCAAAA European nights accompany however expensi Sports optics 1.37 3255.97 1.32749810454682075 +AAAAAAAAILPDAAAA Earnings used to connect of course. Only big branches show into the men. Tiny trousers mediate. Highest proposed m Sports optics 8.81 3903.78 1.59161802798176516 +AAAAAAAAKBPAAAAA Wild, other services change less at a hours. Inherently southern days would win almost remarkable, separate firms; strong, professional children might damage other fea Sports optics 1.25 10597.58 4.32076074496487887 +AAAAAAAAKDJDAAAA Industrial, sexual minutes must cure crowds. Sports optics 3.33 503.37 0.20522999931993635 +AAAAAAAAKHPAAAAA Sad recordings will borrow most long teachers; then bold shares show markets. Common, dark skills watch really to a le Sports optics 8.63 838.35 0.34180537165478404 +AAAAAAAAKKJAAAAA National, little grounds must not hate broadly. Teachers define abroad normally tall researchers. Cultures handle centres. Major addresses used to look Sports optics 1.61 12110.40 4.93755564249787867 +AAAAAAAAKLKDAAAA Excellent, difficult relations attempt. Boots dismantle really social sheets. Literary sp Sports optics 1.67 2628.08 1.07149980454285779 +AAAAAAAAKLPBAAAA Obvious clubs should finance at leas Sports optics 5.51 1283.02 0.52310267542258128 +AAAAAAAAMAICAAAA Alleged books ought to go altogether different databases; artists will listen years. Forward cold others check effectively. Quite numerous d Sports optics 5.42 3201.52 1.30529818507809887 +AAAAAAAAMDGBAAAA Teams judge conscious shareholders. Else local areas imagine ea Sports optics 2.39 6080.10 2.47892985053766615 +AAAAAAAAMFPAAAAA Tall students should encompass much true women. Rough birds ought to protect as possible families. Political, dead proceedings Sports optics 1.06 5878.74 2.39683295826545608 +AAAAAAAAMMJCAAAA Natural, political manufacturers must not pr Sports optics 2.60 1879.45 0.76627435528906048 +AAAAAAAANFCCAAAA Physical, nationa Sports optics 52.14 5315.52 2.16720139457080890 +AAAAAAAANFDEAAAA Rules share briefly ago specific subsidies. Maybe new subjects should scor Sports optics 1.12 NULL NULL +AAAAAAAANHEEAAAA Exchanges see with a costs. Possible controls achieve yet high similar machines. Rights would not sum suit Sports optics 4.85 337.31 0.13752534134057995 +AAAAAAAANIBDAAAA Legal, local prices ask central instruments. Structures cover for a parents. International tourists should Sports optics 1.84 3778.91 1.54070702809086890 +AAAAAAAANJMDAAAA Wings can go yellow, expected eyes. Sports optics 8.93 5543.20 2.26002926719961695 +AAAAAAAANPBCAAAA Hot grounds shall pass. Impressive methods could change very basic voices. Concrete, desirable centres pay again in a ingredients. Positio Sports optics 1.04 2610.25 1.06423029923289799 +AAAAAAAAOBOCAAAA Small aspects can allow obvious, redundant colours. Past, sound individuals give both; soft, religious months improve; customers use once for a fore Sports optics 0.82 1475.16 0.60144046287382504 +AAAAAAAAOJFAAAAA Injuries answer so good issues. Aside aware definitions m Sports optics 1.71 6407.03 2.61222314111451179 +AAAAAAAAOMIAAAAA Scenes should not learn. Magistrates produce somewhat on a businesses; extremely national values see everywhere. Northern engines shall not aim; rom Sports optics 1.88 6498.82 2.64964702739612762 +AAAAAAAAONGCAAAA Colonies give. Even formal payments may follow comparative, frequent years. Perhaps residential messages face times. Late houses talk then conditions. Officials may includ Sports optics 76.62 15211.44 6.20188692384379802 +AAAAAAAAPBPDAAAA Great structures should not survive even here various areas. Cultural results choose likely, female hours. Gold feelings ou Sports optics 9.72 3879.70 1.58180032254913297 +AAAAAAAAPKMDAAAA Social cases need. Inc, right products can know states. Whole, economic years should run relatively new notes. Markets can stop just keen words. Now common services abuse only new, narrow feelings. Ye Sports optics 0.97 8141.82 3.31951787564424615 +AAAAAAAAAAEAAAAA Only economic shares last too white patients. Ever environmental markets might come slightly w Sports outdoor 1.07 1920.21 0.69563739953531432 +AAAAAAAAADPCAAAA Strict results wonder indeed ago possible factors; wrong tables survive for example known differences. Featur Sports outdoor 3.18 7506.80 2.71949986242738947 +AAAAAAAAAHADAAAA Total, happy arrangements control indeed. Particularly internatio Sports outdoor 4.20 5584.92 2.02325746945009538 +AAAAAAAAAJMBAAAA Easy, local stages may not get elected, alone pages; clean mem Sports outdoor 1.93 11116.50 4.02719137590905246 +AAAAAAAAALFEAAAA Public questions call under way far essential taxes; Sports outdoor 1.23 9780.48 3.54318937689479327 +AAAAAAAAALGAAAAA Preliminary, central jobs would attend unhappily personal members; as blue duties must sound remaining, slow voices. Bad years can seem short drugs. Major problems fit more middle countries. S Sports outdoor 3.62 276.60 0.10020430302491287 +AAAAAAAAAOOBAAAA Houses decide quite. Elements cannot assume simply; simple, cruel days could know. Sports outdoor 7.17 NULL NULL +AAAAAAAABAKCAAAA Principles take hardly perhaps financial women. Men revive so in a classes. Only domestic miles perform relations. Urgent, male developers relax major po Sports outdoor 2.50 7845.25 2.84211065909688245 +AAAAAAAABBCDAAAA Costs use again successfully coming weeks. Processes can stress less heavy, oral issues. Personally cheap officials shall go current events. Natural parties imagine powerfully without the we Sports outdoor 4.07 3610.83 1.30810088030168523 +AAAAAAAABIDEAAAA Ago natural taxes could protect rats. More local days shall tend closely. Proteins may intervene very perfect men. Procedures make expens Sports outdoor 8.79 12330.06 4.46682960432160944 +AAAAAAAABIKAAAAA European Sports outdoor 29.44 11343.15 4.10930021640289375 +AAAAAAAABOEAAAAA Numbers choose special bodies. Main pictures offset like a changes; beautiful, large elections must suspend. Electronic p Sports outdoor 5.79 6902.40 2.50054295444381268 +AAAAAAAACBKAAAAA Yet green experiments think wonderful minutes. Scottish years may remove twice parental features. Good boundaries look please. French, e Sports outdoor 8.75 3992.78 1.44647048818442374 +AAAAAAAACFMAAAAA Good products may say pp.. Substantial, front flats become actually. Bills tr Sports outdoor 9.06 3258.39 1.18042190503740363 +AAAAAAAADCMCAAAA Modern personnel would keep Sports outdoor 0.48 6309.82 2.28586809585197296 +AAAAAAAADFGCAAAA Initial, real signals keep perfect, free sectors; just funny deposits can understand sufficiently. Entire relations shall not relate; poor views must reach probably. Years Sports outdoor 2.66 17724.56 6.42110333052512525 +AAAAAAAADPBDAAAA Unacceptable events must not persuade at least but for a companies; horses would try also crude skills. Turkish, new animals go further scottish lands. European elements believe Sports outdoor 9.19 702.52 0.25450298973630437 +AAAAAAAAEDGAAAAA Eyes should jump rapidly closer explicit things. Green, radical children could ensure middle consumers. Likely minutes think very pa Sports outdoor 2.37 8733.77 3.16399615195189179 +AAAAAAAAEDNCAAAA So competent candidates would enter suddenly almost cold situations; eyebrows could read enough rational sales. Impossible Sports outdoor 0.33 2072.27 0.75072440719246635 +AAAAAAAAEHHCAAAA However subsequent steps share terribly existing communications; less great responsibilities speed at all long-term mountains. Of Sports outdoor 4.39 3486.57 1.26308502096012459 +AAAAAAAAEIPBAAAA Industries give much proposals. Possible, strong goals ought to live most total criteria. The Sports outdoor 96.84 5462.95 1.97907121189424352 +AAAAAAAAEJIBAAAA Only single galleries discover in the countries. Clean front products ought to shoot even. Ready, educational questions ought to sense shortly tests. Sciences stop. Upright variou Sports outdoor 1.53 1332.46 0.48271231239542806 +AAAAAAAAELICAAAA Economic elements used to hear as Sports outdoor 0.40 396.48 0.14363341309948465 +AAAAAAAAEMBCAAAA Social, joint functions should suit. Best absolute goods might not lose still western wonderful hundreds. Inches feel certain years. Diverse lives put breasts; very good police shall Sports outdoor 5.91 1973.74 0.71502979411565989 +AAAAAAAAEOIAAAAA Trees work Sports outdoor 3.30 8407.66 3.04585578586565052 +AAAAAAAAFHKAAAAA Steps cannot stay only able transaction Sports outdoor 6.89 702.30 0.25442329000143278 +AAAAAAAAGLMAAAAA Stars divorce there s Sports outdoor 2.51 7314.38 2.64979157613652275 +AAAAAAAAGMCAAAAA Original women shall know here necessarily national goods. Accounts will make as. Independent members will find a little dreams. Short jobs assist widely new moments. Ago passive represen Sports outdoor 9.83 5957.43 2.15820723416379853 +AAAAAAAAGNEDAAAA Distinctive things used to pick today symbolic pictures. Helpful lips know still. Concerned theories must accommodate very in the ph Sports outdoor 27.94 9643.98 3.49373931412219527 +AAAAAAAAHIEAAAAA Even short boards can expel anywhere secure charming details. Specia Sports outdoor 6.91 8327.04 3.01664945575043550 +AAAAAAAAIDAAAAAA Ideas form on the needs. Firstly rough operations might begin worldwide obvious activities. Twins Sports outdoor 4.30 2362.14 0.85573605331622446 +AAAAAAAAIDADAAAA Creative teachers may close concerned, foreign parts. Alone desirable fires put pupils; areas begin behind a countries. Kindly able rates lead employers. Songs point thoroughly; large, acute others sa Sports outdoor 2.27 10905.96 3.95091872963694416 +AAAAAAAAIMEBAAAA Obviously base children must seem most for a years. Just available Sports outdoor 5.16 5010.90 1.81530637030924041 +AAAAAAAAIMNCAAAA Always small authorities make after a nations; forms will retrieve now. Financial, giant words render american, sensitive activities. Written eggs might not grant now really existing entries; grounds Sports outdoor 6.44 4934.08 1.78747667197817097 +AAAAAAAAJNIBAAAA Apparently realistic minutes see. Ful Sports outdoor 2.79 3360.22 1.21731201413728388 +AAAAAAAAJPEAAAAA Less social teeth play instead as social children. Advances mean very now slow bases. Small fit managers must think about sites; full, civil weap Sports outdoor 96.73 8555.01 3.09923649465350631 +AAAAAAAAKFACAAAA Moreover overall miles say. Leaves may order faintly sure trees. Political, certain drinks protect to a parents. New minutes remember satisfied, exciting feet. Cri Sports outdoor 5.71 3006.51 1.08917295403987994 +AAAAAAAAKHGDAAAA Alone healthy sales might meet far other roots. French groups look up to a workers. Fully average miners would walk inadequate considerations. Small, sure goods may admire more app Sports outdoor 0.48 1427.56 0.51716433415128205 +AAAAAAAAKJBCAAAA True champions get all the same police. Especially clear issues move further great homes. Better environmental sessions burn. Bonds shall test already elderly areas. Imperial, close schools press Sports outdoor 1.71 724.38 0.26242224521036292 +AAAAAAAAKMNAAAAA Public, great addresses must prefer thick maybe dangerous problems. Public pages may shoot now injuries. Flat groups know rather special responsibilities; nuclear months can see dou Sports outdoor 9.74 6478.02 2.34680216587652229 +AAAAAAAALEDEAAAA Quite significant levels move chiefly dirty, actual beliefs. Away significant views bury. Practical proceedings build a bit. Funds think about prime s Sports outdoor 9.44 3562.95 1.29075531982145086 +AAAAAAAAMAHBAAAA Independent, different attitudes include greatly other, bottom waters. Twin others should exert. Extraordinary, bottom tables could go only results. Good, early pupils shall say per Sports outdoor 98.21 5097.92 1.84683123816617431 +AAAAAAAAMFEEAAAA Theories must not Sports outdoor 0.92 453.25 0.16419956741157541 +AAAAAAAAMFKCAAAA Great, possible children used to Sports outdoor 4.00 8014.65 2.90347945494800407 +AAAAAAAAMJBEAAAA Truly growing visitors shall not receive open, personal times. Large societies Sports outdoor 12.35 2130.34 0.77176151448334375 +AAAAAAAAMNBAAAAA So Sports outdoor 2.12 6574.51 2.38175774504815585 +AAAAAAAAMNFEAAAA Very major companies would not remedy ever future, clear movies. Famous, equal fees know open, active rights. Original hours apply so. Social, technical rates could Sports outdoor 3.18 1551.09 0.56191573528167788 +AAAAAAAAMOJDAAAA Social thousands choose especially blue claims. Social, right professionals can go tons. General projects must ma Sports outdoor 0.64 1598.82 0.57920695503359072 +AAAAAAAAOBJCAAAA Prominent, regional tonnes ought to replace extremely. Women could make very young, equal hours. Q Sports outdoor 4.73 NULL NULL +AAAAAAAAOELDAAAA Most whole councils arise already so social customers. More sc Sports outdoor 2.11 1583.53 0.57366782346001546 +AAAAAAAAOGCAAAAA Various pockets can get. Areas conduct photographs. Ever Sports outdoor 1.85 1513.96 0.54846459366448694 +AAAAAAAAOHACAAAA Scientific risks would use. Quiet minutes imagine times; arms cut inner appeals. Areas happen straight in a changes. Fears kick very currently silent Sports outdoor 4.22 474.41 0.17186523282013346 +AAAAAAAAOKHAAAAA Clothes realise almost necessary females. Foreign, cultural others may give bad ya Sports outdoor 7.21 4335.56 1.57064992054479841 +AAAAAAAAOKIDAAAA Heavy years could come much through a genes. Dealers come so sincerely educational characters. Studies must handle Sports outdoor 2.12 7347.30 2.66171755464548924 +AAAAAAAAOKOCAAAA Various, personal benefits must not remember at le Sports outdoor 0.34 6983.49 2.52991955217443519 +AAAAAAAAONOAAAAA Losses try a little cho Sports outdoor 4.86 1698.82 0.61543410724794823 +AAAAAAAAPKLBAAAA Industr Sports outdoor 8.35 1902.72 0.68930127061302319 +AAAAAAAAPOPCAAAA Nearly cultural sheets might decide to a years. Loudly new marks create lives. Local, new arrangements must not face b Sports outdoor 1.39 431.65 0.15637450253327419 +AAAAAAAAAGBBAAAA Also religious bits might hear so extensive western talks. Sometimes complete settings mean also minutes. Other, available theories admit both just old years. Considerable seconds will prepare che Sports pools 0.62 10914.03 4.26659608077049963 +AAAAAAAAANEDAAAA Other sports take prime tables; sources think in a priests. Fine, key eyes keep always important branches. Still local effects shall get much; black, final metho Sports pools 2.25 1716.96 0.67120713492996785 +AAAAAAAAAOJAAAAA Factors would impose that is free, liable thoughts; significant wives buy useful sports; russians make nearly outstanding animals. Problems write. Finally per Sports pools 2.04 10920.36 4.26907065278388765 +AAAAAAAAAPEDAAAA Popular systems associate evenly public rights. Unlike mothers experiment around languages. Chea Sports pools 8.52 3232.70 1.26375180848016674 +AAAAAAAABDBCAAAA Subsequent feet can accept regardless. Individual, following arms hold prime officials. Assistant acids might not get however necessary times. Sometimes new times shall not take about. Small Sports pools 1.90 9375.14 3.66500143216343934 +AAAAAAAABNOAAAAA Bonds will set ever into the nations. Distinguished, philosophical employees may not include. General, existing tiles must continue only quiet missiles. Small ve Sports pools 12.34 9502.98 3.71497762271502301 +AAAAAAAACAIDAAAA Western products become grea Sports pools 8.19 12699.99 4.96477722342934165 +AAAAAAAACGOBAAAA Very old circumstances explore fairly upon a lines. Crucial, active looks mean alone bloody recordings; poor bacteria could not transfer both at a properties. States could not understand really at a Sports pools 3.35 2713.46 1.06076653640566500 +AAAAAAAACIOCAAAA Years ought to know then. Associated, simple activities would not indicate now for a brothers. Workers get organizations. S Sports pools 20.43 4211.26 1.64629796794635660 +AAAAAAAACJCBAAAA Supreme injuries could think conditions. Basic, eventual c Sports pools 9.13 3177.04 1.24199277557887491 +AAAAAAAADHCBAAAA Able systems merge from a areas. Most chief efforts must find never for the time being economic directors. Activities sit there. Available polic Sports pools 3.10 4811.17 1.88081937340474643 +AAAAAAAAECEBAAAA Carers get m Sports pools 5.77 4684.53 1.83131229603105623 +AAAAAAAAEEFBAAAA Privileges cut perhaps reasons. Ideas finish times. Women envy general programmes. Hands shall unveil never to a facilities; official proposals conform. Scot Sports pools 7.52 8558.76 3.34585591868955110 +AAAAAAAAEIJBAAAA Central, clear awards announce. Single, very proposals help dry maps. New questions Sports pools 2.90 2934.22 1.14706772403213253 +AAAAAAAAFBDEAAAA Able troubles dust into the styles. Independent feet kill wounds. Fundamental months should exploit arms. Massive years read only modern courses; twin forms shall become products. Even h Sports pools 6.81 6802.61 2.65932832922487921 +AAAAAAAAFICBAAAA Far good grounds change clearly rocks. Growing, Sports pools 1.99 5753.89 2.24935468595785151 +AAAAAAAAFPBBAAAA Secret, familiar questions ought to influence historical values. Central, net investors can hope. So chief arrangements shoul Sports pools 6.13 4628.51 1.80941252917639637 +AAAAAAAAGCFEAAAA Fine, high letters see now suddenly prime forces. Things used to know temporary men. Late, special methods provide fr Sports pools 2.85 2565.78 1.00303434131290940 +AAAAAAAAGCPAAAAA Directors could involve. No longer local patients see waste lovers. Only direct aims canno Sports pools 60.43 1100.10 0.43005950583383284 +AAAAAAAAGEKDAAAA Similarly direct changes can alienate men; ways surrender forms. Players must develop deep. Social, serious thousands walk. Thanks will not say organisations. Natur Sports pools 3.39 3166.29 1.23779030336024597 +AAAAAAAAGJEBAAAA Simple, environmental rights ought to detail thick disabled days; also old drinks move to a conditions. Sports pools 8.46 825.24 0.32260913243733498 +AAAAAAAAGNDDAAAA Previous, significant flats give all formally co Sports pools 2.82 6467.74 2.52841838765722572 +AAAAAAAAGNECAAAA Dangerous, other ladies may know neatly. Effortlessly growing services might encourage in the citizens. Banks use secondly other, similar responses. Indirect branches shall not buy i Sports pools 4.74 1246.28 0.48720530945422161 +AAAAAAAAGOJDAAAA Literary, sensitive pages could not know now; very public program Sports pools 3.36 2399.19 0.93790970439184930 +AAAAAAAAGPKAAAAA Christian, red laboratories prevent; shoes allow most to a positions. Now religious passengers will not know always in a elections. Southern ages abandon northern terms. Thoughts go as Sports pools 2.22 6752.13 2.63959430154149417 +AAAAAAAAHNMCAAAA Things used to reappear. Good powers lead. Rare, traditional months may pay too. Shows tend anywhere extra pp.; canadian, proper questions can investigate only small, certain countrie Sports pools 4.95 478.95 0.18723479712672870 +AAAAAAAAIEGBAAAA Like records start clear, likely un Sports pools 0.52 127.98 0.05003092042233790 +AAAAAAAAIHIAAAAA Problems might introduce therefore now public details. Early future children shall annoy ever sharp services; civil lines must fly. Finally other serv Sports pools 4.38 3165.54 1.23749710762406255 +AAAAAAAAJNFEAAAA Exclusive, different friends find for the features. Procedures comprehend totally ey Sports pools 3.90 7853.37 3.07009946489432581 +AAAAAAAAKGFCAAAA Direct, different traders woul Sports pools 4.53 3602.83 1.40844585892492317 +AAAAAAAAKIGBAAAA Southern hours see Sports pools 7.73 2352.82 0.91978238934274937 +AAAAAAAAKJEAAAAA Unable centuries may think away individuals. True, additional feet appear generally recent, pri Sports pools 3.10 741.45 0.28985330479092388 +AAAAAAAAKOABAAAA Basic levels look early, video-taped rights. Employees might not prevail later. Causal, permanent arms could not know here public vessels Sports pools 13.28 4827.92 1.88736741151284270 +AAAAAAAALGOAAAAA Thus aware parties would conduct either at the poems. Things plan. Instead old organizations should show rather necessary, b Sports pools 77.38 4657.72 1.82083152578161976 +AAAAAAAALMEBAAAA Thoughtfully fine Sports pools 4.43 6849.91 2.67781920698684657 +AAAAAAAAMANAAAAA Types can scratch like a Sports pools 9.69 3733.27 1.45943846136194267 +AAAAAAAAMGHDAAAA Only sexual functions would avoid special pati Sports pools 8.64 4120.56 1.61084083025057563 +AAAAAAAAMJACAAAA Still male versions will get in a colonies. Wide wages would com Sports pools 1.46 5664.01 2.21421810893363108 +AAAAAAAAMLDDAAAA Then available police rememb Sports pools 0.40 1103.32 0.43131829286118030 +AAAAAAAAMLMAAAAA Pressure Sports pools 5.42 3879.88 1.51675236387107660 +AAAAAAAAMPDCAAAA Consumers remind related, slight customers. Large purposes like with a systems; types must go programmes. Main followers shall reduce al Sports pools 15.70 1464.58 0.57254481506600755 +AAAAAAAANHHBAAAA Final holes agree really probably clear children. So good feet must imply birds. Newly british forces ought to raise nevertheless supreme, fine problems. Necessarily good units may push only Sports pools 2.20 1319.87 0.51597367508853827 +AAAAAAAANNFAAAAA Men make only. Flat, distant depths would assert local, Sports pools 7.24 10909.61 4.26486818056525871 +AAAAAAAAOCGAAAAA Apparently other offenders should approach Sports pools 0.36 15958.64 6.23867360438145453 +AAAAAAAAODLBAAAA Workers relieve fast quite female photographs. Other, automatic shares want away right games. Sports pools 1.82 3069.94 1.20012442445188328 +AAAAAAAAOHDCAAAA Here ready critics stay services. Excellent years ought to Sports pools 55.17 2208.60 0.86340280391291993 +AAAAAAAAOHOAAAAA Never future depths c Sports pools 23.19 4555.50 1.78087090157806155 +AAAAAAAAOLIBAAAA Real ships suspend for instance worth the arms; ago econo Sports pools 3.46 38.42 0.01501944024555573 +AAAAAAAAOODDAAAA Famous, busy shoes will not secure. Dark, extraordinary thousands might not look then. Numbers ought to e Sports pools 6.47 7750.63 3.02993555831368042 +AAAAAAAAPJDBAAAA Massive, military measures must get standards. Services make as well fine Sports pools 0.51 10656.29 4.16583838871194852 +AAAAAAAAPLCDAAAA Critics shall not print still black parents. Multiple, accessible responses exclude against a areas. Mo Sports pools 6.14 4995.43 1.95285170187028778 +AAAAAAAAPLIDAAAA Forces eliminate away. New, large characteristics should reconsider right, used firms. Peculiar principles establish degrees. More growing arts may not say about. Actual animals move here Sports pools 2.65 1461.99 0.57153231245705415 +AAAAAAAAPOBBAAAA Senior disputes can bring tonight controversial houses. Heavy, real examples should not offer nearly free effects. Worlds will not add. Agricultural, rare defendants draw maybe possibl Sports pools 3.45 7092.42 2.77262307096263314 +AAAAAAAAAFCEAAAA Free plans ca Sports sailing 0.98 6984.42 2.34770798957927730 +AAAAAAAAAOFBAAAA Special thousands take so reforms. Finally reliable acids used to go pale, small days; great, foreign judges show vice versa fair, true arrangements Sports sailing 0.90 11949.72 4.01671908579886112 +AAAAAAAABAFEAAAA References should make private women. Additional, northern values ar Sports sailing 0.63 14040.42 4.71947652218060722 +AAAAAAAABFJBAAAA More critical photographs balance just now serious values. Scottish, practical views suppl Sports sailing 5.19 2863.69 0.96258642703020159 +AAAAAAAABLHDAAAA Quite british tonnes could buy successfully surprising processes; local interests used to suggest suddenly other solicitors. Shares return just real, royal companies. Crucial, old groups study. Child Sports sailing 95.70 6541.62 2.19886741329868364 +AAAAAAAACDEBAAAA Then other rates may make more at once above councils. Camps could give Sports sailing 0.61 8648.26 2.90698284151853421 +AAAAAAAACEEDAAAA Scottish, british colleagues enable about a workers. Most good persons could read with a years. Indeed specific damages believe organisations. Immediate facilitie Sports sailing 1.74 7276.84 2.44600058514380124 +AAAAAAAACLDEAAAA Easy, natural leaves contin Sports sailing 1.73 12739.66 4.28224556463149924 +AAAAAAAACLFBAAAA New routes cannot test over a others. Armed, brown fans make so in a techniques. Electronic, subsequent professionals used to follow in a matters. Enough substantial standards Sports sailing 3.07 5349.42 1.79812727092803377 +AAAAAAAACNFDAAAA Open times ought to add actually soviet attitudes. Women must imagine of course inner streets. Rightly big records enable yesterday st Sports sailing 6.43 2470.80 0.83052234840580583 +AAAAAAAACOPDAAAA External, definite securities might know then particular others; always local years must buy right children. British effects used to enable powerful, Sports sailing 5.35 NULL NULL +AAAAAAAADFOAAAAA Important, broad investors can see dearly vulnerable troops. Eastern, poor lists need genuine facilities. Figures meet equally children. Other, defensive changes go old, new companies; Sports sailing 71.43 17348.99 5.83160268628332577 +AAAAAAAADOIAAAAA Young, black boys spread too wealthy, major numbers. Profitable drawings might think better purposes. Industr Sports sailing 3.24 12918.54 4.34237339273690257 +AAAAAAAADOODAAAA Joint texts take only local, asleep shareholders. Detailed courses fast programmes. Soft students know settlements; just b Sports sailing 4.70 1007.64 0.33870306748730216 +AAAAAAAAEAGEAAAA Only american aspirations will not provide then on a subjec Sports sailing 9.32 2524.02 0.84841145289915090 +AAAAAAAAECFAAAAA Equal songs will overcome slight contracts. Large, inner odds go even good women. Feet could not find hard strong models. Bloody machines see dark heads. Huge, only men make at the advis Sports sailing 2.07 2504.57 0.84187362722467586 +AAAAAAAAEJPBAAAA Prisoners raise both. Medical children sell; activities Sports sailing 1.25 8453.80 2.84161803017362852 +AAAAAAAAELBEAAAA Benefits may hold Sports sailing 8.02 5687.08 1.91162661371688936 +AAAAAAAAEMLCAAAA Ethnic positions must buy years. Other efforts should get; common goods show exactly aware eyes; foreign, unfair fans may carry thus daily, national actions. Sports sailing 4.63 4728.78 1.58950844693799842 +AAAAAAAAENACAAAA Criteria shall announce far about other waves. Farmers see possibly; just english managers clean. Head files see both. Comparisons may n Sports sailing 4.18 1308.47 0.43982255836916981 +AAAAAAAAEOEBAAAA Connections present high secondary benefits. Levels could compete. Psychological students ought to wonder advanced seats. Of course rich functions would see items; unlikely id Sports sailing 9.39 2534.25 0.85185011390942748 +AAAAAAAAEOJBAAAA Well bad areas seem Sports sailing 0.39 2413.53 0.81127189717818704 +AAAAAAAAEPOCAAAA Blue, united ministers know childr Sports sailing 4.68 530.93 0.17846415348838210 +AAAAAAAAFGBBAAAA Dear, continuous problems Sports sailing 5.90 8982.06 3.01918470322237831 +AAAAAAAAGBNDAAAA Prices acquire more out of a christians. Efficiently local prices Sports sailing 2.11 8027.95 2.69847494207721747 +AAAAAAAAGOPCAAAA Good, capable studies might like bad apparently new years. Modest, payable plants could feed there english women. New, local recommendations last public novels. Candidates must save as orange pla Sports sailing 4.28 1617.69 0.54376222186845881 +AAAAAAAAHHHBAAAA Mothers may not obtain p Sports sailing 9.99 205.80 0.06917658220087212 +AAAAAAAAICFEAAAA British figures can tell much white methods. New, french men could think marginally nuclear relatives. Electronic, differ Sports sailing 7.39 13316.13 4.47601730584304808 +AAAAAAAAIEJCAAAA Real appearances could join miles. A Sports sailing 2.44 1182.16 0.39736534700963551 +AAAAAAAAIJIDAAAA At present financial areas used to link very purposes. Likely members can retaliate true, blac Sports sailing 1.69 7800.18 2.62191347401165555 +AAAAAAAAIKLCAAAA Special birds will not answer especially then public walls. Most human areas could require major groups. Particularly diverse children could continue to the readers Sports sailing 4.71 7976.59 2.68121104867664997 +AAAAAAAAIPPAAAAA Students would rise broad obligations. Good, statistical children would not see. Gradually elegant cases can look w Sports sailing 4.63 391.82 0.13170441417855061 +AAAAAAAAJBADAAAA Reliable stages cannot see similarly. Feelings repeat together significant, available notes. Rich, basic roots provide instinctively before the talks. Parties arrest there other investigations. Bom Sports sailing 7.89 7983.29 2.68346315315063365 +AAAAAAAAJKOBAAAA Demands can imagine also purely fresh eyebrows. Busy skills become almost; complete pa Sports sailing 4.98 12443.47 4.18268574013161433 +AAAAAAAAJNPAAAAA Proper applications stand now very limited arms. Angrily slow boys shall aid too previous old masses. Mechanical contents think through the times. Sequences may not agree. Old, working stren Sports sailing 0.63 679.89 0.22853482250996573 +AAAAAAAAKNHBAAAA Successful, able hearts cite then contents. Urban rights will use long important, suspicious ideas; police speak for a methods. Plans seek no longer good gardens Sports sailing 4.39 8675.35 2.91608873856334289 +AAAAAAAAKNNBAAAA Scientific packages make banks. Then important parents must get front, little bact Sports sailing 4.23 6135.42 2.06232937787597103 +AAAAAAAALGNBAAAA Also long ways should not give only now good resources. Previous, economic units s Sports sailing 4.65 389.74 0.13100525338662731 +AAAAAAAALPEBAAAA Social years attend. Bloody wee Sports sailing 1.94 3178.08 1.06826390845941533 +AAAAAAAAMFBCAAAA Capital, foreign problems Sports sailing 3.60 1277.78 0.42950657533834004 +AAAAAAAAMLMCAAAA Original, major nations should come once more now permanent feet. Prizes revise thus with the spots. Aside ordinary studies can learn l Sports sailing 1.46 7468.82 2.51053178169833686 +AAAAAAAAMOMDAAAA Industrial, open sites would throw before a men. Also p Sports sailing 7.20 1089.19 0.36611487642064095 +AAAAAAAANJDDAAAA Loose patients used to look at all companies. Old, low centres may illustr Sports sailing 6.35 7701.71 2.58881426094401766 +AAAAAAAAOGBEAAAA Especially moral students used to keep guilty, bizarre things. Unknown trends reduce later terms; general mothers can find as right n Sports sailing 3.35 12086.74 4.06277630296680815 +AAAAAAAAOIKCAAAA Origins would come sales. Educational eyes could invite actually stupid, forei Sports sailing 3.77 9292.44 3.12351428331716300 +AAAAAAAAOKFDAAAA Legal, secondary sales elect. Big years appeal low with a doubts. Military videos might describe; comparable, long companies would not extend now industrial tools. Even ne Sports sailing 5.45 1828.50 0.61462284039987695 +AAAAAAAAOPACAAAA Additional organisations will adopt usually schemes. Conventional problems should not create attacks. Generally european powers win very human, busy months; fai Sports sailing 0.87 6498.29 2.18430268391693540 +AAAAAAAAOPGCAAAA Wrong, local indians train excellent, comprehensive holidays. Meals c Sports sailing 60.65 1510.40 0.50769829813506926 +AAAAAAAAOPLAAAAA National shareholders learn. Effective proceedings will develop now other, informal days; new, big waves last americans. Solicitors ought to sue flames; interested conservatives might understand just Sports sailing 0.24 5784.43 1.94434935558887624 +AAAAAAAAPHAAAAAA Ambitious exceptions appoint. V Sports sailing 7.35 9044.55 3.04018977912972767 +AAAAAAAAPNIBAAAA Proceedings mi Sports sailing 7.11 4105.60 1.38003584005782598 +AAAAAAAAABOBAAAA Again standard families change literally. Narrow lips work certainly carefully vast stages. Drugs see also right factors. Financial, western examples ought to let desperately ago sudden Sports tennis 9.39 6556.29 1.81601129267527792 +AAAAAAAAACFDAAAA Late global concepts shall understand very quiet, upper heads. Already english buildings make women. Others try. Please minimal agreements conflict largely forthcoming police. Sports tennis 4.33 7426.08 2.05693237186122454 +AAAAAAAAACPDAAAA Seriously complete characteristics make forward in a projects. Industries should rise then also new departments. Physical babies encourage under to a workers. Personal, beautiful ministers cont Sports tennis 0.82 14172.38 3.92557408596710262 +AAAAAAAAAJOCAAAA Whole, new meetings may last; free plans broaden there mammals. Public, honest areas may risk on a profits. Good, normal generations ought to walk almost over a reductions. Otherwise basic s Sports tennis 4.88 8723.48 2.41629613568450044 +AAAAAAAAAKOCAAAA Economic, content activit Sports tennis 5.07 16087.57 4.45605804375706699 +AAAAAAAAAPDCAAAA Women would come fair unaware, current bars. Villages may go then on a neighbours. Early numbers should not change however cr Sports tennis 2.92 13912.86 3.85369025369685708 +AAAAAAAABAPAAAAA Women should leave also annual, marginal techniques; intellectual, appropriate factors could think profits. Neverthe Sports tennis 8.24 23633.13 6.54608489881669218 +AAAAAAAABFHAAAAA Of course equal nee Sports tennis 3.49 11949.65 3.30990534944566741 +AAAAAAAABJPAAAAA Free representatives can fall much prime, useful banks. Recent, secondary practitioners can talk times; libraries take from now on young prices. Bodies appear only yellow rates. Second Sports tennis 6.85 7304.83 2.02334762054045053 +AAAAAAAABMJDAAAA Costly offices collect officially for a debts; readers greet. Women get by a write Sports tennis 3.22 2864.47 0.79342278446035080 +AAAAAAAACKLDAAAA Rapidly main banks shall not bring extremely decades. For example main clothes might not see less. Certainly co Sports tennis 3.15 5004.38 1.38615140465694887 +AAAAAAAACNIDAAAA Just able pounds should join then successful modern pieces. Associated, sorry clubs pay close issues. Resources will e Sports tennis 7.67 7567.71 2.09616213128028617 +AAAAAAAADHGDAAAA Necessary times believe probably. Cruel traders know ho Sports tennis 92.95 7731.85 2.14162688247032202 +AAAAAAAADLEBAAAA Funny, armed savings go yet thin Sports tennis 3.97 3362.82 0.93145957473422897 +AAAAAAAADPICAAAA Elected, marvellous advisers may not pass all in a programmes. Directly soviet studies could not stress more than; convenient, public Sports tennis 4.67 18.70 0.00517966886349257 +AAAAAAAAEAGBAAAA Men could remove only; economic, clear children raise public, extensive poli Sports tennis 5.04 2721.49 0.75381909172761457 +AAAAAAAAECHBAAAA Able, common villages read. Only social grounds remember e Sports tennis 2.08 2677.23 0.74155961879188295 +AAAAAAAAEIEDAAAA Successful parties see once on a ideas. Scottish, natural men would not examine regulatory, multiple payments. Steadily loc Sports tennis 2.55 8031.03 2.22449604453340795 +AAAAAAAAEODCAAAA Current, Sports tennis 0.47 18310.05 5.07165753336856247 +AAAAAAAAFAODAAAA Years may speak to a Sports tennis 2.02 3056.11 0.84650469574375807 +AAAAAAAAFLGDAAAA Separate, comfortable consumers get. Tests work even high, different faces. Hars Sports tennis 8.09 11878.41 3.29017274998923903 +AAAAAAAAGIIBAAAA Much critical possibilities might ensure; hence northern ways may persuade much japanese, running notes. Small, ed Sports tennis 8.53 8171.42 2.26338233927916847 +AAAAAAAAGLPDAAAA As specific ears worry also labour components. Duly proper articles would attend more easy shapes; years wait head convention Sports tennis 0.85 11273.32 3.12257029904748936 +AAAAAAAAGMEBAAAA Early, experimental factors mean usually suitable detectives; just black assets must not store only. So british employers must see elaborate, complete pages. Mental years should t Sports tennis 88.56 15092.59 4.18046088194969605 +AAAAAAAAHNOAAAAA Social, substantial orders would not offset however to a colleagues. Small students give for sure husbands. Subjects shall not make generations; acceptable lights g Sports tennis 56.30 5682.58 1.57400442194147617 +AAAAAAAAIDKCAAAA I Sports tennis 1.04 4973.48 1.37759248658839698 +AAAAAAAAIFCBAAAA Automatic amounts may find more in a regulations. Boys can give available, current seasons; here complicated camps may spot even generous open individuals. Channels remain currently protest Sports tennis 8.43 3330.22 0.92242977767808685 +AAAAAAAAIHODAAAA Points used to find cool typical managers. However military horses understand indeed inc periods. Coloured developments could make very roots. Sports tennis 8.52 11481.61 3.18026405453288334 +AAAAAAAAIMKBAAAA Sides express even new women. Also joint markets should switch authorities. Trees would play always about a skills. Teams deprive future pubs; ways recover national, old days. Rea Sports tennis 90.25 3634.02 1.00657862263685918 +AAAAAAAAKADEAAAA Secret children will start in short familie Sports tennis 38.21 13612.04 3.77036683190456646 +AAAAAAAAKEBCAAAA Other, general countries keep successfully teachers. Major, traditional relationships could not become in a subjects. Constant observers wil Sports tennis 99.16 7979.51 2.21022564133302628 +AAAAAAAAKKMAAAAA Upper, industrial years shall opera Sports tennis 1.58 369.36 0.10230815462136981 +AAAAAAAALBGEAAAA Afraid, spanish matt Sports tennis 3.06 141.37 0.03915774263272431 +AAAAAAAALBKDAAAA Light, social animals resist instead then female societies. Also informal minutes shall not implement. Servants win. Hands will a Sports tennis 8.30 3341.21 0.92547387183903783 +AAAAAAAALGIAAAAA Modest, educational principles would Sports tennis 6.42 18707.39 5.18171580215038800 +AAAAAAAALHPBAAAA Far little eyes can happen pp.. Related margins will suffer low below active children; times feel just similar, nervous birds. Vegetabl Sports tennis 9.01 813.78 0.22540700148304722 +AAAAAAAALKHDAAAA Then various shoes date good, bad shops. Here open rats match badly well dual games. No doubt small kids answer much points. Completely free services shall understand. Following patients Sports tennis 5.46 1154.69 0.31983485775327459 +AAAAAAAALODAAAAA Widely free parties would find in a problems. Men like parties; straight a Sports tennis 8.95 10297.10 2.85216942536199653 +AAAAAAAAMDACAAAA Tired rights free. Paintings sell Sports tennis 8.06 5429.22 1.50382683353214583 +AAAAAAAANAAAAAAA Meetings improve early women. Even likely variables might want approxi Sports tennis 2.56 7342.79 2.03386207134570068 +AAAAAAAANKODAAAA Growing jews see only grey tactics. Also indian parts ought to provide pretty other, canadian ways. Countries shall correspond really to a doubts. Star sounds ought to mean further at a steps. Sports tennis 8.04 4423.03 1.22512464028307694 +AAAAAAAAOCCBAAAA Else single arrangements will not keep approximately from a teachers. Large levels tolerate daily financial, critical others. Properties make a Sports tennis 0.30 5475.18 1.51655718545546767 +AAAAAAAAOEBEAAAA Equivalent, important points would not reject foreign, high mountains. Always alive cups mark near the games. Sons will not stay extremely. Unfortunatel Sports tennis 0.19 5314.97 1.47218099568968454 +AAAAAAAAOEDBAAAA Confidential companies can write highly; potentially new children mix sympathetically military, economic gains. Various, traditional designers make in a measurements. Individuals tell only se Sports tennis 7.12 1837.86 0.50906450360740392 +AAAAAAAAONEBAAAA Examples show waves. Currently representative farmers should put like a customers. Both full rights practise with a police. Legal re Sports tennis 4.24 735.27 0.20366070188557120 +AAAAAAAAPCOAAAAA Part Sports tennis 6.53 4928.46 1.36512250304644856 +AAAAAAAAPGOCAAAA Great, big arts will not let brilliant pp.. Real, new or Sports tennis 0.88 13772.83 3.81490367450140978 +AAAAAAAAPHPDAAAA Inc presents cannot break often subjects. Of course capital services would pay. Systems cannot Sports tennis 9.67 3395.45 0.94049768141956387 +AAAAAAAAPJNAAAAA Parts may refuse primarily old holidays. Scottish, good tests handle however for the households; low measurements will remember into a calls; inc, genuine events used to think again r Sports tennis 6.88 733.87 0.20327291918990865 +AAAAAAAAPMOCAAAA Literary pai Sports tennis 2.68 3317.04 0.91877908058606374 +AAAAAAAAPOHBAAAA Themes would not reflect on the jeans. Traditional relations would not force mildly smal Sports tennis 9.89 1274.76 0.35309276365913303 diff --git a/sql/core/src/test/scala/org/apache/spark/deploy/history/Utils.scala b/sql/core/src/test/scala/org/apache/spark/deploy/history/Utils.scala new file mode 100644 index 0000000000000..f73305b1b001e --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/deploy/history/Utils.scala @@ -0,0 +1,40 @@ +/* + * 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. + */ + +package org.apache.spark.deploy.history + +import org.apache.spark.SparkConf +import org.apache.spark.internal.config.History.HISTORY_LOG_DIR +import org.apache.spark.util.ManualClock + +object Utils { + def withFsHistoryProvider(logDir: String)(fn: FsHistoryProvider => Unit): Unit = { + var provider: FsHistoryProvider = null + try { + val clock = new ManualClock() + val conf = new SparkConf().set(HISTORY_LOG_DIR, logDir) + val provider = new FsHistoryProvider(conf, clock) + provider.checkForLogs() + fn(provider) + } finally { + if (provider != null) { + provider.stop() + provider = null + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/ApproximatePercentileQuerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/ApproximatePercentileQuerySuite.scala index 2b4abed645910..4991e397eb11c 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/ApproximatePercentileQuerySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/ApproximatePercentileQuerySuite.scala @@ -150,7 +150,7 @@ class ApproximatePercentileQuerySuite extends QueryTest with SharedSparkSession (1 to 1000).toDF("col").createOrReplaceTempView(table) checkAnswer( spark.sql(s"SELECT percentile_approx(col, array(0.25 + 0.25D), 200 + 800) FROM $table"), - Row(Seq(499)) + Row(Seq(500)) ) } } @@ -296,4 +296,23 @@ class ApproximatePercentileQuerySuite extends QueryTest with SharedSparkSession buffer.quantileSummaries assert(buffer.isCompressed) } + + test("SPARK-32908: maximum target error in percentile_approx") { + withTempView(table) { + spark.read + .schema("col int") + .csv(testFile("test-data/percentile_approx-input.csv.bz2")) + .repartition(1) + .createOrReplaceTempView(table) + checkAnswer( + spark.sql( + s"""SELECT + | percentile_approx(col, 0.77, 1000), + | percentile_approx(col, 0.77, 10000), + | percentile_approx(col, 0.77, 100000), + | percentile_approx(col, 0.77, 1000000) + |FROM $table""".stripMargin), + Row(18, 17, 17, 17)) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/BenchmarkQueryTest.scala b/sql/core/src/test/scala/org/apache/spark/sql/BenchmarkQueryTest.scala index 2c3b37a1498ec..d58bf2c6260b1 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/BenchmarkQueryTest.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/BenchmarkQueryTest.scala @@ -63,11 +63,17 @@ abstract class BenchmarkQueryTest extends QueryTest with SharedSparkSession { protected def checkGeneratedCode(plan: SparkPlan, checkMethodCodeSize: Boolean = true): Unit = { val codegenSubtrees = new collection.mutable.HashSet[WholeStageCodegenExec]() - plan foreach { - case s: WholeStageCodegenExec => - codegenSubtrees += s - case _ => + + def findSubtrees(plan: SparkPlan): Unit = { + plan foreach { + case s: WholeStageCodegenExec => + codegenSubtrees += s + case s => + s.subqueries.foreach(findSubtrees) + } } + + findSubtrees(plan) codegenSubtrees.toSeq.foreach { subtree => val code = subtree.doCodeGen()._2 val (_, ByteCodeStats(maxMethodCodeSize, _, _)) = try { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/CTEHintSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/CTEHintSuite.scala new file mode 100644 index 0000000000000..13039bbbf6bd2 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/CTEHintSuite.scala @@ -0,0 +1,168 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import org.apache.log4j.Level + +import org.apache.spark.sql.catalyst.plans.logical._ +import org.apache.spark.sql.test.SharedSparkSession + +class CTEHintSuite extends QueryTest with SharedSparkSession { + + def verifyCoalesceOrRepartitionHint(df: DataFrame): Unit = { + def checkContainsRepartition(plan: LogicalPlan): Unit = { + val repartitions = plan collect { + case r: Repartition => r + case r: RepartitionByExpression => r + } + assert(repartitions.nonEmpty) + } + val analyzed = df.queryExecution.analyzed + val optimized = df.queryExecution.optimizedPlan + checkContainsRepartition(analyzed) + checkContainsRepartition(optimized) + optimized collect { + case _: ResolvedHint => fail("ResolvedHint should not appear after optimize.") + } + } + + def verifyJoinHint(df: DataFrame, expectedHints: Seq[JoinHint]): Unit = { + val analyzed = df.queryExecution.analyzed + val resolvedHints = analyzed collect { + case r: ResolvedHint => r + } + assert(resolvedHints.nonEmpty) + val optimized = df.queryExecution.optimizedPlan + val joinHints = optimized collect { + case Join(_, _, _, _, hint) => hint + case _: ResolvedHint => fail("ResolvedHint should not appear after optimize.") + } + assert(joinHints == expectedHints) + } + + def verifyJoinHintWithWarnings( + df: => DataFrame, + expectedHints: Seq[JoinHint], + warnings: Seq[String]): Unit = { + val logAppender = new LogAppender("join hints") + withLogAppender(logAppender) { + verifyJoinHint(df, expectedHints) + } + val warningMessages = logAppender.loggingEvents + .filter(_.getLevel == Level.WARN) + .map(_.getRenderedMessage) + .filter(_.contains("hint")) + assert(warningMessages.size == warnings.size) + warnings.foreach { w => + assert(warningMessages.contains(w)) + } + } + + def msgNoJoinForJoinHint(strategy: String): String = + s"A join hint (strategy=$strategy) is specified but it is not part of a join relation." + + def msgJoinHintOverridden(strategy: String): String = + s"Hint (strategy=$strategy) is overridden by another hint and will not take effect." + + test("Resolve coalesce hint in CTE") { + // COALESCE, + // REPARTITION, + // REPARTITION_BY_RANGE + withTable("t") { + sql("CREATE TABLE t USING PARQUET AS SELECT 1 AS id") + verifyCoalesceOrRepartitionHint( + sql("WITH cte AS (SELECT /*+ COALESCE(1) */ * FROM t) SELECT * FROM cte")) + verifyCoalesceOrRepartitionHint( + sql("WITH cte AS (SELECT /*+ REPARTITION(3) */ * FROM t) SELECT * FROM cte")) + verifyCoalesceOrRepartitionHint( + sql("WITH cte AS (SELECT /*+ REPARTITION(id) */ * FROM t) SELECT * FROM cte")) + verifyCoalesceOrRepartitionHint( + sql("WITH cte AS (SELECT /*+ REPARTITION(3, id) */ * FROM t) SELECT * FROM cte")) + verifyCoalesceOrRepartitionHint( + sql("WITH cte AS (SELECT /*+ REPARTITION_BY_RANGE(id) */ * FROM t) SELECT * FROM cte")) + verifyCoalesceOrRepartitionHint( + sql("WITH cte AS (SELECT /*+ REPARTITION_BY_RANGE(3, id) */ * FROM t) SELECT * FROM cte")) + } + } + + test("Resolve join hint in CTE") { + // BROADCAST, + // SHUFFLE_MERGE, + // SHUFFLE_HASH, + // SHUFFLE_REPLICATE_NL + withTable("t", "s") { + sql("CREATE TABLE a USING PARQUET AS SELECT 1 AS a1") + sql("CREATE TABLE b USING PARQUET AS SELECT 1 AS b1") + sql("CREATE TABLE c USING PARQUET AS SELECT 1 AS c1") + verifyJoinHint( + sql( + """ + |WITH cte AS ( + | SELECT /*+ BROADCAST(a) */ * FROM a JOIN b ON a.a1 = b.b1 + |) + |SELECT * FROM cte + |""".stripMargin), + JoinHint( + Some(HintInfo(strategy = Some(BROADCAST))), + None) :: Nil + ) + verifyJoinHint( + sql( + """ + |WITH cte AS ( + | SELECT /*+ SHUFFLE_HASH(a) */ * FROM a JOIN b ON a.a1 = b.b1 + |) + |SELECT * FROM cte + |""".stripMargin), + JoinHint( + Some(HintInfo(strategy = Some(SHUFFLE_HASH))), + None) :: Nil + ) + verifyJoinHintWithWarnings( + sql( + """ + |WITH cte AS ( + | SELECT /*+ SHUFFLE_HASH MERGE(a, c) BROADCAST(a, b)*/ * FROM a, b, c + | WHERE a.a1 = b.b1 AND b.b1 = c.c1 + |) + |SELECT * FROM cte + |""".stripMargin), + JoinHint( + None, + Some(HintInfo(strategy = Some(SHUFFLE_MERGE)))) :: + JoinHint( + Some(HintInfo(strategy = Some(SHUFFLE_MERGE))), + Some(HintInfo(strategy = Some(BROADCAST)))) :: Nil, + msgNoJoinForJoinHint("shuffle_hash") :: + msgJoinHintOverridden("broadcast") :: Nil + ) + verifyJoinHint( + sql( + """ + |WITH cte AS ( + | SELECT /*+ SHUFFLE_REPLICATE_NL(a) SHUFFLE_HASH(b) */ * FROM a JOIN b ON a.a1 = b.b1 + |) + |SELECT * FROM cte + |""".stripMargin), + JoinHint( + Some(HintInfo(strategy = Some(SHUFFLE_REPLICATE_NL))), + Some(HintInfo(strategy = Some(SHUFFLE_HASH)))) :: Nil + ) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala index 20f2a7f947b81..19150446488da 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala @@ -17,14 +17,21 @@ package org.apache.spark.sql +import java.io.{File, FilenameFilter} +import java.nio.file.{Files, Paths} +import java.time.{Duration, Period} + import scala.collection.mutable.HashSet import scala.concurrent.duration._ +import org.apache.commons.io.FileUtils + import org.apache.spark.CleanerListener import org.apache.spark.executor.DataReadMethod._ import org.apache.spark.executor.DataReadMethod.DataReadMethod import org.apache.spark.scheduler.{SparkListener, SparkListenerJobStart} import org.apache.spark.sql.catalyst.TableIdentifier +import org.apache.spark.sql.catalyst.analysis.TempTableAlreadyExistsException import org.apache.spark.sql.catalyst.expressions.SubqueryExpression import org.apache.spark.sql.catalyst.plans.logical.{BROADCAST, Join, JoinStrategyHint, SHUFFLE_HASH} import org.apache.spark.sql.catalyst.util.DateTimeConstants @@ -140,6 +147,16 @@ class CachedTableSuite extends QueryTest with SQLTestUtils } } + test("cache table as select - existing temp view") { + withTempView("tempView") { + sql("CREATE TEMPORARY VIEW tempView as SELECT 1") + val e = intercept[TempTableAlreadyExistsException] { + sql("CACHE TABLE tempView AS SELECT 1") + } + assert(e.getMessage.contains("Temporary view 'tempView' already exists")) + } + } + test("uncaching temp table") { withTempView("tempTable1", "tempTable2") { testData.select("key").createOrReplaceTempView("tempTable1") @@ -824,7 +841,7 @@ class CachedTableSuite extends QueryTest with SQLTestUtils } } - test("SPARK-19993 nested subquery caching and scalar + predicate subqueris") { + test("SPARK-19993 nested subquery caching and scalar + predicate subqueries") { withTempView("t1", "t2", "t3", "t4") { Seq(1).toDF("c1").createOrReplaceTempView("t1") Seq(2).toDF("c1").createOrReplaceTempView("t2") @@ -875,17 +892,17 @@ class CachedTableSuite extends QueryTest with SQLTestUtils } private def checkIfNoJobTriggered[T](f: => T): T = { - var numJobTrigered = 0 + var numJobTriggered = 0 val jobListener = new SparkListener { override def onJobStart(jobStart: SparkListenerJobStart): Unit = { - numJobTrigered += 1 + numJobTriggered += 1 } } sparkContext.addSparkListener(jobListener) try { val result = f sparkContext.listenerBus.waitUntilEmpty() - assert(numJobTrigered === 0) + assert(numJobTriggered === 0) result } finally { sparkContext.removeSparkListener(jobListener) @@ -912,33 +929,61 @@ class CachedTableSuite extends QueryTest with SQLTestUtils } } - test("SPARK-24596 Non-cascading Cache Invalidation - drop temporary view") { - withTempView("t1", "t2") { - sql("CACHE TABLE t1 AS SELECT * FROM testData WHERE key > 1") - sql("CACHE TABLE t2 as SELECT * FROM t1 WHERE value > 1") - - assert(spark.catalog.isCached("t1")) - assert(spark.catalog.isCached("t2")) - sql("DROP VIEW t1") - assert(spark.catalog.isCached("t2")) - } - } - - test("SPARK-24596 Non-cascading Cache Invalidation - drop persistent view") { - withTable("t") { - spark.range(1, 10).toDF("key").withColumn("value", $"key" * 2) - .write.format("json").saveAsTable("t") - withView("t1") { - withTempView("t2") { - sql("CREATE VIEW t1 AS SELECT * FROM t WHERE key > 1") - - sql("CACHE TABLE t1") - sql("CACHE TABLE t2 AS SELECT * FROM t1 WHERE value > 1") + test("SPARK-24596, SPARK-34052: cascading cache invalidation - drop temporary view") { + Seq(true, false).foreach { storeAnalyzed => + withSQLConf(SQLConf.STORE_ANALYZED_PLAN_FOR_VIEW.key -> storeAnalyzed.toString) { + withTempView("t1", "t2") { + sql("CACHE TABLE t1 AS SELECT * FROM testData WHERE key > 1") + sql("CACHE TABLE t2 as SELECT * FROM t1 WHERE value > 1") assert(spark.catalog.isCached("t1")) assert(spark.catalog.isCached("t2")) + + val oldView = spark.table("t2") sql("DROP VIEW t1") - assert(!spark.catalog.isCached("t2")) + + // dropping a temp view trigger cache invalidation on dependents iff the config is + // turned off + assert(storeAnalyzed == + spark.sharedState.cacheManager.lookupCachedData(oldView).isDefined) + if (!storeAnalyzed) { + // t2 should become invalid after t1 is dropped + val e = intercept[AnalysisException](spark.catalog.isCached("t2")) + assert(e.message.contains(s"Table or view not found")) + } + } + } + } + } + + test("SPARK-24596, SPARK-34052: cascading cache invalidation - drop persistent view") { + Seq(true, false).foreach { storeAnalyzed => + withSQLConf(SQLConf.STORE_ANALYZED_PLAN_FOR_VIEW.key -> storeAnalyzed.toString) { + withTable("t") { + spark.range(1, 10).toDF("key").withColumn("value", $"key" * 2) + .write.format("json").saveAsTable("t") + withView("t1") { + withTempView("t2") { + sql("CREATE VIEW t1 AS SELECT * FROM t WHERE key > 1") + + sql("CACHE TABLE t1") + sql("CACHE TABLE t2 AS SELECT * FROM t1 WHERE value > 1") + + assert(spark.catalog.isCached("t1")) + assert(spark.catalog.isCached("t2")) + + val oldView = spark.table("t2") + sql("DROP VIEW t1") + + // dropping a permanent view always trigger cache invalidation on dependents + assert(spark.sharedState.cacheManager.lookupCachedData(oldView).isEmpty) + if (!storeAnalyzed) { + // t2 should become invalid after t1 is dropped + val e = intercept[AnalysisException](spark.catalog.isCached("t2")) + assert(e.message.contains(s"Table or view not found")) + } + } + } } } } @@ -1131,7 +1176,7 @@ class CachedTableSuite extends QueryTest with SQLTestUtils } test("cache supports for intervals") { - withTable("interval_cache") { + withTable("interval_cache", "t1") { Seq((1, "1 second"), (2, "2 seconds"), (2, null)) .toDF("k", "v").write.saveAsTable("interval_cache") sql("CACHE TABLE t1 AS SELECT k, cast(v as interval) FROM interval_cache") @@ -1143,6 +1188,20 @@ class CachedTableSuite extends QueryTest with SQLTestUtils } } + test("SPARK-35243: cache supports for YearMonthIntervalType and DayTimeIntervalType") { + withTempView("ymi_dti_interval_cache") { + Seq((1, Period.ofYears(1), Duration.ofDays(1)), + (2, Period.ofYears(2), Duration.ofDays(2))) + .toDF("k", "v1", "v2").createTempView("ymi_dti_interval_cache") + sql("CACHE TABLE tmp AS SELECT k, v1, v2 FROM ymi_dti_interval_cache") + assert(spark.catalog.isCached("tmp")) + checkAnswer(sql("SELECT * FROM tmp WHERE k = 1"), + Row(1, Period.ofYears(1), Duration.ofDays(1))) + sql("UNCACHE TABLE tmp") + assert(!spark.catalog.isCached("tmp")) + } + } + test("SPARK-30494 Fix the leak of cached data when replace an existing view") { withTempView("tempView") { spark.catalog.clearCache() @@ -1184,4 +1243,391 @@ class CachedTableSuite extends QueryTest with SQLTestUtils assert(spark.sharedState.cacheManager.isEmpty) } } + + test("SPARK-33228: Don't uncache data when replacing an existing view having the same plan") { + withTempView("tempView") { + spark.catalog.clearCache() + val df = spark.range(1).selectExpr("id a", "id b") + df.cache() + assert(spark.sharedState.cacheManager.lookupCachedData(df).isDefined) + df.createOrReplaceTempView("tempView") + assert(spark.sharedState.cacheManager.lookupCachedData(df).isDefined) + df.createOrReplaceTempView("tempView") + assert(spark.sharedState.cacheManager.lookupCachedData(df).isDefined) + } + + withTempView("tempGlobalTempView") { + spark.catalog.clearCache() + val df = spark.range(1).selectExpr("id a", "id b") + df.cache() + assert(spark.sharedState.cacheManager.lookupCachedData(df).isDefined) + df.createOrReplaceGlobalTempView("tempGlobalTempView") + assert(spark.sharedState.cacheManager.lookupCachedData(df).isDefined) + df.createOrReplaceGlobalTempView("tempGlobalTempView") + assert(spark.sharedState.cacheManager.lookupCachedData(df).isDefined) + } + } + + test("SPARK-33290: REFRESH TABLE should invalidate all caches referencing the table") { + withTable("t") { + withTempPath { path => + withTempView("tempView1", "tempView2") { + Seq((1 -> "a")).toDF("i", "j").write.parquet(path.getCanonicalPath) + sql(s"CREATE TABLE t USING parquet LOCATION '${path.toURI}'") + sql("CREATE TEMPORARY VIEW tempView1 AS SELECT * FROM t") + sql("CACHE TABLE tempView2 AS SELECT i FROM tempView1") + checkAnswer(sql("SELECT * FROM tempView1"), Seq(Row(1, "a"))) + checkAnswer(sql("SELECT * FROM tempView2"), Seq(Row(1))) + + Utils.deleteRecursively(path) + sql("REFRESH TABLE tempView1") + checkAnswer(sql("SELECT * FROM tempView1"), Seq.empty) + checkAnswer(sql("SELECT * FROM tempView2"), Seq.empty) + } + } + } + } + + test("SPARK-33729: REFRESH TABLE should not use cached/stale plan") { + def moveParquetFiles(src: File, dst: File): Unit = { + src.listFiles(new FilenameFilter { + override def accept(dir: File, name: String): Boolean = name.endsWith("parquet") + }).foreach { f => + Files.move(f.toPath, Paths.get(dst.getAbsolutePath, f.getName)) + } + // cleanup the rest of the files + src.listFiles().foreach(_.delete()) + src.delete() + } + + withTable("t") { + withTempDir { dir => + val path1 = new File(dir, "path1") + Seq((1 -> "a")).toDF("i", "j").write.parquet(path1.getCanonicalPath) + moveParquetFiles(path1, dir) + sql(s"CREATE TABLE t (i INT, j STRING) USING parquet LOCATION '${dir.toURI}'") + sql("CACHE TABLE t") + checkAnswer(sql("SELECT * FROM t"), Row(1, "a") :: Nil) + + val path2 = new File(dir, "path2") + Seq(2 -> "b").toDF("i", "j").write.parquet(path2.getCanonicalPath) + moveParquetFiles(path2, dir) + sql("REFRESH TABLE t") + checkAnswer(sql("SELECT * FROM t"), Row(1, "a") :: Row(2, "b") :: Nil) + } + } + } + + test("SPARK-33647: cache table support for permanent view") { + withView("v1") { + spark.catalog.clearCache() + sql("create or replace view v1 as select 1") + sql("cache table v1") + assert(spark.sharedState.cacheManager.lookupCachedData(sql("select 1")).isDefined) + sql("create or replace view v1 as select 1, 2") + assert(spark.sharedState.cacheManager.lookupCachedData(sql("select 1")).isEmpty) + sql("cache table v1") + assert(spark.sharedState.cacheManager.lookupCachedData(sql("select 1, 2")).isDefined) + } + } + + test("SPARK-34269: cache lookup with ORDER BY / LIMIT clause") { + Seq("ORDER BY key", "LIMIT 10").foreach { clause => + withTable("t") { + withTempView("v1") { + sql("CREATE TABLE t (key bigint, value string) USING parquet") + sql(s"CACHE TABLE v1 AS SELECT * FROM t $clause") + + val query = sql(s"SELECT * FROM t $clause") + assert(spark.sharedState.cacheManager.lookupCachedData(query).isDefined) + } + } + } + } + + test("SPARK-34027: refresh cache in partitions recovering") { + withTable("t") { + sql("CREATE TABLE t (id int, part int) USING parquet PARTITIONED BY (part)") + sql("INSERT INTO t PARTITION (part=0) SELECT 0") + assert(!spark.catalog.isCached("t")) + sql("CACHE TABLE t") + assert(spark.catalog.isCached("t")) + checkAnswer(sql("SELECT * FROM t"), Seq(Row(0, 0))) + + // Create new partition (part = 1) in the filesystem + val information = sql("SHOW TABLE EXTENDED LIKE 't' PARTITION (part = 0)") + .select("information") + .first().getString(0) + val part0Loc = information + .split("\\r?\\n") + .filter(_.startsWith("Location:")) + .head + .replace("Location: file:", "") + FileUtils.copyDirectory( + new File(part0Loc), + new File(part0Loc.replace("part=0", "part=1"))) + + sql("ALTER TABLE t RECOVER PARTITIONS") + assert(spark.catalog.isCached("t")) + checkAnswer(sql("SELECT * FROM t"), Seq(Row(0, 0), Row(0, 1))) + } + } + + test("SPARK-34052: cascading cache invalidation - CatalogImpl.dropTempView") { + Seq(true, false).foreach { storeAnalyzed => + withSQLConf(SQLConf.STORE_ANALYZED_PLAN_FOR_VIEW.key -> storeAnalyzed.toString) { + withTempView("view1", "view2") { + sql("CREATE TEMPORARY VIEW view1 AS SELECT * FROM testData WHERE key > 1") + sql("CACHE TABLE view2 AS SELECT * FROM view1 WHERE value > 1") + assert(spark.catalog.isCached("view2")) + + val oldView = spark.table("view2") + spark.catalog.dropTempView("view1") + assert(storeAnalyzed == + spark.sharedState.cacheManager.lookupCachedData(oldView).isDefined) + } + } + } + } + + test("SPARK-34052: cascading cache invalidation - CatalogImpl.dropGlobalTempView") { + Seq(true, false).foreach { storeAnalyzed => + withSQLConf(SQLConf.STORE_ANALYZED_PLAN_FOR_VIEW.key -> storeAnalyzed.toString) { + withGlobalTempView("view1") { + withTempView("view2") { + val db = spark.sharedState.globalTempViewManager.database + sql("CREATE GLOBAL TEMPORARY VIEW view1 AS SELECT * FROM testData WHERE key > 1") + sql(s"CACHE TABLE view2 AS SELECT * FROM ${db}.view1 WHERE value > 1") + assert(spark.catalog.isCached("view2")) + + val oldView = spark.table("view2") + spark.catalog.dropGlobalTempView("view1") + assert(storeAnalyzed == + spark.sharedState.cacheManager.lookupCachedData(oldView).isDefined) + } + } + } + } + } + + test("SPARK-34052: cached temp view should become invalid after the source table is dropped") { + val t = "t" + withTable(t) { + sql(s"CREATE TABLE $t USING parquet AS SELECT * FROM VALUES(1, 'a') AS $t(a, b)") + sql(s"CACHE TABLE v AS SELECT a FROM $t") + checkAnswer(sql("SELECT * FROM v"), Row(1) :: Nil) + sql(s"DROP TABLE $t") + val e = intercept[AnalysisException](sql("SELECT * FROM v")) + assert(e.message.contains(s"Table or view not found: $t")) + } + } + + test("SPARK-34347: cascading cache invalidation - SQLContext.uncacheTable") { + Seq(true, false).foreach { storeAnalyzed => + withSQLConf(SQLConf.STORE_ANALYZED_PLAN_FOR_VIEW.key -> storeAnalyzed.toString) { + withTempView("view1", "view2") { + sql("CREATE TEMPORARY VIEW view1 AS SELECT * FROM testData WHERE key > 1") + sql("CACHE TABLE view2 AS SELECT * FROM view1 WHERE value > 1") + assert(spark.catalog.isCached("view2")) + + val oldView = spark.table("view2") + spark.sqlContext.uncacheTable("view1") + assert(storeAnalyzed == + spark.sharedState.cacheManager.lookupCachedData(oldView).isDefined, + s"when storeAnalyzed = $storeAnalyzed") + } + } + } + } + + test("SPARK-34347: cascading cache invalidation - SQLContext.uncacheTable (global temp view)") { + Seq(true, false).foreach { storeAnalyzed => + withSQLConf(SQLConf.STORE_ANALYZED_PLAN_FOR_VIEW.key -> storeAnalyzed.toString) { + withGlobalTempView("view1") { + withTempView("view2") { + val db = spark.sharedState.globalTempViewManager.database + sql("CREATE GLOBAL TEMPORARY VIEW view1 AS SELECT * FROM testData WHERE key > 1") + sql(s"CACHE TABLE view2 AS SELECT * FROM $db.view1 WHERE value > 1") + assert(spark.catalog.isCached("view2")) + + val oldView = spark.table("view2") + spark.sqlContext.uncacheTable(s"$db.view1") + assert(storeAnalyzed == + spark.sharedState.cacheManager.lookupCachedData(oldView).isDefined, + s"when storeAnalyzed = $storeAnalyzed") + } + } + } + } + } + + test("SPARK-34546: ALTER VIEW AS should uncache if a temp view is cached") { + Seq(true, false).foreach { storeAnalyzed => + withSQLConf(SQLConf.STORE_ANALYZED_PLAN_FOR_VIEW.key -> storeAnalyzed.toString) { + withTempView("tv") { + testAlterTemporaryViewAsWithCache(TableIdentifier("tv"), storeAnalyzed) + } + } + } + } + + test("SPARK-34546: ALTER VIEW AS should uncache if a global temp view is cached") { + Seq(true, false).foreach { storeAnalyzed => + withSQLConf(SQLConf.STORE_ANALYZED_PLAN_FOR_VIEW.key -> storeAnalyzed.toString) { + withGlobalTempView("global_tv") { + val db = spark.sharedState.globalTempViewManager.database + testAlterTemporaryViewAsWithCache(TableIdentifier("global_tv", Some(db)), storeAnalyzed) + } + } + } + } + + private def testAlterTemporaryViewAsWithCache( + ident: TableIdentifier, + storeAnalyzed: Boolean): Unit = { + val (tempViewStr, viewName) = if (ident.database.nonEmpty) { + ("GLOBAL TEMPORARY", s"${ident.database.get}.${ident.table}") + } else { + ("TEMPORARY", ident.table) + } + + sql(s"CREATE $tempViewStr VIEW ${ident.table} AS SELECT 1") + + sql(s"CACHE TABLE $viewName") + assert(spark.catalog.isCached(viewName)) + assert(spark.sharedState.cacheManager.lookupCachedData(sql("SELECT 1")).nonEmpty) + + if (storeAnalyzed) { + // Altered temporary view will have the same plan, thus it will not be uncached. + // Note that this check is done only if a temporary view stores an analyzed view. + sql(s"ALTER VIEW $viewName as SELECT 1") + assert(spark.catalog.isCached(viewName)) + assert(spark.sharedState.cacheManager.lookupCachedData(sql("SELECT 1")).nonEmpty) + } + + sql(s"ALTER VIEW $viewName as SELECT 2") + assert(!spark.catalog.isCached(viewName)) + assert(spark.sharedState.cacheManager.lookupCachedData(sql("SELECT 1")).isEmpty) + } + + test("SPARK-34546: ALTER VIEW AS should uncache if a permanent view is cached") { + withView("view") { + sql("CREATE VIEW view AS SELECT 1") + sql("CACHE TABLE view") + assert(spark.catalog.isCached("view")) + assert(spark.sharedState.cacheManager.lookupCachedData(sql("SELECT 1")).nonEmpty) + + // ALTER VIEW AS on a permanent view should uncache even if the replacing view produces + // the same result. + sql("ALTER VIEW view as SELECT 1") + assert(!spark.catalog.isCached("view")) + assert(spark.sharedState.cacheManager.lookupCachedData(sql("SELECT 1")).isEmpty) + } + } + + test("SPARK-34699: CREATE TEMP VIEW USING should uncache correctly") { + withTempView("tv") { + testCreateTemporaryViewUsingWithCache(TableIdentifier("tv")) + } + } + + test("SPARK-34699: CREATE GLOBAL TEMP VIEW USING should uncache correctly") { + withGlobalTempView("global_tv") { + val db = spark.sharedState.globalTempViewManager.database + testCreateTemporaryViewUsingWithCache(TableIdentifier("global_tv", Some(db))) + } + } + + private def testCreateTemporaryViewUsingWithCache(ident: TableIdentifier): Unit = { + withTempDir { dir => + val path1 = new File(dir, "t1").getCanonicalPath + val path2 = new File(dir, "t2").getCanonicalPath + Seq(1).toDF.write.parquet(path1) + Seq(1).toDF.write.parquet(path2) + + val (tempViewStr, viewName) = if (ident.database.nonEmpty) { + ("GLOBAL TEMPORARY VIEW", s"${ident.database.get}.${ident.table}") + } else { + ("TEMPORARY VIEW", ident.table) + } + + sql(s"CREATE $tempViewStr ${ident.table} USING parquet OPTIONS (path '$path1')") + + sql(s"CACHE TABLE $viewName") + assert(spark.catalog.isCached(viewName)) + + // Replacing with the same relation. The cache shouldn't be uncached. + sql(s"CREATE OR REPLACE $tempViewStr ${ident.table} USING parquet OPTIONS (path '$path1')") + assert(spark.catalog.isCached(viewName)) + + // Replacing with a different relation. The cache should be cleared. + sql(s"CREATE OR REPLACE $tempViewStr ${ident.table} USING parquet OPTIONS (path '$path2')") + assert(!spark.catalog.isCached(viewName)) + + // Validate that the cache is cleared by creating a temp view with the same relation. + sql(s"CREATE OR REPLACE $tempViewStr ${ident.table} USING parquet OPTIONS (path '$path1')") + assert(!spark.catalog.isCached(viewName)) + } + } + + test("SPARK-35332: Make cache plan disable configs configurable - check AQE") { + withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "2", + SQLConf.COALESCE_PARTITIONS_MIN_PARTITION_NUM.key -> "1", + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") { + + withTempView("t1", "t2", "t3") { + withSQLConf(SQLConf.CAN_CHANGE_CACHED_PLAN_OUTPUT_PARTITIONING.key -> "false") { + sql("CACHE TABLE t1 as SELECT /*+ REPARTITION */ * FROM values(1) as t(c)") + assert(spark.table("t1").rdd.partitions.length == 2) + } + + withSQLConf(SQLConf.CAN_CHANGE_CACHED_PLAN_OUTPUT_PARTITIONING.key -> "true") { + assert(spark.table("t1").rdd.partitions.length == 2) + sql("CACHE TABLE t2 as SELECT /*+ REPARTITION */ * FROM values(2) as t(c)") + assert(spark.table("t2").rdd.partitions.length == 1) + } + + withSQLConf(SQLConf.CAN_CHANGE_CACHED_PLAN_OUTPUT_PARTITIONING.key -> "false") { + assert(spark.table("t1").rdd.partitions.length == 2) + assert(spark.table("t2").rdd.partitions.length == 1) + sql("CACHE TABLE t3 as SELECT /*+ REPARTITION */ * FROM values(3) as t(c)") + assert(spark.table("t3").rdd.partitions.length == 2) + } + } + } + } + + test("SPARK-35332: Make cache plan disable configs configurable - check bucket scan") { + withTable("t1", "t2", "t3") { + Seq(1, 2, 3).foreach { i => + spark.range(1, 2) + .write + .format("parquet") + .bucketBy(2, "id") + .saveAsTable(s"t$i") + } + + withCache("t1", "t2", "t3") { + withSQLConf(SQLConf.BUCKETING_ENABLED.key -> "true", + SQLConf.FILES_MIN_PARTITION_NUM.key -> "1", + SQLConf.CAN_CHANGE_CACHED_PLAN_OUTPUT_PARTITIONING.key -> "false") { + sql("CACHE TABLE t1") + assert(spark.table("t1").rdd.partitions.length == 2) + + withSQLConf(SQLConf.CAN_CHANGE_CACHED_PLAN_OUTPUT_PARTITIONING.key -> "true") { + assert(spark.table("t1").rdd.partitions.length == 2) + sql("CACHE TABLE t2") + assert(spark.table("t2").rdd.partitions.length == 1) + } + + withSQLConf(SQLConf.CAN_CHANGE_CACHED_PLAN_OUTPUT_PARTITIONING.key -> "false") { + assert(spark.table("t1").rdd.partitions.length == 2) + assert(spark.table("t2").rdd.partitions.length == 1) + sql("CACHE TABLE t3") + assert(spark.table("t3").rdd.partitions.length == 2) + } + } + } + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala new file mode 100644 index 0000000000000..c06544ee00621 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/CharVarcharTestSuite.scala @@ -0,0 +1,876 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import org.apache.spark.{SparkConf, SparkException} +import org.apache.spark.sql.catalyst.parser.CatalystSqlParser +import org.apache.spark.sql.catalyst.util.CharVarcharUtils +import org.apache.spark.sql.connector.SchemaRequiredDataSource +import org.apache.spark.sql.connector.catalog.InMemoryPartitionTableCatalog +import org.apache.spark.sql.execution.datasources.LogicalRelation +import org.apache.spark.sql.execution.datasources.v2.DataSourceV2Relation +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.sources.SimpleInsertSource +import org.apache.spark.sql.test.{SharedSparkSession, SQLTestUtils} +import org.apache.spark.sql.types._ + +// The base trait for char/varchar tests that need to be run with different table implementations. +trait CharVarcharTestSuite extends QueryTest with SQLTestUtils { + + def format: String + + def checkColType(f: StructField, dt: DataType): Unit = { + assert(f.dataType == CharVarcharUtils.replaceCharVarcharWithString(dt)) + assert(CharVarcharUtils.getRawType(f.metadata) == Some(dt)) + } + + def checkPlainResult(df: DataFrame, dt: String, insertVal: String): Unit = { + val dataType = CatalystSqlParser.parseDataType(dt) + checkColType(df.schema(1), dataType) + dataType match { + case CharType(len) => + // char value will be padded if (<= len) or trimmed if (> len) + val fixLenStr = if (insertVal != null) { + insertVal.take(len).padTo(len, " ").mkString + } else null + checkAnswer(df, Row("1", fixLenStr)) + case VarcharType(len) => + // varchar value will be remained if (<= len) or trimmed if (> len) + val varLenStrWithUpperBound = if (insertVal != null) { + insertVal.take(len) + } else null + checkAnswer(df, Row("1", varLenStrWithUpperBound)) + } + } + + test("apply char padding/trimming and varchar trimming: top-level columns") { + Seq("CHAR(5)", "VARCHAR(5)").foreach { typ => + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c $typ) USING $format") + (0 to 5).map(n => "a" + " " * n).foreach { v => + sql(s"INSERT OVERWRITE t VALUES ('1', '$v')") + checkPlainResult(spark.table("t"), typ, v) + } + sql("INSERT OVERWRITE t VALUES ('1', null)") + checkPlainResult(spark.table("t"), typ, null) + } + } + } + + test("char type values should be padded or trimmed: partitioned columns") { + // via dynamic partitioned columns + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c CHAR(5)) USING $format PARTITIONED BY (c)") + (0 to 5).map(n => "a" + " " * n).foreach { v => + sql(s"INSERT OVERWRITE t VALUES ('1', '$v')") + checkPlainResult(spark.table("t"), "CHAR(5)", v) + } + } + + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c CHAR(5)) USING $format PARTITIONED BY (c)") + (0 to 5).map(n => "a" + " " * n).foreach { v => + // via dynamic partitioned columns with drop partition command + sql(s"INSERT INTO t VALUES ('1', '$v')") + checkPlainResult(spark.table("t"), "CHAR(5)", v) + sql(s"ALTER TABLE t DROP PARTITION(c='a')") + checkAnswer(spark.table("t"), Nil) + + // via static partitioned columns with drop partition command + sql(s"INSERT INTO t PARTITION (c ='$v') VALUES ('1')") + checkPlainResult(spark.table("t"), "CHAR(5)", v) + sql(s"ALTER TABLE t DROP PARTITION(c='a')") + checkAnswer(spark.table("t"), Nil) + } + } + } + + test("varchar type values length check and trim: partitioned columns") { + (0 to 5).foreach { n => + // SPARK-34192: we need to create a a new table for each round of test because of + // trailing spaces in partition column will be treated differently. + // This is because Mysql and Derby(used in tests) considers 'a' = 'a ' + // whereas others like (Postgres, Oracle) doesn't exhibit this problem. + // see more at: + // https://issues.apache.org/jira/browse/HIVE-13618 + // https://issues.apache.org/jira/browse/SPARK-34192 + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c VARCHAR(5)) USING $format PARTITIONED BY (c)") + val v = "a" + " " * n + // via dynamic partitioned columns + sql(s"INSERT INTO t VALUES ('1', '$v')") + checkPlainResult(spark.table("t"), "VARCHAR(5)", v) + sql(s"ALTER TABLE t DROP PARTITION(c='$v')") + checkAnswer(spark.table("t"), Nil) + + // via static partitioned columns + sql(s"INSERT INTO t PARTITION (c='$v') VALUES ('1')") + checkPlainResult(spark.table("t"), "VARCHAR(5)", v) + sql(s"ALTER TABLE t DROP PARTITION(c='$v')") + checkAnswer(spark.table("t"), Nil) + } + } + } + + test("oversize char/varchar values for alter table partition operations") { + Seq("CHAR(5)", "VARCHAR(5)").foreach { typ => + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c $typ) USING $format PARTITIONED BY (c)") + Seq("ADD", "DROP").foreach { op => + val e = intercept[RuntimeException](sql(s"ALTER TABLE t $op PARTITION(c='abcdef')")) + assert(e.getMessage.contains("Exceeds char/varchar type length limitation: 5")) + } + val e1 = intercept[RuntimeException] { + sql(s"ALTER TABLE t PARTITION (c='abcdef') RENAME TO PARTITION (c='2')") + } + assert(e1.getMessage.contains("Exceeds char/varchar type length limitation: 5")) + val e2 = intercept[RuntimeException] { + sql(s"ALTER TABLE t PARTITION (c='1') RENAME TO PARTITION (c='abcdef')") + } + assert(e2.getMessage.contains("Exceeds char/varchar type length limitation: 5")) + } + } + } + + test("SPARK-34233: char/varchar with null value for partitioned columns") { + Seq("CHAR(5)", "VARCHAR(5)").foreach { typ => + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c $typ) USING $format PARTITIONED BY (c)") + sql("INSERT INTO t VALUES ('1', null)") + checkPlainResult(spark.table("t"), typ, null) + sql("INSERT OVERWRITE t VALUES ('1', null)") + checkPlainResult(spark.table("t"), typ, null) + sql("INSERT OVERWRITE t PARTITION (c=null) VALUES ('1')") + checkPlainResult(spark.table("t"), typ, null) + sql("ALTER TABLE t DROP PARTITION(c=null)") + checkAnswer(spark.table("t"), Nil) + } + } + } + + test("char/varchar type values length check: partitioned columns of other types") { + Seq("CHAR(5)", "VARCHAR(5)").foreach { typ => + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c $typ) USING $format PARTITIONED BY (c)") + Seq(1, 10, 100, 1000, 10000).foreach { v => + sql(s"INSERT OVERWRITE t VALUES ('1', $v)") + checkPlainResult(spark.table("t"), typ, v.toString) + sql(s"ALTER TABLE t DROP PARTITION(c=$v)") + checkAnswer(spark.table("t"), Nil) + } + + val e1 = intercept[SparkException](sql(s"INSERT OVERWRITE t VALUES ('1', 100000)")) + assert(e1.getCause.getMessage.contains("Exceeds char/varchar type length limitation: 5")) + + val e2 = intercept[RuntimeException](sql("ALTER TABLE t DROP PARTITION(c=100000)")) + assert(e2.getMessage.contains("Exceeds char/varchar type length limitation: 5")) + } + } + } + + test("char type values should be padded: nested in struct") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c STRUCT) USING $format") + sql("INSERT INTO t VALUES ('1', struct('a'))") + checkAnswer(spark.table("t"), Row("1", Row("a" + " " * 4))) + checkColType(spark.table("t").schema(1), new StructType().add("c", CharType(5))) + + sql("INSERT OVERWRITE t VALUES ('1', null)") + checkAnswer(spark.table("t"), Row("1", null)) + sql("INSERT OVERWRITE t VALUES ('1', struct(null))") + checkAnswer(spark.table("t"), Row("1", Row(null))) + } + } + + test("char type values should be padded: nested in array") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c ARRAY) USING $format") + sql("INSERT INTO t VALUES ('1', array('a', 'ab'))") + checkAnswer(spark.table("t"), Row("1", Seq("a" + " " * 4, "ab" + " " * 3))) + checkColType(spark.table("t").schema(1), ArrayType(CharType(5))) + + sql("INSERT OVERWRITE t VALUES ('1', null)") + checkAnswer(spark.table("t"), Row("1", null)) + sql("INSERT OVERWRITE t VALUES ('1', array(null))") + checkAnswer(spark.table("t"), Row("1", Seq(null))) + } + } + + test("char type values should be padded: nested in map key") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c MAP) USING $format") + sql("INSERT INTO t VALUES ('1', map('a', 'ab'))") + checkAnswer(spark.table("t"), Row("1", Map(("a" + " " * 4, "ab")))) + checkColType(spark.table("t").schema(1), MapType(CharType(5), StringType)) + + sql("INSERT OVERWRITE t VALUES ('1', null)") + checkAnswer(spark.table("t"), Row("1", null)) + } + } + + test("char type values should be padded: nested in map value") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c MAP) USING $format") + sql("INSERT INTO t VALUES ('1', map('a', 'ab'))") + checkAnswer(spark.table("t"), Row("1", Map(("a", "ab" + " " * 3)))) + checkColType(spark.table("t").schema(1), MapType(StringType, CharType(5))) + + sql("INSERT OVERWRITE t VALUES ('1', null)") + checkAnswer(spark.table("t"), Row("1", null)) + sql("INSERT OVERWRITE t VALUES ('1', map('a', null))") + checkAnswer(spark.table("t"), Row("1", Map("a" -> null))) + } + } + + test("char type values should be padded: nested in both map key and value") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c MAP) USING $format") + sql("INSERT INTO t VALUES ('1', map('a', 'ab'))") + checkAnswer(spark.table("t"), Row("1", Map(("a" + " " * 4, "ab" + " " * 8)))) + checkColType(spark.table("t").schema(1), MapType(CharType(5), CharType(10))) + + sql("INSERT OVERWRITE t VALUES ('1', null)") + checkAnswer(spark.table("t"), Row("1", null)) + } + } + + test("char type values should be padded: nested in struct of array") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c STRUCT>) USING $format") + sql("INSERT INTO t VALUES ('1', struct(array('a', 'ab')))") + checkAnswer(spark.table("t"), Row("1", Row(Seq("a" + " " * 4, "ab" + " " * 3)))) + checkColType(spark.table("t").schema(1), + new StructType().add("c", ArrayType(CharType(5)))) + + sql("INSERT OVERWRITE t VALUES ('1', null)") + checkAnswer(spark.table("t"), Row("1", null)) + sql("INSERT OVERWRITE t VALUES ('1', struct(null))") + checkAnswer(spark.table("t"), Row("1", Row(null))) + sql("INSERT OVERWRITE t VALUES ('1', struct(array(null)))") + checkAnswer(spark.table("t"), Row("1", Row(Seq(null)))) + } + } + + test("char type values should be padded: nested in array of struct") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c ARRAY>) USING $format") + sql("INSERT INTO t VALUES ('1', array(struct('a'), struct('ab')))") + checkAnswer(spark.table("t"), Row("1", Seq(Row("a" + " " * 4), Row("ab" + " " * 3)))) + checkColType(spark.table("t").schema(1), + ArrayType(new StructType().add("c", CharType(5)))) + + sql("INSERT OVERWRITE t VALUES ('1', null)") + checkAnswer(spark.table("t"), Row("1", null)) + sql("INSERT OVERWRITE t VALUES ('1', array(null))") + checkAnswer(spark.table("t"), Row("1", Seq(null))) + sql("INSERT OVERWRITE t VALUES ('1', array(struct(null)))") + checkAnswer(spark.table("t"), Row("1", Seq(Row(null)))) + } + } + + test("char type values should be padded: nested in array of array") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c ARRAY>) USING $format") + sql("INSERT INTO t VALUES ('1', array(array('a', 'ab')))") + checkAnswer(spark.table("t"), Row("1", Seq(Seq("a" + " " * 4, "ab" + " " * 3)))) + checkColType(spark.table("t").schema(1), ArrayType(ArrayType(CharType(5)))) + + sql("INSERT OVERWRITE t VALUES ('1', null)") + checkAnswer(spark.table("t"), Row("1", null)) + sql("INSERT OVERWRITE t VALUES ('1', array(null))") + checkAnswer(spark.table("t"), Row("1", Seq(null))) + sql("INSERT OVERWRITE t VALUES ('1', array(array(null)))") + checkAnswer(spark.table("t"), Row("1", Seq(Seq(null)))) + } + } + + private def testTableWrite(f: String => Unit): Unit = { + withTable("t") { f("char") } + withTable("t") { f("varchar") } + } + + test("length check for input string values: top-level columns") { + testTableWrite { typeName => + sql(s"CREATE TABLE t(c $typeName(5)) USING $format") + sql("INSERT INTO t VALUES (null)") + checkAnswer(spark.table("t"), Row(null)) + val e = intercept[SparkException](sql("INSERT INTO t VALUES ('123456')")) + assert(e.getCause.getMessage.contains(s"Exceeds char/varchar type length limitation: 5")) + } + } + + test("length check for input string values: partitioned columns") { + // DS V2 doesn't support partitioned table. + if (!conf.contains(SQLConf.DEFAULT_CATALOG.key)) { + testTableWrite { typeName => + sql(s"CREATE TABLE t(i INT, c $typeName(5)) USING $format PARTITIONED BY (c)") + sql("INSERT INTO t VALUES (1, null)") + checkAnswer(spark.table("t"), Row(1, null)) + val e = intercept[SparkException](sql("INSERT INTO t VALUES (1, '123456')")) + assert(e.getCause.getMessage.contains(s"Exceeds char/varchar type length limitation: 5")) + } + } + } + + test("length check for input string values: nested in struct") { + testTableWrite { typeName => + sql(s"CREATE TABLE t(c STRUCT) USING $format") + sql("INSERT INTO t SELECT struct(null)") + checkAnswer(spark.table("t"), Row(Row(null))) + val e = intercept[SparkException](sql("INSERT INTO t SELECT struct('123456')")) + assert(e.getCause.getMessage.contains(s"Exceeds char/varchar type length limitation: 5")) + } + } + + test("length check for input string values: nested in array") { + testTableWrite { typeName => + sql(s"CREATE TABLE t(c ARRAY<$typeName(5)>) USING $format") + sql("INSERT INTO t VALUES (array(null))") + checkAnswer(spark.table("t"), Row(Seq(null))) + val e = intercept[SparkException](sql("INSERT INTO t VALUES (array('a', '123456'))")) + assert(e.getCause.getMessage.contains(s"Exceeds char/varchar type length limitation: 5")) + } + } + + test("length check for input string values: nested in map key") { + testTableWrite { typeName => + sql(s"CREATE TABLE t(c MAP<$typeName(5), STRING>) USING $format") + val e = intercept[SparkException](sql("INSERT INTO t VALUES (map('123456', 'a'))")) + assert(e.getCause.getMessage.contains(s"Exceeds char/varchar type length limitation: 5")) + } + } + + test("length check for input string values: nested in map value") { + testTableWrite { typeName => + sql(s"CREATE TABLE t(c MAP) USING $format") + sql("INSERT INTO t VALUES (map('a', null))") + checkAnswer(spark.table("t"), Row(Map("a" -> null))) + val e = intercept[SparkException](sql("INSERT INTO t VALUES (map('a', '123456'))")) + assert(e.getCause.getMessage.contains(s"Exceeds char/varchar type length limitation: 5")) + } + } + + test("length check for input string values: nested in both map key and value") { + testTableWrite { typeName => + sql(s"CREATE TABLE t(c MAP<$typeName(5), $typeName(5)>) USING $format") + val e1 = intercept[SparkException](sql("INSERT INTO t VALUES (map('123456', 'a'))")) + assert(e1.getCause.getMessage.contains(s"Exceeds char/varchar type length limitation: 5")) + val e2 = intercept[SparkException](sql("INSERT INTO t VALUES (map('a', '123456'))")) + assert(e2.getCause.getMessage.contains(s"Exceeds char/varchar type length limitation: 5")) + } + } + + test("length check for input string values: nested in struct of array") { + testTableWrite { typeName => + sql(s"CREATE TABLE t(c STRUCT>) USING $format") + sql("INSERT INTO t SELECT struct(array(null))") + checkAnswer(spark.table("t"), Row(Row(Seq(null)))) + val e = intercept[SparkException](sql("INSERT INTO t SELECT struct(array('123456'))")) + assert(e.getCause.getMessage.contains(s"Exceeds char/varchar type length limitation: 5")) + } + } + + test("length check for input string values: nested in array of struct") { + testTableWrite { typeName => + sql(s"CREATE TABLE t(c ARRAY>) USING $format") + sql("INSERT INTO t VALUES (array(struct(null)))") + checkAnswer(spark.table("t"), Row(Seq(Row(null)))) + val e = intercept[SparkException](sql("INSERT INTO t VALUES (array(struct('123456')))")) + assert(e.getCause.getMessage.contains(s"Exceeds char/varchar type length limitation: 5")) + } + } + + test("length check for input string values: nested in array of array") { + testTableWrite { typeName => + sql(s"CREATE TABLE t(c ARRAY>) USING $format") + sql("INSERT INTO t VALUES (array(array(null)))") + checkAnswer(spark.table("t"), Row(Seq(Seq(null)))) + val e = intercept[SparkException](sql("INSERT INTO t VALUES (array(array('123456')))")) + assert(e.getCause.getMessage.contains(s"Exceeds char/varchar type length limitation: 5")) + } + } + + test("length check for input string values: with trailing spaces") { + withTable("t") { + sql(s"CREATE TABLE t(c1 CHAR(5), c2 VARCHAR(5)) USING $format") + sql("INSERT INTO t VALUES ('12 ', '12 ')") + sql("INSERT INTO t VALUES ('1234 ', '1234 ')") + checkAnswer(spark.table("t"), Seq( + Row("12" + " " * 3, "12 "), + Row("1234 ", "1234 "))) + } + } + + test("length check for input string values: with implicit cast") { + withTable("t") { + sql(s"CREATE TABLE t(c1 CHAR(5), c2 VARCHAR(5)) USING $format") + sql("INSERT INTO t VALUES (1234, 1234)") + checkAnswer(spark.table("t"), Row("1234 ", "1234")) + val e1 = intercept[SparkException](sql("INSERT INTO t VALUES (123456, 1)")) + assert(e1.getCause.getMessage.contains("Exceeds char/varchar type length limitation: 5")) + val e2 = intercept[SparkException](sql("INSERT INTO t VALUES (1, 123456)")) + assert(e2.getCause.getMessage.contains("Exceeds char/varchar type length limitation: 5")) + } + } + + private def testConditions(df: DataFrame, conditions: Seq[(String, Boolean)]): Unit = { + checkAnswer(df.selectExpr(conditions.map(_._1): _*), Row.fromSeq(conditions.map(_._2))) + } + + test("char type comparison: top-level columns") { + withTable("t") { + sql(s"CREATE TABLE t(c1 CHAR(2), c2 CHAR(5)) USING $format") + sql("INSERT INTO t VALUES ('a', 'a')") + testConditions(spark.table("t"), Seq( + ("c1 = 'a'", true), + ("'a' = c1", true), + ("c1 = 'a '", true), + ("c1 > 'a'", false), + ("c1 IN ('a', 'b')", true), + ("c1 = c2", true), + ("c1 < c2", false), + ("c1 IN (c2)", true), + ("c1 <=> null", false))) + } + } + + test("char type comparison: partitioned columns") { + withTable("t") { + sql(s"CREATE TABLE t(i INT, c1 CHAR(2), c2 CHAR(5)) USING $format PARTITIONED BY (c1, c2)") + sql("INSERT INTO t VALUES (1, 'a', 'a')") + testConditions(spark.table("t"), Seq( + ("c1 = 'a'", true), + ("'a' = c1", true), + ("c1 = 'a '", true), + ("c1 > 'a'", false), + ("c1 IN ('a', 'b')", true), + ("c1 = c2", true), + ("c1 < c2", false), + ("c1 IN (c2)", true), + ("c1 <=> null", false))) + } + } + + private def testNullConditions(df: DataFrame, conditions: Seq[String]): Unit = { + conditions.foreach { cond => + checkAnswer(df.selectExpr(cond), Row(null)) + } + } + + test("SPARK-34233: char type comparison with null values") { + val conditions = Seq("c = null", "c IN ('e', null)", "c IN (null)") + withTable("t") { + sql(s"CREATE TABLE t(c CHAR(2)) USING $format") + sql("INSERT INTO t VALUES ('a')") + testNullConditions(spark.table("t"), conditions) + } + + withTable("t") { + sql(s"CREATE TABLE t(i INT, c CHAR(2)) USING $format PARTITIONED BY (c)") + sql("INSERT INTO t VALUES (1, 'a')") + testNullConditions(spark.table("t"), conditions) + } + } + + test("char type comparison: partition pruning") { + withTable("t") { + sql(s"CREATE TABLE t(i INT, c1 CHAR(2), c2 VARCHAR(5)) USING $format PARTITIONED BY (c1, c2)") + sql("INSERT INTO t VALUES (1, 'a', 'a')") + Seq(("c1 = 'a'", true), + ("'a' = c1", true), + ("c1 = 'a '", true), + ("c1 > 'a'", false), + ("c1 IN ('a', 'b')", true), + ("c2 = 'a '", false), + ("c2 = 'a'", true), + ("c2 IN ('a', 'b')", true)).foreach { case (con, res) => + val df = spark.table("t") + withClue(con) { + checkAnswer(df.where(con), df.where(res.toString)) + } + } + } + } + + test("char type comparison: join") { + withTable("t1", "t2") { + sql(s"CREATE TABLE t1(c CHAR(2)) USING $format") + sql(s"CREATE TABLE t2(c CHAR(5)) USING $format") + sql("INSERT INTO t1 VALUES ('a')") + sql("INSERT INTO t2 VALUES ('a')") + checkAnswer(sql("SELECT t1.c FROM t1 JOIN t2 ON t1.c = t2.c"), Row("a ")) + } + } + + test("char type comparison: nested in struct") { + withTable("t") { + sql(s"CREATE TABLE t(c1 STRUCT, c2 STRUCT) USING $format") + sql("INSERT INTO t VALUES (struct('a'), struct('a'))") + testConditions(spark.table("t"), Seq( + ("c1 = c2", true), + ("c1 < c2", false), + ("c1 IN (c2)", true))) + } + } + + test("char type comparison: nested in array") { + withTable("t") { + sql(s"CREATE TABLE t(c1 ARRAY, c2 ARRAY) USING $format") + sql("INSERT INTO t VALUES (array('a', 'b'), array('a', 'b'))") + testConditions(spark.table("t"), Seq( + ("c1 = c2", true), + ("c1 < c2", false), + ("c1 IN (c2)", true))) + } + } + + test("char type comparison: nested in struct of array") { + withTable("t") { + sql("CREATE TABLE t(c1 STRUCT>, c2 STRUCT>) " + + s"USING $format") + sql("INSERT INTO t VALUES (struct(array('a', 'b')), struct(array('a', 'b')))") + testConditions(spark.table("t"), Seq( + ("c1 = c2", true), + ("c1 < c2", false), + ("c1 IN (c2)", true))) + } + } + + test("char type comparison: nested in array of struct") { + withTable("t") { + sql("CREATE TABLE t(c1 ARRAY>, c2 ARRAY>) " + + s"USING $format") + sql("INSERT INTO t VALUES (array(struct('a')), array(struct('a')))") + testConditions(spark.table("t"), Seq( + ("c1 = c2", true), + ("c1 < c2", false), + ("c1 IN (c2)", true))) + } + } + + test("char type comparison: nested in array of array") { + withTable("t") { + sql("CREATE TABLE t(c1 ARRAY>, c2 ARRAY>) " + + s"USING $format") + sql("INSERT INTO t VALUES (array(array('a')), array(array('a')))") + testConditions(spark.table("t"), Seq( + ("c1 = c2", true), + ("c1 < c2", false), + ("c1 IN (c2)", true))) + } + } + + test("SPARK-33892: DESCRIBE TABLE w/ char/varchar") { + withTable("t") { + sql(s"CREATE TABLE t(v VARCHAR(3), c CHAR(5)) USING $format") + checkAnswer(sql("desc t").selectExpr("data_type").where("data_type like '%char%'"), + Seq(Row("char(5)"), Row("varchar(3)"))) + } + } + + test("SPARK-34003: fix char/varchar fails w/ both group by and order by ") { + withTable("t") { + sql(s"CREATE TABLE t(v VARCHAR(3), i INT) USING $format") + sql("INSERT INTO t VALUES ('c', 1)") + checkAnswer(sql("SELECT v, sum(i) FROM t GROUP BY v ORDER BY v"), Row("c", 1)) + } + } + + test("SPARK-34003: fix char/varchar fails w/ order by functions") { + withTable("t") { + sql(s"CREATE TABLE t(v VARCHAR(3), i INT) USING $format") + sql("INSERT INTO t VALUES ('c', 1)") + checkAnswer(sql("SELECT substr(v, 1, 2), sum(i) FROM t GROUP BY v ORDER BY substr(v, 1, 2)"), + Row("c", 1)) + checkAnswer(sql("SELECT sum(i) FROM t GROUP BY v ORDER BY substr(v, 1, 2)"), + Row(1)) + } + } + + test("SPARK-34114: varchar type will strip tailing spaces to certain length at write time") { + withTable("t") { + sql(s"CREATE TABLE t(v VARCHAR(3)) USING $format") + sql("INSERT INTO t VALUES ('c ')") + checkAnswer(spark.table("t"), Row("c ")) + } + } + + test("SPARK-34114: varchar type will remain the value length with spaces at read time") { + withTable("t") { + sql(s"CREATE TABLE t(v VARCHAR(3)) USING $format") + sql("INSERT INTO t VALUES ('c ')") + checkAnswer(spark.table("t"), Row("c ")) + } + } + + test("SPARK-34833: right-padding applied correctly for correlated subqueries - join keys") { + withTable("t1", "t2") { + sql(s"CREATE TABLE t1(v VARCHAR(3), c CHAR(5)) USING $format") + sql(s"CREATE TABLE t2(v VARCHAR(5), c CHAR(8)) USING $format") + sql("INSERT INTO t1 VALUES ('c', 'b')") + sql("INSERT INTO t2 VALUES ('a', 'b')") + Seq("t1.c = t2.c", "t2.c = t1.c", + "t1.c = 'b'", "'b' = t1.c", "t1.c = 'b '", "'b ' = t1.c", + "t1.c = 'b '", "'b ' = t1.c").foreach { predicate => + checkAnswer(sql( + s""" + |SELECT v FROM t1 + |WHERE 'a' IN (SELECT v FROM t2 WHERE $predicate) + """.stripMargin), + Row("c")) + } + } + } + + test("SPARK-34833: right-padding applied correctly for correlated subqueries - other preds") { + withTable("t") { + sql(s"CREATE TABLE t(c0 INT, c1 CHAR(5), c2 CHAR(7)) USING $format") + sql("INSERT INTO t VALUES (1, 'abc', 'abc')") + Seq("c1 = 'abc'", "'abc' = c1", "c1 = 'abc '", "'abc ' = c1", + "c1 = 'abc '", "'abc ' = c1", "c1 = c2", "c2 = c1", + "c1 IN ('xxx', 'abc', 'xxxxx')", "c1 IN ('xxx', 'abc ', 'xxxxx')", + "c1 IN ('xxx', 'abc ', 'xxxxx')", + "c1 IN (c2)", "c2 IN (c1)").foreach { predicate => + checkAnswer(sql( + s""" + |SELECT c0 FROM t t1 + |WHERE ( + | SELECT count(*) AS c + | FROM t + | WHERE c0 = t1.c0 AND $predicate + |) > 0 + """.stripMargin), + Row(1)) + } + } + } +} + +// Some basic char/varchar tests which doesn't rely on table implementation. +class BasicCharVarcharTestSuite extends QueryTest with SharedSparkSession { + import testImplicits._ + + test("user-specified schema in cast") { + def assertNoCharType(df: DataFrame): Unit = { + checkAnswer(df, Row("0")) + assert(df.schema.map(_.dataType) == Seq(StringType)) + } + + val logAppender = new LogAppender("The Spark cast operator does not support char/varchar" + + " type and simply treats them as string type. Please use string type directly to avoid" + + " confusion.") + withLogAppender(logAppender) { + assertNoCharType(spark.range(1).select($"id".cast("char(5)"))) + assertNoCharType(spark.range(1).select($"id".cast(CharType(5)))) + assertNoCharType(spark.range(1).selectExpr("CAST(id AS CHAR(5))")) + assertNoCharType(sql("SELECT CAST(id AS CHAR(5)) FROM range(1)")) + } + } + + def failWithInvalidCharUsage[T](fn: => T): Unit = { + val e = intercept[AnalysisException](fn) + assert(e.getMessage contains "char/varchar type can only be used in the table schema") + } + + test("invalidate char/varchar in functions") { + failWithInvalidCharUsage(sql("""SELECT from_json('{"a": "str"}', 'a CHAR(5)')""")) + withSQLConf((SQLConf.LEGACY_CHAR_VARCHAR_AS_STRING.key, "true")) { + val df = sql("""SELECT from_json('{"a": "str"}', 'a CHAR(5)')""") + checkAnswer(df, Row(Row("str"))) + val schema = df.schema.head.dataType.asInstanceOf[StructType] + assert(schema.map(_.dataType) == Seq(StringType)) + } + } + + test("invalidate char/varchar in SparkSession createDataframe") { + val df = spark.range(10).map(_.toString).toDF() + val schema = new StructType().add("id", CharType(5)) + failWithInvalidCharUsage(spark.createDataFrame(df.collectAsList(), schema)) + failWithInvalidCharUsage(spark.createDataFrame(df.rdd, schema)) + failWithInvalidCharUsage(spark.createDataFrame(df.toJavaRDD, schema)) + withSQLConf((SQLConf.LEGACY_CHAR_VARCHAR_AS_STRING.key, "true")) { + val df1 = spark.createDataFrame(df.collectAsList(), schema) + checkAnswer(df1, df) + assert(df1.schema.head.dataType === StringType) + } + } + + test("invalidate char/varchar in spark.read.schema") { + failWithInvalidCharUsage(spark.read.schema(new StructType().add("id", CharType(5)))) + failWithInvalidCharUsage(spark.read.schema("id char(5)")) + withSQLConf((SQLConf.LEGACY_CHAR_VARCHAR_AS_STRING.key, "true")) { + val ds = spark.range(10).map(_.toString) + val df1 = spark.read.schema(new StructType().add("id", CharType(5))).csv(ds) + assert(df1.schema.map(_.dataType) == Seq(StringType)) + val df2 = spark.read.schema("id char(5)").csv(ds) + assert(df2.schema.map(_.dataType) == Seq(StringType)) + + def checkSchema(df: DataFrame): Unit = { + val schemas = df.queryExecution.analyzed.collect { + case l: LogicalRelation => l.relation.schema + case d: DataSourceV2Relation => d.table.schema() + } + assert(schemas.length == 1) + assert(schemas.head.map(_.dataType) == Seq(StringType)) + } + + // user-specified schema in DataFrameReader: DSV1 + checkSchema(spark.read.schema(new StructType().add("id", CharType(5))) + .format(classOf[SimpleInsertSource].getName).load()) + checkSchema(spark.read.schema("id char(5)") + .format(classOf[SimpleInsertSource].getName).load()) + + // user-specified schema in DataFrameReader: DSV2 + checkSchema(spark.read.schema(new StructType().add("id", CharType(5))) + .format(classOf[SchemaRequiredDataSource].getName).load()) + checkSchema(spark.read.schema("id char(5)") + .format(classOf[SchemaRequiredDataSource].getName).load()) + } + } + + test("invalidate char/varchar in udf's result type") { + failWithInvalidCharUsage(spark.udf.register("testchar", () => "B", VarcharType(1))) + failWithInvalidCharUsage(spark.udf.register("testchar2", (x: String) => x, VarcharType(1))) + withSQLConf((SQLConf.LEGACY_CHAR_VARCHAR_AS_STRING.key, "true")) { + spark.udf.register("testchar", () => "B", VarcharType(1)) + spark.udf.register("testchar2", (x: String) => x, VarcharType(1)) + val df1 = spark.sql("select testchar()") + checkAnswer(df1, Row("B")) + assert(df1.schema.head.dataType === StringType) + val df2 = spark.sql("select testchar2('abc')") + checkAnswer(df2, Row("abc")) + assert(df2.schema.head.dataType === StringType) + } + } + + test("invalidate char/varchar in spark.readStream.schema") { + failWithInvalidCharUsage(spark.readStream.schema(new StructType().add("id", CharType(5)))) + failWithInvalidCharUsage(spark.readStream.schema("id char(5)")) + withSQLConf((SQLConf.LEGACY_CHAR_VARCHAR_AS_STRING.key, "true")) { + withTempPath { dir => + spark.range(2).write.save(dir.toString) + val df1 = spark.readStream.schema(new StructType().add("id", CharType(5))) + .load(dir.toString) + assert(df1.schema.map(_.dataType) == Seq(StringType)) + val df2 = spark.readStream.schema("id char(5)").load(dir.toString) + assert(df2.schema.map(_.dataType) == Seq(StringType)) + } + } + } +} + +class FileSourceCharVarcharTestSuite extends CharVarcharTestSuite with SharedSparkSession { + override def format: String = "parquet" + override protected def sparkConf: SparkConf = { + super.sparkConf.set(SQLConf.USE_V1_SOURCE_LIST, "parquet") + } + + test("create table w/ location and fit length values") { + Seq("char", "varchar").foreach { typ => + withTempPath { dir => + withTable("t") { + sql("SELECT '12' as col").write.format(format).save(dir.toString) + sql(s"CREATE TABLE t (col $typ(2)) using $format LOCATION '$dir'") + val df = sql("select * from t") + checkAnswer(sql("select * from t"), Row("12")) + } + } + } + } + + test("create table w/ location and over length values") { + Seq("char", "varchar").foreach { typ => + withTempPath { dir => + withTable("t") { + sql("SELECT '123456' as col").write.format(format).save(dir.toString) + sql(s"CREATE TABLE t (col $typ(2)) using $format LOCATION '$dir'") + checkAnswer(sql("select * from t"), Row("123456")) + } + } + } + } + + test("alter table set location w/ fit length values") { + Seq("char", "varchar").foreach { typ => + withTempPath { dir => + withTable("t") { + sql("SELECT '12' as col").write.format(format).save(dir.toString) + sql(s"CREATE TABLE t (col $typ(2)) using $format") + sql(s"ALTER TABLE t SET LOCATION '$dir'") + checkAnswer(spark.table("t"), Row("12")) + } + } + } + } + + test("alter table set location w/ over length values") { + Seq("char", "varchar").foreach { typ => + withTempPath { dir => + withTable("t") { + sql("SELECT '123456' as col").write.format(format).save(dir.toString) + sql(s"CREATE TABLE t (col $typ(2)) using $format") + sql(s"ALTER TABLE t SET LOCATION '$dir'") + checkAnswer(spark.table("t"), Row("123456")) + } + } + } + } + + // TODO(SPARK-33875): Move these tests to super after DESCRIBE COLUMN v2 implemented + test("SPARK-33892: DESCRIBE COLUMN w/ char/varchar") { + withTable("t") { + sql(s"CREATE TABLE t(v VARCHAR(3), c CHAR(5)) USING $format") + checkAnswer(sql("desc t v").selectExpr("info_value").where("info_value like '%char%'"), + Row("varchar(3)")) + checkAnswer(sql("desc t c").selectExpr("info_value").where("info_value like '%char%'"), + Row("char(5)")) + } + } + + // TODO(SPARK-33898): Move these tests to super after SHOW CREATE TABLE for v2 implemented + test("SPARK-33892: SHOW CREATE TABLE w/ char/varchar") { + withTable("t") { + sql(s"CREATE TABLE t(v VARCHAR(3), c CHAR(5)) USING $format") + val rest = sql("SHOW CREATE TABLE t").head().getString(0) + assert(rest.contains("VARCHAR(3)")) + assert(rest.contains("CHAR(5)")) + } + } + + test("SPARK-34114: should not trim right for read-side length check and char padding") { + Seq("char", "varchar").foreach { typ => + withTempPath { dir => + withTable("t") { + sql("SELECT '12 ' as col").write.format(format).save(dir.toString) + sql(s"CREATE TABLE t (col $typ(2)) using $format LOCATION '$dir'") + checkAnswer(spark.table("t"), Row("12 ")) + } + } + } + } +} + +class DSV2CharVarcharTestSuite extends CharVarcharTestSuite + with SharedSparkSession { + override def format: String = "foo" + protected override def sparkConf = { + super.sparkConf + .set("spark.sql.catalog.testcat", classOf[InMemoryPartitionTableCatalog].getName) + .set(SQLConf.DEFAULT_CATALOG.key, "testcat") + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/ColumnExpressionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/ColumnExpressionSuite.scala index fa06484a73d95..ad5d73c774274 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/ColumnExpressionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/ColumnExpressionSuite.scala @@ -18,15 +18,19 @@ package org.apache.spark.sql import java.sql.{Date, Timestamp} +import java.time.{Duration, Instant, LocalDate, LocalDateTime, Period} +import java.time.temporal.ChronoUnit import java.util.Locale -import scala.collection.JavaConverters._ - import org.apache.hadoop.io.{LongWritable, Text} import org.apache.hadoop.mapreduce.lib.input.{TextInputFormat => NewTextInputFormat} -import org.scalatest.Matchers._ +import org.scalatest.matchers.should.Matchers._ +import org.apache.spark.SparkException +import org.apache.spark.sql.UpdateFieldsBenchmark._ import org.apache.spark.sql.catalyst.expressions.{InSet, Literal, NamedExpression} +import org.apache.spark.sql.catalyst.util.DateTimeTestUtils.{outstandingTimezonesIds, outstandingZoneIds} +import org.apache.spark.sql.catalyst.util.DateTimeUtils import org.apache.spark.sql.execution.ProjectExec import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf @@ -155,6 +159,28 @@ class ColumnExpressionSuite extends QueryTest with SharedSparkSession { checkAnswer(testData.as("testData").select($"testData.*"), testData.collect().toSeq) } + test("SPARK-34199: star can be qualified by table name inside a non-count function") { + checkAnswer( + testData.as("testData").selectExpr("hash(testData.*)"), + testData.as("testData").selectExpr("hash(testData.key, testData.value)") + ) + } + + test("SPARK-34199: star cannot be qualified by table name inside a count function") { + val e = intercept[AnalysisException] { + testData.as("testData").selectExpr("count(testData.*)").collect() + } + assert(e.getMessage.contains( + "count(testData.*) is not allowed. Please use count(*) or expand the columns manually")) + } + + test("SPARK-34199: table star can be qualified inside a count function with multiple arguments") { + checkAnswer( + testData.as("testData").selectExpr("count(testData.*, testData.key)"), + testData.as("testData").selectExpr("count(testData.key, testData.value, testData.key)") + ) + } + test("+") { checkAnswer( testData2.select($"a" + 1), @@ -923,4 +949,1933 @@ class ColumnExpressionSuite extends QueryTest with SharedSparkSession { val inSet = InSet(Literal("a"), Set("a", "b").map(UTF8String.fromString)) assert(inSet.sql === "('a' IN ('a', 'b'))") } + + def checkAnswer( + df: => DataFrame, + expectedAnswer: Seq[Row], + expectedSchema: StructType): Unit = { + checkAnswer(df, expectedAnswer) + assert(df.schema == expectedSchema) + } + + private lazy val structType = StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false))) + + private lazy val structLevel1: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(Row(1, null, 3)) :: Nil), + StructType(Seq(StructField("a", structType, nullable = false)))) + + private lazy val nullableStructLevel1: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(null) :: Row(Row(1, null, 3)) :: Nil), + StructType(Seq(StructField("a", structType, nullable = true)))) + + private lazy val structLevel2: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(Row(Row(1, null, 3))) :: Nil), + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", structType, nullable = false))), + nullable = false)))) + + private lazy val nullableStructLevel2: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(null) :: Row(Row(null)) :: Row(Row(Row(1, null, 3))) :: Nil), + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", structType, nullable = true))), + nullable = true)))) + + private lazy val structLevel3: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(Row(Row(Row(1, null, 3)))) :: Nil), + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", structType, nullable = false))), + nullable = false))), + nullable = false)))) + + test("withField should throw an exception if called on a non-StructType column") { + intercept[AnalysisException] { + testData.withColumn("key", $"key".withField("a", lit(2))) + }.getMessage should include("struct argument should be struct type, got: int") + } + + test("withField should throw an exception if either fieldName or col argument are null") { + intercept[IllegalArgumentException] { + structLevel1.withColumn("a", $"a".withField(null, lit(2))) + }.getMessage should include("fieldName cannot be null") + + intercept[IllegalArgumentException] { + structLevel1.withColumn("a", $"a".withField("b", null)) + }.getMessage should include("col cannot be null") + + intercept[IllegalArgumentException] { + structLevel1.withColumn("a", $"a".withField(null, null)) + }.getMessage should include("fieldName cannot be null") + } + + test("withField should throw an exception if any intermediate structs don't exist") { + intercept[AnalysisException] { + structLevel2.withColumn("a", 'a.withField("x.b", lit(2))) + }.getMessage should include("No such struct field x in a") + + intercept[AnalysisException] { + structLevel3.withColumn("a", 'a.withField("a.x.b", lit(2))) + }.getMessage should include("No such struct field x in a") + } + + test("withField should throw an exception if intermediate field is not a struct") { + intercept[AnalysisException] { + structLevel1.withColumn("a", 'a.withField("b.a", lit(2))) + }.getMessage should include("struct argument should be struct type, got: int") + } + + test("withField should throw an exception if intermediate field reference is ambiguous") { + intercept[AnalysisException] { + val structLevel2: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(Row(Row(1, null, 3), 4)) :: Nil), + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", structType, nullable = false), + StructField("a", structType, nullable = false))), + nullable = false)))) + + structLevel2.withColumn("a", 'a.withField("a.b", lit(2))) + }.getMessage should include("Ambiguous reference to fields") + } + + test("withField should add field with no name") { + checkAnswer( + structLevel1.withColumn("a", $"a".withField("", lit(4))), + Row(Row(1, null, 3, 4)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("", IntegerType, nullable = false))), + nullable = false)))) + } + + test("withField should add field to struct") { + checkAnswer( + structLevel1.withColumn("a", 'a.withField("d", lit(4))), + Row(Row(1, null, 3, 4)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("d", IntegerType, nullable = false))), + nullable = false)))) + } + + test("withField should add field to nullable struct") { + checkAnswer( + nullableStructLevel1.withColumn("a", $"a".withField("d", lit(4))), + Row(null) :: Row(Row(1, null, 3, 4)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("d", IntegerType, nullable = false))), + nullable = true)))) + } + + test("withField should add field to nested nullable struct") { + checkAnswer( + nullableStructLevel2.withColumn("a", $"a".withField("a.d", lit(4))), + Row(null) :: Row(Row(null)) :: Row(Row(Row(1, null, 3, 4))) :: Nil, + StructType( + Seq(StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("d", IntegerType, nullable = false))), + nullable = true))), + nullable = true)))) + } + + test("withField should add null field to struct") { + checkAnswer( + structLevel1.withColumn("a", 'a.withField("d", lit(null).cast(IntegerType))), + Row(Row(1, null, 3, null)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("d", IntegerType, nullable = true))), + nullable = false)))) + } + + test("withField should add multiple fields to struct") { + checkAnswer( + structLevel1.withColumn("a", 'a.withField("d", lit(4)).withField("e", lit(5))), + Row(Row(1, null, 3, 4, 5)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("d", IntegerType, nullable = false), + StructField("e", IntegerType, nullable = false))), + nullable = false)))) + } + + test("withField should add multiple fields to nullable struct") { + checkAnswer( + nullableStructLevel1.withColumn("a", 'a.withField("d", lit(4)).withField("e", lit(5))), + Row(null) :: Row(Row(1, null, 3, 4, 5)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("d", IntegerType, nullable = false), + StructField("e", IntegerType, nullable = false))), + nullable = true)))) + } + + test("withField should add field to nested struct") { + Seq( + structLevel2.withColumn("a", 'a.withField("a.d", lit(4))), + structLevel2.withColumn("a", 'a.withField("a", $"a.a".withField("d", lit(4)))) + ).foreach { df => + checkAnswer( + df, + Row(Row(Row(1, null, 3, 4))) :: Nil, + StructType( + Seq(StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("d", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + } + } + + test("withField should add multiple fields to nested struct") { + Seq( + col("a").withField("a", $"a.a".withField("d", lit(4)).withField("e", lit(5))), + col("a").withField("a.d", lit(4)).withField("a.e", lit(5)) + ).foreach { column => + checkAnswer( + structLevel2.select(column.as("a")), + Row(Row(Row(1, null, 3, 4, 5))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("d", IntegerType, nullable = false), + StructField("e", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + } + } + + test("withField should add multiple fields to nested nullable struct") { + Seq( + col("a").withField("a", $"a.a".withField("d", lit(4)).withField("e", lit(5))), + col("a").withField("a.d", lit(4)).withField("a.e", lit(5)) + ).foreach { column => + checkAnswer( + nullableStructLevel2.select(column.as("a")), + Row(null) :: Row(Row(null)) :: Row(Row(Row(1, null, 3, 4, 5))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("d", IntegerType, nullable = false), + StructField("e", IntegerType, nullable = false))), + nullable = true))), + nullable = true)))) + } + } + + test("withField should add field to deeply nested struct") { + checkAnswer( + structLevel3.withColumn("a", 'a.withField("a.a.d", lit(4))), + Row(Row(Row(Row(1, null, 3, 4)))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("d", IntegerType, nullable = false))), + nullable = false))), + nullable = false))), + nullable = false)))) + } + + test("withField should replace field in struct") { + checkAnswer( + structLevel1.withColumn("a", 'a.withField("b", lit(2))), + Row(Row(1, 2, 3)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = false)))) + } + + test("withField should replace field in nullable struct") { + checkAnswer( + nullableStructLevel1.withColumn("a", 'a.withField("b", lit("foo"))), + Row(null) :: Row(Row(1, "foo", 3)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", StringType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = true)))) + } + + test("withField should replace field in nested nullable struct") { + checkAnswer( + nullableStructLevel2.withColumn("a", $"a".withField("a.b", lit("foo"))), + Row(null) :: Row(Row(null)) :: Row(Row(Row(1, "foo", 3))) :: Nil, + StructType( + Seq(StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", StringType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = true))), + nullable = true)))) + } + + test("withField should replace field with null value in struct") { + checkAnswer( + structLevel1.withColumn("a", 'a.withField("c", lit(null).cast(IntegerType))), + Row(Row(1, null, null)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = true))), + nullable = false)))) + } + + test("withField should replace multiple fields in struct") { + checkAnswer( + structLevel1.withColumn("a", 'a.withField("a", lit(10)).withField("b", lit(20))), + Row(Row(10, 20, 3)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = false)))) + } + + test("withField should replace multiple fields in nullable struct") { + checkAnswer( + nullableStructLevel1.withColumn("a", 'a.withField("a", lit(10)).withField("b", lit(20))), + Row(null) :: Row(Row(10, 20, 3)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = true)))) + } + + test("withField should replace field in nested struct") { + Seq( + structLevel2.withColumn("a", $"a".withField("a.b", lit(2))), + structLevel2.withColumn("a", 'a.withField("a", $"a.a".withField("b", lit(2)))) + ).foreach { df => + checkAnswer( + df, + Row(Row(Row(1, 2, 3))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + } + } + + test("withField should replace multiple fields in nested struct") { + Seq( + col("a").withField("a", $"a.a".withField("a", lit(10)).withField("b", lit(20))), + col("a").withField("a.a", lit(10)).withField("a.b", lit(20)) + ).foreach { column => + checkAnswer( + structLevel2.select(column.as("a")), + Row(Row(Row(10, 20, 3))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + } + } + + test("withField should replace multiple fields in nested nullable struct") { + Seq( + col("a").withField("a", $"a.a".withField("a", lit(10)).withField("b", lit(20))), + col("a").withField("a.a", lit(10)).withField("a.b", lit(20)) + ).foreach { column => + checkAnswer( + nullableStructLevel2.select(column.as("a")), + Row(null) :: Row(Row(null)) :: Row(Row(Row(10, 20, 3))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = true))), + nullable = true)))) + } + } + + test("withField should replace field in deeply nested struct") { + checkAnswer( + structLevel3.withColumn("a", $"a".withField("a.a.b", lit(2))), + Row(Row(Row(Row(1, 2, 3)))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = false))), + nullable = false))), + nullable = false)))) + } + + test("withField should replace all fields with given name in struct") { + val structLevel1 = spark.createDataFrame( + sparkContext.parallelize(Row(Row(1, 2, 3)) :: Nil), + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false)))) + + checkAnswer( + structLevel1.withColumn("a", 'a.withField("b", lit(100))), + Row(Row(1, 100, 100)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false)))) + } + + test("withField should replace fields in struct in given order") { + checkAnswer( + structLevel1.withColumn("a", 'a.withField("b", lit(2)).withField("b", lit(20))), + Row(Row(1, 20, 3)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = false)))) + } + + test("withField should add field and then replace same field in struct") { + checkAnswer( + structLevel1.withColumn("a", 'a.withField("d", lit(4)).withField("d", lit(5))), + Row(Row(1, null, 3, 5)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("d", IntegerType, nullable = false))), + nullable = false)))) + } + + test("withField should handle fields with dots in their name if correctly quoted") { + val df: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(Row(Row(1, null, 3))) :: Nil), + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a.b", StructType(Seq( + StructField("c.d", IntegerType, nullable = false), + StructField("e.f", IntegerType, nullable = true), + StructField("g.h", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + + checkAnswer( + df.withColumn("a", 'a.withField("`a.b`.`e.f`", lit(2))), + Row(Row(Row(1, 2, 3))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a.b", StructType(Seq( + StructField("c.d", IntegerType, nullable = false), + StructField("e.f", IntegerType, nullable = false), + StructField("g.h", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + + intercept[AnalysisException] { + df.withColumn("a", 'a.withField("a.b.e.f", lit(2))) + }.getMessage should include("No such struct field a in a.b") + } + + private lazy val mixedCaseStructLevel1: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(Row(1, 1)) :: Nil), + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("B", IntegerType, nullable = false))), + nullable = false)))) + + test("withField should replace field in struct even if casing is different") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + checkAnswer( + mixedCaseStructLevel1.withColumn("a", 'a.withField("A", lit(2))), + Row(Row(2, 1)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("A", IntegerType, nullable = false), + StructField("B", IntegerType, nullable = false))), + nullable = false)))) + + checkAnswer( + mixedCaseStructLevel1.withColumn("a", 'a.withField("b", lit(2))), + Row(Row(1, 2)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false)))) + } + } + + test("withField should add field to struct because casing is different") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + checkAnswer( + mixedCaseStructLevel1.withColumn("a", 'a.withField("A", lit(2))), + Row(Row(1, 1, 2)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("B", IntegerType, nullable = false), + StructField("A", IntegerType, nullable = false))), + nullable = false)))) + + checkAnswer( + mixedCaseStructLevel1.withColumn("a", 'a.withField("b", lit(2))), + Row(Row(1, 1, 2)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("B", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false)))) + } + } + + private lazy val mixedCaseStructLevel2: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(Row(Row(1, 1), Row(1, 1))) :: Nil), + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false), + StructField("B", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + + test("withField should replace nested field in struct even if casing is different") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + checkAnswer( + mixedCaseStructLevel2.withColumn("a", 'a.withField("A.a", lit(2))), + Row(Row(Row(2, 1), Row(1, 1))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("A", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false), + StructField("B", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + + checkAnswer( + mixedCaseStructLevel2.withColumn("a", 'a.withField("b.a", lit(2))), + Row(Row(Row(1, 1), Row(2, 1))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false), + StructField("b", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + } + } + + test("withField should throw an exception because casing is different") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + intercept[AnalysisException] { + mixedCaseStructLevel2.withColumn("a", 'a.withField("A.a", lit(2))) + }.getMessage should include("No such struct field A in a, B") + + intercept[AnalysisException] { + mixedCaseStructLevel2.withColumn("a", 'a.withField("b.a", lit(2))) + }.getMessage should include("No such struct field b in a, B") + } + } + + test("withField user-facing examples") { + checkAnswer( + sql("SELECT named_struct('a', 1, 'b', 2) struct_col") + .select($"struct_col".withField("c", lit(3))), + Row(Row(1, 2, 3))) + + checkAnswer( + sql("SELECT named_struct('a', 1, 'b', 2) struct_col") + .select($"struct_col".withField("b", lit(3))), + Row(Row(1, 3))) + + checkAnswer( + sql("SELECT CAST(NULL AS struct) struct_col") + .select($"struct_col".withField("c", lit(3))), + Row(null)) + + checkAnswer( + sql("SELECT named_struct('a', 1, 'b', 2, 'b', 3) struct_col") + .select($"struct_col".withField("b", lit(100))), + Row(Row(1, 100, 100))) + + checkAnswer( + sql("SELECT named_struct('a', named_struct('a', 1, 'b', 2)) struct_col") + .select($"struct_col".withField("a.c", lit(3))), + Row(Row(Row(1, 2, 3)))) + + intercept[AnalysisException] { + sql("SELECT named_struct('a', named_struct('b', 1), 'a', named_struct('c', 2)) struct_col") + .select($"struct_col".withField("a.c", lit(3))) + }.getMessage should include("Ambiguous reference to fields") + + checkAnswer( + sql("SELECT named_struct('a', named_struct('a', 1, 'b', 2)) struct_col") + .select($"struct_col".withField("a.c", lit(3)).withField("a.d", lit(4))), + Row(Row(Row(1, 2, 3, 4)))) + + checkAnswer( + sql("SELECT named_struct('a', named_struct('a', 1, 'b', 2)) struct_col") + .select($"struct_col".withField("a", + $"struct_col.a".withField("c", lit(3)).withField("d", lit(4)))), + Row(Row(Row(1, 2, 3, 4)))) + } + + test("SPARK-32641: extracting field from non-null struct column after withField should return " + + "field value") { + // extract newly added field + checkAnswer( + structLevel1.withColumn("a", $"a".withField("d", lit(4)).getField("d")), + Row(4) :: Nil, + StructType(Seq(StructField("a", IntegerType, nullable = false)))) + + // extract newly replaced field + checkAnswer( + structLevel1.withColumn("a", $"a".withField("a", lit(4)).getField("a")), + Row(4) :: Nil, + StructType(Seq(StructField("a", IntegerType, nullable = false)))) + + // add new field, extract another field from original struct + checkAnswer( + structLevel1.withColumn("a", $"a".withField("d", lit(4)).getField("c")), + Row(3):: Nil, + StructType(Seq(StructField("a", IntegerType, nullable = false)))) + + // replace field, extract another field from original struct + checkAnswer( + structLevel1.withColumn("a", $"a".withField("a", lit(4)).getField("c")), + Row(3):: Nil, + StructType(Seq(StructField("a", IntegerType, nullable = false)))) + } + + test("SPARK-32641: extracting field from null struct column after withField should return " + + "null if the original struct was null") { + val nullStructLevel1 = spark.createDataFrame( + sparkContext.parallelize(Row(null) :: Nil), + StructType(Seq(StructField("a", structType, nullable = true)))) + + // extract newly added field + checkAnswer( + nullStructLevel1.withColumn("a", $"a".withField("d", lit(4)).getField("d")), + Row(null) :: Nil, + StructType(Seq(StructField("a", IntegerType, nullable = true)))) + + // extract newly replaced field + checkAnswer( + nullStructLevel1.withColumn("a", $"a".withField("a", lit(4)).getField("a")), + Row(null):: Nil, + StructType(Seq(StructField("a", IntegerType, nullable = true)))) + + // add new field, extract another field from original struct + checkAnswer( + nullStructLevel1.withColumn("a", $"a".withField("d", lit(4)).getField("c")), + Row(null):: Nil, + StructType(Seq(StructField("a", IntegerType, nullable = true)))) + + // replace field, extract another field from original struct + checkAnswer( + nullStructLevel1.withColumn("a", $"a".withField("a", lit(4)).getField("c")), + Row(null):: Nil, + StructType(Seq(StructField("a", IntegerType, nullable = true)))) + } + + test("SPARK-32641: extracting field from nullable struct column which contains both null and " + + "non-null values after withField should return null if the original struct was null") { + val df = spark.createDataFrame( + sparkContext.parallelize(Row(Row(1, null, 3)) :: Row(null) :: Nil), + StructType(Seq(StructField("a", structType, nullable = true)))) + + // extract newly added field + checkAnswer( + df.withColumn("a", $"a".withField("d", lit(4)).getField("d")), + Row(4) :: Row(null) :: Nil, + StructType(Seq(StructField("a", IntegerType, nullable = true)))) + + // extract newly replaced field + checkAnswer( + df.withColumn("a", $"a".withField("a", lit(4)).getField("a")), + Row(4) :: Row(null):: Nil, + StructType(Seq(StructField("a", IntegerType, nullable = true)))) + + // add new field, extract another field from original struct + checkAnswer( + df.withColumn("a", $"a".withField("d", lit(4)).getField("c")), + Row(3) :: Row(null):: Nil, + StructType(Seq(StructField("a", IntegerType, nullable = true)))) + + // replace field, extract another field from original struct + checkAnswer( + df.withColumn("a", $"a".withField("a", lit(4)).getField("c")), + Row(3) :: Row(null):: Nil, + StructType(Seq(StructField("a", IntegerType, nullable = true)))) + } + + test("SPARK-35213: chained withField operations should have correct schema for new columns") { + val df = spark.createDataFrame( + sparkContext.parallelize(Row(null) :: Nil), + StructType(Seq(StructField("data", NullType)))) + + checkAnswer( + df.withColumn("data", struct() + .withField("a", struct()) + .withField("b", struct()) + .withField("a.aa", lit("aa1")) + .withField("b.ba", lit("ba1")) + .withField("a.ab", lit("ab1"))), + Row(Row(Row("aa1", "ab1"), Row("ba1"))) :: Nil, + StructType(Seq( + StructField("data", StructType(Seq( + StructField("a", StructType(Seq( + StructField("aa", StringType, nullable = false), + StructField("ab", StringType, nullable = false) + )), nullable = false), + StructField("b", StructType(Seq( + StructField("ba", StringType, nullable = false) + )), nullable = false) + )), nullable = false) + )) + ) + } + + test("SPARK-35213: optimized withField operations should maintain correct nested struct " + + "ordering") { + val df = spark.createDataFrame( + sparkContext.parallelize(Row(null) :: Nil), + StructType(Seq(StructField("data", NullType)))) + + checkAnswer( + df.withColumn("data", struct() + .withField("a", struct().withField("aa", lit("aa1"))) + .withField("b", struct().withField("ba", lit("ba1"))) + ) + .withColumn("data", col("data").withField("b.bb", lit("bb1"))) + .withColumn("data", col("data").withField("a.ab", lit("ab1"))), + Row(Row(Row("aa1", "ab1"), Row("ba1", "bb1"))) :: Nil, + StructType(Seq( + StructField("data", StructType(Seq( + StructField("a", StructType(Seq( + StructField("aa", StringType, nullable = false), + StructField("ab", StringType, nullable = false) + )), nullable = false), + StructField("b", StructType(Seq( + StructField("ba", StringType, nullable = false), + StructField("bb", StringType, nullable = false) + )), nullable = false) + )), nullable = false) + )) + ) + } + + test("dropFields should throw an exception if called on a non-StructType column") { + intercept[AnalysisException] { + testData.withColumn("key", $"key".dropFields("a")) + }.getMessage should include("struct argument should be struct type, got: int") + } + + test("dropFields should throw an exception if fieldName argument is null") { + intercept[IllegalArgumentException] { + structLevel1.withColumn("a", $"a".dropFields(null)) + }.getMessage should include("fieldName cannot be null") + } + + test("dropFields should throw an exception if any intermediate structs don't exist") { + intercept[AnalysisException] { + structLevel2.withColumn("a", 'a.dropFields("x.b")) + }.getMessage should include("No such struct field x in a") + + intercept[AnalysisException] { + structLevel3.withColumn("a", 'a.dropFields("a.x.b")) + }.getMessage should include("No such struct field x in a") + } + + test("dropFields should throw an exception if intermediate field is not a struct") { + intercept[AnalysisException] { + structLevel1.withColumn("a", 'a.dropFields("b.a")) + }.getMessage should include("struct argument should be struct type, got: int") + } + + test("dropFields should throw an exception if intermediate field reference is ambiguous") { + intercept[AnalysisException] { + val structLevel2: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(Row(Row(1, null, 3), 4)) :: Nil), + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", structType, nullable = false), + StructField("a", structType, nullable = false))), + nullable = false)))) + + structLevel2.withColumn("a", 'a.dropFields("a.b")) + }.getMessage should include("Ambiguous reference to fields") + } + + test("dropFields should drop field in struct") { + checkAnswer( + structLevel1.withColumn("a", 'a.dropFields("b")), + Row(Row(1, 3)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = false)))) + } + + test("dropFields should drop field in nullable struct") { + checkAnswer( + nullableStructLevel1.withColumn("a", $"a".dropFields("b")), + Row(null) :: Row(Row(1, 3)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = true)))) + } + + test("dropFields should drop multiple fields in struct") { + Seq( + structLevel1.withColumn("a", $"a".dropFields("b", "c")), + structLevel1.withColumn("a", 'a.dropFields("b").dropFields("c")) + ).foreach { df => + checkAnswer( + df, + Row(Row(1)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false))), + nullable = false)))) + } + } + + test("dropFields should throw an exception if no fields will be left in struct") { + intercept[AnalysisException] { + structLevel1.withColumn("a", 'a.dropFields("a", "b", "c")) + }.getMessage should include("cannot drop all fields in struct") + } + + test("dropFields should drop field with no name in struct") { + val structType = StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("", IntegerType, nullable = false))) + + val structLevel1: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(Row(1, 2)) :: Nil), + StructType(Seq(StructField("a", structType, nullable = false)))) + + checkAnswer( + structLevel1.withColumn("a", $"a".dropFields("")), + Row(Row(1)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false))), + nullable = false)))) + } + + test("dropFields should drop field in nested struct") { + checkAnswer( + structLevel2.withColumn("a", 'a.dropFields("a.b")), + Row(Row(Row(1, 3))) :: Nil, + StructType( + Seq(StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + } + + test("dropFields should drop multiple fields in nested struct") { + checkAnswer( + structLevel2.withColumn("a", 'a.dropFields("a.b", "a.c")), + Row(Row(Row(1))) :: Nil, + StructType( + Seq(StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + } + + test("dropFields should drop field in nested nullable struct") { + checkAnswer( + nullableStructLevel2.withColumn("a", $"a".dropFields("a.b")), + Row(null) :: Row(Row(null)) :: Row(Row(Row(1, 3))) :: Nil, + StructType( + Seq(StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = true))), + nullable = true)))) + } + + test("dropFields should drop multiple fields in nested nullable struct") { + checkAnswer( + nullableStructLevel2.withColumn("a", $"a".dropFields("a.b", "a.c")), + Row(null) :: Row(Row(null)) :: Row(Row(Row(1))) :: Nil, + StructType( + Seq(StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false))), + nullable = true))), + nullable = true)))) + } + + test("dropFields should drop field in deeply nested struct") { + checkAnswer( + structLevel3.withColumn("a", 'a.dropFields("a.a.b")), + Row(Row(Row(Row(1, 3)))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = false))), + nullable = false))), + nullable = false)))) + } + + test("dropFields should drop all fields with given name in struct") { + val structLevel1 = spark.createDataFrame( + sparkContext.parallelize(Row(Row(1, 2, 3)) :: Nil), + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false)))) + + checkAnswer( + structLevel1.withColumn("a", 'a.dropFields("b")), + Row(Row(1)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false))), + nullable = false)))) + } + + test("dropFields should drop field in struct even if casing is different") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + checkAnswer( + mixedCaseStructLevel1.withColumn("a", 'a.dropFields("A")), + Row(Row(1)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("B", IntegerType, nullable = false))), + nullable = false)))) + + checkAnswer( + mixedCaseStructLevel1.withColumn("a", 'a.dropFields("b")), + Row(Row(1)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false))), + nullable = false)))) + } + } + + test("dropFields should not drop field in struct because casing is different") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + checkAnswer( + mixedCaseStructLevel1.withColumn("a", 'a.dropFields("A")), + Row(Row(1, 1)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("B", IntegerType, nullable = false))), + nullable = false)))) + + checkAnswer( + mixedCaseStructLevel1.withColumn("a", 'a.dropFields("b")), + Row(Row(1, 1)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("B", IntegerType, nullable = false))), + nullable = false)))) + } + } + + test("dropFields should drop nested field in struct even if casing is different") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + checkAnswer( + mixedCaseStructLevel2.withColumn("a", 'a.dropFields("A.a")), + Row(Row(Row(1), Row(1, 1))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("A", StructType(Seq( + StructField("b", IntegerType, nullable = false))), + nullable = false), + StructField("B", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + + checkAnswer( + mixedCaseStructLevel2.withColumn("a", 'a.dropFields("b.a")), + Row(Row(Row(1, 1), Row(1))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false), + StructField("b", StructType(Seq( + StructField("b", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + } + } + + test("dropFields should throw an exception because casing is different") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + intercept[AnalysisException] { + mixedCaseStructLevel2.withColumn("a", 'a.dropFields("A.a")) + }.getMessage should include("No such struct field A in a, B") + + intercept[AnalysisException] { + mixedCaseStructLevel2.withColumn("a", 'a.dropFields("b.a")) + }.getMessage should include("No such struct field b in a, B") + } + } + + test("dropFields should drop only fields that exist") { + checkAnswer( + structLevel1.withColumn("a", 'a.dropFields("d")), + Row(Row(1, null, 3)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false))), + nullable = false)))) + + checkAnswer( + structLevel1.withColumn("a", 'a.dropFields("b", "d")), + Row(Row(1, 3)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = false)))) + + checkAnswer( + structLevel2.withColumn("a", $"a".dropFields("a.b", "a.d")), + Row(Row(Row(1, 3))) :: Nil, + StructType( + Seq(StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + } + + test("dropFields should drop multiple fields at arbitrary levels of nesting in a single call") { + val df: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(Row(Row(1, null, 3), 4)) :: Nil), + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", structType, nullable = false), + StructField("b", IntegerType, nullable = false))), + nullable = false)))) + + checkAnswer( + df.withColumn("a", $"a".dropFields("a.b", "b")), + Row(Row(Row(1, 3))) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("c", IntegerType, nullable = false))), nullable = false))), + nullable = false)))) + } + + test("dropFields user-facing examples") { + checkAnswer( + sql("SELECT named_struct('a', 1, 'b', 2) struct_col") + .select($"struct_col".dropFields("b")), + Row(Row(1))) + + checkAnswer( + sql("SELECT named_struct('a', 1, 'b', 2) struct_col") + .select($"struct_col".dropFields("c")), + Row(Row(1, 2))) + + checkAnswer( + sql("SELECT named_struct('a', 1, 'b', 2, 'c', 3) struct_col") + .select($"struct_col".dropFields("b", "c")), + Row(Row(1))) + + intercept[AnalysisException] { + sql("SELECT named_struct('a', 1, 'b', 2) struct_col") + .select($"struct_col".dropFields("a", "b")) + }.getMessage should include("cannot drop all fields in struct") + + checkAnswer( + sql("SELECT CAST(NULL AS struct) struct_col") + .select($"struct_col".dropFields("b")), + Row(null)) + + checkAnswer( + sql("SELECT named_struct('a', 1, 'b', 2, 'b', 3) struct_col") + .select($"struct_col".dropFields("b")), + Row(Row(1))) + + checkAnswer( + sql("SELECT named_struct('a', named_struct('a', 1, 'b', 2)) struct_col") + .select($"struct_col".dropFields("a.b")), + Row(Row(Row(1)))) + + intercept[AnalysisException] { + sql("SELECT named_struct('a', named_struct('b', 1), 'a', named_struct('c', 2)) struct_col") + .select($"struct_col".dropFields("a.c")) + }.getMessage should include("Ambiguous reference to fields") + + checkAnswer( + sql("SELECT named_struct('a', named_struct('a', 1, 'b', 2, 'c', 3)) struct_col") + .select($"struct_col".dropFields("a.b", "a.c")), + Row(Row(Row(1)))) + + checkAnswer( + sql("SELECT named_struct('a', named_struct('a', 1, 'b', 2, 'c', 3)) struct_col") + .select($"struct_col".withField("a", $"struct_col.a".dropFields("b", "c"))), + Row(Row(Row(1)))) + } + + test("should correctly handle different dropField + withField + getField combinations") { + val structType = StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = false))) + + val structLevel1: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(Row(1, 2)) :: Nil), + StructType(Seq(StructField("a", structType, nullable = false)))) + + val nullStructLevel1: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(null) :: Nil), + StructType(Seq(StructField("a", structType, nullable = true)))) + + val nullableStructLevel1: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(Row(1, 2)) :: Row(null) :: Nil), + StructType(Seq(StructField("a", structType, nullable = true)))) + + def check( + fieldOps: Column => Column, + getFieldName: String, + expectedValue: Option[Int]): Unit = { + + def query(df: DataFrame): DataFrame = + df.select(fieldOps(col("a")).getField(getFieldName).as("res")) + + checkAnswer( + query(structLevel1), + Row(expectedValue.orNull) :: Nil, + StructType(Seq(StructField("res", IntegerType, nullable = expectedValue.isEmpty)))) + + checkAnswer( + query(nullStructLevel1), + Row(null) :: Nil, + StructType(Seq(StructField("res", IntegerType, nullable = true)))) + + checkAnswer( + query(nullableStructLevel1), + Row(expectedValue.orNull) :: Row(null) :: Nil, + StructType(Seq(StructField("res", IntegerType, nullable = true)))) + } + + // add attribute, extract an attribute from the original struct + check(_.withField("c", lit(3)), "a", Some(1)) + check(_.withField("c", lit(3)), "b", Some(2)) + + // add attribute, extract added attribute + check(_.withField("c", lit(3)), "c", Some(3)) + check(_.withField("c", col("a.a")), "c", Some(1)) + check(_.withField("c", col("a.b")), "c", Some(2)) + check(_.withField("c", lit(null).cast(IntegerType)), "c", None) + + // replace attribute, extract an attribute from the original struct + check(_.withField("b", lit(3)), "a", Some(1)) + check(_.withField("a", lit(3)), "b", Some(2)) + + // replace attribute, extract replaced attribute + check(_.withField("b", lit(3)), "b", Some(3)) + check(_.withField("b", lit(null).cast(IntegerType)), "b", None) + check(_.withField("a", lit(3)), "a", Some(3)) + check(_.withField("a", lit(null).cast(IntegerType)), "a", None) + + // drop attribute, extract an attribute from the original struct + check(_.dropFields("b"), "a", Some(1)) + check(_.dropFields("a"), "b", Some(2)) + + // drop attribute, add attribute, extract an attribute from the original struct + check(_.dropFields("b").withField("c", lit(3)), "a", Some(1)) + check(_.dropFields("a").withField("c", lit(3)), "b", Some(2)) + + // drop attribute, add another attribute, extract added attribute + check(_.dropFields("a").withField("c", lit(3)), "c", Some(3)) + check(_.dropFields("b").withField("c", lit(3)), "c", Some(3)) + + // add attribute, drop attribute, extract an attribute from the original struct + check(_.withField("c", lit(3)).dropFields("a"), "b", Some(2)) + check(_.withField("c", lit(3)).dropFields("b"), "a", Some(1)) + + // add attribute, drop another attribute, extract added attribute + check(_.withField("c", lit(3)).dropFields("a"), "c", Some(3)) + check(_.withField("c", lit(3)).dropFields("b"), "c", Some(3)) + + // replace attribute, drop same attribute, extract an attribute from the original struct + check(_.withField("b", lit(3)).dropFields("b"), "a", Some(1)) + check(_.withField("a", lit(3)).dropFields("a"), "b", Some(2)) + + // add attribute, drop same attribute, extract an attribute from the original struct + check(_.withField("c", lit(3)).dropFields("c"), "a", Some(1)) + check(_.withField("c", lit(3)).dropFields("c"), "b", Some(2)) + + // add attribute, drop another attribute, extract added attribute + check(_.withField("b", lit(3)).dropFields("a"), "b", Some(3)) + check(_.withField("a", lit(3)).dropFields("b"), "a", Some(3)) + check(_.withField("b", lit(null).cast(IntegerType)).dropFields("a"), "b", None) + check(_.withField("a", lit(null).cast(IntegerType)).dropFields("b"), "a", None) + + // drop attribute, add same attribute, extract added attribute + check(_.dropFields("b").withField("b", lit(3)), "b", Some(3)) + check(_.dropFields("a").withField("a", lit(3)), "a", Some(3)) + check(_.dropFields("b").withField("b", lit(null).cast(IntegerType)), "b", None) + check(_.dropFields("a").withField("a", lit(null).cast(IntegerType)), "a", None) + check(_.dropFields("c").withField("c", lit(3)), "c", Some(3)) + + // add attribute, drop same attribute, add same attribute again, extract added attribute + check(_.withField("c", lit(3)).dropFields("c").withField("c", lit(4)), "c", Some(4)) + } + + test("should move field up one level of nesting") { + // move a field up one level + checkAnswer( + nullableStructLevel2.select( + col("a").withField("c", col("a.a.c")).dropFields("a.c").as("res")), + Row(null) :: Row(Row(null, null)) :: Row(Row(Row(1, null), 3)) :: Nil, + StructType(Seq( + StructField("res", StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true))), + nullable = true), + StructField("c", IntegerType, nullable = true))), + nullable = true)))) + + // move a field up one level and then extract it + checkAnswer( + nullableStructLevel2.select( + col("a").withField("c", col("a.a.c")).dropFields("a.c").getField("c").as("res")), + Row(null) :: Row(null) :: Row(3) :: Nil, + StructType(Seq(StructField("res", IntegerType, nullable = true)))) + } + + test("should be able to refer to newly added nested column") { + intercept[AnalysisException] { + structLevel1.select($"a".withField("d", lit(4)).withField("e", $"a.d" + 1).as("a")) + }.getMessage should include("No such struct field d in a, b, c") + + checkAnswer( + structLevel1 + .select($"a".withField("d", lit(4)).as("a")) + .select($"a".withField("e", $"a.d" + 1).as("a")), + Row(Row(1, null, 3, 4, 5)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("c", IntegerType, nullable = false), + StructField("d", IntegerType, nullable = false), + StructField("e", IntegerType, nullable = false))), + nullable = false)))) + } + + test("should be able to drop newly added nested column") { + Seq( + structLevel1.select($"a".withField("d", lit(4)).dropFields("d").as("a")), + structLevel1 + .select($"a".withField("d", lit(4)).as("a")) + .select($"a".dropFields("d").as("a")) + ).foreach { query => + checkAnswer( + query, + Row(Row(1, null, 3)) :: Nil, + StructType(Seq( + StructField("a", structType, nullable = false)))) + } + } + + test("should still be able to refer to dropped column within the same select statement") { + // we can still access the nested column even after dropping it within the same select statement + checkAnswer( + structLevel1.select($"a".dropFields("c").withField("z", $"a.c").as("a")), + Row(Row(1, null, 3)) :: Nil, + StructType(Seq( + StructField("a", StructType(Seq( + StructField("a", IntegerType, nullable = false), + StructField("b", IntegerType, nullable = true), + StructField("z", IntegerType, nullable = false))), + nullable = false)))) + + // we can't access the nested column in subsequent select statement after dropping it in a + // previous select statement + intercept[AnalysisException]{ + structLevel1 + .select($"a".dropFields("c").as("a")) + .select($"a".withField("z", $"a.c")).as("a") + }.getMessage should include("No such struct field c in a, b") + } + + test("nestedDf should generate nested DataFrames") { + checkAnswer( + emptyNestedDf(1, 1, nullable = false), + Seq.empty[Row], + StructType(Seq(StructField("nested0Col0", StructType(Seq( + StructField("nested1Col0", IntegerType, nullable = false))), + nullable = false)))) + + checkAnswer( + emptyNestedDf(1, 2, nullable = false), + Seq.empty[Row], + StructType(Seq(StructField("nested0Col0", StructType(Seq( + StructField("nested1Col0", IntegerType, nullable = false), + StructField("nested1Col1", IntegerType, nullable = false))), + nullable = false)))) + + checkAnswer( + emptyNestedDf(2, 1, nullable = false), + Seq.empty[Row], + StructType(Seq(StructField("nested0Col0", StructType(Seq( + StructField("nested1Col0", StructType(Seq( + StructField("nested2Col0", IntegerType, nullable = false))), + nullable = false))), + nullable = false)))) + + checkAnswer( + emptyNestedDf(2, 2, nullable = false), + Seq.empty[Row], + StructType(Seq(StructField("nested0Col0", StructType(Seq( + StructField("nested1Col0", StructType(Seq( + StructField("nested2Col0", IntegerType, nullable = false), + StructField("nested2Col1", IntegerType, nullable = false))), + nullable = false), + StructField("nested1Col1", IntegerType, nullable = false))), + nullable = false)))) + + checkAnswer( + emptyNestedDf(2, 2, nullable = true), + Seq.empty[Row], + StructType(Seq(StructField("nested0Col0", StructType(Seq( + StructField("nested1Col0", StructType(Seq( + StructField("nested2Col0", IntegerType, nullable = false), + StructField("nested2Col1", IntegerType, nullable = false))), + nullable = true), + StructField("nested1Col1", IntegerType, nullable = false))), + nullable = true)))) + } + + Seq(Performant, NonPerformant).foreach { method => + Seq(false, true).foreach { nullable => + test(s"should add and drop 1 column at each depth of nesting using ${method.name} method, " + + s"nullable = $nullable") { + val maxDepth = 3 + + // dataframe with nested*Col0 to nested*Col2 at each depth + val inputDf = emptyNestedDf(maxDepth, 3, nullable) + + // add nested*Col3 and drop nested*Col2 + val modifiedColumn = method( + column = col(nestedColName(0, 0)), + numsToAdd = Seq(3), + numsToDrop = Seq(2), + maxDepth = maxDepth + ).as(nestedColName(0, 0)) + val resultDf = inputDf.select(modifiedColumn) + + // dataframe with nested*Col0, nested*Col1, nested*Col3 at each depth + val expectedDf = { + val colNums = Seq(0, 1, 3) + val nestedColumnDataType = nestedStructType(colNums, nullable, maxDepth) + + spark.createDataFrame( + spark.sparkContext.emptyRDD[Row], + StructType(Seq(StructField(nestedColName(0, 0), nestedColumnDataType, nullable)))) + } + + checkAnswer(resultDf, expectedDf.collect(), expectedDf.schema) + } + } + } + + test("assert_true") { + // assert_true(condition, errMsgCol) + val booleanDf = Seq((true), (false)).toDF("cond") + checkAnswer( + booleanDf.filter("cond = true").select(assert_true($"cond")), + Row(null) :: Nil + ) + val e1 = intercept[SparkException] { + booleanDf.select(assert_true($"cond", lit(null.asInstanceOf[String]))).collect() + } + assert(e1.getCause.isInstanceOf[RuntimeException]) + assert(e1.getCause.getMessage == null) + + val nullDf = Seq(("first row", None), ("second row", Some(true))).toDF("n", "cond") + checkAnswer( + nullDf.filter("cond = true").select(assert_true($"cond", $"cond")), + Row(null) :: Nil + ) + val e2 = intercept[SparkException] { + nullDf.select(assert_true($"cond", $"n")).collect() + } + assert(e2.getCause.isInstanceOf[RuntimeException]) + assert(e2.getCause.getMessage == "first row") + + // assert_true(condition) + val intDf = Seq((0, 1)).toDF("a", "b") + checkAnswer(intDf.select(assert_true($"a" < $"b")), Row(null) :: Nil) + val e3 = intercept[SparkException] { + intDf.select(assert_true($"a" > $"b")).collect() + } + assert(e3.getCause.isInstanceOf[RuntimeException]) + assert(e3.getCause.getMessage == "'('a > 'b)' is not true!") + } + + test("raise_error") { + val strDf = Seq(("hello")).toDF("a") + + val e1 = intercept[SparkException] { + strDf.select(raise_error(lit(null.asInstanceOf[String]))).collect() + } + assert(e1.getCause.isInstanceOf[RuntimeException]) + assert(e1.getCause.getMessage == null) + + val e2 = intercept[SparkException] { + strDf.select(raise_error($"a")).collect() + } + assert(e2.getCause.isInstanceOf[RuntimeException]) + assert(e2.getCause.getMessage == "hello") + } + + test("SPARK-34677: negate/add/subtract year-month and day-time intervals") { + import testImplicits._ + val df = Seq((Period.ofMonths(10), Duration.ofDays(10), Period.ofMonths(1), Duration.ofDays(1))) + .toDF("year-month-A", "day-time-A", "year-month-B", "day-time-B") + val negatedDF = df.select(-$"year-month-A", -$"day-time-A") + checkAnswer(negatedDF, Row(Period.ofMonths(-10), Duration.ofDays(-10))) + val addDF = df.select($"year-month-A" + $"year-month-B", $"day-time-A" + $"day-time-B") + checkAnswer(addDF, Row(Period.ofMonths(11), Duration.ofDays(11))) + val subDF = df.select($"year-month-A" - $"year-month-B", $"day-time-A" - $"day-time-B") + checkAnswer(subDF, Row(Period.ofMonths(9), Duration.ofDays(9))) + } + + test("SPARK-34721: add a year-month interval to a date") { + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { + outstandingTimezonesIds.foreach { zid => + withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> zid) { + Seq( + (LocalDate.of(1900, 10, 1), Period.ofMonths(0)) -> LocalDate.of(1900, 10, 1), + (LocalDate.of(1970, 1, 1), Period.ofMonths(-1)) -> LocalDate.of(1969, 12, 1), + (LocalDate.of(2021, 3, 11), Period.ofMonths(1)) -> LocalDate.of(2021, 4, 11), + (LocalDate.of(2020, 12, 31), Period.ofMonths(2)) -> LocalDate.of(2021, 2, 28), + (LocalDate.of(2021, 5, 31), Period.ofMonths(-3)) -> LocalDate.of(2021, 2, 28), + (LocalDate.of(2020, 2, 29), Period.ofYears(1)) -> LocalDate.of(2021, 2, 28), + (LocalDate.of(1, 1, 1), Period.ofYears(2020)) -> LocalDate.of(2021, 1, 1) + ).foreach { case ((date, period), result) => + val df = Seq((date, period)).toDF("date", "interval") + checkAnswer( + df.select($"date" + $"interval", $"interval" + $"date"), + Row(result, result)) + } + } + } + + val e = intercept[SparkException] { + Seq((LocalDate.of(2021, 3, 11), Period.ofMonths(Int.MaxValue))) + .toDF("date", "interval") + .select($"date" + $"interval") + .collect() + }.getCause + assert(e.isInstanceOf[ArithmeticException]) + assert(e.getMessage.contains("integer overflow")) + } + } + + test("SPARK-34721: subtract a year-month interval from a date") { + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { + outstandingTimezonesIds.foreach { zid => + withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> zid) { + Seq( + (LocalDate.of(1582, 10, 4), Period.ofMonths(0)) -> LocalDate.of(1582, 10, 4), + (LocalDate.of(1582, 10, 15), Period.ofMonths(1)) -> LocalDate.of(1582, 9, 15), + (LocalDate.of(1, 1, 1), Period.ofMonths(-1)) -> LocalDate.of(1, 2, 1), + (LocalDate.of(9999, 10, 31), Period.ofMonths(-2)) -> LocalDate.of(9999, 12, 31), + (LocalDate.of(2021, 5, 31), Period.ofMonths(3)) -> LocalDate.of(2021, 2, 28), + (LocalDate.of(2021, 2, 28), Period.ofYears(1)) -> LocalDate.of(2020, 2, 28), + (LocalDate.of(2020, 2, 29), Period.ofYears(4)) -> LocalDate.of(2016, 2, 29) + ).foreach { case ((date, period), result) => + val df = Seq((date, period)).toDF("date", "interval") + checkAnswer(df.select($"date" - $"interval"), Row(result)) + } + } + } + + val e = intercept[SparkException] { + Seq((LocalDate.of(2021, 3, 11), Period.ofMonths(Int.MaxValue))) + .toDF("date", "interval") + .select($"date" - $"interval") + .collect() + }.getCause + assert(e.isInstanceOf[ArithmeticException]) + assert(e.getMessage.contains("integer overflow")) + } + } + + test("SPARK-34739: add a year-month interval to a timestamp") { + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { + outstandingZoneIds.foreach { zid => + withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> zid.getId) { + Seq( + (LocalDateTime.of(1900, 1, 1, 0, 0, 0, 123456000), Period.ofMonths(0)) -> + LocalDateTime.of(1900, 1, 1, 0, 0, 0, 123456000), + (LocalDateTime.of(1970, 1, 1, 0, 0, 0, 1000), Period.ofMonths(-1)) -> + LocalDateTime.of(1969, 12, 1, 0, 0, 0, 1000), + (LocalDateTime.of(2021, 3, 14, 1, 2, 3, 0), Period.ofMonths(1)) -> + LocalDateTime.of(2021, 4, 14, 1, 2, 3, 0), + (LocalDateTime.of(2020, 12, 31, 23, 59, 59, 999999000), Period.ofMonths(2)) -> + LocalDateTime.of(2021, 2, 28, 23, 59, 59, 999999000), + (LocalDateTime.of(2021, 5, 31, 0, 0, 1, 0), Period.ofMonths(-3)) -> + LocalDateTime.of(2021, 2, 28, 0, 0, 1, 0), + (LocalDateTime.of(2020, 2, 29, 12, 13, 14), Period.ofYears(1)) -> + LocalDateTime.of(2021, 2, 28, 12, 13, 14), + (LocalDateTime.of(1, 1, 1, 1, 1, 1, 1000), Period.ofYears(2020)) -> + LocalDateTime.of(2021, 1, 1, 1, 1, 1, 1000) + ).foreach { case ((ldt, period), expected) => + val df = Seq((ldt.atZone(zid).toInstant, period)).toDF("ts", "interval") + val result = expected.atZone(zid).toInstant + checkAnswer(df.select($"ts" + $"interval", $"interval" + $"ts"), Row(result, result)) + } + } + } + + val e = intercept[SparkException] { + Seq((Instant.parse("2021-03-14T18:55:00Z"), Period.ofMonths(Int.MaxValue))) + .toDF("ts", "interval") + .select($"ts" + $"interval") + .collect() + }.getCause + assert(e.isInstanceOf[ArithmeticException]) + assert(e.getMessage.contains("long overflow")) + } + } + + test("SPARK-34739: subtract a year-month interval from a timestamp") { + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { + outstandingZoneIds.foreach { zid => + withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> zid.getId) { + Seq( + (LocalDateTime.of(1582, 10, 4, 0, 0, 0), Period.ofMonths(0)) -> + LocalDateTime.of(1582, 10, 4, 0, 0, 0), + (LocalDateTime.of(1582, 10, 15, 23, 59, 59, 999999000), Period.ofMonths(1)) -> + LocalDateTime.of(1582, 9, 15, 23, 59, 59, 999999000), + (LocalDateTime.of(1, 1, 1, 1, 1, 1, 1000), Period.ofMonths(-1)) -> + LocalDateTime.of(1, 2, 1, 1, 1, 1, 1000), + (LocalDateTime.of(9999, 10, 31, 23, 59, 59, 999000000), Period.ofMonths(-2)) -> + LocalDateTime.of(9999, 12, 31, 23, 59, 59, 999000000), + (LocalDateTime.of(2021, 5, 31, 0, 0, 0, 1000), Period.ofMonths(3)) -> + LocalDateTime.of(2021, 2, 28, 0, 0, 0, 1000), + (LocalDateTime.of(2021, 2, 28, 11, 12, 13, 123456000), Period.ofYears(1)) -> + LocalDateTime.of(2020, 2, 28, 11, 12, 13, 123456000), + (LocalDateTime.of(2020, 2, 29, 1, 2, 3, 5000), Period.ofYears(4)) -> + LocalDateTime.of(2016, 2, 29, 1, 2, 3, 5000) + ).foreach { case ((ldt, period), expected) => + val df = Seq((ldt.atZone(zid).toInstant, period)).toDF("ts", "interval") + checkAnswer(df.select($"ts" - $"interval"), Row(expected.atZone(zid).toInstant)) + } + } + } + + val e = intercept[SparkException] { + Seq((Instant.parse("2021-03-14T18:55:00Z"), Period.ofMonths(Int.MaxValue))) + .toDF("ts", "interval") + .select($"ts" - $"interval") + .collect() + }.getCause + assert(e.isInstanceOf[ArithmeticException]) + assert(e.getMessage.contains("long overflow")) + } + } + + test("SPARK-34761, SPARK-34903: add/subtract a day-time interval to/from a timestamp") { + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { + outstandingZoneIds.foreach { zid => + withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> zid.getId) { + Seq( + (LocalDateTime.of(1900, 1, 1, 0, 0, 0, 123456000), Duration.ofDays(0)) -> + LocalDateTime.of(1900, 1, 1, 0, 0, 0, 123456000), + (LocalDateTime.of(1970, 1, 1, 0, 0, 0, 100000000), Duration.ofDays(-1)) -> + LocalDateTime.of(1969, 12, 31, 0, 0, 0, 100000000), + (LocalDateTime.of(2021, 3, 14, 1, 2, 3), Duration.ofDays(1)) -> + LocalDateTime.of(2021, 3, 15, 1, 2, 3), + (LocalDateTime.of(2020, 12, 31, 23, 59, 59, 999000000), + Duration.ofDays(2 * 30).plusMillis(1)) -> LocalDateTime.of(2021, 3, 2, 0, 0, 0), + (LocalDateTime.of(2020, 3, 16, 0, 0, 0, 1000), Duration.of(-1, ChronoUnit.MICROS)) -> + LocalDateTime.of(2020, 3, 16, 0, 0, 0), + (LocalDateTime.of(2020, 2, 29, 12, 13, 14), Duration.ofDays(365)) -> + LocalDateTime.of(2021, 2, 28, 12, 13, 14), + (LocalDateTime.of(1582, 10, 4, 1, 2, 3, 40000000), + Duration.ofDays(10).plusMillis(60)) -> + LocalDateTime.of(1582, 10, 14, 1, 2, 3, 100000000) + ).foreach { case ((ldt, duration), expected) => + val ts = ldt.atZone(zid).toInstant + val result = expected.atZone(zid).toInstant + val df = Seq((ts, duration, result)).toDF("ts", "interval", "result") + checkAnswer( + df.select($"ts" + $"interval", $"interval" + $"ts", $"result" - $"interval", + $"result" - $"ts"), + Row(result, result, ts, duration)) + } + } + } + + Seq( + "2021-03-16T18:56:00Z" -> "ts + i", + "1900-03-16T18:56:00Z" -> "ts - i").foreach { case (instant, op) => + val e = intercept[SparkException] { + Seq( + (Instant.parse(instant), Duration.of(Long.MaxValue, ChronoUnit.MICROS))) + .toDF("ts", "i") + .selectExpr(op) + .collect() + }.getCause + assert(e.isInstanceOf[ArithmeticException]) + assert(e.getMessage.contains("long overflow")) + } + } + } + + test("SPARK-34824: multiply year-month interval by numeric") { + checkAnswer( + Seq((Period.ofYears(0), 0)).toDF("i", "n").select($"i" * $"n"), + Row(Period.ofYears(0))) + checkAnswer( + Seq((Period.ofMonths(0), 10.toByte)).toDF("i", "n").select($"i" * $"n"), + Row(Period.ofMonths(0))) + checkAnswer( + Seq((Period.ofMonths(5), 3.toShort)).toDF("i", "n").select($"n" * $"i"), + Row(Period.ofYears(1).plusMonths(3))) + checkAnswer( + Seq((Period.ofYears(1000), "2")).toDF("i", "n").select($"i" * $"n"), + Row(Period.ofYears(2000))) + checkAnswer( + Seq((Period.ofMonths(1), 12L)).toDF("i", "n").select($"n" * $"i"), + Row(Period.ofYears(1))) + checkAnswer( + Seq((Period.ofYears(100).plusMonths(11), Short.MaxValue)).toDF("i", "n").select($"n" * $"i"), + Row(Period.ofYears(100).plusMonths(11).multipliedBy(Short.MaxValue).normalized())) + checkAnswer( + Seq((Period.ofMonths(-1), 0.499f)).toDF("i", "n").select($"i" * $"n"), + Row(Period.ofMonths(0))) + checkAnswer( + Seq((Period.ofMonths(10000000), 0.0000001d)).toDF("i", "n").select($"i" * $"n"), + Row(Period.ofMonths(1))) + checkAnswer( + Seq((Period.ofMonths(-10000000), BigDecimal(0.0000001d))).toDF("i", "n").select($"i" * $"n"), + Row(Period.ofMonths(-1))) + checkAnswer( + Seq((Period.ofMonths(-1), BigDecimal(0.5))).toDF("i", "n").select($"i" * $"n"), + Row(Period.ofMonths(-1))) + + val e = intercept[SparkException] { + Seq((Period.ofYears(9999), Long.MinValue)).toDF("i", "n").select($"n" * $"i").collect() + }.getCause + assert(e.isInstanceOf[ArithmeticException]) + assert(e.getMessage.contains("overflow")) + } + + test("SPARK-34850: multiply day-time interval by numeric") { + checkAnswer( + Seq((Duration.ofDays(0), 0)).toDF("i", "n").select($"i" * $"n"), + Row(Duration.ofDays(0))) + checkAnswer( + Seq((Duration.ofDays(0), 10.toByte)).toDF("i", "n").select($"i" * $"n"), + Row(Duration.ofDays(0))) + checkAnswer( + Seq((Duration.ofHours(12), 3.toShort)).toDF("i", "n").select($"n" * $"i"), + Row(Duration.ofDays(1).plusHours(12))) + checkAnswer( + Seq((Duration.ofMinutes(1000), "2")).toDF("i", "n").select($"i" * $"n"), + Row(Duration.ofMinutes(2000))) + checkAnswer( + Seq((Duration.ofSeconds(1), 60L)).toDF("i", "n").select($"n" * $"i"), + Row(Duration.ofMinutes(1))) + checkAnswer( + Seq((Duration.of(-1, ChronoUnit.MICROS), 0.499f)).toDF("i", "n").select($"i" * $"n"), + Row(Duration.of(0, ChronoUnit.MICROS))) + checkAnswer( + Seq((Duration.of(-1, ChronoUnit.MICROS), 0.51d)).toDF("i", "n").select($"i" * $"n"), + Row(Duration.of(-1, ChronoUnit.MICROS))) + checkAnswer( + Seq((Duration.of(-10000000, ChronoUnit.MICROS), BigDecimal(0.0000001d))) + .toDF("i", "n").select($"i" * $"n"), + Row(Duration.of(-1, ChronoUnit.MICROS))) + + val e = intercept[SparkException] { + Seq((Duration.ofDays(9999), Long.MinValue)).toDF("i", "n").select($"n" * $"i").collect() + }.getCause + assert(e.isInstanceOf[ArithmeticException]) + assert(e.getMessage.contains("overflow")) + } + + test("SPARK-34868: divide year-month interval by numeric") { + checkAnswer( + Seq((Period.ofYears(0), 10.toByte)).toDF("i", "n").select($"i" / $"n"), + Row(Period.ofYears(0))) + checkAnswer( + Seq((Period.ofYears(10), 3.toShort)).toDF("i", "n").select($"i" / $"n"), + Row(Period.ofYears(3).plusMonths(4))) + checkAnswer( + Seq((Period.ofYears(1000), "2")).toDF("i", "n").select($"i" / $"n"), + Row(Period.ofYears(500))) + checkAnswer( + Seq((Period.ofMonths(1).multipliedBy(Int.MaxValue), Int.MaxValue)) + .toDF("i", "n").select($"i" / $"n"), + Row(Period.ofMonths(1))) + checkAnswer( + Seq((Period.ofYears(-1), 12L)).toDF("i", "n").select($"i" / $"n"), + Row(Period.ofMonths(-1))) + checkAnswer( + Seq((Period.ofMonths(-1), 0.499f)).toDF("i", "n").select($"i" / $"n"), + Row(Period.ofMonths(-2))) + checkAnswer( + Seq((Period.ofMonths(10000000), 10000000d)).toDF("i", "n").select($"i" / $"n"), + Row(Period.ofMonths(1))) + checkAnswer( + Seq((Period.ofMonths(-1), BigDecimal(0.5))).toDF("i", "n").select($"i" / $"n"), + Row(Period.ofMonths(-2))) + + val e = intercept[SparkException] { + Seq((Period.ofYears(9999), 0)).toDF("i", "n").select($"i" / $"n").collect() + }.getCause + assert(e.isInstanceOf[ArithmeticException]) + assert(e.getMessage.contains("/ by zero")) + } + + test("SPARK-34875: divide day-time interval by numeric") { + checkAnswer( + Seq((Duration.ZERO, 10.toByte)).toDF("i", "n").select($"i" / $"n"), + Row(Duration.ZERO)) + checkAnswer( + Seq((Duration.ofDays(10), 3.toShort)).toDF("i", "n").select($"i" / $"n"), + Row(Duration.ofDays(10).dividedBy(3))) + checkAnswer( + Seq((Duration.ofHours(1000), "2")).toDF("i", "n").select($"i" / $"n"), + Row(Duration.ofHours(500))) + checkAnswer( + Seq((Duration.of(1, ChronoUnit.MICROS).multipliedBy(Long.MaxValue), Long.MaxValue)) + .toDF("i", "n").select($"i" / $"n"), + Row(Duration.of(1, ChronoUnit.MICROS))) + checkAnswer( + Seq((Duration.ofMinutes(-1), 60L)).toDF("i", "n").select($"i" / $"n"), + Row(Duration.ofSeconds(-1))) + checkAnswer( + Seq((Duration.ofDays(-1), 0.5f)).toDF("i", "n").select($"i" / $"n"), + Row(Duration.ofDays(-2))) + checkAnswer( + Seq((Duration.ofMillis(10000000), 10000000d)).toDF("i", "n").select($"i" / $"n"), + Row(Duration.ofMillis(1))) + checkAnswer( + Seq((Duration.of(-1, ChronoUnit.MICROS), BigDecimal(10000.0001))) + .toDF("i", "n").select($"i" / $"n"), + Row(Duration.of(-1, ChronoUnit.MICROS).multipliedBy(10000).dividedBy(100000001))) + + val e = intercept[SparkException] { + Seq((Duration.ofDays(9999), 0)).toDF("i", "n").select($"i" / $"n").collect() + }.getCause + assert(e.isInstanceOf[ArithmeticException]) + assert(e.getMessage.contains("/ by zero")) + } + + test("SPARK-34896: return day-time interval from dates subtraction") { + withSQLConf( + SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true", + SQLConf.LEGACY_INTERVAL_ENABLED.key -> "false") { + outstandingTimezonesIds.foreach { zid => + withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> zid) { + Seq( + (LocalDate.of(1582, 10, 15), LocalDate.of(1582, 10, 4)), + (LocalDate.of(1900, 10, 1), LocalDate.of(1900, 10, 1)), + (LocalDate.of(1969, 12, 1), LocalDate.of(1970, 1, 1)), + (LocalDate.of(2021, 3, 1), LocalDate.of(2020, 2, 29)), + (LocalDate.of(2021, 3, 15), LocalDate.of(2021, 3, 14)), + (LocalDate.of(1, 1, 1), LocalDate.of(2021, 3, 29)) + ).foreach { case (end, start) => + val df = Seq((end, start)).toDF("end", "start") + val daysBetween = Duration.ofDays(ChronoUnit.DAYS.between(start, end)) + checkAnswer(df.select($"end" - $"start"), Row(daysBetween)) + } + } + } + + val e = intercept[SparkException] { + Seq((LocalDate.ofEpochDay(0), LocalDate.of(500000, 1, 1))) + .toDF("start", "end") + .select($"end" - $"start") + .collect() + }.getCause + assert(e.isInstanceOf[ArithmeticException]) + assert(e.getMessage.contains("long overflow")) + } + } + + test("SPARK-34903: Return day-time interval from timestamps subtraction") { + outstandingTimezonesIds.foreach { tz => + withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> tz) { + checkAnswer( + sql("select timestamp '2021-03-31 19:11:10' - timestamp '2021-03-01 19:11:10'"), + Row(Duration.ofDays(30))) + checkAnswer( + Seq((Instant.parse("2021-03-31T00:01:02Z"), Instant.parse("2021-04-01T00:00:00Z"))) + .toDF("start", "end").select($"end" - $"start" < Duration.ofDays(1)), + Row(true)) + checkAnswer( + Seq((Instant.parse("2021-03-31T00:01:02.777Z"), Duration.ofMillis(333))) + .toDF("ts", "i") + .select(($"ts" + $"i") - $"ts"), + Row(Duration.ofMillis(333))) + checkAnswer( + Seq((LocalDateTime.of(2021, 3, 31, 10, 0, 0) + .atZone(DateTimeUtils.getZoneId(tz)).toInstant, LocalDate.of(2020, 3, 31))) + .toDF("ts", "d") + .select($"ts" - $"d"), + Row(Duration.ofDays(365).plusHours(10))) + } + } + } + + test("SPARK-35051: add/subtract a day-time interval to/from a date") { + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { + outstandingZoneIds.foreach { zid => + withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> zid.getId) { + Seq( + (LocalDate.of(1, 1, 1), Duration.ofDays(31)) -> LocalDateTime.of(1, 2, 1, 0, 0, 0), + (LocalDate.of(1582, 9, 15), Duration.ofDays(30).plus(1, ChronoUnit.MICROS)) -> + LocalDateTime.of(1582, 10, 15, 0, 0, 0, 1000), + (LocalDate.of(1900, 1, 1), Duration.ofDays(0).plusHours(1)) -> + LocalDateTime.of(1900, 1, 1, 1, 0, 0), + (LocalDate.of(1970, 1, 1), Duration.ofDays(-1).minusMinutes(1)) -> + LocalDateTime.of(1969, 12, 30, 23, 59, 0), + (LocalDate.of(2021, 3, 14), Duration.ofDays(1)) -> + LocalDateTime.of(2021, 3, 15, 0, 0, 0), + (LocalDate.of(2020, 12, 31), Duration.ofDays(4 * 30).plusMinutes(30)) -> + LocalDateTime.of(2021, 4, 30, 0, 30, 0), + (LocalDate.of(2020, 2, 29), Duration.ofDays(365).plusSeconds(59)) -> + LocalDateTime.of(2021, 2, 28, 0, 0, 59), + (LocalDate.of(10000, 1, 1), Duration.ofDays(-2)) -> + LocalDateTime.of(9999, 12, 30, 0, 0, 0) + ).foreach { case ((date, duration), expected) => + val result = expected.atZone(zid).toInstant + val ts = date.atStartOfDay(zid).toInstant + val df = Seq((date, duration, result)).toDF("date", "interval", "result") + checkAnswer( + df.select($"date" + $"interval", $"interval" + $"date", $"result" - $"interval", + $"result" - $"date"), + Row(result, result, ts, duration)) + } + } + } + + Seq( + "2021-04-14" -> "date + i", + "1900-04-14" -> "date - i").foreach { case (date, op) => + val e = intercept[SparkException] { + Seq( + (LocalDate.parse(date), Duration.of(Long.MaxValue, ChronoUnit.MICROS))) + .toDF("date", "i") + .selectExpr(op) + .collect() + }.getCause + assert(e.isInstanceOf[ArithmeticException]) + assert(e.getMessage.contains("long overflow")) + } + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/ComplexTypesSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/ComplexTypesSuite.scala index 6b503334f9f23..bdcf7230e3211 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/ComplexTypesSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/ComplexTypesSuite.scala @@ -17,11 +17,15 @@ package org.apache.spark.sql +import scala.collection.JavaConverters._ + import org.apache.spark.sql.catalyst.expressions.CreateNamedStruct import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types.{ArrayType, StructType} class ComplexTypesSuite extends QueryTest with SharedSparkSession { + import testImplicits._ override def beforeAll(): Unit = { super.beforeAll() @@ -106,4 +110,11 @@ class ComplexTypesSuite extends QueryTest with SharedSparkSession { checkAnswer(df1, Row(10, 12) :: Row(11, 13) :: Nil) checkNamedStruct(df.queryExecution.optimizedPlan, expectedCount = 0) } + + test("SPARK-32167: get field from an array of struct") { + val innerStruct = new StructType().add("i", "int", nullable = true) + val schema = new StructType().add("arr", ArrayType(innerStruct, containsNull = false)) + val df = spark.createDataFrame(List(Row(Seq(Row(1), Row(null)))).asJava, schema) + checkAnswer(df.select($"arr".getField("i")), Row(Seq(1, null))) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/CsvFunctionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/CsvFunctionsSuite.scala index 800e294cca8c4..16b92d6d11c91 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/CsvFunctionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/CsvFunctionsSuite.scala @@ -80,16 +80,16 @@ class CsvFunctionsSuite extends QueryTest with SharedSparkSession { test("schema_of_csv - infers schemas") { checkAnswer( spark.range(1).select(schema_of_csv(lit("0.1,1"))), - Seq(Row("struct<_c0:double,_c1:int>"))) + Seq(Row("STRUCT<`_c0`: DOUBLE, `_c1`: INT>"))) checkAnswer( spark.range(1).select(schema_of_csv("0.1,1")), - Seq(Row("struct<_c0:double,_c1:int>"))) + Seq(Row("STRUCT<`_c0`: DOUBLE, `_c1`: INT>"))) } test("schema_of_csv - infers schemas using options") { val df = spark.range(1) .select(schema_of_csv(lit("0.1 1"), Map("sep" -> " ").asJava)) - checkAnswer(df, Seq(Row("struct<_c0:double,_c1:int>"))) + checkAnswer(df, Seq(Row("STRUCT<`_c0`: DOUBLE, `_c1`: INT>"))) } test("to_csv - struct") { @@ -236,7 +236,7 @@ class CsvFunctionsSuite extends QueryTest with SharedSparkSession { val input = concat_ws(",", lit(0.1), lit(1)) checkAnswer( spark.range(1).select(schema_of_csv(input)), - Seq(Row("struct<_c0:double,_c1:int>"))) + Seq(Row("STRUCT<`_c0`: DOUBLE, `_c1`: INT>"))) } test("optional datetime parser does not affect csv time formatting") { @@ -250,4 +250,52 @@ class CsvFunctionsSuite extends QueryTest with SharedSparkSession { | """.stripMargin) checkAnswer(toDF("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"), toDF("yyyy-MM-dd'T'HH:mm:ss[.SSS][XXX]")) } + + test("SPARK-32968: Pruning csv field should not change result") { + Seq("true", "false").foreach { enabled => + withSQLConf(SQLConf.CSV_EXPRESSION_OPTIMIZATION.key -> enabled) { + val df1 = sparkContext.parallelize(Seq("a,b")).toDF("csv") + .selectExpr("from_csv(csv, 'a string, b string', map('mode', 'failfast')) as parsed") + checkAnswer(df1.selectExpr("parsed.a"), Seq(Row("a"))) + checkAnswer(df1.selectExpr("parsed.b"), Seq(Row("b"))) + + val df2 = sparkContext.parallelize(Seq("a,b")).toDF("csv") + .selectExpr("from_csv(csv, 'a string, b string') as parsed") + checkAnswer(df2.selectExpr("parsed.a"), Seq(Row("a"))) + checkAnswer(df2.selectExpr("parsed.b"), Seq(Row("b"))) + } + } + } + + test("SPARK-32968: bad csv input with csv pruning optimization") { + Seq("true", "false").foreach { enabled => + withSQLConf(SQLConf.CSV_EXPRESSION_OPTIMIZATION.key -> enabled) { + val df = sparkContext.parallelize(Seq("1,\u0001\u0000\u0001234")).toDF("csv") + .selectExpr("from_csv(csv, 'a int, b int', map('mode', 'failfast')) as parsed") + + val err1 = intercept[SparkException] { + df.selectExpr("parsed.a").collect + } + + val err2 = intercept[SparkException] { + df.selectExpr("parsed.b").collect + } + + assert(err1.getMessage.contains("Malformed records are detected in record parsing")) + assert(err2.getMessage.contains("Malformed records are detected in record parsing")) + } + } + } + + test("SPARK-32968: csv pruning optimization with corrupt record field") { + Seq("true", "false").foreach { enabled => + withSQLConf(SQLConf.CSV_EXPRESSION_OPTIMIZATION.key -> enabled) { + val df = sparkContext.parallelize(Seq("a,b,c,d")).toDF("csv") + .selectExpr("from_csv(csv, 'a string, b string, _corrupt_record string') as parsed") + .selectExpr("parsed._corrupt_record") + + checkAnswer(df, Seq(Row("a,b,c,d"))) + } + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameAggregateSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameAggregateSuite.scala index 2293d4ae61aff..c6f6cbdbf02c6 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameAggregateSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameAggregateSuite.scala @@ -17,10 +17,13 @@ package org.apache.spark.sql +import java.time.{Duration, Period} + import scala.util.Random -import org.scalatest.Matchers.the +import org.scalatest.matchers.must.Matchers.the +import org.apache.spark.SparkException import org.apache.spark.sql.execution.WholeStageCodegenExec import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper import org.apache.spark.sql.execution.aggregate.{HashAggregateExec, ObjectHashAggregateExec, SortAggregateExec} @@ -31,7 +34,6 @@ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.test.SQLTestData.DecimalData import org.apache.spark.sql.types._ -import org.apache.spark.unsafe.types.CalendarInterval case class Fact(date: Int, hour: Int, minute: Int, room_name: String, temp: Double) @@ -298,7 +300,7 @@ class DataFrameAggregateSuite extends QueryTest Row(2.0, 2.0)) checkAnswer( - testData2.agg(avg($"a"), sumDistinct($"a")), // non-partial + testData2.agg(avg($"a"), sumDistinct($"a")), // non-partial and test deprecated version Row(2.0, 6.0) :: Nil) checkAnswer( @@ -306,7 +308,7 @@ class DataFrameAggregateSuite extends QueryTest Row(new java.math.BigDecimal(2))) checkAnswer( - decimalData.agg(avg($"a"), sumDistinct($"a")), // non-partial + decimalData.agg(avg($"a"), sum_distinct($"a")), // non-partial Row(new java.math.BigDecimal(2), new java.math.BigDecimal(6)) :: Nil) checkAnswer( @@ -315,7 +317,7 @@ class DataFrameAggregateSuite extends QueryTest // non-partial checkAnswer( decimalData.agg( - avg($"a" cast DecimalType(10, 2)), sumDistinct($"a" cast DecimalType(10, 2))), + avg($"a" cast DecimalType(10, 2)), sum_distinct($"a" cast DecimalType(10, 2))), Row(new java.math.BigDecimal(2), new java.math.BigDecimal(6)) :: Nil) } @@ -325,11 +327,11 @@ class DataFrameAggregateSuite extends QueryTest Row(2.0)) checkAnswer( - testData3.agg(avg($"b"), countDistinct($"b")), + testData3.agg(avg($"b"), count_distinct($"b")), Row(2.0, 1)) checkAnswer( - testData3.agg(avg($"b"), sumDistinct($"b")), // non-partial + testData3.agg(avg($"b"), sum_distinct($"b")), // non-partial Row(2.0, 2.0)) } @@ -340,7 +342,7 @@ class DataFrameAggregateSuite extends QueryTest Row(null)) checkAnswer( - emptyTableData.agg(avg($"a"), sumDistinct($"b")), // non-partial + emptyTableData.agg(avg($"a"), sum_distinct($"b")), // non-partial Row(null, null)) } @@ -348,7 +350,7 @@ class DataFrameAggregateSuite extends QueryTest assert(testData2.count() === testData2.rdd.map(_ => 1).count()) checkAnswer( - testData2.agg(count($"a"), sumDistinct($"a")), // non-partial + testData2.agg(count($"a"), sum_distinct($"a")), // non-partial Row(6, 6.0)) } @@ -365,12 +367,12 @@ class DataFrameAggregateSuite extends QueryTest checkAnswer( testData3.agg( - count($"a"), count($"b"), count(lit(1)), countDistinct($"a"), countDistinct($"b")), + count($"a"), count($"b"), count(lit(1)), count_distinct($"a"), count_distinct($"b")), Row(2, 1, 2, 2, 1) ) checkAnswer( - testData3.agg(count($"b"), countDistinct($"b"), sumDistinct($"b")), // non-partial + testData3.agg(count($"b"), count_distinct($"b"), sum_distinct($"b")), // non-partial Row(1, 1, 2) ) } @@ -385,17 +387,17 @@ class DataFrameAggregateSuite extends QueryTest .toDF("key1", "key2", "key3") checkAnswer( - df1.agg(countDistinct($"key1", $"key2")), + df1.agg(count_distinct($"key1", $"key2")), Row(3) ) checkAnswer( - df1.agg(countDistinct($"key1", $"key2", $"key3")), + df1.agg(count_distinct($"key1", $"key2", $"key3")), Row(3) ) checkAnswer( - df1.groupBy($"key1").agg(countDistinct($"key2", $"key3")), + df1.groupBy($"key1").agg(count_distinct($"key2", $"key3")), Seq(Row("a", 2), Row("x", 1)) ) } @@ -403,7 +405,7 @@ class DataFrameAggregateSuite extends QueryTest test("zero count") { val emptyTableData = Seq.empty[(Int, Int)].toDF("a", "b") checkAnswer( - emptyTableData.agg(count($"a"), sumDistinct($"a")), // non-partial + emptyTableData.agg(count($"a"), sum_distinct($"a")), // non-partial Row(0, null)) } @@ -434,7 +436,7 @@ class DataFrameAggregateSuite extends QueryTest test("zero sum distinct") { val emptyTableData = Seq.empty[(Int, Int)].toDF("a", "b") checkAnswer( - emptyTableData.agg(sumDistinct($"a")), + emptyTableData.agg(sum_distinct($"a")), Row(null)) } @@ -457,25 +459,51 @@ class DataFrameAggregateSuite extends QueryTest } test("zero moments") { - val input = Seq((1, 2)).toDF("a", "b") - checkAnswer( - input.agg(stddev($"a"), stddev_samp($"a"), stddev_pop($"a"), variance($"a"), - var_samp($"a"), var_pop($"a"), skewness($"a"), kurtosis($"a")), - Row(Double.NaN, Double.NaN, 0.0, Double.NaN, Double.NaN, 0.0, - Double.NaN, Double.NaN)) + withSQLConf(SQLConf.LEGACY_STATISTICAL_AGGREGATE.key -> "true") { + val input = Seq((1, 2)).toDF("a", "b") + checkAnswer( + input.agg(stddev($"a"), stddev_samp($"a"), stddev_pop($"a"), variance($"a"), + var_samp($"a"), var_pop($"a"), skewness($"a"), kurtosis($"a")), + Row(Double.NaN, Double.NaN, 0.0, Double.NaN, Double.NaN, 0.0, + Double.NaN, Double.NaN)) - checkAnswer( - input.agg( - expr("stddev(a)"), - expr("stddev_samp(a)"), - expr("stddev_pop(a)"), - expr("variance(a)"), - expr("var_samp(a)"), - expr("var_pop(a)"), - expr("skewness(a)"), - expr("kurtosis(a)")), - Row(Double.NaN, Double.NaN, 0.0, Double.NaN, Double.NaN, 0.0, - Double.NaN, Double.NaN)) + checkAnswer( + input.agg( + expr("stddev(a)"), + expr("stddev_samp(a)"), + expr("stddev_pop(a)"), + expr("variance(a)"), + expr("var_samp(a)"), + expr("var_pop(a)"), + expr("skewness(a)"), + expr("kurtosis(a)")), + Row(Double.NaN, Double.NaN, 0.0, Double.NaN, Double.NaN, 0.0, + Double.NaN, Double.NaN)) + } + } + + test("SPARK-13860: zero moments LEGACY_STATISTICAL_AGGREGATE off") { + withSQLConf(SQLConf.LEGACY_STATISTICAL_AGGREGATE.key -> "false") { + val input = Seq((1, 2)).toDF("a", "b") + checkAnswer( + input.agg(stddev($"a"), stddev_samp($"a"), stddev_pop($"a"), variance($"a"), + var_samp($"a"), var_pop($"a"), skewness($"a"), kurtosis($"a")), + Row(null, null, 0.0, null, null, 0.0, + null, null)) + + checkAnswer( + input.agg( + expr("stddev(a)"), + expr("stddev_samp(a)"), + expr("stddev_pop(a)"), + expr("variance(a)"), + expr("var_samp(a)"), + expr("var_pop(a)"), + expr("skewness(a)"), + expr("kurtosis(a)")), + Row(null, null, 0.0, null, null, 0.0, + null, null)) + } } test("null moments") { @@ -597,7 +625,7 @@ class DataFrameAggregateSuite extends QueryTest val df = Seq((1, 3, "a"), (1, 2, "b"), (3, 4, "c"), (3, 4, "c"), (3, 5, "d")) .toDF("x", "y", "z") checkAnswer( - df.groupBy($"x").agg(countDistinct($"y"), sort_array(collect_list($"z"))), + df.groupBy($"x").agg(count_distinct($"y"), sort_array(collect_list($"z"))), Seq(Row(1, 2, Seq("a", "b")), Row(3, 2, Seq("c", "c", "d")))) } @@ -812,7 +840,7 @@ class DataFrameAggregateSuite extends QueryTest ) } - test("SPARK-27581: DataFrame countDistinct(\"*\") shouldn't fail with AnalysisException") { + test("SPARK-27581: DataFrame count_distinct(\"*\") shouldn't fail with AnalysisException") { val df = sql("select id % 100 from range(100000)") val distinctCount1 = df.select(expr("count(distinct(*))")) val distinctCount2 = df.select(countDistinct("*")) @@ -976,7 +1004,8 @@ class DataFrameAggregateSuite extends QueryTest Seq(true, false).foreach { value => test(s"SPARK-31620: agg with subquery (whole-stage-codegen = $value)") { - withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> value.toString) { + withSQLConf( + SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> value.toString) { withTempView("t1", "t2") { sql("create temporary view t1 as select * from values (1, 2) as t1(a, b)") sql("create temporary view t2 as select * from values (3, 4) as t2(c, d)") @@ -999,17 +1028,175 @@ class DataFrameAggregateSuite extends QueryTest // test SortAggregateExec var df = sql("select max(if(c > (select a from t1), 'str1', 'str2')) as csum from t2") - assert(df.queryExecution.executedPlan - .find { case _: SortAggregateExec => true }.isDefined) + assert(find(df.queryExecution.executedPlan)(_.isInstanceOf[SortAggregateExec]).isDefined) checkAnswer(df, Row("str1") :: Nil) // test ObjectHashAggregateExec df = sql("select collect_list(d), sum(if(c > (select a from t1), d, 0)) as csum from t2") - assert(df.queryExecution.executedPlan - .find { case _: ObjectHashAggregateExec => true }.isDefined) + assert( + find(df.queryExecution.executedPlan)(_.isInstanceOf[ObjectHashAggregateExec]).isDefined) checkAnswer(df, Row(Array(4), 4) :: Nil) } } } } + + test("SPARK-32038: NormalizeFloatingNumbers should work on distinct aggregate") { + withTempView("view") { + val nan1 = java.lang.Float.intBitsToFloat(0x7f800001) + val nan2 = java.lang.Float.intBitsToFloat(0x7fffffff) + + Seq(("mithunr", Float.NaN), + ("mithunr", nan1), + ("mithunr", nan2), + ("abellina", 1.0f), + ("abellina", 2.0f)).toDF("uid", "score").createOrReplaceTempView("view") + + val df = spark.sql("select uid, count(distinct score) from view group by 1 order by 1 asc") + checkAnswer(df, Row("abellina", 2) :: Row("mithunr", 1) :: Nil) + } + } + + test("SPARK-32136: NormalizeFloatingNumbers should work on null struct") { + val df = Seq( + A(None), + A(Some(B(None))), + A(Some(B(Some(1.0))))).toDF + val groupBy = df.groupBy("b").agg(count("*")) + checkAnswer(groupBy, Row(null, 1) :: Row(Row(null), 1) :: Row(Row(1.0), 1) :: Nil) + } + + test("SPARK-32344: Unevaluable's set to FIRST/LAST ignoreNullsExpr in distinct aggregates") { + val queryTemplate = (agg: String) => + s"SELECT $agg(DISTINCT v) FROM (SELECT v FROM VALUES 1, 2, 3 t(v) ORDER BY v)" + checkAnswer(sql(queryTemplate("FIRST")), Row(1)) + checkAnswer(sql(queryTemplate("LAST")), Row(3)) + } + + test("SPARK-32906: struct field names should not change after normalizing floats") { + val df = Seq(Tuple1(Tuple2(-0.0d, Double.NaN)), Tuple1(Tuple2(0.0d, Double.NaN))).toDF("k") + val aggs = df.distinct().queryExecution.sparkPlan.collect { case a: HashAggregateExec => a } + assert(aggs.length == 2) + assert(aggs.head.output.map(_.dataType.simpleString).head === + aggs.last.output.map(_.dataType.simpleString).head) + } + + test("SPARK-33726: Aggregation on a table where a column name is reused") { + val query = + """|with T as ( + |select id as a, -id as x from range(3)), + |U as ( + |select id as b, cast(id as string) as x from range(3)) + |select T.x, U.x, min(a) as ma, min(b) as mb + |from T join U on a=b + |group by U.x, T.x + """.stripMargin + val df = spark.sql(query) + checkAnswer(df, Row(0, "0", 0, 0) :: Row(-1, "1", 1, 1) :: Row(-2, "2", 2, 2) :: Nil) + } + + test("SPARK-34713: group by CreateStruct with ExtractValue") { + val structDF = Seq(Tuple1(1 -> 1)).toDF("col") + checkAnswer(structDF.groupBy(struct($"col._1")).count().select("count"), Row(1)) + + val arrayOfStructDF = Seq(Tuple1(Seq(1 -> 1))).toDF("col") + checkAnswer(arrayOfStructDF.groupBy(struct($"col._1")).count().select("count"), Row(1)) + + val mapDF = Seq(Tuple1(Map("a" -> "a"))).toDF("col") + checkAnswer(mapDF.groupBy(struct($"col.a")).count().select("count"), Row(1)) + + val nonStringMapDF = Seq(Tuple1(Map(1 -> 1))).toDF("col") + // Spark implicit casts string literal "a" to int to match the key type. + checkAnswer(nonStringMapDF.groupBy(struct($"col.a")).count().select("count"), Row(1)) + + val arrayDF = Seq(Tuple1(Seq(1))).toDF("col") + val e = intercept[AnalysisException](arrayDF.groupBy(struct($"col.a")).count()) + assert(e.message.contains("requires integral type")) + } + + test("SPARK-34716: Support ANSI SQL intervals by the aggregate function `sum`") { + val df = Seq((1, Period.ofMonths(10), Duration.ofDays(10)), + (2, Period.ofMonths(1), Duration.ofDays(1)), + (2, null, null), + (3, Period.ofMonths(-3), Duration.ofDays(-6)), + (3, Period.ofMonths(21), Duration.ofDays(-5))) + .toDF("class", "year-month", "day-time") + + val df2 = Seq((Period.ofMonths(Int.MaxValue), Duration.ofDays(106751991)), + (Period.ofMonths(10), Duration.ofDays(10))) + .toDF("year-month", "day-time") + + val sumDF = df.select(sum($"year-month"), sum($"day-time")) + checkAnswer(sumDF, Row(Period.of(2, 5, 0), Duration.ofDays(0))) + assert(find(sumDF.queryExecution.executedPlan)(_.isInstanceOf[HashAggregateExec]).isDefined) + assert(sumDF.schema == StructType(Seq(StructField("sum(year-month)", YearMonthIntervalType), + StructField("sum(day-time)", DayTimeIntervalType)))) + + val sumDF2 = df.groupBy($"class").agg(sum($"year-month"), sum($"day-time")) + checkAnswer(sumDF2, Row(1, Period.ofMonths(10), Duration.ofDays(10)) :: + Row(2, Period.ofMonths(1), Duration.ofDays(1)) :: + Row(3, Period.of(1, 6, 0), Duration.ofDays(-11)) :: Nil) + assert(find(sumDF2.queryExecution.executedPlan)(_.isInstanceOf[HashAggregateExec]).isDefined) + assert(sumDF2.schema == StructType(Seq(StructField("class", IntegerType, false), + StructField("sum(year-month)", YearMonthIntervalType), + StructField("sum(day-time)", DayTimeIntervalType)))) + + val error = intercept[SparkException] { + checkAnswer(df2.select(sum($"year-month")), Nil) + } + assert(error.toString contains "java.lang.ArithmeticException: integer overflow") + + val error2 = intercept[SparkException] { + checkAnswer(df2.select(sum($"day-time")), Nil) + } + assert(error2.toString contains "java.lang.ArithmeticException: long overflow") + } + + test("SPARK-34837: Support ANSI SQL intervals by the aggregate function `avg`") { + val df = Seq((1, Period.ofMonths(10), Duration.ofDays(10)), + (2, Period.ofMonths(1), Duration.ofDays(1)), + (2, null, null), + (3, Period.ofMonths(-3), Duration.ofDays(-6)), + (3, Period.ofMonths(21), Duration.ofDays(-5))) + .toDF("class", "year-month", "day-time") + + val df2 = Seq((Period.ofMonths(Int.MaxValue), Duration.ofDays(106751991)), + (Period.ofMonths(10), Duration.ofDays(10))) + .toDF("year-month", "day-time") + + val avgDF = df.select(avg($"year-month"), avg($"day-time")) + checkAnswer(avgDF, Row(Period.ofMonths(7), Duration.ofDays(0))) + assert(find(avgDF.queryExecution.executedPlan)(_.isInstanceOf[HashAggregateExec]).isDefined) + assert(avgDF.schema == StructType(Seq(StructField("avg(year-month)", YearMonthIntervalType), + StructField("avg(day-time)", DayTimeIntervalType)))) + + val avgDF2 = df.groupBy($"class").agg(avg($"year-month"), avg($"day-time")) + checkAnswer(avgDF2, Row(1, Period.ofMonths(10), Duration.ofDays(10)) :: + Row(2, Period.ofMonths(1), Duration.ofDays(1)) :: + Row(3, Period.ofMonths(9), Duration.ofDays(-5).plusHours(-12)) :: Nil) + assert(find(avgDF2.queryExecution.executedPlan)(_.isInstanceOf[HashAggregateExec]).isDefined) + assert(avgDF2.schema == StructType(Seq(StructField("class", IntegerType, false), + StructField("avg(year-month)", YearMonthIntervalType), + StructField("avg(day-time)", DayTimeIntervalType)))) + + val error = intercept[SparkException] { + checkAnswer(df2.select(avg($"year-month")), Nil) + } + assert(error.toString contains "java.lang.ArithmeticException: integer overflow") + + val error2 = intercept[SparkException] { + checkAnswer(df2.select(avg($"day-time")), Nil) + } + assert(error2.toString contains "java.lang.ArithmeticException: long overflow") + + val df3 = df.filter($"class" > 4) + val avgDF3 = df3.select(avg($"year-month"), avg($"day-time")) + checkAnswer(avgDF3, Row(null, null) :: Nil) + + val avgDF4 = df3.groupBy($"class").agg(avg($"year-month"), avg($"day-time")) + checkAnswer(avgDF4, Nil) + } } + +case class B(c: Option[Double]) +case class A(b: Option[B]) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala index ac98d3f0c7095..eb71f5966a9c9 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameFunctionsSuite.scala @@ -19,17 +19,15 @@ package org.apache.spark.sql import java.nio.charset.StandardCharsets import java.sql.{Date, Timestamp} -import java.util.TimeZone import scala.util.Random import org.apache.spark.SparkException import org.apache.spark.sql.catalyst.InternalRow -import org.apache.spark.sql.catalyst.expressions.Expression +import org.apache.spark.sql.catalyst.expressions.{Expression, UnaryExpression} import org.apache.spark.sql.catalyst.expressions.codegen.CodegenFallback import org.apache.spark.sql.catalyst.plans.logical.OneRowRelation -import org.apache.spark.sql.catalyst.util.DateTimeTestUtils -import org.apache.spark.sql.catalyst.util.DateTimeTestUtils.UTC +import org.apache.spark.sql.catalyst.util.DateTimeTestUtils.{withDefaultTimeZone, UTC} import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession @@ -173,10 +171,10 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSparkSession { ) } - test("bitwiseNOT") { + test("bitwise_not") { checkAnswer( - testData2.select(bitwiseNOT($"a")), - testData2.collect().toSeq.map(r => Row(~r.getInt(0)))) + testData2.select(bitwiseNOT($"a"), bitwise_not($"a")), + testData2.collect().toSeq.map(r => Row(~r.getInt(0), ~r.getInt(0)))) } test("bin") { @@ -465,7 +463,7 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSparkSession { assert(intercept[AnalysisException] { df3.selectExpr("array_sort(a)").collect() - }.getMessage().contains("argument 1 requires array type, however, '`a`' is of string type")) + }.getMessage().contains("argument 1 requires array type, however, 'a' is of string type")) } def testSizeOfArray(sizeOfNull: Any): Unit = { @@ -938,11 +936,21 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSparkSession { val answer = Seq(Row(Seq(2, 3)), Row(Seq(5))) checkAnswer(df.select(slice(df("x"), 2, 2)), answer) + checkAnswer(df.select(slice(df("x"), lit(2), lit(2))), answer) checkAnswer(df.selectExpr("slice(x, 2, 2)"), answer) val answerNegative = Seq(Row(Seq(3)), Row(Seq(5))) checkAnswer(df.select(slice(df("x"), -1, 1)), answerNegative) + checkAnswer(df.select(slice(df("x"), lit(-1), lit(1))), answerNegative) checkAnswer(df.selectExpr("slice(x, -1, 1)"), answerNegative) + + val answerStartExpr = Seq(Row(Seq(2)), Row(Seq(4))) + checkAnswer(df.select(slice(df("x"), size($"x") - 1, lit(1))), answerStartExpr) + checkAnswer(df.selectExpr("slice(x, size(x) - 1, 1)"), answerStartExpr) + + val answerLengthExpr = Seq(Row(Seq(1, 2)), Row(Seq(4))) + checkAnswer(df.select(slice(df("x"), lit(1), size($"x") - 1)), answerLengthExpr) + checkAnswer(df.selectExpr("slice(x, 1, size(x) - 1)"), answerLengthExpr) } test("array_join function") { @@ -1029,7 +1037,7 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSparkSession { Timestamp.valueOf("2018-01-01 12:00:00"), Timestamp.valueOf("2018-01-02 00:00:00"))))) - DateTimeTestUtils.withDefaultTimeZone(UTC) { + withDefaultTimeZone(UTC) { checkAnswer( spark.sql("select sequence(" + " cast('2018-01-01' as date)" + @@ -2250,7 +2258,7 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSparkSession { val ex3 = intercept[AnalysisException] { df.selectExpr("transform(a, x -> x)") } - assert(ex3.getMessage.contains("cannot resolve '`a`'")) + assert(ex3.getMessage.contains("cannot resolve 'a'")) } test("map_filter") { @@ -2321,7 +2329,7 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSparkSession { val ex4 = intercept[AnalysisException] { df.selectExpr("map_filter(a, (k, v) -> k > v)") } - assert(ex4.getMessage.contains("cannot resolve '`a`'")) + assert(ex4.getMessage.contains("cannot resolve 'a'")) } test("filter function - array for primitive type not containing null") { @@ -2480,7 +2488,7 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSparkSession { val ex4 = intercept[AnalysisException] { df.selectExpr("filter(a, x -> x)") } - assert(ex4.getMessage.contains("cannot resolve '`a`'")) + assert(ex4.getMessage.contains("cannot resolve 'a'")) } test("exists function - array for primitive type not containing null") { @@ -2612,7 +2620,7 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSparkSession { val ex4 = intercept[AnalysisException] { df.selectExpr("exists(a, x -> x)") } - assert(ex4.getMessage.contains("cannot resolve '`a`'")) + assert(ex4.getMessage.contains("cannot resolve 'a'")) } test("forall function - array for primitive type not containing null") { @@ -2758,12 +2766,12 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSparkSession { val ex4 = intercept[AnalysisException] { df.selectExpr("forall(a, x -> x)") } - assert(ex4.getMessage.contains("cannot resolve '`a`'")) + assert(ex4.getMessage.contains("cannot resolve 'a'")) val ex4a = intercept[AnalysisException] { df.select(forall(col("a"), x => x)) } - assert(ex4a.getMessage.contains("cannot resolve '`a`'")) + assert(ex4a.getMessage.contains("cannot resolve 'a'")) } test("aggregate function - array for primitive type not containing null") { @@ -2940,7 +2948,7 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSparkSession { val ex5 = intercept[AnalysisException] { df.selectExpr("aggregate(a, 0, (acc, x) -> x)") } - assert(ex5.getMessage.contains("cannot resolve '`a`'")) + assert(ex5.getMessage.contains("cannot resolve 'a'")) } test("map_zip_with function - map of primitive types") { @@ -3493,7 +3501,7 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSparkSession { val ex4 = intercept[AnalysisException] { df.selectExpr("zip_with(a1, a, (acc, x) -> x)") } - assert(ex4.getMessage.contains("cannot resolve '`a`'")) + assert(ex4.getMessage.contains("cannot resolve 'a'")) } private def assertValuesDoNotChangeAfterCoalesceOrUnion(v: Column): Unit = { @@ -3621,14 +3629,38 @@ class DataFrameFunctionsSuite extends QueryTest with SharedSparkSession { df.select(map(map_entries($"m"), lit(1))), Row(Map(Seq(Row(1, "a")) -> 1))) } + + test("SPARK-34794: lambda variable name issues in nested functions") { + val df1 = Seq((Seq(1, 2), Seq("a", "b"))).toDF("numbers", "letters") + + checkAnswer(df1.select(flatten(transform($"numbers", (number: Column) => + transform($"letters", (letter: Column) => + struct(number, letter))))), + Seq(Row(Seq(Row(1, "a"), Row(1, "b"), Row(2, "a"), Row(2, "b")))) + ) + checkAnswer(df1.select(flatten(transform($"numbers", (number: Column, i: Column) => + transform($"letters", (letter: Column, j: Column) => + struct(number + j, concat(letter, i)))))), + Seq(Row(Seq(Row(1, "a0"), Row(2, "b0"), Row(2, "a1"), Row(3, "b1")))) + ) + + val df2 = Seq((Map("a" -> 1, "b" -> 2), Map("a" -> 2, "b" -> 3))).toDF("m1", "m2") + + checkAnswer(df2.select(map_zip_with($"m1", $"m2", (k1: Column, ov1: Column, ov2: Column) => + map_zip_with($"m1", $"m2", (k2: Column, iv1: Column, iv2: Column) => + ov1 + iv1 + ov2 + iv2))), + Seq(Row(Map("a" -> Map("a" -> 6, "b" -> 8), "b" -> Map("a" -> 8, "b" -> 10)))) + ) + } } object DataFrameFunctionsSuite { - case class CodegenFallbackExpr(child: Expression) extends Expression with CodegenFallback { - override def children: Seq[Expression] = Seq(child) + case class CodegenFallbackExpr(child: Expression) extends UnaryExpression with CodegenFallback { override def nullable: Boolean = child.nullable override def dataType: DataType = child.dataType override lazy val resolved = true override def eval(input: InternalRow): Any = child.eval(input) + override protected def withNewChildInternal(newChild: Expression): CodegenFallbackExpr = + copy(child = newChild) } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameJoinSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameJoinSuite.scala index 6b772e53ac184..a803fa88ed313 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameJoinSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameJoinSuite.scala @@ -17,18 +17,22 @@ package org.apache.spark.sql +import scala.collection.JavaConverters._ + import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.plans.{Inner, InnerLike, LeftOuter, RightOuter} import org.apache.spark.sql.catalyst.plans.logical.{BROADCAST, Filter, HintInfo, Join, JoinHint, LogicalPlan, Project} import org.apache.spark.sql.connector.catalog.CatalogManager import org.apache.spark.sql.execution.FileSourceScanExec import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper +import org.apache.spark.sql.execution.analysis.DetectAmbiguousSelfJoin.LogicalPlanWithDatasetId import org.apache.spark.sql.execution.datasources.LogicalRelation import org.apache.spark.sql.execution.exchange.BroadcastExchangeExec import org.apache.spark.sql.execution.joins.BroadcastHashJoinExec import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types._ class DataFrameJoinSuite extends QueryTest with SharedSparkSession @@ -119,6 +123,16 @@ class DataFrameJoinSuite extends QueryTest df2.crossJoin(df1), Row(2, "2", 1, "1") :: Row(2, "2", 3, "3") :: Row(4, "4", 1, "1") :: Row(4, "4", 3, "3") :: Nil) + + checkAnswer( + df1.join(df2, Nil, "cross"), + Row(1, "1", 2, "2") :: Row(1, "1", 4, "4") :: + Row(3, "3", 2, "2") :: Row(3, "3", 4, "4") :: Nil) + + checkAnswer( + df2.join(df1, Nil, "cross"), + Row(2, "2", 1, "1") :: Row(2, "2", 3, "3") :: + Row(4, "4", 1, "1") :: Row(4, "4", 3, "3") :: Nil) } test("broadcast join hint using broadcast function") { @@ -261,7 +275,16 @@ class DataFrameJoinSuite extends QueryTest withSQLConf(SQLConf.CROSS_JOINS_ENABLED.key -> "false") { val df = spark.range(2) // this throws an exception before the fix - df.join(df, df("id") <=> df("id")).queryExecution.optimizedPlan + val plan = df.join(df, df("id") <=> df("id")).queryExecution.optimizedPlan + + plan match { + // SPARK-34178: we can't match the plan before the fix due to + // the right side plan doesn't contains dataset id. + case Join( + LogicalPlanWithDatasetId(_, leftId), + LogicalPlanWithDatasetId(_, rightId), _, _, _) => + assert(leftId === rightId) + } } } @@ -338,14 +361,14 @@ class DataFrameJoinSuite extends QueryTest def checkIfHintApplied(df: DataFrame): Unit = { val sparkPlan = df.queryExecution.executedPlan - val broadcastHashJoins = sparkPlan.collect { case p: BroadcastHashJoinExec => p } + val broadcastHashJoins = collect(sparkPlan) { case p: BroadcastHashJoinExec => p } assert(broadcastHashJoins.size == 1) val broadcastExchanges = broadcastHashJoins.head.collect { case p: BroadcastExchangeExec => p } assert(broadcastExchanges.size == 1) val tables = broadcastExchanges.head.collect { - case FileSourceScanExec(_, _, _, _, _, _, Some(tableIdent)) => tableIdent + case FileSourceScanExec(_, _, _, _, _, _, _, Some(tableIdent), _) => tableIdent } assert(tables.size == 1) assert(tables.head === TableIdentifier(table1Name, Some(dbName))) @@ -353,7 +376,7 @@ class DataFrameJoinSuite extends QueryTest def checkIfHintNotApplied(df: DataFrame): Unit = { val sparkPlan = df.queryExecution.executedPlan - val broadcastHashJoins = sparkPlan.collect { case p: BroadcastHashJoinExec => p } + val broadcastHashJoins = collect(sparkPlan) { case p: BroadcastHashJoinExec => p } assert(broadcastHashJoins.isEmpty) } @@ -418,4 +441,62 @@ class DataFrameJoinSuite extends QueryTest } } } + + test("SPARK-32693: Compare two dataframes with same schema except nullable property") { + val schema1 = StructType( + StructField("a", IntegerType, false) :: + StructField("b", IntegerType, false) :: + StructField("c", IntegerType, false) :: Nil) + val rowSeq1: List[Row] = List(Row(10, 1, 1), Row(10, 50, 2)) + val df1 = spark.createDataFrame(rowSeq1.asJava, schema1) + + val schema2 = StructType( + StructField("a", IntegerType) :: + StructField("b", IntegerType) :: + StructField("c", IntegerType) :: Nil) + val rowSeq2: List[Row] = List(Row(10, 1, 1)) + val df2 = spark.createDataFrame(rowSeq2.asJava, schema2) + + checkAnswer(df1.except(df2), Row(10, 50, 2)) + + val schema3 = StructType( + StructField("a", IntegerType, false) :: + StructField("b", IntegerType, false) :: + StructField("c", IntegerType, false) :: + StructField("d", schema1, false) :: Nil) + val rowSeq3: List[Row] = List(Row(10, 1, 1, Row(10, 1, 1)), Row(10, 50, 2, Row(10, 50, 2))) + val df3 = spark.createDataFrame(rowSeq3.asJava, schema3) + + val schema4 = StructType( + StructField("a", IntegerType) :: + StructField("b", IntegerType) :: + StructField("b", IntegerType) :: + StructField("d", schema2) :: Nil) + val rowSeq4: List[Row] = List(Row(10, 1, 1, Row(10, 1, 1))) + val df4 = spark.createDataFrame(rowSeq4.asJava, schema4) + + checkAnswer(df3.except(df4), Row(10, 50, 2, Row(10, 50, 2))) + } + + test("SPARK-34527: Resolve common columns from USING JOIN") { + val joinDf = testData2.as("testData2").join( + testData3.as("testData3"), usingColumns = Seq("a"), joinType = "fullouter") + val dfQuery = joinDf.select( + $"a", $"testData2.a", $"testData2.b", $"testData3.a", $"testData3.b") + val dfQuery2 = joinDf.select( + $"a", testData2.col("a"), testData2.col("b"), testData3.col("a"), testData3.col("b")) + + Seq(dfQuery, dfQuery2).map { query => + checkAnswer(query, + Seq( + Row(1, 1, 1, 1, null), + Row(1, 1, 2, 1, null), + Row(2, 2, 1, 2, 2), + Row(2, 2, 2, 2, 2), + Row(3, 3, 1, null, null), + Row(3, 3, 2, null, null) + ) + ) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameNaFunctionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameNaFunctionsSuite.scala index 091877f7cac37..20ae995af628b 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameNaFunctionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameNaFunctionsSuite.scala @@ -460,4 +460,66 @@ class DataFrameNaFunctionsSuite extends QueryTest with SharedSparkSession { Row(0, 0L, 0.toShort, 0.toByte, Float.NaN, Double.NaN) :: Row(0, 0L, 0.toShort, 0.toByte, Float.NaN, Double.NaN) :: Nil) } + + test("SPARK-34417: test fillMap() for column with a dot in the name") { + val na = "n/a" + checkAnswer( + Seq(("abc", 23L), ("def", 44L), (null, 0L)).toDF("ColWith.Dot", "Col") + .na.fill(Map("`ColWith.Dot`" -> na)), + Row("abc", 23) :: Row("def", 44L) :: Row(na, 0L) :: Nil) + } + + test("SPARK-34417: test fillMap() for qualified-column with a dot in the name") { + val na = "n/a" + checkAnswer( + Seq(("abc", 23L), ("def", 44L), (null, 0L)).toDF("ColWith.Dot", "Col").as("testDF") + .na.fill(Map("testDF.`ColWith.Dot`" -> na)), + Row("abc", 23) :: Row("def", 44L) :: Row(na, 0L) :: Nil) + } + + test("SPARK-34417: test fillMap() for column without a dot in the name" + + " and dataframe with another column having a dot in the name") { + val na = "n/a" + checkAnswer( + Seq(("abc", 23L), ("def", 44L), (null, 0L)).toDF("Col", "ColWith.Dot") + .na.fill(Map("Col" -> na)), + Row("abc", 23) :: Row("def", 44L) :: Row(na, 0L) :: Nil) + } + + test("SPARK-34649: replace value of a column with dot in the name") { + checkAnswer( + Seq(("abc", 23), ("def", 44), ("n/a", 0)).toDF("Col.1", "Col.2") + .na.replace("`Col.1`", Map( "n/a" -> "unknown")), + Row("abc", 23) :: Row("def", 44L) :: Row("unknown", 0L) :: Nil) + } + + test("SPARK-34649: replace value of a qualified-column with dot in the name") { + checkAnswer( + Seq(("abc", 23), ("def", 44), ("n/a", 0)).toDF("Col.1", "Col.2").as("testDf") + .na.replace("testDf.`Col.1`", Map( "n/a" -> "unknown")), + Row("abc", 23) :: Row("def", 44L) :: Row("unknown", 0L) :: Nil) + } + + test("SPARK-34649: replace value of a dataframe having dot in the all column names") { + checkAnswer( + Seq(("abc", 23), ("def", 44), ("n/a", 0)).toDF("Col.1", "Col.2") + .na.replace("*", Map( "n/a" -> "unknown")), + Row("abc", 23) :: Row("def", 44L) :: Row("unknown", 0L) :: Nil) + } + + test("SPARK-34649: replace value of a column not present in the dataframe") { + val df = Seq(("abc", 23), ("def", 44), ("n/a", 0)).toDF("Col.1", "Col.2") + val exception = intercept[AnalysisException] { + df.na.replace("aa", Map( "n/a" -> "unknown")) + } + assert(exception.getMessage.equals("Cannot resolve column name \"aa\" among (Col.1, Col.2)")) + } + + test("SPARK-34649: replace value of a nested column") { + val df = createDFWithNestedColumns + val exception = intercept[UnsupportedOperationException] { + df.na.replace("c1.c1-1", Map("b1" ->"a1")) + } + assert(exception.getMessage.equals("Nested field c1.c1-1 is not supported.")) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSelfJoinSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSelfJoinSuite.scala index 250ec7dc0ba5a..76f07b5b0132d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSelfJoinSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSelfJoinSuite.scala @@ -17,9 +17,11 @@ package org.apache.spark.sql +import org.apache.spark.sql.expressions.Window import org.apache.spark.sql.functions.{count, sum} import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.test.SQLTestData.TestData class DataFrameSelfJoinSuite extends QueryTest with SharedSparkSession { import testImplicits._ @@ -202,4 +204,57 @@ class DataFrameSelfJoinSuite extends QueryTest with SharedSparkSession { assertAmbiguousSelfJoin(df1.join(df4).join(df2).select(df2("id"))) } } + + test("SPARK-28344: don't fail if there is no ambiguous self join") { + withSQLConf( + SQLConf.FAIL_AMBIGUOUS_SELF_JOIN_ENABLED.key -> "true") { + val df = Seq(1, 1, 2, 2).toDF("a") + val w = Window.partitionBy(df("a")) + checkAnswer( + df.select(df("a").alias("x"), sum(df("a")).over(w)), + Seq((1, 2), (1, 2), (2, 4), (2, 4)).map(Row.fromTuple)) + + val joined = df.join(spark.range(1)).select($"a") + checkAnswer( + joined.select(joined("a").alias("x"), sum(joined("a")).over(w)), + Seq((1, 2), (1, 2), (2, 4), (2, 4)).map(Row.fromTuple)) + } + } + + test("SPARK-33071/SPARK-33536: Avoid changing dataset_id of LogicalPlan in join() " + + "to not break DetectAmbiguousSelfJoin") { + val emp1 = Seq[TestData]( + TestData(1, "sales"), + TestData(2, "personnel"), + TestData(3, "develop"), + TestData(4, "IT")).toDS() + val emp2 = Seq[TestData]( + TestData(1, "sales"), + TestData(2, "personnel"), + TestData(3, "develop")).toDS() + val emp3 = emp1.join(emp2, emp1("key") === emp2("key")).select(emp1("*")) + assertAmbiguousSelfJoin(emp1.join(emp3, emp1.col("key") === emp3.col("key"), + "left_outer").select(emp1.col("*"), emp3.col("key").as("e2"))) + } + + test("df.show() should also not change dataset_id of LogicalPlan") { + val df = Seq[TestData]( + TestData(1, "sales"), + TestData(2, "personnel"), + TestData(3, "develop"), + TestData(4, "IT")).toDF() + val ds_id1 = df.logicalPlan.getTagValue(Dataset.DATASET_ID_TAG) + df.show(0) + val ds_id2 = df.logicalPlan.getTagValue(Dataset.DATASET_ID_TAG) + assert(ds_id1 === ds_id2) + } + + test("SPARK-34200: ambiguous column reference should consider attribute availability") { + withTable("t") { + sql("CREATE TABLE t USING json AS SELECT 1 a, 2 b") + val df1 = spark.table("t") + val df2 = df1.select("a") + checkAnswer(df1.join(df2, df1("b") === 2), Row(1, 2, 1)) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSetOperationsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSetOperationsSuite.scala index bd3f48078374d..797673ae15ba8 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSetOperationsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSetOperationsSuite.scala @@ -19,10 +19,11 @@ package org.apache.spark.sql import java.sql.{Date, Timestamp} +import org.apache.spark.sql.catalyst.optimizer.RemoveNoopUnion import org.apache.spark.sql.catalyst.plans.logical.Union import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.sql.test.{ExamplePoint, ExamplePointUDT, SharedSparkSession} +import org.apache.spark.sql.test.{ExamplePoint, ExamplePointUDT, SharedSparkSession, SQLTestData} import org.apache.spark.sql.test.SQLTestData.NullStrings import org.apache.spark.sql.types._ @@ -297,13 +298,12 @@ class DataFrameSetOperationsSuite extends QueryTest with SharedSparkSession { // When generating expected results at here, we need to follow the implementation of // Rand expression. - def expected(df: DataFrame): Seq[Row] = { + def expected(df: DataFrame): Seq[Row] = df.rdd.collectPartitions().zipWithIndex.flatMap { case (data, index) => val rng = new org.apache.spark.util.random.XORShiftRandom(7 + index) data.filter(_.getInt(0) < rng.nextDouble() * 10) - } - } + }.toSeq val union = df1.union(df2) checkAnswer( @@ -372,7 +372,7 @@ class DataFrameSetOperationsSuite extends QueryTest with SharedSparkSession { // Before optimizer, Union should be combined. assert(unionDF.queryExecution.analyzed.collect { - case j: Union if j.children.size == 5 => j }.size === 1) + case u: Union if u.children.size == 5 => u }.size === 1) checkAnswer( unionDF.agg(avg("key"), max("key"), min("key"), sum("key")), @@ -386,6 +386,109 @@ class DataFrameSetOperationsSuite extends QueryTest with SharedSparkSession { checkAnswer(unionDF, unionAllDF) } + test("SPARK-34283: SQL-style union using Dataset, " + + "remove unnecessary deduplicate in multiple unions") { + withSQLConf(SQLConf.OPTIMIZER_EXCLUDED_RULES.key -> RemoveNoopUnion.ruleName) { + val unionDF = testData.union(testData).distinct().union(testData).distinct() + .union(testData).distinct().union(testData).distinct() + + // Before optimizer, there are three 'union.deduplicate' operations should be combined. + assert(unionDF.queryExecution.analyzed.collect { + case u: Union if u.children.size == 4 => u + }.size === 1) + + // After optimizer, four 'union.deduplicate' operations should be combined. + assert(unionDF.queryExecution.optimizedPlan.collect { + case u: Union if u.children.size == 5 => u + }.size === 1) + + checkAnswer( + unionDF.agg(avg("key"), max("key"), min("key"), + sum("key")), Row(50.5, 100, 1, 5050) :: Nil + ) + + // The result of SQL-style union + val unionSQLResult = sql( + """ + | select key, value from testData + | union + | select key, value from testData + | union + | select key, value from testData + | union + | select key, value from testData + | union + | select key, value from testData + |""".stripMargin) + checkAnswer(unionDF, unionSQLResult) + } + } + + test("SPARK-34283: SQL-style union using Dataset, " + + "keep necessary deduplicate in multiple unions") { + withSQLConf(SQLConf.OPTIMIZER_EXCLUDED_RULES.key -> RemoveNoopUnion.ruleName) { + val df1 = Seq((1, 2, 3)).toDF("a", "b", "c") + var df2 = Seq((6, 2, 5)).toDF("a", "b", "c") + var df3 = Seq((2, 4, 3)).toDF("c", "a", "b") + var df4 = Seq((1, 4, 5)).toDF("b", "a", "c") + + val unionDF = df1.unionByName(df2).dropDuplicates(Seq("a")) + .unionByName(df3).dropDuplicates("c").unionByName(df4) + .dropDuplicates("b") + + // In this case, there is no 'union.deduplicate' operation will be combined. + assert(unionDF.queryExecution.analyzed.collect { + case u: Union if u.children.size == 2 => u + }.size === 3) + + assert(unionDF.queryExecution.optimizedPlan.collect { + case u: Union if u.children.size == 2 => u + }.size === 3) + + checkAnswer( + unionDF, + Row(4, 3, 2) :: Row(4, 1, 5) :: Row(1, 2, 3) :: Nil + ) + + val unionDF1 = df1.unionByName(df2).dropDuplicates(Seq("B", "A", "c")) + .unionByName(df3).dropDuplicates().unionByName(df4) + .dropDuplicates("A") + + // In this case, there are two 'union.deduplicate' operations will be combined. + assert(unionDF1.queryExecution.analyzed.collect { + case u: Union if u.children.size == 2 => u + }.size === 1) + assert(unionDF1.queryExecution.analyzed.collect { + case u: Union if u.children.size == 3 => u + }.size === 1) + + assert(unionDF1.queryExecution.optimizedPlan.collect { + case u: Union if u.children.size == 2 => u + }.size === 1) + assert(unionDF1.queryExecution.optimizedPlan.collect { + case u: Union if u.children.size == 3 => u + }.size === 1) + + checkAnswer( + unionDF1, + Row(4, 3, 2) :: Row(6, 2, 5) :: Row(1, 2, 3) :: Nil + ) + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + df2 = Seq((6, 2, 5)).toDF("a", "B", "C") + df3 = Seq((2, 1, 3)).toDF("b", "a", "c") + df4 = Seq((1, 4, 5)).toDF("b", "a", "c") + + val unionDF2 = df1.unionByName(df2, true).distinct() + .unionByName(df3, true).dropDuplicates(Seq("a")).unionByName(df4, true).distinct() + + checkAnswer(unionDF2, + Row(4, 1, 5, null, null) :: Row(1, 2, 3, null, null) :: Row(6, null, null, 2, 5) :: Nil) + assert(unionDF2.schema.fieldNames === Array("a", "b", "c", "B", "C")) + } + } + } + test("union should union DataFrames with UDTs (SPARK-13410)") { val rowRDD1 = sparkContext.parallelize(Seq(Row(1, new ExamplePoint(1.0, 2.0)))) val schema1 = StructType(Array(StructField("label", IntegerType, false), @@ -506,4 +609,280 @@ class DataFrameSetOperationsSuite extends QueryTest with SharedSparkSession { check(lit(2).cast("int"), $"c" === 2, Seq(Row(1, 1, 2, 0), Row(1, 1, 2, 1))) check(lit(2).cast("int"), $"c" =!= 2, Seq()) } + + test("SPARK-29358: Make unionByName optionally fill missing columns with nulls") { + var df1 = Seq(1, 2, 3).toDF("a") + var df2 = Seq(3, 1, 2).toDF("b") + val df3 = Seq(2, 3, 1).toDF("c") + val unionDf = df1.unionByName(df2.unionByName(df3, true), true) + checkAnswer(unionDf, + Row(1, null, null) :: Row(2, null, null) :: Row(3, null, null) :: // df1 + Row(null, 3, null) :: Row(null, 1, null) :: Row(null, 2, null) :: // df2 + Row(null, null, 2) :: Row(null, null, 3) :: Row(null, null, 1) :: Nil // df3 + ) + + df1 = Seq((1, 2)).toDF("a", "c") + df2 = Seq((3, 4, 5)).toDF("a", "b", "c") + checkAnswer(df1.unionByName(df2, true), + Row(1, 2, null) :: Row(3, 5, 4) :: Nil) + checkAnswer(df2.unionByName(df1, true), + Row(3, 4, 5) :: Row(1, null, 2) :: Nil) + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + df2 = Seq((3, 4, 5)).toDF("a", "B", "C") + val union1 = df1.unionByName(df2, true) + val union2 = df2.unionByName(df1, true) + + checkAnswer(union1, Row(1, 2, null, null) :: Row(3, null, 4, 5) :: Nil) + checkAnswer(union2, Row(3, 4, 5, null) :: Row(1, null, null, 2) :: Nil) + + assert(union1.schema.fieldNames === Array("a", "c", "B", "C")) + assert(union2.schema.fieldNames === Array("a", "B", "C", "c")) + } + } + + test("SPARK-32376: Make unionByName null-filling behavior work with struct columns - simple") { + val df1 = Seq(((1, 2, 3), 0), ((2, 3, 4), 1), ((3, 4, 5), 2)).toDF("a", "idx") + val df2 = Seq(((3, 4), 0), ((1, 2), 1), ((2, 3), 2)).toDF("a", "idx") + val df3 = Seq(((100, 101, 102, 103), 0), ((110, 111, 112, 113), 1), ((120, 121, 122, 123), 2)) + .toDF("a", "idx") + + var unionDf = df1.unionByName(df2, true) + + checkAnswer(unionDf, + Row(Row(1, 2, 3), 0) :: Row(Row(2, 3, 4), 1) :: Row(Row(3, 4, 5), 2) :: + Row(Row(3, 4, null), 0) :: Row(Row(1, 2, null), 1) :: Row(Row(2, 3, null), 2) :: Nil + ) + + assert(unionDf.schema.toDDL == "`a` STRUCT<`_1`: INT, `_2`: INT, `_3`: INT>,`idx` INT") + + unionDf = df1.unionByName(df2, true).unionByName(df3, true) + + checkAnswer(unionDf, + Row(Row(1, 2, 3, null), 0) :: + Row(Row(2, 3, 4, null), 1) :: + Row(Row(3, 4, 5, null), 2) :: // df1 + Row(Row(3, 4, null, null), 0) :: + Row(Row(1, 2, null, null), 1) :: + Row(Row(2, 3, null, null), 2) :: // df2 + Row(Row(100, 101, 102, 103), 0) :: + Row(Row(110, 111, 112, 113), 1) :: + Row(Row(120, 121, 122, 123), 2) :: Nil // df3 + ) + assert(unionDf.schema.toDDL == + "`a` STRUCT<`_1`: INT, `_2`: INT, `_3`: INT, `_4`: INT>,`idx` INT") + } + + test("SPARK-32376: Make unionByName null-filling behavior work with struct columns - nested") { + val df1 = Seq((0, UnionClass1a(0, 1L, UnionClass2(1, "2")))).toDF("id", "a") + val df2 = Seq((1, UnionClass1b(1, 2L, UnionClass3(2, 3L)))).toDF("id", "a") + + val expectedSchema = "`id` INT,`a` STRUCT<`a`: INT, `b`: BIGINT, " + + "`nested`: STRUCT<`a`: INT, `b`: BIGINT, `c`: STRING>>" + + var unionDf = df1.unionByName(df2, true) + checkAnswer(unionDf, + Row(0, Row(0, 1, Row(1, null, "2"))) :: + Row(1, Row(1, 2, Row(2, 3L, null))) :: Nil) + assert(unionDf.schema.toDDL == expectedSchema) + + unionDf = df2.unionByName(df1, true) + checkAnswer(unionDf, + Row(1, Row(1, 2, Row(2, 3L, null))) :: + Row(0, Row(0, 1, Row(1, null, "2"))) :: Nil) + assert(unionDf.schema.toDDL == expectedSchema) + + val df3 = Seq((2, UnionClass1b(2, 3L, null))).toDF("id", "a") + unionDf = df1.unionByName(df3, true) + checkAnswer(unionDf, + Row(0, Row(0, 1, Row(1, null, "2"))) :: + Row(2, Row(2, 3, null)) :: Nil) + assert(unionDf.schema.toDDL == expectedSchema) + } + + test("SPARK-32376: Make unionByName null-filling behavior work with struct columns" + + " - case-sensitive cases") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + val df1 = Seq((0, UnionClass1a(0, 1L, UnionClass2(1, "2")))).toDF("id", "a") + val df2 = Seq((1, UnionClass1c(1, 2L, UnionClass4(2, 3L)))).toDF("id", "a") + + var unionDf = df1.unionByName(df2, true) + checkAnswer(unionDf, + Row(0, Row(0, 1, Row(null, 1, null, "2"))) :: + Row(1, Row(1, 2, Row(2, null, 3L, null))) :: Nil) + assert(unionDf.schema.toDDL == + "`id` INT,`a` STRUCT<`a`: INT, `b`: BIGINT, " + + "`nested`: STRUCT<`A`: INT, `a`: INT, `b`: BIGINT, `c`: STRING>>") + + unionDf = df2.unionByName(df1, true) + checkAnswer(unionDf, + Row(1, Row(1, 2, Row(2, null, 3L, null))) :: + Row(0, Row(0, 1, Row(null, 1, null, "2"))) :: Nil) + assert(unionDf.schema.toDDL == + "`id` INT,`a` STRUCT<`a`: INT, `b`: BIGINT, " + + "`nested`: STRUCT<`A`: INT, `a`: INT, `b`: BIGINT, `c`: STRING>>") + + val df3 = Seq((2, UnionClass1b(2, 3L, UnionClass3(4, 5L)))).toDF("id", "a") + unionDf = df2.unionByName(df3, true) + checkAnswer(unionDf, + Row(1, Row(1, 2, Row(2, null, 3L))) :: + Row(2, Row(2, 3, Row(null, 4, 5L))) :: Nil) + assert(unionDf.schema.toDDL == + "`id` INT,`a` STRUCT<`a`: INT, `b`: BIGINT, " + + "`nested`: STRUCT<`A`: INT, `a`: INT, `b`: BIGINT>>") + } + } + + test("SPARK-32376: Make unionByName null-filling behavior work with struct columns - edge case") { + val nestedStructType1 = StructType(Seq( + StructField("b", StringType))) + val nestedStructValues1 = Row("b") + + val nestedStructType2 = StructType(Seq( + StructField("b", StringType), + StructField("a", StringType))) + val nestedStructValues2 = Row("b", "a") + + val df1: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(nestedStructValues1) :: Nil), + StructType(Seq(StructField("topLevelCol", nestedStructType1)))) + + val df2: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(nestedStructValues2) :: Nil), + StructType(Seq(StructField("topLevelCol", nestedStructType2)))) + + val union = df1.unionByName(df2, allowMissingColumns = true) + checkAnswer(union, Row(Row(null, "b")) :: Row(Row("a", "b")) :: Nil) + assert(union.schema.toDDL == "`topLevelCol` STRUCT<`a`: STRING, `b`: STRING>") + } + + test("SPARK-32376: Make unionByName null-filling behavior work with struct columns - deep expr") { + def nestedDf(depth: Int, numColsAtEachDepth: Int): DataFrame = { + val initialNestedStructType = StructType( + (0 to numColsAtEachDepth).map(i => + StructField(s"nested${depth}Col$i", IntegerType, nullable = false)) + ) + val initialNestedValues = Row(0 to numColsAtEachDepth: _*) + + var depthCounter = depth - 1 + var structType = initialNestedStructType + var struct = initialNestedValues + while (depthCounter != 0) { + struct = Row((struct +: (1 to numColsAtEachDepth)): _*) + structType = StructType( + StructField(s"nested${depthCounter}Col0", structType, nullable = false) +: + (1 to numColsAtEachDepth).map(i => + StructField(s"nested${depthCounter}Col$i", IntegerType, nullable = false)) + ) + depthCounter -= 1 + } + + val df: DataFrame = spark.createDataFrame( + sparkContext.parallelize(Row(struct) :: Nil), + StructType(Seq(StructField("nested0Col0", structType)))) + + df + } + + val df1 = nestedDf(depth = 10, numColsAtEachDepth = 1) + val df2 = nestedDf(depth = 10, numColsAtEachDepth = 20) + val union = df1.unionByName(df2, allowMissingColumns = true) + // scalastyle:off + val row1 = Row(Row(Row(Row(Row(Row(Row(Row(Row(Row( + Row(0, 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null), + 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null), + 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null), + 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null), + 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null), + 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null), + 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null), + 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null), + 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null), + 1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null)) + val row2 = Row(Row(Row(Row(Row(Row(Row(Row(Row(Row( + Row(0, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9), + 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9), + 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9), + 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9), + 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9), + 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9), + 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9), + 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9), + 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9), + 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9)) + // scalastyle:on + checkAnswer(union, row1 :: row2 :: Nil) + } + + test("SPARK-34474: Remove unnecessary Union under Distinct") { + Seq(RemoveNoopUnion.ruleName, "").map { ruleName => + withSQLConf(SQLConf.OPTIMIZER_EXCLUDED_RULES.key -> ruleName) { + val distinctUnionDF1 = testData.union(testData).distinct() + checkAnswer(distinctUnionDF1, testData.distinct()) + + + val distinctUnionDF2 = testData.union(testData).dropDuplicates(Seq("key")) + checkAnswer(distinctUnionDF2, testData.dropDuplicates(Seq("key"))) + + val distinctUnionDF3 = sql( + """ + |select key, value from testData + |union + |select key, value from testData + |""".stripMargin) + checkAnswer(distinctUnionDF3, testData.distinct()) + + val distinctUnionDF4 = sql( + """ + |select distinct key, expr + |from + |( + | select key, key + 1 as expr + | from testData + | union all + | select key, key + 2 as expr + | from testData + |) + |""".stripMargin) + val expected = sql( + """ + |select key, expr + |from + |( + | select key, key + 1 as expr + | from testData + | union all + | select key, key + 2 as expr + | from testData + |) group by key, expr + |""".stripMargin) + checkAnswer(distinctUnionDF4, expected) + } + } + } + + test("SPARK-34548: Remove unnecessary children from Union") { + Seq(RemoveNoopUnion.ruleName, "").map { ruleName => + withSQLConf(SQLConf.OPTIMIZER_EXCLUDED_RULES.key -> ruleName) { + val testDataCopy = spark.sparkContext.parallelize( + (1 to 100).map(i => SQLTestData.TestData(i, i.toString))).toDF() + + val distinctUnionDF1 = testData.union(testData).union(testDataCopy).distinct() + val expected = testData.union(testDataCopy).distinct() + checkAnswer(distinctUnionDF1, expected) + + val distinctUnionDF2 = testData.union(testData).union(testDataCopy) + .dropDuplicates(Seq("key")) + checkAnswer(distinctUnionDF2, expected) + } + } + } } + +case class UnionClass1a(a: Int, b: Long, nested: UnionClass2) +case class UnionClass1b(a: Int, b: Long, nested: UnionClass3) +case class UnionClass1c(a: Int, b: Long, nested: UnionClass4) + +case class UnionClass2(a: Int, c: String) +case class UnionClass3(a: Int, b: Long) +case class UnionClass4(A: Int, b: Long) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameStatSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameStatSuite.scala index 19601726fa393..cdd256877157c 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameStatSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameStatSuite.scala @@ -19,7 +19,7 @@ package org.apache.spark.sql import java.util.Random -import org.scalatest.Matchers._ +import org.scalatest.matchers.must.Matchers._ import org.apache.spark.internal.Logging import org.apache.spark.sql.execution.stat.StatFunctions @@ -412,8 +412,8 @@ class DataFrameStatSuite extends QueryTest with SharedSparkSession { // Original bug was a NullPointerException exception caused by calling collect(), test for this val resultRow = result.collect()(0) - assert(resultRow.get(0).asInstanceOf[Seq[String]].toSet == Set("1", "2", "3")) - assert(resultRow.get(1).asInstanceOf[Seq[String]].toSet == Set("a", "b", null)) + assert(resultRow.get(0).asInstanceOf[scala.collection.Seq[String]].toSet == Set("1", "2", "3")) + assert(resultRow.get(1).asInstanceOf[scala.collection.Seq[String]].toSet == Set("a", "b", null)) } test("sampleBy") { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala index 4e91a7c7bb0f4..d7d85d43544e0 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameSuite.scala @@ -18,15 +18,16 @@ package org.apache.spark.sql import java.io.{ByteArrayOutputStream, File} +import java.lang.{Long => JLong} import java.nio.charset.StandardCharsets import java.sql.{Date, Timestamp} -import java.util.UUID +import java.util.{Locale, UUID} import java.util.concurrent.atomic.AtomicLong import scala.reflect.runtime.universe.TypeTag import scala.util.Random -import org.scalatest.Matchers._ +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.SparkException import org.apache.spark.scheduler.{SparkListener, SparkListenerJobEnd} @@ -36,10 +37,12 @@ import org.apache.spark.sql.catalyst.expressions.Uuid import org.apache.spark.sql.catalyst.optimizer.ConvertToLocalRelation import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, OneRowRelation} import org.apache.spark.sql.catalyst.util.DateTimeUtils +import org.apache.spark.sql.connector.FakeV2Provider import org.apache.spark.sql.execution.{FilterExec, QueryExecution, WholeStageCodegenExec} import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper import org.apache.spark.sql.execution.aggregate.HashAggregateExec import org.apache.spark.sql.execution.exchange.{BroadcastExchangeExec, ReusedExchangeExec, ShuffleExchangeExec} +import org.apache.spark.sql.expressions.{Aggregator, Window} import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.{ExamplePoint, ExamplePointUDT, SharedSparkSession} @@ -132,7 +135,7 @@ class DataFrameSuite extends QueryTest df2 .select('_1 as 'letter, 'number) .groupBy('letter) - .agg(countDistinct('number)), + .agg(count_distinct('number)), Row("a", 3) :: Row("b", 2) :: Row("c", 1) :: Nil ) } @@ -192,6 +195,20 @@ class DataFrameSuite extends QueryTest structDf.select(xxhash64($"a", $"record.*"))) } + private def assertDecimalSumOverflow( + df: DataFrame, ansiEnabled: Boolean, expectedAnswer: Row): Unit = { + if (!ansiEnabled) { + checkAnswer(df, expectedAnswer) + } else { + val e = intercept[SparkException] { + df.collect() + } + assert(e.getCause.isInstanceOf[ArithmeticException]) + assert(e.getCause.getMessage.contains("cannot be represented as Decimal") || + e.getCause.getMessage.contains("Overflow in sum of decimals")) + } + } + test("SPARK-28224: Aggregate sum big decimal overflow") { val largeDecimals = spark.sparkContext.parallelize( DecimalData(BigDecimal("1"* 20 + ".123"), BigDecimal("1"* 20 + ".123")) :: @@ -200,14 +217,90 @@ class DataFrameSuite extends QueryTest Seq(true, false).foreach { ansiEnabled => withSQLConf((SQLConf.ANSI_ENABLED.key, ansiEnabled.toString)) { val structDf = largeDecimals.select("a").agg(sum("a")) - if (!ansiEnabled) { - checkAnswer(structDf, Row(null)) - } else { - val e = intercept[SparkException] { - structDf.collect + assertDecimalSumOverflow(structDf, ansiEnabled, Row(null)) + } + } + } + + test("SPARK-28067: sum of null decimal values") { + Seq("true", "false").foreach { wholeStageEnabled => + withSQLConf((SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key, wholeStageEnabled)) { + Seq("true", "false").foreach { ansiEnabled => + withSQLConf((SQLConf.ANSI_ENABLED.key, ansiEnabled)) { + val df = spark.range(1, 4, 1).select(expr(s"cast(null as decimal(38,18)) as d")) + checkAnswer(df.agg(sum($"d")), Row(null)) + } + } + } + } + } + + test("SPARK-28067: Aggregate sum should not return wrong results for decimal overflow") { + Seq("true", "false").foreach { wholeStageEnabled => + withSQLConf((SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key, wholeStageEnabled)) { + Seq(true, false).foreach { ansiEnabled => + withSQLConf((SQLConf.ANSI_ENABLED.key, ansiEnabled.toString)) { + val df0 = Seq( + (BigDecimal("10000000000000000000"), 1), + (BigDecimal("10000000000000000000"), 1), + (BigDecimal("10000000000000000000"), 2)).toDF("decNum", "intNum") + val df1 = Seq( + (BigDecimal("10000000000000000000"), 2), + (BigDecimal("10000000000000000000"), 2), + (BigDecimal("10000000000000000000"), 2), + (BigDecimal("10000000000000000000"), 2), + (BigDecimal("10000000000000000000"), 2), + (BigDecimal("10000000000000000000"), 2), + (BigDecimal("10000000000000000000"), 2), + (BigDecimal("10000000000000000000"), 2), + (BigDecimal("10000000000000000000"), 2)).toDF("decNum", "intNum") + val df = df0.union(df1) + val df2 = df.withColumnRenamed("decNum", "decNum2"). + join(df, "intNum").agg(sum("decNum")) + + val expectedAnswer = Row(null) + assertDecimalSumOverflow(df2, ansiEnabled, expectedAnswer) + + val decStr = "1" + "0" * 19 + val d1 = spark.range(0, 12, 1, 1) + val d2 = d1.select(expr(s"cast('$decStr' as decimal (38, 18)) as d")).agg(sum($"d")) + assertDecimalSumOverflow(d2, ansiEnabled, expectedAnswer) + + val d3 = spark.range(0, 1, 1, 1).union(spark.range(0, 11, 1, 1)) + val d4 = d3.select(expr(s"cast('$decStr' as decimal (38, 18)) as d")).agg(sum($"d")) + assertDecimalSumOverflow(d4, ansiEnabled, expectedAnswer) + + val d5 = d3.select(expr(s"cast('$decStr' as decimal (38, 18)) as d"), + lit(1).as("key")).groupBy("key").agg(sum($"d").alias("sumd")).select($"sumd") + assertDecimalSumOverflow(d5, ansiEnabled, expectedAnswer) + + val nullsDf = spark.range(1, 4, 1).select(expr(s"cast(null as decimal(38,18)) as d")) + + val largeDecimals = Seq(BigDecimal("1"* 20 + ".123"), BigDecimal("9"* 20 + ".123")). + toDF("d") + assertDecimalSumOverflow( + nullsDf.union(largeDecimals).agg(sum($"d")), ansiEnabled, expectedAnswer) + + val df3 = Seq( + (BigDecimal("10000000000000000000"), 1), + (BigDecimal("50000000000000000000"), 1), + (BigDecimal("10000000000000000000"), 2)).toDF("decNum", "intNum") + + val df4 = Seq( + (BigDecimal("10000000000000000000"), 1), + (BigDecimal("10000000000000000000"), 1), + (BigDecimal("10000000000000000000"), 2)).toDF("decNum", "intNum") + + val df5 = Seq( + (BigDecimal("10000000000000000000"), 1), + (BigDecimal("10000000000000000000"), 1), + (BigDecimal("20000000000000000000"), 2)).toDF("decNum", "intNum") + + val df6 = df3.union(df4).union(df5) + val df7 = df6.groupBy("intNum").agg(sum("decNum"), countDistinct("decNum")). + filter("intNum == 1") + assertDecimalSumOverflow(df7, ansiEnabled, Row(1, null, 2)) } - assert(e.getCause.getClass.equals(classOf[ArithmeticException])) - assert(e.getCause.getMessage.contains("cannot be represented as Decimal")) } } } @@ -422,7 +515,7 @@ class DataFrameSuite extends QueryTest Row(5, false))) checkAnswer( - testData2.select(sumDistinct($"a")), + testData2.select(sum_distinct($"a")), Row(6)) } @@ -516,7 +609,7 @@ class DataFrameSuite extends QueryTest val df = Seq(("id1", 1), ("id2", 4), ("id3", 5)).toDF("id", "value") df.sparkSession.udf.register("simpleUDF", (v: Int) => v * v) checkAnswer( - df.select($"id", callUDF("simpleUDF", $"value")), + df.select($"id", callUDF("simpleUDF", $"value")), // test deprecated one Row("id1", 1) :: Row("id2", 16) :: Row("id3", 25) :: Nil) } @@ -714,7 +807,7 @@ class DataFrameSuite extends QueryTest assert(df2.drop("`a.b`").columns.size == 2) } - test("drop(name: String) search and drop all top level columns that matchs the name") { + test("drop(name: String) search and drop all top level columns that matches the name") { val df1 = Seq((1, 2)).toDF("a", "b") val df2 = Seq((3, 4)).toDF("a", "b") checkAnswer(df1.crossJoin(df2), Row(1, 2, 3, 4)) @@ -739,6 +832,15 @@ class DataFrameSuite extends QueryTest ("David", 60, 192), ("Amy", 24, 180)).toDF("name", "age", "height") + private lazy val person3: DataFrame = Seq( + ("Luis", 1, 99), + ("Luis", 16, 99), + ("Luis", 16, 176), + ("Fernando", 32, 99), + ("Fernando", 32, 164), + ("David", 60, 99), + ("Amy", 24, 99)).toDF("name", "age", "height") + test("describe") { val describeResult = Seq( Row("count", "4", "4", "4"), @@ -830,6 +932,25 @@ class DataFrameSuite extends QueryTest checkAnswer(emptyDescription, emptySummaryResult) } + test("SPARK-34165: Add count_distinct to summary") { + val summaryDF = person3.summary("count", "count_distinct") + + val summaryResult = Seq( + Row("count", "7", "7", "7"), + Row("count_distinct", "4", "5", "3")) + + def getSchemaAsSeq(df: DataFrame): Seq[String] = df.schema.map(_.name) + assert(getSchemaAsSeq(summaryDF) === Seq("summary", "name", "age", "height")) + checkAnswer(summaryDF, summaryResult) + + val approxSummaryDF = person3.summary("count", "approx_count_distinct") + val approxSummaryResult = Seq( + Row("count", "7", "7", "7"), + Row("approx_count_distinct", "4", "5", "3")) + assert(getSchemaAsSeq(summaryDF) === Seq("summary", "name", "age", "height")) + checkAnswer(approxSummaryDF, approxSummaryResult) + } + test("summary advanced") { val stats = Array("count", "50.01%", "max", "mean", "min", "25%") val orderMatters = person2.summary(stats: _*) @@ -1144,6 +1265,99 @@ class DataFrameSuite extends QueryTest assert(df.showString(10, vertical = true) === expectedAnswer) } + test("SPARK-33690: showString: escape meta-characters") { + val df1 = spark.sql("SELECT 'aaa\nbbb\tccc\rddd\feee\bfff\u000Bggg\u0007hhh'") + assert(df1.showString(1, truncate = 0) === + """+--------------------------------------+ + ||aaa\nbbb\tccc\rddd\feee\bfff\vggg\ahhh| + |+--------------------------------------+ + ||aaa\nbbb\tccc\rddd\feee\bfff\vggg\ahhh| + |+--------------------------------------+ + |""".stripMargin) + + val df2 = spark.sql("SELECT array('aaa\nbbb\tccc\rddd\feee\bfff\u000Bggg\u0007hhh')") + assert(df2.showString(1, truncate = 0) === + """+---------------------------------------------+ + ||array(aaa\nbbb\tccc\rddd\feee\bfff\vggg\ahhh)| + |+---------------------------------------------+ + ||[aaa\nbbb\tccc\rddd\feee\bfff\vggg\ahhh] | + |+---------------------------------------------+ + |""".stripMargin) + + val df3 = + spark.sql("SELECT map('aaa\nbbb\tccc', 'aaa\nbbb\tccc\rddd\feee\bfff\u000Bggg\u0007hhh')") + assert(df3.showString(1, truncate = 0) === + """+----------------------------------------------------------+ + ||map(aaa\nbbb\tccc, aaa\nbbb\tccc\rddd\feee\bfff\vggg\ahhh)| + |+----------------------------------------------------------+ + ||{aaa\nbbb\tccc -> aaa\nbbb\tccc\rddd\feee\bfff\vggg\ahhh} | + |+----------------------------------------------------------+ + |""".stripMargin) + + val df4 = + spark.sql("SELECT named_struct('v', 'aaa\nbbb\tccc\rddd\feee\bfff\u000Bggg\u0007hhh')") + assert(df4.showString(1, truncate = 0) === + """+-------------------------------------------------------+ + ||named_struct(v, aaa\nbbb\tccc\rddd\feee\bfff\vggg\ahhh)| + |+-------------------------------------------------------+ + ||{aaa\nbbb\tccc\rddd\feee\bfff\vggg\ahhh} | + |+-------------------------------------------------------+ + |""".stripMargin) + } + + test("SPARK-34308: printSchema: escape meta-characters") { + val captured = new ByteArrayOutputStream() + + val df1 = spark.sql("SELECT 'aaa\nbbb\tccc\rddd\feee\bfff\u000Bggg\u0007hhh'") + Console.withOut(captured) { + df1.printSchema() + } + assert(captured.toString === + """root + | |-- aaa\nbbb\tccc\rddd\feee\bfff\vggg\ahhh: string (nullable = false) + | + |""".stripMargin) + captured.reset() + + val df2 = spark.sql("SELECT array('aaa\nbbb\tccc\rddd\feee\bfff\u000Bggg\u0007hhh')") + Console.withOut(captured) { + df2.printSchema() + } + assert(captured.toString === + """root + | |-- array(aaa\nbbb\tccc\rddd\feee\bfff\vggg\ahhh): array (nullable = false) + | | |-- element: string (containsNull = false) + | + |""".stripMargin) + captured.reset() + + val df3 = + spark.sql("SELECT map('aaa\nbbb\tccc', 'aaa\nbbb\tccc\rddd\feee\bfff\u000Bggg\u0007hhh')") + Console.withOut(captured) { + df3.printSchema() + } + assert(captured.toString === + """root + | |-- map(aaa\nbbb\tccc, aaa\nbbb\tccc\rddd\feee\bfff\vggg\ahhh): map (nullable = false) + | | |-- key: string + | | |-- value: string (valueContainsNull = false) + | + |""".stripMargin) + captured.reset() + + val df4 = + spark.sql("SELECT named_struct('v', 'aaa\nbbb\tccc\rddd\feee\bfff\u000Bggg\u0007hhh')") + Console.withOut(captured) { + df4.printSchema() + } + assert(captured.toString === + """root + | |-- named_struct(v, aaa\nbbb\tccc\rddd\feee\bfff\vggg\ahhh): struct (nullable = false) + | | |-- v: string (nullable = false) + | + |""".stripMargin) + } + test("SPARK-7319 showString") { val expectedAnswer = """+---+-----+ ||key|value| @@ -1177,7 +1391,7 @@ class DataFrameSuite extends QueryTest s"""+----------------+ || a| |+----------------+ - ||[1 -> a, 2 -> b]| + ||{1 -> a, 2 -> b}| |+----------------+ |""".stripMargin) val df3 = Seq(((1, "a"), 0), ((2, "b"), 0)).toDF("a", "b") @@ -1185,8 +1399,8 @@ class DataFrameSuite extends QueryTest s"""+------+---+ || a| b| |+------+---+ - ||[1, a]| 0| - ||[2, b]| 0| + ||{1, a}| 0| + ||{2, b}| 0| |+------+---+ |""".stripMargin) } @@ -2339,7 +2553,7 @@ class DataFrameSuite extends QueryTest val err = intercept[AnalysisException] { df.groupBy($"d", $"b").as[GroupByKey, Row] } - assert(err.getMessage.contains("cannot resolve '`d`'")) + assert(err.getMessage.contains("cannot resolve 'd'")) } test("emptyDataFrame should be foldable") { @@ -2361,6 +2575,14 @@ class DataFrameSuite extends QueryTest assert(e.getMessage.contains("Table or view not found:")) } + test("SPARK-32680: Don't analyze CTAS with unresolved query") { + val v2Source = classOf[FakeV2Provider].getName + val e = intercept[AnalysisException] { + sql(s"CREATE TABLE t USING $v2Source AS SELECT * from nonexist") + } + assert(e.getMessage.contains("Table or view not found:")) + } + test("CalendarInterval reflection support") { val df = Seq((1, new CalendarInterval(1, 2, 3))).toDF("a", "b") checkAnswer(df.selectExpr("b"), Row(new CalendarInterval(1, 2, 3))) @@ -2439,6 +2661,208 @@ class DataFrameSuite extends QueryTest val nestedDecArray = Array(decSpark) checkAnswer(Seq(nestedDecArray).toDF(), Row(Array(wrapRefArray(decJava)))) } + + test("SPARK-31750: eliminate UpCast if child's dataType is DecimalType") { + withTempPath { f => + sql("select cast(1 as decimal(38, 0)) as d") + .write.mode("overwrite") + .parquet(f.getAbsolutePath) + + val df = spark.read.parquet(f.getAbsolutePath).as[BigDecimal] + assert(df.schema === new StructType().add(StructField("d", DecimalType(38, 0)))) + } + } + + test("SPARK-32640: ln(NaN) should return NaN") { + val df = Seq(Double.NaN).toDF("d") + checkAnswer(df.selectExpr("ln(d)"), Row(Double.NaN)) + } + + test("SPARK-32761: aggregating multiple distinct CONSTANT columns") { + checkAnswer(sql("select count(distinct 2), count(distinct 2,3)"), Row(1, 1)) + } + + test("SPARK-32764: -0.0 and 0.0 should be equal") { + val df = Seq(0.0 -> -0.0).toDF("pos", "neg") + checkAnswer(df.select($"pos" > $"neg"), Row(false)) + } + + test("SPARK-32635: Replace references with foldables coming only from the node's children") { + val a = Seq("1").toDF("col1").withColumn("col2", lit("1")) + val b = Seq("2").toDF("col1").withColumn("col2", lit("2")) + val aub = a.union(b) + val c = aub.filter($"col1" === "2").cache() + val d = Seq("2").toDF("col4") + val r = d.join(aub, $"col2" === $"col4").select("col4") + val l = c.select("col2") + val df = l.join(r, $"col2" === $"col4", "LeftOuter") + checkAnswer(df, Row("2", "2")) + } + + test("SPARK-33939: Make Column.named use UnresolvedAlias to assign name") { + val df = spark.range(1).selectExpr("id as id1", "id as id2") + val df1 = df.selectExpr("cast(struct(id1, id2).id1 as int)") + assert(df1.schema.head.name == "CAST(struct(id1, id2).id1 AS INT)") + + val df2 = df.selectExpr("cast(array(struct(id1, id2))[0].id1 as int)") + assert(df2.schema.head.name == "CAST(array(struct(id1, id2))[0].id1 AS INT)") + + val df3 = df.select(hex(expr("struct(id1, id2).id1"))) + assert(df3.schema.head.name == "hex(struct(id1, id2).id1)") + + // this test is to make sure we don't have a regression. + val df4 = df.selectExpr("id1 == null") + assert(df4.schema.head.name == "(id1 = NULL)") + } + + test("SPARK-33989: Strip auto-generated cast when using Cast.sql") { + Seq("SELECT id == null FROM VALUES(1) AS t(id)", + "SELECT floor(1)", + "SELECT split(struct(c1, c2).c1, ',') FROM VALUES(1, 2) AS t(c1, c2)").foreach { sqlStr => + assert(!sql(sqlStr).schema.fieldNames.head.toLowerCase(Locale.getDefault).contains("cast")) + } + + Seq("SELECT id == CAST(null AS int) FROM VALUES(1) AS t(id)", + "SELECT floor(CAST(1 AS double))", + "SELECT split(CAST(struct(c1, c2).c1 AS string), ',') FROM VALUES(1, 2) AS t(c1, c2)" + ).foreach { sqlStr => + assert(sql(sqlStr).schema.fieldNames.head.toLowerCase(Locale.getDefault).contains("cast")) + } + } + + test("SPARK-34318: colRegex should work with column names & qualifiers which contain newlines") { + val df = Seq(1, 2, 3).toDF("test\n_column").as("test\n_table") + val col1 = df.colRegex("`tes.*\n.*mn`") + checkAnswer(df.select(col1), Row(1) :: Row(2) :: Row(3) :: Nil) + + val col2 = df.colRegex("test\n_table.`tes.*\n.*mn`") + checkAnswer(df.select(col2), Row(1) :: Row(2) :: Row(3) :: Nil) + } + + test("SPARK-34763: col(), $\"\", df(\"name\") should handle quoted column name properly") { + val df1 = spark.sql("SELECT 'col1' AS `a``b.c`") + checkAnswer(df1.selectExpr("`a``b.c`"), Row("col1")) + checkAnswer(df1.select(df1("`a``b.c`")), Row("col1")) + checkAnswer(df1.select(col("`a``b.c`")), Row("col1")) + checkAnswer(df1.select($"`a``b.c`"), Row("col1")) + + val df2 = df1.as("d.e`f") + checkAnswer(df2.selectExpr("`a``b.c`"), Row("col1")) + checkAnswer(df2.select(df2("`a``b.c`")), Row("col1")) + checkAnswer(df2.select(col("`a``b.c`")), Row("col1")) + checkAnswer(df2.select($"`a``b.c`"), Row("col1")) + + checkAnswer(df2.selectExpr("`d.e``f`.`a``b.c`"), Row("col1")) + checkAnswer(df2.select(df2("`d.e``f`.`a``b.c`")), Row("col1")) + checkAnswer(df2.select(col("`d.e``f`.`a``b.c`")), Row("col1")) + checkAnswer(df2.select($"`d.e``f`.`a``b.c`"), Row("col1")) + + val df3 = df1.as("*-#&% ?") + checkAnswer(df3.selectExpr("`*-#&% ?`.`a``b.c`"), Row("col1")) + checkAnswer(df3.select(df3("*-#&% ?.`a``b.c`")), Row("col1")) + checkAnswer(df3.select(col("*-#&% ?.`a``b.c`")), Row("col1")) + checkAnswer(df3.select($"*-#&% ?.`a``b.c`"), Row("col1")) + } + + test("SPARK-34776: Nested column pruning should not prune Window produced attributes") { + val df = Seq( + ("t1", "123", "bob"), + ("t1", "456", "bob"), + ("t2", "123", "sam") + ).toDF("type", "value", "name") + + val test = df.select( + $"*", + struct(count($"*").over(Window.partitionBy($"type", $"value", $"name")) + .as("count"), $"name").as("name_count") + ).select( + $"*", + max($"name_count").over(Window.partitionBy($"type", $"value")).as("best_name") + ) + checkAnswer(test.select($"best_name.name"), Row("bob") :: Row("bob") :: Row("sam") :: Nil) + } + + test("SPARK-34829: Multiple applications of typed ScalaUDFs in higher order functions work") { + val reverse = udf((s: String) => s.reverse) + val reverse2 = udf((b: Bar2) => Bar2(b.s.reverse)) + + val df = Seq(Array("abc", "def")).toDF("array") + val test = df.select(transform(col("array"), s => reverse(s))) + checkAnswer(test, Row(Array("cba", "fed")) :: Nil) + + val df2 = Seq(Array(Bar2("abc"), Bar2("def"))).toDF("array") + val test2 = df2.select(transform(col("array"), b => reverse2(b))) + checkAnswer(test2, Row(Array(Row("cba"), Row("fed"))) :: Nil) + + val df3 = Seq(Map("abc" -> 1, "def" -> 2)).toDF("map") + val test3 = df3.select(transform_keys(col("map"), (s, _) => reverse(s))) + checkAnswer(test3, Row(Map("cba" -> 1, "fed" -> 2)) :: Nil) + + val df4 = Seq(Map(Bar2("abc") -> 1, Bar2("def") -> 2)).toDF("map") + val test4 = df4.select(transform_keys(col("map"), (b, _) => reverse2(b))) + checkAnswer(test4, Row(Map(Row("cba") -> 1, Row("fed") -> 2)) :: Nil) + + val df5 = Seq(Map(1 -> "abc", 2 -> "def")).toDF("map") + val test5 = df5.select(transform_values(col("map"), (_, s) => reverse(s))) + checkAnswer(test5, Row(Map(1 -> "cba", 2 -> "fed")) :: Nil) + + val df6 = Seq(Map(1 -> Bar2("abc"), 2 -> Bar2("def"))).toDF("map") + val test6 = df6.select(transform_values(col("map"), (_, b) => reverse2(b))) + checkAnswer(test6, Row(Map(1 -> Row("cba"), 2 -> Row("fed"))) :: Nil) + + val reverseThenConcat = udf((s1: String, s2: String) => s1.reverse ++ s2.reverse) + val reverseThenConcat2 = udf((b1: Bar2, b2: Bar2) => Bar2(b1.s.reverse ++ b2.s.reverse)) + + val df7 = Seq((Map(1 -> "abc", 2 -> "def"), Map(1 -> "ghi", 2 -> "jkl"))).toDF("map1", "map2") + val test7 = + df7.select(map_zip_with(col("map1"), col("map2"), (_, s1, s2) => reverseThenConcat(s1, s2))) + checkAnswer(test7, Row(Map(1 -> "cbaihg", 2 -> "fedlkj")) :: Nil) + + val df8 = Seq((Map(1 -> Bar2("abc"), 2 -> Bar2("def")), + Map(1 -> Bar2("ghi"), 2 -> Bar2("jkl")))).toDF("map1", "map2") + val test8 = + df8.select(map_zip_with(col("map1"), col("map2"), (_, b1, b2) => reverseThenConcat2(b1, b2))) + checkAnswer(test8, Row(Map(1 -> Row("cbaihg"), 2 -> Row("fedlkj"))) :: Nil) + + val df9 = Seq((Array("abc", "def"), Array("ghi", "jkl"))).toDF("array1", "array2") + val test9 = + df9.select(zip_with(col("array1"), col("array2"), (s1, s2) => reverseThenConcat(s1, s2))) + checkAnswer(test9, Row(Array("cbaihg", "fedlkj")) :: Nil) + + val df10 = Seq((Array(Bar2("abc"), Bar2("def")), Array(Bar2("ghi"), Bar2("jkl")))) + .toDF("array1", "array2") + val test10 = + df10.select(zip_with(col("array1"), col("array2"), (b1, b2) => reverseThenConcat2(b1, b2))) + checkAnswer(test10, Row(Array(Row("cbaihg"), Row("fedlkj"))) :: Nil) + } + + test("SPARK-34882: Aggregate with multiple distinct null sensitive aggregators") { + withUserDefinedFunction(("countNulls", true)) { + spark.udf.register("countNulls", udaf(new Aggregator[JLong, JLong, JLong] { + def zero: JLong = 0L + def reduce(b: JLong, a: JLong): JLong = if (a == null) { + b + 1 + } else { + b + } + def merge(b1: JLong, b2: JLong): JLong = b1 + b2 + def finish(r: JLong): JLong = r + def bufferEncoder: Encoder[JLong] = Encoders.LONG + def outputEncoder: Encoder[JLong] = Encoders.LONG + })) + + val result = testData.selectExpr( + "countNulls(key)", + "countNulls(DISTINCT key)", + "countNulls(key) FILTER (WHERE key > 50)", + "countNulls(DISTINCT key) FILTER (WHERE key > 50)", + "count(DISTINCT key)") + + checkAnswer(result, Row(0, 0, 0, 0, 100)) + } + } } case class GroupByKey(a: Int, b: Int) + +case class Bar2(s: String) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameTimeWindowingSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameTimeWindowingSuite.scala index 8b0f46b9d1ddb..4fdaeb57ad50e 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameTimeWindowingSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameTimeWindowingSuite.scala @@ -17,8 +17,6 @@ package org.apache.spark.sql -import org.scalatest.BeforeAndAfterEach - import org.apache.spark.sql.catalyst.plans.logical.Expand import org.apache.spark.sql.functions._ import org.apache.spark.sql.test.SharedSparkSession diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFramesSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFramesSuite.scala index 8c998290b5044..fd408c37ef6cd 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFramesSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFramesSuite.scala @@ -17,8 +17,6 @@ package org.apache.spark.sql -import java.sql.Date - import org.apache.spark.sql.expressions.Window import org.apache.spark.sql.functions._ import org.apache.spark.sql.test.SharedSparkSession diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFunctionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFunctionsSuite.scala index 09ce43e4e2b27..666bf739ca9c9 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFunctionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameWindowFunctionsSuite.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql -import org.scalatest.Matchers.the +import org.scalatest.matchers.must.Matchers.the import org.apache.spark.TestUtils.{assertNotSpilled, assertSpilled} import org.apache.spark.sql.catalyst.optimizer.TransposeWindow @@ -94,89 +94,187 @@ class DataFrameWindowFunctionsSuite extends QueryTest } test("corr, covar_pop, stddev_pop functions in specific window") { - val df = Seq( - ("a", "p1", 10.0, 20.0), - ("b", "p1", 20.0, 10.0), - ("c", "p2", 20.0, 20.0), - ("d", "p2", 20.0, 20.0), - ("e", "p3", 0.0, 0.0), - ("f", "p3", 6.0, 12.0), - ("g", "p3", 6.0, 12.0), - ("h", "p3", 8.0, 16.0), - ("i", "p4", 5.0, 5.0)).toDF("key", "partitionId", "value1", "value2") - checkAnswer( - df.select( - $"key", - corr("value1", "value2").over(Window.partitionBy("partitionId") - .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), - covar_pop("value1", "value2") - .over(Window.partitionBy("partitionId") + withSQLConf(SQLConf.LEGACY_STATISTICAL_AGGREGATE.key -> "true") { + val df = Seq( + ("a", "p1", 10.0, 20.0), + ("b", "p1", 20.0, 10.0), + ("c", "p2", 20.0, 20.0), + ("d", "p2", 20.0, 20.0), + ("e", "p3", 0.0, 0.0), + ("f", "p3", 6.0, 12.0), + ("g", "p3", 6.0, 12.0), + ("h", "p3", 8.0, 16.0), + ("i", "p4", 5.0, 5.0)).toDF("key", "partitionId", "value1", "value2") + checkAnswer( + df.select( + $"key", + corr("value1", "value2").over(Window.partitionBy("partitionId") .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), - var_pop("value1") - .over(Window.partitionBy("partitionId") + covar_pop("value1", "value2") + .over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + var_pop("value1") + .over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + stddev_pop("value1") + .over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + var_pop("value2") + .over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + stddev_pop("value2") + .over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing))), + + // As stddev_pop(expr) = sqrt(var_pop(expr)) + // the "stddev_pop" column can be calculated from the "var_pop" column. + // + // As corr(expr1, expr2) = covar_pop(expr1, expr2) / (stddev_pop(expr1) * stddev_pop(expr2)) + // the "corr" column can be calculated from the "covar_pop" and the two "stddev_pop" columns + Seq( + Row("a", -1.0, -25.0, 25.0, 5.0, 25.0, 5.0), + Row("b", -1.0, -25.0, 25.0, 5.0, 25.0, 5.0), + Row("c", null, 0.0, 0.0, 0.0, 0.0, 0.0), + Row("d", null, 0.0, 0.0, 0.0, 0.0, 0.0), + Row("e", 1.0, 18.0, 9.0, 3.0, 36.0, 6.0), + Row("f", 1.0, 18.0, 9.0, 3.0, 36.0, 6.0), + Row("g", 1.0, 18.0, 9.0, 3.0, 36.0, 6.0), + Row("h", 1.0, 18.0, 9.0, 3.0, 36.0, 6.0), + Row("i", Double.NaN, 0.0, 0.0, 0.0, 0.0, 0.0))) + } + } + + test("SPARK-13860: " + + "corr, covar_pop, stddev_pop functions in specific window " + + "LEGACY_STATISTICAL_AGGREGATE off") { + withSQLConf(SQLConf.LEGACY_STATISTICAL_AGGREGATE.key -> "false") { + val df = Seq( + ("a", "p1", 10.0, 20.0), + ("b", "p1", 20.0, 10.0), + ("c", "p2", 20.0, 20.0), + ("d", "p2", 20.0, 20.0), + ("e", "p3", 0.0, 0.0), + ("f", "p3", 6.0, 12.0), + ("g", "p3", 6.0, 12.0), + ("h", "p3", 8.0, 16.0), + ("i", "p4", 5.0, 5.0)).toDF("key", "partitionId", "value1", "value2") + checkAnswer( + df.select( + $"key", + corr("value1", "value2").over(Window.partitionBy("partitionId") .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), - stddev_pop("value1") - .over(Window.partitionBy("partitionId") + covar_pop("value1", "value2") + .over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + var_pop("value1") + .over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + stddev_pop("value1") + .over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + var_pop("value2") + .over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + stddev_pop("value2") + .over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing))), + + // As stddev_pop(expr) = sqrt(var_pop(expr)) + // the "stddev_pop" column can be calculated from the "var_pop" column. + // + // As corr(expr1, expr2) = covar_pop(expr1, expr2) / (stddev_pop(expr1) * stddev_pop(expr2)) + // the "corr" column can be calculated from the "covar_pop" and the two "stddev_pop" columns + Seq( + Row("a", -1.0, -25.0, 25.0, 5.0, 25.0, 5.0), + Row("b", -1.0, -25.0, 25.0, 5.0, 25.0, 5.0), + Row("c", null, 0.0, 0.0, 0.0, 0.0, 0.0), + Row("d", null, 0.0, 0.0, 0.0, 0.0, 0.0), + Row("e", 1.0, 18.0, 9.0, 3.0, 36.0, 6.0), + Row("f", 1.0, 18.0, 9.0, 3.0, 36.0, 6.0), + Row("g", 1.0, 18.0, 9.0, 3.0, 36.0, 6.0), + Row("h", 1.0, 18.0, 9.0, 3.0, 36.0, 6.0), + Row("i", null, 0.0, 0.0, 0.0, 0.0, 0.0))) + } + } + + test("covar_samp, var_samp (variance), stddev_samp (stddev) functions in specific window") { + withSQLConf(SQLConf.LEGACY_STATISTICAL_AGGREGATE.key -> "true") { + val df = Seq( + ("a", "p1", 10.0, 20.0), + ("b", "p1", 20.0, 10.0), + ("c", "p2", 20.0, 20.0), + ("d", "p2", 20.0, 20.0), + ("e", "p3", 0.0, 0.0), + ("f", "p3", 6.0, 12.0), + ("g", "p3", 6.0, 12.0), + ("h", "p3", 8.0, 16.0), + ("i", "p4", 5.0, 5.0)).toDF("key", "partitionId", "value1", "value2") + checkAnswer( + df.select( + $"key", + covar_samp("value1", "value2").over(Window.partitionBy("partitionId") .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), - var_pop("value2") - .over(Window.partitionBy("partitionId") + var_samp("value1").over(Window.partitionBy("partitionId") .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), - stddev_pop("value2") - .over(Window.partitionBy("partitionId") - .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing))), - - // As stddev_pop(expr) = sqrt(var_pop(expr)) - // the "stddev_pop" column can be calculated from the "var_pop" column. - // - // As corr(expr1, expr2) = covar_pop(expr1, expr2) / (stddev_pop(expr1) * stddev_pop(expr2)) - // the "corr" column can be calculated from the "covar_pop" and the two "stddev_pop" columns. - Seq( - Row("a", -1.0, -25.0, 25.0, 5.0, 25.0, 5.0), - Row("b", -1.0, -25.0, 25.0, 5.0, 25.0, 5.0), - Row("c", null, 0.0, 0.0, 0.0, 0.0, 0.0), - Row("d", null, 0.0, 0.0, 0.0, 0.0, 0.0), - Row("e", 1.0, 18.0, 9.0, 3.0, 36.0, 6.0), - Row("f", 1.0, 18.0, 9.0, 3.0, 36.0, 6.0), - Row("g", 1.0, 18.0, 9.0, 3.0, 36.0, 6.0), - Row("h", 1.0, 18.0, 9.0, 3.0, 36.0, 6.0), - Row("i", Double.NaN, 0.0, 0.0, 0.0, 0.0, 0.0))) + variance("value1").over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + stddev_samp("value1").over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + stddev("value1").over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)) + ), + Seq( + Row("a", -50.0, 50.0, 50.0, 7.0710678118654755, 7.0710678118654755), + Row("b", -50.0, 50.0, 50.0, 7.0710678118654755, 7.0710678118654755), + Row("c", 0.0, 0.0, 0.0, 0.0, 0.0), + Row("d", 0.0, 0.0, 0.0, 0.0, 0.0), + Row("e", 24.0, 12.0, 12.0, 3.4641016151377544, 3.4641016151377544), + Row("f", 24.0, 12.0, 12.0, 3.4641016151377544, 3.4641016151377544), + Row("g", 24.0, 12.0, 12.0, 3.4641016151377544, 3.4641016151377544), + Row("h", 24.0, 12.0, 12.0, 3.4641016151377544, 3.4641016151377544), + Row("i", Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN))) + } } - test("covar_samp, var_samp (variance), stddev_samp (stddev) functions in specific window") { - val df = Seq( - ("a", "p1", 10.0, 20.0), - ("b", "p1", 20.0, 10.0), - ("c", "p2", 20.0, 20.0), - ("d", "p2", 20.0, 20.0), - ("e", "p3", 0.0, 0.0), - ("f", "p3", 6.0, 12.0), - ("g", "p3", 6.0, 12.0), - ("h", "p3", 8.0, 16.0), - ("i", "p4", 5.0, 5.0)).toDF("key", "partitionId", "value1", "value2") - checkAnswer( - df.select( - $"key", - covar_samp("value1", "value2").over(Window.partitionBy("partitionId") - .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), - var_samp("value1").over(Window.partitionBy("partitionId") - .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), - variance("value1").over(Window.partitionBy("partitionId") - .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), - stddev_samp("value1").over(Window.partitionBy("partitionId") - .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), - stddev("value1").over(Window.partitionBy("partitionId") - .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)) - ), - Seq( - Row("a", -50.0, 50.0, 50.0, 7.0710678118654755, 7.0710678118654755), - Row("b", -50.0, 50.0, 50.0, 7.0710678118654755, 7.0710678118654755), - Row("c", 0.0, 0.0, 0.0, 0.0, 0.0), - Row("d", 0.0, 0.0, 0.0, 0.0, 0.0), - Row("e", 24.0, 12.0, 12.0, 3.4641016151377544, 3.4641016151377544), - Row("f", 24.0, 12.0, 12.0, 3.4641016151377544, 3.4641016151377544), - Row("g", 24.0, 12.0, 12.0, 3.4641016151377544, 3.4641016151377544), - Row("h", 24.0, 12.0, 12.0, 3.4641016151377544, 3.4641016151377544), - Row("i", Double.NaN, Double.NaN, Double.NaN, Double.NaN, Double.NaN))) + test("SPARK-13860: " + + "covar_samp, var_samp (variance), stddev_samp (stddev) functions in specific window " + + "LEGACY_STATISTICAL_AGGREGATE off") { + withSQLConf(SQLConf.LEGACY_STATISTICAL_AGGREGATE.key -> "false") { + val df = Seq( + ("a", "p1", 10.0, 20.0), + ("b", "p1", 20.0, 10.0), + ("c", "p2", 20.0, 20.0), + ("d", "p2", 20.0, 20.0), + ("e", "p3", 0.0, 0.0), + ("f", "p3", 6.0, 12.0), + ("g", "p3", 6.0, 12.0), + ("h", "p3", 8.0, 16.0), + ("i", "p4", 5.0, 5.0)).toDF("key", "partitionId", "value1", "value2") + checkAnswer( + df.select( + $"key", + covar_samp("value1", "value2").over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + var_samp("value1").over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + variance("value1").over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + stddev_samp("value1").over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)), + stddev("value1").over(Window.partitionBy("partitionId") + .orderBy("key").rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing)) + ), + Seq( + Row("a", -50.0, 50.0, 50.0, 7.0710678118654755, 7.0710678118654755), + Row("b", -50.0, 50.0, 50.0, 7.0710678118654755, 7.0710678118654755), + Row("c", 0.0, 0.0, 0.0, 0.0, 0.0), + Row("d", 0.0, 0.0, 0.0, 0.0, 0.0), + Row("e", 24.0, 12.0, 12.0, 3.4641016151377544, 3.4641016151377544), + Row("f", 24.0, 12.0, 12.0, 3.4641016151377544, 3.4641016151377544), + Row("g", 24.0, 12.0, 12.0, 3.4641016151377544, 3.4641016151377544), + Row("h", 24.0, 12.0, 12.0, 3.4641016151377544, 3.4641016151377544), + Row("i", null, null, null, null, null))) + } } test("collect_list in ascending ordered window") { @@ -301,7 +399,7 @@ class DataFrameWindowFunctionsSuite extends QueryTest val df = Seq((1, "1")).toDF("key", "value") val e = intercept[AnalysisException]( df.select($"key", count("invalid").over())) - assert(e.message.contains("cannot resolve '`invalid`' given input columns: [key, value]")) + assert(e.message.contains("cannot resolve 'invalid' given input columns: [key, value]")) } test("numerical aggregate functions on string column") { @@ -541,6 +639,157 @@ class DataFrameWindowFunctionsSuite extends QueryTest Row("b", 3, null, null, null, null, null, null))) } + test("nth_value with ignoreNulls") { + val nullStr: String = null + val df = Seq( + ("a", 0, nullStr), + ("a", 1, "x"), + ("a", 2, "y"), + ("a", 3, "z"), + ("a", 4, nullStr), + ("b", 1, nullStr), + ("b", 2, nullStr)). + toDF("key", "order", "value") + val window = Window.partitionBy($"key").orderBy($"order") + checkAnswer( + df.select( + $"key", + $"order", + nth_value($"value", 2).over(window), + nth_value($"value", 2, ignoreNulls = false).over(window), + nth_value($"value", 2, ignoreNulls = true).over(window), + nth_value($"value", 3, ignoreNulls = false).over(window)), + Seq( + Row("a", 0, null, null, null, null), + Row("a", 1, "x", "x", null, null), + Row("a", 2, "x", "x", "y", "y"), + Row("a", 3, "x", "x", "y", "y"), + Row("a", 4, "x", "x", "y", "y"), + Row("b", 1, null, null, null, null), + Row("b", 2, null, null, null, null))) + } + + test("nth_value with ignoreNulls over offset window frame") { + val nullStr: String = null + val df = Seq( + ("a", 0, nullStr), + ("a", 1, "x"), + ("a", 2, "y"), + ("a", 3, "z"), + ("a", 4, nullStr), + ("b", 1, nullStr), + ("b", 2, nullStr)). + toDF("key", "order", "value") + val window1 = Window.partitionBy($"key").orderBy($"order") + .rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing) + val window2 = Window.partitionBy($"key").orderBy($"order") + .rowsBetween(Window.unboundedPreceding, Window.currentRow) + checkAnswer( + df.select( + $"key", + $"order", + nth_value($"value", 2).over(window1), + nth_value($"value", 2, ignoreNulls = false).over(window1), + nth_value($"value", 2, ignoreNulls = true).over(window1), + nth_value($"value", 2).over(window2), + nth_value($"value", 2, ignoreNulls = false).over(window2), + nth_value($"value", 2, ignoreNulls = true).over(window2)), + Seq( + Row("a", 0, "x", "x", "y", null, null, null), + Row("a", 1, "x", "x", "y", "x", "x", null), + Row("a", 2, "x", "x", "y", "x", "x", "y"), + Row("a", 3, "x", "x", "y", "x", "x", "y"), + Row("a", 4, "x", "x", "y", "x", "x", "y"), + Row("b", 1, null, null, null, null, null, null), + Row("b", 2, null, null, null, null, null, null))) + } + + test("nth_value on descending ordered window") { + val nullStr: String = null + val df = Seq( + ("a", 0, nullStr), + ("a", 1, "x"), + ("a", 2, "y"), + ("a", 3, "z"), + ("a", 4, "v"), + ("b", 1, "k"), + ("b", 2, "l"), + ("b", 3, nullStr)). + toDF("key", "order", "value") + val window = Window.partitionBy($"key").orderBy($"order".desc) + checkAnswer( + df.select( + $"key", + $"order", + nth_value($"value", 2).over(window), + nth_value($"value", 2, ignoreNulls = false).over(window), + nth_value($"value", 2, ignoreNulls = true).over(window)), + Seq( + Row("a", 0, "z", "z", "z"), + Row("a", 1, "z", "z", "z"), + Row("a", 2, "z", "z", "z"), + Row("a", 3, "z", "z", "z"), + Row("a", 4, null, null, null), + Row("b", 1, "l", "l", "k"), + Row("b", 2, "l", "l", null), + Row("b", 3, null, null, null))) + } + + test("lead/lag with ignoreNulls") { + val nullStr: String = null + val df = Seq( + ("a", 0, nullStr), + ("a", 1, "x"), + ("b", 2, nullStr), + ("c", 3, nullStr), + ("a", 4, "y"), + ("b", 5, nullStr), + ("a", 6, "z"), + ("a", 7, "v"), + ("a", 8, nullStr)). + toDF("key", "order", "value") + val window = Window.orderBy($"order") + checkAnswer( + df.select( + $"key", + $"order", + $"value", + lead($"value", 1).over(window), + lead($"value", 2).over(window), + lead($"value", 0, null, true).over(window), + lead($"value", 1, null, true).over(window), + lead($"value", 2, null, true).over(window), + lead($"value", 3, null, true).over(window), + lead(concat($"value", $"key"), 1, null, true).over(window), + lag($"value", 1).over(window), + lag($"value", 2).over(window), + lag($"value", 0, null, true).over(window), + lag($"value", 1, null, true).over(window), + lag($"value", 2, null, true).over(window), + lag($"value", 3, null, true).over(window), + lag(concat($"value", $"key"), 1, null, true).over(window)) + .orderBy($"order"), + Seq( + Row("a", 0, null, "x", null, null, "x", "y", "z", "xa", + null, null, null, null, null, null, null), + Row("a", 1, "x", null, null, "x", "y", "z", "v", "ya", + null, null, "x", null, null, null, null), + Row("b", 2, null, null, "y", null, "y", "z", "v", "ya", + "x", null, null, "x", null, null, "xa"), + Row("c", 3, null, "y", null, null, "y", "z", "v", "ya", + null, "x", null, "x", null, null, "xa"), + Row("a", 4, "y", null, "z", "y", "z", "v", null, "za", + null, null, "y", "x", null, null, "xa"), + Row("b", 5, null, "z", "v", null, "z", "v", null, "za", + "y", null, null, "y", "x", null, "ya"), + Row("a", 6, "z", "v", null, "z", "v", null, null, "va", + null, "y", "z", "y", "x", null, "ya"), + Row("a", 7, "v", null, null, "v", null, null, null, null, + "z", null, "v", "z", "y", "x", "za"), + Row("a", 8, null, null, null, null, null, null, null, null, + "v", "z", null, "v", "z", "y", "va"))) + } + test("SPARK-12989 ExtractWindowExpressions treats alias as regular attribute") { val src = Seq((0, 3, 5)).toDF("a", "b", "c") .withColumn("Data", struct("a", "b")) @@ -795,4 +1044,30 @@ class DataFrameWindowFunctionsSuite extends QueryTest Row(Seq(-0.0f, 0.0f), Row(-0.0d, Double.NaN), Seq(Row(-0.0d, Double.NaN)), 2), Row(Seq(0.0f, -0.0f), Row(0.0d, Double.NaN), Seq(Row(0.0d, 0.0/0.0)), 2))) } + + test("SPARK-34227: WindowFunctionFrame should clear its states during preparation") { + // This creates a single partition dataframe with 3 records: + // "a", 0, null + // "a", 1, "x" + // "b", 0, null + val df = spark.range(0, 3, 1, 1).select( + when($"id" < 2, lit("a")).otherwise(lit("b")).as("key"), + ($"id" % 2).cast("int").as("order"), + when($"id" % 2 === 0, lit(null)).otherwise(lit("x")).as("value")) + + val window1 = Window.partitionBy($"key").orderBy($"order") + .rowsBetween(Window.unboundedPreceding, Window.unboundedFollowing) + val window2 = Window.partitionBy($"key").orderBy($"order") + .rowsBetween(Window.unboundedPreceding, Window.currentRow) + checkAnswer( + df.select( + $"key", + $"order", + nth_value($"value", 1, ignoreNulls = true).over(window1), + nth_value($"value", 1, ignoreNulls = true).over(window2)), + Seq( + Row("a", 0, "x", null), + Row("a", 1, "x", "x"), + Row("b", 0, null, null))) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameWriterV2Suite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameWriterV2Suite.scala index ac2ebd8bd748b..8aef27a1b6692 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DataFrameWriterV2Suite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DataFrameWriterV2Suite.scala @@ -23,16 +23,15 @@ import scala.collection.JavaConverters._ import org.scalatest.BeforeAndAfter -import org.apache.spark.sql.catalyst.analysis.{CannotReplaceMissingTableException, NoSuchTableException, TableAlreadyExistsException} +import org.apache.spark.sql.catalyst.analysis.{CannotReplaceMissingTableException, TableAlreadyExistsException} import org.apache.spark.sql.catalyst.plans.logical.{AppendData, LogicalPlan, OverwriteByExpression, OverwritePartitionsDynamic} -import org.apache.spark.sql.connector.{InMemoryTable, InMemoryTableCatalog} -import org.apache.spark.sql.connector.catalog.{Identifier, TableCatalog} +import org.apache.spark.sql.connector.catalog.{Identifier, InMemoryTable, InMemoryTableCatalog, TableCatalog} import org.apache.spark.sql.connector.expressions.{BucketTransform, DaysTransform, FieldReference, HoursTransform, IdentityTransform, LiteralValue, MonthsTransform, YearsTransform} import org.apache.spark.sql.execution.QueryExecution import org.apache.spark.sql.execution.datasources.v2.DataSourceV2Relation +import org.apache.spark.sql.sources.FakeSourceOne import org.apache.spark.sql.test.SharedSparkSession -import org.apache.spark.sql.types.{IntegerType, LongType, StringType, StructType} -import org.apache.spark.sql.types.TimestampType +import org.apache.spark.sql.types.{IntegerType, LongType, StringType, StructType, TimestampType} import org.apache.spark.sql.util.QueryExecutionListener import org.apache.spark.unsafe.types.UTF8String import org.apache.spark.util.Utils @@ -58,6 +57,7 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo } after { + spark.sessionState.catalog.reset() spark.sessionState.catalogManager.reset() spark.sessionState.conf.clear() } @@ -119,6 +119,18 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo Seq(Row(1L, "a"), Row(2L, "b"), Row(3L, "c"), Row(4L, "d"), Row(5L, "e"), Row(6L, "f"))) } + test("Append: write to a temp view of v2 relation") { + spark.sql("CREATE TABLE testcat.table_name (id bigint, data string) USING foo") + spark.table("testcat.table_name").createOrReplaceTempView("temp_view") + spark.table("source").writeTo("temp_view").append() + checkAnswer( + spark.table("testcat.table_name"), + Seq(Row(1L, "a"), Row(2L, "b"), Row(3L, "c"))) + checkAnswer( + spark.table("temp_view"), + Seq(Row(1L, "a"), Row(2L, "b"), Row(3L, "c"))) + } + test("Append: by name not position") { spark.sql("CREATE TABLE testcat.table_name (id bigint, data string) USING foo") @@ -137,11 +149,36 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo } test("Append: fail if table does not exist") { - val exc = intercept[NoSuchTableException] { + val exc = intercept[AnalysisException] { spark.table("source").writeTo("testcat.table_name").append() } - assert(exc.getMessage.contains("table_name")) + assert(exc.getMessage.contains("Table or view not found: testcat.table_name")) + } + + test("Append: fail if it writes to a temp view that is not v2 relation") { + spark.range(10).createOrReplaceTempView("temp_view") + val exc = intercept[AnalysisException] { + spark.table("source").writeTo("temp_view").append() + } + assert(exc.getMessage.contains("Cannot write into temp view temp_view as it's not a " + + "data source v2 relation")) + } + + test("Append: fail if it writes to a view") { + spark.sql("CREATE VIEW v AS SELECT 1") + val exc = intercept[AnalysisException] { + spark.table("source").writeTo("v").append() + } + assert(exc.getMessage.contains("Writing into a view is not allowed")) + } + + test("Append: fail if it writes to a v1 table") { + sql(s"CREATE TABLE table_name USING ${classOf[FakeSourceOne].getName}") + val exc = intercept[AnalysisException] { + spark.table("source").writeTo("table_name").append() + } + assert(exc.getMessage.contains("Cannot write into v1 table: `default`.`table_name`")) } test("Overwrite: overwrite by expression: true") { @@ -182,6 +219,20 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo Seq(Row(1L, "a"), Row(2L, "b"), Row(4L, "d"), Row(5L, "e"), Row(6L, "f"))) } + test("Overwrite: write to a temp view of v2 relation") { + spark.sql("CREATE TABLE testcat.table_name (id bigint, data string) USING foo") + spark.table("source").writeTo("testcat.table_name").append() + spark.table("testcat.table_name").createOrReplaceTempView("temp_view") + + spark.table("source2").writeTo("testcat.table_name").overwrite(lit(true)) + checkAnswer( + spark.table("testcat.table_name"), + Seq(Row(4L, "d"), Row(5L, "e"), Row(6L, "f"))) + checkAnswer( + spark.table("temp_view"), + Seq(Row(4L, "d"), Row(5L, "e"), Row(6L, "f"))) + } + test("Overwrite: by name not position") { spark.sql("CREATE TABLE testcat.table_name (id bigint, data string) USING foo") @@ -201,11 +252,36 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo } test("Overwrite: fail if table does not exist") { - val exc = intercept[NoSuchTableException] { + val exc = intercept[AnalysisException] { spark.table("source").writeTo("testcat.table_name").overwrite(lit(true)) } - assert(exc.getMessage.contains("table_name")) + assert(exc.getMessage.contains("Table or view not found: testcat.table_name")) + } + + test("Overwrite: fail if it writes to a temp view that is not v2 relation") { + spark.range(10).createOrReplaceTempView("temp_view") + val exc = intercept[AnalysisException] { + spark.table("source").writeTo("temp_view").overwrite(lit(true)) + } + assert(exc.getMessage.contains("Cannot write into temp view temp_view as it's not a " + + "data source v2 relation")) + } + + test("Overwrite: fail if it writes to a view") { + spark.sql("CREATE VIEW v AS SELECT 1") + val exc = intercept[AnalysisException] { + spark.table("source").writeTo("v").overwrite(lit(true)) + } + assert(exc.getMessage.contains("Writing into a view is not allowed")) + } + + test("Overwrite: fail if it writes to a v1 table") { + sql(s"CREATE TABLE table_name USING ${classOf[FakeSourceOne].getName}") + val exc = intercept[AnalysisException] { + spark.table("source").writeTo("table_name").overwrite(lit(true)) + } + assert(exc.getMessage.contains("Cannot write into v1 table: `default`.`table_name`")) } test("OverwritePartitions: overwrite conflicting partitions") { @@ -246,6 +322,20 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo Seq(Row(4L, "d"), Row(5L, "e"), Row(6L, "f"))) } + test("OverwritePartitions: write to a temp view of v2 relation") { + spark.sql("CREATE TABLE testcat.table_name (id bigint, data string) USING foo") + spark.table("source").writeTo("testcat.table_name").append() + spark.table("testcat.table_name").createOrReplaceTempView("temp_view") + + spark.table("source2").writeTo("testcat.table_name").overwritePartitions() + checkAnswer( + spark.table("testcat.table_name"), + Seq(Row(4L, "d"), Row(5L, "e"), Row(6L, "f"))) + checkAnswer( + spark.table("temp_view"), + Seq(Row(4L, "d"), Row(5L, "e"), Row(6L, "f"))) + } + test("OverwritePartitions: by name not position") { spark.sql("CREATE TABLE testcat.table_name (id bigint, data string) USING foo") @@ -265,11 +355,36 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo } test("OverwritePartitions: fail if table does not exist") { - val exc = intercept[NoSuchTableException] { + val exc = intercept[AnalysisException] { spark.table("source").writeTo("testcat.table_name").overwritePartitions() } - assert(exc.getMessage.contains("table_name")) + assert(exc.getMessage.contains("Table or view not found: testcat.table_name")) + } + + test("OverwritePartitions: fail if it writes to a temp view that is not v2 relation") { + spark.range(10).createOrReplaceTempView("temp_view") + val exc = intercept[AnalysisException] { + spark.table("source").writeTo("temp_view").overwritePartitions() + } + assert(exc.getMessage.contains("Cannot write into temp view temp_view as it's not a " + + "data source v2 relation")) + } + + test("OverwritePartitions: fail if it writes to a view") { + spark.sql("CREATE VIEW v AS SELECT 1") + val exc = intercept[AnalysisException] { + spark.table("source").writeTo("v").overwritePartitions() + } + assert(exc.getMessage.contains("Writing into a view is not allowed")) + } + + test("OverwritePartitions: fail if it writes to a v1 table") { + sql(s"CREATE TABLE table_name USING ${classOf[FakeSourceOne].getName}") + val exc = intercept[AnalysisException] { + spark.table("source").writeTo("table_name").overwritePartitions() + } + assert(exc.getMessage.contains("Cannot write into v1 table: `default`.`table_name`")) } test("Create: basic behavior") { @@ -336,7 +451,6 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo spark.table("source") .withColumn("ts", lit("2019-06-01 10:00:00.000000").cast("timestamp")) .writeTo("testcat.table_name") - .tableProperty("allow-unsupported-transforms", "true") .partitionedBy(years($"ts")) .create() @@ -350,7 +464,6 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo spark.table("source") .withColumn("ts", lit("2019-06-01 10:00:00.000000").cast("timestamp")) .writeTo("testcat.table_name") - .tableProperty("allow-unsupported-transforms", "true") .partitionedBy(months($"ts")) .create() @@ -364,7 +477,6 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo spark.table("source") .withColumn("ts", lit("2019-06-01 10:00:00.000000").cast("timestamp")) .writeTo("testcat.table_name") - .tableProperty("allow-unsupported-transforms", "true") .partitionedBy(days($"ts")) .create() @@ -378,7 +490,6 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo spark.table("source") .withColumn("ts", lit("2019-06-01 10:00:00.000000").cast("timestamp")) .writeTo("testcat.table_name") - .tableProperty("allow-unsupported-transforms", "true") .partitionedBy(hours($"ts")) .create() @@ -391,7 +502,6 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo test("Create: partitioned by bucket(4, id)") { spark.table("source") .writeTo("testcat.table_name") - .tableProperty("allow-unsupported-transforms", "true") .partitionedBy(bucket(4, $"id")) .create() @@ -596,7 +706,6 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo lit("2019-09-02 07:00:00.000000").cast("timestamp") as "modified", lit("America/Los_Angeles") as "timezone")) .writeTo("testcat.table_name") - .tableProperty("allow-unsupported-transforms", "true") .partitionedBy( years($"ts.created"), months($"ts.created"), days($"ts.created"), hours($"ts.created"), years($"ts.modified"), months($"ts.modified"), days($"ts.modified"), hours($"ts.modified") @@ -624,7 +733,6 @@ class DataFrameWriterV2Suite extends QueryTest with SharedSparkSession with Befo lit("2019-09-02 07:00:00.000000").cast("timestamp") as "modified", lit("America/Los_Angeles") as "timezone")) .writeTo("testcat.table_name") - .tableProperty("allow-unsupported-transforms", "true") .partitionedBy(bucket(4, $"ts.timezone")) .create() diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DatasetBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/DatasetBenchmark.scala index e47a6a68a0a9c..955d0f9193e24 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DatasetBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DatasetBenchmark.scala @@ -28,7 +28,9 @@ import org.apache.spark.sql.types.StringType * Benchmark for Dataset typed operations comparing with DataFrame and RDD versions. * To run this benchmark: * {{{ - * 1. without sbt: bin/spark-submit --class + * 1. without sbt: + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/DatasetBenchmark-results.txt". diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DatasetCacheSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DatasetCacheSuite.scala index 5c144dad23c30..009ccb9a45354 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DatasetCacheSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DatasetCacheSuite.scala @@ -102,18 +102,19 @@ class DatasetCacheSuite extends QueryTest test("persist and then groupBy columns asKey, map") { val ds = Seq(("a", 10), ("a", 20), ("b", 1), ("b", 2), ("c", 1)).toDS() val grouped = ds.groupByKey(_._1) - val agged = grouped.mapGroups { (g, iter) => (g, iter.map(_._2).sum) } - agged.persist() + val aggregated = grouped.mapGroups { (g, iter) => (g, iter.map(_._2).sum) } + aggregated.persist() checkDataset( - agged.filter(_._1 == "b"), + aggregated.filter(_._1 == "b"), ("b", 3)) - assertCached(agged.filter(_._1 == "b")) + assertCached(aggregated.filter(_._1 == "b")) ds.unpersist(blocking = true) assert(ds.storageLevel == StorageLevel.NONE, "The Dataset ds should not be cached.") - agged.unpersist(blocking = true) - assert(agged.storageLevel == StorageLevel.NONE, "The Dataset agged should not be cached.") + aggregated.unpersist(blocking = true) + assert(aggregated.storageLevel == StorageLevel.NONE, + "The Dataset aggregated should not be cached.") } test("persist and then withColumn") { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DatasetOptimizationSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DatasetOptimizationSuite.scala index 0ac99905f35f4..5b8c80b471bb4 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DatasetOptimizationSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DatasetOptimizationSuite.scala @@ -18,12 +18,13 @@ package org.apache.spark.sql import org.apache.spark.metrics.source.CodegenMetrics +import org.apache.spark.sql.catalyst.encoders.RowEncoder import org.apache.spark.sql.catalyst.expressions.{CreateNamedStruct, Expression} -import org.apache.spark.sql.catalyst.expressions.objects.ExternalMapToCatalyst import org.apache.spark.sql.catalyst.plans.logical.SerializeFromObject -import org.apache.spark.sql.functions.expr +import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types.StructType class DatasetOptimizationSuite extends QueryTest with SharedSparkSession { import testImplicits._ @@ -195,4 +196,12 @@ class DatasetOptimizationSuite extends QueryTest with SharedSparkSession { checkCodegenCache(() => Seq(Seq(Map("abc" -> 1))).toDS()) } } + + test("SPARK-32652: Pruned nested serializers: RowEncoder") { + val df = Seq(("a", 1), ("b", 2), ("c", 3)).toDF("i", "j") + val encoder = RowEncoder(new StructType().add("s", df.schema)) + val query = df.map(row => Row(row))(encoder).select("s.i") + testSerializer(query, Seq(Seq("i"))) + checkAnswer(query, Seq(Row("a"), Row("b"), Row("c"))) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DatasetPrimitiveSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DatasetPrimitiveSuite.scala index 124b58483d24f..8547d96e0f457 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DatasetPrimitiveSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DatasetPrimitiveSuite.scala @@ -20,7 +20,6 @@ package org.apache.spark.sql import scala.collection.immutable.{HashSet => HSet} import scala.collection.immutable.Queue import scala.collection.mutable.{LinkedHashMap => LHMap} -import scala.collection.mutable.ArrayBuffer import org.apache.spark.sql.test.SharedSparkSession @@ -171,23 +170,23 @@ class DatasetPrimitiveSuite extends QueryTest with SharedSparkSession { test("groupBy function, map") { val ds = Seq(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11).toDS() val grouped = ds.groupByKey(_ % 2) - val agged = grouped.mapGroups { (g, iter) => + val aggregated = grouped.mapGroups { (g, iter) => val name = if (g == 0) "even" else "odd" (name, iter.size) } checkDatasetUnorderly( - agged, + aggregated, ("even", 5), ("odd", 6)) } test("groupBy function, flatMap") { val ds = Seq("a", "b", "c", "xyz", "hello").toDS() val grouped = ds.groupByKey(_.length) - val agged = grouped.flatMapGroups { (g, iter) => Iterator(g.toString, iter.mkString) } + val aggregated = grouped.flatMapGroups { (g, iter) => Iterator(g.toString, iter.mkString) } checkDatasetUnorderly( - agged, + aggregated, "1", "abc", "3", "xyz", "5", "hello") } @@ -223,16 +222,6 @@ class DatasetPrimitiveSuite extends QueryTest with SharedSparkSession { checkDataset(Seq(Queue(true)).toDS(), Queue(true)) checkDataset(Seq(Queue("test")).toDS(), Queue("test")) checkDataset(Seq(Queue(Tuple1(1))).toDS(), Queue(Tuple1(1))) - - checkDataset(Seq(ArrayBuffer(1)).toDS(), ArrayBuffer(1)) - checkDataset(Seq(ArrayBuffer(1.toLong)).toDS(), ArrayBuffer(1.toLong)) - checkDataset(Seq(ArrayBuffer(1.toDouble)).toDS(), ArrayBuffer(1.toDouble)) - checkDataset(Seq(ArrayBuffer(1.toFloat)).toDS(), ArrayBuffer(1.toFloat)) - checkDataset(Seq(ArrayBuffer(1.toByte)).toDS(), ArrayBuffer(1.toByte)) - checkDataset(Seq(ArrayBuffer(1.toShort)).toDS(), ArrayBuffer(1.toShort)) - checkDataset(Seq(ArrayBuffer(true)).toDS(), ArrayBuffer(true)) - checkDataset(Seq(ArrayBuffer("test")).toDS(), ArrayBuffer("test")) - checkDataset(Seq(ArrayBuffer(Tuple1(1))).toDS(), ArrayBuffer(Tuple1(1))) } test("sequence and product combinations") { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DatasetSerializerRegistratorSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DatasetSerializerRegistratorSuite.scala index 43de2663b1236..b20d050f2fc4a 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DatasetSerializerRegistratorSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DatasetSerializerRegistratorSuite.scala @@ -34,7 +34,7 @@ class DatasetSerializerRegistratorSuite extends QueryTest with SharedSparkSessio override protected def sparkConf: SparkConf = { // Make sure we use the KryoRegistrator - super.sparkConf.set(KRYO_USER_REGISTRATORS, TestRegistrator().getClass.getCanonicalName) + super.sparkConf.set(KRYO_USER_REGISTRATORS, Seq(TestRegistrator().getClass.getCanonicalName)) } test("Kryo registrator") { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala index af65957691b37..e933b4488b8c5 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala @@ -25,7 +25,7 @@ import org.scalatest.exceptions.TestFailedException import org.scalatest.prop.TableDrivenPropertyChecks._ import org.apache.spark.{SparkException, TaskContext} -import org.apache.spark.sql.catalyst.ScroogeLikeExample +import org.apache.spark.sql.catalyst.{FooClassWithEnum, FooEnum, ScroogeLikeExample} import org.apache.spark.sql.catalyst.encoders.{OuterScopes, RowEncoder} import org.apache.spark.sql.catalyst.plans.{LeftAnti, LeftSemi} import org.apache.spark.sql.catalyst.util.sideBySide @@ -528,42 +528,42 @@ class DatasetSuite extends QueryTest test("groupBy function, map") { val ds = Seq(("a", 10), ("a", 20), ("b", 1), ("b", 2), ("c", 1)).toDS() val grouped = ds.groupByKey(v => (v._1, "word")) - val agged = grouped.mapGroups { (g, iter) => (g._1, iter.map(_._2).sum) } + val aggregated = grouped.mapGroups { (g, iter) => (g._1, iter.map(_._2).sum) } checkDatasetUnorderly( - agged, + aggregated, ("a", 30), ("b", 3), ("c", 1)) } test("groupBy function, flatMap") { val ds = Seq(("a", 10), ("a", 20), ("b", 1), ("b", 2), ("c", 1)).toDS() val grouped = ds.groupByKey(v => (v._1, "word")) - val agged = grouped.flatMapGroups { (g, iter) => + val aggregated = grouped.flatMapGroups { (g, iter) => Iterator(g._1, iter.map(_._2).sum.toString) } checkDatasetUnorderly( - agged, + aggregated, "a", "30", "b", "3", "c", "1") } test("groupBy function, mapValues, flatMap") { val ds = Seq(("a", 10), ("a", 20), ("b", 1), ("b", 2), ("c", 1)).toDS() val keyValue = ds.groupByKey(_._1).mapValues(_._2) - val agged = keyValue.mapGroups { (g, iter) => (g, iter.sum) } - checkDataset(agged, ("a", 30), ("b", 3), ("c", 1)) + val aggregated = keyValue.mapGroups { (g, iter) => (g, iter.sum) } + checkDataset(aggregated, ("a", 30), ("b", 3), ("c", 1)) val keyValue1 = ds.groupByKey(t => (t._1, "key")).mapValues(t => (t._2, "value")) - val agged1 = keyValue1.mapGroups { (g, iter) => (g._1, iter.map(_._1).sum) } - checkDataset(agged1, ("a", 30), ("b", 3), ("c", 1)) + val aggregated1 = keyValue1.mapGroups { (g, iter) => (g._1, iter.map(_._1).sum) } + checkDataset(aggregated1, ("a", 30), ("b", 3), ("c", 1)) } test("groupBy function, reduce") { val ds = Seq("abc", "xyz", "hello").toDS() - val agged = ds.groupByKey(_.length).reduceGroups(_ + _) + val aggregated = ds.groupByKey(_.length).reduceGroups(_ + _) checkDatasetUnorderly( - agged, + aggregated, 3 -> "abcxyz", 5 -> "hello") } @@ -864,7 +864,7 @@ class DatasetSuite extends QueryTest val e = intercept[AnalysisException] { ds.as[ClassData2] } - assert(e.getMessage.contains("cannot resolve '`c`' given input columns: [a, b]"), e.getMessage) + assert(e.getMessage.contains("cannot resolve 'c' given input columns: [a, b]"), e.getMessage) } test("runtime nullability check") { @@ -914,11 +914,11 @@ class DatasetSuite extends QueryTest test("grouping key and grouped value has field with same name") { val ds = Seq(ClassData("a", 1), ClassData("a", 2)).toDS() - val agged = ds.groupByKey(d => ClassNullableData(d.a, null)).mapGroups { + val aggregated = ds.groupByKey(d => ClassNullableData(d.a, null)).mapGroups { (key, values) => key.a + values.map(_.b).sum } - checkDataset(agged, "a3") + checkDataset(aggregated, "a3") } test("cogroup's left and right side has field with same name") { @@ -1116,8 +1116,8 @@ class DatasetSuite extends QueryTest """+--------+ || f| |+--------+ - ||[foo, 1]| - ||[bar, 2]| + ||{foo, 1}| + ||{bar, 2}| |+--------+ |""".stripMargin @@ -1286,7 +1286,7 @@ class DatasetSuite extends QueryTest Route("b", "c", 6)) val ds = sparkContext.parallelize(data).toDF.as[Route] - val grped = ds.map(r => GroupedRoutes(r.src, r.dest, Seq(r))) + val grouped = ds.map(r => GroupedRoutes(r.src, r.dest, Seq(r))) .groupByKey(r => (r.src, r.dest)) .reduceGroups { (g1: GroupedRoutes, g2: GroupedRoutes) => GroupedRoutes(g1.src, g1.dest, g1.routes ++ g2.routes) @@ -1303,7 +1303,7 @@ class DatasetSuite extends QueryTest implicit def ordering[GroupedRoutes]: Ordering[GroupedRoutes] = (x: GroupedRoutes, y: GroupedRoutes) => x.toString.compareTo(y.toString) - checkDatasetUnorderly(grped, expected: _*) + checkDatasetUnorderly(grouped, expected: _*) } test("SPARK-18189: Fix serialization issue in KeyValueGroupedDataset") { @@ -1383,7 +1383,7 @@ class DatasetSuite extends QueryTest } } } else { - // Local checkpoints dont require checkpoint_dir + // Local checkpoints don't require checkpoint_dir f } } @@ -1474,7 +1474,7 @@ class DatasetSuite extends QueryTest } test("SPARK-18717: code generation works for both scala.collection.Map" + - " and scala.collection.imutable.Map") { + " and scala.collection.immutable.Map") { val ds = Seq(WithImmutableMap("hi", Map(42L -> "foo"))).toDS checkDataset(ds.map(t => t), WithImmutableMap("hi", Map(42L -> "foo"))) @@ -1693,6 +1693,33 @@ class DatasetSuite extends QueryTest checkDataset(ds1.select("_2._2"), ds2.select("_2._2").collect(): _*) } + test("SPARK-23862: Spark ExpressionEncoder should support Java Enum type from Scala") { + val saveModeSeq = + Seq(SaveMode.Append, SaveMode.Overwrite, SaveMode.ErrorIfExists, SaveMode.Ignore, null) + assert(saveModeSeq.toDS().collect().toSeq === saveModeSeq) + assert(saveModeSeq.toDS().schema === new StructType().add("value", StringType, nullable = true)) + + val saveModeCaseSeq = saveModeSeq.map(SaveModeCase.apply) + assert(saveModeCaseSeq.toDS().collect().toSet === saveModeCaseSeq.toSet) + assert(saveModeCaseSeq.toDS().schema === + new StructType().add("mode", StringType, nullable = true)) + + val saveModeArrayCaseSeq = + Seq(SaveModeArrayCase(Array()), SaveModeArrayCase(saveModeSeq.toArray)) + val collected = saveModeArrayCaseSeq.toDS().collect() + assert(collected.length === 2) + val sortedByLength = collected.sortBy(_.modes.length) + assert(sortedByLength(0).modes === Array()) + assert(sortedByLength(1).modes === saveModeSeq.toArray) + assert(saveModeArrayCaseSeq.toDS().schema === + new StructType().add("modes", ArrayType(StringType, containsNull = true), nullable = true)) + + // Enum is stored as string, so it is possible to convert to/from string + val stringSeq = saveModeSeq.map(Option.apply).map(_.map(_.toString).orNull) + assert(stringSeq.toDS().as[SaveMode].collect().toSet === saveModeSeq.toSet) + assert(saveModeSeq.toDS().as[String].collect().toSet === stringSeq.toSet) + } + test("SPARK-24571: filtering of string values by char literal") { val df = Seq("Amsterdam", "San Francisco", "X").toDF("city") checkAnswer(df.where($"city" === 'X'), Seq(Row("X"))) @@ -1826,7 +1853,7 @@ class DatasetSuite extends QueryTest .map(b => b - 1) .collect() } - assert(thrownException.message.contains("Cannot up cast `id` from bigint to tinyint")) + assert(thrownException.message.contains("Cannot up cast id from bigint to tinyint")) } test("SPARK-26690: checkpoints should be executed with an execution id") { @@ -1916,8 +1943,84 @@ class DatasetSuite extends QueryTest assert(df1.semanticHash !== df3.semanticHash) assert(df3.semanticHash === df4.semanticHash) } + + test("SPARK-31854: Invoke in MapElementsExec should not propagate null") { + Seq("true", "false").foreach { wholeStage => + withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> wholeStage) { + val ds = Seq(1.asInstanceOf[Integer], null.asInstanceOf[Integer]).toDS() + val expectedAnswer = Seq[(Integer, Integer)]((1, 1), (null, null)) + checkDataset(ds.map(v => (v, v)), expectedAnswer: _*) + } + } + } + + test("SPARK-32585: Support scala enumeration in ScalaReflection") { + checkDataset( + Seq(FooClassWithEnum(1, FooEnum.E1), FooClassWithEnum(2, FooEnum.E2)).toDS(), + Seq(FooClassWithEnum(1, FooEnum.E1), FooClassWithEnum(2, FooEnum.E2)): _* + ) + + // test null + checkDataset( + Seq(FooClassWithEnum(1, null), FooClassWithEnum(2, FooEnum.E2)).toDS(), + Seq(FooClassWithEnum(1, null), FooClassWithEnum(2, FooEnum.E2)): _* + ) + } + + test("SPARK-33390: Make Literal support char array") { + val df = Seq("aa", "bb", "cc", "abc").toDF("zoo") + checkAnswer(df.where($"zoo" === Array('a', 'a')), Seq(Row("aa"))) + checkAnswer( + df.where($"zoo".contains(Array('a', 'b'))), + Seq(Row("abc"))) + } + + test("SPARK-33469: Add current_timezone function") { + val df = Seq(1).toDF("c") + withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> "Asia/Shanghai") { + val timezone = df.selectExpr("current_timezone()").collect().head.getString(0) + assert(timezone == "Asia/Shanghai") + } + } + + test("SPARK-34002: Fix broken Option input/output in UDF") { + def f1(bar: Bar): Option[Bar] = { + None + } + + def f2(bar: Option[Bar]): Option[Bar] = { + bar + } + + val udf1 = udf(f1 _).withName("f1") + val udf2 = udf(f2 _).withName("f2") + + val df = (1 to 2).map(i => Tuple1(Bar(1))).toDF("c0") + val withUDF = df + .withColumn("c1", udf1(col("c0"))) + .withColumn("c2", udf2(col("c1"))) + + assert(withUDF.schema == StructType( + StructField("c0", StructType(StructField("a", IntegerType, false) :: Nil)) :: + StructField("c1", StructType(StructField("a", IntegerType, false) :: Nil)) :: + StructField("c2", StructType(StructField("a", IntegerType, false) :: Nil)) :: Nil)) + + checkAnswer(withUDF, Row(Row(1), null, null) :: Row(Row(1), null, null) :: Nil) + } + + test("SPARK-34605: implicit encoder for java.time.Duration") { + val duration = java.time.Duration.ofMinutes(10) + assert(spark.range(1).map { _ => duration }.head === duration) + } + + test("SPARK-34615: implicit encoder for java.time.Period") { + val period = java.time.Period.ofYears(9999).withMonths(11) + assert(spark.range(1).map { _ => period }.head === period) + } } +case class Bar(a: Int) + object AssertExecutionId { def apply(id: Long): Long = { assert(TaskContext.get().getLocalProperty(SQLExecution.EXECUTION_ID_KEY) != null) @@ -2014,3 +2117,7 @@ case class CircularReferenceClassD(map: Map[String, CircularReferenceClassE]) case class CircularReferenceClassE(id: String, list: List[CircularReferenceClassD]) case class SpecialCharClass(`field.1`: String, `field 2`: String) + +/** Used to test Java Enums from Scala code */ +case class SaveModeCase(mode: SaveMode) +case class SaveModeArrayCase(modes: Array[SaveMode]) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DateFunctionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DateFunctionsSuite.scala index 14e6ee2b04c14..d927953677d03 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DateFunctionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DateFunctionsSuite.scala @@ -23,7 +23,7 @@ import java.time.{Instant, LocalDateTime, ZoneId} import java.util.{Locale, TimeZone} import java.util.concurrent.TimeUnit -import org.apache.spark.SparkException +import org.apache.spark.{SparkException, SparkUpgradeException} import org.apache.spark.sql.catalyst.util.DateTimeTestUtils.{CEST, LA} import org.apache.spark.sql.catalyst.util.DateTimeUtils import org.apache.spark.sql.functions._ @@ -47,7 +47,7 @@ class DateFunctionsSuite extends QueryTest with SharedSparkSession { test("function current_timestamp and now") { val df1 = Seq((1, 2), (3, 1)).toDF("a", "b") - checkAnswer(df1.select(countDistinct(current_timestamp())), Row(1)) + checkAnswer(df1.select(count_distinct(current_timestamp())), Row(1)) // Execution in one query should return the same value checkAnswer(sql("""SELECT CURRENT_TIMESTAMP() = CURRENT_TIMESTAMP()"""), Row(true)) @@ -323,6 +323,46 @@ class DateFunctionsSuite extends QueryTest with SharedSparkSession { Row(Timestamp.valueOf("2015-12-27 00:00:00")))) } + test("function make_interval") { + val t1 = Timestamp.valueOf("2015-10-01 00:00:01") + val t2 = Timestamp.valueOf("2016-02-29 00:00:02") + val df = Seq((t1), (t2)).toDF("t") + // adds two hours to times + checkAnswer( + df.select(col("t") + make_interval(hours = lit(2))), + Seq(Row(Timestamp.valueOf("2015-10-01 02:00:01")), + Row(Timestamp.valueOf("2016-02-29 02:00:02")))) + // adds four days and two hours to times + checkAnswer( + df.select(col("t") + make_interval(hours = lit(2), days = lit(4))), + Seq(Row(Timestamp.valueOf("2015-10-05 02:00:01")), + Row(Timestamp.valueOf("2016-03-04 02:00:02")))) + // subtracts two hours from times + checkAnswer( + df.select(col("t") + make_interval(hours = lit(-2))), + Seq(Row(Timestamp.valueOf("2015-09-30 22:00:01")), + Row(Timestamp.valueOf("2016-02-28 22:00:02")))) + + val d1 = Date.valueOf("2015-08-31") + val d2 = Date.valueOf("2015-02-28") + val df2 = Seq((d1), (d2)).toDF("d") + // adding an hour to a date does nothing + checkAnswer( + df2.select(col("d") + make_interval(hours = lit(1))), + Seq(Row(Date.valueOf("2015-08-31")), + Row(Date.valueOf("2015-02-28")))) + // adds three years to date + checkAnswer( + df2.select(col("d") + make_interval(years = lit(3))), + Seq(Row(Date.valueOf("2018-08-31")), + Row(Date.valueOf("2018-02-28")))) + // subtracts 1 week, one day from date + checkAnswer( + df2.select(col("d") - make_interval(weeks = lit(1), days = lit(1))), + Seq(Row(Date.valueOf("2015-08-23")), + Row(Date.valueOf("2015-02-20")))) + } + test("function add_months") { val d1 = Date.valueOf("2015-08-31") val d2 = Date.valueOf("2015-02-28") @@ -372,11 +412,21 @@ class DateFunctionsSuite extends QueryTest with SharedSparkSession { val df1 = Seq(("mon", "2015-07-23"), ("tuesday", "2015-07-20")).toDF("dow", "d") val df2 = Seq(("th", "2015-07-23 00:11:22"), ("xx", "2015-07-24 11:22:33")).toDF("dow", "t") checkAnswer( - df1.select(next_day(col("d"), "MONDAY")), - Seq(Row(Date.valueOf("2015-07-27")), Row(Date.valueOf("2015-07-27")))) + df1.select( + next_day(col("d"), "MONDAY"), + next_day(col("d"), col("dow")), + next_day(col("d"), "NonValidDay")), + Seq( + Row(Date.valueOf("2015-07-27"), Date.valueOf("2015-07-27"), null), + Row(Date.valueOf("2015-07-27"), Date.valueOf("2015-07-21"), null))) checkAnswer( - df2.select(next_day(col("t"), "th")), - Seq(Row(Date.valueOf("2015-07-30")), Row(Date.valueOf("2015-07-30")))) + df2.select( + next_day(col("t"), "th"), + next_day(col("t"), col("dow")), + next_day(col("t"), "NonValidDay")), + Seq( + Row(Date.valueOf("2015-07-30"), Date.valueOf("2015-07-30"), null), + Row(Date.valueOf("2015-07-30"), null, null))) } def checkExceptionMessage(df: DataFrame): Unit = { @@ -450,11 +500,11 @@ class DateFunctionsSuite extends QueryTest with SharedSparkSession { checkAnswer( df.select(to_date(col("s"), "yyyy-hh-MM")), Seq(Row(null), Row(null), Row(null))) - checkAnswer( - df.select(to_date(col("s"), "yyyy-dd-aa")), - Seq(Row(null), Row(null), Row(null))) + val e = intercept[SparkUpgradeException](df.select(to_date(col("s"), "yyyy-dd-aa")).collect()) + assert(e.getCause.isInstanceOf[IllegalArgumentException]) + assert(e.getMessage.contains("You may get a different result due to the upgrading of Spark")) - // february + // February val x1 = "2016-02-29" val x2 = "2017-02-29" val df1 = Seq(x1, x2).toDF("x") @@ -618,10 +668,18 @@ class DateFunctionsSuite extends QueryTest with SharedSparkSession { Row(secs(ts4.getTime)), Row(null), Row(secs(ts3.getTime)), Row(null))) // invalid format - checkAnswer(df1.selectExpr(s"unix_timestamp(x, 'yyyy-MM-dd aa:HH:ss')"), Seq( - Row(null), Row(null), Row(null), Row(null))) + val invalid = df1.selectExpr(s"unix_timestamp(x, 'yyyy-MM-dd aa:HH:ss')") + if (legacyParserPolicy == "legacy") { + checkAnswer(invalid, + Seq(Row(null), Row(null), Row(null), Row(null))) + } else { + val e = intercept[SparkUpgradeException](invalid.collect()) + assert(e.getCause.isInstanceOf[IllegalArgumentException]) + assert( + e.getMessage.contains("You may get a different result due to the upgrading of Spark")) + } - // february + // February val y1 = "2016-02-29" val y2 = "2017-02-29" val ts5 = Timestamp.valueOf("2016-02-29 00:00:00") @@ -631,7 +689,7 @@ class DateFunctionsSuite extends QueryTest with SharedSparkSession { val now = sql("select unix_timestamp()").collect().head.getLong(0) checkAnswer( - sql(s"select cast ($now as timestamp)"), + sql(s"select timestamp_seconds($now)"), Row(new java.util.Date(TimeUnit.SECONDS.toMillis(now)))) } } @@ -672,7 +730,7 @@ class DateFunctionsSuite extends QueryTest with SharedSparkSession { checkAnswer(df1.selectExpr(s"to_unix_timestamp(x, 'yyyy-MM-dd mm:HH:ss')"), Seq( Row(secs(ts4.getTime)), Row(null), Row(secs(ts3.getTime)), Row(null))) - // february + // February val y1 = "2016-02-29" val y2 = "2017-02-29" val ts5 = Timestamp.valueOf("2016-02-29 00:00:00") @@ -681,8 +739,9 @@ class DateFunctionsSuite extends QueryTest with SharedSparkSession { Row(secs(ts5.getTime)), Row(null))) // invalid format - checkAnswer(df1.selectExpr(s"to_unix_timestamp(x, 'yyyy-MM-dd bb:HH:ss')"), Seq( - Row(null), Row(null), Row(null), Row(null))) + val invalid = df1.selectExpr(s"to_unix_timestamp(x, 'yyyy-MM-dd bb:HH:ss')") + val e = intercept[IllegalArgumentException](invalid.collect()) + assert(e.getMessage.contains('b')) } } } @@ -707,7 +766,7 @@ class DateFunctionsSuite extends QueryTest with SharedSparkSession { val df = Seq((date1, ts1, s1, ss1), (date2, ts2, s2, ss2)).toDF("d", "ts", "s", "ss") checkAnswer(df.select(to_timestamp(col("ss"))), - df.select(unix_timestamp(col("ss")).cast("timestamp"))) + df.select(timestamp_seconds(unix_timestamp(col("ss"))))) checkAnswer(df.select(to_timestamp(col("ss"))), Seq( Row(ts1), Row(ts2))) if (legacyParserPolicy == "legacy") { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala index cdf9ea4b31ee7..3b88bd58d925f 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/DynamicPartitionPruningSuite.scala @@ -20,10 +20,11 @@ package org.apache.spark.sql import org.scalatest.GivenWhenThen import org.apache.spark.sql.catalyst.expressions.{DynamicPruningExpression, Expression} +import org.apache.spark.sql.catalyst.expressions.CodegenObjectFactoryMode._ import org.apache.spark.sql.catalyst.plans.ExistenceJoin import org.apache.spark.sql.execution._ -import org.apache.spark.sql.execution.adaptive.{AdaptiveSparkPlanExec, AdaptiveSparkPlanHelper} -import org.apache.spark.sql.execution.exchange.{BroadcastExchangeExec, ReusedExchangeExec} +import org.apache.spark.sql.execution.adaptive._ +import org.apache.spark.sql.execution.exchange.{BroadcastExchangeLike, ReusedExchangeExec} import org.apache.spark.sql.execution.joins.BroadcastHashJoinExec import org.apache.spark.sql.execution.streaming.{MemoryStream, StreamingQueryWrapper} import org.apache.spark.sql.functions._ @@ -43,14 +44,9 @@ abstract class DynamicPartitionPruningSuiteBase import testImplicits._ - val adaptiveExecutionOn: Boolean - override def beforeAll(): Unit = { super.beforeAll() - spark.sessionState.conf.setConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED, adaptiveExecutionOn) - spark.sessionState.conf.setConf(SQLConf.ADAPTIVE_EXECUTION_FORCE_APPLY, true) - val factData = Seq[(Int, Int, Int, Int)]( (1000, 1, 1, 10), (1010, 2, 1, 10), @@ -172,6 +168,8 @@ abstract class DynamicPartitionPruningSuiteBase df: DataFrame, withSubquery: Boolean, withBroadcast: Boolean): Unit = { + df.collect() + val plan = df.queryExecution.executedPlan val dpExprs = collectDynamicPruningExpressions(plan) val hasSubquery = dpExprs.exists { @@ -192,12 +190,24 @@ abstract class DynamicPartitionPruningSuiteBase subqueryBroadcast.foreach { s => s.child match { case _: ReusedExchangeExec => // reuse check ok. - case b: BroadcastExchangeExec => + case BroadcastQueryStageExec(_, _: ReusedExchangeExec, _) => // reuse check ok. + case b: BroadcastExchangeLike => val hasReuse = plan.find { case ReusedExchangeExec(_, e) => e eq b case _ => false }.isDefined assert(hasReuse, s"$s\nshould have been reused in\n$plan") + case a: AdaptiveSparkPlanExec => + val broadcastQueryStage = collectFirst(a) { + case b: BroadcastQueryStageExec => b + } + val broadcastPlan = broadcastQueryStage.get.broadcast + val hasReuse = find(plan) { + case ReusedExchangeExec(_, e) => e eq broadcastPlan + case b: BroadcastExchangeLike => b eq broadcastPlan + case _ => false + }.isDefined + assert(hasReuse, s"$s\nshould have been reused in\n$plan") case _ => fail(s"Invalid child node found in\n$s") } @@ -205,7 +215,11 @@ abstract class DynamicPartitionPruningSuiteBase val isMainQueryAdaptive = plan.isInstanceOf[AdaptiveSparkPlanExec] subqueriesAll(plan).filterNot(subqueryBroadcast.contains).foreach { s => - assert(s.find(_.isInstanceOf[AdaptiveSparkPlanExec]).isDefined == isMainQueryAdaptive) + val subquery = s match { + case r: ReusedSubqueryExec => r.child + case o => o + } + assert(subquery.find(_.isInstanceOf[AdaptiveSparkPlanExec]).isDefined == isMainQueryAdaptive) } } @@ -213,6 +227,8 @@ abstract class DynamicPartitionPruningSuiteBase * Check if the plan has the given number of distinct broadcast exchange subqueries. */ def checkDistinctSubqueries(df: DataFrame, n: Int): Unit = { + df.collect() + val buf = collectDynamicPruningExpressions(df.queryExecution.executedPlan).collect { case InSubqueryExec(_, b: SubqueryBroadcastExec, _, _) => b.index @@ -224,7 +240,7 @@ abstract class DynamicPartitionPruningSuiteBase * Collect the children of all correctly pushed down dynamic pruning expressions in a spark plan. */ private def collectDynamicPruningExpressions(plan: SparkPlan): Seq[Expression] = { - plan.flatMap { + flatMap(plan) { case s: FileSourceScanExec => s.partitionFilters.collect { case d: DynamicPruningExpression => d.child } @@ -236,7 +252,7 @@ abstract class DynamicPartitionPruningSuiteBase * Check if the plan contains unpushed dynamic pruning filters. */ def checkUnpushedFilters(df: DataFrame): Boolean = { - df.queryExecution.executedPlan.find { + find(df.queryExecution.executedPlan) { case FilterExec(condition, _) => splitConjunctivePredicates(condition).exists { case _: DynamicPruningExpression => true @@ -249,33 +265,20 @@ abstract class DynamicPartitionPruningSuiteBase /** * Test the result of a simple join on mock-up tables */ - test("simple inner join triggers DPP with mock-up tables") { + test("simple inner join triggers DPP with mock-up tables", + DisableAdaptiveExecution("DPP in AQE must reuse broadcast")) { withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_ENABLED.key -> "true", SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "false", SQLConf.EXCHANGE_REUSE_ENABLED.key -> "false") { - withTable("df1", "df2") { - spark.range(1000) - .select(col("id"), col("id").as("k")) - .write - .partitionBy("k") - .format(tableFormat) - .mode("overwrite") - .saveAsTable("df1") - - spark.range(100) - .select(col("id"), col("id").as("k")) - .write - .partitionBy("k") - .format(tableFormat) - .mode("overwrite") - .saveAsTable("df2") - - val df = sql("SELECT df1.id, df2.k FROM df1 JOIN df2 ON df1.k = df2.k AND df2.id < 2") + val df = sql( + """ + |SELECT f.date_id, f.store_id FROM fact_sk f + |JOIN dim_store s ON f.store_id = s.store_id AND s.country = 'NL' + """.stripMargin) - checkPartitionPruningPredicate(df, true, false) + checkPartitionPruningPredicate(df, true, false) - checkAnswer(df, Row(0, 0) :: Row(1, 1) :: Nil) - } + checkAnswer(df, Row(1000, 1) :: Row(1010, 2) :: Row(1020, 2) :: Nil) } } @@ -314,11 +317,14 @@ abstract class DynamicPartitionPruningSuiteBase /** * Check the static scan metrics with and without DPP */ - test("static scan metrics") { + test("static scan metrics", + DisableAdaptiveExecution("DPP in AQE must reuse broadcast")) { withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_ENABLED.key -> "true", SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "false", SQLConf.EXCHANGE_REUSE_ENABLED.key -> "false") { withTable("fact", "dim") { + val numPartitions = 10 + spark.range(10) .map { x => Tuple3(x, x + 1, 0) } .toDF("did", "d1", "d2") @@ -328,7 +334,7 @@ abstract class DynamicPartitionPruningSuiteBase .saveAsTable("dim") spark.range(100) - .map { x => Tuple2(x, x % 10) } + .map { x => Tuple2(x, x % numPartitions) } .toDF("f1", "fid") .write.partitionBy("fid") .format(tableFormat) @@ -355,6 +361,8 @@ abstract class DynamicPartitionPruningSuiteBase assert(!scan1.metrics.contains("staticFilesSize")) val allFilesNum = scan1.metrics("numFiles").value val allFilesSize = scan1.metrics("filesSize").value + assert(scan1.metrics("numPartitions").value === numPartitions) + assert(scan1.metrics("pruningTime").value === -1) // No dynamic partition pruning, so no static metrics // Only files from fid = 5 partition are scanned @@ -367,6 +375,8 @@ abstract class DynamicPartitionPruningSuiteBase val partFilesSize = scan2.metrics("filesSize").value assert(0 < partFilesNum && partFilesNum < allFilesNum) assert(0 < partFilesSize && partFilesSize < allFilesSize) + assert(scan2.metrics("numPartitions").value === 1) + assert(scan2.metrics("pruningTime").value === -1) // Dynamic partition pruning is used // Static metrics are as-if reading the whole fact table @@ -378,6 +388,8 @@ abstract class DynamicPartitionPruningSuiteBase assert(scan3.metrics("staticFilesSize").value == allFilesSize) assert(scan3.metrics("numFiles").value == partFilesNum) assert(scan3.metrics("filesSize").value == partFilesSize) + assert(scan3.metrics("numPartitions").value === 1) + assert(scan3.metrics("pruningTime").value !== -1) } } } @@ -396,7 +408,7 @@ abstract class DynamicPartitionPruningSuiteBase """.stripMargin) val found = df.queryExecution.executedPlan.find { - case BroadcastHashJoinExec(_, _, p: ExistenceJoin, _, _, _, _) => true + case BroadcastHashJoinExec(_, _, p: ExistenceJoin, _, _, _, _, _) => true case _ => false } @@ -409,9 +421,11 @@ abstract class DynamicPartitionPruningSuiteBase * (2) DPP should be triggered only for certain join types * (3) DPP should trigger only when we have attributes on both sides of the join condition */ - test("DPP triggers only for certain types of query") { + test("DPP triggers only for certain types of query", + DisableAdaptiveExecution("DPP in AQE must reuse broadcast")) { withSQLConf( - SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "false") { + SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "false", + SQLConf.DYNAMIC_PARTITION_PRUNING_PRUNING_SIDE_EXTRA_FILTER_RATIO.key -> "1") { Given("dynamic partition pruning disabled") withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_ENABLED.key -> "false") { val df = sql( @@ -461,6 +475,19 @@ abstract class DynamicPartitionPruningSuiteBase checkPartitionPruningPredicate(df, true, false) } + Given("left-semi join with partition column on the right side") + withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_ENABLED.key -> "true", + SQLConf.EXCHANGE_REUSE_ENABLED.key -> "false") { + val df = sql( + """ + |SELECT * FROM dim_store s + |LEFT SEMI JOIN fact_sk f + |ON f.store_id = s.store_id AND s.country = 'NL' + """.stripMargin) + + checkPartitionPruningPredicate(df, true, false) + } + Given("left outer with partition column on the left side") withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_ENABLED.key -> "true") { val df = sql( @@ -490,7 +517,8 @@ abstract class DynamicPartitionPruningSuiteBase /** * The filtering policy has a fallback when the stats are unavailable */ - test("filtering ratio policy fallback") { + test("filtering ratio policy fallback", + DisableAdaptiveExecution("DPP in AQE must reuse broadcast")) { withSQLConf( SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "false", SQLConf.EXCHANGE_REUSE_ENABLED.key -> "false") { @@ -560,7 +588,8 @@ abstract class DynamicPartitionPruningSuiteBase /** * The filtering ratio policy performs best when it uses cardinality estimates */ - test("filtering ratio policy with stats when the broadcast pruning is disabled") { + test("filtering ratio policy with stats when the broadcast pruning is disabled", + DisableAdaptiveExecution("DPP in AQE must reuse broadcast")) { withSQLConf( SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "false", SQLConf.EXCHANGE_REUSE_ENABLED.key -> "false") { @@ -753,7 +782,8 @@ abstract class DynamicPartitionPruningSuiteBase } } - test("partition pruning in broadcast hash joins") { + test("partition pruning in broadcast hash joins", + DisableAdaptiveExecution("DPP in AQE must reuse broadcast")) { Given("disable broadcast pruning and disable subquery duplication") withSQLConf( SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "true", @@ -1060,7 +1090,8 @@ abstract class DynamicPartitionPruningSuiteBase } } - test("avoid reordering broadcast join keys to match input hash partitioning") { + test("avoid reordering broadcast join keys to match input hash partitioning", + DisableAdaptiveExecution("DPP in AQE must reuse broadcast")) { withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "false", SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { withTable("large", "dimTwo", "dimThree") { @@ -1151,7 +1182,7 @@ abstract class DynamicPartitionPruningSuiteBase test("cleanup any DPP filter that isn't pushed down due to expression id clashes") { withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "true") { withTable("fact", "dim") { - spark.range(1000).select($"id".as("A"), $"id".as("AA")) + spark.range(20).select($"id".as("A"), $"id".as("AA")) .write.partitionBy("A").format(tableFormat).mode("overwrite").saveAsTable("fact") spark.range(10).select($"id".as("B"), $"id".as("BB")) .write.format(tableFormat).mode("overwrite").saveAsTable("dim") @@ -1184,7 +1215,8 @@ abstract class DynamicPartitionPruningSuiteBase } } - test("join key with multiple references on the filtering plan") { + test("join key with multiple references on the filtering plan", + DisableAdaptiveExecution("DPP in AQE must reuse broadcast")) { withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "true") { // when enable AQE, the reusedExchange is inserted when executed. withTable("fact", "dim") { @@ -1234,9 +1266,42 @@ abstract class DynamicPartitionPruningSuiteBase val plan = df.queryExecution.executedPlan val countSubqueryBroadcasts = - plan.collectWithSubqueries({ case _: SubqueryBroadcastExec => 1 }).sum + collectWithSubqueries(plan)({ case _: SubqueryBroadcastExec => 1 }).sum + + if (conf.getConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED)) { + val countReusedSubqueryBroadcasts = + collectWithSubqueries(plan)({ case ReusedSubqueryExec(_: SubqueryBroadcastExec) => 1}).sum + + assert(countSubqueryBroadcasts == 1) + assert(countReusedSubqueryBroadcasts == 1) + } else { + assert(countSubqueryBroadcasts == 2) + } + } + } + + test("SPARK-32509: Unused Dynamic Pruning filter shouldn't affect " + + "canonicalization and exchange reuse", + DisableAdaptiveExecution("DPP in AQE must reuse broadcast")) { + withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "true") { + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + val df = sql( + """ WITH view1 as ( + | SELECT f.store_id FROM fact_stats f WHERE f.units_sold = 70 + | ) + | + | SELECT * FROM view1 v1 join view1 v2 WHERE v1.store_id = v2.store_id + """.stripMargin) - assert(countSubqueryBroadcasts == 2) + checkPartitionPruningPredicate(df, false, false) + val reuseExchangeNodes = df.queryExecution.executedPlan.collect { + case se: ReusedExchangeExec => se + } + assert(reuseExchangeNodes.size == 1, "Expected plan to contain 1 ReusedExchangeExec " + + s"nodes. Found ${reuseExchangeNodes.size}") + + checkAnswer(df, Row(15, 15) :: Nil) + } } } @@ -1280,12 +1345,170 @@ abstract class DynamicPartitionPruningSuiteBase ) } } -} -class DynamicPartitionPruningSuiteAEOff extends DynamicPartitionPruningSuiteBase { - override val adaptiveExecutionOn: Boolean = false -} + test("SPARK-32659: Fix the data issue when pruning DPP on non-atomic type") { + Seq(NO_CODEGEN, CODEGEN_ONLY).foreach { mode => + Seq(true, false).foreach { pruning => + withSQLConf( + SQLConf.CODEGEN_FACTORY_MODE.key -> mode.toString, + SQLConf.DYNAMIC_PARTITION_PRUNING_ENABLED.key -> s"$pruning") { + Seq("struct", "array").foreach { dataType => + val df = sql( + s""" + |SELECT f.date_id, f.product_id, f.units_sold, f.store_id FROM fact_stats f + |JOIN dim_stats s + |ON $dataType(f.store_id) = $dataType(s.store_id) WHERE s.country = 'DE' + """.stripMargin) + + if (pruning) { + checkPartitionPruningPredicate(df, false, true) + } else { + checkPartitionPruningPredicate(df, false, false) + } + + checkAnswer(df, + Row(1030, 2, 10, 3) :: + Row(1040, 2, 50, 3) :: + Row(1050, 2, 50, 3) :: + Row(1060, 2, 50, 3) :: Nil + ) + } + } + } + } + } -class DynamicPartitionPruningSuiteAEOn extends DynamicPartitionPruningSuiteBase { - override val adaptiveExecutionOn: Boolean = true + test("SPARK-32817: DPP throws error when the broadcast side is empty") { + withSQLConf( + SQLConf.DYNAMIC_PARTITION_PRUNING_ENABLED.key -> "true", + SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "true", + SQLConf.ADAPTIVE_OPTIMIZER_EXCLUDED_RULES.key -> EliminateUnnecessaryJoin.ruleName) { + val df = sql( + """ + |SELECT * FROM fact_sk f + |JOIN dim_store s + |ON f.store_id = s.store_id WHERE s.country = 'XYZ' + """.stripMargin) + + checkPartitionPruningPredicate(df, false, true) + + checkAnswer(df, Nil) + } + } + + test("SPARK-34436: DPP support LIKE ANY/ALL expression") { + withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_ENABLED.key -> "true") { + val df = sql( + """ + |SELECT date_id, product_id FROM fact_sk f + |JOIN dim_store s + |ON f.store_id = s.store_id WHERE s.country LIKE ANY ('%D%E%', '%A%B%') + """.stripMargin) + + checkPartitionPruningPredicate(df, false, true) + + checkAnswer(df, + Row(1030, 2) :: + Row(1040, 2) :: + Row(1050, 2) :: + Row(1060, 2) :: Nil + ) + } + } + + test("SPARK-34595: DPP support RLIKE expression") { + withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_ENABLED.key -> "true") { + val df = sql( + """ + |SELECT date_id, product_id FROM fact_sk f + |JOIN dim_store s + |ON f.store_id = s.store_id WHERE s.country RLIKE '[DE|US]' + """.stripMargin) + + checkPartitionPruningPredicate(df, false, true) + + checkAnswer(df, + Row(1030, 2) :: + Row(1040, 2) :: + Row(1050, 2) :: + Row(1060, 2) :: + Row(1070, 2) :: + Row(1080, 3) :: + Row(1090, 3) :: + Row(1100, 3) :: + Row(1110, 3) :: + Row(1120, 4) :: Nil + ) + } + } + + test("SPARK-32855: Filtering side can not broadcast by join type", + DisableAdaptiveExecution("DPP in AQE must reuse broadcast")) { + withSQLConf( + SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "false", + SQLConf.DYNAMIC_PARTITION_PRUNING_USE_STATS.key -> "false", + SQLConf.DYNAMIC_PARTITION_PRUNING_PRUNING_SIDE_EXTRA_FILTER_RATIO.key -> "1") { + + val sqlStr = + """ + |SELECT s.store_id,f. product_id FROM dim_store s + |LEFT JOIN fact_sk f + |ON f.store_id = s.store_id WHERE s.country = 'NL' + """.stripMargin + + // DPP will only apply if disable reuseBroadcastOnly + Seq(true, false).foreach { reuseBroadcastOnly => + withSQLConf( + SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> s"$reuseBroadcastOnly") { + val df = sql(sqlStr) + checkPartitionPruningPredicate(df, !reuseBroadcastOnly, false) + } + } + + // DPP will only apply if left side can broadcast by size + Seq(1L, 100000L).foreach { threshold => + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> s"$threshold") { + val df = sql(sqlStr) + checkPartitionPruningPredicate(df, threshold > 10L, false) + } + } + } + } + + test("SPARK-34637: DPP side broadcast query stage is created firstly") { + withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "true") { + val df = sql( + """ WITH v as ( + | SELECT f.store_id FROM fact_stats f WHERE f.units_sold = 70 group by f.store_id + | ) + | + | SELECT * FROM v v1 join v v2 WHERE v1.store_id = v2.store_id + """.stripMargin) + + // A possible resulting query plan: + // BroadcastHashJoin + // +- HashAggregate + // +- ShuffleQueryStage + // +- Exchange + // +- HashAggregate + // +- Filter + // +- FileScan [PartitionFilters: dynamicpruning#3385] + // +- SubqueryBroadcast dynamicpruning#3385 + // +- AdaptiveSparkPlan + // +- BroadcastQueryStage + // +- BroadcastExchange + // + // +- BroadcastQueryStage + // +- ReusedExchange + + checkPartitionPruningPredicate(df, false, true) + checkAnswer(df, Row(15, 15) :: Nil) + } + } } + +class DynamicPartitionPruningSuiteAEOff extends DynamicPartitionPruningSuiteBase + with DisableAdaptiveExecutionSuite + +class DynamicPartitionPruningSuiteAEOn extends DynamicPartitionPruningSuiteBase + with EnableAdaptiveExecutionSuite diff --git a/sql/core/src/test/scala/org/apache/spark/sql/ExplainSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/ExplainSuite.scala index 5aeecd2df91e9..3edc40133c616 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/ExplainSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/ExplainSuite.scala @@ -19,10 +19,12 @@ package org.apache.spark.sql import org.apache.spark.sql.execution._ import org.apache.spark.sql.execution.adaptive.{DisableAdaptiveExecutionSuite, EnableAdaptiveExecutionSuite} +import org.apache.spark.sql.execution.datasources.SaveIntoDataSourceCommand import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.sources.TestOptionsSource import org.apache.spark.sql.test.SharedSparkSession -import org.apache.spark.sql.types.StructType +import org.apache.spark.sql.types.{IntegerType, StructField, StructType} trait ExplainSuiteHelper extends QueryTest with SharedSparkSession { @@ -69,6 +71,18 @@ trait ExplainSuiteHelper extends QueryTest with SharedSparkSession { protected def checkKeywordsExistsInExplain(df: DataFrame, keywords: String*): Unit = { checkKeywordsExistsInExplain(df, ExtendedMode, keywords: _*) } + + /** + * Runs the plan and makes sure the plans does not contain any of the keywords. + */ + protected def checkKeywordsNotExistsInExplain( + df: DataFrame, mode: ExplainMode, keywords: String*): Unit = { + withNormalizedExplain(df, mode) { normalizedOutput => + for (key <- keywords) { + assert(!normalizedOutput.contains(key)) + } + } + } } class ExplainSuite extends ExplainSuiteHelper with DisableAdaptiveExecutionSuite { @@ -196,14 +210,13 @@ class ExplainSuite extends ExplainSuiteHelper with DisableAdaptiveExecutionSuite // OR disjunction // --------------------------------------------------------------------------------------- checkKeywordsExistsInExplain(sql("select 'a' || 1 + 2"), - "Project [null AS (CAST(concat(a, CAST(1 AS STRING)) AS DOUBLE) + CAST(2 AS DOUBLE))#x]") + "Project [null AS (concat(a, 1) + 2)#x]") checkKeywordsExistsInExplain(sql("select 1 - 2 || 'b'"), - "Project [-1b AS concat(CAST((1 - 2) AS STRING), b)#x]") + "Project [-1b AS concat((1 - 2), b)#x]") checkKeywordsExistsInExplain(sql("select 2 * 4 + 3 || 'b'"), - "Project [11b AS concat(CAST(((2 * 4) + 3) AS STRING), b)#x]") + "Project [11b AS concat(((2 * 4) + 3), b)#x]") checkKeywordsExistsInExplain(sql("select 3 + 1 || 'a' || 4 / 2"), - "Project [4a2.0 AS concat(concat(CAST((3 + 1) AS STRING), a), " + - "CAST((CAST(4 AS DOUBLE) / CAST(2 AS DOUBLE)) AS STRING))#x]") + "Project [4a2.0 AS concat(concat((3 + 1), a), (4 / 2))#x]") checkKeywordsExistsInExplain(sql("select 1 == 1 OR 'a' || 'b' == 'ab'"), "Project [true AS ((1 = 1) OR (concat(a, b) = ab))#x]") checkKeywordsExistsInExplain(sql("select 'a' || 'c' == 'ac' AND 2 == 3"), @@ -228,12 +241,27 @@ class ExplainSuite extends ExplainSuiteHelper with DisableAdaptiveExecutionSuite } } + test("SPARK-33853: explain codegen - check presence of subquery") { + withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true") { + withTempView("df") { + val df1 = spark.range(1, 100) + df1.createTempView("df") + + val sqlText = "EXPLAIN CODEGEN SELECT (SELECT min(id) FROM df)" + val expectedText = "Found 3 WholeStageCodegen subtrees." + + withNormalizedExplain(sqlText) { normalizedOutput => + assert(normalizedOutput.contains(expectedText)) + } + } + } + } + test("explain formatted - check presence of subquery in case of DPP") { withTable("df1", "df2") { withSQLConf(SQLConf.DYNAMIC_PARTITION_PRUNING_ENABLED.key -> "true", SQLConf.DYNAMIC_PARTITION_PRUNING_REUSE_BROADCAST_ONLY.key -> "false", SQLConf.EXCHANGE_REUSE_ENABLED.key -> "false") { - withTable("df1", "df2") { spark.range(1000).select(col("id"), col("id").as("k")) .write .partitionBy("k") @@ -261,11 +289,11 @@ class ExplainSuite extends ExplainSuiteHelper with DisableAdaptiveExecutionSuite "PartitionFilters: \\[isnotnull\\(k#xL\\), dynamicpruningexpression\\(k#xL " + "IN subquery#x\\)\\]" val expected_pattern3 = - "Location: InMemoryFileIndex \\[.*org.apache.spark.sql.ExplainSuite" + - "/df2/.*, ... 99 entries\\]" + "Location: InMemoryFileIndex \\[\\S*org.apache.spark.sql.ExplainSuite" + + "/df2/\\S*, ... 99 entries\\]" val expected_pattern4 = - "Location: InMemoryFileIndex \\[.*org.apache.spark.sql.ExplainSuite" + - "/df1/.*, ... 999 entries\\]" + "Location: InMemoryFileIndex \\[\\S*org.apache.spark.sql.ExplainSuite" + + "/df1/\\S*, ... 999 entries\\]" withNormalizedExplain(sqlText) { normalizedOutput => assert(expected_pattern1.r.findAllMatchIn(normalizedOutput).length == 1) assert(expected_pattern2.r.findAllMatchIn(normalizedOutput).length == 1) @@ -273,6 +301,22 @@ class ExplainSuite extends ExplainSuiteHelper with DisableAdaptiveExecutionSuite assert(expected_pattern4.r.findAllMatchIn(normalizedOutput).length == 1) } } + } + } + + test("SPARK-33850: explain formatted - check presence of subquery in case of AQE") { + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") { + withTempView("df") { + val df = spark.range(1, 100) + df.createTempView("df") + + val sqlText = "EXPLAIN FORMATTED SELECT (SELECT min(id) FROM df) as v" + val expected_pattern = + "Subquery:1 Hosting operator id = 2 Hosting Expression = Subquery subquery#x" + + withNormalizedExplain(sqlText) { normalizedOutput => + assert(expected_pattern.r.findAllMatchIn(normalizedOutput).length == 1) + } } } } @@ -316,6 +360,45 @@ class ExplainSuite extends ExplainSuiteHelper with DisableAdaptiveExecutionSuite Nil: _*) } + test("SPARK-34970: Redact Map type options in explain output") { + val password = "MyPassWord" + val token = "MyToken" + val value = "value" + val options = Map("password" -> password, "token" -> token, "key" -> value) + val cmd = SaveIntoDataSourceCommand(spark.range(10).logicalPlan, new TestOptionsSource, + options, SaveMode.Overwrite) + + Seq(SimpleMode, ExtendedMode, FormattedMode).foreach { mode => + checkKeywordsExistsInExplain(cmd, mode, value) + } + Seq(SimpleMode, ExtendedMode, CodegenMode, CostMode, FormattedMode).foreach { mode => + checkKeywordsNotExistsInExplain(cmd, mode, password) + checkKeywordsNotExistsInExplain(cmd, mode, token) + } + } + + test("SPARK-34970: Redact CaseInsensitiveMap type options in explain output") { + val password = "MyPassWord" + val token = "MyToken" + val value = "value" + val tableName = "t" + withTable(tableName) { + val df1 = spark.range(10).toDF() + df1.write.format("json").saveAsTable(tableName) + val df2 = spark.read + .option("key", value) + .option("password", password) + .option("token", token) + .table(tableName) + + checkKeywordsExistsInExplain(df2, ExtendedMode, value) + Seq(SimpleMode, ExtendedMode, CodegenMode, CostMode, FormattedMode).foreach { mode => + checkKeywordsNotExistsInExplain(df2, mode, password) + checkKeywordsNotExistsInExplain(df2, mode, token) + } + } + } + test("Dataset.toExplainString has mode as string") { val df = spark.range(10).toDF def assertExplainOutput(mode: ExplainMode): Unit = { @@ -343,6 +426,94 @@ class ExplainSuite extends ExplainSuiteHelper with DisableAdaptiveExecutionSuite assert(getNormalizedExplain(df1, FormattedMode) === getNormalizedExplain(df2, FormattedMode)) } } + + test("Coalesced bucket info should be a part of explain string") { + withTable("t1", "t2") { + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "0", + SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "true") { + Seq(1, 2).toDF("i").write.bucketBy(8, "i").saveAsTable("t1") + Seq(2, 3).toDF("i").write.bucketBy(4, "i").saveAsTable("t2") + val df1 = spark.table("t1") + val df2 = spark.table("t2") + val joined = df1.join(df2, df1("i") === df2("i")) + checkKeywordsExistsInExplain( + joined, + SimpleMode, + "SelectedBucketsCount: 8 out of 8 (Coalesced to 4)" :: Nil: _*) + } + } + } + + test("Explain formatted output for scan operator for datasource V2") { + withTempDir { dir => + Seq("parquet", "orc", "csv", "json").foreach { fmt => + val basePath = dir.getCanonicalPath + "/" + fmt + val pushFilterMaps = Map ( + "parquet" -> + "|PushedFilters: \\[IsNotNull\\(value\\), GreaterThan\\(value,2\\)\\]", + "orc" -> + "|PushedFilters: \\[.*\\(id\\), .*\\(value\\), .*\\(id,1\\), .*\\(value,2\\)\\]", + "csv" -> + "|PushedFilters: \\[IsNotNull\\(value\\), GreaterThan\\(value,2\\)\\]", + "json" -> + "|remove_marker" + ) + val expected_plan_fragment1 = + s""" + |\\(1\\) BatchScan + |Output \\[2\\]: \\[value#x, id#x\\] + |DataFilters: \\[isnotnull\\(value#x\\), \\(value#x > 2\\)\\] + |Format: $fmt + |Location: InMemoryFileIndex\\([0-9]+ paths\\)\\[.*\\] + |PartitionFilters: \\[isnotnull\\(id#x\\), \\(id#x > 1\\)\\] + ${pushFilterMaps.get(fmt).get} + |ReadSchema: struct\\ + |""".stripMargin.replaceAll("\nremove_marker", "").trim + + spark.range(10) + .select(col("id"), col("id").as("value")) + .write.option("header", true) + .partitionBy("id") + .format(fmt) + .save(basePath) + val readSchema = + StructType(Seq(StructField("id", IntegerType), StructField("value", IntegerType))) + withSQLConf(SQLConf.USE_V1_SOURCE_LIST.key -> "") { + val df = spark + .read + .schema(readSchema) + .option("header", true) + .format(fmt) + .load(basePath).where($"id" > 1 && $"value" > 2) + val normalizedOutput = getNormalizedExplain(df, FormattedMode) + assert(expected_plan_fragment1.r.findAllMatchIn(normalizedOutput).length == 1) + } + } + } + } + + test("Explain UnresolvedRelation with CaseInsensitiveStringMap options") { + val tableName = "test" + withTable(tableName) { + val df1 = Seq((1L, "a"), (2L, "b"), (3L, "c")).toDF("id", "data") + df1.write.saveAsTable(tableName) + val df2 = spark.read + .option("key1", "value1") + .option("KEY2", "VALUE2") + .table(tableName) + // == Parsed Logical Plan == + // 'UnresolvedRelation [test], [key1=value1, KEY2=VALUE2] + checkKeywordsExistsInExplain(df2, keywords = "[key1=value1, KEY2=VALUE2]") + } + } + + test("SPARK-35225: Handle empty output for analyzed plan") { + withTempView("test") { + checkKeywordsExistsInExplain( + sql("CREATE TEMPORARY VIEW test AS SELECT 1"), + "== Analyzed Logical Plan ==\nCreateViewCommand") + } + } } class ExplainSuiteAE extends ExplainSuiteHelper with EnableAdaptiveExecutionSuite { @@ -394,6 +565,33 @@ class ExplainSuiteAE extends ExplainSuiteHelper with EnableAdaptiveExecutionSuit |""".stripMargin ) } + + test("SPARK-35133: explain codegen should work with AQE") { + withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true") { + withTempView("df") { + val df = spark.range(5).select(col("id").as("key"), col("id").as("value")) + df.createTempView("df") + + val sqlText = "EXPLAIN CODEGEN SELECT key, MAX(value) FROM df GROUP BY key" + val expectedCodegenText = "Found 2 WholeStageCodegen subtrees." + val expectedNoCodegenText = "Found 0 WholeStageCodegen subtrees." + withNormalizedExplain(sqlText) { normalizedOutput => + assert(normalizedOutput.contains(expectedNoCodegenText)) + } + + val aggDf = df.groupBy('key).agg(max('value)) + withNormalizedExplain(aggDf, CodegenMode) { normalizedOutput => + assert(normalizedOutput.contains(expectedNoCodegenText)) + } + + // trigger the final plan for AQE + aggDf.collect() + withNormalizedExplain(aggDf, CodegenMode) { normalizedOutput => + assert(normalizedOutput.contains(expectedCodegenText)) + } + } + } + } } case class ExplainSingleData(id: Int) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/ExpressionsSchemaSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/ExpressionsSchemaSuite.scala index 4c9ba9455c33f..f8071e6cda175 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/ExpressionsSchemaSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/ExpressionsSchemaSuite.scala @@ -32,12 +32,12 @@ import org.apache.spark.tags.ExtendedSQLTest * * To run the entire test suite: * {{{ - * build/sbt "sql/test-only *ExpressionsSchemaSuite" + * build/sbt "sql/testOnly *ExpressionsSchemaSuite" * }}} * * To re-generate golden files for entire suite, run: * {{{ - * SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/test-only *ExpressionsSchemaSuite" + * SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/testOnly *ExpressionsSchemaSuite" * }}} * * For example: @@ -72,14 +72,7 @@ class ExpressionsSchemaSuite extends QueryTest with SharedSparkSession { // We use a path based on Spark home for 2 reasons: // 1. Maven can't get correct resource directory when resources in other jars. // 2. We test subclasses in the hive-thriftserver module. - val sparkHome = { - assert(sys.props.contains("spark.test.home") || - sys.env.contains("SPARK_HOME"), "spark.test.home or SPARK_HOME is not set.") - sys.props.getOrElse("spark.test.home", sys.env("SPARK_HOME")) - } - - java.nio.file.Paths.get(sparkHome, - "sql", "core", "src", "test", "resources", "sql-functions").toFile + getWorkspaceFilePath("sql", "core", "src", "test", "resources", "sql-functions").toFile } private val resultFile = new File(baseResourcePath, "sql-expression-schema.md") @@ -101,7 +94,9 @@ class ExpressionsSchemaSuite extends QueryTest with SharedSparkSession { spark.sessionState.catalog.lookupFunctionInfo(funcId) } - val classFunsMap = funInfos.groupBy(_.getClassName).toSeq.sortBy(_._1) + val classFunsMap = funInfos.groupBy(_.getClassName).toSeq.sortBy(_._1).map { + case (className, infos) => (className, infos.sortBy(_.getName)) + } val outputBuffer = new ArrayBuffer[String] val outputs = new ArrayBuffer[QueryOutput] val missingExamples = new ArrayBuffer[String] @@ -158,16 +153,17 @@ class ExpressionsSchemaSuite extends QueryTest with SharedSparkSession { val outputSize = outputs.size val headerSize = header.size - val expectedOutputs: Seq[QueryOutput] = { + val (expectedMissingExamples, expectedOutputs) = { val expectedGoldenOutput = fileToString(resultFile) val lines = expectedGoldenOutput.split("\n") val expectedSize = lines.size assert(expectedSize == outputSize + headerSize, s"Expected $expectedSize blocks in result file but got " + - s"${outputSize + headerSize}. Try regenerate the result files.") + s"${outputSize + headerSize}. Try regenerating the result files.") - Seq.tabulate(outputSize) { i => + val numberOfQueries = lines(2).split(":")(1).trim.toInt + val expectedOutputs = Seq.tabulate(outputSize) { i => val segments = lines(i + headerSize).split('|') QueryOutput( className = segments(1).trim, @@ -175,6 +171,28 @@ class ExpressionsSchemaSuite extends QueryTest with SharedSparkSession { sql = segments(3).trim, schema = segments(4).trim) } + + assert(numberOfQueries == expectedOutputs.size, + s"expected outputs size: ${expectedOutputs.size} not same as numberOfQueries: " + + s"$numberOfQueries record in result file. Try regenerating the result files.") + + val numberOfMissingExamples = lines(3).split(":")(1).trim.toInt + val expectedMissingExamples = { + val missingExamples = lines(4).split(":")(1).trim + // Splitting on a empty string would return [""] + if (missingExamples.nonEmpty) { + missingExamples.split(",") + } else { + Array.empty[String] + } + } + + assert(numberOfMissingExamples == expectedMissingExamples.size, + s"expected missing examples size: ${expectedMissingExamples.size} not same as " + + s"numberOfMissingExamples: $numberOfMissingExamples " + + "record in result file. Try regenerating the result files.") + + (expectedMissingExamples, expectedOutputs) } // Compare results. @@ -185,5 +203,13 @@ class ExpressionsSchemaSuite extends QueryTest with SharedSparkSession { assert(expected.sql == output.sql, "SQL query did not match") assert(expected.schema == output.schema, s"Schema did not match for query ${expected.sql}") } + + // Compare expressions missing examples + assert(expectedMissingExamples.length == missingExamples.size, + "The number of missing examples not equals the number of expected missing examples.") + + missingExamples.zip(expectedMissingExamples).foreach { case (output, expected) => + assert(expected == output, "Missing example expression not match") + } } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/ExtraStrategiesSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/ExtraStrategiesSuite.scala index 9192370cfa620..bec68fae08719 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/ExtraStrategiesSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/ExtraStrategiesSuite.scala @@ -21,10 +21,10 @@ import org.apache.spark.rdd.RDD import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Project} -import org.apache.spark.sql.execution.SparkPlan +import org.apache.spark.sql.execution.{LeafExecNode, SparkPlan} import org.apache.spark.sql.test.SharedSparkSession -case class FastOperator(output: Seq[Attribute]) extends SparkPlan { +case class FastOperator(output: Seq[Attribute]) extends LeafExecNode { override protected def doExecute(): RDD[InternalRow] = { val str = Literal("so fast").value @@ -35,7 +35,6 @@ case class FastOperator(output: Seq[Attribute]) extends SparkPlan { } override def producedAttributes: AttributeSet = outputSet - override def children: Seq[SparkPlan] = Nil } object TestStrategy extends Strategy { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/FileBasedDataSourceSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/FileBasedDataSourceSuite.scala index cb410b4f0d7dc..876f62803dc7c 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/FileBasedDataSourceSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/FileBasedDataSourceSuite.scala @@ -18,23 +18,27 @@ package org.apache.spark.sql import java.io.{File, FileNotFoundException} +import java.net.URI import java.nio.file.{Files, StandardOpenOption} import java.util.Locale import scala.collection.mutable -import org.apache.hadoop.fs.Path +import org.apache.hadoop.conf.Configuration +import org.apache.hadoop.fs.{LocalFileSystem, Path} import org.apache.spark.SparkException import org.apache.spark.scheduler.{SparkListener, SparkListenerTaskEnd} import org.apache.spark.sql.TestingUDT.{IntervalUDT, NullData, NullUDT} import org.apache.spark.sql.catalyst.expressions.AttributeReference -import org.apache.spark.sql.catalyst.planning.PhysicalOperation +import org.apache.spark.sql.catalyst.expressions.IntegralLiteralTestUtils.{negativeInt, positiveInt} import org.apache.spark.sql.catalyst.plans.logical.Filter +import org.apache.spark.sql.execution.SimpleMode import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper import org.apache.spark.sql.execution.datasources.FilePartition -import org.apache.spark.sql.execution.datasources.v2.{BatchScanExec, DataSourceV2ScanRelation, FileScan} -import org.apache.spark.sql.execution.datasources.v2.parquet.ParquetTable +import org.apache.spark.sql.execution.datasources.v2.{BatchScanExec, FileScan} +import org.apache.spark.sql.execution.datasources.v2.orc.OrcScan +import org.apache.spark.sql.execution.datasources.v2.parquet.ParquetScan import org.apache.spark.sql.execution.joins.{BroadcastHashJoinExec, SortMergeJoinExec} import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf @@ -229,6 +233,20 @@ class FileBasedDataSourceSuite extends QueryTest } } + Seq("json", "orc").foreach { format => + test(s"SPARK-32889: column name supports special characters using $format") { + Seq("$", " ", ",", ";", "{", "}", "(", ")", "\n", "\t", "=").foreach { name => + withTempDir { dir => + val dataDir = new File(dir, "file").getCanonicalPath + Seq(1).toDF(name).write.format(format).save(dataDir) + val schema = spark.read.format(format).load(dataDir).schema + assert(schema.size == 1) + assertResult(name)(schema.head.name) + } + } + } + } + // Text file format only supports string type test("SPARK-24691 error handling for unsupported types - text") { withTempDir { dir => @@ -559,38 +577,6 @@ class FileBasedDataSourceSuite extends QueryTest } } - test("Option pathGlobFilter: filter files correctly") { - withTempPath { path => - val dataDir = path.getCanonicalPath - Seq("foo").toDS().write.text(dataDir) - Seq("bar").toDS().write.mode("append").orc(dataDir) - val df = spark.read.option("pathGlobFilter", "*.txt").text(dataDir) - checkAnswer(df, Row("foo")) - - // Both glob pattern in option and path should be effective to filter files. - val df2 = spark.read.option("pathGlobFilter", "*.txt").text(dataDir + "/*.orc") - checkAnswer(df2, Seq.empty) - - val df3 = spark.read.option("pathGlobFilter", "*.txt").text(dataDir + "/*xt") - checkAnswer(df3, Row("foo")) - } - } - - test("Option pathGlobFilter: simple extension filtering should contains partition info") { - withTempPath { path => - val input = Seq(("foo", 1), ("oof", 2)).toDF("a", "b") - input.write.partitionBy("b").text(path.getCanonicalPath) - Seq("bar").toDS().write.mode("append").orc(path.getCanonicalPath + "/b=1") - - // If we use glob pattern in the path, the partition column won't be shown in the result. - val df = spark.read.text(path.getCanonicalPath + "/*/*.txt") - checkAnswer(df, input.select("a")) - - val df2 = spark.read.option("pathGlobFilter", "*.txt").text(path.getCanonicalPath) - checkAnswer(df2, input) - } - } - test("Option recursiveFileLookup: recursive loading correctly") { val expectedFileList = mutable.ListBuffer[String]() @@ -631,13 +617,15 @@ class FileBasedDataSourceSuite extends QueryTest assert(fileList.toSet === expectedFileList.toSet) - val fileList2 = spark.read.format("binaryFile") - .option("recursiveFileLookup", true) - .option("pathGlobFilter", "*.bin") - .load(dataPath) - .select("path").collect().map(_.getString(0)) + withClue("SPARK-32368: 'recursiveFileLookup' and 'pathGlobFilter' can be case insensitive") { + val fileList2 = spark.read.format("binaryFile") + .option("RecuRsivefileLookup", true) + .option("PaThglobFilter", "*.bin") + .load(dataPath) + .select("path").collect().map(_.getString(0)) - assert(fileList2.toSet === expectedFileList.filter(_.endsWith(".bin")).toSet) + assert(fileList2.toSet === expectedFileList.filter(_.endsWith(".bin")).toSet) + } } } @@ -822,27 +810,6 @@ class FileBasedDataSourceSuite extends QueryTest } } - test("File table location should include both values of option `path` and `paths`") { - withSQLConf(SQLConf.USE_V1_SOURCE_LIST.key -> "") { - withTempPaths(3) { paths => - paths.zipWithIndex.foreach { case (path, index) => - Seq(index).toDF("a").write.mode("overwrite").parquet(path.getCanonicalPath) - } - val df = spark - .read - .option("path", paths.head.getCanonicalPath) - .parquet(paths(1).getCanonicalPath, paths(2).getCanonicalPath) - df.queryExecution.optimizedPlan match { - case PhysicalOperation(_, _, DataSourceV2ScanRelation(table: ParquetTable, _, _)) => - assert(table.paths.toSet == paths.map(_.getCanonicalPath).toSet) - case _ => - throw new AnalysisException("Can not match ParquetTable in the query.") - } - checkAnswer(df, Seq(0, 1, 2).map(Row(_))) - } - } - } - test("SPARK-31116: Select nested schema with case insensitive mode") { // This test case failed at only Parquet. ORC is added for test coverage parity. Seq("orc", "parquet").foreach { format => @@ -882,6 +849,114 @@ class FileBasedDataSourceSuite extends QueryTest } } } + + test("test casts pushdown on orc/parquet for integral types") { + def checkPushedFilters( + format: String, + df: DataFrame, + filters: Array[sources.Filter], + noScan: Boolean = false): Unit = { + val scanExec = df.queryExecution.sparkPlan.find(_.isInstanceOf[BatchScanExec]) + if (noScan) { + assert(scanExec.isEmpty) + return + } + val scan = scanExec.get.asInstanceOf[BatchScanExec].scan + format match { + case "orc" => + assert(scan.isInstanceOf[OrcScan]) + assert(scan.asInstanceOf[OrcScan].pushedFilters === filters) + case "parquet" => + assert(scan.isInstanceOf[ParquetScan]) + assert(scan.asInstanceOf[ParquetScan].pushedFilters === filters) + case _ => + fail(s"unknown format $format") + } + } + + Seq("orc", "parquet").foreach { format => + withSQLConf(SQLConf.USE_V1_SOURCE_LIST.key -> "") { + withTempPath { dir => + spark.range(100).map(i => (i.toShort, i.toString)).toDF("id", "s") + .write + .format(format) + .save(dir.getCanonicalPath) + val df = spark.read.format(format).load(dir.getCanonicalPath) + + // cases when value == MAX + var v = Short.MaxValue + checkPushedFilters(format, df.where('id > v.toInt), Array(), noScan = true) + checkPushedFilters(format, df.where('id >= v.toInt), Array(sources.IsNotNull("id"), + sources.EqualTo("id", v))) + checkPushedFilters(format, df.where('id === v.toInt), Array(sources.IsNotNull("id"), + sources.EqualTo("id", v))) + checkPushedFilters(format, df.where('id <=> v.toInt), + Array(sources.EqualNullSafe("id", v))) + checkPushedFilters(format, df.where('id <= v.toInt), Array(sources.IsNotNull("id"))) + checkPushedFilters(format, df.where('id < v.toInt), Array(sources.IsNotNull("id"), + sources.Not(sources.EqualTo("id", v)))) + + // cases when value > MAX + var v1: Int = positiveInt + checkPushedFilters(format, df.where('id > v1), Array(), noScan = true) + checkPushedFilters(format, df.where('id >= v1), Array(), noScan = true) + checkPushedFilters(format, df.where('id === v1), Array(), noScan = true) + checkPushedFilters(format, df.where('id <=> v1), Array(), noScan = true) + checkPushedFilters(format, df.where('id <= v1), Array(sources.IsNotNull("id"))) + checkPushedFilters(format, df.where('id < v1), Array(sources.IsNotNull("id"))) + + // cases when value = MIN + v = Short.MinValue + checkPushedFilters(format, df.where(lit(v.toInt) < 'id), Array(sources.IsNotNull("id"), + sources.Not(sources.EqualTo("id", v)))) + checkPushedFilters(format, df.where(lit(v.toInt) <= 'id), Array(sources.IsNotNull("id"))) + checkPushedFilters(format, df.where(lit(v.toInt) === 'id), Array(sources.IsNotNull("id"), + sources.EqualTo("id", v))) + checkPushedFilters(format, df.where(lit(v.toInt) <=> 'id), + Array(sources.EqualNullSafe("id", v))) + checkPushedFilters(format, df.where(lit(v.toInt) >= 'id), Array(sources.IsNotNull("id"), + sources.EqualTo("id", v))) + checkPushedFilters(format, df.where(lit(v.toInt) > 'id), Array(), noScan = true) + + // cases when value < MIN + v1 = negativeInt + checkPushedFilters(format, df.where(lit(v1) < 'id), Array(sources.IsNotNull("id"))) + checkPushedFilters(format, df.where(lit(v1) <= 'id), Array(sources.IsNotNull("id"))) + checkPushedFilters(format, df.where(lit(v1) === 'id), Array(), noScan = true) + checkPushedFilters(format, df.where(lit(v1) >= 'id), Array(), noScan = true) + checkPushedFilters(format, df.where(lit(v1) > 'id), Array(), noScan = true) + + // cases when value is within range (MIN, MAX) + checkPushedFilters(format, df.where('id > 30), Array(sources.IsNotNull("id"), + sources.GreaterThan("id", 30))) + checkPushedFilters(format, df.where(lit(100) >= 'id), Array(sources.IsNotNull("id"), + sources.LessThanOrEqual("id", 100))) + } + } + } + } + + test("SPARK-32827: Set max metadata string length") { + withTempDir { dir => + val tableName = "t" + val path = s"${dir.getCanonicalPath}/$tableName" + withTable(tableName) { + sql(s"CREATE TABLE $tableName(c INT) USING PARQUET LOCATION '$path'") + withSQLConf(SQLConf.MAX_METADATA_STRING_LENGTH.key -> "5") { + val explain = spark.table(tableName).queryExecution.explainString(SimpleMode) + assert(!explain.contains(path)) + // metadata has abbreviated by ... + assert(explain.contains("...")) + } + + withSQLConf(SQLConf.MAX_METADATA_STRING_LENGTH.key -> "1000") { + val explain = spark.table(tableName).queryExecution.explainString(SimpleMode) + assert(explain.contains(path)) + assert(!explain.contains("...")) + } + } + } + } } object TestingUDT { @@ -912,3 +987,10 @@ object TestingUDT { override def userClass: Class[NullData] = classOf[NullData] } } + +class FakeFileSystemRequiringDSOption extends LocalFileSystem { + override def initialize(name: URI, conf: Configuration): Unit = { + super.initialize(name, conf) + require(conf.get("ds_option", "") == "value") + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/FileScanSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/FileScanSuite.scala new file mode 100644 index 0000000000000..4e7fe8455ff93 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/FileScanSuite.scala @@ -0,0 +1,374 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import scala.collection.mutable + +import com.google.common.collect.ImmutableMap +import org.apache.hadoop.fs.{FileStatus, Path} + +import org.apache.spark.sql.catalyst.dsl.expressions._ +import org.apache.spark.sql.catalyst.expressions.{And, Expression, IsNull, LessThan} +import org.apache.spark.sql.execution.datasources.{PartitioningAwareFileIndex, PartitionSpec} +import org.apache.spark.sql.execution.datasources.v2.FileScan +import org.apache.spark.sql.execution.datasources.v2.csv.CSVScan +import org.apache.spark.sql.execution.datasources.v2.json.JsonScan +import org.apache.spark.sql.execution.datasources.v2.orc.OrcScan +import org.apache.spark.sql.execution.datasources.v2.parquet.ParquetScan +import org.apache.spark.sql.execution.datasources.v2.text.TextScan +import org.apache.spark.sql.sources.Filter +import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types.StructType +import org.apache.spark.sql.util.CaseInsensitiveStringMap + +trait FileScanSuiteBase extends SharedSparkSession { + private def newPartitioningAwareFileIndex() = { + new PartitioningAwareFileIndex(spark, Map.empty, None) { + override def partitionSpec(): PartitionSpec = { + PartitionSpec.emptySpec + } + + override protected def leafFiles: mutable.LinkedHashMap[Path, FileStatus] = { + mutable.LinkedHashMap.empty + } + + override protected def leafDirToChildrenFiles: Map[Path, Array[FileStatus]] = { + Map.empty + } + + override def rootPaths: Seq[Path] = { + Seq.empty + } + + override def refresh(): Unit = {} + } + } + + type ScanBuilder = ( + SparkSession, + PartitioningAwareFileIndex, + StructType, + StructType, + StructType, + Array[Filter], + CaseInsensitiveStringMap, + Seq[Expression], + Seq[Expression]) => FileScan + + def run(scanBuilders: Seq[(String, ScanBuilder, Seq[String])]): Unit = { + val dataSchema = StructType.fromDDL("data INT, partition INT, other INT") + val dataSchemaNotEqual = StructType.fromDDL("data INT, partition INT, other INT, new INT") + val readDataSchema = StructType.fromDDL("data INT") + val readDataSchemaNotEqual = StructType.fromDDL("data INT, other INT") + val readPartitionSchema = StructType.fromDDL("partition INT") + val readPartitionSchemaNotEqual = StructType.fromDDL("partition INT, other INT") + val pushedFilters = + Array[Filter](sources.And(sources.IsNull("data"), sources.LessThan("data", 0))) + val pushedFiltersNotEqual = + Array[Filter](sources.And(sources.IsNull("data"), sources.LessThan("data", 1))) + val optionsMap = ImmutableMap.of("key", "value") + val options = new CaseInsensitiveStringMap(ImmutableMap.copyOf(optionsMap)) + val optionsNotEqual = + new CaseInsensitiveStringMap(ImmutableMap.copyOf(ImmutableMap.of("key2", "value2"))) + val partitionFilters = Seq(And(IsNull('data.int), LessThan('data.int, 0))) + val partitionFiltersNotEqual = Seq(And(IsNull('data.int), LessThan('data.int, 1))) + val dataFilters = Seq(And(IsNull('data.int), LessThan('data.int, 0))) + val dataFiltersNotEqual = Seq(And(IsNull('data.int), LessThan('data.int, 1))) + + scanBuilders.foreach { case (name, scanBuilder, exclusions) => + test(s"SPARK-33482: Test $name equals") { + val partitioningAwareFileIndex = newPartitioningAwareFileIndex() + + val scan = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFilters) + + val scanEquals = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema.copy(), + readDataSchema.copy(), + readPartitionSchema.copy(), + pushedFilters.clone(), + new CaseInsensitiveStringMap(ImmutableMap.copyOf(optionsMap)), + Seq(partitionFilters: _*), + Seq(dataFilters: _*)) + + assert(scan === scanEquals) + } + + test(s"SPARK-33482: Test $name fileIndex not equals") { + val partitioningAwareFileIndex = newPartitioningAwareFileIndex() + + val scan = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFilters) + + val partitioningAwareFileIndexNotEqual = newPartitioningAwareFileIndex() + + val scanNotEqual = scanBuilder( + spark, + partitioningAwareFileIndexNotEqual, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFilters) + + assert(scan !== scanNotEqual) + } + + if (!exclusions.contains("dataSchema")) { + test(s"SPARK-33482: Test $name dataSchema not equals") { + val partitioningAwareFileIndex = newPartitioningAwareFileIndex() + + val scan = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFilters) + + val scanNotEqual = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchemaNotEqual, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFilters) + + assert(scan !== scanNotEqual) + } + } + + test(s"SPARK-33482: Test $name readDataSchema not equals") { + val partitioningAwareFileIndex = newPartitioningAwareFileIndex() + + val scan = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFilters) + + val scanNotEqual = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchemaNotEqual, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFilters) + + assert(scan !== scanNotEqual) + } + + test(s"SPARK-33482: Test $name readPartitionSchema not equals") { + val partitioningAwareFileIndex = newPartitioningAwareFileIndex() + + val scan = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFilters) + + val scanNotEqual = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchemaNotEqual, + pushedFilters, + options, + partitionFilters, + dataFilters) + + assert(scan !== scanNotEqual) + } + + if (!exclusions.contains("pushedFilters")) { + test(s"SPARK-33482: Test $name pushedFilters not equals") { + val partitioningAwareFileIndex = newPartitioningAwareFileIndex() + + val scan = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFilters) + + val scanNotEqual = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFiltersNotEqual, + options, + partitionFilters, + dataFilters) + + assert(scan !== scanNotEqual) + } + } + + test(s"SPARK-33482: Test $name options not equals") { + val partitioningAwareFileIndex = newPartitioningAwareFileIndex() + + val scan = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFilters) + + val scanNotEqual = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + optionsNotEqual, + partitionFilters, + dataFilters) + + assert(scan !== scanNotEqual) + } + + test(s"SPARK-33482: Test $name partitionFilters not equals") { + val partitioningAwareFileIndex = newPartitioningAwareFileIndex() + + val scan = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFilters) + + val scanNotEqual = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFiltersNotEqual, + dataFilters) + assert(scan !== scanNotEqual) + } + + test(s"SPARK-33482: Test $name dataFilters not equals") { + val partitioningAwareFileIndex = newPartitioningAwareFileIndex() + + val scan = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFilters) + + val scanNotEqual = scanBuilder( + spark, + partitioningAwareFileIndex, + dataSchema, + readDataSchema, + readPartitionSchema, + pushedFilters, + options, + partitionFilters, + dataFiltersNotEqual) + assert(scan !== scanNotEqual) + } + } + } +} + +class FileScanSuite extends FileScanSuiteBase { + val scanBuilders = Seq[(String, ScanBuilder, Seq[String])]( + ("ParquetScan", + (s, fi, ds, rds, rps, f, o, pf, df) => + ParquetScan(s, s.sessionState.newHadoopConf(), fi, ds, rds, rps, f, o, pf, df), + Seq.empty), + ("OrcScan", + (s, fi, ds, rds, rps, f, o, pf, df) => + OrcScan(s, s.sessionState.newHadoopConf(), fi, ds, rds, rps, o, f, pf, df), + Seq.empty), + ("CSVScan", + (s, fi, ds, rds, rps, f, o, pf, df) => CSVScan(s, fi, ds, rds, rps, o, f, pf, df), + Seq.empty), + ("JsonScan", + (s, fi, ds, rds, rps, f, o, pf, df) => JsonScan(s, fi, ds, rds, rps, o, f, pf, df), + Seq.empty), + ("TextScan", + (s, fi, _, rds, rps, _, o, pf, df) => TextScan(s, fi, rds, rps, o, pf, df), + Seq("dataSchema", "pushedFilters"))) + + run(scanBuilders) +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/GenTPCDSData.scala b/sql/core/src/test/scala/org/apache/spark/sql/GenTPCDSData.scala new file mode 100644 index 0000000000000..104ea6c9cfefd --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/GenTPCDSData.scala @@ -0,0 +1,444 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import java.util.concurrent.LinkedBlockingQueue + +import scala.collection.immutable.Stream +import scala.sys.process._ +import scala.util.Try + +import org.apache.spark.SparkContext +import org.apache.spark.internal.Logging +import org.apache.spark.rdd.RDD +import org.apache.spark.sql.functions.{col, rpad} +import org.apache.spark.sql.types.{CharType, StringType, StructField, StructType, VarcharType} + +// The classes in this file are basically moved from https://github.com/databricks/spark-sql-perf + +/** + * Using ProcessBuilder.lineStream produces a stream, that uses + * a LinkedBlockingQueue with a default capacity of Integer.MAX_VALUE. + * + * This causes OOM if the consumer cannot keep up with the producer. + * + * See scala.sys.process.ProcessBuilderImpl.lineStream + */ +object BlockingLineStream { + + // See scala.sys.process.Streamed + private final class BlockingStreamed[T]( + val process: T => Unit, + val done: Int => Unit, + val stream: () => Stream[T]) + + // See scala.sys.process.Streamed + private object BlockingStreamed { + // scala.process.sys.Streamed uses default of Integer.MAX_VALUE, + // which causes OOMs if the consumer cannot keep up with producer. + val maxQueueSize = 65536 + + def apply[T](nonzeroException: Boolean): BlockingStreamed[T] = { + val q = new LinkedBlockingQueue[Either[Int, T]](maxQueueSize) + + def next(): Stream[T] = q.take match { + case Left(0) => Stream.empty + case Left(code) => + if (nonzeroException) scala.sys.error("Nonzero exit code: " + code) else Stream.empty + case Right(s) => Stream.cons(s, next()) + } + + new BlockingStreamed((s: T) => q put Right(s), code => q put Left(code), () => next()) + } + } + + // See scala.sys.process.ProcessImpl.Spawn + private object Spawn { + def apply(f: => Unit): Thread = apply(f, daemon = false) + def apply(f: => Unit, daemon: Boolean): Thread = { + val thread = new Thread() { override def run() = { f } } + thread.setDaemon(daemon) + thread.start() + thread + } + } + + def apply(command: Seq[String]): Stream[String] = { + val streamed = BlockingStreamed[String](true) + val process = command.run(BasicIO(false, streamed.process, None)) + Spawn(streamed.done(process.exitValue())) + streamed.stream() + } +} + +class Dsdgen(dsdgenDir: String) extends Serializable { + private val dsdgen = s"$dsdgenDir/dsdgen" + + def generate( + sparkContext: SparkContext, + tableName: String, + partitions: Int, + scaleFactor: Int): RDD[String] = { + val generatedData = { + sparkContext.parallelize(1 to partitions, partitions).flatMap { i => + val localToolsDir = if (new java.io.File(dsdgen).exists) { + dsdgenDir + } else if (new java.io.File(s"/$dsdgen").exists) { + s"/$dsdgenDir" + } else { + throw new IllegalStateException( + s"Could not find dsdgen at $dsdgen or /$dsdgen. Run install") + } + + // NOTE: RNGSEED is the RNG seed used by the data generator. Right now, it is fixed to 100. + val parallel = if (partitions > 1) s"-parallel $partitions -child $i" else "" + val commands = Seq( + "bash", "-c", + s"cd $localToolsDir && ./dsdgen -table $tableName -filter Y -scale $scaleFactor " + + s"-RNGSEED 100 $parallel") + BlockingLineStream(commands) + } + } + + generatedData.setName(s"$tableName, sf=$scaleFactor, strings") + generatedData + } +} + +class TPCDSTables(sqlContext: SQLContext, dsdgenDir: String, scaleFactor: Int) + extends TPCDSSchema with Logging with Serializable { + + private val dataGenerator = new Dsdgen(dsdgenDir) + + private def tables: Seq[Table] = tableColumns.map { case (tableName, schemaString) => + val partitionColumns = tablePartitionColumns.getOrElse(tableName, Nil) + .map(_.stripPrefix("`").stripSuffix("`")) + Table(tableName, partitionColumns, StructType.fromDDL(schemaString)) + }.toSeq + + private case class Table(name: String, partitionColumns: Seq[String], schema: StructType) { + def nonPartitioned: Table = { + Table(name, Nil, schema) + } + + private def df(numPartition: Int) = { + val generatedData = dataGenerator.generate( + sqlContext.sparkContext, name, numPartition, scaleFactor) + val rows = generatedData.mapPartitions { iter => + iter.map { l => + val values = l.split("\\|", -1).dropRight(1).map { v => + if (v.equals("")) { + // If the string value is an empty string, we turn it to a null + null + } else { + v + } + } + Row.fromSeq(values) + } + } + + val stringData = + sqlContext.createDataFrame( + rows, + StructType(schema.fields.map(f => StructField(f.name, StringType)))) + + val convertedData = { + val columns = schema.fields.map { f => + val c = f.dataType match { + // Needs right-padding for char types + case CharType(n) => rpad(Column(f.name), n, " ") + // Don't need a cast for varchar types + case _: VarcharType => col(f.name) + case _ => col(f.name).cast(f.dataType) + } + c.as(f.name) + } + stringData.select(columns: _*) + } + + convertedData + } + + def genData( + location: String, + format: String, + overwrite: Boolean, + clusterByPartitionColumns: Boolean, + filterOutNullPartitionValues: Boolean, + numPartitions: Int): Unit = { + val mode = if (overwrite) SaveMode.Overwrite else SaveMode.Ignore + + val data = df(numPartitions) + val tempTableName = s"${name}_text" + data.createOrReplaceTempView(tempTableName) + + val writer = if (partitionColumns.nonEmpty) { + if (clusterByPartitionColumns) { + val columnString = data.schema.fields.map { field => + field.name + }.mkString(",") + val partitionColumnString = partitionColumns.mkString(",") + val predicates = if (filterOutNullPartitionValues) { + partitionColumns.map(col => s"$col IS NOT NULL").mkString("WHERE ", " AND ", "") + } else { + "" + } + + val query = + s""" + |SELECT + | $columnString + |FROM + | $tempTableName + |$predicates + |DISTRIBUTE BY + | $partitionColumnString + """.stripMargin + val grouped = sqlContext.sql(query) + logInfo(s"Pre-clustering with partitioning columns with query $query.") + grouped.write + } else { + data.write + } + } else { + // treat non-partitioned tables as "one partition" that we want to coalesce + if (clusterByPartitionColumns) { + // in case data has more than maxRecordsPerFile, split into multiple writers to improve + // datagen speed files will be truncated to maxRecordsPerFile value, so the final + // result will be the same. + val numRows = data.count + val maxRecordPerFile = Try { + sqlContext.getConf("spark.sql.files.maxRecordsPerFile").toInt + }.getOrElse(0) + + if (maxRecordPerFile > 0 && numRows > maxRecordPerFile) { + val numFiles = (numRows.toDouble/maxRecordPerFile).ceil.toInt + logInfo(s"Coalescing into $numFiles files") + data.coalesce(numFiles).write + } else { + data.coalesce(1).write + } + } else { + data.write + } + } + writer.format(format).mode(mode) + if (partitionColumns.nonEmpty) { + writer.partitionBy(partitionColumns: _*) + } + logInfo(s"Generating table $name in database to $location with save mode $mode.") + writer.save(location) + sqlContext.dropTempTable(tempTableName) + } + } + + def genData( + location: String, + format: String, + overwrite: Boolean, + partitionTables: Boolean, + clusterByPartitionColumns: Boolean, + filterOutNullPartitionValues: Boolean, + tableFilter: String = "", + numPartitions: Int = 100): Unit = { + var tablesToBeGenerated = if (partitionTables) { + tables + } else { + tables.map(_.nonPartitioned) + } + + if (!tableFilter.isEmpty) { + tablesToBeGenerated = tablesToBeGenerated.filter(_.name == tableFilter) + if (tablesToBeGenerated.isEmpty) { + throw new RuntimeException("Bad table name filter: " + tableFilter) + } + } + + tablesToBeGenerated.foreach { table => + val tableLocation = s"$location/${table.name}" + table.genData(tableLocation, format, overwrite, clusterByPartitionColumns, + filterOutNullPartitionValues, numPartitions) + } + } +} + +class GenTPCDSDataConfig(args: Array[String]) { + var master: String = "local[*]" + var dsdgenDir: String = null + var location: String = null + var scaleFactor: Int = 1 + var format: String = "parquet" + var overwrite: Boolean = false + var partitionTables: Boolean = false + var clusterByPartitionColumns: Boolean = false + var filterOutNullPartitionValues: Boolean = false + var tableFilter: String = "" + var numPartitions: Int = 100 + + parseArgs(args.toList) + + private def parseArgs(inputArgs: List[String]): Unit = { + var args = inputArgs + + while (args.nonEmpty) { + args match { + case "--master" :: value :: tail => + master = value + args = tail + + case "--dsdgenDir" :: value :: tail => + dsdgenDir = value + args = tail + + case "--location" :: value :: tail => + location = value + args = tail + + case "--scaleFactor" :: value :: tail => + scaleFactor = toPositiveIntValue("Scale factor", value) + args = tail + + case "--format" :: value :: tail => + format = value + args = tail + + case "--overwrite" :: tail => + overwrite = true + args = tail + + case "--partitionTables" :: tail => + partitionTables = true + args = tail + + case "--clusterByPartitionColumns" :: tail => + clusterByPartitionColumns = true + args = tail + + case "--filterOutNullPartitionValues" :: tail => + filterOutNullPartitionValues = true + args = tail + + case "--tableFilter" :: value :: tail => + tableFilter = value + args = tail + + case "--numPartitions" :: value :: tail => + numPartitions = toPositiveIntValue("Number of partitions", value) + args = tail + + case "--help" :: tail => + printUsageAndExit(0) + + case _ => + // scalastyle:off println + System.err.println("Unknown/unsupported param " + args) + // scalastyle:on println + printUsageAndExit(1) + } + } + + checkRequiredArguments() + } + + private def printUsageAndExit(exitCode: Int): Unit = { + // scalastyle:off + System.err.println(""" + |build/sbt "test:runMain [Options]" + |Options: + | --master the Spark master to use, default to local[*] + | --dsdgenDir location of dsdgen + | --location root directory of location to generate data in + | --scaleFactor size of the dataset to generate (in GB) + | --format generated data format, Parquet, ORC ... + | --overwrite whether to overwrite the data that is already there + | --partitionTables whether to create the partitioned fact tables + | --clusterByPartitionColumns whether to shuffle to get partitions coalesced into single files + | --filterOutNullPartitionValues whether to filter out the partition with NULL key value + | --tableFilter comma-separated list of table names to generate (e.g., store_sales,store_returns), + | all the tables are generated by default + | --numPartitions how many dsdgen partitions to run - number of input tasks + """.stripMargin) + // scalastyle:on + System.exit(exitCode) + } + + private def toPositiveIntValue(name: String, v: String): Int = { + if (Try(v.toInt).getOrElse(-1) <= 0) { + // scalastyle:off println + System.err.println(s"$name must be a positive number") + // scalastyle:on println + printUsageAndExit(-1) + } + v.toInt + } + + private def checkRequiredArguments(): Unit = { + if (dsdgenDir == null) { + // scalastyle:off println + System.err.println("Must specify a dsdgen path") + // scalastyle:on println + printUsageAndExit(-1) + } + if (location == null) { + // scalastyle:off println + System.err.println("Must specify an output location") + // scalastyle:on println + printUsageAndExit(-1) + } + } +} + +/** + * This class generates TPCDS table data by using tpcds-kit: + * - https://github.com/databricks/tpcds-kit + * + * To run this: + * {{{ + * build/sbt "sql/test:runMain --dsdgenDir --location --scaleFactor 1" + * }}} + */ +object GenTPCDSData { + + def main(args: Array[String]): Unit = { + val config = new GenTPCDSDataConfig(args) + + val spark = SparkSession + .builder() + .appName(getClass.getName) + .master(config.master) + .getOrCreate() + + val tables = new TPCDSTables( + spark.sqlContext, + dsdgenDir = config.dsdgenDir, + scaleFactor = config.scaleFactor) + + tables.genData( + location = config.location, + format = config.format, + overwrite = config.overwrite, + partitionTables = config.partitionTables, + clusterByPartitionColumns = config.clusterByPartitionColumns, + filterOutNullPartitionValues = config.filterOutNullPartitionValues, + tableFilter = config.tableFilter, + numPartitions = config.numPartitions) + + spark.stop() + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/GeneratorFunctionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/GeneratorFunctionSuite.scala index 8f449037a5e01..311bc52515827 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/GeneratorFunctionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/GeneratorFunctionSuite.scala @@ -21,6 +21,7 @@ import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.{Expression, Generator} import org.apache.spark.sql.catalyst.expressions.codegen.{CodegenContext, ExprCode} import org.apache.spark.sql.catalyst.expressions.codegen.Block._ +import org.apache.spark.sql.catalyst.trees.LeafLike import org.apache.spark.sql.functions._ import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types.{IntegerType, StructType} @@ -358,8 +359,7 @@ class GeneratorFunctionSuite extends QueryTest with SharedSparkSession { } } -case class EmptyGenerator() extends Generator { - override def children: Seq[Expression] = Nil +case class EmptyGenerator() extends Generator with LeafLike[Expression] { override def elementSchema: StructType = new StructType().add("id", IntegerType) override def eval(input: InternalRow): TraversableOnce[InternalRow] = Seq.empty override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/IntegratedUDFTestUtils.scala b/sql/core/src/test/scala/org/apache/spark/sql/IntegratedUDFTestUtils.scala index 4a4504a075060..a090eba430061 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/IntegratedUDFTestUtils.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/IntegratedUDFTestUtils.scala @@ -27,7 +27,6 @@ import org.scalatest.Assertions._ import org.apache.spark.TestUtils import org.apache.spark.api.python.{PythonBroadcast, PythonEvalType, PythonFunction, PythonUtils} import org.apache.spark.broadcast.Broadcast -import org.apache.spark.internal.config.Tests import org.apache.spark.sql.catalyst.expressions.{Cast, Expression} import org.apache.spark.sql.catalyst.plans.SQLHelper import org.apache.spark.sql.execution.python.UserDefinedPythonFunction @@ -75,14 +74,7 @@ object IntegratedUDFTestUtils extends SQLHelper { import scala.sys.process._ private lazy val pythonPath = sys.env.getOrElse("PYTHONPATH", "") - private lazy val sparkHome = if (sys.props.contains(Tests.IS_TESTING.key)) { - assert(sys.props.contains("spark.test.home") || - sys.env.contains("SPARK_HOME"), "spark.test.home or SPARK_HOME is not set.") - sys.props.getOrElse("spark.test.home", sys.env("SPARK_HOME")) - } else { - assert(sys.env.contains("SPARK_HOME"), "SPARK_HOME is not set.") - sys.env("SPARK_HOME") - } + // Note that we will directly refer pyspark's source, not the zip from a regular build. // It is possible the test is being ran without the build. private lazy val sourcePath = Paths.get(sparkHome, "python").toAbsolutePath @@ -204,7 +196,7 @@ object IntegratedUDFTestUtils extends SQLHelper { lazy val pythonExec: String = { val pythonExec = sys.env.getOrElse( - "PYSPARK_DRIVER_PYTHON", sys.env.getOrElse("PYSPARK_PYTHON", "python3.6")) + "PYSPARK_DRIVER_PYTHON", sys.env.getOrElse("PYSPARK_PYTHON", "python3")) if (TestUtils.testCommandAvailable(pythonExec)) { pythonExec } else { @@ -329,25 +321,33 @@ object IntegratedUDFTestUtils extends SQLHelper { * casted_col.cast(df.schema("col").dataType) * }}} */ - case class TestScalaUDF(name: String) extends TestUDF { - private[IntegratedUDFTestUtils] lazy val udf = new SparkUserDefinedFunction( - (input: Any) => if (input == null) { - null - } else { - input.toString - }, - StringType, - inputEncoders = Seq.fill(1)(None), - name = Some(name)) { - - override def apply(exprs: Column*): Column = { - assert(exprs.length == 1, "Defined UDF only has one column") - val expr = exprs.head.expr - assert(expr.resolved, "column should be resolved to use the same type " + - "as input. Try df(name) or df.col(name)") - Column(Cast(createScalaUDF(Cast(expr, StringType) :: Nil), expr.dataType)) - } + class TestInternalScalaUDF(name: String) extends SparkUserDefinedFunction( + (input: Any) => if (input == null) { + null + } else { + input.toString + }, + StringType, + inputEncoders = Seq.fill(1)(None), + name = Some(name)) { + + override def apply(exprs: Column*): Column = { + assert(exprs.length == 1, "Defined UDF only has one column") + val expr = exprs.head.expr + assert(expr.resolved, "column should be resolved to use the same type " + + "as input. Try df(name) or df.col(name)") + Column(Cast(createScalaUDF(Cast(expr, StringType) :: Nil), expr.dataType)) + } + + override def withName(name: String): TestInternalScalaUDF = { + // "withName" should overridden to return TestInternalScalaUDF. Otherwise, the current object + // is sliced and the overridden "apply" is not invoked. + new TestInternalScalaUDF(name) } + } + + case class TestScalaUDF(name: String) extends TestUDF { + private[IntegratedUDFTestUtils] lazy val udf = new TestInternalScalaUDF(name) def apply(exprs: Column*): Column = udf(exprs: _*) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/JoinHintSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/JoinHintSuite.scala index f68c416941266..9f4c24b46a9b9 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/JoinHintSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/JoinHintSuite.scala @@ -19,7 +19,7 @@ package org.apache.spark.sql import org.apache.log4j.Level -import org.apache.spark.sql.catalyst.optimizer.EliminateResolvedHint +import org.apache.spark.sql.catalyst.optimizer.{BuildLeft, BuildRight, BuildSide, EliminateResolvedHint} import org.apache.spark.sql.catalyst.plans.PlanTest import org.apache.spark.sql.catalyst.plans.logical._ import org.apache.spark.sql.catalyst.rules.RuleExecutor @@ -570,4 +570,31 @@ class JoinHintSuite extends PlanTest with SharedSparkSession with AdaptiveSparkP assert(joinHints == expectedHints) } } + + test("SPARK-32220: Non Cartesian Product Join Result Correct with SHUFFLE_REPLICATE_NL hint") { + withTempView("t1", "t2") { + Seq((1, "4"), (2, "2")).toDF("key", "value").createTempView("t1") + Seq((1, "1"), (2, "12.3"), (2, "123")).toDF("key", "value").createTempView("t2") + val df1 = sql("SELECT /*+ shuffle_replicate_nl(t1) */ * from t1 join t2 ON t1.key = t2.key") + val df2 = sql("SELECT * from t1 join t2 ON t1.key = t2.key") + assert(df1.collect().size == df2.collect().size) + + val df3 = sql("SELECT /*+ shuffle_replicate_nl(t1) */ * from t1 join t2") + val df4 = sql("SELECT * from t1 join t2") + assert(df3.collect().size == df4.collect().size) + + val df5 = sql("SELECT /*+ shuffle_replicate_nl(t1) */ * from t1 join t2 ON t1.key < t2.key") + val df6 = sql("SELECT * from t1 join t2 ON t1.key < t2.key") + assert(df5.collect().size == df6.collect().size) + + val df7 = sql("SELECT /*+ shuffle_replicate_nl(t1) */ * from t1 join t2 ON t1.key < 2") + val df8 = sql("SELECT * from t1 join t2 ON t1.key < 2") + assert(df7.collect().size == df8.collect().size) + + + val df9 = sql("SELECT /*+ shuffle_replicate_nl(t1) */ * from t1 join t2 ON t2.key < 2") + val df10 = sql("SELECT * from t1 join t2 ON t2.key < 2") + assert(df9.collect().size == df10.collect().size) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/JoinSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/JoinSuite.scala index fe6775cc7f9b9..acbf30089a92e 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/JoinSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/JoinSuite.scala @@ -29,8 +29,9 @@ import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.analysis.UnresolvedRelation import org.apache.spark.sql.catalyst.expressions.{Ascending, GenericRow, SortOrder} import org.apache.spark.sql.catalyst.plans.logical.Filter -import org.apache.spark.sql.execution.{BinaryExecNode, FilterExec, SortExec, SparkPlan} +import org.apache.spark.sql.execution.{BinaryExecNode, FilterExec, ProjectExec, SortExec, SparkPlan, WholeStageCodegenExec} import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper +import org.apache.spark.sql.execution.exchange.ShuffleExchangeExec import org.apache.spark.sql.execution.joins._ import org.apache.spark.sql.execution.python.BatchEvalPythonExec import org.apache.spark.sql.internal.SQLConf @@ -88,6 +89,7 @@ class JoinSuite extends QueryTest with SharedSparkSession with AdaptiveSparkPlan if (operators.head.getClass != c) { fail(s"$sqlString expected operator: $c, but got ${operators.head}\n physical: \n$physical") } + operators.head } test("join operator selection") { @@ -712,7 +714,7 @@ class JoinSuite extends QueryTest with SharedSparkSession with AdaptiveSparkPlan |ON | big.key = small.a """.stripMargin), - expected + expected.toSeq ) } @@ -729,7 +731,7 @@ class JoinSuite extends QueryTest with SharedSparkSession with AdaptiveSparkPlan |ON | big.key = small.a """.stripMargin), - expected + expected.toSeq ) } } @@ -747,6 +749,22 @@ class JoinSuite extends QueryTest with SharedSparkSession with AdaptiveSparkPlan ) } + // LEFT SEMI JOIN without bound condition does not spill + assertNotSpilled(sparkContext, "left semi join") { + checkAnswer( + sql("SELECT * FROM testData LEFT SEMI JOIN testData2 ON key = a WHERE key = 2"), + Row(2, "2") :: Nil + ) + } + + // LEFT ANTI JOIN without bound condition does not spill + assertNotSpilled(sparkContext, "left anti join") { + checkAnswer( + sql("SELECT * FROM testData LEFT ANTI JOIN testData2 ON key = a WHERE key = 2"), + Nil + ) + } + val expected = new ListBuffer[Row]() expected.append( Row(1, "1", 1, 1), Row(1, "1", 1, 2), @@ -770,7 +788,7 @@ class JoinSuite extends QueryTest with SharedSparkSession with AdaptiveSparkPlan |ON | big.key = small.a """.stripMargin), - expected + expected.toSeq ) } @@ -787,7 +805,7 @@ class JoinSuite extends QueryTest with SharedSparkSession with AdaptiveSparkPlan |ON | big.key = small.a """.stripMargin), - expected + expected.toSeq ) } @@ -806,7 +824,7 @@ class JoinSuite extends QueryTest with SharedSparkSession with AdaptiveSparkPlan |ON | big.key = small.a """.stripMargin), - expected + expected.toSeq ) } } @@ -1086,4 +1104,294 @@ class JoinSuite extends QueryTest with SharedSparkSession with AdaptiveSparkPlan assert(df2.join(df1, "id").collect().isEmpty) } } + + test("SPARK-32330: Preserve shuffled hash join build side partitioning") { + val df1 = spark.range(10).select($"id".as("k1")) + val df2 = spark.range(30).select($"id".as("k2")) + Seq("inner", "cross").foreach(joinType => { + val plan = df1.join(df2.hint("SHUFFLE_HASH"), $"k1" === $"k2", joinType) + .groupBy($"k1").count() + .queryExecution.executedPlan + assert(collect(plan) { case _: ShuffledHashJoinExec => true }.size === 1) + // No extra shuffle before aggregate + assert(collect(plan) { case _: ShuffleExchangeExec => true }.size === 2) + }) + } + + test("SPARK-32383: Preserve hash join (BHJ and SHJ) stream side ordering") { + val df1 = spark.range(100).select($"id".as("k1")) + val df2 = spark.range(100).select($"id".as("k2")) + val df3 = spark.range(3).select($"id".as("k3")) + val df4 = spark.range(100).select($"id".as("k4")) + + // Test broadcast hash join + Seq("inner", "left_outer").foreach(joinType => { + val plan = df1.join(df2.hint("SHUFFLE_MERGE"), $"k1" === $"k2", joinType) + .join(df3.hint("BROADCAST"), $"k1" === $"k3", joinType) + .join(df4.hint("SHUFFLE_MERGE"), $"k1" === $"k4", joinType) + .queryExecution + .executedPlan + assert(collect(plan) { case _: SortMergeJoinExec => true }.size === 2) + assert(collect(plan) { case _: BroadcastHashJoinExec => true }.size === 1) + // No extra sort before last sort merge join + assert(collect(plan) { case _: SortExec => true }.size === 3) + }) + + // Test shuffled hash join + Seq("inner", "left_outer").foreach(joinType => { + val plan = df1.join(df2.hint("SHUFFLE_MERGE"), $"k1" === $"k2", joinType) + .join(df3.hint("SHUFFLE_HASH"), $"k1" === $"k3", joinType) + .join(df4.hint("SHUFFLE_MERGE"), $"k1" === $"k4", joinType) + .queryExecution + .executedPlan + assert(collect(plan) { case _: SortMergeJoinExec => true }.size === 2) + assert(collect(plan) { case _: ShuffledHashJoinExec => true }.size === 1) + // No extra sort before last sort merge join + assert(collect(plan) { case _: SortExec => true }.size === 3) + }) + } + + test("SPARK-32290: SingleColumn Null Aware Anti Join Optimize") { + withSQLConf(SQLConf.OPTIMIZE_NULL_AWARE_ANTI_JOIN.key -> "true", + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> Long.MaxValue.toString) { + // positive not in subquery case + var joinExec = assertJoin(( + "select * from testData where key not in (select a from testData2)", + classOf[BroadcastHashJoinExec])) + assert(joinExec.asInstanceOf[BroadcastHashJoinExec].isNullAwareAntiJoin) + + // negative not in subquery case since multi-column is not supported + assertJoin(( + "select * from testData where (key, key + 1) not in (select * from testData2)", + classOf[BroadcastNestedLoopJoinExec])) + + // positive hand-written left anti join + // testData.key nullable false + // testData3.b nullable true + joinExec = assertJoin(( + "select * from testData left anti join testData3 ON key = b or isnull(key = b)", + classOf[BroadcastHashJoinExec])) + assert(joinExec.asInstanceOf[BroadcastHashJoinExec].isNullAwareAntiJoin) + + // negative hand-written left anti join + // testData.key nullable false + // testData2.a nullable false + // isnull(key = a) will be optimized to true literal and removed + joinExec = assertJoin(( + "select * from testData left anti join testData2 ON key = a or isnull(key = a)", + classOf[BroadcastHashJoinExec])) + assert(!joinExec.asInstanceOf[BroadcastHashJoinExec].isNullAwareAntiJoin) + + // negative hand-written left anti join + // not match pattern Or(EqualTo(a=b), IsNull(EqualTo(a=b)) + assertJoin(( + "select * from testData2 left anti join testData3 ON testData2.a = testData3.b or " + + "isnull(testData2.b = testData3.b)", + classOf[BroadcastNestedLoopJoinExec])) + } + } + + test("SPARK-32399: Full outer shuffled hash join") { + val inputDFs = Seq( + // Test unique join key + (spark.range(10).selectExpr("id as k1"), + spark.range(30).selectExpr("id as k2"), + $"k1" === $"k2"), + // Test non-unique join key + (spark.range(10).selectExpr("id % 5 as k1"), + spark.range(30).selectExpr("id % 5 as k2"), + $"k1" === $"k2"), + // Test empty build side + (spark.range(10).selectExpr("id as k1").filter("k1 < -1"), + spark.range(30).selectExpr("id as k2"), + $"k1" === $"k2"), + // Test empty stream side + (spark.range(10).selectExpr("id as k1"), + spark.range(30).selectExpr("id as k2").filter("k2 < -1"), + $"k1" === $"k2"), + // Test empty build and stream side + (spark.range(10).selectExpr("id as k1").filter("k1 < -1"), + spark.range(30).selectExpr("id as k2").filter("k2 < -1"), + $"k1" === $"k2"), + // Test string join key + (spark.range(10).selectExpr("cast(id * 3 as string) as k1"), + spark.range(30).selectExpr("cast(id as string) as k2"), + $"k1" === $"k2"), + // Test build side at right + (spark.range(30).selectExpr("cast(id / 3 as string) as k1"), + spark.range(10).selectExpr("cast(id as string) as k2"), + $"k1" === $"k2"), + // Test NULL join key + (spark.range(10).map(i => if (i % 2 == 0) i else null).selectExpr("value as k1"), + spark.range(30).map(i => if (i % 4 == 0) i else null).selectExpr("value as k2"), + $"k1" === $"k2"), + (spark.range(10).map(i => if (i % 3 == 0) i else null).selectExpr("value as k1"), + spark.range(30).map(i => if (i % 5 == 0) i else null).selectExpr("value as k2"), + $"k1" === $"k2"), + // Test multiple join keys + (spark.range(10).map(i => if (i % 2 == 0) i else null).selectExpr( + "value as k1", "cast(value % 5 as short) as k2", "cast(value * 3 as long) as k3"), + spark.range(30).map(i => if (i % 3 == 0) i else null).selectExpr( + "value as k4", "cast(value % 5 as short) as k5", "cast(value * 3 as long) as k6"), + $"k1" === $"k4" && $"k2" === $"k5" && $"k3" === $"k6") + ) + inputDFs.foreach { case (df1, df2, joinExprs) => + val smjDF = df1.join(df2.hint("SHUFFLE_MERGE"), joinExprs, "full") + assert(collect(smjDF.queryExecution.executedPlan) { + case _: SortMergeJoinExec => true }.size === 1) + val smjResult = smjDF.collect() + + val shjDF = df1.join(df2.hint("SHUFFLE_HASH"), joinExprs, "full") + assert(collect(shjDF.queryExecution.executedPlan) { + case _: ShuffledHashJoinExec => true }.size === 1) + // Same result between shuffled hash join and sort merge join + checkAnswer(shjDF, smjResult) + } + } + + test("SPARK-32649: Optimize BHJ/SHJ inner/semi join with empty hashed relation") { + val inputDFs = Seq( + // Test empty build side for inner join + (spark.range(30).selectExpr("id as k1"), + spark.range(10).selectExpr("id as k2").filter("k2 < -1"), + "inner"), + // Test empty build side for semi join + (spark.range(30).selectExpr("id as k1"), + spark.range(10).selectExpr("id as k2").filter("k2 < -1"), + "semi") + ) + inputDFs.foreach { case (df1, df2, joinType) => + // Test broadcast hash join + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") { + val bhjCodegenDF = df1.join(df2.hint("BROADCAST"), $"k1" === $"k2", joinType) + assert(bhjCodegenDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(_ : BroadcastHashJoinExec) => true + case WholeStageCodegenExec(ProjectExec(_, _ : BroadcastHashJoinExec)) => true + }.size === 1) + checkAnswer(bhjCodegenDF, Seq.empty) + + withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") { + val bhjNonCodegenDF = df1.join(df2, $"k1" === $"k2", joinType) + assert(bhjNonCodegenDF.queryExecution.executedPlan.collect { + case _: BroadcastHashJoinExec => true }.size === 1) + checkAnswer(bhjNonCodegenDF, Seq.empty) + } + } + + // Test shuffled hash join + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") { + val shjCodegenDF = df1.join(df2.hint("SHUFFLE_HASH"), $"k1" === $"k2", joinType) + assert(shjCodegenDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(_ : ShuffledHashJoinExec) => true + case WholeStageCodegenExec(ProjectExec(_, _ : ShuffledHashJoinExec)) => true + }.size === 1) + checkAnswer(shjCodegenDF, Seq.empty) + + withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") { + val shjNonCodegenDF = df1.join(df2.hint("SHUFFLE_HASH"), $"k1" === $"k2", joinType) + assert(shjNonCodegenDF.queryExecution.executedPlan.collect { + case _: ShuffledHashJoinExec => true }.size === 1) + checkAnswer(shjNonCodegenDF, Seq.empty) + } + } + } + } + + test("SPARK-34593: Preserve broadcast nested loop join partitioning and ordering") { + withTable("t1", "t2", "t3", "t4", "t5") { + spark.range(15).toDF("k").write.bucketBy(4, "k").saveAsTable("t1") + spark.range(6).toDF("k").write.bucketBy(4, "k").saveAsTable("t2") + spark.range(8).toDF("k").write.saveAsTable("t3") + spark.range(9).toDF("k").write.saveAsTable("t4") + spark.range(11).toDF("k").write.saveAsTable("t5") + + def getAggQuery(selectExpr: String, joinType: String): String = { + s""" + |SELECT k, COUNT(*) + |FROM (SELECT $selectExpr FROM t1 $joinType JOIN t2) + |GROUP BY k + """.stripMargin + } + + // Test output partitioning is preserved + Seq("INNER", "LEFT OUTER", "RIGHT OUTER", "LEFT SEMI", "LEFT ANTI").foreach { + joinType => + val selectExpr = if (joinType == "RIGHT OUTER") { + "/*+ BROADCAST(t1) */ t2.k AS k" + } else { + "/*+ BROADCAST(t2) */ t1.k as k" + } + val plan = sql(getAggQuery(selectExpr, joinType)).queryExecution.executedPlan + assert(collect(plan) { case _: BroadcastNestedLoopJoinExec => true }.size === 1) + // No extra shuffle before aggregation + assert(collect(plan) { case _: ShuffleExchangeExec => true }.size === 0) + } + + // Test output partitioning is not preserved + Seq("LEFT OUTER", "RIGHT OUTER", "LEFT SEMI", "LEFT ANTI", "FULL OUTER").foreach { + joinType => + val selectExpr = if (joinType == "RIGHT OUTER") { + "/*+ BROADCAST(t2) */ t1.k AS k" + } else { + "/*+ BROADCAST(t1) */ t1.k as k" + } + val plan = sql(getAggQuery(selectExpr, joinType)).queryExecution.executedPlan + assert(collect(plan) { case _: BroadcastNestedLoopJoinExec => true }.size === 1) + // Have shuffle before aggregation + assert(collect(plan) { case _: ShuffleExchangeExec => true }.size === 1) + } + + def getJoinQuery(selectExpr: String, joinType: String): String = { + s""" + |SELECT /*+ MERGE(t3) */ t3.k + |FROM + |( + | SELECT $selectExpr + | FROM + | (SELECT /*+ MERGE(t4) */ t1.k AS k1 FROM t1 JOIN t4 ON t1.k = t4.k) AS left_t + | $joinType JOIN + | (SELECT /*+ MERGE(t5) */ t2.k AS k2 FROM t2 JOIN t5 ON t2.k = t5.k) AS right_t + |) + |JOIN t3 + |ON t3.k = k0 + """.stripMargin + } + + // Test output ordering is preserved + Seq("INNER", "LEFT OUTER", "RIGHT OUTER", "LEFT SEMI", "LEFT ANTI").foreach { + joinType => + val selectExpr = if (joinType == "RIGHT OUTER") { + "/*+ BROADCAST(left_t) */ k2 AS k0" + } else { + "/*+ BROADCAST(right_t) */ k1 as k0" + } + val plan = sql(getJoinQuery(selectExpr, joinType)).queryExecution.executedPlan + assert(collect(plan) { case _: BroadcastNestedLoopJoinExec => true }.size === 1) + assert(collect(plan) { case _: SortMergeJoinExec => true }.size === 3) + // No extra sort on left side before last sort merge join + assert(collect(plan) { case _: SortExec => true }.size === 5) + } + + // Test output ordering is not preserved + Seq("LEFT OUTER", "FULL OUTER").foreach { + joinType => + val selectExpr = "/*+ BROADCAST(left_t) */ k1 as k0" + val plan = sql(getJoinQuery(selectExpr, joinType)).queryExecution.executedPlan + assert(collect(plan) { case _: BroadcastNestedLoopJoinExec => true }.size === 1) + assert(collect(plan) { case _: SortMergeJoinExec => true }.size === 3) + // Have sort on left side before last sort merge join + assert(collect(plan) { case _: SortExec => true }.size === 6) + } + + // Test singe partition + val fullJoinDF = sql( + s""" + |SELECT /*+ BROADCAST(t1) */ COUNT(*) + |FROM range(0, 10, 1, 1) t1 FULL OUTER JOIN range(0, 10, 1, 1) t2 + |""".stripMargin) + val plan = fullJoinDF.queryExecution.executedPlan + assert(collect(plan) { case _: ShuffleExchangeExec => true}.size == 1) + checkAnswer(fullJoinDF, Row(100)) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/JsonFunctionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/JsonFunctionsSuite.scala index 03b48451c7495..310e170e8c1b1 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/JsonFunctionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/JsonFunctionsSuite.scala @@ -411,7 +411,7 @@ class JsonFunctionsSuite extends QueryTest with SharedSparkSession { test("infers schemas using options") { val df = spark.range(1) .select(schema_of_json(lit("{a:1}"), Map("allowUnquotedFieldNames" -> "true").asJava)) - checkAnswer(df, Seq(Row("struct"))) + checkAnswer(df, Seq(Row("STRUCT<`a`: BIGINT>"))) } test("from_json - array of primitive types") { @@ -684,14 +684,14 @@ class JsonFunctionsSuite extends QueryTest with SharedSparkSession { val input = regexp_replace(lit("""{"item_id": 1, "item_price": 0.1}"""), "item_", "") checkAnswer( spark.range(1).select(schema_of_json(input)), - Seq(Row("struct"))) + Seq(Row("STRUCT<`id`: BIGINT, `price`: DOUBLE>"))) } test("SPARK-31065: schema_of_json - null and empty strings as strings") { Seq("""{"id": null}""", """{"id": ""}""").foreach { input => checkAnswer( spark.range(1).select(schema_of_json(input)), - Seq(Row("struct"))) + Seq(Row("STRUCT<`id`: STRING>"))) } } @@ -703,7 +703,7 @@ class JsonFunctionsSuite extends QueryTest with SharedSparkSession { schema_of_json( lit("""{"id": "a", "drop": {"drop": null}}"""), options.asJava)), - Seq(Row("struct"))) + Seq(Row("STRUCT<`id`: STRING>"))) // Array of structs checkAnswer( @@ -711,7 +711,7 @@ class JsonFunctionsSuite extends QueryTest with SharedSparkSession { schema_of_json( lit("""[{"id": "a", "drop": {"drop": null}}]"""), options.asJava)), - Seq(Row("array>"))) + Seq(Row("ARRAY>"))) // Other types are not affected. checkAnswer( @@ -719,7 +719,7 @@ class JsonFunctionsSuite extends QueryTest with SharedSparkSession { schema_of_json( lit("""null"""), options.asJava)), - Seq(Row("string"))) + Seq(Row("STRING"))) } test("optional datetime parser does not affect json time formatting") { @@ -733,4 +733,111 @@ class JsonFunctionsSuite extends QueryTest with SharedSparkSession { | """.stripMargin) checkAnswer(toDF("yyyy-MM-dd'T'HH:mm:ss.SSSXXX"), toDF("yyyy-MM-dd'T'HH:mm:ss[.SSS][XXX]")) } + + test("SPARK-33134: return partial results only for root JSON objects") { + val st = new StructType() + .add("c1", LongType) + .add("c2", ArrayType(new StructType().add("c3", LongType).add("c4", StringType))) + val df1 = Seq("""{"c2": [19], "c1": 123456}""").toDF("c0") + checkAnswer(df1.select(from_json($"c0", st)), Row(Row(123456, null))) + val df2 = Seq("""{"data": {"c2": [19], "c1": 123456}}""").toDF("c0") + checkAnswer(df2.select(from_json($"c0", new StructType().add("data", st))), Row(Row(null))) + val df3 = Seq("""[{"c2": [19], "c1": 123456}]""").toDF("c0") + checkAnswer(df3.select(from_json($"c0", ArrayType(st))), Row(null)) + val df4 = Seq("""{"c2": [19]}""").toDF("c0") + checkAnswer(df4.select(from_json($"c0", MapType(StringType, st))), Row(null)) + } + + test("SPARK-33270: infers schema for JSON field with spaces and pass them to from_json") { + val in = Seq("""{"a b": 1}""").toDS() + val out = in.select(from_json('value, schema_of_json("""{"a b": 100}""")) as "parsed") + val expected = new StructType().add("parsed", new StructType().add("a b", LongType)) + assert(out.schema == expected) + } + + test("SPARK-33286: from_json - combined error messages") { + val df = Seq("""{"a":1}""").toDF("json") + val invalidJsonSchema = """{"fields": [{"a":123}], "type": "struct"}""" + val errMsg1 = intercept[AnalysisException] { + df.select(from_json($"json", invalidJsonSchema, Map.empty[String, String])).collect() + }.getMessage + assert(errMsg1.contains("""Failed to convert the JSON string '{"a":123}' to a field""")) + + val invalidDataType = "MAP" + val errMsg2 = intercept[AnalysisException] { + df.select(from_json($"json", invalidDataType, Map.empty[String, String])).collect() + }.getMessage + assert(errMsg2.contains("DataType cow is not supported")) + + val invalidTableSchema = "x INT, a cow" + val errMsg3 = intercept[AnalysisException] { + df.select(from_json($"json", invalidTableSchema, Map.empty[String, String])).collect() + }.getMessage + assert(errMsg3.contains("DataType cow is not supported")) + } + + test("SPARK-33907: bad json input with json pruning optimization: GetStructField") { + Seq("true", "false").foreach { enabled => + withSQLConf(SQLConf.JSON_EXPRESSION_OPTIMIZATION.key -> enabled) { + val schema = new StructType() + .add("a", IntegerType) + .add("b", IntegerType) + val badRec = """{"a" 1, "b": 11}""" + val df = Seq(badRec, """{"a": 2, "b": 12}""").toDS() + + val exception1 = intercept[SparkException] { + df.select(from_json($"value", schema, Map("mode" -> "FAILFAST"))("b")).collect() + }.getMessage + assert(exception1.contains( + "Malformed records are detected in record parsing. Parse Mode: FAILFAST.")) + + val exception2 = intercept[SparkException] { + df.select(from_json($"value", schema, Map("mode" -> "FAILFAST"))("a")).collect() + }.getMessage + assert(exception2.contains( + "Malformed records are detected in record parsing. Parse Mode: FAILFAST.")) + } + } + } + + test("SPARK-33907: bad json input with json pruning optimization: GetArrayStructFields") { + Seq("true", "false").foreach { enabled => + withSQLConf(SQLConf.JSON_EXPRESSION_OPTIMIZATION.key -> enabled) { + val schema = ArrayType(new StructType() + .add("a", IntegerType) + .add("b", IntegerType)) + val badRec = """{"a" 1, "b": 11}""" + val df = Seq(s"""[$badRec, {"a": 2, "b": 12}]""").toDS() + + val exception1 = intercept[SparkException] { + df.select(from_json($"value", schema, Map("mode" -> "FAILFAST"))("b")).collect() + }.getMessage + assert(exception1.contains( + "Malformed records are detected in record parsing. Parse Mode: FAILFAST.")) + + val exception2 = intercept[SparkException] { + df.select(from_json($"value", schema, Map("mode" -> "FAILFAST"))("a")).collect() + }.getMessage + assert(exception2.contains( + "Malformed records are detected in record parsing. Parse Mode: FAILFAST.")) + } + } + } + + test("SPARK-33907: json pruning optimization with corrupt record field") { + Seq("true", "false").foreach { enabled => + withSQLConf(SQLConf.JSON_EXPRESSION_OPTIMIZATION.key -> enabled) { + val schema = new StructType() + .add("a", IntegerType) + .add("b", IntegerType) + val badRec = """{"a" 1, "b": 11}""" + + val df = Seq(badRec, """{"a": 2, "b": 12}""").toDS() + .selectExpr("from_json(value, 'a int, b int, _corrupt_record string') as parsed") + .selectExpr("parsed._corrupt_record") + + checkAnswer(df, Seq(Row("""{"a" 1, "b": 11}"""), Row(null))) + } + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala index bd86c2ec075b0..7c46dd08acff0 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/MathFunctionsSuite.scala @@ -125,6 +125,11 @@ class MathFunctionsSuite extends QueryTest with SharedSparkSession { testOneToOneMathFunction(sinh, math.sinh) } + test("asinh") { + testOneToOneMathFunction(asinh, + (x: Double) => math.log(x + math.sqrt(x * x + 1)) ) + } + test("cos") { testOneToOneMathFunction(cos, math.cos) } @@ -137,6 +142,11 @@ class MathFunctionsSuite extends QueryTest with SharedSparkSession { testOneToOneMathFunction(cosh, math.cosh) } + test("acosh") { + testOneToOneMathFunction(acosh, + (x: Double) => math.log(x + math.sqrt(x * x - 1)) ) + } + test("tan") { testOneToOneMathFunction(tan, math.tan) } @@ -149,6 +159,11 @@ class MathFunctionsSuite extends QueryTest with SharedSparkSession { testOneToOneMathFunction(tanh, math.tanh) } + test("atanh") { + testOneToOneMathFunction(atanh, + (x: Double) => (0.5 * (math.log1p(x) - math.log1p(-x))) ) + } + test("degrees") { testOneToOneMathFunction(degrees, math.toDegrees) checkAnswer( @@ -351,14 +366,14 @@ class MathFunctionsSuite extends QueryTest with SharedSparkSession { checkAnswer( df.select( - shiftLeft('a, 1), shiftLeft('b, 1), shiftLeft('c, 1), shiftLeft('d, 1), - shiftLeft('f, 1)), + shiftleft('a, 1), shiftleft('b, 1), shiftleft('c, 1), shiftleft('d, 1), + shiftLeft('f, 1)), // test deprecated one. Row(42.toLong, 42, 42.toShort, 42.toByte, null)) checkAnswer( df.selectExpr( - "shiftLeft(a, 1)", "shiftLeft(b, 1)", "shiftLeft(b, 1)", "shiftLeft(d, 1)", - "shiftLeft(f, 1)"), + "shiftleft(a, 1)", "shiftleft(b, 1)", "shiftleft(b, 1)", "shiftleft(d, 1)", + "shiftleft(f, 1)"), Row(42.toLong, 42, 42.toShort, 42.toByte, null)) } @@ -368,14 +383,14 @@ class MathFunctionsSuite extends QueryTest with SharedSparkSession { checkAnswer( df.select( - shiftRight('a, 1), shiftRight('b, 1), shiftRight('c, 1), shiftRight('d, 1), - shiftRight('f, 1)), + shiftright('a, 1), shiftright('b, 1), shiftright('c, 1), shiftright('d, 1), + shiftRight('f, 1)), // test deprecated one. Row(21.toLong, 21, 21.toShort, 21.toByte, null)) checkAnswer( df.selectExpr( - "shiftRight(a, 1)", "shiftRight(b, 1)", "shiftRight(c, 1)", "shiftRight(d, 1)", - "shiftRight(f, 1)"), + "shiftright(a, 1)", "shiftright(b, 1)", "shiftright(c, 1)", "shiftright(d, 1)", + "shiftright(f, 1)"), Row(21.toLong, 21, 21.toShort, 21.toByte, null)) } @@ -385,14 +400,14 @@ class MathFunctionsSuite extends QueryTest with SharedSparkSession { checkAnswer( df.select( - shiftRightUnsigned('a, 1), shiftRightUnsigned('b, 1), shiftRightUnsigned('c, 1), - shiftRightUnsigned('d, 1), shiftRightUnsigned('f, 1)), + shiftrightunsigned('a, 1), shiftrightunsigned('b, 1), shiftrightunsigned('c, 1), + shiftrightunsigned('d, 1), shiftRightUnsigned('f, 1)), // test deprecated one. Row(9223372036854775787L, 21, 21.toShort, 21.toByte, null)) checkAnswer( df.selectExpr( - "shiftRightUnsigned(a, 1)", "shiftRightUnsigned(b, 1)", "shiftRightUnsigned(c, 1)", - "shiftRightUnsigned(d, 1)", "shiftRightUnsigned(f, 1)"), + "shiftrightunsigned(a, 1)", "shiftrightunsigned(b, 1)", "shiftrightunsigned(c, 1)", + "shiftrightunsigned(d, 1)", "shiftrightunsigned(f, 1)"), Row(9223372036854775787L, 21, 21.toShort, 21.toByte, null)) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/MetadataCacheSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/MetadataCacheSuite.scala index a9f443be69cb2..956bd7861d99d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/MetadataCacheSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/MetadataCacheSuite.scala @@ -20,7 +20,6 @@ package org.apache.spark.sql import java.io.File import org.apache.spark.{SparkConf, SparkException} -import org.apache.spark.sql.execution.adaptive.AdaptiveTestUtils.assertExceptionMessage import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession @@ -56,8 +55,8 @@ abstract class MetadataCacheSuite extends QueryTest with SharedSparkSession { val e = intercept[SparkException] { df.count() } - assertExceptionMessage(e, "FileNotFoundException") - assertExceptionMessage(e, "recreating the Dataset/DataFrame involved") + assert(e.getMessage.contains("FileNotFoundException")) + assert(e.getMessage.contains("recreating the Dataset/DataFrame involved")) } } } @@ -85,8 +84,8 @@ class MetadataCacheV1Suite extends MetadataCacheSuite { val e = intercept[SparkException] { sql("select count(*) from view_refresh").first() } - assertExceptionMessage(e, "FileNotFoundException") - assertExceptionMessage(e, "REFRESH") + assert(e.getMessage.contains("FileNotFoundException")) + assert(e.getMessage.contains("REFRESH")) // Refresh and we should be able to read it again. spark.catalog.refreshTable("view_refresh") diff --git a/sql/core/src/test/scala/org/apache/spark/sql/NestedDataSourceSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/NestedDataSourceSuite.scala new file mode 100644 index 0000000000000..78b314272aa07 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/NestedDataSourceSuite.scala @@ -0,0 +1,88 @@ +/* + * 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. + */ +package org.apache.spark.sql + +import org.apache.spark.SparkConf +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types.{LongType, StructType} + +// Datasource tests for nested schemas +trait NestedDataSourceSuiteBase extends QueryTest with SharedSparkSession { + protected val nestedDataSources: Seq[String] = Seq("orc", "parquet", "json") + protected def readOptions(schema: StructType): Map[String, String] = Map.empty + protected def save(selectExpr: Seq[String], format: String, path: String): Unit = { + spark + .range(1L) + .selectExpr(selectExpr: _*) + .write.mode("overwrite") + .format(format) + .save(path) + } + protected val colType: String = "in the data schema" + + test("SPARK-32431: consistent error for nested and top-level duplicate columns") { + Seq( + Seq("id AS lowercase", "id + 1 AS camelCase") -> + new StructType() + .add("LowerCase", LongType) + .add("camelcase", LongType) + .add("CamelCase", LongType), + Seq("NAMED_STRUCT('lowercase', id, 'camelCase', id + 1) AS StructColumn") -> + new StructType().add("StructColumn", + new StructType() + .add("LowerCase", LongType) + .add("camelcase", LongType) + .add("CamelCase", LongType)) + ).foreach { case (selectExpr: Seq[String], caseInsensitiveSchema: StructType) => + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + nestedDataSources.map { format => + withClue(s"format = $format select = ${selectExpr.mkString(",")}") { + withTempPath { dir => + val path = dir.getCanonicalPath + save(selectExpr, format, path) + val e = intercept[AnalysisException] { + spark + .read + .options(readOptions(caseInsensitiveSchema)) + .schema(caseInsensitiveSchema) + .format(format) + .load(path) + .show + } + assert(e.getMessage.contains(s"Found duplicate column(s) $colType: `camelcase`")) + } + } + } + } + } + } +} + +class NestedDataSourceV1Suite extends NestedDataSourceSuiteBase { + override protected def sparkConf: SparkConf = + super + .sparkConf + .set(SQLConf.USE_V1_SOURCE_LIST, nestedDataSources.mkString(",")) +} + +class NestedDataSourceV2Suite extends NestedDataSourceSuiteBase { + override protected def sparkConf: SparkConf = + super + .sparkConf + .set(SQLConf.USE_V1_SOURCE_LIST, "") +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/PlanStabilitySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/PlanStabilitySuite.scala new file mode 100644 index 0000000000000..0df18723921e8 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/PlanStabilitySuite.scala @@ -0,0 +1,333 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import java.io.File +import java.nio.charset.StandardCharsets + +import scala.collection.mutable + +import org.apache.commons.io.FileUtils + +import org.apache.spark.sql.catalyst.expressions.AttributeSet +import org.apache.spark.sql.catalyst.util._ +import org.apache.spark.sql.execution._ +import org.apache.spark.sql.execution.adaptive.DisableAdaptiveExecutionSuite +import org.apache.spark.sql.execution.exchange.{Exchange, ReusedExchangeExec} +import org.apache.spark.sql.internal.SQLConf + +// scalastyle:off line.size.limit +/** + * Check that TPC-DS SparkPlans don't change. + * If there are plan differences, the error message looks like this: + * Plans did not match: + * last approved simplified plan: /path/to/tpcds-plan-stability/approved-plans-xxx/q1/simplified.txt + * last approved explain plan: /path/to/tpcds-plan-stability/approved-plans-xxx/q1/explain.txt + * [last approved simplified plan] + * + * actual simplified plan: /path/to/tmp/q1.actual.simplified.txt + * actual explain plan: /path/to/tmp/q1.actual.explain.txt + * [actual simplified plan] + * + * + * To run the entire test suite: + * {{{ + * build/sbt "sql/testOnly *PlanStability[WithStats]Suite" + * }}} + * + * To run a single test file upon change: + * {{{ + * build/sbt "sql/testOnly *PlanStability[WithStats]Suite -- -z (tpcds-v1.4/q49)" + * }}} + * + * To re-generate golden files for entire suite, run: + * {{{ + * SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/testOnly *PlanStability[WithStats]Suite" + * }}} + * + * To re-generate golden file for a single test, run: + * {{{ + * SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/testOnly *PlanStability[WithStats]Suite -- -z (tpcds-v1.4/q49)" + * }}} + */ +// scalastyle:on line.size.limit +trait PlanStabilitySuite extends TPCDSBase with DisableAdaptiveExecutionSuite { + + private val originalMaxToStringFields = conf.maxToStringFields + + override def beforeAll(): Unit = { + conf.setConf(SQLConf.MAX_TO_STRING_FIELDS, Int.MaxValue) + super.beforeAll() + } + + override def afterAll(): Unit = { + super.afterAll() + conf.setConf(SQLConf.MAX_TO_STRING_FIELDS, originalMaxToStringFields) + } + + private val regenerateGoldenFiles: Boolean = System.getenv("SPARK_GENERATE_GOLDEN_FILES") == "1" + + protected val baseResourcePath = { + // use the same way as `SQLQueryTestSuite` to get the resource path + getWorkspaceFilePath("sql", "core", "src", "test", "resources", "tpcds-plan-stability").toFile + } + + private val referenceRegex = "#\\d+".r + private val normalizeRegex = "#\\d+L?".r + + private val clsName = this.getClass.getCanonicalName + + def goldenFilePath: String + + private def getDirForTest(name: String): File = { + new File(goldenFilePath, name) + } + + private def isApproved( + dir: File, actualSimplifiedPlan: String, actualExplain: String): Boolean = { + val simplifiedFile = new File(dir, "simplified.txt") + val expectedSimplified = FileUtils.readFileToString(simplifiedFile, StandardCharsets.UTF_8) + lazy val explainFile = new File(dir, "explain.txt") + lazy val expectedExplain = FileUtils.readFileToString(explainFile, StandardCharsets.UTF_8) + expectedSimplified == actualSimplifiedPlan && expectedExplain == actualExplain + } + + /** + * Serialize and save this SparkPlan. + * The resulting file is used by [[checkWithApproved]] to check stability. + * + * @param plan the SparkPlan + * @param name the name of the query + * @param explain the full explain output; this is saved to help debug later as the simplified + * plan is not too useful for debugging + */ + private def generateGoldenFile(plan: SparkPlan, name: String, explain: String): Unit = { + val dir = getDirForTest(name) + val simplified = getSimplifiedPlan(plan) + val foundMatch = dir.exists() && isApproved(dir, simplified, explain) + + if (!foundMatch) { + FileUtils.deleteDirectory(dir) + assert(dir.mkdirs()) + + val file = new File(dir, "simplified.txt") + FileUtils.writeStringToFile(file, simplified, StandardCharsets.UTF_8) + val fileOriginalPlan = new File(dir, "explain.txt") + FileUtils.writeStringToFile(fileOriginalPlan, explain, StandardCharsets.UTF_8) + logDebug(s"APPROVED: $file $fileOriginalPlan") + } + } + + private def checkWithApproved(plan: SparkPlan, name: String, explain: String): Unit = { + val dir = getDirForTest(name) + val tempDir = FileUtils.getTempDirectory + val actualSimplified = getSimplifiedPlan(plan) + val foundMatch = isApproved(dir, actualSimplified, explain) + + if (!foundMatch) { + // show diff with last approved + val approvedSimplifiedFile = new File(dir, "simplified.txt") + val approvedExplainFile = new File(dir, "explain.txt") + + val actualSimplifiedFile = new File(tempDir, s"$name.actual.simplified.txt") + val actualExplainFile = new File(tempDir, s"$name.actual.explain.txt") + + val approvedSimplified = FileUtils.readFileToString( + approvedSimplifiedFile, StandardCharsets.UTF_8) + // write out for debugging + FileUtils.writeStringToFile(actualSimplifiedFile, actualSimplified, StandardCharsets.UTF_8) + FileUtils.writeStringToFile(actualExplainFile, explain, StandardCharsets.UTF_8) + + fail( + s""" + |Plans did not match: + |last approved simplified plan: ${approvedSimplifiedFile.getAbsolutePath} + |last approved explain plan: ${approvedExplainFile.getAbsolutePath} + | + |$approvedSimplified + | + |actual simplified plan: ${actualSimplifiedFile.getAbsolutePath} + |actual explain plan: ${actualExplainFile.getAbsolutePath} + | + |$actualSimplified + """.stripMargin) + } + } + + /** + * Get the simplified plan for a specific SparkPlan. In the simplified plan, the node only has + * its name and all the sorted reference and produced attributes names(without ExprId) and its + * simplified children as well. And we'll only identify the performance sensitive nodes, e.g., + * Exchange, Subquery, in the simplified plan. Given such a identical but simplified plan, we'd + * expect to avoid frequent plan changing and catch the possible meaningful regression. + */ + private def getSimplifiedPlan(plan: SparkPlan): String = { + val exchangeIdMap = new mutable.HashMap[Int, Int]() + val subqueriesMap = new mutable.HashMap[Int, Int]() + + def getId(plan: SparkPlan): Int = plan match { + case exchange: Exchange => exchangeIdMap.getOrElseUpdate(exchange.id, exchangeIdMap.size + 1) + case ReusedExchangeExec(_, exchange) => + exchangeIdMap.getOrElseUpdate(exchange.id, exchangeIdMap.size + 1) + case subquery: SubqueryExec => + subqueriesMap.getOrElseUpdate(subquery.id, subqueriesMap.size + 1) + case subquery: SubqueryBroadcastExec => + subqueriesMap.getOrElseUpdate(subquery.id, subqueriesMap.size + 1) + case ReusedSubqueryExec(subquery) => + subqueriesMap.getOrElseUpdate(subquery.id, subqueriesMap.size + 1) + case _ => -1 + } + + /** + * Some expression names have ExprId in them due to using things such as + * "sum(sr_return_amt#14)", so we remove all of these using regex + */ + def cleanUpReferences(references: AttributeSet): String = { + referenceRegex.replaceAllIn(references.map(_.name).mkString(","), "") + } + + /** + * Generate a simplified plan as a string + * Example output: + * TakeOrderedAndProject [c_customer_id] + * WholeStageCodegen + * Project [c_customer_id] + */ + def simplifyNode(node: SparkPlan, depth: Int): String = { + val padding = " " * depth + var thisNode = node.nodeName + if (node.references.nonEmpty) { + thisNode += s" [${cleanUpReferences(node.references)}]" + } + if (node.producedAttributes.nonEmpty) { + thisNode += s" [${cleanUpReferences(node.producedAttributes)}]" + } + val id = getId(node) + if (id > 0) { + thisNode += s" #$id" + } + val childrenSimplified = node.children.map(simplifyNode(_, depth + 1)) + val subqueriesSimplified = node.subqueries.map(simplifyNode(_, depth + 1)) + s"$padding$thisNode\n${subqueriesSimplified.mkString("")}${childrenSimplified.mkString("")}" + } + + simplifyNode(plan, 0) + } + + private def normalizeIds(plan: String): String = { + val map = new mutable.HashMap[String, String]() + normalizeRegex.findAllMatchIn(plan).map(_.toString) + .foreach(map.getOrElseUpdate(_, (map.size + 1).toString)) + normalizeRegex.replaceAllIn(plan, regexMatch => s"#${map(regexMatch.toString)}") + } + + private def normalizeLocation(plan: String): String = { + plan.replaceAll(s"Location.*$clsName/", + "Location [not included in comparison]/{warehouse_dir}/") + } + + /** + * Test a TPC-DS query. Depending on the settings this test will either check if the plan matches + * a golden file or it will create a new golden file. + */ + protected def testQuery(tpcdsGroup: String, query: String, suffix: String = ""): Unit = { + val queryString = resourceToString(s"$tpcdsGroup/$query.sql", + classLoader = Thread.currentThread().getContextClassLoader) + val qe = sql(queryString).queryExecution + val plan = qe.executedPlan + val explain = normalizeLocation(normalizeIds(qe.explainString(FormattedMode))) + + if (regenerateGoldenFiles) { + generateGoldenFile(plan, query + suffix, explain) + } else { + checkWithApproved(plan, query + suffix, explain) + } + } +} + +class TPCDSV1_4_PlanStabilitySuite extends PlanStabilitySuite { + override val goldenFilePath: String = + new File(baseResourcePath, s"approved-plans-v1_4").getAbsolutePath + + tpcdsQueries.foreach { q => + test(s"check simplified (tpcds-v1.4/$q)") { + testQuery("tpcds", q) + } + } +} + +class TPCDSV1_4_PlanStabilityWithStatsSuite extends PlanStabilitySuite { + override def injectStats: Boolean = true + + override val goldenFilePath: String = + new File(baseResourcePath, s"approved-plans-v1_4").getAbsolutePath + + tpcdsQueries.foreach { q => + test(s"check simplified sf100 (tpcds-v1.4/$q)") { + testQuery("tpcds", q, ".sf100") + } + } +} + +class TPCDSV2_7_PlanStabilitySuite extends PlanStabilitySuite { + override val goldenFilePath: String = + new File(baseResourcePath, s"approved-plans-v2_7").getAbsolutePath + + tpcdsQueriesV2_7_0.foreach { q => + test(s"check simplified (tpcds-v2.7.0/$q)") { + testQuery("tpcds-v2.7.0", q) + } + } +} + +class TPCDSV2_7_PlanStabilityWithStatsSuite extends PlanStabilitySuite { + override def injectStats: Boolean = true + + override val goldenFilePath: String = + new File(baseResourcePath, s"approved-plans-v2_7").getAbsolutePath + + tpcdsQueriesV2_7_0.foreach { q => + test(s"check simplified sf100 (tpcds-v2.7.0/$q)") { + testQuery("tpcds-v2.7.0", q, ".sf100") + } + } +} + +class TPCDSModifiedPlanStabilitySuite extends PlanStabilitySuite { + override val goldenFilePath: String = + new File(baseResourcePath, s"approved-plans-modified").getAbsolutePath + + modifiedTPCDSQueries.foreach { q => + test(s"check simplified (tpcds-modifiedQueries/$q)") { + testQuery("tpcds-modifiedQueries", q) + } + } +} + +class TPCDSModifiedPlanStabilityWithStatsSuite extends PlanStabilitySuite { + override def injectStats: Boolean = true + + override val goldenFilePath: String = + new File(baseResourcePath, s"approved-plans-modified").getAbsolutePath + + modifiedTPCDSQueries.foreach { q => + test(s"check simplified sf100 (tpcds-modifiedQueries/$q)") { + testQuery("tpcds-modifiedQueries", q, ".sf100") + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/ProductAggSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/ProductAggSuite.scala new file mode 100644 index 0000000000000..7fff53087e66f --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/ProductAggSuite.scala @@ -0,0 +1,121 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import org.apache.spark.sql.expressions.Window +import org.apache.spark.sql.functions.{col, lit, product} +import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types.{ByteType, DoubleType, FloatType, IntegerType, ShortType} + + +class ProductAggSuite extends QueryTest + with SharedSparkSession { + + // Sequence of integers small enough that factorial is representable exactly as DoubleType: + private lazy val data16 = spark.range(1, 17).toDF("x") + + private lazy val factorials = (1 to 16).scanLeft(1L) { case (f, x) => f * x } + + test("bare factorial") { + checkAnswer( + data16.agg(product(col("x"))), + Row((1L to 16L).reduce { _ * _ }.toDouble) + ) + + checkAnswer( + data16.agg(product(col("x"))), + Row(factorials(16)) + ) + } + + test("type flexibility") { + val bytes16 = spark.createDataset((1 to 16).map { _.toByte })(Encoders.scalaByte).toDF("x") + + val variants = Map( + "int8" -> ByteType, "int16" -> ShortType, "int32" -> IntegerType, + "float32" -> FloatType, "float64" -> DoubleType) + + val prods = variants.foldLeft(bytes16) { case (df, (id, typ)) => + df.withColumn(id, df.col("x").cast(typ)) + }.agg( + lit(1) as "dummy", + variants.keys.toSeq.map { id => product(col(id)) as id } : _*) + + variants.keys.foreach { typ => + checkAnswer( + prods.select(typ), + Row(factorials(16)) + ) + } + } + + test("windowed factorials") { + val win = Window.partitionBy(lit(1)).orderBy("x") + + val prodFactorials = data16.withColumn("f", product(col("x")).over(win)).orderBy(col("x")) + + assert(prodFactorials.count === 16) + + checkAnswer( + prodFactorials.limit(5), + Seq( + Row(1, 1.0), + Row(2, 2.0), + Row(3, 6.0), + Row(4, 24.0), + Row(5, 120.0) + ) + ) + + checkAnswer( + prodFactorials, + factorials.zipWithIndex.drop(1).map { case (fac, idx) => + Row(idx, fac) + } + ) + } + + test("grouped factorials") { + val grouped = data16.groupBy((col("x") % 3) as "mod3") + .agg( + product(col("x")) as "product", + product(col("x") * 0.5) as "product_scaled", + product(col("x") * -1.0) as "product_minus") + .orderBy("mod3") + + val expectedBase = Seq( + (3 * 6 * 9 * 12 * 15), + (1 * 4 * 7 * 10 * 13 * 16), + (2 * 5 * 8 * 11 * 14)) + + checkAnswer( + grouped.select("product"), + expectedBase.map { n => Row(n.toDouble) } + ) + + checkAnswer( + grouped.select("product_scaled"), + expectedBase.zip(Seq(0.03125, 0.015625, 0.03125)).map { case(a, b) => Row(a * b) } + ) + + checkAnswer( + grouped.select("product_minus"), + expectedBase.zip(Seq(-1.0, 1.0, -1.0)).map { case(a, b) => Row(a * b) } + ) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/QueryTest.scala b/sql/core/src/test/scala/org/apache/spark/sql/QueryTest.scala index e52d2262a6bf8..8469216901b05 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/QueryTest.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/QueryTest.scala @@ -418,7 +418,7 @@ object QueryTest extends Assertions { } def checkAnswer(df: DataFrame, expectedAnswer: java.util.List[Row]): Unit = { - getErrorMessageInCheckAnswer(df, expectedAnswer.asScala) match { + getErrorMessageInCheckAnswer(df, expectedAnswer.asScala.toSeq) match { case Some(errorMessage) => Assert.fail(errorMessage) case None => } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/ReplaceNullWithFalseInPredicateEndToEndSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/ReplaceNullWithFalseInPredicateEndToEndSuite.scala index bdbb741f24bc6..739b4052ee90d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/ReplaceNullWithFalseInPredicateEndToEndSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/ReplaceNullWithFalseInPredicateEndToEndSuite.scala @@ -27,6 +27,12 @@ import org.apache.spark.sql.types.BooleanType class ReplaceNullWithFalseInPredicateEndToEndSuite extends QueryTest with SharedSparkSession { import testImplicits._ + private def checkPlanIsEmptyLocalScan(df: DataFrame): Unit = + df.queryExecution.executedPlan match { + case s: LocalTableScanExec => assert(s.rows.isEmpty) + case p => fail(s"$p is not LocalTableScanExec") + } + test("SPARK-25860: Replace Literal(null, _) with FalseLiteral whenever possible") { withTable("t1", "t2") { Seq((1, true), (2, false)).toDF("l", "b").write.saveAsTable("t1") @@ -64,11 +70,6 @@ class ReplaceNullWithFalseInPredicateEndToEndSuite extends QueryTest with Shared checkAnswer(df1.where("IF(l > 10, false, b OR null)"), Row(1, true)) } - - def checkPlanIsEmptyLocalScan(df: DataFrame): Unit = df.queryExecution.executedPlan match { - case s: LocalTableScanExec => assert(s.rows.isEmpty) - case p => fail(s"$p is not LocalTableScanExec") - } } test("SPARK-26107: Replace Literal(null, _) with FalseLiteral in higher-order functions") { @@ -112,4 +113,14 @@ class ReplaceNullWithFalseInPredicateEndToEndSuite extends QueryTest with Shared assertNoLiteralNullInPlan(q3) } } + + test("SPARK-33847: replace None of elseValue inside CaseWhen to FalseLiteral") { + withTable("t1") { + Seq((1, 1), (2, 2)).toDF("a", "b").write.saveAsTable("t1") + val t1 = spark.table("t1") + val q1 = t1.filter("(CASE WHEN a > 1 THEN 1 END) = 0") + checkAnswer(q1, Seq.empty) + checkPlanIsEmptyLocalScan(q1) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/RuntimeConfigSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/RuntimeConfigSuite.scala index 720d570ca8384..4052130720811 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/RuntimeConfigSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/RuntimeConfigSuite.scala @@ -20,7 +20,7 @@ package org.apache.spark.sql import org.apache.spark.SparkFunSuite import org.apache.spark.internal.config import org.apache.spark.sql.internal.SQLConf.CHECKPOINT_LOCATION -import org.apache.spark.sql.internal.StaticSQLConf.SCHEMA_STRING_LENGTH_THRESHOLD +import org.apache.spark.sql.internal.StaticSQLConf.GLOBAL_TEMP_DATABASE class RuntimeConfigSuite extends SparkFunSuite { @@ -62,7 +62,7 @@ class RuntimeConfigSuite extends SparkFunSuite { val conf = newConf() // SQL configs - assert(!conf.isModifiable(SCHEMA_STRING_LENGTH_THRESHOLD.key)) + assert(!conf.isModifiable(GLOBAL_TEMP_DATABASE.key)) assert(conf.isModifiable(CHECKPOINT_LOCATION.key)) // Core configs assert(!conf.isModifiable(config.CPUS_PER_TASK.key)) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SQLContextSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SQLContextSuite.scala index a1799829932b8..d81768c0077eb 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/SQLContextSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/SQLContextSuite.scala @@ -122,7 +122,7 @@ class SQLContextSuite extends SparkFunSuite with SharedSparkContext { df.createOrReplaceTempView("listtablessuitetable") val expectedSchema = StructType( - StructField("database", StringType, false) :: + StructField("namespace", StringType, false) :: StructField("tableName", StringType, false) :: StructField("isTemporary", BooleanType, false) :: Nil) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SQLInsertTestSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SQLInsertTestSuite.scala new file mode 100644 index 0000000000000..2f56fbaf7f821 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/SQLInsertTestSuite.scala @@ -0,0 +1,326 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import org.apache.spark.SparkConf +import org.apache.spark.sql.catalyst.expressions.Hex +import org.apache.spark.sql.connector.catalog.InMemoryPartitionTableCatalog +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.{SharedSparkSession, SQLTestUtils} +import org.apache.spark.unsafe.types.UTF8String + +/** + * The base trait for SQL INSERT. + */ +trait SQLInsertTestSuite extends QueryTest with SQLTestUtils { + + import testImplicits._ + + def format: String + + protected def createTable( + table: String, + cols: Seq[String], + colTypes: Seq[String], + partCols: Seq[String] = Nil): Unit = { + val values = cols.zip(colTypes).map(tuple => tuple._1 + " " + tuple._2).mkString("(", ", ", ")") + val partitionSpec = if (partCols.nonEmpty) { + partCols.mkString("PARTITIONED BY (", ",", ")") + } else "" + sql(s"CREATE TABLE $table$values USING $format $partitionSpec") + } + + protected def processInsert( + tableName: String, + input: DataFrame, + cols: Seq[String] = Nil, + partitionExprs: Seq[String] = Nil, + overwrite: Boolean): Unit = { + val tmpView = "tmp_view" + val columnList = if (cols.nonEmpty) cols.mkString("(", ",", ")") else "" + val partitionList = if (partitionExprs.nonEmpty) { + partitionExprs.mkString("PARTITION (", ",", ")") + } else "" + withTempView(tmpView) { + input.createOrReplaceTempView(tmpView) + val overwriteStr = if (overwrite) "OVERWRITE" else "INTO" + sql( + s"INSERT $overwriteStr TABLE $tableName $partitionList $columnList SELECT * FROM $tmpView") + } + } + + protected def verifyTable(tableName: String, expected: DataFrame): Unit = { + checkAnswer(spark.table(tableName), expected) + } + + test("insert with column list - follow table output order") { + withTable("t1") { + val df = Seq((1, 2L, "3")).toDF() + val cols = Seq("c1", "c2", "c3") + createTable("t1", cols, Seq("int", "long", "string")) + Seq(false, true).foreach { m => + processInsert("t1", df, cols, overwrite = m) + verifyTable("t1", df) + } + } + } + + test("insert with column list - follow table output order + partitioned table") { + val cols = Seq("c1", "c2", "c3", "c4") + val df = Seq((1, 2, 3, 4)).toDF(cols: _*) + withTable("t1") { + createTable("t1", cols, Seq("int", "int", "int", "int"), cols.takeRight(2)) + Seq(false, true).foreach { m => + processInsert("t1", df, cols, overwrite = m) + verifyTable("t1", df) + } + } + + withTable("t1") { + createTable("t1", cols, Seq("int", "int", "int", "int"), cols.takeRight(2)) + Seq(false, true).foreach { m => + processInsert( + "t1", df.selectExpr("c1", "c2"), cols.take(2), Seq("c3=3", "c4=4"), overwrite = m) + verifyTable("t1", df) + } + } + + withTable("t1") { + createTable("t1", cols, Seq("int", "int", "int", "int"), cols.takeRight(2)) + Seq(false, true).foreach { m => + processInsert("t1", df.selectExpr("c1", "c2", "c4"), + cols.filterNot(_ == "c3"), Seq("c3=3", "c4"), overwrite = m) + verifyTable("t1", df) + } + } + } + + test("insert with column list - table output reorder") { + withTable("t1") { + val cols = Seq("c1", "c2", "c3") + val df = Seq((1, 2, 3)).toDF(cols: _*) + createTable("t1", cols, Seq("int", "int", "int")) + Seq(false, true).foreach { m => + processInsert("t1", df, cols.reverse, overwrite = m) + verifyTable("t1", df.selectExpr(cols.reverse: _*)) + } + } + } + + test("insert with column list - table output reorder + partitioned table") { + val cols = Seq("c1", "c2", "c3", "c4") + val df = Seq((1, 2, 3, 4)).toDF(cols: _*) + withTable("t1") { + createTable("t1", cols, Seq("int", "int", "int", "int"), cols.takeRight(2)) + Seq(false, true).foreach { m => + processInsert("t1", df, cols.reverse, overwrite = m) + verifyTable("t1", df.selectExpr(cols.reverse: _*)) + } + } + + withTable("t1") { + createTable("t1", cols, Seq("int", "int", "int", "int"), cols.takeRight(2)) + Seq(false, true).foreach { m => + processInsert( + "t1", df.selectExpr("c1", "c2"), cols.take(2).reverse, Seq("c3=3", "c4=4"), overwrite = m) + verifyTable("t1", df.selectExpr("c2", "c1", "c3", "c4")) + } + } + + withTable("t1") { + createTable("t1", cols, Seq("int", "int", "int", "int"), cols.takeRight(2)) + Seq(false, true).foreach { m => + processInsert("t1", + df.selectExpr("c1", "c2", "c4"), Seq("c4", "c2", "c1"), Seq("c3=3", "c4"), overwrite = m) + verifyTable("t1", df.selectExpr("c4", "c2", "c3", "c1")) + } + } + } + + test("insert with column list - duplicated columns") { + withTable("t1") { + val cols = Seq("c1", "c2", "c3") + createTable("t1", cols, Seq("int", "long", "string")) + val e1 = intercept[AnalysisException](sql(s"INSERT INTO t1 (c1, c2, c2) values(1, 2, 3)")) + assert(e1.getMessage.contains("Found duplicate column(s) in the column list: `c2`")) + } + } + + test("insert with column list - invalid columns") { + withTable("t1") { + val cols = Seq("c1", "c2", "c3") + createTable("t1", cols, Seq("int", "long", "string")) + val e1 = intercept[AnalysisException](sql(s"INSERT INTO t1 (c1, c2, c4) values(1, 2, 3)")) + assert(e1.getMessage.contains("Cannot resolve column name c4")) + } + } + + test("insert with column list - mismatched column list size") { + val msg = "Cannot write to table due to mismatched user specified column size" + withTable("t1") { + val cols = Seq("c1", "c2", "c3") + createTable("t1", cols, Seq("int", "long", "string")) + val e1 = intercept[AnalysisException](sql(s"INSERT INTO t1 (c1, c2) values(1, 2, 3)")) + assert(e1.getMessage.contains(msg)) + val e2 = intercept[AnalysisException](sql(s"INSERT INTO t1 (c1, c2, c3) values(1, 2)")) + assert(e2.getMessage.contains(msg)) + } + } + + test("insert with column list - mismatched target table out size after rewritten query") { + val v2Msg = "Cannot write to 'testcat.t1', not enough data columns:" + val cols = Seq("c1", "c2", "c3", "c4") + + withTable("t1") { + createTable("t1", cols, Seq.fill(4)("int")) + val e1 = intercept[AnalysisException](sql(s"INSERT INTO t1 (c1) values(1)")) + assert(e1.getMessage.contains("target table has 4 column(s) but the inserted data has 1") || + e1.getMessage.contains(v2Msg)) + } + + withTable("t1") { + createTable("t1", cols, Seq.fill(4)("int"), cols.takeRight(2)) + val e1 = intercept[AnalysisException] { + sql(s"INSERT INTO t1 partition(c3=3, c4=4) (c1) values(1)") + } + assert(e1.getMessage.contains("target table has 4 column(s) but the inserted data has 3") || + e1.getMessage.contains(v2Msg)) + } + } + + test("SPARK-34223: static partition with null raise NPE") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c string) USING PARQUET PARTITIONED BY (c)") + sql("INSERT OVERWRITE t PARTITION (c=null) VALUES ('1')") + checkAnswer(spark.table("t"), Row("1", null)) + } + } + + test("SPARK-33474: Support typed literals as partition spec values") { + withTable("t1") { + val binaryStr = "Spark SQL" + val binaryHexStr = Hex.hex(UTF8String.fromString(binaryStr).getBytes).toString + sql( + """ + | CREATE TABLE t1(name STRING, part1 DATE, part2 TIMESTAMP, part3 BINARY, + | part4 STRING, part5 STRING, part6 STRING, part7 STRING) + | USING PARQUET PARTITIONED BY (part1, part2, part3, part4, part5, part6, part7) + """.stripMargin) + + sql( + s""" + | INSERT OVERWRITE t1 PARTITION( + | part1 = date'2019-01-01', + | part2 = timestamp'2019-01-01 11:11:11', + | part3 = X'$binaryHexStr', + | part4 = 'p1', + | part5 = date'2019-01-01', + | part6 = timestamp'2019-01-01 11:11:11', + | part7 = X'$binaryHexStr' + | ) VALUES('a') + """.stripMargin) + checkAnswer(sql( + """ + | SELECT + | name, + | CAST(part1 AS STRING), + | CAST(part2 as STRING), + | CAST(part3 as STRING), + | part4, + | part5, + | part6, + | part7 + | FROM t1 + """.stripMargin), + Row("a", "2019-01-01", "2019-01-01 11:11:11", "Spark SQL", "p1", + "2019-01-01", "2019-01-01 11:11:11", "Spark SQL")) + + val e = intercept[AnalysisException] { + sql("CREATE TABLE t2(name STRING, part INTERVAL) USING PARQUET PARTITIONED BY (part)") + }.getMessage + assert(e.contains("Cannot use interval")) + } + } + + test("SPARK-34556: " + + "checking duplicate static partition columns should respect case sensitive conf") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c string) USING PARQUET PARTITIONED BY (c)") + val e = intercept[AnalysisException] { + sql("INSERT OVERWRITE t PARTITION (c='2', C='3') VALUES (1)") + } + assert(e.getMessage.contains("Found duplicate keys 'c'")) + } + // The following code is skipped for Hive because columns stored in Hive Metastore is always + // case insensitive and we cannot create such table in Hive Metastore. + if (!format.startsWith("hive")) { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + withTable("t") { + sql(s"CREATE TABLE t(i int, c string, C string) USING PARQUET PARTITIONED BY (c, C)") + sql("INSERT OVERWRITE t PARTITION (c='2', C='3') VALUES (1)") + checkAnswer(spark.table("t"), Row(1, "2", "3")) + } + } + } + } + + test("SPARK-30844: static partition should also follow StoreAssignmentPolicy") { + val testingPolicies = if (format == "foo") { + // DS v2 doesn't support the legacy policy + Seq(SQLConf.StoreAssignmentPolicy.ANSI, SQLConf.StoreAssignmentPolicy.STRICT) + } else { + SQLConf.StoreAssignmentPolicy.values + } + testingPolicies.foreach { policy => + withSQLConf( + SQLConf.STORE_ASSIGNMENT_POLICY.key -> policy.toString) { + withTable("t") { + sql("create table t(a int, b string) using parquet partitioned by (a)") + policy match { + case SQLConf.StoreAssignmentPolicy.ANSI | SQLConf.StoreAssignmentPolicy.STRICT => + val errorMsg = intercept[NumberFormatException] { + sql("insert into t partition(a='ansi') values('ansi')") + }.getMessage + assert(errorMsg.contains("invalid input syntax for type numeric: ansi")) + case SQLConf.StoreAssignmentPolicy.LEGACY => + sql("insert into t partition(a='ansi') values('ansi')") + checkAnswer(sql("select * from t"), Row("ansi", null) :: Nil) + } + } + } + } + } +} + +class FileSourceSQLInsertTestSuite extends SQLInsertTestSuite with SharedSparkSession { + override def format: String = "parquet" + override protected def sparkConf: SparkConf = { + super.sparkConf.set(SQLConf.USE_V1_SOURCE_LIST, format) + } +} + +class DSV2SQLInsertTestSuite extends SQLInsertTestSuite with SharedSparkSession { + + override def format: String = "foo" + + protected override def sparkConf: SparkConf = { + super.sparkConf + .set("spark.sql.catalog.testcat", classOf[InMemoryPartitionTableCatalog].getName) + .set(SQLConf.DEFAULT_CATALOG.key, "testcat") + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala index 788a07370195d..26af0b9f81127 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala @@ -22,20 +22,25 @@ import java.net.{MalformedURLException, URL} import java.sql.{Date, Timestamp} import java.util.concurrent.atomic.AtomicBoolean +import org.apache.commons.io.FileUtils + import org.apache.spark.{AccumulatorSuite, SparkException} import org.apache.spark.scheduler.{SparkListener, SparkListenerJobStart} import org.apache.spark.sql.catalyst.expressions.GenericRow import org.apache.spark.sql.catalyst.expressions.aggregate.{Complete, Partial} import org.apache.spark.sql.catalyst.optimizer.{ConvertToLocalRelation, NestedColumnAliasingSuite} -import org.apache.spark.sql.catalyst.plans.logical.Project +import org.apache.spark.sql.catalyst.plans.logical.{LocalLimit, Project, RepartitionByExpression, Sort} import org.apache.spark.sql.catalyst.util.StringUtils +import org.apache.spark.sql.execution.UnionExec import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper import org.apache.spark.sql.execution.aggregate.{HashAggregateExec, ObjectHashAggregateExec, SortAggregateExec} import org.apache.spark.sql.execution.columnar.InMemoryTableScanExec import org.apache.spark.sql.execution.command.FunctionsCommand +import org.apache.spark.sql.execution.datasources.LogicalRelation import org.apache.spark.sql.execution.datasources.v2.BatchScanExec import org.apache.spark.sql.execution.datasources.v2.orc.OrcScan import org.apache.spark.sql.execution.datasources.v2.parquet.ParquetScan +import org.apache.spark.sql.execution.exchange.ReusedExchangeExec import org.apache.spark.sql.execution.joins.{BroadcastHashJoinExec, CartesianProductExec, SortMergeJoinExec} import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf @@ -43,8 +48,10 @@ import org.apache.spark.sql.test.{SharedSparkSession, TestSQLContext} import org.apache.spark.sql.test.SQLTestData._ import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.CalendarInterval +import org.apache.spark.util.ResetSystemProperties -class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSparkPlanHelper { +class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSparkPlanHelper + with ResetSystemProperties { import testImplicits._ setupTestData() @@ -117,10 +124,18 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark checkKeywordsExist(sql("describe functioN abcadf"), "Function: abcadf not found.") } + test("SPARK-34678: describe functions for table-valued functions") { + checkKeywordsExist(sql("describe function range"), + "Function: range", + "Class: org.apache.spark.sql.catalyst.plans.logical.Range", + "range(end: long)" + ) + } + test("SPARK-14415: All functions should have own descriptions") { for (f <- spark.sessionState.functionRegistry.listFunction()) { if (!Seq("cube", "grouping", "grouping_id", "rollup", "window").contains(f.unquotedString)) { - checkKeywordsNotExist(sql(s"describe function `$f`"), "N/A.") + checkKeywordsNotExist(sql(s"describe function $f"), "N/A.") } } } @@ -1054,6 +1069,21 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark spark.sessionState.conf.clear() } + test("SPARK-35044: SET command shall display default value for hadoop conf correctly") { + val key = "hadoop.this.is.a.test.key" + val value = "2018-11-17 13:33:33.333" + // these keys are located at `src/test/resources/hive-site.xml` + checkAnswer(sql(s"SET $key"), Row(key, value)) + checkAnswer(sql("SET hadoop.tmp.dir"), Row("hadoop.tmp.dir", "/tmp/hive_one")) + + // these keys does not exist as default yet + checkAnswer(sql(s"SET ${key}no"), Row(key + "no", "")) + checkAnswer(sql("SET dfs.hosts"), Row("dfs.hosts", "")) + + // io.file.buffer.size has a default value from `SparkHadoopUtil.newConfiguration` + checkAnswer(sql("SET io.file.buffer.size"), Row("io.file.buffer.size", "65536")) + } + test("apply schema") { withTempView("applySchema1", "applySchema2", "applySchema3") { val schema1 = StructType( @@ -1175,7 +1205,7 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark |order by struct.a, struct.b |""".stripMargin) } - assert(error.message contains "cannot resolve '`struct.a`' given input columns: [a, b]") + assert(error.message contains "cannot resolve 'struct.a' given input columns: [a, b]") } @@ -1316,7 +1346,7 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark ) } - test("oder by asc by default when not specify ascending and descending") { + test("order by asc by default when not specify ascending and descending") { checkAnswer( sql("SELECT a, b FROM testData2 ORDER BY a desc, b"), Seq(Row(3, 1), Row(3, 2), Row(2, 1), Row(2, 2), Row(1, 1), Row(1, 2)) @@ -2763,8 +2793,8 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark }.message assert( m.contains( - "cannot resolve '(spark_catalog.default.t.`c` = spark_catalog.default.S.`C`)' " + - "due to data type mismatch")) + "cannot resolve '(spark_catalog.default.t.c = " + + "spark_catalog.default.S.C)' due to data type mismatch")) } } } @@ -2776,7 +2806,7 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark val e = intercept[AnalysisException](sql("SELECT v.i from (SELECT i FROM v)")) assert(e.message == - "cannot resolve '`v.i`' given input columns: [__auto_generated_subquery_name.i]") + "cannot resolve 'v.i' given input columns: [__auto_generated_subquery_name.i]") checkAnswer(sql("SELECT __auto_generated_subquery_name.i from (SELECT i FROM v)"), Row(1)) } @@ -2812,7 +2842,7 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark } } - test("SRARK-22266: the same aggregate function was calculated multiple times") { + test("SPARK-22266: the same aggregate function was calculated multiple times") { val query = "SELECT a, max(b+1), max(b+1) + 1 FROM testData2 GROUP BY a" val df = sql(query) val physical = df.queryExecution.sparkPlan @@ -3092,7 +3122,7 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark assert(scan.isInstanceOf[ParquetScan]) assert(scan.asInstanceOf[ParquetScan].pushedFilters === filters) case _ => - fail(s"unknow format $format") + fail(s"unknown format $format") } } @@ -3495,6 +3525,593 @@ class SQLQuerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark assert(df4.schema.head.name === "randn(1)") checkIfSeedExistsInExplain(df2) } + + test("SPARK-31670: Trim unnecessary Struct field alias in Aggregate/GroupingSets") { + withTempView("t") { + sql( + """ + |CREATE TEMPORARY VIEW t(a, b, c) AS + |SELECT * FROM VALUES + |('A', 1, NAMED_STRUCT('row_id', 1, 'json_string', '{"i": 1}')), + |('A', 2, NAMED_STRUCT('row_id', 2, 'json_string', '{"i": 1}')), + |('A', 2, NAMED_STRUCT('row_id', 2, 'json_string', '{"i": 2}')), + |('B', 1, NAMED_STRUCT('row_id', 3, 'json_string', '{"i": 1}')), + |('C', 3, NAMED_STRUCT('row_id', 4, 'json_string', '{"i": 1}')) + """.stripMargin) + + checkAnswer( + sql( + """ + |SELECT a, c.json_string, SUM(b) + |FROM t + |GROUP BY a, c.json_string + |""".stripMargin), + Row("A", "{\"i\": 1}", 3) :: Row("A", "{\"i\": 2}", 2) :: + Row("B", "{\"i\": 1}", 1) :: Row("C", "{\"i\": 1}", 3) :: Nil) + + checkAnswer( + sql( + """ + |SELECT a, c.json_string, SUM(b) + |FROM t + |GROUP BY a, c.json_string + |WITH CUBE + |""".stripMargin), + Row("A", "{\"i\": 1}", 3) :: Row("A", "{\"i\": 2}", 2) :: Row("A", null, 5) :: + Row("B", "{\"i\": 1}", 1) :: Row("B", null, 1) :: + Row("C", "{\"i\": 1}", 3) :: Row("C", null, 3) :: + Row(null, "{\"i\": 1}", 7) :: Row(null, "{\"i\": 2}", 2) :: Row(null, null, 9) :: Nil) + + checkAnswer( + sql( + """ + |SELECT a, get_json_object(c.json_string, '$.i'), SUM(b) + |FROM t + |GROUP BY a, get_json_object(c.json_string, '$.i') + |WITH CUBE + |""".stripMargin), + Row("A", "1", 3) :: Row("A", "2", 2) :: Row("A", null, 5) :: + Row("B", "1", 1) :: Row("B", null, 1) :: + Row("C", "1", 3) :: Row("C", null, 3) :: + Row(null, "1", 7) :: Row(null, "2", 2) :: Row(null, null, 9) :: Nil) + + checkAnswer( + sql( + """ + |SELECT a, c.json_string AS json_string, SUM(b) + |FROM t + |GROUP BY a, c.json_string + |WITH CUBE + |""".stripMargin), + Row("A", null, 5) :: Row("A", "{\"i\": 1}", 3) :: Row("A", "{\"i\": 2}", 2) :: + Row("B", null, 1) :: Row("B", "{\"i\": 1}", 1) :: + Row("C", null, 3) :: Row("C", "{\"i\": 1}", 3) :: + Row(null, null, 9) :: Row(null, "{\"i\": 1}", 7) :: Row(null, "{\"i\": 2}", 2) :: Nil) + + checkAnswer( + sql( + """ + |SELECT a, c.json_string as js, SUM(b) + |FROM t + |GROUP BY a, c.json_string + |WITH CUBE + |""".stripMargin), + Row("A", null, 5) :: Row("A", "{\"i\": 1}", 3) :: Row("A", "{\"i\": 2}", 2) :: + Row("B", null, 1) :: Row("B", "{\"i\": 1}", 1) :: + Row("C", null, 3) :: Row("C", "{\"i\": 1}", 3) :: + Row(null, null, 9) :: Row(null, "{\"i\": 1}", 7) :: Row(null, "{\"i\": 2}", 2) :: Nil) + + checkAnswer( + sql( + """ + |SELECT a, c.json_string as js, SUM(b) + |FROM t + |GROUP BY a, c.json_string + |WITH ROLLUP + |""".stripMargin), + Row("A", null, 5) :: Row("A", "{\"i\": 1}", 3) :: Row("A", "{\"i\": 2}", 2) :: + Row("B", null, 1) :: Row("B", "{\"i\": 1}", 1) :: + Row("C", null, 3) :: Row("C", "{\"i\": 1}", 3) :: + Row(null, null, 9) :: Nil) + + checkAnswer( + sql( + """ + |SELECT a, c.json_string, SUM(b) + |FROM t + |GROUP BY a, c.json_string + |GROUPING sets((a),(a, c.json_string)) + |""".stripMargin), + Row("A", null, 5) :: Row("A", "{\"i\": 1}", 3) :: Row("A", "{\"i\": 2}", 2) :: + Row("B", null, 1) :: Row("B", "{\"i\": 1}", 1) :: + Row("C", null, 3) :: Row("C", "{\"i\": 1}", 3) :: Nil) + } + } + + test("SPARK-31761: test byte, short, integer overflow for (Divide) integral type") { + checkAnswer(sql("Select -2147483648 DIV -1"), Seq(Row(Integer.MIN_VALUE.toLong * -1))) + checkAnswer(sql("select CAST(-128 as Byte) DIV CAST (-1 as Byte)"), + Seq(Row(Byte.MinValue.toLong * -1))) + checkAnswer(sql("select CAST(-32768 as short) DIV CAST (-1 as short)"), + Seq(Row(Short.MinValue.toLong * -1))) + } + + test("normalize special floating numbers in subquery") { + withTempView("v1", "v2", "v3") { + Seq(-0.0).toDF("d").createTempView("v1") + Seq(0.0).toDF("d").createTempView("v2") + spark.range(2).createTempView("v3") + + // non-correlated subquery + checkAnswer(sql("SELECT (SELECT v1.d FROM v1 JOIN v2 ON v1.d = v2.d)"), Row(-0.0)) + // correlated subquery + checkAnswer( + sql( + """ + |SELECT id FROM v3 WHERE EXISTS + | (SELECT v1.d FROM v1 JOIN v2 ON v1.d = v2.d WHERE id > 0) + |""".stripMargin), Row(1)) + } + } + + test("SPARK-31875: remove hints from plan when spark.sql.optimizer.disableHints = true") { + withSQLConf(SQLConf.DISABLE_HINTS.key -> "true") { + withTempView("t1", "t2") { + Seq[Integer](1, 2).toDF("c1").createOrReplaceTempView("t1") + Seq[Integer](1, 2).toDF("c1").createOrReplaceTempView("t2") + val repartitionHints = Seq( + "COALESCE(2)", + "REPARTITION(c1)", + "REPARTITION(c1, 2)", + "REPARTITION_BY_RANGE(c1, 2)", + "REPARTITION_BY_RANGE(c1)" + ) + val joinHints = Seq( + "BROADCASTJOIN (t1)", + "MAPJOIN(t1)", + "SHUFFLE_MERGE(t1)", + "MERGEJOIN(t1)", + "SHUFFLE_REPLICATE_NL(t1)" + ) + + repartitionHints.foreach { hintName => + val sqlText = s"SELECT /*+ $hintName */ * FROM t1" + val sqlTextWithoutHint = "SELECT * FROM t1" + val expectedPlan = sql(sqlTextWithoutHint) + val actualPlan = sql(sqlText) + comparePlans(actualPlan.queryExecution.analyzed, expectedPlan.queryExecution.analyzed) + } + + joinHints.foreach { hintName => + val sqlText = s"SELECT /*+ $hintName */ * FROM t1 INNER JOIN t2 ON t1.c1 = t2.c1" + val sqlTextWithoutHint = "SELECT * FROM t1 INNER JOIN t2 ON t1.c1 = t2.c1" + val expectedPlan = sql(sqlTextWithoutHint) + val actualPlan = sql(sqlText) + comparePlans(actualPlan.queryExecution.analyzed, expectedPlan.queryExecution.analyzed) + } + } + } + } + + test("SPARK-32372: ResolveReferences.dedupRight should only rewrite attributes for ancestor " + + "plans of the conflict plan") { + sql("SELECT name, avg(age) as avg_age FROM person GROUP BY name") + .createOrReplaceTempView("person_a") + sql("SELECT p1.name, p2.avg_age FROM person p1 JOIN person_a p2 ON p1.name = p2.name") + .createOrReplaceTempView("person_b") + sql("SELECT * FROM person_a UNION SELECT * FROM person_b") + .createOrReplaceTempView("person_c") + checkAnswer( + sql("SELECT p1.name, p2.avg_age FROM person_c p1 JOIN person_c p2 ON p1.name = p2.name"), + Row("jim", 20.0) :: Row("mike", 30.0) :: Nil) + } + + test("SPARK-32280: Avoid duplicate rewrite attributes when there're multiple JOINs") { + sql("SELECT 1 AS id").createOrReplaceTempView("A") + sql("SELECT id, 'foo' AS kind FROM A").createOrReplaceTempView("B") + sql("SELECT l.id as id FROM B AS l LEFT SEMI JOIN B AS r ON l.kind = r.kind") + .createOrReplaceTempView("C") + checkAnswer(sql("SELECT 0 FROM ( SELECT * FROM B JOIN C USING (id)) " + + "JOIN ( SELECT * FROM B JOIN C USING (id)) USING (id)"), Row(0)) + } + + test("SPARK-32788: non-partitioned table scan should not have partition filter") { + withTable("t") { + spark.range(1).write.saveAsTable("t") + checkAnswer(sql("SELECT id FROM t WHERE (SELECT true)"), Row(0L)) + } + } + + test("SPARK-33306: Timezone is needed when cast Date to String") { + withTempView("t1", "t2") { + spark.sql("select to_date(concat('2000-01-0', id)) as d from range(1, 2)") + .createOrReplaceTempView("t1") + spark.sql("select concat('2000-01-0', id) as d from range(1, 2)") + .createOrReplaceTempView("t2") + val result = Date.valueOf("2000-01-01") + + checkAnswer(sql("select t1.d from t1 join t2 on t1.d = t2.d"), Row(result)) + withSQLConf(SQLConf.LEGACY_CAST_DATETIME_TO_STRING.key -> "true") { + checkAnswer(sql("select t1.d from t1 join t2 on t1.d = t2.d"), Row(result)) + } + } + } + + test("SPARK-33338: GROUP BY using literal map should not fail") { + withTempDir { dir => + sql(s"CREATE TABLE t USING ORC LOCATION '${dir.toURI}' AS SELECT map('k1', 'v1') m, 'k1' k") + Seq( + "SELECT map('k1', 'v1')[k] FROM t GROUP BY 1", + "SELECT map('k1', 'v1')[k] FROM t GROUP BY map('k1', 'v1')[k]", + "SELECT map('k1', 'v1')[k] a FROM t GROUP BY a").foreach { statement => + checkAnswer(sql(statement), Row("v1")) + } + } + } + + test("SPARK-33084: Add jar support Ivy URI in SQL") { + val sc = spark.sparkContext + val hiveVersion = "2.3.8" + // transitive=false, only download specified jar + sql(s"ADD JAR ivy://org.apache.hive.hcatalog:hive-hcatalog-core:$hiveVersion?transitive=false") + assert(sc.listJars() + .exists(_.contains(s"org.apache.hive.hcatalog_hive-hcatalog-core-$hiveVersion.jar"))) + + // default transitive=true, test download ivy URL jar return multiple jars + sql("ADD JAR ivy://org.scala-js:scalajs-test-interface_2.12:1.2.0") + assert(sc.listJars().exists(_.contains("scalajs-library_2.12"))) + assert(sc.listJars().exists(_.contains("scalajs-test-interface_2.12"))) + + sql(s"ADD JAR ivy://org.apache.hive:hive-contrib:$hiveVersion" + + "?exclude=org.pentaho:pentaho-aggdesigner-algorithm&transitive=true") + assert(sc.listJars().exists(_.contains(s"org.apache.hive_hive-contrib-$hiveVersion.jar"))) + assert(sc.listJars().exists(_.contains(s"org.apache.hive_hive-exec-$hiveVersion.jar"))) + assert(!sc.listJars().exists(_.contains("org.pentaho.pentaho_aggdesigner-algorithm"))) + } + + test("SPARK-33677: LikeSimplification should be skipped if pattern contains any escapeChar") { + withTempView("df") { + Seq("m@ca").toDF("s").createOrReplaceTempView("df") + + val e = intercept[AnalysisException] { + sql("SELECT s LIKE 'm%@ca' ESCAPE '%' FROM df").collect() + } + assert(e.message.contains("the pattern 'm%@ca' is invalid, " + + "the escape character is not allowed to precede '@'")) + + checkAnswer(sql("SELECT s LIKE 'm@@ca' ESCAPE '@' FROM df"), Row(true)) + } + } + + test("limit partition num to 1 when distributing by foldable expressions") { + withSQLConf((SQLConf.SHUFFLE_PARTITIONS.key, "5")) { + Seq(1, "1, 2", null, "version()").foreach { expr => + val plan = sql(s"select * from values (1), (2), (3) t(a) distribute by $expr") + .queryExecution.optimizedPlan + val res = plan.collect { + case r: RepartitionByExpression if r.numPartitions == 1 => true + } + assert(res.nonEmpty) + } + } + } + + test("Fold RepartitionExpression num partition should check if partition expression is empty") { + withSQLConf((SQLConf.SHUFFLE_PARTITIONS.key, "5")) { + val df = spark.range(1).hint("REPARTITION_BY_RANGE") + val plan = df.queryExecution.optimizedPlan + val res = plan.collect { + case r: RepartitionByExpression if r.numPartitions == 5 => true + } + assert(res.nonEmpty) + } + } + + test("SPARK-34030: Fold RepartitionExpression num partition should at Optimizer") { + withSQLConf((SQLConf.SHUFFLE_PARTITIONS.key, "2")) { + Seq(1, "1, 2", null, "version()").foreach { expr => + val plan = sql(s"select * from values (1), (2), (3) t(a) distribute by $expr") + .queryExecution.analyzed + val res = plan.collect { + case r: RepartitionByExpression if r.numPartitions == 2 => true + } + assert(res.nonEmpty) + } + } + } + + test("SPARK-33591: null as string partition literal value 'null' after setting legacy conf") { + withSQLConf(SQLConf.LEGACY_PARSE_NULL_PARTITION_SPEC_AS_STRING_LITERAL.key -> "true") { + val t = "tbl" + withTable("tbl") { + sql(s"CREATE TABLE $t (col1 INT, p1 STRING) USING PARQUET PARTITIONED BY (p1)") + sql(s"INSERT INTO TABLE $t PARTITION (p1 = null) SELECT 0") + checkAnswer(spark.sql(s"SELECT * FROM $t"), Row(0, "null")) + } + } + } + + test("SPARK-33593: Vector reader got incorrect data with binary partition value") { + Seq("false", "true").foreach(value => { + withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> value) { + withTable("t1") { + sql( + """CREATE TABLE t1(name STRING, id BINARY, part BINARY) + |USING PARQUET PARTITIONED BY (part)""".stripMargin) + sql("INSERT INTO t1 PARTITION(part = 'Spark SQL') VALUES('a', X'537061726B2053514C')") + checkAnswer(sql("SELECT name, cast(id as string), cast(part as string) FROM t1"), + Row("a", "Spark SQL", "Spark SQL")) + } + } + + withSQLConf(SQLConf.ORC_VECTORIZED_READER_ENABLED.key -> value) { + withTable("t2") { + sql( + """CREATE TABLE t2(name STRING, id BINARY, part BINARY) + |USING ORC PARTITIONED BY (part)""".stripMargin) + sql("INSERT INTO t2 PARTITION(part = 'Spark SQL') VALUES('a', X'537061726B2053514C')") + checkAnswer(sql("SELECT name, cast(id as string), cast(part as string) FROM t2"), + Row("a", "Spark SQL", "Spark SQL")) + } + } + }) + } + + test("SPARK-33084: Add jar support Ivy URI in SQL -- jar contains udf class") { + val sumFuncClass = "org.apache.spark.examples.sql.Spark33084" + val functionName = "test_udf" + withTempDir { dir => + System.setProperty("ivy.home", dir.getAbsolutePath) + val sourceJar = new File(Thread.currentThread().getContextClassLoader + .getResource("SPARK-33084.jar").getFile) + val targetCacheJarDir = new File(dir.getAbsolutePath + + "/local/org.apache.spark/SPARK-33084/1.0/jars/") + targetCacheJarDir.mkdir() + // copy jar to local cache + FileUtils.copyFileToDirectory(sourceJar, targetCacheJarDir) + withTempView("v1") { + withUserDefinedFunction( + s"default.$functionName" -> false, + functionName -> true) { + // create temporary function without class + val e = intercept[AnalysisException] { + sql(s"CREATE TEMPORARY FUNCTION $functionName AS '$sumFuncClass'") + }.getMessage + assert(e.contains("Can not load class 'org.apache.spark.examples.sql.Spark33084")) + sql("ADD JAR ivy://org.apache.spark:SPARK-33084:1.0") + sql(s"CREATE TEMPORARY FUNCTION $functionName AS '$sumFuncClass'") + // create a view using a function in 'default' database + sql(s"CREATE TEMPORARY VIEW v1 AS SELECT $functionName(col1) FROM VALUES (1), (2), (3)") + // view v1 should still using function defined in `default` database + checkAnswer(sql("SELECT * FROM v1"), Seq(Row(2.0))) + } + } + } + } + + test("SPARK-33964: Combine distinct unions that have noop project between them") { + val df = sql(""" + |SELECT a, b FROM ( + | SELECT a, b FROM testData2 + | UNION + | SELECT a, sum(b) FROM testData2 GROUP BY a + | UNION + | SELECT null AS a, sum(b) FROM testData2 + |)""".stripMargin) + + val unions = df.queryExecution.sparkPlan.collect { + case u: UnionExec => u + } + + assert(unions.size == 1) + } + + test("SPARK-34421: Resolve temporary objects in temporary views with CTEs") { + val tempFuncName = "temp_func" + withUserDefinedFunction(tempFuncName -> true) { + spark.udf.register(tempFuncName, identity[Int](_)) + + val tempViewName = "temp_view" + withTempView(tempViewName) { + sql(s"CREATE TEMPORARY VIEW $tempViewName AS SELECT 1") + + val testViewName = "test_view" + + withTempView(testViewName) { + sql( + s""" + |CREATE TEMPORARY VIEW $testViewName AS + |WITH cte AS ( + | SELECT $tempFuncName(0) + |) + |SELECT * FROM cte + |""".stripMargin) + checkAnswer(sql(s"SELECT * FROM $testViewName"), Row(0)) + } + + withTempView(testViewName) { + sql( + s""" + |CREATE TEMPORARY VIEW $testViewName AS + |WITH cte AS ( + | SELECT * FROM $tempViewName + |) + |SELECT * FROM cte + |""".stripMargin) + checkAnswer(sql(s"SELECT * FROM $testViewName"), Row(1)) + } + } + } + } + + test("SPARK-34421: Resolve temporary objects in permanent views with CTEs") { + val tempFuncName = "temp_func" + withUserDefinedFunction((tempFuncName, true)) { + spark.udf.register(tempFuncName, identity[Int](_)) + + val tempViewName = "temp_view" + withTempView(tempViewName) { + sql(s"CREATE TEMPORARY VIEW $tempViewName AS SELECT 1") + + val testViewName = "test_view" + + val e = intercept[AnalysisException] { + sql( + s""" + |CREATE VIEW $testViewName AS + |WITH cte AS ( + | SELECT * FROM $tempViewName + |) + |SELECT * FROM cte + |""".stripMargin) + } + assert(e.message.contains("Not allowed to create a permanent view " + + s"`default`.`$testViewName` by referencing a temporary view $tempViewName")) + + val e2 = intercept[AnalysisException] { + sql( + s""" + |CREATE VIEW $testViewName AS + |WITH cte AS ( + | SELECT $tempFuncName(0) + |) + |SELECT * FROM cte + |""".stripMargin) + } + assert(e2.message.contains("Not allowed to create a permanent view " + + s"`default`.`$testViewName` by referencing a temporary function `$tempFuncName`")) + } + } + } + + test("SPARK-26138 Pushdown limit through InnerLike when condition is empty") { + withTable("t1", "t2") { + spark.range(5).repartition(1).write.saveAsTable("t1") + spark.range(5).repartition(1).write.saveAsTable("t2") + val df = spark.sql("SELECT * FROM t1 CROSS JOIN t2 LIMIT 3") + val pushedLocalLimits = df.queryExecution.optimizedPlan.collect { + case l @ LocalLimit(_, _: LogicalRelation) => l + } + assert(pushedLocalLimits.length === 2) + checkAnswer(df, Row(0, 0) :: Row(0, 1) :: Row(0, 2) :: Nil) + } + } + + test("SPARK-34514: Push down limit through LEFT SEMI and LEFT ANTI join") { + withTable("left_table", "nonempty_right_table", "empty_right_table") { + spark.range(5).toDF().repartition(1).write.saveAsTable("left_table") + spark.range(3).write.saveAsTable("nonempty_right_table") + spark.range(0).write.saveAsTable("empty_right_table") + Seq("LEFT SEMI", "LEFT ANTI").foreach { joinType => + val joinWithNonEmptyRightDf = spark.sql( + s"SELECT * FROM left_table $joinType JOIN nonempty_right_table LIMIT 3") + val joinWithEmptyRightDf = spark.sql( + s"SELECT * FROM left_table $joinType JOIN empty_right_table LIMIT 3") + + Seq(joinWithNonEmptyRightDf, joinWithEmptyRightDf).foreach { df => + val pushedLocalLimits = df.queryExecution.optimizedPlan.collect { + case l @ LocalLimit(_, _: LogicalRelation) => l + } + assert(pushedLocalLimits.length === 1) + } + + val expectedAnswer = Seq(Row(0), Row(1), Row(2)) + if (joinType == "LEFT SEMI") { + checkAnswer(joinWithNonEmptyRightDf, expectedAnswer) + checkAnswer(joinWithEmptyRightDf, Seq.empty) + } else { + checkAnswer(joinWithNonEmptyRightDf, Seq.empty) + checkAnswer(joinWithEmptyRightDf, expectedAnswer) + } + } + } + } + + test("SPARK-34575 Push down limit through window when partitionSpec is empty") { + withTable("t1") { + val numRows = 10 + spark.range(numRows) + .selectExpr("if (id % 2 = 0, null, id) AS a", s"$numRows - id AS b") + .write + .saveAsTable("t1") + + val df1 = spark.sql( + """ + |SELECT a, b, ROW_NUMBER() OVER(ORDER BY a, b) AS rn + |FROM t1 LIMIT 3 + |""".stripMargin) + val pushedLocalLimits1 = df1.queryExecution.optimizedPlan.collect { + case l @ LocalLimit(_, _: Sort) => l + } + assert(pushedLocalLimits1.length === 1) + checkAnswer(df1, Seq(Row(null, 2, 1), Row(null, 4, 2), Row(null, 6, 3))) + + val df2 = spark.sql( + """ + |SELECT b, RANK() OVER(ORDER BY a, b) AS rk, DENSE_RANK(b) OVER(ORDER BY a, b) AS s + |FROM t1 LIMIT 2 + |""".stripMargin) + val pushedLocalLimits2 = df2.queryExecution.optimizedPlan.collect { + case l @ LocalLimit(_, _: Sort) => l + } + assert(pushedLocalLimits2.length === 1) + checkAnswer(df2, Seq(Row(2, 1, 1), Row(4, 2, 2))) + } + } + + test("SPARK-34796: Avoid code-gen compilation error for LIMIT query") { + withTable("left_table", "empty_right_table", "output_table") { + spark.range(5).toDF("k").write.saveAsTable("left_table") + spark.range(0).toDF("k").write.saveAsTable("empty_right_table") + + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") { + spark.sql("CREATE TABLE output_table (k INT) USING parquet") + spark.sql( + """ + |INSERT INTO TABLE output_table + |SELECT t1.k FROM left_table t1 + |JOIN empty_right_table t2 + |ON t1.k = t2.k + |LIMIT 3 + """.stripMargin) + } + } + } + + test("SPARK-33482: Fix FileScan canonicalization") { + withSQLConf(SQLConf.USE_V1_SOURCE_LIST.key -> "") { + withTempPath { path => + spark.range(5).toDF().write.mode("overwrite").parquet(path.toString) + withTempView("t") { + spark.read.parquet(path.toString).createOrReplaceTempView("t") + val df = sql( + """ + |SELECT * + |FROM t AS t1 + |JOIN t AS t2 ON t2.id = t1.id + |JOIN t AS t3 ON t3.id = t2.id + |""".stripMargin) + df.collect() + val reusedExchanges = collect(df.queryExecution.executedPlan) { + case r: ReusedExchangeExec => r + } + assert(reusedExchanges.size == 1) + } + } + } + } + + test("SPARK-35331: Fix resolving original expression in RepartitionByExpression after aliased") { + Seq("CLUSTER", "DISTRIBUTE").foreach { keyword => + Seq("a", "substr(a, 0, 3)").foreach { expr => + val clause = keyword + " by " + expr + withClue(clause) { + checkAnswer(sql(s"select a b from values('123') t(a) $clause"), Row("123")) + } + } + } + checkAnswer(sql(s"select /*+ REPARTITION(3, a) */ a b from values('123') t(a)"), Row("123")) + } } case class Foo(bar: Option[String]) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala b/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala new file mode 100644 index 0000000000000..b9ca2a0f034e5 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestHelper.scala @@ -0,0 +1,100 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import scala.util.control.NonFatal + +import org.apache.spark.SparkException +import org.apache.spark.sql.catalyst.planning.PhysicalOperation +import org.apache.spark.sql.catalyst.plans.logical._ +import org.apache.spark.sql.execution.HiveResult.hiveResultString +import org.apache.spark.sql.execution.SQLExecution +import org.apache.spark.sql.execution.command.{DescribeColumnCommand, DescribeCommandBase} +import org.apache.spark.sql.types.StructType + +trait SQLQueryTestHelper { + + private val notIncludedMsg = "[not included in comparison]" + private val clsName = this.getClass.getCanonicalName + protected val emptySchema = StructType(Seq.empty).catalogString + + protected def replaceNotIncludedMsg(line: String): String = { + line.replaceAll("#\\d+", "#x") + .replaceAll( + s"Location.*$clsName/", + s"Location $notIncludedMsg/{warehouse_dir}/") + .replaceAll("Created By.*", s"Created By $notIncludedMsg") + .replaceAll("Created Time.*", s"Created Time $notIncludedMsg") + .replaceAll("Last Access.*", s"Last Access $notIncludedMsg") + .replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg") + .replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds + } + + + /** Executes a query and returns the result as (schema of the output, normalized output). */ + protected def getNormalizedResult(session: SparkSession, sql: String): (String, Seq[String]) = { + // Returns true if the plan is supposed to be sorted. + def isSorted(plan: LogicalPlan): Boolean = plan match { + case _: Join | _: Aggregate | _: Generate | _: Sample | _: Distinct => false + case _: DescribeCommandBase + | _: DescribeColumnCommand + | _: DescribeRelation + | _: DescribeColumn => true + case PhysicalOperation(_, _, Sort(_, true, _)) => true + case _ => plan.children.iterator.exists(isSorted) + } + + val df = session.sql(sql) + val schema = df.schema.catalogString + // Get answer, but also get rid of the #1234 expression ids that show up in explain plans + val answer = SQLExecution.withNewExecutionId(df.queryExecution, Some(sql)) { + hiveResultString(df.queryExecution.executedPlan).map(replaceNotIncludedMsg) + } + + // If the output is not pre-sorted, sort it. + if (isSorted(df.queryExecution.analyzed)) (schema, answer) else (schema, answer.sorted) + } + + /** + * This method handles exceptions occurred during query execution as they may need special care + * to become comparable to the expected output. + * + * @param result a function that returns a pair of schema and output + */ + protected def handleExceptions(result: => (String, Seq[String])): (String, Seq[String]) = { + try { + result + } catch { + case a: AnalysisException => + // Do not output the logical plan tree which contains expression IDs. + // Also implement a crude way of masking expression IDs in the error message + // with a generic pattern "###". + val msg = if (a.plan.nonEmpty) a.getSimpleMessage else a.getMessage + (emptySchema, Seq(a.getClass.getName, msg.replaceAll("#\\d+", "#x"))) + case s: SparkException if s.getCause != null => + // For a runtime exception, it is hard to match because its message contains + // information of stage, task ID, etc. + // To make result matching simpler, here we match the cause of the exception if it exists. + val cause = s.getCause + (emptySchema, Seq(cause.getClass.getName, cause.getMessage)) + case NonFatal(e) => + // If there is an exception, put the exception class followed by the message. + (emptySchema, Seq(e.getClass.getName, e.getMessage)) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala index 92da58c27a141..609e0094f9ee4 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala @@ -18,26 +18,22 @@ package org.apache.spark.sql import java.io.File +import java.net.URI import java.util.Locale -import java.util.regex.Pattern -import scala.collection.mutable.{ArrayBuffer, HashMap} -import scala.util.control.NonFatal +import scala.collection.mutable.ArrayBuffer -import org.apache.spark.{SparkConf, SparkException} +import org.apache.spark.{SparkConf, TestUtils} import org.apache.spark.sql.catalyst.expressions.codegen.CodeGenerator -import org.apache.spark.sql.catalyst.planning.PhysicalOperation -import org.apache.spark.sql.catalyst.plans.logical._ +import org.apache.spark.sql.catalyst.plans.SQLHelper import org.apache.spark.sql.catalyst.rules.RuleExecutor import org.apache.spark.sql.catalyst.util.{fileToString, stringToFile} import org.apache.spark.sql.catalyst.util.DateTimeConstants.NANOS_PER_SECOND -import org.apache.spark.sql.execution.{SQLExecution, WholeStageCodegenExec} -import org.apache.spark.sql.execution.HiveResult.hiveResultString -import org.apache.spark.sql.execution.command.{DescribeColumnCommand, DescribeCommandBase} +import org.apache.spark.sql.execution.WholeStageCodegenExec import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession -import org.apache.spark.sql.types.StructType import org.apache.spark.tags.ExtendedSQLTest +import org.apache.spark.util.Utils /** * End-to-end test cases for SQL queries. @@ -47,22 +43,22 @@ import org.apache.spark.tags.ExtendedSQLTest * * To run the entire test suite: * {{{ - * build/sbt "sql/test-only *SQLQueryTestSuite" + * build/sbt "sql/testOnly *SQLQueryTestSuite" * }}} * * To run a single test file upon change: * {{{ - * build/sbt "~sql/test-only *SQLQueryTestSuite -- -z inline-table.sql" + * build/sbt "~sql/testOnly *SQLQueryTestSuite -- -z inline-table.sql" * }}} * * To re-generate golden files for entire suite, run: * {{{ - * SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/test-only *SQLQueryTestSuite" + * SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/testOnly *SQLQueryTestSuite" * }}} * * To re-generate golden file for a single test, run: * {{{ - * SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/test-only *SQLQueryTestSuite -- -z describe.sql" + * SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/testOnly *SQLQueryTestSuite -- -z describe.sql" * }}} * * The format for input files is simple: @@ -124,7 +120,8 @@ import org.apache.spark.tags.ExtendedSQLTest * different types of UDFs. See 'udf/udf-inner-join.sql' as an example. */ @ExtendedSQLTest -class SQLQueryTestSuite extends QueryTest with SharedSparkSession { +class SQLQueryTestSuite extends QueryTest with SharedSparkSession with SQLHelper + with SQLQueryTestHelper { import IntegratedUDFTestUtils._ @@ -134,14 +131,7 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession { // We use a path based on Spark home for 2 reasons: // 1. Maven can't get correct resource directory when resources in other jars. // 2. We test subclasses in the hive-thriftserver module. - val sparkHome = { - assert(sys.props.contains("spark.test.home") || - sys.env.contains("SPARK_HOME"), "spark.test.home or SPARK_HOME is not set.") - sys.props.getOrElse("spark.test.home", sys.env("SPARK_HOME")) - } - - java.nio.file.Paths.get(sparkHome, - "sql", "core", "src", "test", "resources", "sql-tests").toFile + getWorkspaceFilePath("sql", "core", "src", "test", "resources", "sql-tests").toFile } protected val inputFilePath = new File(baseResourcePath, "inputs").getAbsolutePath @@ -149,19 +139,18 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession { protected val validFileExtensions = ".sql" - private val notIncludedMsg = "[not included in comparison]" - private val clsName = this.getClass.getCanonicalName - - protected val emptySchema = StructType(Seq.empty).catalogString - protected override def sparkConf: SparkConf = super.sparkConf // Fewer shuffle partitions to speed up testing. .set(SQLConf.SHUFFLE_PARTITIONS, 4) + // SPARK-32106 Since we add SQL test 'transform.sql' will use `cat` command, + // here we need to ignore it. + private val otherIgnoreList = + if (TestUtils.testCommandAvailable("/bin/bash")) Nil else Set("transform.sql") /** List of test cases to ignore, in lower cases. */ - protected def blackList: Set[String] = Set( - "blacklist.sql" // Do NOT remove this one. It is here to test the blacklist functionality. - ) + protected def ignoreList: Set[String] = Set( + "ignored.sql" // Do NOT remove this one. It is here to test the ignore functionality. + ) ++ otherIgnoreList // Create all the test cases. listTestCases.foreach(createScalaTestCase) @@ -228,7 +217,7 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession { name: String, inputFile: String, resultFile: String) extends TestCase with AnsiTest protected def createScalaTestCase(testCase: TestCase): Unit = { - if (blackList.exists(t => + if (ignoreList.exists(t => testCase.name.toLowerCase(Locale.ROOT).contains(t.toLowerCase(Locale.ROOT)))) { // Create a test case to ignore this case. ignore(testCase.name) { /* Do nothing */ } @@ -282,18 +271,18 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession { val allCode = importedCode ++ code val tempQueries = if (allCode.exists(_.trim.startsWith("--QUERY-DELIMITER"))) { // Although the loop is heavy, only used for bracketed comments test. - val querys = new ArrayBuffer[String] + val queries = new ArrayBuffer[String] val otherCodes = new ArrayBuffer[String] var tempStr = "" var start = false for (c <- allCode) { if (c.trim.startsWith("--QUERY-DELIMITER-START")) { start = true - querys ++= splitWithSemicolon(otherCodes.toSeq) + queries ++= splitWithSemicolon(otherCodes.toSeq) otherCodes.clear() } else if (c.trim.startsWith("--QUERY-DELIMITER-END")) { start = false - querys += s"\n${tempStr.stripSuffix(";")}" + queries += s"\n${tempStr.stripSuffix(";")}" tempStr = "" } else if (start) { tempStr += s"\n$c" @@ -302,9 +291,9 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession { } } if (otherCodes.nonEmpty) { - querys ++= splitWithSemicolon(otherCodes.toSeq) + queries ++= splitWithSemicolon(otherCodes.toSeq) } - querys.toSeq + queries.toSeq } else { splitWithSemicolon(allCode).toSeq } @@ -378,6 +367,7 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession { // vol used by boolean.sql and case.sql. localSparkSession.udf.register("vol", (s: String) => s) localSparkSession.conf.set(SQLConf.ANSI_ENABLED.key, true) + localSparkSession.conf.set(SQLConf.LEGACY_INTERVAL_ENABLED.key, true) case _: AnsiTest => localSparkSession.conf.set(SQLConf.ANSI_ENABLED.key, true) case _ => @@ -405,7 +395,7 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession { val goldenOutput = { s"-- Automatically generated by ${getClass.getSimpleName}\n" + s"-- Number of queries: ${outputs.size}\n\n\n" + - outputs.zipWithIndex.map{case (qr, i) => qr.toString}.mkString("\n\n\n") + "\n" + outputs.mkString("\n\n\n") + "\n" } val resultFile = new File(testCase.resultFile) val parent = resultFile.getParentFile @@ -470,70 +460,6 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession { } } - /** - * This method handles exceptions occurred during query execution as they may need special care - * to become comparable to the expected output. - * - * @param result a function that returns a pair of schema and output - */ - protected def handleExceptions(result: => (String, Seq[String])): (String, Seq[String]) = { - try { - result - } catch { - case a: AnalysisException => - // Do not output the logical plan tree which contains expression IDs. - // Also implement a crude way of masking expression IDs in the error message - // with a generic pattern "###". - val msg = if (a.plan.nonEmpty) a.getSimpleMessage else a.getMessage - (emptySchema, Seq(a.getClass.getName, msg.replaceAll("#\\d+", "#x"))) - case s: SparkException if s.getCause != null => - // For a runtime exception, it is hard to match because its message contains - // information of stage, task ID, etc. - // To make result matching simpler, here we match the cause of the exception if it exists. - val cause = s.getCause - (emptySchema, Seq(cause.getClass.getName, cause.getMessage)) - case NonFatal(e) => - // If there is an exception, put the exception class followed by the message. - (emptySchema, Seq(e.getClass.getName, e.getMessage)) - } - } - - /** Executes a query and returns the result as (schema of the output, normalized output). */ - private def getNormalizedResult(session: SparkSession, sql: String): (String, Seq[String]) = { - // Returns true if the plan is supposed to be sorted. - def isSorted(plan: LogicalPlan): Boolean = plan match { - case _: Join | _: Aggregate | _: Generate | _: Sample | _: Distinct => false - case _: DescribeCommandBase - | _: DescribeColumnCommand - | _: DescribeRelation - | _: DescribeColumnStatement => true - case PhysicalOperation(_, _, Sort(_, true, _)) => true - case _ => plan.children.iterator.exists(isSorted) - } - - val df = session.sql(sql) - val schema = df.schema.catalogString - // Get answer, but also get rid of the #1234 expression ids that show up in explain plans - val answer = SQLExecution.withNewExecutionId(df.queryExecution, Some(sql)) { - hiveResultString(df.queryExecution.executedPlan).map(replaceNotIncludedMsg) - } - - // If the output is not pre-sorted, sort it. - if (isSorted(df.queryExecution.analyzed)) (schema, answer) else (schema, answer.sorted) - } - - protected def replaceNotIncludedMsg(line: String): String = { - line.replaceAll("#\\d+", "#x") - .replaceAll( - s"Location.*$clsName/", - s"Location $notIncludedMsg/{warehouse_dir}/") - .replaceAll("Created By.*", s"Created By $notIncludedMsg") - .replaceAll("Created Time.*", s"Created Time $notIncludedMsg") - .replaceAll("Last Access.*", s"Last Access $notIncludedMsg") - .replaceAll("Partition Statistics\t\\d+", s"Partition Statistics\t$notIncludedMsg") - .replaceAll("\\*\\(\\d+\\) ", "*") // remove the WholeStageCodegen codegenStageIds - } - protected lazy val listTestCases: Seq[TestCase] = { listFilesRecursively(new File(inputFilePath)).flatMap { file => val resultFile = file.getAbsolutePath.replace(inputFilePath, goldenFilePath) + ".out" @@ -574,6 +500,14 @@ class SQLQueryTestSuite extends QueryTest with SharedSparkSession { private def createTestTables(session: SparkSession): Unit = { import session.implicits._ + // Before creating test tables, deletes orphan directories in warehouse dir + Seq("testdata", "arraydata", "mapdata", "aggtest", "onek", "tenk1").foreach { dirName => + val f = new File(new URI(s"${conf.warehousePath}/$dirName")) + if (f.exists()) { + Utils.deleteRecursively(f) + } + } + (1 to 100).map(i => (i, i.toString)).toDF("key", "value") .repartition(1) .write diff --git a/sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala index 4e85f739b95a2..5ce5d36c5e8f7 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/ShowCreateTableSuite.scala @@ -155,16 +155,19 @@ abstract class ShowCreateTableSuite extends QueryTest with SQLTestUtils { val ex = intercept[AnalysisException] { sql(s"SHOW CREATE TABLE $viewName") } - assert(ex.getMessage.contains("SHOW CREATE TABLE is not supported on a temporary view")) + assert(ex.getMessage.contains( + s"$viewName is a temp view. 'SHOW CREATE TABLE' expects a table or permanent view.")) } withGlobalTempView(viewName) { sql(s"CREATE GLOBAL TEMPORARY VIEW $viewName AS SELECT 1 AS a") + val globalTempViewDb = spark.sessionState.catalog.globalTempViewManager.database val ex = intercept[AnalysisException] { - val globalTempViewDb = spark.sessionState.catalog.globalTempViewManager.database sql(s"SHOW CREATE TABLE $globalTempViewDb.$viewName") } - assert(ex.getMessage.contains("SHOW CREATE TABLE is not supported on a temporary view")) + assert(ex.getMessage.contains( + s"$globalTempViewDb.$viewName is a temp view. " + + "'SHOW CREATE TABLE' expects a table or permanent view.")) } } @@ -220,29 +223,6 @@ abstract class ShowCreateTableSuite extends QueryTest with SQLTestUtils { } protected def checkCatalogTables(expected: CatalogTable, actual: CatalogTable): Unit = { - def normalize(table: CatalogTable): CatalogTable = { - val nondeterministicProps = Set( - "CreateTime", - "transient_lastDdlTime", - "grantTime", - "lastUpdateTime", - "last_modified_by", - "last_modified_time", - "Owner:", - // The following are hive specific schema parameters which we do not need to match exactly. - "totalNumberFiles", - "maxFileSize", - "minFileSize" - ) - - table.copy( - createTime = 0L, - lastAccessTime = 0L, - properties = table.properties.filterKeys(!nondeterministicProps.contains(_)), - stats = None, - ignoredProperties = Map.empty - ) - } - assert(normalize(actual) == normalize(expected)) + assert(CatalogTable.normalize(actual) == CatalogTable.normalize(expected)) } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SparkSessionBuilderSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SparkSessionBuilderSuite.scala index 7b76d0702d835..f12f866073d61 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/SparkSessionBuilderSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/SparkSessionBuilderSuite.scala @@ -17,17 +17,25 @@ package org.apache.spark.sql +import scala.collection.JavaConverters._ + +import org.apache.hadoop.fs.Path import org.scalatest.BeforeAndAfterEach +import org.scalatest.concurrent.Eventually +import org.scalatest.time.SpanSugar._ -import org.apache.spark.{SparkConf, SparkContext, SparkFunSuite} +import org.apache.spark.{SparkConf, SparkContext, SparkException, SparkFunSuite} +import org.apache.spark.internal.config.EXECUTOR_ALLOW_SPARK_CONTEXT import org.apache.spark.internal.config.UI.UI_ENABLED import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.internal.StaticSQLConf._ +import org.apache.spark.sql.util.ExecutionListenerBus +import org.apache.spark.util.ThreadUtils /** * Test cases for the builder pattern of [[SparkSession]]. */ -class SparkSessionBuilderSuite extends SparkFunSuite with BeforeAndAfterEach { +class SparkSessionBuilderSuite extends SparkFunSuite with BeforeAndAfterEach with Eventually { override def afterEach(): Unit = { // This suite should not interfere with the other test suites. @@ -37,6 +45,34 @@ class SparkSessionBuilderSuite extends SparkFunSuite with BeforeAndAfterEach { SparkSession.clearDefaultSession() } + test("SPARK-34087: Fix memory leak of ExecutionListenerBus") { + val spark = SparkSession.builder() + .master("local") + .getOrCreate() + + @inline def listenersNum(): Int = { + spark.sparkContext + .listenerBus + .listeners + .asScala + .count(_.isInstanceOf[ExecutionListenerBus]) + } + + (1 to 10).foreach { _ => + spark.cloneSession() + SparkSession.clearActiveSession() + } + + eventually(timeout(10.seconds), interval(1.seconds)) { + System.gc() + // After GC, the number of ExecutionListenerBus should be less than 11 (we created 11 + // SparkSessions in total). + // Since GC can't 100% guarantee all out-of-referenced objects be cleaned at one time, + // here, we check at least one listener is cleaned up to prove the mechanism works. + assert(listenersNum() < 11) + } + } + test("create with config options and propagate them to SparkContext and SparkSession") { val session = SparkSession.builder() .master("local") @@ -169,6 +205,31 @@ class SparkSessionBuilderSuite extends SparkFunSuite with BeforeAndAfterEach { assert(session.sessionState.conf.getConf(GLOBAL_TEMP_DATABASE) === "globaltempdb-spark-31234") } + test("SPARK-31354: SparkContext only register one SparkSession ApplicationEnd listener") { + val conf = new SparkConf() + .setMaster("local") + .setAppName("test-app-SPARK-31354-1") + val context = new SparkContext(conf) + SparkSession + .builder() + .sparkContext(context) + .master("local") + .getOrCreate() + val postFirstCreation = context.listenerBus.listeners.size() + SparkSession.clearActiveSession() + SparkSession.clearDefaultSession() + + SparkSession + .builder() + .sparkContext(context) + .master("local") + .getOrCreate() + val postSecondCreation = context.listenerBus.listeners.size() + SparkSession.clearActiveSession() + SparkSession.clearDefaultSession() + assert(postFirstCreation == postSecondCreation) + } + test("SPARK-31532: should not propagate static sql configs to the existing" + " active/default SparkSession") { val session = SparkSession.builder() @@ -213,6 +274,202 @@ class SparkSessionBuilderSuite extends SparkFunSuite with BeforeAndAfterEach { .getOrCreate() assert(session.conf.get("spark.app.name") === "test-app-SPARK-31532-2") assert(session.conf.get(GLOBAL_TEMP_DATABASE) === "globaltempdb-spark-31532-2") - assert(session.conf.get(WAREHOUSE_PATH) === "SPARK-31532-db-2") + assert(session.conf.get(WAREHOUSE_PATH) contains "SPARK-31532-db-2") + } + + test("SPARK-32062: reset listenerRegistered in SparkSession") { + (1 to 2).foreach { i => + val conf = new SparkConf() + .setMaster("local") + .setAppName(s"test-SPARK-32062-$i") + val context = new SparkContext(conf) + val beforeListenerSize = context.listenerBus.listeners.size() + SparkSession + .builder() + .sparkContext(context) + .getOrCreate() + val afterListenerSize = context.listenerBus.listeners.size() + assert(beforeListenerSize + 1 == afterListenerSize) + context.stop() + } + } + + test("SPARK-32160: Disallow to create SparkSession in executors") { + val session = SparkSession.builder().master("local-cluster[3, 1, 1024]").getOrCreate() + + val error = intercept[SparkException] { + session.range(1).foreach { v => + SparkSession.builder.master("local").getOrCreate() + () + } + }.getMessage() + + assert(error.contains("SparkSession should only be created and accessed on the driver.")) + } + + test("SPARK-32160: Allow to create SparkSession in executors if the config is set") { + val session = SparkSession.builder().master("local-cluster[3, 1, 1024]").getOrCreate() + + session.range(1).foreach { v => + SparkSession.builder.master("local") + .config(EXECUTOR_ALLOW_SPARK_CONTEXT.key, true).getOrCreate().stop() + () + } + } + + test("SPARK-32991: Use conf in shared state as the original configuration for RESET") { + val wh = "spark.sql.warehouse.dir" + val td = "spark.sql.globalTempDatabase" + val custom = "spark.sql.custom" + + val conf = new SparkConf() + .setMaster("local") + .setAppName("SPARK-32991") + .set(wh, "./data1") + .set(td, "bob") + + val sc = new SparkContext(conf) + + val spark = SparkSession.builder() + .config(wh, "./data2") + .config(td, "alice") + .config(custom, "kyao") + .getOrCreate() + + // When creating the first session like above, we will update the shared spark conf to the + // newly specified values + val sharedWH = spark.sharedState.conf.get(wh) + val sharedTD = spark.sharedState.conf.get(td) + assert(sharedWH contains "data2", + "The warehouse dir in shared state should be determined by the 1st created spark session") + assert(sharedTD === "alice", + "Static sql configs in shared state should be determined by the 1st created spark session") + assert(spark.sharedState.conf.getOption(custom).isEmpty, + "Dynamic sql configs is session specific") + + assert(spark.conf.get(wh) contains sharedWH, + "The warehouse dir in session conf and shared state conf should be consistent") + assert(spark.conf.get(td) === sharedTD, + "Static sql configs in session conf and shared state conf should be consistent") + assert(spark.conf.get(custom) === "kyao", "Dynamic sql configs is session specific") + + spark.sql("RESET") + + assert(spark.conf.get(wh) contains sharedWH, + "The warehouse dir in shared state should be respect after RESET") + assert(spark.conf.get(td) === sharedTD, + "Static sql configs in shared state should be respect after RESET") + assert(spark.conf.get(custom) === "kyao", + "Dynamic sql configs in session initial map should be respect after RESET") + + val spark2 = SparkSession.builder() + .config(wh, "./data3") + .config(custom, "kyaoo").getOrCreate() + assert(spark2.conf.get(wh) contains sharedWH) + assert(spark2.conf.get(td) === sharedTD) + assert(spark2.conf.get(custom) === "kyaoo") + } + + test("SPARK-32991: RESET should work properly with multi threads") { + val wh = "spark.sql.warehouse.dir" + val td = "spark.sql.globalTempDatabase" + val custom = "spark.sql.custom" + val spark = ThreadUtils.runInNewThread("new session 0", false) { + SparkSession.builder() + .master("local") + .config(wh, "./data0") + .config(td, "bob") + .config(custom, "c0") + .getOrCreate() + } + + spark.sql(s"SET $custom=c1") + assert(spark.conf.get(custom) === "c1") + spark.sql("RESET") + assert(spark.conf.get(wh) contains "data0", + "The warehouse dir in shared state should be respect after RESET") + assert(spark.conf.get(td) === "bob", + "Static sql configs in shared state should be respect after RESET") + assert(spark.conf.get(custom) === "c0", + "Dynamic sql configs in shared state should be respect after RESET") + + val spark1 = ThreadUtils.runInNewThread("new session 1", false) { + SparkSession.builder().getOrCreate() + } + + assert(spark === spark1) + + // TODO: SPARK-33718: After clear sessions, the SharedState will be unreachable, then all + // the new static will take effect. + SparkSession.clearDefaultSession() + val spark2 = ThreadUtils.runInNewThread("new session 2", false) { + SparkSession.builder() + .master("local") + .config(wh, "./data1") + .config(td, "alice") + .config(custom, "c2") + .getOrCreate() + } + + assert(spark2 !== spark) + spark2.sql(s"SET $custom=c1") + assert(spark2.conf.get(custom) === "c1") + spark2.sql("RESET") + assert(spark2.conf.get(wh) contains "data1") + assert(spark2.conf.get(td) === "alice") + assert(spark2.conf.get(custom) === "c2") + + } + + test("SPARK-33944: warning setting hive.metastore.warehouse.dir using session options") { + val msg = "Not allowing to set hive.metastore.warehouse.dir in SparkSession's options" + val logAppender = new LogAppender(msg) + withLogAppender(logAppender) { + SparkSession.builder() + .master("local") + .config("hive.metastore.warehouse.dir", "any") + .getOrCreate() + .sharedState + } + assert(logAppender.loggingEvents.exists(_.getRenderedMessage.contains(msg))) + } + + test("SPARK-33944: no warning setting spark.sql.warehouse.dir using session options") { + val msg = "Not allowing to set hive.metastore.warehouse.dir in SparkSession's options" + val logAppender = new LogAppender(msg) + withLogAppender(logAppender) { + SparkSession.builder() + .master("local") + .config("spark.sql.warehouse.dir", "any") + .getOrCreate() + .sharedState + } + assert(!logAppender.loggingEvents.exists(_.getRenderedMessage.contains(msg))) + } + + Seq(".", "..", "dir0", "dir0/dir1", "/dir0/dir1", "./dir0").foreach { pathStr => + test(s"SPARK-34558: warehouse path ($pathStr) should be qualified for spark/hadoop conf") { + val path = new Path(pathStr) + val conf = new SparkConf().set(WAREHOUSE_PATH, pathStr) + val session = SparkSession.builder() + .master("local") + .config(conf) + .getOrCreate() + val hadoopConf = session.sessionState.newHadoopConf() + val expected = path.getFileSystem(hadoopConf).makeQualified(path).toString + // session related configs + assert(hadoopConf.get("hive.metastore.warehouse.dir") === expected) + assert(session.conf.get(WAREHOUSE_PATH) === expected) + assert(session.sessionState.conf.warehousePath === expected) + + // shared configs + assert(session.sharedState.conf.get(WAREHOUSE_PATH) === expected) + assert(session.sharedState.hadoopConf.get("hive.metastore.warehouse.dir") === expected) + + // spark context configs + assert(session.sparkContext.conf.get(WAREHOUSE_PATH) === expected) + assert(session.sparkContext.hadoopConfiguration.get("hive.metastore.warehouse.dir") === + expected) + } } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SparkSessionExtensionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SparkSessionExtensionSuite.scala index d9c90c7dbd085..c8768ec2c5af1 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/SparkSessionExtensionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/SparkSessionExtensionSuite.scala @@ -16,17 +16,24 @@ */ package org.apache.spark.sql -import java.util.Locale +import java.util.{Locale, UUID} -import org.apache.spark.{SparkFunSuite, TaskContext} +import scala.concurrent.Future + +import org.apache.spark.{MapOutputStatistics, SparkFunSuite, TaskContext} +import org.apache.spark.broadcast.Broadcast import org.apache.spark.internal.Logging import org.apache.spark.rdd.RDD -import org.apache.spark.sql.catalyst.{FunctionIdentifier, TableIdentifier} +import org.apache.spark.sql.catalyst.{FunctionIdentifier, InternalRow, TableIdentifier} import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.parser.{CatalystSqlParser, ParserInterface} -import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, LogicalPlan, UnresolvedHint} +import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, LogicalPlan, Statistics, UnresolvedHint} +import org.apache.spark.sql.catalyst.plans.physical.Partitioning import org.apache.spark.sql.catalyst.rules.Rule +import org.apache.spark.sql.catalyst.trees.TreeNodeTag import org.apache.spark.sql.execution._ +import org.apache.spark.sql.execution.adaptive.{AdaptiveSparkPlanExec, QueryStageExec} +import org.apache.spark.sql.execution.exchange.{BroadcastExchangeExec, BroadcastExchangeLike, ShuffleExchangeExec, ShuffleExchangeLike, ShuffleOrigin} import org.apache.spark.sql.execution.vectorized.OnHeapColumnVector import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.internal.SQLConf.COLUMN_BATCH_SIZE @@ -39,8 +46,8 @@ import org.apache.spark.unsafe.types.UTF8String * Test cases for the [[SparkSessionExtensions]]. */ class SparkSessionExtensionSuite extends SparkFunSuite { - type ExtensionsBuilder = SparkSessionExtensions => Unit - private def create(builder: ExtensionsBuilder): Seq[ExtensionsBuilder] = Seq(builder) + private def create( + builder: SparkSessionExtensionsProvider): Seq[SparkSessionExtensionsProvider] = Seq(builder) private def stop(spark: SparkSession): Unit = { spark.stop() @@ -48,7 +55,8 @@ class SparkSessionExtensionSuite extends SparkFunSuite { SparkSession.clearDefaultSession() } - private def withSession(builders: Seq[ExtensionsBuilder])(f: SparkSession => Unit): Unit = { + private def withSession( + builders: Seq[SparkSessionExtensionsProvider])(f: SparkSession => Unit): Unit = { val builder = SparkSession.builder().master("local[1]") builders.foreach(builder.withExtensions) val spark = builder.getOrCreate() @@ -81,6 +89,12 @@ class SparkSessionExtensionSuite extends SparkFunSuite { } } + test("SPARK-33621: inject a pre CBO rule") { + withSession(Seq(_.injectPreCBORule(MyRule))) { session => + assert(session.sessionState.optimizer.preCBORules.contains(MyRule(session))) + } + } + test("inject spark planner strategy") { withSession(Seq(_.injectPlannerStrategy(MySparkStrategy))) { session => assert(session.sessionState.planner.strategies.contains(MySparkStrategy(session))) @@ -145,33 +159,83 @@ class SparkSessionExtensionSuite extends SparkFunSuite { } } - test("inject columnar") { + test("inject adaptive query prep rule") { val extensions = create { extensions => + // inject rule that will run during AQE query stage preparation and will add custom tags + // to the plan + extensions.injectQueryStagePrepRule(session => MyQueryStagePrepRule()) + // inject rule that will run during AQE query stage optimization and will verify that the + // custom tags were written in the preparation phase extensions.injectColumnar(session => - MyColumarRule(PreRuleReplaceAddWithBrokenVersion(), MyPostRule())) + MyColumnarRule(MyNewQueryStageRule(), MyNewQueryStageRule())) } withSession(extensions) { session => - // The ApplyColumnarRulesAndInsertTransitions rule is not applied when enable AQE - session.sessionState.conf.setConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED, false) + session.sessionState.conf.setConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED, true) + assert(session.sessionState.queryStagePrepRules.contains(MyQueryStagePrepRule())) assert(session.sessionState.columnarRules.contains( - MyColumarRule(PreRuleReplaceAddWithBrokenVersion(), MyPostRule()))) + MyColumnarRule(MyNewQueryStageRule(), MyNewQueryStageRule()))) import session.sqlContext.implicits._ - // repartitioning avoids having the add operation pushed up into the LocalTableScan val data = Seq((100L), (200L), (300L)).toDF("vals").repartition(1) val df = data.selectExpr("vals + 1") - // Verify that both pre and post processing of the plan worked. - val found = df.queryExecution.executedPlan.collect { - case rep: ReplacedRowToColumnarExec => 1 - case proj: ColumnarProjectExec => 10 - case c2r: ColumnarToRowExec => 100 - }.sum - assert(found == 111) + df.collect() + } + } + + test("inject columnar AQE on") { + testInjectColumnar(true) + } + + test("inject columnar AQE off") { + testInjectColumnar(false) + } + + private def testInjectColumnar(enableAQE: Boolean): Unit = { + def collectPlanSteps(plan: SparkPlan): Seq[Int] = plan match { + case a: AdaptiveSparkPlanExec => + assert(a.toString.startsWith("AdaptiveSparkPlan isFinalPlan=true")) + collectPlanSteps(a.executedPlan) + case _ => plan.collect { + case _: ReplacedRowToColumnarExec => 1 + case _: ColumnarProjectExec => 10 + case _: ColumnarToRowExec => 100 + case s: QueryStageExec => collectPlanSteps(s.plan).sum + case _: MyShuffleExchangeExec => 1000 + case _: MyBroadcastExchangeExec => 10000 + } + } + + val extensions = create { extensions => + extensions.injectColumnar(session => + MyColumnarRule(PreRuleReplaceAddWithBrokenVersion(), MyPostRule())) + } + withSession(extensions) { session => + session.sessionState.conf.setConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED, enableAQE) + assert(session.sessionState.columnarRules.contains( + MyColumnarRule(PreRuleReplaceAddWithBrokenVersion(), MyPostRule()))) + import session.sqlContext.implicits._ + // perform a join to inject a broadcast exchange + val left = Seq((1, 50L), (2, 100L), (3, 150L)).toDF("l1", "l2") + val right = Seq((1, 50L), (2, 100L), (3, 150L)).toDF("r1", "r2") + val data = left.join(right, $"l1" === $"r1") + // repartitioning avoids having the add operation pushed up into the LocalTableScan + .repartition(1) + val df = data.selectExpr("l2 + r2") + // execute the plan so that the final adaptive plan is available when AQE is on + df.collect() + val found = collectPlanSteps(df.queryExecution.executedPlan).sum + // 1 MyBroadcastExchangeExec + // 1 MyShuffleExchangeExec + // 1 ColumnarToRowExec + // 2 ColumnarProjectExec + // 1 ReplacedRowToColumnarExec + // so 11121 is expected. + assert(found == 11121) // Verify that we get back the expected, wrong, result val result = df.collect() - assert(result(0).getLong(0) == 102L) // Check that broken columnar Add was used. - assert(result(1).getLong(0) == 202L) - assert(result(2).getLong(0) == 302L) + assert(result(0).getLong(0) == 101L) // Check that broken columnar Add was used. + assert(result(1).getLong(0) == 201L) + assert(result(2).getLong(0) == 301L) } } @@ -181,12 +245,12 @@ class SparkSessionExtensionSuite extends SparkFunSuite { .config(COLUMN_BATCH_SIZE.key, 2) .withExtensions { extensions => extensions.injectColumnar(session => - MyColumarRule(PreRuleReplaceAddWithBrokenVersion(), MyPostRule())) } + MyColumnarRule(PreRuleReplaceAddWithBrokenVersion(), MyPostRule())) } .getOrCreate() try { assert(session.sessionState.columnarRules.contains( - MyColumarRule(PreRuleReplaceAddWithBrokenVersion(), MyPostRule()))) + MyColumnarRule(PreRuleReplaceAddWithBrokenVersion(), MyPostRule()))) import session.sqlContext.implicits._ val input = Seq((100L), (200L), (300L)) @@ -214,7 +278,7 @@ class SparkSessionExtensionSuite extends SparkFunSuite { assert(session.sessionState.functionRegistry .lookupFunction(MyExtensions.myFunction._1).isDefined) assert(session.sessionState.columnarRules.contains( - MyColumarRule(PreRuleReplaceAddWithBrokenVersion(), MyPostRule()))) + MyColumnarRule(PreRuleReplaceAddWithBrokenVersion(), MyPostRule()))) } finally { stop(session) } @@ -292,6 +356,20 @@ class SparkSessionExtensionSuite extends SparkFunSuite { stop(session) } } + + test("SPARK-35380: Loading extensions from ServiceLoader") { + val builder = SparkSession.builder().master("local[1]") + + Seq(None, Some(classOf[YourExtensions].getName)).foreach { ext => + ext.foreach(builder.config(SPARK_SESSION_EXTENSIONS.key, _)) + val session = builder.getOrCreate() + try { + assert(session.sql("select get_fake_app_name()").head().getString(0) === "Fake App Name") + } finally { + stop(session) + } + } + } } case class MyRule(spark: SparkSession) extends Rule[LogicalPlan] { @@ -327,9 +405,6 @@ case class MyParser(spark: SparkSession, delegate: ParserInterface) extends Pars override def parseDataType(sqlText: String): DataType = delegate.parseDataType(sqlText) - - override def parseRawDataType(sqlText: String): DataType = - delegate.parseRawDataType(sqlText) } object MyExtensions { @@ -516,11 +591,16 @@ class ColumnarBoundReference(ordinal: Int, dataType: DataType, nullable: Boolean class ColumnarAlias(child: ColumnarExpression, name: String)( override val exprId: ExprId = NamedExpression.newExprId, override val qualifier: Seq[String] = Seq.empty, - override val explicitMetadata: Option[Metadata] = None) - extends Alias(child, name)(exprId, qualifier, explicitMetadata) + override val explicitMetadata: Option[Metadata] = None, + override val nonInheritableMetadataKeys: Seq[String] = Seq.empty) + extends Alias(child, name)(exprId, qualifier, explicitMetadata, nonInheritableMetadataKeys) with ColumnarExpression { override def columnarEval(batch: ColumnarBatch): Any = child.columnarEval(batch) + + override protected def withNewChildInternal(newChild: Expression): ColumnarAlias = + new ColumnarAlias(newChild.asInstanceOf[ColumnarExpression], name)(exprId, qualifier, + explicitMetadata, nonInheritableMetadataKeys) } class ColumnarAttributeReference( @@ -580,14 +660,20 @@ class ColumnarProjectExec(projectList: Seq[NamedExpression], child: SparkPlan) } override def hashCode(): Int = super.hashCode() + + override def withNewChildInternal(newChild: SparkPlan): ColumnarProjectExec = + new ColumnarProjectExec(projectList, newChild) } /** * A version of add that supports columnar processing for longs. This version is broken * on purpose so it adds the numbers plus 1 so that the tests can show that it was replaced. */ -class BrokenColumnarAdd(left: ColumnarExpression, right: ColumnarExpression) - extends Add(left, right) with ColumnarExpression { +class BrokenColumnarAdd( + left: ColumnarExpression, + right: ColumnarExpression, + failOnError: Boolean = false) + extends Add(left, right, failOnError) with ColumnarExpression { override def supportsColumnar(): Boolean = left.supportsColumnar && right.supportsColumnar @@ -641,6 +727,12 @@ class BrokenColumnarAdd(left: ColumnarExpression, right: ColumnarExpression) } ret } + + override def withNewChildrenInternal( + newLeft: Expression, newRight: Expression): BrokenColumnarAdd = + new BrokenColumnarAdd( + left = newLeft.asInstanceOf[ColumnarExpression], + right = newRight.asInstanceOf[ColumnarExpression], failOnError) } class CannotReplaceException(str: String) extends RuntimeException(str) { @@ -651,7 +743,7 @@ case class PreRuleReplaceAddWithBrokenVersion() extends Rule[SparkPlan] { def replaceWithColumnarExpression(exp: Expression): ColumnarExpression = exp match { case a: Alias => new ColumnarAlias(replaceWithColumnarExpression(a.child), - a.name)(a.exprId, a.qualifier, a.explicitMetadata) + a.name)(a.exprId, a.qualifier, a.explicitMetadata, a.nonInheritableMetadataKeys) case att: AttributeReference => new ColumnarAttributeReference(att.name, att.dataType, att.nullable, att.metadata)(att.exprId, att.qualifier) @@ -671,6 +763,16 @@ case class PreRuleReplaceAddWithBrokenVersion() extends Rule[SparkPlan] { def replaceWithColumnarPlan(plan: SparkPlan): SparkPlan = try { plan match { + case e: ShuffleExchangeExec => + // note that this is not actually columnar but demonstrates that exchanges can + // be replaced. + val replaced = e.withNewChildren(e.children.map(replaceWithColumnarPlan)) + MyShuffleExchangeExec(replaced.asInstanceOf[ShuffleExchangeExec]) + case e: BroadcastExchangeExec => + // note that this is not actually columnar but demonstrates that exchanges can + // be replaced. + val replaced = e.withNewChildren(e.children.map(replaceWithColumnarPlan)) + MyBroadcastExchangeExec(replaced.asInstanceOf[BroadcastExchangeExec]) case plan: ProjectExec => new ColumnarProjectExec(plan.projectList.map((exp) => replaceWithColumnarExpression(exp).asInstanceOf[NamedExpression]), @@ -689,6 +791,48 @@ case class PreRuleReplaceAddWithBrokenVersion() extends Rule[SparkPlan] { override def apply(plan: SparkPlan): SparkPlan = replaceWithColumnarPlan(plan) } +/** + * Custom Exchange used in tests to demonstrate that shuffles can be replaced regardless of + * whether AQE is enabled. + */ +case class MyShuffleExchangeExec(delegate: ShuffleExchangeExec) extends ShuffleExchangeLike { + override def numMappers: Int = delegate.numMappers + override def numPartitions: Int = delegate.numPartitions + override def shuffleOrigin: ShuffleOrigin = { + delegate.shuffleOrigin + } + override def mapOutputStatisticsFuture: Future[MapOutputStatistics] = + delegate.mapOutputStatisticsFuture + override def getShuffleRDD(partitionSpecs: Array[ShufflePartitionSpec]): RDD[_] = + delegate.getShuffleRDD(partitionSpecs) + override def runtimeStatistics: Statistics = delegate.runtimeStatistics + override def child: SparkPlan = delegate.child + override protected def doExecute(): RDD[InternalRow] = delegate.execute() + override def outputPartitioning: Partitioning = delegate.outputPartitioning + override protected def withNewChildInternal(newChild: SparkPlan): SparkPlan = + super.legacyWithNewChildren(Seq(newChild)) +} + +/** + * Custom Exchange used in tests to demonstrate that broadcasts can be replaced regardless of + * whether AQE is enabled. + */ +case class MyBroadcastExchangeExec(delegate: BroadcastExchangeExec) extends BroadcastExchangeLike { + override def runId: UUID = delegate.runId + override def relationFuture: java.util.concurrent.Future[Broadcast[Any]] = + delegate.relationFuture + override def completionFuture: Future[Broadcast[Any]] = delegate.completionFuture + override def runtimeStatistics: Statistics = delegate.runtimeStatistics + override def child: SparkPlan = delegate.child + override protected def doPrepare(): Unit = delegate.prepare() + override protected def doExecute(): RDD[InternalRow] = delegate.execute() + override def doExecuteBroadcast[T](): Broadcast[T] = delegate.executeBroadcast() + override def outputPartitioning: Partitioning = delegate.outputPartitioning + + override protected def withNewChildInternal(newChild: SparkPlan): SparkPlan = + super.legacyWithNewChildren(Seq(newChild)) +} + class ReplacedRowToColumnarExec(override val child: SparkPlan) extends RowToColumnarExec(child) { @@ -704,6 +848,9 @@ class ReplacedRowToColumnarExec(override val child: SparkPlan) } override def hashCode(): Int = super.hashCode() + + override def withNewChildInternal(newChild: SparkPlan): ReplacedRowToColumnarExec = + new ReplacedRowToColumnarExec(newChild) } case class MyPostRule() extends Rule[SparkPlan] { @@ -713,7 +860,7 @@ case class MyPostRule() extends Rule[SparkPlan] { } } -case class MyColumarRule(pre: Rule[SparkPlan], post: Rule[SparkPlan]) extends ColumnarRule { +case class MyColumnarRule(pre: Rule[SparkPlan], post: Rule[SparkPlan]) extends ColumnarRule { override def preColumnarTransitions: Rule[SparkPlan] = pre override def postColumnarTransitions: Rule[SparkPlan] = post } @@ -727,7 +874,32 @@ class MyExtensions extends (SparkSessionExtensions => Unit) { e.injectOptimizerRule(MyRule) e.injectParser(MyParser) e.injectFunction(MyExtensions.myFunction) - e.injectColumnar(session => MyColumarRule(PreRuleReplaceAddWithBrokenVersion(), MyPostRule())) + e.injectColumnar(session => MyColumnarRule(PreRuleReplaceAddWithBrokenVersion(), MyPostRule())) + } +} + +object QueryPrepRuleHelper { + val myPrepTag: TreeNodeTag[String] = TreeNodeTag[String]("myPrepTag") + val myPrepTagValue: String = "myPrepTagValue" +} + +// this rule will run during AQE query preparation and will write custom tags to each node +case class MyQueryStagePrepRule() extends Rule[SparkPlan] { + override def apply(plan: SparkPlan): SparkPlan = plan.transformDown { + case plan => + plan.setTagValue(QueryPrepRuleHelper.myPrepTag, QueryPrepRuleHelper.myPrepTagValue) + plan + } +} + +// this rule will run during AQE query stage optimization and will verify custom tags were +// already written during query preparation phase +case class MyNewQueryStageRule() extends Rule[SparkPlan] { + override def apply(plan: SparkPlan): SparkPlan = plan.transformDown { + case plan if !plan.isInstanceOf[AdaptiveSparkPlanExec] => + assert(plan.getTagValue(QueryPrepRuleHelper.myPrepTag).get == + QueryPrepRuleHelper.myPrepTagValue) + plan } } @@ -802,3 +974,16 @@ class MyExtensions2Duplicate extends (SparkSessionExtensions => Unit) { e.injectFunction(MyExtensions2Duplicate.myFunction) } } + +class YourExtensions extends SparkSessionExtensionsProvider { + val getAppName = (FunctionIdentifier("get_fake_app_name"), + new ExpressionInfo( + "zzz.zzz.zzz", + "", + "get_fake_app_name"), + (_: Seq[Expression]) => Literal("Fake App Name")) + + override def apply(v1: SparkSessionExtensions): Unit = { + v1.injectFunction(getAppName) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/StatisticsCollectionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/StatisticsCollectionSuite.scala index 708b98e8fe15a..9f8000a08f7af 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/StatisticsCollectionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/StatisticsCollectionSuite.scala @@ -25,10 +25,11 @@ import java.util.concurrent.TimeUnit import scala.collection.mutable import org.apache.spark.sql.catalyst.TableIdentifier -import org.apache.spark.sql.catalyst.analysis.NoSuchTableException import org.apache.spark.sql.catalyst.catalog.CatalogColumnStat import org.apache.spark.sql.catalyst.plans.logical._ -import org.apache.spark.sql.catalyst.util.{DateTimeTestUtils, DateTimeUtils} +import org.apache.spark.sql.catalyst.util.DateTimeTestUtils +import org.apache.spark.sql.catalyst.util.DateTimeUtils.TimeZoneUTC +import org.apache.spark.sql.functions.timestamp_seconds import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.test.SQLTestData.ArrayData @@ -173,6 +174,15 @@ class StatisticsCollectionSuite extends StatisticsCollectionTestBase with Shared } } + test("SPARK-33812: column stats round trip serialization with splitting histogram property") { + withSQLConf(SQLConf.HIVE_TABLE_PROPERTY_LENGTH_THRESHOLD.key -> "10") { + statsWithHgms.foreach { case (k, v) => + val roundtrip = CatalogColumnStat.fromMap("t", k, v.toMap(k)) + assert(roundtrip == Some(v)) + } + } + } + test("analyze column command - result verification") { // (data.head.productArity - 1) because the last column does not support stats collection. assert(stats.size == data.head.productArity - 1) @@ -247,24 +257,6 @@ class StatisticsCollectionSuite extends StatisticsCollectionTestBase with Shared } } - test("change stats after truncate command") { - val table = "change_stats_truncate_table" - withTable(table) { - spark.range(100).select($"id", $"id" % 5 as "value").write.saveAsTable(table) - // analyze to get initial stats - sql(s"ANALYZE TABLE $table COMPUTE STATISTICS FOR COLUMNS id, value") - val fetched1 = checkTableStats(table, hasSizeInBytes = true, expectedRowCounts = Some(100)) - assert(fetched1.get.sizeInBytes > 0) - assert(fetched1.get.colStats.size == 2) - - // truncate table command - sql(s"TRUNCATE TABLE $table") - val fetched2 = checkTableStats(table, hasSizeInBytes = true, expectedRowCounts = Some(0)) - assert(fetched2.get.sizeInBytes == 0) - assert(fetched2.get.colStats.isEmpty) - } - } - test("change stats after set location command") { val table = "change_stats_set_location_table" val tableLoc = new File(spark.sessionState.catalog.defaultTablePath(TableIdentifier(table))) @@ -375,22 +367,6 @@ class StatisticsCollectionSuite extends StatisticsCollectionTestBase with Shared } } - test("invalidation of tableRelationCache after table truncation") { - val table = "invalidate_catalog_cache_table" - Seq(false, true).foreach { autoUpdate => - withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> autoUpdate.toString) { - withTable(table) { - spark.range(100).write.saveAsTable(table) - sql(s"ANALYZE TABLE $table COMPUTE STATISTICS") - spark.table(table) - sql(s"TRUNCATE TABLE $table") - spark.table(table) - assert(getTableFromCatalogCache(table).stats.sizeInBytes == 0) - } - } - } - } - test("invalidation of tableRelationCache after alter table add partition") { val table = "invalidate_catalog_cache_table" Seq(false, true).foreach { autoUpdate => @@ -467,7 +443,7 @@ class StatisticsCollectionSuite extends StatisticsCollectionTestBase with Shared withTable(table) { TimeZone.setDefault(srcTimeZone) spark.range(start, end) - .select('id.cast(TimestampType).cast(t).as(column)) + .select(timestamp_seconds($"id").cast(t).as(column)) .write.saveAsTable(table) sql(s"ANALYZE TABLE $table COMPUTE STATISTICS FOR COLUMNS $column") @@ -483,11 +459,11 @@ class StatisticsCollectionSuite extends StatisticsCollectionTestBase with Shared DateTimeTestUtils.outstandingZoneIds.foreach { zid => val timeZone = TimeZone.getTimeZone(zid) - checkTimestampStats(DateType, DateTimeUtils.TimeZoneUTC, timeZone) { stats => + checkTimestampStats(DateType, TimeZoneUTC, timeZone) { stats => assert(stats.min.get.asInstanceOf[Int] == TimeUnit.SECONDS.toDays(start)) assert(stats.max.get.asInstanceOf[Int] == TimeUnit.SECONDS.toDays(end - 1)) } - checkTimestampStats(TimestampType, DateTimeUtils.TimeZoneUTC, timeZone) { stats => + checkTimestampStats(TimestampType, TimeZoneUTC, timeZone) { stats => assert(stats.min.get.asInstanceOf[Long] == TimeUnit.SECONDS.toMicros(start)) assert(stats.max.get.asInstanceOf[Long] == TimeUnit.SECONDS.toMicros(end - 1)) } @@ -521,11 +497,11 @@ class StatisticsCollectionSuite extends StatisticsCollectionTestBase with Shared test("analyzes column statistics in cached local temporary view") { withTempView("tempView") { // Analyzes in a temporary view - sql("CREATE TEMPORARY VIEW tempView AS SELECT * FROM range(1, 30)") + sql("CREATE TEMPORARY VIEW tempView AS SELECT 1 id") val errMsg = intercept[AnalysisException] { sql("ANALYZE TABLE tempView COMPUTE STATISTICS FOR COLUMNS id") }.getMessage - assert(errMsg.contains(s"Table or view 'tempView' not found in database 'default'")) + assert(errMsg.contains("Temporary view `tempView` is not cached for analyzing columns")) // Cache the view then analyze it sql("CACHE TABLE tempView") @@ -538,16 +514,18 @@ class StatisticsCollectionSuite extends StatisticsCollectionTestBase with Shared test("analyzes column statistics in cached global temporary view") { withGlobalTempView("gTempView") { val globalTempDB = spark.sharedState.globalTempViewManager.database - val errMsg1 = intercept[NoSuchTableException] { + val errMsg1 = intercept[AnalysisException] { sql(s"ANALYZE TABLE $globalTempDB.gTempView COMPUTE STATISTICS FOR COLUMNS id") }.getMessage - assert(errMsg1.contains(s"Table or view 'gTempView' not found in database '$globalTempDB'")) + assert(errMsg1.contains("Table or view not found: " + + s"$globalTempDB.gTempView")) // Analyzes in a global temporary view - sql("CREATE GLOBAL TEMP VIEW gTempView AS SELECT * FROM range(1, 30)") + sql("CREATE GLOBAL TEMP VIEW gTempView AS SELECT 1 id") val errMsg2 = intercept[AnalysisException] { sql(s"ANALYZE TABLE $globalTempDB.gTempView COMPUTE STATISTICS FOR COLUMNS id") }.getMessage - assert(errMsg2.contains(s"Table or view 'gTempView' not found in database '$globalTempDB'")) + assert(errMsg2.contains( + s"Temporary view `$globalTempDB`.`gTempView` is not cached for analyzing columns")) // Cache the view then analyze it sql(s"CACHE TABLE $globalTempDB.gTempView") @@ -668,4 +646,73 @@ class StatisticsCollectionSuite extends StatisticsCollectionTestBase with Shared } } } + + test("SPARK-34119: Keep necessary stats after PruneFileSourcePartitions") { + withTable("SPARK_34119") { + withSQLConf(SQLConf.CBO_ENABLED.key -> "true") { + sql(s"CREATE TABLE SPARK_34119 using parquet PARTITIONED BY (p) AS " + + "(SELECT id, CAST(id % 5 AS STRING) AS p FROM range(10))") + sql(s"ANALYZE TABLE SPARK_34119 COMPUTE STATISTICS FOR ALL COLUMNS") + + checkOptimizedPlanStats(sql(s"SELECT id FROM SPARK_34119"), + 160L, + Some(10), + Seq(ColumnStat( + distinctCount = Some(10), + min = Some(0), + max = Some(9), + nullCount = Some(0), + avgLen = Some(LongType.defaultSize), + maxLen = Some(LongType.defaultSize)))) + + checkOptimizedPlanStats(sql("SELECT id FROM SPARK_34119 WHERE p = '2'"), + 32L, + Some(2), + Seq(ColumnStat( + distinctCount = Some(2), + min = Some(0), + max = Some(9), + nullCount = Some(0), + avgLen = Some(LongType.defaultSize), + maxLen = Some(LongType.defaultSize)))) + } + } + } + + test("SPARK-33687: analyze all tables in a specific database") { + withTempDatabase { database => + spark.catalog.setCurrentDatabase(database) + withTempDir { dir => + withTable("t1", "t2") { + spark.range(10).write.saveAsTable("t1") + sql(s"CREATE EXTERNAL TABLE t2 USING parquet LOCATION '${dir.toURI}' " + + "AS SELECT * FROM range(20)") + withView("v1", "v2") { + sql("CREATE VIEW v1 AS SELECT 1 c1") + sql("CREATE VIEW v2 AS SELECT 2 c2") + sql("CACHE TABLE v1") + sql("CACHE LAZY TABLE v2") + + sql(s"ANALYZE TABLES IN $database COMPUTE STATISTICS NOSCAN") + checkTableStats("t1", hasSizeInBytes = true, expectedRowCounts = None) + checkTableStats("t2", hasSizeInBytes = true, expectedRowCounts = None) + assert(getCatalogTable("v1").stats.isEmpty) + checkOptimizedPlanStats(spark.table("v1"), 4, Some(1), Seq.empty) + checkOptimizedPlanStats(spark.table("v2"), 1, None, Seq.empty) + + sql("ANALYZE TABLES COMPUTE STATISTICS") + checkTableStats("t1", hasSizeInBytes = true, expectedRowCounts = Some(10)) + checkTableStats("t2", hasSizeInBytes = true, expectedRowCounts = Some(20)) + checkOptimizedPlanStats(spark.table("v1"), 4, Some(1), Seq.empty) + checkOptimizedPlanStats(spark.table("v2"), 4, Some(1), Seq.empty) + } + } + } + } + + val errMsg = intercept[AnalysisException] { + sql(s"ANALYZE TABLES IN db_not_exists COMPUTE STATISTICS") + }.getMessage + assert(errMsg.contains("Database 'db_not_exists' not found")) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/StatisticsCollectionTestBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/StatisticsCollectionTestBase.scala index d3fae6a14915b..6c6ef1a118f48 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/StatisticsCollectionTestBase.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/StatisticsCollectionTestBase.scala @@ -27,7 +27,8 @@ import scala.util.Random import org.apache.spark.sql.catalyst.{QualifiedTableName, TableIdentifier} import org.apache.spark.sql.catalyst.catalog.{CatalogColumnStat, CatalogStatistics, CatalogTable, HiveTableRelation} import org.apache.spark.sql.catalyst.catalog.CatalogTypes.TablePartitionSpec -import org.apache.spark.sql.catalyst.plans.logical.{ColumnStat, Histogram, HistogramBin, HistogramSerializer, LogicalPlan} +import org.apache.spark.sql.catalyst.expressions.AttributeMap +import org.apache.spark.sql.catalyst.plans.logical.{ColumnStat, Histogram, HistogramBin, HistogramSerializer, LogicalPlan, Statistics} import org.apache.spark.sql.catalyst.util.DateTimeTestUtils._ import org.apache.spark.sql.catalyst.util.DateTimeUtils import org.apache.spark.sql.execution.datasources.LogicalRelation @@ -320,6 +321,17 @@ abstract class StatisticsCollectionTestBase extends QueryTest with SQLTestUtils } } + def checkOptimizedPlanStats( + df: DataFrame, + sizeInBytes: BigInt, + rowCount: Option[BigInt], + colStat: Seq[ColumnStat]): Unit = { + val optimizedPlan = df.queryExecution.optimizedPlan + val attributeStats = optimizedPlan.references.zip(colStat) + assert(optimizedPlan.stats === + Statistics(sizeInBytes, rowCount, AttributeMap(attributeStats.toSeq))) + } + // Filter out the checksum file refer to ChecksumFileSystem#isChecksumFile. def getDataSize(file: File): Long = { file.listFiles.filter { f => diff --git a/sql/core/src/test/scala/org/apache/spark/sql/StringFunctionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/StringFunctionsSuite.scala index ec698818a0d85..10f2b3004d708 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/StringFunctionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/StringFunctionsSuite.scala @@ -18,6 +18,7 @@ package org.apache.spark.sql import org.apache.spark.sql.functions._ +import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession @@ -48,6 +49,65 @@ class StringFunctionsSuite extends QueryTest with SharedSparkSession { Row("a||b")) } + test("SPARK-31993: concat_ws in agg function with plenty of string/array types columns") { + withSQLConf(SQLConf.CODEGEN_METHOD_SPLIT_THRESHOLD.key -> "1024", + SQLConf.CODEGEN_FACTORY_MODE.key -> "CODEGEN_ONLY") { + + val (df, genColNames, genColValues) = prepareTestConcatWsColumns() + val groupedCols = Seq($"a") ++ genColNames.map(col) + val concatCols = Seq(collect_list($"b"), collect_list($"c")) ++ genColNames.map(col) + val df2 = df + .groupBy(groupedCols: _*) + .agg(concat_ws(",", concatCols: _*).as("con")) + .select("con") + + val expected = Seq( + Row((Seq("b1", "b2") ++ genColValues).mkString(",")), + Row((Seq("b3", "b4") ++ genColValues).mkString(",")) + ) + + checkAnswer(df2, expected) + } + } + + // This test doesn't fail without SPARK-31993, but still be useful for regression test. + test("SPARK-31993: concat_ws in agg function with plenty of string types columns") { + withSQLConf(SQLConf.CODEGEN_METHOD_SPLIT_THRESHOLD.key -> "1024", + SQLConf.CODEGEN_FACTORY_MODE.key -> "CODEGEN_ONLY") { + + val (df, genColNames, genColValues) = prepareTestConcatWsColumns() + val groupedCols = Seq($"a") ++ genColNames.map(col) + val concatCols = groupedCols + val df2 = df + .groupBy(groupedCols: _*) + .agg(concat_ws(",", concatCols: _*).as("con")) + .select("con") + + val expected = Seq( + Row((Seq("a") ++ genColValues).mkString(",")), + Row((Seq("b") ++ genColValues).mkString(",")) + ) + + checkAnswer(df2, expected) + } + } + + private def prepareTestConcatWsColumns(): (DataFrame, Seq[String], Seq[String]) = { + val genColNames = (1 to 30).map { idx => s"col_$idx" } + val genColValues = (1 to 30).map { _.toString } + val genCols = genColValues.map(lit) + + val df = Seq[(String, String, String)]( + ("a", "b1", null), + ("a", "b2", null), + ("b", "b3", null), + ("b", "b4", null)) + .toDF("a", "b", "c") + .withColumns(genColNames, genCols) + + (df, genColNames, genColValues) + } + test("string elt") { val df = Seq[(String, String, String, Int)](("hello", "world", null, 15)) .toDF("a", "b", "c", "d") @@ -96,6 +156,7 @@ class StringFunctionsSuite extends QueryTest with SharedSparkSession { test("non-matching optional group") { val df = Seq(Tuple1("aaaac")).toDF("s") + checkAnswer( df.select(regexp_extract($"s", "(foo)", 1)), Row("") diff --git a/sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala index 8118eb4f79c17..bb6b402e8156d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala @@ -24,6 +24,7 @@ import org.apache.spark.sql.catalyst.plans.logical.{Join, LogicalPlan, Sort} import org.apache.spark.sql.execution.{ColumnarToRowExec, ExecSubqueryExpression, FileSourceScanExec, InputAdapter, ReusedSubqueryExec, ScalarSubquery, SubqueryExec, WholeStageCodegenExec} import org.apache.spark.sql.execution.adaptive.{AdaptiveSparkPlanHelper, DisableAdaptiveExecution} import org.apache.spark.sql.execution.datasources.FileScanRDD +import org.apache.spark.sql.execution.joins.{BaseJoinExec, BroadcastHashJoinExec, BroadcastNestedLoopJoinExec} import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession @@ -511,6 +512,18 @@ class SubquerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark Row(1, null) :: Row(2, 6.0) :: Row(3, 2.0) :: Row(null, null) :: Row(6, null) :: Nil) } + test("SPARK-34269: correlated subquery with view in aggregate's grouping expression") { + withTable("tr") { + withView("vr") { + r.write.saveAsTable("tr") + sql("create view vr as select * from tr") + checkAnswer( + sql("select a, (select sum(d) from vr where a = c) sum_d from l l1 group by 1, 2"), + Row(1, null) :: Row(2, 6.0) :: Row(3, 2.0) :: Row(null, null) :: Row(6, null) :: Nil) + } + } + } + test("SPARK-18504 extra GROUP BY column in correlated scalar subquery is not permitted") { withTempView("t") { Seq((1, 1), (1, 2)).toDF("c1", "c2").createOrReplaceTempView("t") @@ -541,7 +554,7 @@ class SubquerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark sql("select a, (select sum(b) from l l2 where l2.a < l1.a) sum_b from l l1") } assert(msg1.getMessage.contains( - "Correlated column is not allowed in a non-equality predicate:")) + "Correlated column is not allowed in predicate (l2.a < outer(l1.a))")) } test("disjunctive correlated scalar subquery") { @@ -882,7 +895,7 @@ class SubquerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark withTempView("t") { Seq(1 -> "a").toDF("i", "j").createOrReplaceTempView("t") val e = intercept[AnalysisException](sql("SELECT (SELECT count(*) FROM t WHERE a = 1)")) - assert(e.message.contains("cannot resolve '`a`' given input columns: [t.i, t.j]")) + assert(e.message.contains("cannot resolve 'a' given input columns: [t.i, t.j]")) } } @@ -992,7 +1005,7 @@ class SubquerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark subqueryExpressions ++= (getSubqueryExpressions(s.plan) :+ s) s } - subqueryExpressions + subqueryExpressions.toSeq } private def getNumSorts(plan: LogicalPlan): Int = { @@ -1102,12 +1115,12 @@ class SubquerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark |SELECT c1 FROM t1 |WHERE |c1 IN (( - | SELECT c1 FROM t2 + | SELECT c1 + 1 AS c1 FROM t2 | ORDER BY c1 | ) | UNION | ( - | SELECT c1 FROM t2 + | SELECT c1 + 2 AS c1 FROM t2 | ORDER BY c1 | )) """.stripMargin @@ -1313,7 +1326,7 @@ class SubquerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark // need to execute the query before we can examine fs.inputRDDs() assert(stripAQEPlan(df.queryExecution.executedPlan) match { case WholeStageCodegenExec(ColumnarToRowExec(InputAdapter( - fs @ FileSourceScanExec(_, _, _, partitionFilters, _, _, _)))) => + fs @ FileSourceScanExec(_, _, _, partitionFilters, _, _, _, _, _)))) => partitionFilters.exists(ExecSubqueryExpression.hasSubquery) && fs.inputRDDs().forall( _.asInstanceOf[FileScanRDD].filePartitions.forall( @@ -1646,4 +1659,181 @@ class SubquerySuite extends QueryTest with SharedSparkSession with AdaptiveSpark checkAnswer(df, df2) checkAnswer(df, Nil) } + + test("SPARK-32290: SingleColumn Null Aware Anti Join Optimize") { + Seq(true, false).foreach { enableNAAJ => + Seq(true, false).foreach { enableAQE => + Seq(true, false).foreach { enableCodegen => + withSQLConf( + SQLConf.OPTIMIZE_NULL_AWARE_ANTI_JOIN.key -> enableNAAJ.toString, + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> enableAQE.toString, + SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> enableCodegen.toString) { + + def findJoinExec(df: DataFrame): BaseJoinExec = { + df.queryExecution.sparkPlan.collectFirst { + case j: BaseJoinExec => j + }.get + } + + var df: DataFrame = null + var joinExec: BaseJoinExec = null + + // single column not in subquery -- empty sub-query + df = sql("select * from l where a not in (select c from r where c > 10)") + checkAnswer(df, spark.table("l")) + if (enableNAAJ) { + joinExec = findJoinExec(df) + assert(joinExec.isInstanceOf[BroadcastHashJoinExec]) + assert(joinExec.asInstanceOf[BroadcastHashJoinExec].isNullAwareAntiJoin) + } else { + assert(findJoinExec(df).isInstanceOf[BroadcastNestedLoopJoinExec]) + } + + // single column not in subquery -- sub-query include null + df = sql("select * from l where a not in (select c from r where d < 6.0)") + checkAnswer(df, Seq.empty) + if (enableNAAJ) { + joinExec = findJoinExec(df) + assert(joinExec.isInstanceOf[BroadcastHashJoinExec]) + assert(joinExec.asInstanceOf[BroadcastHashJoinExec].isNullAwareAntiJoin) + } else { + assert(findJoinExec(df).isInstanceOf[BroadcastNestedLoopJoinExec]) + } + + // single column not in subquery -- streamedSide row is null + df = + sql("select * from l where b = 5.0 and a not in(select c from r where c is not null)") + checkAnswer(df, Seq.empty) + if (enableNAAJ) { + joinExec = findJoinExec(df) + assert(joinExec.isInstanceOf[BroadcastHashJoinExec]) + assert(joinExec.asInstanceOf[BroadcastHashJoinExec].isNullAwareAntiJoin) + } else { + assert(findJoinExec(df).isInstanceOf[BroadcastNestedLoopJoinExec]) + } + + // single column not in subquery -- streamedSide row is not null, match found + df = + sql("select * from l where a = 6 and a not in (select c from r where c is not null)") + checkAnswer(df, Seq.empty) + if (enableNAAJ) { + joinExec = findJoinExec(df) + assert(joinExec.isInstanceOf[BroadcastHashJoinExec]) + assert(joinExec.asInstanceOf[BroadcastHashJoinExec].isNullAwareAntiJoin) + } else { + assert(findJoinExec(df).isInstanceOf[BroadcastNestedLoopJoinExec]) + } + + // single column not in subquery -- streamedSide row is not null, match not found + df = + sql("select * from l where a = 1 and a not in (select c from r where c is not null)") + checkAnswer(df, Row(1, 2.0) :: Row(1, 2.0) :: Nil) + if (enableNAAJ) { + joinExec = findJoinExec(df) + assert(joinExec.isInstanceOf[BroadcastHashJoinExec]) + assert(joinExec.asInstanceOf[BroadcastHashJoinExec].isNullAwareAntiJoin) + } else { + assert(findJoinExec(df).isInstanceOf[BroadcastNestedLoopJoinExec]) + } + + // single column not in subquery -- d = b + 10 joinKey found, match ExtractEquiJoinKeys + df = sql("select * from l where a not in (select c from r where d = b + 10)") + checkAnswer(df, spark.table("l")) + joinExec = findJoinExec(df) + assert(joinExec.isInstanceOf[BroadcastHashJoinExec]) + assert(!joinExec.asInstanceOf[BroadcastHashJoinExec].isNullAwareAntiJoin) + + // single column not in subquery -- d = b + 10 and b = 5.0 => d = 15, joinKey not found + // match ExtractSingleColumnNullAwareAntiJoin + df = + sql("select * from l where b = 5.0 and a not in (select c from r where d = b + 10)") + checkAnswer(df, Row(null, 5.0) :: Nil) + if (enableNAAJ) { + joinExec = findJoinExec(df) + assert(joinExec.isInstanceOf[BroadcastHashJoinExec]) + assert(joinExec.asInstanceOf[BroadcastHashJoinExec].isNullAwareAntiJoin) + } else { + assert(findJoinExec(df).isInstanceOf[BroadcastNestedLoopJoinExec]) + } + + // multi column not in subquery + df = sql("select * from l where (a, b) not in (select c, d from r where c > 10)") + checkAnswer(df, spark.table("l")) + assert(findJoinExec(df).isInstanceOf[BroadcastNestedLoopJoinExec]) + } + } + } + } + } + + test("SPARK-28379: non-aggregated zero row scalar subquery") { + checkAnswer( + sql("select a, (select id from range(0) where id = a) from l where a = 3"), + Row(3, null)) + checkAnswer( + sql("select a, (select c from (select * from r limit 0) where c = a) from l where a = 3"), + Row(3, null)) + } + + test("SPARK-28379: non-aggregated single row correlated scalar subquery") { + withTempView("t") { + Seq((0, 1), (1, 2)).toDF("c1", "c2").createOrReplaceTempView("t") + // inline table + checkAnswer( + sql("select c1, c2, (select col1 from values (0, 1) where col2 = c2) from t"), + Row(0, 1, 0) :: Row(1, 2, null) :: Nil) + // one row relation + checkAnswer( + sql("select c1, c2, (select a from (select 1 as a) where a = c2) from t"), + Row(0, 1, 1) :: Row(1, 2, null) :: Nil) + // limit 1 with order by + checkAnswer( + sql( + """ + |select c1, c2, ( + | select b from (select * from l order by a asc nulls last limit 1) where a = c2 + |) from t + |""".stripMargin), + Row(0, 1, 2.0) :: Row(1, 2, null) :: Nil) + // limit 1 with window + checkAnswer( + sql( + """ + |select c1, c2, ( + | select w from ( + | select a, sum(b) over (partition by a) w from l order by a asc nulls last limit 1 + | ) where a = c1 + c2 + |) from t + |""".stripMargin), + Row(0, 1, 4.0) :: Row(1, 2, null) :: Nil) + // set operations + checkAnswer( + sql( + """ + |select c1, c2, ( + | select a from ((select 1 as a) intersect (select 1 as a)) where a = c2 + |) from t + |""".stripMargin), + Row(0, 1, 1) :: Row(1, 2, null) :: Nil) + // join + checkAnswer( + sql( + """ + |select c1, c2, ( + | select a from (select * from (select 1 as a) join (select 1 as b) on a = b) + | where a = c2 + |) from t + |""".stripMargin), + Row(0, 1, 1) :: Row(1, 2, null) :: Nil) + } + } + + test("SPARK-35080: correlated equality predicates contain only outer references") { + withTempView("t") { + Seq((0, 1), (1, 1)).toDF("c1", "c2").createOrReplaceTempView("t") + checkAnswer( + sql("select c1, c2, (select count(*) from l where c1 = c2) from t"), + Row(0, 1, 0) :: Row(1, 1, 8) :: Nil) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala new file mode 100644 index 0000000000000..20cfcecc229ae --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSBase.scala @@ -0,0 +1,116 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import org.apache.spark.sql.catalyst.TableIdentifier +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.SharedSparkSession + +trait TPCDSBase extends SharedSparkSession with TPCDSSchema { + + // The TPCDS queries below are based on v1.4 + private val tpcdsAllQueries: Seq[String] = Seq( + "q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", "q10", "q11", + "q12", "q13", "q14a", "q14b", "q15", "q16", "q17", "q18", "q19", "q20", + "q21", "q22", "q23a", "q23b", "q24a", "q24b", "q25", "q26", "q27", "q28", "q29", "q30", + "q31", "q32", "q33", "q34", "q35", "q36", "q37", "q38", "q39a", "q39b", "q40", + "q41", "q42", "q43", "q44", "q45", "q46", "q47", "q48", "q49", "q50", + "q51", "q52", "q53", "q54", "q55", "q56", "q57", "q58", "q59", "q60", + "q61", "q62", "q63", "q64", "q65", "q66", "q67", "q68", "q69", "q70", + "q71", "q72", "q73", "q74", "q75", "q76", "q77", "q78", "q79", "q80", + "q81", "q82", "q83", "q84", "q85", "q86", "q87", "q88", "q89", "q90", + "q91", "q92", "q93", "q94", "q95", "q96", "q97", "q98", "q99") + + // Since `tpcdsQueriesV2_7_0` has almost the same queries with these ones below, + // we skip them in the TPCDS-related tests. + // NOTE: q6" and "q75" can cause flaky test results, so we must exclude them. + // For more details, see SPARK-35327. + private val excludedTpcdsQueries: Set[String] = Set("q6", "q34", "q64", "q74", "q75", "q78") + + val tpcdsQueries: Seq[String] = tpcdsAllQueries.filterNot(excludedTpcdsQueries.contains) + + // This list only includes TPCDS v2.7 queries that are different from v1.4 ones + val tpcdsQueriesV2_7_0 = Seq( + "q5a", "q6", "q10a", "q11", "q12", "q14", "q14a", "q18a", + "q20", "q22", "q22a", "q24", "q27a", "q34", "q35", "q35a", "q36a", "q47", "q49", + "q51a", "q57", "q64", "q67a", "q70a", "q72", "q74", "q75", "q77a", "q78", + "q80a", "q86a", "q98") + + // These queries are from https://github.com/cloudera/impala-tpcds-kit/tree/master/queries + val modifiedTPCDSQueries = Seq( + "q3", "q7", "q10", "q19", "q27", "q34", "q42", "q43", "q46", "q52", "q53", "q55", "q59", + "q63", "q65", "q68", "q73", "q79", "q89", "q98", "ss_max") + + protected def partitionedByClause(tableName: String): String = { + tablePartitionColumns.get(tableName) match { + case Some(cols) if cols.nonEmpty => s"PARTITIONED BY (${cols.mkString(", ")})" + case _ => "" + } + } + + val tableNames: Iterable[String] = tableColumns.keys + + def createTable( + spark: SparkSession, + tableName: String, + format: String = "parquet", + options: Seq[String] = Nil): Unit = { + spark.sql( + s""" + |CREATE TABLE `$tableName` (${tableColumns(tableName)}) + |USING $format + |${partitionedByClause(tableName)} + |${options.mkString("\n")} + """.stripMargin) + } + + private val originalCBCEnabled = conf.cboEnabled + private val originalPlanStatsEnabled = conf.planStatsEnabled + private val originalJoinReorderEnabled = conf.joinReorderEnabled + + override def beforeAll(): Unit = { + super.beforeAll() + if (injectStats) { + // Sets configurations for enabling the optimization rules that + // exploit data statistics. + conf.setConf(SQLConf.CBO_ENABLED, true) + conf.setConf(SQLConf.PLAN_STATS_ENABLED, true) + conf.setConf(SQLConf.JOIN_REORDER_ENABLED, true) + } + tableNames.foreach { tableName => + createTable(spark, tableName) + if (injectStats) { + // To simulate plan generation on actual TPC-DS data, injects data stats here + spark.sessionState.catalog.alterTableStats( + TableIdentifier(tableName), Some(TPCDSTableStats.sf100TableStats(tableName))) + } + } + } + + override def afterAll(): Unit = { + conf.setConf(SQLConf.CBO_ENABLED, originalCBCEnabled) + conf.setConf(SQLConf.PLAN_STATS_ENABLED, originalPlanStatsEnabled) + conf.setConf(SQLConf.JOIN_REORDER_ENABLED, originalJoinReorderEnabled) + tableNames.foreach { tableName => + spark.sessionState.catalog.dropTable(TableIdentifier(tableName), true, true) + } + super.afterAll() + } + + protected def injectStats: Boolean = false +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQuerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQuerySuite.scala index aacb625d7921f..22e1b838f3f3f 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQuerySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQuerySuite.scala @@ -17,75 +17,42 @@ package org.apache.spark.sql +import org.apache.spark.SparkConf import org.apache.spark.sql.catalyst.util.resourceToString import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.tags.ExtendedSQLTest /** * This test suite ensures all the TPC-DS queries can be successfully analyzed, optimized * and compiled without hitting the max iteration threshold. */ -class TPCDSQuerySuite extends BenchmarkQueryTest with TPCDSSchema { - - override def beforeAll(): Unit = { - super.beforeAll() - for (tableName <- tableNames) { - createTable(spark, tableName) - } - } - - // The TPCDS queries below are based on v1.4 - val tpcdsQueries = Seq( - "q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", "q10", "q11", - "q12", "q13", "q14a", "q14b", "q15", "q16", "q17", "q18", "q19", "q20", - "q21", "q22", "q23a", "q23b", "q24a", "q24b", "q25", "q26", "q27", "q28", "q29", "q30", - "q31", "q32", "q33", "q34", "q35", "q36", "q37", "q38", "q39a", "q39b", "q40", - "q41", "q42", "q43", "q44", "q45", "q46", "q47", "q48", "q49", "q50", - "q51", "q52", "q53", "q54", "q55", "q56", "q57", "q58", "q59", "q60", - "q61", "q62", "q63", "q64", "q65", "q66", "q67", "q68", "q69", "q70", - "q71", "q72", "q73", "q74", "q75", "q76", "q77", "q78", "q79", "q80", - "q81", "q82", "q83", "q84", "q85", "q86", "q87", "q88", "q89", "q90", - "q91", "q92", "q93", "q94", "q95", "q96", "q97", "q98", "q99") +@ExtendedSQLTest +class TPCDSQuerySuite extends BenchmarkQueryTest with TPCDSBase { tpcdsQueries.foreach { name => val queryString = resourceToString(s"tpcds/$name.sql", classLoader = Thread.currentThread().getContextClassLoader) test(name) { - withSQLConf(SQLConf.CROSS_JOINS_ENABLED.key -> "true") { - // check the plans can be properly generated - val plan = sql(queryString).queryExecution.executedPlan - checkGeneratedCode(plan) - } + // check the plans can be properly generated + val plan = sql(queryString).queryExecution.executedPlan + checkGeneratedCode(plan) } } - // This list only includes TPCDS v2.7 queries that are different from v1.4 ones - val tpcdsQueriesV2_7_0 = Seq( - "q5a", "q6", "q10a", "q11", "q12", "q14", "q14a", "q18a", - "q20", "q22", "q22a", "q24", "q27a", "q34", "q35", "q35a", "q36a", "q47", "q49", - "q51a", "q57", "q64", "q67a", "q70a", "q72", "q74", "q75", "q77a", "q78", - "q80a", "q86a", "q98") - tpcdsQueriesV2_7_0.foreach { name => val queryString = resourceToString(s"tpcds-v2.7.0/$name.sql", classLoader = Thread.currentThread().getContextClassLoader) test(s"$name-v2.7") { - withSQLConf(SQLConf.CROSS_JOINS_ENABLED.key -> "true") { - // check the plans can be properly generated - val plan = sql(queryString).queryExecution.executedPlan - checkGeneratedCode(plan) - } + // check the plans can be properly generated + val plan = sql(queryString).queryExecution.executedPlan + checkGeneratedCode(plan) } } - // These queries are from https://github.com/cloudera/impala-tpcds-kit/tree/master/queries - val modifiedTPCDSQueries = Seq( - "q3", "q7", "q10", "q19", "q27", "q34", "q42", "q43", "q46", "q52", "q53", "q55", "q59", - "q63", "q65", "q68", "q73", "q79", "q89", "q98", "ss_max") - // List up the known queries having too large code in a generated function. // A JIRA file for `modified-q3` is as follows; // [SPARK-29128] Split predicate code in OR expressions - val blackListForMethodCodeSizeCheck = Set("modified-q3") + val excludeListForMethodCodeSizeCheck = Set("modified-q3") modifiedTPCDSQueries.foreach { name => val queryString = resourceToString(s"tpcds-modifiedQueries/$name.sql", @@ -94,7 +61,18 @@ class TPCDSQuerySuite extends BenchmarkQueryTest with TPCDSSchema { test(testName) { // check the plans can be properly generated val plan = sql(queryString).queryExecution.executedPlan - checkGeneratedCode(plan, !blackListForMethodCodeSizeCheck.contains(testName)) + checkGeneratedCode(plan, !excludeListForMethodCodeSizeCheck.contains(testName)) } } } + +@ExtendedSQLTest +class TPCDSQueryWithStatsSuite extends TPCDSQuerySuite { + override def injectStats: Boolean = true +} + +@ExtendedSQLTest +class TPCDSQueryANSISuite extends TPCDSQuerySuite { + override protected def sparkConf: SparkConf = + super.sparkConf.set(SQLConf.ANSI_ENABLED, true) +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQueryTestSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQueryTestSuite.scala new file mode 100644 index 0000000000000..952e8968020aa --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSQueryTestSuite.scala @@ -0,0 +1,158 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import java.io.File +import java.nio.file.{Files, Paths} + +import org.apache.spark.{SparkConf, SparkContext} +import org.apache.spark.sql.catalyst.util.{fileToString, resourceToString, stringToFile} +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.TestSparkSession + +/** + * End-to-end tests to check TPCDS query results. + * + * To run this test suite: + * {{{ + * SPARK_TPCDS_DATA= build/sbt "sql/testOnly *TPCDSQueryTestSuite" + * }}} + * + * To run a single test file upon change: + * {{{ + * SPARK_TPCDS_DATA= + * build/sbt "~sql/testOnly *TPCDSQueryTestSuite -- -z q79" + * }}} + * + * To re-generate golden files for this suite, run: + * {{{ + * SPARK_GENERATE_GOLDEN_FILES=1 SPARK_TPCDS_DATA= + * build/sbt "sql/testOnly *TPCDSQueryTestSuite" + * }}} + * + * To re-generate golden file for a single test, run: + * {{{ + * SPARK_GENERATE_GOLDEN_FILES=1 SPARK_TPCDS_DATA= + * build/sbt "sql/testOnly *TPCDSQueryTestSuite -- -z q79" + * }}} + */ +class TPCDSQueryTestSuite extends QueryTest with TPCDSBase with SQLQueryTestHelper { + + private val tpcdsDataPath = sys.env.get("SPARK_TPCDS_DATA") + private val regenerateGoldenFiles = sys.env.get("SPARK_GENERATE_GOLDEN_FILES").exists(_ == "1") + + // To make output results deterministic + protected override def sparkConf: SparkConf = super.sparkConf + .set(SQLConf.SHUFFLE_PARTITIONS.key, "1") + + protected override def createSparkSession: TestSparkSession = { + new TestSparkSession(new SparkContext("local[1]", this.getClass.getSimpleName, sparkConf)) + } + + // We use SF=1 table data here, so we cannot use SF=100 stats + protected override val injectStats: Boolean = false + + if (tpcdsDataPath.nonEmpty) { + val nonExistentTables = tableNames.filterNot { tableName => + Files.exists(Paths.get(s"${tpcdsDataPath.get}/$tableName")) + } + if (nonExistentTables.nonEmpty) { + fail(s"Non-existent TPCDS table paths found in ${tpcdsDataPath.get}: " + + nonExistentTables.mkString(", ")) + } + } + + protected val baseResourcePath = { + // use the same way as `SQLQueryTestSuite` to get the resource path + getWorkspaceFilePath("sql", "core", "src", "test", "resources", "tpcds-query-results") + .toFile.getAbsolutePath + } + + override def createTable( + spark: SparkSession, + tableName: String, + format: String = "parquet", + options: Seq[String] = Nil): Unit = { + spark.sql( + s""" + |CREATE TABLE `$tableName` (${tableColumns(tableName)}) + |USING $format + |LOCATION '${tpcdsDataPath.get}/$tableName' + |${options.mkString("\n")} + """.stripMargin) + } + + private def runQuery(query: String, goldenFile: File): Unit = { + val (schema, output) = handleExceptions(getNormalizedResult(spark, query)) + val queryString = query.trim + val outputString = output.mkString("\n").replaceAll("\\s+$", "") + if (regenerateGoldenFiles) { + val goldenOutput = { + s"-- Automatically generated by ${getClass.getSimpleName}\n\n" + + s"-- !query schema\n" + + schema + "\n" + + s"-- !query output\n" + + outputString + + "\n" + } + val parent = goldenFile.getParentFile + if (!parent.exists()) { + assert(parent.mkdirs(), "Could not create directory: " + parent) + } + stringToFile(goldenFile, goldenOutput) + } + + // Read back the golden file. + val (expectedSchema, expectedOutput) = { + val goldenOutput = fileToString(goldenFile) + val segments = goldenOutput.split("-- !query.*\n") + + // query has 3 segments, plus the header + assert(segments.size == 3, + s"Expected 3 blocks in result file but got ${segments.size}. " + + "Try regenerate the result files.") + + (segments(1).trim, segments(2).replaceAll("\\s+$", "")) + } + + assertResult(expectedSchema, s"Schema did not match\n$queryString") { schema } + assertResult(expectedOutput, s"Result did not match\n$queryString") { outputString } + } + + if (tpcdsDataPath.nonEmpty) { + tpcdsQueries.foreach { name => + val queryString = resourceToString(s"tpcds/$name.sql", + classLoader = Thread.currentThread().getContextClassLoader) + test(name) { + val goldenFile = new File(s"$baseResourcePath/v1_4", s"$name.sql.out") + runQuery(queryString, goldenFile) + } + } + + tpcdsQueriesV2_7_0.foreach { name => + val queryString = resourceToString(s"tpcds-v2.7.0/$name.sql", + classLoader = Thread.currentThread().getContextClassLoader) + test(s"$name-v2.7") { + val goldenFile = new File(s"$baseResourcePath/v2_7", s"$name.sql.out") + runQuery(queryString, goldenFile) + } + } + } else { + ignore("skipped because env `SPARK_TPCDS_DATA` is not set") {} + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSSchema.scala b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSSchema.scala index 43974ad22f2ef..7b2ed8d28274d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSSchema.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSSchema.scala @@ -17,243 +17,539 @@ package org.apache.spark.sql +/** + * Base trait for TPC-DS related tests. + * + * Datatype mapping for TPC-DS and Spark SQL, fully matching schemas defined in `tpcds.sql` of the + * official tpcds toolkit + * see more at: + * http://www.tpc.org/tpc_documents_current_versions/pdf/tpc-ds_v2.9.0.pdf + * + * |---------------|---------------| + * | TPC-DS | Spark SQL | + * |---------------|---------------| + * | Identifier | INT | + * |---------------|---------------| + * | Integer | INT | + * |---------------|---------------| + * | Decimal(d, f) | Decimal(d, f) | + * |---------------|---------------| + * | Char(N) | Char(N) | + * |---------------|---------------| + * | Varchar(N) | Varchar(N) | + * |---------------|---------------| + * | Date | Date | + * |---------------|---------------| + */ trait TPCDSSchema { - private val tableColumns = Map( + protected val tableColumns: Map[String, String] = Map( "store_sales" -> """ - |`ss_sold_date_sk` INT, `ss_sold_time_sk` INT, `ss_item_sk` INT, `ss_customer_sk` INT, - |`ss_cdemo_sk` INT, `ss_hdemo_sk` INT, `ss_addr_sk` INT, `ss_store_sk` INT, - |`ss_promo_sk` INT, `ss_ticket_number` INT, `ss_quantity` INT, - |`ss_wholesale_cost` DECIMAL(7,2), `ss_list_price` DECIMAL(7,2), - |`ss_sales_price` DECIMAL(7,2), `ss_ext_discount_amt` DECIMAL(7,2), - |`ss_ext_sales_price` DECIMAL(7,2), `ss_ext_wholesale_cost` DECIMAL(7,2), - |`ss_ext_list_price` DECIMAL(7,2), `ss_ext_tax` DECIMAL(7,2), - |`ss_coupon_amt` DECIMAL(7,2), `ss_net_paid` DECIMAL(7,2), - |`ss_net_paid_inc_tax` DECIMAL(7,2), `ss_net_profit` DECIMAL(7,2) + |`ss_sold_date_sk` INT, + |`ss_sold_time_sk` INT, + |`ss_item_sk` INT, + |`ss_customer_sk` INT, + |`ss_cdemo_sk` INT, + |`ss_hdemo_sk` INT, + |`ss_addr_sk` INT, + |`ss_store_sk` INT, + |`ss_promo_sk` INT, + |`ss_ticket_number` INT, + |`ss_quantity` INT, + |`ss_wholesale_cost` DECIMAL(7,2), + |`ss_list_price` DECIMAL(7,2), + |`ss_sales_price` DECIMAL(7,2), + |`ss_ext_discount_amt` DECIMAL(7,2), + |`ss_ext_sales_price` DECIMAL(7,2), + |`ss_ext_wholesale_cost` DECIMAL(7,2), + |`ss_ext_list_price` DECIMAL(7,2), + |`ss_ext_tax` DECIMAL(7,2), + |`ss_coupon_amt` DECIMAL(7,2), + |`ss_net_paid` DECIMAL(7,2), + |`ss_net_paid_inc_tax` DECIMAL(7,2), + |`ss_net_profit` DECIMAL(7,2) """.stripMargin, "store_returns" -> """ - |`sr_returned_date_sk` BIGINT, `sr_return_time_sk` BIGINT, `sr_item_sk` BIGINT, - |`sr_customer_sk` BIGINT, `sr_cdemo_sk` BIGINT, `sr_hdemo_sk` BIGINT, `sr_addr_sk` BIGINT, - |`sr_store_sk` BIGINT, `sr_reason_sk` BIGINT, `sr_ticket_number` BIGINT, - |`sr_return_quantity` INT, `sr_return_amt` DECIMAL(7,2), `sr_return_tax` DECIMAL(7,2), - |`sr_return_amt_inc_tax` DECIMAL(7,2), `sr_fee` DECIMAL(7,2), - |`sr_return_ship_cost` DECIMAL(7,2), `sr_refunded_cash` DECIMAL(7,2), - |`sr_reversed_charge` DECIMAL(7,2), `sr_store_credit` DECIMAL(7,2), + |`sr_returned_date_sk` INT, + |`sr_return_time_sk` INT, + |`sr_item_sk` INT, + |`sr_customer_sk` INT, + |`sr_cdemo_sk` INT, + |`sr_hdemo_sk` INT, + |`sr_addr_sk` INT, + |`sr_store_sk` INT, + |`sr_reason_sk` INT, + |`sr_ticket_number` INT, + |`sr_return_quantity` INT, + |`sr_return_amt` DECIMAL(7,2), + |`sr_return_tax` DECIMAL(7,2), + |`sr_return_amt_inc_tax` DECIMAL(7,2), + |`sr_fee` DECIMAL(7,2), + |`sr_return_ship_cost` DECIMAL(7,2), + |`sr_refunded_cash` DECIMAL(7,2), + |`sr_reversed_charge` DECIMAL(7,2), + |`sr_store_credit` DECIMAL(7,2), |`sr_net_loss` DECIMAL(7,2) """.stripMargin, "catalog_sales" -> """ - |`cs_sold_date_sk` INT, `cs_sold_time_sk` INT, `cs_ship_date_sk` INT, - |`cs_bill_customer_sk` INT, `cs_bill_cdemo_sk` INT, `cs_bill_hdemo_sk` INT, - |`cs_bill_addr_sk` INT, `cs_ship_customer_sk` INT, `cs_ship_cdemo_sk` INT, - |`cs_ship_hdemo_sk` INT, `cs_ship_addr_sk` INT, `cs_call_center_sk` INT, - |`cs_catalog_page_sk` INT, `cs_ship_mode_sk` INT, `cs_warehouse_sk` INT, - |`cs_item_sk` INT, `cs_promo_sk` INT, `cs_order_number` INT, `cs_quantity` INT, - |`cs_wholesale_cost` DECIMAL(7,2), `cs_list_price` DECIMAL(7,2), - |`cs_sales_price` DECIMAL(7,2), `cs_ext_discount_amt` DECIMAL(7,2), - |`cs_ext_sales_price` DECIMAL(7,2), `cs_ext_wholesale_cost` DECIMAL(7,2), - |`cs_ext_list_price` DECIMAL(7,2), `cs_ext_tax` DECIMAL(7,2), - |`cs_coupon_amt` DECIMAL(7,2), `cs_ext_ship_cost` DECIMAL(7,2), - |`cs_net_paid` DECIMAL(7,2), `cs_net_paid_inc_tax` DECIMAL(7,2), - |`cs_net_paid_inc_ship` DECIMAL(7,2), `cs_net_paid_inc_ship_tax` DECIMAL(7,2), + |`cs_sold_date_sk` INT, + |`cs_sold_time_sk` INT, + |`cs_ship_date_sk` INT, + |`cs_bill_customer_sk` INT, + |`cs_bill_cdemo_sk` INT, + |`cs_bill_hdemo_sk` INT, + |`cs_bill_addr_sk` INT, + |`cs_ship_customer_sk` INT, + |`cs_ship_cdemo_sk` INT, + |`cs_ship_hdemo_sk` INT, + |`cs_ship_addr_sk` INT, + |`cs_call_center_sk` INT, + |`cs_catalog_page_sk` INT, + |`cs_ship_mode_sk` INT, + |`cs_warehouse_sk` INT, + |`cs_item_sk` INT, + |`cs_promo_sk` INT, + |`cs_order_number` INT, + |`cs_quantity` INT, + |`cs_wholesale_cost` DECIMAL(7,2), + |`cs_list_price` DECIMAL(7,2), + |`cs_sales_price` DECIMAL(7,2), + |`cs_ext_discount_amt` DECIMAL(7,2), + |`cs_ext_sales_price` DECIMAL(7,2), + |`cs_ext_wholesale_cost` DECIMAL(7,2), + |`cs_ext_list_price` DECIMAL(7,2), + |`cs_ext_tax` DECIMAL(7,2), + |`cs_coupon_amt` DECIMAL(7,2), + |`cs_ext_ship_cost` DECIMAL(7,2), + |`cs_net_paid` DECIMAL(7,2), + |`cs_net_paid_inc_tax` DECIMAL(7,2), + |`cs_net_paid_inc_ship` DECIMAL(7,2), + |`cs_net_paid_inc_ship_tax` DECIMAL(7,2), |`cs_net_profit` DECIMAL(7,2) """.stripMargin, "catalog_returns" -> """ - |`cr_returned_date_sk` INT, `cr_returned_time_sk` INT, `cr_item_sk` INT, - |`cr_refunded_customer_sk` INT, `cr_refunded_cdemo_sk` INT, `cr_refunded_hdemo_sk` INT, - |`cr_refunded_addr_sk` INT, `cr_returning_customer_sk` INT, `cr_returning_cdemo_sk` INT, - |`cr_returning_hdemo_sk` INT, `cr_returning_addr_sk` INT, `cr_call_center_sk` INT, - |`cr_catalog_page_sk` INT, `cr_ship_mode_sk` INT, `cr_warehouse_sk` INT, - |`cr_reason_sk` INT,`cr_order_number` INT, `cr_return_quantity` INT, - |`cr_return_amount` DECIMAL(7,2), `cr_return_tax` DECIMAL(7,2), - |`cr_return_amt_inc_tax` DECIMAL(7,2), `cr_fee` DECIMAL(7,2), - |`cr_return_ship_cost` DECIMAL(7,2), `cr_refunded_cash` DECIMAL(7,2), - |`cr_reversed_charge` DECIMAL(7,2), `cr_store_credit` DECIMAL(7,2), + |`cr_returned_date_sk` INT, + |`cr_returned_time_sk` INT, + |`cr_item_sk` INT, + |`cr_refunded_customer_sk` INT, + |`cr_refunded_cdemo_sk` INT, + |`cr_refunded_hdemo_sk` INT, + |`cr_refunded_addr_sk` INT, + |`cr_returning_customer_sk` INT, + |`cr_returning_cdemo_sk` INT, + |`cr_returning_hdemo_sk` INT, + |`cr_returning_addr_sk` INT, + |`cr_call_center_sk` INT, + |`cr_catalog_page_sk` INT, + |`cr_ship_mode_sk` INT, + |`cr_warehouse_sk` INT, + |`cr_reason_sk` INT,`cr_order_number` INT, + |`cr_return_quantity` INT, + |`cr_return_amount` DECIMAL(7,2), + |`cr_return_tax` DECIMAL(7,2), + |`cr_return_amt_inc_tax` DECIMAL(7,2), + |`cr_fee` DECIMAL(7,2), + |`cr_return_ship_cost` DECIMAL(7,2), + |`cr_refunded_cash` DECIMAL(7,2), + |`cr_reversed_charge` DECIMAL(7,2), + |`cr_store_credit` DECIMAL(7,2), |`cr_net_loss` DECIMAL(7,2) """.stripMargin, "web_sales" -> """ - |`ws_sold_date_sk` INT, `ws_sold_time_sk` INT, `ws_ship_date_sk` INT, `ws_item_sk` INT, - |`ws_bill_customer_sk` INT, `ws_bill_cdemo_sk` INT, `ws_bill_hdemo_sk` INT, - |`ws_bill_addr_sk` INT, `ws_ship_customer_sk` INT, `ws_ship_cdemo_sk` INT, - |`ws_ship_hdemo_sk` INT, `ws_ship_addr_sk` INT, `ws_web_page_sk` INT, - |`ws_web_site_sk` INT, `ws_ship_mode_sk` INT, `ws_warehouse_sk` INT, `ws_promo_sk` INT, - |`ws_order_number` INT, `ws_quantity` INT, `ws_wholesale_cost` DECIMAL(7,2), - |`ws_list_price` DECIMAL(7,2), `ws_sales_price` DECIMAL(7,2), - |`ws_ext_discount_amt` DECIMAL(7,2), `ws_ext_sales_price` DECIMAL(7,2), - |`ws_ext_wholesale_cost` DECIMAL(7,2), `ws_ext_list_price` DECIMAL(7,2), - |`ws_ext_tax` DECIMAL(7,2), `ws_coupon_amt` DECIMAL(7,2), `ws_ext_ship_cost` DECIMAL(7,2), - |`ws_net_paid` DECIMAL(7,2), `ws_net_paid_inc_tax` DECIMAL(7,2), - |`ws_net_paid_inc_ship` DECIMAL(7,2), `ws_net_paid_inc_ship_tax` DECIMAL(7,2), + |`ws_sold_date_sk` INT, + |`ws_sold_time_sk` INT, + |`ws_ship_date_sk` INT, + |`ws_item_sk` INT, + |`ws_bill_customer_sk` INT, + |`ws_bill_cdemo_sk` INT, + |`ws_bill_hdemo_sk` INT, + |`ws_bill_addr_sk` INT, + |`ws_ship_customer_sk` INT, + |`ws_ship_cdemo_sk` INT, + |`ws_ship_hdemo_sk` INT, + |`ws_ship_addr_sk` INT, + |`ws_web_page_sk` INT, + |`ws_web_site_sk` INT, + |`ws_ship_mode_sk` INT, + |`ws_warehouse_sk` INT, + |`ws_promo_sk` INT, + |`ws_order_number` INT, + |`ws_quantity` INT, + |`ws_wholesale_cost` DECIMAL(7,2), + |`ws_list_price` DECIMAL(7,2), + |`ws_sales_price` DECIMAL(7,2), + |`ws_ext_discount_amt` DECIMAL(7,2), + |`ws_ext_sales_price` DECIMAL(7,2), + |`ws_ext_wholesale_cost` DECIMAL(7,2), + |`ws_ext_list_price` DECIMAL(7,2), + |`ws_ext_tax` DECIMAL(7,2), + |`ws_coupon_amt` DECIMAL(7,2), + |`ws_ext_ship_cost` DECIMAL(7,2), + |`ws_net_paid` DECIMAL(7,2), + |`ws_net_paid_inc_tax` DECIMAL(7,2), + |`ws_net_paid_inc_ship` DECIMAL(7,2), + |`ws_net_paid_inc_ship_tax` DECIMAL(7,2), |`ws_net_profit` DECIMAL(7,2) """.stripMargin, "web_returns" -> """ - |`wr_returned_date_sk` BIGINT, `wr_returned_time_sk` BIGINT, `wr_item_sk` BIGINT, - |`wr_refunded_customer_sk` BIGINT, `wr_refunded_cdemo_sk` BIGINT, - |`wr_refunded_hdemo_sk` BIGINT, `wr_refunded_addr_sk` BIGINT, - |`wr_returning_customer_sk` BIGINT, `wr_returning_cdemo_sk` BIGINT, - |`wr_returning_hdemo_sk` BIGINT, `wr_returning_addr_sk` BIGINT, `wr_web_page_sk` BIGINT, - |`wr_reason_sk` BIGINT, `wr_order_number` BIGINT, `wr_return_quantity` INT, - |`wr_return_amt` DECIMAL(7,2), `wr_return_tax` DECIMAL(7,2), - |`wr_return_amt_inc_tax` DECIMAL(7,2), `wr_fee` DECIMAL(7,2), - |`wr_return_ship_cost` DECIMAL(7,2), `wr_refunded_cash` DECIMAL(7,2), - |`wr_reversed_charge` DECIMAL(7,2), `wr_account_credit` DECIMAL(7,2), + |`wr_returned_date_sk` INT, + |`wr_returned_time_sk` INT, + |`wr_item_sk` INT, + |`wr_refunded_customer_sk` INT, + |`wr_refunded_cdemo_sk` INT, + |`wr_refunded_hdemo_sk` INT, + |`wr_refunded_addr_sk` INT, + |`wr_returning_customer_sk` INT, + |`wr_returning_cdemo_sk` INT, + |`wr_returning_hdemo_sk` INT, + |`wr_returning_addr_sk` INT, + |`wr_web_page_sk` INT, + |`wr_reason_sk` INT, + |`wr_order_number` INT, + |`wr_return_quantity` INT, + |`wr_return_amt` DECIMAL(7,2), + |`wr_return_tax` DECIMAL(7,2), + |`wr_return_amt_inc_tax` DECIMAL(7,2), + |`wr_fee` DECIMAL(7,2), + |`wr_return_ship_cost` DECIMAL(7,2), + |`wr_refunded_cash` DECIMAL(7,2), + |`wr_reversed_charge` DECIMAL(7,2), + |`wr_account_credit` DECIMAL(7,2), |`wr_net_loss` DECIMAL(7,2) """.stripMargin, "inventory" -> """ - |`inv_date_sk` INT, `inv_item_sk` INT, `inv_warehouse_sk` INT, + |`inv_date_sk` INT, + |`inv_item_sk` INT, + |`inv_warehouse_sk` INT, |`inv_quantity_on_hand` INT """.stripMargin, "store" -> """ - |`s_store_sk` INT, `s_store_id` STRING, `s_rec_start_date` DATE, - |`s_rec_end_date` DATE, `s_closed_date_sk` INT, `s_store_name` STRING, - |`s_number_employees` INT, `s_floor_space` INT, `s_hours` STRING, `s_manager` STRING, - |`s_market_id` INT, `s_geography_class` STRING, `s_market_desc` STRING, - |`s_market_manager` STRING, `s_division_id` INT, `s_division_name` STRING, - |`s_company_id` INT, `s_company_name` STRING, `s_street_number` STRING, - |`s_street_name` STRING, `s_street_type` STRING, `s_suite_number` STRING, `s_city` STRING, - |`s_county` STRING, `s_state` STRING, `s_zip` STRING, `s_country` STRING, - |`s_gmt_offset` DECIMAL(5,2), `s_tax_percentage` DECIMAL(5,2) + |`s_store_sk` INT, + |`s_store_id` CHAR(16), + |`s_rec_start_date` DATE, + |`s_rec_end_date` DATE, + |`s_closed_date_sk` INT, + |`s_store_name` VARCHAR(50), + |`s_number_employees` INT, + |`s_floor_space` INT, + |`s_hours` CHAR(20), + |`s_manager` VARCHAR(40), + |`s_market_id` INT, + |`s_geography_class` VARCHAR(100), + |`s_market_desc` VARCHAR(100), + |`s_market_manager` VARCHAR(40), + |`s_division_id` INT, + |`s_division_name` VARCHAR(50), + |`s_company_id` INT, + |`s_company_name` VARCHAR(50), + |`s_street_number` VARCHAR(10), + |`s_street_name` VARCHAR(60), + |`s_street_type` CHAR(15), + |`s_suite_number` CHAR(10), + |`s_city` VARCHAR(60), + |`s_county` VARCHAR(30), + |`s_state` CHAR(2), + |`s_zip` CHAR(10), + |`s_country` VARCHAR(20), + |`s_gmt_offset` DECIMAL(5,2), + |`s_tax_percentage` DECIMAL(5,2) """.stripMargin, "call_center" -> """ - |`cc_call_center_sk` INT, `cc_call_center_id` STRING, `cc_rec_start_date` DATE, - |`cc_rec_end_date` DATE, `cc_closed_date_sk` INT, `cc_open_date_sk` INT, `cc_name` STRING, - |`cc_class` STRING, `cc_employees` INT, `cc_sq_ft` INT, `cc_hours` STRING, - |`cc_manager` STRING, `cc_mkt_id` INT, `cc_mkt_class` STRING, `cc_mkt_desc` STRING, - |`cc_market_manager` STRING, `cc_division` INT, `cc_division_name` STRING, - |`cc_company` INT, `cc_company_name` STRING, `cc_street_number` STRING, - |`cc_street_name` STRING, `cc_street_type` STRING, `cc_suite_number` STRING, - |`cc_city` STRING, `cc_county` STRING, `cc_state` STRING, `cc_zip` STRING, - |`cc_country` STRING, `cc_gmt_offset` DECIMAL(5,2), `cc_tax_percentage` DECIMAL(5,2) + |`cc_call_center_sk` INT, + |`cc_call_center_id` CHAR(16), + |`cc_rec_start_date` DATE, + |`cc_rec_end_date` DATE, + |`cc_closed_date_sk` INT, + |`cc_open_date_sk` INT, + |`cc_name` VARCHAR(50), + |`cc_class` VARCHAR(50), + |`cc_employees` INT, + |`cc_sq_ft` INT, + |`cc_hours` CHAR(20), + |`cc_manager` VARCHAR(40), + |`cc_mkt_id` INT, + |`cc_mkt_class` CHAR(50), + |`cc_mkt_desc` VARCHAR(100), + |`cc_market_manager` VARCHAR(40), + |`cc_division` INT, + |`cc_division_name` VARCHAR(50), + |`cc_company` INT, + |`cc_company_name` CHAR(50), + |`cc_street_number` CHAR(10), + |`cc_street_name` VARCHAR(60), + |`cc_street_type` CHAR(15), + |`cc_suite_number` CHAR(10), + |`cc_city` VARCHAR(60), + |`cc_county` VARCHAR(30), + |`cc_state` CHAR(2), + |`cc_zip` CHAR(10), + |`cc_country` VARCHAR(20), + |`cc_gmt_offset` DECIMAL(5,2), + |`cc_tax_percentage` DECIMAL(5,2) """.stripMargin, "catalog_page" -> """ - |`cp_catalog_page_sk` INT, `cp_catalog_page_id` STRING, `cp_start_date_sk` INT, - |`cp_end_date_sk` INT, `cp_department` STRING, `cp_catalog_number` INT, - |`cp_catalog_page_number` INT, `cp_description` STRING, `cp_type` STRING + |`cp_catalog_page_sk` INT, + |`cp_catalog_page_id` CHAR(16), + |`cp_start_date_sk` INT, + |`cp_end_date_sk` INT, + |`cp_department` VARCHAR(50), + |`cp_catalog_number` INT, + |`cp_catalog_page_number` INT, + |`cp_description` VARCHAR(100), + |`cp_type` VARCHAR(100) """.stripMargin, "web_site" -> """ - |`web_site_sk` INT, `web_site_id` STRING, `web_rec_start_date` DATE, - |`web_rec_end_date` DATE, `web_name` STRING, `web_open_date_sk` INT, - |`web_close_date_sk` INT, `web_class` STRING, `web_manager` STRING, `web_mkt_id` INT, - |`web_mkt_class` STRING, `web_mkt_desc` STRING, `web_market_manager` STRING, - |`web_company_id` INT, `web_company_name` STRING, `web_street_number` STRING, - |`web_street_name` STRING, `web_street_type` STRING, `web_suite_number` STRING, - |`web_city` STRING, `web_county` STRING, `web_state` STRING, `web_zip` STRING, - |`web_country` STRING, `web_gmt_offset` DECIMAL(5,2), `web_tax_percentage` DECIMAL(5,2) + |`web_site_sk` INT, + |`web_site_id` CHAR(16), + |`web_rec_start_date` DATE, + |`web_rec_end_date` DATE, + |`web_name` VARCHAR(50), + |`web_open_date_sk` INT, + |`web_close_date_sk` INT, + |`web_class` VARCHAR(50), + |`web_manager` VARCHAR(40), + |`web_mkt_id` INT, + |`web_mkt_class` VARCHAR(50), + |`web_mkt_desc` VARCHAR(100), + |`web_market_manager` VARCHAR(40), + |`web_company_id` INT, + |`web_company_name` CHAR(50), + |`web_street_number` CHAR(10), + |`web_street_name` VARCHAR(60), + |`web_street_type` CHAR(15), + |`web_suite_number` CHAR(10), + |`web_city` VARCHAR(60), + |`web_county` VARCHAR(30), + |`web_state` CHAR(2), + |`web_zip` CHAR(10), + |`web_country` VARCHAR(20), + |`web_gmt_offset` DECIMAL(5,2), + |`web_tax_percentage` DECIMAL(5,2) """.stripMargin, "web_page" -> """ - |`wp_web_page_sk` INT, `wp_web_page_id` STRING, - |`wp_rec_start_date` DATE, `wp_rec_end_date` DATE, `wp_creation_date_sk` INT, - |`wp_access_date_sk` INT, `wp_autogen_flag` STRING, `wp_customer_sk` INT, - |`wp_url` STRING, `wp_type` STRING, `wp_char_count` INT, `wp_link_count` INT, - |`wp_image_count` INT, `wp_max_ad_count` INT + |`wp_web_page_sk` INT, + |`wp_web_page_id` CHAR(16), + |`wp_rec_start_date` DATE, + |`wp_rec_end_date` DATE, + |`wp_creation_date_sk` INT, + |`wp_access_date_sk` INT, + |`wp_autogen_flag` CHAR(1), + |`wp_customer_sk` INT, + |`wp_url` VARCHAR(100), + |`wp_type` CHAR(50), + |`wp_char_count` INT, + |`wp_link_count` INT, + |`wp_image_count` INT, + |`wp_max_ad_count` INT """.stripMargin, "warehouse" -> """ - |`w_warehouse_sk` INT, `w_warehouse_id` STRING, `w_warehouse_name` STRING, - |`w_warehouse_sq_ft` INT, `w_street_number` STRING, `w_street_name` STRING, - |`w_street_type` STRING, `w_suite_number` STRING, `w_city` STRING, `w_county` STRING, - |`w_state` STRING, `w_zip` STRING, `w_country` STRING, `w_gmt_offset` DECIMAL(5,2) + |`w_warehouse_sk` INT, + |`w_warehouse_id` CHAR(16), + |`w_warehouse_name` VARCHAR(20), + |`w_warehouse_sq_ft` INT, + |`w_street_number` CHAR(10), + |`w_street_name` VARCHAR(20), + |`w_street_type` CHAR(15), + |`w_suite_number` CHAR(10), + |`w_city` VARCHAR(60), + |`w_county` VARCHAR(30), + |`w_state` CHAR(2), + |`w_zip` CHAR(10), + |`w_country` VARCHAR(20), + |`w_gmt_offset` DECIMAL(5,2) """.stripMargin, "customer" -> """ - |`c_customer_sk` INT, `c_customer_id` STRING, `c_current_cdemo_sk` INT, - |`c_current_hdemo_sk` INT, `c_current_addr_sk` INT, `c_first_shipto_date_sk` INT, - |`c_first_sales_date_sk` INT, `c_salutation` STRING, `c_first_name` STRING, - |`c_last_name` STRING, `c_preferred_cust_flag` STRING, `c_birth_day` INT, - |`c_birth_month` INT, `c_birth_year` INT, `c_birth_country` STRING, `c_login` STRING, - |`c_email_address` STRING, `c_last_review_date` INT + |`c_customer_sk` INT, + |`c_customer_id` CHAR(16), + |`c_current_cdemo_sk` INT, + |`c_current_hdemo_sk` INT, + |`c_current_addr_sk` INT, + |`c_first_shipto_date_sk` INT, + |`c_first_sales_date_sk` INT, + |`c_salutation` CHAR(10), + |`c_first_name` CHAR(20), + |`c_last_name` CHAR(30), + |`c_preferred_cust_flag` CHAR(1), + |`c_birth_day` INT, + |`c_birth_month` INT, + |`c_birth_year` INT, + |`c_birth_country` VARCHAR(20), + |`c_login` CHAR(13), + |`c_email_address` CHAR(50), + |`c_last_review_date` INT """.stripMargin, "customer_address" -> """ - |`ca_address_sk` INT, `ca_address_id` STRING, `ca_street_number` STRING, - |`ca_street_name` STRING, `ca_street_type` STRING, `ca_suite_number` STRING, - |`ca_city` STRING, `ca_county` STRING, `ca_state` STRING, `ca_zip` STRING, - |`ca_country` STRING, `ca_gmt_offset` DECIMAL(5,2), `ca_location_type` STRING + |`ca_address_sk` INT, + |`ca_address_id` CHAR(16), + |`ca_street_number` CHAR(10), + |`ca_street_name` VARCHAR(60), + |`ca_street_type` CHAR(15), + |`ca_suite_number` CHAR(10), + |`ca_city` VARCHAR(60), + |`ca_county` VARCHAR(30), + |`ca_state` CHAR(2), + |`ca_zip` CHAR(10), + |`ca_country` VARCHAR(20), + |`ca_gmt_offset` DECIMAL(5,2), + |`ca_location_type` CHAR(20) """.stripMargin, "customer_demographics" -> """ - |`cd_demo_sk` INT, `cd_gender` STRING, `cd_marital_status` STRING, - |`cd_education_status` STRING, `cd_purchase_estimate` INT, `cd_credit_rating` STRING, - |`cd_dep_count` INT, `cd_dep_employed_count` INT, `cd_dep_college_count` INT + |`cd_demo_sk` INT, + |`cd_gender` CHAR(1), + |`cd_marital_status` CHAR(1), + |`cd_education_status` CHAR(20), + |`cd_purchase_estimate` INT, + |`cd_credit_rating` CHAR(10), + |`cd_dep_count` INT, + |`cd_dep_employed_count` INT, + |`cd_dep_college_count` INT """.stripMargin, "date_dim" -> """ - |`d_date_sk` INT, `d_date_id` STRING, `d_date` DATE, - |`d_month_seq` INT, `d_week_seq` INT, `d_quarter_seq` INT, `d_year` INT, `d_dow` INT, - |`d_moy` INT, `d_dom` INT, `d_qoy` INT, `d_fy_year` INT, `d_fy_quarter_seq` INT, - |`d_fy_week_seq` INT, `d_day_name` STRING, `d_quarter_name` STRING, `d_holiday` STRING, - |`d_weekend` STRING, `d_following_holiday` STRING, `d_first_dom` INT, `d_last_dom` INT, - |`d_same_day_ly` INT, `d_same_day_lq` INT, `d_current_day` STRING, - |`d_current_week` STRING, `d_current_month` STRING, `d_current_quarter` STRING, - |`d_current_year` STRING + |`d_date_sk` INT, + |`d_date_id` CHAR(16), + |`d_date` DATE, + |`d_month_seq` INT, + |`d_week_seq` INT, + |`d_quarter_seq` INT, + |`d_year` INT, + |`d_dow` INT, + |`d_moy` INT, + |`d_dom` INT, + |`d_qoy` INT, + |`d_fy_year` INT, + |`d_fy_quarter_seq` INT, + |`d_fy_week_seq` INT, + |`d_day_name` CHAR(9), + |`d_quarter_name` CHAR(6), + |`d_holiday` CHAR(1), + |`d_weekend` CHAR(1), + |`d_following_holiday` CHAR(1), + |`d_first_dom` INT, + |`d_last_dom` INT, + |`d_same_day_ly` INT, + |`d_same_day_lq` INT, + |`d_current_day` CHAR(1), + |`d_current_week` CHAR(1), + |`d_current_month` CHAR(1), + |`d_current_quarter` CHAR(1), + |`d_current_year` CHAR(1) """.stripMargin, "household_demographics" -> """ - |`hd_demo_sk` INT, `hd_income_band_sk` INT, `hd_buy_potential` STRING, `hd_dep_count` INT, + |`hd_demo_sk` INT, + |`hd_income_band_sk` INT, + |`hd_buy_potential` CHAR(15), + |`hd_dep_count` INT, |`hd_vehicle_count` INT """.stripMargin, "item" -> """ - |`i_item_sk` INT, `i_item_id` STRING, `i_rec_start_date` DATE, - |`i_rec_end_date` DATE, `i_item_desc` STRING, `i_current_price` DECIMAL(7,2), - |`i_wholesale_cost` DECIMAL(7,2), `i_brand_id` INT, `i_brand` STRING, `i_class_id` INT, - |`i_class` STRING, `i_category_id` INT, `i_category` STRING, `i_manufact_id` INT, - |`i_manufact` STRING, `i_size` STRING, `i_formulation` STRING, `i_color` STRING, - |`i_units` STRING, `i_container` STRING, `i_manager_id` INT, `i_product_name` STRING + |`i_item_sk` INT, + |`i_item_id` CHAR(16), + |`i_rec_start_date` DATE, + |`i_rec_end_date` DATE, + |`i_item_desc` VARCHAR(200), + |`i_current_price` DECIMAL(7,2), + |`i_wholesale_cost` DECIMAL(7,2), + |`i_brand_id` INT, + |`i_brand` CHAR(50), + |`i_class_id` INT, + |`i_class` CHAR(50), + |`i_category_id` INT, + |`i_category` CHAR(50), + |`i_manufact_id` INT, + |`i_manufact` CHAR(50), + |`i_size` CHAR(20), + |`i_formulation` CHAR(20), + |`i_color` CHAR(20), + |`i_units` CHAR(10), + |`i_container` CHAR(10), + |`i_manager_id` INT, + |`i_product_name` CHAR(50) """.stripMargin, "income_band" -> """ - |`ib_income_band_sk` INT, `ib_lower_bound` INT, `ib_upper_bound` INT + |`ib_income_band_sk` INT, + |`ib_lower_bound` INT, + |`ib_upper_bound` INT """.stripMargin, "promotion" -> """ - |`p_promo_sk` INT, `p_promo_id` STRING, `p_start_date_sk` INT, `p_end_date_sk` INT, - |`p_item_sk` INT, `p_cost` DECIMAL(15,2), `p_response_target` INT, `p_promo_name` STRING, - |`p_channel_dmail` STRING, `p_channel_email` STRING, `p_channel_catalog` STRING, - |`p_channel_tv` STRING, `p_channel_radio` STRING, `p_channel_press` STRING, - |`p_channel_event` STRING, `p_channel_demo` STRING, `p_channel_details` STRING, - |`p_purpose` STRING, `p_discount_active` STRING + |`p_promo_sk` INT, + |`p_promo_id` CHAR(16), + |`p_start_date_sk` INT, + |`p_end_date_sk` INT, + |`p_item_sk` INT, + |`p_cost` DECIMAL(15,2), + |`p_response_target` INT, + |`p_promo_name` CHAR(50), + |`p_channel_dmail` CHAR(1), + |`p_channel_email` CHAR(1), + |`p_channel_catalog` CHAR(1), + |`p_channel_tv` CHAR(1), + |`p_channel_radio` CHAR(1), + |`p_channel_press` CHAR(1), + |`p_channel_event` CHAR(1), + |`p_channel_demo` CHAR(1), + |`p_channel_details` VARCHAR(100), + |`p_purpose` CHAR(15), + |`p_discount_active` CHAR(1) """.stripMargin, "reason" -> """ - |`r_reason_sk` INT, `r_reason_id` STRING, `r_reason_desc` STRING + |`r_reason_sk` INT, + |`r_reason_id` CHAR(16), + |`r_reason_desc` CHAR(100) """.stripMargin, "ship_mode" -> """ - |`sm_ship_mode_sk` INT, `sm_ship_mode_id` STRING, `sm_type` STRING, `sm_code` STRING, - |`sm_carrier` STRING, `sm_contract` STRING + |`sm_ship_mode_sk` INT, + |`sm_ship_mode_id` CHAR(16), + |`sm_type` CHAR(30), + |`sm_code` CHAR(10), + |`sm_carrier` CHAR(20), + |`sm_contract` CHAR(20) """.stripMargin, "time_dim" -> """ - |`t_time_sk` INT, `t_time_id` STRING, `t_time` INT, `t_hour` INT, `t_minute` INT, - |`t_second` INT, `t_am_pm` STRING, `t_shift` STRING, `t_sub_shift` STRING, - |`t_meal_time` STRING + |`t_time_sk` INT, + |`t_time_id` CHAR(16), + |`t_time` INT, + |`t_hour` INT, + |`t_minute` INT, + |`t_second` INT, + |`t_am_pm` CHAR(2), + |`t_shift` CHAR(20), + |`t_sub_shift` CHAR(20), + |`t_meal_time` CHAR(20) """.stripMargin ) - val tableNames: Iterable[String] = tableColumns.keys - - def createTable( - spark: SparkSession, - tableName: String, - format: String = "parquet", - options: Seq[String] = Nil): Unit = { - spark.sql( - s""" - |CREATE TABLE `$tableName` (${tableColumns(tableName)}) - |USING $format - |${options.mkString("\n")} - """.stripMargin) - } + // The partition column is consistent with the databricks/spark-sql-perf project. + protected val tablePartitionColumns = Map( + "catalog_sales" -> Seq("`cs_sold_date_sk`"), + "catalog_returns" -> Seq("`cr_returned_date_sk`"), + "inventory" -> Seq("`inv_date_sk`"), + "store_sales" -> Seq("`ss_sold_date_sk`"), + "store_returns" -> Seq("`sr_returned_date_sk`"), + "web_sales" -> Seq("`ws_sold_date_sk`"), + "web_returns" -> Seq("`wr_returned_date_sk`") + ) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/TPCDSTableStats.scala b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSTableStats.scala new file mode 100644 index 0000000000000..ee9cf7b67225f --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/TPCDSTableStats.scala @@ -0,0 +1,503 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import org.apache.spark.sql.catalyst.catalog.{CatalogColumnStat, CatalogStatistics} + +object TPCDSTableStats { + + // These data statistics are extracted from generated TPCDS data with SF=100 + + // scalastyle:off line.size.limit + val sf100TableStats = Map( + "customer" -> CatalogStatistics(500000000L, Some(2000000L), Map( + "c_birth_country" -> CatalogColumnStat(Some(196L), None, None, Some(69626), Some(9), Some(20), None, CatalogColumnStat.VERSION), + "c_current_cdemo_sk" -> CatalogColumnStat(Some(1184426L), Some("1"), Some("1920798"), Some(69943), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "c_customer_id" -> CatalogColumnStat(Some(2000000L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "c_birth_day" -> CatalogColumnStat(Some(32L), Some("1"), Some("31"), Some(70166), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "c_last_name" -> CatalogColumnStat(Some(5250L), None, None, Some(70098), Some(7), Some(13), None, CatalogColumnStat.VERSION), + "c_login" -> CatalogColumnStat(Some(0L), None, None, Some(2000000), Some(20), Some(20), None, CatalogColumnStat.VERSION), + "c_first_shipto_date_sk" -> CatalogColumnStat(Some(3755L), Some("2449028"), Some("2452678"), Some(70080), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "c_first_name" -> CatalogColumnStat(Some(5146L), None, None, Some(69769), Some(6), Some(11), None, CatalogColumnStat.VERSION), + "c_birth_month" -> CatalogColumnStat(Some(12L), Some("1"), Some("12"), Some(69896), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "c_email_address" -> CatalogColumnStat(Some(1929800L), None, None, Some(70200), Some(28), Some(47), None, CatalogColumnStat.VERSION), + "c_current_addr_sk" -> CatalogColumnStat(Some(824389L), Some("1"), Some("1000000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "c_salutation" -> CatalogColumnStat(Some(6L), None, None, Some(69840), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "c_current_hdemo_sk" -> CatalogColumnStat(Some(7083L), Some("1"), Some("7200"), Some(69657), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "c_birth_year" -> CatalogColumnStat(Some(67L), Some("1924"), Some("1992"), Some(69986), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "c_customer_sk" -> CatalogColumnStat(Some(1903054L), Some("1"), Some("2000000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "c_last_review_date" -> CatalogColumnStat(Some(357L), None, None, Some(70102), Some(7), Some(7), None, CatalogColumnStat.VERSION), + "c_preferred_cust_flag" -> CatalogColumnStat(Some(2L), None, None, Some(69778), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "c_first_sales_date_sk" -> CatalogColumnStat(Some(3758L), Some("2448998"), Some("2452648"), Some(69950), Some(4), Some(4), None, CatalogColumnStat.VERSION) + )), + "store_sales" -> CatalogStatistics(42623559552L, Some(287997024L), Map( + "ss_ext_sales_price" -> CatalogColumnStat(Some(712602L), Some("0.00"), Some("19878.00"), Some(12955462), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ss_item_sk" -> CatalogColumnStat(Some(206807L), Some("1"), Some("204000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ss_coupon_amt" -> CatalogColumnStat(Some(925847L), Some("0.00"), Some("19225.00"), Some(12958053), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ss_store_sk" -> CatalogColumnStat(Some(199L), Some("1"), Some("400"), Some(12950651), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ss_quantity" -> CatalogColumnStat(Some(99L), Some("1"), Some("100"), Some(12953654), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ss_ext_discount_amt" -> CatalogColumnStat(Some(925847L), Some("0.00"), Some("19225.00"), Some(12958053), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ss_hdemo_sk" -> CatalogColumnStat(Some(7083L), Some("1"), Some("7200"), Some(12957139), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ss_ext_tax" -> CatalogColumnStat(Some(135620L), Some("0.00"), Some("1762.38"), Some(12957705), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ss_sold_time_sk" -> CatalogColumnStat(Some(47827L), Some("28800"), Some("75599"), Some(12953300), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ss_promo_sk" -> CatalogColumnStat(Some(1026L), Some("1"), Some("1000"), Some(12954088), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ss_net_paid_inc_tax" -> CatalogColumnStat(Some(1404501L), Some("0.00"), Some("21344.38"), Some(12958941), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ss_wholesale_cost" -> CatalogColumnStat(Some(9503L), Some("1.00"), Some("100.00"), Some(12958327), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ss_cdemo_sk" -> CatalogColumnStat(Some(1847065L), Some("1"), Some("1920800"), Some(12955252), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ss_sold_date_sk" -> CatalogColumnStat(Some(1781L), Some("2450816"), Some("2452642"), Some(12955025), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ss_list_price" -> CatalogColumnStat(Some(19079L), Some("1.00"), Some("200.00"), Some(12952108), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ss_ext_list_price" -> CatalogColumnStat(Some(752016L), Some("1.00"), Some("20000.00"), Some(12955040), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ss_net_profit" -> CatalogColumnStat(Some(1388760L), Some("-10000.00"), Some("9889.00"), Some(12955156), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ss_ticket_number" -> CatalogColumnStat(Some(24596280L), Some("1"), Some("24000000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ss_net_paid" -> CatalogColumnStat(Some(1058635L), Some("0.00"), Some("19878.00"), Some(12954554), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ss_ext_wholesale_cost" -> CatalogColumnStat(Some(382964L), Some("1.00"), Some("10000.00"), Some(12960060), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ss_customer_sk" -> CatalogColumnStat(Some(1903054L), Some("1"), Some("2000000"), Some(12952082), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ss_addr_sk" -> CatalogColumnStat(Some(943039L), Some("1"), Some("1000000"), Some(12956686), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ss_sales_price" -> CatalogColumnStat(Some(19261L), Some("0.00"), Some("200.00"), Some(12958587), Some(8), Some(8), None, CatalogColumnStat.VERSION) + )), + "web_sales" -> CatalogStatistics(14688252348L, Some(72001237L), Map( + "ws_sold_time_sk" -> CatalogColumnStat(Some(83505L), Some("0"), Some("86399"), Some(17931), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_ext_wholesale_cost" -> CatalogColumnStat(Some(382964L), Some("1.00"), Some("10000.00"), Some(17814), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_bill_cdemo_sk" -> CatalogColumnStat(Some(1707373L), Some("1"), Some("1920800"), Some(17833), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_net_paid_inc_ship" -> CatalogColumnStat(Some(1629659L), Some("0.00"), Some("43468.92"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_sales_price" -> CatalogColumnStat(Some(29143L), Some("0.00"), Some("300.00"), Some(18005), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_ship_mode_sk" -> CatalogColumnStat(Some(20L), Some("1"), Some("20"), Some(17823), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_ship_hdemo_sk" -> CatalogColumnStat(Some(7083L), Some("1"), Some("7200"), Some(17833), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_order_number" -> CatalogColumnStat(Some(6073146L), Some("1"), Some("6000000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_sold_date_sk" -> CatalogColumnStat(Some(1781L), Some("2450816"), Some("2452642"), Some(17922), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_web_site_sk" -> CatalogColumnStat(Some(25L), Some("1"), Some("24"), Some(18030), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_bill_customer_sk" -> CatalogColumnStat(Some(1800267L), Some("1"), Some("2000000"), Some(17882), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_coupon_amt" -> CatalogColumnStat(Some(863374L), Some("0.00"), Some("27591.16"), Some(18027), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_ship_addr_sk" -> CatalogColumnStat(Some(943039L), Some("1"), Some("1000000"), Some(17931), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_net_paid_inc_tax" -> CatalogColumnStat(Some(1695042L), Some("0.00"), Some("32492.90"), Some(18102), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_quantity" -> CatalogColumnStat(Some(99L), Some("1"), Some("100"), Some(18014), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_bill_addr_sk" -> CatalogColumnStat(Some(940457L), Some("1"), Some("1000000"), Some(17801), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_net_paid" -> CatalogColumnStat(Some(1247989L), Some("0.00"), Some("29810.00"), Some(17968), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_ext_discount_amt" -> CatalogColumnStat(Some(934889L), Some("0.00"), Some("29982.00"), Some(17890), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_item_sk" -> CatalogColumnStat(Some(206807L), Some("1"), Some("204000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_ext_tax" -> CatalogColumnStat(Some(168876L), Some("0.00"), Some("2682.90"), Some(17800), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_wholesale_cost" -> CatalogColumnStat(Some(9503L), Some("1.00"), Some("100.00"), Some(17850), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_ship_customer_sk" -> CatalogColumnStat(Some(1811873L), Some("1"), Some("2000000"), Some(17886), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_net_paid_inc_ship_tax" -> CatalogColumnStat(Some(2186741L), Some("0.00"), Some("44479.52"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_web_page_sk" -> CatalogColumnStat(Some(2108L), Some("1"), Some("2040"), Some(17920), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_ext_sales_price" -> CatalogColumnStat(Some(908147L), Some("0.00"), Some("29810.00"), Some(17843), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_ext_ship_cost" -> CatalogColumnStat(Some(482711L), Some("0.00"), Some("14927.00"), Some(17923), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_bill_hdemo_sk" -> CatalogColumnStat(Some(7083L), Some("1"), Some("7200"), Some(18011), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_ship_date_sk" -> CatalogColumnStat(Some(1898L), Some("2450817"), Some("2452762"), Some(17883), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_ext_list_price" -> CatalogColumnStat(Some(1071558L), Some("1.02"), Some("29997.00"), Some(18001), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_ship_cdemo_sk" -> CatalogColumnStat(Some(1755797L), Some("1"), Some("1920800"), Some(17903), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_warehouse_sk" -> CatalogColumnStat(Some(15L), Some("1"), Some("15"), Some(17812), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_list_price" -> CatalogColumnStat(Some(29447L), Some("1.00"), Some("300.00"), Some(17824), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ws_promo_sk" -> CatalogColumnStat(Some(1026L), Some("1"), Some("1000"), Some(18116), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ws_net_profit" -> CatalogColumnStat(Some(1482074L), Some("-9997.00"), Some("19840.00"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION) + )), + "date_dim" -> CatalogStatistics(19284936L, Some(73049L), Map( + "d_dom" -> CatalogColumnStat(Some(32L), Some("1"), Some("31"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_current_quarter" -> CatalogColumnStat(Some(2L), None, None, Some(0), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "d_fy_week_seq" -> CatalogColumnStat(Some(10010L), Some("1"), Some("10436"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_holiday" -> CatalogColumnStat(Some(2L), None, None, Some(0), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "d_current_day" -> CatalogColumnStat(Some(1L), None, None, Some(0), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "d_week_seq" -> CatalogColumnStat(Some(10010L), Some("1"), Some("10436"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_current_month" -> CatalogColumnStat(Some(2L), None, None, Some(0), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "d_moy" -> CatalogColumnStat(Some(12L), Some("1"), Some("12"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_date" -> CatalogColumnStat(Some(73049L), None, None, Some(0), Some(10), Some(10), None, CatalogColumnStat.VERSION), + "d_same_day_lq" -> CatalogColumnStat(Some(73049L), Some("2414930"), Some("2487978"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_weekend" -> CatalogColumnStat(Some(2L), None, None, Some(0), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "d_dow" -> CatalogColumnStat(Some(7L), Some("0"), Some("6"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_year" -> CatalogColumnStat(Some(202L), Some("1900"), Some("2100"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_current_week" -> CatalogColumnStat(Some(1L), None, None, Some(0), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "d_quarter_name" -> CatalogColumnStat(Some(774L), None, None, Some(0), Some(6), Some(6), None, CatalogColumnStat.VERSION), + "d_month_seq" -> CatalogColumnStat(Some(2431L), Some("0"), Some("2400"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_fy_year" -> CatalogColumnStat(Some(202L), Some("1900"), Some("2100"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_following_holiday" -> CatalogColumnStat(Some(2L), None, None, Some(0), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "d_same_day_ly" -> CatalogColumnStat(Some(73049L), Some("2414657"), Some("2487705"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_day_name" -> CatalogColumnStat(Some(7L), None, None, Some(0), Some(8), Some(9), None, CatalogColumnStat.VERSION), + "d_qoy" -> CatalogColumnStat(Some(4L), Some("1"), Some("4"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_date_sk" -> CatalogColumnStat(Some(73049L), Some("2415022"), Some("2488070"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_fy_quarter_seq" -> CatalogColumnStat(Some(787L), Some("1"), Some("801"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_current_year" -> CatalogColumnStat(Some(2L), None, None, Some(0), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "d_date_id" -> CatalogColumnStat(Some(73049L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "d_quarter_seq" -> CatalogColumnStat(Some(787L), Some("1"), Some("801"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_last_dom" -> CatalogColumnStat(Some(2386L), Some("2415020"), Some("2488372"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "d_first_dom" -> CatalogColumnStat(Some(2329L), Some("2415021"), Some("2488070"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION) + )), + "household_demographics" -> CatalogStatistics(316800L, Some(7200L), Map( + "hd_buy_potential" -> CatalogColumnStat(Some(6L), None, None, Some(0), Some(8), Some(10), None, CatalogColumnStat.VERSION), + "hd_income_band_sk" -> CatalogColumnStat(Some(20L), Some("1"), Some("20"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "hd_demo_sk" -> CatalogColumnStat(Some(7083L), Some("1"), Some("7200"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "hd_vehicle_count" -> CatalogColumnStat(Some(6L), Some("-1"), Some("4"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "hd_dep_count" -> CatalogColumnStat(Some(10L), Some("0"), Some("9"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION) + )), + "call_center" -> CatalogStatistics(16020L, Some(30L), Map( + "cc_rec_start_date" -> CatalogColumnStat(Some(4L), Some("1998-01-01"), Some("2002-01-01"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cc_mkt_desc" -> CatalogColumnStat(Some(21L), None, None, Some(0), Some(59), Some(93), None, CatalogColumnStat.VERSION), + "cc_hours" -> CatalogColumnStat(Some(3L), None, None, Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cc_street_name" -> CatalogColumnStat(Some(14L), None, None, Some(0), Some(8), Some(16), None, CatalogColumnStat.VERSION), + "cc_manager" -> CatalogColumnStat(Some(22L), None, None, Some(0), Some(13), Some(17), None, CatalogColumnStat.VERSION), + "cc_city" -> CatalogColumnStat(Some(12L), None, None, Some(0), Some(10), Some(15), None, CatalogColumnStat.VERSION), + "cc_class" -> CatalogColumnStat(Some(3L), None, None, Some(0), Some(6), Some(6), None, CatalogColumnStat.VERSION), + "cc_country" -> CatalogColumnStat(Some(1L), None, None, Some(0), Some(13), Some(13), None, CatalogColumnStat.VERSION), + "cc_open_date_sk" -> CatalogColumnStat(Some(15L), Some("2450794"), Some("2451146"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cc_market_manager" -> CatalogColumnStat(Some(25L), None, None, Some(0), Some(13), Some(17), None, CatalogColumnStat.VERSION), + "cc_street_number" -> CatalogColumnStat(Some(15L), None, None, Some(0), Some(3), Some(3), None, CatalogColumnStat.VERSION), + "cc_call_center_sk" -> CatalogColumnStat(Some(30L), Some("1"), Some("30"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cc_name" -> CatalogColumnStat(Some(15L), None, None, Some(0), Some(14), Some(19), None, CatalogColumnStat.VERSION), + "cc_suite_number" -> CatalogColumnStat(Some(14L), None, None, Some(0), Some(8), Some(9), None, CatalogColumnStat.VERSION), + "cc_mkt_id" -> CatalogColumnStat(Some(6L), Some("1"), Some("6"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cc_gmt_offset" -> CatalogColumnStat(Some(2L), Some("-6.00"), Some("-5.00"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cc_company_name" -> CatalogColumnStat(Some(6L), None, None, Some(0), Some(4), Some(5), None, CatalogColumnStat.VERSION), + "cc_division" -> CatalogColumnStat(Some(6L), Some("1"), Some("6"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cc_closed_date_sk" -> CatalogColumnStat(Some(0L), None, None, Some(30), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cc_state" -> CatalogColumnStat(Some(8L), None, None, Some(0), Some(2), Some(2), None, CatalogColumnStat.VERSION), + "cc_street_type" -> CatalogColumnStat(Some(9L), None, None, Some(0), Some(5), Some(9), None, CatalogColumnStat.VERSION), + "cc_call_center_id" -> CatalogColumnStat(Some(14L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "cc_sq_ft" -> CatalogColumnStat(Some(22L), Some("1670015"), Some("31896816"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cc_mkt_class" -> CatalogColumnStat(Some(26L), None, None, Some(0), Some(35), Some(50), None, CatalogColumnStat.VERSION), + "cc_tax_percentage" -> CatalogColumnStat(Some(10L), Some("0.00"), Some("0.12"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cc_division_name" -> CatalogColumnStat(Some(6L), None, None, Some(0), Some(5), Some(5), None, CatalogColumnStat.VERSION), + "cc_zip" -> CatalogColumnStat(Some(14L), None, None, Some(0), Some(5), Some(5), None, CatalogColumnStat.VERSION), + "cc_rec_end_date" -> CatalogColumnStat(Some(3L), Some("2000-01-01"), Some("2001-12-31"), Some(15), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cc_employees" -> CatalogColumnStat(Some(22L), Some("2935"), Some("69020"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cc_county" -> CatalogColumnStat(Some(8L), None, None, Some(0), Some(15), Some(17), None, CatalogColumnStat.VERSION), + "cc_company" -> CatalogColumnStat(Some(6L), Some("1"), Some("6"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION) + )), + "catalog_page" -> CatalogStatistics(3774000L, Some(20400L), Map( + "cp_catalog_page_id" -> CatalogColumnStat(Some(20400L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "cp_department" -> CatalogColumnStat(Some(1L), None, None, Some(205), Some(10), Some(10), None, CatalogColumnStat.VERSION), + "cp_description" -> CatalogColumnStat(Some(19304L), None, None, Some(190), Some(75), Some(99), None, CatalogColumnStat.VERSION), + "cp_start_date_sk" -> CatalogColumnStat(Some(88L), Some("2450815"), Some("2453005"), Some(196), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cp_end_date_sk" -> CatalogColumnStat(Some(101L), Some("2450844"), Some("2453186"), Some(206), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cp_catalog_page_number" -> CatalogColumnStat(Some(186L), Some("1"), Some("188"), Some(208), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cp_type" -> CatalogColumnStat(Some(3L), None, None, Some(197), Some(8), Some(9), None, CatalogColumnStat.VERSION), + "cp_catalog_page_sk" -> CatalogColumnStat(Some(18915L), Some("1"), Some("20400"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cp_catalog_number" -> CatalogColumnStat(Some(110L), Some("1"), Some("109"), Some(197), Some(4), Some(4), None, CatalogColumnStat.VERSION) + )), + "catalog_returns" -> CatalogStatistics(2189464848L, Some(14404374L), Map( + "cr_return_amount" -> CatalogColumnStat(Some(563788L), Some("0.00"), Some("28778.31"), Some(288408), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cr_returning_hdemo_sk" -> CatalogColumnStat(Some(7083L), Some("1"), Some("7200"), Some(288369), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_refunded_hdemo_sk" -> CatalogColumnStat(Some(7083L), Some("1"), Some("7200"), Some(288053), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_catalog_page_sk" -> CatalogColumnStat(Some(11224L), Some("1"), Some("17108"), Some(288041), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_reason_sk" -> CatalogColumnStat(Some(55L), Some("1"), Some("55"), Some(287890), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_returning_cdemo_sk" -> CatalogColumnStat(Some(1839372L), Some("1"), Some("1920800"), Some(288128), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_fee" -> CatalogColumnStat(Some(9571L), Some("0.50"), Some("100.00"), Some(288038), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cr_refunded_cash" -> CatalogColumnStat(Some(592855L), Some("0.00"), Some("24544.84"), Some(287638), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cr_refunded_cdemo_sk" -> CatalogColumnStat(Some(1842661L), Some("1"), Some("1920800"), Some(287556), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_order_number" -> CatalogColumnStat(Some(8816832L), Some("2"), Some("16000000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_ship_mode_sk" -> CatalogColumnStat(Some(20L), Some("1"), Some("20"), Some(287768), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_refunded_customer_sk" -> CatalogColumnStat(Some(1894309L), Some("1"), Some("2000000"), Some(287207), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_return_amt_inc_tax" -> CatalogColumnStat(Some(855338L), Some("0.00"), Some("29353.87"), Some(288246), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cr_returning_customer_sk" -> CatalogColumnStat(Some(1903054L), Some("1"), Some("2000000"), Some(287581), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_returned_date_sk" -> CatalogColumnStat(Some(2027L), Some("2450821"), Some("2452921"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_return_ship_cost" -> CatalogColumnStat(Some(347391L), Some("0.00"), Some("14130.96"), Some(287952), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cr_returning_addr_sk" -> CatalogColumnStat(Some(943039L), Some("1"), Some("1000000"), Some(288203), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_return_quantity" -> CatalogColumnStat(Some(99L), Some("1"), Some("100"), Some(287844), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_store_credit" -> CatalogColumnStat(Some(415989L), Some("0.00"), Some("22167.49"), Some(288118), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cr_item_sk" -> CatalogColumnStat(Some(206807L), Some("1"), Some("204000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_return_tax" -> CatalogColumnStat(Some(101557L), Some("0.00"), Some("2390.75"), Some(288599), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cr_refunded_addr_sk" -> CatalogColumnStat(Some(943039L), Some("1"), Some("1000000"), Some(287752), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_call_center_sk" -> CatalogColumnStat(Some(31L), Some("1"), Some("30"), Some(288179), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_returned_time_sk" -> CatalogColumnStat(Some(83505L), Some("0"), Some("86399"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cr_net_loss" -> CatalogColumnStat(Some(550908L), Some("0.50"), Some("15781.83"), Some(287954), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cr_reversed_charge" -> CatalogColumnStat(Some(410432L), Some("0.00"), Some("23801.24"), Some(288476), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cr_warehouse_sk" -> CatalogColumnStat(Some(15L), Some("1"), Some("15"), Some(288581), Some(4), Some(4), None, CatalogColumnStat.VERSION) + )), + "catalog_sales" -> CatalogStatistics(29375401260L, Some(143997065L), Map( + "cs_ship_hdemo_sk" -> CatalogColumnStat(Some(7083L), Some("1"), Some("7200"), Some(720450), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_bill_addr_sk" -> CatalogColumnStat(Some(943039L), Some("1"), Some("1000000"), Some(718886), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_net_paid_inc_ship_tax" -> CatalogColumnStat(Some(2570239L), Some("0.00"), Some("45460.80"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_ext_sales_price" -> CatalogColumnStat(Some(977146L), Some("0.00"), Some("29808.00"), Some(719228), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_sold_date_sk" -> CatalogColumnStat(Some(1772L), Some("2450815"), Some("2452654"), Some(719581), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_ext_tax" -> CatalogColumnStat(Some(189612L), Some("0.00"), Some("2619.36"), Some(719627), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_sold_time_sk" -> CatalogColumnStat(Some(83505L), Some("0"), Some("86399"), Some(720917), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_net_paid_inc_ship" -> CatalogColumnStat(Some(1870941L), Some("0.00"), Some("43725.00"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_warehouse_sk" -> CatalogColumnStat(Some(15L), Some("1"), Some("15"), Some(719624), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_ext_list_price" -> CatalogColumnStat(Some(1101138L), Some("1.00"), Some("29997.00"), Some(719642), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_quantity" -> CatalogColumnStat(Some(99L), Some("1"), Some("100"), Some(720147), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_ext_discount_amt" -> CatalogColumnStat(Some(965247L), Some("0.00"), Some("29765.00"), Some(719820), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_net_profit" -> CatalogColumnStat(Some(1640663L), Some("-10000.00"), Some("19840.00"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_bill_hdemo_sk" -> CatalogColumnStat(Some(7083L), Some("1"), Some("7200"), Some(719849), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_ext_ship_cost" -> CatalogColumnStat(Some(508914L), Some("0.00"), Some("14896.00"), Some(719848), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_item_sk" -> CatalogColumnStat(Some(206807L), Some("1"), Some("204000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_ship_cdemo_sk" -> CatalogColumnStat(Some(1847065L), Some("1"), Some("1920800"), Some(720292), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_wholesale_cost" -> CatalogColumnStat(Some(9503L), Some("1.00"), Some("100.00"), Some(721114), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_ship_date_sk" -> CatalogColumnStat(Some(1887L), Some("2450817"), Some("2452744"), Some(719625), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_ext_wholesale_cost" -> CatalogColumnStat(Some(382964L), Some("1.00"), Some("10000.00"), Some(719924), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_bill_cdemo_sk" -> CatalogColumnStat(Some(1847065L), Some("1"), Some("1920800"), Some(720208), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_sales_price" -> CatalogColumnStat(Some(29282L), Some("0.00"), Some("300.00"), Some(719781), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_net_paid" -> CatalogColumnStat(Some(1330351L), Some("0.00"), Some("29760.00"), Some(719706), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_promo_sk" -> CatalogColumnStat(Some(1026L), Some("1"), Some("1000"), Some(720194), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_call_center_sk" -> CatalogColumnStat(Some(31L), Some("1"), Some("30"), Some(719767), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_catalog_page_sk" -> CatalogColumnStat(Some(11224L), Some("1"), Some("17108"), Some(719180), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_bill_customer_sk" -> CatalogColumnStat(Some(1903054L), Some("1"), Some("2000000"), Some(719473), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_list_price" -> CatalogColumnStat(Some(29447L), Some("1.00"), Some("300.00"), Some(720328), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_ship_customer_sk" -> CatalogColumnStat(Some(1903054L), Some("1"), Some("2000000"), Some(720582), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_coupon_amt" -> CatalogColumnStat(Some(982009L), Some("0.00"), Some("28422.94"), Some(719631), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_ship_addr_sk" -> CatalogColumnStat(Some(943039L), Some("1"), Some("1000000"), Some(718680), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_order_number" -> CatalogColumnStat(Some(15603123L), Some("1"), Some("16000000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cs_net_paid_inc_tax" -> CatalogColumnStat(Some(1807594L), Some("0.00"), Some("31745.52"), Some(719354), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "cs_ship_mode_sk" -> CatalogColumnStat(Some(20L), Some("1"), Some("20"), Some(720146), Some(4), Some(4), None, CatalogColumnStat.VERSION) + )), + "customer_address" -> CatalogStatistics(245000000L, Some(1000000L), Map( + "ca_country" -> CatalogColumnStat(Some(1L), None, None, Some(30097), Some(13), Some(13), None, CatalogColumnStat.VERSION), + "ca_address_id" -> CatalogColumnStat(Some(1000000L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "ca_address_sk" -> CatalogColumnStat(Some(943039L), Some("1"), Some("1000000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ca_county" -> CatalogColumnStat(Some(1957L), None, None, Some(30028), Some(14), Some(28), None, CatalogColumnStat.VERSION), + "ca_gmt_offset" -> CatalogColumnStat(Some(6L), Some("-10.00"), Some("-5.00"), Some(30131), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "ca_street_type" -> CatalogColumnStat(Some(20L), None, None, Some(30124), Some(5), Some(9), None, CatalogColumnStat.VERSION), + "ca_street_name" -> CatalogColumnStat(Some(8292L), None, None, Some(30178), Some(9), Some(21), None, CatalogColumnStat.VERSION), + "ca_city" -> CatalogColumnStat(Some(977L), None, None, Some(30183), Some(9), Some(20), None, CatalogColumnStat.VERSION), + "ca_location_type" -> CatalogColumnStat(Some(3L), None, None, Some(30172), Some(9), Some(13), None, CatalogColumnStat.VERSION), + "ca_suite_number" -> CatalogColumnStat(Some(76L), None, None, Some(30047), Some(8), Some(9), None, CatalogColumnStat.VERSION), + "ca_zip" -> CatalogColumnStat(Some(8311L), None, None, Some(30370), Some(5), Some(5), None, CatalogColumnStat.VERSION), + "ca_state" -> CatalogColumnStat(Some(54L), None, None, Some(30124), Some(2), Some(2), None, CatalogColumnStat.VERSION), + "ca_street_number" -> CatalogColumnStat(Some(1034L), None, None, Some(30226), Some(3), Some(4), None, CatalogColumnStat.VERSION) + )), + "customer_demographics" -> CatalogStatistics(182476000L, Some(1920800L), Map( + "cd_dep_employed_count" -> CatalogColumnStat(Some(7L), Some("0"), Some("6"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cd_dep_count" -> CatalogColumnStat(Some(7L), Some("0"), Some("6"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cd_education_status" -> CatalogColumnStat(Some(7L), None, None, Some(0), Some(10), Some(15), None, CatalogColumnStat.VERSION), + "cd_marital_status" -> CatalogColumnStat(Some(5L), None, None, Some(0), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "cd_gender" -> CatalogColumnStat(Some(2L), None, None, Some(0), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "cd_purchase_estimate" -> CatalogColumnStat(Some(20L), Some("500"), Some("10000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cd_demo_sk" -> CatalogColumnStat(Some(1847065L), Some("1"), Some("1920800"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "cd_credit_rating" -> CatalogColumnStat(Some(4L), None, None, Some(0), Some(7), Some(9), None, CatalogColumnStat.VERSION), + "cd_dep_college_count" -> CatalogColumnStat(Some(7L), Some("0"), Some("6"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION) + )), + "income_band" -> CatalogStatistics(400L, Some(20L), Map( + "ib_income_band_sk" -> CatalogColumnStat(Some(20L), Some("1"), Some("20"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ib_lower_bound" -> CatalogColumnStat(Some(19L), Some("0"), Some("190001"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "ib_upper_bound" -> CatalogColumnStat(Some(20L), Some("10000"), Some("200000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION) + )), + "inventory" -> CatalogStatistics(9583920000L, Some(399330000L), Map( + "inv_date_sk" -> CatalogColumnStat(Some(267L), Some("2450815"), Some("2452635"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "inv_item_sk" -> CatalogColumnStat(Some(206807L), Some("1"), Some("204000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "inv_warehouse_sk" -> CatalogColumnStat(Some(15L), Some("1"), Some("15"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "inv_quantity_on_hand" -> CatalogColumnStat(Some(1026L), Some("0"), Some("1000"), Some(19969395), Some(4), Some(4), None, CatalogColumnStat.VERSION) + )), + "item" -> CatalogStatistics(94248000L, Some(204000L), Map( + "i_container" -> CatalogColumnStat(Some(1L), None, None, Some(510), Some(7), Some(7), None, CatalogColumnStat.VERSION), + "i_formulation" -> CatalogColumnStat(Some(158873L), None, None, Some(530), Some(20), Some(20), None, CatalogColumnStat.VERSION), + "i_brand_id" -> CatalogColumnStat(Some(862L), Some("1001001"), Some("10016017"), Some(516), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "i_manager_id" -> CatalogColumnStat(Some(99L), Some("1"), Some("100"), Some(506), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "i_rec_end_date" -> CatalogColumnStat(Some(3L), None, None, Some(102000), Some(10), Some(10), None, CatalogColumnStat.VERSION), + "i_class" -> CatalogColumnStat(Some(100L), None, None, Some(499), Some(8), Some(15), None, CatalogColumnStat.VERSION), + "i_wholesale_cost" -> CatalogColumnStat(Some(6297L), Some("0.02"), Some("88.91"), Some(489), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "i_item_id" -> CatalogColumnStat(Some(104042L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "i_manufact_id" -> CatalogColumnStat(Some(1026L), Some("1"), Some("1000"), Some(498), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "i_item_desc" -> CatalogColumnStat(Some(158754L), None, None, Some(508), Some(101), Some(200), None, CatalogColumnStat.VERSION), + "i_rec_start_date" -> CatalogColumnStat(Some(4L), None, None, Some(522), Some(10), Some(10), None, CatalogColumnStat.VERSION), + "i_color" -> CatalogColumnStat(Some(88L), None, None, Some(524), Some(6), Some(10), None, CatalogColumnStat.VERSION), + "i_product_name" -> CatalogColumnStat(Some(203486L), None, None, Some(514), Some(23), Some(30), None, CatalogColumnStat.VERSION), + "i_category" -> CatalogColumnStat(Some(10L), None, None, Some(482), Some(6), Some(11), None, CatalogColumnStat.VERSION), + "i_class_id" -> CatalogColumnStat(Some(16L), Some("1"), Some("16"), Some(491), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "i_item_sk" -> CatalogColumnStat(Some(204000L), Some("1"), Some("204000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "i_manufact" -> CatalogColumnStat(Some(997L), None, None, Some(544), Some(12), Some(15), None, CatalogColumnStat.VERSION), + "i_brand" -> CatalogColumnStat(Some(671L), None, None, Some(510), Some(17), Some(22), None, CatalogColumnStat.VERSION), + "i_current_price" -> CatalogColumnStat(Some(8736L), Some("0.09"), Some("99.99"), Some(518), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "i_category_id" -> CatalogColumnStat(Some(10L), Some("1"), Some("10"), Some(515), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "i_size" -> CatalogColumnStat(Some(7L), None, None, Some(515), Some(5), Some(11), None, CatalogColumnStat.VERSION), + "i_units" -> CatalogColumnStat(Some(21L), None, None, Some(503), Some(5), Some(7), None, CatalogColumnStat.VERSION) + )), + "promotion" -> CatalogStatistics(268000L, Some(1000L), Map( + "p_promo_name" -> CatalogColumnStat(Some(10L), None, None, Some(18), Some(4), Some(5), None, CatalogColumnStat.VERSION), + "p_end_date_sk" -> CatalogColumnStat(Some(564L), Some("2450116"), Some("2450967"), Some(12), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "p_channel_radio" -> CatalogColumnStat(Some(1L), None, None, Some(13), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "p_channel_demo" -> CatalogColumnStat(Some(1L), None, None, Some(16), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "p_item_sk" -> CatalogColumnStat(Some(986L), Some("280"), Some("203966"), Some(14), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "p_channel_dmail" -> CatalogColumnStat(Some(2L), None, None, Some(13), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "p_discount_active" -> CatalogColumnStat(Some(1L), None, None, Some(19), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "p_promo_id" -> CatalogColumnStat(Some(1000L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "p_channel_tv" -> CatalogColumnStat(Some(1L), None, None, Some(14), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "p_cost" -> CatalogColumnStat(Some(1L), Some("1000.00"), Some("1000.00"), Some(14), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "p_channel_email" -> CatalogColumnStat(Some(1L), None, None, Some(13), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "p_channel_event" -> CatalogColumnStat(Some(1L), None, None, Some(14), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "p_channel_catalog" -> CatalogColumnStat(Some(1L), None, None, Some(14), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "p_promo_sk" -> CatalogColumnStat(Some(1000L), Some("1"), Some("1000"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "p_purpose" -> CatalogColumnStat(Some(1L), None, None, Some(13), Some(7), Some(7), None, CatalogColumnStat.VERSION), + "p_start_date_sk" -> CatalogColumnStat(Some(577L), Some("2450100"), Some("2450915"), Some(17), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "p_channel_press" -> CatalogColumnStat(Some(1L), None, None, Some(15), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "p_channel_details" -> CatalogColumnStat(Some(990L), None, None, Some(10), Some(40), Some(60), None, CatalogColumnStat.VERSION), + "p_response_target" -> CatalogColumnStat(Some(1L), Some("1"), Some("1"), Some(19), Some(4), Some(4), None, CatalogColumnStat.VERSION) + )), + "reason" -> CatalogStatistics(3630L, Some(55L), Map( + "r_reason_sk" -> CatalogColumnStat(Some(55L), Some("1"), Some("55"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "r_reason_id" -> CatalogColumnStat(Some(55L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "r_reason_desc" -> CatalogColumnStat(Some(55L), None, None, Some(0), Some(14), Some(43), None, CatalogColumnStat.VERSION) + )), + "ship_mode" -> CatalogStatistics(2420L, Some(20L), Map( + "sm_carrier" -> CatalogColumnStat(Some(19L), None, None, Some(0), Some(7), Some(14), None, CatalogColumnStat.VERSION), + "sm_ship_mode_sk" -> CatalogColumnStat(Some(20L), Some("1"), Some("20"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "sm_code" -> CatalogColumnStat(Some(4L), None, None, Some(0), Some(5), Some(7), None, CatalogColumnStat.VERSION), + "sm_type" -> CatalogColumnStat(Some(5L), None, None, Some(0), Some(8), Some(9), None, CatalogColumnStat.VERSION), + "sm_contract" -> CatalogColumnStat(Some(18L), None, None, Some(0), Some(13), Some(20), None, CatalogColumnStat.VERSION), + "sm_ship_mode_id" -> CatalogColumnStat(Some(20L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION) + )), + "store" -> CatalogStatistics(207432L, Some(402L), Map( + "s_rec_end_date" -> CatalogColumnStat(Some(3L), None, None, Some(201), Some(10), Some(10), None, CatalogColumnStat.VERSION), + "s_state" -> CatalogColumnStat(Some(9L), None, None, Some(2), Some(2), Some(2), None, CatalogColumnStat.VERSION), + "s_street_type" -> CatalogColumnStat(Some(20L), None, None, Some(6), Some(5), Some(9), None, CatalogColumnStat.VERSION), + "s_floor_space" -> CatalogColumnStat(Some(300L), Some("5004767"), Some("9997773"), Some(3), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "s_division_name" -> CatalogColumnStat(Some(1L), None, None, Some(5), Some(7), Some(7), None, CatalogColumnStat.VERSION), + "s_market_desc" -> CatalogColumnStat(Some(318L), None, None, Some(5), Some(59), Some(100), None, CatalogColumnStat.VERSION), + "s_street_name" -> CatalogColumnStat(Some(255L), None, None, Some(6), Some(9), Some(16), None, CatalogColumnStat.VERSION), + "s_county" -> CatalogColumnStat(Some(9L), None, None, Some(4), Some(15), Some(17), None, CatalogColumnStat.VERSION), + "s_rec_start_date" -> CatalogColumnStat(Some(4L), None, None, Some(4), Some(10), Some(10), None, CatalogColumnStat.VERSION), + "s_company_id" -> CatalogColumnStat(Some(1L), Some("1"), Some("1"), Some(4), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "s_market_manager" -> CatalogColumnStat(Some(275L), None, None, Some(7), Some(13), Some(20), None, CatalogColumnStat.VERSION), + "s_number_employees" -> CatalogColumnStat(Some(94L), Some("200"), Some("300"), Some(5), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "s_manager" -> CatalogColumnStat(Some(300L), None, None, Some(5), Some(13), Some(20), None, CatalogColumnStat.VERSION), + "s_country" -> CatalogColumnStat(Some(1L), None, None, Some(4), Some(13), Some(13), None, CatalogColumnStat.VERSION), + "s_store_name" -> CatalogColumnStat(Some(10L), None, None, Some(2), Some(4), Some(5), None, CatalogColumnStat.VERSION), + "s_division_id" -> CatalogColumnStat(Some(1L), Some("1"), Some("1"), Some(2), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "s_street_number" -> CatalogColumnStat(Some(274L), None, None, Some(5), Some(3), Some(3), None, CatalogColumnStat.VERSION), + "s_company_name" -> CatalogColumnStat(Some(1L), None, None, Some(3), Some(7), Some(7), None, CatalogColumnStat.VERSION), + "s_gmt_offset" -> CatalogColumnStat(Some(2L), Some("-6.00"), Some("-5.00"), Some(4), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "s_store_sk" -> CatalogColumnStat(Some(399L), Some("1"), Some("402"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "s_city" -> CatalogColumnStat(Some(18L), None, None, Some(5), Some(10), Some(15), None, CatalogColumnStat.VERSION), + "s_zip" -> CatalogColumnStat(Some(99L), None, None, Some(6), Some(5), Some(5), None, CatalogColumnStat.VERSION), + "s_market_id" -> CatalogColumnStat(Some(10L), Some("1"), Some("10"), Some(6), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "s_hours" -> CatalogColumnStat(Some(3L), None, None, Some(4), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "s_suite_number" -> CatalogColumnStat(Some(75L), None, None, Some(2), Some(8), Some(9), None, CatalogColumnStat.VERSION), + "s_closed_date_sk" -> CatalogColumnStat(Some(70L), Some("2450823"), Some("2451313"), Some(296), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "s_store_id" -> CatalogColumnStat(Some(210L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "s_geography_class" -> CatalogColumnStat(Some(1L), None, None, Some(3), Some(7), Some(7), None, CatalogColumnStat.VERSION), + "s_tax_percentage" -> CatalogColumnStat(Some(12L), Some("0.00"), Some("0.11"), Some(5), Some(8), Some(8), None, CatalogColumnStat.VERSION) + )), + "store_returns" -> CatalogStatistics(4837573440L, Some(28795080L), Map( + "sr_item_sk" -> CatalogColumnStat(Some(197284L), Some("1"), Some("204000"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_reversed_charge" -> CatalogColumnStat(Some(423824L), Some("0.00"), Some("16099.52"), Some(1009035), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_return_amt_inc_tax" -> CatalogColumnStat(Some(807709L), Some("0.00"), Some("20002.89"), Some(1006919), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_store_sk" -> CatalogColumnStat(Some(199L), Some("1"), Some("400"), Some(1007164), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_return_quantity" -> CatalogColumnStat(Some(103L), Some("1"), Some("100"), Some(1007948), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_fee" -> CatalogColumnStat(Some(9571L), Some("0.50"), Some("100.00"), Some(1008291), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_refunded_cash" -> CatalogColumnStat(Some(559685L), Some("0.00"), Some("17556.95"), Some(1008003), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_return_time_sk" -> CatalogColumnStat(Some(31932L), Some("28799"), Some("61199"), Some(1009330), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_addr_sk" -> CatalogColumnStat(Some(925738L), Some("1"), Some("1000000"), Some(1008253), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_return_amt" -> CatalogColumnStat(Some(492928L), Some("0.00"), Some("18973.20"), Some(1007419), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_returned_date_sk" -> CatalogColumnStat(Some(2010L), Some("2450820"), Some("2452822"), Some(1007464), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_return_tax" -> CatalogColumnStat(Some(86618L), Some("0.00"), Some("1611.71"), Some(1008618), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_return_ship_cost" -> CatalogColumnStat(Some(290195L), Some("0.00"), Some("9578.25"), Some(1007846), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_reason_sk" -> CatalogColumnStat(Some(57L), Some("1"), Some("55"), Some(1008299), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_net_loss" -> CatalogColumnStat(Some(487073L), Some("0.50"), Some("10447.72"), Some(1007153), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_cdemo_sk" -> CatalogColumnStat(Some(1807132L), Some("1"), Some("1920800"), Some(1006835), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_hdemo_sk" -> CatalogColumnStat(Some(6609L), Some("1"), Some("7200"), Some(1008547), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_store_credit" -> CatalogColumnStat(Some(410133L), Some("0.00"), Some("15642.11"), Some(1007102), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_customer_sk" -> CatalogColumnStat(Some(1860981L), Some("1"), Some("2000000"), Some(1008429), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "sr_ticket_number" -> CatalogColumnStat(Some(15853105L), Some("1"), Some("23999996"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION) + )), + "time_dim" -> CatalogStatistics(10886400L, Some(86400L), Map( + "t_sub_shift" -> CatalogColumnStat(Some(4L), None, None, Some(0), Some(7), Some(9), None, CatalogColumnStat.VERSION), + "t_time" -> CatalogColumnStat(Some(83505L), Some("0"), Some("86399"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "t_second" -> CatalogColumnStat(Some(60L), Some("0"), Some("59"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "t_hour" -> CatalogColumnStat(Some(25L), Some("0"), Some("23"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "t_am_pm" -> CatalogColumnStat(Some(2L), None, None, Some(0), Some(2), Some(2), None, CatalogColumnStat.VERSION), + "t_minute" -> CatalogColumnStat(Some(60L), Some("0"), Some("59"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "t_shift" -> CatalogColumnStat(Some(3L), None, None, Some(0), Some(6), Some(6), None, CatalogColumnStat.VERSION), + "t_time_id" -> CatalogColumnStat(Some(80197L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "t_time_sk" -> CatalogColumnStat(Some(83505L), Some("0"), Some("86399"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "t_meal_time" -> CatalogColumnStat(Some(3L), None, None, Some(50400), Some(7), Some(9), None, CatalogColumnStat.VERSION) + )), + "warehouse" -> CatalogStatistics(3855L, Some(15L), Map( + "w_state" -> CatalogColumnStat(Some(8L), None, None, Some(0), Some(2), Some(2), None, CatalogColumnStat.VERSION), + "w_street_name" -> CatalogColumnStat(Some(14L), None, None, Some(1), Some(10), Some(14), None, CatalogColumnStat.VERSION), + "w_warehouse_name" -> CatalogColumnStat(Some(14L), None, None, Some(1), Some(17), Some(20), None, CatalogColumnStat.VERSION), + "w_county" -> CatalogColumnStat(Some(8L), None, None, Some(0), Some(14), Some(16), None, CatalogColumnStat.VERSION), + "w_street_number" -> CatalogColumnStat(Some(14L), None, None, Some(1), Some(3), Some(3), None, CatalogColumnStat.VERSION), + "w_warehouse_sq_ft" -> CatalogColumnStat(Some(14L), Some("73065"), Some("977787"), Some(1), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "w_city" -> CatalogColumnStat(Some(11L), None, None, Some(0), Some(8), Some(13), None, CatalogColumnStat.VERSION), + "w_warehouse_sk" -> CatalogColumnStat(Some(15L), Some("1"), Some("15"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "w_suite_number" -> CatalogColumnStat(Some(13L), None, None, Some(1), Some(8), Some(9), None, CatalogColumnStat.VERSION), + "w_zip" -> CatalogColumnStat(Some(14L), None, None, Some(0), Some(5), Some(5), None, CatalogColumnStat.VERSION), + "w_gmt_offset" -> CatalogColumnStat(Some(2L), Some("-6.00"), Some("-5.00"), Some(1), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "w_street_type" -> CatalogColumnStat(Some(10L), None, None, Some(1), Some(5), Some(7), None, CatalogColumnStat.VERSION), + "w_warehouse_id" -> CatalogColumnStat(Some(15L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "w_country" -> CatalogColumnStat(Some(1L), None, None, Some(0), Some(13), Some(13), None, CatalogColumnStat.VERSION) + )), + "web_page" -> CatalogStatistics(281520L, Some(2040L), Map( + "wp_type" -> CatalogColumnStat(Some(7L), None, None, Some(19), Some(7), Some(9), None, CatalogColumnStat.VERSION), + "wp_autogen_flag" -> CatalogColumnStat(Some(2L), None, None, Some(25), Some(1), Some(1), None, CatalogColumnStat.VERSION), + "wp_url" -> CatalogColumnStat(Some(1L), None, None, Some(25), Some(18), Some(18), None, CatalogColumnStat.VERSION), + "wp_image_count" -> CatalogColumnStat(Some(7L), Some("1"), Some("7"), Some(20), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "wp_max_ad_count" -> CatalogColumnStat(Some(5L), Some("0"), Some("4"), Some(21), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "wp_customer_sk" -> CatalogColumnStat(Some(486L), Some("711"), Some("1996257"), Some(1471), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "wp_rec_end_date" -> CatalogColumnStat(Some(3L), Some("1999-09-03"), Some("2001-09-02"), Some(1020), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "wp_creation_date_sk" -> CatalogColumnStat(Some(121L), Some("2450672"), Some("2450815"), Some(20), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "wp_link_count" -> CatalogColumnStat(Some(25L), Some("2"), Some("25"), Some(16), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "wp_web_page_id" -> CatalogColumnStat(Some(1004L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "wp_web_page_sk" -> CatalogColumnStat(Some(2040L), Some("1"), Some("2040"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "wp_rec_start_date" -> CatalogColumnStat(Some(4L), Some("1997-09-03"), Some("2001-09-03"), Some(21), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "wp_access_date_sk" -> CatalogColumnStat(Some(100L), Some("2452548"), Some("2452648"), Some(19), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "wp_char_count" -> CatalogColumnStat(Some(1493L), Some("303"), Some("8523"), Some(25), Some(4), Some(4), None, CatalogColumnStat.VERSION) + )), + "web_returns" -> CatalogStatistics(1439534000L, Some(7197670L), Map( + "wr_returning_addr_sk" -> CatalogColumnStat(Some(925738L), Some("1"), Some("1000000"), Some(323850), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_reversed_charge" -> CatalogColumnStat(Some(346909L), Some("0.00"), Some("22972.36"), Some(323810), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_returned_date_sk" -> CatalogColumnStat(Some(2189L), Some("2450820"), Some("2453002"), Some(324185), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_order_number" -> CatalogColumnStat(Some(4098425L), Some("1"), Some("5999999"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_fee" -> CatalogColumnStat(Some(9571L), Some("0.50"), Some("100.00"), Some(324065), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_account_credit" -> CatalogColumnStat(Some(334119L), Some("0.00"), Some("23028.27"), Some(324422), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_refunded_customer_sk" -> CatalogColumnStat(Some(1808850L), Some("1"), Some("2000000"), Some(324191), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_returning_customer_sk" -> CatalogColumnStat(Some(1813094L), Some("1"), Some("2000000"), Some(324024), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_return_tax" -> CatalogColumnStat(Some(88469L), Some("0.00"), Some("2551.16"), Some(323621), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_web_page_sk" -> CatalogColumnStat(Some(1994L), Some("1"), Some("2040"), Some(324900), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_item_sk" -> CatalogColumnStat(Some(197284L), Some("1"), Some("204000"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_reason_sk" -> CatalogColumnStat(Some(57L), Some("1"), Some("55"), Some(323666), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_return_amt_inc_tax" -> CatalogColumnStat(Some(683544L), Some("0.00"), Some("29493.38"), Some(323171), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_net_loss" -> CatalogColumnStat(Some(494707L), Some("0.50"), Some("15068.96"), Some(324438), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_refunded_cdemo_sk" -> CatalogColumnStat(Some(1755065L), Some("1"), Some("1920800"), Some(323863), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_returned_time_sk" -> CatalogColumnStat(Some(84232L), Some("0"), Some("86399"), Some(323677), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_return_amt" -> CatalogColumnStat(Some(453015L), Some("0.00"), Some("28346.31"), Some(323473), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_returning_cdemo_sk" -> CatalogColumnStat(Some(1755065L), Some("1"), Some("1920800"), Some(323899), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_returning_hdemo_sk" -> CatalogColumnStat(Some(6609L), Some("1"), Some("7200"), Some(323999), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_refunded_cash" -> CatalogColumnStat(Some(484316L), Some("0.00"), Some("26466.56"), Some(324693), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_refunded_hdemo_sk" -> CatalogColumnStat(Some(6609L), Some("1"), Some("7200"), Some(324230), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_return_quantity" -> CatalogColumnStat(Some(103L), Some("1"), Some("100"), Some(323764), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_return_ship_cost" -> CatalogColumnStat(Some(302038L), Some("0.00"), Some("13602.60"), Some(323341), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "wr_refunded_addr_sk" -> CatalogColumnStat(Some(925738L), Some("1"), Some("1000000"), Some(324482), Some(8), Some(8), None, CatalogColumnStat.VERSION) + )), + "web_site" -> CatalogStatistics(11760L, Some(24L), Map( + "web_rec_end_date" -> CatalogColumnStat(Some(3L), Some("1999-08-16"), Some("2001-08-15"), Some(12), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "web_market_manager" -> CatalogColumnStat(Some(21L), None, None, Some(0), Some(13), Some(15), None, CatalogColumnStat.VERSION), + "web_country" -> CatalogColumnStat(Some(1L), None, None, Some(0), Some(13), Some(13), None, CatalogColumnStat.VERSION), + "web_street_name" -> CatalogColumnStat(Some(24L), None, None, Some(0), Some(10), Some(14), None, CatalogColumnStat.VERSION), + "web_city" -> CatalogColumnStat(Some(11L), None, None, Some(0), Some(10), Some(15), None, CatalogColumnStat.VERSION), + "web_mkt_id" -> CatalogColumnStat(Some(6L), Some("1"), Some("6"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "web_close_date_sk" -> CatalogColumnStat(Some(8L), Some("2443328"), Some("2447131"), Some(4), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "web_street_number" -> CatalogColumnStat(Some(14L), None, None, Some(0), Some(3), Some(3), None, CatalogColumnStat.VERSION), + "web_gmt_offset" -> CatalogColumnStat(Some(2L), None, None, Some(0), Some(2), Some(2), None, CatalogColumnStat.VERSION), + "web_rec_start_date" -> CatalogColumnStat(Some(4L), Some("1997-08-16"), Some("2001-08-16"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "web_mkt_class" -> CatalogColumnStat(Some(17L), None, None, Some(0), Some(32), Some(47), None, CatalogColumnStat.VERSION), + "web_county" -> CatalogColumnStat(Some(9L), None, None, Some(0), Some(14), Some(17), None, CatalogColumnStat.VERSION), + "web_class" -> CatalogColumnStat(Some(1L), None, None, Some(0), Some(7), Some(7), None, CatalogColumnStat.VERSION), + "web_site_sk" -> CatalogColumnStat(Some(24L), Some("1"), Some("24"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "web_manager" -> CatalogColumnStat(Some(19L), None, None, Some(0), Some(13), Some(16), None, CatalogColumnStat.VERSION), + "web_suite_number" -> CatalogColumnStat(Some(20L), None, None, Some(0), Some(9), Some(9), None, CatalogColumnStat.VERSION), + "web_site_id" -> CatalogColumnStat(Some(12L), None, None, Some(0), Some(16), Some(16), None, CatalogColumnStat.VERSION), + "web_company_name" -> CatalogColumnStat(Some(6L), None, None, Some(0), Some(5), Some(5), None, CatalogColumnStat.VERSION), + "web_state" -> CatalogColumnStat(Some(9L), None, None, Some(0), Some(2), Some(2), None, CatalogColumnStat.VERSION), + "web_mkt_desc" -> CatalogColumnStat(Some(15L), None, None, Some(0), Some(66), Some(92), None, CatalogColumnStat.VERSION), + "web_name" -> CatalogColumnStat(Some(4L), None, None, Some(0), Some(6), Some(6), None, CatalogColumnStat.VERSION), + "web_company_id" -> CatalogColumnStat(Some(6L), Some("1"), Some("6"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "web_street_type" -> CatalogColumnStat(Some(15L), None, None, Some(0), Some(4), Some(9), None, CatalogColumnStat.VERSION), + "web_open_date_sk" -> CatalogColumnStat(Some(12L), Some("2450628"), Some("2450807"), Some(0), Some(4), Some(4), None, CatalogColumnStat.VERSION), + "web_tax_percentage" -> CatalogColumnStat(Some(8L), Some("0.00"), Some("0.12"), Some(0), Some(8), Some(8), None, CatalogColumnStat.VERSION), + "web_zip" -> CatalogColumnStat(Some(14L), None, None, Some(0), Some(5), Some(5), None, CatalogColumnStat.VERSION) + )) + ) + // scalastyle:on line.size.limit +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/TypedImperativeAggregateSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/TypedImperativeAggregateSuite.scala index f2b608bbcb21b..986e625137a77 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/TypedImperativeAggregateSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/TypedImperativeAggregateSuite.scala @@ -23,6 +23,7 @@ import org.apache.spark.sql.TypedImperativeAggregateSuite.TypedMax import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.{BoundReference, Expression, GenericInternalRow, ImplicitCastInputTypes, SpecificInternalRow} import org.apache.spark.sql.catalyst.expressions.aggregate.TypedImperativeAggregate +import org.apache.spark.sql.catalyst.trees.UnaryLike import org.apache.spark.sql.execution.aggregate.HashAggregateExec import org.apache.spark.sql.expressions.Window import org.apache.spark.sql.functions._ @@ -147,9 +148,9 @@ class TypedImperativeAggregateSuite extends QueryTest with SharedSparkSession { val query = df.select(typedMax($"key"), count($"key"), typedMax($"value"), count($"value")) val maxKey = nullableData.map(_._1).filter(_ != null).max - val countKey = nullableData.map(_._1).filter(_ != null).size + val countKey = nullableData.map(_._1).count(_ != null) val maxValue = nullableData.map(_._2).filter(_ != null).max - val countValue = nullableData.map(_._2).filter(_ != null).size + val countValue = nullableData.map(_._2).count(_ != null) val expected = Seq(Row(maxKey, countKey, maxValue, countValue)) checkAnswer(query, expected) } @@ -232,8 +233,8 @@ object TypedImperativeAggregateSuite { nullable: Boolean = false, mutableAggBufferOffset: Int = 0, inputAggBufferOffset: Int = 0) - extends TypedImperativeAggregate[MaxValue] with ImplicitCastInputTypes { - + extends TypedImperativeAggregate[MaxValue] with ImplicitCastInputTypes + with UnaryLike[Expression] { override def createAggregationBuffer(): MaxValue = { // Returns Int.MinValue if all inputs are null @@ -270,8 +271,6 @@ object TypedImperativeAggregateSuite { override lazy val deterministic: Boolean = true - override def children: Seq[Expression] = Seq(child) - override def inputTypes: Seq[AbstractDataType] = Seq(IntegerType) override def dataType: DataType = IntegerType @@ -297,6 +296,9 @@ object TypedImperativeAggregateSuite { val value = stream.readInt() new MaxValue(value, isValueSet) } + + override protected def withNewChildInternal(newChild: Expression): TypedMax = + copy(child = newChild) } private class MaxValue(var value: Int, var isValueSet: Boolean = false) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/UDFSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/UDFSuite.scala index e2747d7db9f3f..116e1ef1f9445 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/UDFSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/UDFSuite.scala @@ -18,14 +18,26 @@ package org.apache.spark.sql import java.math.BigDecimal +import java.sql.Timestamp +import java.time.{Instant, LocalDate} +import java.time.format.DateTimeFormatter +import scala.collection.mutable.{ArrayBuffer, WrappedArray} + +import org.apache.spark.SparkException import org.apache.spark.sql.api.java._ +import org.apache.spark.sql.catalyst.FunctionIdentifier +import org.apache.spark.sql.catalyst.encoders.{ExpressionEncoder, OuterScopes} +import org.apache.spark.sql.catalyst.expressions.{Literal, ScalaUDF} import org.apache.spark.sql.catalyst.plans.logical.Project +import org.apache.spark.sql.catalyst.util.DateTimeUtils import org.apache.spark.sql.execution.{QueryExecution, SimpleMode} +import org.apache.spark.sql.execution.aggregate.{ScalaAggregator, ScalaUDAF} import org.apache.spark.sql.execution.columnar.InMemoryRelation import org.apache.spark.sql.execution.command.{CreateDataSourceTableAsSelectCommand, ExplainCommand} import org.apache.spark.sql.execution.datasources.InsertIntoHadoopFsRelationCommand -import org.apache.spark.sql.functions.{lit, udf} +import org.apache.spark.sql.expressions.{Aggregator, MutableAggregationBuffer, SparkUserDefinedFunction, UserDefinedAggregateFunction} +import org.apache.spark.sql.functions.{lit, struct, udaf, udf} import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.test.SQLTestData._ @@ -33,6 +45,8 @@ import org.apache.spark.sql.types._ import org.apache.spark.sql.util.QueryExecutionListener private case class FunctionResult(f1: String, f2: String) +private case class LocalDateInstantType(date: LocalDate, instant: Instant) +private case class TimestampInstantType(t: Timestamp, instant: Instant) class UDFSuite extends QueryTest with SharedSparkSession { import testImplicits._ @@ -330,7 +344,7 @@ class UDFSuite extends QueryTest with SharedSparkSession { Console.withOut(outputStream) { spark.sql("SELECT f(a._1) FROM x").show } - assert(outputStream.toString.contains("f(a._1 AS `_1`)")) + assert(outputStream.toString.contains("f(a._1)")) } } @@ -483,7 +497,7 @@ class UDFSuite extends QueryTest with SharedSparkSession { sparkContext.parallelize(Seq(Row(Map("a" -> new BigDecimal("2011000000000002456556"))))), StructType(Seq(StructField("col1", MapType(StringType, DecimalType(30, 0)))))) val udf2 = org.apache.spark.sql.functions.udf((map: Map[String, BigDecimal]) => { - map.mapValues(value => if (value == null) null else value.toBigInteger.toString) + map.mapValues(value => if (value == null) null else value.toBigInteger.toString).toMap }) checkAnswer(df2.select(udf2($"col1")), Seq(Row(Map("a" -> "2011000000000002456556")))) } @@ -504,23 +518,94 @@ class UDFSuite extends QueryTest with SharedSparkSession { } test("Using java.time.Instant in UDF") { - withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { - val expected = java.time.Instant.parse("2019-02-27T00:00:00Z") - val plusSec = udf((i: java.time.Instant) => i.plusSeconds(1)) - val df = spark.sql("SELECT TIMESTAMP '2019-02-26 23:59:59Z' as t") - .select(plusSec('t)) - assert(df.collect().toSeq === Seq(Row(expected))) - } + val dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") + val expected = java.time.Instant.parse("2019-02-27T00:00:00Z") + .atZone(DateTimeUtils.getZoneId(conf.sessionLocalTimeZone)) + .toLocalDateTime + .format(dtf) + val plusSec = udf((i: java.time.Instant) => i.plusSeconds(1)) + val df = spark.sql("SELECT TIMESTAMP '2019-02-26 23:59:59Z' as t") + .select(plusSec('t).cast(StringType)) + checkAnswer(df, Row(expected) :: Nil) } test("Using java.time.LocalDate in UDF") { - withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { - val expected = java.time.LocalDate.parse("2019-02-27") - val plusDay = udf((i: java.time.LocalDate) => i.plusDays(1)) - val df = spark.sql("SELECT DATE '2019-02-26' as d") - .select(plusDay('d)) - assert(df.collect().toSeq === Seq(Row(expected))) - } + val expected = java.time.LocalDate.parse("2019-02-27").toString + val plusDay = udf((i: java.time.LocalDate) => i.plusDays(1)) + val df = spark.sql("SELECT DATE '2019-02-26' as d") + .select(plusDay('d).cast(StringType)) + checkAnswer(df, Row(expected) :: Nil) + } + + test("Using combined types of Instant/LocalDate in UDF") { + val dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") + val date = LocalDate.parse("2019-02-26") + val instant = Instant.parse("2019-02-26T23:59:59Z") + val expectedDate = date.toString + val expectedInstant = + instant.atZone(DateTimeUtils.getZoneId(conf.sessionLocalTimeZone)) + .toLocalDateTime + .format(dtf) + val df = Seq((date, instant)).toDF("d", "i") + + // test normal case + spark.udf.register("buildLocalDateInstantType", + udf((d: LocalDate, i: Instant) => LocalDateInstantType(d, i))) + checkAnswer(df.selectExpr(s"buildLocalDateInstantType(d, i) as di") + .select('di.cast(StringType)), + Row(s"{$expectedDate, $expectedInstant}") :: Nil) + + // test null cases + spark.udf.register("buildLocalDateInstantType", + udf((d: LocalDate, i: Instant) => LocalDateInstantType(null, null))) + checkAnswer(df.selectExpr("buildLocalDateInstantType(d, i) as di"), + Row(Row(null, null))) + + spark.udf.register("buildLocalDateInstantType", + udf((d: LocalDate, i: Instant) => null.asInstanceOf[LocalDateInstantType])) + checkAnswer(df.selectExpr("buildLocalDateInstantType(d, i) as di"), + Row(null)) + } + + test("Using combined types of Instant/Timestamp in UDF") { + val dtf = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss") + val timestamp = Timestamp.valueOf("2019-02-26 23:59:59") + val instant = Instant.parse("2019-02-26T23:59:59Z") + val expectedTimestamp = timestamp.toLocalDateTime.format(dtf) + val expectedInstant = + instant.atZone(DateTimeUtils.getZoneId(conf.sessionLocalTimeZone)) + .toLocalDateTime + .format(dtf) + val df = Seq((timestamp, instant)).toDF("t", "i") + + // test normal case + spark.udf.register("buildTimestampInstantType", + udf((t: Timestamp, i: Instant) => TimestampInstantType(t, i))) + checkAnswer(df.selectExpr("buildTimestampInstantType(t, i) as ti") + .select('ti.cast(StringType)), + Row(s"{$expectedTimestamp, $expectedInstant}")) + + // test null cases + spark.udf.register("buildTimestampInstantType", + udf((t: Timestamp, i: Instant) => TimestampInstantType(null, null))) + checkAnswer(df.selectExpr("buildTimestampInstantType(t, i) as ti"), + Row(Row(null, null))) + + spark.udf.register("buildTimestampInstantType", + udf((t: Timestamp, i: Instant) => null.asInstanceOf[TimestampInstantType])) + checkAnswer(df.selectExpr("buildTimestampInstantType(t, i) as ti"), + Row(null)) + } + + test("SPARK-32154: return null with or without explicit type") { + // without explicit type + val udf1 = udf((i: String) => null) + assert(udf1.asInstanceOf[SparkUserDefinedFunction] .dataType === NullType) + checkAnswer(Seq("1").toDF("a").select(udf1('a)), Row(null) :: Nil) + // with explicit type + val udf2 = udf((i: String) => null.asInstanceOf[String]) + assert(udf2.asInstanceOf[SparkUserDefinedFunction].dataType === StringType) + checkAnswer(Seq("1").toDF("a").select(udf1('a)), Row(null) :: Nil) } test("SPARK-28321 0-args Java UDF should not be called only once") { @@ -581,4 +666,234 @@ class UDFSuite extends QueryTest with SharedSparkSession { .toDF("col1", "col2") checkAnswer(df.select(myUdf(Column("col1"), Column("col2"))), Row(2020) :: Nil) } + + test("case class as element type of Seq/Array") { + val f1 = (s: Seq[TestData]) => s.map(d => d.key * d.value.toInt).sum + val myUdf1 = udf(f1) + val df1 = Seq(("data", Seq(TestData(50, "2")))).toDF("col1", "col2") + checkAnswer(df1.select(myUdf1(Column("col2"))), Row(100) :: Nil) + + val f2 = (s: Array[TestData]) => s.map(d => d.key * d.value.toInt).sum + val myUdf2 = udf(f2) + val df2 = Seq(("data", Array(TestData(50, "2")))).toDF("col1", "col2") + checkAnswer(df2.select(myUdf2(Column("col2"))), Row(100) :: Nil) + } + + test("case class as key/value type of Map") { + val f1 = (s: Map[TestData, Int]) => s.keys.head.key * s.keys.head.value.toInt + val myUdf1 = udf(f1) + val df1 = Seq(("data", Map(TestData(50, "2") -> 502))).toDF("col1", "col2") + checkAnswer(df1.select(myUdf1(Column("col2"))), Row(100) :: Nil) + + val f2 = (s: Map[Int, TestData]) => s.values.head.key * s.values.head.value.toInt + val myUdf2 = udf(f2) + val df2 = Seq(("data", Map(502 -> TestData(50, "2")))).toDF("col1", "col2") + checkAnswer(df2.select(myUdf2(Column("col2"))), Row(100) :: Nil) + + val f3 = (s: Map[TestData, TestData]) => s.keys.head.key * s.values.head.value.toInt + val myUdf3 = udf(f3) + val df3 = Seq(("data", Map(TestData(50, "2") -> TestData(50, "2")))).toDF("col1", "col2") + checkAnswer(df3.select(myUdf3(Column("col2"))), Row(100) :: Nil) + } + + test("case class as element of tuple") { + val f = (s: (TestData, Int)) => s._1.key * s._2 + val myUdf = udf(f) + val df = Seq(("data", (TestData(50, "2"), 2))).toDF("col1", "col2") + checkAnswer(df.select(myUdf(Column("col2"))), Row(100) :: Nil) + } + + test("case class as generic type of Option") { + val f = (o: Option[TestData]) => o.map(t => t.key * t.value.toInt) + val myUdf = udf(f) + val df1 = Seq(("data", Some(TestData(50, "2")))).toDF("col1", "col2") + checkAnswer(df1.select(myUdf(Column("col2"))), Row(100) :: Nil) + val df2 = Seq(("data", None: Option[TestData])).toDF("col1", "col2") + checkAnswer(df2.select(myUdf(Column("col2"))), Row(null) :: Nil) + } + + test("more input fields than expect for case class") { + val f = (t: TestData2) => t.a * t.b + val myUdf = udf(f) + val df = spark.range(1) + .select(lit(50).as("a"), lit(2).as("b"), lit(2).as("c")) + .select(struct("a", "b", "c").as("col")) + checkAnswer(df.select(myUdf(Column("col"))), Row(100) :: Nil) + } + + test("less input fields than expect for case class") { + val f = (t: TestData2) => t.a * t.b + val myUdf = udf(f) + val df = spark.range(1) + .select(lit(50).as("a")) + .select(struct("a").as("col")) + val error = intercept[AnalysisException](df.select(myUdf(Column("col")))) + assert(error.getMessage.contains("cannot resolve 'b' given input columns: [a]")) + } + + test("wrong order of input fields for case class") { + val f = (t: TestData) => t.key * t.value.toInt + val myUdf = udf(f) + val df = spark.range(1) + .select(lit("2").as("value"), lit(50).as("key")) + .select(struct("value", "key").as("col")) + checkAnswer(df.select(myUdf(Column("col"))), Row(100) :: Nil) + } + + test("top level Option primitive type") { + val f = (i: Option[Int]) => i.map(_ * 10) + val myUdf = udf(f) + val df = Seq(Some(10), None).toDF("col") + checkAnswer(df.select(myUdf(Column("col"))), Row(100) :: Row(null) :: Nil) + } + + test("array Option") { + val f = (i: Array[Option[TestData]]) => + i.map(_.map(t => t.key * t.value.toInt).getOrElse(0)).sum + val myUdf = udf(f) + val df = Seq(Array(Some(TestData(50, "2")), None)).toDF("col") + checkAnswer(df.select(myUdf(Column("col"))), Row(100) :: Nil) + } + + object MalformedClassObject extends Serializable { + class MalformedNonPrimitiveFunction extends (String => Int) with Serializable { + override def apply(v1: String): Int = v1.toInt / 0 + } + + class MalformedPrimitiveFunction extends (Int => Int) with Serializable { + override def apply(v1: Int): Int = v1 / 0 + } + } + + test("SPARK-32238: Use Utils.getSimpleName to avoid hitting Malformed class name") { + OuterScopes.addOuterScope(MalformedClassObject) + val f1 = new MalformedClassObject.MalformedNonPrimitiveFunction() + val f2 = new MalformedClassObject.MalformedPrimitiveFunction() + + val e1 = intercept[SparkException] { + Seq("20").toDF("col").select(udf(f1).apply(Column("col"))).collect() + } + assert(e1.getMessage.contains("UDFSuite$MalformedClassObject$MalformedNonPrimitiveFunction")) + + val e2 = intercept[SparkException] { + Seq(20).toDF("col").select(udf(f2).apply(Column("col"))).collect() + } + assert(e2.getMessage.contains("UDFSuite$MalformedClassObject$MalformedPrimitiveFunction")) + } + + test("SPARK-32307: Aggregation that use map type input UDF as group expression") { + spark.udf.register("key", udf((m: Map[String, String]) => m.keys.head.toInt)) + Seq(Map("1" -> "one", "2" -> "two")).toDF("a").createOrReplaceTempView("t") + checkAnswer(sql("SELECT key(a) AS k FROM t GROUP BY key(a)"), Row(1) :: Nil) + } + + test("SPARK-32307: Aggregation that use array type input UDF as group expression") { + spark.udf.register("key", udf((m: Array[Int]) => m.head)) + Seq(Array(1)).toDF("a").createOrReplaceTempView("t") + checkAnswer(sql("SELECT key(a) AS k FROM t GROUP BY key(a)"), Row(1) :: Nil) + } + + test("SPARK-32459: UDF should not fail on WrappedArray") { + val myUdf = udf((a: WrappedArray[Int]) => + WrappedArray.make[Int](Array(a.head + 99))) + checkAnswer(Seq(Array(1)) + .toDF("col") + .select(myUdf(Column("col"))), + Row(ArrayBuffer(100))) + } + + test("SPARK-34388: UDF name is propagated with registration for ScalaUDF") { + spark.udf.register("udf34388", udf((value: Int) => value > 2)) + spark.sessionState.catalog.lookupFunction( + FunctionIdentifier("udf34388"), Seq(Literal(1))) match { + case udf: ScalaUDF => assert(udf.name === "udf34388") + } + } + + test("SPARK-34388: UDF name is propagated with registration for ScalaAggregator") { + val agg = new Aggregator[Long, Long, Long] { + override def zero: Long = 0L + override def reduce(b: Long, a: Long): Long = a + b + override def merge(b1: Long, b2: Long): Long = b1 + b2 + override def finish(reduction: Long): Long = reduction + override def bufferEncoder: Encoder[Long] = ExpressionEncoder[Long]() + override def outputEncoder: Encoder[Long] = ExpressionEncoder[Long]() + } + + spark.udf.register("agg34388", udaf(agg)) + spark.sessionState.catalog.lookupFunction( + FunctionIdentifier("agg34388"), Seq(Literal(1))) match { + case agg: ScalaAggregator[_, _, _] => assert(agg.name === "agg34388") + } + } + + test("SPARK-34388: UDF name is propagated with registration for ScalaUDAF") { + val udaf = new UserDefinedAggregateFunction { + def inputSchema: StructType = new StructType().add("a", LongType) + def bufferSchema: StructType = new StructType().add("product", LongType) + def dataType: DataType = LongType + def deterministic: Boolean = true + def initialize(buffer: MutableAggregationBuffer): Unit = {} + def update(buffer: MutableAggregationBuffer, input: Row): Unit = {} + def merge(buffer1: MutableAggregationBuffer, buffer2: Row): Unit = {} + def evaluate(buffer: Row): Any = buffer.getLong(0) + } + spark.udf.register("udaf34388", udaf) + spark.sessionState.catalog.lookupFunction( + FunctionIdentifier("udaf34388"), Seq(Literal(1))) match { + case udaf: ScalaUDAF => assert(udaf.name === "udaf34388") + } + } + + test("SPARK-34663: using java.time.Duration in UDF") { + // Regular case + val input = Seq(java.time.Duration.ofHours(23)).toDF("d") + val plusHour = udf((d: java.time.Duration) => d.plusHours(1)) + val result = input.select(plusHour($"d").as("new_d")) + checkAnswer(result, Row(java.time.Duration.ofDays(1)) :: Nil) + assert(result.schema === new StructType().add("new_d", DayTimeIntervalType)) + // UDF produces `null` + val nullFunc = udf((_: java.time.Duration) => null.asInstanceOf[java.time.Duration]) + val nullResult = input.select(nullFunc($"d").as("null_d")) + checkAnswer(nullResult, Row(null) :: Nil) + assert(nullResult.schema === new StructType().add("null_d", DayTimeIntervalType)) + // Input parameter of UDF is null + val nullInput = Seq(null.asInstanceOf[java.time.Duration]).toDF("null_d") + val constDuration = udf((_: java.time.Duration) => java.time.Duration.ofMinutes(10)) + val constResult = nullInput.select(constDuration($"null_d").as("10_min")) + checkAnswer(constResult, Row(java.time.Duration.ofMinutes(10)) :: Nil) + assert(constResult.schema === new StructType().add("10_min", DayTimeIntervalType)) + // Error in the conversion of UDF result to the internal representation of day-time interval + val overflowFunc = udf((d: java.time.Duration) => d.plusDays(Long.MaxValue)) + val e = intercept[SparkException] { + input.select(overflowFunc($"d")).collect() + }.getCause.getCause + assert(e.isInstanceOf[java.lang.ArithmeticException]) + } + + test("SPARK-34663: using java.time.Period in UDF") { + // Regular case + val input = Seq(java.time.Period.ofMonths(11)).toDF("p") + val incMonth = udf((p: java.time.Period) => p.plusMonths(1)) + val result = input.select(incMonth($"p").as("new_p")) + checkAnswer(result, Row(java.time.Period.ofYears(1)) :: Nil) + assert(result.schema === new StructType().add("new_p", YearMonthIntervalType)) + // UDF produces `null` + val nullFunc = udf((_: java.time.Period) => null.asInstanceOf[java.time.Period]) + val nullResult = input.select(nullFunc($"p").as("null_p")) + checkAnswer(nullResult, Row(null) :: Nil) + assert(nullResult.schema === new StructType().add("null_p", YearMonthIntervalType)) + // Input parameter of UDF is null + val nullInput = Seq(null.asInstanceOf[java.time.Period]).toDF("null_p") + val constPeriod = udf((_: java.time.Period) => java.time.Period.ofYears(10)) + val constResult = nullInput.select(constPeriod($"null_p").as("10_years")) + checkAnswer(constResult, Row(java.time.Period.ofYears(10)) :: Nil) + assert(constResult.schema === new StructType().add("10_years", YearMonthIntervalType)) + // Error in the conversion of UDF result to the internal representation of year-month interval + val overflowFunc = udf((p: java.time.Period) => p.plusYears(Long.MaxValue)) + val e = intercept[SparkException] { + input.select(overflowFunc($"p")).collect() + }.getCause.getCause + assert(e.isInstanceOf[java.lang.ArithmeticException]) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/UnsafeRowSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/UnsafeRowSuite.scala index a5f904c621e6e..9daa69ce9f155 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/UnsafeRowSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/UnsafeRowSuite.scala @@ -178,4 +178,14 @@ class UnsafeRowSuite extends SparkFunSuite { // Makes sure hashCode on unsafe array won't crash unsafeRow.getArray(0).hashCode() } + + test("SPARK-32018: setDecimal with overflowed value") { + val d1 = new Decimal().set(BigDecimal("10000000000000000000")).toPrecision(38, 18) + val row = InternalRow.apply(d1) + val unsafeRow = UnsafeProjection.create(Array[DataType](DecimalType(38, 18))).apply(row) + assert(unsafeRow.getDecimal(0, 38, 18) === d1) + val d2 = (d1 * Decimal(10)).toPrecision(39, 18) + unsafeRow.setDecimal(0, d2, 38) + assert(unsafeRow.getDecimal(0, 38, 18) === null) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/UnwrapCastInComparisonEndToEndSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/UnwrapCastInComparisonEndToEndSuite.scala new file mode 100644 index 0000000000000..e6f0426428bd4 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/UnwrapCastInComparisonEndToEndSuite.scala @@ -0,0 +1,194 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import org.apache.spark.sql.catalyst.expressions.IntegralLiteralTestUtils.{negativeInt, positiveInt} +import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types.Decimal + +class UnwrapCastInComparisonEndToEndSuite extends QueryTest with SharedSparkSession { + import testImplicits._ + + val t = "test_table" + + test("cases when literal is max") { + withTable(t) { + Seq[(Integer, java.lang.Short, java.lang.Float)]( + (1, 100.toShort, 3.14.toFloat), + (2, Short.MaxValue, Float.NaN), + (3, Short.MinValue, Float.PositiveInfinity), + (4, 0.toShort, Float.MaxValue), + (5, null, null)) + .toDF("c1", "c2", "c3").write.saveAsTable(t) + val df = spark.table(t) + + val lit = Short.MaxValue.toInt + checkAnswer(df.where(s"c2 > $lit").select("c1"), Seq.empty) + checkAnswer(df.where(s"c2 >= $lit").select("c1"), Row(2)) + checkAnswer(df.where(s"c2 == $lit").select("c1"), Row(2)) + checkAnswer(df.where(s"c2 <=> $lit").select("c1"), Row(2)) + checkAnswer(df.where(s"c2 != $lit").select("c1"), Row(1) :: Row(3) :: Row(4) :: Nil) + checkAnswer(df.where(s"c2 <= $lit").select("c1"), Row(1) :: Row(2) :: Row(3) :: Row(4) :: Nil) + checkAnswer(df.where(s"c2 < $lit").select("c1"), Row(1) :: Row(3) :: Row(4) :: Nil) + + checkAnswer(df.where(s"c3 > double('nan')").select("c1"), Seq.empty) + checkAnswer(df.where(s"c3 >= double('nan')").select("c1"), Row(2)) + checkAnswer(df.where(s"c3 == double('nan')").select("c1"), Row(2)) + checkAnswer(df.where(s"c3 <=> double('nan')").select("c1"), Row(2)) + checkAnswer(df.where(s"c3 != double('nan')").select("c1"), Row(1) :: Row(3) :: Row(4) :: Nil) + checkAnswer(df.where(s"c3 <= double('nan')").select("c1"), + Row(1) :: Row(2) :: Row(3) :: Row(4) :: Nil) + checkAnswer(df.where(s"c3 < double('nan')").select("c1"), Row(1) :: Row(3) :: Row(4) :: Nil) + } + } + + test("cases when literal is > max") { + withTable(t) { + Seq[(Integer, java.lang.Short)]( + (1, 100.toShort), + (2, Short.MaxValue), + (3, null)) + .toDF("c1", "c2").write.saveAsTable(t) + val df = spark.table(t) + val lit = positiveInt + checkAnswer(df.where(s"c2 > $lit").select("c1"), Seq.empty) + checkAnswer(df.where(s"c2 >= $lit").select("c1"), Seq.empty) + checkAnswer(df.where(s"c2 == $lit").select("c1"), Seq.empty) + checkAnswer(df.where(s"c2 <=> $lit").select("c1"), Seq.empty) + checkAnswer(df.where(s"c2 != $lit").select("c1"), Row(1) :: Row(2) :: Nil) + checkAnswer(df.where(s"c2 <= $lit").select("c1"), Row(1) :: Row(2) :: Nil) + checkAnswer(df.where(s"c2 < $lit").select("c1"), Row(1) :: Row(2) :: Nil) + + // No test for float case since NaN is greater than any other numeric value + } + } + + test("cases when literal is min") { + withTable(t) { + Seq[(Integer, java.lang.Short, java.lang.Float)]( + (1, 100.toShort, 3.14.toFloat), + (2, Short.MinValue, Float.NegativeInfinity), + (3, Short.MaxValue, Float.MinValue), + (4, null, null)) + .toDF("c1", "c2", "c3").write.saveAsTable(t) + val df = spark.table(t) + + val lit = Short.MinValue.toInt + checkAnswer(df.where(s"c2 > $lit").select("c1"), Row(1) :: Row(3) :: Nil) + checkAnswer(df.where(s"c2 >= $lit").select("c1"), Row(1) :: Row(2) :: Row(3) :: Nil) + checkAnswer(df.where(s"c2 == $lit").select("c1"), Row(2)) + checkAnswer(df.where(s"c2 <=> $lit").select("c1"), Row(2)) + checkAnswer(df.where(s"c2 != $lit").select("c1"), Row(1) :: Row(3) :: Nil) + checkAnswer(df.where(s"c2 <= $lit").select("c1"), Row(2)) + checkAnswer(df.where(s"c2 < $lit").select("c1"), Seq.empty) + + checkAnswer(df.where(s"c3 > double('-inf')").select("c1"), Row(1) :: Row(3) :: Nil) + checkAnswer(df.where(s"c3 >= double('-inf')").select("c1"), Row(1) :: Row(2) :: Row(3) :: Nil) + checkAnswer(df.where(s"c3 == double('-inf')").select("c1"), Row(2)) + checkAnswer(df.where(s"c3 <=> double('-inf')").select("c1"), Row(2)) + checkAnswer(df.where(s"c3 != double('-inf')").select("c1"), Row(1) :: Row(3) :: Nil) + checkAnswer(df.where(s"c3 <= double('-inf')").select("c1"), Row(2) :: Nil) + checkAnswer(df.where(s"c3 < double('-inf')").select("c1"), Seq.empty) + } + } + + test("cases when literal is < min") { + val t = "test_table" + withTable(t) { + Seq[(Integer, java.lang.Short)]( + (1, 100.toShort), + (2, Short.MinValue), + (3, null)) + .toDF("c1", "c2").write.saveAsTable(t) + val df = spark.table(t) + + val lit = negativeInt + checkAnswer(df.where(s"c2 > $lit").select("c1"), Row(1) :: Row(2) :: Nil) + checkAnswer(df.where(s"c2 >= $lit").select("c1"), Row(1) :: Row(2) :: Nil) + checkAnswer(df.where(s"c2 == $lit").select("c1"), Seq.empty) + checkAnswer(df.where(s"c2 <=> $lit").select("c1"), Seq.empty) + checkAnswer(df.where(s"c2 != $lit").select("c1"), Row(1) :: Row(2) :: Nil) + checkAnswer(df.where(s"c2 <= $lit").select("c1"), Seq.empty) + checkAnswer(df.where(s"c2 < $lit").select("c1"), Seq.empty) + } + } + + test("cases when literal is within range (min, max)") { + withTable(t) { + Seq((1, 300.toShort), (2, 500.toShort)).toDF("c1", "c2").write.saveAsTable(t) + val df = spark.table(t) + + checkAnswer(df.where("c2 < 200").select("c1"), Seq.empty) + checkAnswer(df.where("c2 < 400").select("c1"), Row(1) :: Nil) + checkAnswer(df.where("c2 < 600").select("c1"), Row(1) :: Row(2) :: Nil) + + checkAnswer(df.where("c2 <= 100").select("c1"), Seq.empty) + checkAnswer(df.where("c2 <= 300").select("c1"), Row(1) :: Nil) + checkAnswer(df.where("c2 <= 500").select("c1"), Row(1) :: Row(2) :: Nil) + + checkAnswer(df.where("c2 == 100").select("c1"), Seq.empty) + checkAnswer(df.where("c2 == 300").select("c1"), Row(1) :: Nil) + checkAnswer(df.where("c2 == 500").select("c1"), Row(2) :: Nil) + + checkAnswer(df.where("c2 <=> 100").select("c1"), Seq.empty) + checkAnswer(df.where("c2 <=> 300").select("c1"), Row(1) :: Nil) + checkAnswer(df.where("c2 <=> 500").select("c1"), Row(2) :: Nil) + checkAnswer(df.where("c2 <=> null").select("c1"), Seq.empty) + + checkAnswer(df.where("c2 >= 200").select("c1"), Row(1) :: Row(2) :: Nil) + checkAnswer(df.where("c2 >= 400").select("c1"), Row(2) :: Nil) + checkAnswer(df.where("c2 >= 600").select("c1"), Seq.empty) + + checkAnswer(df.where("c2 > 100").select("c1"), Row(1) :: Row(2) :: Nil) + checkAnswer(df.where("c2 > 300").select("c1"), Row(2) :: Nil) + checkAnswer(df.where("c2 > 500").select("c1"), Seq.empty) + } + } + + test("cases when literal is within range (min, max) and has rounding up or down") { + withTable(t) { + Seq((1, 100, 3.14.toFloat, decimal(200.12))) + .toDF("c1", "c2", "c3", "c4").write.saveAsTable(t) + val df = spark.table(t) + + checkAnswer(df.where("c2 > 99.6").select("c1"), Row(1)) + checkAnswer(df.where("c2 > 100.4").select("c1"), Seq.empty) + checkAnswer(df.where("c2 == 100.4").select("c1"), Seq.empty) + checkAnswer(df.where("c2 <=> 100.4").select("c1"), Seq.empty) + checkAnswer(df.where("c2 < 99.6").select("c1"), Seq.empty) + checkAnswer(df.where("c2 < 100.4").select("c1"), Row(1)) + + checkAnswer(df.where("c3 >= 3.14").select("c1"), Row(1)) + // float(3.14) is casted to double(3.140000104904175) + checkAnswer(df.where("c3 >= 3.14000010").select("c1"), Row(1)) + checkAnswer(df.where("c3 == 3.14").select("c1"), Seq.empty) + checkAnswer(df.where("c3 <=> 3.14").select("c1"), Seq.empty) + checkAnswer(df.where("c3 < 3.14000010").select("c1"), Seq.empty) + checkAnswer(df.where("c3 <= 3.14").select("c1"), Seq.empty) + + checkAnswer(df.where("c4 > cast(200.1199 as decimal(10, 4))").select("c1"), Row(1)) + checkAnswer(df.where("c4 >= cast(200.1201 as decimal(10, 4))").select("c1"), Seq.empty) + checkAnswer(df.where("c4 == cast(200.1156 as decimal(10, 4))").select("c1"), Seq.empty) + checkAnswer(df.where("c4 <=> cast(200.1201 as decimal(10, 4))").select("c1"), Seq.empty) + checkAnswer(df.where("c4 <= cast(200.1201 as decimal(10, 4))").select("c1"), Row(1)) + checkAnswer(df.where("c4 < cast(200.1159 as decimal(10, 4))").select("c1"), Seq.empty) + } + } + + private def decimal(v: BigDecimal): Decimal = Decimal(v, 5, 2) +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/UpdateFieldsBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/UpdateFieldsBenchmark.scala new file mode 100644 index 0000000000000..13221c9c79c86 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/UpdateFieldsBenchmark.scala @@ -0,0 +1,225 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import org.apache.spark.benchmark.Benchmark +import org.apache.spark.sql.execution.benchmark.SqlBasedBenchmark +import org.apache.spark.sql.functions.{col, lit} +import org.apache.spark.sql.types.{IntegerType, StructField, StructType} + +/** + * Benchmark to measure Spark's performance analyzing and optimizing long UpdateFields chains. + * + * {{{ + * To run this benchmark: + * 1. without sbt: + * bin/spark-submit --class + * --jars , + * 2. with sbt: + * build/sbt "sql/test:runMain " + * 3. generate result: + * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " + * Results will be written to "benchmarks/UpdateFieldsBenchmark-results.txt". + * }}} + */ +object UpdateFieldsBenchmark extends SqlBasedBenchmark { + + def nestedColName(d: Int, colNum: Int): String = s"nested${d}Col$colNum" + + def nestedStructType( + colNums: Seq[Int], + nullable: Boolean, + maxDepth: Int, + currDepth: Int = 1): StructType = { + + if (currDepth == maxDepth) { + val fields = colNums.map { colNum => + val name = nestedColName(currDepth, colNum) + StructField(name, IntegerType, nullable = false) + } + StructType(fields) + } else { + val fields = colNums.foldLeft(Seq.empty[StructField]) { + case (structFields, colNum) if colNum == 0 => + val nested = nestedStructType(colNums, nullable, maxDepth, currDepth + 1) + structFields :+ StructField(nestedColName(currDepth, colNum), nested, nullable) + case (structFields, colNum) => + val name = nestedColName(currDepth, colNum) + structFields :+ StructField(name, IntegerType, nullable = false) + } + StructType(fields) + } + } + + /** + * Utility function for generating an empty DataFrame with nested columns. + * + * @param maxDepth: The depth to which to create nested columns. + * @param numColsAtEachDepth: The number of columns to create at each depth. + * @param nullable: This value is used to set the nullability of any StructType columns. + */ + def emptyNestedDf(maxDepth: Int, numColsAtEachDepth: Int, nullable: Boolean): DataFrame = { + require(maxDepth > 0) + require(numColsAtEachDepth > 0) + + val nestedColumnDataType = nestedStructType(0 until numColsAtEachDepth, nullable, maxDepth) + spark.createDataFrame( + spark.sparkContext.emptyRDD[Row], + StructType(Seq(StructField(nestedColName(0, 0), nestedColumnDataType, nullable)))) + } + + trait ModifyNestedColumns { + val name: String + def apply(column: Column, numsToAdd: Seq[Int], numsToDrop: Seq[Int], maxDepth: Int): Column + } + + object Performant extends ModifyNestedColumns { + override val name: String = "performant" + + override def apply( + column: Column, + numsToAdd: Seq[Int], + numsToDrop: Seq[Int], + maxDepth: Int): Column = helper(column, numsToAdd, numsToDrop, maxDepth, 1) + + private def helper( + column: Column, + numsToAdd: Seq[Int], + numsToDrop: Seq[Int], + maxDepth: Int, + currDepth: Int): Column = { + + // drop columns at the current depth + val dropped = if (numsToDrop.nonEmpty) { + column.dropFields(numsToDrop.map(num => nestedColName(currDepth, num)): _*) + } else column + + // add columns at the current depth + val added = numsToAdd.foldLeft(dropped) { + (res, num) => res.withField(nestedColName(currDepth, num), lit(num)) + } + + if (currDepth == maxDepth) { + added + } else { + // add/drop columns at the next depth + val newValue = helper( + column = col((0 to currDepth).map(d => nestedColName(d, 0)).mkString(".")), + numsToAdd = numsToAdd, + numsToDrop = numsToDrop, + currDepth = currDepth + 1, + maxDepth = maxDepth) + added.withField(nestedColName(currDepth, 0), newValue) + } + } + } + + object NonPerformant extends ModifyNestedColumns { + override val name: String = "non-performant" + + override def apply( + column: Column, + numsToAdd: Seq[Int], + numsToDrop: Seq[Int], + maxDepth: Int): Column = { + + val dropped = if (numsToDrop.nonEmpty) { + val colsToDrop = (1 to maxDepth).flatMap { depth => + numsToDrop.map(num => s"${prefix(depth)}${nestedColName(depth, num)}") + } + column.dropFields(colsToDrop: _*) + } else column + + val added = { + val colsToAdd = (1 to maxDepth).flatMap { depth => + numsToAdd.map(num => (s"${prefix(depth)}${nestedColName(depth, num)}", lit(num))) + } + colsToAdd.foldLeft(dropped)((col, add) => col.withField(add._1, add._2)) + } + + added + } + + private def prefix(depth: Int): String = + if (depth == 1) "" + else (1 until depth).map(d => nestedColName(d, 0)).mkString("", ".", ".") + } + + private def updateFieldsBenchmark( + methods: Seq[ModifyNestedColumns], + maxDepth: Int, + initialNumberOfColumns: Int, + numsToAdd: Seq[Int] = Seq.empty, + numsToDrop: Seq[Int] = Seq.empty): Unit = { + + val name = s"Add ${numsToAdd.length} columns and drop ${numsToDrop.length} columns " + + s"at $maxDepth different depths of nesting" + + runBenchmark(name) { + val benchmark = new Benchmark( + name = name, + // The purpose of this benchmark is to ensure Spark is able to analyze and optimize long + // UpdateFields chains quickly so it runs over 0 rows of data. + valuesPerIteration = 0, + output = output) + + val nonNullableStructsDf = emptyNestedDf(maxDepth, initialNumberOfColumns, nullable = false) + val nullableStructsDf = emptyNestedDf(maxDepth, initialNumberOfColumns, nullable = true) + + methods.foreach { method => + val modifiedColumn = method( + column = col(nestedColName(0, 0)), + numsToAdd = numsToAdd, + numsToDrop = numsToDrop, + maxDepth = maxDepth + ).as(nestedColName(0, 0)) + + benchmark.addCase(s"To non-nullable StructTypes using ${method.name} method") { _ => + nonNullableStructsDf.select(modifiedColumn).queryExecution.optimizedPlan + } + + benchmark.addCase(s"To nullable StructTypes using ${method.name} method") { _ => + nullableStructsDf.select(modifiedColumn).queryExecution.optimizedPlan + } + } + + benchmark.run() + } + } + + override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { + // This benchmark compares the performant and non-performant methods of writing the same query. + // We use small values for maxDepth, numsToAdd, and numsToDrop because the NonPerformant method + // scales extremely poorly with the number of nested columns being added/dropped. + updateFieldsBenchmark( + methods = Seq(Performant, NonPerformant), + maxDepth = 3, + initialNumberOfColumns = 5, + numsToAdd = 5 to 6, + numsToDrop = 3 to 4) + + // This benchmark is to show that the performant method of writing a query when we want to add + // and drop a large number of nested columns scales nicely. + updateFieldsBenchmark( + methods = Seq(Performant), + maxDepth = 100, + initialNumberOfColumns = 51, + numsToAdd = 51 to 100, + numsToDrop = 1 to 50) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/UserDefinedTypeSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/UserDefinedTypeSuite.scala index ed8ab1cb3a603..b6ab60a91955d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/UserDefinedTypeSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/UserDefinedTypeSuite.scala @@ -21,8 +21,8 @@ import java.time.{LocalDateTime, ZoneOffset} import java.util.Arrays import org.apache.spark.rdd.RDD -import org.apache.spark.sql.catalyst.{CatalystTypeConverters, InternalRow} -import org.apache.spark.sql.catalyst.expressions.{Cast, ExpressionEvalHelper, GenericInternalRow, Literal} +import org.apache.spark.sql.catalyst.CatalystTypeConverters +import org.apache.spark.sql.catalyst.expressions.{Cast, ExpressionEvalHelper, Literal} import org.apache.spark.sql.execution.datasources.parquet.ParquetTest import org.apache.spark.sql.functions._ import org.apache.spark.sql.test.SharedSparkSession @@ -33,77 +33,6 @@ private[sql] case class MyLabeledPoint(label: Double, features: TestUDT.MyDenseV def getFeatures: TestUDT.MyDenseVector = features } -// object and classes to test SPARK-19311 - -// Trait/Interface for base type -sealed trait IExampleBaseType extends Serializable { - def field: Int -} - -// Trait/Interface for derived type -sealed trait IExampleSubType extends IExampleBaseType - -// a base class -class ExampleBaseClass(override val field: Int) extends IExampleBaseType - -// a derived class -class ExampleSubClass(override val field: Int) - extends ExampleBaseClass(field) with IExampleSubType - -// UDT for base class -class ExampleBaseTypeUDT extends UserDefinedType[IExampleBaseType] { - - override def sqlType: StructType = { - StructType(Seq( - StructField("intfield", IntegerType, nullable = false))) - } - - override def serialize(obj: IExampleBaseType): InternalRow = { - val row = new GenericInternalRow(1) - row.setInt(0, obj.field) - row - } - - override def deserialize(datum: Any): IExampleBaseType = { - datum match { - case row: InternalRow => - require(row.numFields == 1, - "ExampleBaseTypeUDT requires row with length == 1") - val field = row.getInt(0) - new ExampleBaseClass(field) - } - } - - override def userClass: Class[IExampleBaseType] = classOf[IExampleBaseType] -} - -// UDT for derived class -private[spark] class ExampleSubTypeUDT extends UserDefinedType[IExampleSubType] { - - override def sqlType: StructType = { - StructType(Seq( - StructField("intfield", IntegerType, nullable = false))) - } - - override def serialize(obj: IExampleSubType): InternalRow = { - val row = new GenericInternalRow(1) - row.setInt(0, obj.field) - row - } - - override def deserialize(datum: Any): IExampleSubType = { - datum match { - case row: InternalRow => - require(row.numFields == 1, - "ExampleSubTypeUDT requires row with length == 1") - val field = row.getInt(0) - new ExampleSubClass(field) - } - } - - override def userClass: Class[IExampleSubType] = classOf[IExampleSubType] -} - private[sql] case class FooWithDate(date: LocalDateTime, s: String, i: Int) private[sql] class LocalDateTimeUDT extends UserDefinedType[LocalDateTime] { @@ -134,6 +63,24 @@ class UserDefinedTypeSuite extends QueryTest with SharedSparkSession with Parque MyLabeledPoint(1.0, new TestUDT.MyDenseVector(Array(0.1, 1.0))), MyLabeledPoint(0.0, new TestUDT.MyDenseVector(Array(0.3, 3.0)))).toDF() + + test("SPARK-32090: equal") { + val udt1 = new ExampleBaseTypeUDT + val udt2 = new ExampleSubTypeUDT + val udt3 = new ExampleSubTypeUDT + assert(udt1 !== udt2) + assert(udt2 !== udt1) + assert(udt2 === udt3) + assert(udt3 === udt2) + } + + test("SPARK-32090: acceptsType") { + val udt1 = new ExampleBaseTypeUDT + val udt2 = new ExampleSubTypeUDT + assert(udt1.acceptsType(udt2)) + assert(!udt2.acceptsType(udt1)) + } + test("register user type: MyDenseVector for MyLabeledPoint") { val labels: RDD[Double] = pointsRDD.select('label).rdd.map { case Row(v: Double) => v } val labelsArrays: Array[Double] = labels.collect() @@ -275,11 +222,11 @@ class UserDefinedTypeSuite extends QueryTest with SharedSparkSession with Parque // this worked already before the fix SPARK-19311: // return type of doUDF equals parameter type of doOtherUDF - sql("SELECT doOtherUDF(doUDF(41))") + checkAnswer(sql("SELECT doOtherUDF(doUDF(41))"), Row(41) :: Nil) // this one passes only with the fix SPARK-19311: // return type of doSubUDF is a subtype of the parameter type of doOtherUDF - sql("SELECT doOtherUDF(doSubTypeUDF(42))") + checkAnswer(sql("SELECT doOtherUDF(doSubTypeUDF(42))"), Row(42) :: Nil) } test("except on UDT") { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSessionCatalogSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSessionCatalogSuite.scala index 6b25d7c61663c..91ac7db335cc3 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSessionCatalogSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSessionCatalogSuite.scala @@ -23,14 +23,14 @@ import org.scalatest.BeforeAndAfter import org.apache.spark.sql.{DataFrame, QueryTest, SaveMode} import org.apache.spark.sql.catalyst.TableIdentifier -import org.apache.spark.sql.catalyst.analysis.{NoSuchTableException, TableAlreadyExistsException} +import org.apache.spark.sql.catalyst.analysis.TableAlreadyExistsException import org.apache.spark.sql.connector.catalog._ import org.apache.spark.sql.connector.catalog.CatalogManager.SESSION_CATALOG_NAME import org.apache.spark.sql.connector.expressions.Transform +import org.apache.spark.sql.errors.QueryCompilationErrors import org.apache.spark.sql.internal.SQLConf.V2_SESSION_CATALOG_IMPLEMENTATION import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types.StructType -import org.apache.spark.sql.util.CaseInsensitiveStringMap class DataSourceV2DataFrameSessionCatalogSuite extends InsertIntoTests(supportsDynamicOverwrite = true, includeSQLOnlyTests = false) @@ -126,7 +126,7 @@ class InMemoryTableSessionCatalog extends TestV2SessionCatalogBase[InMemoryTable newTable case _ => - throw new NoSuchTableException(ident) + throw QueryCompilationErrors.noSuchTableError(ident) } } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala index 7c7afa9cfbd41..d83d1a2755928 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2DataFrameSuite.scala @@ -22,8 +22,9 @@ import java.util.Collections import org.apache.spark.sql.{AnalysisException, DataFrame, Row, SaveMode} import org.apache.spark.sql.catalyst.analysis.TableAlreadyExistsException import org.apache.spark.sql.catalyst.plans.logical.{AppendData, LogicalPlan} -import org.apache.spark.sql.connector.catalog.Identifier +import org.apache.spark.sql.connector.catalog.{Identifier, InMemoryTableCatalog} import org.apache.spark.sql.execution.QueryExecution +import org.apache.spark.sql.execution.datasources.v2.DataSourceV2Relation import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.QueryExecutionListener @@ -186,4 +187,21 @@ class DataSourceV2DataFrameSuite assert(e3.getMessage.contains(s"Cannot use interval type in the table schema.")) } } + + test("options to scan v2 table should be passed to DataSourceV2Relation") { + val t1 = "testcat.ns1.ns2.tbl" + withTable(t1) { + val df1 = Seq((1L, "a"), (2L, "b"), (3L, "c")).toDF("id", "data") + df1.write.saveAsTable(t1) + + val optionName = "fakeOption" + val df2 = spark.read + .option(optionName, false) + .table(t1) + val options = df2.queryExecution.analyzed.collectFirst { + case d: DataSourceV2Relation => d.options + }.get + assert(options.get(optionName) === "false") + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2FunctionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2FunctionSuite.scala new file mode 100644 index 0000000000000..b269da39daf38 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2FunctionSuite.scala @@ -0,0 +1,442 @@ +/* + * 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. + */ + +package org.apache.spark.sql.connector + +import java.util +import java.util.Collections + +import test.org.apache.spark.sql.connector.catalog.functions.{JavaAverage, JavaStrLen} +import test.org.apache.spark.sql.connector.catalog.functions.JavaStrLen._ + +import org.apache.spark.SparkException +import org.apache.spark.sql.{AnalysisException, Row} +import org.apache.spark.sql.catalyst.InternalRow +import org.apache.spark.sql.connector.catalog.{BasicInMemoryTableCatalog, Identifier, InMemoryCatalog, SupportsNamespaces} +import org.apache.spark.sql.connector.catalog.functions._ +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.types._ +import org.apache.spark.unsafe.types.UTF8String + +class DataSourceV2FunctionSuite extends DatasourceV2SQLBase { + private val emptyProps: util.Map[String, String] = Collections.emptyMap[String, String] + + private def addFunction(ident: Identifier, fn: UnboundFunction): Unit = { + catalog("testcat").asInstanceOf[InMemoryCatalog].createFunction(ident, fn) + } + + test("undefined function") { + assert(intercept[AnalysisException]( + sql("SELECT testcat.non_exist('abc')").collect() + ).getMessage.contains("Undefined function")) + } + + test("non-function catalog") { + withSQLConf("spark.sql.catalog.testcat" -> classOf[BasicInMemoryTableCatalog].getName) { + assert(intercept[AnalysisException]( + sql("SELECT testcat.strlen('abc')").collect() + ).getMessage.contains("is not a FunctionCatalog")) + } + } + + test("built-in with non-function catalog should still work") { + withSQLConf(SQLConf.DEFAULT_CATALOG.key -> "testcat", + "spark.sql.catalog.testcat" -> classOf[BasicInMemoryTableCatalog].getName) { + checkAnswer(sql("SELECT length('abc')"), Row(3)) + } + } + + test("built-in with default v2 function catalog") { + withSQLConf(SQLConf.DEFAULT_CATALOG.key -> "testcat") { + checkAnswer(sql("SELECT length('abc')"), Row(3)) + } + } + + test("looking up higher-order function with non-session catalog") { + checkAnswer(sql("SELECT transform(array(1, 2, 3), x -> x + 1)"), + Row(Array(2, 3, 4)) :: Nil) + } + + test("built-in override with default v2 function catalog") { + // a built-in function with the same name should take higher priority + withSQLConf(SQLConf.DEFAULT_CATALOG.key -> "testcat") { + addFunction(Identifier.of(Array.empty, "length"), new JavaStrLen(new JavaStrLenNoImpl)) + checkAnswer(sql("SELECT length('abc')"), Row(3)) + } + } + + test("built-in override with non-session catalog") { + addFunction(Identifier.of(Array.empty, "length"), new JavaStrLen(new JavaStrLenNoImpl)) + checkAnswer(sql("SELECT length('abc')"), Row(3)) + } + + test("temp function override with default v2 function catalog") { + val className = "test.org.apache.spark.sql.JavaStringLength" + sql(s"CREATE FUNCTION length AS '$className'") + + withSQLConf(SQLConf.DEFAULT_CATALOG.key -> "testcat") { + addFunction(Identifier.of(Array.empty, "length"), new JavaStrLen(new JavaStrLenNoImpl)) + checkAnswer(sql("SELECT length('abc')"), Row(3)) + } + } + + test("view should use captured catalog and namespace for function lookup") { + val viewName = "my_view" + withView(viewName) { + withSQLConf(SQLConf.DEFAULT_CATALOG.key -> "testcat") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "my_avg"), IntegralAverage) + sql("USE ns") + sql(s"CREATE TEMPORARY VIEW $viewName AS SELECT my_avg(col1) FROM values (1), (2), (3)") + } + + // change default catalog and namespace and add a function with the same name but with no + // implementation + withSQLConf(SQLConf.DEFAULT_CATALOG.key -> "testcat2") { + catalog("testcat2").asInstanceOf[SupportsNamespaces] + .createNamespace(Array("ns2"), emptyProps) + addFunction(Identifier.of(Array("ns2"), "my_avg"), NoImplAverage) + sql("USE ns2") + checkAnswer(sql(s"SELECT * FROM $viewName"), Row(2.0) :: Nil) + } + } + } + + test("scalar function: with default produceResult method") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), StrLen(StrLenDefault)) + checkAnswer(sql("SELECT testcat.ns.strlen('abc')"), Row(3) :: Nil) + } + + test("scalar function: with default produceResult method w/ expression") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), StrLen(StrLenDefault)) + checkAnswer(sql("SELECT testcat.ns.strlen(substr('abcde', 3))"), Row(3) :: Nil) + } + + test("scalar function: lookup magic method") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), StrLen(StrLenMagic)) + checkAnswer(sql("SELECT testcat.ns.strlen('abc')"), Row(3) :: Nil) + } + + test("scalar function: lookup magic method w/ expression") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), StrLen(StrLenMagic)) + checkAnswer(sql("SELECT testcat.ns.strlen(substr('abcde', 3))"), Row(3) :: Nil) + } + + test("scalar function: bad magic method") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), StrLen(StrLenBadMagic)) + assert(intercept[SparkException](sql("SELECT testcat.ns.strlen('abc')").collect()) + .getMessage.contains("Cannot find a compatible")) + } + + test("scalar function: bad magic method with default impl") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), StrLen(StrLenBadMagicWithDefault)) + checkAnswer(sql("SELECT testcat.ns.strlen('abc')"), Row(3) :: Nil) + } + + test("scalar function: no implementation found") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), StrLen(StrLenNoImpl)) + intercept[SparkException](sql("SELECT testcat.ns.strlen('abc')").collect()) + } + + test("scalar function: invalid parameter type or length") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), StrLen(StrLenDefault)) + + assert(intercept[AnalysisException](sql("SELECT testcat.ns.strlen(42)")) + .getMessage.contains("Expect StringType")) + assert(intercept[AnalysisException](sql("SELECT testcat.ns.strlen('a', 'b')")) + .getMessage.contains("Expect exactly one argument")) + } + + test("scalar function: default produceResult in Java") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), + new JavaStrLen(new JavaStrLenDefault)) + checkAnswer(sql("SELECT testcat.ns.strlen('abc')"), Row(3) :: Nil) + } + + test("scalar function: magic method in Java") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), + new JavaStrLen(new JavaStrLenMagic)) + checkAnswer(sql("SELECT testcat.ns.strlen('abc')"), Row(3) :: Nil) + } + + test("scalar function: static magic method in Java") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), + new JavaStrLen(new JavaStrLenStaticMagic)) + checkAnswer(sql("SELECT testcat.ns.strlen('abc')"), Row(3) :: Nil) + } + + test("scalar function: magic method should take higher precedence in Java") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), + new JavaStrLen(new JavaStrLenBoth)) + // to differentiate, the static method returns string length + 100 + checkAnswer(sql("SELECT testcat.ns.strlen('abc')"), Row(103) :: Nil) + } + + test("scalar function: bad static magic method should fallback to non-static") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), + new JavaStrLen(new JavaStrLenBadStaticMagic)) + checkAnswer(sql("SELECT testcat.ns.strlen('abc')"), Row(103) :: Nil) + } + + test("scalar function: no implementation found in Java") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), + new JavaStrLen(new JavaStrLenNoImpl)) + assert(intercept[AnalysisException](sql("SELECT testcat.ns.strlen('abc')").collect()) + .getMessage.contains("neither implement magic method nor override 'produceResult'")) + } + + test("bad bound function (neither scalar nor aggregate)") { + catalog("testcat").asInstanceOf[SupportsNamespaces].createNamespace(Array("ns"), emptyProps) + addFunction(Identifier.of(Array("ns"), "strlen"), StrLen(BadBoundFunction)) + + assert(intercept[AnalysisException](sql("SELECT testcat.ns.strlen('abc')")) + .getMessage.contains("does not implement ScalarFunction or AggregateFunction")) + } + + test("aggregate function: lookup int average") { + import testImplicits._ + val t = "testcat.ns.t" + withTable(t) { + addFunction(Identifier.of(Array("ns"), "avg"), IntegralAverage) + + (1 to 100).toDF("i").write.saveAsTable(t) + checkAnswer(sql(s"SELECT testcat.ns.avg(i) from $t"), Row(50) :: Nil) + } + } + + test("aggregate function: lookup long average") { + import testImplicits._ + val t = "testcat.ns.t" + withTable(t) { + addFunction(Identifier.of(Array("ns"), "avg"), IntegralAverage) + + (1L to 100L).toDF("i").write.saveAsTable(t) + checkAnswer(sql(s"SELECT testcat.ns.avg(i) from $t"), Row(50) :: Nil) + } + } + + test("aggregate function: lookup double average in Java") { + import testImplicits._ + val t = "testcat.ns.t" + withTable(t) { + addFunction(Identifier.of(Array("ns"), "avg"), new JavaAverage) + + Seq(1.toDouble, 2.toDouble, 3.toDouble).toDF("i").write.saveAsTable(t) + checkAnswer(sql(s"SELECT testcat.ns.avg(i) from $t"), Row(2.0) :: Nil) + } + } + + test("aggregate function: lookup int average w/ expression") { + import testImplicits._ + val t = "testcat.ns.t" + withTable(t) { + addFunction(Identifier.of(Array("ns"), "avg"), IntegralAverage) + + (1 to 100).toDF("i").write.saveAsTable(t) + checkAnswer(sql(s"SELECT testcat.ns.avg(i * 10) from $t"), Row(505) :: Nil) + } + } + + test("aggregate function: unsupported input type") { + import testImplicits._ + val t = "testcat.ns.t" + withTable(t) { + addFunction(Identifier.of(Array("ns"), "avg"), IntegralAverage) + + Seq(1.toShort, 2.toShort).toDF("i").write.saveAsTable(t) + assert(intercept[AnalysisException](sql(s"SELECT testcat.ns.avg(i) from $t")) + .getMessage.contains("Unsupported non-integral type: ShortType")) + } + } + + private case class StrLen(impl: BoundFunction) extends UnboundFunction { + override def description(): String = + """strlen: returns the length of the input string + | strlen(string) -> int""".stripMargin + override def name(): String = "strlen" + + override def bind(inputType: StructType): BoundFunction = { + if (inputType.fields.length != 1) { + throw new UnsupportedOperationException("Expect exactly one argument"); + } + inputType.fields(0).dataType match { + case StringType => impl + case _ => + throw new UnsupportedOperationException("Expect StringType") + } + } + } + + private case object StrLenDefault extends ScalarFunction[Int] { + override def inputTypes(): Array[DataType] = Array(StringType) + override def resultType(): DataType = IntegerType + override def name(): String = "strlen_default" + + override def produceResult(input: InternalRow): Int = { + val s = input.getString(0) + s.length + } + } + + private case object StrLenMagic extends ScalarFunction[Int] { + override def inputTypes(): Array[DataType] = Array(StringType) + override def resultType(): DataType = IntegerType + override def name(): String = "strlen_magic" + + def invoke(input: UTF8String): Int = { + input.toString.length + } + } + + private case object StrLenBadMagic extends ScalarFunction[Int] { + override def inputTypes(): Array[DataType] = Array(StringType) + override def resultType(): DataType = IntegerType + override def name(): String = "strlen_bad_magic" + + def invoke(input: String): Int = { + input.length + } + } + + private case object StrLenBadMagicWithDefault extends ScalarFunction[Int] { + override def inputTypes(): Array[DataType] = Array(StringType) + override def resultType(): DataType = IntegerType + override def name(): String = "strlen_bad_magic" + + def invoke(input: String): Int = { + input.length + } + + override def produceResult(input: InternalRow): Int = { + val s = input.getString(0) + s.length + } + } + + private case object StrLenNoImpl extends ScalarFunction[Int] { + override def inputTypes(): Array[DataType] = Array(StringType) + override def resultType(): DataType = IntegerType + override def name(): String = "strlen_noimpl" + } + + private case object BadBoundFunction extends BoundFunction { + override def inputTypes(): Array[DataType] = Array(StringType) + override def resultType(): DataType = IntegerType + override def name(): String = "bad_bound_func" + } + + object IntegralAverage extends UnboundFunction { + override def name(): String = "iavg" + + override def bind(inputType: StructType): BoundFunction = { + if (inputType.fields.length > 1) { + throw new UnsupportedOperationException("Too many arguments") + } + + inputType.fields(0).dataType match { + case _: IntegerType => IntAverage + case _: LongType => LongAverage + case dataType => + throw new UnsupportedOperationException(s"Unsupported non-integral type: $dataType") + } + } + + override def description(): String = + """iavg: produces an average using integer division, ignoring nulls + | iavg(int) -> int + | iavg(bigint) -> bigint""".stripMargin + } + + object IntAverage extends AggregateFunction[(Int, Int), Int] { + override def name(): String = "iavg" + override def inputTypes(): Array[DataType] = Array(IntegerType) + override def resultType(): DataType = IntegerType + + override def newAggregationState(): (Int, Int) = (0, 0) + + override def update(state: (Int, Int), input: InternalRow): (Int, Int) = { + if (input.isNullAt(0)) { + state + } else { + val i = input.getInt(0) + state match { + case (_, 0) => + (i, 1) + case (total, count) => + (total + i, count + 1) + } + } + } + + override def merge(leftState: (Int, Int), rightState: (Int, Int)): (Int, Int) = { + (leftState._1 + rightState._1, leftState._2 + rightState._2) + } + + override def produceResult(state: (Int, Int)): Int = state._1 / state._2 + } + + object LongAverage extends AggregateFunction[(Long, Long), Long] { + override def name(): String = "iavg" + override def inputTypes(): Array[DataType] = Array(LongType) + override def resultType(): DataType = LongType + + override def newAggregationState(): (Long, Long) = (0L, 0L) + + override def update(state: (Long, Long), input: InternalRow): (Long, Long) = { + if (input.isNullAt(0)) { + state + } else { + val l = input.getLong(0) + state match { + case (_, 0L) => + (l, 1) + case (total, count) => + (total + l, count + 1L) + } + } + } + + override def merge(leftState: (Long, Long), rightState: (Long, Long)): (Long, Long) = { + (leftState._1 + rightState._1, leftState._2 + rightState._2) + } + + override def produceResult(state: (Long, Long)): Long = state._1 / state._2 + } + + object NoImplAverage extends UnboundFunction { + override def name(): String = "no_impl_avg" + override def description(): String = name() + + override def bind(inputType: StructType): BoundFunction = { + throw new UnsupportedOperationException(s"Not implemented") + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSessionCatalogSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSessionCatalogSuite.scala index cf00b3b5e4410..44fbc639a5803 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSessionCatalogSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSessionCatalogSuite.scala @@ -18,7 +18,7 @@ package org.apache.spark.sql.connector import org.apache.spark.sql.{DataFrame, Row, SaveMode} -import org.apache.spark.sql.connector.catalog.{Identifier, Table, TableCatalog} +import org.apache.spark.sql.connector.catalog.{Identifier, InMemoryTable, Table, TableCatalog} class DataSourceV2SQLSessionCatalogSuite extends InsertIntoTests(supportsDynamicOverwrite = true, includeSQLOnlyTests = true) @@ -79,4 +79,12 @@ class DataSourceV2SQLSessionCatalogSuite Row("keyX", s"Table default.$t1 does not have property: keyX")) } } + + test("SPARK-33651: allow CREATE EXTERNAL TABLE without LOCATION") { + withTable("t") { + val prop = TestV2SessionCatalogBase.SIMULATE_ALLOW_EXTERNAL_PROPERTY + "=true" + // The following should not throw AnalysisException. + sql(s"CREATE EXTERNAL TABLE t (i INT) USING $v2Format TBLPROPERTIES($prop)") + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala index 8462ce5a6c44f..13facc36876b2 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2SQLSuite.scala @@ -17,26 +17,33 @@ package org.apache.spark.sql.connector +import java.sql.Timestamp +import java.time.LocalDate + import scala.collection.JavaConverters._ import org.apache.spark.SparkException import org.apache.spark.sql._ -import org.apache.spark.sql.catalyst.analysis.{CannotReplaceMissingTableException, NamespaceAlreadyExistsException, NoSuchDatabaseException, NoSuchNamespaceException, NoSuchTableException, TableAlreadyExistsException} +import org.apache.spark.sql.catalyst.InternalRow +import org.apache.spark.sql.catalyst.analysis.{CannotReplaceMissingTableException, NamespaceAlreadyExistsException, NoSuchDatabaseException, NoSuchNamespaceException, TableAlreadyExistsException} import org.apache.spark.sql.catalyst.parser.ParseException import org.apache.spark.sql.connector.catalog._ import org.apache.spark.sql.connector.catalog.CatalogManager.SESSION_CATALOG_NAME import org.apache.spark.sql.connector.catalog.CatalogV2Util.withDefaultOwnership +import org.apache.spark.sql.execution.columnar.InMemoryRelation +import org.apache.spark.sql.execution.streaming.MemoryStream import org.apache.spark.sql.internal.{SQLConf, StaticSQLConf} -import org.apache.spark.sql.internal.SQLConf.V2_SESSION_CATALOG_IMPLEMENTATION +import org.apache.spark.sql.internal.SQLConf.{PARTITION_OVERWRITE_MODE, PartitionOverwriteMode, V2_SESSION_CATALOG_IMPLEMENTATION} import org.apache.spark.sql.internal.connector.SimpleTableProvider import org.apache.spark.sql.sources.SimpleScanSource -import org.apache.spark.sql.types.{BooleanType, LongType, StringType, StructField, StructType} +import org.apache.spark.sql.types.{BooleanType, LongType, MetadataBuilder, StringType, StructField, StructType} import org.apache.spark.sql.util.CaseInsensitiveStringMap +import org.apache.spark.unsafe.types.UTF8String import org.apache.spark.util.Utils class DataSourceV2SQLSuite extends InsertIntoTests(supportsDynamicOverwrite = true, includeSQLOnlyTests = true) - with AlterTableTests { + with AlterTableTests with DatasourceV2SQLBase { import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._ @@ -45,10 +52,6 @@ class DataSourceV2SQLSuite override protected val catalogAndNamespace = "testcat.ns1.ns2." private val defaultUser: String = Utils.getCurrentUserName() - private def catalog(name: String): CatalogPlugin = { - spark.sessionState.catalogManager.catalog(name) - } - protected def doInsert(tableName: String, insert: DataFrame, mode: SaveMode): Unit = { val tmpView = "tmp_view" withTempView(tmpView) { @@ -69,26 +72,6 @@ class DataSourceV2SQLSuite v2Catalog.loadTable(Identifier.of(namespace, nameParts.last)) } - before { - spark.conf.set("spark.sql.catalog.testcat", classOf[InMemoryTableCatalog].getName) - spark.conf.set( - "spark.sql.catalog.testcat_atomic", classOf[StagingInMemoryTableCatalog].getName) - spark.conf.set("spark.sql.catalog.testcat2", classOf[InMemoryTableCatalog].getName) - spark.conf.set( - V2_SESSION_CATALOG_IMPLEMENTATION.key, classOf[InMemoryTableSessionCatalog].getName) - - val df = spark.createDataFrame(Seq((1L, "a"), (2L, "b"), (3L, "c"))).toDF("id", "data") - df.createOrReplaceTempView("source") - val df2 = spark.createDataFrame(Seq((4L, "d"), (5L, "e"), (6L, "f"))).toDF("id", "data") - df2.createOrReplaceTempView("source2") - } - - after { - spark.sessionState.catalog.reset() - spark.sessionState.catalogManager.reset() - spark.sessionState.conf.clear() - } - test("CreateTable: use v2 plan because catalog is set") { spark.sql("CREATE TABLE testcat.table_name (id bigint NOT NULL, data string) USING foo") @@ -158,6 +141,10 @@ class DataSourceV2SQLSuite Array("# Partitioning", "", ""), Array("Part 0", "id", ""), Array("", "", ""), + Array("# Metadata Columns", "", ""), + Array("index", "int", "Metadata column used to conflict with a data column"), + Array("_partition", "string", "Partition key used to store the row"), + Array("", "", ""), Array("# Detailed Table Information", "", ""), Array("Name", "testcat.table_name", ""), Array("Comment", "this is a test table", ""), @@ -165,7 +152,72 @@ class DataSourceV2SQLSuite Array("Provider", "foo", ""), Array(TableCatalog.PROP_OWNER.capitalize, defaultUser, ""), Array("Table Properties", "[bar=baz]", ""))) + } + + test("Describe column for v2 catalog") { + val t = "testcat.tbl" + withTable(t) { + sql(s"CREATE TABLE $t (id bigint, data string COMMENT 'hello') USING foo") + val df1 = sql(s"DESCRIBE $t id") + assert(df1.schema.map(field => (field.name, field.dataType)) + === Seq(("info_name", StringType), ("info_value", StringType))) + assert(df1.collect === Seq( + Row("col_name", "id"), + Row("data_type", "bigint"), + Row("comment", "NULL"))) + val df2 = sql(s"DESCRIBE $t data") + assert(df2.schema.map(field => (field.name, field.dataType)) + === Seq(("info_name", StringType), ("info_value", StringType))) + assert(df2.collect === Seq( + Row("col_name", "data"), + Row("data_type", "string"), + Row("comment", "hello"))) + assertAnalysisError( + s"DESCRIBE $t invalid_col", + "cannot resolve 'invalid_col' given input columns: [testcat.tbl.data, testcat.tbl.id]") + } + } + + test("Describe column for v2 catalog should work with qualified columns") { + val t = "testcat.ns.tbl" + withTable(t) { + sql(s"CREATE TABLE $t (id bigint) USING foo") + Seq("testcat.ns.tbl.id", "ns.tbl.id", "tbl.id", "id").foreach { col => + val df = sql(s"DESCRIBE $t $col") + assert(df.schema.map(field => (field.name, field.dataType)) + === Seq(("info_name", StringType), ("info_value", StringType))) + assert(df.collect === Seq( + Row("col_name", "id"), + Row("data_type", "bigint"), + Row("comment", "NULL"))) + } + } + } + + test("Describing nested column for v2 catalog is not supported") { + val t = "testcat.tbl" + withTable(t) { + sql(s"CREATE TABLE $t (d struct) USING foo") + assertAnalysisError( + s"describe $t d.a", + "DESC TABLE COLUMN does not support nested column") + } + } + + test("SPARK-33004: Describe column should resolve to a temporary view first") { + withTable("testcat.ns.t") { + withTempView("t") { + sql("CREATE TABLE testcat.ns.t (id bigint) USING foo") + sql("CREATE TEMPORARY VIEW t AS SELECT 2 as i") + sql("USE testcat.ns") + checkAnswer( + sql("DESCRIBE t i"), + Seq(Row("col_name", "i"), + Row("data_type", "int"), + Row("comment", "NULL"))) + } + } } test("CreateTable: use v2 plan and session catalog when provider is v2") { @@ -256,25 +308,26 @@ class DataSourceV2SQLSuite checkAnswer(spark.internalCreateDataFrame(rdd, table.schema), Seq.empty) } - // TODO: ignored by SPARK-31707, restore the test after create table syntax unification - ignore("CreateTable: without USING clause") { - // unset this config to use the default v2 session catalog. - spark.conf.unset(V2_SESSION_CATALOG_IMPLEMENTATION.key) - val testCatalog = catalog("testcat").asTableCatalog + test("CreateTable: without USING clause") { + withSQLConf(SQLConf.LEGACY_CREATE_HIVE_TABLE_BY_DEFAULT.key -> "false") { + // unset this config to use the default v2 session catalog. + spark.conf.unset(V2_SESSION_CATALOG_IMPLEMENTATION.key) + val testCatalog = catalog("testcat").asTableCatalog - sql("CREATE TABLE testcat.t1 (id int)") - val t1 = testCatalog.loadTable(Identifier.of(Array(), "t1")) - // Spark shouldn't set the default provider for catalog plugins. - assert(!t1.properties.containsKey(TableCatalog.PROP_PROVIDER)) + sql("CREATE TABLE testcat.t1 (id int)") + val t1 = testCatalog.loadTable(Identifier.of(Array(), "t1")) + // Spark shouldn't set the default provider for catalog plugins. + assert(!t1.properties.containsKey(TableCatalog.PROP_PROVIDER)) - sql("CREATE TABLE t2 (id int)") - val t2 = spark.sessionState.catalogManager.v2SessionCatalog.asTableCatalog - .loadTable(Identifier.of(Array("default"), "t2")).asInstanceOf[V1Table] - // Spark should set the default provider as DEFAULT_DATA_SOURCE_NAME for the session catalog. - assert(t2.v1Table.provider == Some(conf.defaultDataSourceName)) + sql("CREATE TABLE t2 (id int)") + val t2 = spark.sessionState.catalogManager.v2SessionCatalog.asTableCatalog + .loadTable(Identifier.of(Array("default"), "t2")).asInstanceOf[V1Table] + // Spark should set the default provider as DEFAULT_DATA_SOURCE_NAME for the session catalog. + assert(t2.v1Table.provider == Some(conf.defaultDataSourceName)) + } } - test("CreateTable/RepalceTable: invalid schema if has interval type") { + test("CreateTable/ReplaceTable: invalid schema if has interval type") { Seq("CREATE", "REPLACE").foreach { action => val e1 = intercept[AnalysisException]( sql(s"$action TABLE table_name (id int, value interval) USING $v2Format")) @@ -423,7 +476,7 @@ class DataSourceV2SQLSuite intercept[Exception] { spark.sql("REPLACE TABLE testcat.table_name" + - s" USING foo OPTIONS (`${InMemoryTable.SIMULATE_FAILED_WRITE_OPTION}`=true)" + + s" USING foo TBLPROPERTIES (`${InMemoryTable.SIMULATE_FAILED_WRITE_OPTION}`=true)" + s" AS SELECT id FROM source") } @@ -456,7 +509,7 @@ class DataSourceV2SQLSuite intercept[Exception] { spark.sql("REPLACE TABLE testcat_atomic.table_name" + - s" USING foo OPTIONS (`${InMemoryTable.SIMULATE_FAILED_WRITE_OPTION}=true)" + + s" USING foo TBLPROPERTIES (`${InMemoryTable.SIMULATE_FAILED_WRITE_OPTION}=true)" + s" AS SELECT id FROM source") } @@ -699,28 +752,128 @@ class DataSourceV2SQLSuite assert(t2.v1Table.provider == Some(conf.defaultDataSourceName)) } - test("DropTable: basic") { - val tableName = "testcat.ns1.ns2.tbl" - val ident = Identifier.of(Array("ns1", "ns2"), "tbl") - sql(s"CREATE TABLE $tableName USING foo AS SELECT id, data FROM source") - assert(catalog("testcat").asTableCatalog.tableExists(ident) === true) - sql(s"DROP TABLE $tableName") - assert(catalog("testcat").asTableCatalog.tableExists(ident) === false) + test("SPARK-34039: ReplaceTable (atomic or non-atomic) should invalidate cache") { + Seq("testcat.ns.t", "testcat_atomic.ns.t").foreach { t => + val view = "view" + withTable(t) { + withTempView(view) { + sql(s"CREATE TABLE $t USING foo AS SELECT id, data FROM source") + sql(s"CACHE TABLE $view AS SELECT id FROM $t") + checkAnswer(sql(s"SELECT * FROM $t"), spark.table("source")) + checkAnswer(sql(s"SELECT * FROM $view"), spark.table("source").select("id")) + + val oldView = spark.table(view) + sql(s"REPLACE TABLE $t (a bigint) USING foo") + assert(spark.sharedState.cacheManager.lookupCachedData(oldView).isEmpty) + } + } + } } - test("DropTable: table qualified with the session catalog name") { - val ident = Identifier.of(Array("default"), "tbl") - sql("CREATE TABLE tbl USING json AS SELECT 1 AS i") - assert(catalog("spark_catalog").asTableCatalog.tableExists(ident) === true) - sql("DROP TABLE spark_catalog.default.tbl") - assert(catalog("spark_catalog").asTableCatalog.tableExists(ident) === false) + test("SPARK-33492: ReplaceTableAsSelect (atomic or non-atomic) should invalidate cache") { + Seq("testcat.ns.t", "testcat_atomic.ns.t").foreach { t => + val view = "view" + withTable(t) { + withTempView(view) { + sql(s"CREATE TABLE $t USING foo AS SELECT id, data FROM source") + sql(s"CACHE TABLE $view AS SELECT id FROM $t") + checkAnswer(sql(s"SELECT * FROM $t"), spark.table("source")) + checkAnswer(sql(s"SELECT * FROM $view"), spark.table("source").select("id")) + + sql(s"REPLACE TABLE $t USING foo AS SELECT id FROM source") + assert(spark.sharedState.cacheManager.lookupCachedData(spark.table(view)).isEmpty) + } + } + } } - test("DropTable: if exists") { - intercept[NoSuchTableException] { - sql(s"DROP TABLE testcat.db.notbl") + test("SPARK-33492: AppendData should refresh cache") { + import testImplicits._ + + val t = "testcat.ns.t" + val view = "view" + withTable(t) { + withTempView(view) { + Seq((1, "a")).toDF("i", "j").write.saveAsTable(t) + sql(s"CACHE TABLE $view AS SELECT i FROM $t") + checkAnswer(sql(s"SELECT * FROM $t"), Row(1, "a") :: Nil) + checkAnswer(sql(s"SELECT * FROM $view"), Row(1) :: Nil) + + Seq((2, "b")).toDF("i", "j").write.mode(SaveMode.Append).saveAsTable(t) + + assert(spark.sharedState.cacheManager.lookupCachedData(spark.table(view)).isDefined) + checkAnswer(sql(s"SELECT * FROM $t"), Row(1, "a") :: Row(2, "b") :: Nil) + checkAnswer(sql(s"SELECT * FROM $view"), Row(1) :: Row(2) :: Nil) + } + } + } + + test("SPARK-33492: OverwriteByExpression should refresh cache") { + val t = "testcat.ns.t" + val view = "view" + withTable(t) { + withTempView(view) { + sql(s"CREATE TABLE $t USING foo AS SELECT id, data FROM source") + sql(s"CACHE TABLE $view AS SELECT id FROM $t") + checkAnswer(sql(s"SELECT * FROM $t"), spark.table("source")) + checkAnswer(sql(s"SELECT * FROM $view"), spark.table("source").select("id")) + + sql(s"INSERT OVERWRITE TABLE $t VALUES (1, 'a')") + + assert(spark.sharedState.cacheManager.lookupCachedData(spark.table(view)).isDefined) + checkAnswer(sql(s"SELECT * FROM $t"), Row(1, "a") :: Nil) + checkAnswer(sql(s"SELECT * FROM $view"), Row(1) :: Nil) + } + } + } + + test("SPARK-33492: OverwritePartitionsDynamic should refresh cache") { + import testImplicits._ + + val t = "testcat.ns.t" + val view = "view" + withTable(t) { + withTempView(view) { + Seq((1, "a", 1)).toDF("i", "j", "k").write.partitionBy("k") saveAsTable(t) + sql(s"CACHE TABLE $view AS SELECT i FROM $t") + checkAnswer(sql(s"SELECT * FROM $t"), Row(1, "a", 1) :: Nil) + checkAnswer(sql(s"SELECT * FROM $view"), Row(1) :: Nil) + + Seq((2, "b", 1)).toDF("i", "j", "k").writeTo(t).overwritePartitions() + + assert(spark.sharedState.cacheManager.lookupCachedData(spark.table(view)).isDefined) + checkAnswer(sql(s"SELECT * FROM $t"), Row(2, "b", 1) :: Nil) + checkAnswer(sql(s"SELECT * FROM $view"), Row(2) :: Nil) + } + } + } + + test("SPARK-34947: micro batch streaming write should invalidate cache") { + import testImplicits._ + + val t = "testcat.ns.t" + withTable(t) { + withTempDir { checkpointDir => + sql(s"CREATE TABLE $t (id bigint, data string) USING foo") + sql(s"INSERT INTO $t VALUES (1L, 'a')") + sql(s"CACHE TABLE $t") + + val inputData = MemoryStream[(Long, String)] + val df = inputData.toDF().toDF("id", "data") + val query = df + .writeStream + .option("checkpointLocation", checkpointDir.getAbsolutePath) + .toTable(t) + + val newData = Seq((2L, "b")) + inputData.addData(newData) + query.processAllAvailable() + query.stop() + + assert(!spark.catalog.isCached("testcat.ns.t")) + checkAnswer(sql(s"SELECT * FROM $t"), Row(1L, "a") :: Row(2L, "b") :: Nil) + } } - sql(s"DROP TABLE IF EXISTS testcat.db.notbl") } test("Relation: basic") { @@ -755,8 +908,9 @@ class DataSourceV2SQLSuite test("Relation: view text") { val t1 = "testcat.ns1.ns2.tbl" + val v1 = "view1" withTable(t1) { - withView("view1") { v1: String => + withView(v1) { sql(s"CREATE TABLE $t1 USING foo AS SELECT id, data FROM source") sql(s"CREATE VIEW $v1 AS SELECT * from $t1") checkAnswer(sql(s"TABLE $v1"), spark.table("source")) @@ -808,7 +962,7 @@ class DataSourceV2SQLSuite val ex = intercept[AnalysisException] { sql(s"SELECT ns1.ns2.ns3.tbl.id from $t") } - assert(ex.getMessage.contains("cannot resolve '`ns1.ns2.ns3.tbl.id`")) + assert(ex.getMessage.contains("cannot resolve 'ns1.ns2.ns3.tbl.id")) } } @@ -847,74 +1001,13 @@ class DataSourceV2SQLSuite } } - test("ShowTables: using v2 catalog") { - spark.sql("CREATE TABLE testcat.db.table_name (id bigint, data string) USING foo") - spark.sql("CREATE TABLE testcat.n1.n2.db.table_name (id bigint, data string) USING foo") - - runShowTablesSql("SHOW TABLES FROM testcat.db", Seq(Row("db", "table_name"))) - - runShowTablesSql( - "SHOW TABLES FROM testcat.n1.n2.db", - Seq(Row("n1.n2.db", "table_name"))) - } - - test("ShowTables: using v2 catalog with a pattern") { - spark.sql("CREATE TABLE testcat.db.table (id bigint, data string) USING foo") - spark.sql("CREATE TABLE testcat.db.table_name_1 (id bigint, data string) USING foo") - spark.sql("CREATE TABLE testcat.db.table_name_2 (id bigint, data string) USING foo") - spark.sql("CREATE TABLE testcat.db2.table_name_2 (id bigint, data string) USING foo") - - runShowTablesSql( - "SHOW TABLES FROM testcat.db", - Seq( - Row("db", "table"), - Row("db", "table_name_1"), - Row("db", "table_name_2"))) - - runShowTablesSql( - "SHOW TABLES FROM testcat.db LIKE '*name*'", - Seq(Row("db", "table_name_1"), Row("db", "table_name_2"))) - - runShowTablesSql( - "SHOW TABLES FROM testcat.db LIKE '*2'", - Seq(Row("db", "table_name_2"))) - } - - test("ShowTables: using v2 catalog, namespace doesn't exist") { - runShowTablesSql("SHOW TABLES FROM testcat.unknown", Seq()) - } - - test("ShowTables: using v1 catalog") { - runShowTablesSql( - "SHOW TABLES FROM default", - Seq(Row("", "source", true), Row("", "source2", true)), - expectV2Catalog = false) - } - - test("ShowTables: using v1 catalog, db doesn't exist ") { - // 'db' below resolves to a database name for v1 catalog because there is no catalog named - // 'db' and there is no default catalog set. - val exception = intercept[NoSuchDatabaseException] { - runShowTablesSql("SHOW TABLES FROM db", Seq(), expectV2Catalog = false) - } - - assert(exception.getMessage.contains("Database 'db' not found")) - } - - test("ShowTables: using v1 catalog, db name with multipartIdentifier ('a.b') is not allowed.") { - val exception = intercept[AnalysisException] { - runShowTablesSql("SHOW TABLES FROM a.b", Seq(), expectV2Catalog = false) - } - - assert(exception.getMessage.contains("The database name is not valid: a.b")) - } - test("ShowViews: using v1 catalog, db name with multipartIdentifier ('a.b') is not allowed.") { val exception = intercept[AnalysisException] { - sql("SHOW TABLES FROM a.b") + sql("SHOW VIEWS FROM a.b") } - assert(exception.getMessage.contains("The database name is not valid: a.b")) + assert(exception.getMessage.contains( + "Nested databases are not supported by v1 session catalog: a.b")) } test("ShowViews: using v2 catalog, command not supported.") { @@ -926,112 +1019,6 @@ class DataSourceV2SQLSuite " only SessionCatalog supports this command.")) } - test("ShowTables: using v2 catalog with empty namespace") { - spark.sql("CREATE TABLE testcat.table (id bigint, data string) USING foo") - runShowTablesSql("SHOW TABLES FROM testcat", Seq(Row("", "table"))) - } - - test("ShowTables: namespace is not specified and default v2 catalog is set") { - spark.conf.set(SQLConf.DEFAULT_CATALOG.key, "testcat") - spark.sql("CREATE TABLE testcat.table (id bigint, data string) USING foo") - - // v2 catalog is used where default namespace is empty for TestInMemoryTableCatalog. - runShowTablesSql("SHOW TABLES", Seq(Row("", "table"))) - } - - test("ShowTables: namespace not specified and default v2 catalog not set - fallback to v1") { - runShowTablesSql( - "SHOW TABLES", - Seq(Row("", "source", true), Row("", "source2", true)), - expectV2Catalog = false) - - runShowTablesSql( - "SHOW TABLES LIKE '*2'", - Seq(Row("", "source2", true)), - expectV2Catalog = false) - } - - test("ShowTables: change current catalog and namespace with USE statements") { - sql("CREATE TABLE testcat.ns1.ns2.table (id bigint) USING foo") - - // Initially, the v2 session catalog (current catalog) is used. - runShowTablesSql( - "SHOW TABLES", Seq(Row("", "source", true), Row("", "source2", true)), - expectV2Catalog = false) - - // Update the current catalog, and no table is matched since the current namespace is Array(). - sql("USE testcat") - runShowTablesSql("SHOW TABLES", Seq()) - - // Update the current namespace to match ns1.ns2.table. - sql("USE testcat.ns1.ns2") - runShowTablesSql("SHOW TABLES", Seq(Row("ns1.ns2", "table"))) - } - - private def runShowTablesSql( - sqlText: String, - expected: Seq[Row], - expectV2Catalog: Boolean = true): Unit = { - val schema = if (expectV2Catalog) { - new StructType() - .add("namespace", StringType, nullable = false) - .add("tableName", StringType, nullable = false) - } else { - new StructType() - .add("database", StringType, nullable = false) - .add("tableName", StringType, nullable = false) - .add("isTemporary", BooleanType, nullable = false) - } - - val df = spark.sql(sqlText) - assert(df.schema === schema) - assert(expected === df.collect()) - } - - test("SHOW TABLE EXTENDED not valid v1 database") { - def testV1CommandNamespace(sqlCommand: String, namespace: String): Unit = { - val e = intercept[AnalysisException] { - sql(sqlCommand) - } - assert(e.message.contains(s"The database name is not valid: ${namespace}")) - } - - val namespace = "testcat.ns1.ns2" - val table = "tbl" - withTable(s"$namespace.$table") { - sql(s"CREATE TABLE $namespace.$table (id bigint, data string) " + - s"USING foo PARTITIONED BY (id)") - - testV1CommandNamespace(s"SHOW TABLE EXTENDED FROM $namespace LIKE 'tb*'", - namespace) - testV1CommandNamespace(s"SHOW TABLE EXTENDED IN $namespace LIKE 'tb*'", - namespace) - testV1CommandNamespace("SHOW TABLE EXTENDED " + - s"FROM $namespace LIKE 'tb*' PARTITION(id=1)", - namespace) - testV1CommandNamespace("SHOW TABLE EXTENDED " + - s"IN $namespace LIKE 'tb*' PARTITION(id=1)", - namespace) - } - } - - test("SHOW TABLE EXTENDED valid v1") { - val expected = Seq(Row("", "source", true), Row("", "source2", true)) - val schema = new StructType() - .add("database", StringType, nullable = false) - .add("tableName", StringType, nullable = false) - .add("isTemporary", BooleanType, nullable = false) - .add("information", StringType, nullable = false) - - val df = sql("SHOW TABLE EXTENDED FROM default LIKE '*source*'") - val result = df.collect() - val resultWithoutInfo = result.map{ case Row(db, table, temp, _) => Row(db, table, temp)} - - assert(df.schema === schema) - assert(resultWithoutInfo === expected) - result.foreach{ case Row(_, _, _, info: String) => assert(info.nonEmpty)} - } - test("CreateNameSpace: basic tests") { // Session catalog is used. withNamespace("ns") { @@ -1251,8 +1238,8 @@ class DataSourceV2SQLSuite val descriptionDf = sql("DESCRIBE NAMESPACE testcat.ns1.ns2") assert(descriptionDf.schema.map(field => (field.name, field.dataType)) === Seq( - ("name", StringType), - ("value", StringType) + ("info_name", StringType), + ("info_value", StringType) )) val description = descriptionDf.collect() assert(description === Seq( @@ -1264,7 +1251,7 @@ class DataSourceV2SQLSuite } } - test("AlterNamespaceSetProperties using v2 catalog") { + test("ALTER NAMESPACE .. SET PROPERTIES using v2 catalog") { withNamespace("testcat.ns1.ns2") { sql("CREATE NAMESPACE IF NOT EXISTS testcat.ns1.ns2 COMMENT " + "'test namespace' LOCATION '/tmp/ns_test' WITH PROPERTIES ('a'='a','b'='b','c'='c')") @@ -1280,7 +1267,7 @@ class DataSourceV2SQLSuite } } - test("AlterNamespaceSetProperties: reserved properties") { + test("ALTER NAMESPACE .. SET PROPERTIES reserved properties") { import SupportsNamespaces._ withSQLConf((SQLConf.LEGACY_PROPERTY_NON_RESERVED.key, "false")) { CatalogV2Util.NAMESPACE_RESERVED_PROPERTIES.filterNot(_ == PROP_COMMENT).foreach { key => @@ -1311,7 +1298,7 @@ class DataSourceV2SQLSuite } } - test("AlterNamespaceSetLocation using v2 catalog") { + test("ALTER NAMESPACE .. SET LOCATION using v2 catalog") { withNamespace("testcat.ns1.ns2") { sql("CREATE NAMESPACE IF NOT EXISTS testcat.ns1.ns2 COMMENT " + "'test namespace' LOCATION '/tmp/ns_test_1'") @@ -1326,95 +1313,6 @@ class DataSourceV2SQLSuite } } - test("ShowNamespaces: show root namespaces with default v2 catalog") { - spark.conf.set(SQLConf.DEFAULT_CATALOG.key, "testcat") - - testShowNamespaces("SHOW NAMESPACES", Seq()) - - spark.sql("CREATE TABLE testcat.ns1.table (id bigint) USING foo") - spark.sql("CREATE TABLE testcat.ns1.ns1_1.table (id bigint) USING foo") - spark.sql("CREATE TABLE testcat.ns2.table (id bigint) USING foo") - - testShowNamespaces("SHOW NAMESPACES", Seq("ns1", "ns2")) - testShowNamespaces("SHOW NAMESPACES LIKE '*1*'", Seq("ns1")) - } - - test("ShowNamespaces: show namespaces with v2 catalog") { - spark.sql("CREATE TABLE testcat.ns1.table (id bigint) USING foo") - spark.sql("CREATE TABLE testcat.ns1.ns1_1.table (id bigint) USING foo") - spark.sql("CREATE TABLE testcat.ns1.ns1_2.table (id bigint) USING foo") - spark.sql("CREATE TABLE testcat.ns2.table (id bigint) USING foo") - spark.sql("CREATE TABLE testcat.ns2.ns2_1.table (id bigint) USING foo") - - // Look up only with catalog name, which should list root namespaces. - testShowNamespaces("SHOW NAMESPACES IN testcat", Seq("ns1", "ns2")) - - // Look up sub-namespaces. - testShowNamespaces("SHOW NAMESPACES IN testcat.ns1", Seq("ns1.ns1_1", "ns1.ns1_2")) - testShowNamespaces("SHOW NAMESPACES IN testcat.ns1 LIKE '*2*'", Seq("ns1.ns1_2")) - testShowNamespaces("SHOW NAMESPACES IN testcat.ns2", Seq("ns2.ns2_1")) - - // Try to look up namespaces that do not exist. - testShowNamespaces("SHOW NAMESPACES IN testcat.ns3", Seq()) - testShowNamespaces("SHOW NAMESPACES IN testcat.ns1.ns3", Seq()) - } - - test("ShowNamespaces: default v2 catalog is not set") { - spark.sql("CREATE TABLE testcat.ns.table (id bigint) USING foo") - - // The current catalog is resolved to a v2 session catalog. - testShowNamespaces("SHOW NAMESPACES", Seq("default")) - } - - test("ShowNamespaces: default v2 catalog doesn't support namespace") { - spark.conf.set( - "spark.sql.catalog.testcat_no_namspace", - classOf[BasicInMemoryTableCatalog].getName) - spark.conf.set(SQLConf.DEFAULT_CATALOG.key, "testcat_no_namspace") - - val exception = intercept[AnalysisException] { - sql("SHOW NAMESPACES") - } - - assert(exception.getMessage.contains("does not support namespaces")) - } - - test("ShowNamespaces: v2 catalog doesn't support namespace") { - spark.conf.set( - "spark.sql.catalog.testcat_no_namspace", - classOf[BasicInMemoryTableCatalog].getName) - - val exception = intercept[AnalysisException] { - sql("SHOW NAMESPACES in testcat_no_namspace") - } - - assert(exception.getMessage.contains("does not support namespaces")) - } - - test("ShowNamespaces: session catalog is used and namespace doesn't exist") { - val exception = intercept[AnalysisException] { - sql("SHOW NAMESPACES in dummy") - } - - assert(exception.getMessage.contains("Namespace 'dummy' not found")) - } - - test("ShowNamespaces: change catalog and namespace with USE statements") { - sql("CREATE TABLE testcat.ns1.ns2.table (id bigint) USING foo") - - // Initially, the current catalog is a v2 session catalog. - testShowNamespaces("SHOW NAMESPACES", Seq("default")) - - // Update the current catalog to 'testcat'. - sql("USE testcat") - testShowNamespaces("SHOW NAMESPACES", Seq("ns1")) - - // Update the current namespace to 'ns1'. - sql("USE ns1") - // 'SHOW NAMESPACES' is not affected by the current namespace and lists root namespaces. - testShowNamespaces("SHOW NAMESPACES", Seq("ns1")) - } - private def testShowNamespaces( sqlText: String, expected: Seq[String]): Unit = { @@ -1479,11 +1377,26 @@ class DataSourceV2SQLSuite assert(exception.getMessage.contains("Database 'ns1' not found")) } - test("Use: v2 catalog is used and namespace does not exist") { - // Namespaces are not required to exist for v2 catalogs. - sql("USE testcat.ns1.ns2") - val catalogManager = spark.sessionState.catalogManager - assert(catalogManager.currentNamespace === Array("ns1", "ns2")) + test("SPARK-31100: Use: v2 catalog that implements SupportsNamespaces is used " + + "and namespace not exists") { + // Namespaces are required to exist for v2 catalogs that implements SupportsNamespaces. + val exception = intercept[NoSuchNamespaceException] { + sql("USE testcat.ns1.ns2") + } + assert(exception.getMessage.contains("Namespace 'ns1.ns2' not found")) + } + + test("SPARK-31100: Use: v2 catalog that does not implement SupportsNameSpaces is used " + + "and namespace does not exist") { + // Namespaces are not required to exist for v2 catalogs + // that does not implement SupportsNamespaces. + withSQLConf("spark.sql.catalog.dummy" -> classOf[BasicInMemoryTableCatalog].getName) { + val catalogManager = spark.sessionState.catalogManager + + sql("USE dummy.ns1") + assert(catalogManager.currentCatalog.name() == "dummy") + assert(catalogManager.currentNamespace === Array("ns1")) + } } test("ShowCurrentNamespace: basic tests") { @@ -1505,6 +1418,8 @@ class DataSourceV2SQLSuite sql("USE testcat") testShowCurrentNamespace("testcat", "") + + sql("CREATE NAMESPACE testcat.ns1.ns2") sql("USE testcat.ns1.ns2") testShowCurrentNamespace("testcat", "ns1.ns2") } @@ -1630,7 +1545,6 @@ class DataSourceV2SQLSuite """ |CREATE TABLE testcat.t (id int, `a.b` string) USING foo |CLUSTERED BY (`a.b`) INTO 4 BUCKETS - |OPTIONS ('allow-unsupported-transforms'=true) """.stripMargin) val testCatalog = catalog("testcat").asTableCatalog.asInstanceOf[InMemoryTableCatalog] @@ -1709,6 +1623,63 @@ class DataSourceV2SQLSuite } } + test("SPARK-32990: REFRESH TABLE should resolve to a temporary view first") { + withTable("testcat.ns.t") { + withTempView("t") { + sql("CREATE TABLE testcat.ns.t (id bigint) USING foo") + sql("CREATE TEMPORARY VIEW t AS SELECT 2") + sql("USE testcat.ns") + + val testCatalog = catalog("testcat").asTableCatalog.asInstanceOf[InMemoryTableCatalog] + val identifier = Identifier.of(Array("ns"), "t") + + assert(!testCatalog.isTableInvalidated(identifier)) + sql("REFRESH TABLE t") + assert(!testCatalog.isTableInvalidated(identifier)) + } + } + } + + test("SPARK-33435, SPARK-34099: REFRESH TABLE should refresh all caches referencing the table") { + val tblName = "testcat.ns.t" + withTable(tblName) { + withTempView("t") { + sql(s"CREATE TABLE $tblName (id bigint) USING foo") + sql(s"INSERT INTO $tblName SELECT 0") + sql(s"CACHE TABLE t AS SELECT id FROM $tblName") + checkAnswer(spark.table(tblName), Row(0)) + checkAnswer(spark.table("t"), Row(0)) + + sql(s"INSERT INTO $tblName SELECT 1") + + assert(spark.sharedState.cacheManager.lookupCachedData(spark.table("t")).isDefined) + sql(s"REFRESH TABLE $tblName") + assert(spark.sharedState.cacheManager.lookupCachedData(spark.table("t")).isDefined) + checkAnswer(spark.table(tblName), Seq(Row(0), Row(1))) + checkAnswer(spark.table("t"), Seq(Row(0), Row(1))) + } + } + } + + test("SPARK-33653: REFRESH TABLE should recache the target table itself") { + val tblName = "testcat.ns.t" + withTable(tblName) { + sql(s"CREATE TABLE $tblName (id bigint) USING foo") + + // if the table is not cached, refreshing it should not recache it + assert(spark.sharedState.cacheManager.lookupCachedData(spark.table(tblName)).isEmpty) + sql(s"REFRESH TABLE $tblName") + assert(spark.sharedState.cacheManager.lookupCachedData(spark.table(tblName)).isEmpty) + + sql(s"CACHE TABLE $tblName") + + // after caching & refreshing the table should be recached + assert(spark.sharedState.cacheManager.lookupCachedData(spark.table(tblName)).isDefined) + sql(s"REFRESH TABLE $tblName") + assert(spark.sharedState.cacheManager.lookupCachedData(spark.table(tblName)).isDefined) + } + } + test("REPLACE TABLE: v1 table") { val e = intercept[AnalysisException] { sql(s"CREATE OR REPLACE TABLE tbl (a int) USING ${classOf[SimpleScanSource].getName}") @@ -1773,6 +1744,20 @@ class DataSourceV2SQLSuite } } + test("DeleteFrom: delete with unsupported predicates") { + val t = "testcat.ns1.ns2.tbl" + withTable(t) { + sql(s"CREATE TABLE $t (id bigint, data string, p int) USING foo") + sql(s"INSERT INTO $t VALUES (2L, 'a', 2), (2L, 'b', 3), (3L, 'c', 3)") + val exc = intercept[AnalysisException] { + sql(s"DELETE FROM $t WHERE id > 3 AND p > 3") + } + + assert(spark.table(t).count === 3) + assert(exc.getMessage.contains(s"Cannot delete from table $t")) + } + } + test("DeleteFrom: DELETE is only supported with v2 tables") { // unset this config to use the default v2 session catalog. spark.conf.unset(V2_SESSION_CATALOG_IMPLEMENTATION.key) @@ -1788,6 +1773,22 @@ class DataSourceV2SQLSuite } } + test("SPARK-33652: DeleteFrom should refresh caches referencing the table") { + val t = "testcat.ns1.ns2.tbl" + val view = "view" + withTable(t) { + withTempView(view) { + sql(s"CREATE TABLE $t (id bigint, data string, p int) USING foo PARTITIONED BY (id, p)") + sql(s"INSERT INTO $t VALUES (2L, 'a', 2), (2L, 'b', 3), (3L, 'c', 3)") + sql(s"CACHE TABLE view AS SELECT id FROM $t") + assert(spark.table(view).count() == 3) + + sql(s"DELETE FROM $t WHERE id = 2") + assert(spark.table(view).count() == 1) + } + } + } + test("UPDATE TABLE") { val t = "testcat.ns1.ns2.tbl" withTable(t) { @@ -1904,14 +1905,16 @@ class DataSourceV2SQLSuite } } - test("AlterTable: rename table basic test") { + test("rename table by ALTER VIEW") { withTable("testcat.ns1.new") { - sql(s"CREATE TABLE testcat.ns1.ns2.old USING foo AS SELECT id, data FROM source") - checkAnswer(sql("SHOW TABLES FROM testcat.ns1.ns2"), Seq(Row("ns1.ns2", "old"))) + sql("CREATE TABLE testcat.ns1.ns2.old USING foo AS SELECT id, data FROM source") + checkAnswer(sql("SHOW TABLES FROM testcat.ns1.ns2"), Seq(Row("ns1.ns2", "old", false))) - sql(s"ALTER TABLE testcat.ns1.ns2.old RENAME TO ns1.new") - checkAnswer(sql("SHOW TABLES FROM testcat.ns1.ns2"), Seq.empty) - checkAnswer(sql("SHOW TABLES FROM testcat.ns1"), Seq(Row("ns1", "new"))) + val e = intercept[AnalysisException] { + sql("ALTER VIEW testcat.ns1.ns2.old RENAME TO ns1.new") + } + assert(e.getMessage.contains( + "Cannot rename a table with ALTER VIEW. Please use ALTER TABLE instead")) } } @@ -1919,15 +1922,16 @@ class DataSourceV2SQLSuite val e = intercept[AnalysisException] { sql(s"ALTER VIEW testcat.ns.tbl RENAME TO ns.view") } - assert(e.getMessage.contains("Renaming view is not supported in v2 catalogs")) + assert(e.getMessage.contains( + "Table or view not found: testcat.ns.tbl")) } test("ANALYZE TABLE") { val t = "testcat.ns1.ns2.tbl" withTable(t) { spark.sql(s"CREATE TABLE $t (id bigint, data string) USING foo") - testV1Command("ANALYZE TABLE", s"$t COMPUTE STATISTICS") - testV1CommandSupportingTempView("ANALYZE TABLE", s"$t COMPUTE STATISTICS FOR ALL COLUMNS") + testNotSupportedV2Command("ANALYZE TABLE", s"$t COMPUTE STATISTICS") + testNotSupportedV2Command("ANALYZE TABLE", s"$t COMPUTE STATISTICS FOR ALL COLUMNS") } } @@ -1935,37 +1939,7 @@ class DataSourceV2SQLSuite val t = "testcat.ns1.ns2.tbl" withTable(t) { spark.sql(s"CREATE TABLE $t (id bigint, data string) USING foo") - testV1Command("MSCK REPAIR TABLE", t) - } - } - - test("TRUNCATE TABLE") { - val t = "testcat.ns1.ns2.tbl" - withTable(t) { - sql( - s""" - |CREATE TABLE $t (id bigint, data string) - |USING foo - |PARTITIONED BY (id) - """.stripMargin) - - testV1Command("TRUNCATE TABLE", t) - testV1Command("TRUNCATE TABLE", s"$t PARTITION(id='1')") - } - } - - test("SHOW PARTITIONS") { - val t = "testcat.ns1.ns2.tbl" - withTable(t) { - sql( - s""" - |CREATE TABLE $t (id bigint, data string) - |USING foo - |PARTITIONED BY (id) - """.stripMargin) - - testV1Command("SHOW PARTITIONS", t) - testV1Command("SHOW PARTITIONS", s"$t PARTITION(id='1')") + testNotSupportedV2Command("MSCK REPAIR TABLE", t) } } @@ -1979,10 +1953,10 @@ class DataSourceV2SQLSuite |PARTITIONED BY (id) """.stripMargin) - testV1Command("LOAD DATA", s"INPATH 'filepath' INTO TABLE $t") - testV1Command("LOAD DATA", s"LOCAL INPATH 'filepath' INTO TABLE $t") - testV1Command("LOAD DATA", s"LOCAL INPATH 'filepath' OVERWRITE INTO TABLE $t") - testV1Command("LOAD DATA", + testNotSupportedV2Command("LOAD DATA", s"INPATH 'filepath' INTO TABLE $t") + testNotSupportedV2Command("LOAD DATA", s"LOCAL INPATH 'filepath' INTO TABLE $t") + testNotSupportedV2Command("LOAD DATA", s"LOCAL INPATH 'filepath' OVERWRITE INTO TABLE $t") + testNotSupportedV2Command("LOAD DATA", s"LOCAL INPATH 'filepath' OVERWRITE INTO TABLE $t PARTITION(id=1)") } } @@ -1991,91 +1965,44 @@ class DataSourceV2SQLSuite val t = "testcat.ns1.ns2.tbl" withTable(t) { spark.sql(s"CREATE TABLE $t (id bigint, data string) USING foo") - testV1CommandSupportingTempView("SHOW CREATE TABLE", t) + testNotSupportedV2Command("SHOW CREATE TABLE", t) + testNotSupportedV2Command("SHOW CREATE TABLE", s"$t AS SERDE") } } - test("CACHE TABLE") { + test("CACHE/UNCACHE TABLE") { val t = "testcat.ns1.ns2.tbl" withTable(t) { - spark.sql(s"CREATE TABLE $t (id bigint, data string) USING foo") - - testV1CommandSupportingTempView("CACHE TABLE", t) - - val e = intercept[AnalysisException] { - sql(s"CACHE LAZY TABLE $t") + def isCached(table: String): Boolean = { + spark.table(table).queryExecution.withCachedData.isInstanceOf[InMemoryRelation] } - assert(e.message.contains("CACHE TABLE is only supported with temp views or v1 tables")) - } - } - - test("UNCACHE TABLE") { - val t = "testcat.ns1.ns2.tbl" - withTable(t) { - sql(s"CREATE TABLE $t (id bigint, data string) USING foo") - - testV1CommandSupportingTempView("UNCACHE TABLE", t) - testV1CommandSupportingTempView("UNCACHE TABLE", s"IF EXISTS $t") - } - } - test("SHOW COLUMNS") { - val t = "testcat.ns1.ns2.tbl" - withTable(t) { spark.sql(s"CREATE TABLE $t (id bigint, data string) USING foo") + sql(s"CACHE TABLE $t") + assert(isCached(t)) - testV1CommandSupportingTempView("SHOW COLUMNS", s"FROM $t") - testV1CommandSupportingTempView("SHOW COLUMNS", s"IN $t") - - val e3 = intercept[AnalysisException] { - sql(s"SHOW COLUMNS FROM tbl IN testcat.ns1.ns2") - } - assert(e3.message.contains("Namespace name should have " + - "only one part if specified: testcat.ns1.ns2")) + sql(s"UNCACHE TABLE $t") + assert(!isCached(t)) } - } - test("ALTER TABLE RECOVER PARTITIONS") { - val t = "testcat.ns1.ns2.tbl" - withTable(t) { - spark.sql(s"CREATE TABLE $t (id bigint, data string) USING foo") - val e = intercept[AnalysisException] { - sql(s"ALTER TABLE $t RECOVER PARTITIONS") - } - assert(e.message.contains("ALTER TABLE RECOVER PARTITIONS is only supported with v1 tables")) + // Test a scenario where a table does not exist. + val e = intercept[AnalysisException] { + sql(s"UNCACHE TABLE $t") } - } + assert(e.message.contains("Table or view not found: testcat.ns1.ns2.tbl")) - test("ALTER TABLE ADD PARTITION") { - val t = "testcat.ns1.ns2.tbl" - withTable(t) { - spark.sql(s"CREATE TABLE $t (id bigint, data string) USING foo PARTITIONED BY (id)") - val e = intercept[AnalysisException] { - sql(s"ALTER TABLE $t ADD PARTITION (id=1) LOCATION 'loc'") - } - assert(e.message.contains("ALTER TABLE ADD PARTITION is only supported with v1 tables")) - } + // If "IF EXISTS" is set, UNCACHE TABLE will not throw an exception. + sql(s"UNCACHE TABLE IF EXISTS $t") } - test("ALTER TABLE RENAME PARTITION") { + test("SHOW COLUMNS") { val t = "testcat.ns1.ns2.tbl" withTable(t) { - spark.sql(s"CREATE TABLE $t (id bigint, data string) USING foo PARTITIONED BY (id)") - val e = intercept[AnalysisException] { - sql(s"ALTER TABLE $t PARTITION (id=1) RENAME TO PARTITION (id=2)") - } - assert(e.message.contains("ALTER TABLE RENAME PARTITION is only supported with v1 tables")) - } - } + spark.sql(s"CREATE TABLE $t (id bigint, data string) USING foo") - test("ALTER TABLE DROP PARTITIONS") { - val t = "testcat.ns1.ns2.tbl" - withTable(t) { - spark.sql(s"CREATE TABLE $t (id bigint, data string) USING foo PARTITIONED BY (id)") - val e = intercept[AnalysisException] { - sql(s"ALTER TABLE $t DROP PARTITION (id=1)") - } - assert(e.message.contains("ALTER TABLE DROP PARTITION is only supported with v1 tables")) + testNotSupportedV2Command("SHOW COLUMNS", s"FROM $t") + testNotSupportedV2Command("SHOW COLUMNS", s"IN $t") + testNotSupportedV2Command("SHOW COLUMNS", "FROM tbl IN testcat.ns1.ns2") } } @@ -2086,22 +2013,15 @@ class DataSourceV2SQLSuite val e = intercept[AnalysisException] { sql(s"ALTER TABLE $t SET SERDEPROPERTIES ('columns'='foo,bar', 'field.delim' = ',')") } - assert(e.message.contains("ALTER TABLE SerDe Properties is only supported with v1 tables")) + assert(e.message.contains( + "ALTER TABLE ... SET [SERDE|SERDEPROPERTIES] is not supported for v2 tables")) } } - test("ALTER VIEW AS QUERY") { - val v = "testcat.ns1.ns2.v" - val e = intercept[AnalysisException] { - sql(s"ALTER VIEW $v AS SELECT 1") - } - assert(e.message.contains("ALTER VIEW QUERY is only supported with temp views or v1 tables")) - } - test("CREATE VIEW") { val v = "testcat.ns1.ns2.v" val e = intercept[AnalysisException] { - sql(s"CREATE VIEW $v AS SELECT * FROM tab1") + sql(s"CREATE VIEW $v AS SELECT 1") } assert(e.message.contains("CREATE VIEW is only supported with v1 tables")) } @@ -2166,13 +2086,12 @@ class DataSourceV2SQLSuite val e = intercept[AnalysisException] { sql("DESCRIBE FUNCTION testcat.ns1.ns2.fun") } - assert(e.message.contains("DESCRIBE FUNCTION is only supported in v1 catalog")) + assert(e.message.contains("function is only supported in v1 catalog")) val e1 = intercept[AnalysisException] { sql("DESCRIBE FUNCTION default.ns1.ns2.fun") } - assert(e1.message.contains( - "The namespace in session catalog must have exactly one name part: default.ns1.ns2.fun")) + assert(e1.message.contains("Unsupported function name 'default.ns1.ns2.fun'")) } test("SHOW FUNCTIONS not valid v1 namespace") { @@ -2181,33 +2100,44 @@ class DataSourceV2SQLSuite val e = intercept[AnalysisException] { sql(s"SHOW FUNCTIONS LIKE $function") } - assert(e.message.contains("SHOW FUNCTIONS is only supported in v1 catalog")) + assert(e.message.contains("function is only supported in v1 catalog")) } test("DROP FUNCTION: only support session catalog") { val e = intercept[AnalysisException] { sql("DROP FUNCTION testcat.ns1.ns2.fun") } - assert(e.message.contains("DROP FUNCTION is only supported in v1 catalog")) + assert(e.message.contains("function is only supported in v1 catalog")) val e1 = intercept[AnalysisException] { sql("DROP FUNCTION default.ns1.ns2.fun") } - assert(e1.message.contains( - "The namespace in session catalog must have exactly one name part: default.ns1.ns2.fun")) + assert(e1.message.contains("Unsupported function name 'default.ns1.ns2.fun'")) } test("CREATE FUNCTION: only support session catalog") { val e = intercept[AnalysisException] { sql("CREATE FUNCTION testcat.ns1.ns2.fun as 'f'") } - assert(e.message.contains("CREATE FUNCTION is only supported in v1 catalog")) + assert(e.message.contains("function is only supported in v1 catalog")) val e1 = intercept[AnalysisException] { sql("CREATE FUNCTION default.ns1.ns2.fun as 'f'") } + assert(e1.message.contains("Unsupported function name 'default.ns1.ns2.fun'")) + } + + test("REFRESH FUNCTION: only support session catalog") { + val e = intercept[AnalysisException] { + sql("REFRESH FUNCTION testcat.ns1.ns2.fun") + } + assert(e.message.contains("function is only supported in v1 catalog")) + + val e1 = intercept[AnalysisException] { + sql("REFRESH FUNCTION default.ns1.ns2.fun") + } assert(e1.message.contains( - "The namespace in session catalog must have exactly one name part: default.ns1.ns2.fun")) + "Unsupported function name 'default.ns1.ns2.fun'")) } test("global temp view should not be masked by v2 catalog") { @@ -2241,11 +2171,11 @@ class DataSourceV2SQLSuite val e = intercept[AnalysisException] { // Since the following multi-part name starts with `globalTempDB`, it is resolved to - // the session catalog, not the `gloabl_temp` v2 catalog. + // the session catalog, not the `global_temp` v2 catalog. sql(s"CREATE TABLE $globalTempDB.ns1.ns2.tbl (id bigint, data string) USING json") } assert(e.message.contains( - "The namespace in session catalog must have exactly one name part: global_temp.ns1.ns2.tbl")) + "global_temp.ns1.ns2.tbl is not a valid TableIdentifier as it has more than 2 name parts.")) } test("table name same as catalog can be used") { @@ -2274,10 +2204,29 @@ class DataSourceV2SQLSuite sql("CREATE TABLE t USING json AS SELECT 1 AS i") val t = "spark_catalog.t" + def verify(sql: String): Unit = { val e = intercept[AnalysisException](spark.sql(sql)) - assert(e.message.contains( - s"The namespace in session catalog must have exactly one name part: $t")) + assert(e.message.contains(s"Table or view not found: $t"), + s"Error message did not contain expected text while evaluting $sql") + } + + def verifyView(sql: String): Unit = { + val e = intercept[AnalysisException](spark.sql(sql)) + assert(e.message.contains(s"View not found: $t"), + s"Error message did not contain expected text while evaluting $sql") + } + + def verifyTable(sql: String): Unit = { + val e = intercept[AnalysisException](spark.sql(sql)) + assert(e.message.contains(s"Table not found: $t"), + s"Error message did not contain expected text while evaluting $sql") + } + + def verifyGeneric(sql: String): Unit = { + val e = intercept[AnalysisException](spark.sql(sql)) + assert(e.message.contains(s"not found: $t"), + s"Error message did not contain expected text while evaluting $sql") } verify(s"select * from $t") @@ -2285,17 +2234,16 @@ class DataSourceV2SQLSuite verify(s"REFRESH TABLE $t") verify(s"DESCRIBE $t i") verify(s"DROP TABLE $t") - verify(s"DROP VIEW $t") - verify(s"ANALYZE TABLE $t COMPUTE STATISTICS") - verify(s"ANALYZE TABLE $t COMPUTE STATISTICS FOR ALL COLUMNS") - verify(s"MSCK REPAIR TABLE $t") - verify(s"LOAD DATA INPATH 'filepath' INTO TABLE $t") - verify(s"SHOW CREATE TABLE $t") - verify(s"SHOW CREATE TABLE $t AS SERDE") - verify(s"CACHE TABLE $t") - verify(s"UNCACHE TABLE $t") - verify(s"TRUNCATE TABLE $t") - verify(s"SHOW PARTITIONS $t") + verifyView(s"DROP VIEW $t") + verifyGeneric(s"ANALYZE TABLE $t COMPUTE STATISTICS") + verifyGeneric(s"ANALYZE TABLE $t COMPUTE STATISTICS FOR ALL COLUMNS") + verifyTable(s"MSCK REPAIR TABLE $t") + verifyTable(s"LOAD DATA INPATH 'filepath' INTO TABLE $t") + verifyGeneric(s"SHOW CREATE TABLE $t") + verifyGeneric(s"SHOW CREATE TABLE $t AS SERDE") + verifyGeneric(s"CACHE TABLE $t") + verifyGeneric(s"UNCACHE TABLE $t") + verifyGeneric(s"TRUNCATE TABLE $t") verify(s"SHOW COLUMNS FROM $t") } } @@ -2342,6 +2290,7 @@ class DataSourceV2SQLSuite spark.conf.unset(V2_SESSION_CATALOG_IMPLEMENTATION.key) val sessionCatalogName = CatalogManager.SESSION_CATALOG_NAME + sql("CREATE NAMESPACE testcat.ns1.ns2") sql("USE testcat.ns1.ns2") sql("CREATE TABLE t USING foo AS SELECT 1 col") checkAnswer(spark.table("t"), Row(1)) @@ -2421,7 +2370,8 @@ class DataSourceV2SQLSuite withTempView("v") { sql("create global temp view v as select 1") val e = intercept[AnalysisException](sql("COMMENT ON TABLE global_temp.v IS NULL")) - assert(e.getMessage.contains("global_temp.v is a temp view not table.")) + assert(e.getMessage.contains( + "global_temp.v is a temp view. 'COMMENT ON TABLE' expects a table")) } } @@ -2441,7 +2391,7 @@ class DataSourceV2SQLSuite sql(s"CACHE TABLE $sessionCatalogName.v") ) assert(e1.message.contains( - "The namespace in session catalog must have exactly one name part: spark_catalog.v")) + "Table or view not found: spark_catalog.v")) } val e2 = intercept[AnalysisException] { sql(s"CREATE TEMP VIEW $sessionCatalogName.v AS SELECT 1") @@ -2476,18 +2426,407 @@ class DataSourceV2SQLSuite } } - private def testV1Command(sqlCommand: String, sqlParams: String): Unit = { - val e = intercept[AnalysisException] { - sql(s"$sqlCommand $sqlParams") + test("SPARK-32168: INSERT OVERWRITE - hidden days partition - dynamic mode") { + def testTimestamp(daysOffset: Int): Timestamp = { + Timestamp.valueOf(LocalDate.of(2020, 1, 1 + daysOffset).atStartOfDay()) + } + + withSQLConf(PARTITION_OVERWRITE_MODE.key -> PartitionOverwriteMode.DYNAMIC.toString) { + val t1 = s"${catalogAndNamespace}tbl" + withTable(t1) { + val df = spark.createDataFrame(Seq( + (testTimestamp(1), "a"), + (testTimestamp(2), "b"), + (testTimestamp(3), "c"))).toDF("ts", "data") + df.createOrReplaceTempView("source_view") + + sql(s"CREATE TABLE $t1 (ts timestamp, data string) " + + s"USING $v2Format PARTITIONED BY (days(ts))") + sql(s"INSERT INTO $t1 VALUES " + + s"(CAST(date_add('2020-01-01', 2) AS timestamp), 'dummy'), " + + s"(CAST(date_add('2020-01-01', 4) AS timestamp), 'keep')") + sql(s"INSERT OVERWRITE TABLE $t1 SELECT ts, data FROM source_view") + + val expected = spark.createDataFrame(Seq( + (testTimestamp(1), "a"), + (testTimestamp(2), "b"), + (testTimestamp(3), "c"), + (testTimestamp(4), "keep"))).toDF("ts", "data") + + verifyTable(t1, expected) + } + } + } + + test("SPARK-31255: Project a metadata column") { + val t1 = s"${catalogAndNamespace}table" + withTable(t1) { + sql(s"CREATE TABLE $t1 (id bigint, data string) USING $v2Format " + + "PARTITIONED BY (bucket(4, id), id)") + sql(s"INSERT INTO $t1 VALUES (1, 'a'), (2, 'b'), (3, 'c')") + + val sqlQuery = spark.sql(s"SELECT id, data, index, _partition FROM $t1") + val dfQuery = spark.table(t1).select("id", "data", "index", "_partition") + + Seq(sqlQuery, dfQuery).foreach { query => + checkAnswer(query, Seq(Row(1, "a", 0, "3/1"), Row(2, "b", 0, "0/2"), Row(3, "c", 0, "1/3"))) + } + } + } + + test("SPARK-31255: Projects data column when metadata column has the same name") { + val t1 = s"${catalogAndNamespace}table" + withTable(t1) { + sql(s"CREATE TABLE $t1 (index bigint, data string) USING $v2Format " + + "PARTITIONED BY (bucket(4, index), index)") + sql(s"INSERT INTO $t1 VALUES (3, 'c'), (2, 'b'), (1, 'a')") + + val sqlQuery = spark.sql(s"SELECT index, data, _partition FROM $t1") + val dfQuery = spark.table(t1).select("index", "data", "_partition") + + Seq(sqlQuery, dfQuery).foreach { query => + checkAnswer(query, Seq(Row(3, "c", "1/3"), Row(2, "b", "0/2"), Row(1, "a", "3/1"))) + } + } + } + + test("SPARK-31255: * expansion does not include metadata columns") { + val t1 = s"${catalogAndNamespace}table" + withTable(t1) { + sql(s"CREATE TABLE $t1 (id bigint, data string) USING $v2Format " + + "PARTITIONED BY (bucket(4, id), id)") + sql(s"INSERT INTO $t1 VALUES (3, 'c'), (2, 'b'), (1, 'a')") + + val sqlQuery = spark.sql(s"SELECT * FROM $t1") + val dfQuery = spark.table(t1) + + Seq(sqlQuery, dfQuery).foreach { query => + checkAnswer(query, Seq(Row(3, "c"), Row(2, "b"), Row(1, "a"))) + } + } + } + + test("SPARK-31255: metadata column should only be produced when necessary") { + val t1 = s"${catalogAndNamespace}table" + withTable(t1) { + sql(s"CREATE TABLE $t1 (id bigint, data string) USING $v2Format " + + "PARTITIONED BY (bucket(4, id), id)") + + val sqlQuery = spark.sql(s"SELECT * FROM $t1 WHERE index = 0") + val dfQuery = spark.table(t1).filter("index = 0") + + Seq(sqlQuery, dfQuery).foreach { query => + assert(query.schema.fieldNames.toSeq == Seq("id", "data")) + } + } + } + + test("SPARK-34547: metadata columns are resolved last") { + val t1 = s"${catalogAndNamespace}tableOne" + val t2 = "t2" + withTable(t1) { + sql(s"CREATE TABLE $t1 (id bigint, data string) USING $v2Format " + + "PARTITIONED BY (bucket(4, id), id)") + sql(s"INSERT INTO $t1 VALUES (1, 'a'), (2, 'b'), (3, 'c')") + withTempView(t2) { + sql(s"CREATE TEMPORARY VIEW $t2 AS SELECT * FROM " + + s"VALUES (1, -1), (2, -2), (3, -3) AS $t2(id, index)") + + val sqlQuery = spark.sql(s"SELECT $t1.id, $t2.id, data, index, $t1.index, $t2.index FROM " + + s"$t1 JOIN $t2 WHERE $t1.id = $t2.id") + val t1Table = spark.table(t1) + val t2Table = spark.table(t2) + val dfQuery = t1Table.join(t2Table, t1Table.col("id") === t2Table.col("id")) + .select(s"$t1.id", s"$t2.id", "data", "index", s"$t1.index", s"$t2.index") + + Seq(sqlQuery, dfQuery).foreach { query => + checkAnswer(query, + Seq( + Row(1, 1, "a", -1, 0, -1), + Row(2, 2, "b", -2, 0, -2), + Row(3, 3, "c", -3, 0, -3) + ) + ) + } + } + } + } + + test("SPARK-33505: insert into partitioned table") { + val t = "testpart.ns1.ns2.tbl" + withTable(t) { + sql(s""" + |CREATE TABLE $t (id bigint, city string, data string) + |USING foo + |PARTITIONED BY (id, city)""".stripMargin) + val partTable = catalog("testpart").asTableCatalog + .loadTable(Identifier.of(Array("ns1", "ns2"), "tbl")).asInstanceOf[InMemoryPartitionTable] + val expectedPartitionIdent = InternalRow.fromSeq(Seq(1, UTF8String.fromString("NY"))) + assert(!partTable.partitionExists(expectedPartitionIdent)) + sql(s"INSERT INTO $t PARTITION(id = 1, city = 'NY') SELECT 'abc'") + assert(partTable.partitionExists(expectedPartitionIdent)) + // Insert into the existing partition must not fail + sql(s"INSERT INTO $t PARTITION(id = 1, city = 'NY') SELECT 'def'") + assert(partTable.partitionExists(expectedPartitionIdent)) + } + } + + test("View commands are not supported in v2 catalogs") { + def validateViewCommand( + sql: String, + catalogName: String, + viewName: String, + cmdName: String): Unit = { + assertAnalysisError( + sql, + s"Cannot specify catalog `$catalogName` for view $viewName because view support " + + s"in v2 catalog has not been implemented yet. $cmdName expects a view.") + } + + validateViewCommand("DROP VIEW testcat.v", "testcat", "v", "DROP VIEW") + validateViewCommand( + "ALTER VIEW testcat.v SET TBLPROPERTIES ('key' = 'val')", + "testcat", + "v", + "ALTER VIEW ... SET TBLPROPERTIES") + validateViewCommand( + "ALTER VIEW testcat.v UNSET TBLPROPERTIES ('key')", + "testcat", + "v", + "ALTER VIEW ... UNSET TBLPROPERTIES") + validateViewCommand( + "ALTER VIEW testcat.v AS SELECT 1", + "testcat", + "v", + "ALTER VIEW ... AS") + } + + test("SPARK-33924: INSERT INTO .. PARTITION preserves the partition location") { + val t = "testpart.ns1.ns2.tbl" + withTable(t) { + sql(s""" + |CREATE TABLE $t (id bigint, city string, data string) + |USING foo + |PARTITIONED BY (id, city)""".stripMargin) + val partTable = catalog("testpart").asTableCatalog + .loadTable(Identifier.of(Array("ns1", "ns2"), "tbl")).asInstanceOf[InMemoryPartitionTable] + + val loc = "partition_location" + sql(s"ALTER TABLE $t ADD PARTITION (id = 1, city = 'NY') LOCATION '$loc'") + + val ident = InternalRow.fromSeq(Seq(1, UTF8String.fromString("NY"))) + assert(partTable.loadPartitionMetadata(ident).get("location") === loc) + + sql(s"INSERT INTO $t PARTITION(id = 1, city = 'NY') SELECT 'abc'") + assert(partTable.loadPartitionMetadata(ident).get("location") === loc) + } + } + + test("SPARK-34468: rename table in place when the destination name has single part") { + val tbl = s"${catalogAndNamespace}src_tbl" + withTable(tbl) { + sql(s"CREATE TABLE $tbl (c0 INT) USING $v2Format") + sql(s"INSERT INTO $tbl SELECT 0") + checkAnswer(sql(s"SHOW TABLES FROM testcat.ns1.ns2 LIKE 'new_tbl'"), Nil) + sql(s"ALTER TABLE $tbl RENAME TO new_tbl") + checkAnswer( + sql(s"SHOW TABLES FROM testcat.ns1.ns2 LIKE 'new_tbl'"), + Row("ns1.ns2", "new_tbl", false)) + checkAnswer(sql(s"SELECT c0 FROM ${catalogAndNamespace}new_tbl"), Row(0)) + } + } + + test("SPARK-34555: Resolve DataFrame metadata column") { + val tbl = s"${catalogAndNamespace}table" + withTable(tbl) { + sql(s"CREATE TABLE $tbl (id bigint, data string) USING $v2Format " + + "PARTITIONED BY (bucket(4, id), id)") + sql(s"INSERT INTO $tbl VALUES (1, 'a'), (2, 'b'), (3, 'c')") + val table = spark.table(tbl) + val dfQuery = table.select( + table.col("id"), + table.col("data"), + table.col("index"), + table.col("_partition") + ) + + checkAnswer( + dfQuery, + Seq(Row(1, "a", 0, "3/1"), Row(2, "b", 0, "0/2"), Row(3, "c", 0, "1/3")) + ) + } + } + + test("SPARK-34561: drop/add columns to a dataset of `DESCRIBE TABLE`") { + val tbl = s"${catalogAndNamespace}tbl" + withTable(tbl) { + sql(s"CREATE TABLE $tbl (c0 INT) USING $v2Format") + val description = sql(s"DESCRIBE TABLE $tbl") + val noCommentDataset = description.drop("comment") + val expectedSchema = new StructType() + .add( + name = "col_name", + dataType = StringType, + nullable = false, + metadata = new MetadataBuilder().putString("comment", "name of the column").build()) + .add( + name = "data_type", + dataType = StringType, + nullable = false, + metadata = new MetadataBuilder().putString("comment", "data type of the column").build()) + assert(noCommentDataset.schema === expectedSchema) + val isNullDataset = noCommentDataset + .withColumn("is_null", noCommentDataset("col_name").isNull) + assert(isNullDataset.schema === expectedSchema.add("is_null", BooleanType, false)) + } + } + + test("SPARK-34576: drop/add columns to a dataset of `DESCRIBE COLUMN`") { + val tbl = s"${catalogAndNamespace}tbl" + withTable(tbl) { + sql(s"CREATE TABLE $tbl (c0 INT) USING $v2Format") + val description = sql(s"DESCRIBE TABLE $tbl c0") + val noCommentDataset = description.drop("info_value") + val expectedSchema = new StructType() + .add( + name = "info_name", + dataType = StringType, + nullable = false, + metadata = new MetadataBuilder().putString("comment", "name of the column info").build()) + assert(noCommentDataset.schema === expectedSchema) + val isNullDataset = noCommentDataset + .withColumn("is_null", noCommentDataset("info_name").isNull) + assert(isNullDataset.schema === expectedSchema.add("is_null", BooleanType, false)) + } + } + + test("SPARK-34577: drop/add columns to a dataset of `DESCRIBE NAMESPACE`") { + withNamespace("ns") { + sql("CREATE NAMESPACE ns") + val description = sql(s"DESCRIBE NAMESPACE ns") + val noCommentDataset = description.drop("info_name") + val expectedSchema = new StructType() + .add( + name = "info_value", + dataType = StringType, + nullable = true, + metadata = new MetadataBuilder() + .putString("comment", "value of the namespace info").build()) + assert(noCommentDataset.schema === expectedSchema) + val isNullDataset = noCommentDataset + .withColumn("is_null", noCommentDataset("info_value").isNull) + assert(isNullDataset.schema === expectedSchema.add("is_null", BooleanType, false)) + } + } + + test("SPARK-34923: do not propagate metadata columns through Project") { + val t1 = s"${catalogAndNamespace}table" + withTable(t1) { + sql(s"CREATE TABLE $t1 (id bigint, data string) USING $v2Format " + + "PARTITIONED BY (bucket(4, id), id)") + sql(s"INSERT INTO $t1 VALUES (1, 'a'), (2, 'b'), (3, 'c')") + + assertThrows[AnalysisException] { + sql(s"SELECT index, _partition from (SELECT id, data FROM $t1)") + } + assertThrows[AnalysisException] { + spark.table(t1).select("id", "data").select("index", "_partition") + } + } + } + + test("SPARK-34923: do not propagate metadata columns through View") { + val t1 = s"${catalogAndNamespace}table" + val view = "view" + + withTable(t1) { + withTempView(view) { + sql(s"CREATE TABLE $t1 (id bigint, data string) USING $v2Format " + + "PARTITIONED BY (bucket(4, id), id)") + sql(s"INSERT INTO $t1 VALUES (1, 'a'), (2, 'b'), (3, 'c')") + sql(s"CACHE TABLE $view AS SELECT * FROM $t1") + assertThrows[AnalysisException] { + sql(s"SELECT index, _partition FROM $view") + } + } + } + } + + test("SPARK-34923: propagate metadata columns through Filter") { + val t1 = s"${catalogAndNamespace}table" + withTable(t1) { + sql(s"CREATE TABLE $t1 (id bigint, data string) USING $v2Format " + + "PARTITIONED BY (bucket(4, id), id)") + sql(s"INSERT INTO $t1 VALUES (1, 'a'), (2, 'b'), (3, 'c')") + + val sqlQuery = spark.sql(s"SELECT id, data, index, _partition FROM $t1 WHERE id > 1") + val dfQuery = spark.table(t1).where("id > 1").select("id", "data", "index", "_partition") + + Seq(sqlQuery, dfQuery).foreach { query => + checkAnswer(query, Seq(Row(2, "b", 0, "0/2"), Row(3, "c", 0, "1/3"))) + } + } + } + + test("SPARK-34923: propagate metadata columns through Sort") { + val t1 = s"${catalogAndNamespace}table" + withTable(t1) { + sql(s"CREATE TABLE $t1 (id bigint, data string) USING $v2Format " + + "PARTITIONED BY (bucket(4, id), id)") + sql(s"INSERT INTO $t1 VALUES (1, 'a'), (2, 'b'), (3, 'c')") + + val sqlQuery = spark.sql(s"SELECT id, data, index, _partition FROM $t1 ORDER BY id") + val dfQuery = spark.table(t1).orderBy("id").select("id", "data", "index", "_partition") + + Seq(sqlQuery, dfQuery).foreach { query => + checkAnswer(query, Seq(Row(1, "a", 0, "3/1"), Row(2, "b", 0, "0/2"), Row(3, "c", 0, "1/3"))) + } + } + } + + test("SPARK-34923: propagate metadata columns through RepartitionBy") { + val t1 = s"${catalogAndNamespace}table" + withTable(t1) { + sql(s"CREATE TABLE $t1 (id bigint, data string) USING $v2Format " + + "PARTITIONED BY (bucket(4, id), id)") + sql(s"INSERT INTO $t1 VALUES (1, 'a'), (2, 'b'), (3, 'c')") + + val sqlQuery = spark.sql( + s"SELECT /*+ REPARTITION_BY_RANGE(3, id) */ id, data, index, _partition FROM $t1") + val tbl = spark.table(t1) + val dfQuery = tbl.repartitionByRange(3, tbl.col("id")) + .select("id", "data", "index", "_partition") + + Seq(sqlQuery, dfQuery).foreach { query => + checkAnswer(query, Seq(Row(1, "a", 0, "3/1"), Row(2, "b", 0, "0/2"), Row(3, "c", 0, "1/3"))) + } + } + } + + test("SPARK-34923: propagate metadata columns through SubqueryAlias") { + val t1 = s"${catalogAndNamespace}table" + val sbq = "sbq" + withTable(t1) { + sql(s"CREATE TABLE $t1 (id bigint, data string) USING $v2Format " + + "PARTITIONED BY (bucket(4, id), id)") + sql(s"INSERT INTO $t1 VALUES (1, 'a'), (2, 'b'), (3, 'c')") + + val sqlQuery = spark.sql( + s"SELECT $sbq.id, $sbq.data, $sbq.index, $sbq._partition FROM $t1 as $sbq") + val dfQuery = spark.table(t1).as(sbq).select( + s"$sbq.id", s"$sbq.data", s"$sbq.index", s"$sbq._partition") + + Seq(sqlQuery, dfQuery).foreach { query => + checkAnswer(query, Seq(Row(1, "a", 0, "3/1"), Row(2, "b", 0, "0/2"), Row(3, "c", 0, "1/3"))) + } } - assert(e.message.contains(s"$sqlCommand is only supported with v1 tables")) } - private def testV1CommandSupportingTempView(sqlCommand: String, sqlParams: String): Unit = { + private def testNotSupportedV2Command(sqlCommand: String, sqlParams: String): Unit = { val e = intercept[AnalysisException] { sql(s"$sqlCommand $sqlParams") } - assert(e.message.contains(s"$sqlCommand is only supported with temp views or v1 tables")) + assert(e.message.contains(s"$sqlCommand is not supported for v2 tables")) } private def assertAnalysisError(sqlStatement: String, expectedError: String): Unit = { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2Suite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2Suite.scala index 2d8761f872da7..49a1078800552 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2Suite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2Suite.scala @@ -157,6 +157,19 @@ class DataSourceV2Suite extends QueryTest with SharedSparkSession with AdaptiveS } } + test("SPARK-33369: Skip schema inference in DataframeWriter.save() if table provider " + + "supports external metadata") { + withTempDir { dir => + val cls = classOf[SupportsExternalMetadataWritableDataSource].getName + spark.range(10).select('id as 'i, -'id as 'j).write.format(cls) + .option("path", dir.getCanonicalPath).mode("append").save() + val schema = new StructType().add("i", "long").add("j", "long") + checkAnswer( + spark.read.format(cls).option("path", dir.getCanonicalPath).schema(schema).load(), + spark.range(10).select('id, -'id)) + } + } + test("partitioning reporting") { import org.apache.spark.sql.functions.{count, sum} Seq(classOf[PartitionAwareDataSource], classOf[JavaPartitionAwareDataSource]).foreach { cls => @@ -215,8 +228,7 @@ class DataSourceV2Suite extends QueryTest with SharedSparkSession with AdaptiveS } test("simple writable data source") { - // TODO: java implementation. - Seq(classOf[SimpleWritableDataSource]).foreach { cls => + Seq(classOf[SimpleWritableDataSource], classOf[JavaSimpleWritableDataSource]).foreach { cls => withTempPath { file => val path = file.getCanonicalPath assert(spark.read.format(cls.getName).option("path", path).load().collect().isEmpty) @@ -268,7 +280,7 @@ class DataSourceV2Suite extends QueryTest with SharedSparkSession with AdaptiveS } } // this input data will fail to read middle way. - val input = spark.range(10).select(failingUdf('id).as('i)).select('i, -'i as 'j) + val input = spark.range(15).select(failingUdf('id).as('i)).select('i, -'i as 'j) val e3 = intercept[SparkException] { input.write.format(cls.getName).option("path", path).mode("overwrite").save() } @@ -394,6 +406,35 @@ class DataSourceV2Suite extends QueryTest with SharedSparkSession with AdaptiveS checkAnswer(df, (0 until 3).map(i => Row(i))) } } + + test("SPARK-32609: DataSourceV2 with different pushedfilters should be different") { + def getScanExec(query: DataFrame): BatchScanExec = { + query.queryExecution.executedPlan.collect { + case d: BatchScanExec => d + }.head + } + + Seq(classOf[AdvancedDataSourceV2], classOf[JavaAdvancedDataSourceV2]).foreach { cls => + withClue(cls.getName) { + val df = spark.read.format(cls.getName).load() + val q1 = df.select('i).filter('i > 6) + val q2 = df.select('i).filter('i > 5) + val scan1 = getScanExec(q1) + val scan2 = getScanExec(q2) + assert(!scan1.equals(scan2)) + } + } + } + + test("SPARK-33267: push down with condition 'in (..., null)' should not throw NPE") { + Seq(classOf[AdvancedDataSourceV2], classOf[JavaAdvancedDataSourceV2]).foreach { cls => + withClue(cls.getName) { + val df = spark.read.format(cls.getName).load() + // before SPARK-33267 below query just threw NPE + df.select('i).where("i in (1, null)").collect() + } + } + } } @@ -742,6 +783,16 @@ class SimpleWriteOnlyDataSource extends SimpleWritableDataSource { } } +class SupportsExternalMetadataWritableDataSource extends SimpleWritableDataSource { + override def supportsExternalMetadata(): Boolean = true + + override def inferSchema(options: CaseInsensitiveStringMap): StructType = { + throw new IllegalArgumentException( + "Dataframe writer should not require inferring table schema the data source supports" + + " external metadata.") + } +} + class ReportStatisticsDataSource extends SimpleWritableDataSource { class MyScanBuilder extends SimpleScanBuilder diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2UtilsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2UtilsSuite.scala index 01fcced5b12a8..a58bab276a41b 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2UtilsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/DataSourceV2UtilsSuite.scala @@ -37,8 +37,8 @@ class DataSourceV2UtilsSuite extends SparkFunSuite { val source = new DataSourceV2WithSessionConfig val confs = DataSourceV2Utils.extractSessionConfigs(source, conf) assert(confs.size == 2) - assert(confs.keySet.filter(_.startsWith("spark.datasource")).size == 0) - assert(confs.keySet.filter(_.startsWith("not.exist.prefix")).size == 0) + assert(!confs.keySet.exists(_.startsWith("spark.datasource"))) + assert(!confs.keySet.exists(_.startsWith("not.exist.prefix"))) assert(confs.keySet.contains("foo.bar")) assert(confs.keySet.contains("whateverConfigName")) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/DatasourceV2SQLBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/DatasourceV2SQLBase.scala new file mode 100644 index 0000000000000..77a515b55ce76 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/DatasourceV2SQLBase.scala @@ -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. + */ + +package org.apache.spark.sql.connector + +import org.scalatest.BeforeAndAfter + +import org.apache.spark.sql.QueryTest +import org.apache.spark.sql.connector.catalog.{CatalogPlugin, InMemoryCatalog, InMemoryPartitionTableCatalog, StagingInMemoryTableCatalog} +import org.apache.spark.sql.internal.SQLConf.V2_SESSION_CATALOG_IMPLEMENTATION +import org.apache.spark.sql.test.SharedSparkSession + +trait DatasourceV2SQLBase + extends QueryTest with SharedSparkSession with BeforeAndAfter { + + protected def catalog(name: String): CatalogPlugin = { + spark.sessionState.catalogManager.catalog(name) + } + + before { + spark.conf.set("spark.sql.catalog.testcat", classOf[InMemoryCatalog].getName) + spark.conf.set("spark.sql.catalog.testpart", classOf[InMemoryPartitionTableCatalog].getName) + spark.conf.set( + "spark.sql.catalog.testcat_atomic", classOf[StagingInMemoryTableCatalog].getName) + spark.conf.set("spark.sql.catalog.testcat2", classOf[InMemoryCatalog].getName) + spark.conf.set( + V2_SESSION_CATALOG_IMPLEMENTATION.key, classOf[InMemoryTableSessionCatalog].getName) + + val df = spark.createDataFrame(Seq((1L, "a"), (2L, "b"), (3L, "c"))).toDF("id", "data") + df.createOrReplaceTempView("source") + val df2 = spark.createDataFrame(Seq((4L, "d"), (5L, "e"), (6L, "f"))).toDF("id", "data") + df2.createOrReplaceTempView("source2") + } + + after { + spark.sessionState.catalog.reset() + spark.sessionState.catalogManager.reset() + spark.sessionState.conf.clear() + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/InsertIntoTests.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/InsertIntoTests.scala index b88ad5218fcd2..ad730376b2e3a 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/InsertIntoTests.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/InsertIntoTests.scala @@ -446,21 +446,18 @@ trait InsertIntoSQLOnlyTests } } - test("InsertInto: overwrite - multiple static partitions - dynamic mode") { - // Since all partitions are provided statically, this should be supported by everyone - withSQLConf(PARTITION_OVERWRITE_MODE.key -> PartitionOverwriteMode.DYNAMIC.toString) { - val t1 = s"${catalogAndNamespace}tbl" - withTableAndData(t1) { view => - sql(s"CREATE TABLE $t1 (id bigint, data string, p int) " + - s"USING $v2Format PARTITIONED BY (id, p)") - sql(s"INSERT INTO $t1 VALUES (2L, 'dummy', 2), (4L, 'keep', 2)") - sql(s"INSERT OVERWRITE TABLE $t1 PARTITION (id = 2, p = 2) SELECT data FROM $view") - verifyTable(t1, Seq( - (2, "a", 2), - (2, "b", 2), - (2, "c", 2), - (4, "keep", 2)).toDF("id", "data", "p")) - } + dynamicOverwriteTest("InsertInto: overwrite - multiple static partitions - dynamic mode") { + val t1 = s"${catalogAndNamespace}tbl" + withTableAndData(t1) { view => + sql(s"CREATE TABLE $t1 (id bigint, data string, p int) " + + s"USING $v2Format PARTITIONED BY (id, p)") + sql(s"INSERT INTO $t1 VALUES (2L, 'dummy', 2), (4L, 'keep', 2)") + sql(s"INSERT OVERWRITE TABLE $t1 PARTITION (id = 2, p = 2) SELECT data FROM $view") + verifyTable(t1, Seq( + (2, "a", 2), + (2, "b", 2), + (2, "c", 2), + (4, "keep", 2)).toDF("id", "data", "p")) } } @@ -480,5 +477,15 @@ trait InsertIntoSQLOnlyTests verifyTable(t1, spark.table(view)) } } + + test("SPARK-34599: InsertInto: overwrite - dot in the partition column name - static mode") { + import testImplicits._ + val t1 = "tbl" + withTable(t1) { + sql(s"CREATE TABLE $t1 (`a.b` string, `c.d` string) USING $v2Format PARTITIONED BY (`a.b`)") + sql(s"INSERT OVERWRITE $t1 PARTITION (`a.b` = 'a') (`c.d`) VALUES('b')") + verifyTable(t1, Seq("a" -> "b").toDF("id", "data")) + } + } } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/SimpleWritableDataSource.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/SimpleWritableDataSource.scala index f9306ba28e7f2..49a6742a85269 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/SimpleWritableDataSource.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/SimpleWritableDataSource.scala @@ -27,12 +27,10 @@ import org.apache.hadoop.fs.{FileSystem, Path} import org.apache.spark.SparkContext import org.apache.spark.sql.catalyst.InternalRow -import org.apache.spark.sql.connector.catalog.{SessionConfigSupport, SupportsWrite, Table, TableCapability} +import org.apache.spark.sql.connector.catalog.{SupportsWrite, Table, TableCapability} import org.apache.spark.sql.connector.catalog.TableCapability._ import org.apache.spark.sql.connector.read.{InputPartition, PartitionReader, PartitionReaderFactory, ScanBuilder} import org.apache.spark.sql.connector.write._ -import org.apache.spark.sql.internal.connector.SimpleTableProvider -import org.apache.spark.sql.types.StructType import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.apache.spark.util.SerializableConfiguration @@ -41,11 +39,7 @@ import org.apache.spark.util.SerializableConfiguration * Each task writes data to `target/_temporary/uniqueId/$jobId-$partitionId-$attemptNumber`. * Each job moves files from `target/_temporary/uniqueId/` to `target`. */ -class SimpleWritableDataSource extends SimpleTableProvider with SessionConfigSupport { - - private val tableSchema = new StructType().add("i", "long").add("j", "long") - - override def keyPrefix: String = "simpleWritableDataSource" +class SimpleWritableDataSource extends TestingV2Source { class MyScanBuilder(path: String, conf: Configuration) extends SimpleScanBuilder { override def planInputPartitions(): Array[InputPartition] = { @@ -67,8 +61,6 @@ class SimpleWritableDataSource extends SimpleTableProvider with SessionConfigSup val serializableConf = new SerializableConfiguration(conf) new CSVReaderFactory(serializableConf) } - - override def readSchema(): StructType = tableSchema } class MyWriteBuilder(path: String, info: LogicalWriteInfo) @@ -81,17 +73,21 @@ class SimpleWritableDataSource extends SimpleTableProvider with SessionConfigSup this } - override def buildForBatch(): BatchWrite = { - val hadoopPath = new Path(path) - val hadoopConf = SparkContext.getActive.get.hadoopConfiguration - val fs = hadoopPath.getFileSystem(hadoopConf) + override def build(): Write = { + new Write { + override def toBatch: BatchWrite = { + val hadoopPath = new Path(path) + val hadoopConf = SparkContext.getActive.get.hadoopConfiguration + val fs = hadoopPath.getFileSystem(hadoopConf) - if (needTruncate) { - fs.delete(hadoopPath, true) - } + if (needTruncate) { + fs.delete(hadoopPath, true) + } - val pathStr = hadoopPath.toUri.toString - new MyBatchWrite(queryId, pathStr, hadoopConf) + val pathStr = hadoopPath.toUri.toString + new MyBatchWrite(queryId, pathStr, hadoopConf) + } + } } } @@ -134,8 +130,6 @@ class SimpleWritableDataSource extends SimpleTableProvider with SessionConfigSup private val path = options.get("path") private val conf = SparkContext.getActive.get.hadoopConfiguration - override def schema(): StructType = tableSchema - override def newScanBuilder(options: CaseInsensitiveStringMap): ScanBuilder = { new MyScanBuilder(new Path(path).toUri.toString, conf) } @@ -179,7 +173,7 @@ class CSVReaderFactory(conf: SerializableConfiguration) } } - override def get(): InternalRow = InternalRow(currentLine.split(",").map(_.trim.toLong): _*) + override def get(): InternalRow = InternalRow(currentLine.split(",").map(_.trim.toInt): _*) override def close(): Unit = { inputStream.close() @@ -222,7 +216,7 @@ class CSVDataWriter(fs: FileSystem, file: Path) extends DataWriter[InternalRow] private val out = fs.create(file) override def write(record: InternalRow): Unit = { - out.writeBytes(s"${record.getLong(0)},${record.getLong(1)}\n") + out.writeBytes(s"${record.getInt(0)},${record.getInt(1)}\n") } override def commit(): WriterCommitMessage = { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/SupportsCatalogOptionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/SupportsCatalogOptionsSuite.scala index 550bec7505422..076dad7530807 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/SupportsCatalogOptionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/SupportsCatalogOptionsSuite.scala @@ -22,12 +22,13 @@ import scala.util.Try import org.scalatest.BeforeAndAfter +import org.apache.spark.SparkException import org.apache.spark.sql.{DataFrame, QueryTest, SaveMode} import org.apache.spark.sql.catalyst.analysis.TableAlreadyExistsException import org.apache.spark.sql.catalyst.plans.logical.{AppendData, LogicalPlan, OverwriteByExpression} -import org.apache.spark.sql.connector.catalog.{Identifier, SupportsCatalogOptions, TableCatalog} +import org.apache.spark.sql.connector.catalog.{Identifier, InMemoryTableCatalog, SupportsCatalogOptions, TableCatalog} import org.apache.spark.sql.connector.catalog.CatalogManager.SESSION_CATALOG_NAME -import org.apache.spark.sql.connector.expressions.{FieldReference, IdentityTransform, Transform} +import org.apache.spark.sql.connector.expressions.{FieldReference, IdentityTransform} import org.apache.spark.sql.execution.QueryExecution import org.apache.spark.sql.execution.datasources.v2.DataSourceV2Relation import org.apache.spark.sql.internal.SQLConf.V2_SESSION_CATALOG_IMPLEMENTATION @@ -254,6 +255,22 @@ class SupportsCatalogOptionsSuite extends QueryTest with SharedSparkSession with } } + test("SPARK-33240: fail the query when instantiation on session catalog fails") { + try { + spark.sessionState.catalogManager.reset() + spark.conf.set( + V2_SESSION_CATALOG_IMPLEMENTATION.key, "InvalidCatalogClass") + val e = intercept[SparkException] { + sql(s"create table t1 (id bigint) using $format") + } + + assert(e.getMessage.contains("Cannot find catalog plugin class")) + assert(e.getMessage.contains("InvalidCatalogClass")) + } finally { + spark.sessionState.catalogManager.reset() + } + } + private def checkV2Identifiers( plan: LogicalPlan, identifier: String = "t1", diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/TableCapabilityCheckSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/TableCapabilityCheckSuite.scala index 23e4c293cbc28..ce94d3b5c2fc0 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/TableCapabilityCheckSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/TableCapabilityCheckSuite.scala @@ -22,30 +22,33 @@ import java.util import scala.collection.JavaConverters._ import org.apache.spark.sql.{AnalysisException, DataFrame, SQLContext} -import org.apache.spark.sql.catalyst.analysis.{AnalysisSuite, NamedRelation} +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, NamedRelation} import org.apache.spark.sql.catalyst.expressions.{AttributeReference, EqualTo, Literal} import org.apache.spark.sql.catalyst.plans.logical._ -import org.apache.spark.sql.connector.catalog.{CatalogPlugin, Identifier, Table, TableCapability, TableProvider} +import org.apache.spark.sql.catalyst.streaming.StreamingRelationV2 +import org.apache.spark.sql.connector.catalog.{Table, TableCapability} import org.apache.spark.sql.connector.catalog.TableCapability._ import org.apache.spark.sql.execution.datasources.DataSource import org.apache.spark.sql.execution.datasources.v2.{DataSourceV2Relation, TableCapabilityCheck} -import org.apache.spark.sql.execution.streaming.{Offset, Source, StreamingRelation, StreamingRelationV2} +import org.apache.spark.sql.execution.streaming.{Offset, Source, StreamingRelation} import org.apache.spark.sql.sources.StreamSourceProvider import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types.{LongType, StringType, StructType} import org.apache.spark.sql.util.CaseInsensitiveStringMap -class TableCapabilityCheckSuite extends AnalysisSuite with SharedSparkSession { +class TableCapabilityCheckSuite extends AnalysisTest with SharedSparkSession { private val emptyMap = CaseInsensitiveStringMap.empty private def createStreamingRelation(table: Table, v1Relation: Option[StreamingRelation]) = { StreamingRelationV2( - new FakeV2Provider, + Some(new FakeV2Provider), "fake", table, CaseInsensitiveStringMap.empty(), TableCapabilityCheckSuite.schema.toAttributes, - v1Relation)(spark) + None, + None, + v1Relation) } private def createStreamingRelationV1() = { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala index 637cf2fd16515..bf2749d1afc53 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/TestV2SessionCatalogBase.scala @@ -19,11 +19,12 @@ package org.apache.spark.sql.connector import java.util import java.util.concurrent.ConcurrentHashMap +import java.util.concurrent.atomic.AtomicBoolean import scala.collection.JavaConverters._ -import org.apache.spark.sql.catalyst.analysis.NoSuchTableException -import org.apache.spark.sql.connector.catalog.{DelegatingCatalogExtension, Identifier, Table} +import org.apache.spark.sql.catalyst.catalog.CatalogTableType +import org.apache.spark.sql.connector.catalog.{DelegatingCatalogExtension, Identifier, Table, TableCatalog, V1Table} import org.apache.spark.sql.connector.expressions.Transform import org.apache.spark.sql.types.StructType @@ -36,6 +37,13 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating protected val tables: util.Map[Identifier, T] = new ConcurrentHashMap[Identifier, T]() + private val tableCreated: AtomicBoolean = new AtomicBoolean(false) + + private def addTable(ident: Identifier, table: T): Unit = { + tableCreated.set(true) + tables.put(ident, table) + } + protected def newTable( name: String, schema: StructType, @@ -47,10 +55,13 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating tables.get(ident) } else { // Table was created through the built-in catalog - val t = super.loadTable(ident) - val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties()) - tables.put(ident, table) - table + super.loadTable(ident) match { + case v1Table: V1Table if v1Table.v1Table.tableType == CatalogTableType.VIEW => v1Table + case t => + val table = newTable(t.name(), t.schema(), t.partitioning(), t.properties()) + addTable(ident, table) + table + } } } @@ -59,9 +70,23 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating schema: StructType, partitions: Array[Transform], properties: util.Map[String, String]): Table = { - val created = super.createTable(ident, schema, partitions, properties) - val t = newTable(created.name(), schema, partitions, properties) - tables.put(ident, t) + val key = TestV2SessionCatalogBase.SIMULATE_ALLOW_EXTERNAL_PROPERTY + val propsWithLocation = if (properties.containsKey(key)) { + // Always set a location so that CREATE EXTERNAL TABLE won't fail with LOCATION not specified. + if (!properties.containsKey(TableCatalog.PROP_LOCATION)) { + val newProps = new util.HashMap[String, String]() + newProps.putAll(properties) + newProps.put(TableCatalog.PROP_LOCATION, "file:/abc") + newProps + } else { + properties + } + } else { + properties + } + val created = super.createTable(ident, schema, partitions, propsWithLocation) + val t = newTable(created.name(), schema, partitions, propsWithLocation) + addTable(ident, t) t } @@ -71,8 +96,15 @@ private[connector] trait TestV2SessionCatalogBase[T <: Table] extends Delegating } def clearTables(): Unit = { - assert(!tables.isEmpty, "Tables were empty, maybe didn't use the session catalog code path?") + assert( + tableCreated.get, + "Tables are not created, maybe didn't use the session catalog code path?") tables.keySet().asScala.foreach(super.dropTable) tables.clear() + tableCreated.set(false) } } + +object TestV2SessionCatalogBase { + val SIMULATE_ALLOW_EXTERNAL_PROPERTY = "spark.sql.test.simulateAllowExternal" +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/V1ReadFallbackSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/V1ReadFallbackSuite.scala index 74f2ca14234d2..847953e09cef7 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/V1ReadFallbackSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/V1ReadFallbackSuite.scala @@ -23,7 +23,7 @@ import scala.collection.JavaConverters._ import org.apache.spark.rdd.RDD import org.apache.spark.sql.{DataFrame, QueryTest, Row, SparkSession, SQLContext} -import org.apache.spark.sql.connector.catalog.{Identifier, SupportsRead, Table, TableCapability, TableProvider} +import org.apache.spark.sql.connector.catalog.{BasicInMemoryTableCatalog, Identifier, SupportsRead, Table, TableCapability} import org.apache.spark.sql.connector.expressions.Transform import org.apache.spark.sql.connector.read.{Scan, ScanBuilder, SupportsPushDownFilters, SupportsPushDownRequiredColumns, V1Scan} import org.apache.spark.sql.execution.RowDataSourceScanExec diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/V1WriteFallbackSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/V1WriteFallbackSuite.scala index 10ed2048dbf61..7effc747ab323 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/connector/V1WriteFallbackSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/V1WriteFallbackSuite.scala @@ -24,11 +24,18 @@ import scala.collection.mutable import org.scalatest.BeforeAndAfter +import org.apache.spark.rdd.RDD import org.apache.spark.sql.{AnalysisException, DataFrame, QueryTest, Row, SaveMode, SparkSession, SQLContext} -import org.apache.spark.sql.connector.catalog.{SupportsWrite, Table, TableCapability} +import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan +import org.apache.spark.sql.catalyst.rules.Rule +import org.apache.spark.sql.catalyst.trees.TreeNodeTag +import org.apache.spark.sql.connector.catalog.{Identifier, InMemoryTable, SupportsRead, SupportsWrite, Table, TableCapability} import org.apache.spark.sql.connector.expressions.{FieldReference, IdentityTransform, Transform} -import org.apache.spark.sql.connector.write.{LogicalWriteInfo, LogicalWriteInfoImpl, SupportsOverwrite, SupportsTruncate, V1WriteBuilder, WriteBuilder} +import org.apache.spark.sql.connector.read.{Scan, ScanBuilder, V1Scan} +import org.apache.spark.sql.connector.write.{LogicalWriteInfo, LogicalWriteInfoImpl, SupportsOverwrite, SupportsTruncate, V1Write, WriteBuilder} import org.apache.spark.sql.execution.datasources.DataSourceUtils +import org.apache.spark.sql.functions.lit +import org.apache.spark.sql.internal.SQLConf.V2_SESSION_CATALOG_IMPLEMENTATION import org.apache.spark.sql.internal.connector.SimpleTableProvider import org.apache.spark.sql.sources._ import org.apache.spark.sql.test.SharedSparkSession @@ -124,6 +131,69 @@ class V1WriteFallbackSuite extends QueryTest with SharedSparkSession with Before } assert(e3.getMessage.contains("schema")) } + + test("fallback writes should only analyze plan once") { + SparkSession.clearActiveSession() + SparkSession.clearDefaultSession() + try { + val session = SparkSession.builder() + .master("local[1]") + .withExtensions(_.injectPostHocResolutionRule(_ => OnlyOnceRule)) + .config(V2_SESSION_CATALOG_IMPLEMENTATION.key, classOf[V1FallbackTableCatalog].getName) + .getOrCreate() + val df = session.createDataFrame(Seq((1, "x"), (2, "y"), (3, "z"))) + df.write.mode("append").option("name", "t1").format(v2Format).saveAsTable("test") + } finally { + SparkSession.setActiveSession(spark) + SparkSession.setDefaultSession(spark) + } + } + + test("SPARK-33492: append fallback should refresh cache") { + SparkSession.clearActiveSession() + SparkSession.clearDefaultSession() + try { + val session = SparkSession.builder() + .master("local[1]") + .config(V2_SESSION_CATALOG_IMPLEMENTATION.key, classOf[V1FallbackTableCatalog].getName) + .getOrCreate() + val df = session.createDataFrame(Seq((1, "x"))) + df.write.mode("append").option("name", "t1").format(v2Format).saveAsTable("test") + session.catalog.cacheTable("test") + checkAnswer(session.read.table("test"), Row(1, "x") :: Nil) + + val df2 = session.createDataFrame(Seq((2, "y"))) + df2.writeTo("test").append() + checkAnswer(session.read.table("test"), Row(1, "x") :: Row(2, "y") :: Nil) + + } finally { + SparkSession.setActiveSession(spark) + SparkSession.setDefaultSession(spark) + } + } + + test("SPARK-33492: overwrite fallback should refresh cache") { + SparkSession.clearActiveSession() + SparkSession.clearDefaultSession() + try { + val session = SparkSession.builder() + .master("local[1]") + .config(V2_SESSION_CATALOG_IMPLEMENTATION.key, classOf[V1FallbackTableCatalog].getName) + .getOrCreate() + val df = session.createDataFrame(Seq((1, "x"))) + df.write.mode("append").option("name", "t1").format(v2Format).saveAsTable("test") + session.catalog.cacheTable("test") + checkAnswer(session.read.table("test"), Row(1, "x") :: Nil) + + val df2 = session.createDataFrame(Seq((2, "y"))) + df2.writeTo("test").overwrite(lit(true)) + checkAnswer(session.read.table("test"), Row(2, "y") :: Nil) + + } finally { + SparkSession.setActiveSession(spark) + SparkSession.setDefaultSession(spark) + } + } } class V1WriteFallbackSessionCatalogSuite @@ -156,6 +226,7 @@ class V1FallbackTableCatalog extends TestV2SessionCatalogBase[InMemoryTableWithV properties: util.Map[String, String]): InMemoryTableWithV1Fallback = { val t = new InMemoryTableWithV1Fallback(name, schema, partitions, properties) InMemoryV1Provider.tables.put(name, t) + tables.put(Identifier.of(Array("default"), name), t) t } } @@ -240,7 +311,8 @@ class InMemoryV1Provider if (mode == SaveMode.Overwrite) { writer.asInstanceOf[SupportsTruncate].truncate() } - writer.asInstanceOf[V1WriteBuilder].buildForV1Write().insert(data, overwrite = false) + val write = writer.build() + write.asInstanceOf[V1Write].toInsertableRelation.insert(data, overwrite = false) getRelation } } @@ -251,7 +323,7 @@ class InMemoryTableWithV1Fallback( override val partitioning: Array[Transform], override val properties: util.Map[String, String]) extends Table - with SupportsWrite { + with SupportsWrite with SupportsRead { partitioning.foreach { t => if (!t.isInstanceOf[IdentityTransform]) { @@ -260,6 +332,7 @@ class InMemoryTableWithV1Fallback( } override def capabilities: util.Set[TableCapability] = Set( + TableCapability.BATCH_READ, TableCapability.V1_BATCH_WRITE, TableCapability.OVERWRITE_BY_FILTER, TableCapability.TRUNCATE).asJava @@ -276,7 +349,6 @@ class InMemoryTableWithV1Fallback( private class FallbackWriteBuilder(options: CaseInsensitiveStringMap) extends WriteBuilder - with V1WriteBuilder with SupportsTruncate with SupportsOverwrite { @@ -299,9 +371,9 @@ class InMemoryTableWithV1Fallback( partIndexes.map(row.get) } - override def buildForV1Write(): InsertableRelation = { - new InsertableRelation { - override def insert(data: DataFrame, overwrite: Boolean): Unit = { + override def build(): V1Write = new V1Write { + override def toInsertableRelation: InsertableRelation = { + (data: DataFrame, overwrite: Boolean) => { assert(!overwrite, "V1 write fallbacks cannot be called with overwrite=true") val rows = data.collect() rows.groupBy(getPartitionValues).foreach { case (partition, elements) => @@ -317,4 +389,49 @@ class InMemoryTableWithV1Fallback( } } } + + override def newScanBuilder(options: CaseInsensitiveStringMap): ScanBuilder = + new V1ReadFallbackScanBuilder(schema) + + private class V1ReadFallbackScanBuilder(schema: StructType) extends ScanBuilder { + override def build(): Scan = new V1ReadFallbackScan(schema) + } + + private class V1ReadFallbackScan(schema: StructType) extends V1Scan { + override def readSchema(): StructType = schema + override def toV1TableScan[T <: BaseRelation with TableScan](context: SQLContext): T = + new V1TableScan(context, schema).asInstanceOf[T] + } + + private class V1TableScan( + context: SQLContext, + requiredSchema: StructType) extends BaseRelation with TableScan { + override def sqlContext: SQLContext = context + override def schema: StructType = requiredSchema + override def buildScan(): RDD[Row] = { + val data = InMemoryV1Provider.getTableData(context.sparkSession, name).collect() + context.sparkContext.makeRDD(data) + } + } +} + +/** A rule that fails if a query plan is analyzed twice. */ +object OnlyOnceRule extends Rule[LogicalPlan] { + private val tag = TreeNodeTag[String]("test") + private val counts = new mutable.HashMap[LogicalPlan, Int]() + + override def apply(plan: LogicalPlan): LogicalPlan = { + if (plan.getTagValue(tag).isEmpty) { + plan.setTagValue(tag, "abc") + plan + } else { + val cnt = counts.getOrElseUpdate(plan, 0) + 1 + // This rule will be run as injectPostHocResolutionRule, and is supposed to be run only twice. + // Once during planning and once during checkBatchIdempotence + assert(cnt <= 1, "This rule shouldn't have been called again") + counts.put(plan, cnt) + plan + } + + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/WriteDistributionAndOrderingSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/WriteDistributionAndOrderingSuite.scala new file mode 100644 index 0000000000000..db4a9c153c0ff --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/WriteDistributionAndOrderingSuite.scala @@ -0,0 +1,801 @@ +/* + * 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. + */ + +package org.apache.spark.sql.connector + +import java.util.Collections + +import org.scalatest.BeforeAndAfter + +import org.apache.spark.sql.{catalyst, AnalysisException, DataFrame, QueryTest} +import org.apache.spark.sql.catalyst.analysis.UnresolvedAttribute +import org.apache.spark.sql.catalyst.plans.physical +import org.apache.spark.sql.catalyst.plans.physical.{HashPartitioning, RangePartitioning, UnknownPartitioning} +import org.apache.spark.sql.connector.catalog.{Identifier, InMemoryTableCatalog} +import org.apache.spark.sql.connector.distributions.{Distribution, Distributions} +import org.apache.spark.sql.connector.expressions.{Expression, FieldReference, NullOrdering, SortDirection, SortOrder} +import org.apache.spark.sql.connector.expressions.LogicalExpressions._ +import org.apache.spark.sql.execution.{QueryExecution, SortExec, SparkPlan} +import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper +import org.apache.spark.sql.execution.datasources.v2.V2TableWriteExec +import org.apache.spark.sql.execution.exchange.ShuffleExchangeLike +import org.apache.spark.sql.functions.lit +import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types.{IntegerType, StringType, StructType} +import org.apache.spark.sql.util.QueryExecutionListener + +class WriteDistributionAndOrderingSuite + extends QueryTest with SharedSparkSession with BeforeAndAfter with AdaptiveSparkPlanHelper { + + import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._ + + before { + spark.conf.set("spark.sql.catalog.testcat", classOf[InMemoryTableCatalog].getName) + } + + after { + spark.sessionState.catalogManager.reset() + spark.sessionState.conf.unsetConf("spark.sql.catalog.testcat") + } + + private val namespace = Array("ns1") + private val ident = Identifier.of(namespace, "test_table") + private val tableNameAsString = "testcat." + ident.toString + private val emptyProps = Collections.emptyMap[String, String] + private val schema = new StructType() + .add("id", IntegerType) + .add("data", StringType) + + private val resolver = conf.resolver + + test("ordered distribution and sort with same exprs: append") { + checkOrderedDistributionAndSortWithSameExprs("append") + } + + test("ordered distribution and sort with same exprs: overwrite") { + checkOrderedDistributionAndSortWithSameExprs("overwrite") + } + + test("ordered distribution and sort with same exprs: overwriteDynamic") { + checkOrderedDistributionAndSortWithSameExprs("overwriteDynamic") + } + + test("ordered distribution and sort with same exprs with numPartitions: append") { + checkOrderedDistributionAndSortWithSameExprs("append", Some(10)) + } + + test("ordered distribution and sort with same exprs with numPartitions: overwrite") { + checkOrderedDistributionAndSortWithSameExprs("overwrite", Some(10)) + } + + test("ordered distribution and sort with same exprs with numPartitions: overwriteDynamic") { + checkOrderedDistributionAndSortWithSameExprs("overwriteDynamic", Some(10)) + } + + private def checkOrderedDistributionAndSortWithSameExprs(command: String): Unit = { + checkOrderedDistributionAndSortWithSameExprs(command, None) + } + + private def checkOrderedDistributionAndSortWithSameExprs( + command: String, + targetNumPartitions: Option[Int]): Unit = { + val tableOrdering = Array[SortOrder]( + sort(FieldReference("data"), SortDirection.ASCENDING, NullOrdering.NULLS_FIRST) + ) + val tableDistribution = Distributions.ordered(tableOrdering) + + val writeOrdering = Seq( + catalyst.expressions.SortOrder( + attr("data"), + catalyst.expressions.Ascending, + catalyst.expressions.NullsFirst, + Seq.empty + ) + ) + val writePartitioning = orderedWritePartitioning(writeOrdering, targetNumPartitions) + + checkWriteRequirements( + tableDistribution, + tableOrdering, + targetNumPartitions, + expectedWritePartitioning = writePartitioning, + expectedWriteOrdering = writeOrdering, + writeCommand = command) + } + + test("clustered distribution and sort with same exprs: append") { + checkClusteredDistributionAndSortWithSameExprs("append") + } + + test("clustered distribution and sort with same exprs: overwrite") { + checkClusteredDistributionAndSortWithSameExprs("overwrite") + } + + test("clustered distribution and sort with same exprs: overwriteDynamic") { + checkClusteredDistributionAndSortWithSameExprs("overwriteDynamic") + } + + test("clustered distribution and sort with same exprs with numPartitions: append") { + checkClusteredDistributionAndSortWithSameExprs("append", Some(10)) + } + + test("clustered distribution and sort with same exprs with numPartitions: overwrite") { + checkClusteredDistributionAndSortWithSameExprs("overwrite", Some(10)) + } + + test("clustered distribution and sort with same exprs with numPartitions: overwriteDynamic") { + checkClusteredDistributionAndSortWithSameExprs("overwriteDynamic", Some(10)) + } + + private def checkClusteredDistributionAndSortWithSameExprs(command: String): Unit = { + checkClusteredDistributionAndSortWithSameExprs(command, None) + } + + private def checkClusteredDistributionAndSortWithSameExprs( + command: String, + targetNumPartitions: Option[Int]): Unit = { + val tableOrdering = Array[SortOrder]( + sort(FieldReference("data"), SortDirection.DESCENDING, NullOrdering.NULLS_FIRST), + sort(FieldReference("id"), SortDirection.ASCENDING, NullOrdering.NULLS_FIRST) + ) + val clustering = Array[Expression](FieldReference("data"), FieldReference("id")) + val tableDistribution = Distributions.clustered(clustering) + + val writeOrdering = Seq( + catalyst.expressions.SortOrder( + attr("data"), + catalyst.expressions.Descending, + catalyst.expressions.NullsFirst, + Seq.empty + ), + catalyst.expressions.SortOrder( + attr("id"), + catalyst.expressions.Ascending, + catalyst.expressions.NullsFirst, + Seq.empty + ) + ) + val writePartitioningExprs = Seq(attr("data"), attr("id")) + val writePartitioning = clusteredWritePartitioning(writePartitioningExprs, targetNumPartitions) + + checkWriteRequirements( + tableDistribution, + tableOrdering, + targetNumPartitions, + expectedWritePartitioning = writePartitioning, + expectedWriteOrdering = writeOrdering, + writeCommand = command) + } + + test("clustered distribution and sort with extended exprs: append") { + checkClusteredDistributionAndSortWithExtendedExprs("append") + } + + test("clustered distribution and sort with extended exprs: overwrite") { + checkClusteredDistributionAndSortWithExtendedExprs("overwrite") + } + + test("clustered distribution and sort with extended exprs: overwriteDynamic") { + checkClusteredDistributionAndSortWithExtendedExprs("overwriteDynamic") + } + + test("clustered distribution and sort with extended exprs with numPartitions: append") { + checkClusteredDistributionAndSortWithExtendedExprs("append", Some(10)) + } + + test("clustered distribution and sort with extended exprs with numPartitions: overwrite") { + checkClusteredDistributionAndSortWithExtendedExprs("overwrite", Some(10)) + } + + test("clustered distribution and sort with extended exprs with numPartitions: " + + "overwriteDynamic") { + checkClusteredDistributionAndSortWithExtendedExprs("overwriteDynamic", Some(10)) + } + + private def checkClusteredDistributionAndSortWithExtendedExprs(command: String): Unit = { + checkClusteredDistributionAndSortWithExtendedExprs(command, None) + } + + private def checkClusteredDistributionAndSortWithExtendedExprs( + command: String, + targetNumPartitions: Option[Int]): Unit = { + val tableOrdering = Array[SortOrder]( + sort(FieldReference("data"), SortDirection.DESCENDING, NullOrdering.NULLS_FIRST), + sort(FieldReference("id"), SortDirection.ASCENDING, NullOrdering.NULLS_FIRST) + ) + val clustering = Array[Expression](FieldReference("data")) + val tableDistribution = Distributions.clustered(clustering) + + val writeOrdering = Seq( + catalyst.expressions.SortOrder( + attr("data"), + catalyst.expressions.Descending, + catalyst.expressions.NullsFirst, + Seq.empty + ), + catalyst.expressions.SortOrder( + attr("id"), + catalyst.expressions.Ascending, + catalyst.expressions.NullsFirst, + Seq.empty + ) + ) + val writePartitioningExprs = Seq(attr("data")) + val writePartitioning = clusteredWritePartitioning(writePartitioningExprs, targetNumPartitions) + + checkWriteRequirements( + tableDistribution, + tableOrdering, + targetNumPartitions, + expectedWritePartitioning = writePartitioning, + expectedWriteOrdering = writeOrdering, + writeCommand = command) + } + + test("unspecified distribution and local sort: append") { + checkUnspecifiedDistributionAndLocalSort("append") + } + + test("unspecified distribution and local sort: overwrite") { + checkUnspecifiedDistributionAndLocalSort("overwrite") + } + + test("unspecified distribution and local sort: overwriteDynamic") { + checkUnspecifiedDistributionAndLocalSort("overwriteDynamic") + } + + test("unspecified distribution and local sort with numPartitions: append") { + checkUnspecifiedDistributionAndLocalSort("append", Some(10)) + } + + test("unspecified distribution and local sort with numPartitions: overwrite") { + checkUnspecifiedDistributionAndLocalSort("overwrite", Some(10)) + } + + test("unspecified distribution and local sort with numPartitions: overwriteDynamic") { + checkUnspecifiedDistributionAndLocalSort("overwriteDynamic", Some(10)) + } + + private def checkUnspecifiedDistributionAndLocalSort(command: String): Unit = { + checkUnspecifiedDistributionAndLocalSort(command, None) + } + + private def checkUnspecifiedDistributionAndLocalSort( + command: String, + targetNumPartitions: Option[Int]): Unit = { + val tableOrdering = Array[SortOrder]( + sort(FieldReference("data"), SortDirection.DESCENDING, NullOrdering.NULLS_FIRST) + ) + val tableDistribution = Distributions.unspecified() + + val writeOrdering = Seq( + catalyst.expressions.SortOrder( + attr("data"), + catalyst.expressions.Descending, + catalyst.expressions.NullsFirst, + Seq.empty + ) + ) + + val writePartitioning = UnknownPartitioning(0) + + checkWriteRequirements( + tableDistribution, + tableOrdering, + targetNumPartitions, + expectedWritePartitioning = writePartitioning, + expectedWriteOrdering = writeOrdering, + writeCommand = command, + // if the number of partitions is specified, we expect query to fail + expectAnalysisException = targetNumPartitions.isDefined) + } + + test("unspecified distribution and no sort: append") { + checkUnspecifiedDistributionAndNoSort("append") + } + + test("unspecified distribution and no sort: overwrite") { + checkUnspecifiedDistributionAndNoSort("overwrite") + } + + test("unspecified distribution and no sort: overwriteDynamic") { + checkUnspecifiedDistributionAndNoSort("overwriteDynamic") + } + + test("unspecified distribution and no sort with numPartitions: append") { + checkUnspecifiedDistributionAndNoSort("append", Some(10)) + } + + test("unspecified distribution and no sort with numPartitions: overwrite") { + checkUnspecifiedDistributionAndNoSort("overwrite", Some(10)) + } + + test("unspecified distribution and no sort with numPartitions: overwriteDynamic") { + checkUnspecifiedDistributionAndNoSort("overwriteDynamic", Some(10)) + } + + private def checkUnspecifiedDistributionAndNoSort(command: String): Unit = { + checkUnspecifiedDistributionAndNoSort(command, None) + } + + private def checkUnspecifiedDistributionAndNoSort( + command: String, + targetNumPartitions: Option[Int]): Unit = { + val tableOrdering = Array.empty[SortOrder] + val tableDistribution = Distributions.unspecified() + + val writeOrdering = Seq.empty[catalyst.expressions.SortOrder] + val writePartitioning = UnknownPartitioning(0) + + checkWriteRequirements( + tableDistribution, + tableOrdering, + targetNumPartitions, + expectedWritePartitioning = writePartitioning, + expectedWriteOrdering = writeOrdering, + writeCommand = command, + // if the number of partitions is specified, we expect query to fail + expectAnalysisException = targetNumPartitions.isDefined) + } + + test("ordered distribution and sort with manual global sort: append") { + checkOrderedDistributionAndSortWithManualGlobalSort("append") + } + + test("ordered distribution and sort with manual global sort: overwrite") { + checkOrderedDistributionAndSortWithManualGlobalSort("overwrite") + } + + test("ordered distribution and sort with manual global sort: overwriteDynamic") { + checkOrderedDistributionAndSortWithManualGlobalSort("overwriteDynamic") + } + + test("ordered distribution and sort with manual global sort with numPartitions: append") { + checkOrderedDistributionAndSortWithManualGlobalSort("append", Some(10)) + } + + test("ordered distribution and sort with manual global sort with numPartitions: overwrite") { + checkOrderedDistributionAndSortWithManualGlobalSort("overwrite", Some(10)) + } + + test("ordered distribution and sort with manual global sort with numPartitions: " + + "overwriteDynamic") { + checkOrderedDistributionAndSortWithManualGlobalSort("overwriteDynamic", Some(10)) + } + + private def checkOrderedDistributionAndSortWithManualGlobalSort(command: String): Unit = { + checkOrderedDistributionAndSortWithManualGlobalSort(command, None) + } + + private def checkOrderedDistributionAndSortWithManualGlobalSort( + command: String, + targetNumPartitions: Option[Int]): Unit = { + val tableOrdering = Array[SortOrder]( + sort(FieldReference("data"), SortDirection.ASCENDING, NullOrdering.NULLS_FIRST), + sort(FieldReference("id"), SortDirection.ASCENDING, NullOrdering.NULLS_FIRST) + ) + val tableDistribution = Distributions.ordered(tableOrdering) + + val writeOrdering = Seq( + catalyst.expressions.SortOrder( + attr("data"), + catalyst.expressions.Ascending, + catalyst.expressions.NullsFirst, + Seq.empty + ), + catalyst.expressions.SortOrder( + attr("id"), + catalyst.expressions.Ascending, + catalyst.expressions.NullsFirst, + Seq.empty + ) + ) + val writePartitioning = orderedWritePartitioning(writeOrdering, targetNumPartitions) + + checkWriteRequirements( + tableDistribution, + tableOrdering, + targetNumPartitions, + expectedWritePartitioning = writePartitioning, + expectedWriteOrdering = writeOrdering, + writeTransform = df => df.orderBy("data", "id"), + writeCommand = command) + } + + test("ordered distribution and sort with incompatible global sort: append") { + checkOrderedDistributionAndSortWithIncompatibleGlobalSort("append") + } + + test("ordered distribution and sort with incompatible global sort: overwrite") { + checkOrderedDistributionAndSortWithIncompatibleGlobalSort("overwrite") + } + + test("ordered distribution and sort with incompatible global sort: overwriteDynamic") { + checkOrderedDistributionAndSortWithIncompatibleGlobalSort("overwriteDynamic") + } + + test("ordered distribution and sort with incompatible global sort with numPartitions: append") { + checkOrderedDistributionAndSortWithIncompatibleGlobalSort("append", Some(10)) + } + + test("ordered distribution and sort with incompatible global sort with numPartitions: " + + "overwrite") { + checkOrderedDistributionAndSortWithIncompatibleGlobalSort("overwrite", Some(10)) + } + + test("ordered distribution and sort with incompatible global sort with numPartitions: " + + "overwriteDynamic") { + checkOrderedDistributionAndSortWithIncompatibleGlobalSort("overwriteDynamic", Some(10)) + } + + private def checkOrderedDistributionAndSortWithIncompatibleGlobalSort(command: String): Unit = { + checkOrderedDistributionAndSortWithIncompatibleGlobalSort(command, None) + } + + private def checkOrderedDistributionAndSortWithIncompatibleGlobalSort( + command: String, + targetNumPartitions: Option[Int]): Unit = { + val tableOrdering = Array[SortOrder]( + sort(FieldReference("data"), SortDirection.ASCENDING, NullOrdering.NULLS_FIRST), + sort(FieldReference("id"), SortDirection.ASCENDING, NullOrdering.NULLS_FIRST) + ) + val tableDistribution = Distributions.ordered(tableOrdering) + + val writeOrdering = Seq( + catalyst.expressions.SortOrder( + attr("data"), + catalyst.expressions.Ascending, + catalyst.expressions.NullsFirst, + Seq.empty + ), + catalyst.expressions.SortOrder( + attr("id"), + catalyst.expressions.Ascending, + catalyst.expressions.NullsFirst, + Seq.empty + ) + ) + val writePartitioning = orderedWritePartitioning(writeOrdering, targetNumPartitions) + + checkWriteRequirements( + tableDistribution, + tableOrdering, + targetNumPartitions, + expectedWritePartitioning = writePartitioning, + expectedWriteOrdering = writeOrdering, + writeTransform = df => df.orderBy(df("data").desc, df("id").asc), + writeCommand = command) + } + + test("ordered distribution and sort with manual local sort: append") { + checkOrderedDistributionAndSortWithManualLocalSort("append") + } + + test("ordered distribution and sort with manual local sort: overwrite") { + checkOrderedDistributionAndSortWithManualLocalSort("overwrite") + } + + test("ordered distribution and sort with manual local sort: overwriteDynamic") { + checkOrderedDistributionAndSortWithManualLocalSort("overwriteDynamic") + } + + test("ordered distribution and sort with manual local sort with numPartitions: append") { + checkOrderedDistributionAndSortWithManualLocalSort("append", Some(10)) + } + + test("ordered distribution and sort with manual local sort with numPartitions: overwrite") { + checkOrderedDistributionAndSortWithManualLocalSort("overwrite", Some(10)) + } + + test("ordered distribution and sort with manual local sort with numPartitions: " + + "overwriteDynamic") { + checkOrderedDistributionAndSortWithManualLocalSort("overwriteDynamic", Some(10)) + } + + private def checkOrderedDistributionAndSortWithManualLocalSort(command: String): Unit = { + checkOrderedDistributionAndSortWithManualLocalSort(command, None) + } + + private def checkOrderedDistributionAndSortWithManualLocalSort( + command: String, + targetNumPartitions: Option[Int]): Unit = { + val tableOrdering = Array[SortOrder]( + sort(FieldReference("data"), SortDirection.ASCENDING, NullOrdering.NULLS_FIRST), + sort(FieldReference("id"), SortDirection.ASCENDING, NullOrdering.NULLS_FIRST) + ) + val tableDistribution = Distributions.ordered(tableOrdering) + + val writeOrdering = Seq( + catalyst.expressions.SortOrder( + attr("data"), + catalyst.expressions.Ascending, + catalyst.expressions.NullsFirst, + Seq.empty + ), + catalyst.expressions.SortOrder( + attr("id"), + catalyst.expressions.Ascending, + catalyst.expressions.NullsFirst, + Seq.empty + ) + ) + val writePartitioning = orderedWritePartitioning(writeOrdering, targetNumPartitions) + + checkWriteRequirements( + tableDistribution, + tableOrdering, + targetNumPartitions, + expectedWritePartitioning = writePartitioning, + expectedWriteOrdering = writeOrdering, + writeTransform = df => df.sortWithinPartitions("data", "id"), + writeCommand = command) + } + + test("clustered distribution and local sort with manual global sort: append") { + checkClusteredDistributionAndLocalSortWithManualGlobalSort("append") + } + + test("clustered distribution and local sort with manual global sort: overwrite") { + checkClusteredDistributionAndLocalSortWithManualGlobalSort("overwrite") + } + + test("clustered distribution and local sort with manual global sort: overwriteDynamic") { + checkClusteredDistributionAndLocalSortWithManualGlobalSort("overwriteDynamic") + } + + test("clustered distribution and local sort with manual global sort with numPartitions: append") { + checkClusteredDistributionAndLocalSortWithManualGlobalSort("append", Some(10)) + } + + test("clustered distribution and local sort with manual global sort with numPartitions: " + + "overwrite") { + checkClusteredDistributionAndLocalSortWithManualGlobalSort("overwrite", Some(10)) + } + + test("clustered distribution and local sort with manual global sort with numPartitions: " + + "overwriteDynamic") { + checkClusteredDistributionAndLocalSortWithManualGlobalSort("overwriteDynamic", Some(10)) + } + + private def checkClusteredDistributionAndLocalSortWithManualGlobalSort(command: String): Unit = { + checkClusteredDistributionAndLocalSortWithManualGlobalSort(command, None) + } + + private def checkClusteredDistributionAndLocalSortWithManualGlobalSort( + command: String, + targetNumPartitions: Option[Int]): Unit = { + val tableOrdering = Array[SortOrder]( + sort(FieldReference("data"), SortDirection.DESCENDING, NullOrdering.NULLS_FIRST), + sort(FieldReference("id"), SortDirection.ASCENDING, NullOrdering.NULLS_FIRST) + ) + val tableDistribution = Distributions.clustered(Array(FieldReference("data"))) + + val writeOrdering = Seq( + catalyst.expressions.SortOrder( + attr("data"), + catalyst.expressions.Descending, + catalyst.expressions.NullsFirst, + Seq.empty + ), + catalyst.expressions.SortOrder( + attr("id"), + catalyst.expressions.Ascending, + catalyst.expressions.NullsFirst, + Seq.empty + ) + ) + val writePartitioningExprs = Seq(attr("data")) + val writePartitioning = clusteredWritePartitioning(writePartitioningExprs, targetNumPartitions) + + checkWriteRequirements( + tableDistribution, + tableOrdering, + targetNumPartitions, + expectedWritePartitioning = writePartitioning, + expectedWriteOrdering = writeOrdering, + writeTransform = df => df.orderBy("data", "id"), + writeCommand = command) + } + + test("clustered distribution and local sort with manual local sort: append") { + checkClusteredDistributionAndLocalSortWithManualLocalSort("append") + } + + test("clustered distribution and local sort with manual local sort: overwrite") { + checkClusteredDistributionAndLocalSortWithManualLocalSort("overwrite") + } + + test("clustered distribution and local sort with manual local sort: overwriteDynamic") { + checkClusteredDistributionAndLocalSortWithManualLocalSort("overwriteDynamic") + } + + test("clustered distribution and local sort with manual local sort with numPartitions: append") { + checkClusteredDistributionAndLocalSortWithManualLocalSort("append", Some(10)) + } + + test("clustered distribution and local sort with manual local sort with numPartitions: " + + "overwrite") { + checkClusteredDistributionAndLocalSortWithManualLocalSort("overwrite", Some(10)) + } + + test("clustered distribution and local sort with manual local sort with numPartitions: " + + "overwriteDynamic") { + checkClusteredDistributionAndLocalSortWithManualLocalSort("overwriteDynamic", Some(10)) + } + + private def checkClusteredDistributionAndLocalSortWithManualLocalSort(command: String): Unit = { + checkClusteredDistributionAndLocalSortWithManualLocalSort(command, None) + } + + private def checkClusteredDistributionAndLocalSortWithManualLocalSort( + command: String, + targetNumPartitions: Option[Int]): Unit = { + val tableOrdering = Array[SortOrder]( + sort(FieldReference("data"), SortDirection.DESCENDING, NullOrdering.NULLS_FIRST), + sort(FieldReference("id"), SortDirection.ASCENDING, NullOrdering.NULLS_FIRST) + ) + val tableDistribution = Distributions.clustered(Array(FieldReference("data"))) + + val writeOrdering = Seq( + catalyst.expressions.SortOrder( + attr("data"), + catalyst.expressions.Descending, + catalyst.expressions.NullsFirst, + Seq.empty + ), + catalyst.expressions.SortOrder( + attr("id"), + catalyst.expressions.Ascending, + catalyst.expressions.NullsFirst, + Seq.empty + ) + ) + val writePartitioningExprs = Seq(attr("data")) + val writePartitioning = clusteredWritePartitioning(writePartitioningExprs, targetNumPartitions) + + checkWriteRequirements( + tableDistribution, + tableOrdering, + targetNumPartitions, + expectedWritePartitioning = writePartitioning, + expectedWriteOrdering = writeOrdering, + writeTransform = df => df.orderBy("data", "id"), + writeCommand = command) + } + + private def checkWriteRequirements( + tableDistribution: Distribution, + tableOrdering: Array[SortOrder], + tableNumPartitions: Option[Int], + expectedWritePartitioning: physical.Partitioning, + expectedWriteOrdering: Seq[catalyst.expressions.SortOrder], + writeTransform: DataFrame => DataFrame = df => df, + writeCommand: String = "append", + expectAnalysisException: Boolean = false): Unit = { + + catalog.createTable(ident, schema, Array.empty, emptyProps, tableDistribution, + tableOrdering, tableNumPartitions) + + val df = spark.createDataFrame(Seq((1, "a"), (2, "b"), (3, "c"))).toDF("id", "data") + val writer = writeTransform(df).writeTo(tableNameAsString) + + def executeCommand(): SparkPlan = writeCommand match { + case "append" => execute(writer.append()) + case "overwrite" => execute(writer.overwrite(lit(true))) + case "overwriteDynamic" => execute(writer.overwritePartitions()) + } + + if (expectAnalysisException) { + intercept[AnalysisException] { + executeCommand() + } + } else { + val executedPlan = executeCommand() + + checkPartitioningAndOrdering(executedPlan, expectedWritePartitioning, expectedWriteOrdering) + + checkAnswer(spark.table(tableNameAsString), df) + } + } + + private def checkPartitioningAndOrdering( + plan: SparkPlan, + partitioning: physical.Partitioning, + ordering: Seq[catalyst.expressions.SortOrder]): Unit = { + + val sorts = collect(plan) { case s: SortExec => s } + assert(sorts.size <= 1, "must be at most one sort") + val shuffles = collect(plan) { case s: ShuffleExchangeLike => s } + assert(shuffles.size <= 1, "must be at most one shuffle") + + val actualPartitioning = plan.outputPartitioning + val expectedPartitioning = partitioning match { + case p: physical.RangePartitioning => + val resolvedOrdering = p.ordering.map(resolveAttrs(_, plan)) + p.copy(ordering = resolvedOrdering.asInstanceOf[Seq[catalyst.expressions.SortOrder]]) + case p: physical.HashPartitioning => + val resolvedExprs = p.expressions.map(resolveAttrs(_, plan)) + p.copy(expressions = resolvedExprs) + case other => other + } + assert(actualPartitioning == expectedPartitioning, "partitioning must match") + + val actualOrdering = plan.outputOrdering + val expectedOrdering = ordering.map(resolveAttrs(_, plan)) + assert(actualOrdering == expectedOrdering, "ordering must match") + } + + private def resolveAttrs( + expr: catalyst.expressions.Expression, + plan: SparkPlan): catalyst.expressions.Expression = { + + expr.transform { + case UnresolvedAttribute(Seq(attrName)) => + plan.output.find(attr => resolver(attr.name, attrName)).get + case UnresolvedAttribute(nameParts) => + val attrName = nameParts.mkString(".") + fail(s"cannot resolve a nested attr: $attrName") + } + } + + private def attr(name: String): UnresolvedAttribute = { + UnresolvedAttribute(name) + } + + private def catalog: InMemoryTableCatalog = { + val catalog = spark.sessionState.catalogManager.catalog("testcat") + catalog.asTableCatalog.asInstanceOf[InMemoryTableCatalog] + } + + // executes a write operation and keeps the executed physical plan + private def execute(writeFunc: => Unit): SparkPlan = { + var executedPlan: SparkPlan = null + + val listener = new QueryExecutionListener { + override def onSuccess(funcName: String, qe: QueryExecution, durationNs: Long): Unit = { + executedPlan = qe.executedPlan + } + override def onFailure(funcName: String, qe: QueryExecution, exception: Exception): Unit = { + } + } + spark.listenerManager.register(listener) + + writeFunc + + sparkContext.listenerBus.waitUntilEmpty() + + executedPlan match { + case w: V2TableWriteExec => + stripAQEPlan(w.query) + case _ => + fail("expected V2TableWriteExec") + } + } + + private def orderedWritePartitioning( + writeOrdering: Seq[catalyst.expressions.SortOrder], + targetNumPartitions: Option[Int]): physical.Partitioning = { + RangePartitioning(writeOrdering, targetNumPartitions.getOrElse(conf.numShufflePartitions)) + } + + private def clusteredWritePartitioning( + writePartitioningExprs: Seq[catalyst.expressions.Expression], + targetNumPartitions: Option[Int]): physical.Partitioning = { + HashPartitioning(writePartitioningExprs, + targetNumPartitions.getOrElse(conf.numShufflePartitions)) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/connector/functions/V2FunctionBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/connector/functions/V2FunctionBenchmark.scala new file mode 100644 index 0000000000000..16e86a7597e76 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/connector/functions/V2FunctionBenchmark.scala @@ -0,0 +1,146 @@ +/* + * 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. + */ + +package org.apache.spark.sql.connector.functions + +import test.org.apache.spark.sql.connector.catalog.functions.JavaLongAdd +import test.org.apache.spark.sql.connector.catalog.functions.JavaLongAdd.{JavaLongAddDefault, JavaLongAddMagic, JavaLongAddStaticMagic} + +import org.apache.spark.benchmark.Benchmark +import org.apache.spark.sql.Column +import org.apache.spark.sql.catalyst.InternalRow +import org.apache.spark.sql.catalyst.dsl.expressions._ +import org.apache.spark.sql.catalyst.expressions.{BinaryArithmetic, Expression} +import org.apache.spark.sql.catalyst.expressions.CodegenObjectFactoryMode._ +import org.apache.spark.sql.catalyst.util.TypeUtils +import org.apache.spark.sql.connector.catalog.{Identifier, InMemoryCatalog} +import org.apache.spark.sql.connector.catalog.functions.{BoundFunction, ScalarFunction, UnboundFunction} +import org.apache.spark.sql.execution.benchmark.SqlBasedBenchmark +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.types.{AbstractDataType, DataType, LongType, NumericType, StructType} + +/** + * Benchmark to measure DataSourceV2 UDF performance + * {{{ + * To run this benchmark: + * 1. without sbt: + * bin/spark-submit --class + * --jars , + * 2. build/sbt "sql/test:runMain " + * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " + * Results will be written to "benchmarks/V2FunctionBenchmark-results.txt". + * }}} + * '''NOTE''': to update the result of this benchmark, please use Github benchmark action: + * https://spark.apache.org/developer-tools.html#github-workflow-benchmarks + */ +object V2FunctionBenchmark extends SqlBasedBenchmark { + val catalogName: String = "benchmark_catalog" + + override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { + val N = 500L * 1000 * 1000 + Seq(true, false).foreach { codegenEnabled => + Seq(true, false).foreach { resultNullable => + scalarFunctionBenchmark(N, codegenEnabled = codegenEnabled, + resultNullable = resultNullable) + } + } + } + + private def scalarFunctionBenchmark( + N: Long, + codegenEnabled: Boolean, + resultNullable: Boolean): Unit = { + withSQLConf(s"spark.sql.catalog.$catalogName" -> classOf[InMemoryCatalog].getName) { + createFunction("java_long_add_default", + new JavaLongAdd(new JavaLongAddDefault(resultNullable))) + createFunction("java_long_add_magic", new JavaLongAdd(new JavaLongAddMagic(resultNullable))) + createFunction("java_long_add_static_magic", + new JavaLongAdd(new JavaLongAddStaticMagic(resultNullable))) + createFunction("scala_long_add_default", + LongAddUnbound(new LongAddWithProduceResult(resultNullable))) + createFunction("scala_long_add_magic", LongAddUnbound(new LongAddWithMagic(resultNullable))) + + val codeGenFactoryMode = if (codegenEnabled) FALLBACK else NO_CODEGEN + withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> codegenEnabled.toString, + SQLConf.CODEGEN_FACTORY_MODE.key -> codeGenFactoryMode.toString) { + val name = s"scalar function (long + long) -> long, result_nullable = $resultNullable " + + s"codegen = $codegenEnabled" + val benchmark = new Benchmark(name, N, output = output) + benchmark.addCase(s"native_long_add", numIters = 3) { _ => + spark.range(N).select(Column(NativeAdd($"id".expr, $"id".expr, resultNullable))).noop() + } + Seq("java_long_add_default", "java_long_add_magic", "java_long_add_static_magic", + "scala_long_add_default", "scala_long_add_magic").foreach { functionName => + benchmark.addCase(s"$functionName", numIters = 3) { _ => + spark.range(N).selectExpr(s"$catalogName.$functionName(id, id)").noop() + } + } + benchmark.run() + } + } + } + + private def createFunction(name: String, fn: UnboundFunction): Unit = { + val catalog = spark.sessionState.catalogManager.catalog(catalogName) + val ident = Identifier.of(Array.empty, name) + catalog.asInstanceOf[InMemoryCatalog].createFunction(ident, fn) + } + + case class NativeAdd( + left: Expression, + right: Expression, + override val nullable: Boolean) extends BinaryArithmetic { + override protected val failOnError: Boolean = false + override def inputType: AbstractDataType = NumericType + override def symbol: String = "+" + + private lazy val numeric = TypeUtils.getNumeric(dataType, failOnError) + protected override def nullSafeEval(input1: Any, input2: Any): Any = + numeric.plus(input1, input2) + + override protected def withNewChildrenInternal( + newLeft: Expression, + newRight: Expression): NativeAdd = copy(left = newLeft, right = newRight) + } + + case class LongAddUnbound(impl: ScalarFunction[Long]) extends UnboundFunction { + override def bind(inputType: StructType): BoundFunction = impl + override def description(): String = name() + override def name(): String = "long_add_unbound" + } + + abstract class LongAddBase(resultNullable: Boolean) extends ScalarFunction[Long] { + override def inputTypes(): Array[DataType] = Array(LongType, LongType) + override def resultType(): DataType = LongType + override def isResultNullable: Boolean = resultNullable + } + + class LongAddWithProduceResult(resultNullable: Boolean) extends LongAddBase(resultNullable) { + override def produceResult(input: InternalRow): Long = { + input.getLong(0) + input.getLong(1) + } + override def name(): String = "long_add_default" + } + + class LongAddWithMagic(resultNullable: Boolean) extends LongAddBase(resultNullable) { + def invoke(left: Long, right: Long): Long = { + left + right + } + override def name(): String = "long_add_magic" + } +} + diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/BaseScriptTransformationSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/BaseScriptTransformationSuite.scala new file mode 100644 index 0000000000000..c845dd81f3e32 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/BaseScriptTransformationSuite.scala @@ -0,0 +1,707 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution + +import java.sql.{Date, Timestamp} +import java.time.{Duration, Period} + +import org.json4s.DefaultFormats +import org.json4s.JsonDSL._ +import org.json4s.jackson.JsonMethods._ +import org.scalatest.Assertions._ +import org.scalatest.BeforeAndAfterEach +import org.scalatest.exceptions.TestFailedException + +import org.apache.spark.{SparkException, TaskContext, TestUtils} +import org.apache.spark.rdd.RDD +import org.apache.spark.sql.Row +import org.apache.spark.sql.catalyst.InternalRow +import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference, GenericInternalRow} +import org.apache.spark.sql.catalyst.plans.physical.Partitioning +import org.apache.spark.sql.functions._ +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.SQLTestUtils +import org.apache.spark.sql.types._ +import org.apache.spark.unsafe.types.CalendarInterval + +abstract class BaseScriptTransformationSuite extends SparkPlanTest with SQLTestUtils + with BeforeAndAfterEach { + import testImplicits._ + import ScriptTransformationIOSchema._ + + protected def defaultSerDe(): String + + protected val uncaughtExceptionHandler = new TestUncaughtExceptionHandler + + private var defaultUncaughtExceptionHandler: Thread.UncaughtExceptionHandler = _ + + protected override def beforeAll(): Unit = { + super.beforeAll() + defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler + Thread.setDefaultUncaughtExceptionHandler(uncaughtExceptionHandler) + } + + protected override def afterAll(): Unit = { + super.afterAll() + Thread.setDefaultUncaughtExceptionHandler(defaultUncaughtExceptionHandler) + } + + override protected def afterEach(): Unit = { + super.afterEach() + uncaughtExceptionHandler.cleanStatus() + } + + def createScriptTransformationExec( + script: String, + output: Seq[Attribute], + child: SparkPlan, + ioschema: ScriptTransformationIOSchema): BaseScriptTransformationExec + + test("cat without SerDe") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + + val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") + checkAnswer( + rowsDf, + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq(AttributeReference("a", StringType)()), + child = child, + ioschema = defaultIOSchema + ), + rowsDf.collect()) + assert(uncaughtExceptionHandler.exception.isEmpty) + } + + test("script transformation should not swallow errors from upstream operators (no serde)") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + + val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") + val e = intercept[TestFailedException] { + checkAnswer( + rowsDf, + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq(AttributeReference("a", StringType)()), + child = ExceptionInjectingOperator(child), + ioschema = defaultIOSchema + ), + rowsDf.collect()) + } + assert(e.getMessage().contains("intentional exception")) + // Before SPARK-25158, uncaughtExceptionHandler will catch IllegalArgumentException + assert(uncaughtExceptionHandler.exception.isEmpty) + } + + test("SPARK-25990: TRANSFORM should handle different data types correctly") { + assume(TestUtils.testCommandAvailable("python")) + val scriptFilePath = copyAndGetResourceFile("test_script.py", ".py").getAbsoluteFile + + withTempView("v") { + val df = Seq( + (1, "1", 1.0, BigDecimal(1.0), new Timestamp(1)), + (2, "2", 2.0, BigDecimal(2.0), new Timestamp(2)), + (3, "3", 3.0, BigDecimal(3.0), new Timestamp(3)) + ).toDF("a", "b", "c", "d", "e") // Note column d's data type is Decimal(38, 18) + df.createTempView("v") + + val query = sql( + s""" + |SELECT + |TRANSFORM(a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '\t' + | USING 'python $scriptFilePath' AS (a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '\t' + |FROM v + """.stripMargin) + + checkAnswer(query, identity, df.select( + 'a.cast("string"), + 'b.cast("string"), + 'c.cast("string"), + 'd.cast("string"), + 'e.cast("string")).collect()) + } + } + + test("SPARK-32388: TRANSFORM should handle schema less correctly (no serde)") { + withTempView("v") { + val df = Seq( + (1, "1", 1.0, BigDecimal(1.0), new Timestamp(1)), + (2, "2", 2.0, BigDecimal(2.0), new Timestamp(2)), + (3, "3", 3.0, BigDecimal(3.0), new Timestamp(3)) + ).toDF("a", "b", "c", "d", "e") // Note column d's data type is Decimal(38, 18) + + checkAnswer( + df, + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq( + AttributeReference("key", StringType)(), + AttributeReference("value", StringType)()), + child = child, + ioschema = defaultIOSchema.copy(schemaLess = true) + ), + df.select( + 'a.cast("string").as("key"), + 'b.cast("string").as("value")).collect()) + + checkAnswer( + df.select('a, 'b), + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq( + AttributeReference("key", StringType)(), + AttributeReference("value", StringType)()), + child = child, + ioschema = defaultIOSchema.copy(schemaLess = true) + ), + df.select( + 'a.cast("string").as("key"), + 'b.cast("string").as("value")).collect()) + + checkAnswer( + df.select('a), + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq( + AttributeReference("key", StringType)(), + AttributeReference("value", StringType)()), + child = child, + ioschema = defaultIOSchema.copy(schemaLess = true) + ), + df.select( + 'a.cast("string").as("key"), + lit(null)).collect()) + } + } + + test("SPARK-30973: TRANSFORM should wait for the termination of the script (no serde)") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + + val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") + val e = intercept[SparkException] { + val plan = + createScriptTransformationExec( + script = "some_non_existent_command", + output = Seq(AttributeReference("a", StringType)()), + child = rowsDf.queryExecution.sparkPlan, + ioschema = defaultIOSchema) + SparkPlanTest.executePlan(plan, spark.sqlContext) + } + assert(e.getMessage.contains("Subprocess exited with status")) + assert(uncaughtExceptionHandler.exception.isEmpty) + } + + def testBasicInputDataTypesWith(serde: ScriptTransformationIOSchema, testName: String): Unit = { + test(s"SPARK-32400: TRANSFORM should support basic data types as input ($testName)") { + assume(TestUtils.testCommandAvailable("python")) + withTempView("v") { + val df = Seq( + (1, "1", 1.0f, 1.0, 11.toByte, BigDecimal(1.0), new Timestamp(1), + new Date(2020, 7, 1), true), + (2, "2", 2.0f, 2.0, 22.toByte, BigDecimal(2.0), new Timestamp(2), + new Date(2020, 7, 2), true), + (3, "3", 3.0f, 3.0, 33.toByte, BigDecimal(3.0), new Timestamp(3), + new Date(2020, 7, 3), false) + ).toDF("a", "b", "c", "d", "e", "f", "g", "h", "i") + .withColumn("j", lit("abc").cast("binary")) + + checkAnswer( + df, + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq( + AttributeReference("a", IntegerType)(), + AttributeReference("b", StringType)(), + AttributeReference("c", FloatType)(), + AttributeReference("d", DoubleType)(), + AttributeReference("e", ByteType)(), + AttributeReference("f", DecimalType(38, 18))(), + AttributeReference("g", TimestampType)(), + AttributeReference("h", DateType)(), + AttributeReference("i", BooleanType)(), + AttributeReference("j", BinaryType)()), + child = child, + ioschema = serde + ), + df.select('a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j).collect()) + } + } + } + + testBasicInputDataTypesWith(defaultIOSchema, "no serde") + + test("SPARK-32400: TRANSFORM should support more data types (interval, array, map, struct " + + "and udt) as input (no serde)") { + assume(TestUtils.testCommandAvailable("python")) + withTempView("v") { + val df = Seq( + (new CalendarInterval(7, 1, 1000), Array(0, 1, 2), Map("a" -> 1), (1, 2), + new SimpleTuple(1, 1L)), + (new CalendarInterval(7, 2, 2000), Array(3, 4, 5), Map("b" -> 2), (3, 4), + new SimpleTuple(1, 1L)), + (new CalendarInterval(7, 3, 3000), Array(6, 7, 8), Map("c" -> 3), (5, 6), + new SimpleTuple(1, 1L)) + ).toDF("a", "b", "c", "d", "e") + + // Can't support convert script output data to ArrayType/MapType/StructType now, + // return these column still as string. + // For UserDefinedType, if user defined deserialize method to support convert string + // to UserType like [[SimpleTupleUDT]], we can support convert to this UDT, else we + // will return null value as column. + checkAnswer( + df, + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq( + AttributeReference("a", CalendarIntervalType)(), + AttributeReference("b", ArrayType(IntegerType))(), + AttributeReference("c", MapType(StringType, IntegerType))(), + AttributeReference("d", StructType( + Array(StructField("_1", IntegerType), + StructField("_2", IntegerType))))(), + AttributeReference("e", new SimpleTupleUDT)()), + child = child, + ioschema = defaultIOSchema + ), + df.select('a, 'b, 'c, 'd, 'e).collect()) + } + } + + test("SPARK-32400: TRANSFORM should respect DATETIME_JAVA8API_ENABLED (no serde)") { + assume(TestUtils.testCommandAvailable("python")) + Array(false, true).foreach { java8AapiEnable => + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> java8AapiEnable.toString) { + withTempView("v") { + val df = Seq( + (new Timestamp(1), new Date(2020, 7, 1)), + (new Timestamp(2), new Date(2020, 7, 2)), + (new Timestamp(3), new Date(2020, 7, 3)) + ).toDF("a", "b") + df.createTempView("v") + + val query = sql( + """ + |SELECT TRANSFORM (a, b) + |USING 'cat' AS (a timestamp, b date) + |FROM v + """.stripMargin) + checkAnswer(query, identity, df.select('a, 'b).collect()) + } + } + } + } + + test("SPARK-32608: Script Transform ROW FORMAT DELIMIT value should format value") { + withTempView("v") { + val df = Seq( + (1, "1", 1.0, BigDecimal(1.0), new Timestamp(1)), + (2, "2", 2.0, BigDecimal(2.0), new Timestamp(2)), + (3, "3", 3.0, BigDecimal(3.0), new Timestamp(3)) + ).toDF("a", "b", "c", "d", "e") // Note column d's data type is Decimal(38, 18) + df.createTempView("v") + + // input/output with same delimit + checkAnswer( + sql( + s""" + |SELECT TRANSFORM(a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY ',' + | COLLECTION ITEMS TERMINATED BY '#' + | MAP KEYS TERMINATED BY '@' + | LINES TERMINATED BY '\n' + | NULL DEFINED AS 'null' + | USING 'cat' AS (a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY ',' + | COLLECTION ITEMS TERMINATED BY '#' + | MAP KEYS TERMINATED BY '@' + | LINES TERMINATED BY '\n' + | NULL DEFINED AS 'NULL' + |FROM v + """.stripMargin), identity, df.select( + 'a.cast("string"), + 'b.cast("string"), + 'c.cast("string"), + 'd.cast("string"), + 'e.cast("string")).collect()) + + // input/output with different delimit and show result + checkAnswer( + sql( + s""" + |SELECT TRANSFORM(a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY ',' + | LINES TERMINATED BY '\n' + | NULL DEFINED AS 'null' + | USING 'cat' AS (value) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '&' + | LINES TERMINATED BY '\n' + | NULL DEFINED AS 'NULL' + |FROM v + """.stripMargin), identity, df.select( + concat_ws(",", + 'a.cast("string"), + 'b.cast("string"), + 'c.cast("string"), + 'd.cast("string"), + 'e.cast("string"))).collect()) + } + } + + test("SPARK-32667: SCRIPT TRANSFORM pad null value to fill column" + + " when without schema less (no-serde)") { + val df = Seq( + (1, "1", 1.0, BigDecimal(1.0), new Timestamp(1)), + (2, "2", 2.0, BigDecimal(2.0), new Timestamp(2)), + (3, "3", 3.0, BigDecimal(3.0), new Timestamp(3)) + ).toDF("a", "b", "c", "d", "e") // Note column d's data type is Decimal(38, 18) + + checkAnswer( + df.select('a, 'b), + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq( + AttributeReference("a", StringType)(), + AttributeReference("b", StringType)(), + AttributeReference("c", StringType)(), + AttributeReference("d", StringType)()), + child = child, + ioschema = defaultIOSchema + ), + df.select( + 'a.cast("string").as("a"), + 'b.cast("string").as("b"), + lit(null), lit(null)).collect()) + } + + test("SPARK-32106: TRANSFORM with non-existent command/file") { + Seq( + s""" + |SELECT TRANSFORM(a) + |USING 'some_non_existent_command' AS (a) + |FROM VALUES (1) t(a) + """.stripMargin, + s""" + |SELECT TRANSFORM(a) + |USING 'python some_non_existent_file' AS (a) + |FROM VALUES (1) t(a) + """.stripMargin).foreach { query => + intercept[SparkException] { + // Since an error message is shell-dependent, this test just checks + // if the expected exception will be thrown. + sql(query).collect() + } + } + } + + test("SPARK-33930: Script Transform default FIELD DELIMIT should be \u0001 (no serde)") { + withTempView("v") { + val df = Seq( + (1, 2, 3), + (2, 3, 4), + (3, 4, 5) + ).toDF("a", "b", "c") + df.createTempView("v") + + checkAnswer( + sql( + s""" + |SELECT TRANSFORM(a, b, c) + | ROW FORMAT DELIMITED + | USING 'cat' AS (a) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '&' + |FROM v + """.stripMargin), identity, + Row("1\u00012\u00013") :: + Row("2\u00013\u00014") :: + Row("3\u00014\u00015") :: Nil) + } + } + + test("SPARK-31936: Script transform support ArrayType/MapType/StructType (no serde)") { + assume(TestUtils.testCommandAvailable("python")) + withTempView("v") { + val df = Seq( + (Array(0, 1, 2), Array(Array(0, 1), Array(2)), + Map("a" -> 1), Map("b" -> Array("a", "b"))), + (Array(3, 4, 5), Array(Array(3, 4), Array(5)), + Map("b" -> 2), Map("c" -> Array("c", "d"))), + (Array(6, 7, 8), Array(Array(6, 7), Array(8)), + Map("c" -> 3), Map("d" -> Array("e", "f"))) + ).toDF("a", "b", "c", "d") + .select('a, 'b, 'c, 'd, + struct('a, 'b).as("e"), + struct('a, 'd).as("f"), + struct(struct('a, 'b), struct('a, 'd)).as("g") + ) + + checkAnswer( + df, + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq( + AttributeReference("a", ArrayType(IntegerType))(), + AttributeReference("b", ArrayType(ArrayType(IntegerType)))(), + AttributeReference("c", MapType(StringType, IntegerType))(), + AttributeReference("d", MapType(StringType, ArrayType(StringType)))(), + AttributeReference("e", StructType( + Array(StructField("a", ArrayType(IntegerType)), + StructField("b", ArrayType(ArrayType(IntegerType))))))(), + AttributeReference("f", StructType( + Array(StructField("a", ArrayType(IntegerType)), + StructField("d", MapType(StringType, ArrayType(StringType))))))(), + AttributeReference("g", StructType( + Array(StructField("col1", StructType( + Array(StructField("a", ArrayType(IntegerType)), + StructField("b", ArrayType(ArrayType(IntegerType)))))), + StructField("col2", StructType( + Array(StructField("a", ArrayType(IntegerType)), + StructField("d", MapType(StringType, ArrayType(StringType)))))))))()), + child = child, + ioschema = defaultIOSchema + ), + df.select('a, 'b, 'c, 'd, 'e, 'f, 'g).collect()) + } + } + + test("SPARK-33934: Add SparkFile's root dir to env property PATH") { + assume(TestUtils.testCommandAvailable("python")) + val scriptFilePath = copyAndGetResourceFile("test_script.py", ".py").getAbsoluteFile + withTempView("v") { + val df = Seq( + (1, "1", 1.0, BigDecimal(1.0), new Timestamp(1)), + (2, "2", 2.0, BigDecimal(2.0), new Timestamp(2)), + (3, "3", 3.0, BigDecimal(3.0), new Timestamp(3)) + ).toDF("a", "b", "c", "d", "e") // Note column d's data type is Decimal(38, 18) + df.createTempView("v") + + // test 'python /path/to/script.py' with local file + checkAnswer( + sql( + s""" + |SELECT + |TRANSFORM(a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '\t' + | USING 'python $scriptFilePath' AS (a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '\t' + |FROM v + """.stripMargin), identity, df.select( + 'a.cast("string"), + 'b.cast("string"), + 'c.cast("string"), + 'd.cast("string"), + 'e.cast("string")).collect()) + + // test '/path/to/script.py' with script not executable + val e1 = intercept[TestFailedException] { + checkAnswer( + sql( + s""" + |SELECT + |TRANSFORM(a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '\t' + | USING '$scriptFilePath' AS (a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '\t' + |FROM v + """.stripMargin), identity, df.select( + 'a.cast("string"), + 'b.cast("string"), + 'c.cast("string"), + 'd.cast("string"), + 'e.cast("string")).collect()) + }.getMessage + // Check with status exit code since in GA test, it may lose detail failed root cause. + // Different root cause's exitcode is not same. + // In this test, root cause is `Permission denied` + assert(e1.contains("Subprocess exited with status 126")) + + // test `/path/to/script.py' with script executable + scriptFilePath.setExecutable(true) + checkAnswer( + sql( + s""" + |SELECT + |TRANSFORM(a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '\t' + | USING '$scriptFilePath' AS (a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '\t' + |FROM v + """.stripMargin), identity, df.select( + 'a.cast("string"), + 'b.cast("string"), + 'c.cast("string"), + 'd.cast("string"), + 'e.cast("string")).collect()) + + scriptFilePath.setExecutable(false) + sql(s"ADD FILE ${scriptFilePath.getAbsolutePath}") + + // test `script.py` when file added + checkAnswer( + sql( + s""" + |SELECT TRANSFORM(a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '\t' + | USING '${scriptFilePath.getName}' AS (a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '\t' + |FROM v + """.stripMargin), identity, df.select( + 'a.cast("string"), + 'b.cast("string"), + 'c.cast("string"), + 'd.cast("string"), + 'e.cast("string")).collect()) + + // test `python script.py` when file added + checkAnswer( + sql( + s""" + |SELECT TRANSFORM(a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '\t' + | USING 'python ${scriptFilePath.getName}' AS (a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '\t' + |FROM v + """.stripMargin), identity, df.select( + 'a.cast("string"), + 'b.cast("string"), + 'c.cast("string"), + 'd.cast("string"), + 'e.cast("string")).collect()) + } + } + + test("SPARK-35220: DayTimeIntervalType/YearMonthIntervalType show different " + + "between hive serde and row format delimited\t") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + withTempView("v") { + val df = Seq( + (Duration.ofDays(1), Period.ofMonths(10)) + ).toDF("a", "b") + df.createTempView("v") + + if (defaultSerDe == "hive-serde") { + checkAnswer(sql( + """ + |SELECT TRANSFORM(a, b) + | USING 'cat' AS (a, b) + |FROM v + |""".stripMargin), + identity, + Row("1 00:00:00.000000000", "0-10") :: Nil) + } else { + checkAnswer(sql( + """ + |SELECT TRANSFORM(a, b) + | USING 'cat' AS (a, b) + |FROM v + |""".stripMargin), + identity, + Row("INTERVAL '1 00:00:00' DAY TO SECOND", "INTERVAL '0-10' YEAR TO MONTH") :: Nil) + } + } + } +} + +case class ExceptionInjectingOperator(child: SparkPlan) extends UnaryExecNode { + override protected def doExecute(): RDD[InternalRow] = { + child.execute().map { x => + assert(TaskContext.get() != null) // Make sure that TaskContext is defined. + Thread.sleep(1000) // This sleep gives the external process time to start. + throw new IllegalArgumentException("intentional exception") + } + } + + override def output: Seq[Attribute] = child.output + + override def outputPartitioning: Partitioning = child.outputPartitioning + + override protected def withNewChildInternal(newChild: SparkPlan): ExceptionInjectingOperator = + copy(child = newChild) +} + +@SQLUserDefinedType(udt = classOf[SimpleTupleUDT]) +private class SimpleTuple(val id: Int, val size: Long) extends Serializable { + + override def hashCode(): Int = getClass.hashCode() + + override def equals(other: Any): Boolean = other match { + case v: SimpleTuple => this.id == v.id && this.size == v.size + case _ => false + } + + override def toString: String = + compact(render( + ("id" -> id) ~ + ("size" -> size) + )) +} + +private class SimpleTupleUDT extends UserDefinedType[SimpleTuple] { + + override def sqlType: DataType = StructType( + StructField("id", IntegerType, false) :: + StructField("size", LongType, false) :: + Nil) + + override def serialize(sql: SimpleTuple): Any = { + val row = new GenericInternalRow(2) + row.setInt(0, sql.id) + row.setLong(1, sql.size) + row + } + + override def deserialize(datum: Any): SimpleTuple = { + datum match { + case str: String => + implicit val format = DefaultFormats + val json = parse(str) + new SimpleTuple((json \ "id").extract[Int], (json \ "size").extract[Long]) + case data: InternalRow if data.numFields == 2 => + new SimpleTuple(data.getInt(0), data.getLong(1)) + case _ => null + } + } + + override def userClass: Class[SimpleTuple] = classOf[SimpleTuple] + + override def asNullable: SimpleTupleUDT = this + + override def hashCode(): Int = getClass.hashCode() + + override def equals(other: Any): Boolean = { + other.isInstanceOf[SimpleTupleUDT] + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/CoalesceShufflePartitionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/CoalesceShufflePartitionsSuite.scala index 22c5b651f7e12..e3688686a187b 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/CoalesceShufflePartitionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/CoalesceShufflePartitionsSuite.scala @@ -20,6 +20,7 @@ package org.apache.spark.sql.execution import org.scalatest.BeforeAndAfterAll import org.apache.spark.{SparkConf, SparkFunSuite} +import org.apache.spark.internal.config.IO_ENCRYPTION_ENABLED import org.apache.spark.internal.config.UI.UI_ENABLED import org.apache.spark.sql._ import org.apache.spark.sql.execution.adaptive._ @@ -57,15 +58,18 @@ class CoalesceShufflePartitionsSuite extends SparkFunSuite with BeforeAndAfterAl def withSparkSession( f: SparkSession => Unit, targetPostShuffleInputSize: Int, - minNumPostShufflePartitions: Option[Int]): Unit = { + minNumPostShufflePartitions: Option[Int], + enableIOEncryption: Boolean = false): Unit = { val sparkConf = new SparkConf(false) .setMaster("local[*]") .setAppName("test") .set(UI_ENABLED, false) + .set(IO_ENCRYPTION_ENABLED, enableIOEncryption) .set(SQLConf.SHUFFLE_PARTITIONS.key, "5") .set(SQLConf.COALESCE_PARTITIONS_INITIAL_PARTITION_NUM.key, "5") .set(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key, "true") + .set(SQLConf.FETCH_SHUFFLE_BLOCKS_IN_BATCH.key, "true") .set(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key, "-1") .set( SQLConf.ADVISORY_PARTITION_SIZE_IN_BYTES.key, @@ -90,7 +94,7 @@ class CoalesceShufflePartitionsSuite extends SparkFunSuite with BeforeAndAfterAl } test(s"determining the number of reducers: aggregate operator$testNameNote") { - val test = { spark: SparkSession => + val test: SparkSession => Unit = { spark: SparkSession => val df = spark .range(0, 1000, 1, numInputPartitions) @@ -109,14 +113,13 @@ class CoalesceShufflePartitionsSuite extends SparkFunSuite with BeforeAndAfterAl val shuffleReaders = finalPlan.collect { case r @ CoalescedShuffleReader() => r } - assert(shuffleReaders.length === 1) + minNumPostShufflePartitions match { case Some(numPartitions) => - shuffleReaders.foreach { reader => - assert(reader.outputPartitioning.numPartitions === numPartitions) - } + assert(shuffleReaders.isEmpty) case None => + assert(shuffleReaders.length === 1) shuffleReaders.foreach { reader => assert(reader.outputPartitioning.numPartitions === 3) } @@ -127,7 +130,7 @@ class CoalesceShufflePartitionsSuite extends SparkFunSuite with BeforeAndAfterAl } test(s"determining the number of reducers: join operator$testNameNote") { - val test = { spark: SparkSession => + val test: SparkSession => Unit = { spark: SparkSession => val df1 = spark .range(0, 1000, 1, numInputPartitions) @@ -156,14 +159,13 @@ class CoalesceShufflePartitionsSuite extends SparkFunSuite with BeforeAndAfterAl val shuffleReaders = finalPlan.collect { case r @ CoalescedShuffleReader() => r } - assert(shuffleReaders.length === 2) + minNumPostShufflePartitions match { case Some(numPartitions) => - shuffleReaders.foreach { reader => - assert(reader.outputPartitioning.numPartitions === numPartitions) - } + assert(shuffleReaders.isEmpty) case None => + assert(shuffleReaders.length === 2) shuffleReaders.foreach { reader => assert(reader.outputPartitioning.numPartitions === 2) } @@ -208,14 +210,13 @@ class CoalesceShufflePartitionsSuite extends SparkFunSuite with BeforeAndAfterAl val shuffleReaders = finalPlan.collect { case r @ CoalescedShuffleReader() => r } - assert(shuffleReaders.length === 2) + minNumPostShufflePartitions match { case Some(numPartitions) => - shuffleReaders.foreach { reader => - assert(reader.outputPartitioning.numPartitions === numPartitions) - } + assert(shuffleReaders.isEmpty) case None => + assert(shuffleReaders.length === 2) shuffleReaders.foreach { reader => assert(reader.outputPartitioning.numPartitions === 2) } @@ -260,14 +261,13 @@ class CoalesceShufflePartitionsSuite extends SparkFunSuite with BeforeAndAfterAl val shuffleReaders = finalPlan.collect { case r @ CoalescedShuffleReader() => r } - assert(shuffleReaders.length === 2) + minNumPostShufflePartitions match { case Some(numPartitions) => - shuffleReaders.foreach { reader => - assert(reader.outputPartitioning.numPartitions === numPartitions) - } + assert(shuffleReaders.isEmpty) case None => + assert(shuffleReaders.length === 2) shuffleReaders.foreach { reader => assert(reader.outputPartitioning.numPartitions === 3) } @@ -327,7 +327,7 @@ class CoalesceShufflePartitionsSuite extends SparkFunSuite with BeforeAndAfterAl val finalPlan = resultDf.queryExecution.executedPlan .asInstanceOf[AdaptiveSparkPlanExec].executedPlan assert(finalPlan.collect { - case ShuffleQueryStageExec(_, r: ReusedExchangeExec) => r + case ShuffleQueryStageExec(_, r: ReusedExchangeExec, _) => r }.length == 2) assert( finalPlan.collect { @@ -363,7 +363,7 @@ class CoalesceShufflePartitionsSuite extends SparkFunSuite with BeforeAndAfterAl val reusedStages = level1Stages.flatMap { stage => stage.plan.collect { - case ShuffleQueryStageExec(_, r: ReusedExchangeExec) => r + case ShuffleQueryStageExec(_, r: ReusedExchangeExec, _) => r } } assert(reusedStages.length == 1) @@ -408,6 +408,25 @@ class CoalesceShufflePartitionsSuite extends SparkFunSuite with BeforeAndAfterAl } withSparkSession(test, 100, None) } + + test("SPARK-34790: enable IO encryption in AQE partition coalescing") { + val test: SparkSession => Unit = { spark: SparkSession => + val ds = spark.range(0, 100, 1, numInputPartitions) + val resultDf = ds.repartition(ds.col("id")) + resultDf.collect() + + val finalPlan = resultDf.queryExecution.executedPlan + .asInstanceOf[AdaptiveSparkPlanExec].executedPlan + assert( + finalPlan.collect { + case r @ CoalescedShuffleReader() => r + }.isDefinedAt(0)) + } + Seq(true, false).foreach { enableIOEncryption => + // Before SPARK-34790, it will throw an exception when io encryption enabled. + withSparkSession(test, Int.MaxValue, None, enableIOEncryption) + } + } } object CoalescedShuffleReader { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/ColumnarRulesSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/ColumnarRulesSuite.scala new file mode 100644 index 0000000000000..df08acd35ef17 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/ColumnarRulesSuite.scala @@ -0,0 +1,64 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution + +import org.apache.spark.rdd.RDD +import org.apache.spark.sql.catalyst.InternalRow +import org.apache.spark.sql.catalyst.expressions.Attribute +import org.apache.spark.sql.catalyst.plans.PlanTest +import org.apache.spark.sql.test.SharedSparkSession + +class ColumnarRulesSuite extends PlanTest with SharedSparkSession { + + test("Idempotency of columnar rules - RowToColumnar/ColumnarToRow") { + val rules = ApplyColumnarRulesAndInsertTransitions( + spark.sessionState.columnarRules) + + val plan = UnaryOp(UnaryOp(LeafOp(false), true), false) + val expected = + UnaryOp(ColumnarToRowExec(UnaryOp(RowToColumnarExec(LeafOp(false)), true)), false) + val appliedOnce = rules.apply(plan) + assert(appliedOnce == expected) + val appliedTwice = rules.apply(appliedOnce) + assert(appliedTwice == expected) + } + + test("Idempotency of columnar rules - ColumnarToRow/RowToColumnar") { + val rules = ApplyColumnarRulesAndInsertTransitions( + spark.sessionState.columnarRules) + + val plan = UnaryOp(UnaryOp(LeafOp(true), false), true) + val expected = ColumnarToRowExec( + UnaryOp(RowToColumnarExec(UnaryOp(ColumnarToRowExec(LeafOp(true)), false)), true)) + val appliedOnce = rules.apply(plan) + assert(appliedOnce == expected) + val appliedTwice = rules.apply(appliedOnce) + assert(appliedTwice == expected) + } +} + +case class LeafOp(override val supportsColumnar: Boolean) extends LeafExecNode { + override protected def doExecute(): RDD[InternalRow] = throw new UnsupportedOperationException() + override def output: Seq[Attribute] = Seq.empty +} + +case class UnaryOp(child: SparkPlan, override val supportsColumnar: Boolean) extends UnaryExecNode { + override protected def doExecute(): RDD[InternalRow] = throw new UnsupportedOperationException() + override def output: Seq[Attribute] = child.output + override protected def withNewChildInternal(newChild: SparkPlan): UnaryOp = copy(child = newChild) +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/DataSourceScanExecRedactionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/DataSourceScanExecRedactionSuite.scala index f1411b263c77b..612cd6f0d891b 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/DataSourceScanExecRedactionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/DataSourceScanExecRedactionSuite.scala @@ -16,7 +16,10 @@ */ package org.apache.spark.sql.execution +import java.io.File + import scala.collection.mutable +import scala.util.Random import org.apache.hadoop.fs.Path @@ -116,6 +119,48 @@ class DataSourceScanExecRedactionSuite extends DataSourceScanRedactionTest { assert(isIncluded(df.queryExecution, "Location")) } } + + test("SPARK-31793: FileSourceScanExec metadata should contain limited file paths") { + withTempPath { path => + // create a sub-directory with long name so that each root path will always exceed the limit + // this is to ensure we always test the case for the path truncation + val dataDirName = Random.alphanumeric.take(100).toList.mkString + val dataDir = new File(path, dataDirName) + dataDir.mkdir() + + val partitionCol = "partitionCol" + spark.range(10) + .select("id", "id") + .toDF("value", partitionCol) + .write + .partitionBy(partitionCol) + .orc(dataDir.getCanonicalPath) + val paths = (0 to 9).map(i => new File(dataDir, s"$partitionCol=$i").getCanonicalPath) + val plan = spark.read.orc(paths: _*).queryExecution.executedPlan + val location = plan collectFirst { + case f: FileSourceScanExec => f.metadata("Location") + } + assert(location.isDefined) + // The location metadata should at least contain one path + assert(location.get.contains(paths.head)) + + // The location metadata should have the number of root paths + assert(location.get.contains("(10 paths)")) + + // The location metadata should have bracket wrapping paths + assert(location.get.indexOf('[') > -1) + assert(location.get.indexOf(']') > -1) + + // extract paths in location metadata (removing classname, brackets, separators) + val pathsInLocation = location.get.substring( + location.get.indexOf('[') + 1, location.get.indexOf(']')).split(", ").toSeq + + // the only one path should be available + assert(pathsInLocation.size == 2) + // indicator ("...") should be available + assert(pathsInLocation.exists(_.contains("..."))) + } + } } /** diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/ExchangeSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/ExchangeSuite.scala index fb97e15e4df63..9776e76b541ee 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/ExchangeSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/ExchangeSuite.scala @@ -40,6 +40,9 @@ case class ColumnarExchange(child: SparkPlan) extends Exchange { override protected def doExecute(): RDD[InternalRow] = throw new RanRowBased override protected def doExecuteColumnar(): RDD[ColumnarBatch] = throw new RanColumnar + + override protected def withNewChildInternal(newChild: SparkPlan): ColumnarExchange = + copy(child = newChild) } class ExchangeSuite extends SparkPlanTest with SharedSparkSession { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/ExternalAppendOnlyUnsafeRowArrayBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/ExternalAppendOnlyUnsafeRowArrayBenchmark.scala index 0869e25674e69..e7f83cb7eb4bc 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/ExternalAppendOnlyUnsafeRowArrayBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/ExternalAppendOnlyUnsafeRowArrayBenchmark.scala @@ -47,6 +47,9 @@ object ExternalAppendOnlyUnsafeRowArrayBenchmark extends BenchmarkBase { // for a bug we had with bytes written past the last object in a batch (SPARK-2792) .set(config.SERIALIZER_OBJECT_STREAM_RESET, 1) .set(config.SERIALIZER, "org.apache.spark.serializer.JavaSerializer") + // SPARK-34832: Add this configuration to allow `withFakeTaskContext` method + // to create `SparkContext` on the executor side. + .set(config.EXECUTOR_ALLOW_SPARK_CONTEXT, true) private def withFakeTaskContext(f: => Unit): Unit = { val sc = new SparkContext("local", "test", conf) @@ -54,6 +57,7 @@ object ExternalAppendOnlyUnsafeRowArrayBenchmark extends BenchmarkBase { TaskContext.setTaskContext(taskContext) f sc.stop() + TaskContext.unset() } private def testRows(numRows: Int): Seq[UnsafeRow] = { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/ExternalAppendOnlyUnsafeRowArraySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/ExternalAppendOnlyUnsafeRowArraySuite.scala index b29de9c4adbaa..98aba3ba25f17 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/ExternalAppendOnlyUnsafeRowArraySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/ExternalAppendOnlyUnsafeRowArraySuite.scala @@ -27,32 +27,29 @@ import org.apache.spark.sql.catalyst.expressions.UnsafeRow class ExternalAppendOnlyUnsafeRowArraySuite extends SparkFunSuite with LocalSparkContext { private val random = new java.util.Random() - private var taskContext: TaskContext = _ - - override def afterAll(): Unit = try { - TaskContext.unset() - } finally { - super.afterAll() - } private def withExternalArray(inMemoryThreshold: Int, spillThreshold: Int) (f: ExternalAppendOnlyUnsafeRowArray => Unit): Unit = { sc = new SparkContext("local", "test", new SparkConf(false)) - taskContext = MemoryTestingUtils.fakeTaskContext(SparkEnv.get) + val taskContext = MemoryTestingUtils.fakeTaskContext(SparkEnv.get) TaskContext.setTaskContext(taskContext) - val array = new ExternalAppendOnlyUnsafeRowArray( - taskContext.taskMemoryManager(), - SparkEnv.get.blockManager, - SparkEnv.get.serializerManager, - taskContext, - 1024, - SparkEnv.get.memoryManager.pageSizeBytes, - inMemoryThreshold, - spillThreshold) - try f(array) finally { - array.clear() + try { + val array = new ExternalAppendOnlyUnsafeRowArray( + taskContext.taskMemoryManager(), + SparkEnv.get.blockManager, + SparkEnv.get.serializerManager, + taskContext, + 1024, + SparkEnv.get.memoryManager.pageSizeBytes, + inMemoryThreshold, + spillThreshold) + try f(array) finally { + array.clear() + } + } finally { + TaskContext.unset() } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala index 5e81c74420fd0..f8366b3f7c5fa 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/HiveResultSuite.scala @@ -17,21 +17,30 @@ package org.apache.spark.sql.execution -import org.apache.spark.sql.connector.InMemoryTableCatalog +import java.time.{Duration, Period} + +import org.apache.spark.sql.catalyst.util.DateTimeTestUtils +import org.apache.spark.sql.connector.catalog.InMemoryTableCatalog +import org.apache.spark.sql.execution.HiveResult._ +import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.{ExamplePoint, ExamplePointUDT, SharedSparkSession} class HiveResultSuite extends SharedSparkSession { import testImplicits._ test("date formatting in hive result") { - val dates = Seq("2018-12-28", "1582-10-03", "1582-10-04", "1582-10-15") - val df = dates.toDF("a").selectExpr("cast(a as date) as b") - val executedPlan1 = df.queryExecution.executedPlan - val result = HiveResult.hiveResultString(executedPlan1) - assert(result == dates) - val executedPlan2 = df.selectExpr("array(b)").queryExecution.executedPlan - val result2 = HiveResult.hiveResultString(executedPlan2) - assert(result2 == dates.map(x => s"[$x]")) + DateTimeTestUtils.outstandingTimezonesIds.foreach { zoneId => + withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> zoneId) { + val dates = Seq("2018-12-28", "1582-10-03", "1582-10-04", "1582-10-15") + val df = dates.toDF("a").selectExpr("cast(a as date) as b") + val executedPlan1 = df.queryExecution.executedPlan + val result = hiveResultString(executedPlan1) + assert(result == dates) + val executedPlan2 = df.selectExpr("array(b)").queryExecution.executedPlan + val result2 = hiveResultString(executedPlan2) + assert(result2 == dates.map(x => s"[$x]")) + } + } } test("timestamp formatting in hive result") { @@ -42,17 +51,17 @@ class HiveResultSuite extends SharedSparkSession { "1582-10-15 01:02:03") val df = timestamps.toDF("a").selectExpr("cast(a as timestamp) as b") val executedPlan1 = df.queryExecution.executedPlan - val result = HiveResult.hiveResultString(executedPlan1) + val result = hiveResultString(executedPlan1) assert(result == timestamps) val executedPlan2 = df.selectExpr("array(b)").queryExecution.executedPlan - val result2 = HiveResult.hiveResultString(executedPlan2) + val result2 = hiveResultString(executedPlan2) assert(result2 == timestamps.map(x => s"[$x]")) } test("toHiveString correctly handles UDTs") { val point = new ExamplePoint(50.0, 50.0) val tpe = new ExamplePointUDT() - assert(HiveResult.toHiveString((point, tpe)) === "(50.0, 50.0)") + assert(toHiveString((point, tpe), false, getTimeFormatters) === "(50.0, 50.0)") } test("decimal formatting in hive result") { @@ -60,13 +69,13 @@ class HiveResultSuite extends SharedSparkSession { Seq(2, 6, 18).foreach { scala => val executedPlan = df.selectExpr(s"CAST(value AS decimal(38, $scala))").queryExecution.executedPlan - val result = HiveResult.hiveResultString(executedPlan) + val result = hiveResultString(executedPlan) assert(result.head.split("\\.").last.length === scala) } val executedPlan = Seq(java.math.BigDecimal.ZERO).toDS() .selectExpr(s"CAST(value AS decimal(38, 8))").queryExecution.executedPlan - val result = HiveResult.hiveResultString(executedPlan) + val result = hiveResultString(executedPlan) assert(result.head === "0.00000000") } @@ -78,7 +87,7 @@ class HiveResultSuite extends SharedSparkSession { spark.sql(s"CREATE TABLE $ns.$tbl (id bigint) USING $source") val df = spark.sql(s"SHOW TABLES FROM $ns") val executedPlan = df.queryExecution.executedPlan - assert(HiveResult.hiveResultString(executedPlan).head == tbl) + assert(hiveResultString(executedPlan).head == tbl) } } } @@ -95,9 +104,25 @@ class HiveResultSuite extends SharedSparkSession { val expected = "id " + "\tbigint " + "\tcol1 " - assert(HiveResult.hiveResultString(executedPlan).head == expected) + assert(hiveResultString(executedPlan).head == expected) } } } } + + test("SPARK-34984, SPARK-35016: year-month interval formatting in hive result") { + val df = Seq(Period.ofYears(-10).minusMonths(1)).toDF("i") + val plan1 = df.queryExecution.executedPlan + assert(hiveResultString(plan1) === Seq("-10-1")) + val plan2 = df.selectExpr("array(i)").queryExecution.executedPlan + assert(hiveResultString(plan2) === Seq("[-10-1]")) + } + + test("SPARK-34984, SPARK-35016: day-time interval formatting in hive result") { + val df = Seq(Duration.ofDays(5).plusMillis(10)).toDF("i") + val plan1 = df.queryExecution.executedPlan + assert(hiveResultString(plan1) === Seq("5 00:00:00.010000000")) + val plan2 = df.selectExpr("array(i)").queryExecution.executedPlan + assert(hiveResultString(plan2) === Seq("[5 00:00:00.010000000]")) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala index d428b7ebc0e91..0b30b8cdf2644 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/PlannerSuite.scala @@ -22,7 +22,7 @@ import org.apache.spark.sql.{execution, DataFrame, Row} import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.plans._ -import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, LogicalPlan, Range, Repartition, Sort, Union} +import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, LogicalPlan, Range, Repartition, RepartitionOperation, Union} import org.apache.spark.sql.catalyst.plans.physical._ import org.apache.spark.sql.execution.adaptive.{AdaptiveSparkPlanHelper, DisableAdaptiveExecution} import org.apache.spark.sql.execution.aggregate.{HashAggregateExec, ObjectHashAggregateExec, SortAggregateExec} @@ -61,13 +61,13 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { } test("count distinct is partially aggregated") { - val query = testData.groupBy('value).agg(countDistinct('key)).queryExecution.analyzed + val query = testData.groupBy('value).agg(count_distinct('key)).queryExecution.analyzed testPartialAggregationPlan(query) } test("mixed aggregates are partially aggregated") { val query = - testData.groupBy('value).agg(count('value), countDistinct('key)).queryExecution.analyzed + testData.groupBy('value).agg(count('value), count_distinct('key)).queryExecution.analyzed testPartialAggregationPlan(query) } @@ -234,19 +234,6 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { } } - test("SPARK-23375: Cached sorted data doesn't need to be re-sorted") { - val query = testData.select('key, 'value).sort('key.desc).cache() - assert(query.queryExecution.optimizedPlan.isInstanceOf[InMemoryRelation]) - val resorted = query.sort('key.desc) - assert(resorted.queryExecution.optimizedPlan.collect { case s: Sort => s}.isEmpty) - assert(resorted.select('key).collect().map(_.getInt(0)).toSeq == - (1 to 100).reverse) - // with a different order, the sort is needed - val sortedAsc = query.sort('key) - assert(sortedAsc.queryExecution.optimizedPlan.collect { case s: Sort => s}.size == 1) - assert(sortedAsc.select('key).collect().map(_.getInt(0)).toSeq == (1 to 100)) - } - test("PartitioningCollection") { withTempView("normal", "small", "tiny") { testData.createOrReplaceTempView("normal") @@ -342,7 +329,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { requiredChildDistribution = Seq(distribution, distribution), requiredChildOrdering = Seq(Seq.empty, Seq.empty) ) - val outputPlan = EnsureRequirements(spark.sessionState.conf).apply(inputPlan) + val outputPlan = EnsureRequirements.apply(inputPlan) assertDistributionRequirementsAreSatisfied(outputPlan) } @@ -360,7 +347,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { requiredChildDistribution = Seq(distribution, distribution), requiredChildOrdering = Seq(Seq.empty, Seq.empty) ) - val outputPlan = EnsureRequirements(spark.sessionState.conf).apply(inputPlan) + val outputPlan = EnsureRequirements.apply(inputPlan) assertDistributionRequirementsAreSatisfied(outputPlan) if (outputPlan.collect { case e: ShuffleExchangeExec => true }.isEmpty) { fail(s"Exchange should have been added:\n$outputPlan") @@ -380,7 +367,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { requiredChildDistribution = Seq(distribution, distribution), requiredChildOrdering = Seq(Seq.empty, Seq.empty) ) - val outputPlan = EnsureRequirements(spark.sessionState.conf).apply(inputPlan) + val outputPlan = EnsureRequirements.apply(inputPlan) assertDistributionRequirementsAreSatisfied(outputPlan) if (outputPlan.collect { case e: ShuffleExchangeExec => true }.nonEmpty) { fail(s"Exchange should not have been added:\n$outputPlan") @@ -403,7 +390,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { requiredChildDistribution = Seq(distribution, distribution), requiredChildOrdering = Seq(outputOrdering, outputOrdering) ) - val outputPlan = EnsureRequirements(spark.sessionState.conf).apply(inputPlan) + val outputPlan = EnsureRequirements.apply(inputPlan) assertDistributionRequirementsAreSatisfied(outputPlan) if (outputPlan.collect { case e: ShuffleExchangeExec => true }.nonEmpty) { fail(s"No Exchanges should have been added:\n$outputPlan") @@ -418,7 +405,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { val inputPlan = ShuffleExchangeExec( partitioning, DummySparkPlan(outputPartitioning = partitioning)) - val outputPlan = EnsureRequirements(spark.sessionState.conf).apply(inputPlan) + val outputPlan = EnsureRequirements.apply(inputPlan) assertDistributionRequirementsAreSatisfied(outputPlan) if (outputPlan.collect { case e: ShuffleExchangeExec => true }.size == 2) { fail(s"Topmost Exchange should have been eliminated:\n$outputPlan") @@ -433,7 +420,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { val inputPlan = ShuffleExchangeExec( partitioning, DummySparkPlan(outputPartitioning = partitioning)) - val outputPlan = EnsureRequirements(spark.sessionState.conf).apply(inputPlan) + val outputPlan = EnsureRequirements.apply(inputPlan) assertDistributionRequirementsAreSatisfied(outputPlan) if (outputPlan.collect { case e: ShuffleExchangeExec => true }.size == 1) { fail(s"Topmost Exchange should not have been eliminated:\n$outputPlan") @@ -451,7 +438,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { requiredChildDistribution = Seq(distribution), requiredChildOrdering = Seq(Seq.empty)) - val outputPlan = EnsureRequirements(spark.sessionState.conf).apply(inputPlan) + val outputPlan = EnsureRequirements.apply(inputPlan) val shuffle = outputPlan.collect { case e: ShuffleExchangeExec => e } assert(shuffle.size === 1) assert(shuffle.head.outputPartitioning === finalPartitioning) @@ -476,7 +463,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { shuffle, shuffle) - val outputPlan = ReuseExchange(spark.sessionState.conf).apply(inputPlan) + val outputPlan = ReuseExchange.apply(inputPlan) if (outputPlan.collect { case e: ReusedExchangeExec => true }.size != 1) { fail(s"Should re-use the shuffle:\n$outputPlan") } @@ -493,7 +480,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { ShuffleExchangeExec(finalPartitioning, inputPlan), ShuffleExchangeExec(finalPartitioning, inputPlan)) - val outputPlan2 = ReuseExchange(spark.sessionState.conf).apply(inputPlan2) + val outputPlan2 = ReuseExchange.apply(inputPlan2) if (outputPlan2.collect { case e: ReusedExchangeExec => true }.size != 2) { fail(s"Should re-use the two shuffles:\n$outputPlan2") } @@ -530,7 +517,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { requiredChildOrdering = Seq(requiredOrdering), requiredChildDistribution = Seq(UnspecifiedDistribution) ) - val outputPlan = EnsureRequirements(spark.sessionState.conf).apply(inputPlan) + val outputPlan = EnsureRequirements.apply(inputPlan) assertDistributionRequirementsAreSatisfied(outputPlan) if (shouldHaveSort) { if (outputPlan.collect { case s: SortExec => true }.isEmpty) { @@ -691,7 +678,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { val smjExec = SortMergeJoinExec( exprA :: exprA :: Nil, exprB :: exprC :: Nil, Inner, None, plan1, plan2) - val outputPlan = EnsureRequirements(spark.sessionState.conf).apply(smjExec) + val outputPlan = EnsureRequirements.apply(smjExec) outputPlan match { case SortMergeJoinExec(leftKeys, rightKeys, _, _, _, _, _) => assert(leftKeys == Seq(exprA, exprA)) @@ -711,7 +698,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { condition = None, left = plan1, right = plan2) - val outputPlan = EnsureRequirements(spark.sessionState.conf).apply(smjExec) + val outputPlan = EnsureRequirements.apply(smjExec) outputPlan match { case SortMergeJoinExec(leftKeys, rightKeys, _, _, SortExec(_, _, @@ -741,8 +728,6 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { case r: Range => r } assert(ranges.length == 2) - // Ensure the two Range instances are equal according to their equal method - assert(ranges.head == ranges.last) val execRanges = df.queryExecution.sparkPlan.collect { case r: RangeExec => r } @@ -902,8 +887,225 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { | (SELECT key AS k from df2) t2 |ON t1.k = t2.k """.stripMargin).queryExecution.executedPlan - val exchanges = planned.collect { case s: ShuffleExchangeExec => s } + val exchanges = collect(planned) { case s: ShuffleExchangeExec => s } + assert(exchanges.size == 2) + } + } + } + + test("SPARK-33399: aliases should be handled properly in PartitioningCollection output" + + " partitioning") { + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + withTempView("t1", "t2", "t3") { + spark.range(10).repartition($"id").createTempView("t1") + spark.range(20).repartition($"id").createTempView("t2") + spark.range(30).repartition($"id").createTempView("t3") + val planned = sql( + """ + |SELECT t3.id as t3id + |FROM ( + | SELECT t1.id as t1id, t2.id as t2id + | FROM t1, t2 + | WHERE t1.id = t2.id + |) t12, t3 + |WHERE t1id = t3.id + """.stripMargin).queryExecution.executedPlan + val exchanges = collect(planned) { case s: ShuffleExchangeExec => s } + assert(exchanges.size == 3) + + val projects = collect(planned) { case p: ProjectExec => p } + assert(projects.exists(_.outputPartitioning match { + case HashPartitioning(Seq(k1: AttributeReference), _) if k1.name == "t1id" => + true + case _ => + false + })) + } + } + } + + test("SPARK-33399: aliases should be handled properly in HashPartitioning") { + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + withTempView("t1", "t2", "t3") { + spark.range(10).repartition($"id").createTempView("t1") + spark.range(20).repartition($"id").createTempView("t2") + spark.range(30).repartition($"id").createTempView("t3") + val planned = sql( + """ + |SELECT t1id, t3.id as t3id + |FROM ( + | SELECT t1.id as t1id + | FROM t1 LEFT SEMI JOIN t2 + | ON t1.id = t2.id + |) t12 INNER JOIN t3 + |WHERE t1id = t3.id + """.stripMargin).queryExecution.executedPlan + val exchanges = collect(planned) { case s: ShuffleExchangeExec => s } + assert(exchanges.size == 3) + + val projects = collect(planned) { case p: ProjectExec => p } + assert(projects.exists(_.outputPartitioning match { + case HashPartitioning(Seq(a: AttributeReference), _) => a.name == "t1id" + case _ => false + })) + } + } + } + + test("SPARK-33399: alias handling should happen properly for RangePartitioning") { + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + val df = spark.range(1, 100) + .select(col("id").as("id1")).groupBy("id1").count() + // Plan for this will be Range -> ProjectWithAlias -> HashAggregate -> HashAggregate + // if Project normalizes alias in its Range outputPartitioning, then no Exchange should come + // in between HashAggregates + val planned = df.queryExecution.executedPlan + val exchanges = collect(planned) { case s: ShuffleExchangeExec => s } + assert(exchanges.isEmpty) + + val projects = collect(planned) { case p: ProjectExec => p } + assert(projects.exists(_.outputPartitioning match { + case RangePartitioning(Seq(SortOrder(ar: AttributeReference, _, _, _)), _) => + ar.name == "id1" + case _ => false + })) + } + } + + test("SPARK-33399: aliased should be handled properly " + + "for partitioning and sortorder involving complex expressions") { + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + withTempView("t1", "t2", "t3") { + spark.range(10).select(col("id").as("id1")).createTempView("t1") + spark.range(20).select(col("id").as("id2")).createTempView("t2") + spark.range(30).select(col("id").as("id3")).createTempView("t3") + val planned = sql( + """ + |SELECT t3.id3 as t3id + |FROM ( + | SELECT t1.id1 as t1id, t2.id2 as t2id + | FROM t1, t2 + | WHERE t1.id1 * 10 = t2.id2 * 10 + |) t12, t3 + |WHERE t1id * 10 = t3.id3 * 10 + """.stripMargin).queryExecution.executedPlan + val sortNodes = collect(planned) { case s: SortExec => s } + assert(sortNodes.size == 3) + val exchangeNodes = collect(planned) { case e: ShuffleExchangeExec => e } + assert(exchangeNodes.size == 3) + + val projects = collect(planned) { case p: ProjectExec => p } + assert(projects.exists(_.outputPartitioning match { + case HashPartitioning(Seq(Multiply(ar1: AttributeReference, _, _)), _) => + ar1.name == "t1id" + case _ => + false + })) + } + } + } + + test("SPARK-33399: alias handling should happen properly for SinglePartition") { + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + val df = spark.range(1, 100, 1, 1) + .select(col("id").as("id1")).groupBy("id1").count() + val planned = df.queryExecution.executedPlan + val exchanges = collect(planned) { case s: ShuffleExchangeExec => s } + assert(exchanges.isEmpty) + + val projects = collect(planned) { case p: ProjectExec => p } + assert(projects.exists(_.outputPartitioning match { + case SinglePartition => true + case _ => false + })) + } + } + + test("SPARK-33399: No extra exchanges in case of" + + " [Inner Join -> Project with aliases -> HashAggregate]") { + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + withTempView("t1", "t2") { + spark.range(10).repartition($"id").createTempView("t1") + spark.range(20).repartition($"id").createTempView("t2") + val planned = sql( + """ + |SELECT t1id, t2id + |FROM ( + | SELECT t1.id as t1id, t2.id as t2id + | FROM t1 INNER JOIN t2 + | WHERE t1.id = t2.id + |) t12 + |GROUP BY t1id, t2id + """.stripMargin).queryExecution.executedPlan + val exchanges = collect(planned) { case s: ShuffleExchangeExec => s } assert(exchanges.size == 2) + + val projects = collect(planned) { case p: ProjectExec => p } + assert(projects.exists(_.outputPartitioning match { + case PartitioningCollection(Seq(HashPartitioning(Seq(k1: AttributeReference), _), + HashPartitioning(Seq(k2: AttributeReference), _))) => + k1.name == "t1id" && k2.name == "t2id" + case _ => false + })) + } + } + } + + test("SPARK-33400: Normalization of sortOrder should take care of sameOrderExprs") { + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + withTempView("t1", "t2", "t3") { + spark.range(10).repartition($"id").createTempView("t1") + spark.range(20).repartition($"id").createTempView("t2") + spark.range(30).repartition($"id").createTempView("t3") + val planned = sql( + """ + |SELECT t2id, t3.id as t3id + |FROM ( + | SELECT t1.id as t1id, t2.id as t2id + | FROM t1, t2 + | WHERE t1.id = t2.id + |) t12, t3 + |WHERE t2id = t3.id + """.stripMargin).queryExecution.executedPlan + + val sortNodes = collect(planned) { case s: SortExec => s } + assert(sortNodes.size == 3) + + val projects = collect(planned) { case p: ProjectExec => p } + assert(projects.exists(_.outputOrdering match { + case Seq(SortOrder(_, Ascending, NullsFirst, sameOrderExprs)) => + sameOrderExprs.size == 1 && sameOrderExprs.head.isInstanceOf[AttributeReference] && + sameOrderExprs.head.asInstanceOf[AttributeReference].name == "t2id" + case _ => false + })) + } + } + } + + test("sort order doesn't have repeated expressions") { + withSQLConf( + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1", + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") { + withTempView("t1", "t2") { + spark.range(10).repartition($"id").createTempView("t1") + spark.range(20).repartition($"id").createTempView("t2") + val planned = sql( + """ + | SELECT t12.id, t1.id + | FROM (SELECT t1.id FROM t1, t2 WHERE t1.id * 2 = t2.id) t12, t1 + | where 2 * t12.id = t1.id + """.stripMargin).queryExecution.executedPlan + + // t12 is already sorted on `t1.id * 2`. and we need to sort it on `2 * t12.id` + // for 2nd join. So sorting on t12 can be avoided + val sortNodes = planned.collect { case s: SortExec => s } + assert(sortNodes.size == 3) + val outputOrdering = planned.outputOrdering + assert(outputOrdering.size == 1) + // Sort order should have 3 childrens, not 4. This is because t1.id*2 and 2*t1.id are same + assert(outputOrdering.head.children.size == 3) + assert(outputOrdering.head.children.count(_.isInstanceOf[AttributeReference]) == 2) + assert(outputOrdering.head.children.count(_.isInstanceOf[Multiply]) == 1) } } } @@ -921,7 +1123,7 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { | (SELECT key + 1 AS k2 from df2) t2 |ON t1.k1 = t2.k2 |""".stripMargin).queryExecution.executedPlan - val exchanges = planned.collect { case s: ShuffleExchangeExec => s } + val exchanges = collect(planned) { case s: ShuffleExchangeExec => s } // Make sure aliases to an expression (key + 1) are not replaced. Seq("k1", "k2").foreach { alias => @@ -944,9 +1146,9 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { val planned = agg1.join(agg2, $"k1" === $"k3").queryExecution.executedPlan - assert(planned.collect { case h: HashAggregateExec => h }.nonEmpty) + assert(collect(planned) { case h: HashAggregateExec => h }.nonEmpty) - val exchanges = planned.collect { case s: ShuffleExchangeExec => s } + val exchanges = collect(planned) { case s: ShuffleExchangeExec => s } assert(exchanges.size == 2) } } @@ -964,12 +1166,12 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { val planned = agg1.join(agg2, $"k1" === $"k3").queryExecution.executedPlan if (useObjectHashAgg) { - assert(planned.collect { case o: ObjectHashAggregateExec => o }.nonEmpty) + assert(collect(planned) { case o: ObjectHashAggregateExec => o }.nonEmpty) } else { - assert(planned.collect { case s: SortAggregateExec => s }.nonEmpty) + assert(collect(planned) { case s: SortAggregateExec => s }.nonEmpty) } - val exchanges = planned.collect { case s: ShuffleExchangeExec => s } + val exchanges = collect(planned) { case s: ShuffleExchangeExec => s } assert(exchanges.size == 2) } } @@ -977,23 +1179,79 @@ class PlannerSuite extends SharedSparkSession with AdaptiveSparkPlanHelper { } test("aliases in the sort aggregate expressions should not introduce extra sort") { - withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { - withSQLConf(SQLConf.USE_OBJECT_HASH_AGG.key -> "false") { - val t1 = spark.range(10).selectExpr("floor(id/4) as k1") - val t2 = spark.range(20).selectExpr("floor(id/4) as k2") + withSQLConf( + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1", + SQLConf.USE_OBJECT_HASH_AGG.key -> "false") { + val t1 = spark.range(10).selectExpr("floor(id/4) as k1") + val t2 = spark.range(20).selectExpr("floor(id/4) as k2") + + val agg1 = t1.groupBy("k1").agg(collect_list("k1")).withColumnRenamed("k1", "k3") + val agg2 = t2.groupBy("k2").agg(collect_list("k2")) - val agg1 = t1.groupBy("k1").agg(collect_list("k1")).withColumnRenamed("k1", "k3") - val agg2 = t2.groupBy("k2").agg(collect_list("k2")) + val planned = agg1.join(agg2, $"k3" === $"k2").queryExecution.executedPlan + assert(collect(planned) { case s: SortAggregateExec => s }.nonEmpty) - val planned = agg1.join(agg2, $"k3" === $"k2").queryExecution.executedPlan - assert(planned.collect { case s: SortAggregateExec => s }.nonEmpty) + // We expect two SortExec nodes on each side of join. + val sorts = collect(planned) { case s: SortExec => s } + assert(sorts.size == 4) + } + } - // We expect two SortExec nodes on each side of join. - val sorts = planned.collect { case s: SortExec => s } - assert(sorts.size == 4) + testWithWholeStageCodegenOnAndOff("Change the number of partitions to zero " + + "when a range is empty") { _ => + val range = spark.range(1, 1, 1, 1000) + val numPartitions = range.rdd.getNumPartitions + assert(numPartitions == 0) + } + + test("SPARK-33758: Prune unnecessary output partitioning") { + withSQLConf( + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1", + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") { + withTempView("t1", "t2") { + spark.range(10).repartition($"id").createTempView("t1") + spark.range(20).repartition($"id").createTempView("t2") + val planned = sql( + """ + | SELECT t1.id as t1id, t2.id as t2id + | FROM t1, t2 + | WHERE t1.id = t2.id + """.stripMargin).queryExecution.executedPlan + + assert(planned.outputPartitioning match { + case PartitioningCollection(Seq(HashPartitioning(Seq(k1: AttributeReference), _), + HashPartitioning(Seq(k2: AttributeReference), _))) => + k1.name == "t1id" && k2.name == "t2id" + }) + + val planned2 = sql( + """ + | SELECT t1.id as t1id + | FROM t1, t2 + | WHERE t1.id = t2.id + """.stripMargin).queryExecution.executedPlan + assert(planned2.outputPartitioning match { + case HashPartitioning(Seq(k1: AttributeReference), _) if k1.name == "t1id" => + true + }) } } } + + test("SPARK-34919: Change partitioning to SinglePartition if partition number is 1") { + def checkSinglePartitioning(df: DataFrame): Unit = { + assert( + df.queryExecution.analyzed.collect { + case r: RepartitionOperation => r + }.size == 1) + assert( + collect(df.queryExecution.executedPlan) { + case s: ShuffleExchangeExec if s.outputPartitioning == SinglePartition => s + }.size == 1) + } + checkSinglePartitioning(sql("SELECT /*+ REPARTITION(1) */ * FROM VALUES(1),(2),(3) AS t(c)")) + checkSinglePartitioning(sql("SELECT /*+ REPARTITION(1, c) */ * FROM VALUES(1),(2),(3) AS t(c)")) + } } // Used for unit-testing EnsureRequirements @@ -1006,4 +1264,6 @@ private case class DummySparkPlan( ) extends SparkPlan { override protected def doExecute(): RDD[InternalRow] = throw new UnsupportedOperationException override def output: Seq[Attribute] = Seq.empty + override protected def withNewChildrenInternal(newChildren: IndexedSeq[SparkPlan]): SparkPlan = + copy(children = newChildren) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/QueryExecutionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/QueryExecutionSuite.scala index eca39f3f81726..eb93a5eca6560 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/QueryExecutionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/QueryExecutionSuite.scala @@ -24,6 +24,7 @@ import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, OneRowRelation} import org.apache.spark.sql.catalyst.trees.TreeNodeTag import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.util.Utils case class QueryExecutionTestRecord( c0: Int, c1: Int, c2: Int, c3: Int, c4: Int, @@ -36,8 +37,9 @@ case class QueryExecutionTestRecord( class QueryExecutionSuite extends SharedSparkSession { import testImplicits._ - def checkDumpedPlans(path: String, expected: Int): Unit = { - assert(Source.fromFile(path).getLines.toList + def checkDumpedPlans(path: String, expected: Int): Unit = Utils.tryWithResource( + Source.fromFile(path)) { source => + assert(source.getLines.toList .takeWhile(_ != "== Whole Stage Codegen ==") == List( "== Parsed Logical Plan ==", s"Range (0, $expected, step=1, splits=Some(2))", @@ -53,6 +55,7 @@ class QueryExecutionSuite extends SharedSparkSession { s"*(1) Range (0, $expected, step=1, splits=2)", "")) } + test("dumping query execution info to a file") { withTempDir { dir => val path = dir.getCanonicalPath + "/plans.txt" @@ -93,6 +96,26 @@ class QueryExecutionSuite extends SharedSparkSession { assert(exception.getMessage.contains("Illegal character in scheme name")) } + test("dumping query execution info to a file - explainMode=formatted") { + withTempDir { dir => + val path = dir.getCanonicalPath + "/plans.txt" + val df = spark.range(0, 10) + df.queryExecution.debug.toFile(path, explainMode = Option("formatted")) + val lines = Utils.tryWithResource(Source.fromFile(path))(_.getLines().toList) + assert(lines + .takeWhile(_ != "== Whole Stage Codegen ==").map(_.replaceAll("#\\d+", "#x")) == List( + "== Physical Plan ==", + s"* Range (1)", + "", + "", + s"(1) Range [codegen id : 1]", + "Output [1]: [id#xL]", + s"Arguments: Range (0, 10, step=1, splits=Some(2))", + "", + "")) + } + } + test("limit number of fields by sql config") { def relationPlans: String = { val ds = spark.createDataset(Seq(QueryExecutionTestRecord( @@ -115,9 +138,10 @@ class QueryExecutionSuite extends SharedSparkSession { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26))) ds.queryExecution.debug.toFile(path) - val localRelations = Source.fromFile(path).getLines().filter(_.contains("LocalRelation")) - - assert(!localRelations.exists(_.contains("more fields"))) + Utils.tryWithResource(Source.fromFile(path)) { source => + val localRelations = source.getLines().filter(_.contains("LocalRelation")) + assert(!localRelations.exists(_.contains("more fields"))) + } } } @@ -191,4 +215,25 @@ class QueryExecutionSuite extends SharedSparkSession { df.queryExecution.executedPlan.setTagValue(tag5, "v") assertNoTag(tag5, df.queryExecution.sparkPlan) } + + test("Logging plan changes for execution") { + val testAppender = new LogAppender("plan changes") + withLogAppender(testAppender) { + withSQLConf(SQLConf.PLAN_CHANGE_LOG_LEVEL.key -> "INFO") { + spark.range(1).groupBy("id").count().queryExecution.executedPlan + } + } + Seq("=== Applying Rule org.apache.spark.sql.execution", + "=== Result of Batch Preparations ===").foreach { expectedMsg => + assert(testAppender.loggingEvents.exists(_.getRenderedMessage.contains(expectedMsg))) + } + } + + test("SPARK-34129: Add table name to LogicalRelation.simpleString") { + withTable("spark_34129") { + spark.sql("CREATE TABLE spark_34129(id INT) using parquet") + val df = spark.table("spark_34129") + assert(df.queryExecution.optimizedPlan.toString.startsWith("Relation default.spark_34129[")) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/ReferenceSort.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/ReferenceSort.scala index 25b4464823e5f..1592949fe9a9b 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/ReferenceSort.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/ReferenceSort.scala @@ -20,7 +20,6 @@ package org.apache.spark.sql.execution import org.apache.spark.TaskContext import org.apache.spark.rdd.RDD import org.apache.spark.sql.catalyst.InternalRow -import org.apache.spark.sql.catalyst.errors._ import org.apache.spark.sql.catalyst.expressions.{Attribute, RowOrdering, SortOrder} import org.apache.spark.sql.catalyst.plans.physical._ import org.apache.spark.util.CompletionIterator @@ -39,7 +38,7 @@ case class ReferenceSort( override def requiredChildDistribution: Seq[Distribution] = if (global) OrderedDistribution(sortOrder) :: Nil else UnspecifiedDistribution :: Nil - protected override def doExecute(): RDD[InternalRow] = attachTree(this, "sort") { + protected override def doExecute(): RDD[InternalRow] = { child.execute().mapPartitions( { iterator => val ordering = RowOrdering.create(sortOrder, child.output) val sorter = new ExternalSorter[InternalRow, Null, InternalRow]( @@ -59,4 +58,7 @@ case class ReferenceSort( override def outputOrdering: Seq[SortOrder] = sortOrder override def outputPartitioning: Partitioning = child.outputPartitioning + + override protected def withNewChildInternal(newChild: SparkPlan): ReferenceSort = + copy(child = newChild) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/RemoveRedundantProjectsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/RemoveRedundantProjectsSuite.scala new file mode 100644 index 0000000000000..944aa963cc4be --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/RemoveRedundantProjectsSuite.scala @@ -0,0 +1,225 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution + +import org.apache.spark.sql.{DataFrame, QueryTest, Row} +import org.apache.spark.sql.execution.adaptive.{AdaptiveSparkPlanHelper, DisableAdaptiveExecutionSuite, EnableAdaptiveExecutionSuite} +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types.StructType +import org.apache.spark.util.Utils + +abstract class RemoveRedundantProjectsSuiteBase + extends QueryTest + with SharedSparkSession + with AdaptiveSparkPlanHelper { + + private def assertProjectExecCount(df: DataFrame, expected: Int): Unit = { + withClue(df.queryExecution) { + val plan = df.queryExecution.executedPlan + val actual = collectWithSubqueries(plan) { case p: ProjectExec => p }.size + assert(actual == expected) + } + } + + private def assertProjectExec(query: String, enabled: Int, disabled: Int): Unit = { + val df = sql(query) + // When enabling AQE, the DPP subquery filters is replaced in runtime. + df.collect() + assertProjectExecCount(df, enabled) + val result = df.collect() + withSQLConf(SQLConf.REMOVE_REDUNDANT_PROJECTS_ENABLED.key -> "false") { + val df2 = sql(query) + df2.collect() + assertProjectExecCount(df2, disabled) + checkAnswer(df2, result) + } + } + + private val tmpPath = Utils.createTempDir() + + override def beforeAll(): Unit = { + super.beforeAll() + tmpPath.delete() + val path = tmpPath.getAbsolutePath + spark.range(100).selectExpr("id % 10 as key", "cast(id * 2 as int) as a", + "cast(id * 3 as int) as b", "cast(id as string) as c", "array(id, id + 1, id + 3) as d") + .write.partitionBy("key").parquet(path) + spark.read.parquet(path).createOrReplaceTempView("testView") + } + + override def afterAll(): Unit = { + Utils.deleteRecursively(tmpPath) + super.afterAll() + } + + test("project") { + val query = "select * from testView" + assertProjectExec(query, 0, 0) + } + + test("project with filter") { + val query = "select * from testView where a > 5" + assertProjectExec(query, 0, 1) + } + + test("project with specific column ordering") { + val query = "select key, a, b, c from testView" + assertProjectExec(query, 1, 1) + } + + test("project with extra columns") { + val query = "select a, b, c, key, a from testView" + assertProjectExec(query, 1, 1) + } + + test("project with fewer columns") { + val query = "select a from testView where a > 3" + assertProjectExec(query, 1, 1) + } + + test("aggregate without ordering requirement") { + val query = "select sum(a) as sum_a, key, last(b) as last_b " + + "from (select key, a, b from testView where a > 100) group by key" + assertProjectExec(query, 0, 1) + } + + test("aggregate with ordering requirement") { + val query = "select a, sum(b) as sum_b from testView group by a" + assertProjectExec(query, 1, 1) + } + + test("join without ordering requirement") { + val query = "select t1.key, t2.key, t1.a, t2.b from (select key, a, b, c from testView)" + + " as t1 join (select key, a, b, c from testView) as t2 on t1.c > t2.c and t1.key > 10" + assertProjectExec(query, 1, 3) + } + + test("join with ordering requirement") { + val query = "select * from (select key, a, c, b from testView) as t1 join " + + "(select key, a, b, c from testView) as t2 on t1.key = t2.key where t2.a > 50" + assertProjectExec(query, 2, 2) + } + + test("window function") { + val query = "select key, b, avg(a) over (partition by key order by a " + + "rows between 1 preceding and 1 following) as avg from testView" + assertProjectExec(query, 1, 2) + } + + test("generate should require column ordering") { + withTempView("testData") { + spark.range(0, 10, 1) + .selectExpr("id as key", "id * 2 as a", "id * 3 as b") + .createOrReplaceTempView("testData") + + val data = sql("select key, a, b, count(*) from testData group by key, a, b limit 2") + val df = data.selectExpr("a", "b", "key", "explode(array(key, a, b)) as d").filter("d > 0") + df.collect() + val plan = df.queryExecution.executedPlan + val numProjects = collectWithSubqueries(plan) { case p: ProjectExec => p }.length + + // Create a new plan that reverse the GenerateExec output and add a new ProjectExec between + // GenerateExec and its child. This is to test if the ProjectExec is removed, the output of + // the query will be incorrect. + val newPlan = stripAQEPlan(plan) transform { + case g @ GenerateExec(_, requiredChildOutput, _, _, child) => + g.copy(requiredChildOutput = requiredChildOutput.reverse, + child = ProjectExec(requiredChildOutput.reverse, child)) + } + + // Re-apply remove redundant project rule. + val rule = RemoveRedundantProjects + val newExecutedPlan = rule.apply(newPlan) + // The manually added ProjectExec node shouldn't be removed. + assert(collectWithSubqueries(newExecutedPlan) { + case p: ProjectExec => p + }.size == numProjects + 1) + + // Check the original plan's output and the new plan's output are the same. + val expectedRows = plan.executeCollect() + val actualRows = newExecutedPlan.executeCollect() + assert(expectedRows.length == actualRows.length) + expectedRows.zip(actualRows).foreach { case (expected, actual) => assert(expected == actual) } + } + } + + test("subquery") { + withTempView("testData") { + val data = spark.sparkContext.parallelize((1 to 100).map(i => Row(i, i.toString))) + val schema = new StructType().add("key", "int").add("value", "string") + spark.createDataFrame(data, schema).createOrReplaceTempView("testData") + val query = "select key, value from testData where key in " + + "(select sum(a) from testView where a > 5 group by key)" + assertProjectExec(query, 0, 1) + } + } + + test("SPARK-33697: UnionExec should require column ordering") { + withTable("t1", "t2") { + spark.range(-10, 20) + .selectExpr( + "id", + "date_add(date '1950-01-01', cast(id as int)) as datecol", + "cast(id as string) strcol") + .write.mode("overwrite").format("parquet").saveAsTable("t1") + spark.range(-10, 20) + .selectExpr( + "cast(id as string) strcol", + "id", + "date_add(date '1950-01-01', cast(id as int)) as datecol") + .write.mode("overwrite").format("parquet").saveAsTable("t2") + + val queryTemplate = + """ + |SELECT DISTINCT datecol, strcol FROM + |( + |(SELECT datecol, id, strcol from t1) + | %s + |(SELECT datecol, id, strcol from t2) + |) + |""".stripMargin + + Seq(("UNION", 1, 2), ("UNION ALL", 1, 2)).foreach { case (setOperation, enabled, disabled) => + val query = queryTemplate.format(setOperation) + assertProjectExec(query, enabled = enabled, disabled = disabled) + } + } + } + + test("SPARK-33697: remove redundant projects under expand") { + val query = + """ + |SELECT t1.key, t2.key, sum(t1.a) AS s1, sum(t2.b) AS s2 FROM + |(SELECT a, key FROM testView) t1 + |JOIN + |(SELECT b, key FROM testView) t2 + |ON t1.key = t2.key + |GROUP BY t1.key, t2.key GROUPING SETS(t1.key, t2.key) + |ORDER BY t1.key, t2.key, s1, s2 + |LIMIT 10 + |""".stripMargin + assertProjectExec(query, 0, 3) + } +} + +class RemoveRedundantProjectsSuite extends RemoveRedundantProjectsSuiteBase + with DisableAdaptiveExecutionSuite + +class RemoveRedundantProjectsSuiteAE extends RemoveRedundantProjectsSuiteBase + with EnableAdaptiveExecutionSuite diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/RemoveRedundantSortsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/RemoveRedundantSortsSuite.scala new file mode 100644 index 0000000000000..751078d08fda9 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/RemoveRedundantSortsSuite.scala @@ -0,0 +1,172 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution + +import org.apache.spark.sql.{DataFrame, QueryTest} +import org.apache.spark.sql.catalyst.plans.physical.{RangePartitioning, UnknownPartitioning} +import org.apache.spark.sql.execution.adaptive.{AdaptiveSparkPlanHelper, DisableAdaptiveExecutionSuite, EnableAdaptiveExecutionSuite} +import org.apache.spark.sql.execution.joins.ShuffledJoin +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.SharedSparkSession + + +abstract class RemoveRedundantSortsSuiteBase + extends QueryTest + with SharedSparkSession + with AdaptiveSparkPlanHelper { + import testImplicits._ + + private def checkNumSorts(df: DataFrame, count: Int): Unit = { + val plan = df.queryExecution.executedPlan + assert(collectWithSubqueries(plan) { case s: SortExec => s }.length == count) + } + + private def checkSorts(query: String, enabledCount: Int, disabledCount: Int): Unit = { + withSQLConf(SQLConf.REMOVE_REDUNDANT_SORTS_ENABLED.key -> "true") { + val df = sql(query) + checkNumSorts(df, enabledCount) + val result = df.collect() + withSQLConf(SQLConf.REMOVE_REDUNDANT_SORTS_ENABLED.key -> "false") { + val df = sql(query) + checkNumSorts(df, disabledCount) + checkAnswer(df, result) + } + } + } + + test("remove redundant sorts with limit") { + withTempView("t") { + spark.range(100).select('id as "key").createOrReplaceTempView("t") + val query = + """ + |SELECT key FROM + | (SELECT key FROM t WHERE key > 10 ORDER BY key DESC LIMIT 10) + |ORDER BY key DESC + |""".stripMargin + checkSorts(query, 0, 1) + } + } + + test("remove redundant sorts with broadcast hash join") { + withTempView("t1", "t2") { + spark.range(1000).select('id as "key").createOrReplaceTempView("t1") + spark.range(1000).select('id as "key").createOrReplaceTempView("t2") + + val queryTemplate = """ + |SELECT /*+ BROADCAST(%s) */ t1.key FROM + | (SELECT key FROM t1 WHERE key > 10 ORDER BY key DESC LIMIT 10) t1 + |JOIN + | (SELECT key FROM t2 WHERE key > 50 ORDER BY key DESC LIMIT 100) t2 + |ON t1.key = t2.key + |ORDER BY %s + """.stripMargin + + // No sort should be removed since the stream side (t2) order DESC + // does not satisfy the required sort order ASC. + val buildLeftOrderByRightAsc = queryTemplate.format("t1", "t2.key ASC") + checkSorts(buildLeftOrderByRightAsc, 1, 1) + + // The top sort node should be removed since the stream side (t2) order DESC already + // satisfies the required sort order DESC. + val buildLeftOrderByRightDesc = queryTemplate.format("t1", "t2.key DESC") + checkSorts(buildLeftOrderByRightDesc, 0, 1) + + // No sort should be removed since the sort ordering from broadcast-hash join is based + // on the stream side (t2) and the required sort order is from t1. + val buildLeftOrderByLeftDesc = queryTemplate.format("t1", "t1.key DESC") + checkSorts(buildLeftOrderByLeftDesc, 1, 1) + + // The top sort node should be removed since the stream side (t1) order DESC already + // satisfies the required sort order DESC. + val buildRightOrderByLeftDesc = queryTemplate.format("t2", "t1.key DESC") + checkSorts(buildRightOrderByLeftDesc, 0, 1) + } + } + + test("remove redundant sorts with sort merge join") { + withTempView("t1", "t2") { + spark.range(1000).select('id as "key").createOrReplaceTempView("t1") + spark.range(1000).select('id as "key").createOrReplaceTempView("t2") + val query = """ + |SELECT /*+ MERGE(t1) */ t1.key FROM + | (SELECT key FROM t1 WHERE key > 10 ORDER BY key DESC LIMIT 10) t1 + |JOIN + | (SELECT key FROM t2 WHERE key > 50 ORDER BY key DESC LIMIT 100) t2 + |ON t1.key = t2.key + |ORDER BY t1.key + """.stripMargin + + val queryAsc = query + " ASC" + checkSorts(queryAsc, 2, 3) + + // The top level sort should not be removed since the child output ordering is ASC and + // the required ordering is DESC. + val queryDesc = query + " DESC" + checkSorts(queryDesc, 3, 3) + } + } + + test("cached sorted data doesn't need to be re-sorted") { + withSQLConf(SQLConf.REMOVE_REDUNDANT_SORTS_ENABLED.key -> "true") { + val df = spark.range(1000).select('id as "key").sort('key.desc).cache() + val resorted = df.sort('key.desc) + val sortedAsc = df.sort('key.asc) + checkNumSorts(df, 0) + checkNumSorts(resorted, 0) + checkNumSorts(sortedAsc, 1) + val result = resorted.collect() + withSQLConf(SQLConf.REMOVE_REDUNDANT_SORTS_ENABLED.key -> "false") { + val resorted = df.sort('key.desc) + checkNumSorts(resorted, 1) + checkAnswer(resorted, result) + } + } + } + + test("SPARK-33472: shuffled join with different left and right side partition numbers") { + withTempView("t1", "t2") { + spark.range(0, 100, 1, 2).select('id as "key").createOrReplaceTempView("t1") + (0 to 100).toDF("key").createOrReplaceTempView("t2") + + val queryTemplate = """ + |SELECT /*+ %s(t1) */ t1.key + |FROM t1 JOIN t2 ON t1.key = t2.key + |WHERE t1.key > 10 AND t2.key < 50 + |ORDER BY t1.key ASC + """.stripMargin + + Seq(("MERGE", 3), ("SHUFFLE_HASH", 1)).foreach { case (hint, count) => + val query = queryTemplate.format(hint) + val df = sql(query) + val sparkPlan = df.queryExecution.sparkPlan + val join = sparkPlan.collect { case j: ShuffledJoin => j }.head + val leftPartitioning = join.left.outputPartitioning + assert(leftPartitioning.isInstanceOf[RangePartitioning]) + assert(leftPartitioning.numPartitions == 2) + assert(join.right.outputPartitioning == UnknownPartitioning(0)) + checkSorts(query, count, count) + } + } + } +} + +class RemoveRedundantSortsSuite extends RemoveRedundantSortsSuiteBase + with DisableAdaptiveExecutionSuite + +class RemoveRedundantSortsSuiteAE extends RemoveRedundantSortsSuiteBase + with EnableAdaptiveExecutionSuite diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLExecutionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLExecutionSuite.scala index 8bf7fe62cd49b..81e692076b432 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLExecutionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLExecutionSuite.scala @@ -17,11 +17,17 @@ package org.apache.spark.sql.execution +import java.util.concurrent.Executors + import scala.collection.parallel.immutable.ParRange +import scala.concurrent.{ExecutionContext, Future} +import scala.concurrent.duration._ import org.apache.spark.{SparkConf, SparkContext, SparkFunSuite} import org.apache.spark.scheduler.{SparkListener, SparkListenerJobStart} -import org.apache.spark.sql.SparkSession +import org.apache.spark.sql.{Row, SparkSession} +import org.apache.spark.sql.types._ +import org.apache.spark.util.ThreadUtils class SQLExecutionSuite extends SparkFunSuite { @@ -119,6 +125,38 @@ class SQLExecutionSuite extends SparkFunSuite { spark.stop() } + + test("SPARK-32813: Table scan should work in different thread") { + val executor1 = Executors.newSingleThreadExecutor() + val executor2 = Executors.newSingleThreadExecutor() + var session: SparkSession = null + SparkSession.cleanupAnyExistingSession() + + withTempDir { tempDir => + try { + val tablePath = tempDir.toString + "/table" + val df = ThreadUtils.awaitResult(Future { + session = SparkSession.builder().appName("test").master("local[*]").getOrCreate() + + session.createDataFrame( + session.sparkContext.parallelize(Row(Array(1, 2, 3)) :: Nil), + StructType(Seq( + StructField("a", ArrayType(IntegerType, containsNull = false), nullable = false)))) + .write.parquet(tablePath) + + session.read.parquet(tablePath) + }(ExecutionContext.fromExecutorService(executor1)), 1.minute) + + ThreadUtils.awaitResult(Future { + assert(df.rdd.collect()(0) === Row(Seq(1, 2, 3))) + }(ExecutionContext.fromExecutorService(executor2)), 1.minute) + } finally { + executor1.shutdown() + executor2.shutdown() + session.stop() + } + } + } } object SQLExecutionSuite { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala index 575efec364812..adb212d653ce9 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewSuite.scala @@ -17,10 +17,12 @@ package org.apache.spark.sql.execution +import org.apache.spark.SparkException import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.analysis.NoSuchTableException -import org.apache.spark.sql.internal.SQLConf.MAX_NESTED_VIEW_DEPTH +import org.apache.spark.sql.catalyst.parser.ParseException +import org.apache.spark.sql.internal.SQLConf._ import org.apache.spark.sql.test.{SharedSparkSession, SQLTestUtils} class SimpleSQLViewSuite extends SQLViewSuite with SharedSparkSession @@ -109,7 +111,7 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils { e = intercept[AnalysisException] { sql("ALTER VIEW tab1 AS SELECT * FROM jt") }.getMessage - assert(e.contains("`tab1` is not a view")) + assert(e.contains("tab1 is a table. 'ALTER VIEW ... AS' expects a view.")) } } @@ -125,8 +127,12 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils { val viewName = "testView" withTempView(viewName) { spark.range(10).createTempView(viewName) - assertNoSuchTable(s"ALTER VIEW $viewName SET TBLPROPERTIES ('p' = 'an')") - assertNoSuchTable(s"ALTER VIEW $viewName UNSET TBLPROPERTIES ('p')") + assertAnalysisError( + s"ALTER VIEW $viewName SET TBLPROPERTIES ('p' = 'an')", + "testView is a temp view. 'ALTER VIEW ... SET TBLPROPERTIES' expects a permanent view.") + assertAnalysisError( + s"ALTER VIEW $viewName UNSET TBLPROPERTIES ('p')", + "testView is a temp view. 'ALTER VIEW ... UNSET TBLPROPERTIES' expects a permanent view.") } } @@ -134,24 +140,50 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils { val viewName = "testView" withTempView(viewName) { spark.range(10).createTempView(viewName) - assertNoSuchTable(s"ALTER TABLE $viewName SET SERDE 'whatever'") - assertNoSuchTable(s"ALTER TABLE $viewName PARTITION (a=1, b=2) SET SERDE 'whatever'") - assertNoSuchTable(s"ALTER TABLE $viewName SET SERDEPROPERTIES ('p' = 'an')") - assertNoSuchTable(s"ALTER TABLE $viewName ADD IF NOT EXISTS PARTITION (a='4', b='8')") - assertNoSuchTable(s"ALTER TABLE $viewName DROP PARTITION (a='4', b='8')") - assertNoSuchTable(s"ALTER TABLE $viewName PARTITION (a='4') RENAME TO PARTITION (a='5')") - assertNoSuchTable(s"ALTER TABLE $viewName RECOVER PARTITIONS") - - // For v2 ALTER TABLE statements, we have better error message saying view is not supported. - assertAnalysisError( + assertErrorForAlterTableOnTempView( + s"ALTER TABLE $viewName SET SERDE 'whatever'", + viewName, + "ALTER TABLE ... SET [SERDE|SERDEPROPERTIES]") + assertErrorForAlterTableOnTempView( + s"ALTER TABLE $viewName PARTITION (a=1, b=2) SET SERDE 'whatever'", + viewName, + "ALTER TABLE ... SET [SERDE|SERDEPROPERTIES]") + assertErrorForAlterTableOnTempView( + s"ALTER TABLE $viewName SET SERDEPROPERTIES ('p' = 'an')", + viewName, + "ALTER TABLE ... SET [SERDE|SERDEPROPERTIES]") + assertErrorForAlterTableOnTempView( + s"ALTER TABLE $viewName PARTITION (a='4') RENAME TO PARTITION (a='5')", + viewName, + "ALTER TABLE ... RENAME TO PARTITION") + assertErrorForAlterTableOnTempView( + s"ALTER TABLE $viewName RECOVER PARTITIONS", + viewName, + "ALTER TABLE ... RECOVER PARTITIONS") + assertErrorForAlterTableOnTempView( s"ALTER TABLE $viewName SET LOCATION '/path/to/your/lovely/heart'", - s"'$viewName' is a view not a table") - - // For the following v2 ALERT TABLE statements, unsupported operations are checked first - // before resolving the relations. - assertAnalysisError( + viewName, + "ALTER TABLE ... SET LOCATION ...") + assertErrorForAlterTableOnTempView( s"ALTER TABLE $viewName PARTITION (a='4') SET LOCATION '/path/to/home'", - "ALTER TABLE SET LOCATION does not support partition for v2 tables") + viewName, + "ALTER TABLE ... SET LOCATION ...") + assertErrorForAlterTableOnTempView( + s"ALTER TABLE $viewName ADD IF NOT EXISTS PARTITION (a='4', b='8')", + viewName, + "ALTER TABLE ... ADD PARTITION ...") + assertErrorForAlterTableOnTempView( + s"ALTER TABLE $viewName DROP PARTITION (a='4', b='8')", + viewName, + "ALTER TABLE ... DROP PARTITION ...") + assertErrorForAlterTableOnTempView( + s"ALTER TABLE $viewName SET TBLPROPERTIES ('p' = 'an')", + viewName, + "ALTER TABLE ... SET TBLPROPERTIES") + assertErrorForAlterTableOnTempView( + s"ALTER TABLE $viewName UNSET TBLPROPERTIES ('p')", + viewName, + "ALTER TABLE ... UNSET TBLPROPERTIES") } } @@ -167,15 +199,24 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils { val dataFilePath = Thread.currentThread().getContextClassLoader.getResource("data/files/employee.dat") - assertNoSuchTable(s"""LOAD DATA LOCAL INPATH "$dataFilePath" INTO TABLE $viewName""") - assertNoSuchTable(s"TRUNCATE TABLE $viewName") val e2 = intercept[AnalysisException] { + sql(s"""LOAD DATA LOCAL INPATH "$dataFilePath" INTO TABLE $viewName""") + }.getMessage + assert(e2.contains(s"$viewName is a temp view. 'LOAD DATA' expects a table")) + val e3 = intercept[AnalysisException] { sql(s"SHOW CREATE TABLE $viewName") }.getMessage - assert(e2.contains("SHOW CREATE TABLE is not supported on a temporary view")) - assertNoSuchTable(s"SHOW PARTITIONS $viewName") - assertNoSuchTable(s"ANALYZE TABLE $viewName COMPUTE STATISTICS") - assertNoSuchTable(s"ANALYZE TABLE $viewName COMPUTE STATISTICS FOR COLUMNS id") + assert(e3.contains( + s"$viewName is a temp view. 'SHOW CREATE TABLE' expects a table or permanent view.")) + val e4 = intercept[AnalysisException] { + sql(s"ANALYZE TABLE $viewName COMPUTE STATISTICS") + }.getMessage + assert(e4.contains( + s"$viewName is a temp view. 'ANALYZE TABLE' expects a table or permanent view.")) + val e5 = intercept[AnalysisException] { + sql(s"ANALYZE TABLE $viewName COMPUTE STATISTICS FOR COLUMNS id") + }.getMessage + assert(e5.contains(s"Temporary view `$viewName` is not cached for analyzing columns.")) } } @@ -190,7 +231,14 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils { assert(e.message.contains(message)) } - test("error handling: insert/load/truncate table commands against a view") { + private def assertErrorForAlterTableOnTempView( + sqlText: String, viewName: String, cmdName: String): Unit = { + assertAnalysisError( + sqlText, + s"$viewName is a temp view. '$cmdName' expects a table. Please use ALTER VIEW instead.") + } + + test("error handling: insert/load table commands against a view") { val viewName = "testView" withView(viewName) { sql(s"CREATE VIEW $viewName AS SELECT id FROM jt") @@ -204,12 +252,7 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils { e = intercept[AnalysisException] { sql(s"""LOAD DATA LOCAL INPATH "$dataFilePath" INTO TABLE $viewName""") }.getMessage - assert(e.contains(s"Target table in LOAD DATA cannot be a view: `default`.`testview`")) - - e = intercept[AnalysisException] { - sql(s"TRUNCATE TABLE $viewName") - }.getMessage - assert(e.contains(s"Operation not allowed: TRUNCATE TABLE on views: `default`.`testview`")) + assert(e.contains("default.testView is a view. 'LOAD DATA' expects a table")) } } @@ -266,6 +309,16 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils { } } + test("SPARK-32374: disallow setting properties for CREATE TEMPORARY VIEW") { + withTempView("myabcdview") { + val e = intercept[ParseException] { + sql("CREATE TEMPORARY VIEW myabcdview TBLPROPERTIES ('a' = 'b') AS SELECT * FROM jt") + } + assert(e.message.contains( + "Operation not allowed: TBLPROPERTIES can't coexist with CREATE TEMPORARY VIEW")) + } + } + test("correctly parse CREATE VIEW statement") { withView("testView") { sql( @@ -301,7 +354,6 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils { sql( """CREATE TEMPORARY VIEW |testView (c1 COMMENT 'blabla', c2 COMMENT 'blabla') - |TBLPROPERTIES ('a' = 'b') |AS SELECT * FROM jt |""".stripMargin) checkAnswer(sql("SELECT c1, c2 FROM testView ORDER BY c1"), (1 to 9).map(i => Row(i, i))) @@ -416,8 +468,13 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils { } test("should not allow ALTER VIEW AS when the view does not exist") { - assertNoSuchTable("ALTER VIEW testView AS SELECT 1, 2") - assertNoSuchTable("ALTER VIEW default.testView AS SELECT 1, 2") + assertAnalysisError( + "ALTER VIEW testView AS SELECT 1, 2", + "View not found: testView") + + assertAnalysisError( + "ALTER VIEW default.testView AS SELECT 1, 2", + "View not found: default.testView") } test("ALTER VIEW AS should try to alter temp view first if view name has no database part") { @@ -676,31 +733,6 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils { } } - test("restrict the nested level of a view") { - val viewNames = Array.range(0, 11).map(idx => s"view$idx") - withView(viewNames: _*) { - sql("CREATE VIEW view0 AS SELECT * FROM jt") - Array.range(0, 10).foreach { idx => - sql(s"CREATE VIEW view${idx + 1} AS SELECT * FROM view$idx") - } - - withSQLConf(MAX_NESTED_VIEW_DEPTH.key -> "10") { - val e = intercept[AnalysisException] { - sql("SELECT * FROM view10") - }.getMessage - assert(e.contains("The depth of view `default`.`view0` exceeds the maximum view " + - "resolution depth (10). Analysis is aborted to avoid errors. Increase the value " + - s"of ${MAX_NESTED_VIEW_DEPTH.key} to work around this.")) - } - - val e = intercept[IllegalArgumentException] { - withSQLConf(MAX_NESTED_VIEW_DEPTH.key -> "0") {} - }.getMessage - assert(e.contains("The maximum depth of a view reference in a nested view must be " + - "positive.")) - } - } - test("permanent view should be case-preserving") { withView("v") { sql("CREATE VIEW v AS SELECT 1 as aBc") @@ -713,7 +745,7 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils { test("sparkSession API view resolution with different default database") { withDatabase("db2") { - withView("v1") { + withView("default.v1") { withTable("t1") { sql("USE default") sql("CREATE TABLE t1 USING parquet AS SELECT 1 AS c0") @@ -735,4 +767,147 @@ abstract class SQLViewSuite extends QueryTest with SQLTestUtils { } } } + + test("temporary view should ignore useCurrentSQLConfigsForView config") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + withTempView("v1") { + sql("CREATE TEMPORARY VIEW v1 AS SELECT 1/0") + withSQLConf( + USE_CURRENT_SQL_CONFIGS_FOR_VIEW.key -> "true", + ANSI_ENABLED.key -> "true") { + checkAnswer(sql("SELECT * FROM v1"), Seq(Row(null))) + } + } + } + } + + test("alter temporary view should follow current storeAnalyzedPlanForView config") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + withView("v1") { + withSQLConf(STORE_ANALYZED_PLAN_FOR_VIEW.key -> "true") { + sql("CREATE TEMPORARY VIEW v1 AS SELECT * FROM t") + Seq(4, 6, 5).toDF("c1").write.mode("overwrite").format("parquet").saveAsTable("t") + val e = intercept[SparkException] { + sql("SELECT * FROM v1").collect() + }.getMessage + assert(e.contains("does not exist")) + } + + withSQLConf(STORE_ANALYZED_PLAN_FOR_VIEW.key -> "false") { + // alter view from legacy to non-legacy config + sql("ALTER VIEW v1 AS SELECT * FROM t") + Seq(1, 3, 5).toDF("c1").write.mode("overwrite").format("parquet").saveAsTable("t") + checkAnswer(sql("SELECT * FROM v1"), Seq(Row(1), Row(3), Row(5))) + } + + withSQLConf(STORE_ANALYZED_PLAN_FOR_VIEW.key -> "true") { + // alter view from non-legacy to legacy config + sql("ALTER VIEW v1 AS SELECT * FROM t") + Seq(2, 4, 6).toDF("c1").write.mode("overwrite").format("parquet").saveAsTable("t") + val e = intercept[SparkException] { + sql("SELECT * FROM v1").collect() + }.getMessage + assert(e.contains("does not exist")) + } + } + } + } + + test("local temp view refers global temp view") { + withGlobalTempView("v1") { + withTempView("v2") { + val globalTempDB = spark.sharedState.globalTempViewManager.database + sql("CREATE GLOBAL TEMPORARY VIEW v1 AS SELECT 1") + sql(s"CREATE TEMPORARY VIEW v2 AS SELECT * FROM ${globalTempDB}.v1") + checkAnswer(sql("SELECT * FROM v2"), Seq(Row(1))) + } + } + } + + test("global temp view refers local temp view") { + withTempView("v1") { + withGlobalTempView("v2") { + val globalTempDB = spark.sharedState.globalTempViewManager.database + sql("CREATE TEMPORARY VIEW v1 AS SELECT 1") + sql(s"CREATE GLOBAL TEMPORARY VIEW v2 AS SELECT * FROM v1") + checkAnswer(sql(s"SELECT * FROM ${globalTempDB}.v2"), Seq(Row(1))) + } + } + } + + test("SPARK-33141: view should be parsed and analyzed with configs set when creating") { + withTable("t") { + withView("v1", "v2", "v3", "v4", "v5") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + sql("CREATE VIEW v1 (c1) AS SELECT C1 FROM t") + sql("CREATE VIEW v2 (c1) AS SELECT c1 FROM t ORDER BY 1 ASC, c1 DESC") + sql("CREATE VIEW v3 (c1, count) AS SELECT c1, count(c1) FROM t GROUP BY 1") + sql("CREATE VIEW v4 (a, count) AS SELECT c1 as a, count(c1) FROM t GROUP BY a") + sql("CREATE VIEW v5 (c1) AS SELECT 1/0") + + withSQLConf(CASE_SENSITIVE.key -> "true") { + checkAnswer(sql("SELECT * FROM v1"), Seq(Row(2), Row(3), Row(1))) + } + withSQLConf(ORDER_BY_ORDINAL.key -> "false") { + checkAnswer(sql("SELECT * FROM v2"), Seq(Row(1), Row(2), Row(3))) + } + withSQLConf(GROUP_BY_ORDINAL.key -> "false") { + checkAnswer(sql("SELECT * FROM v3"), + Seq(Row(1, 1), Row(2, 1), Row(3, 1))) + } + withSQLConf(GROUP_BY_ALIASES.key -> "false") { + checkAnswer(sql("SELECT * FROM v4"), + Seq(Row(1, 1), Row(2, 1), Row(3, 1))) + } + withSQLConf(ANSI_ENABLED.key -> "true") { + checkAnswer(sql("SELECT * FROM v5"), Seq(Row(null))) + } + + withSQLConf(USE_CURRENT_SQL_CONFIGS_FOR_VIEW.key -> "true") { + withSQLConf(CASE_SENSITIVE.key -> "true") { + val e = intercept[AnalysisException] { + sql("SELECT * FROM v1") + }.getMessage + assert(e.contains("cannot resolve 'C1' given input columns: " + + "[spark_catalog.default.t.c1]")) + } + withSQLConf(ORDER_BY_ORDINAL.key -> "false") { + checkAnswer(sql("SELECT * FROM v2"), Seq(Row(3), Row(2), Row(1))) + } + withSQLConf(GROUP_BY_ORDINAL.key -> "false") { + val e = intercept[AnalysisException] { + sql("SELECT * FROM v3") + }.getMessage + assert(e.contains( + "expression 'spark_catalog.default.t.c1' is neither present " + + "in the group by, nor is it an aggregate function. Add to group by or wrap in " + + "first() (or first_value) if you don't care which value you get.")) + } + withSQLConf(GROUP_BY_ALIASES.key -> "false") { + val e = intercept[AnalysisException] { + sql("SELECT * FROM v4") + }.getMessage + assert(e.contains("cannot resolve 'a' given input columns: " + + "[spark_catalog.default.t.c1]")) + } + withSQLConf(ANSI_ENABLED.key -> "true") { + val e = intercept[ArithmeticException] { + sql("SELECT * FROM v5").collect() + }.getMessage + assert(e.contains("divide by zero")) + } + } + + withSQLConf(ANSI_ENABLED.key -> "true") { + sql("ALTER VIEW v1 AS SELECT 1/0") + } + val e = intercept[ArithmeticException] { + sql("SELECT * FROM v1").collect() + }.getMessage + assert(e.contains("divide by zero")) + } + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewTestSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewTestSuite.scala new file mode 100644 index 0000000000000..5fb2e2cd3d433 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLViewTestSuite.scala @@ -0,0 +1,406 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution + +import org.apache.spark.sql.{AnalysisException, QueryTest, Row} +import org.apache.spark.sql.catalyst.TableIdentifier +import org.apache.spark.sql.catalyst.plans.logical.Repartition +import org.apache.spark.sql.internal.SQLConf._ +import org.apache.spark.sql.test.{SharedSparkSession, SQLTestUtils} + +/** + * A base suite contains a set of view related test cases for different kind of views + * Currently, the test cases in this suite should have same behavior across all kind of views + * TODO: Combine this with [[SQLViewSuite]] + */ +abstract class SQLViewTestSuite extends QueryTest with SQLTestUtils { + import testImplicits._ + + protected def viewTypeString: String + protected def formattedViewName(viewName: String): String + protected def tableIdentifier(viewName: String): TableIdentifier + + def createView( + viewName: String, + sqlText: String, + columnNames: Seq[String] = Seq.empty, + replace: Boolean = false): String = { + val replaceString = if (replace) "OR REPLACE" else "" + val columnString = if (columnNames.nonEmpty) columnNames.mkString("(", ",", ")") else "" + sql(s"CREATE $replaceString $viewTypeString $viewName $columnString AS $sqlText") + formattedViewName(viewName) + } + + def checkViewOutput(viewName: String, expectedAnswer: Seq[Row]): Unit = { + checkAnswer(sql(s"SELECT * FROM $viewName"), expectedAnswer) + } + + test("change SQLConf should not change view behavior - caseSensitiveAnalysis") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + val viewName = createView("v1", "SELECT c1 FROM t", Seq("C1")) + withView(viewName) { + Seq("true", "false").foreach { flag => + withSQLConf(CASE_SENSITIVE.key -> flag) { + checkViewOutput(viewName, Seq(Row(2), Row(3), Row(1))) + } + } + } + } + } + + test("change SQLConf should not change view behavior - orderByOrdinal") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + val viewName = createView("v1", "SELECT c1 FROM t ORDER BY 1 ASC, c1 DESC", Seq("c1")) + withView(viewName) { + Seq("true", "false").foreach { flag => + withSQLConf(ORDER_BY_ORDINAL.key -> flag) { + checkViewOutput(viewName, Seq(Row(1), Row(2), Row(3))) + } + } + } + } + } + + test("change SQLConf should not change view behavior - groupByOrdinal") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + val viewName = createView("v1", "SELECT c1, count(c1) FROM t GROUP BY 1", Seq("c1", "count")) + withView(viewName) { + Seq("true", "false").foreach { flag => + withSQLConf(GROUP_BY_ORDINAL.key -> flag) { + checkViewOutput(viewName, Seq(Row(1, 1), Row(2, 1), Row(3, 1))) + } + } + } + } + } + + test("change SQLConf should not change view behavior - groupByAliases") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + val viewName = createView( + "v1", "SELECT c1 as a, count(c1) FROM t GROUP BY a", Seq("a", "count")) + withView(viewName) { + Seq("true", "false").foreach { flag => + withSQLConf(GROUP_BY_ALIASES.key -> flag) { + checkViewOutput(viewName, Seq(Row(1, 1), Row(2, 1), Row(3, 1))) + } + } + } + } + } + + test("change SQLConf should not change view behavior - ansiEnabled") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + val viewName = createView("v1", "SELECT 1/0", Seq("c1")) + withView(viewName) { + Seq("true", "false").foreach { flag => + withSQLConf(ANSI_ENABLED.key -> flag) { + checkViewOutput(viewName, Seq(Row(null))) + } + } + } + } + } + + test("change current database should not change view behavior") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + val viewName = createView("v1", "SELECT * FROM t") + withView(viewName) { + withTempDatabase { db => + sql(s"USE $db") + Seq(4, 5, 6).toDF("c1").write.format("parquet").saveAsTable("t") + checkViewOutput(viewName, Seq(Row(2), Row(3), Row(1))) + } + } + } + } + + test("view should read the new data if table is updated") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + val viewName = createView("v1", "SELECT c1 FROM t", Seq("c1")) + withView(viewName) { + Seq(9, 7, 8).toDF("c1").write.mode("overwrite").format("parquet").saveAsTable("t") + checkViewOutput(viewName, Seq(Row(9), Row(7), Row(8))) + } + } + } + + test("add column for table should not affect view output") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + val viewName = createView("v1", "SELECT * FROM t") + withView(viewName) { + sql("ALTER TABLE t ADD COLUMN (c2 INT)") + checkViewOutput(viewName, Seq(Row(2), Row(3), Row(1))) + } + } + } + + test("check cyclic view reference on CREATE OR REPLACE VIEW") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + val viewName1 = createView("v1", "SELECT * FROM t") + val viewName2 = createView("v2", s"SELECT * FROM $viewName1") + withView(viewName2, viewName1) { + val e = intercept[AnalysisException] { + createView("v1", s"SELECT * FROM $viewName2", replace = true) + }.getMessage + assert(e.contains("Recursive view")) + } + } + } + + test("check cyclic view reference on ALTER VIEW") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + val viewName1 = createView("v1", "SELECT * FROM t") + val viewName2 = createView("v2", s"SELECT * FROM $viewName1") + withView(viewName2, viewName1) { + val e = intercept[AnalysisException] { + sql(s"ALTER VIEW $viewName1 AS SELECT * FROM $viewName2") + }.getMessage + assert(e.contains("Recursive view")) + } + } + } + + test("restrict the nested level of a view") { + val viewNames = scala.collection.mutable.ArrayBuffer.empty[String] + val view0 = createView("view0", "SELECT 1") + viewNames += view0 + for (i <- 1 to 10) { + viewNames += createView(s"view$i", s"SELECT * FROM ${viewNames.last}") + } + withView(viewNames.reverse.toSeq: _*) { + withSQLConf(MAX_NESTED_VIEW_DEPTH.key -> "10") { + val e = intercept[AnalysisException] { + sql(s"SELECT * FROM ${viewNames.last}") + }.getMessage + assert(e.contains("exceeds the maximum view resolution depth (10)")) + assert(e.contains(s"Increase the value of ${MAX_NESTED_VIEW_DEPTH.key}")) + } + } + } + + test("view should use captured catalog and namespace to resolve relation") { + withTempDatabase { dbName => + withTable("default.t", s"$dbName.t") { + withTempView("t") { + // create a table in default database + sql("USE DEFAULT") + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + // create a view refer the created table in default database + val viewName = createView("v1", "SELECT * FROM t") + // using another database to create a table with same name + sql(s"USE $dbName") + Seq(4, 5, 6).toDF("c1").write.format("parquet").saveAsTable("t") + // create a temporary view with the same name + sql("CREATE TEMPORARY VIEW t AS SELECT 1") + withView(viewName) { + // view v1 should still refer the table defined in `default` database + checkViewOutput(viewName, Seq(Row(2), Row(3), Row(1))) + } + } + } + } + } + + test("SPARK-33692: view should use captured catalog and namespace to lookup function") { + val avgFuncClass = "test.org.apache.spark.sql.MyDoubleAvg" + val sumFuncClass = "test.org.apache.spark.sql.MyDoubleSum" + val functionName = "test_udf" + withTempDatabase { dbName => + withUserDefinedFunction( + s"default.$functionName" -> false, + s"$dbName.$functionName" -> false, + functionName -> true) { + // create a function in default database + sql("USE DEFAULT") + sql(s"CREATE FUNCTION $functionName AS '$avgFuncClass'") + // create a view using a function in 'default' database + val viewName = createView("v1", s"SELECT $functionName(col1) FROM VALUES (1), (2), (3)") + // create function in another database with the same function name + sql(s"USE $dbName") + sql(s"CREATE FUNCTION $functionName AS '$sumFuncClass'") + // create temporary function with the same function name + sql(s"CREATE TEMPORARY FUNCTION $functionName AS '$sumFuncClass'") + withView(viewName) { + // view v1 should still using function defined in `default` database + checkViewOutput(viewName, Seq(Row(102.0))) + } + } + } + } + + test("SPARK-34260: replace existing view using CREATE OR REPLACE") { + val viewName = createView("testView", "SELECT * FROM (SELECT 1)") + withView(viewName) { + checkViewOutput(viewName, Seq(Row(1))) + createView("testView", "SELECT * FROM (SELECT 2)", replace = true) + checkViewOutput(viewName, Seq(Row(2))) + } + } + + test("SPARK-34490 - query should fail if the view refers a dropped table") { + withTable("t") { + Seq(2, 3, 1).toDF("c1").write.format("parquet").saveAsTable("t") + val viewName = createView("testView", "SELECT * FROM t") + withView(viewName) { + // Always create a temp view in this case, not use `createView` on purpose + sql("CREATE TEMP VIEW t AS SELECT 1 AS c1") + withTempView("t") { + checkViewOutput(viewName, Seq(Row(2), Row(3), Row(1))) + // Manually drop table `t` to see if the query will fail + sql("DROP TABLE IF EXISTS default.t") + val e = intercept[AnalysisException] { + sql(s"SELECT * FROM $viewName").collect() + }.getMessage + assert(e.contains("Table or view not found: t")) + } + } + } + } + + test("SPARK-34613: Fix view does not capture disable hint config") { + withSQLConf(DISABLE_HINTS.key -> "true") { + val viewName = createView("v1", "SELECT /*+ repartition(1) */ 1") + withView(viewName) { + assert( + sql(s"SELECT * FROM $viewName").queryExecution.analyzed.collect { + case e: Repartition => e + }.isEmpty + ) + checkViewOutput(viewName, Seq(Row(1))) + } + } + } + + test("SPARK-34152: view's identifier should be correctly stored") { + Seq(true, false).foreach { storeAnalyzed => + withSQLConf(STORE_ANALYZED_PLAN_FOR_VIEW.key -> storeAnalyzed.toString) { + val viewName = createView("v", "SELECT 1") + withView(viewName) { + val tblIdent = tableIdentifier("v") + val metadata = spark.sessionState.catalog.getTempViewOrPermanentTableMetadata(tblIdent) + assert(metadata.identifier == tblIdent) + } + } + } + } + + test("SPARK-34504: drop an invalid view") { + withTable("t") { + sql("CREATE TABLE t(s STRUCT) USING json") + val viewName = createView("v", "SELECT s.i FROM t") + withView(viewName) { + assert(spark.table(viewName).collect().isEmpty) + + // re-create the table without nested field `i` which is referred by the view. + sql("DROP TABLE t") + sql("CREATE TABLE t(s STRUCT) USING json") + val e = intercept[AnalysisException](spark.table(viewName)) + assert(e.message.contains("No such struct field i in j")) + + // drop invalid view should be fine + sql(s"DROP VIEW $viewName") + } + } + } + + test("SPARK-34719: view query with duplicated output column names") { + Seq(true, false).foreach { caseSensitive => + withSQLConf(CASE_SENSITIVE.key -> caseSensitive.toString) { + withView("v1", "v2") { + sql("CREATE VIEW v1 AS SELECT 1 a, 2 b") + sql("CREATE VIEW v2 AS SELECT 1 col") + + val viewName = createView( + viewName = "testView", + sqlText = "SELECT *, 1 col, 2 col FROM v1", + columnNames = Seq("c1", "c2", "c3", "c4")) + withView(viewName) { + checkViewOutput(viewName, Seq(Row(1, 2, 1, 2))) + + // One more duplicated column `COL` if caseSensitive=false. + sql("CREATE OR REPLACE VIEW v1 AS SELECT 1 a, 2 b, 3 COL") + if (caseSensitive) { + checkViewOutput(viewName, Seq(Row(1, 2, 1, 2))) + } else { + val e = intercept[AnalysisException](spark.table(viewName).collect()) + assert(e.message.contains("incompatible schema change")) + } + } + + // v1 has 3 columns [a, b, COL], v2 has one column [col], so `testView2` has duplicated + // output column names if caseSensitive=false. + val viewName2 = createView( + viewName = "testView2", + sqlText = "SELECT * FROM v1, v2", + columnNames = Seq("c1", "c2", "c3", "c4")) + withView(viewName2) { + checkViewOutput(viewName2, Seq(Row(1, 2, 3, 1))) + + // One less duplicated column if caseSensitive=false. + sql("CREATE OR REPLACE VIEW v1 AS SELECT 1 a, 2 b") + if (caseSensitive) { + val e = intercept[AnalysisException](spark.table(viewName2).collect()) + assert(e.message.contains("cannot resolve 'COL'")) + } else { + val e = intercept[AnalysisException](spark.table(viewName2).collect()) + assert(e.message.contains("incompatible schema change")) + } + } + } + } + } + } +} + +class LocalTempViewTestSuite extends SQLViewTestSuite with SharedSparkSession { + override protected def viewTypeString: String = "TEMPORARY VIEW" + override protected def formattedViewName(viewName: String): String = viewName + override protected def tableIdentifier(viewName: String): TableIdentifier = { + TableIdentifier(viewName) + } +} + +class GlobalTempViewTestSuite extends SQLViewTestSuite with SharedSparkSession { + private def db: String = spark.sharedState.globalTempViewManager.database + override protected def viewTypeString: String = "GLOBAL TEMPORARY VIEW" + override protected def formattedViewName(viewName: String): String = { + s"$db.$viewName" + } + override protected def tableIdentifier(viewName: String): TableIdentifier = { + TableIdentifier(viewName, Some(db)) + } +} + +class PersistedViewTestSuite extends SQLViewTestSuite with SharedSparkSession { + private def db: String = "default" + override protected def viewTypeString: String = "VIEW" + override protected def formattedViewName(viewName: String): String = s"$db.$viewName" + override protected def tableIdentifier(viewName: String): TableIdentifier = { + TableIdentifier(viewName, Some(db)) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLWindowFunctionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLWindowFunctionSuite.scala index 67ec1028f1998..eec396b2e3998 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLWindowFunctionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SQLWindowFunctionSuite.scala @@ -372,7 +372,7 @@ class SQLWindowFunctionSuite extends QueryTest with SharedSparkSession { spark.catalog.dropTempView("nums") } - test("window function: mutiple window expressions specified by range in a single expression") { + test("window function: multiple window expressions specified by range in a single expression") { val nums = sparkContext.parallelize(1 to 10).map(x => (x, x % 2)).toDF("x", "y") nums.createOrReplaceTempView("nums") withTempView("nums") { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SameResultSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SameResultSuite.scala index ddaa2687eaf1a..d2406aa59e21e 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SameResultSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SameResultSuite.scala @@ -20,7 +20,7 @@ package org.apache.spark.sql.execution import org.apache.spark.sql.{DataFrame, QueryTest} import org.apache.spark.sql.catalyst.expressions.AttributeReference import org.apache.spark.sql.catalyst.plans.logical.{LocalRelation, Project} -import org.apache.spark.sql.execution.datasources.v2.{BatchScanExec, FileScan} +import org.apache.spark.sql.execution.datasources.v2.BatchScanExec import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession @@ -120,8 +120,8 @@ class SameResultSuite extends QueryTest with SharedSparkSession { val df2 = spark.range(10).agg(sum($"id")) assert(df1.queryExecution.executedPlan.sameResult(df2.queryExecution.executedPlan)) - val df3 = spark.range(10).agg(sumDistinct($"id")) - val df4 = spark.range(10).agg(sumDistinct($"id")) + val df3 = spark.range(10).agg(sum_distinct($"id")) + val df4 = spark.range(10).agg(sum_distinct($"id")) assert(df3.queryExecution.executedPlan.sameResult(df4.queryExecution.executedPlan)) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/ShufflePartitionsUtilSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/ShufflePartitionsUtilSuite.scala index f5c3b7816f5ea..94e22a414a628 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/ShufflePartitionsUtilSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/ShufflePartitionsUtilSuite.scala @@ -198,9 +198,11 @@ class ShufflePartitionsUtilSuite extends SparkFunSuite { // the size of data is 0. val bytesByPartitionId1 = Array[Long](0, 0, 0, 0, 0) val bytesByPartitionId2 = Array[Long](0, 0, 0, 0, 0) + // Create at least one partition spec + val expectedPartitionSpecs = Seq(CoalescedPartitionSpec(0, 5)) checkEstimation( Array(bytesByPartitionId1, bytesByPartitionId2), - Seq.empty, targetSize, minNumPartitions) + expectedPartitionSpecs, targetSize, minNumPartitions) } @@ -248,16 +250,19 @@ class ShufflePartitionsUtilSuite extends SparkFunSuite { val minNumPartitions = 2 { - // 1 shuffle: All bytes per partition are 0, no partition spec created. + // 1 shuffle: All bytes per partition are 0, 1 empty partition spec created. val bytesByPartitionId = Array[Long](0, 0, 0, 0, 0) - checkEstimation(Array(bytesByPartitionId), Seq.empty, targetSize) + val expectedPartitionSpecs = Seq(CoalescedPartitionSpec(0, 5)) + checkEstimation(Array(bytesByPartitionId), expectedPartitionSpecs, targetSize) } { - // 2 shuffles: All bytes per partition are 0, no partition spec created. + // 2 shuffles: All bytes per partition are 0, 1 empty partition spec created. val bytesByPartitionId1 = Array[Long](0, 0, 0, 0, 0) val bytesByPartitionId2 = Array[Long](0, 0, 0, 0, 0) - checkEstimation(Array(bytesByPartitionId1, bytesByPartitionId2), Seq.empty, targetSize) + val expectedPartitionSpecs = Seq(CoalescedPartitionSpec(0, 5)) + checkEstimation( + Array(bytesByPartitionId1, bytesByPartitionId2), expectedPartitionSpecs, targetSize) } { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SortSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SortSuite.scala index 7654a9d982059..6a4f3f62641f8 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SortSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SortSuite.scala @@ -97,6 +97,19 @@ class SortSuite extends SparkPlanTest with SharedSparkSession { } } + test("SPARK-33260: sort order is a Stream") { + val input = Seq( + ("Hello", 4, 2.0), + ("Hello", 1, 1.0), + ("World", 8, 3.0) + ) + checkAnswer( + input.toDF("a", "b", "c"), + (child: SparkPlan) => SortExec(Stream('a.asc, 'b.asc, 'c.asc), global = true, child = child), + input.sortBy(t => (t._1, t._2, t._3)).map(Row.fromTuple), + sortAnswers = false) + } + // Test sorting on different data types for ( dataType <- DataTypeTestUtils.atomicTypes ++ Set(NullType); diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala index 56fff1107ae39..7687bfdd14fdb 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanSuite.scala @@ -19,6 +19,7 @@ package org.apache.spark.sql.execution import org.apache.spark.SparkEnv import org.apache.spark.sql.QueryTest +import org.apache.spark.sql.catalyst.plans.logical.Deduplicate import org.apache.spark.sql.execution.datasources.v2.BatchScanExec import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession @@ -88,4 +89,24 @@ class SparkPlanSuite extends QueryTest with SharedSparkSession { test("SPARK-30780 empty LocalTableScan should use RDD without partitions") { assert(LocalTableScanExec(Nil, Nil).execute().getNumPartitions == 0) } + + test("SPARK-33617: change default parallelism of LocalTableScan") { + Seq(1, 4).foreach { minPartitionNum => + withSQLConf(SQLConf.LEAF_NODE_DEFAULT_PARALLELISM.key -> minPartitionNum.toString) { + val df = spark.sql("SELECT * FROM VALUES (1), (2), (3), (4), (5), (6), (7), (8)") + assert(df.rdd.partitions.length === minPartitionNum) + } + } + } + + test("SPARK-34420: Throw exception if non-streaming Deduplicate is not replaced by aggregate") { + val df = spark.range(10) + val planner = spark.sessionState.planner + val deduplicate = Deduplicate(df.queryExecution.analyzed.output, df.queryExecution.analyzed) + val err = intercept[IllegalStateException] { + planner.plan(deduplicate) + } + assert(err.getMessage.contains("Deduplicate operator for non streaming data source " + + "should have been replaced by aggregate in the optimizer")) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanTest.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanTest.scala index 7ddf9d87a6aca..f1fcf3bc5125e 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanTest.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlanTest.scala @@ -17,7 +17,6 @@ package org.apache.spark.sql.execution -import scala.language.implicitConversions import scala.util.control.NonFatal import org.apache.spark.SparkFunSuite diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala index 9107f8afa83d7..b4cb7e3fce3cf 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkPlannerSuite.scala @@ -37,9 +37,9 @@ class SparkPlannerSuite extends SharedSparkSession { case ReturnAnswer(child) => planned += 1 planLater(child) :: planLater(NeverPlanned) :: Nil - case Union(children) => + case u: Union => planned += 1 - UnionExec(children.map(planLater)) :: planLater(NeverPlanned) :: Nil + UnionExec(u.children.map(planLater)) :: planLater(NeverPlanned) :: Nil case LocalRelation(output, data, _) => planned += 1 LocalTableScanExec(output, data) :: planLater(NeverPlanned) :: Nil diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkScriptTransformationSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkScriptTransformationSuite.scala new file mode 100644 index 0000000000000..5638743b7633d --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkScriptTransformationSuite.scala @@ -0,0 +1,62 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution + +import org.apache.spark.TestUtils +import org.apache.spark.sql.catalyst.expressions.Attribute +import org.apache.spark.sql.catalyst.parser.ParseException +import org.apache.spark.sql.test.SharedSparkSession + +class SparkScriptTransformationSuite extends BaseScriptTransformationSuite with SharedSparkSession { + import testImplicits._ + + override protected def defaultSerDe(): String = "row-format-delimited" + + override def createScriptTransformationExec( + script: String, + output: Seq[Attribute], + child: SparkPlan, + ioschema: ScriptTransformationIOSchema): BaseScriptTransformationExec = { + SparkScriptTransformationExec( + script = script, + output = output, + child = child, + ioschema = ioschema + ) + } + + test("SPARK-32106: TRANSFORM with serde without hive should throw exception") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + withTempView("v") { + val df = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") + df.createTempView("v") + + val e = intercept[ParseException] { + sql( + """ + |SELECT TRANSFORM (a) + |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + |USING 'cat' AS (a) + |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + |FROM v + """.stripMargin) + }.getMessage + assert(e.contains("TRANSFORM with serde is only supported in hive mode")) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala index 06574a9f8fd2c..e7d630d1abfbd 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SparkSqlParserSuite.scala @@ -17,16 +17,18 @@ package org.apache.spark.sql.execution -import org.apache.spark.sql.SaveMode -import org.apache.spark.sql.catalyst.TableIdentifier -import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedAlias, UnresolvedAttribute, UnresolvedRelation, UnresolvedStar} -import org.apache.spark.sql.catalyst.catalog.{BucketSpec, CatalogStorageFormat, CatalogTable, CatalogTableType} -import org.apache.spark.sql.catalyst.expressions.{Ascending, Concat, SortOrder} -import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, Project, RepartitionByExpression, Sort} +import scala.collection.JavaConverters._ + +import org.apache.spark.internal.config.ConfigEntry +import org.apache.spark.sql.catalyst.{FunctionIdentifier, TableIdentifier} +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedAlias, UnresolvedAttribute, UnresolvedFunction, UnresolvedGenerator, UnresolvedHaving, UnresolvedRelation, UnresolvedStar} +import org.apache.spark.sql.catalyst.expressions.{Ascending, AttributeReference, Concat, GreaterThan, Literal, NullsFirst, SortOrder, UnresolvedWindowExpression, UnspecifiedFrame, WindowSpecDefinition, WindowSpecReference} +import org.apache.spark.sql.catalyst.plans.logical._ +import org.apache.spark.sql.connector.catalog.TableCatalog import org.apache.spark.sql.execution.command._ -import org.apache.spark.sql.execution.datasources.{CreateTable, RefreshResource} -import org.apache.spark.sql.internal.{HiveSerDe, SQLConf} -import org.apache.spark.sql.types.{IntegerType, LongType, StringType, StructType} +import org.apache.spark.sql.execution.datasources.{CreateTempViewUsing, RefreshResource} +import org.apache.spark.sql.internal.StaticSQLConf +import org.apache.spark.sql.types.StringType /** * Parser test cases for rules defined in [[SparkSqlParser]]. @@ -35,32 +37,135 @@ import org.apache.spark.sql.types.{IntegerType, LongType, StringType, StructType * defined in the Catalyst module. */ class SparkSqlParserSuite extends AnalysisTest { + import org.apache.spark.sql.catalyst.dsl.expressions._ - val newConf = new SQLConf - private lazy val parser = new SparkSqlParser(newConf) - - /** - * Normalizes plans: - * - CreateTable the createTime in tableDesc will replaced by -1L. - */ - override def normalizePlan(plan: LogicalPlan): LogicalPlan = { - plan match { - case CreateTable(tableDesc, mode, query) => - val newTableDesc = tableDesc.copy(createTime = -1L) - CreateTable(newTableDesc, mode, query) - case _ => plan // Don't transform - } - } + private lazy val parser = new SparkSqlParser() private def assertEqual(sqlCommand: String, plan: LogicalPlan): Unit = { - val normalized1 = normalizePlan(parser.parsePlan(sqlCommand)) - val normalized2 = normalizePlan(plan) - comparePlans(normalized1, normalized2) + comparePlans(parser.parsePlan(sqlCommand), plan) } private def intercept(sqlCommand: String, messages: String*): Unit = interceptParseException(parser.parsePlan)(sqlCommand, messages: _*) + test("Checks if SET/RESET can parse all the configurations") { + // Force to build static SQL configurations + StaticSQLConf + ConfigEntry.knownConfigs.values.asScala.foreach { config => + assertEqual(s"SET ${config.key}", SetCommand(Some(config.key -> None))) + assertEqual(s"SET `${config.key}`", SetCommand(Some(config.key -> None))) + + val defaultValueStr = config.defaultValueString + if (config.defaultValue.isDefined && defaultValueStr != null) { + assertEqual(s"SET ${config.key}=`$defaultValueStr`", + SetCommand(Some(config.key -> Some(defaultValueStr)))) + assertEqual(s"SET `${config.key}`=`$defaultValueStr`", + SetCommand(Some(config.key -> Some(defaultValueStr)))) + + if (!defaultValueStr.contains(";")) { + assertEqual(s"SET ${config.key}=$defaultValueStr", + SetCommand(Some(config.key -> Some(defaultValueStr)))) + assertEqual(s"SET `${config.key}`=$defaultValueStr", + SetCommand(Some(config.key -> Some(defaultValueStr)))) + } + } + assertEqual(s"RESET ${config.key}", ResetCommand(Some(config.key))) + } + } + + test("Report Error for invalid usage of SET command") { + assertEqual("SET", SetCommand(None)) + assertEqual("SET -v", SetCommand(Some("-v", None))) + assertEqual("SET spark.sql.key", SetCommand(Some("spark.sql.key" -> None))) + assertEqual("SET spark.sql.key ", SetCommand(Some("spark.sql.key" -> None))) + assertEqual("SET spark:sql:key=false", SetCommand(Some("spark:sql:key" -> Some("false")))) + assertEqual("SET spark:sql:key=", SetCommand(Some("spark:sql:key" -> Some("")))) + assertEqual("SET spark:sql:key= ", SetCommand(Some("spark:sql:key" -> Some("")))) + assertEqual("SET spark:sql:key=-1 ", SetCommand(Some("spark:sql:key" -> Some("-1")))) + assertEqual("SET spark:sql:key = -1", SetCommand(Some("spark:sql:key" -> Some("-1")))) + assertEqual("SET 1.2.key=value", SetCommand(Some("1.2.key" -> Some("value")))) + assertEqual("SET spark.sql.3=4", SetCommand(Some("spark.sql.3" -> Some("4")))) + assertEqual("SET 1:2:key=value", SetCommand(Some("1:2:key" -> Some("value")))) + assertEqual("SET spark:sql:3=4", SetCommand(Some("spark:sql:3" -> Some("4")))) + assertEqual("SET 5=6", SetCommand(Some("5" -> Some("6")))) + assertEqual("SET spark:sql:key = va l u e ", + SetCommand(Some("spark:sql:key" -> Some("va l u e")))) + assertEqual("SET `spark.sql. key`=value", + SetCommand(Some("spark.sql. key" -> Some("value")))) + assertEqual("SET `spark.sql. key`= v a lu e ", + SetCommand(Some("spark.sql. key" -> Some("v a lu e")))) + assertEqual("SET `spark.sql. key`= -1", + SetCommand(Some("spark.sql. key" -> Some("-1")))) + assertEqual("SET key=", SetCommand(Some("key" -> Some("")))) + + val expectedErrMsg = "Expected format is 'SET', 'SET key', or " + + "'SET key=value'. If you want to include special characters in key, or include semicolon " + + "in value, please use quotes, e.g., SET `ke y`=`v;alue`." + intercept("SET spark.sql.key value", expectedErrMsg) + intercept("SET spark.sql.key 'value'", expectedErrMsg) + intercept("SET spark.sql.key \"value\" ", expectedErrMsg) + intercept("SET spark.sql.key value1 value2", expectedErrMsg) + intercept("SET spark. sql.key=value", expectedErrMsg) + intercept("SET spark :sql:key=value", expectedErrMsg) + intercept("SET spark . sql.key=value", expectedErrMsg) + intercept("SET spark.sql. key=value", expectedErrMsg) + intercept("SET spark.sql :key=value", expectedErrMsg) + intercept("SET spark.sql . key=value", expectedErrMsg) + intercept("SET =", expectedErrMsg) + intercept("SET =value", expectedErrMsg) + } + + test("Report Error for invalid usage of RESET command") { + assertEqual("RESET", ResetCommand(None)) + assertEqual("RESET spark.sql.key", ResetCommand(Some("spark.sql.key"))) + assertEqual("RESET spark.sql.key ", ResetCommand(Some("spark.sql.key"))) + assertEqual("RESET 1.2.key ", ResetCommand(Some("1.2.key"))) + assertEqual("RESET spark.sql.3", ResetCommand(Some("spark.sql.3"))) + assertEqual("RESET 1:2:key ", ResetCommand(Some("1:2:key"))) + assertEqual("RESET spark:sql:3", ResetCommand(Some("spark:sql:3"))) + assertEqual("RESET `spark.sql. key`", ResetCommand(Some("spark.sql. key"))) + + val expectedErrMsg = "Expected format is 'RESET' or 'RESET key'. " + + "If you want to include special characters in key, " + + "please use quotes, e.g., RESET `ke y`." + intercept("RESET spark.sql.key1 key2", expectedErrMsg) + intercept("RESET spark. sql.key1 key2", expectedErrMsg) + intercept("RESET spark.sql.key1 key2 key3", expectedErrMsg) + intercept("RESET spark: sql:key", expectedErrMsg) + intercept("RESET spark .sql.key", expectedErrMsg) + intercept("RESET spark : sql:key", expectedErrMsg) + intercept("RESET spark.sql: key", expectedErrMsg) + intercept("RESET spark.sql .key", expectedErrMsg) + intercept("RESET spark.sql : key", expectedErrMsg) + } + + test("SPARK-33419: Semicolon handling in SET command") { + assertEqual("SET a=1;", SetCommand(Some("a" -> Some("1")))) + assertEqual("SET a=1;;", SetCommand(Some("a" -> Some("1")))) + + assertEqual("SET a=`1`;", SetCommand(Some("a" -> Some("1")))) + assertEqual("SET a=`1;`", SetCommand(Some("a" -> Some("1;")))) + assertEqual("SET a=`1;`;", SetCommand(Some("a" -> Some("1;")))) + + assertEqual("SET `a`=1;;", SetCommand(Some("a" -> Some("1")))) + assertEqual("SET `a`=`1;`", SetCommand(Some("a" -> Some("1;")))) + assertEqual("SET `a`=`1;`;", SetCommand(Some("a" -> Some("1;")))) + + val expectedErrMsg = "Expected format is 'SET', 'SET key', or " + + "'SET key=value'. If you want to include special characters in key, or include semicolon " + + "in value, please use quotes, e.g., SET `ke y`=`v;alue`." + + intercept("SET a=1; SELECT 1", expectedErrMsg) + intercept("SET a=1;2;;", expectedErrMsg) + + intercept("SET a b=`1;;`", + "'a b' is an invalid property key, please use quotes, e.g. SET `a b`=`1;;`") + + intercept("SET `a`=1;2;;", + "'1;2;;' is an invalid property value, please use quotes, e.g." + + " SET `a`=`1;2;;`") + } + test("refresh resource") { assertEqual("REFRESH prefix_path", RefreshResource("prefix_path")) assertEqual("REFRESH /", RefreshResource("/")) @@ -80,108 +185,13 @@ class SparkSqlParserSuite extends AnalysisTest { intercept("REFRESH", "Resource paths cannot be empty in REFRESH statements") } - private def createTableUsing( - table: String, - database: Option[String] = None, - tableType: CatalogTableType = CatalogTableType.MANAGED, - storage: CatalogStorageFormat = CatalogStorageFormat.empty, - schema: StructType = new StructType, - provider: Option[String] = Some("parquet"), - partitionColumnNames: Seq[String] = Seq.empty, - bucketSpec: Option[BucketSpec] = None, - mode: SaveMode = SaveMode.ErrorIfExists, - query: Option[LogicalPlan] = None): CreateTable = { - CreateTable( - CatalogTable( - identifier = TableIdentifier(table, database), - tableType = tableType, - storage = storage, - schema = schema, - provider = provider, - partitionColumnNames = partitionColumnNames, - bucketSpec = bucketSpec - ), mode, query - ) - } - - private def createTable( - table: String, - database: Option[String] = None, - tableType: CatalogTableType = CatalogTableType.MANAGED, - storage: CatalogStorageFormat = CatalogStorageFormat.empty.copy( - inputFormat = HiveSerDe.sourceToSerDe("textfile").get.inputFormat, - outputFormat = HiveSerDe.sourceToSerDe("textfile").get.outputFormat, - serde = Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")), - schema: StructType = new StructType, - provider: Option[String] = Some("hive"), - partitionColumnNames: Seq[String] = Seq.empty, - comment: Option[String] = None, - mode: SaveMode = SaveMode.ErrorIfExists, - query: Option[LogicalPlan] = None): CreateTable = { - CreateTable( - CatalogTable( - identifier = TableIdentifier(table, database), - tableType = tableType, - storage = storage, - schema = schema, - provider = provider, - partitionColumnNames = partitionColumnNames, - comment = comment - ), mode, query - ) - } - - test("create table - schema") { - assertEqual("CREATE TABLE my_tab(a INT COMMENT 'test', b STRING) STORED AS textfile", - createTable( - table = "my_tab", - schema = (new StructType) - .add("a", IntegerType, nullable = true, "test") - .add("b", StringType) - ) - ) - assertEqual("CREATE TABLE my_tab(a INT COMMENT 'test', b STRING) " + - "PARTITIONED BY (c INT, d STRING COMMENT 'test2')", - createTable( - table = "my_tab", - schema = (new StructType) - .add("a", IntegerType, nullable = true, "test") - .add("b", StringType) - .add("c", IntegerType) - .add("d", StringType, nullable = true, "test2"), - partitionColumnNames = Seq("c", "d") - ) - ) - assertEqual("CREATE TABLE my_tab(id BIGINT, nested STRUCT) " + - "STORED AS textfile", - createTable( - table = "my_tab", - schema = (new StructType) - .add("id", LongType) - .add("nested", (new StructType) - .add("col1", StringType) - .add("col2", IntegerType) - ) - ) - ) - // Partitioned by a StructType should be accepted by `SparkSqlParser` but will fail an analyze - // rule in `AnalyzeCreateTable`. - assertEqual("CREATE TABLE my_tab(a INT COMMENT 'test', b STRING) " + - "PARTITIONED BY (nested STRUCT)", - createTable( - table = "my_tab", - schema = (new StructType) - .add("a", IntegerType, nullable = true, "test") - .add("b", StringType) - .add("nested", (new StructType) - .add("col1", StringType) - .add("col2", IntegerType) - ), - partitionColumnNames = Seq("nested") - ) - ) - intercept("CREATE TABLE my_tab(a: INT COMMENT 'test', b: STRING)", - "no viable alternative at input") + test("SPARK-33118 CREATE TEMPORARY TABLE with LOCATION") { + assertEqual("CREATE TEMPORARY TABLE t USING parquet OPTIONS (path '/data/tmp/testspark1')", + CreateTempViewUsing(TableIdentifier("t", None), None, false, false, "parquet", + Map("path" -> "/data/tmp/testspark1"))) + assertEqual("CREATE TEMPORARY TABLE t USING parquet LOCATION '/data/tmp/testspark1'", + CreateTempViewUsing(TableIdentifier("t", None), None, false, false, "parquet", + Map("path" -> "/data/tmp/testspark1"))) } test("describe query") { @@ -199,20 +209,20 @@ class SparkSqlParserSuite extends AnalysisTest { assertEqual(s"$baseSql distribute by a, b", RepartitionByExpression(UnresolvedAttribute("a") :: UnresolvedAttribute("b") :: Nil, basePlan, - numPartitions = newConf.numShufflePartitions)) + None)) assertEqual(s"$baseSql distribute by a sort by b", Sort(SortOrder(UnresolvedAttribute("b"), Ascending) :: Nil, global = false, RepartitionByExpression(UnresolvedAttribute("a") :: Nil, basePlan, - numPartitions = newConf.numShufflePartitions))) + None))) assertEqual(s"$baseSql cluster by a, b", Sort(SortOrder(UnresolvedAttribute("a"), Ascending) :: SortOrder(UnresolvedAttribute("b"), Ascending) :: Nil, global = false, RepartitionByExpression(UnresolvedAttribute("a") :: UnresolvedAttribute("b") :: Nil, basePlan, - numPartitions = newConf.numShufflePartitions))) + None))) } test("pipeline concatenation") { @@ -235,20 +245,226 @@ class SparkSqlParserSuite extends AnalysisTest { } test("manage resources") { - assertEqual("ADD FILE abc.txt", AddFileCommand("abc.txt")) - assertEqual("ADD FILE 'abc.txt'", AddFileCommand("abc.txt")) - assertEqual("ADD FILE \"/path/to/abc.txt\"", AddFileCommand("/path/to/abc.txt")) + assertEqual("ADD FILE abc.txt", AddFilesCommand(Seq("abc.txt"))) + assertEqual("ADD FILE 'abc.txt'", AddFilesCommand(Seq("abc.txt"))) + assertEqual("ADD FILE \"/path/to/abc.txt\"", AddFilesCommand("/path/to/abc.txt"::Nil)) assertEqual("LIST FILE abc.txt", ListFilesCommand(Array("abc.txt"))) assertEqual("LIST FILE '/path//abc.txt'", ListFilesCommand(Array("/path//abc.txt"))) assertEqual("LIST FILE \"/path2/abc.txt\"", ListFilesCommand(Array("/path2/abc.txt"))) - assertEqual("ADD JAR /path2/_2/abc.jar", AddJarCommand("/path2/_2/abc.jar")) - assertEqual("ADD JAR '/test/path_2/jar/abc.jar'", AddJarCommand("/test/path_2/jar/abc.jar")) - assertEqual("ADD JAR \"abc.jar\"", AddJarCommand("abc.jar")) + assertEqual("ADD JAR /path2/_2/abc.jar", AddJarsCommand(Seq("/path2/_2/abc.jar"))) + assertEqual("ADD JAR '/test/path_2/jar/abc.jar'", + AddJarsCommand(Seq("/test/path_2/jar/abc.jar"))) + assertEqual("ADD JAR \"abc.jar\"", AddJarsCommand(Seq("abc.jar"))) assertEqual("LIST JAR /path-with-dash/abc.jar", ListJarsCommand(Array("/path-with-dash/abc.jar"))) assertEqual("LIST JAR 'abc.jar'", ListJarsCommand(Array("abc.jar"))) assertEqual("LIST JAR \"abc.jar\"", ListJarsCommand(Array("abc.jar"))) - assertEqual("ADD FILE /path with space/abc.txt", AddFileCommand("/path with space/abc.txt")) - assertEqual("ADD JAR /path with space/abc.jar", AddJarCommand("/path with space/abc.jar")) + assertEqual("ADD FILE '/path with space/abc.txt'", + AddFilesCommand(Seq("/path with space/abc.txt"))) + assertEqual("ADD JAR '/path with space/abc.jar'", + AddJarsCommand(Seq("/path with space/abc.jar"))) + } + + test("SPARK-32608: script transform with row format delimit") { + val rowFormat = + """ + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY ',' + | COLLECTION ITEMS TERMINATED BY '#' + | MAP KEYS TERMINATED BY '@' + | LINES TERMINATED BY '\n' + | NULL DEFINED AS 'null' + """.stripMargin + + val ioSchema = + ScriptInputOutputSchema( + Seq(("TOK_TABLEROWFORMATFIELD", ","), + ("TOK_TABLEROWFORMATCOLLITEMS", "#"), + ("TOK_TABLEROWFORMATMAPKEYS", "@"), + ("TOK_TABLEROWFORMATNULL", "null"), + ("TOK_TABLEROWFORMATLINES", "\n")), + Seq(("TOK_TABLEROWFORMATFIELD", ","), + ("TOK_TABLEROWFORMATCOLLITEMS", "#"), + ("TOK_TABLEROWFORMATMAPKEYS", "@"), + ("TOK_TABLEROWFORMATNULL", "null"), + ("TOK_TABLEROWFORMATLINES", "\n")), None, None, + List.empty, List.empty, None, None, false) + + assertEqual( + s""" + |SELECT TRANSFORM(a, b, c) + | $rowFormat + | USING 'cat' AS (a, b, c) + | $rowFormat + |FROM testData + """.stripMargin, + ScriptTransformation( + "cat", + Seq(AttributeReference("a", StringType)(), + AttributeReference("b", StringType)(), + AttributeReference("c", StringType)()), + Project(Seq('a, 'b, 'c), + UnresolvedRelation(TableIdentifier("testData"))), + ioSchema)) + + assertEqual( + s""" + |SELECT TRANSFORM(a, sum(b), max(c)) + | $rowFormat + | USING 'cat' AS (a, b, c) + | $rowFormat + |FROM testData + |GROUP BY a + |HAVING sum(b) > 10 + """.stripMargin, + ScriptTransformation( + "cat", + Seq(AttributeReference("a", StringType)(), + AttributeReference("b", StringType)(), + AttributeReference("c", StringType)()), + UnresolvedHaving( + GreaterThan( + UnresolvedFunction("sum", Seq(UnresolvedAttribute("b")), isDistinct = false), + Literal(10)), + Aggregate( + Seq('a), + Seq( + 'a, + UnresolvedAlias( + UnresolvedFunction("sum", Seq(UnresolvedAttribute("b")), isDistinct = false), None), + UnresolvedAlias( + UnresolvedFunction("max", Seq(UnresolvedAttribute("c")), isDistinct = false), None) + ), + UnresolvedRelation(TableIdentifier("testData")))), + ioSchema)) + + assertEqual( + s""" + |SELECT TRANSFORM(a, sum(b) OVER w, max(c) OVER w) + | $rowFormat + | USING 'cat' AS (a, b, c) + | $rowFormat + |FROM testData + |WINDOW w AS (PARTITION BY a ORDER BY b) + """.stripMargin, + ScriptTransformation( + "cat", + Seq(AttributeReference("a", StringType)(), + AttributeReference("b", StringType)(), + AttributeReference("c", StringType)()), + WithWindowDefinition( + Map("w" -> WindowSpecDefinition( + Seq('a), + Seq(SortOrder('b, Ascending, NullsFirst, Seq.empty)), + UnspecifiedFrame)), + Project( + Seq( + 'a, + UnresolvedAlias( + UnresolvedWindowExpression( + UnresolvedFunction("sum", Seq(UnresolvedAttribute("b")), isDistinct = false), + WindowSpecReference("w")), None), + UnresolvedAlias( + UnresolvedWindowExpression( + UnresolvedFunction("max", Seq(UnresolvedAttribute("c")), isDistinct = false), + WindowSpecReference("w")), None) + ), + UnresolvedRelation(TableIdentifier("testData")))), + ioSchema)) + + assertEqual( + s""" + |SELECT TRANSFORM(a, sum(b), max(c)) + | $rowFormat + | USING 'cat' AS (a, b, c) + | $rowFormat + |FROM testData + |LATERAL VIEW explode(array(array(1,2,3))) myTable AS myCol + |LATERAL VIEW explode(myTable.myCol) myTable2 AS myCol2 + |GROUP BY a, myCol, myCol2 + |HAVING sum(b) > 10 + """.stripMargin, + ScriptTransformation( + "cat", + Seq(AttributeReference("a", StringType)(), + AttributeReference("b", StringType)(), + AttributeReference("c", StringType)()), + UnresolvedHaving( + GreaterThan( + UnresolvedFunction("sum", Seq(UnresolvedAttribute("b")), isDistinct = false), + Literal(10)), + Aggregate( + Seq('a, 'myCol, 'myCol2), + Seq( + 'a, + UnresolvedAlias( + UnresolvedFunction("sum", Seq(UnresolvedAttribute("b")), isDistinct = false), None), + UnresolvedAlias( + UnresolvedFunction("max", Seq(UnresolvedAttribute("c")), isDistinct = false), None) + ), + Generate( + UnresolvedGenerator( + FunctionIdentifier("explode"), + Seq(UnresolvedAttribute("myTable.myCol"))), + Nil, false, Option("mytable2"), Seq('myCol2), + Generate( + UnresolvedGenerator( + FunctionIdentifier("explode"), + Seq(UnresolvedFunction("array", + Seq( + UnresolvedFunction("array", Seq(Literal(1), Literal(2), Literal(3)), false)), + false))), + Nil, false, Option("mytable"), Seq('myCol), + UnresolvedRelation(TableIdentifier("testData")))))), + ioSchema)) + } + + test("SPARK-32607: Script Transformation ROW FORMAT DELIMITED" + + " `TOK_TABLEROWFORMATLINES` only support '\\n'") { + + // test input format TOK_TABLEROWFORMATLINES + intercept( + s""" + |SELECT TRANSFORM(a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY ',' + | LINES TERMINATED BY '@' + | NULL DEFINED AS 'null' + | USING 'cat' AS (value) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '&' + | LINES TERMINATED BY '\n' + | NULL DEFINED AS 'NULL' + |FROM v + """.stripMargin, + "LINES TERMINATED BY only supports newline '\\n' right now") + + // test output format TOK_TABLEROWFORMATLINES + intercept( + s""" + |SELECT TRANSFORM(a, b, c, d, e) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY ',' + | LINES TERMINATED BY '\n' + | NULL DEFINED AS 'null' + | USING 'cat' AS (value) + | ROW FORMAT DELIMITED + | FIELDS TERMINATED BY '&' + | LINES TERMINATED BY '@' + | NULL DEFINED AS 'NULL' + |FROM v + """.stripMargin, + "LINES TERMINATED BY only supports newline '\\n' right now") + } + + test("CLEAR CACHE") { + assertEqual("CLEAR CACHE", ClearCacheCommand) + } + + test("CREATE TABLE LIKE COMMAND should reject reserved properties") { + Seq(TableCatalog.PROP_OWNER, TableCatalog.PROP_PROVIDER).foreach { reserved => + intercept(s"CREATE TABLE target LIKE source TBLPROPERTIES ($reserved='howdy')", + "reserved") + } } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/SubExprEliminationBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/SubExprEliminationBenchmark.scala new file mode 100644 index 0000000000000..c025670fb895e --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/SubExprEliminationBenchmark.scala @@ -0,0 +1,128 @@ +/* + * 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. + */ +package org.apache.spark.sql.execution + +import org.apache.spark.benchmark.Benchmark +import org.apache.spark.sql.Column +import org.apache.spark.sql.catalyst.expressions.{Expression, Literal, Or} +import org.apache.spark.sql.execution.benchmark.SqlBasedBenchmark +import org.apache.spark.sql.functions._ +import org.apache.spark.sql.internal.SQLConf + +/** + * The benchmarks aims to measure performance of the queries where there are subexpression + * elimination or not. + * To run this benchmark: + * {{{ + * 1. without sbt: + * bin/spark-submit --class --jars , + * + * 2. build/sbt "sql/test:runMain " + * 3. generate result: + * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " + * Results will be written to "benchmarks/SubExprEliminationBenchmark-results.txt". + * }}} + */ +object SubExprEliminationBenchmark extends SqlBasedBenchmark { + import spark.implicits._ + + def withFromJson(rowsNum: Int, numIters: Int): Unit = { + val benchmark = new Benchmark("from_json as subExpr in Project", rowsNum, output = output) + + withTempPath { path => + prepareDataInfo(benchmark) + val numCols = 500 + val schema = writeWideRow(path.getAbsolutePath, rowsNum, numCols) + + val cols = (0 until numCols).map { idx => + from_json('value, schema).getField(s"col$idx") + } + + Seq( + ("false", "true", "CODEGEN_ONLY"), + ("false", "false", "NO_CODEGEN"), + ("true", "true", "CODEGEN_ONLY"), + ("true", "false", "NO_CODEGEN") + ).foreach { case (subExprEliminationEnabled, codegenEnabled, codegenFactory) => + // We only benchmark subexpression performance under codegen/non-codegen, so disabling + // json optimization. + val caseName = s"subExprElimination $subExprEliminationEnabled, codegen: $codegenEnabled" + benchmark.addCase(caseName, numIters) { _ => + withSQLConf( + SQLConf.SUBEXPRESSION_ELIMINATION_ENABLED.key -> subExprEliminationEnabled, + SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> codegenEnabled, + SQLConf.CODEGEN_FACTORY_MODE.key -> codegenFactory, + SQLConf.JSON_EXPRESSION_OPTIMIZATION.key -> "false") { + val df = spark.read + .text(path.getAbsolutePath) + .select(cols: _*) + df.write.mode("overwrite").format("noop").save() + } + } + } + + benchmark.run() + } + } + + def withFilter(rowsNum: Int, numIters: Int): Unit = { + val benchmark = new Benchmark("from_json as subExpr in Filter", rowsNum, output = output) + + withTempPath { path => + prepareDataInfo(benchmark) + val numCols = 500 + val schema = writeWideRow(path.getAbsolutePath, rowsNum, numCols) + + val predicate = (0 until numCols).map { idx => + (from_json('value, schema).getField(s"col$idx") >= Literal(100000)).expr + }.asInstanceOf[Seq[Expression]].reduce(Or) + + Seq( + ("false", "true", "CODEGEN_ONLY"), + ("false", "false", "NO_CODEGEN"), + ("true", "true", "CODEGEN_ONLY"), + ("true", "false", "NO_CODEGEN") + ).foreach { case (subExprEliminationEnabled, codegenEnabled, codegenFactory) => + // We only benchmark subexpression performance under codegen/non-codegen, so disabling + // json optimization. + val caseName = s"subExprElimination $subExprEliminationEnabled, codegen: $codegenEnabled" + benchmark.addCase(caseName, numIters) { _ => + withSQLConf( + SQLConf.SUBEXPRESSION_ELIMINATION_ENABLED.key -> subExprEliminationEnabled, + SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> codegenEnabled, + SQLConf.CODEGEN_FACTORY_MODE.key -> codegenFactory, + SQLConf.JSON_EXPRESSION_OPTIMIZATION.key -> "false") { + val df = spark.read + .text(path.getAbsolutePath) + .where(Column(predicate)) + df.write.mode("overwrite").format("noop").save() + } + } + } + + benchmark.run() + } + } + + override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { + val numIters = 3 + runBenchmark("Benchmark for performance of subexpression elimination") { + withFromJson(100, numIters) + withFilter(100, numIters) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/TakeOrderedAndProjectSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/TakeOrderedAndProjectSuite.scala index 376d330ebeb70..6ec5c6287eed1 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/TakeOrderedAndProjectSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/TakeOrderedAndProjectSuite.scala @@ -37,12 +37,18 @@ class TakeOrderedAndProjectSuite extends SparkPlanTest with SharedSparkSession { rand = new Random(seed) } - private def generateRandomInputData(): DataFrame = { + private def generateRandomInputData(numRows: Int, numParts: Int): DataFrame = { val schema = new StructType() .add("a", IntegerType, nullable = false) .add("b", IntegerType, nullable = false) - val inputData = Seq.fill(10000)(Row(rand.nextInt(), rand.nextInt())) - spark.createDataFrame(sparkContext.parallelize(Random.shuffle(inputData), 10), schema) + val rdd = if (numParts > 0) { + val inputData = Seq.fill(numRows)(Row(rand.nextInt(), rand.nextInt())) + sparkContext.parallelize(Random.shuffle(inputData), numParts) + } else { + sparkContext.emptyRDD[Row] + } + assert(rdd.getNumPartitions == numParts) + spark.createDataFrame(rdd, schema) } /** @@ -56,31 +62,35 @@ class TakeOrderedAndProjectSuite extends SparkPlanTest with SharedSparkSession { test("TakeOrderedAndProject.doExecute without project") { withClue(s"seed = $seed") { - checkThatPlansAgree( - generateRandomInputData(), - input => - noOpFilter(TakeOrderedAndProjectExec(limit, sortOrder, input.output, input)), - input => - GlobalLimitExec(limit, - LocalLimitExec(limit, - SortExec(sortOrder, true, input))), - sortAnswers = false) + Seq((0, 0), (10000, 1), (10000, 10)).foreach { case (n, m) => + checkThatPlansAgree( + generateRandomInputData(n, m), + input => + noOpFilter(TakeOrderedAndProjectExec(limit, sortOrder, input.output, input)), + input => + GlobalLimitExec(limit, + LocalLimitExec(limit, + SortExec(sortOrder, true, input))), + sortAnswers = false) + } } } test("TakeOrderedAndProject.doExecute with project") { withClue(s"seed = $seed") { - checkThatPlansAgree( - generateRandomInputData(), - input => - noOpFilter( - TakeOrderedAndProjectExec(limit, sortOrder, Seq(input.output.last), input)), - input => - GlobalLimitExec(limit, - LocalLimitExec(limit, - ProjectExec(Seq(input.output.last), - SortExec(sortOrder, true, input)))), - sortAnswers = false) + Seq((0, 0), (10000, 1), (10000, 10)).foreach { case (n, m) => + checkThatPlansAgree( + generateRandomInputData(n, m), + input => + noOpFilter( + TakeOrderedAndProjectExec(limit, sortOrder, Seq(input.output.last), input)), + input => + GlobalLimitExec(limit, + LocalLimitExec(limit, + ProjectExec(Seq(input.output.last), + SortExec(sortOrder, true, input)))), + sortAnswers = false) + } } } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/TestUncaughtExceptionHandler.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/TestUncaughtExceptionHandler.scala similarity index 96% rename from sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/TestUncaughtExceptionHandler.scala rename to sql/core/src/test/scala/org/apache/spark/sql/execution/TestUncaughtExceptionHandler.scala index 681eb4e255dbc..360f4658345e9 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/TestUncaughtExceptionHandler.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/TestUncaughtExceptionHandler.scala @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.spark.sql.hive.execution +package org.apache.spark.sql.execution class TestUncaughtExceptionHandler extends Thread.UncaughtExceptionHandler { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeFixedWidthAggregationMapSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeFixedWidthAggregationMapSuite.scala index ef81f1b788496..97e5c1148c244 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeFixedWidthAggregationMapSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeFixedWidthAggregationMapSuite.scala @@ -24,7 +24,8 @@ import scala.util.{Random, Try} import scala.util.control.NonFatal import org.mockito.Mockito._ -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.{SparkConf, SparkFunSuite, TaskContext, TaskContextImpl} import org.apache.spark.internal.config.MEMORY_OFFHEAP_ENABLED diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeKVExternalSorterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeKVExternalSorterSuite.scala index 8aa003a3dfeb0..f630cd8322c61 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeKVExternalSorterSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/UnsafeKVExternalSorterSuite.scala @@ -210,23 +210,8 @@ class UnsafeKVExternalSorterSuite extends SparkFunSuite with SharedSparkSession test("SPARK-23376: Create UnsafeKVExternalSorter with BytesToByteMap having duplicated keys") { val memoryManager = new TestMemoryManager(new SparkConf()) val taskMemoryManager = new TaskMemoryManager(memoryManager, 0) - val map = new BytesToBytesMap(taskMemoryManager, 64, taskMemoryManager.pageSizeBytes()) - - // Key/value are a unsafe rows with a single int column + val map = createBytesToBytesMapWithDuplicateKeys(taskMemoryManager) val schema = new StructType().add("i", IntegerType) - val key = new UnsafeRow(1) - key.pointTo(new Array[Byte](32), 32) - key.setInt(0, 1) - val value = new UnsafeRow(1) - value.pointTo(new Array[Byte](32), 32) - value.setInt(0, 2) - - for (_ <- 1 to 65) { - val loc = map.lookup(key.getBaseObject, key.getBaseOffset, key.getSizeInBytes) - loc.append( - key.getBaseObject, key.getBaseOffset, key.getSizeInBytes, - value.getBaseObject, value.getBaseOffset, value.getSizeInBytes) - } // Make sure we can successfully create a UnsafeKVExternalSorter with a `BytesToBytesMap` // which has duplicated keys and the number of entries exceeds its capacity. @@ -245,4 +230,82 @@ class UnsafeKVExternalSorterSuite extends SparkFunSuite with SharedSparkSession TaskContext.unset() } } + + test("SPARK-31952: create UnsafeKVExternalSorter with existing map should count spilled memory " + + "size correctly") { + val memoryManager = new TestMemoryManager(new SparkConf()) + val taskMemoryManager = new TaskMemoryManager(memoryManager, 0) + val map = createBytesToBytesMapWithDuplicateKeys(taskMemoryManager) + val schema = new StructType().add("i", IntegerType) + + try { + val context = new TaskContextImpl(0, 0, 0, 0, 0, taskMemoryManager, new Properties(), null) + TaskContext.setTaskContext(context) + val expectedSpillSize = map.getTotalMemoryConsumption + val sorter = new UnsafeKVExternalSorter( + schema, + schema, + sparkContext.env.blockManager, + sparkContext.env.serializerManager, + taskMemoryManager.pageSizeBytes(), + Int.MaxValue, + map) + assert(sorter.getSpillSize === expectedSpillSize) + } finally { + TaskContext.unset() + } + } + + test("SPARK-31952: UnsafeKVExternalSorter.merge should accumulate totalSpillBytes") { + val memoryManager = new TestMemoryManager(new SparkConf()) + val taskMemoryManager = new TaskMemoryManager(memoryManager, 0) + val map1 = createBytesToBytesMapWithDuplicateKeys(taskMemoryManager) + val map2 = createBytesToBytesMapWithDuplicateKeys(taskMemoryManager) + val schema = new StructType().add("i", IntegerType) + + try { + val context = new TaskContextImpl(0, 0, 0, 0, 0, taskMemoryManager, new Properties(), null) + TaskContext.setTaskContext(context) + val expectedSpillSize = map1.getTotalMemoryConsumption + map2.getTotalMemoryConsumption + val sorter1 = new UnsafeKVExternalSorter( + schema, + schema, + sparkContext.env.blockManager, + sparkContext.env.serializerManager, + taskMemoryManager.pageSizeBytes(), + Int.MaxValue, + map1) + val sorter2 = new UnsafeKVExternalSorter( + schema, + schema, + sparkContext.env.blockManager, + sparkContext.env.serializerManager, + taskMemoryManager.pageSizeBytes(), + Int.MaxValue, + map2) + sorter1.merge(sorter2) + assert(sorter1.getSpillSize === expectedSpillSize) + } finally { + TaskContext.unset() + } + } + + private def createBytesToBytesMapWithDuplicateKeys(taskMemoryManager: TaskMemoryManager) + : BytesToBytesMap = { + val map = new BytesToBytesMap(taskMemoryManager, 64, taskMemoryManager.pageSizeBytes()) + // Key/value are a unsafe rows with a single int column + val key = new UnsafeRow(1) + key.pointTo(new Array[Byte](32), 32) + key.setInt(0, 1) + val value = new UnsafeRow(1) + value.pointTo(new Array[Byte](32), 32) + value.setInt(0, 2) + for (_ <- 1 to 65) { + val loc = map.lookup(key.getBaseObject, key.getBaseOffset, key.getSizeInBytes) + loc.append( + key.getBaseObject, key.getBaseOffset, key.getSizeInBytes, + value.getBaseObject, value.getBaseOffset, value.getSizeInBytes) + } + map + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSparkSubmitSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSparkSubmitSuite.scala index c5a01de911962..ee5e0e09fca21 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSparkSubmitSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSparkSubmitSuite.scala @@ -17,14 +17,14 @@ package org.apache.spark.sql.execution -import org.scalatest.{Assertions, BeforeAndAfterEach, Matchers} -import org.scalatest.concurrent.TimeLimits +import org.scalatest.{Assertions, BeforeAndAfterEach} +import org.scalatest.matchers.must.Matchers import org.scalatest.time.SpanSugar._ import org.apache.spark.{SparkFunSuite, TestUtils} import org.apache.spark.deploy.SparkSubmitSuite import org.apache.spark.internal.Logging -import org.apache.spark.sql.{LocalSparkSession, QueryTest, Row, SparkSession} +import org.apache.spark.sql.{QueryTest, Row, SparkSession} import org.apache.spark.sql.functions.{array, col, count, lit} import org.apache.spark.sql.types.IntegerType import org.apache.spark.unsafe.Platform diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala index f7396ee2a89c8..f019e34b60118 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/WholeStageCodegenSuite.scala @@ -22,8 +22,7 @@ import org.apache.spark.sql.catalyst.expressions.codegen.{ByteCodeStats, CodeAnd import org.apache.spark.sql.execution.adaptive.DisableAdaptiveExecutionSuite import org.apache.spark.sql.execution.aggregate.HashAggregateExec import org.apache.spark.sql.execution.columnar.InMemoryTableScanExec -import org.apache.spark.sql.execution.joins.BroadcastHashJoinExec -import org.apache.spark.sql.execution.joins.SortMergeJoinExec +import org.apache.spark.sql.execution.joins.{BroadcastHashJoinExec, BroadcastNestedLoopJoinExec, ShuffledHashJoinExec, SortMergeJoinExec} import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession @@ -51,6 +50,85 @@ class WholeStageCodegenSuite extends QueryTest with SharedSparkSession assert(df.collect() === Array(Row(9, 4.5))) } + testWithWholeStageCodegenOnAndOff("GenerateExec should be" + + " included in WholeStageCodegen") { codegenEnabled => + import testImplicits._ + val arrayData = Seq(("James", Seq("Java", "Scala"), Map("hair" -> "black", "eye" -> "brown"))) + val df = arrayData.toDF("name", "knownLanguages", "properties") + + // Array - explode + var expDF = df.select($"name", explode($"knownLanguages"), $"properties") + var plan = expDF.queryExecution.executedPlan + assert(plan.find { + case stage: WholeStageCodegenExec => + stage.find(_.isInstanceOf[GenerateExec]).isDefined + case _ => !codegenEnabled.toBoolean + }.isDefined) + checkAnswer(expDF, Array(Row("James", "Java", Map("hair" -> "black", "eye" -> "brown")), + Row("James", "Scala", Map("hair" -> "black", "eye" -> "brown")))) + + // Map - explode + expDF = df.select($"name", $"knownLanguages", explode($"properties")) + plan = expDF.queryExecution.executedPlan + assert(plan.find { + case stage: WholeStageCodegenExec => + stage.find(_.isInstanceOf[GenerateExec]).isDefined + case _ => !codegenEnabled.toBoolean + }.isDefined) + checkAnswer(expDF, + Array(Row("James", List("Java", "Scala"), "hair", "black"), + Row("James", List("Java", "Scala"), "eye", "brown"))) + + // Array - posexplode + expDF = df.select($"name", posexplode($"knownLanguages")) + plan = expDF.queryExecution.executedPlan + assert(plan.find { + case stage: WholeStageCodegenExec => + stage.find(_.isInstanceOf[GenerateExec]).isDefined + case _ => !codegenEnabled.toBoolean + }.isDefined) + checkAnswer(expDF, + Array(Row("James", 0, "Java"), Row("James", 1, "Scala"))) + + // Map - posexplode + expDF = df.select($"name", posexplode($"properties")) + plan = expDF.queryExecution.executedPlan + assert(plan.find { + case stage: WholeStageCodegenExec => + stage.find(_.isInstanceOf[GenerateExec]).isDefined + case _ => !codegenEnabled.toBoolean + }.isDefined) + checkAnswer(expDF, + Array(Row("James", 0, "hair", "black"), Row("James", 1, "eye", "brown"))) + + // Array - explode , selecting all columns + expDF = df.select($"*", explode($"knownLanguages")) + plan = expDF.queryExecution.executedPlan + assert(plan.find { + case stage: WholeStageCodegenExec => + stage.find(_.isInstanceOf[GenerateExec]).isDefined + case _ => !codegenEnabled.toBoolean + }.isDefined) + checkAnswer(expDF, + Array(Row("James", Seq("Java", "Scala"), Map("hair" -> "black", "eye" -> "brown"), "Java"), + Row("James", Seq("Java", "Scala"), Map("hair" -> "black", "eye" -> "brown"), "Scala"))) + + // Map - explode, selecting all columns + expDF = df.select($"*", explode($"properties")) + plan = expDF.queryExecution.executedPlan + assert(plan.find { + case stage: WholeStageCodegenExec => + stage.find(_.isInstanceOf[GenerateExec]).isDefined + case _ => !codegenEnabled.toBoolean + }.isDefined) + checkAnswer(expDF, + Array( + Row("James", List("Java", "Scala"), + Map("hair" -> "black", "eye" -> "brown"), "hair", "black"), + Row("James", List("Java", "Scala"), + Map("hair" -> "black", "eye" -> "brown"), "eye", "brown"))) + } + test("Aggregate with grouping keys should be included in WholeStageCodegen") { val df = spark.range(3).groupBy(col("id") * 2).count().orderBy(col("id") * 2) val plan = df.queryExecution.executedPlan @@ -71,6 +149,205 @@ class WholeStageCodegenSuite extends QueryTest with SharedSparkSession assert(df.collect() === Array(Row(1, 1, "1"), Row(1, 1, "1"), Row(2, 2, "2"))) } + test("ShuffledHashJoin should be included in WholeStageCodegen") { + val df1 = spark.range(5).select($"id".as("k1")) + val df2 = spark.range(15).select($"id".as("k2")) + val df3 = spark.range(6).select($"id".as("k3")) + + // test one shuffled hash join + val oneJoinDF = df1.join(df2.hint("SHUFFLE_HASH"), $"k1" === $"k2") + assert(oneJoinDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(_ : ShuffledHashJoinExec) => true + }.size === 1) + checkAnswer(oneJoinDF, Seq(Row(0, 0), Row(1, 1), Row(2, 2), Row(3, 3), Row(4, 4))) + + // test two shuffled hash joins + val twoJoinsDF = df1.join(df2.hint("SHUFFLE_HASH"), $"k1" === $"k2") + .join(df3.hint("SHUFFLE_HASH"), $"k1" === $"k3") + assert(twoJoinsDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(_ : ShuffledHashJoinExec) => true + }.size === 2) + checkAnswer(twoJoinsDF, + Seq(Row(0, 0, 0), Row(1, 1, 1), Row(2, 2, 2), Row(3, 3, 3), Row(4, 4, 4))) + } + + test("Left/Right Outer SortMergeJoin should be included in WholeStageCodegen") { + val df1 = spark.range(10).select($"id".as("k1")) + val df2 = spark.range(4).select($"id".as("k2")) + val df3 = spark.range(6).select($"id".as("k3")) + + // test one left outer sort merge join + val oneLeftOuterJoinDF = df1.join(df2.hint("SHUFFLE_MERGE"), $"k1" === $"k2", "left_outer") + assert(oneLeftOuterJoinDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(_ : SortMergeJoinExec) => true + }.size === 1) + checkAnswer(oneLeftOuterJoinDF, Seq(Row(0, 0), Row(1, 1), Row(2, 2), Row(3, 3), Row(4, null), + Row(5, null), Row(6, null), Row(7, null), Row(8, null), Row(9, null))) + + // test one right outer sort merge join + val oneRightOuterJoinDF = df2.join(df3.hint("SHUFFLE_MERGE"), $"k2" === $"k3", "right_outer") + assert(oneRightOuterJoinDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(_ : SortMergeJoinExec) => true + }.size === 1) + checkAnswer(oneRightOuterJoinDF, Seq(Row(0, 0), Row(1, 1), Row(2, 2), Row(3, 3), Row(null, 4), + Row(null, 5))) + + // test two sort merge joins + val twoJoinsDF = df3.join(df2.hint("SHUFFLE_MERGE"), $"k3" === $"k2", "left_outer") + .join(df1.hint("SHUFFLE_MERGE"), $"k3" === $"k1", "right_outer") + assert(twoJoinsDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(_ : SortMergeJoinExec) => true + }.size === 2) + checkAnswer(twoJoinsDF, + Seq(Row(0, 0, 0), Row(1, 1, 1), Row(2, 2, 2), Row(3, 3, 3), Row(4, null, 4), Row(5, null, 5), + Row(null, null, 6), Row(null, null, 7), Row(null, null, 8), Row(null, null, 9))) + } + + test("Left Semi SortMergeJoin should be included in WholeStageCodegen") { + val df1 = spark.range(10).select($"id".as("k1")) + val df2 = spark.range(4).select($"id".as("k2")) + val df3 = spark.range(6).select($"id".as("k3")) + + // test one left semi sort merge join + val oneJoinDF = df1.join(df2.hint("SHUFFLE_MERGE"), $"k1" === $"k2", "left_semi") + assert(oneJoinDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(ProjectExec(_, _ : SortMergeJoinExec)) => true + }.size === 1) + checkAnswer(oneJoinDF, Seq(Row(0), Row(1), Row(2), Row(3))) + + // test two left semi sort merge joins + val twoJoinsDF = df3.join(df2.hint("SHUFFLE_MERGE"), $"k3" === $"k2", "left_semi") + .join(df1.hint("SHUFFLE_MERGE"), $"k3" === $"k1", "left_semi") + assert(twoJoinsDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(ProjectExec(_, _ : SortMergeJoinExec)) | + WholeStageCodegenExec(_ : SortMergeJoinExec) => true + }.size === 2) + checkAnswer(twoJoinsDF, Seq(Row(0), Row(1), Row(2), Row(3))) + } + + test("Inner/Cross BroadcastNestedLoopJoinExec should be included in WholeStageCodegen") { + val df1 = spark.range(4).select($"id".as("k1")) + val df2 = spark.range(3).select($"id".as("k2")) + val df3 = spark.range(2).select($"id".as("k3")) + + Seq(true, false).foreach { codegenEnabled => + withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> codegenEnabled.toString) { + // test broadcast nested loop join without condition + val oneJoinDF = df1.join(df2) + var hasJoinInCodegen = oneJoinDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(_ : BroadcastNestedLoopJoinExec) => true + }.size === 1 + assert(hasJoinInCodegen == codegenEnabled) + checkAnswer(oneJoinDF, + Seq(Row(0, 0), Row(0, 1), Row(0, 2), Row(1, 0), Row(1, 1), Row(1, 2), + Row(2, 0), Row(2, 1), Row(2, 2), Row(3, 0), Row(3, 1), Row(3, 2))) + + // test broadcast nested loop join with condition + val oneJoinDFWithCondition = df1.join(df2, $"k1" + 1 =!= $"k2") + hasJoinInCodegen = oneJoinDFWithCondition.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(_ : BroadcastNestedLoopJoinExec) => true + }.size === 1 + assert(hasJoinInCodegen == codegenEnabled) + checkAnswer(oneJoinDFWithCondition, + Seq(Row(0, 0), Row(0, 2), Row(1, 0), Row(1, 1), Row(2, 0), Row(2, 1), + Row(2, 2), Row(3, 0), Row(3, 1), Row(3, 2))) + + // test two broadcast nested loop joins + val twoJoinsDF = df1.join(df2, $"k1" < $"k2").crossJoin(df3) + hasJoinInCodegen = twoJoinsDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(BroadcastNestedLoopJoinExec( + _: BroadcastNestedLoopJoinExec, _, _, _, _)) => true + }.size === 1 + assert(hasJoinInCodegen == codegenEnabled) + checkAnswer(twoJoinsDF, + Seq(Row(0, 1, 0), Row(0, 2, 0), Row(1, 2, 0), Row(0, 1, 1), Row(0, 2, 1), Row(1, 2, 1))) + } + } + } + + test("Left/Right outer BroadcastNestedLoopJoinExec should be included in WholeStageCodegen") { + val df1 = spark.range(4).select($"id".as("k1")) + val df2 = spark.range(3).select($"id".as("k2")) + val df3 = spark.range(2).select($"id".as("k3")) + val df4 = spark.range(0).select($"id".as("k4")) + + Seq(true, false).foreach { codegenEnabled => + withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> codegenEnabled.toString) { + // test left outer join + val leftOuterJoinDF = df1.join(df2, $"k1" > $"k2", "left_outer") + var hasJoinInCodegen = leftOuterJoinDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(_: BroadcastNestedLoopJoinExec) => true + }.size === 1 + assert(hasJoinInCodegen == codegenEnabled) + checkAnswer(leftOuterJoinDF, + Seq(Row(0, null), Row(1, 0), Row(2, 0), Row(2, 1), Row(3, 0), Row(3, 1), Row(3, 2))) + + // test right outer join + val rightOuterJoinDF = df1.join(df2, $"k1" < $"k2", "right_outer") + hasJoinInCodegen = rightOuterJoinDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(_: BroadcastNestedLoopJoinExec) => true + }.size === 1 + assert(hasJoinInCodegen == codegenEnabled) + checkAnswer(rightOuterJoinDF, Seq(Row(null, 0), Row(0, 1), Row(0, 2), Row(1, 2))) + + // test a combination of left outer and right outer joins + val twoJoinsDF = df1.join(df2, $"k1" > $"k2" + 1, "right_outer") + .join(df3, $"k1" <= $"k3", "left_outer") + hasJoinInCodegen = twoJoinsDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(BroadcastNestedLoopJoinExec( + _: BroadcastNestedLoopJoinExec, _, _, _, _)) => true + }.size === 1 + assert(hasJoinInCodegen == codegenEnabled) + checkAnswer(twoJoinsDF, + Seq(Row(2, 0, null), Row(3, 0, null), Row(3, 1, null), Row(null, 2, null))) + + // test build side is empty + val buildSideIsEmptyDF = df3.join(df4, $"k3" > $"k4", "left_outer") + hasJoinInCodegen = buildSideIsEmptyDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(_: BroadcastNestedLoopJoinExec) => true + }.size === 1 + assert(hasJoinInCodegen == codegenEnabled) + checkAnswer(buildSideIsEmptyDF, Seq(Row(0, null), Row(1, null))) + } + } + } + + test("Left semi/anti BroadcastNestedLoopJoinExec should be included in WholeStageCodegen") { + val df1 = spark.range(4).select($"id".as("k1")) + val df2 = spark.range(3).select($"id".as("k2")) + val df3 = spark.range(2).select($"id".as("k3")) + + Seq(true, false).foreach { codegenEnabled => + withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> codegenEnabled.toString) { + // test left semi join + val semiJoinDF = df1.join(df2, $"k1" + 1 <= $"k2", "left_semi") + var hasJoinInCodegen = semiJoinDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(ProjectExec(_, _ : BroadcastNestedLoopJoinExec)) => true + }.size === 1 + assert(hasJoinInCodegen == codegenEnabled) + checkAnswer(semiJoinDF, Seq(Row(0), Row(1))) + + // test left anti join + val antiJoinDF = df1.join(df2, $"k1" + 1 <= $"k2", "left_anti") + hasJoinInCodegen = antiJoinDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(ProjectExec(_, _ : BroadcastNestedLoopJoinExec)) => true + }.size === 1 + assert(hasJoinInCodegen == codegenEnabled) + checkAnswer(antiJoinDF, Seq(Row(2), Row(3))) + + // test a combination of left semi and left anti joins + val twoJoinsDF = df1.join(df2, $"k1" < $"k2", "left_semi") + .join(df3, $"k1" > $"k3", "left_anti") + hasJoinInCodegen = twoJoinsDF.queryExecution.executedPlan.collect { + case WholeStageCodegenExec(ProjectExec(_, BroadcastNestedLoopJoinExec( + _: BroadcastNestedLoopJoinExec, _, _, _, _))) => true + }.size === 1 + assert(hasJoinInCodegen == codegenEnabled) + checkAnswer(twoJoinsDF, Seq(Row(0))) + } + } + } + test("Sort should be included in WholeStageCodegen") { val df = spark.range(3, 0, -1).toDF().sort(col("id")) val plan = df.queryExecution.executedPlan @@ -342,7 +619,7 @@ class WholeStageCodegenSuite extends QueryTest with SharedSparkSession .join(baseTable, "idx") assert(distinctWithId.queryExecution.executedPlan.collectFirst { case WholeStageCodegenExec( - ProjectExec(_, BroadcastHashJoinExec(_, _, _, _, _, _: HashAggregateExec, _))) => true + ProjectExec(_, BroadcastHashJoinExec(_, _, _, _, _, _: HashAggregateExec, _, _))) => true }.isDefined) checkAnswer(distinctWithId, Seq(Row(1, 0), Row(1, 0))) @@ -353,7 +630,7 @@ class WholeStageCodegenSuite extends QueryTest with SharedSparkSession .join(baseTable, "idx") assert(groupByWithId.queryExecution.executedPlan.collectFirst { case WholeStageCodegenExec( - ProjectExec(_, BroadcastHashJoinExec(_, _, _, _, _, _: HashAggregateExec, _))) => true + ProjectExec(_, BroadcastHashJoinExec(_, _, _, _, _, _: HashAggregateExec, _, _))) => true }.isDefined) checkAnswer(groupByWithId, Seq(Row(1, 2, 0), Row(1, 2, 0))) } @@ -374,8 +651,8 @@ class WholeStageCodegenSuite extends QueryTest with SharedSparkSession // Case2: The parent of a LocalTableScanExec supports WholeStageCodegen. // In this case, the LocalTableScanExec should be within a WholeStageCodegen domain // and no more InputAdapter is inserted as the direct parent of the LocalTableScanExec. - val aggedDF = Seq(1, 2, 3).toDF.groupBy("value").sum() - val executedPlan = aggedDF.queryExecution.executedPlan + val aggregatedDF = Seq(1, 2, 3).toDF.groupBy("value").sum() + val executedPlan = aggregatedDF.queryExecution.executedPlan // HashAggregateExec supports WholeStageCodegen and it's the parent of // LocalTableScanExec so LocalTableScanExec should be within a WholeStageCodegen domain. @@ -424,7 +701,7 @@ class WholeStageCodegenSuite extends QueryTest with SharedSparkSession "GROUP BY k").foreach { query => val e = intercept[Exception] { sql(query).collect - }.getCause + } assert(e.isInstanceOf[IllegalStateException]) assert(e.getMessage.contains(expectedErrMsg)) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala index a80fc410f5033..454d3aa148a44 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveQueryExecSuite.scala @@ -21,25 +21,34 @@ import java.io.File import java.net.URI import org.apache.log4j.Level +import org.scalatest.PrivateMethodTester import org.apache.spark.scheduler.{SparkListener, SparkListenerEvent, SparkListenerJobStart} -import org.apache.spark.sql.{QueryTest, Row, SparkSession, Strategy} +import org.apache.spark.sql.{Dataset, QueryTest, Row, SparkSession, Strategy} +import org.apache.spark.sql.catalyst.optimizer.{BuildLeft, BuildRight} import org.apache.spark.sql.catalyst.plans.logical.{Aggregate, LogicalPlan} -import org.apache.spark.sql.execution.{ReusedSubqueryExec, ShuffledRowRDD, SparkPlan} +import org.apache.spark.sql.execution.{PartialReducerPartitionSpec, QueryExecution, ReusedSubqueryExec, ShuffledRowRDD, SparkPlan, UnaryExecNode} import org.apache.spark.sql.execution.command.DataWritingCommandExec -import org.apache.spark.sql.execution.exchange.{BroadcastExchangeExec, Exchange, ReusedExchangeExec} -import org.apache.spark.sql.execution.joins.{BroadcastHashJoinExec, BuildLeft, BuildRight, SortMergeJoinExec} +import org.apache.spark.sql.execution.datasources.noop.NoopDataSource +import org.apache.spark.sql.execution.datasources.v2.V2TableWriteExec +import org.apache.spark.sql.execution.exchange.{BroadcastExchangeExec, ENSURE_REQUIREMENTS, Exchange, REPARTITION, REPARTITION_WITH_NUM, ReusedExchangeExec, ShuffleExchangeExec, ShuffleExchangeLike, ShuffleOrigin} +import org.apache.spark.sql.execution.joins.{BaseJoinExec, BroadcastHashJoinExec, ShuffledHashJoinExec, ShuffledJoin, SortMergeJoinExec} +import org.apache.spark.sql.execution.metric.SQLShuffleReadMetricsReporter import org.apache.spark.sql.execution.ui.SparkListenerSQLAdaptiveExecutionUpdate import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.internal.SQLConf.PartitionOverwriteMode import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.test.SQLTestData.TestData import org.apache.spark.sql.types.{IntegerType, StructType} +import org.apache.spark.sql.util.QueryExecutionListener import org.apache.spark.util.Utils class AdaptiveQueryExecSuite extends QueryTest with SharedSparkSession - with AdaptiveSparkPlanHelper { + with AdaptiveSparkPlanHelper + with PrivateMethodTester { import testImplicits._ @@ -67,7 +76,7 @@ class AdaptiveQueryExecSuite val result = dfAdaptive.collect() withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") { val df = sql(query) - QueryTest.sameRows(result.toSeq, df.collect().toSeq) + checkAnswer(df, result) } val planAfter = dfAdaptive.queryExecution.executedPlan assert(planAfter.toString.startsWith("AdaptiveSparkPlan isFinalPlan=true")) @@ -99,10 +108,22 @@ class AdaptiveQueryExecSuite } } + private def findTopLevelShuffledHashJoin(plan: SparkPlan): Seq[ShuffledHashJoinExec] = { + collect(plan) { + case j: ShuffledHashJoinExec => j + } + } + + private def findTopLevelBaseJoin(plan: SparkPlan): Seq[BaseJoinExec] = { + collect(plan) { + case j: BaseJoinExec => j + } + } + private def findReusedExchange(plan: SparkPlan): Seq[ReusedExchangeExec] = { collectWithSubqueries(plan) { - case ShuffleQueryStageExec(_, e: ReusedExchangeExec) => e - case BroadcastQueryStageExec(_, e: ReusedExchangeExec) => e + case ShuffleQueryStageExec(_, e: ReusedExchangeExec, _) => e + case BroadcastQueryStageExec(_, e: ReusedExchangeExec, _) => e } } @@ -129,6 +150,17 @@ class AdaptiveQueryExecSuite assert(numShuffles === (numLocalReaders.length + numShufflesWithoutLocalReader)) } + private def checkInitialPartitionNum(df: Dataset[_], numPartition: Int): Unit = { + // repartition obeys initialPartitionNum when adaptiveExecutionEnabled + val plan = df.queryExecution.executedPlan + assert(plan.isInstanceOf[AdaptiveSparkPlanExec]) + val shuffle = plan.asInstanceOf[AdaptiveSparkPlanExec].executedPlan.collect { + case s: ShuffleExchangeExec => s + } + assert(shuffle.size == 1) + assert(shuffle(0).outputPartitioning.numPartitions == numPartition) + } + test("Change merge join to broadcast join") { withSQLConf( SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", @@ -201,34 +233,36 @@ class AdaptiveQueryExecSuite } } - test("Empty stage coalesced to 0-partition RDD") { + test("Empty stage coalesced to 1-partition RDD") { withSQLConf( SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", SQLConf.COALESCE_PARTITIONS_ENABLED.key -> "true") { val df1 = spark.range(10).withColumn("a", 'id) val df2 = spark.range(10).withColumn("b", 'id) withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { - val testDf = df1.where('a > 10).join(df2.where('b > 10), "id").groupBy('a).count() + val testDf = df1.where('a > 10).join(df2.where('b > 10), Seq("id"), "left_outer") + .groupBy('a).count() checkAnswer(testDf, Seq()) val plan = testDf.queryExecution.executedPlan assert(find(plan)(_.isInstanceOf[SortMergeJoinExec]).isDefined) val coalescedReaders = collect(plan) { case r: CustomShuffleReaderExec => r } - assert(coalescedReaders.length == 2) - coalescedReaders.foreach(r => assert(r.partitionSpecs.isEmpty)) + assert(coalescedReaders.length == 3) + coalescedReaders.foreach(r => assert(r.partitionSpecs.length == 1)) } withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "1") { - val testDf = df1.where('a > 10).join(df2.where('b > 10), "id").groupBy('a).count() + val testDf = df1.where('a > 10).join(df2.where('b > 10), Seq("id"), "left_outer") + .groupBy('a).count() checkAnswer(testDf, Seq()) val plan = testDf.queryExecution.executedPlan assert(find(plan)(_.isInstanceOf[BroadcastHashJoinExec]).isDefined) val coalescedReaders = collect(plan) { case r: CustomShuffleReaderExec => r } - assert(coalescedReaders.length == 2, s"$plan") - coalescedReaders.foreach(r => assert(r.partitionSpecs.isEmpty)) + assert(coalescedReaders.length == 3, s"$plan") + coalescedReaders.foreach(r => assert(r.isLocalReader || r.partitionSpecs.length == 1)) } } } @@ -545,7 +579,8 @@ class AdaptiveQueryExecSuite withSQLConf( SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", - SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "80") { + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "80", + SQLConf.BROADCAST_HASH_JOIN_OUTPUT_PARTITIONING_EXPAND_LIMIT.key -> "0") { val (plan, adaptivePlan) = runAdaptiveAndVerifyResult( "SELECT * FROM testData " + "join testData2 t2 ON key = t2.a " + @@ -628,98 +663,102 @@ class AdaptiveQueryExecSuite withSQLConf( SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1", - SQLConf.ADVISORY_PARTITION_SIZE_IN_BYTES.key -> "700") { + SQLConf.SKEW_JOIN_SKEWED_PARTITION_THRESHOLD.key -> "100", + SQLConf.ADVISORY_PARTITION_SIZE_IN_BYTES.key -> "100") { withTempView("skewData1", "skewData2") { spark .range(0, 1000, 1, 10) - .selectExpr("id % 2 as key1", "id as value1") + .selectExpr("id % 3 as key1", "id as value1") .createOrReplaceTempView("skewData1") spark .range(0, 1000, 1, 10) .selectExpr("id % 1 as key2", "id as value2") .createOrReplaceTempView("skewData2") - val (_, innerAdaptivePlan) = runAdaptiveAndVerifyResult( - "SELECT key1 FROM skewData1 join skewData2 ON key1 = key2 group by key1") + + def checkSkewJoin(query: String, optimizeSkewJoin: Boolean): Unit = { + val (_, innerAdaptivePlan) = runAdaptiveAndVerifyResult(query) + val innerSmj = findTopLevelSortMergeJoin(innerAdaptivePlan) + assert(innerSmj.size == 1 && innerSmj.head.isSkewJoin == optimizeSkewJoin) + } + + checkSkewJoin( + "SELECT key1 FROM skewData1 JOIN skewData2 ON key1 = key2", true) // Additional shuffle introduced, so disable the "OptimizeSkewedJoin" optimization - val innerSmj = findTopLevelSortMergeJoin(innerAdaptivePlan) - assert(innerSmj.size == 1 && !innerSmj.head.isSkewJoin) + checkSkewJoin( + "SELECT key1 FROM skewData1 JOIN skewData2 ON key1 = key2 GROUP BY key1", false) } } } - // TODO: we need a way to customize data distribution after shuffle, to improve test coverage - // of this case. test("SPARK-29544: adaptive skew join with different join types") { - withSQLConf( - SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", - SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1", - SQLConf.SKEW_JOIN_SKEWED_PARTITION_THRESHOLD.key -> "2000", - SQLConf.ADVISORY_PARTITION_SIZE_IN_BYTES.key -> "2000") { - withTempView("skewData1", "skewData2") { - spark - .range(0, 1000, 1, 10) - .selectExpr("id % 2 as key1", "id as value1") - .createOrReplaceTempView("skewData1") - spark - .range(0, 1000, 1, 10) - .selectExpr("id % 1 as key2", "id as value2") - .createOrReplaceTempView("skewData2") + Seq("SHUFFLE_MERGE", "SHUFFLE_HASH").foreach { joinHint => + def getJoinNode(plan: SparkPlan): Seq[ShuffledJoin] = if (joinHint == "SHUFFLE_MERGE") { + findTopLevelSortMergeJoin(plan) + } else { + findTopLevelShuffledHashJoin(plan) + } + withSQLConf( + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1", + SQLConf.COALESCE_PARTITIONS_MIN_PARTITION_NUM.key -> "1", + SQLConf.SHUFFLE_PARTITIONS.key -> "100", + SQLConf.SKEW_JOIN_SKEWED_PARTITION_THRESHOLD.key -> "800", + SQLConf.ADVISORY_PARTITION_SIZE_IN_BYTES.key -> "800") { + withTempView("skewData1", "skewData2") { + spark + .range(0, 1000, 1, 10) + .select( + when('id < 250, 249) + .when('id >= 750, 1000) + .otherwise('id).as("key1"), + 'id as "value1") + .createOrReplaceTempView("skewData1") + spark + .range(0, 1000, 1, 10) + .select( + when('id < 250, 249) + .otherwise('id).as("key2"), + 'id as "value2") + .createOrReplaceTempView("skewData2") - def checkSkewJoin(joins: Seq[SortMergeJoinExec], expectedNumPartitions: Int): Unit = { - assert(joins.size == 1 && joins.head.isSkewJoin) - assert(joins.head.left.collect { - case r: CustomShuffleReaderExec => r - }.head.partitionSpecs.length == expectedNumPartitions) - assert(joins.head.right.collect { - case r: CustomShuffleReaderExec => r - }.head.partitionSpecs.length == expectedNumPartitions) - } + def checkSkewJoin( + joins: Seq[ShuffledJoin], + leftSkewNum: Int, + rightSkewNum: Int): Unit = { + assert(joins.size == 1 && joins.head.isSkewJoin) + assert(joins.head.left.collect { + case r: CustomShuffleReaderExec => r + }.head.partitionSpecs.collect { + case p: PartialReducerPartitionSpec => p.reducerIndex + }.distinct.length == leftSkewNum) + assert(joins.head.right.collect { + case r: CustomShuffleReaderExec => r + }.head.partitionSpecs.collect { + case p: PartialReducerPartitionSpec => p.reducerIndex + }.distinct.length == rightSkewNum) + } - // skewed inner join optimization - val (_, innerAdaptivePlan) = runAdaptiveAndVerifyResult( - "SELECT * FROM skewData1 join skewData2 ON key1 = key2") - // left stats: [3496, 0, 0, 0, 4014] - // right stats:[6292, 0, 0, 0, 0] - // Partition 0: both left and right sides are skewed, left side is divided - // into 2 splits and right side is divided into 4 splits, so - // 2 x 4 sub-partitions. - // Partition 1, 2, 3: not skewed, and coalesced into 1 partition, but it's ignored as the - // size is 0. - // Partition 4: only left side is skewed, and divide into 2 splits, so - // 2 sub-partitions. - // So total (8 + 0 + 2) partitions. - val innerSmj = findTopLevelSortMergeJoin(innerAdaptivePlan) - checkSkewJoin(innerSmj, 8 + 0 + 2) - - // skewed left outer join optimization - val (_, leftAdaptivePlan) = runAdaptiveAndVerifyResult( - "SELECT * FROM skewData1 left outer join skewData2 ON key1 = key2") - // left stats: [3496, 0, 0, 0, 4014] - // right stats:[6292, 0, 0, 0, 0] - // Partition 0: both left and right sides are skewed, but left join can't split right side, - // so only left side is divided into 2 splits, and thus 2 sub-partitions. - // Partition 1, 2, 3: not skewed, and coalesced into 1 partition, but it's ignored as the - // size is 0. - // Partition 4: only left side is skewed, and divide into 2 splits, so - // 2 sub-partitions. - // So total (2 + 0 + 2) partitions. - val leftSmj = findTopLevelSortMergeJoin(leftAdaptivePlan) - checkSkewJoin(leftSmj, 2 + 0 + 2) - - // skewed right outer join optimization - val (_, rightAdaptivePlan) = runAdaptiveAndVerifyResult( - "SELECT * FROM skewData1 right outer join skewData2 ON key1 = key2") - // left stats: [3496, 0, 0, 0, 4014] - // right stats:[6292, 0, 0, 0, 0] - // Partition 0: both left and right sides are skewed, but right join can't split left side, - // so only right side is divided into 4 splits, and thus 4 sub-partitions. - // Partition 1, 2, 3: not skewed, and coalesced into 1 partition, but it's ignored as the - // size is 0. - // Partition 4: only left side is skewed, but right join can't split left side, so just - // 1 partition. - // So total (4 + 0 + 1) partitions. - val rightSmj = findTopLevelSortMergeJoin(rightAdaptivePlan) - checkSkewJoin(rightSmj, 4 + 0 + 1) + // skewed inner join optimization + val (_, innerAdaptivePlan) = runAdaptiveAndVerifyResult( + s"SELECT /*+ $joinHint(skewData1) */ * FROM skewData1 " + + "JOIN skewData2 ON key1 = key2") + val inner = getJoinNode(innerAdaptivePlan) + checkSkewJoin(inner, 2, 1) + + // skewed left outer join optimization + val (_, leftAdaptivePlan) = runAdaptiveAndVerifyResult( + s"SELECT /*+ $joinHint(skewData2) */ * FROM skewData1 " + + "LEFT OUTER JOIN skewData2 ON key1 = key2") + val leftJoin = getJoinNode(leftAdaptivePlan) + checkSkewJoin(leftJoin, 2, 0) + + // skewed right outer join optimization + val (_, rightAdaptivePlan) = runAdaptiveAndVerifyResult( + s"SELECT /*+ $joinHint(skewData1) */ * FROM skewData1 " + + "RIGHT OUTER JOIN skewData2 ON key1 = key2") + val rightJoin = getJoinNode(rightAdaptivePlan) + checkSkewJoin(rightJoin, 0, 1) + } } } } @@ -736,11 +775,11 @@ class AdaptiveQueryExecSuite Utils.deleteRecursively(tableDir) df1.write.parquet(tableDir.getAbsolutePath) - val agged = spark.table("bucketed_table").groupBy("i").count() + val aggregated = spark.table("bucketed_table").groupBy("i").count() val error = intercept[Exception] { - agged.count() + aggregated.count() } - assert(error.getCause().toString contains "Early failed query stage found") + assert(error.toString contains "Invalid bucket file") assert(error.getSuppressed.size === 0) } } @@ -823,6 +862,19 @@ class AdaptiveQueryExecSuite } } + test("tree string output") { + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") { + val df = sql("SELECT * FROM testData join testData2 ON key = a where value = '1'") + val planBefore = df.queryExecution.executedPlan + assert(!planBefore.toString.contains("== Current Plan ==")) + assert(!planBefore.toString.contains("== Initial Plan ==")) + df.collect() + val planAfter = df.queryExecution.executedPlan + assert(planAfter.toString.contains("== Final Plan ==")) + assert(planAfter.toString.contains("== Initial Plan ==")) + } + } + test("SPARK-31384: avoid NPE in OptimizeSkewedJoin when there's 0 partition plan") { withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { @@ -836,6 +888,25 @@ class AdaptiveQueryExecSuite } } + test("SPARK-34682: CustomShuffleReaderExec operating on canonicalized plan") { + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") { + val (_, adaptivePlan) = runAdaptiveAndVerifyResult( + "SELECT key FROM testData GROUP BY key") + val readers = collect(adaptivePlan) { + case r: CustomShuffleReaderExec => r + } + assert(readers.length == 1) + val reader = readers.head + val c = reader.canonicalized.asInstanceOf[CustomShuffleReaderExec] + // we can't just call execute() because that has separate checks for canonicalized plans + val ex = intercept[IllegalStateException] { + val doExecute = PrivateMethod[Unit](Symbol("doExecute")) + c.invokePrivate(doExecute()) + } + assert(ex.getMessage === "operating on canonicalized plan") + } + } + test("metrics of the shuffle reader") { withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") { val (_, adaptivePlan) = runAdaptiveAndVerifyResult( @@ -873,28 +944,40 @@ class AdaptiveQueryExecSuite withSQLConf( SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1", - SQLConf.ADVISORY_PARTITION_SIZE_IN_BYTES.key -> "2000", - SQLConf.SKEW_JOIN_SKEWED_PARTITION_THRESHOLD.key -> "2000") { + SQLConf.SHUFFLE_PARTITIONS.key -> "100", + SQLConf.SKEW_JOIN_SKEWED_PARTITION_THRESHOLD.key -> "800", + SQLConf.ADVISORY_PARTITION_SIZE_IN_BYTES.key -> "800") { withTempView("skewData1", "skewData2") { spark .range(0, 1000, 1, 10) - .selectExpr("id % 2 as key1", "id as value1") + .select( + when('id < 250, 249) + .when('id >= 750, 1000) + .otherwise('id).as("key1"), + 'id as "value1") .createOrReplaceTempView("skewData1") spark .range(0, 1000, 1, 10) - .selectExpr("id % 1 as key2", "id as value2") + .select( + when('id < 250, 249) + .otherwise('id).as("key2"), + 'id as "value2") .createOrReplaceTempView("skewData2") val (_, adaptivePlan) = runAdaptiveAndVerifyResult( "SELECT * FROM skewData1 join skewData2 ON key1 = key2") - val reader = collect(adaptivePlan) { + val readers = collect(adaptivePlan) { case r: CustomShuffleReaderExec => r - }.head - assert(!reader.isLocalReader) - assert(reader.hasSkewedPartition) - assert(!reader.hasCoalescedPartition) // 0-size partitions are ignored. - assert(reader.metrics.contains("numSkewedPartitions")) - assert(reader.metrics("numSkewedPartitions").value > 0) - assert(reader.metrics("numSkewedSplits").value > 0) + } + readers.foreach { reader => + assert(!reader.isLocalReader) + assert(reader.hasCoalescedPartition) + assert(reader.hasSkewedPartition) + assert(reader.metrics.contains("numSkewedPartitions")) + } + assert(readers(0).metrics("numSkewedPartitions").value == 2) + assert(readers(0).metrics("numSkewedSplits").value == 15) + assert(readers(1).metrics("numSkewedPartitions").value == 1) + assert(readers(1).metrics("numSkewedSplits").value == 12) } } } @@ -918,9 +1001,9 @@ class AdaptiveQueryExecSuite withSQLConf(SQLConf.UI_EXPLAIN_MODE.key -> mode, SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "80") { - val dfApdaptive = sql("SELECT * FROM testData JOIN testData2 ON key = a WHERE value = '1'") + val dfAdaptive = sql("SELECT * FROM testData JOIN testData2 ON key = a WHERE value = '1'") try { - checkAnswer(dfApdaptive, Row(1, "1", 1, 1) :: Row(1, "1", 1, 2) :: Nil) + checkAnswer(dfAdaptive, Row(1, "1", 1, 1) :: Row(1, "1", 1, 2) :: Nil) spark.sparkContext.listenerBus.waitUntilEmpty() assert(checkDone) } finally { @@ -1014,4 +1097,548 @@ class AdaptiveQueryExecSuite } } } + + test("SPARK-31220, SPARK-32056: repartition by expression with AQE") { + Seq(true, false).foreach { enableAQE => + withSQLConf( + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> enableAQE.toString, + SQLConf.COALESCE_PARTITIONS_ENABLED.key -> "true", + SQLConf.COALESCE_PARTITIONS_INITIAL_PARTITION_NUM.key -> "10", + SQLConf.SHUFFLE_PARTITIONS.key -> "10") { + + val df1 = spark.range(10).repartition($"id") + val df2 = spark.range(10).repartition($"id" + 1) + + val partitionsNum1 = df1.rdd.collectPartitions().length + val partitionsNum2 = df2.rdd.collectPartitions().length + + if (enableAQE) { + assert(partitionsNum1 < 10) + assert(partitionsNum2 < 10) + + checkInitialPartitionNum(df1, 10) + checkInitialPartitionNum(df2, 10) + } else { + assert(partitionsNum1 === 10) + assert(partitionsNum2 === 10) + } + + + // Don't coalesce partitions if the number of partitions is specified. + val df3 = spark.range(10).repartition(10, $"id") + val df4 = spark.range(10).repartition(10) + assert(df3.rdd.collectPartitions().length == 10) + assert(df4.rdd.collectPartitions().length == 10) + } + } + } + + test("SPARK-31220, SPARK-32056: repartition by range with AQE") { + Seq(true, false).foreach { enableAQE => + withSQLConf( + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> enableAQE.toString, + SQLConf.COALESCE_PARTITIONS_ENABLED.key -> "true", + SQLConf.COALESCE_PARTITIONS_INITIAL_PARTITION_NUM.key -> "10", + SQLConf.SHUFFLE_PARTITIONS.key -> "10") { + + val df1 = spark.range(10).toDF.repartitionByRange($"id".asc) + val df2 = spark.range(10).toDF.repartitionByRange(($"id" + 1).asc) + + val partitionsNum1 = df1.rdd.collectPartitions().length + val partitionsNum2 = df2.rdd.collectPartitions().length + + if (enableAQE) { + assert(partitionsNum1 < 10) + assert(partitionsNum2 < 10) + + checkInitialPartitionNum(df1, 10) + checkInitialPartitionNum(df2, 10) + } else { + assert(partitionsNum1 === 10) + assert(partitionsNum2 === 10) + } + + // Don't coalesce partitions if the number of partitions is specified. + val df3 = spark.range(10).repartitionByRange(10, $"id".asc) + assert(df3.rdd.collectPartitions().length == 10) + } + } + } + + test("SPARK-31220, SPARK-32056: repartition using sql and hint with AQE") { + Seq(true, false).foreach { enableAQE => + withTempView("test") { + withSQLConf( + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> enableAQE.toString, + SQLConf.COALESCE_PARTITIONS_ENABLED.key -> "true", + SQLConf.COALESCE_PARTITIONS_INITIAL_PARTITION_NUM.key -> "10", + SQLConf.SHUFFLE_PARTITIONS.key -> "10") { + + spark.range(10).toDF.createTempView("test") + + val df1 = spark.sql("SELECT /*+ REPARTITION(id) */ * from test") + val df2 = spark.sql("SELECT /*+ REPARTITION_BY_RANGE(id) */ * from test") + val df3 = spark.sql("SELECT * from test DISTRIBUTE BY id") + val df4 = spark.sql("SELECT * from test CLUSTER BY id") + + val partitionsNum1 = df1.rdd.collectPartitions().length + val partitionsNum2 = df2.rdd.collectPartitions().length + val partitionsNum3 = df3.rdd.collectPartitions().length + val partitionsNum4 = df4.rdd.collectPartitions().length + + if (enableAQE) { + assert(partitionsNum1 < 10) + assert(partitionsNum2 < 10) + assert(partitionsNum3 < 10) + assert(partitionsNum4 < 10) + + checkInitialPartitionNum(df1, 10) + checkInitialPartitionNum(df2, 10) + checkInitialPartitionNum(df3, 10) + checkInitialPartitionNum(df4, 10) + } else { + assert(partitionsNum1 === 10) + assert(partitionsNum2 === 10) + assert(partitionsNum3 === 10) + assert(partitionsNum4 === 10) + } + + // Don't coalesce partitions if the number of partitions is specified. + val df5 = spark.sql("SELECT /*+ REPARTITION(10, id) */ * from test") + val df6 = spark.sql("SELECT /*+ REPARTITION_BY_RANGE(10, id) */ * from test") + assert(df5.rdd.collectPartitions().length == 10) + assert(df6.rdd.collectPartitions().length == 10) + } + } + } + } + + test("SPARK-32573: Eliminate NAAJ when BuildSide is HashedRelationWithAllNullKeys") { + withSQLConf( + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> Long.MaxValue.toString) { + val (plan, adaptivePlan) = runAdaptiveAndVerifyResult( + "SELECT * FROM testData2 t1 WHERE t1.b NOT IN (SELECT b FROM testData3)") + val bhj = findTopLevelBroadcastHashJoin(plan) + assert(bhj.size == 1) + val join = findTopLevelBaseJoin(adaptivePlan) + assert(join.isEmpty) + checkNumLocalShuffleReaders(adaptivePlan) + } + } + + test("SPARK-32717: AQEOptimizer should respect excludedRules configuration") { + withSQLConf( + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> Long.MaxValue.toString, + // This test is a copy of test(SPARK-32573), in order to test the configuration + // `spark.sql.adaptive.optimizer.excludedRules` works as expect. + SQLConf.ADAPTIVE_OPTIMIZER_EXCLUDED_RULES.key -> EliminateUnnecessaryJoin.ruleName) { + val (plan, adaptivePlan) = runAdaptiveAndVerifyResult( + "SELECT * FROM testData2 t1 WHERE t1.b NOT IN (SELECT b FROM testData3)") + val bhj = findTopLevelBroadcastHashJoin(plan) + assert(bhj.size == 1) + val join = findTopLevelBaseJoin(adaptivePlan) + // this is different compares to test(SPARK-32573) due to the rule + // `EliminateUnnecessaryJoin` has been excluded. + assert(join.nonEmpty) + checkNumLocalShuffleReaders(adaptivePlan) + } + } + + test("SPARK-32649: Eliminate inner and semi join to empty relation") { + withSQLConf( + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "80") { + Seq( + // inner join (small table at right side) + "SELECT * FROM testData t1 join testData3 t2 ON t1.key = t2.a WHERE t2.b = 1", + // inner join (small table at left side) + "SELECT * FROM testData3 t1 join testData t2 ON t1.a = t2.key WHERE t1.b = 1", + // left semi join + "SELECT * FROM testData t1 left semi join testData3 t2 ON t1.key = t2.a AND t2.b = 1" + ).foreach(query => { + val (plan, adaptivePlan) = runAdaptiveAndVerifyResult(query) + val smj = findTopLevelSortMergeJoin(plan) + assert(smj.size == 1) + val join = findTopLevelBaseJoin(adaptivePlan) + assert(join.isEmpty) + checkNumLocalShuffleReaders(adaptivePlan) + }) + } + } + + test("SPARK-34533: Eliminate left anti join to empty relation") { + withSQLConf( + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") { + Seq( + // broadcast non-empty right side + ("SELECT /*+ broadcast(testData3) */ * FROM testData LEFT ANTI JOIN testData3", true), + // broadcast empty right side + ("SELECT /*+ broadcast(emptyTestData) */ * FROM testData LEFT ANTI JOIN emptyTestData", + true), + // broadcast left side + ("SELECT /*+ broadcast(testData) */ * FROM testData LEFT ANTI JOIN testData3", false) + ).foreach { case (query, isEliminated) => + val (plan, adaptivePlan) = runAdaptiveAndVerifyResult(query) + assert(findTopLevelBaseJoin(plan).size == 1) + assert(findTopLevelBaseJoin(adaptivePlan).isEmpty == isEliminated) + } + } + } + + test("SPARK-34781: Eliminate left semi/anti join to its left side") { + withSQLConf( + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") { + Seq( + // left semi join and non-empty right side + ("SELECT * FROM testData LEFT SEMI JOIN testData3", true), + // left semi join, non-empty right side and non-empty join condition + ("SELECT * FROM testData t1 LEFT SEMI JOIN testData3 t2 ON t1.key = t2.a", false), + // left anti join and empty right side + ("SELECT * FROM testData LEFT ANTI JOIN emptyTestData", true), + // left anti join, empty right side and non-empty join condition + ("SELECT * FROM testData t1 LEFT ANTI JOIN emptyTestData t2 ON t1.key = t2.key", true) + ).foreach { case (query, isEliminated) => + val (plan, adaptivePlan) = runAdaptiveAndVerifyResult(query) + assert(findTopLevelBaseJoin(plan).size == 1) + assert(findTopLevelBaseJoin(adaptivePlan).isEmpty == isEliminated) + } + } + } + + test("SPARK-32753: Only copy tags to node with no tags") { + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") { + withTempView("v1") { + spark.range(10).union(spark.range(10)).createOrReplaceTempView("v1") + + val (_, adaptivePlan) = runAdaptiveAndVerifyResult( + "SELECT id FROM v1 GROUP BY id DISTRIBUTE BY id") + assert(collect(adaptivePlan) { + case s: ShuffleExchangeExec => s + }.length == 1) + } + } + } + + test("Logging plan changes for AQE") { + val testAppender = new LogAppender("plan changes") + withLogAppender(testAppender) { + withSQLConf( + SQLConf.PLAN_CHANGE_LOG_LEVEL.key -> "INFO", + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "80") { + sql("SELECT * FROM testData JOIN testData2 ON key = a " + + "WHERE value = (SELECT max(a) FROM testData3)").collect() + } + Seq("=== Result of Batch AQE Preparations ===", + "=== Result of Batch AQE Post Stage Creation ===", + "=== Result of Batch AQE Replanning ===", + "=== Result of Batch AQE Query Stage Optimization ===", + "=== Result of Batch AQE Final Query Stage Optimization ===").foreach { expectedMsg => + assert(testAppender.loggingEvents.exists(_.getRenderedMessage.contains(expectedMsg))) + } + } + } + + test("SPARK-32932: Do not use local shuffle reader at final stage on write command") { + withSQLConf(SQLConf.PARTITION_OVERWRITE_MODE.key -> PartitionOverwriteMode.DYNAMIC.toString, + SQLConf.SHUFFLE_PARTITIONS.key -> "5", + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") { + val data = for ( + i <- 1L to 10L; + j <- 1L to 3L + ) yield (i, j) + + val df = data.toDF("i", "j").repartition($"j") + var noLocalReader: Boolean = false + val listener = new QueryExecutionListener { + override def onSuccess(funcName: String, qe: QueryExecution, durationNs: Long): Unit = { + qe.executedPlan match { + case plan@(_: DataWritingCommandExec | _: V2TableWriteExec) => + assert(plan.asInstanceOf[UnaryExecNode].child.isInstanceOf[AdaptiveSparkPlanExec]) + noLocalReader = collect(plan) { + case exec: CustomShuffleReaderExec if exec.isLocalReader => exec + }.isEmpty + case _ => // ignore other events + } + } + override def onFailure(funcName: String, qe: QueryExecution, + exception: Exception): Unit = {} + } + spark.listenerManager.register(listener) + + withTable("t") { + df.write.partitionBy("j").saveAsTable("t") + sparkContext.listenerBus.waitUntilEmpty() + assert(noLocalReader) + noLocalReader = false + } + + // Test DataSource v2 + val format = classOf[NoopDataSource].getName + df.write.format(format).mode("overwrite").save() + sparkContext.listenerBus.waitUntilEmpty() + assert(noLocalReader) + noLocalReader = false + + spark.listenerManager.unregister(listener) + } + } + + test("SPARK-33494: Do not use local shuffle reader for repartition") { + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") { + val df = spark.table("testData").repartition('key) + df.collect() + // local shuffle reader breaks partitioning and shouldn't be used for repartition operation + // which is specified by users. + checkNumLocalShuffleReaders(df.queryExecution.executedPlan, numShufflesWithoutLocalReader = 1) + } + } + + test("SPARK-33551: Do not use custom shuffle reader for repartition") { + def hasRepartitionShuffle(plan: SparkPlan): Boolean = { + find(plan) { + case s: ShuffleExchangeLike => + s.shuffleOrigin == REPARTITION || s.shuffleOrigin == REPARTITION_WITH_NUM + case _ => false + }.isDefined + } + + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", + SQLConf.SHUFFLE_PARTITIONS.key -> "5") { + val df = sql( + """ + |SELECT * FROM ( + | SELECT * FROM testData WHERE key = 1 + |) + |RIGHT OUTER JOIN testData2 + |ON value = b + """.stripMargin) + + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "80") { + // Repartition with no partition num specified. + val dfRepartition = df.repartition('b) + dfRepartition.collect() + val plan = dfRepartition.queryExecution.executedPlan + // The top shuffle from repartition is optimized out. + assert(!hasRepartitionShuffle(plan)) + val bhj = findTopLevelBroadcastHashJoin(plan) + assert(bhj.length == 1) + checkNumLocalShuffleReaders(plan, 1) + // Probe side is coalesced. + val customReader = bhj.head.right.find(_.isInstanceOf[CustomShuffleReaderExec]) + assert(customReader.isDefined) + assert(customReader.get.asInstanceOf[CustomShuffleReaderExec].hasCoalescedPartition) + + // Repartition with partition default num specified. + val dfRepartitionWithNum = df.repartition(5, 'b) + dfRepartitionWithNum.collect() + val planWithNum = dfRepartitionWithNum.queryExecution.executedPlan + // The top shuffle from repartition is optimized out. + assert(!hasRepartitionShuffle(planWithNum)) + val bhjWithNum = findTopLevelBroadcastHashJoin(planWithNum) + assert(bhjWithNum.length == 1) + checkNumLocalShuffleReaders(planWithNum, 1) + // Probe side is not coalesced. + assert(bhjWithNum.head.right.find(_.isInstanceOf[CustomShuffleReaderExec]).isEmpty) + + // Repartition with partition non-default num specified. + val dfRepartitionWithNum2 = df.repartition(3, 'b) + dfRepartitionWithNum2.collect() + val planWithNum2 = dfRepartitionWithNum2.queryExecution.executedPlan + // The top shuffle from repartition is not optimized out, and this is the only shuffle that + // does not have local shuffle reader. + assert(hasRepartitionShuffle(planWithNum2)) + val bhjWithNum2 = findTopLevelBroadcastHashJoin(planWithNum2) + assert(bhjWithNum2.length == 1) + checkNumLocalShuffleReaders(planWithNum2, 1) + val customReader2 = bhjWithNum2.head.right.find(_.isInstanceOf[CustomShuffleReaderExec]) + assert(customReader2.isDefined) + assert(customReader2.get.asInstanceOf[CustomShuffleReaderExec].isLocalReader) + } + + // Force skew join + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1", + SQLConf.SKEW_JOIN_ENABLED.key -> "true", + SQLConf.SKEW_JOIN_SKEWED_PARTITION_THRESHOLD.key -> "1", + SQLConf.SKEW_JOIN_SKEWED_PARTITION_FACTOR.key -> "0", + SQLConf.ADVISORY_PARTITION_SIZE_IN_BYTES.key -> "10") { + // Repartition with no partition num specified. + val dfRepartition = df.repartition('b) + dfRepartition.collect() + val plan = dfRepartition.queryExecution.executedPlan + // The top shuffle from repartition is optimized out. + assert(!hasRepartitionShuffle(plan)) + val smj = findTopLevelSortMergeJoin(plan) + assert(smj.length == 1) + // No skew join due to the repartition. + assert(!smj.head.isSkewJoin) + // Both sides are coalesced. + val customReaders = collect(smj.head) { + case c: CustomShuffleReaderExec if c.hasCoalescedPartition => c + } + assert(customReaders.length == 2) + + // Repartition with default partition num specified. + val dfRepartitionWithNum = df.repartition(5, 'b) + dfRepartitionWithNum.collect() + val planWithNum = dfRepartitionWithNum.queryExecution.executedPlan + // The top shuffle from repartition is optimized out. + assert(!hasRepartitionShuffle(planWithNum)) + val smjWithNum = findTopLevelSortMergeJoin(planWithNum) + assert(smjWithNum.length == 1) + // No skew join due to the repartition. + assert(!smjWithNum.head.isSkewJoin) + // No coalesce due to the num in repartition. + val customReadersWithNum = collect(smjWithNum.head) { + case c: CustomShuffleReaderExec if c.hasCoalescedPartition => c + } + assert(customReadersWithNum.isEmpty) + + // Repartition with default non-partition num specified. + val dfRepartitionWithNum2 = df.repartition(3, 'b) + dfRepartitionWithNum2.collect() + val planWithNum2 = dfRepartitionWithNum2.queryExecution.executedPlan + // The top shuffle from repartition is not optimized out. + assert(hasRepartitionShuffle(planWithNum2)) + val smjWithNum2 = findTopLevelSortMergeJoin(planWithNum2) + assert(smjWithNum2.length == 1) + // Skew join can apply as the repartition is not optimized out. + assert(smjWithNum2.head.isSkewJoin) + } + } + } + + test("SPARK-34091: Batch shuffle fetch in AQE partition coalescing") { + withSQLConf( + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", + SQLConf.SHUFFLE_PARTITIONS.key -> "10000", + SQLConf.FETCH_SHUFFLE_BLOCKS_IN_BATCH.key -> "true") { + withTable("t1") { + spark.range(100).selectExpr("id + 1 as a").write.format("parquet").saveAsTable("t1") + val query = "SELECT SUM(a) FROM t1 GROUP BY a" + val (_, adaptivePlan) = runAdaptiveAndVerifyResult(query) + val metricName = SQLShuffleReadMetricsReporter.LOCAL_BLOCKS_FETCHED + val blocksFetchedMetric = collectFirst(adaptivePlan) { + case p if p.metrics.contains(metricName) => p.metrics(metricName) + } + assert(blocksFetchedMetric.isDefined) + val blocksFetched = blocksFetchedMetric.get.value + withSQLConf(SQLConf.FETCH_SHUFFLE_BLOCKS_IN_BATCH.key -> "false") { + val (_, adaptivePlan2) = runAdaptiveAndVerifyResult(query) + val blocksFetchedMetric2 = collectFirst(adaptivePlan2) { + case p if p.metrics.contains(metricName) => p.metrics(metricName) + } + assert(blocksFetchedMetric2.isDefined) + val blocksFetched2 = blocksFetchedMetric2.get.value + assert(blocksFetched < blocksFetched2) + } + } + } + } + + test("SPARK-33933: Materialize BroadcastQueryStage first in AQE") { + val testAppender = new LogAppender("aqe query stage materialization order test") + val df = spark.range(1000).select($"id" % 26, $"id" % 10) + .toDF("index", "pv") + val dim = Range(0, 26).map(x => (x, ('a' + x).toChar.toString)) + .toDF("index", "name") + val testDf = df.groupBy("index") + .agg(sum($"pv").alias("pv")) + .join(dim, Seq("index")) + withLogAppender(testAppender, level = Some(Level.DEBUG)) { + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true") { + val result = testDf.collect() + assert(result.length == 26) + } + } + val materializeLogs = testAppender.loggingEvents + .map(_.getRenderedMessage) + .filter(_.startsWith("Materialize query stage")) + .toArray + assert(materializeLogs(0).startsWith("Materialize query stage BroadcastQueryStageExec")) + assert(materializeLogs(1).startsWith("Materialize query stage ShuffleQueryStageExec")) + } + + test("SPARK-34899: Use origin plan if we can not coalesce shuffle partition") { + def checkNoCoalescePartitions(ds: Dataset[Row], origin: ShuffleOrigin): Unit = { + assert(collect(ds.queryExecution.executedPlan) { + case s: ShuffleExchangeExec if s.shuffleOrigin == origin && s.numPartitions == 2 => s + }.size == 1) + ds.collect() + val plan = ds.queryExecution.executedPlan + assert(collect(plan) { + case c: CustomShuffleReaderExec => c + }.isEmpty) + assert(collect(plan) { + case s: ShuffleExchangeExec if s.shuffleOrigin == origin && s.numPartitions == 2 => s + }.size == 1) + checkAnswer(ds, testData) + } + + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", + SQLConf.COALESCE_PARTITIONS_ENABLED.key -> "true", + SQLConf.ADVISORY_PARTITION_SIZE_IN_BYTES.key -> "2258", + SQLConf.COALESCE_PARTITIONS_MIN_PARTITION_NUM.key -> "1", + SQLConf.SHUFFLE_PARTITIONS.key -> "2") { + val df = spark.sparkContext.parallelize( + (1 to 100).map(i => TestData(i, i.toString)), 10).toDF() + + // partition size [1420, 1420] + checkNoCoalescePartitions(df.repartition(), REPARTITION) + // partition size [1140, 1119] + checkNoCoalescePartitions(df.sort($"key"), ENSURE_REQUIREMENTS) + } + } + + test("SPARK-35239: Coalesce shuffle partition should handle empty input RDD") { + withTable("t") { + withSQLConf(SQLConf.COALESCE_PARTITIONS_MIN_PARTITION_NUM.key -> "1", + SQLConf.SHUFFLE_PARTITIONS.key -> "2") { + spark.sql("CREATE TABLE t (c1 int) USING PARQUET") + val (_, adaptive) = runAdaptiveAndVerifyResult("SELECT c1, count(*) FROM t GROUP BY c1") + assert( + collect(adaptive) { + case c @ CustomShuffleReaderExec(_, partitionSpecs) if partitionSpecs.length == 1 => c + }.length == 1 + ) + } + } + } + + test("SPARK-35264: Support AQE side broadcastJoin threshold") { + withTempView("t1", "t2") { + def checkJoinStrategy(shouldBroadcast: Boolean): Unit = { + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + val (origin, adaptive) = runAdaptiveAndVerifyResult( + "SELECT t1.c1, t2.c1 FROM t1 JOIN t2 ON t1.c1 = t2.c1") + assert(findTopLevelSortMergeJoin(origin).size == 1) + if (shouldBroadcast) { + assert(findTopLevelBroadcastHashJoin(adaptive).size == 1) + } else { + assert(findTopLevelSortMergeJoin(adaptive).size == 1) + } + } + } + + // t1: 1600 bytes + // t2: 160 bytes + spark.sparkContext.parallelize( + (1 to 100).map(i => TestData(i, i.toString)), 10) + .toDF("c1", "c2").createOrReplaceTempView("t1") + spark.sparkContext.parallelize( + (1 to 10).map(i => TestData(i, i.toString)), 5) + .toDF("c1", "c2").createOrReplaceTempView("t2") + + checkJoinStrategy(false) + withSQLConf(SQLConf.ADAPTIVE_AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + checkJoinStrategy(false) + } + + withSQLConf(SQLConf.ADAPTIVE_AUTO_BROADCASTJOIN_THRESHOLD.key -> "160") { + checkJoinStrategy(true) + } + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveTestUtils.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveTestUtils.scala index ddaeb57d31547..ad3ec85e984c8 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveTestUtils.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/adaptive/AdaptiveTestUtils.scala @@ -17,8 +17,6 @@ package org.apache.spark.sql.execution.adaptive -import java.io.{PrintWriter, StringWriter} - import org.scalactic.source.Position import org.scalatest.Tag @@ -69,25 +67,3 @@ trait DisableAdaptiveExecutionSuite extends SQLTestUtils { } } } - -object AdaptiveTestUtils { - def assertExceptionMessage(e: Exception, expected: String): Unit = { - val stringWriter = new StringWriter() - e.printStackTrace(new PrintWriter(stringWriter)) - val errorMsg = stringWriter.toString - assert(errorMsg.contains(expected)) - } - - def assertExceptionCause(t: Throwable, causeClass: Class[_]): Unit = { - var c = t.getCause - var foundCause = false - while (c != null && !foundCause) { - if (causeClass.isAssignableFrom(c.getClass)) { - foundCause = true - } else { - c = c.getCause - } - } - assert(foundCause, s"Can not find cause: $causeClass") - } -} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/arrow/ArrowConvertersSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/arrow/ArrowConvertersSuite.scala index 1e6e59456c887..a5ac2d5aa70c9 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/arrow/ArrowConvertersSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/arrow/ArrowConvertersSuite.scala @@ -34,7 +34,7 @@ import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.util.DateTimeUtils import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession -import org.apache.spark.sql.types.{BinaryType, Decimal, IntegerType, StructField, StructType} +import org.apache.spark.sql.types.{ArrayType, BinaryType, Decimal, IntegerType, NullType, StructField, StructType} import org.apache.spark.sql.util.ArrowUtils import org.apache.spark.util.Utils @@ -1071,6 +1071,61 @@ class ArrowConvertersSuite extends SharedSparkSession { collectAndValidate(df, json, "structData.json") } + test("null type conversion") { + val json = + s""" + |{ + | "schema" : { + | "fields": [ { + | "name" : "a", + | "type" : { + | "name" : "null" + | }, + | "nullable" : true, + | "children" : [ ] + | }, { + | "name" : "b", + | "type" : { + | "name" : "list" + | }, + | "nullable" : true, + | "children" : [ { + | "name" : "element", + | "type" : { + | "name" : "null" + | }, + | "nullable" : true, + | "children" : [ ] + | } ] + | } ] + | }, + | "batches" : [ { + | "count" : 3, + | "columns" : [ { + | "name" : "a", + | "count" : 3 + | }, { + | "name" : "b", + | "count" : 3, + | "VALIDITY" : [ 1, 1, 1 ], + | "OFFSET" : [ 0, 2, 4, 6 ], + | "children" : [ { + | "name" : "element", + | "count" : 6 + | } ] + | } ] + | } ] + |} + """.stripMargin + + val data = Seq(null, null, null) + val rdd = sparkContext.parallelize(data.map(n => Row(n, Seq(n, n)))) + val schema = new StructType().add("a", NullType).add("b", ArrayType(NullType)) + val df = spark.createDataFrame(rdd, schema) + + collectAndValidate(df, json, "nullData.json") + } + test("partitioned DataFrame") { val json1 = s""" @@ -1210,7 +1265,7 @@ class ArrowConvertersSuite extends SharedSparkSession { testQuietly("interval is unsupported for arrow") { val e = intercept[SparkException] { - calenderIntervalData.toDF().toArrowBatchRdd.collect() + calendarIntervalData.toDF().toArrowBatchRdd.collect() } assert(e.getCause.isInstanceOf[UnsupportedOperationException]) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/arrow/ArrowWriterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/arrow/ArrowWriterSuite.scala index bdc3b5eed7d8d..1684633c92854 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/arrow/ArrowWriterSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/arrow/ArrowWriterSuite.scala @@ -17,6 +17,8 @@ package org.apache.spark.sql.execution.arrow +import org.apache.arrow.vector.IntervalDayVector + import org.apache.spark.SparkFunSuite import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.util._ @@ -54,6 +56,8 @@ class ArrowWriterSuite extends SparkFunSuite { case BinaryType => reader.getBinary(rowId) case DateType => reader.getInt(rowId) case TimestampType => reader.getLong(rowId) + case YearMonthIntervalType => reader.getInt(rowId) + case DayTimeIntervalType => reader.getLong(rowId) } assert(value === datum) } @@ -72,6 +76,34 @@ class ArrowWriterSuite extends SparkFunSuite { check(BinaryType, Seq("a".getBytes(), "b".getBytes(), null, "d".getBytes())) check(DateType, Seq(0, 1, 2, null, 4)) check(TimestampType, Seq(0L, 3.6e9.toLong, null, 8.64e10.toLong), "America/Los_Angeles") + check(NullType, Seq(null, null, null)) + check(YearMonthIntervalType, Seq(null, 0, 1, -1, Int.MaxValue, Int.MinValue)) + check(DayTimeIntervalType, Seq(null, 0L, 1000L, -1000L, (Long.MaxValue - 807L), + (Long.MinValue + 808L))) + } + + test("long overflow for DayTimeIntervalType") + { + val schema = new StructType().add("value", DayTimeIntervalType, nullable = true) + val writer = ArrowWriter.create(schema, null) + val reader = new ArrowColumnVector(writer.root.getFieldVectors().get(0)) + val valueVector = writer.root.getFieldVectors().get(0).asInstanceOf[IntervalDayVector] + + valueVector.set(0, 106751992, 0) + valueVector.set(1, 106751991, Int.MaxValue) + + // first long overflow for test Math.multiplyExact() + val msg = intercept[java.lang.ArithmeticException] { + reader.getLong(0) + }.getMessage + assert(msg.equals("long overflow")) + + // second long overflow for test Math.addExact() + val msg1 = intercept[java.lang.ArithmeticException] { + reader.getLong(1) + }.getMessage + assert(msg1.equals("long overflow")) + writer.root.close() } test("get multiple") { @@ -96,6 +128,8 @@ class ArrowWriterSuite extends SparkFunSuite { case DoubleType => reader.getDoubles(0, data.size) case DateType => reader.getInts(0, data.size) case TimestampType => reader.getLongs(0, data.size) + case YearMonthIntervalType => reader.getInts(0, data.size) + case DayTimeIntervalType => reader.getLongs(0, data.size) } assert(values === data) @@ -110,6 +144,8 @@ class ArrowWriterSuite extends SparkFunSuite { check(DoubleType, (0 until 10).map(_.toDouble)) check(DateType, (0 until 10)) check(TimestampType, (0 until 10).map(_ * 4.32e10.toLong), "America/Los_Angeles") + check(YearMonthIntervalType, (0 until 10)) + check(DayTimeIntervalType, (-10 until 10).map(_ * 1000.toLong)) } test("array") { @@ -202,6 +238,46 @@ class ArrowWriterSuite extends SparkFunSuite { writer.root.close() } + test("null array") { + val schema = new StructType() + .add("arr", ArrayType(NullType, containsNull = true), nullable = true) + val writer = ArrowWriter.create(schema, null) + assert(writer.schema === schema) + + writer.write(InternalRow(ArrayData.toArrayData(Array(null, null, null)))) + writer.write(InternalRow(ArrayData.toArrayData(Array(null, null)))) + writer.write(InternalRow(null)) + writer.write(InternalRow(ArrayData.toArrayData(Array.empty[Int]))) + writer.write(InternalRow(ArrayData.toArrayData(Array(null, null, null)))) + writer.finish() + + val reader = new ArrowColumnVector(writer.root.getFieldVectors().get(0)) + + val array0 = reader.getArray(0) + assert(array0.numElements() === 3) + assert(array0.isNullAt(0)) + assert(array0.isNullAt(1)) + assert(array0.isNullAt(2)) + + val array1 = reader.getArray(1) + assert(array1.numElements() === 2) + assert(array1.isNullAt(0)) + assert(array1.isNullAt(1)) + + assert(reader.isNullAt(2)) + + val array3 = reader.getArray(3) + assert(array3.numElements() === 0) + + val array4 = reader.getArray(4) + assert(array4.numElements() === 3) + assert(array4.isNullAt(0)) + assert(array4.isNullAt(1)) + assert(array4.isNullAt(2)) + + writer.root.close() + } + test("struct") { val schema = new StructType() .add("struct", new StructType().add("i", IntegerType).add("str", StringType)) @@ -268,6 +344,32 @@ class ArrowWriterSuite extends SparkFunSuite { writer.root.close() } + test("null struct") { + val schema = new StructType() + .add("struct", new StructType().add("n1", NullType).add("n2", NullType)) + val writer = ArrowWriter.create(schema, null) + assert(writer.schema === schema) + + writer.write(InternalRow(InternalRow(null, null))) + writer.write(InternalRow(null)) + writer.write(InternalRow(InternalRow(null, null))) + writer.finish() + + val reader = new ArrowColumnVector(writer.root.getFieldVectors().get(0)) + + val struct0 = reader.getStruct(0) + assert(struct0.isNullAt(0)) + assert(struct0.isNullAt(1)) + + assert(reader.isNullAt(1)) + + val struct2 = reader.getStruct(2) + assert(struct2.isNullAt(0)) + assert(struct2.isNullAt(1)) + + writer.root.close() + } + test("map") { val schema = new StructType() .add("map", MapType(IntegerType, StringType), nullable = true) @@ -326,6 +428,37 @@ class ArrowWriterSuite extends SparkFunSuite { writer.root.close() } + test("null value map") { + val schema = new StructType() + .add("map", MapType(IntegerType, NullType), nullable = true) + val writer = ArrowWriter.create(schema, null) + assert(writer.schema == schema) + + writer.write(InternalRow(ArrayBasedMapData( + keys = Array(1, 2, 3), + values = Array(null, null, null) + ))) + writer.write(InternalRow(ArrayBasedMapData(Array(43), Array(null)))) + writer.write(InternalRow(null)) + + writer.finish() + + val reader = new ArrowColumnVector(writer.root.getFieldVectors.get(0)) + val map0 = reader.getMap(0) + assert(map0.numElements() == 3) + assert(map0.keyArray().array().mkString(",") == Array(1, 2, 3).mkString(",")) + assert(map0.valueArray().array().mkString(",") == Array(null, null, null).mkString(",")) + + val map1 = reader.getMap(1) + assert(map1.numElements() == 1) + assert(map1.keyArray().array().mkString(",") == Array(43).mkString(",")) + assert(map1.valueArray().array().mkString(",") == Array(null).mkString(",")) + + val map2 = reader.getMap(3) + assert(map2 == null) + writer.root.close() + } + test("nested map") { val valueSchema = new StructType() .add("name", StringType) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/AggregateBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/AggregateBenchmark.scala index 965d78227c335..b8d7b774d832d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/AggregateBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/AggregateBenchmark.scala @@ -36,7 +36,8 @@ import org.apache.spark.unsafe.map.BytesToBytesMap * Benchmark to measure performance for aggregate primitives. * To run this benchmark: * {{{ - * 1. without sbt: bin/spark-submit --class + * 1. without sbt: bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/AggregateBenchmark-results.txt". @@ -79,7 +80,7 @@ object AggregateBenchmark extends SqlBasedBenchmark { } } - benchmark.addCase("codegen = T hashmap = F", numIters = 3) { _ => + benchmark.addCase("codegen = T, hashmap = F", numIters = 3) { _ => withSQLConf( SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false", @@ -88,7 +89,16 @@ object AggregateBenchmark extends SqlBasedBenchmark { } } - benchmark.addCase("codegen = T hashmap = T", numIters = 5) { _ => + benchmark.addCase("codegen = T, row-based hashmap = T", numIters = 5) { _ => + withSQLConf( + SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", + SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true", + SQLConf.ENABLE_VECTORIZED_HASH_MAP.key -> "false") { + f() + } + } + + benchmark.addCase("codegen = T, vectorized hashmap = T", numIters = 5) { _ => withSQLConf( SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true", @@ -115,7 +125,7 @@ object AggregateBenchmark extends SqlBasedBenchmark { } } - benchmark.addCase("codegen = T hashmap = F", numIters = 3) { _ => + benchmark.addCase("codegen = T, hashmap = F", numIters = 3) { _ => withSQLConf( SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false", @@ -124,7 +134,16 @@ object AggregateBenchmark extends SqlBasedBenchmark { } } - benchmark.addCase("codegen = T hashmap = T", numIters = 5) { _ => + benchmark.addCase("codegen = T, row-based hashmap = T", numIters = 5) { _ => + withSQLConf( + SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", + SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true", + SQLConf.ENABLE_VECTORIZED_HASH_MAP.key -> "false") { + f() + } + } + + benchmark.addCase("codegen = T, vectorized hashmap = T", numIters = 5) { _ => withSQLConf( SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true", @@ -150,7 +169,7 @@ object AggregateBenchmark extends SqlBasedBenchmark { } } - benchmark.addCase("codegen = T hashmap = F", numIters = 3) { _ => + benchmark.addCase("codegen = T, hashmap = F", numIters = 3) { _ => withSQLConf( SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false", @@ -159,7 +178,16 @@ object AggregateBenchmark extends SqlBasedBenchmark { } } - benchmark.addCase("codegen = T hashmap = T", numIters = 5) { _ => + benchmark.addCase("codegen = T, row-based hashmap = T", numIters = 5) { _ => + withSQLConf( + SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", + SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true", + SQLConf.ENABLE_VECTORIZED_HASH_MAP.key -> "false") { + f() + } + } + + benchmark.addCase("codegen = T, vectorized hashmap = T", numIters = 5) { _ => withSQLConf( SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true", @@ -185,7 +213,7 @@ object AggregateBenchmark extends SqlBasedBenchmark { } } - benchmark.addCase("codegen = T hashmap = F") { _ => + benchmark.addCase("codegen = T, hashmap = F") { _ => withSQLConf( SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false", @@ -194,7 +222,16 @@ object AggregateBenchmark extends SqlBasedBenchmark { } } - benchmark.addCase("codegen = T hashmap = T") { _ => + benchmark.addCase("codegen = T, row-based hashmap = T") { _ => + withSQLConf( + SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", + SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true", + SQLConf.ENABLE_VECTORIZED_HASH_MAP.key -> "false") { + f() + } + } + + benchmark.addCase("codegen = T, vectorized hashmap = T") { _ => withSQLConf( SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true", @@ -230,7 +267,7 @@ object AggregateBenchmark extends SqlBasedBenchmark { } } - benchmark.addCase("codegen = T hashmap = F") { _ => + benchmark.addCase("codegen = T, hashmap = F") { _ => withSQLConf( SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "false", @@ -239,7 +276,16 @@ object AggregateBenchmark extends SqlBasedBenchmark { } } - benchmark.addCase("codegen = T hashmap = T") { _ => + benchmark.addCase("codegen = T, row-based hashmap = T") { _ => + withSQLConf( + SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", + SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true", + SQLConf.ENABLE_VECTORIZED_HASH_MAP.key -> "false") { + f() + } + } + + benchmark.addCase("codegen = T, vectorized hashmap = T") { _ => withSQLConf( SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", SQLConf.ENABLE_TWOLEVEL_AGG_MAP.key -> "true", @@ -290,7 +336,7 @@ object AggregateBenchmark extends SqlBasedBenchmark { } } - benchmark.addCase("codegen = T hugeMethodLimit = 10000") { _ => + benchmark.addCase("codegen = T, hugeMethodLimit = 10000") { _ => withSQLConf( SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", SQLConf.WHOLESTAGE_HUGE_METHOD_LIMIT.key -> "10000") { @@ -298,7 +344,7 @@ object AggregateBenchmark extends SqlBasedBenchmark { } } - benchmark.addCase("codegen = T hugeMethodLimit = 1500") { _ => + benchmark.addCase("codegen = T, hugeMethodLimit = 1500") { _ => withSQLConf( SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true", SQLConf.WHOLESTAGE_HUGE_METHOD_LIMIT.key -> "1500") { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/BloomFilterBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/BloomFilterBenchmark.scala index ae241b3625d02..f78ccf9569a0f 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/BloomFilterBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/BloomFilterBenchmark.scala @@ -29,7 +29,8 @@ import org.apache.spark.benchmark.Benchmark * * To run this benchmark: * {{{ - * 1. without sbt: bin/spark-submit --class + * 1. without sbt: bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/BloomFilterBenchmark-results.txt". diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/BuiltInDataSourceWriteBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/BuiltInDataSourceWriteBenchmark.scala index 6925bdd72674f..361deb0d3e3b6 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/BuiltInDataSourceWriteBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/BuiltInDataSourceWriteBenchmark.scala @@ -31,7 +31,8 @@ import org.apache.spark.sql.internal.SQLConf * * To measure specified formats, run it with arguments. * 1. without sbt: - * bin/spark-submit --class format1 [format2] [...] + * bin/spark-submit --class --jars , + * format1 [format2] [...] * 2. build/sbt "sql/test:runMain format1 [format2] [...]" * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt * "sql/test:runMain format1 [format2] [...]" diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/CharVarcharBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/CharVarcharBenchmark.scala new file mode 100644 index 0000000000000..112fd98d7016a --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/CharVarcharBenchmark.scala @@ -0,0 +1,94 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.benchmark + +import org.apache.spark.benchmark.Benchmark + +/** + * Benchmark for measure writing and reading char/varchar values with implicit length check + * and padding. + * To run this benchmark: + * {{{ + * 1. without sbt: + * bin/spark-submit --class + * --jars , + * 2. build/sbt "sql/test:runMain " + * 3. generate result: + * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " + * Results will be written to "benchmarks/CharVarcharBenchmark-results.txt". + * }}} + */ +object CharVarcharBenchmark extends SqlBasedBenchmark { + import spark.implicits._ + + private def withTable(tableNames: String*)(f: => Unit): Unit = { + try f finally { + tableNames.foreach { name => + spark.sql(s"DROP TABLE IF EXISTS $name") + } + } + } + + private def createTable(tblName: String, colType: String, path: String): Unit = { + spark.sql(s"CREATE TABLE $tblName (c $colType) USING PARQUET LOCATION '$path'") + } + + def writeBenchmark(card: Long, length: Int, hasSpaces: Boolean): Unit = { + withTempPath { dir => + val path = dir.getCanonicalPath + val benchmark = + new Benchmark(s"Write with length $length", card, output = output) + Seq("string", "char", "varchar").foreach { typ => + val colType = if (typ == "string") typ else s"$typ($length)" + val tblName = s"${typ}_${length}_$card" + + benchmark.addCase(s"write $typ with length $length", 3) { _ => + withTable(tblName) { + createTable(tblName, colType, path) + spark.range(card).map { _ => + if (hasSpaces) { + "st" + " " * length + } else { + "st" + } + }.write.insertInto(tblName) + } + } + } + benchmark.run() + } + } + + override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { + val N = 200L * 1000 * 1000 + val range = Range(20, 101, 20) + + runBenchmark("Char Varchar Write Side Perf w/o Tailing Spaces") { + for (len <- Seq(5, 10) ++ range) { + writeBenchmark(N / len, len, hasSpaces = false) + } + } + + runBenchmark("Char Varchar Write Side Perf w/ Tailing Spaces") { + for (len <- Seq(5, 10) ++ range) { + // in write side length check, we only visit the last few spaces + writeBenchmark(N / len, len, hasSpaces = true) + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/DateTimeBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/DateTimeBenchmark.scala index f56efa3bba600..4e42330088da5 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/DateTimeBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/DateTimeBenchmark.scala @@ -21,8 +21,10 @@ import java.sql.{Date, Timestamp} import java.time.{Instant, LocalDate} import org.apache.spark.benchmark.Benchmark +import org.apache.spark.sql.Dataset import org.apache.spark.sql.catalyst.util.DateTimeConstants.MILLIS_PER_DAY import org.apache.spark.sql.catalyst.util.DateTimeTestUtils.{withDefaultTimeZone, LA} +import org.apache.spark.sql.execution.HiveResult import org.apache.spark.sql.internal.SQLConf /** @@ -30,7 +32,8 @@ import org.apache.spark.sql.internal.SQLConf * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " @@ -52,7 +55,7 @@ object DateTimeBenchmark extends SqlBasedBenchmark { private def run(cardinality: Int, func: String): Unit = { codegenBenchmark(s"$func of timestamp", cardinality) { - doBenchmark(cardinality, s"$func(cast(id as timestamp))") + doBenchmark(cardinality, s"$func(timestamp_seconds(id))") } } @@ -62,7 +65,7 @@ object DateTimeBenchmark extends SqlBasedBenchmark { val N = 10000000 runBenchmark("datetime +/- interval") { val benchmark = new Benchmark("datetime +/- interval", N, output = output) - val ts = "cast(id as timestamp)" + val ts = "timestamp_seconds(id)" val dt = s"cast($ts as date)" benchmark.addCase("date + interval(m)") { _ => doBenchmark(N, s"$dt + interval 1 month") @@ -103,7 +106,7 @@ object DateTimeBenchmark extends SqlBasedBenchmark { benchmark.run() } runBenchmark("Extract components") { - run(N, "cast to timestamp", "cast(id as timestamp)") + run(N, "cast to timestamp", "timestamp_seconds(id)") run(N, "year") run(N, "quarter") run(N, "month") @@ -122,7 +125,7 @@ object DateTimeBenchmark extends SqlBasedBenchmark { run(N, "current_timestamp", "current_timestamp") } runBenchmark("Date arithmetic") { - val dateExpr = "cast(cast(id as timestamp) as date)" + val dateExpr = "cast(timestamp_seconds(id) as date)" run(N, "cast to date", dateExpr) run(N, "last_day", s"last_day($dateExpr)") run(N, "next_day", s"next_day($dateExpr, 'TU')") @@ -131,31 +134,31 @@ object DateTimeBenchmark extends SqlBasedBenchmark { run(N, "add_months", s"add_months($dateExpr, 10)") } runBenchmark("Formatting dates") { - val dateExpr = "cast(cast(id as timestamp) as date)" + val dateExpr = "cast(timestamp_seconds(id) as date)" run(N, "format date", s"date_format($dateExpr, 'MMM yyyy')") } runBenchmark("Formatting timestamps") { run(N, "from_unixtime", "from_unixtime(id, 'yyyy-MM-dd HH:mm:ss.SSSSSS')") } runBenchmark("Convert timestamps") { - val timestampExpr = "cast(id as timestamp)" + val timestampExpr = "timestamp_seconds(id)" run(N, "from_utc_timestamp", s"from_utc_timestamp($timestampExpr, 'CET')") run(N, "to_utc_timestamp", s"to_utc_timestamp($timestampExpr, 'CET')") } runBenchmark("Intervals") { - val (start, end) = ("cast(id as timestamp)", "cast((id+8640000) as timestamp)") + val (start, end) = ("timestamp_seconds(id)", "timestamp_seconds(id+8640000)") run(N, "cast interval", start, end) run(N, "datediff", s"datediff($start, $end)") run(N, "months_between", s"months_between($start, $end)") run(1000000, "window", s"window($start, 100, 10, 1)") } runBenchmark("Truncation") { - val timestampExpr = "cast(id as timestamp)" + val timestampExpr = "timestamp_seconds(id)" Seq("YEAR", "YYYY", "YY", "MON", "MONTH", "MM", "DAY", "DD", "HOUR", "MINUTE", "SECOND", "WEEK", "QUARTER").foreach { level => run(N, s"date_trunc $level", s"date_trunc('$level', $timestampExpr)") } - val dateExpr = "cast(cast(id as timestamp) as date)" + val dateExpr = "cast(timestamp_seconds(id) as date)" Seq("year", "yyyy", "yy", "mon", "month", "mm").foreach { level => run(N, s"trunc $level", s"trunc('$level', $dateExpr)") } @@ -182,14 +185,19 @@ object DateTimeBenchmark extends SqlBasedBenchmark { benchmark.addCase("From java.time.LocalDate", numIters) { _ => spark.range(rowsNum).map(millis => LocalDate.ofEpochDay(millis / MILLIS_PER_DAY)).noop() } + def dates = { + spark.range(0, rowsNum, 1, 1).map(millis => new Date(millis)) + } benchmark.addCase("Collect java.sql.Date", numIters) { _ => - spark.range(0, rowsNum, 1, 1).map(millis => new Date(millis)).collect() + dates.collect() + } + def localDates = { + spark.range(0, rowsNum, 1, 1) + .map(millis => LocalDate.ofEpochDay(millis / MILLIS_PER_DAY)) } benchmark.addCase("Collect java.time.LocalDate", numIters) { _ => withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { - spark.range(0, rowsNum, 1, 1) - .map(millis => LocalDate.ofEpochDay(millis / MILLIS_PER_DAY)) - .collect() + localDates.collect() } } benchmark.addCase("From java.sql.Timestamp", numIters) { _ => @@ -202,14 +210,37 @@ object DateTimeBenchmark extends SqlBasedBenchmark { spark.range(0, rowsNum, 1, 1) .collect() } + def timestamps = { + spark.range(0, rowsNum, 1, 1).map(millis => new Timestamp(millis)) + } benchmark.addCase("Collect java.sql.Timestamp", numIters) { _ => - spark.range(0, rowsNum, 1, 1).map(millis => new Timestamp(millis)).collect() + timestamps.collect() + } + def instants = { + spark.range(0, rowsNum, 1, 1).map(millis => Instant.ofEpochMilli(millis)) } benchmark.addCase("Collect java.time.Instant", numIters) { _ => withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { - spark.range(0, rowsNum, 1, 1) - .map(millis => Instant.ofEpochMilli(millis)) - .collect() + instants.collect() + } + } + def toHiveString(df: Dataset[_]): Unit = { + HiveResult.hiveResultString(df.queryExecution.executedPlan) + } + benchmark.addCase("java.sql.Date to Hive string", numIters) { _ => + toHiveString(dates) + } + benchmark.addCase("java.time.LocalDate to Hive string", numIters) { _ => + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { + toHiveString(localDates) + } + } + benchmark.addCase("java.sql.Timestamp to Hive string", numIters) { _ => + toHiveString(timestamps) + } + benchmark.addCase("java.time.Instant to Hive string", numIters) { _ => + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { + toHiveString(instants) } } benchmark.run() diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/DateTimeRebaseBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/DateTimeRebaseBenchmark.scala index d6167f98b5a51..090ef34e1cf0d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/DateTimeRebaseBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/DateTimeRebaseBenchmark.scala @@ -25,8 +25,7 @@ import org.apache.spark.sql.DataFrame import org.apache.spark.sql.catalyst.util.DateTimeConstants.SECONDS_PER_DAY import org.apache.spark.sql.catalyst.util.DateTimeTestUtils.{withDefaultTimeZone, LA} import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.sql.internal.SQLConf.LegacyBehaviorPolicy._ -import org.apache.spark.sql.internal.SQLConf.ParquetOutputTimestampType +import org.apache.spark.sql.internal.SQLConf.{LegacyBehaviorPolicy, ParquetOutputTimestampType} object DateTime extends Enumeration { type DateTime = Value @@ -38,7 +37,8 @@ object DateTime extends Enumeration { * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " @@ -118,12 +118,12 @@ object DateTimeRebaseBenchmark extends SqlBasedBenchmark { private def caseName( modernDates: Boolean, dateTime: DateTime, - rebase: Option[Boolean] = None, + mode: Option[LegacyBehaviorPolicy.Value] = None, vec: Option[Boolean] = None): String = { val period = if (modernDates) "after" else "before" val year = if (dateTime == DATE) 1582 else 1900 val vecFlag = vec.map(flagToStr).map(flag => s", vec $flag").getOrElse("") - val rebaseFlag = rebase.map(flagToStr).map(flag => s", rebase $flag").getOrElse("") + val rebaseFlag = mode.map(_.toString).map(m => s", rebase $m").getOrElse("") s"$period $year$vecFlag$rebaseFlag" } @@ -131,10 +131,10 @@ object DateTimeRebaseBenchmark extends SqlBasedBenchmark { basePath: File, dateTime: DateTime, modernDates: Boolean, - rebase: Option[Boolean] = None): String = { + mode: Option[LegacyBehaviorPolicy.Value] = None): String = { val period = if (modernDates) "after" else "before" val year = if (dateTime == DATE) 1582 else 1900 - val rebaseFlag = rebase.map(flagToStr).map(flag => s"_$flag").getOrElse("") + val rebaseFlag = mode.map(_.toString).map(m => s"_$m").getOrElse("") basePath.getAbsolutePath + s"/${dateTime}_${period}_$year$rebaseFlag" } @@ -160,17 +160,19 @@ object DateTimeRebaseBenchmark extends SqlBasedBenchmark { output = output) benchmarkInputs(benchmark, rowsNum, dateTime) Seq(true, false).foreach { modernDates => - Seq(false, true).foreach { rebase => - benchmark.addCase(caseName(modernDates, dateTime, Some(rebase)), 1) { _ => - val mode = if (rebase) LEGACY else CORRECTED + LegacyBehaviorPolicy.values + .filterNot(v => !modernDates && v == LegacyBehaviorPolicy.EXCEPTION) + .foreach { mode => + benchmark.addCase(caseName(modernDates, dateTime, Some(mode)), 1) { _ => withSQLConf( SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> getOutputType(dateTime), - SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_WRITE.key -> mode.toString) { + SQLConf.PARQUET_REBASE_MODE_IN_WRITE.key -> mode.toString, + SQLConf.PARQUET_INT96_REBASE_MODE_IN_WRITE.key -> mode.toString) { genDF(rowsNum, dateTime, modernDates) .write .mode("overwrite") .format("parquet") - .save(getPath(path, dateTime, modernDates, Some(rebase))) + .save(getPath(path, dateTime, modernDates, Some(mode))) } } } @@ -181,13 +183,15 @@ object DateTimeRebaseBenchmark extends SqlBasedBenchmark { s"Load $dateTime from parquet", rowsNum, output = output) Seq(true, false).foreach { modernDates => Seq(false, true).foreach { vec => - Seq(false, true).foreach { rebase => - val name = caseName(modernDates, dateTime, Some(rebase), Some(vec)) + LegacyBehaviorPolicy.values + .filterNot(v => !modernDates && v == LegacyBehaviorPolicy.EXCEPTION) + .foreach { mode => + val name = caseName(modernDates, dateTime, Some(mode), Some(vec)) benchmark2.addCase(name, 3) { _ => withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vec.toString) { spark.read .format("parquet") - .load(getPath(path, dateTime, modernDates, Some(rebase))) + .load(getPath(path, dateTime, modernDates, Some(mode))) .noop() } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ExtractBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ExtractBenchmark.scala index 287854dc3646c..6af20e8696aae 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ExtractBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ExtractBenchmark.scala @@ -27,7 +27,8 @@ import org.apache.spark.sql.internal.SQLConf * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " @@ -38,7 +39,9 @@ object ExtractBenchmark extends SqlBasedBenchmark { private def doBenchmark(cardinality: Long, exprs: String*): Unit = { val sinceSecond = Instant.parse("2010-01-01T00:00:00Z").getEpochSecond - withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true") { + withSQLConf( + SQLConf.LEGACY_INTERVAL_ENABLED.key -> "true", + SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true") { spark .range(sinceSecond, sinceSecond + cardinality, 1, 1) .selectExpr(exprs: _*) @@ -59,10 +62,10 @@ object ExtractBenchmark extends SqlBasedBenchmark { } private def castExpr(from: String): String = from match { - case "timestamp" => "cast(id as timestamp)" - case "date" => "cast(cast(id as timestamp) as date)" - case "interval" => "(cast(cast(id as timestamp) as date) - date'0001-01-01') + " + - "(cast(id as timestamp) - timestamp'1000-01-01 01:02:03.123456')" + case "timestamp" => "timestamp_seconds(id)" + case "date" => "cast(timestamp_seconds(id) as date)" + case "interval" => "(cast(timestamp_seconds(id) as date) - date'0001-01-01') + " + + "(timestamp_seconds(id) - timestamp'1000-01-01 01:02:03.123456')" case other => throw new IllegalArgumentException( s"Unsupported column type $other. Valid column types are 'timestamp' and 'date'") } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/FilterPushdownBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/FilterPushdownBenchmark.scala index b3f65d40ad95b..2bd03b6cb758b 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/FilterPushdownBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/FilterPushdownBenchmark.scala @@ -24,16 +24,17 @@ import scala.util.Random import org.apache.spark.SparkConf import org.apache.spark.benchmark.Benchmark import org.apache.spark.sql.{DataFrame, SparkSession} -import org.apache.spark.sql.functions.monotonically_increasing_id +import org.apache.spark.sql.functions.{monotonically_increasing_id, timestamp_seconds} import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.internal.SQLConf.ParquetOutputTimestampType -import org.apache.spark.sql.types.{ByteType, Decimal, DecimalType, TimestampType} +import org.apache.spark.sql.types.{ByteType, Decimal, DecimalType} /** * Benchmark to measure read performance with Filter pushdown. * To run this benchmark: * {{{ - * 1. without sbt: bin/spark-submit --class + * 1. without sbt: bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/FilterPushdownBenchmark-results.txt". @@ -332,11 +333,11 @@ object FilterPushdownBenchmark extends SqlBasedBenchmark { withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> fileType) { val columns = (1 to width).map(i => s"CAST(id AS string) c$i") val df = spark.range(numRows).selectExpr(columns: _*) - .withColumn("value", monotonically_increasing_id().cast(TimestampType)) + .withColumn("value", timestamp_seconds(monotonically_increasing_id())) withTempTable("orcTable", "parquetTable") { saveAsTable(df, dir) - Seq(s"value = CAST($mid AS timestamp)").foreach { whereExpr => + Seq(s"value = timestamp_seconds($mid)").foreach { whereExpr => val title = s"Select 1 timestamp stored as $fileType row ($whereExpr)" .replace("value AND value", "value") filterPushDownBenchmark(numRows, title, whereExpr) @@ -348,8 +349,8 @@ object FilterPushdownBenchmark extends SqlBasedBenchmark { filterPushDownBenchmark( numRows, s"Select $percent% timestamp stored as $fileType rows " + - s"(value < CAST(${numRows * percent / 100} AS timestamp))", - s"value < CAST(${numRows * percent / 100} as timestamp)", + s"(value < timestamp_seconds(${numRows * percent / 100}))", + s"value < timestamp_seconds(${numRows * percent / 100})", selectExpr ) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/GenerateExecBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/GenerateExecBenchmark.scala new file mode 100644 index 0000000000000..97bf95090f104 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/GenerateExecBenchmark.scala @@ -0,0 +1,50 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.benchmark + +import org.apache.spark.sql.functions.explode + +/** + * Benchmark to measure performance for generate exec operator. + * To run this benchmark: + * {{{ + * 1. without sbt: + * bin/spark-submit --class + * --jars , + * 2. build/sbt "sql/test:runMain " + * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " + * Results will be written to "benchmarks/GenerateExecBenchmark-results.txt". + * }}} + */ +case class Data(value1: Float, value2: Map[String, String], value3: String) + +object GenerateExecBenchmark extends SqlBasedBenchmark { + + override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { + runBenchmark("GenerateExec benchmark") { + import spark.implicits._ + val numRecords = 100000000 + codegenBenchmark("GenerateExec Benchmark", numRecords) { + val srcDF = spark.range(numRecords).map { + x => Data(x.toFloat, Map(x.toString -> x.toString), s"value3$x") + }.select($"value1", explode($"value2"), $"value3") + srcDF.noop() + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/HashedRelationMetricsBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/HashedRelationMetricsBenchmark.scala index f3647b3bb2631..f03c22aecfce3 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/HashedRelationMetricsBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/HashedRelationMetricsBenchmark.scala @@ -17,8 +17,6 @@ package org.apache.spark.sql.execution.benchmark -import org.scalatest.Assertions._ - import org.apache.spark.SparkConf import org.apache.spark.benchmark.Benchmark import org.apache.spark.internal.config.MEMORY_OFFHEAP_ENABLED @@ -32,7 +30,8 @@ import org.apache.spark.sql.types.LongType * Benchmark to measure metrics performance at HashedRelation. * To run this benchmark: * {{{ - * 1. without sbt: bin/spark-submit --class + * 1. without sbt: bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/HashedRelationMetricsBenchmark-results.txt". diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/InExpressionBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/InExpressionBenchmark.scala index caf3387875813..f5a3483bdf3ce 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/InExpressionBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/InExpressionBenchmark.scala @@ -19,7 +19,7 @@ package org.apache.spark.sql.execution.benchmark import org.apache.spark.benchmark.Benchmark import org.apache.spark.sql.DataFrame -import org.apache.spark.sql.functions.{array, struct} +import org.apache.spark.sql.functions.{array, struct, timestamp_seconds} import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types._ @@ -31,7 +31,9 @@ import org.apache.spark.sql.types._ * * To run this benchmark: * {{{ - * 1. without sbt: bin/spark-submit --class + * 1. without sbt: + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/InExpressionBenchmark-results.txt". @@ -128,15 +130,15 @@ object InExpressionBenchmark extends SqlBasedBenchmark { private def runTimestampBenchmark(numItems: Int, numRows: Long, minNumIters: Int): Unit = { val name = s"$numItems timestamps" - val values = (1 to numItems).map(m => s"CAST('1970-01-01 01:00:00.$m' AS timestamp)") - val df = spark.range(0, numRows).select($"id".cast(TimestampType)) + val values = (1 to numItems).map(m => s"timestamp'1970-01-01 01:00:00.$m'") + val df = spark.range(0, numRows).select(timestamp_seconds($"id").as("id")) runBenchmark(name, df, values, numRows, minNumIters) } private def runDateBenchmark(numItems: Int, numRows: Long, minNumIters: Int): Unit = { val name = s"$numItems dates" - val values = (1 to numItems).map(n => 1970 + n).map(y => s"CAST('$y-01-01' AS date)") - val df = spark.range(0, numRows).select($"id".cast(TimestampType).cast(DateType)) + val values = (1 to numItems).map(n => 1970 + n).map(y => s"date'$y-01-01'") + val df = spark.range(0, numRows).select(timestamp_seconds($"id").cast(DateType).as("id")) runBenchmark(name, df, values, numRows, minNumIters) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/InsertTableWithDynamicPartitionsBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/InsertTableWithDynamicPartitionsBenchmark.scala new file mode 100644 index 0000000000000..32bc2001dcd08 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/InsertTableWithDynamicPartitionsBenchmark.scala @@ -0,0 +1,105 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.benchmark + +import org.apache.spark.benchmark.Benchmark + +/** + * Benchmark to measure insert into table with dynamic partition columns. + * To run this benchmark: + * {{{ + * 1. without sbt: + * bin/spark-submit --class + * --jars , < spark sql test jar> + * 2. build/sbt "sql/test:runMain " + * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " + * Results will be written to + * "benchmarks/InsertTableWithDynamicPartitionsBenchmark-results.txt". + * }}} + */ +object InsertTableWithDynamicPartitionsBenchmark extends DataSourceWriteBenchmark { + + def prepareSourceTableAndGetTotalRows(numberRows: Long, sourceTable: String, + part1Step: Int, part2Step: Int, part3Step: Int): Long = { + val dataFrame = spark.range(0, numberRows, 1, 4) + val dataFrame1 = spark.range(0, numberRows, part1Step, 4) + val dataFrame2 = spark.range(0, numberRows, part2Step, 4) + val dataFrame3 = spark.range(0, numberRows, part3Step, 4) + + val data = dataFrame.join(dataFrame1).join(dataFrame2).join(dataFrame3) + .toDF("id", "part1", "part2", "part3") + data.write.saveAsTable(sourceTable) + data.count() + } + + def writeOnePartitionColumnTable(tableName: String, + partitionNumber: Long, benchmark: Benchmark): Unit = { + spark.sql(s"create table $tableName(i bigint, part bigint) " + + "using parquet partitioned by (part)") + benchmark.addCase(s"one partition column, $partitionNumber partitions") { _ => + spark.sql(s"insert overwrite table $tableName partition(part) " + + "select id, part1 as part from sourceTable") + } + } + + def writeTwoPartitionColumnTable(tableName: String, + partitionNumber: Long, benchmark: Benchmark): Unit = { + spark.sql(s"create table $tableName(i bigint, part1 bigint, part2 bigint) " + + "using parquet partitioned by (part1, part2)") + benchmark.addCase(s"two partition columns, $partitionNumber partitions") { _ => + spark.sql(s"insert overwrite table $tableName partition(part1, part2) " + + "select id, part1, part2 from sourceTable") + } + } + + def writeThreePartitionColumnTable(tableName: String, + partitionNumber: Long, benchmark: Benchmark): Unit = { + spark.sql(s"create table $tableName(i bigint, part1 bigint, part2 bigint, part3 bigint) " + + "using parquet partitioned by (part1, part2, part3)") + benchmark.addCase(s"three partition columns, $partitionNumber partitions") { _ => + spark.sql(s"insert overwrite table $tableName partition(part1, part2, part3) " + + "select id, part1, part2, part3 from sourceTable") + } + } + + override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { + val sourceTable = "sourceTable" + val onePartColTable = "onePartColTable" + val twoPartColTable = "twoPartColTable" + val threePartColTable = "threePartColTable" + val numberRows = 100L + val part1Step = 1 + val part2Step = 20 + val part3Step = 25 + val part1Number = numberRows / part1Step + val part2Number = numberRows / part2Step * part1Number + val part3Number = numberRows / part3Step * part2Number + + withTable(sourceTable, onePartColTable, twoPartColTable, threePartColTable) { + val totalRows = + prepareSourceTableAndGetTotalRows(numberRows, sourceTable, part1Step, part2Step, part3Step) + val benchmark = + new Benchmark(s"dynamic insert table benchmark, totalRows = $totalRows", + totalRows, output = output) + writeOnePartitionColumnTable(onePartColTable, part1Number, benchmark) + writeTwoPartitionColumnTable(twoPartColTable, part2Number, benchmark) + writeThreePartitionColumnTable(threePartColTable, part3Number, benchmark) + benchmark.run() + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/IntervalBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/IntervalBenchmark.scala index 907e3f40c1911..a9696e6718de8 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/IntervalBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/IntervalBenchmark.scala @@ -39,11 +39,11 @@ import org.apache.spark.sql.internal.SQLConf object IntervalBenchmark extends SqlBasedBenchmark { import spark.implicits._ - private def doBenchmark(cardinality: Long, exprs: Column*): Unit = { + private def doBenchmark(cardinality: Long, columns: Column*): Unit = { withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true") { spark .range(0, cardinality, 1, 1) - .select(exprs: _*) + .select(columns: _*) .queryExecution .toRdd .foreach(_ => ()) @@ -60,6 +60,26 @@ object IntervalBenchmark extends SqlBasedBenchmark { } } + private def doBenchmarkExpr(cardinality: Long, exprs: String*): Unit = { + withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "true") { + spark + .range(0, cardinality, 1, 1) + .selectExpr(exprs: _*) + .queryExecution + .toRdd + .foreach(_ => ()) + } + } + + private def addCaseExpr( + benchmark: Benchmark, + cardinality: Long, + name: String, + exprs: String*): Unit = { + benchmark.addCase(name, numIters = 3) { _ => doBenchmarkExpr(cardinality, exprs: _*) } + } + + private def buildString(withPrefix: Boolean, units: Seq[String] = Seq.empty): Column = { val init = lit(if (withPrefix) "interval" else "") :: ($"id" % 10000).cast("string") :: @@ -78,25 +98,68 @@ object IntervalBenchmark extends SqlBasedBenchmark { } } - override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { - val N = 1000000 + private def benchmarkIntervalStringParsing(cardinality: Long): Unit = { val timeUnits = Seq( "13 months", " 1 months", "100 weeks", "9 days", "12 hours", "- 3 hours", "5 minutes", "45 seconds", "123 milliseconds", "567 microseconds") val intervalToTest = ListBuffer[String]() - val benchmark = new Benchmark("cast strings to intervals", N, output = output) + val benchmark = new Benchmark("cast strings to intervals", cardinality, output = output) // The first 2 cases are used to show the overhead of preparing the interval string. - addCase(benchmark, N, "prepare string w/ interval", buildString(true, timeUnits)) - addCase(benchmark, N, "prepare string w/o interval", buildString(false, timeUnits)) - addCase(benchmark, N, intervalToTest) // Only years + addCase(benchmark, cardinality, "prepare string w/ interval", buildString(true, timeUnits)) + addCase(benchmark, cardinality, "prepare string w/o interval", buildString(false, timeUnits)) + addCase(benchmark, cardinality, intervalToTest.toSeq) // Only years for (unit <- timeUnits) { intervalToTest.append(unit) - addCase(benchmark, N, intervalToTest) + addCase(benchmark, cardinality, intervalToTest.toSeq) } benchmark.run() } + + private def benchmarkMakeInterval(cardinality: Long): Unit = { + val benchmark = new Benchmark("make_interval()", cardinality, output = output) + val hmExprs = Seq("id % 24", "id % 60") + val hmsExprs = hmExprs ++ Seq("cast((id % 500000000) / 1000000.0 as decimal(18, 6))") + val ymExprs = Seq("(2000 + (id % 30))", "((id % 12) + 1)") + val wdExpr = Seq("((id % 54) + 1)", "((id % 1000) + 1)") + val args = ymExprs ++ wdExpr ++ hmsExprs + + addCaseExpr( + benchmark, + cardinality, + "prepare make_interval()", + args: _*) + val foldableExpr = "make_interval(0, 1, 2, 3, 4, 5, 50.123456)" + addCaseExpr(benchmark, cardinality, foldableExpr, foldableExpr) + addCaseExpr( + benchmark, + cardinality, + "make_interval(*, *, 2, 3, 4, 5, 50.123456)", + s"make_interval(${ymExprs.mkString(",")}, 2, 3, 4, 5, 50.123456)") + addCaseExpr( + benchmark, + cardinality, + "make_interval(0, 1, *, *, 4, 5, 50.123456)", + s"make_interval(0, 1, ${wdExpr.mkString(",")}, 4, 5, 50.123456)") + addCaseExpr( + benchmark, + cardinality, + "make_interval(0, 1, 2, 3, *, *, *)", + s"make_interval(0, 1, 2, 3, ${hmsExprs.mkString(",")})") + addCaseExpr( + benchmark, + cardinality, + "make_interval(*, *, *, *, *, *, *)", + s"make_interval(${args.mkString(",")})") + + benchmark.run() + } + + override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { + benchmarkIntervalStringParsing(1000000) + benchmarkMakeInterval(1000000) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/JoinBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/JoinBenchmark.scala index 1cc92892fe122..849c41307245e 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/JoinBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/JoinBenchmark.scala @@ -17,8 +17,6 @@ package org.apache.spark.sql.execution.benchmark -import org.scalatest.Assertions._ - import org.apache.spark.sql.execution.joins._ import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf @@ -29,7 +27,8 @@ import org.apache.spark.sql.types.IntegerType * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " @@ -166,6 +165,19 @@ object JoinBenchmark extends SqlBasedBenchmark { } } + def broadcastNestedLoopJoin(): Unit = { + val N = 20 << 20 + val M = 1 << 4 + + val dim = broadcast(spark.range(M).selectExpr("id as k", "cast(id as string) as v")) + codegenBenchmark("broadcast nested loop join", N) { + val df = spark.range(N).join(dim) + assert(df.queryExecution.sparkPlan.find( + _.isInstanceOf[BroadcastNestedLoopJoinExec]).isDefined) + df.noop() + } + } + override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { runBenchmark("Join Benchmark") { broadcastHashJoinLongKey() @@ -178,6 +190,7 @@ object JoinBenchmark extends SqlBasedBenchmark { sortMergeJoin() sortMergeJoinWithDuplicates() shuffleHashJoin() + broadcastNestedLoopJoin() } } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/MakeDateTimeBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/MakeDateTimeBenchmark.scala index c92098c93aa1e..6ab4fcc9c00fe 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/MakeDateTimeBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/MakeDateTimeBenchmark.scala @@ -25,7 +25,8 @@ import org.apache.spark.sql.internal.SQLConf * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/MiscBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/MiscBenchmark.scala index 2aecf553d75a2..18605468adba7 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/MiscBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/MiscBenchmark.scala @@ -24,7 +24,9 @@ import org.apache.spark.sql.internal.SQLConf * Benchmark to measure whole stage codegen performance. * To run this benchmark: * {{{ - * 1. without sbt: bin/spark-submit --class + * 1. without sbt: + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/MiscBenchmark-results.txt". diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/OrcNestedSchemaPruningBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/OrcNestedSchemaPruningBenchmark.scala index eeb2605c47c20..a59da45f1fe17 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/OrcNestedSchemaPruningBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/OrcNestedSchemaPruningBenchmark.scala @@ -24,7 +24,8 @@ import org.apache.spark.sql.internal.SQLConf * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/OrcV2NestedSchemaPruningBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/OrcV2NestedSchemaPruningBenchmark.scala index e735d1cf257d0..d0289df380d98 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/OrcV2NestedSchemaPruningBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/OrcV2NestedSchemaPruningBenchmark.scala @@ -22,7 +22,8 @@ package org.apache.spark.sql.execution.benchmark * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ParquetNestedPredicatePushDownBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ParquetNestedPredicatePushDownBenchmark.scala index d2bd962b50654..5604f6856b042 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ParquetNestedPredicatePushDownBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ParquetNestedPredicatePushDownBenchmark.scala @@ -17,9 +17,8 @@ package org.apache.spark.sql.execution.benchmark -import org.apache.spark.SparkConf import org.apache.spark.benchmark.Benchmark -import org.apache.spark.sql.{DataFrame, SaveMode, SparkSession} +import org.apache.spark.sql.{DataFrame, SaveMode} import org.apache.spark.sql.internal.SQLConf /** @@ -27,7 +26,8 @@ import org.apache.spark.sql.internal.SQLConf * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ParquetNestedSchemaPruningBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ParquetNestedSchemaPruningBenchmark.scala index 1c9cc2c371176..f8f0ab10b24ef 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ParquetNestedSchemaPruningBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/ParquetNestedSchemaPruningBenchmark.scala @@ -22,7 +22,8 @@ package org.apache.spark.sql.execution.benchmark * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/PrimitiveArrayBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/PrimitiveArrayBenchmark.scala index e07921bf3aa74..b09549be167f5 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/PrimitiveArrayBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/PrimitiveArrayBenchmark.scala @@ -23,7 +23,9 @@ import org.apache.spark.sql.SparkSession /** * Benchmark primitive arrays via DataFrame and Dataset program using primitive arrays * To run this benchmark: - * 1. without sbt: bin/spark-submit --class + * 1. without sbt: + * bin/spark-submit --class + * --jars , < spark sql test jar> * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/PrimitiveArrayBenchmark-results.txt". diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/RangeBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/RangeBenchmark.scala index e566f5d5adee6..e9bdff5853a51 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/RangeBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/RangeBenchmark.scala @@ -24,7 +24,8 @@ import org.apache.spark.benchmark.Benchmark * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/RangeBenchmark-results.txt". diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/SortBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/SortBenchmark.scala index 2c9e8a909633c..8b8710d96b5ce 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/SortBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/SortBenchmark.scala @@ -30,7 +30,8 @@ import org.apache.spark.util.random.XORShiftRandom * Benchmark to measure performance for aggregate primitives. * {{{ * To run this benchmark: - * 1. without sbt: bin/spark-submit --class + * 1. without sbt: + * bin/spark-submit --class --jars * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/-results.txt". diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/SqlBasedBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/SqlBasedBenchmark.scala index 28387dcef125b..f84172278bef6 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/SqlBasedBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/SqlBasedBenchmark.scala @@ -22,7 +22,9 @@ import org.apache.spark.internal.config.UI.UI_ENABLED import org.apache.spark.sql.{Dataset, SparkSession} import org.apache.spark.sql.SaveMode.Overwrite import org.apache.spark.sql.catalyst.plans.SQLHelper +import org.apache.spark.sql.functions.lit import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.types._ /** * Common base trait to run benchmark with the Dataset and DataFrame API. @@ -66,4 +68,29 @@ trait SqlBasedBenchmark extends BenchmarkBase with SQLHelper { ds.write.format("noop").mode(Overwrite).save() } } + + protected def prepareDataInfo(benchmark: Benchmark): Unit = { + // scalastyle:off println + benchmark.out.println("Preparing data for benchmarking ...") + // scalastyle:on println + } + + /** + * Prepares a table with wide row for benchmarking. The table will be written into + * the given path. + */ + protected def writeWideRow(path: String, rowsNum: Int, numCols: Int): StructType = { + val fields = Seq.tabulate(numCols)(i => StructField(s"col$i", IntegerType)) + val schema = StructType(fields) + + spark.range(rowsNum) + .select(Seq.tabulate(numCols)(i => lit(i).as(s"col$i")): _*) + .write.json(path) + + schema + } + + override def afterAll(): Unit = { + spark.stop() + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/TPCDSQueryBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/TPCDSQueryBenchmark.scala index ad3d79760adf0..90d3f96f8b0f5 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/TPCDSQueryBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/TPCDSQueryBenchmark.scala @@ -17,6 +17,8 @@ package org.apache.spark.sql.execution.benchmark +import scala.util.Try + import org.apache.spark.SparkConf import org.apache.spark.benchmark.Benchmark import org.apache.spark.internal.Logging @@ -24,21 +26,24 @@ import org.apache.spark.sql.SparkSession import org.apache.spark.sql.catalyst.catalog.HiveTableRelation import org.apache.spark.sql.catalyst.plans.logical.SubqueryAlias import org.apache.spark.sql.catalyst.util._ +import org.apache.spark.sql.catalyst.util.DateTimeConstants.NANOS_PER_SECOND import org.apache.spark.sql.execution.datasources.LogicalRelation +import org.apache.spark.sql.internal.SQLConf /** * Benchmark to measure TPCDS query performance. * To run this: * {{{ * 1. without sbt: - * bin/spark-submit --class --data-location + * bin/spark-submit --jars , + * --class --data-location * 2. build/sbt "sql/test:runMain --data-location " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt * "sql/test:runMain --data-location " * Results will be written to "benchmarks/TPCDSQueryBenchmark-results.txt". * }}} */ -object TPCDSQueryBenchmark extends SqlBasedBenchmark { +object TPCDSQueryBenchmark extends SqlBasedBenchmark with Logging { override def getSparkSession: SparkSession = { val conf = new SparkConf() @@ -60,9 +65,20 @@ object TPCDSQueryBenchmark extends SqlBasedBenchmark { "web_returns", "web_site", "reason", "call_center", "warehouse", "ship_mode", "income_band", "time_dim", "web_page") - def setupTables(dataLocation: String): Map[String, Long] = { + def setupTables(dataLocation: String, createTempView: Boolean): Map[String, Long] = { tables.map { tableName => - spark.read.parquet(s"$dataLocation/$tableName").createOrReplaceTempView(tableName) + if (createTempView) { + spark.read.parquet(s"$dataLocation/$tableName").createOrReplaceTempView(tableName) + } else { + spark.sql(s"DROP TABLE IF EXISTS $tableName") + spark.catalog.createTable(tableName, s"$dataLocation/$tableName", "parquet") + // Recover partitions but don't fail if a table is not partitioned. + Try { + spark.sql(s"ALTER TABLE $tableName RECOVER PARTITIONS") + }.getOrElse { + logInfo(s"Recovering partitions of table $tableName failed") + } + } tableName -> spark.table(tableName).count() }.toMap } @@ -97,11 +113,16 @@ object TPCDSQueryBenchmark extends SqlBasedBenchmark { } } - def filterQueries( + private def filterQueries( origQueries: Seq[String], - args: TPCDSQueryBenchmarkArguments): Seq[String] = { - if (args.queryFilter.nonEmpty) { - origQueries.filter(args.queryFilter.contains) + queryFilter: Set[String], + nameSuffix: String = ""): Seq[String] = { + if (queryFilter.nonEmpty) { + if (nameSuffix.nonEmpty) { + origQueries.filter { name => queryFilter.contains(s"$name$nameSuffix") } + } else { + origQueries.filter(queryFilter.contains) + } } else { origQueries } @@ -124,6 +145,7 @@ object TPCDSQueryBenchmark extends SqlBasedBenchmark { "q91", "q92", "q93", "q94", "q95", "q96", "q97", "q98", "q99") // This list only includes TPC-DS v2.7 queries that are different from v1.4 ones + val nameSuffixForQueriesV2_7 = "-v2.7" val tpcdsQueriesV2_7 = Seq( "q5a", "q6", "q10a", "q11", "q12", "q14", "q14a", "q18a", "q20", "q22", "q22a", "q24", "q27a", "q34", "q35", "q35a", "q36a", "q47", "q49", @@ -131,17 +153,36 @@ object TPCDSQueryBenchmark extends SqlBasedBenchmark { "q80a", "q86a", "q98") // If `--query-filter` defined, filters the queries that this option selects - val queriesV1_4ToRun = filterQueries(tpcdsQueries, benchmarkArgs) - val queriesV2_7ToRun = filterQueries(tpcdsQueriesV2_7, benchmarkArgs) + val queriesV1_4ToRun = filterQueries(tpcdsQueries, benchmarkArgs.queryFilter) + val queriesV2_7ToRun = filterQueries(tpcdsQueriesV2_7, benchmarkArgs.queryFilter, + nameSuffix = nameSuffixForQueriesV2_7) if ((queriesV1_4ToRun ++ queriesV2_7ToRun).isEmpty) { throw new RuntimeException( s"Empty queries to run. Bad query name filter: ${benchmarkArgs.queryFilter}") } - val tableSizes = setupTables(benchmarkArgs.dataLocation) + val tableSizes = setupTables(benchmarkArgs.dataLocation, + createTempView = !benchmarkArgs.cboEnabled) + if (benchmarkArgs.cboEnabled) { + spark.sql(s"SET ${SQLConf.CBO_ENABLED.key}=true") + spark.sql(s"SET ${SQLConf.PLAN_STATS_ENABLED.key}=true") + spark.sql(s"SET ${SQLConf.JOIN_REORDER_ENABLED.key}=true") + spark.sql(s"SET ${SQLConf.HISTOGRAM_ENABLED.key}=true") + + // Analyze all the tables before running TPCDS queries + val startTime = System.nanoTime() + tables.foreach { tableName => + spark.sql(s"ANALYZE TABLE $tableName COMPUTE STATISTICS FOR ALL COLUMNS") + } + logInfo("The elapsed time to analyze all the tables is " + + s"${(System.nanoTime() - startTime) / NANOS_PER_SECOND.toDouble} seconds") + } else { + spark.sql(s"SET ${SQLConf.CBO_ENABLED.key}=false") + } + runTpcdsQueries(queryLocation = "tpcds", queries = queriesV1_4ToRun, tableSizes) runTpcdsQueries(queryLocation = "tpcds-v2.7.0", queries = queriesV2_7ToRun, tableSizes, - nameSuffix = "-v2.7") + nameSuffix = nameSuffixForQueriesV2_7) } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/TPCDSQueryBenchmarkArguments.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/TPCDSQueryBenchmarkArguments.scala index 184ffff94298a..80a6bffc61ea4 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/TPCDSQueryBenchmarkArguments.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/TPCDSQueryBenchmarkArguments.scala @@ -23,6 +23,7 @@ import java.util.Locale class TPCDSQueryBenchmarkArguments(val args: Array[String]) { var dataLocation: String = null var queryFilter: Set[String] = Set.empty + var cboEnabled: Boolean = false parseArgs(args.toList) validateArguments() @@ -44,6 +45,10 @@ class TPCDSQueryBenchmarkArguments(val args: Array[String]) { queryFilter = value.toLowerCase(Locale.ROOT).split(",").map(_.trim).toSet args = tail + case optName :: tail if optionMatch("--cbo", optName) => + cboEnabled = true + args = tail + case _ => // scalastyle:off println System.err.println("Unknown/unsupported param " + args) @@ -60,6 +65,7 @@ class TPCDSQueryBenchmarkArguments(val args: Array[String]) { |Options: | --data-location Path to TPCDS data | --query-filter Queries to filter, e.g., q3,q5,q13 + | --cbo Whether to enable cost-based optimization | |------------------------------------------------------------------------------------------------------------------ |In order to run this benchmark, please follow the instructions at diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/UDFBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/UDFBenchmark.scala index ee8a6e787c36c..34e51efc1f796 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/UDFBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/UDFBenchmark.scala @@ -28,7 +28,8 @@ import org.apache.spark.sql.types.{IntegerType, StringType} * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/UnsafeArrayDataBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/UnsafeArrayDataBenchmark.scala index 9b0389c6d1ea4..67eb20c42a9ef 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/UnsafeArrayDataBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/UnsafeArrayDataBenchmark.scala @@ -27,7 +27,8 @@ import org.apache.spark.sql.catalyst.expressions.UnsafeArrayData * Benchmark [[UnsafeArrayDataBenchmark]] for UnsafeArrayData * To run this benchmark: * {{{ - * 1. without sbt: bin/spark-submit --class + * 1. without sbt: + * bin/spark-submit --class --jars * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/UnsafeArrayDataBenchmark-results.txt". diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/WideSchemaBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/WideSchemaBenchmark.scala index 77dc3a10f8033..c209a6da3a3d5 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/WideSchemaBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/benchmark/WideSchemaBenchmark.scala @@ -19,8 +19,6 @@ package org.apache.spark.sql.execution.benchmark import java.io.File -import org.scalatest.Assertions._ - import org.apache.spark.benchmark.Benchmark import org.apache.spark.sql.DataFrame import org.apache.spark.util.Utils @@ -30,7 +28,8 @@ import org.apache.spark.util.Utils * To run this benchmark: * {{{ * 1. without sbt: - * bin/spark-submit --class --jars + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/WideSchemaBenchmark-results.txt". diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/bucketing/CoalesceBucketsInJoinSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/bucketing/CoalesceBucketsInJoinSuite.scala new file mode 100644 index 0000000000000..63964665fc81c --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/bucketing/CoalesceBucketsInJoinSuite.scala @@ -0,0 +1,272 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.bucketing + +import org.apache.spark.sql.catalyst.catalog.BucketSpec +import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference} +import org.apache.spark.sql.catalyst.optimizer.{BuildLeft, BuildRight, BuildSide} +import org.apache.spark.sql.catalyst.plans.Inner +import org.apache.spark.sql.execution.{BinaryExecNode, FileSourceScanExec, SparkPlan} +import org.apache.spark.sql.execution.datasources.{HadoopFsRelation, InMemoryFileIndex, PartitionSpec} +import org.apache.spark.sql.execution.datasources.parquet.ParquetFileFormat +import org.apache.spark.sql.execution.joins.{BroadcastHashJoinExec, ShuffledHashJoinExec, SortMergeJoinExec} +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.{SharedSparkSession, SQLTestUtils} +import org.apache.spark.sql.types.{IntegerType, StructType} + +class CoalesceBucketsInJoinSuite extends SQLTestUtils with SharedSparkSession { + private val SORT_MERGE_JOIN = "sortMergeJoin" + private val SHUFFLED_HASH_JOIN = "shuffledHashJoin" + private val BROADCAST_HASH_JOIN = "broadcastHashJoin" + + case class RelationSetting( + cols: Seq[Attribute], + numBuckets: Int, + expectedCoalescedNumBuckets: Option[Int]) + + object RelationSetting { + def apply(numBuckets: Int, expectedCoalescedNumBuckets: Option[Int]): RelationSetting = { + val cols = Seq(AttributeReference("i", IntegerType)()) + RelationSetting(cols, numBuckets, expectedCoalescedNumBuckets) + } + } + + case class JoinSetting( + leftKeys: Seq[Attribute], + rightKeys: Seq[Attribute], + leftRelation: RelationSetting, + rightRelation: RelationSetting, + joinOperator: String, + shjBuildSide: Option[BuildSide]) + + object JoinSetting { + def apply( + l: RelationSetting, + r: RelationSetting, + joinOperator: String = SORT_MERGE_JOIN, + shjBuildSide: Option[BuildSide] = None): JoinSetting = { + JoinSetting(l.cols, r.cols, l, r, joinOperator, shjBuildSide) + } + } + + private def newFileSourceScanExec(setting: RelationSetting): FileSourceScanExec = { + val relation = HadoopFsRelation( + location = new InMemoryFileIndex(spark, Nil, Map.empty, None), + partitionSchema = PartitionSpec.emptySpec.partitionColumns, + dataSchema = StructType.fromAttributes(setting.cols), + bucketSpec = Some(BucketSpec(setting.numBuckets, setting.cols.map(_.name), Nil)), + fileFormat = new ParquetFileFormat(), + options = Map.empty)(spark) + FileSourceScanExec(relation, setting.cols, relation.dataSchema, Nil, None, None, Nil, None) + } + + private def run(setting: JoinSetting): Unit = { + val swappedSetting = setting.copy( + leftKeys = setting.rightKeys, + rightKeys = setting.leftKeys, + leftRelation = setting.rightRelation, + rightRelation = setting.leftRelation) + + val settings = if (setting.joinOperator != SHUFFLED_HASH_JOIN) { + Seq(setting, swappedSetting) + } else { + Seq(setting) + } + settings.foreach { s => + val lScan = newFileSourceScanExec(s.leftRelation) + val rScan = newFileSourceScanExec(s.rightRelation) + val join = if (s.joinOperator == SORT_MERGE_JOIN) { + SortMergeJoinExec(s.leftKeys, s.rightKeys, Inner, None, lScan, rScan) + } else if (s.joinOperator == SHUFFLED_HASH_JOIN) { + ShuffledHashJoinExec(s.leftKeys, s.rightKeys, Inner, s.shjBuildSide.get, None, lScan, rScan) + } else { + BroadcastHashJoinExec( + s.leftKeys, s.rightKeys, Inner, BuildLeft, None, lScan, rScan) + } + + val plan = CoalesceBucketsInJoin(join) + + def verify(expected: Option[Int], subPlan: SparkPlan): Unit = { + val coalesced = subPlan.collect { + case f: FileSourceScanExec if f.optionalNumCoalescedBuckets.nonEmpty => + f.optionalNumCoalescedBuckets.get + } + if (expected.isDefined) { + assert(coalesced.size == 1 && coalesced.head == expected.get) + } else { + assert(coalesced.isEmpty) + } + } + + verify(s.leftRelation.expectedCoalescedNumBuckets, plan.asInstanceOf[BinaryExecNode].left) + verify(s.rightRelation.expectedCoalescedNumBuckets, plan.asInstanceOf[BinaryExecNode].right) + } + } + + test("bucket coalescing - basic") { + withSQLConf(SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "true") { + run(JoinSetting( + RelationSetting(4, None), RelationSetting(8, Some(4)), joinOperator = SORT_MERGE_JOIN)) + run(JoinSetting( + RelationSetting(4, None), RelationSetting(8, Some(4)), joinOperator = SHUFFLED_HASH_JOIN, + shjBuildSide = Some(BuildLeft))) + } + + withSQLConf(SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "false") { + run(JoinSetting( + RelationSetting(4, None), RelationSetting(8, None), joinOperator = SORT_MERGE_JOIN)) + run(JoinSetting( + RelationSetting(4, None), RelationSetting(8, None), joinOperator = SHUFFLED_HASH_JOIN, + shjBuildSide = Some(BuildLeft))) + } + } + + test("bucket coalescing should work only for sort merge join and shuffled hash join") { + Seq(true, false).foreach { enabled => + withSQLConf(SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> enabled.toString) { + run(JoinSetting( + RelationSetting(4, None), RelationSetting(8, None), joinOperator = BROADCAST_HASH_JOIN)) + } + } + } + + test("bucket coalescing shouldn't be applied to shuffled hash join build side") { + withSQLConf(SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "true") { + run(JoinSetting( + RelationSetting(4, None), RelationSetting(8, None), joinOperator = SHUFFLED_HASH_JOIN, + shjBuildSide = Some(BuildRight))) + } + } + + test("bucket coalescing shouldn't be applied when the number of buckets are the same") { + withSQLConf(SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "true") { + run(JoinSetting( + RelationSetting(8, None), RelationSetting(8, None), joinOperator = SORT_MERGE_JOIN)) + run(JoinSetting( + RelationSetting(8, None), RelationSetting(8, None), joinOperator = SHUFFLED_HASH_JOIN, + shjBuildSide = Some(BuildLeft))) + } + } + + test("number of bucket is not divisible by other number of bucket") { + withSQLConf(SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "true") { + run(JoinSetting( + RelationSetting(3, None), RelationSetting(8, None), joinOperator = SORT_MERGE_JOIN)) + run(JoinSetting( + RelationSetting(3, None), RelationSetting(8, None), joinOperator = SHUFFLED_HASH_JOIN, + shjBuildSide = Some(BuildLeft))) + } + } + + test("the ratio of the number of buckets is greater than max allowed") { + withSQLConf(SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "true", + SQLConf.COALESCE_BUCKETS_IN_JOIN_MAX_BUCKET_RATIO.key -> "2") { + run(JoinSetting( + RelationSetting(4, None), RelationSetting(16, None), joinOperator = SORT_MERGE_JOIN)) + run(JoinSetting( + RelationSetting(4, None), RelationSetting(16, None), joinOperator = SHUFFLED_HASH_JOIN, + shjBuildSide = Some(BuildLeft))) + } + } + + test("join keys should match with output partitioning") { + withSQLConf(SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "true") { + val lCols = Seq( + AttributeReference("l1", IntegerType)(), + AttributeReference("l2", IntegerType)()) + val rCols = Seq( + AttributeReference("r1", IntegerType)(), + AttributeReference("r2", IntegerType)()) + + val lRel = RelationSetting(lCols, 4, None) + val rRel = RelationSetting(rCols, 8, None) + + // The following should not be coalesced because join keys do not match with output + // partitioning (missing one expression). + run(JoinSetting( + leftKeys = Seq(lCols.head), + rightKeys = Seq(rCols.head), + leftRelation = lRel, + rightRelation = rRel, + joinOperator = SORT_MERGE_JOIN, + shjBuildSide = None)) + + run(JoinSetting( + leftKeys = Seq(lCols.head), + rightKeys = Seq(rCols.head), + leftRelation = lRel, + rightRelation = rRel, + joinOperator = SHUFFLED_HASH_JOIN, + shjBuildSide = Some(BuildLeft))) + + // The following should not be coalesced because join keys do not match with output + // partitioning (more expressions). + run(JoinSetting( + leftKeys = lCols :+ AttributeReference("l3", IntegerType)(), + rightKeys = rCols :+ AttributeReference("r3", IntegerType)(), + leftRelation = lRel, + rightRelation = rRel, + joinOperator = SORT_MERGE_JOIN, + shjBuildSide = None)) + + run(JoinSetting( + leftKeys = lCols :+ AttributeReference("l3", IntegerType)(), + rightKeys = rCols :+ AttributeReference("r3", IntegerType)(), + leftRelation = lRel, + rightRelation = rRel, + joinOperator = SHUFFLED_HASH_JOIN, + shjBuildSide = Some(BuildLeft))) + + // The following will be coalesced since ordering should not matter because it will be + // adjusted in `EnsureRequirements`. + run(JoinSetting( + leftKeys = lCols.reverse, + rightKeys = rCols.reverse, + leftRelation = lRel, + rightRelation = RelationSetting(rCols, 8, Some(4)), + joinOperator = SORT_MERGE_JOIN, + shjBuildSide = None)) + + run(JoinSetting( + leftKeys = lCols.reverse, + rightKeys = rCols.reverse, + leftRelation = lRel, + rightRelation = RelationSetting(rCols, 8, Some(4)), + joinOperator = SHUFFLED_HASH_JOIN, + shjBuildSide = Some(BuildLeft))) + + run(JoinSetting( + leftKeys = rCols.reverse, + rightKeys = lCols.reverse, + leftRelation = RelationSetting(rCols, 8, Some(4)), + rightRelation = lRel, + joinOperator = SHUFFLED_HASH_JOIN, + shjBuildSide = Some(BuildRight))) + } + } + + test("FileSourceScanExec's metadata should be updated with coalesced info") { + val scan = newFileSourceScanExec(RelationSetting(8, None)) + val value = scan.metadata("SelectedBucketsCount") + assert(value === "8 out of 8") + + val scanWithCoalescing = scan.copy(optionalNumCoalescedBuckets = Some(4)) + val valueWithCoalescing = scanWithCoalescing.metadata("SelectedBucketsCount") + assert(valueWithCoalescing == "8 out of 8 (Coalesced to 4)") + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/CachedBatchSerializerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/CachedBatchSerializerSuite.scala new file mode 100644 index 0000000000000..099a1aa996c11 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/CachedBatchSerializerSuite.scala @@ -0,0 +1,145 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.columnar + +import org.apache.spark.SparkConf +import org.apache.spark.rdd.RDD +import org.apache.spark.sql.{QueryTest, Row} +import org.apache.spark.sql.catalyst.InternalRow +import org.apache.spark.sql.catalyst.expressions.{Attribute, Expression} +import org.apache.spark.sql.columnar.{CachedBatch, CachedBatchSerializer} +import org.apache.spark.sql.execution.columnar.InMemoryRelation.clearSerializer +import org.apache.spark.sql.execution.vectorized.OnHeapColumnVector +import org.apache.spark.sql.internal.{SQLConf, StaticSQLConf} +import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types.{IntegerType, StructType} +import org.apache.spark.sql.vectorized.{ColumnarBatch, ColumnVector} +import org.apache.spark.storage.StorageLevel + +case class SingleIntCachedBatch(data: Array[Int]) extends CachedBatch { + override def numRows: Int = data.length + override def sizeInBytes: Long = 4 * data.length +} + +/** + * Very simple serializer that only supports a single int column, but does support columnar. + */ +class TestSingleIntColumnarCachedBatchSerializer extends CachedBatchSerializer { + override def supportsColumnarInput(schema: Seq[Attribute]): Boolean = true + + override def convertInternalRowToCachedBatch( + input: RDD[InternalRow], + schema: Seq[Attribute], + storageLevel: StorageLevel, + conf: SQLConf): RDD[CachedBatch] = { + throw new IllegalStateException("This does not work. This is only for testing") + } + + override def convertColumnarBatchToCachedBatch( + input: RDD[ColumnarBatch], + schema: Seq[Attribute], + storageLevel: StorageLevel, + conf: SQLConf): RDD[CachedBatch] = { + if (schema.length != 1 || schema.head.dataType != IntegerType) { + throw new IllegalArgumentException("Only a single column of non-nullable ints works. " + + s"This is for testing $schema") + } + input.map { cb => + val column = cb.column(0) + val data = column.getInts(0, cb.numRows()) + SingleIntCachedBatch(data) + } + } + + override def supportsColumnarOutput(schema: StructType): Boolean = true + override def vectorTypes(attributes: Seq[Attribute], conf: SQLConf): Option[Seq[String]] = + Some(attributes.map(_ => classOf[OnHeapColumnVector].getName)) + + override def convertCachedBatchToColumnarBatch( + input: RDD[CachedBatch], + cacheAttributes: Seq[Attribute], + selectedAttributes: Seq[Attribute], + conf: SQLConf): RDD[ColumnarBatch] = { + if (selectedAttributes.isEmpty) { + input.map { cached => + val single = cached.asInstanceOf[SingleIntCachedBatch] + new ColumnarBatch(new Array[ColumnVector](0), single.numRows) + } + } else { + if (selectedAttributes.length > 1 || + selectedAttributes.head.dataType != IntegerType) { + throw new IllegalArgumentException("Only a single column of non-nullable ints works. " + + s"This is for testing") + } + input.map { cached => + val single = cached.asInstanceOf[SingleIntCachedBatch] + val cv = OnHeapColumnVector.allocateColumns(single.numRows, selectedAttributes.toStructType) + val data = single.data + cv(0).putInts(0, data.length, data, 0) + new ColumnarBatch(cv.toArray, single.numRows) + } + } + } + + override def convertCachedBatchToInternalRow( + input: RDD[CachedBatch], + cacheAttributes: Seq[Attribute], + selectedAttributes: Seq[Attribute], + conf: SQLConf): RDD[InternalRow] = { + throw new IllegalStateException("This does not work. This is only for testing") + } + + override def buildFilter( + predicates: Seq[Expression], + cachedAttributes: Seq[Attribute]): (Int, Iterator[CachedBatch]) => Iterator[CachedBatch] = { + def ret(index: Int, cb: Iterator[CachedBatch]): Iterator[CachedBatch] = cb + ret + } +} + +class CachedBatchSerializerSuite extends QueryTest with SharedSparkSession { + import testImplicits._ + + override protected def sparkConf: SparkConf = { + super.sparkConf.set( + StaticSQLConf.SPARK_CACHE_SERIALIZER.key, + classOf[TestSingleIntColumnarCachedBatchSerializer].getName) + } + + protected override def beforeAll(): Unit = { + super.beforeAll() + clearSerializer() + } + + protected override def afterAll(): Unit = { + clearSerializer() + super.afterAll() + } + + test("Columnar Cache Plugin") { + withTempPath { workDir => + val workDirPath = workDir.getAbsolutePath + val input = Seq(100, 200, 300).toDF("count") + input.write.parquet(workDirPath) + val data = spark.read.parquet(workDirPath) + data.cache() + assert(data.count() == 3) + checkAnswer(data, Row(100) :: Row(200) :: Row(300) :: Nil) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/ColumnStatsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/ColumnStatsSuite.scala index 847e0ec4f3195..0abb3cb6a2ed0 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/ColumnStatsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/ColumnStatsSuite.scala @@ -19,7 +19,6 @@ package org.apache.spark.sql.execution.columnar import org.apache.spark.SparkFunSuite import org.apache.spark.sql.types._ -import org.apache.spark.unsafe.types.CalendarInterval class ColumnStatsSuite extends SparkFunSuite { testColumnStats(classOf[BooleanColumnStats], BOOLEAN, Array(true, false, 0)) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/ColumnTypeSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/ColumnTypeSuite.scala index b25aa6e308657..e6dfc7c99abcc 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/ColumnTypeSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/ColumnTypeSuite.scala @@ -19,6 +19,7 @@ package org.apache.spark.sql.execution.columnar import java.nio.{ByteBuffer, ByteOrder} import java.nio.charset.StandardCharsets +import java.time.{Duration, Period} import org.apache.spark.SparkFunSuite import org.apache.spark.internal.Logging @@ -79,6 +80,8 @@ class ColumnTypeSuite extends SparkFunSuite with Logging { checkActualSize(MAP_TYPE, Map(1 -> "a"), 4 + (8 + 8 + 8 + 8) + (8 + 8 + 8 + 8)) checkActualSize(STRUCT_TYPE, Row("hello"), 28) checkActualSize(CALENDAR_INTERVAL, new CalendarInterval(0, 0, 0), 4 + 4 + 8) + checkActualSize(YEAR_MONTH_INTERVAL, Period.ofMonths(Int.MaxValue).normalized(), 4) + checkActualSize(DAY_TIME_INTERVAL, Duration.ofDays(106751991), 8) } testNativeColumnType(BOOLEAN) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/InMemoryColumnarQuerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/InMemoryColumnarQuerySuite.scala index 18f29f7b90ad5..b8f73f4563ef1 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/InMemoryColumnarQuerySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/InMemoryColumnarQuerySuite.scala @@ -20,18 +20,32 @@ package org.apache.spark.sql.execution.columnar import java.nio.charset.StandardCharsets import java.sql.{Date, Timestamp} +import org.apache.spark.rdd.RDD import org.apache.spark.sql.{DataFrame, QueryTest, Row} -import org.apache.spark.sql.catalyst.expressions.{AttributeReference, AttributeSet, In} -import org.apache.spark.sql.catalyst.plans.logical.LocalRelation +import org.apache.spark.sql.catalyst.InternalRow +import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference, AttributeSet, In} import org.apache.spark.sql.catalyst.plans.physical.HashPartitioning -import org.apache.spark.sql.execution.{ColumnarToRowExec, FilterExec, InputAdapter, LocalTableScanExec, WholeStageCodegenExec} +import org.apache.spark.sql.columnar.CachedBatch +import org.apache.spark.sql.execution.{ColumnarToRowExec, FilterExec, InputAdapter, WholeStageCodegenExec} import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.test.SQLTestData._ import org.apache.spark.sql.types._ +import org.apache.spark.storage.StorageLevel import org.apache.spark.storage.StorageLevel._ -import org.apache.spark.util.Utils + +class TestCachedBatchSerializer( + useCompression: Boolean, + batchSize: Int) extends DefaultCachedBatchSerializer { + + override def convertInternalRowToCachedBatch(input: RDD[InternalRow], + schema: Seq[Attribute], + storageLevel: StorageLevel, + conf: SQLConf): RDD[CachedBatch] = { + convertForCacheInternal(input, schema, batchSize, useCompression) + } +} class InMemoryColumnarQuerySuite extends QueryTest with SharedSparkSession { import testImplicits._ @@ -42,12 +56,12 @@ class InMemoryColumnarQuerySuite extends QueryTest with SharedSparkSession { data.createOrReplaceTempView(s"testData$dataType") val storageLevel = MEMORY_ONLY val plan = spark.sessionState.executePlan(data.logicalPlan).sparkPlan - val inMemoryRelation = InMemoryRelation(useCompression = true, 5, storageLevel, plan, None, - data.logicalPlan) + val inMemoryRelation = InMemoryRelation(new TestCachedBatchSerializer(useCompression = true, 5), + storageLevel, plan, None, data.logicalPlan) assert(inMemoryRelation.cacheBuilder.cachedColumnBuffers.getStorageLevel == storageLevel) inMemoryRelation.cacheBuilder.cachedColumnBuffers.collect().head match { - case _: CachedBatch => + case _: DefaultCachedBatch => case other => fail(s"Unexpected cached batch type: ${other.getClass.getName}") } checkAnswer(inMemoryRelation, data.collect().toSeq) @@ -119,8 +133,8 @@ class InMemoryColumnarQuerySuite extends QueryTest with SharedSparkSession { test("simple columnar query") { val plan = spark.sessionState.executePlan(testData.logicalPlan).sparkPlan - val scan = InMemoryRelation(useCompression = true, 5, MEMORY_ONLY, plan, None, - testData.logicalPlan) + val scan = InMemoryRelation(new TestCachedBatchSerializer(useCompression = true, 5), + MEMORY_ONLY, plan, None, testData.logicalPlan) checkAnswer(scan, testData.collect().toSeq) } @@ -140,8 +154,8 @@ class InMemoryColumnarQuerySuite extends QueryTest with SharedSparkSession { test("projection") { val logicalPlan = testData.select('value, 'key).logicalPlan val plan = spark.sessionState.executePlan(logicalPlan).sparkPlan - val scan = InMemoryRelation(useCompression = true, 5, MEMORY_ONLY, plan, None, - logicalPlan) + val scan = InMemoryRelation(new TestCachedBatchSerializer(useCompression = true, 5), + MEMORY_ONLY, plan, None, logicalPlan) checkAnswer(scan, testData.collect().map { case Row(key: Int, value: String) => value -> key @@ -157,8 +171,8 @@ class InMemoryColumnarQuerySuite extends QueryTest with SharedSparkSession { test("SPARK-1436 regression: in-memory columns must be able to be accessed multiple times") { val plan = spark.sessionState.executePlan(testData.logicalPlan).sparkPlan - val scan = InMemoryRelation(useCompression = true, 5, MEMORY_ONLY, plan, None, - testData.logicalPlan) + val scan = InMemoryRelation(new TestCachedBatchSerializer(useCompression = true, 5), + MEMORY_ONLY, plan, None, testData.logicalPlan) checkAnswer(scan, testData.collect().toSeq) checkAnswer(scan, testData.collect().toSeq) @@ -336,7 +350,8 @@ class InMemoryColumnarQuerySuite extends QueryTest with SharedSparkSession { test("SPARK-17549: cached table size should be correctly calculated") { val data = spark.sparkContext.parallelize(1 to 10, 5).toDF() val plan = spark.sessionState.executePlan(data.logicalPlan).sparkPlan - val cached = InMemoryRelation(true, 5, MEMORY_ONLY, plan, None, data.logicalPlan) + val cached = InMemoryRelation(new TestCachedBatchSerializer(true, 5), + MEMORY_ONLY, plan, None, data.logicalPlan) // Materialize the data. val expectedAnswer = data.collect() @@ -349,7 +364,8 @@ class InMemoryColumnarQuerySuite extends QueryTest with SharedSparkSession { test("cached row count should be calculated") { val data = spark.range(6).toDF val plan = spark.sessionState.executePlan(data.logicalPlan).sparkPlan - val cached = InMemoryRelation(true, 5, MEMORY_ONLY, plan, None, data.logicalPlan) + val cached = InMemoryRelation(new TestCachedBatchSerializer(true, 5), + MEMORY_ONLY, plan, None, data.logicalPlan) // Materialize the data. val expectedAnswer = data.collect() @@ -474,12 +490,8 @@ class InMemoryColumnarQuerySuite extends QueryTest with SharedSparkSession { test("SPARK-22249: buildFilter should not throw exception when In contains an empty list") { val attribute = AttributeReference("a", IntegerType)() - val localTableScanExec = LocalTableScanExec(Seq(attribute), Nil) - val testRelation = InMemoryRelation(false, 1, MEMORY_ONLY, localTableScanExec, None, - LocalRelation(Seq(attribute), Nil)) - val tableScanExec = InMemoryTableScanExec(Seq(attribute), - Seq(In(attribute, Nil)), testRelation) - assert(tableScanExec.partitionFilters.isEmpty) + val testSerializer = new TestCachedBatchSerializer(false, 1) + testSerializer.buildFilter(Seq(In(attribute, Nil)), Seq(attribute)) } testWithWholeStageCodegenOnAndOff("SPARK-22348: table cache " + diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/compression/BooleanBitSetSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/compression/BooleanBitSetSuite.scala index 192db0e910d03..111a620df8c24 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/compression/BooleanBitSetSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/compression/BooleanBitSetSuite.scala @@ -156,4 +156,30 @@ class BooleanBitSetSuite extends SparkFunSuite { test(s"$BooleanBitSet: multiple words and 1 more bit for decompression()") { skeletonForDecompress(BITS_PER_LONG * 2 + 1) } + + test(s"$BooleanBitSet: Only nulls for decompression()") { + val builder = TestCompressibleColumnBuilder(new NoopColumnStats, BOOLEAN, BooleanBitSet) + val numRows = 10 + + val rows = Seq.fill[InternalRow](numRows)({ + val row = new GenericInternalRow(1) + row.setNullAt(0) + row + }) + rows.foreach(builder.appendFrom(_, 0)) + val buffer = builder.build() + + // Rewinds, skips column header and 4 more bytes for compression scheme ID + val headerSize = CompressionScheme.columnHeaderSize(buffer) + buffer.position(headerSize) + assertResult(BooleanBitSet.typeId, "Wrong compression scheme ID")(buffer.getInt()) + + val decoder = BooleanBitSet.decoder(buffer, BOOLEAN) + val columnVector = new OnHeapColumnVector(numRows, BooleanType) + decoder.decompress(columnVector, numRows) + + (0 until numRows).foreach { rowNum => + assert(columnVector.isNullAt(rowNum)) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/compression/CompressionSchemeBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/compression/CompressionSchemeBenchmark.scala index fcb18392235c3..cad7f7a11211b 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/compression/CompressionSchemeBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/compression/CompressionSchemeBenchmark.scala @@ -22,7 +22,6 @@ import java.nio.charset.StandardCharsets import org.apache.commons.lang3.RandomStringUtils import org.apache.commons.math3.distribution.LogNormalDistribution -import org.scalatest.Assertions._ import org.apache.spark.benchmark.{Benchmark, BenchmarkBase} import org.apache.spark.sql.catalyst.expressions.GenericInternalRow @@ -34,7 +33,9 @@ import org.apache.spark.util.Utils._ * Benchmark to decoders using various compression schemes. * To run this benchmark: * {{{ - * 1. without sbt: bin/spark-submit --class + * 1. without sbt: + * bin/spark-submit --class + * --jars , * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/CompressionSchemeBenchmark-results.txt". diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/compression/PassThroughEncodingSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/compression/PassThroughEncodingSuite.scala index f946a6779ec95..c6fe64d1058ab 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/compression/PassThroughEncodingSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/columnar/compression/PassThroughEncodingSuite.scala @@ -46,7 +46,7 @@ class PassThroughSuite extends SparkFunSuite { val builder = TestCompressibleColumnBuilder(columnStats, columnType, PassThrough) - input.map { value => + input.foreach { value => val row = new GenericInternalRow(1) columnType.setField(row, 0, value) builder.appendFrom(row, 0) @@ -98,7 +98,7 @@ class PassThroughSuite extends SparkFunSuite { val row = new GenericInternalRow(1) val nullRow = new GenericInternalRow(1) nullRow.setNullAt(0) - input.map { value => + input.foreach { value => if (value == nullValue) { builder.appendFrom(nullRow, 0) } else { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableAddPartitionParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableAddPartitionParserSuite.scala new file mode 100644 index 0000000000000..1694c73b10f2c --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableAddPartitionParserSuite.scala @@ -0,0 +1,57 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedPartitionSpec, UnresolvedTable} +import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parsePlan +import org.apache.spark.sql.catalyst.plans.logical.AddPartitions +import org.apache.spark.sql.test.SharedSparkSession + +class AlterTableAddPartitionParserSuite extends AnalysisTest with SharedSparkSession { + test("add partition if not exists") { + val sql = """ + |ALTER TABLE a.b.c ADD IF NOT EXISTS PARTITION + |(dt='2008-08-08', country='us') LOCATION 'location1' PARTITION + |(dt='2009-09-09', country='uk')""".stripMargin + val parsed = parsePlan(sql) + val expected = AddPartitions( + UnresolvedTable( + Seq("a", "b", "c"), + "ALTER TABLE ... ADD PARTITION ...", + Some("Please use ALTER VIEW instead.")), + Seq( + UnresolvedPartitionSpec(Map("dt" -> "2008-08-08", "country" -> "us"), Some("location1")), + UnresolvedPartitionSpec(Map("dt" -> "2009-09-09", "country" -> "uk"), None)), + ifNotExists = true) + comparePlans(parsed, expected) + } + + test("add partition") { + val sql = "ALTER TABLE a.b.c ADD PARTITION (dt='2008-08-08') LOCATION 'loc'" + val parsed = parsePlan(sql) + val expected = AddPartitions( + UnresolvedTable( + Seq("a", "b", "c"), + "ALTER TABLE ... ADD PARTITION ...", + Some("Please use ALTER VIEW instead.")), + Seq(UnresolvedPartitionSpec(Map("dt" -> "2008-08-08"), Some("loc"))), + ifNotExists = false) + + comparePlans(parsed, expected) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableAddPartitionSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableAddPartitionSuiteBase.scala new file mode 100644 index 0000000000000..e2e15917d7ea7 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableAddPartitionSuiteBase.scala @@ -0,0 +1,192 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.{AnalysisException, QueryTest} +import org.apache.spark.sql.catalyst.analysis.PartitionsAlreadyExistException +import org.apache.spark.sql.internal.SQLConf + +/** + * This base suite contains unified tests for the `ALTER TABLE .. ADD PARTITION` command that + * check V1 and V2 table catalogs. The tests that cannot run for all supported catalogs are + * located in more specific test suites: + * + * - V2 table catalog tests: + * `org.apache.spark.sql.execution.command.v2.AlterTableAddPartitionSuite` + * - V1 table catalog tests: + * `org.apache.spark.sql.execution.command.v1.AlterTableAddPartitionSuiteBase` + * - V1 In-Memory catalog: + * `org.apache.spark.sql.execution.command.v1.AlterTableAddPartitionSuite` + * - V1 Hive External catalog: + * `org.apache.spark.sql.hive.execution.command.AlterTableAddPartitionSuite` + */ +trait AlterTableAddPartitionSuiteBase extends QueryTest with DDLCommandTestUtils { + override val command = "ALTER TABLE .. ADD PARTITION" + + test("one partition") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)") + Seq("", "IF NOT EXISTS").foreach { exists => + sql(s"ALTER TABLE $t ADD $exists PARTITION (id=1) LOCATION 'loc'") + + checkPartitions(t, Map("id" -> "1")) + checkLocation(t, Map("id" -> "1"), "loc") + } + } + } + + test("multiple partitions") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)") + Seq("", "IF NOT EXISTS").foreach { exists => + sql(s""" + |ALTER TABLE $t ADD $exists + |PARTITION (id=1) LOCATION 'loc' + |PARTITION (id=2) LOCATION 'loc1'""".stripMargin) + + checkPartitions(t, Map("id" -> "1"), Map("id" -> "2")) + checkLocation(t, Map("id" -> "1"), "loc") + checkLocation(t, Map("id" -> "2"), "loc1") + } + } + } + + test("multi-part partition") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id bigint, a int, b string) $defaultUsing PARTITIONED BY (a, b)") + Seq("", "IF NOT EXISTS").foreach { exists => + sql(s"ALTER TABLE $t ADD $exists PARTITION (a=2, b='abc')") + + checkPartitions(t, Map("a" -> "2", "b" -> "abc")) + } + } + } + + test("table to alter does not exist") { + withNamespaceAndTable("ns", "does_not_exist") { t => + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $t ADD IF NOT EXISTS PARTITION (a='4', b='9')") + }.getMessage + assert(errMsg.contains("Table not found")) + } + } + + test("case sensitivity in resolving partition specs") { + withNamespaceAndTable("ns", "tbl") { t => + spark.sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)") + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + val errMsg = intercept[AnalysisException] { + spark.sql(s"ALTER TABLE $t ADD PARTITION (ID=1) LOCATION 'loc1'") + }.getMessage + assert(errMsg.contains("ID is not a valid partition column")) + } + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + spark.sql(s"ALTER TABLE $t ADD PARTITION (ID=1) LOCATION 'loc1'") + checkPartitions(t, Map("id" -> "1")) + checkLocation(t, Map("id" -> "1"), "loc1") + } + } + } + + test("SPARK-33521: universal type conversions of partition values") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s""" + |CREATE TABLE $t ( + | id int, + | part0 tinyint, + | part1 smallint, + | part2 int, + | part3 bigint, + | part4 float, + | part5 double, + | part6 string, + | part7 boolean, + | part8 date, + | part9 timestamp + |) $defaultUsing + |PARTITIONED BY (part0, part1, part2, part3, part4, part5, part6, part7, part8, part9) + |""".stripMargin) + val partSpec = """ + | part0 = -1, + | part1 = 0, + | part2 = 1, + | part3 = 2, + | part4 = 3.14, + | part5 = 3.14, + | part6 = 'abc', + | part7 = true, + | part8 = '2020-11-23', + | part9 = '2020-11-23 22:13:10.123456' + |""".stripMargin + sql(s"ALTER TABLE $t ADD PARTITION ($partSpec)") + val expected = Map( + "part0" -> "-1", + "part1" -> "0", + "part2" -> "1", + "part3" -> "2", + "part4" -> "3.14", + "part5" -> "3.14", + "part6" -> "abc", + "part7" -> "true", + "part8" -> "2020-11-23", + "part9" -> "2020-11-23 22:13:10.123456") + checkPartitions(t, expected) + sql(s"ALTER TABLE $t DROP PARTITION ($partSpec)") + checkPartitions(t) // no partitions + } + } + + test("SPARK-33676: not fully specified partition spec") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s""" + |CREATE TABLE $t (id bigint, part0 int, part1 string) + |$defaultUsing + |PARTITIONED BY (part0, part1)""".stripMargin) + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $t ADD PARTITION (part0 = 1)") + }.getMessage + assert(errMsg.contains("Partition spec is invalid. " + + "The spec (part0) must match the partition spec (part0, part1)")) + } + } + + test("partition already exists") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)") + sql(s"ALTER TABLE $t ADD PARTITION (id=2) LOCATION 'loc1'") + + val errMsg = intercept[PartitionsAlreadyExistException] { + sql(s"ALTER TABLE $t ADD PARTITION (id=1) LOCATION 'loc'" + + " PARTITION (id=2) LOCATION 'loc1'") + }.getMessage + assert(errMsg.contains("The following partitions already exists")) + + sql(s"ALTER TABLE $t ADD IF NOT EXISTS PARTITION (id=1) LOCATION 'loc'" + + " PARTITION (id=2) LOCATION 'loc1'") + checkPartitions(t, Map("id" -> "1"), Map("id" -> "2")) + } + } + + test("SPARK-33474: Support typed literals as partition spec values") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t(name STRING, part DATE) USING PARQUET PARTITIONED BY (part)") + sql(s"ALTER TABLE $t ADD PARTITION(part = date'2020-01-01')") + checkPartitions(t, Map("part" ->"2020-01-01")) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableDropPartitionParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableDropPartitionParserSuite.scala new file mode 100644 index 0000000000000..4c60c80f4e054 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableDropPartitionParserSuite.scala @@ -0,0 +1,100 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedPartitionSpec, UnresolvedTable} +import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parsePlan +import org.apache.spark.sql.catalyst.parser.ParseException +import org.apache.spark.sql.catalyst.plans.logical.DropPartitions +import org.apache.spark.sql.test.SharedSparkSession + +class AlterTableDropPartitionParserSuite extends AnalysisTest with SharedSparkSession { + test("drop partition") { + val sql = """ + |ALTER TABLE table_name DROP PARTITION + |(dt='2008-08-08', country='us'), PARTITION (dt='2009-09-09', country='uk') + """.stripMargin + val expected = DropPartitions( + UnresolvedTable( + Seq("table_name"), + "ALTER TABLE ... DROP PARTITION ...", + Some("Please use ALTER VIEW instead.")), + Seq( + UnresolvedPartitionSpec(Map("dt" -> "2008-08-08", "country" -> "us")), + UnresolvedPartitionSpec(Map("dt" -> "2009-09-09", "country" -> "uk"))), + ifExists = false, + purge = false) + + comparePlans(parsePlan(sql), expected) + } + + test("drop partition if exists") { + val sql = """ + |ALTER TABLE table_name DROP IF EXISTS + |PARTITION (dt='2008-08-08', country='us'), + |PARTITION (dt='2009-09-09', country='uk') + """.stripMargin + val expected = DropPartitions( + UnresolvedTable( + Seq("table_name"), + "ALTER TABLE ... DROP PARTITION ...", + Some("Please use ALTER VIEW instead.")), + Seq( + UnresolvedPartitionSpec(Map("dt" -> "2008-08-08", "country" -> "us")), + UnresolvedPartitionSpec(Map("dt" -> "2009-09-09", "country" -> "uk"))), + ifExists = true, + purge = false) + comparePlans(parsePlan(sql), expected) + } + + test("drop partition in a table with multi-part identifier") { + val sql = "ALTER TABLE a.b.c DROP IF EXISTS PARTITION (ds='2017-06-10')" + val expected = DropPartitions( + UnresolvedTable( + Seq("a", "b", "c"), + "ALTER TABLE ... DROP PARTITION ...", + Some("Please use ALTER VIEW instead.")), + Seq(UnresolvedPartitionSpec(Map("ds" -> "2017-06-10"))), + ifExists = true, + purge = false) + + comparePlans(parsePlan(sql), expected) + } + + test("drop partition with PURGE") { + val sql = "ALTER TABLE table_name DROP PARTITION (p=1) PURGE" + val expected = DropPartitions( + UnresolvedTable( + Seq("table_name"), + "ALTER TABLE ... DROP PARTITION ...", + Some("Please use ALTER VIEW instead.")), + Seq(UnresolvedPartitionSpec(Map("p" -> "1"))), + ifExists = false, + purge = true) + + comparePlans(parsePlan(sql), expected) + } + + test("drop partition from view") { + val sql = "ALTER VIEW table_name DROP PARTITION (p=1)" + val errMsg = intercept[ParseException] { + parsePlan(sql) + }.getMessage + assert(errMsg.contains("Operation not allowed")) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableDropPartitionSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableDropPartitionSuiteBase.scala new file mode 100644 index 0000000000000..41ac62ed333aa --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableDropPartitionSuiteBase.scala @@ -0,0 +1,243 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.{AnalysisException, QueryTest, Row} +import org.apache.spark.sql.catalyst.analysis.NoSuchPartitionsException +import org.apache.spark.sql.internal.SQLConf + +/** + * This base suite contains unified tests for the `ALTER TABLE .. DROP PARTITION` command that + * check V1 and V2 table catalogs. The tests that cannot run for all supported catalogs are + * located in more specific test suites: + * + * - V2 table catalog tests: + * `org.apache.spark.sql.execution.command.v2.AlterTableDropPartitionSuite` + * - V1 table catalog tests: + * `org.apache.spark.sql.execution.command.v1.AlterTableDropPartitionSuiteBase` + * - V1 In-Memory catalog: + * `org.apache.spark.sql.execution.command.v1.AlterTableDropPartitionSuite` + * - V1 Hive External catalog: + * `org.apache.spark.sql.hive.execution.command.AlterTableDropPartitionSuite` + */ +trait AlterTableDropPartitionSuiteBase extends QueryTest with DDLCommandTestUtils { + override val command = "ALTER TABLE .. DROP PARTITION" + + protected def notFullPartitionSpecErr: String + protected def nullPartitionValue: String + + protected def checkDropPartition( + t: String, + ifExists: String, + specs: Map[String, Any]*): Unit = { + checkPartitions(t, specs.map(_.mapValues(_.toString).toMap): _*) + val specStr = specs.map(partSpecToString).mkString(", ") + sql(s"ALTER TABLE $t DROP $ifExists $specStr") + checkPartitions(t) + } + + test("single partition") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)") + Seq("", "IF EXISTS").foreach { ifExists => + sql(s"ALTER TABLE $t ADD PARTITION (id=1) LOCATION 'loc'") + checkDropPartition(t, ifExists, Map("id" -> 1)) + } + } + } + + test("multiple partitions") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)") + Seq("", "IF EXISTS").foreach { ifExists => + sql(s""" + |ALTER TABLE $t ADD + |PARTITION (id=1) LOCATION 'loc' + |PARTITION (id=2) LOCATION 'loc1'""".stripMargin) + checkDropPartition(t, ifExists, Map("id" -> 1), Map("id" -> 2)) + } + } + } + + test("multi-part partition") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id bigint, a int, b string) $defaultUsing PARTITIONED BY (a, b)") + Seq("", "IF EXISTS").foreach { ifExists => + sql(s"ALTER TABLE $t ADD PARTITION (a = 2, b = 'abc')") + checkDropPartition(t, ifExists, Map("a" -> 2, "b" -> "abc")) + } + } + } + + test("table to alter does not exist") { + withNamespaceAndTable("ns", "does_not_exist") { t => + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $t DROP PARTITION (a='4', b='9')") + }.getMessage + assert(errMsg.contains("Table not found")) + } + } + + test("case sensitivity in resolving partition specs") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)") + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $t DROP PARTITION (ID=1)") + }.getMessage + assert(errMsg.contains("ID is not a valid partition column")) + } + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + Seq("", "IF EXISTS").foreach { ifExists => + sql(s"ALTER TABLE $t ADD PARTITION (ID=1) LOCATION 'loc1'") + checkDropPartition(t, ifExists, Map("id" -> 1)) + } + } + } + } + + test("SPARK-33676: not fully specified partition spec") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s""" + |CREATE TABLE $t (id bigint, part0 int, part1 string) + |$defaultUsing + |PARTITIONED BY (part0, part1)""".stripMargin) + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $t DROP PARTITION (part0 = 1)") + }.getMessage + assert(errMsg.contains(notFullPartitionSpecErr)) + } + } + + test("partition not exists") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)") + sql(s"ALTER TABLE $t ADD PARTITION (id=1) LOCATION 'loc'") + + val errMsg = intercept[NoSuchPartitionsException] { + sql(s"ALTER TABLE $t DROP PARTITION (id=1), PARTITION (id=2)") + }.getMessage + assert(errMsg.contains("partitions not found in table")) + + checkPartitions(t, Map("id" -> "1")) + sql(s"ALTER TABLE $t DROP IF EXISTS PARTITION (id=1), PARTITION (id=2)") + checkPartitions(t) + } + } + + test("SPARK-33990: don not return data from dropped partition") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1") + QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(0, 0), Row(1, 1))) + sql(s"ALTER TABLE $t DROP PARTITION (part=0)") + QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(1, 1))) + } + } + + test("SPARK-33950, SPARK-33987: refresh cache after partition dropping") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1") + assert(!spark.catalog.isCached(t)) + sql(s"CACHE TABLE $t") + assert(spark.catalog.isCached(t)) + QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(0, 0), Row(1, 1))) + sql(s"ALTER TABLE $t DROP PARTITION (part=0)") + assert(spark.catalog.isCached(t)) + QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(1, 1))) + } + } + + test("SPARK-33591: null as a partition value") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (col1 INT, p1 STRING) $defaultUsing PARTITIONED BY (p1)") + sql(s"ALTER TABLE $t ADD PARTITION (p1 = null)") + checkPartitions(t, Map("p1" -> nullPartitionValue)) + sql(s"ALTER TABLE $t DROP PARTITION (p1 = null)") + checkPartitions(t) + } + } + + test("SPARK-33591, SPARK-34203: insert and drop partitions with null values") { + def insertAndDropNullPart(t: String, insertCmd: String): Unit = { + sql(s"CREATE TABLE $t (col1 INT, p1 STRING) $defaultUsing PARTITIONED BY (p1)") + sql(insertCmd) + checkPartitions(t, Map("p1" -> nullPartitionValue)) + sql(s"ALTER TABLE $t DROP PARTITION (p1 = null)") + checkPartitions(t) + } + + withNamespaceAndTable("ns", "tbl") { t => + insertAndDropNullPart(t, s"INSERT INTO TABLE $t PARTITION (p1 = null) SELECT 0") + } + + withSQLConf("hive.exec.dynamic.partition.mode" -> "nonstrict") { + withNamespaceAndTable("ns", "tbl") { t => + insertAndDropNullPart(t, s"INSERT OVERWRITE TABLE $t VALUES (0, null)") + } + } + } + + test("SPARK-34161, SPARK-34138, SPARK-34099: keep dependents cached after table altering") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1") + sql(s"INSERT INTO $t PARTITION (part=2) SELECT 2") + sql(s"INSERT INTO $t PARTITION (part=3) SELECT 3") + cacheRelation(t) + checkCachedRelation(t, Seq(Row(0, 0), Row(1, 1), Row(2, 2), Row(3, 3))) + + withView("v0") { + sql(s"CREATE VIEW v0 AS SELECT * FROM $t") + cacheRelation("v0") + sql(s"ALTER TABLE $t DROP PARTITION (part=1)") + checkCachedRelation("v0", Seq(Row(0, 0), Row(2, 2), Row(3, 3))) + } + + withTempView("v1") { + sql(s"CREATE TEMP VIEW v1 AS SELECT * FROM $t") + cacheRelation("v1") + sql(s"ALTER TABLE $t DROP PARTITION (part=2)") + checkCachedRelation("v1", Seq(Row(0, 0), Row(3, 3))) + } + + val v2 = s"${spark.sharedState.globalTempViewManager.database}.v2" + withGlobalTempView("v2") { + sql(s"CREATE GLOBAL TEMP VIEW v2 AS SELECT * FROM $t") + cacheRelation(v2) + sql(s"ALTER TABLE $t DROP PARTITION (part=3)") + checkCachedRelation(v2, Seq(Row(0, 0))) + } + } + } + + test("SPARK-33474: Support typed literals as partition spec values") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t(name STRING, part DATE) USING PARQUET PARTITIONED BY (part)") + sql(s"ALTER TABLE $t ADD PARTITION(part = date'2020-01-01')") + checkPartitions(t, Map("part" -> "2020-01-01")) + sql(s"ALTER TABLE $t DROP PARTITION (part = date'2020-01-01')") + checkPartitions(t) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRecoverPartitionsParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRecoverPartitionsParserSuite.scala new file mode 100644 index 0000000000000..ebc1bd3468837 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRecoverPartitionsParserSuite.scala @@ -0,0 +1,74 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedTable} +import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parsePlan +import org.apache.spark.sql.catalyst.parser.ParseException +import org.apache.spark.sql.catalyst.plans.logical.RecoverPartitions +import org.apache.spark.sql.test.SharedSparkSession + +class AlterTableRecoverPartitionsParserSuite extends AnalysisTest with SharedSparkSession { + + test("recover partitions without table") { + val errMsg = intercept[ParseException] { + parsePlan("ALTER TABLE RECOVER PARTITIONS") + }.getMessage + assert(errMsg.contains("no viable alternative at input 'ALTER TABLE RECOVER PARTITIONS'")) + } + + test("recover partitions of a table") { + comparePlans( + parsePlan("ALTER TABLE tbl RECOVER PARTITIONS"), + RecoverPartitions( + UnresolvedTable( + Seq("tbl"), + "ALTER TABLE ... RECOVER PARTITIONS", + Some("Please use ALTER VIEW instead.")))) + } + + test("recover partitions of a table in a database") { + comparePlans( + parsePlan("alter table db.tbl recover partitions"), + RecoverPartitions( + UnresolvedTable( + Seq("db", "tbl"), + "ALTER TABLE ... RECOVER PARTITIONS", + Some("Please use ALTER VIEW instead.")))) + } + + test("recover partitions of a table spark_catalog") { + comparePlans( + parsePlan("alter table spark_catalog.db.TBL recover partitions"), + RecoverPartitions( + UnresolvedTable( + Seq("spark_catalog", "db", "TBL"), + "ALTER TABLE ... RECOVER PARTITIONS", + Some("Please use ALTER VIEW instead.")))) + } + + test("recover partitions of a table in nested namespaces") { + comparePlans( + parsePlan("Alter Table ns1.ns2.ns3.ns4.ns5.ns6.ns7.ns8.t Recover Partitions"), + RecoverPartitions( + UnresolvedTable( + Seq("ns1", "ns2", "ns3", "ns4", "ns5", "ns6", "ns7", "ns8", "t"), + "ALTER TABLE ... RECOVER PARTITIONS", + Some("Please use ALTER VIEW instead.")))) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRecoverPartitionsSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRecoverPartitionsSuiteBase.scala new file mode 100644 index 0000000000000..b33817e84b2e8 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRecoverPartitionsSuiteBase.scala @@ -0,0 +1,40 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.QueryTest + +/** + * This base suite contains unified tests for the `ALTER TABLE .. RECOVER PARTITIONS` command that + * check V1 and V2 table catalogs. The tests that cannot run for all supported catalogs are + * located in more specific test suites: + * + * - V2 table catalog tests: + * `org.apache.spark.sql.execution.command.v2.AlterTableRecoverPartitionsSuite` + * - V1 table catalog tests: + * `org.apache.spark.sql.execution.command.v1.AlterTableRecoverPartitionsSuiteBase` + * - V1 In-Memory catalog (sequential): + * `org.apache.spark.sql.execution.command.v1.AlterTableRecoverPartitionsSuite` + * - V1 In-Memory catalog (parallel): + * `org.apache.spark.sql.execution.command.v1.AlterTableRecoverPartitionsParallelSuite` + * - V1 Hive External catalog: + * `org.apache.spark.sql.hive.execution.command.AlterTableRecoverPartitionsSuite` + */ +trait AlterTableRecoverPartitionsSuiteBase extends QueryTest with DDLCommandTestUtils { + override val command = "ALTER TABLE .. RECOVER PARTITIONS" +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenameParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenameParserSuite.scala new file mode 100644 index 0000000000000..e4087e63797d2 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenameParserSuite.scala @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedTableOrView} +import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parsePlan +import org.apache.spark.sql.catalyst.parser.ParseException +import org.apache.spark.sql.catalyst.plans.logical.RenameTable + +class AlterTableRenameParserSuite extends AnalysisTest { + test("rename table") { + comparePlans( + parsePlan("ALTER TABLE a.b.c RENAME TO x.y.z"), + RenameTable( + UnresolvedTableOrView(Seq("a", "b", "c"), "ALTER TABLE ... RENAME TO", true), + Seq("x", "y", "z"), + isView = false)) + } + + test("case sensitivity") { + comparePlans( + parsePlan("alter Table spark_catalog.ns.tbl RENAME to tbl"), + RenameTable( + UnresolvedTableOrView(Seq("spark_catalog", "ns", "tbl"), "ALTER TABLE ... RENAME TO", true), + Seq("tbl"), + isView = false)) + } + + test("invalid table identifiers") { + Seq( + "ALTER TABLE RENAME TO x.y.z", + "ALTER TABLE _ RENAME TO .z").foreach { renameCmd => + intercept[ParseException] { parsePlan(renameCmd) } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenamePartitionParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenamePartitionParserSuite.scala new file mode 100644 index 0000000000000..4148798d6cdb4 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenamePartitionParserSuite.scala @@ -0,0 +1,57 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedPartitionSpec, UnresolvedTable} +import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parsePlan +import org.apache.spark.sql.catalyst.plans.logical.RenamePartitions +import org.apache.spark.sql.test.SharedSparkSession + +class AlterTableRenamePartitionParserSuite extends AnalysisTest with SharedSparkSession { + test("rename a partition with single part") { + val sql = """ + |ALTER TABLE a.b.c PARTITION (ds='2017-06-10') + |RENAME TO PARTITION (ds='2018-06-10') + """.stripMargin + val parsed = parsePlan(sql) + val expected = RenamePartitions( + UnresolvedTable( + Seq("a", "b", "c"), + "ALTER TABLE ... RENAME TO PARTITION", + Some("Please use ALTER VIEW instead.")), + UnresolvedPartitionSpec(Map("ds" -> "2017-06-10")), + UnresolvedPartitionSpec(Map("ds" -> "2018-06-10"))) + comparePlans(parsed, expected) + } + + test("rename a partition with multi parts") { + val sql = """ + |ALTER TABLE table_name PARTITION (dt='2008-08-08', country='us') + |RENAME TO PARTITION (dt='2008-09-09', country='uk') + """.stripMargin + val parsed = parsePlan(sql) + val expected = RenamePartitions( + UnresolvedTable( + Seq("table_name"), + "ALTER TABLE ... RENAME TO PARTITION", + Some("Please use ALTER VIEW instead.")), + UnresolvedPartitionSpec(Map("dt" -> "2008-08-08", "country" -> "us")), + UnresolvedPartitionSpec(Map("dt" -> "2008-09-09", "country" -> "uk"))) + comparePlans(parsed, expected) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenamePartitionSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenamePartitionSuiteBase.scala new file mode 100644 index 0000000000000..080cd89c4a209 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenamePartitionSuiteBase.scala @@ -0,0 +1,224 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.{AnalysisException, QueryTest, Row} +import org.apache.spark.sql.catalyst.analysis.{NoSuchPartitionException, PartitionAlreadyExistsException} +import org.apache.spark.sql.internal.SQLConf + +/** + * This base suite contains unified tests for the `ALTER TABLE .. RENAME PARTITION` command that + * check V1 and V2 table catalogs. The tests that cannot run for all supported catalogs are + * located in more specific test suites: + * + * - V2 table catalog tests: + * `org.apache.spark.sql.execution.command.v2.AlterTableRenamePartitionSuite` + * - V1 table catalog tests: + * `org.apache.spark.sql.execution.command.v1.AlterTableRenamePartitionSuiteBase` + * - V1 In-Memory catalog: + * `org.apache.spark.sql.execution.command.v1.AlterTableRenamePartitionSuite` + * - V1 Hive External catalog: + * `org.apache.spark.sql.hive.execution.command.AlterTableRenamePartitionSuite` + */ +trait AlterTableRenamePartitionSuiteBase extends QueryTest with DDLCommandTestUtils { + override val command = "ALTER TABLE .. RENAME PARTITION" + + protected def createSinglePartTable(t: String): Unit = { + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)") + sql(s"INSERT INTO $t PARTITION (id = 1) SELECT 'abc'") + } + + test("rename without explicitly specifying database") { + withSQLConf(SQLConf.DEFAULT_CATALOG.key -> catalog) { + createSinglePartTable("t") + checkPartitions("t", Map("id" -> "1")) + + sql(s"ALTER TABLE t PARTITION (id = 1) RENAME TO PARTITION (id = 2)") + checkPartitions("t", Map("id" -> "2")) + checkAnswer(sql(s"SELECT id, data FROM t"), Row(2, "abc")) + } + } + + test("table to alter does not exist") { + withNamespace(s"$catalog.ns") { + sql(s"CREATE NAMESPACE $catalog.ns") + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $catalog.ns.no_tbl PARTITION (id=1) RENAME TO PARTITION (id=2)") + }.getMessage + assert(errMsg.contains("Table not found")) + } + } + + test("partition to rename does not exist") { + withNamespaceAndTable("ns", "tbl") { t => + createSinglePartTable(t) + checkPartitions(t, Map("id" -> "1")) + val errMsg = intercept[NoSuchPartitionException] { + sql(s"ALTER TABLE $t PARTITION (id = 3) RENAME TO PARTITION (id = 2)") + }.getMessage + assert(errMsg.contains("Partition not found in table")) + } + } + + test("target partition exists") { + withNamespaceAndTable("ns", "tbl") { t => + createSinglePartTable(t) + sql(s"INSERT INTO $t PARTITION (id = 2) SELECT 'def'") + checkPartitions(t, Map("id" -> "1"), Map("id" -> "2")) + val errMsg = intercept[PartitionAlreadyExistsException] { + sql(s"ALTER TABLE $t PARTITION (id = 1) RENAME TO PARTITION (id = 2)") + }.getMessage + assert(errMsg.contains("Partition already exists")) + } + } + + test("single part partition") { + withNamespaceAndTable("ns", "tbl") { t => + createSinglePartTable(t) + checkPartitions(t, Map("id" -> "1")) + + sql(s"ALTER TABLE $t PARTITION (id = 1) RENAME TO PARTITION (id = 2)") + checkPartitions(t, Map("id" -> "2")) + checkAnswer(sql(s"SELECT id, data FROM $t"), Row(2, "abc")) + } + } + + test("multi part partition") { + withNamespaceAndTable("ns", "tbl") { t => + createWideTable(t) + checkPartitions(t, + Map( + "year" -> "2016", + "month" -> "3", + "hour" -> "10", + "minute" -> "10", + "sec" -> "10", + "extra" -> "1"), + Map( + "year" -> "2016", + "month" -> "4", + "hour" -> "10", + "minute" -> "10", + "sec" -> "10", + "extra" -> "1")) + + sql(s""" + |ALTER TABLE $t + |PARTITION ( + | year = 2016, month = 3, hour = 10, minute = 10, sec = 10, extra = 1 + |) RENAME TO PARTITION ( + | year = 2016, month = 3, hour = 10, minute = 10, sec = 123, extra = 1 + |)""".stripMargin) + checkPartitions(t, + Map( + "year" -> "2016", + "month" -> "3", + "hour" -> "10", + "minute" -> "10", + "sec" -> "123", + "extra" -> "1"), + Map( + "year" -> "2016", + "month" -> "4", + "hour" -> "10", + "minute" -> "10", + "sec" -> "10", + "extra" -> "1")) + checkAnswer(sql(s"SELECT month, sec, price FROM $t"), Row(3, 123, 3)) + } + } + + test("partition spec in RENAME PARTITION should be case insensitive") { + withNamespaceAndTable("ns", "tbl") { t => + createSinglePartTable(t) + checkPartitions(t, Map("id" -> "1")) + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $t PARTITION (ID = 1) RENAME TO PARTITION (id = 2)") + }.getMessage + assert(errMsg.contains("ID is not a valid partition column")) + checkPartitions(t, Map("id" -> "1")) + } + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + sql(s"ALTER TABLE $t PARTITION (ID = 1) RENAME TO PARTITION (id = 2)") + checkPartitions(t, Map("id" -> "2")) + checkAnswer(sql(s"SELECT id, data FROM $t"), Row(2, "abc")) + } + } + } + + test("SPARK-34011: refresh cache after partition renaming") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1") + assert(!spark.catalog.isCached(t)) + sql(s"CACHE TABLE $t") + assert(spark.catalog.isCached(t)) + QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(0, 0), Row(1, 1))) + sql(s"ALTER TABLE $t PARTITION (part=0) RENAME TO PARTITION (part=2)") + assert(spark.catalog.isCached(t)) + QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(0, 2), Row(1, 1))) + } + } + + test("SPARK-34161, SPARK-34138, SPARK-34099: keep dependents cached after table altering") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1") + cacheRelation(t) + checkCachedRelation(t, Seq(Row(0, 0), Row(1, 1))) + + withView("v0") { + sql(s"CREATE VIEW v0 AS SELECT * FROM $t") + cacheRelation("v0") + sql(s"ALTER TABLE $t PARTITION (part=0) RENAME TO PARTITION (part=2)") + checkCachedRelation("v0", Seq(Row(0, 2), Row(1, 1))) + } + + withTempView("v1") { + sql(s"CREATE TEMP VIEW v1 AS SELECT * FROM $t") + cacheRelation("v1") + sql(s"ALTER TABLE $t PARTITION (part=1) RENAME TO PARTITION (part=3)") + checkCachedRelation("v1", Seq(Row(0, 2), Row(1, 3))) + } + + val v2 = s"${spark.sharedState.globalTempViewManager.database}.v2" + withGlobalTempView("v2") { + sql(s"CREATE GLOBAL TEMP VIEW v2 AS SELECT * FROM $t") + cacheRelation(v2) + sql(s"ALTER TABLE $t PARTITION (part=2) RENAME TO PARTITION (part=4)") + checkCachedRelation(v2, Seq(Row(0, 4), Row(1, 3))) + } + } + } + + test("SPARK-33474: Support typed literals as partition spec values") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t(name STRING, part DATE) USING PARQUET PARTITIONED BY (part)") + sql(s"ALTER TABLE $t ADD PARTITION(part = date'2020-01-01')") + checkPartitions(t, Map("part" -> "2020-01-01")) + sql(s"ALTER TABLE $t PARTITION (part = date'2020-01-01')" + + s" RENAME TO PARTITION (part = date'2020-01-02')") + checkPartitions(t, Map("part" -> "2020-01-02")) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenameSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenameSuiteBase.scala new file mode 100644 index 0000000000000..6370939cef6a2 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/AlterTableRenameSuiteBase.scala @@ -0,0 +1,129 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.{AnalysisException, QueryTest, Row} +import org.apache.spark.storage.StorageLevel + +/** + * This base suite contains unified tests for the `ALTER TABLE .. RENAME` command that check V1 + * and V2 table catalogs. The tests that cannot run for all supported catalogs are located in more + * specific test suites: + * + * - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.AlterTableRenameSuite` + * - V1 table catalog tests: `org.apache.spark.sql.execution.command.v1.AlterTableRenameSuiteBase` + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.AlterTableRenameSuite` + * - V1 Hive External catalog: + * `org.apache.spark.sql.hive.execution.command.AlterTableRenameSuite` + */ +trait AlterTableRenameSuiteBase extends QueryTest with DDLCommandTestUtils { + override val command = "ALTER TABLE .. RENAME" + + test("rename a table in a database/namespace") { + withNamespaceAndTable("ns", "dst_tbl") { dst => + val src = dst.replace("dst", "src") + sql(s"CREATE TABLE $src (c0 INT) $defaultUsing") + sql(s"INSERT INTO $src SELECT 0") + + sql(s"ALTER TABLE $src RENAME TO ns.dst_tbl") + checkTables("ns", "dst_tbl") + QueryTest.checkAnswer(sql(s"SELECT c0 FROM $dst"), Seq(Row(0))) + } + } + + test("table to rename does not exist") { + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $catalog.dbx.does_not_exist RENAME TO dbx.tab2") + }.getMessage + assert(errMsg.contains("Table or view not found")) + } + + test("omit namespace in the destination table") { + withNamespaceAndTable("ns", "dst_tbl") { dst => + val src = dst.replace("dst", "src") + sql(s"CREATE TABLE $src (c0 INT) $defaultUsing") + sql(s"INSERT INTO $src SELECT 0") + + sql(s"ALTER TABLE $src RENAME TO dst_tbl") + checkTables("ns", "dst_tbl") + QueryTest.checkAnswer(sql(s"SELECT c0 FROM $dst"), Seq(Row(0))) + } + } + + test("SPARK-33786: Cache's storage level should be respected when a table name is altered") { + withNamespaceAndTable("ns", "dst_tbl") { dst => + val src = dst.replace("dst", "src") + def getStorageLevel(tableName: String): StorageLevel = { + val table = spark.table(tableName) + val cachedData = spark.sharedState.cacheManager.lookupCachedData(table).get + cachedData.cachedRepresentation.cacheBuilder.storageLevel + } + sql(s"CREATE TABLE $src (c0 INT) $defaultUsing") + sql(s"INSERT INTO $src SELECT 0") + sql(s"CACHE TABLE $src OPTIONS('storageLevel' 'MEMORY_ONLY')") + val oldStorageLevel = getStorageLevel(src) + + sql(s"ALTER TABLE $src RENAME TO ns.dst_tbl") + QueryTest.checkAnswer(sql(s"SELECT c0 FROM $dst"), Seq(Row(0))) + val newStorageLevel = getStorageLevel(dst) + assert(oldStorageLevel === newStorageLevel) + } + } + + test("rename cached table") { + withNamespaceAndTable("ns", "students") { students => + sql(s"CREATE TABLE $students (age INT, name STRING) $defaultUsing") + sql(s"INSERT INTO $students SELECT 19, 'Ana'") + + spark.catalog.cacheTable(students) + val expected = Seq(Row(19, "Ana")) + QueryTest.checkAnswer(spark.table(students), expected) + assert(spark.catalog.isCached(students), + "bad test: table was not cached in the first place") + val teachers = s"$catalog.ns.teachers" + withTable(teachers) { + // After the command below we have both students and teachers. + sql(s"ALTER TABLE $students RENAME TO ns.teachers") + // The cached data for the old students table should not be read by + // the new students table. + sql(s"CREATE TABLE $students (age INT, name STRING) $defaultUsing") + assert(!spark.catalog.isCached(students)) + assert(spark.catalog.isCached(teachers)) + assert(spark.table(students).collect().isEmpty) + QueryTest.checkAnswer(spark.table(teachers), expected) + } + } + } + + test("rename without explicitly specifying database") { + try { + withNamespaceAndTable("ns", "dst_tbl") { dst => + val src = dst.replace("dst", "src") + sql(s"CREATE TABLE $src (c0 INT) $defaultUsing") + sql(s"INSERT INTO $src SELECT 0") + + sql(s"USE $catalog.ns") + sql(s"ALTER TABLE src_tbl RENAME TO dst_tbl") + checkTables("ns", "dst_tbl") + checkAnswer(sql(s"SELECT c0 FROM $dst"), Seq(Row(0))) + } + } finally { + spark.sessionState.catalogManager.reset() + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/CharVarcharDDLTestBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/CharVarcharDDLTestBase.scala new file mode 100644 index 0000000000000..ba683c049a631 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/CharVarcharDDLTestBase.scala @@ -0,0 +1,199 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.SparkConf +import org.apache.spark.sql.{AnalysisException, QueryTest, Row} +import org.apache.spark.sql.catalyst.util.CharVarcharUtils +import org.apache.spark.sql.connector.catalog.InMemoryPartitionTableCatalog +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.{SharedSparkSession, SQLTestUtils} +import org.apache.spark.sql.types._ + +trait CharVarcharDDLTestBase extends QueryTest with SQLTestUtils { + + def format: String + + def checkColType(f: StructField, dt: DataType): Unit = { + assert(f.dataType == CharVarcharUtils.replaceCharVarcharWithString(dt)) + assert(CharVarcharUtils.getRawType(f.metadata).contains(dt)) + } + + test("allow to change column for char(x) to char(y), x == y") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c CHAR(4)) USING $format") + sql("ALTER TABLE t CHANGE COLUMN c TYPE CHAR(4)") + checkColType(spark.table("t").schema(1), CharType(4)) + } + } + + test("not allow to change column for char(x) to char(y), x != y") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c CHAR(4)) USING $format") + val e = intercept[AnalysisException] { + sql("ALTER TABLE t CHANGE COLUMN c TYPE CHAR(5)") + } + val v1 = e.getMessage contains "'CharType(4)' to 'c' with type 'CharType(5)'" + val v2 = e.getMessage contains "char(4) cannot be cast to char(5)" + assert(v1 || v2) + } + } + + test("not allow to change column from string to char type") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c STRING) USING $format") + val e = intercept[AnalysisException] { + sql("ALTER TABLE t CHANGE COLUMN c TYPE CHAR(5)") + } + val v1 = e.getMessage contains "'StringType' to 'c' with type 'CharType(5)'" + val v2 = e.getMessage contains "string cannot be cast to char(5)" + assert(v1 || v2) + } + } + + test("not allow to change column from int to char type") { + withTable("t") { + sql(s"CREATE TABLE t(i int, c CHAR(4)) USING $format") + val e = intercept[AnalysisException] { + sql("ALTER TABLE t CHANGE COLUMN i TYPE CHAR(5)") + } + val v1 = e.getMessage contains "'IntegerType' to 'i' with type 'CharType(5)'" + val v2 = e.getMessage contains "int cannot be cast to char(5)" + assert(v1 || v2) + } + } + + test("allow to change column for varchar(x) to varchar(y), x == y") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c VARCHAR(4)) USING $format") + sql("ALTER TABLE t CHANGE COLUMN c TYPE VARCHAR(4)") + checkColType(spark.table("t").schema(1), VarcharType(4)) + } + } + + test("not allow to change column for varchar(x) to varchar(y), x > y") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c VARCHAR(4)) USING $format") + val e = intercept[AnalysisException] { + sql("ALTER TABLE t CHANGE COLUMN c TYPE VARCHAR(3)") + } + val v1 = e.getMessage contains "'VarcharType(4)' to 'c' with type 'VarcharType(3)'" + val v2 = e.getMessage contains "varchar(4) cannot be cast to varchar(3)" + assert(v1 || v2) + } + } + + def checkTableSchemaTypeStr(expected: Seq[Row]): Unit = { + checkAnswer(sql("desc t").selectExpr("data_type").where("data_type like '%char%'"), expected) + } + + test("SPARK-33901: alter table add columns should not change original table's schema") { + withTable("t") { + sql(s"CREATE TABLE t(i CHAR(5), c VARCHAR(4)) USING $format") + sql("ALTER TABLE t ADD COLUMNS (d VARCHAR(5))") + checkTableSchemaTypeStr(Seq(Row("char(5)"), Row("varchar(4)"), Row("varchar(5)"))) + } + } + + test("SPARK-33901: ctas should should not change table's schema") { + withTable("t", "tt") { + sql(s"CREATE TABLE tt(i CHAR(5), c VARCHAR(4)) USING $format") + sql(s"CREATE TABLE t USING $format AS SELECT * FROM tt") + checkTableSchemaTypeStr(Seq(Row("char(5)"), Row("varchar(4)"))) + } + } +} + +class FileSourceCharVarcharDDLTestSuite extends CharVarcharDDLTestBase with SharedSparkSession { + override def format: String = "parquet" + override protected def sparkConf: SparkConf = { + super.sparkConf.set(SQLConf.USE_V1_SOURCE_LIST, "parquet") + } + + // TODO(SPARK-33902): MOVE TO SUPER CLASS AFTER THE TARGET TICKET RESOLVED + test("SPARK-33901: create table like should should not change table's schema") { + withTable("t", "tt") { + sql(s"CREATE TABLE tt(i CHAR(5), c VARCHAR(4)) USING $format") + sql("CREATE TABLE t LIKE tt") + checkTableSchemaTypeStr(Seq(Row("char(5)"), Row("varchar(4)"))) + } + } + + // TODO(SPARK-33903): MOVE TO SUPER CLASS AFTER THE TARGET TICKET RESOLVED + test("SPARK-33901: cvas should should not change view's schema") { + withTable( "tt") { + sql(s"CREATE TABLE tt(i CHAR(5), c VARCHAR(4)) USING $format") + withView("t") { + sql("CREATE VIEW t AS SELECT * FROM tt") + checkTableSchemaTypeStr(Seq(Row("char(5)"), Row("varchar(4)"))) + } + } + } +} + +class DSV2CharVarcharDDLTestSuite extends CharVarcharDDLTestBase + with SharedSparkSession { + override def format: String = "foo" + protected override def sparkConf = { + super.sparkConf + .set("spark.sql.catalog.testcat", classOf[InMemoryPartitionTableCatalog].getName) + .set(SQLConf.DEFAULT_CATALOG.key, "testcat") + } + + test("allow to change change column from char to string type") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c CHAR(4)) USING $format") + sql("ALTER TABLE t CHANGE COLUMN c TYPE STRING") + assert(spark.table("t").schema(1).dataType === StringType) + } + } + + test("allow to change column from char(x) to varchar(y) type x <= y") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c CHAR(4)) USING $format") + sql("ALTER TABLE t CHANGE COLUMN c TYPE VARCHAR(4)") + checkColType(spark.table("t").schema(1), VarcharType(4)) + } + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c CHAR(4)) USING $format") + sql("ALTER TABLE t CHANGE COLUMN c TYPE VARCHAR(5)") + checkColType(spark.table("t").schema(1), VarcharType(5)) + } + } + + test("allow to change column from varchar(x) to varchar(y) type x <= y") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c VARCHAR(4)) USING $format") + sql("ALTER TABLE t CHANGE COLUMN c TYPE VARCHAR(4)") + checkColType(spark.table("t").schema(1), VarcharType(4)) + sql("ALTER TABLE t CHANGE COLUMN c TYPE VARCHAR(5)") + checkColType(spark.table("t").schema(1), VarcharType(5)) + + } + } + + test("not allow to change column from char(x) to varchar(y) type x > y") { + withTable("t") { + sql(s"CREATE TABLE t(i STRING, c CHAR(4)) USING $format") + val e = intercept[AnalysisException] { + sql("ALTER TABLE t CHANGE COLUMN c TYPE VARCHAR(3)") + } + assert(e.getMessage contains "char(4) cannot be cast to varchar(3)") + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLCommandTestUtils.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLCommandTestUtils.scala new file mode 100644 index 0000000000000..f9e26f8277d8b --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLCommandTestUtils.scala @@ -0,0 +1,172 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import java.io.File + +import org.apache.commons.io.FileUtils +import org.apache.hadoop.fs.{FileSystem, Path} +import org.scalactic.source.Position +import org.scalatest.Tag + +import org.apache.spark.sql.{QueryTest, Row} +import org.apache.spark.sql.catalyst.catalog.CatalogTypes.TablePartitionSpec +import org.apache.spark.sql.execution.datasources.PartitioningUtils +import org.apache.spark.sql.test.SQLTestUtils + +/** + * The common settings and utility functions for all v1 and v2 test suites. When a function + * is not applicable to all supported catalogs, it should be placed to a specific trait: + * + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.CommandSuiteBase` + * - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.CommandSuiteBase` + * - V2 In-Memory catalog: `org.apache.spark.sql.execution.command.v2.CommandSuiteBase` + */ +trait DDLCommandTestUtils extends SQLTestUtils { + // The version of the catalog under testing such as "V1", "V2", "Hive V1". + protected def version: String + // Name of the command as SQL statement, for instance "SHOW PARTITIONS" + protected def command: String + // The catalog name which can be used in SQL statements under testing + protected def catalog: String + // The clause is used in creating tables for testing + protected def defaultUsing: String + + // Overrides the `test` method, and adds a prefix to easily find identify the catalog to which + // the failed test in logs belongs to. + override def test(testName: String, testTags: Tag*)(testFun: => Any) + (implicit pos: Position): Unit = { + super.test(s"$command $version: " + testName, testTags: _*)(testFun) + } + + protected def withNamespaceAndTable(ns: String, tableName: String, cat: String = catalog) + (f: String => Unit): Unit = { + val nsCat = s"$cat.$ns" + withNamespace(nsCat) { + sql(s"CREATE NAMESPACE $nsCat") + val t = s"$nsCat.$tableName" + withTable(t) { + f(t) + } + } + } + + // Checks that the table `t` contains only the `expected` partitions. + protected def checkPartitions(t: String, expected: Map[String, String]*): Unit = { + val partitions = sql(s"SHOW PARTITIONS $t") + .collect() + .toSet + .map((row: Row) => row.getString(0)) + .map(PartitioningUtils.parsePathFragment) + assert(partitions === expected.toSet) + } + + protected def createWideTable(table: String): Unit = { + sql(s""" + |CREATE TABLE $table ( + | price int, qty int, + | year int, month int, hour int, minute int, sec int, extra int) + |$defaultUsing + |PARTITIONED BY (year, month, hour, minute, sec, extra) + |""".stripMargin) + sql(s""" + |INSERT INTO $table + |PARTITION(year = 2016, month = 3, hour = 10, minute = 10, sec = 10, extra = 1) SELECT 3, 3 + |""".stripMargin) + sql(s""" + |ALTER TABLE $table + |ADD PARTITION(year = 2016, month = 4, hour = 10, minute = 10, sec = 10, extra = 1) + |""".stripMargin) + } + + protected def checkLocation(t: String, spec: TablePartitionSpec, expected: String): Unit + + // Getting the total table size in the filesystem in bytes + def getTableSize(tableName: String): Int = { + val stats = + sql(s"DESCRIBE TABLE EXTENDED $tableName") + .where("col_name = 'Statistics'") + .select("data_type") + if (stats.isEmpty) { + throw new IllegalArgumentException(s"The table $tableName does not have stats") + } + val tableSizeInStats = "^(\\d+) bytes.*$".r + val size = stats.first().getString(0) match { + case tableSizeInStats(s) => s.toInt + case _ => throw new IllegalArgumentException("Not found table size in stats") + } + size + } + + def partSpecToString(spec: Map[String, Any]): String = { + spec.map { + case (k, v: String) => s"$k = '$v'" + case (k, v) => s"$k = $v" + }.mkString("PARTITION (", ", ", ")") + } + + def cacheRelation(name: String): Unit = { + assert(!spark.catalog.isCached(name)) + sql(s"CACHE TABLE $name") + assert(spark.catalog.isCached(name)) + } + + def checkCachedRelation(name: String, expected: Seq[Row]): Unit = { + assert(spark.catalog.isCached(name)) + QueryTest.checkAnswer(sql(s"SELECT * FROM $name"), expected) + } + + def checkTables(namespace: String, expectedTables: String*): Unit = { + val tables = sql(s"SHOW TABLES IN $catalog.$namespace").select("tableName") + val rows = expectedTables.map(Row(_)) + QueryTest.checkAnswer(tables, rows) + } + + def withTableDir(tableName: String)(f: (FileSystem, Path) => Unit): Unit = { + val location = sql(s"DESCRIBE TABLE EXTENDED $tableName") + .where("col_name = 'Location'") + .select("data_type") + .first() + .getString(0) + val root = new Path(location) + val fs = root.getFileSystem(spark.sessionState.newHadoopConf()) + f(fs, root) + } + + def getPartitionLocation(tableName: String, part: String): String = { + val idents = tableName.split('.') + val table = idents.last + val catalogAndNs = idents.init + val in = if (catalogAndNs.isEmpty) "" else s"IN ${catalogAndNs.mkString(".")}" + val information = sql(s"SHOW TABLE EXTENDED $in LIKE '$table' PARTITION ($part)") + .select("information") + .first().getString(0) + information + .split("\\r?\\n") + .filter(_.startsWith("Location:")) + .head + .replace("Location: file:", "") + } + + def copyPartition(tableName: String, from: String, to: String): String = { + val part0Loc = getPartitionLocation(tableName, from) + val part1Loc = part0Loc.replace(from, to) + FileUtils.copyDirectory(new File(part0Loc), new File(part1Loc)) + part1Loc + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLParserSuite.scala index c6a533dfae4d0..6c337e3e8275c 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLParserSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLParserSuite.scala @@ -17,30 +17,21 @@ package org.apache.spark.sql.execution.command -import java.net.URI import java.util.Locale -import scala.reflect.{classTag, ClassTag} - -import org.apache.spark.sql.{AnalysisException, SaveMode} -import org.apache.spark.sql.catalyst.TableIdentifier +import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedAttribute} -import org.apache.spark.sql.catalyst.catalog._ import org.apache.spark.sql.catalyst.dsl.expressions._ import org.apache.spark.sql.catalyst.dsl.plans import org.apache.spark.sql.catalyst.dsl.plans.DslLogicalPlan import org.apache.spark.sql.catalyst.expressions.JsonTuple import org.apache.spark.sql.catalyst.parser.ParseException import org.apache.spark.sql.catalyst.plans.logical._ -import org.apache.spark.sql.connector.expressions.{FieldReference, IdentityTransform} import org.apache.spark.sql.execution.SparkSqlParser -import org.apache.spark.sql.execution.datasources.CreateTable -import org.apache.spark.sql.internal.{HiveSerDe, SQLConf} import org.apache.spark.sql.test.SharedSparkSession -import org.apache.spark.sql.types.{IntegerType, StructField, StructType} class DDLParserSuite extends AnalysisTest with SharedSparkSession { - private lazy val parser = new SparkSqlParser(new SQLConf) + private lazy val parser = new SparkSqlParser() private def assertUnsupported(sql: String, containsThesePhrases: Seq[String] = Seq()): Unit = { val e = intercept[ParseException] { @@ -52,159 +43,17 @@ class DDLParserSuite extends AnalysisTest with SharedSparkSession { } } - private def intercept(sqlCommand: String, messages: String*): Unit = - interceptParseException(parser.parsePlan)(sqlCommand, messages: _*) - - private def parseAs[T: ClassTag](query: String): T = { - parser.parsePlan(query) match { - case t: T => t - case other => - fail(s"Expected to parse ${classTag[T].runtimeClass} from query," + - s"got ${other.getClass.getName}: $query") - } - } - private def compareTransformQuery(sql: String, expected: LogicalPlan): Unit = { val plan = parser.parsePlan(sql).asInstanceOf[ScriptTransformation].copy(ioschema = null) comparePlans(plan, expected, checkAnalysis = false) } - private def extractTableDesc(sql: String): (CatalogTable, Boolean) = { - parser.parsePlan(sql).collect { - case CreateTable(tableDesc, mode, _) => (tableDesc, mode == SaveMode.Ignore) - }.head - } - test("alter database - property values must be set") { assertUnsupported( sql = "ALTER DATABASE my_db SET DBPROPERTIES('key_without_value', 'key_with_value'='x')", containsThesePhrases = Seq("key_without_value")) } - test("create hive table - table file format") { - val allSources = Seq("parquet", "parquetfile", "orc", "orcfile", "avro", "avrofile", - "sequencefile", "rcfile", "textfile") - - allSources.foreach { s => - val query = s"CREATE TABLE my_tab STORED AS $s" - val ct = parseAs[CreateTable](query) - val hiveSerde = HiveSerDe.sourceToSerDe(s) - assert(hiveSerde.isDefined) - assert(ct.tableDesc.storage.serde == - hiveSerde.get.serde.orElse(Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"))) - assert(ct.tableDesc.storage.inputFormat == hiveSerde.get.inputFormat) - assert(ct.tableDesc.storage.outputFormat == hiveSerde.get.outputFormat) - } - } - - test("create hive table - row format and table file format") { - val createTableStart = "CREATE TABLE my_tab ROW FORMAT" - val fileFormat = s"STORED AS INPUTFORMAT 'inputfmt' OUTPUTFORMAT 'outputfmt'" - val query1 = s"$createTableStart SERDE 'anything' $fileFormat" - val query2 = s"$createTableStart DELIMITED FIELDS TERMINATED BY ' ' $fileFormat" - - // No conflicting serdes here, OK - val parsed1 = parseAs[CreateTable](query1) - assert(parsed1.tableDesc.storage.serde == Some("anything")) - assert(parsed1.tableDesc.storage.inputFormat == Some("inputfmt")) - assert(parsed1.tableDesc.storage.outputFormat == Some("outputfmt")) - - val parsed2 = parseAs[CreateTable](query2) - assert(parsed2.tableDesc.storage.serde == - Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")) - assert(parsed2.tableDesc.storage.inputFormat == Some("inputfmt")) - assert(parsed2.tableDesc.storage.outputFormat == Some("outputfmt")) - } - - test("create hive table - row format serde and generic file format") { - val allSources = Seq("parquet", "orc", "avro", "sequencefile", "rcfile", "textfile") - val supportedSources = Set("sequencefile", "rcfile", "textfile") - - allSources.foreach { s => - val query = s"CREATE TABLE my_tab ROW FORMAT SERDE 'anything' STORED AS $s" - if (supportedSources.contains(s)) { - val ct = parseAs[CreateTable](query) - val hiveSerde = HiveSerDe.sourceToSerDe(s) - assert(hiveSerde.isDefined) - assert(ct.tableDesc.storage.serde == Some("anything")) - assert(ct.tableDesc.storage.inputFormat == hiveSerde.get.inputFormat) - assert(ct.tableDesc.storage.outputFormat == hiveSerde.get.outputFormat) - } else { - assertUnsupported(query, Seq("row format serde", "incompatible", s)) - } - } - } - - test("create hive table - row format delimited and generic file format") { - val allSources = Seq("parquet", "orc", "avro", "sequencefile", "rcfile", "textfile") - val supportedSources = Set("textfile") - - allSources.foreach { s => - val query = s"CREATE TABLE my_tab ROW FORMAT DELIMITED FIELDS TERMINATED BY ' ' STORED AS $s" - if (supportedSources.contains(s)) { - val ct = parseAs[CreateTable](query) - val hiveSerde = HiveSerDe.sourceToSerDe(s) - assert(hiveSerde.isDefined) - assert(ct.tableDesc.storage.serde == - hiveSerde.get.serde.orElse(Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"))) - assert(ct.tableDesc.storage.inputFormat == hiveSerde.get.inputFormat) - assert(ct.tableDesc.storage.outputFormat == hiveSerde.get.outputFormat) - } else { - assertUnsupported(query, Seq("row format delimited", "only compatible with 'textfile'", s)) - } - } - } - - test("create hive external table - location must be specified") { - assertUnsupported( - sql = "CREATE EXTERNAL TABLE my_tab STORED AS parquet", - containsThesePhrases = Seq("create external table", "location")) - val query = "CREATE EXTERNAL TABLE my_tab STORED AS parquet LOCATION '/something/anything'" - val ct = parseAs[CreateTable](query) - assert(ct.tableDesc.tableType == CatalogTableType.EXTERNAL) - assert(ct.tableDesc.storage.locationUri == Some(new URI("/something/anything"))) - } - - test("create hive table - property values must be set") { - assertUnsupported( - sql = "CREATE TABLE my_tab STORED AS parquet " + - "TBLPROPERTIES('key_without_value', 'key_with_value'='x')", - containsThesePhrases = Seq("key_without_value")) - assertUnsupported( - sql = "CREATE TABLE my_tab ROW FORMAT SERDE 'serde' " + - "WITH SERDEPROPERTIES('key_without_value', 'key_with_value'='x')", - containsThesePhrases = Seq("key_without_value")) - } - - test("create hive table - location implies external") { - val query = "CREATE TABLE my_tab STORED AS parquet LOCATION '/something/anything'" - val ct = parseAs[CreateTable](query) - assert(ct.tableDesc.tableType == CatalogTableType.EXTERNAL) - assert(ct.tableDesc.storage.locationUri == Some(new URI("/something/anything"))) - } - - test("Duplicate clauses - create hive table") { - def createTableHeader(duplicateClause: String): String = { - s"CREATE TABLE my_tab(a INT, b STRING) STORED AS parquet $duplicateClause $duplicateClause" - } - - intercept(createTableHeader("TBLPROPERTIES('test' = 'test2')"), - "Found duplicate clauses: TBLPROPERTIES") - intercept(createTableHeader("LOCATION '/tmp/file'"), - "Found duplicate clauses: LOCATION") - intercept(createTableHeader("COMMENT 'a table'"), - "Found duplicate clauses: COMMENT") - intercept(createTableHeader("CLUSTERED BY(b) INTO 256 BUCKETS"), - "Found duplicate clauses: CLUSTERED BY") - intercept(createTableHeader("PARTITIONED BY (k int)"), - "Found duplicate clauses: PARTITIONED BY") - intercept(createTableHeader("STORED AS parquet"), - "Found duplicate clauses: STORED AS/BY") - intercept( - createTableHeader("ROW FORMAT SERDE 'parquet.hive.serde.ParquetHiveSerDe'"), - "Found duplicate clauses: ROW FORMAT") - } - test("insert overwrite directory") { val v1 = "INSERT OVERWRITE DIRECTORY '/tmp/file' USING parquet SELECT 1 as a" parser.parsePlan(v1) match { @@ -361,188 +210,6 @@ class DDLParserSuite extends AnalysisTest with SharedSparkSession { assert(e.contains("Found duplicate keys 'a'")) } - test("empty values in non-optional partition specs") { - val e = intercept[ParseException] { - parser.parsePlan( - "SHOW PARTITIONS dbx.tab1 PARTITION (a='1', b)") - }.getMessage - assert(e.contains("Found an empty partition key 'b'")) - } - - test("Test CTAS #1") { - val s1 = - """ - |CREATE EXTERNAL TABLE IF NOT EXISTS mydb.page_view - |COMMENT 'This is the staging page view table' - |STORED AS RCFILE - |LOCATION '/user/external/page_view' - |TBLPROPERTIES ('p1'='v1', 'p2'='v2') - |AS SELECT * FROM src - """.stripMargin - - val s2 = - """ - |CREATE EXTERNAL TABLE IF NOT EXISTS mydb.page_view - |STORED AS RCFILE - |COMMENT 'This is the staging page view table' - |TBLPROPERTIES ('p1'='v1', 'p2'='v2') - |LOCATION '/user/external/page_view' - |AS SELECT * FROM src - """.stripMargin - - val s3 = - """ - |CREATE EXTERNAL TABLE IF NOT EXISTS mydb.page_view - |TBLPROPERTIES ('p1'='v1', 'p2'='v2') - |LOCATION '/user/external/page_view' - |STORED AS RCFILE - |COMMENT 'This is the staging page view table' - |AS SELECT * FROM src - """.stripMargin - - checkParsing(s1) - checkParsing(s2) - checkParsing(s3) - - def checkParsing(sql: String): Unit = { - val (desc, exists) = extractTableDesc(sql) - assert(exists) - assert(desc.identifier.database == Some("mydb")) - assert(desc.identifier.table == "page_view") - assert(desc.tableType == CatalogTableType.EXTERNAL) - assert(desc.storage.locationUri == Some(new URI("/user/external/page_view"))) - assert(desc.schema.isEmpty) // will be populated later when the table is actually created - assert(desc.comment == Some("This is the staging page view table")) - // TODO will be SQLText - assert(desc.viewText.isEmpty) - assert(desc.viewCatalogAndNamespace.isEmpty) - assert(desc.viewQueryColumnNames.isEmpty) - assert(desc.partitionColumnNames.isEmpty) - assert(desc.storage.inputFormat == Some("org.apache.hadoop.hive.ql.io.RCFileInputFormat")) - assert(desc.storage.outputFormat == Some("org.apache.hadoop.hive.ql.io.RCFileOutputFormat")) - assert(desc.storage.serde == - Some("org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe")) - assert(desc.properties == Map("p1" -> "v1", "p2" -> "v2")) - } - } - - test("Test CTAS #2") { - val s1 = - """ - |CREATE EXTERNAL TABLE IF NOT EXISTS mydb.page_view - |COMMENT 'This is the staging page view table' - |ROW FORMAT SERDE 'parquet.hive.serde.ParquetHiveSerDe' - | STORED AS - | INPUTFORMAT 'parquet.hive.DeprecatedParquetInputFormat' - | OUTPUTFORMAT 'parquet.hive.DeprecatedParquetOutputFormat' - |LOCATION '/user/external/page_view' - |TBLPROPERTIES ('p1'='v1', 'p2'='v2') - |AS SELECT * FROM src - """.stripMargin - - val s2 = - """ - |CREATE EXTERNAL TABLE IF NOT EXISTS mydb.page_view - |LOCATION '/user/external/page_view' - |TBLPROPERTIES ('p1'='v1', 'p2'='v2') - |ROW FORMAT SERDE 'parquet.hive.serde.ParquetHiveSerDe' - | STORED AS - | INPUTFORMAT 'parquet.hive.DeprecatedParquetInputFormat' - | OUTPUTFORMAT 'parquet.hive.DeprecatedParquetOutputFormat' - |COMMENT 'This is the staging page view table' - |AS SELECT * FROM src - """.stripMargin - - checkParsing(s1) - checkParsing(s2) - - def checkParsing(sql: String): Unit = { - val (desc, exists) = extractTableDesc(sql) - assert(exists) - assert(desc.identifier.database == Some("mydb")) - assert(desc.identifier.table == "page_view") - assert(desc.tableType == CatalogTableType.EXTERNAL) - assert(desc.storage.locationUri == Some(new URI("/user/external/page_view"))) - assert(desc.schema.isEmpty) // will be populated later when the table is actually created - // TODO will be SQLText - assert(desc.comment == Some("This is the staging page view table")) - assert(desc.viewText.isEmpty) - assert(desc.viewCatalogAndNamespace.isEmpty) - assert(desc.viewQueryColumnNames.isEmpty) - assert(desc.partitionColumnNames.isEmpty) - assert(desc.storage.properties == Map()) - assert(desc.storage.inputFormat == Some("parquet.hive.DeprecatedParquetInputFormat")) - assert(desc.storage.outputFormat == Some("parquet.hive.DeprecatedParquetOutputFormat")) - assert(desc.storage.serde == Some("parquet.hive.serde.ParquetHiveSerDe")) - assert(desc.properties == Map("p1" -> "v1", "p2" -> "v2")) - } - } - - test("Test CTAS #3") { - val s3 = """CREATE TABLE page_view AS SELECT * FROM src""" - val (desc, exists) = extractTableDesc(s3) - assert(exists == false) - assert(desc.identifier.database == None) - assert(desc.identifier.table == "page_view") - assert(desc.tableType == CatalogTableType.MANAGED) - assert(desc.storage.locationUri == None) - assert(desc.schema.isEmpty) - assert(desc.viewText == None) // TODO will be SQLText - assert(desc.viewQueryColumnNames.isEmpty) - assert(desc.storage.properties == Map()) - assert(desc.storage.inputFormat == Some("org.apache.hadoop.mapred.TextInputFormat")) - assert(desc.storage.outputFormat == - Some("org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat")) - assert(desc.storage.serde == Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")) - assert(desc.properties == Map()) - } - - test("Test CTAS #4") { - val s4 = - """CREATE TABLE page_view - |STORED BY 'storage.handler.class.name' AS SELECT * FROM src""".stripMargin - intercept[AnalysisException] { - extractTableDesc(s4) - } - } - - test("Test CTAS #5") { - val s5 = """CREATE TABLE ctas2 - | ROW FORMAT SERDE "org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe" - | WITH SERDEPROPERTIES("serde_p1"="p1","serde_p2"="p2") - | STORED AS RCFile - | TBLPROPERTIES("tbl_p1"="p11", "tbl_p2"="p22") - | AS - | SELECT key, value - | FROM src - | ORDER BY key, value""".stripMargin - val (desc, exists) = extractTableDesc(s5) - assert(exists == false) - assert(desc.identifier.database == None) - assert(desc.identifier.table == "ctas2") - assert(desc.tableType == CatalogTableType.MANAGED) - assert(desc.storage.locationUri == None) - assert(desc.schema.isEmpty) - assert(desc.viewText == None) // TODO will be SQLText - assert(desc.viewCatalogAndNamespace.isEmpty) - assert(desc.viewQueryColumnNames.isEmpty) - assert(desc.storage.properties == Map(("serde_p1" -> "p1"), ("serde_p2" -> "p2"))) - assert(desc.storage.inputFormat == Some("org.apache.hadoop.hive.ql.io.RCFileInputFormat")) - assert(desc.storage.outputFormat == Some("org.apache.hadoop.hive.ql.io.RCFileOutputFormat")) - assert(desc.storage.serde == Some("org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe")) - assert(desc.properties == Map(("tbl_p1" -> "p11"), ("tbl_p2" -> "p22"))) - } - - test("CTAS statement with a PARTITIONED BY clause is not allowed") { - assertUnsupported(s"CREATE TABLE ctas1 PARTITIONED BY (k int)" + - " AS SELECT key, value FROM (SELECT 1 as key, 2 as value) tmp") - } - - test("CTAS statement with schema") { - assertUnsupported(s"CREATE TABLE ctas1 (age INT, name STRING) AS SELECT * FROM src") - assertUnsupported(s"CREATE TABLE ctas1 (age INT, name STRING) AS SELECT 1, 'hello'") - } - test("unsupported operations") { intercept[ParseException] { parser.parsePlan( @@ -612,16 +279,16 @@ class DDLParserSuite extends AnalysisTest with SharedSparkSession { } test("transform query spec") { - val p = ScriptTransformation( - Seq(UnresolvedAttribute("a"), UnresolvedAttribute("b")), - "func", Seq.empty, plans.table("e"), null) + val p = Project(Seq(UnresolvedAttribute("a"), UnresolvedAttribute("b")), plans.table("e")) + val s = ScriptTransformation("func", Seq.empty, p, null) compareTransformQuery("select transform(a, b) using 'func' from e where f < 10", - p.copy(child = p.child.where('f < 10), output = Seq('key.string, 'value.string))) + s.copy(child = p.copy(child = p.child.where('f < 10)), + output = Seq('key.string, 'value.string))) compareTransformQuery("map a, b using 'func' as c, d from e", - p.copy(output = Seq('c.string, 'd.string))) + s.copy(output = Seq('c.string, 'd.string))) compareTransformQuery("reduce a, b using 'func' as (c int, d decimal(10, 0)) from e", - p.copy(output = Seq('c.int, 'd.decimal(10, 0)))) + s.copy(output = Seq('c.int, 'd.decimal(10, 0)))) } test("use backticks in output of Script Transform") { @@ -652,205 +319,6 @@ class DDLParserSuite extends AnalysisTest with SharedSparkSession { """.stripMargin) } - test("create table - basic") { - val query = "CREATE TABLE my_table (id int, name string)" - val (desc, allowExisting) = extractTableDesc(query) - assert(!allowExisting) - assert(desc.identifier.database.isEmpty) - assert(desc.identifier.table == "my_table") - assert(desc.tableType == CatalogTableType.MANAGED) - assert(desc.schema == new StructType().add("id", "int").add("name", "string")) - assert(desc.partitionColumnNames.isEmpty) - assert(desc.bucketSpec.isEmpty) - assert(desc.viewText.isEmpty) - assert(desc.viewQueryColumnNames.isEmpty) - assert(desc.storage.locationUri.isEmpty) - assert(desc.storage.inputFormat == - Some("org.apache.hadoop.mapred.TextInputFormat")) - assert(desc.storage.outputFormat == - Some("org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat")) - assert(desc.storage.serde == Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")) - assert(desc.storage.properties.isEmpty) - assert(desc.properties.isEmpty) - assert(desc.comment.isEmpty) - } - - test("create table - with database name") { - val query = "CREATE TABLE dbx.my_table (id int, name string)" - val (desc, _) = extractTableDesc(query) - assert(desc.identifier.database == Some("dbx")) - assert(desc.identifier.table == "my_table") - } - - test("create table - temporary") { - val query = "CREATE TEMPORARY TABLE tab1 (id int, name string)" - val e = intercept[ParseException] { parser.parsePlan(query) } - assert(e.message.contains("CREATE TEMPORARY TABLE is not supported yet")) - } - - test("create table - external") { - val query = "CREATE EXTERNAL TABLE tab1 (id int, name string) LOCATION '/path/to/nowhere'" - val (desc, _) = extractTableDesc(query) - assert(desc.tableType == CatalogTableType.EXTERNAL) - assert(desc.storage.locationUri == Some(new URI("/path/to/nowhere"))) - } - - test("create table - if not exists") { - val query = "CREATE TABLE IF NOT EXISTS tab1 (id int, name string)" - val (_, allowExisting) = extractTableDesc(query) - assert(allowExisting) - } - - test("create table - comment") { - val query = "CREATE TABLE my_table (id int, name string) COMMENT 'its hot as hell below'" - val (desc, _) = extractTableDesc(query) - assert(desc.comment == Some("its hot as hell below")) - } - - test("create table - partitioned columns") { - val query = "CREATE TABLE my_table (id int, name string) PARTITIONED BY (month int)" - val (desc, _) = extractTableDesc(query) - assert(desc.schema == new StructType() - .add("id", "int") - .add("name", "string") - .add("month", "int")) - assert(desc.partitionColumnNames == Seq("month")) - } - - test("create table - clustered by") { - val numBuckets = 10 - val bucketedColumn = "id" - val sortColumn = "id" - val baseQuery = - s""" - CREATE TABLE my_table ( - $bucketedColumn int, - name string) - CLUSTERED BY($bucketedColumn) - """ - - val query1 = s"$baseQuery INTO $numBuckets BUCKETS" - val (desc1, _) = extractTableDesc(query1) - assert(desc1.bucketSpec.isDefined) - val bucketSpec1 = desc1.bucketSpec.get - assert(bucketSpec1.numBuckets == numBuckets) - assert(bucketSpec1.bucketColumnNames.head.equals(bucketedColumn)) - assert(bucketSpec1.sortColumnNames.isEmpty) - - val query2 = s"$baseQuery SORTED BY($sortColumn) INTO $numBuckets BUCKETS" - val (desc2, _) = extractTableDesc(query2) - assert(desc2.bucketSpec.isDefined) - val bucketSpec2 = desc2.bucketSpec.get - assert(bucketSpec2.numBuckets == numBuckets) - assert(bucketSpec2.bucketColumnNames.head.equals(bucketedColumn)) - assert(bucketSpec2.sortColumnNames.head.equals(sortColumn)) - } - - test("create table(hive) - skewed by") { - val baseQuery = "CREATE TABLE my_table (id int, name string) SKEWED BY" - val query1 = s"$baseQuery(id) ON (1, 10, 100)" - val query2 = s"$baseQuery(id, name) ON ((1, 'x'), (2, 'y'), (3, 'z'))" - val query3 = s"$baseQuery(id, name) ON ((1, 'x'), (2, 'y'), (3, 'z')) STORED AS DIRECTORIES" - val e1 = intercept[ParseException] { parser.parsePlan(query1) } - val e2 = intercept[ParseException] { parser.parsePlan(query2) } - val e3 = intercept[ParseException] { parser.parsePlan(query3) } - assert(e1.getMessage.contains("Operation not allowed")) - assert(e2.getMessage.contains("Operation not allowed")) - assert(e3.getMessage.contains("Operation not allowed")) - } - - test("create table(hive) - row format") { - val baseQuery = "CREATE TABLE my_table (id int, name string) ROW FORMAT" - val query1 = s"$baseQuery SERDE 'org.apache.poof.serde.Baff'" - val query2 = s"$baseQuery SERDE 'org.apache.poof.serde.Baff' WITH SERDEPROPERTIES ('k1'='v1')" - val query3 = - s""" - |$baseQuery DELIMITED FIELDS TERMINATED BY 'x' ESCAPED BY 'y' - |COLLECTION ITEMS TERMINATED BY 'a' - |MAP KEYS TERMINATED BY 'b' - |LINES TERMINATED BY '\n' - |NULL DEFINED AS 'c' - """.stripMargin - val (desc1, _) = extractTableDesc(query1) - val (desc2, _) = extractTableDesc(query2) - val (desc3, _) = extractTableDesc(query3) - assert(desc1.storage.serde == Some("org.apache.poof.serde.Baff")) - assert(desc1.storage.properties.isEmpty) - assert(desc2.storage.serde == Some("org.apache.poof.serde.Baff")) - assert(desc2.storage.properties == Map("k1" -> "v1")) - assert(desc3.storage.properties == Map( - "field.delim" -> "x", - "escape.delim" -> "y", - "serialization.format" -> "x", - "line.delim" -> "\n", - "colelction.delim" -> "a", // yes, it's a typo from Hive :) - "mapkey.delim" -> "b")) - } - - test("create table(hive) - file format") { - val baseQuery = "CREATE TABLE my_table (id int, name string) STORED AS" - val query1 = s"$baseQuery INPUTFORMAT 'winput' OUTPUTFORMAT 'wowput'" - val query2 = s"$baseQuery ORC" - val (desc1, _) = extractTableDesc(query1) - val (desc2, _) = extractTableDesc(query2) - assert(desc1.storage.inputFormat == Some("winput")) - assert(desc1.storage.outputFormat == Some("wowput")) - assert(desc1.storage.serde == Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")) - assert(desc2.storage.inputFormat == Some("org.apache.hadoop.hive.ql.io.orc.OrcInputFormat")) - assert(desc2.storage.outputFormat == Some("org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat")) - assert(desc2.storage.serde == Some("org.apache.hadoop.hive.ql.io.orc.OrcSerde")) - } - - test("create table(hive) - storage handler") { - val baseQuery = "CREATE TABLE my_table (id int, name string) STORED BY" - val query1 = s"$baseQuery 'org.papachi.StorageHandler'" - val query2 = s"$baseQuery 'org.mamachi.StorageHandler' WITH SERDEPROPERTIES ('k1'='v1')" - val e1 = intercept[ParseException] { parser.parsePlan(query1) } - val e2 = intercept[ParseException] { parser.parsePlan(query2) } - assert(e1.getMessage.contains("Operation not allowed")) - assert(e2.getMessage.contains("Operation not allowed")) - } - - test("create table - properties") { - val query = "CREATE TABLE my_table (id int, name string) TBLPROPERTIES ('k1'='v1', 'k2'='v2')" - val (desc, _) = extractTableDesc(query) - assert(desc.properties == Map("k1" -> "v1", "k2" -> "v2")) - } - - test("create table(hive) - everything!") { - val query = - """ - |CREATE EXTERNAL TABLE IF NOT EXISTS dbx.my_table (id int, name string) - |COMMENT 'no comment' - |PARTITIONED BY (month int) - |ROW FORMAT SERDE 'org.apache.poof.serde.Baff' WITH SERDEPROPERTIES ('k1'='v1') - |STORED AS INPUTFORMAT 'winput' OUTPUTFORMAT 'wowput' - |LOCATION '/path/to/mercury' - |TBLPROPERTIES ('k1'='v1', 'k2'='v2') - """.stripMargin - val (desc, allowExisting) = extractTableDesc(query) - assert(allowExisting) - assert(desc.identifier.database == Some("dbx")) - assert(desc.identifier.table == "my_table") - assert(desc.tableType == CatalogTableType.EXTERNAL) - assert(desc.schema == new StructType() - .add("id", "int") - .add("name", "string") - .add("month", "int")) - assert(desc.partitionColumnNames == Seq("month")) - assert(desc.bucketSpec.isEmpty) - assert(desc.viewText.isEmpty) - assert(desc.viewCatalogAndNamespace.isEmpty) - assert(desc.viewQueryColumnNames.isEmpty) - assert(desc.storage.locationUri == Some(new URI("/path/to/mercury"))) - assert(desc.storage.inputFormat == Some("winput")) - assert(desc.storage.outputFormat == Some("wowput")) - assert(desc.storage.serde == Some("org.apache.poof.serde.Baff")) - assert(desc.storage.properties == Map("k1" -> "v1")) - assert(desc.properties == Map("k1" -> "v1", "k2" -> "v2")) - assert(desc.comment == Some("no comment")) - } - test("create table like") { val v1 = "CREATE TABLE table1 LIKE table2" val (target, source, fileFormat, provider, properties, exists) = diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala index 10ad8acc68937..59f321d0015e9 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala @@ -22,14 +22,13 @@ import java.net.URI import java.util.Locale import org.apache.hadoop.fs.{Path, RawLocalFileSystem} -import org.apache.hadoop.fs.permission.{AclEntry, AclEntryScope, AclEntryType, AclStatus, FsAction, FsPermission} +import org.apache.hadoop.fs.permission.{AclEntry, AclStatus} import org.apache.spark.{SparkException, SparkFiles} import org.apache.spark.internal.config -import org.apache.spark.internal.config.RDD_PARALLEL_LISTING_THRESHOLD import org.apache.spark.sql.{AnalysisException, QueryTest, Row, SaveMode} -import org.apache.spark.sql.catalyst.{QualifiedTableName, TableIdentifier} -import org.apache.spark.sql.catalyst.analysis.{FunctionRegistry, NoSuchDatabaseException, NoSuchPartitionException, NoSuchTableException, TempTableAlreadyExistsException} +import org.apache.spark.sql.catalyst.{FunctionIdentifier, QualifiedTableName, TableIdentifier} +import org.apache.spark.sql.catalyst.analysis.{FunctionRegistry, NoSuchDatabaseException, NoSuchFunctionException, TableFunctionRegistry, TempTableAlreadyExistsException} import org.apache.spark.sql.catalyst.catalog._ import org.apache.spark.sql.catalyst.catalog.CatalogTypes.TablePartitionSpec import org.apache.spark.sql.connector.catalog.SupportsNamespaces.PROP_OWNER @@ -334,22 +333,6 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { testChangeColumn(isDatasourceTable = true) } - test("alter table: add partition (datasource table)") { - testAddPartitions(isDatasourceTable = true) - } - - test("alter table: drop partition (datasource table)") { - testDropPartitions(isDatasourceTable = true) - } - - test("alter table: rename partition (datasource table)") { - testRenamePartitions(isDatasourceTable = true) - } - - test("drop table - data source table") { - testDropTable(isDatasourceTable = true) - } - test("the qualified path of a database is stored in the catalog") { val catalog = spark.sessionState.catalog @@ -497,19 +480,6 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { } } - test("rename a managed table with existing empty directory") { - withEmptyDirInTablePath("tab2") { tableLoc => - withTable("tab1") { - sql(s"CREATE TABLE tab1 USING $dataSource AS SELECT 1, 'a'") - val ex = intercept[AnalysisException] { - sql("ALTER TABLE tab1 RENAME TO tab2") - }.getMessage - assert(ex.contains( - "Can not rename the managed table('`default`.`tab1`'). The associated location")) - } - } - } - private def checkSchemaInCreatedDataSourceTable( path: File, userSpecifiedSchema: Option[String], @@ -549,9 +519,9 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { import testImplicits._ val df = sparkContext.parallelize(1 to 10).map(i => (i, i.toString)).toDF("num", "str") - // Case 1: with partitioning columns but no schema: Option("inexistentColumns") + // Case 1: with partitioning columns but no schema: Option("nonexistentColumns") // Case 2: without schema and partitioning columns: None - Seq(Option("inexistentColumns"), None).foreach { partitionCols => + Seq(Option("nonexistentColumns"), None).foreach { partitionCols => withTempPath { pathToPartitionedTable => df.write.format("parquet").partitionBy("num") .save(pathToPartitionedTable.getCanonicalPath) @@ -589,9 +559,9 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { import testImplicits._ val df = sparkContext.parallelize(1 to 10).map(i => (i, i.toString)).toDF("num", "str") - // Case 1: with partitioning columns but no schema: Option("inexistentColumns") + // Case 1: with partitioning columns but no schema: Option("nonexistentColumns") // Case 2: without schema and partitioning columns: None - Seq(Option("inexistentColumns"), None).foreach { partitionCols => + Seq(Option("nonexistentColumns"), None).foreach { partitionCols => withTempPath { pathToNonPartitionedTable => df.write.format("parquet").save(pathToNonPartitionedTable.getCanonicalPath) checkSchemaInCreatedDataSourceTable( @@ -608,7 +578,7 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { import testImplicits._ val df = sparkContext.parallelize(1 to 10).map(i => (i, i.toString)).toDF("num", "str") - // Case 1: with partitioning columns but no schema: Option("inexistentColumns") + // Case 1: with partitioning columns but no schema: Option("nonexistentColumns") // Case 2: without schema and partitioning columns: None Seq(Option("num"), None).foreach { partitionCols => withTempPath { pathToNonPartitionedTable => @@ -995,55 +965,6 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { } } - test("alter table: rename") { - val catalog = spark.sessionState.catalog - val tableIdent1 = TableIdentifier("tab1", Some("dbx")) - val tableIdent2 = TableIdentifier("tab2", Some("dbx")) - createDatabase(catalog, "dbx") - createDatabase(catalog, "dby") - createTable(catalog, tableIdent1) - - assert(catalog.listTables("dbx") == Seq(tableIdent1)) - sql("ALTER TABLE dbx.tab1 RENAME TO dbx.tab2") - assert(catalog.listTables("dbx") == Seq(tableIdent2)) - - // The database in destination table name can be omitted, and we will use the database of source - // table for it. - sql("ALTER TABLE dbx.tab2 RENAME TO tab1") - assert(catalog.listTables("dbx") == Seq(tableIdent1)) - - catalog.setCurrentDatabase("dbx") - // rename without explicitly specifying database - sql("ALTER TABLE tab1 RENAME TO tab2") - assert(catalog.listTables("dbx") == Seq(tableIdent2)) - // table to rename does not exist - intercept[AnalysisException] { - sql("ALTER TABLE dbx.does_not_exist RENAME TO dbx.tab2") - } - // destination database is different - intercept[AnalysisException] { - sql("ALTER TABLE dbx.tab1 RENAME TO dby.tab2") - } - } - - test("alter table: rename cached table") { - import testImplicits._ - sql("CREATE TABLE students (age INT, name STRING) USING parquet") - val df = (1 to 2).map { i => (i, i.toString) }.toDF("age", "name") - df.write.insertInto("students") - spark.catalog.cacheTable("students") - checkAnswer(spark.table("students"), df) - assert(spark.catalog.isCached("students"), "bad test: table was not cached in the first place") - sql("ALTER TABLE students RENAME TO teachers") - sql("CREATE TABLE students (age INT, name STRING) USING parquet") - // Now we have both students and teachers. - // The cached data for the old students table should not be read by the new students table. - assert(!spark.catalog.isCached("students")) - assert(spark.catalog.isCached("teachers")) - assert(spark.table("students").collect().isEmpty) - checkAnswer(spark.table("teachers"), df) - } - test("rename temporary view - destination table with database name") { withTempView("tab1") { sql( @@ -1202,79 +1123,6 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { assertUnsupported("ALTER TABLE dbx.tab1 NOT STORED AS DIRECTORIES") } - test("alter table: recover partitions (sequential)") { - withSQLConf(RDD_PARALLEL_LISTING_THRESHOLD.key -> "10") { - testRecoverPartitions() - } - } - - test("alter table: recover partition (parallel)") { - withSQLConf(RDD_PARALLEL_LISTING_THRESHOLD.key -> "0") { - testRecoverPartitions() - } - } - - protected def testRecoverPartitions(): Unit = { - val catalog = spark.sessionState.catalog - // table to alter does not exist - intercept[AnalysisException] { - sql("ALTER TABLE does_not_exist RECOVER PARTITIONS") - } - - val tableIdent = TableIdentifier("tab1") - createTable(catalog, tableIdent, partitionCols = Seq("a", "b", "c")) - val part1 = Map("a" -> "1", "b" -> "5", "c" -> "19") - createTablePartition(catalog, part1, tableIdent) - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == Set(part1)) - - val part2 = Map("a" -> "2", "b" -> "6", "c" -> "31") - val root = new Path(catalog.getTableMetadata(tableIdent).location) - val fs = root.getFileSystem(spark.sessionState.newHadoopConf()) - // valid - fs.mkdirs(new Path(new Path(new Path(root, "a=1"), "b=5"), "c=19")) - fs.createNewFile(new Path(new Path(root, "a=1/b=5/c=19"), "a.csv")) // file - fs.createNewFile(new Path(new Path(root, "a=1/b=5/c=19"), "_SUCCESS")) // file - - fs.mkdirs(new Path(new Path(new Path(root, "A=2"), "B=6"), "C=31")) - fs.createNewFile(new Path(new Path(root, "A=2/B=6/C=31"), "b.csv")) // file - fs.createNewFile(new Path(new Path(root, "A=2/B=6/C=31"), "c.csv")) // file - fs.createNewFile(new Path(new Path(root, "A=2/B=6/C=31"), ".hiddenFile")) // file - fs.mkdirs(new Path(new Path(root, "A=2/B=6/C=31"), "_temporary")) - - val parts = (10 to 100).map { a => - val part = Map("a" -> a.toString, "b" -> "5", "c" -> "42") - fs.mkdirs(new Path(new Path(new Path(root, s"a=$a"), "b=5"), "c=42")) - fs.createNewFile(new Path(new Path(root, s"a=$a/b=5/c=42"), "a.csv")) // file - createTablePartition(catalog, part, tableIdent) - part - } - - // invalid - fs.mkdirs(new Path(new Path(root, "a"), "b")) // bad name - fs.mkdirs(new Path(new Path(root, "b=1"), "a=1")) // wrong order - fs.mkdirs(new Path(root, "a=4")) // not enough columns - fs.createNewFile(new Path(new Path(root, "a=1"), "b=4")) // file - fs.createNewFile(new Path(new Path(root, "a=1"), "_SUCCESS")) // _SUCCESS - fs.mkdirs(new Path(new Path(root, "a=1"), "_temporary")) // _temporary - fs.mkdirs(new Path(new Path(root, "a=1"), ".b=4")) // start with . - - try { - sql("ALTER TABLE tab1 RECOVER PARTITIONS") - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == - Set(part1, part2) ++ parts) - if (!isUsingHiveMetastore) { - assert(catalog.getPartition(tableIdent, part1).parameters("numFiles") == "1") - assert(catalog.getPartition(tableIdent, part2).parameters("numFiles") == "2") - } else { - // After ALTER TABLE, the statistics of the first partition is removed by Hive megastore - assert(catalog.getPartition(tableIdent, part1).parameters.get("numFiles").isEmpty) - assert(catalog.getPartition(tableIdent, part2).parameters("numFiles") == "2") - } - } finally { - fs.delete(root, true) - } - } - test("alter table: add partition is not supported for views") { assertUnsupported("ALTER VIEW dbx.tab1 ADD IF NOT EXISTS PARTITION (b='2')") } @@ -1283,36 +1131,6 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { assertUnsupported("ALTER VIEW dbx.tab1 DROP IF EXISTS PARTITION (b='2')") } - - test("show databases") { - sql("CREATE DATABASE showdb2B") - sql("CREATE DATABASE showdb1A") - - // check the result as well as its order - checkDataset(sql("SHOW DATABASES"), Row("default"), Row("showdb1a"), Row("showdb2b")) - - checkAnswer( - sql("SHOW DATABASES LIKE '*db1A'"), - Row("showdb1a") :: Nil) - - checkAnswer( - sql("SHOW DATABASES '*db1A'"), - Row("showdb1a") :: Nil) - - checkAnswer( - sql("SHOW DATABASES LIKE 'showdb1A'"), - Row("showdb1a") :: Nil) - - checkAnswer( - sql("SHOW DATABASES LIKE '*db1A|*db2B'"), - Row("showdb1a") :: - Row("showdb2b") :: Nil) - - checkAnswer( - sql("SHOW DATABASES LIKE 'non-existentdb'"), - Nil) - } - test("drop view - temporary view") { val catalog = spark.sessionState.catalog sql( @@ -1330,35 +1148,17 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { assert(catalog.listTables("default") == Nil) } - protected def testDropTable(isDatasourceTable: Boolean): Unit = { - if (!isUsingHiveMetastore) { - assert(isDatasourceTable, "InMemoryCatalog only supports data source tables") - } - val catalog = spark.sessionState.catalog - val tableIdent = TableIdentifier("tab1", Some("dbx")) - createDatabase(catalog, "dbx") - createTable(catalog, tableIdent, isDatasourceTable) - assert(catalog.listTables("dbx") == Seq(tableIdent)) - sql("DROP TABLE dbx.tab1") - assert(catalog.listTables("dbx") == Nil) - sql("DROP TABLE IF EXISTS dbx.tab1") - intercept[AnalysisException] { - sql("DROP TABLE dbx.tab1") - } - } - test("drop view") { val catalog = spark.sessionState.catalog val tableIdent = TableIdentifier("tab1", Some("dbx")) createDatabase(catalog, "dbx") createTable(catalog, tableIdent) assert(catalog.listTables("dbx") == Seq(tableIdent)) - val e = intercept[AnalysisException] { sql("DROP VIEW dbx.tab1") } - assert( - e.getMessage.contains("Cannot drop a table with DROP VIEW. Please use DROP TABLE instead")) + assert(e.getMessage.contains( + "dbx.tab1 is a table. 'DROP VIEW' expects a view. Please use DROP TABLE instead.")) } protected def testSetProperties(isDatasourceTable: Boolean): Unit = { @@ -1461,6 +1261,17 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { // set table partition location sql("ALTER TABLE dbx.tab1 PARTITION (a='1', b='2') SET LOCATION '/path/to/part/ways'") verifyLocation(new URI("/path/to/part/ways"), Some(partSpec)) + // set location for partition spec in the upper case + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + sql("ALTER TABLE dbx.tab1 PARTITION (A='1', B='2') SET LOCATION '/path/to/part/ways2'") + verifyLocation(new URI("/path/to/part/ways2"), Some(partSpec)) + } + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + val errMsg = intercept[AnalysisException] { + sql("ALTER TABLE dbx.tab1 PARTITION (A='1', B='2') SET LOCATION '/path/to/part/ways3'") + }.getMessage + assert(errMsg.contains("not a valid partition column")) + } // set table location without explicitly specifying database catalog.setCurrentDatabase("dbx") sql("ALTER TABLE tab1 SET LOCATION '/swanky/steak/place'") @@ -1612,160 +1423,6 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { } } - protected def testAddPartitions(isDatasourceTable: Boolean): Unit = { - if (!isUsingHiveMetastore) { - assert(isDatasourceTable, "InMemoryCatalog only supports data source tables") - } - val catalog = spark.sessionState.catalog - val tableIdent = TableIdentifier("tab1", Some("dbx")) - val part1 = Map("a" -> "1", "b" -> "5") - val part2 = Map("a" -> "2", "b" -> "6") - val part3 = Map("a" -> "3", "b" -> "7") - val part4 = Map("a" -> "4", "b" -> "8") - val part5 = Map("a" -> "9", "b" -> "9") - createDatabase(catalog, "dbx") - createTable(catalog, tableIdent, isDatasourceTable) - createTablePartition(catalog, part1, tableIdent) - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == Set(part1)) - - // basic add partition - sql("ALTER TABLE dbx.tab1 ADD IF NOT EXISTS " + - "PARTITION (a='2', b='6') LOCATION 'paris' PARTITION (a='3', b='7')") - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == Set(part1, part2, part3)) - assert(catalog.getPartition(tableIdent, part1).storage.locationUri.isDefined) - - val tableLocation = catalog.getTableMetadata(tableIdent).storage.locationUri - assert(tableLocation.isDefined) - val partitionLocation = makeQualifiedPath( - new Path(tableLocation.get.toString, "paris").toString) - - assert(catalog.getPartition(tableIdent, part2).storage.locationUri == Option(partitionLocation)) - assert(catalog.getPartition(tableIdent, part3).storage.locationUri.isDefined) - - // add partitions without explicitly specifying database - catalog.setCurrentDatabase("dbx") - sql("ALTER TABLE tab1 ADD IF NOT EXISTS PARTITION (a='4', b='8')") - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == - Set(part1, part2, part3, part4)) - - // table to alter does not exist - intercept[AnalysisException] { - sql("ALTER TABLE does_not_exist ADD IF NOT EXISTS PARTITION (a='4', b='9')") - } - - // partition to add already exists - intercept[AnalysisException] { - sql("ALTER TABLE tab1 ADD PARTITION (a='4', b='8')") - } - - // partition to add already exists when using IF NOT EXISTS - sql("ALTER TABLE tab1 ADD IF NOT EXISTS PARTITION (a='4', b='8')") - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == - Set(part1, part2, part3, part4)) - - // partition spec in ADD PARTITION should be case insensitive by default - sql("ALTER TABLE tab1 ADD PARTITION (A='9', B='9')") - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == - Set(part1, part2, part3, part4, part5)) - } - - protected def testDropPartitions(isDatasourceTable: Boolean): Unit = { - if (!isUsingHiveMetastore) { - assert(isDatasourceTable, "InMemoryCatalog only supports data source tables") - } - val catalog = spark.sessionState.catalog - val tableIdent = TableIdentifier("tab1", Some("dbx")) - val part1 = Map("a" -> "1", "b" -> "5") - val part2 = Map("a" -> "2", "b" -> "6") - val part3 = Map("a" -> "3", "b" -> "7") - val part4 = Map("a" -> "4", "b" -> "8") - val part5 = Map("a" -> "9", "b" -> "9") - createDatabase(catalog, "dbx") - createTable(catalog, tableIdent, isDatasourceTable) - createTablePartition(catalog, part1, tableIdent) - createTablePartition(catalog, part2, tableIdent) - createTablePartition(catalog, part3, tableIdent) - createTablePartition(catalog, part4, tableIdent) - createTablePartition(catalog, part5, tableIdent) - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == - Set(part1, part2, part3, part4, part5)) - - // basic drop partition - sql("ALTER TABLE dbx.tab1 DROP IF EXISTS PARTITION (a='4', b='8'), PARTITION (a='3', b='7')") - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == Set(part1, part2, part5)) - - // drop partitions without explicitly specifying database - catalog.setCurrentDatabase("dbx") - sql("ALTER TABLE tab1 DROP IF EXISTS PARTITION (a='2', b ='6')") - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == Set(part1, part5)) - - // table to alter does not exist - intercept[AnalysisException] { - sql("ALTER TABLE does_not_exist DROP IF EXISTS PARTITION (a='2')") - } - - // partition to drop does not exist - intercept[AnalysisException] { - sql("ALTER TABLE tab1 DROP PARTITION (a='300')") - } - - // partition to drop does not exist when using IF EXISTS - sql("ALTER TABLE tab1 DROP IF EXISTS PARTITION (a='300')") - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == Set(part1, part5)) - - // partition spec in DROP PARTITION should be case insensitive by default - sql("ALTER TABLE tab1 DROP PARTITION (A='1', B='5')") - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == Set(part5)) - - // use int literal as partition value for int type partition column - sql("ALTER TABLE tab1 DROP PARTITION (a=9, b=9)") - assert(catalog.listPartitions(tableIdent).isEmpty) - } - - protected def testRenamePartitions(isDatasourceTable: Boolean): Unit = { - if (!isUsingHiveMetastore) { - assert(isDatasourceTable, "InMemoryCatalog only supports data source tables") - } - val catalog = spark.sessionState.catalog - val tableIdent = TableIdentifier("tab1", Some("dbx")) - val part1 = Map("a" -> "1", "b" -> "q") - val part2 = Map("a" -> "2", "b" -> "c") - val part3 = Map("a" -> "3", "b" -> "p") - createDatabase(catalog, "dbx") - createTable(catalog, tableIdent, isDatasourceTable) - createTablePartition(catalog, part1, tableIdent) - createTablePartition(catalog, part2, tableIdent) - createTablePartition(catalog, part3, tableIdent) - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == Set(part1, part2, part3)) - - // basic rename partition - sql("ALTER TABLE dbx.tab1 PARTITION (a='1', b='q') RENAME TO PARTITION (a='100', b='p')") - sql("ALTER TABLE dbx.tab1 PARTITION (a='2', b='c') RENAME TO PARTITION (a='20', b='c')") - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == - Set(Map("a" -> "100", "b" -> "p"), Map("a" -> "20", "b" -> "c"), Map("a" -> "3", "b" -> "p"))) - - // rename without explicitly specifying database - catalog.setCurrentDatabase("dbx") - sql("ALTER TABLE tab1 PARTITION (a='100', b='p') RENAME TO PARTITION (a='10', b='p')") - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == - Set(Map("a" -> "10", "b" -> "p"), Map("a" -> "20", "b" -> "c"), Map("a" -> "3", "b" -> "p"))) - - // table to alter does not exist - intercept[NoSuchTableException] { - sql("ALTER TABLE does_not_exist PARTITION (c='3') RENAME TO PARTITION (c='333')") - } - - // partition to rename does not exist - intercept[NoSuchPartitionException] { - sql("ALTER TABLE tab1 PARTITION (a='not_found', b='1') RENAME TO PARTITION (a='1', b='2')") - } - - // partition spec in RENAME PARTITION should be case insensitive by default - sql("ALTER TABLE tab1 PARTITION (A='10', B='p') RENAME TO PARTITION (A='1', B='p')") - assert(catalog.listPartitions(tableIdent).map(_.spec).toSet == - Set(Map("a" -> "1", "b" -> "p"), Map("a" -> "20", "b" -> "c"), Map("a" -> "3", "b" -> "p"))) - } - protected def testChangeColumn(isDatasourceTable: Boolean): Unit = { if (!isUsingHiveMetastore) { assert(isDatasourceTable, "InMemoryCatalog only supports data source tables") @@ -1853,6 +1510,7 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { "Returns the concatenation of col1, col2, ..., colN.") :: Nil ) // extended mode + // scalastyle:off whitespace.end.of.line checkAnswer( sql("DESCRIBE FUNCTION EXTENDED ^"), Row("Class: org.apache.spark.sql.catalyst.expressions.BitwiseXor") :: @@ -1861,11 +1519,14 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { | Examples: | > SELECT 3 ^ 5; | 6 - | """.stripMargin) :: + | + | Since: 1.4.0 + |""".stripMargin) :: Row("Function: ^") :: Row("Usage: expr1 ^ expr2 - Returns the result of " + "bitwise exclusive OR of `expr1` and `expr2`.") :: Nil ) + // scalastyle:on whitespace.end.of.line } test("create a data source table without schema") { @@ -1897,7 +1558,7 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { |OPTIONS ( | path '${tempDir.getCanonicalPath}' |) - |CLUSTERED BY (inexistentColumnA) SORTED BY (inexistentColumnB) INTO 2 BUCKETS + |CLUSTERED BY (nonexistentColumnA) SORTED BY (nonexistentColumnB) INTO 2 BUCKETS """.stripMargin) } assert(e.message == "Cannot specify bucketing information if the table schema is not " + @@ -1951,160 +1612,6 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { } } - test("truncate table - datasource table") { - import testImplicits._ - - val data = (1 to 10).map { i => (i, i) }.toDF("width", "length") - // Test both a Hive compatible and incompatible code path. - Seq("json", "parquet").foreach { format => - withTable("rectangles") { - data.write.format(format).saveAsTable("rectangles") - assert(spark.table("rectangles").collect().nonEmpty, - "bad test; table was empty to begin with") - - sql("TRUNCATE TABLE rectangles") - assert(spark.table("rectangles").collect().isEmpty) - - // not supported since the table is not partitioned - assertUnsupported("TRUNCATE TABLE rectangles PARTITION (width=1)") - } - } - } - - test("truncate partitioned table - datasource table") { - import testImplicits._ - - val data = (1 to 10).map { i => (i % 3, i % 5, i) }.toDF("width", "length", "height") - - withTable("partTable") { - data.write.partitionBy("width", "length").saveAsTable("partTable") - // supported since partitions are stored in the metastore - sql("TRUNCATE TABLE partTable PARTITION (width=1, length=1)") - assert(spark.table("partTable").filter($"width" === 1).collect().nonEmpty) - assert(spark.table("partTable").filter($"width" === 1 && $"length" === 1).collect().isEmpty) - } - - withTable("partTable") { - data.write.partitionBy("width", "length").saveAsTable("partTable") - // support partial partition spec - sql("TRUNCATE TABLE partTable PARTITION (width=1)") - assert(spark.table("partTable").collect().nonEmpty) - assert(spark.table("partTable").filter($"width" === 1).collect().isEmpty) - } - - withTable("partTable") { - data.write.partitionBy("width", "length").saveAsTable("partTable") - // do nothing if no partition is matched for the given partial partition spec - sql("TRUNCATE TABLE partTable PARTITION (width=100)") - assert(spark.table("partTable").count() == data.count()) - - // throw exception if no partition is matched for the given non-partial partition spec. - intercept[NoSuchPartitionException] { - sql("TRUNCATE TABLE partTable PARTITION (width=100, length=100)") - } - - // throw exception if the column in partition spec is not a partition column. - val e = intercept[AnalysisException] { - sql("TRUNCATE TABLE partTable PARTITION (unknown=1)") - } - assert(e.message.contains("unknown is not a valid partition column")) - } - } - - test("SPARK-30312: truncate table - keep acl/permission") { - import testImplicits._ - val ignorePermissionAcl = Seq(true, false) - - ignorePermissionAcl.foreach { ignore => - withSQLConf( - "fs.file.impl" -> classOf[FakeLocalFsFileSystem].getName, - "fs.file.impl.disable.cache" -> "true", - SQLConf.TRUNCATE_TABLE_IGNORE_PERMISSION_ACL.key -> ignore.toString) { - withTable("tab1") { - sql("CREATE TABLE tab1 (col INT) USING parquet") - sql("INSERT INTO tab1 SELECT 1") - checkAnswer(spark.table("tab1"), Row(1)) - - val tablePath = new Path(spark.sessionState.catalog - .getTableMetadata(TableIdentifier("tab1")).storage.locationUri.get) - - val hadoopConf = spark.sessionState.newHadoopConf() - val fs = tablePath.getFileSystem(hadoopConf) - val fileStatus = fs.getFileStatus(tablePath); - - fs.setPermission(tablePath, new FsPermission("777")) - assert(fileStatus.getPermission().toString() == "rwxrwxrwx") - - // Set ACL to table path. - val customAcl = new java.util.ArrayList[AclEntry]() - customAcl.add(new AclEntry.Builder() - .setName("test") - .setType(AclEntryType.USER) - .setScope(AclEntryScope.ACCESS) - .setPermission(FsAction.READ).build()) - fs.setAcl(tablePath, customAcl) - assert(fs.getAclStatus(tablePath).getEntries().get(0) == customAcl.get(0)) - - sql("TRUNCATE TABLE tab1") - assert(spark.table("tab1").collect().isEmpty) - - val fileStatus2 = fs.getFileStatus(tablePath) - if (ignore) { - assert(fileStatus2.getPermission().toString() != "rwxrwxrwx") - } else { - assert(fileStatus2.getPermission().toString() == "rwxrwxrwx") - } - val aclEntries = fs.getAclStatus(tablePath).getEntries() - if (ignore) { - assert(aclEntries.size() == 0) - } else { - assert(aclEntries.size() == 4) - assert(aclEntries.get(0) == customAcl.get(0)) - - // Setting ACLs will also set user/group/other permissions - // as ACL entries. - val user = new AclEntry.Builder() - .setType(AclEntryType.USER) - .setScope(AclEntryScope.ACCESS) - .setPermission(FsAction.ALL).build() - val group = new AclEntry.Builder() - .setType(AclEntryType.GROUP) - .setScope(AclEntryScope.ACCESS) - .setPermission(FsAction.ALL).build() - val other = new AclEntry.Builder() - .setType(AclEntryType.OTHER) - .setScope(AclEntryScope.ACCESS) - .setPermission(FsAction.ALL).build() - assert(aclEntries.get(1) == user) - assert(aclEntries.get(2) == group) - assert(aclEntries.get(3) == other) - } - } - } - } - } - - test("SPARK-31163: acl/permission should handle non-existed path when truncating table") { - withSQLConf(SQLConf.TRUNCATE_TABLE_IGNORE_PERMISSION_ACL.key -> "false") { - withTable("tab1") { - sql("CREATE TABLE tab1 (col1 STRING, col2 INT) USING parquet PARTITIONED BY (col2)") - sql("INSERT INTO tab1 SELECT 'one', 1") - checkAnswer(spark.table("tab1"), Row("one", 1)) - val part = spark.sessionState.catalog.listPartitions(TableIdentifier("tab1")).head - val path = new File(part.location.getPath) - sql("TRUNCATE TABLE tab1") - // simulate incomplete/unsuccessful truncate - assert(path.exists()) - path.delete() - assert(!path.exists()) - // execute without java.io.FileNotFoundException - sql("TRUNCATE TABLE tab1") - // partition path should be re-created - assert(path.exists()) - } - } - } - test("create temporary view with mismatched schema") { withTable("tab1") { spark.range(10).write.saveAsTable("tab1") @@ -2148,31 +1655,6 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { } } - test("truncate table - external table, temporary table, view (not allowed)") { - import testImplicits._ - withTempPath { tempDir => - withTable("my_ext_tab") { - (("a", "b") :: Nil).toDF().write.parquet(tempDir.getCanonicalPath) - (1 to 10).map { i => (i, i) }.toDF("a", "b").createTempView("my_temp_tab") - sql(s"CREATE TABLE my_ext_tab using parquet LOCATION '${tempDir.toURI}'") - sql(s"CREATE VIEW my_view AS SELECT 1") - intercept[NoSuchTableException] { - sql("TRUNCATE TABLE my_temp_tab") - } - assertUnsupported("TRUNCATE TABLE my_ext_tab") - assertUnsupported("TRUNCATE TABLE my_view") - } - } - } - - test("truncate table - non-partitioned table (not allowed)") { - withTable("my_tab") { - sql("CREATE TABLE my_tab (age INT, name STRING) using parquet") - sql("INSERT INTO my_tab values (10, 'a')") - assertUnsupported("TRUNCATE TABLE my_tab PARTITION (age=10)") - } - } - test("SPARK-16034 Partition columns should match when appending to existing data source tables") { import testImplicits._ val df = Seq((1, 2, 3)).toDF("a", "b", "c") @@ -2217,6 +1699,7 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { test("show functions") { withUserDefinedFunction("add_one" -> true) { val numFunctions = FunctionRegistry.functionSet.size.toLong + + TableFunctionRegistry.functionSet.size.toLong + FunctionsCommand.virtualOperators.size.toLong assert(sql("show functions").count() === numFunctions) assert(sql("show system functions").count() === numFunctions) @@ -2249,6 +1732,17 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { } } + test("show columns - invalid db name") { + withTable("tbl") { + sql("CREATE TABLE tbl(col1 int, col2 string) USING parquet ") + val message = intercept[AnalysisException] { + sql("SHOW COLUMNS IN tbl FROM a.b.c") + }.getMessage + assert(message.contains( + "Table or view not found: a.b.c.tbl")) + } + } + test("SPARK-18009 calling toLocalIterator on commands") { import scala.collection.JavaConverters._ val df = sql("show databases") @@ -3020,6 +2514,77 @@ abstract class DDLSuite extends QueryTest with SQLTestUtils { } } } + + test("REFRESH FUNCTION") { + val msg = intercept[AnalysisException] { + sql("REFRESH FUNCTION md5") + }.getMessage + assert(msg.contains("Cannot refresh built-in function")) + val msg2 = intercept[NoSuchFunctionException] { + sql("REFRESH FUNCTION default.md5") + }.getMessage + assert(msg2.contains(s"Undefined function: 'md5'. This function is neither a registered " + + s"temporary function nor a permanent function registered in the database 'default'.")) + + withUserDefinedFunction("func1" -> true) { + sql("CREATE TEMPORARY FUNCTION func1 AS 'test.org.apache.spark.sql.MyDoubleAvg'") + val msg = intercept[AnalysisException] { + sql("REFRESH FUNCTION func1") + }.getMessage + assert(msg.contains("Cannot refresh temporary function")) + } + + withUserDefinedFunction("func1" -> false) { + val func = FunctionIdentifier("func1", Some("default")) + assert(!spark.sessionState.catalog.isRegisteredFunction(func)) + intercept[NoSuchFunctionException] { + sql("REFRESH FUNCTION func1") + } + assert(!spark.sessionState.catalog.isRegisteredFunction(func)) + + sql("CREATE FUNCTION func1 AS 'test.org.apache.spark.sql.MyDoubleAvg'") + assert(!spark.sessionState.catalog.isRegisteredFunction(func)) + sql("REFRESH FUNCTION func1") + assert(spark.sessionState.catalog.isRegisteredFunction(func)) + val msg = intercept[NoSuchFunctionException] { + sql("REFRESH FUNCTION func2") + }.getMessage + assert(msg.contains(s"Undefined function: 'func2'. This function is neither a registered " + + s"temporary function nor a permanent function registered in the database 'default'.")) + assert(spark.sessionState.catalog.isRegisteredFunction(func)) + + spark.sessionState.catalog.externalCatalog.dropFunction("default", "func1") + assert(spark.sessionState.catalog.isRegisteredFunction(func)) + intercept[NoSuchFunctionException] { + sql("REFRESH FUNCTION func1") + } + assert(!spark.sessionState.catalog.isRegisteredFunction(func)) + + val function = CatalogFunction(func, "test.non.exists.udf", Seq.empty) + spark.sessionState.catalog.createFunction(function, false) + assert(!spark.sessionState.catalog.isRegisteredFunction(func)) + val err = intercept[AnalysisException] { + sql("REFRESH FUNCTION func1") + }.getMessage + assert(err.contains("Can not load class")) + assert(!spark.sessionState.catalog.isRegisteredFunction(func)) + } + } + + test("REFRESH FUNCTION persistent function with the same name as the built-in function") { + withUserDefinedFunction("default.rand" -> false) { + val rand = FunctionIdentifier("rand", Some("default")) + sql("CREATE FUNCTION rand AS 'test.org.apache.spark.sql.MyDoubleAvg'") + assert(!spark.sessionState.catalog.isRegisteredFunction(rand)) + val msg = intercept[AnalysisException] { + sql("REFRESH FUNCTION rand") + }.getMessage + assert(msg.contains("Cannot refresh built-in function")) + assert(!spark.sessionState.catalog.isRegisteredFunction(rand)) + sql("REFRESH FUNCTION default.rand") + assert(spark.sessionState.catalog.isRegisteredFunction(rand)) + } + } } object FakeLocalFsFileSystem { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DropTableParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DropTableParserSuite.scala new file mode 100644 index 0000000000000..60c7cd8dd6f8b --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DropTableParserSuite.scala @@ -0,0 +1,59 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedTableOrView} +import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parsePlan +import org.apache.spark.sql.catalyst.plans.logical.{DropTable, LogicalPlan} +import org.apache.spark.sql.test.SharedSparkSession + +class DropTableParserSuite extends AnalysisTest with SharedSparkSession { + private def parseCompare(sql: String, expected: LogicalPlan): Unit = { + comparePlans(parsePlan(sql), expected, checkAnalysis = false) + } + + test("drop table") { + parseCompare("DROP TABLE testcat.ns1.ns2.tbl", + DropTable( + UnresolvedTableOrView(Seq("testcat", "ns1", "ns2", "tbl"), "DROP TABLE", true), + ifExists = false, + purge = false)) + parseCompare(s"DROP TABLE db.tab", + DropTable( + UnresolvedTableOrView(Seq("db", "tab"), "DROP TABLE", true), + ifExists = false, + purge = false)) + parseCompare(s"DROP TABLE IF EXISTS db.tab", + DropTable( + UnresolvedTableOrView(Seq("db", "tab"), "DROP TABLE", true), + ifExists = true, + purge = false)) + parseCompare(s"DROP TABLE tab", + DropTable( + UnresolvedTableOrView(Seq("tab"), "DROP TABLE", true), ifExists = false, purge = false)) + parseCompare(s"DROP TABLE IF EXISTS tab", + DropTable( + UnresolvedTableOrView(Seq("tab"), "DROP TABLE", true), ifExists = true, purge = false)) + parseCompare(s"DROP TABLE tab PURGE", + DropTable( + UnresolvedTableOrView(Seq("tab"), "DROP TABLE", true), ifExists = false, purge = true)) + parseCompare(s"DROP TABLE IF EXISTS tab PURGE", + DropTable( + UnresolvedTableOrView(Seq("tab"), "DROP TABLE", true), ifExists = true, purge = true)) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DropTableSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DropTableSuiteBase.scala new file mode 100644 index 0000000000000..3c9b39af8ef22 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DropTableSuiteBase.scala @@ -0,0 +1,126 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.{AnalysisException, QueryTest, Row} + +/** + * This base suite contains unified tests for the `DROP TABLE` command that check V1 and V2 + * table catalogs. The tests that cannot run for all supported catalogs are located in more + * specific test suites: + * + * - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.DropTableSuite` + * - V1 table catalog tests: `org.apache.spark.sql.execution.command.v1.DropTableSuiteBase` + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DropTableSuite` + * - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.DropTableSuite` + */ +trait DropTableSuiteBase extends QueryTest with DDLCommandTestUtils { + override val command = "DROP TABLE" + + protected def createTable(tableName: String): Unit = { + sql(s"CREATE TABLE $tableName (c int) $defaultUsing") + sql(s"INSERT INTO $tableName SELECT 0") + } + + test("basic") { + withNamespace(s"$catalog.ns") { + sql(s"CREATE NAMESPACE $catalog.ns") + + createTable(s"$catalog.ns.tbl") + checkTables("ns", "tbl") + + sql(s"DROP TABLE $catalog.ns.tbl") + checkTables("ns") // no tables + } + } + + test("try to drop a nonexistent table") { + withNamespace(s"$catalog.ns") { + sql(s"CREATE NAMESPACE $catalog.ns") + checkTables("ns") // no tables + + val errMsg = intercept[AnalysisException] { + sql(s"DROP TABLE $catalog.ns.tbl") + }.getMessage + assert(errMsg.contains("Table or view not found")) + } + } + + test("with IF EXISTS") { + withNamespace(s"$catalog.ns") { + sql(s"CREATE NAMESPACE $catalog.ns") + + createTable(s"$catalog.ns.tbl") + checkTables("ns", "tbl") + sql(s"DROP TABLE IF EXISTS $catalog.ns.tbl") + checkTables("ns") + + // It must not throw any exceptions + sql(s"DROP TABLE IF EXISTS $catalog.ns.tbl") + checkTables("ns") + } + } + + test("SPARK-33174: DROP TABLE should resolve to a temporary view first") { + withNamespaceAndTable("ns", "t") { t => + withTempView("t") { + sql(s"CREATE TABLE $t (id bigint) $defaultUsing") + sql("CREATE TEMPORARY VIEW t AS SELECT 2") + sql(s"USE $catalog.ns") + try { + // Check the temporary view 't' exists. + checkAnswer( + sql("SHOW TABLES FROM spark_catalog.default LIKE 't'") + .select("tableName", "isTemporary"), + Row("t", true)) + sql("DROP TABLE t") + // Verify that the temporary view 't' is resolved first and dropped. + checkAnswer( + sql("SHOW TABLES FROM spark_catalog.default LIKE 't'") + .select("tableName", "isTemporary"), + Seq.empty) + } finally { + sql(s"USE spark_catalog") + } + } + } + } + + test("SPARK-33305: DROP TABLE should also invalidate cache") { + val t = s"$catalog.ns.tbl" + val view = "view" + withNamespace(s"$catalog.ns") { + sql(s"CREATE NAMESPACE $catalog.ns") + withTempView(view, "source") { + val df = spark.createDataFrame(Seq((1L, "a"), (2L, "b"), (3L, "c"))).toDF("id", "data") + df.createOrReplaceTempView("source") + sql(s"CREATE TABLE $t $defaultUsing AS SELECT id, data FROM source") + sql(s"CACHE TABLE $view AS SELECT id FROM $t") + checkAnswer(sql(s"SELECT * FROM $t"), spark.table("source").collect()) + checkAnswer( + sql(s"SELECT * FROM $view"), + spark.table("source").select("id").collect()) + + val oldTable = spark.table(view) + assert(spark.sharedState.cacheManager.lookupCachedData(oldTable).isDefined) + sql(s"DROP TABLE $t") + assert(spark.sharedState.cacheManager.lookupCachedData(oldTable).isEmpty) + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/MsckRepairTableParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/MsckRepairTableParserSuite.scala new file mode 100644 index 0000000000000..458b3a4fc3c8d --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/MsckRepairTableParserSuite.scala @@ -0,0 +1,69 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedTable} +import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parsePlan +import org.apache.spark.sql.catalyst.plans.logical.RepairTable + +class MsckRepairTableParserSuite extends AnalysisTest { + test("repair a table") { + comparePlans( + parsePlan("MSCK REPAIR TABLE a.b.c"), + RepairTable( + UnresolvedTable(Seq("a", "b", "c"), "MSCK REPAIR TABLE", None), + enableAddPartitions = true, + enableDropPartitions = false)) + } + + test("add partitions") { + comparePlans( + parsePlan("msck repair table ns.tbl add partitions"), + RepairTable( + UnresolvedTable( + Seq("ns", "tbl"), + "MSCK REPAIR TABLE ... ADD PARTITIONS", + None), + enableAddPartitions = true, + enableDropPartitions = false)) + } + + test("drop partitions") { + comparePlans( + parsePlan("MSCK repair table TBL Drop Partitions"), + RepairTable( + UnresolvedTable( + Seq("TBL"), + "MSCK REPAIR TABLE ... DROP PARTITIONS", + None), + enableAddPartitions = false, + enableDropPartitions = true)) + } + + test("sync partitions") { + comparePlans( + parsePlan("MSCK REPAIR TABLE spark_catalog.ns.tbl SYNC PARTITIONS"), + RepairTable( + UnresolvedTable( + Seq("spark_catalog", "ns", "tbl"), + "MSCK REPAIR TABLE ... SYNC PARTITIONS", + None), + enableAddPartitions = true, + enableDropPartitions = true)) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/MsckRepairTableSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/MsckRepairTableSuiteBase.scala new file mode 100644 index 0000000000000..b8b0d003a314c --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/MsckRepairTableSuiteBase.scala @@ -0,0 +1,38 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.QueryTest + +/** + * This base suite contains unified tests for the `MSCK REPAIR TABLE` command that + * check V1 and V2 table catalogs. The tests that cannot run for all supported catalogs are + * located in more specific test suites: + * + * - V2 table catalog tests: + * `org.apache.spark.sql.execution.command.v2.MsckRepairTableSuite` + * - V1 table catalog tests: + * `org.apache.spark.sql.execution.command.v1.MsckRepairTableSuiteBase` + * - V1 In-Memory catalog: + * `org.apache.spark.sql.execution.command.v1.MsckRepairTableSuite` + * - V1 Hive External catalog: + * `org.apache.spark.sql.hive.execution.command.MsckRepairTableSuite` + */ +trait MsckRepairTableSuiteBase extends QueryTest with DDLCommandTestUtils { + override val command = "MSCK REPAIR TABLE" +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/PlanResolutionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/PlanResolutionSuite.scala index 2d6a5da6d67f7..d48264c6d1c43 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/PlanResolutionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/PlanResolutionSuite.scala @@ -26,19 +26,21 @@ import org.mockito.invocation.InvocationOnMock import org.apache.spark.sql.{AnalysisException, SaveMode} import org.apache.spark.sql.catalyst.{AliasIdentifier, TableIdentifier} -import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, Analyzer, CTESubstitution, EmptyFunctionRegistry, NoSuchTableException, ResolveCatalogs, ResolvedTable, ResolveInlineTables, ResolveSessionCatalog, UnresolvedAttribute, UnresolvedRelation, UnresolvedStar, UnresolvedSubqueryColumnAliases, UnresolvedV2Relation} +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, Analyzer, EmptyFunctionRegistry, NoSuchTableException, ResolvedTable, ResolveSessionCatalog, UnresolvedAttribute, UnresolvedRelation, UnresolvedSubqueryColumnAliases, UnresolvedTable} import org.apache.spark.sql.catalyst.catalog.{BucketSpec, CatalogStorageFormat, CatalogTable, CatalogTableType, InMemoryCatalog, SessionCatalog} -import org.apache.spark.sql.catalyst.expressions.{AttributeReference, EqualTo, Expression, InSubquery, IntegerLiteral, ListQuery, StringLiteral} -import org.apache.spark.sql.catalyst.parser.CatalystSqlParser -import org.apache.spark.sql.catalyst.plans.logical.{AlterTable, Assignment, CreateTableAsSelect, CreateV2Table, DeleteAction, DeleteFromTable, DescribeRelation, DropTable, InsertAction, InsertIntoStatement, LocalRelation, LogicalPlan, MergeIntoTable, OneRowRelation, Project, ShowTableProperties, SubqueryAlias, UpdateAction, UpdateTable} +import org.apache.spark.sql.catalyst.expressions.{AttributeReference, EqualTo, Expression, InSubquery, IntegerLiteral, ListQuery, Literal, StringLiteral} +import org.apache.spark.sql.catalyst.parser.{CatalystSqlParser, ParseException} +import org.apache.spark.sql.catalyst.plans.logical.{AlterTable, AnalysisOnlyCommand, AppendData, Assignment, CreateTableAsSelect, CreateTableStatement, CreateV2Table, DeleteAction, DeleteFromTable, DescribeRelation, DropTable, InsertAction, LocalRelation, LogicalPlan, MergeIntoTable, OneRowRelation, Project, SetTableLocation, SetTableProperties, ShowTableProperties, SubqueryAlias, UnsetTableProperties, UpdateAction, UpdateTable} +import org.apache.spark.sql.catalyst.rules.Rule import org.apache.spark.sql.connector.FakeV2Provider import org.apache.spark.sql.connector.catalog.{CatalogManager, CatalogNotFoundException, Identifier, Table, TableCapability, TableCatalog, TableChange, V1Table} import org.apache.spark.sql.connector.catalog.TableChange.{UpdateColumnComment, UpdateColumnType} +import org.apache.spark.sql.connector.expressions.Transform import org.apache.spark.sql.execution.datasources.CreateTable import org.apache.spark.sql.execution.datasources.v2.DataSourceV2Relation -import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.internal.{HiveSerDe, SQLConf} import org.apache.spark.sql.sources.SimpleScanSource -import org.apache.spark.sql.types.{CharType, DoubleType, HIVE_TYPE_STRING, IntegerType, LongType, MetadataBuilder, StringType, StructField, StructType} +import org.apache.spark.sql.types.{BooleanType, CharType, DoubleType, IntegerType, LongType, StringType, StructField, StructType} class PlanResolutionSuite extends AnalysisTest { import CatalystSqlParser._ @@ -49,6 +51,21 @@ class PlanResolutionSuite extends AnalysisTest { private val table: Table = { val t = mock(classOf[Table]) when(t.schema()).thenReturn(new StructType().add("i", "int").add("s", "string")) + when(t.partitioning()).thenReturn(Array.empty[Transform]) + t + } + + private val table1: Table = { + val t = mock(classOf[Table]) + when(t.schema()).thenReturn(new StructType().add("s", "string").add("i", "int")) + when(t.partitioning()).thenReturn(Array.empty[Transform]) + t + } + + private val table2: Table = { + val t = mock(classOf[Table]) + when(t.schema()).thenReturn(new StructType().add("i", "int").add("x", "string")) + when(t.partitioning()).thenReturn(Array.empty[Transform]) t } @@ -75,12 +92,21 @@ class PlanResolutionSuite extends AnalysisTest { V1Table(t) } + private val view: V1Table = { + val t = mock(classOf[CatalogTable]) + when(t.schema).thenReturn(new StructType().add("i", "int").add("s", "string")) + when(t.tableType).thenReturn(CatalogTableType.VIEW) + when(t.provider).thenReturn(Some(v1Format)) + V1Table(t) + } + private val testCat: TableCatalog = { val newCatalog = mock(classOf[TableCatalog]) when(newCatalog.loadTable(any())).thenAnswer((invocation: InvocationOnMock) => { invocation.getArgument[Identifier](0).name match { case "tab" => table - case "tab1" => table + case "tab1" => table1 + case "tab2" => table2 case name => throw new NoSuchTableException(name) } }) @@ -96,8 +122,9 @@ class PlanResolutionSuite extends AnalysisTest { case "v1Table1" => v1Table case "v1HiveTable" => v1HiveTable case "v2Table" => table - case "v2Table1" => table + case "v2Table1" => table1 case "v2TableWithAcceptAnySchemaCapability" => tableWithAcceptAnySchemaCapability + case "view" => view case name => throw new NoSuchTableException(name) } }) @@ -109,7 +136,7 @@ class PlanResolutionSuite extends AnalysisTest { new InMemoryCatalog, EmptyFunctionRegistry, new SQLConf().copy(SQLConf.CASE_SENSITIVE -> true)) - v1SessionCatalog.createTempView("v", LocalRelation(Nil), false) + createTempView(v1SessionCatalog, "v", LocalRelation(Nil), false) private val catalogManagerWithDefault = { val manager = mock(classOf[CatalogManager]) @@ -145,28 +172,26 @@ class PlanResolutionSuite extends AnalysisTest { manager } - def parseAndResolve(query: String, withDefault: Boolean = false): LogicalPlan = { + def parseAndResolve( + query: String, + withDefault: Boolean = false, + checkAnalysis: Boolean = false): LogicalPlan = { val catalogManager = if (withDefault) { catalogManagerWithDefault } else { catalogManagerWithoutDefault } - val analyzer = new Analyzer(catalogManager, conf) - // TODO: run the analyzer directly. - val rules = Seq( - CTESubstitution, - ResolveInlineTables(conf), - analyzer.ResolveRelations, - new ResolveCatalogs(catalogManager), - new ResolveSessionCatalog(catalogManager, conf, _ == Seq("v"), _ => false), - analyzer.ResolveTables, - analyzer.ResolveReferences, - analyzer.ResolveSubqueryColumnAliases, - analyzer.ResolveReferences, - analyzer.ResolveAlterTableChanges) - rules.foldLeft(parsePlan(query)) { - case (plan, rule) => rule.apply(plan) + val analyzer = new Analyzer(catalogManager) { + override val extendedResolutionRules: Seq[Rule[LogicalPlan]] = Seq( + new ResolveSessionCatalog(catalogManager)) + } + // We don't check analysis here by default, as we expect the plan to be unresolved + // such as `CreateTable`. + val analyzed = analyzer.execute(CatalystSqlParser.parsePlan(query)) + if (checkAnalysis) { + analyzer.checkAnalysis(analyzed) } + analyzed } private def parseResolveCompare(query: String, expected: LogicalPlan): Unit = @@ -178,6 +203,16 @@ class PlanResolutionSuite extends AnalysisTest { }.head } + private def assertUnsupported(sql: String, containsThesePhrases: Seq[String] = Seq()): Unit = { + val e = intercept[ParseException] { + parsePlan(sql) + } + assert(e.getMessage.toLowerCase(Locale.ROOT).contains("operation not allowed")) + containsThesePhrases.foreach { p => + assert(e.getMessage.toLowerCase(Locale.ROOT).contains(p.toLowerCase(Locale.ROOT))) + } + } + test("create table - with partitioned by") { val query = "CREATE TABLE my_tab(a INT comment 'test', b STRING) " + "USING parquet PARTITIONED BY (a)" @@ -428,10 +463,11 @@ class PlanResolutionSuite extends AnalysisTest { val expectedProperties = Map( "p1" -> "v1", "p2" -> "v2", - "other" -> "20", + "option.other" -> "20", "provider" -> "parquet", "location" -> "s3://bucket/path/to/data", - "comment" -> "table comment") + "comment" -> "table comment", + "other" -> "20") parseAndResolve(sql) match { case create: CreateV2Table => @@ -467,10 +503,11 @@ class PlanResolutionSuite extends AnalysisTest { val expectedProperties = Map( "p1" -> "v1", "p2" -> "v2", - "other" -> "20", + "option.other" -> "20", "provider" -> "parquet", "location" -> "s3://bucket/path/to/data", - "comment" -> "table comment") + "comment" -> "table comment", + "other" -> "20") parseAndResolve(sql, withDefault = true) match { case create: CreateV2Table => @@ -542,10 +579,11 @@ class PlanResolutionSuite extends AnalysisTest { val expectedProperties = Map( "p1" -> "v1", "p2" -> "v2", - "other" -> "20", + "option.other" -> "20", "provider" -> "parquet", "location" -> "s3://bucket/path/to/data", - "comment" -> "table comment") + "comment" -> "table comment", + "other" -> "20") parseAndResolve(sql) match { case ctas: CreateTableAsSelect => @@ -576,10 +614,11 @@ class PlanResolutionSuite extends AnalysisTest { val expectedProperties = Map( "p1" -> "v1", "p2" -> "v2", - "other" -> "20", + "option.other" -> "20", "provider" -> "parquet", "location" -> "s3://bucket/path/to/data", - "comment" -> "table comment") + "comment" -> "table comment", + "other" -> "20") parseAndResolve(sql, withDefault = true) match { case ctas: CreateTableAsSelect => @@ -630,10 +669,10 @@ class PlanResolutionSuite extends AnalysisTest { } test("drop table") { - val tableName1 = "db.tab" - val tableIdent1 = TableIdentifier("tab", Option("db")) - val tableName2 = "tab" - val tableIdent2 = TableIdentifier("tab", Some("default")) + val tableName1 = "db.v1Table" + val tableIdent1 = TableIdentifier("v1Table", Option("db")) + val tableName2 = "v1Table" + val tableIdent2 = TableIdentifier("v1Table", Some("default")) parseResolveCompare(s"DROP TABLE $tableName1", DropTableCommand(tableIdent1, ifExists = false, isView = false, purge = false)) @@ -656,13 +695,13 @@ class PlanResolutionSuite extends AnalysisTest { val tableIdent2 = Identifier.of(Array.empty, "tab") parseResolveCompare(s"DROP TABLE $tableName1", - DropTable(testCat, tableIdent1, ifExists = false)) + DropTable(ResolvedTable.create(testCat, tableIdent1, table), ifExists = false, purge = false)) parseResolveCompare(s"DROP TABLE IF EXISTS $tableName1", - DropTable(testCat, tableIdent1, ifExists = true)) + DropTable(ResolvedTable.create(testCat, tableIdent1, table), ifExists = true, purge = false)) parseResolveCompare(s"DROP TABLE $tableName2", - DropTable(testCat, tableIdent2, ifExists = false)) + DropTable(ResolvedTable.create(testCat, tableIdent2, table), ifExists = false, purge = false)) parseResolveCompare(s"DROP TABLE IF EXISTS $tableName2", - DropTable(testCat, tableIdent2, ifExists = true)) + DropTable(ResolvedTable.create(testCat, tableIdent2, table), ifExists = true, purge = false)) } test("drop view") { @@ -670,6 +709,8 @@ class PlanResolutionSuite extends AnalysisTest { val viewIdent1 = TableIdentifier("view", Option("db")) val viewName2 = "view" val viewIdent2 = TableIdentifier("view", Option("default")) + val tempViewName = "v" + val tempViewIdent = TableIdentifier("v") parseResolveCompare(s"DROP VIEW $viewName1", DropTableCommand(viewIdent1, ifExists = false, isView = true, purge = false)) @@ -679,11 +720,15 @@ class PlanResolutionSuite extends AnalysisTest { DropTableCommand(viewIdent2, ifExists = false, isView = true, purge = false)) parseResolveCompare(s"DROP VIEW IF EXISTS $viewName2", DropTableCommand(viewIdent2, ifExists = true, isView = true, purge = false)) + parseResolveCompare(s"DROP VIEW $tempViewName", + DropTableCommand(tempViewIdent, ifExists = false, isView = true, purge = false)) + parseResolveCompare(s"DROP VIEW IF EXISTS $tempViewName", + DropTableCommand(tempViewIdent, ifExists = true, isView = true, purge = false)) } test("drop view in v2 catalog") { intercept[AnalysisException] { - parseAndResolve("DROP VIEW testcat.db.view") + parseAndResolve("DROP VIEW testcat.db.view", checkAnalysis = true) }.getMessage.toLowerCase(Locale.ROOT).contains( "view support in catalog has not been implemented") } @@ -691,16 +736,16 @@ class PlanResolutionSuite extends AnalysisTest { // ALTER VIEW view_name SET TBLPROPERTIES ('comment' = new_comment); // ALTER VIEW view_name UNSET TBLPROPERTIES [IF EXISTS] ('comment', 'key'); test("alter view: alter view properties") { - val sql1_view = "ALTER VIEW table_name SET TBLPROPERTIES ('test' = 'test', " + + val sql1_view = "ALTER VIEW view SET TBLPROPERTIES ('test' = 'test', " + "'comment' = 'new_comment')" - val sql2_view = "ALTER VIEW table_name UNSET TBLPROPERTIES ('comment', 'test')" - val sql3_view = "ALTER VIEW table_name UNSET TBLPROPERTIES IF EXISTS ('comment', 'test')" + val sql2_view = "ALTER VIEW view UNSET TBLPROPERTIES ('comment', 'test')" + val sql3_view = "ALTER VIEW view UNSET TBLPROPERTIES IF EXISTS ('comment', 'test')" val parsed1_view = parseAndResolve(sql1_view) val parsed2_view = parseAndResolve(sql2_view) val parsed3_view = parseAndResolve(sql3_view) - val tableIdent = TableIdentifier("table_name", Some("default")) + val tableIdent = TableIdentifier("view", Some("default")) val expected1_view = AlterTableSetPropertiesCommand( tableIdent, Map("test" -> "test", "comment" -> "new_comment"), isView = true) val expected2_view = AlterTableUnsetPropertiesCommand( @@ -741,27 +786,23 @@ class PlanResolutionSuite extends AnalysisTest { comparePlans(parsed3, expected3) } else { parsed1 match { - case AlterTable(_, _, _: DataSourceV2Relation, changes) => - assert(changes == Seq( - TableChange.setProperty("test", "test"), - TableChange.setProperty("comment", "new_comment"))) - case _ => fail("expect AlterTable") + case SetTableProperties(_: ResolvedTable, properties) => + assert(properties == Map(("test", "test"), ("comment", "new_comment"))) + case _ => fail(s"expect ${SetTableProperties.getClass.getName}") } parsed2 match { - case AlterTable(_, _, _: DataSourceV2Relation, changes) => - assert(changes == Seq( - TableChange.removeProperty("comment"), - TableChange.removeProperty("test"))) - case _ => fail("expect AlterTable") + case UnsetTableProperties(_: ResolvedTable, propertyKeys, ifExists) => + assert(propertyKeys == Seq("comment", "test")) + assert(!ifExists) + case _ => fail(s"expect ${UnsetTableProperties.getClass.getName}") } parsed3 match { - case AlterTable(_, _, _: DataSourceV2Relation, changes) => - assert(changes == Seq( - TableChange.removeProperty("comment"), - TableChange.removeProperty("test"))) - case _ => fail("expect AlterTable") + case UnsetTableProperties(_: ResolvedTable, propertyKeys, ifExists) => + assert(propertyKeys == Seq("comment", "test")) + assert(ifExists) + case _ => fail(s"expect ${UnsetTableProperties.getClass.getName}") } } } @@ -773,12 +814,14 @@ class PlanResolutionSuite extends AnalysisTest { // For non-existing tables, we convert it to v2 command with `UnresolvedV2Table` parsed4 match { - case AlterTable(_, _, _: UnresolvedV2Relation, _) => // OK - case _ => fail("Expect AlterTable, but got:\n" + parsed4.treeString) + case SetTableProperties(_: UnresolvedTable, _) => // OK + case _ => + fail(s"Expect ${SetTableProperties.getClass.getName}, but got:\n" + parsed4.treeString) } parsed5 match { - case AlterTable(_, _, _: UnresolvedV2Relation, _) => // OK - case _ => fail("Expect AlterTable, but got:\n" + parsed5.treeString) + case UnsetTableProperties(_: UnresolvedTable, _, _) => // OK + case _ => + fail(s"Expect ${UnsetTableProperties.getClass.getName}, but got:\n" + parsed5.treeString) } } @@ -800,11 +843,8 @@ class PlanResolutionSuite extends AnalysisTest { comparePlans(parsed, expected) } else { parsed match { - case AlterTable(_, _, _: DataSourceV2Relation, changes) => - assert(changes == Seq( - TableChange.setProperty("a", "1"), - TableChange.setProperty("b", "0.1"), - TableChange.setProperty("c", "true"))) + case SetTableProperties(_: ResolvedTable, changes) => + assert(changes == Map(("a", "1"), ("b", "0.1"), ("c", "true"))) case _ => fail("Expect AlterTable, but got:\n" + parsed.treeString) } } @@ -824,9 +864,10 @@ class PlanResolutionSuite extends AnalysisTest { comparePlans(parsed, expected) } else { parsed match { - case AlterTable(_, _, _: DataSourceV2Relation, changes) => - assert(changes == Seq(TableChange.setProperty("location", "new location"))) - case _ => fail("Expect AlterTable, but got:\n" + parsed.treeString) + case SetTableLocation(_: ResolvedTable, _, location) => + assert(location === "new location") + case _ => + fail(s"Expect ${SetTableLocation.getClass.getName}, but got:\n" + parsed.treeString) } } } @@ -841,21 +882,21 @@ class PlanResolutionSuite extends AnalysisTest { val parsed2 = parseAndResolve(sql2) if (useV1Command) { val expected1 = DescribeTableCommand( - TableIdentifier(tblName, Some("default")), Map.empty, false) + TableIdentifier(tblName, Some("default")), Map.empty, false, parsed1.output) val expected2 = DescribeTableCommand( - TableIdentifier(tblName, Some("default")), Map.empty, true) + TableIdentifier(tblName, Some("default")), Map.empty, true, parsed2.output) comparePlans(parsed1, expected1) comparePlans(parsed2, expected2) } else { parsed1 match { - case DescribeRelation(_: ResolvedTable, _, isExtended) => + case DescribeRelation(_: ResolvedTable, _, isExtended, _) => assert(!isExtended) case _ => fail("Expect DescribeTable, but got:\n" + parsed1.treeString) } parsed2 match { - case DescribeRelation(_: ResolvedTable, _, isExtended) => + case DescribeRelation(_: ResolvedTable, _, isExtended, _) => assert(isExtended) case _ => fail("Expect DescribeTable, but got:\n" + parsed2.treeString) } @@ -865,11 +906,11 @@ class PlanResolutionSuite extends AnalysisTest { val parsed3 = parseAndResolve(sql3) if (useV1Command) { val expected3 = DescribeTableCommand( - TableIdentifier(tblName, Some("default")), Map("a" -> "1"), false) + TableIdentifier(tblName, Some("default")), Map("a" -> "1"), false, parsed3.output) comparePlans(parsed3, expected3) } else { parsed3 match { - case DescribeRelation(_: ResolvedTable, partitionSpec, isExtended) => + case DescribeRelation(_: ResolvedTable, partitionSpec, isExtended, _) => assert(!isExtended) assert(partitionSpec == Map("a" -> "1")) case _ => fail("Expect DescribeTable, but got:\n" + parsed2.treeString) @@ -1076,9 +1117,7 @@ class PlanResolutionSuite extends AnalysisTest { } val sql = s"ALTER TABLE v1HiveTable ALTER COLUMN i TYPE char(1)" - val builder = new MetadataBuilder - builder.putString(HIVE_TYPE_STRING, CharType(1).catalogString) - val newColumnWithCleanedType = StructField("i", StringType, true, builder.build()) + val newColumnWithCleanedType = StructField("i", CharType(1), true) val expected = AlterTableChangeColumnCommand( TableIdentifier("v1HiveTable", Some("default")), "i", newColumnWithCleanedType) val parsed = parseAndResolve(sql) @@ -1144,9 +1183,9 @@ class PlanResolutionSuite extends AnalysisTest { ("ALTER TABLE testcat.tab ALTER COLUMN i TYPE bigint", false), ("ALTER TABLE tab ALTER COLUMN i TYPE bigint", false), (s"ALTER TABLE $v2SessionCatalogTable ALTER COLUMN i TYPE bigint", true), - ("INSERT INTO TABLE tab VALUES (1)", false), - ("INSERT INTO TABLE testcat.tab VALUES (1)", false), - (s"INSERT INTO TABLE $v2SessionCatalogTable VALUES (1)", true), + ("INSERT INTO TABLE tab VALUES (1, 'a')", false), + ("INSERT INTO TABLE testcat.tab VALUES (1, 'a')", false), + (s"INSERT INTO TABLE $v2SessionCatalogTable VALUES (1, 'a')", true), ("DESC TABLE tab", false), ("DESC TABLE testcat.tab", false), (s"DESC TABLE $v2SessionCatalogTable", true), @@ -1159,28 +1198,28 @@ class PlanResolutionSuite extends AnalysisTest { ) } - DSV2ResolutionTests.foreach { case (sql, isSessionCatlog) => + DSV2ResolutionTests.foreach { case (sql, isSessionCatalog) => test(s"Data source V2 relation resolution '$sql'") { val parsed = parseAndResolve(sql, withDefault = true) - val catlogIdent = if (isSessionCatlog) v2SessionCatalog else testCat - val tableIdent = if (isSessionCatlog) "v2Table" else "tab" + val catalogIdent = if (isSessionCatalog) v2SessionCatalog else testCat + val tableIdent = if (isSessionCatalog) "v2Table" else "tab" parsed match { case AlterTable(_, _, r: DataSourceV2Relation, _) => - assert(r.catalog.exists(_ == catlogIdent)) + assert(r.catalog.exists(_ == catalogIdent)) assert(r.identifier.exists(_.name() == tableIdent)) case Project(_, AsDataSourceV2Relation(r)) => - assert(r.catalog.exists(_ == catlogIdent)) + assert(r.catalog.exists(_ == catalogIdent)) assert(r.identifier.exists(_.name() == tableIdent)) - case InsertIntoStatement(r: DataSourceV2Relation, _, _, _, _) => - assert(r.catalog.exists(_ == catlogIdent)) + case AppendData(r: DataSourceV2Relation, _, _, _, _) => + assert(r.catalog.exists(_ == catalogIdent)) assert(r.identifier.exists(_.name() == tableIdent)) - case DescribeRelation(r: ResolvedTable, _, _) => - assert(r.catalog == catlogIdent) + case DescribeRelation(r: ResolvedTable, _, _, _) => + assert(r.catalog == catalogIdent) assert(r.identifier.name() == tableIdent) - case ShowTableProperties(r: ResolvedTable, _) => - assert(r.catalog == catlogIdent) + case ShowTableProperties(r: ResolvedTable, _, _) => + assert(r.catalog == catalogIdent) assert(r.identifier.name() == tableIdent) - case ShowTablePropertiesCommand(t: TableIdentifier, _) => + case ShowTablePropertiesCommand(t: TableIdentifier, _, _) => assert(t.identifier == tableIdent) } } @@ -1205,6 +1244,7 @@ class PlanResolutionSuite extends AnalysisTest { mergeCondition match { case EqualTo(l: AttributeReference, r: AttributeReference) => assert(l.sameRef(ti) && r.sameRef(si)) + case Literal(_, BooleanType) => // this is acceptable as a merge condition case other => fail("unexpected merge condition " + other) } @@ -1285,6 +1325,28 @@ class PlanResolutionSuite extends AnalysisTest { case other => fail("Expect MergeIntoTable, but got:\n" + other.treeString) } + // merge with star should get resolved into specific actions even if there + // is no other unresolved expression in the merge + parseAndResolve(s""" + |MERGE INTO $target AS target + |USING $source AS source + |ON true + |WHEN MATCHED THEN UPDATE SET * + |WHEN NOT MATCHED THEN INSERT * + """.stripMargin) match { + case MergeIntoTable( + SubqueryAlias(AliasIdentifier("target", Seq()), AsDataSourceV2Relation(target)), + SubqueryAlias(AliasIdentifier("source", Seq()), AsDataSourceV2Relation(source)), + mergeCondition, + Seq(UpdateAction(None, updateAssigns)), + Seq(InsertAction(None, insertAssigns))) => + + checkResolution(target, source, mergeCondition, None, None, None, + updateAssigns, insertAssigns, starInUpdate = true) + + case other => fail("Expect MergeIntoTable, but got:\n" + other.treeString) + } + // no additional conditions val sql3 = s""" @@ -1338,7 +1400,7 @@ class PlanResolutionSuite extends AnalysisTest { // cte val sql5 = s""" - |WITH source(i, s) AS + |WITH source(s, i) AS | (SELECT * FROM $source) |MERGE INTO $target AS target |USING source @@ -1358,7 +1420,7 @@ class PlanResolutionSuite extends AnalysisTest { updateAssigns)), Seq(InsertAction(Some(EqualTo(il: AttributeReference, StringLiteral("insert"))), insertAssigns))) => - assert(source.output.map(_.name) == Seq("i", "s")) + assert(source.output.map(_.name) == Seq("s", "i")) checkResolution(target, source, mergeCondition, Some(dl), Some(ul), Some(il), updateAssigns, insertAssigns) @@ -1367,8 +1429,7 @@ class PlanResolutionSuite extends AnalysisTest { } // no aliases - Seq(("v2Table", "v2Table1"), - ("testcat.tab", "testcat.tab1")).foreach { pair => + Seq(("v2Table", "v2Table1"), ("testcat.tab", "testcat.tab1")).foreach { pair => val target = pair._1 val source = pair._2 @@ -1460,7 +1521,7 @@ class PlanResolutionSuite extends AnalysisTest { assert(e5.message.contains("Reference 's' is ambiguous")) } - val sql6 = + val sql1 = s""" |MERGE INTO non_exist_target |USING non_exist_source @@ -1469,13 +1530,37 @@ class PlanResolutionSuite extends AnalysisTest { |WHEN MATCHED THEN UPDATE SET * |WHEN NOT MATCHED THEN INSERT * """.stripMargin - val parsed = parseAndResolve(sql6) + val parsed = parseAndResolve(sql1) parsed match { case u: MergeIntoTable => assert(u.targetTable.isInstanceOf[UnresolvedRelation]) assert(u.sourceTable.isInstanceOf[UnresolvedRelation]) case _ => fail("Expect MergeIntoTable, but got:\n" + parsed.treeString) } + + // UPDATE * with incompatible schema between source and target tables. + val sql2 = + """ + |MERGE INTO testcat.tab + |USING testcat.tab2 + |ON 1 = 1 + |WHEN MATCHED THEN UPDATE SET * + |""".stripMargin + val e2 = intercept[AnalysisException](parseAndResolve(sql2)) + assert(e2.message.contains( + "cannot resolve s in MERGE command given columns [testcat.tab2.i, testcat.tab2.x]")) + + // INSERT * with incompatible schema between source and target tables. + val sql3 = + """ + |MERGE INTO testcat.tab + |USING testcat.tab2 + |ON 1 = 1 + |WHEN NOT MATCHED THEN INSERT * + |""".stripMargin + val e3 = intercept[AnalysisException](parseAndResolve(sql3)) + assert(e3.message.contains( + "cannot resolve s in MERGE command given columns [testcat.tab2.i, testcat.tab2.x]")) } test("MERGE INTO TABLE - skip resolution on v2 tables that accept any schema") { @@ -1519,42 +1604,639 @@ class PlanResolutionSuite extends AnalysisTest { } } - test("SPARK-31147: forbid CHAR type in non-Hive tables") { - def checkFailure(t: String, provider: String): Unit = { - val types = Seq( - "CHAR(2)", - "ARRAY", - "MAP", - "MAP", - "STRUCT") - types.foreach { tpe => - intercept[AnalysisException] { - parseAndResolve(s"CREATE TABLE $t(col $tpe) USING $provider") - } - intercept[AnalysisException] { - parseAndResolve(s"REPLACE TABLE $t(col $tpe) USING $provider") - } - intercept[AnalysisException] { - parseAndResolve(s"CREATE OR REPLACE TABLE $t(col $tpe) USING $provider") - } - intercept[AnalysisException] { - parseAndResolve(s"ALTER TABLE $t ADD COLUMN col $tpe") - } - intercept[AnalysisException] { - parseAndResolve(s"ALTER TABLE $t ADD COLUMN col $tpe") - } - intercept[AnalysisException] { - parseAndResolve(s"ALTER TABLE $t ALTER COLUMN col TYPE $tpe") + private def compareNormalized(plan1: LogicalPlan, plan2: LogicalPlan): Unit = { + /** + * Normalizes plans: + * - CreateTable the createTime in tableDesc will replaced by -1L. + */ + def normalizePlan(plan: LogicalPlan): LogicalPlan = { + plan match { + case CreateTable(tableDesc, mode, query) => + val newTableDesc = tableDesc.copy(createTime = -1L) + CreateTable(newTableDesc, mode, query) + case _ => plan // Don't transform + } + } + comparePlans(normalizePlan(plan1), normalizePlan(plan2)) + } + + test("create table - schema") { + def createTable( + table: String, + database: Option[String] = None, + tableType: CatalogTableType = CatalogTableType.MANAGED, + storage: CatalogStorageFormat = CatalogStorageFormat.empty.copy( + inputFormat = HiveSerDe.sourceToSerDe("textfile").get.inputFormat, + outputFormat = HiveSerDe.sourceToSerDe("textfile").get.outputFormat, + serde = Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")), + schema: StructType = new StructType, + provider: Option[String] = Some("hive"), + partitionColumnNames: Seq[String] = Seq.empty, + comment: Option[String] = None, + mode: SaveMode = SaveMode.ErrorIfExists, + query: Option[LogicalPlan] = None): CreateTable = { + CreateTable( + CatalogTable( + identifier = TableIdentifier(table, database), + tableType = tableType, + storage = storage, + schema = schema, + provider = provider, + partitionColumnNames = partitionColumnNames, + comment = comment + ), mode, query + ) + } + + def compare(sql: String, plan: LogicalPlan): Unit = { + compareNormalized(parseAndResolve(sql), plan) + } + + compare("CREATE TABLE my_tab(a INT COMMENT 'test', b STRING) STORED AS textfile", + createTable( + table = "my_tab", + database = Some("default"), + schema = (new StructType) + .add("a", IntegerType, nullable = true, "test") + .add("b", StringType) + ) + ) + compare("CREATE TABLE my_tab(a INT COMMENT 'test', b STRING) STORED AS textfile " + + "PARTITIONED BY (c INT, d STRING COMMENT 'test2')", + createTable( + table = "my_tab", + database = Some("default"), + schema = (new StructType) + .add("a", IntegerType, nullable = true, "test") + .add("b", StringType) + .add("c", IntegerType) + .add("d", StringType, nullable = true, "test2"), + partitionColumnNames = Seq("c", "d") + ) + ) + compare("CREATE TABLE my_tab(id BIGINT, nested STRUCT) " + + "STORED AS textfile", + createTable( + table = "my_tab", + database = Some("default"), + schema = (new StructType) + .add("id", LongType) + .add("nested", (new StructType) + .add("col1", StringType) + .add("col2", IntegerType) + ) + ) + ) + // Partitioned by a StructType should be accepted by `SparkSqlParser` but will fail an analyze + // rule in `AnalyzeCreateTable`. + compare("CREATE TABLE my_tab(a INT COMMENT 'test', b STRING) STORED AS textfile " + + "PARTITIONED BY (nested STRUCT)", + createTable( + table = "my_tab", + database = Some("default"), + schema = (new StructType) + .add("a", IntegerType, nullable = true, "test") + .add("b", StringType) + .add("nested", (new StructType) + .add("col1", StringType) + .add("col2", IntegerType) + ), + partitionColumnNames = Seq("nested") + ) + ) + + interceptParseException(parsePlan)( + "CREATE TABLE my_tab(a: INT COMMENT 'test', b: STRING)", + "extraneous input ':'") + } + + test("create hive table - table file format") { + val allSources = Seq("parquet", "parquetfile", "orc", "orcfile", "avro", "avrofile", + "sequencefile", "rcfile", "textfile") + + allSources.foreach { s => + val query = s"CREATE TABLE my_tab STORED AS $s" + parseAndResolve(query) match { + case ct: CreateTable => + val hiveSerde = HiveSerDe.sourceToSerDe(s) + assert(hiveSerde.isDefined) + assert(ct.tableDesc.storage.serde == + hiveSerde.get.serde.orElse(Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"))) + assert(ct.tableDesc.storage.inputFormat == hiveSerde.get.inputFormat) + assert(ct.tableDesc.storage.outputFormat == hiveSerde.get.outputFormat) + } + } + } + + test("create hive table - row format and table file format") { + val createTableStart = "CREATE TABLE my_tab ROW FORMAT" + val fileFormat = s"STORED AS INPUTFORMAT 'inputfmt' OUTPUTFORMAT 'outputfmt'" + val query1 = s"$createTableStart SERDE 'anything' $fileFormat" + val query2 = s"$createTableStart DELIMITED FIELDS TERMINATED BY ' ' $fileFormat" + + // No conflicting serdes here, OK + parseAndResolve(query1) match { + case parsed1: CreateTable => + assert(parsed1.tableDesc.storage.serde == Some("anything")) + assert(parsed1.tableDesc.storage.inputFormat == Some("inputfmt")) + assert(parsed1.tableDesc.storage.outputFormat == Some("outputfmt")) + } + + parseAndResolve(query2) match { + case parsed2: CreateTable => + assert(parsed2.tableDesc.storage.serde == + Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")) + assert(parsed2.tableDesc.storage.inputFormat == Some("inputfmt")) + assert(parsed2.tableDesc.storage.outputFormat == Some("outputfmt")) + } + } + + test("create hive table - row format serde and generic file format") { + val allSources = Seq("parquet", "orc", "avro", "sequencefile", "rcfile", "textfile") + val supportedSources = Set("sequencefile", "rcfile", "textfile") + + allSources.foreach { s => + val query = s"CREATE TABLE my_tab ROW FORMAT SERDE 'anything' STORED AS $s" + if (supportedSources.contains(s)) { + parseAndResolve(query) match { + case ct: CreateTable => + val hiveSerde = HiveSerDe.sourceToSerDe(s) + assert(hiveSerde.isDefined) + assert(ct.tableDesc.storage.serde == Some("anything")) + assert(ct.tableDesc.storage.inputFormat == hiveSerde.get.inputFormat) + assert(ct.tableDesc.storage.outputFormat == hiveSerde.get.outputFormat) } - intercept[AnalysisException] { - parseAndResolve(s"ALTER TABLE $t REPLACE COLUMNS (col $tpe)") + } else { + assertUnsupported(query, Seq("row format serde", "incompatible", s)) + } + } + } + + test("create hive table - row format delimited and generic file format") { + val allSources = Seq("parquet", "orc", "avro", "sequencefile", "rcfile", "textfile") + val supportedSources = Set("textfile") + + allSources.foreach { s => + val query = s"CREATE TABLE my_tab ROW FORMAT DELIMITED FIELDS TERMINATED BY ' ' STORED AS $s" + if (supportedSources.contains(s)) { + parseAndResolve(query) match { + case ct: CreateTable => + val hiveSerde = HiveSerDe.sourceToSerDe(s) + assert(hiveSerde.isDefined) + assert(ct.tableDesc.storage.serde == hiveSerde.get.serde + .orElse(Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"))) + assert(ct.tableDesc.storage.inputFormat == hiveSerde.get.inputFormat) + assert(ct.tableDesc.storage.outputFormat == hiveSerde.get.outputFormat) } + } else { + assertUnsupported(query, Seq("row format delimited", "only compatible with 'textfile'", s)) } } + } + + test("create hive external table") { + val withoutLoc = "CREATE EXTERNAL TABLE my_tab STORED AS parquet" + parseAndResolve(withoutLoc) match { + case ct: CreateTable => + assert(ct.tableDesc.tableType == CatalogTableType.EXTERNAL) + assert(ct.tableDesc.storage.locationUri.isEmpty) + } + + val withLoc = "CREATE EXTERNAL TABLE my_tab STORED AS parquet LOCATION '/something/anything'" + parseAndResolve(withLoc) match { + case ct: CreateTable => + assert(ct.tableDesc.tableType == CatalogTableType.EXTERNAL) + assert(ct.tableDesc.storage.locationUri == Some(new URI("/something/anything"))) + } + } + + test("create hive table - property values must be set") { + assertUnsupported( + sql = "CREATE TABLE my_tab STORED AS parquet " + + "TBLPROPERTIES('key_without_value', 'key_with_value'='x')", + containsThesePhrases = Seq("key_without_value")) + assertUnsupported( + sql = "CREATE TABLE my_tab ROW FORMAT SERDE 'serde' " + + "WITH SERDEPROPERTIES('key_without_value', 'key_with_value'='x')", + containsThesePhrases = Seq("key_without_value")) + } + + test("create hive table - location implies external") { + val query = "CREATE TABLE my_tab STORED AS parquet LOCATION '/something/anything'" + parseAndResolve(query) match { + case ct: CreateTable => + assert(ct.tableDesc.tableType == CatalogTableType.EXTERNAL) + assert(ct.tableDesc.storage.locationUri == Some(new URI("/something/anything"))) + } + } + + test("Duplicate clauses - create hive table") { + def intercept(sqlCommand: String, messages: String*): Unit = + interceptParseException(parsePlan)(sqlCommand, messages: _*) + + def createTableHeader(duplicateClause: String): String = { + s"CREATE TABLE my_tab(a INT, b STRING) STORED AS parquet $duplicateClause $duplicateClause" + } + + intercept(createTableHeader("TBLPROPERTIES('test' = 'test2')"), + "Found duplicate clauses: TBLPROPERTIES") + intercept(createTableHeader("LOCATION '/tmp/file'"), + "Found duplicate clauses: LOCATION") + intercept(createTableHeader("COMMENT 'a table'"), + "Found duplicate clauses: COMMENT") + intercept(createTableHeader("CLUSTERED BY(b) INTO 256 BUCKETS"), + "Found duplicate clauses: CLUSTERED BY") + intercept(createTableHeader("PARTITIONED BY (k int)"), + "Found duplicate clauses: PARTITIONED BY") + intercept(createTableHeader("STORED AS parquet"), + "Found duplicate clauses: STORED AS/BY") + intercept( + createTableHeader("ROW FORMAT SERDE 'parquet.hive.serde.ParquetHiveSerDe'"), + "Found duplicate clauses: ROW FORMAT") + } + + test("Test CTAS #1") { + val s1 = + """ + |CREATE EXTERNAL TABLE IF NOT EXISTS mydb.page_view + |COMMENT 'This is the staging page view table' + |STORED AS RCFILE + |LOCATION '/user/external/page_view' + |TBLPROPERTIES ('p1'='v1', 'p2'='v2') + |AS SELECT * FROM src + """.stripMargin + + val s2 = + """ + |CREATE EXTERNAL TABLE IF NOT EXISTS mydb.page_view + |STORED AS RCFILE + |COMMENT 'This is the staging page view table' + |TBLPROPERTIES ('p1'='v1', 'p2'='v2') + |LOCATION '/user/external/page_view' + |AS SELECT * FROM src + """.stripMargin + + val s3 = + """ + |CREATE EXTERNAL TABLE IF NOT EXISTS mydb.page_view + |TBLPROPERTIES ('p1'='v1', 'p2'='v2') + |LOCATION '/user/external/page_view' + |STORED AS RCFILE + |COMMENT 'This is the staging page view table' + |AS SELECT * FROM src + """.stripMargin + + checkParsing(s1) + checkParsing(s2) + checkParsing(s3) + + def checkParsing(sql: String): Unit = { + val (desc, exists) = extractTableDesc(sql) + assert(exists) + assert(desc.identifier.database == Some("mydb")) + assert(desc.identifier.table == "page_view") + assert(desc.tableType == CatalogTableType.EXTERNAL) + assert(desc.storage.locationUri == Some(new URI("/user/external/page_view"))) + assert(desc.schema.isEmpty) // will be populated later when the table is actually created + assert(desc.comment == Some("This is the staging page view table")) + // TODO will be SQLText + assert(desc.viewText.isEmpty) + assert(desc.viewCatalogAndNamespace.isEmpty) + assert(desc.viewQueryColumnNames.isEmpty) + assert(desc.partitionColumnNames.isEmpty) + assert(desc.storage.inputFormat == Some("org.apache.hadoop.hive.ql.io.RCFileInputFormat")) + assert(desc.storage.outputFormat == Some("org.apache.hadoop.hive.ql.io.RCFileOutputFormat")) + assert(desc.storage.serde == + Some("org.apache.hadoop.hive.serde2.columnar.LazyBinaryColumnarSerDe")) + assert(desc.properties == Map("p1" -> "v1", "p2" -> "v2")) + } + } + + test("Test CTAS #2") { + val s1 = + """ + |CREATE EXTERNAL TABLE IF NOT EXISTS mydb.page_view + |COMMENT 'This is the staging page view table' + |ROW FORMAT SERDE 'parquet.hive.serde.ParquetHiveSerDe' + | STORED AS + | INPUTFORMAT 'parquet.hive.DeprecatedParquetInputFormat' + | OUTPUTFORMAT 'parquet.hive.DeprecatedParquetOutputFormat' + |LOCATION '/user/external/page_view' + |TBLPROPERTIES ('p1'='v1', 'p2'='v2') + |AS SELECT * FROM src + """.stripMargin + + val s2 = + """ + |CREATE EXTERNAL TABLE IF NOT EXISTS mydb.page_view + |LOCATION '/user/external/page_view' + |TBLPROPERTIES ('p1'='v1', 'p2'='v2') + |ROW FORMAT SERDE 'parquet.hive.serde.ParquetHiveSerDe' + | STORED AS + | INPUTFORMAT 'parquet.hive.DeprecatedParquetInputFormat' + | OUTPUTFORMAT 'parquet.hive.DeprecatedParquetOutputFormat' + |COMMENT 'This is the staging page view table' + |AS SELECT * FROM src + """.stripMargin + + checkParsing(s1) + checkParsing(s2) - checkFailure("v1Table", v1Format) - checkFailure("v2Table", v2Format) - checkFailure("testcat.tab", "foo") + def checkParsing(sql: String): Unit = { + val (desc, exists) = extractTableDesc(sql) + assert(exists) + assert(desc.identifier.database == Some("mydb")) + assert(desc.identifier.table == "page_view") + assert(desc.tableType == CatalogTableType.EXTERNAL) + assert(desc.storage.locationUri == Some(new URI("/user/external/page_view"))) + assert(desc.schema.isEmpty) // will be populated later when the table is actually created + // TODO will be SQLText + assert(desc.comment == Some("This is the staging page view table")) + assert(desc.viewText.isEmpty) + assert(desc.viewCatalogAndNamespace.isEmpty) + assert(desc.viewQueryColumnNames.isEmpty) + assert(desc.partitionColumnNames.isEmpty) + assert(desc.storage.properties == Map()) + assert(desc.storage.inputFormat == Some("parquet.hive.DeprecatedParquetInputFormat")) + assert(desc.storage.outputFormat == Some("parquet.hive.DeprecatedParquetOutputFormat")) + assert(desc.storage.serde == Some("parquet.hive.serde.ParquetHiveSerDe")) + assert(desc.properties == Map("p1" -> "v1", "p2" -> "v2")) + } + } + + test("Test CTAS #3") { + val s3 = """CREATE TABLE page_view STORED AS textfile AS SELECT * FROM src""" + val (desc, exists) = extractTableDesc(s3) + assert(exists == false) + assert(desc.identifier.database == Some("default")) + assert(desc.identifier.table == "page_view") + assert(desc.tableType == CatalogTableType.MANAGED) + assert(desc.storage.locationUri == None) + assert(desc.schema.isEmpty) + assert(desc.viewText == None) // TODO will be SQLText + assert(desc.viewQueryColumnNames.isEmpty) + assert(desc.storage.properties == Map()) + assert(desc.storage.inputFormat == Some("org.apache.hadoop.mapred.TextInputFormat")) + assert(desc.storage.outputFormat == + Some("org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat")) + assert(desc.storage.serde == Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")) + assert(desc.properties == Map()) + } + + test("Test CTAS #4") { + val s4 = + """CREATE TABLE page_view + |STORED BY 'storage.handler.class.name' AS SELECT * FROM src""".stripMargin + intercept[AnalysisException] { + extractTableDesc(s4) + } + } + + test("Test CTAS #5") { + val s5 = """CREATE TABLE ctas2 + | ROW FORMAT SERDE "org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe" + | WITH SERDEPROPERTIES("serde_p1"="p1","serde_p2"="p2") + | STORED AS RCFile + | TBLPROPERTIES("tbl_p1"="p11", "tbl_p2"="p22") + | AS + | SELECT key, value + | FROM src + | ORDER BY key, value""".stripMargin + val (desc, exists) = extractTableDesc(s5) + assert(exists == false) + assert(desc.identifier.database == Some("default")) + assert(desc.identifier.table == "ctas2") + assert(desc.tableType == CatalogTableType.MANAGED) + assert(desc.storage.locationUri == None) + assert(desc.schema.isEmpty) + assert(desc.viewText == None) // TODO will be SQLText + assert(desc.viewCatalogAndNamespace.isEmpty) + assert(desc.viewQueryColumnNames.isEmpty) + assert(desc.storage.properties == Map(("serde_p1" -> "p1"), ("serde_p2" -> "p2"))) + assert(desc.storage.inputFormat == Some("org.apache.hadoop.hive.ql.io.RCFileInputFormat")) + assert(desc.storage.outputFormat == Some("org.apache.hadoop.hive.ql.io.RCFileOutputFormat")) + assert(desc.storage.serde == Some("org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe")) + assert(desc.properties == Map(("tbl_p1" -> "p11"), ("tbl_p2" -> "p22"))) + } + + test("CTAS statement with a PARTITIONED BY clause is not allowed") { + assertUnsupported(s"CREATE TABLE ctas1 PARTITIONED BY (k int)" + + " AS SELECT key, value FROM (SELECT 1 as key, 2 as value) tmp") + } + + test("CTAS statement with schema") { + assertUnsupported(s"CREATE TABLE ctas1 (age INT, name STRING) AS SELECT * FROM src") + assertUnsupported(s"CREATE TABLE ctas1 (age INT, name STRING) AS SELECT 1, 'hello'") + } + + test("create table - basic") { + val query = "CREATE TABLE my_table (id int, name string)" + val (desc, allowExisting) = extractTableDesc(query) + assert(!allowExisting) + assert(desc.identifier.database == Some("default")) + assert(desc.identifier.table == "my_table") + assert(desc.tableType == CatalogTableType.MANAGED) + assert(desc.schema == new StructType().add("id", "int").add("name", "string")) + assert(desc.partitionColumnNames.isEmpty) + assert(desc.bucketSpec.isEmpty) + assert(desc.viewText.isEmpty) + assert(desc.viewQueryColumnNames.isEmpty) + assert(desc.storage.locationUri.isEmpty) + assert(desc.storage.inputFormat == + Some("org.apache.hadoop.mapred.TextInputFormat")) + assert(desc.storage.outputFormat == + Some("org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat")) + assert(desc.storage.serde == Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")) + assert(desc.storage.properties.isEmpty) + assert(desc.properties.isEmpty) + assert(desc.comment.isEmpty) + } + + test("create table - with database name") { + val query = "CREATE TABLE dbx.my_table (id int, name string)" + val (desc, _) = extractTableDesc(query) + assert(desc.identifier.database == Some("dbx")) + assert(desc.identifier.table == "my_table") + } + + test("create table - temporary") { + val query = "CREATE TEMPORARY TABLE tab1 (id int, name string)" + val e = intercept[ParseException] { parsePlan(query) } + assert(e.message.contains("Operation not allowed: CREATE TEMPORARY TABLE")) + } + + test("create table - external") { + val query = "CREATE EXTERNAL TABLE tab1 (id int, name string) LOCATION '/path/to/nowhere'" + val (desc, _) = extractTableDesc(query) + assert(desc.tableType == CatalogTableType.EXTERNAL) + assert(desc.storage.locationUri == Some(new URI("/path/to/nowhere"))) + } + + test("create table - if not exists") { + val query = "CREATE TABLE IF NOT EXISTS tab1 (id int, name string)" + val (_, allowExisting) = extractTableDesc(query) + assert(allowExisting) + } + + test("create table - comment") { + val query = "CREATE TABLE my_table (id int, name string) COMMENT 'its hot as hell below'" + val (desc, _) = extractTableDesc(query) + assert(desc.comment == Some("its hot as hell below")) + } + + test("create table - partitioned columns") { + val query = "CREATE TABLE my_table (id int, name string) PARTITIONED BY (month int)" + val (desc, _) = extractTableDesc(query) + assert(desc.schema == new StructType() + .add("id", "int") + .add("name", "string") + .add("month", "int")) + assert(desc.partitionColumnNames == Seq("month")) + } + + test("create table - clustered by") { + val numBuckets = 10 + val bucketedColumn = "id" + val sortColumn = "id" + val baseQuery = + s""" + CREATE TABLE my_table ( + $bucketedColumn int, + name string) + CLUSTERED BY($bucketedColumn) + """ + + val query1 = s"$baseQuery INTO $numBuckets BUCKETS" + val (desc1, _) = extractTableDesc(query1) + assert(desc1.bucketSpec.isDefined) + val bucketSpec1 = desc1.bucketSpec.get + assert(bucketSpec1.numBuckets == numBuckets) + assert(bucketSpec1.bucketColumnNames.head.equals(bucketedColumn)) + assert(bucketSpec1.sortColumnNames.isEmpty) + + val query2 = s"$baseQuery SORTED BY($sortColumn) INTO $numBuckets BUCKETS" + val (desc2, _) = extractTableDesc(query2) + assert(desc2.bucketSpec.isDefined) + val bucketSpec2 = desc2.bucketSpec.get + assert(bucketSpec2.numBuckets == numBuckets) + assert(bucketSpec2.bucketColumnNames.head.equals(bucketedColumn)) + assert(bucketSpec2.sortColumnNames.head.equals(sortColumn)) + } + + test("create table(hive) - skewed by") { + val baseQuery = "CREATE TABLE my_table (id int, name string) SKEWED BY" + val query1 = s"$baseQuery(id) ON (1, 10, 100)" + val query2 = s"$baseQuery(id, name) ON ((1, 'x'), (2, 'y'), (3, 'z'))" + val query3 = s"$baseQuery(id, name) ON ((1, 'x'), (2, 'y'), (3, 'z')) STORED AS DIRECTORIES" + val e1 = intercept[ParseException] { parsePlan(query1) } + val e2 = intercept[ParseException] { parsePlan(query2) } + val e3 = intercept[ParseException] { parsePlan(query3) } + assert(e1.getMessage.contains("Operation not allowed")) + assert(e2.getMessage.contains("Operation not allowed")) + assert(e3.getMessage.contains("Operation not allowed")) + } + + test("create table(hive) - row format") { + val baseQuery = "CREATE TABLE my_table (id int, name string) ROW FORMAT" + val query1 = s"$baseQuery SERDE 'org.apache.poof.serde.Baff'" + val query2 = s"$baseQuery SERDE 'org.apache.poof.serde.Baff' WITH SERDEPROPERTIES ('k1'='v1')" + val query3 = + s""" + |$baseQuery DELIMITED FIELDS TERMINATED BY 'x' ESCAPED BY 'y' + |COLLECTION ITEMS TERMINATED BY 'a' + |MAP KEYS TERMINATED BY 'b' + |LINES TERMINATED BY '\n' + |NULL DEFINED AS 'c' + """.stripMargin + val (desc1, _) = extractTableDesc(query1) + val (desc2, _) = extractTableDesc(query2) + val (desc3, _) = extractTableDesc(query3) + assert(desc1.storage.serde == Some("org.apache.poof.serde.Baff")) + assert(desc1.storage.properties.isEmpty) + assert(desc2.storage.serde == Some("org.apache.poof.serde.Baff")) + assert(desc2.storage.properties == Map("k1" -> "v1")) + assert(desc3.storage.properties == Map( + "field.delim" -> "x", + "escape.delim" -> "y", + "serialization.format" -> "x", + "line.delim" -> "\n", + "colelction.delim" -> "a", // yes, it's a typo from Hive :) + "mapkey.delim" -> "b")) + } + + test("create table(hive) - file format") { + val baseQuery = "CREATE TABLE my_table (id int, name string) STORED AS" + val query1 = s"$baseQuery INPUTFORMAT 'winput' OUTPUTFORMAT 'wowput'" + val query2 = s"$baseQuery ORC" + val (desc1, _) = extractTableDesc(query1) + val (desc2, _) = extractTableDesc(query2) + assert(desc1.storage.inputFormat == Some("winput")) + assert(desc1.storage.outputFormat == Some("wowput")) + assert(desc1.storage.serde == Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")) + assert(desc2.storage.inputFormat == Some("org.apache.hadoop.hive.ql.io.orc.OrcInputFormat")) + assert(desc2.storage.outputFormat == Some("org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat")) + assert(desc2.storage.serde == Some("org.apache.hadoop.hive.ql.io.orc.OrcSerde")) + } + + test("create table(hive) - storage handler") { + val baseQuery = "CREATE TABLE my_table (id int, name string) STORED BY" + val query1 = s"$baseQuery 'org.papachi.StorageHandler'" + val query2 = s"$baseQuery 'org.mamachi.StorageHandler' WITH SERDEPROPERTIES ('k1'='v1')" + val e1 = intercept[ParseException] { parsePlan(query1) } + val e2 = intercept[ParseException] { parsePlan(query2) } + assert(e1.getMessage.contains("Operation not allowed")) + assert(e2.getMessage.contains("Operation not allowed")) + } + + test("create table - properties") { + val query = "CREATE TABLE my_table (id int, name string) TBLPROPERTIES ('k1'='v1', 'k2'='v2')" + parsePlan(query) match { + case state: CreateTableStatement => + assert(state.properties == Map("k1" -> "v1", "k2" -> "v2")) + } + } + + test("create table(hive) - everything!") { + val query = + """ + |CREATE EXTERNAL TABLE IF NOT EXISTS dbx.my_table (id int, name string) + |COMMENT 'no comment' + |PARTITIONED BY (month int) + |ROW FORMAT SERDE 'org.apache.poof.serde.Baff' WITH SERDEPROPERTIES ('k1'='v1') + |STORED AS INPUTFORMAT 'winput' OUTPUTFORMAT 'wowput' + |LOCATION '/path/to/mercury' + |TBLPROPERTIES ('k1'='v1', 'k2'='v2') + """.stripMargin + val (desc, allowExisting) = extractTableDesc(query) + assert(allowExisting) + assert(desc.identifier.database == Some("dbx")) + assert(desc.identifier.table == "my_table") + assert(desc.tableType == CatalogTableType.EXTERNAL) + assert(desc.schema == new StructType() + .add("id", "int") + .add("name", "string") + .add("month", "int")) + assert(desc.partitionColumnNames == Seq("month")) + assert(desc.bucketSpec.isEmpty) + assert(desc.viewText.isEmpty) + assert(desc.viewCatalogAndNamespace.isEmpty) + assert(desc.viewQueryColumnNames.isEmpty) + assert(desc.storage.locationUri == Some(new URI("/path/to/mercury"))) + assert(desc.storage.inputFormat == Some("winput")) + assert(desc.storage.outputFormat == Some("wowput")) + assert(desc.storage.serde == Some("org.apache.poof.serde.Baff")) + assert(desc.storage.properties == Map("k1" -> "v1")) + assert(desc.properties == Map("k1" -> "v1", "k2" -> "v2")) + assert(desc.comment == Some("no comment")) + } + + test("SPARK-34701: children/innerChildren should be mutually exclusive for AnalysisOnlyCommand") { + val cmdNotAnalyzed = DummyAnalysisOnlyCommand(isAnalyzed = false, childrenToAnalyze = Seq(null)) + assert(cmdNotAnalyzed.innerChildren.isEmpty) + assert(cmdNotAnalyzed.children.length == 1) + val cmdAnalyzed = cmdNotAnalyzed.markAsAnalyzed() + assert(cmdAnalyzed.innerChildren.length == 1) + assert(cmdAnalyzed.children.isEmpty) } // TODO: add tests for more commands. @@ -1566,3 +2248,13 @@ object AsDataSourceV2Relation { case _ => None } } + +case class DummyAnalysisOnlyCommand( + isAnalyzed: Boolean, + childrenToAnalyze: Seq[LogicalPlan]) extends AnalysisOnlyCommand { + override def markAsAnalyzed(): LogicalPlan = copy(isAnalyzed = true) + override protected def withNewChildrenInternal( + newChildren: IndexedSeq[LogicalPlan]): LogicalPlan = { + copy(childrenToAnalyze = newChildren) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowNamespacesParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowNamespacesParserSuite.scala new file mode 100644 index 0000000000000..c9e5d33fea87a --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowNamespacesParserSuite.scala @@ -0,0 +1,70 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedNamespace} +import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parsePlan +import org.apache.spark.sql.catalyst.parser.ParseException +import org.apache.spark.sql.catalyst.plans.logical.ShowNamespaces +import org.apache.spark.sql.test.SharedSparkSession + +class ShowNamespacesParserSuite extends AnalysisTest with SharedSparkSession { + test("all namespaces") { + Seq("SHOW NAMESPACES", "SHOW DATABASES").foreach { sqlCmd => + comparePlans( + parsePlan(sqlCmd), + ShowNamespaces(UnresolvedNamespace(Seq.empty[String]), None)) + } + } + + test("basic pattern") { + Seq( + "SHOW DATABASES LIKE 'defau*'", + "SHOW NAMESPACES LIKE 'defau*'").foreach { sqlCmd => + comparePlans( + parsePlan(sqlCmd), + ShowNamespaces(UnresolvedNamespace(Seq.empty[String]), Some("defau*"))) + } + } + + test("FROM/IN operator is not allowed by SHOW DATABASES") { + Seq( + "SHOW DATABASES FROM testcat.ns1.ns2", + "SHOW DATABASES IN testcat.ns1.ns2").foreach { sqlCmd => + val errMsg = intercept[ParseException] { + parsePlan(sqlCmd) + }.getMessage + assert(errMsg.contains("FROM/IN operator is not allowed in SHOW DATABASES")) + } + } + + test("show namespaces in/from a namespace") { + comparePlans( + parsePlan("SHOW NAMESPACES FROM testcat.ns1.ns2"), + ShowNamespaces(UnresolvedNamespace(Seq("testcat", "ns1", "ns2")), None)) + comparePlans( + parsePlan("SHOW NAMESPACES IN testcat.ns1.ns2"), + ShowNamespaces(UnresolvedNamespace(Seq("testcat", "ns1", "ns2")), None)) + } + + test("namespaces by a pattern from another namespace") { + comparePlans( + parsePlan("SHOW NAMESPACES IN testcat.ns1 LIKE '*pattern*'"), + ShowNamespaces(UnresolvedNamespace(Seq("testcat", "ns1")), Some("*pattern*"))) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowNamespacesSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowNamespacesSuiteBase.scala new file mode 100644 index 0000000000000..790489e0d47ce --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowNamespacesSuiteBase.scala @@ -0,0 +1,131 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.{QueryTest, Row} +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.types.{StringType, StructType} + +/** + * This base suite contains unified tests for the `SHOW NAMESPACES` and `SHOW DATABASES` commands + * that check V1 and V2 table catalogs. The tests that cannot run for all supported catalogs are + * located in more specific test suites: + * + * - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.ShowNamespacesSuite` + * - V1 table catalog tests: `org.apache.spark.sql.execution.command.v1.ShowNamespacesSuiteBase` + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.ShowNamespacesSuite` + * - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.ShowNamespacesSuite` + */ +trait ShowNamespacesSuiteBase extends QueryTest with DDLCommandTestUtils { + override val command = "SHOW NAMESPACES" + + protected def runShowNamespacesSql(sqlText: String, expected: Seq[String]): Unit = { + val df = spark.sql(sqlText) + assert(df.schema === new StructType().add("namespace", StringType, false)) + checkAnswer(df, expected.map(Row(_))) + } + + protected def builtinTopNamespaces: Seq[String] = Seq.empty + + test("default namespace") { + withSQLConf(SQLConf.DEFAULT_CATALOG.key -> catalog) { + runShowNamespacesSql("SHOW NAMESPACES", builtinTopNamespaces) + } + runShowNamespacesSql(s"SHOW NAMESPACES IN $catalog", builtinTopNamespaces) + } + + test("at the top level") { + withNamespace(s"$catalog.ns1", s"$catalog.ns2") { + sql(s"CREATE DATABASE $catalog.ns1") + sql(s"CREATE NAMESPACE $catalog.ns2") + + runShowNamespacesSql( + s"SHOW NAMESPACES IN $catalog", + Seq("ns1", "ns2") ++ builtinTopNamespaces) + } + } + + test("exact matching") { + withNamespace(s"$catalog.ns1", s"$catalog.ns2") { + sql(s"CREATE NAMESPACE $catalog.ns1") + sql(s"CREATE NAMESPACE $catalog.ns2") + Seq( + s"SHOW NAMESPACES IN $catalog LIKE 'ns2'", + s"SHOW NAMESPACES IN $catalog 'ns2'", + s"SHOW NAMESPACES FROM $catalog LIKE 'ns2'", + s"SHOW NAMESPACES FROM $catalog 'ns2'").foreach { sqlCmd => + withClue(sqlCmd) { + runShowNamespacesSql(sqlCmd, Seq("ns2")) + } + } + } + } + + test("does not match to any namespace") { + Seq( + "SHOW DATABASES LIKE 'non-existentdb'", + "SHOW NAMESPACES 'non-existentdb'").foreach { sqlCmd => + runShowNamespacesSql(sqlCmd, Seq.empty) + } + } + + test("show root namespaces with the default catalog") { + withSQLConf(SQLConf.DEFAULT_CATALOG.key -> catalog) { + runShowNamespacesSql("SHOW NAMESPACES", builtinTopNamespaces) + + withNamespace("ns1", "ns2") { + sql(s"CREATE NAMESPACE ns1") + sql(s"CREATE NAMESPACE ns2") + + runShowNamespacesSql("SHOW NAMESPACES", Seq("ns1", "ns2") ++ builtinTopNamespaces) + runShowNamespacesSql("SHOW NAMESPACES LIKE '*1*'", Seq("ns1")) + } + } + } + + test("complex namespace patterns") { + withNamespace(s"$catalog.showdb2b", s"$catalog.showdb1a") { + sql(s"CREATE NAMESPACE $catalog.showdb2b") + sql(s"CREATE NAMESPACE $catalog.showdb1a") + + Seq( + "'*db1A'" -> Seq("showdb1a"), + "'*2*'" -> Seq("showdb2b"), + "'*db1A|*db2B'" -> Seq("showdb1a", "showdb2b") + ).foreach { case (pattern, expected) => + runShowNamespacesSql(s"SHOW NAMESPACES IN $catalog LIKE $pattern", expected) + } + } + } + + test("change catalog and namespace with USE statements") { + try { + withNamespace(s"$catalog.ns") { + sql(s"CREATE NAMESPACE $catalog.ns") + sql(s"USE $catalog") + runShowNamespacesSql("SHOW NAMESPACES", Seq("ns") ++ builtinTopNamespaces) + + sql("USE ns") + // 'SHOW NAMESPACES' is not affected by the current namespace and lists root namespaces. + runShowNamespacesSql("SHOW NAMESPACES", Seq("ns") ++ builtinTopNamespaces) + } + } finally { + spark.sessionState.catalogManager.reset() + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowPartitionsParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowPartitionsParserSuite.scala new file mode 100644 index 0000000000000..1c7b1282fde42 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowPartitionsParserSuite.scala @@ -0,0 +1,57 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedPartitionSpec, UnresolvedTable} +import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parsePlan +import org.apache.spark.sql.catalyst.parser.ParseException +import org.apache.spark.sql.catalyst.plans.logical.ShowPartitions +import org.apache.spark.sql.execution.SparkSqlParser +import org.apache.spark.sql.test.SharedSparkSession + +class ShowPartitionsParserSuite extends AnalysisTest with SharedSparkSession { + test("SHOW PARTITIONS") { + val commandName = "SHOW PARTITIONS" + Seq( + "SHOW PARTITIONS t1" -> ShowPartitions(UnresolvedTable(Seq("t1"), commandName, None), None), + "SHOW PARTITIONS db1.t1" -> ShowPartitions( + UnresolvedTable(Seq("db1", "t1"), commandName, None), None), + "SHOW PARTITIONS t1 PARTITION(partcol1='partvalue', partcol2='partvalue')" -> + ShowPartitions( + UnresolvedTable(Seq("t1"), commandName, None), + Some(UnresolvedPartitionSpec(Map("partcol1" -> "partvalue", "partcol2" -> "partvalue")))), + "SHOW PARTITIONS a.b.c" -> ShowPartitions( + UnresolvedTable(Seq("a", "b", "c"), commandName, None), None), + "SHOW PARTITIONS a.b.c PARTITION(ds='2017-06-10')" -> + ShowPartitions( + UnresolvedTable(Seq("a", "b", "c"), commandName, None), + Some(UnresolvedPartitionSpec(Map("ds" -> "2017-06-10")))) + ).foreach { case (sql, expected) => + val parsed = parsePlan(sql) + comparePlans(parsed, expected) + } + } + + test("empty values in non-optional partition specs") { + val e = intercept[ParseException] { + new SparkSqlParser().parsePlan( + "SHOW PARTITIONS dbx.tab1 PARTITION (a='1', b)") + }.getMessage + assert(e.contains("Found an empty partition key 'b'")) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowPartitionsSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowPartitionsSuiteBase.scala new file mode 100644 index 0000000000000..27d2eb9854302 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowPartitionsSuiteBase.scala @@ -0,0 +1,159 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.{AnalysisException, QueryTest, Row, SaveMode} +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.types.{StringType, StructType} + +/** + * This base suite contains unified tests for the `SHOW PARTITIONS` command that check V1 and V2 + * table catalogs. The tests that cannot run for all supported catalogs are located in more + * specific test suites: + * + * - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.ShowPartitionsSuite` + * - V1 table catalog tests: `org.apache.spark.sql.execution.command.v1.ShowPartitionsSuiteBase` + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.ShowPartitionsSuite` + * - V1 Hive External catalog: + * `org.apache.spark.sql.hive.execution.command.ShowPartitionsSuite` + */ +trait ShowPartitionsSuiteBase extends QueryTest with DDLCommandTestUtils { + override val command = "SHOW PARTITIONS" + // Gets the schema of `SHOW PARTITIONS` + private val showSchema: StructType = new StructType().add("partition", StringType, false) + protected def runShowPartitionsSql(sqlText: String, expected: Seq[Row]): Unit = { + val df = spark.sql(sqlText) + assert(df.schema === showSchema) + checkAnswer(df, expected) + } + + protected def createDateTable(table: String): Unit = { + sql(s""" + |CREATE TABLE $table (price int, qty int, year int, month int) + |$defaultUsing + |partitioned by (year, month)""".stripMargin) + sql(s"INSERT INTO $table PARTITION(year = 2015, month = 1) SELECT 1, 1") + sql(s"INSERT INTO $table PARTITION(year = 2015, month = 2) SELECT 2, 2") + sql(s"ALTER TABLE $table ADD PARTITION(year = 2016, month = 2)") + sql(s"ALTER TABLE $table ADD PARTITION(year = 2016, month = 3)") + } + + protected def createNullPartTable(table: String, format: String): Unit = { + import testImplicits._ + val df = Seq((0, ""), (1, null)).toDF("a", "part") + df.write + .partitionBy("part") + .format(format) + .mode(SaveMode.Overwrite) + .saveAsTable(table) + } + + test("show partitions of non-partitioned table") { + withNamespaceAndTable("ns", "not_partitioned_table") { t => + sql(s"CREATE TABLE $t (col1 int) $defaultUsing") + val errMsg = intercept[AnalysisException] { + sql(s"SHOW PARTITIONS $t") + }.getMessage + assert(errMsg.contains("not allowed on a table that is not partitioned") || + // V2 error message. + errMsg.contains(s"Table $t is not partitioned")) + } + } + + test("non-partitioning columns") { + withNamespaceAndTable("ns", "dateTable") { t => + createDateTable(t) + val errMsg = intercept[AnalysisException] { + sql(s"SHOW PARTITIONS $t PARTITION(abcd=2015, xyz=1)") + }.getMessage + assert(errMsg.contains("abcd is not a valid partition column")) + } + } + + test("show everything") { + withNamespaceAndTable("ns", "dateTable") { t => + createDateTable(t) + runShowPartitionsSql( + s"show partitions $t", + Row("year=2015/month=1") :: + Row("year=2015/month=2") :: + Row("year=2016/month=2") :: + Row("year=2016/month=3") :: Nil) + } + } + + test("filter by partitions") { + withNamespaceAndTable("ns", "dateTable") { t => + createDateTable(t) + runShowPartitionsSql( + s"show partitions $t PARTITION(year=2015)", + Row("year=2015/month=1") :: + Row("year=2015/month=2") :: Nil) + runShowPartitionsSql( + s"show partitions $t PARTITION(year=2015, month=1)", + Row("year=2015/month=1") :: Nil) + runShowPartitionsSql( + s"show partitions $t PARTITION(month=2)", + Row("year=2015/month=2") :: + Row("year=2016/month=2") :: Nil) + } + } + + test("show everything more than 5 part keys") { + withNamespaceAndTable("ns", "wideTable") { t => + createWideTable(t) + runShowPartitionsSql( + s"show partitions $t", + Row("year=2016/month=3/hour=10/minute=10/sec=10/extra=1") :: + Row("year=2016/month=4/hour=10/minute=10/sec=10/extra=1") :: Nil) + } + } + + test("SPARK-33667: case sensitivity of partition spec") { + withNamespaceAndTable("ns", "part_table") { t => + sql(s""" + |CREATE TABLE $t (price int, qty int, year int, month int) + |$defaultUsing + |PARTITIONED BY (year, month)""".stripMargin) + sql(s"INSERT INTO $t PARTITION(year = 2015, month = 1) SELECT 1, 1") + Seq( + true -> "PARTITION(year = 2015, month = 1)", + false -> "PARTITION(YEAR = 2015, Month = 1)" + ).foreach { case (caseSensitive, partitionSpec) => + withSQLConf(SQLConf.CASE_SENSITIVE.key -> caseSensitive.toString) { + runShowPartitionsSql( + s"SHOW PARTITIONS $t $partitionSpec", + Row("year=2015/month=1") :: Nil) + } + } + } + } + + test("SPARK-33777: sorted output") { + withNamespaceAndTable("ns", "dateTable") { t => + sql(s""" + |CREATE TABLE $t (id int, part string) + |$defaultUsing + |PARTITIONED BY (part)""".stripMargin) + sql(s"ALTER TABLE $t ADD PARTITION(part = 'b')") + sql(s"ALTER TABLE $t ADD PARTITION(part = 'a')") + val partitions = sql(s"show partitions $t") + assert(partitions.first().getString(0) === "part=a") + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesParserSuite.scala new file mode 100644 index 0000000000000..d68e1233f7ab2 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesParserSuite.scala @@ -0,0 +1,83 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedNamespace, UnresolvedPartitionSpec} +import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parsePlan +import org.apache.spark.sql.catalyst.plans.logical.{ShowTableExtended, ShowTables} +import org.apache.spark.sql.test.SharedSparkSession + +class ShowTablesParserSuite extends AnalysisTest with SharedSparkSession { + private val catalog = "test_catalog" + + test("show tables") { + comparePlans( + parsePlan("SHOW TABLES"), + ShowTables(UnresolvedNamespace(Seq.empty[String]), None)) + comparePlans( + parsePlan("SHOW TABLES '*test*'"), + ShowTables(UnresolvedNamespace(Seq.empty[String]), Some("*test*"))) + comparePlans( + parsePlan("SHOW TABLES LIKE '*test*'"), + ShowTables(UnresolvedNamespace(Seq.empty[String]), Some("*test*"))) + comparePlans( + parsePlan(s"SHOW TABLES FROM $catalog.ns1.ns2.tbl"), + ShowTables(UnresolvedNamespace(Seq(catalog, "ns1", "ns2", "tbl")), None)) + comparePlans( + parsePlan(s"SHOW TABLES IN $catalog.ns1.ns2.tbl"), + ShowTables(UnresolvedNamespace(Seq(catalog, "ns1", "ns2", "tbl")), None)) + comparePlans( + parsePlan("SHOW TABLES IN ns1 '*test*'"), + ShowTables(UnresolvedNamespace(Seq("ns1")), Some("*test*"))) + comparePlans( + parsePlan("SHOW TABLES IN ns1 LIKE '*test*'"), + ShowTables(UnresolvedNamespace(Seq("ns1")), Some("*test*"))) + } + + test("show table extended") { + comparePlans( + parsePlan("SHOW TABLE EXTENDED LIKE '*test*'"), + ShowTableExtended(UnresolvedNamespace(Seq.empty[String]), "*test*", None)) + comparePlans( + parsePlan(s"SHOW TABLE EXTENDED FROM $catalog.ns1.ns2 LIKE '*test*'"), + ShowTableExtended(UnresolvedNamespace(Seq(catalog, "ns1", "ns2")), "*test*", None)) + comparePlans( + parsePlan(s"SHOW TABLE EXTENDED IN $catalog.ns1.ns2 LIKE '*test*'"), + ShowTableExtended(UnresolvedNamespace(Seq(catalog, "ns1", "ns2")), "*test*", None)) + comparePlans( + parsePlan("SHOW TABLE EXTENDED LIKE '*test*' PARTITION(ds='2008-04-09', hr=11)"), + ShowTableExtended( + UnresolvedNamespace(Seq.empty[String]), + "*test*", + Some(UnresolvedPartitionSpec(Map("ds" -> "2008-04-09", "hr" -> "11"))))) + comparePlans( + parsePlan(s"SHOW TABLE EXTENDED FROM $catalog.ns1.ns2 LIKE '*test*' " + + "PARTITION(ds='2008-04-09')"), + ShowTableExtended( + UnresolvedNamespace(Seq(catalog, "ns1", "ns2")), + "*test*", + Some(UnresolvedPartitionSpec(Map("ds" -> "2008-04-09"))))) + comparePlans( + parsePlan(s"SHOW TABLE EXTENDED IN $catalog.ns1.ns2 LIKE '*test*' " + + "PARTITION(ds='2008-04-09')"), + ShowTableExtended( + UnresolvedNamespace(Seq(catalog, "ns1", "ns2")), + "*test*", + Some(UnresolvedPartitionSpec(Map("ds" -> "2008-04-09"))))) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala new file mode 100644 index 0000000000000..06385017bbd64 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/ShowTablesSuiteBase.scala @@ -0,0 +1,135 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.{QueryTest, Row} +import org.apache.spark.sql.catalyst.analysis.NoSuchNamespaceException +import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._ +import org.apache.spark.sql.internal.SQLConf + +/** + * This base suite contains unified tests for the `SHOW TABLES` command that check V1 and V2 + * table catalogs. The tests that cannot run for all supported catalogs are located in more + * specific test suites: + * + * - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.ShowTablesSuite` + * - V1 table catalog tests: `org.apache.spark.sql.execution.command.v1.ShowTablesSuiteBase` + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.ShowTablesSuite` + * - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.ShowTablesSuite` + */ +trait ShowTablesSuiteBase extends QueryTest with DDLCommandTestUtils { + override val command = "SHOW TABLES" + protected def defaultNamespace: Seq[String] + + protected def runShowTablesSql(sqlText: String, expected: Seq[Row]): Unit = { + val df = spark.sql(sqlText) + checkAnswer(df, expected) + } + + test("show an existing table") { + withNamespaceAndTable("ns", "table") { t => + sql(s"CREATE TABLE $t (name STRING, id INT) $defaultUsing") + runShowTablesSql(s"SHOW TABLES IN $catalog.ns", Seq(Row("ns", "table", false))) + } + } + + test("show table in a not existing namespace") { + val msg = intercept[NoSuchNamespaceException] { + runShowTablesSql(s"SHOW TABLES IN $catalog.unknown", Seq()) + }.getMessage + assert(msg.matches("(Database|Namespace) 'unknown' not found")) + } + + test("show tables with a pattern") { + withNamespace(s"$catalog.ns1", s"$catalog.ns2") { + sql(s"CREATE NAMESPACE $catalog.ns1") + sql(s"CREATE NAMESPACE $catalog.ns2") + withTable( + s"$catalog.ns1.table", + s"$catalog.ns1.table_name_1a", + s"$catalog.ns1.table_name_2b", + s"$catalog.ns2.table_name_2b") { + sql(s"CREATE TABLE $catalog.ns1.table (id bigint, data string) $defaultUsing") + sql(s"CREATE TABLE $catalog.ns1.table_name_1a (id bigint, data string) $defaultUsing") + sql(s"CREATE TABLE $catalog.ns1.table_name_2b (id bigint, data string) $defaultUsing") + sql(s"CREATE TABLE $catalog.ns2.table_name_2b (id bigint, data string) $defaultUsing") + + runShowTablesSql( + s"SHOW TABLES FROM $catalog.ns1", + Seq( + Row("ns1", "table", false), + Row("ns1", "table_name_1a", false), + Row("ns1", "table_name_2b", false))) + + runShowTablesSql( + s"SHOW TABLES FROM $catalog.ns1 LIKE '*name*'", + Seq( + Row("ns1", "table_name_1a", false), + Row("ns1", "table_name_2b", false))) + + runShowTablesSql( + s"SHOW TABLES FROM $catalog.ns1 LIKE 'table_name_1*|table_name_2*'", + Seq( + Row("ns1", "table_name_1a", false), + Row("ns1", "table_name_2b", false))) + + runShowTablesSql( + s"SHOW TABLES FROM $catalog.ns1 LIKE '*2b'", + Seq(Row("ns1", "table_name_2b", false))) + } + } + } + + test("show tables with current catalog and namespace") { + withSQLConf(SQLConf.DEFAULT_CATALOG.key -> catalog) { + val tblName = (catalog +: defaultNamespace :+ "table").quoted + withTable(tblName) { + sql(s"CREATE TABLE $tblName (name STRING, id INT) $defaultUsing") + val ns = defaultNamespace.mkString(".") + runShowTablesSql("SHOW TABLES", Seq(Row(ns, "table", false))) + } + } + } + + test("SPARK-34560: unique attribute references") { + withNamespaceAndTable("ns1", "tbl1") { t1 => + sql(s"CREATE TABLE $t1 (col INT) $defaultUsing") + val show1 = sql(s"SHOW TABLES IN $catalog.ns1") + withNamespaceAndTable("ns2", "tbl2") { t2 => + sql(s"CREATE TABLE $t2 (col INT) $defaultUsing") + val show2 = sql(s"SHOW TABLES IN $catalog.ns2") + assert(!show1.join(show2).where(show1("tableName") =!= show2("tableName")).isEmpty) + } + } + } + + test("change current catalog and namespace with USE statements") { + withNamespaceAndTable("ns", "table") { t => + sql(s"CREATE TABLE $t (name STRING, id INT) $defaultUsing") + + sql(s"USE $catalog") + // No table is matched since the current namespace is not ["ns"] + assert(defaultNamespace != Seq("ns")) + runShowTablesSql("SHOW TABLES", Seq()) + + // Update the current namespace to match "ns.tbl". + sql(s"USE $catalog.ns") + runShowTablesSql("SHOW TABLES", Seq(Row("ns", "table", false))) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/TruncateTableParserSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/TruncateTableParserSuite.scala new file mode 100644 index 0000000000000..7f4a48023c16e --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/TruncateTableParserSuite.scala @@ -0,0 +1,55 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.catalyst.analysis.{AnalysisTest, UnresolvedPartitionSpec, UnresolvedTable} +import org.apache.spark.sql.catalyst.parser.CatalystSqlParser.parsePlan +import org.apache.spark.sql.catalyst.parser.ParseException +import org.apache.spark.sql.catalyst.plans.logical.{TruncatePartition, TruncateTable} +import org.apache.spark.sql.test.SharedSparkSession + +class TruncateTableParserSuite extends AnalysisTest with SharedSparkSession { + test("truncate table") { + comparePlans( + parsePlan("TRUNCATE TABLE a.b.c"), + TruncateTable(UnresolvedTable(Seq("a", "b", "c"), "TRUNCATE TABLE", None))) + } + + test("truncate a single part partition") { + comparePlans( + parsePlan("TRUNCATE TABLE a.b.c PARTITION(ds='2017-06-10')"), + TruncatePartition( + UnresolvedTable(Seq("a", "b", "c"), "TRUNCATE TABLE", None), + UnresolvedPartitionSpec(Map("ds" -> "2017-06-10"), None))) + } + + test("truncate a multi parts partition") { + comparePlans( + parsePlan("TRUNCATE TABLE ns.tbl PARTITION(a = 1, B = 'ABC')"), + TruncatePartition( + UnresolvedTable(Seq("ns", "tbl"), "TRUNCATE TABLE", None), + UnresolvedPartitionSpec(Map("a" -> "1", "B" -> "ABC"), None))) + } + + test("empty values in non-optional partition specs") { + val errMsg = intercept[ParseException] { + parsePlan("TRUNCATE TABLE dbx.tab1 PARTITION (a='1', b)") + }.getMessage + assert(errMsg.contains("Found an empty partition key 'b'")) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/TruncateTableSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/TruncateTableSuiteBase.scala new file mode 100644 index 0000000000000..001ec8e250def --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/TruncateTableSuiteBase.scala @@ -0,0 +1,233 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command + +import org.apache.spark.sql.{AnalysisException, QueryTest, Row} +import org.apache.spark.sql.catalyst.analysis.NoSuchPartitionException +import org.apache.spark.sql.internal.SQLConf + +/** + * This base suite contains unified tests for the `TRUNCATE TABLE` command that check V1 and V2 + * table catalogs. The tests that cannot run for all supported catalogs are located in more + * specific test suites: + * + * - V2 table catalog tests: `org.apache.spark.sql.execution.command.v2.TruncateTableSuite` + * - V1 table catalog tests: `org.apache.spark.sql.execution.command.v1.TruncateTableSuiteBase` + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.TruncateTableSuite` + * - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.TruncateTableSuite` + */ +trait TruncateTableSuiteBase extends QueryTest with DDLCommandTestUtils { + override val command = "TRUNCATE TABLE" + + test("table does not exist") { + withNamespaceAndTable("ns", "does_not_exist") { t => + val errMsg = intercept[AnalysisException] { + sql(s"TRUNCATE TABLE $t") + }.getMessage + assert(errMsg.contains("Table not found")) + } + } + + test("truncate non-partitioned table") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (c0 INT, c1 INT) $defaultUsing") + sql(s"INSERT INTO $t SELECT 0, 1") + + sql(s"TRUNCATE TABLE $t") + QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Nil) + } + } + + protected def createPartTable(t: String): Unit = { + sql(s""" + |CREATE TABLE $t (width INT, length INT, height INT) + |$defaultUsing + |PARTITIONED BY (width, length)""".stripMargin) + sql(s"INSERT INTO $t PARTITION (width = 0, length = 0) SELECT 0") + sql(s"INSERT INTO $t PARTITION (width = 1, length = 1) SELECT 1") + sql(s"INSERT INTO $t PARTITION (width = 1, length = 2) SELECT 3") + } + + test("SPARK-34418: truncate partitioned tables") { + withNamespaceAndTable("ns", "partTable") { t => + createPartTable(t) + sql(s"TRUNCATE TABLE $t PARTITION (width = 1, length = 1)") + checkAnswer(sql(s"SELECT width, length, height FROM $t"), Seq(Row(0, 0, 0), Row(1, 2, 3))) + checkPartitions(t, + Map("width" -> "0", "length" -> "0"), + Map("width" -> "1", "length" -> "1"), + Map("width" -> "1", "length" -> "2")) + } + + withNamespaceAndTable("ns", "partTable") { t => + createPartTable(t) + // support partial partition spec + sql(s"TRUNCATE TABLE $t PARTITION (width = 1)") + QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Row(0, 0, 0) :: Nil) + checkPartitions(t, + Map("width" -> "0", "length" -> "0"), + Map("width" -> "1", "length" -> "1"), + Map("width" -> "1", "length" -> "2")) + } + + withNamespaceAndTable("ns", "partTable") { t => + createPartTable(t) + // do nothing if no partition is matched for the given partial partition spec + sql(s"TRUNCATE TABLE $t PARTITION (width = 100)") + QueryTest.checkAnswer( + sql(s"SELECT width, length, height FROM $t"), + Seq(Row(0, 0, 0), Row(1, 1, 1), Row(1, 2, 3))) + + // throw exception if no partition is matched for the given non-partial partition spec. + intercept[NoSuchPartitionException] { + sql(s"TRUNCATE TABLE $t PARTITION (width = 100, length = 100)") + } + + // throw exception if the column in partition spec is not a partition column. + val errMsg = intercept[AnalysisException] { + sql(s"TRUNCATE TABLE $t PARTITION (unknown = 1)") + }.getMessage + assert(errMsg.contains("unknown is not a valid partition column")) + } + } + + protected def invalidPartColumnError: String + + test("truncate a partition of non partitioned table") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (c0 INT) $defaultUsing") + sql(s"INSERT INTO $t SELECT 0") + + val errMsg = intercept[AnalysisException] { + sql(s"TRUNCATE TABLE $t PARTITION (c0=1)") + }.getMessage + assert(errMsg.contains(invalidPartColumnError)) + } + } + + test("SPARK-34418: preserve partitions in truncated table") { + withNamespaceAndTable("ns", "partTable") { t => + createPartTable(t) + checkAnswer( + sql(s"SELECT width, length, height FROM $t"), + Seq(Row(0, 0, 0), Row(1, 1, 1), Row(1, 2, 3))) + sql(s"TRUNCATE TABLE $t") + checkAnswer(sql(s"SELECT width, length, height FROM $t"), Nil) + checkPartitions(t, + Map("width" -> "0", "length" -> "0"), + Map("width" -> "1", "length" -> "1"), + Map("width" -> "1", "length" -> "2")) + } + } + + test("case sensitivity in resolving partition specs") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)") + sql(s"INSERT INTO $t PARTITION (id=0) SELECT 'abc'") + sql(s"INSERT INTO $t PARTITION (id=1) SELECT 'def'") + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + val errMsg = intercept[AnalysisException] { + sql(s"TRUNCATE TABLE $t PARTITION (ID=1)") + }.getMessage + assert(errMsg.contains("ID is not a valid partition column")) + } + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + sql(s"TRUNCATE TABLE $t PARTITION (ID=1)") + QueryTest.checkAnswer(sql(s"SELECT id, data FROM $t"), Row(0, "abc") :: Nil) + } + } + } + + test("SPARK-34215: keep table cached after truncation") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (c0 int) $defaultUsing") + sql(s"INSERT INTO $t SELECT 0") + sql(s"CACHE TABLE $t") + assert(spark.catalog.isCached(t)) + QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Row(0) :: Nil) + sql(s"TRUNCATE TABLE $t") + assert(spark.catalog.isCached(t)) + QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Nil) + } + } + + test("truncation of views is not allowed") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + + withView("v0") { + sql(s"CREATE VIEW v0 AS SELECT * FROM $t") + val errMsg = intercept[AnalysisException] { + sql("TRUNCATE TABLE v0") + }.getMessage + assert(errMsg.contains("'TRUNCATE TABLE' expects a table")) + } + + withTempView("v1") { + sql(s"CREATE TEMP VIEW v1 AS SELECT * FROM $t") + val errMsg = intercept[AnalysisException] { + sql("TRUNCATE TABLE v1") + }.getMessage + assert(errMsg.contains("'TRUNCATE TABLE' expects a table")) + } + + val v2 = s"${spark.sharedState.globalTempViewManager.database}.v2" + withGlobalTempView("v2") { + sql(s"CREATE GLOBAL TEMP VIEW v2 AS SELECT * FROM $t") + val errMsg = intercept[AnalysisException] { + sql(s"TRUNCATE TABLE $v2") + }.getMessage + assert(errMsg.contains("'TRUNCATE TABLE' expects a table")) + } + } + } + + test("keep dependents as cached after table truncation") { + withNamespaceAndTable("ns", "tbl") { t => + createPartTable(t) + cacheRelation(t) + QueryTest.checkAnswer( + sql(s"SELECT width, length, height FROM $t"), + Seq(Row(0, 0, 0), Row(1, 1, 1), Row(1, 2, 3))) + + withView("v0") { + sql(s"CREATE VIEW v0 AS SELECT * FROM $t") + cacheRelation("v0") + sql(s"TRUNCATE TABLE $t PARTITION (width = 1, length = 2)") + checkCachedRelation("v0", Seq(Row(0, 0, 0), Row(1, 1, 1))) + } + + withTempView("v1") { + sql(s"CREATE TEMP VIEW v1 AS SELECT * FROM $t") + cacheRelation("v1") + sql(s"TRUNCATE TABLE $t PARTITION (width = 1, length = 1)") + checkCachedRelation("v1", Seq(Row(0, 0, 0))) + } + + val v2 = s"${spark.sharedState.globalTempViewManager.database}.v2" + withGlobalTempView("v2") { + sql(s"INSERT INTO $t PARTITION (width = 10, length = 10) SELECT 10") + sql(s"CREATE GLOBAL TEMP VIEW v2 AS SELECT * FROM $t") + cacheRelation(v2) + sql(s"TRUNCATE TABLE $t PARTITION (width = 10, length = 10)") + checkCachedRelation(v2, Seq(Row(0, 0, 0))) + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableAddPartitionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableAddPartitionSuite.scala new file mode 100644 index 0000000000000..b2e626be1b180 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableAddPartitionSuite.scala @@ -0,0 +1,144 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v1 + +import org.apache.spark.sql.{AnalysisException, Row} +import org.apache.spark.sql.execution.command +import org.apache.spark.sql.internal.SQLConf + +/** + * This base suite contains unified tests for the `ALTER TABLE .. ADD PARTITION` command that + * check V1 table catalogs. The tests that cannot run for all V1 catalogs are located in more + * specific test suites: + * + * - V1 In-Memory catalog: + * `org.apache.spark.sql.execution.command.v1.AlterTableAddPartitionSuite` + * - V1 Hive External catalog: + * `org.apache.spark.sql.hive.execution.command.AlterTableAddPartitionSuite` + */ +trait AlterTableAddPartitionSuiteBase extends command.AlterTableAddPartitionSuiteBase { + test("empty string as partition value") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (col1 INT, p1 STRING) $defaultUsing PARTITIONED BY (p1)") + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $t ADD PARTITION (p1 = '')") + }.getMessage + assert(errMsg.contains("Partition spec is invalid. " + + "The spec ([p1=]) contains an empty partition column value")) + } + } + + test("SPARK-34055: refresh cache in partition adding") { + withTable("t") { + sql(s"CREATE TABLE t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql("INSERT INTO t PARTITION (part=0) SELECT 0") + assert(!spark.catalog.isCached("t")) + sql("CACHE TABLE t") + assert(spark.catalog.isCached("t")) + checkAnswer(sql("SELECT * FROM t"), Seq(Row(0, 0))) + + // Create new partition (part = 1) in the filesystem + val part1Loc = copyPartition("t", "part=0", "part=1") + + sql(s"ALTER TABLE t ADD PARTITION (part=1) LOCATION '$part1Loc'") + assert(spark.catalog.isCached("t")) + checkAnswer(sql("SELECT * FROM t"), Seq(Row(0, 0), Row(0, 1))) + } + } + + test("SPARK-34084: auto update table stats") { + withNamespaceAndTable("ns", "tbl") { t => + withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> "false") { + sql(s"CREATE TABLE $t (col0 int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + val errMsg = intercept[IllegalArgumentException] { + getTableSize(t) + }.getMessage + assert(errMsg.contains(s"The table $t does not have stats")) + } + withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> "true") { + sql(s"ALTER TABLE $t ADD PARTITION (part=1)") + assert(getTableSize(t) > 0) + } + } + } + + test("SPARK-34060, SPARK-34071: update stats of cached table") { + withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> "true") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + assert(!spark.catalog.isCached(t)) + sql(s"CACHE TABLE $t") + assert(spark.catalog.isCached(t)) + checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(0, 0))) + val onePartSize = getTableSize(t) + assert(onePartSize > 0) + + // Create new partition (part = 1) in the filesystem + val part1Loc = copyPartition(t, "part=0", "part=1") + + sql(s"ALTER TABLE $t ADD PARTITION (part=1) LOCATION '$part1Loc'") + assert(spark.catalog.isCached(t)) + val twoPartSize = getTableSize(t) + assert(onePartSize < twoPartSize) + checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(0, 0), Row(0, 1))) + } + } + } + + test("SPARK-34138: keep dependents cached after table altering") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + cacheRelation(t) + checkCachedRelation(t, Seq(Row(0, 0))) + + withView("v0") { + sql(s"CREATE VIEW v0 AS SELECT * FROM $t") + cacheRelation("v0") + val part1Loc = copyPartition(t, "part=0", "part=1") + sql(s"ALTER TABLE $t ADD PARTITION (part=1) LOCATION '$part1Loc'") + checkCachedRelation("v0", Seq(Row(0, 0), Row(0, 1))) + } + + withTempView("v1") { + sql(s"CREATE TEMP VIEW v1 AS SELECT * FROM $t") + cacheRelation("v1") + val part2Loc = copyPartition(t, "part=0", "part=2") + sql(s"ALTER TABLE $t ADD PARTITION (part=2) LOCATION '$part2Loc'") + checkCachedRelation("v1", Seq(Row(0, 0), Row(0, 1), Row(0, 2))) + } + + val v2 = s"${spark.sharedState.globalTempViewManager.database}.v2" + withGlobalTempView("v2") { + sql(s"CREATE GLOBAL TEMP VIEW v2 AS SELECT * FROM $t") + cacheRelation(v2) + val part3Loc = copyPartition(t, "part=0", "part=3") + sql(s"ALTER TABLE $t ADD PARTITION (part=3) LOCATION '$part3Loc'") + checkCachedRelation(v2, Seq(Row(0, 0), Row(0, 1), Row(0, 2), Row(0, 3))) + } + } + } +} + +/** + * The class contains tests for the `ALTER TABLE .. ADD PARTITION` command to check + * V1 In-Memory table catalog. + */ +class AlterTableAddPartitionSuite extends AlterTableAddPartitionSuiteBase with CommandSuiteBase diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableDropPartitionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableDropPartitionSuite.scala new file mode 100644 index 0000000000000..cc57e10a16887 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableDropPartitionSuite.scala @@ -0,0 +1,89 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v1 + +import org.apache.spark.sql.{AnalysisException, Row} +import org.apache.spark.sql.execution.command +import org.apache.spark.sql.internal.SQLConf + +/** + * This base suite contains unified tests for the `ALTER TABLE .. DROP PARTITION` command that + * check V1 table catalogs. The tests that cannot run for all V1 catalogs are located in more + * specific test suites: + * + * - V1 In-Memory catalog: + * `org.apache.spark.sql.execution.command.v1.AlterTableDropPartitionSuite` + * - V1 Hive External catalog: + * `org.apache.spark.sql.hive.execution.command.AlterTableDropPartitionSuite` + */ +trait AlterTableDropPartitionSuiteBase extends command.AlterTableDropPartitionSuiteBase { + override protected val notFullPartitionSpecErr = "The following partitions not found in table" + override protected def nullPartitionValue: String = "__HIVE_DEFAULT_PARTITION__" + + test("purge partition data") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)") + sql(s"ALTER TABLE $t ADD PARTITION (id = 1)") + checkPartitions(t, Map("id" -> "1")) + sql(s"ALTER TABLE $t DROP PARTITION (id = 1) PURGE") + checkPartitions(t) // no partitions + } + } + + test("SPARK-34060, SPARK-34071: update stats of cached table") { + withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> "true") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1") + assert(!spark.catalog.isCached(t)) + sql(s"CACHE TABLE $t") + assert(spark.catalog.isCached(t)) + checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(0, 0), Row(1, 1))) + val twoPartSize = getTableSize(t) + assert(twoPartSize > 0) + + sql(s"ALTER TABLE $t DROP PARTITION (part=0)") + assert(spark.catalog.isCached(t)) + val onePartSize = getTableSize(t) + assert(0 < onePartSize && onePartSize < twoPartSize) + checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(1, 1))) + } + } + } +} + +/** + * The class contains tests for the `ALTER TABLE .. DROP PARTITION` command to check + * V1 In-Memory table catalog. + */ +class AlterTableDropPartitionSuite + extends AlterTableDropPartitionSuiteBase + with CommandSuiteBase { + + test("empty string as partition value") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (col1 INT, p1 STRING) $defaultUsing PARTITIONED BY (p1)") + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $t DROP PARTITION (p1 = '')") + }.getMessage + assert(errMsg.contains("Partition spec is invalid. " + + "The spec ([p1=]) contains an empty partition column value")) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableRecoverPartitionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableRecoverPartitionsSuite.scala new file mode 100644 index 0000000000000..16dd6a3a03f1d --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableRecoverPartitionsSuite.scala @@ -0,0 +1,140 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v1 + +import org.apache.hadoop.fs.Path + +import org.apache.spark.internal.config.RDD_PARALLEL_LISTING_THRESHOLD +import org.apache.spark.sql.AnalysisException +import org.apache.spark.sql.execution.command + +/** + * This base suite contains unified tests for the `ALTER TABLE .. RECOVER PARTITIONS` command that + * check V1 table catalogs. The tests that cannot run for all V1 catalogs are located in more + * specific test suites: + * + * - V1 In-Memory catalog (sequential): + * `org.apache.spark.sql.execution.command.v1.AlterTableRecoverPartitionsSuite` + * - V1 In-Memory catalog (parallel): + * `org.apache.spark.sql.execution.command.v1.AlterTableRecoverPartitionsParallelSuite` + * - V1 Hive External catalog: + * `org.apache.spark.sql.hive.execution.command.AlterTableRecoverPartitionsSuite` + */ +trait AlterTableRecoverPartitionsSuiteBase extends command.AlterTableRecoverPartitionsSuiteBase { + test("table does not exist") { + val errMsg = intercept[AnalysisException] { + sql("ALTER TABLE does_not_exist RECOVER PARTITIONS") + }.getMessage + assert(errMsg.contains("Table not found")) + } + + test("valid locations") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (a INT, b INT, c INT, d INT) $defaultUsing PARTITIONED BY (a, b, c)") + checkPartitions(t) + + withTableDir(t) { case (fs, root) => + fs.mkdirs(new Path(new Path(new Path(root, "a=1"), "b=5"), "c=19")) + fs.createNewFile(new Path(new Path(root, "a=1/b=5/c=19"), "a.csv")) // file + fs.createNewFile(new Path(new Path(root, "a=1/b=5/c=19"), "_SUCCESS")) // file + + fs.mkdirs(new Path(new Path(new Path(root, "A=2"), "B=6"), "C=31")) + fs.createNewFile(new Path(new Path(root, "A=2/B=6/C=31"), "b.csv")) // file + fs.createNewFile(new Path(new Path(root, "A=2/B=6/C=31"), "c.csv")) // file + fs.createNewFile(new Path(new Path(root, "A=2/B=6/C=31"), ".hiddenFile")) // file + fs.mkdirs(new Path(new Path(root, "A=2/B=6/C=31"), "_temporary")) + } + + sql(s"ALTER TABLE $t RECOVER PARTITIONS") + checkPartitions(t, + Map("a" -> "1", "b" -> "5", "c" -> "19"), + Map("a" -> "2", "b" -> "6", "c" -> "31")) + } + } + + test("invalid locations") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (a INT, b INT, c INT, d INT) $defaultUsing PARTITIONED BY (a, b, c)") + sql(s"INSERT INTO $t PARTITION (a=0, b=1, c=2) SELECT 3") + checkPartitions(t, Map("a" -> "0", "b" -> "1", "c" -> "2")) + + withTableDir(t) { case (fs, root) => + fs.mkdirs(new Path(new Path(root, "a"), "b")) // bad name + fs.mkdirs(new Path(new Path(root, "b=1"), "a=1")) // wrong order + fs.mkdirs(new Path(root, "a=4")) // not enough columns + fs.createNewFile(new Path(new Path(root, "a=1"), "b=4")) // file + fs.createNewFile(new Path(new Path(root, "a=1"), "_SUCCESS")) // _SUCCESS + fs.mkdirs(new Path(new Path(root, "a=1"), "_temporary")) // _temporary + fs.mkdirs(new Path(new Path(root, "a=1"), ".b=4")) // start with . + } + + sql(s"ALTER TABLE $t RECOVER PARTITIONS") + checkPartitions(t, Map("a" -> "0", "b" -> "1", "c" -> "2")) + } + } + + test("multiple locations") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (a INT, b INT, c INT, d INT) $defaultUsing PARTITIONED BY (a, b, c)") + sql(s"INSERT INTO $t PARTITION (a=0, b=1, c=2) SELECT 3") + val initPart = Map("a" -> "0", "b" -> "1", "c" -> "2") + checkPartitions(t, initPart) + + withTableDir(t) { case (fs, root) => + (0 to 100).foreach { a => + val part = Map("a" -> a.toString, "b" -> "5", "c" -> "42") + fs.mkdirs(new Path(new Path(new Path(root, s"a=$a"), "b=5"), "c=42")) + val loc = s"a=$a/b=5/c=42" + fs.createNewFile(new Path(new Path(root, loc), "a.csv")) // file + if (a >= 10) { + sql(s"ALTER TABLE $t ADD ${partSpecToString(part)} LOCATION '$loc'") + } + } + } + + sql(s"ALTER TABLE $t RECOVER PARTITIONS") + val expected = (0 to 100) + .map(a => Map("a" -> a.toString, "b" -> "5", "c" -> "42")) :+ initPart + checkPartitions(t, expected: _*) + } + } +} + +/** + * The class contains tests for the `ALTER TABLE .. RECOVER PARTITIONS` command to check + * V1 In-Memory table catalog (sequential). + */ +class AlterTableRecoverPartitionsSuite + extends AlterTableRecoverPartitionsSuiteBase + with CommandSuiteBase { + + override protected def sparkConf = super.sparkConf + .set(RDD_PARALLEL_LISTING_THRESHOLD, 0) +} + +/** + * The class contains tests for the `ALTER TABLE .. RECOVER PARTITIONS` command to check + * V1 In-Memory table catalog (parallel). + */ +class AlterTableRecoverPartitionsParallelSuite + extends AlterTableRecoverPartitionsSuiteBase + with CommandSuiteBase { + + override protected def sparkConf = super.sparkConf + .set(RDD_PARALLEL_LISTING_THRESHOLD, 10) +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableRenamePartitionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableRenamePartitionSuite.scala new file mode 100644 index 0000000000000..b7f3696351cfb --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableRenamePartitionSuite.scala @@ -0,0 +1,79 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v1 + +import org.apache.spark.sql.{QueryTest, Row} +import org.apache.spark.sql.execution.command +import org.apache.spark.sql.internal.SQLConf + +/** + * This base suite contains unified tests for the `ALTER TABLE .. RENAME PARTITION` command that + * check V1 table catalogs. The tests that cannot run for all V1 catalogs are located in more + * specific test suites: + * + * - V1 In-Memory catalog: + * `org.apache.spark.sql.execution.command.v1.AlterTableRenamePartitionSuite` + * - V1 Hive External catalog: + * `org.apache.spark.sql.hive.execution.command.AlterTableRenamePartitionSuite` + */ +trait AlterTableRenamePartitionSuiteBase extends command.AlterTableRenamePartitionSuiteBase { + test("with location") { + withNamespaceAndTable("ns", "tbl") { t => + createSinglePartTable(t) + sql(s"ALTER TABLE $t ADD PARTITION (id = 2) LOCATION 'loc1'") + sql(s"INSERT INTO $t PARTITION (id = 2) SELECT 'def'") + checkPartitions(t, Map("id" -> "1"), Map("id" -> "2")) + checkLocation(t, Map("id" -> "2"), "loc1") + + sql(s"ALTER TABLE $t PARTITION (id = 2) RENAME TO PARTITION (id = 3)") + checkPartitions(t, Map("id" -> "1"), Map("id" -> "3")) + // V1 catalogs rename the partition location of managed tables + checkLocation(t, Map("id" -> "3"), "id=3") + checkAnswer(sql(s"SELECT id, data FROM $t WHERE id = 3"), Row(3, "def")) + } + } + + test("SPARK-34060, SPARK-34071: update stats of cached table") { + withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> "true") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1") + assert(!spark.catalog.isCached(t)) + sql(s"CACHE TABLE $t") + assert(spark.catalog.isCached(t)) + QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(0, 0), Row(1, 1))) + val tableSize = getTableSize(t) + assert(tableSize > 0) + + sql(s"ALTER TABLE $t PARTITION (part=0) RENAME TO PARTITION (part=2)") + assert(spark.catalog.isCached(t)) + assert(tableSize == getTableSize(t)) + QueryTest.checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(0, 2), Row(1, 1))) + } + } + } +} + +/** + * The class contains tests for the `ALTER TABLE .. RENAME PARTITION` command to check + * V1 In-Memory table catalog. + */ +class AlterTableRenamePartitionSuite + extends AlterTableRenamePartitionSuiteBase + with CommandSuiteBase diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableRenameSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableRenameSuite.scala new file mode 100644 index 0000000000000..abc99db441db2 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/AlterTableRenameSuite.scala @@ -0,0 +1,83 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v1 + +import org.apache.spark.sql.AnalysisException +import org.apache.spark.sql.execution.command + +/** + * This base suite contains unified tests for the `ALTER TABLE .. RENAME` command that check V1 + * table catalogs. The tests that cannot run for all V1 catalogs are located in more + * specific test suites: + * + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.AlterTableRenameSuite` + * - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.AlterTableRenameSuite` + */ +trait AlterTableRenameSuiteBase extends command.AlterTableRenameSuiteBase { + test("destination database is different") { + withNamespaceAndTable("dst_ns", "dst_tbl") { dst => + withNamespace("src_ns") { + sql(s"CREATE NAMESPACE $catalog.src_ns") + val src = dst.replace("dst", "src") + sql(s"CREATE TABLE $src (c0 INT) $defaultUsing") + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $src RENAME TO dst_ns.dst_tbl") + }.getMessage + assert(errMsg.contains("source and destination databases do not match")) + } + } + } + + test("preserve table stats") { + withNamespaceAndTable("ns", "dst_tbl") { dst => + val src = dst.replace("dst", "src") + sql(s"CREATE TABLE $src (c0 INT) $defaultUsing") + sql(s"INSERT INTO $src SELECT 0") + sql(s"ANALYZE TABLE $src COMPUTE STATISTICS") + val size = getTableSize(src) + assert(size > 0) + sql(s"ALTER TABLE $src RENAME TO ns.dst_tbl") + assert(size === getTableSize(dst)) + } + } + + test("the destination folder exists already") { + withNamespaceAndTable("ns", "dst_tbl") { dst => + val src = dst.replace("dst", "src") + sql(s"CREATE TABLE $src (c0 INT) $defaultUsing") + sql(s"INSERT INTO $src SELECT 0") + + sql(s"CREATE TABLE $dst (c0 INT) $defaultUsing") + withTableDir(dst) { (fs, dst_dir) => + sql(s"DROP TABLE $dst") + fs.mkdirs(dst_dir) + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $src RENAME TO ns.dst_tbl") + }.getMessage + assert(errMsg.matches("Can not rename the managed table(.+). " + + "The associated location(.+) already exists.")) + } + } + } +} + +/** + * The class contains tests for the `ALTER TABLE .. RENAME` command to check + * V1 In-Memory table catalog. + */ +class AlterTableRenameSuite extends AlterTableRenameSuiteBase with CommandSuiteBase diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/CommandSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/CommandSuiteBase.scala new file mode 100644 index 0000000000000..80c552de567ba --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/CommandSuiteBase.scala @@ -0,0 +1,50 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v1 + +import org.apache.spark.sql.catalyst.catalog.CatalogTypes.TablePartitionSpec +import org.apache.spark.sql.connector.catalog.CatalogManager +import org.apache.spark.sql.test.SharedSparkSession + +/** + * The trait contains settings and utility functions. It can be mixed to the test suites for + * datasource v1 In-Memory catalog. This trait complements the common trait + * `org.apache.spark.sql.execution.command.DDLCommandTestUtils` with utility functions and + * settings for all unified datasource V1 and V2 test suites. + */ +trait CommandSuiteBase extends SharedSparkSession { + def version: String = "V1" // The prefix is added to test names + def catalog: String = CatalogManager.SESSION_CATALOG_NAME + def defaultUsing: String = "USING parquet" // The clause is used in creating tables under testing + + // TODO(SPARK-33393): Move this to `DDLCommandTestUtils` + def checkLocation( + t: String, + spec: TablePartitionSpec, + expected: String): Unit = { + val tablePath = t.split('.') + val tableName = tablePath.last + val ns = tablePath.init.mkString(".") + val partSpec = spec.map { case (key, value) => s"$key = $value"}.mkString(", ") + val information = sql(s"SHOW TABLE EXTENDED IN $ns LIKE '$tableName' PARTITION($partSpec)") + .select("information") + .first().getString(0) + val location = information.split("\\r?\\n").filter(_.startsWith("Location:")).head + assert(location.endsWith(expected)) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DropTableSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DropTableSuite.scala new file mode 100644 index 0000000000000..497624f0a18de --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/DropTableSuite.scala @@ -0,0 +1,48 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v1 + +import org.apache.spark.sql.execution.command + +/** + * This base suite contains unified tests for the `DROP TABLE` command that check V1 + * table catalogs. The tests that cannot run for all V1 catalogs are located in more + * specific test suites: + * + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.DropTableSuite` + * - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.DropTableSuite` + */ +trait DropTableSuiteBase extends command.DropTableSuiteBase { + test("purge option") { + withNamespace(s"$catalog.ns") { + sql(s"CREATE NAMESPACE $catalog.ns") + + createTable(s"$catalog.ns.tbl") + checkTables("ns", "tbl") + + sql(s"DROP TABLE $catalog.ns.tbl PURGE") + checkTables("ns") // no tables + } + } +} + +/** + * The class contains tests for the `DROP TABLE` command to check V1 In-Memory table catalog. + */ +class DropTableSuite extends DropTableSuiteBase with CommandSuiteBase + diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/MsckRepairTableSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/MsckRepairTableSuite.scala new file mode 100644 index 0000000000000..45dc9e0e00f63 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/MsckRepairTableSuite.scala @@ -0,0 +1,77 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v1 + +import java.io.File + +import org.apache.commons.io.FileUtils + +import org.apache.spark.sql.Row +import org.apache.spark.sql.execution.command + +/** + * This base suite contains unified tests for the `MSCK REPAIR TABLE` command that + * check V1 table catalogs. The tests that cannot run for all V1 catalogs are located in more + * specific test suites: + * + * - V1 In-Memory catalog: + * `org.apache.spark.sql.execution.command.v1.MsckRepairTableSuite` + * - V1 Hive External catalog: + * `org.apache.spark.sql.hive.execution.command.MsckRepairTableSuite` + */ +trait MsckRepairTableSuiteBase extends command.MsckRepairTableSuiteBase { + def deletePartitionDir(tableName: String, part: String): Unit = { + val partLoc = getPartitionLocation(tableName, part) + FileUtils.deleteDirectory(new File(partLoc)) + } + + test("drop partitions") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (col INT, part INT) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1") + + checkAnswer(spark.table(t), Seq(Row(0, 0), Row(1, 1))) + deletePartitionDir(t, "part=1") + sql(s"MSCK REPAIR TABLE $t DROP PARTITIONS") + checkPartitions(t, Map("part" -> "0")) + checkAnswer(spark.table(t), Seq(Row(0, 0))) + } + } + + test("sync partitions") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (col INT, part INT) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1") + + checkAnswer(sql(s"SELECT col, part FROM $t"), Seq(Row(0, 0), Row(1, 1))) + copyPartition(t, "part=0", "part=2") + deletePartitionDir(t, "part=0") + sql(s"MSCK REPAIR TABLE $t SYNC PARTITIONS") + checkPartitions(t, Map("part" -> "1"), Map("part" -> "2")) + checkAnswer(sql(s"SELECT col, part FROM $t"), Seq(Row(1, 1), Row(0, 2))) + } + } +} + +/** + * The class contains tests for the `MSCK REPAIR TABLE` command to check + * V1 In-Memory table catalog. + */ +class MsckRepairTableSuite extends MsckRepairTableSuiteBase with CommandSuiteBase diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowNamespacesSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowNamespacesSuite.scala new file mode 100644 index 0000000000000..52742a2f2332e --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowNamespacesSuite.scala @@ -0,0 +1,66 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v1 + +import org.apache.spark.sql.AnalysisException +import org.apache.spark.sql.execution.command +import org.apache.spark.sql.internal.SQLConf + +/** + * This base suite contains unified tests for the `SHOW NAMESPACES` and `SHOW DATABASES` commands + * that check V1 table catalogs. The tests that cannot run for all V1 catalogs are located in more + * specific test suites: + * + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.ShowNamespacesSuite` + * - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.ShowNamespacesSuite` + */ +trait ShowNamespacesSuiteBase extends command.ShowNamespacesSuiteBase { + override protected def builtinTopNamespaces: Seq[String] = Seq("default") + + test("IN namespace doesn't exist") { + val errMsg = intercept[AnalysisException] { + sql("SHOW NAMESPACES in dummy") + }.getMessage + assert(errMsg.contains("Namespace 'dummy' not found")) + } + + test("SPARK-34359: keep the legacy output schema") { + withSQLConf(SQLConf.LEGACY_KEEP_COMMAND_OUTPUT_SCHEMA.key -> "true") { + assert(sql("SHOW NAMESPACES").schema.fieldNames.toSeq == Seq("databaseName")) + } + } +} + +class ShowNamespacesSuite extends ShowNamespacesSuiteBase with CommandSuiteBase { + test("case sensitivity") { + Seq(true, false).foreach { caseSensitive => + withSQLConf(SQLConf.CASE_SENSITIVE.key -> caseSensitive.toString) { + withNamespace(s"$catalog.AAA", s"$catalog.bbb") { + sql(s"CREATE NAMESPACE $catalog.AAA") + sql(s"CREATE NAMESPACE $catalog.bbb") + val expected = if (caseSensitive) "AAA" else "aaa" + runShowNamespacesSql( + s"SHOW NAMESPACES IN $catalog", + Seq(expected, "bbb") ++ builtinTopNamespaces) + runShowNamespacesSql(s"SHOW NAMESPACES IN $catalog LIKE 'AAA'", Seq(expected)) + runShowNamespacesSql(s"SHOW NAMESPACES IN $catalog LIKE 'aaa'", Seq(expected)) + } + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowPartitionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowPartitionsSuite.scala new file mode 100644 index 0000000000000..a26e29706e147 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowPartitionsSuite.scala @@ -0,0 +1,129 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v1 + +import org.apache.spark.sql.{AnalysisException, Row, SaveMode} +import org.apache.spark.sql.execution.command + +/** + * This base suite contains unified tests for the `SHOW PARTITIONS` command that check V1 + * table catalogs. The tests that cannot run for all V1 catalogs are located in more + * specific test suites: + * + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.ShowPartitionsSuite` + * - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.ShowPartitionsSuite` + */ +trait ShowPartitionsSuiteBase extends command.ShowPartitionsSuiteBase { + test("show everything in the default database") { + val table = "dateTable" + withTable(table) { + createDateTable(table) + runShowPartitionsSql( + s"show partitions default.$table", + Row("year=2015/month=1") :: + Row("year=2015/month=2") :: + Row("year=2016/month=2") :: + Row("year=2016/month=3") :: Nil) + } + } + + // The test fails for V2 Table Catalogs with the exception: + // org.apache.spark.sql.AnalysisException: CREATE VIEW is only supported with v1 tables. + test("show partitions of a view") { + val table = "dateTable" + withTable(table) { + createDateTable(table) + val view = "view1" + withView(view) { + sql(s"CREATE VIEW $view as select * from $table") + val errMsg = intercept[AnalysisException] { + sql(s"SHOW PARTITIONS $view") + }.getMessage + assert(errMsg.contains("'SHOW PARTITIONS' expects a table")) + } + } + } + + test("show partitions of a temporary view") { + val viewName = "test_view" + withTempView(viewName) { + spark.range(10).createTempView(viewName) + val errMsg = intercept[AnalysisException] { + sql(s"SHOW PARTITIONS $viewName") + }.getMessage + assert(errMsg.contains("'SHOW PARTITIONS' expects a table")) + } + } + + test("SPARK-33591: null as a partition value") { + val t = "part_table" + withTable(t) { + sql(s"CREATE TABLE $t (col1 INT, p1 STRING) $defaultUsing PARTITIONED BY (p1)") + sql(s"INSERT INTO TABLE $t PARTITION (p1 = null) SELECT 0") + checkAnswer(sql(s"SHOW PARTITIONS $t"), Row("p1=__HIVE_DEFAULT_PARTITION__")) + checkAnswer( + sql(s"SHOW PARTITIONS $t PARTITION (p1 = null)"), + Row("p1=__HIVE_DEFAULT_PARTITION__")) + } + } +} + +/** + * The class contains tests for the `SHOW PARTITIONS` command to check V1 In-Memory table catalog. + */ +class ShowPartitionsSuite extends ShowPartitionsSuiteBase with CommandSuiteBase { + // The test is placed here because it fails with `USING HIVE`: + // org.apache.spark.sql.AnalysisException: + // Hive data source can only be used with tables, you can't use it with CREATE TEMP VIEW USING + test("issue exceptions on the temporary view") { + val viewName = "test_view" + withTempView(viewName) { + sql(s""" + |CREATE TEMPORARY VIEW $viewName (c1 INT, c2 STRING) + |$defaultUsing""".stripMargin) + val errMsg = intercept[AnalysisException] { + sql(s"SHOW PARTITIONS $viewName") + }.getMessage + assert(errMsg.contains("'SHOW PARTITIONS' expects a table")) + } + } + + test("show partitions from a datasource") { + import testImplicits._ + withTable("part_datasrc") { + val df = (1 to 3).map(i => (i, s"val_$i", i * 2)).toDF("a", "b", "c") + df.write + .partitionBy("a") + .format("parquet") + .mode(SaveMode.Overwrite) + .saveAsTable("part_datasrc") + + assert(sql("SHOW PARTITIONS part_datasrc").count() == 3) + } + } + + test("SPARK-33904: null and empty string as partition values") { + withNamespaceAndTable("ns", "tbl") { t => + createNullPartTable(t, "parquet") + runShowPartitionsSql( + s"SHOW PARTITIONS $t", + Row("part=__HIVE_DEFAULT_PARTITION__") :: Nil) + checkAnswer(spark.table(t), Row(0, null) :: Row(1, null) :: Nil) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala new file mode 100644 index 0000000000000..4efb7c85e5066 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/ShowTablesSuite.scala @@ -0,0 +1,149 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v1 + +import org.apache.spark.sql.{AnalysisException, Row, SaveMode} +import org.apache.spark.sql.execution.command +import org.apache.spark.sql.internal.SQLConf + +/** + * This base suite contains unified tests for the `SHOW TABLES` command that check V1 + * table catalogs. The tests that cannot run for all V1 catalogs are located in more + * specific test suites: + * + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.ShowTablesSuite` + * - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.ShowTablesSuite` + */ +trait ShowTablesSuiteBase extends command.ShowTablesSuiteBase { + override def defaultNamespace: Seq[String] = Seq("default") + + private def withSourceViews(f: => Unit): Unit = { + withTable("source", "source2") { + val df = spark.createDataFrame(Seq((1L, "a"), (2L, "b"), (3L, "c"))).toDF("id", "data") + df.createOrReplaceTempView("source") + val df2 = spark.createDataFrame(Seq((4L, "d"), (5L, "e"), (6L, "f"))).toDF("id", "data") + df2.createOrReplaceTempView("source2") + f + } + } + + // `SHOW TABLES` from v2 catalog returns empty result. + test("v1 SHOW TABLES list the temp views") { + withSourceViews { + runShowTablesSql( + "SHOW TABLES FROM default", + Seq(Row("", "source", true), Row("", "source2", true))) + } + } + + test("only support single-level namespace") { + val errMsg = intercept[AnalysisException] { + runShowTablesSql("SHOW TABLES FROM a.b", Seq()) + }.getMessage + assert(errMsg.contains("Nested databases are not supported by v1 session catalog: a.b")) + } + + test("SHOW TABLE EXTENDED from default") { + withSourceViews { + val expected = Seq(Row("", "source", true), Row("", "source2", true)) + + val df = sql("SHOW TABLE EXTENDED FROM default LIKE '*source*'") + val result = df.collect() + val resultWithoutInfo = result.map { case Row(db, table, temp, _) => Row(db, table, temp) } + + assert(resultWithoutInfo === expected) + result.foreach { case Row(_, _, _, info: String) => assert(info.nonEmpty) } + } + } + + test("case sensitivity of partition spec") { + withNamespaceAndTable("ns", "part_table") { t => + sql(s""" + |CREATE TABLE $t (price int, qty int, year int, month int) + |$defaultUsing + |partitioned by (year, month)""".stripMargin) + sql(s"INSERT INTO $t PARTITION(year = 2015, month = 1) SELECT 1, 1") + Seq( + true -> "PARTITION(year = 2015, month = 1)", + false -> "PARTITION(YEAR = 2015, Month = 1)" + ).foreach { case (caseSensitive, partitionSpec) => + withSQLConf(SQLConf.CASE_SENSITIVE.key -> caseSensitive.toString) { + val df = sql(s"SHOW TABLE EXTENDED LIKE 'part_table' $partitionSpec") + val information = df.select("information").first().getString(0) + assert(information.contains("Partition Values: [year=2015, month=1]")) + } + } + } + } + + test("no database specified") { + Seq( + s"SHOW TABLES IN $catalog", + s"SHOW TABLE EXTENDED IN $catalog LIKE '*tbl'").foreach { showTableCmd => + val errMsg = intercept[AnalysisException] { + sql(showTableCmd) + }.getMessage + assert(errMsg.contains("Database from v1 session catalog is not specified")) + } + } + + test("SPARK-34157: Unify output of SHOW TABLES and pass output attributes properly") { + withNamespace(s"$catalog.ns") { + sql(s"CREATE NAMESPACE $catalog.ns") + sql(s"USE $catalog.ns") + withTable("tbl") { + sql("CREATE TABLE tbl(col1 int, col2 string) USING parquet") + checkAnswer(sql("show tables"), Row("ns", "tbl", false)) + assert(sql("show tables").schema.fieldNames === + Seq("namespace", "tableName", "isTemporary")) + assert(sql("show table extended like 'tbl'").collect()(0).length == 4) + assert(sql("show table extended like 'tbl'").schema.fieldNames === + Seq("namespace", "tableName", "isTemporary", "information")) + + // Keep the legacy output schema + withSQLConf(SQLConf.LEGACY_KEEP_COMMAND_OUTPUT_SCHEMA.key -> "true") { + checkAnswer(sql("show tables"), Row("ns", "tbl", false)) + assert(sql("show tables").schema.fieldNames === + Seq("database", "tableName", "isTemporary")) + assert(sql("show table extended like 'tbl'").collect()(0).length == 4) + assert(sql("show table extended like 'tbl'").schema.fieldNames === + Seq("database", "tableName", "isTemporary", "information")) + } + } + } + } +} + +/** + * The class contains tests for the `SHOW TABLES` command to check V1 In-Memory table catalog. + */ +class ShowTablesSuite extends ShowTablesSuiteBase with CommandSuiteBase { + test("SPARK-33670: show partitions from a datasource table") { + import testImplicits._ + withNamespace(s"$catalog.ns") { + sql(s"CREATE NAMESPACE $catalog.ns") + sql(s"USE $catalog.ns") + val t = "part_datasrc" + withTable(t) { + val df = (1 to 3).map(i => (i, s"val_$i", i * 2)).toDF("a", "b", "c") + df.write.partitionBy("a").format("parquet").mode(SaveMode.Overwrite).saveAsTable(t) + assert(sql(s"SHOW TABLE EXTENDED LIKE '$t' PARTITION(a = 1)").count() === 1) + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/TruncateTableSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/TruncateTableSuite.scala new file mode 100644 index 0000000000000..7da03db6f7371 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v1/TruncateTableSuite.scala @@ -0,0 +1,205 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v1 + +import java.io.File + +import org.apache.hadoop.fs.Path +import org.apache.hadoop.fs.permission.{AclEntry, AclEntryScope, AclEntryType, FsAction, FsPermission} + +import org.apache.spark.sql.{AnalysisException, Row} +import org.apache.spark.sql.catalyst.{QualifiedTableName, TableIdentifier} +import org.apache.spark.sql.execution.command +import org.apache.spark.sql.execution.command.FakeLocalFsFileSystem +import org.apache.spark.sql.internal.SQLConf + +/** + * This base suite contains unified tests for the `TRUNCATE TABLE` command that check V1 + * table catalogs. The tests that cannot run for all V1 catalogs are located in more + * specific test suites: + * + * - V1 In-Memory catalog: `org.apache.spark.sql.execution.command.v1.TruncateTableSuite` + * - V1 Hive External catalog: `org.apache.spark.sql.hive.execution.command.TruncateTableSuite` + */ +trait TruncateTableSuiteBase extends command.TruncateTableSuiteBase { + + override val invalidPartColumnError = + "TRUNCATE TABLE ... PARTITION is not supported for tables that are not partitioned" + + test("SPARK-30312: truncate table - keep acl/permission") { + Seq(true, false).foreach { ignore => + withSQLConf( + "fs.file.impl" -> classOf[FakeLocalFsFileSystem].getName, + "fs.file.impl.disable.cache" -> "true", + SQLConf.TRUNCATE_TABLE_IGNORE_PERMISSION_ACL.key -> ignore.toString) { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (col INT) $defaultUsing") + sql(s"INSERT INTO $t SELECT 1") + checkAnswer(spark.table(t), Row(1)) + + val tablePath = new Path(spark.sessionState.catalog + .getTableMetadata(TableIdentifier("tbl", Some("ns"))) + .storage.locationUri.get) + + val hadoopConf = spark.sessionState.newHadoopConf() + val fs = tablePath.getFileSystem(hadoopConf) + val fileStatus = fs.getFileStatus(tablePath); + + fs.setPermission(tablePath, new FsPermission("777")) + assert(fileStatus.getPermission().toString() == "rwxrwxrwx") + + // Set ACL to table path. + val customAcl = new java.util.ArrayList[AclEntry]() + customAcl.add(new AclEntry.Builder() + .setName("test") + .setType(AclEntryType.USER) + .setScope(AclEntryScope.ACCESS) + .setPermission(FsAction.READ).build()) + fs.setAcl(tablePath, customAcl) + assert(fs.getAclStatus(tablePath).getEntries().get(0) == customAcl.get(0)) + + sql(s"TRUNCATE TABLE $t") + assert(spark.table(t).collect().isEmpty) + + val fileStatus2 = fs.getFileStatus(tablePath) + if (ignore) { + assert(fileStatus2.getPermission().toString() != "rwxrwxrwx") + } else { + assert(fileStatus2.getPermission().toString() == "rwxrwxrwx") + } + val aclEntries = fs.getAclStatus(tablePath).getEntries() + if (ignore) { + assert(aclEntries.size() == 0) + } else { + assert(aclEntries.size() == 4) + assert(aclEntries.get(0) == customAcl.get(0)) + + // Setting ACLs will also set user/group/other permissions + // as ACL entries. + val user = new AclEntry.Builder() + .setType(AclEntryType.USER) + .setScope(AclEntryScope.ACCESS) + .setPermission(FsAction.ALL).build() + val group = new AclEntry.Builder() + .setType(AclEntryType.GROUP) + .setScope(AclEntryScope.ACCESS) + .setPermission(FsAction.ALL).build() + val other = new AclEntry.Builder() + .setType(AclEntryType.OTHER) + .setScope(AclEntryScope.ACCESS) + .setPermission(FsAction.ALL).build() + assert(aclEntries.get(1) == user) + assert(aclEntries.get(2) == group) + assert(aclEntries.get(3) == other) + } + } + } + } + } + + test("SPARK-31163: acl/permission should handle non-existed path when truncating table") { + withSQLConf(SQLConf.TRUNCATE_TABLE_IGNORE_PERMISSION_ACL.key -> "false") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (col1 STRING, col2 INT) $defaultUsing PARTITIONED BY (col2)") + sql(s"INSERT INTO $t PARTITION (col2 = 1) SELECT 'one'") + checkAnswer(spark.table(t), Row("one", 1)) + val part = spark.sessionState.catalog + .listPartitions(TableIdentifier("tbl", Some("ns"))) + .head + val path = new File(part.location.getPath) + sql(s"TRUNCATE TABLE $t") + // simulate incomplete/unsuccessful truncate + assert(path.exists()) + path.delete() + assert(!path.exists()) + // execute without java.io.FileNotFoundException + sql(s"TRUNCATE TABLE $t") + // partition path should be re-created + assert(path.exists()) + } + } + } + + test("invalidation of tableRelationCache after table truncation") { + Seq(false, true).foreach { autoUpdate => + withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> autoUpdate.toString) { + withNamespaceAndTable("ns", "tbl") { t => + spark.range(100).write.saveAsTable(t) + sql(s"ANALYZE TABLE $t COMPUTE STATISTICS") + spark.table(t) + sql(s"TRUNCATE TABLE $t") + spark.table(t) + + val catalog = spark.sessionState.catalog + val qualifiedTableName = QualifiedTableName("ns", "tbl") + val cachedPlan = catalog.getCachedTable(qualifiedTableName) + assert(cachedPlan.stats.sizeInBytes == 0) + } + } + } + } + + test("change stats after truncate command") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id INT, value INT) $defaultUsing") + sql(s"INSERT INTO $t SELECT 0, 100") + // analyze to get initial stats + sql(s"ANALYZE TABLE $t COMPUTE STATISTICS FOR COLUMNS id, value") + assert(getTableSize(t) > 0) + + withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> "true") { + sql(s"TRUNCATE TABLE $t") + assert(getTableSize(t) == 0) + } + } + } + + test("SPARK-34251: stats in truncated non-empty table") { + withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> "true") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (c0 int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1") + val sizeOfTwoParts = getTableSize(t) + assert(sizeOfTwoParts > 0) + sql(s"TRUNCATE TABLE $t PARTITION (part=1)") + val sizeOfOnePart = getTableSize(t) + assert(0 < sizeOfOnePart && sizeOfOnePart < sizeOfTwoParts) + } + } + } +} + +/** + * The class contains tests for the `TRUNCATE TABLE` command to check V1 In-Memory table catalog. + */ +class TruncateTableSuite extends TruncateTableSuiteBase with CommandSuiteBase { + test("truncation of external tables is not allowed") { + import testImplicits._ + withTempPath { tempDir => + withNamespaceAndTable("ns", "tbl") { t => + (("a", "b") :: Nil).toDF().write.parquet(tempDir.getCanonicalPath) + sql(s"CREATE TABLE $t $defaultUsing LOCATION '${tempDir.toURI}'") + val errMsg = intercept[AnalysisException] { + sql(s"TRUNCATE TABLE $t") + }.getMessage + assert(errMsg.contains("Operation not allowed: TRUNCATE TABLE on external tables")) + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableAddPartitionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableAddPartitionSuite.scala new file mode 100644 index 0000000000000..fabe399c340ae --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableAddPartitionSuite.scala @@ -0,0 +1,102 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.sql.{AnalysisException, Row} +import org.apache.spark.sql.execution.command + +/** + * The class contains tests for the `ALTER TABLE .. ADD PARTITION` command + * to check V2 table catalogs. + */ +class AlterTableAddPartitionSuite + extends command.AlterTableAddPartitionSuiteBase + with CommandSuiteBase { + test("SPARK-33650: add partition into a table which doesn't support partition management") { + withNamespaceAndTable("ns", "tbl", s"non_part_$catalog") { t => + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing") + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $t ADD PARTITION (id=1)") + }.getMessage + assert(errMsg.contains(s"Table $t does not support partition management")) + } + } + + test("empty string as partition value") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (col1 INT, p1 STRING) $defaultUsing PARTITIONED BY (p1)") + sql(s"ALTER TABLE $t ADD PARTITION (p1 = '')") + checkPartitions(t, Map("p1" -> "")) + } + } + + test("SPARK-34143: add a partition to fully partitioned table") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (p0 INT, p1 STRING) $defaultUsing PARTITIONED BY (p0, p1)") + sql(s"ALTER TABLE $t ADD PARTITION (p0 = 0, p1 = 'abc')") + checkPartitions(t, Map("p0" -> "0", "p1" -> "abc")) + checkAnswer(sql(s"SELECT * FROM $t"), Row(0, "abc")) + } + } + + test("SPARK-34149: refresh cache in partition adding") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (part int) $defaultUsing PARTITIONED BY (part)") + sql(s"ALTER TABLE $t ADD PARTITION (part=0)") + assert(!spark.catalog.isCached(t)) + sql(s"CACHE TABLE $t") + assert(spark.catalog.isCached(t)) + checkAnswer(sql(s"SELECT * FROM $t"), Row(0)) + + sql(s"ALTER TABLE $t ADD PARTITION (part=1)") + assert(spark.catalog.isCached(t)) + checkAnswer(sql(s"SELECT * FROM $t"), Seq(Row(0), Row(1))) + } + } + + test("SPARK-34099, SPARK-34161: keep dependents cached after table altering") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (id, part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + cacheRelation(t) + checkCachedRelation(t, Seq(Row(0, 0))) + + withView("v0") { + sql(s"CREATE VIEW v0 AS SELECT * FROM $t") + cacheRelation("v0") + sql(s"ALTER TABLE $t ADD PARTITION (id=0, part=1)") + checkCachedRelation("v0", Seq(Row(0, 0), Row(0, 1))) + } + + withTempView("v1") { + sql(s"CREATE TEMP VIEW v1 AS SELECT * FROM $t") + cacheRelation("v1") + sql(s"ALTER TABLE $t ADD PARTITION (id=1, part=2)") + checkCachedRelation("v1", Seq(Row(0, 0), Row(0, 1), Row(1, 2))) + } + + val v2 = s"${spark.sharedState.globalTempViewManager.database}.v2" + withGlobalTempView(v2) { + sql(s"CREATE GLOBAL TEMP VIEW v2 AS SELECT * FROM $t") + cacheRelation(v2) + sql(s"ALTER TABLE $t ADD PARTITION (id=2, part=3)") + checkCachedRelation(v2, Seq(Row(0, 0), Row(0, 1), Row(1, 2), Row(2, 3))) + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableDropPartitionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableDropPartitionSuite.scala new file mode 100644 index 0000000000000..b03c8fb17f542 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableDropPartitionSuite.scala @@ -0,0 +1,66 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.sql.AnalysisException +import org.apache.spark.sql.execution.command + +/** + * The class contains tests for the `ALTER TABLE .. DROP PARTITION` command + * to check V2 table catalogs. + */ +class AlterTableDropPartitionSuite + extends command.AlterTableDropPartitionSuiteBase + with CommandSuiteBase { + override protected val notFullPartitionSpecErr = "Partition spec is invalid" + override protected def nullPartitionValue: String = "null" + + test("SPARK-33650: drop partition into a table which doesn't support partition management") { + withNamespaceAndTable("ns", "tbl", s"non_part_$catalog") { t => + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing") + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $t DROP PARTITION (id=1)") + }.getMessage + assert(errMsg.contains(s"Table $t does not support partition management")) + } + } + + test("purge partition data") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing PARTITIONED BY (id)") + sql(s"ALTER TABLE $t ADD PARTITION (id=1)") + try { + val errMsg = intercept[UnsupportedOperationException] { + sql(s"ALTER TABLE $t DROP PARTITION (id=1) PURGE") + }.getMessage + assert(errMsg.contains("purge is not supported")) + } finally { + sql(s"ALTER TABLE $t DROP PARTITION (id=1)") + } + } + } + + test("empty string as partition value") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (col1 INT, p1 STRING) $defaultUsing PARTITIONED BY (p1)") + sql(s"ALTER TABLE $t ADD PARTITION (p1 = '')") + sql(s"ALTER TABLE $t DROP PARTITION (p1 = '')") + checkPartitions(t) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableRecoverPartitionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableRecoverPartitionsSuite.scala new file mode 100644 index 0000000000000..a44e346d0348c --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableRecoverPartitionsSuite.scala @@ -0,0 +1,40 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.sql.AnalysisException +import org.apache.spark.sql.execution.command + +/** + * The class contains tests for the `ALTER TABLE .. RECOVER PARTITIONS` command + * to check V2 table catalogs. + */ +class AlterTableRecoverPartitionsSuite + extends command.AlterTableRecoverPartitionsSuiteBase + with CommandSuiteBase { + + test("partition recovering of v2 tables is not supported") { + withNamespaceAndTable("ns", "tbl") { t => + spark.sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing") + val errMsg = intercept[AnalysisException] { + sql(s"ALTER TABLE $t RECOVER PARTITIONS") + }.getMessage + assert(errMsg.contains("ALTER TABLE ... RECOVER PARTITIONS is not supported for v2 tables")) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableRenamePartitionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableRenamePartitionSuite.scala new file mode 100644 index 0000000000000..bb06818da48b1 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableRenamePartitionSuite.scala @@ -0,0 +1,47 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.sql.Row +import org.apache.spark.sql.execution.command + +/** + * The class contains tests for the `ALTER TABLE .. RENAME PARTITION` command + * to check V2 table catalogs. + */ +class AlterTableRenamePartitionSuite + extends command.AlterTableRenamePartitionSuiteBase + with CommandSuiteBase { + + test("with location") { + withNamespaceAndTable("ns", "tbl") { t => + createSinglePartTable(t) + val loc = "location1" + sql(s"ALTER TABLE $t ADD PARTITION (id = 2) LOCATION '$loc'") + sql(s"INSERT INTO $t PARTITION (id = 2) SELECT 'def'") + checkPartitions(t, Map("id" -> "1"), Map("id" -> "2")) + checkLocation(t, Map("id" -> "2"), loc) + + sql(s"ALTER TABLE $t PARTITION (id = 2) RENAME TO PARTITION (id = 3)") + checkPartitions(t, Map("id" -> "1"), Map("id" -> "3")) + // `InMemoryPartitionTableCatalog` should keep the original location + checkLocation(t, Map("id" -> "3"), loc) + checkAnswer(sql(s"SELECT id, data FROM $t WHERE id = 3"), Row(3, "def")) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableRenameSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableRenameSuite.scala new file mode 100644 index 0000000000000..9e89c079dc982 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/AlterTableRenameSuite.scala @@ -0,0 +1,37 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.sql.execution.command + +/** + * The class contains tests for the `ALTER TABLE .. RENAME` command to check V2 table catalogs. + */ +class AlterTableRenameSuite extends command.AlterTableRenameSuiteBase with CommandSuiteBase { + test("destination namespace is different") { + withNamespaceAndTable("dst_ns", "dst_tbl") { dst => + withNamespace("src_ns") { + sql(s"CREATE NAMESPACE $catalog.src_ns") + val src = dst.replace("dst", "src") + sql(s"CREATE TABLE $src (c0 INT) $defaultUsing") + sql(s"ALTER TABLE $src RENAME TO dst_ns.dst_tbl") + checkTables("dst_ns", "dst_tbl") + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/CommandSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/CommandSuiteBase.scala new file mode 100644 index 0000000000000..bed04f4f2659b --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/CommandSuiteBase.scala @@ -0,0 +1,63 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.SparkConf +import org.apache.spark.sql.catalyst.analysis.ResolvePartitionSpec +import org.apache.spark.sql.catalyst.catalog.CatalogTypes.TablePartitionSpec +import org.apache.spark.sql.connector.catalog.{CatalogV2Implicits, Identifier, InMemoryPartitionTable, InMemoryPartitionTableCatalog, InMemoryTableCatalog} +import org.apache.spark.sql.test.SharedSparkSession + +/** + * The trait contains settings and utility functions. It can be mixed to the test suites for + * datasource v2 catalogs (in-memory test catalogs). This trait complements the trait + * `org.apache.spark.sql.execution.command.DDLCommandTestUtils` with common utility functions + * for all unified datasource V1 and V2 test suites. + */ +trait CommandSuiteBase extends SharedSparkSession { + def version: String = "V2" // The prefix is added to test names + def catalog: String = "test_catalog" // The default V2 catalog for testing + def defaultUsing: String = "USING _" // The clause is used in creating v2 tables under testing + + // V2 catalogs created and used especially for testing + override def sparkConf: SparkConf = super.sparkConf + .set(s"spark.sql.catalog.$catalog", classOf[InMemoryPartitionTableCatalog].getName) + .set(s"spark.sql.catalog.non_part_$catalog", classOf[InMemoryTableCatalog].getName) + + def checkLocation( + t: String, + spec: TablePartitionSpec, + expected: String): Unit = { + import CatalogV2Implicits._ + + val tablePath = t.split('.') + val catalogName = tablePath.head + val namespaceWithTable = tablePath.tail + val namespaces = namespaceWithTable.init + val tableName = namespaceWithTable.last + val catalogPlugin = spark.sessionState.catalogManager.catalog(catalogName) + val partTable = catalogPlugin.asTableCatalog + .loadTable(Identifier.of(namespaces, tableName)) + .asInstanceOf[InMemoryPartitionTable] + val ident = ResolvePartitionSpec.convertToPartIdent(spec, partTable.partitionSchema.fields) + val partMetadata = partTable.loadPartitionMetadata(ident) + + assert(partMetadata.containsKey("location")) + assert(partMetadata.get("location") === expected) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/DropTableSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/DropTableSuite.scala new file mode 100644 index 0000000000000..9c9b7d3049c7a --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/DropTableSuite.scala @@ -0,0 +1,55 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.sql.Row +import org.apache.spark.sql.connector.InMemoryTableSessionCatalog +import org.apache.spark.sql.execution.command +import org.apache.spark.sql.internal.SQLConf.V2_SESSION_CATALOG_IMPLEMENTATION + +/** + * The class contains tests for the `DROP TABLE` command to check V2 table catalogs. + */ +class DropTableSuite extends command.DropTableSuiteBase with CommandSuiteBase { + test("purge option") { + withNamespaceAndTable("ns", "tbl") { t => + createTable(t) + val errMsg = intercept[UnsupportedOperationException] { + sql(s"DROP TABLE $catalog.ns.tbl PURGE") + }.getMessage + // The default TableCatalog.purgeTable implementation throws an exception. + assert(errMsg.contains("Purge table is not supported")) + } + } + + test("table qualified with the session catalog name") { + withSQLConf( + V2_SESSION_CATALOG_IMPLEMENTATION.key -> classOf[InMemoryTableSessionCatalog].getName) { + + sql("CREATE TABLE tbl USING json AS SELECT 1 AS i") + checkAnswer( + sql("SHOW TABLES IN spark_catalog.default").select("tableName"), + Row("tbl")) + + sql("DROP TABLE spark_catalog.default.tbl") + checkAnswer( + sql("SHOW TABLES IN spark_catalog.default").select("tableName"), + Seq.empty) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/MsckRepairTableSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/MsckRepairTableSuite.scala new file mode 100644 index 0000000000000..d4b23e50786eb --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/MsckRepairTableSuite.scala @@ -0,0 +1,41 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.sql.AnalysisException +import org.apache.spark.sql.execution.command + +/** + * The class contains tests for the `MSCK REPAIR TABLE` command + * to check V2 table catalogs. + */ +class MsckRepairTableSuite + extends command.MsckRepairTableSuiteBase + with CommandSuiteBase { + + // TODO(SPARK-34397): Support v2 `MSCK REPAIR TABLE` + test("repairing of v2 tables is not supported") { + withNamespaceAndTable("ns", "tbl") { t => + spark.sql(s"CREATE TABLE $t (id bigint, data string) $defaultUsing") + val errMsg = intercept[AnalysisException] { + sql(s"MSCK REPAIR TABLE $t") + }.getMessage + assert(errMsg.contains("MSCK REPAIR TABLE is not supported for v2 tables")) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/ShowNamespacesSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/ShowNamespacesSuite.scala new file mode 100644 index 0000000000000..bafb6608c8e6c --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/ShowNamespacesSuite.scala @@ -0,0 +1,72 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.SparkConf +import org.apache.spark.sql.AnalysisException +import org.apache.spark.sql.connector.catalog.BasicInMemoryTableCatalog +import org.apache.spark.sql.execution.command +import org.apache.spark.sql.internal.SQLConf + +/** + * The class contains tests for the `SHOW NAMESPACES` command to check V2 table catalogs. + */ +class ShowNamespacesSuite extends command.ShowNamespacesSuiteBase with CommandSuiteBase { + override def sparkConf: SparkConf = super.sparkConf + .set("spark.sql.catalog.testcat_no_namespace", classOf[BasicInMemoryTableCatalog].getName) + + test("IN namespace doesn't exist") { + withSQLConf(SQLConf.DEFAULT_CATALOG.key -> catalog) { + runShowNamespacesSql("SHOW NAMESPACES in dummy", Seq.empty) + } + runShowNamespacesSql(s"SHOW NAMESPACES in $catalog.ns1", Seq.empty) + runShowNamespacesSql(s"SHOW NAMESPACES in $catalog.ns1.ns3", Seq.empty) + } + + test("default v2 catalog doesn't support namespace") { + withSQLConf(SQLConf.DEFAULT_CATALOG.key -> "testcat_no_namespace") { + val errMsg = intercept[AnalysisException] { + sql("SHOW NAMESPACES") + }.getMessage + assert(errMsg.contains("does not support namespaces")) + } + } + + test("v2 catalog doesn't support namespace") { + val errMsg = intercept[AnalysisException] { + sql("SHOW NAMESPACES in testcat_no_namespace") + }.getMessage + assert(errMsg.contains("does not support namespaces")) + } + + test("case sensitivity") { + Seq(true, false).foreach { caseSensitive => + withSQLConf(SQLConf.CASE_SENSITIVE.key -> caseSensitive.toString) { + withNamespace(s"$catalog.AAA", s"$catalog.bbb") { + sql(s"CREATE NAMESPACE $catalog.AAA") + sql(s"CREATE NAMESPACE $catalog.bbb") + runShowNamespacesSql( + s"SHOW NAMESPACES IN $catalog", + Seq("AAA", "bbb") ++ builtinTopNamespaces) + runShowNamespacesSql(s"SHOW NAMESPACES IN $catalog LIKE 'AAA'", Seq("AAA")) + runShowNamespacesSql(s"SHOW NAMESPACES IN $catalog LIKE 'aaa'", Seq("AAA")) + } + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/ShowPartitionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/ShowPartitionsSuite.scala new file mode 100644 index 0000000000000..8ae8171924c69 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/ShowPartitionsSuite.scala @@ -0,0 +1,47 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.sql.{AnalysisException, Row} +import org.apache.spark.sql.execution.command + +/** + * The class contains tests for the `SHOW PARTITIONS` command to check V2 table catalogs. + */ +class ShowPartitionsSuite extends command.ShowPartitionsSuiteBase with CommandSuiteBase { + test("a table does not support partitioning") { + val table = s"non_part_$catalog.tab1" + withTable(table) { + sql(s""" + |CREATE TABLE $table (price int, qty int, year int, month int) + |$defaultUsing""".stripMargin) + val errMsg = intercept[AnalysisException] { + sql(s"SHOW PARTITIONS $table") + }.getMessage + assert(errMsg.contains(s"Table $table does not support partition management")) + } + } + + test("SPARK-33889, SPARK-33904: null and empty string as partition values") { + withNamespaceAndTable("ns", "tbl") { t => + createNullPartTable(t, "parquet") + runShowPartitionsSql(s"SHOW PARTITIONS $t", Row("part=") :: Row("part=null") :: Nil) + checkAnswer(spark.table(t), Row(0, "") :: Row(1, null) :: Nil) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/ShowTablesSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/ShowTablesSuite.scala new file mode 100644 index 0000000000000..702c1744a68ef --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/ShowTablesSuite.scala @@ -0,0 +1,92 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.sql.{AnalysisException, Row} +import org.apache.spark.sql.execution.command + +/** + * The class contains tests for the `SHOW TABLES` command to check V2 table catalogs. + */ +class ShowTablesSuite extends command.ShowTablesSuiteBase with CommandSuiteBase { + override def defaultNamespace: Seq[String] = Nil + + // The test fails for V1 catalog with the error: + // org.apache.spark.sql.AnalysisException: + // The namespace in session catalog must have exactly one name part: spark_catalog.n1.n2.db + test("show tables in nested namespaces") { + withTable(s"$catalog.n1.n2.db") { + spark.sql(s"CREATE TABLE $catalog.n1.n2.db.table_name (id bigint, data string) $defaultUsing") + runShowTablesSql( + s"SHOW TABLES FROM $catalog.n1.n2.db", + Seq(Row("n1.n2.db", "table_name", false))) + } + } + + // The test fails for V1 catalog with the error: + // org.apache.spark.sql.AnalysisException: + // The namespace in session catalog must have exactly one name part: spark_catalog.table + test("using v2 catalog with empty namespace") { + withTable(s"$catalog.table") { + spark.sql(s"CREATE TABLE $catalog.table (id bigint, data string) $defaultUsing") + runShowTablesSql(s"SHOW TABLES FROM $catalog", Seq(Row("", "table", false))) + } + } + + // The test fails for V1 catalog with the error: + // org.apache.spark.sql.AnalysisException: + // The namespace in session catalog must have exactly one name part: spark_catalog.ns1.ns2.tbl + test("SHOW TABLE EXTENDED not valid v1 database") { + def testV1CommandNamespace(sqlCommand: String, namespace: String): Unit = { + val e = intercept[AnalysisException] { + sql(sqlCommand) + } + assert(e.message.contains(s"SHOW TABLE EXTENDED is not supported for v2 tables")) + } + + val namespace = s"$catalog.ns1.ns2" + val table = "tbl" + withTable(s"$namespace.$table") { + sql(s"CREATE TABLE $namespace.$table (id bigint, data string) " + + s"$defaultUsing PARTITIONED BY (id)") + + testV1CommandNamespace(s"SHOW TABLE EXTENDED FROM $namespace LIKE 'tb*'", + namespace) + testV1CommandNamespace(s"SHOW TABLE EXTENDED IN $namespace LIKE 'tb*'", + namespace) + testV1CommandNamespace("SHOW TABLE EXTENDED " + + s"FROM $namespace LIKE 'tb*' PARTITION(id=1)", + namespace) + testV1CommandNamespace("SHOW TABLE EXTENDED " + + s"IN $namespace LIKE 'tb*' PARTITION(id=1)", + namespace) + } + } + + // TODO(SPARK-33393): Support SHOW TABLE EXTENDED in DSv2 + test("SHOW TABLE EXTENDED: an existing table") { + val table = "people" + withTable(s"$catalog.$table") { + sql(s"CREATE TABLE $catalog.$table (name STRING, id INT) $defaultUsing") + val errMsg = intercept[AnalysisException] { + sql(s"SHOW TABLE EXTENDED FROM $catalog LIKE '*$table*'").collect() + }.getMessage + assert(errMsg.contains("SHOW TABLE EXTENDED is not supported for v2 tables")) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/TruncateTableSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/TruncateTableSuite.scala new file mode 100644 index 0000000000000..f125a72bd32a5 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/command/v2/TruncateTableSuite.scala @@ -0,0 +1,42 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.command.v2 + +import org.apache.spark.sql.AnalysisException +import org.apache.spark.sql.execution.command + +/** + * The class contains tests for the `TRUNCATE TABLE` command to check V2 table catalogs. + */ +class TruncateTableSuite extends command.TruncateTableSuiteBase with CommandSuiteBase { + + override val invalidPartColumnError = "not a valid partition column in table" + + test("truncate a partition of a table which does not support partitions") { + withNamespaceAndTable("ns", "tbl", s"non_part_$catalog") { t => + sql(s"CREATE TABLE $t (c0 INT) $defaultUsing") + sql(s"INSERT INTO $t SELECT 0") + + val errMsg = intercept[AnalysisException] { + sql(s"TRUNCATE TABLE $t PARTITION (c0=1)") + }.getMessage + assert(errMsg.contains( + "Table non_part_test_catalog.ns.tbl does not support partition management")) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/BasicWriteJobStatsTrackerMetricSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/BasicWriteJobStatsTrackerMetricSuite.scala new file mode 100644 index 0000000000000..3e58c225d8c7a --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/BasicWriteJobStatsTrackerMetricSuite.scala @@ -0,0 +1,59 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.datasources + +import org.apache.spark.SparkFunSuite +import org.apache.spark.sql.{LocalSparkSession, SparkSession} + +class BasicWriteJobStatsTrackerMetricSuite extends SparkFunSuite with LocalSparkSession { + + test("SPARK-32978: make sure the number of dynamic part metric is correct") { + try { + val partitions = "50" + spark = SparkSession.builder().master("local[4]").getOrCreate() + val statusStore = spark.sharedState.statusStore + + spark.sql("create table dynamic_partition(i bigint, part bigint) " + + "using parquet partitioned by (part)") + val oldExecutionsSize = statusStore.executionsList().size + spark.sql("insert overwrite table dynamic_partition partition(part) " + + s"select id, id % $partitions as part from range(10000)") + + // Wait for listener to finish computing the metrics for the executions. + while (statusStore.executionsList().size - oldExecutionsSize < 1 || + statusStore.executionsList().last.metricValues == null) { + Thread.sleep(100) + } + + // There should be 2 SQLExecutionUIData in executionsList and the 2nd item is we need, + // but the executionId is indeterminate in maven test, + // so the `statusStore.execution(executionId)` API is not used. + assert(statusStore.executionsCount() == 2) + val executionData = statusStore.executionsList()(1) + val accumulatorIdOpt = + executionData.metrics.find(_.name == "number of dynamic part").map(_.accumulatorId) + assert(accumulatorIdOpt.isDefined) + val numPartsOpt = executionData.metricValues.get(accumulatorIdOpt.get) + assert(numPartsOpt.isDefined && numPartsOpt.get == partitions) + + } finally { + spark.sql("drop table if exists dynamic_partition") + spark.stop() + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/BasicWriteTaskStatsTrackerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/BasicWriteTaskStatsTrackerSuite.scala index 32941d8d2cd11..0237679942714 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/BasicWriteTaskStatsTrackerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/BasicWriteTaskStatsTrackerSuite.scala @@ -17,12 +17,13 @@ package org.apache.spark.sql.execution.datasources -import java.nio.charset.Charset +import java.nio.charset.{Charset, StandardCharsets} import org.apache.hadoop.conf.Configuration -import org.apache.hadoop.fs.Path +import org.apache.hadoop.fs.{FileSystem, FilterFileSystem, Path} import org.apache.spark.SparkFunSuite +import org.apache.spark.sql.execution.datasources.BasicWriteJobStatsTracker.FILE_LENGTH_XATTR import org.apache.spark.util.Utils /** @@ -148,7 +149,7 @@ class BasicWriteTaskStatsTrackerSuite extends SparkFunSuite { test("Three files, last one empty") { val file1 = new Path(tempDirPath, "f-3-1") val file2 = new Path(tempDirPath, "f-3-2") - val file3 = new Path(tempDirPath, "f-3-2") + val file3 = new Path(tempDirPath, "f-3-3") val tracker = new BasicWriteTaskStatsTracker(conf) tracker.newFile(file1.toString) write1(file1) @@ -221,4 +222,127 @@ class BasicWriteTaskStatsTrackerSuite extends SparkFunSuite { write(file, data2) } + /** + * Does a length specified in the XAttr header get picked up? + */ + test("XAttr sourced length") { + val file = new Path(tempDirPath, "file") + touch(file) + val xattrFS = new FsWithFakeXAttrs(localfs) + val bigLong = 34359738368L + xattrFS.set(FILE_LENGTH_XATTR, s"$bigLong") + val tracker = new BasicWriteTaskStatsTracker(conf) + assert(Some(bigLong) === tracker.getFileSize(xattrFS, file), + "Size not collected from XAttr entry") + } + + /** + * If a file is non-empty then the XAttr size declaration + * is not used. + */ + test("XAttr sourced length only used for 0-byte-files") { + val file = new Path(tempDirPath, "file") + write2(file) + val xattrFS = new FsWithFakeXAttrs(localfs) + val bigLong = 34359738368L + xattrFS.set(FILE_LENGTH_XATTR, s"$bigLong") + val tracker = new BasicWriteTaskStatsTracker(conf) + assert(Some(len2) === tracker.getFileSize(xattrFS, file), + "Size not collected from XAttr entry") + } + + /** + * Any FS which supports XAttr must raise an FNFE if the + * file is missing. This verifies resilience on a path + * which the the local FS would not normally take. + */ + test("Missing File with XAttr") { + val missing = new Path(tempDirPath, "missing") + val xattrFS = new FsWithFakeXAttrs(localfs) + val tracker = new BasicWriteTaskStatsTracker(conf) + tracker.newFile(missing.toString) + assert(None === tracker.getFileSize(xattrFS, missing)) + } + + /** + * If there are any problems parsing/validating the + * header attribute, fall back to the file length. + */ + test("XAttr error recovery") { + val file = new Path(tempDirPath, "file") + touch(file) + val xattrFS = new FsWithFakeXAttrs(localfs) + + val tracker = new BasicWriteTaskStatsTracker(conf) + + // without a header + assert(Some(0) === tracker.getFileSize(xattrFS, file)) + + // will fail to parse as a long + xattrFS.set(FILE_LENGTH_XATTR, "Not-a-long") + assert(Some(0) === tracker.getFileSize(xattrFS, file)) + + // a negative value + xattrFS.set(FILE_LENGTH_XATTR, "-1") + assert(Some(0) === tracker.getFileSize(xattrFS, file)) + + // empty string + xattrFS.set(FILE_LENGTH_XATTR, "") + assert(Some(0) === tracker.getFileSize(xattrFS, file)) + + // then a zero byte array + xattrFS.setXAttr(file, FILE_LENGTH_XATTR, + new Array[Byte](0)) + assert(Some(0) === tracker.getFileSize(xattrFS, file)) + } + + /** + * Extend any FS with a mock get/setXAttr. + * A map of attributes is used, these are returned on a getXAttr(path, key) + * call to any path; the other XAttr list/get calls are not implemented. + */ + class FsWithFakeXAttrs(fs: FileSystem) extends FilterFileSystem(fs) { + + private val xattrs = scala.collection.mutable.Map[String, Array[Byte]]() + + /** + * Mock implementation of setAttr. + * + * @param path path (ignored) + * @param name attribute name. + * @param value byte array value + */ + override def setXAttr( + path: Path, + name: String, + value: Array[Byte]): Unit = { + + xattrs.put(name, value) + } + + /** + * Set an attribute to the UTF-8 byte value of a string. + * + * @param name attribute name. + * @param value string value + */ + def set(name: String, value: String): Unit = { + setXAttr(null, name, value.getBytes(StandardCharsets.UTF_8)) + } + + /** + * Get any attribute if it is found in the map, else null. + * @param path path (ignored) + * @param name attribute name. + * @return the byte[] value or null. + */ + override def getXAttr( + path: Path, + name: String): Array[Byte] = { + // force a check for the file and raise an FNFE if not found + getFileStatus(path) + + xattrs.getOrElse(name, null) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/CommonFileDataSourceSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/CommonFileDataSourceSuite.scala new file mode 100644 index 0000000000000..b7d0a7fc306ad --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/CommonFileDataSourceSuite.scala @@ -0,0 +1,62 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.datasources + +import org.scalatest.funsuite.AnyFunSuite + +import org.apache.spark.sql.{Dataset, Encoders, FakeFileSystemRequiringDSOption, SparkSession} +import org.apache.spark.sql.catalyst.plans.SQLHelper + +/** + * The trait contains tests for all file-based data sources. + * The tests that are not applicable to all file-based data sources should be placed to + * [[org.apache.spark.sql.FileBasedDataSourceSuite]]. + */ +trait CommonFileDataSourceSuite extends SQLHelper { self: AnyFunSuite => + + protected def spark: SparkSession + protected def dataSourceFormat: String + protected def inputDataset: Dataset[_] = spark.createDataset(Seq("abc"))(Encoders.STRING) + + test(s"Propagate Hadoop configs from $dataSourceFormat options to underlying file system") { + withSQLConf( + "fs.file.impl" -> classOf[FakeFileSystemRequiringDSOption].getName, + "fs.file.impl.disable.cache" -> "true") { + Seq(false, true).foreach { mergeSchema => + withTempPath { dir => + val path = dir.getAbsolutePath + val conf = Map("ds_option" -> "value", "mergeSchema" -> mergeSchema.toString) + inputDataset + .write + .options(conf) + .format(dataSourceFormat) + .save(path) + Seq(path, "file:" + path.stripPrefix("file:")).foreach { p => + val readback = spark + .read + .options(conf) + .format(dataSourceFormat) + .load(p) + // Checks that read doesn't throw the exception from `FakeFileSystemRequiringDSOption` + readback.write.mode("overwrite").format("noop").save() + } + } + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/CustomWriteTaskStatsTrackerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/CustomWriteTaskStatsTrackerSuite.scala new file mode 100644 index 0000000000000..82d873a2cd81b --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/CustomWriteTaskStatsTrackerSuite.scala @@ -0,0 +1,72 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.datasources + +import scala.collection.mutable + +import org.apache.spark.SparkFunSuite +import org.apache.spark.sql.catalyst.InternalRow + +class CustomWriteTaskStatsTrackerSuite extends SparkFunSuite { + + def checkFinalStats(tracker: CustomWriteTaskStatsTracker, result: Map[String, Int]): Unit = { + assert(tracker.getFinalStats().asInstanceOf[CustomWriteTaskStats].numRowsPerFile == result) + } + + test("sequential file writing") { + val tracker = new CustomWriteTaskStatsTracker + tracker.newFile("a") + tracker.newRow("a", null) + tracker.newRow("a", null) + tracker.newFile("b") + checkFinalStats(tracker, Map("a" -> 2, "b" -> 0)) + } + + test("random file writing") { + val tracker = new CustomWriteTaskStatsTracker + tracker.newFile("a") + tracker.newRow("a", null) + tracker.newFile("b") + tracker.newRow("a", null) + tracker.newRow("b", null) + checkFinalStats(tracker, Map("a" -> 2, "b" -> 1)) + } +} + +class CustomWriteTaskStatsTracker extends WriteTaskStatsTracker { + + val numRowsPerFile = mutable.Map.empty[String, Int] + + override def newPartition(partitionValues: InternalRow): Unit = {} + + override def newFile(filePath: String): Unit = { + numRowsPerFile.put(filePath, 0) + } + + override def closeFile(filePath: String): Unit = {} + + override def newRow(filePath: String, row: InternalRow): Unit = { + numRowsPerFile(filePath) += 1 + } + + override def getFinalStats(): WriteTaskStats = { + CustomWriteTaskStats(numRowsPerFile.toMap) + } +} + +case class CustomWriteTaskStats(numRowsPerFile: Map[String, Int]) extends WriteTaskStats diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/DataSourceSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/DataSourceSuite.scala index 1e3c660e09454..6ba3d2723412b 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/DataSourceSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/DataSourceSuite.scala @@ -19,11 +19,12 @@ package org.apache.spark.sql.execution.datasources import org.apache.hadoop.conf.Configuration import org.apache.hadoop.fs.{FileStatus, Path, RawLocalFileSystem} +import org.scalatest.PrivateMethodTester import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.test.SharedSparkSession -class DataSourceSuite extends SharedSparkSession { +class DataSourceSuite extends SharedSparkSession with PrivateMethodTester { import TestPaths._ test("test glob and non glob paths") { @@ -36,7 +37,8 @@ class DataSourceSuite extends SharedSparkSession { ), hadoopConf, checkEmptyGlobPath = true, - checkFilesExist = true + checkFilesExist = true, + enableGlobbing = true ) assert(resultPaths.toSet === allPathsInFs.toSet) @@ -50,7 +52,8 @@ class DataSourceSuite extends SharedSparkSession { ), hadoopConf, checkEmptyGlobPath = true, - checkFilesExist = true + checkFilesExist = true, + enableGlobbing = true ) assert( @@ -71,7 +74,8 @@ class DataSourceSuite extends SharedSparkSession { ), hadoopConf, checkEmptyGlobPath = true, - checkFilesExist = true + checkFilesExist = true, + enableGlobbing = true ) assert( @@ -91,7 +95,8 @@ class DataSourceSuite extends SharedSparkSession { ), hadoopConf, checkEmptyGlobPath = true, - checkFilesExist = false + checkFilesExist = false, + enableGlobbing = true ) assert( @@ -113,7 +118,8 @@ class DataSourceSuite extends SharedSparkSession { ), hadoopConf, checkEmptyGlobPath = true, - checkFilesExist = true + checkFilesExist = true, + enableGlobbing = true ) ) } @@ -128,10 +134,23 @@ class DataSourceSuite extends SharedSparkSession { ), hadoopConf, checkEmptyGlobPath = true, - checkFilesExist = true + checkFilesExist = true, + enableGlobbing = true ) ) } + + test("Data source options should be propagated in method checkAndGlobPathIfNecessary") { + val dataSourceOptions = Map("fs.defaultFS" -> "nonexistentFs://nonexistentFs") + val dataSource = DataSource(spark, "parquet", Seq("/path3"), options = dataSourceOptions) + val checkAndGlobPathIfNecessary = PrivateMethod[Seq[Path]]('checkAndGlobPathIfNecessary) + + val message = intercept[java.io.IOException] { + dataSource invokePrivate checkAndGlobPathIfNecessary(false, false) + }.getMessage + val expectMessage = "No FileSystem for scheme nonexistentFs" + assert(message.filterNot(Set(':', '"').contains) == expectMessage) + } } object TestPaths { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileBasedDataSourceTest.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileBasedDataSourceTest.scala index bdb161d59a33e..c2dc20b0099a3 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileBasedDataSourceTest.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileBasedDataSourceTest.scala @@ -22,8 +22,10 @@ import java.io.File import scala.reflect.ClassTag import scala.reflect.runtime.universe.TypeTag -import org.apache.spark.sql.{DataFrame, SaveMode} +import org.apache.spark.sql.{DataFrame, Row, SaveMode} +import org.apache.spark.sql.functions.struct import org.apache.spark.sql.test.SQLTestUtils +import org.apache.spark.sql.types.StructType /** * A helper trait that provides convenient facilities for file-based data source testing. @@ -103,4 +105,40 @@ private[sql] trait FileBasedDataSourceTest extends SQLTestUtils { df: DataFrame, path: File): Unit = { df.write.mode(SaveMode.Overwrite).format(dataSourceName).save(path.getCanonicalPath) } + + /** + * Takes single level `inputDF` dataframe to generate multi-level nested + * dataframes as new test data. It tests both non-nested and nested dataframes + * which are written and read back with specified datasource. + */ + protected def withNestedDataFrame(inputDF: DataFrame): Seq[(DataFrame, String, Any => Any)] = { + assert(inputDF.schema.fields.length == 1) + assert(!inputDF.schema.fields.head.dataType.isInstanceOf[StructType]) + val df = inputDF.toDF("temp") + Seq( + ( + df.withColumnRenamed("temp", "a"), + "a", // zero nesting + (x: Any) => x), + ( + df.withColumn("a", struct(df("temp") as "b")).drop("temp"), + "a.b", // one level nesting + (x: Any) => Row(x)), + ( + df.withColumn("a", struct(struct(df("temp") as "c") as "b")).drop("temp"), + "a.b.c", // two level nesting + (x: Any) => Row(Row(x)) + ), + ( + df.withColumnRenamed("temp", "a.b"), + "`a.b`", // zero nesting with column name containing `dots` + (x: Any) => x + ), + ( + df.withColumn("a.b", struct(df("temp") as "c.d") ).drop("temp"), + "`a.b`.`c.d`", // one level nesting with column names containing `dots` + (x: Any) => Row(x) + ) + ) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala index ce511842e6356..f492fc653653e 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileFormatWriterSuite.scala @@ -61,4 +61,17 @@ class FileFormatWriterSuite checkAnswer(spark.table("t2").sort("id"), Seq(Row(0, null), Row(1, null), Row(2, null))) } } + + test("SPARK-33904: save and insert into a table in a namespace of spark_catalog") { + val ns = "spark_catalog.ns" + withNamespace(ns) { + spark.sql(s"CREATE NAMESPACE $ns") + val t = s"$ns.tbl" + withTable(t) { + spark.range(1).write.saveAsTable(t) + Seq(100).toDF().write.insertInto(t) + checkAnswer(spark.table(t), Seq(Row(0), Row(100))) + } + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileIndexSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileIndexSuite.scala index ea15f1891b006..fcaf8df4f9a02 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileIndexSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileIndexSuite.scala @@ -21,6 +21,7 @@ import java.io.{File, FileNotFoundException} import java.net.URI import scala.collection.mutable +import scala.concurrent.duration._ import org.apache.hadoop.conf.Configuration import org.apache.hadoop.fs.{BlockLocation, FileStatus, LocatedFileStatus, Path, RawLocalFileSystem, RemoteIterator} @@ -33,7 +34,7 @@ import org.apache.spark.metrics.source.HiveCatalogMetrics import org.apache.spark.sql.SparkSession import org.apache.spark.sql.catalyst.util._ import org.apache.spark.sql.functions.col -import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.internal.{SQLConf, StaticSQLConf} import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types.{IntegerType, StringType, StructField, StructType} import org.apache.spark.util.KnownSizeEstimation @@ -296,17 +297,6 @@ class FileIndexSuite extends SharedSparkSession { } } - test("InMemoryFileIndex - file filtering") { - assert(!InMemoryFileIndex.shouldFilterOut("abcd")) - assert(InMemoryFileIndex.shouldFilterOut(".ab")) - assert(InMemoryFileIndex.shouldFilterOut("_cd")) - assert(!InMemoryFileIndex.shouldFilterOut("_metadata")) - assert(!InMemoryFileIndex.shouldFilterOut("_common_metadata")) - assert(InMemoryFileIndex.shouldFilterOut("_ab_metadata")) - assert(InMemoryFileIndex.shouldFilterOut("_cd_common_metadata")) - assert(InMemoryFileIndex.shouldFilterOut("a._COPYING_")) - } - test("SPARK-17613 - PartitioningAwareFileIndex: base path w/o '/' at end") { class MockCatalog( override val rootPaths: Seq[Path]) @@ -366,13 +356,15 @@ class FileIndexSuite extends SharedSparkSession { val wrongBasePath = new File(dir, "unknown") // basePath must be a directory wrongBasePath.mkdir() - val parameters = Map("basePath" -> wrongBasePath.getCanonicalPath) - val fileIndex = new InMemoryFileIndex(spark, Seq(path), parameters, None) - val msg = intercept[IllegalArgumentException] { - // trigger inferPartitioning() - fileIndex.partitionSpec() - }.getMessage - assert(msg === s"Wrong basePath ${wrongBasePath.getCanonicalPath} for the root path: $path") + withClue("SPARK-32368: 'basePath' can be case insensitive") { + val parameters = Map("bAsepAtH" -> wrongBasePath.getCanonicalPath) + val fileIndex = new InMemoryFileIndex(spark, Seq(path), parameters, None) + val msg = intercept[IllegalArgumentException] { + // trigger inferPartitioning() + fileIndex.partitionSpec() + }.getMessage + assert(msg === s"Wrong basePath ${wrongBasePath.getCanonicalPath} for the root path: $path") + } } } @@ -413,6 +405,21 @@ class FileIndexSuite extends SharedSparkSession { fileStatusCache.putLeafFiles(new Path("/tmp", "abc"), files.toArray) } + test("SPARK-34075: InMemoryFileIndex filters out hidden file on partition inference") { + withTempPath { path => + spark + .range(2) + .select(col("id").as("p"), col("id")) + .write + .partitionBy("p") + .parquet(path.getAbsolutePath) + val targetPath = new File(path, "p=1") + val hiddenPath = new File(path, "_hidden_path") + targetPath.renameTo(hiddenPath) + assert(spark.read.parquet(path.getAbsolutePath).count() == 1L) + } + } + test("SPARK-20367 - properly unescape column names in inferPartitioning") { withTempPath { path => val colToUnescape = "Column/#%'?" @@ -488,6 +495,31 @@ class FileIndexSuite extends SharedSparkSession { val fileIndex = new TestInMemoryFileIndex(spark, path) assert(fileIndex.leafFileStatuses.toSeq == statuses) } + + test("expire FileStatusCache if TTL is configured") { + val previousValue = SQLConf.get.getConf(StaticSQLConf.METADATA_CACHE_TTL_SECONDS) + try { + // using 'SQLConf.get.setConf' instead of 'withSQLConf' to set a static config at runtime + SQLConf.get.setConf(StaticSQLConf.METADATA_CACHE_TTL_SECONDS, 1L) + + val path = new Path("/dummy_tmp", "abc") + val files = (1 to 3).map(_ => new FileStatus()) + + FileStatusCache.resetForTesting() + val fileStatusCache = FileStatusCache.getOrCreate(spark) + fileStatusCache.putLeafFiles(path, files.toArray) + + // Exactly 3 files are cached. + assert(fileStatusCache.getLeafFiles(path).get.length === 3) + // Wait until the cache expiration. + eventually(timeout(3.seconds)) { + // And the cache is gone. + assert(fileStatusCache.getLeafFiles(path).isEmpty === true) + } + } finally { + SQLConf.get.setConf(StaticSQLConf.METADATA_CACHE_TTL_SECONDS, previousValue) + } + } } object DeletionRaceFileSystem { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategySuite.scala index 812305ba24403..50f32126e5dec 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/FileSourceStrategySuite.scala @@ -262,20 +262,22 @@ class FileSourceStrategySuite extends QueryTest with SharedSparkSession with Pre "p1=2/file7_0000" -> 1), buckets = 3) - // No partition pruning - checkScan(table) { partitions => - assert(partitions.size == 3) - assert(partitions(0).files.size == 5) - assert(partitions(1).files.size == 0) - assert(partitions(2).files.size == 2) - } + withSQLConf(SQLConf.AUTO_BUCKETED_SCAN_ENABLED.key -> "false") { + // No partition pruning + checkScan(table) { partitions => + assert(partitions.size == 3) + assert(partitions(0).files.size == 5) + assert(partitions(1).files.size == 0) + assert(partitions(2).files.size == 2) + } - // With partition pruning - checkScan(table.where("p1=2")) { partitions => - assert(partitions.size == 3) - assert(partitions(0).files.size == 3) - assert(partitions(1).files.size == 0) - assert(partitions(2).files.size == 1) + // With partition pruning + checkScan(table.where("p1=2")) { partitions => + assert(partitions.size == 3) + assert(partitions(0).files.size == 3) + assert(partitions(1).files.size == 0) + assert(partitions(2).files.size == 1) + } } } @@ -528,6 +530,76 @@ class FileSourceStrategySuite extends QueryTest with SharedSparkSession with Pre } } + test("SPARK-32019: Add spark.sql.files.minPartitionNum config") { + withSQLConf(SQLConf.FILES_MIN_PARTITION_NUM.key -> "1") { + val table = + createTable(files = Seq( + "file1" -> 1, + "file2" -> 1, + "file3" -> 1 + )) + assert(table.rdd.partitions.length == 1) + } + + withSQLConf(SQLConf.FILES_MIN_PARTITION_NUM.key -> "10") { + val table = + createTable(files = Seq( + "file1" -> 1, + "file2" -> 1, + "file3" -> 1 + )) + assert(table.rdd.partitions.length == 3) + } + + withSQLConf( + SQLConf.FILES_MAX_PARTITION_BYTES.key -> "2MB", + SQLConf.FILES_OPEN_COST_IN_BYTES.key -> String.valueOf(4 * 1024 * 1024)) { + + withSQLConf(SQLConf.FILES_MIN_PARTITION_NUM.key -> "8") { + val partitions = (1 to 12).map(i => s"file$i" -> 2 * 1024 * 1024) + val table = createTable(files = partitions) + // partition is limited by filesMaxPartitionBytes(2MB) + assert(table.rdd.partitions.length == 12) + } + + withSQLConf(SQLConf.FILES_MIN_PARTITION_NUM.key -> "16") { + val partitions = (1 to 12).map(i => s"file$i" -> 4 * 1024 * 1024) + val table = createTable(files = partitions) + assert(table.rdd.partitions.length == 24) + } + } + } + + test("SPARK-32352: Partially push down support data filter if it mixed in partition filters") { + val table = + createTable( + files = Seq( + "p1=1/file1" -> 10, + "p1=2/file2" -> 10, + "p1=3/file3" -> 10, + "p1=4/file4" -> 10)) + + checkScan(table.where("(c1 = 1) OR (c1 = 2)")) { partitions => + assert(partitions.size == 1, "when checking partitions") + } + checkDataFilters(Set(Or(EqualTo("c1", 1), EqualTo("c1", 2)))) + + checkScan(table.where("(p1 = 1 AND c1 = 1) OR (p1 = 2 and c1 = 2)")) { partitions => + assert(partitions.size == 1, "when checking partitions") + } + checkDataFilters(Set(Or(EqualTo("c1", 1), EqualTo("c1", 2)))) + + checkScan(table.where("(p1 = '1' AND c1 = 2) OR (c1 = 1 OR p1 = '2')")) { partitions => + assert(partitions.size == 1, "when checking partitions") + } + checkDataFilters(Set.empty) + + checkScan(table.where("p1 = '1' OR (p1 = '2' AND c1 = 1)")) { partitions => + assert(partitions.size == 1, "when checking partitions") + } + checkDataFilters(Set.empty) + } + // Helpers for checking the arguments passed to the FileFormat. protected val checkPartitionSchema = diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/HadoopFileLinesReaderSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/HadoopFileLinesReaderSuite.scala index 3c83388461ce1..771ddbd6523bc 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/HadoopFileLinesReaderSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/HadoopFileLinesReaderSuite.scala @@ -36,13 +36,13 @@ class HadoopFileLinesReaderSuite extends SharedSparkSession { val delimOpt = delimiter.map(_.getBytes(StandardCharsets.UTF_8)) Files.write(path.toPath, text.getBytes(StandardCharsets.UTF_8)) - val lines = ranges.map { case (start, length) => + val lines = ranges.flatMap { case (start, length) => val file = PartitionedFile(InternalRow.empty, path.getCanonicalPath, start, length) val hadoopConf = conf.getOrElse(spark.sessionState.newHadoopConf()) val reader = new HadoopFileLinesReader(file, delimOpt, hadoopConf) reader.map(_.toString) - }.flatten + } lines } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/PathFilterStrategySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/PathFilterStrategySuite.scala new file mode 100644 index 0000000000000..b965a78c9eec0 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/PathFilterStrategySuite.scala @@ -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. + */ + +package org.apache.spark.sql.execution.datasources + +import org.apache.spark.sql.QueryTest +import org.apache.spark.sql.catalyst.util.CaseInsensitiveMap +import org.apache.spark.sql.test.SharedSparkSession + +class PathFilterStrategySuite extends QueryTest with SharedSparkSession { + + test("SPARK-31962: PathFilterStrategies - modifiedAfter option") { + val options = + CaseInsensitiveMap[String](Map("modifiedAfter" -> "2010-10-01T01:01:00")) + val strategy = PathFilterFactory.create(options) + assert(strategy.head.isInstanceOf[ModifiedAfterFilter]) + assert(strategy.size == 1) + } + + test("SPARK-31962: PathFilterStrategies - modifiedBefore option") { + val options = + CaseInsensitiveMap[String](Map("modifiedBefore" -> "2020-10-01T01:01:00")) + val strategy = PathFilterFactory.create(options) + assert(strategy.head.isInstanceOf[ModifiedBeforeFilter]) + assert(strategy.size == 1) + } + + test("SPARK-31962: PathFilterStrategies - pathGlobFilter option") { + val options = CaseInsensitiveMap[String](Map("pathGlobFilter" -> "*.txt")) + val strategy = PathFilterFactory.create(options) + assert(strategy.head.isInstanceOf[PathGlobFilter]) + assert(strategy.size == 1) + } + + test("SPARK-31962: PathFilterStrategies - no options") { + val options = CaseInsensitiveMap[String](Map.empty) + val strategy = PathFilterFactory.create(options) + assert(strategy.isEmpty) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/PathFilterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/PathFilterSuite.scala new file mode 100644 index 0000000000000..1af2adfd8640c --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/PathFilterSuite.scala @@ -0,0 +1,307 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.datasources + +import java.io.File +import java.time.{LocalDateTime, ZoneId, ZoneOffset} +import java.time.format.DateTimeFormatter + +import scala.util.Random + +import org.apache.spark.sql.{AnalysisException, QueryTest, Row} +import org.apache.spark.sql.catalyst.util.{stringToFile, DateTimeUtils} +import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types.{StringType, StructField, StructType} + +class PathFilterSuite extends QueryTest with SharedSparkSession { + import testImplicits._ + + test("SPARK-31962: modifiedBefore specified" + + " and sharing same timestamp with file last modified time.") { + withTempDir { dir => + val curTime = LocalDateTime.now(ZoneOffset.UTC) + executeTest(dir, Seq(curTime), 0, modifiedBefore = Some(formatTime(curTime))) + } + } + + test("SPARK-31962: modifiedAfter specified" + + " and sharing same timestamp with file last modified time.") { + withTempDir { dir => + val curTime = LocalDateTime.now(ZoneOffset.UTC) + executeTest(dir, Seq(curTime), 0, modifiedAfter = Some(formatTime(curTime))) + } + } + + test("SPARK-31962: modifiedBefore and modifiedAfter option" + + " share same timestamp with file last modified time.") { + withTempDir { dir => + val curTime = LocalDateTime.now(ZoneOffset.UTC) + val formattedTime = formatTime(curTime) + executeTest(dir, Seq(curTime), 0, modifiedBefore = Some(formattedTime), + modifiedAfter = Some(formattedTime)) + } + } + + test("SPARK-31962: modifiedBefore and modifiedAfter option" + + " share same timestamp with earlier file last modified time.") { + withTempDir { dir => + val curTime = LocalDateTime.now(ZoneOffset.UTC) + val fileTime = curTime.minusDays(3) + val formattedTime = formatTime(curTime) + executeTest(dir, Seq(fileTime), 0, modifiedBefore = Some(formattedTime), + modifiedAfter = Some(formattedTime)) + } + } + + test("SPARK-31962: modifiedBefore and modifiedAfter option" + + " share same timestamp with later file last modified time.") { + withTempDir { dir => + val curTime = LocalDateTime.now(ZoneOffset.UTC) + val formattedTime = formatTime(curTime) + executeTest(dir, Seq(curTime), 0, modifiedBefore = Some(formattedTime), + modifiedAfter = Some(formattedTime)) + } + } + + test("SPARK-31962: when modifiedAfter specified with a past date") { + withTempDir { dir => + val curTime = LocalDateTime.now(ZoneOffset.UTC) + val pastTime = curTime.minusYears(1) + val formattedTime = formatTime(pastTime) + executeTest(dir, Seq(curTime), 1, modifiedAfter = Some(formattedTime)) + } + } + + test("SPARK-31962: when modifiedBefore specified with a future date") { + withTempDir { dir => + val curTime = LocalDateTime.now(ZoneOffset.UTC) + val futureTime = curTime.plusYears(1) + val formattedTime = formatTime(futureTime) + executeTest(dir, Seq(curTime), 1, modifiedBefore = Some(formattedTime)) + } + } + + test("SPARK-31962: with modifiedBefore option provided using a past date") { + withTempDir { dir => + val curTime = LocalDateTime.now(ZoneOffset.UTC) + val pastTime = curTime.minusYears(1) + val formattedTime = formatTime(pastTime) + executeTest(dir, Seq(curTime), 0, modifiedBefore = Some(formattedTime)) + } + } + + test("SPARK-31962: modifiedAfter specified with a past date, multiple files, one valid") { + withTempDir { dir => + val fileTime1 = LocalDateTime.now(ZoneOffset.UTC) + val fileTime2 = LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC) + val pastTime = fileTime1.minusYears(1) + val formattedTime = formatTime(pastTime) + executeTest(dir, Seq(fileTime1, fileTime2), 1, modifiedAfter = Some(formattedTime)) + } + } + + test("SPARK-31962: modifiedAfter specified with a past date, multiple files, both valid") { + withTempDir { dir => + val curTime = LocalDateTime.now(ZoneOffset.UTC) + val pastTime = curTime.minusYears(1) + val formattedTime = formatTime(pastTime) + executeTest(dir, Seq(curTime, curTime), 2, modifiedAfter = Some(formattedTime)) + } + } + + test("SPARK-31962: modifiedAfter specified with a past date, multiple files, none valid") { + withTempDir { dir => + val fileTime = LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC) + val pastTime = LocalDateTime.now(ZoneOffset.UTC).minusYears(1) + val formattedTime = formatTime(pastTime) + executeTest(dir, Seq(fileTime, fileTime), 0, modifiedAfter = Some(formattedTime)) + } + } + + test("SPARK-31962: modifiedBefore specified with a future date, multiple files, both valid") { + withTempDir { dir => + val fileTime = LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC) + val futureTime = LocalDateTime.now(ZoneOffset.UTC).plusYears(1) + val formattedTime = formatTime(futureTime) + executeTest(dir, Seq(fileTime, fileTime), 2, modifiedBefore = Some(formattedTime)) + } + } + + test("SPARK-31962: modifiedBefore specified with a future date, multiple files, one valid") { + withTempDir { dir => + val curTime = LocalDateTime.now(ZoneOffset.UTC) + val fileTime1 = LocalDateTime.ofEpochSecond(0, 0, ZoneOffset.UTC) + val fileTime2 = curTime.plusDays(3) + val formattedTime = formatTime(curTime) + executeTest(dir, Seq(fileTime1, fileTime2), 1, modifiedBefore = Some(formattedTime)) + } + } + + test("SPARK-31962: modifiedBefore specified with a future date, multiple files, none valid") { + withTempDir { dir => + val fileTime = LocalDateTime.now(ZoneOffset.UTC).minusDays(1) + val formattedTime = formatTime(fileTime) + executeTest(dir, Seq(fileTime, fileTime), 0, modifiedBefore = Some(formattedTime)) + } + } + + test("SPARK-31962: modifiedBefore/modifiedAfter is specified with an invalid date") { + executeTestWithBadOption( + Map("modifiedBefore" -> "2024-05+1 01:00:00"), + Seq("The timestamp provided", "modifiedbefore", "2024-05+1 01:00:00")) + + executeTestWithBadOption( + Map("modifiedAfter" -> "2024-05+1 01:00:00"), + Seq("The timestamp provided", "modifiedafter", "2024-05+1 01:00:00")) + } + + test("SPARK-31962: modifiedBefore/modifiedAfter - empty option") { + executeTestWithBadOption( + Map("modifiedBefore" -> ""), + Seq("The timestamp provided", "modifiedbefore")) + + executeTestWithBadOption( + Map("modifiedAfter" -> ""), + Seq("The timestamp provided", "modifiedafter")) + } + + test("SPARK-31962: modifiedBefore/modifiedAfter filter takes into account local timezone " + + "when specified as an option.") { + Seq("modifiedbefore", "modifiedafter").foreach { filterName => + // CET = UTC + 1 hour, HST = UTC - 10 hours + Seq("CET", "HST").foreach { tzId => + testModifiedDateFilterWithTimezone(tzId, filterName) + } + } + } + + test("Option pathGlobFilter: filter files correctly") { + withTempPath { path => + val dataDir = path.getCanonicalPath + Seq("foo").toDS().write.text(dataDir) + Seq("bar").toDS().write.mode("append").orc(dataDir) + val df = spark.read.option("pathGlobFilter", "*.txt").text(dataDir) + checkAnswer(df, Row("foo")) + + // Both glob pattern in option and path should be effective to filter files. + val df2 = spark.read.option("pathGlobFilter", "*.txt").text(dataDir + "/*.orc") + checkAnswer(df2, Seq.empty) + + val df3 = spark.read.option("pathGlobFilter", "*.txt").text(dataDir + "/*xt") + checkAnswer(df3, Row("foo")) + } + } + + test("Option pathGlobFilter: simple extension filtering should contains partition info") { + withTempPath { path => + val input = Seq(("foo", 1), ("oof", 2)).toDF("a", "b") + input.write.partitionBy("b").text(path.getCanonicalPath) + Seq("bar").toDS().write.mode("append").orc(path.getCanonicalPath + "/b=1") + + // If we use glob pattern in the path, the partition column won't be shown in the result. + val df = spark.read.text(path.getCanonicalPath + "/*/*.txt") + checkAnswer(df, input.select("a")) + + val df2 = spark.read.option("pathGlobFilter", "*.txt").text(path.getCanonicalPath) + checkAnswer(df2, input) + } + } + + private def executeTest( + dir: File, + fileDates: Seq[LocalDateTime], + expectedCount: Long, + modifiedBefore: Option[String] = None, + modifiedAfter: Option[String] = None): Unit = { + fileDates.foreach { fileDate => + val file = createSingleFile(dir) + setFileTime(fileDate, file) + } + + val schema = StructType(Seq(StructField("a", StringType))) + + var dfReader = spark.read.format("csv").option("timeZone", "UTC").schema(schema) + modifiedBefore.foreach { opt => dfReader = dfReader.option("modifiedBefore", opt) } + modifiedAfter.foreach { opt => dfReader = dfReader.option("modifiedAfter", opt) } + + if (expectedCount > 0) { + // without pathGlobFilter + val df1 = dfReader.load(dir.getCanonicalPath) + assert(df1.count() === expectedCount) + + // pathGlobFilter matched + val df2 = dfReader.option("pathGlobFilter", "*.csv").load(dir.getCanonicalPath) + assert(df2.count() === expectedCount) + + // pathGlobFilter mismatched + val df3 = dfReader.option("pathGlobFilter", "*.txt").load(dir.getCanonicalPath) + assert(df3.count() === 0) + } else { + val df = dfReader.load(dir.getCanonicalPath) + assert(df.count() === 0) + } + } + + private def executeTestWithBadOption( + options: Map[String, String], + expectedMsgParts: Seq[String]): Unit = { + withTempDir { dir => + createSingleFile(dir) + val exc = intercept[AnalysisException] { + var dfReader = spark.read.format("csv") + options.foreach { case (key, value) => + dfReader = dfReader.option(key, value) + } + dfReader.load(dir.getCanonicalPath) + } + expectedMsgParts.foreach { msg => assert(exc.getMessage.contains(msg)) } + } + } + + private def testModifiedDateFilterWithTimezone( + timezoneId: String, + filterParamName: String): Unit = { + val curTime = LocalDateTime.now(ZoneOffset.UTC) + val zoneId: ZoneId = DateTimeUtils.getTimeZone(timezoneId).toZoneId + val strategyTimeInMicros = + ModifiedDateFilter.toThreshold( + curTime.toString, + timezoneId, + filterParamName) + val strategyTimeInSeconds = strategyTimeInMicros / 1000 / 1000 + + val curTimeAsSeconds = curTime.atZone(zoneId).toEpochSecond + withClue(s"timezone: $timezoneId / param: $filterParamName,") { + assert(strategyTimeInSeconds === curTimeAsSeconds) + } + } + + private def createSingleFile(dir: File): File = { + val file = new File(dir, "temp" + Random.nextInt(1000000) + ".csv") + stringToFile(file, "text") + } + + private def setFileTime(time: LocalDateTime, file: File): Boolean = { + val sameTime = time.toEpochSecond(ZoneOffset.UTC) + file.setLastModified(sameTime * 1000) + } + + private def formatTime(time: LocalDateTime): String = { + time.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss")) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaTest.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaTest.scala index fd70b6529ff51..22db55afc27c9 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaTest.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/ReadSchemaTest.scala @@ -21,7 +21,7 @@ import java.io.File import org.apache.spark.sql.{QueryTest, Row} import org.apache.spark.sql.functions._ -import org.apache.spark.sql.test.{SharedSparkSession, SQLTestUtils} +import org.apache.spark.sql.test.SharedSparkSession /** * The reader schema is said to be evolved (or projected) when it changed after the data is diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/RowDataSourceStrategySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/RowDataSourceStrategySuite.scala index 6420081a9757b..3e8a4fe290502 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/RowDataSourceStrategySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/RowDataSourceStrategySuite.scala @@ -22,15 +22,10 @@ import java.util.Properties import org.scalatest.BeforeAndAfter -import org.apache.spark.SparkFunSuite -import org.apache.spark.sql.{DataFrame, Row} -import org.apache.spark.sql.sources._ import org.apache.spark.sql.test.SharedSparkSession -import org.apache.spark.sql.types._ import org.apache.spark.util.Utils class RowDataSourceStrategySuite extends SharedSparkSession with BeforeAndAfter { - import testImplicits._ val url = "jdbc:h2:mem:testdb0" val urlWithUserAndPass = "jdbc:h2:mem:testdb0;user=testUser;password=testPass" diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SaveIntoDataSourceCommandSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SaveIntoDataSourceCommandSuite.scala index 233978289f068..e843d1d328425 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SaveIntoDataSourceCommandSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SaveIntoDataSourceCommandSuite.scala @@ -17,7 +17,6 @@ package org.apache.spark.sql.execution.datasources -import org.apache.spark.SparkConf import org.apache.spark.sql.SaveMode import org.apache.spark.sql.test.SharedSparkSession diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SchemaPruningSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SchemaPruningSuite.scala index 80061dc84efbc..ac5c28953a5d9 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SchemaPruningSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/SchemaPruningSuite.scala @@ -23,7 +23,9 @@ import org.scalactic.Equality import org.apache.spark.sql.{DataFrame, QueryTest, Row} import org.apache.spark.sql.catalyst.SchemaPruningTest +import org.apache.spark.sql.catalyst.expressions.Concat import org.apache.spark.sql.catalyst.parser.CatalystSqlParser +import org.apache.spark.sql.catalyst.plans.logical.Expand import org.apache.spark.sql.execution.FileSourceScanExec import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper import org.apache.spark.sql.functions._ @@ -49,6 +51,11 @@ abstract class SchemaPruningSuite relatives: Map[String, FullName] = Map.empty, employer: Employer = null, relations: Map[FullName, String] = Map.empty) + case class Department( + depId: Int, + depName: String, + contactId: Int, + employer: Employer) val janeDoe = FullName("Jane", "X.", "Doe") val johnDoe = FullName("John", "Y.", "Doe") @@ -56,6 +63,7 @@ abstract class SchemaPruningSuite val employer = Employer(0, Company("abc", "123 Business Street")) val employerWithNullCompany = Employer(1, null) + val employerWithNullCompany2 = Employer(2, null) val contacts = Contact(0, janeDoe, "123 Main Street", 1, friends = Array(susanSmith), @@ -64,6 +72,11 @@ abstract class SchemaPruningSuite Contact(1, johnDoe, "321 Wall Street", 3, relatives = Map("sister" -> janeDoe), employer = employerWithNullCompany, relations = Map(janeDoe -> "sister")) :: Nil + val departments = + Department(0, "Engineering", 0, employer) :: + Department(1, "Marketing", 1, employerWithNullCompany) :: + Department(2, "Operation", 4, employerWithNullCompany2) :: Nil + case class Name(first: String, last: String) case class BriefContact(id: Int, name: Name, address: String) @@ -338,6 +351,272 @@ abstract class SchemaPruningSuite } } + testSchemaPruning("SPARK-34638: nested column prune on generator output") { + val query1 = spark.table("contacts") + .select(explode(col("friends")).as("friend")) + .select("friend.first") + checkScan(query1, "struct>>") + checkAnswer(query1, Row("Susan") :: Nil) + + // Currently we don't prune multiple field case. + val query2 = spark.table("contacts") + .select(explode(col("friends")).as("friend")) + .select("friend.first", "friend.middle") + checkScan(query2, "struct>>") + checkAnswer(query2, Row("Susan", "Z.") :: Nil) + + val query3 = spark.table("contacts") + .select(explode(col("friends")).as("friend")) + .select("friend.first", "friend.middle", "friend") + checkScan(query3, "struct>>") + checkAnswer(query3, Row("Susan", "Z.", Row("Susan", "Z.", "Smith")) :: Nil) + } + + testSchemaPruning("SPARK-34638: nested column prune on generator output - case-sensitivity") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + val query1 = spark.table("contacts") + .select(explode(col("friends")).as("friend")) + .select("friend.First") + checkScan(query1, "struct>>") + checkAnswer(query1, Row("Susan") :: Nil) + + val query2 = spark.table("contacts") + .select(explode(col("friends")).as("friend")) + .select("friend.MIDDLE") + checkScan(query2, "struct>>") + checkAnswer(query2, Row("Z.") :: Nil) + } + } + + testSchemaPruning("select one deep nested complex field after repartition") { + val query = sql("select * from contacts") + .repartition(100) + .where("employer.company.address is not null") + .selectExpr("employer.id as employer_id") + checkScan(query, + "struct>>") + checkAnswer(query, Row(0) :: Nil) + } + + testSchemaPruning("select one deep nested complex field after repartition by expression") { + val query1 = sql("select * from contacts") + .repartition(100, col("id")) + .where("employer.company.address is not null") + .selectExpr("employer.id as employer_id") + checkScan(query1, + "struct>>") + checkAnswer(query1, Row(0) :: Nil) + + val query2 = sql("select * from contacts") + .repartition(100, col("employer")) + .where("employer.company.address is not null") + .selectExpr("employer.id as employer_id") + checkScan(query2, + "struct>>") + checkAnswer(query2, Row(0) :: Nil) + + val query3 = sql("select * from contacts") + .repartition(100, col("employer.company")) + .where("employer.company.address is not null") + .selectExpr("employer.company as employer_company") + checkScan(query3, + "struct>>") + checkAnswer(query3, Row(Row("abc", "123 Business Street")) :: Nil) + + val query4 = sql("select * from contacts") + .repartition(100, col("employer.company.address")) + .where("employer.company.address is not null") + .selectExpr("employer.company.address as employer_company_addr") + checkScan(query4, + "struct>>") + checkAnswer(query4, Row("123 Business Street") :: Nil) + } + + testSchemaPruning("select one deep nested complex field after join") { + val query1 = sql("select contacts.name.middle from contacts, departments where " + + "contacts.id = departments.contactId") + checkScan(query1, + "struct>", + "struct") + checkAnswer(query1, Row("X.") :: Row("Y.") :: Nil) + + val query2 = sql("select contacts.name.middle from contacts, departments where " + + "contacts.employer = departments.employer") + checkScan(query2, + "struct," + + "employer:struct>>", + "struct>>") + checkAnswer(query2, Row("X.") :: Row("Y.") :: Nil) + + val query3 = sql("select contacts.employer.company.name from contacts, departments where " + + "contacts.employer = departments.employer") + checkScan(query3, + "struct>>", + "struct>>") + checkAnswer(query3, Row("abc") :: Row(null) :: Nil) + } + + testSchemaPruning("select one deep nested complex field after outer join") { + val query1 = sql("select departments.contactId, contacts.name.middle from departments " + + "left outer join contacts on departments.contactId = contacts.id") + checkScan(query1, + "struct", + "struct>") + checkAnswer(query1, Row(0, "X.") :: Row(1, "Y.") :: Row(4, null) :: Nil) + + val query2 = sql("select contacts.name.first, departments.employer.company.name " + + "from contacts right outer join departments on contacts.id = departments.contactId") + checkScan(query2, + "struct>", + "struct>>") + checkAnswer(query2, + Row("Jane", "abc") :: + Row("John", null) :: + Row(null, null) :: Nil) + } + + testSchemaPruning("select nested field in aggregation function of Aggregate") { + val query1 = sql("select count(name.first) from contacts group by name.last") + checkScan(query1, "struct>") + checkAnswer(query1, Row(2) :: Row(2) :: Nil) + + val query2 = sql("select count(name.first), sum(pets) from contacts group by id") + checkScan(query2, "struct,pets:int>") + checkAnswer(query2, Row(1, 1) :: Row(1, null) :: Row(1, 3) :: Row(1, null) :: Nil) + + val query3 = sql("select count(name.first), first(name) from contacts group by id") + checkScan(query3, "struct>") + checkAnswer(query3, + Row(1, Row("Jane", "X.", "Doe")) :: + Row(1, Row("Jim", null, "Jones")) :: + Row(1, Row("John", "Y.", "Doe")) :: + Row(1, Row("Janet", null, "Jones")) :: Nil) + + val query4 = sql("select count(name.first), sum(pets) from contacts group by name.last") + checkScan(query4, "struct,pets:int>") + checkAnswer(query4, Row(2, null) :: Row(2, 4) :: Nil) + } + + testSchemaPruning("select nested field in window function") { + val windowSql = + """ + |with contact_rank as ( + | select row_number() over (partition by address order by id desc) as rank, + | contacts.* + | from contacts + |) + |select name.first, rank from contact_rank + |where name.first = 'Jane' AND rank = 1 + |""".stripMargin + val query = sql(windowSql) + checkScan(query, "struct,address:string>") + checkAnswer(query, Row("Jane", 1) :: Nil) + } + + testSchemaPruning("select nested field in window function and then order by") { + val windowSql = + """ + |with contact_rank as ( + | select row_number() over (partition by address order by id desc) as rank, + | contacts.* + | from contacts + | order by name.last, name.first + |) + |select name.first, rank from contact_rank + |""".stripMargin + val query = sql(windowSql) + checkScan(query, "struct,address:string>") + checkAnswer(query, + Row("Jane", 1) :: + Row("John", 1) :: + Row("Janet", 1) :: + Row("Jim", 1) :: Nil) + } + + testSchemaPruning("select nested field in Sort") { + val query1 = sql("select name.first, name.last from contacts order by name.first, name.last") + checkScan(query1, "struct>") + checkAnswer(query1, + Row("Jane", "Doe") :: + Row("Janet", "Jones") :: + Row("Jim", "Jones") :: + Row("John", "Doe") :: Nil) + + withTempView("tmp_contacts") { + // Create a repartitioned view because `SORT BY` is a local sort + sql("select * from contacts").repartition(1).createOrReplaceTempView("tmp_contacts") + val sortBySql = + """ + |select name.first, name.last from tmp_contacts + |sort by name.first, name.last + |""".stripMargin + val query2 = sql(sortBySql) + checkScan(query2, "struct>") + checkAnswer(query2, + Row("Jane", "Doe") :: + Row("Janet", "Jones") :: + Row("Jim", "Jones") :: + Row("John", "Doe") :: Nil) + } + } + + testSchemaPruning("select nested field in Expand") { + import org.apache.spark.sql.catalyst.dsl.expressions._ + + val query1 = Expand( + Seq( + Seq($"name.first", $"name.last"), + Seq(Concat(Seq($"name.first", $"name.last")), + Concat(Seq($"name.last", $"name.first"))) + ), + Seq('a.string, 'b.string), + sql("select * from contacts").logicalPlan + ).toDF() + checkScan(query1, "struct>") + checkAnswer(query1, + Row("Jane", "Doe") :: + Row("JaneDoe", "DoeJane") :: + Row("John", "Doe") :: + Row("JohnDoe", "DoeJohn") :: + Row("Jim", "Jones") :: + Row("JimJones", "JonesJim") :: + Row("Janet", "Jones") :: + Row("JanetJones", "JonesJanet") :: Nil) + + val name = StructType.fromDDL("first string, middle string, last string") + val query2 = Expand( + Seq(Seq($"name", $"name.last")), + Seq('a.struct(name), 'b.string), + sql("select * from contacts").logicalPlan + ).toDF() + checkScan(query2, "struct>") + checkAnswer(query2, + Row(Row("Jane", "X.", "Doe"), "Doe") :: + Row(Row("John", "Y.", "Doe"), "Doe") :: + Row(Row("Jim", null, "Jones"), "Jones") :: + Row(Row("Janet", null, "Jones"), "Jones") ::Nil) + } + + testSchemaPruning("SPARK-32163: nested pruning should work even with cosmetic variations") { + withTempView("contact_alias") { + sql("select * from contacts") + .repartition(100, col("name.first"), col("name.last")) + .selectExpr("name").createOrReplaceTempView("contact_alias") + + val query1 = sql("select name.first from contact_alias") + checkScan(query1, "struct>") + checkAnswer(query1, Row("Jane") :: Row("John") :: Row("Jim") :: Row("Janet") ::Nil) + + sql("select * from contacts") + .select(explode(col("friends.first")), col("friends")) + .createOrReplaceTempView("contact_alias") + + val query2 = sql("select friends.middle, col from contact_alias") + checkScan(query2, "struct>>") + checkAnswer(query2, Row(Array("Z."), "Susan") :: Nil) + } + } + protected def testSchemaPruning(testName: String)(testThunk: => Unit): Unit = { test(s"Spark vectorized reader - without partition data column - $testName") { withSQLConf(vectorizedReaderEnabledKey -> "true") { @@ -368,6 +647,7 @@ abstract class SchemaPruningSuite makeDataSourceFile(contacts, new File(path + "/contacts/p=1")) makeDataSourceFile(briefContacts, new File(path + "/contacts/p=2")) + makeDataSourceFile(departments, new File(path + "/departments")) // Providing user specified schema. Inferred schema from different data sources might // be different. @@ -380,6 +660,11 @@ abstract class SchemaPruningSuite spark.read.format(dataSourceName).schema(schema).load(path + "/contacts") .createOrReplaceTempView("contacts") + val departmentSchema = "`depId` INT,`depName` STRING,`contactId` INT, " + + "`employer` STRUCT<`id`: INT, `company`: STRUCT<`name`: STRING, `address`: STRING>>" + spark.read.format(dataSourceName).schema(departmentSchema).load(path + "/departments") + .createOrReplaceTempView("departments") + testThunk } } @@ -390,6 +675,7 @@ abstract class SchemaPruningSuite makeDataSourceFile(contactsWithDataPartitionColumn, new File(path + "/contacts/p=1")) makeDataSourceFile(briefContactsWithDataPartitionColumn, new File(path + "/contacts/p=2")) + makeDataSourceFile(departments, new File(path + "/departments")) // Providing user specified schema. Inferred schema from different data sources might // be different. @@ -402,6 +688,11 @@ abstract class SchemaPruningSuite spark.read.format(dataSourceName).schema(schema).load(path + "/contacts") .createOrReplaceTempView("contacts") + val departmentSchema = "`depId` INT,`depName` STRING,`contactId` INT, " + + "`employer` STRUCT<`id`: INT, `company`: STRUCT<`name`: STRING, `address`: STRING>>" + spark.read.format(dataSourceName).schema(departmentSchema).load(path + "/departments") + .createOrReplaceTempView("departments") + testThunk } } @@ -520,4 +811,63 @@ abstract class SchemaPruningSuite assert(scanSchema === expectedScanSchema) } } + + testSchemaPruning("SPARK-34963: extract case-insensitive struct field from array") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + val query1 = spark.table("contacts") + .select("friends.First", "friends.MiDDle") + checkScan(query1, "struct>>") + checkAnswer(query1, + Row(Array.empty[String], Array.empty[String]) :: + Row(Array("Susan"), Array("Z.")) :: + Row(null, null) :: + Row(null, null) :: Nil) + + val query2 = spark.table("contacts") + .where("friends.First is not null") + .select("friends.First", "friends.MiDDle") + checkScan(query2, "struct>>") + checkAnswer(query2, + Row(Array.empty[String], Array.empty[String]) :: + Row(Array("Susan"), Array("Z.")) :: Nil) + } + } + + testSchemaPruning("SPARK-34963: extract case-insensitive struct field from struct") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + val query1 = spark.table("contacts") + .select("Name.First", "NAME.MiDDle") + checkScan(query1, "struct>") + checkAnswer(query1, + Row("Jane", "X.") :: + Row("Janet", null) :: + Row("Jim", null) :: + Row("John", "Y.") :: Nil) + + val query2 = spark.table("contacts") + .where("Name.MIDDLE is not null") + .select("Name.First", "NAME.MiDDle") + checkScan(query2, "struct>") + checkAnswer(query2, + Row("Jane", "X.") :: + Row("John", "Y.") :: Nil) + } + } + + test("SPARK-34638: queries should not fail on unsupported cases") { + withTable("nested_array") { + sql("select * from values array(array(named_struct('a', 1, 'b', 3), " + + "named_struct('a', 2, 'b', 4))) T(items)").write.saveAsTable("nested_array") + val query = sql("select d.a from (select explode(c) d from " + + "(select explode(items) c from nested_array))") + checkAnswer(query, Row(1) :: Row(2) :: Nil) + } + + withTable("map") { + sql("select * from values map(1, named_struct('a', 1, 'b', 3), " + + "2, named_struct('a', 2, 'b', 4)) T(items)").write.saveAsTable("map") + val query = sql("select d.a from (select explode(items) (c, d) from map)") + checkAnswer(query, Row(1) :: Row(2) :: Nil) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/binaryfile/BinaryFileFormatSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/binaryfile/BinaryFileFormatSuite.scala index 8462916daaab8..86ff026d7b1e9 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/binaryfile/BinaryFileFormatSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/binaryfile/BinaryFileFormatSuite.scala @@ -34,7 +34,7 @@ import org.apache.spark.sql.execution.datasources.PartitionedFile import org.apache.spark.sql.functions.col import org.apache.spark.sql.internal.SQLConf.SOURCES_BINARY_FILE_MAX_LENGTH import org.apache.spark.sql.sources._ -import org.apache.spark.sql.test.{SharedSparkSession, SQLTestUtils} +import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types._ import org.apache.spark.util.Utils diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVSuite.scala index 366cf11871fa0..fd25a79619d24 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/csv/CSVSuite.scala @@ -36,13 +36,21 @@ import org.apache.hadoop.io.compress.GzipCodec import org.apache.spark.{SparkConf, SparkException, TestUtils} import org.apache.spark.sql.{AnalysisException, Column, DataFrame, QueryTest, Row} import org.apache.spark.sql.catalyst.util.DateTimeUtils +import org.apache.spark.sql.execution.datasources.CommonFileDataSourceSuite import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types._ -abstract class CSVSuite extends QueryTest with SharedSparkSession with TestCsvData { +abstract class CSVSuite + extends QueryTest + with SharedSparkSession + with TestCsvData + with CommonFileDataSourceSuite { + import testImplicits._ + override protected def dataSourceFormat = "csv" + private val carsFile = "test-data/cars.csv" private val carsMalformedFile = "test-data/cars-malformed.csv" private val carsFile8859 = "test-data/cars_iso-8859-1.csv" @@ -1450,10 +1458,22 @@ abstract class CSVSuite extends QueryTest with SharedSparkSession with TestCsvDa val ds = sampledTestData.coalesce(1) ds.write.text(path.getAbsolutePath) - val readback = spark.read + val readback1 = spark.read .option("inferSchema", true).option("samplingRatio", 0.1) .csv(path.getCanonicalPath) - assert(readback.schema == new StructType().add("_c0", IntegerType)) + assert(readback1.schema == new StructType().add("_c0", IntegerType)) + + withClue("SPARK-32621: 'path' option can cause issues while inferring schema") { + // During infer, "path" option gets added again to the paths that have already been listed. + // This results in reading more data than necessary and causes different schema to be + // inferred when sampling ratio is involved. + val readback2 = spark.read + .option("inferSchema", true).option("samplingRatio", 0.1) + .option("path", path.getCanonicalPath) + .format("csv") + .load + assert(readback2.schema == new StructType().add("_c0", IntegerType)) + } }) } @@ -1890,25 +1910,26 @@ abstract class CSVSuite extends QueryTest with SharedSparkSession with TestCsvDa test("SPARK-25387: bad input should not cause NPE") { val schema = StructType(StructField("a", IntegerType) :: Nil) - val input = spark.createDataset(Seq("\u0000\u0000\u0001234")) + val input = spark.createDataset(Seq("\u0001\u0000\u0001234")) checkAnswer(spark.read.schema(schema).csv(input), Row(null)) checkAnswer(spark.read.option("multiLine", true).schema(schema).csv(input), Row(null)) - assert(spark.read.csv(input).collect().toSet == Set(Row())) + assert(spark.read.schema(schema).csv(input).collect().toSet == Set(Row(null))) } test("SPARK-31261: bad csv input with `columnNameCorruptRecord` should not cause NPE") { val schema = StructType( StructField("a", IntegerType) :: StructField("_corrupt_record", StringType) :: Nil) - val input = spark.createDataset(Seq("\u0000\u0000\u0001234")) + val input = spark.createDataset(Seq("\u0001\u0000\u0001234")) checkAnswer( spark.read .option("columnNameOfCorruptRecord", "_corrupt_record") .schema(schema) .csv(input), - Row(null, null)) - assert(spark.read.csv(input).collect().toSet == Set(Row())) + Row(null, "\u0001\u0000\u0001234")) + assert(spark.read.schema(schema).csv(input).collect().toSet == + Set(Row(null, "\u0001\u0000\u0001234"))) } test("field names of inferred schema shouldn't compare to the first row") { @@ -2341,6 +2362,107 @@ abstract class CSVSuite extends QueryTest with SharedSparkSession with TestCsvDa checkAnswer(csv, Row(null)) } } + + test("SPARK-32025: infer the schema from mixed-type values") { + withTempPath { path => + Seq("col_mixed_types", "2012", "1997", "True").toDS.write.text(path.getCanonicalPath) + val df = spark.read.format("csv") + .option("header", "true") + .option("inferSchema", "true") + .load(path.getCanonicalPath) + + assert(df.schema.last == StructField("col_mixed_types", StringType, true)) + } + } + + test("SPARK-32614: don't treat rows starting with null char as comment") { + withTempPath { path => + Seq("\u0000foo", "bar", "baz").toDS.write.text(path.getCanonicalPath) + val df = spark.read.format("csv") + .option("header", "false") + .option("inferSchema", "true") + .load(path.getCanonicalPath) + assert(df.count() == 3) + } + } + + test("case sensitivity of filters references") { + Seq(true, false).foreach { filterPushdown => + withSQLConf(SQLConf.CSV_FILTER_PUSHDOWN_ENABLED.key -> filterPushdown.toString) { + withTempPath { path => + Seq( + """aaa,BBB""", + """0,1""", + """2,3""").toDF().repartition(1).write.text(path.getCanonicalPath) + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + val readback = spark.read.schema("aaa integer, BBB integer") + .option("header", true) + .csv(path.getCanonicalPath) + checkAnswer(readback, Seq(Row(2, 3), Row(0, 1))) + checkAnswer(readback.filter($"AAA" === 2 && $"bbb" === 3), Seq(Row(2, 3))) + } + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + val readback = spark.read.schema("aaa integer, BBB integer") + .option("header", true) + .csv(path.getCanonicalPath) + checkAnswer(readback, Seq(Row(2, 3), Row(0, 1))) + val errorMsg = intercept[AnalysisException] { + readback.filter($"AAA" === 2 && $"bbb" === 3).collect() + }.getMessage + assert(errorMsg.contains("cannot resolve 'AAA'")) + } + } + } + } + } + + test("SPARK-32810: CSV data source should be able to read files with " + + "escaped glob metacharacter in the paths") { + withTempDir { dir => + val basePath = dir.getCanonicalPath + // test CSV writer / reader without specifying schema + val csvTableName = "[abc]" + spark.range(3).coalesce(1).write.csv(s"$basePath/$csvTableName") + val readback = spark.read + .csv(s"$basePath/${"""(\[|\]|\{|\})""".r.replaceAllIn(csvTableName, """\\$1""")}") + assert(readback.collect sameElements Array(Row("0"), Row("1"), Row("2"))) + } + } + + test("SPARK-33566: configure UnescapedQuoteHandling to parse " + + "unescaped quotes and unescaped delimiter data correctly") { + withTempPath { path => + val dataPath = path.getCanonicalPath + val row1 = Row("""a,""b,c""", "xyz") + val row2 = Row("""a,b,c""", """x""yz""") + // Generate the test data, use `,` as delimiter and `"` as quotes, but they didn't escape. + Seq( + """c1,c2""", + s""""${row1.getString(0)}","${row1.getString(1)}"""", + s""""${row2.getString(0)}","${row2.getString(1)}"""") + .toDF().repartition(1).write.text(dataPath) + // Without configure UnescapedQuoteHandling to STOP_AT_CLOSING_QUOTE, + // the result will be Row(""""a,""b""", """c""""), Row("""a,b,c""", """"x""yz"""") + val result = spark.read + .option("inferSchema", "true") + .option("header", "true") + .option("unescapedQuoteHandling", "STOP_AT_CLOSING_QUOTE") + .csv(dataPath).collect() + val exceptResults = Array(row1, row2) + assert(result.sameElements(exceptResults)) + } + } + + test("SPARK-34768: counting a long record with ignoreTrailingWhiteSpace set to true") { + val bufSize = 128 + val line = "X" * (bufSize - 1) + "| |" + withTempPath { path => + Seq(line).toDF.write.text(path.getAbsolutePath) + assert(spark.read.format("csv") + .option("delimiter", "|") + .option("ignoreTrailingWhiteSpace", "true").load(path.getAbsolutePath).count() == 1) + } + } } class CSVv1Suite extends CSVSuite { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/DriverRegistrySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/DriverRegistrySuite.scala new file mode 100644 index 0000000000000..51dbdacb5e0fe --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/DriverRegistrySuite.scala @@ -0,0 +1,29 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.datasources.jdbc + +import org.apache.spark.SparkFunSuite +import org.apache.spark.sql.execution.datasources.jdbc.connection.TestDriver + +class DriverRegistrySuite extends SparkFunSuite { + test("SPARK-32229: get must give back wrapped driver if wrapped") { + val className = classOf[TestDriver].getName + DriverRegistry.register(className) + assert(DriverRegistry.get(className).isInstanceOf[TestDriver]) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/ConnectionProviderSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/ConnectionProviderSuite.scala index ff5fe4f620a1d..71b0325f93732 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/ConnectionProviderSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/ConnectionProviderSuite.scala @@ -19,27 +19,61 @@ package org.apache.spark.sql.execution.datasources.jdbc.connection import javax.security.auth.login.Configuration -class ConnectionProviderSuite extends ConnectionProviderSuiteBase { +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.SharedSparkSession + +class ConnectionProviderSuite extends ConnectionProviderSuiteBase with SharedSparkSession { + test("All built-in providers must be loaded") { + IntentionallyFaultyConnectionProvider.constructed = false + val providers = ConnectionProvider.loadProviders() + assert(providers.exists(_.isInstanceOf[BasicConnectionProvider])) + assert(providers.exists(_.isInstanceOf[DB2ConnectionProvider])) + assert(providers.exists(_.isInstanceOf[MariaDBConnectionProvider])) + assert(providers.exists(_.isInstanceOf[MSSQLConnectionProvider])) + assert(providers.exists(_.isInstanceOf[PostgresConnectionProvider])) + assert(providers.exists(_.isInstanceOf[OracleConnectionProvider])) + assert(IntentionallyFaultyConnectionProvider.constructed) + assert(!providers.exists(_.isInstanceOf[IntentionallyFaultyConnectionProvider])) + assert(providers.size === 6) + } + + test("Disabled provider must not be loaded") { + withSQLConf(SQLConf.DISABLED_JDBC_CONN_PROVIDER_LIST.key -> "db2") { + val providers = ConnectionProvider.loadProviders() + assert(!providers.exists(_.isInstanceOf[DB2ConnectionProvider])) + assert(providers.size === 5) + } + } + test("Multiple security configs must be reachable") { Configuration.setConfiguration(null) - val postgresDriver = registerDriver(PostgresConnectionProvider.driverClass) - val postgresProvider = new PostgresConnectionProvider( - postgresDriver, options("jdbc:postgresql://localhost/postgres")) - val db2Driver = registerDriver(DB2ConnectionProvider.driverClass) - val db2Provider = new DB2ConnectionProvider(db2Driver, options("jdbc:db2://localhost/db2")) + val postgresProvider = new PostgresConnectionProvider() + val postgresDriver = registerDriver(postgresProvider.driverClass) + val postgresOptions = options("jdbc:postgresql://localhost/postgres") + val postgresAppEntry = postgresProvider.appEntry(postgresDriver, postgresOptions) + val db2Provider = new DB2ConnectionProvider() + val db2Driver = registerDriver(db2Provider.driverClass) + val db2Options = options("jdbc:db2://localhost/db2") + val db2AppEntry = db2Provider.appEntry(db2Driver, db2Options) // Make sure no authentication for the databases are set - val oldConfig = Configuration.getConfiguration - assert(oldConfig.getAppConfigurationEntry(postgresProvider.appEntry) == null) - assert(oldConfig.getAppConfigurationEntry(db2Provider.appEntry) == null) + val rootConfig = Configuration.getConfiguration + assert(rootConfig.getAppConfigurationEntry(postgresAppEntry) == null) + assert(rootConfig.getAppConfigurationEntry(db2AppEntry) == null) + + postgresProvider.setAuthenticationConfig(postgresDriver, postgresOptions) + val postgresConfig = Configuration.getConfiguration - postgresProvider.setAuthenticationConfigIfNeeded() - db2Provider.setAuthenticationConfigIfNeeded() + db2Provider.setAuthenticationConfig(db2Driver, db2Options) + val db2Config = Configuration.getConfiguration // Make sure authentication for the databases are set - val newConfig = Configuration.getConfiguration - assert(oldConfig != newConfig) - assert(newConfig.getAppConfigurationEntry(postgresProvider.appEntry) != null) - assert(newConfig.getAppConfigurationEntry(db2Provider.appEntry) != null) + assert(rootConfig != postgresConfig) + assert(rootConfig != db2Config) + // The topmost config in the chain is linked with all the subsequent entries + assert(db2Config.getAppConfigurationEntry(postgresAppEntry) != null) + assert(db2Config.getAppConfigurationEntry(db2AppEntry) != null) + + Configuration.setConfiguration(null) } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/ConnectionProviderSuiteBase.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/ConnectionProviderSuiteBase.scala index d18a3088c4f2f..f42b17abf31bc 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/ConnectionProviderSuiteBase.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/ConnectionProviderSuiteBase.scala @@ -42,7 +42,7 @@ abstract class ConnectionProviderSuiteBase extends SparkFunSuite with BeforeAndA JDBCOptions.JDBC_PRINCIPAL -> "principal" )) - override def afterEach(): Unit = { + protected override def afterEach(): Unit = { try { Configuration.setConfiguration(null) } finally { @@ -50,20 +50,21 @@ abstract class ConnectionProviderSuiteBase extends SparkFunSuite with BeforeAndA } } - protected def testSecureConnectionProvider(provider: SecureConnectionProvider): Unit = { + protected def testSecureConnectionProvider( + provider: SecureConnectionProvider, + driver: Driver, + options: JDBCOptions): Unit = { + val providerAppEntry = provider.appEntry(driver, options) + // Make sure no authentication for the database is set - assert(Configuration.getConfiguration.getAppConfigurationEntry(provider.appEntry) == null) + assert(Configuration.getConfiguration.getAppConfigurationEntry(providerAppEntry) == null) - // Make sure the first call sets authentication properly + // Make sure setAuthenticationConfig call sets authentication properly val savedConfig = Configuration.getConfiguration - provider.setAuthenticationConfigIfNeeded() + provider.setAuthenticationConfig(driver, options) val config = Configuration.getConfiguration assert(savedConfig != config) - val appEntry = config.getAppConfigurationEntry(provider.appEntry) + val appEntry = config.getAppConfigurationEntry(providerAppEntry) assert(appEntry != null) - - // Make sure a second call is not modifying the existing authentication - provider.setAuthenticationConfigIfNeeded() - assert(config.getAppConfigurationEntry(provider.appEntry) === appEntry) } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/DB2ConnectionProviderSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/DB2ConnectionProviderSuite.scala index d656f83e2ebb9..895b3d85d960b 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/DB2ConnectionProviderSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/DB2ConnectionProviderSuite.scala @@ -18,10 +18,10 @@ package org.apache.spark.sql.execution.datasources.jdbc.connection class DB2ConnectionProviderSuite extends ConnectionProviderSuiteBase { - test("setAuthenticationConfigIfNeeded must set authentication if not set") { - val driver = registerDriver(DB2ConnectionProvider.driverClass) - val provider = new DB2ConnectionProvider(driver, options("jdbc:db2://localhost/db2")) + test("setAuthenticationConfig must set authentication all the time") { + val provider = new DB2ConnectionProvider() + val driver = registerDriver(provider.driverClass) - testSecureConnectionProvider(provider) + testSecureConnectionProvider(provider, driver, options("jdbc:db2://localhost/db2")) } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/IntentionallyFaultyConnectionProvider.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/IntentionallyFaultyConnectionProvider.scala new file mode 100644 index 0000000000000..329d79cae62e8 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/IntentionallyFaultyConnectionProvider.scala @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.datasources.jdbc.connection + +import java.sql.{Connection, Driver} + +import org.apache.spark.sql.jdbc.JdbcConnectionProvider + +private class IntentionallyFaultyConnectionProvider extends JdbcConnectionProvider { + IntentionallyFaultyConnectionProvider.constructed = true + throw new IllegalArgumentException("Intentional Exception") + override val name: String = "IntentionallyFaultyConnectionProvider" + override def canHandle(driver: Driver, options: Map[String, String]): Boolean = true + override def getConnection(driver: Driver, options: Map[String, String]): Connection = null +} + +private object IntentionallyFaultyConnectionProvider { + var constructed = false +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/MSSQLConnectionProviderSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/MSSQLConnectionProviderSuite.scala new file mode 100644 index 0000000000000..a0b9af2d82e13 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/MSSQLConnectionProviderSuite.scala @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.datasources.jdbc.connection + +import java.sql.Driver + +import org.apache.spark.sql.execution.datasources.jdbc.JDBCOptions + +class MSSQLConnectionProviderSuite extends ConnectionProviderSuiteBase { + test("setAuthenticationConfig default parser must set authentication all the time") { + val provider = new MSSQLConnectionProvider() + val driver = registerDriver(provider.driverClass) + + testProviders(driver, provider, options("jdbc:sqlserver://localhost/mssql"), + options("jdbc:sqlserver://localhost/mssql;jaasConfigurationName=custommssql")) + } + + test("setAuthenticationConfig custom parser must set authentication all the time") { + val provider = new MSSQLConnectionProvider() { + override val parserMethod: String = "IntentionallyNotExistingMethod" + } + val driver = registerDriver(provider.driverClass) + + testProviders(driver, provider, options("jdbc:sqlserver://localhost/mssql"), + options("jdbc:sqlserver://localhost/mssql;jaasConfigurationName=custommssql")) + } + + private def testProviders( + driver: Driver, + provider: SecureConnectionProvider, + defaultOptions: JDBCOptions, + customOptions: JDBCOptions) = { + testSecureConnectionProvider(provider, driver, defaultOptions) + testSecureConnectionProvider(provider, driver, customOptions) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/MariaDBConnectionProviderSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/MariaDBConnectionProviderSuite.scala index 70cad2097eb43..d8bdf26b35c7d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/MariaDBConnectionProviderSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/MariaDBConnectionProviderSuite.scala @@ -18,10 +18,10 @@ package org.apache.spark.sql.execution.datasources.jdbc.connection class MariaDBConnectionProviderSuite extends ConnectionProviderSuiteBase { - test("setAuthenticationConfigIfNeeded must set authentication if not set") { - val driver = registerDriver(MariaDBConnectionProvider.driverClass) - val provider = new MariaDBConnectionProvider(driver, options("jdbc:mysql://localhost/mysql")) + test("setAuthenticationConfig must set authentication all the time") { + val provider = new MariaDBConnectionProvider() + val driver = registerDriver(provider.driverClass) - testSecureConnectionProvider(provider) + testSecureConnectionProvider(provider, driver, options("jdbc:mysql://localhost/mysql")) } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/OracleConnectionProviderSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/OracleConnectionProviderSuite.scala new file mode 100644 index 0000000000000..4aaaf8168eb53 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/OracleConnectionProviderSuite.scala @@ -0,0 +1,27 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.datasources.jdbc.connection + +class OracleConnectionProviderSuite extends ConnectionProviderSuiteBase { + test("setAuthenticationConfig must set authentication all the time") { + val provider = new OracleConnectionProvider() + val driver = registerDriver(provider.driverClass) + + testSecureConnectionProvider(provider, driver, options("jdbc:oracle:thin:@//localhost/xe")) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/PostgresConnectionProviderSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/PostgresConnectionProviderSuite.scala index 8cef7652f9c54..5006bf4091380 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/PostgresConnectionProviderSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/PostgresConnectionProviderSuite.scala @@ -18,15 +18,15 @@ package org.apache.spark.sql.execution.datasources.jdbc.connection class PostgresConnectionProviderSuite extends ConnectionProviderSuiteBase { - test("setAuthenticationConfigIfNeeded must set authentication if not set") { - val driver = registerDriver(PostgresConnectionProvider.driverClass) - val defaultProvider = new PostgresConnectionProvider( - driver, options("jdbc:postgresql://localhost/postgres")) - val customProvider = new PostgresConnectionProvider( - driver, options(s"jdbc:postgresql://localhost/postgres?jaasApplicationName=custompgjdbc")) + test("setAuthenticationConfig must set authentication all the time") { + val provider = new PostgresConnectionProvider() + val defaultOptions = options("jdbc:postgresql://localhost/postgres") + val customOptions = + options(s"jdbc:postgresql://localhost/postgres?jaasApplicationName=custompgjdbc") + val driver = registerDriver(provider.driverClass) - assert(defaultProvider.appEntry !== customProvider.appEntry) - testSecureConnectionProvider(defaultProvider) - testSecureConnectionProvider(customProvider) + assert(provider.appEntry(driver, defaultOptions) !== provider.appEntry(driver, customOptions)) + testSecureConnectionProvider(provider, driver, defaultOptions) + testSecureConnectionProvider(provider, driver, customOptions) } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/TestDriver.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/TestDriver.scala new file mode 100644 index 0000000000000..6b57a95ed458b --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/jdbc/connection/TestDriver.scala @@ -0,0 +1,33 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.datasources.jdbc.connection + +import java.sql.{Connection, Driver, DriverPropertyInfo} +import java.util.Properties +import java.util.logging.Logger + +private[jdbc] class TestDriver() extends Driver { + override def connect(url: String, info: Properties): Connection = null + override def acceptsURL(url: String): Boolean = false + override def getPropertyInfo(url: String, info: Properties): Array[DriverPropertyInfo] = + Array.empty + override def getMajorVersion: Int = 0 + override def getMinorVersion: Int = 0 + override def jdbcCompliant(): Boolean = false + override def getParentLogger: Logger = null +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonBenchmark.scala index 56930880ed5da..e4f6ccaa9a621 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonBenchmark.scala @@ -20,9 +20,10 @@ import java.io.File import java.time.{Instant, LocalDate} import org.apache.spark.benchmark.Benchmark -import org.apache.spark.sql.{Dataset, Row} +import org.apache.spark.sql.{Column, Dataset, Row} import org.apache.spark.sql.execution.benchmark.SqlBasedBenchmark import org.apache.spark.sql.functions._ +import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types._ /** @@ -38,16 +39,9 @@ import org.apache.spark.sql.types._ * Results will be written to "benchmarks/JSONBenchmark-results.txt". * }}} */ - object JsonBenchmark extends SqlBasedBenchmark { import spark.implicits._ - private def prepareDataInfo(benchmark: Benchmark): Unit = { - // scalastyle:off println - benchmark.out.println("Preparing data for benchmarking ...") - // scalastyle:on println - } - def schemaInferring(rowsNum: Int, numIters: Int): Unit = { val benchmark = new Benchmark("JSON schema inferring", rowsNum, output = output) @@ -127,18 +121,6 @@ object JsonBenchmark extends SqlBasedBenchmark { .add("z", StringType) } - def writeWideRow(path: String, rowsNum: Int): StructType = { - val colsNum = 1000 - val fields = Seq.tabulate(colsNum)(i => StructField(s"col$i", IntegerType)) - val schema = StructType(fields) - - spark.range(rowsNum) - .select(Seq.tabulate(colsNum)(i => lit(i).as(s"col$i")): _*) - .write.json(path) - - schema - } - def countWideColumn(rowsNum: Int, numIters: Int): Unit = { val benchmark = new Benchmark("count a wide column", rowsNum, output = output) @@ -170,7 +152,7 @@ object JsonBenchmark extends SqlBasedBenchmark { withTempPath { path => prepareDataInfo(benchmark) - val schema = writeWideRow(path.getAbsolutePath, rowsNum) + val schema = writeWideRow(path.getAbsolutePath, rowsNum, 1000) benchmark.addCase("No encoding", numIters) { _ => spark.read @@ -430,7 +412,7 @@ object JsonBenchmark extends SqlBasedBenchmark { } readBench.addCase("infer timestamps from files", numIters) { _ => - spark.read.json(timestampDir).noop() + spark.read.option("inferTimestamp", true).json(timestampDir).noop() } val dateSchema = new StructType().add("date", DateType) @@ -460,7 +442,7 @@ object JsonBenchmark extends SqlBasedBenchmark { } readBench.addCase("infer timestamps from Dataset[String]", numIters) { _ => - spark.read.json(timestampStr).noop() + spark.read.option("inferTimestamp", true).json(timestampStr).noop() } def dateStr: Dataset[String] = { @@ -495,19 +477,61 @@ object JsonBenchmark extends SqlBasedBenchmark { } } + private def filtersPushdownBenchmark(rowsNum: Int, numIters: Int): Unit = { + val benchmark = new Benchmark("Filters pushdown", rowsNum, output = output) + val colsNum = 100 + val fields = Seq.tabulate(colsNum)(i => StructField(s"col$i", TimestampType)) + val schema = StructType(StructField("key", IntegerType) +: fields) + def columns(): Seq[Column] = { + val ts = Seq.tabulate(colsNum) { i => + lit(Instant.ofEpochSecond(i * 12345678)).as(s"col$i") + } + ($"id" % 1000).as("key") +: ts + } + withTempPath { path => + spark.range(rowsNum).select(columns(): _*).write.json(path.getAbsolutePath) + def readback = { + spark.read.schema(schema).json(path.getAbsolutePath) + } + + benchmark.addCase("w/o filters", numIters) { _ => + readback.noop() + } + + def withFilter(configEnabled: Boolean): Unit = { + withSQLConf(SQLConf.JSON_FILTER_PUSHDOWN_ENABLED.key -> configEnabled.toString()) { + readback.filter($"key" === 0).noop() + } + } + + benchmark.addCase("pushdown disabled", numIters) { _ => + withFilter(configEnabled = false) + } + + benchmark.addCase("w/ filters", numIters) { _ => + withFilter(configEnabled = true) + } + + benchmark.run() + } + } + override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { val numIters = 3 runBenchmark("Benchmark for performance of JSON parsing") { - schemaInferring(100 * 1000 * 1000, numIters) - countShortColumn(100 * 1000 * 1000, numIters) - countWideColumn(10 * 1000 * 1000, numIters) - countWideRow(500 * 1000, numIters) - selectSubsetOfColumns(10 * 1000 * 1000, numIters) - jsonParserCreation(10 * 1000 * 1000, numIters) - jsonFunctions(10 * 1000 * 1000, numIters) - jsonInDS(50 * 1000 * 1000, numIters) - jsonInFile(50 * 1000 * 1000, numIters) - datetimeBenchmark(rowsNum = 10 * 1000 * 1000, numIters) + schemaInferring(5 * 1000 * 1000, numIters) + countShortColumn(5 * 1000 * 1000, numIters) + countWideColumn(1000 * 1000, numIters) + countWideRow(50 * 1000, numIters) + selectSubsetOfColumns(1000 * 1000, numIters) + jsonParserCreation(1000 * 1000, numIters) + jsonFunctions(1000 * 1000, numIters) + jsonInDS(5 * 1000 * 1000, numIters) + jsonInFile(5 * 1000 * 1000, numIters) + datetimeBenchmark(rowsNum = 1000 * 1000, numIters) + // Benchmark pushdown filters that refer to top-level columns. + // TODO (SPARK-32325): Add benchmarks for filters with nested column attributes. + filtersPushdownBenchmark(rowsNum = 100 * 1000, numIters) } } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonParsingOptionsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonParsingOptionsSuite.scala index 7592809d7c85b..e9fe79a0641b9 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonParsingOptionsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonParsingOptionsSuite.scala @@ -17,12 +17,12 @@ package org.apache.spark.sql.execution.datasources.json -import org.apache.spark.sql.QueryTest -import org.apache.spark.sql.catalyst.json.JSONOptions +import org.apache.spark.sql.{QueryTest, Row} import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types.{StringType, StructType} /** - * Test cases for various [[JSONOptions]]. + * Test cases for various [[org.apache.spark.sql.catalyst.json.JSONOptions]]. */ class JsonParsingOptionsSuite extends QueryTest with SharedSparkSession { import testImplicits._ @@ -73,14 +73,14 @@ class JsonParsingOptionsSuite extends QueryTest with SharedSparkSession { } test("allowUnquotedControlChars off") { - val str = """{"name": "a\u0001b"}""" + val str = "{\"name\": \"a\u0001b\"}" val df = spark.read.json(Seq(str).toDS()) assert(df.schema.head.name == "_corrupt_record") } test("allowUnquotedControlChars on") { - val str = """{"name": "a\u0001b"}""" + val str = "{\"name\": \"a\u0001b\"}" val df = spark.read.option("allowUnquotedControlChars", "true").json(Seq(str).toDS()) assert(df.schema.head.name == "name") @@ -102,21 +102,32 @@ class JsonParsingOptionsSuite extends QueryTest with SharedSparkSession { assert(df.first().getLong(0) == 18) } - // The following two tests are not really working - need to look into Jackson's - // JsonReadFeature.ALLOW_NON_NUMERIC_NUMBERS. - ignore("allowNonNumericNumbers off") { + test("allowNonNumericNumbers off") { val str = """{"age": NaN}""" - val df = spark.read.json(Seq(str).toDS()) + val df = spark.read.option("allowNonNumericNumbers", false).json(Seq(str).toDS()) - assert(df.schema.head.name == "_corrupt_record") + assert(df.schema === new StructType().add("_corrupt_record", StringType)) + checkAnswer(df, Row(str)) } - ignore("allowNonNumericNumbers on") { - val str = """{"age": NaN}""" - val df = spark.read.option("allowNonNumericNumbers", "true").json(Seq(str).toDS()) - - assert(df.schema.head.name == "age") - assert(df.first().getDouble(0).isNaN) + test("allowNonNumericNumbers on") { + val str = """{"c0":NaN, "c1":+INF, "c2":+Infinity, "c3":Infinity, "c4":-INF, "c5":-Infinity}""" + val df = spark.read.option("allowNonNumericNumbers", true).json(Seq(str).toDS()) + + assert(df.schema === + new StructType() + .add("c0", "double") + .add("c1", "double") + .add("c2", "double") + .add("c3", "double") + .add("c4", "double") + .add("c5", "double")) + checkAnswer( + df, + Row( + Double.NaN, + Double.PositiveInfinity, Double.PositiveInfinity, Double.PositiveInfinity, + Double.NegativeInfinity, Double.NegativeInfinity)) } test("allowBackslashEscapingAnyCharacter off") { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala index dcea4835b5f2a..b707a48413647 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/json/JsonSuite.scala @@ -21,7 +21,7 @@ import java.io._ import java.nio.charset.{Charset, StandardCharsets, UnsupportedCharsetException} import java.nio.file.Files import java.sql.{Date, Timestamp} -import java.time.LocalDate +import java.time.{LocalDate, ZoneId} import java.util.Locale import com.fasterxml.jackson.core.JsonFactory @@ -35,22 +35,30 @@ import org.apache.spark.sql.{functions => F, _} import org.apache.spark.sql.catalyst.json._ import org.apache.spark.sql.catalyst.util.DateTimeUtils import org.apache.spark.sql.execution.ExternalRDD -import org.apache.spark.sql.execution.adaptive.AdaptiveTestUtils.assertExceptionMessage -import org.apache.spark.sql.execution.datasources.DataSource +import org.apache.spark.sql.execution.datasources.{CommonFileDataSourceSuite, DataSource, InMemoryFileIndex, NoopCache} +import org.apache.spark.sql.execution.datasources.v2.json.JsonScanBuilder import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types._ import org.apache.spark.sql.types.StructType.fromDDL import org.apache.spark.sql.types.TestUDT.{MyDenseVector, MyDenseVectorUDT} +import org.apache.spark.sql.util.CaseInsensitiveStringMap import org.apache.spark.util.Utils class TestFileFilter extends PathFilter { override def accept(path: Path): Boolean = path.getParent.getName != "p=2" } -abstract class JsonSuite extends QueryTest with SharedSparkSession with TestJsonData { +abstract class JsonSuite + extends QueryTest + with SharedSparkSession + with TestJsonData + with CommonFileDataSourceSuite { + import testImplicits._ + override protected def dataSourceFormat = "json" + test("Type promotion") { def checkTypePromotion(expected: Any, actual: Any): Unit = { assert(expected.getClass == actual.getClass, @@ -126,7 +134,7 @@ abstract class JsonSuite extends QueryTest with SharedSparkSession with TestJson Map("timestampFormat" -> "yyyy-MM-dd'T'HH:mm:ssXXX"))) val ISO8601Date = "1970-01-01" - checkTypePromotion(DateTimeUtils.microsToDays(32400000000L), + checkTypePromotion(DateTimeUtils.microsToDays(32400000000L, ZoneId.systemDefault), enforceCorrectType(ISO8601Date, DateType)) } @@ -1557,6 +1565,15 @@ abstract class JsonSuite extends QueryTest with SharedSparkSession with TestJson "mapreduce.input.pathFilter.class" -> classOf[TestFileFilter].getName ) assert(spark.read.options(extraOptions).json(path).count() === 2) + + withClue("SPARK-32621: 'path' option can cause issues while inferring schema") { + // During infer, "path" option is used again on top of the paths that have already been + // listed. When a partition is removed by TestFileFilter, this will cause a conflict while + // inferring partitions because the original path in the "path" option will list the + // partition directory that has been removed. + assert( + spark.read.options(extraOptions).format("json").option("path", path).load.count() === 2) + } } } @@ -2142,9 +2159,18 @@ abstract class JsonSuite extends QueryTest with SharedSparkSession with TestJson )(withTempPath { path => val ds = sampledTestData.coalesce(1) ds.write.text(path.getAbsolutePath) - val readback = spark.read.option("samplingRatio", 0.1).json(path.getCanonicalPath) - - assert(readback.schema == new StructType().add("f1", LongType)) + val readback1 = spark.read.option("samplingRatio", 0.1).json(path.getCanonicalPath) + assert(readback1.schema == new StructType().add("f1", LongType)) + + withClue("SPARK-32621: 'path' option can cause issues while inferring schema") { + // During infer, "path" option gets added again to the paths that have already been listed. + // This results in reading more data than necessary and causes different schema to be + // inferred when sampling ratio is involved. + val readback2 = spark.read + .option("samplingRatio", 0.1).option("path", path.getCanonicalPath) + .format("json").load + assert(readback2.schema == new StructType().add("f1", LongType)) + } }) } @@ -2239,7 +2265,7 @@ abstract class JsonSuite extends QueryTest with SharedSparkSession with TestJson .count() } - assertExceptionMessage(exception, "Malformed records are detected in record parsing") + assert(exception.getMessage.contains("Malformed records are detected in record parsing")) } def checkEncoding(expectedEncoding: String, pathToJsonFiles: String, @@ -2489,7 +2515,7 @@ abstract class JsonSuite extends QueryTest with SharedSparkSession with TestJson .json(testFile("test-data/utf16LE.json")) .count() } - assert(exception.getMessage.contains("encoding must not be included in the blacklist")) + assert(exception.getMessage.contains("encoding must not be included in the denyList")) } } @@ -2611,7 +2637,9 @@ abstract class JsonSuite extends QueryTest with SharedSparkSession with TestJson } test("inferring timestamp type") { - def schemaOf(jsons: String*): StructType = spark.read.json(jsons.toDS).schema + def schemaOf(jsons: String*): StructType = { + spark.read.option("inferTimestamp", true).json(jsons.toDS).schema + } assert(schemaOf( """{"a":"2018-12-17T10:11:12.123-01:00"}""", @@ -2634,6 +2662,7 @@ abstract class JsonSuite extends QueryTest with SharedSparkSession with TestJson val timestampsWithFormatPath = s"${dir.getCanonicalPath}/timestampsWithFormat.json" val timestampsWithFormat = spark.read .option("timestampFormat", "dd/MM/yyyy HH:mm") + .option("inferTimestamp", true) .json(datesRecords) assert(timestampsWithFormat.schema === customSchema) @@ -2646,6 +2675,7 @@ abstract class JsonSuite extends QueryTest with SharedSparkSession with TestJson val readBack = spark.read .option("timestampFormat", "yyyy-MM-dd HH:mm:ss") .option(DateTimeUtils.TIMEZONE_OPTION, "UTC") + .option("inferTimestamp", true) .json(timestampsWithFormatPath) assert(readBack.schema === customSchema) @@ -2685,6 +2715,215 @@ abstract class JsonSuite extends QueryTest with SharedSparkSession with TestJson checkAnswer(json, Row(null)) } } + + test("filters push down") { + withTempPath { path => + val t = "2019-12-17 00:01:02" + Seq( + """{"c0": "abc", "c1": {"c2": 1, "c3": "2019-11-14 20:35:30"}}""", + s"""{"c0": "def", "c1": {"c2": 2, "c3": "$t"}}""", + s"""{"c0": "defa", "c1": {"c2": 3, "c3": "$t"}}""", + s"""{"c0": "define", "c1": {"c2": 2, "c3": "$t"}}""").toDF("data") + .repartition(1) + .write.text(path.getAbsolutePath) + Seq(true, false).foreach { filterPushdown => + withSQLConf(SQLConf.JSON_FILTER_PUSHDOWN_ENABLED.key -> filterPushdown.toString) { + Seq("PERMISSIVE", "DROPMALFORMED", "FAILFAST").foreach { mode => + val readback = spark.read + .option("mode", mode) + .option("timestampFormat", "yyyy-MM-dd HH:mm:ss") + .schema("c0 string, c1 struct") + .json(path.getAbsolutePath) + .where($"c1.c2" === 2 && $"c0".startsWith("def")) + .select($"c1.c3") + assert(readback.count() === 2) + checkAnswer(readback, Seq(Row(Timestamp.valueOf(t)), Row(Timestamp.valueOf(t)))) + } + } + } + } + } + + test("apply filters to malformed rows") { + withSQLConf(SQLConf.JSON_FILTER_PUSHDOWN_ENABLED.key -> "true") { + withTempPath { path => + Seq( + "{}", + """{"invalid": 0}""", + """{"i":}""", + """{"i": 0}""", + """{"i": 1, "t": "2020-01-28 01:00:00"}""", + """{"t": "2020-01-28 02:00:00"}""", + """{"i": "abc", "t": "2020-01-28 03:00:00"}""", + """{"i": 2, "t": "2020-01-28 04:00:00", "d": 3.14}""").toDF("data") + .repartition(1) + .write.text(path.getAbsolutePath) + val schema = "i INTEGER, t TIMESTAMP" + val readback = spark.read + .schema(schema) + .option("timestampFormat", "yyyy-MM-dd HH:mm:ss") + .json(path.getAbsolutePath) + // readback: + // +----+-------------------+ + // |i |t | + // +----+-------------------+ + // |null|null | + // |null|null | + // |null|null | + // |0 |null | + // |1 |2020-01-28 01:00:00| + // |null|2020-01-28 02:00:00| + // |null|2020-01-28 03:00:00| + // |2 |2020-01-28 04:00:00| + // +----+-------------------+ + checkAnswer( + readback.where($"i".isNull && $"t".isNotNull), + Seq( + Row(null, Timestamp.valueOf("2020-01-28 02:00:00")), + Row(null, Timestamp.valueOf("2020-01-28 03:00:00")))) + checkAnswer( + readback.where($"i" >= 0 && $"t" > "2020-01-28 00:00:00"), + Seq( + Row(1, Timestamp.valueOf("2020-01-28 01:00:00")), + Row(2, Timestamp.valueOf("2020-01-28 04:00:00")))) + checkAnswer( + readback.where($"t".isNull).select($"i"), + Seq(Row(null), Row(null), Row(null), Row(0))) + } + } + } + + test("case sensitivity of filters references") { + Seq(true, false).foreach { filterPushdown => + withSQLConf(SQLConf.JSON_FILTER_PUSHDOWN_ENABLED.key -> filterPushdown.toString) { + withTempPath { path => + Seq( + """{"aaa": 0, "BBB": 1}""", + """{"AAA": 2, "bbb": 3}""").toDF().write.text(path.getCanonicalPath) + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + val readback = spark.read.schema("aaa integer, BBB integer") + .json(path.getCanonicalPath) + checkAnswer(readback, Seq(Row(null, null), Row(0, 1))) + checkAnswer(readback.filter($"AAA" === 0 && $"bbb" === 1), Seq(Row(0, 1))) + checkAnswer(readback.filter($"AAA" === 2 && $"bbb" === 3), Seq()) + // Schema inferring + val errorMsg = intercept[AnalysisException] { + spark.read.json(path.getCanonicalPath).collect() + }.getMessage + assert(errorMsg.contains("Found duplicate column(s) in the data schema")) + } + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + val readback = spark.read.schema("aaa integer, BBB integer") + .json(path.getCanonicalPath) + checkAnswer(readback, Seq(Row(null, null), Row(0, 1))) + val errorMsg = intercept[AnalysisException] { + readback.filter($"AAA" === 0 && $"bbb" === 1).collect() + }.getMessage + assert(errorMsg.contains("cannot resolve 'AAA'")) + // Schema inferring + val readback2 = spark.read.json(path.getCanonicalPath) + checkAnswer( + readback2.filter($"AAA" === 2).select($"AAA", $"bbb"), + Seq(Row(2, 3))) + checkAnswer(readback2.filter($"aaa" === 2).select($"AAA", $"bbb"), Seq()) + } + } + } + } + } + + test("SPARK-32810: JSON data source should be able to read files with " + + "escaped glob metacharacter in the paths") { + withTempDir { dir => + val basePath = dir.getCanonicalPath + // test JSON writer / reader without specifying schema + val jsonTableName = "{def}" + spark.range(3).coalesce(1).write.json(s"$basePath/$jsonTableName") + val readback = spark.read + .json(s"$basePath/${"""(\[|\]|\{|\})""".r.replaceAllIn(jsonTableName, """\\$1""")}") + assert(readback.collect sameElements Array(Row(0), Row(1), Row(2))) + } + } + + test("SPARK-35047: Write Non-ASCII character as codepoint") { + // scalastyle:off nonascii + withTempPaths(2) { paths => + paths.foreach(_.delete()) + val seq = Seq("a", "\n", "\u3042") + val df = seq.toDF + + val basePath1 = paths(0).getCanonicalPath + df.write.option("writeNonAsciiCharacterAsCodePoint", "true") + .option("pretty", "false").json(basePath1) + val actualText1 = spark.read.option("wholetext", "true").text(basePath1) + .sort("value").map(_.getString(0)).collect().mkString + val expectedText1 = + s"""{"value":"\\n"} + |{"value":"\\u3042"} + |{"value":"a"} + |""".stripMargin + assert(actualText1 === expectedText1) + + val actualJson1 = spark.read.json(basePath1) + .sort("value").map(_.getString(0)).collect().mkString + val expectedJson1 = "\na\u3042" + assert(actualJson1 === expectedJson1) + + // Test for pretty printed JSON. + // If multiLine option is set to true, the format should be should be + // one JSON record per file. So LEAF_NODE_DEFAULT_PARALLELISM is set here. + withSQLConf(SQLConf.LEAF_NODE_DEFAULT_PARALLELISM.key -> s"${seq.length}") { + val basePath2 = paths(1).getCanonicalPath + df.write.option("writeNonAsciiCharacterAsCodePoint", "true") + .option("pretty", "true").json(basePath2) + val actualText2 = spark.read.option("wholetext", "true").text(basePath2) + .sort("value").map(_.getString(0)).collect().mkString + val expectedText2 = + s"""{ + | "value" : "\\n" + |} + |{ + | "value" : "\\u3042" + |} + |{ + | "value" : "a" + |} + |""".stripMargin + assert(actualText2 === expectedText2) + + val actualJson2 = spark.read.option("multiLine", "true").json(basePath2) + .sort("value").map(_.getString(0)).collect().mkString + val expectedJson2 = "\na\u3042" + assert(actualJson2 === expectedJson2) + } + } + // scalastyle:on nonascii + } + + test("SPARK-35104: Fix wrong indentation for multiple JSON even if `pretty` option is true") { + withSQLConf(SQLConf.LEAF_NODE_DEFAULT_PARALLELISM.key -> "1") { + withTempPath { path => + val basePath = path.getCanonicalPath + val df = Seq("a", "b", "c").toDF + df.write.option("pretty", "true").json(basePath) + + val expectedText = + s"""{ + | "value" : "a" + |} + |{ + | "value" : "b" + |} + |{ + | "value" : "c" + |} + |""".stripMargin + val actualText = spark.read.option("wholetext", "true") + .text(basePath).map(_.getString(0)).collect().mkString + assert(actualText === expectedText) + } + } + } } class JsonV1Suite extends JsonSuite { @@ -2699,6 +2938,37 @@ class JsonV2Suite extends JsonSuite { super .sparkConf .set(SQLConf.USE_V1_SOURCE_LIST, "") + + test("get pushed filters") { + val attr = "col" + def getBuilder(path: String): JsonScanBuilder = { + val fileIndex = new InMemoryFileIndex( + spark, + Seq(new org.apache.hadoop.fs.Path(path, "file.json")), + Map.empty, + None, + NoopCache) + val schema = new StructType().add(attr, IntegerType) + val options = CaseInsensitiveStringMap.empty() + new JsonScanBuilder(spark, fileIndex, schema, schema, options) + } + val filters: Array[sources.Filter] = Array(sources.IsNotNull(attr)) + withSQLConf(SQLConf.JSON_FILTER_PUSHDOWN_ENABLED.key -> "true") { + withTempPath { file => + val scanBuilder = getBuilder(file.getCanonicalPath) + assert(scanBuilder.pushFilters(filters) === filters) + assert(scanBuilder.pushedFilters() === filters) + } + } + + withSQLConf(SQLConf.JSON_FILTER_PUSHDOWN_ENABLED.key -> "false") { + withTempPath { file => + val scanBuilder = getBuilder(file.getCanonicalPath) + assert(scanBuilder.pushFilters(filters) === filters) + assert(scanBuilder.pushedFilters() === Array.empty[sources.Filter]) + } + } + } } class JsonLegacyTimeParserSuite extends JsonSuite { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcColumnarBatchReaderSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcColumnarBatchReaderSuite.scala index 719bf91e1786b..bfcef46339908 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcColumnarBatchReaderSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcColumnarBatchReaderSuite.scala @@ -17,16 +17,29 @@ package org.apache.spark.sql.execution.datasources.orc +import java.io.File + +import org.apache.hadoop.fs.Path +import org.apache.hadoop.mapreduce.{JobID, TaskAttemptID, TaskID, TaskType} +import org.apache.hadoop.mapreduce.lib.input.FileSplit +import org.apache.hadoop.mapreduce.task.TaskAttemptContextImpl import org.apache.orc.TypeDescription import org.apache.spark.sql.QueryTest import org.apache.spark.sql.catalyst.InternalRow +import org.apache.spark.sql.catalyst.expressions.GenericInternalRow +import org.apache.spark.sql.catalyst.util.DateTimeUtils +import org.apache.spark.sql.execution.datasources.parquet.SpecificParquetRecordReaderBase import org.apache.spark.sql.execution.vectorized.{OnHeapColumnVector, WritableColumnVector} import org.apache.spark.sql.test.SharedSparkSession -import org.apache.spark.sql.types.{StructField, StructType} +import org.apache.spark.sql.types._ +import org.apache.spark.unsafe.types.UTF8String import org.apache.spark.unsafe.types.UTF8String.fromString class OrcColumnarBatchReaderSuite extends QueryTest with SharedSparkSession { + + import testImplicits._ + private val dataSchema = StructType.fromDDL("col1 int, col2 int") private val partitionSchema = StructType.fromDDL("p1 string, p2 string") private val partitionValues = InternalRow(fromString("partValue1"), fromString("partValue2")) @@ -77,4 +90,66 @@ class OrcColumnarBatchReaderSuite extends QueryTest with SharedSparkSession { assert(p1.getUTF8String(0) === partitionValues.getUTF8String(0)) } } + + test("SPARK-33593: partition column types") { + withTempPath { dir => + Seq(1).toDF().repartition(1).write.orc(dir.getCanonicalPath) + + val dataTypes = + Seq(StringType, BooleanType, ByteType, BinaryType, ShortType, IntegerType, LongType, + FloatType, DoubleType, DecimalType(25, 5), DateType, TimestampType) + + val constantValues = + Seq( + UTF8String.fromString("a string"), + true, + 1.toByte, + "Spark SQL".getBytes, + 2.toShort, + 3, + Long.MaxValue, + 0.25.toFloat, + 0.75D, + Decimal("1234.23456"), + DateTimeUtils.fromJavaDate(java.sql.Date.valueOf("2015-01-01")), + DateTimeUtils.fromJavaTimestamp(java.sql.Timestamp.valueOf("2015-01-01 23:50:59.123"))) + + dataTypes.zip(constantValues).foreach { case (dt, v) => + val schema = StructType(StructField("col1", IntegerType) :: StructField("pcol", dt) :: Nil) + val partitionValues = new GenericInternalRow(Array(v)) + val file = new File(SpecificParquetRecordReaderBase.listDirectory(dir).get(0)) + val fileSplit = new FileSplit(new Path(file.getCanonicalPath), 0L, file.length, Array.empty) + val taskConf = sqlContext.sessionState.newHadoopConf() + val orcFileSchema = TypeDescription.fromString(schema.simpleString) + val vectorizedReader = new OrcColumnarBatchReader(4096) + val attemptId = new TaskAttemptID(new TaskID(new JobID(), TaskType.MAP, 0), 0) + val taskAttemptContext = new TaskAttemptContextImpl(taskConf, attemptId) + + try { + vectorizedReader.initialize(fileSplit, taskAttemptContext) + vectorizedReader.initBatch( + orcFileSchema, + schema.toArray, + Array(0, -1), + Array(-1, 0), + partitionValues) + vectorizedReader.nextKeyValue() + val row = vectorizedReader.getCurrentValue.getRow(0) + + // Use `GenericMutableRow` by explicitly copying rather than `ColumnarBatch` + // in order to use get(...) method which is not implemented in `ColumnarBatch`. + val actual = row.copy().get(1, dt) + val expected = v + if (dt.isInstanceOf[BinaryType]) { + assert(actual.asInstanceOf[Array[Byte]] + sameElements expected.asInstanceOf[Array[Byte]]) + } else { + assert(actual == expected) + } + } finally { + vectorizedReader.close() + } + } + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcEncryptionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcEncryptionSuite.scala new file mode 100644 index 0000000000000..ed7a11c923f01 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcEncryptionSuite.scala @@ -0,0 +1,162 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.datasources.orc + +import java.util.Random + +import org.apache.orc.impl.HadoopShimsFactory + +import org.apache.spark.sql.Row +import org.apache.spark.sql.test.SharedSparkSession + +class OrcEncryptionSuite extends OrcTest with SharedSparkSession { + import testImplicits._ + + val originalData = Seq(("123456789", "dongjoon@apache.org", "Dongjoon Hyun")) + val rowDataWithoutKey = + Row(null, "841626795E7D351555B835A002E3BF10669DE9B81C95A3D59E10865AC37EA7C3", "Dongjoon Hyun") + + test("Write and read an encrypted file") { + val conf = spark.sessionState.newHadoopConf() + val provider = HadoopShimsFactory.get.getHadoopKeyProvider(conf, new Random) + assume(!provider.getKeyNames.isEmpty, + s"$provider doesn't has the test keys. ORC shim is created with old Hadoop libraries") + + val df = originalData.toDF("ssn", "email", "name") + + withTempPath { dir => + val path = dir.getAbsolutePath + withSQLConf( + "hadoop.security.key.provider.path" -> "test:///", + "orc.key.provider" -> "hadoop", + "orc.encrypt" -> "pii:ssn,email", + "orc.mask" -> "nullify:ssn;sha256:email") { + df.write.mode("overwrite").orc(path) + checkAnswer(spark.read.orc(path), df) + } + + withSQLConf( + "orc.key.provider" -> "memory", + "orc.encrypt" -> "pii:ssn,email", + "orc.mask" -> "nullify:ssn;sha256:email") { + checkAnswer(spark.read.orc(path), rowDataWithoutKey) + } + } + } + + test("Write and read an encrypted table") { + val conf = spark.sessionState.newHadoopConf() + val provider = HadoopShimsFactory.get.getHadoopKeyProvider(conf, new Random) + assume(!provider.getKeyNames.isEmpty, + s"$provider doesn't has the test keys. ORC shim is created with old Hadoop libraries") + + val df = originalData.toDF("ssn", "email", "name") + + withTempDir { dir => + val path = dir.getAbsolutePath + withTable("encrypted") { + sql( + s""" + |CREATE TABLE encrypted ( + | ssn STRING, + | email STRING, + | name STRING + |) + |USING ORC + |LOCATION "$path" + |OPTIONS ( + | hadoop.security.key.provider.path "test:///", + | orc.key.provider "hadoop", + | orc.encrypt "pii:ssn,email", + | orc.mask "nullify:ssn;sha256:email" + |) + |""".stripMargin) + sql("INSERT INTO encrypted VALUES('123456789', 'dongjoon@apache.org', 'Dongjoon Hyun')") + checkAnswer(sql("SELECT * FROM encrypted"), df) + } + withTable("normal") { + sql( + s""" + |CREATE TABLE normal ( + | ssn STRING, + | email STRING, + | name STRING + |) + |USING ORC + |LOCATION "$path" + |OPTIONS ( + | orc.key.provider "memory", + | orc.encrypt "pii:ssn,email", + | orc.mask "nullify:ssn;sha256:email" + |) + |""".stripMargin) + checkAnswer(sql("SELECT * FROM normal"), rowDataWithoutKey) + } + } + } + + test("SPARK-35325: Write and read encrypted nested columns") { + val conf = spark.sessionState.newHadoopConf() + val provider = HadoopShimsFactory.get.getHadoopKeyProvider(conf, new Random) + assume(!provider.getKeyNames.isEmpty, + s"$provider doesn't has the test keys. ORC shim is created with old Hadoop libraries") + + val originalNestedData = Row(1, Row("123456789", "dongjoon@apache.org", "Dongjoon")) + val rowNestedDataWithoutKey = + Row(1, Row(null, "841626795E7D351555B835A002E3BF10669DE9B81C95A3D59E10865AC37EA7C3", + "Dongjoon")) + + withTempDir { dir => + val path = dir.getAbsolutePath + withTable("encrypted") { + sql( + s""" + |CREATE TABLE encrypted ( + | id INT, + | contact struct + |) + |USING ORC + |LOCATION "$path" + |OPTIONS ( + | hadoop.security.key.provider.path "test:///", + | orc.key.provider "hadoop", + | orc.encrypt "pii:contact.ssn,contact.email", + | orc.mask "nullify:contact.ssn;sha256:contact.email" + |) + |""".stripMargin) + sql("INSERT INTO encrypted VALUES(1, ('123456789', 'dongjoon@apache.org', 'Dongjoon'))") + checkAnswer(sql("SELECT * FROM encrypted"), originalNestedData) + } + withTable("normal") { + sql( + s""" + |CREATE TABLE normal ( + | id INT, + | contact struct + |) + |USING ORC + |LOCATION "$path" + |OPTIONS ( + | orc.key.provider "memory" + |) + |""".stripMargin) + checkAnswer(sql("SELECT * FROM normal"), rowNestedDataWithoutKey) + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilterSuite.scala new file mode 100644 index 0000000000000..681ed91afaa12 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilterSuite.scala @@ -0,0 +1,673 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.datasources.orc + +import java.math.MathContext +import java.nio.charset.StandardCharsets +import java.sql.{Date, Timestamp} + +import scala.collection.JavaConverters._ + +import org.apache.hadoop.hive.ql.io.sarg.{PredicateLeaf, SearchArgument} +import org.apache.hadoop.hive.ql.io.sarg.SearchArgumentFactory.newBuilder + +import org.apache.spark.{SparkConf, SparkException} +import org.apache.spark.sql.{AnalysisException, Column, DataFrame, Row} +import org.apache.spark.sql.catalyst.dsl.expressions._ +import org.apache.spark.sql.catalyst.expressions._ +import org.apache.spark.sql.catalyst.planning.PhysicalOperation +import org.apache.spark.sql.execution.datasources.v2.DataSourceV2ScanRelation +import org.apache.spark.sql.execution.datasources.v2.orc.OrcScan +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types._ + +/** + * A test suite that tests Apache ORC filter API based filter pushdown optimization. + */ +class OrcFilterSuite extends OrcTest with SharedSparkSession { + + override protected def sparkConf: SparkConf = + super + .sparkConf + .set(SQLConf.USE_V1_SOURCE_LIST, "") + + protected def checkFilterPredicate( + df: DataFrame, + predicate: Predicate, + checker: (SearchArgument) => Unit): Unit = { + val output = predicate.collect { case a: Attribute => a }.distinct + val query = df + .select(output.map(e => Column(e)): _*) + .where(Column(predicate)) + + query.queryExecution.optimizedPlan match { + case PhysicalOperation(_, filters, DataSourceV2ScanRelation(_, o: OrcScan, _)) => + assert(filters.nonEmpty, "No filter is analyzed from the given query") + assert(o.pushedFilters.nonEmpty, "No filter is pushed down") + val maybeFilter = OrcFilters.createFilter(query.schema, o.pushedFilters) + assert(maybeFilter.isDefined, s"Couldn't generate filter predicate for ${o.pushedFilters}") + checker(maybeFilter.get) + + case _ => + throw new AnalysisException("Can not match OrcTable in the query.") + } + } + + protected def checkFilterPredicate + (predicate: Predicate, filterOperator: PredicateLeaf.Operator) + (implicit df: DataFrame): Unit = { + def checkComparisonOperator(filter: SearchArgument) = { + val operator = filter.getLeaves.asScala + assert(operator.map(_.getOperator).contains(filterOperator)) + } + checkFilterPredicate(df, predicate, checkComparisonOperator) + } + + protected def checkFilterPredicate + (predicate: Predicate, stringExpr: String) + (implicit df: DataFrame): Unit = { + def checkLogicalOperator(filter: SearchArgument) = { + assert(filter.toString == stringExpr) + } + checkFilterPredicate(df, predicate, checkLogicalOperator) + } + + test("filter pushdown - integer") { + withNestedOrcDataFrame((1 to 4).map(i => Tuple1(Option(i)))) { case (inputDF, colName, _) => + implicit val df: DataFrame = inputDF + + val intAttr = df(colName).expr + assert(df(colName).expr.dataType === IntegerType) + + checkFilterPredicate(intAttr.isNull, PredicateLeaf.Operator.IS_NULL) + + checkFilterPredicate(intAttr === 1, PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(intAttr <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) + + checkFilterPredicate(intAttr < 2, PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(intAttr > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(intAttr <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(intAttr >= 4, PredicateLeaf.Operator.LESS_THAN) + + checkFilterPredicate(Literal(1) === intAttr, PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(Literal(1) <=> intAttr, PredicateLeaf.Operator.NULL_SAFE_EQUALS) + checkFilterPredicate(Literal(2) > intAttr, PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(Literal(3) < intAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal(1) >= intAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal(4) <= intAttr, PredicateLeaf.Operator.LESS_THAN) + } + } + + test("filter pushdown - long") { + withNestedOrcDataFrame( + (1 to 4).map(i => Tuple1(Option(i.toLong)))) { case (inputDF, colName, _) => + implicit val df: DataFrame = inputDF + + val longAttr = df(colName).expr + assert(df(colName).expr.dataType === LongType) + + checkFilterPredicate(longAttr.isNull, PredicateLeaf.Operator.IS_NULL) + + checkFilterPredicate(longAttr === 1, PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(longAttr <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) + + checkFilterPredicate(longAttr < 2, PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(longAttr > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(longAttr <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(longAttr >= 4, PredicateLeaf.Operator.LESS_THAN) + + checkFilterPredicate(Literal(1) === longAttr, PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(Literal(1) <=> longAttr, PredicateLeaf.Operator.NULL_SAFE_EQUALS) + checkFilterPredicate(Literal(2) > longAttr, PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(Literal(3) < longAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal(1) >= longAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal(4) <= longAttr, PredicateLeaf.Operator.LESS_THAN) + } + } + + test("filter pushdown - float") { + withNestedOrcDataFrame( + (1 to 4).map(i => Tuple1(Option(i.toFloat)))) { case (inputDF, colName, _) => + implicit val df: DataFrame = inputDF + + val floatAttr = df(colName).expr + assert(df(colName).expr.dataType === FloatType) + + checkFilterPredicate(floatAttr.isNull, PredicateLeaf.Operator.IS_NULL) + + checkFilterPredicate(floatAttr === 1, PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(floatAttr <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) + + checkFilterPredicate(floatAttr < 2, PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(floatAttr > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(floatAttr <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(floatAttr >= 4, PredicateLeaf.Operator.LESS_THAN) + + checkFilterPredicate(Literal(1) === floatAttr, PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(Literal(1) <=> floatAttr, PredicateLeaf.Operator.NULL_SAFE_EQUALS) + checkFilterPredicate(Literal(2) > floatAttr, PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(Literal(3) < floatAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal(1) >= floatAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal(4) <= floatAttr, PredicateLeaf.Operator.LESS_THAN) + } + } + + test("filter pushdown - double") { + withNestedOrcDataFrame( + (1 to 4).map(i => Tuple1(Option(i.toDouble)))) { case (inputDF, colName, _) => + implicit val df: DataFrame = inputDF + + val doubleAttr = df(colName).expr + assert(df(colName).expr.dataType === DoubleType) + + checkFilterPredicate(doubleAttr.isNull, PredicateLeaf.Operator.IS_NULL) + + checkFilterPredicate(doubleAttr === 1, PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(doubleAttr <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) + + checkFilterPredicate(doubleAttr < 2, PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(doubleAttr > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(doubleAttr <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(doubleAttr >= 4, PredicateLeaf.Operator.LESS_THAN) + + checkFilterPredicate(Literal(1) === doubleAttr, PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(Literal(1) <=> doubleAttr, PredicateLeaf.Operator.NULL_SAFE_EQUALS) + checkFilterPredicate(Literal(2) > doubleAttr, PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(Literal(3) < doubleAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal(1) >= doubleAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal(4) <= doubleAttr, PredicateLeaf.Operator.LESS_THAN) + } + } + + test("filter pushdown - string") { + withNestedOrcDataFrame( + (1 to 4).map(i => Tuple1(i.toString))) { case (inputDF, colName, _) => + implicit val df: DataFrame = inputDF + + val strAttr = df(colName).expr + assert(df(colName).expr.dataType === StringType) + + checkFilterPredicate(strAttr.isNull, PredicateLeaf.Operator.IS_NULL) + + checkFilterPredicate(strAttr === "1", PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(strAttr <=> "1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) + + checkFilterPredicate(strAttr < "2", PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(strAttr > "3", PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(strAttr <= "1", PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(strAttr >= "4", PredicateLeaf.Operator.LESS_THAN) + + checkFilterPredicate(Literal("1") === strAttr, PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(Literal("1") <=> strAttr, PredicateLeaf.Operator.NULL_SAFE_EQUALS) + checkFilterPredicate(Literal("2") > strAttr, PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(Literal("3") < strAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal("1") >= strAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal("4") <= strAttr, PredicateLeaf.Operator.LESS_THAN) + } + } + + test("filter pushdown - boolean") { + withNestedOrcDataFrame( + (true :: false :: Nil).map(b => Tuple1.apply(Option(b)))) { case (inputDF, colName, _) => + implicit val df: DataFrame = inputDF + + val booleanAttr = df(colName).expr + assert(df(colName).expr.dataType === BooleanType) + + checkFilterPredicate(booleanAttr.isNull, PredicateLeaf.Operator.IS_NULL) + + checkFilterPredicate(booleanAttr === true, PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(booleanAttr <=> true, PredicateLeaf.Operator.NULL_SAFE_EQUALS) + + checkFilterPredicate(booleanAttr < true, PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(booleanAttr > false, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(booleanAttr <= false, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(booleanAttr >= false, PredicateLeaf.Operator.LESS_THAN) + + checkFilterPredicate(Literal(false) === booleanAttr, PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(Literal(false) <=> booleanAttr, + PredicateLeaf.Operator.NULL_SAFE_EQUALS) + checkFilterPredicate(Literal(false) > booleanAttr, PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(Literal(true) < booleanAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal(true) >= booleanAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal(true) <= booleanAttr, PredicateLeaf.Operator.LESS_THAN) + } + } + + test("filter pushdown - decimal") { + withNestedOrcDataFrame( + (1 to 4).map(i => Tuple1.apply(BigDecimal.valueOf(i)))) { case (inputDF, colName, _) => + implicit val df: DataFrame = inputDF + + val decimalAttr = df(colName).expr + assert(df(colName).expr.dataType === DecimalType(38, 18)) + + checkFilterPredicate(decimalAttr.isNull, PredicateLeaf.Operator.IS_NULL) + + checkFilterPredicate(decimalAttr === BigDecimal.valueOf(1), PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(decimalAttr <=> BigDecimal.valueOf(1), + PredicateLeaf.Operator.NULL_SAFE_EQUALS) + + checkFilterPredicate(decimalAttr < BigDecimal.valueOf(2), PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(decimalAttr > BigDecimal.valueOf(3), + PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(decimalAttr <= BigDecimal.valueOf(1), + PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(decimalAttr >= BigDecimal.valueOf(4), PredicateLeaf.Operator.LESS_THAN) + + checkFilterPredicate( + Literal(BigDecimal.valueOf(1)) === decimalAttr, PredicateLeaf.Operator.EQUALS) + checkFilterPredicate( + Literal(BigDecimal.valueOf(1)) <=> decimalAttr, PredicateLeaf.Operator.NULL_SAFE_EQUALS) + checkFilterPredicate( + Literal(BigDecimal.valueOf(2)) > decimalAttr, PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate( + Literal(BigDecimal.valueOf(3)) < decimalAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate( + Literal(BigDecimal.valueOf(1)) >= decimalAttr, PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate( + Literal(BigDecimal.valueOf(4)) <= decimalAttr, PredicateLeaf.Operator.LESS_THAN) + } + } + + test("filter pushdown - timestamp") { + val input = Seq( + "1000-01-01 01:02:03", + "1582-10-01 00:11:22", + "1900-01-01 23:59:59", + "2020-05-25 10:11:12").map(Timestamp.valueOf) + + withOrcFile(input.map(Tuple1(_))) { path => + Seq(false, true).foreach { java8Api => + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> java8Api.toString) { + readFile(path) { implicit df => + val timestamps = input.map(Literal(_)) + checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) + + checkFilterPredicate($"_1" === timestamps(0), PredicateLeaf.Operator.EQUALS) + checkFilterPredicate($"_1" <=> timestamps(0), PredicateLeaf.Operator.NULL_SAFE_EQUALS) + + checkFilterPredicate($"_1" < timestamps(1), PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate($"_1" > timestamps(2), PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate($"_1" <= timestamps(0), PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate($"_1" >= timestamps(3), PredicateLeaf.Operator.LESS_THAN) + + checkFilterPredicate(Literal(timestamps(0)) === $"_1", PredicateLeaf.Operator.EQUALS) + checkFilterPredicate( + Literal(timestamps(0)) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) + checkFilterPredicate(Literal(timestamps(1)) > $"_1", PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate( + Literal(timestamps(2)) < $"_1", + PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate( + Literal(timestamps(0)) >= $"_1", + PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(Literal(timestamps(3)) <= $"_1", PredicateLeaf.Operator.LESS_THAN) + } + } + } + } + } + + test("filter pushdown - combinations with logical operators") { + withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i)))) { implicit df => + checkFilterPredicate( + $"_1".isNotNull, + "leaf-0 = (IS_NULL _1), expr = (not leaf-0)" + ) + checkFilterPredicate( + $"_1" =!= 1, + "leaf-0 = (IS_NULL _1), leaf-1 = (EQUALS _1 1), expr = (and (not leaf-0) (not leaf-1))" + ) + checkFilterPredicate( + !($"_1" < 4), + "leaf-0 = (IS_NULL _1), leaf-1 = (LESS_THAN _1 4), expr = (and (not leaf-0) (not leaf-1))" + ) + checkFilterPredicate( + $"_1" < 2 || $"_1" > 3, + "leaf-0 = (LESS_THAN _1 2), leaf-1 = (LESS_THAN_EQUALS _1 3), " + + "expr = (or leaf-0 (not leaf-1))" + ) + checkFilterPredicate( + $"_1" < 2 && $"_1" > 3, + "leaf-0 = (IS_NULL _1), leaf-1 = (LESS_THAN _1 2), leaf-2 = (LESS_THAN_EQUALS _1 3), " + + "expr = (and (not leaf-0) leaf-1 (not leaf-2))" + ) + } + } + + test("filter pushdown - date") { + val input = Seq("2017-08-18", "2017-08-19", "2017-08-20", "2017-08-21").map { day => + Date.valueOf(day) + } + withOrcFile(input.map(Tuple1(_))) { path => + Seq(false, true).foreach { java8Api => + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> java8Api.toString) { + readFile(path) { implicit df => + val dates = input.map(Literal(_)) + checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) + + checkFilterPredicate($"_1" === dates(0), PredicateLeaf.Operator.EQUALS) + checkFilterPredicate($"_1" <=> dates(0), PredicateLeaf.Operator.NULL_SAFE_EQUALS) + + checkFilterPredicate($"_1" < dates(1), PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate($"_1" > dates(2), PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate($"_1" <= dates(0), PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate($"_1" >= dates(3), PredicateLeaf.Operator.LESS_THAN) + + checkFilterPredicate(dates(0) === $"_1", PredicateLeaf.Operator.EQUALS) + checkFilterPredicate(dates(0) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) + checkFilterPredicate(dates(1) > $"_1", PredicateLeaf.Operator.LESS_THAN) + checkFilterPredicate(dates(2) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(dates(0) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) + checkFilterPredicate(dates(3) <= $"_1", PredicateLeaf.Operator.LESS_THAN) + } + } + } + } + } + + test("no filter pushdown - non-supported types") { + implicit class IntToBinary(int: Int) { + def b: Array[Byte] = int.toString.getBytes(StandardCharsets.UTF_8) + } + // ArrayType + withOrcDataFrame((1 to 4).map(i => Tuple1(Array(i)))) { implicit df => + checkNoFilterPredicate($"_1".isNull, noneSupported = true) + } + // BinaryType + withOrcDataFrame((1 to 4).map(i => Tuple1(i.b))) { implicit df => + checkNoFilterPredicate($"_1" <=> 1.b, noneSupported = true) + } + // MapType + withOrcDataFrame((1 to 4).map(i => Tuple1(Map(i -> i)))) { implicit df => + checkNoFilterPredicate($"_1".isNotNull, noneSupported = true) + } + } + + test("SPARK-12218 and SPARK-25699 Converting conjunctions into ORC SearchArguments") { + import org.apache.spark.sql.sources._ + // The `LessThan` should be converted while the `StringContains` shouldn't + val schema = new StructType( + Array( + StructField("a", IntegerType, nullable = true), + StructField("b", StringType, nullable = true))) + assertResult("leaf-0 = (LESS_THAN a 10), expr = leaf-0") { + OrcFilters.createFilter(schema, Array( + LessThan("a", 10), + StringContains("b", "prefix") + )).get.toString + } + + // The `LessThan` should be converted while the whole inner `And` shouldn't + assertResult("leaf-0 = (LESS_THAN a 10), expr = leaf-0") { + OrcFilters.createFilter(schema, Array( + LessThan("a", 10), + Not(And( + GreaterThan("a", 1), + StringContains("b", "prefix") + )) + )).get.toString + } + + // Safely remove unsupported `StringContains` predicate and push down `LessThan` + assertResult("leaf-0 = (LESS_THAN a 10), expr = leaf-0") { + OrcFilters.createFilter(schema, Array( + And( + LessThan("a", 10), + StringContains("b", "prefix") + ) + )).get.toString + } + + // Safely remove unsupported `StringContains` predicate, push down `LessThan` and `GreaterThan`. + assertResult("leaf-0 = (LESS_THAN a 10), leaf-1 = (LESS_THAN_EQUALS a 1)," + + " expr = (and leaf-0 (not leaf-1))") { + OrcFilters.createFilter(schema, Array( + And( + And( + LessThan("a", 10), + StringContains("b", "prefix") + ), + GreaterThan("a", 1) + ) + )).get.toString + } + } + + test("SPARK-27699 Converting disjunctions into ORC SearchArguments") { + import org.apache.spark.sql.sources._ + // The `LessThan` should be converted while the `StringContains` shouldn't + val schema = new StructType( + Array( + StructField("a", IntegerType, nullable = true), + StructField("b", StringType, nullable = true))) + + // The predicate `StringContains` predicate is not able to be pushed down. + assertResult("leaf-0 = (LESS_THAN_EQUALS a 10), leaf-1 = (LESS_THAN a 1)," + + " expr = (or (not leaf-0) leaf-1)") { + OrcFilters.createFilter(schema, Array( + Or( + GreaterThan("a", 10), + And( + StringContains("b", "prefix"), + LessThan("a", 1) + ) + ) + )).get.toString + } + + assertResult("leaf-0 = (LESS_THAN_EQUALS a 10), leaf-1 = (LESS_THAN a 1)," + + " expr = (or (not leaf-0) leaf-1)") { + OrcFilters.createFilter(schema, Array( + Or( + And( + GreaterThan("a", 10), + StringContains("b", "foobar") + ), + And( + StringContains("b", "prefix"), + LessThan("a", 1) + ) + ) + )).get.toString + } + + assert(OrcFilters.createFilter(schema, Array( + Or( + StringContains("b", "foobar"), + And( + StringContains("b", "prefix"), + LessThan("a", 1) + ) + ) + )).isEmpty) + } + + test("SPARK-27160: Fix casting of the DecimalType literal") { + import org.apache.spark.sql.sources._ + val schema = StructType(Array(StructField("a", DecimalType(3, 2)))) + assertResult("leaf-0 = (LESS_THAN a 3.14), expr = leaf-0") { + OrcFilters.createFilter(schema, Array( + LessThan( + "a", + new java.math.BigDecimal(3.14, MathContext.DECIMAL64).setScale(2))) + ).get.toString + } + } + + test("SPARK-32622: case sensitivity in predicate pushdown") { + withTempPath { dir => + val count = 10 + val tableName = "spark_32622" + val tableDir1 = dir.getAbsoluteFile + "/table1" + + // Physical ORC files have both `A` and `a` fields. + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + spark.range(count).repartition(count).selectExpr("id - 1 as A", "id as a") + .write.mode("overwrite").orc(tableDir1) + } + + // Metastore table has both `A` and `a` fields too. + withTable(tableName) { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + sql( + s""" + |CREATE TABLE $tableName (A LONG, a LONG) USING ORC LOCATION '$tableDir1' + """.stripMargin) + + checkAnswer(sql(s"select a, A from $tableName"), (0 until count).map(c => Row(c, c - 1))) + + val actual1 = stripSparkFilter(sql(s"select A from $tableName where A < 0")) + assert(actual1.count() == 1) + + val actual2 = stripSparkFilter(sql(s"select A from $tableName where a < 0")) + assert(actual2.count() == 0) + } + + // Exception thrown for ambiguous case. + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + val e = intercept[AnalysisException] { + sql(s"select a from $tableName where a < 0").collect() + } + assert(e.getMessage.contains( + "Reference 'a' is ambiguous")) + } + } + + // Metastore table has only `A` field. + withTable(tableName) { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + sql( + s""" + |CREATE TABLE $tableName (A LONG) USING ORC LOCATION '$tableDir1' + """.stripMargin) + + val e = intercept[SparkException] { + sql(s"select A from $tableName where A < 0").collect() + } + assert(e.getCause.isInstanceOf[RuntimeException] && e.getCause.getMessage.contains( + """Found duplicate field(s) "A": [A, a] in case-insensitive mode""")) + } + } + + // Physical ORC files have only `A` field. + val tableDir2 = dir.getAbsoluteFile + "/table2" + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + spark.range(count).repartition(count).selectExpr("id - 1 as A") + .write.mode("overwrite").orc(tableDir2) + } + + withTable(tableName) { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + sql( + s""" + |CREATE TABLE $tableName (a LONG) USING ORC LOCATION '$tableDir2' + """.stripMargin) + + checkAnswer(sql(s"select a from $tableName"), (0 until count).map(c => Row(c - 1))) + + val actual = stripSparkFilter(sql(s"select a from $tableName where a < 0")) + assert(actual.count() == 1) + } + } + + withTable(tableName) { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + sql( + s""" + |CREATE TABLE $tableName (A LONG) USING ORC LOCATION '$tableDir2' + """.stripMargin) + + checkAnswer(sql(s"select A from $tableName"), (0 until count).map(c => Row(c - 1))) + + val actual = stripSparkFilter(sql(s"select A from $tableName where A < 0")) + assert(actual.count() == 1) + } + } + } + } + + test("SPARK-32646: Case-insensitive field resolution for pushdown when reading ORC") { + import org.apache.spark.sql.sources._ + + def getOrcFilter( + schema: StructType, + filters: Seq[Filter], + caseSensitive: String): Option[SearchArgument] = { + var orcFilter: Option[SearchArgument] = None + withSQLConf(SQLConf.CASE_SENSITIVE.key -> caseSensitive) { + orcFilter = + OrcFilters.createFilter(schema, filters) + } + orcFilter + } + + def testFilter( + schema: StructType, + filters: Seq[Filter], + expected: SearchArgument): Unit = { + val caseSensitiveFilters = getOrcFilter(schema, filters, "true") + val caseInsensitiveFilters = getOrcFilter(schema, filters, "false") + + assert(caseSensitiveFilters.isEmpty) + assert(caseInsensitiveFilters.isDefined) + + assert(caseInsensitiveFilters.get.getLeaves().size() > 0) + assert(caseInsensitiveFilters.get.getLeaves().size() == expected.getLeaves().size()) + (0 until expected.getLeaves().size()).foreach { index => + assert(caseInsensitiveFilters.get.getLeaves().get(index) == expected.getLeaves().get(index)) + } + } + + val schema1 = StructType(Seq(StructField("cint", IntegerType))) + testFilter(schema1, Seq(GreaterThan("CINT", 1)), + newBuilder.startNot() + .lessThanEquals("cint", OrcFilters.getPredicateLeafType(IntegerType), 1L).`end`().build()) + testFilter(schema1, Seq( + And(GreaterThan("CINT", 1), EqualTo("Cint", 2))), + newBuilder.startAnd() + .startNot() + .lessThanEquals("cint", OrcFilters.getPredicateLeafType(IntegerType), 1L).`end`() + .equals("cint", OrcFilters.getPredicateLeafType(IntegerType), 2L) + .`end`().build()) + + // Nested column case + val schema2 = StructType(Seq(StructField("a", + StructType(Seq(StructField("cint", IntegerType)))))) + + testFilter(schema2, Seq(GreaterThan("A.CINT", 1)), + newBuilder.startNot() + .lessThanEquals("a.cint", OrcFilters.getPredicateLeafType(IntegerType), 1L).`end`().build()) + testFilter(schema2, Seq(GreaterThan("a.CINT", 1)), + newBuilder.startNot() + .lessThanEquals("a.cint", OrcFilters.getPredicateLeafType(IntegerType), 1L).`end`().build()) + testFilter(schema2, Seq(GreaterThan("A.cint", 1)), + newBuilder.startNot() + .lessThanEquals("a.cint", OrcFilters.getPredicateLeafType(IntegerType), 1L).`end`().build()) + testFilter(schema2, Seq( + And(GreaterThan("a.CINT", 1), EqualTo("a.Cint", 2))), + newBuilder.startAnd() + .startNot() + .lessThanEquals("a.cint", OrcFilters.getPredicateLeafType(IntegerType), 1L).`end`() + .equals("a.cint", OrcFilters.getPredicateLeafType(IntegerType), 2L) + .`end`().build()) + } +} + diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcQuerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcQuerySuite.scala index 60f278b8e5bb0..ead2c2cf1b70f 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcQuerySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcQuerySuite.scala @@ -34,7 +34,6 @@ import org.apache.orc.mapreduce.OrcInputFormat import org.apache.spark.{SparkConf, SparkException} import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.TableIdentifier -import org.apache.spark.sql.execution.adaptive.AdaptiveTestUtils.assertExceptionMessage import org.apache.spark.sql.execution.datasources.{HadoopFsRelation, LogicalRelation, RecordReaderIterator} import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession @@ -137,7 +136,7 @@ abstract class OrcQueryTest extends OrcTest { assertResult(10) { sql("SELECT name, contacts FROM t where age > 5") .rdd - .flatMap(_.getAs[Seq[_]]("contacts")) + .flatMap(_.getAs[scala.collection.Seq[_]]("contacts")) .count() } @@ -149,7 +148,7 @@ abstract class OrcQueryTest extends OrcTest { val df = sql("SELECT name, contacts FROM t WHERE age > 5 AND age < 8") assert(df.count() === 2) assertResult(4) { - df.rdd.flatMap(_.getAs[Seq[_]]("contacts")).count() + df.rdd.flatMap(_.getAs[scala.collection.Seq[_]]("contacts")).count() } } @@ -161,7 +160,7 @@ abstract class OrcQueryTest extends OrcTest { val df = sql("SELECT name, contacts FROM t WHERE age < 2 OR age > 8") assert(df.count() === 3) assertResult(6) { - df.rdd.flatMap(_.getAs[Seq[_]]("contacts")).count() + df.rdd.flatMap(_.getAs[scala.collection.Seq[_]]("contacts")).count() } } } @@ -218,7 +217,6 @@ abstract class OrcQueryTest extends OrcTest { } } - // Hive supports zlib, snappy and none for Hive 1.2.1. test("Compression options for writing to an ORC file (SNAPPY, ZLIB and NONE)") { withTempPath { file => spark.range(0, 10).write @@ -599,19 +597,19 @@ abstract class OrcQueryTest extends OrcTest { val e1 = intercept[SparkException] { testIgnoreCorruptFiles() } - assertExceptionMessage(e1, "Malformed ORC file") + assert(e1.getMessage.contains("Malformed ORC file")) val e2 = intercept[SparkException] { testIgnoreCorruptFilesWithoutSchemaInfer() } - assertExceptionMessage(e2, "Malformed ORC file") + assert(e2.getMessage.contains("Malformed ORC file")) val e3 = intercept[SparkException] { testAllCorruptFiles() } - assertExceptionMessage(e3, "Could not read footer for file") + assert(e3.getMessage.contains("Could not read footer for file")) val e4 = intercept[SparkException] { testAllCorruptFilesWithoutSchemaInfer() } - assertExceptionMessage(e4, "Malformed ORC file") + assert(e4.getMessage.contains("Malformed ORC file")) } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala index 73873684f6aaf..eee8e2ecc9fbd 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcSourceSuite.scala @@ -33,7 +33,8 @@ import org.scalatest.BeforeAndAfterAll import org.apache.spark.{SPARK_VERSION_SHORT, SparkException} import org.apache.spark.sql.{Row, SPARK_VERSION_METADATA_KEY} -import org.apache.spark.sql.execution.datasources.SchemaMergeUtils +import org.apache.spark.sql.execution.FileSourceScanExec +import org.apache.spark.sql.execution.datasources.{CommonFileDataSourceSuite, SchemaMergeUtils} import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types.{LongType, StructField, StructType} @@ -41,9 +42,11 @@ import org.apache.spark.util.Utils case class OrcData(intField: Int, stringField: String) -abstract class OrcSuite extends OrcTest with BeforeAndAfterAll { +abstract class OrcSuite extends OrcTest with BeforeAndAfterAll with CommonFileDataSourceSuite { import testImplicits._ + override protected def dataSourceFormat = "orc" + var orcTableDir: File = null var orcTableAsDir: File = null @@ -120,8 +123,7 @@ abstract class OrcSuite extends OrcTest with BeforeAndAfterAll { } } - protected def testSelectiveDictionaryEncoding(isSelective: Boolean, - isHive23: Boolean = false): Unit = { + protected def testSelectiveDictionaryEncoding(isSelective: Boolean, isHiveOrc: Boolean): Unit = { val tableName = "orcTable" withTempDir { dir => @@ -174,7 +176,7 @@ abstract class OrcSuite extends OrcTest with BeforeAndAfterAll { // Hive 0.11 and RLE v2 is introduced in Hive 0.12 ORC with more improvements. // For more details, see https://orc.apache.org/specification/ assert(stripe.getColumns(1).getKind === DICTIONARY_V2) - if (isSelective || isHive23) { + if (isSelective || isHiveOrc) { assert(stripe.getColumns(2).getKind === DIRECT_V2) } else { assert(stripe.getColumns(2).getKind === DICTIONARY_V2) @@ -213,9 +215,7 @@ abstract class OrcSuite extends OrcTest with BeforeAndAfterAll { Seq(fs.listStatus(path1), fs.listStatus(path2), fs.listStatus(path3)).flatten val schema = SchemaMergeUtils.mergeSchemasInParallel( - spark, - fileStatuses, - schemaReader) + spark, Map.empty, fileStatuses, schemaReader) assert(schema.isDefined) assert(schema.get == StructType(Seq( @@ -338,7 +338,7 @@ abstract class OrcSuite extends OrcTest with BeforeAndAfterAll { } // Test all the valid options of spark.sql.orc.compression.codec - Seq("NONE", "UNCOMPRESSED", "SNAPPY", "ZLIB", "LZO").foreach { c => + Seq("NONE", "UNCOMPRESSED", "SNAPPY", "ZLIB", "LZO", "ZSTD").foreach { c => withSQLConf(SQLConf.ORC_COMPRESSION.key -> c) { val expected = if (c == "UNCOMPRESSED") "NONE" else c assert(new OrcOptions(Map.empty[String, String], conf).compressionCodec == expected) @@ -543,6 +543,7 @@ abstract class OrcSuite extends OrcTest with BeforeAndAfterAll { } class OrcSourceSuite extends OrcSuite with SharedSparkSession { + import testImplicits._ protected override def beforeAll(): Unit = { super.beforeAll() @@ -583,7 +584,7 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession { } test("Enforce direct encoding column-wise selectively") { - testSelectiveDictionaryEncoding(isSelective = true) + testSelectiveDictionaryEncoding(isSelective = true, isHiveOrc = false) } test("SPARK-11412 read and merge orc schemas in parallel") { @@ -595,4 +596,57 @@ class OrcSourceSuite extends OrcSuite with SharedSparkSession { val df = readResourceOrcFile("test-data/TestStringDictionary.testRowIndex.orc") assert(df.where("str < 'row 001000'").count() === 1000) } + + test("SPARK-33978: Write and read a file with ZSTD compression") { + withTempPath { dir => + val path = dir.getAbsolutePath + spark.range(3).write.option("compression", "zstd").orc(path) + checkAnswer(spark.read.orc(path), Seq(Row(0), Row(1), Row(2))) + val files = OrcUtils.listOrcFiles(path, spark.sessionState.newHadoopConf()) + assert(files.nonEmpty && files.forall(_.getName.contains("zstd"))) + } + } + + test("SPARK-34862: Support ORC vectorized reader for nested column") { + withTempPath { dir => + val path = dir.getCanonicalPath + val df = spark.range(10).map { x => + val stringColumn = s"$x" * 10 + val structColumn = (x, s"$x" * 100) + val arrayColumn = (0 until 5).map(i => (x + i, s"$x" * 5)) + val mapColumn = Map( + s"$x" -> (x * 0.1, (x, s"$x" * 100)), + (s"$x" * 2) -> (x * 0.2, (x, s"$x" * 200)), + (s"$x" * 3) -> (x * 0.3, (x, s"$x" * 300))) + (x, stringColumn, structColumn, arrayColumn, mapColumn) + }.toDF("int_col", "string_col", "struct_col", "array_col", "map_col") + df.write.format("orc").save(path) + + withSQLConf(SQLConf.ORC_VECTORIZED_READER_NESTED_COLUMN_ENABLED.key -> "true") { + val readDf = spark.read.orc(path) + val vectorizationEnabled = readDf.queryExecution.executedPlan.find { + case scan: FileSourceScanExec => scan.supportsColumnar + case _ => false + }.isDefined + assert(vectorizationEnabled) + checkAnswer(readDf, df) + } + } + } + + test("SPARK-34897: Support reconcile schemas based on index after nested column pruning") { + withTable("t1") { + spark.sql( + """ + |CREATE TABLE t1 ( + | _col0 INT, + | _col1 STRING, + | _col2 STRUCT) + |USING ORC + |""".stripMargin) + + spark.sql("INSERT INTO t1 values(1, '2', struct('a', 'b', 'c', 10L))") + checkAnswer(spark.sql("SELECT _col0, _col2.c1 FROM t1"), Seq(Row(1, "a"))) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcTest.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcTest.scala index e929f904c798d..4243318ac1dd8 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcTest.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcTest.scala @@ -46,7 +46,6 @@ import org.apache.spark.sql.internal.SQLConf.ORC_IMPLEMENTATION * -> OrcPartitionDiscoverySuite * -> HiveOrcPartitionDiscoverySuite * -> OrcFilterSuite - * -> HiveOrcFilterSuite */ abstract class OrcTest extends QueryTest with FileBasedDataSourceTest with BeforeAndAfterAll { @@ -143,4 +142,26 @@ abstract class OrcTest extends QueryTest with FileBasedDataSourceTest with Befor FileUtils.copyURLToFile(url, file) spark.read.orc(file.getAbsolutePath) } + + /** + * Takes a sequence of products `data` to generate multi-level nested + * dataframes as new test data. It tests both non-nested and nested dataframes + * which are written and read back with Orc datasource. + * + * This is different from [[withOrcDataFrame]] which does not + * test nested cases. + */ + protected def withNestedOrcDataFrame[T <: Product: ClassTag: TypeTag](data: Seq[T]) + (runTest: (DataFrame, String, Any => Any) => Unit): Unit = + withNestedOrcDataFrame(spark.createDataFrame(data))(runTest) + + protected def withNestedOrcDataFrame(inputDF: DataFrame) + (runTest: (DataFrame, String, Any => Any) => Unit): Unit = { + withNestedDataFrame(inputDF).foreach { case (newDF, colName, resultFun) => + withTempPath { file => + newDF.write.format(dataSourceName).save(file.getCanonicalPath) + readFile(file.getCanonicalPath, true) { df => runTest(df, colName, resultFun) } + } + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcV2SchemaPruningSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcV2SchemaPruningSuite.scala index 6c9bd32913178..378b52f9c6c8c 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcV2SchemaPruningSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcV2SchemaPruningSuite.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.execution.datasources.orc import org.apache.spark.SparkConf -import org.apache.spark.sql.{DataFrame, Row} +import org.apache.spark.sql.DataFrame import org.apache.spark.sql.catalyst.parser.CatalystSqlParser import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper import org.apache.spark.sql.execution.datasources.SchemaPruningSuite diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetCommitterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetCommitterSuite.scala index 4b2437803d645..7f408dbba5099 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetCommitterSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetCommitterSuite.scala @@ -17,8 +17,6 @@ package org.apache.spark.sql.execution.datasources.parquet -import java.io.FileNotFoundException - import org.apache.hadoop.conf.Configuration import org.apache.hadoop.fs.{FileStatus, Path} import org.apache.hadoop.mapreduce.{JobContext, TaskAttemptContext} @@ -149,7 +147,7 @@ private object MarkingFileOutput { * @param outputPath destination directory * @param conf configuration to create the FS with * @return the status of the marker - * @throws FileNotFoundException if the marker is absent + * @throws java.io.FileNotFoundException if the marker is absent */ def checkMarker(outputPath: Path, conf: Configuration): FileStatus = { outputPath.getFileSystem(conf).getFileStatus(new Path(outputPath, "marker")) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormatSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormatSuite.scala index e65f4d12bf7f2..c52b57eb31e4d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormatSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFileFormatSuite.scala @@ -19,12 +19,19 @@ package org.apache.spark.sql.execution.datasources.parquet import org.apache.hadoop.fs.{FileSystem, Path} -import org.apache.spark.SparkException +import org.apache.spark.{SparkConf, SparkException} import org.apache.spark.sql.QueryTest +import org.apache.spark.sql.execution.datasources.CommonFileDataSourceSuite import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession -class ParquetFileFormatSuite extends QueryTest with ParquetTest with SharedSparkSession { +abstract class ParquetFileFormatSuite + extends QueryTest + with ParquetTest + with SharedSparkSession + with CommonFileDataSourceSuite { + + override protected def dataSourceFormat = "parquet" test("read parquet footers in parallel") { def testReadFooters(ignoreCorruptFiles: Boolean): Unit = { @@ -57,3 +64,17 @@ class ParquetFileFormatSuite extends QueryTest with ParquetTest with SharedSpark assert(exception.getMessage().contains("Could not read footer for file")) } } + +class ParquetFileFormatV1Suite extends ParquetFileFormatSuite { + override protected def sparkConf: SparkConf = + super + .sparkConf + .set(SQLConf.USE_V1_SOURCE_LIST, "parquet") +} + +class ParquetFileFormatV2Suite extends ParquetFileFormatSuite { + override protected def sparkConf: SparkConf = + super + .sparkConf + .set(SQLConf.USE_V1_SOURCE_LIST, "") +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala index 5cf21293fd07f..94bda56bc8738 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilterSuite.scala @@ -20,11 +20,17 @@ package org.apache.spark.sql.execution.datasources.parquet import java.math.{BigDecimal => JBigDecimal} import java.nio.charset.StandardCharsets import java.sql.{Date, Timestamp} -import java.time.LocalDate +import java.time.{LocalDate, LocalDateTime, ZoneId} +import scala.reflect.ClassTag +import scala.reflect.runtime.universe.TypeTag + +import org.apache.hadoop.fs.Path import org.apache.parquet.filter2.predicate.{FilterApi, FilterPredicate, Operators} import org.apache.parquet.filter2.predicate.FilterApi._ import org.apache.parquet.filter2.predicate.Operators.{Column => _, _} +import org.apache.parquet.hadoop.{ParquetFileReader, ParquetInputFormat, ParquetOutputFormat} +import org.apache.parquet.hadoop.util.HadoopInputFile import org.apache.parquet.schema.MessageType import org.apache.spark.{SparkConf, SparkException} @@ -42,7 +48,8 @@ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.internal.SQLConf.ParquetOutputTimestampType import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types._ -import org.apache.spark.util.{AccumulatorContext, AccumulatorV2} +import org.apache.spark.tags.ExtendedSQLTest +import org.apache.spark.util.{AccumulatorContext, AccumulatorV2, Utils} /** * A test suite that tests Parquet filter2 API based filter pushdown optimization. @@ -106,44 +113,31 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared } /** - * Takes single level `inputDF` dataframe to generate multi-level nested - * dataframes as new test data. + * Takes a sequence of products `data` to generate multi-level nested + * dataframes as new test data. It tests both non-nested and nested dataframes + * which are written and read back with Parquet datasource. + * + * This is different from [[ParquetTest.withParquetDataFrame]] which does not + * test nested cases. */ - private def withNestedDataFrame(inputDF: DataFrame) + private def withNestedParquetDataFrame[T <: Product: ClassTag: TypeTag](data: Seq[T]) + (runTest: (DataFrame, String, Any => Any) => Unit): Unit = + withNestedParquetDataFrame(spark.createDataFrame(data))(runTest) + + private def withNestedParquetDataFrame(inputDF: DataFrame) (runTest: (DataFrame, String, Any => Any) => Unit): Unit = { - assert(inputDF.schema.fields.length == 1) - assert(!inputDF.schema.fields.head.dataType.isInstanceOf[StructType]) - val df = inputDF.toDF("temp") - Seq( - ( - df.withColumnRenamed("temp", "a"), - "a", // zero nesting - (x: Any) => x), - ( - df.withColumn("a", struct(df("temp") as "b")).drop("temp"), - "a.b", // one level nesting - (x: Any) => Row(x)), - ( - df.withColumn("a", struct(struct(df("temp") as "c") as "b")).drop("temp"), - "a.b.c", // two level nesting - (x: Any) => Row(Row(x)) - ), - ( - df.withColumnRenamed("temp", "a.b"), - "`a.b`", // zero nesting with column name containing `dots` - (x: Any) => x - ), - ( - df.withColumn("a.b", struct(df("temp") as "c.d") ).drop("temp"), - "`a.b`.`c.d`", // one level nesting with column names containing `dots` - (x: Any) => Row(x) - ) - ).foreach { case (df, colName, resultFun) => - runTest(df, colName, resultFun) + withNestedDataFrame(inputDF).foreach { case (newDF, colName, resultFun) => + withTempPath { file => + newDF.write.format(dataSourceName).save(file.getCanonicalPath) + readParquetFile(file.getCanonicalPath) { df => runTest(df, colName, resultFun) } + } } } - private def testTimestampPushdown(data: Seq[Timestamp]): Unit = { + private def testTimestampPushdown(data: Seq[String], java8Api: Boolean): Unit = { + implicit class StringToTs(s: String) { + def ts: Timestamp = Timestamp.valueOf(s) + } assert(data.size === 4) val ts1 = data.head val ts2 = data(1) @@ -151,37 +145,49 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared val ts4 = data(3) import testImplicits._ - withNestedDataFrame(data.map(i => Tuple1(i)).toDF()) { case (inputDF, colName, resultFun) => - withParquetDataFrame(inputDF) { implicit df => - val tsAttr = df(colName).expr - assert(df(colName).expr.dataType === TimestampType) - - checkFilterPredicate(tsAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) - checkFilterPredicate(tsAttr.isNotNull, classOf[NotEq[_]], - data.map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(tsAttr === ts1, classOf[Eq[_]], resultFun(ts1)) - checkFilterPredicate(tsAttr <=> ts1, classOf[Eq[_]], resultFun(ts1)) - checkFilterPredicate(tsAttr =!= ts1, classOf[NotEq[_]], - Seq(ts2, ts3, ts4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(tsAttr < ts2, classOf[Lt[_]], resultFun(ts1)) - checkFilterPredicate(tsAttr > ts1, classOf[Gt[_]], - Seq(ts2, ts3, ts4).map(i => Row.apply(resultFun(i)))) - checkFilterPredicate(tsAttr <= ts1, classOf[LtEq[_]], resultFun(ts1)) - checkFilterPredicate(tsAttr >= ts4, classOf[GtEq[_]], resultFun(ts4)) - - checkFilterPredicate(Literal(ts1) === tsAttr, classOf[Eq[_]], resultFun(ts1)) - checkFilterPredicate(Literal(ts1) <=> tsAttr, classOf[Eq[_]], resultFun(ts1)) - checkFilterPredicate(Literal(ts2) > tsAttr, classOf[Lt[_]], resultFun(ts1)) - checkFilterPredicate(Literal(ts3) < tsAttr, classOf[Gt[_]], resultFun(ts4)) - checkFilterPredicate(Literal(ts1) >= tsAttr, classOf[LtEq[_]], resultFun(ts1)) - checkFilterPredicate(Literal(ts4) <= tsAttr, classOf[GtEq[_]], resultFun(ts4)) - - checkFilterPredicate(!(tsAttr < ts4), classOf[GtEq[_]], resultFun(ts4)) - checkFilterPredicate(tsAttr < ts2 || tsAttr > ts3, classOf[Operators.Or], - Seq(Row(resultFun(ts1)), Row(resultFun(ts4)))) + val df = data.map(i => Tuple1(Timestamp.valueOf(i))).toDF() + withNestedParquetDataFrame(df) { case (parquetDF, colName, fun) => + implicit val df: DataFrame = parquetDF + + def resultFun(tsStr: String): Any = { + val parsed = if (java8Api) { + LocalDateTime.parse(tsStr.replace(" ", "T")) + .atZone(ZoneId.systemDefault()) + .toInstant + } else { + Timestamp.valueOf(tsStr) + } + fun(parsed) } + + val tsAttr = df(colName).expr + assert(df(colName).expr.dataType === TimestampType) + + checkFilterPredicate(tsAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) + checkFilterPredicate(tsAttr.isNotNull, classOf[NotEq[_]], + data.map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(tsAttr === ts1.ts, classOf[Eq[_]], resultFun(ts1)) + checkFilterPredicate(tsAttr <=> ts1.ts, classOf[Eq[_]], resultFun(ts1)) + checkFilterPredicate(tsAttr =!= ts1.ts, classOf[NotEq[_]], + Seq(ts2, ts3, ts4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(tsAttr < ts2.ts, classOf[Lt[_]], resultFun(ts1)) + checkFilterPredicate(tsAttr > ts1.ts, classOf[Gt[_]], + Seq(ts2, ts3, ts4).map(i => Row.apply(resultFun(i)))) + checkFilterPredicate(tsAttr <= ts1.ts, classOf[LtEq[_]], resultFun(ts1)) + checkFilterPredicate(tsAttr >= ts4.ts, classOf[GtEq[_]], resultFun(ts4)) + + checkFilterPredicate(Literal(ts1.ts) === tsAttr, classOf[Eq[_]], resultFun(ts1)) + checkFilterPredicate(Literal(ts1.ts) <=> tsAttr, classOf[Eq[_]], resultFun(ts1)) + checkFilterPredicate(Literal(ts2.ts) > tsAttr, classOf[Lt[_]], resultFun(ts1)) + checkFilterPredicate(Literal(ts3.ts) < tsAttr, classOf[Gt[_]], resultFun(ts4)) + checkFilterPredicate(Literal(ts1.ts) >= tsAttr, classOf[LtEq[_]], resultFun(ts1)) + checkFilterPredicate(Literal(ts4.ts) <= tsAttr, classOf[GtEq[_]], resultFun(ts4)) + + checkFilterPredicate(!(tsAttr < ts4.ts), classOf[GtEq[_]], resultFun(ts4)) + checkFilterPredicate(tsAttr < ts2.ts || tsAttr > ts3.ts, classOf[Operators.Or], + Seq(Row(resultFun(ts1)), Row(resultFun(ts4)))) } } @@ -212,272 +218,264 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared test("filter pushdown - boolean") { val data = (true :: false :: Nil).map(b => Tuple1.apply(Option(b))) - import testImplicits._ - withNestedDataFrame(data.toDF()) { case (inputDF, colName, resultFun) => - withParquetDataFrame(inputDF) { implicit df => - val booleanAttr = df(colName).expr - assert(df(colName).expr.dataType === BooleanType) - - checkFilterPredicate(booleanAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) - checkFilterPredicate(booleanAttr.isNotNull, classOf[NotEq[_]], - Seq(Row(resultFun(true)), Row(resultFun(false)))) - - checkFilterPredicate(booleanAttr === true, classOf[Eq[_]], resultFun(true)) - checkFilterPredicate(booleanAttr <=> true, classOf[Eq[_]], resultFun(true)) - checkFilterPredicate(booleanAttr =!= true, classOf[NotEq[_]], resultFun(false)) - } + withNestedParquetDataFrame(data) { case (inputDF, colName, resultFun) => + implicit val df: DataFrame = inputDF + + val booleanAttr = df(colName).expr + assert(df(colName).expr.dataType === BooleanType) + + checkFilterPredicate(booleanAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) + checkFilterPredicate(booleanAttr.isNotNull, classOf[NotEq[_]], + Seq(Row(resultFun(true)), Row(resultFun(false)))) + + checkFilterPredicate(booleanAttr === true, classOf[Eq[_]], resultFun(true)) + checkFilterPredicate(booleanAttr <=> true, classOf[Eq[_]], resultFun(true)) + checkFilterPredicate(booleanAttr =!= true, classOf[NotEq[_]], resultFun(false)) } } test("filter pushdown - tinyint") { val data = (1 to 4).map(i => Tuple1(Option(i.toByte))) - import testImplicits._ - withNestedDataFrame(data.toDF()) { case (inputDF, colName, resultFun) => - withParquetDataFrame(inputDF) { implicit df => - val tinyIntAttr = df(colName).expr - assert(df(colName).expr.dataType === ByteType) - - checkFilterPredicate(tinyIntAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) - checkFilterPredicate(tinyIntAttr.isNotNull, classOf[NotEq[_]], - (1 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(tinyIntAttr === 1.toByte, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(tinyIntAttr <=> 1.toByte, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(tinyIntAttr =!= 1.toByte, classOf[NotEq[_]], - (2 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(tinyIntAttr < 2.toByte, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(tinyIntAttr > 3.toByte, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(tinyIntAttr <= 1.toByte, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(tinyIntAttr >= 4.toByte, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(Literal(1.toByte) === tinyIntAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(1.toByte) <=> tinyIntAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(2.toByte) > tinyIntAttr, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(Literal(3.toByte) < tinyIntAttr, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(Literal(1.toByte) >= tinyIntAttr, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(Literal(4.toByte) <= tinyIntAttr, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(!(tinyIntAttr < 4.toByte), classOf[GtEq[_]], resultFun(4)) - checkFilterPredicate(tinyIntAttr < 2.toByte || tinyIntAttr > 3.toByte, - classOf[Operators.Or], Seq(Row(resultFun(1)), Row(resultFun(4)))) - } + withNestedParquetDataFrame(data) { case (inputDF, colName, resultFun) => + implicit val df: DataFrame = inputDF + + val tinyIntAttr = df(colName).expr + assert(df(colName).expr.dataType === ByteType) + + checkFilterPredicate(tinyIntAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) + checkFilterPredicate(tinyIntAttr.isNotNull, classOf[NotEq[_]], + (1 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(tinyIntAttr === 1.toByte, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(tinyIntAttr <=> 1.toByte, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(tinyIntAttr =!= 1.toByte, classOf[NotEq[_]], + (2 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(tinyIntAttr < 2.toByte, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(tinyIntAttr > 3.toByte, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(tinyIntAttr <= 1.toByte, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(tinyIntAttr >= 4.toByte, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(Literal(1.toByte) === tinyIntAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(1.toByte) <=> tinyIntAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(2.toByte) > tinyIntAttr, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(Literal(3.toByte) < tinyIntAttr, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(Literal(1.toByte) >= tinyIntAttr, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(Literal(4.toByte) <= tinyIntAttr, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(!(tinyIntAttr < 4.toByte), classOf[GtEq[_]], resultFun(4)) + checkFilterPredicate(tinyIntAttr < 2.toByte || tinyIntAttr > 3.toByte, + classOf[Operators.Or], Seq(Row(resultFun(1)), Row(resultFun(4)))) } } test("filter pushdown - smallint") { val data = (1 to 4).map(i => Tuple1(Option(i.toShort))) - import testImplicits._ - withNestedDataFrame(data.toDF()) { case (inputDF, colName, resultFun) => - withParquetDataFrame(inputDF) { implicit df => - val smallIntAttr = df(colName).expr - assert(df(colName).expr.dataType === ShortType) - - checkFilterPredicate(smallIntAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) - checkFilterPredicate(smallIntAttr.isNotNull, classOf[NotEq[_]], - (1 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(smallIntAttr === 1.toShort, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(smallIntAttr <=> 1.toShort, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(smallIntAttr =!= 1.toShort, classOf[NotEq[_]], - (2 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(smallIntAttr < 2.toShort, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(smallIntAttr > 3.toShort, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(smallIntAttr <= 1.toShort, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(smallIntAttr >= 4.toShort, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(Literal(1.toShort) === smallIntAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(1.toShort) <=> smallIntAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(2.toShort) > smallIntAttr, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(Literal(3.toShort) < smallIntAttr, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(Literal(1.toShort) >= smallIntAttr, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(Literal(4.toShort) <= smallIntAttr, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(!(smallIntAttr < 4.toShort), classOf[GtEq[_]], resultFun(4)) - checkFilterPredicate(smallIntAttr < 2.toShort || smallIntAttr > 3.toShort, - classOf[Operators.Or], Seq(Row(resultFun(1)), Row(resultFun(4)))) - } + withNestedParquetDataFrame(data) { case (inputDF, colName, resultFun) => + implicit val df: DataFrame = inputDF + + val smallIntAttr = df(colName).expr + assert(df(colName).expr.dataType === ShortType) + + checkFilterPredicate(smallIntAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) + checkFilterPredicate(smallIntAttr.isNotNull, classOf[NotEq[_]], + (1 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(smallIntAttr === 1.toShort, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(smallIntAttr <=> 1.toShort, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(smallIntAttr =!= 1.toShort, classOf[NotEq[_]], + (2 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(smallIntAttr < 2.toShort, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(smallIntAttr > 3.toShort, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(smallIntAttr <= 1.toShort, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(smallIntAttr >= 4.toShort, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(Literal(1.toShort) === smallIntAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(1.toShort) <=> smallIntAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(2.toShort) > smallIntAttr, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(Literal(3.toShort) < smallIntAttr, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(Literal(1.toShort) >= smallIntAttr, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(Literal(4.toShort) <= smallIntAttr, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(!(smallIntAttr < 4.toShort), classOf[GtEq[_]], resultFun(4)) + checkFilterPredicate(smallIntAttr < 2.toShort || smallIntAttr > 3.toShort, + classOf[Operators.Or], Seq(Row(resultFun(1)), Row(resultFun(4)))) } } test("filter pushdown - integer") { val data = (1 to 4).map(i => Tuple1(Option(i))) - import testImplicits._ - withNestedDataFrame(data.toDF()) { case (inputDF, colName, resultFun) => - withParquetDataFrame(inputDF) { implicit df => - val intAttr = df(colName).expr - assert(df(colName).expr.dataType === IntegerType) - - checkFilterPredicate(intAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) - checkFilterPredicate(intAttr.isNotNull, classOf[NotEq[_]], - (1 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(intAttr === 1, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(intAttr <=> 1, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(intAttr =!= 1, classOf[NotEq[_]], - (2 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(intAttr < 2, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(intAttr > 3, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(intAttr <= 1, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(intAttr >= 4, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(Literal(1) === intAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(1) <=> intAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(2) > intAttr, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(Literal(3) < intAttr, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(Literal(1) >= intAttr, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(Literal(4) <= intAttr, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(!(intAttr < 4), classOf[GtEq[_]], resultFun(4)) - checkFilterPredicate(intAttr < 2 || intAttr > 3, classOf[Operators.Or], - Seq(Row(resultFun(1)), Row(resultFun(4)))) - } + withNestedParquetDataFrame(data) { case (inputDF, colName, resultFun) => + implicit val df: DataFrame = inputDF + + val intAttr = df(colName).expr + assert(df(colName).expr.dataType === IntegerType) + + checkFilterPredicate(intAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) + checkFilterPredicate(intAttr.isNotNull, classOf[NotEq[_]], + (1 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(intAttr === 1, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(intAttr <=> 1, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(intAttr =!= 1, classOf[NotEq[_]], + (2 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(intAttr < 2, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(intAttr > 3, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(intAttr <= 1, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(intAttr >= 4, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(Literal(1) === intAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(1) <=> intAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(2) > intAttr, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(Literal(3) < intAttr, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(Literal(1) >= intAttr, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(Literal(4) <= intAttr, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(!(intAttr < 4), classOf[GtEq[_]], resultFun(4)) + checkFilterPredicate(intAttr < 2 || intAttr > 3, classOf[Operators.Or], + Seq(Row(resultFun(1)), Row(resultFun(4)))) } } test("filter pushdown - long") { val data = (1 to 4).map(i => Tuple1(Option(i.toLong))) - import testImplicits._ - withNestedDataFrame(data.toDF()) { case (inputDF, colName, resultFun) => - withParquetDataFrame(inputDF) { implicit df => - val longAttr = df(colName).expr - assert(df(colName).expr.dataType === LongType) - - checkFilterPredicate(longAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) - checkFilterPredicate(longAttr.isNotNull, classOf[NotEq[_]], - (1 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(longAttr === 1, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(longAttr <=> 1, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(longAttr =!= 1, classOf[NotEq[_]], - (2 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(longAttr < 2, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(longAttr > 3, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(longAttr <= 1, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(longAttr >= 4, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(Literal(1) === longAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(1) <=> longAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(2) > longAttr, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(Literal(3) < longAttr, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(Literal(1) >= longAttr, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(Literal(4) <= longAttr, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(!(longAttr < 4), classOf[GtEq[_]], resultFun(4)) - checkFilterPredicate(longAttr < 2 || longAttr > 3, classOf[Operators.Or], - Seq(Row(resultFun(1)), Row(resultFun(4)))) - } + withNestedParquetDataFrame(data) { case (inputDF, colName, resultFun) => + implicit val df: DataFrame = inputDF + + val longAttr = df(colName).expr + assert(df(colName).expr.dataType === LongType) + + checkFilterPredicate(longAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) + checkFilterPredicate(longAttr.isNotNull, classOf[NotEq[_]], + (1 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(longAttr === 1, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(longAttr <=> 1, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(longAttr =!= 1, classOf[NotEq[_]], + (2 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(longAttr < 2, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(longAttr > 3, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(longAttr <= 1, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(longAttr >= 4, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(Literal(1) === longAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(1) <=> longAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(2) > longAttr, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(Literal(3) < longAttr, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(Literal(1) >= longAttr, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(Literal(4) <= longAttr, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(!(longAttr < 4), classOf[GtEq[_]], resultFun(4)) + checkFilterPredicate(longAttr < 2 || longAttr > 3, classOf[Operators.Or], + Seq(Row(resultFun(1)), Row(resultFun(4)))) } } test("filter pushdown - float") { val data = (1 to 4).map(i => Tuple1(Option(i.toFloat))) - import testImplicits._ - withNestedDataFrame(data.toDF()) { case (inputDF, colName, resultFun) => - withParquetDataFrame(inputDF) { implicit df => - val floatAttr = df(colName).expr - assert(df(colName).expr.dataType === FloatType) - - checkFilterPredicate(floatAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) - checkFilterPredicate(floatAttr.isNotNull, classOf[NotEq[_]], - (1 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(floatAttr === 1, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(floatAttr <=> 1, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(floatAttr =!= 1, classOf[NotEq[_]], - (2 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(floatAttr < 2, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(floatAttr > 3, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(floatAttr <= 1, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(floatAttr >= 4, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(Literal(1) === floatAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(1) <=> floatAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(2) > floatAttr, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(Literal(3) < floatAttr, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(Literal(1) >= floatAttr, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(Literal(4) <= floatAttr, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(!(floatAttr < 4), classOf[GtEq[_]], resultFun(4)) - checkFilterPredicate(floatAttr < 2 || floatAttr > 3, classOf[Operators.Or], - Seq(Row(resultFun(1)), Row(resultFun(4)))) - } + withNestedParquetDataFrame(data) { case (inputDF, colName, resultFun) => + implicit val df: DataFrame = inputDF + + val floatAttr = df(colName).expr + assert(df(colName).expr.dataType === FloatType) + + checkFilterPredicate(floatAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) + checkFilterPredicate(floatAttr.isNotNull, classOf[NotEq[_]], + (1 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(floatAttr === 1, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(floatAttr <=> 1, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(floatAttr =!= 1, classOf[NotEq[_]], + (2 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(floatAttr < 2, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(floatAttr > 3, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(floatAttr <= 1, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(floatAttr >= 4, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(Literal(1) === floatAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(1) <=> floatAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(2) > floatAttr, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(Literal(3) < floatAttr, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(Literal(1) >= floatAttr, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(Literal(4) <= floatAttr, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(!(floatAttr < 4), classOf[GtEq[_]], resultFun(4)) + checkFilterPredicate(floatAttr < 2 || floatAttr > 3, classOf[Operators.Or], + Seq(Row(resultFun(1)), Row(resultFun(4)))) } } test("filter pushdown - double") { val data = (1 to 4).map(i => Tuple1(Option(i.toDouble))) - import testImplicits._ - withNestedDataFrame(data.toDF()) { case (inputDF, colName, resultFun) => - withParquetDataFrame(inputDF) { implicit df => - val doubleAttr = df(colName).expr - assert(df(colName).expr.dataType === DoubleType) - - checkFilterPredicate(doubleAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) - checkFilterPredicate(doubleAttr.isNotNull, classOf[NotEq[_]], - (1 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(doubleAttr === 1, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(doubleAttr <=> 1, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(doubleAttr =!= 1, classOf[NotEq[_]], - (2 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(doubleAttr < 2, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(doubleAttr > 3, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(doubleAttr <= 1, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(doubleAttr >= 4, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(Literal(1) === doubleAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(1) <=> doubleAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(2) > doubleAttr, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(Literal(3) < doubleAttr, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(Literal(1) >= doubleAttr, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(Literal(4) <= doubleAttr, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(!(doubleAttr < 4), classOf[GtEq[_]], resultFun(4)) - checkFilterPredicate(doubleAttr < 2 || doubleAttr > 3, classOf[Operators.Or], - Seq(Row(resultFun(1)), Row(resultFun(4)))) - } + withNestedParquetDataFrame(data) { case (inputDF, colName, resultFun) => + implicit val df: DataFrame = inputDF + + val doubleAttr = df(colName).expr + assert(df(colName).expr.dataType === DoubleType) + + checkFilterPredicate(doubleAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) + checkFilterPredicate(doubleAttr.isNotNull, classOf[NotEq[_]], + (1 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(doubleAttr === 1, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(doubleAttr <=> 1, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(doubleAttr =!= 1, classOf[NotEq[_]], + (2 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(doubleAttr < 2, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(doubleAttr > 3, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(doubleAttr <= 1, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(doubleAttr >= 4, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(Literal(1) === doubleAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(1) <=> doubleAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(2) > doubleAttr, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(Literal(3) < doubleAttr, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(Literal(1) >= doubleAttr, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(Literal(4) <= doubleAttr, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(!(doubleAttr < 4), classOf[GtEq[_]], resultFun(4)) + checkFilterPredicate(doubleAttr < 2 || doubleAttr > 3, classOf[Operators.Or], + Seq(Row(resultFun(1)), Row(resultFun(4)))) } } test("filter pushdown - string") { val data = (1 to 4).map(i => Tuple1(Option(i.toString))) - import testImplicits._ - withNestedDataFrame(data.toDF()) { case (inputDF, colName, resultFun) => - withParquetDataFrame(inputDF) { implicit df => - val stringAttr = df(colName).expr - assert(df(colName).expr.dataType === StringType) - - checkFilterPredicate(stringAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) - checkFilterPredicate(stringAttr.isNotNull, classOf[NotEq[_]], - (1 to 4).map(i => Row.apply(resultFun(i.toString)))) - - checkFilterPredicate(stringAttr === "1", classOf[Eq[_]], resultFun("1")) - checkFilterPredicate(stringAttr <=> "1", classOf[Eq[_]], resultFun("1")) - checkFilterPredicate(stringAttr =!= "1", classOf[NotEq[_]], - (2 to 4).map(i => Row.apply(resultFun(i.toString)))) - - checkFilterPredicate(stringAttr < "2", classOf[Lt[_]], resultFun("1")) - checkFilterPredicate(stringAttr > "3", classOf[Gt[_]], resultFun("4")) - checkFilterPredicate(stringAttr <= "1", classOf[LtEq[_]], resultFun("1")) - checkFilterPredicate(stringAttr >= "4", classOf[GtEq[_]], resultFun("4")) - - checkFilterPredicate(Literal("1") === stringAttr, classOf[Eq[_]], resultFun("1")) - checkFilterPredicate(Literal("1") <=> stringAttr, classOf[Eq[_]], resultFun("1")) - checkFilterPredicate(Literal("2") > stringAttr, classOf[Lt[_]], resultFun("1")) - checkFilterPredicate(Literal("3") < stringAttr, classOf[Gt[_]], resultFun("4")) - checkFilterPredicate(Literal("1") >= stringAttr, classOf[LtEq[_]], resultFun("1")) - checkFilterPredicate(Literal("4") <= stringAttr, classOf[GtEq[_]], resultFun("4")) - - checkFilterPredicate(!(stringAttr < "4"), classOf[GtEq[_]], resultFun("4")) - checkFilterPredicate(stringAttr < "2" || stringAttr > "3", classOf[Operators.Or], - Seq(Row(resultFun("1")), Row(resultFun("4")))) - } + withNestedParquetDataFrame(data) { case (inputDF, colName, resultFun) => + implicit val df: DataFrame = inputDF + + val stringAttr = df(colName).expr + assert(df(colName).expr.dataType === StringType) + + checkFilterPredicate(stringAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) + checkFilterPredicate(stringAttr.isNotNull, classOf[NotEq[_]], + (1 to 4).map(i => Row.apply(resultFun(i.toString)))) + + checkFilterPredicate(stringAttr === "1", classOf[Eq[_]], resultFun("1")) + checkFilterPredicate(stringAttr <=> "1", classOf[Eq[_]], resultFun("1")) + checkFilterPredicate(stringAttr =!= "1", classOf[NotEq[_]], + (2 to 4).map(i => Row.apply(resultFun(i.toString)))) + + checkFilterPredicate(stringAttr < "2", classOf[Lt[_]], resultFun("1")) + checkFilterPredicate(stringAttr > "3", classOf[Gt[_]], resultFun("4")) + checkFilterPredicate(stringAttr <= "1", classOf[LtEq[_]], resultFun("1")) + checkFilterPredicate(stringAttr >= "4", classOf[GtEq[_]], resultFun("4")) + + checkFilterPredicate(Literal("1") === stringAttr, classOf[Eq[_]], resultFun("1")) + checkFilterPredicate(Literal("1") <=> stringAttr, classOf[Eq[_]], resultFun("1")) + checkFilterPredicate(Literal("2") > stringAttr, classOf[Lt[_]], resultFun("1")) + checkFilterPredicate(Literal("3") < stringAttr, classOf[Gt[_]], resultFun("4")) + checkFilterPredicate(Literal("1") >= stringAttr, classOf[LtEq[_]], resultFun("1")) + checkFilterPredicate(Literal("4") <= stringAttr, classOf[GtEq[_]], resultFun("4")) + + checkFilterPredicate(!(stringAttr < "4"), classOf[GtEq[_]], resultFun("4")) + checkFilterPredicate(stringAttr < "2" || stringAttr > "3", classOf[Operators.Or], + Seq(Row(resultFun("1")), Row(resultFun("4")))) } } @@ -487,38 +485,37 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared } val data = (1 to 4).map(i => Tuple1(Option(i.b))) - import testImplicits._ - withNestedDataFrame(data.toDF()) { case (inputDF, colName, resultFun) => - withParquetDataFrame(inputDF) { implicit df => - val binaryAttr: Expression = df(colName).expr - assert(df(colName).expr.dataType === BinaryType) - - checkFilterPredicate(binaryAttr === 1.b, classOf[Eq[_]], resultFun(1.b)) - checkFilterPredicate(binaryAttr <=> 1.b, classOf[Eq[_]], resultFun(1.b)) - - checkFilterPredicate(binaryAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) - checkFilterPredicate(binaryAttr.isNotNull, classOf[NotEq[_]], - (1 to 4).map(i => Row.apply(resultFun(i.b)))) - - checkFilterPredicate(binaryAttr =!= 1.b, classOf[NotEq[_]], - (2 to 4).map(i => Row.apply(resultFun(i.b)))) - - checkFilterPredicate(binaryAttr < 2.b, classOf[Lt[_]], resultFun(1.b)) - checkFilterPredicate(binaryAttr > 3.b, classOf[Gt[_]], resultFun(4.b)) - checkFilterPredicate(binaryAttr <= 1.b, classOf[LtEq[_]], resultFun(1.b)) - checkFilterPredicate(binaryAttr >= 4.b, classOf[GtEq[_]], resultFun(4.b)) - - checkFilterPredicate(Literal(1.b) === binaryAttr, classOf[Eq[_]], resultFun(1.b)) - checkFilterPredicate(Literal(1.b) <=> binaryAttr, classOf[Eq[_]], resultFun(1.b)) - checkFilterPredicate(Literal(2.b) > binaryAttr, classOf[Lt[_]], resultFun(1.b)) - checkFilterPredicate(Literal(3.b) < binaryAttr, classOf[Gt[_]], resultFun(4.b)) - checkFilterPredicate(Literal(1.b) >= binaryAttr, classOf[LtEq[_]], resultFun(1.b)) - checkFilterPredicate(Literal(4.b) <= binaryAttr, classOf[GtEq[_]], resultFun(4.b)) - - checkFilterPredicate(!(binaryAttr < 4.b), classOf[GtEq[_]], resultFun(4.b)) - checkFilterPredicate(binaryAttr < 2.b || binaryAttr > 3.b, classOf[Operators.Or], - Seq(Row(resultFun(1.b)), Row(resultFun(4.b)))) - } + withNestedParquetDataFrame(data) { case (inputDF, colName, resultFun) => + implicit val df: DataFrame = inputDF + + val binaryAttr: Expression = df(colName).expr + assert(df(colName).expr.dataType === BinaryType) + + checkFilterPredicate(binaryAttr === 1.b, classOf[Eq[_]], resultFun(1.b)) + checkFilterPredicate(binaryAttr <=> 1.b, classOf[Eq[_]], resultFun(1.b)) + + checkFilterPredicate(binaryAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) + checkFilterPredicate(binaryAttr.isNotNull, classOf[NotEq[_]], + (1 to 4).map(i => Row.apply(resultFun(i.b)))) + + checkFilterPredicate(binaryAttr =!= 1.b, classOf[NotEq[_]], + (2 to 4).map(i => Row.apply(resultFun(i.b)))) + + checkFilterPredicate(binaryAttr < 2.b, classOf[Lt[_]], resultFun(1.b)) + checkFilterPredicate(binaryAttr > 3.b, classOf[Gt[_]], resultFun(4.b)) + checkFilterPredicate(binaryAttr <= 1.b, classOf[LtEq[_]], resultFun(1.b)) + checkFilterPredicate(binaryAttr >= 4.b, classOf[GtEq[_]], resultFun(4.b)) + + checkFilterPredicate(Literal(1.b) === binaryAttr, classOf[Eq[_]], resultFun(1.b)) + checkFilterPredicate(Literal(1.b) <=> binaryAttr, classOf[Eq[_]], resultFun(1.b)) + checkFilterPredicate(Literal(2.b) > binaryAttr, classOf[Lt[_]], resultFun(1.b)) + checkFilterPredicate(Literal(3.b) < binaryAttr, classOf[Gt[_]], resultFun(4.b)) + checkFilterPredicate(Literal(1.b) >= binaryAttr, classOf[LtEq[_]], resultFun(1.b)) + checkFilterPredicate(Literal(4.b) <= binaryAttr, classOf[GtEq[_]], resultFun(4.b)) + + checkFilterPredicate(!(binaryAttr < 4.b), classOf[GtEq[_]], resultFun(4.b)) + checkFilterPredicate(binaryAttr < 2.b || binaryAttr > 3.b, classOf[Operators.Or], + Seq(Row(resultFun(1.b)), Row(resultFun(4.b)))) } } @@ -532,90 +529,104 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared Seq(false, true).foreach { java8Api => withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> java8Api.toString) { - val df = data.map(i => Tuple1(Date.valueOf(i))).toDF() - withNestedDataFrame(df) { case (inputDF, colName, fun) => + val dates = data.map(i => Tuple1(Date.valueOf(i))).toDF() + withNestedParquetDataFrame(dates) { case (inputDF, colName, fun) => + implicit val df: DataFrame = inputDF + def resultFun(dateStr: String): Any = { val parsed = if (java8Api) LocalDate.parse(dateStr) else Date.valueOf(dateStr) fun(parsed) } - withParquetDataFrame(inputDF) { implicit df => - val dateAttr: Expression = df(colName).expr - assert(df(colName).expr.dataType === DateType) - - checkFilterPredicate(dateAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) - checkFilterPredicate(dateAttr.isNotNull, classOf[NotEq[_]], - data.map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(dateAttr === "2018-03-18".date, classOf[Eq[_]], - resultFun("2018-03-18")) - checkFilterPredicate(dateAttr <=> "2018-03-18".date, classOf[Eq[_]], - resultFun("2018-03-18")) - checkFilterPredicate(dateAttr =!= "2018-03-18".date, classOf[NotEq[_]], - Seq("2018-03-19", "2018-03-20", "2018-03-21").map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(dateAttr < "2018-03-19".date, classOf[Lt[_]], - resultFun("2018-03-18")) - checkFilterPredicate(dateAttr > "2018-03-20".date, classOf[Gt[_]], - resultFun("2018-03-21")) - checkFilterPredicate(dateAttr <= "2018-03-18".date, classOf[LtEq[_]], - resultFun("2018-03-18")) - checkFilterPredicate(dateAttr >= "2018-03-21".date, classOf[GtEq[_]], - resultFun("2018-03-21")) - - checkFilterPredicate(Literal("2018-03-18".date) === dateAttr, classOf[Eq[_]], - resultFun("2018-03-18")) - checkFilterPredicate(Literal("2018-03-18".date) <=> dateAttr, classOf[Eq[_]], - resultFun("2018-03-18")) - checkFilterPredicate(Literal("2018-03-19".date) > dateAttr, classOf[Lt[_]], - resultFun("2018-03-18")) - checkFilterPredicate(Literal("2018-03-20".date) < dateAttr, classOf[Gt[_]], - resultFun("2018-03-21")) - checkFilterPredicate(Literal("2018-03-18".date) >= dateAttr, classOf[LtEq[_]], - resultFun("2018-03-18")) - checkFilterPredicate(Literal("2018-03-21".date) <= dateAttr, classOf[GtEq[_]], - resultFun("2018-03-21")) - - checkFilterPredicate(!(dateAttr < "2018-03-21".date), classOf[GtEq[_]], - resultFun("2018-03-21")) - checkFilterPredicate( - dateAttr < "2018-03-19".date || dateAttr > "2018-03-20".date, - classOf[Operators.Or], - Seq(Row(resultFun("2018-03-18")), Row(resultFun("2018-03-21")))) - } + + val dateAttr: Expression = df(colName).expr + assert(df(colName).expr.dataType === DateType) + + checkFilterPredicate(dateAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) + checkFilterPredicate(dateAttr.isNotNull, classOf[NotEq[_]], + data.map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(dateAttr === "2018-03-18".date, classOf[Eq[_]], + resultFun("2018-03-18")) + checkFilterPredicate(dateAttr <=> "2018-03-18".date, classOf[Eq[_]], + resultFun("2018-03-18")) + checkFilterPredicate(dateAttr =!= "2018-03-18".date, classOf[NotEq[_]], + Seq("2018-03-19", "2018-03-20", "2018-03-21").map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(dateAttr < "2018-03-19".date, classOf[Lt[_]], + resultFun("2018-03-18")) + checkFilterPredicate(dateAttr > "2018-03-20".date, classOf[Gt[_]], + resultFun("2018-03-21")) + checkFilterPredicate(dateAttr <= "2018-03-18".date, classOf[LtEq[_]], + resultFun("2018-03-18")) + checkFilterPredicate(dateAttr >= "2018-03-21".date, classOf[GtEq[_]], + resultFun("2018-03-21")) + + checkFilterPredicate(Literal("2018-03-18".date) === dateAttr, classOf[Eq[_]], + resultFun("2018-03-18")) + checkFilterPredicate(Literal("2018-03-18".date) <=> dateAttr, classOf[Eq[_]], + resultFun("2018-03-18")) + checkFilterPredicate(Literal("2018-03-19".date) > dateAttr, classOf[Lt[_]], + resultFun("2018-03-18")) + checkFilterPredicate(Literal("2018-03-20".date) < dateAttr, classOf[Gt[_]], + resultFun("2018-03-21")) + checkFilterPredicate(Literal("2018-03-18".date) >= dateAttr, classOf[LtEq[_]], + resultFun("2018-03-18")) + checkFilterPredicate(Literal("2018-03-21".date) <= dateAttr, classOf[GtEq[_]], + resultFun("2018-03-21")) + + checkFilterPredicate(!(dateAttr < "2018-03-21".date), classOf[GtEq[_]], + resultFun("2018-03-21")) + checkFilterPredicate( + dateAttr < "2018-03-19".date || dateAttr > "2018-03-20".date, + classOf[Operators.Or], + Seq(Row(resultFun("2018-03-18")), Row(resultFun("2018-03-21")))) } } } } test("filter pushdown - timestamp") { - // spark.sql.parquet.outputTimestampType = TIMESTAMP_MILLIS - val millisData = Seq(Timestamp.valueOf("2018-06-14 08:28:53.123"), - Timestamp.valueOf("2018-06-15 08:28:53.123"), - Timestamp.valueOf("2018-06-16 08:28:53.123"), - Timestamp.valueOf("2018-06-17 08:28:53.123")) - withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> - ParquetOutputTimestampType.TIMESTAMP_MILLIS.toString) { - testTimestampPushdown(millisData) - } - - // spark.sql.parquet.outputTimestampType = TIMESTAMP_MICROS - val microsData = Seq(Timestamp.valueOf("2018-06-14 08:28:53.123456"), - Timestamp.valueOf("2018-06-15 08:28:53.123456"), - Timestamp.valueOf("2018-06-16 08:28:53.123456"), - Timestamp.valueOf("2018-06-17 08:28:53.123456")) - withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> - ParquetOutputTimestampType.TIMESTAMP_MICROS.toString) { - testTimestampPushdown(microsData) - } - - // spark.sql.parquet.outputTimestampType = INT96 doesn't support pushdown - withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> - ParquetOutputTimestampType.INT96.toString) { - import testImplicits._ - withParquetDataFrame(millisData.map(i => Tuple1(i)).toDF()) { implicit df => - val schema = new SparkToParquetSchemaConverter(conf).convert(df.schema) - assertResult(None) { - createParquetFilters(schema).createFilter(sources.IsNull("_1")) + Seq(true, false).foreach { java8Api => + withSQLConf( + SQLConf.DATETIME_JAVA8API_ENABLED.key -> java8Api.toString, + SQLConf.PARQUET_REBASE_MODE_IN_WRITE.key -> "CORRECTED", + SQLConf.PARQUET_INT96_REBASE_MODE_IN_WRITE.key -> "CORRECTED") { + // spark.sql.parquet.outputTimestampType = TIMESTAMP_MILLIS + val millisData = Seq( + "1000-06-14 08:28:53.123", + "1582-06-15 08:28:53.001", + "1900-06-16 08:28:53.0", + "2018-06-17 08:28:53.999") + withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> + ParquetOutputTimestampType.TIMESTAMP_MILLIS.toString) { + testTimestampPushdown(millisData, java8Api) + } + + // spark.sql.parquet.outputTimestampType = TIMESTAMP_MICROS + val microsData = Seq( + "1000-06-14 08:28:53.123456", + "1582-06-15 08:28:53.123456", + "1900-06-16 08:28:53.123456", + "2018-06-17 08:28:53.123456") + withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> + ParquetOutputTimestampType.TIMESTAMP_MICROS.toString) { + testTimestampPushdown(microsData, java8Api) + } + + // spark.sql.parquet.outputTimestampType = INT96 doesn't support pushdown + withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> + ParquetOutputTimestampType.INT96.toString) { + import testImplicits._ + withTempPath { file => + millisData.map(i => Tuple1(Timestamp.valueOf(i))).toDF + .write.format(dataSourceName).save(file.getCanonicalPath) + readParquetFile(file.getCanonicalPath) { df => + val schema = new SparkToParquetSchemaConverter(conf).convert(df.schema) + assertResult(None) { + createParquetFilters(schema).createFilter(sources.IsNull("_1")) + } + } + } } } } @@ -632,36 +643,36 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared val rdd = spark.sparkContext.parallelize((1 to 4).map(i => Row(new java.math.BigDecimal(i)))) val dataFrame = spark.createDataFrame(rdd, StructType.fromDDL(s"a decimal($precision, 2)")) - withNestedDataFrame(dataFrame) { case (inputDF, colName, resultFun) => - withParquetDataFrame(inputDF) { implicit df => - val decimalAttr: Expression = df(colName).expr - assert(df(colName).expr.dataType === DecimalType(precision, 2)) - - checkFilterPredicate(decimalAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) - checkFilterPredicate(decimalAttr.isNotNull, classOf[NotEq[_]], - (1 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(decimalAttr === 1, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(decimalAttr <=> 1, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(decimalAttr =!= 1, classOf[NotEq[_]], - (2 to 4).map(i => Row.apply(resultFun(i)))) - - checkFilterPredicate(decimalAttr < 2, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(decimalAttr > 3, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(decimalAttr <= 1, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(decimalAttr >= 4, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(Literal(1) === decimalAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(1) <=> decimalAttr, classOf[Eq[_]], resultFun(1)) - checkFilterPredicate(Literal(2) > decimalAttr, classOf[Lt[_]], resultFun(1)) - checkFilterPredicate(Literal(3) < decimalAttr, classOf[Gt[_]], resultFun(4)) - checkFilterPredicate(Literal(1) >= decimalAttr, classOf[LtEq[_]], resultFun(1)) - checkFilterPredicate(Literal(4) <= decimalAttr, classOf[GtEq[_]], resultFun(4)) - - checkFilterPredicate(!(decimalAttr < 4), classOf[GtEq[_]], resultFun(4)) - checkFilterPredicate(decimalAttr < 2 || decimalAttr > 3, classOf[Operators.Or], - Seq(Row(resultFun(1)), Row(resultFun(4)))) - } + withNestedParquetDataFrame(dataFrame) { case (inputDF, colName, resultFun) => + implicit val df: DataFrame = inputDF + + val decimalAttr: Expression = df(colName).expr + assert(df(colName).expr.dataType === DecimalType(precision, 2)) + + checkFilterPredicate(decimalAttr.isNull, classOf[Eq[_]], Seq.empty[Row]) + checkFilterPredicate(decimalAttr.isNotNull, classOf[NotEq[_]], + (1 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(decimalAttr === 1, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(decimalAttr <=> 1, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(decimalAttr =!= 1, classOf[NotEq[_]], + (2 to 4).map(i => Row.apply(resultFun(i)))) + + checkFilterPredicate(decimalAttr < 2, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(decimalAttr > 3, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(decimalAttr <= 1, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(decimalAttr >= 4, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(Literal(1) === decimalAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(1) <=> decimalAttr, classOf[Eq[_]], resultFun(1)) + checkFilterPredicate(Literal(2) > decimalAttr, classOf[Lt[_]], resultFun(1)) + checkFilterPredicate(Literal(3) < decimalAttr, classOf[Gt[_]], resultFun(4)) + checkFilterPredicate(Literal(1) >= decimalAttr, classOf[LtEq[_]], resultFun(1)) + checkFilterPredicate(Literal(4) <= decimalAttr, classOf[GtEq[_]], resultFun(4)) + + checkFilterPredicate(!(decimalAttr < 4), classOf[GtEq[_]], resultFun(4)) + checkFilterPredicate(decimalAttr < 2 || decimalAttr > 3, classOf[Operators.Or], + Seq(Row(resultFun(1)), Row(resultFun(4)))) } } } @@ -781,10 +792,9 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared test("Filter applied on merged Parquet schema with new column should work") { import testImplicits._ - Seq("true", "false").foreach { vectorized => + withAllParquetReaders { withSQLConf(SQLConf.PARQUET_FILTER_PUSHDOWN_ENABLED.key -> "true", - SQLConf.PARQUET_SCHEMA_MERGING_ENABLED.key -> "true", - SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized) { + SQLConf.PARQUET_SCHEMA_MERGING_ENABLED.key -> "true") { withTempPath { dir => val path1 = s"${dir.getCanonicalPath}/table1" (1 to 3).map(i => (i, i.toString)).toDF("a", "b").write.parquet(path1) @@ -1175,8 +1185,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared } test("SPARK-16371 Do not push down filters when inner name and outer name are the same") { - import testImplicits._ - withParquetDataFrame((1 to 4).map(i => Tuple1(Tuple1(i))).toDF()) { implicit df => + withParquetDataFrame((1 to 4).map(i => Tuple1(Tuple1(i)))) { implicit df => // Here the schema becomes as below: // // root @@ -1219,24 +1228,22 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared } test("SPARK-17213: Broken Parquet filter push-down for string columns") { - Seq(true, false).foreach { vectorizedEnabled => - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorizedEnabled.toString) { - withTempPath { dir => - import testImplicits._ + withAllParquetReaders { + withTempPath { dir => + import testImplicits._ - val path = dir.getCanonicalPath - // scalastyle:off nonascii - Seq("a", "é").toDF("name").write.parquet(path) - // scalastyle:on nonascii + val path = dir.getCanonicalPath + // scalastyle:off nonascii + Seq("a", "é").toDF("name").write.parquet(path) + // scalastyle:on nonascii - assert(spark.read.parquet(path).where("name > 'a'").count() == 1) - assert(spark.read.parquet(path).where("name >= 'a'").count() == 2) + assert(spark.read.parquet(path).where("name > 'a'").count() == 1) + assert(spark.read.parquet(path).where("name >= 'a'").count() == 2) - // scalastyle:off nonascii - assert(spark.read.parquet(path).where("name < 'é'").count() == 1) - assert(spark.read.parquet(path).where("name <= 'é'").count() == 2) - // scalastyle:on nonascii - } + // scalastyle:off nonascii + assert(spark.read.parquet(path).where("name < 'é'").count() == 1) + assert(spark.read.parquet(path).where("name <= 'é'").count() == 2) + // scalastyle:on nonascii } } } @@ -1244,8 +1251,8 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared test("SPARK-31026: Parquet predicate pushdown for fields having dots in the names") { import testImplicits._ - Seq(true, false).foreach { vectorized => - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized.toString, + withAllParquetReaders { + withSQLConf( SQLConf.PARQUET_FILTER_PUSHDOWN_ENABLED.key -> true.toString, SQLConf.SUPPORT_QUOTED_REGEX_COLUMN_NAME.key -> "false") { withTempPath { path => @@ -1255,7 +1262,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared } } - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized.toString, + withSQLConf( // Makes sure disabling 'spark.sql.parquet.recordFilter' still enables // row group level filtering. SQLConf.PARQUET_RECORD_FILTER_ENABLED.key -> "false", @@ -1318,10 +1325,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared } test("filter pushdown - StringStartsWith") { - withParquetDataFrame { - import testImplicits._ - (1 to 4).map(i => Tuple1(i + "str" + i)).toDF() - } { implicit df => + withParquetDataFrame((1 to 4).map(i => Tuple1(i + "str" + i))) { implicit df => checkFilterPredicate( '_1.startsWith("").asInstanceOf[Predicate], classOf[UserDefinedByInstance[_, _]], @@ -1367,10 +1371,7 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared } // SPARK-28371: make sure filter is null-safe. - withParquetDataFrame { - import testImplicits._ - Seq(Tuple1[String](null)).toDF() - } { implicit df => + withParquetDataFrame(Seq(Tuple1[String](null))) { implicit df => checkFilterPredicate( '_1.startsWith("blah").asInstanceOf[Predicate], classOf[UserDefinedByInstance[_, _]], @@ -1573,8 +1574,98 @@ abstract class ParquetFilterSuite extends QueryTest with ParquetTest with Shared } } } + + test("Support Parquet column index") { + // block 1: + // null count min max + // page-0 0 0 99 + // page-1 0 100 199 + // page-2 0 200 299 + // page-3 0 300 399 + // page-4 0 400 449 + // + // block 2: + // null count min max + // page-0 0 450 549 + // page-1 0 550 649 + // page-2 0 650 749 + // page-3 0 750 849 + // page-4 0 850 899 + withTempPath { path => + spark.range(900) + .repartition(1) + .write + .option(ParquetOutputFormat.PAGE_SIZE, "500") + .option(ParquetOutputFormat.BLOCK_SIZE, "2000") + .parquet(path.getCanonicalPath) + + val parquetFile = path.listFiles().filter(_.getName.startsWith("part")).last + val in = HadoopInputFile.fromPath( + new Path(parquetFile.getCanonicalPath), + spark.sessionState.newHadoopConf()) + + Utils.tryWithResource(ParquetFileReader.open(in)) { reader => + val blocks = reader.getFooter.getBlocks + assert(blocks.size() > 1) + val columns = blocks.get(0).getColumns + assert(columns.size() === 1) + val columnIndex = reader.readColumnIndex(columns.get(0)) + assert(columnIndex.getMinValues.size() > 1) + + val rowGroupCnt = blocks.get(0).getRowCount + // Page count = Second page min value - first page min value + val pageCnt = columnIndex.getMinValues.get(1).asLongBuffer().get() - + columnIndex.getMinValues.get(0).asLongBuffer().get() + assert(pageCnt < rowGroupCnt) + Seq(true, false).foreach { columnIndex => + withSQLConf(ParquetInputFormat.COLUMN_INDEX_FILTERING_ENABLED -> s"$columnIndex") { + val df = spark.read.parquet(parquetFile.getCanonicalPath).where("id = 1") + df.collect() + val plan = df.queryExecution.executedPlan + val metrics = plan.collectLeaves().head.metrics + val numOutputRows = metrics("numOutputRows").value + if (columnIndex) { + assert(numOutputRows === pageCnt) + } else { + assert(numOutputRows === rowGroupCnt) + } + } + } + } + } + } + + test("SPARK-34562: Bloom filter push down") { + withTempPath { dir => + val path = dir.getCanonicalPath + spark.range(100).selectExpr("id * 2 AS id") + .write + .option(ParquetOutputFormat.BLOOM_FILTER_ENABLED + "#id", true) + // Disable dictionary because the distinct values less than 40000. + .option(ParquetOutputFormat.ENABLE_DICTIONARY, false) + .parquet(path) + + Seq(true, false).foreach { bloomFilterEnabled => + withSQLConf(ParquetInputFormat.BLOOM_FILTERING_ENABLED -> bloomFilterEnabled.toString) { + val accu = new NumRowGroupsAcc + sparkContext.register(accu) + + val df = spark.read.parquet(path).filter("id = 19") + df.foreachPartition((it: Iterator[Row]) => it.foreach(_ => accu.add(0))) + if (bloomFilterEnabled) { + assert(accu.value === 0) + } else { + assert(accu.value > 0) + } + + AccumulatorContext.remove(accu.id) + } + } + } + } } +@ExtendedSQLTest class ParquetV1FilterSuite extends ParquetFilterSuite { override protected def sparkConf: SparkConf = super @@ -1589,7 +1680,7 @@ class ParquetV1FilterSuite extends ParquetFilterSuite { expected: Seq[Row]): Unit = { val output = predicate.collect { case a: Attribute => a }.distinct - Seq(("parquet", true), ("", false)).map { case (pushdownDsList, nestedPredicatePushdown) => + Seq(("parquet", true), ("", false)).foreach { case (pushdownDsList, nestedPredicatePushdown) => withSQLConf( SQLConf.PARQUET_FILTER_PUSHDOWN_ENABLED.key -> "true", SQLConf.PARQUET_FILTER_PUSHDOWN_DATE_ENABLED.key -> "true", @@ -1654,6 +1745,7 @@ class ParquetV1FilterSuite extends ParquetFilterSuite { } } +@ExtendedSQLTest class ParquetV2FilterSuite extends ParquetFilterSuite { // TODO: enable Parquet V2 write path after file source V2 writers are workable. override protected def sparkConf: SparkConf = diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetIOSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetIOSuite.scala index 87b4db3fe087a..4d0ea3f5a75b2 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetIOSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetIOSuite.scala @@ -17,8 +17,6 @@ package org.apache.spark.sql.execution.datasources.parquet -import java.sql.{Date, Timestamp} -import java.time._ import java.util.Locale import scala.collection.JavaConverters._ @@ -26,22 +24,20 @@ import scala.collection.mutable import scala.reflect.ClassTag import scala.reflect.runtime.universe.TypeTag -import org.apache.hadoop.conf.Configuration +import com.google.common.primitives.UnsignedLong import org.apache.hadoop.fs.{FileSystem, Path} import org.apache.hadoop.mapreduce.{JobContext, TaskAttemptContext} -import org.apache.parquet.HadoopReadOptions import org.apache.parquet.column.{Encoding, ParquetProperties} -import org.apache.parquet.example.data.{Group, GroupWriter} -import org.apache.parquet.example.data.simple.SimpleGroup +import org.apache.parquet.column.ParquetProperties.WriterVersion.PARQUET_1_0 +import org.apache.parquet.example.data.Group +import org.apache.parquet.example.data.simple.{SimpleGroup, SimpleGroupFactory} import org.apache.parquet.hadoop._ -import org.apache.parquet.hadoop.api.WriteSupport -import org.apache.parquet.hadoop.api.WriteSupport.WriteContext +import org.apache.parquet.hadoop.example.ExampleParquetWriter import org.apache.parquet.hadoop.metadata.CompressionCodecName -import org.apache.parquet.hadoop.util.HadoopInputFile -import org.apache.parquet.io.api.RecordConsumer +import org.apache.parquet.hadoop.metadata.CompressionCodecName.GZIP import org.apache.parquet.schema.{MessageType, MessageTypeParser} -import org.apache.spark.{SPARK_VERSION_SHORT, SparkException, SparkUpgradeException} +import org.apache.spark.{SPARK_VERSION_SHORT, SparkException} import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.{InternalRow, ScalaReflection} import org.apache.spark.sql.catalyst.expressions.{GenericInternalRow, UnsafeRow} @@ -49,31 +45,10 @@ import org.apache.spark.sql.catalyst.util.DateTimeUtils import org.apache.spark.sql.execution.datasources.SQLHadoopMapReduceCommitProtocol import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.sql.internal.SQLConf.LegacyBehaviorPolicy._ import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.UTF8String -// Write support class for nested groups: ParquetWriter initializes GroupWriteSupport -// with an empty configuration (it is after all not intended to be used in this way?) -// and members are private so we need to make our own in order to pass the schema -// to the writer. -private[parquet] class TestGroupWriteSupport(schema: MessageType) extends WriteSupport[Group] { - var groupWriter: GroupWriter = null - - override def prepareForWrite(recordConsumer: RecordConsumer): Unit = { - groupWriter = new GroupWriter(recordConsumer, schema) - } - - override def init(configuration: Configuration): WriteContext = { - new WriteContext(schema, new java.util.HashMap[String, String]()) - } - - override def write(record: Group): Unit = { - groupWriter.write(record) - } -} - /** * A test suite that tests basic Parquet I/O. */ @@ -84,7 +59,7 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession * Writes `data` to a Parquet file, reads it back and check file contents. */ protected def checkParquetFile[T <: Product : ClassTag: TypeTag](data: Seq[T]): Unit = { - withParquetDataFrame(data.toDF())(r => checkAnswer(r, data.map(Row.fromTuple))) + withParquetDataFrame(data)(r => checkAnswer(r, data.map(Row.fromTuple))) } test("basic data types (without binary)") { @@ -96,7 +71,7 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession test("raw binary") { val data = (1 to 4).map(i => Tuple1(Array.fill(3)(i.toByte))) - withParquetDataFrame(data.toDF()) { df => + withParquetDataFrame(data) { df => assertResult(data.map(_._1.mkString(",")).sorted) { df.collect().map(_.getAs[Array[Byte]](0).mkString(",")).sorted } @@ -199,7 +174,7 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession testStandardAndLegacyModes("struct") { val data = (1 to 4).map(i => Tuple1((i, s"val_$i"))) - withParquetDataFrame(data.toDF()) { df => + withParquetDataFrame(data) { df => // Structs are converted to `Row`s checkAnswer(df, data.map { case Tuple1(struct) => Row(Row(struct.productIterator.toSeq: _*)) @@ -216,7 +191,7 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession ) ) } - withParquetDataFrame(data.toDF()) { df => + withParquetDataFrame(data) { df => // Structs are converted to `Row`s checkAnswer(df, data.map { case Tuple1(array) => Row(array.map(struct => Row(struct.productIterator.toSeq: _*))) @@ -235,7 +210,7 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession ) ) } - withParquetDataFrame(data.toDF()) { df => + withParquetDataFrame(data) { df => // Structs are converted to `Row`s checkAnswer(df, data.map { case Tuple1(array) => Row(array.map { case Tuple1(Tuple1(str)) => Row(Row(str))}) @@ -245,7 +220,7 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession testStandardAndLegacyModes("nested struct with array of array as field") { val data = (1 to 4).map(i => Tuple1((i, Seq(Seq(s"val_$i"))))) - withParquetDataFrame(data.toDF()) { df => + withParquetDataFrame(data) { df => // Structs are converted to `Row`s checkAnswer(df, data.map { case Tuple1(struct) => Row(Row(struct.productIterator.toSeq: _*)) @@ -262,7 +237,7 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession ) ) } - withParquetDataFrame(data.toDF()) { df => + withParquetDataFrame(data) { df => // Structs are converted to `Row`s checkAnswer(df, data.map { case Tuple1(m) => Row(m.map { case (k, v) => Row(k.productIterator.toSeq: _*) -> v }) @@ -279,7 +254,7 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession ) ) } - withParquetDataFrame(data.toDF()) { df => + withParquetDataFrame(data) { df => // Structs are converted to `Row`s checkAnswer(df, data.map { case Tuple1(m) => Row(m.mapValues(struct => Row(struct.productIterator.toSeq: _*))) @@ -295,7 +270,7 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession null.asInstanceOf[java.lang.Float], null.asInstanceOf[java.lang.Double]) - withParquetDataFrame((allNulls :: Nil).toDF()) { df => + withParquetDataFrame(allNulls :: Nil) { df => val rows = df.collect() assert(rows.length === 1) assert(rows.head === Row(Seq.fill(5)(null): _*)) @@ -308,28 +283,31 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession None.asInstanceOf[Option[Long]], None.asInstanceOf[Option[String]]) - withParquetDataFrame((allNones :: Nil).toDF()) { df => + withParquetDataFrame(allNones :: Nil) { df => val rows = df.collect() assert(rows.length === 1) assert(rows.head === Row(Seq.fill(3)(null): _*)) } } - test("SPARK-10113 Support for unsigned Parquet logical types") { + test("SPARK-34817: Support for unsigned Parquet logical types") { val parquetSchema = MessageTypeParser.parseMessageType( """message root { - | required int32 c(UINT_32); + | required INT32 a(UINT_8); + | required INT32 b(UINT_16); + | required INT32 c(UINT_32); + | required INT64 d(UINT_64); |} """.stripMargin) + val expectedSparkTypes = Seq(ShortType, IntegerType, LongType, DecimalType.LongDecimal) + withTempPath { location => val path = new Path(location.getCanonicalPath) val conf = spark.sessionState.newHadoopConf() writeMetadata(parquetSchema, path, conf) - val errorMessage = intercept[Throwable] { - spark.read.parquet(path.toString).printSchema() - }.toString - assert(errorMessage.contains("Parquet type not supported")) + val sparkTypes = spark.read.parquet(path.toString).schema.map(_.dataType) + assert(sparkTypes === expectedSparkTypes) } } @@ -384,11 +362,30 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession checkCompressionCodec(CompressionCodecName.UNCOMPRESSED) checkCompressionCodec(CompressionCodecName.GZIP) checkCompressionCodec(CompressionCodecName.SNAPPY) + checkCompressionCodec(CompressionCodecName.ZSTD) + } + + private def createParquetWriter( + schema: MessageType, + path: Path, + dictionaryEnabled: Boolean = false): ParquetWriter[Group] = { + val hadoopConf = spark.sessionState.newHadoopConf() + + ExampleParquetWriter + .builder(path) + .withDictionaryEncoding(dictionaryEnabled) + .withType(schema) + .withWriterVersion(PARQUET_1_0) + .withCompressionCodec(GZIP) + .withRowGroupSize(1024 * 1024) + .withPageSize(1024) + .withConf(hadoopConf) + .build() } test("read raw Parquet file") { def makeRawParquetFile(path: Path): Unit = { - val schema = MessageTypeParser.parseMessageType( + val schemaStr = """ |message root { | required boolean _1; @@ -397,22 +394,11 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession | required float _4; | required double _5; |} - """.stripMargin) - - val testWriteSupport = new TestGroupWriteSupport(schema) - /** - * Provide a builder for constructing a parquet writer - after PARQUET-248 directly - * constructing the writer is deprecated and should be done through a builder. The default - * builders include Avro - but for raw Parquet writing we must create our own builder. - */ - class ParquetWriterBuilder() extends - ParquetWriter.Builder[Group, ParquetWriterBuilder](path) { - override def getWriteSupport(conf: Configuration) = testWriteSupport - - override def self() = this - } + """.stripMargin + val schema = MessageTypeParser.parseMessageType(schemaStr) + - val writer = new ParquetWriterBuilder().build() + val writer = createParquetWriter(schema, path) (0 until 10).foreach { i => val record = new SimpleGroup(schema) @@ -437,6 +423,79 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession } } + test("SPARK-34817: Read UINT_8/UINT_16/UINT_32 from parquet") { + Seq(true, false).foreach { dictionaryEnabled => + def makeRawParquetFile(path: Path): Unit = { + val schemaStr = + """message root { + | required INT32 a(UINT_8); + | required INT32 b(UINT_16); + | required INT32 c(UINT_32); + |} + """.stripMargin + val schema = MessageTypeParser.parseMessageType(schemaStr) + + val writer = createParquetWriter(schema, path, dictionaryEnabled) + + val factory = new SimpleGroupFactory(schema) + (0 until 1000).foreach { i => + val group = factory.newGroup() + .append("a", i % 100 + Byte.MaxValue) + .append("b", i % 100 + Short.MaxValue) + .append("c", i % 100 + Int.MaxValue) + writer.write(group) + } + writer.close() + } + + withTempDir { dir => + val path = new Path(dir.toURI.toString, "part-r-0.parquet") + makeRawParquetFile(path) + readParquetFile(path.toString) { df => + checkAnswer(df, (0 until 1000).map { i => + Row(i % 100 + Byte.MaxValue, + i % 100 + Short.MaxValue, + i % 100 + Int.MaxValue.toLong) + }) + } + } + } + } + + test("SPARK-34817: Read UINT_64 as Decimal from parquet") { + Seq(true, false).foreach { dictionaryEnabled => + def makeRawParquetFile(path: Path): Unit = { + val schemaStr = + """message root { + | required INT64 a(UINT_64); + |} + """.stripMargin + val schema = MessageTypeParser.parseMessageType(schemaStr) + + val writer = createParquetWriter(schema, path, dictionaryEnabled) + + val factory = new SimpleGroupFactory(schema) + (-500 until 500).foreach { i => + val group = factory.newGroup() + .append("a", i % 100L) + writer.write(group) + } + writer.close() + } + + withTempDir { dir => + val path = new Path(dir.toURI.toString, "part-r-0.parquet") + makeRawParquetFile(path) + readParquetFile(path.toString) { df => + checkAnswer(df, (-500 until 500).map { i => + val bi = UnsignedLong.fromLongBits(i % 100L).bigIntegerValue() + Row(new java.math.BigDecimal(bi)) + }) + } + } + } + } + test("write metadata") { val hadoopConf = spark.sessionState.newHadoopConf() withTempPath { file => @@ -647,47 +706,39 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession } test("read dictionary encoded decimals written as INT32") { - ("true" :: "false" :: Nil).foreach { vectorized => - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized) { - checkAnswer( - // Decimal column in this file is encoded using plain dictionary - readResourceParquetFile("test-data/dec-in-i32.parquet"), - spark.range(1 << 4).select('id % 10 cast DecimalType(5, 2) as 'i32_dec)) - } + withAllParquetReaders { + checkAnswer( + // Decimal column in this file is encoded using plain dictionary + readResourceParquetFile("test-data/dec-in-i32.parquet"), + spark.range(1 << 4).select('id % 10 cast DecimalType(5, 2) as 'i32_dec)) } } test("read dictionary encoded decimals written as INT64") { - ("true" :: "false" :: Nil).foreach { vectorized => - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized) { - checkAnswer( - // Decimal column in this file is encoded using plain dictionary - readResourceParquetFile("test-data/dec-in-i64.parquet"), - spark.range(1 << 4).select('id % 10 cast DecimalType(10, 2) as 'i64_dec)) - } + withAllParquetReaders { + checkAnswer( + // Decimal column in this file is encoded using plain dictionary + readResourceParquetFile("test-data/dec-in-i64.parquet"), + spark.range(1 << 4).select('id % 10 cast DecimalType(10, 2) as 'i64_dec)) } } test("read dictionary encoded decimals written as FIXED_LEN_BYTE_ARRAY") { - ("true" :: "false" :: Nil).foreach { vectorized => - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized) { - checkAnswer( - // Decimal column in this file is encoded using plain dictionary - readResourceParquetFile("test-data/dec-in-fixed-len.parquet"), - spark.range(1 << 4).select('id % 10 cast DecimalType(10, 2) as 'fixed_len_dec)) - } + withAllParquetReaders { + checkAnswer( + // Decimal column in this file is encoded using plain dictionary + readResourceParquetFile("test-data/dec-in-fixed-len.parquet"), + spark.range(1 << 4).select('id % 10 cast DecimalType(10, 2) as 'fixed_len_dec)) } } test("read dictionary and plain encoded timestamp_millis written as INT64") { - ("true" :: "false" :: Nil).foreach { vectorized => - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized) { - checkAnswer( - // timestamp column in this file is encoded using combination of plain - // and dictionary encodings. - readResourceParquetFile("test-data/timemillis-in-i64.parquet"), - (1 to 3).map(i => Row(new java.sql.Timestamp(10)))) - } + withAllParquetReaders { + checkAnswer( + // timestamp column in this file is encoded using combination of plain + // and dictionary encodings. + readResourceParquetFile("test-data/timemillis-in-i64.parquet"), + (1 to 3).map(i => Row(new java.sql.Timestamp(10)))) } } @@ -798,7 +849,7 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession Seq(1).toDF().repartition(1).write.parquet(dir.getCanonicalPath) val dataTypes = - Seq(StringType, BooleanType, ByteType, ShortType, IntegerType, LongType, + Seq(StringType, BooleanType, ByteType, BinaryType, ShortType, IntegerType, LongType, FloatType, DoubleType, DecimalType(25, 5), DateType, TimestampType) val constantValues = @@ -806,6 +857,7 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession UTF8String.fromString("a string"), true, 1.toByte, + "Spark SQL".getBytes, 2.toShort, 3, Long.MaxValue, @@ -833,7 +885,11 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession // in order to use get(...) method which is not implemented in `ColumnarBatch`. val actual = row.copy().get(1, dt) val expected = v - assert(actual == expected) + if (dt.isInstanceOf[BinaryType]) { + assert(actual.asInstanceOf[Array[Byte]] sameElements expected.asInstanceOf[Array[Byte]]) + } else { + assert(actual == expected) + } } finally { vectorizedReader.close() } @@ -868,186 +924,43 @@ class ParquetIOSuite extends QueryTest with ParquetTest with SharedSparkSession test("Write Spark version into Parquet metadata") { withTempPath { dir => - val path = dir.getAbsolutePath - spark.range(1).repartition(1).write.parquet(path) - val file = SpecificParquetRecordReaderBase.listDirectory(dir).get(0) - - val conf = new Configuration() - val hadoopInputFile = HadoopInputFile.fromPath(new Path(file), conf) - val parquetReadOptions = HadoopReadOptions.builder(conf).build() - val m = ParquetFileReader.open(hadoopInputFile, parquetReadOptions) - val metaData = m.getFileMetaData.getKeyValueMetaData - m.close() - - assert(metaData.get(SPARK_VERSION_METADATA_KEY) === SPARK_VERSION_SHORT) - } - } - - test("SPARK-31159: compatibility with Spark 2.4 in reading dates/timestamps") { - // test reading the existing 2.4 files and new 3.0 files (with rebase on/off) together. - def checkReadMixedFiles(fileName: String, dt: String, dataStr: String): Unit = { - withTempPaths(2) { paths => - paths.foreach(_.delete()) - val path2_4 = getResourceParquetFilePath("test-data/" + fileName) - val path3_0 = paths(0).getCanonicalPath - val path3_0_rebase = paths(1).getCanonicalPath - if (dt == "date") { - val df = Seq(dataStr).toDF("str").select($"str".cast("date").as("date")) - - // By default we should fail to write ancient datetime values. - var e = intercept[SparkException](df.write.parquet(path3_0)) - assert(e.getCause.getCause.getCause.isInstanceOf[SparkUpgradeException]) - // By default we should fail to read ancient datetime values. - e = intercept[SparkException](spark.read.parquet(path2_4).collect()) - assert(e.getCause.isInstanceOf[SparkUpgradeException]) - - withSQLConf(SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_WRITE.key -> CORRECTED.toString) { - df.write.mode("overwrite").parquet(path3_0) - } - withSQLConf(SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_WRITE.key -> LEGACY.toString) { - df.write.parquet(path3_0_rebase) - } - - // For Parquet files written by Spark 3.0, we know the writer info and don't need the - // config to guide the rebase behavior. - withSQLConf(SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_READ.key -> LEGACY.toString) { - checkAnswer( - spark.read.format("parquet").load(path2_4, path3_0, path3_0_rebase), - 1.to(3).map(_ => Row(java.sql.Date.valueOf(dataStr)))) - } - } else { - val df = Seq(dataStr).toDF("str").select($"str".cast("timestamp").as("ts")) - withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> dt) { - // By default we should fail to write ancient datetime values. - var e = intercept[SparkException](df.write.parquet(path3_0)) - assert(e.getCause.getCause.getCause.isInstanceOf[SparkUpgradeException]) - // By default we should fail to read ancient datetime values. - e = intercept[SparkException](spark.read.parquet(path2_4).collect()) - assert(e.getCause.isInstanceOf[SparkUpgradeException]) - - withSQLConf(SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_WRITE.key -> CORRECTED.toString) { - df.write.mode("overwrite").parquet(path3_0) - } - withSQLConf(SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_WRITE.key -> LEGACY.toString) { - df.write.parquet(path3_0_rebase) - } - } - // For Parquet files written by Spark 3.0, we know the writer info and don't need the - // config to guide the rebase behavior. - withSQLConf(SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_READ.key -> LEGACY.toString) { - checkAnswer( - spark.read.format("parquet").load(path2_4, path3_0, path3_0_rebase), - 1.to(3).map(_ => Row(java.sql.Timestamp.valueOf(dataStr)))) - } - } + spark.range(1).repartition(1).write.parquet(dir.getAbsolutePath) + assert(getMetaData(dir)(SPARK_VERSION_METADATA_KEY) === SPARK_VERSION_SHORT) + } + } + + Seq(true, false).foreach { vec => + test(s"SPARK-34167: read LongDecimals with precision < 10, VectorizedReader $vec") { + // decimal32-written-as-64-bit.snappy.parquet was generated using a 3rd-party library. It has + // 10 rows of Decimal(9, 1) written as LongDecimal instead of an IntDecimal + readParquetFile(testFile("test-data/decimal32-written-as-64-bit.snappy.parquet"), vec) { + df => + assert(10 == df.collect().length) + val first10Df = df.head(10) + assert( + Seq(792059492, 986842987, 540247998, null, 357991078, + 494131059, 92536396, 426847157, -999999999, 204486094) + .zip(first10Df).forall(d => + d._2.isNullAt(0) && d._1 == null || + d._1 == d._2.getDecimal(0).unscaledValue().intValue() + )) } - } - - Seq(false, true).foreach { vectorized => - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized.toString) { - checkReadMixedFiles("before_1582_date_v2_4.snappy.parquet", "date", "1001-01-01") - checkReadMixedFiles( - "before_1582_timestamp_micros_v2_4.snappy.parquet", - "TIMESTAMP_MICROS", - "1001-01-01 01:02:03.123456") - checkReadMixedFiles( - "before_1582_timestamp_millis_v2_4.snappy.parquet", - "TIMESTAMP_MILLIS", - "1001-01-01 01:02:03.123") - - // INT96 is a legacy timestamp format and we always rebase the seconds for it. - checkAnswer(readResourceParquetFile( - "test-data/before_1582_timestamp_int96_v2_4.snappy.parquet"), - Row(java.sql.Timestamp.valueOf("1001-01-01 01:02:03.123456"))) - } - } - } - - test("SPARK-31159: rebasing timestamps in write") { - val N = 8 - Seq(false, true).foreach { dictionaryEncoding => - Seq( - ("TIMESTAMP_MILLIS", "1001-01-01 01:02:03.123", "1001-01-07 01:09:05.123"), - ("TIMESTAMP_MICROS", "1001-01-01 01:02:03.123456", "1001-01-07 01:09:05.123456"), - ("INT96", "1001-01-01 01:02:03.123456", "1001-01-01 01:02:03.123456") - ).foreach { case (outType, tsStr, nonRebased) => - withClue(s"output type $outType") { - withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> outType) { - withTempPath { dir => - val path = dir.getAbsolutePath - withSQLConf(SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_WRITE.key -> LEGACY.toString) { - Seq.tabulate(N)(_ => tsStr).toDF("tsS") - .select($"tsS".cast("timestamp").as("ts")) - .repartition(1) - .write - .option("parquet.enable.dictionary", dictionaryEncoding) - .parquet(path) - } - - Seq(false, true).foreach { vectorized => - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized.toString) { - // The file metadata indicates if it needs rebase or not, so we can always get the - // correct result regardless of the "rebase mode" config. - Seq(LEGACY, CORRECTED, EXCEPTION).foreach { mode => - withSQLConf( - SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_READ.key -> mode.toString) { - checkAnswer( - spark.read.parquet(path), - Seq.tabulate(N)(_ => Row(Timestamp.valueOf(tsStr)))) - } - } - - // Force to not rebase to prove the written datetime values are rebased - // and we will get wrong result if we don't rebase while reading. - withSQLConf("spark.test.forceNoRebase" -> "true") { - checkAnswer( - spark.read.parquet(path), - Seq.tabulate(N)(_ => Row(Timestamp.valueOf(nonRebased)))) - } - } - } - } - } - } - } - } - } - - test("SPARK-31159: rebasing dates in write") { - val N = 8 - Seq(false, true).foreach { dictionaryEncoding => - withTempPath { dir => - val path = dir.getAbsolutePath - withSQLConf(SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_WRITE.key -> LEGACY.toString) { - Seq.tabulate(N)(_ => "1001-01-01").toDF("dateS") - .select($"dateS".cast("date").as("date")) - .repartition(1) - .write - .option("parquet.enable.dictionary", dictionaryEncoding) - .parquet(path) - } - - Seq(false, true).foreach { vectorized => - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized.toString) { - // The file metadata indicates if it needs rebase or not, so we can always get the - // correct result regardless of the "rebase mode" config. - Seq(LEGACY, CORRECTED, EXCEPTION).foreach { mode => - withSQLConf(SQLConf.LEGACY_AVRO_REBASE_MODE_IN_READ.key -> mode.toString) { - checkAnswer( - spark.read.parquet(path), - Seq.tabulate(N)(_ => Row(Date.valueOf("1001-01-01")))) - } - } - - // Force to not rebase to prove the written datetime values are rebased and we will get - // wrong result if we don't rebase while reading. - withSQLConf("spark.test.forceNoRebase" -> "true") { - checkAnswer( - spark.read.parquet(path), - Seq.tabulate(N)(_ => Row(Date.valueOf("1001-01-07")))) - } - } - } + // decimal32-written-as-64-bit-dict.snappy.parquet was generated using a 3rd-party library. It + // has 2048 rows of Decimal(3, 1) written as LongDecimal instead of an IntDecimal + readParquetFile( + testFile("test-data/decimal32-written-as-64-bit-dict.snappy.parquet"), vec) { + df => + assert(2048 == df.collect().length) + val first10Df = df.head(10) + assert(Seq(751, 937, 511, null, 337, 467, 84, 403, -999, 190) + .zip(first10Df).forall(d => + d._2.isNullAt(0) && d._1 == null || + d._1 == d._2.getDecimal(0).unscaledValue().intValue())) + + val last10Df = df.tail(10) + assert(Seq(866, 20, 492, 76, 824, 604, 343, 820, 864, 243) + .zip(last10Df).forall(d => + d._1 == d._2.getDecimal(0).unscaledValue().intValue())) } } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetInteroperabilitySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetInteroperabilitySuite.scala index 7d75077a9732a..b1d930acb097e 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetInteroperabilitySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetInteroperabilitySuite.scala @@ -21,9 +21,8 @@ import java.io.File import java.time.ZoneOffset import org.apache.commons.io.FileUtils -import org.apache.hadoop.fs.{FileSystem, Path, PathFilter} +import org.apache.hadoop.fs.{Path, PathFilter} import org.apache.parquet.format.converter.ParquetMetadataConverter.NO_FILTER -import org.apache.parquet.hadoop.ParquetFileReader import org.apache.parquet.schema.PrimitiveType.PrimitiveTypeName import org.apache.spark.sql.Row @@ -124,12 +123,11 @@ class ParquetInteroperabilitySuite extends ParquetCompatibilityTest with SharedS FileUtils.copyFile(new File(impalaPath), new File(tableDir, "part-00001.parq")) Seq(false, true).foreach { int96TimestampConversion => - Seq(false, true).foreach { vectorized => + withAllParquetReaders { withSQLConf( (SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key, SQLConf.ParquetOutputTimestampType.INT96.toString), - (SQLConf.PARQUET_INT96_TIMESTAMP_CONVERSION.key, int96TimestampConversion.toString()), - (SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key, vectorized.toString()) + (SQLConf.PARQUET_INT96_TIMESTAMP_CONVERSION.key, int96TimestampConversion.toString()) ) { val readBack = spark.read.parquet(tableDir.getAbsolutePath).collect() assert(readBack.size === 6) @@ -149,7 +147,8 @@ class ParquetInteroperabilitySuite extends ParquetCompatibilityTest with SharedS val fullExpectations = (ts ++ impalaExpectations).map(_.toString).sorted.toArray val actual = readBack.map(_.getTimestamp(0).toString).sorted withClue( - s"int96TimestampConversion = $int96TimestampConversion; vectorized = $vectorized") { + s"int96TimestampConversion = $int96TimestampConversion; " + + s"vectorized = ${SQLConf.get.parquetVectorizedReaderEnabled}") { assert(fullExpectations === actual) // Now test that the behavior is still correct even with a filter which could get @@ -165,7 +164,7 @@ class ParquetInteroperabilitySuite extends ParquetCompatibilityTest with SharedS // the assumption on column stats, and also the end-to-end behavior. val hadoopConf = spark.sessionState.newHadoopConf() - val fs = FileSystem.get(hadoopConf) + val fs = new Path(tableDir.getAbsolutePath).getFileSystem(hadoopConf) val parts = fs.listStatus(new Path(tableDir.getAbsolutePath), new PathFilter { override def accept(path: Path): Boolean = !path.getName.startsWith("_") }) @@ -174,7 +173,7 @@ class ParquetInteroperabilitySuite extends ParquetCompatibilityTest with SharedS assert(parts.size == 2) parts.foreach { part => val oneFooter = - ParquetFileReader.readFooter(hadoopConf, part.getPath, NO_FILTER) + ParquetFooterReader.readFooter(hadoopConf, part.getPath, NO_FILTER) assert(oneFooter.getFileMetaData.getSchema.getColumns.size === 1) val typeName = oneFooter .getFileMetaData.getSchema.getColumns.get(0).getPrimitiveType.getPrimitiveTypeName @@ -183,7 +182,7 @@ class ParquetInteroperabilitySuite extends ParquetCompatibilityTest with SharedS val oneBlockColumnMeta = oneBlockMeta.getColumns().get(0) // This is the important assert. Column stats are written, but they are ignored // when the data is read back as mentioned above, b/c int96 is unsigned. This - // assert makes sure this holds even if we change parquet versions (if eg. there + // assert makes sure this holds even if we change parquet versions (if e.g. there // were ever statistics even on unsigned columns). assert(!oneBlockColumnMeta.getStatistics.hasNonNullValue) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetPartitionDiscoverySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetPartitionDiscoverySuite.scala index d3301ced2ba19..5ea8c61749e36 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetPartitionDiscoverySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetPartitionDiscoverySuite.scala @@ -19,11 +19,9 @@ package org.apache.spark.sql.execution.datasources.parquet import java.io.File import java.math.BigInteger -import java.sql.{Date, Timestamp} +import java.sql.Timestamp import java.time.{ZoneId, ZoneOffset} -import java.util.{Calendar, Locale, TimeZone} - -import scala.collection.mutable.ArrayBuffer +import java.util.{Calendar, Locale} import com.google.common.io.Files import org.apache.hadoop.fs.Path @@ -33,8 +31,8 @@ import org.apache.spark.SparkConf import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.catalog.ExternalCatalogUtils -import org.apache.spark.sql.catalyst.expressions.Literal import org.apache.spark.sql.catalyst.util.{DateFormatter, DateTimeUtils, TimestampFormatter} +import org.apache.spark.sql.catalyst.util.DateTimeUtils.TimeZoneUTC import org.apache.spark.sql.execution.datasources._ import org.apache.spark.sql.execution.datasources.{PartitionPath => Partition} import org.apache.spark.sql.execution.datasources.v2.{DataSourceV2Relation, FileTable} @@ -60,7 +58,7 @@ abstract class ParquetPartitionDiscoverySuite val timeZoneId = ZoneId.systemDefault() val df = DateFormatter(timeZoneId) val tf = TimestampFormatter( - timestampPartitionPattern, timeZoneId, needVarLengthSecondFraction = true) + timestampPartitionPattern, timeZoneId, isParsing = true) protected override def beforeAll(): Unit = { super.beforeAll() @@ -73,29 +71,25 @@ abstract class ParquetPartitionDiscoverySuite } test("column type inference") { - def check(raw: String, literal: Literal, zoneId: ZoneId = timeZoneId): Unit = { - assert(inferPartitionColumnValue(raw, true, zoneId, df, tf) === literal) + def check(raw: String, dataType: DataType, zoneId: ZoneId = timeZoneId): Unit = { + assert(inferPartitionColumnValue(raw, true, zoneId, df, tf) === dataType) } - check("10", Literal.create(10, IntegerType)) - check("1000000000000000", Literal.create(1000000000000000L, LongType)) + check("10", IntegerType) + check("1000000000000000", LongType) val decimal = Decimal("1" * 20) - check("1" * 20, - Literal.create(decimal, DecimalType(decimal.precision, decimal.scale))) - check("1.5", Literal.create(1.5, DoubleType)) - check("hello", Literal.create("hello", StringType)) - check("1990-02-24", Literal.create(Date.valueOf("1990-02-24"), DateType)) - check("1990-02-24 12:00:30", - Literal.create(Timestamp.valueOf("1990-02-24 12:00:30"), TimestampType)) - - val c = Calendar.getInstance(TimeZone.getTimeZone("UTC")) + check("1" * 20, DecimalType(decimal.precision, decimal.scale)) + check("1.5", DoubleType) + check("hello", StringType) + check("1990-02-24", DateType) + check("1990-02-24 12:00:30", TimestampType) + + val c = Calendar.getInstance(TimeZoneUTC) c.set(1990, 1, 24, 12, 0, 30) c.set(Calendar.MILLISECOND, 0) - check("1990-02-24 12:00:30", - Literal.create(new Timestamp(c.getTimeInMillis), TimestampType), - ZoneOffset.UTC) + check("1990-02-24 12:00:30", TimestampType, ZoneOffset.UTC) - check(defaultPartitionName, Literal.create(null, NullType)) + check(defaultPartitionName, NullType) } test("parse invalid partitioned directories") { @@ -217,22 +211,22 @@ abstract class ParquetPartitionDiscoverySuite check("file://path/a=10", Some { PartitionValues( Seq("a"), - Seq(Literal.create(10, IntegerType))) + Seq(TypedPartValue("10", IntegerType))) }) check("file://path/a=10/b=hello/c=1.5", Some { PartitionValues( Seq("a", "b", "c"), Seq( - Literal.create(10, IntegerType), - Literal.create("hello", StringType), - Literal.create(1.5, DoubleType))) + TypedPartValue("10", IntegerType), + TypedPartValue("hello", StringType), + TypedPartValue("1.5", DoubleType))) }) check("file://path/a=10/b_hello/c=1.5", Some { PartitionValues( Seq("c"), - Seq(Literal.create(1.5, DoubleType))) + Seq(TypedPartValue("1.5", DoubleType))) }) check("file:///", None) @@ -274,7 +268,7 @@ abstract class ParquetPartitionDiscoverySuite assert(partitionSpec2 == Option(PartitionValues( Seq("a"), - Seq(Literal.create(10, IntegerType))))) + Seq(TypedPartValue("10", IntegerType))))) } test("parse partitions") { @@ -912,15 +906,19 @@ abstract class ParquetPartitionDiscoverySuite assert( listConflictingPartitionColumns( Seq( - (new Path("file:/tmp/foo/a=1"), PartitionValues(Seq("a"), Seq(Literal(1)))), - (new Path("file:/tmp/foo/b=1"), PartitionValues(Seq("b"), Seq(Literal(1)))))).trim === + (new Path("file:/tmp/foo/a=1"), + PartitionValues(Seq("a"), Seq(TypedPartValue("1", IntegerType)))), + (new Path("file:/tmp/foo/b=1"), + PartitionValues(Seq("b"), Seq(TypedPartValue("1", IntegerType)))))).trim === makeExpectedMessage(Seq("a", "b"), Seq("file:/tmp/foo/a=1", "file:/tmp/foo/b=1"))) assert( listConflictingPartitionColumns( Seq( - (new Path("file:/tmp/foo/a=1/_temporary"), PartitionValues(Seq("a"), Seq(Literal(1)))), - (new Path("file:/tmp/foo/a=1"), PartitionValues(Seq("a"), Seq(Literal(1)))))).trim === + (new Path("file:/tmp/foo/a=1/_temporary"), + PartitionValues(Seq("a"), Seq(TypedPartValue("1", IntegerType)))), + (new Path("file:/tmp/foo/a=1"), + PartitionValues(Seq("a"), Seq(TypedPartValue("1", IntegerType)))))).trim === makeExpectedMessage( Seq("a"), Seq("file:/tmp/foo/a=1/_temporary", "file:/tmp/foo/a=1"))) @@ -929,9 +927,10 @@ abstract class ParquetPartitionDiscoverySuite listConflictingPartitionColumns( Seq( (new Path("file:/tmp/foo/a=1"), - PartitionValues(Seq("a"), Seq(Literal(1)))), + PartitionValues(Seq("a"), Seq(TypedPartValue("1", IntegerType)))), (new Path("file:/tmp/foo/a=1/b=foo"), - PartitionValues(Seq("a", "b"), Seq(Literal(1), Literal("foo")))))).trim === + PartitionValues(Seq("a", "b"), + Seq(TypedPartValue("1", IntegerType), TypedPartValue("foo", StringType)))))).trim === makeExpectedMessage( Seq("a", "a, b"), Seq("file:/tmp/foo/a=1", "file:/tmp/foo/a=1/b=foo"))) @@ -1040,6 +1039,21 @@ abstract class ParquetPartitionDiscoverySuite checkAnswer(input, data) } } + + test("SPARK-34314: preserve partition values of the string type") { + import testImplicits._ + withTempPath { file => + val path = file.getCanonicalPath + val df = Seq((0, "AA"), (1, "-0")).toDF("id", "part") + df.write + .partitionBy("part") + .format("parquet") + .save(path) + val readback = spark.read.parquet(path) + assert(readback.schema("part").dataType === StringType) + checkAnswer(readback, Row(0, "AA") :: Row(1, "-0") :: Nil) + } + } } class ParquetV1PartitionDiscoverySuite extends ParquetPartitionDiscoverySuite { @@ -1158,7 +1172,7 @@ class ParquetV1PartitionDiscoverySuite extends ParquetPartitionDiscoverySuite { test("SPARK-21463: MetadataLogFileIndex should respect userSpecifiedSchema for partition cols") { withTempDir { tempDir => val output = new File(tempDir, "output").toString - val checkpoint = new File(tempDir, "chkpoint").toString + val checkpoint = new File(tempDir, "checkpoint").toString try { val stream = MemoryStream[(String, Int)] val df = stream.toDS().toDF("time", "value") @@ -1304,7 +1318,7 @@ class ParquetV2PartitionDiscoverySuite extends ParquetPartitionDiscoverySuite { test("SPARK-21463: MetadataLogFileIndex should respect userSpecifiedSchema for partition cols") { withTempDir { tempDir => val output = new File(tempDir, "output").toString - val checkpoint = new File(tempDir, "chkpoint").toString + val checkpoint = new File(tempDir, "checkpoint").toString try { val stream = MemoryStream[(String, Int)] val df = stream.toDS().toDF("time", "value") diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala index 917aaba2669ce..9ef43995467c6 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetQuerySuite.scala @@ -28,7 +28,7 @@ import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.{InternalRow, TableIdentifier} import org.apache.spark.sql.catalyst.expressions.SpecificInternalRow import org.apache.spark.sql.execution.FileSourceScanExec -import org.apache.spark.sql.execution.datasources.SQLHadoopMapReduceCommitProtocol +import org.apache.spark.sql.execution.datasources.{SchemaColumnConvertNotSupportedException, SQLHadoopMapReduceCommitProtocol} import org.apache.spark.sql.execution.datasources.parquet.TestingUDT.{NestedStruct, NestedStructUDT, SingleElement} import org.apache.spark.sql.execution.datasources.v2.BatchScanExec import org.apache.spark.sql.execution.datasources.v2.parquet.ParquetScan @@ -168,11 +168,9 @@ abstract class ParquetQuerySuite extends QueryTest with ParquetTest with SharedS withTempPath { file => val df = spark.createDataFrame(sparkContext.parallelize(data), schema) df.write.parquet(file.getCanonicalPath) - ("true" :: "false" :: Nil).foreach { vectorized => - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized) { - val df2 = spark.read.parquet(file.getCanonicalPath) - checkAnswer(df2, df.collect().toSeq) - } + withAllParquetReaders { + val df2 = spark.read.parquet(file.getCanonicalPath) + checkAnswer(df2, df.collect().toSeq) } } } @@ -791,15 +789,13 @@ abstract class ParquetQuerySuite extends QueryTest with ParquetTest with SharedS } test("SPARK-26677: negated null-safe equality comparison should not filter matched row groups") { - (true :: false :: Nil).foreach { vectorized => - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized.toString) { - withTempPath { path => - // Repeated values for dictionary encoding. - Seq(Some("A"), Some("A"), None).toDF.repartition(1) - .write.parquet(path.getAbsolutePath) - val df = spark.read.parquet(path.getAbsolutePath) - checkAnswer(stripSparkFilter(df.where("NOT (value <=> 'A')")), df) - } + withAllParquetReaders { + withTempPath { path => + // Repeated values for dictionary encoding. + Seq(Some("A"), Some("A"), None).toDF.repartition(1) + .write.parquet(path.getAbsolutePath) + val df = spark.read.parquet(path.getAbsolutePath) + checkAnswer(stripSparkFilter(df.where("NOT (value <=> 'A')")), df) } } } @@ -821,10 +817,8 @@ abstract class ParquetQuerySuite extends QueryTest with ParquetTest with SharedS withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> toTsType) { write(df2.write.mode(SaveMode.Append)) } - Seq("true", "false").foreach { vectorized => - withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> vectorized) { - checkAnswer(readback, df1.unionAll(df2)) - } + withAllParquetReaders { + checkAnswer(readback, df1.unionAll(df2)) } } @@ -846,6 +840,67 @@ abstract class ParquetQuerySuite extends QueryTest with ParquetTest with SharedS testMigration(fromTsType = "INT96", toTsType = "TIMESTAMP_MICROS") testMigration(fromTsType = "TIMESTAMP_MICROS", toTsType = "INT96") } + + test("SPARK-34212 Parquet should read decimals correctly") { + def readParquet(schema: String, path: File): DataFrame = { + spark.read.schema(schema).parquet(path.toString) + } + + withTempPath { path => + // a is int-decimal (4 bytes), b is long-decimal (8 bytes), c is binary-decimal (16 bytes) + val df = sql("SELECT 1.0 a, CAST(1.23 AS DECIMAL(17, 2)) b, CAST(1.23 AS DECIMAL(36, 2)) c") + df.write.parquet(path.toString) + + withAllParquetReaders { + // We can read the decimal parquet field with a larger precision, if scale is the same. + val schema = "a DECIMAL(9, 1), b DECIMAL(18, 2), c DECIMAL(38, 2)" + checkAnswer(readParquet(schema, path), df) + } + + withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> "false") { + val schema1 = "a DECIMAL(3, 2), b DECIMAL(18, 3), c DECIMAL(37, 3)" + checkAnswer(readParquet(schema1, path), df) + val schema2 = "a DECIMAL(3, 0), b DECIMAL(18, 1), c DECIMAL(37, 1)" + checkAnswer(readParquet(schema2, path), Row(1, 1.2, 1.2)) + } + + withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> "true") { + Seq("a DECIMAL(3, 2)", "b DECIMAL(18, 1)", "c DECIMAL(37, 1)").foreach { schema => + val e = intercept[SparkException] { + readParquet(schema, path).collect() + }.getCause.getCause + assert(e.isInstanceOf[SchemaColumnConvertNotSupportedException]) + } + } + } + + // tests for parquet types without decimal metadata. + withTempPath { path => + val df = sql(s"SELECT 1 a, 123456 b, ${Int.MaxValue.toLong * 10} c, CAST('1.2' AS BINARY) d") + df.write.parquet(path.toString) + + withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> "false") { + checkAnswer(readParquet("a DECIMAL(3, 2)", path), sql("SELECT 1.00")) + checkAnswer(readParquet("b DECIMAL(3, 2)", path), Row(null)) + checkAnswer(readParquet("b DECIMAL(11, 1)", path), sql("SELECT 123456.0")) + checkAnswer(readParquet("c DECIMAL(11, 1)", path), Row(null)) + checkAnswer(readParquet("c DECIMAL(13, 0)", path), df.select("c")) + val e = intercept[SparkException] { + readParquet("d DECIMAL(3, 2)", path).collect() + }.getCause + assert(e.getMessage.contains("Please read this column/field as Spark BINARY type")) + } + + withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> "true") { + Seq("a DECIMAL(3, 2)", "c DECIMAL(18, 1)", "d DECIMAL(37, 1)").foreach { schema => + val e = intercept[SparkException] { + readParquet(schema, path).collect() + }.getCause.getCause + assert(e.isInstanceOf[SchemaColumnConvertNotSupportedException]) + } + } + } + } } class ParquetV1QuerySuite extends ParquetQuerySuite { @@ -863,7 +918,7 @@ class ParquetV1QuerySuite extends ParquetQuerySuite { val df = spark.range(10).select(Seq.tabulate(11) {i => ('id + i).as(s"c$i")} : _*) df.write.mode(SaveMode.Overwrite).parquet(path) - // donot return batch, because whole stage codegen is disabled for wide table (>200 columns) + // do not return batch - whole stage codegen is disabled for wide table (>200 columns) val df2 = spark.read.parquet(path) val fileScan2 = df2.queryExecution.sparkPlan.find(_.isInstanceOf[FileSourceScanExec]).get assert(!fileScan2.asInstanceOf[FileSourceScanExec].supportsColumnar) @@ -896,7 +951,7 @@ class ParquetV2QuerySuite extends ParquetQuerySuite { val df = spark.range(10).select(Seq.tabulate(11) {i => ('id + i).as(s"c$i")} : _*) df.write.mode(SaveMode.Overwrite).parquet(path) - // donot return batch, because whole stage codegen is disabled for wide table (>200 columns) + // do not return batch - whole stage codegen is disabled for wide table (>200 columns) val df2 = spark.read.parquet(path) val fileScan2 = df2.queryExecution.sparkPlan.find(_.isInstanceOf[BatchScanExec]).get val parquetScan2 = fileScan2.asInstanceOf[BatchScanExec].scan.asInstanceOf[ParquetScan] diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRebaseDatetimeSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRebaseDatetimeSuite.scala new file mode 100644 index 0000000000000..6a49f3aea994e --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetRebaseDatetimeSuite.scala @@ -0,0 +1,391 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.datasources.parquet + +import java.nio.file.{Files, Paths, StandardCopyOption} +import java.sql.{Date, Timestamp} + +import org.apache.spark.{SparkConf, SparkException, SparkUpgradeException} +import org.apache.spark.sql.{QueryTest, Row, SPARK_LEGACY_DATETIME, SPARK_LEGACY_INT96} +import org.apache.spark.sql.catalyst.util.DateTimeTestUtils +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.internal.SQLConf.{LegacyBehaviorPolicy, ParquetOutputTimestampType} +import org.apache.spark.sql.internal.SQLConf.LegacyBehaviorPolicy.{CORRECTED, EXCEPTION, LEGACY} +import org.apache.spark.sql.test.SharedSparkSession + +abstract class ParquetRebaseDatetimeSuite + extends QueryTest + with ParquetTest + with SharedSparkSession { + + import testImplicits._ + + // It generates input files for the test below: + // "SPARK-31159: compatibility with Spark 2.4 in reading dates/timestamps" + ignore("SPARK-31806: generate test files for checking compatibility with Spark 2.4") { + val resourceDir = "sql/core/src/test/resources/test-data" + val version = "2_4_5" + val N = 8 + def save( + in: Seq[(String, String)], + t: String, + dstFile: String, + options: Map[String, String] = Map.empty): Unit = { + withTempDir { dir => + in.toDF("dict", "plain") + .select($"dict".cast(t), $"plain".cast(t)) + .repartition(1) + .write + .mode("overwrite") + .options(options) + .parquet(dir.getCanonicalPath) + Files.copy( + dir.listFiles().filter(_.getName.endsWith(".snappy.parquet")).head.toPath, + Paths.get(resourceDir, dstFile), + StandardCopyOption.REPLACE_EXISTING) + } + } + DateTimeTestUtils.withDefaultTimeZone(DateTimeTestUtils.LA) { + withSQLConf(SQLConf.SESSION_LOCAL_TIMEZONE.key -> DateTimeTestUtils.LA.getId) { + save( + (1 to N).map(i => ("1001-01-01", s"1001-01-0$i")), + "date", + s"before_1582_date_v$version.snappy.parquet") + withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> "TIMESTAMP_MILLIS") { + save( + (1 to N).map(i => ("1001-01-01 01:02:03.123", s"1001-01-0$i 01:02:03.123")), + "timestamp", + s"before_1582_timestamp_millis_v$version.snappy.parquet") + } + val usTs = (1 to N).map(i => ("1001-01-01 01:02:03.123456", s"1001-01-0$i 01:02:03.123456")) + withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> "TIMESTAMP_MICROS") { + save(usTs, "timestamp", s"before_1582_timestamp_micros_v$version.snappy.parquet") + } + withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> "INT96") { + // Comparing to other logical types, Parquet-MR chooses dictionary encoding for the + // INT96 logical type because it consumes less memory for small column cardinality. + // Huge parquet files doesn't make sense to place to the resource folder. That's why + // we explicitly set `parquet.enable.dictionary` and generate two files w/ and w/o + // dictionary encoding. + save( + usTs, + "timestamp", + s"before_1582_timestamp_int96_plain_v$version.snappy.parquet", + Map("parquet.enable.dictionary" -> "false")) + save( + usTs, + "timestamp", + s"before_1582_timestamp_int96_dict_v$version.snappy.parquet", + Map("parquet.enable.dictionary" -> "true")) + } + } + } + } + + private def inReadConfToOptions( + conf: String, + mode: LegacyBehaviorPolicy.Value): Map[String, String] = conf match { + case SQLConf.PARQUET_INT96_REBASE_MODE_IN_READ.key => + Map(ParquetOptions.INT96_REBASE_MODE -> mode.toString) + case _ => Map(ParquetOptions.DATETIME_REBASE_MODE -> mode.toString) + } + + private def runInMode( + conf: String, + modes: Seq[LegacyBehaviorPolicy.Value])(f: Map[String, String] => Unit): Unit = { + modes.foreach { mode => + withSQLConf(conf -> mode.toString) { f(Map.empty) } + } + withSQLConf(conf -> EXCEPTION.toString) { + modes.foreach { mode => + f(inReadConfToOptions(conf, mode)) + } + } + } + + test("SPARK-31159: compatibility with Spark 2.4 in reading dates/timestamps") { + val N = 8 + // test reading the existing 2.4 files and new 3.0 files (with rebase on/off) together. + def checkReadMixedFiles[T]( + fileName: String, + catalystType: String, + rowFunc: Int => (String, String), + toJavaType: String => T, + checkDefaultLegacyRead: String => Unit, + tsOutputType: String = "TIMESTAMP_MICROS", + inWriteConf: String = SQLConf.PARQUET_REBASE_MODE_IN_WRITE.key, + inReadConf: String = SQLConf.PARQUET_REBASE_MODE_IN_READ.key): Unit = { + withTempPaths(2) { paths => + paths.foreach(_.delete()) + val path2_4 = getResourceParquetFilePath("test-data/" + fileName) + val path3_0 = paths(0).getCanonicalPath + val path3_0_rebase = paths(1).getCanonicalPath + val df = Seq.tabulate(N)(rowFunc).toDF("dict", "plain") + .select($"dict".cast(catalystType), $"plain".cast(catalystType)) + withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> tsOutputType) { + checkDefaultLegacyRead(path2_4) + // By default we should fail to write ancient datetime values. + if (tsOutputType != "INT96") { + val e = intercept[SparkException](df.write.parquet(path3_0)) + assert(e.getCause.getCause.getCause.isInstanceOf[SparkUpgradeException]) + } + withSQLConf(inWriteConf -> CORRECTED.toString) { + df.write.mode("overwrite").parquet(path3_0) + } + withSQLConf(inWriteConf -> LEGACY.toString) { + df.write.parquet(path3_0_rebase) + } + } + // For Parquet files written by Spark 3.0, we know the writer info and don't need the + // config to guide the rebase behavior. + runInMode(inReadConf, Seq(LEGACY)) { options => + checkAnswer( + spark.read.format("parquet").options(options).load(path2_4, path3_0, path3_0_rebase), + (0 until N).flatMap { i => + val (dictS, plainS) = rowFunc(i) + Seq.tabulate(3) { _ => + Row(toJavaType(dictS), toJavaType(plainS)) + } + }) + } + } + } + def successInRead(path: String): Unit = spark.read.parquet(path).collect() + def failInRead(path: String): Unit = { + val e = intercept[SparkException](spark.read.parquet(path).collect()) + assert(e.getCause.isInstanceOf[SparkUpgradeException]) + } + Seq( + // By default we should fail to read ancient datetime values when parquet files don't + // contain Spark version. + "2_4_5" -> failInRead _, + "2_4_6" -> successInRead _).foreach { case (version, checkDefaultRead) => + withAllParquetReaders { + checkReadMixedFiles( + s"before_1582_date_v$version.snappy.parquet", + "date", + (i: Int) => ("1001-01-01", s"1001-01-0${i + 1}"), + java.sql.Date.valueOf, + checkDefaultRead) + checkReadMixedFiles( + s"before_1582_timestamp_micros_v$version.snappy.parquet", + "timestamp", + (i: Int) => ("1001-01-01 01:02:03.123456", s"1001-01-0${i + 1} 01:02:03.123456"), + java.sql.Timestamp.valueOf, + checkDefaultRead) + checkReadMixedFiles( + s"before_1582_timestamp_millis_v$version.snappy.parquet", + "timestamp", + (i: Int) => ("1001-01-01 01:02:03.123", s"1001-01-0${i + 1} 01:02:03.123"), + java.sql.Timestamp.valueOf, + checkDefaultRead, + tsOutputType = "TIMESTAMP_MILLIS") + } + } + Seq( + "2_4_5" -> failInRead _, + "2_4_6" -> successInRead _).foreach { case (version, checkDefaultRead) => + withAllParquetReaders { + Seq("plain", "dict").foreach { enc => + checkReadMixedFiles( + s"before_1582_timestamp_int96_${enc}_v$version.snappy.parquet", + "timestamp", + (i: Int) => ("1001-01-01 01:02:03.123456", s"1001-01-0${i + 1} 01:02:03.123456"), + java.sql.Timestamp.valueOf, + checkDefaultRead, + tsOutputType = "INT96", + inWriteConf = SQLConf.PARQUET_INT96_REBASE_MODE_IN_WRITE.key, + inReadConf = SQLConf.PARQUET_INT96_REBASE_MODE_IN_READ.key) + } + } + } + } + + test("SPARK-31159: rebasing timestamps in write") { + val N = 8 + Seq(false, true).foreach { dictionaryEncoding => + Seq( + ( + "TIMESTAMP_MILLIS", + "1001-01-01 01:02:03.123", + "1001-01-07 01:09:05.123", + SQLConf.PARQUET_REBASE_MODE_IN_WRITE.key, + SQLConf.PARQUET_REBASE_MODE_IN_READ.key), + ( + "TIMESTAMP_MICROS", + "1001-01-01 01:02:03.123456", + "1001-01-07 01:09:05.123456", + SQLConf.PARQUET_REBASE_MODE_IN_WRITE.key, + SQLConf.PARQUET_REBASE_MODE_IN_READ.key), + ( + "INT96", + "1001-01-01 01:02:03.123456", + "1001-01-07 01:09:05.123456", + SQLConf.PARQUET_INT96_REBASE_MODE_IN_WRITE.key, + SQLConf.PARQUET_INT96_REBASE_MODE_IN_READ.key + ) + ).foreach { case (outType, tsStr, nonRebased, inWriteConf, inReadConf) => + withClue(s"output type $outType") { + withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> outType) { + withTempPath { dir => + val path = dir.getAbsolutePath + withSQLConf(inWriteConf -> LEGACY.toString) { + Seq.tabulate(N)(_ => tsStr).toDF("tsS") + .select($"tsS".cast("timestamp").as("ts")) + .repartition(1) + .write + .option("parquet.enable.dictionary", dictionaryEncoding) + .parquet(path) + } + + withAllParquetReaders { + // The file metadata indicates if it needs rebase or not, so we can always get the + // correct result regardless of the "rebase mode" config. + runInMode(inReadConf, Seq(LEGACY, CORRECTED, EXCEPTION)) { options => + checkAnswer( + spark.read.options(options).parquet(path), + Seq.tabulate(N)(_ => Row(Timestamp.valueOf(tsStr)))) + } + + // Force to not rebase to prove the written datetime values are rebased + // and we will get wrong result if we don't rebase while reading. + withSQLConf("spark.test.forceNoRebase" -> "true") { + checkAnswer( + spark.read.parquet(path), + Seq.tabulate(N)(_ => Row(Timestamp.valueOf(nonRebased)))) + } + } + } + } + } + } + } + } + + test("SPARK-31159: rebasing dates in write") { + val N = 8 + Seq(false, true).foreach { dictionaryEncoding => + withTempPath { dir => + val path = dir.getAbsolutePath + withSQLConf(SQLConf.PARQUET_REBASE_MODE_IN_WRITE.key -> LEGACY.toString) { + Seq.tabulate(N)(_ => "1001-01-01").toDF("dateS") + .select($"dateS".cast("date").as("date")) + .repartition(1) + .write + .option("parquet.enable.dictionary", dictionaryEncoding) + .parquet(path) + } + + withAllParquetReaders { + // The file metadata indicates if it needs rebase or not, so we can always get the + // correct result regardless of the "rebase mode" config. + runInMode( + SQLConf.PARQUET_REBASE_MODE_IN_READ.key, + Seq(LEGACY, CORRECTED, EXCEPTION)) { options => + checkAnswer( + spark.read.options(options).parquet(path), + Seq.tabulate(N)(_ => Row(Date.valueOf("1001-01-01")))) + } + + // Force to not rebase to prove the written datetime values are rebased and we will get + // wrong result if we don't rebase while reading. + withSQLConf("spark.test.forceNoRebase" -> "true") { + checkAnswer( + spark.read.parquet(path), + Seq.tabulate(N)(_ => Row(Date.valueOf("1001-01-07")))) + } + } + } + } + } + + test("SPARK-33163: write the metadata key 'org.apache.spark.legacyDateTime'") { + def checkMetadataKey(dir: java.io.File, exists: Boolean): Unit = { + Seq("timestamp '1000-01-01 01:02:03'", "date '1000-01-01'").foreach { dt => + withSQLConf(SQLConf.PARQUET_OUTPUT_TIMESTAMP_TYPE.key -> + ParquetOutputTimestampType.TIMESTAMP_MICROS.toString) { + sql(s"SELECT $dt AS dt") + .repartition(1) + .write + .mode("overwrite") + .parquet(dir.getAbsolutePath) + val metaData = getMetaData(dir) + val expected = if (exists) Some("") else None + assert(metaData.get(SPARK_LEGACY_DATETIME) === expected) + } + } + } + withSQLConf(SQLConf.PARQUET_REBASE_MODE_IN_WRITE.key -> LEGACY.toString) { + withTempPath { dir => + checkMetadataKey(dir, exists = true) + } + } + withSQLConf(SQLConf.PARQUET_REBASE_MODE_IN_WRITE.key -> CORRECTED.toString) { + withTempPath { dir => + checkMetadataKey(dir, exists = false) + } + } + withSQLConf(SQLConf.PARQUET_REBASE_MODE_IN_WRITE.key -> EXCEPTION.toString) { + withTempPath { dir => intercept[SparkException] { checkMetadataKey(dir, exists = false) } } + } + } + + test("SPARK-33160: write the metadata key 'org.apache.spark.legacyINT96'") { + def saveTs(dir: java.io.File, ts: String = "1000-01-01 01:02:03"): Unit = { + Seq(Timestamp.valueOf(ts)).toDF() + .repartition(1) + .write + .parquet(dir.getAbsolutePath) + } + withSQLConf(SQLConf.PARQUET_INT96_REBASE_MODE_IN_WRITE.key -> LEGACY.toString) { + withTempPath { dir => + saveTs(dir) + assert(getMetaData(dir)(SPARK_LEGACY_INT96) === "") + } + } + withSQLConf(SQLConf.PARQUET_INT96_REBASE_MODE_IN_WRITE.key -> CORRECTED.toString) { + withTempPath { dir => + saveTs(dir) + assert(getMetaData(dir).get(SPARK_LEGACY_INT96).isEmpty) + } + } + withSQLConf(SQLConf.PARQUET_INT96_REBASE_MODE_IN_WRITE.key -> EXCEPTION.toString) { + withTempPath { dir => intercept[SparkException] { saveTs(dir) } } + } + withSQLConf(SQLConf.PARQUET_INT96_REBASE_MODE_IN_WRITE.key -> EXCEPTION.toString) { + withTempPath { dir => + saveTs(dir, "2020-10-22 01:02:03") + assert(getMetaData(dir).get(SPARK_LEGACY_INT96).isEmpty) + } + } + } +} + +class ParquetRebaseDatetimeV1Suite extends ParquetRebaseDatetimeSuite { + override protected def sparkConf: SparkConf = + super + .sparkConf + .set(SQLConf.USE_V1_SOURCE_LIST, "parquet") +} + +class ParquetRebaseDatetimeV2Suite extends ParquetRebaseDatetimeSuite { + override protected def sparkConf: SparkConf = + super + .sparkConf + .set(SQLConf.USE_V1_SOURCE_LIST, "") +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaPruningSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaPruningSuite.scala index c64e95078e916..cab93bd96fff4 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaPruningSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaPruningSuite.scala @@ -25,6 +25,7 @@ import org.apache.spark.sql.execution.datasources.SchemaPruningSuite import org.apache.spark.sql.execution.datasources.v2.BatchScanExec import org.apache.spark.sql.execution.datasources.v2.parquet.ParquetScan import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.tags.ExtendedSQLTest abstract class ParquetSchemaPruningSuite extends SchemaPruningSuite with AdaptiveSparkPlanHelper { override protected val dataSourceName: String = "parquet" @@ -33,6 +34,7 @@ abstract class ParquetSchemaPruningSuite extends SchemaPruningSuite with Adaptiv } +@ExtendedSQLTest class ParquetV1SchemaPruningSuite extends ParquetSchemaPruningSuite { override protected def sparkConf: SparkConf = super @@ -40,6 +42,7 @@ class ParquetV1SchemaPruningSuite extends ParquetSchemaPruningSuite { .set(SQLConf.USE_V1_SOURCE_LIST, "parquet") } +@ExtendedSQLTest class ParquetV2SchemaPruningSuite extends ParquetSchemaPruningSuite { // TODO: enable Parquet V2 write path after file source V2 writers are workable. override protected def sparkConf: SparkConf = diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaSuite.scala index 1274995fd6779..fcc08ee16e805 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetSchemaSuite.scala @@ -23,7 +23,7 @@ import scala.reflect.runtime.universe.TypeTag import org.apache.parquet.io.ParquetDecodingException import org.apache.parquet.schema.{MessageType, MessageTypeParser} -import org.apache.spark.{SparkConf, SparkException} +import org.apache.spark.SparkException import org.apache.spark.sql.catalyst.ScalaReflection import org.apache.spark.sql.execution.QueryExecutionException import org.apache.spark.sql.execution.datasources.SchemaColumnConvertNotSupportedException @@ -251,7 +251,7 @@ class ParquetSchemaInferenceSuite extends ParquetSchemaTest { """ |message root { | optional group _1 (MAP) { - | repeated group map (MAP_KEY_VALUE) { + | repeated group key_value (MAP_KEY_VALUE) { | required int32 key; | optional binary value (UTF8); | } @@ -262,6 +262,25 @@ class ParquetSchemaInferenceSuite extends ParquetSchemaTest { int96AsTimestamp = true, writeLegacyParquetFormat = true) + testSchemaInference[Tuple1[Map[(String, String), String]]]( + "map - group type key", + """ + |message root { + | optional group _1 (MAP) { + | repeated group key_value (MAP_KEY_VALUE) { + | required group key { + | optional binary _1 (UTF8); + | optional binary _2 (UTF8); + | } + | optional binary value (UTF8); + | } + | } + |} + """.stripMargin, + binaryAsString = true, + int96AsTimestamp = true, + writeLegacyParquetFormat = true) + testSchemaInference[Tuple1[(Int, String)]]( "struct", """ @@ -281,7 +300,7 @@ class ParquetSchemaInferenceSuite extends ParquetSchemaTest { """ |message root { | optional group _1 (MAP_KEY_VALUE) { - | repeated group map { + | repeated group key_value { | required int32 key; | optional group value { | optional binary _1 (UTF8); @@ -721,7 +740,7 @@ class ParquetSchemaSuite extends ParquetSchemaTest { nullable = true))), """message root { | optional group f1 (MAP_KEY_VALUE) { - | repeated group map { + | repeated group key_value { | required int32 num; | required binary str (UTF8); | } @@ -740,7 +759,7 @@ class ParquetSchemaSuite extends ParquetSchemaTest { nullable = true))), """message root { | optional group f1 (MAP) { - | repeated group map (MAP_KEY_VALUE) { + | repeated group key_value (MAP_KEY_VALUE) { | required int32 key; | required binary value (UTF8); | } @@ -778,7 +797,7 @@ class ParquetSchemaSuite extends ParquetSchemaTest { nullable = true))), """message root { | optional group f1 (MAP_KEY_VALUE) { - | repeated group map { + | repeated group key_value { | required int32 num; | optional binary str (UTF8); | } @@ -797,7 +816,7 @@ class ParquetSchemaSuite extends ParquetSchemaTest { nullable = true))), """message root { | optional group f1 (MAP) { - | repeated group map (MAP_KEY_VALUE) { + | repeated group key_value (MAP_KEY_VALUE) { | required int32 key; | optional binary value (UTF8); | } @@ -838,7 +857,7 @@ class ParquetSchemaSuite extends ParquetSchemaTest { nullable = true))), """message root { | optional group f1 (MAP) { - | repeated group map (MAP_KEY_VALUE) { + | repeated group key_value (MAP_KEY_VALUE) { | required int32 key; | required binary value (UTF8); | } @@ -874,7 +893,7 @@ class ParquetSchemaSuite extends ParquetSchemaTest { nullable = true))), """message root { | optional group f1 (MAP) { - | repeated group map (MAP_KEY_VALUE) { + | repeated group key_value (MAP_KEY_VALUE) { | required int32 key; | optional binary value (UTF8); | } @@ -1428,7 +1447,7 @@ class ParquetSchemaSuite extends ParquetSchemaTest { parquetSchema = """message root { | required group f0 (MAP) { - | repeated group map (MAP_KEY_VALUE) { + | repeated group key_value (MAP_KEY_VALUE) { | required int32 key; | required group value { | required int32 value_f0; @@ -1453,7 +1472,7 @@ class ParquetSchemaSuite extends ParquetSchemaTest { expectedSchema = """message root { | required group f0 (MAP) { - | repeated group map (MAP_KEY_VALUE) { + | repeated group key_value (MAP_KEY_VALUE) { | required int32 key; | required group value { | required int64 value_f1; diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetTest.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetTest.scala index c833d5f1ab1f6..7a4a382f7f5ce 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetTest.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetTest.scala @@ -25,9 +25,11 @@ import scala.reflect.runtime.universe.TypeTag import org.apache.hadoop.conf.Configuration import org.apache.hadoop.fs.Path +import org.apache.parquet.HadoopReadOptions import org.apache.parquet.format.converter.ParquetMetadataConverter import org.apache.parquet.hadoop.{Footer, ParquetFileReader, ParquetFileWriter} import org.apache.parquet.hadoop.metadata.{BlockMetaData, FileMetaData, ParquetMetadata} +import org.apache.parquet.hadoop.util.HadoopInputFile import org.apache.parquet.schema.MessageType import org.apache.spark.sql.DataFrame @@ -63,16 +65,12 @@ private[sql] trait ParquetTest extends FileBasedDataSourceTest { (f: String => Unit): Unit = withDataSourceFile(data)(f) /** - * Writes `df` dataframe to a Parquet file and reads it back as a [[DataFrame]], + * Writes `data` to a Parquet file and reads it back as a [[DataFrame]], * which is then passed to `f`. The Parquet file will be deleted after `f` returns. */ - protected def withParquetDataFrame(df: DataFrame, testVectorized: Boolean = true) - (f: DataFrame => Unit): Unit = { - withTempPath { file => - df.write.format(dataSourceName).save(file.getCanonicalPath) - readFile(file.getCanonicalPath, testVectorized)(f) - } - } + protected def withParquetDataFrame[T <: Product: ClassTag: TypeTag] + (data: Seq[T], testVectorized: Boolean = true) + (f: DataFrame => Unit): Unit = withDataSourceDataFrame(data, testVectorized)(f) /** * Writes `data` to a Parquet file, reads it back as a [[DataFrame]] and registers it as a @@ -139,7 +137,7 @@ private[sql] trait ParquetTest extends FileBasedDataSourceTest { } protected def readFooter(path: Path, configuration: Configuration): ParquetMetadata = { - ParquetFileReader.readFooter( + ParquetFooterReader.readFooter( configuration, new Path(path, ParquetFileWriter.PARQUET_METADATA_FILE), ParquetMetadataConverter.NO_FILTER) @@ -162,4 +160,25 @@ private[sql] trait ParquetTest extends FileBasedDataSourceTest { protected def getResourceParquetFilePath(name: String): String = { Thread.currentThread().getContextClassLoader.getResource(name).toString } + + def withAllParquetReaders(code: => Unit): Unit = { + // test the row-based reader + withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> "false")(code) + // test the vectorized reader + withSQLConf(SQLConf.PARQUET_VECTORIZED_READER_ENABLED.key -> "true")(code) + } + + def getMetaData(dir: java.io.File): Map[String, String] = { + val file = SpecificParquetRecordReaderBase.listDirectory(dir).get(0) + val conf = new Configuration() + val hadoopInputFile = HadoopInputFile.fromPath(new Path(file), conf) + val parquetReadOptions = HadoopReadOptions.builder(conf).build() + val m = ParquetFileReader.open(hadoopInputFile, parquetReadOptions) + val metadata = try { + m.getFileMetaData.getKeyValueMetaData + } finally { + m.close() + } + metadata.asScala.toMap + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/text/TextSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/text/TextSuite.scala index 7e97994476694..1eb32ed285799 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/text/TextSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/text/TextSuite.scala @@ -26,14 +26,17 @@ import org.apache.hadoop.io.compress.GzipCodec import org.apache.spark.{SparkConf, TestUtils} import org.apache.spark.sql.{AnalysisException, DataFrame, QueryTest, Row, SaveMode} +import org.apache.spark.sql.execution.datasources.CommonFileDataSourceSuite import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types.{StringType, StructType} import org.apache.spark.util.Utils -abstract class TextSuite extends QueryTest with SharedSparkSession { +abstract class TextSuite extends QueryTest with SharedSparkSession with CommonFileDataSourceSuite { import testImplicits._ + override protected def dataSourceFormat = "text" + test("reading text file") { verifyFrame(spark.read.format("text").load(testFile)) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalogSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalogSuite.scala index c399a011f9073..1a4f08418f8d3 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalogSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/V2SessionCatalogSuite.scala @@ -17,17 +17,19 @@ package org.apache.spark.sql.execution.datasources.v2 +import java.net.URI import java.util import java.util.Collections import scala.collection.JavaConverters._ +import org.apache.hadoop.fs.Path import org.scalatest.BeforeAndAfter import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.catalyst.analysis.{NamespaceAlreadyExistsException, NoSuchNamespaceException, NoSuchTableException, TableAlreadyExistsException} import org.apache.spark.sql.catalyst.parser.CatalystSqlParser -import org.apache.spark.sql.connector.catalog.{CatalogV2Util, Identifier, NamespaceChange, SupportsNamespaces, TableChange} +import org.apache.spark.sql.connector.catalog.{CatalogV2Util, Identifier, NamespaceChange, TableCatalog, TableChange, V1Table} import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types.{DoubleType, IntegerType, LongType, StringType, StructField, StructType, TimestampType} import org.apache.spark.sql.util.CaseInsensitiveStringMap @@ -44,7 +46,7 @@ abstract class V2SessionCatalogBaseSuite extends SharedSparkSession with BeforeA val testIdent: Identifier = Identifier.of(testNs, "test_table") def newCatalog(): V2SessionCatalog = { - val newCatalog = new V2SessionCatalog(spark.sessionState.catalog, spark.sessionState.conf) + val newCatalog = new V2SessionCatalog(spark.sessionState.catalog) newCatalog.initialize("test", CaseInsensitiveStringMap.empty()) newCatalog } @@ -160,6 +162,36 @@ class V2SessionCatalogTableSuite extends V2SessionCatalogBaseSuite { assert(catalog.tableExists(testIdent)) } + private def makeQualifiedPathWithWarehouse(path: String): URI = { + val p = new Path(spark.sessionState.conf.warehousePath, path) + val fs = p.getFileSystem(spark.sessionState.newHadoopConf()) + fs.makeQualified(p).toUri + + } + + test("createTable: location") { + val catalog = newCatalog() + val properties = new util.HashMap[String, String]() + assert(!catalog.tableExists(testIdent)) + + // default location + val t1 = catalog.createTable(testIdent, schema, Array.empty, properties).asInstanceOf[V1Table] + assert(t1.catalogTable.location === + spark.sessionState.catalog.defaultTablePath(testIdent.asTableIdentifier)) + catalog.dropTable(testIdent) + + // relative path + properties.put(TableCatalog.PROP_LOCATION, "relative/path") + val t2 = catalog.createTable(testIdent, schema, Array.empty, properties).asInstanceOf[V1Table] + assert(t2.catalogTable.location === makeQualifiedPathWithWarehouse("db.db/relative/path")) + catalog.dropTable(testIdent) + + // absolute path + properties.put(TableCatalog.PROP_LOCATION, "/absolute/path") + val t3 = catalog.createTable(testIdent, schema, Array.empty, properties).asInstanceOf[V1Table] + assert(t3.catalogTable.location.toString === "file:/absolute/path") + } + test("tableExists") { val catalog = newCatalog() @@ -640,6 +672,26 @@ class V2SessionCatalogTableSuite extends V2SessionCatalogBaseSuite { assert(exc.message.contains("not found")) } + test("alterTable: location") { + val catalog = newCatalog() + assert(!catalog.tableExists(testIdent)) + + // default location + val t1 = catalog.createTable(testIdent, schema, Array.empty, emptyProps).asInstanceOf[V1Table] + assert(t1.catalogTable.location === + spark.sessionState.catalog.defaultTablePath(testIdent.asTableIdentifier)) + + // relative path + val t2 = catalog.alterTable(testIdent, + TableChange.setProperty(TableCatalog.PROP_LOCATION, "relative/path")).asInstanceOf[V1Table] + assert(t2.catalogTable.location === makeQualifiedPathWithWarehouse("db.db/relative/path")) + + // absolute path + val t3 = catalog.alterTable(testIdent, + TableChange.setProperty(TableCatalog.PROP_LOCATION, "/absolute/path")).asInstanceOf[V1Table] + assert(t3.catalogTable.location.toString === "file:/absolute/path") + } + test("dropTable") { val catalog = newCatalog() @@ -812,11 +864,15 @@ class V2SessionCatalogNamespaceSuite extends V2SessionCatalogBaseSuite { test("createNamespace: basic behavior") { val catalog = newCatalog() - val expectedPath = sqlContext.sessionState.catalog.getDefaultDBPath(testNs(0)).toString + + val sessionCatalog = sqlContext.sessionState.catalog + val expectedPath = + new Path(spark.sessionState.conf.warehousePath, + sessionCatalog.getDefaultDBPath(testNs(0)).toString).toString catalog.createNamespace(testNs, Map("property" -> "value").asJava) - assert(expectedPath === spark.catalog.getDatabase(testNs(0)).locationUri.toString) + assert(expectedPath === spark.catalog.getDatabase(testNs(0)).locationUri) assert(catalog.namespaceExists(testNs) === true) val metadata = catalog.loadNamespaceMetadata(testNs).asScala @@ -842,6 +898,23 @@ class V2SessionCatalogNamespaceSuite extends V2SessionCatalogBaseSuite { catalog.dropNamespace(testNs) } + test("createNamespace: relative location") { + val catalog = newCatalog() + val expectedPath = + new Path(spark.sessionState.conf.warehousePath, "a/b/c").toString + + catalog.createNamespace(testNs, Map("location" -> "a/b/c").asJava) + + assert(expectedPath === spark.catalog.getDatabase(testNs(0)).locationUri) + + assert(catalog.namespaceExists(testNs) === true) + val metadata = catalog.loadNamespaceMetadata(testNs).asScala + checkMetadata(metadata, Map.empty) + assert(expectedPath === metadata("location")) + + catalog.dropNamespace(testNs) + } + test("createNamespace: fail if namespace already exists") { val catalog = newCatalog() @@ -954,16 +1027,23 @@ class V2SessionCatalogNamespaceSuite extends V2SessionCatalogBaseSuite { test("alterNamespace: update namespace location") { val catalog = newCatalog() - val initialPath = sqlContext.sessionState.catalog.getDefaultDBPath(testNs(0)).toString - val newPath = "file:/tmp/db.db" + val initialPath = + new Path(spark.sessionState.conf.warehousePath, + spark.sessionState.catalog.getDefaultDBPath(testNs(0)).toString).toString + val newAbsoluteUri = "file:/tmp/db.db" catalog.createNamespace(testNs, emptyProps) + assert(initialPath === spark.catalog.getDatabase(testNs(0)).locationUri) + catalog.alterNamespace(testNs, NamespaceChange.setProperty("location", newAbsoluteUri)) + assert(newAbsoluteUri === spark.catalog.getDatabase(testNs(0)).locationUri) - assert(initialPath === spark.catalog.getDatabase(testNs(0)).locationUri.toString) - - catalog.alterNamespace(testNs, NamespaceChange.setProperty("location", newPath)) + val newAbsolutePath = "/tmp/newAbsolutePath" + catalog.alterNamespace(testNs, NamespaceChange.setProperty("location", newAbsolutePath)) + assert("file:" + newAbsolutePath === spark.catalog.getDatabase(testNs(0)).locationUri) - assert(newPath === spark.catalog.getDatabase(testNs(0)).locationUri.toString) + val newRelativePath = new Path(spark.sessionState.conf.warehousePath, "relativeP").toString + catalog.alterNamespace(testNs, NamespaceChange.setProperty("location", "relativeP")) + assert(newRelativePath === spark.catalog.getDatabase(testNs(0)).locationUri) catalog.dropNamespace(testNs) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala new file mode 100644 index 0000000000000..b94d868120b28 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/datasources/v2/jdbc/JDBCTableCatalogSuite.scala @@ -0,0 +1,428 @@ +/* + * 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. + */ +package org.apache.spark.sql.execution.datasources.v2.jdbc + +import java.sql.{Connection, DriverManager} +import java.util.Properties + +import org.apache.log4j.Level + +import org.apache.spark.SparkConf +import org.apache.spark.sql.{AnalysisException, QueryTest, Row} +import org.apache.spark.sql.catalyst.analysis.{NoSuchNamespaceException, TableAlreadyExistsException} +import org.apache.spark.sql.catalyst.parser.ParseException +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types._ +import org.apache.spark.util.Utils + +class JDBCTableCatalogSuite extends QueryTest with SharedSparkSession { + + val tempDir = Utils.createTempDir() + val url = s"jdbc:h2:${tempDir.getCanonicalPath};user=testUser;password=testPass" + val defaultMetadata = new MetadataBuilder().putLong("scale", 0).build() + var conn: java.sql.Connection = null + + override def sparkConf: SparkConf = super.sparkConf + .set("spark.sql.catalog.h2", classOf[JDBCTableCatalog].getName) + .set("spark.sql.catalog.h2.url", url) + .set("spark.sql.catalog.h2.driver", "org.h2.Driver") + + private def withConnection[T](f: Connection => T): T = { + val conn = DriverManager.getConnection(url, new Properties()) + try { + f(conn) + } finally { + conn.close() + } + } + + override def beforeAll(): Unit = { + super.beforeAll() + Utils.classForName("org.h2.Driver") + withConnection { conn => + conn.prepareStatement("""CREATE SCHEMA "test"""").executeUpdate() + conn.prepareStatement( + """CREATE TABLE "test"."people" (name TEXT(32) NOT NULL, id INTEGER NOT NULL)""") + .executeUpdate() + } + } + + override def afterAll(): Unit = { + Utils.deleteRecursively(tempDir) + super.afterAll() + } + + test("show tables") { + checkAnswer(sql("SHOW TABLES IN h2.test"), Seq(Row("test", "people", false))) + // Check not existing namespace + checkAnswer(sql("SHOW TABLES IN h2.bad_test"), Seq()) + } + + test("drop a table and test whether the table exists") { + withConnection { conn => + conn.prepareStatement("""CREATE TABLE "test"."to_drop" (id INTEGER)""").executeUpdate() + } + checkAnswer(sql("SHOW TABLES IN h2.test"), + Seq(Row("test", "to_drop", false), Row("test", "people", false))) + sql("DROP TABLE h2.test.to_drop") + checkAnswer(sql("SHOW TABLES IN h2.test"), Seq(Row("test", "people", false))) + Seq( + "h2.test.not_existing_table" -> + "Table or view not found: h2.test.not_existing_table", + "h2.bad_test.not_existing_table" -> + "Table or view not found: h2.bad_test.not_existing_table" + ).foreach { case (table, expectedMsg) => + val msg = intercept[AnalysisException] { + sql(s"DROP TABLE $table") + }.getMessage + assert(msg.contains(expectedMsg)) + } + } + + test("rename a table") { + withTable("h2.test.dst_table") { + withConnection { conn => + conn.prepareStatement("""CREATE TABLE "test"."src_table" (id INTEGER)""").executeUpdate() + } + checkAnswer( + sql("SHOW TABLES IN h2.test"), + Seq(Row("test", "src_table", false), Row("test", "people", false))) + sql("ALTER TABLE h2.test.src_table RENAME TO test.dst_table") + checkAnswer( + sql("SHOW TABLES IN h2.test"), + Seq(Row("test", "dst_table", false), Row("test", "people", false))) + } + // Rename not existing table or namespace + val exp1 = intercept[AnalysisException] { + sql("ALTER TABLE h2.test.not_existing_table RENAME TO test.dst_table") + } + assert(exp1.getMessage.contains( + "Table or view not found: h2.test.not_existing_table")) + val exp2 = intercept[AnalysisException] { + sql("ALTER TABLE h2.bad_test.not_existing_table RENAME TO test.dst_table") + } + assert(exp2.getMessage.contains( + "Table or view not found: h2.bad_test.not_existing_table")) + // Rename to an existing table + withTable("h2.test.dst_table") { + withConnection { conn => + conn.prepareStatement("""CREATE TABLE "test"."dst_table" (id INTEGER)""").executeUpdate() + } + withTable("h2.test.src_table") { + withConnection { conn => + conn.prepareStatement("""CREATE TABLE "test"."src_table" (id INTEGER)""").executeUpdate() + } + val exp = intercept[TableAlreadyExistsException] { + sql("ALTER TABLE h2.test.src_table RENAME TO test.dst_table") + } + assert(exp.getMessage.contains( + "Failed table renaming from test.src_table to test.dst_table")) + assert(exp.cause.get.getMessage.contains("Table \"dst_table\" already exists")) + } + } + } + + test("load a table") { + val t = spark.table("h2.test.people") + val expectedSchema = new StructType() + .add("NAME", StringType, true, defaultMetadata) + .add("ID", IntegerType, true, defaultMetadata) + assert(t.schema === expectedSchema) + Seq("h2.test.not_existing_table", "h2.bad_test.not_existing_table").foreach { table => + val msg = intercept[AnalysisException] { + spark.table(table).schema + }.getMessage + assert(msg.contains("Table or view not found")) + } + } + + test("create a table") { + withTable("h2.test.new_table") { + sql("CREATE TABLE h2.test.new_table(i INT, j STRING)") + checkAnswer( + sql("SHOW TABLES IN h2.test"), + Seq(Row("test", "people", false), Row("test", "new_table", false))) + } + withTable("h2.test.new_table") { + sql("CREATE TABLE h2.test.new_table(i INT, j STRING)") + val msg = intercept[AnalysisException] { + sql("CREATE TABLE h2.test.new_table(i INT, j STRING)") + }.getMessage + assert(msg.contains("Table test.new_table already exists")) + } + val exp = intercept[NoSuchNamespaceException] { + sql("CREATE TABLE h2.bad_test.new_table(i INT, j STRING)") + } + assert(exp.getMessage.contains("Failed table creation: bad_test.new_table")) + assert(exp.cause.get.getMessage.contains("Schema \"bad_test\" not found")) + } + + test("ALTER TABLE ... add column") { + val tableName = "h2.test.alt_table" + withTable(tableName) { + sql(s"CREATE TABLE $tableName (ID INTEGER)") + sql(s"ALTER TABLE $tableName ADD COLUMNS (C1 INTEGER, C2 STRING)") + var t = spark.table(tableName) + var expectedSchema = new StructType() + .add("ID", IntegerType, true, defaultMetadata) + .add("C1", IntegerType, true, defaultMetadata) + .add("C2", StringType, true, defaultMetadata) + assert(t.schema === expectedSchema) + sql(s"ALTER TABLE $tableName ADD COLUMNS (c3 DOUBLE)") + t = spark.table(tableName) + expectedSchema = expectedSchema.add("c3", DoubleType, true, defaultMetadata) + assert(t.schema === expectedSchema) + // Add already existing column + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $tableName ADD COLUMNS (c3 DOUBLE)") + }.getMessage + assert(msg.contains("Cannot add column, because c3 already exists")) + } + // Add a column to not existing table and namespace + Seq("h2.test.not_existing_table", "h2.bad_test.not_existing_table").foreach { table => + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $table ADD COLUMNS (C4 STRING)") + }.getMessage + assert(msg.contains("Table not found")) + } + } + + test("ALTER TABLE ... rename column") { + val tableName = "h2.test.alt_table" + withTable(tableName) { + sql(s"CREATE TABLE $tableName (id INTEGER, C0 INTEGER)") + sql(s"ALTER TABLE $tableName RENAME COLUMN id TO C") + val t = spark.table(tableName) + val expectedSchema = new StructType() + .add("C", IntegerType, true, defaultMetadata) + .add("C0", IntegerType, true, defaultMetadata) + assert(t.schema === expectedSchema) + // Rename to already existing column + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $tableName RENAME COLUMN C TO C0") + }.getMessage + assert(msg.contains("Cannot rename column, because C0 already exists")) + } + // Rename a column in not existing table and namespace + Seq("h2.test.not_existing_table", "h2.bad_test.not_existing_table").foreach { table => + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $table RENAME COLUMN ID TO C") + }.getMessage + assert(msg.contains("Table not found")) + } + } + + test("ALTER TABLE ... drop column") { + val tableName = "h2.test.alt_table" + withTable(tableName) { + sql(s"CREATE TABLE $tableName (C1 INTEGER, C2 INTEGER, c3 INTEGER)") + sql(s"ALTER TABLE $tableName DROP COLUMN C1") + sql(s"ALTER TABLE $tableName DROP COLUMN c3") + val t = spark.table(tableName) + val expectedSchema = new StructType().add("C2", IntegerType, true, defaultMetadata) + assert(t.schema === expectedSchema) + // Drop not existing column + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $tableName DROP COLUMN bad_column") + }.getMessage + assert(msg.contains("Cannot delete missing field bad_column in test.alt_table schema")) + } + // Drop a column to not existing table and namespace + Seq("h2.test.not_existing_table", "h2.bad_test.not_existing_table").foreach { table => + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $table DROP COLUMN C1") + }.getMessage + assert(msg.contains("Table not found")) + } + } + + test("ALTER TABLE ... update column type") { + val tableName = "h2.test.alt_table" + withTable(tableName) { + sql(s"CREATE TABLE $tableName (ID INTEGER, deptno INTEGER)") + sql(s"ALTER TABLE $tableName ALTER COLUMN id TYPE DOUBLE") + sql(s"ALTER TABLE $tableName ALTER COLUMN deptno TYPE DOUBLE") + val t = spark.table(tableName) + val expectedSchema = new StructType() + .add("ID", DoubleType, true, defaultMetadata) + .add("deptno", DoubleType, true, defaultMetadata) + assert(t.schema === expectedSchema) + // Update not existing column + val msg1 = intercept[AnalysisException] { + sql(s"ALTER TABLE $tableName ALTER COLUMN bad_column TYPE DOUBLE") + }.getMessage + assert(msg1.contains("Cannot update missing field bad_column in test.alt_table schema")) + // Update column to wrong type + val msg2 = intercept[ParseException] { + sql(s"ALTER TABLE $tableName ALTER COLUMN id TYPE bad_type") + }.getMessage + assert(msg2.contains("DataType bad_type is not supported")) + } + // Update column type in not existing table and namespace + Seq("h2.test.not_existing_table", "h2.bad_test.not_existing_table").foreach { table => + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $table ALTER COLUMN id TYPE DOUBLE") + }.getMessage + assert(msg.contains("Table not found")) + } + } + + test("ALTER TABLE ... update column nullability") { + val tableName = "h2.test.alt_table" + withTable(tableName) { + sql(s"CREATE TABLE $tableName (ID INTEGER NOT NULL, deptno INTEGER NOT NULL)") + sql(s"ALTER TABLE $tableName ALTER COLUMN ID DROP NOT NULL") + sql(s"ALTER TABLE $tableName ALTER COLUMN deptno DROP NOT NULL") + val t = spark.table(tableName) + val expectedSchema = new StructType() + .add("ID", IntegerType, true, defaultMetadata) + .add("deptno", IntegerType, true, defaultMetadata) + assert(t.schema === expectedSchema) + // Update nullability of not existing column + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $tableName ALTER COLUMN bad_column DROP NOT NULL") + }.getMessage + assert(msg.contains("Cannot update missing field bad_column in test.alt_table")) + } + // Update column nullability in not existing table and namespace + Seq("h2.test.not_existing_table", "h2.bad_test.not_existing_table").foreach { table => + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $table ALTER COLUMN ID DROP NOT NULL") + }.getMessage + assert(msg.contains("Table not found")) + } + } + + test("ALTER TABLE ... update column comment not supported") { + val tableName = "h2.test.alt_table" + withTable(tableName) { + sql(s"CREATE TABLE $tableName (ID INTEGER)") + val exp = intercept[AnalysisException] { + sql(s"ALTER TABLE $tableName ALTER COLUMN ID COMMENT 'test'") + } + assert(exp.getMessage.contains("Failed table altering: test.alt_table")) + assert(exp.cause.get.getMessage.contains("Unsupported TableChange")) + // Update comment for not existing column + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $tableName ALTER COLUMN bad_column COMMENT 'test'") + }.getMessage + assert(msg.contains("Cannot update missing field bad_column in test.alt_table")) + } + // Update column comments in not existing table and namespace + Seq("h2.test.not_existing_table", "h2.bad_test.not_existing_table").foreach { table => + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $table ALTER COLUMN ID COMMENT 'test'") + }.getMessage + assert(msg.contains("Table not found")) + } + } + + test("ALTER TABLE case sensitivity") { + val tableName = "h2.test.alt_table" + withTable(tableName) { + sql(s"CREATE TABLE $tableName (c1 INTEGER NOT NULL, c2 INTEGER)") + var t = spark.table(tableName) + var expectedSchema = new StructType() + .add("c1", IntegerType, true, defaultMetadata) + .add("c2", IntegerType, true, defaultMetadata) + assert(t.schema === expectedSchema) + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $tableName RENAME COLUMN C2 TO c3") + }.getMessage + assert(msg.contains("Cannot rename missing field C2 in test.alt_table schema")) + } + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + sql(s"ALTER TABLE $tableName RENAME COLUMN C2 TO c3") + expectedSchema = new StructType() + .add("c1", IntegerType, true, defaultMetadata) + .add("c3", IntegerType, true, defaultMetadata) + t = spark.table(tableName) + assert(t.schema === expectedSchema) + } + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $tableName DROP COLUMN C3") + }.getMessage + assert(msg.contains("Cannot delete missing field C3 in test.alt_table schema")) + } + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + sql(s"ALTER TABLE $tableName DROP COLUMN C3") + expectedSchema = new StructType().add("c1", IntegerType, true, defaultMetadata) + t = spark.table(tableName) + assert(t.schema === expectedSchema) + } + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $tableName ALTER COLUMN C1 TYPE DOUBLE") + }.getMessage + assert(msg.contains("Cannot update missing field C1 in test.alt_table schema")) + } + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + sql(s"ALTER TABLE $tableName ALTER COLUMN C1 TYPE DOUBLE") + expectedSchema = new StructType().add("c1", DoubleType, true, defaultMetadata) + t = spark.table(tableName) + assert(t.schema === expectedSchema) + } + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "true") { + val msg = intercept[AnalysisException] { + sql(s"ALTER TABLE $tableName ALTER COLUMN C1 DROP NOT NULL") + }.getMessage + assert(msg.contains("Cannot update missing field C1 in test.alt_table schema")) + } + + withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { + sql(s"ALTER TABLE $tableName ALTER COLUMN C1 DROP NOT NULL") + expectedSchema = new StructType().add("c1", DoubleType, true, defaultMetadata) + t = spark.table(tableName) + assert(t.schema === expectedSchema) + } + } + } + + test("CREATE TABLE with table comment") { + withTable("h2.test.new_table") { + val logAppender = new LogAppender("table comment") + withLogAppender(logAppender) { + sql("CREATE TABLE h2.test.new_table(i INT, j STRING) COMMENT 'this is a comment'") + } + val createCommentWarning = logAppender.loggingEvents + .filter(_.getLevel == Level.WARN) + .map(_.getRenderedMessage) + .exists(_.contains("Cannot create JDBC table comment")) + assert(createCommentWarning === false) + } + } + + test("CREATE TABLE with table property") { + withTable("h2.test.new_table") { + val m = intercept[AnalysisException] { + sql("CREATE TABLE h2.test.new_table(i INT, j STRING)" + + " TBLPROPERTIES('ENGINE'='tableEngineName')") + }.cause.get.getMessage + assert(m.contains("\"TABLEENGINENAME\" not found")) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/debug/DebuggingSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/debug/DebuggingSuite.scala index e9ef7c1a0c540..5085c7483b370 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/debug/DebuggingSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/debug/DebuggingSuite.scala @@ -24,14 +24,13 @@ import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.Attribute import org.apache.spark.sql.catalyst.expressions.codegen.CodegenContext import org.apache.spark.sql.execution.{CodegenSupport, LeafExecNode, WholeStageCodegenExec} -import org.apache.spark.sql.execution.adaptive.DisableAdaptiveExecutionSuite +import org.apache.spark.sql.execution.adaptive.{DisableAdaptiveExecutionSuite, EnableAdaptiveExecutionSuite} import org.apache.spark.sql.functions._ import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.test.SQLTestData.TestData import org.apache.spark.sql.types.StructType -// Disable AQE because the WholeStageCodegenExec is added when running QueryStageExec -class DebuggingSuite extends SharedSparkSession with DisableAdaptiveExecutionSuite { +abstract class DebuggingSuiteBase extends SharedSparkSession { test("DataFrame.debug()") { testData.debug() @@ -43,62 +42,23 @@ class DebuggingSuite extends SharedSparkSession with DisableAdaptiveExecutionSui } test("debugCodegen") { - val res = codegenString(spark.range(10).groupBy(col("id") * 2).count() - .queryExecution.executedPlan) + val df = spark.range(10).groupBy(col("id") * 2).count() + df.collect() + val res = codegenString(df.queryExecution.executedPlan) assert(res.contains("Subtree 1 / 2")) assert(res.contains("Subtree 2 / 2")) assert(res.contains("Object[]")) } test("debugCodegenStringSeq") { - val res = codegenStringSeq(spark.range(10).groupBy(col("id") * 2).count() - .queryExecution.executedPlan) + val df = spark.range(10).groupBy(col("id") * 2).count() + df.collect() + val res = codegenStringSeq(df.queryExecution.executedPlan) assert(res.length == 2) assert(res.forall{ case (subtree, code, _) => subtree.contains("Range") && code.contains("Object[]")}) } - test("SPARK-28537: DebugExec cannot debug broadcast related queries") { - val rightDF = spark.range(10) - val leftDF = spark.range(10) - val joinedDF = leftDF.join(rightDF, leftDF("id") === rightDF("id")) - - val captured = new ByteArrayOutputStream() - Console.withOut(captured) { - joinedDF.debug() - } - - val output = captured.toString() - assert(output.replaceAll("\\[id=#\\d+\\]", "[id=#x]").contains( - """== BroadcastExchange HashedRelationBroadcastMode(List(input[0, bigint, false])), [id=#x] == - |Tuples output: 0 - | id LongType: {} - |== WholeStageCodegen (1) == - |Tuples output: 10 - | id LongType: {java.lang.Long} - |== Range (0, 10, step=1, splits=2) == - |Tuples output: 0 - | id LongType: {}""".stripMargin)) - } - - test("SPARK-28537: DebugExec cannot debug columnar related queries") { - val df = spark.range(5) - df.persist() - - val captured = new ByteArrayOutputStream() - Console.withOut(captured) { - df.debug() - } - df.unpersist() - - val output = captured.toString().replaceAll("#\\d+", "#x") - assert(output.contains( - """== InMemoryTableScan [id#xL] == - |Tuples output: 0 - | id LongType: {} - |""".stripMargin)) - } - case class DummyCodeGeneratorPlan(useInnerClass: Boolean) extends CodegenSupport with LeafExecNode { override def output: Seq[Attribute] = StructType.fromDDL("d int").toAttributes @@ -136,3 +96,51 @@ class DebuggingSuite extends SharedSparkSession with DisableAdaptiveExecutionSui } } } + +// Disable AQE because the WholeStageCodegenExec is added when running QueryStageExec +class DebuggingSuite extends DebuggingSuiteBase with DisableAdaptiveExecutionSuite { + + test("SPARK-28537: DebugExec cannot debug broadcast related queries") { + val rightDF = spark.range(10) + val leftDF = spark.range(10) + val joinedDF = leftDF.join(rightDF, leftDF("id") === rightDF("id")) + + val captured = new ByteArrayOutputStream() + Console.withOut(captured) { + joinedDF.debug() + } + + val output = captured.toString() + val hashedModeString = "HashedRelationBroadcastMode(List(input[0, bigint, false]),false)" + assert(output.replaceAll("\\[id=#\\d+\\]", "[id=#x]").contains( + s"""== BroadcastExchange $hashedModeString, [id=#x] == + |Tuples output: 0 + | id LongType: {} + |== WholeStageCodegen (1) == + |Tuples output: 10 + | id LongType: {java.lang.Long} + |== Range (0, 10, step=1, splits=2) == + |Tuples output: 0 + | id LongType: {}""".stripMargin)) + } + + test("SPARK-28537: DebugExec cannot debug columnar related queries") { + val df = spark.range(5) + df.persist() + + val captured = new ByteArrayOutputStream() + Console.withOut(captured) { + df.debug() + } + df.unpersist() + + val output = captured.toString().replaceAll("#\\d+", "#x") + assert(output.contains( + """== InMemoryTableScan [id#xL] == + |Tuples output: 0 + | id LongType: {} + |""".stripMargin)) + } +} + +class DebuggingSuiteAE extends DebuggingSuiteBase with EnableAdaptiveExecutionSuite diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/exchange/EnsureRequirementsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/exchange/EnsureRequirementsSuite.scala new file mode 100644 index 0000000000000..061799f439e5b --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/exchange/EnsureRequirementsSuite.scala @@ -0,0 +1,122 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.exchange + +import org.apache.spark.sql.catalyst.expressions.Literal +import org.apache.spark.sql.catalyst.plans.Inner +import org.apache.spark.sql.catalyst.plans.physical.{HashPartitioning, PartitioningCollection} +import org.apache.spark.sql.execution.{DummySparkPlan, SortExec} +import org.apache.spark.sql.execution.joins.SortMergeJoinExec +import org.apache.spark.sql.test.SharedSparkSession + +class EnsureRequirementsSuite extends SharedSparkSession { + private val exprA = Literal(1) + private val exprB = Literal(2) + private val exprC = Literal(3) + + test("reorder should handle PartitioningCollection") { + val plan1 = DummySparkPlan( + outputPartitioning = PartitioningCollection(Seq( + HashPartitioning(exprA :: exprB :: Nil, 5), + HashPartitioning(exprA :: Nil, 5)))) + val plan2 = DummySparkPlan() + + // Test PartitioningCollection on the left side of join. + val smjExec1 = SortMergeJoinExec( + exprB :: exprA :: Nil, exprA :: exprB :: Nil, Inner, None, plan1, plan2) + EnsureRequirements.apply(smjExec1) match { + case SortMergeJoinExec(leftKeys, rightKeys, _, _, + SortExec(_, _, DummySparkPlan(_, _, _: PartitioningCollection, _, _), _), + SortExec(_, _, ShuffleExchangeExec(_: HashPartitioning, _, _), _), _) => + assert(leftKeys === Seq(exprA, exprB)) + assert(rightKeys === Seq(exprB, exprA)) + case other => fail(other.toString) + } + + // Test PartitioningCollection on the right side of join. + val smjExec2 = SortMergeJoinExec( + exprA :: exprB :: Nil, exprB :: exprA :: Nil, Inner, None, plan2, plan1) + EnsureRequirements.apply(smjExec2) match { + case SortMergeJoinExec(leftKeys, rightKeys, _, _, + SortExec(_, _, ShuffleExchangeExec(_: HashPartitioning, _, _), _), + SortExec(_, _, DummySparkPlan(_, _, _: PartitioningCollection, _, _), _), _) => + assert(leftKeys === Seq(exprB, exprA)) + assert(rightKeys === Seq(exprA, exprB)) + case other => fail(other.toString) + } + + // Both sides are PartitioningCollection, but left side cannot be reordered to match + // and it should fall back to the right side. + val smjExec3 = SortMergeJoinExec( + exprA :: exprC :: Nil, exprB :: exprA :: Nil, Inner, None, plan1, plan1) + EnsureRequirements.apply(smjExec3) match { + case SortMergeJoinExec(leftKeys, rightKeys, _, _, + SortExec(_, _, ShuffleExchangeExec(_: HashPartitioning, _, _), _), + SortExec(_, _, DummySparkPlan(_, _, _: PartitioningCollection, _, _), _), _) => + assert(leftKeys === Seq(exprC, exprA)) + assert(rightKeys === Seq(exprA, exprB)) + case other => fail(other.toString) + } + } + + test("reorder should fallback to the other side partitioning") { + val plan1 = DummySparkPlan( + outputPartitioning = HashPartitioning(exprA :: exprB :: exprC :: Nil, 5)) + val plan2 = DummySparkPlan( + outputPartitioning = HashPartitioning(exprB :: exprC :: Nil, 5)) + + // Test fallback to the right side, which has HashPartitioning. + val smjExec1 = SortMergeJoinExec( + exprA :: exprB :: Nil, exprC :: exprB :: Nil, Inner, None, plan1, plan2) + EnsureRequirements.apply(smjExec1) match { + case SortMergeJoinExec(leftKeys, rightKeys, _, _, + SortExec(_, _, ShuffleExchangeExec(_: HashPartitioning, _, _), _), + SortExec(_, _, DummySparkPlan(_, _, _: HashPartitioning, _, _), _), _) => + assert(leftKeys === Seq(exprB, exprA)) + assert(rightKeys === Seq(exprB, exprC)) + case other => fail(other.toString) + } + + // Test fallback to the right side, which has PartitioningCollection. + val plan3 = DummySparkPlan( + outputPartitioning = PartitioningCollection(Seq(HashPartitioning(exprB :: exprC :: Nil, 5)))) + val smjExec2 = SortMergeJoinExec( + exprA :: exprB :: Nil, exprC :: exprB :: Nil, Inner, None, plan1, plan3) + EnsureRequirements.apply(smjExec2) match { + case SortMergeJoinExec(leftKeys, rightKeys, _, _, + SortExec(_, _, ShuffleExchangeExec(_: HashPartitioning, _, _), _), + SortExec(_, _, DummySparkPlan(_, _, _: PartitioningCollection, _, _), _), _) => + assert(leftKeys === Seq(exprB, exprA)) + assert(rightKeys === Seq(exprB, exprC)) + case other => fail(other.toString) + } + + // The right side has HashPartitioning, so it is matched first, but no reordering match is + // found, and it should fall back to the left side, which has a PartitioningCollection. + val smjExec3 = SortMergeJoinExec( + exprC :: exprB :: Nil, exprA :: exprB :: Nil, Inner, None, plan3, plan1) + EnsureRequirements.apply(smjExec3) match { + case SortMergeJoinExec(leftKeys, rightKeys, _, _, + SortExec(_, _, DummySparkPlan(_, _, _: PartitioningCollection, _, _), _), + SortExec(_, _, ShuffleExchangeExec(_: HashPartitioning, _, _), _), _) => + assert(leftKeys === Seq(exprB, exprC)) + assert(rightKeys === Seq(exprB, exprA)) + case other => fail(other.toString) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/BroadcastJoinSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/BroadcastJoinSuite.scala index 1be9308c06d8c..98a1089709b92 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/BroadcastJoinSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/BroadcastJoinSuite.scala @@ -21,12 +21,15 @@ import scala.reflect.ClassTag import org.apache.spark.AccumulatorSuite import org.apache.spark.sql.{Dataset, QueryTest, Row, SparkSession} -import org.apache.spark.sql.catalyst.expressions.{BitwiseAnd, BitwiseOr, Cast, Literal, ShiftLeft} +import org.apache.spark.sql.catalyst.expressions.{AttributeReference, BitwiseAnd, BitwiseOr, Cast, Expression, Literal, ShiftLeft} +import org.apache.spark.sql.catalyst.optimizer.{BuildLeft, BuildRight, BuildSide} +import org.apache.spark.sql.catalyst.plans.Inner import org.apache.spark.sql.catalyst.plans.logical.BROADCAST -import org.apache.spark.sql.execution.{SparkPlan, WholeStageCodegenExec} -import org.apache.spark.sql.execution.adaptive.{AdaptiveSparkPlanHelper, AdaptiveTestUtils, DisableAdaptiveExecutionSuite, EnableAdaptiveExecutionSuite} +import org.apache.spark.sql.catalyst.plans.physical.{HashPartitioning, PartitioningCollection} +import org.apache.spark.sql.execution.{DummySparkPlan, SparkPlan, WholeStageCodegenExec} +import org.apache.spark.sql.execution.adaptive.{AdaptiveSparkPlanHelper, DisableAdaptiveExecutionSuite, EnableAdaptiveExecutionSuite} import org.apache.spark.sql.execution.columnar.InMemoryTableScanExec -import org.apache.spark.sql.execution.exchange.EnsureRequirements +import org.apache.spark.sql.execution.exchange.{EnsureRequirements, ShuffleExchangeExec} import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SQLTestUtils @@ -88,7 +91,7 @@ abstract class BroadcastJoinSuiteBase extends QueryTest with SQLTestUtils } else { df1.join(df2, joinExpression, joinType) } - val plan = EnsureRequirements(spark.sessionState.conf).apply(df3.queryExecution.sparkPlan) + val plan = EnsureRequirements.apply(df3.queryExecution.sparkPlan) assert(plan.collect { case p: T => p }.size === 1) plan } @@ -168,7 +171,7 @@ abstract class BroadcastJoinSuiteBase extends QueryTest with SQLTestUtils val df4 = Seq((1, "5"), (2, "5")).toDF("key", "value") val df5 = df4.join(df3, Seq("key"), "inner") - val plan = EnsureRequirements(spark.sessionState.conf).apply(df5.queryExecution.sparkPlan) + val plan = EnsureRequirements.apply(df5.queryExecution.sparkPlan) assert(plan.collect { case p: BroadcastHashJoinExec => p }.size === 1) assert(plan.collect { case p: SortMergeJoinExec => p }.size === 1) @@ -179,7 +182,7 @@ abstract class BroadcastJoinSuiteBase extends QueryTest with SQLTestUtils val df1 = Seq((1, "4"), (2, "2")).toDF("key", "value") val joined = df1.join(df, Seq("key"), "inner") - val plan = EnsureRequirements(spark.sessionState.conf).apply(joined.queryExecution.sparkPlan) + val plan = EnsureRequirements.apply(joined.queryExecution.sparkPlan) assert(plan.collect { case p: BroadcastHashJoinExec => p }.size === 1) } @@ -239,33 +242,40 @@ abstract class BroadcastJoinSuiteBase extends QueryTest with SQLTestUtils assert(HashJoin.rewriteKeyExpr(l :: l :: Nil) === l :: l :: Nil) assert(HashJoin.rewriteKeyExpr(l :: i :: Nil) === l :: i :: Nil) - assert(HashJoin.rewriteKeyExpr(i :: Nil) === Cast(i, LongType) :: Nil) + assert(HashJoin.rewriteKeyExpr(i :: Nil) === + Cast(i, LongType, Some(conf.sessionLocalTimeZone)) :: Nil) assert(HashJoin.rewriteKeyExpr(i :: l :: Nil) === i :: l :: Nil) assert(HashJoin.rewriteKeyExpr(i :: i :: Nil) === - BitwiseOr(ShiftLeft(Cast(i, LongType), Literal(32)), - BitwiseAnd(Cast(i, LongType), Literal((1L << 32) - 1))) :: Nil) + BitwiseOr(ShiftLeft(Cast(i, LongType, Some(conf.sessionLocalTimeZone)), Literal(32)), + BitwiseAnd(Cast(i, LongType, Some(conf.sessionLocalTimeZone)), Literal((1L << 32) - 1))) :: + Nil) assert(HashJoin.rewriteKeyExpr(i :: i :: i :: Nil) === i :: i :: i :: Nil) - assert(HashJoin.rewriteKeyExpr(s :: Nil) === Cast(s, LongType) :: Nil) + assert(HashJoin.rewriteKeyExpr(s :: Nil) === + Cast(s, LongType, Some(conf.sessionLocalTimeZone)) :: Nil) assert(HashJoin.rewriteKeyExpr(s :: l :: Nil) === s :: l :: Nil) assert(HashJoin.rewriteKeyExpr(s :: s :: Nil) === - BitwiseOr(ShiftLeft(Cast(s, LongType), Literal(16)), - BitwiseAnd(Cast(s, LongType), Literal((1L << 16) - 1))) :: Nil) + BitwiseOr(ShiftLeft(Cast(s, LongType, Some(conf.sessionLocalTimeZone)), Literal(16)), + BitwiseAnd(Cast(s, LongType, Some(conf.sessionLocalTimeZone)), Literal((1L << 16) - 1))) :: + Nil) assert(HashJoin.rewriteKeyExpr(s :: s :: s :: Nil) === BitwiseOr(ShiftLeft( - BitwiseOr(ShiftLeft(Cast(s, LongType), Literal(16)), - BitwiseAnd(Cast(s, LongType), Literal((1L << 16) - 1))), + BitwiseOr(ShiftLeft(Cast(s, LongType, Some(conf.sessionLocalTimeZone)), Literal(16)), + BitwiseAnd(Cast(s, LongType, Some(conf.sessionLocalTimeZone)), Literal((1L << 16) - 1))), Literal(16)), - BitwiseAnd(Cast(s, LongType), Literal((1L << 16) - 1))) :: Nil) + BitwiseAnd(Cast(s, LongType, Some(conf.sessionLocalTimeZone)), Literal((1L << 16) - 1))) :: + Nil) assert(HashJoin.rewriteKeyExpr(s :: s :: s :: s :: Nil) === BitwiseOr(ShiftLeft( BitwiseOr(ShiftLeft( - BitwiseOr(ShiftLeft(Cast(s, LongType), Literal(16)), - BitwiseAnd(Cast(s, LongType), Literal((1L << 16) - 1))), + BitwiseOr(ShiftLeft(Cast(s, LongType, Some(conf.sessionLocalTimeZone)), Literal(16)), + BitwiseAnd(Cast(s, LongType, Some(conf.sessionLocalTimeZone)), + Literal((1L << 16) - 1))), Literal(16)), - BitwiseAnd(Cast(s, LongType), Literal((1L << 16) - 1))), + BitwiseAnd(Cast(s, LongType, Some(conf.sessionLocalTimeZone)), Literal((1L << 16) - 1))), Literal(16)), - BitwiseAnd(Cast(s, LongType), Literal((1L << 16) - 1))) :: Nil) + BitwiseAnd(Cast(s, LongType, Some(conf.sessionLocalTimeZone)), Literal((1L << 16) - 1))) :: + Nil) assert(HashJoin.rewriteKeyExpr(s :: s :: s :: s :: s :: Nil) === s :: s :: s :: s :: s :: Nil) @@ -411,9 +421,221 @@ abstract class BroadcastJoinSuiteBase extends QueryTest with SQLTestUtils val e = intercept[Exception] { testDf.collect() } - AdaptiveTestUtils.assertExceptionMessage(e, s"Could not execute broadcast in $timeout secs.") + assert(e.getMessage.contains(s"Could not execute broadcast in $timeout secs.")) } } + + test("broadcast join where streamed side's output partitioning is HashPartitioning") { + withTable("t1", "t3") { + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "500") { + val df1 = (0 until 100).map(i => (i % 5, i % 13)).toDF("i1", "j1") + val df2 = (0 until 20).map(i => (i % 7, i % 11)).toDF("i2", "j2") + val df3 = (0 until 100).map(i => (i % 5, i % 13)).toDF("i3", "j3") + df1.write.format("parquet").bucketBy(8, "i1", "j1").saveAsTable("t1") + df3.write.format("parquet").bucketBy(8, "i3", "j3").saveAsTable("t3") + val t1 = spark.table("t1") + val t3 = spark.table("t3") + + // join1 is a broadcast join where df2 is broadcasted. Note that output partitioning on the + // streamed side (t1) is HashPartitioning (bucketed files). + val join1 = t1.join(df2, t1("i1") === df2("i2") && t1("j1") === df2("j2")) + withSQLConf(SQLConf.AUTO_BUCKETED_SCAN_ENABLED.key -> "false") { + val plan1 = join1.queryExecution.executedPlan + assert(collect(plan1) { case e: ShuffleExchangeExec => e }.isEmpty) + val broadcastJoins = collect(plan1) { case b: BroadcastHashJoinExec => b } + assert(broadcastJoins.size == 1) + assert(broadcastJoins(0).outputPartitioning.isInstanceOf[PartitioningCollection]) + val p = broadcastJoins(0).outputPartitioning.asInstanceOf[PartitioningCollection] + assert(p.partitionings.size == 4) + // Verify all the combinations of output partitioning. + Seq(Seq(t1("i1"), t1("j1")), + Seq(t1("i1"), df2("j2")), + Seq(df2("i2"), t1("j1")), + Seq(df2("i2"), df2("j2"))).foreach { expected => + val expectedExpressions = expected.map(_.expr) + assert(p.partitionings.exists { + case h: HashPartitioning => expressionsEqual(h.expressions, expectedExpressions) + }) + } + } + + // Join on the column from the broadcasted side (i2, j2) and make sure output partitioning + // is maintained by checking no shuffle exchange is introduced. + val join2 = join1.join(t3, join1("i2") === t3("i3") && join1("j2") === t3("j3")) + val plan2 = join2.queryExecution.executedPlan + assert(collect(plan2) { case s: SortMergeJoinExec => s }.size == 1) + assert(collect(plan2) { case b: BroadcastHashJoinExec => b }.size == 1) + assert(collect(plan2) { case e: ShuffleExchangeExec => e }.isEmpty) + + // Validate the data with broadcast join off. + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + val df = join1.join(t3, join1("i2") === t3("i3") && join1("j2") === t3("j3")) + checkAnswer(join2, df) + } + } + } + } + + test("broadcast join where streamed side's output partitioning is PartitioningCollection") { + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "500") { + val t1 = (0 until 100).map(i => (i % 5, i % 13)).toDF("i1", "j1") + val t2 = (0 until 100).map(i => (i % 5, i % 13)).toDF("i2", "j2") + val t3 = (0 until 20).map(i => (i % 7, i % 11)).toDF("i3", "j3") + val t4 = (0 until 100).map(i => (i % 5, i % 13)).toDF("i4", "j4") + + // join1 is a sort merge join (shuffle on the both sides). + val join1 = t1.join(t2, t1("i1") === t2("i2")) + val plan1 = join1.queryExecution.executedPlan + assert(collect(plan1) { case s: SortMergeJoinExec => s }.size == 1) + assert(collect(plan1) { case e: ShuffleExchangeExec => e }.size == 2) + + // join2 is a broadcast join where t3 is broadcasted. Note that output partitioning on the + // streamed side (join1) is PartitioningCollection (sort merge join) + val join2 = join1.join(t3, join1("i1") === t3("i3")) + val plan2 = join2.queryExecution.executedPlan + assert(collect(plan2) { case s: SortMergeJoinExec => s }.size == 1) + assert(collect(plan2) { case e: ShuffleExchangeExec => e }.size == 2) + val broadcastJoins = collect(plan2) { case b: BroadcastHashJoinExec => b } + assert(broadcastJoins.size == 1) + assert(broadcastJoins(0).outputPartitioning.isInstanceOf[PartitioningCollection]) + val p = broadcastJoins(0).outputPartitioning.asInstanceOf[PartitioningCollection] + assert(p.partitionings.size == 3) + // Verify all the combinations of output partitioning. + Seq(Seq(t1("i1")), Seq(t2("i2")), Seq(t3("i3"))).foreach { expected => + val expectedExpressions = expected.map(_.expr) + assert(p.partitionings.exists { + case h: HashPartitioning => expressionsEqual(h.expressions, expectedExpressions) + }) + } + + // Join on the column from the broadcasted side (i3) and make sure output partitioning + // is maintained by checking no shuffle exchange is introduced. Note that one extra + // ShuffleExchangeExec is from t4, not from join2. + val join3 = join2.join(t4, join2("i3") === t4("i4")) + val plan3 = join3.queryExecution.executedPlan + assert(collect(plan3) { case s: SortMergeJoinExec => s }.size == 2) + assert(collect(plan3) { case b: BroadcastHashJoinExec => b }.size == 1) + assert(collect(plan3) { case e: ShuffleExchangeExec => e }.size == 3) + + // Validate the data with broadcast join off. + withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "-1") { + val df = join2.join(t4, join2("i3") === t4("i4")) + checkAnswer(join3, df) + } + } + } + + test("BroadcastHashJoinExec output partitioning scenarios for inner join") { + val l1 = AttributeReference("l1", LongType)() + val l2 = AttributeReference("l2", LongType)() + val l3 = AttributeReference("l3", LongType)() + val r1 = AttributeReference("r1", LongType)() + val r2 = AttributeReference("r2", LongType)() + val r3 = AttributeReference("r3", LongType)() + + // Streamed side has a HashPartitioning. + var bhj = BroadcastHashJoinExec( + leftKeys = Seq(l2, l3), + rightKeys = Seq(r1, r2), + Inner, + BuildRight, + None, + left = DummySparkPlan(outputPartitioning = HashPartitioning(Seq(l1, l2, l3), 1)), + right = DummySparkPlan()) + var expected = PartitioningCollection(Seq( + HashPartitioning(Seq(l1, l2, l3), 1), + HashPartitioning(Seq(l1, l2, r2), 1), + HashPartitioning(Seq(l1, r1, l3), 1), + HashPartitioning(Seq(l1, r1, r2), 1))) + assert(bhj.outputPartitioning === expected) + + // Streamed side has a PartitioningCollection. + bhj = BroadcastHashJoinExec( + leftKeys = Seq(l1, l2, l3), + rightKeys = Seq(r1, r2, r3), + Inner, + BuildRight, + None, + left = DummySparkPlan(outputPartitioning = PartitioningCollection(Seq( + HashPartitioning(Seq(l1, l2), 1), HashPartitioning(Seq(l3), 1)))), + right = DummySparkPlan()) + expected = PartitioningCollection(Seq( + HashPartitioning(Seq(l1, l2), 1), + HashPartitioning(Seq(l1, r2), 1), + HashPartitioning(Seq(r1, l2), 1), + HashPartitioning(Seq(r1, r2), 1), + HashPartitioning(Seq(l3), 1), + HashPartitioning(Seq(r3), 1))) + assert(bhj.outputPartitioning === expected) + + // Streamed side has a nested PartitioningCollection. + bhj = BroadcastHashJoinExec( + leftKeys = Seq(l1, l2, l3), + rightKeys = Seq(r1, r2, r3), + Inner, + BuildRight, + None, + left = DummySparkPlan(outputPartitioning = PartitioningCollection(Seq( + PartitioningCollection(Seq(HashPartitioning(Seq(l1), 1), HashPartitioning(Seq(l2), 1))), + HashPartitioning(Seq(l3), 1)))), + right = DummySparkPlan()) + expected = PartitioningCollection(Seq( + PartitioningCollection(Seq( + HashPartitioning(Seq(l1), 1), + HashPartitioning(Seq(r1), 1), + HashPartitioning(Seq(l2), 1), + HashPartitioning(Seq(r2), 1))), + HashPartitioning(Seq(l3), 1), + HashPartitioning(Seq(r3), 1))) + assert(bhj.outputPartitioning === expected) + + // One-to-mapping case ("l1" = "r1" AND "l1" = "r2") + bhj = BroadcastHashJoinExec( + leftKeys = Seq(l1, l1), + rightKeys = Seq(r1, r2), + Inner, + BuildRight, + None, + left = DummySparkPlan(outputPartitioning = HashPartitioning(Seq(l1, l2), 1)), + right = DummySparkPlan()) + expected = PartitioningCollection(Seq( + HashPartitioning(Seq(l1, l2), 1), + HashPartitioning(Seq(r1, l2), 1), + HashPartitioning(Seq(r2, l2), 1))) + assert(bhj.outputPartitioning === expected) + } + + test("BroadcastHashJoinExec output partitioning size should be limited with a config") { + val l1 = AttributeReference("l1", LongType)() + val l2 = AttributeReference("l2", LongType)() + val r1 = AttributeReference("r1", LongType)() + val r2 = AttributeReference("r2", LongType)() + + val expected = Seq( + HashPartitioning(Seq(l1, l2), 1), + HashPartitioning(Seq(l1, r2), 1), + HashPartitioning(Seq(r1, l2), 1), + HashPartitioning(Seq(r1, r2), 1)) + + Seq(1, 2, 3, 4).foreach { limit => + withSQLConf( + SQLConf.BROADCAST_HASH_JOIN_OUTPUT_PARTITIONING_EXPAND_LIMIT.key -> s"$limit") { + val bhj = BroadcastHashJoinExec( + leftKeys = Seq(l1, l2), + rightKeys = Seq(r1, r2), + Inner, + BuildRight, + None, + left = DummySparkPlan(outputPartitioning = HashPartitioning(Seq(l1, l2), 1)), + right = DummySparkPlan()) + assert(bhj.outputPartitioning === PartitioningCollection(expected.take(limit))) + } + } + } + + private def expressionsEqual(l: Seq[Expression], r: Seq[Expression]): Boolean = { + l.length == r.length && l.zip(r).forall { case (e1, e2) => e1.semanticEquals(e2) } + } } class BroadcastJoinSuite extends BroadcastJoinSuiteBase with DisableAdaptiveExecutionSuite diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/ExistenceJoinSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/ExistenceJoinSuite.scala index 5490246baceea..3588b9dda90d2 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/ExistenceJoinSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/ExistenceJoinSuite.scala @@ -19,6 +19,7 @@ package org.apache.spark.sql.execution.joins import org.apache.spark.sql.{DataFrame, Row} import org.apache.spark.sql.catalyst.expressions._ +import org.apache.spark.sql.catalyst.optimizer.{BuildLeft, BuildRight} import org.apache.spark.sql.catalyst.planning.ExtractEquiJoinKeys import org.apache.spark.sql.catalyst.plans._ import org.apache.spark.sql.catalyst.plans.logical.{Join, JoinHint} @@ -81,12 +82,12 @@ class ExistenceJoinSuite extends SparkPlanTest with SharedSparkSession { joinType: JoinType, leftRows: => DataFrame, rightRows: => DataFrame, - condition: => Expression, + condition: => Option[Expression], expectedAnswer: Seq[Row]): Unit = { def extractJoinParts(): Option[ExtractEquiJoinKeys.ReturnType] = { val join = Join(leftRows.logicalPlan, rightRows.logicalPlan, - Inner, Some(condition), JoinHint.NONE) + Inner, condition, JoinHint.NONE) ExtractEquiJoinKeys.unapply(join) } @@ -102,17 +103,17 @@ class ExistenceJoinSuite extends SparkPlanTest with SharedSparkSession { ProjectExec(output, FilterExec(condition, join)) } - test(s"$testName using ShuffledHashJoin") { + testWithWholeStageCodegenOnAndOff(s"$testName using ShuffledHashJoin") { _ => extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) => withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => - EnsureRequirements(left.sqlContext.sessionState.conf).apply( + EnsureRequirements.apply( ShuffledHashJoinExec( leftKeys, rightKeys, joinType, BuildRight, boundCondition, left, right)), expectedAnswer, sortAnswers = true) checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => - EnsureRequirements(left.sqlContext.sessionState.conf).apply( + EnsureRequirements.apply( createLeftSemiPlusJoin(ShuffledHashJoinExec( leftKeys, rightKeys, leftSemiPlus, BuildRight, boundCondition, left, right))), expectedAnswer, @@ -125,13 +126,13 @@ class ExistenceJoinSuite extends SparkPlanTest with SharedSparkSession { extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) => withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => - EnsureRequirements(left.sqlContext.sessionState.conf).apply( + EnsureRequirements.apply( BroadcastHashJoinExec( leftKeys, rightKeys, joinType, BuildRight, boundCondition, left, right)), expectedAnswer, sortAnswers = true) checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => - EnsureRequirements(left.sqlContext.sessionState.conf).apply( + EnsureRequirements.apply( createLeftSemiPlusJoin(BroadcastHashJoinExec( leftKeys, rightKeys, leftSemiPlus, BuildRight, boundCondition, left, right))), expectedAnswer, @@ -140,16 +141,16 @@ class ExistenceJoinSuite extends SparkPlanTest with SharedSparkSession { } } - test(s"$testName using SortMergeJoin") { + testWithWholeStageCodegenOnAndOff(s"$testName using SortMergeJoin") { _ => extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) => withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => - EnsureRequirements(left.sqlContext.sessionState.conf).apply( + EnsureRequirements.apply( SortMergeJoinExec(leftKeys, rightKeys, joinType, boundCondition, left, right)), expectedAnswer, sortAnswers = true) checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => - EnsureRequirements(left.sqlContext.sessionState.conf).apply( + EnsureRequirements.apply( createLeftSemiPlusJoin(SortMergeJoinExec( leftKeys, rightKeys, leftSemiPlus, boundCondition, left, right))), expectedAnswer, @@ -161,42 +162,67 @@ class ExistenceJoinSuite extends SparkPlanTest with SharedSparkSession { test(s"$testName using BroadcastNestedLoopJoin build left") { withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => - EnsureRequirements(left.sqlContext.sessionState.conf).apply( - BroadcastNestedLoopJoinExec(left, right, BuildLeft, joinType, Some(condition))), + EnsureRequirements.apply( + BroadcastNestedLoopJoinExec(left, right, BuildLeft, joinType, condition)), expectedAnswer, sortAnswers = true) checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => - EnsureRequirements(left.sqlContext.sessionState.conf).apply( + EnsureRequirements.apply( createLeftSemiPlusJoin(BroadcastNestedLoopJoinExec( - left, right, BuildLeft, leftSemiPlus, Some(condition)))), + left, right, BuildLeft, leftSemiPlus, condition))), expectedAnswer, sortAnswers = true) } } - test(s"$testName using BroadcastNestedLoopJoin build right") { + testWithWholeStageCodegenOnAndOff(s"$testName using BroadcastNestedLoopJoin build right") { _ => withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => - EnsureRequirements(left.sqlContext.sessionState.conf).apply( - BroadcastNestedLoopJoinExec(left, right, BuildRight, joinType, Some(condition))), + EnsureRequirements.apply( + BroadcastNestedLoopJoinExec(left, right, BuildRight, joinType, condition)), expectedAnswer, sortAnswers = true) checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => - EnsureRequirements(left.sqlContext.sessionState.conf).apply( + EnsureRequirements.apply( createLeftSemiPlusJoin(BroadcastNestedLoopJoinExec( - left, right, BuildRight, leftSemiPlus, Some(condition)))), + left, right, BuildRight, leftSemiPlus, condition))), expectedAnswer, sortAnswers = true) } } } + testExistenceJoin( + "test no condition with non-empty right side for left semi join", + LeftSemi, + left, + right, + None, + Seq(Row(1, 2.0), Row(1, 2.0), Row(2, 1.0), Row(2, 1.0), Row(3, 3.0), Row(null, null), + Row(null, 5.0), Row(6, null))) + + testExistenceJoin( + "test no condition with empty right side for left semi join", + LeftSemi, + left, + spark.emptyDataFrame, + None, + Seq.empty) + testExistenceJoin( "test single condition (equal) for left semi join", LeftSemi, left, right, - singleConditionEQ, + Some(singleConditionEQ), + Seq(Row(2, 1.0), Row(2, 1.0), Row(3, 3.0), Row(6, null))) + + testExistenceJoin( + "test single unique condition (equal) for left semi join", + LeftSemi, + left, + right.select(right.col("c")).distinct(), /* Trigger BHJs and SHJs unique key code path! */ + Some(singleConditionEQ), Seq(Row(2, 1.0), Row(2, 1.0), Row(3, 3.0), Row(6, null))) testExistenceJoin( @@ -204,7 +230,7 @@ class ExistenceJoinSuite extends SparkPlanTest with SharedSparkSession { LeftSemi, left, right, - composedConditionEQ, + Some(composedConditionEQ), Seq(Row(2, 1.0), Row(2, 1.0))) testExistenceJoin( @@ -212,47 +238,65 @@ class ExistenceJoinSuite extends SparkPlanTest with SharedSparkSession { LeftSemi, left, right, - composedConditionNEQ, + Some(composedConditionNEQ), Seq(Row(1, 2.0), Row(1, 2.0), Row(2, 1.0), Row(2, 1.0))) testExistenceJoin( - "test single condition (equal) for left Anti join", + "test no condition with non-empty right side for left anti join", + LeftAnti, + left, + right, + None, + Seq.empty) + + testExistenceJoin( + "test no condition with empty right side for left anti join", + LeftAnti, + left, + spark.emptyDataFrame, + None, + Seq(Row(1, 2.0), Row(1, 2.0), Row(2, 1.0), Row(2, 1.0), Row(3, 3.0), Row(null, null), + Row(null, 5.0), Row(6, null))) + + testExistenceJoin( + "test single condition (equal) for left anti join", LeftAnti, left, right, - singleConditionEQ, + Some(singleConditionEQ), Seq(Row(1, 2.0), Row(1, 2.0), Row(null, null), Row(null, 5.0))) testExistenceJoin( - "test single unique condition (equal) for left Anti join", + "test single unique condition (equal) for left anti join", LeftAnti, left, - right.select(right.col("c")).distinct(), /* Trigger BHJs unique key code path! */ - singleConditionEQ, + right.select(right.col("c")).distinct(), /* Trigger BHJs and SHJs unique key code path! */ + Some(singleConditionEQ), Seq(Row(1, 2.0), Row(1, 2.0), Row(null, null), Row(null, 5.0))) testExistenceJoin( - "test composed condition (equal & non-equal) test for anti join", + "test composed condition (equal & non-equal) test for left anti join", LeftAnti, left, right, - composedConditionEQ, + Some(composedConditionEQ), Seq(Row(1, 2.0), Row(1, 2.0), Row(3, 3.0), Row(6, null), Row(null, 5.0), Row(null, null))) testExistenceJoin( - "test composed condition (both non-equal) for anti join", + "test composed condition (both non-equal) for left anti join", LeftAnti, left, right, - composedConditionNEQ, + Some(composedConditionNEQ), Seq(Row(3, 3.0), Row(6, null), Row(null, 5.0), Row(null, null))) testExistenceJoin( - "test composed unique condition (both non-equal) for anti join", + "test composed unique condition (both non-equal) for left anti join", LeftAnti, left, rightUniqueKey, - (left.col("a") === rightUniqueKey.col("c") && left.col("b") < rightUniqueKey.col("d")).expr, + Some((left.col("a") === rightUniqueKey.col("c") && left.col("b") < rightUniqueKey.col("d")) + .expr), Seq(Row(1, 2.0), Row(1, 2.0), Row(3, 3.0), Row(null, null), Row(null, 5.0), Row(6, null))) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/HashedRelationSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/HashedRelationSuite.scala index 3526aa254c280..84f62993eba2b 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/HashedRelationSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/HashedRelationSuite.scala @@ -19,6 +19,7 @@ package org.apache.spark.sql.execution.joins import java.io.{ByteArrayInputStream, ByteArrayOutputStream, ObjectInputStream, ObjectOutputStream} +import scala.collection.mutable import scala.collection.mutable.ArrayBuffer import scala.util.Random @@ -144,6 +145,7 @@ class HashedRelationSuite extends SharedSparkSession { } val longRelation2 = LongHashedRelation(rows.iterator ++ rows.iterator, key, 100, mm) + .asInstanceOf[LongHashedRelation] assert(!longRelation2.keyIsUnique) (0 until 100).foreach { i => val rows = longRelation2.get(i).toArray @@ -358,6 +360,45 @@ class HashedRelationSuite extends SharedSparkSession { assert(java.util.Arrays.equals(os.toByteArray, os2.toByteArray)) } + test("SPARK-31511: Make BytesToBytesMap iterators thread-safe") { + val ser = sparkContext.env.serializer.newInstance() + val key = Seq(BoundReference(0, LongType, false)) + + val unsafeProj = UnsafeProjection.create( + Seq(BoundReference(0, LongType, false), BoundReference(1, IntegerType, true))) + val rows = (0 until 10000).map(i => unsafeProj(InternalRow(Int.int2long(i), i + 1)).copy()) + val unsafeHashed = UnsafeHashedRelation(rows.iterator, key, 1, mm) + + val os = new ByteArrayOutputStream() + val thread1 = new Thread { + override def run(): Unit = { + val out = new ObjectOutputStream(os) + unsafeHashed.asInstanceOf[UnsafeHashedRelation].writeExternal(out) + out.flush() + } + } + + val thread2 = new Thread { + override def run(): Unit = { + val threadOut = new ObjectOutputStream(new ByteArrayOutputStream()) + unsafeHashed.asInstanceOf[UnsafeHashedRelation].writeExternal(threadOut) + threadOut.flush() + } + } + + thread1.start() + thread2.start() + thread1.join() + thread2.join() + + val unsafeHashed2 = ser.deserialize[UnsafeHashedRelation](ser.serialize(unsafeHashed)) + val os2 = new ByteArrayOutputStream() + val out2 = new ObjectOutputStream(os2) + unsafeHashed2.writeExternal(out2) + out2.flush() + assert(java.util.Arrays.equals(os.toByteArray, os2.toByteArray)) + } + // This test require 4G heap to run, should run it manually ignore("build HashedRelation that is larger than 1G") { val unsafeProj = UnsafeProjection.create( @@ -579,4 +620,98 @@ class HashedRelationSuite extends SharedSparkSession { assert(proj(packedKeys).get(0, dt) == -i - 1) } } + + test("EmptyHashedRelation override methods behavior test") { + val buildKey = Seq(BoundReference(0, LongType, false)) + val hashed = HashedRelation(Seq.empty[InternalRow].toIterator, buildKey, 1, mm) + assert(hashed == EmptyHashedRelation) + + val key = InternalRow(1L) + assert(hashed.get(0L) == null) + assert(hashed.get(key) == null) + assert(hashed.getValue(0L) == null) + assert(hashed.getValue(key) == null) + + assert(hashed.keys().isEmpty) + assert(hashed.keyIsUnique) + assert(hashed.estimatedSize == 0) + } + + test("SPARK-32399: test methods related to key index") { + val schema = StructType(StructField("a", IntegerType, true) :: Nil) + val toUnsafe = UnsafeProjection.create(schema) + val key = Seq(BoundReference(0, IntegerType, true)) + val row = Seq(BoundReference(0, IntegerType, true), BoundReference(1, IntegerType, true)) + val unsafeProj = UnsafeProjection.create(row) + var rows = (0 until 100).map(i => { + val k = if (i % 10 == 0) null else i % 10 + unsafeProj(InternalRow(k, i)).copy() + }) + rows = unsafeProj(InternalRow(-1, -1)).copy() +: rows + val unsafeRelation = UnsafeHashedRelation(rows.iterator, key, 10, mm, allowsNullKey = true) + val keyIndexToKeyMap = new mutable.HashMap[Int, String] + val keyIndexToValueMap = new mutable.HashMap[Int, Seq[Int]] + + // test getWithKeyIndex() + (0 until 10).foreach(i => { + val key = if (i == 0) InternalRow(null) else InternalRow(i) + val valuesWithKeyIndex = unsafeRelation.getWithKeyIndex(toUnsafe(key)).map( + v => (v.getKeyIndex, v.getValue.getInt(1))).toArray + val keyIndex = valuesWithKeyIndex.head._1 + val actualValues = valuesWithKeyIndex.map(_._2) + val expectedValues = (0 until 10).map(j => j * 10 + i) + if (i == 0) { + keyIndexToKeyMap(keyIndex) = "null" + } else { + keyIndexToKeyMap(keyIndex) = i.toString + } + keyIndexToValueMap(keyIndex) = actualValues + // key index is non-negative + assert(keyIndex >= 0) + // values are expected + assert(actualValues.sortWith(_ < _) === expectedValues) + }) + // key index is unique per key + val numUniqueKeyIndex = (0 until 10).flatMap(i => { + val key = if (i == 0) InternalRow(null) else InternalRow(i) + val keyIndex = unsafeRelation.getWithKeyIndex(toUnsafe(key)).map(_.getKeyIndex).toSeq + keyIndex + }).distinct.size + assert(numUniqueKeyIndex == 10) + // NULL for non-existing key + assert(unsafeRelation.getWithKeyIndex(toUnsafe(InternalRow(100))) == null) + + // test getValueWithKeyIndex() + val valuesWithKeyIndex = unsafeRelation.getValueWithKeyIndex(toUnsafe(InternalRow(-1))) + val keyIndex = valuesWithKeyIndex.getKeyIndex + keyIndexToKeyMap(keyIndex) = "-1" + keyIndexToValueMap(keyIndex) = Seq(-1) + // key index is non-negative + assert(valuesWithKeyIndex.getKeyIndex >= 0) + // value is expected + assert(valuesWithKeyIndex.getValue.getInt(1) == -1) + // NULL for non-existing key + assert(unsafeRelation.getValueWithKeyIndex(toUnsafe(InternalRow(100))) == null) + + // test valuesWithKeyIndex() + val keyIndexToRowMap = unsafeRelation.valuesWithKeyIndex().map( + v => (v.getKeyIndex, v.getValue.copy())).toSeq.groupBy(_._1) + assert(keyIndexToRowMap.size == 11) + keyIndexToRowMap.foreach { + case (keyIndex, row) => + val expectedKey = keyIndexToKeyMap(keyIndex) + val expectedValues = keyIndexToValueMap(keyIndex) + // key index returned from valuesWithKeyIndex() + // should be the same as returned from getWithKeyIndex() + if (expectedKey == "null") { + assert(row.head._2.isNullAt(0)) + } else { + assert(row.head._2.getInt(0).toString == expectedKey) + } + // values returned from valuesWithKeyIndex() + // should have same value and order as returned from getWithKeyIndex() + val actualValues = row.map(_._2.getInt(1)) + assert(actualValues === expectedValues) + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/InnerJoinSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/InnerJoinSuite.scala index 08898f80034e6..5262320134319 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/InnerJoinSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/InnerJoinSuite.scala @@ -19,6 +19,7 @@ package org.apache.spark.sql.execution.joins import org.apache.spark.sql.{DataFrame, Row} import org.apache.spark.sql.catalyst.expressions.Expression +import org.apache.spark.sql.catalyst.optimizer.{BuildLeft, BuildRight, BuildSide} import org.apache.spark.sql.catalyst.planning.ExtractEquiJoinKeys import org.apache.spark.sql.catalyst.plans.Inner import org.apache.spark.sql.catalyst.plans.logical.{Join, JoinHint} @@ -100,7 +101,7 @@ class InnerJoinSuite extends SparkPlanTest with SharedSparkSession { boundCondition, leftPlan, rightPlan) - EnsureRequirements(spark.sessionState.conf).apply(broadcastJoin) + EnsureRequirements.apply(broadcastJoin) } def makeShuffledHashJoin( @@ -114,7 +115,7 @@ class InnerJoinSuite extends SparkPlanTest with SharedSparkSession { side, None, leftPlan, rightPlan) val filteredJoin = boundCondition.map(FilterExec(_, shuffledHashJoin)).getOrElse(shuffledHashJoin) - EnsureRequirements(spark.sessionState.conf).apply(filteredJoin) + EnsureRequirements.apply(filteredJoin) } def makeSortMergeJoin( @@ -125,7 +126,7 @@ class InnerJoinSuite extends SparkPlanTest with SharedSparkSession { rightPlan: SparkPlan) = { val sortMergeJoin = joins.SortMergeJoinExec(leftKeys, rightKeys, Inner, boundCondition, leftPlan, rightPlan) - EnsureRequirements(spark.sessionState.conf).apply(sortMergeJoin) + EnsureRequirements.apply(sortMergeJoin) } testWithWholeStageCodegenOnAndOff(s"$testName using BroadcastHashJoin (build=left)") { _ => @@ -133,7 +134,7 @@ class InnerJoinSuite extends SparkPlanTest with SharedSparkSession { withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (leftPlan: SparkPlan, rightPlan: SparkPlan) => makeBroadcastHashJoin( - leftKeys, rightKeys, boundCondition, leftPlan, rightPlan, joins.BuildLeft), + leftKeys, rightKeys, boundCondition, leftPlan, rightPlan, BuildLeft), expectedAnswer.map(Row.fromTuple), sortAnswers = true) } @@ -145,31 +146,31 @@ class InnerJoinSuite extends SparkPlanTest with SharedSparkSession { withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (leftPlan: SparkPlan, rightPlan: SparkPlan) => makeBroadcastHashJoin( - leftKeys, rightKeys, boundCondition, leftPlan, rightPlan, joins.BuildRight), + leftKeys, rightKeys, boundCondition, leftPlan, rightPlan, BuildRight), expectedAnswer.map(Row.fromTuple), sortAnswers = true) } } } - test(s"$testName using ShuffledHashJoin (build=left)") { + testWithWholeStageCodegenOnAndOff(s"$testName using ShuffledHashJoin (build=left)") { _ => extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) => withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (leftPlan: SparkPlan, rightPlan: SparkPlan) => makeShuffledHashJoin( - leftKeys, rightKeys, boundCondition, leftPlan, rightPlan, joins.BuildLeft), + leftKeys, rightKeys, boundCondition, leftPlan, rightPlan, BuildLeft), expectedAnswer.map(Row.fromTuple), sortAnswers = true) } } } - test(s"$testName using ShuffledHashJoin (build=right)") { + testWithWholeStageCodegenOnAndOff(s"$testName using ShuffledHashJoin (build=right)") { _ => extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) => withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (leftPlan: SparkPlan, rightPlan: SparkPlan) => makeShuffledHashJoin( - leftKeys, rightKeys, boundCondition, leftPlan, rightPlan, joins.BuildRight), + leftKeys, rightKeys, boundCondition, leftPlan, rightPlan, BuildRight), expectedAnswer.map(Row.fromTuple), sortAnswers = true) } @@ -197,7 +198,7 @@ class InnerJoinSuite extends SparkPlanTest with SharedSparkSession { } } - test(s"$testName using BroadcastNestedLoopJoin build left") { + testWithWholeStageCodegenOnAndOff(s"$testName using BroadcastNestedLoopJoin build left") { _ => withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => BroadcastNestedLoopJoinExec(left, right, BuildLeft, Inner, Some(condition())), @@ -206,7 +207,7 @@ class InnerJoinSuite extends SparkPlanTest with SharedSparkSession { } } - test(s"$testName using BroadcastNestedLoopJoin build right") { + testWithWholeStageCodegenOnAndOff(s"$testName using BroadcastNestedLoopJoin build right") { _ => withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => BroadcastNestedLoopJoinExec(left, right, BuildRight, Inner, Some(condition())), diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/OuterJoinSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/OuterJoinSuite.scala index a5ade0d8d7508..744ee1ca1ad23 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/OuterJoinSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/joins/OuterJoinSuite.scala @@ -19,6 +19,7 @@ package org.apache.spark.sql.execution.joins import org.apache.spark.sql.{DataFrame, Row} import org.apache.spark.sql.catalyst.expressions.{And, Expression, LessThan} +import org.apache.spark.sql.catalyst.optimizer.{BuildLeft, BuildRight} import org.apache.spark.sql.catalyst.planning.ExtractEquiJoinKeys import org.apache.spark.sql.catalyst.plans._ import org.apache.spark.sql.catalyst.plans.logical.{Join, JoinHint} @@ -46,7 +47,7 @@ class OuterJoinSuite extends SparkPlanTest with SharedSparkSession { sparkContext.parallelize(Seq( Row(0, 0.0), Row(2, 3.0), // This row is duplicated to ensure that we will have multiple buffered matches - Row(2, -1.0), + Row(2, -1.0), // This row is duplicated to ensure that we will have multiple buffered matches Row(2, -1.0), Row(2, 3.0), Row(3, 2.0), @@ -61,6 +62,32 @@ class OuterJoinSuite extends SparkPlanTest with SharedSparkSession { LessThan(left.col("b").expr, right.col("d").expr)) } + private lazy val uniqueLeft = spark.createDataFrame( + sparkContext.parallelize(Seq( + Row(1, 2.0), + Row(2, 1.0), + Row(3, 3.0), + Row(5, 1.0), + Row(6, 6.0), + Row(null, null) + )), new StructType().add("a", IntegerType).add("b", DoubleType)) + + private lazy val uniqueRight = spark.createDataFrame( + sparkContext.parallelize(Seq( + Row(0, 0.0), + Row(2, 3.0), + Row(3, 2.0), + Row(4, 1.0), + Row(5, 3.0), + Row(7, 7.0), + Row(null, null) + )), new StructType().add("c", IntegerType).add("d", DoubleType)) + + private lazy val uniqueCondition = { + And((uniqueLeft.col("a") === uniqueRight.col("c")).expr, + LessThan(uniqueLeft.col("b").expr, uniqueRight.col("d").expr)) + } + // Note: the input dataframes and expression must be evaluated lazily because // the SQLContext should be used only within a test to keep SQL tests stable private def testOuterJoin( @@ -77,18 +104,16 @@ class OuterJoinSuite extends SparkPlanTest with SharedSparkSession { ExtractEquiJoinKeys.unapply(join) } - if (joinType != FullOuter) { - test(s"$testName using ShuffledHashJoin") { - extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) => - withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { - val buildSide = if (joinType == LeftOuter) BuildRight else BuildLeft - checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => - EnsureRequirements(spark.sessionState.conf).apply( - ShuffledHashJoinExec( - leftKeys, rightKeys, joinType, buildSide, boundCondition, left, right)), - expectedAnswer.map(Row.fromTuple), - sortAnswers = true) - } + testWithWholeStageCodegenOnAndOff(s"$testName using ShuffledHashJoin") { _ => + extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) => + withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { + val buildSide = if (joinType == LeftOuter) BuildRight else BuildLeft + checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => + EnsureRequirements.apply( + ShuffledHashJoinExec( + leftKeys, rightKeys, joinType, buildSide, boundCondition, left, right)), + expectedAnswer.map(Row.fromTuple), + sortAnswers = true) } } } @@ -112,11 +137,11 @@ class OuterJoinSuite extends SparkPlanTest with SharedSparkSession { } } - test(s"$testName using SortMergeJoin") { + testWithWholeStageCodegenOnAndOff(s"$testName using SortMergeJoin") { _ => extractJoinParts().foreach { case (_, leftKeys, rightKeys, boundCondition, _, _, _) => withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => - EnsureRequirements(spark.sessionState.conf).apply( + EnsureRequirements.apply( SortMergeJoinExec(leftKeys, rightKeys, joinType, boundCondition, left, right)), expectedAnswer.map(Row.fromTuple), sortAnswers = true) @@ -124,7 +149,7 @@ class OuterJoinSuite extends SparkPlanTest with SharedSparkSession { } } - test(s"$testName using BroadcastNestedLoopJoin build left") { + testWithWholeStageCodegenOnAndOff(s"$testName using BroadcastNestedLoopJoin build left") { _ => withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => BroadcastNestedLoopJoinExec(left, right, BuildLeft, joinType, Some(condition)), @@ -133,7 +158,7 @@ class OuterJoinSuite extends SparkPlanTest with SharedSparkSession { } } - test(s"$testName using BroadcastNestedLoopJoin build right") { + testWithWholeStageCodegenOnAndOff(s"$testName using BroadcastNestedLoopJoin build right") { _ => withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "1") { checkAnswer2(leftRows, rightRows, (left: SparkPlan, right: SparkPlan) => BroadcastNestedLoopJoinExec(left, right, BuildRight, joinType, Some(condition)), @@ -242,4 +267,39 @@ class OuterJoinSuite extends SparkPlanTest with SharedSparkSession { condition, Seq.empty ) + + // --- Join keys are unique --------------------------------------------------------------------- + + testOuterJoin( + "left outer join with unique keys", + uniqueLeft, + uniqueRight, + LeftOuter, + uniqueCondition, + Seq( + (null, null, null, null), + (1, 2.0, null, null), + (2, 1.0, 2, 3.0), + (3, 3.0, null, null), + (5, 1.0, 5, 3.0), + (6, 6.0, null, null) + ) + ) + + testOuterJoin( + "right outer join with unique keys", + uniqueLeft, + uniqueRight, + RightOuter, + uniqueCondition, + Seq( + (null, null, null, null), + (null, null, 0, 0.0), + (2, 1.0, 2, 3.0), + (null, null, 3, 2.0), + (null, null, 4, 1.0), + (5, 1.0, 5, 3.0), + (null, null, 7, 7.0) + ) + ) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/metric/CustomMetricsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/metric/CustomMetricsSuite.scala new file mode 100644 index 0000000000000..440b0dc08ecbd --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/metric/CustomMetricsSuite.scala @@ -0,0 +1,65 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.metric + +import org.apache.spark.SparkFunSuite +import org.apache.spark.sql.connector.metric.{CustomAvgMetric, CustomSumMetric} + +class CustomMetricsSuite extends SparkFunSuite { + + test("Build/parse custom metric metric type") { + Seq(new TestCustomSumMetric, new TestCustomAvgMetric).foreach { customMetric => + val metricType = CustomMetrics.buildV2CustomMetricTypeName(customMetric) + + assert(metricType == CustomMetrics.V2_CUSTOM + "_" + customMetric.getClass.getCanonicalName) + assert(CustomMetrics.parseV2CustomMetricType(metricType).isDefined) + assert(CustomMetrics.parseV2CustomMetricType(metricType).get == + customMetric.getClass.getCanonicalName) + } + } + + test("Built-in CustomSumMetric") { + val metric = new TestCustomSumMetric + + val metricValues1 = Array(0L, 1L, 5L, 5L, 7L, 10L) + assert(metric.aggregateTaskMetrics(metricValues1) == metricValues1.sum.toString) + + val metricValues2 = Array.empty[Long] + assert(metric.aggregateTaskMetrics(metricValues2) == "0") + } + + test("Built-in CustomAvgMetric") { + val metric = new TestCustomAvgMetric + + val metricValues1 = Array(0L, 1L, 5L, 5L, 7L, 10L) + assert(metric.aggregateTaskMetrics(metricValues1) == "4.667") + + val metricValues2 = Array.empty[Long] + assert(metric.aggregateTaskMetrics(metricValues2) == "0") + } +} + +private[spark] class TestCustomSumMetric extends CustomSumMetric { + override def name(): String = "CustomSumMetric" + override def description(): String = "Sum up CustomMetric" +} + +private[spark] class TestCustomAvgMetric extends CustomAvgMetric { + override def name(): String = "CustomAvgMetric" + override def description(): String = "Average CustomMetric" +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala index 08fb655bde467..1e7032ab07425 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala @@ -28,7 +28,9 @@ import org.apache.spark.sql.catalyst.plans.logical.LocalRelation import org.apache.spark.sql.execution.{FilterExec, RangeExec, SparkPlan, WholeStageCodegenExec} import org.apache.spark.sql.execution.adaptive.DisableAdaptiveExecutionSuite import org.apache.spark.sql.execution.aggregate.HashAggregateExec -import org.apache.spark.sql.execution.exchange.ShuffleExchangeExec +import org.apache.spark.sql.execution.command.DataWritingCommandExec +import org.apache.spark.sql.execution.exchange.{BroadcastExchangeExec, ShuffleExchangeExec} +import org.apache.spark.sql.execution.joins.ShuffledHashJoinExec import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession @@ -166,7 +168,7 @@ class SQLMetricsSuite extends SharedSparkSession with SQLMetricsTestUtils // Exchange(nodeId = 5) // LocalTableScan(nodeId = 6) Seq(true, false).foreach { enableWholeStage => - val df = generateRandomBytesDF().repartition(1).groupBy('a).count() + val df = generateRandomBytesDF().repartition(2).groupBy('a).count() val nodeIds = if (enableWholeStage) { Set(4L, 1L) } else { @@ -180,7 +182,7 @@ class SQLMetricsSuite extends SharedSparkSession with SQLMetricsTestUtils assert(probes.toDouble > 1.0) } else { val mainValue = probes.split("\n").apply(1).stripPrefix("(").stripSuffix(")") - // Extract min, med, max from the string and strip off everthing else. + // Extract min, med, max from the string and strip off everything else. val index = mainValue.indexOf(" (", 0) mainValue.slice(0, index).split(", ").foreach { probe => assert(probe.toDouble > 1.0) @@ -208,14 +210,41 @@ class SQLMetricsSuite extends SharedSparkSession with SQLMetricsTestUtils // 2 partitions and each partition contains 2 keys val df2 = testData2.groupBy('a).agg(collect_set('a)) testSparkPlanMetrics(df2, 1, Map( - 2L -> (("ObjectHashAggregate", Map("number of output rows" -> 4L))), + 2L -> (("ObjectHashAggregate", Map( + "number of output rows" -> 4L, + "number of tasks fall-backed to sort-based aggregation" -> 0L))), 1L -> (("Exchange", Map( "shuffle records written" -> 4L, "records read" -> 4L, "local blocks read" -> 4L, "remote blocks read" -> 0L))), - 0L -> (("ObjectHashAggregate", Map("number of output rows" -> 3L)))) + 0L -> (("ObjectHashAggregate", Map( + "number of output rows" -> 3L, + "number of tasks fall-backed to sort-based aggregation" -> 0L)))) ) + + // 2 partitions and each partition contains 2 keys, with fallback to sort-based aggregation + withSQLConf(SQLConf.OBJECT_AGG_SORT_BASED_FALLBACK_THRESHOLD.key -> "1") { + val df3 = testData2.groupBy('a).agg(collect_set('a)) + testSparkPlanMetrics(df3, 1, Map( + 2L -> (("ObjectHashAggregate", Map( + "number of output rows" -> 4L, + "number of tasks fall-backed to sort-based aggregation" -> 2L))), + 0L -> (("ObjectHashAggregate", Map( + "number of output rows" -> 3L, + "number of tasks fall-backed to sort-based aggregation" -> 1L)))) + ) + testSparkPlanMetricsWithPredicates(df3, 1, Map( + 2L -> (("ObjectHashAggregate", Map( + "spill size" -> { + _.toString.matches(sizeMetricPattern) + }))), + 0L -> (("ObjectHashAggregate", Map( + "spill size" -> { + _.toString.matches(sizeMetricPattern) + })))) + ) + } } test("Sort metrics") { @@ -280,11 +309,11 @@ class SQLMetricsSuite extends SharedSparkSession with SQLMetricsTestUtils val rightJoinQuery = "SELECT * FROM testDataForJoin right JOIN testData2 ON " + "testData2.a = testDataForJoin.a" - Seq((leftJoinQuery, false), (leftJoinQuery, true), (rightJoinQuery, false), - (rightJoinQuery, true)).foreach { case (query, enableWholeStage) => + Seq((leftJoinQuery, 0L, false), (leftJoinQuery, 1L, true), (rightJoinQuery, 0L, false), + (rightJoinQuery, 1L, true)).foreach { case (query, nodeId, enableWholeStage) => val df = spark.sql(query) testSparkPlanMetrics(df, 1, Map( - 0L -> (("SortMergeJoin", Map( + nodeId -> (("SortMergeJoin", Map( // It's 8 because we read 6 rows in the left and 2 row in the right one "number of output rows" -> 8L)))), enableWholeStage @@ -310,8 +339,8 @@ class SQLMetricsSuite extends SharedSparkSession with SQLMetricsTestUtils test("ShuffledHashJoin metrics") { withSQLConf(SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "40", - SQLConf.SHUFFLE_PARTITIONS.key -> "2", - SQLConf.PREFER_SORTMERGEJOIN.key -> "false") { + SQLConf.SHUFFLE_PARTITIONS.key -> "2", + SQLConf.PREFER_SORTMERGEJOIN.key -> "false") { val df1 = Seq((1, "1"), (2, "2")).toDF("key", "value") val df2 = (1 to 10).map(i => (i, i.toString)).toSeq.toDF("key", "value") // Assume the execution plan is @@ -325,30 +354,84 @@ class SQLMetricsSuite extends SharedSparkSession with SQLMetricsTestUtils // +- LocalTableScan(nodeId = 7) Seq((1L, 2L, 5L, false), (2L, 3L, 7L, true)).foreach { case (nodeId1, nodeId2, nodeId3, enableWholeStage) => - val df = df1.join(df2, "key") + val df = df1.join(df2, "key") + testSparkPlanMetrics(df, 1, Map( + nodeId1 -> (("ShuffledHashJoin", Map( + "number of output rows" -> 2L))), + nodeId2 -> (("Exchange", Map( + "shuffle records written" -> 2L, + "records read" -> 2L))), + nodeId3 -> (("Exchange", Map( + "shuffle records written" -> 10L, + "records read" -> 10L)))), + enableWholeStage + ) + } + } + } + + test("ShuffledHashJoin(left, outer) metrics") { + val leftDf = Seq((1, "1"), (2, "2")).toDF("key", "value") + val rightDf = (1 to 10).map(i => (i, i.toString)).toSeq.toDF("key2", "value") + Seq((0L, "right_outer", leftDf, rightDf, 10L, false), + (0L, "left_outer", rightDf, leftDf, 10L, false), + (1L, "right_outer", leftDf, rightDf, 10L, true), + (1L, "left_outer", rightDf, leftDf, 10L, true), + (2L, "left_anti", rightDf, leftDf, 8L, true), + (2L, "left_semi", rightDf, leftDf, 2L, true), + (1L, "left_anti", rightDf, leftDf, 8L, false), + (1L, "left_semi", rightDf, leftDf, 2L, false)) + .foreach { case (nodeId, joinType, leftDf, rightDf, rows, enableWholeStage) => + val df = leftDf.hint("shuffle_hash").join( + rightDf.hint("shuffle_hash"), $"key" === $"key2", joinType) testSparkPlanMetrics(df, 1, Map( - nodeId1 -> (("ShuffledHashJoin", Map( - "number of output rows" -> 2L))), - nodeId2 -> (("Exchange", Map( - "shuffle records written" -> 2L, - "records read" -> 2L))), - nodeId3 -> (("Exchange", Map( - "shuffle records written" -> 10L, - "records read" -> 10L)))), + nodeId -> (("ShuffledHashJoin", Map( + "number of output rows" -> rows)))), enableWholeStage ) } + } + + test("SPARK-32629: ShuffledHashJoin(full outer) metrics") { + val uniqueLeftDf = Seq(("1", "1"), ("11", "11")).toDF("key", "value") + val nonUniqueLeftDf = Seq(("1", "1"), ("1", "2"), ("11", "11")).toDF("key", "value") + val rightDf = (1 to 10).map(i => (i.toString, i.toString)).toDF("key2", "value") + Seq( + // Test unique key on build side + (uniqueLeftDf, rightDf, 11, 134228048, 10, 134221824), + // Test non-unique key on build side + (nonUniqueLeftDf, rightDf, 12, 134228552, 11, 134221824) + ).foreach { case (leftDf, rightDf, fojRows, fojBuildSize, rojRows, rojBuildSize) => + val fojDf = leftDf.hint("shuffle_hash").join( + rightDf, $"key" === $"key2", "full_outer") + fojDf.collect() + val fojPlan = fojDf.queryExecution.executedPlan.collectFirst { + case s: ShuffledHashJoinExec => s + } + assert(fojPlan.isDefined, "The query plan should have shuffled hash join") + testMetricsInSparkPlanOperator(fojPlan.get, + Map("numOutputRows" -> fojRows, "buildDataSize" -> fojBuildSize)) + + // Test right outer join as well to verify build data size to be different + // from full outer join. This makes sure we take extra BitSet/OpenHashSet + // for full outer join into account. + val rojDf = leftDf.hint("shuffle_hash").join( + rightDf, $"key" === $"key2", "right_outer") + rojDf.collect() + val rojPlan = rojDf.queryExecution.executedPlan.collectFirst { + case s: ShuffledHashJoinExec => s + } + assert(rojPlan.isDefined, "The query plan should have shuffled hash join") + testMetricsInSparkPlanOperator(rojPlan.get, + Map("numOutputRows" -> rojRows, "buildDataSize" -> rojBuildSize)) } } test("BroadcastHashJoin(outer) metrics") { val df1 = Seq((1, "a"), (1, "b"), (4, "c")).toDF("key", "value") val df2 = Seq((1, "a"), (1, "b"), (2, "c"), (3, "d")).toDF("key2", "value") - // Assume the execution plan is - // ... -> BroadcastHashJoin(nodeId = 0) - Seq(("left_outer", 0L, 5L, false), ("right_outer", 0L, 6L, false), - ("left_outer", 1L, 5L, true), ("right_outer", 1L, 6L, true)).foreach { - case (joinType, nodeId, numRows, enableWholeStage) => + Seq(("left_outer", 0L, 5L, false), ("right_outer", 0L, 6L, false), ("left_outer", 1L, 5L, true), + ("right_outer", 1L, 6L, true)).foreach { case (joinType, nodeId, numRows, enableWholeStage) => val df = df1.join(broadcast(df2), $"key" === $"key2", joinType) testSparkPlanMetrics(df, 2, Map( nodeId -> (("BroadcastHashJoin", Map( @@ -365,12 +448,15 @@ class SQLMetricsSuite extends SharedSparkSession with SQLMetricsTestUtils withTempView("testDataForJoin") { // Assume the execution plan is // ... -> BroadcastNestedLoopJoin(nodeId = 1) -> TungstenProject(nodeId = 0) - val query = "SELECT * FROM testData2 left JOIN testDataForJoin ON " + + val leftQuery = "SELECT * FROM testData2 LEFT JOIN testDataForJoin ON " + + "testData2.a * testDataForJoin.a != testData2.a + testDataForJoin.a" + val rightQuery = "SELECT * FROM testData2 RIGHT JOIN testDataForJoin ON " + "testData2.a * testDataForJoin.a != testData2.a + testDataForJoin.a" - Seq(false, true).foreach { enableWholeStage => + Seq((leftQuery, 0L, false), (rightQuery, 0L, false), (leftQuery, 1L, true), + (rightQuery, 1L, true)).foreach { case (query, nodeId, enableWholeStage) => val df = spark.sql(query) testSparkPlanMetrics(df, 2, Map( - 0L -> (("BroadcastNestedLoopJoin", Map( + nodeId -> (("BroadcastNestedLoopJoin", Map( "number of output rows" -> 12L)))), enableWholeStage ) @@ -394,6 +480,19 @@ class SQLMetricsSuite extends SharedSparkSession with SQLMetricsTestUtils } } + test("BroadcastLeftAntiJoinHash metrics") { + val df1 = Seq((1, "1"), (2, "2")).toDF("key", "value") + val df2 = Seq((1, "1"), (2, "2"), (3, "3"), (4, "4")).toDF("key2", "value") + Seq((1L, false), (2L, true)).foreach { case (nodeId, enableWholeStage) => + val df = df2.join(broadcast(df1), $"key" === $"key2", "left_anti") + testSparkPlanMetrics(df, 2, Map( + nodeId -> (("BroadcastHashJoin", Map( + "number of output rows" -> 2L)))), + enableWholeStage + ) + } + } + test("CartesianProduct metrics") { withSQLConf(SQLConf.CROSS_JOINS_ENABLED.key -> "true") { val testDataForJoin = testData2.filter('a < 2) // TestData2(1, 1) :: TestData2(1, 2) @@ -634,7 +733,7 @@ class SQLMetricsSuite extends SharedSparkSession with SQLMetricsTestUtils sql("CREATE TEMPORARY VIEW inMemoryTable AS SELECT 1 AS c1") sql("CACHE TABLE inMemoryTable") testSparkPlanMetrics(spark.table("inMemoryTable"), 1, - Map(1L -> (("Scan In-memory table `inMemoryTable`", Map.empty))) + Map(1L -> (("Scan In-memory table inMemoryTable", Map.empty))) ) sql("CREATE TEMPORARY VIEW ```a``b``` AS SELECT 2 AS c1") @@ -651,16 +750,6 @@ class SQLMetricsSuite extends SharedSparkSession with SQLMetricsTestUtils } test("SPARK-28332: SQLMetric merge should handle -1 properly") { - def checkSparkPlanMetrics(plan: SparkPlan, expected: Map[String, Long]): Unit = { - expected.foreach { case (metricName: String, metricValue: Long) => - assert(plan.metrics.contains(metricName), s"The query plan should have metric $metricName") - val actualMetric = plan.metrics.get(metricName).get - assert(actualMetric.value == metricValue, - s"The query plan metric $metricName did not match, " + - s"expected:$metricValue, actual:${actualMetric.value}") - } - } - val df = testData.join(testData2.filter('b === 0), $"key" === $"a", "left_outer") df.collect() val plan = df.queryExecution.executedPlan @@ -671,7 +760,43 @@ class SQLMetricsSuite extends SharedSparkSession with SQLMetricsTestUtils assert(exchanges.size == 2, "The query plan should have two shuffle exchanges") - checkSparkPlanMetrics(exchanges(0), Map("dataSize" -> 3200, "shuffleRecordsWritten" -> 100)) - checkSparkPlanMetrics(exchanges(1), Map("dataSize" -> 0, "shuffleRecordsWritten" -> 0)) + testMetricsInSparkPlanOperator(exchanges.head, + Map("dataSize" -> 3200, "shuffleRecordsWritten" -> 100)) + testMetricsInSparkPlanOperator(exchanges(1), Map("dataSize" -> 0, "shuffleRecordsWritten" -> 0)) + } + + test("Add numRows to metric of BroadcastExchangeExec") { + withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> "true") { + withTable("t1", "t2") { + spark.range(2).write.saveAsTable("t1") + spark.range(2).write.saveAsTable("t2") + val df = sql("SELECT t1.* FROM t1 JOIN t2 ON t1.id = t2.id") + df.collect() + val plan = df.queryExecution.executedPlan + + val exchanges = plan.collect { + case s: BroadcastExchangeExec => s + } + + assert(exchanges.size === 1) + testMetricsInSparkPlanOperator(exchanges.head, Map("numOutputRows" -> 2)) + } + } + } + + test("SPARK-34567: Add metrics for CTAS operator") { + withTable("t") { + val df = sql("CREATE TABLE t USING PARQUET AS SELECT 1 as a") + val dataWritingCommandExec = + df.queryExecution.executedPlan.asInstanceOf[DataWritingCommandExec] + dataWritingCommandExec.executeCollect() + val createTableAsSelect = dataWritingCommandExec.cmd + assert(createTableAsSelect.metrics.contains("numFiles")) + assert(createTableAsSelect.metrics("numFiles").value == 1) + assert(createTableAsSelect.metrics.contains("numOutputBytes")) + assert(createTableAsSelect.metrics("numOutputBytes").value > 0) + assert(createTableAsSelect.metrics.contains("numOutputRows")) + assert(createTableAsSelect.metrics("numOutputRows").value == 1) + } } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsTestUtils.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsTestUtils.scala index 8bbf81efff316..81667d52e16ae 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsTestUtils.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsTestUtils.scala @@ -25,7 +25,7 @@ import org.apache.spark.TestUtils import org.apache.spark.scheduler.{SparkListener, SparkListenerTaskEnd} import org.apache.spark.sql.DataFrame import org.apache.spark.sql.catalyst.TableIdentifier -import org.apache.spark.sql.execution.SparkPlanInfo +import org.apache.spark.sql.execution.{SparkPlan, SparkPlanInfo} import org.apache.spark.sql.execution.ui.{SparkPlanGraph, SQLAppStatusStore} import org.apache.spark.sql.internal.SQLConf.WHOLESTAGE_CODEGEN_ENABLED import org.apache.spark.sql.test.SQLTestUtils @@ -220,9 +220,9 @@ trait SQLMetricsTestUtils extends SQLTestUtils { (nodeName, nodeMetrics.mapValues(expectedMetricValue => (actualMetricValue: Any) => { actualMetricValue.toString.matches(expectedMetricValue.toString) - })) + }).toMap) } - testSparkPlanMetricsWithPredicates(df, expectedNumOfJobs, expectedMetricsPredicates, + testSparkPlanMetricsWithPredicates(df, expectedNumOfJobs, expectedMetricsPredicates.toMap, enableWholeStage) } @@ -254,6 +254,24 @@ trait SQLMetricsTestUtils extends SQLTestUtils { } } } + + /** + * Verify if the metrics in `SparkPlan` operator are same as expected metrics. + * + * @param plan `SparkPlan` operator to check metrics + * @param expectedMetrics the expected metrics. The format is `metric name -> metric value`. + */ + protected def testMetricsInSparkPlanOperator( + plan: SparkPlan, + expectedMetrics: Map[String, Long]): Unit = { + expectedMetrics.foreach { case (metricName: String, metricValue: Long) => + assert(plan.metrics.contains(metricName), s"The query plan should have metric $metricName") + val actualMetric = plan.metrics(metricName) + assert(actualMetric.value == metricValue, + s"The query plan metric $metricName did not match, " + + s"expected:$metricValue, actual:${actualMetric.value}") + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/python/BatchEvalPythonExecSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/python/BatchEvalPythonExecSuite.scala index 5fe3d6a71167e..cb5e23e0534d0 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/python/BatchEvalPythonExecSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/python/BatchEvalPythonExecSuite.scala @@ -137,6 +137,13 @@ class MyDummyPythonUDF extends UserDefinedPythonFunction( pythonEvalType = PythonEvalType.SQL_BATCHED_UDF, udfDeterministic = true) +class MyDummyNondeterministicPythonUDF extends UserDefinedPythonFunction( + name = "dummyNondeterministicUDF", + func = new DummyUDF, + dataType = BooleanType, + pythonEvalType = PythonEvalType.SQL_BATCHED_UDF, + udfDeterministic = false) + class MyDummyGroupedAggPandasUDF extends UserDefinedPythonFunction( name = "dummyGroupedAggPandasUDF", func = new DummyUDF, diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/python/ExtractPythonUDFsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/python/ExtractPythonUDFsSuite.scala index 87d541d2d22b0..325f4923bd6c6 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/python/ExtractPythonUDFsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/python/ExtractPythonUDFsSuite.scala @@ -28,6 +28,7 @@ class ExtractPythonUDFsSuite extends SparkPlanTest with SharedSparkSession { import testImplicits._ val batchedPythonUDF = new MyDummyPythonUDF + val batchedNondeterministicPythonUDF = new MyDummyNondeterministicPythonUDF val scalarPandasUDF = new MyDummyScalarPandasUDF private def collectBatchExec(plan: SparkPlan): Seq[BatchEvalPythonExec] = plan.collect { @@ -166,5 +167,31 @@ class ExtractPythonUDFsSuite extends SparkPlanTest with SharedSparkSession { } } + test("SPARK-33303: Deterministic UDF calls are deduplicated") { + val df = Seq("Hello").toDF("a") + + val df2 = df.withColumn("c", batchedPythonUDF(col("a"))).withColumn("d", col("c")) + val pythonEvalNodes2 = collectBatchExec(df2.queryExecution.executedPlan) + assert(pythonEvalNodes2.size == 1) + assert(pythonEvalNodes2.head.udfs.size == 1) + + val df3 = df.withColumns(Seq("c", "d"), + Seq(batchedPythonUDF(col("a")), batchedPythonUDF(col("a")))) + val pythonEvalNodes3 = collectBatchExec(df3.queryExecution.executedPlan) + assert(pythonEvalNodes3.size == 1) + assert(pythonEvalNodes3.head.udfs.size == 1) + + val df4 = df.withColumn("c", batchedNondeterministicPythonUDF(col("a"))) + .withColumn("d", col("c")) + val pythonEvalNodes4 = collectBatchExec(df4.queryExecution.executedPlan) + assert(pythonEvalNodes4.size == 1) + assert(pythonEvalNodes4.head.udfs.size == 1) + + val df5 = df.withColumns(Seq("c", "d"), + Seq(batchedNondeterministicPythonUDF(col("a")), batchedNondeterministicPythonUDF(col("a")))) + val pythonEvalNodes5 = collectBatchExec(df5.queryExecution.executedPlan) + assert(pythonEvalNodes5.size == 1) + assert(pythonEvalNodes5.head.udfs.size == 2) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/python/RowQueueSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/python/RowQueueSuite.scala index 06077c94b66fc..4314e0d0ee380 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/python/RowQueueSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/python/RowQueueSuite.scala @@ -21,7 +21,7 @@ import java.io.File import org.apache.spark.{SparkConf, SparkFunSuite} import org.apache.spark.internal.config._ -import org.apache.spark.memory.{TaskMemoryManager, TestMemoryManager} +import org.apache.spark.memory.{MemoryMode, TaskMemoryManager, TestMemoryManager} import org.apache.spark.security.{CryptoStreamUtils, EncryptionFunSuite} import org.apache.spark.serializer.{JavaSerializer, SerializerManager} import org.apache.spark.sql.catalyst.expressions.UnsafeRow @@ -94,48 +94,54 @@ class RowQueueSuite extends SparkFunSuite with EncryptionFunSuite { queue.close() } - encryptionTest("hybrid queue") { conf => - val serManager = createSerializerManager(conf) - val mem = new TestMemoryManager(conf) - mem.limit(4<<10) - val taskM = new TaskMemoryManager(mem, 0) - val queue = HybridRowQueue(taskM, Utils.createTempDir().getCanonicalFile, 1, serManager) - val row = new UnsafeRow(1) - row.pointTo(new Array[Byte](16), 16) - val n = (4<<10) / 16 * 3 - var i = 0 - while (i < n) { - row.setLong(0, i) - assert(queue.add(row), "fail to add") - i += 1 - } - assert(queue.numQueues() > 1, "should have more than one queue") - queue.spill(1<<20, null) - i = 0 - while (i < n) { - val row = queue.remove() - assert(row != null, "fail to poll") - assert(row.getLong(0) == i, "does not match") - i += 1 - } + Seq(true, false).foreach { isOffHeap => + encryptionTest(s"hybrid queue (offHeap=$isOffHeap)") { conf => + conf.set(MEMORY_OFFHEAP_ENABLED, isOffHeap) + if (isOffHeap) conf.set(MEMORY_OFFHEAP_SIZE, 1000L) + val serManager = createSerializerManager(conf) + val mem = new TestMemoryManager(conf) + mem.limit(4<<10) + val taskM = new TaskMemoryManager(mem, 0) + val queue = HybridRowQueue(taskM, Utils.createTempDir().getCanonicalFile, 1, serManager) + val mode = if (isOffHeap) MemoryMode.OFF_HEAP else MemoryMode.ON_HEAP + assert(queue.getMode === mode) + val row = new UnsafeRow(1) + row.pointTo(new Array[Byte](16), 16) + val n = (4<<10) / 16 * 3 + var i = 0 + while (i < n) { + row.setLong(0, i) + assert(queue.add(row), "fail to add") + i += 1 + } + assert(queue.numQueues() > 1, "should have more than one queue") + queue.spill(1<<20, null) + i = 0 + while (i < n) { + val row = queue.remove() + assert(row != null, "fail to poll") + assert(row.getLong(0) == i, "does not match") + i += 1 + } - // fill again and spill - i = 0 - while (i < n) { - row.setLong(0, i) - assert(queue.add(row), "fail to add") - i += 1 - } - assert(queue.numQueues() > 1, "should have more than one queue") - queue.spill(1<<20, null) - assert(queue.numQueues() > 1, "should have more than one queue") - i = 0 - while (i < n) { - val row = queue.remove() - assert(row != null, "fail to poll") - assert(row.getLong(0) == i, "does not match") - i += 1 + // fill again and spill + i = 0 + while (i < n) { + row.setLong(0, i) + assert(queue.add(row), "fail to add") + i += 1 + } + assert(queue.numQueues() > 1, "should have more than one queue") + queue.spill(1<<20, null) + assert(queue.numQueues() > 1, "should have more than one queue") + i = 0 + while (i < n) { + val row = queue.remove() + assert(row != null, "fail to poll") + assert(row.getLong(0) == i, "does not match") + i += 1 + } + queue.close() } - queue.close() } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/CompactibleFileStreamLogSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/CompactibleFileStreamLogSuite.scala index ead17d50b4e1e..c7655af98160d 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/CompactibleFileStreamLogSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/CompactibleFileStreamLogSuite.scala @@ -297,6 +297,4 @@ class FakeCompactibleFileStreamLog( override protected def defaultCompactInterval: Int = _defaultCompactInterval override protected val minBatchesToRetain: Int = _defaultMinBatchesToRetain - - override def compactLogs(logs: Seq[String]): Seq[String] = logs } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/FileStreamSinkLogSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/FileStreamSinkLogSuite.scala index f95daafdfe19b..d6707e7be71fc 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/FileStreamSinkLogSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/FileStreamSinkLogSuite.scala @@ -18,7 +18,14 @@ package org.apache.spark.sql.execution.streaming import java.io.{ByteArrayInputStream, ByteArrayOutputStream} +import java.lang.{Long => JLong} +import java.net.URI import java.nio.charset.StandardCharsets.UTF_8 +import java.util.concurrent.ConcurrentHashMap + +import scala.util.Random + +import org.apache.hadoop.fs.{FileSystem, FSDataInputStream, Path, RawLocalFileSystem} import org.apache.spark.SparkFunSuite import org.apache.spark.sql.internal.SQLConf @@ -29,19 +36,10 @@ class FileStreamSinkLogSuite extends SparkFunSuite with SharedSparkSession { import CompactibleFileStreamLog._ import FileStreamSinkLog._ - test("compactLogs") { + test("shouldRetain") { withFileStreamSinkLog { sinkLog => - val logs = Seq( - newFakeSinkFileStatus("/a/b/x", FileStreamSinkLog.ADD_ACTION), - newFakeSinkFileStatus("/a/b/y", FileStreamSinkLog.ADD_ACTION), - newFakeSinkFileStatus("/a/b/z", FileStreamSinkLog.ADD_ACTION)) - assert(logs === sinkLog.compactLogs(logs)) - - val logs2 = Seq( - newFakeSinkFileStatus("/a/b/m", FileStreamSinkLog.ADD_ACTION), - newFakeSinkFileStatus("/a/b/n", FileStreamSinkLog.ADD_ACTION), - newFakeSinkFileStatus("/a/b/z", FileStreamSinkLog.DELETE_ACTION)) - assert(logs.dropRight(1) ++ logs2.dropRight(1) === sinkLog.compactLogs(logs ++ logs2)) + val log = newFakeSinkFileStatus("/a/b/x", FileStreamSinkLog.ADD_ACTION) + assert(sinkLog.shouldRetain(log, System.currentTimeMillis())) } } @@ -56,14 +54,6 @@ class FileStreamSinkLogSuite extends SparkFunSuite with SharedSparkSession { blockReplication = 1, blockSize = 10000L, action = FileStreamSinkLog.ADD_ACTION), - SinkFileStatus( - path = "/a/b/y", - size = 200L, - isDir = false, - modificationTime = 2000L, - blockReplication = 2, - blockSize = 20000L, - action = FileStreamSinkLog.DELETE_ACTION), SinkFileStatus( path = "/a/b/z", size = 300L, @@ -76,7 +66,6 @@ class FileStreamSinkLogSuite extends SparkFunSuite with SharedSparkSession { // scalastyle:off val expected = s"""v$VERSION |{"path":"/a/b/x","size":100,"isDir":false,"modificationTime":1000,"blockReplication":1,"blockSize":10000,"action":"add"} - |{"path":"/a/b/y","size":200,"isDir":false,"modificationTime":2000,"blockReplication":2,"blockSize":20000,"action":"delete"} |{"path":"/a/b/z","size":300,"isDir":false,"modificationTime":3000,"blockReplication":3,"blockSize":30000,"action":"add"}""".stripMargin // scalastyle:on val baos = new ByteArrayOutputStream() @@ -93,7 +82,6 @@ class FileStreamSinkLogSuite extends SparkFunSuite with SharedSparkSession { // scalastyle:off val logs = s"""v$VERSION |{"path":"/a/b/x","size":100,"isDir":false,"modificationTime":1000,"blockReplication":1,"blockSize":10000,"action":"add"} - |{"path":"/a/b/y","size":200,"isDir":false,"modificationTime":2000,"blockReplication":2,"blockSize":20000,"action":"delete"} |{"path":"/a/b/z","size":300,"isDir":false,"modificationTime":3000,"blockReplication":3,"blockSize":30000,"action":"add"}""".stripMargin // scalastyle:on @@ -106,14 +94,6 @@ class FileStreamSinkLogSuite extends SparkFunSuite with SharedSparkSession { blockReplication = 1, blockSize = 10000L, action = FileStreamSinkLog.ADD_ACTION), - SinkFileStatus( - path = "/a/b/y", - size = 200L, - isDir = false, - modificationTime = 2000L, - blockReplication = 2, - blockSize = 20000L, - action = FileStreamSinkLog.DELETE_ACTION), SinkFileStatus( path = "/a/b/z", size = 300L, @@ -149,6 +129,17 @@ class FileStreamSinkLogSuite extends SparkFunSuite with SharedSparkSession { } } + private def listBatchFiles(fs: FileSystem, sinkLog: FileStreamSinkLog): Set[String] = { + fs.listStatus(sinkLog.metadataPath).map(_.getPath.getName).filter { fileName => + try { + getBatchIdFromFileName(fileName) + true + } catch { + case _: NumberFormatException => false + } + }.toSet + } + test("delete expired file") { // Set FILE_SINK_LOG_CLEANUP_DELAY to 0 so that we can detect the deleting behaviour // deterministically and one min batches to retain @@ -158,18 +149,7 @@ class FileStreamSinkLogSuite extends SparkFunSuite with SharedSparkSession { SQLConf.MIN_BATCHES_TO_RETAIN.key -> "1") { withFileStreamSinkLog { sinkLog => val fs = sinkLog.metadataPath.getFileSystem(spark.sessionState.newHadoopConf()) - - def listBatchFiles(): Set[String] = { - fs.listStatus(sinkLog.metadataPath).map(_.getPath.getName).filter { fileName => - try { - getBatchIdFromFileName(fileName) - true - } catch { - case _: NumberFormatException => false - } - }.toSet - } - + def listBatchFiles(): Set[String] = this.listBatchFiles(fs, sinkLog) sinkLog.add(0, Array(newFakeSinkFileStatus("/a/b/0", FileStreamSinkLog.ADD_ACTION))) assert(Set("0") === listBatchFiles()) sinkLog.add(1, Array(newFakeSinkFileStatus("/a/b/1", FileStreamSinkLog.ADD_ACTION))) @@ -193,18 +173,7 @@ class FileStreamSinkLogSuite extends SparkFunSuite with SharedSparkSession { SQLConf.MIN_BATCHES_TO_RETAIN.key -> "2") { withFileStreamSinkLog { sinkLog => val fs = sinkLog.metadataPath.getFileSystem(spark.sessionState.newHadoopConf()) - - def listBatchFiles(): Set[String] = { - fs.listStatus(sinkLog.metadataPath).map(_.getPath.getName).filter { fileName => - try { - getBatchIdFromFileName(fileName) - true - } catch { - case _: NumberFormatException => false - } - }.toSet - } - + def listBatchFiles(): Set[String] = this.listBatchFiles(fs, sinkLog) sinkLog.add(0, Array(newFakeSinkFileStatus("/a/b/0", FileStreamSinkLog.ADD_ACTION))) assert(Set("0") === listBatchFiles()) sinkLog.add(1, Array(newFakeSinkFileStatus("/a/b/1", FileStreamSinkLog.ADD_ACTION))) @@ -225,9 +194,27 @@ class FileStreamSinkLogSuite extends SparkFunSuite with SharedSparkSession { } } + test("filter out outdated entries when compacting") { + val curTime = System.currentTimeMillis() + withFileStreamSinkLog(sinkLog => { + val logs = Seq( + newFakeSinkFileStatus("/a/b/x", FileStreamSinkLog.ADD_ACTION, curTime), + newFakeSinkFileStatus("/a/b/y", FileStreamSinkLog.ADD_ACTION, curTime), + newFakeSinkFileStatus("/a/b/z", FileStreamSinkLog.ADD_ACTION, curTime)) + logs.foreach { log => assert(sinkLog.shouldRetain(log, curTime)) } + + val logs2 = Seq( + newFakeSinkFileStatus("/a/b/m", FileStreamSinkLog.ADD_ACTION, curTime - 80000), + newFakeSinkFileStatus("/a/b/n", FileStreamSinkLog.ADD_ACTION, curTime - 120000)) + logs2.foreach { log => + assert(!sinkLog.shouldRetain(log, curTime)) + } + }, Some(60000)) + } + test("read Spark 2.1.0 log format") { assert(readFromResource("file-sink-log-version-2.1.0") === Seq( - // SinkFileStatus("/a/b/0", 100, false, 100, 1, 100, FileStreamSinkLog.ADD_ACTION), -> deleted + SinkFileStatus("/a/b/0", 1, false, 1, 1, 100, FileStreamSinkLog.ADD_ACTION), SinkFileStatus("/a/b/1", 100, false, 100, 1, 100, FileStreamSinkLog.ADD_ACTION), SinkFileStatus("/a/b/2", 200, false, 200, 1, 100, FileStreamSinkLog.ADD_ACTION), SinkFileStatus("/a/b/3", 300, false, 300, 1, 100, FileStreamSinkLog.ADD_ACTION), @@ -240,24 +227,68 @@ class FileStreamSinkLogSuite extends SparkFunSuite with SharedSparkSession { )) } + test("getLatestBatchId") { + withCountOpenLocalFileSystemAsLocalFileSystem { + val scheme = CountOpenLocalFileSystem.scheme + withSQLConf(SQLConf.FILE_SINK_LOG_COMPACT_INTERVAL.key -> "3") { + withTempDir { dir => + val sinkLog = new FileStreamSinkLog(FileStreamSinkLog.VERSION, spark, + s"$scheme:///${dir.getCanonicalPath}") + for (batchId <- 0L to 2L) { + sinkLog.add( + batchId, + Array(newFakeSinkFileStatus("/a/b/" + batchId, FileStreamSinkLog.ADD_ACTION))) + } + + def getCountForOpenOnMetadataFile(batchId: Long): Long = { + val path = sinkLog.batchIdToPath(batchId).toUri.getPath + CountOpenLocalFileSystem.pathToNumOpenCalled.getOrDefault(path, 0L) + } + + CountOpenLocalFileSystem.resetCount() + + assert(sinkLog.getLatestBatchId() === Some(2L)) + // getLatestBatchId doesn't open the latest metadata log file + (0L to 2L).foreach { batchId => + assert(getCountForOpenOnMetadataFile(batchId) === 0L) + } + + assert(sinkLog.getLatest().map(_._1).getOrElse(-1L) === 2L) + (0L to 1L).foreach { batchId => + assert(getCountForOpenOnMetadataFile(batchId) === 0L) + } + // getLatest opens the latest metadata log file, which explains the needs on + // having "getLatestBatchId". + assert(getCountForOpenOnMetadataFile(2L) === 1L) + } + } + } + } + /** - * Create a fake SinkFileStatus using path and action. Most of tests don't care about other fields - * in SinkFileStatus. + * Create a fake SinkFileStatus using path and action, and optionally modification time. + * Most of tests don't care about other fields in SinkFileStatus. */ - private def newFakeSinkFileStatus(path: String, action: String): SinkFileStatus = { + private def newFakeSinkFileStatus( + path: String, + action: String, + modificationTime: Long = Long.MaxValue): SinkFileStatus = { SinkFileStatus( path = path, size = 100L, isDir = false, - modificationTime = 100L, + modificationTime = modificationTime, blockReplication = 1, blockSize = 100L, action = action) } - private def withFileStreamSinkLog(f: FileStreamSinkLog => Unit): Unit = { + private def withFileStreamSinkLog( + f: FileStreamSinkLog => Unit, + ttl: Option[Long] = None): Unit = { withTempDir { file => - val sinkLog = new FileStreamSinkLog(FileStreamSinkLog.VERSION, spark, file.getCanonicalPath) + val sinkLog = new FileStreamSinkLog(FileStreamSinkLog.VERSION, spark, file.getCanonicalPath, + ttl) f(sinkLog) } } @@ -267,4 +298,41 @@ class FileStreamSinkLogSuite extends SparkFunSuite with SharedSparkSession { val log = new FileStreamSinkLog(FileStreamSinkLog.VERSION, spark, input.toString) log.allFiles() } + + private def withCountOpenLocalFileSystemAsLocalFileSystem(body: => Unit): Unit = { + val optionKey = s"fs.${CountOpenLocalFileSystem.scheme}.impl" + val originClassForLocalFileSystem = spark.conf.getOption(optionKey) + try { + spark.conf.set(optionKey, classOf[CountOpenLocalFileSystem].getName) + body + } finally { + originClassForLocalFileSystem match { + case Some(fsClazz) => spark.conf.set(optionKey, fsClazz) + case _ => spark.conf.unset(optionKey) + } + } + } +} + +class CountOpenLocalFileSystem extends RawLocalFileSystem { + import CountOpenLocalFileSystem._ + + override def getUri: URI = { + URI.create(s"$scheme:///") + } + + override def open(f: Path, bufferSize: Int): FSDataInputStream = { + val path = f.toUri.getPath + pathToNumOpenCalled.compute(path, (_, v) => { + if (v == null) 1L else v + 1 + }) + super.open(f, bufferSize) + } +} + +object CountOpenLocalFileSystem { + val scheme = s"FileStreamSinkLogSuite${math.abs(Random.nextInt)}fs" + val pathToNumOpenCalled = new ConcurrentHashMap[String, JLong] + + def resetCount(): Unit = pathToNumOpenCalled.clear() } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLogSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLogSuite.scala index 67dd88cbab63b..980d532dd4779 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLogSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/HDFSMetadataLogSuite.scala @@ -199,7 +199,7 @@ class HDFSMetadataLogSuite extends SharedSparkSession { intercept[IllegalStateException](verifyBatchIds(Seq(2, 3, 4), Some(1L), Some(5L))) intercept[IllegalStateException](verifyBatchIds(Seq(1, 2, 4, 5), Some(1L), Some(5L))) - // Related to SPARK-26629, this capatures the behavior for verifyBatchIds when startId > endId + // Related to SPARK-26629, this captures the behavior for verifyBatchIds when startId > endId intercept[IllegalStateException](verifyBatchIds(Seq(), Some(2L), Some(1L))) intercept[AssertionError](verifyBatchIds(Seq(2), Some(2L), Some(1L))) intercept[AssertionError](verifyBatchIds(Seq(1), Some(2L), Some(1L))) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/MemorySinkSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/MemorySinkSuite.scala index 3ead91fcf712a..014840d758c0c 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/MemorySinkSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/MemorySinkSuite.scala @@ -24,7 +24,7 @@ import org.scalatest.BeforeAndAfter import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.execution.streaming.sources._ -import org.apache.spark.sql.streaming.{OutputMode, StreamTest} +import org.apache.spark.sql.streaming.StreamTest import org.apache.spark.sql.types.{IntegerType, StructField, StructType} import org.apache.spark.util.Utils diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/MicroBatchExecutionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/MicroBatchExecutionSuite.scala index c228740df07c8..a508f923ffa13 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/MicroBatchExecutionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/MicroBatchExecutionSuite.scala @@ -19,8 +19,13 @@ package org.apache.spark.sql.execution.streaming import org.scalatest.BeforeAndAfter -import org.apache.spark.sql.functions.{count, window} +import org.apache.spark.sql.{DataFrame, Dataset, SparkSession} +import org.apache.spark.sql.catalyst.plans.logical.Range +import org.apache.spark.sql.connector.read.streaming +import org.apache.spark.sql.connector.read.streaming.SparkDataStream +import org.apache.spark.sql.functions.{count, timestamp_seconds, window} import org.apache.spark.sql.streaming.StreamTest +import org.apache.spark.sql.types.{LongType, StructType} class MicroBatchExecutionSuite extends StreamTest with BeforeAndAfter { @@ -33,7 +38,7 @@ class MicroBatchExecutionSuite extends StreamTest with BeforeAndAfter { test("SPARK-24156: do not plan a no-data batch again after it has already been planned") { val inputData = MemoryStream[Int] val df = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -68,4 +73,122 @@ class MicroBatchExecutionSuite extends StreamTest with BeforeAndAfter { CheckNewAnswer((25, 1), (30, 1)) // This should not throw the error reported in SPARK-24156 ) } + + test("no-data-batch re-executed after restart should call V1 source.getBatch()") { + val testSource = ReExecutedBatchTestSource(spark) + val df = testSource.toDF() + .withColumn("eventTime", timestamp_seconds($"value")) + .withWatermark("eventTime", "10 seconds") + .groupBy(window($"eventTime", "5 seconds") as 'window) + .agg(count("*") as 'count) + .select($"window".getField("start").cast("long").as[Long]) + + /** Reset this test source so that it appears to be a new source requiring initialization */ + def resetSource(): StreamAction = Execute("reset source") { _ => + testSource.reset() // Make it look like a new source that needs to be re-initialized + require(testSource.currentOffset === 0) + require(testSource.getBatchCallCount === 0) + } + + /** Add data to this test source by incrementing its available offset */ + def addData(numNewRows: Int): StreamAction = new AddData { + override def addData(query: Option[StreamExecution]): (SparkDataStream, streaming.Offset) = { + testSource.incrementAvailableOffset(numNewRows) + (testSource, testSource.getOffset.get) + } + } + + testStream(df)( + addData(numNewRows = 10), // generate values 1...10, sets watermark to 0 + CheckAnswer(), + addData(numNewRows = 10), // generate values 11...20, sets watermark to 10 + ProcessAllAvailable(), // let no-data-batch be executed + CheckAnswer(0, 5), // start time of windows closed and outputted + Execute("verify source internal state before stop") { q => + // Last batch should be a no-data batch + require(q.lastProgress.numInputRows === 0) + // Source should have expected internal state + require(testSource.currentOffset === 20) + // getBatch should be called only for 2 batches with data, not for no-data-batches + assert(testSource.getBatchCallCount === 2) + }, + StopStream, + + /* Verify that if the last no-data-batch was incomplete, getBatch() is called only once */ + Execute("mark last batch as incomplete") { q => + // Delete the last committed batch from the commit log to signify that the last batch + // (a no-data batch) did not complete and has to be re-executed on restart. + val commit = q.commitLog.getLatest().map(_._1).getOrElse(-1L) + q.commitLog.purgeAfter(commit - 1) + }, + resetSource(), + StartStream(), + ProcessAllAvailable(), // allow initialization and re-execution + Execute("verify source.getBatch() called after re-executed no-data-batch") { q => + // After restart, getBatch() should be called once even for no-data batch + assert(testSource.getBatchCallCount === 1) + assert(testSource.currentOffset === 20) + }, + addData(numNewRows = 10), // generate values 21...30, sets watermark to 20 + ProcessAllAvailable(), // let no-data-batch be executed + CheckAnswer(0, 5, 10, 15), + StopStream, + + /* Verify that if the last no-data-batch was complete, getBatch() is still called only once */ + Execute("verify last batch was complete") { q => + // Verify that the commit log records the last batch as completed + require(q.commitLog.getLatest().map(_._1).get === q.offsetLog.getLatest().map(_._1).get) + }, + resetSource(), + StartStream(), + ProcessAllAvailable(), // allow initialization to completed + Execute("verify source.getBatch() called even if no-data-batch was not re-executed") { q => + // After restart, getBatch() should be called even for no-data batch, but only once + assert(testSource.getBatchCallCount === 1) + assert(testSource.currentOffset === 30) + }, + addData(numNewRows = 10), // generate values 31...40, sets watermark to 30 + ProcessAllAvailable(), // let no-data-batch be executed + CheckAnswer(0, 5, 10, 15, 20, 25) + ) + } + + + case class ReExecutedBatchTestSource(spark: SparkSession) extends Source { + @volatile var currentOffset = 0L + @volatile var getBatchCallCount = 0 + + override def getOffset: Option[Offset] = { + if (currentOffset <= 0) None else Some(LongOffset(currentOffset)) + } + + override def getBatch(start: Option[Offset], end: Offset): DataFrame = { + getBatchCallCount = getBatchCallCount + 1 + if (currentOffset == 0) currentOffset = getOffsetValue(end) + val plan = Range( + start.map(getOffsetValue).getOrElse(0L) + 1L, getOffsetValue(end) + 1L, 1, None, + isStreaming = true) + Dataset.ofRows(spark, plan) + } + + def incrementAvailableOffset(numNewRows: Int): Unit = { + currentOffset = currentOffset + numNewRows + } + + def reset(): Unit = { + currentOffset = 0L + getBatchCallCount = 0 + } + def toDF(): DataFrame = Dataset.ofRows(spark, StreamingExecutionRelation(this, spark)) + override def schema: StructType = new StructType().add("value", LongType) + override def stop(): Unit = {} + private def getOffsetValue(offset: Offset): Long = { + offset match { + case s: SerializedOffset => LongOffset(s).offset + case l: LongOffset => l.offset + case _ => throw new IllegalArgumentException("incorrect offset type: " + offset) + } + } + } } + diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/continuous/shuffle/ContinuousShuffleSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/continuous/shuffle/ContinuousShuffleSuite.scala deleted file mode 100644 index 54ec4a8352c1b..0000000000000 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/continuous/shuffle/ContinuousShuffleSuite.scala +++ /dev/null @@ -1,423 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.execution.streaming.continuous.shuffle - -import java.util.UUID - -import scala.language.implicitConversions - -import org.apache.spark.{HashPartitioner, TaskContext, TaskContextImpl} -import org.apache.spark.rpc.RpcEndpointRef -import org.apache.spark.sql.catalyst.expressions.{GenericInternalRow, UnsafeProjection} -import org.apache.spark.sql.streaming.StreamTest -import org.apache.spark.sql.types.{DataType, IntegerType, StringType} -import org.apache.spark.unsafe.types.UTF8String - -class ContinuousShuffleSuite extends StreamTest { - // In this unit test, we emulate that we're in the task thread where - // ContinuousShuffleReadRDD.compute() will be evaluated. This requires a task context - // thread local to be set. - var ctx: TaskContextImpl = _ - - override def beforeEach(): Unit = { - super.beforeEach() - ctx = TaskContext.empty() - TaskContext.setTaskContext(ctx) - } - - override def afterEach(): Unit = { - ctx.markTaskCompleted(None) - TaskContext.unset() - ctx = null - super.afterEach() - } - - private implicit def unsafeRow(value: Int) = { - UnsafeProjection.create(Array(IntegerType : DataType))( - new GenericInternalRow(Array(value: Any))) - } - - private def unsafeRow(value: String) = { - UnsafeProjection.create(Array(StringType : DataType))( - new GenericInternalRow(Array(UTF8String.fromString(value): Any))) - } - - private def send(endpoint: RpcEndpointRef, messages: RPCContinuousShuffleMessage*) = { - messages.foreach(endpoint.askSync[Unit](_)) - } - - private def readRDDEndpoint(rdd: ContinuousShuffleReadRDD) = { - rdd.partitions(0).asInstanceOf[ContinuousShuffleReadPartition].endpoint - } - - private def readEpoch(rdd: ContinuousShuffleReadRDD) = { - rdd.compute(rdd.partitions(0), ctx).toSeq.map(_.getInt(0)) - } - - test("reader - one epoch") { - val rdd = new ContinuousShuffleReadRDD(sparkContext, numPartitions = 1) - val endpoint = rdd.partitions(0).asInstanceOf[ContinuousShuffleReadPartition].endpoint - send( - endpoint, - ReceiverRow(0, unsafeRow(111)), - ReceiverRow(0, unsafeRow(222)), - ReceiverRow(0, unsafeRow(333)), - ReceiverEpochMarker(0) - ) - - val iter = rdd.compute(rdd.partitions(0), ctx) - assert(iter.toSeq.map(_.getInt(0)) == Seq(111, 222, 333)) - } - - test("reader - multiple epochs") { - val rdd = new ContinuousShuffleReadRDD(sparkContext, numPartitions = 1) - val endpoint = rdd.partitions(0).asInstanceOf[ContinuousShuffleReadPartition].endpoint - send( - endpoint, - ReceiverRow(0, unsafeRow(111)), - ReceiverEpochMarker(0), - ReceiverRow(0, unsafeRow(222)), - ReceiverRow(0, unsafeRow(333)), - ReceiverEpochMarker(0) - ) - - val firstEpoch = rdd.compute(rdd.partitions(0), ctx) - assert(firstEpoch.toSeq.map(_.getInt(0)) == Seq(111)) - - val secondEpoch = rdd.compute(rdd.partitions(0), ctx) - assert(secondEpoch.toSeq.map(_.getInt(0)) == Seq(222, 333)) - } - - test("reader - empty epochs") { - val rdd = new ContinuousShuffleReadRDD(sparkContext, numPartitions = 1) - val endpoint = rdd.partitions(0).asInstanceOf[ContinuousShuffleReadPartition].endpoint - - send( - endpoint, - ReceiverEpochMarker(0), - ReceiverEpochMarker(0), - ReceiverRow(0, unsafeRow(111)), - ReceiverEpochMarker(0), - ReceiverEpochMarker(0), - ReceiverEpochMarker(0) - ) - - assert(rdd.compute(rdd.partitions(0), ctx).isEmpty) - assert(rdd.compute(rdd.partitions(0), ctx).isEmpty) - - val thirdEpoch = rdd.compute(rdd.partitions(0), ctx) - assert(thirdEpoch.toSeq.map(_.getInt(0)) == Seq(111)) - - assert(rdd.compute(rdd.partitions(0), ctx).isEmpty) - assert(rdd.compute(rdd.partitions(0), ctx).isEmpty) - } - - test("reader - multiple partitions") { - val rdd = new ContinuousShuffleReadRDD( - sparkContext, - numPartitions = 5, - endpointNames = Seq.fill(5)(s"endpt-${UUID.randomUUID()}")) - // Send all data before processing to ensure there's no crossover. - for (p <- rdd.partitions) { - val part = p.asInstanceOf[ContinuousShuffleReadPartition] - // Send index for identification. - send( - part.endpoint, - ReceiverRow(0, unsafeRow(part.index)), - ReceiverEpochMarker(0) - ) - } - - for (p <- rdd.partitions) { - val part = p.asInstanceOf[ContinuousShuffleReadPartition] - val iter = rdd.compute(part, ctx) - assert(iter.next().getInt(0) == part.index) - assert(!iter.hasNext) - } - } - - test("reader - blocks waiting for new rows") { - val rdd = new ContinuousShuffleReadRDD( - sparkContext, numPartitions = 1, epochIntervalMs = Long.MaxValue) - val epoch = rdd.compute(rdd.partitions(0), ctx) - - val readRowThread = new Thread { - override def run(): Unit = { - try { - epoch.next().getInt(0) - } catch { - case _: InterruptedException => // do nothing - expected at test ending - } - } - } - - try { - readRowThread.start() - eventually(timeout(streamingTimeout)) { - assert(readRowThread.getState == Thread.State.TIMED_WAITING) - } - } finally { - readRowThread.interrupt() - readRowThread.join() - } - } - - test("reader - multiple writers") { - val rdd = new ContinuousShuffleReadRDD(sparkContext, numPartitions = 1, numShuffleWriters = 3) - val endpoint = rdd.partitions(0).asInstanceOf[ContinuousShuffleReadPartition].endpoint - send( - endpoint, - ReceiverRow(0, unsafeRow("writer0-row0")), - ReceiverRow(1, unsafeRow("writer1-row0")), - ReceiverRow(2, unsafeRow("writer2-row0")), - ReceiverEpochMarker(0), - ReceiverEpochMarker(1), - ReceiverEpochMarker(2) - ) - - val firstEpoch = rdd.compute(rdd.partitions(0), ctx) - assert(firstEpoch.toSeq.map(_.getUTF8String(0).toString).toSet == - Set("writer0-row0", "writer1-row0", "writer2-row0")) - } - - test("reader - epoch only ends when all writers send markers") { - val rdd = new ContinuousShuffleReadRDD( - sparkContext, numPartitions = 1, numShuffleWriters = 3, epochIntervalMs = Long.MaxValue) - val endpoint = rdd.partitions(0).asInstanceOf[ContinuousShuffleReadPartition].endpoint - send( - endpoint, - ReceiverRow(0, unsafeRow("writer0-row0")), - ReceiverRow(1, unsafeRow("writer1-row0")), - ReceiverRow(2, unsafeRow("writer2-row0")), - ReceiverEpochMarker(0), - ReceiverEpochMarker(2) - ) - - val epoch = rdd.compute(rdd.partitions(0), ctx) - val rows = (0 until 3).map(_ => epoch.next()).toSet - assert(rows.map(_.getUTF8String(0).toString) == - Set("writer0-row0", "writer1-row0", "writer2-row0")) - - // After checking the right rows, block until we get an epoch marker indicating there's no next. - // (Also fail the assertion if for some reason we get a row.) - - val readEpochMarkerThread = new Thread { - override def run(): Unit = { - assert(!epoch.hasNext) - } - } - - readEpochMarkerThread.start() - eventually(timeout(streamingTimeout)) { - assert(readEpochMarkerThread.getState == Thread.State.TIMED_WAITING) - } - - // Send the last epoch marker - now the epoch should finish. - send(endpoint, ReceiverEpochMarker(1)) - eventually(timeout(streamingTimeout)) { - !readEpochMarkerThread.isAlive - } - - // Join to pick up assertion failures. - readEpochMarkerThread.join(streamingTimeout.toMillis) - } - - test("reader - writer epochs non aligned") { - val rdd = new ContinuousShuffleReadRDD(sparkContext, numPartitions = 1, numShuffleWriters = 3) - val endpoint = rdd.partitions(0).asInstanceOf[ContinuousShuffleReadPartition].endpoint - // We send multiple epochs for 0, then multiple for 1, then multiple for 2. The receiver should - // collate them as though the markers were aligned in the first place. - send( - endpoint, - ReceiverRow(0, unsafeRow("writer0-row0")), - ReceiverEpochMarker(0), - ReceiverRow(0, unsafeRow("writer0-row1")), - ReceiverEpochMarker(0), - ReceiverEpochMarker(0), - - ReceiverEpochMarker(1), - ReceiverRow(1, unsafeRow("writer1-row0")), - ReceiverEpochMarker(1), - ReceiverRow(1, unsafeRow("writer1-row1")), - ReceiverEpochMarker(1), - - ReceiverEpochMarker(2), - ReceiverEpochMarker(2), - ReceiverRow(2, unsafeRow("writer2-row0")), - ReceiverEpochMarker(2) - ) - - val firstEpoch = rdd.compute(rdd.partitions(0), ctx).map(_.getUTF8String(0).toString).toSet - assert(firstEpoch == Set("writer0-row0")) - - val secondEpoch = rdd.compute(rdd.partitions(0), ctx).map(_.getUTF8String(0).toString).toSet - assert(secondEpoch == Set("writer0-row1", "writer1-row0")) - - val thirdEpoch = rdd.compute(rdd.partitions(0), ctx).map(_.getUTF8String(0).toString).toSet - assert(thirdEpoch == Set("writer1-row1", "writer2-row0")) - } - - test("one epoch") { - val reader = new ContinuousShuffleReadRDD(sparkContext, numPartitions = 1) - val writer = new RPCContinuousShuffleWriter( - 0, new HashPartitioner(1), Array(readRDDEndpoint(reader))) - - writer.write(Iterator(1, 2, 3)) - - assert(readEpoch(reader) == Seq(1, 2, 3)) - } - - test("multiple epochs") { - val reader = new ContinuousShuffleReadRDD(sparkContext, numPartitions = 1) - val writer = new RPCContinuousShuffleWriter( - 0, new HashPartitioner(1), Array(readRDDEndpoint(reader))) - - writer.write(Iterator(1, 2, 3)) - writer.write(Iterator(4, 5, 6)) - - assert(readEpoch(reader) == Seq(1, 2, 3)) - assert(readEpoch(reader) == Seq(4, 5, 6)) - } - - test("empty epochs") { - val reader = new ContinuousShuffleReadRDD(sparkContext, numPartitions = 1) - val writer = new RPCContinuousShuffleWriter( - 0, new HashPartitioner(1), Array(readRDDEndpoint(reader))) - - writer.write(Iterator()) - writer.write(Iterator(1, 2)) - writer.write(Iterator()) - writer.write(Iterator()) - writer.write(Iterator(3, 4)) - writer.write(Iterator()) - - assert(readEpoch(reader) == Seq()) - assert(readEpoch(reader) == Seq(1, 2)) - assert(readEpoch(reader) == Seq()) - assert(readEpoch(reader) == Seq()) - assert(readEpoch(reader) == Seq(3, 4)) - assert(readEpoch(reader) == Seq()) - } - - test("blocks waiting for writer") { - val reader = new ContinuousShuffleReadRDD(sparkContext, numPartitions = 1) - val writer = new RPCContinuousShuffleWriter( - 0, new HashPartitioner(1), Array(readRDDEndpoint(reader))) - - val readerEpoch = reader.compute(reader.partitions(0), ctx) - - val readRowThread = new Thread { - override def run(): Unit = { - assert(readerEpoch.toSeq.map(_.getInt(0)) == Seq(1)) - } - } - readRowThread.start() - - eventually(timeout(streamingTimeout)) { - assert(readRowThread.getState == Thread.State.TIMED_WAITING) - } - - // Once we write the epoch the thread should stop waiting and succeed. - writer.write(Iterator(1)) - readRowThread.join(streamingTimeout.toMillis) - } - - test("multiple writer partitions") { - val numWriterPartitions = 3 - - val reader = new ContinuousShuffleReadRDD( - sparkContext, numPartitions = 1, numShuffleWriters = numWriterPartitions) - val writers = (0 until 3).map { idx => - new RPCContinuousShuffleWriter(idx, new HashPartitioner(1), Array(readRDDEndpoint(reader))) - } - - writers(0).write(Iterator(1, 4, 7)) - writers(1).write(Iterator(2, 5)) - writers(2).write(Iterator(3, 6)) - - writers(0).write(Iterator(4, 7, 10)) - writers(1).write(Iterator(5, 8)) - writers(2).write(Iterator(6, 9)) - - // Since there are multiple asynchronous writers, the original row sequencing is not guaranteed. - // The epochs should be deterministically preserved, however. - assert(readEpoch(reader).toSet == Seq(1, 2, 3, 4, 5, 6, 7).toSet) - assert(readEpoch(reader).toSet == Seq(4, 5, 6, 7, 8, 9, 10).toSet) - } - - test("reader epoch only ends when all writer partitions write it") { - val numWriterPartitions = 3 - - val reader = new ContinuousShuffleReadRDD( - sparkContext, numPartitions = 1, numShuffleWriters = numWriterPartitions) - val writers = (0 until 3).map { idx => - new RPCContinuousShuffleWriter(idx, new HashPartitioner(1), Array(readRDDEndpoint(reader))) - } - - writers(1).write(Iterator()) - writers(2).write(Iterator()) - - val readerEpoch = reader.compute(reader.partitions(0), ctx) - - val readEpochMarkerThread = new Thread { - override def run(): Unit = { - assert(!readerEpoch.hasNext) - } - } - - readEpochMarkerThread.start() - eventually(timeout(streamingTimeout)) { - assert(readEpochMarkerThread.getState == Thread.State.TIMED_WAITING) - } - - writers(0).write(Iterator()) - readEpochMarkerThread.join(streamingTimeout.toMillis) - } - - test("receiver stopped with row last") { - val rdd = new ContinuousShuffleReadRDD(sparkContext, numPartitions = 1) - val endpoint = rdd.partitions(0).asInstanceOf[ContinuousShuffleReadPartition].endpoint - send( - endpoint, - ReceiverEpochMarker(0), - ReceiverRow(0, unsafeRow(111)) - ) - - ctx.markTaskCompleted(None) - val receiver = rdd.partitions(0).asInstanceOf[ContinuousShuffleReadPartition].reader - eventually(timeout(streamingTimeout)) { - assert(receiver.asInstanceOf[RPCContinuousShuffleReader].stopped.get()) - } - } - - test("receiver stopped with marker last") { - val rdd = new ContinuousShuffleReadRDD(sparkContext, numPartitions = 1) - val endpoint = rdd.partitions(0).asInstanceOf[ContinuousShuffleReadPartition].endpoint - send( - endpoint, - ReceiverRow(0, unsafeRow(111)), - ReceiverEpochMarker(0) - ) - - ctx.markTaskCompleted(None) - val receiver = rdd.partitions(0).asInstanceOf[ContinuousShuffleReadPartition].reader - eventually(timeout(streamingTimeout)) { - assert(receiver.asInstanceOf[RPCContinuousShuffleReader].stopped.get()) - } - } -} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/ForeachWriterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/ForeachWriterSuite.scala index 0c17320acade9..0fe339b93047a 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/ForeachWriterSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/sources/ForeachWriterSuite.scala @@ -26,7 +26,7 @@ import org.scalatest.BeforeAndAfter import org.apache.spark.SparkException import org.apache.spark.sql.ForeachWriter import org.apache.spark.sql.execution.streaming.MemoryStream -import org.apache.spark.sql.functions.{count, window} +import org.apache.spark.sql.functions.{count, timestamp_seconds, window} import org.apache.spark.sql.streaming.{OutputMode, StreamingQueryException, StreamTest} import org.apache.spark.sql.test.SharedSparkSession @@ -163,7 +163,7 @@ class ForeachWriterSuite extends StreamTest with SharedSparkSession with BeforeA val inputData = MemoryStream[Int] val windowedAggregation = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -197,7 +197,7 @@ class ForeachWriterSuite extends StreamTest with SharedSparkSession with BeforeA val inputData = MemoryStream[Int] val windowedAggregation = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -333,6 +333,6 @@ class TestForeachWriter extends ForeachWriter[Int] { override def close(errorOrNull: Throwable): Unit = { events += ForeachWriterSuite.Close(error = Option(errorOrNull)) - ForeachWriterSuite.addEvents(events) + ForeachWriterSuite.addEvents(events.toSeq) } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/FlatMapGroupsWithStateExecHelperSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/FlatMapGroupsWithStateExecHelperSuite.scala index dec30fd01f7e2..ea6fd8ab312c9 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/FlatMapGroupsWithStateExecHelperSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/FlatMapGroupsWithStateExecHelperSuite.scala @@ -23,7 +23,6 @@ import org.apache.spark.sql.Encoder import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder import org.apache.spark.sql.catalyst.expressions.{GenericInternalRow, UnsafeProjection, UnsafeRow} import org.apache.spark.sql.execution.streaming.GroupStateImpl._ -import org.apache.spark.sql.streaming.FlatMapGroupsWithStateSuite._ import org.apache.spark.sql.streaming.StreamTest import org.apache.spark.sql.types._ diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateSchemaCompatibilityCheckerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateSchemaCompatibilityCheckerSuite.scala new file mode 100644 index 0000000000000..4eb7603b316aa --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateSchemaCompatibilityCheckerSuite.scala @@ -0,0 +1,230 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.streaming.state + +import java.util.UUID + +import scala.util.Random + +import org.apache.hadoop.conf.Configuration + +import org.apache.spark.sql.execution.streaming.state.StateStoreTestsHelper.newDir +import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types._ + +class StateSchemaCompatibilityCheckerSuite extends SharedSparkSession { + + private val hadoopConf: Configuration = new Configuration() + private val opId = Random.nextInt(100000) + private val partitionId = StateStore.PARTITION_ID_TO_CHECK_SCHEMA + + private val structSchema = new StructType() + .add(StructField("nested1", IntegerType, nullable = true)) + .add(StructField("nested2", StringType, nullable = true)) + + private val keySchema = new StructType() + .add(StructField("key1", IntegerType, nullable = true)) + .add(StructField("key2", StringType, nullable = true)) + .add(StructField("key3", structSchema, nullable = true)) + + private val valueSchema = new StructType() + .add(StructField("value1", IntegerType, nullable = true)) + .add(StructField("value2", StringType, nullable = true)) + .add(StructField("value3", structSchema, nullable = true)) + + test("adding field to key should fail") { + val fieldAddedKeySchema = keySchema.add(StructField("newKey", IntegerType)) + verifyException(keySchema, valueSchema, fieldAddedKeySchema, valueSchema) + } + + test("adding field to value should fail") { + val fieldAddedValueSchema = valueSchema.add(StructField("newValue", IntegerType)) + verifyException(keySchema, valueSchema, keySchema, fieldAddedValueSchema) + } + + test("adding nested field in key should fail") { + val fieldAddedNestedSchema = structSchema.add(StructField("newNested", IntegerType)) + val newKeySchema = applyNewSchemaToNestedFieldInKey(fieldAddedNestedSchema) + verifyException(keySchema, valueSchema, newKeySchema, valueSchema) + } + + test("adding nested field in value should fail") { + val fieldAddedNestedSchema = structSchema.add(StructField("newNested", IntegerType)) + val newValueSchema = applyNewSchemaToNestedFieldInValue(fieldAddedNestedSchema) + verifyException(keySchema, valueSchema, keySchema, newValueSchema) + } + + test("removing field from key should fail") { + val fieldRemovedKeySchema = StructType(keySchema.dropRight(1)) + verifyException(keySchema, valueSchema, fieldRemovedKeySchema, valueSchema) + } + + test("removing field from value should fail") { + val fieldRemovedValueSchema = StructType(valueSchema.drop(1)) + verifyException(keySchema, valueSchema, keySchema, fieldRemovedValueSchema) + } + + test("removing nested field from key should fail") { + val fieldRemovedNestedSchema = StructType(structSchema.dropRight(1)) + val newKeySchema = applyNewSchemaToNestedFieldInKey(fieldRemovedNestedSchema) + verifyException(keySchema, valueSchema, newKeySchema, valueSchema) + } + + test("removing nested field from value should fail") { + val fieldRemovedNestedSchema = StructType(structSchema.drop(1)) + val newValueSchema = applyNewSchemaToNestedFieldInValue(fieldRemovedNestedSchema) + verifyException(keySchema, valueSchema, keySchema, newValueSchema) + } + + test("changing the type of field in key should fail") { + val typeChangedKeySchema = StructType(keySchema.map(_.copy(dataType = TimestampType))) + verifyException(keySchema, valueSchema, typeChangedKeySchema, valueSchema) + } + + test("changing the type of field in value should fail") { + val typeChangedValueSchema = StructType(valueSchema.map(_.copy(dataType = TimestampType))) + verifyException(keySchema, valueSchema, keySchema, typeChangedValueSchema) + } + + test("changing the type of nested field in key should fail") { + val typeChangedNestedSchema = StructType(structSchema.map(_.copy(dataType = TimestampType))) + val newKeySchema = applyNewSchemaToNestedFieldInKey(typeChangedNestedSchema) + verifyException(keySchema, valueSchema, newKeySchema, valueSchema) + } + + test("changing the type of nested field in value should fail") { + val typeChangedNestedSchema = StructType(structSchema.map(_.copy(dataType = TimestampType))) + val newValueSchema = applyNewSchemaToNestedFieldInValue(typeChangedNestedSchema) + verifyException(keySchema, valueSchema, keySchema, newValueSchema) + } + + test("changing the nullability of nullable to non-nullable in key should fail") { + val nonNullChangedKeySchema = StructType(keySchema.map(_.copy(nullable = false))) + verifyException(keySchema, valueSchema, nonNullChangedKeySchema, valueSchema) + } + + test("changing the nullability of nullable to non-nullable in value should fail") { + val nonNullChangedValueSchema = StructType(valueSchema.map(_.copy(nullable = false))) + verifyException(keySchema, valueSchema, keySchema, nonNullChangedValueSchema) + } + + test("changing the nullability of nullable to nonnullable in nested field in key should fail") { + val typeChangedNestedSchema = StructType(structSchema.map(_.copy(nullable = false))) + val newKeySchema = applyNewSchemaToNestedFieldInKey(typeChangedNestedSchema) + verifyException(keySchema, valueSchema, newKeySchema, valueSchema) + } + + test("changing the nullability of nullable to nonnullable in nested field in value should fail") { + val typeChangedNestedSchema = StructType(structSchema.map(_.copy(nullable = false))) + val newValueSchema = applyNewSchemaToNestedFieldInValue(typeChangedNestedSchema) + verifyException(keySchema, valueSchema, keySchema, newValueSchema) + } + + test("changing the name of field in key should be allowed") { + val newName: StructField => StructField = f => f.copy(name = f.name + "_new") + val fieldNameChangedKeySchema = StructType(keySchema.map(newName)) + verifySuccess(keySchema, valueSchema, fieldNameChangedKeySchema, valueSchema) + } + + test("changing the name of field in value should be allowed") { + val newName: StructField => StructField = f => f.copy(name = f.name + "_new") + val fieldNameChangedValueSchema = StructType(valueSchema.map(newName)) + verifySuccess(keySchema, valueSchema, keySchema, fieldNameChangedValueSchema) + } + + test("changing the name of nested field in key should be allowed") { + val newName: StructField => StructField = f => f.copy(name = f.name + "_new") + val newNestedFieldsSchema = StructType(structSchema.map(newName)) + val fieldNameChangedKeySchema = applyNewSchemaToNestedFieldInKey(newNestedFieldsSchema) + verifySuccess(keySchema, valueSchema, fieldNameChangedKeySchema, valueSchema) + } + + test("changing the name of nested field in value should be allowed") { + val newName: StructField => StructField = f => f.copy(name = f.name + "_new") + val newNestedFieldsSchema = StructType(structSchema.map(newName)) + val fieldNameChangedValueSchema = applyNewSchemaToNestedFieldInValue(newNestedFieldsSchema) + verifySuccess(keySchema, valueSchema, keySchema, fieldNameChangedValueSchema) + } + + private def applyNewSchemaToNestedFieldInKey(newNestedSchema: StructType): StructType = { + applyNewSchemaToNestedField(keySchema, newNestedSchema, "key3") + } + + private def applyNewSchemaToNestedFieldInValue(newNestedSchema: StructType): StructType = { + applyNewSchemaToNestedField(valueSchema, newNestedSchema, "value3") + } + + private def applyNewSchemaToNestedField( + originSchema: StructType, + newNestedSchema: StructType, + fieldName: String): StructType = { + val newFields = originSchema.map { field => + if (field.name == fieldName) { + field.copy(dataType = newNestedSchema) + } else { + field + } + } + StructType(newFields) + } + + private def runSchemaChecker( + dir: String, + queryId: UUID, + newKeySchema: StructType, + newValueSchema: StructType): Unit = { + // in fact, Spark doesn't support online state schema change, so need to check + // schema only once for each running of JVM + val providerId = StateStoreProviderId( + StateStoreId(dir, opId, partitionId), queryId) + + new StateSchemaCompatibilityChecker(providerId, hadoopConf) + .check(newKeySchema, newValueSchema) + } + + private def verifyException( + oldKeySchema: StructType, + oldValueSchema: StructType, + newKeySchema: StructType, + newValueSchema: StructType): Unit = { + val dir = newDir() + val queryId = UUID.randomUUID() + runSchemaChecker(dir, queryId, oldKeySchema, oldValueSchema) + + val e = intercept[StateSchemaNotCompatible] { + runSchemaChecker(dir, queryId, newKeySchema, newValueSchema) + } + + e.getMessage.contains("Provided schema doesn't match to the schema for existing state!") + e.getMessage.contains(newKeySchema.json) + e.getMessage.contains(newValueSchema.json) + e.getMessage.contains(oldKeySchema.json) + e.getMessage.contains(oldValueSchema.json) + } + + private def verifySuccess( + oldKeySchema: StructType, + oldValueSchema: StructType, + newKeySchema: StructType, + newValueSchema: StructType): Unit = { + val dir = newDir() + val queryId = UUID.randomUUID() + runSchemaChecker(dir, queryId, oldKeySchema, oldValueSchema) + runSchemaChecker(dir, queryId, newKeySchema, newValueSchema) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreCompatibilitySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreCompatibilitySuite.scala new file mode 100644 index 0000000000000..b189de8d2a21e --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreCompatibilitySuite.scala @@ -0,0 +1,84 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.streaming.state + +import java.io.File + +import org.apache.commons.io.FileUtils + +import org.apache.spark.SparkFunSuite +import org.apache.spark.io.CompressionCodec +import org.apache.spark.sql.catalyst.plans.PlanTestBase +import org.apache.spark.sql.catalyst.streaming.InternalOutputModes.Update +import org.apache.spark.sql.execution.streaming.MemoryStream +import org.apache.spark.sql.functions.count +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.streaming.StreamTest +import org.apache.spark.util.Utils + +class StateStoreCompatibilitySuite extends StreamTest with StateStoreCodecsTest { + testWithAllCodec( + "SPARK-33263: Recovery from checkpoint before codec config introduced") { + val resourceUri = this.getClass.getResource( + "/structured-streaming/checkpoint-version-3.0.0-streaming-statestore-codec/").toURI + val checkpointDir = Utils.createTempDir().getCanonicalFile + FileUtils.copyDirectory(new File(resourceUri), checkpointDir) + + import testImplicits._ + + val inputData = MemoryStream[Int] + val aggregated = inputData.toDF().groupBy("value").agg(count("*")) + inputData.addData(1, 2, 3) + + /** + * Note: The checkpoint was generated using the following input in Spark version 3.0.0: + * AddData(inputData, 1, 2, 3) + */ + + testStream(aggregated, Update)( + StartStream( + checkpointLocation = checkpointDir.getAbsolutePath, + additionalConfs = Map(SQLConf.SHUFFLE_PARTITIONS.key -> "1")), + AddData(inputData, 1, 2), + CheckNewAnswer((1, 2), (2, 2)) + ) + } +} + +trait StateStoreCodecsTest extends SparkFunSuite with PlanTestBase { + private val codecsInShortName = + CompressionCodec.ALL_COMPRESSION_CODECS.map { c => CompressionCodec.getShortName(c) } + + protected def testWithAllCodec(name: String)(func: => Any): Unit = { + codecsInShortName.foreach { codecShortName => + test(s"$name - with codec $codecShortName") { + withSQLConf(SQLConf.STATE_STORE_COMPRESSION_CODEC.key -> codecShortName) { + func + } + } + } + + CompressionCodec.ALL_COMPRESSION_CODECS.foreach { codecShortName => + test(s"$name - with codec $codecShortName") { + withSQLConf(SQLConf.STATE_STORE_COMPRESSION_CODEC.key -> codecShortName) { + func + } + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreCoordinatorSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreCoordinatorSuite.scala index 7bca225dfdd8f..d039c72bb7d18 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreCoordinatorSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreCoordinatorSuite.scala @@ -41,7 +41,7 @@ class StateStoreCoordinatorSuite extends SparkFunSuite with SharedSparkContext { assert(coordinatorRef.verifyIfInstanceActive(id, "exec1") === false) assert(coordinatorRef.getLocation(id) === None) - coordinatorRef.reportActiveInstance(id, "hostX", "exec1") + coordinatorRef.reportActiveInstance(id, "hostX", "exec1", Seq.empty) eventually(timeout(5.seconds)) { assert(coordinatorRef.verifyIfInstanceActive(id, "exec1")) assert( @@ -49,7 +49,7 @@ class StateStoreCoordinatorSuite extends SparkFunSuite with SharedSparkContext { Some(ExecutorCacheTaskLocation("hostX", "exec1").toString)) } - coordinatorRef.reportActiveInstance(id, "hostX", "exec2") + coordinatorRef.reportActiveInstance(id, "hostX", "exec2", Seq.empty) eventually(timeout(5.seconds)) { assert(coordinatorRef.verifyIfInstanceActive(id, "exec1") === false) @@ -72,9 +72,9 @@ class StateStoreCoordinatorSuite extends SparkFunSuite with SharedSparkContext { val host = "hostX" val exec = "exec1" - coordinatorRef.reportActiveInstance(id1, host, exec) - coordinatorRef.reportActiveInstance(id2, host, exec) - coordinatorRef.reportActiveInstance(id3, host, exec) + coordinatorRef.reportActiveInstance(id1, host, exec, Seq.empty) + coordinatorRef.reportActiveInstance(id2, host, exec, Seq.empty) + coordinatorRef.reportActiveInstance(id3, host, exec, Seq.empty) eventually(timeout(5.seconds)) { assert(coordinatorRef.verifyIfInstanceActive(id1, exec)) @@ -106,7 +106,7 @@ class StateStoreCoordinatorSuite extends SparkFunSuite with SharedSparkContext { val id = StateStoreProviderId(StateStoreId("x", 0, 0), UUID.randomUUID) - coordRef1.reportActiveInstance(id, "hostX", "exec1") + coordRef1.reportActiveInstance(id, "hostX", "exec1", Seq.empty) eventually(timeout(5.seconds)) { assert(coordRef2.verifyIfInstanceActive(id, "exec1")) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreRDDSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreRDDSuite.scala index 015415a534ff5..378aa1dca139f 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreRDDSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreRDDSuite.scala @@ -159,8 +159,8 @@ class StateStoreRDDSuite extends SparkFunSuite with BeforeAndAfter with BeforeAn val coordinatorRef = sqlContext.streams.stateStoreCoordinator val storeProviderId1 = StateStoreProviderId(StateStoreId(path, opId, 0), queryRunId) val storeProviderId2 = StateStoreProviderId(StateStoreId(path, opId, 1), queryRunId) - coordinatorRef.reportActiveInstance(storeProviderId1, "host1", "exec1") - coordinatorRef.reportActiveInstance(storeProviderId2, "host2", "exec2") + coordinatorRef.reportActiveInstance(storeProviderId1, "host1", "exec1", Seq.empty) + coordinatorRef.reportActiveInstance(storeProviderId2, "host2", "exec2", Seq.empty) require( coordinatorRef.getLocation(storeProviderId1) === diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreSuite.scala index 488879938339d..bbc557be126be 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/streaming/state/StateStoreSuite.scala @@ -47,15 +47,11 @@ import org.apache.spark.unsafe.types.UTF8String import org.apache.spark.util.Utils class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] - with BeforeAndAfter with PrivateMethodTester { - type MapType = mutable.HashMap[UnsafeRow, UnsafeRow] - type ProviderMapType = java.util.concurrent.ConcurrentHashMap[UnsafeRow, UnsafeRow] - - import StateStoreCoordinatorSuite._ + with BeforeAndAfter { import StateStoreTestsHelper._ - val keySchema = StructType(Seq(StructField("key", StringType, true))) - val valueSchema = StructType(Seq(StructField("value", IntegerType, true))) + override val keySchema = StructType(Seq(StructField("key", StringType, true))) + override val valueSchema = StructType(Seq(StructField("value", IntegerType, true))) before { StateStore.stop() @@ -67,63 +63,21 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] require(!StateStore.isMaintenanceRunning) } - def updateVersionTo( - provider: StateStoreProvider, - currentVersion: Int, - targetVersion: Int): Int = { - var newCurrentVersion = currentVersion - for (i <- newCurrentVersion until targetVersion) { - newCurrentVersion = incrementVersion(provider, i) - } - require(newCurrentVersion === targetVersion) - newCurrentVersion - } - - def incrementVersion(provider: StateStoreProvider, currentVersion: Int): Int = { - val store = provider.getStore(currentVersion) - put(store, "a", currentVersion + 1) - store.commit() - currentVersion + 1 - } - - def checkLoadedVersions( - loadedMaps: util.SortedMap[Long, ProviderMapType], - count: Int, - earliestKey: Long, - latestKey: Long): Unit = { - assert(loadedMaps.size() === count) - assert(loadedMaps.firstKey() === earliestKey) - assert(loadedMaps.lastKey() === latestKey) - } - - def checkVersion( - loadedMaps: util.SortedMap[Long, ProviderMapType], - version: Long, - expectedData: Map[String, Int]): Unit = { - - val originValueMap = loadedMaps.get(version).asScala.map { entry => - rowToString(entry._1) -> rowToInt(entry._2) - }.toMap - - assert(originValueMap === expectedData) - } - test("retaining only two latest versions when MAX_BATCHES_TO_RETAIN_IN_MEMORY set to 2") { - val provider = newStoreProvider(opId = Random.nextInt, partition = 0, - numOfVersToRetainInMemory = 2) + val provider = newStoreProvider(minDeltasForSnapshot = 10, numOfVersToRetainInMemory = 2) var currentVersion = 0 // commit the ver 1 : cache will have one element currentVersion = incrementVersion(provider, currentVersion) - assert(getData(provider) === Set("a" -> 1)) + assert(getLatestData(provider) === Set("a" -> 1)) var loadedMaps = provider.getLoadedMaps() checkLoadedVersions(loadedMaps, count = 1, earliestKey = 1, latestKey = 1) checkVersion(loadedMaps, 1, Map("a" -> 1)) // commit the ver 2 : cache will have two elements currentVersion = incrementVersion(provider, currentVersion) - assert(getData(provider) === Set("a" -> 2)) + assert(getLatestData(provider) === Set("a" -> 2)) loadedMaps = provider.getLoadedMaps() checkLoadedVersions(loadedMaps, count = 2, earliestKey = 2, latestKey = 1) checkVersion(loadedMaps, 2, Map("a" -> 2)) @@ -132,7 +86,7 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] // commit the ver 3 : cache has already two elements and adding ver 3 incurs exceeding cache, // and ver 3 will be added but ver 1 will be evicted currentVersion = incrementVersion(provider, currentVersion) - assert(getData(provider) === Set("a" -> 3)) + assert(getLatestData(provider) === Set("a" -> 3)) loadedMaps = provider.getLoadedMaps() checkLoadedVersions(loadedMaps, count = 2, earliestKey = 3, latestKey = 2) checkVersion(loadedMaps, 3, Map("a" -> 3)) @@ -147,7 +101,7 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] // commit the ver 1 : cache will have one element currentVersion = incrementVersion(provider, currentVersion) - assert(getData(provider) === Set("a" -> 1)) + assert(getLatestData(provider) === Set("a" -> 1)) var loadedMaps = provider.getLoadedMaps() checkLoadedVersions(loadedMaps, count = 1, earliestKey = 1, latestKey = 1) checkVersion(loadedMaps, 1, Map("a" -> 1)) @@ -157,7 +111,7 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] // this fact ensures cache miss will occur when this partition succeeds commit // but there's a failure afterwards so have to reprocess previous batch currentVersion = incrementVersion(provider, currentVersion) - assert(getData(provider) === Set("a" -> 2)) + assert(getLatestData(provider) === Set("a" -> 2)) loadedMaps = provider.getLoadedMaps() checkLoadedVersions(loadedMaps, count = 1, earliestKey = 2, latestKey = 2) checkVersion(loadedMaps, 2, Map("a" -> 2)) @@ -173,7 +127,7 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] currentVersion += 1 // make sure newly committed version is reflected to the cache (overwritten) - assert(getData(provider) === Set("a" -> -2)) + assert(getLatestData(provider) === Set("a" -> -2)) loadedMaps = provider.getLoadedMaps() checkLoadedVersions(loadedMaps, count = 1, earliestKey = 2, latestKey = 2) checkVersion(loadedMaps, 2, Map("a" -> -2)) @@ -187,61 +141,17 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] // commit the ver 1 : never cached currentVersion = incrementVersion(provider, currentVersion) - assert(getData(provider) === Set("a" -> 1)) + assert(getLatestData(provider) === Set("a" -> 1)) var loadedMaps = provider.getLoadedMaps() assert(loadedMaps.size() === 0) // commit the ver 2 : never cached currentVersion = incrementVersion(provider, currentVersion) - assert(getData(provider) === Set("a" -> 2)) + assert(getLatestData(provider) === Set("a" -> 2)) loadedMaps = provider.getLoadedMaps() assert(loadedMaps.size() === 0) } - test("snapshotting") { - val provider = newStoreProvider(opId = Random.nextInt, partition = 0, minDeltasForSnapshot = 5) - - var currentVersion = 0 - - currentVersion = updateVersionTo(provider, currentVersion, 2) - require(getData(provider) === Set("a" -> 2)) - provider.doMaintenance() // should not generate snapshot files - assert(getData(provider) === Set("a" -> 2)) - - for (i <- 1 to currentVersion) { - assert(fileExists(provider, i, isSnapshot = false)) // all delta files present - assert(!fileExists(provider, i, isSnapshot = true)) // no snapshot files present - } - - // After version 6, snapshotting should generate one snapshot file - currentVersion = updateVersionTo(provider, currentVersion, 6) - require(getData(provider) === Set("a" -> 6), "store not updated correctly") - provider.doMaintenance() // should generate snapshot files - - val snapshotVersion = (0 to 6).find(version => fileExists(provider, version, isSnapshot = true)) - assert(snapshotVersion.nonEmpty, "snapshot file not generated") - deleteFilesEarlierThanVersion(provider, snapshotVersion.get) - assert( - getData(provider, snapshotVersion.get) === Set("a" -> snapshotVersion.get), - "snapshotting messed up the data of the snapshotted version") - assert( - getData(provider) === Set("a" -> 6), - "snapshotting messed up the data of the final version") - - // After version 20, snapshotting should generate newer snapshot files - currentVersion = updateVersionTo(provider, currentVersion, 20) - require(getData(provider) === Set("a" -> 20), "store not updated correctly") - provider.doMaintenance() // do snapshot - - val latestSnapshotVersion = (0 to 20).filter(version => - fileExists(provider, version, isSnapshot = true)).lastOption - assert(latestSnapshotVersion.nonEmpty, "no snapshot file found") - assert(latestSnapshotVersion.get > snapshotVersion.get, "newer snapshot not generated") - - deleteFilesEarlierThanVersion(provider, latestSnapshotVersion.get) - assert(getData(provider) === Set("a" -> 20), "snapshotting messed up the data") - } - test("cleaning") { val provider = newStoreProvider(opId = Random.nextInt, partition = 0, minDeltasForSnapshot = 5) @@ -309,15 +219,6 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] } } - test("reports memory usage") { - val provider = newStoreProvider() - val store = provider.getStore(0) - val noDataMemoryUsed = store.metrics.memoryUsedBytes - put(store, "a", 1) - store.commit() - assert(store.metrics.memoryUsedBytes > noDataMemoryUsed) - } - test("reports memory usage on current version") { def getSizeOfStateForCurrentVersion(metrics: StateStoreMetrics): Long = { val metricPair = metrics.customMetrics.find(_._1.name == "stateOnCurrentVersionSizeBytes") @@ -334,156 +235,6 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] assert(getSizeOfStateForCurrentVersion(store.metrics) > noDataMemoryUsed) } - test("StateStore.get") { - quietly { - val dir = newDir() - val storeId = StateStoreProviderId(StateStoreId(dir, 0, 0), UUID.randomUUID) - val storeConf = StateStoreConf.empty - val hadoopConf = new Configuration() - - // Verify that trying to get incorrect versions throw errors - intercept[IllegalArgumentException] { - StateStore.get( - storeId, keySchema, valueSchema, None, -1, storeConf, hadoopConf) - } - assert(!StateStore.isLoaded(storeId)) // version -1 should not attempt to load the store - - intercept[IllegalStateException] { - StateStore.get( - storeId, keySchema, valueSchema, None, 1, storeConf, hadoopConf) - } - - // Increase version of the store and try to get again - val store0 = StateStore.get( - storeId, keySchema, valueSchema, None, 0, storeConf, hadoopConf) - assert(store0.version === 0) - put(store0, "a", 1) - store0.commit() - - val store1 = StateStore.get( - storeId, keySchema, valueSchema, None, 1, storeConf, hadoopConf) - assert(StateStore.isLoaded(storeId)) - assert(store1.version === 1) - assert(rowsToSet(store1.iterator()) === Set("a" -> 1)) - - // Verify that you can also load older version - val store0reloaded = StateStore.get( - storeId, keySchema, valueSchema, None, 0, storeConf, hadoopConf) - assert(store0reloaded.version === 0) - assert(rowsToSet(store0reloaded.iterator()) === Set.empty) - - // Verify that you can remove the store and still reload and use it - StateStore.unload(storeId) - assert(!StateStore.isLoaded(storeId)) - - val store1reloaded = StateStore.get( - storeId, keySchema, valueSchema, None, 1, storeConf, hadoopConf) - assert(StateStore.isLoaded(storeId)) - assert(store1reloaded.version === 1) - put(store1reloaded, "a", 2) - assert(store1reloaded.commit() === 2) - assert(rowsToSet(store1reloaded.iterator()) === Set("a" -> 2)) - } - } - - test("maintenance") { - val conf = new SparkConf() - .setMaster("local") - .setAppName("test") - // Make maintenance thread do snapshots and cleanups very fast - .set(StateStore.MAINTENANCE_INTERVAL_CONFIG, "10ms") - // Make sure that when SparkContext stops, the StateStore maintenance thread 'quickly' - // fails to talk to the StateStoreCoordinator and unloads all the StateStores - .set(RPC_NUM_RETRIES, 1) - val opId = 0 - val dir = newDir() - val storeProviderId = StateStoreProviderId(StateStoreId(dir, opId, 0), UUID.randomUUID) - val sqlConf = new SQLConf() - sqlConf.setConf(SQLConf.MIN_BATCHES_TO_RETAIN, 2) - val storeConf = StateStoreConf(sqlConf) - val hadoopConf = new Configuration() - val provider = newStoreProvider(storeProviderId.storeId) - - var latestStoreVersion = 0 - - def generateStoreVersions(): Unit = { - for (i <- 1 to 20) { - val store = StateStore.get(storeProviderId, keySchema, valueSchema, None, - latestStoreVersion, storeConf, hadoopConf) - put(store, "a", i) - store.commit() - latestStoreVersion += 1 - } - } - - val timeoutDuration = 1.minute - - quietly { - withSpark(new SparkContext(conf)) { sc => - withCoordinatorRef(sc) { coordinatorRef => - require(!StateStore.isMaintenanceRunning, "StateStore is unexpectedly running") - - // Generate sufficient versions of store for snapshots - generateStoreVersions() - - eventually(timeout(timeoutDuration)) { - // Store should have been reported to the coordinator - assert(coordinatorRef.getLocation(storeProviderId).nonEmpty, - "active instance was not reported") - - // Background maintenance should clean up and generate snapshots - assert(StateStore.isMaintenanceRunning, "Maintenance task is not running") - - // Some snapshots should have been generated - val snapshotVersions = (1 to latestStoreVersion).filter { version => - fileExists(provider, version, isSnapshot = true) - } - assert(snapshotVersions.nonEmpty, "no snapshot file found") - } - - // Generate more versions such that there is another snapshot and - // the earliest delta file will be cleaned up - generateStoreVersions() - - // Earliest delta file should get cleaned up - eventually(timeout(timeoutDuration)) { - assert(!fileExists(provider, 1, isSnapshot = false), "earliest file not deleted") - } - - // If driver decides to deactivate all stores related to a query run, - // then this instance should be unloaded - coordinatorRef.deactivateInstances(storeProviderId.queryRunId) - eventually(timeout(timeoutDuration)) { - assert(!StateStore.isLoaded(storeProviderId)) - } - - // Reload the store and verify - StateStore.get(storeProviderId, keySchema, valueSchema, indexOrdinal = None, - latestStoreVersion, storeConf, hadoopConf) - assert(StateStore.isLoaded(storeProviderId)) - - // If some other executor loads the store, then this instance should be unloaded - coordinatorRef.reportActiveInstance(storeProviderId, "other-host", "other-exec") - eventually(timeout(timeoutDuration)) { - assert(!StateStore.isLoaded(storeProviderId)) - } - - // Reload the store and verify - StateStore.get(storeProviderId, keySchema, valueSchema, indexOrdinal = None, - latestStoreVersion, storeConf, hadoopConf) - assert(StateStore.isLoaded(storeProviderId)) - } - } - - // Verify if instance is unloaded if SparkContext is stopped - eventually(timeout(timeoutDuration)) { - require(SparkEnv.get === null) - assert(!StateStore.isLoaded(storeProviderId)) - assert(!StateStore.isMaintenanceRunning) - } - } - } - testQuietly("SPARK-18342: commit fails when rename fails") { import RenameReturnsFalseFileSystem._ val dir = scheme + "://" + newDir() @@ -741,13 +492,21 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] newStoreProvider(storeId.operatorId, storeId.partitionId, dir = storeId.checkpointRootLocation) } + override def newStoreProvider( + minDeltasForSnapshot: Int, + numOfVersToRetainInMemory: Int): HDFSBackedStateStoreProvider = { + newStoreProvider(opId = Random.nextInt(), partition = 0, + minDeltasForSnapshot = minDeltasForSnapshot, + numOfVersToRetainInMemory = numOfVersToRetainInMemory) + } + override def getLatestData(storeProvider: HDFSBackedStateStoreProvider): Set[(String, Int)] = { - getData(storeProvider) + getData(storeProvider, -1) } override def getData( provider: HDFSBackedStateStoreProvider, - version: Int = -1): Set[(String, Int)] = { + version: Int): Set[(String, Int)] = { val reloadedProvider = newStoreProvider(provider.stateStoreId) if (version < 0) { reloadedProvider.latestIterator().map(rowsToStringInt).toSet @@ -756,6 +515,17 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] } } + override def getDefaultSQLConf( + minDeltasForSnapshot: Int, + numOfVersToRetainInMemory: Int): SQLConf = { + val sqlConf = new SQLConf() + sqlConf.setConf(SQLConf.STATE_STORE_MIN_DELTAS_FOR_SNAPSHOT, minDeltasForSnapshot) + sqlConf.setConf(SQLConf.MAX_BATCHES_TO_RETAIN_IN_MEMORY, numOfVersToRetainInMemory) + sqlConf.setConf(SQLConf.MIN_BATCHES_TO_RETAIN, 2) + sqlConf.setConf(SQLConf.STATE_STORE_COMPRESSION_CODEC, SQLConf.get.stateStoreCompressionCodec) + sqlConf + } + def newStoreProvider( opId: Long, partition: Int, @@ -763,10 +533,7 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] minDeltasForSnapshot: Int = SQLConf.STATE_STORE_MIN_DELTAS_FOR_SNAPSHOT.defaultValue.get, numOfVersToRetainInMemory: Int = SQLConf.MAX_BATCHES_TO_RETAIN_IN_MEMORY.defaultValue.get, hadoopConf: Configuration = new Configuration): HDFSBackedStateStoreProvider = { - val sqlConf = new SQLConf() - sqlConf.setConf(SQLConf.STATE_STORE_MIN_DELTAS_FOR_SNAPSHOT, minDeltasForSnapshot) - sqlConf.setConf(SQLConf.MAX_BATCHES_TO_RETAIN_IN_MEMORY, numOfVersToRetainInMemory) - sqlConf.setConf(SQLConf.MIN_BATCHES_TO_RETAIN, 2) + val sqlConf = getDefaultSQLConf(minDeltasForSnapshot, numOfVersToRetainInMemory) val provider = new HDFSBackedStateStoreProvider() provider.init( StateStoreId(dir, opId, partition), @@ -778,27 +545,25 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] provider } - def fileExists( - provider: HDFSBackedStateStoreProvider, - version: Long, - isSnapshot: Boolean): Boolean = { - val method = PrivateMethod[Path](Symbol("baseDir")) - val basePath = provider invokePrivate method() - val fileName = if (isSnapshot) s"$version.snapshot" else s"$version.delta" - val filePath = new File(basePath.toString, fileName) - filePath.exists + def checkLoadedVersions( + loadedMaps: util.SortedMap[Long, ProviderMapType], + count: Int, + earliestKey: Long, + latestKey: Long): Unit = { + assert(loadedMaps.size() === count) + assert(loadedMaps.firstKey() === earliestKey) + assert(loadedMaps.lastKey() === latestKey) } - def deleteFilesEarlierThanVersion(provider: HDFSBackedStateStoreProvider, version: Long): Unit = { - val method = PrivateMethod[Path](Symbol("baseDir")) - val basePath = provider invokePrivate method() - for (version <- 0 until version.toInt) { - for (isSnapshot <- Seq(false, true)) { - val fileName = if (isSnapshot) s"$version.snapshot" else s"$version.delta" - val filePath = new File(basePath.toString, fileName) - if (filePath.exists) filePath.delete() - } - } + def checkVersion( + loadedMaps: util.SortedMap[Long, ProviderMapType], + version: Long, + expectedData: Map[String, Int]): Unit = { + val originValueMap = loadedMaps.get(version).asScala.map { entry => + rowToString(entry._1) -> rowToInt(entry._2) + }.toMap + + assert(originValueMap === expectedData) } def corruptFile( @@ -815,10 +580,17 @@ class StateStoreSuite extends StateStoreSuiteBase[HDFSBackedStateStoreProvider] } abstract class StateStoreSuiteBase[ProviderClass <: StateStoreProvider] - extends SparkFunSuite { + extends StateStoreCodecsTest with PrivateMethodTester { import StateStoreTestsHelper._ + import StateStoreCoordinatorSuite._ - test("get, put, remove, commit, and all data iterator") { + type MapType = mutable.HashMap[UnsafeRow, UnsafeRow] + type ProviderMapType = java.util.concurrent.ConcurrentHashMap[UnsafeRow, UnsafeRow] + + protected val keySchema: StructType + protected val valueSchema: StructType + + testWithAllCodec("get, put, remove, commit, and all data iterator") { val provider = newStoreProvider() // Verify state before starting a new set of updates @@ -833,7 +605,6 @@ abstract class StateStoreSuiteBase[ProviderClass <: StateStoreProvider] // Verify state after updating put(store, "a", 1) assert(get(store, "a") === Some(1)) - assert(store.metrics.numKeys === 1) assert(store.iterator().nonEmpty) assert(getLatestData(provider).isEmpty) @@ -841,9 +612,7 @@ abstract class StateStoreSuiteBase[ProviderClass <: StateStoreProvider] // Make updates, commit and then verify state put(store, "b", 2) put(store, "aa", 3) - assert(store.metrics.numKeys === 3) remove(store, _.startsWith("a")) - assert(store.metrics.numKeys === 1) assert(store.commit() === 1) assert(store.hasCommitted) @@ -861,16 +630,38 @@ abstract class StateStoreSuiteBase[ProviderClass <: StateStoreProvider] // New updates to the reloaded store with new version, and does not change old version val reloadedProvider = newStoreProvider(store.id) val reloadedStore = reloadedProvider.getStore(1) - assert(reloadedStore.metrics.numKeys === 1) put(reloadedStore, "c", 4) - assert(reloadedStore.metrics.numKeys === 2) assert(reloadedStore.commit() === 2) assert(rowsToSet(reloadedStore.iterator()) === Set("b" -> 2, "c" -> 4)) assert(getLatestData(provider) === Set("b" -> 2, "c" -> 4)) assert(getData(provider, version = 1) === Set("b" -> 2)) } - test("removing while iterating") { + testWithAllCodec("numKeys metrics") { + val provider = newStoreProvider() + + // Verify state before starting a new set of updates + assert(getLatestData(provider).isEmpty) + + val store = provider.getStore(0) + put(store, "a", 1) + put(store, "b", 2) + put(store, "c", 3) + put(store, "d", 4) + put(store, "e", 5) + assert(store.commit() === 1) + assert(store.metrics.numKeys === 5) + assert(rowsToSet(store.iterator()) === Set("a" -> 1, "b" -> 2, "c" -> 3, "d" -> 4, "e" -> 5)) + + val reloadedProvider = newStoreProvider(store.id) + val reloadedStore = reloadedProvider.getStore(1) + remove(reloadedStore, _ == "b") + assert(reloadedStore.commit() === 2) + assert(reloadedStore.metrics.numKeys === 4) + assert(rowsToSet(reloadedStore.iterator()) === Set("a" -> 1, "c" -> 3, "d" -> 4, "e" -> 5)) + } + + testWithAllCodec("removing while iterating") { val provider = newStoreProvider() // Verify state before starting a new set of updates @@ -892,7 +683,7 @@ abstract class StateStoreSuiteBase[ProviderClass <: StateStoreProvider] assert(get(store, "b") === None) } - test("abort") { + testWithAllCodec("abort") { val provider = newStoreProvider() val store = provider.getStore(0) put(store, "a", 1) @@ -905,7 +696,7 @@ abstract class StateStoreSuiteBase[ProviderClass <: StateStoreProvider] store1.abort() } - test("getStore with invalid versions") { + testWithAllCodec("getStore with invalid versions") { val provider = newStoreProvider() def checkInvalidVersion(version: Int): Unit = { @@ -939,7 +730,7 @@ abstract class StateStoreSuiteBase[ProviderClass <: StateStoreProvider] checkInvalidVersion(3) } - test("two concurrent StateStores - one for read-only and one for read-write") { + testWithAllCodec("two concurrent StateStores - one for read-only and one for read-write") { // During Streaming Aggregation, we have two StateStores per task, one used as read-only in // `StateStoreRestoreExec`, and one read-write used in `StateStoreSaveExec`. `StateStore.abort` // will be called for these StateStores if they haven't committed their results. We need to @@ -957,7 +748,7 @@ abstract class StateStoreSuiteBase[ProviderClass <: StateStoreProvider] // two state stores val provider1 = newStoreProvider(storeId) - val restoreStore = provider1.getStore(1) + val restoreStore = provider1.getReadStore(1) val saveStore = provider1.getStore(1) put(saveStore, key, get(restoreStore, key).get + 1) @@ -970,12 +761,254 @@ abstract class StateStoreSuiteBase[ProviderClass <: StateStoreProvider] assert(rowsToSet(finalStore.iterator()) === Set(key -> 2)) } + test("maintenance") { + val conf = new SparkConf() + .setMaster("local") + .setAppName("test") + // Make sure that when SparkContext stops, the StateStore maintenance thread 'quickly' + // fails to talk to the StateStoreCoordinator and unloads all the StateStores + .set(RPC_NUM_RETRIES, 1) + val opId = 0 + val dir1 = newDir() + val storeProviderId1 = StateStoreProviderId(StateStoreId(dir1, opId, 0), UUID.randomUUID) + val dir2 = newDir() + val storeProviderId2 = StateStoreProviderId(StateStoreId(dir2, opId, 1), UUID.randomUUID) + val sqlConf = getDefaultSQLConf(SQLConf.STATE_STORE_MIN_DELTAS_FOR_SNAPSHOT.defaultValue.get, + SQLConf.MAX_BATCHES_TO_RETAIN_IN_MEMORY.defaultValue.get) + sqlConf.setConf(SQLConf.MIN_BATCHES_TO_RETAIN, 2) + // Make maintenance thread do snapshots and cleanups very fast + sqlConf.setConf(SQLConf.STREAMING_MAINTENANCE_INTERVAL, 10L) + val storeConf = StateStoreConf(sqlConf) + val hadoopConf = new Configuration() + val provider = newStoreProvider(storeProviderId1.storeId) + + var latestStoreVersion = 0 + + def generateStoreVersions(): Unit = { + for (i <- 1 to 20) { + val store = StateStore.get(storeProviderId1, keySchema, valueSchema, None, + latestStoreVersion, storeConf, hadoopConf) + put(store, "a", i) + store.commit() + latestStoreVersion += 1 + } + } + + val timeoutDuration = 1.minute + + quietly { + withSpark(new SparkContext(conf)) { sc => + withCoordinatorRef(sc) { coordinatorRef => + require(!StateStore.isMaintenanceRunning, "StateStore is unexpectedly running") + + // Generate sufficient versions of store for snapshots + generateStoreVersions() + + eventually(timeout(timeoutDuration)) { + // Store should have been reported to the coordinator + assert(coordinatorRef.getLocation(storeProviderId1).nonEmpty, + "active instance was not reported") + + // Background maintenance should clean up and generate snapshots + assert(StateStore.isMaintenanceRunning, "Maintenance task is not running") + + // Some snapshots should have been generated + val snapshotVersions = (1 to latestStoreVersion).filter { version => + fileExists(provider, version, isSnapshot = true) + } + assert(snapshotVersions.nonEmpty, "no snapshot file found") + } + + // Generate more versions such that there is another snapshot and + // the earliest delta file will be cleaned up + generateStoreVersions() + + // Earliest delta file should get cleaned up + eventually(timeout(timeoutDuration)) { + assert(!fileExists(provider, 1, isSnapshot = false), "earliest file not deleted") + } + + // If driver decides to deactivate all stores related to a query run, + // then this instance should be unloaded + coordinatorRef.deactivateInstances(storeProviderId1.queryRunId) + eventually(timeout(timeoutDuration)) { + assert(!StateStore.isLoaded(storeProviderId1)) + } + + // Reload the store and verify + StateStore.get(storeProviderId1, keySchema, valueSchema, indexOrdinal = None, + latestStoreVersion, storeConf, hadoopConf) + assert(StateStore.isLoaded(storeProviderId1)) + + // If some other executor loads the store, then this instance should be unloaded + coordinatorRef + .reportActiveInstance(storeProviderId1, "other-host", "other-exec", Seq.empty) + eventually(timeout(timeoutDuration)) { + assert(!StateStore.isLoaded(storeProviderId1)) + } + + // Reload the store and verify + StateStore.get(storeProviderId1, keySchema, valueSchema, indexOrdinal = None, + latestStoreVersion, storeConf, hadoopConf) + assert(StateStore.isLoaded(storeProviderId1)) + + // If some other executor loads the store, and when this executor loads other store, + // then this executor should unload inactive instances immediately. + coordinatorRef + .reportActiveInstance(storeProviderId1, "other-host", "other-exec", Seq.empty) + StateStore.get(storeProviderId2, keySchema, valueSchema, indexOrdinal = None, + 0, storeConf, hadoopConf) + assert(!StateStore.isLoaded(storeProviderId1)) + assert(StateStore.isLoaded(storeProviderId2)) + } + } + + // Verify if instance is unloaded if SparkContext is stopped + eventually(timeout(timeoutDuration)) { + require(SparkEnv.get === null) + assert(!StateStore.isLoaded(storeProviderId1)) + assert(!StateStore.isLoaded(storeProviderId2)) + assert(!StateStore.isMaintenanceRunning) + } + } + } + + test("StateStore.get") { + quietly { + val dir = newDir() + val storeId = StateStoreProviderId(StateStoreId(dir, 0, 0), UUID.randomUUID) + val storeConf = getDefaultStoreConf + val hadoopConf = new Configuration() + + // Verify that trying to get incorrect versions throw errors + intercept[IllegalArgumentException] { + StateStore.get( + storeId, keySchema, valueSchema, None, -1, storeConf, hadoopConf) + } + assert(!StateStore.isLoaded(storeId)) // version -1 should not attempt to load the store + + intercept[IllegalStateException] { + StateStore.get( + storeId, keySchema, valueSchema, None, 1, storeConf, hadoopConf) + } + + // Increase version of the store and try to get again + val store0 = StateStore.get( + storeId, keySchema, valueSchema, None, 0, storeConf, hadoopConf) + assert(store0.version === 0) + put(store0, "a", 1) + store0.commit() + + val store1 = StateStore.get( + storeId, keySchema, valueSchema, None, 1, storeConf, hadoopConf) + assert(StateStore.isLoaded(storeId)) + assert(store1.version === 1) + assert(rowsToSet(store1.iterator()) === Set("a" -> 1)) + + // Verify that you can also load older version + val store0reloaded = StateStore.get( + storeId, keySchema, valueSchema, None, 0, storeConf, hadoopConf) + assert(store0reloaded.version === 0) + assert(rowsToSet(store0reloaded.iterator()) === Set.empty) + + // Verify that you can remove the store and still reload and use it + StateStore.unload(storeId) + assert(!StateStore.isLoaded(storeId)) + + val store1reloaded = StateStore.get( + storeId, keySchema, valueSchema, None, 1, storeConf, hadoopConf) + assert(StateStore.isLoaded(storeId)) + assert(store1reloaded.version === 1) + put(store1reloaded, "a", 2) + assert(store1reloaded.commit() === 2) + assert(rowsToSet(store1reloaded.iterator()) === Set("a" -> 2)) + } + } + + test("snapshotting") { + val provider = newStoreProvider(minDeltasForSnapshot = 5, numOfVersToRetainInMemory = 2) + + var currentVersion = 0 + + currentVersion = updateVersionTo(provider, currentVersion, 2) + require(getLatestData(provider) === Set("a" -> 2)) + provider.doMaintenance() // should not generate snapshot files + assert(getLatestData(provider) === Set("a" -> 2)) + + for (i <- 1 to currentVersion) { + assert(fileExists(provider, i, isSnapshot = false)) // all delta files present + assert(!fileExists(provider, i, isSnapshot = true)) // no snapshot files present + } + + // After version 6, snapshotting should generate one snapshot file + currentVersion = updateVersionTo(provider, currentVersion, 6) + require(getLatestData(provider) === Set("a" -> 6), "store not updated correctly") + provider.doMaintenance() // should generate snapshot files + + val snapshotVersion = (0 to 6).find(version => fileExists(provider, version, isSnapshot = true)) + assert(snapshotVersion.nonEmpty, "snapshot file not generated") + deleteFilesEarlierThanVersion(provider, snapshotVersion.get) + assert( + getData(provider, snapshotVersion.get) === Set("a" -> snapshotVersion.get), + "snapshotting messed up the data of the snapshotted version") + assert( + getLatestData(provider) === Set("a" -> 6), + "snapshotting messed up the data of the final version") + + // After version 20, snapshotting should generate newer snapshot files + currentVersion = updateVersionTo(provider, currentVersion, 20) + require(getLatestData(provider) === Set("a" -> 20), "store not updated correctly") + provider.doMaintenance() // do snapshot + + val latestSnapshotVersion = (0 to 20).filter(version => + fileExists(provider, version, isSnapshot = true)).lastOption + assert(latestSnapshotVersion.nonEmpty, "no snapshot file found") + assert(latestSnapshotVersion.get > snapshotVersion.get, "newer snapshot not generated") + + deleteFilesEarlierThanVersion(provider, latestSnapshotVersion.get) + assert(getLatestData(provider) === Set("a" -> 20), "snapshotting messed up the data") + } + + test("reports memory usage") { + val provider = newStoreProvider() + val store = provider.getStore(0) + val noDataMemoryUsed = store.metrics.memoryUsedBytes + put(store, "a", 1) + store.commit() + assert(store.metrics.memoryUsedBytes > noDataMemoryUsed) + } + + test("SPARK-34270: StateStoreMetrics.combine should not override individual metrics") { + val customSumMetric = StateStoreCustomSumMetric("metric1", "custom metric 1") + val customSizeMetric = StateStoreCustomSizeMetric("metric2", "custom metric 2") + val customTimingMetric = StateStoreCustomTimingMetric("metric3", "custom metric 3") + + val leftCustomMetrics: Map[StateStoreCustomMetric, Long] = + Map(customSumMetric -> 10L, customSizeMetric -> 5L, customTimingMetric -> 100L) + val leftMetrics = StateStoreMetrics(1, 10, leftCustomMetrics) + + val rightCustomMetrics: Map[StateStoreCustomMetric, Long] = + Map(customSumMetric -> 20L, customSizeMetric -> 15L, customTimingMetric -> 300L) + val rightMetrics = StateStoreMetrics(3, 20, rightCustomMetrics) + + val combinedMetrics = StateStoreMetrics.combine(Seq(leftMetrics, rightMetrics)) + assert(combinedMetrics.numKeys == 4) + assert(combinedMetrics.memoryUsedBytes == 30) + assert(combinedMetrics.customMetrics.size == 3) + assert(combinedMetrics.customMetrics(customSumMetric) == 30L) + assert(combinedMetrics.customMetrics(customSizeMetric) == 20L) + assert(combinedMetrics.customMetrics(customTimingMetric) == 400L) + } + /** Return a new provider with a random id */ def newStoreProvider(): ProviderClass /** Return a new provider with the given id */ def newStoreProvider(storeId: StateStoreId): ProviderClass + /** Return a new provider with minimum delta and version to retain in memory */ + def newStoreProvider(minDeltasForSnapshot: Int, numOfVersToRetainInMemory: Int): ProviderClass + /** Get the latest data referred to by the given provider but not using this provider */ def getLatestData(storeProvider: ProviderClass): Set[(String, Int)] @@ -992,6 +1025,54 @@ abstract class StateStoreSuiteBase[ProviderClass <: StateStoreProvider] } } } + + /** Get the `SQLConf` by the given minimum delta and version to retain in memory */ + def getDefaultSQLConf(minDeltasForSnapshot: Int, numOfVersToRetainInMemory: Int): SQLConf + + /** Get the `StateStoreConf` used by the tests with default setting */ + def getDefaultStoreConf(): StateStoreConf = StateStoreConf.empty + + protected def fileExists( + provider: ProviderClass, + version: Long, + isSnapshot: Boolean): Boolean = { + val method = PrivateMethod[Path](Symbol("baseDir")) + val basePath = provider invokePrivate method() + val fileName = if (isSnapshot) s"$version.snapshot" else s"$version.delta" + val filePath = new File(basePath.toString, fileName) + filePath.exists + } + + def updateVersionTo( + provider: StateStoreProvider, + currentVersion: Int, + targetVersion: Int): Int = { + var newCurrentVersion = currentVersion + for (i <- newCurrentVersion until targetVersion) { + newCurrentVersion = incrementVersion(provider, i) + } + require(newCurrentVersion === targetVersion) + newCurrentVersion + } + + def incrementVersion(provider: StateStoreProvider, currentVersion: Int): Int = { + val store = provider.getStore(currentVersion) + put(store, "a", currentVersion + 1) + store.commit() + currentVersion + 1 + } + + def deleteFilesEarlierThanVersion(provider: ProviderClass, version: Long): Unit = { + val method = PrivateMethod[Path](Symbol("baseDir")) + val basePath = provider invokePrivate method() + for (version <- 0 until version.toInt) { + for (isSnapshot <- Seq(false, true)) { + val fileName = if (isSnapshot) s"$version.snapshot" else s"$version.delta" + val filePath = new File(basePath.toString, fileName) + if (filePath.exists) filePath.delete() + } + } + } } object StateStoreTestsHelper { @@ -1033,7 +1114,7 @@ object StateStoreTestsHelper { store.put(stringToRow(key), intToRow(value)) } - def get(store: StateStore, key: String): Option[Int] = { + def get(store: ReadStateStore, key: String): Option[Int] = { Option(store.get(stringToRow(key))).map(rowToInt) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/MetricsAggregationBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/MetricsAggregationBenchmark.scala index c09ff51ecaff2..533d98da240fc 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/MetricsAggregationBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/MetricsAggregationBenchmark.scala @@ -39,7 +39,8 @@ import org.apache.spark.util.kvstore.InMemoryStore * Benchmark for metrics aggregation in the SQL listener. * {{{ * To run this benchmark: - * 1. without sbt: bin/spark-submit --class --jars + * 1. without sbt: + * bin/spark-submit --class --jars * 2. build/sbt "core/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "core/test:runMain " * Results will be written to "benchmarks/MetricsAggregationBenchmark-results.txt". diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala index 4d5cd109b7c24..612b74a661d39 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala @@ -37,13 +37,18 @@ import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.Attribute import org.apache.spark.sql.catalyst.plans.logical.LocalRelation import org.apache.spark.sql.catalyst.util.quietly +import org.apache.spark.sql.connector.{RangeInputPartition, SimpleScanBuilder} +import org.apache.spark.sql.connector.metric.{CustomMetric, CustomTaskMetric} +import org.apache.spark.sql.connector.read.{InputPartition, PartitionReader, PartitionReaderFactory} import org.apache.spark.sql.execution.{LeafExecNode, QueryExecution, SparkPlanInfo, SQLExecution} import org.apache.spark.sql.execution.adaptive.DisableAdaptiveExecution +import org.apache.spark.sql.execution.datasources.v2.BatchScanExec import org.apache.spark.sql.execution.metric.{SQLMetric, SQLMetrics} import org.apache.spark.sql.functions.count import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.internal.StaticSQLConf.UI_RETAINED_EXECUTIONS import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.sql.types.StructType import org.apache.spark.status.ElementTrackingStore import org.apache.spark.util.{AccumulatorMetadata, JsonProtocol, LongAccumulator} import org.apache.spark.util.kvstore.InMemoryStore @@ -209,21 +214,24 @@ class SQLAppStatusListenerSuite extends SharedSparkSession with JsonTestUtils (1L, 0, 0, createAccumulatorInfos(accumulatorUpdates)) ))) - checkAnswer(statusStore.executionMetrics(executionId), accumulatorUpdates.mapValues(_ * 2)) + checkAnswer(statusStore.executionMetrics(executionId), + accumulatorUpdates.mapValues(_ * 2).toMap) // Driver accumulator updates don't belong to this execution should be filtered and no // exception will be thrown. listener.onOtherEvent(SparkListenerDriverAccumUpdates(0, Seq((999L, 2L)))) - checkAnswer(statusStore.executionMetrics(executionId), accumulatorUpdates.mapValues(_ * 2)) + checkAnswer(statusStore.executionMetrics(executionId), + accumulatorUpdates.mapValues(_ * 2).toMap) listener.onExecutorMetricsUpdate(SparkListenerExecutorMetricsUpdate("", Seq( // (task id, stage id, stage attempt, accum updates) (0L, 0, 0, createAccumulatorInfos(accumulatorUpdates)), - (1L, 0, 0, createAccumulatorInfos(accumulatorUpdates.mapValues(_ * 2))) + (1L, 0, 0, createAccumulatorInfos(accumulatorUpdates.mapValues(_ * 2).toMap)) ))) - checkAnswer(statusStore.executionMetrics(executionId), accumulatorUpdates.mapValues(_ * 3)) + checkAnswer(statusStore.executionMetrics(executionId), + accumulatorUpdates.mapValues(_ * 3).toMap) // Retrying a stage should reset the metrics listener.onStageSubmitted(SparkListenerStageSubmitted(createStageInfo(0, 1))) @@ -236,7 +244,8 @@ class SQLAppStatusListenerSuite extends SharedSparkSession with JsonTestUtils (1L, 0, 1, createAccumulatorInfos(accumulatorUpdates)) ))) - checkAnswer(statusStore.executionMetrics(executionId), accumulatorUpdates.mapValues(_ * 2)) + checkAnswer(statusStore.executionMetrics(executionId), + accumulatorUpdates.mapValues(_ * 2).toMap) // Ignore the task end for the first attempt listener.onTaskEnd(SparkListenerTaskEnd( @@ -244,11 +253,12 @@ class SQLAppStatusListenerSuite extends SharedSparkSession with JsonTestUtils stageAttemptId = 0, taskType = "", reason = null, - createTaskInfo(0, 0, accums = accumulatorUpdates.mapValues(_ * 100)), + createTaskInfo(0, 0, accums = accumulatorUpdates.mapValues(_ * 100).toMap), new ExecutorMetrics, null)) - checkAnswer(statusStore.executionMetrics(executionId), accumulatorUpdates.mapValues(_ * 2)) + checkAnswer(statusStore.executionMetrics(executionId), + accumulatorUpdates.mapValues(_ * 2).toMap) // Finish two tasks listener.onTaskEnd(SparkListenerTaskEnd( @@ -256,7 +266,7 @@ class SQLAppStatusListenerSuite extends SharedSparkSession with JsonTestUtils stageAttemptId = 1, taskType = "", reason = null, - createTaskInfo(0, 0, accums = accumulatorUpdates.mapValues(_ * 2)), + createTaskInfo(0, 0, accums = accumulatorUpdates.mapValues(_ * 2).toMap), new ExecutorMetrics, null)) listener.onTaskEnd(SparkListenerTaskEnd( @@ -264,11 +274,12 @@ class SQLAppStatusListenerSuite extends SharedSparkSession with JsonTestUtils stageAttemptId = 1, taskType = "", reason = null, - createTaskInfo(1, 0, accums = accumulatorUpdates.mapValues(_ * 3)), + createTaskInfo(1, 0, accums = accumulatorUpdates.mapValues(_ * 3).toMap), new ExecutorMetrics, null)) - checkAnswer(statusStore.executionMetrics(executionId), accumulatorUpdates.mapValues(_ * 5)) + checkAnswer(statusStore.executionMetrics(executionId), + accumulatorUpdates.mapValues(_ * 5).toMap) // Summit a new stage listener.onStageSubmitted(SparkListenerStageSubmitted(createStageInfo(1, 0))) @@ -281,7 +292,8 @@ class SQLAppStatusListenerSuite extends SharedSparkSession with JsonTestUtils (1L, 1, 0, createAccumulatorInfos(accumulatorUpdates)) ))) - checkAnswer(statusStore.executionMetrics(executionId), accumulatorUpdates.mapValues(_ * 7)) + checkAnswer(statusStore.executionMetrics(executionId), + accumulatorUpdates.mapValues(_ * 7).toMap) // Finish two tasks listener.onTaskEnd(SparkListenerTaskEnd( @@ -289,7 +301,7 @@ class SQLAppStatusListenerSuite extends SharedSparkSession with JsonTestUtils stageAttemptId = 0, taskType = "", reason = null, - createTaskInfo(0, 0, accums = accumulatorUpdates.mapValues(_ * 3)), + createTaskInfo(0, 0, accums = accumulatorUpdates.mapValues(_ * 3).toMap), new ExecutorMetrics, null)) listener.onTaskEnd(SparkListenerTaskEnd( @@ -297,11 +309,12 @@ class SQLAppStatusListenerSuite extends SharedSparkSession with JsonTestUtils stageAttemptId = 0, taskType = "", reason = null, - createTaskInfo(1, 0, accums = accumulatorUpdates.mapValues(_ * 3)), + createTaskInfo(1, 0, accums = accumulatorUpdates.mapValues(_ * 3).toMap), new ExecutorMetrics, null)) - checkAnswer(statusStore.executionMetrics(executionId), accumulatorUpdates.mapValues(_ * 11)) + checkAnswer(statusStore.executionMetrics(executionId), + accumulatorUpdates.mapValues(_ * 11).toMap) assertJobs(statusStore.execution(executionId), running = Seq(0)) @@ -315,7 +328,8 @@ class SQLAppStatusListenerSuite extends SharedSparkSession with JsonTestUtils assertJobs(statusStore.execution(executionId), completed = Seq(0)) - checkAnswer(statusStore.executionMetrics(executionId), accumulatorUpdates.mapValues(_ * 11)) + checkAnswer(statusStore.executionMetrics(executionId), + accumulatorUpdates.mapValues(_ * 11).toMap) } test("control a plan explain mode in listeners via SQLConf") { @@ -670,6 +684,174 @@ class SQLAppStatusListenerSuite extends SharedSparkSession with JsonTestUtils val sparkPlanInfo = SparkPlanInfo.fromSparkPlan(df.queryExecution.executedPlan) assert(sparkPlanInfo.nodeName === "WholeStageCodegen (2)") } + + test("SPARK-32615,SPARK-33016: SQLMetrics validation after sparkPlanInfo updated in AQE") { + val statusStore = createStatusStore() + val listener = statusStore.listener.get + + val executionId = 0 + val df = createTestDataFrame + + // oldPlan SQLMetrics + // SQLPlanMetric(duration,0,timing) + // SQLPlanMetric(number of output rows,1,sum) + // SQLPlanMetric(number of output rows,2,sum) + val oldPlan = SparkPlanInfo.fromSparkPlan(df.queryExecution.executedPlan) + val oldAccumulatorIds = + SparkPlanGraph(oldPlan) + .allNodes.flatMap(_.metrics.map(_.accumulatorId)) + + listener.onOtherEvent(SparkListenerSQLExecutionStart( + executionId, + "test", + "test", + df.queryExecution.toString, + oldPlan, + System.currentTimeMillis())) + + listener.onJobStart(SparkListenerJobStart( + jobId = 0, + time = System.currentTimeMillis(), + stageInfos = Seq(createStageInfo(0, 0)), + createProperties(executionId))) + + listener.onStageSubmitted(SparkListenerStageSubmitted(createStageInfo(0, 0))) + listener.onTaskStart(SparkListenerTaskStart(0, 0, createTaskInfo(0, 0))) + + assert(statusStore.executionMetrics(executionId).isEmpty) + + // update old metrics with Id 1 & 2, since 0 is timing metrics, + // timing metrics has a complicated string presentation so we don't test it here. + val oldMetricsValueMap = oldAccumulatorIds.sorted.tail.map(id => (id, 100L)).toMap + listener.onExecutorMetricsUpdate(SparkListenerExecutorMetricsUpdate("", Seq( + (0L, 0, 0, createAccumulatorInfos(oldMetricsValueMap)) + ))) + + assert(statusStore.executionMetrics(executionId).size == 2) + statusStore.executionMetrics(executionId).foreach { m => + assert(m._2 == "100") + } + + listener.onTaskEnd(SparkListenerTaskEnd( + stageId = 0, + stageAttemptId = 0, + taskType = "", + reason = null, + createTaskInfo(0, 0), + new ExecutorMetrics, + null)) + + listener.onStageCompleted(SparkListenerStageCompleted(createStageInfo(0, 0))) + + listener.onJobEnd(SparkListenerJobEnd( + jobId = 0, + time = System.currentTimeMillis(), + JobSucceeded + )) + + val df2 = createTestDataFrame.filter("_2 > 2") + // newPlan SQLMetrics + // SQLPlanMetric(duration,3,timing) + // SQLPlanMetric(number of output rows,4,sum) + // SQLPlanMetric(number of output rows,5,sum) + val newPlan = SparkPlanInfo.fromSparkPlan(df2.queryExecution.executedPlan) + val newAccumulatorIds = + SparkPlanGraph(newPlan) + .allNodes.flatMap(_.metrics.map(_.accumulatorId)) + + // Assume that AQE update sparkPlanInfo with newPlan + // ExecutionMetrics will be appended using newPlan's SQLMetrics + listener.onOtherEvent(SparkListenerSQLAdaptiveExecutionUpdate( + executionId, + "test", + newPlan)) + + listener.onJobStart(SparkListenerJobStart( + jobId = 1, + time = System.currentTimeMillis(), + stageInfos = Seq(createStageInfo(1, 0)), + createProperties(executionId))) + + listener.onStageSubmitted(SparkListenerStageSubmitted(createStageInfo(1, 0))) + listener.onTaskStart(SparkListenerTaskStart(1, 0, createTaskInfo(0, 0))) + + // historical metrics will be kept despite of the newPlan updated. + assert(statusStore.executionMetrics(executionId).size == 2) + + // update new metrics with Id 4 & 5, since 3 is timing metrics, + // timing metrics has a complicated string presentation so we don't test it here. + val newMetricsValueMap = newAccumulatorIds.sorted.tail.map(id => (id, 500L)).toMap + listener.onExecutorMetricsUpdate(SparkListenerExecutorMetricsUpdate("", Seq( + (0L, 1, 0, createAccumulatorInfos(newMetricsValueMap)) + ))) + + assert(statusStore.executionMetrics(executionId).size == 4) + statusStore.executionMetrics(executionId).foreach { m => + assert(m._2 == "100" || m._2 == "500") + } + + listener.onTaskEnd(SparkListenerTaskEnd( + stageId = 1, + stageAttemptId = 0, + taskType = "", + reason = null, + createTaskInfo(0, 0), + new ExecutorMetrics, + null)) + + listener.onStageCompleted(SparkListenerStageCompleted(createStageInfo(1, 0))) + + listener.onJobEnd(SparkListenerJobEnd( + jobId = 1, + time = System.currentTimeMillis(), + JobSucceeded + )) + + // aggregateMetrics should contains all metrics from job 0 and job 1 + val aggregateMetrics = listener.liveExecutionMetrics(executionId) + if (aggregateMetrics.isDefined) { + assert(aggregateMetrics.get.keySet.size == 4) + } + + listener.onOtherEvent(SparkListenerSQLExecutionEnd( + executionId, System.currentTimeMillis())) + } + + + test("SPARK-34338: Report metrics from Datasource v2 scan") { + val statusStore = spark.sharedState.statusStore + val oldCount = statusStore.executionsList().size + + val schema = new StructType().add("i", "int").add("j", "int") + val physicalPlan = BatchScanExec(schema.toAttributes, new CustomMetricScanBuilder()) + val dummyQueryExecution = new QueryExecution(spark, LocalRelation()) { + override lazy val sparkPlan = physicalPlan + override lazy val executedPlan = physicalPlan + } + + SQLExecution.withNewExecutionId(dummyQueryExecution) { + physicalPlan.execute().collect() + } + + // Wait until the new execution is started and being tracked. + while (statusStore.executionsCount() < oldCount) { + Thread.sleep(100) + } + + // Wait for listener to finish computing the metrics for the execution. + while (statusStore.executionsList().isEmpty || + statusStore.executionsList().last.metricValues == null) { + Thread.sleep(100) + } + + val execId = statusStore.executionsList().last.executionId + val metrics = statusStore.executionMetrics(execId) + val expectedMetric = physicalPlan.metrics("custom_metric") + val expectedValue = "custom_metric: 12345, 12345" + + assert(metrics.contains(expectedMetric.id)) + assert(metrics(expectedMetric.id) === expectedValue) + } } @@ -744,3 +926,50 @@ class SQLAppStatusListenerMemoryLeakSuite extends SparkFunSuite { } } } + +class SimpleCustomMetric extends CustomMetric { + override def name(): String = "custom_metric" + override def description(): String = "a simple custom metric" + override def aggregateTaskMetrics(taskMetrics: Array[Long]): String = { + s"custom_metric: ${taskMetrics.mkString(", ")}" + } +} + +// The followings are for custom metrics of V2 data source. +object CustomMetricReaderFactory extends PartitionReaderFactory { + override def createReader(partition: InputPartition): PartitionReader[InternalRow] = { + val RangeInputPartition(start, end) = partition + new PartitionReader[InternalRow] { + private var current = start - 1 + + override def next(): Boolean = { + current += 1 + current < end + } + + override def get(): InternalRow = InternalRow(current, -current) + + override def close(): Unit = {} + + override def currentMetricsValues(): Array[CustomTaskMetric] = { + val metric = new CustomTaskMetric { + override def name(): String = "custom_metric" + override def value(): Long = 12345 + } + Array(metric) + } + } + } +} + +class CustomMetricScanBuilder extends SimpleScanBuilder { + override def planInputPartitions(): Array[InputPartition] = { + Array(RangeInputPartition(0, 5), RangeInputPartition(5, 10)) + } + + override def supportedCustomMetrics(): Array[CustomMetric] = { + Array(new SimpleCustomMetric) + } + + override def createReaderFactory(): PartitionReaderFactory = CustomMetricReaderFactory +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SparkPlanInfoSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SparkPlanInfoSuite.scala new file mode 100644 index 0000000000000..dfc64a41d9f86 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SparkPlanInfoSuite.scala @@ -0,0 +1,44 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.ui + +import org.apache.spark.sql.execution.SparkPlanInfo +import org.apache.spark.sql.test.SharedSparkSession + +class SparkPlanInfoSuite extends SharedSparkSession{ + + import testImplicits._ + + def validateSparkPlanInfo(sparkPlanInfo: SparkPlanInfo): Unit = { + sparkPlanInfo.nodeName match { + case "InMemoryTableScan" => assert(sparkPlanInfo.children.length == 1) + case _ => sparkPlanInfo.children.foreach(validateSparkPlanInfo) + } + } + + test("SparkPlanInfo creation from SparkPlan with InMemoryTableScan node") { + val dfWithCache = Seq( + (1, 1), + (2, 2) + ).toDF().filter("_1 > 1").cache().repartition(10) + + val planInfoResult = SparkPlanInfo.fromSparkPlan(dfWithCache.queryExecution.executedPlan) + + validateSparkPlanInfo(planInfoResult) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchBenchmark.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchBenchmark.scala index 953b3a67d976f..f9ae611691a7f 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchBenchmark.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchBenchmark.scala @@ -32,7 +32,9 @@ import org.apache.spark.util.collection.BitSet * Benchmark to low level memory access using different ways to manage buffers. * To run this benchmark: * {{{ - * 1. without sbt: bin/spark-submit --class + * 1. without sbt: + * bin/spark-submit --class + * --jars * 2. build/sbt "sql/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "sql/test:runMain " * Results will be written to "benchmarks/ColumnarBatchBenchmark-results.txt". diff --git a/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchSuite.scala index 37d028d6a713f..bd69bab6f5da2 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/execution/vectorized/ColumnarBatchSuite.scala @@ -32,7 +32,7 @@ import org.apache.spark.memory.MemoryMode import org.apache.spark.sql.{RandomDataGenerator, Row} import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.GenericInternalRow -import org.apache.spark.sql.catalyst.util.{ArrayBasedMapBuilder, DateTimeUtils, GenericArrayData} +import org.apache.spark.sql.catalyst.util.{ArrayBasedMapBuilder, DateTimeUtils, GenericArrayData, MapData} import org.apache.spark.sql.execution.RowToColumnConverter import org.apache.spark.sql.types._ import org.apache.spark.sql.util.ArrowUtils @@ -447,13 +447,6 @@ class ColumnarBatchSuite extends SparkFunSuite { Platform.putFloat(buffer, Platform.BYTE_ARRAY_OFFSET, 2.234f) Platform.putFloat(buffer, Platform.BYTE_ARRAY_OFFSET + 4, 1.123f) - if (ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN)) { - // Ensure array contains Little Endian floats - val bb = ByteBuffer.wrap(buffer).order(ByteOrder.LITTLE_ENDIAN) - Platform.putFloat(buffer, Platform.BYTE_ARRAY_OFFSET, bb.getFloat(0)) - Platform.putFloat(buffer, Platform.BYTE_ARRAY_OFFSET + 4, bb.getFloat(4)) - } - column.putFloats(idx, 1, buffer, 4) column.putFloats(idx + 1, 1, buffer, 0) reference += 1.123f @@ -491,6 +484,57 @@ class ColumnarBatchSuite extends SparkFunSuite { } } + testVector("[SPARK-31703] Float API - Little Endian", 1024, FloatType) { + column => + val seed = System.currentTimeMillis() + val random = new Random(seed) + val reference = mutable.ArrayBuffer.empty[Float] + + var idx = 0 + + val littleEndian = ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN) + littleEndian.putFloat(0, 1.357f) + littleEndian.putFloat(4, 2.468f) + val arr = new Array[Byte](littleEndian.remaining) + littleEndian.get(arr) + + column.putFloatsLittleEndian(idx, 1, arr, 4) + column.putFloatsLittleEndian(idx + 1, 1, arr, 0) + reference += 2.468f + reference += 1.357f + idx += 2 + + column.putFloatsLittleEndian(idx, 2, arr, 0) + reference += 1.357f + reference += 2.468f + idx += 2 + + while (idx < column.capacity) { + val single = random.nextBoolean() + if (single) { + val v = random.nextFloat() + column.putFloat(idx, v) + reference += v + idx += 1 + } else { + val n = math.min(random.nextInt(column.capacity / 20), column.capacity - idx) + val v = random.nextFloat() + column.putFloats(idx, n, v) + var i = 0 + while (i < n) { + reference += v + i += 1 + } + idx += n + } + } + + reference.zipWithIndex.foreach { v => + assert(v._1 == column.getFloat(v._2), + "Seed = " + seed + " VectorType=" + column.getClass.getSimpleName) + } + } + testVector("Double APIs", 1024, DoubleType) { column => val seed = System.currentTimeMillis() @@ -531,13 +575,6 @@ class ColumnarBatchSuite extends SparkFunSuite { Platform.putDouble(buffer, Platform.BYTE_ARRAY_OFFSET, 2.234) Platform.putDouble(buffer, Platform.BYTE_ARRAY_OFFSET + 8, 1.123) - if (ByteOrder.nativeOrder().equals(ByteOrder.BIG_ENDIAN)) { - // Ensure array contains Little Endian doubles - val bb = ByteBuffer.wrap(buffer).order(ByteOrder.LITTLE_ENDIAN) - Platform.putDouble(buffer, Platform.BYTE_ARRAY_OFFSET, bb.getDouble(0)) - Platform.putDouble(buffer, Platform.BYTE_ARRAY_OFFSET + 8, bb.getDouble(8)) - } - column.putDoubles(idx, 1, buffer, 8) column.putDoubles(idx + 1, 1, buffer, 0) reference += 1.123 @@ -575,6 +612,57 @@ class ColumnarBatchSuite extends SparkFunSuite { } } + testVector("[SPARK-31703] Double API - Little Endian", 1024, DoubleType) { + column => + val seed = System.currentTimeMillis() + val random = new Random(seed) + val reference = mutable.ArrayBuffer.empty[Double] + + var idx = 0 + + val littleEndian = ByteBuffer.allocate(16).order(ByteOrder.LITTLE_ENDIAN) + littleEndian.putDouble(0, 1.357) + littleEndian.putDouble(8, 2.468) + val arr = new Array[Byte](littleEndian.remaining) + littleEndian.get(arr) + + column.putDoublesLittleEndian(idx, 1, arr, 8) + column.putDoublesLittleEndian(idx + 1, 1, arr, 0) + reference += 2.468 + reference += 1.357 + idx += 2 + + column.putDoublesLittleEndian(idx, 2, arr, 0) + reference += 1.357 + reference += 2.468 + idx += 2 + + while (idx < column.capacity) { + val single = random.nextBoolean() + if (single) { + val v = random.nextDouble() + column.putDouble(idx, v) + reference += v + idx += 1 + } else { + val n = math.min(random.nextInt(column.capacity / 20), column.capacity - idx) + val v = random.nextDouble() + column.putDoubles(idx, n, v) + var i = 0 + while (i < n) { + reference += v + i += 1 + } + idx += n + } + } + + reference.zipWithIndex.foreach { v => + assert(v._1 == column.getDouble(v._2), + "Seed = " + seed + " VectorType=" + column.getClass.getSimpleName) + } + } + testVector("String APIs", 7, StringType) { column => val reference = mutable.ArrayBuffer.empty[String] @@ -808,6 +896,16 @@ class ColumnarBatchSuite extends SparkFunSuite { assert(a4.asScala == Map()) assert(a5.asScala == Map(3 -> 6, 4 -> 8, 5 -> 10)) + def toScalaMap(mapData: MapData): Map[Int, Int] = { + val keys = mapData.keyArray().toSeq[Int](IntegerType) + val values = mapData.valueArray().toSeq[Int](IntegerType) + (keys zip values).toMap + } + assert(toScalaMap(column.getMap(0).copy()) === Map(0 -> 0)) + assert(toScalaMap(column.getMap(1).copy()) === Map(1 -> 2, 2 -> 4)) + assert(toScalaMap(column.getMap(3).copy()) === Map()) + assert(toScalaMap(column.getMap(4).copy()) === Map(3 -> 6, 4 -> 8, 5 -> 10)) + column.close() } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/expressions/ExpressionInfoSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/expressions/ExpressionInfoSuite.scala index e18514c6f93f9..438fd2351ab9f 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/expressions/ExpressionInfoSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/expressions/ExpressionInfoSuite.scala @@ -20,11 +20,12 @@ package org.apache.spark.sql.expressions import scala.collection.parallel.immutable.ParVector import org.apache.spark.SparkFunSuite -import org.apache.spark.sql.catalyst.FunctionIdentifier -import org.apache.spark.sql.catalyst.expressions.ExpressionInfo +import org.apache.spark.sql.catalyst.{FunctionIdentifier, InternalRow} +import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.execution.HiveResult.hiveResultString import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.util.Utils class ExpressionInfoSuite extends SparkFunSuite with SharedSparkSession { @@ -42,6 +43,10 @@ class ExpressionInfoSuite extends SparkFunSuite with SharedSparkSession { test("group info in ExpressionInfo") { val info = spark.sessionState.catalog.lookupFunctionInfo(FunctionIdentifier("sum")) assert(info.getGroup === "agg_funcs") + Seq("agg_funcs", "array_funcs", "binary_funcs", "bitwise_funcs", "collection_funcs", + "predicate_funcs", "conditional_funcs", "conversion_funcs", "csv_funcs", "datetime_funcs", + "generator_funcs", "hash_funcs", "json_funcs", "lambda_funcs", "map_funcs", "math_funcs", + "misc_funcs", "string_funcs", "struct_funcs", "window_funcs", "xml_funcs") Seq("agg_funcs", "array_funcs", "datetime_funcs", "json_funcs", "map_funcs", "window_funcs") .foreach { groupName => @@ -104,11 +109,38 @@ class ExpressionInfoSuite extends SparkFunSuite with SharedSparkSession { } } + test("SPARK-32870: Default expressions in FunctionRegistry should have their " + + "usage, examples, since, and group filled") { + val ignoreSet = Set( + // Explicitly inherits NonSQLExpression, and has no ExpressionDescription + "org.apache.spark.sql.catalyst.expressions.TimeWindow", + // Cast aliases do not need examples + "org.apache.spark.sql.catalyst.expressions.Cast") + + spark.sessionState.functionRegistry.listFunction().foreach { funcId => + val info = spark.sessionState.catalog.lookupFunctionInfo(funcId) + if (!ignoreSet.contains(info.getClassName)) { + withClue(s"Function '${info.getName}', Expression class '${info.getClassName}'") { + assert(info.getUsage.nonEmpty) + assert(info.getExamples.startsWith("\n Examples:\n")) + assert(info.getExamples.endsWith("\n ")) + assert(info.getSince.matches("[0-9]+\\.[0-9]+\\.[0-9]+")) + assert(info.getGroup.nonEmpty) + + if (info.getArguments.nonEmpty) { + assert(info.getArguments.startsWith("\n Arguments:\n")) + assert(info.getArguments.endsWith("\n ")) + } + } + } + } + } + test("check outputs of expression examples") { def unindentAndTrim(s: String): String = { s.replaceAll("\n\\s+", "\n").trim } - val beginSqlStmtRe = " > ".r + val beginSqlStmtRe = "\n > ".r val endSqlStmtRe = ";\n".r def checkExampleSyntax(example: String): Unit = { val beginStmtNum = beginSqlStmtRe.findAllIn(example).length @@ -122,14 +154,24 @@ class ExpressionInfoSuite extends SparkFunSuite with SharedSparkSession { "org.apache.spark.sql.catalyst.expressions.UnixTimestamp", "org.apache.spark.sql.catalyst.expressions.CurrentDate", "org.apache.spark.sql.catalyst.expressions.CurrentTimestamp", + "org.apache.spark.sql.catalyst.expressions.CurrentTimeZone", "org.apache.spark.sql.catalyst.expressions.Now", // Random output without a seed "org.apache.spark.sql.catalyst.expressions.Rand", "org.apache.spark.sql.catalyst.expressions.Randn", "org.apache.spark.sql.catalyst.expressions.Shuffle", "org.apache.spark.sql.catalyst.expressions.Uuid", + // Other nondeterministic expressions + "org.apache.spark.sql.catalyst.expressions.MonotonicallyIncreasingID", + "org.apache.spark.sql.catalyst.expressions.SparkPartitionID", + "org.apache.spark.sql.catalyst.expressions.InputFileName", + "org.apache.spark.sql.catalyst.expressions.InputFileBlockStart", + "org.apache.spark.sql.catalyst.expressions.InputFileBlockLength", // The example calls methods that return unstable results. - "org.apache.spark.sql.catalyst.expressions.CallMethodViaReflection") + "org.apache.spark.sql.catalyst.expressions.CallMethodViaReflection", + "org.apache.spark.sql.catalyst.expressions.SparkVersion", + // Throws an error + "org.apache.spark.sql.catalyst.expressions.RaiseError") val parFuncs = new ParVector(spark.sessionState.functionRegistry.listFunction().toVector) parFuncs.foreach { funcId => @@ -156,4 +198,45 @@ class ExpressionInfoSuite extends SparkFunSuite with SharedSparkSession { } } } + + test("Check whether SQL expressions should extend NullIntolerant") { + // Only check expressions extended from these expressions because these expressions are + // NullIntolerant by default. + val exprTypesToCheck = Seq(classOf[UnaryExpression], classOf[BinaryExpression], + classOf[TernaryExpression], classOf[QuaternaryExpression], classOf[SeptenaryExpression]) + + // Do not check these expressions, because these expressions override the eval method + val ignoreSet = Set( + // Extend NullIntolerant and avoid evaluating input1 if input2 is 0 + classOf[IntegralDivide], + classOf[Divide], + classOf[Remainder], + classOf[Pmod], + // Throws an exception, even if input is null + classOf[RaiseError] + ) + + val candidateExprsToCheck = spark.sessionState.functionRegistry.listFunction() + .map(spark.sessionState.catalog.lookupFunctionInfo).map(_.getClassName) + .filterNot(c => ignoreSet.exists(_.getName.equals(c))) + .map(name => Utils.classForName(name)) + .filterNot(classOf[NonSQLExpression].isAssignableFrom) + + exprTypesToCheck.foreach { superClass => + candidateExprsToCheck.filter(superClass.isAssignableFrom).foreach { clazz => + val isEvalOverrode = clazz.getMethod("eval", classOf[InternalRow]) != + superClass.getMethod("eval", classOf[InternalRow]) + val isNullIntolerantMixedIn = classOf[NullIntolerant].isAssignableFrom(clazz) + if (isEvalOverrode && isNullIntolerantMixedIn) { + fail(s"${clazz.getName} should not extend ${classOf[NullIntolerant].getSimpleName}, " + + s"or add ${clazz.getName} in the ignoreSet of this test.") + } else if (!isEvalOverrode && !isNullIntolerantMixedIn) { + fail(s"${clazz.getName} should extend ${classOf[NullIntolerant].getSimpleName}.") + } else { + assert((!isEvalOverrode && isNullIntolerantMixedIn) || + (isEvalOverrode && !isNullIntolerantMixedIn)) + } + } + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala index 4630a429830fb..edd96e8337918 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/internal/CatalogSuite.scala @@ -22,8 +22,9 @@ import java.io.File import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.catalog.{Column, Database, Function, Table} import org.apache.spark.sql.catalyst.{FunctionIdentifier, ScalaReflection, TableIdentifier} +import org.apache.spark.sql.catalyst.analysis.AnalysisTest import org.apache.spark.sql.catalyst.catalog._ -import org.apache.spark.sql.catalyst.expressions.{Expression, ExpressionInfo} +import org.apache.spark.sql.catalyst.expressions.Expression import org.apache.spark.sql.catalyst.plans.logical.Range import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types.StructType @@ -33,7 +34,7 @@ import org.apache.spark.storage.StorageLevel /** * Tests for the user-facing [[org.apache.spark.sql.catalog.Catalog]]. */ -class CatalogSuite extends SharedSparkSession { +class CatalogSuite extends SharedSparkSession with AnalysisTest { import testImplicits._ private def sessionCatalog: SessionCatalog = spark.sessionState.catalog @@ -58,7 +59,7 @@ class CatalogSuite extends SharedSparkSession { } private def createTempTable(name: String): Unit = { - sessionCatalog.createTempView(name, Range(1, 2, 3, 4), overrideIfExists = true) + createTempView(sessionCatalog, name, Range(1, 2, 3, 4), overrideIfExists = true) } private def dropTable(name: String, db: Option[String] = None): Unit = { @@ -470,16 +471,20 @@ class CatalogSuite extends SharedSparkSession { } test("createTable with 'path' in options") { + val description = "this is a test table" + withTable("t") { withTempDir { dir => spark.catalog.createTable( tableName = "t", source = "json", schema = new StructType().add("i", "int"), + description = description, options = Map("path" -> dir.getAbsolutePath)) val table = spark.sessionState.catalog.getTableMetadata(TableIdentifier("t")) assert(table.tableType == CatalogTableType.EXTERNAL) assert(table.storage.locationUri.get == makeQualifiedPath(dir.getAbsolutePath)) + assert(table.comment == Some(description)) Seq((1)).toDF("i").write.insertInto("t") assert(dir.exists() && dir.listFiles().nonEmpty) @@ -530,8 +535,8 @@ class CatalogSuite extends SharedSparkSession { dropTable("my_temp_table") // drop table in original session assert(spark.catalog.listTables().collect().map(_.name).toSet == Set()) assert(forkedSession.catalog.listTables().collect().map(_.name).toSet == Set("my_temp_table")) - forkedSession.sessionState.catalog - .createTempView("fork_table", Range(1, 2, 3, 4), overrideIfExists = true) + createTempView( + forkedSession.sessionState.catalog, "fork_table", Range(1, 2, 3, 4), overrideIfExists = true) assert(spark.catalog.listTables().collect().map(_.name).toSet == Set()) } @@ -541,4 +546,11 @@ class CatalogSuite extends SharedSparkSession { assert(spark.table("my_temp_table").storageLevel == StorageLevel.DISK_ONLY) } + test("SPARK-34301: recover partitions of views is not supported") { + createTempTable("my_temp_table") + val errMsg = intercept[AnalysisException] { + spark.catalog.recoverPartitions("my_temp_table") + }.getMessage + assert(errMsg.contains("my_temp_table is a temp view. 'recoverPartitions()' expects a table")) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/internal/ExecutorSideSQLConfSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/internal/ExecutorSideSQLConfSuite.scala index 567524ac75c2e..13b22dba1168b 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/internal/ExecutorSideSQLConfSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/internal/ExecutorSideSQLConfSuite.scala @@ -108,7 +108,7 @@ class ExecutorSideSQLConfSuite extends SparkFunSuite with SQLTestUtils { .queryExecution.executedPlan) assert(res.length == 2) assert(res.forall { case (_, code, _) => - (code.contains("* Codegend pipeline") == flag) && + (code.contains("* Codegened pipeline") == flag) && (code.contains("// input[") == flag) }) } @@ -175,7 +175,7 @@ class ExecutorSideSQLConfSuite extends SparkFunSuite with SQLTestUtils { df.hint("broadcast") } - // set local propert and assert + // set local property and assert val df2 = generateBroadcastDataFrame(confKey, confValue1) spark.sparkContext.setLocalProperty(confKey, confValue1) val checks = df1.join(df2).collect() diff --git a/sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfSuite.scala index f1cd37f91d78a..90127557f09d5 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/internal/SQLConfSuite.scala @@ -17,12 +17,13 @@ package org.apache.spark.sql.internal -import scala.language.reflectiveCalls +import java.util.TimeZone import org.apache.hadoop.fs.Path import org.apache.log4j.Level import org.apache.spark.sql._ +import org.apache.spark.sql.catalyst.parser.ParseException import org.apache.spark.sql.catalyst.util.DateTimeTestUtils.MIT import org.apache.spark.sql.internal.StaticSQLConf._ import org.apache.spark.sql.test.{SharedSparkSession, TestSQLContext} @@ -112,7 +113,22 @@ class SQLConfSuite extends QueryTest with SharedSparkSession { sql(s"set ${SQLConf.Deprecated.MAPRED_REDUCE_TASKS}=10") assert(spark.conf.get(SQLConf.SHUFFLE_PARTITIONS) === 10) } finally { - sql(s"set ${SQLConf.SHUFFLE_PARTITIONS}=$original") + sql(s"set ${SQLConf.SHUFFLE_PARTITIONS.key}=$original") + } + } + + test(s"SPARK-35168: ${SQLConf.Deprecated.MAPRED_REDUCE_TASKS} should respect" + + s" ${SQLConf.SHUFFLE_PARTITIONS.key}") { + spark.sessionState.conf.clear() + try { + sql(s"SET ${SQLConf.ADAPTIVE_EXECUTION_ENABLED.key}=true") + sql(s"SET ${SQLConf.COALESCE_PARTITIONS_ENABLED.key}=true") + sql(s"SET ${SQLConf.COALESCE_PARTITIONS_INITIAL_PARTITION_NUM.key}=1") + sql(s"SET ${SQLConf.SHUFFLE_PARTITIONS.key}=2") + checkAnswer(sql(s"SET ${SQLConf.Deprecated.MAPRED_REDUCE_TASKS}"), + Row(SQLConf.SHUFFLE_PARTITIONS.key, "2")) + } finally { + spark.sessionState.conf.clear() } } @@ -139,11 +155,14 @@ class SQLConfSuite extends QueryTest with SharedSparkSession { sql(s"set ${SQLConf.GROUP_BY_ORDINAL.key}=false") assert(spark.conf.get(SQLConf.GROUP_BY_ORDINAL) === false) assert(sql(s"set").where(s"key = '${SQLConf.GROUP_BY_ORDINAL.key}'").count() == 1) + assert(spark.conf.get(SQLConf.OPTIMIZER_EXCLUDED_RULES).isEmpty) sql(s"reset") assert(spark.conf.get(SQLConf.GROUP_BY_ORDINAL)) assert(sql(s"set").where(s"key = '${SQLConf.GROUP_BY_ORDINAL.key}'").count() == 0) + assert(spark.conf.get(SQLConf.OPTIMIZER_EXCLUDED_RULES) === + Some("org.apache.spark.sql.catalyst.optimizer.ConvertToLocalRelation")) } finally { - sql(s"set ${SQLConf.GROUP_BY_ORDINAL}=$original") + sql(s"set ${SQLConf.GROUP_BY_ORDINAL.key}=$original") } } @@ -159,7 +178,7 @@ class SQLConfSuite extends QueryTest with SharedSparkSession { assert(spark.conf.get(SQLConf.OPTIMIZER_MAX_ITERATIONS) === 100) assert(sql(s"set").where(s"key = '${SQLConf.OPTIMIZER_MAX_ITERATIONS.key}'").count() == 0) } finally { - sql(s"set ${SQLConf.OPTIMIZER_MAX_ITERATIONS}=$original") + sql(s"set ${SQLConf.OPTIMIZER_MAX_ITERATIONS.key}=$original") } } @@ -178,6 +197,45 @@ class SQLConfSuite extends QueryTest with SharedSparkSession { } } + test("SPARK-32406: reset - single configuration") { + spark.sessionState.conf.clear() + // spark core conf w/o entry registered + val appId = spark.sparkContext.getConf.getAppId + sql("RESET spark.app.id") + assert(spark.conf.get("spark.app.id") === appId, "Should not change spark core ones") + // spark core conf w/ entry registered + val e1 = intercept[AnalysisException](sql("RESET spark.executor.cores")) + assert(e1.getMessage === "Cannot modify the value of a Spark config: spark.executor.cores") + + // user defined settings + sql("SET spark.abc=xyz") + assert(spark.conf.get("spark.abc") === "xyz") + sql("RESET spark.abc") + intercept[NoSuchElementException](spark.conf.get("spark.abc")) + sql("RESET spark.abc") // ignore nonexistent keys + + // runtime sql configs + val original = spark.conf.get(SQLConf.GROUP_BY_ORDINAL) + sql(s"SET ${SQLConf.GROUP_BY_ORDINAL.key}=false") + sql(s"RESET ${SQLConf.GROUP_BY_ORDINAL.key}") + assert(spark.conf.get(SQLConf.GROUP_BY_ORDINAL) === original) + + // runtime sql configs with optional defaults + assert(spark.conf.get(SQLConf.OPTIMIZER_EXCLUDED_RULES).isEmpty) + sql(s"RESET ${SQLConf.OPTIMIZER_EXCLUDED_RULES.key}") + assert(spark.conf.get(SQLConf.OPTIMIZER_EXCLUDED_RULES) === + Some("org.apache.spark.sql.catalyst.optimizer.ConvertToLocalRelation")) + sql(s"SET ${SQLConf.PLAN_CHANGE_LOG_RULES.key}=abc") + sql(s"RESET ${SQLConf.PLAN_CHANGE_LOG_RULES.key}") + assert(spark.conf.get(SQLConf.PLAN_CHANGE_LOG_RULES).isEmpty) + + // static sql configs + val e2 = intercept[AnalysisException](sql(s"RESET ${StaticSQLConf.WAREHOUSE_PATH.key}")) + assert(e2.getMessage === + s"Cannot modify the value of a static config: ${StaticSQLConf.WAREHOUSE_PATH.key}") + + } + test("invalid conf value") { spark.sessionState.conf.clear() val e = intercept[IllegalArgumentException] { @@ -239,23 +297,23 @@ class SQLConfSuite extends QueryTest with SharedSparkSession { } test("static SQL conf comes from SparkConf") { - val previousValue = sparkContext.conf.get(SCHEMA_STRING_LENGTH_THRESHOLD) + val previousValue = sparkContext.conf.get(GLOBAL_TEMP_DATABASE) try { - sparkContext.conf.set(SCHEMA_STRING_LENGTH_THRESHOLD, 2000) + sparkContext.conf.set(GLOBAL_TEMP_DATABASE, "a") val newSession = new SparkSession(sparkContext) - assert(newSession.conf.get(SCHEMA_STRING_LENGTH_THRESHOLD) == 2000) + assert(newSession.conf.get(GLOBAL_TEMP_DATABASE) == "a") checkAnswer( - newSession.sql(s"SET ${SCHEMA_STRING_LENGTH_THRESHOLD.key}"), - Row(SCHEMA_STRING_LENGTH_THRESHOLD.key, "2000")) + newSession.sql(s"SET ${GLOBAL_TEMP_DATABASE.key}"), + Row(GLOBAL_TEMP_DATABASE.key, "a")) } finally { - sparkContext.conf.set(SCHEMA_STRING_LENGTH_THRESHOLD, previousValue) + sparkContext.conf.set(GLOBAL_TEMP_DATABASE, previousValue) } } test("cannot set/unset static SQL conf") { - val e1 = intercept[AnalysisException](sql(s"SET ${SCHEMA_STRING_LENGTH_THRESHOLD.key}=10")) + val e1 = intercept[AnalysisException](sql(s"SET ${GLOBAL_TEMP_DATABASE.key}=10")) assert(e1.message.contains("Cannot modify the value of a static config")) - val e2 = intercept[AnalysisException](spark.conf.unset(SCHEMA_STRING_LENGTH_THRESHOLD.key)) + val e2 = intercept[AnalysisException](spark.conf.unset(GLOBAL_TEMP_DATABASE.key)) assert(e2.message.contains("Cannot modify the value of a static config")) } @@ -371,16 +429,50 @@ class SQLConfSuite extends QueryTest with SharedSparkSession { spark.conf.set(SQLConf.SESSION_LOCAL_TIMEZONE.key, "America/Chicago") assert(sql(s"set ${SQLConf.SESSION_LOCAL_TIMEZONE.key}").head().getString(1) === "America/Chicago") + spark.conf.set(SQLConf.SESSION_LOCAL_TIMEZONE.key, "GMT+8:00") + assert(sql(s"set ${SQLConf.SESSION_LOCAL_TIMEZONE.key}").head().getString(1) === "GMT+8:00") intercept[IllegalArgumentException] { spark.conf.set(SQLConf.SESSION_LOCAL_TIMEZONE.key, "pst") } - intercept[IllegalArgumentException] { - spark.conf.set(SQLConf.SESSION_LOCAL_TIMEZONE.key, "GMT+8:00") - } val e = intercept[IllegalArgumentException] { spark.conf.set(SQLConf.SESSION_LOCAL_TIMEZONE.key, "Asia/shanghai") } assert(e.getMessage === "Cannot resolve the given timezone with ZoneId.of(_, ZoneId.SHORT_IDS)") } + + test("set time zone") { + TimeZone.getAvailableIDs().foreach { zid => + sql(s"set time zone '$zid'") + assert(spark.conf.get(SQLConf.SESSION_LOCAL_TIMEZONE) === zid) + } + sql("set time zone local") + assert(spark.conf.get(SQLConf.SESSION_LOCAL_TIMEZONE) === TimeZone.getDefault.getID) + + val e1 = intercept[IllegalArgumentException](sql("set time zone 'invalid'")) + assert(e1.getMessage === "Cannot resolve the given timezone with" + + " ZoneId.of(_, ZoneId.SHORT_IDS)") + + (-18 to 18).map(v => (v, s"interval '$v' hours")).foreach { case (i, interval) => + sql(s"set time zone $interval") + val zone = spark.conf.get(SQLConf.SESSION_LOCAL_TIMEZONE) + if (i == 0) { + assert(zone === "Z") + } else { + assert(zone === String.format("%+03d:00", new Integer(i))) + } + } + val e2 = intercept[ParseException](sql("set time zone interval 19 hours")) + assert(e2.getMessage contains "The interval value must be in the range of [-18, +18] hours") + } + + test("SPARK-34454: configs from the legacy namespace should be internal") { + val nonInternalLegacyConfigs = spark.sessionState.conf.getAllDefinedConfs + .filter { case (key, _, _, _) => key.contains("spark.sql.legacy.") } + assert(nonInternalLegacyConfigs.isEmpty, + s""" + |Non internal legacy SQL configs: + |${nonInternalLegacyConfigs.map(_._1).mkString("\n")} + |""".stripMargin) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/internal/VariableSubstitutionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/internal/VariableSubstitutionSuite.scala index d5a946aeaac31..d5da2553c7186 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/internal/VariableSubstitutionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/internal/VariableSubstitutionSuite.scala @@ -18,12 +18,11 @@ package org.apache.spark.sql.internal import org.apache.spark.SparkFunSuite -import org.apache.spark.sql.AnalysisException +import org.apache.spark.sql.catalyst.plans.SQLHelper -class VariableSubstitutionSuite extends SparkFunSuite { +class VariableSubstitutionSuite extends SparkFunSuite with SQLHelper { - private lazy val conf = new SQLConf - private lazy val sub = new VariableSubstitution(conf) + private lazy val sub = new VariableSubstitution() test("system property") { System.setProperty("varSubSuite.var", "abcd") @@ -35,26 +34,26 @@ class VariableSubstitutionSuite extends SparkFunSuite { } test("Spark configuration variable") { - conf.setConfString("some-random-string-abcd", "1234abcd") - assert(sub.substitute("${hiveconf:some-random-string-abcd}") == "1234abcd") - assert(sub.substitute("${sparkconf:some-random-string-abcd}") == "1234abcd") - assert(sub.substitute("${spark:some-random-string-abcd}") == "1234abcd") - assert(sub.substitute("${some-random-string-abcd}") == "1234abcd") + withSQLConf("some-random-string-abcd" -> "1234abcd") { + assert(sub.substitute("${hiveconf:some-random-string-abcd}") == "1234abcd") + assert(sub.substitute("${sparkconf:some-random-string-abcd}") == "1234abcd") + assert(sub.substitute("${spark:some-random-string-abcd}") == "1234abcd") + assert(sub.substitute("${some-random-string-abcd}") == "1234abcd") + } } test("multiple substitutes") { val q = "select ${bar} ${foo} ${doo} this is great" - conf.setConfString("bar", "1") - conf.setConfString("foo", "2") - conf.setConfString("doo", "3") - assert(sub.substitute(q) == "select 1 2 3 this is great") + withSQLConf("bar"-> "1", "foo"-> "2", "doo" -> "3") { + assert(sub.substitute(q) == "select 1 2 3 this is great") + } } test("test nested substitutes") { val q = "select ${bar} ${foo} this is great" - conf.setConfString("bar", "1") - conf.setConfString("foo", "${bar}") - assert(sub.substitute(q) == "select 1 1 this is great") + withSQLConf("bar"-> "1", "foo"-> "${bar}") { + assert(sub.substitute(q) == "select 1 1 this is great") + } } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCNestedDataSourceSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCNestedDataSourceSuite.scala new file mode 100644 index 0000000000000..46bdb1918147c --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCNestedDataSourceSuite.scala @@ -0,0 +1,51 @@ +/* + * 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. + */ + +package org.apache.spark.sql.jdbc + +import org.apache.spark.sql.NestedDataSourceSuiteBase +import org.apache.spark.sql.types.StructType +import org.apache.spark.util.Utils + +class JDBCNestedDataSourceSuite extends NestedDataSourceSuiteBase { + override val nestedDataSources: Seq[String] = Seq("jdbc") + private val tempDir = Utils.createTempDir() + private val url = s"jdbc:h2:${tempDir.getCanonicalPath};user=testUser;password=testPass" + override val colType: String = "in the customSchema option value" + + override def afterAll(): Unit = { + Utils.deleteRecursively(tempDir) + super.afterAll() + } + + override def readOptions(schema: StructType): Map[String, String] = { + Map("url" -> url, "dbtable" -> "t1", "customSchema" -> schema.toDDL) + } + + override def save(selectExpr: Seq[String], format: String, path: String): Unit = { + // We ignore `selectExpr` because: + // 1. H2 doesn't support nested columns + // 2. JDBC datasource checks duplicates before comparing of user's schema with + // actual schema of `t1`. + spark + .range(1L) + .write.mode("overwrite") + .options(Map("url" -> url, "dbtable" -> "t1")) + .format(format) + .save() + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala index 7c723f083642d..5865ff245aa39 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCSuite.scala @@ -19,15 +19,21 @@ package org.apache.spark.sql.jdbc import java.math.BigDecimal import java.sql.{Date, DriverManager, SQLException, Timestamp} -import java.util.{Calendar, GregorianCalendar, Properties} +import java.time.{Instant, LocalDate} +import java.util.{Calendar, GregorianCalendar, Properties, TimeZone} + +import scala.collection.JavaConverters._ import org.h2.jdbc.JdbcSQLException +import org.mockito.ArgumentMatchers._ +import org.mockito.Mockito._ import org.scalatest.{BeforeAndAfter, PrivateMethodTester} import org.apache.spark.SparkException import org.apache.spark.sql.{AnalysisException, DataFrame, QueryTest, Row} -import org.apache.spark.sql.catalyst.TableIdentifier +import org.apache.spark.sql.catalyst.{analysis, TableIdentifier} import org.apache.spark.sql.catalyst.parser.CatalystSqlParser +import org.apache.spark.sql.catalyst.plans.logical.ShowCreateTable import org.apache.spark.sql.catalyst.util.{CaseInsensitiveMap, DateTimeTestUtils} import org.apache.spark.sql.execution.{DataSourceScanExec, ExtendedMode} import org.apache.spark.sql.execution.command.{ExplainCommand, ShowCreateTableCommand} @@ -71,7 +77,10 @@ class JDBCSuite extends QueryTest } } - before { + val defaultMetadata = new MetadataBuilder().putLong("scale", 0).build() + + override def beforeAll(): Unit = { + super.beforeAll() Utils.classForName("org.h2.Driver") // Extra properties that will be specified for our database. We need these to test // usage of parameters from OPTIONS clause in queries. @@ -273,8 +282,9 @@ class JDBCSuite extends QueryTest // Untested: IDENTITY, OTHER, UUID, ARRAY, and GEOMETRY types. } - after { + override def afterAll(): Unit = { conn.close() + super.afterAll() } // Check whether the tables are fetched in the expected degree of parallelism @@ -423,6 +433,36 @@ class JDBCSuite extends QueryTest assert(ids(2) === 3) } + test("SPARK-34843: columnPartition should generate the correct stride size" + + " and also realign the first partition for better distribution") { + val schema = StructType(Seq( + StructField("PartitionColumn", DateType) + )) + + val numPartitions = 1000 + val partitionConfig = Map( + "lowerBound" -> "1930-01-01", + "upperBound" -> "2020-12-31", + "numPartitions" -> numPartitions.toString, + "partitionColumn" -> "PartitionColumn" + ) + + val partitions = JDBCRelation.columnPartition( + schema, + analysis.caseInsensitiveResolution, + TimeZone.getDefault.toZoneId.toString, + new JDBCOptions(url, "table", partitionConfig) + ) + + val firstPredicate = partitions.head.asInstanceOf[JDBCPartition].whereClause + val lastPredicate = partitions(numPartitions - 1).asInstanceOf[JDBCPartition].whereClause + + // 152 days (exclusive) to lower bound + assert(firstPredicate == """"PartitionColumn" < '1930-06-02' or "PartitionColumn" is null""") + // 152 days (inclusive) to upper bound + assert(lastPredicate == """"PartitionColumn" >= '2020-08-02'""") + } + test("overflow of partition bound difference does not give negative stride") { val df = sql("SELECT * FROM partsoverflow") checkNumPartitions(df, expectedNumPartitions = 3) @@ -621,9 +661,21 @@ class JDBCSuite extends QueryTest assert(cal.get(Calendar.HOUR) === 11) assert(cal.get(Calendar.MINUTE) === 22) assert(cal.get(Calendar.SECOND) === 33) + assert(cal.get(Calendar.MILLISECOND) === 543) assert(rows(0).getAs[java.sql.Timestamp](2).getNanos === 543543000) } + test("SPARK-34357: test TIME types") { + val rows = spark.read.jdbc( + urlWithUserAndPass, "TEST.TIMETYPES", new Properties()).collect() + val cachedRows = spark.read.jdbc(urlWithUserAndPass, "TEST.TIMETYPES", new Properties()) + .cache().collect() + val expectedTimeAtEpoch = java.sql.Timestamp.valueOf("1970-01-01 12:34:56.0") + assert(rows(0).getAs[java.sql.Timestamp](0) === expectedTimeAtEpoch) + assert(rows(1).getAs[java.sql.Timestamp](0) === expectedTimeAtEpoch) + assert(cachedRows(0).getAs[java.sql.Timestamp](0) === expectedTimeAtEpoch) + } + test("test DATE types") { val rows = spark.read.jdbc( urlWithUserAndPass, "TEST.TIMETYPES", new Properties()).collect() @@ -694,7 +746,7 @@ class JDBCSuite extends QueryTest test("Remap types via JdbcDialects") { JdbcDialects.registerDialect(testH2Dialect) val df = spark.read.jdbc(urlWithUserAndPass, "TEST.PEOPLE", new Properties()) - assert(df.schema.filter(_.dataType != org.apache.spark.sql.types.StringType).isEmpty) + assert(!df.schema.exists(_.dataType != org.apache.spark.sql.types.StringType)) val rows = df.collect() assert(rows(0).get(0).isInstanceOf[String]) assert(rows(0).get(1).isInstanceOf[String]) @@ -766,9 +818,14 @@ class JDBCSuite extends QueryTest } test("Dialect unregister") { - JdbcDialects.registerDialect(testH2Dialect) - JdbcDialects.unregisterDialect(testH2Dialect) - assert(JdbcDialects.get(urlWithUserAndPass) == NoopDialect) + JdbcDialects.unregisterDialect(H2Dialect) + try { + JdbcDialects.registerDialect(testH2Dialect) + JdbcDialects.unregisterDialect(testH2Dialect) + assert(JdbcDialects.get(urlWithUserAndPass) == NoopDialect) + } finally { + JdbcDialects.registerDialect(H2Dialect) + } } test("Aggregated dialects") { @@ -849,6 +906,8 @@ class JDBCSuite extends QueryTest assert(Postgres.getCatalystType(java.sql.Types.OTHER, "jsonb", 1, null) === Some(StringType)) assert(Postgres.getCatalystType(java.sql.Types.ARRAY, "_numeric", 0, md) == Some(ArrayType(DecimalType.SYSTEM_DEFAULT))) + assert(Postgres.getCatalystType(java.sql.Types.ARRAY, "_bpchar", 64, md) == + Some(ArrayType(StringType))) assert(Postgres.getJDBCType(FloatType).map(_.databaseTypeDefinition).get == "FLOAT4") assert(Postgres.getJDBCType(DoubleType).map(_.databaseTypeDefinition).get == "FLOAT8") assert(Postgres.getJDBCType(ByteType).map(_.databaseTypeDefinition).get == "SMALLINT") @@ -994,6 +1053,19 @@ class JDBCSuite extends QueryTest === java.sql.Timestamp.valueOf("2002-02-20 11:22:33.543543")) } + test("SPARK-33867: Test DataFrame.where for LocalDate and Instant") { + // Test for SPARK-33867 + val timestamp = Instant.parse("2001-02-20T11:22:33.543543Z") + val date = LocalDate.parse("1995-01-01") + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { + val jdbcDf = spark.read.jdbc(urlWithUserAndPass, "TEST.TIMETYPES", new Properties()) + val rows = jdbcDf.where($"B" > date && $"C" > timestamp).collect() + assert(rows(0).getAs[LocalDate](1) === LocalDate.parse("1996-01-01")) + // 8 hour difference since saved time was America/Los_Angeles and Instant is GMT + assert(rows(0).getAs[Instant](2) === Instant.parse("2002-02-20T19:22:33.543543Z")) + } + } + test("test credentials in the properties are not in plan output") { val df = sql("SELECT * FROM parts") val explain = ExplainCommand(df.queryExecution.logical, ExtendedMode) @@ -1060,7 +1132,7 @@ class JDBCSuite extends QueryTest | password '$password') """.stripMargin) - val show = ShowCreateTableCommand(TableIdentifier(tableName)) + val show = ShowCreateTableCommand(TableIdentifier(tableName), ShowCreateTable.getoutputAttrs) spark.sessionState.executePlan(show).executedPlan.executeCollect().foreach { r => assert(!r.toString.contains(password)) assert(r.toString.contains(dbTable)) @@ -1180,7 +1252,10 @@ class JDBCSuite extends QueryTest test("SPARK-16387: Reserved SQL words are not escaped by JDBC writer") { val df = spark.createDataset(Seq("a", "b", "c")).toDF("order") - val schema = JdbcUtils.schemaString(df, "jdbc:mysql://localhost:3306/temp") + val schema = JdbcUtils.schemaString( + df.schema, + df.sqlContext.conf.caseSensitiveAnalysis, + "jdbc:mysql://localhost:3306/temp") assert(schema.contains("`order` TEXT")) } @@ -1214,8 +1289,8 @@ class JDBCSuite extends QueryTest } test("SPARK-16848: jdbc API throws an exception for user specified schema") { - val schema = StructType(Seq( - StructField("name", StringType, false), StructField("theid", IntegerType, false))) + val schema = StructType(Seq(StructField("name", StringType, false, defaultMetadata), + StructField("theid", IntegerType, false, defaultMetadata))) val parts = Array[String]("THEID < 2", "THEID >= 2") val e1 = intercept[AnalysisException] { spark.read.schema(schema).jdbc(urlWithUserAndPass, "TEST.PEOPLE", parts, new Properties()) @@ -1235,7 +1310,9 @@ class JDBCSuite extends QueryTest props.put("customSchema", customSchema) val df = spark.read.jdbc(urlWithUserAndPass, "TEST.PEOPLE", parts, props) assert(df.schema.size === 2) - assert(df.schema === CatalystSqlParser.parseTableSchema(customSchema)) + val expectedSchema = new StructType(CatalystSqlParser.parseTableSchema(customSchema).map( + f => StructField(f.name, f.dataType, f.nullable, defaultMetadata)).toArray) + assert(df.schema === expectedSchema) assert(df.count() === 3) } @@ -1251,7 +1328,9 @@ class JDBCSuite extends QueryTest """.stripMargin.replaceAll("\n", " ")) val df = sql("select * from people_view") assert(df.schema.length === 2) - assert(df.schema === CatalystSqlParser.parseTableSchema(customSchema)) + val expectedSchema = new StructType(CatalystSqlParser.parseTableSchema(customSchema) + .map(f => StructField(f.name, f.dataType, f.nullable, defaultMetadata)).toArray) + assert(df.schema === expectedSchema) assert(df.count() === 3) } } @@ -1302,7 +1381,8 @@ class JDBCSuite extends QueryTest testJdbcOptions(new JDBCOptions(parameters)) testJdbcOptions(new JDBCOptions(CaseInsensitiveMap(parameters))) // test add/remove key-value from the case-insensitive map - var modifiedParameters = CaseInsensitiveMap(Map.empty) ++ parameters + var modifiedParameters = + (CaseInsensitiveMap(Map.empty) ++ parameters).asInstanceOf[Map[String, String]] testJdbcOptions(new JDBCOptions(modifiedParameters)) modifiedParameters -= "dbtable" assert(modifiedParameters.get("dbTAblE").isEmpty) @@ -1365,8 +1445,8 @@ class JDBCSuite extends QueryTest } test("jdbc data source shouldn't have unnecessary metadata in its schema") { - val schema = StructType(Seq( - StructField("NAME", StringType, true), StructField("THEID", IntegerType, true))) + val schema = StructType(Seq(StructField("NAME", StringType, true, defaultMetadata), + StructField("THEID", IntegerType, true, defaultMetadata))) val df = spark.read.format("jdbc") .option("Url", urlWithUserAndPass) @@ -1403,7 +1483,7 @@ class JDBCSuite extends QueryTest } test("SPARK-24327 verify and normalize a partition column based on a JDBC resolved schema") { - def testJdbcParitionColumn(partColName: String, expectedColumnName: String): Unit = { + def testJdbcPartitionColumn(partColName: String, expectedColumnName: String): Unit = { val df = spark.read.format("jdbc") .option("url", urlWithUserAndPass) .option("dbtable", "TEST.PARTITION") @@ -1424,16 +1504,16 @@ class JDBCSuite extends QueryTest } } - testJdbcParitionColumn("THEID", "THEID") - testJdbcParitionColumn("\"THEID\"", "THEID") + testJdbcPartitionColumn("THEID", "THEID") + testJdbcPartitionColumn("\"THEID\"", "THEID") withSQLConf(SQLConf.CASE_SENSITIVE.key -> "false") { - testJdbcParitionColumn("ThEiD", "THEID") + testJdbcPartitionColumn("ThEiD", "THEID") } - testJdbcParitionColumn("THE ID", "THE ID") + testJdbcPartitionColumn("THE ID", "THE ID") def testIncorrectJdbcPartitionColumn(partColName: String): Unit = { val errMsg = intercept[AnalysisException] { - testJdbcParitionColumn(partColName, "THEID") + testJdbcPartitionColumn(partColName, "THEID") }.getMessage assert(errMsg.contains(s"User-defined partition column $partColName not found " + "in the JDBC relation:")) @@ -1560,9 +1640,9 @@ class JDBCSuite extends QueryTest case LogicalRelation(JDBCRelation(_, parts, _), _, _, _) => val whereClauses = parts.map(_.asInstanceOf[JDBCPartition].whereClause).toSet assert(whereClauses === Set( - """"D" < '2018-07-10' or "D" is null""", - """"D" >= '2018-07-10' AND "D" < '2018-07-14'""", - """"D" >= '2018-07-14'""")) + """"D" < '2018-07-11' or "D" is null""", + """"D" >= '2018-07-11' AND "D" < '2018-07-15'""", + """"D" >= '2018-07-15'""")) } checkAnswer(df1, expectedResult) @@ -1715,4 +1795,47 @@ class JDBCSuite extends QueryTest jdbcDF = sqlContext.jdbc(urlWithUserAndPass, "TEST.PEOPLE", parts) checkAnswer(jdbcDF, Row("mary", 2) :: Nil) } + + test("SPARK-32364: JDBCOption constructor") { + val extraOptions = CaseInsensitiveMap[String](Map("UrL" -> "url1", "dBTable" -> "table1")) + val connectionProperties = new Properties() + connectionProperties.put("url", "url2") + connectionProperties.put("dbtable", "table2") + + // connection property should override the options in extraOptions + val params = extraOptions ++ connectionProperties.asScala + assert(params.size == 2) + assert(params.get("uRl").contains("url2")) + assert(params.get("DbtaBle").contains("table2")) + + // JDBCOptions constructor parameter should overwrite the existing conf + val options = new JDBCOptions(url, "table3", params) + assert(options.asProperties.size == 2) + assert(options.asProperties.get("url") == url) + assert(options.asProperties.get("dbtable") == "table3") + } + + test("SPARK-34379: Map JDBC RowID to StringType rather than LongType") { + val mockRsmd = mock(classOf[java.sql.ResultSetMetaData]) + when(mockRsmd.getColumnCount).thenReturn(1) + when(mockRsmd.getColumnLabel(anyInt())).thenReturn("rowid") + when(mockRsmd.getColumnType(anyInt())).thenReturn(java.sql.Types.ROWID) + when(mockRsmd.getColumnTypeName(anyInt())).thenReturn("rowid") + when(mockRsmd.getPrecision(anyInt())).thenReturn(0) + when(mockRsmd.getScale(anyInt())).thenReturn(0) + when(mockRsmd.isSigned(anyInt())).thenReturn(false) + when(mockRsmd.isNullable(anyInt())).thenReturn(java.sql.ResultSetMetaData.columnNoNulls) + + val mockRs = mock(classOf[java.sql.ResultSet]) + when(mockRs.getMetaData).thenReturn(mockRsmd) + + val mockDialect = mock(classOf[JdbcDialect]) + when(mockDialect.getCatalystType(anyInt(), anyString(), anyInt(), any[MetadataBuilder])) + .thenReturn(None) + + val schema = JdbcUtils.getSchema(mockRs, mockDialect) + val fields = schema.fields + assert(fields.length === 1) + assert(fields(0).dataType === StringType) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala new file mode 100644 index 0000000000000..a3a3f47280952 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCV2Suite.scala @@ -0,0 +1,217 @@ +/* + * 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. + */ + +package org.apache.spark.sql.jdbc + +import java.sql.{Connection, DriverManager} +import java.util.Properties + +import org.apache.spark.SparkConf +import org.apache.spark.sql.{QueryTest, Row} +import org.apache.spark.sql.catalyst.analysis.CannotReplaceMissingTableException +import org.apache.spark.sql.catalyst.plans.logical.Filter +import org.apache.spark.sql.execution.datasources.v2.DataSourceV2ScanRelation +import org.apache.spark.sql.execution.datasources.v2.jdbc.JDBCTableCatalog +import org.apache.spark.sql.functions.lit +import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.util.Utils + +class JDBCV2Suite extends QueryTest with SharedSparkSession { + import testImplicits._ + + val tempDir = Utils.createTempDir() + val url = s"jdbc:h2:${tempDir.getCanonicalPath};user=testUser;password=testPass" + var conn: java.sql.Connection = null + + override def sparkConf: SparkConf = super.sparkConf + .set("spark.sql.catalog.h2", classOf[JDBCTableCatalog].getName) + .set("spark.sql.catalog.h2.url", url) + .set("spark.sql.catalog.h2.driver", "org.h2.Driver") + + private def withConnection[T](f: Connection => T): T = { + val conn = DriverManager.getConnection(url, new Properties()) + try { + f(conn) + } finally { + conn.close() + } + } + + override def beforeAll(): Unit = { + super.beforeAll() + Utils.classForName("org.h2.Driver") + withConnection { conn => + conn.prepareStatement("CREATE SCHEMA \"test\"").executeUpdate() + conn.prepareStatement( + "CREATE TABLE \"test\".\"empty_table\" (name TEXT(32) NOT NULL, id INTEGER NOT NULL)") + .executeUpdate() + conn.prepareStatement( + "CREATE TABLE \"test\".\"people\" (name TEXT(32) NOT NULL, id INTEGER NOT NULL)") + .executeUpdate() + conn.prepareStatement("INSERT INTO \"test\".\"people\" VALUES ('fred', 1)").executeUpdate() + conn.prepareStatement("INSERT INTO \"test\".\"people\" VALUES ('mary', 2)").executeUpdate() + } + } + + override def afterAll(): Unit = { + Utils.deleteRecursively(tempDir) + super.afterAll() + } + + test("simple scan") { + checkAnswer(sql("SELECT * FROM h2.test.empty_table"), Seq()) + checkAnswer(sql("SELECT * FROM h2.test.people"), Seq(Row("fred", 1), Row("mary", 2))) + checkAnswer(sql("SELECT name, id FROM h2.test.people"), Seq(Row("fred", 1), Row("mary", 2))) + } + + test("scan with filter push-down") { + val df = spark.table("h2.test.people").filter($"id" > 1) + val filters = df.queryExecution.optimizedPlan.collect { + case f: Filter => f + } + assert(filters.isEmpty) + checkAnswer(df, Row("mary", 2)) + } + + test("scan with column pruning") { + val df = spark.table("h2.test.people").select("id") + val scan = df.queryExecution.optimizedPlan.collectFirst { + case s: DataSourceV2ScanRelation => s + }.get + assert(scan.schema.names.sameElements(Seq("ID"))) + checkAnswer(df, Seq(Row(1), Row(2))) + } + + test("scan with filter push-down and column pruning") { + val df = spark.table("h2.test.people").filter($"id" > 1).select("name") + val filters = df.queryExecution.optimizedPlan.collect { + case f: Filter => f + } + assert(filters.isEmpty) + val scan = df.queryExecution.optimizedPlan.collectFirst { + case s: DataSourceV2ScanRelation => s + }.get + assert(scan.schema.names.sameElements(Seq("NAME"))) + checkAnswer(df, Row("mary")) + } + + test("read/write with partition info") { + withTable("h2.test.abc") { + sql("CREATE TABLE h2.test.abc AS SELECT * FROM h2.test.people") + val df1 = Seq(("evan", 3), ("cathy", 4), ("alex", 5)).toDF("NAME", "ID") + val e = intercept[IllegalArgumentException] { + df1.write + .option("partitionColumn", "id") + .option("lowerBound", "0") + .option("upperBound", "3") + .option("numPartitions", "0") + .insertInto("h2.test.abc") + }.getMessage + assert(e.contains("Invalid value `0` for parameter `numPartitions` in table writing " + + "via JDBC. The minimum value is 1.")) + + df1.write + .option("partitionColumn", "id") + .option("lowerBound", "0") + .option("upperBound", "3") + .option("numPartitions", "3") + .insertInto("h2.test.abc") + + val df2 = spark.read + .option("partitionColumn", "id") + .option("lowerBound", "0") + .option("upperBound", "3") + .option("numPartitions", "2") + .table("h2.test.abc") + + assert(df2.rdd.getNumPartitions === 2) + assert(df2.count() === 5) + } + } + + test("show tables") { + checkAnswer(sql("SHOW TABLES IN h2.test"), + Seq(Row("test", "people", false), Row("test", "empty_table", false))) + } + + test("SQL API: create table as select") { + withTable("h2.test.abc") { + sql("CREATE TABLE h2.test.abc AS SELECT * FROM h2.test.people") + checkAnswer(sql("SELECT name, id FROM h2.test.abc"), Seq(Row("fred", 1), Row("mary", 2))) + } + } + + test("DataFrameWriterV2: create table as select") { + withTable("h2.test.abc") { + spark.table("h2.test.people").writeTo("h2.test.abc").create() + checkAnswer(sql("SELECT name, id FROM h2.test.abc"), Seq(Row("fred", 1), Row("mary", 2))) + } + } + + test("SQL API: replace table as select") { + withTable("h2.test.abc") { + intercept[CannotReplaceMissingTableException] { + sql("REPLACE TABLE h2.test.abc AS SELECT 1 as col") + } + sql("CREATE OR REPLACE TABLE h2.test.abc AS SELECT 1 as col") + checkAnswer(sql("SELECT col FROM h2.test.abc"), Row(1)) + sql("REPLACE TABLE h2.test.abc AS SELECT * FROM h2.test.people") + checkAnswer(sql("SELECT name, id FROM h2.test.abc"), Seq(Row("fred", 1), Row("mary", 2))) + } + } + + test("DataFrameWriterV2: replace table as select") { + withTable("h2.test.abc") { + intercept[CannotReplaceMissingTableException] { + sql("SELECT 1 AS col").writeTo("h2.test.abc").replace() + } + sql("SELECT 1 AS col").writeTo("h2.test.abc").createOrReplace() + checkAnswer(sql("SELECT col FROM h2.test.abc"), Row(1)) + spark.table("h2.test.people").writeTo("h2.test.abc").replace() + checkAnswer(sql("SELECT name, id FROM h2.test.abc"), Seq(Row("fred", 1), Row("mary", 2))) + } + } + + test("SQL API: insert and overwrite") { + withTable("h2.test.abc") { + sql("CREATE TABLE h2.test.abc AS SELECT * FROM h2.test.people") + + sql("INSERT INTO h2.test.abc SELECT 'lucy', 3") + checkAnswer( + sql("SELECT name, id FROM h2.test.abc"), + Seq(Row("fred", 1), Row("mary", 2), Row("lucy", 3))) + + sql("INSERT OVERWRITE h2.test.abc SELECT 'bob', 4") + checkAnswer(sql("SELECT name, id FROM h2.test.abc"), Row("bob", 4)) + } + } + + test("DataFrameWriterV2: insert and overwrite") { + withTable("h2.test.abc") { + sql("CREATE TABLE h2.test.abc AS SELECT * FROM h2.test.people") + + // `DataFrameWriterV2` is by-name. + sql("SELECT 3 AS ID, 'lucy' AS NAME").writeTo("h2.test.abc").append() + checkAnswer( + sql("SELECT name, id FROM h2.test.abc"), + Seq(Row("fred", 1), Row("mary", 2), Row("lucy", 3))) + + sql("SELECT 'bob' AS NAME, 4 AS ID").writeTo("h2.test.abc").overwrite(lit(true)) + checkAnswer(sql("SELECT name, id FROM h2.test.abc"), Row("bob", 4)) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCWriteSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCWriteSuite.scala index 8021ef1a17a18..efa2773bfd692 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCWriteSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/jdbc/JDBCWriteSuite.scala @@ -17,7 +17,8 @@ package org.apache.spark.sql.jdbc -import java.sql.DriverManager +import java.sql.{Date, DriverManager, Timestamp} +import java.time.{Instant, LocalDate} import java.util.Properties import scala.collection.JavaConverters.propertiesAsScalaMapConverter @@ -81,6 +82,9 @@ class JDBCWriteSuite extends SharedSparkSession with BeforeAndAfter { |USING org.apache.spark.sql.jdbc |OPTIONS (url '$url1', dbtable 'TEST.PEOPLE1', user 'testUser', password 'testPass') """.stripMargin.replaceAll("\n", " ")) + + conn1.prepareStatement("create table test.timetypes (d DATE, t TIMESTAMP)").executeUpdate() + conn.commit() } after { @@ -194,24 +198,29 @@ class JDBCWriteSuite extends SharedSparkSession with BeforeAndAfter { } test("Truncate") { - JdbcDialects.registerDialect(testH2Dialect) - val df = spark.createDataFrame(sparkContext.parallelize(arr2x2), schema2) - val df2 = spark.createDataFrame(sparkContext.parallelize(arr1x2), schema2) - val df3 = spark.createDataFrame(sparkContext.parallelize(arr2x3), schema3) - - df.write.jdbc(url1, "TEST.TRUNCATETEST", properties) - df2.write.mode(SaveMode.Overwrite).option("truncate", true) - .jdbc(url1, "TEST.TRUNCATETEST", properties) - assert(1 === spark.read.jdbc(url1, "TEST.TRUNCATETEST", properties).count()) - assert(2 === spark.read.jdbc(url1, "TEST.TRUNCATETEST", properties).collect()(0).length) + JdbcDialects.unregisterDialect(H2Dialect) + try { + JdbcDialects.registerDialect(testH2Dialect) + val df = spark.createDataFrame(sparkContext.parallelize(arr2x2), schema2) + val df2 = spark.createDataFrame(sparkContext.parallelize(arr1x2), schema2) + val df3 = spark.createDataFrame(sparkContext.parallelize(arr2x3), schema3) - val m = intercept[AnalysisException] { - df3.write.mode(SaveMode.Overwrite).option("truncate", true) + df.write.jdbc(url1, "TEST.TRUNCATETEST", properties) + df2.write.mode(SaveMode.Overwrite).option("truncate", true) .jdbc(url1, "TEST.TRUNCATETEST", properties) - }.getMessage - assert(m.contains("Column \"seq\" not found")) - assert(0 === spark.read.jdbc(url1, "TEST.TRUNCATETEST", properties).count()) - JdbcDialects.unregisterDialect(testH2Dialect) + assert(1 === spark.read.jdbc(url1, "TEST.TRUNCATETEST", properties).count()) + assert(2 === spark.read.jdbc(url1, "TEST.TRUNCATETEST", properties).collect()(0).length) + + val m = intercept[AnalysisException] { + df3.write.mode(SaveMode.Overwrite).option("truncate", true) + .jdbc(url1, "TEST.TRUNCATETEST", properties) + }.getMessage + assert(m.contains("Column \"seq\" not found")) + assert(0 === spark.read.jdbc(url1, "TEST.TRUNCATETEST", properties).count()) + } finally { + JdbcDialects.unregisterDialect(testH2Dialect) + JdbcDialects.registerDialect(H2Dialect) + } } test("createTableOptions") { @@ -385,12 +394,15 @@ class JDBCWriteSuite extends SharedSparkSession with BeforeAndAfter { .foldLeft(new StructType())((schema, colType) => schema.add(colType._1, colType._2)) val createTableColTypes = colTypes.map { case (col, dataType) => s"$col $dataType" }.mkString(", ") - val df = spark.createDataFrame(sparkContext.parallelize(Seq(Row.empty)), schema) val expectedSchemaStr = colTypes.map { case (col, dataType) => s""""$col" $dataType """ }.mkString(", ") - assert(JdbcUtils.schemaString(df, url1, Option(createTableColTypes)) == expectedSchemaStr) + assert(JdbcUtils.schemaString( + schema, + spark.sqlContext.conf.caseSensitiveAnalysis, + url1, + Option(createTableColTypes)) == expectedSchemaStr) } testCreateTableColDataTypes(Seq("boolean")) @@ -598,4 +610,55 @@ class JDBCWriteSuite extends SharedSparkSession with BeforeAndAfter { sparkContext.removeSparkListener(listener) taskMetrics.sum } + + test("SPARK-34144: write and read java.time LocalDate and Instant") { + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { + val schema = new StructType().add("d", DateType).add("t", TimestampType); + val values = Seq(Row.apply(LocalDate.parse("2020-01-01"), + Instant.parse("2020-02-02T12:13:14.56789Z"))) + val df = spark.createDataFrame(sparkContext.makeRDD(values), schema) + + df.write.jdbc(url, "TEST.TIMETYPES", new Properties()) + + val rows = spark.read.jdbc(url, "TEST.TIMETYPES", new Properties()).collect() + assert(1 === rows.length); + assert(rows(0).getAs[LocalDate](0) === LocalDate.parse("2020-01-01")) + assert(rows(0).getAs[Instant](1) === Instant.parse("2020-02-02T12:13:14.56789Z")) + } + } + + test("SPARK-34144: write Date and Timestampt, read LocalDate and Instant") { + val schema = new StructType().add("d", DateType).add("t", TimestampType); + val values = Seq(Row.apply(Date.valueOf("2020-01-01"), + Timestamp.valueOf("2020-02-02 12:13:14.56789"))) + val df = spark.createDataFrame(sparkContext.makeRDD(values), schema) + + df.write.jdbc(url, "TEST.TIMETYPES", new Properties()) + + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { + val rows = spark.read.jdbc(url, "TEST.TIMETYPES", new Properties()).collect() + assert(1 === rows.length); + assert(rows(0).getAs[LocalDate](0) === LocalDate.parse("2020-01-01")) + // 8 hour difference since Timestamp was America/Los_Angeles and Instant is GMT + assert(rows(0).getAs[Instant](1) === Instant.parse("2020-02-02T20:13:14.56789Z")) + } + } + + test("SPARK-34144: write LocalDate and Instant, read Date and Timestampt") { + withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> "true") { + val schema = new StructType().add("d", DateType).add("t", TimestampType); + val values = Seq(Row.apply(LocalDate.parse("2020-01-01"), + Instant.parse("2020-02-02T12:13:14.56789Z"))) + val df = spark.createDataFrame(sparkContext.makeRDD(values), schema) + + df.write.jdbc(url, "TEST.TIMETYPES", new Properties()) + } + + val rows = spark.read.jdbc(url, "TEST.TIMETYPES", new Properties()).collect() + assert(1 === rows.length); + assert(rows(0).getAs[java.sql.Date](0) === java.sql.Date.valueOf("2020-01-01")) + // -8 hour difference since Instant was GMT and Timestamp is America/Los_Angeles + assert(rows(0).getAs[java.sql.Timestamp](1) + === java.sql.Timestamp.valueOf("2020-02-02 04:13:14.56789")) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala index e153c7168dbf2..d90c8732ea287 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedReadSuite.scala @@ -27,9 +27,8 @@ import org.apache.spark.sql.catalyst.catalog.BucketSpec import org.apache.spark.sql.catalyst.expressions import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.plans.physical.HashPartitioning -import org.apache.spark.sql.execution.{DataSourceScanExec, FileSourceScanExec, SortExec, SparkPlan} -import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanExec -import org.apache.spark.sql.execution.adaptive.AdaptiveTestUtils.assertExceptionMessage +import org.apache.spark.sql.execution.{FileSourceScanExec, SortExec, SparkPlan} +import org.apache.spark.sql.execution.adaptive.{AdaptiveSparkPlanExec, AdaptiveSparkPlanHelper, DisableAdaptiveExecution} import org.apache.spark.sql.execution.datasources.BucketingUtils import org.apache.spark.sql.execution.exchange.ShuffleExchangeExec import org.apache.spark.sql.execution.joins.SortMergeJoinExec @@ -40,7 +39,8 @@ import org.apache.spark.sql.test.{SharedSparkSession, SQLTestUtils} import org.apache.spark.util.Utils import org.apache.spark.util.collection.BitSet -class BucketedReadWithoutHiveSupportSuite extends BucketedReadSuite with SharedSparkSession { +class BucketedReadWithoutHiveSupportSuite + extends BucketedReadSuite with SharedSparkSession { protected override def beforeAll(): Unit = { super.beforeAll() assert(spark.sparkContext.conf.get(CATALOG_IMPLEMENTATION) == "in-memory") @@ -48,7 +48,7 @@ class BucketedReadWithoutHiveSupportSuite extends BucketedReadSuite with SharedS } -abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { +abstract class BucketedReadSuite extends QueryTest with SQLTestUtils with AdaptiveSparkPlanHelper { import testImplicits._ protected override def beforeAll(): Unit = { @@ -82,27 +82,29 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { .bucketBy(8, "j", "k") .saveAsTable("bucketed_table") - val bucketValue = Random.nextInt(maxI) - val table = spark.table("bucketed_table").filter($"i" === bucketValue) - val query = table.queryExecution - val output = query.analyzed.output - val rdd = query.toRdd - - assert(rdd.partitions.length == 8) - - val attrs = table.select("j", "k").queryExecution.analyzed.output - val checkBucketId = rdd.mapPartitionsWithIndex((index, rows) => { - val getBucketId = UnsafeProjection.create( - HashPartitioning(attrs, 8).partitionIdExpression :: Nil, - output) - rows.map(row => getBucketId(row).getInt(0) -> index) - }) - checkBucketId.collect().foreach(r => assert(r._1 == r._2)) + withSQLConf(SQLConf.AUTO_BUCKETED_SCAN_ENABLED.key -> "false") { + val bucketValue = Random.nextInt(maxI) + val table = spark.table("bucketed_table").filter($"i" === bucketValue) + val query = table.queryExecution + val output = query.analyzed.output + val rdd = query.toRdd + + assert(rdd.partitions.length == 8) + + val attrs = table.select("j", "k").queryExecution.analyzed.output + val checkBucketId = rdd.mapPartitionsWithIndex((index, rows) => { + val getBucketId = UnsafeProjection.create( + HashPartitioning(attrs, 8).partitionIdExpression :: Nil, + output) + rows.map(row => getBucketId(row).getInt(0) -> index) + }) + checkBucketId.collect().foreach(r => assert(r._1 == r._2)) + } } } private def getFileScan(plan: SparkPlan): FileSourceScanExec = { - val fileScan = plan.collect { case f: FileSourceScanExec => f } + val fileScan = collect(plan) { case f: FileSourceScanExec => f } assert(fileScan.nonEmpty, plan) fileScan.head } @@ -112,12 +114,15 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { // 2) Verify the final result is the same as the expected one private def checkPrunedAnswers( bucketSpec: BucketSpec, - bucketValues: Seq[Integer], + bucketValues: Seq[Any], filterCondition: Column, originalDataFrame: DataFrame): Unit = { - // This test verifies parts of the plan. Disable whole stage codegen. - withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false") { - val bucketedDataFrame = spark.table("bucketed_table").select("i", "j", "k") + // This test verifies parts of the plan. Disable whole stage codegen, + // automatically bucketed scan, and filter push down for json data source. + withSQLConf(SQLConf.WHOLESTAGE_CODEGEN_ENABLED.key -> "false", + SQLConf.AUTO_BUCKETED_SCAN_ENABLED.key -> "false", + SQLConf.JSON_FILTER_PUSHDOWN_ENABLED.key -> "false") { + val bucketedDataFrame = spark.table("bucketed_table") val BucketSpec(numBuckets, bucketColumnNames, _) = bucketSpec // Limit: bucket pruning only works when the bucket column has one and only one column assert(bucketColumnNames.length == 1) @@ -146,11 +151,41 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { if (invalidBuckets.nonEmpty) { fail(s"Buckets ${invalidBuckets.mkString(",")} should have been pruned from:\n$plan") } + + withSQLConf(SQLConf.AUTO_BUCKETED_SCAN_ENABLED.key -> "true") { + // Bucket pruning should still work without bucketed scan + val planWithoutBucketedScan = bucketedDataFrame.filter(filterCondition) + .queryExecution.executedPlan + val fileScan = getFileScan(planWithoutBucketedScan) + assert(!fileScan.bucketedScan, s"except no bucketed scan but found\n$fileScan") + + val bucketColumnType = bucketedDataFrame.schema.apply(bucketColumnIndex).dataType + val rowsWithInvalidBuckets = fileScan.execute().filter(row => { + // Return rows should have been pruned + val bucketColumnValue = row.get(bucketColumnIndex, bucketColumnType) + val bucketId = BucketingUtils.getBucketIdFromValue( + bucketColumn, numBuckets, bucketColumnValue) + !matchedBuckets.get(bucketId) + }).collect() + + if (rowsWithInvalidBuckets.nonEmpty) { + fail(s"Rows ${rowsWithInvalidBuckets.mkString(",")} should have been pruned from:\n" + + s"$planWithoutBucketedScan") + } + } } + val expectedDataFrame = originalDataFrame.filter(filterCondition).orderBy("i", "j", "k") + .select("i", "j", "k") checkAnswer( - bucketedDataFrame.filter(filterCondition).orderBy("i", "j", "k"), - originalDataFrame.filter(filterCondition).orderBy("i", "j", "k")) + bucketedDataFrame.filter(filterCondition).orderBy("i", "j", "k").select("i", "j", "k"), + expectedDataFrame) + + withSQLConf(SQLConf.AUTO_BUCKETED_SCAN_ENABLED.key -> "true") { + checkAnswer( + bucketedDataFrame.filter(filterCondition).orderBy("i", "j", "k").select("i", "j", "k"), + expectedDataFrame) + } } } @@ -158,7 +193,6 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { withTable("bucketed_table") { val numBuckets = NumBucketsForPruningDF val bucketSpec = BucketSpec(numBuckets, Seq("j"), Nil) - // json does not support predicate push-down, and thus json is used here df.write .format("json") .partitionBy("i") @@ -189,7 +223,7 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { // Case 4: InSet val inSetExpr = expressions.InSet($"j".expr, - Set(bucketValue, bucketValue + 1, bucketValue + 2, bucketValue + 3).map(lit(_).expr)) + Set(bucketValue, bucketValue + 1, bucketValue + 2, bucketValue + 3)) checkPrunedAnswers( bucketSpec, bucketValues = Seq(bucketValue, bucketValue + 1, bucketValue + 2, bucketValue + 3), @@ -244,6 +278,25 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { } } + test("bucket pruning support IsNaN") { + withTable("bucketed_table") { + val numBuckets = NumBucketsForPruningNullDf + val bucketSpec = BucketSpec(numBuckets, Seq("j"), Nil) + val naNDF = nullDF.selectExpr("i", "cast(if(isnull(j), 'NaN', j) as double) as j", "k") + // json does not support predicate push-down, and thus json is used here + naNDF.write + .format("json") + .bucketBy(numBuckets, "j") + .saveAsTable("bucketed_table") + + checkPrunedAnswers( + bucketSpec, + bucketValues = Double.NaN :: Nil, + filterCondition = $"j".isNaN, + naNDF) + } + } + test("read partitioning bucketed tables having composite filters") { withTable("bucketed_table") { val numBuckets = NumBucketsForPruningDF @@ -333,7 +386,8 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { bucketSpec: Option[BucketSpec], numPartitions: Int = 10, expectedShuffle: Boolean = true, - expectedSort: Boolean = true) + expectedSort: Boolean = true, + expectedNumOutputPartitions: Option[Int] = None) /** * A helper method to test the bucket read functionality using join. It will save `df1` and `df2` @@ -346,10 +400,18 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { bucketedTableTestSpecRight: BucketedTableTestSpec, joinType: String = "inner", joinCondition: (DataFrame, DataFrame) => Column): Unit = { - val BucketedTableTestSpec(bucketSpecLeft, numPartitionsLeft, shuffleLeft, sortLeft) = - bucketedTableTestSpecLeft - val BucketedTableTestSpec(bucketSpecRight, numPartitionsRight, shuffleRight, sortRight) = - bucketedTableTestSpecRight + val BucketedTableTestSpec( + bucketSpecLeft, + numPartitionsLeft, + shuffleLeft, + sortLeft, + numOutputPartitionsLeft) = bucketedTableTestSpecLeft + val BucketedTableTestSpec( + bucketSpecRight, + numPartitionsRight, + shuffleRight, + sortRight, + numOutputPartitionsRight) = bucketedTableTestSpecRight withTable("bucketed_table1", "bucketed_table2") { def withBucket( @@ -414,6 +476,16 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { assert( joinOperator.right.find(_.isInstanceOf[SortExec]).isDefined == sortRight, s"expected sort in the right child to be $sortRight but found\n${joinOperator.right}") + + // check the output partitioning + if (numOutputPartitionsLeft.isDefined) { + assert(joinOperator.left.outputPartitioning.numPartitions === + numOutputPartitionsLeft.get) + } + if (numOutputPartitionsRight.isDefined) { + assert(joinOperator.right.outputPartitioning.numPartitions === + numOutputPartitionsRight.get) + } } } } @@ -599,13 +671,14 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { withTable("bucketed_table") { df1.write.format("parquet").bucketBy(8, "i", "j").saveAsTable("bucketed_table") val tbl = spark.table("bucketed_table") - val agged = tbl.groupBy("i", "j").agg(max("k")) + val aggregated = tbl.groupBy("i", "j").agg(max("k")) checkAnswer( - agged.sort("i", "j"), + aggregated.sort("i", "j"), df1.groupBy("i", "j").agg(max("k")).sort("i", "j")) - assert(agged.queryExecution.executedPlan.find(_.isInstanceOf[ShuffleExchangeExec]).isEmpty) + assert( + aggregated.queryExecution.executedPlan.find(_.isInstanceOf[ShuffleExchangeExec]).isEmpty) } } @@ -639,13 +712,14 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { withTable("bucketed_table") { df1.write.format("parquet").bucketBy(8, "i").saveAsTable("bucketed_table") val tbl = spark.table("bucketed_table") - val agged = tbl.groupBy("i", "j").agg(max("k")) + val aggregated = tbl.groupBy("i", "j").agg(max("k")) checkAnswer( - agged.sort("i", "j"), + aggregated.sort("i", "j"), df1.groupBy("i", "j").agg(max("k")).sort("i", "j")) - assert(agged.queryExecution.executedPlan.find(_.isInstanceOf[ShuffleExchangeExec]).isEmpty) + assert( + aggregated.queryExecution.executedPlan.find(_.isInstanceOf[ShuffleExchangeExec]).isEmpty) } } @@ -766,12 +840,12 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { Utils.deleteRecursively(tableDir) df1.write.parquet(tableDir.getAbsolutePath) - val agged = spark.table("bucketed_table").groupBy("i").count() + val aggregated = spark.table("bucketed_table").groupBy("i").count() val error = intercept[Exception] { - agged.count() + aggregated.count() } - assertExceptionMessage(error, "Invalid bucket file") + assert(error.toString contains "Invalid bucket file") } } @@ -856,4 +930,145 @@ abstract class BucketedReadSuite extends QueryTest with SQLTestUtils { } } } + + test("SPARK-32767 Bucket join should work if SHUFFLE_PARTITIONS larger than bucket number") { + withSQLConf( + SQLConf.SHUFFLE_PARTITIONS.key -> "9", + SQLConf.COALESCE_PARTITIONS_INITIAL_PARTITION_NUM.key -> "10") { + + val testSpec1 = BucketedTableTestSpec( + Some(BucketSpec(8, Seq("i", "j"), Seq("i", "j"))), + numPartitions = 1, + expectedShuffle = false, + expectedSort = false, + expectedNumOutputPartitions = Some(8)) + val testSpec2 = BucketedTableTestSpec( + Some(BucketSpec(6, Seq("i", "j"), Seq("i", "j"))), + numPartitions = 1, + expectedShuffle = true, + expectedSort = true, + expectedNumOutputPartitions = Some(8)) + Seq(false, true).foreach { enableAdaptive => + withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> s"$enableAdaptive") { + Seq((testSpec1, testSpec2), (testSpec2, testSpec1)).foreach { specs => + testBucketing( + bucketedTableTestSpecLeft = specs._1, + bucketedTableTestSpecRight = specs._2, + joinCondition = joinCondition(Seq("i", "j"))) + } + } + } + } + } + + test("bucket coalescing eliminates shuffle") { + withSQLConf( + SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "true", + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") { + // The side with bucketedTableTestSpec1 will be coalesced to have 4 output partitions. + // Currently, sort will be introduced for the side that is coalesced. + val testSpec1 = BucketedTableTestSpec( + Some(BucketSpec(8, Seq("i", "j"), Seq("i", "j"))), + numPartitions = 1, + expectedShuffle = false, + expectedSort = true, + expectedNumOutputPartitions = Some(4)) + val testSpec2 = BucketedTableTestSpec( + Some(BucketSpec(4, Seq("i", "j"), Seq("i", "j"))), + numPartitions = 1, + expectedShuffle = false, + expectedSort = false, + expectedNumOutputPartitions = Some(4)) + + Seq((testSpec1, testSpec2), (testSpec2, testSpec1)).foreach { specs => + testBucketing( + bucketedTableTestSpecLeft = specs._1, + bucketedTableTestSpecRight = specs._2, + joinCondition = joinCondition(Seq("i", "j"))) + } + } + } + + test("bucket coalescing is not satisfied") { + def run(testSpec1: BucketedTableTestSpec, testSpec2: BucketedTableTestSpec): Unit = { + Seq((testSpec1, testSpec2), (testSpec2, testSpec1)).foreach { specs => + testBucketing( + bucketedTableTestSpecLeft = specs._1, + bucketedTableTestSpecRight = specs._2, + joinCondition = joinCondition(Seq("i", "j"))) + } + } + + withSQLConf(SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "false") { + // Coalescing buckets is disabled by a config. + run( + BucketedTableTestSpec( + Some(BucketSpec(8, Seq("i", "j"), Seq("i", "j"))), expectedShuffle = false), + BucketedTableTestSpec( + Some(BucketSpec(4, Seq("i", "j"), Seq("i", "j"))), expectedShuffle = true)) + } + + withSQLConf( + SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "true", + SQLConf.COALESCE_BUCKETS_IN_JOIN_MAX_BUCKET_RATIO.key -> "2") { + // Coalescing buckets is not applied because the ratio of the number of buckets (3) + // is greater than max allowed (2). + run( + BucketedTableTestSpec( + Some(BucketSpec(12, Seq("i", "j"), Seq("i", "j"))), expectedShuffle = false), + BucketedTableTestSpec( + Some(BucketSpec(4, Seq("i", "j"), Seq("i", "j"))), expectedShuffle = true)) + } + + withSQLConf(SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "true") { + run( + // Coalescing buckets is not applied because the bigger number of buckets (8) is not + // divisible by the smaller number of buckets (7). + BucketedTableTestSpec( + Some(BucketSpec(8, Seq("i", "j"), Seq("i", "j"))), expectedShuffle = false), + BucketedTableTestSpec( + Some(BucketSpec(7, Seq("i", "j"), Seq("i", "j"))), expectedShuffle = true)) + } + } + + test("bucket coalescing is applied when join expressions match with partitioning expressions", + DisableAdaptiveExecution("Expected shuffle num mismatched")) { + withTable("t1", "t2") { + df1.write.format("parquet").bucketBy(8, "i", "j").saveAsTable("t1") + df2.write.format("parquet").bucketBy(4, "i", "j").saveAsTable("t2") + + withSQLConf( + SQLConf.AUTO_BROADCASTJOIN_THRESHOLD.key -> "0", + SQLConf.COALESCE_BUCKETS_IN_JOIN_ENABLED.key -> "true") { + def verify( + query: String, + expectedNumShuffles: Int, + expectedCoalescedNumBuckets: Option[Int]): Unit = { + val plan = sql(query).queryExecution.executedPlan + val shuffles = plan.collect { case s: ShuffleExchangeExec => s } + assert(shuffles.length == expectedNumShuffles) + + val scans = plan.collect { + case f: FileSourceScanExec if f.optionalNumCoalescedBuckets.isDefined => f + } + if (expectedCoalescedNumBuckets.isDefined) { + assert(scans.length == 1) + assert(scans.head.optionalNumCoalescedBuckets == expectedCoalescedNumBuckets) + } else { + assert(scans.isEmpty) + } + } + + // Coalescing applied since join expressions match with the bucket columns. + verify("SELECT * FROM t1 JOIN t2 ON t1.i = t2.i AND t1.j = t2.j", 0, Some(4)) + // Coalescing applied when columns are aliased. + verify( + "SELECT * FROM t1 JOIN (SELECT i AS x, j AS y FROM t2) ON t1.i = x AND t1.j = y", + 0, + Some(4)) + // Coalescing is not applied when join expressions do not match with bucket columns. + verify("SELECT * FROM t1 JOIN t2 ON t1.i = t2.i", 2, None) + } + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedWriteSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedWriteSuite.scala index a410f32d4af7e..0a5feda1bd533 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedWriteSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/BucketedWriteSuite.scala @@ -88,7 +88,7 @@ abstract class BucketedWriteSuite extends QueryTest with SQLTestUtils { val e = intercept[AnalysisException] { df.write.sortBy("j").saveAsTable("tt") } - assert(e.getMessage == "sortBy must be used together with bucketBy;") + assert(e.getMessage == "sortBy must be used together with bucketBy") } test("sorting by non-orderable column") { @@ -102,7 +102,7 @@ abstract class BucketedWriteSuite extends QueryTest with SQLTestUtils { val e = intercept[AnalysisException] { df.write.bucketBy(2, "i").parquet("/tmp/path") } - assert(e.getMessage == "'save' does not support bucketBy right now;") + assert(e.getMessage == "'save' does not support bucketBy right now") } test("write bucketed and sorted data using save()") { @@ -111,7 +111,7 @@ abstract class BucketedWriteSuite extends QueryTest with SQLTestUtils { val e = intercept[AnalysisException] { df.write.bucketBy(2, "i").sortBy("i").parquet("/tmp/path") } - assert(e.getMessage == "'save' does not support bucketBy and sortBy right now;") + assert(e.getMessage == "'save' does not support bucketBy and sortBy right now") } test("write bucketed data using insertInto()") { @@ -120,7 +120,7 @@ abstract class BucketedWriteSuite extends QueryTest with SQLTestUtils { val e = intercept[AnalysisException] { df.write.bucketBy(2, "i").insertInto("tt") } - assert(e.getMessage == "'insertInto' does not support bucketBy right now;") + assert(e.getMessage == "'insertInto' does not support bucketBy right now") } test("write bucketed and sorted data using insertInto()") { @@ -129,7 +129,7 @@ abstract class BucketedWriteSuite extends QueryTest with SQLTestUtils { val e = intercept[AnalysisException] { df.write.bucketBy(2, "i").sortBy("i").insertInto("tt") } - assert(e.getMessage == "'insertInto' does not support bucketBy and sortBy right now;") + assert(e.getMessage == "'insertInto' does not support bucketBy and sortBy right now") } private lazy val df = { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/CreateTableAsSelectSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/CreateTableAsSelectSuite.scala index 983209051c8ae..9a7c7e0edc409 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/sources/CreateTableAsSelectSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/CreateTableAsSelectSuite.scala @@ -22,7 +22,7 @@ import java.io.File import org.apache.spark.SparkException import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.catalyst.TableIdentifier -import org.apache.spark.sql.catalyst.catalog.BucketSpec +import org.apache.spark.sql.catalyst.catalog.{BucketSpec, CatalogTableType} import org.apache.spark.sql.catalyst.parser.ParseException import org.apache.spark.sql.internal.SQLConf.BUCKETING_MAX_BUCKETS import org.apache.spark.sql.test.SharedSparkSession @@ -166,24 +166,21 @@ class CreateTableAsSelectSuite extends DataSourceTest with SharedSparkSession { ) }.getMessage assert(error.contains("Operation not allowed") && - error.contains("CREATE TEMPORARY TABLE ... USING ... AS query")) + error.contains("CREATE TEMPORARY TABLE")) } } - test("disallows CREATE EXTERNAL TABLE ... USING ... AS query") { + test("SPARK-33651: allow CREATE EXTERNAL TABLE ... USING ... if location is specified") { withTable("t") { - val error = intercept[ParseException] { - sql( - s""" - |CREATE EXTERNAL TABLE t USING PARQUET - |OPTIONS (PATH '${path.toURI}') - |AS SELECT 1 AS a, 2 AS b - """.stripMargin - ) - }.getMessage - - assert(error.contains("Operation not allowed") && - error.contains("CREATE EXTERNAL TABLE ...")) + sql( + s""" + |CREATE EXTERNAL TABLE t USING PARQUET + |OPTIONS (PATH '${path.toURI}') + |AS SELECT 1 AS a, 2 AS b + """.stripMargin) + val table = spark.sessionState.catalog.getTableMetadata(TableIdentifier("t")) + assert(table.tableType == CatalogTableType.EXTERNAL) + assert(table.location.toString == path.toURI.toString.stripSuffix("/")) } } @@ -237,7 +234,7 @@ class CreateTableAsSelectSuite extends DataSourceTest with SharedSparkSession { } } - test("create table using as select - with overriden max number of buckets") { + test("create table using as select - with overridden max number of buckets") { def createTableSql(numBuckets: Int): String = s""" |CREATE TABLE t USING PARQUET diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/DataSourceAnalysisSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/DataSourceAnalysisSuite.scala index a6c50904d395b..81ce979ef0b62 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/sources/DataSourceAnalysisSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/DataSourceAnalysisSuite.scala @@ -23,12 +23,13 @@ import org.apache.spark.SparkFunSuite import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.catalyst.dsl.expressions._ import org.apache.spark.sql.catalyst.expressions.{Alias, AnsiCast, Attribute, Cast, Expression, Literal} +import org.apache.spark.sql.catalyst.plans.SQLHelper import org.apache.spark.sql.execution.datasources.DataSourceAnalysis import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.internal.SQLConf.StoreAssignmentPolicy import org.apache.spark.sql.types.{DataType, IntegerType, StructType} -class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll { +class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll with SQLHelper { private var targetAttributes: Seq[Attribute] = _ private var targetPartitionSchema: StructType = _ @@ -51,19 +52,26 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll { } Seq(true, false).foreach { caseSensitive => - val conf = new SQLConf().copy(SQLConf.CASE_SENSITIVE -> caseSensitive) + def testRule(testName: String, caseSensitive: Boolean)(func: => Unit): Unit = { + test(s"$testName (caseSensitive: $caseSensitive)") { + withSQLConf(SQLConf.CASE_SENSITIVE.key -> caseSensitive.toString) { + func + } + } + } + def cast(e: Expression, dt: DataType): Expression = { - conf.storeAssignmentPolicy match { + SQLConf.get.storeAssignmentPolicy match { case StoreAssignmentPolicy.ANSI | StoreAssignmentPolicy.STRICT => - AnsiCast(e, dt, Option(conf.sessionLocalTimeZone)) + AnsiCast(e, dt, Option(SQLConf.get.sessionLocalTimeZone)) case _ => - Cast(e, dt, Option(conf.sessionLocalTimeZone)) + Cast(e, dt, Option(SQLConf.get.sessionLocalTimeZone)) } } - val rule = DataSourceAnalysis(conf) - test( - s"convertStaticPartitions only handle INSERT having at least static partitions " + - s"(caseSensitive: $caseSensitive)") { + val rule = DataSourceAnalysis + testRule( + "convertStaticPartitions only handle INSERT having at least static partitions", + caseSensitive) { intercept[AssertionError] { rule.convertStaticPartitions( sourceAttributes = Seq('e.int, 'f.int), @@ -73,7 +81,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll { } } - test(s"Missing columns (caseSensitive: $caseSensitive)") { + testRule("Missing columns", caseSensitive) { // Missing columns. intercept[AnalysisException] { rule.convertStaticPartitions( @@ -84,7 +92,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll { } } - test(s"Missing partitioning columns (caseSensitive: $caseSensitive)") { + testRule("Missing partitioning columns", caseSensitive) { // Missing partitioning columns. intercept[AnalysisException] { rule.convertStaticPartitions( @@ -113,7 +121,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll { } } - test(s"Wrong partitioning columns (caseSensitive: $caseSensitive)") { + testRule("Wrong partitioning columns", caseSensitive) { // Wrong partitioning columns. intercept[AnalysisException] { rule.convertStaticPartitions( @@ -144,9 +152,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll { } } - test( - s"Static partitions need to appear before dynamic partitions" + - s" (caseSensitive: $caseSensitive)") { + testRule("Static partitions need to appear before dynamic partitions", caseSensitive) { // Static partitions need to appear before dynamic partitions. intercept[AnalysisException] { rule.convertStaticPartitions( @@ -157,7 +163,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll { } } - test(s"All static partitions (caseSensitive: $caseSensitive)") { + testRule("All static partitions", caseSensitive) { if (!caseSensitive) { val nonPartitionedAttributes = Seq('e.int, 'f.int) val expected = nonPartitionedAttributes ++ @@ -195,7 +201,7 @@ class DataSourceAnalysisSuite extends SparkFunSuite with BeforeAndAfterAll { } } - test(s"Static partition and dynamic partition (caseSensitive: $caseSensitive)") { + testRule("Static partition and dynamic partition", caseSensitive) { val nonPartitionedAttributes = Seq('e.int, 'f.int) val dynamicPartitionAttributes = Seq('g.int) val expected = diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/DisableUnnecessaryBucketedScanSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/DisableUnnecessaryBucketedScanSuite.scala new file mode 100644 index 0000000000000..1a19824a31555 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/DisableUnnecessaryBucketedScanSuite.scala @@ -0,0 +1,261 @@ +/* + * 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. + */ + +package org.apache.spark.sql.sources + +import org.apache.spark.sql.QueryTest +import org.apache.spark.sql.catalyst.expressions.AttributeReference +import org.apache.spark.sql.catalyst.plans.physical.HashPartitioning +import org.apache.spark.sql.execution.FileSourceScanExec +import org.apache.spark.sql.execution.adaptive.{AdaptiveSparkPlanHelper, DisableAdaptiveExecutionSuite, EnableAdaptiveExecutionSuite} +import org.apache.spark.sql.execution.exchange.ShuffleExchangeExec +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.internal.StaticSQLConf.CATALOG_IMPLEMENTATION +import org.apache.spark.sql.test.{SharedSparkSession, SQLTestUtils} + +class DisableUnnecessaryBucketedScanWithoutHiveSupportSuite + extends DisableUnnecessaryBucketedScanSuite + with SharedSparkSession + with DisableAdaptiveExecutionSuite { + + protected override def beforeAll(): Unit = { + super.beforeAll() + assert(spark.sparkContext.conf.get(CATALOG_IMPLEMENTATION) == "in-memory") + } +} + +class DisableUnnecessaryBucketedScanWithoutHiveSupportSuiteAE + extends DisableUnnecessaryBucketedScanSuite + with SharedSparkSession + with EnableAdaptiveExecutionSuite { + + protected override def beforeAll(): Unit = { + super.beforeAll() + assert(spark.sparkContext.conf.get(CATALOG_IMPLEMENTATION) == "in-memory") + } +} + +abstract class DisableUnnecessaryBucketedScanSuite + extends QueryTest + with SQLTestUtils + with AdaptiveSparkPlanHelper { + + import testImplicits._ + + private lazy val df1 = + (0 until 50).map(i => (i % 5, i % 13, i.toString)).toDF("i", "j", "k").as("df1") + private lazy val df2 = + (0 until 50).map(i => (i % 7, i % 11, i.toString)).toDF("i", "j", "k").as("df2") + + private def checkDisableBucketedScan( + query: String, + expectedNumScanWithAutoScanEnabled: Int, + expectedNumScanWithAutoScanDisabled: Int): Unit = { + + def checkNumBucketedScan(query: String, expectedNumBucketedScan: Int): Unit = { + val plan = sql(query).queryExecution.executedPlan + val bucketedScan = collect(plan) { case s: FileSourceScanExec if s.bucketedScan => s } + assert(bucketedScan.length == expectedNumBucketedScan) + } + + withSQLConf(SQLConf.AUTO_BUCKETED_SCAN_ENABLED.key -> "true") { + checkNumBucketedScan(query, expectedNumScanWithAutoScanEnabled) + val result = sql(query).collect() + + withSQLConf(SQLConf.AUTO_BUCKETED_SCAN_ENABLED.key -> "false") { + checkNumBucketedScan(query, expectedNumScanWithAutoScanDisabled) + checkAnswer(sql(query), result) + } + } + } + + test("SPARK-32859: disable unnecessary bucketed table scan - basic test") { + withTable("t1", "t2", "t3") { + df1.write.format("parquet").bucketBy(8, "i").saveAsTable("t1") + df2.write.format("parquet").bucketBy(8, "i").saveAsTable("t2") + df2.write.format("parquet").bucketBy(4, "i").saveAsTable("t3") + + Seq( + // Read bucketed table + ("SELECT * FROM t1", 0, 1), + ("SELECT i FROM t1", 0, 1), + ("SELECT j FROM t1", 0, 0), + // Filter on bucketed column + ("SELECT * FROM t1 WHERE i = 1", 0, 1), + // Filter on non-bucketed column + ("SELECT * FROM t1 WHERE j = 1", 0, 1), + // Join with same buckets + ("SELECT /*+ broadcast(t1)*/ * FROM t1 JOIN t2 ON t1.i = t2.i", 0, 2), + ("SELECT /*+ shuffle_hash(t1)*/ * FROM t1 JOIN t2 ON t1.i = t2.i", 2, 2), + ("SELECT /*+ merge(t1)*/ * FROM t1 JOIN t2 ON t1.i = t2.i", 2, 2), + // Join with different buckets + ("SELECT /*+ broadcast(t1)*/ * FROM t1 JOIN t3 ON t1.i = t3.i", 0, 2), + ("SELECT /*+ shuffle_hash(t1)*/ * FROM t1 JOIN t3 ON t1.i = t3.i", 1, 2), + ("SELECT /*+ merge(t1)*/ * FROM t1 JOIN t3 ON t1.i = t3.i", 1, 2), + // Join on non-bucketed column + ("SELECT /*+ broadcast(t1)*/ * FROM t1 JOIN t2 ON t1.i = t2.j", 0, 2), + ("SELECT /*+ shuffle_hash(t1)*/ * FROM t1 JOIN t2 ON t1.i = t2.j", 1, 2), + ("SELECT /*+ merge(t1)*/ * FROM t1 JOIN t2 ON t1.i = t2.j", 1, 2), + ("SELECT /*+ broadcast(t1)*/ * FROM t1 JOIN t2 ON t1.j = t2.j", 0, 2), + ("SELECT /*+ shuffle_hash(t1)*/ * FROM t1 JOIN t2 ON t1.j = t2.j", 0, 2), + ("SELECT /*+ merge(t1)*/ * FROM t1 JOIN t2 ON t1.j = t2.j", 0, 2), + // Aggregate on bucketed column + ("SELECT SUM(i) FROM t1 GROUP BY i", 1, 1), + // Aggregate on non-bucketed column + ("SELECT SUM(i) FROM t1 GROUP BY j", 0, 1), + ("SELECT j, SUM(i), COUNT(j) FROM t1 GROUP BY j", 0, 1) + ).foreach { case (query, numScanWithAutoScanEnabled, numScanWithAutoScanDisabled) => + checkDisableBucketedScan(query, numScanWithAutoScanEnabled, numScanWithAutoScanDisabled) + } + } + } + + test("SPARK-32859: disable unnecessary bucketed table scan - multiple joins test") { + withTable("t1", "t2", "t3") { + df1.write.format("parquet").bucketBy(8, "i").saveAsTable("t1") + df2.write.format("parquet").bucketBy(8, "i").saveAsTable("t2") + df2.write.format("parquet").bucketBy(4, "i").saveAsTable("t3") + + Seq( + // Multiple joins on bucketed columns + (""" + SELECT /*+ broadcast(t1, t3)*/ * FROM t1 JOIN t2 JOIN t3 + ON t1.i = t2.i AND t2.i = t3.i + """.stripMargin, 0, 3), + (""" + SELECT /*+ broadcast(t1) merge(t3)*/ * FROM t1 JOIN t2 JOIN t3 + ON t1.i = t2.i AND t2.i = t3.i + """.stripMargin, 2, 3), + (""" + SELECT /*+ merge(t1) broadcast(t3)*/ * FROM t1 JOIN t2 JOIN t3 + ON t1.i = t2.i AND t2.i = t3.i + """.stripMargin, 2, 3), + (""" + SELECT /*+ merge(t1, t3)*/ * FROM t1 JOIN t2 JOIN t3 + ON t1.i = t2.i AND t2.i = t3.i + """.stripMargin, 2, 3), + // Multiple joins on non-bucketed columns + (""" + SELECT /*+ broadcast(t1, t3)*/ * FROM t1 JOIN t2 JOIN t3 + ON t1.i = t2.j AND t2.j = t3.i + """.stripMargin, 0, 3), + (""" + SELECT /*+ merge(t1, t3)*/ * FROM t1 JOIN t2 JOIN t3 + ON t1.i = t2.j AND t2.j = t3.i + """.stripMargin, 1, 3), + (""" + SELECT /*+ merge(t1, t3)*/ * FROM t1 JOIN t2 JOIN t3 + ON t1.j = t2.j AND t2.j = t3.j + """.stripMargin, 0, 3) + ).foreach { case (query, numScanWithAutoScanEnabled, numScanWithAutoScanDisabled) => + checkDisableBucketedScan(query, numScanWithAutoScanEnabled, numScanWithAutoScanDisabled) + } + } + } + + test("SPARK-32859: disable unnecessary bucketed table scan - multiple bucketed columns test") { + withTable("t1", "t2", "t3") { + df1.write.format("parquet").bucketBy(8, "i", "j").saveAsTable("t1") + df2.write.format("parquet").bucketBy(8, "i", "j").saveAsTable("t2") + df2.write.format("parquet").bucketBy(4, "i", "j").saveAsTable("t3") + + Seq( + // Filter on bucketed columns + ("SELECT * FROM t1 WHERE i = 1", 0, 1), + ("SELECT * FROM t1 WHERE i = 1 AND j = 1", 0, 1), + // Join on bucketed columns + (""" + SELECT /*+ broadcast(t1)*/ * FROM t1 JOIN t2 ON t1.i = t2.i AND t1.j = t2.j + """.stripMargin, 0, 2), + (""" + SELECT /*+ merge(t1)*/ * FROM t1 JOIN t2 ON t1.i = t2.i AND t1.j = t2.j + """.stripMargin, 2, 2), + (""" + SELECT /*+ merge(t1)*/ * FROM t1 JOIN t3 ON t1.i = t3.i AND t1.j = t3.j + """.stripMargin, 1, 2), + ("SELECT /*+ merge(t1)*/ * FROM t1 JOIN t2 ON t1.i = t2.i", 0, 2), + // Aggregate on bucketed columns + ("SELECT i, j, COUNT(*) FROM t1 GROUP BY i, j", 1, 1), + ("SELECT i, COUNT(i) FROM t1 GROUP BY i", 0, 0), + ("SELECT i, COUNT(j) FROM t1 GROUP BY i", 0, 1) + ).foreach { case (query, numScanWithAutoScanEnabled, numScanWithAutoScanDisabled) => + checkDisableBucketedScan(query, numScanWithAutoScanEnabled, numScanWithAutoScanDisabled) + } + } + } + + test("SPARK-32859: disable unnecessary bucketed table scan - other operators test") { + withTable("t1", "t2", "t3") { + df1.write.format("parquet").bucketBy(8, "i").saveAsTable("t1") + df2.write.format("parquet").bucketBy(8, "i").saveAsTable("t2") + df1.write.format("parquet").saveAsTable("t3") + + Seq( + // Operator with interesting partition not in sub-plan + (""" + SELECT t1.i FROM t1 + UNION ALL + (SELECT t2.i FROM t2 GROUP BY t2.i) + """.stripMargin, 1, 2), + // Non-allowed operator in sub-plan + (""" + SELECT COUNT(*) + FROM (SELECT t1.i FROM t1 UNION ALL SELECT t2.i FROM t2) + GROUP BY i + """.stripMargin, 2, 2), + // Multiple [[Exchange]] in sub-plan + (""" + SELECT j, SUM(i), COUNT(*) FROM t1 GROUP BY j + DISTRIBUTE BY j + """.stripMargin, 0, 1), + (""" + SELECT j, COUNT(*) + FROM (SELECT i, j FROM t1 DISTRIBUTE BY i, j) + GROUP BY j + """.stripMargin, 0, 1), + // No bucketed table scan in plan + (""" + SELECT j, COUNT(*) + FROM (SELECT t1.j FROM t1 JOIN t3 ON t1.j = t3.j) + GROUP BY j + """.stripMargin, 0, 0) + ).foreach { case (query, numScanWithAutoScanEnabled, numScanWithAutoScanDisabled) => + checkDisableBucketedScan(query, numScanWithAutoScanEnabled, numScanWithAutoScanDisabled) + } + } + } + + test("SPARK-33075: not disable bucketed table scan for cached query") { + withTable("t1") { + withSQLConf(SQLConf.AUTO_BUCKETED_SCAN_ENABLED.key -> "true") { + df1.write.format("parquet").bucketBy(8, "i").saveAsTable("t1") + spark.catalog.cacheTable("t1") + assertCached(spark.table("t1")) + + // Verify cached bucketed table scan not disabled + val partitioning = stripAQEPlan(spark.table("t1").queryExecution.executedPlan) + .outputPartitioning + assert(partitioning match { + case HashPartitioning(Seq(column: AttributeReference), 8) if column.name == "i" => true + case _ => false + }) + val aggregateQueryPlan = sql("SELECT SUM(i) FROM t1 GROUP BY i").queryExecution.executedPlan + assert(find(aggregateQueryPlan)(_.isInstanceOf[ShuffleExchangeExec]).isEmpty) + } + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala index 87a4d061b8170..9de3b0e954848 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/InsertSuite.scala @@ -623,12 +623,12 @@ class InsertSuite extends DataSourceTest with SharedSparkSession { var msg = intercept[AnalysisException] { sql("insert into t select 1L, 2") }.getMessage - assert(msg.contains("Cannot safely cast 'i': LongType to IntegerType")) + assert(msg.contains("Cannot safely cast 'i': bigint to int")) msg = intercept[AnalysisException] { sql("insert into t select 1, 2.0") }.getMessage - assert(msg.contains("Cannot safely cast 'd': DecimalType(2,1) to DoubleType")) + assert(msg.contains("Cannot safely cast 'd': decimal(2,1) to double")) msg = intercept[AnalysisException] { sql("insert into t select 1, 2.0D, 3") @@ -660,18 +660,18 @@ class InsertSuite extends DataSourceTest with SharedSparkSession { var msg = intercept[AnalysisException] { sql("insert into t values('a', 'b')") }.getMessage - assert(msg.contains("Cannot safely cast 'i': StringType to IntegerType") && - msg.contains("Cannot safely cast 'd': StringType to DoubleType")) + assert(msg.contains("Cannot safely cast 'i': string to int") && + msg.contains("Cannot safely cast 'd': string to double")) msg = intercept[AnalysisException] { sql("insert into t values(now(), now())") }.getMessage - assert(msg.contains("Cannot safely cast 'i': TimestampType to IntegerType") && - msg.contains("Cannot safely cast 'd': TimestampType to DoubleType")) + assert(msg.contains("Cannot safely cast 'i': timestamp to int") && + msg.contains("Cannot safely cast 'd': timestamp to double")) msg = intercept[AnalysisException] { sql("insert into t values(true, false)") }.getMessage - assert(msg.contains("Cannot safely cast 'i': BooleanType to IntegerType") && - msg.contains("Cannot safely cast 'd': BooleanType to DoubleType")) + assert(msg.contains("Cannot safely cast 'i': boolean to int") && + msg.contains("Cannot safely cast 'd': boolean to double")) } } } @@ -731,13 +731,13 @@ class InsertSuite extends DataSourceTest with SharedSparkSession { var msg = intercept[SparkException] { sql(s"insert into t values(${outOfRangeValue1}D)") }.getCause.getMessage - assert(msg.contains(s"Casting $outOfRangeValue1 to long causes overflow")) + assert(msg.contains(s"Casting $outOfRangeValue1 to bigint causes overflow")) val outOfRangeValue2 = Math.nextDown(Long.MinValue) msg = intercept[SparkException] { sql(s"insert into t values(${outOfRangeValue2}D)") }.getCause.getMessage - assert(msg.contains(s"Casting $outOfRangeValue2 to long causes overflow")) + assert(msg.contains(s"Casting $outOfRangeValue2 to bigint causes overflow")) } } } @@ -756,23 +756,43 @@ class InsertSuite extends DataSourceTest with SharedSparkSession { } } - test("SPARK-30844: static partition should also follow StoreAssignmentPolicy") { - SQLConf.StoreAssignmentPolicy.values.foreach { policy => - withSQLConf( - SQLConf.STORE_ASSIGNMENT_POLICY.key -> policy.toString) { - withTable("t") { - sql("create table t(a int, b string) using parquet partitioned by (a)") - policy match { - case SQLConf.StoreAssignmentPolicy.ANSI | SQLConf.StoreAssignmentPolicy.STRICT => - val errorMsg = intercept[NumberFormatException] { - sql("insert into t partition(a='ansi') values('ansi')") - }.getMessage - assert(errorMsg.contains("invalid input syntax for type numeric: ansi")) - case SQLConf.StoreAssignmentPolicy.LEGACY => - sql("insert into t partition(a='ansi') values('ansi')") - checkAnswer(sql("select * from t"), Row("ansi", null) :: Nil) - } - } + test("SPARK-33354: Throw exceptions on inserting invalid cast with ANSI casting policy") { + withSQLConf( + SQLConf.STORE_ASSIGNMENT_POLICY.key -> SQLConf.StoreAssignmentPolicy.ANSI.toString) { + withTable("t") { + sql("CREATE TABLE t(i int, t timestamp) USING parquet") + val msg = intercept[AnalysisException] { + sql("INSERT INTO t VALUES (TIMESTAMP('2010-09-02 14:10:10'), 1)") + }.getMessage + assert(msg.contains("Cannot safely cast 'i': timestamp to int")) + assert(msg.contains("Cannot safely cast 't': int to timestamp")) + } + + withTable("t") { + sql("CREATE TABLE t(i int, d date) USING parquet") + val msg = intercept[AnalysisException] { + sql("INSERT INTO t VALUES (date('2010-09-02'), 1)") + }.getMessage + assert(msg.contains("Cannot safely cast 'i': date to int")) + assert(msg.contains("Cannot safely cast 'd': int to date")) + } + + withTable("t") { + sql("CREATE TABLE t(b boolean, t timestamp) USING parquet") + val msg = intercept[AnalysisException] { + sql("INSERT INTO t VALUES (TIMESTAMP('2010-09-02 14:10:10'), true)") + }.getMessage + assert(msg.contains("Cannot safely cast 'b': timestamp to boolean")) + assert(msg.contains("Cannot safely cast 't': boolean to timestamp")) + } + + withTable("t") { + sql("CREATE TABLE t(b boolean, d date) USING parquet") + val msg = intercept[AnalysisException] { + sql("INSERT INTO t VALUES (date('2010-09-02'), true)") + }.getMessage + assert(msg.contains("Cannot safely cast 'b': date to boolean")) + assert(msg.contains("Cannot safely cast 'd': boolean to date")) } } } @@ -804,7 +824,7 @@ class InsertSuite extends DataSourceTest with SharedSparkSession { .add("s", StringType, false) val newTable = CatalogTable( identifier = TableIdentifier("test_table", None), - tableType = CatalogTableType.EXTERNAL, + tableType = CatalogTableType.MANAGED, storage = CatalogStorageFormat( locationUri = None, inputFormat = None, @@ -826,21 +846,29 @@ class InsertSuite extends DataSourceTest with SharedSparkSession { } test("Stop task set if FileAlreadyExistsException was thrown") { - withSQLConf("fs.file.impl" -> classOf[FileExistingTestFileSystem].getName, - "fs.file.impl.disable.cache" -> "true") { - withTable("t") { - sql( - """ - |CREATE TABLE t(i INT, part1 INT) USING PARQUET - |PARTITIONED BY (part1) + Seq(true, false).foreach { fastFail => + withSQLConf("fs.file.impl" -> classOf[FileExistingTestFileSystem].getName, + "fs.file.impl.disable.cache" -> "true", + SQLConf.FASTFAIL_ON_FILEFORMAT_OUTPUT.key -> fastFail.toString) { + withTable("t") { + sql( + """ + |CREATE TABLE t(i INT, part1 INT) USING PARQUET + |PARTITIONED BY (part1) """.stripMargin) - val df = Seq((1, 1)).toDF("i", "part1") - val err = intercept[SparkException] { - df.write.mode("overwrite").format("parquet").insertInto("t") + val df = Seq((1, 1)).toDF("i", "part1") + val err = intercept[SparkException] { + df.write.mode("overwrite").format("parquet").insertInto("t") + } + + if (fastFail) { + assert(err.getCause.getMessage.contains("can not write to output file: " + + "org.apache.hadoop.fs.FileAlreadyExistsException")) + } else { + assert(err.getCause.getMessage.contains("Task failed while writing rows")) + } } - assert(err.getCause.getMessage.contains("can not write to output file: " + - "org.apache.hadoop.fs.FileAlreadyExistsException")) } } } @@ -866,6 +894,62 @@ class InsertSuite extends DataSourceTest with SharedSparkSession { }.getMessage assert(message.contains("LOCAL is supported only with file: scheme")) } + + test("SPARK-32508 " + + "Disallow empty part col values in partition spec before static partition writing") { + withTable("insertTable") { + sql( + """ + |CREATE TABLE insertTable(i int, part1 string, part2 string) USING PARQUET + |PARTITIONED BY (part1, part2) + """.stripMargin) + val msg = "Partition spec is invalid" + assert(intercept[AnalysisException] { + sql("INSERT INTO TABLE insertTable PARTITION(part1=1, part2='') SELECT 1") + }.getMessage.contains(msg)) + assert(intercept[AnalysisException] { + sql("INSERT INTO TABLE insertTable PARTITION(part1='', part2) SELECT 1 ,'' AS part2") + }.getMessage.contains(msg)) + + sql("INSERT INTO TABLE insertTable PARTITION(part1='1', part2='2') SELECT 1") + sql("INSERT INTO TABLE insertTable PARTITION(part1='1', part2) SELECT 1 ,'2' AS part2") + sql("INSERT INTO TABLE insertTable PARTITION(part1='1', part2) SELECT 1 ,'' AS part2") + } + } + + test("SPARK-33294: Add query resolved check before analyze InsertIntoDir") { + withTempPath { path => + val msg = intercept[AnalysisException] { + sql( + s""" + |INSERT OVERWRITE DIRECTORY '${path.getAbsolutePath}' USING PARQUET + |SELECT * FROM ( + | SELECT c3 FROM ( + | SELECT c1, c2 from values(1,2) t(c1, c2) + | ) + |) + """.stripMargin) + }.getMessage + assert(msg.contains("cannot resolve 'c3' given input columns")) + } + } + + test("SPARK-34926: PartitioningUtils.getPathFragment() should respect partition value is null") { + withTable("t1", "t2") { + sql("CREATE TABLE t1(id INT) USING PARQUET") + sql( + """ + |CREATE TABLE t2 (c1 INT, part STRING) + | USING parquet + |PARTITIONED BY (part) + |""".stripMargin) + sql( + """ + |INSERT INTO TABLE t2 PARTITION (part = null) + |SELECT * FROM t1 where 1=0""".stripMargin) + checkAnswer(spark.table("t2"), Nil) + } + } } class FileExistingTestFileSystem extends RawLocalFileSystem { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/PartitionedWriteSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/PartitionedWriteSuite.scala index 1c4e2a967b0a2..b9266429f81a5 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/sources/PartitionedWriteSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/PartitionedWriteSuite.scala @@ -20,11 +20,12 @@ package org.apache.spark.sql.sources import java.io.File import java.sql.Timestamp -import org.apache.hadoop.mapreduce.TaskAttemptContext +import org.apache.hadoop.fs.Path +import org.apache.hadoop.mapreduce.{JobContext, TaskAttemptContext} import org.apache.spark.TestUtils import org.apache.spark.internal.Logging -import org.apache.spark.sql.{QueryTest, Row} +import org.apache.spark.sql.{AnalysisException, QueryTest, Row} import org.apache.spark.sql.catalyst.catalog.ExternalCatalogUtils import org.apache.spark.sql.catalyst.util.DateTimeUtils import org.apache.spark.sql.execution.datasources.SQLHadoopMapReduceCommitProtocol @@ -156,4 +157,56 @@ class PartitionedWriteSuite extends QueryTest with SharedSparkSession { } } } + + test("SPARK-31968: duplicate partition columns check") { + withTempPath { f => + val e = intercept[AnalysisException]( + Seq((3, 2)).toDF("a", "b").write.partitionBy("b", "b").csv(f.getAbsolutePath)) + assert(e.getMessage.contains("Found duplicate column(s) b, b: `b`")) + } + } + + test("SPARK-27194 SPARK-29302: Fix commit collision in dynamic partition overwrite mode") { + withSQLConf(SQLConf.PARTITION_OVERWRITE_MODE.key -> + SQLConf.PartitionOverwriteMode.DYNAMIC.toString, + SQLConf.FILE_COMMIT_PROTOCOL_CLASS.key -> + classOf[PartitionFileExistCommitProtocol].getName) { + withTempDir { d => + withTable("t") { + sql( + s""" + | create table t(c1 int, p1 int) using parquet partitioned by (p1) + | location '${d.getAbsolutePath}' + """.stripMargin) + + val df = Seq((1, 2)).toDF("c1", "p1") + df.write + .partitionBy("p1") + .mode("overwrite") + .saveAsTable("t") + checkAnswer(sql("select * from t"), df) + } + } + } + } +} + +/** + * A file commit protocol with pre-created partition file. when try to overwrite partition dir + * in dynamic partition mode, FileAlreadyExist exception would raise without SPARK-27194 + */ +private class PartitionFileExistCommitProtocol( + jobId: String, + path: String, + dynamicPartitionOverwrite: Boolean) + extends SQLHadoopMapReduceCommitProtocol(jobId, path, dynamicPartitionOverwrite) { + override def setupJob(jobContext: JobContext): Unit = { + super.setupJob(jobContext) + val stagingDir = new File(new Path(path).toUri.getPath, s".spark-staging-$jobId") + stagingDir.mkdirs() + val stagingPartDir = new File(stagingDir, "p1=2") + stagingPartDir.mkdirs() + val conflictTaskFile = new File(stagingPartDir, s"part-00000-$jobId.c000.snappy.parquet") + conflictTaskFile.createNewFile() + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/PathOptionSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/PathOptionSuite.scala index 9b26a5659df49..48d717daf00d4 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/sources/PathOptionSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/PathOptionSuite.scala @@ -19,8 +19,6 @@ package org.apache.spark.sql.sources import java.net.URI -import org.apache.hadoop.fs.Path - import org.apache.spark.sql.{DataFrame, SaveMode, SparkSession, SQLContext} import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.catalog.CatalogUtils diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/ResolvedDataSourceSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/ResolvedDataSourceSuite.scala index 36fb418b09cb6..818a66eb436cc 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/sources/ResolvedDataSourceSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/ResolvedDataSourceSuite.scala @@ -17,6 +17,8 @@ package org.apache.spark.sql.sources +import java.time.ZoneId + import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.catalyst.util.DateTimeUtils import org.apache.spark.sql.execution.datasources.DataSource @@ -27,7 +29,7 @@ class ResolvedDataSourceSuite extends SharedSparkSession { DataSource( sparkSession = spark, className = name, - options = Map(DateTimeUtils.TIMEZONE_OPTION -> DateTimeUtils.defaultTimeZone().getID) + options = Map(DateTimeUtils.TIMEZONE_OPTION -> ZoneId.systemDefault().getId) ).providingClass test("jdbc") { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/sources/TableScanSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/sources/TableScanSuite.scala index 9a95bf770772e..de54b38627443 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/sources/TableScanSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/sources/TableScanSuite.scala @@ -22,6 +22,7 @@ import java.sql.{Date, Timestamp} import org.apache.spark.rdd.RDD import org.apache.spark.sql._ +import org.apache.spark.sql.catalyst.util.CharVarcharUtils import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types._ @@ -206,10 +207,6 @@ class TableScanSuite extends DataSourceTest with SharedSparkSession { (2 to 10).map(i => Row(i, i - 1)).toSeq) test("Schema and all fields") { - def hiveMetadata(dt: String): Metadata = { - new MetadataBuilder().putString(HIVE_TYPE_STRING, dt).build() - } - val expectedSchema = StructType( StructField("string$%Field", StringType, true) :: StructField("binaryField", BinaryType, true) :: @@ -224,8 +221,8 @@ class TableScanSuite extends DataSourceTest with SharedSparkSession { StructField("decimalField2", DecimalType(9, 2), true) :: StructField("dateField", DateType, true) :: StructField("timestampField", TimestampType, true) :: - StructField("varcharField", StringType, true, hiveMetadata("varchar(12)")) :: - StructField("charField", StringType, true, hiveMetadata("char(18)")) :: + StructField("varcharField", VarcharType(12), true) :: + StructField("charField", CharType(18), true) :: StructField("arrayFieldSimple", ArrayType(IntegerType), true) :: StructField("arrayFieldComplex", ArrayType( @@ -248,7 +245,8 @@ class TableScanSuite extends DataSourceTest with SharedSparkSession { Nil ) - assert(expectedSchema == spark.table("tableWithSchema").schema) + assert(CharVarcharUtils.replaceCharVarcharWithStringInSchema(expectedSchema) == + spark.table("tableWithSchema").schema) withSQLConf(SQLConf.SUPPORT_QUOTED_REGEX_COLUMN_NAME.key -> "false") { checkAnswer( @@ -361,7 +359,7 @@ class TableScanSuite extends DataSourceTest with SharedSparkSession { val schemaNotMatch = intercept[Exception] { sql( s""" - |CREATE $tableType relationProvierWithSchema (i int) + |CREATE $tableType relationProviderWithSchema (i int) |USING org.apache.spark.sql.sources.SimpleScanSource |OPTIONS ( | From '1', @@ -375,7 +373,7 @@ class TableScanSuite extends DataSourceTest with SharedSparkSession { val schemaNeeded = intercept[Exception] { sql( s""" - |CREATE $tableType schemaRelationProvierWithoutSchema + |CREATE $tableType schemaRelationProviderWithoutSchema |USING org.apache.spark.sql.sources.AllDataTypesScanSource |OPTIONS ( | From '1', @@ -389,7 +387,7 @@ class TableScanSuite extends DataSourceTest with SharedSparkSession { test("read the data source tables that do not extend SchemaRelationProvider") { Seq("TEMPORARY VIEW", "TABLE").foreach { tableType => - val tableName = "relationProvierWithSchema" + val tableName = "relationProviderWithSchema" withTable (tableName) { sql( s""" diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/EventTimeWatermarkSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/EventTimeWatermarkSuite.scala index 6486e1aee8649..67ab72a79145e 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/EventTimeWatermarkSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/EventTimeWatermarkSuite.scala @@ -24,7 +24,9 @@ import java.util.{Calendar, Date, Locale} import java.util.concurrent.TimeUnit._ import org.apache.commons.io.FileUtils -import org.scalatest.{BeforeAndAfter, Matchers} +import org.scalatest.BeforeAndAfter +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.internal.Logging import org.apache.spark.sql.{AnalysisException, Dataset} @@ -32,7 +34,7 @@ import org.apache.spark.sql.catalyst.plans.logical.EventTimeWatermark import org.apache.spark.sql.catalyst.util.DateTimeTestUtils.UTC import org.apache.spark.sql.execution.streaming._ import org.apache.spark.sql.execution.streaming.sources.MemorySink -import org.apache.spark.sql.functions.{count, window} +import org.apache.spark.sql.functions.{count, timestamp_seconds, window} import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.streaming.OutputMode._ import org.apache.spark.util.Utils @@ -129,7 +131,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche // No event time metrics when there is no watermarking val inputData1 = MemoryStream[Int] val aggWithoutWatermark = inputData1.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) .select($"window".getField("start").cast("long").as[Long], $"count".as[Long]) @@ -146,7 +148,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche // All event time metrics where watermarking is set val inputData2 = MemoryStream[Int] val aggWithWatermark = inputData2.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -169,7 +171,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche // All event time metrics where watermarking is set val inputData = MemoryStream[Int] val aggWithWatermark = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -224,7 +226,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche // All event time metrics where watermarking is set val inputData = MemoryStream[Int] val aggWithWatermark = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -286,7 +288,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche val inputData = MemoryStream[Int] val windowedAggregation = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -298,9 +300,11 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche AddData(inputData, 25), // Advance watermark to 15 seconds CheckNewAnswer((10, 5)), assertNumStateRows(2), + assertNumRowsDroppedByWatermark(0), AddData(inputData, 10), // Should not emit anything as data less than watermark CheckNewAnswer(), - assertNumStateRows(2) + assertNumStateRows(2), + assertNumRowsDroppedByWatermark(1) ) } @@ -309,7 +313,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche spark.conf.set(SQLConf.SHUFFLE_PARTITIONS.key, "10") val windowedAggregation = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -321,12 +325,15 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche AddData(inputData, 25), // Advance watermark to 15 seconds CheckNewAnswer((25, 1)), assertNumStateRows(2), + assertNumRowsDroppedByWatermark(0), AddData(inputData, 10, 25), // Ignore 10 as its less than watermark CheckNewAnswer((25, 2)), assertNumStateRows(2), + assertNumRowsDroppedByWatermark(1), AddData(inputData, 10), // Should not emit anything as data less than watermark CheckNewAnswer(), - assertNumStateRows(2) + assertNumStateRows(2), + assertNumRowsDroppedByWatermark(1) ) } @@ -336,7 +343,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche val input = MemoryStream[Long] val aggWithWatermark = input.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "2 years 5 months") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -368,7 +375,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche test("recovery") { val inputData = MemoryStream[Int] val df = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -403,14 +410,14 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche val first = MemoryStream[Int] val firstDf = first.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .select('value) val second = MemoryStream[Int] val secondDf = second.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "5 seconds") .select('value) @@ -480,7 +487,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche val inputData = MemoryStream[Int] val windowedAggregation = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -505,7 +512,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche val inputData = MemoryStream[Int] val windowedAggregation = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy($"eventTime") .agg(count("*") as 'count) @@ -544,8 +551,8 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche test("the new watermark should override the old one") { val df = MemoryStream[(Long, Long)].toDF() - .withColumn("first", $"_1".cast("timestamp")) - .withColumn("second", $"_2".cast("timestamp")) + .withColumn("first", timestamp_seconds($"_1")) + .withColumn("second", timestamp_seconds($"_2")) .withWatermark("first", "1 minute") .withWatermark("second", "2 minutes") @@ -557,7 +564,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche test("EventTime watermark should be ignored in batch query.") { val df = testData - .withColumn("eventTime", $"key".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"key")) .withWatermark("eventTime", "1 minute") .select("eventTime") .as[Long] @@ -596,7 +603,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche test("SPARK-27340 Alias on TimeWindow expression cause watermark metadata lost") { val inputData = MemoryStream[Int] val aliasWindow = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .select(window($"eventTime", "5 seconds") as 'aliasWindow) // Check the eventTime metadata is kept in the top level alias. @@ -626,7 +633,7 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche def testWithFlag(flag: Boolean): Unit = withClue(s"with $flagKey = $flag") { val inputData = MemoryStream[Int] val windowedAggregation = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -762,10 +769,10 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche input1: MemoryStream[Int], input2: MemoryStream[Int]): Dataset[_] = { val df1 = input1.toDF - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") val df2 = input2.toDF - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "15 seconds") df1.union(df2).select($"eventTime".cast("int")) } @@ -783,6 +790,20 @@ class EventTimeWatermarkSuite extends StreamTest with BeforeAndAfter with Matche true } + private def assertNumRowsDroppedByWatermark( + numRowsDroppedByWatermark: Long): AssertOnQuery = AssertOnQuery { q => + q.processAllAvailable() + val progressWithData = q.recentProgress.filterNot { p => + // filter out batches which are falling into one of types: + // 1) doesn't execute the batch run + // 2) empty input batch + p.inputRowsPerSecond == 0 + }.lastOption.get + assert(progressWithData.stateOperators(0).numRowsDroppedByWatermark + === numRowsDroppedByWatermark) + true + } + /** Assert event stats generated on that last batch with data in it */ private def assertEventStats(body: ju.Map[String, String] => Unit): AssertOnQuery = { Execute("AssertEventStats") { q => diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSinkSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSinkSuite.scala index 877965100f018..53ef832063230 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSinkSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSinkSuite.scala @@ -17,17 +17,18 @@ package org.apache.spark.sql.streaming -import java.io.File +import java.io.{File, IOException} import java.nio.file.Files import java.util.Locale import scala.collection.JavaConverters._ import scala.collection.mutable.ArrayBuffer -import org.apache.hadoop.fs.Path +import org.apache.hadoop.fs.{FileStatus, Path, RawLocalFileSystem} import org.apache.hadoop.mapreduce.JobContext import org.apache.spark.SparkConf +import org.apache.spark.deploy.SparkHadoopUtil import org.apache.spark.internal.io.FileCommitProtocol import org.apache.spark.scheduler.{SparkListener, SparkListenerTaskEnd} import org.apache.spark.sql.{AnalysisException, DataFrame} @@ -210,7 +211,7 @@ abstract class FileStreamSinkSuite extends StreamTest { val inputData = MemoryStream[Long] val inputDF = inputData.toDF.toDF("time") val outputDf = inputDF - .selectExpr("CAST(time AS timestamp) AS timestamp") + .selectExpr("timestamp_seconds(time) AS timestamp") .withWatermark("timestamp", "10 seconds") .groupBy(window($"timestamp", "5 seconds")) .count() @@ -555,10 +556,12 @@ abstract class FileStreamSinkSuite extends StreamTest { } } - val fs = new Path(outputDir.getCanonicalPath).getFileSystem( - spark.sessionState.newHadoopConf()) - val sinkLog = new FileStreamSinkLog(FileStreamSinkLog.VERSION, spark, - outputDir.getCanonicalPath) + val outputDirPath = new Path(outputDir.getCanonicalPath) + val hadoopConf = spark.sessionState.newHadoopConf() + val fs = outputDirPath.getFileSystem(hadoopConf) + val logPath = FileStreamSink.getMetadataLogPath(fs, outputDirPath, conf) + + val sinkLog = new FileStreamSinkLog(FileStreamSinkLog.VERSION, spark, logPath.toString) val allFiles = sinkLog.allFiles() // only files from non-empty partition should be logged @@ -573,6 +576,30 @@ abstract class FileStreamSinkSuite extends StreamTest { } } } + + test("formatCheck fail should not fail the query") { + withSQLConf( + "fs.file.impl" -> classOf[FailFormatCheckFileSystem].getName, + "fs.file.impl.disable.cache" -> "true") { + withTempDir { tempDir => + val path = new File(tempDir, "text").getCanonicalPath + Seq("foo").toDF.write.format("text").save(path) + spark.read.format("text").load(path) + } + } + } + + test("fail to check glob path should not fail the query") { + withSQLConf( + "fs.file.impl" -> classOf[FailFormatCheckFileSystem].getName, + "fs.file.impl.disable.cache" -> "true") { + withTempDir { tempDir => + val path = new File(tempDir, "text").getCanonicalPath + Seq("foo").toDF.write.format("text").save(path) + spark.read.format("text").load(path + "/*") + } + } + } } object PendingCommitFilesTrackingManifestFileCommitProtocol { @@ -683,3 +710,19 @@ class FileStreamSinkV2Suite extends FileStreamSinkSuite { // TODO: test partition pruning when file source V2 supports it. } } + +/** + * A special file system that fails when accessing metadata log directory or using a glob path to + * access. + */ +class FailFormatCheckFileSystem extends RawLocalFileSystem { + override def getFileStatus(f: Path): FileStatus = { + if (f.getName == FileStreamSink.metadataDir) { + throw new IOException("cannot access metadata log") + } + if (SparkHadoopUtil.get.isGlobPath(f)) { + throw new IOException("fail to access a glob path") + } + super.getFileStatus(f) + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSourceSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSourceSuite.scala index fa320333143ec..ff00c474e2ef0 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSourceSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/FileStreamSourceSuite.scala @@ -19,6 +19,9 @@ package org.apache.spark.sql.streaming import java.io.File import java.net.URI +import java.time.{LocalDateTime, ZoneOffset} +import java.time.format.DateTimeFormatter +import java.util.concurrent.atomic.AtomicLong import scala.collection.mutable import scala.util.Random @@ -32,14 +35,13 @@ import org.scalatest.time.SpanSugar._ import org.apache.spark.deploy.SparkHadoopUtil import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.util._ +import org.apache.spark.sql.connector.read.streaming.ReadLimit import org.apache.spark.sql.execution.streaming._ import org.apache.spark.sql.execution.streaming.FileStreamSource.{FileEntry, SeenFilesMap, SourceFileArchiver} import org.apache.spark.sql.execution.streaming.sources.MemorySink import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.sql.streaming.ExistsThrowsExceptionFileSystem._ import org.apache.spark.sql.streaming.util.StreamManualClock import org.apache.spark.sql.test.SharedSparkSession -import org.apache.spark.sql.types._ import org.apache.spark.sql.types.{StructType, _} import org.apache.spark.util.Utils @@ -411,7 +413,7 @@ class FileStreamSourceSuite extends FileStreamSourceTest { createFileStreamSourceAndGetSchema( format = Some("json"), path = Some(src.getCanonicalPath), schema = None) } - assert("Unable to infer schema for JSON. It must be specified manually.;" === e.getMessage) + assert("Unable to infer schema for JSON. It must be specified manually." === e.getMessage) } } } @@ -532,6 +534,18 @@ class FileStreamSourceSuite extends FileStreamSourceTest { } } + test("SPARK-31935: Hadoop file system config should be effective in data source options") { + withTempDir { dir => + val path = dir.getCanonicalPath + val defaultFs = "nonexistFS://nonexistFS" + val expectMessage = "No FileSystem for scheme nonexistFS" + val message = intercept[java.io.IOException] { + spark.readStream.option("fs.defaultFS", defaultFs).text(path) + }.getMessage + assert(message.filterNot(Set(':', '"').contains) == expectMessage) + } + } + test("read from textfile") { withTempDirs { case (src, tmp) => val textStream = spark.readStream.textFile(src.getCanonicalPath) @@ -997,15 +1011,6 @@ class FileStreamSourceSuite extends FileStreamSourceTest { } test("when schema inference is turned on, should read partition data") { - def createFile(content: String, src: File, tmp: File): Unit = { - val tempFile = Utils.tempFileWith(new File(tmp, "text")) - val finalFile = new File(src, tempFile.getName) - require(!src.exists(), s"$src exists, dir: ${src.isDirectory}, file: ${src.isFile}") - require(src.mkdirs(), s"Cannot create $src") - require(src.isDirectory(), s"$src is not a directory") - require(stringToFile(tempFile, content).renameTo(finalFile)) - } - withSQLConf(SQLConf.STREAMING_SCHEMA_INFERENCE.key -> "true") { withTempDirs { case (dir, tmp) => val partitionFooSubDir = new File(dir, "partition=foo") @@ -1371,6 +1376,70 @@ class FileStreamSourceSuite extends FileStreamSourceTest { } } + test("restore from file stream source log") { + def createEntries(batchId: Long, count: Int): Array[FileEntry] = { + (1 to count).map { idx => + FileEntry(s"path_${batchId}_$idx", 10000 * batchId + count, batchId) + }.toArray + } + + withSQLConf(SQLConf.FILE_SOURCE_LOG_COMPACT_INTERVAL.key -> "5") { + def verifyBatchAvailabilityInCache( + fileEntryCache: java.util.LinkedHashMap[Long, Array[FileEntry]], + expectNotAvailable: Seq[Int], + expectAvailable: Seq[Int]): Unit = { + expectNotAvailable.foreach { batchId => + assert(!fileEntryCache.containsKey(batchId.toLong)) + } + expectAvailable.foreach { batchId => + assert(fileEntryCache.containsKey(batchId.toLong)) + } + } + withTempDir { chk => + val _fileEntryCache = PrivateMethod[java.util.LinkedHashMap[Long, Array[FileEntry]]]( + Symbol("fileEntryCache")) + + val metadata = new FileStreamSourceLog(FileStreamSourceLog.VERSION, spark, + chk.getCanonicalPath) + val fileEntryCache = metadata invokePrivate _fileEntryCache() + + (0 to 4).foreach { batchId => + metadata.add(batchId, createEntries(batchId, 100)) + } + val allFiles = metadata.allFiles() + + // batch 4 is a compact batch which logs would be cached in fileEntryCache + verifyBatchAvailabilityInCache(fileEntryCache, Seq(0, 1, 2, 3), Seq(4)) + + val metadata2 = new FileStreamSourceLog(FileStreamSourceLog.VERSION, spark, + chk.getCanonicalPath) + val fileEntryCache2 = metadata2 invokePrivate _fileEntryCache() + + // allFiles() doesn't restore the logs for the latest compact batch into file entry cache + assert(metadata2.allFiles() === allFiles) + verifyBatchAvailabilityInCache(fileEntryCache2, Seq(0, 1, 2, 3, 4), Seq.empty) + + // restore() will restore the logs for the latest compact batch into file entry cache + assert(metadata2.restore() === allFiles) + verifyBatchAvailabilityInCache(fileEntryCache2, Seq(0, 1, 2, 3), Seq(4)) + + (5 to 5 + FileStreamSourceLog.PREV_NUM_BATCHES_TO_READ_IN_RESTORE).foreach { batchId => + metadata2.add(batchId, createEntries(batchId, 100)) + } + + val metadata3 = new FileStreamSourceLog(FileStreamSourceLog.VERSION, spark, + chk.getCanonicalPath) + val fileEntryCache3 = metadata3 invokePrivate _fileEntryCache() + + // restore() will not restore the logs for the latest compact batch into file entry cache + // if the latest batch is too far from latest compact batch, because it's unlikely Spark + // will request the batch for the start point. + assert(metadata3.restore() === metadata2.allFiles()) + verifyBatchAvailabilityInCache(fileEntryCache3, Seq(0, 1, 2, 3, 4), Seq.empty) + } + } + } + test("get arbitrary batch from FileStreamSource") { withTempDirs { case (src, tmp) => withSQLConf( @@ -1463,8 +1532,10 @@ class FileStreamSourceSuite extends FileStreamSourceTest { private def readOffsetFromResource(file: String): SerializedOffset = { import scala.io.Source - val str = Source.fromFile(getClass.getResource(s"/structured-streaming/$file").toURI).mkString - SerializedOffset(str.trim) + Utils.tryWithResource( + Source.fromFile(getClass.getResource(s"/structured-streaming/$file").toURI)) { source => + SerializedOffset(source.mkString.trim) + } } private def runTwoBatchesAndVerifyResults( @@ -1602,6 +1673,7 @@ class FileStreamSourceSuite extends FileStreamSourceTest { } test("do not recheck that files exist during getBatch") { + val scheme = ExistsThrowsExceptionFileSystem.scheme withTempDir { temp => spark.conf.set( s"fs.$scheme.impl", @@ -1876,9 +1948,9 @@ class FileStreamSourceSuite extends FileStreamSourceTest { test("SourceFileArchiver - fail when base archive path matches source pattern") { val fakeFileSystem = new FakeFileSystem("fake") - def assertThrowIllegalArgumentException(sourcePatttern: Path, baseArchivePath: Path): Unit = { + def assertThrowIllegalArgumentException(sourcePattern: Path, baseArchivePath: Path): Unit = { intercept[IllegalArgumentException] { - new SourceFileArchiver(fakeFileSystem, sourcePatttern, fakeFileSystem, baseArchivePath) + new SourceFileArchiver(fakeFileSystem, sourcePattern, fakeFileSystem, baseArchivePath) } } @@ -1935,6 +2007,170 @@ class FileStreamSourceSuite extends FileStreamSourceTest { assert(expectedDir.exists()) assert(expectedDir.list().exists(_.startsWith(filePrefix))) } + + private def withCountListingLocalFileSystemAsLocalFileSystem(body: => Unit): Unit = { + val optionKey = s"fs.${CountListingLocalFileSystem.scheme}.impl" + val originClassForLocalFileSystem = spark.conf.getOption(optionKey) + try { + spark.conf.set(optionKey, classOf[CountListingLocalFileSystem].getName) + body + } finally { + originClassForLocalFileSystem match { + case Some(fsClazz) => spark.conf.set(optionKey, fsClazz) + case _ => spark.conf.unset(optionKey) + } + } + } + + test("Caches and leverages unread files") { + withCountListingLocalFileSystemAsLocalFileSystem { + withThreeTempDirs { case (src, meta, tmp) => + val options = Map("latestFirst" -> "false", "maxFilesPerTrigger" -> "10") + val scheme = CountListingLocalFileSystem.scheme + val source = new FileStreamSource(spark, s"$scheme:///${src.getCanonicalPath}/*/*", "text", + StructType(Nil), Seq.empty, meta.getCanonicalPath, options) + val _metadataLog = PrivateMethod[FileStreamSourceLog](Symbol("metadataLog")) + val metadataLog = source invokePrivate _metadataLog() + + def verifyBatch( + offset: FileStreamSourceOffset, + expectedBatchId: Long, + inputFiles: Seq[File], + expectedListingCount: Int): Unit = { + val batchId = offset.logOffset + assert(batchId === expectedBatchId) + + val files = metadataLog.get(batchId).getOrElse(Array.empty[FileEntry]) + assert(files.forall(_.batchId == batchId)) + + val actualInputFiles = files.map { p => new Path(p.path).toUri.getPath } + val expectedInputFiles = inputFiles.slice(batchId.toInt * 10, batchId.toInt * 10 + 10) + .map(_.getCanonicalPath) + assert(actualInputFiles === expectedInputFiles) + + assert(expectedListingCount === CountListingLocalFileSystem.pathToNumListStatusCalled + .get(src.getCanonicalPath).map(_.get()).getOrElse(0)) + } + + CountListingLocalFileSystem.resetCount() + + // provide 41 files in src, with sequential "last modified" to guarantee ordering + val inputFiles = (0 to 40).map { idx => + val f = createFile(idx.toString, new File(src, idx.toString), tmp) + f.setLastModified(idx * 10000) + f + } + + // 4 batches will be available for 40 input files + (0 to 3).foreach { batchId => + val offsetBatch = source.latestOffset(FileStreamSourceOffset(-1L), ReadLimit.maxFiles(10)) + .asInstanceOf[FileStreamSourceOffset] + verifyBatch(offsetBatch, expectedBatchId = batchId, inputFiles, expectedListingCount = 1) + } + + // batch 5 will trigger list operation though the batch 4 should have 1 unseen file: + // 1 is smaller than the threshold (refer FileStreamSource.DISCARD_UNSEEN_FILES_RATIO), + // hence unseen files for batch 4 will be discarded. + val offsetBatch = source.latestOffset(FileStreamSourceOffset(-1L), ReadLimit.maxFiles(10)) + .asInstanceOf[FileStreamSourceOffset] + assert(4 === offsetBatch.logOffset) + assert(2 === CountListingLocalFileSystem.pathToNumListStatusCalled + .get(src.getCanonicalPath).map(_.get()).getOrElse(0)) + + val offsetBatch2 = source.latestOffset(FileStreamSourceOffset(-1L), ReadLimit.maxFiles(10)) + .asInstanceOf[FileStreamSourceOffset] + // latestOffset returns the offset for previous batch which means no new batch is presented + assert(4 === offsetBatch2.logOffset) + // listing should be performed after the list of unread files are exhausted + assert(3 === CountListingLocalFileSystem.pathToNumListStatusCalled + .get(src.getCanonicalPath).map(_.get()).getOrElse(0)) + } + } + } + + test("Don't cache unread files when latestFirst is true") { + withCountListingLocalFileSystemAsLocalFileSystem { + withThreeTempDirs { case (src, meta, tmp) => + val options = Map("latestFirst" -> "true", "maxFilesPerTrigger" -> "5") + val scheme = CountListingLocalFileSystem.scheme + val source = new FileStreamSource(spark, s"$scheme:///${src.getCanonicalPath}/*/*", "text", + StructType(Nil), Seq.empty, meta.getCanonicalPath, options) + + CountListingLocalFileSystem.resetCount() + + // provide 20 files in src, with sequential "last modified" to guarantee ordering + (0 to 19).map { idx => + val f = createFile(idx.toString, new File(src, idx.toString), tmp) + f.setLastModified(idx * 10000) + f + } + + source.latestOffset(FileStreamSourceOffset(-1L), ReadLimit.maxFiles(5)) + .asInstanceOf[FileStreamSourceOffset] + assert(1 === CountListingLocalFileSystem.pathToNumListStatusCalled + .get(src.getCanonicalPath).map(_.get()).getOrElse(0)) + + // Even though the first batch doesn't read all available files, since latestFirst is true, + // file stream source will not leverage unread files - next batch will also trigger + // listing files + source.latestOffset(FileStreamSourceOffset(-1L), ReadLimit.maxFiles(5)) + .asInstanceOf[FileStreamSourceOffset] + assert(2 === CountListingLocalFileSystem.pathToNumListStatusCalled + .get(src.getCanonicalPath).map(_.get()).getOrElse(0)) + } + } + } + + test("SPARK-31962: file stream source shouldn't allow modifiedBefore/modifiedAfter") { + def formatTime(time: LocalDateTime): String = { + time.format(DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss")) + } + + def assertOptionIsNotSupported(options: Map[String, String], path: String): Unit = { + val schema = StructType(Seq(StructField("a", StringType))) + var dsReader = spark.readStream + .format("csv") + .option("timeZone", "UTC") + .schema(schema) + + options.foreach { case (k, v) => dsReader = dsReader.option(k, v) } + + val df = dsReader.load(path) + + testStream(df)( + ExpectFailure[IllegalArgumentException]( + t => assert(t.getMessage.contains("is not allowed in file stream source")), + isFatalError = false) + ) + } + + withTempDir { dir => + // "modifiedBefore" + val futureTime = LocalDateTime.now(ZoneOffset.UTC).plusYears(1) + val formattedFutureTime = formatTime(futureTime) + assertOptionIsNotSupported(Map("modifiedBefore" -> formattedFutureTime), dir.getCanonicalPath) + + // "modifiedAfter" + val prevTime = LocalDateTime.now(ZoneOffset.UTC).minusYears(1) + val formattedPrevTime = formatTime(prevTime) + assertOptionIsNotSupported(Map("modifiedAfter" -> formattedPrevTime), dir.getCanonicalPath) + + // both + assertOptionIsNotSupported( + Map("modifiedBefore" -> formattedFutureTime, "modifiedAfter" -> formattedPrevTime), + dir.getCanonicalPath) + } + } + + private def createFile(content: String, src: File, tmp: File): File = { + val tempFile = Utils.tempFileWith(new File(tmp, "text")) + val finalFile = new File(src, tempFile.getName) + require(!src.exists(), s"$src exists, dir: ${src.isDirectory}, file: ${src.isFile}") + require(src.mkdirs(), s"Cannot create $src") + require(src.isDirectory(), s"$src is not a directory") + require(stringToFile(tempFile, content).renameTo(finalFile)) + finalFile + } } class FileStreamSourceStressTestSuite extends FileStreamSourceTest { @@ -1961,6 +2197,8 @@ class FileStreamSourceStressTestSuite extends FileStreamSourceTest { * `DataSource.resolveRelation`. */ class ExistsThrowsExceptionFileSystem extends RawLocalFileSystem { + import ExistsThrowsExceptionFileSystem._ + override def getUri: URI = { URI.create(s"$scheme:///") } @@ -1980,3 +2218,24 @@ class ExistsThrowsExceptionFileSystem extends RawLocalFileSystem { object ExistsThrowsExceptionFileSystem { val scheme = s"FileStreamSourceSuite${math.abs(Random.nextInt)}fs" } + +class CountListingLocalFileSystem extends RawLocalFileSystem { + import CountListingLocalFileSystem._ + + override def getUri: URI = { + URI.create(s"$scheme:///") + } + + override def listStatus(f: Path): Array[FileStatus] = { + val curVal = pathToNumListStatusCalled.getOrElseUpdate(f.toUri.getPath, new AtomicLong(0)) + curVal.incrementAndGet() + super.listStatus(f) + } +} + +object CountListingLocalFileSystem { + val scheme = s"CountListingLocalFileSystem${math.abs(Random.nextInt)}fs" + val pathToNumListStatusCalled = new mutable.HashMap[String, AtomicLong] + + def resetCount(): Unit = pathToNumListStatusCalled.clear() +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/FlatMapGroupsWithStateSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/FlatMapGroupsWithStateSuite.scala index b04f8b0d4d174..788be539fe073 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/FlatMapGroupsWithStateSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/FlatMapGroupsWithStateSuite.scala @@ -21,12 +21,11 @@ import java.io.File import java.sql.Date import org.apache.commons.io.FileUtils -import org.scalatest.BeforeAndAfterAll import org.scalatest.exceptions.TestFailedException import org.apache.spark.SparkException import org.apache.spark.api.java.function.FlatMapGroupsWithStateFunction -import org.apache.spark.sql.Encoder +import org.apache.spark.sql.{DataFrame, Encoder} import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.{GenericInternalRow, UnsafeProjection, UnsafeRow} import org.apache.spark.sql.catalyst.plans.logical.FlatMapGroupsWithState @@ -34,7 +33,8 @@ import org.apache.spark.sql.catalyst.plans.physical.UnknownPartitioning import org.apache.spark.sql.catalyst.streaming.InternalOutputModes._ import org.apache.spark.sql.execution.RDDScanExec import org.apache.spark.sql.execution.streaming._ -import org.apache.spark.sql.execution.streaming.state.{FlatMapGroupsWithStateExecHelper, MemoryStateStore, StateStore, StateStoreId, StateStoreMetrics, UnsafeRowPair} +import org.apache.spark.sql.execution.streaming.state.{FlatMapGroupsWithStateExecHelper, MemoryStateStore, StateStore} +import org.apache.spark.sql.functions.timestamp_seconds import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.streaming.util.StreamManualClock import org.apache.spark.sql.types.{DataType, IntegerType} @@ -826,7 +826,7 @@ class FlatMapGroupsWithStateSuite extends StateStoreMetricsTest { val inputData = MemoryStream[(String, Int)] val result = inputData.toDS - .select($"_1".as("key"), $"_2".cast("timestamp").as("eventTime")) + .select($"_1".as("key"), timestamp_seconds($"_2").as("eventTime")) .withWatermark("eventTime", "10 seconds") .as[(String, Long)] .groupByKey(_._1) @@ -901,7 +901,7 @@ class FlatMapGroupsWithStateSuite extends StateStoreMetricsTest { val inputData = MemoryStream[(String, Int)] val result = inputData.toDS - .select($"_1".as("key"), $"_2".cast("timestamp").as("eventTime")) + .select($"_1".as("key"), timestamp_seconds($"_2").as("eventTime")) .withWatermark("eventTime", "10 seconds") .as[(String, Long)] .groupByKey(_._1) @@ -1019,6 +1019,56 @@ class FlatMapGroupsWithStateSuite extends StateStoreMetricsTest { spark.createDataset(Seq(("a", 2), ("b", 1))).toDF) } + testWithAllStateVersions("SPARK-29438: ensure UNION doesn't lead (flat)MapGroupsWithState" + + " to use shifted partition IDs") { + val stateFunc = (key: String, values: Iterator[String], state: GroupState[RunningCount]) => { + val count = state.getOption.map(_.count).getOrElse(0L) + values.size + state.update(RunningCount(count)) + (key, count.toString) + } + + def constructUnionDf(desiredPartitionsForInput1: Int) + : (MemoryStream[String], MemoryStream[String], DataFrame) = { + val input1 = MemoryStream[String](desiredPartitionsForInput1) + val input2 = MemoryStream[String] + val df1 = input1.toDF() + .select($"value", $"value") + val df2 = input2.toDS() + .groupByKey(x => x) + .mapGroupsWithState(stateFunc) // Types = State: MyState, Out: (Str, Str) + .toDF() + + // Unioned DF would have columns as (String, String) + (input1, input2, df1.union(df2)) + } + + withTempDir { checkpointDir => + val (input1, input2, unionDf) = constructUnionDf(2) + testStream(unionDf, Update)( + StartStream(checkpointLocation = checkpointDir.getAbsolutePath), + MultiAddData(input1, "input1-a")(input2, "input2-a"), + CheckNewAnswer(("input1-a", "input1-a"), ("input2-a", "1")), + StopStream + ) + + // We're restoring the query with different number of partitions in left side of UNION, + // which may lead right side of union to have mismatched partition IDs (e.g. if it relies on + // TaskContext.partitionId()). This test will verify (flat)MapGroupsWithState doesn't have + // such issue. + + val (newInput1, newInput2, newUnionDf) = constructUnionDf(3) + + newInput1.addData("input1-a") + newInput2.addData("input2-a") + + testStream(newUnionDf, Update)( + StartStream(checkpointLocation = checkpointDir.getAbsolutePath), + MultiAddData(newInput1, "input1-a")(newInput2, "input2-a", "input2-b"), + CheckNewAnswer(("input1-a", "input1-a"), ("input2-a", "2"), ("input2-b", "1")) + ) + } + } + testQuietly("StateStore.abort on task failure handling") { val stateFunc = (key: String, values: Iterator[String], state: GroupState[RunningCount]) => { if (FlatMapGroupsWithStateSuite.failInTask) throw new Exception("expected failure") @@ -1111,7 +1161,7 @@ class FlatMapGroupsWithStateSuite extends StateStoreMetricsTest { val inputData = MemoryStream[(String, Long)] val result = inputData.toDF().toDF("key", "time") - .selectExpr("key", "cast(time as timestamp) as timestamp") + .selectExpr("key", "timestamp_seconds(time) as timestamp") .withWatermark("timestamp", "10 second") .as[(String, Long)] .groupByKey(x => x._1) @@ -1273,7 +1323,9 @@ class FlatMapGroupsWithStateSuite extends StateStoreMetricsTest { def testWithAllStateVersions(name: String)(func: => Unit): Unit = { for (version <- FlatMapGroupsWithStateExecHelper.supportedVersions) { test(s"$name - state format version $version") { - withSQLConf(SQLConf.FLATMAPGROUPSWITHSTATE_STATE_FORMAT_VERSION.key -> version.toString) { + withSQLConf( + SQLConf.FLATMAPGROUPSWITHSTATE_STATE_FORMAT_VERSION.key -> version.toString, + SQLConf.STATEFUL_OPERATOR_CHECK_CORRECTNESS_ENABLED.key -> "false") { func } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StateStoreMetricsTest.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StateStoreMetricsTest.scala index fb5d13d09fb0e..be83f0ee776da 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StateStoreMetricsTest.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StateStoreMetricsTest.scala @@ -29,8 +29,12 @@ trait StateStoreMetricsTest extends StreamTest { lastCheckedRecentProgressIndex = -1 } - def assertNumStateRows(total: Seq[Long], updated: Seq[Long]): AssertOnQuery = - AssertOnQuery(s"Check total state rows = $total, updated state rows = $updated") { q => + def assertNumStateRows( + total: Seq[Long], + updated: Seq[Long], + droppedByWatermark: Seq[Long]): AssertOnQuery = + AssertOnQuery(s"Check total state rows = $total, updated state rows = $updated" + + s", rows dropped by watermark = $droppedByWatermark") { q => // This assumes that the streaming query will not make any progress while the eventually // is being executed. eventually(timeout(streamingTimeout)) { @@ -51,6 +55,9 @@ trait StateStoreMetricsTest extends StreamTest { val allNumUpdatedRowsSinceLastCheck = progressesSinceLastCheck.map(_.stateOperators.map(_.numRowsUpdated)) + val allNumRowsDroppedByWatermarkSinceLastCheck = + progressesSinceLastCheck.map(_.stateOperators.map(_.numRowsDroppedByWatermark)) + lazy val debugString = "recent progresses:\n" + progressesSinceLastCheck.map(_.prettyJson).mkString("\n\n") @@ -60,13 +67,27 @@ trait StateStoreMetricsTest extends StreamTest { val numUpdatedRows = arraySum(allNumUpdatedRowsSinceLastCheck, numStateOperators) assert(numUpdatedRows === updated, s"incorrect updates rows, $debugString") + val numRowsDroppedByWatermark = arraySum(allNumRowsDroppedByWatermarkSinceLastCheck, + numStateOperators) + assert(numRowsDroppedByWatermark === droppedByWatermark, + s"incorrect dropped rows by watermark, $debugString") + lastCheckedRecentProgressIndex = recentProgress.length - 1 } true } - def assertNumStateRows(total: Long, updated: Long): AssertOnQuery = - assertNumStateRows(Seq(total), Seq(updated)) + def assertNumStateRows(total: Seq[Long], updated: Seq[Long]): AssertOnQuery = { + assert(total.length === updated.length) + assertNumStateRows(total, updated, droppedByWatermark = (0 until total.length).map(_ => 0L)) + } + + def assertNumStateRows( + total: Long, + updated: Long, + droppedByWatermark: Long = 0): AssertOnQuery = { + assertNumStateRows(Seq(total), Seq(updated), Seq(droppedByWatermark)) + } def arraySum(arraySeq: Seq[Array[Long]], arrayLength: Int): Seq[Long] = { if (arraySeq.isEmpty) return Seq.fill(arrayLength)(0L) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala index bbd0220a74f88..fb6922aca19a1 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamSuite.scala @@ -19,6 +19,7 @@ package org.apache.spark.sql.streaming import java.io.{File, InterruptedIOException, IOException, UncheckedIOException} import java.nio.channels.ClosedByInterruptException +import java.time.ZoneId import java.util.concurrent.{CountDownLatch, ExecutionException, TimeUnit} import scala.concurrent.TimeoutException @@ -33,9 +34,8 @@ import org.scalatest.time.SpanSugar._ import org.apache.spark.{SparkConf, SparkContext, TaskContext, TestUtils} import org.apache.spark.scheduler.{SparkListener, SparkListenerJobStart} import org.apache.spark.sql._ -import org.apache.spark.sql.catalyst.plans.logical.Range -import org.apache.spark.sql.catalyst.streaming.InternalOutputModes -import org.apache.spark.sql.catalyst.util.DateTimeConstants.MICROS_PER_MILLIS +import org.apache.spark.sql.catalyst.plans.logical.{Range, RepartitionByExpression} +import org.apache.spark.sql.catalyst.streaming.{InternalOutputModes, StreamingRelationV2} import org.apache.spark.sql.catalyst.util.DateTimeUtils import org.apache.spark.sql.execution.{LocalLimitExec, SimpleMode, SparkPlan} import org.apache.spark.sql.execution.command.ExplainCommand @@ -46,7 +46,7 @@ import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.sources.StreamSourceProvider import org.apache.spark.sql.streaming.util.{BlockOnStopSourceProvider, StreamManualClock} -import org.apache.spark.sql.types.{IntegerType, StructField, StructType} +import org.apache.spark.sql.types.{IntegerType, LongType, StructField, StructType} import org.apache.spark.util.Utils class StreamSuite extends StreamTest { @@ -214,7 +214,9 @@ class StreamSuite extends StreamTest { .start(outputDir.getAbsolutePath) try { query.processAllAvailable() - val outputDf = spark.read.parquet(outputDir.getAbsolutePath).as[Long] + // Parquet write page-level CRC checksums will change the file size and + // affect the data order when reading these files. Please see PARQUET-1746 for details. + val outputDf = spark.read.parquet(outputDir.getAbsolutePath).sort('a).as[Long] checkDataset[Long](outputDf, (0L to 10L).toArray: _*) } finally { query.stop() @@ -1064,13 +1066,13 @@ class StreamSuite extends StreamTest { } test("SPARK-30657: streaming limit should not apply on limits on state subplans") { - val streanData = MemoryStream[Int] - val streamingDF = streanData.toDF().toDF("value") + val streamData = MemoryStream[Int] + val streamingDF = streamData.toDF().toDF("value") val staticDF = spark.createDataset(Seq(1)).toDF("value").orderBy("value") testStream(streamingDF.join(staticDF.limit(1), "value"))( - AddData(streanData, 1, 2, 3), + AddData(streamData, 1, 2, 3), CheckAnswer(Row(1)), - AddData(streanData, 1, 3, 5), + AddData(streamData, 1, 3, 5), CheckAnswer(Row(1), Row(1))) } @@ -1130,11 +1132,11 @@ class StreamSuite extends StreamTest { verifyLocalLimit(inputDF.dropDuplicates().repartition(1).limit(1), expectStreamingLimit = false) // Should be LocalLimitExec in the first place, not from optimization of StreamingLocalLimitExec - val staticDF = spark.range(1).toDF("value").limit(1) + val staticDF = spark.range(2).toDF("value").limit(1) verifyLocalLimit(inputDF.toDF("value").join(staticDF, "value"), expectStreamingLimit = false) verifyLocalLimit( - inputDF.groupBy().count().limit(1), + inputDF.groupBy("value").count().limit(1), expectStreamingLimit = false, outputMode = OutputMode.Complete()) } @@ -1219,7 +1221,8 @@ class StreamSuite extends StreamTest { } var lastTimestamp = System.currentTimeMillis() - val currentDate = DateTimeUtils.microsToDays(DateTimeUtils.millisToMicros(lastTimestamp)) + val currentDate = DateTimeUtils.microsToDays( + DateTimeUtils.millisToMicros(lastTimestamp), ZoneId.systemDefault) testStream(df) ( AddData(input, 1), CheckLastBatch { rows: Seq[Row] => @@ -1263,10 +1266,41 @@ class StreamSuite extends StreamTest { } } } + + test("SPARK-34482: correct active SparkSession for logicalPlan") { + withSQLConf( + SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "true", + SQLConf.COALESCE_PARTITIONS_INITIAL_PARTITION_NUM.key -> "10") { + val df = spark.readStream.format(classOf[FakeDefaultSource].getName).load() + var query: StreamExecution = null + try { + query = + df.repartition($"a") + .writeStream + .format("memory") + .queryName("memory") + .start() + .asInstanceOf[StreamingQueryWrapper] + .streamingQuery + query.awaitInitialization(streamingTimeout.toMillis) + val plan = query.logicalPlan + val numPartition = plan + .find { _.isInstanceOf[RepartitionByExpression] } + .map(_.asInstanceOf[RepartitionByExpression].numPartitions) + // Before the fix of SPARK-34482, the numPartition is the value of + // `COALESCE_PARTITIONS_INITIAL_PARTITION_NUM`. + assert(numPartition.get === spark.sqlContext.conf.getConf(SQLConf.SHUFFLE_PARTITIONS)) + } finally { + if (query != null) { + query.stop() + } + } + } + } } abstract class FakeSource extends StreamSourceProvider { - private val fakeSchema = StructType(StructField("a", IntegerType) :: Nil) + private val fakeSchema = StructType(StructField("a", LongType) :: Nil) override def sourceSchema( spark: SQLContext, @@ -1288,7 +1322,7 @@ class FakeDefaultSource extends FakeSource { new Source { private var offset = -1L - override def schema: StructType = StructType(StructField("a", IntegerType) :: Nil) + override def schema: StructType = StructType(StructField("a", LongType) :: Nil) override def getOffset: Option[Offset] = { if (offset >= 10) { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala index 8d5439534b513..624b630401f47 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamTest.scala @@ -19,7 +19,6 @@ package org.apache.spark.sql.streaming import scala.collection.mutable import scala.collection.mutable.ArrayBuffer -import scala.language.experimental.macros import scala.reflect.ClassTag import scala.util.Random import scala.util.control.NonFatal @@ -36,6 +35,7 @@ import org.apache.spark.sql.{Dataset, Encoder, QueryTest, Row} import org.apache.spark.sql.catalyst.encoders.{encoderFor, ExpressionEncoder, RowEncoder} import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan import org.apache.spark.sql.catalyst.plans.physical.AllTuples +import org.apache.spark.sql.catalyst.streaming.StreamingRelationV2 import org.apache.spark.sql.catalyst.util._ import org.apache.spark.sql.connector.read.streaming.{Offset => OffsetV2, SparkDataStream} import org.apache.spark.sql.execution.datasources.v2.StreamingDataSourceV2Relation @@ -305,6 +305,14 @@ trait StreamTest extends QueryTest with SharedSparkSession with TimeLimits with def apply(func: StreamExecution => Any): AssertOnQuery = apply("Execute")(func) } + /** Call `StreamingQuery.processAllAvailable()` to wait. */ + object ProcessAllAvailable { + def apply(): AssertOnQuery = AssertOnQuery { query => + query.processAllAvailable() + true + } + } + object AwaitEpoch { def apply(epoch: Long): AssertOnQuery = Execute { @@ -873,7 +881,7 @@ trait StreamTest extends QueryTest with SharedSparkSession with TimeLimits with } if(!running) { actions += StartStream() } addCheck() - testStream(ds)(actions: _*) + testStream(ds)(actions.toSeq: _*) } object AwaitTerminationTester { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingAggregationSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingAggregationSuite.scala index 85e1b85b84d26..491b0d8b2c26c 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingAggregationSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingAggregationSuite.scala @@ -20,14 +20,14 @@ package org.apache.spark.sql.streaming import java.io.File import java.util.{Locale, TimeZone} -import scala.collection.mutable +import scala.annotation.tailrec import org.apache.commons.io.FileUtils import org.scalatest.Assertions import org.apache.spark.{SparkEnv, SparkException} import org.apache.spark.rdd.BlockRDD -import org.apache.spark.sql.{AnalysisException, DataFrame, Dataset, SparkSession} +import org.apache.spark.sql.{AnalysisException, DataFrame, Dataset, Row, SparkSession} import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.plans.logical.Aggregate import org.apache.spark.sql.catalyst.util.DateTimeConstants._ @@ -35,7 +35,7 @@ import org.apache.spark.sql.execution.{SparkPlan, UnaryExecNode} import org.apache.spark.sql.execution.exchange.Exchange import org.apache.spark.sql.execution.streaming._ import org.apache.spark.sql.execution.streaming.sources.MemorySink -import org.apache.spark.sql.execution.streaming.state.StreamingAggregationStateManager +import org.apache.spark.sql.execution.streaming.state.{StateSchemaNotCompatible, StateStore, StreamingAggregationStateManager} import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.streaming.OutputMode._ @@ -188,7 +188,7 @@ class StreamingAggregationSuite extends StateStoreMetricsTest with Assertions { testWithAllStateVersions("state metrics - append mode") { val inputData = MemoryStream[Int] val aggWithWatermark = inputData.toDF() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .groupBy(window($"eventTime", "5 seconds") as 'window) .agg(count("*") as 'count) @@ -337,6 +337,49 @@ class StreamingAggregationSuite extends StateStoreMetricsTest with Assertions { ) } + testWithAllStateVersions("SPARK-29438: ensure UNION doesn't lead streaming aggregation to use" + + " shifted partition IDs") { + def constructUnionDf(desiredPartitionsForInput1: Int) + : (MemoryStream[Int], MemoryStream[Int], DataFrame) = { + val input1 = MemoryStream[Int](desiredPartitionsForInput1) + val input2 = MemoryStream[Int] + val df1 = input1.toDF() + .select($"value", $"value" + 1) + val df2 = input2.toDF() + .groupBy($"value") + .agg(count("*")) + + // Unioned DF would have columns as (Int, Int) + (input1, input2, df1.union(df2)) + } + + withTempDir { checkpointDir => + val (input1, input2, unionDf) = constructUnionDf(2) + testStream(unionDf, Update)( + StartStream(checkpointLocation = checkpointDir.getAbsolutePath), + MultiAddData(input1, 11, 12)(input2, 21, 22), + CheckNewAnswer(Row(11, 12), Row(12, 13), Row(21, 1), Row(22, 1)), + StopStream + ) + + // We're restoring the query with different number of partitions in left side of UNION, + // which may lead right side of union to have mismatched partition IDs (e.g. if it relies on + // TaskContext.partitionId()). This test will verify streaming aggregation doesn't have + // such issue. + + val (newInput1, newInput2, newUnionDf) = constructUnionDf(3) + + newInput1.addData(11, 12) + newInput2.addData(21, 22) + + testStream(newUnionDf, Update)( + StartStream(checkpointLocation = checkpointDir.getAbsolutePath), + MultiAddData(newInput1, 13, 14)(newInput2, 22, 23), + CheckNewAnswer(Row(13, 14), Row(14, 15), Row(22, 2), Row(23, 1)) + ) + } + } + testQuietlyWithAllStateVersions("midbatch failure") { val inputData = MemoryStream[Int] FailureSingleton.firstTime = true @@ -712,6 +755,89 @@ class StreamingAggregationSuite extends StateStoreMetricsTest with Assertions { ) } + testQuietlyWithAllStateVersions("changing schema of state when restarting query", + (SQLConf.STATE_STORE_FORMAT_VALIDATION_ENABLED.key, "false")) { + withTempDir { tempDir => + val (inputData, aggregated) = prepareTestForChangingSchemaOfState(tempDir) + + // if we don't have verification phase on state schema, modified query would throw NPE with + // stack trace which end users would not easily understand + + testStream(aggregated, Update())( + StartStream(checkpointLocation = tempDir.getAbsolutePath), + AddData(inputData, 21), + ExpectFailure[SparkException] { e => + val stateSchemaExc = findStateSchemaNotCompatible(e) + assert(stateSchemaExc.isDefined) + val msg = stateSchemaExc.get.getMessage + assert(msg.contains("Provided schema doesn't match to the schema for existing state")) + // other verifications are presented in StateStoreSuite + } + ) + } + } + + testQuietlyWithAllStateVersions("changing schema of state when restarting query -" + + " schema check off", + (SQLConf.STATE_SCHEMA_CHECK_ENABLED.key, "false"), + (SQLConf.STATE_STORE_FORMAT_VALIDATION_ENABLED.key, "false")) { + withTempDir { tempDir => + val (inputData, aggregated) = prepareTestForChangingSchemaOfState(tempDir) + + testStream(aggregated, Update())( + StartStream(checkpointLocation = tempDir.getAbsolutePath), + AddData(inputData, 21), + ExpectFailure[SparkException] { e => + val stateSchemaExc = findStateSchemaNotCompatible(e) + // it would bring other error in runtime, but it shouldn't check schema in any way + assert(stateSchemaExc.isEmpty) + } + ) + } + } + + private def prepareTestForChangingSchemaOfState( + tempDir: File): (MemoryStream[Int], DataFrame) = { + val inputData = MemoryStream[Int] + val aggregated = inputData.toDF() + .selectExpr("value % 10 AS id", "value") + .groupBy($"id") + .agg( + sum("value").as("sum_value"), + avg("value").as("avg_value"), + max("value").as("max_value")) + + testStream(aggregated, Update())( + StartStream(checkpointLocation = tempDir.getAbsolutePath), + AddData(inputData, 1, 11), + CheckLastBatch((1L, 12L, 6.0, 11)), + StopStream + ) + + StateStore.unloadAll() + + val inputData2 = MemoryStream[Int] + val aggregated2 = inputData2.toDF() + .selectExpr("value % 10 AS id", "value") + .groupBy($"id") + .agg( + sum("value").as("sum_value"), + avg("value").as("avg_value"), + collect_list("value").as("values")) + + inputData2.addData(1, 11) + + (inputData2, aggregated2) + } + + @tailrec + private def findStateSchemaNotCompatible(exc: Throwable): Option[StateSchemaNotCompatible] = { + exc match { + case e1: StateSchemaNotCompatible => Some(e1) + case e1 if e1.getCause != null => findStateSchemaNotCompatible(e1.getCause) + case _ => None + } + } /** Add blocks of data to the `BlockRDDBackedSource`. */ case class AddBlockData(source: BlockRDDBackedSource, data: Seq[Int]*) extends AddData { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingDeduplicationSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingDeduplicationSuite.scala index f63778aef5a7f..ac9cd1a12d06f 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingDeduplicationSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingDeduplicationSuite.scala @@ -17,12 +17,9 @@ package org.apache.spark.sql.streaming -import org.scalatest.BeforeAndAfterAll - -import org.apache.spark.sql.catalyst.plans.physical.{ClusteredDistribution, HashPartitioning, SinglePartition} +import org.apache.spark.sql.DataFrame import org.apache.spark.sql.catalyst.streaming.InternalOutputModes._ -import org.apache.spark.sql.execution.streaming.{MemoryStream, StreamingDeduplicateExec} -import org.apache.spark.sql.execution.streaming.state.StateStore +import org.apache.spark.sql.execution.streaming.MemoryStream import org.apache.spark.sql.functions._ import org.apache.spark.sql.internal.SQLConf @@ -54,13 +51,13 @@ class StreamingDeduplicationSuite extends StateStoreMetricsTest { testStream(result, Append)( AddData(inputData, "a" -> 1), CheckLastBatch("a" -> 1), - assertNumStateRows(total = 1, updated = 1), + assertNumStateRows(total = 1, updated = 1, droppedByWatermark = 0), AddData(inputData, "a" -> 2), // Dropped CheckLastBatch(), - assertNumStateRows(total = 1, updated = 0), + assertNumStateRows(total = 1, updated = 0, droppedByWatermark = 0), AddData(inputData, "b" -> 1), CheckLastBatch("b" -> 1), - assertNumStateRows(total = 2, updated = 1) + assertNumStateRows(total = 2, updated = 1, droppedByWatermark = 0) ) } @@ -86,7 +83,7 @@ class StreamingDeduplicationSuite extends StateStoreMetricsTest { test("deduplicate with watermark") { val inputData = MemoryStream[Int] val result = inputData.toDS() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .dropDuplicates() .select($"eventTime".cast("long").as[Long]) @@ -102,7 +99,7 @@ class StreamingDeduplicationSuite extends StateStoreMetricsTest { AddData(inputData, 10), // Should not emit anything as data less than watermark CheckNewAnswer(), - assertNumStateRows(total = 1, updated = 0), + assertNumStateRows(total = 1, updated = 0, droppedByWatermark = 1), AddData(inputData, 45), // Advance watermark to 35 seconds, no-data-batch drops row 25 CheckNewAnswer(45), @@ -113,7 +110,7 @@ class StreamingDeduplicationSuite extends StateStoreMetricsTest { test("deduplicate with aggregate - append mode") { val inputData = MemoryStream[Int] val windowedaggregate = inputData.toDS() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .dropDuplicates() .withWatermark("eventTime", "10 seconds") @@ -136,7 +133,8 @@ class StreamingDeduplicationSuite extends StateStoreMetricsTest { AddData(inputData, 10), // Should not emit anything as data less than watermark CheckLastBatch(), - assertNumStateRows(total = Seq(2L, 1L), updated = Seq(0L, 0L)), + assertNumStateRows(total = Seq(2L, 1L), updated = Seq(0L, 0L), + droppedByWatermark = Seq(0L, 1L)), AddData(inputData, 40), // Advance watermark to 30 seconds CheckLastBatch((15 -> 1), (25 -> 1)), @@ -229,7 +227,7 @@ class StreamingDeduplicationSuite extends StateStoreMetricsTest { test("SPARK-19841: watermarkPredicate should filter based on keys") { val input = MemoryStream[(Int, Int)] val df = input.toDS.toDF("time", "id") - .withColumn("time", $"time".cast("timestamp")) + .withColumn("time", timestamp_seconds($"time")) .withWatermark("time", "1 second") .dropDuplicates("id", "time") // Change the column positions .select($"id") @@ -248,7 +246,7 @@ class StreamingDeduplicationSuite extends StateStoreMetricsTest { test("SPARK-21546: dropDuplicates should ignore watermark when it's not a key") { val input = MemoryStream[(Int, Int)] val df = input.toDS.toDF("id", "time") - .withColumn("time", $"time".cast("timestamp")) + .withColumn("time", timestamp_seconds($"time")) .withWatermark("time", "1 second") .dropDuplicates("id") .select($"id", $"time".cast("long")) @@ -264,7 +262,7 @@ class StreamingDeduplicationSuite extends StateStoreMetricsTest { def testWithFlag(flag: Boolean): Unit = withClue(s"with $flagKey = $flag") { val inputData = MemoryStream[Int] val result = inputData.toDS() - .withColumn("eventTime", $"value".cast("timestamp")) + .withColumn("eventTime", timestamp_seconds($"value")) .withWatermark("eventTime", "10 seconds") .dropDuplicates() .select($"eventTime".cast("long").as[Long]) @@ -281,11 +279,57 @@ class StreamingDeduplicationSuite extends StateStoreMetricsTest { if (flag) assertNumStateRows(total = 1, updated = 1) else assertNumStateRows(total = 7, updated = 1) }, - AssertOnQuery(q => q.lastProgress.sink.numOutputRows == 0L) + AssertOnQuery { q => + eventually(timeout(streamingTimeout)) { + q.lastProgress.sink.numOutputRows == 0L + true + } + } ) } testWithFlag(true) testWithFlag(false) } + + test("SPARK-29438: ensure UNION doesn't lead streaming deduplication to use" + + " shifted partition IDs") { + def constructUnionDf(desiredPartitionsForInput1: Int) + : (MemoryStream[Int], MemoryStream[Int], DataFrame) = { + val input1 = MemoryStream[Int](desiredPartitionsForInput1) + val input2 = MemoryStream[Int] + val df1 = input1.toDF().select($"value") + val df2 = input2.toDF().dropDuplicates("value") + + // Unioned DF would have columns as (Int) + (input1, input2, df1.union(df2)) + } + + withTempDir { checkpointDir => + val (input1, input2, unionDf) = constructUnionDf(2) + testStream(unionDf, Append)( + StartStream(checkpointLocation = checkpointDir.getAbsolutePath), + MultiAddData(input1, 11, 12)(input2, 21, 22), + CheckNewAnswer(11, 12, 21, 22), + StopStream + ) + + // We're restoring the query with different number of partitions in left side of UNION, + // which may lead right side of union to have mismatched partition IDs (e.g. if it relies on + // TaskContext.partitionId()). This test will verify streaming deduplication doesn't have + // such issue. + + val (newInput1, newInput2, newUnionDf) = constructUnionDf(3) + + newInput1.addData(11, 12) + newInput2.addData(21, 22) + + testStream(newUnionDf, Append)( + StartStream(checkpointLocation = checkpointDir.getAbsolutePath), + MultiAddData(newInput1, 13, 14)(newInput2, 22, 23), + CheckNewAnswer(13, 14, 23) + ) + } + } + } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingJoinSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingJoinSuite.scala index 3f218c9cb7fd9..40131e822c5ce 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingJoinSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingJoinSuite.scala @@ -18,6 +18,7 @@ package org.apache.spark.sql.streaming import java.io.File +import java.sql.Timestamp import java.util.{Locale, UUID} import scala.util.Random @@ -25,23 +26,17 @@ import scala.util.Random import org.apache.commons.io.FileUtils import org.scalatest.BeforeAndAfter -import org.apache.spark.SparkContext import org.apache.spark.scheduler.ExecutorCacheTaskLocation -import org.apache.spark.sql.{AnalysisException, DataFrame, Row, SparkSession} -import org.apache.spark.sql.catalyst.analysis.StreamingJoinHelper -import org.apache.spark.sql.catalyst.expressions.{AttributeReference, AttributeSet, Literal} -import org.apache.spark.sql.catalyst.plans.logical.{EventTimeWatermark, Filter} -import org.apache.spark.sql.catalyst.trees.TreeNode -import org.apache.spark.sql.execution.{FileSourceScanExec, LogicalRDD} -import org.apache.spark.sql.execution.datasources.LogicalRelation +import org.apache.spark.sql.{DataFrame, Row, SparkSession} import org.apache.spark.sql.execution.streaming.{MemoryStream, StatefulOperatorStateInfo, StreamingSymmetricHashJoinExec, StreamingSymmetricHashJoinHelper} import org.apache.spark.sql.execution.streaming.state.{StateStore, StateStoreProviderId} import org.apache.spark.sql.functions._ -import org.apache.spark.sql.types._ import org.apache.spark.util.Utils +abstract class StreamingJoinSuite + extends StreamTest with StateStoreMetricsTest with BeforeAndAfter { -class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with BeforeAndAfter { + import testImplicits._ before { SparkSession.setActiveSession(spark) // set this before force initializing 'joinExec' @@ -52,6 +47,162 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with StateStore.stop() } + protected def setupStream(prefix: String, multiplier: Int): (MemoryStream[Int], DataFrame) = { + val input = MemoryStream[Int] + val df = input.toDF + .select( + 'value as "key", + timestamp_seconds($"value") as s"${prefix}Time", + ('value * multiplier) as s"${prefix}Value") + .withWatermark(s"${prefix}Time", "10 seconds") + + (input, df) + } + + protected def setupWindowedJoin(joinType: String) + : (MemoryStream[Int], MemoryStream[Int], DataFrame) = { + + val (input1, df1) = setupStream("left", 2) + val (input2, df2) = setupStream("right", 3) + val windowed1 = df1.select('key, window('leftTime, "10 second"), 'leftValue) + val windowed2 = df2.select('key, window('rightTime, "10 second"), 'rightValue) + val joined = windowed1.join(windowed2, Seq("key", "window"), joinType) + val select = if (joinType == "left_semi") { + joined.select('key, $"window.end".cast("long"), 'leftValue) + } else { + joined.select('key, $"window.end".cast("long"), 'leftValue, 'rightValue) + } + + (input1, input2, select) + } + + protected def setupWindowedJoinWithLeftCondition(joinType: String) + : (MemoryStream[Int], MemoryStream[Int], DataFrame) = { + + val (leftInput, df1) = setupStream("left", 2) + val (rightInput, df2) = setupStream("right", 3) + // Use different schemas to ensure the null row is being generated from the correct side. + val left = df1.select('key, window('leftTime, "10 second"), 'leftValue) + val right = df2.select('key, window('rightTime, "10 second"), 'rightValue.cast("string")) + + val joined = left.join( + right, + left("key") === right("key") + && left("window") === right("window") + && 'leftValue > 4, + joinType) + + val select = if (joinType == "left_semi") { + joined.select(left("key"), left("window.end").cast("long"), 'leftValue) + } else if (joinType == "left_outer") { + joined.select(left("key"), left("window.end").cast("long"), 'leftValue, 'rightValue) + } else if (joinType == "right_outer") { + joined.select(right("key"), right("window.end").cast("long"), 'leftValue, 'rightValue) + } else { + joined.select(left("key"), left("window.end").cast("long"), 'leftValue, + right("key"), right("window.end").cast("long"), 'rightValue) + } + + (leftInput, rightInput, select) + } + + protected def setupWindowedJoinWithRightCondition(joinType: String) + : (MemoryStream[Int], MemoryStream[Int], DataFrame) = { + + val (leftInput, df1) = setupStream("left", 2) + val (rightInput, df2) = setupStream("right", 3) + // Use different schemas to ensure the null row is being generated from the correct side. + val left = df1.select('key, window('leftTime, "10 second"), 'leftValue) + val right = df2.select('key, window('rightTime, "10 second"), 'rightValue.cast("string")) + + val joined = left.join( + right, + left("key") === right("key") + && left("window") === right("window") + && 'rightValue.cast("int") > 7, + joinType) + + val select = if (joinType == "left_semi") { + joined.select(left("key"), left("window.end").cast("long"), 'leftValue) + } else if (joinType == "left_outer") { + joined.select(left("key"), left("window.end").cast("long"), 'leftValue, 'rightValue) + } else if (joinType == "right_outer") { + joined.select(right("key"), right("window.end").cast("long"), 'leftValue, 'rightValue) + } else { + joined.select(left("key"), left("window.end").cast("long"), 'leftValue, + right("key"), right("window.end").cast("long"), 'rightValue) + } + + (leftInput, rightInput, select) + } + + protected def setupJoinWithRangeCondition(joinType: String) + : (MemoryStream[(Int, Int)], MemoryStream[(Int, Int)], DataFrame) = { + + val leftInput = MemoryStream[(Int, Int)] + val rightInput = MemoryStream[(Int, Int)] + + val df1 = leftInput.toDF.toDF("leftKey", "time") + .select('leftKey, timestamp_seconds($"time") as "leftTime", ('leftKey * 2) as "leftValue") + .withWatermark("leftTime", "10 seconds") + + val df2 = rightInput.toDF.toDF("rightKey", "time") + .select('rightKey, timestamp_seconds($"time") as "rightTime", + ('rightKey * 3) as "rightValue") + .withWatermark("rightTime", "10 seconds") + + val joined = + df1.join( + df2, + expr("leftKey = rightKey AND " + + "leftTime BETWEEN rightTime - interval 5 seconds AND rightTime + interval 5 seconds"), + joinType) + + val select = if (joinType == "left_semi") { + joined.select('leftKey, 'leftTime.cast("int")) + } else { + joined.select('leftKey, 'rightKey, 'leftTime.cast("int"), 'rightTime.cast("int")) + } + + (leftInput, rightInput, select) + } + + protected def setupSelfJoin(joinType: String) + : (MemoryStream[(Int, Long)], DataFrame) = { + + val inputStream = MemoryStream[(Int, Long)] + + val df = inputStream.toDS() + .select(col("_1").as("value"), timestamp_seconds($"_2").as("timestamp")) + + val leftStream = df.select(col("value").as("leftId"), col("timestamp").as("leftTime")) + + val rightStream = df + // Introduce misses for ease of debugging + .where(col("value") % 2 === 0) + .select(col("value").as("rightId"), col("timestamp").as("rightTime")) + + val joined = leftStream + .withWatermark("leftTime", "5 seconds") + .join( + rightStream.withWatermark("rightTime", "5 seconds"), + expr("leftId = rightId AND rightTime >= leftTime AND " + + "rightTime <= leftTime + interval 5 seconds"), + joinType) + + val select = if (joinType == "left_semi") { + joined.select(col("leftId"), col("leftTime").cast("int")) + } else { + joined.select(col("leftId"), col("leftTime").cast("int"), + col("rightId"), col("rightTime").cast("int")) + } + + (inputStream, select) + } +} + +class StreamingInnerJoinSuite extends StreamingJoinSuite { + import testImplicits._ test("stream stream inner join on non-time column") { val input1 = MemoryStream[Int] @@ -87,11 +238,12 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with val input2 = MemoryStream[Int] val df1 = input1.toDF - .select('value as "key", 'value.cast("timestamp") as "timestamp", ('value * 2) as "leftValue") + .select('value as "key", timestamp_seconds($"value") as "timestamp", + ('value * 2) as "leftValue") .select('key, window('timestamp, "10 second"), 'leftValue) val df2 = input2.toDF - .select('value as "key", 'value.cast("timestamp") as "timestamp", + .select('value as "key", timestamp_seconds($"value") as "timestamp", ('value * 3) as "rightValue") .select('key, window('timestamp, "10 second"), 'rightValue) @@ -127,12 +279,13 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with val input2 = MemoryStream[Int] val df1 = input1.toDF - .select('value as "key", 'value.cast("timestamp") as "timestamp", ('value * 2) as "leftValue") + .select('value as "key", timestamp_seconds($"value") as "timestamp", + ('value * 2) as "leftValue") .withWatermark("timestamp", "10 seconds") .select('key, window('timestamp, "10 second"), 'leftValue) val df2 = input2.toDF - .select('value as "key", 'value.cast("timestamp") as "timestamp", + .select('value as "key", timestamp_seconds($"value") as "timestamp", ('value * 3) as "rightValue") .select('key, window('timestamp, "10 second"), 'rightValue) @@ -166,7 +319,7 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with AddData(input1, 5), CheckNewAnswer(), // Same reason as above - assertNumStateRows(total = 2, updated = 0) + assertNumStateRows(total = 2, updated = 0, droppedByWatermark = 1) ) } @@ -177,11 +330,12 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with val rightInput = MemoryStream[(Int, Int)] val df1 = leftInput.toDF.toDF("leftKey", "time") - .select('leftKey, 'time.cast("timestamp") as "leftTime", ('leftKey * 2) as "leftValue") + .select('leftKey, timestamp_seconds($"time") as "leftTime", ('leftKey * 2) as "leftValue") .withWatermark("leftTime", "10 seconds") val df2 = rightInput.toDF.toDF("rightKey", "time") - .select('rightKey, 'time.cast("timestamp") as "rightTime", ('rightKey * 3) as "rightValue") + .select('rightKey, timestamp_seconds($"time") as "rightTime", + ('rightKey * 3) as "rightValue") .withWatermark("rightTime", "10 seconds") val joined = @@ -219,12 +373,12 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with // (1, 28) ==> passed filter, matched with left (1, 3) and (1, 5), added to state AddData(rightInput, (1, 20), (1, 21), (1, 28)), CheckNewAnswer((1, 3, 21), (1, 5, 21), (1, 3, 28), (1, 5, 28)), - assertNumStateRows(total = 5, updated = 1), + assertNumStateRows(total = 5, updated = 1, droppedByWatermark = 1), // New data to left input with leftTime <= 20 should be filtered due to event time watermark AddData(leftInput, (1, 20), (1, 21)), CheckNewAnswer((1, 21, 28)), - assertNumStateRows(total = 6, updated = 1) + assertNumStateRows(total = 6, updated = 1, droppedByWatermark = 1) ) } @@ -235,11 +389,12 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with val rightInput = MemoryStream[(Int, Int)] val df1 = leftInput.toDF.toDF("leftKey", "time") - .select('leftKey, 'time.cast("timestamp") as "leftTime", ('leftKey * 2) as "leftValue") + .select('leftKey, timestamp_seconds($"time") as "leftTime", ('leftKey * 2) as "leftValue") .withWatermark("leftTime", "20 seconds") val df2 = rightInput.toDF.toDF("rightKey", "time") - .select('rightKey, 'time.cast("timestamp") as "rightTime", ('rightKey * 3) as "rightValue") + .select('rightKey, timestamp_seconds($"time") as "rightTime", + ('rightKey * 3) as "rightValue") .withWatermark("rightTime", "30 seconds") val condition = expr( @@ -293,7 +448,7 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with AddData(leftInput, (1, 30), (1, 31)), // 30 should not be processed or added to state CheckNewAnswer((1, 31, 26), (1, 31, 30), (1, 31, 31)), - assertNumStateRows(total = 11, updated = 1), // only 31 added + assertNumStateRows(total = 11, updated = 1, droppedByWatermark = 1), // only 31 added // Advance the watermark AddData(rightInput, (1, 80)), @@ -307,7 +462,7 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with AddData(rightInput, (1, 46), (1, 50)), // 46 should not be processed or added to state CheckNewAnswer((1, 49, 50), (1, 50, 50)), - assertNumStateRows(total = 7, updated = 1) // 50 added + assertNumStateRows(total = 7, updated = 1, droppedByWatermark = 1) // 50 added ) } @@ -368,7 +523,7 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with }.toMap partitionAndStoreNameToLocation.foreach { case ((partIndex, storeName), hostName) => val providerId = StateStoreProviderId(stateInfo, partIndex, storeName) - coordinatorRef.reportActiveInstance(providerId, hostName, s"exec-$hostName") + coordinatorRef.reportActiveInstance(providerId, hostName, s"exec-$hostName", Seq.empty) require( coordinatorRef.getLocation(providerId) === Some(ExecutorCacheTaskLocation(hostName, s"exec-$hostName").toString)) @@ -425,7 +580,7 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with test("SPARK-26187 restore the stream-stream inner join query from Spark 2.4") { val inputStream = MemoryStream[(Int, Long)] val df = inputStream.toDS() - .select(col("_1").as("value"), col("_2").cast("timestamp").as("timestamp")) + .select(col("_1").as("value"), timestamp_seconds($"_2").as("timestamp")) val leftStream = df.select(col("value").as("leftId"), col("timestamp").as("leftTime")) @@ -481,58 +636,13 @@ class StreamingInnerJoinSuite extends StreamTest with StateStoreMetricsTest with } -class StreamingOuterJoinSuite extends StreamTest with StateStoreMetricsTest with BeforeAndAfter { +class StreamingOuterJoinSuite extends StreamingJoinSuite { import testImplicits._ import org.apache.spark.sql.functions._ - before { - SparkSession.setActiveSession(spark) // set this before force initializing 'joinExec' - spark.streams.stateStoreCoordinator // initialize the lazy coordinator - } - - after { - StateStore.stop() - } - - private def setupStream(prefix: String, multiplier: Int): (MemoryStream[Int], DataFrame) = { - val input = MemoryStream[Int] - val df = input.toDF - .select( - 'value as "key", - 'value.cast("timestamp") as s"${prefix}Time", - ('value * multiplier) as s"${prefix}Value") - .withWatermark(s"${prefix}Time", "10 seconds") - - return (input, df) - } - - private def setupWindowedJoin(joinType: String): - (MemoryStream[Int], MemoryStream[Int], DataFrame) = { - val (input1, df1) = setupStream("left", 2) - val (input2, df2) = setupStream("right", 3) - val windowed1 = df1.select('key, window('leftTime, "10 second"), 'leftValue) - val windowed2 = df2.select('key, window('rightTime, "10 second"), 'rightValue) - val joined = windowed1.join(windowed2, Seq("key", "window"), joinType) - .select('key, $"window.end".cast("long"), 'leftValue, 'rightValue) - - (input1, input2, joined) - } - test("left outer early state exclusion on left") { - val (leftInput, df1) = setupStream("left", 2) - val (rightInput, df2) = setupStream("right", 3) - // Use different schemas to ensure the null row is being generated from the correct side. - val left = df1.select('key, window('leftTime, "10 second"), 'leftValue) - val right = df2.select('key, window('rightTime, "10 second"), 'rightValue.cast("string")) - - val joined = left.join( - right, - left("key") === right("key") - && left("window") === right("window") - && 'leftValue > 4, - "left_outer") - .select(left("key"), left("window.end").cast("long"), 'leftValue, 'rightValue) + val (leftInput, rightInput, joined) = setupWindowedJoinWithLeftCondition("left_outer") testStream(joined)( MultiAddData(leftInput, 1, 2, 3)(rightInput, 3, 4, 5), @@ -549,19 +659,7 @@ class StreamingOuterJoinSuite extends StreamTest with StateStoreMetricsTest with } test("left outer early state exclusion on right") { - val (leftInput, df1) = setupStream("left", 2) - val (rightInput, df2) = setupStream("right", 3) - // Use different schemas to ensure the null row is being generated from the correct side. - val left = df1.select('key, window('leftTime, "10 second"), 'leftValue) - val right = df2.select('key, window('rightTime, "10 second"), 'rightValue.cast("string")) - - val joined = left.join( - right, - left("key") === right("key") - && left("window") === right("window") - && 'rightValue.cast("int") > 7, - "left_outer") - .select(left("key"), left("window.end").cast("long"), 'leftValue, 'rightValue) + val (leftInput, rightInput, joined) = setupWindowedJoinWithRightCondition("left_outer") testStream(joined)( MultiAddData(leftInput, 3, 4, 5)(rightInput, 1, 2, 3), @@ -578,19 +676,7 @@ class StreamingOuterJoinSuite extends StreamTest with StateStoreMetricsTest with } test("right outer early state exclusion on left") { - val (leftInput, df1) = setupStream("left", 2) - val (rightInput, df2) = setupStream("right", 3) - // Use different schemas to ensure the null row is being generated from the correct side. - val left = df1.select('key, window('leftTime, "10 second"), 'leftValue) - val right = df2.select('key, window('rightTime, "10 second"), 'rightValue.cast("string")) - - val joined = left.join( - right, - left("key") === right("key") - && left("window") === right("window") - && 'leftValue > 4, - "right_outer") - .select(right("key"), right("window.end").cast("long"), 'leftValue, 'rightValue) + val (leftInput, rightInput, joined) = setupWindowedJoinWithLeftCondition("right_outer") testStream(joined)( MultiAddData(leftInput, 1, 2, 3)(rightInput, 3, 4, 5), @@ -607,19 +693,7 @@ class StreamingOuterJoinSuite extends StreamTest with StateStoreMetricsTest with } test("right outer early state exclusion on right") { - val (leftInput, df1) = setupStream("left", 2) - val (rightInput, df2) = setupStream("right", 3) - // Use different schemas to ensure the null row is being generated from the correct side. - val left = df1.select('key, window('leftTime, "10 second"), 'leftValue) - val right = df2.select('key, window('rightTime, "10 second"), 'rightValue.cast("string")) - - val joined = left.join( - right, - left("key") === right("key") - && left("window") === right("window") - && 'rightValue.cast("int") > 7, - "right_outer") - .select(right("key"), right("window.end").cast("long"), 'leftValue, 'rightValue) + val (leftInput, rightInput, joined) = setupWindowedJoinWithRightCondition("right_outer") testStream(joined)( MultiAddData(leftInput, 3, 4, 5)(rightInput, 1, 2, 3), @@ -676,26 +750,8 @@ class StreamingOuterJoinSuite extends StreamTest with StateStoreMetricsTest with ("right_outer", Row(null, 2, null, 5)) ).foreach { case (joinType: String, outerResult) => test(s"${joinType.replaceAllLiterally("_", " ")} with watermark range condition") { - import org.apache.spark.sql.functions._ - - val leftInput = MemoryStream[(Int, Int)] - val rightInput = MemoryStream[(Int, Int)] - - val df1 = leftInput.toDF.toDF("leftKey", "time") - .select('leftKey, 'time.cast("timestamp") as "leftTime", ('leftKey * 2) as "leftValue") - .withWatermark("leftTime", "10 seconds") - - val df2 = rightInput.toDF.toDF("rightKey", "time") - .select('rightKey, 'time.cast("timestamp") as "rightTime", ('rightKey * 3) as "rightValue") - .withWatermark("rightTime", "10 seconds") - - val joined = - df1.join( - df2, - expr("leftKey = rightKey AND " + - "leftTime BETWEEN rightTime - interval 5 seconds AND rightTime + interval 5 seconds"), - joinType) - .select('leftKey, 'rightKey, 'leftTime.cast("int"), 'rightTime.cast("int")) + val (leftInput, rightInput, joined) = setupJoinWithRangeCondition(joinType) + testStream(joined)( AddData(leftInput, (1, 5), (3, 5)), CheckAnswer(), @@ -774,27 +830,7 @@ class StreamingOuterJoinSuite extends StreamTest with StateStoreMetricsTest with } test("SPARK-26187 self left outer join should not return outer nulls for already matched rows") { - val inputStream = MemoryStream[(Int, Long)] - - val df = inputStream.toDS() - .select(col("_1").as("value"), col("_2").cast("timestamp").as("timestamp")) - - val leftStream = df.select(col("value").as("leftId"), col("timestamp").as("leftTime")) - - val rightStream = df - // Introduce misses for ease of debugging - .where(col("value") % 2 === 0) - .select(col("value").as("rightId"), col("timestamp").as("rightTime")) - - val query = leftStream - .withWatermark("leftTime", "5 seconds") - .join( - rightStream.withWatermark("rightTime", "5 seconds"), - expr("leftId = rightId AND rightTime >= leftTime AND " + - "rightTime <= leftTime + interval 5 seconds"), - joinType = "leftOuter") - .select(col("leftId"), col("leftTime").cast("int"), - col("rightId"), col("rightTime").cast("int")) + val (inputStream, query) = setupSelfJoin("left_outer") testStream(query)( AddData(inputStream, (1, 1L), (2, 2L), (3, 3L), (4, 4L), (5, 5L)), @@ -840,7 +876,7 @@ class StreamingOuterJoinSuite extends StreamTest with StateStoreMetricsTest with val inputStream = MemoryStream[(Int, Long)] val df = inputStream.toDS() - .select(col("_1").as("value"), col("_2").cast("timestamp").as("timestamp")) + .select(col("_1").as("value"), timestamp_seconds($"_2").as("timestamp")) // we're just flipping "left" and "right" from left outer join and apply right outer join @@ -883,7 +919,7 @@ class StreamingOuterJoinSuite extends StreamTest with StateStoreMetricsTest with test("SPARK-26187 restore the stream-stream outer join query from Spark 2.4") { val inputStream = MemoryStream[(Int, Long)] val df = inputStream.toDS() - .select(col("_1").as("value"), col("_2").cast("timestamp").as("timestamp")) + .select(col("_1").as("value"), timestamp_seconds($"_2").as("timestamp")) val leftStream = df.select(col("value").as("leftId"), col("timestamp").as("leftTime")) @@ -932,7 +968,7 @@ class StreamingOuterJoinSuite extends StreamTest with StateStoreMetricsTest with throw writer.exception.get } assert(e.getMessage.toLowerCase(Locale.ROOT) - .contains("the query is using stream-stream outer join with state format version 1")) + .contains("the query is using stream-stream leftouter join with state format version 1")) } test("SPARK-29438: ensure UNION doesn't lead stream-stream join to use shifted partition IDs") { @@ -991,4 +1027,452 @@ class StreamingOuterJoinSuite extends StreamTest with StateStoreMetricsTest with ) } } + + test("SPARK-32148 stream-stream join regression on Spark 3.0.0") { + val input1 = MemoryStream[(Timestamp, String, String)] + val df1 = input1.toDF + .selectExpr("_1 as eventTime", "_2 as id", "_3 as comment") + .withWatermark(s"eventTime", "2 minutes") + + val input2 = MemoryStream[(Timestamp, String, String)] + val df2 = input2.toDF + .selectExpr("_1 as eventTime", "_2 as id", "_3 as name") + .withWatermark(s"eventTime", "4 minutes") + + val joined = df1.as("left") + .join(df2.as("right"), + expr(""" + |left.id = right.id AND left.eventTime BETWEEN + | right.eventTime - INTERVAL 30 seconds AND + | right.eventTime + INTERVAL 30 seconds + """.stripMargin), + joinType = "leftOuter") + + val inputDataForInput1 = Seq( + (Timestamp.valueOf("2020-01-01 00:00:00"), "abc", "has no join partner"), + (Timestamp.valueOf("2020-01-02 00:00:00"), "abc", "joined with A"), + (Timestamp.valueOf("2020-01-02 01:00:00"), "abc", "joined with B")) + + val inputDataForInput2 = Seq( + (Timestamp.valueOf("2020-01-02 00:00:10"), "abc", "A"), + (Timestamp.valueOf("2020-01-02 00:59:59"), "abc", "B"), + (Timestamp.valueOf("2020-01-02 02:00:00"), "abc", "C")) + + val expectedOutput = Seq( + (Timestamp.valueOf("2020-01-01 00:00:00"), "abc", "has no join partner", null, null, null), + (Timestamp.valueOf("2020-01-02 00:00:00"), "abc", "joined with A", + Timestamp.valueOf("2020-01-02 00:00:10"), "abc", "A"), + (Timestamp.valueOf("2020-01-02 01:00:00"), "abc", "joined with B", + Timestamp.valueOf("2020-01-02 00:59:59"), "abc", "B")) + + testStream(joined)( + MultiAddData((input1, inputDataForInput1), (input2, inputDataForInput2)), + CheckNewAnswer(expectedOutput.head, expectedOutput.tail: _*) + ) + } +} + +class StreamingFullOuterJoinSuite extends StreamingJoinSuite { + + test("windowed full outer join") { + val (leftInput, rightInput, joined) = setupWindowedJoin("full_outer") + + testStream(joined)( + MultiAddData(leftInput, 1, 2, 3, 4, 5)(rightInput, 3, 4, 5, 6, 7), + CheckNewAnswer(Row(3, 10, 6, 9), Row(4, 10, 8, 12), Row(5, 10, 10, 15)), + // states + // left: 1, 2, 3, 4 ,5 + // right: 3, 4, 5, 6, 7 + assertNumStateRows(total = 10, updated = 10), + MultiAddData(leftInput, 21)(rightInput, 22), + // Watermark = 11, should remove rows having window=[0,10]. + CheckNewAnswer(Row(1, 10, 2, null), Row(2, 10, 4, null), Row(6, 10, null, 18), + Row(7, 10, null, 21)), + // states + // left: 21 + // right: 22 + // + // states evicted + // left: 1, 2, 3, 4 ,5 (below watermark) + // right: 3, 4, 5, 6, 7 (below watermark) + assertNumStateRows(total = 2, updated = 2), + AddData(leftInput, 22), + CheckNewAnswer(Row(22, 30, 44, 66)), + // states + // left: 21, 22 + // right: 22 + assertNumStateRows(total = 3, updated = 1), + StopStream, + StartStream(), + + AddData(leftInput, 1), + // Row not add as 1 < state key watermark = 12. + CheckNewAnswer(), + // states + // left: 21, 22 + // right: 22 + assertNumStateRows(total = 3, updated = 0, droppedByWatermark = 1), + AddData(rightInput, 5), + // Row not add as 5 < state key watermark = 12. + CheckNewAnswer(), + // states + // left: 21, 22 + // right: 22 + assertNumStateRows(total = 3, updated = 0, droppedByWatermark = 1) + ) + } + + test("full outer early state exclusion on left") { + val (leftInput, rightInput, joined) = setupWindowedJoinWithLeftCondition("full_outer") + + testStream(joined)( + MultiAddData(leftInput, 1, 2, 3)(rightInput, 3, 4, 5), + // The left rows with leftValue <= 4 should generate their outer join rows now and + // not get added to the state. + CheckNewAnswer(Row(1, 10, 2, null, null, null), Row(2, 10, 4, null, null, null), + Row(3, 10, 6, 3, 10, "9")), + // states + // left: 3 + // right: 3, 4, 5 + assertNumStateRows(total = 4, updated = 4), + // Generate outer join result for all non-matched rows when the watermark advances. + MultiAddData(leftInput, 20)(rightInput, 21), + CheckNewAnswer(Row(null, null, null, 4, 10, "12"), Row(null, null, null, 5, 10, "15")), + // states + // left: 20 + // right: 21 + // + // states evicted + // left: 3 (below watermark) + // right: 3, 4, 5 (below watermark) + assertNumStateRows(total = 2, updated = 2), + AddData(rightInput, 20), + CheckNewAnswer(Row(20, 30, 40, 20, 30, "60")), + // states + // left: 20 + // right: 21, 20 + assertNumStateRows(total = 3, updated = 1) + ) + } + + test("full outer early state exclusion on right") { + val (leftInput, rightInput, joined) = setupWindowedJoinWithRightCondition("full_outer") + + testStream(joined)( + MultiAddData(leftInput, 3, 4, 5)(rightInput, 1, 2, 3), + // The right rows with rightValue <= 7 should generate their outer join rows now, + // and never be added to the state. + // The right row with rightValue = 9 > 7, hence joined and added to state. + CheckNewAnswer(Row(null, null, null, 1, 10, "3"), Row(null, null, null, 2, 10, "6"), + Row(3, 10, 6, 3, 10, "9")), + // states + // left: 3, 4, 5 + // right: 3 + assertNumStateRows(total = 4, updated = 4), + // Generate outer join result for all non-matched rows when the watermark advances. + MultiAddData(leftInput, 20)(rightInput, 21), + CheckNewAnswer(Row(4, 10, 8, null, null, null), Row(5, 10, 10, null, null, null)), + // states + // left: 20 + // right: 21 + // + // states evicted + // left: 3, 4, 5 (below watermark) + // right: 3 (below watermark) + assertNumStateRows(total = 2, updated = 2), + AddData(rightInput, 20), + CheckNewAnswer(Row(20, 30, 40, 20, 30, "60")), + // states + // left: 20 + // right: 21, 20 + assertNumStateRows(total = 3, updated = 1) + ) + } + + test("full outer join with watermark range condition") { + val (leftInput, rightInput, joined) = setupJoinWithRangeCondition("full_outer") + + testStream(joined)( + AddData(leftInput, (1, 5), (3, 5)), + CheckNewAnswer(), + // states + // left: (1, 5), (3, 5) + // right: nothing + assertNumStateRows(total = 2, updated = 2), + AddData(rightInput, (1, 10), (2, 5)), + // Match left row in the state. + CheckNewAnswer(Row(1, 1, 5, 10)), + // states + // left: (1, 5), (3, 5) + // right: (1, 10), (2, 5) + assertNumStateRows(total = 4, updated = 2), + AddData(rightInput, (1, 9)), + // Match left row in the state. + CheckNewAnswer(Row(1, 1, 5, 9)), + // states + // left: (1, 5), (3, 5) + // right: (1, 10), (2, 5), (1, 9) + assertNumStateRows(total = 5, updated = 1), + // Increase event time watermark to 20s by adding data with time = 30s on both inputs. + AddData(leftInput, (1, 7), (1, 30)), + CheckNewAnswer(Row(1, 1, 7, 9), Row(1, 1, 7, 10)), + // states + // left: (1, 5), (3, 5), (1, 7), (1, 30) + // right: (1, 10), (2, 5), (1, 9) + assertNumStateRows(total = 7, updated = 2), + // Watermark = 30 - 10 = 20, no matched row. + // Generate outer join result for all non-matched rows when the watermark advances. + AddData(rightInput, (0, 30)), + CheckNewAnswer(Row(3, null, 5, null), Row(null, 2, null, 5)), + // states + // left: (1, 30) + // right: (0, 30) + // + // states evicted + // left: (1, 5), (3, 5), (1, 5) (below watermark = 20) + // right: (1, 10), (2, 5), (1, 9) (below watermark = 20) + assertNumStateRows(total = 2, updated = 1) + ) + } + + test("self full outer join") { + val (inputStream, query) = setupSelfJoin("full_outer") + + testStream(query)( + AddData(inputStream, (1, 1L), (2, 2L), (3, 3L), (4, 4L), (5, 5L)), + CheckNewAnswer(Row(2, 2L, 2, 2L), Row(4, 4L, 4, 4L)), + // batch 1 - global watermark = 0 + // states + // left: (1, 1L), (2, 2L), (3, 3L), (4, 4L), (5, 5L) + // right: (2, 2L), (4, 4L) + assertNumStateRows(total = 7, updated = 7), + AddData(inputStream, (6, 6L), (7, 7L), (8, 8L), (9, 9L), (10, 10L)), + CheckNewAnswer(Row(6, 6L, 6, 6L), Row(8, 8L, 8, 8L), Row(10, 10L, 10, 10L)), + // batch 2 - global watermark = 5 + // states + // left: (1, 1L), (2, 2L), (3, 3L), (4, 4L), (5, 5L), (6, 6L), (7, 7L), (8, 8L), + // (9, 9L), (10, 10L) + // right: (6, 6L), (8, 8L), (10, 10L) + // + // states evicted + // left: nothing (it waits for 5 seconds more than watermark due to join condition) + // right: (2, 2L), (4, 4L) + assertNumStateRows(total = 13, updated = 8), + AddData(inputStream, (11, 11L), (12, 12L), (13, 13L), (14, 14L), (15, 15L)), + CheckNewAnswer(Row(12, 12L, 12, 12L), Row(14, 14L, 14, 14L), Row(1, 1L, null, null), + Row(3, 3L, null, null)), + // batch 3 - global watermark = 9 + // states + // left: (4, 4L), (5, 5L), (6, 6L), (7, 7L), (8, 8L), (9, 9L), (10, 10L), (11, 11L), + // (12, 12L), (13, 13L), (14, 14L), (15, 15L) + // right: (10, 10L), (12, 12L), (14, 14L) + // + // states evicted + // left: (1, 1L), (2, 2L), (3, 3L) + // right: (6, 6L), (8, 8L) + assertNumStateRows(total = 15, updated = 7) + ) + } +} + +class StreamingLeftSemiJoinSuite extends StreamingJoinSuite { + + import testImplicits._ + + test("windowed left semi join") { + val (leftInput, rightInput, joined) = setupWindowedJoin("left_semi") + + testStream(joined)( + MultiAddData(leftInput, 1, 2, 3, 4, 5)(rightInput, 3, 4, 5, 6, 7), + CheckNewAnswer(Row(3, 10, 6), Row(4, 10, 8), Row(5, 10, 10)), + // states + // left: 1, 2, 3, 4 ,5 + // right: 3, 4, 5, 6, 7 + assertNumStateRows(total = 10, updated = 10), + MultiAddData(leftInput, 21)(rightInput, 22), + // Watermark = 11, should remove rows having window=[0,10]. + CheckNewAnswer(), + // states + // left: 21 + // right: 22 + // + // states evicted + // left: 1, 2, 3, 4 ,5 (below watermark) + // right: 3, 4, 5, 6, 7 (below watermark) + assertNumStateRows(total = 2, updated = 2), + AddData(leftInput, 22), + CheckNewAnswer(Row(22, 30, 44)), + // Unlike inner/outer joins, given left input row matches with right input row, + // we don't buffer the matched left input row to the state store. + // + // states + // left: 21 + // right: 22 + assertNumStateRows(total = 2, updated = 0), + StopStream, + StartStream(), + + AddData(leftInput, 1), + // Row not add as 1 < state key watermark = 12. + CheckNewAnswer(), + // states + // left: 21 + // right: 22 + assertNumStateRows(total = 2, updated = 0, droppedByWatermark = 1), + AddData(rightInput, 5), + // Row not add as 5 < state key watermark = 12. + CheckNewAnswer(), + // states + // left: 21 + // right: 22 + assertNumStateRows(total = 2, updated = 0, droppedByWatermark = 1) + ) + } + + test("left semi early state exclusion on left") { + val (leftInput, rightInput, joined) = setupWindowedJoinWithLeftCondition("left_semi") + + testStream(joined)( + MultiAddData(leftInput, 1, 2, 3)(rightInput, 3, 4, 5), + // The left rows with leftValue <= 4 should not generate their semi join rows and + // not get added to the state. + CheckNewAnswer(Row(3, 10, 6)), + // states + // left: 3 + // right: 3, 4, 5 + assertNumStateRows(total = 4, updated = 4), + // We shouldn't get more semi join rows when the watermark advances. + MultiAddData(leftInput, 20)(rightInput, 21), + CheckNewAnswer(), + // states + // left: 20 + // right: 21 + // + // states evicted + // left: 3 (below watermark) + // right: 3, 4, 5 (below watermark) + assertNumStateRows(total = 2, updated = 2), + AddData(rightInput, 20), + CheckNewAnswer((20, 30, 40)), + // states + // left: 20 + // right: 21, 20 + assertNumStateRows(total = 3, updated = 1) + ) + } + + test("left semi early state exclusion on right") { + val (leftInput, rightInput, joined) = setupWindowedJoinWithRightCondition("left_semi") + + testStream(joined)( + MultiAddData(leftInput, 3, 4, 5)(rightInput, 1, 2, 3), + // The right rows with rightValue <= 7 should never be added to the state. + // The right row with rightValue = 9 > 7, hence joined and added to state. + CheckNewAnswer(Row(3, 10, 6)), + // states + // left: 3, 4, 5 + // right: 3 + assertNumStateRows(total = 4, updated = 4), + // We shouldn't get more semi join rows when the watermark advances. + MultiAddData(leftInput, 20)(rightInput, 21), + CheckNewAnswer(), + // states + // left: 20 + // right: 21 + // + // states evicted + // left: 3, 4, 5 (below watermark) + // right: 3 (below watermark) + assertNumStateRows(total = 2, updated = 2), + AddData(rightInput, 20), + CheckNewAnswer((20, 30, 40)), + // states + // left: 20 + // right: 21, 20 + assertNumStateRows(total = 3, updated = 1) + ) + } + + test("left semi join with watermark range condition") { + val (leftInput, rightInput, joined) = setupJoinWithRangeCondition("left_semi") + + testStream(joined)( + AddData(leftInput, (1, 5), (3, 5)), + CheckNewAnswer(), + // states + // left: (1, 5), (3, 5) + // right: nothing + assertNumStateRows(total = 2, updated = 2), + AddData(rightInput, (1, 10), (2, 5)), + // Match left row in the state. + CheckNewAnswer((1, 5)), + // states + // left: (1, 5), (3, 5) + // right: (1, 10), (2, 5) + assertNumStateRows(total = 4, updated = 2), + AddData(rightInput, (1, 9)), + // No match as left row is already matched. + CheckNewAnswer(), + // states + // left: (1, 5), (3, 5) + // right: (1, 10), (2, 5), (1, 9) + assertNumStateRows(total = 5, updated = 1), + // Increase event time watermark to 20s by adding data with time = 30s on both inputs. + AddData(leftInput, (1, 7), (1, 30)), + CheckNewAnswer((1, 7)), + // states + // left: (1, 5), (3, 5), (1, 30) + // right: (1, 10), (2, 5), (1, 9) + assertNumStateRows(total = 6, updated = 1), + // Watermark = 30 - 10 = 20, no matched row. + AddData(rightInput, (0, 30)), + CheckNewAnswer(), + // states + // left: (1, 30) + // right: (0, 30) + // + // states evicted + // left: (1, 5), (3, 5) (below watermark = 20) + // right: (1, 10), (2, 5), (1, 9) (below watermark = 20) + assertNumStateRows(total = 2, updated = 1) + ) + } + + test("self left semi join") { + val (inputStream, query) = setupSelfJoin("left_semi") + + testStream(query)( + AddData(inputStream, (1, 1L), (2, 2L), (3, 3L), (4, 4L), (5, 5L)), + CheckNewAnswer((2, 2), (4, 4)), + // batch 1 - global watermark = 0 + // states + // left: (2, 2L), (4, 4L) + // (left rows with value % 2 != 0 is filtered per [[PushPredicateThroughJoin]]) + // right: (2, 2L), (4, 4L) + // (right rows with value % 2 != 0 is filtered per [[PushPredicateThroughJoin]]) + assertNumStateRows(total = 4, updated = 4), + AddData(inputStream, (6, 6L), (7, 7L), (8, 8L), (9, 9L), (10, 10L)), + CheckNewAnswer((6, 6), (8, 8), (10, 10)), + // batch 2 - global watermark = 5 + // states + // left: (2, 2L), (4, 4L), (6, 6L), (8, 8L), (10, 10L) + // right: (6, 6L), (8, 8L), (10, 10L) + // + // states evicted + // left: nothing (it waits for 5 seconds more than watermark due to join condition) + // right: (2, 2L), (4, 4L) + assertNumStateRows(total = 8, updated = 6), + AddData(inputStream, (11, 11L), (12, 12L), (13, 13L), (14, 14L), (15, 15L)), + CheckNewAnswer((12, 12), (14, 14)), + // batch 3 - global watermark = 9 + // states + // left: (4, 4L), (6, 6L), (8, 8L), (10, 10L), (12, 12L), (14, 14L) + // right: (10, 10L), (12, 12L), (14, 14L) + // + // states evicted + // left: (2, 2L) + // right: (6, 6L), (8, 8L) + assertNumStateRows(total = 9, updated = 4) + ) + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryListenerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryListenerSuite.scala index e585b8a885c9c..156528776d945 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryListenerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryListenerSuite.scala @@ -49,7 +49,7 @@ class StreamingQueryListenerSuite extends StreamTest with BeforeAndAfter { assert(spark.streams.active.isEmpty) // Skip check default `StreamingQueryStatusListener` which is for streaming UI. assert(spark.streams.listListeners() - .filterNot(_.isInstanceOf[StreamingQueryStatusListener]).isEmpty) + .forall(_.isInstanceOf[StreamingQueryStatusListener])) // Make sure we don't leak any events to the next test spark.sparkContext.listenerBus.waitUntilEmpty() } @@ -323,7 +323,7 @@ class StreamingQueryListenerSuite extends StreamTest with BeforeAndAfter { actions += AssertOnQuery { q => q.recentProgress.size > 1 && q.recentProgress.size <= 11 } - testStream(input.toDS)(actions: _*) + testStream(input.toDS)(actions.toSeq: _*) spark.sparkContext.listenerBus.waitUntilEmpty() // 11 is the max value of the possible numbers of events. assert(numProgressEvent > 1 && numProgressEvent <= 11) @@ -389,7 +389,7 @@ class StreamingQueryListenerSuite extends StreamTest with BeforeAndAfter { // Structured Streaming in Spark 2.0.0. Because we renamed the classes, // SparkListenerApplicationEnd is the only valid event and it's the last event. We use it // to verify that we can skip broken jsons generated by Structured Streaming. - testReplayListenerBusWithBorkenEventJsons("query-event-logs-version-2.0.0.txt", 1) + testReplayListenerBusWithBrokenEventJsons("query-event-logs-version-2.0.0.txt", 1) } testQuietly("ReplayListenerBus should ignore broken event jsons generated in 2_0_1") { @@ -397,14 +397,14 @@ class StreamingQueryListenerSuite extends StreamTest with BeforeAndAfter { // Structured Streaming in Spark 2.0.1. Because we renamed the classes, // SparkListenerApplicationEnd is the only valid event and it's the last event. We use it // to verify that we can skip broken jsons generated by Structured Streaming. - testReplayListenerBusWithBorkenEventJsons("query-event-logs-version-2.0.1.txt", 1) + testReplayListenerBusWithBrokenEventJsons("query-event-logs-version-2.0.1.txt", 1) } testQuietly("ReplayListenerBus should ignore broken event jsons generated in 2_0_2") { // query-event-logs-version-2.0.2.txt has all types of events generated by // Structured Streaming in Spark 2.0.2. SPARK-18516 refactored Structured Streaming query events // in 2.1.0. This test is to verify we are able to load events generated by Spark 2.0.2. - testReplayListenerBusWithBorkenEventJsons("query-event-logs-version-2.0.2.txt", 5) + testReplayListenerBusWithBrokenEventJsons("query-event-logs-version-2.0.2.txt", 5) } test("listener propagates observable metrics") { @@ -433,9 +433,13 @@ class StreamingQueryListenerSuite extends StreamTest with BeforeAndAfter { } try { + val noDataProgressIntervalKey = SQLConf.STREAMING_NO_DATA_PROGRESS_EVENT_INTERVAL.key spark.streams.addListener(listener) testStream(df, OutputMode.Append)( - StartStream(Trigger.ProcessingTime(100), triggerClock = clock), + StartStream( + Trigger.ProcessingTime(100), + triggerClock = clock, + Map(noDataProgressIntervalKey -> "100")), // Batch 1 AddData(inputData, 1, 2), AdvanceManualClock(100), @@ -464,7 +468,49 @@ class StreamingQueryListenerSuite extends StreamTest with BeforeAndAfter { } } - private def testReplayListenerBusWithBorkenEventJsons( + test("SPARK-31593: remove unnecessary streaming query progress update") { + withSQLConf(SQLConf.STREAMING_NO_DATA_PROGRESS_EVENT_INTERVAL.key -> "100") { + @volatile var numProgressEvent = 0 + val listener = new StreamingQueryListener { + override def onQueryStarted(event: QueryStartedEvent): Unit = {} + override def onQueryProgress(event: QueryProgressEvent): Unit = { + numProgressEvent += 1 + } + override def onQueryTerminated(event: QueryTerminatedEvent): Unit = {} + } + spark.streams.addListener(listener) + + def checkProgressEvent(count: Int): StreamAction = { + AssertOnQuery { _ => + eventually(Timeout(streamingTimeout)) { + assert(numProgressEvent == count) + } + true + } + } + + try { + val input = new MemoryStream[Int](0, sqlContext) + val clock = new StreamManualClock() + val result = input.toDF().select("value") + testStream(result)( + StartStream(trigger = Trigger.ProcessingTime(10), triggerClock = clock), + AddData(input, 10), + checkProgressEvent(1), + AdvanceManualClock(10), + checkProgressEvent(2), + AdvanceManualClock(90), + checkProgressEvent(2), + AdvanceManualClock(10), + checkProgressEvent(3) + ) + } finally { + spark.streams.removeListener(listener) + } + } + } + + private def testReplayListenerBusWithBrokenEventJsons( fileName: String, expectedEventSize: Int): Unit = { val input = getClass.getResourceAsStream(s"/structured-streaming/$fileName") @@ -513,11 +559,11 @@ class StreamingQueryListenerSuite extends StreamTest with BeforeAndAfter { private val _progressEvents = new mutable.Queue[StreamingQueryProgress] def progressEvents: Seq[StreamingQueryProgress] = _progressEvents.synchronized { - _progressEvents.filter(_.numInputRows > 0) + _progressEvents.filter(_.numInputRows > 0).toSeq } def allProgressEvents: Seq[StreamingQueryProgress] = _progressEvents.synchronized { - _progressEvents.clone() + _progressEvents.clone().toSeq } def reset(): Unit = { diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryStatusAndProgressSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryStatusAndProgressSuite.scala index 08b3644745f9a..c0aefb8120808 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryStatusAndProgressSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryStatusAndProgressSuite.scala @@ -64,6 +64,7 @@ class StreamingQueryStatusAndProgressSuite extends StreamTest with Eventually { | "numRowsTotal" : 0, | "numRowsUpdated" : 1, | "memoryUsedBytes" : 3, + | "numRowsDroppedByWatermark" : 0, | "customMetrics" : { | "loadedMapCacheHitCount" : 1, | "loadedMapCacheMissCount" : 0, @@ -74,6 +75,7 @@ class StreamingQueryStatusAndProgressSuite extends StreamTest with Eventually { | "description" : "source", | "startOffset" : 123, | "endOffset" : 456, + | "latestOffset" : 789, | "numInputRows" : 678, | "inputRowsPerSecond" : 10.0 | } ], @@ -113,12 +115,14 @@ class StreamingQueryStatusAndProgressSuite extends StreamTest with Eventually { | "stateOperators" : [ { | "numRowsTotal" : 0, | "numRowsUpdated" : 1, - | "memoryUsedBytes" : 2 + | "memoryUsedBytes" : 2, + | "numRowsDroppedByWatermark" : 0 | } ], | "sources" : [ { | "description" : "source", | "startOffset" : 123, | "endOffset" : 456, + | "latestOffset" : 789, | "numInputRows" : 678 | } ], | "sink" : { @@ -314,23 +318,24 @@ object StreamingQueryStatusAndProgressSuite { timestamp = "2016-12-05T20:54:20.827Z", batchId = 2L, batchDuration = 0L, - durationMs = new java.util.HashMap(Map("total" -> 0L).mapValues(long2Long).asJava), + durationMs = new java.util.HashMap(Map("total" -> 0L).mapValues(long2Long).toMap.asJava), eventTime = new java.util.HashMap(Map( "max" -> "2016-12-05T20:54:20.827Z", "min" -> "2016-12-05T20:54:20.827Z", "avg" -> "2016-12-05T20:54:20.827Z", "watermark" -> "2016-12-05T20:54:20.827Z").asJava), stateOperators = Array(new StateOperatorProgress( - numRowsTotal = 0, numRowsUpdated = 1, memoryUsedBytes = 3, + numRowsTotal = 0, numRowsUpdated = 1, memoryUsedBytes = 3, numRowsDroppedByWatermark = 0, customMetrics = new java.util.HashMap(Map("stateOnCurrentVersionSizeBytes" -> 2L, "loadedMapCacheHitCount" -> 1L, "loadedMapCacheMissCount" -> 0L) - .mapValues(long2Long).asJava) + .mapValues(long2Long).toMap.asJava) )), sources = Array( new SourceProgress( description = "source", startOffset = "123", endOffset = "456", + latestOffset = "789", numInputRows = 678, inputRowsPerSecond = 10.0, processedRowsPerSecond = Double.PositiveInfinity // should not be present in the json @@ -349,16 +354,17 @@ object StreamingQueryStatusAndProgressSuite { timestamp = "2016-12-05T20:54:20.827Z", batchId = 2L, batchDuration = 0L, - durationMs = new java.util.HashMap(Map("total" -> 0L).mapValues(long2Long).asJava), + durationMs = new java.util.HashMap(Map("total" -> 0L).mapValues(long2Long).toMap.asJava), // empty maps should be handled correctly eventTime = new java.util.HashMap(Map.empty[String, String].asJava), stateOperators = Array(new StateOperatorProgress( - numRowsTotal = 0, numRowsUpdated = 1, memoryUsedBytes = 2)), + numRowsTotal = 0, numRowsUpdated = 1, memoryUsedBytes = 2, numRowsDroppedByWatermark = 0)), sources = Array( new SourceProgress( description = "source", startOffset = "123", endOffset = "456", + latestOffset = "789", numInputRows = 678, inputRowsPerSecond = Double.NaN, // should not be present in the json processedRowsPerSecond = Double.NegativeInfinity // should not be present in the json diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQuerySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQuerySuite.scala index 77f5c856ff0f4..9c2403dffbb1a 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQuerySuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQuerySuite.scala @@ -33,8 +33,11 @@ import org.scalatestplus.mockito.MockitoSugar import org.apache.spark.{SparkException, TestUtils} import org.apache.spark.internal.Logging -import org.apache.spark.sql.{Column, DataFrame, Dataset, Row} +import org.apache.spark.sql.{AnalysisException, Column, DataFrame, Dataset, Row} +import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions.{Literal, Rand, Randn, Shuffle, Uuid} +import org.apache.spark.sql.catalyst.plans.logical.LocalRelation +import org.apache.spark.sql.catalyst.streaming.InternalOutputModes.Complete import org.apache.spark.sql.connector.read.InputPartition import org.apache.spark.sql.connector.read.streaming.{Offset => OffsetV2} import org.apache.spark.sql.execution.exchange.ReusedExchangeExec @@ -702,7 +705,7 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter with Logging wi val q2 = startQuery(input(1).toDS.map { i => // Emulate that `StreamingQuery` get captured with normal usage unintentionally. // It should not fail the query. - q1 + val q = q1 i }, "stream_serializable_test_2") val q3 = startQuery(input(2).toDS.map { i => @@ -1106,6 +1109,90 @@ class StreamingQuerySuite extends StreamTest with BeforeAndAfter with Logging wi } } + test("SPARK-32456: SQL union in streaming query of append mode without watermark") { + val inputData1 = MemoryStream[Int] + val inputData2 = MemoryStream[Int] + withTempView("s1", "s2") { + inputData1.toDF().createOrReplaceTempView("s1") + inputData2.toDF().createOrReplaceTempView("s2") + val unioned = spark.sql( + "select s1.value from s1 union select s2.value from s2") + checkExceptionMessage(unioned) + } + } + + test("SPARK-32456: distinct in streaming query of append mode without watermark") { + val inputData = MemoryStream[Int] + withTempView("deduptest") { + inputData.toDF().toDF("value").createOrReplaceTempView("deduptest") + val distinct = spark.sql("select distinct value from deduptest") + checkExceptionMessage(distinct) + } + } + + test("SPARK-32456: distinct in streaming query of complete mode") { + val inputData = MemoryStream[Int] + withTempView("deduptest") { + inputData.toDF().toDF("value").createOrReplaceTempView("deduptest") + val distinct = spark.sql("select distinct value from deduptest") + + testStream(distinct, Complete)( + AddData(inputData, 1, 2, 3, 3, 4), + CheckAnswer(Row(1), Row(2), Row(3), Row(4)) + ) + } + } + + testQuietly("limit on empty batch should not cause state store error") { + // The source only produces two batches, the first batch is empty and the second batch has data. + val source = new Source { + var batchId = 0 + override def stop(): Unit = {} + override def getOffset: Option[Offset] = { + Some(LongOffset(batchId + 1)) + } + override def getBatch(start: Option[Offset], end: Offset): DataFrame = { + if (batchId == 0) { + batchId += 1 + Dataset.ofRows(spark, LocalRelation(schema.toAttributes, Nil, isStreaming = true)) + } else { + Dataset.ofRows(spark, + LocalRelation(schema.toAttributes, InternalRow(10) :: Nil, isStreaming = true)) + } + } + override def schema: StructType = MockSourceProvider.fakeSchema + } + + MockSourceProvider.withMockSources(source) { + val df = spark.readStream + .format("org.apache.spark.sql.streaming.util.MockSourceProvider") + .load() + .limit(1) + + testStream(df)( + StartStream(), + AssertOnQuery { q => + q.processAllAvailable() + true + }, + CheckAnswer(10)) + } + } + + private def checkExceptionMessage(df: DataFrame): Unit = { + withTempDir { outputDir => + withTempDir { checkpointDir => + val exception = intercept[AnalysisException]( + df.writeStream + .option("checkpointLocation", checkpointDir.getCanonicalPath) + .start(outputDir.getCanonicalPath)) + assert(exception.getMessage.contains( + "Append output mode not supported when there are streaming aggregations on streaming " + + "DataFrames/DataSets without watermark")) + } + } + } + /** Create a streaming DF that only execute one batch in which it returns the given static DF */ private def createSingleTriggerStreamingDF(triggerDF: DataFrame): DataFrame = { require(!triggerDF.isStreaming) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingStateStoreFormatCompatibilitySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingStateStoreFormatCompatibilitySuite.scala new file mode 100644 index 0000000000000..1032d6c5b6ff2 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingStateStoreFormatCompatibilitySuite.scala @@ -0,0 +1,260 @@ +/* + * 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. + */ + +package org.apache.spark.sql.streaming + +import java.io.File + +import scala.annotation.tailrec + +import org.apache.commons.io.FileUtils + +import org.apache.spark.SparkException +import org.apache.spark.sql.Row +import org.apache.spark.sql.catalyst.streaming.InternalOutputModes.Complete +import org.apache.spark.sql.execution.streaming.MemoryStream +import org.apache.spark.sql.execution.streaming.state.{InvalidUnsafeRowException, StateSchemaNotCompatible} +import org.apache.spark.sql.functions._ +import org.apache.spark.util.Utils + +/** + * An integrated test for streaming state store format compatibility. + * For each PR breaks this test, we need to pay attention to the underlying unsafe row format + * changing. All the checkpoint dirs were generated based on Spark version 2.4.5. If we accept the + * changes, it means the checkpoint for Structured Streaming will become non-reusable. Please add + * a new test for the issue, just like the test suite "SPARK-28067 changed the sum decimal unsafe + * row format". + */ +class StreamingStateStoreFormatCompatibilitySuite extends StreamTest { + import testImplicits._ + + private def prepareCheckpointDir(testName: String): File = { + val resourceUri = this.getClass.getResource("/structured-streaming/" + + s"checkpoint-version-2.4.5-for-compatibility-test-${testName}").toURI + val checkpointDir = Utils.createTempDir().getCanonicalFile + FileUtils.copyDirectory(new File(resourceUri), checkpointDir) + checkpointDir + } + + test("common functions") { + val inputData = MemoryStream[Int] + val aggregated = + inputData.toDF().toDF("value") + .selectExpr( + "value", + "value % 5 AS id", + "CAST(value AS STRING) as str", + "CAST(value AS FLOAT) as f", + "CAST(value AS DOUBLE) as d", + "CAST(value AS DECIMAL) as dec", + "value % 3 AS mod", + "named_struct('key', CAST(value AS STRING), 'value', value) AS s") + .groupBy($"id") + .agg( + avg($"value").as("avg_v"), + avg($"f").as("avg_f"), + avg($"d").as("avg_d"), + avg($"dec").as("avg_dec"), + count($"value").as("cnt"), + first($"value").as("first_v"), + first($"s").as("first_s"), + last($"value").as("last_v"), + last($"s").as("last_s"), + min(struct("value", "str")).as("min_struct"), + max($"value").as("max_v"), + sum($"value").as("sum_v"), + sum($"f").as("sum_f"), + sum($"d").as("sum_d"), + // The test for sum decimal broke by SPARK-28067, use separated test for it + // sum($"dec").as("sum_dec"), + collect_list($"value").as("col_list"), + collect_set($"mod").as("col_set")) + .select("id", "avg_v", "avg_f", "avg_d", "avg_dec", "cnt", "first_v", "first_s.value", + "last_v", "last_s.value", "min_struct.value", "max_v", "sum_v", "sum_f", "sum_d", + "col_list", "col_set") + + val checkpointDir = prepareCheckpointDir("common-functions") + inputData.addData(0 to 9: _*) + + testStream(aggregated, Complete)( + StartStream(checkpointLocation = checkpointDir.getAbsolutePath), + /* + Note: The checkpoint was generated using the following input in Spark version 2.4.5 + AddData(inputData, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9), + CheckAnswer( + Row(0, 2.5, 2.5F, 2.5, 2.5000, 2, 0, 0, 5, 5, 0, 5, 5, 5.0, 5.0, Seq(0, 5), + Seq(0, 2)), + Row(1, 3.5, 3.5F, 3.5, 3.5000, 2, 1, 1, 6, 6, 1, 6, 7, 7.0, 7.0, Seq(1, 6), + Seq(0, 1)), + Row(2, 4.5, 4.5F, 4.5, 4.5000, 2, 2, 2, 7, 7, 2, 7, 9, 9.0, 9.0, Seq(2, 7), + Seq(1, 2)), + Row(3, 5.5, 5.5F, 5.5, 5.5000, 2, 3, 3, 8, 8, 3, 8, 11, 11.0, 11.0, Seq(3, 8), + Seq(0, 2)), + Row(4, 6.5, 6.5F, 6.5, 6.5000, 2, 4, 4, 9, 9, 4, 9, 13, 13.0, 13.0, Seq(4, 9), + Seq(0, 1))) + */ + AddData(inputData, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19), + CheckAnswer( + Row(0, 7.5, 7.5, 7.5, 7.5000, 4, 0, 0, 15, 15, 0, 15, 30, 30.0, 30.0, + Seq(0, 5, 10, 15), Seq(0, 1, 2)), + Row(1, 8.5, 8.5, 8.5, 8.5000, 4, 1, 1, 16, 16, 1, 16, 34, 34.0, 34.0, + Seq(1, 6, 11, 16), Seq(0, 1, 2)), + Row(2, 9.5, 9.5, 9.5, 9.5000, 4, 2, 2, 17, 17, 2, 17, 38, 38.0, 38.0, + Seq(2, 7, 12, 17), Seq(0, 1, 2)), + Row(3, 10.5, 10.5, 10.5, 10.5000, 4, 3, 3, 18, 18, 3, 18, 42, 42.0, 42.0, + Seq(3, 8, 13, 18), Seq(0, 1, 2)), + Row(4, 11.5, 11.5, 11.5, 11.5000, 4, 4, 4, 19, 19, 4, 19, 46, 46.0, 46.0, + Seq(4, 9, 14, 19), Seq(0, 1, 2))) + ) + } + + test("statistical functions") { + val inputData = MemoryStream[Long] + val aggregated = + inputData.toDF().toDF("value") + .selectExpr( + "value", + "value % 5 AS id", + "CAST(value AS STRING) as str", + "CAST(value AS FLOAT) as f", + "CAST(value AS DOUBLE) as d", + "CAST(value AS DECIMAL) as dec", + "value % 3 AS mod") + .groupBy($"id") + .agg( + kurtosis($"d").as("kts"), + skewness($"d").as("skew"), + approx_count_distinct($"mod").as("approx_cnt"), + approx_count_distinct($"f").as("approx_cnt_f"), + approx_count_distinct($"d").as("approx_cnt_d"), + approx_count_distinct($"dec").as("approx_cnt_dec"), + approx_count_distinct($"str").as("approx_cnt_str"), + stddev_pop($"d").as("stddev_pop"), + stddev_samp($"d").as("stddev_samp"), + var_pop($"d").as("var_pop"), + var_samp($"d").as("var_samp"), + covar_pop($"value", $"mod").as("covar_pop"), + covar_samp($"value", $"mod").as("covar_samp"), + corr($"value", $"mod").as("corr")) + .select("id", "kts", "skew", "approx_cnt", "approx_cnt_f", "approx_cnt_d", + "approx_cnt_dec", "approx_cnt_str", "stddev_pop", "stddev_samp", "var_pop", "var_samp", + "covar_pop", "covar_samp", "corr") + + val checkpointDir = prepareCheckpointDir("statistical-functions") + inputData.addData(0L to 9L: _*) + + testStream(aggregated, Complete)( + StartStream(checkpointLocation = checkpointDir.getAbsolutePath), + /* + Note: The checkpoint was generated using the following input in Spark version 2.4.5 + AddData(inputData, 0L to 9L: _*), + CheckAnswer( + Row(0, -2.0, 0.0, 2, 2, 2, 2, 2, 2.5, 3.5355339059327378, 6.25, 12.5, 2.5, 5.0, 1.0), + Row(1, -2.0, 0.0, 2, 2, 2, 2, 2, 2.5, 3.5355339059327378, 6.25, 12.5, -1.25, -2.5, -1.0), + Row(2, -2.0, 0.0, 2, 2, 2, 2, 2, 2.5, 3.5355339059327378, 6.25, 12.5, -1.25, -2.5, -1.0), + Row(3, -2.0, 0.0, 2, 2, 2, 2, 2, 2.5, 3.5355339059327378, 6.25, 12.5, 2.5, 5.0, 1.0), + Row(4, -2.0, 0.0, 2, 2, 2, 2, 2, 2.5, 3.5355339059327378, 6.25, 12.5, -1.25, -2.5, -1.0)) + */ + + AddData(inputData, 10L to 19L: _*), + CheckAnswer( + Row(0, -1.36, 0.0, 3, 4, 4, 4, 4, 5.5901699437494745, 6.454972243679028, 31.25, + 41.666666666666664, -0.625, -0.8333333333333334, -0.13483997249264842), + Row(1, -1.36, 0.0, 3, 4, 4, 4, 4, 5.5901699437494745, 6.454972243679028, 31.25, + 41.666666666666664, 1.25, 1.6666666666666667, 0.31622776601683794), + Row(2, -1.36, 0.0, 3, 4, 4, 4, 4, 5.5901699437494745, 6.454972243679028, 31.25, + 41.666666666666664, -0.625, -0.8333333333333334, -0.13483997249264842), + Row(3, -1.36, 0.0, 3, 4, 4, 4, 4, 5.5901699437494745, 6.454972243679028, 31.25, + 41.666666666666664, -0.625, -0.8333333333333334, -0.13483997249264842), + Row(4, -1.36, 0.0, 3, 4, 4, 4, 4, 5.5901699437494745, 6.454972243679028, 31.25, + 41.666666666666664, 1.25, 1.6666666666666667, 0.31622776601683794)) + ) + } + + test("deduplicate with all columns") { + val inputData = MemoryStream[Long] + val result = inputData.toDF().toDF("value") + .selectExpr( + "value", + "value + 10 AS key", + "CAST(value AS STRING) as topic", + "value + 100 AS partition", + "value + 5 AS offset") + .dropDuplicates() + .select("key", "value", "topic", "partition", "offset") + + val checkpointDir = prepareCheckpointDir("deduplicate") + inputData.addData(0L, 1L, 2L, 3L, 4L) + + testStream(result)( + StartStream(checkpointLocation = checkpointDir.getAbsolutePath), + /* + Note: The checkpoint was generated using the following input in Spark version 2.4.5 + AddData(inputData, 0L, 1L, 2L, 3L, 4L), + CheckAnswer( + Row(10, 0, "0", 100, 5), + Row(11, 1, "1", 101, 6), + Row(12, 2, "2", 102, 7), + Row(13, 3, "3", 103, 8), + Row(14, 4, "4", 104, 9)) + */ + AddData(inputData, 3L, 4L, 5L, 6L), + CheckLastBatch( + Row(15, 5, "5", 105, 10), + Row(16, 6, "6", 106, 11)) + ) + } + + test("SPARK-28067 changed the sum decimal unsafe row format") { + val inputData = MemoryStream[Int] + val aggregated = + inputData.toDF().toDF("value") + .selectExpr( + "value", + "value % 2 AS id", + "CAST(value AS DECIMAL) as dec") + .groupBy($"id") + .agg(sum($"dec").as("sum_dec"), collect_list($"value").as("col_list")) + .select("id", "sum_dec", "col_list") + + val checkpointDir = prepareCheckpointDir("sum-decimal") + inputData.addData(0 to 9: _*) + + testStream(aggregated, Complete)( + StartStream(checkpointLocation = checkpointDir.getAbsolutePath), + /* + Note: The checkpoint was generated using the following input in Spark version 2.4.5 + AddData(inputData, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9), + CheckAnswer(Row(0, 20, Seq(0, 2, 4, 6, 8)), Row(1, 25, Seq(1, 3, 5, 7, 9))) + */ + AddData(inputData, 10 to 19: _*), + ExpectFailure[SparkException] { e => + assert(findStateSchemaException(e)) + } + ) + } + + @tailrec + private def findStateSchemaException(exc: Throwable): Boolean = { + exc match { + case _: StateSchemaNotCompatible => true + case _: InvalidUnsafeRowException => true + case e1 if e1.getCause != null => findStateSchemaException(e1.getCause) + case _ => false + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/continuous/ContinuousAggregationSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/continuous/ContinuousAggregationSuite.scala deleted file mode 100644 index 3ec4750c59fc5..0000000000000 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/continuous/ContinuousAggregationSuite.scala +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.streaming.continuous - -import org.apache.spark.sql.AnalysisException -import org.apache.spark.sql.execution.streaming.sources.ContinuousMemoryStream -import org.apache.spark.sql.functions._ -import org.apache.spark.sql.internal.SQLConf.UNSUPPORTED_OPERATION_CHECK_ENABLED -import org.apache.spark.sql.streaming.OutputMode - -class ContinuousAggregationSuite extends ContinuousSuiteBase { - import testImplicits._ - - test("not enabled") { - val ex = intercept[AnalysisException] { - val input = ContinuousMemoryStream.singlePartition[Int] - testStream(input.toDF().agg(max('value)), OutputMode.Complete)() - } - - assert(ex.getMessage.contains( - "In continuous processing mode, coalesce(1) must be called before aggregate operation")) - } - - test("basic") { - withSQLConf((UNSUPPORTED_OPERATION_CHECK_ENABLED.key, "false")) { - val input = ContinuousMemoryStream.singlePartition[Int] - - testStream(input.toDF().agg(max('value)), OutputMode.Complete)( - AddData(input, 0, 1, 2), - CheckAnswer(2), - StopStream, - AddData(input, 3, 4, 5), - StartStream(), - CheckAnswer(5), - AddData(input, -1, -2, -3), - CheckAnswer(5)) - } - } - - test("multiple partitions with coalesce") { - val input = ContinuousMemoryStream[Int] - - val df = input.toDF().coalesce(1).agg(max('value)) - - testStream(df, OutputMode.Complete)( - AddData(input, 0, 1, 2), - CheckAnswer(2), - StopStream, - AddData(input, 3, 4, 5), - StartStream(), - CheckAnswer(5), - AddData(input, -1, -2, -3), - CheckAnswer(5)) - } - - test("multiple partitions with coalesce - multiple transformations") { - val input = ContinuousMemoryStream[Int] - - // We use a barrier to make sure predicates both before and after coalesce work - val df = input.toDF() - .select('value as 'copy, 'value) - .where('copy =!= 1) - .logicalPlan - .coalesce(1) - .where('copy =!= 2) - .agg(max('value)) - - testStream(df, OutputMode.Complete)( - AddData(input, 0, 1, 2), - CheckAnswer(0), - StopStream, - AddData(input, 3, 4, 5), - StartStream(), - CheckAnswer(5), - AddData(input, -1, -2, -3), - CheckAnswer(5)) - } - - test("multiple partitions with multiple coalesce") { - val input = ContinuousMemoryStream[Int] - - val df = input.toDF() - .coalesce(1) - .logicalPlan - .coalesce(1) - .select('value as 'copy, 'value) - .agg(max('value)) - - testStream(df, OutputMode.Complete)( - AddData(input, 0, 1, 2), - CheckAnswer(2), - StopStream, - AddData(input, 3, 4, 5), - StartStream(), - CheckAnswer(5), - AddData(input, -1, -2, -3), - CheckAnswer(5)) - } - - test("repeated restart") { - withSQLConf((UNSUPPORTED_OPERATION_CHECK_ENABLED.key, "false")) { - val input = ContinuousMemoryStream.singlePartition[Int] - - testStream(input.toDF().agg(max('value)), OutputMode.Complete)( - AddData(input, 0, 1, 2), - CheckAnswer(2), - StopStream, - StartStream(), - StopStream, - StartStream(), - StopStream, - StartStream(), - AddData(input, 0), - CheckAnswer(2), - AddData(input, 5), - CheckAnswer(5)) - } - } -} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/continuous/ContinuousSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/continuous/ContinuousSuite.scala index 0d17f2e0bc7fb..0e2fcfbd46356 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/continuous/ContinuousSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/continuous/ContinuousSuite.scala @@ -22,7 +22,6 @@ import java.sql.Timestamp import org.apache.spark.{SparkContext, SparkException} import org.apache.spark.scheduler.{SparkListener, SparkListenerTaskStart} import org.apache.spark.sql._ -import org.apache.spark.sql.execution.datasources.v2.ContinuousScanExec import org.apache.spark.sql.execution.streaming._ import org.apache.spark.sql.execution.streaming.continuous._ import org.apache.spark.sql.execution.streaming.sources.ContinuousMemoryStream @@ -55,27 +54,31 @@ class ContinuousSuiteBase extends StreamTest { protected def waitForRateSourceCommittedValue( query: ContinuousExecution, - desiredValue: Long, + partitionIdToDesiredValue: Map[Int, Long], maxWaitTimeMs: Long): Unit = { - def readHighestCommittedValue(c: ContinuousExecution): Option[Long] = { + def readCommittedValues(c: ContinuousExecution): Option[Map[Int, Long]] = { c.committedOffsets.lastOption.map { case (_, offset) => offset match { case o: RateStreamOffset => - o.partitionToValueAndRunTimeMs.map { - case (_, ValueRunTimeMsPair(value, _)) => value - }.max + o.partitionToValueAndRunTimeMs.mapValues(_.value).toMap } } } + def reachDesiredValues: Boolean = { + val committedValues = readCommittedValues(query).getOrElse(Map.empty) + partitionIdToDesiredValue.forall { case (key, value) => + committedValues.contains(key) && committedValues(key) > value + } + } + val maxWait = System.currentTimeMillis() + maxWaitTimeMs - while (System.currentTimeMillis() < maxWait && - readHighestCommittedValue(query).getOrElse(Long.MinValue) < desiredValue) { + while (System.currentTimeMillis() < maxWait && !reachDesiredValues) { Thread.sleep(100) } if (System.currentTimeMillis() > maxWait) { logWarning(s"Couldn't reach desired value in $maxWaitTimeMs milliseconds!" + - s"Current highest committed value is ${readHighestCommittedValue(query)}") + s"Current committed values is ${readCommittedValues(query)}") } } @@ -265,7 +268,7 @@ class ContinuousSuite extends ContinuousSuiteBase { val expected = Set(0, 1, 2, 3) val continuousExecution = query.asInstanceOf[StreamingQueryWrapper].streamingQuery.asInstanceOf[ContinuousExecution] - waitForRateSourceCommittedValue(continuousExecution, expected.max, 20 * 1000) + waitForRateSourceCommittedValue(continuousExecution, Map(0 -> 2, 1 -> 3), 20 * 1000) query.stop() val results = spark.read.table("noharness").collect() diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/sources/StreamingDataSourceV2Suite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/sources/StreamingDataSourceV2Suite.scala index 05cf324f8d490..c360ec8e670bd 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/sources/StreamingDataSourceV2Suite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/sources/StreamingDataSourceV2Suite.scala @@ -25,9 +25,10 @@ import scala.collection.JavaConverters._ import org.apache.spark.sql.{DataFrame, SQLContext} import org.apache.spark.sql.connector.catalog.{SessionConfigSupport, SupportsRead, SupportsWrite, Table, TableCapability, TableProvider} import org.apache.spark.sql.connector.catalog.TableCapability._ +import org.apache.spark.sql.connector.expressions.Transform import org.apache.spark.sql.connector.read.{InputPartition, PartitionReaderFactory, Scan, ScanBuilder} import org.apache.spark.sql.connector.read.streaming.{ContinuousPartitionReaderFactory, ContinuousStream, MicroBatchStream, Offset, PartitionOffset} -import org.apache.spark.sql.connector.write.{LogicalWriteInfo, PhysicalWriteInfo, WriteBuilder, WriterCommitMessage} +import org.apache.spark.sql.connector.write.{LogicalWriteInfo, PhysicalWriteInfo, Write, WriteBuilder, WriterCommitMessage} import org.apache.spark.sql.connector.write.streaming.{StreamingDataWriterFactory, StreamingWrite} import org.apache.spark.sql.execution.datasources.DataSource import org.apache.spark.sql.execution.streaming.{ContinuousTrigger, RateStreamOffset, Sink, StreamingQueryWrapper} @@ -67,8 +68,15 @@ class FakeScanBuilder extends ScanBuilder with Scan { override def toContinuousStream(checkpointLocation: String): ContinuousStream = new FakeDataStream } -class FakeWriteBuilder extends WriteBuilder with StreamingWrite { - override def buildForStreaming(): StreamingWrite = this +class FakeWriteBuilder extends WriteBuilder { + override def build(): Write = { + new Write { + override def toStreaming: StreamingWrite = new FakeStreamingWrite + } + } +} + +class FakeStreamingWrite extends StreamingWrite { override def createStreamingWriterFactory( info: PhysicalWriteInfo): StreamingDataWriterFactory = { throw new IllegalStateException("fake sink - cannot actually write") @@ -195,6 +203,30 @@ class FakeNoWrite extends DataSourceRegister with SimpleTableProvider { } } +class FakeWriteSupportingExternalMetadata + extends DataSourceRegister + with TableProvider { + override def shortName(): String = "fake-write-supporting-external-metadata" + + override def supportsExternalMetadata(): Boolean = true + + override def inferSchema(options: CaseInsensitiveStringMap): StructType = { + throw new IllegalArgumentException( + "Data stream writer should not require inferring table schema the data source supports" + + " external Metadata.") + } + + override def getTable( + tableSchema: StructType, + partitioning: Array[Transform], + properties: util.Map[String, String]): Table = { + new Table with FakeStreamingWriteTable { + override def name(): String = "fake" + override def schema(): StructType = tableSchema + } + } +} + case class FakeWriteV1FallbackException() extends Exception class FakeSink extends Sink { @@ -265,7 +297,7 @@ class StreamingDataSourceV2Suite extends StreamTest { Trigger.Continuous(1000)) private def testPositiveCase(readFormat: String, writeFormat: String, trigger: Trigger): Unit = { - testPositiveCaseWithQuery(readFormat, writeFormat, trigger)(() => _) + testPositiveCaseWithQuery(readFormat, writeFormat, trigger)(_ => ()) } private def testPositiveCaseWithQuery( @@ -314,6 +346,17 @@ class StreamingDataSourceV2Suite extends StreamTest { } } + test("SPARK-33369: Skip schema inference in DataStreamWriter.start() if table provider " + + "supports external metadata") { + testPositiveCaseWithQuery( + "fake-read-microbatch-continuous", "fake-write-supporting-external-metadata", + Trigger.Once()) { v2Query => + val sink = v2Query.asInstanceOf[StreamingQueryWrapper].streamingQuery.sink + assert(sink.isInstanceOf[Table]) + assert(sink.asInstanceOf[Table].schema() == StructType(Nil)) + } + } + test("disabled v2 write") { // Ensure the V2 path works normally and generates a V2 sink.. testPositiveCaseWithQuery( diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamReaderWriterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamReaderWriterSuite.scala index f9fc540c2ab80..5e62db08345b2 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamReaderWriterSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamReaderWriterSuite.scala @@ -43,11 +43,13 @@ object LastOptions { var mockStreamSourceProvider = mock(classOf[StreamSourceProvider]) var mockStreamSinkProvider = mock(classOf[StreamSinkProvider]) var parameters: Map[String, String] = null + var sinkParameters: Map[String, String] = null var schema: Option[StructType] = null var partitionColumns: Seq[String] = Nil def clear(): Unit = { parameters = null + sinkParameters = null schema = null partitionColumns = null reset(mockStreamSourceProvider) @@ -87,8 +89,6 @@ class DefaultSource extends StreamSourceProvider with StreamSinkProvider { override def getOffset: Option[Offset] = Some(new LongOffset(0)) override def getBatch(start: Option[Offset], end: Offset): DataFrame = { - import spark.implicits._ - spark.internalCreateDataFrame(spark.sparkContext.emptyRDD, schema, isStreaming = true) } @@ -101,7 +101,7 @@ class DefaultSource extends StreamSourceProvider with StreamSinkProvider { parameters: Map[String, String], partitionColumns: Seq[String], outputMode: OutputMode): Sink = { - LastOptions.parameters = parameters + LastOptions.sinkParameters = parameters LastOptions.partitionColumns = partitionColumns LastOptions.mockStreamSinkProvider.createSink(spark, parameters, partitionColumns, outputMode) (_: Long, _: DataFrame) => {} @@ -109,6 +109,7 @@ class DefaultSource extends StreamSourceProvider with StreamSinkProvider { } class DataStreamReaderWriterSuite extends StreamTest with BeforeAndAfter { + import testImplicits._ private def newMetadataDir = Utils.createTempDir(namePrefix = "streaming.metadata").getCanonicalPath @@ -171,16 +172,48 @@ class DataStreamReaderWriterSuite extends StreamTest with BeforeAndAfter { df.writeStream .format("org.apache.spark.sql.streaming.test") - .option("opt1", "1") - .options(Map("opt2" -> "2")) + .option("opt1", "5") + .options(Map("opt2" -> "4")) .options(map) .option("checkpointLocation", newMetadataDir) .start() .stop() - assert(LastOptions.parameters("opt1") == "1") - assert(LastOptions.parameters("opt2") == "2") - assert(LastOptions.parameters("opt3") == "3") + assert(LastOptions.sinkParameters("opt1") == "5") + assert(LastOptions.sinkParameters("opt2") == "4") + assert(LastOptions.sinkParameters("opt3") == "3") + assert(LastOptions.sinkParameters.contains("checkpointLocation")) + } + + test("SPARK-32832: later option should override earlier options for load()") { + spark.readStream + .format("org.apache.spark.sql.streaming.test") + .option("paTh", "1") + .option("PATH", "2") + .option("Path", "3") + .option("patH", "4") + .option("path", "5") + .load() + assert(LastOptions.parameters("path") == "5") + } + + test("SPARK-32832: later option should override earlier options for start()") { + val ds = spark.readStream + .format("org.apache.spark.sql.streaming.test") + .load() + assert(LastOptions.parameters.isEmpty) + + ds.writeStream + .format("org.apache.spark.sql.streaming.test") + .option("checkpointLocation", newMetadataDir) + .option("paTh", "1") + .option("PATH", "2") + .option("Path", "3") + .option("patH", "4") + .option("path", "5") + .start() + .stop() + assert(LastOptions.sinkParameters("path") == "5") } test("partitioning") { @@ -397,8 +430,8 @@ class DataStreamReaderWriterSuite extends StreamTest with BeforeAndAfter { .format("org.apache.spark.sql.streaming.test") .load() - var w = df.writeStream - var e = intercept[IllegalArgumentException](w.foreach(null)) + val w = df.writeStream + val e = intercept[IllegalArgumentException](w.foreach(null)) Seq("foreach", "null").foreach { s => assert(e.getMessage.toLowerCase(Locale.ROOT).contains(s.toLowerCase(Locale.ROOT))) } @@ -414,8 +447,8 @@ class DataStreamReaderWriterSuite extends StreamTest with BeforeAndAfter { override def process(value: Row): Unit = {} override def close(errorOrNull: Throwable): Unit = {} } - var w = df.writeStream.partitionBy("value") - var e = intercept[AnalysisException](w.foreach(foreachWriter).start()) + val w = df.writeStream.partitionBy("value") + val e = intercept[AnalysisException](w.foreach(foreachWriter).start()) Seq("foreach", "partitioning").foreach { s => assert(e.getMessage.toLowerCase(Locale.ROOT).contains(s.toLowerCase(Locale.ROOT))) } @@ -435,7 +468,6 @@ class DataStreamReaderWriterSuite extends StreamTest with BeforeAndAfter { } private def testMemorySinkCheckpointRecovery(chkLoc: String, provideInWriter: Boolean): Unit = { - import testImplicits._ val ms = new MemoryStream[Int](0, sqlContext) val df = ms.toDF().toDF("a") val tableName = "test" @@ -703,4 +735,81 @@ class DataStreamReaderWriterSuite extends StreamTest with BeforeAndAfter { queries.foreach(_.stop()) } } + + test("SPARK-32516: 'path' cannot coexist with load()'s path parameter") { + def verifyLoadFails(f: => DataFrame): Unit = { + val e = intercept[AnalysisException](f) + assert(e.getMessage.contains( + "Either remove the path option, or call load() without the parameter")) + } + + verifyLoadFails(spark.readStream.option("path", "tmp1").parquet("tmp2")) + verifyLoadFails(spark.readStream.option("path", "tmp1").parquet("")) + verifyLoadFails(spark.readStream.option("path", "tmp1").format("parquet").load("tmp2")) + verifyLoadFails(spark.readStream.option("path", "tmp1").format("parquet").load("")) + + withClue("SPARK-32516: legacy behavior") { + withSQLConf(SQLConf.LEGACY_PATH_OPTION_BEHAVIOR.key -> "true") { + spark.readStream + .format("org.apache.spark.sql.streaming.test") + .option("path", "tmp1") + .load("tmp2") + // The legacy behavior overwrites the path option. + assert(LastOptions.parameters("path") == "tmp2") + } + } + } + + test("SPARK-32516: 'path' cannot coexist with start()'s path parameter") { + val df = spark.readStream + .format("org.apache.spark.sql.streaming.test") + .load("tmp1") + + def verifyStartFails(f: => StreamingQuery): Unit = { + val e = intercept[AnalysisException](f) + assert(e.getMessage.contains( + "Either remove the path option, or call start() without the parameter")) + } + + verifyStartFails( + df.writeStream + .format("org.apache.spark.sql.streaming.test") + .option("path", "tmp2") + .start("tmp3")) + verifyStartFails( + df.writeStream + .format("org.apache.spark.sql.streaming.test") + .option("path", "tmp2") + .start("")) + + withClue("SPARK-32516: legacy behavior") { + withTempDir { checkpointPath => + withSQLConf(SQLConf.LEGACY_PATH_OPTION_BEHAVIOR.key -> "true", + SQLConf.CHECKPOINT_LOCATION.key -> checkpointPath.getAbsolutePath) { + df.writeStream + .format("org.apache.spark.sql.streaming.test") + .option("path", "tmp4") + .start("tmp5") + .stop() + // The legacy behavior overwrites the path option. + assert(LastOptions.sinkParameters("path") == "tmp5") + } + } + } + } + + test("SPARK-32853: consecutive load/start calls should be allowed") { + val dfr = spark.readStream.format(classOf[DefaultSource].getName) + var df = dfr.load("1") + df = dfr.load("2") + withTempDir { checkpointPath => + val dfw = df.writeStream + .option("checkpointLocation", checkpointPath.getCanonicalPath) + .format(classOf[DefaultSource].getName) + var query = dfw.start("1") + query.stop() + query = dfw.start("2") + query.stop() + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamTableAPISuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamTableAPISuite.scala new file mode 100644 index 0000000000000..49e5218ea3352 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataStreamTableAPISuite.scala @@ -0,0 +1,463 @@ +/* + * 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. + */ + +package org.apache.spark.sql.streaming.test + +import java.io.File +import java.util + +import scala.collection.JavaConverters._ + +import org.scalatest.BeforeAndAfter + +import org.apache.spark.sql.{AnalysisException, Row} +import org.apache.spark.sql.catalyst.TableIdentifier +import org.apache.spark.sql.catalyst.analysis.TableAlreadyExistsException +import org.apache.spark.sql.catalyst.catalog.{CatalogStorageFormat, CatalogTable, CatalogTableType} +import org.apache.spark.sql.catalyst.streaming.StreamingRelationV2 +import org.apache.spark.sql.connector.{FakeV2Provider, InMemoryTableSessionCatalog} +import org.apache.spark.sql.connector.catalog.{Identifier, InMemoryTableCatalog, SupportsRead, Table, TableCapability, V2TableWithV1Fallback} +import org.apache.spark.sql.connector.expressions.Transform +import org.apache.spark.sql.connector.read.ScanBuilder +import org.apache.spark.sql.execution.streaming.{MemoryStream, MemoryStreamScanBuilder} +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.streaming.StreamTest +import org.apache.spark.sql.streaming.sources.FakeScanBuilder +import org.apache.spark.sql.types.StructType +import org.apache.spark.sql.util.CaseInsensitiveStringMap +import org.apache.spark.util.Utils + +class DataStreamTableAPISuite extends StreamTest with BeforeAndAfter { + import testImplicits._ + import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._ + + before { + spark.conf.set("spark.sql.catalog.testcat", classOf[InMemoryTableCatalog].getName) + spark.conf.set("spark.sql.catalog.teststream", classOf[InMemoryStreamTableCatalog].getName) + } + + after { + spark.sessionState.catalogManager.reset() + spark.sessionState.conf.clear() + sqlContext.streams.active.foreach(_.stop()) + } + + test("read: table API with file source") { + Seq("parquet", "").foreach { source => + withSQLConf(SQLConf.USE_V1_SOURCE_LIST.key -> source) { + withTempDir { tempDir => + val tblName = "my_table" + val dir = tempDir.getAbsolutePath + withTable(tblName) { + spark.range(3).write.format("parquet").option("path", dir).saveAsTable(tblName) + + testStream(spark.readStream.table(tblName))( + ProcessAllAvailable(), + CheckAnswer(Row(0), Row(1), Row(2)) + ) + } + } + } + } + } + + test("read: read non-exist table") { + intercept[AnalysisException] { + spark.readStream.table("non_exist_table") + }.message.contains("Table not found") + } + + test("read: stream table API with temp view") { + val tblName = "my_table" + val stream = MemoryStream[Int] + withTable(tblName) { + stream.toDF().createOrReplaceTempView(tblName) + + testStream(spark.readStream.table(tblName)) ( + AddData(stream, 1, 2, 3), + CheckLastBatch(1, 2, 3), + AddData(stream, 4, 5), + CheckLastBatch(4, 5) + ) + } + } + + test("read: stream table API with non-streaming temp view") { + val tblName = "my_table" + withTable(tblName) { + spark.range(3).createOrReplaceTempView(tblName) + intercept[AnalysisException] { + spark.readStream.table(tblName) + }.message.contains("is not a temp view of streaming logical plan") + } + } + + test("read: read table without streaming capability support") { + val tableIdentifier = "testcat.table_name" + + spark.sql(s"CREATE TABLE $tableIdentifier (id bigint, data string) USING foo") + + intercept[AnalysisException] { + spark.readStream.table(tableIdentifier) + }.message.contains("does not support either micro-batch or continuous scan") + } + + test("read: read table with custom catalog") { + val tblName = "teststream.table_name" + withTable(tblName) { + spark.sql(s"CREATE TABLE $tblName (data int) USING foo") + val stream = MemoryStream[Int] + val testCatalog = spark.sessionState.catalogManager.catalog("teststream").asTableCatalog + val table = testCatalog.loadTable(Identifier.of(Array(), "table_name")) + table.asInstanceOf[InMemoryStreamTable].setStream(stream) + + testStream(spark.readStream.table(tblName)) ( + AddData(stream, 1, 2, 3), + CheckLastBatch(1, 2, 3), + AddData(stream, 4, 5), + CheckLastBatch(4, 5) + ) + } + } + + test("read: read table with custom catalog & namespace") { + spark.sql("CREATE NAMESPACE teststream.ns") + + val tblName = "teststream.ns.table_name" + withTable(tblName) { + spark.sql(s"CREATE TABLE $tblName (data int) USING foo") + val stream = MemoryStream[Int] + val testCatalog = spark.sessionState.catalogManager.catalog("teststream").asTableCatalog + val table = testCatalog.loadTable(Identifier.of(Array("ns"), "table_name")) + table.asInstanceOf[InMemoryStreamTable].setStream(stream) + + testStream(spark.readStream.table(tblName)) ( + AddData(stream, 1, 2, 3), + CheckLastBatch(1, 2, 3), + AddData(stream, 4, 5), + CheckLastBatch(4, 5) + ) + } + } + + test("read: fallback to V1 relation") { + val tblName = DataStreamTableAPISuite.V1FallbackTestTableName + spark.conf.set(SQLConf.V2_SESSION_CATALOG_IMPLEMENTATION.key, + classOf[InMemoryStreamTableCatalog].getName) + val v2Source = classOf[FakeV2Provider].getName + withTempDir { tempDir => + withTable(tblName) { + spark.sql(s"CREATE TABLE $tblName (data int) USING $v2Source") + + // Check the StreamingRelationV2 has been replaced by StreamingRelation + val plan = spark.readStream.option("path", tempDir.getCanonicalPath).table(tblName) + .queryExecution.analyzed.collectFirst { + case d: StreamingRelationV2 => d + } + assert(plan.isEmpty) + } + } + } + + test("write: write to table with custom catalog & no namespace") { + val tableIdentifier = "testcat.table_name" + + withTable(tableIdentifier) { + spark.sql(s"CREATE TABLE $tableIdentifier (id bigint, data string) USING foo") + checkAnswer(spark.table(tableIdentifier), Seq.empty) + + runTestWithStreamAppend(tableIdentifier) + } + } + + test("write: write to table with custom catalog & namespace") { + spark.sql("CREATE NAMESPACE testcat.ns") + val tableIdentifier = "testcat.ns.table_name" + + withTable(tableIdentifier) { + spark.sql(s"CREATE TABLE $tableIdentifier (id bigint, data string) USING foo") + checkAnswer(spark.table(tableIdentifier), Seq.empty) + + runTestWithStreamAppend(tableIdentifier) + } + } + + test("write: write to table with default session catalog") { + val v2Source = classOf[FakeV2Provider].getName + spark.conf.set(SQLConf.V2_SESSION_CATALOG_IMPLEMENTATION.key, + classOf[InMemoryTableSessionCatalog].getName) + + spark.sql("CREATE NAMESPACE ns") + + val tableIdentifier = "ns.table_name" + withTable(tableIdentifier) { + spark.sql(s"CREATE TABLE $tableIdentifier (id bigint, data string) USING $v2Source") + checkAnswer(spark.table(tableIdentifier), Seq.empty) + + runTestWithStreamAppend(tableIdentifier) + } + } + + test("write: write to non-exist table with custom catalog") { + val tableIdentifier = "testcat.nonexistenttable" + + withTable(tableIdentifier) { + runTestWithStreamAppend(tableIdentifier) + } + } + + test("write: write to temporary view isn't allowed yet") { + val tableIdentifier = "testcat.table_name" + val tempViewIdentifier = "temp_view" + + spark.sql(s"CREATE TABLE $tableIdentifier (id bigint, data string) USING foo") + checkAnswer(spark.table(tableIdentifier), Seq.empty) + + spark.table(tableIdentifier).createOrReplaceTempView(tempViewIdentifier) + + withTempDir { checkpointDir => + val exc = intercept[AnalysisException] { + runStreamQueryAppendMode(tempViewIdentifier, checkpointDir, Seq.empty, Seq.empty) + } + assert(exc.getMessage.contains("doesn't support streaming write")) + } + } + + test("write: write to view shouldn't be allowed") { + val tableIdentifier = "testcat.table_name" + val viewIdentifier = "table_view" + + spark.sql(s"CREATE TABLE $tableIdentifier (id bigint, data string) USING foo") + checkAnswer(spark.table(tableIdentifier), Seq.empty) + + spark.sql(s"CREATE VIEW $viewIdentifier AS SELECT id, data FROM $tableIdentifier") + + withTempDir { checkpointDir => + val exc = intercept[AnalysisException] { + runStreamQueryAppendMode(viewIdentifier, checkpointDir, Seq.empty, Seq.empty) + } + assert(exc.getMessage.contains(s"Streaming into views $viewIdentifier is not supported")) + } + } + + test("write: write to an external table") { + withTempDir { dir => + val tableName = "stream_test" + withTable(tableName) { + checkForStreamTable(Some(dir), tableName) + } + } + } + + test("write: write to a managed table") { + val tableName = "stream_test" + withTable(tableName) { + checkForStreamTable(None, tableName) + } + } + + test("write: write to an external table with existing path") { + withTempDir { dir => + val tableName = "stream_test" + withTable(tableName) { + // The file written by batch will not be seen after the table was written by a streaming + // query. This is because we load files from the metadata log instead of listing them + // using HDFS API. + Seq(4, 5, 6).toDF("value").write.format("parquet") + .option("path", dir.getCanonicalPath).saveAsTable(tableName) + + checkForStreamTable(Some(dir), tableName) + } + } + } + + test("write: write to a managed table with existing path") { + val tableName = "stream_test" + withTable(tableName) { + // The file written by batch will not be seen after the table was written by a streaming + // query. This is because we load files from the metadata log instead of listing them + // using HDFS API. + Seq(4, 5, 6).toDF("value").write.format("parquet").saveAsTable(tableName) + + checkForStreamTable(None, tableName) + } + } + + test("write: write to an external path and create table") { + withTempDir { dir => + val tableName = "stream_test" + withTable(tableName) { + // The file written by batch will not be seen after the table was written by a streaming + // query. This is because we load files from the metadata log instead of listing them + // using HDFS API. + Seq(4, 5, 6).toDF("value").write + .mode("append").format("parquet").save(dir.getCanonicalPath) + + checkForStreamTable(Some(dir), tableName) + } + } + } + + test("write: write to table with different format shouldn't be allowed") { + val tableName = "stream_test" + + spark.sql(s"CREATE TABLE $tableName (id bigint, data string) USING json") + checkAnswer(spark.table(tableName), Seq.empty) + + withTempDir { checkpointDir => + val exc = intercept[AnalysisException] { + runStreamQueryAppendMode(tableName, checkpointDir, Seq.empty, Seq.empty) + } + assert(exc.getMessage.contains("The input source(parquet) is different from the table " + + s"$tableName's data source provider(json)")) + } + } + + private def checkForStreamTable(dir: Option[File], tableName: String): Unit = { + val memory = MemoryStream[Int] + val dsw = memory.toDS().writeStream.format("parquet") + dir.foreach { output => + dsw.option("path", output.getCanonicalPath) + } + val sq = dsw + .option("checkpointLocation", Utils.createTempDir().getCanonicalPath) + .toTable(tableName) + memory.addData(1, 2, 3) + sq.processAllAvailable() + + checkDataset( + spark.table(tableName).as[Int], + 1, 2, 3) + val catalogTable = spark.sessionState.catalog.getTableMetadata(TableIdentifier(tableName)) + val path = if (dir.nonEmpty) { + dir.get + } else { + new File(catalogTable.location) + } + checkDataset( + spark.read.format("parquet").load(path.getCanonicalPath).as[Int], + 1, 2, 3) + } + + private def runTestWithStreamAppend(tableIdentifier: String) = { + withTempDir { checkpointDir => + val input1 = Seq((1L, "a"), (2L, "b"), (3L, "c")) + verifyStreamAppend(tableIdentifier, checkpointDir, Seq.empty, input1, input1) + + val input2 = Seq((4L, "d"), (5L, "e"), (6L, "f")) + verifyStreamAppend(tableIdentifier, checkpointDir, Seq(input1), input2, input1 ++ input2) + } + } + + private def runStreamQueryAppendMode( + tableIdentifier: String, + checkpointDir: File, + prevInputs: Seq[Seq[(Long, String)]], + newInputs: Seq[(Long, String)]): Unit = { + val inputData = MemoryStream[(Long, String)] + val inputDF = inputData.toDF().toDF("id", "data") + + prevInputs.foreach { inputsPerBatch => + inputData.addData(inputsPerBatch: _*) + } + + val query = inputDF + .writeStream + .option("checkpointLocation", checkpointDir.getAbsolutePath) + .toTable(tableIdentifier) + + inputData.addData(newInputs: _*) + + query.processAllAvailable() + query.stop() + } + + private def verifyStreamAppend( + tableIdentifier: String, + checkpointDir: File, + prevInputs: Seq[Seq[(Long, String)]], + newInputs: Seq[(Long, String)], + expectedOutputs: Seq[(Long, String)]): Unit = { + runStreamQueryAppendMode(tableIdentifier, checkpointDir, prevInputs, newInputs) + checkAnswer( + spark.table(tableIdentifier), + expectedOutputs.map { case (id, data) => Row(id, data) } + ) + } +} + +object DataStreamTableAPISuite { + val V1FallbackTestTableName = "fallbackV1Test" +} + +class InMemoryStreamTable(override val name: String) extends Table with SupportsRead { + var stream: MemoryStream[Int] = _ + + def setStream(inputData: MemoryStream[Int]): Unit = stream = inputData + + override def schema(): StructType = stream.fullSchema() + + override def capabilities(): util.Set[TableCapability] = { + Set(TableCapability.MICRO_BATCH_READ, TableCapability.CONTINUOUS_READ).asJava + } + + override def newScanBuilder(options: CaseInsensitiveStringMap): ScanBuilder = { + new MemoryStreamScanBuilder(stream) + } +} + +class NonStreamV2Table(override val name: String) + extends Table with SupportsRead with V2TableWithV1Fallback { + override def schema(): StructType = StructType(Nil) + override def capabilities(): util.Set[TableCapability] = Set(TableCapability.BATCH_READ).asJava + override def newScanBuilder(options: CaseInsensitiveStringMap): ScanBuilder = new FakeScanBuilder + + override def v1Table: CatalogTable = { + CatalogTable( + identifier = + TableIdentifier(DataStreamTableAPISuite.V1FallbackTestTableName, Some("default")), + tableType = CatalogTableType.MANAGED, + storage = CatalogStorageFormat.empty, + owner = null, + schema = schema(), + provider = Some("parquet")) + } +} + + +class InMemoryStreamTableCatalog extends InMemoryTableCatalog { + import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._ + + override def createTable( + ident: Identifier, + schema: StructType, + partitions: Array[Transform], + properties: util.Map[String, String]): Table = { + if (tables.containsKey(ident)) { + throw new TableAlreadyExistsException(ident) + } + + val table = if (ident.name() == DataStreamTableAPISuite.V1FallbackTestTableName) { + new NonStreamV2Table(s"$name.${ident.quoted}") + } else { + new InMemoryStreamTable(s"$name.${ident.quoted}") + } + tables.put(ident, table) + namespaces.putIfAbsent(ident.namespace.toList, Map()) + table + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/StreamingQueryHistorySuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/StreamingQueryHistorySuite.scala new file mode 100644 index 0000000000000..160535ea4d048 --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/StreamingQueryHistorySuite.scala @@ -0,0 +1,63 @@ +/* + * 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. + */ + +package org.apache.spark.sql.streaming.ui + +import java.util.Locale +import javax.servlet.http.HttpServletRequest + +import org.mockito.Mockito.{mock, when} +import org.scalatest.BeforeAndAfter + +import org.apache.spark.deploy.history.{Utils => HsUtils} +import org.apache.spark.sql.execution.ui.StreamingQueryStatusStore +import org.apache.spark.sql.test.SharedSparkSession + +class StreamingQueryHistorySuite extends SharedSparkSession with BeforeAndAfter { + + test("support streaming query events") { + val logDir = Thread.currentThread().getContextClassLoader.getResource("spark-events").toString + HsUtils.withFsHistoryProvider(logDir) { provider => + val appUi = provider.getAppUI("local-1596020211915", None).getOrElse { + assert(false, "Failed to load event log of local-1596020211915.") + null + } + assert(appUi.ui.appName == "StructuredKafkaWordCount") + assert(appUi.ui.store.store.count(classOf[StreamingQueryData]) == 1) + assert(appUi.ui.store.store.count(classOf[StreamingQueryProgressWrapper]) == 8) + + val store = new StreamingQueryStatusStore(appUi.ui.store.store) + val tab = new StreamingQueryTab(store, appUi.ui) + val request = mock(classOf[HttpServletRequest]) + var html = new StreamingQueryPage(tab).render(request) + .toString().toLowerCase(Locale.ROOT) + // 81.39: Avg Input /sec + assert(html.contains("81.39")) + // 157.05: Avg Process /sec + assert(html.contains("157.05")) + + val id = "8d268dc2-bc9c-4be8-97a9-b135d2943028" + val runId = "e225d92f-2545-48f8-87a2-9c0309580f8a" + when(request.getParameter("id")).thenReturn(runId) + html = new StreamingQueryStatisticsPage(tab).render(request) + .toString().toLowerCase(Locale.ROOT) + assert(html.contains("8 completed batches")) + assert(html.contains(id)) + assert(html.contains(runId)) + } + } +} diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/StreamingQueryPageSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/StreamingQueryPageSuite.scala index 2a1e18ab66bb7..246fa1f7c9184 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/StreamingQueryPageSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/StreamingQueryPageSuite.scala @@ -20,12 +20,16 @@ package org.apache.spark.sql.streaming.ui import java.util.{Locale, UUID} import javax.servlet.http.HttpServletRequest +import scala.xml.Node + import org.mockito.Mockito.{mock, when, RETURNS_SMART_NULLS} import org.scalatest.BeforeAndAfter -import scala.xml.Node +import org.apache.spark.SparkConf +import org.apache.spark.sql.execution.ui.StreamingQueryStatusStore import org.apache.spark.sql.streaming.StreamingQueryProgress import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.ui.SparkUI class StreamingQueryPageSuite extends SharedSparkSession with BeforeAndAfter { @@ -33,31 +37,28 @@ class StreamingQueryPageSuite extends SharedSparkSession with BeforeAndAfter { val id = UUID.randomUUID() val request = mock(classOf[HttpServletRequest]) val tab = mock(classOf[StreamingQueryTab], RETURNS_SMART_NULLS) - val statusListener = mock(classOf[StreamingQueryStatusListener], RETURNS_SMART_NULLS) + val store = mock(classOf[StreamingQueryStatusStore], RETURNS_SMART_NULLS) when(tab.appName).thenReturn("testing") when(tab.headerTabs).thenReturn(Seq.empty) - when(tab.statusListener).thenReturn(statusListener) + when(tab.store).thenReturn(store) val streamQuery = createStreamQueryUIData(id) - when(statusListener.allQueryStatus).thenReturn(Seq(streamQuery)) + when(store.allQueryUIData).thenReturn(Seq(streamQuery)) var html = renderStreamingQueryPage(request, tab) .toString().toLowerCase(Locale.ROOT) assert(html.contains("active streaming queries (1)")) - assert(html.contains("completed streaming queries (0)")) - when(streamQuery.isActive).thenReturn(false) - when(streamQuery.exception).thenReturn(None) + when(streamQuery.summary.isActive).thenReturn(false) + when(streamQuery.summary.exception).thenReturn(None) html = renderStreamingQueryPage(request, tab) .toString().toLowerCase(Locale.ROOT) - assert(html.contains("active streaming queries (0)")) assert(html.contains("completed streaming queries (1)")) assert(html.contains("finished")) - when(streamQuery.isActive).thenReturn(false) - when(streamQuery.exception).thenReturn(Option("exception in query")) + when(streamQuery.summary.isActive).thenReturn(false) + when(streamQuery.summary.exception).thenReturn(Option("exception in query")) html = renderStreamingQueryPage(request, tab) .toString().toLowerCase(Locale.ROOT) - assert(html.contains("active streaming queries (0)")) assert(html.contains("completed streaming queries (1)")) assert(html.contains("failed")) assert(html.contains("exception in query")) @@ -67,14 +68,20 @@ class StreamingQueryPageSuite extends SharedSparkSession with BeforeAndAfter { val id = UUID.randomUUID() val request = mock(classOf[HttpServletRequest]) val tab = mock(classOf[StreamingQueryTab], RETURNS_SMART_NULLS) - val statusListener = mock(classOf[StreamingQueryStatusListener], RETURNS_SMART_NULLS) + val store = mock(classOf[StreamingQueryStatusStore], RETURNS_SMART_NULLS) when(request.getParameter("id")).thenReturn(id.toString) when(tab.appName).thenReturn("testing") when(tab.headerTabs).thenReturn(Seq.empty) - when(tab.statusListener).thenReturn(statusListener) + when(tab.store).thenReturn(store) + val ui = mock(classOf[SparkUI]) + when(request.getParameter("id")).thenReturn(id.toString) + when(tab.appName).thenReturn("testing") + when(tab.headerTabs).thenReturn(Seq.empty) + when(ui.conf).thenReturn(new SparkConf()) + when(tab.parent).thenReturn(ui) val streamQuery = createStreamQueryUIData(id) - when(statusListener.allQueryStatus).thenReturn(Seq(streamQuery)) + when(store.allQueryUIData).thenReturn(Seq(streamQuery)) val html = renderStreamingQueryStatisticsPage(request, tab) .toString().toLowerCase(Locale.ROOT) @@ -92,15 +99,18 @@ class StreamingQueryPageSuite extends SharedSparkSession with BeforeAndAfter { when(progress.batchId).thenReturn(2) when(progress.prettyJson).thenReturn("""{"a":1}""") + val summary = mock(classOf[StreamingQueryData], RETURNS_SMART_NULLS) + when(summary.isActive).thenReturn(true) + when(summary.name).thenReturn("query") + when(summary.id).thenReturn(id) + when(summary.runId).thenReturn(id) + when(summary.startTimestamp).thenReturn(1L) + when(summary.exception).thenReturn(None) + val streamQuery = mock(classOf[StreamingQueryUIData], RETURNS_SMART_NULLS) - when(streamQuery.isActive).thenReturn(true) - when(streamQuery.name).thenReturn("query") - when(streamQuery.id).thenReturn(id) - when(streamQuery.runId).thenReturn(id) - when(streamQuery.startTimestamp).thenReturn(1L) + when(streamQuery.summary).thenReturn(summary) when(streamQuery.lastProgress).thenReturn(progress) when(streamQuery.recentProgress).thenReturn(Array(progress)) - when(streamQuery.exception).thenReturn(None) streamQuery } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/StreamingQueryStatusListenerSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/StreamingQueryStatusListenerSuite.scala index 6aa440e5609c5..91c55d5598a6b 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/StreamingQueryStatusListenerSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/StreamingQueryStatusListenerSuite.scala @@ -17,19 +17,28 @@ package org.apache.spark.sql.streaming.ui -import java.util.UUID +import java.text.SimpleDateFormat +import java.util.{Date, UUID} import org.mockito.Mockito.{mock, when, RETURNS_SMART_NULLS} +import org.scalatest.time.SpanSugar._ +import org.apache.spark.sql.catalyst.util.DateTimeUtils.getTimeZone +import org.apache.spark.sql.execution.ui.StreamingQueryStatusStore +import org.apache.spark.sql.internal.StaticSQLConf import org.apache.spark.sql.streaming.{StreamingQueryListener, StreamingQueryProgress, StreamTest} import org.apache.spark.sql.streaming +import org.apache.spark.status.ElementTrackingStore +import org.apache.spark.util.kvstore.InMemoryStore class StreamingQueryStatusListenerSuite extends StreamTest { test("onQueryStarted, onQueryProgress, onQueryTerminated") { - val listener = new StreamingQueryStatusListener(spark.sparkContext.conf) + val kvStore = new ElementTrackingStore(new InMemoryStore(), sparkConf) + val listener = new StreamingQueryStatusListener(spark.sparkContext.conf, kvStore) + val queryStore = new StreamingQueryStatusStore(kvStore) - // hanlde query started event + // handle query started event val id = UUID.randomUUID() val runId = UUID.randomUUID() val startEvent = new StreamingQueryListener.QueryStartedEvent( @@ -37,8 +46,9 @@ class StreamingQueryStatusListenerSuite extends StreamTest { listener.onQueryStarted(startEvent) // result checking - assert(listener.activeQueryStatus.size() == 1) - assert(listener.activeQueryStatus.get(runId).name == "test") + assert(queryStore.allQueryUIData.count(_.summary.isActive) == 1) + assert(queryStore.allQueryUIData.filter(_.summary.isActive).exists(uiData => + uiData.summary.runId == runId && uiData.summary.name.equals("test"))) // handle query progress event val progress = mock(classOf[StreamingQueryProgress], RETURNS_SMART_NULLS) @@ -53,28 +63,32 @@ class StreamingQueryStatusListenerSuite extends StreamTest { listener.onQueryProgress(processEvent) // result checking - val activeQuery = listener.activeQueryStatus.get(runId) - assert(activeQuery.isActive) - assert(activeQuery.recentProgress.length == 1) - assert(activeQuery.lastProgress.id == id) - assert(activeQuery.lastProgress.runId == runId) - assert(activeQuery.lastProgress.timestamp == "2001-10-01T01:00:00.100Z") - assert(activeQuery.lastProgress.inputRowsPerSecond == 10.0) - assert(activeQuery.lastProgress.processedRowsPerSecond == 12.0) - assert(activeQuery.lastProgress.batchId == 2) - assert(activeQuery.lastProgress.prettyJson == """{"a":1}""") + val activeQuery = + queryStore.allQueryUIData.filter(_.summary.isActive).find(_.summary.runId == runId) + assert(activeQuery.isDefined) + assert(activeQuery.get.summary.isActive) + assert(activeQuery.get.recentProgress.length == 1) + assert(activeQuery.get.lastProgress.id == id) + assert(activeQuery.get.lastProgress.runId == runId) + assert(activeQuery.get.lastProgress.timestamp == "2001-10-01T01:00:00.100Z") + assert(activeQuery.get.lastProgress.inputRowsPerSecond == 10.0) + assert(activeQuery.get.lastProgress.processedRowsPerSecond == 12.0) + assert(activeQuery.get.lastProgress.batchId == 2) + assert(activeQuery.get.lastProgress.prettyJson == """{"a":1}""") // handle terminate event val terminateEvent = new StreamingQueryListener.QueryTerminatedEvent(id, runId, None) listener.onQueryTerminated(terminateEvent) - assert(!listener.inactiveQueryStatus.head.isActive) - assert(listener.inactiveQueryStatus.head.runId == runId) - assert(listener.inactiveQueryStatus.head.id == id) + assert(!queryStore.allQueryUIData.filterNot(_.summary.isActive).head.summary.isActive) + assert(queryStore.allQueryUIData.filterNot(_.summary.isActive).head.summary.runId == runId) + assert(queryStore.allQueryUIData.filterNot(_.summary.isActive).head.summary.id == id) } test("same query start multiple times") { - val listener = new StreamingQueryStatusListener(spark.sparkContext.conf) + val kvStore = new ElementTrackingStore(new InMemoryStore(), sparkConf) + val listener = new StreamingQueryStatusListener(spark.sparkContext.conf, kvStore) + val queryStore = new StreamingQueryStatusStore(kvStore) // handle first time start val id = UUID.randomUUID() @@ -94,11 +108,106 @@ class StreamingQueryStatusListenerSuite extends StreamTest { listener.onQueryStarted(startEvent1) // result checking - assert(listener.activeQueryStatus.size() == 1) - assert(listener.inactiveQueryStatus.length == 1) - assert(listener.activeQueryStatus.containsKey(runId1)) - assert(listener.activeQueryStatus.get(runId1).id == id) - assert(listener.inactiveQueryStatus.head.runId == runId0) - assert(listener.inactiveQueryStatus.head.id == id) + assert(queryStore.allQueryUIData.count(_.summary.isActive) == 1) + assert(queryStore.allQueryUIData.filterNot(_.summary.isActive).length == 1) + assert(queryStore.allQueryUIData.filter(_.summary.isActive).exists(_.summary.runId == runId1)) + assert(queryStore.allQueryUIData.filter(_.summary.isActive).exists(uiData => + uiData.summary.runId == runId1 && uiData.summary.id == id)) + assert(queryStore.allQueryUIData.filterNot(_.summary.isActive).head.summary.runId == runId0) + assert(queryStore.allQueryUIData.filterNot(_.summary.isActive).head.summary.id == id) + } + + test("test small retained queries") { + val kvStore = new ElementTrackingStore(new InMemoryStore(), sparkConf) + val conf = spark.sparkContext.conf + conf.set(StaticSQLConf.STREAMING_UI_RETAINED_QUERIES.key, "2") + val listener = new StreamingQueryStatusListener(conf, kvStore) + val queryStore = new StreamingQueryStatusStore(kvStore) + + def addNewQuery(): (UUID, UUID) = { + val format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") // ISO8601 + format.setTimeZone(getTimeZone("UTC")) + val id = UUID.randomUUID() + val runId = UUID.randomUUID() + val startEvent = new StreamingQueryListener.QueryStartedEvent( + id, runId, "test1", format.format(new Date(System.currentTimeMillis()))) + listener.onQueryStarted(startEvent) + (id, runId) + } + + def checkInactiveQueryStatus(numInactives: Int, targetInactives: Seq[UUID]): Unit = { + eventually(timeout(10.seconds)) { + val inactiveQueries = queryStore.allQueryUIData.filter(!_.summary.isActive) + assert(inactiveQueries.size == numInactives) + assert(inactiveQueries.map(_.summary.id).toSet == targetInactives.toSet) + } + } + + val (id1, runId1) = addNewQuery() + val (id2, runId2) = addNewQuery() + val (id3, runId3) = addNewQuery() + assert(queryStore.allQueryUIData.count(!_.summary.isActive) == 0) + + val terminateEvent1 = new StreamingQueryListener.QueryTerminatedEvent(id1, runId1, None) + listener.onQueryTerminated(terminateEvent1) + checkInactiveQueryStatus(1, Seq(id1)) + val terminateEvent2 = new StreamingQueryListener.QueryTerminatedEvent(id2, runId2, None) + listener.onQueryTerminated(terminateEvent2) + checkInactiveQueryStatus(2, Seq(id1, id2)) + val terminateEvent3 = new StreamingQueryListener.QueryTerminatedEvent(id3, runId3, None) + listener.onQueryTerminated(terminateEvent3) + checkInactiveQueryStatus(2, Seq(id2, id3)) + } + + test("test small retained progress") { + val kvStore = new ElementTrackingStore(new InMemoryStore(), sparkConf) + val conf = spark.sparkContext.conf + conf.set(StaticSQLConf.STREAMING_UI_RETAINED_PROGRESS_UPDATES.key, "5") + val listener = new StreamingQueryStatusListener(conf, kvStore) + val queryStore = new StreamingQueryStatusStore(kvStore) + + val id = UUID.randomUUID() + val runId = UUID.randomUUID() + val startEvent = new StreamingQueryListener.QueryStartedEvent( + id, runId, "test", "2016-12-05T20:54:20.827Z") + listener.onQueryStarted(startEvent) + + var batchId: Int = 0 + + def addQueryProgress(): Unit = { + val progress = mockProgressData(id, runId) + val processEvent = new streaming.StreamingQueryListener.QueryProgressEvent(progress) + listener.onQueryProgress(processEvent) + } + + def mockProgressData(id: UUID, runId: UUID): StreamingQueryProgress = { + val format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'") // ISO8601 + format.setTimeZone(getTimeZone("UTC")) + + val progress = mock(classOf[StreamingQueryProgress], RETURNS_SMART_NULLS) + when(progress.id).thenReturn(id) + when(progress.runId).thenReturn(runId) + when(progress.timestamp).thenReturn(format.format(new Date(System.currentTimeMillis()))) + when(progress.inputRowsPerSecond).thenReturn(10.0) + when(progress.processedRowsPerSecond).thenReturn(12.0) + when(progress.batchId).thenReturn(batchId) + when(progress.prettyJson).thenReturn("""{"a":1}""") + + batchId += 1 + progress + } + + def checkQueryProcessData(targetNum: Int): Unit = { + eventually(timeout(10.seconds)) { + assert(queryStore.getQueryProgressData(runId).size == targetNum) + } + } + + Array.tabulate(4) { _ => addQueryProgress() } + checkQueryProcessData(4) + addQueryProgress() + checkQueryProcessData(5) + addQueryProgress() + checkQueryProcessData(5) } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/UISeleniumSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/UISeleniumSuite.scala index fdf4c6634d79f..db3d6529c9906 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/UISeleniumSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/UISeleniumSuite.scala @@ -19,8 +19,10 @@ package org.apache.spark.sql.streaming.ui import org.openqa.selenium.WebDriver import org.openqa.selenium.htmlunit.HtmlUnitDriver -import org.scalatest._ +import org.scalatest.BeforeAndAfterAll import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.scalatest.time.SpanSugar._ import org.scalatestplus.selenium.WebBrowser @@ -29,7 +31,10 @@ import org.apache.spark.internal.config.UI.{UI_ENABLED, UI_PORT} import org.apache.spark.sql.LocalSparkSession.withSparkSession import org.apache.spark.sql.SparkSession import org.apache.spark.sql.catalyst.util.quietly -import org.apache.spark.sql.streaming.StreamingQueryException +import org.apache.spark.sql.functions.{window => windowFn, _} +import org.apache.spark.sql.internal.SQLConf.SHUFFLE_PARTITIONS +import org.apache.spark.sql.internal.StaticSQLConf.ENABLED_STREAMING_UI_CUSTOM_METRIC_LIST +import org.apache.spark.sql.streaming.{StreamingQueryException, Trigger} import org.apache.spark.ui.SparkUICssErrorHandler class UISeleniumSuite extends SparkFunSuite with WebBrowser with Matchers with BeforeAndAfterAll { @@ -49,8 +54,10 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser with Matchers with B val conf = new SparkConf() .setMaster(master) .setAppName("ui-test") + .set(SHUFFLE_PARTITIONS, 5) .set(UI_ENABLED, true) .set(UI_PORT, 0) + .set(ENABLED_STREAMING_UI_CUSTOM_METRIC_LIST, Seq("stateOnCurrentVersionSizeBytes")) additionalConfs.foreach { case (k, v) => conf.set(k, v) } val spark = SparkSession.builder().master(master).config(conf).getOrCreate() assert(spark.sparkContext.ui.isDefined) @@ -73,10 +80,17 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser with Matchers with B val h3Text = findAll(cssSelector("h3")).map(_.text).toSeq h3Text should not contain ("Streaming Query") + val input1 = spark.readStream.format("rate").load() + val input2 = spark.readStream.format("rate").load() + val input3 = spark.readStream.format("rate").load() val activeQuery = - spark.readStream.format("rate").load().writeStream.format("noop").start() + input1.selectExpr("timestamp", "mod(value, 100) as mod", "value") + .withWatermark("timestamp", "0 second") + .groupBy(windowFn($"timestamp", "10 seconds", "2 seconds"), $"mod") + .agg(avg("value").as("avg_value")) + .writeStream.format("noop").trigger(Trigger.ProcessingTime("5 seconds")).start() val completedQuery = - spark.readStream.format("rate").load().writeStream.format("noop").start() + input2.join(input3, "value").writeStream.format("noop").start() completedQuery.stop() val failedQuery = spark.readStream.format("rate").load().select("value").as[Long] .map(_ / 0).writeStream.format("noop").start() @@ -91,21 +105,23 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser with Matchers with B goToUi(spark, "/StreamingQuery") findAll(cssSelector("h3")).map(_.text).toSeq should contain("Streaming Query") - findAll(cssSelector("""#activeQueries-table th""")).map(_.text).toSeq should be { - List("Name", "Status", "Id", "Run ID", "Start Time", "Duration", "Avg Input /sec", - "Avg Process /sec", "Lastest Batch") + + val arrow = 0x25BE.toChar + findAll(cssSelector("""#active-table th""")).map(_.text).toList should be { + List("Name", "Status", "ID", "Run ID", s"Start Time $arrow", "Duration", + "Avg Input /sec", "Avg Process /sec", "Latest Batch") } val activeQueries = - findAll(cssSelector("""#activeQueries-table td""")).map(_.text).toSeq + findAll(cssSelector("""#active-table td""")).map(_.text).toSeq activeQueries should contain(activeQuery.id.toString) activeQueries should contain(activeQuery.runId.toString) - findAll(cssSelector("""#completedQueries-table th""")) - .map(_.text).toSeq should be { - List("Name", "Status", "Id", "Run ID", "Start Time", "Duration", "Avg Input /sec", - "Avg Process /sec", "Lastest Batch", "Error") + findAll(cssSelector("""#completed-table th""")) + .map(_.text).toList should be { + List("Name", "Status", "ID", "Run ID", s"Start Time $arrow", "Duration", + "Avg Input /sec", "Avg Process /sec", "Latest Batch", "Error") } val completedQueries = - findAll(cssSelector("""#completedQueries-table td""")).map(_.text).toSeq + findAll(cssSelector("""#completed-table td""")).map(_.text).toSeq completedQueries should contain(completedQuery.id.toString) completedQueries should contain(completedQuery.runId.toString) completedQueries should contain(failedQuery.id.toString) @@ -113,7 +129,7 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser with Matchers with B // Check the query statistics page val activeQueryLink = - findAll(cssSelector("""#activeQueries-table a""")).flatMap(_.attribute("href")).next + findAll(cssSelector("""#active-table td a""")).flatMap(_.attribute("href")).next go to activeQueryLink findAll(cssSelector("h3")) @@ -125,6 +141,20 @@ class UISeleniumSuite extends SparkFunSuite with WebBrowser with Matchers with B findAll(cssSelector("""#stat-table th""")).map(_.text).toSeq should be { List("", "Timelines", "Histograms") } + summaryText should contain ("Input Rate (?)") + summaryText should contain ("Process Rate (?)") + summaryText should contain ("Input Rows (?)") + summaryText should contain ("Batch Duration (?)") + summaryText should contain ("Operation Duration (?)") + summaryText should contain ("Global Watermark Gap (?)") + summaryText should contain ("Aggregated Number Of Total State Rows (?)") + summaryText should contain ("Aggregated Number Of Updated State Rows (?)") + summaryText should contain ("Aggregated State Memory Used In Bytes (?)") + summaryText should contain ("Aggregated Number Of Rows Dropped By Watermark (?)") + summaryText should contain ("Aggregated Custom Metric stateOnCurrentVersionSizeBytes" + + " (?)") + summaryText should not contain ("Aggregated Custom Metric loadedMapCacheHitCount (?)") + summaryText should not contain ("Aggregated Custom Metric loadedMapCacheMissCount (?)") } } finally { spark.streams.active.foreach(_.stop()) diff --git a/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/UIUtilsSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/UIUtilsSuite.scala index 46f2eadc05835..fbf4dcead4a9e 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/UIUtilsSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/streaming/ui/UIUtilsSuite.scala @@ -18,7 +18,7 @@ package org.apache.spark.sql.streaming.ui import org.mockito.Mockito.{mock, when, RETURNS_SMART_NULLS} -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers import org.apache.spark.SparkFunSuite import org.apache.spark.sql.streaming.StreamingQueryProgress diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala index 9747840ce4032..41d11568750cc 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/test/DataFrameReaderWriterSuite.scala @@ -18,7 +18,7 @@ package org.apache.spark.sql.test import java.io.File -import java.util.Locale +import java.util.{Locale, Random} import java.util.concurrent.ConcurrentLinkedQueue import scala.collection.JavaConverters._ @@ -40,7 +40,7 @@ import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.plans.logical.{AppendData, LogicalPlan, OverwriteByExpression} import org.apache.spark.sql.execution.QueryExecution -import org.apache.spark.sql.execution.datasources.DataSourceUtils +import org.apache.spark.sql.execution.datasources.{DataSourceUtils, HadoopFsRelation, LogicalRelation} import org.apache.spark.sql.execution.datasources.noop.NoopDataSource import org.apache.spark.sql.execution.datasources.parquet.SpecificParquetRecordReaderBase import org.apache.spark.sql.internal.SQLConf @@ -224,6 +224,56 @@ class DataFrameReaderWriterSuite extends QueryTest with SharedSparkSession with assert(LastOptions.parameters("opt3") == "3") } + test("SPARK-32364: later option should override earlier options for load()") { + spark.read + .format("org.apache.spark.sql.test") + .option("paTh", "1") + .option("PATH", "2") + .option("Path", "3") + .option("patH", "4") + .option("path", "5") + .load() + assert(LastOptions.parameters("path") == "5") + + withClue("SPARK-32516: legacy path option behavior") { + withSQLConf(SQLConf.LEGACY_PATH_OPTION_BEHAVIOR.key -> "true") { + spark.read + .format("org.apache.spark.sql.test") + .option("paTh", "1") + .option("PATH", "2") + .option("Path", "3") + .option("patH", "4") + .load("5") + assert(LastOptions.parameters("path") == "5") + } + } + } + + test("SPARK-32364: later option should override earlier options for save()") { + Seq(1).toDF.write + .format("org.apache.spark.sql.test") + .option("paTh", "1") + .option("PATH", "2") + .option("Path", "3") + .option("patH", "4") + .option("path", "5") + .save() + assert(LastOptions.parameters("path") == "5") + + withClue("SPARK-32516: legacy path option behavior") { + withSQLConf(SQLConf.LEGACY_PATH_OPTION_BEHAVIOR.key -> "true") { + Seq(1).toDF.write + .format("org.apache.spark.sql.test") + .option("paTh", "1") + .option("PATH", "2") + .option("Path", "3") + .option("patH", "4") + .save("5") + assert(LastOptions.parameters("path") == "5") + } + } + } + test("pass partitionBy as options") { Seq(1).toDF.write .format("org.apache.spark.sql.test") @@ -330,10 +380,10 @@ class DataFrameReaderWriterSuite extends QueryTest with SharedSparkSession with withTable("t") { sql("create table t(i int, d double) using parquet") // Calling `saveAsTable` to an existing table with append mode results in table insertion. - var msg = intercept[AnalysisException] { + val msg = intercept[AnalysisException] { Seq((1L, 2.0)).toDF("i", "d").write.mode("append").saveAsTable("t") }.getMessage - assert(msg.contains("Cannot safely cast 'i': LongType to IntegerType")) + assert(msg.contains("Cannot safely cast 'i': bigint to int")) // Insert into table successfully. Seq((1, 2.0)).toDF("i", "d").write.mode("append").saveAsTable("t") @@ -354,14 +404,14 @@ class DataFrameReaderWriterSuite extends QueryTest with SharedSparkSession with var msg = intercept[AnalysisException] { Seq(("a", "b")).toDF("i", "d").write.mode("append").saveAsTable("t") }.getMessage - assert(msg.contains("Cannot safely cast 'i': StringType to IntegerType") && - msg.contains("Cannot safely cast 'd': StringType to DoubleType")) + assert(msg.contains("Cannot safely cast 'i': string to int") && + msg.contains("Cannot safely cast 'd': string to double")) msg = intercept[AnalysisException] { Seq((true, false)).toDF("i", "d").write.mode("append").saveAsTable("t") }.getMessage - assert(msg.contains("Cannot safely cast 'i': BooleanType to IntegerType") && - msg.contains("Cannot safely cast 'd': BooleanType to DoubleType")) + assert(msg.contains("Cannot safely cast 'i': boolean to int") && + msg.contains("Cannot safely cast 'd': boolean to double")) } } } @@ -1083,4 +1133,126 @@ class DataFrameReaderWriterSuite extends QueryTest with SharedSparkSession with } } } + + test("SPARK-32516: 'path' or 'paths' option cannot coexist with load()'s path parameters") { + def verifyLoadFails(f: => DataFrame): Unit = { + val e = intercept[AnalysisException](f) + assert(e.getMessage.contains( + "Either remove the path option if it's the same as the path parameter")) + } + + val path = "/tmp" + verifyLoadFails(spark.read.option("path", path).parquet(path)) + verifyLoadFails(spark.read.option("path", path).parquet("")) + verifyLoadFails(spark.read.option("path", path).format("parquet").load(path)) + verifyLoadFails(spark.read.option("path", path).format("parquet").load("")) + verifyLoadFails(spark.read.option("paths", path).parquet(path)) + verifyLoadFails(spark.read.option("paths", path).parquet("")) + verifyLoadFails(spark.read.option("paths", path).format("parquet").load(path)) + verifyLoadFails(spark.read.option("paths", path).format("parquet").load("")) + } + + test("SPARK-32516: legacy path option behavior in load()") { + withSQLConf(SQLConf.LEGACY_PATH_OPTION_BEHAVIOR.key -> "true") { + withTempDir { dir => + val path = dir.getCanonicalPath + Seq(1).toDF.write.mode("overwrite").parquet(path) + + // When there is one path parameter to load(), "path" option is overwritten. + checkAnswer(spark.read.format("parquet").option("path", path).load(path), Row(1)) + + // When there are multiple path parameters to load(), "path" option is added. + checkAnswer( + spark.read.format("parquet").option("path", path).load(path, path), + Seq(Row(1), Row(1), Row(1))) + + // When built-in datasource functions are invoked (e.g, `csv`, `parquet`, etc.), + // the path option is always added regardless of the number of path parameters. + checkAnswer(spark.read.option("path", path).parquet(path), Seq(Row(1), Row(1))) + checkAnswer( + spark.read.option("path", path).parquet(path, path), + Seq(Row(1), Row(1), Row(1))) + } + } + } + + test("SPARK-32516: 'path' option cannot coexist with save()'s path parameter") { + def verifyLoadFails(f: => Unit): Unit = { + val e = intercept[AnalysisException](f) + assert(e.getMessage.contains( + "Either remove the path option, or call save() without the parameter")) + } + + val df = Seq(1).toDF + val path = "tmp" + verifyLoadFails(df.write.option("path", path).parquet(path)) + verifyLoadFails(df.write.option("path", path).parquet("")) + verifyLoadFails(df.write.option("path", path).format("parquet").save(path)) + verifyLoadFails(df.write.option("path", path).format("parquet").save("")) + } + + test("SPARK-32853: consecutive load/save calls should be allowed") { + val dfr = spark.read.format(classOf[FakeSourceOne].getName) + dfr.load("1") + dfr.load("2") + val dfw = spark.range(10).write.format(classOf[DefaultSource].getName) + dfw.save("1") + dfw.save("2") + } + + test("SPARK-32844: DataFrameReader.table take the specified options for V1 relation") { + withSQLConf(SQLConf.USE_V1_SOURCE_LIST.key -> "parquet") { + withTable("t") { + sql("CREATE TABLE t(i int, d double) USING parquet OPTIONS ('p1'='v1', 'p2'='v2')") + + val msg = intercept[AnalysisException] { + spark.read.option("P1", "v3").table("t").count() + }.getMessage + assert(msg.contains("duplicated key")) + + val df = spark.read.option("P2", "v2").option("p3", "v3").table("t") + val options = df.queryExecution.analyzed.collectFirst { + case r: LogicalRelation => r.relation.asInstanceOf[HadoopFsRelation].options + }.get + assert(options("p2") == "v2") + assert(options("p3") == "v3") + } + } + } + + test("SPARK-26164: Allow concurrent writers for multiple partitions and buckets") { + withTable("t1", "t2") { + // Uses fixed seed to ensure reproducible test execution + val r = new Random(31) + val df = spark.range(200).map(_ => { + val n = r.nextInt() + (n, n.toString, n % 5) + }).toDF("k1", "k2", "part") + df.write.format("parquet").saveAsTable("t1") + spark.sql("CREATE TABLE t2(k1 int, k2 string, part int) USING parquet PARTITIONED " + + "BY (part) CLUSTERED BY (k1) INTO 3 BUCKETS") + val queryToInsertTable = "INSERT OVERWRITE TABLE t2 SELECT k1, k2, part FROM t1" + + Seq( + // Single writer + 0, + // Concurrent writers without fallback + 200, + // concurrent writers with fallback + 3 + ).foreach { maxWriters => + withSQLConf(SQLConf.MAX_CONCURRENT_OUTPUT_FILE_WRITERS.key -> maxWriters.toString) { + spark.sql(queryToInsertTable).collect() + checkAnswer(spark.table("t2").orderBy("k1"), + spark.table("t1").orderBy("k1")) + + withSQLConf(SQLConf.MAX_RECORDS_PER_FILE.key -> "1") { + spark.sql(queryToInsertTable).collect() + checkAnswer(spark.table("t2").orderBy("k1"), + spark.table("t1").orderBy("k1")) + } + } + } + } + } } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/GenericFlatSpecSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/GenericFlatSpecSuite.scala index 2861b80190abe..dfa0348f1227c 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/test/GenericFlatSpecSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/test/GenericFlatSpecSuite.scala @@ -17,15 +17,13 @@ package org.apache.spark.sql.test -import org.scalatest.FlatSpec - -import org.apache.spark.sql.Dataset +import org.scalatest.flatspec.AnyFlatSpec /** * The purpose of this suite is to make sure that generic FlatSpec-based scala * tests work with a shared spark session */ -class GenericFlatSpecSuite extends FlatSpec with SharedSparkSessionBase { +class GenericFlatSpecSuite extends AnyFlatSpec with SharedSparkSessionBase { import testImplicits._ private def ds = Seq((1, 1), (2, 1), (3, 2), (4, 2), (5, 3), (6, 3), (7, 4), (8, 4)).toDS diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/GenericFunSpecSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/GenericFunSpecSuite.scala index efdaac3ae1f0c..d15e5c42732d1 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/test/GenericFunSpecSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/test/GenericFunSpecSuite.scala @@ -17,15 +17,13 @@ package org.apache.spark.sql.test -import org.scalatest.FunSpec - -import org.apache.spark.sql.Dataset +import org.scalatest.funspec.AnyFunSpec /** * The purpose of this suite is to make sure that generic FunSpec-based scala * tests work with a shared spark session */ -class GenericFunSpecSuite extends FunSpec with SharedSparkSessionBase { +class GenericFunSpecSuite extends AnyFunSpec with SharedSparkSessionBase { import testImplicits._ private def ds = Seq((1, 1), (2, 1), (3, 2), (4, 2), (5, 3), (6, 3), (7, 4), (8, 4)).toDS diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/GenericWordSpecSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/GenericWordSpecSuite.scala index 3a3540c1dbdbf..e693dc9c9b134 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/test/GenericWordSpecSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/test/GenericWordSpecSuite.scala @@ -17,15 +17,13 @@ package org.apache.spark.sql.test -import org.scalatest.WordSpec - -import org.apache.spark.sql.Dataset +import org.scalatest.wordspec.AnyWordSpec /** * The purpose of this suite is to make sure that generic WordSpec-based scala * tests work with a shared spark session */ -class GenericWordSpecSuite extends WordSpec with SharedSparkSessionBase { +class GenericWordSpecSuite extends AnyWordSpec with SharedSparkSessionBase { import testImplicits._ private def ds = Seq((1, 1), (2, 1), (3, 2), (4, 2), (5, 3), (6, 3), (7, 4), (8, 4)).toDS diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestData.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestData.scala index c51faaf10f5dd..a1fd4a0215b1f 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestData.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestData.scala @@ -169,10 +169,10 @@ private[sql] trait SQLTestData { self => rdd } - protected lazy val calenderIntervalData: RDD[IntervalData] = { + protected lazy val calendarIntervalData: RDD[IntervalData] = { val rdd = spark.sparkContext.parallelize( IntervalData(new CalendarInterval(1, 1, 1)) :: Nil) - rdd.toDF().createOrReplaceTempView("calenderIntervalData") + rdd.toDF().createOrReplaceTempView("calendarIntervalData") rdd } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala index 7be15e9d87004..0e62be40607a1 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/test/SQLTestUtils.scala @@ -335,7 +335,7 @@ private[sql] trait SQLTestUtilsBase // Blocking uncache table for tests protected def uncacheTable(tableName: String): Unit = { val tableIdent = spark.sessionState.sqlParser.parseTableIdentifier(tableName) - val cascade = !spark.sessionState.catalog.isTemporaryTable(tableIdent) + val cascade = !spark.sessionState.catalog.isTempView(tableIdent) spark.sharedState.cacheManager.uncacheQuery( spark, spark.table(tableName).logicalPlan, diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/SharedSparkSession.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/SharedSparkSession.scala index ee29b4b8fb32b..ed2e309fa075a 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/test/SharedSparkSession.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/test/SharedSparkSession.scala @@ -25,13 +25,14 @@ import org.scalatest.concurrent.Eventually import org.apache.spark.{DebugFilesystem, SparkConf} import org.apache.spark.internal.config.UNSAFE_EXCEPTION_ON_MEMORY_LEAK import org.apache.spark.sql.{SparkSession, SQLContext} +import org.apache.spark.sql.catalyst.expressions.CodegenObjectFactoryMode import org.apache.spark.sql.catalyst.optimizer.ConvertToLocalRelation import org.apache.spark.sql.internal.{SQLConf, StaticSQLConf} trait SharedSparkSession extends SQLTestUtils with SharedSparkSessionBase { /** - * Suites extending [[SharedSparkSession]] are sharing resources (eg. SparkSession) in their + * Suites extending [[SharedSparkSession]] are sharing resources (e.g. SparkSession) in their * tests. That trait initializes the spark session in its [[beforeAll()]] implementation before * the automatic thread snapshot is performed, so the audit code could fail to report threads * leaked by that shared session. @@ -67,6 +68,7 @@ trait SharedSparkSessionBase .set("spark.hadoop.fs.file.impl", classOf[DebugFilesystem].getName) .set(UNSAFE_EXCEPTION_ON_MEMORY_LEAK, true) .set(SQLConf.CODEGEN_FALLBACK.key, "false") + .set(SQLConf.CODEGEN_FACTORY_MODE.key, CodegenObjectFactoryMode.CODEGEN_ONLY.toString) // Disable ConvertToLocalRelation for better test coverage. Test cases built on // LocalRelation will exercise the optimization rules better by disabling it as // this rule may potentially block testing of other optimization rules such as diff --git a/sql/core/src/test/scala/org/apache/spark/sql/test/TestSQLContext.scala b/sql/core/src/test/scala/org/apache/spark/sql/test/TestSQLContext.scala index 17603deacdcdd..47a6f3617da63 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/test/TestSQLContext.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/test/TestSQLContext.scala @@ -25,12 +25,12 @@ import org.apache.spark.sql.internal.{SessionState, SessionStateBuilder, SQLConf * A special `SparkSession` prepared for testing. */ private[spark] class TestSparkSession(sc: SparkContext) extends SparkSession(sc) { self => - def this(sparkConf: SparkConf) { + def this(sparkConf: SparkConf) = { this(new SparkContext("local[2]", "test-sql-context", sparkConf.set("spark.sql.testkey", "true"))) } - def this() { + def this() = { this(new SparkConf) } diff --git a/sql/core/src/test/scala/org/apache/spark/sql/util/DataFrameCallbackSuite.scala b/sql/core/src/test/scala/org/apache/spark/sql/util/DataFrameCallbackSuite.scala index b17c93503804c..b3d29df1b29bc 100644 --- a/sql/core/src/test/scala/org/apache/spark/sql/util/DataFrameCallbackSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/sql/util/DataFrameCallbackSuite.scala @@ -26,7 +26,7 @@ import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference} import org.apache.spark.sql.catalyst.plans.logical.{Aggregate, InsertIntoStatement, LogicalPlan, Project} import org.apache.spark.sql.execution.{QueryExecution, QueryExecutionException, WholeStageCodegenExec} import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper -import org.apache.spark.sql.execution.command.RunnableCommand +import org.apache.spark.sql.execution.command.LeafRunnableCommand import org.apache.spark.sql.execution.datasources.{CreateTable, InsertIntoHadoopFsRelationCommand} import org.apache.spark.sql.execution.datasources.json.JsonFileFormat import org.apache.spark.sql.test.SharedSparkSession @@ -302,7 +302,7 @@ class DataFrameCallbackSuite extends QueryTest } /** A test command that throws `java.lang.Error` during execution. */ -case class ErrorTestCommand(foo: String) extends RunnableCommand { +case class ErrorTestCommand(foo: String) extends LeafRunnableCommand { override val output: Seq[Attribute] = Seq(AttributeReference("foo", StringType)()) diff --git a/sql/core/src/test/scala/org/apache/spark/status/api/v1/sql/SqlResourceSuite.scala b/sql/core/src/test/scala/org/apache/spark/status/api/v1/sql/SqlResourceSuite.scala index 43cca246cc47c..dbc33c47fed51 100644 --- a/sql/core/src/test/scala/org/apache/spark/status/api/v1/sql/SqlResourceSuite.scala +++ b/sql/core/src/test/scala/org/apache/spark/status/api/v1/sql/SqlResourceSuite.scala @@ -54,12 +54,11 @@ object SqlResourceSuite { SQLPlanMetric(NUMBER_OF_OUTPUT_ROWS, 4, ""), SQLPlanMetric(SIZE_OF_FILES_READ, 5, "")))) + val edges: Seq[SparkPlanGraphEdge] = Seq(SparkPlanGraphEdge(3, 2)) + val nodesWhenCodegenIsOff: Seq[SparkPlanGraphNode] = SparkPlanGraph(nodes, edges).allNodes.filterNot(_.name == WHOLE_STAGE_CODEGEN_1) - val edges: Seq[SparkPlanGraphEdge] = - Seq(SparkPlanGraphEdge(3, 2)) - val metrics: Seq[SQLPlanMetric] = { Seq(SQLPlanMetric(DURATION, 0, ""), SQLPlanMetric(NUMBER_OF_OUTPUT_ROWS, 1, ""), diff --git a/sql/core/src/test/scala/org/apache/spark/status/api/v1/sql/SqlResourceWithActualMetricsSuite.scala b/sql/core/src/test/scala/org/apache/spark/status/api/v1/sql/SqlResourceWithActualMetricsSuite.scala new file mode 100644 index 0000000000000..1510e8957f9ae --- /dev/null +++ b/sql/core/src/test/scala/org/apache/spark/status/api/v1/sql/SqlResourceWithActualMetricsSuite.scala @@ -0,0 +1,132 @@ +/* + * 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. + */ + +package org.apache.spark.status.api.v1.sql + +import java.net.URL +import java.text.SimpleDateFormat + +import org.json4s.DefaultFormats +import org.json4s.jackson.JsonMethods + +import org.apache.spark.SparkConf +import org.apache.spark.deploy.history.HistoryServerSuite.getContentAndCode +import org.apache.spark.sql.DataFrame +import org.apache.spark.sql.catalyst.plans.SQLHelper +import org.apache.spark.sql.execution.metric.SQLMetricsTestUtils +import org.apache.spark.sql.internal.SQLConf.ADAPTIVE_EXECUTION_ENABLED +import org.apache.spark.sql.test.SharedSparkSession + +case class Person(id: Int, name: String, age: Int) +case class Salary(personId: Int, salary: Double) + +/** + * Sql Resource Public API Unit Tests running query and extracting the metrics. + */ +class SqlResourceWithActualMetricsSuite + extends SharedSparkSession with SQLMetricsTestUtils with SQLHelper { + + import testImplicits._ + + // Exclude nodes which may not have the metrics + val excludedNodes = List("WholeStageCodegen", "Project", "SerializeFromObject") + + implicit val formats = new DefaultFormats { + override def dateFormatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss") + } + + override def sparkConf: SparkConf = { + super.sparkConf.set("spark.ui.enabled", "true") + } + + test("Check Sql Rest Api Endpoints") { + // Materalize result DataFrame + withSQLConf(ADAPTIVE_EXECUTION_ENABLED.key -> "false") { + val count = getDF().count() + assert(count == 2, s"Expected Query Count is 2 but received: $count") + } + + // Spark apps launched by local-mode seems not having `attemptId` as default + // so UT is just added for existing endpoints. + val executionId = callSqlRestEndpointAndVerifyResult() + callSqlRestEndpointByExecutionIdAndVerifyResult(executionId) + } + + private def callSqlRestEndpointAndVerifyResult(): Long = { + val url = new URL(spark.sparkContext.ui.get.webUrl + + s"/api/v1/applications/${spark.sparkContext.applicationId}/sql") + val jsonResult = verifyAndGetSqlRestResult(url) + val executionDatas = JsonMethods.parse(jsonResult).extract[Seq[ExecutionData]] + assert(executionDatas.size > 0, + s"Expected Query Result Size is higher than 0 but received: ${executionDatas.size}") + val executionData = executionDatas.head + verifySqlRestContent(executionData) + executionData.id + } + + private def callSqlRestEndpointByExecutionIdAndVerifyResult(executionId: Long): Unit = { + val url = new URL(spark.sparkContext.ui.get.webUrl + + s"/api/v1/applications/${spark.sparkContext.applicationId}/sql/${executionId}") + val jsonResult = verifyAndGetSqlRestResult(url) + val executionData = JsonMethods.parse(jsonResult).extract[ExecutionData] + verifySqlRestContent(executionData) + } + + private def verifySqlRestContent(executionData: ExecutionData): Unit = { + assert(executionData.status == "COMPLETED", + s"Expected status is COMPLETED but actual: ${executionData.status}") + assert(executionData.successJobIds.nonEmpty, + s"Expected successJobIds should not be empty") + assert(executionData.runningJobIds.isEmpty, + s"Expected runningJobIds should be empty but actual: ${executionData.runningJobIds}") + assert(executionData.failedJobIds.isEmpty, + s"Expected failedJobIds should be empty but actual: ${executionData.failedJobIds}") + assert(executionData.nodes.nonEmpty, "Expected nodes should not be empty}") + executionData.nodes.filterNot(node => excludedNodes.contains(node.nodeName)).foreach { node => + assert(node.metrics.nonEmpty, "Expected metrics of nodes should not be empty") + } + } + + private def verifyAndGetSqlRestResult(url: URL): String = { + val (code, resultOpt, error) = getContentAndCode(url) + assert(code == 200, s"Expected Http Response Code is 200 but received: $code for url: $url") + assert(resultOpt.nonEmpty, s"Rest result should not be empty for url: $url") + assert(error.isEmpty, s"Error message should be empty for url: $url") + resultOpt.get + } + + private def getDF(): DataFrame = { + val person: DataFrame = + spark.sparkContext.parallelize( + Person(0, "mike", 30) :: + Person(1, "jim", 20) :: Nil).toDF() + + val salary: DataFrame = + spark.sparkContext.parallelize( + Salary(0, 2000.0) :: + Salary(1, 1000.0) :: Nil).toDF() + + val salaryDF = salary.withColumnRenamed("personId", "id") + val ds = person.join(salaryDF, "id") + .groupBy("name", "age", "salary").avg("age", "salary") + .filter(_.getAs[Int]("age") <= 30) + .sort() + + ds.toDF + } + +} diff --git a/sql/core/v1.2/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java b/sql/core/v1.2/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java deleted file mode 100644 index 6601bcb9018f4..0000000000000 --- a/sql/core/v1.2/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.execution.datasources.orc; - -import java.math.BigDecimal; - -import org.apache.orc.storage.ql.exec.vector.*; - -import org.apache.spark.sql.catalyst.util.DateTimeUtils; -import org.apache.spark.sql.catalyst.util.RebaseDateTime; -import org.apache.spark.sql.types.DataType; -import org.apache.spark.sql.types.DateType; -import org.apache.spark.sql.types.Decimal; -import org.apache.spark.sql.types.TimestampType; -import org.apache.spark.sql.vectorized.ColumnarArray; -import org.apache.spark.sql.vectorized.ColumnarMap; -import org.apache.spark.unsafe.types.UTF8String; - -/** - * A column vector class wrapping Hive's ColumnVector. Because Spark ColumnarBatch only accepts - * Spark's vectorized.ColumnVector, this column vector is used to adapt Hive ColumnVector with - * Spark ColumnarVector. - */ -public class OrcColumnVector extends org.apache.spark.sql.vectorized.ColumnVector { - private ColumnVector baseData; - private LongColumnVector longData; - private DoubleColumnVector doubleData; - private BytesColumnVector bytesData; - private DecimalColumnVector decimalData; - private TimestampColumnVector timestampData; - private final boolean isTimestamp; - private final boolean isDate; - - private int batchSize; - - OrcColumnVector(DataType type, ColumnVector vector) { - super(type); - - if (type instanceof TimestampType) { - isTimestamp = true; - } else { - isTimestamp = false; - } - - if (type instanceof DateType) { - isDate = true; - } else { - isDate = false; - } - - baseData = vector; - if (vector instanceof LongColumnVector) { - longData = (LongColumnVector) vector; - } else if (vector instanceof DoubleColumnVector) { - doubleData = (DoubleColumnVector) vector; - } else if (vector instanceof BytesColumnVector) { - bytesData = (BytesColumnVector) vector; - } else if (vector instanceof DecimalColumnVector) { - decimalData = (DecimalColumnVector) vector; - } else if (vector instanceof TimestampColumnVector) { - timestampData = (TimestampColumnVector) vector; - } else { - throw new UnsupportedOperationException(); - } - } - - public void setBatchSize(int batchSize) { - this.batchSize = batchSize; - } - - @Override - public void close() { - - } - - @Override - public boolean hasNull() { - return !baseData.noNulls; - } - - @Override - public int numNulls() { - if (baseData.isRepeating) { - if (baseData.isNull[0]) { - return batchSize; - } else { - return 0; - } - } else if (baseData.noNulls) { - return 0; - } else { - int count = 0; - for (int i = 0; i < batchSize; i++) { - if (baseData.isNull[i]) count++; - } - return count; - } - } - - /* A helper method to get the row index in a column. */ - private int getRowIndex(int rowId) { - return baseData.isRepeating ? 0 : rowId; - } - - @Override - public boolean isNullAt(int rowId) { - return baseData.isNull[getRowIndex(rowId)]; - } - - @Override - public boolean getBoolean(int rowId) { - return longData.vector[getRowIndex(rowId)] == 1; - } - - @Override - public byte getByte(int rowId) { - return (byte) longData.vector[getRowIndex(rowId)]; - } - - @Override - public short getShort(int rowId) { - return (short) longData.vector[getRowIndex(rowId)]; - } - - @Override - public int getInt(int rowId) { - int value = (int) longData.vector[getRowIndex(rowId)]; - if (isDate) { - return RebaseDateTime.rebaseJulianToGregorianDays(value); - } else { - return value; - } - } - - @Override - public long getLong(int rowId) { - int index = getRowIndex(rowId); - if (isTimestamp) { - return DateTimeUtils.fromJavaTimestamp(timestampData.asScratchTimestamp(index)); - } else { - return longData.vector[index]; - } - } - - @Override - public float getFloat(int rowId) { - return (float) doubleData.vector[getRowIndex(rowId)]; - } - - @Override - public double getDouble(int rowId) { - return doubleData.vector[getRowIndex(rowId)]; - } - - @Override - public Decimal getDecimal(int rowId, int precision, int scale) { - if (isNullAt(rowId)) return null; - BigDecimal data = decimalData.vector[getRowIndex(rowId)].getHiveDecimal().bigDecimalValue(); - return Decimal.apply(data, precision, scale); - } - - @Override - public UTF8String getUTF8String(int rowId) { - if (isNullAt(rowId)) return null; - int index = getRowIndex(rowId); - BytesColumnVector col = bytesData; - return UTF8String.fromBytes(col.vector[index], col.start[index], col.length[index]); - } - - @Override - public byte[] getBinary(int rowId) { - if (isNullAt(rowId)) return null; - int index = getRowIndex(rowId); - byte[] binary = new byte[bytesData.length[index]]; - System.arraycopy(bytesData.vector[index], bytesData.start[index], binary, 0, binary.length); - return binary; - } - - @Override - public ColumnarArray getArray(int rowId) { - throw new UnsupportedOperationException(); - } - - @Override - public ColumnarMap getMap(int rowId) { - throw new UnsupportedOperationException(); - } - - @Override - public org.apache.spark.sql.vectorized.ColumnVector getChild(int ordinal) { - throw new UnsupportedOperationException(); - } -} diff --git a/sql/core/v1.2/src/main/scala/org/apache/spark/sql/execution/datasources/orc/DaysWritable.scala b/sql/core/v1.2/src/main/scala/org/apache/spark/sql/execution/datasources/orc/DaysWritable.scala deleted file mode 100644 index 1dccf0ca1faef..0000000000000 --- a/sql/core/v1.2/src/main/scala/org/apache/spark/sql/execution/datasources/orc/DaysWritable.scala +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.execution.datasources.orc - -import java.io.{DataInput, DataOutput, IOException} -import java.sql.Date - -import org.apache.hadoop.io.WritableUtils -import org.apache.orc.storage.serde2.io.DateWritable - -import org.apache.spark.sql.catalyst.util.RebaseDateTime.{rebaseGregorianToJulianDays, rebaseJulianToGregorianDays} - -/** - * The class accepts/returns days in Gregorian calendar and rebase them - * via conversion to local date in Julian calendar for dates before 1582-10-15 - * in read/write for backward compatibility with Spark 2.4 and earlier versions. - * - * This is a clone of `org.apache.spark.sql.execution.datasources.DaysWritable`. - * The class is cloned because Hive ORC v1.2 uses different `DateWritable`: - * - v1.2: `org.apache.orc.storage.serde2.io.DateWritable` - * - v2.3 and `HiveInspectors`: `org.apache.hadoop.hive.serde2.io.DateWritable` - * - * @param gregorianDays The number of days since the epoch 1970-01-01 in - * Gregorian calendar. - * @param julianDays The number of days since the epoch 1970-01-01 in - * Julian calendar. - */ -class DaysWritable( - var gregorianDays: Int, - var julianDays: Int) - extends DateWritable { - - def this() = this(0, 0) - def this(gregorianDays: Int) = - this(gregorianDays, rebaseGregorianToJulianDays(gregorianDays)) - def this(dateWritable: DateWritable) = { - this( - gregorianDays = dateWritable match { - case daysWritable: DaysWritable => daysWritable.gregorianDays - case dateWritable: DateWritable => - rebaseJulianToGregorianDays(dateWritable.getDays) - }, - julianDays = dateWritable.getDays) - } - - override def getDays: Int = julianDays - override def get(): Date = new Date(DateWritable.daysToMillis(julianDays)) - - override def set(d: Int): Unit = { - gregorianDays = d - julianDays = rebaseGregorianToJulianDays(d) - } - - @throws[IOException] - override def write(out: DataOutput): Unit = { - WritableUtils.writeVInt(out, julianDays) - } - - @throws[IOException] - override def readFields(in: DataInput): Unit = { - julianDays = WritableUtils.readVInt(in) - gregorianDays = rebaseJulianToGregorianDays(julianDays) - } -} diff --git a/sql/core/v1.2/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala b/sql/core/v1.2/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala deleted file mode 100644 index a01d5a44da714..0000000000000 --- a/sql/core/v1.2/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala +++ /dev/null @@ -1,271 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.execution.datasources.orc - -import java.time.LocalDate - -import org.apache.orc.storage.common.`type`.HiveDecimal -import org.apache.orc.storage.ql.io.sarg.{PredicateLeaf, SearchArgument} -import org.apache.orc.storage.ql.io.sarg.SearchArgument.Builder -import org.apache.orc.storage.ql.io.sarg.SearchArgumentFactory.newBuilder -import org.apache.orc.storage.serde2.io.HiveDecimalWritable - -import org.apache.spark.SparkException -import org.apache.spark.sql.catalyst.util.DateTimeUtils.{localDateToDays, toJavaDate} -import org.apache.spark.sql.connector.catalog.CatalogV2Implicits.quoteIfNeeded -import org.apache.spark.sql.sources.Filter -import org.apache.spark.sql.types._ - -/** - * Helper object for building ORC `SearchArgument`s, which are used for ORC predicate push-down. - * - * Due to limitation of ORC `SearchArgument` builder, we had to implement separate checking and - * conversion passes through the Filter to make sure we only convert predicates that are known - * to be convertible. - * - * An ORC `SearchArgument` must be built in one pass using a single builder. For example, you can't - * build `a = 1` and `b = 2` first, and then combine them into `a = 1 AND b = 2`. This is quite - * different from the cases in Spark SQL or Parquet, where complex filters can be easily built using - * existing simpler ones. - * - * The annoying part is that, `SearchArgument` builder methods like `startAnd()`, `startOr()`, and - * `startNot()` mutate internal state of the builder instance. This forces us to translate all - * convertible filters with a single builder instance. However, if we try to translate a filter - * before checking whether it can be converted or not, we may end up with a builder whose internal - * state is inconsistent in the case of an inconvertible filter. - * - * For example, to convert an `And` filter with builder `b`, we call `b.startAnd()` first, and then - * try to convert its children. Say we convert `left` child successfully, but find that `right` - * child is inconvertible. Alas, `b.startAnd()` call can't be rolled back, and `b` is inconsistent - * now. - * - * The workaround employed here is to trim the Spark filters before trying to convert them. This - * way, we can only do the actual conversion on the part of the Filter that is known to be - * convertible. - * - * P.S.: Hive seems to use `SearchArgument` together with `ExprNodeGenericFuncDesc` only. Usage of - * builder methods mentioned above can only be found in test code, where all tested filters are - * known to be convertible. - */ -private[sql] object OrcFilters extends OrcFiltersBase { - - /** - * Create ORC filter as a SearchArgument instance. - */ - def createFilter(schema: StructType, filters: Seq[Filter]): Option[SearchArgument] = { - val dataTypeMap = schema.map(f => quoteIfNeeded(f.name) -> f.dataType).toMap - // Combines all convertible filters using `And` to produce a single conjunction - // TODO (SPARK-25557): ORC doesn't support nested predicate pushdown, so they are removed. - val newFilters = filters.filter(!_.containsNestedColumn) - val conjunctionOptional = buildTree(convertibleFilters(schema, dataTypeMap, newFilters)) - conjunctionOptional.map { conjunction => - // Then tries to build a single ORC `SearchArgument` for the conjunction predicate. - // The input predicate is fully convertible. There should not be any empty result in the - // following recursive method call `buildSearchArgument`. - buildSearchArgument(dataTypeMap, conjunction, newBuilder).build() - } - } - - def convertibleFilters( - schema: StructType, - dataTypeMap: Map[String, DataType], - filters: Seq[Filter]): Seq[Filter] = { - import org.apache.spark.sql.sources._ - - def convertibleFiltersHelper( - filter: Filter, - canPartialPushDown: Boolean): Option[Filter] = filter match { - // At here, it is not safe to just convert one side and remove the other side - // if we do not understand what the parent filters are. - // - // Here is an example used to explain the reason. - // Let's say we have NOT(a = 2 AND b in ('1')) and we do not understand how to - // convert b in ('1'). If we only convert a = 2, we will end up with a filter - // NOT(a = 2), which will generate wrong results. - // - // Pushing one side of AND down is only safe to do at the top level or in the child - // AND before hitting NOT or OR conditions, and in this case, the unsupported predicate - // can be safely removed. - case And(left, right) => - val leftResultOptional = convertibleFiltersHelper(left, canPartialPushDown) - val rightResultOptional = convertibleFiltersHelper(right, canPartialPushDown) - (leftResultOptional, rightResultOptional) match { - case (Some(leftResult), Some(rightResult)) => Some(And(leftResult, rightResult)) - case (Some(leftResult), None) if canPartialPushDown => Some(leftResult) - case (None, Some(rightResult)) if canPartialPushDown => Some(rightResult) - case _ => None - } - - // The Or predicate is convertible when both of its children can be pushed down. - // That is to say, if one/both of the children can be partially pushed down, the Or - // predicate can be partially pushed down as well. - // - // Here is an example used to explain the reason. - // Let's say we have - // (a1 AND a2) OR (b1 AND b2), - // a1 and b1 is convertible, while a2 and b2 is not. - // The predicate can be converted as - // (a1 OR b1) AND (a1 OR b2) AND (a2 OR b1) AND (a2 OR b2) - // As per the logical in And predicate, we can push down (a1 OR b1). - case Or(left, right) => - for { - lhs <- convertibleFiltersHelper(left, canPartialPushDown) - rhs <- convertibleFiltersHelper(right, canPartialPushDown) - } yield Or(lhs, rhs) - case Not(pred) => - val childResultOptional = convertibleFiltersHelper(pred, canPartialPushDown = false) - childResultOptional.map(Not) - case other => - for (_ <- buildLeafSearchArgument(dataTypeMap, other, newBuilder())) yield other - } - filters.flatMap { filter => - convertibleFiltersHelper(filter, true) - } - } - - /** - * Get PredicateLeafType which is corresponding to the given DataType. - */ - private def getPredicateLeafType(dataType: DataType) = dataType match { - case BooleanType => PredicateLeaf.Type.BOOLEAN - case ByteType | ShortType | IntegerType | LongType => PredicateLeaf.Type.LONG - case FloatType | DoubleType => PredicateLeaf.Type.FLOAT - case StringType => PredicateLeaf.Type.STRING - case DateType => PredicateLeaf.Type.DATE - case TimestampType => PredicateLeaf.Type.TIMESTAMP - case _: DecimalType => PredicateLeaf.Type.DECIMAL - case _ => throw new UnsupportedOperationException(s"DataType: ${dataType.catalogString}") - } - - /** - * Cast literal values for filters. - * - * We need to cast to long because ORC raises exceptions - * at 'checkLiteralType' of SearchArgumentImpl.java. - */ - private def castLiteralValue(value: Any, dataType: DataType): Any = dataType match { - case ByteType | ShortType | IntegerType | LongType => - value.asInstanceOf[Number].longValue - case FloatType | DoubleType => - value.asInstanceOf[Number].doubleValue() - case _: DecimalType => - new HiveDecimalWritable(HiveDecimal.create(value.asInstanceOf[java.math.BigDecimal])) - case _: DateType if value.isInstanceOf[LocalDate] => - toJavaDate(localDateToDays(value.asInstanceOf[LocalDate])) - case _ => value - } - - /** - * Build a SearchArgument and return the builder so far. - * - * @param dataTypeMap a map from the attribute name to its data type. - * @param expression the input predicates, which should be fully convertible to SearchArgument. - * @param builder the input SearchArgument.Builder. - * @return the builder so far. - */ - private def buildSearchArgument( - dataTypeMap: Map[String, DataType], - expression: Filter, - builder: Builder): Builder = { - import org.apache.spark.sql.sources._ - - expression match { - case And(left, right) => - val lhs = buildSearchArgument(dataTypeMap, left, builder.startAnd()) - val rhs = buildSearchArgument(dataTypeMap, right, lhs) - rhs.end() - - case Or(left, right) => - val lhs = buildSearchArgument(dataTypeMap, left, builder.startOr()) - val rhs = buildSearchArgument(dataTypeMap, right, lhs) - rhs.end() - - case Not(child) => - buildSearchArgument(dataTypeMap, child, builder.startNot()).end() - - case other => - buildLeafSearchArgument(dataTypeMap, other, builder).getOrElse { - throw new SparkException( - "The input filter of OrcFilters.buildSearchArgument should be fully convertible.") - } - } - } - - /** - * Build a SearchArgument for a leaf predicate and return the builder so far. - * - * @param dataTypeMap a map from the attribute name to its data type. - * @param expression the input filter predicates. - * @param builder the input SearchArgument.Builder. - * @return the builder so far. - */ - private def buildLeafSearchArgument( - dataTypeMap: Map[String, DataType], - expression: Filter, - builder: Builder): Option[Builder] = { - def getType(attribute: String): PredicateLeaf.Type = - getPredicateLeafType(dataTypeMap(attribute)) - - import org.apache.spark.sql.sources._ - - // NOTE: For all case branches dealing with leaf predicates below, the additional `startAnd()` - // call is mandatory. ORC `SearchArgument` builder requires that all leaf predicates must be - // wrapped by a "parent" predicate (`And`, `Or`, or `Not`). - // Since ORC 1.5.0 (ORC-323), we need to quote for column names with `.` characters - // in order to distinguish predicate pushdown for nested columns. - expression match { - case EqualTo(name, value) if isSearchableType(dataTypeMap(name)) => - val castedValue = castLiteralValue(value, dataTypeMap(name)) - Some(builder.startAnd().equals(name, getType(name), castedValue).end()) - - case EqualNullSafe(name, value) if isSearchableType(dataTypeMap(name)) => - val castedValue = castLiteralValue(value, dataTypeMap(name)) - Some(builder.startAnd().nullSafeEquals(name, getType(name), castedValue).end()) - - case LessThan(name, value) if isSearchableType(dataTypeMap(name)) => - val castedValue = castLiteralValue(value, dataTypeMap(name)) - Some(builder.startAnd().lessThan(name, getType(name), castedValue).end()) - - case LessThanOrEqual(name, value) if isSearchableType(dataTypeMap(name)) => - val castedValue = castLiteralValue(value, dataTypeMap(name)) - Some(builder.startAnd().lessThanEquals(name, getType(name), castedValue).end()) - - case GreaterThan(name, value) if isSearchableType(dataTypeMap(name)) => - val castedValue = castLiteralValue(value, dataTypeMap(name)) - Some(builder.startNot().lessThanEquals(name, getType(name), castedValue).end()) - - case GreaterThanOrEqual(name, value) if isSearchableType(dataTypeMap(name)) => - val castedValue = castLiteralValue(value, dataTypeMap(name)) - Some(builder.startNot().lessThan(name, getType(name), castedValue).end()) - - case IsNull(name) if isSearchableType(dataTypeMap(name)) => - Some(builder.startAnd().isNull(name, getType(name)).end()) - - case IsNotNull(name) if isSearchableType(dataTypeMap(name)) => - Some(builder.startNot().isNull(name, getType(name)).end()) - - case In(name, values) if isSearchableType(dataTypeMap(name)) => - val castedValues = values.map(v => castLiteralValue(v, dataTypeMap(name))) - Some(builder.startAnd().in(name, getType(name), - castedValues.map(_.asInstanceOf[AnyRef]): _*).end()) - - case _ => None - } - } -} - diff --git a/sql/core/v1.2/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcShimUtils.scala b/sql/core/v1.2/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcShimUtils.scala deleted file mode 100644 index 7fbc1cd205b13..0000000000000 --- a/sql/core/v1.2/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcShimUtils.scala +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.execution.datasources.orc - -import org.apache.orc.storage.common.`type`.HiveDecimal -import org.apache.orc.storage.ql.exec.vector.VectorizedRowBatch -import org.apache.orc.storage.ql.io.sarg.{SearchArgument => OrcSearchArgument} -import org.apache.orc.storage.ql.io.sarg.PredicateLeaf.{Operator => OrcOperator} -import org.apache.orc.storage.serde2.io.{DateWritable, HiveDecimalWritable} - -import org.apache.spark.sql.catalyst.expressions.SpecializedGetters -import org.apache.spark.sql.types.Decimal - -/** - * Various utilities for ORC used to upgrade the built-in Hive. - */ -private[sql] object OrcShimUtils { - - class VectorizedRowBatchWrap(val batch: VectorizedRowBatch) {} - - private[sql] type Operator = OrcOperator - private[sql] type SearchArgument = OrcSearchArgument - - def getGregorianDays(value: Any): Int = { - new DaysWritable(value.asInstanceOf[DateWritable]).gregorianDays - } - - def getDecimal(value: Any): Decimal = { - val decimal = value.asInstanceOf[HiveDecimalWritable].getHiveDecimal() - Decimal(decimal.bigDecimalValue, decimal.precision(), decimal.scale()) - } - - def getDateWritable(reuseObj: Boolean): (SpecializedGetters, Int) => DateWritable = { - if (reuseObj) { - val result = new DaysWritable() - (getter, ordinal) => - result.set(getter.getInt(ordinal)) - result - } else { - (getter: SpecializedGetters, ordinal: Int) => - new DaysWritable(getter.getInt(ordinal)) - } - } - - def getHiveDecimalWritable(precision: Int, scale: Int): - (SpecializedGetters, Int) => HiveDecimalWritable = { - (getter, ordinal) => - val d = getter.getDecimal(ordinal, precision, scale) - new HiveDecimalWritable(HiveDecimal.create(d.toJavaBigDecimal)) - } -} diff --git a/sql/core/v1.2/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilterSuite.scala b/sql/core/v1.2/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilterSuite.scala deleted file mode 100644 index a1c325e7bb876..0000000000000 --- a/sql/core/v1.2/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilterSuite.scala +++ /dev/null @@ -1,461 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.execution.datasources.orc - -import java.math.MathContext -import java.nio.charset.StandardCharsets -import java.sql.{Date, Timestamp} - -import scala.collection.JavaConverters._ - -import org.apache.orc.storage.ql.io.sarg.{PredicateLeaf, SearchArgument} - -import org.apache.spark.SparkConf -import org.apache.spark.sql.{AnalysisException, Column, DataFrame} -import org.apache.spark.sql.catalyst.dsl.expressions._ -import org.apache.spark.sql.catalyst.expressions._ -import org.apache.spark.sql.catalyst.planning.PhysicalOperation -import org.apache.spark.sql.execution.datasources.v2.DataSourceV2ScanRelation -import org.apache.spark.sql.execution.datasources.v2.orc.OrcScan -import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.sql.test.SharedSparkSession -import org.apache.spark.sql.types._ - -/** - * A test suite that tests Apache ORC filter API based filter pushdown optimization. - * OrcFilterSuite and HiveOrcFilterSuite is logically duplicated to provide the same test coverage. - * The difference are the packages containing 'Predicate' and 'SearchArgument' classes. - * - OrcFilterSuite uses 'org.apache.orc.storage.ql.io.sarg' package. - * - HiveOrcFilterSuite uses 'org.apache.hadoop.hive.ql.io.sarg' package. - */ -class OrcFilterSuite extends OrcTest with SharedSparkSession { - - override protected def sparkConf: SparkConf = - super - .sparkConf - .set(SQLConf.USE_V1_SOURCE_LIST, "") - - protected def checkFilterPredicate( - df: DataFrame, - predicate: Predicate, - checker: (SearchArgument) => Unit): Unit = { - val output = predicate.collect { case a: Attribute => a }.distinct - val query = df - .select(output.map(e => Column(e)): _*) - .where(Column(predicate)) - - query.queryExecution.optimizedPlan match { - case PhysicalOperation(_, filters, DataSourceV2ScanRelation(_, o: OrcScan, _)) => - assert(filters.nonEmpty, "No filter is analyzed from the given query") - assert(o.pushedFilters.nonEmpty, "No filter is pushed down") - val maybeFilter = OrcFilters.createFilter(query.schema, o.pushedFilters) - assert(maybeFilter.isDefined, s"Couldn't generate filter predicate for ${o.pushedFilters}") - checker(maybeFilter.get) - - case _ => - throw new AnalysisException("Can not match OrcTable in the query.") - } - } - - protected def checkFilterPredicate - (predicate: Predicate, filterOperator: PredicateLeaf.Operator) - (implicit df: DataFrame): Unit = { - def checkComparisonOperator(filter: SearchArgument) = { - val operator = filter.getLeaves.asScala - assert(operator.map(_.getOperator).contains(filterOperator)) - } - checkFilterPredicate(df, predicate, checkComparisonOperator) - } - - protected def checkFilterPredicate - (predicate: Predicate, stringExpr: String) - (implicit df: DataFrame): Unit = { - def checkLogicalOperator(filter: SearchArgument) = { - assert(filter.toString == stringExpr) - } - checkFilterPredicate(df, predicate, checkLogicalOperator) - } - - test("filter pushdown - integer") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === 1, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < 2, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= 4, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(1) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(1) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(2) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(3) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(1) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(4) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - long") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i.toLong)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === 1, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < 2, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= 4, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(1) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(1) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(2) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(3) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(1) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(4) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - float") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i.toFloat)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === 1, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < 2, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= 4, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(1) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(1) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(2) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(3) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(1) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(4) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - double") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i.toDouble)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === 1, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < 2, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= 4, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(1) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(1) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(2) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(3) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(1) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(4) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - string") { - withOrcDataFrame((1 to 4).map(i => Tuple1(i.toString))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === "1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> "1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < "2", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > "3", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= "1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= "4", PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal("1") === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal("1") <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal("2") > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal("3") < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal("1") >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal("4") <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - boolean") { - withOrcDataFrame((true :: false :: Nil).map(b => Tuple1.apply(Option(b)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === true, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> true, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < true, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > false, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= false, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= false, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(false) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(false) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(false) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(true) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(true) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(true) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - decimal") { - withOrcDataFrame((1 to 4).map(i => Tuple1.apply(BigDecimal.valueOf(i)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === BigDecimal.valueOf(1), PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> BigDecimal.valueOf(1), PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < BigDecimal.valueOf(2), PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > BigDecimal.valueOf(3), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= BigDecimal.valueOf(1), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= BigDecimal.valueOf(4), PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate( - Literal(BigDecimal.valueOf(1)) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate( - Literal(BigDecimal.valueOf(1)) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate( - Literal(BigDecimal.valueOf(2)) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate( - Literal(BigDecimal.valueOf(3)) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate( - Literal(BigDecimal.valueOf(1)) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate( - Literal(BigDecimal.valueOf(4)) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - timestamp") { - val timeString = "2015-08-20 14:57:00" - val timestamps = (1 to 4).map { i => - val milliseconds = Timestamp.valueOf(timeString).getTime + i * 3600 - new Timestamp(milliseconds) - } - withOrcDataFrame(timestamps.map(Tuple1(_))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === timestamps(0), PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> timestamps(0), PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < timestamps(1), PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > timestamps(2), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= timestamps(0), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= timestamps(3), PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(timestamps(0)) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(timestamps(0)) <=> $"_1", - PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(timestamps(1)) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(timestamps(2)) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(timestamps(0)) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(timestamps(3)) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - combinations with logical operators") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i)))) { implicit df => - checkFilterPredicate( - $"_1".isNotNull, - "leaf-0 = (IS_NULL _1), expr = (not leaf-0)" - ) - checkFilterPredicate( - $"_1" =!= 1, - "leaf-0 = (IS_NULL _1), leaf-1 = (EQUALS _1 1), expr = (and (not leaf-0) (not leaf-1))" - ) - checkFilterPredicate( - !($"_1" < 4), - "leaf-0 = (IS_NULL _1), leaf-1 = (LESS_THAN _1 4), expr = (and (not leaf-0) (not leaf-1))" - ) - checkFilterPredicate( - $"_1" < 2 || $"_1" > 3, - "leaf-0 = (LESS_THAN _1 2), leaf-1 = (LESS_THAN_EQUALS _1 3), " + - "expr = (or leaf-0 (not leaf-1))" - ) - checkFilterPredicate( - $"_1" < 2 && $"_1" > 3, - "leaf-0 = (IS_NULL _1), leaf-1 = (LESS_THAN _1 2), leaf-2 = (LESS_THAN_EQUALS _1 3), " + - "expr = (and (not leaf-0) leaf-1 (not leaf-2))" - ) - } - } - - test("filter pushdown - date") { - val input = Seq("2017-08-18", "2017-08-19", "2017-08-20", "2017-08-21").map { day => - Date.valueOf(day) - } - withOrcFile(input.map(Tuple1(_))) { path => - Seq(false, true).foreach { java8Api => - withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> java8Api.toString) { - readFile(path) { implicit df => - val dates = input.map(Literal(_)) - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === dates(0), PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> dates(0), PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < dates(1), PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > dates(2), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= dates(0), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= dates(3), PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(dates(0) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(dates(0) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(dates(1) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(dates(2) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(dates(0) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(dates(3) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - } - } - } - - test("no filter pushdown - non-supported types") { - implicit class IntToBinary(int: Int) { - def b: Array[Byte] = int.toString.getBytes(StandardCharsets.UTF_8) - } - // ArrayType - withOrcDataFrame((1 to 4).map(i => Tuple1(Array(i)))) { implicit df => - checkNoFilterPredicate($"_1".isNull, noneSupported = true) - } - // BinaryType - withOrcDataFrame((1 to 4).map(i => Tuple1(i.b))) { implicit df => - checkNoFilterPredicate($"_1" <=> 1.b, noneSupported = true) - } - // MapType - withOrcDataFrame((1 to 4).map(i => Tuple1(Map(i -> i)))) { implicit df => - checkNoFilterPredicate($"_1".isNotNull, noneSupported = true) - } - } - - test("SPARK-12218 and SPARK-25699 Converting conjunctions into ORC SearchArguments") { - import org.apache.spark.sql.sources._ - // The `LessThan` should be converted while the `StringContains` shouldn't - val schema = new StructType( - Array( - StructField("a", IntegerType, nullable = true), - StructField("b", StringType, nullable = true))) - assertResult("leaf-0 = (LESS_THAN a 10), expr = leaf-0") { - OrcFilters.createFilter(schema, Array( - LessThan("a", 10), - StringContains("b", "prefix") - )).get.toString - } - - // The `LessThan` should be converted while the whole inner `And` shouldn't - assertResult("leaf-0 = (LESS_THAN a 10), expr = leaf-0") { - OrcFilters.createFilter(schema, Array( - LessThan("a", 10), - Not(And( - GreaterThan("a", 1), - StringContains("b", "prefix") - )) - )).get.toString - } - - // Safely remove unsupported `StringContains` predicate and push down `LessThan` - assertResult("leaf-0 = (LESS_THAN a 10), expr = leaf-0") { - OrcFilters.createFilter(schema, Array( - And( - LessThan("a", 10), - StringContains("b", "prefix") - ) - )).get.toString - } - - // Safely remove unsupported `StringContains` predicate, push down `LessThan` and `GreaterThan`. - assertResult("leaf-0 = (LESS_THAN a 10), leaf-1 = (LESS_THAN_EQUALS a 1)," + - " expr = (and leaf-0 (not leaf-1))") { - OrcFilters.createFilter(schema, Array( - And( - And( - LessThan("a", 10), - StringContains("b", "prefix") - ), - GreaterThan("a", 1) - ) - )).get.toString - } - } - - test("SPARK-27699 Converting disjunctions into ORC SearchArguments") { - import org.apache.spark.sql.sources._ - // The `LessThan` should be converted while the `StringContains` shouldn't - val schema = new StructType( - Array( - StructField("a", IntegerType, nullable = true), - StructField("b", StringType, nullable = true))) - - // The predicate `StringContains` predicate is not able to be pushed down. - assertResult("leaf-0 = (LESS_THAN_EQUALS a 10), leaf-1 = (LESS_THAN a 1)," + - " expr = (or (not leaf-0) leaf-1)") { - OrcFilters.createFilter(schema, Array( - Or( - GreaterThan("a", 10), - And( - StringContains("b", "prefix"), - LessThan("a", 1) - ) - ) - )).get.toString - } - - assertResult("leaf-0 = (LESS_THAN_EQUALS a 10), leaf-1 = (LESS_THAN a 1)," + - " expr = (or (not leaf-0) leaf-1)") { - OrcFilters.createFilter(schema, Array( - Or( - And( - GreaterThan("a", 10), - StringContains("b", "foobar") - ), - And( - StringContains("b", "prefix"), - LessThan("a", 1) - ) - ) - )).get.toString - } - - assert(OrcFilters.createFilter(schema, Array( - Or( - StringContains("b", "foobar"), - And( - StringContains("b", "prefix"), - LessThan("a", 1) - ) - ) - )).isEmpty) - } - - test("SPARK-27160: Fix casting of the DecimalType literal") { - import org.apache.spark.sql.sources._ - val schema = StructType(Array(StructField("a", DecimalType(3, 2)))) - assertResult("leaf-0 = (LESS_THAN a 3.14), expr = leaf-0") { - OrcFilters.createFilter(schema, Array( - LessThan( - "a", - new java.math.BigDecimal(3.14, MathContext.DECIMAL64).setScale(2))) - ).get.toString - } - } -} - diff --git a/sql/core/v2.3/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java b/sql/core/v2.3/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java deleted file mode 100644 index 6e55fedfc4deb..0000000000000 --- a/sql/core/v2.3/src/main/java/org/apache/spark/sql/execution/datasources/orc/OrcColumnVector.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.execution.datasources.orc; - -import java.math.BigDecimal; - -import org.apache.hadoop.hive.ql.exec.vector.*; - -import org.apache.spark.sql.catalyst.util.DateTimeUtils; -import org.apache.spark.sql.catalyst.util.RebaseDateTime; -import org.apache.spark.sql.types.DataType; -import org.apache.spark.sql.types.DateType; -import org.apache.spark.sql.types.Decimal; -import org.apache.spark.sql.types.TimestampType; -import org.apache.spark.sql.vectorized.ColumnarArray; -import org.apache.spark.sql.vectorized.ColumnarMap; -import org.apache.spark.unsafe.types.UTF8String; - -/** - * A column vector class wrapping Hive's ColumnVector. Because Spark ColumnarBatch only accepts - * Spark's vectorized.ColumnVector, this column vector is used to adapt Hive ColumnVector with - * Spark ColumnarVector. - */ -public class OrcColumnVector extends org.apache.spark.sql.vectorized.ColumnVector { - private ColumnVector baseData; - private LongColumnVector longData; - private DoubleColumnVector doubleData; - private BytesColumnVector bytesData; - private DecimalColumnVector decimalData; - private TimestampColumnVector timestampData; - private final boolean isTimestamp; - private final boolean isDate; - - private int batchSize; - - OrcColumnVector(DataType type, ColumnVector vector) { - super(type); - - if (type instanceof TimestampType) { - isTimestamp = true; - } else { - isTimestamp = false; - } - - if (type instanceof DateType) { - isDate = true; - } else { - isDate = false; - } - - baseData = vector; - if (vector instanceof LongColumnVector) { - longData = (LongColumnVector) vector; - } else if (vector instanceof DoubleColumnVector) { - doubleData = (DoubleColumnVector) vector; - } else if (vector instanceof BytesColumnVector) { - bytesData = (BytesColumnVector) vector; - } else if (vector instanceof DecimalColumnVector) { - decimalData = (DecimalColumnVector) vector; - } else if (vector instanceof TimestampColumnVector) { - timestampData = (TimestampColumnVector) vector; - } else { - throw new UnsupportedOperationException(); - } - } - - public void setBatchSize(int batchSize) { - this.batchSize = batchSize; - } - - @Override - public void close() { - - } - - @Override - public boolean hasNull() { - return !baseData.noNulls; - } - - @Override - public int numNulls() { - if (baseData.isRepeating) { - if (baseData.isNull[0]) { - return batchSize; - } else { - return 0; - } - } else if (baseData.noNulls) { - return 0; - } else { - int count = 0; - for (int i = 0; i < batchSize; i++) { - if (baseData.isNull[i]) count++; - } - return count; - } - } - - /* A helper method to get the row index in a column. */ - private int getRowIndex(int rowId) { - return baseData.isRepeating ? 0 : rowId; - } - - @Override - public boolean isNullAt(int rowId) { - return baseData.isNull[getRowIndex(rowId)]; - } - - @Override - public boolean getBoolean(int rowId) { - return longData.vector[getRowIndex(rowId)] == 1; - } - - @Override - public byte getByte(int rowId) { - return (byte) longData.vector[getRowIndex(rowId)]; - } - - @Override - public short getShort(int rowId) { - return (short) longData.vector[getRowIndex(rowId)]; - } - - @Override - public int getInt(int rowId) { - int value = (int) longData.vector[getRowIndex(rowId)]; - if (isDate) { - return RebaseDateTime.rebaseJulianToGregorianDays(value); - } else { - return value; - } - } - - @Override - public long getLong(int rowId) { - int index = getRowIndex(rowId); - if (isTimestamp) { - return DateTimeUtils.fromJavaTimestamp(timestampData.asScratchTimestamp(index)); - } else { - return longData.vector[index]; - } - } - - @Override - public float getFloat(int rowId) { - return (float) doubleData.vector[getRowIndex(rowId)]; - } - - @Override - public double getDouble(int rowId) { - return doubleData.vector[getRowIndex(rowId)]; - } - - @Override - public Decimal getDecimal(int rowId, int precision, int scale) { - if (isNullAt(rowId)) return null; - BigDecimal data = decimalData.vector[getRowIndex(rowId)].getHiveDecimal().bigDecimalValue(); - return Decimal.apply(data, precision, scale); - } - - @Override - public UTF8String getUTF8String(int rowId) { - if (isNullAt(rowId)) return null; - int index = getRowIndex(rowId); - BytesColumnVector col = bytesData; - return UTF8String.fromBytes(col.vector[index], col.start[index], col.length[index]); - } - - @Override - public byte[] getBinary(int rowId) { - if (isNullAt(rowId)) return null; - int index = getRowIndex(rowId); - byte[] binary = new byte[bytesData.length[index]]; - System.arraycopy(bytesData.vector[index], bytesData.start[index], binary, 0, binary.length); - return binary; - } - - @Override - public ColumnarArray getArray(int rowId) { - throw new UnsupportedOperationException(); - } - - @Override - public ColumnarMap getMap(int rowId) { - throw new UnsupportedOperationException(); - } - - @Override - public org.apache.spark.sql.vectorized.ColumnVector getChild(int ordinal) { - throw new UnsupportedOperationException(); - } -} diff --git a/sql/core/v2.3/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala b/sql/core/v2.3/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala deleted file mode 100644 index 445a52cece1c3..0000000000000 --- a/sql/core/v2.3/src/main/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilters.scala +++ /dev/null @@ -1,270 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.execution.datasources.orc - -import java.time.LocalDate - -import org.apache.hadoop.hive.common.`type`.HiveDecimal -import org.apache.hadoop.hive.ql.io.sarg.{PredicateLeaf, SearchArgument} -import org.apache.hadoop.hive.ql.io.sarg.SearchArgument.Builder -import org.apache.hadoop.hive.ql.io.sarg.SearchArgumentFactory.newBuilder -import org.apache.hadoop.hive.serde2.io.HiveDecimalWritable - -import org.apache.spark.SparkException -import org.apache.spark.sql.catalyst.util.DateTimeUtils.{localDateToDays, toJavaDate} -import org.apache.spark.sql.connector.catalog.CatalogV2Implicits.quoteIfNeeded -import org.apache.spark.sql.sources.Filter -import org.apache.spark.sql.types._ - -/** - * Helper object for building ORC `SearchArgument`s, which are used for ORC predicate push-down. - * - * Due to limitation of ORC `SearchArgument` builder, we had to implement separate checking and - * conversion passes through the Filter to make sure we only convert predicates that are known - * to be convertible. - * - * An ORC `SearchArgument` must be built in one pass using a single builder. For example, you can't - * build `a = 1` and `b = 2` first, and then combine them into `a = 1 AND b = 2`. This is quite - * different from the cases in Spark SQL or Parquet, where complex filters can be easily built using - * existing simpler ones. - * - * The annoying part is that, `SearchArgument` builder methods like `startAnd()`, `startOr()`, and - * `startNot()` mutate internal state of the builder instance. This forces us to translate all - * convertible filters with a single builder instance. However, if we try to translate a filter - * before checking whether it can be converted or not, we may end up with a builder whose internal - * state is inconsistent in the case of an inconvertible filter. - * - * For example, to convert an `And` filter with builder `b`, we call `b.startAnd()` first, and then - * try to convert its children. Say we convert `left` child successfully, but find that `right` - * child is inconvertible. Alas, `b.startAnd()` call can't be rolled back, and `b` is inconsistent - * now. - * - * The workaround employed here is to trim the Spark filters before trying to convert them. This - * way, we can only do the actual conversion on the part of the Filter that is known to be - * convertible. - * - * P.S.: Hive seems to use `SearchArgument` together with `ExprNodeGenericFuncDesc` only. Usage of - * builder methods mentioned above can only be found in test code, where all tested filters are - * known to be convertible. - */ -private[sql] object OrcFilters extends OrcFiltersBase { - - /** - * Create ORC filter as a SearchArgument instance. - */ - def createFilter(schema: StructType, filters: Seq[Filter]): Option[SearchArgument] = { - val dataTypeMap = schema.map(f => quoteIfNeeded(f.name) -> f.dataType).toMap - // Combines all convertible filters using `And` to produce a single conjunction - // TODO (SPARK-25557): ORC doesn't support nested predicate pushdown, so they are removed. - val newFilters = filters.filter(!_.containsNestedColumn) - val conjunctionOptional = buildTree(convertibleFilters(schema, dataTypeMap, newFilters)) - conjunctionOptional.map { conjunction => - // Then tries to build a single ORC `SearchArgument` for the conjunction predicate. - // The input predicate is fully convertible. There should not be any empty result in the - // following recursive method call `buildSearchArgument`. - buildSearchArgument(dataTypeMap, conjunction, newBuilder).build() - } - } - - def convertibleFilters( - schema: StructType, - dataTypeMap: Map[String, DataType], - filters: Seq[Filter]): Seq[Filter] = { - import org.apache.spark.sql.sources._ - - def convertibleFiltersHelper( - filter: Filter, - canPartialPushDown: Boolean): Option[Filter] = filter match { - // At here, it is not safe to just convert one side and remove the other side - // if we do not understand what the parent filters are. - // - // Here is an example used to explain the reason. - // Let's say we have NOT(a = 2 AND b in ('1')) and we do not understand how to - // convert b in ('1'). If we only convert a = 2, we will end up with a filter - // NOT(a = 2), which will generate wrong results. - // - // Pushing one side of AND down is only safe to do at the top level or in the child - // AND before hitting NOT or OR conditions, and in this case, the unsupported predicate - // can be safely removed. - case And(left, right) => - val leftResultOptional = convertibleFiltersHelper(left, canPartialPushDown) - val rightResultOptional = convertibleFiltersHelper(right, canPartialPushDown) - (leftResultOptional, rightResultOptional) match { - case (Some(leftResult), Some(rightResult)) => Some(And(leftResult, rightResult)) - case (Some(leftResult), None) if canPartialPushDown => Some(leftResult) - case (None, Some(rightResult)) if canPartialPushDown => Some(rightResult) - case _ => None - } - - // The Or predicate is convertible when both of its children can be pushed down. - // That is to say, if one/both of the children can be partially pushed down, the Or - // predicate can be partially pushed down as well. - // - // Here is an example used to explain the reason. - // Let's say we have - // (a1 AND a2) OR (b1 AND b2), - // a1 and b1 is convertible, while a2 and b2 is not. - // The predicate can be converted as - // (a1 OR b1) AND (a1 OR b2) AND (a2 OR b1) AND (a2 OR b2) - // As per the logical in And predicate, we can push down (a1 OR b1). - case Or(left, right) => - for { - lhs <- convertibleFiltersHelper(left, canPartialPushDown) - rhs <- convertibleFiltersHelper(right, canPartialPushDown) - } yield Or(lhs, rhs) - case Not(pred) => - val childResultOptional = convertibleFiltersHelper(pred, canPartialPushDown = false) - childResultOptional.map(Not) - case other => - for (_ <- buildLeafSearchArgument(dataTypeMap, other, newBuilder())) yield other - } - filters.flatMap { filter => - convertibleFiltersHelper(filter, true) - } - } - - /** - * Get PredicateLeafType which is corresponding to the given DataType. - */ - private def getPredicateLeafType(dataType: DataType) = dataType match { - case BooleanType => PredicateLeaf.Type.BOOLEAN - case ByteType | ShortType | IntegerType | LongType => PredicateLeaf.Type.LONG - case FloatType | DoubleType => PredicateLeaf.Type.FLOAT - case StringType => PredicateLeaf.Type.STRING - case DateType => PredicateLeaf.Type.DATE - case TimestampType => PredicateLeaf.Type.TIMESTAMP - case _: DecimalType => PredicateLeaf.Type.DECIMAL - case _ => throw new UnsupportedOperationException(s"DataType: ${dataType.catalogString}") - } - - /** - * Cast literal values for filters. - * - * We need to cast to long because ORC raises exceptions - * at 'checkLiteralType' of SearchArgumentImpl.java. - */ - private def castLiteralValue(value: Any, dataType: DataType): Any = dataType match { - case ByteType | ShortType | IntegerType | LongType => - value.asInstanceOf[Number].longValue - case FloatType | DoubleType => - value.asInstanceOf[Number].doubleValue() - case _: DecimalType => - new HiveDecimalWritable(HiveDecimal.create(value.asInstanceOf[java.math.BigDecimal])) - case _: DateType if value.isInstanceOf[LocalDate] => - toJavaDate(localDateToDays(value.asInstanceOf[LocalDate])) - case _ => value - } - - /** - * Build a SearchArgument and return the builder so far. - * - * @param dataTypeMap a map from the attribute name to its data type. - * @param expression the input predicates, which should be fully convertible to SearchArgument. - * @param builder the input SearchArgument.Builder. - * @return the builder so far. - */ - private def buildSearchArgument( - dataTypeMap: Map[String, DataType], - expression: Filter, - builder: Builder): Builder = { - import org.apache.spark.sql.sources._ - - expression match { - case And(left, right) => - val lhs = buildSearchArgument(dataTypeMap, left, builder.startAnd()) - val rhs = buildSearchArgument(dataTypeMap, right, lhs) - rhs.end() - - case Or(left, right) => - val lhs = buildSearchArgument(dataTypeMap, left, builder.startOr()) - val rhs = buildSearchArgument(dataTypeMap, right, lhs) - rhs.end() - - case Not(child) => - buildSearchArgument(dataTypeMap, child, builder.startNot()).end() - - case other => - buildLeafSearchArgument(dataTypeMap, other, builder).getOrElse { - throw new SparkException( - "The input filter of OrcFilters.buildSearchArgument should be fully convertible.") - } - } - } - - /** - * Build a SearchArgument for a leaf predicate and return the builder so far. - * - * @param dataTypeMap a map from the attribute name to its data type. - * @param expression the input filter predicates. - * @param builder the input SearchArgument.Builder. - * @return the builder so far. - */ - private def buildLeafSearchArgument( - dataTypeMap: Map[String, DataType], - expression: Filter, - builder: Builder): Option[Builder] = { - def getType(attribute: String): PredicateLeaf.Type = - getPredicateLeafType(dataTypeMap(attribute)) - - import org.apache.spark.sql.sources._ - - // NOTE: For all case branches dealing with leaf predicates below, the additional `startAnd()` - // call is mandatory. ORC `SearchArgument` builder requires that all leaf predicates must be - // wrapped by a "parent" predicate (`And`, `Or`, or `Not`). - // Since ORC 1.5.0 (ORC-323), we need to quote for column names with `.` characters - // in order to distinguish predicate pushdown for nested columns. - expression match { - case EqualTo(name, value) if isSearchableType(dataTypeMap(name)) => - val castedValue = castLiteralValue(value, dataTypeMap(name)) - Some(builder.startAnd().equals(name, getType(name), castedValue).end()) - - case EqualNullSafe(name, value) if isSearchableType(dataTypeMap(name)) => - val castedValue = castLiteralValue(value, dataTypeMap(name)) - Some(builder.startAnd().nullSafeEquals(name, getType(name), castedValue).end()) - - case LessThan(name, value) if isSearchableType(dataTypeMap(name)) => - val castedValue = castLiteralValue(value, dataTypeMap(name)) - Some(builder.startAnd().lessThan(name, getType(name), castedValue).end()) - - case LessThanOrEqual(name, value) if isSearchableType(dataTypeMap(name)) => - val castedValue = castLiteralValue(value, dataTypeMap(name)) - Some(builder.startAnd().lessThanEquals(name, getType(name), castedValue).end()) - - case GreaterThan(name, value) if isSearchableType(dataTypeMap(name)) => - val castedValue = castLiteralValue(value, dataTypeMap(name)) - Some(builder.startNot().lessThanEquals(name, getType(name), castedValue).end()) - - case GreaterThanOrEqual(name, value) if isSearchableType(dataTypeMap(name)) => - val castedValue = castLiteralValue(value, dataTypeMap(name)) - Some(builder.startNot().lessThan(name, getType(name), castedValue).end()) - - case IsNull(name) if isSearchableType(dataTypeMap(name)) => - Some(builder.startAnd().isNull(name, getType(name)).end()) - - case IsNotNull(name) if isSearchableType(dataTypeMap(name)) => - Some(builder.startNot().isNull(name, getType(name)).end()) - - case In(name, values) if isSearchableType(dataTypeMap(name)) => - val castedValues = values.map(v => castLiteralValue(v, dataTypeMap(name))) - Some(builder.startAnd().in(name, getType(name), - castedValues.map(_.asInstanceOf[AnyRef]): _*).end()) - - case _ => None - } - } -} diff --git a/sql/core/v2.3/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilterSuite.scala b/sql/core/v2.3/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilterSuite.scala deleted file mode 100644 index 815af05beb002..0000000000000 --- a/sql/core/v2.3/src/test/scala/org/apache/spark/sql/execution/datasources/orc/OrcFilterSuite.scala +++ /dev/null @@ -1,462 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.execution.datasources.orc - -import java.math.MathContext -import java.nio.charset.StandardCharsets -import java.sql.{Date, Timestamp} - -import scala.collection.JavaConverters._ - -import org.apache.hadoop.hive.ql.io.sarg.{PredicateLeaf, SearchArgument} - -import org.apache.spark.SparkConf -import org.apache.spark.sql.{AnalysisException, Column, DataFrame} -import org.apache.spark.sql.catalyst.dsl.expressions._ -import org.apache.spark.sql.catalyst.expressions._ -import org.apache.spark.sql.catalyst.planning.PhysicalOperation -import org.apache.spark.sql.execution.datasources.{DataSourceStrategy, HadoopFsRelation, LogicalRelation} -import org.apache.spark.sql.execution.datasources.v2.{DataSourceV2Relation, DataSourceV2ScanRelation} -import org.apache.spark.sql.execution.datasources.v2.orc.{OrcScan, OrcTable} -import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.sql.test.SharedSparkSession -import org.apache.spark.sql.types._ - -/** - * A test suite that tests Apache ORC filter API based filter pushdown optimization. - * OrcFilterSuite and HiveOrcFilterSuite is logically duplicated to provide the same test coverage. - * The difference are the packages containing 'Predicate' and 'SearchArgument' classes. - * - OrcFilterSuite uses 'org.apache.orc.storage.ql.io.sarg' package. - * - HiveOrcFilterSuite uses 'org.apache.hadoop.hive.ql.io.sarg' package. - */ -class OrcFilterSuite extends OrcTest with SharedSparkSession { - - override protected def sparkConf: SparkConf = - super - .sparkConf - .set(SQLConf.USE_V1_SOURCE_LIST, "") - - protected def checkFilterPredicate( - df: DataFrame, - predicate: Predicate, - checker: (SearchArgument) => Unit): Unit = { - val output = predicate.collect { case a: Attribute => a }.distinct - val query = df - .select(output.map(e => Column(e)): _*) - .where(Column(predicate)) - - query.queryExecution.optimizedPlan match { - case PhysicalOperation(_, filters, DataSourceV2ScanRelation(_, o: OrcScan, _)) => - assert(filters.nonEmpty, "No filter is analyzed from the given query") - assert(o.pushedFilters.nonEmpty, "No filter is pushed down") - val maybeFilter = OrcFilters.createFilter(query.schema, o.pushedFilters) - assert(maybeFilter.isDefined, s"Couldn't generate filter predicate for ${o.pushedFilters}") - checker(maybeFilter.get) - - case _ => - throw new AnalysisException("Can not match OrcTable in the query.") - } - } - - protected def checkFilterPredicate - (predicate: Predicate, filterOperator: PredicateLeaf.Operator) - (implicit df: DataFrame): Unit = { - def checkComparisonOperator(filter: SearchArgument) = { - val operator = filter.getLeaves.asScala - assert(operator.map(_.getOperator).contains(filterOperator)) - } - checkFilterPredicate(df, predicate, checkComparisonOperator) - } - - protected def checkFilterPredicate - (predicate: Predicate, stringExpr: String) - (implicit df: DataFrame): Unit = { - def checkLogicalOperator(filter: SearchArgument) = { - assert(filter.toString == stringExpr) - } - checkFilterPredicate(df, predicate, checkLogicalOperator) - } - - test("filter pushdown - integer") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === 1, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < 2, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= 4, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(1) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(1) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(2) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(3) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(1) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(4) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - long") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i.toLong)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === 1, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < 2, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= 4, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(1) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(1) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(2) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(3) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(1) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(4) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - float") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i.toFloat)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === 1, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < 2, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= 4, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(1) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(1) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(2) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(3) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(1) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(4) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - double") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i.toDouble)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === 1, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < 2, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= 4, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(1) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(1) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(2) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(3) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(1) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(4) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - string") { - withOrcDataFrame((1 to 4).map(i => Tuple1(i.toString))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === "1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> "1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < "2", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > "3", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= "1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= "4", PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal("1") === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal("1") <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal("2") > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal("3") < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal("1") >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal("4") <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - boolean") { - withOrcDataFrame((true :: false :: Nil).map(b => Tuple1.apply(Option(b)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === true, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> true, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < true, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > false, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= false, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= false, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(false) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(false) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(false) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(true) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(true) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(true) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - decimal") { - withOrcDataFrame((1 to 4).map(i => Tuple1.apply(BigDecimal.valueOf(i)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === BigDecimal.valueOf(1), PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> BigDecimal.valueOf(1), PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < BigDecimal.valueOf(2), PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > BigDecimal.valueOf(3), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= BigDecimal.valueOf(1), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= BigDecimal.valueOf(4), PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate( - Literal(BigDecimal.valueOf(1)) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate( - Literal(BigDecimal.valueOf(1)) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate( - Literal(BigDecimal.valueOf(2)) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate( - Literal(BigDecimal.valueOf(3)) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate( - Literal(BigDecimal.valueOf(1)) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate( - Literal(BigDecimal.valueOf(4)) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - timestamp") { - val timeString = "2015-08-20 14:57:00" - val timestamps = (1 to 4).map { i => - val milliseconds = Timestamp.valueOf(timeString).getTime + i * 3600 - new Timestamp(milliseconds) - } - withOrcDataFrame(timestamps.map(Tuple1(_))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === timestamps(0), PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> timestamps(0), PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < timestamps(1), PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > timestamps(2), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= timestamps(0), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= timestamps(3), PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(timestamps(0)) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate( - Literal(timestamps(0)) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(timestamps(1)) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(timestamps(2)) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(timestamps(0)) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(timestamps(3)) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - combinations with logical operators") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i)))) { implicit df => - checkFilterPredicate( - $"_1".isNotNull, - "leaf-0 = (IS_NULL _1), expr = (not leaf-0)" - ) - checkFilterPredicate( - $"_1" =!= 1, - "leaf-0 = (IS_NULL _1), leaf-1 = (EQUALS _1 1), expr = (and (not leaf-0) (not leaf-1))" - ) - checkFilterPredicate( - !($"_1" < 4), - "leaf-0 = (IS_NULL _1), leaf-1 = (LESS_THAN _1 4), expr = (and (not leaf-0) (not leaf-1))" - ) - checkFilterPredicate( - $"_1" < 2 || $"_1" > 3, - "leaf-0 = (LESS_THAN _1 2), leaf-1 = (LESS_THAN_EQUALS _1 3), " + - "expr = (or leaf-0 (not leaf-1))" - ) - checkFilterPredicate( - $"_1" < 2 && $"_1" > 3, - "leaf-0 = (IS_NULL _1), leaf-1 = (LESS_THAN _1 2), leaf-2 = (LESS_THAN_EQUALS _1 3), " + - "expr = (and (not leaf-0) leaf-1 (not leaf-2))" - ) - } - } - - test("filter pushdown - date") { - val input = Seq("2017-08-18", "2017-08-19", "2017-08-20", "2017-08-21").map { day => - Date.valueOf(day) - } - withOrcFile(input.map(Tuple1(_))) { path => - Seq(false, true).foreach { java8Api => - withSQLConf(SQLConf.DATETIME_JAVA8API_ENABLED.key -> java8Api.toString) { - readFile(path) { implicit df => - val dates = input.map(Literal(_)) - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === dates(0), PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> dates(0), PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < dates(1), PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > dates(2), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= dates(0), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= dates(3), PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(dates(0) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(dates(0) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(dates(1) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(dates(2) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(dates(0) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(dates(3) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - } - } - } - - test("no filter pushdown - non-supported types") { - implicit class IntToBinary(int: Int) { - def b: Array[Byte] = int.toString.getBytes(StandardCharsets.UTF_8) - } - // ArrayType - withOrcDataFrame((1 to 4).map(i => Tuple1(Array(i)))) { implicit df => - checkNoFilterPredicate($"_1".isNull, noneSupported = true) - } - // BinaryType - withOrcDataFrame((1 to 4).map(i => Tuple1(i.b))) { implicit df => - checkNoFilterPredicate($"_1" <=> 1.b, noneSupported = true) - } - // MapType - withOrcDataFrame((1 to 4).map(i => Tuple1(Map(i -> i)))) { implicit df => - checkNoFilterPredicate($"_1".isNotNull, noneSupported = true) - } - } - - test("SPARK-12218 and SPARK-25699 Converting conjunctions into ORC SearchArguments") { - import org.apache.spark.sql.sources._ - // The `LessThan` should be converted while the `StringContains` shouldn't - val schema = new StructType( - Array( - StructField("a", IntegerType, nullable = true), - StructField("b", StringType, nullable = true))) - assertResult("leaf-0 = (LESS_THAN a 10), expr = leaf-0") { - OrcFilters.createFilter(schema, Array( - LessThan("a", 10), - StringContains("b", "prefix") - )).get.toString - } - - // The `LessThan` should be converted while the whole inner `And` shouldn't - assertResult("leaf-0 = (LESS_THAN a 10), expr = leaf-0") { - OrcFilters.createFilter(schema, Array( - LessThan("a", 10), - Not(And( - GreaterThan("a", 1), - StringContains("b", "prefix") - )) - )).get.toString - } - - // Safely remove unsupported `StringContains` predicate and push down `LessThan` - assertResult("leaf-0 = (LESS_THAN a 10), expr = leaf-0") { - OrcFilters.createFilter(schema, Array( - And( - LessThan("a", 10), - StringContains("b", "prefix") - ) - )).get.toString - } - - // Safely remove unsupported `StringContains` predicate, push down `LessThan` and `GreaterThan`. - assertResult("leaf-0 = (LESS_THAN a 10), leaf-1 = (LESS_THAN_EQUALS a 1)," + - " expr = (and leaf-0 (not leaf-1))") { - OrcFilters.createFilter(schema, Array( - And( - And( - LessThan("a", 10), - StringContains("b", "prefix") - ), - GreaterThan("a", 1) - ) - )).get.toString - } - } - - test("SPARK-27699 Converting disjunctions into ORC SearchArguments") { - import org.apache.spark.sql.sources._ - // The `LessThan` should be converted while the `StringContains` shouldn't - val schema = new StructType( - Array( - StructField("a", IntegerType, nullable = true), - StructField("b", StringType, nullable = true))) - - // The predicate `StringContains` predicate is not able to be pushed down. - assertResult("leaf-0 = (LESS_THAN_EQUALS a 10), leaf-1 = (LESS_THAN a 1)," + - " expr = (or (not leaf-0) leaf-1)") { - OrcFilters.createFilter(schema, Array( - Or( - GreaterThan("a", 10), - And( - StringContains("b", "prefix"), - LessThan("a", 1) - ) - ) - )).get.toString - } - - assertResult("leaf-0 = (LESS_THAN_EQUALS a 10), leaf-1 = (LESS_THAN a 1)," + - " expr = (or (not leaf-0) leaf-1)") { - OrcFilters.createFilter(schema, Array( - Or( - And( - GreaterThan("a", 10), - StringContains("b", "foobar") - ), - And( - StringContains("b", "prefix"), - LessThan("a", 1) - ) - ) - )).get.toString - } - - assert(OrcFilters.createFilter(schema, Array( - Or( - StringContains("b", "foobar"), - And( - StringContains("b", "prefix"), - LessThan("a", 1) - ) - ) - )).isEmpty) - } - - test("SPARK-27160: Fix casting of the DecimalType literal") { - import org.apache.spark.sql.sources._ - val schema = StructType(Array(StructField("a", DecimalType(3, 2)))) - assertResult("leaf-0 = (LESS_THAN a 3.14), expr = leaf-0") { - OrcFilters.createFilter(schema, Array( - LessThan( - "a", - new java.math.BigDecimal(3.14, MathContext.DECIMAL64).setScale(2))) - ).get.toString - } - } -} - diff --git a/sql/create-docs.sh b/sql/create-docs.sh index 6614c714e90c7..8721df874ee73 100755 --- a/sql/create-docs.sh +++ b/sql/create-docs.sh @@ -27,14 +27,14 @@ set -e FWDIR="$(cd "`dirname "${BASH_SOURCE[0]}"`"; pwd)" SPARK_HOME="$(cd "`dirname "${BASH_SOURCE[0]}"`"/..; pwd)" -if ! hash python 2>/dev/null; then - echo "Missing python in your path, skipping SQL documentation generation." +if ! hash python3 2>/dev/null; then + echo "Missing python3 in your path, skipping SQL documentation generation." exit 0 fi if ! hash mkdocs 2>/dev/null; then echo "Missing mkdocs in your path, trying to install mkdocs for SQL documentation generation." - pip install mkdocs + pip3 install mkdocs fi pushd "$FWDIR" > /dev/null diff --git a/sql/gen-sql-api-docs.py b/sql/gen-sql-api-docs.py index 61328997c1c58..17631a7352a02 100644 --- a/sql/gen-sql-api-docs.py +++ b/sql/gen-sql-api-docs.py @@ -24,6 +24,106 @@ ExpressionInfo = namedtuple( "ExpressionInfo", "className name usage arguments examples note since deprecated") +_virtual_operator_infos = [ + ExpressionInfo( + className="", + name="!=", + usage="expr1 != expr2 - Returns true if `expr1` is not equal to `expr2`, " + + "or false otherwise.", + arguments="\n Arguments:\n " + + """* expr1, expr2 - the two expressions must be same type or can be casted to + a common type, and must be a type that can be used in equality comparison. + Map type is not supported. For complex types such array/struct, + the data types of fields must be orderable.""", + examples="\n Examples:\n " + + "> SELECT 1 != 2;\n " + + " true\n " + + "> SELECT 1 != '2';\n " + + " true\n " + + "> SELECT true != NULL;\n " + + " NULL\n " + + "> SELECT NULL != NULL;\n " + + " NULL", + note="", + since="1.0.0", + deprecated=""), + ExpressionInfo( + className="", + name="<>", + usage="expr1 != expr2 - Returns true if `expr1` is not equal to `expr2`, " + + "or false otherwise.", + arguments="\n Arguments:\n " + + """* expr1, expr2 - the two expressions must be same type or can be casted to + a common type, and must be a type that can be used in equality comparison. + Map type is not supported. For complex types such array/struct, + the data types of fields must be orderable.""", + examples="\n Examples:\n " + + "> SELECT 1 != 2;\n " + + " true\n " + + "> SELECT 1 != '2';\n " + + " true\n " + + "> SELECT true != NULL;\n " + + " NULL\n " + + "> SELECT NULL != NULL;\n " + + " NULL", + note="", + since="1.0.0", + deprecated=""), + ExpressionInfo( + className="", + name="between", + usage="expr1 [NOT] BETWEEN expr2 AND expr3 - " + + "evaluate if `expr1` is [not] in between `expr2` and `expr3`.", + arguments="", + examples="\n Examples:\n " + + "> SELECT col1 FROM VALUES 1, 3, 5, 7 WHERE col1 BETWEEN 2 AND 5;\n " + + " 3\n " + + " 5", + note="", + since="1.0.0", + deprecated=""), + ExpressionInfo( + className="", + name="case", + usage="CASE expr1 WHEN expr2 THEN expr3 " + + "[WHEN expr4 THEN expr5]* [ELSE expr6] END - " + + "When `expr1` = `expr2`, returns `expr3`; " + + "when `expr1` = `expr4`, return `expr5`; else return `expr6`.", + arguments="\n Arguments:\n " + + "* expr1 - the expression which is one operand of comparison.\n " + + "* expr2, expr4 - the expressions each of which is the other " + + " operand of comparison.\n " + + "* expr3, expr5, expr6 - the branch value expressions and else value expression" + + " should all be same type or coercible to a common type.", + examples="\n Examples:\n " + + "> SELECT CASE col1 WHEN 1 THEN 'one' " + + "WHEN 2 THEN 'two' ELSE '?' END FROM VALUES 1, 2, 3;\n " + + " one\n " + + " two\n " + + " ?\n " + + "> SELECT CASE col1 WHEN 1 THEN 'one' " + + "WHEN 2 THEN 'two' END FROM VALUES 1, 2, 3;\n " + + " one\n " + + " two\n " + + " NULL", + note="", + since="1.0.1", + deprecated=""), + ExpressionInfo( + className="", + name="||", + usage="expr1 || expr2 - Returns the concatenation of `expr1` and `expr2`.", + arguments="", + examples="\n Examples:\n " + + "> SELECT 'Spark' || 'SQL';\n " + + " SparkSQL\n " + + "> SELECT array(1, 2, 3) || array(4, 5) || array(6);\n " + + " [1,2,3,4,5,6]", + note="\n || for arrays is available since 2.4.0.\n", + since="2.3.0", + deprecated="") +] + def _list_function_infos(jvm): """ @@ -32,7 +132,7 @@ def _list_function_infos(jvm): """ jinfos = jvm.org.apache.spark.sql.api.python.PythonSQLUtils.listBuiltinFunctionInfos() - infos = [] + infos = _virtual_operator_infos for jinfo in jinfos: name = jinfo.getName() usage = jinfo.getUsage() @@ -195,6 +295,7 @@ def generate_sql_api_markdown(jvm, path): """ with open(path, 'w') as mdfile: + mdfile.write("# Built-in Functions\n\n") for info in _list_function_infos(jvm): name = info.name usage = _make_pretty_usage(info.usage) diff --git a/sql/hive-thriftserver/pom.xml b/sql/hive-thriftserver/pom.xml index 1de2677d5ede5..7d61b92b4f6ef 100644 --- a/sql/hive-thriftserver/pom.xml +++ b/sql/hive-thriftserver/pom.xml @@ -22,7 +22,7 @@ org.apache.spark spark-parent_2.12 - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../../pom.xml @@ -77,6 +77,10 @@ ${hive.group} hive-beeline + + ${hive.group} + hive-service-rpc + org.eclipse.jetty jetty-server @@ -95,7 +99,7 @@ org.seleniumhq.selenium - selenium-htmlunit-driver + htmlunit-driver test @@ -129,31 +133,13 @@ net.sf.jpam jpam + + commons-cli + commons-cli + target/scala-${scala.binary.version}/classes target/scala-${scala.binary.version}/test-classes - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-source - generate-sources - - add-source - - - - v${hive.version.short}/src/gen/java - v${hive.version.short}/src/main/java - v${hive.version.short}/src/main/scala - - - - - - diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/AbstractService.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/AbstractService.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/AbstractService.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/AbstractService.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/CompositeService.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/CompositeService.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/CompositeService.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/CompositeService.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/CookieSigner.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/CookieSigner.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/CookieSigner.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/CookieSigner.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/ServiceOperations.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/ServiceOperations.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/ServiceOperations.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/ServiceOperations.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/ServiceUtils.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/ServiceUtils.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/ServiceUtils.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/ServiceUtils.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/auth/HttpAuthUtils.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/HttpAuthUtils.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/auth/HttpAuthUtils.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/HttpAuthUtils.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/auth/KerberosSaslHelper.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/KerberosSaslHelper.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/auth/KerberosSaslHelper.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/KerberosSaslHelper.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/CLIService.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/CLIService.java new file mode 100644 index 0000000000000..68f044c6a0f28 --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/CLIService.java @@ -0,0 +1,583 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli; + +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CancellationException; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; + +import javax.security.auth.login.LoginException; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.conf.HiveConf.ConfVars; +import org.apache.hadoop.hive.metastore.HiveMetaStoreClient; +import org.apache.hadoop.hive.metastore.IMetaStoreClient; +import org.apache.hadoop.hive.metastore.api.MetaException; +import org.apache.hadoop.hive.ql.exec.FunctionRegistry; +import org.apache.hadoop.hive.ql.metadata.Hive; +import org.apache.hadoop.hive.ql.metadata.HiveException; +import org.apache.hadoop.hive.ql.session.SessionState; +import org.apache.hadoop.hive.shims.Utils; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hive.service.CompositeService; +import org.apache.hive.service.ServiceException; +import org.apache.hive.service.auth.HiveAuthFactory; +import org.apache.hive.service.cli.operation.Operation; +import org.apache.hive.service.cli.session.HiveSession; +import org.apache.hive.service.cli.session.SessionManager; +import org.apache.hive.service.rpc.thrift.TOperationHandle; +import org.apache.hive.service.rpc.thrift.TProtocolVersion; +import org.apache.hive.service.server.HiveServer2; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * CLIService. + * + */ +public class CLIService extends CompositeService implements ICLIService { + + public static final TProtocolVersion SERVER_VERSION; + + static { + TProtocolVersion[] protocols = TProtocolVersion.values(); + SERVER_VERSION = protocols[protocols.length - 1]; + } + + private final Logger LOG = LoggerFactory.getLogger(CLIService.class.getName()); + + private HiveConf hiveConf; + private SessionManager sessionManager; + private UserGroupInformation serviceUGI; + private UserGroupInformation httpUGI; + // The HiveServer2 instance running this service + private final HiveServer2 hiveServer2; + + public CLIService(HiveServer2 hiveServer2) { + super(CLIService.class.getSimpleName()); + this.hiveServer2 = hiveServer2; + } + + @Override + public synchronized void init(HiveConf hiveConf) { + this.hiveConf = hiveConf; + sessionManager = new SessionManager(hiveServer2); + addService(sessionManager); + // If the hadoop cluster is secure, do a kerberos login for the service from the keytab + if (UserGroupInformation.isSecurityEnabled()) { + try { + HiveAuthFactory.loginFromKeytab(hiveConf); + this.serviceUGI = Utils.getUGI(); + } catch (IOException e) { + throw new ServiceException("Unable to login to kerberos with given principal/keytab", e); + } catch (LoginException e) { + throw new ServiceException("Unable to login to kerberos with given principal/keytab", e); + } + + // Also try creating a UGI object for the SPNego principal + String principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_PRINCIPAL); + String keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_KEYTAB); + if (principal.isEmpty() || keyTabFile.isEmpty()) { + LOG.info("SPNego httpUGI not created, spNegoPrincipal: " + principal + + ", ketabFile: " + keyTabFile); + } else { + try { + this.httpUGI = HiveAuthFactory.loginFromSpnegoKeytabAndReturnUGI(hiveConf); + LOG.info("SPNego httpUGI successfully created."); + } catch (IOException e) { + LOG.warn("SPNego httpUGI creation failed: ", e); + } + } + } + // creates connection to HMS and thus *must* occur after kerberos login above + try { + applyAuthorizationConfigPolicy(hiveConf); + } catch (Exception e) { + throw new RuntimeException("Error applying authorization policy on hive configuration: " + + e.getMessage(), e); + } + setupBlockedUdfs(); + super.init(hiveConf); + } + + private void applyAuthorizationConfigPolicy(HiveConf newHiveConf) throws HiveException, + MetaException { + // authorization setup using SessionState should be revisited eventually, as + // authorization and authentication are not session specific settings + SessionState ss = new SessionState(newHiveConf); + ss.setIsHiveServerQuery(true); + SessionState.start(ss); + ss.applyAuthorizationPolicy(); + } + + private void setupBlockedUdfs() { + FunctionRegistry.setupPermissionsForBuiltinUDFs( + hiveConf.getVar(ConfVars.HIVE_SERVER2_BUILTIN_UDF_WHITELIST), + hiveConf.getVar(ConfVars.HIVE_SERVER2_BUILTIN_UDF_BLACKLIST)); + } + + public UserGroupInformation getServiceUGI() { + return this.serviceUGI; + } + + public UserGroupInformation getHttpUGI() { + return this.httpUGI; + } + + @Override + public synchronized void start() { + super.start(); + // Initialize and test a connection to the metastore + IMetaStoreClient metastoreClient = null; + try { + metastoreClient = new HiveMetaStoreClient(hiveConf); + metastoreClient.getDatabases("default"); + } catch (Exception e) { + throw new ServiceException("Unable to connect to MetaStore!", e); + } + finally { + if (metastoreClient != null) { + metastoreClient.close(); + } + } + } + + @Override + public synchronized void stop() { + super.stop(); + } + + /** + * @deprecated Use {@link #openSession(TProtocolVersion, String, String, String, Map)} + */ + @Deprecated + public SessionHandle openSession(TProtocolVersion protocol, String username, String password, + Map configuration) throws HiveSQLException { + SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, null, configuration, false, null); + LOG.debug(sessionHandle + ": openSession()"); + return sessionHandle; + } + + /** + * @deprecated Use {@link #openSessionWithImpersonation(TProtocolVersion, String, String, String, Map, String)} + */ + @Deprecated + public SessionHandle openSessionWithImpersonation(TProtocolVersion protocol, String username, + String password, Map configuration, String delegationToken) + throws HiveSQLException { + SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, null, configuration, + true, delegationToken); + LOG.debug(sessionHandle + ": openSessionWithImpersonation()"); + return sessionHandle; + } + + public SessionHandle openSession(TProtocolVersion protocol, String username, String password, String ipAddress, + Map configuration) throws HiveSQLException { + SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, ipAddress, configuration, false, null); + LOG.debug(sessionHandle + ": openSession()"); + return sessionHandle; + } + + public SessionHandle openSessionWithImpersonation(TProtocolVersion protocol, String username, + String password, String ipAddress, Map configuration, String delegationToken) + throws HiveSQLException { + SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, ipAddress, configuration, + true, delegationToken); + LOG.debug(sessionHandle + ": openSession()"); + return sessionHandle; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map) + */ + @Override + public SessionHandle openSession(String username, String password, Map configuration) + throws HiveSQLException { + SessionHandle sessionHandle = sessionManager.openSession(SERVER_VERSION, username, password, null, configuration, false, null); + LOG.debug(sessionHandle + ": openSession()"); + return sessionHandle; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map) + */ + @Override + public SessionHandle openSessionWithImpersonation(String username, String password, Map configuration, + String delegationToken) throws HiveSQLException { + SessionHandle sessionHandle = sessionManager.openSession(SERVER_VERSION, username, password, null, configuration, + true, delegationToken); + LOG.debug(sessionHandle + ": openSession()"); + return sessionHandle; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#closeSession(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public void closeSession(SessionHandle sessionHandle) + throws HiveSQLException { + sessionManager.closeSession(sessionHandle); + LOG.debug(sessionHandle + ": closeSession()"); + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getInfo(org.apache.hive.service.cli.SessionHandle, java.util.List) + */ + @Override + public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType getInfoType) + throws HiveSQLException { + GetInfoValue infoValue = sessionManager.getSession(sessionHandle) + .getInfo(getInfoType); + LOG.debug(sessionHandle + ": getInfo()"); + return infoValue; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#executeStatement(org.apache.hive.service.cli.SessionHandle, + * java.lang.String, java.util.Map) + */ + @Override + public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, + Map confOverlay) throws HiveSQLException { + HiveSession session = sessionManager.getSession(sessionHandle); + // need to reset the monitor, as operation handle is not available down stream, Ideally the + // monitor should be associated with the operation handle. + session.getSessionState().updateProgressMonitor(null); + OperationHandle opHandle = session.executeStatement(statement, confOverlay); + LOG.debug(sessionHandle + ": executeStatement()"); + return opHandle; + } + + /** + * Execute statement on the server with a timeout. This is a blocking call. + */ + @Override + public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, + Map confOverlay, long queryTimeout) throws HiveSQLException { + HiveSession session = sessionManager.getSession(sessionHandle); + // need to reset the monitor, as operation handle is not available down stream, Ideally the + // monitor should be associated with the operation handle. + session.getSessionState().updateProgressMonitor(null); + OperationHandle opHandle = session.executeStatement(statement, confOverlay, queryTimeout); + LOG.debug(sessionHandle + ": executeStatement()"); + return opHandle; + } + + /** + * Execute statement asynchronously on the server. This is a non-blocking call + */ + @Override + public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, + Map confOverlay) throws HiveSQLException { + HiveSession session = sessionManager.getSession(sessionHandle); + // need to reset the monitor, as operation handle is not available down stream, Ideally the + // monitor should be associated with the operation handle. + session.getSessionState().updateProgressMonitor(null); + OperationHandle opHandle = session.executeStatementAsync(statement, confOverlay); + LOG.debug(sessionHandle + ": executeStatementAsync()"); + return opHandle; + } + + /** + * Execute statement asynchronously on the server with a timeout. This is a non-blocking call + */ + @Override + public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, + Map confOverlay, long queryTimeout) throws HiveSQLException { + HiveSession session = sessionManager.getSession(sessionHandle); + // need to reset the monitor, as operation handle is not available down stream, Ideally the + // monitor should be associated with the operation handle. + session.getSessionState().updateProgressMonitor(null); + OperationHandle opHandle = session.executeStatementAsync(statement, confOverlay, queryTimeout); + LOG.debug(sessionHandle + ": executeStatementAsync()"); + return opHandle; + } + + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getTypeInfo(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public OperationHandle getTypeInfo(SessionHandle sessionHandle) + throws HiveSQLException { + OperationHandle opHandle = sessionManager.getSession(sessionHandle) + .getTypeInfo(); + LOG.debug(sessionHandle + ": getTypeInfo()"); + return opHandle; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getCatalogs(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public OperationHandle getCatalogs(SessionHandle sessionHandle) + throws HiveSQLException { + OperationHandle opHandle = sessionManager.getSession(sessionHandle) + .getCatalogs(); + LOG.debug(sessionHandle + ": getCatalogs()"); + return opHandle; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getSchemas(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String) + */ + @Override + public OperationHandle getSchemas(SessionHandle sessionHandle, + String catalogName, String schemaName) + throws HiveSQLException { + OperationHandle opHandle = sessionManager.getSession(sessionHandle) + .getSchemas(catalogName, schemaName); + LOG.debug(sessionHandle + ": getSchemas()"); + return opHandle; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getTables(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.util.List) + */ + @Override + public OperationHandle getTables(SessionHandle sessionHandle, + String catalogName, String schemaName, String tableName, List tableTypes) + throws HiveSQLException { + OperationHandle opHandle = sessionManager.getSession(sessionHandle) + .getTables(catalogName, schemaName, tableName, tableTypes); + LOG.debug(sessionHandle + ": getTables()"); + return opHandle; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getTableTypes(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public OperationHandle getTableTypes(SessionHandle sessionHandle) + throws HiveSQLException { + OperationHandle opHandle = sessionManager.getSession(sessionHandle) + .getTableTypes(); + LOG.debug(sessionHandle + ": getTableTypes()"); + return opHandle; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getColumns(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public OperationHandle getColumns(SessionHandle sessionHandle, + String catalogName, String schemaName, String tableName, String columnName) + throws HiveSQLException { + OperationHandle opHandle = sessionManager.getSession(sessionHandle) + .getColumns(catalogName, schemaName, tableName, columnName); + LOG.debug(sessionHandle + ": getColumns()"); + return opHandle; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getFunctions(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public OperationHandle getFunctions(SessionHandle sessionHandle, + String catalogName, String schemaName, String functionName) + throws HiveSQLException { + OperationHandle opHandle = sessionManager.getSession(sessionHandle) + .getFunctions(catalogName, schemaName, functionName); + LOG.debug(sessionHandle + ": getFunctions()"); + return opHandle; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getPrimaryKeys(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public OperationHandle getPrimaryKeys(SessionHandle sessionHandle, + String catalog, String schema, String table) throws HiveSQLException { + OperationHandle opHandle = sessionManager.getSession(sessionHandle) + .getPrimaryKeys(catalog, schema, table); + LOG.debug(sessionHandle + ": getPrimaryKeys()"); + return opHandle; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getCrossReference(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public OperationHandle getCrossReference(SessionHandle sessionHandle, + String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, + String foreignSchema, String foreignTable) throws HiveSQLException { + OperationHandle opHandle = sessionManager.getSession(sessionHandle) + .getCrossReference(primaryCatalog, primarySchema, primaryTable, + foreignCatalog, + foreignSchema, foreignTable); + LOG.debug(sessionHandle + ": getCrossReference()"); + return opHandle; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getOperationStatus(org.apache.hive.service.cli.OperationHandle) + */ + @Override + public OperationStatus getOperationStatus(OperationHandle opHandle) + throws HiveSQLException { + Operation operation = sessionManager.getOperationManager().getOperation(opHandle); + /** + * If this is a background operation run asynchronously, + * we block for a configured duration, before we return + * (duration: HIVE_SERVER2_LONG_POLLING_TIMEOUT). + * However, if the background operation is complete, we return immediately. + */ + if (operation.shouldRunAsync()) { + HiveConf conf = operation.getParentSession().getHiveConf(); + long timeout = HiveConf.getTimeVar(conf, + HiveConf.ConfVars.HIVE_SERVER2_LONG_POLLING_TIMEOUT, TimeUnit.MILLISECONDS); + try { + operation.getBackgroundHandle().get(timeout, TimeUnit.MILLISECONDS); + } catch (TimeoutException e) { + // No Op, return to the caller since long polling timeout has expired + LOG.trace(opHandle + ": Long polling timed out"); + } catch (CancellationException e) { + // The background operation thread was cancelled + LOG.trace(opHandle + ": The background operation was cancelled", e); + } catch (ExecutionException e) { + // The background operation thread was aborted + LOG.warn(opHandle + ": The background operation was aborted", e); + } catch (InterruptedException e) { + // No op, this thread was interrupted + // In this case, the call might return sooner than long polling timeout + } + } + OperationStatus opStatus = operation.getStatus(); + LOG.debug(opHandle + ": getOperationStatus()"); + return opStatus; + } + + public HiveConf getSessionConf(SessionHandle sessionHandle) throws HiveSQLException { + return sessionManager.getSession(sessionHandle).getHiveConf(); + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#cancelOperation(org.apache.hive.service.cli.OperationHandle) + */ + @Override + public void cancelOperation(OperationHandle opHandle) + throws HiveSQLException { + sessionManager.getOperationManager().getOperation(opHandle) + .getParentSession().cancelOperation(opHandle); + LOG.debug(opHandle + ": cancelOperation()"); + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#closeOperation(org.apache.hive.service.cli.OperationHandle) + */ + @Override + public void closeOperation(OperationHandle opHandle) + throws HiveSQLException { + sessionManager.getOperationManager().getOperation(opHandle) + .getParentSession().closeOperation(opHandle); + LOG.debug(opHandle + ": closeOperation"); + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getResultSetMetadata(org.apache.hive.service.cli.OperationHandle) + */ + @Override + public TableSchema getResultSetMetadata(OperationHandle opHandle) + throws HiveSQLException { + TableSchema tableSchema = sessionManager.getOperationManager() + .getOperation(opHandle).getParentSession().getResultSetMetadata(opHandle); + LOG.debug(opHandle + ": getResultSetMetadata()"); + return tableSchema; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#fetchResults(org.apache.hive.service.cli.OperationHandle) + */ + @Override + public RowSet fetchResults(OperationHandle opHandle) + throws HiveSQLException { + return fetchResults(opHandle, Operation.DEFAULT_FETCH_ORIENTATION, + Operation.DEFAULT_FETCH_MAX_ROWS, FetchType.QUERY_OUTPUT); + } + + @Override + public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, + long maxRows, FetchType fetchType) throws HiveSQLException { + RowSet rowSet = sessionManager.getOperationManager().getOperation(opHandle) + .getParentSession().fetchResults(opHandle, orientation, maxRows, fetchType); + LOG.debug(opHandle + ": fetchResults()"); + return rowSet; + } + + // obtain delegation token for the give user from metastore + public synchronized String getDelegationTokenFromMetaStore(String owner) + throws HiveSQLException, UnsupportedOperationException, LoginException, IOException { + if (!hiveConf.getBoolVar(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL) || + !hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS)) { + throw new UnsupportedOperationException( + "delegation token is can only be obtained for a secure remote metastore"); + } + + try { + Hive.closeCurrent(); + return Hive.get(hiveConf).getDelegationToken(owner, owner); + } catch (HiveException e) { + if (e.getCause() instanceof UnsupportedOperationException) { + throw (UnsupportedOperationException)e.getCause(); + } else { + throw new HiveSQLException("Error connect metastore to setup impersonation", e); + } + } + } + + @Override + public String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String owner, String renewer) throws HiveSQLException { + String delegationToken = sessionManager.getSession(sessionHandle) + .getDelegationToken(authFactory, owner, renewer); + LOG.info(sessionHandle + ": getDelegationToken()"); + return delegationToken; + } + + @Override + public void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String tokenStr) throws HiveSQLException { + sessionManager.getSession(sessionHandle).cancelDelegationToken(authFactory, tokenStr); + LOG.info(sessionHandle + ": cancelDelegationToken()"); + } + + @Override + public void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String tokenStr) throws HiveSQLException { + sessionManager.getSession(sessionHandle).renewDelegationToken(authFactory, tokenStr); + LOG.info(sessionHandle + ": renewDelegationToken()"); + } + + @Override + public String getQueryId(TOperationHandle opHandle) throws HiveSQLException { + Operation operation = sessionManager.getOperationManager().getOperation( + new OperationHandle(opHandle)); + final String queryId = operation.getParentSession().getHiveConf().getVar(ConfVars.HIVEQUERYID); + LOG.debug(opHandle + ": getQueryId() " + queryId); + return queryId; + } + + public SessionManager getSessionManager() { + return sessionManager; + } +} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java new file mode 100644 index 0000000000000..b2ef1c7722ef8 --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java @@ -0,0 +1,92 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli; + +import org.apache.hadoop.hive.serde2.thrift.Type; +import org.apache.hive.service.rpc.thrift.TColumnDesc; + + +/** + * ColumnDescriptor. + * + */ +public class ColumnDescriptor { + private final String name; + private final String comment; + private final TypeDescriptor type; + // ordinal position of this column in the schema + private final int position; + + public ColumnDescriptor(String name, String comment, TypeDescriptor type, int position) { + this.name = name; + this.comment = comment; + this.type = type; + this.position = position; + } + + public ColumnDescriptor(TColumnDesc tColumnDesc) { + name = tColumnDesc.getColumnName(); + comment = tColumnDesc.getComment(); + type = new TypeDescriptor(tColumnDesc.getTypeDesc()); + position = tColumnDesc.getPosition(); + } + + public static ColumnDescriptor newPrimitiveColumnDescriptor(String name, String comment, Type type, int position) { + // Current usage looks like it's only for metadata columns, but if that changes then + // this method may need to require a type qualifiers arguments. + return new ColumnDescriptor(name, comment, new TypeDescriptor(type), position); + } + + public String getName() { + return name; + } + + public String getComment() { + return comment; + } + + public TypeDescriptor getTypeDescriptor() { + return type; + } + + public int getOrdinalPosition() { + return position; + } + + public TColumnDesc toTColumnDesc() { + TColumnDesc tColumnDesc = new TColumnDesc(); + tColumnDesc.setColumnName(name); + tColumnDesc.setComment(comment); + tColumnDesc.setTypeDesc(type.toTTypeDesc()); + tColumnDesc.setPosition(position); + return tColumnDesc; + } + + public Type getType() { + return type.getType(); + } + + public boolean isPrimitive() { + return type.getType().isPrimitiveType(); + } + + public String getTypeName() { + return type.getTypeName(); + } +} diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/ColumnValue.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/ColumnValue.java new file mode 100644 index 0000000000000..44d9e8a296452 --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/ColumnValue.java @@ -0,0 +1,289 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli; + +import java.math.BigDecimal; +import java.sql.Date; +import java.sql.Timestamp; + +import org.apache.hadoop.hive.common.type.HiveChar; +import org.apache.hadoop.hive.common.type.HiveIntervalDayTime; +import org.apache.hadoop.hive.common.type.HiveIntervalYearMonth; +import org.apache.hadoop.hive.common.type.HiveVarchar; +import org.apache.hadoop.hive.serde2.thrift.Type; +import org.apache.hive.service.rpc.thrift.TBoolValue; +import org.apache.hive.service.rpc.thrift.TByteValue; +import org.apache.hive.service.rpc.thrift.TColumnValue; +import org.apache.hive.service.rpc.thrift.TDoubleValue; +import org.apache.hive.service.rpc.thrift.TI16Value; +import org.apache.hive.service.rpc.thrift.TI32Value; +import org.apache.hive.service.rpc.thrift.TI64Value; +import org.apache.hive.service.rpc.thrift.TStringValue; + +import org.apache.spark.unsafe.types.UTF8String; + +/** + * Protocols before HIVE_CLI_SERVICE_PROTOCOL_V6 (used by RowBasedSet) + * + */ +public class ColumnValue { + + private static TColumnValue booleanValue(Boolean value) { + TBoolValue tBoolValue = new TBoolValue(); + if (value != null) { + tBoolValue.setValue(value); + } + return TColumnValue.boolVal(tBoolValue); + } + + private static TColumnValue byteValue(Byte value) { + TByteValue tByteValue = new TByteValue(); + if (value != null) { + tByteValue.setValue(value); + } + return TColumnValue.byteVal(tByteValue); + } + + private static TColumnValue shortValue(Short value) { + TI16Value tI16Value = new TI16Value(); + if (value != null) { + tI16Value.setValue(value); + } + return TColumnValue.i16Val(tI16Value); + } + + private static TColumnValue intValue(Integer value) { + TI32Value tI32Value = new TI32Value(); + if (value != null) { + tI32Value.setValue(value); + } + return TColumnValue.i32Val(tI32Value); + } + + private static TColumnValue longValue(Long value) { + TI64Value tI64Value = new TI64Value(); + if (value != null) { + tI64Value.setValue(value); + } + return TColumnValue.i64Val(tI64Value); + } + + private static TColumnValue floatValue(Float value) { + TDoubleValue tDoubleValue = new TDoubleValue(); + if (value != null) { + tDoubleValue.setValue(value); + } + return TColumnValue.doubleVal(tDoubleValue); + } + + private static TColumnValue doubleValue(Double value) { + TDoubleValue tDoubleValue = new TDoubleValue(); + if (value != null) { + tDoubleValue.setValue(value); + } + return TColumnValue.doubleVal(tDoubleValue); + } + + private static TColumnValue stringValue(String value) { + TStringValue tStringValue = new TStringValue(); + if (value != null) { + tStringValue.setValue(value); + } + return TColumnValue.stringVal(tStringValue); + } + + private static TColumnValue stringValue(HiveChar value) { + TStringValue tStringValue = new TStringValue(); + if (value != null) { + tStringValue.setValue(value.toString()); + } + return TColumnValue.stringVal(tStringValue); + } + + private static TColumnValue stringValue(HiveVarchar value) { + TStringValue tStringValue = new TStringValue(); + if (value != null) { + tStringValue.setValue(value.toString()); + } + return TColumnValue.stringVal(tStringValue); + } + + private static TColumnValue stringValue(HiveIntervalYearMonth value) { + TStringValue tStrValue = new TStringValue(); + if (value != null) { + tStrValue.setValue(value.toString()); + } + return TColumnValue.stringVal(tStrValue); + } + + private static TColumnValue stringValue(HiveIntervalDayTime value) { + TStringValue tStrValue = new TStringValue(); + if (value != null) { + tStrValue.setValue(value.toString()); + } + return TColumnValue.stringVal(tStrValue); + } + + public static TColumnValue toTColumnValue(TypeDescriptor typeDescriptor, Object value) { + Type type = typeDescriptor.getType(); + + switch (type) { + case BOOLEAN_TYPE: + return booleanValue((Boolean)value); + case TINYINT_TYPE: + return byteValue((Byte)value); + case SMALLINT_TYPE: + return shortValue((Short)value); + case INT_TYPE: + return intValue((Integer)value); + case BIGINT_TYPE: + return longValue((Long)value); + case FLOAT_TYPE: + return floatValue((Float)value); + case DOUBLE_TYPE: + return doubleValue((Double)value); + case STRING_TYPE: + return stringValue((String)value); + case CHAR_TYPE: + return stringValue((HiveChar)value); + case VARCHAR_TYPE: + return stringValue((HiveVarchar)value); + case DATE_TYPE: + case TIMESTAMP_TYPE: + // SPARK-31859, SPARK-31861: converted to string already in SparkExecuteStatementOperation + return stringValue((String)value); + case DECIMAL_TYPE: + String plainStr = value == null ? null : ((BigDecimal)value).toPlainString(); + return stringValue(plainStr); + case BINARY_TYPE: + String strVal = value == null ? null : UTF8String.fromBytes((byte[])value).toString(); + return stringValue(strVal); + case ARRAY_TYPE: + case MAP_TYPE: + case STRUCT_TYPE: + case UNION_TYPE: + case USER_DEFINED_TYPE: + case INTERVAL_YEAR_MONTH_TYPE: + case INTERVAL_DAY_TIME_TYPE: + return stringValue((String)value); + case NULL_TYPE: + return stringValue((String)value); + default: + return null; + } + } + + private static Boolean getBooleanValue(TBoolValue tBoolValue) { + if (tBoolValue.isSetValue()) { + return tBoolValue.isValue(); + } + return null; + } + + private static Byte getByteValue(TByteValue tByteValue) { + if (tByteValue.isSetValue()) { + return tByteValue.getValue(); + } + return null; + } + + private static Short getShortValue(TI16Value tI16Value) { + if (tI16Value.isSetValue()) { + return tI16Value.getValue(); + } + return null; + } + + private static Integer getIntegerValue(TI32Value tI32Value) { + if (tI32Value.isSetValue()) { + return tI32Value.getValue(); + } + return null; + } + + private static Long getLongValue(TI64Value tI64Value) { + if (tI64Value.isSetValue()) { + return tI64Value.getValue(); + } + return null; + } + + private static Double getDoubleValue(TDoubleValue tDoubleValue) { + if (tDoubleValue.isSetValue()) { + return tDoubleValue.getValue(); + } + return null; + } + + private static String getStringValue(TStringValue tStringValue) { + if (tStringValue.isSetValue()) { + return tStringValue.getValue(); + } + return null; + } + + private static Date getDateValue(TStringValue tStringValue) { + if (tStringValue.isSetValue()) { + return Date.valueOf(tStringValue.getValue()); + } + return null; + } + + private static Timestamp getTimestampValue(TStringValue tStringValue) { + if (tStringValue.isSetValue()) { + return Timestamp.valueOf(tStringValue.getValue()); + } + return null; + } + + private static byte[] getBinaryValue(TStringValue tString) { + if (tString.isSetValue()) { + return tString.getValue().getBytes(); + } + return null; + } + + private static BigDecimal getBigDecimalValue(TStringValue tStringValue) { + if (tStringValue.isSetValue()) { + return new BigDecimal(tStringValue.getValue()); + } + return null; + } + + public static Object toColumnValue(TColumnValue value) { + TColumnValue._Fields field = value.getSetField(); + switch (field) { + case BOOL_VAL: + return getBooleanValue(value.getBoolVal()); + case BYTE_VAL: + return getByteValue(value.getByteVal()); + case I16_VAL: + return getShortValue(value.getI16Val()); + case I32_VAL: + return getIntegerValue(value.getI32Val()); + case I64_VAL: + return getLongValue(value.getI64Val()); + case DOUBLE_VAL: + return getDoubleValue(value.getDoubleVal()); + case STRING_VAL: + return getStringValue(value.getStringVal()); + } + throw new IllegalArgumentException("never"); + } +} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/FetchOrientation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/FetchOrientation.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/FetchOrientation.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/FetchOrientation.java diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/GetInfoType.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/GetInfoType.java new file mode 100644 index 0000000000000..575dff8f8f47b --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/GetInfoType.java @@ -0,0 +1,97 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli; + +import org.apache.hive.service.rpc.thrift.TGetInfoType; + +/** + * GetInfoType. + * + */ +public enum GetInfoType { + CLI_MAX_DRIVER_CONNECTIONS(TGetInfoType.CLI_MAX_DRIVER_CONNECTIONS), + CLI_MAX_CONCURRENT_ACTIVITIES(TGetInfoType.CLI_MAX_CONCURRENT_ACTIVITIES), + CLI_DATA_SOURCE_NAME(TGetInfoType.CLI_DATA_SOURCE_NAME), + CLI_FETCH_DIRECTION(TGetInfoType.CLI_FETCH_DIRECTION), + CLI_SERVER_NAME(TGetInfoType.CLI_SERVER_NAME), + CLI_SEARCH_PATTERN_ESCAPE(TGetInfoType.CLI_SEARCH_PATTERN_ESCAPE), + CLI_DBMS_NAME(TGetInfoType.CLI_DBMS_NAME), + CLI_DBMS_VER(TGetInfoType.CLI_DBMS_VER), + CLI_ACCESSIBLE_TABLES(TGetInfoType.CLI_ACCESSIBLE_TABLES), + CLI_ACCESSIBLE_PROCEDURES(TGetInfoType.CLI_ACCESSIBLE_PROCEDURES), + CLI_CURSOR_COMMIT_BEHAVIOR(TGetInfoType.CLI_CURSOR_COMMIT_BEHAVIOR), + CLI_DATA_SOURCE_READ_ONLY(TGetInfoType.CLI_DATA_SOURCE_READ_ONLY), + CLI_DEFAULT_TXN_ISOLATION(TGetInfoType.CLI_DEFAULT_TXN_ISOLATION), + CLI_IDENTIFIER_CASE(TGetInfoType.CLI_IDENTIFIER_CASE), + CLI_IDENTIFIER_QUOTE_CHAR(TGetInfoType.CLI_IDENTIFIER_QUOTE_CHAR), + CLI_MAX_COLUMN_NAME_LEN(TGetInfoType.CLI_MAX_COLUMN_NAME_LEN), + CLI_MAX_CURSOR_NAME_LEN(TGetInfoType.CLI_MAX_CURSOR_NAME_LEN), + CLI_MAX_SCHEMA_NAME_LEN(TGetInfoType.CLI_MAX_SCHEMA_NAME_LEN), + CLI_MAX_CATALOG_NAME_LEN(TGetInfoType.CLI_MAX_CATALOG_NAME_LEN), + CLI_MAX_TABLE_NAME_LEN(TGetInfoType.CLI_MAX_TABLE_NAME_LEN), + CLI_SCROLL_CONCURRENCY(TGetInfoType.CLI_SCROLL_CONCURRENCY), + CLI_TXN_CAPABLE(TGetInfoType.CLI_TXN_CAPABLE), + CLI_USER_NAME(TGetInfoType.CLI_USER_NAME), + CLI_TXN_ISOLATION_OPTION(TGetInfoType.CLI_TXN_ISOLATION_OPTION), + CLI_INTEGRITY(TGetInfoType.CLI_INTEGRITY), + CLI_GETDATA_EXTENSIONS(TGetInfoType.CLI_GETDATA_EXTENSIONS), + CLI_NULL_COLLATION(TGetInfoType.CLI_NULL_COLLATION), + CLI_ALTER_TABLE(TGetInfoType.CLI_ALTER_TABLE), + CLI_ORDER_BY_COLUMNS_IN_SELECT(TGetInfoType.CLI_ORDER_BY_COLUMNS_IN_SELECT), + CLI_SPECIAL_CHARACTERS(TGetInfoType.CLI_SPECIAL_CHARACTERS), + CLI_MAX_COLUMNS_IN_GROUP_BY(TGetInfoType.CLI_MAX_COLUMNS_IN_GROUP_BY), + CLI_MAX_COLUMNS_IN_INDEX(TGetInfoType.CLI_MAX_COLUMNS_IN_INDEX), + CLI_MAX_COLUMNS_IN_ORDER_BY(TGetInfoType.CLI_MAX_COLUMNS_IN_ORDER_BY), + CLI_MAX_COLUMNS_IN_SELECT(TGetInfoType.CLI_MAX_COLUMNS_IN_SELECT), + CLI_MAX_COLUMNS_IN_TABLE(TGetInfoType.CLI_MAX_COLUMNS_IN_TABLE), + CLI_MAX_INDEX_SIZE(TGetInfoType.CLI_MAX_INDEX_SIZE), + CLI_MAX_ROW_SIZE(TGetInfoType.CLI_MAX_ROW_SIZE), + CLI_MAX_STATEMENT_LEN(TGetInfoType.CLI_MAX_STATEMENT_LEN), + CLI_MAX_TABLES_IN_SELECT(TGetInfoType.CLI_MAX_TABLES_IN_SELECT), + CLI_MAX_USER_NAME_LEN(TGetInfoType.CLI_MAX_USER_NAME_LEN), + CLI_OJ_CAPABILITIES(TGetInfoType.CLI_OJ_CAPABILITIES), + + CLI_XOPEN_CLI_YEAR(TGetInfoType.CLI_XOPEN_CLI_YEAR), + CLI_CURSOR_SENSITIVITY(TGetInfoType.CLI_CURSOR_SENSITIVITY), + CLI_DESCRIBE_PARAMETER(TGetInfoType.CLI_DESCRIBE_PARAMETER), + CLI_CATALOG_NAME(TGetInfoType.CLI_CATALOG_NAME), + CLI_COLLATION_SEQ(TGetInfoType.CLI_COLLATION_SEQ), + CLI_MAX_IDENTIFIER_LEN(TGetInfoType.CLI_MAX_IDENTIFIER_LEN), + CLI_ODBC_KEYWORDS(TGetInfoType.CLI_ODBC_KEYWORDS); + + private final TGetInfoType tInfoType; + + GetInfoType(TGetInfoType tInfoType) { + this.tInfoType = tInfoType; + } + + public static GetInfoType getGetInfoType(TGetInfoType tGetInfoType) { + for (GetInfoType infoType : values()) { + if (tGetInfoType.equals(infoType.tInfoType)) { + return infoType; + } + } + throw new IllegalArgumentException("Unrecognized Thrift TGetInfoType value: " + tGetInfoType); + } + + public TGetInfoType toTGetInfoType() { + return tInfoType; + } + +} diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/GetInfoValue.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/GetInfoValue.java new file mode 100644 index 0000000000000..bf3c6b27ea81d --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/GetInfoValue.java @@ -0,0 +1,82 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli; + +import org.apache.hive.service.rpc.thrift.TGetInfoValue; + +/** + * GetInfoValue. + * + */ +public class GetInfoValue { + private String stringValue = null; + private short shortValue; + private int intValue; + private long longValue; + + public GetInfoValue(String stringValue) { + this.stringValue = stringValue; + } + + public GetInfoValue(short shortValue) { + this.shortValue = shortValue; + } + + public GetInfoValue(int intValue) { + this.intValue = intValue; + } + + public GetInfoValue(long longValue) { + this.longValue = longValue; + } + + public GetInfoValue(TGetInfoValue tGetInfoValue) { + switch (tGetInfoValue.getSetField()) { + case STRING_VALUE: + stringValue = tGetInfoValue.getStringValue(); + break; + default: + throw new IllegalArgumentException("Unrecognized TGetInfoValue"); + } + } + + public TGetInfoValue toTGetInfoValue() { + TGetInfoValue tInfoValue = new TGetInfoValue(); + if (stringValue != null) { + tInfoValue.setStringValue(stringValue); + } + return tInfoValue; + } + + public String getStringValue() { + return stringValue; + } + + public short getShortValue() { + return shortValue; + } + + public int getIntValue() { + return intValue; + } + + public long getLongValue() { + return longValue; + } +} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/Handle.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/Handle.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/Handle.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/Handle.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/HiveSQLException.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/HiveSQLException.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/HiveSQLException.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/HiveSQLException.java diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/ICLIService.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/ICLIService.java new file mode 100644 index 0000000000000..a87c6691ebac7 --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/ICLIService.java @@ -0,0 +1,116 @@ +/** + * 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. + */ +package org.apache.hive.service.cli; + +import java.util.List; +import java.util.Map; + + + + +import org.apache.hive.service.auth.HiveAuthFactory; +import org.apache.hive.service.rpc.thrift.TOperationHandle; + +public interface ICLIService { + + SessionHandle openSession(String username, String password, + Map configuration) + throws HiveSQLException; + + SessionHandle openSessionWithImpersonation(String username, String password, + Map configuration, String delegationToken) + throws HiveSQLException; + + void closeSession(SessionHandle sessionHandle) + throws HiveSQLException; + + GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) + throws HiveSQLException; + + OperationHandle executeStatement(SessionHandle sessionHandle, String statement, + Map confOverlay) throws HiveSQLException; + + OperationHandle executeStatement(SessionHandle sessionHandle, String statement, + Map confOverlay, long queryTimeout) throws HiveSQLException; + + OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, + Map confOverlay) throws HiveSQLException; + OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, + Map confOverlay, long queryTimeout) throws HiveSQLException; + + OperationHandle getTypeInfo(SessionHandle sessionHandle) + throws HiveSQLException; + + OperationHandle getCatalogs(SessionHandle sessionHandle) + throws HiveSQLException; + + OperationHandle getSchemas(SessionHandle sessionHandle, + String catalogName, String schemaName) + throws HiveSQLException; + + OperationHandle getTables(SessionHandle sessionHandle, + String catalogName, String schemaName, String tableName, List tableTypes) + throws HiveSQLException; + + OperationHandle getTableTypes(SessionHandle sessionHandle) + throws HiveSQLException; + + OperationHandle getColumns(SessionHandle sessionHandle, + String catalogName, String schemaName, String tableName, String columnName) + throws HiveSQLException; + + OperationHandle getFunctions(SessionHandle sessionHandle, + String catalogName, String schemaName, String functionName) + throws HiveSQLException; + + OperationStatus getOperationStatus(OperationHandle opHandle) + throws HiveSQLException; + + void cancelOperation(OperationHandle opHandle) + throws HiveSQLException; + + void closeOperation(OperationHandle opHandle) + throws HiveSQLException; + + TableSchema getResultSetMetadata(OperationHandle opHandle) + throws HiveSQLException; + + RowSet fetchResults(OperationHandle opHandle) + throws HiveSQLException; + + RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, + long maxRows, FetchType fetchType) throws HiveSQLException; + + String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String owner, String renewer) throws HiveSQLException; + + String getQueryId(TOperationHandle operationHandle) throws HiveSQLException; + + void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String tokenStr) throws HiveSQLException; + + void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String tokenStr) throws HiveSQLException; + + OperationHandle getPrimaryKeys(SessionHandle sessionHandle, String catalog, + String schema, String table) throws HiveSQLException; + + OperationHandle getCrossReference(SessionHandle sessionHandle, + String primaryCatalog, String primarySchema, String primaryTable, + String foreignCatalog, String foreignSchema, String foreignTable) throws HiveSQLException; +} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/OperationHandle.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/OperationHandle.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/OperationHandle.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/OperationHandle.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/OperationState.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/OperationState.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/OperationState.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/OperationState.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/OperationType.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/OperationType.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/OperationType.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/OperationType.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/RowBasedSet.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/RowBasedSet.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/RowBasedSet.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/RowBasedSet.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/RowSet.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/RowSet.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/RowSet.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/RowSet.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/RowSetFactory.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/RowSetFactory.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/RowSetFactory.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/RowSetFactory.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/SessionHandle.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/SessionHandle.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/SessionHandle.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/SessionHandle.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/TableSchema.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/TableSchema.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/TableSchema.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/TableSchema.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/ClassicTableTypeMapping.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/ClassicTableTypeMapping.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/ClassicTableTypeMapping.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/ClassicTableTypeMapping.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java new file mode 100644 index 0000000000000..59630672847e4 --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java @@ -0,0 +1,251 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli.operation; + +import java.sql.DatabaseMetaData; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.regex.Pattern; + +import org.apache.hadoop.hive.conf.HiveConf.ConfVars; +import org.apache.hadoop.hive.metastore.IMetaStoreClient; +import org.apache.hadoop.hive.metastore.api.PrimaryKeysRequest; +import org.apache.hadoop.hive.metastore.api.SQLPrimaryKey; +import org.apache.hadoop.hive.metastore.api.Table; +import org.apache.hadoop.hive.ql.metadata.TableIterable; +import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType; +import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject; +import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject.HivePrivilegeObjectType; +import org.apache.hadoop.hive.ql.session.SessionState; +import org.apache.hadoop.hive.serde2.thrift.Type; +import org.apache.hive.service.cli.ColumnDescriptor; +import org.apache.hive.service.cli.FetchOrientation; +import org.apache.hive.service.cli.HiveSQLException; +import org.apache.hive.service.cli.OperationState; +import org.apache.hive.service.cli.OperationType; +import org.apache.hive.service.cli.RowSet; +import org.apache.hive.service.cli.RowSetFactory; +import org.apache.hive.service.cli.TableSchema; +import org.apache.hive.service.cli.session.HiveSession; + +/** + * GetColumnsOperation. + * + */ +public class GetColumnsOperation extends MetadataOperation { + + protected static final TableSchema RESULT_SET_SCHEMA = new TableSchema() + .addPrimitiveColumn("TABLE_CAT", Type.STRING_TYPE, + "Catalog name. NULL if not applicable") + .addPrimitiveColumn("TABLE_SCHEM", Type.STRING_TYPE, + "Schema name") + .addPrimitiveColumn("TABLE_NAME", Type.STRING_TYPE, + "Table name") + .addPrimitiveColumn("COLUMN_NAME", Type.STRING_TYPE, + "Column name") + .addPrimitiveColumn("DATA_TYPE", Type.INT_TYPE, + "SQL type from java.sql.Types") + .addPrimitiveColumn("TYPE_NAME", Type.STRING_TYPE, + "Data source dependent type name, for a UDT the type name is fully qualified") + .addPrimitiveColumn("COLUMN_SIZE", Type.INT_TYPE, + "Column size. For char or date types this is the maximum number of characters," + + " for numeric or decimal types this is precision.") + .addPrimitiveColumn("BUFFER_LENGTH", Type.TINYINT_TYPE, + "Unused") + .addPrimitiveColumn("DECIMAL_DIGITS", Type.INT_TYPE, + "The number of fractional digits") + .addPrimitiveColumn("NUM_PREC_RADIX", Type.INT_TYPE, + "Radix (typically either 10 or 2)") + .addPrimitiveColumn("NULLABLE", Type.INT_TYPE, + "Is NULL allowed") + .addPrimitiveColumn("REMARKS", Type.STRING_TYPE, + "Comment describing column (may be null)") + .addPrimitiveColumn("COLUMN_DEF", Type.STRING_TYPE, + "Default value (may be null)") + .addPrimitiveColumn("SQL_DATA_TYPE", Type.INT_TYPE, + "Unused") + .addPrimitiveColumn("SQL_DATETIME_SUB", Type.INT_TYPE, + "Unused") + .addPrimitiveColumn("CHAR_OCTET_LENGTH", Type.INT_TYPE, + "For char types the maximum number of bytes in the column") + .addPrimitiveColumn("ORDINAL_POSITION", Type.INT_TYPE, + "Index of column in table (starting at 1)") + .addPrimitiveColumn("IS_NULLABLE", Type.STRING_TYPE, + "\"NO\" means column definitely does not allow NULL values; " + + "\"YES\" means the column might allow NULL values. An empty " + + "string means nobody knows.") + .addPrimitiveColumn("SCOPE_CATALOG", Type.STRING_TYPE, + "Catalog of table that is the scope of a reference attribute " + + "(null if DATA_TYPE isn't REF)") + .addPrimitiveColumn("SCOPE_SCHEMA", Type.STRING_TYPE, + "Schema of table that is the scope of a reference attribute " + + "(null if the DATA_TYPE isn't REF)") + .addPrimitiveColumn("SCOPE_TABLE", Type.STRING_TYPE, + "Table name that this the scope of a reference attribute " + + "(null if the DATA_TYPE isn't REF)") + .addPrimitiveColumn("SOURCE_DATA_TYPE", Type.SMALLINT_TYPE, + "Source type of a distinct type or user-generated Ref type, " + + "SQL type from java.sql.Types (null if DATA_TYPE isn't DISTINCT or user-generated REF)") + .addPrimitiveColumn("IS_AUTO_INCREMENT", Type.STRING_TYPE, + "Indicates whether this column is auto incremented."); + + private final String catalogName; + private final String schemaName; + private final String tableName; + private final String columnName; + + protected final RowSet rowSet; + + protected GetColumnsOperation(HiveSession parentSession, String catalogName, String schemaName, + String tableName, String columnName) { + super(parentSession, OperationType.GET_COLUMNS); + this.catalogName = catalogName; + this.schemaName = schemaName; + this.tableName = tableName; + this.columnName = columnName; + this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); + } + + @Override + public void runInternal() throws HiveSQLException { + setState(OperationState.RUNNING); + try { + IMetaStoreClient metastoreClient = getParentSession().getMetaStoreClient(); + String schemaPattern = convertSchemaPattern(schemaName); + String tablePattern = convertIdentifierPattern(tableName, true); + + Pattern columnPattern = null; + if (columnName != null) { + columnPattern = Pattern.compile(convertIdentifierPattern(columnName, false)); + } + + List dbNames = metastoreClient.getDatabases(schemaPattern); + Collections.sort(dbNames); + Map> db2Tabs = new HashMap<>(); + + for (String dbName : dbNames) { + List tableNames = metastoreClient.getTables(dbName, tablePattern); + Collections.sort(tableNames); + db2Tabs.put(dbName, tableNames); + } + + if (isAuthV2Enabled()) { + List privObjs = getPrivObjs(db2Tabs); + String cmdStr = "catalog : " + catalogName + ", schemaPattern : " + schemaName + + ", tablePattern : " + tableName; + authorizeMetaGets(HiveOperationType.GET_COLUMNS, privObjs, cmdStr); + } + + int maxBatchSize = SessionState.get().getConf().getIntVar(ConfVars.METASTORE_BATCH_RETRIEVE_MAX); + for (Entry> dbTabs : db2Tabs.entrySet()) { + String dbName = dbTabs.getKey(); + List tableNames = dbTabs.getValue(); + + for (Table table : new TableIterable(metastoreClient, dbName, tableNames, maxBatchSize)) { + + TableSchema schema = new TableSchema(metastoreClient.getSchema(dbName, + table.getTableName())); + List primaryKeys = metastoreClient.getPrimaryKeys(new PrimaryKeysRequest(dbName, table.getTableName())); + Set pkColNames = new HashSet<>(); + for(SQLPrimaryKey key : primaryKeys) { + pkColNames.add(key.getColumn_name().toLowerCase()); + } + for (ColumnDescriptor column : schema.getColumnDescriptors()) { + if (columnPattern != null && !columnPattern.matcher(column.getName()).matches()) { + continue; + } + Object[] rowData = new Object[] { + null, // TABLE_CAT + table.getDbName(), // TABLE_SCHEM + table.getTableName(), // TABLE_NAME + column.getName(), // COLUMN_NAME + column.getType().toJavaSQLType(), // DATA_TYPE + column.getTypeName(), // TYPE_NAME + column.getTypeDescriptor().getColumnSize(), // COLUMN_SIZE + null, // BUFFER_LENGTH, unused + column.getTypeDescriptor().getDecimalDigits(), // DECIMAL_DIGITS + column.getType().getNumPrecRadix(), // NUM_PREC_RADIX + pkColNames.contains(column.getName().toLowerCase()) ? DatabaseMetaData.columnNoNulls + : DatabaseMetaData.columnNullable, // NULLABLE + column.getComment(), // REMARKS + null, // COLUMN_DEF + null, // SQL_DATA_TYPE + null, // SQL_DATETIME_SUB + null, // CHAR_OCTET_LENGTH + column.getOrdinalPosition(), // ORDINAL_POSITION + pkColNames.contains(column.getName().toLowerCase()) ? "NO" : "YES", // IS_NULLABLE + null, // SCOPE_CATALOG + null, // SCOPE_SCHEMA + null, // SCOPE_TABLE + null, // SOURCE_DATA_TYPE + "NO", // IS_AUTO_INCREMENT + }; + rowSet.addRow(rowData); + } + } + } + setState(OperationState.FINISHED); + } catch (Exception e) { + setState(OperationState.ERROR); + throw new HiveSQLException(e); + } + + } + + + private List getPrivObjs(Map> db2Tabs) { + List privObjs = new ArrayList<>(); + for (Entry> dbTabs : db2Tabs.entrySet()) { + for (String tabName : dbTabs.getValue()) { + privObjs.add(new HivePrivilegeObject(HivePrivilegeObjectType.TABLE_OR_VIEW, dbTabs.getKey(), + tabName)); + } + } + return privObjs; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.Operation#getResultSetSchema() + */ + @Override + public TableSchema getResultSetSchema() throws HiveSQLException { + assertState(OperationState.FINISHED); + return RESULT_SET_SCHEMA; + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.Operation#getNextRowSet(org.apache.hive.service.cli.FetchOrientation, long) + */ + @Override + public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { + assertState(OperationState.FINISHED); + validateDefaultFetchOrientation(orientation); + if (orientation.equals(FetchOrientation.FETCH_FIRST)) { + rowSet.setStartOffset(0); + } + return rowSet.extractSubset((int)maxRows); + } + +} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetCrossReferenceOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetCrossReferenceOperation.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetCrossReferenceOperation.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetCrossReferenceOperation.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetPrimaryKeysOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetPrimaryKeysOperation.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetPrimaryKeysOperation.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetPrimaryKeysOperation.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/HiveTableTypeMapping.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/HiveTableTypeMapping.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/HiveTableTypeMapping.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/HiveTableTypeMapping.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/Operation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/Operation.java new file mode 100644 index 0000000000000..558c68f85c16b --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/Operation.java @@ -0,0 +1,350 @@ +/** + * 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. + */ +package org.apache.hive.service.cli.operation; + +import java.io.File; +import java.io.FileNotFoundException; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.ql.QueryState; +import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; +import org.apache.hadoop.hive.ql.session.OperationLog; +import org.apache.hive.service.cli.FetchOrientation; +import org.apache.hive.service.cli.HiveSQLException; +import org.apache.hive.service.cli.OperationHandle; +import org.apache.hive.service.cli.OperationState; +import org.apache.hive.service.cli.OperationStatus; +import org.apache.hive.service.cli.OperationType; +import org.apache.hive.service.cli.RowSet; +import org.apache.hive.service.cli.TableSchema; +import org.apache.hive.service.cli.session.HiveSession; +import org.apache.hive.service.rpc.thrift.TProtocolVersion; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public abstract class Operation { + protected final HiveSession parentSession; + private OperationState state = OperationState.INITIALIZED; + private final OperationHandle opHandle; + private HiveConf configuration; + public static final Logger LOG = LoggerFactory.getLogger(Operation.class.getName()); + public static final FetchOrientation DEFAULT_FETCH_ORIENTATION = FetchOrientation.FETCH_NEXT; + public static final long DEFAULT_FETCH_MAX_ROWS = 100; + protected boolean hasResultSet; + protected volatile HiveSQLException operationException; + protected final boolean runAsync; + protected volatile Future backgroundHandle; + protected OperationLog operationLog; + protected boolean isOperationLogEnabled; + protected Map confOverlay = new HashMap(); + + private long operationTimeout; + private long lastAccessTime; + + protected final QueryState queryState; + + protected static final EnumSet DEFAULT_FETCH_ORIENTATION_SET = + EnumSet.of( + FetchOrientation.FETCH_NEXT, + FetchOrientation.FETCH_FIRST, + FetchOrientation.FETCH_PRIOR); + + protected Operation(HiveSession parentSession, OperationType opType) { + this(parentSession, null, opType); + } + + protected Operation(HiveSession parentSession, Map confOverlay, + OperationType opType) { + this(parentSession, confOverlay, opType, false); + } + + protected Operation(HiveSession parentSession, + Map confOverlay, OperationType opType, boolean runInBackground) { + this.parentSession = parentSession; + this.confOverlay = confOverlay; + this.runAsync = runInBackground; + this.opHandle = new OperationHandle(opType, parentSession.getProtocolVersion()); + lastAccessTime = System.currentTimeMillis(); + operationTimeout = HiveConf.getTimeVar(parentSession.getHiveConf(), + HiveConf.ConfVars.HIVE_SERVER2_IDLE_OPERATION_TIMEOUT, TimeUnit.MILLISECONDS); + queryState = new QueryState(parentSession.getHiveConf(), confOverlay, runInBackground); + } + + public Future getBackgroundHandle() { + return backgroundHandle; + } + + protected void setBackgroundHandle(Future backgroundHandle) { + this.backgroundHandle = backgroundHandle; + } + + public boolean shouldRunAsync() { + return runAsync; + } + + public void setConfiguration(HiveConf configuration) { + this.configuration = new HiveConf(configuration); + } + + public HiveConf getConfiguration() { + return new HiveConf(configuration); + } + + public HiveSession getParentSession() { + return parentSession; + } + + public OperationHandle getHandle() { + return opHandle; + } + + public TProtocolVersion getProtocolVersion() { + return opHandle.getProtocolVersion(); + } + + public OperationType getType() { + return opHandle.getOperationType(); + } + + public OperationStatus getStatus() { + return new OperationStatus(state, operationException); + } + + public boolean hasResultSet() { + return hasResultSet; + } + + protected void setHasResultSet(boolean hasResultSet) { + this.hasResultSet = hasResultSet; + opHandle.setHasResultSet(hasResultSet); + } + + public OperationLog getOperationLog() { + return operationLog; + } + + protected final OperationState setState(OperationState newState) throws HiveSQLException { + state.validateTransition(newState); + this.state = newState; + this.lastAccessTime = System.currentTimeMillis(); + return this.state; + } + + public boolean isTimedOut(long current) { + if (operationTimeout == 0) { + return false; + } + if (operationTimeout > 0) { + // check only when it's in terminal state + return state.isTerminal() && lastAccessTime + operationTimeout <= current; + } + return lastAccessTime + -operationTimeout <= current; + } + + public long getLastAccessTime() { + return lastAccessTime; + } + + public long getOperationTimeout() { + return operationTimeout; + } + + public void setOperationTimeout(long operationTimeout) { + this.operationTimeout = operationTimeout; + } + + protected void setOperationException(HiveSQLException operationException) { + this.operationException = operationException; + } + + protected final void assertState(OperationState state) throws HiveSQLException { + if (this.state != state) { + throw new HiveSQLException("Expected state " + state + ", but found " + this.state); + } + this.lastAccessTime = System.currentTimeMillis(); + } + + public boolean isRunning() { + return OperationState.RUNNING.equals(state); + } + + public boolean isFinished() { + return OperationState.FINISHED.equals(state); + } + + public boolean isCanceled() { + return OperationState.CANCELED.equals(state); + } + + public boolean isFailed() { + return OperationState.ERROR.equals(state); + } + + protected void createOperationLog() { + if (parentSession.isOperationLogEnabled()) { + File operationLogFile = new File(parentSession.getOperationLogSessionDir(), + opHandle.getHandleIdentifier().toString()); + isOperationLogEnabled = true; + + // create log file + try { + if (operationLogFile.exists()) { + LOG.warn("The operation log file should not exist, but it is already there: " + + operationLogFile.getAbsolutePath()); + operationLogFile.delete(); + } + if (!operationLogFile.createNewFile()) { + // the log file already exists and cannot be deleted. + // If it can be read/written, keep its contents and use it. + if (!operationLogFile.canRead() || !operationLogFile.canWrite()) { + LOG.warn("The already existed operation log file cannot be recreated, " + + "and it cannot be read or written: " + operationLogFile.getAbsolutePath()); + isOperationLogEnabled = false; + return; + } + } + } catch (Exception e) { + LOG.warn("Unable to create operation log file: " + operationLogFile.getAbsolutePath(), e); + isOperationLogEnabled = false; + return; + } + + // create OperationLog object with above log file + try { + operationLog = new OperationLog(opHandle.toString(), operationLogFile, parentSession.getHiveConf()); + } catch (FileNotFoundException e) { + LOG.warn("Unable to instantiate OperationLog object for operation: " + + opHandle, e); + isOperationLogEnabled = false; + return; + } + + // register this operationLog to current thread + OperationLog.setCurrentOperationLog(operationLog); + } + } + + protected void unregisterOperationLog() { + if (isOperationLogEnabled) { + OperationLog.removeCurrentOperationLog(); + } + } + + /** + * Invoked before runInternal(). + * Set up some preconditions, or configurations. + */ + protected void beforeRun() { + createOperationLog(); + } + + /** + * Invoked after runInternal(), even if an exception is thrown in runInternal(). + * Clean up resources, which was set up in beforeRun(). + */ + protected void afterRun() { + unregisterOperationLog(); + } + + /** + * Implemented by subclass of Operation class to execute specific behaviors. + * @throws HiveSQLException + */ + protected abstract void runInternal() throws HiveSQLException; + + public void run() throws HiveSQLException { + beforeRun(); + try { + runInternal(); + } finally { + afterRun(); + } + } + + protected void cleanupOperationLog() { + if (isOperationLogEnabled) { + if (operationLog == null) { + LOG.error("Operation [ " + opHandle.getHandleIdentifier() + " ] " + + "logging is enabled, but its OperationLog object cannot be found."); + } else { + operationLog.close(); + } + } + } + + // TODO: make this abstract and implement in subclasses. + public void cancel() throws HiveSQLException { + setState(OperationState.CANCELED); + throw new UnsupportedOperationException("SQLOperation.cancel()"); + } + + public void close() throws HiveSQLException { + setState(OperationState.CLOSED); + cleanupOperationLog(); + } + + public abstract TableSchema getResultSetSchema() throws HiveSQLException; + + public abstract RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException; + + public RowSet getNextRowSet() throws HiveSQLException { + return getNextRowSet(FetchOrientation.FETCH_NEXT, DEFAULT_FETCH_MAX_ROWS); + } + + /** + * Verify if the given fetch orientation is part of the default orientation types. + * @param orientation + * @throws HiveSQLException + */ + protected void validateDefaultFetchOrientation(FetchOrientation orientation) + throws HiveSQLException { + validateFetchOrientation(orientation, DEFAULT_FETCH_ORIENTATION_SET); + } + + /** + * Verify if the given fetch orientation is part of the supported orientation types. + * @param orientation + * @param supportedOrientations + * @throws HiveSQLException + */ + protected void validateFetchOrientation(FetchOrientation orientation, + EnumSet supportedOrientations) throws HiveSQLException { + if (!supportedOrientations.contains(orientation)) { + throw new HiveSQLException("The fetch type " + orientation.toString() + + " is not supported for this resultset", "HY106"); + } + } + + protected HiveSQLException toSQLException(String prefix, CommandProcessorResponse response) { + HiveSQLException ex = new HiveSQLException(prefix + ": " + response.getErrorMessage(), + response.getSQLState(), response.getResponseCode()); + if (response.getException() != null) { + ex.initCause(response.getException()); + } + return ex; + } + + protected Map getConfOverlay() { + return confOverlay; + } +} diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java new file mode 100644 index 0000000000000..3df842d2b4af9 --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java @@ -0,0 +1,311 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli.operation; + +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.metastore.api.FieldSchema; +import org.apache.hadoop.hive.metastore.api.Schema; +import org.apache.hadoop.hive.ql.session.OperationLog; +import org.apache.hive.service.AbstractService; +import org.apache.hive.service.cli.FetchOrientation; +import org.apache.hive.service.cli.HiveSQLException; +import org.apache.hive.service.cli.OperationHandle; +import org.apache.hive.service.cli.OperationState; +import org.apache.hive.service.cli.OperationStatus; +import org.apache.hive.service.cli.RowSet; +import org.apache.hive.service.cli.RowSetFactory; +import org.apache.hive.service.cli.TableSchema; +import org.apache.hive.service.cli.session.HiveSession; +import org.apache.log4j.Appender; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * OperationManager. + * + */ +public class OperationManager extends AbstractService { + private final Logger LOG = LoggerFactory.getLogger(OperationManager.class.getName()); + + private final Map handleToOperation = + new HashMap(); + + public OperationManager() { + super(OperationManager.class.getSimpleName()); + } + + @Override + public synchronized void init(HiveConf hiveConf) { + if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED)) { + initOperationLogCapture(hiveConf.getVar( + HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LEVEL)); + } else { + LOG.debug("Operation level logging is turned off"); + } + super.init(hiveConf); + } + + @Override + public synchronized void start() { + super.start(); + // TODO + } + + @Override + public synchronized void stop() { + // TODO + super.stop(); + } + + private void initOperationLogCapture(String loggingMode) { + // Register another Appender (with the same layout) that talks to us. + Appender ap = new LogDivertAppender(this, OperationLog.getLoggingLevel(loggingMode)); + org.apache.log4j.Logger.getRootLogger().addAppender(ap); + } + + public ExecuteStatementOperation newExecuteStatementOperation(HiveSession parentSession, + String statement, Map confOverlay, boolean runAsync) + throws HiveSQLException { + ExecuteStatementOperation executeStatementOperation = ExecuteStatementOperation + .newExecuteStatementOperation(parentSession, statement, confOverlay, runAsync, 0); + addOperation(executeStatementOperation); + return executeStatementOperation; + } + + public ExecuteStatementOperation newExecuteStatementOperation(HiveSession parentSession, + String statement, Map confOverlay, boolean runAsync, long queryTimeout) + throws HiveSQLException { + return newExecuteStatementOperation(parentSession, statement, confOverlay, runAsync, + queryTimeout); + } + + public GetTypeInfoOperation newGetTypeInfoOperation(HiveSession parentSession) { + GetTypeInfoOperation operation = new GetTypeInfoOperation(parentSession); + addOperation(operation); + return operation; + } + + public GetCatalogsOperation newGetCatalogsOperation(HiveSession parentSession) { + GetCatalogsOperation operation = new GetCatalogsOperation(parentSession); + addOperation(operation); + return operation; + } + + public GetSchemasOperation newGetSchemasOperation(HiveSession parentSession, + String catalogName, String schemaName) { + GetSchemasOperation operation = new GetSchemasOperation(parentSession, catalogName, schemaName); + addOperation(operation); + return operation; + } + + public MetadataOperation newGetTablesOperation(HiveSession parentSession, + String catalogName, String schemaName, String tableName, + List tableTypes) { + MetadataOperation operation = + new GetTablesOperation(parentSession, catalogName, schemaName, tableName, tableTypes); + addOperation(operation); + return operation; + } + + public GetTableTypesOperation newGetTableTypesOperation(HiveSession parentSession) { + GetTableTypesOperation operation = new GetTableTypesOperation(parentSession); + addOperation(operation); + return operation; + } + + public GetColumnsOperation newGetColumnsOperation(HiveSession parentSession, + String catalogName, String schemaName, String tableName, String columnName) { + GetColumnsOperation operation = new GetColumnsOperation(parentSession, + catalogName, schemaName, tableName, columnName); + addOperation(operation); + return operation; + } + + public GetFunctionsOperation newGetFunctionsOperation(HiveSession parentSession, + String catalogName, String schemaName, String functionName) { + GetFunctionsOperation operation = new GetFunctionsOperation(parentSession, + catalogName, schemaName, functionName); + addOperation(operation); + return operation; + } + + public GetPrimaryKeysOperation newGetPrimaryKeysOperation(HiveSession parentSession, + String catalogName, String schemaName, String tableName) { + GetPrimaryKeysOperation operation = new GetPrimaryKeysOperation(parentSession, + catalogName, schemaName, tableName); + addOperation(operation); + return operation; + } + + public GetCrossReferenceOperation newGetCrossReferenceOperation( + HiveSession session, String primaryCatalog, String primarySchema, + String primaryTable, String foreignCatalog, String foreignSchema, + String foreignTable) { + GetCrossReferenceOperation operation = new GetCrossReferenceOperation(session, + primaryCatalog, primarySchema, primaryTable, foreignCatalog, foreignSchema, + foreignTable); + addOperation(operation); + return operation; + } + + public Operation getOperation(OperationHandle operationHandle) throws HiveSQLException { + Operation operation = getOperationInternal(operationHandle); + if (operation == null) { + throw new HiveSQLException("Invalid OperationHandle: " + operationHandle); + } + return operation; + } + + private synchronized Operation getOperationInternal(OperationHandle operationHandle) { + return handleToOperation.get(operationHandle); + } + + private synchronized Operation removeTimedOutOperation(OperationHandle operationHandle) { + Operation operation = handleToOperation.get(operationHandle); + if (operation != null && operation.isTimedOut(System.currentTimeMillis())) { + handleToOperation.remove(operationHandle); + return operation; + } + return null; + } + + private synchronized void addOperation(Operation operation) { + handleToOperation.put(operation.getHandle(), operation); + } + + private synchronized Operation removeOperation(OperationHandle opHandle) { + return handleToOperation.remove(opHandle); + } + + public OperationStatus getOperationStatus(OperationHandle opHandle) + throws HiveSQLException { + return getOperation(opHandle).getStatus(); + } + + public void cancelOperation(OperationHandle opHandle) throws HiveSQLException { + Operation operation = getOperation(opHandle); + OperationState opState = operation.getStatus().getState(); + if (opState == OperationState.CANCELED || + opState == OperationState.TIMEDOUT || + opState == OperationState.CLOSED || + opState == OperationState.FINISHED || + opState == OperationState.ERROR || + opState == OperationState.UNKNOWN) { + // Cancel should be a no-op in either cases + LOG.debug(opHandle + ": Operation is already aborted in state - " + opState); + } + else { + LOG.debug(opHandle + ": Attempting to cancel from state - " + opState); + operation.cancel(); + } + } + + public void closeOperation(OperationHandle opHandle) throws HiveSQLException { + Operation operation = removeOperation(opHandle); + if (operation == null) { + throw new HiveSQLException("Operation does not exist!"); + } + operation.close(); + } + + public TableSchema getOperationResultSetSchema(OperationHandle opHandle) + throws HiveSQLException { + return getOperation(opHandle).getResultSetSchema(); + } + + public RowSet getOperationNextRowSet(OperationHandle opHandle) + throws HiveSQLException { + return getOperation(opHandle).getNextRowSet(); + } + + public RowSet getOperationNextRowSet(OperationHandle opHandle, + FetchOrientation orientation, long maxRows) + throws HiveSQLException { + return getOperation(opHandle).getNextRowSet(orientation, maxRows); + } + + public RowSet getOperationLogRowSet(OperationHandle opHandle, + FetchOrientation orientation, long maxRows) + throws HiveSQLException { + // get the OperationLog object from the operation + OperationLog operationLog = getOperation(opHandle).getOperationLog(); + if (operationLog == null) { + throw new HiveSQLException("Couldn't find log associated with operation handle: " + opHandle); + } + + // read logs + List logs; + try { + logs = operationLog.readOperationLog(isFetchFirst(orientation), maxRows); + } catch (SQLException e) { + throw new HiveSQLException(e.getMessage(), e.getCause()); + } + + + // convert logs to RowSet + TableSchema tableSchema = new TableSchema(getLogSchema()); + RowSet rowSet = RowSetFactory.create(tableSchema, + getOperation(opHandle).getProtocolVersion(), false); + for (String log : logs) { + rowSet.addRow(new String[] {log}); + } + + return rowSet; + } + + private boolean isFetchFirst(FetchOrientation fetchOrientation) { + //TODO: Since OperationLog is moved to package o.a.h.h.ql.session, + // we may add a Enum there and map FetchOrientation to it. + if (fetchOrientation.equals(FetchOrientation.FETCH_FIRST)) { + return true; + } + return false; + } + + private Schema getLogSchema() { + Schema schema = new Schema(); + FieldSchema fieldSchema = new FieldSchema(); + fieldSchema.setName("operation_log"); + fieldSchema.setType("string"); + schema.addToFieldSchemas(fieldSchema); + return schema; + } + + public OperationLog getOperationLogByThread() { + return OperationLog.getCurrentOperationLog(); + } + + public List removeExpiredOperations(OperationHandle[] handles) { + List removed = new ArrayList(); + for (OperationHandle handle : handles) { + Operation operation = removeTimedOutOperation(handle); + if (operation != null) { + LOG.warn("Operation " + handle + " is timed-out and will be closed"); + removed.add(operation); + } + } + return removed; + } +} diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java new file mode 100644 index 0000000000000..894793152f409 --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java @@ -0,0 +1,457 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli.operation; + +import java.io.IOException; +import java.io.Serializable; +import java.security.PrivilegedExceptionAction; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.Future; +import java.util.concurrent.RejectedExecutionException; + +import static java.nio.charset.StandardCharsets.UTF_8; + +import org.apache.commons.codec.binary.Base64; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.metastore.api.FieldSchema; +import org.apache.hadoop.hive.metastore.api.Schema; +import org.apache.hadoop.hive.ql.CommandNeedRetryException; +import org.apache.hadoop.hive.ql.Driver; +import org.apache.hadoop.hive.ql.QueryState; +import org.apache.hadoop.hive.ql.exec.ExplainTask; +import org.apache.hadoop.hive.ql.exec.Task; +import org.apache.hadoop.hive.ql.metadata.Hive; +import org.apache.hadoop.hive.ql.metadata.HiveException; +import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; +import org.apache.hadoop.hive.ql.session.SessionState; +import org.apache.hadoop.hive.serde.serdeConstants; +import org.apache.hadoop.hive.serde2.AbstractSerDe; +import org.apache.hadoop.hive.serde2.SerDeException; +import org.apache.hadoop.hive.serde2.SerDeUtils; +import org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe; +import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; +import org.apache.hadoop.hive.serde2.objectinspector.StructField; +import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; +import org.apache.hadoop.hive.shims.Utils; +import org.apache.hadoop.io.BytesWritable; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hive.service.cli.FetchOrientation; +import org.apache.hive.service.cli.HiveSQLException; +import org.apache.hive.service.cli.OperationState; +import org.apache.hive.service.cli.RowSet; +import org.apache.hive.service.cli.RowSetFactory; +import org.apache.hive.service.cli.TableSchema; +import org.apache.hive.service.cli.session.HiveSession; +import org.apache.hive.service.server.ThreadWithGarbageCleanup; + +/** + * SQLOperation. + * + */ +public class SQLOperation extends ExecuteStatementOperation { + + private Driver driver = null; + private CommandProcessorResponse response; + private TableSchema resultSchema = null; + private Schema mResultSchema = null; + private AbstractSerDe serde = null; + private boolean fetchStarted = false; + + public SQLOperation(HiveSession parentSession, String statement, Map confOverlay, + boolean runInBackground, long queryTimeout) { + // TODO: call setRemoteUser in ExecuteStatementOperation or higher. + super(parentSession, statement, confOverlay, runInBackground); + } + + /*** + * Compile the query and extract metadata + * @param queryState + * @throws HiveSQLException + */ + public void prepare(QueryState queryState) throws HiveSQLException { + setState(OperationState.RUNNING); + + try { + driver = new Driver(queryState, getParentSession().getUserName()); + + // set the operation handle information in Driver, so that thrift API users + // can use the operation handle they receive, to lookup query information in + // Yarn ATS + String guid64 = Base64.encodeBase64URLSafeString(getHandle().getHandleIdentifier() + .toTHandleIdentifier().getGuid()).trim(); + driver.setOperationId(guid64); + + // In Hive server mode, we are not able to retry in the FetchTask + // case, when calling fetch queries since execute() has returned. + // For now, we disable the test attempts. + driver.setTryCount(Integer.MAX_VALUE); + + response = driver.compileAndRespond(statement); + if (0 != response.getResponseCode()) { + throw toSQLException("Error while compiling statement", response); + } + + mResultSchema = driver.getSchema(); + + // hasResultSet should be true only if the query has a FetchTask + // "explain" is an exception for now + if(driver.getPlan().getFetchTask() != null) { + //Schema has to be set + if (mResultSchema == null || !mResultSchema.isSetFieldSchemas()) { + throw new HiveSQLException("Error compiling query: Schema and FieldSchema " + + "should be set when query plan has a FetchTask"); + } + resultSchema = new TableSchema(mResultSchema); + setHasResultSet(true); + } else { + setHasResultSet(false); + } + // Set hasResultSet true if the plan has ExplainTask + // TODO explain should use a FetchTask for reading + for (Task task: driver.getPlan().getRootTasks()) { + if (task.getClass() == ExplainTask.class) { + resultSchema = new TableSchema(mResultSchema); + setHasResultSet(true); + break; + } + } + } catch (HiveSQLException e) { + setState(OperationState.ERROR); + throw e; + } catch (Exception e) { + setState(OperationState.ERROR); + throw new HiveSQLException("Error running query: " + e.toString(), e); + } + } + + private void runQuery(HiveConf sqlOperationConf) throws HiveSQLException { + try { + // In Hive server mode, we are not able to retry in the FetchTask + // case, when calling fetch queries since execute() has returned. + // For now, we disable the test attempts. + driver.setTryCount(Integer.MAX_VALUE); + response = driver.run(); + if (0 != response.getResponseCode()) { + throw toSQLException("Error while processing statement", response); + } + } catch (HiveSQLException e) { + // If the operation was cancelled by another thread or timed out, + // Driver#run will return a non-zero response code. + // We will simply return if the operation state is CANCELED or TIMEDOUT, + // otherwise throw an exception + if (getStatus().getState() == OperationState.CANCELED || + getStatus().getState() == OperationState.TIMEDOUT) { + return; + } + else { + setState(OperationState.ERROR); + throw e; + } + } catch (Exception e) { + setState(OperationState.ERROR); + throw new HiveSQLException("Error running query: " + e.toString(), e); + } + setState(OperationState.FINISHED); + } + + @Override + public void runInternal() throws HiveSQLException { + setState(OperationState.PENDING); + final HiveConf opConfig = getConfigForOperation(); + prepare(queryState); + if (!shouldRunAsync()) { + runQuery(opConfig); + } else { + // We'll pass ThreadLocals in the background thread from the foreground (handler) thread + final SessionState parentSessionState = SessionState.get(); + // ThreadLocal Hive object needs to be set in background thread. + // The metastore client in Hive is associated with right user. + final Hive parentHive = getSessionHive(); + // Current UGI will get used by metastore when metsatore is in embedded mode + // So this needs to get passed to the new background thread + final UserGroupInformation currentUGI = getCurrentUGI(opConfig); + // Runnable impl to call runInternal asynchronously, + // from a different thread + Runnable backgroundOperation = new Runnable() { + @Override + public void run() { + PrivilegedExceptionAction doAsAction = new PrivilegedExceptionAction() { + @Override + public Object run() throws HiveSQLException { + Hive.set(parentHive); + SessionState.setCurrentSessionState(parentSessionState); + // Set current OperationLog in this async thread for keeping on saving query log. + registerCurrentOperationLog(); + try { + runQuery(opConfig); + } catch (HiveSQLException e) { + setOperationException(e); + LOG.error("Error running hive query: ", e); + } finally { + unregisterOperationLog(); + } + return null; + } + }; + + try { + currentUGI.doAs(doAsAction); + } catch (Exception e) { + setOperationException(new HiveSQLException(e)); + LOG.error("Error running hive query as user : " + currentUGI.getShortUserName(), e); + } + finally { + /** + * We'll cache the ThreadLocal RawStore object for this background thread for an orderly cleanup + * when this thread is garbage collected later. + * @see org.apache.hive.service.server.ThreadWithGarbageCleanup#finalize() + */ + if (ThreadWithGarbageCleanup.currentThread() instanceof ThreadWithGarbageCleanup) { + ThreadWithGarbageCleanup currentThread = + (ThreadWithGarbageCleanup) ThreadWithGarbageCleanup.currentThread(); + currentThread.cacheThreadLocalRawStore(); + } + } + } + }; + try { + // This submit blocks if no background threads are available to run this operation + Future backgroundHandle = + getParentSession().getSessionManager().submitBackgroundOperation(backgroundOperation); + setBackgroundHandle(backgroundHandle); + } catch (RejectedExecutionException rejected) { + setState(OperationState.ERROR); + throw new HiveSQLException("The background threadpool cannot accept" + + " new task for execution, please retry the operation", rejected); + } + } + } + + /** + * Returns the current UGI on the stack + * @param opConfig + * @return UserGroupInformation + * @throws HiveSQLException + */ + private UserGroupInformation getCurrentUGI(HiveConf opConfig) throws HiveSQLException { + try { + return Utils.getUGI(); + } catch (Exception e) { + throw new HiveSQLException("Unable to get current user", e); + } + } + + /** + * Returns the ThreadLocal Hive for the current thread + * @return Hive + * @throws HiveSQLException + */ + private Hive getSessionHive() throws HiveSQLException { + try { + return Hive.get(); + } catch (HiveException e) { + throw new HiveSQLException("Failed to get ThreadLocal Hive object", e); + } + } + + private void cleanup(OperationState state) throws HiveSQLException { + setState(state); + if (shouldRunAsync()) { + Future backgroundHandle = getBackgroundHandle(); + if (backgroundHandle != null) { + backgroundHandle.cancel(true); + } + } + if (driver != null) { + driver.close(); + driver.destroy(); + } + driver = null; + + SessionState ss = SessionState.get(); + if (ss.getTmpOutputFile() != null) { + ss.getTmpOutputFile().delete(); + } + } + + @Override + public void cancel() throws HiveSQLException { + cleanup(OperationState.CANCELED); + } + + @Override + public void close() throws HiveSQLException { + cleanup(OperationState.CLOSED); + cleanupOperationLog(); + } + + @Override + public TableSchema getResultSetSchema() throws HiveSQLException { + assertState(OperationState.FINISHED); + if (resultSchema == null) { + resultSchema = new TableSchema(driver.getSchema()); + } + return resultSchema; + } + + private final transient List convey = new ArrayList(); + + @Override + public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { + validateDefaultFetchOrientation(orientation); + assertState(OperationState.FINISHED); + + RowSet rowSet = RowSetFactory.create(resultSchema, getProtocolVersion(), false); + + try { + /* if client is requesting fetch-from-start and its not the first time reading from this operation + * then reset the fetch position to beginning + */ + if (orientation.equals(FetchOrientation.FETCH_FIRST) && fetchStarted) { + driver.resetFetch(); + } + fetchStarted = true; + driver.setMaxRows((int) maxRows); + if (driver.getResults(convey)) { + return decode(convey, rowSet); + } + return rowSet; + } catch (IOException e) { + throw new HiveSQLException(e); + } catch (CommandNeedRetryException e) { + throw new HiveSQLException(e); + } catch (Exception e) { + throw new HiveSQLException(e); + } finally { + convey.clear(); + } + } + + private RowSet decode(List rows, RowSet rowSet) throws Exception { + if (driver.isFetchingTable()) { + return prepareFromRow(rows, rowSet); + } + return decodeFromString(rows, rowSet); + } + + // already encoded to thrift-able object in ThriftFormatter + private RowSet prepareFromRow(List rows, RowSet rowSet) throws Exception { + for (Object row : rows) { + rowSet.addRow((Object[]) row); + } + return rowSet; + } + + private RowSet decodeFromString(List rows, RowSet rowSet) + throws SQLException, SerDeException { + getSerDe(); + StructObjectInspector soi = (StructObjectInspector) serde.getObjectInspector(); + List fieldRefs = soi.getAllStructFieldRefs(); + + Object[] deserializedFields = new Object[fieldRefs.size()]; + Object rowObj; + ObjectInspector fieldOI; + + int protocol = getProtocolVersion().getValue(); + for (Object rowString : rows) { + rowObj = serde.deserialize(new BytesWritable(((String)rowString).getBytes(UTF_8))); + for (int i = 0; i < fieldRefs.size(); i++) { + StructField fieldRef = fieldRefs.get(i); + fieldOI = fieldRef.getFieldObjectInspector(); + Object fieldData = soi.getStructFieldData(rowObj, fieldRef); + deserializedFields[i] = SerDeUtils.toThriftPayload(fieldData, fieldOI, protocol); + } + rowSet.addRow(deserializedFields); + } + return rowSet; + } + + private AbstractSerDe getSerDe() throws SQLException { + if (serde != null) { + return serde; + } + try { + List fieldSchemas = mResultSchema.getFieldSchemas(); + StringBuilder namesSb = new StringBuilder(); + StringBuilder typesSb = new StringBuilder(); + + if (fieldSchemas != null && !fieldSchemas.isEmpty()) { + for (int pos = 0; pos < fieldSchemas.size(); pos++) { + if (pos != 0) { + namesSb.append(","); + typesSb.append(","); + } + namesSb.append(fieldSchemas.get(pos).getName()); + typesSb.append(fieldSchemas.get(pos).getType()); + } + } + String names = namesSb.toString(); + String types = typesSb.toString(); + + serde = new LazySimpleSerDe(); + Properties props = new Properties(); + if (names.length() > 0) { + LOG.debug("Column names: " + names); + props.setProperty(serdeConstants.LIST_COLUMNS, names); + } + if (types.length() > 0) { + LOG.debug("Column types: " + types); + props.setProperty(serdeConstants.LIST_COLUMN_TYPES, types); + } + SerDeUtils.initializeSerDe(serde, new HiveConf(), props, null); + + } catch (Exception ex) { + ex.printStackTrace(); + throw new SQLException("Could not create ResultSet: " + ex.getMessage(), ex); + } + return serde; + } + + /** + * If there are query specific settings to overlay, then create a copy of config + * There are two cases we need to clone the session config that's being passed to hive driver + * 1. Async query - + * If the client changes a config setting, that shouldn't reflect in the execution already underway + * 2. confOverlay - + * The query specific settings should only be applied to the query config and not session + * @return new configuration + * @throws HiveSQLException + */ + private HiveConf getConfigForOperation() throws HiveSQLException { + HiveConf sqlOperationConf = getParentSession().getHiveConf(); + if (!getConfOverlay().isEmpty() || shouldRunAsync()) { + // clone the parent session config for this query + sqlOperationConf = new HiveConf(sqlOperationConf); + + // apply overlay query specific settings, if any + for (Map.Entry confEntry : getConfOverlay().entrySet()) { + try { + sqlOperationConf.verifyAndSet(confEntry.getKey(), confEntry.getValue()); + } catch (IllegalArgumentException e) { + throw new HiveSQLException("Error applying statement specific settings", e); + } + } + } + return sqlOperationConf; + } +} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/TableTypeMapping.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/TableTypeMapping.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/TableTypeMapping.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/TableTypeMapping.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSession.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSession.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSession.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSession.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSessionHookContext.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionHookContext.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSessionHookContext.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionHookContext.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSessionHookContextImpl.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionHookContextImpl.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSessionHookContextImpl.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionHookContextImpl.java diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java new file mode 100644 index 0000000000000..f47a4388f7bea --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java @@ -0,0 +1,901 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli.session; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.hadoop.hive.common.cli.HiveFileProcessor; +import org.apache.hadoop.hive.common.cli.IHiveFileProcessor; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.conf.HiveConf.ConfVars; +import org.apache.hadoop.hive.conf.VariableSubstitution; +import org.apache.hadoop.hive.metastore.IMetaStoreClient; +import org.apache.hadoop.hive.metastore.api.MetaException; +import org.apache.hadoop.hive.ql.exec.Utilities; +import org.apache.hadoop.hive.ql.history.HiveHistory; +import org.apache.hadoop.hive.ql.metadata.Hive; +import org.apache.hadoop.hive.ql.metadata.HiveException; +import org.apache.hadoop.hive.ql.session.SessionState; +import org.apache.hadoop.hive.serde2.SerDeUtils; +import org.apache.hadoop.hive.serde2.thrift.ThriftFormatter; +import org.apache.hadoop.hive.shims.ShimLoader; +import org.apache.hive.common.util.HiveVersionInfo; +import org.apache.hive.service.auth.HiveAuthFactory; +import org.apache.hive.service.cli.FetchOrientation; +import org.apache.hive.service.cli.FetchType; +import org.apache.hive.service.cli.GetInfoType; +import org.apache.hive.service.cli.GetInfoValue; +import org.apache.hive.service.cli.HiveSQLException; +import org.apache.hive.service.cli.OperationHandle; +import org.apache.hive.service.cli.RowSet; +import org.apache.hive.service.cli.SessionHandle; +import org.apache.hive.service.cli.TableSchema; +import org.apache.hive.service.cli.operation.ExecuteStatementOperation; +import org.apache.hive.service.cli.operation.GetCatalogsOperation; +import org.apache.hive.service.cli.operation.GetColumnsOperation; +import org.apache.hive.service.cli.operation.GetCrossReferenceOperation; +import org.apache.hive.service.cli.operation.GetFunctionsOperation; +import org.apache.hive.service.cli.operation.GetPrimaryKeysOperation; +import org.apache.hive.service.cli.operation.GetSchemasOperation; +import org.apache.hive.service.cli.operation.GetTableTypesOperation; +import org.apache.hive.service.cli.operation.GetTypeInfoOperation; +import org.apache.hive.service.cli.operation.MetadataOperation; +import org.apache.hive.service.cli.operation.Operation; +import org.apache.hive.service.cli.operation.OperationManager; +import org.apache.hive.service.rpc.thrift.TProtocolVersion; +import org.apache.hive.service.server.ThreadWithGarbageCleanup; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import static org.apache.hadoop.hive.conf.SystemVariables.ENV_PREFIX; +import static org.apache.hadoop.hive.conf.SystemVariables.HIVECONF_PREFIX; +import static org.apache.hadoop.hive.conf.SystemVariables.HIVEVAR_PREFIX; +import static org.apache.hadoop.hive.conf.SystemVariables.METACONF_PREFIX; +import static org.apache.hadoop.hive.conf.SystemVariables.SYSTEM_PREFIX; + +/** + * HiveSession + * + */ +public class HiveSessionImpl implements HiveSession { + private final SessionHandle sessionHandle; + private String username; + private final String password; + private HiveConf hiveConf; + private SessionState sessionState; + private String ipAddress; + private static final String FETCH_WORK_SERDE_CLASS = + "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"; + private static final Logger LOG = LoggerFactory.getLogger(HiveSessionImpl.class); + private SessionManager sessionManager; + private OperationManager operationManager; + private final Set opHandleSet = new HashSet(); + private boolean isOperationLogEnabled; + private File sessionLogDir; + private volatile long lastAccessTime; + private volatile long lastIdleTime; + + public HiveSessionImpl(TProtocolVersion protocol, String username, String password, + HiveConf serverhiveConf, String ipAddress) { + this.username = username; + this.password = password; + this.sessionHandle = new SessionHandle(protocol); + this.hiveConf = new HiveConf(serverhiveConf); + this.ipAddress = ipAddress; + + try { + // In non-impersonation mode, map scheduler queue to current user + // if fair scheduler is configured. + if (! hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS) && + hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_MAP_FAIR_SCHEDULER_QUEUE)) { + ShimLoader.getHadoopShims().refreshDefaultQueue(hiveConf, username); + } + } catch (IOException e) { + LOG.warn("Error setting scheduler queue: " + e, e); + } + // Set an explicit session name to control the download directory name + hiveConf.set(ConfVars.HIVESESSIONID.varname, + sessionHandle.getHandleIdentifier().toString()); + // Use thrift transportable formatter + hiveConf.set(SerDeUtils.LIST_SINK_OUTPUT_FORMATTER, ThriftFormatter.class.getName()); + hiveConf.setInt(SerDeUtils.LIST_SINK_OUTPUT_PROTOCOL, protocol.getValue()); + } + + @Override + /** + * Opens a new HiveServer2 session for the client connection. + * Creates a new SessionState object that will be associated with this HiveServer2 session. + * When the server executes multiple queries in the same session, + * this SessionState object is reused across multiple queries. + * Note that if doAs is true, this call goes through a proxy object, + * which wraps the method logic in a UserGroupInformation#doAs. + * That's why it is important to create SessionState here rather than in the constructor. + */ + public void open(Map sessionConfMap) throws HiveSQLException { + sessionState = new SessionState(hiveConf, username); + sessionState.setUserIpAddress(ipAddress); + sessionState.setIsHiveServerQuery(true); + SessionState.start(sessionState); + try { + sessionState.loadAuxJars(); + sessionState.loadReloadableAuxJars(); + } catch (IOException e) { + String msg = "Failed to load reloadable jar file path: " + e; + LOG.error(msg, e); + throw new HiveSQLException(msg, e); + } + // Process global init file: .hiverc + processGlobalInitFile(); + if (sessionConfMap != null) { + configureSession(sessionConfMap); + } + lastAccessTime = System.currentTimeMillis(); + lastIdleTime = lastAccessTime; + } + + /** + * It is used for processing hiverc file from HiveServer2 side. + */ + private class GlobalHivercFileProcessor extends HiveFileProcessor { + @Override + protected BufferedReader loadFile(String fileName) throws IOException { + FileInputStream initStream = null; + BufferedReader bufferedReader = null; + initStream = new FileInputStream(fileName); + bufferedReader = new BufferedReader(new InputStreamReader(initStream)); + return bufferedReader; + } + + @Override + protected int processCmd(String cmd) { + int rc = 0; + String cmd_trimmed = cmd.trim(); + try { + executeStatementInternal(cmd_trimmed, null, false, 0); + } catch (HiveSQLException e) { + rc = -1; + LOG.warn("Failed to execute HQL command in global .hiverc file.", e); + } + return rc; + } + } + + private void processGlobalInitFile() { + IHiveFileProcessor processor = new GlobalHivercFileProcessor(); + + try { + String hiverc = hiveConf.getVar(ConfVars.HIVE_SERVER2_GLOBAL_INIT_FILE_LOCATION); + if (hiverc != null) { + File hivercFile = new File(hiverc); + if (hivercFile.isDirectory()) { + hivercFile = new File(hivercFile, SessionManager.HIVERCFILE); + } + if (hivercFile.isFile()) { + LOG.info("Running global init file: " + hivercFile); + int rc = processor.processFile(hivercFile.getAbsolutePath()); + if (rc != 0) { + LOG.error("Failed on initializing global .hiverc file"); + } + } else { + LOG.debug("Global init file " + hivercFile + " does not exist"); + } + } + } catch (IOException e) { + LOG.warn("Failed on initializing global .hiverc file", e); + } + } + + private void configureSession(Map sessionConfMap) throws HiveSQLException { + SessionState.setCurrentSessionState(sessionState); + for (Map.Entry entry : sessionConfMap.entrySet()) { + String key = entry.getKey(); + if (key.startsWith("set:")) { + try { + setVariable(key.substring(4), entry.getValue()); + } catch (Exception e) { + throw new HiveSQLException(e); + } + } else if (key.startsWith("use:")) { + SessionState.get().setCurrentDatabase(entry.getValue()); + } else { + hiveConf.verifyAndSet(key, entry.getValue()); + } + } + } + + // Copy from org.apache.hadoop.hive.ql.processors.SetProcessor, only change: + // setConf(varname, propName, varvalue, true) when varname.startsWith(HIVECONF_PREFIX) + public static int setVariable(String varname, String varvalue) throws Exception { + SessionState ss = SessionState.get(); + VariableSubstitution substitution = new VariableSubstitution(() -> ss.getHiveVariables()); + if (varvalue.contains("\n")){ + ss.err.println("Warning: Value had a \\n character in it."); + } + varname = varname.trim(); + if (varname.startsWith(ENV_PREFIX)){ + ss.err.println("env:* variables can not be set."); + return 1; + } else if (varname.startsWith(SYSTEM_PREFIX)){ + String propName = varname.substring(SYSTEM_PREFIX.length()); + System.getProperties().setProperty(propName, substitution.substitute(ss.getConf(),varvalue)); + } else if (varname.startsWith(HIVECONF_PREFIX)){ + String propName = varname.substring(HIVECONF_PREFIX.length()); + setConf(varname, propName, varvalue, true); + } else if (varname.startsWith(HIVEVAR_PREFIX)) { + String propName = varname.substring(HIVEVAR_PREFIX.length()); + ss.getHiveVariables().put(propName, substitution.substitute(ss.getConf(),varvalue)); + } else if (varname.startsWith(METACONF_PREFIX)) { + String propName = varname.substring(METACONF_PREFIX.length()); + Hive hive = Hive.get(ss.getConf()); + hive.setMetaConf(propName, substitution.substitute(ss.getConf(), varvalue)); + } else { + setConf(varname, varname, varvalue, true); + } + return 0; + } + + // returns non-null string for validation fail + private static void setConf(String varname, String key, String varvalue, boolean register) + throws IllegalArgumentException { + VariableSubstitution substitution = + new VariableSubstitution(() -> SessionState.get().getHiveVariables()); + HiveConf conf = SessionState.get().getConf(); + String value = substitution.substitute(conf, varvalue); + if (conf.getBoolVar(HiveConf.ConfVars.HIVECONFVALIDATION)) { + HiveConf.ConfVars confVars = HiveConf.getConfVars(key); + if (confVars != null) { + if (!confVars.isType(value)) { + StringBuilder message = new StringBuilder(); + message.append("'SET ").append(varname).append('=').append(varvalue); + message.append("' FAILED because ").append(key).append(" expects "); + message.append(confVars.typeString()).append(" type value."); + throw new IllegalArgumentException(message.toString()); + } + String fail = confVars.validate(value); + if (fail != null) { + StringBuilder message = new StringBuilder(); + message.append("'SET ").append(varname).append('=').append(varvalue); + message.append("' FAILED in validation : ").append(fail).append('.'); + throw new IllegalArgumentException(message.toString()); + } + } else if (key.startsWith("hive.")) { + throw new IllegalArgumentException("hive configuration " + key + " does not exists."); + } + } + conf.verifyAndSet(key, value); + if (register) { + SessionState.get().getOverriddenConfigurations().put(key, value); + } + } + + @Override + public void setOperationLogSessionDir(File operationLogRootDir) { + if (!operationLogRootDir.exists()) { + LOG.warn("The operation log root directory is removed, recreating: " + + operationLogRootDir.getAbsolutePath()); + if (!operationLogRootDir.mkdirs()) { + LOG.warn("Unable to create operation log root directory: " + + operationLogRootDir.getAbsolutePath()); + } + } + if (!operationLogRootDir.canWrite()) { + LOG.warn("The operation log root directory is not writable: " + + operationLogRootDir.getAbsolutePath()); + } + sessionLogDir = new File(operationLogRootDir, sessionHandle.getHandleIdentifier().toString()); + isOperationLogEnabled = true; + if (!sessionLogDir.exists()) { + if (!sessionLogDir.mkdir()) { + LOG.warn("Unable to create operation log session directory: " + + sessionLogDir.getAbsolutePath()); + isOperationLogEnabled = false; + } + } + if (isOperationLogEnabled) { + LOG.info("Operation log session directory is created: " + sessionLogDir.getAbsolutePath()); + } + } + + @Override + public boolean isOperationLogEnabled() { + return isOperationLogEnabled; + } + + @Override + public File getOperationLogSessionDir() { + return sessionLogDir; + } + + @Override + public TProtocolVersion getProtocolVersion() { + return sessionHandle.getProtocolVersion(); + } + + @Override + public SessionManager getSessionManager() { + return sessionManager; + } + + @Override + public void setSessionManager(SessionManager sessionManager) { + this.sessionManager = sessionManager; + } + + private OperationManager getOperationManager() { + return operationManager; + } + + @Override + public void setOperationManager(OperationManager operationManager) { + this.operationManager = operationManager; + } + + protected synchronized void acquire(boolean userAccess) { + // Need to make sure that the this HiveServer2's session's SessionState is + // stored in the thread local for the handler thread. + SessionState.setCurrentSessionState(sessionState); + if (userAccess) { + lastAccessTime = System.currentTimeMillis(); + } + } + + /** + * 1. We'll remove the ThreadLocal SessionState as this thread might now serve + * other requests. + * 2. We'll cache the ThreadLocal RawStore object for this background thread for an orderly cleanup + * when this thread is garbage collected later. + * @see org.apache.hive.service.server.ThreadWithGarbageCleanup#finalize() + */ + protected synchronized void release(boolean userAccess) { + SessionState.detachSession(); + if (ThreadWithGarbageCleanup.currentThread() instanceof ThreadWithGarbageCleanup) { + ThreadWithGarbageCleanup currentThread = + (ThreadWithGarbageCleanup) ThreadWithGarbageCleanup.currentThread(); + currentThread.cacheThreadLocalRawStore(); + } + if (userAccess) { + lastAccessTime = System.currentTimeMillis(); + } + if (opHandleSet.isEmpty()) { + lastIdleTime = System.currentTimeMillis(); + } else { + lastIdleTime = 0; + } + } + + @Override + public SessionHandle getSessionHandle() { + return sessionHandle; + } + + @Override + public String getUsername() { + return username; + } + + @Override + public String getPassword() { + return password; + } + + @Override + public HiveConf getHiveConf() { + hiveConf.setVar(HiveConf.ConfVars.HIVEFETCHOUTPUTSERDE, FETCH_WORK_SERDE_CLASS); + return hiveConf; + } + + @Override + public IMetaStoreClient getMetaStoreClient() throws HiveSQLException { + try { + return Hive.get(getHiveConf()).getMSC(); + } catch (HiveException e) { + throw new HiveSQLException("Failed to get metastore connection", e); + } catch (MetaException e) { + throw new HiveSQLException("Failed to get metastore connection", e); + } + } + + @Override + public GetInfoValue getInfo(GetInfoType getInfoType) + throws HiveSQLException { + acquire(true); + try { + switch (getInfoType) { + case CLI_SERVER_NAME: + return new GetInfoValue("Hive"); + case CLI_DBMS_NAME: + return new GetInfoValue("Apache Hive"); + case CLI_DBMS_VER: + return new GetInfoValue(HiveVersionInfo.getVersion()); + case CLI_MAX_COLUMN_NAME_LEN: + return new GetInfoValue(128); + case CLI_MAX_SCHEMA_NAME_LEN: + return new GetInfoValue(128); + case CLI_MAX_TABLE_NAME_LEN: + return new GetInfoValue(128); + case CLI_TXN_CAPABLE: + default: + throw new HiveSQLException("Unrecognized GetInfoType value: " + getInfoType.toString()); + } + } finally { + release(true); + } + } + + @Override + public OperationHandle executeStatement(String statement, Map confOverlay) + throws HiveSQLException { + return executeStatementInternal(statement, confOverlay, false, 0); + } + + @Override + public OperationHandle executeStatement(String statement, Map confOverlay, + long queryTimeout) throws HiveSQLException { + return executeStatementInternal(statement, confOverlay, false, queryTimeout); + } + + @Override + public OperationHandle executeStatementAsync(String statement, Map confOverlay) + throws HiveSQLException { + return executeStatementInternal(statement, confOverlay, true, 0); + } + + @Override + public OperationHandle executeStatementAsync(String statement, Map confOverlay, + long queryTimeout) throws HiveSQLException { + return executeStatementInternal(statement, confOverlay, true, queryTimeout); + } + + private OperationHandle executeStatementInternal(String statement, + Map confOverlay, boolean runAsync, long queryTimeout) throws HiveSQLException { + acquire(true); + + OperationManager operationManager = getOperationManager(); + ExecuteStatementOperation operation = operationManager + .newExecuteStatementOperation(getSession(), statement, confOverlay, runAsync, queryTimeout); + OperationHandle opHandle = operation.getHandle(); + try { + operation.run(); + opHandleSet.add(opHandle); + return opHandle; + } catch (HiveSQLException e) { + // Referring to SQLOperation.java, there is no chance that a HiveSQLException throws and the asyn + // background operation submits to thread pool successfully at the same time. So, Cleanup + // opHandle directly when got HiveSQLException + operationManager.closeOperation(opHandle); + throw e; + } finally { + release(true); + } + } + + @Override + public OperationHandle getTypeInfo() + throws HiveSQLException { + acquire(true); + + OperationManager operationManager = getOperationManager(); + GetTypeInfoOperation operation = operationManager.newGetTypeInfoOperation(getSession()); + OperationHandle opHandle = operation.getHandle(); + try { + operation.run(); + opHandleSet.add(opHandle); + return opHandle; + } catch (HiveSQLException e) { + operationManager.closeOperation(opHandle); + throw e; + } finally { + release(true); + } + } + + @Override + public OperationHandle getCatalogs() + throws HiveSQLException { + acquire(true); + + OperationManager operationManager = getOperationManager(); + GetCatalogsOperation operation = operationManager.newGetCatalogsOperation(getSession()); + OperationHandle opHandle = operation.getHandle(); + try { + operation.run(); + opHandleSet.add(opHandle); + return opHandle; + } catch (HiveSQLException e) { + operationManager.closeOperation(opHandle); + throw e; + } finally { + release(true); + } + } + + @Override + public OperationHandle getSchemas(String catalogName, String schemaName) + throws HiveSQLException { + acquire(true); + + OperationManager operationManager = getOperationManager(); + GetSchemasOperation operation = + operationManager.newGetSchemasOperation(getSession(), catalogName, schemaName); + OperationHandle opHandle = operation.getHandle(); + try { + operation.run(); + opHandleSet.add(opHandle); + return opHandle; + } catch (HiveSQLException e) { + operationManager.closeOperation(opHandle); + throw e; + } finally { + release(true); + } + } + + @Override + public OperationHandle getTables(String catalogName, String schemaName, String tableName, + List tableTypes) + throws HiveSQLException { + acquire(true); + + OperationManager operationManager = getOperationManager(); + MetadataOperation operation = + operationManager.newGetTablesOperation(getSession(), catalogName, schemaName, tableName, tableTypes); + OperationHandle opHandle = operation.getHandle(); + try { + operation.run(); + opHandleSet.add(opHandle); + return opHandle; + } catch (HiveSQLException e) { + operationManager.closeOperation(opHandle); + throw e; + } finally { + release(true); + } + } + + @Override + public OperationHandle getTableTypes() + throws HiveSQLException { + acquire(true); + + OperationManager operationManager = getOperationManager(); + GetTableTypesOperation operation = operationManager.newGetTableTypesOperation(getSession()); + OperationHandle opHandle = operation.getHandle(); + try { + operation.run(); + opHandleSet.add(opHandle); + return opHandle; + } catch (HiveSQLException e) { + operationManager.closeOperation(opHandle); + throw e; + } finally { + release(true); + } + } + + @Override + public OperationHandle getColumns(String catalogName, String schemaName, + String tableName, String columnName) throws HiveSQLException { + acquire(true); + String addedJars = Utilities.getResourceFiles(hiveConf, SessionState.ResourceType.JAR); + if (StringUtils.isNotBlank(addedJars)) { + IMetaStoreClient metastoreClient = getSession().getMetaStoreClient(); + metastoreClient.setHiveAddedJars(addedJars); + } + OperationManager operationManager = getOperationManager(); + GetColumnsOperation operation = operationManager.newGetColumnsOperation(getSession(), + catalogName, schemaName, tableName, columnName); + OperationHandle opHandle = operation.getHandle(); + try { + operation.run(); + opHandleSet.add(opHandle); + return opHandle; + } catch (HiveSQLException e) { + operationManager.closeOperation(opHandle); + throw e; + } finally { + release(true); + } + } + + @Override + public OperationHandle getFunctions(String catalogName, String schemaName, String functionName) + throws HiveSQLException { + acquire(true); + + OperationManager operationManager = getOperationManager(); + GetFunctionsOperation operation = operationManager + .newGetFunctionsOperation(getSession(), catalogName, schemaName, functionName); + OperationHandle opHandle = operation.getHandle(); + try { + operation.run(); + opHandleSet.add(opHandle); + return opHandle; + } catch (HiveSQLException e) { + operationManager.closeOperation(opHandle); + throw e; + } finally { + release(true); + } + } + + @Override + public void close() throws HiveSQLException { + try { + acquire(true); + // Iterate through the opHandles and close their operations + for (OperationHandle opHandle : opHandleSet) { + try { + operationManager.closeOperation(opHandle); + } catch (Exception e) { + LOG.warn("Exception is thrown closing operation " + opHandle, e); + } + } + opHandleSet.clear(); + // Cleanup session log directory. + cleanupSessionLogDir(); + // Cleanup pipeout file. + cleanupPipeoutFile(); + HiveHistory hiveHist = sessionState.getHiveHistory(); + if (null != hiveHist) { + hiveHist.closeStream(); + } + try { + sessionState.close(); + } finally { + sessionState = null; + } + } catch (IOException ioe) { + throw new HiveSQLException("Failure to close", ioe); + } finally { + if (sessionState != null) { + try { + sessionState.close(); + } catch (Throwable t) { + LOG.warn("Error closing session", t); + } + sessionState = null; + } + release(true); + } + } + + private void cleanupPipeoutFile() { + String lScratchDir = hiveConf.getVar(ConfVars.LOCALSCRATCHDIR); + String sessionID = hiveConf.getVar(ConfVars.HIVESESSIONID); + + File[] fileAry = new File(lScratchDir).listFiles( + (dir, name) -> name.startsWith(sessionID) && name.endsWith(".pipeout")); + + if (fileAry == null) { + LOG.error("Unable to access pipeout files in " + lScratchDir); + } else { + for (File file : fileAry) { + try { + FileUtils.forceDelete(file); + } catch (Exception e) { + LOG.error("Failed to cleanup pipeout file: " + file, e); + } + } + } + } + + private void cleanupSessionLogDir() { + if (isOperationLogEnabled) { + try { + FileUtils.forceDelete(sessionLogDir); + } catch (Exception e) { + LOG.error("Failed to cleanup session log dir: " + sessionHandle, e); + } + } + } + + @Override + public SessionState getSessionState() { + return sessionState; + } + + @Override + public String getUserName() { + return username; + } + + @Override + public void setUserName(String userName) { + this.username = userName; + } + + @Override + public long getLastAccessTime() { + return lastAccessTime; + } + + @Override + public void closeExpiredOperations() { + OperationHandle[] handles = opHandleSet.toArray(new OperationHandle[opHandleSet.size()]); + if (handles.length > 0) { + List operations = operationManager.removeExpiredOperations(handles); + if (!operations.isEmpty()) { + closeTimedOutOperations(operations); + } + } + } + + @Override + public long getNoOperationTime() { + return lastIdleTime > 0 ? System.currentTimeMillis() - lastIdleTime : 0; + } + + private void closeTimedOutOperations(List operations) { + acquire(false); + try { + for (Operation operation : operations) { + opHandleSet.remove(operation.getHandle()); + try { + operation.close(); + } catch (Exception e) { + LOG.warn("Exception is thrown closing timed-out operation " + operation.getHandle(), e); + } + } + } finally { + release(false); + } + } + + @Override + public void cancelOperation(OperationHandle opHandle) throws HiveSQLException { + acquire(true); + try { + sessionManager.getOperationManager().cancelOperation(opHandle); + } finally { + release(true); + } + } + + @Override + public void closeOperation(OperationHandle opHandle) throws HiveSQLException { + acquire(true); + try { + operationManager.closeOperation(opHandle); + opHandleSet.remove(opHandle); + } finally { + release(true); + } + } + + @Override + public TableSchema getResultSetMetadata(OperationHandle opHandle) throws HiveSQLException { + acquire(true); + try { + return sessionManager.getOperationManager().getOperationResultSetSchema(opHandle); + } finally { + release(true); + } + } + + @Override + public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, + long maxRows, FetchType fetchType) throws HiveSQLException { + acquire(true); + try { + if (fetchType == FetchType.QUERY_OUTPUT) { + return operationManager.getOperationNextRowSet(opHandle, orientation, maxRows); + } + return operationManager.getOperationLogRowSet(opHandle, orientation, maxRows); + } finally { + release(true); + } + } + + protected HiveSession getSession() { + return this; + } + + @Override + public String getIpAddress() { + return ipAddress; + } + + @Override + public void setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + } + + @Override + public String getDelegationToken(HiveAuthFactory authFactory, String owner, String renewer) + throws HiveSQLException { + HiveAuthFactory.verifyProxyAccess(getUsername(), owner, getIpAddress(), getHiveConf()); + return authFactory.getDelegationToken(owner, renewer, getIpAddress()); + } + + @Override + public void cancelDelegationToken(HiveAuthFactory authFactory, String tokenStr) + throws HiveSQLException { + HiveAuthFactory.verifyProxyAccess(getUsername(), getUserFromToken(authFactory, tokenStr), + getIpAddress(), getHiveConf()); + authFactory.cancelDelegationToken(tokenStr); + } + + @Override + public void renewDelegationToken(HiveAuthFactory authFactory, String tokenStr) + throws HiveSQLException { + HiveAuthFactory.verifyProxyAccess(getUsername(), getUserFromToken(authFactory, tokenStr), + getIpAddress(), getHiveConf()); + authFactory.renewDelegationToken(tokenStr); + } + + // extract the real user from the given token string + private String getUserFromToken(HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException { + return authFactory.getUserFromToken(tokenStr); + } + + @Override + public OperationHandle getPrimaryKeys(String catalog, String schema, + String table) throws HiveSQLException { + acquire(true); + + OperationManager operationManager = getOperationManager(); + GetPrimaryKeysOperation operation = operationManager + .newGetPrimaryKeysOperation(getSession(), catalog, schema, table); + OperationHandle opHandle = operation.getHandle(); + try { + operation.run(); + opHandleSet.add(opHandle); + return opHandle; + } catch (HiveSQLException e) { + operationManager.closeOperation(opHandle); + throw e; + } finally { + release(true); + } + } + + @Override + public OperationHandle getCrossReference(String primaryCatalog, + String primarySchema, String primaryTable, String foreignCatalog, + String foreignSchema, String foreignTable) throws HiveSQLException { + acquire(true); + + OperationManager operationManager = getOperationManager(); + GetCrossReferenceOperation operation = operationManager + .newGetCrossReferenceOperation(getSession(), primaryCatalog, + primarySchema, primaryTable, foreignCatalog, + foreignSchema, foreignTable); + OperationHandle opHandle = operation.getHandle(); + try { + operation.run(); + opHandleSet.add(opHandle); + return opHandle; + } catch (HiveSQLException e) { + operationManager.closeOperation(opHandle); + throw e; + } finally { + release(true); + } + } +} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/SessionManager.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/SessionManager.java new file mode 100644 index 0000000000000..5a381d170b4f9 --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/SessionManager.java @@ -0,0 +1,377 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli.session; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.Future; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import org.apache.commons.io.FileUtils; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.conf.HiveConf.ConfVars; +import org.apache.hive.service.CompositeService; +import org.apache.hive.service.cli.HiveSQLException; +import org.apache.hive.service.cli.SessionHandle; +import org.apache.hive.service.cli.operation.OperationManager; +import org.apache.hive.service.rpc.thrift.TProtocolVersion; +import org.apache.hive.service.server.HiveServer2; +import org.apache.hive.service.server.ThreadFactoryWithGarbageCleanup; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * SessionManager. + * + */ +public class SessionManager extends CompositeService { + + private static final Logger LOG = LoggerFactory.getLogger(SessionManager.class); + public static final String HIVERCFILE = ".hiverc"; + private HiveConf hiveConf; + private final Map handleToSession = + new ConcurrentHashMap(); + private final OperationManager operationManager = new OperationManager(); + private ThreadPoolExecutor backgroundOperationPool; + private boolean isOperationLogEnabled; + private File operationLogRootDir; + + private long checkInterval; + private long sessionTimeout; + private boolean checkOperation; + + private volatile boolean shutdown; + // The HiveServer2 instance running this service + private final HiveServer2 hiveServer2; + + public SessionManager(HiveServer2 hiveServer2) { + super(SessionManager.class.getSimpleName()); + this.hiveServer2 = hiveServer2; + } + + @Override + public synchronized void init(HiveConf hiveConf) { + this.hiveConf = hiveConf; + //Create operation log root directory, if operation logging is enabled + if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED)) { + initOperationLogRootDir(); + } + createBackgroundOperationPool(); + addService(operationManager); + super.init(hiveConf); + } + + private void createBackgroundOperationPool() { + int poolSize = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_ASYNC_EXEC_THREADS); + LOG.info("HiveServer2: Background operation thread pool size: " + poolSize); + int poolQueueSize = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_ASYNC_EXEC_WAIT_QUEUE_SIZE); + LOG.info("HiveServer2: Background operation thread wait queue size: " + poolQueueSize); + long keepAliveTime = HiveConf.getTimeVar( + hiveConf, ConfVars.HIVE_SERVER2_ASYNC_EXEC_KEEPALIVE_TIME, TimeUnit.SECONDS); + LOG.info( + "HiveServer2: Background operation thread keepalive time: " + keepAliveTime + " seconds"); + + // Create a thread pool with #poolSize threads + // Threads terminate when they are idle for more than the keepAliveTime + // A bounded blocking queue is used to queue incoming operations, if #operations > poolSize + String threadPoolName = "HiveServer2-Background-Pool"; + backgroundOperationPool = new ThreadPoolExecutor(poolSize, poolSize, + keepAliveTime, TimeUnit.SECONDS, new LinkedBlockingQueue(poolQueueSize), + new ThreadFactoryWithGarbageCleanup(threadPoolName)); + backgroundOperationPool.allowCoreThreadTimeOut(true); + + checkInterval = HiveConf.getTimeVar( + hiveConf, ConfVars.HIVE_SERVER2_SESSION_CHECK_INTERVAL, TimeUnit.MILLISECONDS); + sessionTimeout = HiveConf.getTimeVar( + hiveConf, ConfVars.HIVE_SERVER2_IDLE_SESSION_TIMEOUT, TimeUnit.MILLISECONDS); + checkOperation = HiveConf.getBoolVar(hiveConf, + ConfVars.HIVE_SERVER2_IDLE_SESSION_CHECK_OPERATION); + } + + private void initOperationLogRootDir() { + operationLogRootDir = new File( + hiveConf.getVar(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LOG_LOCATION)); + isOperationLogEnabled = true; + + if (operationLogRootDir.exists() && !operationLogRootDir.isDirectory()) { + LOG.warn("The operation log root directory exists, but it is not a directory: " + + operationLogRootDir.getAbsolutePath()); + isOperationLogEnabled = false; + } + + if (!operationLogRootDir.exists()) { + if (!operationLogRootDir.mkdirs()) { + LOG.warn("Unable to create operation log root directory: " + + operationLogRootDir.getAbsolutePath()); + isOperationLogEnabled = false; + } + } + + if (isOperationLogEnabled) { + LOG.info("Operation log root directory is created: " + operationLogRootDir.getAbsolutePath()); + try { + FileUtils.forceDeleteOnExit(operationLogRootDir); + } catch (IOException e) { + LOG.warn("Failed to schedule cleanup HS2 operation logging root dir: " + + operationLogRootDir.getAbsolutePath(), e); + } + } + } + + @Override + public synchronized void start() { + super.start(); + if (checkInterval > 0) { + startTimeoutChecker(); + } + } + + private final Object timeoutCheckerLock = new Object(); + + private void startTimeoutChecker() { + final long interval = Math.max(checkInterval, 3000L); // minimum 3 seconds + final Runnable timeoutChecker = new Runnable() { + @Override + public void run() { + sleepFor(interval); + while (!shutdown) { + long current = System.currentTimeMillis(); + for (HiveSession session : new ArrayList(handleToSession.values())) { + if (shutdown) { + break; + } + if (sessionTimeout > 0 && session.getLastAccessTime() + sessionTimeout <= current + && (!checkOperation || session.getNoOperationTime() > sessionTimeout)) { + SessionHandle handle = session.getSessionHandle(); + LOG.warn("Session " + handle + " is Timed-out (last access : " + + new Date(session.getLastAccessTime()) + ") and will be closed"); + try { + closeSession(handle); + } catch (HiveSQLException e) { + LOG.warn("Exception is thrown closing session " + handle, e); + } + } else { + session.closeExpiredOperations(); + } + } + sleepFor(interval); + } + } + + private void sleepFor(long interval) { + synchronized (timeoutCheckerLock) { + try { + timeoutCheckerLock.wait(interval); + } catch (InterruptedException e) { + // Ignore, and break. + } + } + } + }; + backgroundOperationPool.execute(timeoutChecker); + } + + private void shutdownTimeoutChecker() { + shutdown = true; + synchronized (timeoutCheckerLock) { + timeoutCheckerLock.notify(); + } + } + + @Override + public synchronized void stop() { + super.stop(); + shutdownTimeoutChecker(); + if (backgroundOperationPool != null) { + backgroundOperationPool.shutdown(); + long timeout = hiveConf.getTimeVar( + ConfVars.HIVE_SERVER2_ASYNC_EXEC_SHUTDOWN_TIMEOUT, TimeUnit.SECONDS); + try { + backgroundOperationPool.awaitTermination(timeout, TimeUnit.SECONDS); + } catch (InterruptedException e) { + LOG.warn("HIVE_SERVER2_ASYNC_EXEC_SHUTDOWN_TIMEOUT = " + timeout + + " seconds has been exceeded. RUNNING background operations will be shut down", e); + } + backgroundOperationPool = null; + } + cleanupLoggingRootDir(); + } + + private void cleanupLoggingRootDir() { + if (isOperationLogEnabled) { + try { + FileUtils.forceDelete(operationLogRootDir); + } catch (Exception e) { + LOG.warn("Failed to cleanup root dir of HS2 logging: " + operationLogRootDir + .getAbsolutePath(), e); + } + } + } + + public SessionHandle openSession(TProtocolVersion protocol, String username, String password, String ipAddress, + Map sessionConf) throws HiveSQLException { + return openSession(protocol, username, password, ipAddress, sessionConf, false, null); + } + + /** + * Opens a new session and creates a session handle. + * The username passed to this method is the effective username. + * If withImpersonation is true (==doAs true) we wrap all the calls in HiveSession + * within a UGI.doAs, where UGI corresponds to the effective user. + * + * Please see {@code org.apache.hive.service.cli.thrift.ThriftCLIService.getUserName()} for + * more details. + * + * @param protocol + * @param username + * @param password + * @param ipAddress + * @param sessionConf + * @param withImpersonation + * @param delegationToken + * @return + * @throws HiveSQLException + */ + public SessionHandle openSession(TProtocolVersion protocol, String username, String password, String ipAddress, + Map sessionConf, boolean withImpersonation, String delegationToken) + throws HiveSQLException { + HiveSession session; + // If doAs is set to true for HiveServer2, we will create a proxy object for the session impl. + // Within the proxy object, we wrap the method call in a UserGroupInformation#doAs + if (withImpersonation) { + HiveSessionImplwithUGI sessionWithUGI = new HiveSessionImplwithUGI(protocol, username, password, + hiveConf, ipAddress, delegationToken); + session = HiveSessionProxy.getProxy(sessionWithUGI, sessionWithUGI.getSessionUgi()); + sessionWithUGI.setProxySession(session); + } else { + session = new HiveSessionImpl(protocol, username, password, hiveConf, ipAddress); + } + session.setSessionManager(this); + session.setOperationManager(operationManager); + try { + session.open(sessionConf); + } catch (Exception e) { + try { + session.close(); + } catch (Throwable t) { + LOG.warn("Error closing session", t); + } + session = null; + throw new HiveSQLException("Failed to open new session: " + e, e); + } + if (isOperationLogEnabled) { + session.setOperationLogSessionDir(operationLogRootDir); + } + handleToSession.put(session.getSessionHandle(), session); + return session.getSessionHandle(); + } + + public void closeSession(SessionHandle sessionHandle) throws HiveSQLException { + HiveSession session = handleToSession.remove(sessionHandle); + if (session == null) { + throw new HiveSQLException("Session does not exist!"); + } + session.close(); + } + + public HiveSession getSession(SessionHandle sessionHandle) throws HiveSQLException { + HiveSession session = handleToSession.get(sessionHandle); + if (session == null) { + throw new HiveSQLException("Invalid SessionHandle: " + sessionHandle); + } + return session; + } + + public OperationManager getOperationManager() { + return operationManager; + } + + private static ThreadLocal threadLocalIpAddress = new ThreadLocal() { + @Override + protected synchronized String initialValue() { + return null; + } + }; + + public static void setIpAddress(String ipAddress) { + threadLocalIpAddress.set(ipAddress); + } + + public static void clearIpAddress() { + threadLocalIpAddress.remove(); + } + + public static String getIpAddress() { + return threadLocalIpAddress.get(); + } + + private static ThreadLocal threadLocalUserName = new ThreadLocal(){ + @Override + protected synchronized String initialValue() { + return null; + } + }; + + public static void setUserName(String userName) { + threadLocalUserName.set(userName); + } + + public static void clearUserName() { + threadLocalUserName.remove(); + } + + public static String getUserName() { + return threadLocalUserName.get(); + } + + private static ThreadLocal threadLocalProxyUserName = new ThreadLocal(){ + @Override + protected synchronized String initialValue() { + return null; + } + }; + + public static void setProxyUserName(String userName) { + LOG.debug("setting proxy user name based on query param to: " + userName); + threadLocalProxyUserName.set(userName); + } + + public static String getProxyUserName() { + return threadLocalProxyUserName.get(); + } + + public static void clearProxyUserName() { + threadLocalProxyUserName.remove(); + } + + public Future submitBackgroundOperation(Runnable r) { + return backgroundOperationPool.submit(r); + } + + public int getOpenSessionCount() { + return handleToSession.size(); + } +} + diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java new file mode 100644 index 0000000000000..8085c8d12e6b2 --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java @@ -0,0 +1,145 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli.thrift; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.SynchronousQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import org.apache.hadoop.hive.common.auth.HiveAuthUtils; +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.conf.HiveConf.ConfVars; +import org.apache.hadoop.hive.shims.ShimLoader; +import org.apache.hive.service.ServiceException; +import org.apache.hive.service.auth.HiveAuthFactory; +import org.apache.hive.service.cli.CLIService; +import org.apache.hive.service.cli.HiveSQLException; +import org.apache.hive.service.rpc.thrift.TGetQueryIdReq; +import org.apache.hive.service.rpc.thrift.TGetQueryIdResp; +import org.apache.hive.service.server.ThreadFactoryWithGarbageCleanup; +import org.apache.thrift.TException; +import org.apache.thrift.TProcessorFactory; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.server.TServer; +import org.apache.thrift.server.TThreadPoolServer; +import org.apache.thrift.transport.TServerSocket; +import org.apache.thrift.transport.TTransportFactory; + + +public class ThriftBinaryCLIService extends ThriftCLIService { + + protected TServer server; + + public ThriftBinaryCLIService(CLIService cliService) { + super(cliService, ThriftBinaryCLIService.class.getSimpleName()); + } + + @Override + protected void initializeServer() { + try { + // Server thread pool + String threadPoolName = "HiveServer2-Handler-Pool"; + ExecutorService executorService = new ThreadPoolExecutor(minWorkerThreads, maxWorkerThreads, + workerKeepAliveTime, TimeUnit.SECONDS, new SynchronousQueue(), + new ThreadFactoryWithGarbageCleanup(threadPoolName)); + + // Thrift configs + hiveAuthFactory = new HiveAuthFactory(hiveConf); + TTransportFactory transportFactory = hiveAuthFactory.getAuthTransFactory(); + TProcessorFactory processorFactory = hiveAuthFactory.getAuthProcFactory(this); + TServerSocket serverSocket = null; + List sslVersionBlacklist = new ArrayList(); + for (String sslVersion : hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(",")) { + sslVersionBlacklist.add(sslVersion); + } + if (!hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_USE_SSL)) { + serverSocket = HiveAuthUtils.getServerSocket(hiveHost, portNum); + } else { + String keyStorePath = hiveConf.getVar(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH).trim(); + if (keyStorePath.isEmpty()) { + throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname + + " Not configured for SSL connection"); + } + String keyStorePassword = ShimLoader.getHadoopShims().getPassword(hiveConf, + HiveConf.ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname); + serverSocket = HiveAuthUtils.getServerSSLSocket(hiveHost, portNum, keyStorePath, + keyStorePassword, sslVersionBlacklist); + } + + // In case HIVE_SERVER2_THRIFT_PORT or hive.server2.thrift.port is configured with 0 which + // represents any free port, we should set it to the actual one + portNum = serverSocket.getServerSocket().getLocalPort(); + + // Server args + int maxMessageSize = hiveConf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_MAX_MESSAGE_SIZE); + int requestTimeout = (int) hiveConf.getTimeVar( + HiveConf.ConfVars.HIVE_SERVER2_THRIFT_LOGIN_TIMEOUT, TimeUnit.SECONDS); + int beBackoffSlotLength = (int) hiveConf.getTimeVar( + HiveConf.ConfVars.HIVE_SERVER2_THRIFT_LOGIN_BEBACKOFF_SLOT_LENGTH, TimeUnit.MILLISECONDS); + TThreadPoolServer.Args sargs = new TThreadPoolServer.Args(serverSocket) + .processorFactory(processorFactory).transportFactory(transportFactory) + .protocolFactory(new TBinaryProtocol.Factory()) + .inputProtocolFactory(new TBinaryProtocol.Factory(true, true, maxMessageSize, maxMessageSize)) + .requestTimeout(requestTimeout).requestTimeoutUnit(TimeUnit.SECONDS) + .beBackoffSlotLength(beBackoffSlotLength).beBackoffSlotLengthUnit(TimeUnit.MILLISECONDS) + .executorService(executorService); + + // TCP Server + server = new TThreadPoolServer(sargs); + server.setServerEventHandler(serverEventHandler); + String msg = "Starting " + ThriftBinaryCLIService.class.getSimpleName() + " on port " + + portNum + " with " + minWorkerThreads + "..." + maxWorkerThreads + " worker threads"; + LOG.info(msg); + } catch (Exception t) { + throw new ServiceException("Error initializing " + getName(), t); + } + } + + @Override + protected void stopServer() { + server.stop(); + server = null; + LOG.info("Thrift server has stopped"); + } + + @Override + public TGetQueryIdResp GetQueryId(TGetQueryIdReq req) throws TException { + try { + return new TGetQueryIdResp(cliService.getQueryId(req.getOperationHandle())); + } catch (HiveSQLException e) { + throw new TException(e); + } + } + + @Override + public void run() { + try { + server.serve(); + } catch (Throwable t) { + LOG.error( + "Error starting HiveServer2: could not start " + + ThriftBinaryCLIService.class.getSimpleName(), t); + System.exit(-1); + } + } + +} diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java new file mode 100644 index 0000000000000..a65951c8aec2e --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java @@ -0,0 +1,756 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli.thrift; + +import javax.security.auth.login.LoginException; +import java.io.IOException; +import java.net.InetAddress; +import java.net.UnknownHostException; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.conf.HiveConf.ConfVars; +import org.apache.hive.service.AbstractService; +import org.apache.hive.service.ServiceException; +import org.apache.hive.service.ServiceUtils; +import org.apache.hive.service.auth.HiveAuthFactory; +import org.apache.hive.service.auth.TSetIpAddressProcessor; +import org.apache.hive.service.cli.*; +import org.apache.hive.service.cli.session.SessionManager; +import org.apache.hive.service.rpc.thrift.*; +import org.apache.hive.service.server.HiveServer2; +import org.apache.thrift.TException; +import org.apache.thrift.protocol.TProtocol; +import org.apache.thrift.server.ServerContext; +import org.apache.thrift.server.TServerEventHandler; +import org.apache.thrift.transport.TTransport; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * ThriftCLIService. + * + */ +public abstract class ThriftCLIService extends AbstractService implements TCLIService.Iface, Runnable { + + public static final Logger LOG = LoggerFactory.getLogger(ThriftCLIService.class.getName()); + + protected CLIService cliService; + private static final TStatus OK_STATUS = new TStatus(TStatusCode.SUCCESS_STATUS); + protected static HiveAuthFactory hiveAuthFactory; + + protected int portNum; + protected InetAddress serverIPAddress; + protected String hiveHost; + private Thread serverThread = null; + + private boolean isStarted = false; + protected boolean isEmbedded = false; + + protected HiveConf hiveConf; + + protected int minWorkerThreads; + protected int maxWorkerThreads; + protected long workerKeepAliveTime; + + protected TServerEventHandler serverEventHandler; + protected ThreadLocal currentServerContext; + + static class ThriftCLIServerContext implements ServerContext { + private SessionHandle sessionHandle = null; + + public void setSessionHandle(SessionHandle sessionHandle) { + this.sessionHandle = sessionHandle; + } + + public SessionHandle getSessionHandle() { + return sessionHandle; + } + } + + public ThriftCLIService(CLIService service, String serviceName) { + super(serviceName); + this.cliService = service; + currentServerContext = new ThreadLocal(); + serverEventHandler = new TServerEventHandler() { + @Override + public ServerContext createContext( + TProtocol input, TProtocol output) { + return new ThriftCLIServerContext(); + } + + @Override + public void deleteContext(ServerContext serverContext, + TProtocol input, TProtocol output) { + ThriftCLIServerContext context = (ThriftCLIServerContext)serverContext; + SessionHandle sessionHandle = context.getSessionHandle(); + if (sessionHandle != null) { + LOG.info("Session disconnected without closing properly, close it now"); + try { + cliService.closeSession(sessionHandle); + } catch (HiveSQLException e) { + LOG.warn("Failed to close session: " + e, e); + } + } + } + + @Override + public void preServe() { + } + + @Override + public void processContext(ServerContext serverContext, + TTransport input, TTransport output) { + currentServerContext.set(serverContext); + } + }; + } + + @Override + public synchronized void init(HiveConf hiveConf) { + this.hiveConf = hiveConf; + // Initialize common server configs needed in both binary & http modes + String portString; + hiveHost = System.getenv("HIVE_SERVER2_THRIFT_BIND_HOST"); + if (hiveHost == null) { + hiveHost = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST); + } + try { + if (hiveHost != null && !hiveHost.isEmpty()) { + serverIPAddress = InetAddress.getByName(hiveHost); + } else { + serverIPAddress = InetAddress.getLocalHost(); + } + } catch (UnknownHostException e) { + throw new ServiceException(e); + } + // HTTP mode + if (HiveServer2.isHTTPTransportMode(hiveConf)) { + workerKeepAliveTime = + hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_WORKER_KEEPALIVE_TIME, + TimeUnit.SECONDS); + portString = System.getenv("HIVE_SERVER2_THRIFT_HTTP_PORT"); + if (portString != null) { + portNum = Integer.valueOf(portString); + } else { + portNum = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT); + } + } + // Binary mode + else { + workerKeepAliveTime = + hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_WORKER_KEEPALIVE_TIME, TimeUnit.SECONDS); + portString = System.getenv("HIVE_SERVER2_THRIFT_PORT"); + if (portString != null) { + portNum = Integer.valueOf(portString); + } else { + portNum = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_PORT); + } + } + minWorkerThreads = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_MIN_WORKER_THREADS); + maxWorkerThreads = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_MAX_WORKER_THREADS); + super.init(hiveConf); + } + + @Override + public synchronized void start() { + super.start(); + if (!isStarted && !isEmbedded) { + initializeServer(); + serverThread = new Thread(this); + serverThread.setName(getName()); + serverThread.start(); + isStarted = true; + } + } + + protected abstract void stopServer(); + + @Override + public synchronized void stop() { + if (isStarted && !isEmbedded) { + if (serverThread != null) { + serverThread.interrupt(); + serverThread = null; + } + stopServer(); + isStarted = false; + } + super.stop(); + } + + public int getPortNumber() { + return portNum; + } + + public InetAddress getServerIPAddress() { + return serverIPAddress; + } + + @Override + public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) + throws TException { + TGetDelegationTokenResp resp = new TGetDelegationTokenResp(); + resp.setStatus(notSupportTokenErrorStatus()); + return resp; + } + + @Override + public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) + throws TException { + TCancelDelegationTokenResp resp = new TCancelDelegationTokenResp(); + resp.setStatus(notSupportTokenErrorStatus()); + return resp; + } + + @Override + public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) + throws TException { + TRenewDelegationTokenResp resp = new TRenewDelegationTokenResp(); + resp.setStatus(notSupportTokenErrorStatus()); + return resp; + } + + private TStatus notSupportTokenErrorStatus() { + TStatus errorStatus = new TStatus(TStatusCode.ERROR_STATUS); + errorStatus.setErrorMessage("Delegation token is not supported"); + return errorStatus; + } + + @Override + public TOpenSessionResp OpenSession(TOpenSessionReq req) throws TException { + LOG.info("Client protocol version: " + req.getClient_protocol()); + TOpenSessionResp resp = new TOpenSessionResp(); + try { + SessionHandle sessionHandle = getSessionHandle(req, resp); + resp.setSessionHandle(sessionHandle.toTSessionHandle()); + // TODO: set real configuration map + resp.setConfiguration(new HashMap()); + resp.setStatus(OK_STATUS); + ThriftCLIServerContext context = + (ThriftCLIServerContext)currentServerContext.get(); + if (context != null) { + context.setSessionHandle(sessionHandle); + } + } catch (Exception e) { + LOG.warn("Error opening session: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TSetClientInfoResp SetClientInfo(TSetClientInfoReq req) throws TException { + // TODO: We don't do anything for now, just log this for debugging. + // We may be able to make use of this later, e.g. for workload management. + if (req.isSetConfiguration()) { + StringBuilder sb = null; + for (Map.Entry e : req.getConfiguration().entrySet()) { + if (sb == null) { + SessionHandle sh = new SessionHandle(req.getSessionHandle()); + sb = new StringBuilder("Client information for ").append(sh).append(": "); + } else { + sb.append(", "); + } + sb.append(e.getKey()).append(" = ").append(e.getValue()); + } + if (sb != null) { + LOG.info("{}", sb); + } + } + return new TSetClientInfoResp(OK_STATUS); + } + + private String getIpAddress() { + String clientIpAddress; + // Http transport mode. + // We set the thread local ip address, in ThriftHttpServlet. + if (cliService.getHiveConf().getVar( + ConfVars.HIVE_SERVER2_TRANSPORT_MODE).equalsIgnoreCase("http")) { + clientIpAddress = SessionManager.getIpAddress(); + } + else { + // Kerberos + if (isKerberosAuthMode()) { + clientIpAddress = hiveAuthFactory.getIpAddress(); + } + // Except kerberos, NOSASL + else { + clientIpAddress = TSetIpAddressProcessor.getUserIpAddress(); + } + } + LOG.debug("Client's IP Address: " + clientIpAddress); + return clientIpAddress; + } + + /** + * Returns the effective username. + * 1. If hive.server2.allow.user.substitution = false: the username of the connecting user + * 2. If hive.server2.allow.user.substitution = true: the username of the end user, + * that the connecting user is trying to proxy for. + * This includes a check whether the connecting user is allowed to proxy for the end user. + * @param req + * @return + * @throws HiveSQLException + */ + private String getUserName(TOpenSessionReq req) throws HiveSQLException { + String userName = null; + // Kerberos + if (isKerberosAuthMode()) { + userName = hiveAuthFactory.getRemoteUser(); + } + // Except kerberos, NOSASL + if (userName == null) { + userName = TSetIpAddressProcessor.getUserName(); + } + // Http transport mode. + // We set the thread local username, in ThriftHttpServlet. + if (cliService.getHiveConf().getVar( + ConfVars.HIVE_SERVER2_TRANSPORT_MODE).equalsIgnoreCase("http")) { + userName = SessionManager.getUserName(); + } + if (userName == null) { + userName = req.getUsername(); + } + + userName = getShortName(userName); + String effectiveClientUser = getProxyUser(userName, req.getConfiguration(), getIpAddress()); + LOG.debug("Client's username: " + effectiveClientUser); + return effectiveClientUser; + } + + private String getShortName(String userName) { + String ret = null; + if (userName != null) { + int indexOfDomainMatch = ServiceUtils.indexOfDomainMatch(userName); + ret = (indexOfDomainMatch <= 0) ? userName : + userName.substring(0, indexOfDomainMatch); + } + + return ret; + } + + /** + * Create a session handle + * @param req + * @param res + * @return + * @throws HiveSQLException + * @throws LoginException + * @throws IOException + */ + SessionHandle getSessionHandle(TOpenSessionReq req, TOpenSessionResp res) + throws HiveSQLException, LoginException, IOException { + String userName = getUserName(req); + String ipAddress = getIpAddress(); + TProtocolVersion protocol = getMinVersion(CLIService.SERVER_VERSION, + req.getClient_protocol()); + res.setServerProtocolVersion(protocol); + SessionHandle sessionHandle; + if (cliService.getHiveConf().getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS) && + (userName != null)) { + String delegationTokenStr = getDelegationToken(userName); + sessionHandle = cliService.openSessionWithImpersonation(protocol, userName, + req.getPassword(), ipAddress, req.getConfiguration(), delegationTokenStr); + } else { + sessionHandle = cliService.openSession(protocol, userName, req.getPassword(), + ipAddress, req.getConfiguration()); + } + return sessionHandle; + } + + + private String getDelegationToken(String userName) + throws HiveSQLException, LoginException, IOException { + if (userName == null || !cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) + .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString())) { + return null; + } + try { + return cliService.getDelegationTokenFromMetaStore(userName); + } catch (UnsupportedOperationException e) { + // The delegation token is not applicable in the given deployment mode + } + return null; + } + + private TProtocolVersion getMinVersion(TProtocolVersion... versions) { + TProtocolVersion[] values = TProtocolVersion.values(); + int current = values[values.length - 1].getValue(); + for (TProtocolVersion version : versions) { + if (current > version.getValue()) { + current = version.getValue(); + } + } + for (TProtocolVersion version : values) { + if (version.getValue() == current) { + return version; + } + } + throw new IllegalArgumentException("never"); + } + + @Override + public TCloseSessionResp CloseSession(TCloseSessionReq req) throws TException { + TCloseSessionResp resp = new TCloseSessionResp(); + try { + SessionHandle sessionHandle = new SessionHandle(req.getSessionHandle()); + cliService.closeSession(sessionHandle); + resp.setStatus(OK_STATUS); + ThriftCLIServerContext context = + (ThriftCLIServerContext)currentServerContext.get(); + if (context != null) { + context.setSessionHandle(null); + } + } catch (Exception e) { + LOG.warn("Error closing session: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetInfoResp GetInfo(TGetInfoReq req) throws TException { + TGetInfoResp resp = new TGetInfoResp(); + try { + GetInfoValue getInfoValue = + cliService.getInfo(new SessionHandle(req.getSessionHandle()), + GetInfoType.getGetInfoType(req.getInfoType())); + resp.setInfoValue(getInfoValue.toTGetInfoValue()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting info: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws TException { + TExecuteStatementResp resp = new TExecuteStatementResp(); + try { + SessionHandle sessionHandle = new SessionHandle(req.getSessionHandle()); + String statement = req.getStatement(); + Map confOverlay = req.getConfOverlay(); + Boolean runAsync = req.isRunAsync(); + long queryTimeout = req.getQueryTimeout(); + OperationHandle operationHandle = runAsync ? + cliService.executeStatementAsync(sessionHandle, statement, confOverlay, queryTimeout) + : cliService.executeStatement(sessionHandle, statement, confOverlay, queryTimeout); + resp.setOperationHandle(operationHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error executing statement: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws TException { + TGetTypeInfoResp resp = new TGetTypeInfoResp(); + try { + OperationHandle operationHandle = cliService.getTypeInfo(new SessionHandle(req.getSessionHandle())); + resp.setOperationHandle(operationHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting type info: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws TException { + TGetCatalogsResp resp = new TGetCatalogsResp(); + try { + OperationHandle opHandle = cliService.getCatalogs(new SessionHandle(req.getSessionHandle())); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting catalogs: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws TException { + TGetSchemasResp resp = new TGetSchemasResp(); + try { + OperationHandle opHandle = cliService.getSchemas( + new SessionHandle(req.getSessionHandle()), req.getCatalogName(), req.getSchemaName()); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting schemas: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetTablesResp GetTables(TGetTablesReq req) throws TException { + TGetTablesResp resp = new TGetTablesResp(); + try { + OperationHandle opHandle = cliService + .getTables(new SessionHandle(req.getSessionHandle()), req.getCatalogName(), + req.getSchemaName(), req.getTableName(), req.getTableTypes()); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting tables: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws TException { + TGetTableTypesResp resp = new TGetTableTypesResp(); + try { + OperationHandle opHandle = cliService.getTableTypes(new SessionHandle(req.getSessionHandle())); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting table types: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetColumnsResp GetColumns(TGetColumnsReq req) throws TException { + TGetColumnsResp resp = new TGetColumnsResp(); + try { + OperationHandle opHandle = cliService.getColumns( + new SessionHandle(req.getSessionHandle()), + req.getCatalogName(), + req.getSchemaName(), + req.getTableName(), + req.getColumnName()); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting columns: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws TException { + TGetFunctionsResp resp = new TGetFunctionsResp(); + try { + OperationHandle opHandle = cliService.getFunctions( + new SessionHandle(req.getSessionHandle()), req.getCatalogName(), + req.getSchemaName(), req.getFunctionName()); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting functions: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws TException { + TGetOperationStatusResp resp = new TGetOperationStatusResp(); + try { + OperationStatus operationStatus = cliService.getOperationStatus( + new OperationHandle(req.getOperationHandle())); + resp.setOperationState(operationStatus.getState().toTOperationState()); + HiveSQLException opException = operationStatus.getOperationException(); + if (opException != null) { + resp.setSqlState(opException.getSQLState()); + resp.setErrorCode(opException.getErrorCode()); + resp.setErrorMessage(org.apache.hadoop.util.StringUtils + .stringifyException(opException)); + } + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting operation status: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException { + TCancelOperationResp resp = new TCancelOperationResp(); + try { + cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error cancelling operation: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws TException { + TCloseOperationResp resp = new TCloseOperationResp(); + try { + cliService.closeOperation(new OperationHandle(req.getOperationHandle())); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error closing operation: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) + throws TException { + TGetResultSetMetadataResp resp = new TGetResultSetMetadataResp(); + try { + TableSchema schema = cliService.getResultSetMetadata(new OperationHandle(req.getOperationHandle())); + resp.setSchema(schema.toTTableSchema()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting result set metadata: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TFetchResultsResp FetchResults(TFetchResultsReq req) throws TException { + TFetchResultsResp resp = new TFetchResultsResp(); + try { + RowSet rowSet = cliService.fetchResults( + new OperationHandle(req.getOperationHandle()), + FetchOrientation.getFetchOrientation(req.getOrientation()), + req.getMaxRows(), + FetchType.getFetchType(req.getFetchType())); + resp.setResults(rowSet.toTRowSet()); + resp.setHasMoreRows(false); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error fetching results: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req) + throws TException { + TGetPrimaryKeysResp resp = new TGetPrimaryKeysResp(); + try { + OperationHandle opHandle = cliService.getPrimaryKeys( + new SessionHandle(req.getSessionHandle()), req.getCatalogName(), + req.getSchemaName(), req.getTableName()); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting primary keys: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + @Override + public TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req) + throws TException { + TGetCrossReferenceResp resp = new TGetCrossReferenceResp(); + try { + OperationHandle opHandle = cliService.getCrossReference( + new SessionHandle(req.getSessionHandle()), req.getParentCatalogName(), + req.getParentSchemaName(), req.getParentTableName(), + req.getForeignCatalogName(), req.getForeignSchemaName(), req.getForeignTableName()); + resp.setOperationHandle(opHandle.toTOperationHandle()); + resp.setStatus(OK_STATUS); + } catch (Exception e) { + LOG.warn("Error getting cross reference: ", e); + resp.setStatus(HiveSQLException.toTStatus(e)); + } + return resp; + } + + protected abstract void initializeServer(); + + @Override + public TGetQueryIdResp GetQueryId(TGetQueryIdReq req) throws TException { + try { + return new TGetQueryIdResp(cliService.getQueryId(req.getOperationHandle())); + } catch (HiveSQLException e) { + throw new TException(e); + } + } + + @Override + public abstract void run(); + + /** + * If the proxy user name is provided then check privileges to substitute the user. + * @param realUser + * @param sessionConf + * @param ipAddress + * @return + * @throws HiveSQLException + */ + private String getProxyUser(String realUser, Map sessionConf, + String ipAddress) throws HiveSQLException { + String proxyUser = null; + // Http transport mode. + // We set the thread local proxy username, in ThriftHttpServlet. + if (cliService.getHiveConf().getVar( + ConfVars.HIVE_SERVER2_TRANSPORT_MODE).equalsIgnoreCase("http")) { + proxyUser = SessionManager.getProxyUserName(); + LOG.debug("Proxy user from query string: " + proxyUser); + } + + if (proxyUser == null && sessionConf != null && sessionConf.containsKey(HiveAuthFactory.HS2_PROXY_USER)) { + String proxyUserFromThriftBody = sessionConf.get(HiveAuthFactory.HS2_PROXY_USER); + LOG.debug("Proxy user from thrift body: " + proxyUserFromThriftBody); + proxyUser = proxyUserFromThriftBody; + } + + if (proxyUser == null) { + return realUser; + } + + // check whether substitution is allowed + if (!hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ALLOW_USER_SUBSTITUTION)) { + throw new HiveSQLException("Proxy user substitution is not allowed"); + } + + // If there's no authentication, then directly substitute the user + if (HiveAuthFactory.AuthTypes.NONE.toString() + .equalsIgnoreCase(hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION))) { + return proxyUser; + } + + // Verify proxy user privilege of the realUser for the proxyUser + HiveAuthFactory.verifyProxyAccess(realUser, proxyUser, ipAddress, hiveConf); + LOG.debug("Verified proxy user: " + proxyUser); + return proxyUser; + } + + private boolean isKerberosAuthMode() { + return cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) + .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); + } +} diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java new file mode 100644 index 0000000000000..0e81e4446caac --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java @@ -0,0 +1,502 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli.thrift; + +import java.util.List; +import java.util.Map; + +import org.apache.hive.service.auth.HiveAuthFactory; +import org.apache.hive.service.cli.*; +import org.apache.hive.service.rpc.thrift.*; +import org.apache.thrift.TException; + +/** + * ThriftCLIServiceClient. + * + */ +public class ThriftCLIServiceClient extends CLIServiceClient { + private final TCLIService.Iface cliService; + + public ThriftCLIServiceClient(TCLIService.Iface cliService) { + this.cliService = cliService; + } + + public void checkStatus(TStatus status) throws HiveSQLException { + if (TStatusCode.ERROR_STATUS.equals(status.getStatusCode())) { + throw new HiveSQLException(status); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map) + */ + @Override + public SessionHandle openSession(String username, String password, + Map configuration) + throws HiveSQLException { + try { + TOpenSessionReq req = new TOpenSessionReq(); + req.setUsername(username); + req.setPassword(password); + req.setConfiguration(configuration); + TOpenSessionResp resp = cliService.OpenSession(req); + checkStatus(resp.getStatus()); + return new SessionHandle(resp.getSessionHandle(), resp.getServerProtocolVersion()); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#closeSession(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public SessionHandle openSessionWithImpersonation(String username, String password, + Map configuration, String delegationToken) throws HiveSQLException { + throw new HiveSQLException("open with impersonation operation is not supported in the client"); + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#closeSession(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public void closeSession(SessionHandle sessionHandle) throws HiveSQLException { + try { + TCloseSessionReq req = new TCloseSessionReq(sessionHandle.toTSessionHandle()); + TCloseSessionResp resp = cliService.CloseSession(req); + checkStatus(resp.getStatus()); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getInfo(org.apache.hive.service.cli.SessionHandle, java.util.List) + */ + @Override + public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) + throws HiveSQLException { + try { + // FIXME extract the right info type + TGetInfoReq req = new TGetInfoReq(sessionHandle.toTSessionHandle(), infoType.toTGetInfoType()); + TGetInfoResp resp = cliService.GetInfo(req); + checkStatus(resp.getStatus()); + return new GetInfoValue(resp.getInfoValue()); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#executeStatement(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.util.Map) + */ + @Override + public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, + Map confOverlay) throws HiveSQLException { + return executeStatementInternal(sessionHandle, statement, confOverlay, false, 0); + } + + @Override + public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, + Map confOverlay, long queryTimeout) throws HiveSQLException { + return executeStatementInternal(sessionHandle, statement, confOverlay, false, queryTimeout); + } + + @Override + public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, + Map confOverlay) throws HiveSQLException { + return executeStatementInternal(sessionHandle, statement, confOverlay, true, 0); + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#executeStatementAsync(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.util.Map) + */ + @Override + public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, + Map confOverlay, long queryTimeout) throws HiveSQLException { + return executeStatementInternal(sessionHandle, statement, confOverlay, true, queryTimeout); + } + + private OperationHandle executeStatementInternal(SessionHandle sessionHandle, String statement, + Map confOverlay, boolean isAsync, long queryTimeout) throws HiveSQLException { + try { + TExecuteStatementReq req = + new TExecuteStatementReq(sessionHandle.toTSessionHandle(), statement); + req.setConfOverlay(confOverlay); + req.setRunAsync(isAsync); + req.setQueryTimeout(queryTimeout); + TExecuteStatementResp resp = cliService.ExecuteStatement(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getTypeInfo(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public OperationHandle getTypeInfo(SessionHandle sessionHandle) throws HiveSQLException { + try { + TGetTypeInfoReq req = new TGetTypeInfoReq(sessionHandle.toTSessionHandle()); + TGetTypeInfoResp resp = cliService.GetTypeInfo(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getCatalogs(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public OperationHandle getCatalogs(SessionHandle sessionHandle) throws HiveSQLException { + try { + TGetCatalogsReq req = new TGetCatalogsReq(sessionHandle.toTSessionHandle()); + TGetCatalogsResp resp = cliService.GetCatalogs(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getSchemas(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String) + */ + @Override + public OperationHandle getSchemas(SessionHandle sessionHandle, String catalogName, + String schemaName) + throws HiveSQLException { + try { + TGetSchemasReq req = new TGetSchemasReq(sessionHandle.toTSessionHandle()); + req.setCatalogName(catalogName); + req.setSchemaName(schemaName); + TGetSchemasResp resp = cliService.GetSchemas(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getTables(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.util.List) + */ + @Override + public OperationHandle getTables(SessionHandle sessionHandle, String catalogName, + String schemaName, String tableName, List tableTypes) + throws HiveSQLException { + try { + TGetTablesReq req = new TGetTablesReq(sessionHandle.toTSessionHandle()); + req.setTableName(tableName); + req.setTableTypes(tableTypes); + req.setSchemaName(schemaName); + TGetTablesResp resp = cliService.GetTables(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getTableTypes(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public OperationHandle getTableTypes(SessionHandle sessionHandle) throws HiveSQLException { + try { + TGetTableTypesReq req = new TGetTableTypesReq(sessionHandle.toTSessionHandle()); + TGetTableTypesResp resp = cliService.GetTableTypes(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getColumns(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public OperationHandle getColumns(SessionHandle sessionHandle, + String catalogName, String schemaName, String tableName, String columnName) + throws HiveSQLException { + try { + TGetColumnsReq req = new TGetColumnsReq(); + req.setSessionHandle(sessionHandle.toTSessionHandle()); + req.setCatalogName(catalogName); + req.setSchemaName(schemaName); + req.setTableName(tableName); + req.setColumnName(columnName); + TGetColumnsResp resp = cliService.GetColumns(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getFunctions(org.apache.hive.service.cli.SessionHandle) + */ + @Override + public OperationHandle getFunctions(SessionHandle sessionHandle, + String catalogName, String schemaName, String functionName) throws HiveSQLException { + try { + TGetFunctionsReq req = new TGetFunctionsReq(sessionHandle.toTSessionHandle(), functionName); + req.setCatalogName(catalogName); + req.setSchemaName(schemaName); + TGetFunctionsResp resp = cliService.GetFunctions(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getOperationStatus(org.apache.hive.service.cli.OperationHandle) + */ + @Override + public OperationStatus getOperationStatus(OperationHandle opHandle) throws HiveSQLException { + try { + TGetOperationStatusReq req = new TGetOperationStatusReq(opHandle.toTOperationHandle()); + TGetOperationStatusResp resp = cliService.GetOperationStatus(req); + // Checks the status of the RPC call, throws an exception in case of error + checkStatus(resp.getStatus()); + OperationState opState = OperationState.getOperationState(resp.getOperationState()); + HiveSQLException opException = null; + if (opState == OperationState.ERROR) { + opException = new HiveSQLException(resp.getErrorMessage(), resp.getSqlState(), resp.getErrorCode()); + } + return new OperationStatus(opState, opException); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#cancelOperation(org.apache.hive.service.cli.OperationHandle) + */ + @Override + public void cancelOperation(OperationHandle opHandle) throws HiveSQLException { + try { + TCancelOperationReq req = new TCancelOperationReq(opHandle.toTOperationHandle()); + TCancelOperationResp resp = cliService.CancelOperation(req); + checkStatus(resp.getStatus()); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#closeOperation(org.apache.hive.service.cli.OperationHandle) + */ + @Override + public void closeOperation(OperationHandle opHandle) + throws HiveSQLException { + try { + TCloseOperationReq req = new TCloseOperationReq(opHandle.toTOperationHandle()); + TCloseOperationResp resp = cliService.CloseOperation(req); + checkStatus(resp.getStatus()); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#getResultSetMetadata(org.apache.hive.service.cli.OperationHandle) + */ + @Override + public TableSchema getResultSetMetadata(OperationHandle opHandle) + throws HiveSQLException { + try { + TGetResultSetMetadataReq req = new TGetResultSetMetadataReq(opHandle.toTOperationHandle()); + TGetResultSetMetadataResp resp = cliService.GetResultSetMetadata(req); + checkStatus(resp.getStatus()); + return new TableSchema(resp.getSchema()); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + @Override + public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, long maxRows, + FetchType fetchType) throws HiveSQLException { + try { + TFetchResultsReq req = new TFetchResultsReq(); + req.setOperationHandle(opHandle.toTOperationHandle()); + req.setOrientation(orientation.toTFetchOrientation()); + req.setMaxRows(maxRows); + req.setFetchType(fetchType.toTFetchType()); + TFetchResultsResp resp = cliService.FetchResults(req); + checkStatus(resp.getStatus()); + return RowSetFactory.create(resp.getResults(), opHandle.getProtocolVersion()); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + /* (non-Javadoc) + * @see org.apache.hive.service.cli.ICLIService#fetchResults(org.apache.hive.service.cli.OperationHandle) + */ + @Override + public RowSet fetchResults(OperationHandle opHandle) throws HiveSQLException { + // TODO: set the correct default fetch size + return fetchResults(opHandle, FetchOrientation.FETCH_NEXT, 10000, FetchType.QUERY_OUTPUT); + } + + @Override + public String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String owner, String renewer) throws HiveSQLException { + TGetDelegationTokenReq req = new TGetDelegationTokenReq( + sessionHandle.toTSessionHandle(), owner, renewer); + try { + TGetDelegationTokenResp tokenResp = cliService.GetDelegationToken(req); + checkStatus(tokenResp.getStatus()); + return tokenResp.getDelegationToken(); + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + @Override + public void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String tokenStr) throws HiveSQLException { + TCancelDelegationTokenReq cancelReq = new TCancelDelegationTokenReq( + sessionHandle.toTSessionHandle(), tokenStr); + try { + TCancelDelegationTokenResp cancelResp = + cliService.CancelDelegationToken(cancelReq); + checkStatus(cancelResp.getStatus()); + return; + } catch (TException e) { + throw new HiveSQLException(e); + } + } + + @Override + public void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, + String tokenStr) throws HiveSQLException { + TRenewDelegationTokenReq cancelReq = new TRenewDelegationTokenReq( + sessionHandle.toTSessionHandle(), tokenStr); + try { + TRenewDelegationTokenResp renewResp = + cliService.RenewDelegationToken(cancelReq); + checkStatus(renewResp.getStatus()); + return; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + @Override + public OperationHandle getPrimaryKeys(SessionHandle sessionHandle, + String catalog, String schema, String table) throws HiveSQLException { + try { + TGetPrimaryKeysReq req = new TGetPrimaryKeysReq(sessionHandle.toTSessionHandle()); + req.setCatalogName(catalog); + req.setSchemaName(schema); + req.setTableName(table); + TGetPrimaryKeysResp resp = cliService.GetPrimaryKeys(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + @Override + public OperationHandle getCrossReference(SessionHandle sessionHandle, + String primaryCatalog, String primarySchema, String primaryTable, + String foreignCatalog, String foreignSchema, String foreignTable) throws HiveSQLException { + try { + TGetCrossReferenceReq req = new TGetCrossReferenceReq(sessionHandle.toTSessionHandle()); + req.setParentCatalogName(primaryCatalog); + req.setParentSchemaName(primarySchema); + req.setParentTableName(primaryTable); + req.setForeignCatalogName(foreignCatalog); + req.setForeignSchemaName(foreignSchema); + req.setForeignTableName(foreignTable); + TGetCrossReferenceResp resp = cliService.GetCrossReference(req); + checkStatus(resp.getStatus()); + TProtocolVersion protocol = sessionHandle.getProtocolVersion(); + return new OperationHandle(resp.getOperationHandle(), protocol); + } catch (HiveSQLException e) { + throw e; + } catch (Exception e) { + throw new HiveSQLException(e); + } + } + + @Override + public String getQueryId(TOperationHandle operationHandle) throws HiveSQLException { + try { + return cliService.GetQueryId(new TGetQueryIdReq(operationHandle)).getQueryId(); + } catch (TException e) { + throw new HiveSQLException(e); + } + } +} diff --git a/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java new file mode 100644 index 0000000000000..bc568be5d2ebb --- /dev/null +++ b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java @@ -0,0 +1,214 @@ +/** + * 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. + */ + +package org.apache.hive.service.cli.thrift; + +import java.util.Arrays; +import java.util.concurrent.SynchronousQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; + +import org.apache.hadoop.hive.conf.HiveConf; +import org.apache.hadoop.hive.conf.HiveConf.ConfVars; +import org.apache.hadoop.hive.shims.ShimLoader; +import org.apache.hadoop.security.UserGroupInformation; +import org.apache.hadoop.util.Shell; +import org.apache.hive.service.ServiceException; +import org.apache.hive.service.auth.HiveAuthFactory; +import org.apache.hive.service.cli.CLIService; +import org.apache.hive.service.rpc.thrift.TCLIService; +import org.apache.hive.service.rpc.thrift.TCLIService.Iface; +import org.apache.hive.service.server.ThreadFactoryWithGarbageCleanup; +import org.apache.thrift.TProcessor; +import org.apache.thrift.protocol.TBinaryProtocol; +import org.apache.thrift.protocol.TProtocolFactory; +import org.apache.thrift.server.TServlet; +import org.eclipse.jetty.server.AbstractConnectionFactory; +import org.eclipse.jetty.server.ConnectionFactory; +import org.eclipse.jetty.server.HttpConnectionFactory; +import org.eclipse.jetty.server.ServerConnector; +import org.eclipse.jetty.servlet.ServletContextHandler; +import org.eclipse.jetty.servlet.ServletHolder; +import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.eclipse.jetty.util.thread.ExecutorThreadPool; +import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; + + +public class ThriftHttpCLIService extends ThriftCLIService { + + protected org.eclipse.jetty.server.Server httpServer; + + public ThriftHttpCLIService(CLIService cliService) { + super(cliService, ThriftHttpCLIService.class.getSimpleName()); + } + + @Override + protected void initializeServer() { + try { + // Server thread pool + // Start with minWorkerThreads, expand till maxWorkerThreads and reject subsequent requests + String threadPoolName = "HiveServer2-HttpHandler-Pool"; + ThreadPoolExecutor executorService = new ThreadPoolExecutor(minWorkerThreads, maxWorkerThreads, + workerKeepAliveTime, TimeUnit.SECONDS, new SynchronousQueue(), + new ThreadFactoryWithGarbageCleanup(threadPoolName)); + ExecutorThreadPool threadPool = new ExecutorThreadPool(executorService); + + // HTTP Server + httpServer = new org.eclipse.jetty.server.Server(threadPool); + + // Connector configs + + ConnectionFactory[] connectionFactories; + boolean useSsl = hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_USE_SSL); + String schemeName = useSsl ? "https" : "http"; + // Change connector if SSL is used + if (useSsl) { + String keyStorePath = hiveConf.getVar(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH).trim(); + String keyStorePassword = ShimLoader.getHadoopShims().getPassword(hiveConf, + HiveConf.ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname); + if (keyStorePath.isEmpty()) { + throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname + + " Not configured for SSL connection"); + } + SslContextFactory sslContextFactory = new SslContextFactory.Server(); + String[] excludedProtocols = hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(","); + LOG.info("HTTP Server SSL: adding excluded protocols: " + Arrays.toString(excludedProtocols)); + sslContextFactory.addExcludeProtocols(excludedProtocols); + LOG.info("HTTP Server SSL: SslContextFactory.getExcludeProtocols = " + + Arrays.toString(sslContextFactory.getExcludeProtocols())); + sslContextFactory.setKeyStorePath(keyStorePath); + sslContextFactory.setKeyStorePassword(keyStorePassword); + connectionFactories = AbstractConnectionFactory.getFactories( + sslContextFactory, new HttpConnectionFactory()); + } else { + connectionFactories = new ConnectionFactory[] { new HttpConnectionFactory() }; + } + ServerConnector connector = new ServerConnector( + httpServer, + null, + // Call this full constructor to set this, which forces daemon threads: + new ScheduledExecutorScheduler("HiveServer2-HttpHandler-JettyScheduler", true), + null, + -1, + -1, + connectionFactories); + + connector.setPort(portNum); + // Linux:yes, Windows:no + connector.setReuseAddress(!Shell.WINDOWS); + int maxIdleTime = (int) hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_MAX_IDLE_TIME, + TimeUnit.MILLISECONDS); + connector.setIdleTimeout(maxIdleTime); + + httpServer.addConnector(connector); + + // Thrift configs + hiveAuthFactory = new HiveAuthFactory(hiveConf); + TProcessor processor = new TCLIService.Processor(this); + TProtocolFactory protocolFactory = new TBinaryProtocol.Factory(); + // Set during the init phase of HiveServer2 if auth mode is kerberos + // UGI for the hive/_HOST (kerberos) principal + UserGroupInformation serviceUGI = cliService.getServiceUGI(); + // UGI for the http/_HOST (SPNego) principal + UserGroupInformation httpUGI = cliService.getHttpUGI(); + String authType = hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION); + TServlet thriftHttpServlet = new ThriftHttpServlet(processor, protocolFactory, authType, + serviceUGI, httpUGI, hiveAuthFactory); + + // Context handler + final ServletContextHandler context = new ServletContextHandler( + ServletContextHandler.SESSIONS); + context.setContextPath("/"); + String httpPath = getHttpPath(hiveConf + .getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_HTTP_PATH)); + httpServer.setHandler(context); + context.addServlet(new ServletHolder(thriftHttpServlet), httpPath); + + // TODO: check defaults: maxTimeout, keepalive, maxBodySize, bodyReceiveDuration, etc. + // Finally, start the server + httpServer.start(); + // In case HIVE_SERVER2_THRIFT_HTTP_PORT or hive.server2.thrift.http.port is configured with + // 0 which represents any free port, we should set it to the actual one + portNum = connector.getLocalPort(); + String msg = "Started " + ThriftHttpCLIService.class.getSimpleName() + " in " + schemeName + + " mode on port " + portNum + " path=" + httpPath + " with " + minWorkerThreads + "..." + + maxWorkerThreads + " worker threads"; + LOG.info(msg); + } catch (Exception t) { + throw new ServiceException("Error initializing " + getName(), t); + } + } + + @Override + protected void stopServer() { + if ((httpServer != null) && httpServer.isStarted()) { + try { + httpServer.stop(); + httpServer = null; + LOG.info("Thrift HTTP server has been stopped"); + } catch (Exception e) { + LOG.error("Error stopping HTTP server: ", e); + } + } + } + + /** + * Configure Jetty to serve http requests. Example of a client connection URL: + * http://localhost:10000/servlets/thrifths2/ A gateway may cause actual target URL to differ, + * e.g. http://gateway:port/hive2/servlets/thrifths2/ + */ + @Override + public void run() { + try { + httpServer.join(); + } catch (Throwable t) { + if (t instanceof InterruptedException) { + // This is likely a shutdown + LOG.info("Caught " + t.getClass().getSimpleName() + ". Shutting down thrift server."); + } else { + LOG.error("Error starting HiveServer2: could not start " + + ThriftHttpCLIService.class.getSimpleName(), t); + System.exit(-1); + } + } + } + + /** + * The config parameter can be like "path", "/path", "/path/", "path/*", "/path1/path2/*" and so on. + * httpPath should end up as "/*", "/path/*" or "/path1/../pathN/*" + * @param httpPath + * @return + */ + private String getHttpPath(String httpPath) { + if(httpPath == null || httpPath.equals("")) { + httpPath = "/*"; + } + else { + if(!httpPath.startsWith("/")) { + httpPath = "/" + httpPath; + } + if(httpPath.endsWith("/")) { + httpPath = httpPath + "*"; + } + if(!httpPath.endsWith("/*")) { + httpPath = httpPath + "/*"; + } + } + return httpPath; + } +} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/server/HiveServer2.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/server/HiveServer2.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/server/HiveServer2.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/server/HiveServer2.java diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java b/sql/hive-thriftserver/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java similarity index 100% rename from sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java rename to sql/hive-thriftserver/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/FetchIterator.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/FetchIterator.scala new file mode 100644 index 0000000000000..b9db657952b56 --- /dev/null +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/FetchIterator.scala @@ -0,0 +1,107 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.thriftserver + +private[hive] sealed trait FetchIterator[A] extends Iterator[A] { + /** + * Begin a fetch block, forward from the current position. + * Resets the fetch start offset. + */ + def fetchNext(): Unit + + /** + * Begin a fetch block, moving the iterator back by offset from the start of the previous fetch + * block start. + * Resets the fetch start offset. + * + * @param offset the amount to move a fetch start position toward the prior direction. + */ + def fetchPrior(offset: Long): Unit = fetchAbsolute(getFetchStart - offset) + + /** + * Begin a fetch block, moving the iterator to the given position. + * Resets the fetch start offset. + * + * @param pos index to move a position of iterator. + */ + def fetchAbsolute(pos: Long): Unit + + def getFetchStart: Long + + def getPosition: Long +} + +private[hive] class ArrayFetchIterator[A](src: Array[A]) extends FetchIterator[A] { + private var fetchStart: Long = 0 + + private var position: Long = 0 + + override def fetchNext(): Unit = fetchStart = position + + override def fetchAbsolute(pos: Long): Unit = { + position = (pos max 0) min src.length + fetchStart = position + } + + override def getFetchStart: Long = fetchStart + + override def getPosition: Long = position + + override def hasNext: Boolean = position < src.length + + override def next(): A = { + position += 1 + src(position.toInt - 1) + } +} + +private[hive] class IterableFetchIterator[A](iterable: Iterable[A]) extends FetchIterator[A] { + private var iter: Iterator[A] = iterable.iterator + + private var fetchStart: Long = 0 + + private var position: Long = 0 + + override def fetchNext(): Unit = fetchStart = position + + override def fetchAbsolute(pos: Long): Unit = { + val newPos = pos max 0 + if (newPos < position) resetPosition() + while (position < newPos && hasNext) next() + fetchStart = position + } + + override def getFetchStart: Long = fetchStart + + override def getPosition: Long = position + + override def hasNext: Boolean = iter.hasNext + + override def next(): A = { + position += 1 + iter.next() + } + + private def resetPosition(): Unit = { + if (position != 0) { + iter = iterable.iterator + position = 0 + fetchStart = 0 + } + } +} diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala index f9f2ceeed8a75..a1f2d62a0b72c 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala @@ -52,14 +52,17 @@ object HiveThriftServer2 extends Logging { */ @DeveloperApi def startWithContext(sqlContext: SQLContext): HiveThriftServer2 = { - val server = new HiveThriftServer2(sqlContext) - val executionHive = HiveUtils.newClientForExecution( sqlContext.sparkContext.conf, sqlContext.sessionState.newHadoopConf()) + // Cleanup the scratch dir before starting + ServerUtils.cleanUpScratchDir(executionHive.conf) + val server = new HiveThriftServer2(sqlContext) + server.init(executionHive.conf) server.start() + logInfo("HiveThriftServer2 started") createListenerAndUI(server, sqlContext.sparkContext) server } @@ -97,18 +100,8 @@ object HiveThriftServer2 extends Logging { uiTab.foreach(_.detach()) } - val executionHive = HiveUtils.newClientForExecution( - SparkSQLEnv.sqlContext.sparkContext.conf, - SparkSQLEnv.sqlContext.sessionState.newHadoopConf()) - try { - // Cleanup the scratch dir before starting - ServerUtils.cleanUpScratchDir(executionHive.conf) - val server = new HiveThriftServer2(SparkSQLEnv.sqlContext) - server.init(executionHive.conf) - server.start() - logInfo("HiveThriftServer2 started") - createListenerAndUI(server, SparkSQLEnv.sparkContext) + startWithContext(SparkSQLEnv.sqlContext) // If application was killed before HiveThriftServer2 start successfully then SparkSubmit // process can not exit, so check whether if SparkContext was stopped. if (SparkSQLEnv.sparkContext.stopped.get()) { @@ -123,7 +116,7 @@ object HiveThriftServer2 extends Logging { } private[thriftserver] object ExecutionState extends Enumeration { - val STARTED, COMPILED, CANCELED, FAILED, FINISHED, CLOSED = Value + val STARTED, COMPILED, CANCELED, TIMEDOUT, FAILED, FINISHED, CLOSED = Value type ExecutionState = Value } } diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ReflectionUtils.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ReflectionUtils.scala index a4024be67ac9c..8a136c11389d6 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ReflectionUtils.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ReflectionUtils.scala @@ -53,6 +53,6 @@ private[hive] object ReflectionUtils { val (types, values) = args.unzip val method = clazz.getDeclaredMethod(methodName, types: _*) method.setAccessible(true) - method.invoke(obj, values.toSeq: _*) + method.invoke(obj, values: _*) } } diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala index d14d70f7d3d83..6196f941c858a 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala @@ -18,51 +18,61 @@ package org.apache.spark.sql.hive.thriftserver import java.security.PrivilegedExceptionAction -import java.sql.{Date, Timestamp} -import java.util.{Arrays, Map => JMap, UUID} -import java.util.concurrent.RejectedExecutionException +import java.util.{Arrays, Map => JMap} +import java.util.concurrent.{Executors, RejectedExecutionException, TimeUnit} import scala.collection.JavaConverters._ import scala.collection.mutable.ArrayBuffer import scala.util.control.NonFatal -import org.apache.commons.lang3.exception.ExceptionUtils import org.apache.hadoop.hive.metastore.api.FieldSchema import org.apache.hadoop.hive.shims.Utils import org.apache.hive.service.cli._ import org.apache.hive.service.cli.operation.ExecuteStatementOperation import org.apache.hive.service.cli.session.HiveSession -import org.apache.spark.SparkContext import org.apache.spark.internal.Logging import org.apache.spark.sql.{DataFrame, Row => SparkRow, SQLContext} -import org.apache.spark.sql.execution.HiveResult -import org.apache.spark.sql.execution.command.SetCommand +import org.apache.spark.sql.execution.HiveResult.{getTimeFormatters, toHiveString, TimeFormatters} import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.internal.VariableSubstitution import org.apache.spark.sql.types._ import org.apache.spark.unsafe.types.CalendarInterval import org.apache.spark.util.{Utils => SparkUtils} private[hive] class SparkExecuteStatementOperation( + val sqlContext: SQLContext, parentSession: HiveSession, statement: String, confOverlay: JMap[String, String], - runInBackground: Boolean = true) - (sqlContext: SQLContext, sessionToActivePool: JMap[SessionHandle, String]) + runInBackground: Boolean = true, + queryTimeout: Long) extends ExecuteStatementOperation(parentSession, statement, confOverlay, runInBackground) + with SparkOperation with Logging { + // If a timeout value `queryTimeout` is specified by users and it is smaller than + // a global timeout value, we use the user-specified value. + // This code follows the Hive timeout behaviour (See #29933 for details). + private val timeout = { + val globalTimeout = sqlContext.conf.getConf(SQLConf.THRIFTSERVER_QUERY_TIMEOUT) + if (globalTimeout > 0 && (queryTimeout <= 0 || globalTimeout < queryTimeout)) { + globalTimeout + } else { + queryTimeout + } + } + + private val forceCancel = sqlContext.conf.getConf(SQLConf.THRIFTSERVER_FORCE_CANCEL) + + private val substitutorStatement = SQLConf.withExistingConf(sqlContext.conf) { + new VariableSubstitution().substitute(statement) + } + private var result: DataFrame = _ - // We cache the returned rows to get iterators again in case the user wants to use FETCH_FIRST. - // This is only used when `spark.sql.thriftServer.incrementalCollect` is set to `false`. - // In case of `true`, this will be `None` and FETCH_FIRST will trigger re-execution. - private var resultList: Option[Array[SparkRow]] = _ - private var previousFetchEndOffset: Long = 0 - private var previousFetchStartOffset: Long = 0 - private var iter: Iterator[SparkRow] = _ + private var iter: FetchIterator[SparkRow] = _ private var dataTypes: Array[DataType] = _ - private var statementId: String = _ private lazy val resultSchema: TableSchema = { if (result == null || result.schema.isEmpty) { @@ -73,14 +83,11 @@ private[hive] class SparkExecuteStatementOperation( } } - override def close(): Unit = { - // RDDs will be cleaned automatically upon garbage collection. - logInfo(s"Close statement with $statementId") - cleanup(OperationState.CLOSED) - HiveThriftServer2.eventManager.onOperationClosed(statementId) - } - - def addNonNullColumnValue(from: SparkRow, to: ArrayBuffer[Any], ordinal: Int): Unit = { + def addNonNullColumnValue( + from: SparkRow, + to: ArrayBuffer[Any], + ordinal: Int, + timeFormatters: TimeFormatters): Unit = { dataTypes(ordinal) match { case StringType => to += from.getString(ordinal) @@ -100,69 +107,56 @@ private[hive] class SparkExecuteStatementOperation( to += from.getByte(ordinal) case ShortType => to += from.getShort(ordinal) - case DateType => - to += from.getAs[Date](ordinal) - case TimestampType => - to += from.getAs[Timestamp](ordinal) case BinaryType => to += from.getAs[Array[Byte]](ordinal) + // SPARK-31859, SPARK-31861: Date and Timestamp need to be turned to String here to: + // - respect spark.sql.session.timeZone + // - work with spark.sql.datetime.java8API.enabled + // These types have always been sent over the wire as string, converted later. + case _: DateType | _: TimestampType => + to += toHiveString((from.get(ordinal), dataTypes(ordinal)), false, timeFormatters) case CalendarIntervalType => - to += HiveResult.toHiveString((from.getAs[CalendarInterval](ordinal), CalendarIntervalType)) - case _: ArrayType | _: StructType | _: MapType | _: UserDefinedType[_] => - val hiveString = HiveResult.toHiveString((from.get(ordinal), dataTypes(ordinal))) - to += hiveString + to += toHiveString( + (from.getAs[CalendarInterval](ordinal), CalendarIntervalType), + false, + timeFormatters) + case _: ArrayType | _: StructType | _: MapType | _: UserDefinedType[_] | + YearMonthIntervalType | DayTimeIntervalType => + to += toHiveString((from.get(ordinal), dataTypes(ordinal)), false, timeFormatters) + } + } + + def getNextRowSet(order: FetchOrientation, maxRowsL: Long): RowSet = withLocalProperties { + try { + sqlContext.sparkContext.setJobGroup(statementId, substitutorStatement, forceCancel) + getNextRowSetInternal(order, maxRowsL) + } finally { + sqlContext.sparkContext.clearJobGroup() } } - def getNextRowSet(order: FetchOrientation, maxRowsL: Long): RowSet = withSchedulerPool { + private def getNextRowSetInternal( + order: FetchOrientation, + maxRowsL: Long): RowSet = withLocalProperties { log.info(s"Received getNextRowSet request order=${order} and maxRowsL=${maxRowsL} " + s"with ${statementId}") validateDefaultFetchOrientation(order) assertState(OperationState.FINISHED) setHasResultSet(true) - val resultRowSet: RowSet = - ThriftserverShimUtils.resultRowSet(getResultSetSchema, getProtocolVersion) - - // Reset iter when FETCH_FIRST or FETCH_PRIOR - if ((order.equals(FetchOrientation.FETCH_FIRST) || - order.equals(FetchOrientation.FETCH_PRIOR)) && previousFetchEndOffset != 0) { - // Reset the iterator to the beginning of the query. - iter = if (sqlContext.getConf(SQLConf.THRIFTSERVER_INCREMENTAL_COLLECT.key).toBoolean) { - resultList = None - result.toLocalIterator.asScala - } else { - if (resultList.isEmpty) { - resultList = Some(result.collect()) - } - resultList.get.iterator - } - } + val resultRowSet: RowSet = RowSetFactory.create(getResultSetSchema, getProtocolVersion, false) - var resultOffset = { - if (order.equals(FetchOrientation.FETCH_FIRST)) { - logInfo(s"FETCH_FIRST request with $statementId. Resetting to resultOffset=0") - 0 - } else if (order.equals(FetchOrientation.FETCH_PRIOR)) { - // TODO: FETCH_PRIOR should be handled more efficiently than rewinding to beginning and - // reiterating. - val targetOffset = math.max(previousFetchStartOffset - maxRowsL, 0) - logInfo(s"FETCH_PRIOR request with $statementId. Resetting to resultOffset=$targetOffset") - var off = 0 - while (off < targetOffset && iter.hasNext) { - iter.next() - off += 1 - } - off - } else { // FETCH_NEXT - previousFetchEndOffset - } + if (order.equals(FetchOrientation.FETCH_FIRST)) { + iter.fetchAbsolute(0) + } else if (order.equals(FetchOrientation.FETCH_PRIOR)) { + iter.fetchPrior(maxRowsL) + } else { + iter.fetchNext() } - - resultRowSet.setStartOffset(resultOffset) - previousFetchStartOffset = resultOffset + resultRowSet.setStartOffset(iter.getPosition) if (!iter.hasNext) { resultRowSet } else { + val timeFormatters = getTimeFormatters // maxRowsL here typically maps to java.sql.Statement.getFetchSize, which is an int val maxRows = maxRowsL.toInt var curRow = 0 @@ -174,17 +168,15 @@ private[hive] class SparkExecuteStatementOperation( if (sparkRow.isNullAt(curCol)) { row += null } else { - addNonNullColumnValue(sparkRow, row, curCol) + addNonNullColumnValue(sparkRow, row, curCol, timeFormatters) } curCol += 1 } resultRowSet.addRow(row.toArray.asInstanceOf[Array[Object]]) curRow += 1 - resultOffset += 1 } - previousFetchEndOffset = resultOffset log.info(s"Returning result set with ${curRow} rows from offsets " + - s"[$previousFetchStartOffset, $previousFetchEndOffset) with $statementId") + s"[${iter.getFetchStart}, ${iter.getPosition}) with $statementId") resultRowSet } } @@ -193,7 +185,6 @@ private[hive] class SparkExecuteStatementOperation( override def runInternal(): Unit = { setState(OperationState.PENDING) - statementId = UUID.randomUUID().toString logInfo(s"Submitting query '$statement' with $statementId") HiveThriftServer2.eventManager.onStatementStart( statementId, @@ -203,6 +194,23 @@ private[hive] class SparkExecuteStatementOperation( parentSession.getUsername) setHasResultSet(true) // avoid no resultset for async run + if (timeout > 0) { + val timeoutExecutor = Executors.newSingleThreadScheduledExecutor() + timeoutExecutor.schedule(new Runnable { + override def run(): Unit = { + try { + timeoutCancel() + } catch { + case NonFatal(e) => + setOperationException(new HiveSQLException(e)) + logError(s"Error cancelling the query after timeout: $timeout seconds") + } finally { + timeoutExecutor.shutdown() + } + } + }, timeout, TimeUnit.SECONDS) + } + if (!runInBackground) { execute() } else { @@ -217,11 +225,11 @@ private[hive] class SparkExecuteStatementOperation( override def run(): Unit = { registerCurrentOperationLog() try { - execute() + withLocalProperties { + execute() + } } catch { - case e: HiveSQLException => - setOperationException(e) - log.error("Error running hive query: ", e) + case e: HiveSQLException => setOperationException(e) } } } @@ -259,7 +267,7 @@ private[hive] class SparkExecuteStatementOperation( } } - private def execute(): Unit = withSchedulerPool { + private def execute(): Unit = { try { synchronized { if (getStatus.getState.isTerminal) { @@ -279,26 +287,17 @@ private[hive] class SparkExecuteStatementOperation( parentSession.getSessionState.getConf.setClassLoader(executionHiveClassLoader) } - sqlContext.sparkContext.setJobGroup(statementId, statement) + sqlContext.sparkContext.setJobGroup(statementId, substitutorStatement, forceCancel) result = sqlContext.sql(statement) logDebug(result.queryExecution.toString()) - result.queryExecution.logical match { - case SetCommand(Some((SQLConf.THRIFTSERVER_POOL.key, Some(value)))) => - sessionToActivePool.put(parentSession.getSessionHandle, value) - logInfo(s"Setting ${SparkContext.SPARK_SCHEDULER_POOL}=$value for future statements " + - "in this session.") - case _ => - } HiveThriftServer2.eventManager.onStatementParsed(statementId, result.queryExecution.toString()) - iter = { - if (sqlContext.getConf(SQLConf.THRIFTSERVER_INCREMENTAL_COLLECT.key).toBoolean) { - resultList = None - result.toLocalIterator.asScala - } else { - resultList = Some(result.collect()) - resultList.get.iterator - } + iter = if (sqlContext.getConf(SQLConf.THRIFTSERVER_INCREMENTAL_COLLECT.key).toBoolean) { + new IterableFetchIterator[SparkRow](new Iterable[SparkRow] { + override def iterator: Iterator[SparkRow] = result.toLocalIterator.asScala + }) + } else { + new ArrayFetchIterator[SparkRow](result.collect()) } dataTypes = result.schema.fields.map(_.dataType) } catch { @@ -319,16 +318,11 @@ private[hive] class SparkExecuteStatementOperation( } else { logError(s"Error executing query with $statementId, currentState $currentState, ", e) setState(OperationState.ERROR) + HiveThriftServer2.eventManager.onStatementError( + statementId, e.getMessage, SparkUtils.exceptionString(e)) e match { - case hiveException: HiveSQLException => - HiveThriftServer2.eventManager.onStatementError( - statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) - throw hiveException - case _ => - val root = ExceptionUtils.getRootCause(e) - HiveThriftServer2.eventManager.onStatementError( - statementId, root.getMessage, SparkUtils.exceptionString(root)) - throw new HiveSQLException("Error running query: " + root.toString, root) + case _: HiveSQLException => throw e + case _ => throw new HiveSQLException("Error running query: " + e.toString, e) } } } finally { @@ -342,42 +336,40 @@ private[hive] class SparkExecuteStatementOperation( } } + def timeoutCancel(): Unit = { + synchronized { + if (!getStatus.getState.isTerminal) { + logInfo(s"Query with $statementId timed out after $timeout seconds") + setState(OperationState.TIMEDOUT) + cleanup() + HiveThriftServer2.eventManager.onStatementTimeout(statementId) + } + } + } + override def cancel(): Unit = { synchronized { if (!getStatus.getState.isTerminal) { logInfo(s"Cancel query with $statementId") - cleanup(OperationState.CANCELED) + setState(OperationState.CANCELED) + cleanup() HiveThriftServer2.eventManager.onStatementCanceled(statementId) } } } - private def cleanup(state: OperationState): Unit = { - setState(state) + override protected def cleanup(): Unit = { if (runInBackground) { val backgroundHandle = getBackgroundHandle() if (backgroundHandle != null) { backgroundHandle.cancel(true) } } + // RDDs will be cleaned automatically upon garbage collection. if (statementId != null) { sqlContext.sparkContext.cancelJobGroup(statementId) } } - - private def withSchedulerPool[T](body: => T): T = { - val pool = sessionToActivePool.get(parentSession.getSessionHandle) - if (pool != null) { - sqlContext.sparkContext.setLocalProperty(SparkContext.SPARK_SCHEDULER_POOL, pool) - } - try { - body - } finally { - if (pool != null) { - sqlContext.sparkContext.setLocalProperty(SparkContext.SPARK_SCHEDULER_POOL, null) - } - } - } } object SparkExecuteStatementOperation { @@ -386,6 +378,8 @@ object SparkExecuteStatementOperation { val attrTypeString = field.dataType match { case NullType => "void" case CalendarIntervalType => StringType.catalogString + case YearMonthIntervalType => "interval_year_month" + case DayTimeIntervalType => "interval_day_time" case other => other.catalogString } new FieldSchema(field.name, attrTypeString, field.getComment.getOrElse("")) diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetCatalogsOperation.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetCatalogsOperation.scala index 2945cfd200e46..01ef78cde8956 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetCatalogsOperation.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetCatalogsOperation.scala @@ -17,17 +17,13 @@ package org.apache.spark.sql.hive.thriftserver -import java.util.UUID - -import org.apache.commons.lang3.exception.ExceptionUtils import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType -import org.apache.hive.service.cli.{HiveSQLException, OperationState} +import org.apache.hive.service.cli.OperationState import org.apache.hive.service.cli.operation.GetCatalogsOperation import org.apache.hive.service.cli.session.HiveSession import org.apache.spark.internal.Logging import org.apache.spark.sql.SQLContext -import org.apache.spark.util.{Utils => SparkUtils} /** * Spark's own GetCatalogsOperation @@ -36,19 +32,13 @@ import org.apache.spark.util.{Utils => SparkUtils} * @param parentSession a HiveSession from SessionManager */ private[hive] class SparkGetCatalogsOperation( - sqlContext: SQLContext, + val sqlContext: SQLContext, parentSession: HiveSession) - extends GetCatalogsOperation(parentSession) with Logging { - - private var statementId: String = _ - - override def close(): Unit = { - super.close() - HiveThriftServer2.eventManager.onOperationClosed(statementId) - } + extends GetCatalogsOperation(parentSession) + with SparkOperation + with Logging { override def runInternal(): Unit = { - statementId = UUID.randomUUID().toString val logMsg = "Listing catalogs" logInfo(s"$logMsg with $statementId") setState(OperationState.RUNNING) @@ -68,22 +58,8 @@ private[hive] class SparkGetCatalogsOperation( authorizeMetaGets(HiveOperationType.GET_CATALOGS, null) } setState(OperationState.FINISHED) - } catch { - case e: Throwable => - logError(s"Error executing get catalogs operation with $statementId", e) - setState(OperationState.ERROR) - e match { - case hiveException: HiveSQLException => - HiveThriftServer2.eventManager.onStatementError( - statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) - throw hiveException - case _ => - val root = ExceptionUtils.getRootCause(e) - HiveThriftServer2.eventManager.onStatementError( - statementId, root.getMessage, SparkUtils.exceptionString(root)) - throw new HiveSQLException("Error getting catalogs: " + root.toString, root) - } - } + } catch onError() + HiveThriftServer2.eventManager.onStatementFinish(statementId) } } diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetColumnsOperation.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetColumnsOperation.scala index ff7cbfeae13be..a354050d2fc47 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetColumnsOperation.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetColumnsOperation.scala @@ -17,12 +17,10 @@ package org.apache.spark.sql.hive.thriftserver -import java.util.UUID import java.util.regex.Pattern import scala.collection.JavaConverters.seqAsJavaListConverter -import org.apache.commons.lang3.exception.ExceptionUtils import org.apache.hadoop.hive.ql.security.authorization.plugin.{HiveOperationType, HivePrivilegeObject} import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject.HivePrivilegeObjectType import org.apache.hive.service.cli._ @@ -33,9 +31,7 @@ import org.apache.spark.internal.Logging import org.apache.spark.sql.SQLContext import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.catalog.SessionCatalog -import org.apache.spark.sql.hive.thriftserver.ThriftserverShimUtils.toJavaSQLType -import org.apache.spark.sql.types.StructType -import org.apache.spark.util.{Utils => SparkUtils} +import org.apache.spark.sql.types._ /** * Spark's own SparkGetColumnsOperation @@ -48,26 +44,19 @@ import org.apache.spark.util.{Utils => SparkUtils} * @param columnName column name */ private[hive] class SparkGetColumnsOperation( - sqlContext: SQLContext, + val sqlContext: SQLContext, parentSession: HiveSession, catalogName: String, schemaName: String, tableName: String, columnName: String) extends GetColumnsOperation(parentSession, catalogName, schemaName, tableName, columnName) - with Logging { + with SparkOperation + with Logging { val catalog: SessionCatalog = sqlContext.sessionState.catalog - private var statementId: String = _ - - override def close(): Unit = { - super.close() - HiveThriftServer2.eventManager.onOperationClosed(statementId) - } - override def runInternal(): Unit = { - statementId = UUID.randomUUID().toString // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName, tablePattern : $tableName" val logMsg = s"Listing columns '$cmdStr, columnName : $columnName'" @@ -116,44 +105,98 @@ private[hive] class SparkGetColumnsOperation( val databasePattern = Pattern.compile(CLIServiceUtils.patternToRegex(schemaName)) if (databasePattern.matcher(globalTempViewDb).matches()) { catalog.globalTempViewManager.listViewNames(tablePattern).foreach { globalTempView => - catalog.globalTempViewManager.get(globalTempView).foreach { plan => - addToRowSet(columnPattern, globalTempViewDb, globalTempView, plan.schema) + catalog.getRawGlobalTempView(globalTempView).map(_.tableMeta.schema).foreach { + schema => addToRowSet(columnPattern, globalTempViewDb, globalTempView, schema) } } } // Temporary views catalog.listLocalTempViews(tablePattern).foreach { localTempView => - catalog.getTempView(localTempView.table).foreach { plan => - addToRowSet(columnPattern, null, localTempView.table, plan.schema) + catalog.getRawTempView(localTempView.table).map(_.tableMeta.schema).foreach { + schema => addToRowSet(columnPattern, null, localTempView.table, schema) } } setState(OperationState.FINISHED) - } catch { - case e: Throwable => - logError(s"Error executing get columns operation with $statementId", e) - setState(OperationState.ERROR) - e match { - case hiveException: HiveSQLException => - HiveThriftServer2.eventManager.onStatementError( - statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) - throw hiveException - case _ => - val root = ExceptionUtils.getRootCause(e) - HiveThriftServer2.eventManager.onStatementError( - statementId, root.getMessage, SparkUtils.exceptionString(root)) - throw new HiveSQLException("Error getting columns: " + root.toString, root) - } - } + } catch onError() + HiveThriftServer2.eventManager.onStatementFinish(statementId) } + /** + * For boolean, numeric and datetime types, it returns the default size of its catalyst type + * For struct type, when its elements are fixed-size, the summation of all element sizes will be + * returned. + * For array, map, string, and binaries, the column size is variable, return null as unknown. + */ + private def getColumnSize(typ: DataType): Option[Int] = typ match { + case dt @ (BooleanType | _: NumericType | DateType | TimestampType | + CalendarIntervalType | NullType | YearMonthIntervalType | DayTimeIntervalType) => + Some(dt.defaultSize) + case CharType(n) => Some(n) + case StructType(fields) => + val sizeArr = fields.map(f => getColumnSize(f.dataType)) + if (sizeArr.contains(None)) { + None + } else { + Some(sizeArr.map(_.get).sum) + } + case other => None + } + + /** + * The number of fractional digits for this type. + * Null is returned for data types where this is not applicable. + * For boolean and integrals, the decimal digits is 0 + * For floating types, we follow the IEEE Standard for Floating-Point Arithmetic (IEEE 754) + * For timestamp values, we support microseconds + * For decimals, it returns the scale + */ + private def getDecimalDigits(typ: DataType) = typ match { + case BooleanType | _: IntegerType => Some(0) + case FloatType => Some(7) + case DoubleType => Some(15) + case d: DecimalType => Some(d.scale) + case TimestampType => Some(6) + case _ => None + } + + private def getNumPrecRadix(typ: DataType): Option[Int] = typ match { + case _: NumericType => Some(10) + case _ => None + } + + private def toJavaSQLType(typ: DataType): Integer = typ match { + case NullType => java.sql.Types.NULL + case BooleanType => java.sql.Types.BOOLEAN + case ByteType => java.sql.Types.TINYINT + case ShortType => java.sql.Types.SMALLINT + case IntegerType => java.sql.Types.INTEGER + case LongType => java.sql.Types.BIGINT + case FloatType => java.sql.Types.FLOAT + case DoubleType => java.sql.Types.DOUBLE + case _: DecimalType => java.sql.Types.DECIMAL + case StringType => java.sql.Types.VARCHAR + case VarcharType(_) => java.sql.Types.VARCHAR + case CharType(_) => java.sql.Types.CHAR + case BinaryType => java.sql.Types.BINARY + case DateType => java.sql.Types.DATE + case TimestampType => java.sql.Types.TIMESTAMP + case _: ArrayType => java.sql.Types.ARRAY + case _: MapType => java.sql.Types.JAVA_OBJECT + case _: StructType => java.sql.Types.STRUCT + // Hive's year-month and day-time intervals are mapping to java.sql.Types.OTHER + case _: CalendarIntervalType | YearMonthIntervalType | DayTimeIntervalType => + java.sql.Types.OTHER + case _ => throw new IllegalArgumentException(s"Unrecognized type name: ${typ.sql}") + } + private def addToRowSet( columnPattern: Pattern, dbName: String, tableName: String, schema: StructType): Unit = { - schema.foreach { column => + schema.zipWithIndex.foreach { case (column, pos) => if (columnPattern != null && !columnPattern.matcher(column.name).matches()) { } else { val rowData = Array[AnyRef]( @@ -161,19 +204,19 @@ private[hive] class SparkGetColumnsOperation( dbName, // TABLE_SCHEM tableName, // TABLE_NAME column.name, // COLUMN_NAME - toJavaSQLType(column.dataType.sql).asInstanceOf[AnyRef], // DATA_TYPE + toJavaSQLType(column.dataType), // DATA_TYPE column.dataType.sql, // TYPE_NAME - null, // COLUMN_SIZE + getColumnSize(column.dataType).map(_.asInstanceOf[AnyRef]).orNull, // COLUMN_SIZE null, // BUFFER_LENGTH, unused - null, // DECIMAL_DIGITS - null, // NUM_PREC_RADIX + getDecimalDigits(column.dataType).map(_.asInstanceOf[AnyRef]).orNull, // DECIMAL_DIGITS + getNumPrecRadix(column.dataType).map(_.asInstanceOf[AnyRef]).orNull, // NUM_PREC_RADIX (if (column.nullable) 1 else 0).asInstanceOf[AnyRef], // NULLABLE column.getComment().getOrElse(""), // REMARKS null, // COLUMN_DEF null, // SQL_DATA_TYPE null, // SQL_DATETIME_SUB null, // CHAR_OCTET_LENGTH - null, // ORDINAL_POSITION + pos.asInstanceOf[AnyRef], // ORDINAL_POSITION "YES", // IS_NULLABLE null, // SCOPE_CATALOG null, // SCOPE_SCHEMA diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetFunctionsOperation.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetFunctionsOperation.scala index d9c12b6ca9e64..352528e26e318 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetFunctionsOperation.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetFunctionsOperation.scala @@ -18,11 +18,9 @@ package org.apache.spark.sql.hive.thriftserver import java.sql.DatabaseMetaData -import java.util.UUID import scala.collection.JavaConverters.seqAsJavaListConverter -import org.apache.commons.lang3.exception.ExceptionUtils import org.apache.hadoop.hive.ql.security.authorization.plugin.{HiveOperationType, HivePrivilegeObjectUtils} import org.apache.hive.service.cli._ import org.apache.hive.service.cli.operation.GetFunctionsOperation @@ -31,7 +29,6 @@ import org.apache.hive.service.cli.session.HiveSession import org.apache.spark.internal.Logging import org.apache.spark.sql.SQLContext -import org.apache.spark.util.{Utils => SparkUtils} /** * Spark's own GetFunctionsOperation @@ -43,22 +40,16 @@ import org.apache.spark.util.{Utils => SparkUtils} * @param functionName function name pattern */ private[hive] class SparkGetFunctionsOperation( - sqlContext: SQLContext, + val sqlContext: SQLContext, parentSession: HiveSession, catalogName: String, schemaName: String, functionName: String) - extends GetFunctionsOperation(parentSession, catalogName, schemaName, functionName) with Logging { - - private var statementId: String = _ - - override def close(): Unit = { - super.close() - HiveThriftServer2.eventManager.onOperationClosed(statementId) - } + extends GetFunctionsOperation(parentSession, catalogName, schemaName, functionName) + with SparkOperation + with Logging { override def runInternal(): Unit = { - statementId = UUID.randomUUID().toString // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" val logMsg = s"Listing functions '$cmdStr, functionName : $functionName'" @@ -97,29 +88,15 @@ private[hive] class SparkGetFunctionsOperation( DEFAULT_HIVE_CATALOG, // FUNCTION_CAT db, // FUNCTION_SCHEM funcIdentifier.funcName, // FUNCTION_NAME - info.getUsage, // REMARKS + s"Usage: ${info.getUsage}\nExtended Usage:${info.getExtended}", // REMARKS DatabaseMetaData.functionResultUnknown.asInstanceOf[AnyRef], // FUNCTION_TYPE info.getClassName) // SPECIFIC_NAME rowSet.addRow(rowData); } } setState(OperationState.FINISHED) - } catch { - case e: Throwable => - logError(s"Error executing get functions operation with $statementId", e) - setState(OperationState.ERROR) - e match { - case hiveException: HiveSQLException => - HiveThriftServer2.eventManager.onStatementError( - statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) - throw hiveException - case _ => - val root = ExceptionUtils.getRootCause(e) - HiveThriftServer2.eventManager.onStatementError( - statementId, root.getMessage, SparkUtils.exceptionString(root)) - throw new HiveSQLException("Error getting functions: " + root.toString, root) - } - } + } catch onError() + HiveThriftServer2.eventManager.onStatementFinish(statementId) } } diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetSchemasOperation.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetSchemasOperation.scala index db19880d1b99f..45cfa86ba9343 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetSchemasOperation.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetSchemasOperation.scala @@ -17,10 +17,8 @@ package org.apache.spark.sql.hive.thriftserver -import java.util.UUID import java.util.regex.Pattern -import org.apache.commons.lang3.exception.ExceptionUtils import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType import org.apache.hive.service.cli._ import org.apache.hive.service.cli.operation.GetSchemasOperation @@ -29,7 +27,6 @@ import org.apache.hive.service.cli.session.HiveSession import org.apache.spark.internal.Logging import org.apache.spark.sql.SQLContext -import org.apache.spark.util.{Utils => SparkUtils} /** * Spark's own GetSchemasOperation @@ -40,21 +37,15 @@ import org.apache.spark.util.{Utils => SparkUtils} * @param schemaName database name, null or a concrete database name */ private[hive] class SparkGetSchemasOperation( - sqlContext: SQLContext, + val sqlContext: SQLContext, parentSession: HiveSession, catalogName: String, schemaName: String) - extends GetSchemasOperation(parentSession, catalogName, schemaName) with Logging { - - private var statementId: String = _ - - override def close(): Unit = { - super.close() - HiveThriftServer2.eventManager.onOperationClosed(statementId) - } + extends GetSchemasOperation(parentSession, catalogName, schemaName) + with SparkOperation + with Logging { override def runInternal(): Unit = { - statementId = UUID.randomUUID().toString // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" val logMsg = s"Listing databases '$cmdStr'" @@ -83,26 +74,13 @@ private[hive] class SparkGetSchemasOperation( val globalTempViewDb = sqlContext.sessionState.catalog.globalTempViewManager.database val databasePattern = Pattern.compile(CLIServiceUtils.patternToRegex(schemaName)) - if (databasePattern.matcher(globalTempViewDb).matches()) { + if (schemaName == null || schemaName.isEmpty || + databasePattern.matcher(globalTempViewDb).matches()) { rowSet.addRow(Array[AnyRef](globalTempViewDb, DEFAULT_HIVE_CATALOG)) } setState(OperationState.FINISHED) - } catch { - case e: Throwable => - logError(s"Error executing get schemas operation with $statementId", e) - setState(OperationState.ERROR) - e match { - case hiveException: HiveSQLException => - HiveThriftServer2.eventManager.onStatementError( - statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) - throw hiveException - case _ => - val root = ExceptionUtils.getRootCause(e) - HiveThriftServer2.eventManager.onStatementError( - statementId, root.getMessage, SparkUtils.exceptionString(root)) - throw new HiveSQLException("Error getting schemas: " + root.toString, root) - } - } + } catch onError() + HiveThriftServer2.eventManager.onStatementFinish(statementId) } } diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTableTypesOperation.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTableTypesOperation.scala index b4093e58d3c07..9e31b8baad78e 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTableTypesOperation.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTableTypesOperation.scala @@ -19,7 +19,6 @@ package org.apache.spark.sql.hive.thriftserver import java.util.UUID -import org.apache.commons.lang3.exception.ExceptionUtils import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType import org.apache.hive.service.cli._ import org.apache.hive.service.cli.operation.GetTableTypesOperation @@ -28,7 +27,6 @@ import org.apache.hive.service.cli.session.HiveSession import org.apache.spark.internal.Logging import org.apache.spark.sql.SQLContext import org.apache.spark.sql.catalyst.catalog.CatalogTableType -import org.apache.spark.util.{Utils => SparkUtils} /** * Spark's own GetTableTypesOperation @@ -37,16 +35,11 @@ import org.apache.spark.util.{Utils => SparkUtils} * @param parentSession a HiveSession from SessionManager */ private[hive] class SparkGetTableTypesOperation( - sqlContext: SQLContext, + val sqlContext: SQLContext, parentSession: HiveSession) - extends GetTableTypesOperation(parentSession) with SparkMetadataOperationUtils with Logging { - - private var statementId: String = _ - - override def close(): Unit = { - super.close() - HiveThriftServer2.eventManager.onOperationClosed(statementId) - } + extends GetTableTypesOperation(parentSession) + with SparkOperation + with Logging { override def runInternal(): Unit = { statementId = UUID.randomUUID().toString @@ -74,22 +67,8 @@ private[hive] class SparkGetTableTypesOperation( rowSet.addRow(Array[AnyRef](tableType)) } setState(OperationState.FINISHED) - } catch { - case e: Throwable => - logError(s"Error executing get table types operation with $statementId", e) - setState(OperationState.ERROR) - e match { - case hiveException: HiveSQLException => - HiveThriftServer2.eventManager.onStatementError( - statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) - throw hiveException - case _ => - val root = ExceptionUtils.getRootCause(e) - HiveThriftServer2.eventManager.onStatementError( - statementId, root.getMessage, SparkUtils.exceptionString(root)) - throw new HiveSQLException("Error getting table types: " + root.toString, root) - } - } + } catch onError() + HiveThriftServer2.eventManager.onStatementFinish(statementId) } } diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTablesOperation.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTablesOperation.scala index 45c6d980aac47..bddf5eb82012f 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTablesOperation.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTablesOperation.scala @@ -17,14 +17,12 @@ package org.apache.spark.sql.hive.thriftserver -import java.util.{List => JList, UUID} +import java.util.{List => JList} import java.util.regex.Pattern import scala.collection.JavaConverters._ -import org.apache.commons.lang3.exception.ExceptionUtils -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType -import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObjectUtils +import org.apache.hadoop.hive.ql.security.authorization.plugin.{HiveOperationType, HivePrivilegeObjectUtils} import org.apache.hive.service.cli._ import org.apache.hive.service.cli.operation.GetTablesOperation import org.apache.hive.service.cli.session.HiveSession @@ -32,8 +30,6 @@ import org.apache.hive.service.cli.session.HiveSession import org.apache.spark.internal.Logging import org.apache.spark.sql.SQLContext import org.apache.spark.sql.catalyst.catalog.CatalogTableType._ -import org.apache.spark.sql.hive.HiveUtils -import org.apache.spark.util.{Utils => SparkUtils} /** * Spark's own GetTablesOperation @@ -46,24 +42,17 @@ import org.apache.spark.util.{Utils => SparkUtils} * @param tableTypes list of allowed table types, e.g. "TABLE", "VIEW" */ private[hive] class SparkGetTablesOperation( - sqlContext: SQLContext, + val sqlContext: SQLContext, parentSession: HiveSession, catalogName: String, schemaName: String, tableName: String, tableTypes: JList[String]) extends GetTablesOperation(parentSession, catalogName, schemaName, tableName, tableTypes) - with SparkMetadataOperationUtils with Logging { - - private var statementId: String = _ - - override def close(): Unit = { - super.close() - HiveThriftServer2.eventManager.onOperationClosed(statementId) - } + with SparkOperation + with Logging { override def runInternal(): Unit = { - statementId = UUID.randomUUID().toString // Do not change cmdStr. It's used for Hive auditing and authorization. val cmdStr = s"catalog : $catalogName, schemaPattern : $schemaName" val tableTypesStr = if (tableTypes == null) "null" else tableTypes.asScala.mkString(",") @@ -118,22 +107,8 @@ private[hive] class SparkGetTablesOperation( } } setState(OperationState.FINISHED) - } catch { - case e: Throwable => - logError(s"Error executing get tables operation with $statementId", e) - setState(OperationState.ERROR) - e match { - case hiveException: HiveSQLException => - HiveThriftServer2.eventManager.onStatementError( - statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) - throw hiveException - case _ => - val root = ExceptionUtils.getRootCause(e) - HiveThriftServer2.eventManager.onStatementError( - statementId, root.getMessage, SparkUtils.exceptionString(root)) - throw new HiveSQLException("Error getting tables: " + root.toString, root) - } - } + } catch onError() + HiveThriftServer2.eventManager.onStatementFinish(statementId) } @@ -149,10 +124,6 @@ private[hive] class SparkGetTablesOperation( tableType, comment.getOrElse("")) // Since HIVE-7575(Hive 2.0.0), adds 5 additional columns to the ResultSet of GetTables. - if (HiveUtils.isHive23) { - rowSet.addRow(rowData ++ Array(null, null, null, null, null)) - } else { - rowSet.addRow(rowData) - } + rowSet.addRow(rowData ++ Array(null, null, null, null, null)) } } diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTypeInfoOperation.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTypeInfoOperation.scala index dd5668a93f82d..cecb0dec72c80 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTypeInfoOperation.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkGetTypeInfoOperation.scala @@ -19,15 +19,15 @@ package org.apache.spark.sql.hive.thriftserver import java.util.UUID -import org.apache.commons.lang3.exception.ExceptionUtils import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType -import org.apache.hive.service.cli.{HiveSQLException, OperationState} +import org.apache.hadoop.hive.serde2.thrift.Type +import org.apache.hadoop.hive.serde2.thrift.Type._ +import org.apache.hive.service.cli.OperationState import org.apache.hive.service.cli.operation.GetTypeInfoOperation import org.apache.hive.service.cli.session.HiveSession import org.apache.spark.internal.Logging import org.apache.spark.sql.SQLContext -import org.apache.spark.util.{Utils => SparkUtils} /** * Spark's own GetTypeInfoOperation @@ -36,16 +36,11 @@ import org.apache.spark.util.{Utils => SparkUtils} * @param parentSession a HiveSession from SessionManager */ private[hive] class SparkGetTypeInfoOperation( - sqlContext: SQLContext, + val sqlContext: SQLContext, parentSession: HiveSession) - extends GetTypeInfoOperation(parentSession) with Logging { - - private var statementId: String = _ - - override def close(): Unit = { - super.close() - HiveThriftServer2.eventManager.onOperationClosed(statementId) - } + extends GetTypeInfoOperation(parentSession) + with SparkOperation + with Logging { override def runInternal(): Unit = { statementId = UUID.randomUUID().toString @@ -68,7 +63,7 @@ private[hive] class SparkGetTypeInfoOperation( parentSession.getUsername) try { - ThriftserverShimUtils.supportedType().foreach(typeInfo => { + SparkGetTypeInfoUtil.supportedType.foreach(typeInfo => { val rowData = Array[AnyRef]( typeInfo.getName, // TYPE_NAME typeInfo.toJavaSQLType.asInstanceOf[AnyRef], // DATA_TYPE @@ -92,22 +87,19 @@ private[hive] class SparkGetTypeInfoOperation( rowSet.addRow(rowData) }) setState(OperationState.FINISHED) - } catch { - case e: Throwable => - logError(s"Error executing get type info with $statementId", e) - setState(OperationState.ERROR) - e match { - case hiveException: HiveSQLException => - HiveThriftServer2.eventManager.onStatementError( - statementId, hiveException.getMessage, SparkUtils.exceptionString(hiveException)) - throw hiveException - case _ => - val root = ExceptionUtils.getRootCause(e) - HiveThriftServer2.eventManager.onStatementError( - statementId, root.getMessage, SparkUtils.exceptionString(root)) - throw new HiveSQLException("Error getting type info: " + root.toString, root) - } - } + } catch onError() + HiveThriftServer2.eventManager.onStatementFinish(statementId) } } + +private[hive] object SparkGetTypeInfoUtil { + val supportedType: Seq[Type] = { + Seq(NULL_TYPE, BOOLEAN_TYPE, STRING_TYPE, BINARY_TYPE, + TINYINT_TYPE, SMALLINT_TYPE, INT_TYPE, BIGINT_TYPE, + FLOAT_TYPE, DOUBLE_TYPE, DECIMAL_TYPE, + DATE_TYPE, TIMESTAMP_TYPE, + ARRAY_TYPE, MAP_TYPE, STRUCT_TYPE, CHAR_TYPE, VARCHAR_TYPE, + INTERVAL_YEAR_MONTH_TYPE, INTERVAL_DAY_TIME_TYPE) + } +} diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationUtils.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationUtils.scala deleted file mode 100644 index f4c4b04bada2a..0000000000000 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationUtils.scala +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.hive.thriftserver - -import org.apache.spark.sql.catalyst.catalog.CatalogTableType -import org.apache.spark.sql.catalyst.catalog.CatalogTableType.{EXTERNAL, MANAGED, VIEW} - -/** - * Utils for metadata operations. - */ -private[hive] trait SparkMetadataOperationUtils { - - def tableTypeString(tableType: CatalogTableType): String = tableType match { - case EXTERNAL | MANAGED => "TABLE" - case VIEW => "VIEW" - case t => - throw new IllegalArgumentException(s"Unknown table type is found: $t") - } -} diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkOperation.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkOperation.scala new file mode 100644 index 0000000000000..bbfc1b83379aa --- /dev/null +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkOperation.scala @@ -0,0 +1,108 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.thriftserver + +import org.apache.hive.service.cli.{HiveSQLException, OperationState} +import org.apache.hive.service.cli.operation.Operation + +import org.apache.spark.SparkContext +import org.apache.spark.internal.Logging +import org.apache.spark.sql.{SparkSession, SQLContext} +import org.apache.spark.sql.catalyst.catalog.CatalogTableType +import org.apache.spark.sql.catalyst.catalog.CatalogTableType.{EXTERNAL, MANAGED, VIEW} +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.util.Utils + +/** + * Utils for Spark operations. + */ +private[hive] trait SparkOperation extends Operation with Logging { + + protected def sqlContext: SQLContext + + protected var statementId = getHandle().getHandleIdentifier().getPublicId().toString() + + protected def cleanup(): Unit = () // noop by default + + abstract override def run(): Unit = { + withLocalProperties { + super.run() + } + } + + abstract override def close(): Unit = { + super.close() + cleanup() + logInfo(s"Close statement with $statementId") + HiveThriftServer2.eventManager.onOperationClosed(statementId) + } + + // Set thread local properties for the execution of the operation. + // This method should be applied during the execution of the operation, by all the child threads. + // The original spark context local properties will be restored after the operation. + // + // It is used to: + // - set appropriate SparkSession + // - set scheduler pool for the operation + def withLocalProperties[T](f: => T): T = { + val originalProps = Utils.cloneProperties(sqlContext.sparkContext.getLocalProperties) + val originalSession = SparkSession.getActiveSession + + try { + // Set active SparkSession + SparkSession.setActiveSession(sqlContext.sparkSession) + + // Set scheduler pool + sqlContext.sparkSession.conf.getOption(SQLConf.THRIFTSERVER_POOL.key) match { + case Some(pool) => + sqlContext.sparkContext.setLocalProperty(SparkContext.SPARK_SCHEDULER_POOL, pool) + case None => + } + + // run the body + f + } finally { + // reset local properties, will also reset SPARK_SCHEDULER_POOL + sqlContext.sparkContext.setLocalProperties(originalProps) + + originalSession match { + case Some(session) => SparkSession.setActiveSession(session) + case None => SparkSession.clearActiveSession() + } + } + } + + def tableTypeString(tableType: CatalogTableType): String = tableType match { + case EXTERNAL | MANAGED => "TABLE" + case VIEW => "VIEW" + case t => + throw new IllegalArgumentException(s"Unknown table type is found: $t") + } + + protected def onError(): PartialFunction[Throwable, Unit] = { + case e: Throwable => + logError(s"Error operating $getType with $statementId", e) + super.setState(OperationState.ERROR) + HiveThriftServer2.eventManager.onStatementError( + statementId, e.getMessage, Utils.exceptionString(e)) + e match { + case _: HiveSQLException => throw e + case _ => throw new HiveSQLException(s"Error operating $getType ${e.getMessage}", e) + } + } +} diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala index c7848afd822d5..c3d3f29338b92 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala @@ -37,6 +37,7 @@ import org.apache.hadoop.hive.ql.session.SessionState import org.apache.hadoop.security.{Credentials, UserGroupInformation} import org.apache.log4j.Level import org.apache.thrift.transport.TSocket +import org.slf4j.LoggerFactory import sun.misc.{Signal, SignalHandler} import org.apache.spark.SparkConf @@ -59,6 +60,7 @@ private[hive] object SparkSQLCLIDriver extends Logging { private var transport: TSocket = _ private final val SPARK_HADOOP_PROP_PREFIX = "spark.hadoop." + initializeLogIfNecessary(true) installSignalHandler() /** @@ -131,7 +133,9 @@ private[hive] object SparkSQLCLIDriver extends Logging { UserGroupInformation.getCurrentUser.addCredentials(credentials) } - SharedState.loadHiveConfFile(sparkConf, conf) + val warehousePath = SharedState.resolveWarehousePath(sparkConf, conf) + val qualified = SharedState.qualifyWarehousePath(conf, warehousePath) + SharedState.setWarehousePathConf(sparkConf, conf, qualified) SessionState.start(sessionState) // Clean up after we exit @@ -165,10 +169,10 @@ private[hive] object SparkSQLCLIDriver extends Logging { } // The class loader of CliSessionState's conf is current main thread's class loader - // used to load jars passed by --jars. One class loader used by AddJarCommand is + // used to load jars passed by --jars. One class loader used by AddJarsCommand is // sharedState.jarClassLoader which contain jar path passed by --jars in main thread. // We set CliSessionState's conf class loader to sharedState.jarClassLoader. - // Thus we can load all jars passed by --jars and AddJarCommand. + // Thus we can load all jars passed by --jars and AddJarsCommand. sessionState.getConf.setClassLoader(SparkSQLEnv.sqlContext.sharedState.jarClassLoader) // TODO work around for set the log output to console, because the HiveContext @@ -197,6 +201,8 @@ private[hive] object SparkSQLCLIDriver extends Logging { SparkSQLEnv.sqlContext.setConf(k, v) } + cli.printMasterAndAppId + if (sessionState.execString != null) { System.exit(cli.processLine(sessionState.execString)) } @@ -266,8 +272,6 @@ private[hive] object SparkSQLCLIDriver extends Logging { def continuedPromptWithDBSpaces: String = continuedPrompt + ReflectionUtils.invokeStatic( classOf[CliDriver], "spacesForString", classOf[String] -> currentDB) - cli.printMasterAndAppId - var currentPrompt = promptWithCurrentDB var line = reader.readLine(currentPrompt + "> ") @@ -306,7 +310,9 @@ private[hive] object SparkSQLCLIDriver extends Logging { private[hive] class SparkSQLCLIDriver extends CliDriver with Logging { private val sessionState = SessionState.get().asInstanceOf[CliSessionState] - private val console = ThriftserverShimUtils.getConsole + private val LOG = LoggerFactory.getLogger(classOf[SparkSQLCLIDriver]) + + private val console = new SessionState.LogHelper(LOG) private val isRemoteMode = { SparkSQLCLIDriver.isRemoteMode(sessionState) @@ -400,7 +406,8 @@ private[hive] class SparkSQLCLIDriver extends CliDriver with Logging { val res = new JArrayList[String]() - if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_CLI_PRINT_HEADER)) { + if (HiveConf.getBoolVar(conf, HiveConf.ConfVars.HIVE_CLI_PRINT_HEADER) || + SparkSQLEnv.sqlContext.conf.cliPrintHeader) { // Print the column names. Option(driver.getSchema.getFieldSchemas).foreach { fields => out.println(fields.asScala.map(_.getName).mkString("\t")) @@ -461,7 +468,7 @@ private[hive] class SparkSQLCLIDriver extends CliDriver with Logging { oldSignal = Signal.handle(interruptSignal, new SignalHandler() { private var interruptRequested: Boolean = false - override def handle(signal: Signal) { + override def handle(signal: Signal): Unit = { val initialRequest = !interruptRequested interruptRequested = true @@ -499,7 +506,7 @@ private[hive] class SparkSQLCLIDriver extends CliDriver with Logging { val ignoreErrors = HiveConf.getBoolVar(conf, HiveConf.ConfVars.CLIIGNOREERRORS) if (ret != 0 && !ignoreErrors) { CommandProcessorFactory.clean(conf.asInstanceOf[HiveConf]) - ret + return ret } } } @@ -518,15 +525,32 @@ private[hive] class SparkSQLCLIDriver extends CliDriver with Logging { // Note: [SPARK-31595] if there is a `'` in a double quoted string, or a `"` in a single quoted // string, the origin implementation from Hive will not drop the trailing semicolon as expected, // hence we refined this function a little bit. + // Note: [SPARK-33100] Ignore a semicolon inside a bracketed comment in spark-sql. private def splitSemiColon(line: String): JList[String] = { var insideSingleQuote = false var insideDoubleQuote = false - var insideComment = false + var insideSimpleComment = false + var bracketedCommentLevel = 0 var escape = false var beginIndex = 0 + var leavingBracketedComment = false + var isStatement = false val ret = new JArrayList[String] + def insideBracketedComment: Boolean = bracketedCommentLevel > 0 + def insideComment: Boolean = insideSimpleComment || insideBracketedComment + def statementInProgress(index: Int): Boolean = isStatement || (!insideComment && + index > beginIndex && !s"${line.charAt(index)}".trim.isEmpty) + for (index <- 0 until line.length) { + // Checks if we need to decrement a bracketed comment level; the last character '/' of + // bracketed comments is still inside the comment, so `insideBracketedComment` must keep true + // in the previous loop and we decrement the level here if needed. + if (leavingBracketedComment) { + bracketedCommentLevel -= 1 + leavingBracketedComment = false + } + if (line.charAt(index) == '\'' && !insideComment) { // take a look to see if it is escaped // See the comment above about SPARK-31595 @@ -549,21 +573,34 @@ private[hive] class SparkSQLCLIDriver extends CliDriver with Logging { // Sample query: select "quoted value --" // ^^ avoids starting a comment if it's inside quotes. } else if (hasNext && line.charAt(index + 1) == '-') { - // ignore quotes and ; - insideComment = true + // ignore quotes and ; in simple comment + insideSimpleComment = true } } else if (line.charAt(index) == ';') { if (insideSingleQuote || insideDoubleQuote || insideComment) { // do not split } else { - // split, do not include ; itself - ret.add(line.substring(beginIndex, index)) + if (isStatement) { + // split, do not include ; itself + ret.add(line.substring(beginIndex, index)) + } beginIndex = index + 1 + isStatement = false } } else if (line.charAt(index) == '\n') { - // with a new line the inline comment should end. + // with a new line the inline simple comment should end. if (!escape) { - insideComment = false + insideSimpleComment = false + } + } else if (line.charAt(index) == '/' && !insideSimpleComment) { + val hasNext = index + 1 < line.length + if (insideSingleQuote || insideDoubleQuote) { + // Ignores '/' in any case of quotes + } else if (insideBracketedComment && line.charAt(index - 1) == '*' ) { + // Decrements `bracketedCommentLevel` at the beginning of the next loop + leavingBracketedComment = true + } else if (hasNext && !insideBracketedComment && line.charAt(index + 1) == '*') { + bracketedCommentLevel += 1 } } // set the escape @@ -572,8 +609,12 @@ private[hive] class SparkSQLCLIDriver extends CliDriver with Logging { } else if (line.charAt(index) == '\\') { escape = true } + + isStatement = statementInProgress(index) + } + if (isStatement) { + ret.add(line.substring(beginIndex)) } - ret.add(line.substring(beginIndex)) ret } } diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIService.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIService.scala index 1644ecb2453be..e9420ad21bebd 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIService.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIService.scala @@ -22,13 +22,13 @@ import java.util.{List => JList} import javax.security.auth.login.LoginException import scala.collection.JavaConverters._ +import scala.util.control.NonFatal -import org.apache.commons.logging.Log import org.apache.hadoop.hive.conf.HiveConf import org.apache.hadoop.hive.conf.HiveConf.ConfVars import org.apache.hadoop.hive.shims.Utils import org.apache.hadoop.security.{SecurityUtil, UserGroupInformation} -import org.apache.hive.service.{AbstractService, Service, ServiceException} +import org.apache.hive.service.{AbstractService, CompositeService, Service, ServiceException} import org.apache.hive.service.Service.STATE import org.apache.hive.service.auth.HiveAuthFactory import org.apache.hive.service.cli._ @@ -36,7 +36,6 @@ import org.apache.hive.service.server.HiveServer2 import org.slf4j.Logger import org.apache.spark.sql.SQLContext -import org.apache.spark.sql.hive.HiveUtils import org.apache.spark.sql.hive.thriftserver.ReflectionUtils._ private[hive] class SparkSQLCLIService(hiveServer: HiveServer2, sqlContext: SQLContext) @@ -94,17 +93,30 @@ private[hive] class SparkSQLCLIService(hiveServer: HiveServer2, sqlContext: SQLC initCompositeService(hiveConf) } + /** + * the super class [[CLIService#start]] starts a useless dummy metastore client, skip it and call + * the ancestor [[CompositeService#start]] directly. + */ + override def start(): Unit = startCompositeService() + override def getInfo(sessionHandle: SessionHandle, getInfoType: GetInfoType): GetInfoValue = { getInfoType match { case GetInfoType.CLI_SERVER_NAME => new GetInfoValue("Spark SQL") case GetInfoType.CLI_DBMS_NAME => new GetInfoValue("Spark SQL") case GetInfoType.CLI_DBMS_VER => new GetInfoValue(sqlContext.sparkContext.version) + case GetInfoType.CLI_ODBC_KEYWORDS => new GetInfoValue("Unimplemented") case _ => super.getInfo(sessionHandle, getInfoType) } } } private[thriftserver] trait ReflectedCompositeService { this: AbstractService => + + private val logInfo = (msg: String) => getAncestorField[Logger](this, 3, "LOG").info(msg) + + private val logError = (msg: String, e: Throwable) => + getAncestorField[Logger](this, 3, "LOG").error(msg, e) + def initCompositeService(hiveConf: HiveConf): Unit = { // Emulating `CompositeService.init(hiveConf)` val serviceList = getAncestorField[JList[Service]](this, 2, "serviceList") @@ -114,10 +126,30 @@ private[thriftserver] trait ReflectedCompositeService { this: AbstractService => invoke(classOf[AbstractService], this, "ensureCurrentState", classOf[STATE] -> STATE.NOTINITED) setAncestorField(this, 3, "hiveConf", hiveConf) invoke(classOf[AbstractService], this, "changeState", classOf[STATE] -> STATE.INITED) - if (HiveUtils.isHive23) { - getAncestorField[Logger](this, 3, "LOG").info(s"Service: $getName is inited.") - } else { - getAncestorField[Log](this, 3, "LOG").info(s"Service: $getName is inited.") + logInfo(s"Service: $getName is inited.") + } + + def startCompositeService(): Unit = { + // Emulating `CompositeService.start` + val serviceList = getAncestorField[JList[Service]](this, 2, "serviceList") + var serviceStartCount = 0 + try { + serviceList.asScala.foreach { service => + service.start() + serviceStartCount += 1 + } + // Emulating `AbstractService.start` + val startTime = new java.lang.Long(System.currentTimeMillis()) + setAncestorField(this, 3, "startTime", startTime) + invoke(classOf[AbstractService], this, "ensureCurrentState", classOf[STATE] -> STATE.INITED) + invoke(classOf[AbstractService], this, "changeState", classOf[STATE] -> STATE.STARTED) + logInfo(s"Service: $getName is started.") + } catch { + case NonFatal(e) => + logError(s"Error starting services $getName", e) + invoke(classOf[CompositeService], this, "stop", + classOf[Int] -> new Integer(serviceStartCount)) + throw new ServiceException("Failed to Start " + getName, e) } } } diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala index 12fba0eae6dce..8bc762fe99233 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLDriver.scala @@ -30,6 +30,7 @@ import org.apache.spark.internal.Logging import org.apache.spark.sql.{AnalysisException, SQLContext} import org.apache.spark.sql.execution.{QueryExecution, SQLExecution} import org.apache.spark.sql.execution.HiveResult.hiveResultString +import org.apache.spark.sql.internal.{SQLConf, VariableSubstitution} private[hive] class SparkSQLDriver(val context: SQLContext = SparkSQLEnv.sqlContext) @@ -59,7 +60,10 @@ private[hive] class SparkSQLDriver(val context: SQLContext = SparkSQLEnv.sqlCont override def run(command: String): CommandProcessorResponse = { // TODO unify the error code try { - context.sparkContext.setJobDescription(command) + val substitutorCommand = SQLConf.withExistingConf(context.conf) { + new VariableSubstitution().substitute(command) + } + context.sparkContext.setJobDescription(substitutorCommand) val execution = context.sessionState.executePlan(context.sql(command).logicalPlan) hiveResponse = SQLExecution.withNewExecutionId(execution) { hiveResultString(execution.executedPlan) diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnv.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnv.scala index 8944b93d9b697..291e426f148df 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnv.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnv.scala @@ -24,9 +24,10 @@ import org.apache.spark.{SparkConf, SparkContext} import org.apache.spark.internal.Logging import org.apache.spark.sql.{SparkSession, SQLContext} import org.apache.spark.sql.hive.{HiveExternalCatalog, HiveUtils} +import org.apache.spark.sql.internal.SQLConf import org.apache.spark.util.Utils -/** A singleton object for the master program. The slaves should not access this. */ +/** A singleton object for the master program. The executors should not access this. */ private[hive] object SparkSQLEnv extends Logging { logDebug("Initializing SparkSQLEnv") @@ -45,8 +46,13 @@ private[hive] object SparkSQLEnv extends Logging { sparkConf .setAppName(maybeAppName.getOrElse(s"SparkSQL::${Utils.localHostName()}")) + .set(SQLConf.DATETIME_JAVA8API_ENABLED, true) - val sparkSession = SparkSession.builder.config(sparkConf).enableHiveSupport().getOrCreate() + + val sparkSession = SparkSession.builder() + .config(sparkConf) + .config(HiveUtils.BUILTIN_HIVE_VERSION.key, HiveUtils.builtinHiveVersion) + .enableHiveSupport().getOrCreate() sparkContext = sparkSession.sparkContext sqlContext = sparkSession.sqlContext @@ -60,7 +66,6 @@ private[hive] object SparkSQLEnv extends Logging { metadataHive.setOut(new PrintStream(System.out, true, UTF_8.name())) metadataHive.setInfo(new PrintStream(System.err, true, UTF_8.name())) metadataHive.setError(new PrintStream(System.err, true, UTF_8.name())) - sparkSession.conf.set(HiveUtils.FAKE_HIVE_VERSION.key, HiveUtils.builtinHiveVersion) } } diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala index b3171897141c2..2312c8ed714c2 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala @@ -17,24 +17,24 @@ package org.apache.spark.sql.hive.thriftserver -import java.util.concurrent.Executors +import scala.util.control.NonFatal -import org.apache.commons.logging.Log import org.apache.hadoop.hive.conf.HiveConf -import org.apache.hadoop.hive.conf.HiveConf.ConfVars -import org.apache.hive.service.cli.SessionHandle +import org.apache.hive.service.cli.{HiveSQLException, SessionHandle} import org.apache.hive.service.cli.session.SessionManager +import org.apache.hive.service.rpc.thrift.TProtocolVersion import org.apache.hive.service.server.HiveServer2 +import org.apache.spark.internal.Logging import org.apache.spark.sql.SQLContext -import org.apache.spark.sql.hive.HiveUtils import org.apache.spark.sql.hive.thriftserver.ReflectionUtils._ import org.apache.spark.sql.hive.thriftserver.server.SparkSQLOperationManager +import org.apache.spark.sql.internal.SQLConf private[hive] class SparkSQLSessionManager(hiveServer: HiveServer2, sqlContext: SQLContext) extends SessionManager(hiveServer) - with ReflectedCompositeService { + with ReflectedCompositeService with Logging { private lazy val sparkSqlOperationManager = new SparkSQLOperationManager() @@ -44,7 +44,7 @@ private[hive] class SparkSQLSessionManager(hiveServer: HiveServer2, sqlContext: } override def openSession( - protocol: ThriftserverShimUtils.TProtocolVersion, + protocol: TProtocolVersion, username: String, passwd: String, ipAddress: String, @@ -54,23 +54,34 @@ private[hive] class SparkSQLSessionManager(hiveServer: HiveServer2, sqlContext: val sessionHandle = super.openSession(protocol, username, passwd, ipAddress, sessionConf, withImpersonation, delegationToken) - val session = super.getSession(sessionHandle) - HiveThriftServer2.eventManager.onSessionCreated( - session.getIpAddress, sessionHandle.getSessionId.toString, session.getUsername) - val ctx = if (sqlContext.conf.hiveThriftServerSingleSession) { - sqlContext - } else { - sqlContext.newSession() + try { + val session = super.getSession(sessionHandle) + HiveThriftServer2.eventManager.onSessionCreated( + session.getIpAddress, sessionHandle.getSessionId.toString, session.getUsername) + val ctx = if (sqlContext.conf.hiveThriftServerSingleSession) { + sqlContext + } else { + sqlContext.newSession() + } + ctx.setConf(SQLConf.DATETIME_JAVA8API_ENABLED, true) + val hiveSessionState = session.getSessionState + setConfMap(ctx, hiveSessionState.getOverriddenConfigurations) + setConfMap(ctx, hiveSessionState.getHiveVariables) + if (sessionConf != null && sessionConf.containsKey("use:database")) { + ctx.sql(s"use ${sessionConf.get("use:database")}") + } + sparkSqlOperationManager.sessionToContexts.put(sessionHandle, ctx) + sessionHandle + } catch { + case NonFatal(e) => + try { + closeSession(sessionHandle) + } catch { + case NonFatal(inner) => + logWarning("Error closing session", inner) + } + throw new HiveSQLException("Failed to open new session: " + e, e) } - ctx.setConf(HiveUtils.FAKE_HIVE_VERSION.key, HiveUtils.builtinHiveVersion) - val hiveSessionState = session.getSessionState - setConfMap(ctx, hiveSessionState.getOverriddenConfigurations) - setConfMap(ctx, hiveSessionState.getHiveVariables) - if (sessionConf != null && sessionConf.containsKey("use:database")) { - ctx.sql(s"use ${sessionConf.get("use:database")}") - } - sparkSqlOperationManager.sessionToContexts.put(sessionHandle, ctx) - sessionHandle } override def closeSession(sessionHandle: SessionHandle): Unit = { @@ -78,7 +89,6 @@ private[hive] class SparkSQLSessionManager(hiveServer: HiveServer2, sqlContext: val ctx = sparkSqlOperationManager.sessionToContexts.getOrDefault(sessionHandle, sqlContext) ctx.sparkSession.sessionState.catalog.getTempViewNames().foreach(ctx.uncacheTable) super.closeSession(sessionHandle) - sparkSqlOperationManager.sessionToActivePool.remove(sessionHandle) sparkSqlOperationManager.sessionToContexts.remove(sessionHandle) } diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala index 3396560f43502..ba42eefed2a22 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/server/SparkSQLOperationManager.scala @@ -38,21 +38,21 @@ private[thriftserver] class SparkSQLOperationManager() val handleToOperation = ReflectionUtils .getSuperField[JMap[OperationHandle, Operation]](this, "handleToOperation") - val sessionToActivePool = new ConcurrentHashMap[SessionHandle, String]() val sessionToContexts = new ConcurrentHashMap[SessionHandle, SQLContext]() override def newExecuteStatementOperation( parentSession: HiveSession, statement: String, confOverlay: JMap[String, String], - async: Boolean): ExecuteStatementOperation = synchronized { + async: Boolean, + queryTimeout: Long): ExecuteStatementOperation = synchronized { val sqlContext = sessionToContexts.get(parentSession.getSessionHandle) require(sqlContext != null, s"Session handle: ${parentSession.getSessionHandle} has not been" + s" initialized or had already closed.") val conf = sqlContext.sessionState.conf val runInBackground = async && conf.getConf(HiveUtils.HIVE_THRIFT_SERVER_ASYNC) - val operation = new SparkExecuteStatementOperation(parentSession, statement, confOverlay, - runInBackground)(sqlContext, sessionToActivePool) + val operation = new SparkExecuteStatementOperation( + sqlContext, parentSession, statement, confOverlay, runInBackground, queryTimeout) handleToOperation.put(operation.getHandle, operation) logDebug(s"Created Operation for $statement with session=$parentSession, " + s"runInBackground=$runInBackground") diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2AppStatusStore.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2AppStatusStore.scala index 5cb78f6e64650..8bd8f29a4b9ec 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2AppStatusStore.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2AppStatusStore.scala @@ -119,6 +119,7 @@ private[thriftserver] class ExecutionInfo( def isExecutionActive: Boolean = { !(state == ExecutionState.FAILED || state == ExecutionState.CANCELED || + state == ExecutionState.TIMEDOUT || state == ExecutionState.CLOSED) } diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2EventManager.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2EventManager.scala index fa04c67896a69..202fdf33c0dd9 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2EventManager.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2EventManager.scala @@ -57,6 +57,10 @@ private[thriftserver] class HiveThriftServer2EventManager(sc: SparkContext) { postLiveListenerBus(SparkListenerThriftServerOperationCanceled(id, System.currentTimeMillis())) } + def onStatementTimeout(id: String): Unit = { + postLiveListenerBus(SparkListenerThriftServerOperationTimeout(id, System.currentTimeMillis())) + } + def onStatementError(id: String, errorMsg: String, errorTrace: String): Unit = { postLiveListenerBus(SparkListenerThriftServerOperationError(id, errorMsg, errorTrace, System.currentTimeMillis())) @@ -96,6 +100,9 @@ private[thriftserver] case class SparkListenerThriftServerOperationParsed( private[thriftserver] case class SparkListenerThriftServerOperationCanceled( id: String, finishTime: Long) extends SparkListenerEvent +private[thriftserver] case class SparkListenerThriftServerOperationTimeout( + id: String, finishTime: Long) extends SparkListenerEvent + private[thriftserver] case class SparkListenerThriftServerOperationError( id: String, errorMsg: String, diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2Listener.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2Listener.scala index 6d0a506fa94dc..4cf672e3d9d9e 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2Listener.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2Listener.scala @@ -25,6 +25,7 @@ import scala.collection.mutable.ArrayBuffer import org.apache.hive.service.server.HiveServer2 import org.apache.spark.{SparkConf, SparkContext} +import org.apache.spark.internal.Logging import org.apache.spark.internal.config.Status.LIVE_ENTITY_UPDATE_PERIOD import org.apache.spark.scheduler._ import org.apache.spark.sql.hive.thriftserver.HiveThriftServer2.ExecutionState @@ -38,7 +39,7 @@ private[thriftserver] class HiveThriftServer2Listener( kvstore: ElementTrackingStore, sparkConf: SparkConf, server: Option[HiveServer2], - live: Boolean = true) extends SparkListener { + live: Boolean = true) extends SparkListener with Logging { private val sessionList = new ConcurrentHashMap[String, LiveSessionData]() private val executionList = new ConcurrentHashMap[String, LiveExecutionData]() @@ -118,6 +119,7 @@ private[thriftserver] class HiveThriftServer2Listener( case e: SparkListenerThriftServerOperationStart => onOperationStart(e) case e: SparkListenerThriftServerOperationParsed => onOperationParsed(e) case e: SparkListenerThriftServerOperationCanceled => onOperationCanceled(e) + case e: SparkListenerThriftServerOperationTimeout => onOperationTimeout(e) case e: SparkListenerThriftServerOperationError => onOperationError(e) case e: SparkListenerThriftServerOperationFinish => onOperationFinished(e) case e: SparkListenerThriftServerOperationClosed => onOperationClosed(e) @@ -131,60 +133,92 @@ private[thriftserver] class HiveThriftServer2Listener( updateLiveStore(session) } - private def onSessionClosed(e: SparkListenerThriftServerSessionClosed): Unit = { - val session = sessionList.get(e.sessionId) - session.finishTimestamp = e.finishTime - updateStoreWithTriggerEnabled(session) - sessionList.remove(e.sessionId) - } + private def onSessionClosed(e: SparkListenerThriftServerSessionClosed): Unit = + Option(sessionList.get(e.sessionId)) match { + case Some(sessionData) => + sessionData.finishTimestamp = e.finishTime + updateStoreWithTriggerEnabled(sessionData) + sessionList.remove(e.sessionId) + case None => logWarning(s"onSessionClosed called with unknown session id: ${e.sessionId}") + } private def onOperationStart(e: SparkListenerThriftServerOperationStart): Unit = { - val info = getOrCreateExecution( + val executionData = getOrCreateExecution( e.id, e.statement, e.sessionId, e.startTime, e.userName) - info.state = ExecutionState.STARTED - executionList.put(e.id, info) - sessionList.get(e.sessionId).totalExecution += 1 - executionList.get(e.id).groupId = e.groupId - updateLiveStore(executionList.get(e.id)) - updateLiveStore(sessionList.get(e.sessionId)) + executionData.state = ExecutionState.STARTED + executionList.put(e.id, executionData) + executionData.groupId = e.groupId + updateLiveStore(executionData) + + Option(sessionList.get(e.sessionId)) match { + case Some(sessionData) => + sessionData.totalExecution += 1 + updateLiveStore(sessionData) + case None => logWarning(s"onOperationStart called with unknown session id: ${e.sessionId}." + + s"Regardless, the operation has been registered.") + } } - private def onOperationParsed(e: SparkListenerThriftServerOperationParsed): Unit = { - executionList.get(e.id).executePlan = e.executionPlan - executionList.get(e.id).state = ExecutionState.COMPILED - updateLiveStore(executionList.get(e.id)) - } + private def onOperationParsed(e: SparkListenerThriftServerOperationParsed): Unit = + Option(executionList.get(e.id)) match { + case Some(executionData) => + executionData.executePlan = e.executionPlan + executionData.state = ExecutionState.COMPILED + updateLiveStore(executionData) + case None => logWarning(s"onOperationParsed called with unknown operation id: ${e.id}") + } - private def onOperationCanceled(e: SparkListenerThriftServerOperationCanceled): Unit = { - executionList.get(e.id).finishTimestamp = e.finishTime - executionList.get(e.id).state = ExecutionState.CANCELED - updateLiveStore(executionList.get(e.id)) - } + private def onOperationCanceled(e: SparkListenerThriftServerOperationCanceled): Unit = + Option(executionList.get(e.id)) match { + case Some(executionData) => + executionData.finishTimestamp = e.finishTime + executionData.state = ExecutionState.CANCELED + updateLiveStore(executionData) + case None => logWarning(s"onOperationCanceled called with unknown operation id: ${e.id}") + } - private def onOperationError(e: SparkListenerThriftServerOperationError): Unit = { - executionList.get(e.id).finishTimestamp = e.finishTime - executionList.get(e.id).detail = e.errorMsg - executionList.get(e.id).state = ExecutionState.FAILED - updateLiveStore(executionList.get(e.id)) - } + private def onOperationTimeout(e: SparkListenerThriftServerOperationTimeout): Unit = + Option(executionList.get(e.id)) match { + case Some(executionData) => + executionData.finishTimestamp = e.finishTime + executionData.state = ExecutionState.TIMEDOUT + updateLiveStore(executionData) + case None => logWarning(s"onOperationCanceled called with unknown operation id: ${e.id}") + } - private def onOperationFinished(e: SparkListenerThriftServerOperationFinish): Unit = { - executionList.get(e.id).finishTimestamp = e.finishTime - executionList.get(e.id).state = ExecutionState.FINISHED - updateLiveStore(executionList.get(e.id)) - } + private def onOperationError(e: SparkListenerThriftServerOperationError): Unit = + Option(executionList.get(e.id)) match { + case Some(executionData) => + executionData.finishTimestamp = e.finishTime + executionData.detail = e.errorMsg + executionData.state = ExecutionState.FAILED + updateLiveStore(executionData) + case None => logWarning(s"onOperationError called with unknown operation id: ${e.id}") + } - private def onOperationClosed(e: SparkListenerThriftServerOperationClosed): Unit = { - executionList.get(e.id).closeTimestamp = e.closeTime - executionList.get(e.id).state = ExecutionState.CLOSED - updateStoreWithTriggerEnabled(executionList.get(e.id)) - executionList.remove(e.id) - } + private def onOperationFinished(e: SparkListenerThriftServerOperationFinish): Unit = + Option(executionList.get(e.id)) match { + case Some(executionData) => + executionData.finishTimestamp = e.finishTime + executionData.state = ExecutionState.FINISHED + updateLiveStore(executionData) + case None => logWarning(s"onOperationFinished called with unknown operation id: ${e.id}") + } + + private def onOperationClosed(e: SparkListenerThriftServerOperationClosed): Unit = + Option(executionList.get(e.id)) match { + case Some(executionData) => + executionData.closeTimestamp = e.closeTime + executionData.state = ExecutionState.CLOSED + updateStoreWithTriggerEnabled(executionData) + executionList.remove(e.id) + case None => logWarning(s"onOperationClosed called with unknown operation id: ${e.id}") + } // Update both live and history stores. Trigger is enabled by default, hence // it will cleanup the entity which exceeds the threshold. diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala index 7fb755c292b38..54a40e3990f09 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerPage.scala @@ -19,11 +19,9 @@ package org.apache.spark.sql.hive.thriftserver.ui import java.net.URLEncoder import java.nio.charset.StandardCharsets.UTF_8 -import java.util.Calendar import javax.servlet.http.HttpServletRequest -import scala.collection.JavaConverters._ -import scala.xml.{Node, Unparsed} +import scala.xml.Node import org.apache.commons.text.StringEscapeUtils @@ -78,26 +76,8 @@ private[ui] class ThriftServerPage(parent: ThriftServerTab) extends WebUIPage("" val sqlTableTag = "sqlstat" - val parameterOtherTable = request.getParameterMap().asScala - .filterNot(_._1.startsWith(sqlTableTag)) - .map { case (name, vals) => - name + "=" + vals(0) - } - - val parameterSqlTablePage = request.getParameter(s"$sqlTableTag.page") - val parameterSqlTableSortColumn = request.getParameter(s"$sqlTableTag.sort") - val parameterSqlTableSortDesc = request.getParameter(s"$sqlTableTag.desc") - val parameterSqlPageSize = request.getParameter(s"$sqlTableTag.pageSize") - - val sqlTablePage = Option(parameterSqlTablePage).map(_.toInt).getOrElse(1) - val sqlTableSortColumn = Option(parameterSqlTableSortColumn).map { sortColumn => - UIUtils.decodeURLParameter(sortColumn) - }.getOrElse("Start Time") - val sqlTableSortDesc = Option(parameterSqlTableSortDesc).map(_.toBoolean).getOrElse( - // New executions should be shown above old executions by default. - sqlTableSortColumn == "Start Time" - ) - val sqlTablePageSize = Option(parameterSqlPageSize).map(_.toInt).getOrElse(100) + val sqlTablePage = + Option(request.getParameter(s"$sqlTableTag.page")).map(_.toInt).getOrElse(1) try { Some(new SqlStatsPagedTable( @@ -106,12 +86,7 @@ private[ui] class ThriftServerPage(parent: ThriftServerTab) extends WebUIPage("" store.getExecutionList, "sqlserver", UIUtils.prependBaseUri(request, parent.basePath), - parameterOtherTable, - sqlTableTag, - pageSize = sqlTablePageSize, - sortColumn = sqlTableSortColumn, - desc = sqlTableSortDesc - ).table(sqlTablePage)) + sqlTableTag).table(sqlTablePage)) } catch { case e@(_: IllegalArgumentException | _: IndexOutOfBoundsException) => Some(
@@ -146,26 +121,8 @@ private[ui] class ThriftServerPage(parent: ThriftServerTab) extends WebUIPage("" val sessionTableTag = "sessionstat" - val parameterOtherTable = request.getParameterMap().asScala - .filterNot(_._1.startsWith(sessionTableTag)) - .map { case (name, vals) => - name + "=" + vals(0) - } - - val parameterSessionTablePage = request.getParameter(s"$sessionTableTag.page") - val parameterSessionTableSortColumn = request.getParameter(s"$sessionTableTag.sort") - val parameterSessionTableSortDesc = request.getParameter(s"$sessionTableTag.desc") - val parameterSessionPageSize = request.getParameter(s"$sessionTableTag.pageSize") - - val sessionTablePage = Option(parameterSessionTablePage).map(_.toInt).getOrElse(1) - val sessionTableSortColumn = Option(parameterSessionTableSortColumn).map { sortColumn => - UIUtils.decodeURLParameter(sortColumn) - }.getOrElse("Start Time") - val sessionTableSortDesc = Option(parameterSessionTableSortDesc).map(_.toBoolean).getOrElse( - // New session should be shown above old session by default. - (sessionTableSortColumn == "Start Time") - ) - val sessionTablePageSize = Option(parameterSessionPageSize).map(_.toInt).getOrElse(100) + val sessionTablePage = + Option(request.getParameter(s"$sessionTableTag.page")).map(_.toInt).getOrElse(1) try { Some(new SessionStatsPagedTable( @@ -174,11 +131,7 @@ private[ui] class ThriftServerPage(parent: ThriftServerTab) extends WebUIPage("" store.getSessionList, "sqlserver", UIUtils.prependBaseUri(request, parent.basePath), - parameterOtherTable, - sessionTableTag, - pageSize = sessionTablePageSize, - sortColumn = sessionTableSortColumn, - desc = sessionTableSortDesc + sessionTableTag ).table(sessionTablePage)) } catch { case e@(_: IllegalArgumentException | _: IndexOutOfBoundsException) => @@ -216,104 +169,59 @@ private[ui] class SqlStatsPagedTable( data: Seq[ExecutionInfo], subPath: String, basePath: String, - parameterOtherTable: Iterable[String], - sqlStatsTableTag: String, - pageSize: Int, - sortColumn: String, - desc: Boolean) extends PagedTable[SqlStatsTableRow] { + sqlStatsTableTag: String) extends PagedTable[SqlStatsTableRow] { - override val dataSource = new SqlStatsTableDataSource(data, pageSize, sortColumn, desc) + private val (sortColumn, desc, pageSize) = + getTableParameters(request, sqlStatsTableTag, "Start Time") + + private val encodedSortColumn = URLEncoder.encode(sortColumn, UTF_8.name()) + + private val parameterPath = + s"$basePath/$subPath/?${getParameterOtherTable(request, sqlStatsTableTag)}" - private val parameterPath = s"$basePath/$subPath/?${parameterOtherTable.mkString("&")}" + override val dataSource = new SqlStatsTableDataSource(data, pageSize, sortColumn, desc) override def tableId: String = sqlStatsTableTag override def tableCssClass: String = - "table table-bordered table-sm table-striped " + - "table-head-clickable table-cell-width-limited" + "table table-bordered table-sm table-striped table-head-clickable table-cell-width-limited" override def pageLink(page: Int): String = { - val encodedSortColumn = URLEncoder.encode(sortColumn, UTF_8.name()) parameterPath + s"&$pageNumberFormField=$page" + s"&$sqlStatsTableTag.sort=$encodedSortColumn" + s"&$sqlStatsTableTag.desc=$desc" + - s"&$pageSizeFormField=$pageSize" + s"&$pageSizeFormField=$pageSize" + + s"#$sqlStatsTableTag" } override def pageSizeFormField: String = s"$sqlStatsTableTag.pageSize" override def pageNumberFormField: String = s"$sqlStatsTableTag.page" - override def goButtonFormPath: String = { - val encodedSortColumn = URLEncoder.encode(sortColumn, UTF_8.name()) - s"$parameterPath&$sqlStatsTableTag.sort=$encodedSortColumn&$sqlStatsTableTag.desc=$desc" - } + override def goButtonFormPath: String = + s"$parameterPath&$sqlStatsTableTag.sort=$encodedSortColumn" + + s"&$sqlStatsTableTag.desc=$desc#$sqlStatsTableTag" override def headers: Seq[Node] = { - val sqlTableHeaders = Seq("User", "JobID", "GroupID", "Start Time", "Finish Time", - "Close Time", "Execution Time", "Duration", "Statement", "State", "Detail") - - val tooltips = Seq(None, None, None, None, Some(THRIFT_SERVER_FINISH_TIME), - Some(THRIFT_SERVER_CLOSE_TIME), Some(THRIFT_SERVER_EXECUTION), - Some(THRIFT_SERVER_DURATION), None, None, None) - - assert(sqlTableHeaders.length == tooltips.length) - - val headerRow: Seq[Node] = { - sqlTableHeaders.zip(tooltips).map { case (header, tooltip) => - if (header == sortColumn) { - val headerLink = Unparsed( - parameterPath + - s"&$sqlStatsTableTag.sort=${URLEncoder.encode(header, UTF_8.name())}" + - s"&$sqlStatsTableTag.desc=${!desc}" + - s"&$sqlStatsTableTag.pageSize=$pageSize" + - s"#$sqlStatsTableTag") - val arrow = if (desc) "▾" else "▴" // UP or DOWN - - if (tooltip.nonEmpty) { - - - - {header} {Unparsed(arrow)} - - - - } else { - - - {header} {Unparsed(arrow)} - - - } - } else { - val headerLink = Unparsed( - parameterPath + - s"&$sqlStatsTableTag.sort=${URLEncoder.encode(header, UTF_8.name())}" + - s"&$sqlStatsTableTag.pageSize=$pageSize" + - s"#$sqlStatsTableTag") - - if(tooltip.nonEmpty) { - - - - {header} - - - - } else { - - - {header} - - - } - } - } - } - - {headerRow} - + val sqlTableHeadersAndTooltips: Seq[(String, Boolean, Option[String])] = + Seq( + ("User", true, None), + ("JobID", true, None), + ("GroupID", true, None), + ("Start Time", true, None), + ("Finish Time", true, Some(THRIFT_SERVER_FINISH_TIME)), + ("Close Time", true, Some(THRIFT_SERVER_CLOSE_TIME)), + ("Execution Time", true, Some(THRIFT_SERVER_EXECUTION)), + ("Duration", true, Some(THRIFT_SERVER_DURATION)), + ("Statement", true, None), + ("State", true, None), + ("Detail", true, None)) + + isSortColumnValid(sqlTableHeadersAndTooltips, sortColumn) + + headerRow(sqlTableHeadersAndTooltips, desc, pageSize, sortColumn, parameterPath, + sqlStatsTableTag, sqlStatsTableTag) } override def row(sqlStatsTableRow: SqlStatsTableRow): Seq[Node] = { @@ -391,101 +299,55 @@ private[ui] class SessionStatsPagedTable( data: Seq[SessionInfo], subPath: String, basePath: String, - parameterOtherTable: Iterable[String], - sessionStatsTableTag: String, - pageSize: Int, - sortColumn: String, - desc: Boolean) extends PagedTable[SessionInfo] { + sessionStatsTableTag: String) extends PagedTable[SessionInfo] { - override val dataSource = new SessionStatsTableDataSource(data, pageSize, sortColumn, desc) + private val (sortColumn, desc, pageSize) = + getTableParameters(request, sessionStatsTableTag, "Start Time") + + private val encodedSortColumn = URLEncoder.encode(sortColumn, UTF_8.name()) - private val parameterPath = s"$basePath/$subPath/?${parameterOtherTable.mkString("&")}" + private val parameterPath = + s"$basePath/$subPath/?${getParameterOtherTable(request, sessionStatsTableTag)}" + + override val dataSource = new SessionStatsTableDataSource(data, pageSize, sortColumn, desc) override def tableId: String = sessionStatsTableTag override def tableCssClass: String = - "table table-bordered table-sm table-striped " + - "table-head-clickable table-cell-width-limited" + "table table-bordered table-sm table-striped table-head-clickable table-cell-width-limited" override def pageLink(page: Int): String = { - val encodedSortColumn = URLEncoder.encode(sortColumn, UTF_8.name()) parameterPath + s"&$pageNumberFormField=$page" + s"&$sessionStatsTableTag.sort=$encodedSortColumn" + s"&$sessionStatsTableTag.desc=$desc" + - s"&$pageSizeFormField=$pageSize" + s"&$pageSizeFormField=$pageSize" + + s"#$sessionStatsTableTag" } override def pageSizeFormField: String = s"$sessionStatsTableTag.pageSize" override def pageNumberFormField: String = s"$sessionStatsTableTag.page" - override def goButtonFormPath: String = { - val encodedSortColumn = URLEncoder.encode(sortColumn, UTF_8.name()) - s"$parameterPath&$sessionStatsTableTag.sort=$encodedSortColumn&$sessionStatsTableTag.desc=$desc" - } + override def goButtonFormPath: String = + s"$parameterPath&$sessionStatsTableTag.sort=$encodedSortColumn" + + s"&$sessionStatsTableTag.desc=$desc#$sessionStatsTableTag" override def headers: Seq[Node] = { - val sessionTableHeaders = - Seq("User", "IP", "Session ID", "Start Time", "Finish Time", "Duration", "Total Execute") - - val tooltips = Seq(None, None, None, None, None, Some(THRIFT_SESSION_DURATION), - Some(THRIFT_SESSION_TOTAL_EXECUTE)) - assert(sessionTableHeaders.length == tooltips.length) - val colWidthAttr = s"${100.toDouble / sessionTableHeaders.size}%" - - val headerRow: Seq[Node] = { - sessionTableHeaders.zip(tooltips).map { case (header, tooltip) => - if (header == sortColumn) { - val headerLink = Unparsed( - parameterPath + - s"&$sessionStatsTableTag.sort=${URLEncoder.encode(header, UTF_8.name())}" + - s"&$sessionStatsTableTag.desc=${!desc}" + - s"&$sessionStatsTableTag.pageSize=$pageSize" + - s"#$sessionStatsTableTag") - val arrow = if (desc) "▾" else "▴" // UP or DOWN - - - { - if (tooltip.nonEmpty) { - - {header} {Unparsed(arrow)} - - } else { - - {header} {Unparsed(arrow)} - - } - } - - - - } else { - val headerLink = Unparsed( - parameterPath + - s"&$sessionStatsTableTag.sort=${URLEncoder.encode(header, UTF_8.name())}" + - s"&$sessionStatsTableTag.pageSize=$pageSize" + - s"#$sessionStatsTableTag") - - - - { - if (tooltip.nonEmpty) { - - {header} - - } else { - {header} - } - } - - - } - } - } - - {headerRow} - + val sessionTableHeadersAndTooltips: Seq[(String, Boolean, Option[String])] = + Seq( + ("User", true, None), + ("IP", true, None), + ("Session ID", true, None), + ("Start Time", true, None), + ("Finish Time", true, None), + ("Duration", true, Some(THRIFT_SESSION_DURATION)), + ("Total Execute", true, Some(THRIFT_SESSION_TOTAL_EXECUTE))) + + isSortColumnValid(sessionTableHeadersAndTooltips, sortColumn) + + headerRow(sessionTableHeadersAndTooltips, desc, pageSize, sortColumn, + parameterPath, sessionStatsTableTag, sessionStatsTableTag) } override def row(session: SessionInfo): Seq[Node] = { @@ -503,108 +365,94 @@ private[ui] class SessionStatsPagedTable( } } - private[ui] class SqlStatsTableRow( +private[ui] class SqlStatsTableRow( val jobId: Seq[String], val duration: Long, val executionTime: Long, val executionInfo: ExecutionInfo, val detail: String) - private[ui] class SqlStatsTableDataSource( +private[ui] class SqlStatsTableDataSource( info: Seq[ExecutionInfo], pageSize: Int, sortColumn: String, desc: Boolean) extends PagedDataSource[SqlStatsTableRow](pageSize) { - // Convert ExecutionInfo to SqlStatsTableRow which contains the final contents to show in - // the table so that we can avoid creating duplicate contents during sorting the data - private val data = info.map(sqlStatsTableRow).sorted(ordering(sortColumn, desc)) + // Convert ExecutionInfo to SqlStatsTableRow which contains the final contents to show in + // the table so that we can avoid creating duplicate contents during sorting the data + private val data = info.map(sqlStatsTableRow).sorted(ordering(sortColumn, desc)) - private var _slicedStartTime: Set[Long] = null + override def dataSize: Int = data.size - override def dataSize: Int = data.size + override def sliceData(from: Int, to: Int): Seq[SqlStatsTableRow] = data.slice(from, to) - override def sliceData(from: Int, to: Int): Seq[SqlStatsTableRow] = { - val r = data.slice(from, to) - _slicedStartTime = r.map(_.executionInfo.startTimestamp).toSet - r - } + private def sqlStatsTableRow(executionInfo: ExecutionInfo): SqlStatsTableRow = { + val duration = executionInfo.totalTime(executionInfo.closeTimestamp) + val executionTime = executionInfo.totalTime(executionInfo.finishTimestamp) + val detail = Option(executionInfo.detail).filter(!_.isEmpty) + .getOrElse(executionInfo.executePlan) + val jobId = executionInfo.jobId.toSeq.sorted - private def sqlStatsTableRow(executionInfo: ExecutionInfo): SqlStatsTableRow = { - val duration = executionInfo.totalTime(executionInfo.closeTimestamp) - val executionTime = executionInfo.totalTime(executionInfo.finishTimestamp) - val detail = Option(executionInfo.detail).filter(!_.isEmpty) - .getOrElse(executionInfo.executePlan) - val jobId = executionInfo.jobId.toSeq.sorted - - new SqlStatsTableRow(jobId, duration, executionTime, executionInfo, detail) + new SqlStatsTableRow(jobId, duration, executionTime, executionInfo, detail) + } + /** + * Return Ordering according to sortColumn and desc. + */ + private def ordering(sortColumn: String, desc: Boolean): Ordering[SqlStatsTableRow] = { + val ordering: Ordering[SqlStatsTableRow] = sortColumn match { + case "User" => Ordering.by(_.executionInfo.userName) + case "JobID" => Ordering by (_.jobId.headOption) + case "GroupID" => Ordering.by(_.executionInfo.groupId) + case "Start Time" => Ordering.by(_.executionInfo.startTimestamp) + case "Finish Time" => Ordering.by(_.executionInfo.finishTimestamp) + case "Close Time" => Ordering.by(_.executionInfo.closeTimestamp) + case "Execution Time" => Ordering.by(_.executionTime) + case "Duration" => Ordering.by(_.duration) + case "Statement" => Ordering.by(_.executionInfo.statement) + case "State" => Ordering.by(_.executionInfo.state) + case "Detail" => Ordering.by(_.detail) + case unknownColumn => throw new IllegalArgumentException(s"Unknown column: $unknownColumn") } - - /** - * Return Ordering according to sortColumn and desc. - */ - private def ordering(sortColumn: String, desc: Boolean): Ordering[SqlStatsTableRow] = { - val ordering: Ordering[SqlStatsTableRow] = sortColumn match { - case "User" => Ordering.by(_.executionInfo.userName) - case "JobID" => Ordering by (_.jobId.headOption) - case "GroupID" => Ordering.by(_.executionInfo.groupId) - case "Start Time" => Ordering.by(_.executionInfo.startTimestamp) - case "Finish Time" => Ordering.by(_.executionInfo.finishTimestamp) - case "Close Time" => Ordering.by(_.executionInfo.closeTimestamp) - case "Execution Time" => Ordering.by(_.executionTime) - case "Duration" => Ordering.by(_.duration) - case "Statement" => Ordering.by(_.executionInfo.statement) - case "State" => Ordering.by(_.executionInfo.state) - case "Detail" => Ordering.by(_.detail) - case unknownColumn => throw new IllegalArgumentException(s"Unknown column: $unknownColumn") - } - if (desc) { - ordering.reverse - } else { - ordering - } + if (desc) { + ordering.reverse + } else { + ordering } - } +} - private[ui] class SessionStatsTableDataSource( +private[ui] class SessionStatsTableDataSource( info: Seq[SessionInfo], pageSize: Int, sortColumn: String, desc: Boolean) extends PagedDataSource[SessionInfo](pageSize) { - // Sorting SessionInfo data - private val data = info.sorted(ordering(sortColumn, desc)) - - private var _slicedStartTime: Set[Long] = null - - override def dataSize: Int = data.size - - override def sliceData(from: Int, to: Int): Seq[SessionInfo] = { - val r = data.slice(from, to) - _slicedStartTime = r.map(_.startTimestamp).toSet - r + // Sorting SessionInfo data + private val data = info.sorted(ordering(sortColumn, desc)) + + override def dataSize: Int = data.size + + override def sliceData(from: Int, to: Int): Seq[SessionInfo] = data.slice(from, to) + + /** + * Return Ordering according to sortColumn and desc. + */ + private def ordering(sortColumn: String, desc: Boolean): Ordering[SessionInfo] = { + val ordering: Ordering[SessionInfo] = sortColumn match { + case "User" => Ordering.by(_.userName) + case "IP" => Ordering.by(_.ip) + case "Session ID" => Ordering.by(_.sessionId) + case "Start Time" => Ordering by (_.startTimestamp) + case "Finish Time" => Ordering.by(_.finishTimestamp) + case "Duration" => Ordering.by(_.totalTime) + case "Total Execute" => Ordering.by(_.totalExecution) + case unknownColumn => throw new IllegalArgumentException(s"Unknown column: $unknownColumn") } - - /** - * Return Ordering according to sortColumn and desc. - */ - private def ordering(sortColumn: String, desc: Boolean): Ordering[SessionInfo] = { - val ordering: Ordering[SessionInfo] = sortColumn match { - case "User" => Ordering.by(_.userName) - case "IP" => Ordering.by(_.ip) - case "Session ID" => Ordering.by(_.sessionId) - case "Start Time" => Ordering by (_.startTimestamp) - case "Finish Time" => Ordering.by(_.finishTimestamp) - case "Duration" => Ordering.by(_.totalTime) - case "Total Execute" => Ordering.by(_.totalExecution) - case unknownColumn => throw new IllegalArgumentException(s"Unknown column: $unknownColumn") - } - if (desc) { - ordering.reverse - } else { - ordering - } + if (desc) { + ordering.reverse + } else { + ordering } } +} diff --git a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala index 2d7adf552738c..87165cc8cac45 100644 --- a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala +++ b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/ui/ThriftServerSessionPage.scala @@ -19,7 +19,6 @@ package org.apache.spark.sql.hive.thriftserver.ui import javax.servlet.http.HttpServletRequest -import scala.collection.JavaConverters._ import scala.xml.Node import org.apache.spark.internal.Logging @@ -77,26 +76,8 @@ private[ui] class ThriftServerSessionPage(parent: ThriftServerTab) val sqlTableTag = "sqlsessionstat" - val parameterOtherTable = request.getParameterMap().asScala - .filterNot(_._1.startsWith(sqlTableTag)) - .map { case (name, vals) => - name + "=" + vals(0) - } - - val parameterSqlTablePage = request.getParameter(s"$sqlTableTag.page") - val parameterSqlTableSortColumn = request.getParameter(s"$sqlTableTag.sort") - val parameterSqlTableSortDesc = request.getParameter(s"$sqlTableTag.desc") - val parameterSqlPageSize = request.getParameter(s"$sqlTableTag.pageSize") - - val sqlTablePage = Option(parameterSqlTablePage).map(_.toInt).getOrElse(1) - val sqlTableSortColumn = Option(parameterSqlTableSortColumn).map { sortColumn => - UIUtils.decodeURLParameter(sortColumn) - }.getOrElse("Start Time") - val sqlTableSortDesc = Option(parameterSqlTableSortDesc).map(_.toBoolean).getOrElse( - // New executions should be shown above old executions by default. - sqlTableSortColumn == "Start Time" - ) - val sqlTablePageSize = Option(parameterSqlPageSize).map(_.toInt).getOrElse(100) + val sqlTablePage = + Option(request.getParameter(s"$sqlTableTag.page")).map(_.toInt).getOrElse(1) try { Some(new SqlStatsPagedTable( @@ -105,11 +86,7 @@ private[ui] class ThriftServerSessionPage(parent: ThriftServerTab) executionList, "sqlserver/session", UIUtils.prependBaseUri(request, parent.basePath), - parameterOtherTable, - sqlTableTag, - pageSize = sqlTablePageSize, - sortColumn = sqlTableSortColumn, - desc = sqlTableSortDesc + sqlTableTag ).table(sqlTablePage)) } catch { case e@(_: IllegalArgumentException | _: IndexOutOfBoundsException) => diff --git a/sql/hive-thriftserver/src/test/resources/log4j.properties b/sql/hive-thriftserver/src/test/resources/log4j.properties new file mode 100644 index 0000000000000..ad799deea3678 --- /dev/null +++ b/sql/hive-thriftserver/src/test/resources/log4j.properties @@ -0,0 +1,75 @@ +# +# 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 everything to be logged to the file hive-thriftserver/target/unit-tests.log +log4j.rootLogger=DEBUG, CA, FA + +#Console Appender +log4j.appender.CA=org.apache.log4j.ConsoleAppender +log4j.appender.CA.layout=org.apache.log4j.PatternLayout +log4j.appender.CA.layout.ConversionPattern=%d{HH:mm:ss.SSS} %p %c: %m%n +log4j.appender.CA.Threshold = WARN + +# SPARK-34128: Suppress undesirable TTransportException warnings, due to THRIFT-4805 +log4j.appender.CA.filter.1=org.apache.log4j.varia.StringMatchFilter +log4j.appender.CA.filter.1.StringToMatch=Thrift error occurred during processing of message +log4j.appender.CA.filter.1.AcceptOnMatch=false + +#File Appender +log4j.appender.FA=org.apache.log4j.FileAppender +log4j.appender.FA.append=false +log4j.appender.FA.file=target/unit-tests.log +log4j.appender.FA.layout=org.apache.log4j.PatternLayout +log4j.appender.FA.layout.ConversionPattern=%d{HH:mm:ss.SSS} %t %p %c{1}: %m%n + +log4j.appender.FA.filter.1=org.apache.log4j.varia.StringMatchFilter +log4j.appender.FA.filter.1.StringToMatch=Thrift error occurred during processing of message +log4j.appender.FA.filter.1.AcceptOnMatch=false + +# Set the logger level of File Appender to WARN +log4j.appender.FA.Threshold = DEBUG + +# Some packages are noisy for no good reason. +log4j.additivity.org.apache.hadoop.hive.serde2.lazy.LazyStruct=false +log4j.logger.org.apache.hadoop.hive.serde2.lazy.LazyStruct=OFF + +log4j.additivity.org.apache.hadoop.hive.metastore.RetryingHMSHandler=false +log4j.logger.org.apache.hadoop.hive.metastore.RetryingHMSHandler=OFF + +log4j.additivity.hive.log=false +log4j.logger.hive.log=OFF + +log4j.additivity.parquet.hadoop.ParquetRecordReader=false +log4j.logger.parquet.hadoop.ParquetRecordReader=OFF + +log4j.additivity.org.apache.parquet.hadoop.ParquetRecordReader=false +log4j.logger.org.apache.parquet.hadoop.ParquetRecordReader=OFF + +log4j.additivity.org.apache.parquet.hadoop.ParquetOutputCommitter=false +log4j.logger.org.apache.parquet.hadoop.ParquetOutputCommitter=OFF + +log4j.additivity.hive.ql.metadata.Hive=false +log4j.logger.hive.ql.metadata.Hive=OFF + +log4j.additivity.org.apache.hadoop.hive.ql.io.RCFile=false +log4j.logger.org.apache.hadoop.hive.ql.io.RCFile=ERROR + +# Parquet related logging +log4j.logger.org.apache.parquet.CorruptStatistics=ERROR +log4j.logger.parquet.CorruptStatistics=ERROR + +log4j.logger.org.apache.spark.sql.hive.thriftserver.SparkExecuteStatementOperation=OFF diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreLazyInitializationSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreLazyInitializationSuite.scala index 277df548aefd0..951f92793732f 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreLazyInitializationSuite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreLazyInitializationSuite.scala @@ -31,6 +31,7 @@ class HiveMetastoreLazyInitializationSuite extends SparkFunSuite { .config("spark.hadoop.hive.metastore.uris", "thrift://127.0.0.1:11111") .getOrCreate() val originalLevel = org.apache.log4j.Logger.getRootLogger().getLevel + val originalClassLoader = Thread.currentThread().getContextClassLoader try { // Avoid outputting a lot of expected warning logs spark.sparkContext.setLogLevel("error") @@ -64,6 +65,7 @@ class HiveMetastoreLazyInitializationSuite extends SparkFunSuite { exceptionString.contains(msg) } } finally { + Thread.currentThread().setContextClassLoader(originalClassLoader) spark.sparkContext.setLogLevel(originalLevel.toString) spark.stop() } diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala index ea1a371151c36..7067b65a6232e 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/CliSuite.scala @@ -27,10 +27,11 @@ import scala.concurrent.Promise import scala.concurrent.duration._ import org.apache.hadoop.hive.conf.HiveConf.ConfVars -import org.scalatest.{BeforeAndAfterAll, BeforeAndAfterEach} +import org.scalatest.BeforeAndAfterAll import org.apache.spark.SparkFunSuite import org.apache.spark.internal.Logging +import org.apache.spark.sql.hive.HiveUtils._ import org.apache.spark.sql.hive.test.HiveTestJars import org.apache.spark.sql.internal.StaticSQLConf import org.apache.spark.sql.test.ProcessTestUtils.ProcessOutputCapturer @@ -98,10 +99,8 @@ class CliSuite extends SparkFunSuite with BeforeAndAfterAll with Logging { Seq(answer) } else { // spark-sql echoes the submitted queries - val queryEcho = query.split("\n").toList match { - case firstLine :: tail => - s"spark-sql> $firstLine" :: tail.map(l => s" > $l") - } + val xs = query.split("\n").toList + val queryEcho = s"spark-sql> ${xs.head}" :: xs.tail.map(l => s" > $l") // longer lines sometimes get split in the output, // match the first 60 characters of each query line queryEcho.map(_.take(60)) :+ answer @@ -132,6 +131,7 @@ class CliSuite extends SparkFunSuite with BeforeAndAfterAll with Logging { } var next = 0 + val foundMasterAndApplicationIdMessage = Promise.apply[Unit]() val foundAllExpectedAnswers = Promise.apply[Unit]() val buffer = new ArrayBuffer[String]() val lock = new Object @@ -143,6 +143,10 @@ class CliSuite extends SparkFunSuite with BeforeAndAfterAll with Logging { log.info(newLine) buffer += newLine + if (line.startsWith("Spark master: ") && line.contains("Application Id: ")) { + foundMasterAndApplicationIdMessage.trySuccess(()) + } + // If we haven't found all expected answers and another expected answer comes up... if (next < expectedAnswers.size && line.contains(expectedAnswers(next))) { log.info(s"$source> found expected output line $next: '${expectedAnswers(next)}'") @@ -172,7 +176,18 @@ class CliSuite extends SparkFunSuite with BeforeAndAfterAll with Logging { new ProcessOutputCapturer(process.getErrorStream, captureOutput("stderr")).start() try { - ThreadUtils.awaitResult(foundAllExpectedAnswers.future, timeout) + val timeoutForQuery = if (!extraArgs.contains("-e")) { + // Wait for for cli driver to boot, up to two minutes + ThreadUtils.awaitResult(foundMasterAndApplicationIdMessage.future, 2.minutes) + log.info("Cli driver is booted. Waiting for expected answers.") + // Given timeout is applied after the cli driver is ready + timeout + } else { + // There's no boot message if -e option is provided, just extend timeout long enough + // so that the bootup duration is counted on the timeout + 2.minutes + timeout + } + ThreadUtils.awaitResult(foundAllExpectedAnswers.future, timeoutForQuery) log.info("Found all expected output.") } catch { case cause: Throwable => val message = @@ -194,7 +209,7 @@ class CliSuite extends SparkFunSuite with BeforeAndAfterAll with Logging { } finally { if (!process.waitFor(1, MINUTES)) { try { - fail("spark-sql did not exit gracefully.") + log.warn("spark-sql did not exit gracefully.") } finally { process.destroy() } @@ -447,7 +462,7 @@ class CliSuite extends SparkFunSuite with BeforeAndAfterAll with Logging { val jarFile = new File("../../sql/hive/src/test/resources/SPARK-21101-1.0.jar").getCanonicalPath val hiveContribJar = HiveTestJars.getHiveContribJar().getCanonicalPath runCliWithin( - 1.minute, + 2.minutes, Seq("--jars", s"$jarFile", "--conf", s"spark.hadoop.${ConfVars.HIVEAUXJARS}=$hiveContribJar"))( "CREATE TEMPORARY FUNCTION testjar AS" + @@ -551,4 +566,49 @@ class CliSuite extends SparkFunSuite with BeforeAndAfterAll with Logging { errorResponses = Seq("AnalysisException"))( ("", "Error in query: The second argument of 'date_sub' function needs to be an integer.")) } + + test("SPARK-30808: use Java 8 time API in Thrift SQL CLI by default") { + // If Java 8 time API is enabled via the SQL config `spark.sql.datetime.java8API.enabled`, + // the date formatter for `java.sql.LocalDate` must output negative years with sign. + runCliWithin(1.minute)("SELECT MAKE_DATE(-44, 3, 15);" -> "-0044-03-15") + } + + test("SPARK-33100: Ignore a semicolon inside a bracketed comment in spark-sql") { + runCliWithin(4.minute)( + "/* SELECT 'test';*/ SELECT 'test';" -> "test", + ";;/* SELECT 'test';*/ SELECT 'test';" -> "test", + "/* SELECT 'test';*/;; SELECT 'test';" -> "test", + "SELECT 'test'; -- SELECT 'test';" -> "test", + "SELECT 'test'; /* SELECT 'test';*/;" -> "test", + "/*$meta chars{^\\;}*/ SELECT 'test';" -> "test", + "/*\nmulti-line\n*/ SELECT 'test';" -> "test", + "/*/* multi-level bracketed*/ SELECT 'test';" -> "test" + ) + } + + test("SPARK-33100: test sql statements with hint in bracketed comment") { + runCliWithin(2.minute)( + "CREATE TEMPORARY VIEW t1 AS SELECT * FROM VALUES(1, 2) AS t1(k, v);" -> "", + "CREATE TEMPORARY VIEW t2 AS SELECT * FROM VALUES(2, 1) AS t2(k, v);" -> "", + "EXPLAIN SELECT /*+ MERGEJOIN(t1) */ t1.* FROM t1 JOIN t2 ON t1.k = t2.v;" -> "SortMergeJoin", + "EXPLAIN SELECT /* + MERGEJOIN(t1) */ t1.* FROM t1 JOIN t2 ON t1.k = t2.v;" + -> "BroadcastHashJoin" + ) + } + + test("SPARK-35086: --verbose should be passed to Spark SQL CLI") { + runCliWithin(2.minute, Seq("--verbose"))( + "SELECT 'SPARK-35086' AS c1, '--verbose' AS c2;" -> + "SELECT 'SPARK-35086' AS c1, '--verbose' AS c2" + ) + } + + test("SPARK-35102: Make spark.sql.hive.version meaningful and not deprecated") { + runCliWithin(1.minute, + Seq("--conf", "spark.sql.hive.version=0.1"), + Seq(s"please use ${HIVE_METASTORE_VERSION.key}"))("" -> "") + runCliWithin(2.minute, + Seq("--conf", s"${BUILTIN_HIVE_VERSION.key}=$builtinHiveVersion"))( + s"set ${BUILTIN_HIVE_VERSION.key};" -> builtinHiveVersion, "SET -v;" -> builtinHiveVersion) + } } diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/DummyListeners.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/DummyListeners.scala index 4564c2209a931..820859b65925b 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/DummyListeners.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/DummyListeners.scala @@ -17,7 +17,7 @@ /** * These classes in this package are intentionally placed to the outer package of spark, - * because IsolatedClientLoader leverages Spark classloader for shared classess including + * because IsolatedClientLoader leverages Spark classloader for shared classes including * spark package, and the test should fail if Spark initializes these listeners with * IsolatedClientLoader. */ diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/FetchIteratorSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/FetchIteratorSuite.scala new file mode 100644 index 0000000000000..0fbdb8a9050c8 --- /dev/null +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/FetchIteratorSuite.scala @@ -0,0 +1,134 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.thriftserver + +import org.apache.spark.SparkFunSuite + +class FetchIteratorSuite extends SparkFunSuite { + + private def getRows(fetchIter: FetchIterator[Int], maxRowCount: Int): Seq[Int] = { + for (_ <- 0 until maxRowCount if fetchIter.hasNext) yield fetchIter.next() + } + + test("SPARK-33655: Test fetchNext and fetchPrior") { + val testData = 0 until 10 + + def iteratorTest(fetchIter: FetchIterator[Int]): Unit = { + fetchIter.fetchNext() + assert(fetchIter.getFetchStart == 0) + assert(fetchIter.getPosition == 0) + assertResult(0 until 2)(getRows(fetchIter, 2)) + assert(fetchIter.getFetchStart == 0) + assert(fetchIter.getPosition == 2) + + fetchIter.fetchNext() + assert(fetchIter.getFetchStart == 2) + assert(fetchIter.getPosition == 2) + assertResult(2 until 3)(getRows(fetchIter, 1)) + assert(fetchIter.getFetchStart == 2) + assert(fetchIter.getPosition == 3) + + fetchIter.fetchPrior(2) + assert(fetchIter.getFetchStart == 0) + assert(fetchIter.getPosition == 0) + assertResult(0 until 3)(getRows(fetchIter, 3)) + assert(fetchIter.getFetchStart == 0) + assert(fetchIter.getPosition == 3) + + fetchIter.fetchNext() + assert(fetchIter.getFetchStart == 3) + assert(fetchIter.getPosition == 3) + assertResult(3 until 8)(getRows(fetchIter, 5)) + assert(fetchIter.getFetchStart == 3) + assert(fetchIter.getPosition == 8) + + fetchIter.fetchPrior(2) + assert(fetchIter.getFetchStart == 1) + assert(fetchIter.getPosition == 1) + assertResult(1 until 4)(getRows(fetchIter, 3)) + assert(fetchIter.getFetchStart == 1) + assert(fetchIter.getPosition == 4) + + fetchIter.fetchNext() + assert(fetchIter.getFetchStart == 4) + assert(fetchIter.getPosition == 4) + assertResult(4 until 10)(getRows(fetchIter, 10)) + assert(fetchIter.getFetchStart == 4) + assert(fetchIter.getPosition == 10) + + fetchIter.fetchNext() + assert(fetchIter.getFetchStart == 10) + assert(fetchIter.getPosition == 10) + assertResult(Seq.empty[Int])(getRows(fetchIter, 10)) + assert(fetchIter.getFetchStart == 10) + assert(fetchIter.getPosition == 10) + + fetchIter.fetchPrior(20) + assert(fetchIter.getFetchStart == 0) + assert(fetchIter.getPosition == 0) + assertResult(0 until 3)(getRows(fetchIter, 3)) + assert(fetchIter.getFetchStart == 0) + assert(fetchIter.getPosition == 3) + } + iteratorTest(new ArrayFetchIterator[Int](testData.toArray)) + iteratorTest(new IterableFetchIterator[Int](testData)) + } + + test("SPARK-33655: Test fetchAbsolute") { + val testData = 0 until 10 + + def iteratorTest(fetchIter: FetchIterator[Int]): Unit = { + fetchIter.fetchNext() + assert(fetchIter.getFetchStart == 0) + assert(fetchIter.getPosition == 0) + assertResult(0 until 5)(getRows(fetchIter, 5)) + assert(fetchIter.getFetchStart == 0) + assert(fetchIter.getPosition == 5) + + fetchIter.fetchAbsolute(2) + assert(fetchIter.getFetchStart == 2) + assert(fetchIter.getPosition == 2) + assertResult(2 until 5)(getRows(fetchIter, 3)) + assert(fetchIter.getFetchStart == 2) + assert(fetchIter.getPosition == 5) + + fetchIter.fetchAbsolute(7) + assert(fetchIter.getFetchStart == 7) + assert(fetchIter.getPosition == 7) + assertResult(7 until 8)(getRows(fetchIter, 1)) + assert(fetchIter.getFetchStart == 7) + assert(fetchIter.getPosition == 8) + + fetchIter.fetchAbsolute(20) + assert(fetchIter.getFetchStart == 10) + assert(fetchIter.getPosition == 10) + assertResult(Seq.empty[Int])(getRows(fetchIter, 1)) + assert(fetchIter.getFetchStart == 10) + assert(fetchIter.getPosition == 10) + + fetchIter.fetchAbsolute(0) + assert(fetchIter.getFetchStart == 0) + assert(fetchIter.getPosition == 0) + assertResult(0 until 3)(getRows(fetchIter, 3)) + assert(fetchIter.getFetchStart == 0) + assert(fetchIter.getPosition == 3) + } + iteratorTest(new ArrayFetchIterator[Int](testData.toArray)) + iteratorTest(new IterableFetchIterator[Int](testData)) + } +} diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/GetCatalogsOperationMock.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/GetCatalogsOperationMock.scala new file mode 100644 index 0000000000000..1bc9aaf672c3b --- /dev/null +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/GetCatalogsOperationMock.scala @@ -0,0 +1,50 @@ +/* + * 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. + */ +package org.apache.spark.sql.hive.thriftserver + +import java.nio.ByteBuffer +import java.util.UUID + +import org.apache.hive.service.cli.OperationHandle +import org.apache.hive.service.cli.operation.GetCatalogsOperation +import org.apache.hive.service.cli.session.HiveSession +import org.apache.hive.service.rpc.thrift.{THandleIdentifier, TOperationHandle, TOperationType} + +class GetCatalogsOperationMock(parentSession: HiveSession) + extends GetCatalogsOperation(parentSession) { + + override def runInternal(): Unit = {} + + override def getHandle: OperationHandle = { + val uuid: UUID = UUID.randomUUID() + val tHandleIdentifier: THandleIdentifier = new THandleIdentifier() + tHandleIdentifier.setGuid(getByteBufferFromUUID(uuid)) + tHandleIdentifier.setSecret(getByteBufferFromUUID(uuid)) + val tOperationHandle: TOperationHandle = new TOperationHandle() + tOperationHandle.setOperationId(tHandleIdentifier) + tOperationHandle.setOperationType(TOperationType.GET_TYPE_INFO) + tOperationHandle.setHasResultSetIsSet(false) + new OperationHandle(tOperationHandle) + } + + private def getByteBufferFromUUID(uuid: UUID): Array[Byte] = { + val bb: ByteBuffer = ByteBuffer.wrap(new Array[Byte](16)) + bb.putLong(uuid.getMostSignificantBits) + bb.putLong(uuid.getLeastSignificantBits) + bb.array + } +} diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveSessionImplSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveSessionImplSuite.scala new file mode 100644 index 0000000000000..7c42348f74453 --- /dev/null +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveSessionImplSuite.scala @@ -0,0 +1,90 @@ +/* + * 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. + */ +package org.apache.spark.sql.hive.thriftserver + +import java.lang.reflect.InvocationTargetException + +import scala.collection.JavaConverters._ +import scala.collection.mutable + +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hive.service.cli.OperationHandle +import org.apache.hive.service.cli.operation.{GetCatalogsOperation, Operation, OperationManager} +import org.apache.hive.service.cli.session.{HiveSession, HiveSessionImpl, SessionManager} +import org.apache.hive.service.rpc.thrift.TProtocolVersion + +import org.apache.spark.SparkFunSuite + +class HiveSessionImplSuite extends SparkFunSuite { + private var session: HiveSessionImpl = _ + private var operationManager: OperationManagerMock = _ + + override def beforeAll(): Unit = { + super.beforeAll() + + val sessionManager = new SessionManager(null) + operationManager = new OperationManagerMock() + + session = new HiveSessionImpl( + TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1, + "", + "", + new HiveConf(), + "" + ) + session.setSessionManager(sessionManager) + session.setOperationManager(operationManager) + + session.open(Map.empty[String, String].asJava) + } + + test("SPARK-31387 - session.close() closes all sessions regardless of thrown exceptions") { + val operationHandle1 = session.getCatalogs + val operationHandle2 = session.getCatalogs + + session.close() + + assert(operationManager.getCalledHandles.contains(operationHandle1)) + assert(operationManager.getCalledHandles.contains(operationHandle2)) + } +} + +class OperationManagerMock extends OperationManager { + private val calledHandles: mutable.Set[OperationHandle] = new mutable.HashSet[OperationHandle]() + + override def newGetCatalogsOperation(parentSession: HiveSession): GetCatalogsOperation = { + val operation = new GetCatalogsOperationMock(parentSession) + try { + val m = classOf[OperationManager].getDeclaredMethod("addOperation", classOf[Operation]) + m.setAccessible(true) + m.invoke(this, operation) + } catch { + case e@(_: NoSuchMethodException | _: IllegalAccessException | + _: InvocationTargetException) => + throw new RuntimeException(e) + } + operation + } + + override def closeOperation(opHandle: OperationHandle): Unit = { + calledHandles.add(opHandle) + throw new RuntimeException + } + + def getCalledHandles: mutable.Set[OperationHandle] = calledHandles +} + diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala index 0cec63460814c..792aea1dca84c 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2Suites.scala @@ -29,7 +29,7 @@ import scala.collection.mutable.ArrayBuffer import scala.concurrent.{ExecutionContext, Future, Promise} import scala.concurrent.duration._ import scala.io.Source -import scala.util.{Random, Try} +import scala.util.Try import com.google.common.io.Files import org.apache.hadoop.hive.conf.HiveConf.ConfVars @@ -37,14 +37,17 @@ import org.apache.hive.jdbc.HiveDriver import org.apache.hive.service.auth.PlainSaslHelper import org.apache.hive.service.cli.{FetchOrientation, FetchType, GetInfoType, RowSet} import org.apache.hive.service.cli.thrift.ThriftCLIServiceClient +import org.apache.hive.service.rpc.thrift.TCLIService.Client import org.apache.thrift.protocol.TBinaryProtocol import org.apache.thrift.transport.TSocket import org.scalatest.BeforeAndAfterAll +import org.scalatest.concurrent.Eventually._ import org.apache.spark.{SparkException, SparkFunSuite} import org.apache.spark.internal.Logging import org.apache.spark.sql.hive.HiveUtils import org.apache.spark.sql.hive.test.HiveTestJars +import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.internal.StaticSQLConf.HIVE_THRIFT_SERVER_SINGLESESSION import org.apache.spark.sql.test.ProcessTestUtils.ProcessOutputCapturer import org.apache.spark.util.{ThreadUtils, Utils} @@ -58,7 +61,7 @@ object TestData { val smallKvWithNull = getTestDataFilePath("small_kv_with_null.txt") } -class HiveThriftBinaryServerSuite extends HiveThriftJdbcTest { +class HiveThriftBinaryServerSuite extends HiveThriftServer2Test { override def mode: ServerMode.Value = ServerMode.binary private def withCLIServiceClient(f: ThriftCLIServiceClient => Unit): Unit = { @@ -67,7 +70,7 @@ class HiveThriftBinaryServerSuite extends HiveThriftJdbcTest { val user = System.getProperty("user.name") val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) val protocol = new TBinaryProtocol(transport) - val client = new ThriftCLIServiceClient(new ThriftserverShimUtils.Client(protocol)) + val client = new ThriftCLIServiceClient(new Client(protocol)) transport.open() try f(client) finally transport.close() @@ -284,7 +287,6 @@ class HiveThriftBinaryServerSuite extends HiveThriftJdbcTest { } test("test multiple session") { - import org.apache.spark.sql.internal.SQLConf var defaultV1: String = null var defaultV2: String = null var data: ArrayBuffer[Int] = null @@ -304,7 +306,7 @@ class HiveThriftBinaryServerSuite extends HiveThriftJdbcTest { val plan = statement.executeQuery("explain select * from test_table") plan.next() plan.next() - assert(plan.getString(1).contains("Scan In-memory table `test_table`")) + assert(plan.getString(1).contains("Scan In-memory table test_table")) val rs1 = statement.executeQuery("SELECT key FROM test_table ORDER BY KEY DESC") val buf1 = new collection.mutable.ArrayBuffer[Int]() @@ -387,10 +389,11 @@ class HiveThriftBinaryServerSuite extends HiveThriftJdbcTest { statement.executeQuery("SELECT key FROM test_table ORDER BY KEY DESC") } + // The cached temporary table can be used indirectly if the query matches. val plan = statement.executeQuery("explain select key from test_map ORDER BY key DESC") plan.next() plan.next() - assert(plan.getString(1).contains("Scan In-memory table `test_table`")) + assert(plan.getString(1).contains("Scan In-memory table test_table")) val rs = statement.executeQuery("SELECT key FROM test_map ORDER BY KEY DESC") val buf = new collection.mutable.ArrayBuffer[Int]() @@ -544,11 +547,7 @@ class HiveThriftBinaryServerSuite extends HiveThriftJdbcTest { conf += resultSet.getString(1) -> resultSet.getString(2) } - if (HiveUtils.isHive23) { - assert(conf.get(HiveUtils.FAKE_HIVE_VERSION.key) === Some("2.3.7")) - } else { - assert(conf.get(HiveUtils.FAKE_HIVE_VERSION.key) === Some("1.2.1")) - } + assert(conf.get(HiveUtils.BUILTIN_HIVE_VERSION.key) === Some(HiveUtils.builtinHiveVersion)) } } @@ -561,11 +560,7 @@ class HiveThriftBinaryServerSuite extends HiveThriftJdbcTest { conf += resultSet.getString(1) -> resultSet.getString(2) } - if (HiveUtils.isHive23) { - assert(conf.get(HiveUtils.FAKE_HIVE_VERSION.key) === Some("2.3.7")) - } else { - assert(conf.get(HiveUtils.FAKE_HIVE_VERSION.key) === Some("1.2.1")) - } + assert(conf.get(HiveUtils.BUILTIN_HIVE_VERSION.key) === Some(HiveUtils.builtinHiveVersion)) } } @@ -643,11 +638,7 @@ class HiveThriftBinaryServerSuite extends HiveThriftJdbcTest { val sessionHandle = client.openSession(user, "") val sessionID = sessionHandle.getSessionId - if (HiveUtils.isHive23) { - assert(pipeoutFileList(sessionID).length == 2) - } else { - assert(pipeoutFileList(sessionID).length == 1) - } + assert(pipeoutFileList(sessionID).length == 2) client.closeSession(sessionHandle) @@ -684,6 +675,55 @@ class HiveThriftBinaryServerSuite extends HiveThriftJdbcTest { } assert(e.getMessage.contains("org.apache.spark.sql.catalyst.parser.ParseException")) } + + withJdbcStatement() { statement => + val rs = statement.executeQuery("SELECT interval '3-1' year to month;") + assert(rs.next()) + assert(rs.getString(1) === "3-1") + } + + withJdbcStatement() { statement => + val rs = statement.executeQuery("SELECT interval '3 1:1:1' day to second;") + assert(rs.next()) + assert(rs.getString(1) === "3 01:01:01.000000000") + } + } + + test("Query Intervals in VIEWs through thrift server") { + val viewName1 = "view_interval_1" + val viewName2 = "view_interval_2" + val ddl1 = + s""" + |CREATE GLOBAL TEMP VIEW $viewName1 + |AS SELECT + | INTERVAL 1 DAY AS a, + | INTERVAL '2-1' YEAR TO MONTH AS b, + | INTERVAL '3 1:1:1' DAY TO SECOND AS c + """.stripMargin + val ddl2 = s"CREATE TEMP VIEW $viewName2 as select * from global_temp.$viewName1" + withJdbcStatement(viewName1, viewName2) { statement => + statement.executeQuery(ddl1) + statement.executeQuery(ddl2) + val rs = statement.executeQuery( + s""" + |SELECT v1.a AS a1, v2.a AS a2, + | v1.b AS b1, v2.b AS b2, + | v1.c AS c1, v2.c AS c2 + |FROM global_temp.$viewName1 v1 + |JOIN $viewName2 v2 + |ON date_part('DAY', v1.a) = date_part('DAY', v2.a) + | AND v1.b = v2.b + | AND v1.c = v2.c + |""".stripMargin) + while (rs.next()) { + assert(rs.getString("a1") === "1 days") + assert(rs.getString("a2") === "1 days") + assert(rs.getString("b1") === "2-1") + assert(rs.getString("b2") === "2-1") + assert(rs.getString("c1") === "3 01:01:01.000000000") + assert(rs.getString("c2") === "3 01:01:01.000000000") + } + } } test("ThriftCLIService FetchResults FETCH_FIRST, FETCH_NEXT, FETCH_PRIOR") { @@ -811,16 +851,132 @@ class HiveThriftBinaryServerSuite extends HiveThriftJdbcTest { } } } + + test("SPARK-31859 Thriftserver works with spark.sql.datetime.java8API.enabled=true") { + withJdbcStatement() { st => + st.execute("set spark.sql.datetime.java8API.enabled=true") + val rs = st.executeQuery("select date '2020-05-28', timestamp '2020-05-28 00:00:00'") + rs.next() + assert(rs.getDate(1).toString() == "2020-05-28") + assert(rs.getTimestamp(2).toString() == "2020-05-28 00:00:00.0") + } + } + + test("SPARK-31861 Thriftserver respects spark.sql.session.timeZone") { + withJdbcStatement() { st => + st.execute("set spark.sql.session.timeZone=+03:15") // different than Thriftserver's JVM tz + val rs = st.executeQuery("select timestamp '2020-05-28 10:00:00'") + rs.next() + // The timestamp as string is the same as the literal + assert(rs.getString(1) == "2020-05-28 10:00:00.0") + // Parsing it to java.sql.Timestamp in the client will always result in a timestamp + // in client default JVM timezone. The string value of the Timestamp will match the literal, + // but if the JDBC application cares about the internal timezone and UTC offset of the + // Timestamp object, it should set spark.sql.session.timeZone to match its client JVM tz. + assert(rs.getTimestamp(1).toString() == "2020-05-28 10:00:00.0") + } + } + + test("SPARK-31863 Session conf should persist between Thriftserver worker threads") { + val iter = 20 + withJdbcStatement() { statement => + // date 'now' is resolved during parsing, and relies on SQLConf.get to + // obtain the current set timezone. We exploit this to run this test. + // If the timezones are set correctly to 25 hours apart across threads, + // the dates should reflect this. + + // iterate a few times for the odd chance the same thread is selected + for (_ <- 0 until iter) { + statement.execute("SET spark.sql.session.timeZone=GMT-12") + val firstResult = statement.executeQuery("SELECT date 'now'") + firstResult.next() + val beyondDateLineWest = firstResult.getDate(1) + + statement.execute("SET spark.sql.session.timeZone=GMT+13") + val secondResult = statement.executeQuery("SELECT date 'now'") + secondResult.next() + val dateLineEast = secondResult.getDate(1) + assert( + dateLineEast after beyondDateLineWest, + "SQLConf changes should persist across execution threads") + } + } + } + + test("SPARK-30808: use Java 8 time API and Proleptic Gregorian calendar by default") { + withJdbcStatement() { st => + // Proleptic Gregorian calendar has no gap in the range 1582-10-04..1582-10-15 + val date = "1582-10-10" + val rs = st.executeQuery(s"select date '$date'") + rs.next() + val expected = java.sql.Date.valueOf(date) + assert(rs.getDate(1) === expected) + assert(rs.getString(1) === expected.toString) + } + } + + test("SPARK-26533: Support query auto timeout cancel on thriftserver - setQueryTimeout") { + withJdbcStatement() { statement => + statement.setQueryTimeout(1) + val e = intercept[SQLException] { + statement.execute("select java_method('java.lang.Thread', 'sleep', 10000L)") + }.getMessage + assert(e.contains("Query timed out after")) + + statement.setQueryTimeout(0) + val rs1 = statement.executeQuery( + "select 'test', java_method('java.lang.Thread', 'sleep', 3000L)") + rs1.next() + assert(rs1.getString(1) == "test") + + statement.setQueryTimeout(-1) + val rs2 = statement.executeQuery( + "select 'test', java_method('java.lang.Thread', 'sleep', 3000L)") + rs2.next() + assert(rs2.getString(1) == "test") + } + } + + test("SPARK-26533: Support query auto timeout cancel on thriftserver - SQLConf") { + withJdbcStatement() { statement => + statement.execute(s"SET ${SQLConf.THRIFTSERVER_QUERY_TIMEOUT.key}=1") + val e1 = intercept[SQLException] { + statement.execute("select java_method('java.lang.Thread', 'sleep', 10000L)") + }.getMessage + assert(e1.contains("Query timed out after")) + + statement.execute(s"SET ${SQLConf.THRIFTSERVER_QUERY_TIMEOUT.key}=0") + val rs = statement.executeQuery( + "select 'test', java_method('java.lang.Thread', 'sleep', 3000L)") + rs.next() + assert(rs.getString(1) == "test") + + // Uses a smaller timeout value of a config value and an a user-specified one + statement.execute(s"SET ${SQLConf.THRIFTSERVER_QUERY_TIMEOUT.key}=1") + statement.setQueryTimeout(30) + val e2 = intercept[SQLException] { + statement.execute("select java_method('java.lang.Thread', 'sleep', 10000L)") + }.getMessage + assert(e2.contains("Query timed out after")) + + statement.execute(s"SET ${SQLConf.THRIFTSERVER_QUERY_TIMEOUT.key}=30") + statement.setQueryTimeout(1) + val e3 = intercept[SQLException] { + statement.execute("select java_method('java.lang.Thread', 'sleep', 10000L)") + }.getMessage + assert(e3.contains("Query timed out after")) + } + } } -class SingleSessionSuite extends HiveThriftJdbcTest { +class SingleSessionSuite extends HiveThriftServer2TestBase { override def mode: ServerMode.Value = ServerMode.binary override protected def extraConf: Seq[String] = s"--conf ${HIVE_THRIFT_SERVER_SINGLESESSION.key}=true" :: Nil test("share the temporary functions across JDBC connections") { - withMultipleConnectionJdbcStatement()( + withMultipleConnectionJdbcStatement("test_udtf")( { statement => val jarPath = "../hive/src/test/resources/TestUDTF.jar" val jarURL = s"file://${System.getProperty("user.dir")}/$jarPath" @@ -924,7 +1080,7 @@ class SingleSessionSuite extends HiveThriftJdbcTest { } } -class HiveThriftCleanUpScratchDirSuite extends HiveThriftJdbcTest{ +class HiveThriftCleanUpScratchDirSuite extends HiveThriftServer2TestBase { var tempScratchDir: File = _ override protected def beforeAll(): Unit = { @@ -957,7 +1113,7 @@ class HiveThriftCleanUpScratchDirSuite extends HiveThriftJdbcTest{ } } -class HiveThriftHttpServerSuite extends HiveThriftJdbcTest { +class HiveThriftHttpServerSuite extends HiveThriftServer2Test { override def mode: ServerMode.Value = ServerMode.http test("JDBC query execution") { @@ -1000,63 +1156,7 @@ object ServerMode extends Enumeration { val binary, http = Value } -abstract class HiveThriftJdbcTest extends HiveThriftServer2Test { - Utils.classForName(classOf[HiveDriver].getCanonicalName) - - private def jdbcUri = if (mode == ServerMode.http) { - s"""jdbc:hive2://localhost:$serverPort/ - |default? - |hive.server2.transport.mode=http; - |hive.server2.thrift.http.path=cliservice; - |${hiveConfList}#${hiveVarList} - """.stripMargin.split("\n").mkString.trim - } else { - s"jdbc:hive2://localhost:$serverPort/?${hiveConfList}#${hiveVarList}" - } - - def withMultipleConnectionJdbcStatement(tableNames: String*)(fs: (Statement => Unit)*): Unit = { - val user = System.getProperty("user.name") - val connections = fs.map { _ => DriverManager.getConnection(jdbcUri, user, "") } - val statements = connections.map(_.createStatement()) - - try { - statements.zip(fs).foreach { case (s, f) => f(s) } - } finally { - tableNames.foreach { name => - // TODO: Need a better way to drop the view. - if (name.toUpperCase(Locale.ROOT).startsWith("VIEW")) { - statements(0).execute(s"DROP VIEW IF EXISTS $name") - } else { - statements(0).execute(s"DROP TABLE IF EXISTS $name") - } - } - statements.foreach(_.close()) - connections.foreach(_.close()) - } - } - - def withDatabase(dbNames: String*)(fs: (Statement => Unit)*): Unit = { - val user = System.getProperty("user.name") - val connections = fs.map { _ => DriverManager.getConnection(jdbcUri, user, "") } - val statements = connections.map(_.createStatement()) - - try { - statements.zip(fs).foreach { case (s, f) => f(s) } - } finally { - dbNames.foreach { name => - statements(0).execute(s"DROP DATABASE IF EXISTS $name") - } - statements.foreach(_.close()) - connections.foreach(_.close()) - } - } - - def withJdbcStatement(tableNames: String*)(f: Statement => Unit): Unit = { - withMultipleConnectionJdbcStatement(tableNames: _*)(f) - } -} - -abstract class HiveThriftServer2Test extends SparkFunSuite with BeforeAndAfterAll with Logging { +abstract class HiveThriftServer2TestBase extends SparkFunSuite with BeforeAndAfterAll with Logging { def mode: ServerMode.Value private val CLASS_NAME = HiveThriftServer2.getClass.getCanonicalName.stripSuffix("$") @@ -1085,7 +1185,7 @@ abstract class HiveThriftServer2Test extends SparkFunSuite with BeforeAndAfterAl protected def extraConf: Seq[String] = Nil - protected def serverStartCommand(port: Int) = { + protected def serverStartCommand(): Seq[String] = { val portConf = if (mode == ServerMode.binary) { ConfVars.HIVE_SERVER2_THRIFT_PORT } else { @@ -1098,7 +1198,7 @@ abstract class HiveThriftServer2Test extends SparkFunSuite with BeforeAndAfterAl val tempLog4jConf = Utils.createTempDir().getCanonicalPath Files.write( - """log4j.rootCategory=DEBUG, console + """log4j.rootCategory=INFO, console |log4j.appender.console=org.apache.log4j.ConsoleAppender |log4j.appender.console.target=System.err |log4j.appender.console.layout=org.apache.log4j.PatternLayout @@ -1118,7 +1218,7 @@ abstract class HiveThriftServer2Test extends SparkFunSuite with BeforeAndAfterAl | --hiveconf ${ConfVars.HIVE_SERVER2_TRANSPORT_MODE}=$mode | --hiveconf ${ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LOG_LOCATION}=$operationLogPath | --hiveconf ${ConfVars.LOCALSCRATCHDIR}=$lScratchDir - | --hiveconf $portConf=$port + | --hiveconf $portConf=0 | --driver-class-path $driverClassPath | --driver-java-options -Dlog4j.debug | --conf spark.ui.enabled=false @@ -1140,7 +1240,7 @@ abstract class HiveThriftServer2Test extends SparkFunSuite with BeforeAndAfterAl val SERVER_STARTUP_TIMEOUT = 3.minutes - private def startThriftServer(port: Int, attempt: Int) = { + private def startThriftServer(attempt: Int) = { warehousePath = Utils.createTempDir() warehousePath.delete() metastorePath = Utils.createTempDir() @@ -1152,18 +1252,16 @@ abstract class HiveThriftServer2Test extends SparkFunSuite with BeforeAndAfterAl logPath = null logTailingProcess = null - val command = serverStartCommand(port) + val command = serverStartCommand() diagnosisBuffer ++= s""" |### Attempt $attempt ### |HiveThriftServer2 command line: $command - |Listening port: $port + |Listening port: 0 |System user: $user """.stripMargin.split("\n") - logInfo(s"Trying to start HiveThriftServer2: port=$port, mode=$mode, attempt=$attempt") - logPath = { val lines = Utils.executeAndGetOutput( command = command, @@ -1190,7 +1288,11 @@ abstract class HiveThriftServer2Test extends SparkFunSuite with BeforeAndAfterAl // Ensures that the following "tail" command won't fail. logPath.createNewFile() - val successLines = Seq(THRIFT_BINARY_SERVICE_LIVE, THRIFT_HTTP_SERVICE_LIVE) + val successLine = if (mode == ServerMode.http) { + THRIFT_HTTP_SERVICE_LIVE + } else { + THRIFT_BINARY_SERVICE_LIVE + } logTailingProcess = { val command = s"/usr/bin/env tail -n +0 -f ${logPath.getCanonicalPath}".split(" ") @@ -1199,14 +1301,15 @@ abstract class HiveThriftServer2Test extends SparkFunSuite with BeforeAndAfterAl val captureOutput = (line: String) => diagnosisBuffer.synchronized { diagnosisBuffer += line - successLines.foreach { r => - if (line.contains(r)) { - serverStarted.trySuccess(()) - } + if (line.contains(successLine)) { + listeningPort = line.split(" on port ")(1).split(' ').head.toInt + logInfo(s"Started HiveThriftServer2: port=$listeningPort, mode=$mode, attempt=$attempt") + serverStarted.trySuccess(()) + () } } - val process = builder.start() + val process = builder.start() new ProcessOutputCapturer(process.getInputStream, captureOutput).start() new ProcessOutputCapturer(process.getErrorStream, captureOutput).start() @@ -1257,16 +1360,18 @@ abstract class HiveThriftServer2Test extends SparkFunSuite with BeforeAndAfterAl override protected def beforeAll(): Unit = { super.beforeAll() - // Chooses a random port between 10000 and 19999 - listeningPort = 10000 + Random.nextInt(10000) diagnosisBuffer.clear() // Retries up to 3 times with different port numbers if the server fails to start - (1 to 3).foldLeft(Try(startThriftServer(listeningPort, 0))) { case (started, attempt) => + (1 to 3).foldLeft(Try(startThriftServer(0))) { case (started, attempt) => started.orElse { - listeningPort += 1 stopThriftServer() - Try(startThriftServer(listeningPort, attempt)) + Try { + startThriftServer(attempt) + eventually(timeout(30.seconds), interval(1.seconds)) { + withJdbcStatement() { _.execute("SELECT 1") } + } + } } }.recover { case cause: Throwable => @@ -1285,4 +1390,91 @@ abstract class HiveThriftServer2Test extends SparkFunSuite with BeforeAndAfterAl super.afterAll() } } + + Utils.classForName(classOf[HiveDriver].getCanonicalName) + + protected def jdbcUri(database: String = "default"): String = if (mode == ServerMode.http) { + s"""jdbc:hive2://localhost:$serverPort/ + |$database? + |hive.server2.transport.mode=http; + |hive.server2.thrift.http.path=cliservice; + |${hiveConfList}#${hiveVarList} + """.stripMargin.split("\n").mkString.trim + } else { + s"jdbc:hive2://localhost:$serverPort/$database?${hiveConfList}#${hiveVarList}" + } + + private def tryCaptureSysLog(f: => Unit): Unit = { + try f catch { + case e: Exception => + // Dump the HiveThriftServer2 log if error occurs, e.g. getConnection failure. + dumpLogs() + throw e + } + } + + def withMultipleConnectionJdbcStatement( + tableNames: String*)(fs: (Statement => Unit)*): Unit = tryCaptureSysLog { + val user = System.getProperty("user.name") + val connections = fs.map { _ => DriverManager.getConnection(jdbcUri(), user, "") } + val statements = connections.map(_.createStatement()) + + try { + statements.zip(fs).foreach { case (s, f) => f(s) } + } finally { + tableNames.foreach { name => + // TODO: Need a better way to drop the view. + if (name.toUpperCase(Locale.ROOT).startsWith("VIEW")) { + statements(0).execute(s"DROP VIEW IF EXISTS $name") + } else { + statements(0).execute(s"DROP TABLE IF EXISTS $name") + } + } + statements.foreach(_.close()) + connections.foreach(_.close()) + } + } + + def withDatabase(dbNames: String*)(fs: (Statement => Unit)*): Unit = tryCaptureSysLog { + val user = System.getProperty("user.name") + val connections = fs.map { _ => DriverManager.getConnection(jdbcUri(), user, "") } + val statements = connections.map(_.createStatement()) + + try { + statements.zip(fs).foreach { case (s, f) => f(s) } + } finally { + dbNames.foreach { name => + statements(0).execute(s"DROP DATABASE IF EXISTS $name") + } + statements.foreach(_.close()) + connections.foreach(_.close()) + } + } + + def withJdbcStatement(tableNames: String*)(f: Statement => Unit): Unit = { + withMultipleConnectionJdbcStatement(tableNames: _*)(f) + } +} + +/** + * Common tests for both binary and http mode thrift server + * TODO: SPARK-31914: Move common tests from subclasses to this trait + */ +abstract class HiveThriftServer2Test extends HiveThriftServer2TestBase { + test("SPARK-17819: Support default database in connection URIs") { + withDatabase("spark17819") { statement => + statement.execute(s"CREATE DATABASE IF NOT EXISTS spark17819") + val jdbcStr = jdbcUri("spark17819") + val connection = DriverManager.getConnection(jdbcStr, user, "") + val statementN = connection.createStatement() + try { + val resultSet = statementN.executeQuery("select current_database()") + resultSet.next() + assert(resultSet.getString(1) === "spark17819") + } finally { + statementN.close() + connection.close() + } + } + } } diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/JdbcConnectionUriSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/JdbcConnectionUriSuite.scala deleted file mode 100644 index fb8a7e273ae44..0000000000000 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/JdbcConnectionUriSuite.scala +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.hive.thriftserver - -import java.sql.DriverManager - -import org.apache.hive.jdbc.HiveDriver - -import org.apache.spark.util.Utils - -class JdbcConnectionUriSuite extends HiveThriftServer2Test { - Utils.classForName(classOf[HiveDriver].getCanonicalName) - - override def mode: ServerMode.Value = ServerMode.binary - - val JDBC_TEST_DATABASE = "jdbc_test_database" - val USER = System.getProperty("user.name") - val PASSWORD = "" - - override protected def beforeAll(): Unit = { - super.beforeAll() - - val jdbcUri = s"jdbc:hive2://localhost:$serverPort/" - val connection = DriverManager.getConnection(jdbcUri, USER, PASSWORD) - val statement = connection.createStatement() - statement.execute(s"CREATE DATABASE $JDBC_TEST_DATABASE") - connection.close() - } - - override protected def afterAll(): Unit = { - try { - val jdbcUri = s"jdbc:hive2://localhost:$serverPort/" - val connection = DriverManager.getConnection(jdbcUri, USER, PASSWORD) - val statement = connection.createStatement() - statement.execute(s"DROP DATABASE $JDBC_TEST_DATABASE") - connection.close() - } finally { - super.afterAll() - } - } - - test("SPARK-17819 Support default database in connection URIs") { - val jdbcUri = s"jdbc:hive2://localhost:$serverPort/$JDBC_TEST_DATABASE" - val connection = DriverManager.getConnection(jdbcUri, USER, PASSWORD) - val statement = connection.createStatement() - try { - val resultSet = statement.executeQuery("select current_database()") - resultSet.next() - assert(resultSet.getString(1) === JDBC_TEST_DATABASE) - } finally { - statement.close() - connection.close() - } - } -} diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SharedThriftServer.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SharedThriftServer.scala index ce610098156f3..8f61268c838fe 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SharedThriftServer.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SharedThriftServer.scala @@ -17,31 +17,47 @@ package org.apache.spark.sql.hive.thriftserver +import java.io.File import java.sql.{DriverManager, Statement} +import java.util +import scala.collection.JavaConverters._ import scala.concurrent.duration._ -import scala.util.{Random, Try} +import scala.util.Try import org.apache.hadoop.hive.conf.HiveConf.ConfVars +import org.apache.hadoop.hive.ql.metadata.Hive +import org.apache.hadoop.hive.ql.session.SessionState +import org.apache.hive.jdbc.HttpBasicAuthInterceptor +import org.apache.hive.service.auth.PlainSaslHelper +import org.apache.hive.service.cli.thrift.{ThriftCLIService, ThriftCLIServiceClient} +import org.apache.hive.service.rpc.thrift.TCLIService.Client +import org.apache.http.impl.client.HttpClientBuilder +import org.apache.thrift.protocol.TBinaryProtocol +import org.apache.thrift.transport.{THttpClient, TSocket} -import org.apache.spark.sql.QueryTest import org.apache.spark.sql.test.SharedSparkSession +import org.apache.spark.util.Utils trait SharedThriftServer extends SharedSparkSession { private var hiveServer2: HiveThriftServer2 = _ + private var serverPort: Int = 0 + + protected val tempScratchDir: File = { + val dir = Utils.createTempDir() + dir.setWritable(true, false) + Utils.createTempDir(dir.getAbsolutePath) + dir + } + + def mode: ServerMode.Value override def beforeAll(): Unit = { super.beforeAll() - // Chooses a random port between 10000 and 19999 - var listeningPort = 10000 + Random.nextInt(10000) - // Retries up to 3 times with different port numbers if the server fails to start - (1 to 3).foldLeft(Try(startThriftServer(listeningPort, 0))) { case (started, attempt) => - started.orElse { - listeningPort += 1 - Try(startThriftServer(listeningPort, attempt)) - } + (1 to 3).foldLeft(Try(startThriftServer(0))) { case (started, attempt) => + started.orElse(Try(startThriftServer(attempt))) }.recover { case cause: Throwable => throw cause @@ -51,18 +67,28 @@ trait SharedThriftServer extends SharedSparkSession { override def afterAll(): Unit = { try { - hiveServer2.stop() + if (hiveServer2 != null) { + hiveServer2.stop() + } } finally { super.afterAll() + SessionState.detachSession() + Hive.closeCurrent() } } - protected def withJdbcStatement(fs: (Statement => Unit)*): Unit = { - val user = System.getProperty("user.name") + protected def jdbcUri: String = if (mode == ServerMode.http) { + s"jdbc:hive2://localhost:$serverPort/default;transportMode=http;httpPath=cliservice" + } else { + s"jdbc:hive2://localhost:$serverPort/" + } - val serverPort = hiveServer2.getHiveConf.get(ConfVars.HIVE_SERVER2_THRIFT_PORT.varname) + protected def user: String = System.getProperty("user.name") + + protected def withJdbcStatement(fs: (Statement => Unit)*): Unit = { + require(serverPort != 0, "Failed to bind an actual port for HiveThriftServer2") val connections = - fs.map { _ => DriverManager.getConnection(s"jdbc:hive2://localhost:$serverPort", user, "") } + fs.map { _ => DriverManager.getConnection(jdbcUri, user, "") } val statements = connections.map(_.createStatement()) try { @@ -73,16 +99,69 @@ trait SharedThriftServer extends SharedSparkSession { } } - private def startThriftServer(port: Int, attempt: Int): Unit = { - logInfo(s"Trying to start HiveThriftServer2: port=$port, attempt=$attempt") + protected def withCLIServiceClient(f: ThriftCLIServiceClient => Unit): Unit = { + require(serverPort != 0, "Failed to bind an actual port for HiveThriftServer2") + val transport = mode match { + case ServerMode.binary => + val rawTransport = new TSocket("localhost", serverPort) + PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) + case ServerMode.http => + val interceptor = new HttpBasicAuthInterceptor( + user, + "anonymous", + null, null, true, new util.HashMap[String, String]()) + new THttpClient( + s"http://localhost:$serverPort/cliservice", + HttpClientBuilder.create.addInterceptorFirst(interceptor).build()) + } + + val protocol = new TBinaryProtocol(transport) + val client = new ThriftCLIServiceClient(new Client(protocol)) + + transport.open() + try f(client) finally transport.close() + } + + private def startThriftServer(attempt: Int): Unit = { + logInfo(s"Trying to start HiveThriftServer2: mode=$mode, attempt=$attempt") val sqlContext = spark.newSession().sqlContext - sqlContext.setConf(ConfVars.HIVE_SERVER2_THRIFT_PORT.varname, port.toString) - hiveServer2 = HiveThriftServer2.startWithContext(sqlContext) + // Set the HIVE_SERVER2_THRIFT_PORT and HIVE_SERVER2_THRIFT_HTTP_PORT to 0, so it could + // randomly pick any free port to use. + // It's much more robust than set a random port generated by ourselves ahead + sqlContext.setConf(ConfVars.HIVE_SERVER2_THRIFT_PORT.varname, "0") + sqlContext.setConf(ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT.varname, "0") + sqlContext.setConf(ConfVars.HIVE_SERVER2_TRANSPORT_MODE.varname, mode.toString) + sqlContext.setConf(ConfVars.SCRATCHDIR.varname, tempScratchDir.getAbsolutePath) + sqlContext.setConf(ConfVars.HIVE_START_CLEANUP_SCRATCHDIR.varname, "true") - // Wait for thrift server to be ready to serve the query, via executing simple query - // till the query succeeds. See SPARK-30345 for more details. - eventually(timeout(30.seconds), interval(1.seconds)) { - withJdbcStatement { _.execute("SELECT 1") } + try { + hiveServer2 = HiveThriftServer2.startWithContext(sqlContext) + hiveServer2.getServices.asScala.foreach { + case t: ThriftCLIService => + serverPort = t.getPortNumber + logInfo(s"Started HiveThriftServer2: mode=$mode, port=$serverPort, attempt=$attempt") + case _ => + } + + // the scratch dir will be recreated after the probe sql `SELECT 1` executed, so we + // check it here first. + assert(!tempScratchDir.exists()) + + // Wait for thrift server to be ready to serve the query, via executing simple query + // till the query succeeds. See SPARK-30345 for more details. + eventually(timeout(30.seconds), interval(1.seconds)) { + withJdbcStatement { _.execute("SELECT 1") } + } + } catch { + case e: Exception => + logError("Error start hive server with Context ", e) + if (hiveServer2 != null) { + hiveServer2.stop() + hiveServer2 = null + } + SessionState.detachSession() + Hive.closeCurrent() + throw e } } } diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperationSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperationSuite.scala index 13df3fabc4919..c8bb6d9ee0821 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperationSuite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperationSuite.scala @@ -17,10 +17,26 @@ package org.apache.spark.sql.hive.thriftserver +import java.util +import java.util.concurrent.Semaphore + +import scala.concurrent.duration._ + +import org.apache.hadoop.hive.conf.HiveConf +import org.apache.hive.service.cli.OperationState +import org.apache.hive.service.cli.session.{HiveSession, HiveSessionImpl} +import org.apache.hive.service.rpc.thrift.TProtocolVersion +import org.mockito.Mockito.{doReturn, mock, spy, when, RETURNS_DEEP_STUBS} +import org.mockito.invocation.InvocationOnMock + import org.apache.spark.SparkFunSuite +import org.apache.spark.sql.{DataFrame, SQLContext} +import org.apache.spark.sql.hive.thriftserver.ui.HiveThriftServer2EventManager +import org.apache.spark.sql.test.SharedSparkSession import org.apache.spark.sql.types.{IntegerType, NullType, StringType, StructField, StructType} -class SparkExecuteStatementOperationSuite extends SparkFunSuite { +class SparkExecuteStatementOperationSuite extends SparkFunSuite with SharedSparkSession { + test("SPARK-17112 `select null` via JDBC triggers IllegalArgumentException in ThriftServer") { val field1 = StructField("NULL", NullType) val field2 = StructField("(IF(true, NULL, NULL))", NullType) @@ -42,4 +58,69 @@ class SparkExecuteStatementOperationSuite extends SparkFunSuite { assert(columns.get(1).getType().getName == "INT") assert(columns.get(1).getComment() == "") } + + Seq( + (OperationState.CANCELED, (_: SparkExecuteStatementOperation).cancel()), + (OperationState.TIMEDOUT, (_: SparkExecuteStatementOperation).timeoutCancel()), + (OperationState.CLOSED, (_: SparkExecuteStatementOperation).close()) + ).foreach { case (finalState, transition) => + test("SPARK-32057 SparkExecuteStatementOperation should not transiently become ERROR " + + s"before being set to $finalState") { + val hiveSession = new HiveSessionImpl(TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1, + "username", "password", new HiveConf, "ip address") + hiveSession.open(new util.HashMap) + + HiveThriftServer2.eventManager = mock(classOf[HiveThriftServer2EventManager]) + + val spySqlContext = spy(sqlContext) + + // When cancel() is called on the operation, cleanup causes an exception to be thrown inside + // of execute(). This should not cause the state to become ERROR. The exception here will be + // triggered in our custom cleanup(). + val signal = new Semaphore(0) + val dataFrame = mock(classOf[DataFrame], RETURNS_DEEP_STUBS) + when(dataFrame.collect()).thenAnswer((_: InvocationOnMock) => { + signal.acquire() + throw new RuntimeException("Operation was cancelled by test cleanup.") + }) + val statement = "stmt" + doReturn(dataFrame, Nil: _*).when(spySqlContext).sql(statement) + + val executeStatementOperation = new MySparkExecuteStatementOperation(spySqlContext, + hiveSession, statement, signal, finalState) + + val run = new Thread() { + override def run(): Unit = executeStatementOperation.runInternal() + } + assert(executeStatementOperation.getStatus.getState === OperationState.INITIALIZED) + run.start() + eventually(timeout(5.seconds)) { + assert(executeStatementOperation.getStatus.getState === OperationState.RUNNING) + } + transition(executeStatementOperation) + run.join() + assert(executeStatementOperation.getStatus.getState === finalState) + } + } + + private class MySparkExecuteStatementOperation( + sqlContext: SQLContext, + hiveSession: HiveSession, + statement: String, + signal: Semaphore, + finalState: OperationState) + extends SparkExecuteStatementOperation(sqlContext, hiveSession, statement, + new util.HashMap, false, 0) { + + override def cleanup(): Unit = { + super.cleanup() + signal.release() + // At this point, operation should already be in finalState (set by either close() or + // cancel()). We want to check if it stays in finalState after the exception thrown by + // releasing the semaphore propagates. We hence need to sleep for a short while. + Thread.sleep(1000) + // State should not be ERROR + assert(getStatus.getState === finalState) + } + } } diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationSuite.scala index f7ee3e0a46cd1..bc2d413fdf1e9 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationSuite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkMetadataOperationSuite.scala @@ -17,31 +17,56 @@ package org.apache.spark.sql.hive.thriftserver -import java.sql.{DatabaseMetaData, ResultSet} +import java.sql.{DatabaseMetaData, ResultSet, SQLFeatureNotSupportedException} -class SparkMetadataOperationSuite extends HiveThriftJdbcTest { +import org.apache.hive.common.util.HiveVersionInfo +import org.apache.hive.service.cli.HiveSQLException + +import org.apache.spark.SPARK_VERSION +import org.apache.spark.sql.catalyst.analysis.FunctionRegistry +import org.apache.spark.sql.types._ +import org.apache.spark.util.VersionUtils + +class SparkMetadataOperationSuite extends HiveThriftServer2TestBase { override def mode: ServerMode.Value = ServerMode.binary test("Spark's own GetSchemasOperation(SparkGetSchemasOperation)") { def checkResult(rs: ResultSet, dbNames: Seq[String]): Unit = { - for (i <- dbNames.indices) { - assert(rs.next()) - assert(rs.getString("TABLE_SCHEM") === dbNames(i)) + val expected = dbNames.iterator + while(rs.next() || expected.hasNext) { + assert(rs.getString("TABLE_SCHEM") === expected.next) + assert(rs.getString("TABLE_CATALOG").isEmpty) } // Make sure there are no more elements assert(!rs.next()) + assert(!expected.hasNext, "All expected schemas should be visited") } - withDatabase("db1", "db2") { statement => - Seq("CREATE DATABASE db1", "CREATE DATABASE db2").foreach(statement.execute) - + val dbs = Seq("db1", "db2", "db33", "db44") + val dbDflts = Seq("default", "global_temp") + withDatabase(dbs: _*) { statement => + dbs.foreach( db => statement.execute(s"CREATE DATABASE IF NOT EXISTS $db")) val metaData = statement.getConnection.getMetaData - checkResult(metaData.getSchemas(null, "%"), Seq("db1", "db2", "default", "global_temp")) + Seq("", "%", null, ".*", "_*", "_%", ".%") foreach { pattern => + checkResult(metaData.getSchemas(null, pattern), dbs ++ dbDflts) + } + + Seq("db%", "db*") foreach { pattern => + checkResult(metaData.getSchemas(null, pattern), dbs) + } + + Seq("db_", "db.") foreach { pattern => + checkResult(metaData.getSchemas(null, pattern), dbs.take(2)) + } + checkResult(metaData.getSchemas(null, "db1"), Seq("db1")) checkResult(metaData.getSchemas(null, "db_not_exist"), Seq.empty) - checkResult(metaData.getSchemas(null, "db*"), Seq("db1", "db2")) + + val e = intercept[HiveSQLException](metaData.getSchemas(null, "*")) + assert(e.getCause.getMessage === + "Error operating GET_SCHEMAS Dangling meta character '*' near index 0\n*\n^") } } @@ -184,14 +209,16 @@ class SparkMetadataOperationSuite extends HiveThriftJdbcTest { } test("Spark's own GetFunctionsOperation(SparkGetFunctionsOperation)") { - def checkResult(rs: ResultSet, functionName: Seq[String]): Unit = { - for (i <- functionName.indices) { + def checkResult(rs: ResultSet, functionNames: Seq[String]): Unit = { + functionNames.foreach { func => + val exprInfo = FunctionRegistry.expressions(func)._1 assert(rs.next()) assert(rs.getString("FUNCTION_SCHEM") === "default") - assert(rs.getString("FUNCTION_NAME") === functionName(i)) - assert(rs.getString("REMARKS").startsWith(s"${functionName(i)}(")) + assert(rs.getString("FUNCTION_NAME") === exprInfo.getName) + assert(rs.getString("REMARKS") === + s"Usage: ${exprInfo.getUsage}\nExtended Usage:${exprInfo.getExtended}") assert(rs.getInt("FUNCTION_TYPE") === DatabaseMetaData.functionResultUnknown) - assert(rs.getString("SPECIFIC_NAME").startsWith("org.apache.spark.sql.catalyst")) + assert(rs.getString("SPECIFIC_NAME") === exprInfo.getClassName) } // Make sure there are no more elements assert(!rs.next()) @@ -207,20 +234,7 @@ class SparkMetadataOperationSuite extends HiveThriftJdbcTest { checkResult(metaData.getFunctions(null, "default", "overlay"), Seq("overlay")) checkResult(metaData.getFunctions(null, "default", "shift*"), Seq("shiftleft", "shiftright", "shiftrightunsigned")) - } - - withJdbcStatement() { statement => - val metaData = statement.getConnection.getMetaData - val rs = metaData.getFunctions(null, "default", "upPer") - assert(rs.next()) - assert(rs.getString("FUNCTION_SCHEM") === "default") - assert(rs.getString("FUNCTION_NAME") === "upper") - assert(rs.getString("REMARKS") === - "upper(str) - Returns `str` with all characters changed to uppercase.") - assert(rs.getInt("FUNCTION_TYPE") === DatabaseMetaData.functionResultUnknown) - assert(rs.getString("SPECIFIC_NAME") === "org.apache.spark.sql.catalyst.expressions.Upper") - // Make sure there are no more elements - assert(!rs.next()) + checkResult(metaData.getFunctions(null, "default", "upPer"), Seq("upper")) } } @@ -244,7 +258,404 @@ class SparkMetadataOperationSuite extends HiveThriftJdbcTest { withJdbcStatement() { statement => val metaData = statement.getConnection.getMetaData - checkResult(metaData.getTypeInfo, ThriftserverShimUtils.supportedType().map(_.getName)) + checkResult(metaData.getTypeInfo, SparkGetTypeInfoUtil.supportedType.map(_.getName)) + } + } + + test("check results from get columns operation from thrift server") { + val schemaName = "default" + val tableName = "spark_get_col_operation" + val schema = new StructType() + .add("c0", "boolean", nullable = false, "0") + .add("c1", "tinyint", nullable = true, "1") + .add("c2", "smallint", nullable = false, "2") + .add("c3", "int", nullable = true, "3") + .add("c4", "long", nullable = false, "4") + .add("c5", "float", nullable = true, "5") + .add("c6", "double", nullable = false, "6") + .add("c7", "decimal(38, 20)", nullable = true, "7") + .add("c8", "decimal(10, 2)", nullable = false, "8") + .add("c9", "string", nullable = true, "9") + .add("c10", "array", nullable = false, "10") + .add("c11", "array", nullable = true, "11") + .add("c12", "map", nullable = false, "12") + .add("c13", "date", nullable = true, "13") + .add("c14", "timestamp", nullable = false, "14") + .add("c15", "struct", nullable = true, "15") + .add("c16", "binary", nullable = false, "16") + .add("c17", "char(255)", nullable = true, "17") + .add("c18", "varchar(1024)", nullable = false, "18") + + val ddl = + s""" + |CREATE TABLE $schemaName.$tableName ( + | ${schema.toDDL} + |) + |using parquet""".stripMargin + + withJdbcStatement(tableName) { statement => + statement.execute(ddl) + + val databaseMetaData = statement.getConnection.getMetaData + val rowSet = databaseMetaData.getColumns("", schemaName, tableName, null) + + import java.sql.Types._ + val expectedJavaTypes = Seq(BOOLEAN, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, DOUBLE, + DECIMAL, DECIMAL, VARCHAR, ARRAY, ARRAY, JAVA_OBJECT, DATE, TIMESTAMP, STRUCT, BINARY, + CHAR, VARCHAR) + + var pos = 0 + + while (rowSet.next()) { + assert(rowSet.getString("TABLE_CAT") === null) + assert(rowSet.getString("TABLE_SCHEM") === schemaName) + assert(rowSet.getString("TABLE_NAME") === tableName) + assert(rowSet.getString("COLUMN_NAME") === schema(pos).name) + assert(rowSet.getInt("DATA_TYPE") === expectedJavaTypes(pos)) + assert(rowSet.getString("TYPE_NAME") === schema(pos).dataType.sql) + + val colSize = rowSet.getInt("COLUMN_SIZE") + schema(pos).dataType match { + case StringType | BinaryType | _: ArrayType | _: MapType | _: VarcharType => + assert(colSize === 0) + case o => assert(colSize === o.defaultSize) + } + + assert(rowSet.getInt("BUFFER_LENGTH") === 0) // not used + val decimalDigits = rowSet.getInt("DECIMAL_DIGITS") + schema(pos).dataType match { + case BooleanType | _: IntegerType => assert(decimalDigits === 0) + case d: DecimalType => assert(decimalDigits === d.scale) + case FloatType => assert(decimalDigits === 7) + case DoubleType => assert(decimalDigits === 15) + case TimestampType => assert(decimalDigits === 6) + case _ => assert(decimalDigits === 0) // nulls + } + + val radix = rowSet.getInt("NUM_PREC_RADIX") + schema(pos).dataType match { + case _: NumericType => assert(radix === 10) + case _ => assert(radix === 0) // nulls + } + + assert(rowSet.getInt("NULLABLE") === 1) + assert(rowSet.getString("REMARKS") === pos.toString) + assert(rowSet.getInt("ORDINAL_POSITION") === pos) + assert(rowSet.getString("IS_NULLABLE") === "YES") + assert(rowSet.getString("IS_AUTO_INCREMENT") === "NO") + pos += 1 + } + + assert(pos === 19, "all columns should have been verified") + } + } + + test("get columns operation should handle interval column properly") { + val viewName = "view_interval" + val ddl = s"CREATE GLOBAL TEMP VIEW $viewName as select interval 1 day as i" + + withJdbcStatement(viewName) { statement => + statement.execute(ddl) + val data = statement.getConnection.getMetaData + val rowSet = data.getColumns("", "global_temp", viewName, null) + while (rowSet.next()) { + assert(rowSet.getString("TABLE_CAT") === null) + assert(rowSet.getString("TABLE_SCHEM") === "global_temp") + assert(rowSet.getString("TABLE_NAME") === viewName) + assert(rowSet.getString("COLUMN_NAME") === "i") + assert(rowSet.getInt("DATA_TYPE") === java.sql.Types.OTHER) + assert(rowSet.getString("TYPE_NAME").equalsIgnoreCase(CalendarIntervalType.sql)) + assert(rowSet.getInt("COLUMN_SIZE") === CalendarIntervalType.defaultSize) + assert(rowSet.getInt("DECIMAL_DIGITS") === 0) + assert(rowSet.getInt("NUM_PREC_RADIX") === 0) + assert(rowSet.getInt("NULLABLE") === 0) + assert(rowSet.getString("REMARKS") === "") + assert(rowSet.getInt("ORDINAL_POSITION") === 0) + assert(rowSet.getString("IS_NULLABLE") === "YES") + assert(rowSet.getString("IS_AUTO_INCREMENT") === "NO") + } + } + } + + test("SPARK-35085: Get columns operation should handle ANSI interval column properly") { + val viewName1 = "view_interval1" + val yearMonthDDL = + s"CREATE GLOBAL TEMP VIEW $viewName1 as select interval '1-1' year to month as i" + + withJdbcStatement(viewName1) { statement => + statement.execute(yearMonthDDL) + val data = statement.getConnection.getMetaData + val rowSet = data.getColumns("", "global_temp", viewName1, null) + while (rowSet.next()) { + assert(rowSet.getString("TABLE_CAT") === null) + assert(rowSet.getString("TABLE_SCHEM") === "global_temp") + assert(rowSet.getString("TABLE_NAME") === viewName1) + assert(rowSet.getString("COLUMN_NAME") === "i") + assert(rowSet.getInt("DATA_TYPE") === java.sql.Types.OTHER) + assert(rowSet.getString("TYPE_NAME").equalsIgnoreCase(YearMonthIntervalType.sql)) + assert(rowSet.getInt("COLUMN_SIZE") === YearMonthIntervalType.defaultSize) + assert(rowSet.getInt("DECIMAL_DIGITS") === 0) + assert(rowSet.getInt("NUM_PREC_RADIX") === 0) + assert(rowSet.getInt("NULLABLE") === 0) + assert(rowSet.getString("REMARKS") === "") + assert(rowSet.getInt("ORDINAL_POSITION") === 0) + assert(rowSet.getString("IS_NULLABLE") === "YES") + assert(rowSet.getString("IS_AUTO_INCREMENT") === "NO") + } + } + + val viewName2 = "view_interval2" + val dayTimeDDL = + s"CREATE GLOBAL TEMP VIEW $viewName2 as select interval '1 2:3:4.001' day to second as i" + + withJdbcStatement(viewName2) { statement => + statement.execute(dayTimeDDL) + val data = statement.getConnection.getMetaData + val rowSet = data.getColumns("", "global_temp", viewName2, null) + while (rowSet.next()) { + assert(rowSet.getString("TABLE_CAT") === null) + assert(rowSet.getString("TABLE_SCHEM") === "global_temp") + assert(rowSet.getString("TABLE_NAME") === viewName2) + assert(rowSet.getString("COLUMN_NAME") === "i") + assert(rowSet.getInt("DATA_TYPE") === java.sql.Types.OTHER) + assert(rowSet.getString("TYPE_NAME").equalsIgnoreCase(DayTimeIntervalType.sql)) + assert(rowSet.getInt("COLUMN_SIZE") === DayTimeIntervalType.defaultSize) + assert(rowSet.getInt("DECIMAL_DIGITS") === 0) + assert(rowSet.getInt("NUM_PREC_RADIX") === 0) + assert(rowSet.getInt("NULLABLE") === 0) + assert(rowSet.getString("REMARKS") === "") + assert(rowSet.getInt("ORDINAL_POSITION") === 0) + assert(rowSet.getString("IS_NULLABLE") === "YES") + assert(rowSet.getString("IS_AUTO_INCREMENT") === "NO") + } + } + } + + test("handling null in view for get columns operations") { + val viewName = "view_null" + val ddl = s"CREATE GLOBAL TEMP VIEW $viewName as select null as n" + + withJdbcStatement(viewName) { statement => + statement.execute(ddl) + val data = statement.getConnection.getMetaData + val rowSet = data.getColumns("", "global_temp", viewName, "n") + while (rowSet.next()) { + assert(rowSet.getString("TABLE_CAT") === null) + assert(rowSet.getString("TABLE_SCHEM") === "global_temp") + assert(rowSet.getString("TABLE_NAME") === viewName) + assert(rowSet.getString("COLUMN_NAME") === "n") + assert(rowSet.getInt("DATA_TYPE") === java.sql.Types.NULL) + assert(rowSet.getString("TYPE_NAME").equalsIgnoreCase(NullType.sql)) + assert(rowSet.getInt("COLUMN_SIZE") === 1) + assert(rowSet.getInt("DECIMAL_DIGITS") === 0) + assert(rowSet.getInt("NUM_PREC_RADIX") === 0) + assert(rowSet.getInt("NULLABLE") === 1) + assert(rowSet.getString("REMARKS") === "") + assert(rowSet.getInt("ORDINAL_POSITION") === 0) + assert(rowSet.getString("IS_NULLABLE") === "YES") + assert(rowSet.getString("IS_AUTO_INCREMENT") === "NO") + } + } + } + + test("Hive ThriftServer JDBC Database MetaData API Auditing - Method not supported") { + // These APIs belong to the upstream Apache Hive's hive-jdbc artifact where defines the hive + // behavior. Users can also use it to interact with Spark ThriftServer directly. Some behaviors + // are not fully consistent with Spark e.g. we support correlated subqueries but the hive-jdbc + // now fail directly at client side. There is nothing we can do but accept the current + // condition and highlight the difference and make it perspective in future changes both from + // upstream and inside Spark. + withJdbcStatement() { statement => + val metaData = statement.getConnection.getMetaData + Seq( + () => metaData.allProceduresAreCallable, + () => metaData.getURL, + () => metaData.getUserName, + () => metaData.isReadOnly, + () => metaData.nullsAreSortedHigh, + () => metaData.nullsAreSortedLow, + () => metaData.nullsAreSortedAtStart, + () => metaData.nullsAreSortedAtEnd, + () => metaData.usesLocalFiles, + () => metaData.usesLocalFilePerTable, + () => metaData.supportsMixedCaseIdentifiers, + () => metaData.supportsMixedCaseQuotedIdentifiers, + () => metaData.storesUpperCaseIdentifiers, + () => metaData.storesUpperCaseQuotedIdentifiers, + () => metaData.storesLowerCaseIdentifiers, + () => metaData.storesLowerCaseQuotedIdentifiers, + () => metaData.storesMixedCaseIdentifiers, + () => metaData.storesMixedCaseQuotedIdentifiers, + () => metaData.getSQLKeywords, + () => metaData.nullPlusNonNullIsNull, + () => metaData.supportsConvert, + () => metaData.supportsTableCorrelationNames, + () => metaData.supportsDifferentTableCorrelationNames, + () => metaData.supportsExpressionsInOrderBy, + () => metaData.supportsOrderByUnrelated, + () => metaData.supportsGroupByUnrelated, + () => metaData.supportsGroupByBeyondSelect, + () => metaData.supportsLikeEscapeClause, + () => metaData.supportsMultipleTransactions, + () => metaData.supportsMinimumSQLGrammar, + () => metaData.supportsCoreSQLGrammar, + () => metaData.supportsExtendedSQLGrammar, + () => metaData.supportsANSI92EntryLevelSQL, + () => metaData.supportsANSI92IntermediateSQL, + () => metaData.supportsANSI92FullSQL, + () => metaData.supportsIntegrityEnhancementFacility, + () => metaData.isCatalogAtStart, + () => metaData.supportsSubqueriesInComparisons, + () => metaData.supportsSubqueriesInExists, + () => metaData.supportsSubqueriesInIns, + () => metaData.supportsSubqueriesInQuantifieds, + // Spark support this, see https://issues.apache.org/jira/browse/SPARK-18455 + () => metaData.supportsCorrelatedSubqueries, + () => metaData.supportsOpenCursorsAcrossCommit, + () => metaData.supportsOpenCursorsAcrossRollback, + () => metaData.supportsOpenStatementsAcrossCommit, + () => metaData.supportsOpenStatementsAcrossRollback, + () => metaData.getMaxBinaryLiteralLength, + () => metaData.getMaxCharLiteralLength, + () => metaData.getMaxColumnsInGroupBy, + () => metaData.getMaxColumnsInIndex, + () => metaData.getMaxColumnsInOrderBy, + () => metaData.getMaxColumnsInSelect, + () => metaData.getMaxColumnsInTable, + () => metaData.getMaxConnections, + () => metaData.getMaxCursorNameLength, + () => metaData.getMaxIndexLength, + () => metaData.getMaxSchemaNameLength, + () => metaData.getMaxProcedureNameLength, + () => metaData.getMaxCatalogNameLength, + () => metaData.getMaxRowSize, + () => metaData.doesMaxRowSizeIncludeBlobs, + () => metaData.getMaxStatementLength, + () => metaData.getMaxStatements, + () => metaData.getMaxTableNameLength, + () => metaData.getMaxTablesInSelect, + () => metaData.getMaxUserNameLength, + () => metaData.supportsTransactionIsolationLevel(1), + () => metaData.supportsDataDefinitionAndDataManipulationTransactions, + () => metaData.supportsDataManipulationTransactionsOnly, + () => metaData.dataDefinitionCausesTransactionCommit, + () => metaData.dataDefinitionIgnoredInTransactions, + () => metaData.getColumnPrivileges("", "%", "%", "%"), + () => metaData.getTablePrivileges("", "%", "%"), + () => metaData.getBestRowIdentifier("", "%", "%", 0, true), + () => metaData.getVersionColumns("", "%", "%"), + () => metaData.getExportedKeys("", "default", ""), + () => metaData.supportsResultSetConcurrency(ResultSet.TYPE_FORWARD_ONLY, 2), + () => metaData.ownUpdatesAreVisible(ResultSet.TYPE_FORWARD_ONLY), + () => metaData.ownDeletesAreVisible(ResultSet.TYPE_FORWARD_ONLY), + () => metaData.ownInsertsAreVisible(ResultSet.TYPE_FORWARD_ONLY), + () => metaData.othersUpdatesAreVisible(ResultSet.TYPE_FORWARD_ONLY), + () => metaData.othersDeletesAreVisible(ResultSet.TYPE_FORWARD_ONLY), + () => metaData.othersInsertsAreVisible(ResultSet.TYPE_FORWARD_ONLY), + () => metaData.updatesAreDetected(ResultSet.TYPE_FORWARD_ONLY), + () => metaData.deletesAreDetected(ResultSet.TYPE_FORWARD_ONLY), + () => metaData.insertsAreDetected(ResultSet.TYPE_FORWARD_ONLY), + () => metaData.supportsNamedParameters, + () => metaData.supportsMultipleOpenResults, + () => metaData.supportsGetGeneratedKeys, + () => metaData.getSuperTypes("", "%", "%"), + () => metaData.getSuperTables("", "%", "%"), + () => metaData.getAttributes("", "%", "%", "%"), + () => metaData.getResultSetHoldability, + () => metaData.locatorsUpdateCopy, + () => metaData.supportsStatementPooling, + () => metaData.getRowIdLifetime, + () => metaData.supportsStoredFunctionsUsingCallSyntax, + () => metaData.autoCommitFailureClosesAllResultSets, + () => metaData.getClientInfoProperties, + () => metaData.getFunctionColumns("", "%", "%", "%"), + () => metaData.getPseudoColumns("", "%", "%", "%"), + () => metaData.generatedKeyAlwaysReturned).foreach { func => + val e = intercept[SQLFeatureNotSupportedException](func()) + assert(e.getMessage === "Method not supported") + } + } + } + + test("Hive ThriftServer JDBC Database MetaData API Auditing - Method supported") { + // These APIs belong to the upstream Apache Hive's hive-jdbc artifact where defines the hive + // behavior. Users can also use it to interact with Spark ThriftServer directly. Some behaviors + // are not fully consistent with Spark e.g. we can work with multiple catalogs. + // There is nothing we can do but accept the current condition and highlight the difference + // and make it perspective in future changes both from upstream and inside Spark. + withJdbcStatement() { statement => + val metaData = statement.getConnection.getMetaData + assert(metaData.allTablesAreSelectable) + assert(metaData.getDatabaseProductName === "Spark SQL") + assert(metaData.getDatabaseProductVersion === SPARK_VERSION) + assert(metaData.getDriverName === "Hive JDBC") + assert(metaData.getDriverVersion === HiveVersionInfo.getVersion) + assert(metaData.getDatabaseMajorVersion === VersionUtils.majorVersion(SPARK_VERSION)) + assert(metaData.getDatabaseMinorVersion === VersionUtils.minorVersion(SPARK_VERSION)) + assert(metaData.getIdentifierQuoteString === " ", + "This method returns a space \" \" if identifier quoting is not supported") + assert(metaData.getNumericFunctions === "") + assert(metaData.getStringFunctions === "") + assert(metaData.getSystemFunctions === "") + assert(metaData.getTimeDateFunctions === "") + assert(metaData.getSearchStringEscape === "\\") + assert(metaData.getExtraNameCharacters === "") + assert(metaData.supportsAlterTableWithAddColumn()) + assert(!metaData.supportsAlterTableWithDropColumn()) + assert(metaData.supportsColumnAliasing()) + assert(metaData.supportsGroupBy) + assert(!metaData.supportsMultipleResultSets) + assert(!metaData.supportsNonNullableColumns) + assert(metaData.supportsOuterJoins) + assert(metaData.supportsFullOuterJoins) + assert(metaData.supportsLimitedOuterJoins) + assert(metaData.getSchemaTerm === "database") + assert(metaData.getProcedureTerm === "UDF") + assert(metaData.getCatalogTerm === "instance") + assert(metaData.getCatalogSeparator === ".") + assert(metaData.supportsSchemasInDataManipulation) + assert(!metaData.supportsSchemasInProcedureCalls) + assert(metaData.supportsSchemasInTableDefinitions) + assert(!metaData.supportsSchemasInIndexDefinitions) + assert(!metaData.supportsSchemasInPrivilegeDefinitions) + // This is actually supported, but hive jdbc package return false + assert(!metaData.supportsCatalogsInDataManipulation) + assert(!metaData.supportsCatalogsInProcedureCalls) + // This is actually supported, but hive jdbc package return false + assert(!metaData.supportsCatalogsInTableDefinitions) + assert(!metaData.supportsCatalogsInIndexDefinitions) + assert(!metaData.supportsCatalogsInPrivilegeDefinitions) + assert(!metaData.supportsPositionedDelete) + assert(!metaData.supportsPositionedUpdate) + assert(!metaData.supportsSelectForUpdate) + assert(!metaData.supportsStoredProcedures) + // This is actually supported, but hive jdbc package return false + assert(!metaData.supportsUnion) + assert(metaData.supportsUnionAll) + assert(metaData.getMaxColumnNameLength === 128) + assert(metaData.getDefaultTransactionIsolation === java.sql.Connection.TRANSACTION_NONE) + assert(!metaData.supportsTransactions) + assert(!metaData.getProcedureColumns("", "%", "%", "%").next()) + assert(!metaData.getImportedKeys("", "default", "").next()) + + // TODO: SPARK-33219 Disable GetPrimaryKeys and GetCrossReference APIs explicitly + // for Spark ThriftServer + assert(!metaData.getPrimaryKeys("", "default", "").next()) + assert(!metaData.getCrossReference("", "default", "src", "", "default", "src2").next()) + + assert(!metaData.getIndexInfo("", "default", "src", true, true).next()) + assert(metaData.supportsResultSetType(ResultSet.TYPE_FORWARD_ONLY)) + assert(metaData.supportsResultSetType(ResultSet.TYPE_SCROLL_INSENSITIVE)) + assert(metaData.supportsResultSetType(ResultSet.TYPE_SCROLL_SENSITIVE)) + assert(!metaData.supportsBatchUpdates) + assert(!metaData.getUDTs(",", "%", "%", null).next()) + assert(!metaData.supportsSavepoints) + assert(!metaData.supportsResultSetHoldability(ResultSet.HOLD_CURSORS_OVER_COMMIT)) + assert(metaData.getJDBCMajorVersion === 3) + assert(metaData.getJDBCMinorVersion === 0) + assert(metaData.getSQLStateType === DatabaseMetaData.sqlStateSQL) + assert(metaData.getMaxLogicalLobSize === 0) + assert(!metaData.supportsRefCursors) } } } diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnvSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnvSuite.scala index f28faea2be868..f2bb337e4a826 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnvSuite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLEnvSuite.scala @@ -42,7 +42,7 @@ class SparkSQLEnvSuite extends SparkFunSuite { QUERY_EXECUTION_LISTENERS.key -> classOf[DummyQueryExecutionListener].getCanonicalName, STREAMING_QUERY_LISTENERS.key -> classOf[DummyStreamingQueryListener].getCanonicalName, WAREHOUSE_PATH.key -> TestHiveContext.makeWarehouseDir().toURI.getPath, - // The issue occured from "maven" and list of custom jars, but providing list of custom + // The issue occurred from "maven" and list of custom jars, but providing list of custom // jars to initialize HiveClient isn't trivial, so just use "maven". HIVE_METASTORE_JARS.key -> "maven", HIVE_METASTORE_VERSION.key -> null, diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkThriftServerProtocolVersionsSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkThriftServerProtocolVersionsSuite.scala index fd45e7a48c0eb..8ca33d3e1b410 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkThriftServerProtocolVersionsSuite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/SparkThriftServerProtocolVersionsSuite.scala @@ -20,34 +20,37 @@ package org.apache.spark.sql.hive.thriftserver import java.sql.{Date, Timestamp} import java.util.{List => JList, Properties} +import org.apache.hadoop.hive.common.`type`.{HiveIntervalDayTime, HiveIntervalYearMonth} import org.apache.hive.jdbc.{HiveConnection, HiveQueryResultSet} import org.apache.hive.service.auth.PlainSaslHelper import org.apache.hive.service.cli.GetInfoType +import org.apache.hive.service.rpc.thrift.{TExecuteStatementReq, TGetInfoReq, TGetTablesReq, TOpenSessionReq, TProtocolVersion} +import org.apache.hive.service.rpc.thrift.TCLIService.Client import org.apache.thrift.protocol.TBinaryProtocol import org.apache.thrift.transport.TSocket import org.apache.spark.sql.catalyst.util.NumberConverter import org.apache.spark.unsafe.types.UTF8String -class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { +class SparkThriftServerProtocolVersionsSuite extends HiveThriftServer2TestBase { override def mode: ServerMode.Value = ServerMode.binary def testExecuteStatementWithProtocolVersion( - version: ThriftserverShimUtils.TProtocolVersion, + version: TProtocolVersion, sql: String)(f: HiveQueryResultSet => Unit): Unit = { val rawTransport = new TSocket("localhost", serverPort) val connection = new HiveConnection(s"jdbc:hive2://localhost:$serverPort", new Properties) val user = System.getProperty("user.name") val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) - val client = new ThriftserverShimUtils.Client(new TBinaryProtocol(transport)) + val client = new Client(new TBinaryProtocol(transport)) transport.open() var rs: HiveQueryResultSet = null try { - val clientProtocol = new ThriftserverShimUtils.TOpenSessionReq(version) + val clientProtocol = new TOpenSessionReq(version) val openResp = client.OpenSession(clientProtocol) val sessHandle = openResp.getSessionHandle - val execReq = new ThriftserverShimUtils.TExecuteStatementReq(sessHandle, sql) + val execReq = new TExecuteStatementReq(sessHandle, sql) val execResp = client.ExecuteStatement(execReq) val stmtHandle = execResp.getOperationHandle @@ -72,23 +75,21 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { } } - def testGetInfoWithProtocolVersion(version: ThriftserverShimUtils.TProtocolVersion): Unit = { + def testGetInfoWithProtocolVersion(version: TProtocolVersion): Unit = { val rawTransport = new TSocket("localhost", serverPort) val connection = new HiveConnection(s"jdbc:hive2://localhost:$serverPort", new Properties) val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) - val client = new ThriftserverShimUtils.Client(new TBinaryProtocol(transport)) + val client = new Client(new TBinaryProtocol(transport)) transport.open() try { - val clientProtocol = new ThriftserverShimUtils.TOpenSessionReq(version) + val clientProtocol = new TOpenSessionReq(version) val openResp = client.OpenSession(clientProtocol) val sessHandle = openResp.getSessionHandle - val dbVersionReq = - new ThriftserverShimUtils.TGetInfoReq(sessHandle, GetInfoType.CLI_DBMS_VER.toTGetInfoType) + val dbVersionReq = new TGetInfoReq(sessHandle, GetInfoType.CLI_DBMS_VER.toTGetInfoType) val dbVersion = client.GetInfo(dbVersionReq).getInfoValue.getStringValue - val dbNameReq = - new ThriftserverShimUtils.TGetInfoReq(sessHandle, GetInfoType.CLI_DBMS_NAME.toTGetInfoType) + val dbNameReq = new TGetInfoReq(sessHandle, GetInfoType.CLI_DBMS_NAME.toTGetInfoType) val dbName = client.GetInfo(dbNameReq).getInfoValue.getStringValue assert(dbVersion === org.apache.spark.SPARK_VERSION) @@ -101,21 +102,21 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { } def testGetTablesWithProtocolVersion( - version: ThriftserverShimUtils.TProtocolVersion, + version: TProtocolVersion, schema: String, tableNamePattern: String, tableTypes: JList[String])(f: HiveQueryResultSet => Unit): Unit = { val rawTransport = new TSocket("localhost", serverPort) val connection = new HiveConnection(s"jdbc:hive2://localhost:$serverPort", new Properties) val transport = PlainSaslHelper.getPlainTransport(user, "anonymous", rawTransport) - val client = new ThriftserverShimUtils.Client(new TBinaryProtocol(transport)) + val client = new Client(new TBinaryProtocol(transport)) transport.open() var rs: HiveQueryResultSet = null try { - val clientProtocol = new ThriftserverShimUtils.TOpenSessionReq(version) + val clientProtocol = new TOpenSessionReq(version) val openResp = client.OpenSession(clientProtocol) val sessHandle = openResp.getSessionHandle - val getTableReq = new ThriftserverShimUtils.TGetTablesReq(sessHandle) + val getTableReq = new TGetTablesReq(sessHandle) getTableReq.setSchemaName(schema) getTableReq.setTableName(tableNamePattern) getTableReq.setTableTypes(tableTypes) @@ -143,11 +144,17 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { } } - ThriftserverShimUtils.testedProtocolVersions.foreach { version => + TProtocolVersion.values().foreach { version => test(s"$version get byte type") { testExecuteStatementWithProtocolVersion(version, "SELECT cast(1 as byte)") { rs => assert(rs.next()) assert(rs.getByte(1) === 1.toByte) + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "CAST(1 AS TINYINT)") + assert(metaData.getColumnTypeName(1) === "tinyint") + assert(metaData.getColumnType(1) === java.sql.Types.TINYINT) + assert(metaData.getPrecision(1) === 3) + assert(metaData.getScale(1) === 0) } } @@ -155,6 +162,12 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { testExecuteStatementWithProtocolVersion(version, "SELECT cast(1 as short)") { rs => assert(rs.next()) assert(rs.getShort(1) === 1.toShort) + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "CAST(1 AS SMALLINT)") + assert(metaData.getColumnTypeName(1) === "smallint") + assert(metaData.getColumnType(1) === java.sql.Types.SMALLINT) + assert(metaData.getPrecision(1) === 5) + assert(metaData.getScale(1) === 0) } } @@ -162,6 +175,12 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { testExecuteStatementWithProtocolVersion(version, "SELECT 1") { rs => assert(rs.next()) assert(rs.getInt(1) === 1) + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "1") + assert(metaData.getColumnTypeName(1) === "int") + assert(metaData.getColumnType(1) === java.sql.Types.INTEGER) + assert(metaData.getPrecision(1) === 10) + assert(metaData.getScale(1) === 0) } } @@ -169,6 +188,12 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { testExecuteStatementWithProtocolVersion(version, "SELECT cast(1 as bigint)") { rs => assert(rs.next()) assert(rs.getLong(1) === 1L) + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "CAST(1 AS BIGINT)") + assert(metaData.getColumnTypeName(1) === "bigint") + assert(metaData.getColumnType(1) === java.sql.Types.BIGINT) + assert(metaData.getPrecision(1) === 19) + assert(metaData.getScale(1) === 0) } } @@ -176,6 +201,12 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { testExecuteStatementWithProtocolVersion(version, "SELECT cast(1.2 as float)") { rs => assert(rs.next()) assert(rs.getFloat(1) === 1.2F) + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "CAST(1.2 AS FLOAT)") + assert(metaData.getColumnTypeName(1) === "float") + assert(metaData.getColumnType(1) === java.sql.Types.FLOAT) + assert(metaData.getPrecision(1) === 7) + assert(metaData.getScale(1) === 7) } } @@ -183,14 +214,30 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { testExecuteStatementWithProtocolVersion(version, "SELECT cast(1.2 as double)") { rs => assert(rs.next()) assert(rs.getDouble(1) === 1.2D) + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "CAST(1.2 AS DOUBLE)") + assert(metaData.getColumnTypeName(1) === "double") + assert(metaData.getColumnType(1) === java.sql.Types.DOUBLE) + assert(metaData.getPrecision(1) === 15) + assert(metaData.getScale(1) === 15) } } test(s"$version get decimal type") { testExecuteStatementWithProtocolVersion(version, - "SELECT cast(1 as decimal(18, 2)) as c") { rs => + "SELECT cast(1 as decimal(9, 1)) as col0, 1234.56BD as col1, 0.123 as col2") { rs => assert(rs.next()) - assert(rs.getBigDecimal(1) === new java.math.BigDecimal("1.00")) + assert(rs.getBigDecimal(1) === new java.math.BigDecimal("1.0")) + assert(rs.getBigDecimal("col1") === new java.math.BigDecimal("1234.56")) + assert(rs.getBigDecimal("col2") === new java.math.BigDecimal("0.123")) + val metaData = rs.getMetaData + (1 to 3) foreach { i => + assert(metaData.getColumnName(i) === s"col${i - 1}") + assert(metaData.getColumnTypeName(i) === "decimal") + assert(metaData.getColumnType(i) === java.sql.Types.DECIMAL) + assert(metaData.getPrecision(i) == 12 - i * 3) + assert(metaData.getScale(i) == i) + } } testExecuteStatementWithProtocolVersion(version, "SELECT cast(null as decimal) ") { rs => @@ -203,6 +250,12 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { testExecuteStatementWithProtocolVersion(version, "SELECT 'str'") { rs => assert(rs.next()) assert(rs.getString(1) === "str") + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) ==="str") + assert(metaData.getColumnTypeName(1) === "string") + assert(metaData.getColumnType(1) === java.sql.Types.VARCHAR) + assert(metaData.getPrecision(1) === Int.MaxValue) + assert(metaData.getScale(1) === 0) } } @@ -211,6 +264,12 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { "SELECT cast('char-str' as char(10))") { rs => assert(rs.next()) assert(rs.getString(1) === "char-str") + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) ==="CAST(char-str AS STRING)") + assert(metaData.getColumnTypeName(1) === "string") + assert(metaData.getColumnType(1) === java.sql.Types.VARCHAR) + assert(metaData.getPrecision(1) === Int.MaxValue) + assert(metaData.getScale(1) === 0) } } @@ -219,6 +278,12 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { "SELECT cast('varchar-str' as varchar(10))") { rs => assert(rs.next()) assert(rs.getString(1) === "varchar-str") + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) ==="CAST(varchar-str AS STRING)") + assert(metaData.getColumnTypeName(1) === "string") + assert(metaData.getColumnType(1) === java.sql.Types.VARCHAR) + assert(metaData.getPrecision(1) === Int.MaxValue) + assert(metaData.getScale(1) === 0) } } @@ -226,6 +291,12 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { testExecuteStatementWithProtocolVersion(version, "SELECT cast('ABC' as binary)") { rs => assert(rs.next()) assert(rs.getString(1) === "ABC") + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "CAST(ABC AS BINARY)") + assert(metaData.getColumnTypeName(1) === "binary") + assert(metaData.getColumnType(1) === java.sql.Types.BINARY) + assert(metaData.getPrecision(1) === Int.MaxValue) + assert(metaData.getScale(1) === 0) } testExecuteStatementWithProtocolVersion(version, "SELECT cast(49960 as binary)") { rs => assert(rs.next()) @@ -241,6 +312,12 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { testExecuteStatementWithProtocolVersion(version, "SELECT true") { rs => assert(rs.next()) assert(rs.getBoolean(1) === true) + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "true") + assert(metaData.getColumnTypeName(1) === "boolean") + assert(metaData.getColumnType(1) === java.sql.Types.BOOLEAN) + assert(metaData.getPrecision(1) === 1) + assert(metaData.getScale(1) === 0) } } @@ -248,6 +325,12 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { testExecuteStatementWithProtocolVersion(version, "SELECT cast('2019-07-22' as date)") { rs => assert(rs.next()) assert(rs.getDate(1) === Date.valueOf("2019-07-22")) + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "CAST(2019-07-22 AS DATE)") + assert(metaData.getColumnTypeName(1) === "date") + assert(metaData.getColumnType(1) === java.sql.Types.DATE) + assert(metaData.getPrecision(1) === 10) + assert(metaData.getScale(1) === 0) } } @@ -256,6 +339,12 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { "SELECT cast('2019-07-22 18:14:00' as timestamp)") { rs => assert(rs.next()) assert(rs.getTimestamp(1) === Timestamp.valueOf("2019-07-22 18:14:00")) + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "CAST(2019-07-22 18:14:00 AS TIMESTAMP)") + assert(metaData.getColumnTypeName(1) === "timestamp") + assert(metaData.getColumnType(1) === java.sql.Types.TIMESTAMP) + assert(metaData.getPrecision(1) === 29) + assert(metaData.getScale(1) === 9) } } @@ -263,6 +352,12 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { testExecuteStatementWithProtocolVersion(version, "SELECT null") { rs => assert(rs.next()) assert(rs.getString(1) === null) + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "NULL") + assert(metaData.getColumnTypeName(1) === "void") + assert(metaData.getColumnType(1) === java.sql.Types.NULL) + assert(metaData.getPrecision(1) === 0) + assert(metaData.getScale(1) === 0) } } @@ -270,28 +365,67 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { testExecuteStatementWithProtocolVersion(version, "SELECT interval '1' year '2' day") { rs => assert(rs.next()) assert(rs.getString(1) === "1 years 2 days") + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "INTERVAL '1 years 2 days'") + assert(metaData.getColumnTypeName(1) === "string") + assert(metaData.getColumnType(1) === java.sql.Types.VARCHAR) + assert(metaData.getPrecision(1) === Int.MaxValue) + assert(metaData.getScale(1) === 0) } } test(s"$version get array type") { - testExecuteStatementWithProtocolVersion(version, "SELECT array(1, 2)") { rs => + testExecuteStatementWithProtocolVersion( + version, "SELECT array() AS col1, array(1, 2) AS col2") { rs => assert(rs.next()) - assert(rs.getString(1) === "[1,2]") + assert(rs.getString(2) === "[1,2]") + assert(rs.getObject("col1") === "[]") + assert(rs.getObject("col2") === "[1,2]") + val metaData = rs.getMetaData + (1 to 2) foreach { i => + assert(metaData.getColumnName(i) === s"col$i") + assert(metaData.getColumnTypeName(i) === "array") + assert(metaData.getColumnType(i) === java.sql.Types.ARRAY) + assert(metaData.getPrecision(i) === Int.MaxValue) + assert(metaData.getScale(i) == 0) + } } } test(s"$version get map type") { - testExecuteStatementWithProtocolVersion(version, "SELECT map(1, 2)") { rs => + testExecuteStatementWithProtocolVersion(version, + "SELECT map(), map(1, 2, 3, 4)") { rs => assert(rs.next()) - assert(rs.getString(1) === "{1:2}") + assert(rs.getObject(1) === "{}") + assert(rs.getObject(2) === "{1:2,3:4}") + assert(rs.getString(2) === "{1:2,3:4}") + val metaData = rs.getMetaData + (1 to 2) foreach { i => + assert(metaData.getColumnName(i).startsWith("map(")) + assert(metaData.getColumnTypeName(1) === "map") + assert(metaData.getColumnType(i) === java.sql.Types.JAVA_OBJECT) + assert(metaData.getPrecision(i) === Int.MaxValue) + assert(metaData.getScale(i) == 0) + } } } test(s"$version get struct type") { testExecuteStatementWithProtocolVersion(version, - "SELECT struct('alpha' AS A, 'beta' AS B)") { rs => + "SELECT struct('alpha' AS A, 'beta' AS B) as col0," + + " struct('1', '2') AS col1, named_struct('a', 2, 'b', 4) AS col2") { rs => assert(rs.next()) assert(rs.getString(1) === """{"A":"alpha","B":"beta"}""") + assert(rs.getObject("col1") === """{"col1":"1","col2":"2"}""") + assert(rs.getObject("col2") === """{"a":2,"b":4}""") + val metaData = rs.getMetaData + (1 to 3) foreach { i => + assert(metaData.getColumnName(i) === s"col${i - 1}") + assert(metaData.getColumnTypeName(1) === "struct") + assert(metaData.getColumnType(i) === java.sql.Types.STRUCT) + assert(metaData.getPrecision(i) === Int.MaxValue) + assert(metaData.getScale(i) == 0) + } } } @@ -325,5 +459,29 @@ class SparkThriftServerProtocolVersionsSuite extends HiveThriftJdbcTest { } } } + + test(s"SPARK-35017: $version get day-time interval type") { + testExecuteStatementWithProtocolVersion( + version, "SELECT INTERVAL '1 10:11:12' DAY TO SECOND AS dt") { rs => + assert(rs.next()) + assert(rs.getObject(1) === new HiveIntervalDayTime(1, 10, 11, 12, 0)) + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "dt") + assert(metaData.getColumnTypeName(1) === "interval_day_time") + assert(metaData.getColumnType(1) === java.sql.Types.OTHER) + } + } + + test(s"SPARK-35018: $version get year-month interval type") { + testExecuteStatementWithProtocolVersion( + version, "SELECT INTERVAL '1-1' YEAR TO MONTH AS ym") { rs => + assert(rs.next()) + assert(rs.getObject(1) === new HiveIntervalYearMonth(1, 1)) + val metaData = rs.getMetaData + assert(metaData.getColumnName(1) === "ym") + assert(metaData.getColumnTypeName(1) === "interval_year_month") + assert(metaData.getColumnType(1) === java.sql.Types.OTHER) + } + } } } diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala index 15cc3109da3f7..1d03c90cc812b 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerQueryTestSuite.scala @@ -23,28 +23,41 @@ import java.util.{Locale, MissingFormatArgumentException} import scala.util.control.NonFatal -import org.apache.commons.io.FileUtils import org.apache.commons.lang3.exception.ExceptionUtils import org.apache.spark.SparkException import org.apache.spark.sql.SQLQueryTestSuite import org.apache.spark.sql.catalyst.analysis.NoSuchTableException import org.apache.spark.sql.catalyst.util.fileToString -import org.apache.spark.sql.execution.HiveResult +import org.apache.spark.sql.execution.HiveResult.{getTimeFormatters, toHiveString, TimeFormatters} import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types._ +// scalastyle:off line.size.limit /** * Re-run all the tests in SQLQueryTestSuite via Thrift Server. * + * Each case is loaded from a file in "spark/sql/core/src/test/resources/sql-tests/inputs". + * Each case has a golden result file in "spark/sql/core/src/test/resources/sql-tests/results". + * * To run the entire test suite: * {{{ - * build/sbt "hive-thriftserver/test-only *ThriftServerQueryTestSuite" -Phive-thriftserver + * build/sbt -Phive-thriftserver "hive-thriftserver/testOnly *ThriftServerQueryTestSuite" + * }}} + * + * To run a single test file upon change: + * {{{ + * build/sbt -Phive-thriftserver "hive-thriftserver/testOnly *ThriftServerQueryTestSuite -- -z inline-table.sql" * }}} * * This test suite won't generate golden files. To re-generate golden files for entire suite, run: * {{{ - * SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/test-only *SQLQueryTestSuite" + * SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/testOnly *SQLQueryTestSuite" + * }}} + * + * To re-generate golden file for a single test, run: + * {{{ + * SPARK_GENERATE_GOLDEN_FILES=1 build/sbt "sql/testOnly *SQLQueryTestSuite -- -z describe.sql" * }}} * * TODO: @@ -52,19 +65,18 @@ import org.apache.spark.sql.types._ * 2. Support DESC command. * 3. Support SHOW command. */ +// scalastyle:on line.size.limit class ThriftServerQueryTestSuite extends SQLQueryTestSuite with SharedThriftServer { + + override def mode: ServerMode.Value = ServerMode.binary + override protected def testFile(fileName: String): String = { - val url = Thread.currentThread().getContextClassLoader.getResource(fileName) - // Copy to avoid URISyntaxException during accessing the resources in `sql/core` - val file = File.createTempFile("thriftserver-test", ".data") - file.deleteOnExit() - FileUtils.copyURLToFile(url, file) - file.getAbsolutePath + copyAndGetResourceFile(fileName, ".data").getAbsolutePath } /** List of test cases to ignore, in lower cases. */ - override def blackList: Set[String] = super.blackList ++ Set( + override def ignoreList: Set[String] = super.ignoreList ++ Set( // Missing UDF "postgreSQL/boolean.sql", "postgreSQL/case.sql", @@ -95,7 +107,10 @@ class ThriftServerQueryTestSuite extends SQLQueryTestSuite with SharedThriftServ } testCase match { - case _: PgSQLTest | _: AnsiTest => + case _: PgSQLTest => + statement.execute(s"SET ${SQLConf.ANSI_ENABLED.key} = true") + statement.execute(s"SET ${SQLConf.LEGACY_INTERVAL_ENABLED.key} = true") + case _: AnsiTest => statement.execute(s"SET ${SQLConf.ANSI_ENABLED.key} = true") case _ => statement.execute(s"SET ${SQLConf.ANSI_ENABLED.key} = false") @@ -205,7 +220,7 @@ class ThriftServerQueryTestSuite extends SQLQueryTestSuite with SharedThriftServ } override def createScalaTestCase(testCase: TestCase): Unit = { - if (blackList.exists(t => + if (ignoreList.exists(t => testCase.name.toLowerCase(Locale.ROOT).contains(t.toLowerCase(Locale.ROOT)))) { // Create a test case to ignore this case. ignore(testCase.name) { /* Do nothing */ } @@ -257,8 +272,9 @@ class ThriftServerQueryTestSuite extends SQLQueryTestSuite with SharedThriftServ private def getNormalizedResult(statement: Statement, sql: String): (String, Seq[String]) = { val rs = statement.executeQuery(sql) val cols = rs.getMetaData.getColumnCount + val timeFormatters = getTimeFormatters val buildStr = () => (for (i <- 1 to cols) yield { - getHiveResult(rs.getObject(i)) + getHiveResult(rs.getObject(i), timeFormatters) }).mkString("\t") val answer = Iterator.continually(rs.next()).takeWhile(identity).map(_ => buildStr()).toSeq @@ -280,18 +296,18 @@ class ThriftServerQueryTestSuite extends SQLQueryTestSuite with SharedThriftServ upperCase.startsWith("(") } - private def getHiveResult(obj: Object): String = { + private def getHiveResult(obj: Object, timeFormatters: TimeFormatters): String = { obj match { case null => - HiveResult.toHiveString((null, StringType)) + toHiveString((null, StringType), false, timeFormatters) case d: java.sql.Date => - HiveResult.toHiveString((d, DateType)) + toHiveString((d, DateType), false, timeFormatters) case t: Timestamp => - HiveResult.toHiveString((t, TimestampType)) + toHiveString((t, TimestampType), false, timeFormatters) case d: java.math.BigDecimal => - HiveResult.toHiveString((d, DecimalType.fromDecimal(Decimal(d)))) + toHiveString((d, DecimalType.fromDecimal(Decimal(d))), false, timeFormatters) case bin: Array[Byte] => - HiveResult.toHiveString((bin, BinaryType)) + toHiveString((bin, BinaryType), false, timeFormatters) case other => other.toString } diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerWithSparkContextSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerWithSparkContextSuite.scala index 3e1fce78ae71c..3598f966b6259 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerWithSparkContextSuite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ThriftServerWithSparkContextSuite.scala @@ -17,7 +17,20 @@ package org.apache.spark.sql.hive.thriftserver -class ThriftServerWithSparkContextSuite extends SharedThriftServer { +import java.sql.SQLException +import java.util.concurrent.atomic.AtomicBoolean + +import org.apache.hive.service.cli.HiveSQLException + +import org.apache.spark.TaskKilled +import org.apache.spark.scheduler.{SparkListener, SparkListenerTaskEnd} +import org.apache.spark.sql.internal.SQLConf + +trait ThriftServerWithSparkContextSuite extends SharedThriftServer { + + test("the scratch dir will be deleted during server start but recreated with new operation") { + assert(tempScratchDir.exists()) + } test("SPARK-29911: Uncache cached tables when session closed") { val cacheManager = spark.sharedState.cacheManager @@ -41,4 +54,76 @@ class ThriftServerWithSparkContextSuite extends SharedThriftServer { assert(cacheManager.isEmpty) } } + + test("Full stack traces as error message for jdbc or thrift client") { + val sql = "select date_sub(date'2011-11-11', '1.2')" + withCLIServiceClient { client => + val sessionHandle = client.openSession(user, "") + + val confOverlay = new java.util.HashMap[java.lang.String, java.lang.String] + val e = intercept[HiveSQLException] { + client.executeStatement( + sessionHandle, + sql, + confOverlay) + } + + assert(e.getMessage + .contains("The second argument of 'date_sub' function needs to be an integer.")) + assert(!e.getMessage.contains("" + + "java.lang.NumberFormatException: invalid input syntax for type numeric: 1.2")) + } + + withJdbcStatement { statement => + val e = intercept[SQLException] { + statement.executeQuery(sql) + } + assert(e.getMessage + .contains("The second argument of 'date_sub' function needs to be an integer.")) + assert(e.getMessage.contains("" + + "java.lang.NumberFormatException: invalid input syntax for type numeric: 1.2")) + } + } + + test("SPARK-33526: Add config to control if cancel invoke interrupt task on thriftserver") { + withJdbcStatement { statement => + val forceCancel = new AtomicBoolean(false) + val listener = new SparkListener { + override def onTaskEnd(taskEnd: SparkListenerTaskEnd): Unit = { + assert(taskEnd.reason.isInstanceOf[TaskKilled]) + if (forceCancel.get()) { + assert(System.currentTimeMillis() - taskEnd.taskInfo.launchTime < 1000) + } else { + // avoid accuracy, we check 2s instead of 3s. + assert(System.currentTimeMillis() - taskEnd.taskInfo.launchTime >= 2000) + } + } + } + + spark.sparkContext.addSparkListener(listener) + try { + Seq(true, false).foreach { force => + statement.setQueryTimeout(0) + statement.execute(s"SET ${SQLConf.THRIFTSERVER_FORCE_CANCEL.key}=$force") + statement.setQueryTimeout(1) + forceCancel.set(force) + val e = intercept[SQLException] { + statement.execute("select java_method('java.lang.Thread', 'sleep', 3000L)") + }.getMessage + assert(e.contains("Query timed out")) + } + } finally { + spark.sparkContext.removeSparkListener(listener) + } + } + } +} + + +class ThriftServerWithSparkContextInBinarySuite extends ThriftServerWithSparkContextSuite { + override def mode: ServerMode.Value = ServerMode.binary +} + +class ThriftServerWithSparkContextInHttpSuite extends ThriftServerWithSparkContextSuite { + override def mode: ServerMode.Value = ServerMode.http } diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/UISeleniumSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/UISeleniumSuite.scala index 7f731f3d05e51..2d0edb8eb8d48 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/UISeleniumSuite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/UISeleniumSuite.scala @@ -22,15 +22,17 @@ import scala.util.Random import org.apache.hadoop.hive.conf.HiveConf.ConfVars import org.openqa.selenium.WebDriver import org.openqa.selenium.htmlunit.HtmlUnitDriver -import org.scalatest.{BeforeAndAfterAll, Matchers} +import org.scalatest.BeforeAndAfterAll import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.scalatest.time.SpanSugar._ import org.scalatestplus.selenium.WebBrowser import org.apache.spark.ui.SparkUICssErrorHandler class UISeleniumSuite - extends HiveThriftJdbcTest + extends HiveThriftServer2TestBase with WebBrowser with Matchers with BeforeAndAfterAll { implicit var webDriver: WebDriver = _ @@ -55,7 +57,7 @@ class UISeleniumSuite } } - override protected def serverStartCommand(port: Int) = { + override protected def serverStartCommand(): Seq[String] = { val portConf = if (mode == ServerMode.binary) { ConfVars.HIVE_SERVER2_THRIFT_PORT } else { @@ -69,7 +71,7 @@ class UISeleniumSuite | --hiveconf ${ConfVars.METASTOREWAREHOUSE}=$warehousePath | --hiveconf ${ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST}=localhost | --hiveconf ${ConfVars.HIVE_SERVER2_TRANSPORT_MODE}=$mode - | --hiveconf $portConf=$port + | --hiveconf $portConf=0 | --driver-class-path ${sys.props("java.class.path")} | --conf spark.ui.enabled=true | --conf spark.ui.port=$uiPort diff --git a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2ListenerSuite.scala b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2ListenerSuite.scala index 075032fa5d099..3f0538dd1c943 100644 --- a/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2ListenerSuite.scala +++ b/sql/hive-thriftserver/src/test/scala/org/apache/spark/sql/hive/thriftserver/ui/HiveThriftServer2ListenerSuite.scala @@ -140,6 +140,24 @@ class HiveThriftServer2ListenerSuite extends SparkFunSuite with BeforeAndAfter { assert(listener.noLiveData()) } + test("SPARK-31387 - listener update methods should not throw exception with unknown input") { + val (statusStore: HiveThriftServer2AppStatusStore, listener: HiveThriftServer2Listener) = + createAppStatusStore(true) + + val unknownSession = "unknown_session" + val unknownOperation = "unknown_operation" + listener.onOtherEvent(SparkListenerThriftServerSessionClosed(unknownSession, 0)) + listener.onOtherEvent(SparkListenerThriftServerOperationStart("id", unknownSession, + "stmt", "groupId", 0)) + listener.onOtherEvent(SparkListenerThriftServerOperationParsed(unknownOperation, "query")) + listener.onOtherEvent(SparkListenerThriftServerOperationCanceled(unknownOperation, 0)) + listener.onOtherEvent(SparkListenerThriftServerOperationTimeout(unknownOperation, 0)) + listener.onOtherEvent(SparkListenerThriftServerOperationError(unknownOperation, + "msg", "trace", 0)) + listener.onOtherEvent(SparkListenerThriftServerOperationFinish(unknownOperation, 0)) + listener.onOtherEvent(SparkListenerThriftServerOperationClosed(unknownOperation, 0)) + } + private def createProperties: Properties = { val properties = new Properties() properties.setProperty(SparkContext.SPARK_JOB_GROUP_ID, "groupId") diff --git a/sql/hive-thriftserver/v1.2/if/TCLIService.thrift b/sql/hive-thriftserver/v1.2/if/TCLIService.thrift deleted file mode 100644 index 225e319737811..0000000000000 --- a/sql/hive-thriftserver/v1.2/if/TCLIService.thrift +++ /dev/null @@ -1,1173 +0,0 @@ -// 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. - -// Coding Conventions for this file: -// -// Structs/Enums/Unions -// * Struct, Enum, and Union names begin with a "T", -// and use a capital letter for each new word, with no underscores. -// * All fields should be declared as either optional or required. -// -// Functions -// * Function names start with a capital letter and have a capital letter for -// each new word, with no underscores. -// * Each function should take exactly one parameter, named TFunctionNameReq, -// and should return either void or TFunctionNameResp. This convention allows -// incremental updates. -// -// Services -// * Service names begin with the letter "T", use a capital letter for each -// new word (with no underscores), and end with the word "Service". - -namespace java org.apache.hive.service.cli.thrift -namespace cpp apache.hive.service.cli.thrift - -// List of protocol versions. A new token should be -// added to the end of this list every time a change is made. -enum TProtocolVersion { - HIVE_CLI_SERVICE_PROTOCOL_V1, - - // V2 adds support for asynchronous execution - HIVE_CLI_SERVICE_PROTOCOL_V2 - - // V3 add varchar type, primitive type qualifiers - HIVE_CLI_SERVICE_PROTOCOL_V3 - - // V4 add decimal precision/scale, char type - HIVE_CLI_SERVICE_PROTOCOL_V4 - - // V5 adds error details when GetOperationStatus returns in error state - HIVE_CLI_SERVICE_PROTOCOL_V5 - - // V6 uses binary type for binary payload (was string) and uses columnar result set - HIVE_CLI_SERVICE_PROTOCOL_V6 - - // V7 adds support for delegation token based connection - HIVE_CLI_SERVICE_PROTOCOL_V7 - - // V8 adds support for interval types - HIVE_CLI_SERVICE_PROTOCOL_V8 -} - -enum TTypeId { - BOOLEAN_TYPE, - TINYINT_TYPE, - SMALLINT_TYPE, - INT_TYPE, - BIGINT_TYPE, - FLOAT_TYPE, - DOUBLE_TYPE, - STRING_TYPE, - TIMESTAMP_TYPE, - BINARY_TYPE, - ARRAY_TYPE, - MAP_TYPE, - STRUCT_TYPE, - UNION_TYPE, - USER_DEFINED_TYPE, - DECIMAL_TYPE, - NULL_TYPE, - DATE_TYPE, - VARCHAR_TYPE, - CHAR_TYPE, - INTERVAL_YEAR_MONTH_TYPE, - INTERVAL_DAY_TIME_TYPE -} - -const set PRIMITIVE_TYPES = [ - TTypeId.BOOLEAN_TYPE, - TTypeId.TINYINT_TYPE, - TTypeId.SMALLINT_TYPE, - TTypeId.INT_TYPE, - TTypeId.BIGINT_TYPE, - TTypeId.FLOAT_TYPE, - TTypeId.DOUBLE_TYPE, - TTypeId.STRING_TYPE, - TTypeId.TIMESTAMP_TYPE, - TTypeId.BINARY_TYPE, - TTypeId.DECIMAL_TYPE, - TTypeId.NULL_TYPE, - TTypeId.DATE_TYPE, - TTypeId.VARCHAR_TYPE, - TTypeId.CHAR_TYPE, - TTypeId.INTERVAL_YEAR_MONTH_TYPE, - TTypeId.INTERVAL_DAY_TIME_TYPE -] - -const set COMPLEX_TYPES = [ - TTypeId.ARRAY_TYPE - TTypeId.MAP_TYPE - TTypeId.STRUCT_TYPE - TTypeId.UNION_TYPE - TTypeId.USER_DEFINED_TYPE -] - -const set COLLECTION_TYPES = [ - TTypeId.ARRAY_TYPE - TTypeId.MAP_TYPE -] - -const map TYPE_NAMES = { - TTypeId.BOOLEAN_TYPE: "BOOLEAN", - TTypeId.TINYINT_TYPE: "TINYINT", - TTypeId.SMALLINT_TYPE: "SMALLINT", - TTypeId.INT_TYPE: "INT", - TTypeId.BIGINT_TYPE: "BIGINT", - TTypeId.FLOAT_TYPE: "FLOAT", - TTypeId.DOUBLE_TYPE: "DOUBLE", - TTypeId.STRING_TYPE: "STRING", - TTypeId.TIMESTAMP_TYPE: "TIMESTAMP", - TTypeId.BINARY_TYPE: "BINARY", - TTypeId.ARRAY_TYPE: "ARRAY", - TTypeId.MAP_TYPE: "MAP", - TTypeId.STRUCT_TYPE: "STRUCT", - TTypeId.UNION_TYPE: "UNIONTYPE", - TTypeId.DECIMAL_TYPE: "DECIMAL", - TTypeId.NULL_TYPE: "NULL" - TTypeId.DATE_TYPE: "DATE" - TTypeId.VARCHAR_TYPE: "VARCHAR" - TTypeId.CHAR_TYPE: "CHAR" - TTypeId.INTERVAL_YEAR_MONTH_TYPE: "INTERVAL_YEAR_MONTH" - TTypeId.INTERVAL_DAY_TIME_TYPE: "INTERVAL_DAY_TIME" -} - -// Thrift does not support recursively defined types or forward declarations, -// which makes it difficult to represent Hive's nested types. -// To get around these limitations TTypeDesc employs a type list that maps -// integer "pointers" to TTypeEntry objects. The following examples show -// how different types are represented using this scheme: -// -// "INT": -// TTypeDesc { -// types = [ -// TTypeEntry.primitive_entry { -// type = INT_TYPE -// } -// ] -// } -// -// "ARRAY": -// TTypeDesc { -// types = [ -// TTypeEntry.array_entry { -// object_type_ptr = 1 -// }, -// TTypeEntry.primitive_entry { -// type = INT_TYPE -// } -// ] -// } -// -// "MAP": -// TTypeDesc { -// types = [ -// TTypeEntry.map_entry { -// key_type_ptr = 1 -// value_type_ptr = 2 -// }, -// TTypeEntry.primitive_entry { -// type = INT_TYPE -// }, -// TTypeEntry.primitive_entry { -// type = STRING_TYPE -// } -// ] -// } - -typedef i32 TTypeEntryPtr - -// Valid TTypeQualifiers key names -const string CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength" - -// Type qualifier key name for decimal -const string PRECISION = "precision" -const string SCALE = "scale" - -union TTypeQualifierValue { - 1: optional i32 i32Value - 2: optional string stringValue -} - -// Type qualifiers for primitive type. -struct TTypeQualifiers { - 1: required map qualifiers -} - -// Type entry for a primitive type. -struct TPrimitiveTypeEntry { - // The primitive type token. This must satisfy the condition - // that type is in the PRIMITIVE_TYPES set. - 1: required TTypeId type - 2: optional TTypeQualifiers typeQualifiers -} - -// Type entry for an ARRAY type. -struct TArrayTypeEntry { - 1: required TTypeEntryPtr objectTypePtr -} - -// Type entry for a MAP type. -struct TMapTypeEntry { - 1: required TTypeEntryPtr keyTypePtr - 2: required TTypeEntryPtr valueTypePtr -} - -// Type entry for a STRUCT type. -struct TStructTypeEntry { - 1: required map nameToTypePtr -} - -// Type entry for a UNIONTYPE type. -struct TUnionTypeEntry { - 1: required map nameToTypePtr -} - -struct TUserDefinedTypeEntry { - // The fully qualified name of the class implementing this type. - 1: required string typeClassName -} - -// We use a union here since Thrift does not support inheritance. -union TTypeEntry { - 1: TPrimitiveTypeEntry primitiveEntry - 2: TArrayTypeEntry arrayEntry - 3: TMapTypeEntry mapEntry - 4: TStructTypeEntry structEntry - 5: TUnionTypeEntry unionEntry - 6: TUserDefinedTypeEntry userDefinedTypeEntry -} - -// Type descriptor for columns. -struct TTypeDesc { - // The "top" type is always the first element of the list. - // If the top type is an ARRAY, MAP, STRUCT, or UNIONTYPE - // type, then subsequent elements represent nested types. - 1: required list types -} - -// A result set column descriptor. -struct TColumnDesc { - // The name of the column - 1: required string columnName - - // The type descriptor for this column - 2: required TTypeDesc typeDesc - - // The ordinal position of this column in the schema - 3: required i32 position - - 4: optional string comment -} - -// Metadata used to describe the schema (column names, types, comments) -// of result sets. -struct TTableSchema { - 1: required list columns -} - -// A Boolean column value. -struct TBoolValue { - // NULL if value is unset. - 1: optional bool value -} - -// A Byte column value. -struct TByteValue { - // NULL if value is unset. - 1: optional byte value -} - -// A signed, 16 bit column value. -struct TI16Value { - // NULL if value is unset - 1: optional i16 value -} - -// A signed, 32 bit column value -struct TI32Value { - // NULL if value is unset - 1: optional i32 value -} - -// A signed 64 bit column value -struct TI64Value { - // NULL if value is unset - 1: optional i64 value -} - -// A floating point 64 bit column value -struct TDoubleValue { - // NULL if value is unset - 1: optional double value -} - -struct TStringValue { - // NULL if value is unset - 1: optional string value -} - -// A single column value in a result set. -// Note that Hive's type system is richer than Thrift's, -// so in some cases we have to map multiple Hive types -// to the same Thrift type. On the client-side this is -// disambiguated by looking at the Schema of the -// result set. -union TColumnValue { - 1: TBoolValue boolVal // BOOLEAN - 2: TByteValue byteVal // TINYINT - 3: TI16Value i16Val // SMALLINT - 4: TI32Value i32Val // INT - 5: TI64Value i64Val // BIGINT, TIMESTAMP - 6: TDoubleValue doubleVal // FLOAT, DOUBLE - 7: TStringValue stringVal // STRING, LIST, MAP, STRUCT, UNIONTYPE, BINARY, DECIMAL, NULL, INTERVAL_YEAR_MONTH, INTERVAL_DAY_TIME -} - -// Represents a row in a rowset. -struct TRow { - 1: required list colVals -} - -struct TBoolColumn { - 1: required list values - 2: required binary nulls -} - -struct TByteColumn { - 1: required list values - 2: required binary nulls -} - -struct TI16Column { - 1: required list values - 2: required binary nulls -} - -struct TI32Column { - 1: required list values - 2: required binary nulls -} - -struct TI64Column { - 1: required list values - 2: required binary nulls -} - -struct TDoubleColumn { - 1: required list values - 2: required binary nulls -} - -struct TStringColumn { - 1: required list values - 2: required binary nulls -} - -struct TBinaryColumn { - 1: required list values - 2: required binary nulls -} - -// Note that Hive's type system is richer than Thrift's, -// so in some cases we have to map multiple Hive types -// to the same Thrift type. On the client-side this is -// disambiguated by looking at the Schema of the -// result set. -union TColumn { - 1: TBoolColumn boolVal // BOOLEAN - 2: TByteColumn byteVal // TINYINT - 3: TI16Column i16Val // SMALLINT - 4: TI32Column i32Val // INT - 5: TI64Column i64Val // BIGINT, TIMESTAMP - 6: TDoubleColumn doubleVal // FLOAT, DOUBLE - 7: TStringColumn stringVal // STRING, LIST, MAP, STRUCT, UNIONTYPE, DECIMAL, NULL - 8: TBinaryColumn binaryVal // BINARY -} - -// Represents a rowset -struct TRowSet { - // The starting row offset of this rowset. - 1: required i64 startRowOffset - 2: required list rows - 3: optional list columns -} - -// The return status code contained in each response. -enum TStatusCode { - SUCCESS_STATUS, - SUCCESS_WITH_INFO_STATUS, - STILL_EXECUTING_STATUS, - ERROR_STATUS, - INVALID_HANDLE_STATUS -} - -// The return status of a remote request -struct TStatus { - 1: required TStatusCode statusCode - - // If status is SUCCESS_WITH_INFO, info_msgs may be populated with - // additional diagnostic information. - 2: optional list infoMessages - - // If status is ERROR, then the following fields may be set - 3: optional string sqlState // as defined in the ISO/IEF CLI specification - 4: optional i32 errorCode // internal error code - 5: optional string errorMessage -} - -// The state of an operation (i.e. a query or other -// asynchronous operation that generates a result set) -// on the server. -enum TOperationState { - // The operation has been initialized - INITIALIZED_STATE, - - // The operation is running. In this state the result - // set is not available. - RUNNING_STATE, - - // The operation has completed. When an operation is in - // this state its result set may be fetched. - FINISHED_STATE, - - // The operation was canceled by a client - CANCELED_STATE, - - // The operation was closed by a client - CLOSED_STATE, - - // The operation failed due to an error - ERROR_STATE, - - // The operation is in an unrecognized state - UKNOWN_STATE, - - // The operation is in an pending state - PENDING_STATE, -} - -// A string identifier. This is interpreted literally. -typedef string TIdentifier - -// A search pattern. -// -// Valid search pattern characters: -// '_': Any single character. -// '%': Any sequence of zero or more characters. -// '\': Escape character used to include special characters, -// e.g. '_', '%', '\'. If a '\' precedes a non-special -// character it has no special meaning and is interpreted -// literally. -typedef string TPattern - - -// A search pattern or identifier. Used as input -// parameter for many of the catalog functions. -typedef string TPatternOrIdentifier - -struct THandleIdentifier { - // 16 byte globally unique identifier - // This is the public ID of the handle and - // can be used for reporting. - 1: required binary guid, - - // 16 byte secret generated by the server - // and used to verify that the handle is not - // being hijacked by another user. - 2: required binary secret, -} - -// Client-side handle to persistent -// session information on the server-side. -struct TSessionHandle { - 1: required THandleIdentifier sessionId -} - -// The subtype of an OperationHandle. -enum TOperationType { - EXECUTE_STATEMENT, - GET_TYPE_INFO, - GET_CATALOGS, - GET_SCHEMAS, - GET_TABLES, - GET_TABLE_TYPES, - GET_COLUMNS, - GET_FUNCTIONS, - UNKNOWN, -} - -// Client-side reference to a task running -// asynchronously on the server. -struct TOperationHandle { - 1: required THandleIdentifier operationId - 2: required TOperationType operationType - - // If hasResultSet = TRUE, then this operation - // generates a result set that can be fetched. - // Note that the result set may be empty. - // - // If hasResultSet = FALSE, then this operation - // does not generate a result set, and calling - // GetResultSetMetadata or FetchResults against - // this OperationHandle will generate an error. - 3: required bool hasResultSet - - // For operations that don't generate result sets, - // modifiedRowCount is either: - // - // 1) The number of rows that were modified by - // the DML operation (e.g. number of rows inserted, - // number of rows deleted, etc). - // - // 2) 0 for operations that don't modify or add rows. - // - // 3) < 0 if the operation is capable of modifiying rows, - // but Hive is unable to determine how many rows were - // modified. For example, Hive's LOAD DATA command - // doesn't generate row count information because - // Hive doesn't inspect the data as it is loaded. - // - // modifiedRowCount is unset if the operation generates - // a result set. - 4: optional double modifiedRowCount -} - - -// OpenSession() -// -// Open a session (connection) on the server against -// which operations may be executed. -struct TOpenSessionReq { - // The version of the HiveServer2 protocol that the client is using. - 1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8 - - // Username and password for authentication. - // Depending on the authentication scheme being used, - // this information may instead be provided by a lower - // protocol layer, in which case these fields may be - // left unset. - 2: optional string username - 3: optional string password - - // Configuration overlay which is applied when the session is - // first created. - 4: optional map configuration -} - -struct TOpenSessionResp { - 1: required TStatus status - - // The protocol version that the server is using. - 2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8 - - // Session Handle - 3: optional TSessionHandle sessionHandle - - // The configuration settings for this session. - 4: optional map configuration -} - - -// CloseSession() -// -// Closes the specified session and frees any resources -// currently allocated to that session. Any open -// operations in that session will be canceled. -struct TCloseSessionReq { - 1: required TSessionHandle sessionHandle -} - -struct TCloseSessionResp { - 1: required TStatus status -} - - - -enum TGetInfoType { - CLI_MAX_DRIVER_CONNECTIONS = 0, - CLI_MAX_CONCURRENT_ACTIVITIES = 1, - CLI_DATA_SOURCE_NAME = 2, - CLI_FETCH_DIRECTION = 8, - CLI_SERVER_NAME = 13, - CLI_SEARCH_PATTERN_ESCAPE = 14, - CLI_DBMS_NAME = 17, - CLI_DBMS_VER = 18, - CLI_ACCESSIBLE_TABLES = 19, - CLI_ACCESSIBLE_PROCEDURES = 20, - CLI_CURSOR_COMMIT_BEHAVIOR = 23, - CLI_DATA_SOURCE_READ_ONLY = 25, - CLI_DEFAULT_TXN_ISOLATION = 26, - CLI_IDENTIFIER_CASE = 28, - CLI_IDENTIFIER_QUOTE_CHAR = 29, - CLI_MAX_COLUMN_NAME_LEN = 30, - CLI_MAX_CURSOR_NAME_LEN = 31, - CLI_MAX_SCHEMA_NAME_LEN = 32, - CLI_MAX_CATALOG_NAME_LEN = 34, - CLI_MAX_TABLE_NAME_LEN = 35, - CLI_SCROLL_CONCURRENCY = 43, - CLI_TXN_CAPABLE = 46, - CLI_USER_NAME = 47, - CLI_TXN_ISOLATION_OPTION = 72, - CLI_INTEGRITY = 73, - CLI_GETDATA_EXTENSIONS = 81, - CLI_NULL_COLLATION = 85, - CLI_ALTER_TABLE = 86, - CLI_ORDER_BY_COLUMNS_IN_SELECT = 90, - CLI_SPECIAL_CHARACTERS = 94, - CLI_MAX_COLUMNS_IN_GROUP_BY = 97, - CLI_MAX_COLUMNS_IN_INDEX = 98, - CLI_MAX_COLUMNS_IN_ORDER_BY = 99, - CLI_MAX_COLUMNS_IN_SELECT = 100, - CLI_MAX_COLUMNS_IN_TABLE = 101, - CLI_MAX_INDEX_SIZE = 102, - CLI_MAX_ROW_SIZE = 104, - CLI_MAX_STATEMENT_LEN = 105, - CLI_MAX_TABLES_IN_SELECT = 106, - CLI_MAX_USER_NAME_LEN = 107, - CLI_OJ_CAPABILITIES = 115, - - CLI_XOPEN_CLI_YEAR = 10000, - CLI_CURSOR_SENSITIVITY = 10001, - CLI_DESCRIBE_PARAMETER = 10002, - CLI_CATALOG_NAME = 10003, - CLI_COLLATION_SEQ = 10004, - CLI_MAX_IDENTIFIER_LEN = 10005, -} - -union TGetInfoValue { - 1: string stringValue - 2: i16 smallIntValue - 3: i32 integerBitmask - 4: i32 integerFlag - 5: i32 binaryValue - 6: i64 lenValue -} - -// GetInfo() -// -// This function is based on ODBC's CLIGetInfo() function. -// The function returns general information about the data source -// using the same keys as ODBC. -struct TGetInfoReq { - // The session to run this request against - 1: required TSessionHandle sessionHandle - - 2: required TGetInfoType infoType -} - -struct TGetInfoResp { - 1: required TStatus status - - 2: required TGetInfoValue infoValue -} - - -// ExecuteStatement() -// -// Execute a statement. -// The returned OperationHandle can be used to check on the -// status of the statement, and to fetch results once the -// statement has finished executing. -struct TExecuteStatementReq { - // The session to execute the statement against - 1: required TSessionHandle sessionHandle - - // The statement to be executed (DML, DDL, SET, etc) - 2: required string statement - - // Configuration properties that are overlayed on top of the - // the existing session configuration before this statement - // is executed. These properties apply to this statement - // only and will not affect the subsequent state of the Session. - 3: optional map confOverlay - - // Execute asynchronously when runAsync is true - 4: optional bool runAsync = false -} - -struct TExecuteStatementResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - -// GetTypeInfo() -// -// Get information about types supported by the HiveServer instance. -// The information is returned as a result set which can be fetched -// using the OperationHandle provided in the response. -// -// Refer to the documentation for ODBC's CLIGetTypeInfo function for -// the format of the result set. -struct TGetTypeInfoReq { - // The session to run this request against. - 1: required TSessionHandle sessionHandle -} - -struct TGetTypeInfoResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetCatalogs() -// -// Returns the list of catalogs (databases) -// Results are ordered by TABLE_CATALOG -// -// Resultset columns : -// col1 -// name: TABLE_CAT -// type: STRING -// desc: Catalog name. NULL if not applicable. -// -struct TGetCatalogsReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle -} - -struct TGetCatalogsResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetSchemas() -// -// Retrieves the schema names available in this database. -// The results are ordered by TABLE_CATALOG and TABLE_SCHEM. -// col1 -// name: TABLE_SCHEM -// type: STRING -// desc: schema name -// col2 -// name: TABLE_CATALOG -// type: STRING -// desc: catalog name -struct TGetSchemasReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle - - // Name of the catalog. Must not contain a search pattern. - 2: optional TIdentifier catalogName - - // schema name or pattern - 3: optional TPatternOrIdentifier schemaName -} - -struct TGetSchemasResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetTables() -// -// Returns a list of tables with catalog, schema, and table -// type information. The information is returned as a result -// set which can be fetched using the OperationHandle -// provided in the response. -// Results are ordered by TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, and TABLE_NAME -// -// Result Set Columns: -// -// col1 -// name: TABLE_CAT -// type: STRING -// desc: Catalog name. NULL if not applicable. -// -// col2 -// name: TABLE_SCHEM -// type: STRING -// desc: Schema name. -// -// col3 -// name: TABLE_NAME -// type: STRING -// desc: Table name. -// -// col4 -// name: TABLE_TYPE -// type: STRING -// desc: The table type, e.g. "TABLE", "VIEW", etc. -// -// col5 -// name: REMARKS -// type: STRING -// desc: Comments about the table -// -struct TGetTablesReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle - - // Name of the catalog or a search pattern. - 2: optional TPatternOrIdentifier catalogName - - // Name of the schema or a search pattern. - 3: optional TPatternOrIdentifier schemaName - - // Name of the table or a search pattern. - 4: optional TPatternOrIdentifier tableName - - // List of table types to match - // e.g. "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", - // "LOCAL TEMPORARY", "ALIAS", "SYNONYM", etc. - 5: optional list tableTypes -} - -struct TGetTablesResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetTableTypes() -// -// Returns the table types available in this database. -// The results are ordered by table type. -// -// col1 -// name: TABLE_TYPE -// type: STRING -// desc: Table type name. -struct TGetTableTypesReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle -} - -struct TGetTableTypesResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetColumns() -// -// Returns a list of columns in the specified tables. -// The information is returned as a result set which can be fetched -// using the OperationHandle provided in the response. -// Results are ordered by TABLE_CAT, TABLE_SCHEM, TABLE_NAME, -// and ORDINAL_POSITION. -// -// Result Set Columns are the same as those for the ODBC CLIColumns -// function. -// -struct TGetColumnsReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle - - // Name of the catalog. Must not contain a search pattern. - 2: optional TIdentifier catalogName - - // Schema name or search pattern - 3: optional TPatternOrIdentifier schemaName - - // Table name or search pattern - 4: optional TPatternOrIdentifier tableName - - // Column name or search pattern - 5: optional TPatternOrIdentifier columnName -} - -struct TGetColumnsResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetFunctions() -// -// Returns a list of functions supported by the data source. The -// behavior of this function matches -// java.sql.DatabaseMetaData.getFunctions() both in terms of -// inputs and outputs. -// -// Result Set Columns: -// -// col1 -// name: FUNCTION_CAT -// type: STRING -// desc: Function catalog (may be null) -// -// col2 -// name: FUNCTION_SCHEM -// type: STRING -// desc: Function schema (may be null) -// -// col3 -// name: FUNCTION_NAME -// type: STRING -// desc: Function name. This is the name used to invoke the function. -// -// col4 -// name: REMARKS -// type: STRING -// desc: Explanatory comment on the function. -// -// col5 -// name: FUNCTION_TYPE -// type: SMALLINT -// desc: Kind of function. One of: -// * functionResultUnknown - Cannot determine if a return value or a table -// will be returned. -// * functionNoTable - Does not a return a table. -// * functionReturnsTable - Returns a table. -// -// col6 -// name: SPECIFIC_NAME -// type: STRING -// desc: The name which uniquely identifies this function within its schema. -// In this case this is the fully qualified class name of the class -// that implements this function. -// -struct TGetFunctionsReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle - - // A catalog name; must match the catalog name as it is stored in the - // database; "" retrieves those without a catalog; null means - // that the catalog name should not be used to narrow the search. - 2: optional TIdentifier catalogName - - // A schema name pattern; must match the schema name as it is stored - // in the database; "" retrieves those without a schema; null means - // that the schema name should not be used to narrow the search. - 3: optional TPatternOrIdentifier schemaName - - // A function name pattern; must match the function name as it is stored - // in the database. - 4: required TPatternOrIdentifier functionName -} - -struct TGetFunctionsResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetOperationStatus() -// -// Get the status of an operation running on the server. -struct TGetOperationStatusReq { - // Session to run this request against - 1: required TOperationHandle operationHandle -} - -struct TGetOperationStatusResp { - 1: required TStatus status - 2: optional TOperationState operationState - - // If operationState is ERROR_STATE, then the following fields may be set - // sqlState as defined in the ISO/IEF CLI specification - 3: optional string sqlState - - // Internal error code - 4: optional i32 errorCode - - // Error message - 5: optional string errorMessage -} - - -// CancelOperation() -// -// Cancels processing on the specified operation handle and -// frees any resources which were allocated. -struct TCancelOperationReq { - // Operation to cancel - 1: required TOperationHandle operationHandle -} - -struct TCancelOperationResp { - 1: required TStatus status -} - - -// CloseOperation() -// -// Given an operation in the FINISHED, CANCELED, -// or ERROR states, CloseOperation() will free -// all of the resources which were allocated on -// the server to service the operation. -struct TCloseOperationReq { - 1: required TOperationHandle operationHandle -} - -struct TCloseOperationResp { - 1: required TStatus status -} - - -// GetResultSetMetadata() -// -// Retrieves schema information for the specified operation -struct TGetResultSetMetadataReq { - // Operation for which to fetch result set schema information - 1: required TOperationHandle operationHandle -} - -struct TGetResultSetMetadataResp { - 1: required TStatus status - 2: optional TTableSchema schema -} - - -enum TFetchOrientation { - // Get the next rowset. The fetch offset is ignored. - FETCH_NEXT, - - // Get the previous rowset. The fetch offset is ignored. - FETCH_PRIOR, - - // Return the rowset at the given fetch offset relative - // to the current rowset. - // NOT SUPPORTED - FETCH_RELATIVE, - - // Return the rowset at the specified fetch offset. - // NOT SUPPORTED - FETCH_ABSOLUTE, - - // Get the first rowset in the result set. - FETCH_FIRST, - - // Get the last rowset in the result set. - // NOT SUPPORTED - FETCH_LAST -} - -// FetchResults() -// -// Fetch rows from the server corresponding to -// a particular OperationHandle. -struct TFetchResultsReq { - // Operation from which to fetch results. - 1: required TOperationHandle operationHandle - - // The fetch orientation. This must be either - // FETCH_NEXT, FETCH_PRIOR or FETCH_FIRST. Defaults to FETCH_NEXT. - 2: required TFetchOrientation orientation = TFetchOrientation.FETCH_NEXT - - // Max number of rows that should be returned in - // the rowset. - 3: required i64 maxRows - - // The type of a fetch results request. 0 represents Query output. 1 represents Log - 4: optional i16 fetchType = 0 -} - -struct TFetchResultsResp { - 1: required TStatus status - - // TRUE if there are more rows left to fetch from the server. - 2: optional bool hasMoreRows - - // The rowset. This is optional so that we have the - // option in the future of adding alternate formats for - // representing result set data, e.g. delimited strings, - // binary encoded, etc. - 3: optional TRowSet results -} - -// GetDelegationToken() -// Retrieve delegation token for the current user -struct TGetDelegationTokenReq { - // session handle - 1: required TSessionHandle sessionHandle - - // userid for the proxy user - 2: required string owner - - // designated renewer userid - 3: required string renewer -} - -struct TGetDelegationTokenResp { - // status of the request - 1: required TStatus status - - // delegation token string - 2: optional string delegationToken -} - -// CancelDelegationToken() -// Cancel the given delegation token -struct TCancelDelegationTokenReq { - // session handle - 1: required TSessionHandle sessionHandle - - // delegation token to cancel - 2: required string delegationToken -} - -struct TCancelDelegationTokenResp { - // status of the request - 1: required TStatus status -} - -// RenewDelegationToken() -// Renew the given delegation token -struct TRenewDelegationTokenReq { - // session handle - 1: required TSessionHandle sessionHandle - - // delegation token to renew - 2: required string delegationToken -} - -struct TRenewDelegationTokenResp { - // status of the request - 1: required TStatus status -} - -service TCLIService { - - TOpenSessionResp OpenSession(1:TOpenSessionReq req); - - TCloseSessionResp CloseSession(1:TCloseSessionReq req); - - TGetInfoResp GetInfo(1:TGetInfoReq req); - - TExecuteStatementResp ExecuteStatement(1:TExecuteStatementReq req); - - TGetTypeInfoResp GetTypeInfo(1:TGetTypeInfoReq req); - - TGetCatalogsResp GetCatalogs(1:TGetCatalogsReq req); - - TGetSchemasResp GetSchemas(1:TGetSchemasReq req); - - TGetTablesResp GetTables(1:TGetTablesReq req); - - TGetTableTypesResp GetTableTypes(1:TGetTableTypesReq req); - - TGetColumnsResp GetColumns(1:TGetColumnsReq req); - - TGetFunctionsResp GetFunctions(1:TGetFunctionsReq req); - - TGetOperationStatusResp GetOperationStatus(1:TGetOperationStatusReq req); - - TCancelOperationResp CancelOperation(1:TCancelOperationReq req); - - TCloseOperationResp CloseOperation(1:TCloseOperationReq req); - - TGetResultSetMetadataResp GetResultSetMetadata(1:TGetResultSetMetadataReq req); - - TFetchResultsResp FetchResults(1:TFetchResultsReq req); - - TGetDelegationTokenResp GetDelegationToken(1:TGetDelegationTokenReq req); - - TCancelDelegationTokenResp CancelDelegationToken(1:TCancelDelegationTokenReq req); - - TRenewDelegationTokenResp RenewDelegationToken(1:TRenewDelegationTokenReq req); -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TArrayTypeEntry.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TArrayTypeEntry.java deleted file mode 100644 index 6323d34eac734..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TArrayTypeEntry.java +++ /dev/null @@ -1,383 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TArrayTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TArrayTypeEntry"); - - private static final org.apache.thrift.protocol.TField OBJECT_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("objectTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TArrayTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TArrayTypeEntryTupleSchemeFactory()); - } - - private int objectTypePtr; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OBJECT_TYPE_PTR((short)1, "objectTypePtr"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OBJECT_TYPE_PTR - return OBJECT_TYPE_PTR; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __OBJECTTYPEPTR_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OBJECT_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("objectTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TArrayTypeEntry.class, metaDataMap); - } - - public TArrayTypeEntry() { - } - - public TArrayTypeEntry( - int objectTypePtr) - { - this(); - this.objectTypePtr = objectTypePtr; - setObjectTypePtrIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TArrayTypeEntry(TArrayTypeEntry other) { - __isset_bitfield = other.__isset_bitfield; - this.objectTypePtr = other.objectTypePtr; - } - - public TArrayTypeEntry deepCopy() { - return new TArrayTypeEntry(this); - } - - @Override - public void clear() { - setObjectTypePtrIsSet(false); - this.objectTypePtr = 0; - } - - public int getObjectTypePtr() { - return this.objectTypePtr; - } - - public void setObjectTypePtr(int objectTypePtr) { - this.objectTypePtr = objectTypePtr; - setObjectTypePtrIsSet(true); - } - - public void unsetObjectTypePtr() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); - } - - /** Returns true if field objectTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetObjectTypePtr() { - return EncodingUtils.testBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); - } - - public void setObjectTypePtrIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OBJECT_TYPE_PTR: - if (value == null) { - unsetObjectTypePtr(); - } else { - setObjectTypePtr((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OBJECT_TYPE_PTR: - return Integer.valueOf(getObjectTypePtr()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OBJECT_TYPE_PTR: - return isSetObjectTypePtr(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TArrayTypeEntry) - return this.equals((TArrayTypeEntry)that); - return false; - } - - public boolean equals(TArrayTypeEntry that) { - if (that == null) - return false; - - boolean this_present_objectTypePtr = true; - boolean that_present_objectTypePtr = true; - if (this_present_objectTypePtr || that_present_objectTypePtr) { - if (!(this_present_objectTypePtr && that_present_objectTypePtr)) - return false; - if (this.objectTypePtr != that.objectTypePtr) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_objectTypePtr = true; - builder.append(present_objectTypePtr); - if (present_objectTypePtr) - builder.append(objectTypePtr); - - return builder.toHashCode(); - } - - public int compareTo(TArrayTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TArrayTypeEntry typedOther = (TArrayTypeEntry)other; - - lastComparison = Boolean.valueOf(isSetObjectTypePtr()).compareTo(typedOther.isSetObjectTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetObjectTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.objectTypePtr, typedOther.objectTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TArrayTypeEntry("); - boolean first = true; - - sb.append("objectTypePtr:"); - sb.append(this.objectTypePtr); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetObjectTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'objectTypePtr' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TArrayTypeEntryStandardSchemeFactory implements SchemeFactory { - public TArrayTypeEntryStandardScheme getScheme() { - return new TArrayTypeEntryStandardScheme(); - } - } - - private static class TArrayTypeEntryStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OBJECT_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.objectTypePtr = iprot.readI32(); - struct.setObjectTypePtrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(OBJECT_TYPE_PTR_FIELD_DESC); - oprot.writeI32(struct.objectTypePtr); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TArrayTypeEntryTupleSchemeFactory implements SchemeFactory { - public TArrayTypeEntryTupleScheme getScheme() { - return new TArrayTypeEntryTupleScheme(); - } - } - - private static class TArrayTypeEntryTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.objectTypePtr); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.objectTypePtr = iprot.readI32(); - struct.setObjectTypePtrIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TBinaryColumn.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TBinaryColumn.java deleted file mode 100644 index 6b1b054d1acad..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TBinaryColumn.java +++ /dev/null @@ -1,550 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TBinaryColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBinaryColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBinaryColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBinaryColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBinaryColumn.class, metaDataMap); - } - - public TBinaryColumn() { - } - - public TBinaryColumn( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = nulls; - } - - /** - * Performs a deep copy on other. - */ - public TBinaryColumn(TBinaryColumn other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(); - for (ByteBuffer other_element : other.values) { - ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element); -; - __this__values.add(temp_binary_element); - } - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); -; - } - } - - public TBinaryColumn deepCopy() { - return new TBinaryColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(ByteBuffer elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return nulls; - } - - public void setNulls(byte[] nulls) { - setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = nulls; - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBinaryColumn) - return this.equals((TBinaryColumn)that); - return false; - } - - public boolean equals(TBinaryColumn that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_values = true && (isSetValues()); - builder.append(present_values); - if (present_values) - builder.append(values); - - boolean present_nulls = true && (isSetNulls()); - builder.append(present_nulls); - if (present_nulls) - builder.append(nulls); - - return builder.toHashCode(); - } - - public int compareTo(TBinaryColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TBinaryColumn typedOther = (TBinaryColumn)other; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TBinaryColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TBinaryColumnStandardSchemeFactory implements SchemeFactory { - public TBinaryColumnStandardScheme getScheme() { - return new TBinaryColumnStandardScheme(); - } - } - - private static class TBinaryColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBinaryColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list110 = iprot.readListBegin(); - struct.values = new ArrayList(_list110.size); - for (int _i111 = 0; _i111 < _list110.size; ++_i111) - { - ByteBuffer _elem112; // optional - _elem112 = iprot.readBinary(); - struct.values.add(_elem112); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBinaryColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); - for (ByteBuffer _iter113 : struct.values) - { - oprot.writeBinary(_iter113); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBinaryColumnTupleSchemeFactory implements SchemeFactory { - public TBinaryColumnTupleScheme getScheme() { - return new TBinaryColumnTupleScheme(); - } - } - - private static class TBinaryColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (ByteBuffer _iter114 : struct.values) - { - oprot.writeBinary(_iter114); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list115 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.values = new ArrayList(_list115.size); - for (int _i116 = 0; _i116 < _list115.size; ++_i116) - { - ByteBuffer _elem117; // optional - _elem117 = iprot.readBinary(); - struct.values.add(_elem117); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TBoolColumn.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TBoolColumn.java deleted file mode 100644 index efd571cfdfbbf..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TBoolColumn.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TBoolColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBoolColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBoolColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolColumn.class, metaDataMap); - } - - public TBoolColumn() { - } - - public TBoolColumn( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = nulls; - } - - /** - * Performs a deep copy on other. - */ - public TBoolColumn(TBoolColumn other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(); - for (Boolean other_element : other.values) { - __this__values.add(other_element); - } - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); -; - } - } - - public TBoolColumn deepCopy() { - return new TBoolColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(boolean elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return nulls; - } - - public void setNulls(byte[] nulls) { - setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = nulls; - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBoolColumn) - return this.equals((TBoolColumn)that); - return false; - } - - public boolean equals(TBoolColumn that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_values = true && (isSetValues()); - builder.append(present_values); - if (present_values) - builder.append(values); - - boolean present_nulls = true && (isSetNulls()); - builder.append(present_nulls); - if (present_nulls) - builder.append(nulls); - - return builder.toHashCode(); - } - - public int compareTo(TBoolColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TBoolColumn typedOther = (TBoolColumn)other; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TBoolColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TBoolColumnStandardSchemeFactory implements SchemeFactory { - public TBoolColumnStandardScheme getScheme() { - return new TBoolColumnStandardScheme(); - } - } - - private static class TBoolColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list54 = iprot.readListBegin(); - struct.values = new ArrayList(_list54.size); - for (int _i55 = 0; _i55 < _list54.size; ++_i55) - { - boolean _elem56; // optional - _elem56 = iprot.readBool(); - struct.values.add(_elem56); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBoolColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, struct.values.size())); - for (boolean _iter57 : struct.values) - { - oprot.writeBool(_iter57); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBoolColumnTupleSchemeFactory implements SchemeFactory { - public TBoolColumnTupleScheme getScheme() { - return new TBoolColumnTupleScheme(); - } - } - - private static class TBoolColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (boolean _iter58 : struct.values) - { - oprot.writeBool(_iter58); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list59 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, iprot.readI32()); - struct.values = new ArrayList(_list59.size); - for (int _i60 = 0; _i60 < _list59.size; ++_i60) - { - boolean _elem61; // optional - _elem61 = iprot.readBool(); - struct.values.add(_elem61); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TBoolValue.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TBoolValue.java deleted file mode 100644 index c7495ee79e4b5..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TBoolValue.java +++ /dev/null @@ -1,386 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TBoolValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolValue"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BOOL, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBoolValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBoolValueTupleSchemeFactory()); - } - - private boolean value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolValue.class, metaDataMap); - } - - public TBoolValue() { - } - - /** - * Performs a deep copy on other. - */ - public TBoolValue(TBoolValue other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TBoolValue deepCopy() { - return new TBoolValue(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = false; - } - - public boolean isValue() { - return this.value; - } - - public void setValue(boolean value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return Boolean.valueOf(isValue()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBoolValue) - return this.equals((TBoolValue)that); - return false; - } - - public boolean equals(TBoolValue that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); - - return builder.toHashCode(); - } - - public int compareTo(TBoolValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TBoolValue typedOther = (TBoolValue)other; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TBoolValue("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TBoolValueStandardSchemeFactory implements SchemeFactory { - public TBoolValueStandardScheme getScheme() { - return new TBoolValueStandardScheme(); - } - } - - private static class TBoolValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.value = iprot.readBool(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBoolValue struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeBool(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBoolValueTupleSchemeFactory implements SchemeFactory { - public TBoolValueTupleScheme getScheme() { - return new TBoolValueTupleScheme(); - } - } - - private static class TBoolValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeBool(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readBool(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TByteColumn.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TByteColumn.java deleted file mode 100644 index 169bfdeab3eea..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TByteColumn.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TByteColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TByteColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TByteColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteColumn.class, metaDataMap); - } - - public TByteColumn() { - } - - public TByteColumn( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = nulls; - } - - /** - * Performs a deep copy on other. - */ - public TByteColumn(TByteColumn other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(); - for (Byte other_element : other.values) { - __this__values.add(other_element); - } - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); -; - } - } - - public TByteColumn deepCopy() { - return new TByteColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(byte elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return nulls; - } - - public void setNulls(byte[] nulls) { - setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = nulls; - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TByteColumn) - return this.equals((TByteColumn)that); - return false; - } - - public boolean equals(TByteColumn that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_values = true && (isSetValues()); - builder.append(present_values); - if (present_values) - builder.append(values); - - boolean present_nulls = true && (isSetNulls()); - builder.append(present_nulls); - if (present_nulls) - builder.append(nulls); - - return builder.toHashCode(); - } - - public int compareTo(TByteColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TByteColumn typedOther = (TByteColumn)other; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TByteColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TByteColumnStandardSchemeFactory implements SchemeFactory { - public TByteColumnStandardScheme getScheme() { - return new TByteColumnStandardScheme(); - } - } - - private static class TByteColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TByteColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list62 = iprot.readListBegin(); - struct.values = new ArrayList(_list62.size); - for (int _i63 = 0; _i63 < _list62.size; ++_i63) - { - byte _elem64; // optional - _elem64 = iprot.readByte(); - struct.values.add(_elem64); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TByteColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, struct.values.size())); - for (byte _iter65 : struct.values) - { - oprot.writeByte(_iter65); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TByteColumnTupleSchemeFactory implements SchemeFactory { - public TByteColumnTupleScheme getScheme() { - return new TByteColumnTupleScheme(); - } - } - - private static class TByteColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (byte _iter66 : struct.values) - { - oprot.writeByte(_iter66); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list67 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, iprot.readI32()); - struct.values = new ArrayList(_list67.size); - for (int _i68 = 0; _i68 < _list67.size; ++_i68) - { - byte _elem69; // optional - _elem69 = iprot.readByte(); - struct.values.add(_elem69); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TByteValue.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TByteValue.java deleted file mode 100644 index 23d9693759968..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TByteValue.java +++ /dev/null @@ -1,386 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TByteValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteValue"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BYTE, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TByteValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TByteValueTupleSchemeFactory()); - } - - private byte value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteValue.class, metaDataMap); - } - - public TByteValue() { - } - - /** - * Performs a deep copy on other. - */ - public TByteValue(TByteValue other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TByteValue deepCopy() { - return new TByteValue(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0; - } - - public byte getValue() { - return this.value; - } - - public void setValue(byte value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((Byte)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return Byte.valueOf(getValue()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TByteValue) - return this.equals((TByteValue)that); - return false; - } - - public boolean equals(TByteValue that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); - - return builder.toHashCode(); - } - - public int compareTo(TByteValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TByteValue typedOther = (TByteValue)other; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TByteValue("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TByteValueStandardSchemeFactory implements SchemeFactory { - public TByteValueStandardScheme getScheme() { - return new TByteValueStandardScheme(); - } - } - - private static class TByteValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TByteValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) { - struct.value = iprot.readByte(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TByteValue struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeByte(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TByteValueTupleSchemeFactory implements SchemeFactory { - public TByteValueTupleScheme getScheme() { - return new TByteValueTupleScheme(); - } - } - - private static class TByteValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeByte(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readByte(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCLIService.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCLIService.java deleted file mode 100644 index 54851b8d51317..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCLIService.java +++ /dev/null @@ -1,15414 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TCLIService { - - public interface Iface { - - public TOpenSessionResp OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException; - - public TCloseSessionResp CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException; - - public TGetInfoResp GetInfo(TGetInfoReq req) throws org.apache.thrift.TException; - - public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException; - - public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException; - - public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException; - - public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException; - - public TGetTablesResp GetTables(TGetTablesReq req) throws org.apache.thrift.TException; - - public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException; - - public TGetColumnsResp GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException; - - public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException; - - public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException; - - public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException; - - public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException; - - public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException; - - public TFetchResultsResp FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException; - - public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException; - - public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException; - - public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException; - - } - - public interface AsyncIface { - - public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetTypeInfo(TGetTypeInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetCatalogs(TGetCatalogsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - } - - public static class Client extends org.apache.thrift.TServiceClient implements Iface { - public static class Factory implements org.apache.thrift.TServiceClientFactory { - public Factory() {} - public Client getClient(org.apache.thrift.protocol.TProtocol prot) { - return new Client(prot); - } - public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - return new Client(iprot, oprot); - } - } - - public Client(org.apache.thrift.protocol.TProtocol prot) - { - super(prot, prot); - } - - public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - super(iprot, oprot); - } - - public TOpenSessionResp OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException - { - send_OpenSession(req); - return recv_OpenSession(); - } - - public void send_OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException - { - OpenSession_args args = new OpenSession_args(); - args.setReq(req); - sendBase("OpenSession", args); - } - - public TOpenSessionResp recv_OpenSession() throws org.apache.thrift.TException - { - OpenSession_result result = new OpenSession_result(); - receiveBase(result, "OpenSession"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "OpenSession failed: unknown result"); - } - - public TCloseSessionResp CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException - { - send_CloseSession(req); - return recv_CloseSession(); - } - - public void send_CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException - { - CloseSession_args args = new CloseSession_args(); - args.setReq(req); - sendBase("CloseSession", args); - } - - public TCloseSessionResp recv_CloseSession() throws org.apache.thrift.TException - { - CloseSession_result result = new CloseSession_result(); - receiveBase(result, "CloseSession"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CloseSession failed: unknown result"); - } - - public TGetInfoResp GetInfo(TGetInfoReq req) throws org.apache.thrift.TException - { - send_GetInfo(req); - return recv_GetInfo(); - } - - public void send_GetInfo(TGetInfoReq req) throws org.apache.thrift.TException - { - GetInfo_args args = new GetInfo_args(); - args.setReq(req); - sendBase("GetInfo", args); - } - - public TGetInfoResp recv_GetInfo() throws org.apache.thrift.TException - { - GetInfo_result result = new GetInfo_result(); - receiveBase(result, "GetInfo"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetInfo failed: unknown result"); - } - - public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException - { - send_ExecuteStatement(req); - return recv_ExecuteStatement(); - } - - public void send_ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException - { - ExecuteStatement_args args = new ExecuteStatement_args(); - args.setReq(req); - sendBase("ExecuteStatement", args); - } - - public TExecuteStatementResp recv_ExecuteStatement() throws org.apache.thrift.TException - { - ExecuteStatement_result result = new ExecuteStatement_result(); - receiveBase(result, "ExecuteStatement"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ExecuteStatement failed: unknown result"); - } - - public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException - { - send_GetTypeInfo(req); - return recv_GetTypeInfo(); - } - - public void send_GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException - { - GetTypeInfo_args args = new GetTypeInfo_args(); - args.setReq(req); - sendBase("GetTypeInfo", args); - } - - public TGetTypeInfoResp recv_GetTypeInfo() throws org.apache.thrift.TException - { - GetTypeInfo_result result = new GetTypeInfo_result(); - receiveBase(result, "GetTypeInfo"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTypeInfo failed: unknown result"); - } - - public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException - { - send_GetCatalogs(req); - return recv_GetCatalogs(); - } - - public void send_GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException - { - GetCatalogs_args args = new GetCatalogs_args(); - args.setReq(req); - sendBase("GetCatalogs", args); - } - - public TGetCatalogsResp recv_GetCatalogs() throws org.apache.thrift.TException - { - GetCatalogs_result result = new GetCatalogs_result(); - receiveBase(result, "GetCatalogs"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetCatalogs failed: unknown result"); - } - - public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException - { - send_GetSchemas(req); - return recv_GetSchemas(); - } - - public void send_GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException - { - GetSchemas_args args = new GetSchemas_args(); - args.setReq(req); - sendBase("GetSchemas", args); - } - - public TGetSchemasResp recv_GetSchemas() throws org.apache.thrift.TException - { - GetSchemas_result result = new GetSchemas_result(); - receiveBase(result, "GetSchemas"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetSchemas failed: unknown result"); - } - - public TGetTablesResp GetTables(TGetTablesReq req) throws org.apache.thrift.TException - { - send_GetTables(req); - return recv_GetTables(); - } - - public void send_GetTables(TGetTablesReq req) throws org.apache.thrift.TException - { - GetTables_args args = new GetTables_args(); - args.setReq(req); - sendBase("GetTables", args); - } - - public TGetTablesResp recv_GetTables() throws org.apache.thrift.TException - { - GetTables_result result = new GetTables_result(); - receiveBase(result, "GetTables"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTables failed: unknown result"); - } - - public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException - { - send_GetTableTypes(req); - return recv_GetTableTypes(); - } - - public void send_GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException - { - GetTableTypes_args args = new GetTableTypes_args(); - args.setReq(req); - sendBase("GetTableTypes", args); - } - - public TGetTableTypesResp recv_GetTableTypes() throws org.apache.thrift.TException - { - GetTableTypes_result result = new GetTableTypes_result(); - receiveBase(result, "GetTableTypes"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTableTypes failed: unknown result"); - } - - public TGetColumnsResp GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException - { - send_GetColumns(req); - return recv_GetColumns(); - } - - public void send_GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException - { - GetColumns_args args = new GetColumns_args(); - args.setReq(req); - sendBase("GetColumns", args); - } - - public TGetColumnsResp recv_GetColumns() throws org.apache.thrift.TException - { - GetColumns_result result = new GetColumns_result(); - receiveBase(result, "GetColumns"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetColumns failed: unknown result"); - } - - public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException - { - send_GetFunctions(req); - return recv_GetFunctions(); - } - - public void send_GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException - { - GetFunctions_args args = new GetFunctions_args(); - args.setReq(req); - sendBase("GetFunctions", args); - } - - public TGetFunctionsResp recv_GetFunctions() throws org.apache.thrift.TException - { - GetFunctions_result result = new GetFunctions_result(); - receiveBase(result, "GetFunctions"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetFunctions failed: unknown result"); - } - - public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException - { - send_GetOperationStatus(req); - return recv_GetOperationStatus(); - } - - public void send_GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException - { - GetOperationStatus_args args = new GetOperationStatus_args(); - args.setReq(req); - sendBase("GetOperationStatus", args); - } - - public TGetOperationStatusResp recv_GetOperationStatus() throws org.apache.thrift.TException - { - GetOperationStatus_result result = new GetOperationStatus_result(); - receiveBase(result, "GetOperationStatus"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetOperationStatus failed: unknown result"); - } - - public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException - { - send_CancelOperation(req); - return recv_CancelOperation(); - } - - public void send_CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException - { - CancelOperation_args args = new CancelOperation_args(); - args.setReq(req); - sendBase("CancelOperation", args); - } - - public TCancelOperationResp recv_CancelOperation() throws org.apache.thrift.TException - { - CancelOperation_result result = new CancelOperation_result(); - receiveBase(result, "CancelOperation"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CancelOperation failed: unknown result"); - } - - public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException - { - send_CloseOperation(req); - return recv_CloseOperation(); - } - - public void send_CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException - { - CloseOperation_args args = new CloseOperation_args(); - args.setReq(req); - sendBase("CloseOperation", args); - } - - public TCloseOperationResp recv_CloseOperation() throws org.apache.thrift.TException - { - CloseOperation_result result = new CloseOperation_result(); - receiveBase(result, "CloseOperation"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CloseOperation failed: unknown result"); - } - - public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException - { - send_GetResultSetMetadata(req); - return recv_GetResultSetMetadata(); - } - - public void send_GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException - { - GetResultSetMetadata_args args = new GetResultSetMetadata_args(); - args.setReq(req); - sendBase("GetResultSetMetadata", args); - } - - public TGetResultSetMetadataResp recv_GetResultSetMetadata() throws org.apache.thrift.TException - { - GetResultSetMetadata_result result = new GetResultSetMetadata_result(); - receiveBase(result, "GetResultSetMetadata"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetResultSetMetadata failed: unknown result"); - } - - public TFetchResultsResp FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException - { - send_FetchResults(req); - return recv_FetchResults(); - } - - public void send_FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException - { - FetchResults_args args = new FetchResults_args(); - args.setReq(req); - sendBase("FetchResults", args); - } - - public TFetchResultsResp recv_FetchResults() throws org.apache.thrift.TException - { - FetchResults_result result = new FetchResults_result(); - receiveBase(result, "FetchResults"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "FetchResults failed: unknown result"); - } - - public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException - { - send_GetDelegationToken(req); - return recv_GetDelegationToken(); - } - - public void send_GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException - { - GetDelegationToken_args args = new GetDelegationToken_args(); - args.setReq(req); - sendBase("GetDelegationToken", args); - } - - public TGetDelegationTokenResp recv_GetDelegationToken() throws org.apache.thrift.TException - { - GetDelegationToken_result result = new GetDelegationToken_result(); - receiveBase(result, "GetDelegationToken"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetDelegationToken failed: unknown result"); - } - - public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException - { - send_CancelDelegationToken(req); - return recv_CancelDelegationToken(); - } - - public void send_CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException - { - CancelDelegationToken_args args = new CancelDelegationToken_args(); - args.setReq(req); - sendBase("CancelDelegationToken", args); - } - - public TCancelDelegationTokenResp recv_CancelDelegationToken() throws org.apache.thrift.TException - { - CancelDelegationToken_result result = new CancelDelegationToken_result(); - receiveBase(result, "CancelDelegationToken"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CancelDelegationToken failed: unknown result"); - } - - public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException - { - send_RenewDelegationToken(req); - return recv_RenewDelegationToken(); - } - - public void send_RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException - { - RenewDelegationToken_args args = new RenewDelegationToken_args(); - args.setReq(req); - sendBase("RenewDelegationToken", args); - } - - public TRenewDelegationTokenResp recv_RenewDelegationToken() throws org.apache.thrift.TException - { - RenewDelegationToken_result result = new RenewDelegationToken_result(); - receiveBase(result, "RenewDelegationToken"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "RenewDelegationToken failed: unknown result"); - } - - } - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { - public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { - private org.apache.thrift.async.TAsyncClientManager clientManager; - private org.apache.thrift.protocol.TProtocolFactory protocolFactory; - public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { - this.clientManager = clientManager; - this.protocolFactory = protocolFactory; - } - public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { - return new AsyncClient(protocolFactory, clientManager, transport); - } - } - - public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { - super(protocolFactory, clientManager, transport); - } - - public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - OpenSession_call method_call = new OpenSession_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class OpenSession_call extends org.apache.thrift.async.TAsyncMethodCall { - private TOpenSessionReq req; - public OpenSession_call(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("OpenSession", org.apache.thrift.protocol.TMessageType.CALL, 0)); - OpenSession_args args = new OpenSession_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TOpenSessionResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_OpenSession(); - } - } - - public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - CloseSession_call method_call = new CloseSession_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class CloseSession_call extends org.apache.thrift.async.TAsyncMethodCall { - private TCloseSessionReq req; - public CloseSession_call(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("CloseSession", org.apache.thrift.protocol.TMessageType.CALL, 0)); - CloseSession_args args = new CloseSession_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TCloseSessionResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_CloseSession(); - } - } - - public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetInfo_call method_call = new GetInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetInfo_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetInfoReq req; - public GetInfo_call(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetInfo_args args = new GetInfo_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetInfoResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetInfo(); - } - } - - public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - ExecuteStatement_call method_call = new ExecuteStatement_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class ExecuteStatement_call extends org.apache.thrift.async.TAsyncMethodCall { - private TExecuteStatementReq req; - public ExecuteStatement_call(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("ExecuteStatement", org.apache.thrift.protocol.TMessageType.CALL, 0)); - ExecuteStatement_args args = new ExecuteStatement_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TExecuteStatementResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_ExecuteStatement(); - } - } - - public void GetTypeInfo(TGetTypeInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetTypeInfo_call method_call = new GetTypeInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetTypeInfo_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetTypeInfoReq req; - public GetTypeInfo_call(TGetTypeInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetTypeInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetTypeInfo_args args = new GetTypeInfo_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetTypeInfoResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetTypeInfo(); - } - } - - public void GetCatalogs(TGetCatalogsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetCatalogs_call method_call = new GetCatalogs_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetCatalogs_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetCatalogsReq req; - public GetCatalogs_call(TGetCatalogsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetCatalogs", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetCatalogs_args args = new GetCatalogs_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetCatalogsResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetCatalogs(); - } - } - - public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetSchemas_call method_call = new GetSchemas_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetSchemas_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetSchemasReq req; - public GetSchemas_call(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetSchemas", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetSchemas_args args = new GetSchemas_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetSchemasResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetSchemas(); - } - } - - public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetTables_call method_call = new GetTables_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetTables_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetTablesReq req; - public GetTables_call(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetTables", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetTables_args args = new GetTables_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetTablesResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetTables(); - } - } - - public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetTableTypes_call method_call = new GetTableTypes_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetTableTypes_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetTableTypesReq req; - public GetTableTypes_call(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetTableTypes", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetTableTypes_args args = new GetTableTypes_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetTableTypesResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetTableTypes(); - } - } - - public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetColumns_call method_call = new GetColumns_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetColumns_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetColumnsReq req; - public GetColumns_call(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetColumns", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetColumns_args args = new GetColumns_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetColumnsResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetColumns(); - } - } - - public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetFunctions_call method_call = new GetFunctions_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetFunctions_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetFunctionsReq req; - public GetFunctions_call(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetFunctions", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetFunctions_args args = new GetFunctions_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetFunctionsResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetFunctions(); - } - } - - public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetOperationStatus_call method_call = new GetOperationStatus_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetOperationStatus_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetOperationStatusReq req; - public GetOperationStatus_call(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetOperationStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetOperationStatus_args args = new GetOperationStatus_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetOperationStatusResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetOperationStatus(); - } - } - - public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - CancelOperation_call method_call = new CancelOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class CancelOperation_call extends org.apache.thrift.async.TAsyncMethodCall { - private TCancelOperationReq req; - public CancelOperation_call(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("CancelOperation", org.apache.thrift.protocol.TMessageType.CALL, 0)); - CancelOperation_args args = new CancelOperation_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TCancelOperationResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_CancelOperation(); - } - } - - public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - CloseOperation_call method_call = new CloseOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class CloseOperation_call extends org.apache.thrift.async.TAsyncMethodCall { - private TCloseOperationReq req; - public CloseOperation_call(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("CloseOperation", org.apache.thrift.protocol.TMessageType.CALL, 0)); - CloseOperation_args args = new CloseOperation_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TCloseOperationResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_CloseOperation(); - } - } - - public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetResultSetMetadata_call method_call = new GetResultSetMetadata_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetResultSetMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetResultSetMetadataReq req; - public GetResultSetMetadata_call(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetResultSetMetadata", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetResultSetMetadata_args args = new GetResultSetMetadata_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetResultSetMetadataResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetResultSetMetadata(); - } - } - - public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - FetchResults_call method_call = new FetchResults_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class FetchResults_call extends org.apache.thrift.async.TAsyncMethodCall { - private TFetchResultsReq req; - public FetchResults_call(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("FetchResults", org.apache.thrift.protocol.TMessageType.CALL, 0)); - FetchResults_args args = new FetchResults_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TFetchResultsResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_FetchResults(); - } - } - - public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetDelegationToken_call method_call = new GetDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetDelegationTokenReq req; - public GetDelegationToken_call(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetDelegationToken_args args = new GetDelegationToken_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetDelegationTokenResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetDelegationToken(); - } - } - - public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - CancelDelegationToken_call method_call = new CancelDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class CancelDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { - private TCancelDelegationTokenReq req; - public CancelDelegationToken_call(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("CancelDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); - CancelDelegationToken_args args = new CancelDelegationToken_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TCancelDelegationTokenResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_CancelDelegationToken(); - } - } - - public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - RenewDelegationToken_call method_call = new RenewDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class RenewDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { - private TRenewDelegationTokenReq req; - public RenewDelegationToken_call(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("RenewDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); - RenewDelegationToken_args args = new RenewDelegationToken_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TRenewDelegationTokenResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_RenewDelegationToken(); - } - } - - } - - public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); - public Processor(I iface) { - super(iface, getProcessMap(new HashMap>())); - } - - protected Processor(I iface, Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static Map> getProcessMap(Map> processMap) { - processMap.put("OpenSession", new OpenSession()); - processMap.put("CloseSession", new CloseSession()); - processMap.put("GetInfo", new GetInfo()); - processMap.put("ExecuteStatement", new ExecuteStatement()); - processMap.put("GetTypeInfo", new GetTypeInfo()); - processMap.put("GetCatalogs", new GetCatalogs()); - processMap.put("GetSchemas", new GetSchemas()); - processMap.put("GetTables", new GetTables()); - processMap.put("GetTableTypes", new GetTableTypes()); - processMap.put("GetColumns", new GetColumns()); - processMap.put("GetFunctions", new GetFunctions()); - processMap.put("GetOperationStatus", new GetOperationStatus()); - processMap.put("CancelOperation", new CancelOperation()); - processMap.put("CloseOperation", new CloseOperation()); - processMap.put("GetResultSetMetadata", new GetResultSetMetadata()); - processMap.put("FetchResults", new FetchResults()); - processMap.put("GetDelegationToken", new GetDelegationToken()); - processMap.put("CancelDelegationToken", new CancelDelegationToken()); - processMap.put("RenewDelegationToken", new RenewDelegationToken()); - return processMap; - } - - public static class OpenSession extends org.apache.thrift.ProcessFunction { - public OpenSession() { - super("OpenSession"); - } - - public OpenSession_args getEmptyArgsInstance() { - return new OpenSession_args(); - } - - protected boolean isOneway() { - return false; - } - - public OpenSession_result getResult(I iface, OpenSession_args args) throws org.apache.thrift.TException { - OpenSession_result result = new OpenSession_result(); - result.success = iface.OpenSession(args.req); - return result; - } - } - - public static class CloseSession extends org.apache.thrift.ProcessFunction { - public CloseSession() { - super("CloseSession"); - } - - public CloseSession_args getEmptyArgsInstance() { - return new CloseSession_args(); - } - - protected boolean isOneway() { - return false; - } - - public CloseSession_result getResult(I iface, CloseSession_args args) throws org.apache.thrift.TException { - CloseSession_result result = new CloseSession_result(); - result.success = iface.CloseSession(args.req); - return result; - } - } - - public static class GetInfo extends org.apache.thrift.ProcessFunction { - public GetInfo() { - super("GetInfo"); - } - - public GetInfo_args getEmptyArgsInstance() { - return new GetInfo_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetInfo_result getResult(I iface, GetInfo_args args) throws org.apache.thrift.TException { - GetInfo_result result = new GetInfo_result(); - result.success = iface.GetInfo(args.req); - return result; - } - } - - public static class ExecuteStatement extends org.apache.thrift.ProcessFunction { - public ExecuteStatement() { - super("ExecuteStatement"); - } - - public ExecuteStatement_args getEmptyArgsInstance() { - return new ExecuteStatement_args(); - } - - protected boolean isOneway() { - return false; - } - - public ExecuteStatement_result getResult(I iface, ExecuteStatement_args args) throws org.apache.thrift.TException { - ExecuteStatement_result result = new ExecuteStatement_result(); - result.success = iface.ExecuteStatement(args.req); - return result; - } - } - - public static class GetTypeInfo extends org.apache.thrift.ProcessFunction { - public GetTypeInfo() { - super("GetTypeInfo"); - } - - public GetTypeInfo_args getEmptyArgsInstance() { - return new GetTypeInfo_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetTypeInfo_result getResult(I iface, GetTypeInfo_args args) throws org.apache.thrift.TException { - GetTypeInfo_result result = new GetTypeInfo_result(); - result.success = iface.GetTypeInfo(args.req); - return result; - } - } - - public static class GetCatalogs extends org.apache.thrift.ProcessFunction { - public GetCatalogs() { - super("GetCatalogs"); - } - - public GetCatalogs_args getEmptyArgsInstance() { - return new GetCatalogs_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetCatalogs_result getResult(I iface, GetCatalogs_args args) throws org.apache.thrift.TException { - GetCatalogs_result result = new GetCatalogs_result(); - result.success = iface.GetCatalogs(args.req); - return result; - } - } - - public static class GetSchemas extends org.apache.thrift.ProcessFunction { - public GetSchemas() { - super("GetSchemas"); - } - - public GetSchemas_args getEmptyArgsInstance() { - return new GetSchemas_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetSchemas_result getResult(I iface, GetSchemas_args args) throws org.apache.thrift.TException { - GetSchemas_result result = new GetSchemas_result(); - result.success = iface.GetSchemas(args.req); - return result; - } - } - - public static class GetTables extends org.apache.thrift.ProcessFunction { - public GetTables() { - super("GetTables"); - } - - public GetTables_args getEmptyArgsInstance() { - return new GetTables_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetTables_result getResult(I iface, GetTables_args args) throws org.apache.thrift.TException { - GetTables_result result = new GetTables_result(); - result.success = iface.GetTables(args.req); - return result; - } - } - - public static class GetTableTypes extends org.apache.thrift.ProcessFunction { - public GetTableTypes() { - super("GetTableTypes"); - } - - public GetTableTypes_args getEmptyArgsInstance() { - return new GetTableTypes_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetTableTypes_result getResult(I iface, GetTableTypes_args args) throws org.apache.thrift.TException { - GetTableTypes_result result = new GetTableTypes_result(); - result.success = iface.GetTableTypes(args.req); - return result; - } - } - - public static class GetColumns extends org.apache.thrift.ProcessFunction { - public GetColumns() { - super("GetColumns"); - } - - public GetColumns_args getEmptyArgsInstance() { - return new GetColumns_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetColumns_result getResult(I iface, GetColumns_args args) throws org.apache.thrift.TException { - GetColumns_result result = new GetColumns_result(); - result.success = iface.GetColumns(args.req); - return result; - } - } - - public static class GetFunctions extends org.apache.thrift.ProcessFunction { - public GetFunctions() { - super("GetFunctions"); - } - - public GetFunctions_args getEmptyArgsInstance() { - return new GetFunctions_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetFunctions_result getResult(I iface, GetFunctions_args args) throws org.apache.thrift.TException { - GetFunctions_result result = new GetFunctions_result(); - result.success = iface.GetFunctions(args.req); - return result; - } - } - - public static class GetOperationStatus extends org.apache.thrift.ProcessFunction { - public GetOperationStatus() { - super("GetOperationStatus"); - } - - public GetOperationStatus_args getEmptyArgsInstance() { - return new GetOperationStatus_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetOperationStatus_result getResult(I iface, GetOperationStatus_args args) throws org.apache.thrift.TException { - GetOperationStatus_result result = new GetOperationStatus_result(); - result.success = iface.GetOperationStatus(args.req); - return result; - } - } - - public static class CancelOperation extends org.apache.thrift.ProcessFunction { - public CancelOperation() { - super("CancelOperation"); - } - - public CancelOperation_args getEmptyArgsInstance() { - return new CancelOperation_args(); - } - - protected boolean isOneway() { - return false; - } - - public CancelOperation_result getResult(I iface, CancelOperation_args args) throws org.apache.thrift.TException { - CancelOperation_result result = new CancelOperation_result(); - result.success = iface.CancelOperation(args.req); - return result; - } - } - - public static class CloseOperation extends org.apache.thrift.ProcessFunction { - public CloseOperation() { - super("CloseOperation"); - } - - public CloseOperation_args getEmptyArgsInstance() { - return new CloseOperation_args(); - } - - protected boolean isOneway() { - return false; - } - - public CloseOperation_result getResult(I iface, CloseOperation_args args) throws org.apache.thrift.TException { - CloseOperation_result result = new CloseOperation_result(); - result.success = iface.CloseOperation(args.req); - return result; - } - } - - public static class GetResultSetMetadata extends org.apache.thrift.ProcessFunction { - public GetResultSetMetadata() { - super("GetResultSetMetadata"); - } - - public GetResultSetMetadata_args getEmptyArgsInstance() { - return new GetResultSetMetadata_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetResultSetMetadata_result getResult(I iface, GetResultSetMetadata_args args) throws org.apache.thrift.TException { - GetResultSetMetadata_result result = new GetResultSetMetadata_result(); - result.success = iface.GetResultSetMetadata(args.req); - return result; - } - } - - public static class FetchResults extends org.apache.thrift.ProcessFunction { - public FetchResults() { - super("FetchResults"); - } - - public FetchResults_args getEmptyArgsInstance() { - return new FetchResults_args(); - } - - protected boolean isOneway() { - return false; - } - - public FetchResults_result getResult(I iface, FetchResults_args args) throws org.apache.thrift.TException { - FetchResults_result result = new FetchResults_result(); - result.success = iface.FetchResults(args.req); - return result; - } - } - - public static class GetDelegationToken extends org.apache.thrift.ProcessFunction { - public GetDelegationToken() { - super("GetDelegationToken"); - } - - public GetDelegationToken_args getEmptyArgsInstance() { - return new GetDelegationToken_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetDelegationToken_result getResult(I iface, GetDelegationToken_args args) throws org.apache.thrift.TException { - GetDelegationToken_result result = new GetDelegationToken_result(); - result.success = iface.GetDelegationToken(args.req); - return result; - } - } - - public static class CancelDelegationToken extends org.apache.thrift.ProcessFunction { - public CancelDelegationToken() { - super("CancelDelegationToken"); - } - - public CancelDelegationToken_args getEmptyArgsInstance() { - return new CancelDelegationToken_args(); - } - - protected boolean isOneway() { - return false; - } - - public CancelDelegationToken_result getResult(I iface, CancelDelegationToken_args args) throws org.apache.thrift.TException { - CancelDelegationToken_result result = new CancelDelegationToken_result(); - result.success = iface.CancelDelegationToken(args.req); - return result; - } - } - - public static class RenewDelegationToken extends org.apache.thrift.ProcessFunction { - public RenewDelegationToken() { - super("RenewDelegationToken"); - } - - public RenewDelegationToken_args getEmptyArgsInstance() { - return new RenewDelegationToken_args(); - } - - protected boolean isOneway() { - return false; - } - - public RenewDelegationToken_result getResult(I iface, RenewDelegationToken_args args) throws org.apache.thrift.TException { - RenewDelegationToken_result result = new RenewDelegationToken_result(); - result.success = iface.RenewDelegationToken(args.req); - return result; - } - } - - } - - public static class OpenSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OpenSession_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new OpenSession_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new OpenSession_argsTupleSchemeFactory()); - } - - private TOpenSessionReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOpenSessionReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_args.class, metaDataMap); - } - - public OpenSession_args() { - } - - public OpenSession_args( - TOpenSessionReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public OpenSession_args(OpenSession_args other) { - if (other.isSetReq()) { - this.req = new TOpenSessionReq(other.req); - } - } - - public OpenSession_args deepCopy() { - return new OpenSession_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TOpenSessionReq getReq() { - return this.req; - } - - public void setReq(TOpenSessionReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TOpenSessionReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof OpenSession_args) - return this.equals((OpenSession_args)that); - return false; - } - - public boolean equals(OpenSession_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(OpenSession_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - OpenSession_args typedOther = (OpenSession_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("OpenSession_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class OpenSession_argsStandardSchemeFactory implements SchemeFactory { - public OpenSession_argsStandardScheme getScheme() { - return new OpenSession_argsStandardScheme(); - } - } - - private static class OpenSession_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TOpenSessionReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, OpenSession_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class OpenSession_argsTupleSchemeFactory implements SchemeFactory { - public OpenSession_argsTupleScheme getScheme() { - return new OpenSession_argsTupleScheme(); - } - } - - private static class OpenSession_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TOpenSessionReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class OpenSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OpenSession_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new OpenSession_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new OpenSession_resultTupleSchemeFactory()); - } - - private TOpenSessionResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOpenSessionResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_result.class, metaDataMap); - } - - public OpenSession_result() { - } - - public OpenSession_result( - TOpenSessionResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public OpenSession_result(OpenSession_result other) { - if (other.isSetSuccess()) { - this.success = new TOpenSessionResp(other.success); - } - } - - public OpenSession_result deepCopy() { - return new OpenSession_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TOpenSessionResp getSuccess() { - return this.success; - } - - public void setSuccess(TOpenSessionResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TOpenSessionResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof OpenSession_result) - return this.equals((OpenSession_result)that); - return false; - } - - public boolean equals(OpenSession_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(OpenSession_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - OpenSession_result typedOther = (OpenSession_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("OpenSession_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class OpenSession_resultStandardSchemeFactory implements SchemeFactory { - public OpenSession_resultStandardScheme getScheme() { - return new OpenSession_resultStandardScheme(); - } - } - - private static class OpenSession_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TOpenSessionResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, OpenSession_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class OpenSession_resultTupleSchemeFactory implements SchemeFactory { - public OpenSession_resultTupleScheme getScheme() { - return new OpenSession_resultTupleScheme(); - } - } - - private static class OpenSession_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TOpenSessionResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class CloseSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CloseSession_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CloseSession_argsTupleSchemeFactory()); - } - - private TCloseSessionReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCloseSessionReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_args.class, metaDataMap); - } - - public CloseSession_args() { - } - - public CloseSession_args( - TCloseSessionReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public CloseSession_args(CloseSession_args other) { - if (other.isSetReq()) { - this.req = new TCloseSessionReq(other.req); - } - } - - public CloseSession_args deepCopy() { - return new CloseSession_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TCloseSessionReq getReq() { - return this.req; - } - - public void setReq(TCloseSessionReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TCloseSessionReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CloseSession_args) - return this.equals((CloseSession_args)that); - return false; - } - - public boolean equals(CloseSession_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(CloseSession_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - CloseSession_args typedOther = (CloseSession_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CloseSession_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CloseSession_argsStandardSchemeFactory implements SchemeFactory { - public CloseSession_argsStandardScheme getScheme() { - return new CloseSession_argsStandardScheme(); - } - } - - private static class CloseSession_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TCloseSessionReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CloseSession_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CloseSession_argsTupleSchemeFactory implements SchemeFactory { - public CloseSession_argsTupleScheme getScheme() { - return new CloseSession_argsTupleScheme(); - } - } - - private static class CloseSession_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CloseSession_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TCloseSessionReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class CloseSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CloseSession_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CloseSession_resultTupleSchemeFactory()); - } - - private TCloseSessionResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCloseSessionResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_result.class, metaDataMap); - } - - public CloseSession_result() { - } - - public CloseSession_result( - TCloseSessionResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public CloseSession_result(CloseSession_result other) { - if (other.isSetSuccess()) { - this.success = new TCloseSessionResp(other.success); - } - } - - public CloseSession_result deepCopy() { - return new CloseSession_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TCloseSessionResp getSuccess() { - return this.success; - } - - public void setSuccess(TCloseSessionResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TCloseSessionResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CloseSession_result) - return this.equals((CloseSession_result)that); - return false; - } - - public boolean equals(CloseSession_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(CloseSession_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - CloseSession_result typedOther = (CloseSession_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CloseSession_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CloseSession_resultStandardSchemeFactory implements SchemeFactory { - public CloseSession_resultStandardScheme getScheme() { - return new CloseSession_resultStandardScheme(); - } - } - - private static class CloseSession_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TCloseSessionResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CloseSession_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CloseSession_resultTupleSchemeFactory implements SchemeFactory { - public CloseSession_resultTupleScheme getScheme() { - return new CloseSession_resultTupleScheme(); - } - } - - private static class CloseSession_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CloseSession_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TCloseSessionResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfo_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetInfo_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetInfo_argsTupleSchemeFactory()); - } - - private TGetInfoReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetInfoReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_args.class, metaDataMap); - } - - public GetInfo_args() { - } - - public GetInfo_args( - TGetInfoReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetInfo_args(GetInfo_args other) { - if (other.isSetReq()) { - this.req = new TGetInfoReq(other.req); - } - } - - public GetInfo_args deepCopy() { - return new GetInfo_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetInfoReq getReq() { - return this.req; - } - - public void setReq(TGetInfoReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetInfoReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetInfo_args) - return this.equals((GetInfo_args)that); - return false; - } - - public boolean equals(GetInfo_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(GetInfo_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetInfo_args typedOther = (GetInfo_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetInfo_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetInfo_argsStandardSchemeFactory implements SchemeFactory { - public GetInfo_argsStandardScheme getScheme() { - return new GetInfo_argsStandardScheme(); - } - } - - private static class GetInfo_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetInfoReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetInfo_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetInfo_argsTupleSchemeFactory implements SchemeFactory { - public GetInfo_argsTupleScheme getScheme() { - return new GetInfo_argsTupleScheme(); - } - } - - private static class GetInfo_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetInfoReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfo_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetInfo_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetInfo_resultTupleSchemeFactory()); - } - - private TGetInfoResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetInfoResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_result.class, metaDataMap); - } - - public GetInfo_result() { - } - - public GetInfo_result( - TGetInfoResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetInfo_result(GetInfo_result other) { - if (other.isSetSuccess()) { - this.success = new TGetInfoResp(other.success); - } - } - - public GetInfo_result deepCopy() { - return new GetInfo_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetInfoResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetInfoResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetInfoResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetInfo_result) - return this.equals((GetInfo_result)that); - return false; - } - - public boolean equals(GetInfo_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(GetInfo_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetInfo_result typedOther = (GetInfo_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetInfo_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetInfo_resultStandardSchemeFactory implements SchemeFactory { - public GetInfo_resultStandardScheme getScheme() { - return new GetInfo_resultStandardScheme(); - } - } - - private static class GetInfo_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetInfoResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetInfo_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetInfo_resultTupleSchemeFactory implements SchemeFactory { - public GetInfo_resultTupleScheme getScheme() { - return new GetInfo_resultTupleScheme(); - } - } - - private static class GetInfo_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetInfoResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class ExecuteStatement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteStatement_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ExecuteStatement_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ExecuteStatement_argsTupleSchemeFactory()); - } - - private TExecuteStatementReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TExecuteStatementReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_args.class, metaDataMap); - } - - public ExecuteStatement_args() { - } - - public ExecuteStatement_args( - TExecuteStatementReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public ExecuteStatement_args(ExecuteStatement_args other) { - if (other.isSetReq()) { - this.req = new TExecuteStatementReq(other.req); - } - } - - public ExecuteStatement_args deepCopy() { - return new ExecuteStatement_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TExecuteStatementReq getReq() { - return this.req; - } - - public void setReq(TExecuteStatementReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TExecuteStatementReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ExecuteStatement_args) - return this.equals((ExecuteStatement_args)that); - return false; - } - - public boolean equals(ExecuteStatement_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(ExecuteStatement_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - ExecuteStatement_args typedOther = (ExecuteStatement_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("ExecuteStatement_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class ExecuteStatement_argsStandardSchemeFactory implements SchemeFactory { - public ExecuteStatement_argsStandardScheme getScheme() { - return new ExecuteStatement_argsStandardScheme(); - } - } - - private static class ExecuteStatement_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TExecuteStatementReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ExecuteStatement_argsTupleSchemeFactory implements SchemeFactory { - public ExecuteStatement_argsTupleScheme getScheme() { - return new ExecuteStatement_argsTupleScheme(); - } - } - - private static class ExecuteStatement_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TExecuteStatementReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class ExecuteStatement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteStatement_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ExecuteStatement_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ExecuteStatement_resultTupleSchemeFactory()); - } - - private TExecuteStatementResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TExecuteStatementResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_result.class, metaDataMap); - } - - public ExecuteStatement_result() { - } - - public ExecuteStatement_result( - TExecuteStatementResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public ExecuteStatement_result(ExecuteStatement_result other) { - if (other.isSetSuccess()) { - this.success = new TExecuteStatementResp(other.success); - } - } - - public ExecuteStatement_result deepCopy() { - return new ExecuteStatement_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TExecuteStatementResp getSuccess() { - return this.success; - } - - public void setSuccess(TExecuteStatementResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TExecuteStatementResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ExecuteStatement_result) - return this.equals((ExecuteStatement_result)that); - return false; - } - - public boolean equals(ExecuteStatement_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(ExecuteStatement_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - ExecuteStatement_result typedOther = (ExecuteStatement_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("ExecuteStatement_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class ExecuteStatement_resultStandardSchemeFactory implements SchemeFactory { - public ExecuteStatement_resultStandardScheme getScheme() { - return new ExecuteStatement_resultStandardScheme(); - } - } - - private static class ExecuteStatement_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TExecuteStatementResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ExecuteStatement_resultTupleSchemeFactory implements SchemeFactory { - public ExecuteStatement_resultTupleScheme getScheme() { - return new ExecuteStatement_resultTupleScheme(); - } - } - - private static class ExecuteStatement_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TExecuteStatementResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetTypeInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetTypeInfo_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTypeInfo_argsTupleSchemeFactory()); - } - - private TGetTypeInfoReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetTypeInfoReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_args.class, metaDataMap); - } - - public GetTypeInfo_args() { - } - - public GetTypeInfo_args( - TGetTypeInfoReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetTypeInfo_args(GetTypeInfo_args other) { - if (other.isSetReq()) { - this.req = new TGetTypeInfoReq(other.req); - } - } - - public GetTypeInfo_args deepCopy() { - return new GetTypeInfo_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetTypeInfoReq getReq() { - return this.req; - } - - public void setReq(TGetTypeInfoReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetTypeInfoReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetTypeInfo_args) - return this.equals((GetTypeInfo_args)that); - return false; - } - - public boolean equals(GetTypeInfo_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(GetTypeInfo_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetTypeInfo_args typedOther = (GetTypeInfo_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTypeInfo_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetTypeInfo_argsStandardSchemeFactory implements SchemeFactory { - public GetTypeInfo_argsStandardScheme getScheme() { - return new GetTypeInfo_argsStandardScheme(); - } - } - - private static class GetTypeInfo_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetTypeInfoReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetTypeInfo_argsTupleSchemeFactory implements SchemeFactory { - public GetTypeInfo_argsTupleScheme getScheme() { - return new GetTypeInfo_argsTupleScheme(); - } - } - - private static class GetTypeInfo_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetTypeInfoReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetTypeInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetTypeInfo_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTypeInfo_resultTupleSchemeFactory()); - } - - private TGetTypeInfoResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetTypeInfoResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_result.class, metaDataMap); - } - - public GetTypeInfo_result() { - } - - public GetTypeInfo_result( - TGetTypeInfoResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetTypeInfo_result(GetTypeInfo_result other) { - if (other.isSetSuccess()) { - this.success = new TGetTypeInfoResp(other.success); - } - } - - public GetTypeInfo_result deepCopy() { - return new GetTypeInfo_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetTypeInfoResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetTypeInfoResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetTypeInfoResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetTypeInfo_result) - return this.equals((GetTypeInfo_result)that); - return false; - } - - public boolean equals(GetTypeInfo_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(GetTypeInfo_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetTypeInfo_result typedOther = (GetTypeInfo_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTypeInfo_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetTypeInfo_resultStandardSchemeFactory implements SchemeFactory { - public GetTypeInfo_resultStandardScheme getScheme() { - return new GetTypeInfo_resultStandardScheme(); - } - } - - private static class GetTypeInfo_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetTypeInfoResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetTypeInfo_resultTupleSchemeFactory implements SchemeFactory { - public GetTypeInfo_resultTupleScheme getScheme() { - return new GetTypeInfo_resultTupleScheme(); - } - } - - private static class GetTypeInfo_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetTypeInfoResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetCatalogs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCatalogs_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetCatalogs_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetCatalogs_argsTupleSchemeFactory()); - } - - private TGetCatalogsReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetCatalogsReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_args.class, metaDataMap); - } - - public GetCatalogs_args() { - } - - public GetCatalogs_args( - TGetCatalogsReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetCatalogs_args(GetCatalogs_args other) { - if (other.isSetReq()) { - this.req = new TGetCatalogsReq(other.req); - } - } - - public GetCatalogs_args deepCopy() { - return new GetCatalogs_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetCatalogsReq getReq() { - return this.req; - } - - public void setReq(TGetCatalogsReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetCatalogsReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetCatalogs_args) - return this.equals((GetCatalogs_args)that); - return false; - } - - public boolean equals(GetCatalogs_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(GetCatalogs_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetCatalogs_args typedOther = (GetCatalogs_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetCatalogs_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetCatalogs_argsStandardSchemeFactory implements SchemeFactory { - public GetCatalogs_argsStandardScheme getScheme() { - return new GetCatalogs_argsStandardScheme(); - } - } - - private static class GetCatalogs_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetCatalogsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetCatalogs_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetCatalogs_argsTupleSchemeFactory implements SchemeFactory { - public GetCatalogs_argsTupleScheme getScheme() { - return new GetCatalogs_argsTupleScheme(); - } - } - - private static class GetCatalogs_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetCatalogsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetCatalogs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCatalogs_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetCatalogs_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetCatalogs_resultTupleSchemeFactory()); - } - - private TGetCatalogsResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetCatalogsResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_result.class, metaDataMap); - } - - public GetCatalogs_result() { - } - - public GetCatalogs_result( - TGetCatalogsResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetCatalogs_result(GetCatalogs_result other) { - if (other.isSetSuccess()) { - this.success = new TGetCatalogsResp(other.success); - } - } - - public GetCatalogs_result deepCopy() { - return new GetCatalogs_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetCatalogsResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetCatalogsResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetCatalogsResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetCatalogs_result) - return this.equals((GetCatalogs_result)that); - return false; - } - - public boolean equals(GetCatalogs_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(GetCatalogs_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetCatalogs_result typedOther = (GetCatalogs_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetCatalogs_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetCatalogs_resultStandardSchemeFactory implements SchemeFactory { - public GetCatalogs_resultStandardScheme getScheme() { - return new GetCatalogs_resultStandardScheme(); - } - } - - private static class GetCatalogs_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetCatalogsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetCatalogs_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetCatalogs_resultTupleSchemeFactory implements SchemeFactory { - public GetCatalogs_resultTupleScheme getScheme() { - return new GetCatalogs_resultTupleScheme(); - } - } - - private static class GetCatalogs_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetCatalogsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetSchemas_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetSchemas_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetSchemas_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetSchemas_argsTupleSchemeFactory()); - } - - private TGetSchemasReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetSchemasReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_args.class, metaDataMap); - } - - public GetSchemas_args() { - } - - public GetSchemas_args( - TGetSchemasReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetSchemas_args(GetSchemas_args other) { - if (other.isSetReq()) { - this.req = new TGetSchemasReq(other.req); - } - } - - public GetSchemas_args deepCopy() { - return new GetSchemas_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetSchemasReq getReq() { - return this.req; - } - - public void setReq(TGetSchemasReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetSchemasReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetSchemas_args) - return this.equals((GetSchemas_args)that); - return false; - } - - public boolean equals(GetSchemas_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(GetSchemas_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetSchemas_args typedOther = (GetSchemas_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetSchemas_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetSchemas_argsStandardSchemeFactory implements SchemeFactory { - public GetSchemas_argsStandardScheme getScheme() { - return new GetSchemas_argsStandardScheme(); - } - } - - private static class GetSchemas_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetSchemasReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetSchemas_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetSchemas_argsTupleSchemeFactory implements SchemeFactory { - public GetSchemas_argsTupleScheme getScheme() { - return new GetSchemas_argsTupleScheme(); - } - } - - private static class GetSchemas_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetSchemasReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetSchemas_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetSchemas_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetSchemas_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetSchemas_resultTupleSchemeFactory()); - } - - private TGetSchemasResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetSchemasResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_result.class, metaDataMap); - } - - public GetSchemas_result() { - } - - public GetSchemas_result( - TGetSchemasResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetSchemas_result(GetSchemas_result other) { - if (other.isSetSuccess()) { - this.success = new TGetSchemasResp(other.success); - } - } - - public GetSchemas_result deepCopy() { - return new GetSchemas_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetSchemasResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetSchemasResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetSchemasResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetSchemas_result) - return this.equals((GetSchemas_result)that); - return false; - } - - public boolean equals(GetSchemas_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(GetSchemas_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetSchemas_result typedOther = (GetSchemas_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetSchemas_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetSchemas_resultStandardSchemeFactory implements SchemeFactory { - public GetSchemas_resultStandardScheme getScheme() { - return new GetSchemas_resultStandardScheme(); - } - } - - private static class GetSchemas_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetSchemasResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetSchemas_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetSchemas_resultTupleSchemeFactory implements SchemeFactory { - public GetSchemas_resultTupleScheme getScheme() { - return new GetSchemas_resultTupleScheme(); - } - } - - private static class GetSchemas_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetSchemasResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetTables_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTables_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetTables_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTables_argsTupleSchemeFactory()); - } - - private TGetTablesReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetTablesReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_args.class, metaDataMap); - } - - public GetTables_args() { - } - - public GetTables_args( - TGetTablesReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetTables_args(GetTables_args other) { - if (other.isSetReq()) { - this.req = new TGetTablesReq(other.req); - } - } - - public GetTables_args deepCopy() { - return new GetTables_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetTablesReq getReq() { - return this.req; - } - - public void setReq(TGetTablesReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetTablesReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetTables_args) - return this.equals((GetTables_args)that); - return false; - } - - public boolean equals(GetTables_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(GetTables_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetTables_args typedOther = (GetTables_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTables_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetTables_argsStandardSchemeFactory implements SchemeFactory { - public GetTables_argsStandardScheme getScheme() { - return new GetTables_argsStandardScheme(); - } - } - - private static class GetTables_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetTablesReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetTables_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetTables_argsTupleSchemeFactory implements SchemeFactory { - public GetTables_argsTupleScheme getScheme() { - return new GetTables_argsTupleScheme(); - } - } - - private static class GetTables_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetTables_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetTablesReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetTables_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTables_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetTables_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTables_resultTupleSchemeFactory()); - } - - private TGetTablesResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetTablesResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_result.class, metaDataMap); - } - - public GetTables_result() { - } - - public GetTables_result( - TGetTablesResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetTables_result(GetTables_result other) { - if (other.isSetSuccess()) { - this.success = new TGetTablesResp(other.success); - } - } - - public GetTables_result deepCopy() { - return new GetTables_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetTablesResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetTablesResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetTablesResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetTables_result) - return this.equals((GetTables_result)that); - return false; - } - - public boolean equals(GetTables_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(GetTables_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetTables_result typedOther = (GetTables_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTables_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetTables_resultStandardSchemeFactory implements SchemeFactory { - public GetTables_resultStandardScheme getScheme() { - return new GetTables_resultStandardScheme(); - } - } - - private static class GetTables_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetTablesResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetTables_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetTables_resultTupleSchemeFactory implements SchemeFactory { - public GetTables_resultTupleScheme getScheme() { - return new GetTables_resultTupleScheme(); - } - } - - private static class GetTables_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetTables_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetTablesResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetTableTypes_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTableTypes_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetTableTypes_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTableTypes_argsTupleSchemeFactory()); - } - - private TGetTableTypesReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetTableTypesReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_args.class, metaDataMap); - } - - public GetTableTypes_args() { - } - - public GetTableTypes_args( - TGetTableTypesReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetTableTypes_args(GetTableTypes_args other) { - if (other.isSetReq()) { - this.req = new TGetTableTypesReq(other.req); - } - } - - public GetTableTypes_args deepCopy() { - return new GetTableTypes_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetTableTypesReq getReq() { - return this.req; - } - - public void setReq(TGetTableTypesReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetTableTypesReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetTableTypes_args) - return this.equals((GetTableTypes_args)that); - return false; - } - - public boolean equals(GetTableTypes_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(GetTableTypes_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetTableTypes_args typedOther = (GetTableTypes_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTableTypes_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetTableTypes_argsStandardSchemeFactory implements SchemeFactory { - public GetTableTypes_argsStandardScheme getScheme() { - return new GetTableTypes_argsStandardScheme(); - } - } - - private static class GetTableTypes_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetTableTypesReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetTableTypes_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetTableTypes_argsTupleSchemeFactory implements SchemeFactory { - public GetTableTypes_argsTupleScheme getScheme() { - return new GetTableTypes_argsTupleScheme(); - } - } - - private static class GetTableTypes_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetTableTypesReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetTableTypes_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTableTypes_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetTableTypes_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTableTypes_resultTupleSchemeFactory()); - } - - private TGetTableTypesResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetTableTypesResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_result.class, metaDataMap); - } - - public GetTableTypes_result() { - } - - public GetTableTypes_result( - TGetTableTypesResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetTableTypes_result(GetTableTypes_result other) { - if (other.isSetSuccess()) { - this.success = new TGetTableTypesResp(other.success); - } - } - - public GetTableTypes_result deepCopy() { - return new GetTableTypes_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetTableTypesResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetTableTypesResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetTableTypesResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetTableTypes_result) - return this.equals((GetTableTypes_result)that); - return false; - } - - public boolean equals(GetTableTypes_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(GetTableTypes_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetTableTypes_result typedOther = (GetTableTypes_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTableTypes_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetTableTypes_resultStandardSchemeFactory implements SchemeFactory { - public GetTableTypes_resultStandardScheme getScheme() { - return new GetTableTypes_resultStandardScheme(); - } - } - - private static class GetTableTypes_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetTableTypesResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetTableTypes_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetTableTypes_resultTupleSchemeFactory implements SchemeFactory { - public GetTableTypes_resultTupleScheme getScheme() { - return new GetTableTypes_resultTupleScheme(); - } - } - - private static class GetTableTypes_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetTableTypesResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetColumns_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetColumns_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetColumns_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetColumns_argsTupleSchemeFactory()); - } - - private TGetColumnsReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetColumnsReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_args.class, metaDataMap); - } - - public GetColumns_args() { - } - - public GetColumns_args( - TGetColumnsReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetColumns_args(GetColumns_args other) { - if (other.isSetReq()) { - this.req = new TGetColumnsReq(other.req); - } - } - - public GetColumns_args deepCopy() { - return new GetColumns_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetColumnsReq getReq() { - return this.req; - } - - public void setReq(TGetColumnsReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetColumnsReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetColumns_args) - return this.equals((GetColumns_args)that); - return false; - } - - public boolean equals(GetColumns_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(GetColumns_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetColumns_args typedOther = (GetColumns_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetColumns_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetColumns_argsStandardSchemeFactory implements SchemeFactory { - public GetColumns_argsStandardScheme getScheme() { - return new GetColumns_argsStandardScheme(); - } - } - - private static class GetColumns_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetColumnsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetColumns_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetColumns_argsTupleSchemeFactory implements SchemeFactory { - public GetColumns_argsTupleScheme getScheme() { - return new GetColumns_argsTupleScheme(); - } - } - - private static class GetColumns_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetColumns_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetColumnsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetColumns_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetColumns_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetColumns_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetColumns_resultTupleSchemeFactory()); - } - - private TGetColumnsResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetColumnsResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_result.class, metaDataMap); - } - - public GetColumns_result() { - } - - public GetColumns_result( - TGetColumnsResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetColumns_result(GetColumns_result other) { - if (other.isSetSuccess()) { - this.success = new TGetColumnsResp(other.success); - } - } - - public GetColumns_result deepCopy() { - return new GetColumns_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetColumnsResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetColumnsResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetColumnsResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetColumns_result) - return this.equals((GetColumns_result)that); - return false; - } - - public boolean equals(GetColumns_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(GetColumns_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetColumns_result typedOther = (GetColumns_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetColumns_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetColumns_resultStandardSchemeFactory implements SchemeFactory { - public GetColumns_resultStandardScheme getScheme() { - return new GetColumns_resultStandardScheme(); - } - } - - private static class GetColumns_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetColumnsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetColumns_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetColumns_resultTupleSchemeFactory implements SchemeFactory { - public GetColumns_resultTupleScheme getScheme() { - return new GetColumns_resultTupleScheme(); - } - } - - private static class GetColumns_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetColumns_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetColumnsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetFunctions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetFunctions_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetFunctions_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetFunctions_argsTupleSchemeFactory()); - } - - private TGetFunctionsReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetFunctionsReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_args.class, metaDataMap); - } - - public GetFunctions_args() { - } - - public GetFunctions_args( - TGetFunctionsReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetFunctions_args(GetFunctions_args other) { - if (other.isSetReq()) { - this.req = new TGetFunctionsReq(other.req); - } - } - - public GetFunctions_args deepCopy() { - return new GetFunctions_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetFunctionsReq getReq() { - return this.req; - } - - public void setReq(TGetFunctionsReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetFunctionsReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetFunctions_args) - return this.equals((GetFunctions_args)that); - return false; - } - - public boolean equals(GetFunctions_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(GetFunctions_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetFunctions_args typedOther = (GetFunctions_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetFunctions_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetFunctions_argsStandardSchemeFactory implements SchemeFactory { - public GetFunctions_argsStandardScheme getScheme() { - return new GetFunctions_argsStandardScheme(); - } - } - - private static class GetFunctions_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetFunctionsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetFunctions_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetFunctions_argsTupleSchemeFactory implements SchemeFactory { - public GetFunctions_argsTupleScheme getScheme() { - return new GetFunctions_argsTupleScheme(); - } - } - - private static class GetFunctions_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetFunctionsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetFunctions_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetFunctions_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetFunctions_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetFunctions_resultTupleSchemeFactory()); - } - - private TGetFunctionsResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetFunctionsResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_result.class, metaDataMap); - } - - public GetFunctions_result() { - } - - public GetFunctions_result( - TGetFunctionsResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetFunctions_result(GetFunctions_result other) { - if (other.isSetSuccess()) { - this.success = new TGetFunctionsResp(other.success); - } - } - - public GetFunctions_result deepCopy() { - return new GetFunctions_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetFunctionsResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetFunctionsResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetFunctionsResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetFunctions_result) - return this.equals((GetFunctions_result)that); - return false; - } - - public boolean equals(GetFunctions_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(GetFunctions_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetFunctions_result typedOther = (GetFunctions_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetFunctions_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetFunctions_resultStandardSchemeFactory implements SchemeFactory { - public GetFunctions_resultStandardScheme getScheme() { - return new GetFunctions_resultStandardScheme(); - } - } - - private static class GetFunctions_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetFunctionsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetFunctions_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetFunctions_resultTupleSchemeFactory implements SchemeFactory { - public GetFunctions_resultTupleScheme getScheme() { - return new GetFunctions_resultTupleScheme(); - } - } - - private static class GetFunctions_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetFunctionsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetOperationStatus_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetOperationStatus_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetOperationStatus_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetOperationStatus_argsTupleSchemeFactory()); - } - - private TGetOperationStatusReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetOperationStatusReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_args.class, metaDataMap); - } - - public GetOperationStatus_args() { - } - - public GetOperationStatus_args( - TGetOperationStatusReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetOperationStatus_args(GetOperationStatus_args other) { - if (other.isSetReq()) { - this.req = new TGetOperationStatusReq(other.req); - } - } - - public GetOperationStatus_args deepCopy() { - return new GetOperationStatus_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetOperationStatusReq getReq() { - return this.req; - } - - public void setReq(TGetOperationStatusReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetOperationStatusReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetOperationStatus_args) - return this.equals((GetOperationStatus_args)that); - return false; - } - - public boolean equals(GetOperationStatus_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(GetOperationStatus_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetOperationStatus_args typedOther = (GetOperationStatus_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetOperationStatus_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetOperationStatus_argsStandardSchemeFactory implements SchemeFactory { - public GetOperationStatus_argsStandardScheme getScheme() { - return new GetOperationStatus_argsStandardScheme(); - } - } - - private static class GetOperationStatus_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetOperationStatusReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetOperationStatus_argsTupleSchemeFactory implements SchemeFactory { - public GetOperationStatus_argsTupleScheme getScheme() { - return new GetOperationStatus_argsTupleScheme(); - } - } - - private static class GetOperationStatus_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetOperationStatusReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetOperationStatus_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetOperationStatus_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetOperationStatus_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetOperationStatus_resultTupleSchemeFactory()); - } - - private TGetOperationStatusResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetOperationStatusResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_result.class, metaDataMap); - } - - public GetOperationStatus_result() { - } - - public GetOperationStatus_result( - TGetOperationStatusResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetOperationStatus_result(GetOperationStatus_result other) { - if (other.isSetSuccess()) { - this.success = new TGetOperationStatusResp(other.success); - } - } - - public GetOperationStatus_result deepCopy() { - return new GetOperationStatus_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetOperationStatusResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetOperationStatusResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetOperationStatusResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetOperationStatus_result) - return this.equals((GetOperationStatus_result)that); - return false; - } - - public boolean equals(GetOperationStatus_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(GetOperationStatus_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetOperationStatus_result typedOther = (GetOperationStatus_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetOperationStatus_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetOperationStatus_resultStandardSchemeFactory implements SchemeFactory { - public GetOperationStatus_resultStandardScheme getScheme() { - return new GetOperationStatus_resultStandardScheme(); - } - } - - private static class GetOperationStatus_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetOperationStatusResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetOperationStatus_resultTupleSchemeFactory implements SchemeFactory { - public GetOperationStatus_resultTupleScheme getScheme() { - return new GetOperationStatus_resultTupleScheme(); - } - } - - private static class GetOperationStatus_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetOperationStatusResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class CancelOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelOperation_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CancelOperation_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CancelOperation_argsTupleSchemeFactory()); - } - - private TCancelOperationReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCancelOperationReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_args.class, metaDataMap); - } - - public CancelOperation_args() { - } - - public CancelOperation_args( - TCancelOperationReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public CancelOperation_args(CancelOperation_args other) { - if (other.isSetReq()) { - this.req = new TCancelOperationReq(other.req); - } - } - - public CancelOperation_args deepCopy() { - return new CancelOperation_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TCancelOperationReq getReq() { - return this.req; - } - - public void setReq(TCancelOperationReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TCancelOperationReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CancelOperation_args) - return this.equals((CancelOperation_args)that); - return false; - } - - public boolean equals(CancelOperation_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(CancelOperation_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - CancelOperation_args typedOther = (CancelOperation_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CancelOperation_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CancelOperation_argsStandardSchemeFactory implements SchemeFactory { - public CancelOperation_argsStandardScheme getScheme() { - return new CancelOperation_argsStandardScheme(); - } - } - - private static class CancelOperation_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TCancelOperationReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CancelOperation_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CancelOperation_argsTupleSchemeFactory implements SchemeFactory { - public CancelOperation_argsTupleScheme getScheme() { - return new CancelOperation_argsTupleScheme(); - } - } - - private static class CancelOperation_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TCancelOperationReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class CancelOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelOperation_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CancelOperation_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CancelOperation_resultTupleSchemeFactory()); - } - - private TCancelOperationResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCancelOperationResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_result.class, metaDataMap); - } - - public CancelOperation_result() { - } - - public CancelOperation_result( - TCancelOperationResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public CancelOperation_result(CancelOperation_result other) { - if (other.isSetSuccess()) { - this.success = new TCancelOperationResp(other.success); - } - } - - public CancelOperation_result deepCopy() { - return new CancelOperation_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TCancelOperationResp getSuccess() { - return this.success; - } - - public void setSuccess(TCancelOperationResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TCancelOperationResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CancelOperation_result) - return this.equals((CancelOperation_result)that); - return false; - } - - public boolean equals(CancelOperation_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(CancelOperation_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - CancelOperation_result typedOther = (CancelOperation_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CancelOperation_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CancelOperation_resultStandardSchemeFactory implements SchemeFactory { - public CancelOperation_resultStandardScheme getScheme() { - return new CancelOperation_resultStandardScheme(); - } - } - - private static class CancelOperation_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TCancelOperationResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CancelOperation_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CancelOperation_resultTupleSchemeFactory implements SchemeFactory { - public CancelOperation_resultTupleScheme getScheme() { - return new CancelOperation_resultTupleScheme(); - } - } - - private static class CancelOperation_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TCancelOperationResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class CloseOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseOperation_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CloseOperation_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CloseOperation_argsTupleSchemeFactory()); - } - - private TCloseOperationReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCloseOperationReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_args.class, metaDataMap); - } - - public CloseOperation_args() { - } - - public CloseOperation_args( - TCloseOperationReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public CloseOperation_args(CloseOperation_args other) { - if (other.isSetReq()) { - this.req = new TCloseOperationReq(other.req); - } - } - - public CloseOperation_args deepCopy() { - return new CloseOperation_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TCloseOperationReq getReq() { - return this.req; - } - - public void setReq(TCloseOperationReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TCloseOperationReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CloseOperation_args) - return this.equals((CloseOperation_args)that); - return false; - } - - public boolean equals(CloseOperation_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(CloseOperation_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - CloseOperation_args typedOther = (CloseOperation_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CloseOperation_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CloseOperation_argsStandardSchemeFactory implements SchemeFactory { - public CloseOperation_argsStandardScheme getScheme() { - return new CloseOperation_argsStandardScheme(); - } - } - - private static class CloseOperation_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TCloseOperationReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CloseOperation_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CloseOperation_argsTupleSchemeFactory implements SchemeFactory { - public CloseOperation_argsTupleScheme getScheme() { - return new CloseOperation_argsTupleScheme(); - } - } - - private static class CloseOperation_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TCloseOperationReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class CloseOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseOperation_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CloseOperation_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CloseOperation_resultTupleSchemeFactory()); - } - - private TCloseOperationResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCloseOperationResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_result.class, metaDataMap); - } - - public CloseOperation_result() { - } - - public CloseOperation_result( - TCloseOperationResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public CloseOperation_result(CloseOperation_result other) { - if (other.isSetSuccess()) { - this.success = new TCloseOperationResp(other.success); - } - } - - public CloseOperation_result deepCopy() { - return new CloseOperation_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TCloseOperationResp getSuccess() { - return this.success; - } - - public void setSuccess(TCloseOperationResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TCloseOperationResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CloseOperation_result) - return this.equals((CloseOperation_result)that); - return false; - } - - public boolean equals(CloseOperation_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(CloseOperation_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - CloseOperation_result typedOther = (CloseOperation_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CloseOperation_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CloseOperation_resultStandardSchemeFactory implements SchemeFactory { - public CloseOperation_resultStandardScheme getScheme() { - return new CloseOperation_resultStandardScheme(); - } - } - - private static class CloseOperation_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TCloseOperationResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CloseOperation_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CloseOperation_resultTupleSchemeFactory implements SchemeFactory { - public CloseOperation_resultTupleScheme getScheme() { - return new CloseOperation_resultTupleScheme(); - } - } - - private static class CloseOperation_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CloseOperation_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TCloseOperationResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetResultSetMetadata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetResultSetMetadata_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetResultSetMetadata_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetResultSetMetadata_argsTupleSchemeFactory()); - } - - private TGetResultSetMetadataReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetResultSetMetadataReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_args.class, metaDataMap); - } - - public GetResultSetMetadata_args() { - } - - public GetResultSetMetadata_args( - TGetResultSetMetadataReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetResultSetMetadata_args(GetResultSetMetadata_args other) { - if (other.isSetReq()) { - this.req = new TGetResultSetMetadataReq(other.req); - } - } - - public GetResultSetMetadata_args deepCopy() { - return new GetResultSetMetadata_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetResultSetMetadataReq getReq() { - return this.req; - } - - public void setReq(TGetResultSetMetadataReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetResultSetMetadataReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetResultSetMetadata_args) - return this.equals((GetResultSetMetadata_args)that); - return false; - } - - public boolean equals(GetResultSetMetadata_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(GetResultSetMetadata_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetResultSetMetadata_args typedOther = (GetResultSetMetadata_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetResultSetMetadata_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetResultSetMetadata_argsStandardSchemeFactory implements SchemeFactory { - public GetResultSetMetadata_argsStandardScheme getScheme() { - return new GetResultSetMetadata_argsStandardScheme(); - } - } - - private static class GetResultSetMetadata_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetResultSetMetadataReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetResultSetMetadata_argsTupleSchemeFactory implements SchemeFactory { - public GetResultSetMetadata_argsTupleScheme getScheme() { - return new GetResultSetMetadata_argsTupleScheme(); - } - } - - private static class GetResultSetMetadata_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetResultSetMetadataReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetResultSetMetadata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetResultSetMetadata_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetResultSetMetadata_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetResultSetMetadata_resultTupleSchemeFactory()); - } - - private TGetResultSetMetadataResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetResultSetMetadataResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_result.class, metaDataMap); - } - - public GetResultSetMetadata_result() { - } - - public GetResultSetMetadata_result( - TGetResultSetMetadataResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetResultSetMetadata_result(GetResultSetMetadata_result other) { - if (other.isSetSuccess()) { - this.success = new TGetResultSetMetadataResp(other.success); - } - } - - public GetResultSetMetadata_result deepCopy() { - return new GetResultSetMetadata_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetResultSetMetadataResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetResultSetMetadataResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetResultSetMetadataResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetResultSetMetadata_result) - return this.equals((GetResultSetMetadata_result)that); - return false; - } - - public boolean equals(GetResultSetMetadata_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(GetResultSetMetadata_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetResultSetMetadata_result typedOther = (GetResultSetMetadata_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetResultSetMetadata_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetResultSetMetadata_resultStandardSchemeFactory implements SchemeFactory { - public GetResultSetMetadata_resultStandardScheme getScheme() { - return new GetResultSetMetadata_resultStandardScheme(); - } - } - - private static class GetResultSetMetadata_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetResultSetMetadataResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetResultSetMetadata_resultTupleSchemeFactory implements SchemeFactory { - public GetResultSetMetadata_resultTupleScheme getScheme() { - return new GetResultSetMetadata_resultTupleScheme(); - } - } - - private static class GetResultSetMetadata_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetResultSetMetadataResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class FetchResults_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FetchResults_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new FetchResults_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new FetchResults_argsTupleSchemeFactory()); - } - - private TFetchResultsReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFetchResultsReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_args.class, metaDataMap); - } - - public FetchResults_args() { - } - - public FetchResults_args( - TFetchResultsReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public FetchResults_args(FetchResults_args other) { - if (other.isSetReq()) { - this.req = new TFetchResultsReq(other.req); - } - } - - public FetchResults_args deepCopy() { - return new FetchResults_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TFetchResultsReq getReq() { - return this.req; - } - - public void setReq(TFetchResultsReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TFetchResultsReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof FetchResults_args) - return this.equals((FetchResults_args)that); - return false; - } - - public boolean equals(FetchResults_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(FetchResults_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - FetchResults_args typedOther = (FetchResults_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("FetchResults_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class FetchResults_argsStandardSchemeFactory implements SchemeFactory { - public FetchResults_argsStandardScheme getScheme() { - return new FetchResults_argsStandardScheme(); - } - } - - private static class FetchResults_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TFetchResultsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, FetchResults_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class FetchResults_argsTupleSchemeFactory implements SchemeFactory { - public FetchResults_argsTupleScheme getScheme() { - return new FetchResults_argsTupleScheme(); - } - } - - private static class FetchResults_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TFetchResultsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class FetchResults_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FetchResults_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new FetchResults_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new FetchResults_resultTupleSchemeFactory()); - } - - private TFetchResultsResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFetchResultsResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_result.class, metaDataMap); - } - - public FetchResults_result() { - } - - public FetchResults_result( - TFetchResultsResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public FetchResults_result(FetchResults_result other) { - if (other.isSetSuccess()) { - this.success = new TFetchResultsResp(other.success); - } - } - - public FetchResults_result deepCopy() { - return new FetchResults_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TFetchResultsResp getSuccess() { - return this.success; - } - - public void setSuccess(TFetchResultsResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TFetchResultsResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof FetchResults_result) - return this.equals((FetchResults_result)that); - return false; - } - - public boolean equals(FetchResults_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(FetchResults_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - FetchResults_result typedOther = (FetchResults_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("FetchResults_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class FetchResults_resultStandardSchemeFactory implements SchemeFactory { - public FetchResults_resultStandardScheme getScheme() { - return new FetchResults_resultStandardScheme(); - } - } - - private static class FetchResults_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TFetchResultsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, FetchResults_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class FetchResults_resultTupleSchemeFactory implements SchemeFactory { - public FetchResults_resultTupleScheme getScheme() { - return new FetchResults_resultTupleScheme(); - } - } - - private static class FetchResults_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TFetchResultsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetDelegationToken_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetDelegationToken_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetDelegationToken_argsTupleSchemeFactory()); - } - - private TGetDelegationTokenReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetDelegationTokenReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_args.class, metaDataMap); - } - - public GetDelegationToken_args() { - } - - public GetDelegationToken_args( - TGetDelegationTokenReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetDelegationToken_args(GetDelegationToken_args other) { - if (other.isSetReq()) { - this.req = new TGetDelegationTokenReq(other.req); - } - } - - public GetDelegationToken_args deepCopy() { - return new GetDelegationToken_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetDelegationTokenReq getReq() { - return this.req; - } - - public void setReq(TGetDelegationTokenReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetDelegationTokenReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetDelegationToken_args) - return this.equals((GetDelegationToken_args)that); - return false; - } - - public boolean equals(GetDelegationToken_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(GetDelegationToken_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetDelegationToken_args typedOther = (GetDelegationToken_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetDelegationToken_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetDelegationToken_argsStandardSchemeFactory implements SchemeFactory { - public GetDelegationToken_argsStandardScheme getScheme() { - return new GetDelegationToken_argsStandardScheme(); - } - } - - private static class GetDelegationToken_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetDelegationToken_argsTupleSchemeFactory implements SchemeFactory { - public GetDelegationToken_argsTupleScheme getScheme() { - return new GetDelegationToken_argsTupleScheme(); - } - } - - private static class GetDelegationToken_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetDelegationToken_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetDelegationToken_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetDelegationToken_resultTupleSchemeFactory()); - } - - private TGetDelegationTokenResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetDelegationTokenResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_result.class, metaDataMap); - } - - public GetDelegationToken_result() { - } - - public GetDelegationToken_result( - TGetDelegationTokenResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetDelegationToken_result(GetDelegationToken_result other) { - if (other.isSetSuccess()) { - this.success = new TGetDelegationTokenResp(other.success); - } - } - - public GetDelegationToken_result deepCopy() { - return new GetDelegationToken_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetDelegationTokenResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetDelegationTokenResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetDelegationTokenResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetDelegationToken_result) - return this.equals((GetDelegationToken_result)that); - return false; - } - - public boolean equals(GetDelegationToken_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(GetDelegationToken_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - GetDelegationToken_result typedOther = (GetDelegationToken_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetDelegationToken_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetDelegationToken_resultStandardSchemeFactory implements SchemeFactory { - public GetDelegationToken_resultStandardScheme getScheme() { - return new GetDelegationToken_resultStandardScheme(); - } - } - - private static class GetDelegationToken_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetDelegationToken_resultTupleSchemeFactory implements SchemeFactory { - public GetDelegationToken_resultTupleScheme getScheme() { - return new GetDelegationToken_resultTupleScheme(); - } - } - - private static class GetDelegationToken_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class CancelDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelDelegationToken_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CancelDelegationToken_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CancelDelegationToken_argsTupleSchemeFactory()); - } - - private TCancelDelegationTokenReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCancelDelegationTokenReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_args.class, metaDataMap); - } - - public CancelDelegationToken_args() { - } - - public CancelDelegationToken_args( - TCancelDelegationTokenReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public CancelDelegationToken_args(CancelDelegationToken_args other) { - if (other.isSetReq()) { - this.req = new TCancelDelegationTokenReq(other.req); - } - } - - public CancelDelegationToken_args deepCopy() { - return new CancelDelegationToken_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TCancelDelegationTokenReq getReq() { - return this.req; - } - - public void setReq(TCancelDelegationTokenReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TCancelDelegationTokenReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CancelDelegationToken_args) - return this.equals((CancelDelegationToken_args)that); - return false; - } - - public boolean equals(CancelDelegationToken_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(CancelDelegationToken_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - CancelDelegationToken_args typedOther = (CancelDelegationToken_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CancelDelegationToken_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CancelDelegationToken_argsStandardSchemeFactory implements SchemeFactory { - public CancelDelegationToken_argsStandardScheme getScheme() { - return new CancelDelegationToken_argsStandardScheme(); - } - } - - private static class CancelDelegationToken_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TCancelDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CancelDelegationToken_argsTupleSchemeFactory implements SchemeFactory { - public CancelDelegationToken_argsTupleScheme getScheme() { - return new CancelDelegationToken_argsTupleScheme(); - } - } - - private static class CancelDelegationToken_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TCancelDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class CancelDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelDelegationToken_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CancelDelegationToken_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CancelDelegationToken_resultTupleSchemeFactory()); - } - - private TCancelDelegationTokenResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCancelDelegationTokenResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_result.class, metaDataMap); - } - - public CancelDelegationToken_result() { - } - - public CancelDelegationToken_result( - TCancelDelegationTokenResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public CancelDelegationToken_result(CancelDelegationToken_result other) { - if (other.isSetSuccess()) { - this.success = new TCancelDelegationTokenResp(other.success); - } - } - - public CancelDelegationToken_result deepCopy() { - return new CancelDelegationToken_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TCancelDelegationTokenResp getSuccess() { - return this.success; - } - - public void setSuccess(TCancelDelegationTokenResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TCancelDelegationTokenResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CancelDelegationToken_result) - return this.equals((CancelDelegationToken_result)that); - return false; - } - - public boolean equals(CancelDelegationToken_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(CancelDelegationToken_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - CancelDelegationToken_result typedOther = (CancelDelegationToken_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CancelDelegationToken_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CancelDelegationToken_resultStandardSchemeFactory implements SchemeFactory { - public CancelDelegationToken_resultStandardScheme getScheme() { - return new CancelDelegationToken_resultStandardScheme(); - } - } - - private static class CancelDelegationToken_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TCancelDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CancelDelegationToken_resultTupleSchemeFactory implements SchemeFactory { - public CancelDelegationToken_resultTupleScheme getScheme() { - return new CancelDelegationToken_resultTupleScheme(); - } - } - - private static class CancelDelegationToken_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TCancelDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class RenewDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RenewDelegationToken_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new RenewDelegationToken_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new RenewDelegationToken_argsTupleSchemeFactory()); - } - - private TRenewDelegationTokenReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRenewDelegationTokenReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_args.class, metaDataMap); - } - - public RenewDelegationToken_args() { - } - - public RenewDelegationToken_args( - TRenewDelegationTokenReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public RenewDelegationToken_args(RenewDelegationToken_args other) { - if (other.isSetReq()) { - this.req = new TRenewDelegationTokenReq(other.req); - } - } - - public RenewDelegationToken_args deepCopy() { - return new RenewDelegationToken_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TRenewDelegationTokenReq getReq() { - return this.req; - } - - public void setReq(TRenewDelegationTokenReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TRenewDelegationTokenReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof RenewDelegationToken_args) - return this.equals((RenewDelegationToken_args)that); - return false; - } - - public boolean equals(RenewDelegationToken_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_req = true && (isSetReq()); - builder.append(present_req); - if (present_req) - builder.append(req); - - return builder.toHashCode(); - } - - public int compareTo(RenewDelegationToken_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - RenewDelegationToken_args typedOther = (RenewDelegationToken_args)other; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(typedOther.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, typedOther.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("RenewDelegationToken_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class RenewDelegationToken_argsStandardSchemeFactory implements SchemeFactory { - public RenewDelegationToken_argsStandardScheme getScheme() { - return new RenewDelegationToken_argsStandardScheme(); - } - } - - private static class RenewDelegationToken_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TRenewDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class RenewDelegationToken_argsTupleSchemeFactory implements SchemeFactory { - public RenewDelegationToken_argsTupleScheme getScheme() { - return new RenewDelegationToken_argsTupleScheme(); - } - } - - private static class RenewDelegationToken_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TRenewDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class RenewDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RenewDelegationToken_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new RenewDelegationToken_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new RenewDelegationToken_resultTupleSchemeFactory()); - } - - private TRenewDelegationTokenResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRenewDelegationTokenResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_result.class, metaDataMap); - } - - public RenewDelegationToken_result() { - } - - public RenewDelegationToken_result( - TRenewDelegationTokenResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public RenewDelegationToken_result(RenewDelegationToken_result other) { - if (other.isSetSuccess()) { - this.success = new TRenewDelegationTokenResp(other.success); - } - } - - public RenewDelegationToken_result deepCopy() { - return new RenewDelegationToken_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TRenewDelegationTokenResp getSuccess() { - return this.success; - } - - public void setSuccess(TRenewDelegationTokenResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TRenewDelegationTokenResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof RenewDelegationToken_result) - return this.equals((RenewDelegationToken_result)that); - return false; - } - - public boolean equals(RenewDelegationToken_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_success = true && (isSetSuccess()); - builder.append(present_success); - if (present_success) - builder.append(success); - - return builder.toHashCode(); - } - - public int compareTo(RenewDelegationToken_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - RenewDelegationToken_result typedOther = (RenewDelegationToken_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("RenewDelegationToken_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class RenewDelegationToken_resultStandardSchemeFactory implements SchemeFactory { - public RenewDelegationToken_resultStandardScheme getScheme() { - return new RenewDelegationToken_resultStandardScheme(); - } - } - - private static class RenewDelegationToken_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TRenewDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class RenewDelegationToken_resultTupleSchemeFactory implements SchemeFactory { - public RenewDelegationToken_resultTupleScheme getScheme() { - return new RenewDelegationToken_resultTupleScheme(); - } - } - - private static class RenewDelegationToken_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TRenewDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCLIServiceConstants.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCLIServiceConstants.java deleted file mode 100644 index 25a38b178428a..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCLIServiceConstants.java +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TCLIServiceConstants { - - public static final Set PRIMITIVE_TYPES = new HashSet(); - static { - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.BOOLEAN_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.TINYINT_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.SMALLINT_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.INT_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.BIGINT_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.FLOAT_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.DOUBLE_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.STRING_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.TIMESTAMP_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.BINARY_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.DECIMAL_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.NULL_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.DATE_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.VARCHAR_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.CHAR_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.INTERVAL_YEAR_MONTH_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.INTERVAL_DAY_TIME_TYPE); - } - - public static final Set COMPLEX_TYPES = new HashSet(); - static { - COMPLEX_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.ARRAY_TYPE); - COMPLEX_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.MAP_TYPE); - COMPLEX_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.STRUCT_TYPE); - COMPLEX_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.UNION_TYPE); - COMPLEX_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.USER_DEFINED_TYPE); - } - - public static final Set COLLECTION_TYPES = new HashSet(); - static { - COLLECTION_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.ARRAY_TYPE); - COLLECTION_TYPES.add(org.apache.hive.service.cli.thrift.TTypeId.MAP_TYPE); - } - - public static final Map TYPE_NAMES = new HashMap(); - static { - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.BOOLEAN_TYPE, "BOOLEAN"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.TINYINT_TYPE, "TINYINT"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.SMALLINT_TYPE, "SMALLINT"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.INT_TYPE, "INT"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.BIGINT_TYPE, "BIGINT"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.FLOAT_TYPE, "FLOAT"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.DOUBLE_TYPE, "DOUBLE"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.STRING_TYPE, "STRING"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.TIMESTAMP_TYPE, "TIMESTAMP"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.BINARY_TYPE, "BINARY"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.ARRAY_TYPE, "ARRAY"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.MAP_TYPE, "MAP"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.STRUCT_TYPE, "STRUCT"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.UNION_TYPE, "UNIONTYPE"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.DECIMAL_TYPE, "DECIMAL"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.NULL_TYPE, "NULL"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.DATE_TYPE, "DATE"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.VARCHAR_TYPE, "VARCHAR"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.CHAR_TYPE, "CHAR"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.INTERVAL_YEAR_MONTH_TYPE, "INTERVAL_YEAR_MONTH"); - TYPE_NAMES.put(org.apache.hive.service.cli.thrift.TTypeId.INTERVAL_DAY_TIME_TYPE, "INTERVAL_DAY_TIME"); - } - - public static final String CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"; - - public static final String PRECISION = "precision"; - - public static final String SCALE = "scale"; - -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCancelDelegationTokenReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCancelDelegationTokenReq.java deleted file mode 100644 index e23fcdd77a1a4..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCancelDelegationTokenReq.java +++ /dev/null @@ -1,491 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TCancelDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCancelDelegationTokenReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCancelDelegationTokenReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String delegationToken; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - DELEGATION_TOKEN((short)2, "delegationToken"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // DELEGATION_TOKEN - return DELEGATION_TOKEN; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenReq.class, metaDataMap); - } - - public TCancelDelegationTokenReq() { - } - - public TCancelDelegationTokenReq( - TSessionHandle sessionHandle, - String delegationToken) - { - this(); - this.sessionHandle = sessionHandle; - this.delegationToken = delegationToken; - } - - /** - * Performs a deep copy on other. - */ - public TCancelDelegationTokenReq(TCancelDelegationTokenReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetDelegationToken()) { - this.delegationToken = other.delegationToken; - } - } - - public TCancelDelegationTokenReq deepCopy() { - return new TCancelDelegationTokenReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.delegationToken = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getDelegationToken() { - return this.delegationToken; - } - - public void setDelegationToken(String delegationToken) { - this.delegationToken = delegationToken; - } - - public void unsetDelegationToken() { - this.delegationToken = null; - } - - /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ - public boolean isSetDelegationToken() { - return this.delegationToken != null; - } - - public void setDelegationTokenIsSet(boolean value) { - if (!value) { - this.delegationToken = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case DELEGATION_TOKEN: - if (value == null) { - unsetDelegationToken(); - } else { - setDelegationToken((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case DELEGATION_TOKEN: - return getDelegationToken(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case DELEGATION_TOKEN: - return isSetDelegationToken(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCancelDelegationTokenReq) - return this.equals((TCancelDelegationTokenReq)that); - return false; - } - - public boolean equals(TCancelDelegationTokenReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_delegationToken = true && this.isSetDelegationToken(); - boolean that_present_delegationToken = true && that.isSetDelegationToken(); - if (this_present_delegationToken || that_present_delegationToken) { - if (!(this_present_delegationToken && that_present_delegationToken)) - return false; - if (!this.delegationToken.equals(that.delegationToken)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - boolean present_delegationToken = true && (isSetDelegationToken()); - builder.append(present_delegationToken); - if (present_delegationToken) - builder.append(delegationToken); - - return builder.toHashCode(); - } - - public int compareTo(TCancelDelegationTokenReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TCancelDelegationTokenReq typedOther = (TCancelDelegationTokenReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(typedOther.isSetDelegationToken()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDelegationToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, typedOther.delegationToken); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCancelDelegationTokenReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("delegationToken:"); - if (this.delegationToken == null) { - sb.append("null"); - } else { - sb.append(this.delegationToken); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - if (!isSetDelegationToken()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'delegationToken' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCancelDelegationTokenReqStandardSchemeFactory implements SchemeFactory { - public TCancelDelegationTokenReqStandardScheme getScheme() { - return new TCancelDelegationTokenReqStandardScheme(); - } - } - - private static class TCancelDelegationTokenReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // DELEGATION_TOKEN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.delegationToken != null) { - oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); - oprot.writeString(struct.delegationToken); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCancelDelegationTokenReqTupleSchemeFactory implements SchemeFactory { - public TCancelDelegationTokenReqTupleScheme getScheme() { - return new TCancelDelegationTokenReqTupleScheme(); - } - } - - private static class TCancelDelegationTokenReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.delegationToken); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCancelDelegationTokenResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCancelDelegationTokenResp.java deleted file mode 100644 index 77c9ee77ec59b..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCancelDelegationTokenResp.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TCancelDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCancelDelegationTokenRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCancelDelegationTokenRespTupleSchemeFactory()); - } - - private TStatus status; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenResp.class, metaDataMap); - } - - public TCancelDelegationTokenResp() { - } - - public TCancelDelegationTokenResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TCancelDelegationTokenResp(TCancelDelegationTokenResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TCancelDelegationTokenResp deepCopy() { - return new TCancelDelegationTokenResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCancelDelegationTokenResp) - return this.equals((TCancelDelegationTokenResp)that); - return false; - } - - public boolean equals(TCancelDelegationTokenResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - return builder.toHashCode(); - } - - public int compareTo(TCancelDelegationTokenResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TCancelDelegationTokenResp typedOther = (TCancelDelegationTokenResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCancelDelegationTokenResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCancelDelegationTokenRespStandardSchemeFactory implements SchemeFactory { - public TCancelDelegationTokenRespStandardScheme getScheme() { - return new TCancelDelegationTokenRespStandardScheme(); - } - } - - private static class TCancelDelegationTokenRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCancelDelegationTokenRespTupleSchemeFactory implements SchemeFactory { - public TCancelDelegationTokenRespTupleScheme getScheme() { - return new TCancelDelegationTokenRespTupleScheme(); - } - } - - private static class TCancelDelegationTokenRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCancelOperationReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCancelOperationReq.java deleted file mode 100644 index 45eac48ab12d3..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCancelOperationReq.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TCancelOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationReq"); - - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCancelOperationReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCancelOperationReqTupleSchemeFactory()); - } - - private TOperationHandle operationHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OPERATION_HANDLE((short)1, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationReq.class, metaDataMap); - } - - public TCancelOperationReq() { - } - - public TCancelOperationReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TCancelOperationReq(TCancelOperationReq other) { - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TCancelOperationReq deepCopy() { - return new TCancelOperationReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCancelOperationReq) - return this.equals((TCancelOperationReq)that); - return false; - } - - public boolean equals(TCancelOperationReq that) { - if (that == null) - return false; - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - return builder.toHashCode(); - } - - public int compareTo(TCancelOperationReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TCancelOperationReq typedOther = (TCancelOperationReq)other; - - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCancelOperationReq("); - boolean first = true; - - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCancelOperationReqStandardSchemeFactory implements SchemeFactory { - public TCancelOperationReqStandardScheme getScheme() { - return new TCancelOperationReqStandardScheme(); - } - } - - private static class TCancelOperationReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelOperationReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCancelOperationReqTupleSchemeFactory implements SchemeFactory { - public TCancelOperationReqTupleScheme getScheme() { - return new TCancelOperationReqTupleScheme(); - } - } - - private static class TCancelOperationReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.operationHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCancelOperationResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCancelOperationResp.java deleted file mode 100644 index 2a39414d601aa..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCancelOperationResp.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TCancelOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCancelOperationRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCancelOperationRespTupleSchemeFactory()); - } - - private TStatus status; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationResp.class, metaDataMap); - } - - public TCancelOperationResp() { - } - - public TCancelOperationResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TCancelOperationResp(TCancelOperationResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TCancelOperationResp deepCopy() { - return new TCancelOperationResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCancelOperationResp) - return this.equals((TCancelOperationResp)that); - return false; - } - - public boolean equals(TCancelOperationResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - return builder.toHashCode(); - } - - public int compareTo(TCancelOperationResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TCancelOperationResp typedOther = (TCancelOperationResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCancelOperationResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCancelOperationRespStandardSchemeFactory implements SchemeFactory { - public TCancelOperationRespStandardScheme getScheme() { - return new TCancelOperationRespStandardScheme(); - } - } - - private static class TCancelOperationRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelOperationResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCancelOperationRespTupleSchemeFactory implements SchemeFactory { - public TCancelOperationRespTupleScheme getScheme() { - return new TCancelOperationRespTupleScheme(); - } - } - - private static class TCancelOperationRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCloseOperationReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCloseOperationReq.java deleted file mode 100644 index 0cbb7ccced073..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCloseOperationReq.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TCloseOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationReq"); - - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCloseOperationReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCloseOperationReqTupleSchemeFactory()); - } - - private TOperationHandle operationHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OPERATION_HANDLE((short)1, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationReq.class, metaDataMap); - } - - public TCloseOperationReq() { - } - - public TCloseOperationReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TCloseOperationReq(TCloseOperationReq other) { - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TCloseOperationReq deepCopy() { - return new TCloseOperationReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCloseOperationReq) - return this.equals((TCloseOperationReq)that); - return false; - } - - public boolean equals(TCloseOperationReq that) { - if (that == null) - return false; - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - return builder.toHashCode(); - } - - public int compareTo(TCloseOperationReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TCloseOperationReq typedOther = (TCloseOperationReq)other; - - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCloseOperationReq("); - boolean first = true; - - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCloseOperationReqStandardSchemeFactory implements SchemeFactory { - public TCloseOperationReqStandardScheme getScheme() { - return new TCloseOperationReqStandardScheme(); - } - } - - private static class TCloseOperationReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseOperationReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCloseOperationReqTupleSchemeFactory implements SchemeFactory { - public TCloseOperationReqTupleScheme getScheme() { - return new TCloseOperationReqTupleScheme(); - } - } - - private static class TCloseOperationReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.operationHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCloseOperationResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCloseOperationResp.java deleted file mode 100644 index 7334d67173d7b..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCloseOperationResp.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TCloseOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCloseOperationRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCloseOperationRespTupleSchemeFactory()); - } - - private TStatus status; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationResp.class, metaDataMap); - } - - public TCloseOperationResp() { - } - - public TCloseOperationResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TCloseOperationResp(TCloseOperationResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TCloseOperationResp deepCopy() { - return new TCloseOperationResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCloseOperationResp) - return this.equals((TCloseOperationResp)that); - return false; - } - - public boolean equals(TCloseOperationResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - return builder.toHashCode(); - } - - public int compareTo(TCloseOperationResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TCloseOperationResp typedOther = (TCloseOperationResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCloseOperationResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCloseOperationRespStandardSchemeFactory implements SchemeFactory { - public TCloseOperationRespStandardScheme getScheme() { - return new TCloseOperationRespStandardScheme(); - } - } - - private static class TCloseOperationRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseOperationResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCloseOperationRespTupleSchemeFactory implements SchemeFactory { - public TCloseOperationRespTupleScheme getScheme() { - return new TCloseOperationRespTupleScheme(); - } - } - - private static class TCloseOperationRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCloseSessionReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCloseSessionReq.java deleted file mode 100644 index 027e8295436b0..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCloseSessionReq.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TCloseSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCloseSessionReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCloseSessionReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionReq.class, metaDataMap); - } - - public TCloseSessionReq() { - } - - public TCloseSessionReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TCloseSessionReq(TCloseSessionReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - } - - public TCloseSessionReq deepCopy() { - return new TCloseSessionReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCloseSessionReq) - return this.equals((TCloseSessionReq)that); - return false; - } - - public boolean equals(TCloseSessionReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - return builder.toHashCode(); - } - - public int compareTo(TCloseSessionReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TCloseSessionReq typedOther = (TCloseSessionReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCloseSessionReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCloseSessionReqStandardSchemeFactory implements SchemeFactory { - public TCloseSessionReqStandardScheme getScheme() { - return new TCloseSessionReqStandardScheme(); - } - } - - private static class TCloseSessionReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseSessionReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCloseSessionReqTupleSchemeFactory implements SchemeFactory { - public TCloseSessionReqTupleScheme getScheme() { - return new TCloseSessionReqTupleScheme(); - } - } - - private static class TCloseSessionReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCloseSessionResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCloseSessionResp.java deleted file mode 100644 index 168c8fc775e33..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TCloseSessionResp.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TCloseSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCloseSessionRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCloseSessionRespTupleSchemeFactory()); - } - - private TStatus status; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionResp.class, metaDataMap); - } - - public TCloseSessionResp() { - } - - public TCloseSessionResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TCloseSessionResp(TCloseSessionResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TCloseSessionResp deepCopy() { - return new TCloseSessionResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCloseSessionResp) - return this.equals((TCloseSessionResp)that); - return false; - } - - public boolean equals(TCloseSessionResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - return builder.toHashCode(); - } - - public int compareTo(TCloseSessionResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TCloseSessionResp typedOther = (TCloseSessionResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCloseSessionResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCloseSessionRespStandardSchemeFactory implements SchemeFactory { - public TCloseSessionRespStandardScheme getScheme() { - return new TCloseSessionRespStandardScheme(); - } - } - - private static class TCloseSessionRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseSessionResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCloseSessionRespTupleSchemeFactory implements SchemeFactory { - public TCloseSessionRespTupleScheme getScheme() { - return new TCloseSessionRespTupleScheme(); - } - } - - private static class TCloseSessionRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TColumn.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TColumn.java deleted file mode 100644 index fc2171dc99e4c..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TColumn.java +++ /dev/null @@ -1,732 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TColumn extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn"); - private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField BYTE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("byteVal", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField I16_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i16Val", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField I32_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Val", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField I64_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i64Val", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.protocol.TField DOUBLE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleVal", org.apache.thrift.protocol.TType.STRUCT, (short)6); - private static final org.apache.thrift.protocol.TField STRING_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("stringVal", org.apache.thrift.protocol.TType.STRUCT, (short)7); - private static final org.apache.thrift.protocol.TField BINARY_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryVal", org.apache.thrift.protocol.TType.STRUCT, (short)8); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - BOOL_VAL((short)1, "boolVal"), - BYTE_VAL((short)2, "byteVal"), - I16_VAL((short)3, "i16Val"), - I32_VAL((short)4, "i32Val"), - I64_VAL((short)5, "i64Val"), - DOUBLE_VAL((short)6, "doubleVal"), - STRING_VAL((short)7, "stringVal"), - BINARY_VAL((short)8, "binaryVal"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // BOOL_VAL - return BOOL_VAL; - case 2: // BYTE_VAL - return BYTE_VAL; - case 3: // I16_VAL - return I16_VAL; - case 4: // I32_VAL - return I32_VAL; - case 5: // I64_VAL - return I64_VAL; - case 6: // DOUBLE_VAL - return DOUBLE_VAL; - case 7: // STRING_VAL - return STRING_VAL; - case 8: // BINARY_VAL - return BINARY_VAL; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolColumn.class))); - tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteColumn.class))); - tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Column.class))); - tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Column.class))); - tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Column.class))); - tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleColumn.class))); - tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringColumn.class))); - tmpMap.put(_Fields.BINARY_VAL, new org.apache.thrift.meta_data.FieldMetaData("binaryVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBinaryColumn.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumn.class, metaDataMap); - } - - public TColumn() { - super(); - } - - public TColumn(TColumn._Fields setField, Object value) { - super(setField, value); - } - - public TColumn(TColumn other) { - super(other); - } - public TColumn deepCopy() { - return new TColumn(this); - } - - public static TColumn boolVal(TBoolColumn value) { - TColumn x = new TColumn(); - x.setBoolVal(value); - return x; - } - - public static TColumn byteVal(TByteColumn value) { - TColumn x = new TColumn(); - x.setByteVal(value); - return x; - } - - public static TColumn i16Val(TI16Column value) { - TColumn x = new TColumn(); - x.setI16Val(value); - return x; - } - - public static TColumn i32Val(TI32Column value) { - TColumn x = new TColumn(); - x.setI32Val(value); - return x; - } - - public static TColumn i64Val(TI64Column value) { - TColumn x = new TColumn(); - x.setI64Val(value); - return x; - } - - public static TColumn doubleVal(TDoubleColumn value) { - TColumn x = new TColumn(); - x.setDoubleVal(value); - return x; - } - - public static TColumn stringVal(TStringColumn value) { - TColumn x = new TColumn(); - x.setStringVal(value); - return x; - } - - public static TColumn binaryVal(TBinaryColumn value) { - TColumn x = new TColumn(); - x.setBinaryVal(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case BOOL_VAL: - if (value instanceof TBoolColumn) { - break; - } - throw new ClassCastException("Was expecting value of type TBoolColumn for field 'boolVal', but got " + value.getClass().getSimpleName()); - case BYTE_VAL: - if (value instanceof TByteColumn) { - break; - } - throw new ClassCastException("Was expecting value of type TByteColumn for field 'byteVal', but got " + value.getClass().getSimpleName()); - case I16_VAL: - if (value instanceof TI16Column) { - break; - } - throw new ClassCastException("Was expecting value of type TI16Column for field 'i16Val', but got " + value.getClass().getSimpleName()); - case I32_VAL: - if (value instanceof TI32Column) { - break; - } - throw new ClassCastException("Was expecting value of type TI32Column for field 'i32Val', but got " + value.getClass().getSimpleName()); - case I64_VAL: - if (value instanceof TI64Column) { - break; - } - throw new ClassCastException("Was expecting value of type TI64Column for field 'i64Val', but got " + value.getClass().getSimpleName()); - case DOUBLE_VAL: - if (value instanceof TDoubleColumn) { - break; - } - throw new ClassCastException("Was expecting value of type TDoubleColumn for field 'doubleVal', but got " + value.getClass().getSimpleName()); - case STRING_VAL: - if (value instanceof TStringColumn) { - break; - } - throw new ClassCastException("Was expecting value of type TStringColumn for field 'stringVal', but got " + value.getClass().getSimpleName()); - case BINARY_VAL: - if (value instanceof TBinaryColumn) { - break; - } - throw new ClassCastException("Was expecting value of type TBinaryColumn for field 'binaryVal', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case BOOL_VAL: - if (field.type == BOOL_VAL_FIELD_DESC.type) { - TBoolColumn boolVal; - boolVal = new TBoolColumn(); - boolVal.read(iprot); - return boolVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BYTE_VAL: - if (field.type == BYTE_VAL_FIELD_DESC.type) { - TByteColumn byteVal; - byteVal = new TByteColumn(); - byteVal.read(iprot); - return byteVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I16_VAL: - if (field.type == I16_VAL_FIELD_DESC.type) { - TI16Column i16Val; - i16Val = new TI16Column(); - i16Val.read(iprot); - return i16Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I32_VAL: - if (field.type == I32_VAL_FIELD_DESC.type) { - TI32Column i32Val; - i32Val = new TI32Column(); - i32Val.read(iprot); - return i32Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I64_VAL: - if (field.type == I64_VAL_FIELD_DESC.type) { - TI64Column i64Val; - i64Val = new TI64Column(); - i64Val.read(iprot); - return i64Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case DOUBLE_VAL: - if (field.type == DOUBLE_VAL_FIELD_DESC.type) { - TDoubleColumn doubleVal; - doubleVal = new TDoubleColumn(); - doubleVal.read(iprot); - return doubleVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRING_VAL: - if (field.type == STRING_VAL_FIELD_DESC.type) { - TStringColumn stringVal; - stringVal = new TStringColumn(); - stringVal.read(iprot); - return stringVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BINARY_VAL: - if (field.type == BINARY_VAL_FIELD_DESC.type) { - TBinaryColumn binaryVal; - binaryVal = new TBinaryColumn(); - binaryVal.read(iprot); - return binaryVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_VAL: - TBoolColumn boolVal = (TBoolColumn)value_; - boolVal.write(oprot); - return; - case BYTE_VAL: - TByteColumn byteVal = (TByteColumn)value_; - byteVal.write(oprot); - return; - case I16_VAL: - TI16Column i16Val = (TI16Column)value_; - i16Val.write(oprot); - return; - case I32_VAL: - TI32Column i32Val = (TI32Column)value_; - i32Val.write(oprot); - return; - case I64_VAL: - TI64Column i64Val = (TI64Column)value_; - i64Val.write(oprot); - return; - case DOUBLE_VAL: - TDoubleColumn doubleVal = (TDoubleColumn)value_; - doubleVal.write(oprot); - return; - case STRING_VAL: - TStringColumn stringVal = (TStringColumn)value_; - stringVal.write(oprot); - return; - case BINARY_VAL: - TBinaryColumn binaryVal = (TBinaryColumn)value_; - binaryVal.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case BOOL_VAL: - TBoolColumn boolVal; - boolVal = new TBoolColumn(); - boolVal.read(iprot); - return boolVal; - case BYTE_VAL: - TByteColumn byteVal; - byteVal = new TByteColumn(); - byteVal.read(iprot); - return byteVal; - case I16_VAL: - TI16Column i16Val; - i16Val = new TI16Column(); - i16Val.read(iprot); - return i16Val; - case I32_VAL: - TI32Column i32Val; - i32Val = new TI32Column(); - i32Val.read(iprot); - return i32Val; - case I64_VAL: - TI64Column i64Val; - i64Val = new TI64Column(); - i64Val.read(iprot); - return i64Val; - case DOUBLE_VAL: - TDoubleColumn doubleVal; - doubleVal = new TDoubleColumn(); - doubleVal.read(iprot); - return doubleVal; - case STRING_VAL: - TStringColumn stringVal; - stringVal = new TStringColumn(); - stringVal.read(iprot); - return stringVal; - case BINARY_VAL: - TBinaryColumn binaryVal; - binaryVal = new TBinaryColumn(); - binaryVal.read(iprot); - return binaryVal; - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_VAL: - TBoolColumn boolVal = (TBoolColumn)value_; - boolVal.write(oprot); - return; - case BYTE_VAL: - TByteColumn byteVal = (TByteColumn)value_; - byteVal.write(oprot); - return; - case I16_VAL: - TI16Column i16Val = (TI16Column)value_; - i16Val.write(oprot); - return; - case I32_VAL: - TI32Column i32Val = (TI32Column)value_; - i32Val.write(oprot); - return; - case I64_VAL: - TI64Column i64Val = (TI64Column)value_; - i64Val.write(oprot); - return; - case DOUBLE_VAL: - TDoubleColumn doubleVal = (TDoubleColumn)value_; - doubleVal.write(oprot); - return; - case STRING_VAL: - TStringColumn stringVal = (TStringColumn)value_; - stringVal.write(oprot); - return; - case BINARY_VAL: - TBinaryColumn binaryVal = (TBinaryColumn)value_; - binaryVal.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case BOOL_VAL: - return BOOL_VAL_FIELD_DESC; - case BYTE_VAL: - return BYTE_VAL_FIELD_DESC; - case I16_VAL: - return I16_VAL_FIELD_DESC; - case I32_VAL: - return I32_VAL_FIELD_DESC; - case I64_VAL: - return I64_VAL_FIELD_DESC; - case DOUBLE_VAL: - return DOUBLE_VAL_FIELD_DESC; - case STRING_VAL: - return STRING_VAL_FIELD_DESC; - case BINARY_VAL: - return BINARY_VAL_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public TBoolColumn getBoolVal() { - if (getSetField() == _Fields.BOOL_VAL) { - return (TBoolColumn)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBoolVal(TBoolColumn value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BOOL_VAL; - value_ = value; - } - - public TByteColumn getByteVal() { - if (getSetField() == _Fields.BYTE_VAL) { - return (TByteColumn)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setByteVal(TByteColumn value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BYTE_VAL; - value_ = value; - } - - public TI16Column getI16Val() { - if (getSetField() == _Fields.I16_VAL) { - return (TI16Column)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI16Val(TI16Column value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I16_VAL; - value_ = value; - } - - public TI32Column getI32Val() { - if (getSetField() == _Fields.I32_VAL) { - return (TI32Column)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI32Val(TI32Column value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I32_VAL; - value_ = value; - } - - public TI64Column getI64Val() { - if (getSetField() == _Fields.I64_VAL) { - return (TI64Column)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI64Val(TI64Column value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I64_VAL; - value_ = value; - } - - public TDoubleColumn getDoubleVal() { - if (getSetField() == _Fields.DOUBLE_VAL) { - return (TDoubleColumn)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setDoubleVal(TDoubleColumn value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.DOUBLE_VAL; - value_ = value; - } - - public TStringColumn getStringVal() { - if (getSetField() == _Fields.STRING_VAL) { - return (TStringColumn)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringVal(TStringColumn value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.STRING_VAL; - value_ = value; - } - - public TBinaryColumn getBinaryVal() { - if (getSetField() == _Fields.BINARY_VAL) { - return (TBinaryColumn)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'binaryVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBinaryVal(TBinaryColumn value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BINARY_VAL; - value_ = value; - } - - public boolean isSetBoolVal() { - return setField_ == _Fields.BOOL_VAL; - } - - - public boolean isSetByteVal() { - return setField_ == _Fields.BYTE_VAL; - } - - - public boolean isSetI16Val() { - return setField_ == _Fields.I16_VAL; - } - - - public boolean isSetI32Val() { - return setField_ == _Fields.I32_VAL; - } - - - public boolean isSetI64Val() { - return setField_ == _Fields.I64_VAL; - } - - - public boolean isSetDoubleVal() { - return setField_ == _Fields.DOUBLE_VAL; - } - - - public boolean isSetStringVal() { - return setField_ == _Fields.STRING_VAL; - } - - - public boolean isSetBinaryVal() { - return setField_ == _Fields.BINARY_VAL; - } - - - public boolean equals(Object other) { - if (other instanceof TColumn) { - return equals((TColumn)other); - } else { - return false; - } - } - - public boolean equals(TColumn other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TColumn other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - HashCodeBuilder hcb = new HashCodeBuilder(); - hcb.append(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - hcb.append(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - hcb.append(value); - } - } - return hcb.toHashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TColumnDesc.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TColumnDesc.java deleted file mode 100644 index 247db6489457f..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TColumnDesc.java +++ /dev/null @@ -1,700 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TColumnDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnDesc"); - - private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField TYPE_DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("typeDesc", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField POSITION_FIELD_DESC = new org.apache.thrift.protocol.TField("position", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TColumnDescStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TColumnDescTupleSchemeFactory()); - } - - private String columnName; // required - private TTypeDesc typeDesc; // required - private int position; // required - private String comment; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - COLUMN_NAME((short)1, "columnName"), - TYPE_DESC((short)2, "typeDesc"), - POSITION((short)3, "position"), - COMMENT((short)4, "comment"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // COLUMN_NAME - return COLUMN_NAME; - case 2: // TYPE_DESC - return TYPE_DESC; - case 3: // POSITION - return POSITION; - case 4: // COMMENT - return COMMENT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __POSITION_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.COMMENT}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TYPE_DESC, new org.apache.thrift.meta_data.FieldMetaData("typeDesc", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeDesc.class))); - tmpMap.put(_Fields.POSITION, new org.apache.thrift.meta_data.FieldMetaData("position", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnDesc.class, metaDataMap); - } - - public TColumnDesc() { - } - - public TColumnDesc( - String columnName, - TTypeDesc typeDesc, - int position) - { - this(); - this.columnName = columnName; - this.typeDesc = typeDesc; - this.position = position; - setPositionIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TColumnDesc(TColumnDesc other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetColumnName()) { - this.columnName = other.columnName; - } - if (other.isSetTypeDesc()) { - this.typeDesc = new TTypeDesc(other.typeDesc); - } - this.position = other.position; - if (other.isSetComment()) { - this.comment = other.comment; - } - } - - public TColumnDesc deepCopy() { - return new TColumnDesc(this); - } - - @Override - public void clear() { - this.columnName = null; - this.typeDesc = null; - setPositionIsSet(false); - this.position = 0; - this.comment = null; - } - - public String getColumnName() { - return this.columnName; - } - - public void setColumnName(String columnName) { - this.columnName = columnName; - } - - public void unsetColumnName() { - this.columnName = null; - } - - /** Returns true if field columnName is set (has been assigned a value) and false otherwise */ - public boolean isSetColumnName() { - return this.columnName != null; - } - - public void setColumnNameIsSet(boolean value) { - if (!value) { - this.columnName = null; - } - } - - public TTypeDesc getTypeDesc() { - return this.typeDesc; - } - - public void setTypeDesc(TTypeDesc typeDesc) { - this.typeDesc = typeDesc; - } - - public void unsetTypeDesc() { - this.typeDesc = null; - } - - /** Returns true if field typeDesc is set (has been assigned a value) and false otherwise */ - public boolean isSetTypeDesc() { - return this.typeDesc != null; - } - - public void setTypeDescIsSet(boolean value) { - if (!value) { - this.typeDesc = null; - } - } - - public int getPosition() { - return this.position; - } - - public void setPosition(int position) { - this.position = position; - setPositionIsSet(true); - } - - public void unsetPosition() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __POSITION_ISSET_ID); - } - - /** Returns true if field position is set (has been assigned a value) and false otherwise */ - public boolean isSetPosition() { - return EncodingUtils.testBit(__isset_bitfield, __POSITION_ISSET_ID); - } - - public void setPositionIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __POSITION_ISSET_ID, value); - } - - public String getComment() { - return this.comment; - } - - public void setComment(String comment) { - this.comment = comment; - } - - public void unsetComment() { - this.comment = null; - } - - /** Returns true if field comment is set (has been assigned a value) and false otherwise */ - public boolean isSetComment() { - return this.comment != null; - } - - public void setCommentIsSet(boolean value) { - if (!value) { - this.comment = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case COLUMN_NAME: - if (value == null) { - unsetColumnName(); - } else { - setColumnName((String)value); - } - break; - - case TYPE_DESC: - if (value == null) { - unsetTypeDesc(); - } else { - setTypeDesc((TTypeDesc)value); - } - break; - - case POSITION: - if (value == null) { - unsetPosition(); - } else { - setPosition((Integer)value); - } - break; - - case COMMENT: - if (value == null) { - unsetComment(); - } else { - setComment((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case COLUMN_NAME: - return getColumnName(); - - case TYPE_DESC: - return getTypeDesc(); - - case POSITION: - return Integer.valueOf(getPosition()); - - case COMMENT: - return getComment(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case COLUMN_NAME: - return isSetColumnName(); - case TYPE_DESC: - return isSetTypeDesc(); - case POSITION: - return isSetPosition(); - case COMMENT: - return isSetComment(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TColumnDesc) - return this.equals((TColumnDesc)that); - return false; - } - - public boolean equals(TColumnDesc that) { - if (that == null) - return false; - - boolean this_present_columnName = true && this.isSetColumnName(); - boolean that_present_columnName = true && that.isSetColumnName(); - if (this_present_columnName || that_present_columnName) { - if (!(this_present_columnName && that_present_columnName)) - return false; - if (!this.columnName.equals(that.columnName)) - return false; - } - - boolean this_present_typeDesc = true && this.isSetTypeDesc(); - boolean that_present_typeDesc = true && that.isSetTypeDesc(); - if (this_present_typeDesc || that_present_typeDesc) { - if (!(this_present_typeDesc && that_present_typeDesc)) - return false; - if (!this.typeDesc.equals(that.typeDesc)) - return false; - } - - boolean this_present_position = true; - boolean that_present_position = true; - if (this_present_position || that_present_position) { - if (!(this_present_position && that_present_position)) - return false; - if (this.position != that.position) - return false; - } - - boolean this_present_comment = true && this.isSetComment(); - boolean that_present_comment = true && that.isSetComment(); - if (this_present_comment || that_present_comment) { - if (!(this_present_comment && that_present_comment)) - return false; - if (!this.comment.equals(that.comment)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_columnName = true && (isSetColumnName()); - builder.append(present_columnName); - if (present_columnName) - builder.append(columnName); - - boolean present_typeDesc = true && (isSetTypeDesc()); - builder.append(present_typeDesc); - if (present_typeDesc) - builder.append(typeDesc); - - boolean present_position = true; - builder.append(present_position); - if (present_position) - builder.append(position); - - boolean present_comment = true && (isSetComment()); - builder.append(present_comment); - if (present_comment) - builder.append(comment); - - return builder.toHashCode(); - } - - public int compareTo(TColumnDesc other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TColumnDesc typedOther = (TColumnDesc)other; - - lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(typedOther.isSetColumnName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumnName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnName, typedOther.columnName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTypeDesc()).compareTo(typedOther.isSetTypeDesc()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTypeDesc()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeDesc, typedOther.typeDesc); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPosition()).compareTo(typedOther.isSetPosition()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPosition()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.position, typedOther.position); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetComment()).compareTo(typedOther.isSetComment()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetComment()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.comment, typedOther.comment); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TColumnDesc("); - boolean first = true; - - sb.append("columnName:"); - if (this.columnName == null) { - sb.append("null"); - } else { - sb.append(this.columnName); - } - first = false; - if (!first) sb.append(", "); - sb.append("typeDesc:"); - if (this.typeDesc == null) { - sb.append("null"); - } else { - sb.append(this.typeDesc); - } - first = false; - if (!first) sb.append(", "); - sb.append("position:"); - sb.append(this.position); - first = false; - if (isSetComment()) { - if (!first) sb.append(", "); - sb.append("comment:"); - if (this.comment == null) { - sb.append("null"); - } else { - sb.append(this.comment); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetColumnName()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnName' is unset! Struct:" + toString()); - } - - if (!isSetTypeDesc()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeDesc' is unset! Struct:" + toString()); - } - - if (!isSetPosition()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'position' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (typeDesc != null) { - typeDesc.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TColumnDescStandardSchemeFactory implements SchemeFactory { - public TColumnDescStandardScheme getScheme() { - return new TColumnDescStandardScheme(); - } - } - - private static class TColumnDescStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TColumnDesc struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // COLUMN_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.columnName = iprot.readString(); - struct.setColumnNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // TYPE_DESC - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.typeDesc = new TTypeDesc(); - struct.typeDesc.read(iprot); - struct.setTypeDescIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // POSITION - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.position = iprot.readI32(); - struct.setPositionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // COMMENT - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.comment = iprot.readString(); - struct.setCommentIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TColumnDesc struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.columnName != null) { - oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); - oprot.writeString(struct.columnName); - oprot.writeFieldEnd(); - } - if (struct.typeDesc != null) { - oprot.writeFieldBegin(TYPE_DESC_FIELD_DESC); - struct.typeDesc.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(POSITION_FIELD_DESC); - oprot.writeI32(struct.position); - oprot.writeFieldEnd(); - if (struct.comment != null) { - if (struct.isSetComment()) { - oprot.writeFieldBegin(COMMENT_FIELD_DESC); - oprot.writeString(struct.comment); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TColumnDescTupleSchemeFactory implements SchemeFactory { - public TColumnDescTupleScheme getScheme() { - return new TColumnDescTupleScheme(); - } - } - - private static class TColumnDescTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeString(struct.columnName); - struct.typeDesc.write(oprot); - oprot.writeI32(struct.position); - BitSet optionals = new BitSet(); - if (struct.isSetComment()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetComment()) { - oprot.writeString(struct.comment); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.columnName = iprot.readString(); - struct.setColumnNameIsSet(true); - struct.typeDesc = new TTypeDesc(); - struct.typeDesc.read(iprot); - struct.setTypeDescIsSet(true); - struct.position = iprot.readI32(); - struct.setPositionIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.comment = iprot.readString(); - struct.setCommentIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TColumnValue.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TColumnValue.java deleted file mode 100644 index 8504c6d608d42..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TColumnValue.java +++ /dev/null @@ -1,671 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TColumnValue extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnValue"); - private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField BYTE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("byteVal", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField I16_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i16Val", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField I32_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Val", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField I64_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i64Val", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.protocol.TField DOUBLE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleVal", org.apache.thrift.protocol.TType.STRUCT, (short)6); - private static final org.apache.thrift.protocol.TField STRING_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("stringVal", org.apache.thrift.protocol.TType.STRUCT, (short)7); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - BOOL_VAL((short)1, "boolVal"), - BYTE_VAL((short)2, "byteVal"), - I16_VAL((short)3, "i16Val"), - I32_VAL((short)4, "i32Val"), - I64_VAL((short)5, "i64Val"), - DOUBLE_VAL((short)6, "doubleVal"), - STRING_VAL((short)7, "stringVal"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // BOOL_VAL - return BOOL_VAL; - case 2: // BYTE_VAL - return BYTE_VAL; - case 3: // I16_VAL - return I16_VAL; - case 4: // I32_VAL - return I32_VAL; - case 5: // I64_VAL - return I64_VAL; - case 6: // DOUBLE_VAL - return DOUBLE_VAL; - case 7: // STRING_VAL - return STRING_VAL; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolValue.class))); - tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteValue.class))); - tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Value.class))); - tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Value.class))); - tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Value.class))); - tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleValue.class))); - tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringValue.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnValue.class, metaDataMap); - } - - public TColumnValue() { - super(); - } - - public TColumnValue(TColumnValue._Fields setField, Object value) { - super(setField, value); - } - - public TColumnValue(TColumnValue other) { - super(other); - } - public TColumnValue deepCopy() { - return new TColumnValue(this); - } - - public static TColumnValue boolVal(TBoolValue value) { - TColumnValue x = new TColumnValue(); - x.setBoolVal(value); - return x; - } - - public static TColumnValue byteVal(TByteValue value) { - TColumnValue x = new TColumnValue(); - x.setByteVal(value); - return x; - } - - public static TColumnValue i16Val(TI16Value value) { - TColumnValue x = new TColumnValue(); - x.setI16Val(value); - return x; - } - - public static TColumnValue i32Val(TI32Value value) { - TColumnValue x = new TColumnValue(); - x.setI32Val(value); - return x; - } - - public static TColumnValue i64Val(TI64Value value) { - TColumnValue x = new TColumnValue(); - x.setI64Val(value); - return x; - } - - public static TColumnValue doubleVal(TDoubleValue value) { - TColumnValue x = new TColumnValue(); - x.setDoubleVal(value); - return x; - } - - public static TColumnValue stringVal(TStringValue value) { - TColumnValue x = new TColumnValue(); - x.setStringVal(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case BOOL_VAL: - if (value instanceof TBoolValue) { - break; - } - throw new ClassCastException("Was expecting value of type TBoolValue for field 'boolVal', but got " + value.getClass().getSimpleName()); - case BYTE_VAL: - if (value instanceof TByteValue) { - break; - } - throw new ClassCastException("Was expecting value of type TByteValue for field 'byteVal', but got " + value.getClass().getSimpleName()); - case I16_VAL: - if (value instanceof TI16Value) { - break; - } - throw new ClassCastException("Was expecting value of type TI16Value for field 'i16Val', but got " + value.getClass().getSimpleName()); - case I32_VAL: - if (value instanceof TI32Value) { - break; - } - throw new ClassCastException("Was expecting value of type TI32Value for field 'i32Val', but got " + value.getClass().getSimpleName()); - case I64_VAL: - if (value instanceof TI64Value) { - break; - } - throw new ClassCastException("Was expecting value of type TI64Value for field 'i64Val', but got " + value.getClass().getSimpleName()); - case DOUBLE_VAL: - if (value instanceof TDoubleValue) { - break; - } - throw new ClassCastException("Was expecting value of type TDoubleValue for field 'doubleVal', but got " + value.getClass().getSimpleName()); - case STRING_VAL: - if (value instanceof TStringValue) { - break; - } - throw new ClassCastException("Was expecting value of type TStringValue for field 'stringVal', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case BOOL_VAL: - if (field.type == BOOL_VAL_FIELD_DESC.type) { - TBoolValue boolVal; - boolVal = new TBoolValue(); - boolVal.read(iprot); - return boolVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BYTE_VAL: - if (field.type == BYTE_VAL_FIELD_DESC.type) { - TByteValue byteVal; - byteVal = new TByteValue(); - byteVal.read(iprot); - return byteVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I16_VAL: - if (field.type == I16_VAL_FIELD_DESC.type) { - TI16Value i16Val; - i16Val = new TI16Value(); - i16Val.read(iprot); - return i16Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I32_VAL: - if (field.type == I32_VAL_FIELD_DESC.type) { - TI32Value i32Val; - i32Val = new TI32Value(); - i32Val.read(iprot); - return i32Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I64_VAL: - if (field.type == I64_VAL_FIELD_DESC.type) { - TI64Value i64Val; - i64Val = new TI64Value(); - i64Val.read(iprot); - return i64Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case DOUBLE_VAL: - if (field.type == DOUBLE_VAL_FIELD_DESC.type) { - TDoubleValue doubleVal; - doubleVal = new TDoubleValue(); - doubleVal.read(iprot); - return doubleVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRING_VAL: - if (field.type == STRING_VAL_FIELD_DESC.type) { - TStringValue stringVal; - stringVal = new TStringValue(); - stringVal.read(iprot); - return stringVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_VAL: - TBoolValue boolVal = (TBoolValue)value_; - boolVal.write(oprot); - return; - case BYTE_VAL: - TByteValue byteVal = (TByteValue)value_; - byteVal.write(oprot); - return; - case I16_VAL: - TI16Value i16Val = (TI16Value)value_; - i16Val.write(oprot); - return; - case I32_VAL: - TI32Value i32Val = (TI32Value)value_; - i32Val.write(oprot); - return; - case I64_VAL: - TI64Value i64Val = (TI64Value)value_; - i64Val.write(oprot); - return; - case DOUBLE_VAL: - TDoubleValue doubleVal = (TDoubleValue)value_; - doubleVal.write(oprot); - return; - case STRING_VAL: - TStringValue stringVal = (TStringValue)value_; - stringVal.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case BOOL_VAL: - TBoolValue boolVal; - boolVal = new TBoolValue(); - boolVal.read(iprot); - return boolVal; - case BYTE_VAL: - TByteValue byteVal; - byteVal = new TByteValue(); - byteVal.read(iprot); - return byteVal; - case I16_VAL: - TI16Value i16Val; - i16Val = new TI16Value(); - i16Val.read(iprot); - return i16Val; - case I32_VAL: - TI32Value i32Val; - i32Val = new TI32Value(); - i32Val.read(iprot); - return i32Val; - case I64_VAL: - TI64Value i64Val; - i64Val = new TI64Value(); - i64Val.read(iprot); - return i64Val; - case DOUBLE_VAL: - TDoubleValue doubleVal; - doubleVal = new TDoubleValue(); - doubleVal.read(iprot); - return doubleVal; - case STRING_VAL: - TStringValue stringVal; - stringVal = new TStringValue(); - stringVal.read(iprot); - return stringVal; - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_VAL: - TBoolValue boolVal = (TBoolValue)value_; - boolVal.write(oprot); - return; - case BYTE_VAL: - TByteValue byteVal = (TByteValue)value_; - byteVal.write(oprot); - return; - case I16_VAL: - TI16Value i16Val = (TI16Value)value_; - i16Val.write(oprot); - return; - case I32_VAL: - TI32Value i32Val = (TI32Value)value_; - i32Val.write(oprot); - return; - case I64_VAL: - TI64Value i64Val = (TI64Value)value_; - i64Val.write(oprot); - return; - case DOUBLE_VAL: - TDoubleValue doubleVal = (TDoubleValue)value_; - doubleVal.write(oprot); - return; - case STRING_VAL: - TStringValue stringVal = (TStringValue)value_; - stringVal.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case BOOL_VAL: - return BOOL_VAL_FIELD_DESC; - case BYTE_VAL: - return BYTE_VAL_FIELD_DESC; - case I16_VAL: - return I16_VAL_FIELD_DESC; - case I32_VAL: - return I32_VAL_FIELD_DESC; - case I64_VAL: - return I64_VAL_FIELD_DESC; - case DOUBLE_VAL: - return DOUBLE_VAL_FIELD_DESC; - case STRING_VAL: - return STRING_VAL_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public TBoolValue getBoolVal() { - if (getSetField() == _Fields.BOOL_VAL) { - return (TBoolValue)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBoolVal(TBoolValue value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BOOL_VAL; - value_ = value; - } - - public TByteValue getByteVal() { - if (getSetField() == _Fields.BYTE_VAL) { - return (TByteValue)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setByteVal(TByteValue value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BYTE_VAL; - value_ = value; - } - - public TI16Value getI16Val() { - if (getSetField() == _Fields.I16_VAL) { - return (TI16Value)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI16Val(TI16Value value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I16_VAL; - value_ = value; - } - - public TI32Value getI32Val() { - if (getSetField() == _Fields.I32_VAL) { - return (TI32Value)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI32Val(TI32Value value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I32_VAL; - value_ = value; - } - - public TI64Value getI64Val() { - if (getSetField() == _Fields.I64_VAL) { - return (TI64Value)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI64Val(TI64Value value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I64_VAL; - value_ = value; - } - - public TDoubleValue getDoubleVal() { - if (getSetField() == _Fields.DOUBLE_VAL) { - return (TDoubleValue)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setDoubleVal(TDoubleValue value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.DOUBLE_VAL; - value_ = value; - } - - public TStringValue getStringVal() { - if (getSetField() == _Fields.STRING_VAL) { - return (TStringValue)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringVal(TStringValue value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.STRING_VAL; - value_ = value; - } - - public boolean isSetBoolVal() { - return setField_ == _Fields.BOOL_VAL; - } - - - public boolean isSetByteVal() { - return setField_ == _Fields.BYTE_VAL; - } - - - public boolean isSetI16Val() { - return setField_ == _Fields.I16_VAL; - } - - - public boolean isSetI32Val() { - return setField_ == _Fields.I32_VAL; - } - - - public boolean isSetI64Val() { - return setField_ == _Fields.I64_VAL; - } - - - public boolean isSetDoubleVal() { - return setField_ == _Fields.DOUBLE_VAL; - } - - - public boolean isSetStringVal() { - return setField_ == _Fields.STRING_VAL; - } - - - public boolean equals(Object other) { - if (other instanceof TColumnValue) { - return equals((TColumnValue)other); - } else { - return false; - } - } - - public boolean equals(TColumnValue other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TColumnValue other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - HashCodeBuilder hcb = new HashCodeBuilder(); - hcb.append(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - hcb.append(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - hcb.append(value); - } - } - return hcb.toHashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TDoubleColumn.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TDoubleColumn.java deleted file mode 100644 index 4fc54544c1bea..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TDoubleColumn.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TDoubleColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TDoubleColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TDoubleColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleColumn.class, metaDataMap); - } - - public TDoubleColumn() { - } - - public TDoubleColumn( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = nulls; - } - - /** - * Performs a deep copy on other. - */ - public TDoubleColumn(TDoubleColumn other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(); - for (Double other_element : other.values) { - __this__values.add(other_element); - } - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); -; - } - } - - public TDoubleColumn deepCopy() { - return new TDoubleColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(double elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return nulls; - } - - public void setNulls(byte[] nulls) { - setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = nulls; - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TDoubleColumn) - return this.equals((TDoubleColumn)that); - return false; - } - - public boolean equals(TDoubleColumn that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_values = true && (isSetValues()); - builder.append(present_values); - if (present_values) - builder.append(values); - - boolean present_nulls = true && (isSetNulls()); - builder.append(present_nulls); - if (present_nulls) - builder.append(nulls); - - return builder.toHashCode(); - } - - public int compareTo(TDoubleColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TDoubleColumn typedOther = (TDoubleColumn)other; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TDoubleColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TDoubleColumnStandardSchemeFactory implements SchemeFactory { - public TDoubleColumnStandardScheme getScheme() { - return new TDoubleColumnStandardScheme(); - } - } - - private static class TDoubleColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list94 = iprot.readListBegin(); - struct.values = new ArrayList(_list94.size); - for (int _i95 = 0; _i95 < _list94.size; ++_i95) - { - double _elem96; // optional - _elem96 = iprot.readDouble(); - struct.values.add(_elem96); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TDoubleColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, struct.values.size())); - for (double _iter97 : struct.values) - { - oprot.writeDouble(_iter97); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TDoubleColumnTupleSchemeFactory implements SchemeFactory { - public TDoubleColumnTupleScheme getScheme() { - return new TDoubleColumnTupleScheme(); - } - } - - private static class TDoubleColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (double _iter98 : struct.values) - { - oprot.writeDouble(_iter98); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list99 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); - struct.values = new ArrayList(_list99.size); - for (int _i100 = 0; _i100 < _list99.size; ++_i100) - { - double _elem101; // optional - _elem101 = iprot.readDouble(); - struct.values.add(_elem101); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TDoubleValue.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TDoubleValue.java deleted file mode 100644 index d21573633ef51..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TDoubleValue.java +++ /dev/null @@ -1,386 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TDoubleValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleValue"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.DOUBLE, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TDoubleValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TDoubleValueTupleSchemeFactory()); - } - - private double value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleValue.class, metaDataMap); - } - - public TDoubleValue() { - } - - /** - * Performs a deep copy on other. - */ - public TDoubleValue(TDoubleValue other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TDoubleValue deepCopy() { - return new TDoubleValue(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0.0; - } - - public double getValue() { - return this.value; - } - - public void setValue(double value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((Double)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return Double.valueOf(getValue()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TDoubleValue) - return this.equals((TDoubleValue)that); - return false; - } - - public boolean equals(TDoubleValue that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); - - return builder.toHashCode(); - } - - public int compareTo(TDoubleValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TDoubleValue typedOther = (TDoubleValue)other; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TDoubleValue("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TDoubleValueStandardSchemeFactory implements SchemeFactory { - public TDoubleValueStandardScheme getScheme() { - return new TDoubleValueStandardScheme(); - } - } - - private static class TDoubleValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.value = iprot.readDouble(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TDoubleValue struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeDouble(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TDoubleValueTupleSchemeFactory implements SchemeFactory { - public TDoubleValueTupleScheme getScheme() { - return new TDoubleValueTupleScheme(); - } - } - - private static class TDoubleValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeDouble(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readDouble(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TExecuteStatementReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TExecuteStatementReq.java deleted file mode 100644 index 4f157ad5a6450..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TExecuteStatementReq.java +++ /dev/null @@ -1,769 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TExecuteStatementReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField STATEMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("statement", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField CONF_OVERLAY_FIELD_DESC = new org.apache.thrift.protocol.TField("confOverlay", org.apache.thrift.protocol.TType.MAP, (short)3); - private static final org.apache.thrift.protocol.TField RUN_ASYNC_FIELD_DESC = new org.apache.thrift.protocol.TField("runAsync", org.apache.thrift.protocol.TType.BOOL, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TExecuteStatementReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TExecuteStatementReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String statement; // required - private Map confOverlay; // optional - private boolean runAsync; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - STATEMENT((short)2, "statement"), - CONF_OVERLAY((short)3, "confOverlay"), - RUN_ASYNC((short)4, "runAsync"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // STATEMENT - return STATEMENT; - case 3: // CONF_OVERLAY - return CONF_OVERLAY; - case 4: // RUN_ASYNC - return RUN_ASYNC; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __RUNASYNC_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.CONF_OVERLAY,_Fields.RUN_ASYNC}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.STATEMENT, new org.apache.thrift.meta_data.FieldMetaData("statement", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.CONF_OVERLAY, new org.apache.thrift.meta_data.FieldMetaData("confOverlay", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.RUN_ASYNC, new org.apache.thrift.meta_data.FieldMetaData("runAsync", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementReq.class, metaDataMap); - } - - public TExecuteStatementReq() { - this.runAsync = false; - - } - - public TExecuteStatementReq( - TSessionHandle sessionHandle, - String statement) - { - this(); - this.sessionHandle = sessionHandle; - this.statement = statement; - } - - /** - * Performs a deep copy on other. - */ - public TExecuteStatementReq(TExecuteStatementReq other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetStatement()) { - this.statement = other.statement; - } - if (other.isSetConfOverlay()) { - Map __this__confOverlay = new HashMap(); - for (Map.Entry other_element : other.confOverlay.entrySet()) { - - String other_element_key = other_element.getKey(); - String other_element_value = other_element.getValue(); - - String __this__confOverlay_copy_key = other_element_key; - - String __this__confOverlay_copy_value = other_element_value; - - __this__confOverlay.put(__this__confOverlay_copy_key, __this__confOverlay_copy_value); - } - this.confOverlay = __this__confOverlay; - } - this.runAsync = other.runAsync; - } - - public TExecuteStatementReq deepCopy() { - return new TExecuteStatementReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.statement = null; - this.confOverlay = null; - this.runAsync = false; - - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getStatement() { - return this.statement; - } - - public void setStatement(String statement) { - this.statement = statement; - } - - public void unsetStatement() { - this.statement = null; - } - - /** Returns true if field statement is set (has been assigned a value) and false otherwise */ - public boolean isSetStatement() { - return this.statement != null; - } - - public void setStatementIsSet(boolean value) { - if (!value) { - this.statement = null; - } - } - - public int getConfOverlaySize() { - return (this.confOverlay == null) ? 0 : this.confOverlay.size(); - } - - public void putToConfOverlay(String key, String val) { - if (this.confOverlay == null) { - this.confOverlay = new HashMap(); - } - this.confOverlay.put(key, val); - } - - public Map getConfOverlay() { - return this.confOverlay; - } - - public void setConfOverlay(Map confOverlay) { - this.confOverlay = confOverlay; - } - - public void unsetConfOverlay() { - this.confOverlay = null; - } - - /** Returns true if field confOverlay is set (has been assigned a value) and false otherwise */ - public boolean isSetConfOverlay() { - return this.confOverlay != null; - } - - public void setConfOverlayIsSet(boolean value) { - if (!value) { - this.confOverlay = null; - } - } - - public boolean isRunAsync() { - return this.runAsync; - } - - public void setRunAsync(boolean runAsync) { - this.runAsync = runAsync; - setRunAsyncIsSet(true); - } - - public void unsetRunAsync() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RUNASYNC_ISSET_ID); - } - - /** Returns true if field runAsync is set (has been assigned a value) and false otherwise */ - public boolean isSetRunAsync() { - return EncodingUtils.testBit(__isset_bitfield, __RUNASYNC_ISSET_ID); - } - - public void setRunAsyncIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RUNASYNC_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case STATEMENT: - if (value == null) { - unsetStatement(); - } else { - setStatement((String)value); - } - break; - - case CONF_OVERLAY: - if (value == null) { - unsetConfOverlay(); - } else { - setConfOverlay((Map)value); - } - break; - - case RUN_ASYNC: - if (value == null) { - unsetRunAsync(); - } else { - setRunAsync((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case STATEMENT: - return getStatement(); - - case CONF_OVERLAY: - return getConfOverlay(); - - case RUN_ASYNC: - return Boolean.valueOf(isRunAsync()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case STATEMENT: - return isSetStatement(); - case CONF_OVERLAY: - return isSetConfOverlay(); - case RUN_ASYNC: - return isSetRunAsync(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TExecuteStatementReq) - return this.equals((TExecuteStatementReq)that); - return false; - } - - public boolean equals(TExecuteStatementReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_statement = true && this.isSetStatement(); - boolean that_present_statement = true && that.isSetStatement(); - if (this_present_statement || that_present_statement) { - if (!(this_present_statement && that_present_statement)) - return false; - if (!this.statement.equals(that.statement)) - return false; - } - - boolean this_present_confOverlay = true && this.isSetConfOverlay(); - boolean that_present_confOverlay = true && that.isSetConfOverlay(); - if (this_present_confOverlay || that_present_confOverlay) { - if (!(this_present_confOverlay && that_present_confOverlay)) - return false; - if (!this.confOverlay.equals(that.confOverlay)) - return false; - } - - boolean this_present_runAsync = true && this.isSetRunAsync(); - boolean that_present_runAsync = true && that.isSetRunAsync(); - if (this_present_runAsync || that_present_runAsync) { - if (!(this_present_runAsync && that_present_runAsync)) - return false; - if (this.runAsync != that.runAsync) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - boolean present_statement = true && (isSetStatement()); - builder.append(present_statement); - if (present_statement) - builder.append(statement); - - boolean present_confOverlay = true && (isSetConfOverlay()); - builder.append(present_confOverlay); - if (present_confOverlay) - builder.append(confOverlay); - - boolean present_runAsync = true && (isSetRunAsync()); - builder.append(present_runAsync); - if (present_runAsync) - builder.append(runAsync); - - return builder.toHashCode(); - } - - public int compareTo(TExecuteStatementReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TExecuteStatementReq typedOther = (TExecuteStatementReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStatement()).compareTo(typedOther.isSetStatement()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatement()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statement, typedOther.statement); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetConfOverlay()).compareTo(typedOther.isSetConfOverlay()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConfOverlay()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.confOverlay, typedOther.confOverlay); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRunAsync()).compareTo(typedOther.isSetRunAsync()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRunAsync()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.runAsync, typedOther.runAsync); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TExecuteStatementReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("statement:"); - if (this.statement == null) { - sb.append("null"); - } else { - sb.append(this.statement); - } - first = false; - if (isSetConfOverlay()) { - if (!first) sb.append(", "); - sb.append("confOverlay:"); - if (this.confOverlay == null) { - sb.append("null"); - } else { - sb.append(this.confOverlay); - } - first = false; - } - if (isSetRunAsync()) { - if (!first) sb.append(", "); - sb.append("runAsync:"); - sb.append(this.runAsync); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - if (!isSetStatement()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'statement' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TExecuteStatementReqStandardSchemeFactory implements SchemeFactory { - public TExecuteStatementReqStandardScheme getScheme() { - return new TExecuteStatementReqStandardScheme(); - } - } - - private static class TExecuteStatementReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STATEMENT - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.statement = iprot.readString(); - struct.setStatementIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CONF_OVERLAY - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map162 = iprot.readMapBegin(); - struct.confOverlay = new HashMap(2*_map162.size); - for (int _i163 = 0; _i163 < _map162.size; ++_i163) - { - String _key164; // required - String _val165; // required - _key164 = iprot.readString(); - _val165 = iprot.readString(); - struct.confOverlay.put(_key164, _val165); - } - iprot.readMapEnd(); - } - struct.setConfOverlayIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // RUN_ASYNC - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.runAsync = iprot.readBool(); - struct.setRunAsyncIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.statement != null) { - oprot.writeFieldBegin(STATEMENT_FIELD_DESC); - oprot.writeString(struct.statement); - oprot.writeFieldEnd(); - } - if (struct.confOverlay != null) { - if (struct.isSetConfOverlay()) { - oprot.writeFieldBegin(CONF_OVERLAY_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.confOverlay.size())); - for (Map.Entry _iter166 : struct.confOverlay.entrySet()) - { - oprot.writeString(_iter166.getKey()); - oprot.writeString(_iter166.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - if (struct.isSetRunAsync()) { - oprot.writeFieldBegin(RUN_ASYNC_FIELD_DESC); - oprot.writeBool(struct.runAsync); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TExecuteStatementReqTupleSchemeFactory implements SchemeFactory { - public TExecuteStatementReqTupleScheme getScheme() { - return new TExecuteStatementReqTupleScheme(); - } - } - - private static class TExecuteStatementReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.statement); - BitSet optionals = new BitSet(); - if (struct.isSetConfOverlay()) { - optionals.set(0); - } - if (struct.isSetRunAsync()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetConfOverlay()) { - { - oprot.writeI32(struct.confOverlay.size()); - for (Map.Entry _iter167 : struct.confOverlay.entrySet()) - { - oprot.writeString(_iter167.getKey()); - oprot.writeString(_iter167.getValue()); - } - } - } - if (struct.isSetRunAsync()) { - oprot.writeBool(struct.runAsync); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.statement = iprot.readString(); - struct.setStatementIsSet(true); - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map168 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.confOverlay = new HashMap(2*_map168.size); - for (int _i169 = 0; _i169 < _map168.size; ++_i169) - { - String _key170; // required - String _val171; // required - _key170 = iprot.readString(); - _val171 = iprot.readString(); - struct.confOverlay.put(_key170, _val171); - } - } - struct.setConfOverlayIsSet(true); - } - if (incoming.get(1)) { - struct.runAsync = iprot.readBool(); - struct.setRunAsyncIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TExecuteStatementResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TExecuteStatementResp.java deleted file mode 100644 index fdde51e70f783..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TExecuteStatementResp.java +++ /dev/null @@ -1,505 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TExecuteStatementResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TExecuteStatementRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TExecuteStatementRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementResp.class, metaDataMap); - } - - public TExecuteStatementResp() { - } - - public TExecuteStatementResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TExecuteStatementResp(TExecuteStatementResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TExecuteStatementResp deepCopy() { - return new TExecuteStatementResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TExecuteStatementResp) - return this.equals((TExecuteStatementResp)that); - return false; - } - - public boolean equals(TExecuteStatementResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - return builder.toHashCode(); - } - - public int compareTo(TExecuteStatementResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TExecuteStatementResp typedOther = (TExecuteStatementResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TExecuteStatementResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TExecuteStatementRespStandardSchemeFactory implements SchemeFactory { - public TExecuteStatementRespStandardScheme getScheme() { - return new TExecuteStatementRespStandardScheme(); - } - } - - private static class TExecuteStatementRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TExecuteStatementRespTupleSchemeFactory implements SchemeFactory { - public TExecuteStatementRespTupleScheme getScheme() { - return new TExecuteStatementRespTupleScheme(); - } - } - - private static class TExecuteStatementRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TFetchOrientation.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TFetchOrientation.java deleted file mode 100644 index b2a22effd91af..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TFetchOrientation.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TFetchOrientation implements org.apache.thrift.TEnum { - FETCH_NEXT(0), - FETCH_PRIOR(1), - FETCH_RELATIVE(2), - FETCH_ABSOLUTE(3), - FETCH_FIRST(4), - FETCH_LAST(5); - - private final int value; - - private TFetchOrientation(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TFetchOrientation findByValue(int value) { - switch (value) { - case 0: - return FETCH_NEXT; - case 1: - return FETCH_PRIOR; - case 2: - return FETCH_RELATIVE; - case 3: - return FETCH_ABSOLUTE; - case 4: - return FETCH_FIRST; - case 5: - return FETCH_LAST; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TFetchResultsReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TFetchResultsReq.java deleted file mode 100644 index 068711fc44440..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TFetchResultsReq.java +++ /dev/null @@ -1,710 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TFetchResultsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsReq"); - - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField ORIENTATION_FIELD_DESC = new org.apache.thrift.protocol.TField("orientation", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField MAX_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxRows", org.apache.thrift.protocol.TType.I64, (short)3); - private static final org.apache.thrift.protocol.TField FETCH_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("fetchType", org.apache.thrift.protocol.TType.I16, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFetchResultsReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFetchResultsReqTupleSchemeFactory()); - } - - private TOperationHandle operationHandle; // required - private TFetchOrientation orientation; // required - private long maxRows; // required - private short fetchType; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OPERATION_HANDLE((short)1, "operationHandle"), - /** - * - * @see TFetchOrientation - */ - ORIENTATION((short)2, "orientation"), - MAX_ROWS((short)3, "maxRows"), - FETCH_TYPE((short)4, "fetchType"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_HANDLE - return OPERATION_HANDLE; - case 2: // ORIENTATION - return ORIENTATION; - case 3: // MAX_ROWS - return MAX_ROWS; - case 4: // FETCH_TYPE - return FETCH_TYPE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __MAXROWS_ISSET_ID = 0; - private static final int __FETCHTYPE_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.FETCH_TYPE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - tmpMap.put(_Fields.ORIENTATION, new org.apache.thrift.meta_data.FieldMetaData("orientation", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TFetchOrientation.class))); - tmpMap.put(_Fields.MAX_ROWS, new org.apache.thrift.meta_data.FieldMetaData("maxRows", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.FETCH_TYPE, new org.apache.thrift.meta_data.FieldMetaData("fetchType", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsReq.class, metaDataMap); - } - - public TFetchResultsReq() { - this.orientation = org.apache.hive.service.cli.thrift.TFetchOrientation.FETCH_NEXT; - - this.fetchType = (short)0; - - } - - public TFetchResultsReq( - TOperationHandle operationHandle, - TFetchOrientation orientation, - long maxRows) - { - this(); - this.operationHandle = operationHandle; - this.orientation = orientation; - this.maxRows = maxRows; - setMaxRowsIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TFetchResultsReq(TFetchResultsReq other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - if (other.isSetOrientation()) { - this.orientation = other.orientation; - } - this.maxRows = other.maxRows; - this.fetchType = other.fetchType; - } - - public TFetchResultsReq deepCopy() { - return new TFetchResultsReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - this.orientation = org.apache.hive.service.cli.thrift.TFetchOrientation.FETCH_NEXT; - - setMaxRowsIsSet(false); - this.maxRows = 0; - this.fetchType = (short)0; - - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - /** - * - * @see TFetchOrientation - */ - public TFetchOrientation getOrientation() { - return this.orientation; - } - - /** - * - * @see TFetchOrientation - */ - public void setOrientation(TFetchOrientation orientation) { - this.orientation = orientation; - } - - public void unsetOrientation() { - this.orientation = null; - } - - /** Returns true if field orientation is set (has been assigned a value) and false otherwise */ - public boolean isSetOrientation() { - return this.orientation != null; - } - - public void setOrientationIsSet(boolean value) { - if (!value) { - this.orientation = null; - } - } - - public long getMaxRows() { - return this.maxRows; - } - - public void setMaxRows(long maxRows) { - this.maxRows = maxRows; - setMaxRowsIsSet(true); - } - - public void unsetMaxRows() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXROWS_ISSET_ID); - } - - /** Returns true if field maxRows is set (has been assigned a value) and false otherwise */ - public boolean isSetMaxRows() { - return EncodingUtils.testBit(__isset_bitfield, __MAXROWS_ISSET_ID); - } - - public void setMaxRowsIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXROWS_ISSET_ID, value); - } - - public short getFetchType() { - return this.fetchType; - } - - public void setFetchType(short fetchType) { - this.fetchType = fetchType; - setFetchTypeIsSet(true); - } - - public void unsetFetchType() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); - } - - /** Returns true if field fetchType is set (has been assigned a value) and false otherwise */ - public boolean isSetFetchType() { - return EncodingUtils.testBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); - } - - public void setFetchTypeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FETCHTYPE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - case ORIENTATION: - if (value == null) { - unsetOrientation(); - } else { - setOrientation((TFetchOrientation)value); - } - break; - - case MAX_ROWS: - if (value == null) { - unsetMaxRows(); - } else { - setMaxRows((Long)value); - } - break; - - case FETCH_TYPE: - if (value == null) { - unsetFetchType(); - } else { - setFetchType((Short)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - case ORIENTATION: - return getOrientation(); - - case MAX_ROWS: - return Long.valueOf(getMaxRows()); - - case FETCH_TYPE: - return Short.valueOf(getFetchType()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - case ORIENTATION: - return isSetOrientation(); - case MAX_ROWS: - return isSetMaxRows(); - case FETCH_TYPE: - return isSetFetchType(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TFetchResultsReq) - return this.equals((TFetchResultsReq)that); - return false; - } - - public boolean equals(TFetchResultsReq that) { - if (that == null) - return false; - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - boolean this_present_orientation = true && this.isSetOrientation(); - boolean that_present_orientation = true && that.isSetOrientation(); - if (this_present_orientation || that_present_orientation) { - if (!(this_present_orientation && that_present_orientation)) - return false; - if (!this.orientation.equals(that.orientation)) - return false; - } - - boolean this_present_maxRows = true; - boolean that_present_maxRows = true; - if (this_present_maxRows || that_present_maxRows) { - if (!(this_present_maxRows && that_present_maxRows)) - return false; - if (this.maxRows != that.maxRows) - return false; - } - - boolean this_present_fetchType = true && this.isSetFetchType(); - boolean that_present_fetchType = true && that.isSetFetchType(); - if (this_present_fetchType || that_present_fetchType) { - if (!(this_present_fetchType && that_present_fetchType)) - return false; - if (this.fetchType != that.fetchType) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - boolean present_orientation = true && (isSetOrientation()); - builder.append(present_orientation); - if (present_orientation) - builder.append(orientation.getValue()); - - boolean present_maxRows = true; - builder.append(present_maxRows); - if (present_maxRows) - builder.append(maxRows); - - boolean present_fetchType = true && (isSetFetchType()); - builder.append(present_fetchType); - if (present_fetchType) - builder.append(fetchType); - - return builder.toHashCode(); - } - - public int compareTo(TFetchResultsReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TFetchResultsReq typedOther = (TFetchResultsReq)other; - - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOrientation()).compareTo(typedOther.isSetOrientation()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOrientation()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orientation, typedOther.orientation); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaxRows()).compareTo(typedOther.isSetMaxRows()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaxRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxRows, typedOther.maxRows); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFetchType()).compareTo(typedOther.isSetFetchType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFetchType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fetchType, typedOther.fetchType); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFetchResultsReq("); - boolean first = true; - - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("orientation:"); - if (this.orientation == null) { - sb.append("null"); - } else { - sb.append(this.orientation); - } - first = false; - if (!first) sb.append(", "); - sb.append("maxRows:"); - sb.append(this.maxRows); - first = false; - if (isSetFetchType()) { - if (!first) sb.append(", "); - sb.append("fetchType:"); - sb.append(this.fetchType); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - if (!isSetOrientation()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'orientation' is unset! Struct:" + toString()); - } - - if (!isSetMaxRows()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'maxRows' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TFetchResultsReqStandardSchemeFactory implements SchemeFactory { - public TFetchResultsReqStandardScheme getScheme() { - return new TFetchResultsReqStandardScheme(); - } - } - - private static class TFetchResultsReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // ORIENTATION - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.orientation = TFetchOrientation.findByValue(iprot.readI32()); - struct.setOrientationIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // MAX_ROWS - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.maxRows = iprot.readI64(); - struct.setMaxRowsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // FETCH_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.fetchType = iprot.readI16(); - struct.setFetchTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchResultsReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.orientation != null) { - oprot.writeFieldBegin(ORIENTATION_FIELD_DESC); - oprot.writeI32(struct.orientation.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(MAX_ROWS_FIELD_DESC); - oprot.writeI64(struct.maxRows); - oprot.writeFieldEnd(); - if (struct.isSetFetchType()) { - oprot.writeFieldBegin(FETCH_TYPE_FIELD_DESC); - oprot.writeI16(struct.fetchType); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TFetchResultsReqTupleSchemeFactory implements SchemeFactory { - public TFetchResultsReqTupleScheme getScheme() { - return new TFetchResultsReqTupleScheme(); - } - } - - private static class TFetchResultsReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.operationHandle.write(oprot); - oprot.writeI32(struct.orientation.getValue()); - oprot.writeI64(struct.maxRows); - BitSet optionals = new BitSet(); - if (struct.isSetFetchType()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetFetchType()) { - oprot.writeI16(struct.fetchType); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - struct.orientation = TFetchOrientation.findByValue(iprot.readI32()); - struct.setOrientationIsSet(true); - struct.maxRows = iprot.readI64(); - struct.setMaxRowsIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.fetchType = iprot.readI16(); - struct.setFetchTypeIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TFetchResultsResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TFetchResultsResp.java deleted file mode 100644 index 19991f1da3eb3..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TFetchResultsResp.java +++ /dev/null @@ -1,608 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TFetchResultsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField HAS_MORE_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("hasMoreRows", org.apache.thrift.protocol.TType.BOOL, (short)2); - private static final org.apache.thrift.protocol.TField RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("results", org.apache.thrift.protocol.TType.STRUCT, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFetchResultsRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFetchResultsRespTupleSchemeFactory()); - } - - private TStatus status; // required - private boolean hasMoreRows; // optional - private TRowSet results; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - HAS_MORE_ROWS((short)2, "hasMoreRows"), - RESULTS((short)3, "results"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // HAS_MORE_ROWS - return HAS_MORE_ROWS; - case 3: // RESULTS - return RESULTS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __HASMOREROWS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.HAS_MORE_ROWS,_Fields.RESULTS}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.HAS_MORE_ROWS, new org.apache.thrift.meta_data.FieldMetaData("hasMoreRows", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.RESULTS, new org.apache.thrift.meta_data.FieldMetaData("results", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRowSet.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsResp.class, metaDataMap); - } - - public TFetchResultsResp() { - } - - public TFetchResultsResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TFetchResultsResp(TFetchResultsResp other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - this.hasMoreRows = other.hasMoreRows; - if (other.isSetResults()) { - this.results = new TRowSet(other.results); - } - } - - public TFetchResultsResp deepCopy() { - return new TFetchResultsResp(this); - } - - @Override - public void clear() { - this.status = null; - setHasMoreRowsIsSet(false); - this.hasMoreRows = false; - this.results = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public boolean isHasMoreRows() { - return this.hasMoreRows; - } - - public void setHasMoreRows(boolean hasMoreRows) { - this.hasMoreRows = hasMoreRows; - setHasMoreRowsIsSet(true); - } - - public void unsetHasMoreRows() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); - } - - /** Returns true if field hasMoreRows is set (has been assigned a value) and false otherwise */ - public boolean isSetHasMoreRows() { - return EncodingUtils.testBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); - } - - public void setHasMoreRowsIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASMOREROWS_ISSET_ID, value); - } - - public TRowSet getResults() { - return this.results; - } - - public void setResults(TRowSet results) { - this.results = results; - } - - public void unsetResults() { - this.results = null; - } - - /** Returns true if field results is set (has been assigned a value) and false otherwise */ - public boolean isSetResults() { - return this.results != null; - } - - public void setResultsIsSet(boolean value) { - if (!value) { - this.results = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case HAS_MORE_ROWS: - if (value == null) { - unsetHasMoreRows(); - } else { - setHasMoreRows((Boolean)value); - } - break; - - case RESULTS: - if (value == null) { - unsetResults(); - } else { - setResults((TRowSet)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case HAS_MORE_ROWS: - return Boolean.valueOf(isHasMoreRows()); - - case RESULTS: - return getResults(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case HAS_MORE_ROWS: - return isSetHasMoreRows(); - case RESULTS: - return isSetResults(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TFetchResultsResp) - return this.equals((TFetchResultsResp)that); - return false; - } - - public boolean equals(TFetchResultsResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_hasMoreRows = true && this.isSetHasMoreRows(); - boolean that_present_hasMoreRows = true && that.isSetHasMoreRows(); - if (this_present_hasMoreRows || that_present_hasMoreRows) { - if (!(this_present_hasMoreRows && that_present_hasMoreRows)) - return false; - if (this.hasMoreRows != that.hasMoreRows) - return false; - } - - boolean this_present_results = true && this.isSetResults(); - boolean that_present_results = true && that.isSetResults(); - if (this_present_results || that_present_results) { - if (!(this_present_results && that_present_results)) - return false; - if (!this.results.equals(that.results)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_hasMoreRows = true && (isSetHasMoreRows()); - builder.append(present_hasMoreRows); - if (present_hasMoreRows) - builder.append(hasMoreRows); - - boolean present_results = true && (isSetResults()); - builder.append(present_results); - if (present_results) - builder.append(results); - - return builder.toHashCode(); - } - - public int compareTo(TFetchResultsResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TFetchResultsResp typedOther = (TFetchResultsResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetHasMoreRows()).compareTo(typedOther.isSetHasMoreRows()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHasMoreRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasMoreRows, typedOther.hasMoreRows); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetResults()).compareTo(typedOther.isSetResults()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetResults()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.results, typedOther.results); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFetchResultsResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetHasMoreRows()) { - if (!first) sb.append(", "); - sb.append("hasMoreRows:"); - sb.append(this.hasMoreRows); - first = false; - } - if (isSetResults()) { - if (!first) sb.append(", "); - sb.append("results:"); - if (this.results == null) { - sb.append("null"); - } else { - sb.append(this.results); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (results != null) { - results.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TFetchResultsRespStandardSchemeFactory implements SchemeFactory { - public TFetchResultsRespStandardScheme getScheme() { - return new TFetchResultsRespStandardScheme(); - } - } - - private static class TFetchResultsRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // HAS_MORE_ROWS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.hasMoreRows = iprot.readBool(); - struct.setHasMoreRowsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // RESULTS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.results = new TRowSet(); - struct.results.read(iprot); - struct.setResultsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchResultsResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.isSetHasMoreRows()) { - oprot.writeFieldBegin(HAS_MORE_ROWS_FIELD_DESC); - oprot.writeBool(struct.hasMoreRows); - oprot.writeFieldEnd(); - } - if (struct.results != null) { - if (struct.isSetResults()) { - oprot.writeFieldBegin(RESULTS_FIELD_DESC); - struct.results.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TFetchResultsRespTupleSchemeFactory implements SchemeFactory { - public TFetchResultsRespTupleScheme getScheme() { - return new TFetchResultsRespTupleScheme(); - } - } - - private static class TFetchResultsRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetHasMoreRows()) { - optionals.set(0); - } - if (struct.isSetResults()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetHasMoreRows()) { - oprot.writeBool(struct.hasMoreRows); - } - if (struct.isSetResults()) { - struct.results.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.hasMoreRows = iprot.readBool(); - struct.setHasMoreRowsIsSet(true); - } - if (incoming.get(1)) { - struct.results = new TRowSet(); - struct.results.read(iprot); - struct.setResultsIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetCatalogsReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetCatalogsReq.java deleted file mode 100644 index cfd157f701b26..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetCatalogsReq.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetCatalogsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetCatalogsReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetCatalogsReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsReq.class, metaDataMap); - } - - public TGetCatalogsReq() { - } - - public TGetCatalogsReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetCatalogsReq(TGetCatalogsReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - } - - public TGetCatalogsReq deepCopy() { - return new TGetCatalogsReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetCatalogsReq) - return this.equals((TGetCatalogsReq)that); - return false; - } - - public boolean equals(TGetCatalogsReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - return builder.toHashCode(); - } - - public int compareTo(TGetCatalogsReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetCatalogsReq typedOther = (TGetCatalogsReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetCatalogsReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetCatalogsReqStandardSchemeFactory implements SchemeFactory { - public TGetCatalogsReqStandardScheme getScheme() { - return new TGetCatalogsReqStandardScheme(); - } - } - - private static class TGetCatalogsReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetCatalogsReqTupleSchemeFactory implements SchemeFactory { - public TGetCatalogsReqTupleScheme getScheme() { - return new TGetCatalogsReqTupleScheme(); - } - } - - private static class TGetCatalogsReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetCatalogsResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetCatalogsResp.java deleted file mode 100644 index 1c5a35437d416..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetCatalogsResp.java +++ /dev/null @@ -1,505 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetCatalogsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetCatalogsRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetCatalogsRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsResp.class, metaDataMap); - } - - public TGetCatalogsResp() { - } - - public TGetCatalogsResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetCatalogsResp(TGetCatalogsResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetCatalogsResp deepCopy() { - return new TGetCatalogsResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetCatalogsResp) - return this.equals((TGetCatalogsResp)that); - return false; - } - - public boolean equals(TGetCatalogsResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - return builder.toHashCode(); - } - - public int compareTo(TGetCatalogsResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetCatalogsResp typedOther = (TGetCatalogsResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetCatalogsResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetCatalogsRespStandardSchemeFactory implements SchemeFactory { - public TGetCatalogsRespStandardScheme getScheme() { - return new TGetCatalogsRespStandardScheme(); - } - } - - private static class TGetCatalogsRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetCatalogsRespTupleSchemeFactory implements SchemeFactory { - public TGetCatalogsRespTupleScheme getScheme() { - return new TGetCatalogsRespTupleScheme(); - } - } - - private static class TGetCatalogsRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetColumnsReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetColumnsReq.java deleted file mode 100644 index a2c793bd95927..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetColumnsReq.java +++ /dev/null @@ -1,818 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetColumnsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetColumnsReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetColumnsReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - private String tableName; // optional - private String columnName; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"), - TABLE_NAME((short)4, "tableName"), - COLUMN_NAME((short)5, "columnName"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - case 4: // TABLE_NAME - return TABLE_NAME; - case 5: // COLUMN_NAME - return COLUMN_NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.COLUMN_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsReq.class, metaDataMap); - } - - public TGetColumnsReq() { - } - - public TGetColumnsReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetColumnsReq(TGetColumnsReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - if (other.isSetTableName()) { - this.tableName = other.tableName; - } - if (other.isSetColumnName()) { - this.columnName = other.columnName; - } - } - - public TGetColumnsReq deepCopy() { - return new TGetColumnsReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - this.tableName = null; - this.columnName = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - public String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - public String getTableName() { - return this.tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public void unsetTableName() { - this.tableName = null; - } - - /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ - public boolean isSetTableName() { - return this.tableName != null; - } - - public void setTableNameIsSet(boolean value) { - if (!value) { - this.tableName = null; - } - } - - public String getColumnName() { - return this.columnName; - } - - public void setColumnName(String columnName) { - this.columnName = columnName; - } - - public void unsetColumnName() { - this.columnName = null; - } - - /** Returns true if field columnName is set (has been assigned a value) and false otherwise */ - public boolean isSetColumnName() { - return this.columnName != null; - } - - public void setColumnNameIsSet(boolean value) { - if (!value) { - this.columnName = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((String)value); - } - break; - - case TABLE_NAME: - if (value == null) { - unsetTableName(); - } else { - setTableName((String)value); - } - break; - - case COLUMN_NAME: - if (value == null) { - unsetColumnName(); - } else { - setColumnName((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - case TABLE_NAME: - return getTableName(); - - case COLUMN_NAME: - return getColumnName(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - case TABLE_NAME: - return isSetTableName(); - case COLUMN_NAME: - return isSetColumnName(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetColumnsReq) - return this.equals((TGetColumnsReq)that); - return false; - } - - public boolean equals(TGetColumnsReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - boolean this_present_tableName = true && this.isSetTableName(); - boolean that_present_tableName = true && that.isSetTableName(); - if (this_present_tableName || that_present_tableName) { - if (!(this_present_tableName && that_present_tableName)) - return false; - if (!this.tableName.equals(that.tableName)) - return false; - } - - boolean this_present_columnName = true && this.isSetColumnName(); - boolean that_present_columnName = true && that.isSetColumnName(); - if (this_present_columnName || that_present_columnName) { - if (!(this_present_columnName && that_present_columnName)) - return false; - if (!this.columnName.equals(that.columnName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - boolean present_catalogName = true && (isSetCatalogName()); - builder.append(present_catalogName); - if (present_catalogName) - builder.append(catalogName); - - boolean present_schemaName = true && (isSetSchemaName()); - builder.append(present_schemaName); - if (present_schemaName) - builder.append(schemaName); - - boolean present_tableName = true && (isSetTableName()); - builder.append(present_tableName); - if (present_tableName) - builder.append(tableName); - - boolean present_columnName = true && (isSetColumnName()); - builder.append(present_columnName); - if (present_columnName) - builder.append(columnName); - - return builder.toHashCode(); - } - - public int compareTo(TGetColumnsReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetColumnsReq typedOther = (TGetColumnsReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(typedOther.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, typedOther.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(typedOther.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, typedOther.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTableName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(typedOther.isSetColumnName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumnName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnName, typedOther.columnName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetColumnsReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - if (isSetTableName()) { - if (!first) sb.append(", "); - sb.append("tableName:"); - if (this.tableName == null) { - sb.append("null"); - } else { - sb.append(this.tableName); - } - first = false; - } - if (isSetColumnName()) { - if (!first) sb.append(", "); - sb.append("columnName:"); - if (this.columnName == null) { - sb.append("null"); - } else { - sb.append(this.columnName); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetColumnsReqStandardSchemeFactory implements SchemeFactory { - public TGetColumnsReqStandardScheme getScheme() { - return new TGetColumnsReqStandardScheme(); - } - } - - private static class TGetColumnsReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // TABLE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // COLUMN_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.columnName = iprot.readString(); - struct.setColumnNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetColumnsReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - if (struct.tableName != null) { - if (struct.isSetTableName()) { - oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); - oprot.writeString(struct.tableName); - oprot.writeFieldEnd(); - } - } - if (struct.columnName != null) { - if (struct.isSetColumnName()) { - oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); - oprot.writeString(struct.columnName); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetColumnsReqTupleSchemeFactory implements SchemeFactory { - public TGetColumnsReqTupleScheme getScheme() { - return new TGetColumnsReqTupleScheme(); - } - } - - private static class TGetColumnsReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - if (struct.isSetTableName()) { - optionals.set(2); - } - if (struct.isSetColumnName()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - if (struct.isSetTableName()) { - oprot.writeString(struct.tableName); - } - if (struct.isSetColumnName()) { - oprot.writeString(struct.columnName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - if (incoming.get(2)) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } - if (incoming.get(3)) { - struct.columnName = iprot.readString(); - struct.setColumnNameIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetColumnsResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetColumnsResp.java deleted file mode 100644 index d6cf1be6d304b..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetColumnsResp.java +++ /dev/null @@ -1,505 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetColumnsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetColumnsRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetColumnsRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsResp.class, metaDataMap); - } - - public TGetColumnsResp() { - } - - public TGetColumnsResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetColumnsResp(TGetColumnsResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetColumnsResp deepCopy() { - return new TGetColumnsResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetColumnsResp) - return this.equals((TGetColumnsResp)that); - return false; - } - - public boolean equals(TGetColumnsResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - return builder.toHashCode(); - } - - public int compareTo(TGetColumnsResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetColumnsResp typedOther = (TGetColumnsResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetColumnsResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetColumnsRespStandardSchemeFactory implements SchemeFactory { - public TGetColumnsRespStandardScheme getScheme() { - return new TGetColumnsRespStandardScheme(); - } - } - - private static class TGetColumnsRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetColumnsResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetColumnsRespTupleSchemeFactory implements SchemeFactory { - public TGetColumnsRespTupleScheme getScheme() { - return new TGetColumnsRespTupleScheme(); - } - } - - private static class TGetColumnsRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetDelegationTokenReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetDelegationTokenReq.java deleted file mode 100644 index 6c6bb00e43e43..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetDelegationTokenReq.java +++ /dev/null @@ -1,592 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField RENEWER_FIELD_DESC = new org.apache.thrift.protocol.TField("renewer", org.apache.thrift.protocol.TType.STRING, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetDelegationTokenReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetDelegationTokenReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String owner; // required - private String renewer; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - OWNER((short)2, "owner"), - RENEWER((short)3, "renewer"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // OWNER - return OWNER; - case 3: // RENEWER - return RENEWER; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.OWNER, new org.apache.thrift.meta_data.FieldMetaData("owner", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.RENEWER, new org.apache.thrift.meta_data.FieldMetaData("renewer", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenReq.class, metaDataMap); - } - - public TGetDelegationTokenReq() { - } - - public TGetDelegationTokenReq( - TSessionHandle sessionHandle, - String owner, - String renewer) - { - this(); - this.sessionHandle = sessionHandle; - this.owner = owner; - this.renewer = renewer; - } - - /** - * Performs a deep copy on other. - */ - public TGetDelegationTokenReq(TGetDelegationTokenReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetOwner()) { - this.owner = other.owner; - } - if (other.isSetRenewer()) { - this.renewer = other.renewer; - } - } - - public TGetDelegationTokenReq deepCopy() { - return new TGetDelegationTokenReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.owner = null; - this.renewer = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public void unsetOwner() { - this.owner = null; - } - - /** Returns true if field owner is set (has been assigned a value) and false otherwise */ - public boolean isSetOwner() { - return this.owner != null; - } - - public void setOwnerIsSet(boolean value) { - if (!value) { - this.owner = null; - } - } - - public String getRenewer() { - return this.renewer; - } - - public void setRenewer(String renewer) { - this.renewer = renewer; - } - - public void unsetRenewer() { - this.renewer = null; - } - - /** Returns true if field renewer is set (has been assigned a value) and false otherwise */ - public boolean isSetRenewer() { - return this.renewer != null; - } - - public void setRenewerIsSet(boolean value) { - if (!value) { - this.renewer = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case OWNER: - if (value == null) { - unsetOwner(); - } else { - setOwner((String)value); - } - break; - - case RENEWER: - if (value == null) { - unsetRenewer(); - } else { - setRenewer((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case OWNER: - return getOwner(); - - case RENEWER: - return getRenewer(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case OWNER: - return isSetOwner(); - case RENEWER: - return isSetRenewer(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetDelegationTokenReq) - return this.equals((TGetDelegationTokenReq)that); - return false; - } - - public boolean equals(TGetDelegationTokenReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_owner = true && this.isSetOwner(); - boolean that_present_owner = true && that.isSetOwner(); - if (this_present_owner || that_present_owner) { - if (!(this_present_owner && that_present_owner)) - return false; - if (!this.owner.equals(that.owner)) - return false; - } - - boolean this_present_renewer = true && this.isSetRenewer(); - boolean that_present_renewer = true && that.isSetRenewer(); - if (this_present_renewer || that_present_renewer) { - if (!(this_present_renewer && that_present_renewer)) - return false; - if (!this.renewer.equals(that.renewer)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - boolean present_owner = true && (isSetOwner()); - builder.append(present_owner); - if (present_owner) - builder.append(owner); - - boolean present_renewer = true && (isSetRenewer()); - builder.append(present_renewer); - if (present_renewer) - builder.append(renewer); - - return builder.toHashCode(); - } - - public int compareTo(TGetDelegationTokenReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetDelegationTokenReq typedOther = (TGetDelegationTokenReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOwner()).compareTo(typedOther.isSetOwner()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOwner()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, typedOther.owner); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRenewer()).compareTo(typedOther.isSetRenewer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRenewer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.renewer, typedOther.renewer); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetDelegationTokenReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("owner:"); - if (this.owner == null) { - sb.append("null"); - } else { - sb.append(this.owner); - } - first = false; - if (!first) sb.append(", "); - sb.append("renewer:"); - if (this.renewer == null) { - sb.append("null"); - } else { - sb.append(this.renewer); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - if (!isSetOwner()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'owner' is unset! Struct:" + toString()); - } - - if (!isSetRenewer()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'renewer' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetDelegationTokenReqStandardSchemeFactory implements SchemeFactory { - public TGetDelegationTokenReqStandardScheme getScheme() { - return new TGetDelegationTokenReqStandardScheme(); - } - } - - private static class TGetDelegationTokenReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OWNER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.owner = iprot.readString(); - struct.setOwnerIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // RENEWER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.renewer = iprot.readString(); - struct.setRenewerIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.owner != null) { - oprot.writeFieldBegin(OWNER_FIELD_DESC); - oprot.writeString(struct.owner); - oprot.writeFieldEnd(); - } - if (struct.renewer != null) { - oprot.writeFieldBegin(RENEWER_FIELD_DESC); - oprot.writeString(struct.renewer); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetDelegationTokenReqTupleSchemeFactory implements SchemeFactory { - public TGetDelegationTokenReqTupleScheme getScheme() { - return new TGetDelegationTokenReqTupleScheme(); - } - } - - private static class TGetDelegationTokenReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.owner); - oprot.writeString(struct.renewer); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.owner = iprot.readString(); - struct.setOwnerIsSet(true); - struct.renewer = iprot.readString(); - struct.setRenewerIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetDelegationTokenResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetDelegationTokenResp.java deleted file mode 100644 index d14c5e029a35d..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetDelegationTokenResp.java +++ /dev/null @@ -1,500 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetDelegationTokenRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetDelegationTokenRespTupleSchemeFactory()); - } - - private TStatus status; // required - private String delegationToken; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - DELEGATION_TOKEN((short)2, "delegationToken"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // DELEGATION_TOKEN - return DELEGATION_TOKEN; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.DELEGATION_TOKEN}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenResp.class, metaDataMap); - } - - public TGetDelegationTokenResp() { - } - - public TGetDelegationTokenResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetDelegationTokenResp(TGetDelegationTokenResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetDelegationToken()) { - this.delegationToken = other.delegationToken; - } - } - - public TGetDelegationTokenResp deepCopy() { - return new TGetDelegationTokenResp(this); - } - - @Override - public void clear() { - this.status = null; - this.delegationToken = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public String getDelegationToken() { - return this.delegationToken; - } - - public void setDelegationToken(String delegationToken) { - this.delegationToken = delegationToken; - } - - public void unsetDelegationToken() { - this.delegationToken = null; - } - - /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ - public boolean isSetDelegationToken() { - return this.delegationToken != null; - } - - public void setDelegationTokenIsSet(boolean value) { - if (!value) { - this.delegationToken = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case DELEGATION_TOKEN: - if (value == null) { - unsetDelegationToken(); - } else { - setDelegationToken((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case DELEGATION_TOKEN: - return getDelegationToken(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case DELEGATION_TOKEN: - return isSetDelegationToken(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetDelegationTokenResp) - return this.equals((TGetDelegationTokenResp)that); - return false; - } - - public boolean equals(TGetDelegationTokenResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_delegationToken = true && this.isSetDelegationToken(); - boolean that_present_delegationToken = true && that.isSetDelegationToken(); - if (this_present_delegationToken || that_present_delegationToken) { - if (!(this_present_delegationToken && that_present_delegationToken)) - return false; - if (!this.delegationToken.equals(that.delegationToken)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_delegationToken = true && (isSetDelegationToken()); - builder.append(present_delegationToken); - if (present_delegationToken) - builder.append(delegationToken); - - return builder.toHashCode(); - } - - public int compareTo(TGetDelegationTokenResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetDelegationTokenResp typedOther = (TGetDelegationTokenResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(typedOther.isSetDelegationToken()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDelegationToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, typedOther.delegationToken); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetDelegationTokenResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetDelegationToken()) { - if (!first) sb.append(", "); - sb.append("delegationToken:"); - if (this.delegationToken == null) { - sb.append("null"); - } else { - sb.append(this.delegationToken); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetDelegationTokenRespStandardSchemeFactory implements SchemeFactory { - public TGetDelegationTokenRespStandardScheme getScheme() { - return new TGetDelegationTokenRespStandardScheme(); - } - } - - private static class TGetDelegationTokenRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // DELEGATION_TOKEN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.delegationToken != null) { - if (struct.isSetDelegationToken()) { - oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); - oprot.writeString(struct.delegationToken); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetDelegationTokenRespTupleSchemeFactory implements SchemeFactory { - public TGetDelegationTokenRespTupleScheme getScheme() { - return new TGetDelegationTokenRespTupleScheme(); - } - } - - private static class TGetDelegationTokenRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetDelegationToken()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetDelegationToken()) { - oprot.writeString(struct.delegationToken); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetFunctionsReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetFunctionsReq.java deleted file mode 100644 index ff45ee0386cb9..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetFunctionsReq.java +++ /dev/null @@ -1,707 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetFunctionsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("functionName", org.apache.thrift.protocol.TType.STRING, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetFunctionsReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetFunctionsReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - private String functionName; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"), - FUNCTION_NAME((short)4, "functionName"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - case 4: // FUNCTION_NAME - return FUNCTION_NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsReq.class, metaDataMap); - } - - public TGetFunctionsReq() { - } - - public TGetFunctionsReq( - TSessionHandle sessionHandle, - String functionName) - { - this(); - this.sessionHandle = sessionHandle; - this.functionName = functionName; - } - - /** - * Performs a deep copy on other. - */ - public TGetFunctionsReq(TGetFunctionsReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - if (other.isSetFunctionName()) { - this.functionName = other.functionName; - } - } - - public TGetFunctionsReq deepCopy() { - return new TGetFunctionsReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - this.functionName = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - public String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - public String getFunctionName() { - return this.functionName; - } - - public void setFunctionName(String functionName) { - this.functionName = functionName; - } - - public void unsetFunctionName() { - this.functionName = null; - } - - /** Returns true if field functionName is set (has been assigned a value) and false otherwise */ - public boolean isSetFunctionName() { - return this.functionName != null; - } - - public void setFunctionNameIsSet(boolean value) { - if (!value) { - this.functionName = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((String)value); - } - break; - - case FUNCTION_NAME: - if (value == null) { - unsetFunctionName(); - } else { - setFunctionName((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - case FUNCTION_NAME: - return getFunctionName(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - case FUNCTION_NAME: - return isSetFunctionName(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetFunctionsReq) - return this.equals((TGetFunctionsReq)that); - return false; - } - - public boolean equals(TGetFunctionsReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - boolean this_present_functionName = true && this.isSetFunctionName(); - boolean that_present_functionName = true && that.isSetFunctionName(); - if (this_present_functionName || that_present_functionName) { - if (!(this_present_functionName && that_present_functionName)) - return false; - if (!this.functionName.equals(that.functionName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - boolean present_catalogName = true && (isSetCatalogName()); - builder.append(present_catalogName); - if (present_catalogName) - builder.append(catalogName); - - boolean present_schemaName = true && (isSetSchemaName()); - builder.append(present_schemaName); - if (present_schemaName) - builder.append(schemaName); - - boolean present_functionName = true && (isSetFunctionName()); - builder.append(present_functionName); - if (present_functionName) - builder.append(functionName); - - return builder.toHashCode(); - } - - public int compareTo(TGetFunctionsReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetFunctionsReq typedOther = (TGetFunctionsReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(typedOther.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, typedOther.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(typedOther.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, typedOther.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFunctionName()).compareTo(typedOther.isSetFunctionName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFunctionName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.functionName, typedOther.functionName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetFunctionsReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - if (!first) sb.append(", "); - sb.append("functionName:"); - if (this.functionName == null) { - sb.append("null"); - } else { - sb.append(this.functionName); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - if (!isSetFunctionName()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'functionName' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetFunctionsReqStandardSchemeFactory implements SchemeFactory { - public TGetFunctionsReqStandardScheme getScheme() { - return new TGetFunctionsReqStandardScheme(); - } - } - - private static class TGetFunctionsReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // FUNCTION_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.functionName = iprot.readString(); - struct.setFunctionNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - if (struct.functionName != null) { - oprot.writeFieldBegin(FUNCTION_NAME_FIELD_DESC); - oprot.writeString(struct.functionName); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetFunctionsReqTupleSchemeFactory implements SchemeFactory { - public TGetFunctionsReqTupleScheme getScheme() { - return new TGetFunctionsReqTupleScheme(); - } - } - - private static class TGetFunctionsReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.functionName); - BitSet optionals = new BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.functionName = iprot.readString(); - struct.setFunctionNameIsSet(true); - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetFunctionsResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetFunctionsResp.java deleted file mode 100644 index 3adafdacb54ef..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetFunctionsResp.java +++ /dev/null @@ -1,505 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetFunctionsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetFunctionsRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetFunctionsRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsResp.class, metaDataMap); - } - - public TGetFunctionsResp() { - } - - public TGetFunctionsResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetFunctionsResp(TGetFunctionsResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetFunctionsResp deepCopy() { - return new TGetFunctionsResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetFunctionsResp) - return this.equals((TGetFunctionsResp)that); - return false; - } - - public boolean equals(TGetFunctionsResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - return builder.toHashCode(); - } - - public int compareTo(TGetFunctionsResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetFunctionsResp typedOther = (TGetFunctionsResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetFunctionsResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetFunctionsRespStandardSchemeFactory implements SchemeFactory { - public TGetFunctionsRespStandardScheme getScheme() { - return new TGetFunctionsRespStandardScheme(); - } - } - - private static class TGetFunctionsRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetFunctionsRespTupleSchemeFactory implements SchemeFactory { - public TGetFunctionsRespTupleScheme getScheme() { - return new TGetFunctionsRespTupleScheme(); - } - } - - private static class TGetFunctionsRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetInfoReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetInfoReq.java deleted file mode 100644 index 0139bf04ec7db..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetInfoReq.java +++ /dev/null @@ -1,503 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField INFO_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoType", org.apache.thrift.protocol.TType.I32, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetInfoReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetInfoReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private TGetInfoType infoType; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - /** - * - * @see TGetInfoType - */ - INFO_TYPE((short)2, "infoType"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // INFO_TYPE - return INFO_TYPE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.INFO_TYPE, new org.apache.thrift.meta_data.FieldMetaData("infoType", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TGetInfoType.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoReq.class, metaDataMap); - } - - public TGetInfoReq() { - } - - public TGetInfoReq( - TSessionHandle sessionHandle, - TGetInfoType infoType) - { - this(); - this.sessionHandle = sessionHandle; - this.infoType = infoType; - } - - /** - * Performs a deep copy on other. - */ - public TGetInfoReq(TGetInfoReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetInfoType()) { - this.infoType = other.infoType; - } - } - - public TGetInfoReq deepCopy() { - return new TGetInfoReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.infoType = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - /** - * - * @see TGetInfoType - */ - public TGetInfoType getInfoType() { - return this.infoType; - } - - /** - * - * @see TGetInfoType - */ - public void setInfoType(TGetInfoType infoType) { - this.infoType = infoType; - } - - public void unsetInfoType() { - this.infoType = null; - } - - /** Returns true if field infoType is set (has been assigned a value) and false otherwise */ - public boolean isSetInfoType() { - return this.infoType != null; - } - - public void setInfoTypeIsSet(boolean value) { - if (!value) { - this.infoType = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case INFO_TYPE: - if (value == null) { - unsetInfoType(); - } else { - setInfoType((TGetInfoType)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case INFO_TYPE: - return getInfoType(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case INFO_TYPE: - return isSetInfoType(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetInfoReq) - return this.equals((TGetInfoReq)that); - return false; - } - - public boolean equals(TGetInfoReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_infoType = true && this.isSetInfoType(); - boolean that_present_infoType = true && that.isSetInfoType(); - if (this_present_infoType || that_present_infoType) { - if (!(this_present_infoType && that_present_infoType)) - return false; - if (!this.infoType.equals(that.infoType)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - boolean present_infoType = true && (isSetInfoType()); - builder.append(present_infoType); - if (present_infoType) - builder.append(infoType.getValue()); - - return builder.toHashCode(); - } - - public int compareTo(TGetInfoReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetInfoReq typedOther = (TGetInfoReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetInfoType()).compareTo(typedOther.isSetInfoType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetInfoType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoType, typedOther.infoType); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetInfoReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("infoType:"); - if (this.infoType == null) { - sb.append("null"); - } else { - sb.append(this.infoType); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - if (!isSetInfoType()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'infoType' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetInfoReqStandardSchemeFactory implements SchemeFactory { - public TGetInfoReqStandardScheme getScheme() { - return new TGetInfoReqStandardScheme(); - } - } - - private static class TGetInfoReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // INFO_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.infoType = TGetInfoType.findByValue(iprot.readI32()); - struct.setInfoTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetInfoReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.infoType != null) { - oprot.writeFieldBegin(INFO_TYPE_FIELD_DESC); - oprot.writeI32(struct.infoType.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetInfoReqTupleSchemeFactory implements SchemeFactory { - public TGetInfoReqTupleScheme getScheme() { - return new TGetInfoReqTupleScheme(); - } - } - - private static class TGetInfoReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeI32(struct.infoType.getValue()); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.infoType = TGetInfoType.findByValue(iprot.readI32()); - struct.setInfoTypeIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetInfoResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetInfoResp.java deleted file mode 100644 index 2faaa9211b3ba..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetInfoResp.java +++ /dev/null @@ -1,493 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField INFO_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoValue", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetInfoRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetInfoRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TGetInfoValue infoValue; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - INFO_VALUE((short)2, "infoValue"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // INFO_VALUE - return INFO_VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.INFO_VALUE, new org.apache.thrift.meta_data.FieldMetaData("infoValue", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetInfoValue.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoResp.class, metaDataMap); - } - - public TGetInfoResp() { - } - - public TGetInfoResp( - TStatus status, - TGetInfoValue infoValue) - { - this(); - this.status = status; - this.infoValue = infoValue; - } - - /** - * Performs a deep copy on other. - */ - public TGetInfoResp(TGetInfoResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetInfoValue()) { - this.infoValue = new TGetInfoValue(other.infoValue); - } - } - - public TGetInfoResp deepCopy() { - return new TGetInfoResp(this); - } - - @Override - public void clear() { - this.status = null; - this.infoValue = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TGetInfoValue getInfoValue() { - return this.infoValue; - } - - public void setInfoValue(TGetInfoValue infoValue) { - this.infoValue = infoValue; - } - - public void unsetInfoValue() { - this.infoValue = null; - } - - /** Returns true if field infoValue is set (has been assigned a value) and false otherwise */ - public boolean isSetInfoValue() { - return this.infoValue != null; - } - - public void setInfoValueIsSet(boolean value) { - if (!value) { - this.infoValue = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case INFO_VALUE: - if (value == null) { - unsetInfoValue(); - } else { - setInfoValue((TGetInfoValue)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case INFO_VALUE: - return getInfoValue(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case INFO_VALUE: - return isSetInfoValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetInfoResp) - return this.equals((TGetInfoResp)that); - return false; - } - - public boolean equals(TGetInfoResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_infoValue = true && this.isSetInfoValue(); - boolean that_present_infoValue = true && that.isSetInfoValue(); - if (this_present_infoValue || that_present_infoValue) { - if (!(this_present_infoValue && that_present_infoValue)) - return false; - if (!this.infoValue.equals(that.infoValue)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_infoValue = true && (isSetInfoValue()); - builder.append(present_infoValue); - if (present_infoValue) - builder.append(infoValue); - - return builder.toHashCode(); - } - - public int compareTo(TGetInfoResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetInfoResp typedOther = (TGetInfoResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetInfoValue()).compareTo(typedOther.isSetInfoValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetInfoValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoValue, typedOther.infoValue); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetInfoResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (!first) sb.append(", "); - sb.append("infoValue:"); - if (this.infoValue == null) { - sb.append("null"); - } else { - sb.append(this.infoValue); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - if (!isSetInfoValue()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'infoValue' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetInfoRespStandardSchemeFactory implements SchemeFactory { - public TGetInfoRespStandardScheme getScheme() { - return new TGetInfoRespStandardScheme(); - } - } - - private static class TGetInfoRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // INFO_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.infoValue = new TGetInfoValue(); - struct.infoValue.read(iprot); - struct.setInfoValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetInfoResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.infoValue != null) { - oprot.writeFieldBegin(INFO_VALUE_FIELD_DESC); - struct.infoValue.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetInfoRespTupleSchemeFactory implements SchemeFactory { - public TGetInfoRespTupleScheme getScheme() { - return new TGetInfoRespTupleScheme(); - } - } - - private static class TGetInfoRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - struct.infoValue.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - struct.infoValue = new TGetInfoValue(); - struct.infoValue.read(iprot); - struct.setInfoValueIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetInfoType.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetInfoType.java deleted file mode 100644 index d9dd62414f001..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetInfoType.java +++ /dev/null @@ -1,180 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TGetInfoType implements org.apache.thrift.TEnum { - CLI_MAX_DRIVER_CONNECTIONS(0), - CLI_MAX_CONCURRENT_ACTIVITIES(1), - CLI_DATA_SOURCE_NAME(2), - CLI_FETCH_DIRECTION(8), - CLI_SERVER_NAME(13), - CLI_SEARCH_PATTERN_ESCAPE(14), - CLI_DBMS_NAME(17), - CLI_DBMS_VER(18), - CLI_ACCESSIBLE_TABLES(19), - CLI_ACCESSIBLE_PROCEDURES(20), - CLI_CURSOR_COMMIT_BEHAVIOR(23), - CLI_DATA_SOURCE_READ_ONLY(25), - CLI_DEFAULT_TXN_ISOLATION(26), - CLI_IDENTIFIER_CASE(28), - CLI_IDENTIFIER_QUOTE_CHAR(29), - CLI_MAX_COLUMN_NAME_LEN(30), - CLI_MAX_CURSOR_NAME_LEN(31), - CLI_MAX_SCHEMA_NAME_LEN(32), - CLI_MAX_CATALOG_NAME_LEN(34), - CLI_MAX_TABLE_NAME_LEN(35), - CLI_SCROLL_CONCURRENCY(43), - CLI_TXN_CAPABLE(46), - CLI_USER_NAME(47), - CLI_TXN_ISOLATION_OPTION(72), - CLI_INTEGRITY(73), - CLI_GETDATA_EXTENSIONS(81), - CLI_NULL_COLLATION(85), - CLI_ALTER_TABLE(86), - CLI_ORDER_BY_COLUMNS_IN_SELECT(90), - CLI_SPECIAL_CHARACTERS(94), - CLI_MAX_COLUMNS_IN_GROUP_BY(97), - CLI_MAX_COLUMNS_IN_INDEX(98), - CLI_MAX_COLUMNS_IN_ORDER_BY(99), - CLI_MAX_COLUMNS_IN_SELECT(100), - CLI_MAX_COLUMNS_IN_TABLE(101), - CLI_MAX_INDEX_SIZE(102), - CLI_MAX_ROW_SIZE(104), - CLI_MAX_STATEMENT_LEN(105), - CLI_MAX_TABLES_IN_SELECT(106), - CLI_MAX_USER_NAME_LEN(107), - CLI_OJ_CAPABILITIES(115), - CLI_XOPEN_CLI_YEAR(10000), - CLI_CURSOR_SENSITIVITY(10001), - CLI_DESCRIBE_PARAMETER(10002), - CLI_CATALOG_NAME(10003), - CLI_COLLATION_SEQ(10004), - CLI_MAX_IDENTIFIER_LEN(10005); - - private final int value; - - private TGetInfoType(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TGetInfoType findByValue(int value) { - switch (value) { - case 0: - return CLI_MAX_DRIVER_CONNECTIONS; - case 1: - return CLI_MAX_CONCURRENT_ACTIVITIES; - case 2: - return CLI_DATA_SOURCE_NAME; - case 8: - return CLI_FETCH_DIRECTION; - case 13: - return CLI_SERVER_NAME; - case 14: - return CLI_SEARCH_PATTERN_ESCAPE; - case 17: - return CLI_DBMS_NAME; - case 18: - return CLI_DBMS_VER; - case 19: - return CLI_ACCESSIBLE_TABLES; - case 20: - return CLI_ACCESSIBLE_PROCEDURES; - case 23: - return CLI_CURSOR_COMMIT_BEHAVIOR; - case 25: - return CLI_DATA_SOURCE_READ_ONLY; - case 26: - return CLI_DEFAULT_TXN_ISOLATION; - case 28: - return CLI_IDENTIFIER_CASE; - case 29: - return CLI_IDENTIFIER_QUOTE_CHAR; - case 30: - return CLI_MAX_COLUMN_NAME_LEN; - case 31: - return CLI_MAX_CURSOR_NAME_LEN; - case 32: - return CLI_MAX_SCHEMA_NAME_LEN; - case 34: - return CLI_MAX_CATALOG_NAME_LEN; - case 35: - return CLI_MAX_TABLE_NAME_LEN; - case 43: - return CLI_SCROLL_CONCURRENCY; - case 46: - return CLI_TXN_CAPABLE; - case 47: - return CLI_USER_NAME; - case 72: - return CLI_TXN_ISOLATION_OPTION; - case 73: - return CLI_INTEGRITY; - case 81: - return CLI_GETDATA_EXTENSIONS; - case 85: - return CLI_NULL_COLLATION; - case 86: - return CLI_ALTER_TABLE; - case 90: - return CLI_ORDER_BY_COLUMNS_IN_SELECT; - case 94: - return CLI_SPECIAL_CHARACTERS; - case 97: - return CLI_MAX_COLUMNS_IN_GROUP_BY; - case 98: - return CLI_MAX_COLUMNS_IN_INDEX; - case 99: - return CLI_MAX_COLUMNS_IN_ORDER_BY; - case 100: - return CLI_MAX_COLUMNS_IN_SELECT; - case 101: - return CLI_MAX_COLUMNS_IN_TABLE; - case 102: - return CLI_MAX_INDEX_SIZE; - case 104: - return CLI_MAX_ROW_SIZE; - case 105: - return CLI_MAX_STATEMENT_LEN; - case 106: - return CLI_MAX_TABLES_IN_SELECT; - case 107: - return CLI_MAX_USER_NAME_LEN; - case 115: - return CLI_OJ_CAPABILITIES; - case 10000: - return CLI_XOPEN_CLI_YEAR; - case 10001: - return CLI_CURSOR_SENSITIVITY; - case 10002: - return CLI_DESCRIBE_PARAMETER; - case 10003: - return CLI_CATALOG_NAME; - case 10004: - return CLI_COLLATION_SEQ; - case 10005: - return CLI_MAX_IDENTIFIER_LEN; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetInfoValue.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetInfoValue.java deleted file mode 100644 index fe2a211c46309..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetInfoValue.java +++ /dev/null @@ -1,593 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetInfoValue extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoValue"); - private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField SMALL_INT_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("smallIntValue", org.apache.thrift.protocol.TType.I16, (short)2); - private static final org.apache.thrift.protocol.TField INTEGER_BITMASK_FIELD_DESC = new org.apache.thrift.protocol.TField("integerBitmask", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField INTEGER_FLAG_FIELD_DESC = new org.apache.thrift.protocol.TField("integerFlag", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField BINARY_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryValue", org.apache.thrift.protocol.TType.I32, (short)5); - private static final org.apache.thrift.protocol.TField LEN_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("lenValue", org.apache.thrift.protocol.TType.I64, (short)6); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STRING_VALUE((short)1, "stringValue"), - SMALL_INT_VALUE((short)2, "smallIntValue"), - INTEGER_BITMASK((short)3, "integerBitmask"), - INTEGER_FLAG((short)4, "integerFlag"), - BINARY_VALUE((short)5, "binaryValue"), - LEN_VALUE((short)6, "lenValue"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STRING_VALUE - return STRING_VALUE; - case 2: // SMALL_INT_VALUE - return SMALL_INT_VALUE; - case 3: // INTEGER_BITMASK - return INTEGER_BITMASK; - case 4: // INTEGER_FLAG - return INTEGER_FLAG; - case 5: // BINARY_VALUE - return BINARY_VALUE; - case 6: // LEN_VALUE - return LEN_VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SMALL_INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("smallIntValue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - tmpMap.put(_Fields.INTEGER_BITMASK, new org.apache.thrift.meta_data.FieldMetaData("integerBitmask", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.INTEGER_FLAG, new org.apache.thrift.meta_data.FieldMetaData("integerFlag", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.BINARY_VALUE, new org.apache.thrift.meta_data.FieldMetaData("binaryValue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.LEN_VALUE, new org.apache.thrift.meta_data.FieldMetaData("lenValue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoValue.class, metaDataMap); - } - - public TGetInfoValue() { - super(); - } - - public TGetInfoValue(TGetInfoValue._Fields setField, Object value) { - super(setField, value); - } - - public TGetInfoValue(TGetInfoValue other) { - super(other); - } - public TGetInfoValue deepCopy() { - return new TGetInfoValue(this); - } - - public static TGetInfoValue stringValue(String value) { - TGetInfoValue x = new TGetInfoValue(); - x.setStringValue(value); - return x; - } - - public static TGetInfoValue smallIntValue(short value) { - TGetInfoValue x = new TGetInfoValue(); - x.setSmallIntValue(value); - return x; - } - - public static TGetInfoValue integerBitmask(int value) { - TGetInfoValue x = new TGetInfoValue(); - x.setIntegerBitmask(value); - return x; - } - - public static TGetInfoValue integerFlag(int value) { - TGetInfoValue x = new TGetInfoValue(); - x.setIntegerFlag(value); - return x; - } - - public static TGetInfoValue binaryValue(int value) { - TGetInfoValue x = new TGetInfoValue(); - x.setBinaryValue(value); - return x; - } - - public static TGetInfoValue lenValue(long value) { - TGetInfoValue x = new TGetInfoValue(); - x.setLenValue(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case STRING_VALUE: - if (value instanceof String) { - break; - } - throw new ClassCastException("Was expecting value of type String for field 'stringValue', but got " + value.getClass().getSimpleName()); - case SMALL_INT_VALUE: - if (value instanceof Short) { - break; - } - throw new ClassCastException("Was expecting value of type Short for field 'smallIntValue', but got " + value.getClass().getSimpleName()); - case INTEGER_BITMASK: - if (value instanceof Integer) { - break; - } - throw new ClassCastException("Was expecting value of type Integer for field 'integerBitmask', but got " + value.getClass().getSimpleName()); - case INTEGER_FLAG: - if (value instanceof Integer) { - break; - } - throw new ClassCastException("Was expecting value of type Integer for field 'integerFlag', but got " + value.getClass().getSimpleName()); - case BINARY_VALUE: - if (value instanceof Integer) { - break; - } - throw new ClassCastException("Was expecting value of type Integer for field 'binaryValue', but got " + value.getClass().getSimpleName()); - case LEN_VALUE: - if (value instanceof Long) { - break; - } - throw new ClassCastException("Was expecting value of type Long for field 'lenValue', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case STRING_VALUE: - if (field.type == STRING_VALUE_FIELD_DESC.type) { - String stringValue; - stringValue = iprot.readString(); - return stringValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case SMALL_INT_VALUE: - if (field.type == SMALL_INT_VALUE_FIELD_DESC.type) { - Short smallIntValue; - smallIntValue = iprot.readI16(); - return smallIntValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case INTEGER_BITMASK: - if (field.type == INTEGER_BITMASK_FIELD_DESC.type) { - Integer integerBitmask; - integerBitmask = iprot.readI32(); - return integerBitmask; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case INTEGER_FLAG: - if (field.type == INTEGER_FLAG_FIELD_DESC.type) { - Integer integerFlag; - integerFlag = iprot.readI32(); - return integerFlag; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BINARY_VALUE: - if (field.type == BINARY_VALUE_FIELD_DESC.type) { - Integer binaryValue; - binaryValue = iprot.readI32(); - return binaryValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case LEN_VALUE: - if (field.type == LEN_VALUE_FIELD_DESC.type) { - Long lenValue; - lenValue = iprot.readI64(); - return lenValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case STRING_VALUE: - String stringValue = (String)value_; - oprot.writeString(stringValue); - return; - case SMALL_INT_VALUE: - Short smallIntValue = (Short)value_; - oprot.writeI16(smallIntValue); - return; - case INTEGER_BITMASK: - Integer integerBitmask = (Integer)value_; - oprot.writeI32(integerBitmask); - return; - case INTEGER_FLAG: - Integer integerFlag = (Integer)value_; - oprot.writeI32(integerFlag); - return; - case BINARY_VALUE: - Integer binaryValue = (Integer)value_; - oprot.writeI32(binaryValue); - return; - case LEN_VALUE: - Long lenValue = (Long)value_; - oprot.writeI64(lenValue); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case STRING_VALUE: - String stringValue; - stringValue = iprot.readString(); - return stringValue; - case SMALL_INT_VALUE: - Short smallIntValue; - smallIntValue = iprot.readI16(); - return smallIntValue; - case INTEGER_BITMASK: - Integer integerBitmask; - integerBitmask = iprot.readI32(); - return integerBitmask; - case INTEGER_FLAG: - Integer integerFlag; - integerFlag = iprot.readI32(); - return integerFlag; - case BINARY_VALUE: - Integer binaryValue; - binaryValue = iprot.readI32(); - return binaryValue; - case LEN_VALUE: - Long lenValue; - lenValue = iprot.readI64(); - return lenValue; - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case STRING_VALUE: - String stringValue = (String)value_; - oprot.writeString(stringValue); - return; - case SMALL_INT_VALUE: - Short smallIntValue = (Short)value_; - oprot.writeI16(smallIntValue); - return; - case INTEGER_BITMASK: - Integer integerBitmask = (Integer)value_; - oprot.writeI32(integerBitmask); - return; - case INTEGER_FLAG: - Integer integerFlag = (Integer)value_; - oprot.writeI32(integerFlag); - return; - case BINARY_VALUE: - Integer binaryValue = (Integer)value_; - oprot.writeI32(binaryValue); - return; - case LEN_VALUE: - Long lenValue = (Long)value_; - oprot.writeI64(lenValue); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case STRING_VALUE: - return STRING_VALUE_FIELD_DESC; - case SMALL_INT_VALUE: - return SMALL_INT_VALUE_FIELD_DESC; - case INTEGER_BITMASK: - return INTEGER_BITMASK_FIELD_DESC; - case INTEGER_FLAG: - return INTEGER_FLAG_FIELD_DESC; - case BINARY_VALUE: - return BINARY_VALUE_FIELD_DESC; - case LEN_VALUE: - return LEN_VALUE_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public String getStringValue() { - if (getSetField() == _Fields.STRING_VALUE) { - return (String)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringValue(String value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.STRING_VALUE; - value_ = value; - } - - public short getSmallIntValue() { - if (getSetField() == _Fields.SMALL_INT_VALUE) { - return (Short)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'smallIntValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setSmallIntValue(short value) { - setField_ = _Fields.SMALL_INT_VALUE; - value_ = value; - } - - public int getIntegerBitmask() { - if (getSetField() == _Fields.INTEGER_BITMASK) { - return (Integer)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'integerBitmask' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setIntegerBitmask(int value) { - setField_ = _Fields.INTEGER_BITMASK; - value_ = value; - } - - public int getIntegerFlag() { - if (getSetField() == _Fields.INTEGER_FLAG) { - return (Integer)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'integerFlag' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setIntegerFlag(int value) { - setField_ = _Fields.INTEGER_FLAG; - value_ = value; - } - - public int getBinaryValue() { - if (getSetField() == _Fields.BINARY_VALUE) { - return (Integer)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'binaryValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBinaryValue(int value) { - setField_ = _Fields.BINARY_VALUE; - value_ = value; - } - - public long getLenValue() { - if (getSetField() == _Fields.LEN_VALUE) { - return (Long)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'lenValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setLenValue(long value) { - setField_ = _Fields.LEN_VALUE; - value_ = value; - } - - public boolean isSetStringValue() { - return setField_ == _Fields.STRING_VALUE; - } - - - public boolean isSetSmallIntValue() { - return setField_ == _Fields.SMALL_INT_VALUE; - } - - - public boolean isSetIntegerBitmask() { - return setField_ == _Fields.INTEGER_BITMASK; - } - - - public boolean isSetIntegerFlag() { - return setField_ == _Fields.INTEGER_FLAG; - } - - - public boolean isSetBinaryValue() { - return setField_ == _Fields.BINARY_VALUE; - } - - - public boolean isSetLenValue() { - return setField_ == _Fields.LEN_VALUE; - } - - - public boolean equals(Object other) { - if (other instanceof TGetInfoValue) { - return equals((TGetInfoValue)other); - } else { - return false; - } - } - - public boolean equals(TGetInfoValue other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TGetInfoValue other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - HashCodeBuilder hcb = new HashCodeBuilder(); - hcb.append(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - hcb.append(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - hcb.append(value); - } - } - return hcb.toHashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetOperationStatusReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetOperationStatusReq.java deleted file mode 100644 index b88591ea1945b..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetOperationStatusReq.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetOperationStatusReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusReq"); - - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetOperationStatusReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetOperationStatusReqTupleSchemeFactory()); - } - - private TOperationHandle operationHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OPERATION_HANDLE((short)1, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusReq.class, metaDataMap); - } - - public TGetOperationStatusReq() { - } - - public TGetOperationStatusReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetOperationStatusReq(TGetOperationStatusReq other) { - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetOperationStatusReq deepCopy() { - return new TGetOperationStatusReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetOperationStatusReq) - return this.equals((TGetOperationStatusReq)that); - return false; - } - - public boolean equals(TGetOperationStatusReq that) { - if (that == null) - return false; - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - return builder.toHashCode(); - } - - public int compareTo(TGetOperationStatusReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetOperationStatusReq typedOther = (TGetOperationStatusReq)other; - - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetOperationStatusReq("); - boolean first = true; - - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetOperationStatusReqStandardSchemeFactory implements SchemeFactory { - public TGetOperationStatusReqStandardScheme getScheme() { - return new TGetOperationStatusReqStandardScheme(); - } - } - - private static class TGetOperationStatusReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetOperationStatusReqTupleSchemeFactory implements SchemeFactory { - public TGetOperationStatusReqTupleScheme getScheme() { - return new TGetOperationStatusReqTupleScheme(); - } - } - - private static class TGetOperationStatusReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.operationHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetOperationStatusResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetOperationStatusResp.java deleted file mode 100644 index 94ba6bb1146de..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetOperationStatusResp.java +++ /dev/null @@ -1,827 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetOperationStatusResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationState", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetOperationStatusRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetOperationStatusRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationState operationState; // optional - private String sqlState; // optional - private int errorCode; // optional - private String errorMessage; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - /** - * - * @see TOperationState - */ - OPERATION_STATE((short)2, "operationState"), - SQL_STATE((short)3, "sqlState"), - ERROR_CODE((short)4, "errorCode"), - ERROR_MESSAGE((short)5, "errorMessage"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_STATE - return OPERATION_STATE; - case 3: // SQL_STATE - return SQL_STATE; - case 4: // ERROR_CODE - return ERROR_CODE; - case 5: // ERROR_MESSAGE - return ERROR_MESSAGE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERRORCODE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.OPERATION_STATE,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_STATE, new org.apache.thrift.meta_data.FieldMetaData("operationState", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationState.class))); - tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusResp.class, metaDataMap); - } - - public TGetOperationStatusResp() { - } - - public TGetOperationStatusResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetOperationStatusResp(TGetOperationStatusResp other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationState()) { - this.operationState = other.operationState; - } - if (other.isSetSqlState()) { - this.sqlState = other.sqlState; - } - this.errorCode = other.errorCode; - if (other.isSetErrorMessage()) { - this.errorMessage = other.errorMessage; - } - } - - public TGetOperationStatusResp deepCopy() { - return new TGetOperationStatusResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationState = null; - this.sqlState = null; - setErrorCodeIsSet(false); - this.errorCode = 0; - this.errorMessage = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - /** - * - * @see TOperationState - */ - public TOperationState getOperationState() { - return this.operationState; - } - - /** - * - * @see TOperationState - */ - public void setOperationState(TOperationState operationState) { - this.operationState = operationState; - } - - public void unsetOperationState() { - this.operationState = null; - } - - /** Returns true if field operationState is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationState() { - return this.operationState != null; - } - - public void setOperationStateIsSet(boolean value) { - if (!value) { - this.operationState = null; - } - } - - public String getSqlState() { - return this.sqlState; - } - - public void setSqlState(String sqlState) { - this.sqlState = sqlState; - } - - public void unsetSqlState() { - this.sqlState = null; - } - - /** Returns true if field sqlState is set (has been assigned a value) and false otherwise */ - public boolean isSetSqlState() { - return this.sqlState != null; - } - - public void setSqlStateIsSet(boolean value) { - if (!value) { - this.sqlState = null; - } - } - - public int getErrorCode() { - return this.errorCode; - } - - public void setErrorCode(int errorCode) { - this.errorCode = errorCode; - setErrorCodeIsSet(true); - } - - public void unsetErrorCode() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); - } - - /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ - public boolean isSetErrorCode() { - return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); - } - - public void setErrorCodeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); - } - - public String getErrorMessage() { - return this.errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - public void unsetErrorMessage() { - this.errorMessage = null; - } - - /** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */ - public boolean isSetErrorMessage() { - return this.errorMessage != null; - } - - public void setErrorMessageIsSet(boolean value) { - if (!value) { - this.errorMessage = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_STATE: - if (value == null) { - unsetOperationState(); - } else { - setOperationState((TOperationState)value); - } - break; - - case SQL_STATE: - if (value == null) { - unsetSqlState(); - } else { - setSqlState((String)value); - } - break; - - case ERROR_CODE: - if (value == null) { - unsetErrorCode(); - } else { - setErrorCode((Integer)value); - } - break; - - case ERROR_MESSAGE: - if (value == null) { - unsetErrorMessage(); - } else { - setErrorMessage((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_STATE: - return getOperationState(); - - case SQL_STATE: - return getSqlState(); - - case ERROR_CODE: - return Integer.valueOf(getErrorCode()); - - case ERROR_MESSAGE: - return getErrorMessage(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_STATE: - return isSetOperationState(); - case SQL_STATE: - return isSetSqlState(); - case ERROR_CODE: - return isSetErrorCode(); - case ERROR_MESSAGE: - return isSetErrorMessage(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetOperationStatusResp) - return this.equals((TGetOperationStatusResp)that); - return false; - } - - public boolean equals(TGetOperationStatusResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationState = true && this.isSetOperationState(); - boolean that_present_operationState = true && that.isSetOperationState(); - if (this_present_operationState || that_present_operationState) { - if (!(this_present_operationState && that_present_operationState)) - return false; - if (!this.operationState.equals(that.operationState)) - return false; - } - - boolean this_present_sqlState = true && this.isSetSqlState(); - boolean that_present_sqlState = true && that.isSetSqlState(); - if (this_present_sqlState || that_present_sqlState) { - if (!(this_present_sqlState && that_present_sqlState)) - return false; - if (!this.sqlState.equals(that.sqlState)) - return false; - } - - boolean this_present_errorCode = true && this.isSetErrorCode(); - boolean that_present_errorCode = true && that.isSetErrorCode(); - if (this_present_errorCode || that_present_errorCode) { - if (!(this_present_errorCode && that_present_errorCode)) - return false; - if (this.errorCode != that.errorCode) - return false; - } - - boolean this_present_errorMessage = true && this.isSetErrorMessage(); - boolean that_present_errorMessage = true && that.isSetErrorMessage(); - if (this_present_errorMessage || that_present_errorMessage) { - if (!(this_present_errorMessage && that_present_errorMessage)) - return false; - if (!this.errorMessage.equals(that.errorMessage)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_operationState = true && (isSetOperationState()); - builder.append(present_operationState); - if (present_operationState) - builder.append(operationState.getValue()); - - boolean present_sqlState = true && (isSetSqlState()); - builder.append(present_sqlState); - if (present_sqlState) - builder.append(sqlState); - - boolean present_errorCode = true && (isSetErrorCode()); - builder.append(present_errorCode); - if (present_errorCode) - builder.append(errorCode); - - boolean present_errorMessage = true && (isSetErrorMessage()); - builder.append(present_errorMessage); - if (present_errorMessage) - builder.append(errorMessage); - - return builder.toHashCode(); - } - - public int compareTo(TGetOperationStatusResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetOperationStatusResp typedOther = (TGetOperationStatusResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationState()).compareTo(typedOther.isSetOperationState()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationState()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationState, typedOther.operationState); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(typedOther.isSetSqlState()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSqlState()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, typedOther.sqlState); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(typedOther.isSetErrorCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErrorCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, typedOther.errorCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(typedOther.isSetErrorMessage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErrorMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, typedOther.errorMessage); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetOperationStatusResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationState()) { - if (!first) sb.append(", "); - sb.append("operationState:"); - if (this.operationState == null) { - sb.append("null"); - } else { - sb.append(this.operationState); - } - first = false; - } - if (isSetSqlState()) { - if (!first) sb.append(", "); - sb.append("sqlState:"); - if (this.sqlState == null) { - sb.append("null"); - } else { - sb.append(this.sqlState); - } - first = false; - } - if (isSetErrorCode()) { - if (!first) sb.append(", "); - sb.append("errorCode:"); - sb.append(this.errorCode); - first = false; - } - if (isSetErrorMessage()) { - if (!first) sb.append(", "); - sb.append("errorMessage:"); - if (this.errorMessage == null) { - sb.append("null"); - } else { - sb.append(this.errorMessage); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetOperationStatusRespStandardSchemeFactory implements SchemeFactory { - public TGetOperationStatusRespStandardScheme getScheme() { - return new TGetOperationStatusRespStandardScheme(); - } - } - - private static class TGetOperationStatusRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_STATE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.operationState = TOperationState.findByValue(iprot.readI32()); - struct.setOperationStateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SQL_STATE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.sqlState = iprot.readString(); - struct.setSqlStateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // ERROR_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.errorCode = iprot.readI32(); - struct.setErrorCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // ERROR_MESSAGE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.errorMessage = iprot.readString(); - struct.setErrorMessageIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationState != null) { - if (struct.isSetOperationState()) { - oprot.writeFieldBegin(OPERATION_STATE_FIELD_DESC); - oprot.writeI32(struct.operationState.getValue()); - oprot.writeFieldEnd(); - } - } - if (struct.sqlState != null) { - if (struct.isSetSqlState()) { - oprot.writeFieldBegin(SQL_STATE_FIELD_DESC); - oprot.writeString(struct.sqlState); - oprot.writeFieldEnd(); - } - } - if (struct.isSetErrorCode()) { - oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); - oprot.writeI32(struct.errorCode); - oprot.writeFieldEnd(); - } - if (struct.errorMessage != null) { - if (struct.isSetErrorMessage()) { - oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC); - oprot.writeString(struct.errorMessage); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetOperationStatusRespTupleSchemeFactory implements SchemeFactory { - public TGetOperationStatusRespTupleScheme getScheme() { - return new TGetOperationStatusRespTupleScheme(); - } - } - - private static class TGetOperationStatusRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationState()) { - optionals.set(0); - } - if (struct.isSetSqlState()) { - optionals.set(1); - } - if (struct.isSetErrorCode()) { - optionals.set(2); - } - if (struct.isSetErrorMessage()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetOperationState()) { - oprot.writeI32(struct.operationState.getValue()); - } - if (struct.isSetSqlState()) { - oprot.writeString(struct.sqlState); - } - if (struct.isSetErrorCode()) { - oprot.writeI32(struct.errorCode); - } - if (struct.isSetErrorMessage()) { - oprot.writeString(struct.errorMessage); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.operationState = TOperationState.findByValue(iprot.readI32()); - struct.setOperationStateIsSet(true); - } - if (incoming.get(1)) { - struct.sqlState = iprot.readString(); - struct.setSqlStateIsSet(true); - } - if (incoming.get(2)) { - struct.errorCode = iprot.readI32(); - struct.setErrorCodeIsSet(true); - } - if (incoming.get(3)) { - struct.errorMessage = iprot.readString(); - struct.setErrorMessageIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetResultSetMetadataReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetResultSetMetadataReq.java deleted file mode 100644 index 3bf363c958468..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetResultSetMetadataReq.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetResultSetMetadataReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataReq"); - - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetResultSetMetadataReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetResultSetMetadataReqTupleSchemeFactory()); - } - - private TOperationHandle operationHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OPERATION_HANDLE((short)1, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataReq.class, metaDataMap); - } - - public TGetResultSetMetadataReq() { - } - - public TGetResultSetMetadataReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetResultSetMetadataReq(TGetResultSetMetadataReq other) { - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetResultSetMetadataReq deepCopy() { - return new TGetResultSetMetadataReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetResultSetMetadataReq) - return this.equals((TGetResultSetMetadataReq)that); - return false; - } - - public boolean equals(TGetResultSetMetadataReq that) { - if (that == null) - return false; - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - return builder.toHashCode(); - } - - public int compareTo(TGetResultSetMetadataReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetResultSetMetadataReq typedOther = (TGetResultSetMetadataReq)other; - - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetResultSetMetadataReq("); - boolean first = true; - - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetResultSetMetadataReqStandardSchemeFactory implements SchemeFactory { - public TGetResultSetMetadataReqStandardScheme getScheme() { - return new TGetResultSetMetadataReqStandardScheme(); - } - } - - private static class TGetResultSetMetadataReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetResultSetMetadataReqTupleSchemeFactory implements SchemeFactory { - public TGetResultSetMetadataReqTupleScheme getScheme() { - return new TGetResultSetMetadataReqTupleScheme(); - } - } - - private static class TGetResultSetMetadataReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.operationHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetResultSetMetadataResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetResultSetMetadataResp.java deleted file mode 100644 index a9bef9f722c16..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetResultSetMetadataResp.java +++ /dev/null @@ -1,505 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetResultSetMetadataResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetResultSetMetadataRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetResultSetMetadataRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TTableSchema schema; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - SCHEMA((short)2, "schema"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // SCHEMA - return SCHEMA; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.SCHEMA}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("schema", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTableSchema.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataResp.class, metaDataMap); - } - - public TGetResultSetMetadataResp() { - } - - public TGetResultSetMetadataResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetResultSetMetadataResp(TGetResultSetMetadataResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetSchema()) { - this.schema = new TTableSchema(other.schema); - } - } - - public TGetResultSetMetadataResp deepCopy() { - return new TGetResultSetMetadataResp(this); - } - - @Override - public void clear() { - this.status = null; - this.schema = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TTableSchema getSchema() { - return this.schema; - } - - public void setSchema(TTableSchema schema) { - this.schema = schema; - } - - public void unsetSchema() { - this.schema = null; - } - - /** Returns true if field schema is set (has been assigned a value) and false otherwise */ - public boolean isSetSchema() { - return this.schema != null; - } - - public void setSchemaIsSet(boolean value) { - if (!value) { - this.schema = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case SCHEMA: - if (value == null) { - unsetSchema(); - } else { - setSchema((TTableSchema)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case SCHEMA: - return getSchema(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case SCHEMA: - return isSetSchema(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetResultSetMetadataResp) - return this.equals((TGetResultSetMetadataResp)that); - return false; - } - - public boolean equals(TGetResultSetMetadataResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_schema = true && this.isSetSchema(); - boolean that_present_schema = true && that.isSetSchema(); - if (this_present_schema || that_present_schema) { - if (!(this_present_schema && that_present_schema)) - return false; - if (!this.schema.equals(that.schema)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_schema = true && (isSetSchema()); - builder.append(present_schema); - if (present_schema) - builder.append(schema); - - return builder.toHashCode(); - } - - public int compareTo(TGetResultSetMetadataResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetResultSetMetadataResp typedOther = (TGetResultSetMetadataResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSchema()).compareTo(typedOther.isSetSchema()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchema()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema, typedOther.schema); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetResultSetMetadataResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetSchema()) { - if (!first) sb.append(", "); - sb.append("schema:"); - if (this.schema == null) { - sb.append("null"); - } else { - sb.append(this.schema); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (schema != null) { - schema.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetResultSetMetadataRespStandardSchemeFactory implements SchemeFactory { - public TGetResultSetMetadataRespStandardScheme getScheme() { - return new TGetResultSetMetadataRespStandardScheme(); - } - } - - private static class TGetResultSetMetadataRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SCHEMA - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.schema = new TTableSchema(); - struct.schema.read(iprot); - struct.setSchemaIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.schema != null) { - if (struct.isSetSchema()) { - oprot.writeFieldBegin(SCHEMA_FIELD_DESC); - struct.schema.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetResultSetMetadataRespTupleSchemeFactory implements SchemeFactory { - public TGetResultSetMetadataRespTupleScheme getScheme() { - return new TGetResultSetMetadataRespTupleScheme(); - } - } - - private static class TGetResultSetMetadataRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetSchema()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSchema()) { - struct.schema.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.schema = new TTableSchema(); - struct.schema.read(iprot); - struct.setSchemaIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetSchemasReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetSchemasReq.java deleted file mode 100644 index c2aadaa49a1e9..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetSchemasReq.java +++ /dev/null @@ -1,606 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetSchemasReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetSchemasReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetSchemasReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasReq.class, metaDataMap); - } - - public TGetSchemasReq() { - } - - public TGetSchemasReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetSchemasReq(TGetSchemasReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - } - - public TGetSchemasReq deepCopy() { - return new TGetSchemasReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - public String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetSchemasReq) - return this.equals((TGetSchemasReq)that); - return false; - } - - public boolean equals(TGetSchemasReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - boolean present_catalogName = true && (isSetCatalogName()); - builder.append(present_catalogName); - if (present_catalogName) - builder.append(catalogName); - - boolean present_schemaName = true && (isSetSchemaName()); - builder.append(present_schemaName); - if (present_schemaName) - builder.append(schemaName); - - return builder.toHashCode(); - } - - public int compareTo(TGetSchemasReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetSchemasReq typedOther = (TGetSchemasReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(typedOther.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, typedOther.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(typedOther.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, typedOther.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetSchemasReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetSchemasReqStandardSchemeFactory implements SchemeFactory { - public TGetSchemasReqStandardScheme getScheme() { - return new TGetSchemasReqStandardScheme(); - } - } - - private static class TGetSchemasReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetSchemasReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetSchemasReqTupleSchemeFactory implements SchemeFactory { - public TGetSchemasReqTupleScheme getScheme() { - return new TGetSchemasReqTupleScheme(); - } - } - - private static class TGetSchemasReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetSchemasResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetSchemasResp.java deleted file mode 100644 index ac1ea3e7cc7af..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetSchemasResp.java +++ /dev/null @@ -1,505 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetSchemasResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetSchemasRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetSchemasRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasResp.class, metaDataMap); - } - - public TGetSchemasResp() { - } - - public TGetSchemasResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetSchemasResp(TGetSchemasResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetSchemasResp deepCopy() { - return new TGetSchemasResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetSchemasResp) - return this.equals((TGetSchemasResp)that); - return false; - } - - public boolean equals(TGetSchemasResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - return builder.toHashCode(); - } - - public int compareTo(TGetSchemasResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetSchemasResp typedOther = (TGetSchemasResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetSchemasResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetSchemasRespStandardSchemeFactory implements SchemeFactory { - public TGetSchemasRespStandardScheme getScheme() { - return new TGetSchemasRespStandardScheme(); - } - } - - private static class TGetSchemasRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetSchemasResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetSchemasRespTupleSchemeFactory implements SchemeFactory { - public TGetSchemasRespTupleScheme getScheme() { - return new TGetSchemasRespTupleScheme(); - } - } - - private static class TGetSchemasRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTableTypesReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTableTypesReq.java deleted file mode 100644 index 6f2c713e0be6a..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTableTypesReq.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetTableTypesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTableTypesReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTableTypesReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesReq.class, metaDataMap); - } - - public TGetTableTypesReq() { - } - - public TGetTableTypesReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetTableTypesReq(TGetTableTypesReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - } - - public TGetTableTypesReq deepCopy() { - return new TGetTableTypesReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetTableTypesReq) - return this.equals((TGetTableTypesReq)that); - return false; - } - - public boolean equals(TGetTableTypesReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - return builder.toHashCode(); - } - - public int compareTo(TGetTableTypesReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetTableTypesReq typedOther = (TGetTableTypesReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTableTypesReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetTableTypesReqStandardSchemeFactory implements SchemeFactory { - public TGetTableTypesReqStandardScheme getScheme() { - return new TGetTableTypesReqStandardScheme(); - } - } - - private static class TGetTableTypesReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTableTypesReqTupleSchemeFactory implements SchemeFactory { - public TGetTableTypesReqTupleScheme getScheme() { - return new TGetTableTypesReqTupleScheme(); - } - } - - private static class TGetTableTypesReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTableTypesResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTableTypesResp.java deleted file mode 100644 index 6f33fbcf5dadc..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTableTypesResp.java +++ /dev/null @@ -1,505 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetTableTypesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTableTypesRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTableTypesRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesResp.class, metaDataMap); - } - - public TGetTableTypesResp() { - } - - public TGetTableTypesResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetTableTypesResp(TGetTableTypesResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetTableTypesResp deepCopy() { - return new TGetTableTypesResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetTableTypesResp) - return this.equals((TGetTableTypesResp)that); - return false; - } - - public boolean equals(TGetTableTypesResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - return builder.toHashCode(); - } - - public int compareTo(TGetTableTypesResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetTableTypesResp typedOther = (TGetTableTypesResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTableTypesResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetTableTypesRespStandardSchemeFactory implements SchemeFactory { - public TGetTableTypesRespStandardScheme getScheme() { - return new TGetTableTypesRespStandardScheme(); - } - } - - private static class TGetTableTypesRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTableTypesRespTupleSchemeFactory implements SchemeFactory { - public TGetTableTypesRespTupleScheme getScheme() { - return new TGetTableTypesRespTupleScheme(); - } - } - - private static class TGetTableTypesRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTablesReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTablesReq.java deleted file mode 100644 index c973fcc24cb10..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTablesReq.java +++ /dev/null @@ -1,870 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetTablesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField TABLE_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("tableTypes", org.apache.thrift.protocol.TType.LIST, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTablesReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTablesReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - private String tableName; // optional - private List tableTypes; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"), - TABLE_NAME((short)4, "tableName"), - TABLE_TYPES((short)5, "tableTypes"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - case 4: // TABLE_NAME - return TABLE_NAME; - case 5: // TABLE_TYPES - return TABLE_TYPES; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.TABLE_TYPES}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.TABLE_TYPES, new org.apache.thrift.meta_data.FieldMetaData("tableTypes", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesReq.class, metaDataMap); - } - - public TGetTablesReq() { - } - - public TGetTablesReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetTablesReq(TGetTablesReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - if (other.isSetTableName()) { - this.tableName = other.tableName; - } - if (other.isSetTableTypes()) { - List __this__tableTypes = new ArrayList(); - for (String other_element : other.tableTypes) { - __this__tableTypes.add(other_element); - } - this.tableTypes = __this__tableTypes; - } - } - - public TGetTablesReq deepCopy() { - return new TGetTablesReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - this.tableName = null; - this.tableTypes = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - public String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - public String getTableName() { - return this.tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public void unsetTableName() { - this.tableName = null; - } - - /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ - public boolean isSetTableName() { - return this.tableName != null; - } - - public void setTableNameIsSet(boolean value) { - if (!value) { - this.tableName = null; - } - } - - public int getTableTypesSize() { - return (this.tableTypes == null) ? 0 : this.tableTypes.size(); - } - - public java.util.Iterator getTableTypesIterator() { - return (this.tableTypes == null) ? null : this.tableTypes.iterator(); - } - - public void addToTableTypes(String elem) { - if (this.tableTypes == null) { - this.tableTypes = new ArrayList(); - } - this.tableTypes.add(elem); - } - - public List getTableTypes() { - return this.tableTypes; - } - - public void setTableTypes(List tableTypes) { - this.tableTypes = tableTypes; - } - - public void unsetTableTypes() { - this.tableTypes = null; - } - - /** Returns true if field tableTypes is set (has been assigned a value) and false otherwise */ - public boolean isSetTableTypes() { - return this.tableTypes != null; - } - - public void setTableTypesIsSet(boolean value) { - if (!value) { - this.tableTypes = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((String)value); - } - break; - - case TABLE_NAME: - if (value == null) { - unsetTableName(); - } else { - setTableName((String)value); - } - break; - - case TABLE_TYPES: - if (value == null) { - unsetTableTypes(); - } else { - setTableTypes((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - case TABLE_NAME: - return getTableName(); - - case TABLE_TYPES: - return getTableTypes(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - case TABLE_NAME: - return isSetTableName(); - case TABLE_TYPES: - return isSetTableTypes(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetTablesReq) - return this.equals((TGetTablesReq)that); - return false; - } - - public boolean equals(TGetTablesReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - boolean this_present_tableName = true && this.isSetTableName(); - boolean that_present_tableName = true && that.isSetTableName(); - if (this_present_tableName || that_present_tableName) { - if (!(this_present_tableName && that_present_tableName)) - return false; - if (!this.tableName.equals(that.tableName)) - return false; - } - - boolean this_present_tableTypes = true && this.isSetTableTypes(); - boolean that_present_tableTypes = true && that.isSetTableTypes(); - if (this_present_tableTypes || that_present_tableTypes) { - if (!(this_present_tableTypes && that_present_tableTypes)) - return false; - if (!this.tableTypes.equals(that.tableTypes)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - boolean present_catalogName = true && (isSetCatalogName()); - builder.append(present_catalogName); - if (present_catalogName) - builder.append(catalogName); - - boolean present_schemaName = true && (isSetSchemaName()); - builder.append(present_schemaName); - if (present_schemaName) - builder.append(schemaName); - - boolean present_tableName = true && (isSetTableName()); - builder.append(present_tableName); - if (present_tableName) - builder.append(tableName); - - boolean present_tableTypes = true && (isSetTableTypes()); - builder.append(present_tableTypes); - if (present_tableTypes) - builder.append(tableTypes); - - return builder.toHashCode(); - } - - public int compareTo(TGetTablesReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetTablesReq typedOther = (TGetTablesReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(typedOther.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, typedOther.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(typedOther.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, typedOther.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(typedOther.isSetTableName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTableName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, typedOther.tableName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTableTypes()).compareTo(typedOther.isSetTableTypes()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTableTypes()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableTypes, typedOther.tableTypes); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTablesReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - if (isSetTableName()) { - if (!first) sb.append(", "); - sb.append("tableName:"); - if (this.tableName == null) { - sb.append("null"); - } else { - sb.append(this.tableName); - } - first = false; - } - if (isSetTableTypes()) { - if (!first) sb.append(", "); - sb.append("tableTypes:"); - if (this.tableTypes == null) { - sb.append("null"); - } else { - sb.append(this.tableTypes); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetTablesReqStandardSchemeFactory implements SchemeFactory { - public TGetTablesReqStandardScheme getScheme() { - return new TGetTablesReqStandardScheme(); - } - } - - private static class TGetTablesReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // TABLE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // TABLE_TYPES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list172 = iprot.readListBegin(); - struct.tableTypes = new ArrayList(_list172.size); - for (int _i173 = 0; _i173 < _list172.size; ++_i173) - { - String _elem174; // optional - _elem174 = iprot.readString(); - struct.tableTypes.add(_elem174); - } - iprot.readListEnd(); - } - struct.setTableTypesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - if (struct.tableName != null) { - if (struct.isSetTableName()) { - oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); - oprot.writeString(struct.tableName); - oprot.writeFieldEnd(); - } - } - if (struct.tableTypes != null) { - if (struct.isSetTableTypes()) { - oprot.writeFieldBegin(TABLE_TYPES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tableTypes.size())); - for (String _iter175 : struct.tableTypes) - { - oprot.writeString(_iter175); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTablesReqTupleSchemeFactory implements SchemeFactory { - public TGetTablesReqTupleScheme getScheme() { - return new TGetTablesReqTupleScheme(); - } - } - - private static class TGetTablesReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - if (struct.isSetTableName()) { - optionals.set(2); - } - if (struct.isSetTableTypes()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - if (struct.isSetTableName()) { - oprot.writeString(struct.tableName); - } - if (struct.isSetTableTypes()) { - { - oprot.writeI32(struct.tableTypes.size()); - for (String _iter176 : struct.tableTypes) - { - oprot.writeString(_iter176); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - if (incoming.get(2)) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } - if (incoming.get(3)) { - { - org.apache.thrift.protocol.TList _list177 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.tableTypes = new ArrayList(_list177.size); - for (int _i178 = 0; _i178 < _list177.size; ++_i178) - { - String _elem179; // optional - _elem179 = iprot.readString(); - struct.tableTypes.add(_elem179); - } - } - struct.setTableTypesIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTablesResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTablesResp.java deleted file mode 100644 index d526f4478a24e..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTablesResp.java +++ /dev/null @@ -1,505 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetTablesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTablesRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTablesRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesResp.class, metaDataMap); - } - - public TGetTablesResp() { - } - - public TGetTablesResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetTablesResp(TGetTablesResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetTablesResp deepCopy() { - return new TGetTablesResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetTablesResp) - return this.equals((TGetTablesResp)that); - return false; - } - - public boolean equals(TGetTablesResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - return builder.toHashCode(); - } - - public int compareTo(TGetTablesResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetTablesResp typedOther = (TGetTablesResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTablesResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetTablesRespStandardSchemeFactory implements SchemeFactory { - public TGetTablesRespStandardScheme getScheme() { - return new TGetTablesRespStandardScheme(); - } - } - - private static class TGetTablesRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTablesRespTupleSchemeFactory implements SchemeFactory { - public TGetTablesRespTupleScheme getScheme() { - return new TGetTablesRespTupleScheme(); - } - } - - private static class TGetTablesRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTypeInfoReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTypeInfoReq.java deleted file mode 100644 index d40115e83ec45..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTypeInfoReq.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetTypeInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTypeInfoReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTypeInfoReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoReq.class, metaDataMap); - } - - public TGetTypeInfoReq() { - } - - public TGetTypeInfoReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetTypeInfoReq(TGetTypeInfoReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - } - - public TGetTypeInfoReq deepCopy() { - return new TGetTypeInfoReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetTypeInfoReq) - return this.equals((TGetTypeInfoReq)that); - return false; - } - - public boolean equals(TGetTypeInfoReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - return builder.toHashCode(); - } - - public int compareTo(TGetTypeInfoReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetTypeInfoReq typedOther = (TGetTypeInfoReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTypeInfoReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetTypeInfoReqStandardSchemeFactory implements SchemeFactory { - public TGetTypeInfoReqStandardScheme getScheme() { - return new TGetTypeInfoReqStandardScheme(); - } - } - - private static class TGetTypeInfoReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTypeInfoReqTupleSchemeFactory implements SchemeFactory { - public TGetTypeInfoReqTupleScheme getScheme() { - return new TGetTypeInfoReqTupleScheme(); - } - } - - private static class TGetTypeInfoReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTypeInfoResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTypeInfoResp.java deleted file mode 100644 index 59be1a33b55e2..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TGetTypeInfoResp.java +++ /dev/null @@ -1,505 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TGetTypeInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTypeInfoRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTypeInfoRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoResp.class, metaDataMap); - } - - public TGetTypeInfoResp() { - } - - public TGetTypeInfoResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetTypeInfoResp(TGetTypeInfoResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetTypeInfoResp deepCopy() { - return new TGetTypeInfoResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetTypeInfoResp) - return this.equals((TGetTypeInfoResp)that); - return false; - } - - public boolean equals(TGetTypeInfoResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - builder.append(present_operationHandle); - if (present_operationHandle) - builder.append(operationHandle); - - return builder.toHashCode(); - } - - public int compareTo(TGetTypeInfoResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TGetTypeInfoResp typedOther = (TGetTypeInfoResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(typedOther.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, typedOther.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTypeInfoResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetTypeInfoRespStandardSchemeFactory implements SchemeFactory { - public TGetTypeInfoRespStandardScheme getScheme() { - return new TGetTypeInfoRespStandardScheme(); - } - } - - private static class TGetTypeInfoRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTypeInfoRespTupleSchemeFactory implements SchemeFactory { - public TGetTypeInfoRespTupleScheme getScheme() { - return new TGetTypeInfoRespTupleScheme(); - } - } - - private static class TGetTypeInfoRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/THandleIdentifier.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/THandleIdentifier.java deleted file mode 100644 index 368273c341c7b..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/THandleIdentifier.java +++ /dev/null @@ -1,506 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class THandleIdentifier implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THandleIdentifier"); - - private static final org.apache.thrift.protocol.TField GUID_FIELD_DESC = new org.apache.thrift.protocol.TField("guid", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField SECRET_FIELD_DESC = new org.apache.thrift.protocol.TField("secret", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new THandleIdentifierStandardSchemeFactory()); - schemes.put(TupleScheme.class, new THandleIdentifierTupleSchemeFactory()); - } - - private ByteBuffer guid; // required - private ByteBuffer secret; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - GUID((short)1, "guid"), - SECRET((short)2, "secret"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // GUID - return GUID; - case 2: // SECRET - return SECRET; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.GUID, new org.apache.thrift.meta_data.FieldMetaData("guid", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.SECRET, new org.apache.thrift.meta_data.FieldMetaData("secret", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(THandleIdentifier.class, metaDataMap); - } - - public THandleIdentifier() { - } - - public THandleIdentifier( - ByteBuffer guid, - ByteBuffer secret) - { - this(); - this.guid = guid; - this.secret = secret; - } - - /** - * Performs a deep copy on other. - */ - public THandleIdentifier(THandleIdentifier other) { - if (other.isSetGuid()) { - this.guid = org.apache.thrift.TBaseHelper.copyBinary(other.guid); -; - } - if (other.isSetSecret()) { - this.secret = org.apache.thrift.TBaseHelper.copyBinary(other.secret); -; - } - } - - public THandleIdentifier deepCopy() { - return new THandleIdentifier(this); - } - - @Override - public void clear() { - this.guid = null; - this.secret = null; - } - - public byte[] getGuid() { - setGuid(org.apache.thrift.TBaseHelper.rightSize(guid)); - return guid == null ? null : guid.array(); - } - - public ByteBuffer bufferForGuid() { - return guid; - } - - public void setGuid(byte[] guid) { - setGuid(guid == null ? (ByteBuffer)null : ByteBuffer.wrap(guid)); - } - - public void setGuid(ByteBuffer guid) { - this.guid = guid; - } - - public void unsetGuid() { - this.guid = null; - } - - /** Returns true if field guid is set (has been assigned a value) and false otherwise */ - public boolean isSetGuid() { - return this.guid != null; - } - - public void setGuidIsSet(boolean value) { - if (!value) { - this.guid = null; - } - } - - public byte[] getSecret() { - setSecret(org.apache.thrift.TBaseHelper.rightSize(secret)); - return secret == null ? null : secret.array(); - } - - public ByteBuffer bufferForSecret() { - return secret; - } - - public void setSecret(byte[] secret) { - setSecret(secret == null ? (ByteBuffer)null : ByteBuffer.wrap(secret)); - } - - public void setSecret(ByteBuffer secret) { - this.secret = secret; - } - - public void unsetSecret() { - this.secret = null; - } - - /** Returns true if field secret is set (has been assigned a value) and false otherwise */ - public boolean isSetSecret() { - return this.secret != null; - } - - public void setSecretIsSet(boolean value) { - if (!value) { - this.secret = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case GUID: - if (value == null) { - unsetGuid(); - } else { - setGuid((ByteBuffer)value); - } - break; - - case SECRET: - if (value == null) { - unsetSecret(); - } else { - setSecret((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case GUID: - return getGuid(); - - case SECRET: - return getSecret(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case GUID: - return isSetGuid(); - case SECRET: - return isSetSecret(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof THandleIdentifier) - return this.equals((THandleIdentifier)that); - return false; - } - - public boolean equals(THandleIdentifier that) { - if (that == null) - return false; - - boolean this_present_guid = true && this.isSetGuid(); - boolean that_present_guid = true && that.isSetGuid(); - if (this_present_guid || that_present_guid) { - if (!(this_present_guid && that_present_guid)) - return false; - if (!this.guid.equals(that.guid)) - return false; - } - - boolean this_present_secret = true && this.isSetSecret(); - boolean that_present_secret = true && that.isSetSecret(); - if (this_present_secret || that_present_secret) { - if (!(this_present_secret && that_present_secret)) - return false; - if (!this.secret.equals(that.secret)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_guid = true && (isSetGuid()); - builder.append(present_guid); - if (present_guid) - builder.append(guid); - - boolean present_secret = true && (isSetSecret()); - builder.append(present_secret); - if (present_secret) - builder.append(secret); - - return builder.toHashCode(); - } - - public int compareTo(THandleIdentifier other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - THandleIdentifier typedOther = (THandleIdentifier)other; - - lastComparison = Boolean.valueOf(isSetGuid()).compareTo(typedOther.isSetGuid()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGuid()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.guid, typedOther.guid); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSecret()).compareTo(typedOther.isSetSecret()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSecret()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.secret, typedOther.secret); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("THandleIdentifier("); - boolean first = true; - - sb.append("guid:"); - if (this.guid == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.guid, sb); - } - first = false; - if (!first) sb.append(", "); - sb.append("secret:"); - if (this.secret == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.secret, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetGuid()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'guid' is unset! Struct:" + toString()); - } - - if (!isSetSecret()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'secret' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class THandleIdentifierStandardSchemeFactory implements SchemeFactory { - public THandleIdentifierStandardScheme getScheme() { - return new THandleIdentifierStandardScheme(); - } - } - - private static class THandleIdentifierStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, THandleIdentifier struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // GUID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.guid = iprot.readBinary(); - struct.setGuidIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SECRET - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.secret = iprot.readBinary(); - struct.setSecretIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, THandleIdentifier struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.guid != null) { - oprot.writeFieldBegin(GUID_FIELD_DESC); - oprot.writeBinary(struct.guid); - oprot.writeFieldEnd(); - } - if (struct.secret != null) { - oprot.writeFieldBegin(SECRET_FIELD_DESC); - oprot.writeBinary(struct.secret); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class THandleIdentifierTupleSchemeFactory implements SchemeFactory { - public THandleIdentifierTupleScheme getScheme() { - return new THandleIdentifierTupleScheme(); - } - } - - private static class THandleIdentifierTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeBinary(struct.guid); - oprot.writeBinary(struct.secret); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.guid = iprot.readBinary(); - struct.setGuidIsSet(true); - struct.secret = iprot.readBinary(); - struct.setSecretIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI16Column.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI16Column.java deleted file mode 100644 index c83663072f877..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI16Column.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TI16Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Column"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI16ColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI16ColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Column.class, metaDataMap); - } - - public TI16Column() { - } - - public TI16Column( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = nulls; - } - - /** - * Performs a deep copy on other. - */ - public TI16Column(TI16Column other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(); - for (Short other_element : other.values) { - __this__values.add(other_element); - } - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); -; - } - } - - public TI16Column deepCopy() { - return new TI16Column(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(short elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return nulls; - } - - public void setNulls(byte[] nulls) { - setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = nulls; - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TI16Column) - return this.equals((TI16Column)that); - return false; - } - - public boolean equals(TI16Column that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_values = true && (isSetValues()); - builder.append(present_values); - if (present_values) - builder.append(values); - - boolean present_nulls = true && (isSetNulls()); - builder.append(present_nulls); - if (present_nulls) - builder.append(nulls); - - return builder.toHashCode(); - } - - public int compareTo(TI16Column other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TI16Column typedOther = (TI16Column)other; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI16Column("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TI16ColumnStandardSchemeFactory implements SchemeFactory { - public TI16ColumnStandardScheme getScheme() { - return new TI16ColumnStandardScheme(); - } - } - - private static class TI16ColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list70 = iprot.readListBegin(); - struct.values = new ArrayList(_list70.size); - for (int _i71 = 0; _i71 < _list70.size; ++_i71) - { - short _elem72; // optional - _elem72 = iprot.readI16(); - struct.values.add(_elem72); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TI16Column struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, struct.values.size())); - for (short _iter73 : struct.values) - { - oprot.writeI16(_iter73); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI16ColumnTupleSchemeFactory implements SchemeFactory { - public TI16ColumnTupleScheme getScheme() { - return new TI16ColumnTupleScheme(); - } - } - - private static class TI16ColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (short _iter74 : struct.values) - { - oprot.writeI16(_iter74); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list75 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, iprot.readI32()); - struct.values = new ArrayList(_list75.size); - for (int _i76 = 0; _i76 < _list75.size; ++_i76) - { - short _elem77; // optional - _elem77 = iprot.readI16(); - struct.values.add(_elem77); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI16Value.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI16Value.java deleted file mode 100644 index bb5ae9609de86..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI16Value.java +++ /dev/null @@ -1,386 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TI16Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Value"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I16, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI16ValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI16ValueTupleSchemeFactory()); - } - - private short value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Value.class, metaDataMap); - } - - public TI16Value() { - } - - /** - * Performs a deep copy on other. - */ - public TI16Value(TI16Value other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TI16Value deepCopy() { - return new TI16Value(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0; - } - - public short getValue() { - return this.value; - } - - public void setValue(short value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((Short)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return Short.valueOf(getValue()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TI16Value) - return this.equals((TI16Value)that); - return false; - } - - public boolean equals(TI16Value that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); - - return builder.toHashCode(); - } - - public int compareTo(TI16Value other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TI16Value typedOther = (TI16Value)other; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI16Value("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TI16ValueStandardSchemeFactory implements SchemeFactory { - public TI16ValueStandardScheme getScheme() { - return new TI16ValueStandardScheme(); - } - } - - private static class TI16ValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.value = iprot.readI16(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TI16Value struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeI16(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI16ValueTupleSchemeFactory implements SchemeFactory { - public TI16ValueTupleScheme getScheme() { - return new TI16ValueTupleScheme(); - } - } - - private static class TI16ValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeI16(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readI16(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI32Column.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI32Column.java deleted file mode 100644 index 6c6c5f35b7c8e..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI32Column.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TI32Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Column"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI32ColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI32ColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Column.class, metaDataMap); - } - - public TI32Column() { - } - - public TI32Column( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = nulls; - } - - /** - * Performs a deep copy on other. - */ - public TI32Column(TI32Column other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(); - for (Integer other_element : other.values) { - __this__values.add(other_element); - } - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); -; - } - } - - public TI32Column deepCopy() { - return new TI32Column(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(int elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return nulls; - } - - public void setNulls(byte[] nulls) { - setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = nulls; - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TI32Column) - return this.equals((TI32Column)that); - return false; - } - - public boolean equals(TI32Column that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_values = true && (isSetValues()); - builder.append(present_values); - if (present_values) - builder.append(values); - - boolean present_nulls = true && (isSetNulls()); - builder.append(present_nulls); - if (present_nulls) - builder.append(nulls); - - return builder.toHashCode(); - } - - public int compareTo(TI32Column other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TI32Column typedOther = (TI32Column)other; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI32Column("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TI32ColumnStandardSchemeFactory implements SchemeFactory { - public TI32ColumnStandardScheme getScheme() { - return new TI32ColumnStandardScheme(); - } - } - - private static class TI32ColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list78 = iprot.readListBegin(); - struct.values = new ArrayList(_list78.size); - for (int _i79 = 0; _i79 < _list78.size; ++_i79) - { - int _elem80; // optional - _elem80 = iprot.readI32(); - struct.values.add(_elem80); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TI32Column struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.values.size())); - for (int _iter81 : struct.values) - { - oprot.writeI32(_iter81); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI32ColumnTupleSchemeFactory implements SchemeFactory { - public TI32ColumnTupleScheme getScheme() { - return new TI32ColumnTupleScheme(); - } - } - - private static class TI32ColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (int _iter82 : struct.values) - { - oprot.writeI32(_iter82); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list83 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.values = new ArrayList(_list83.size); - for (int _i84 = 0; _i84 < _list83.size; ++_i84) - { - int _elem85; // optional - _elem85 = iprot.readI32(); - struct.values.add(_elem85); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI32Value.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI32Value.java deleted file mode 100644 index 059408b96c8ce..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI32Value.java +++ /dev/null @@ -1,386 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TI32Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Value"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I32, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI32ValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI32ValueTupleSchemeFactory()); - } - - private int value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Value.class, metaDataMap); - } - - public TI32Value() { - } - - /** - * Performs a deep copy on other. - */ - public TI32Value(TI32Value other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TI32Value deepCopy() { - return new TI32Value(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0; - } - - public int getValue() { - return this.value; - } - - public void setValue(int value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return Integer.valueOf(getValue()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TI32Value) - return this.equals((TI32Value)that); - return false; - } - - public boolean equals(TI32Value that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); - - return builder.toHashCode(); - } - - public int compareTo(TI32Value other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TI32Value typedOther = (TI32Value)other; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI32Value("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TI32ValueStandardSchemeFactory implements SchemeFactory { - public TI32ValueStandardScheme getScheme() { - return new TI32ValueStandardScheme(); - } - } - - private static class TI32ValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.value = iprot.readI32(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TI32Value struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeI32(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI32ValueTupleSchemeFactory implements SchemeFactory { - public TI32ValueTupleScheme getScheme() { - return new TI32ValueTupleScheme(); - } - } - - private static class TI32ValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeI32(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readI32(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI64Column.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI64Column.java deleted file mode 100644 index cc383ed089fa4..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI64Column.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TI64Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Column"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI64ColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI64ColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Column.class, metaDataMap); - } - - public TI64Column() { - } - - public TI64Column( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = nulls; - } - - /** - * Performs a deep copy on other. - */ - public TI64Column(TI64Column other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(); - for (Long other_element : other.values) { - __this__values.add(other_element); - } - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); -; - } - } - - public TI64Column deepCopy() { - return new TI64Column(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(long elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return nulls; - } - - public void setNulls(byte[] nulls) { - setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = nulls; - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TI64Column) - return this.equals((TI64Column)that); - return false; - } - - public boolean equals(TI64Column that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_values = true && (isSetValues()); - builder.append(present_values); - if (present_values) - builder.append(values); - - boolean present_nulls = true && (isSetNulls()); - builder.append(present_nulls); - if (present_nulls) - builder.append(nulls); - - return builder.toHashCode(); - } - - public int compareTo(TI64Column other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TI64Column typedOther = (TI64Column)other; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI64Column("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TI64ColumnStandardSchemeFactory implements SchemeFactory { - public TI64ColumnStandardScheme getScheme() { - return new TI64ColumnStandardScheme(); - } - } - - private static class TI64ColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list86 = iprot.readListBegin(); - struct.values = new ArrayList(_list86.size); - for (int _i87 = 0; _i87 < _list86.size; ++_i87) - { - long _elem88; // optional - _elem88 = iprot.readI64(); - struct.values.add(_elem88); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TI64Column struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.values.size())); - for (long _iter89 : struct.values) - { - oprot.writeI64(_iter89); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI64ColumnTupleSchemeFactory implements SchemeFactory { - public TI64ColumnTupleScheme getScheme() { - return new TI64ColumnTupleScheme(); - } - } - - private static class TI64ColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (long _iter90 : struct.values) - { - oprot.writeI64(_iter90); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list91 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); - struct.values = new ArrayList(_list91.size); - for (int _i92 = 0; _i92 < _list91.size; ++_i92) - { - long _elem93; // optional - _elem93 = iprot.readI64(); - struct.values.add(_elem93); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI64Value.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI64Value.java deleted file mode 100644 index 9a941cce0c077..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TI64Value.java +++ /dev/null @@ -1,386 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TI64Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Value"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I64, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI64ValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI64ValueTupleSchemeFactory()); - } - - private long value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Value.class, metaDataMap); - } - - public TI64Value() { - } - - /** - * Performs a deep copy on other. - */ - public TI64Value(TI64Value other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TI64Value deepCopy() { - return new TI64Value(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0; - } - - public long getValue() { - return this.value; - } - - public void setValue(long value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((Long)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return Long.valueOf(getValue()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TI64Value) - return this.equals((TI64Value)that); - return false; - } - - public boolean equals(TI64Value that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); - - return builder.toHashCode(); - } - - public int compareTo(TI64Value other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TI64Value typedOther = (TI64Value)other; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI64Value("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TI64ValueStandardSchemeFactory implements SchemeFactory { - public TI64ValueStandardScheme getScheme() { - return new TI64ValueStandardScheme(); - } - } - - private static class TI64ValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.value = iprot.readI64(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TI64Value struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeI64(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI64ValueTupleSchemeFactory implements SchemeFactory { - public TI64ValueTupleScheme getScheme() { - return new TI64ValueTupleScheme(); - } - } - - private static class TI64ValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeI64(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readI64(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TMapTypeEntry.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TMapTypeEntry.java deleted file mode 100644 index 425603cbdecbd..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TMapTypeEntry.java +++ /dev/null @@ -1,478 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TMapTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TMapTypeEntry"); - - private static final org.apache.thrift.protocol.TField KEY_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("keyTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField VALUE_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("valueTypePtr", org.apache.thrift.protocol.TType.I32, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TMapTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TMapTypeEntryTupleSchemeFactory()); - } - - private int keyTypePtr; // required - private int valueTypePtr; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - KEY_TYPE_PTR((short)1, "keyTypePtr"), - VALUE_TYPE_PTR((short)2, "valueTypePtr"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // KEY_TYPE_PTR - return KEY_TYPE_PTR; - case 2: // VALUE_TYPE_PTR - return VALUE_TYPE_PTR; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __KEYTYPEPTR_ISSET_ID = 0; - private static final int __VALUETYPEPTR_ISSET_ID = 1; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.KEY_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("keyTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - tmpMap.put(_Fields.VALUE_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("valueTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TMapTypeEntry.class, metaDataMap); - } - - public TMapTypeEntry() { - } - - public TMapTypeEntry( - int keyTypePtr, - int valueTypePtr) - { - this(); - this.keyTypePtr = keyTypePtr; - setKeyTypePtrIsSet(true); - this.valueTypePtr = valueTypePtr; - setValueTypePtrIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TMapTypeEntry(TMapTypeEntry other) { - __isset_bitfield = other.__isset_bitfield; - this.keyTypePtr = other.keyTypePtr; - this.valueTypePtr = other.valueTypePtr; - } - - public TMapTypeEntry deepCopy() { - return new TMapTypeEntry(this); - } - - @Override - public void clear() { - setKeyTypePtrIsSet(false); - this.keyTypePtr = 0; - setValueTypePtrIsSet(false); - this.valueTypePtr = 0; - } - - public int getKeyTypePtr() { - return this.keyTypePtr; - } - - public void setKeyTypePtr(int keyTypePtr) { - this.keyTypePtr = keyTypePtr; - setKeyTypePtrIsSet(true); - } - - public void unsetKeyTypePtr() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); - } - - /** Returns true if field keyTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetKeyTypePtr() { - return EncodingUtils.testBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); - } - - public void setKeyTypePtrIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID, value); - } - - public int getValueTypePtr() { - return this.valueTypePtr; - } - - public void setValueTypePtr(int valueTypePtr) { - this.valueTypePtr = valueTypePtr; - setValueTypePtrIsSet(true); - } - - public void unsetValueTypePtr() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); - } - - /** Returns true if field valueTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetValueTypePtr() { - return EncodingUtils.testBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); - } - - public void setValueTypePtrIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case KEY_TYPE_PTR: - if (value == null) { - unsetKeyTypePtr(); - } else { - setKeyTypePtr((Integer)value); - } - break; - - case VALUE_TYPE_PTR: - if (value == null) { - unsetValueTypePtr(); - } else { - setValueTypePtr((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case KEY_TYPE_PTR: - return Integer.valueOf(getKeyTypePtr()); - - case VALUE_TYPE_PTR: - return Integer.valueOf(getValueTypePtr()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case KEY_TYPE_PTR: - return isSetKeyTypePtr(); - case VALUE_TYPE_PTR: - return isSetValueTypePtr(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TMapTypeEntry) - return this.equals((TMapTypeEntry)that); - return false; - } - - public boolean equals(TMapTypeEntry that) { - if (that == null) - return false; - - boolean this_present_keyTypePtr = true; - boolean that_present_keyTypePtr = true; - if (this_present_keyTypePtr || that_present_keyTypePtr) { - if (!(this_present_keyTypePtr && that_present_keyTypePtr)) - return false; - if (this.keyTypePtr != that.keyTypePtr) - return false; - } - - boolean this_present_valueTypePtr = true; - boolean that_present_valueTypePtr = true; - if (this_present_valueTypePtr || that_present_valueTypePtr) { - if (!(this_present_valueTypePtr && that_present_valueTypePtr)) - return false; - if (this.valueTypePtr != that.valueTypePtr) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_keyTypePtr = true; - builder.append(present_keyTypePtr); - if (present_keyTypePtr) - builder.append(keyTypePtr); - - boolean present_valueTypePtr = true; - builder.append(present_valueTypePtr); - if (present_valueTypePtr) - builder.append(valueTypePtr); - - return builder.toHashCode(); - } - - public int compareTo(TMapTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TMapTypeEntry typedOther = (TMapTypeEntry)other; - - lastComparison = Boolean.valueOf(isSetKeyTypePtr()).compareTo(typedOther.isSetKeyTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKeyTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keyTypePtr, typedOther.keyTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetValueTypePtr()).compareTo(typedOther.isSetValueTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValueTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.valueTypePtr, typedOther.valueTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TMapTypeEntry("); - boolean first = true; - - sb.append("keyTypePtr:"); - sb.append(this.keyTypePtr); - first = false; - if (!first) sb.append(", "); - sb.append("valueTypePtr:"); - sb.append(this.valueTypePtr); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetKeyTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'keyTypePtr' is unset! Struct:" + toString()); - } - - if (!isSetValueTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'valueTypePtr' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TMapTypeEntryStandardSchemeFactory implements SchemeFactory { - public TMapTypeEntryStandardScheme getScheme() { - return new TMapTypeEntryStandardScheme(); - } - } - - private static class TMapTypeEntryStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TMapTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // KEY_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.keyTypePtr = iprot.readI32(); - struct.setKeyTypePtrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // VALUE_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.valueTypePtr = iprot.readI32(); - struct.setValueTypePtrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TMapTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(KEY_TYPE_PTR_FIELD_DESC); - oprot.writeI32(struct.keyTypePtr); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(VALUE_TYPE_PTR_FIELD_DESC); - oprot.writeI32(struct.valueTypePtr); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TMapTypeEntryTupleSchemeFactory implements SchemeFactory { - public TMapTypeEntryTupleScheme getScheme() { - return new TMapTypeEntryTupleScheme(); - } - } - - private static class TMapTypeEntryTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.keyTypePtr); - oprot.writeI32(struct.valueTypePtr); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.keyTypePtr = iprot.readI32(); - struct.setKeyTypePtrIsSet(true); - struct.valueTypePtr = iprot.readI32(); - struct.setValueTypePtrIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOpenSessionReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOpenSessionReq.java deleted file mode 100644 index c0481615b06d3..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOpenSessionReq.java +++ /dev/null @@ -1,785 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TOpenSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionReq"); - - private static final org.apache.thrift.protocol.TField CLIENT_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("client_protocol", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TOpenSessionReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TOpenSessionReqTupleSchemeFactory()); - } - - private TProtocolVersion client_protocol; // required - private String username; // optional - private String password; // optional - private Map configuration; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see TProtocolVersion - */ - CLIENT_PROTOCOL((short)1, "client_protocol"), - USERNAME((short)2, "username"), - PASSWORD((short)3, "password"), - CONFIGURATION((short)4, "configuration"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // CLIENT_PROTOCOL - return CLIENT_PROTOCOL; - case 2: // USERNAME - return USERNAME; - case 3: // PASSWORD - return PASSWORD; - case 4: // CONFIGURATION - return CONFIGURATION; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.USERNAME,_Fields.PASSWORD,_Fields.CONFIGURATION}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.CLIENT_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("client_protocol", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); - tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionReq.class, metaDataMap); - } - - public TOpenSessionReq() { - this.client_protocol = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8; - - } - - public TOpenSessionReq( - TProtocolVersion client_protocol) - { - this(); - this.client_protocol = client_protocol; - } - - /** - * Performs a deep copy on other. - */ - public TOpenSessionReq(TOpenSessionReq other) { - if (other.isSetClient_protocol()) { - this.client_protocol = other.client_protocol; - } - if (other.isSetUsername()) { - this.username = other.username; - } - if (other.isSetPassword()) { - this.password = other.password; - } - if (other.isSetConfiguration()) { - Map __this__configuration = new HashMap(); - for (Map.Entry other_element : other.configuration.entrySet()) { - - String other_element_key = other_element.getKey(); - String other_element_value = other_element.getValue(); - - String __this__configuration_copy_key = other_element_key; - - String __this__configuration_copy_value = other_element_value; - - __this__configuration.put(__this__configuration_copy_key, __this__configuration_copy_value); - } - this.configuration = __this__configuration; - } - } - - public TOpenSessionReq deepCopy() { - return new TOpenSessionReq(this); - } - - @Override - public void clear() { - this.client_protocol = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8; - - this.username = null; - this.password = null; - this.configuration = null; - } - - /** - * - * @see TProtocolVersion - */ - public TProtocolVersion getClient_protocol() { - return this.client_protocol; - } - - /** - * - * @see TProtocolVersion - */ - public void setClient_protocol(TProtocolVersion client_protocol) { - this.client_protocol = client_protocol; - } - - public void unsetClient_protocol() { - this.client_protocol = null; - } - - /** Returns true if field client_protocol is set (has been assigned a value) and false otherwise */ - public boolean isSetClient_protocol() { - return this.client_protocol != null; - } - - public void setClient_protocolIsSet(boolean value) { - if (!value) { - this.client_protocol = null; - } - } - - public String getUsername() { - return this.username; - } - - public void setUsername(String username) { - this.username = username; - } - - public void unsetUsername() { - this.username = null; - } - - /** Returns true if field username is set (has been assigned a value) and false otherwise */ - public boolean isSetUsername() { - return this.username != null; - } - - public void setUsernameIsSet(boolean value) { - if (!value) { - this.username = null; - } - } - - public String getPassword() { - return this.password; - } - - public void setPassword(String password) { - this.password = password; - } - - public void unsetPassword() { - this.password = null; - } - - /** Returns true if field password is set (has been assigned a value) and false otherwise */ - public boolean isSetPassword() { - return this.password != null; - } - - public void setPasswordIsSet(boolean value) { - if (!value) { - this.password = null; - } - } - - public int getConfigurationSize() { - return (this.configuration == null) ? 0 : this.configuration.size(); - } - - public void putToConfiguration(String key, String val) { - if (this.configuration == null) { - this.configuration = new HashMap(); - } - this.configuration.put(key, val); - } - - public Map getConfiguration() { - return this.configuration; - } - - public void setConfiguration(Map configuration) { - this.configuration = configuration; - } - - public void unsetConfiguration() { - this.configuration = null; - } - - /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ - public boolean isSetConfiguration() { - return this.configuration != null; - } - - public void setConfigurationIsSet(boolean value) { - if (!value) { - this.configuration = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case CLIENT_PROTOCOL: - if (value == null) { - unsetClient_protocol(); - } else { - setClient_protocol((TProtocolVersion)value); - } - break; - - case USERNAME: - if (value == null) { - unsetUsername(); - } else { - setUsername((String)value); - } - break; - - case PASSWORD: - if (value == null) { - unsetPassword(); - } else { - setPassword((String)value); - } - break; - - case CONFIGURATION: - if (value == null) { - unsetConfiguration(); - } else { - setConfiguration((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case CLIENT_PROTOCOL: - return getClient_protocol(); - - case USERNAME: - return getUsername(); - - case PASSWORD: - return getPassword(); - - case CONFIGURATION: - return getConfiguration(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case CLIENT_PROTOCOL: - return isSetClient_protocol(); - case USERNAME: - return isSetUsername(); - case PASSWORD: - return isSetPassword(); - case CONFIGURATION: - return isSetConfiguration(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TOpenSessionReq) - return this.equals((TOpenSessionReq)that); - return false; - } - - public boolean equals(TOpenSessionReq that) { - if (that == null) - return false; - - boolean this_present_client_protocol = true && this.isSetClient_protocol(); - boolean that_present_client_protocol = true && that.isSetClient_protocol(); - if (this_present_client_protocol || that_present_client_protocol) { - if (!(this_present_client_protocol && that_present_client_protocol)) - return false; - if (!this.client_protocol.equals(that.client_protocol)) - return false; - } - - boolean this_present_username = true && this.isSetUsername(); - boolean that_present_username = true && that.isSetUsername(); - if (this_present_username || that_present_username) { - if (!(this_present_username && that_present_username)) - return false; - if (!this.username.equals(that.username)) - return false; - } - - boolean this_present_password = true && this.isSetPassword(); - boolean that_present_password = true && that.isSetPassword(); - if (this_present_password || that_present_password) { - if (!(this_present_password && that_present_password)) - return false; - if (!this.password.equals(that.password)) - return false; - } - - boolean this_present_configuration = true && this.isSetConfiguration(); - boolean that_present_configuration = true && that.isSetConfiguration(); - if (this_present_configuration || that_present_configuration) { - if (!(this_present_configuration && that_present_configuration)) - return false; - if (!this.configuration.equals(that.configuration)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_client_protocol = true && (isSetClient_protocol()); - builder.append(present_client_protocol); - if (present_client_protocol) - builder.append(client_protocol.getValue()); - - boolean present_username = true && (isSetUsername()); - builder.append(present_username); - if (present_username) - builder.append(username); - - boolean present_password = true && (isSetPassword()); - builder.append(present_password); - if (present_password) - builder.append(password); - - boolean present_configuration = true && (isSetConfiguration()); - builder.append(present_configuration); - if (present_configuration) - builder.append(configuration); - - return builder.toHashCode(); - } - - public int compareTo(TOpenSessionReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TOpenSessionReq typedOther = (TOpenSessionReq)other; - - lastComparison = Boolean.valueOf(isSetClient_protocol()).compareTo(typedOther.isSetClient_protocol()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetClient_protocol()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.client_protocol, typedOther.client_protocol); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUsername()).compareTo(typedOther.isSetUsername()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUsername()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, typedOther.username); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPassword()).compareTo(typedOther.isSetPassword()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPassword()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, typedOther.password); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(typedOther.isSetConfiguration()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConfiguration()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, typedOther.configuration); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TOpenSessionReq("); - boolean first = true; - - sb.append("client_protocol:"); - if (this.client_protocol == null) { - sb.append("null"); - } else { - sb.append(this.client_protocol); - } - first = false; - if (isSetUsername()) { - if (!first) sb.append(", "); - sb.append("username:"); - if (this.username == null) { - sb.append("null"); - } else { - sb.append(this.username); - } - first = false; - } - if (isSetPassword()) { - if (!first) sb.append(", "); - sb.append("password:"); - if (this.password == null) { - sb.append("null"); - } else { - sb.append(this.password); - } - first = false; - } - if (isSetConfiguration()) { - if (!first) sb.append(", "); - sb.append("configuration:"); - if (this.configuration == null) { - sb.append("null"); - } else { - sb.append(this.configuration); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetClient_protocol()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'client_protocol' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TOpenSessionReqStandardSchemeFactory implements SchemeFactory { - public TOpenSessionReqStandardScheme getScheme() { - return new TOpenSessionReqStandardScheme(); - } - } - - private static class TOpenSessionReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // CLIENT_PROTOCOL - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.client_protocol = TProtocolVersion.findByValue(iprot.readI32()); - struct.setClient_protocolIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // USERNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PASSWORD - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.password = iprot.readString(); - struct.setPasswordIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CONFIGURATION - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map142 = iprot.readMapBegin(); - struct.configuration = new HashMap(2*_map142.size); - for (int _i143 = 0; _i143 < _map142.size; ++_i143) - { - String _key144; // required - String _val145; // required - _key144 = iprot.readString(); - _val145 = iprot.readString(); - struct.configuration.put(_key144, _val145); - } - iprot.readMapEnd(); - } - struct.setConfigurationIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.client_protocol != null) { - oprot.writeFieldBegin(CLIENT_PROTOCOL_FIELD_DESC); - oprot.writeI32(struct.client_protocol.getValue()); - oprot.writeFieldEnd(); - } - if (struct.username != null) { - if (struct.isSetUsername()) { - oprot.writeFieldBegin(USERNAME_FIELD_DESC); - oprot.writeString(struct.username); - oprot.writeFieldEnd(); - } - } - if (struct.password != null) { - if (struct.isSetPassword()) { - oprot.writeFieldBegin(PASSWORD_FIELD_DESC); - oprot.writeString(struct.password); - oprot.writeFieldEnd(); - } - } - if (struct.configuration != null) { - if (struct.isSetConfiguration()) { - oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (Map.Entry _iter146 : struct.configuration.entrySet()) - { - oprot.writeString(_iter146.getKey()); - oprot.writeString(_iter146.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TOpenSessionReqTupleSchemeFactory implements SchemeFactory { - public TOpenSessionReqTupleScheme getScheme() { - return new TOpenSessionReqTupleScheme(); - } - } - - private static class TOpenSessionReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.client_protocol.getValue()); - BitSet optionals = new BitSet(); - if (struct.isSetUsername()) { - optionals.set(0); - } - if (struct.isSetPassword()) { - optionals.set(1); - } - if (struct.isSetConfiguration()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetUsername()) { - oprot.writeString(struct.username); - } - if (struct.isSetPassword()) { - oprot.writeString(struct.password); - } - if (struct.isSetConfiguration()) { - { - oprot.writeI32(struct.configuration.size()); - for (Map.Entry _iter147 : struct.configuration.entrySet()) - { - oprot.writeString(_iter147.getKey()); - oprot.writeString(_iter147.getValue()); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.client_protocol = TProtocolVersion.findByValue(iprot.readI32()); - struct.setClient_protocolIsSet(true); - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } - if (incoming.get(1)) { - struct.password = iprot.readString(); - struct.setPasswordIsSet(true); - } - if (incoming.get(2)) { - { - org.apache.thrift.protocol.TMap _map148 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new HashMap(2*_map148.size); - for (int _i149 = 0; _i149 < _map148.size; ++_i149) - { - String _key150; // required - String _val151; // required - _key150 = iprot.readString(); - _val151 = iprot.readString(); - struct.configuration.put(_key150, _val151); - } - } - struct.setConfigurationIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOpenSessionResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOpenSessionResp.java deleted file mode 100644 index 351f78b2de20c..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOpenSessionResp.java +++ /dev/null @@ -1,790 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TOpenSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField SERVER_PROTOCOL_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("serverProtocolVersion", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TOpenSessionRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TOpenSessionRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TProtocolVersion serverProtocolVersion; // required - private TSessionHandle sessionHandle; // optional - private Map configuration; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - /** - * - * @see TProtocolVersion - */ - SERVER_PROTOCOL_VERSION((short)2, "serverProtocolVersion"), - SESSION_HANDLE((short)3, "sessionHandle"), - CONFIGURATION((short)4, "configuration"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // SERVER_PROTOCOL_VERSION - return SERVER_PROTOCOL_VERSION; - case 3: // SESSION_HANDLE - return SESSION_HANDLE; - case 4: // CONFIGURATION - return CONFIGURATION; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.SESSION_HANDLE,_Fields.CONFIGURATION}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.SERVER_PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("serverProtocolVersion", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionResp.class, metaDataMap); - } - - public TOpenSessionResp() { - this.serverProtocolVersion = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8; - - } - - public TOpenSessionResp( - TStatus status, - TProtocolVersion serverProtocolVersion) - { - this(); - this.status = status; - this.serverProtocolVersion = serverProtocolVersion; - } - - /** - * Performs a deep copy on other. - */ - public TOpenSessionResp(TOpenSessionResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetServerProtocolVersion()) { - this.serverProtocolVersion = other.serverProtocolVersion; - } - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetConfiguration()) { - Map __this__configuration = new HashMap(); - for (Map.Entry other_element : other.configuration.entrySet()) { - - String other_element_key = other_element.getKey(); - String other_element_value = other_element.getValue(); - - String __this__configuration_copy_key = other_element_key; - - String __this__configuration_copy_value = other_element_value; - - __this__configuration.put(__this__configuration_copy_key, __this__configuration_copy_value); - } - this.configuration = __this__configuration; - } - } - - public TOpenSessionResp deepCopy() { - return new TOpenSessionResp(this); - } - - @Override - public void clear() { - this.status = null; - this.serverProtocolVersion = org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V8; - - this.sessionHandle = null; - this.configuration = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - /** - * - * @see TProtocolVersion - */ - public TProtocolVersion getServerProtocolVersion() { - return this.serverProtocolVersion; - } - - /** - * - * @see TProtocolVersion - */ - public void setServerProtocolVersion(TProtocolVersion serverProtocolVersion) { - this.serverProtocolVersion = serverProtocolVersion; - } - - public void unsetServerProtocolVersion() { - this.serverProtocolVersion = null; - } - - /** Returns true if field serverProtocolVersion is set (has been assigned a value) and false otherwise */ - public boolean isSetServerProtocolVersion() { - return this.serverProtocolVersion != null; - } - - public void setServerProtocolVersionIsSet(boolean value) { - if (!value) { - this.serverProtocolVersion = null; - } - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public int getConfigurationSize() { - return (this.configuration == null) ? 0 : this.configuration.size(); - } - - public void putToConfiguration(String key, String val) { - if (this.configuration == null) { - this.configuration = new HashMap(); - } - this.configuration.put(key, val); - } - - public Map getConfiguration() { - return this.configuration; - } - - public void setConfiguration(Map configuration) { - this.configuration = configuration; - } - - public void unsetConfiguration() { - this.configuration = null; - } - - /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ - public boolean isSetConfiguration() { - return this.configuration != null; - } - - public void setConfigurationIsSet(boolean value) { - if (!value) { - this.configuration = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case SERVER_PROTOCOL_VERSION: - if (value == null) { - unsetServerProtocolVersion(); - } else { - setServerProtocolVersion((TProtocolVersion)value); - } - break; - - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CONFIGURATION: - if (value == null) { - unsetConfiguration(); - } else { - setConfiguration((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case SERVER_PROTOCOL_VERSION: - return getServerProtocolVersion(); - - case SESSION_HANDLE: - return getSessionHandle(); - - case CONFIGURATION: - return getConfiguration(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case SERVER_PROTOCOL_VERSION: - return isSetServerProtocolVersion(); - case SESSION_HANDLE: - return isSetSessionHandle(); - case CONFIGURATION: - return isSetConfiguration(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TOpenSessionResp) - return this.equals((TOpenSessionResp)that); - return false; - } - - public boolean equals(TOpenSessionResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_serverProtocolVersion = true && this.isSetServerProtocolVersion(); - boolean that_present_serverProtocolVersion = true && that.isSetServerProtocolVersion(); - if (this_present_serverProtocolVersion || that_present_serverProtocolVersion) { - if (!(this_present_serverProtocolVersion && that_present_serverProtocolVersion)) - return false; - if (!this.serverProtocolVersion.equals(that.serverProtocolVersion)) - return false; - } - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_configuration = true && this.isSetConfiguration(); - boolean that_present_configuration = true && that.isSetConfiguration(); - if (this_present_configuration || that_present_configuration) { - if (!(this_present_configuration && that_present_configuration)) - return false; - if (!this.configuration.equals(that.configuration)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - boolean present_serverProtocolVersion = true && (isSetServerProtocolVersion()); - builder.append(present_serverProtocolVersion); - if (present_serverProtocolVersion) - builder.append(serverProtocolVersion.getValue()); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - boolean present_configuration = true && (isSetConfiguration()); - builder.append(present_configuration); - if (present_configuration) - builder.append(configuration); - - return builder.toHashCode(); - } - - public int compareTo(TOpenSessionResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TOpenSessionResp typedOther = (TOpenSessionResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetServerProtocolVersion()).compareTo(typedOther.isSetServerProtocolVersion()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServerProtocolVersion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverProtocolVersion, typedOther.serverProtocolVersion); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(typedOther.isSetConfiguration()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConfiguration()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, typedOther.configuration); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TOpenSessionResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (!first) sb.append(", "); - sb.append("serverProtocolVersion:"); - if (this.serverProtocolVersion == null) { - sb.append("null"); - } else { - sb.append(this.serverProtocolVersion); - } - first = false; - if (isSetSessionHandle()) { - if (!first) sb.append(", "); - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - } - if (isSetConfiguration()) { - if (!first) sb.append(", "); - sb.append("configuration:"); - if (this.configuration == null) { - sb.append("null"); - } else { - sb.append(this.configuration); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - if (!isSetServerProtocolVersion()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'serverProtocolVersion' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TOpenSessionRespStandardSchemeFactory implements SchemeFactory { - public TOpenSessionRespStandardScheme getScheme() { - return new TOpenSessionRespStandardScheme(); - } - } - - private static class TOpenSessionRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SERVER_PROTOCOL_VERSION - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.serverProtocolVersion = TProtocolVersion.findByValue(iprot.readI32()); - struct.setServerProtocolVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CONFIGURATION - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map152 = iprot.readMapBegin(); - struct.configuration = new HashMap(2*_map152.size); - for (int _i153 = 0; _i153 < _map152.size; ++_i153) - { - String _key154; // required - String _val155; // required - _key154 = iprot.readString(); - _val155 = iprot.readString(); - struct.configuration.put(_key154, _val155); - } - iprot.readMapEnd(); - } - struct.setConfigurationIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.serverProtocolVersion != null) { - oprot.writeFieldBegin(SERVER_PROTOCOL_VERSION_FIELD_DESC); - oprot.writeI32(struct.serverProtocolVersion.getValue()); - oprot.writeFieldEnd(); - } - if (struct.sessionHandle != null) { - if (struct.isSetSessionHandle()) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - if (struct.configuration != null) { - if (struct.isSetConfiguration()) { - oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (Map.Entry _iter156 : struct.configuration.entrySet()) - { - oprot.writeString(_iter156.getKey()); - oprot.writeString(_iter156.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TOpenSessionRespTupleSchemeFactory implements SchemeFactory { - public TOpenSessionRespTupleScheme getScheme() { - return new TOpenSessionRespTupleScheme(); - } - } - - private static class TOpenSessionRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - oprot.writeI32(struct.serverProtocolVersion.getValue()); - BitSet optionals = new BitSet(); - if (struct.isSetSessionHandle()) { - optionals.set(0); - } - if (struct.isSetConfiguration()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetSessionHandle()) { - struct.sessionHandle.write(oprot); - } - if (struct.isSetConfiguration()) { - { - oprot.writeI32(struct.configuration.size()); - for (Map.Entry _iter157 : struct.configuration.entrySet()) - { - oprot.writeString(_iter157.getKey()); - oprot.writeString(_iter157.getValue()); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - struct.serverProtocolVersion = TProtocolVersion.findByValue(iprot.readI32()); - struct.setServerProtocolVersionIsSet(true); - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - if (incoming.get(1)) { - { - org.apache.thrift.protocol.TMap _map158 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new HashMap(2*_map158.size); - for (int _i159 = 0; _i159 < _map158.size; ++_i159) - { - String _key160; // required - String _val161; // required - _key160 = iprot.readString(); - _val161 = iprot.readString(); - struct.configuration.put(_key160, _val161); - } - } - struct.setConfigurationIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOperationHandle.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOperationHandle.java deleted file mode 100644 index 8fbd8752eaca6..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOperationHandle.java +++ /dev/null @@ -1,705 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TOperationHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOperationHandle"); - - private static final org.apache.thrift.protocol.TField OPERATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("operationId", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationType", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)3); - private static final org.apache.thrift.protocol.TField MODIFIED_ROW_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("modifiedRowCount", org.apache.thrift.protocol.TType.DOUBLE, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TOperationHandleStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TOperationHandleTupleSchemeFactory()); - } - - private THandleIdentifier operationId; // required - private TOperationType operationType; // required - private boolean hasResultSet; // required - private double modifiedRowCount; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OPERATION_ID((short)1, "operationId"), - /** - * - * @see TOperationType - */ - OPERATION_TYPE((short)2, "operationType"), - HAS_RESULT_SET((short)3, "hasResultSet"), - MODIFIED_ROW_COUNT((short)4, "modifiedRowCount"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_ID - return OPERATION_ID; - case 2: // OPERATION_TYPE - return OPERATION_TYPE; - case 3: // HAS_RESULT_SET - return HAS_RESULT_SET; - case 4: // MODIFIED_ROW_COUNT - return MODIFIED_ROW_COUNT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __HASRESULTSET_ISSET_ID = 0; - private static final int __MODIFIEDROWCOUNT_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.MODIFIED_ROW_COUNT}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("operationId", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); - tmpMap.put(_Fields.OPERATION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("operationType", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationType.class))); - tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.MODIFIED_ROW_COUNT, new org.apache.thrift.meta_data.FieldMetaData("modifiedRowCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOperationHandle.class, metaDataMap); - } - - public TOperationHandle() { - } - - public TOperationHandle( - THandleIdentifier operationId, - TOperationType operationType, - boolean hasResultSet) - { - this(); - this.operationId = operationId; - this.operationType = operationType; - this.hasResultSet = hasResultSet; - setHasResultSetIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TOperationHandle(TOperationHandle other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetOperationId()) { - this.operationId = new THandleIdentifier(other.operationId); - } - if (other.isSetOperationType()) { - this.operationType = other.operationType; - } - this.hasResultSet = other.hasResultSet; - this.modifiedRowCount = other.modifiedRowCount; - } - - public TOperationHandle deepCopy() { - return new TOperationHandle(this); - } - - @Override - public void clear() { - this.operationId = null; - this.operationType = null; - setHasResultSetIsSet(false); - this.hasResultSet = false; - setModifiedRowCountIsSet(false); - this.modifiedRowCount = 0.0; - } - - public THandleIdentifier getOperationId() { - return this.operationId; - } - - public void setOperationId(THandleIdentifier operationId) { - this.operationId = operationId; - } - - public void unsetOperationId() { - this.operationId = null; - } - - /** Returns true if field operationId is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationId() { - return this.operationId != null; - } - - public void setOperationIdIsSet(boolean value) { - if (!value) { - this.operationId = null; - } - } - - /** - * - * @see TOperationType - */ - public TOperationType getOperationType() { - return this.operationType; - } - - /** - * - * @see TOperationType - */ - public void setOperationType(TOperationType operationType) { - this.operationType = operationType; - } - - public void unsetOperationType() { - this.operationType = null; - } - - /** Returns true if field operationType is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationType() { - return this.operationType != null; - } - - public void setOperationTypeIsSet(boolean value) { - if (!value) { - this.operationType = null; - } - } - - public boolean isHasResultSet() { - return this.hasResultSet; - } - - public void setHasResultSet(boolean hasResultSet) { - this.hasResultSet = hasResultSet; - setHasResultSetIsSet(true); - } - - public void unsetHasResultSet() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); - } - - /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ - public boolean isSetHasResultSet() { - return EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); - } - - public void setHasResultSetIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); - } - - public double getModifiedRowCount() { - return this.modifiedRowCount; - } - - public void setModifiedRowCount(double modifiedRowCount) { - this.modifiedRowCount = modifiedRowCount; - setModifiedRowCountIsSet(true); - } - - public void unsetModifiedRowCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); - } - - /** Returns true if field modifiedRowCount is set (has been assigned a value) and false otherwise */ - public boolean isSetModifiedRowCount() { - return EncodingUtils.testBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); - } - - public void setModifiedRowCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OPERATION_ID: - if (value == null) { - unsetOperationId(); - } else { - setOperationId((THandleIdentifier)value); - } - break; - - case OPERATION_TYPE: - if (value == null) { - unsetOperationType(); - } else { - setOperationType((TOperationType)value); - } - break; - - case HAS_RESULT_SET: - if (value == null) { - unsetHasResultSet(); - } else { - setHasResultSet((Boolean)value); - } - break; - - case MODIFIED_ROW_COUNT: - if (value == null) { - unsetModifiedRowCount(); - } else { - setModifiedRowCount((Double)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_ID: - return getOperationId(); - - case OPERATION_TYPE: - return getOperationType(); - - case HAS_RESULT_SET: - return Boolean.valueOf(isHasResultSet()); - - case MODIFIED_ROW_COUNT: - return Double.valueOf(getModifiedRowCount()); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OPERATION_ID: - return isSetOperationId(); - case OPERATION_TYPE: - return isSetOperationType(); - case HAS_RESULT_SET: - return isSetHasResultSet(); - case MODIFIED_ROW_COUNT: - return isSetModifiedRowCount(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TOperationHandle) - return this.equals((TOperationHandle)that); - return false; - } - - public boolean equals(TOperationHandle that) { - if (that == null) - return false; - - boolean this_present_operationId = true && this.isSetOperationId(); - boolean that_present_operationId = true && that.isSetOperationId(); - if (this_present_operationId || that_present_operationId) { - if (!(this_present_operationId && that_present_operationId)) - return false; - if (!this.operationId.equals(that.operationId)) - return false; - } - - boolean this_present_operationType = true && this.isSetOperationType(); - boolean that_present_operationType = true && that.isSetOperationType(); - if (this_present_operationType || that_present_operationType) { - if (!(this_present_operationType && that_present_operationType)) - return false; - if (!this.operationType.equals(that.operationType)) - return false; - } - - boolean this_present_hasResultSet = true; - boolean that_present_hasResultSet = true; - if (this_present_hasResultSet || that_present_hasResultSet) { - if (!(this_present_hasResultSet && that_present_hasResultSet)) - return false; - if (this.hasResultSet != that.hasResultSet) - return false; - } - - boolean this_present_modifiedRowCount = true && this.isSetModifiedRowCount(); - boolean that_present_modifiedRowCount = true && that.isSetModifiedRowCount(); - if (this_present_modifiedRowCount || that_present_modifiedRowCount) { - if (!(this_present_modifiedRowCount && that_present_modifiedRowCount)) - return false; - if (this.modifiedRowCount != that.modifiedRowCount) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_operationId = true && (isSetOperationId()); - builder.append(present_operationId); - if (present_operationId) - builder.append(operationId); - - boolean present_operationType = true && (isSetOperationType()); - builder.append(present_operationType); - if (present_operationType) - builder.append(operationType.getValue()); - - boolean present_hasResultSet = true; - builder.append(present_hasResultSet); - if (present_hasResultSet) - builder.append(hasResultSet); - - boolean present_modifiedRowCount = true && (isSetModifiedRowCount()); - builder.append(present_modifiedRowCount); - if (present_modifiedRowCount) - builder.append(modifiedRowCount); - - return builder.toHashCode(); - } - - public int compareTo(TOperationHandle other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TOperationHandle typedOther = (TOperationHandle)other; - - lastComparison = Boolean.valueOf(isSetOperationId()).compareTo(typedOther.isSetOperationId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationId, typedOther.operationId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationType()).compareTo(typedOther.isSetOperationType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationType, typedOther.operationType); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetHasResultSet()).compareTo(typedOther.isSetHasResultSet()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHasResultSet()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasResultSet, typedOther.hasResultSet); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetModifiedRowCount()).compareTo(typedOther.isSetModifiedRowCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetModifiedRowCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modifiedRowCount, typedOther.modifiedRowCount); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TOperationHandle("); - boolean first = true; - - sb.append("operationId:"); - if (this.operationId == null) { - sb.append("null"); - } else { - sb.append(this.operationId); - } - first = false; - if (!first) sb.append(", "); - sb.append("operationType:"); - if (this.operationType == null) { - sb.append("null"); - } else { - sb.append(this.operationType); - } - first = false; - if (!first) sb.append(", "); - sb.append("hasResultSet:"); - sb.append(this.hasResultSet); - first = false; - if (isSetModifiedRowCount()) { - if (!first) sb.append(", "); - sb.append("modifiedRowCount:"); - sb.append(this.modifiedRowCount); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationId' is unset! Struct:" + toString()); - } - - if (!isSetOperationType()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationType' is unset! Struct:" + toString()); - } - - if (!isSetHasResultSet()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasResultSet' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationId != null) { - operationId.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TOperationHandleStandardSchemeFactory implements SchemeFactory { - public TOperationHandleStandardScheme getScheme() { - return new TOperationHandleStandardScheme(); - } - } - - private static class TOperationHandleStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TOperationHandle struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OPERATION_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationId = new THandleIdentifier(); - struct.operationId.read(iprot); - struct.setOperationIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.operationType = TOperationType.findByValue(iprot.readI32()); - struct.setOperationTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // HAS_RESULT_SET - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.hasResultSet = iprot.readBool(); - struct.setHasResultSetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // MODIFIED_ROW_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.modifiedRowCount = iprot.readDouble(); - struct.setModifiedRowCountIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TOperationHandle struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationId != null) { - oprot.writeFieldBegin(OPERATION_ID_FIELD_DESC); - struct.operationId.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationType != null) { - oprot.writeFieldBegin(OPERATION_TYPE_FIELD_DESC); - oprot.writeI32(struct.operationType.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC); - oprot.writeBool(struct.hasResultSet); - oprot.writeFieldEnd(); - if (struct.isSetModifiedRowCount()) { - oprot.writeFieldBegin(MODIFIED_ROW_COUNT_FIELD_DESC); - oprot.writeDouble(struct.modifiedRowCount); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TOperationHandleTupleSchemeFactory implements SchemeFactory { - public TOperationHandleTupleScheme getScheme() { - return new TOperationHandleTupleScheme(); - } - } - - private static class TOperationHandleTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.operationId.write(oprot); - oprot.writeI32(struct.operationType.getValue()); - oprot.writeBool(struct.hasResultSet); - BitSet optionals = new BitSet(); - if (struct.isSetModifiedRowCount()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetModifiedRowCount()) { - oprot.writeDouble(struct.modifiedRowCount); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.operationId = new THandleIdentifier(); - struct.operationId.read(iprot); - struct.setOperationIdIsSet(true); - struct.operationType = TOperationType.findByValue(iprot.readI32()); - struct.setOperationTypeIsSet(true); - struct.hasResultSet = iprot.readBool(); - struct.setHasResultSetIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.modifiedRowCount = iprot.readDouble(); - struct.setModifiedRowCountIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOperationState.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOperationState.java deleted file mode 100644 index 219866223a6b0..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOperationState.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TOperationState implements org.apache.thrift.TEnum { - INITIALIZED_STATE(0), - RUNNING_STATE(1), - FINISHED_STATE(2), - CANCELED_STATE(3), - CLOSED_STATE(4), - ERROR_STATE(5), - UKNOWN_STATE(6), - PENDING_STATE(7); - - private final int value; - - private TOperationState(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TOperationState findByValue(int value) { - switch (value) { - case 0: - return INITIALIZED_STATE; - case 1: - return RUNNING_STATE; - case 2: - return FINISHED_STATE; - case 3: - return CANCELED_STATE; - case 4: - return CLOSED_STATE; - case 5: - return ERROR_STATE; - case 6: - return UKNOWN_STATE; - case 7: - return PENDING_STATE; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOperationType.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOperationType.java deleted file mode 100644 index b6d4b2fab9f96..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TOperationType.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TOperationType implements org.apache.thrift.TEnum { - EXECUTE_STATEMENT(0), - GET_TYPE_INFO(1), - GET_CATALOGS(2), - GET_SCHEMAS(3), - GET_TABLES(4), - GET_TABLE_TYPES(5), - GET_COLUMNS(6), - GET_FUNCTIONS(7), - UNKNOWN(8); - - private final int value; - - private TOperationType(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TOperationType findByValue(int value) { - switch (value) { - case 0: - return EXECUTE_STATEMENT; - case 1: - return GET_TYPE_INFO; - case 2: - return GET_CATALOGS; - case 3: - return GET_SCHEMAS; - case 4: - return GET_TABLES; - case 5: - return GET_TABLE_TYPES; - case 6: - return GET_COLUMNS; - case 7: - return GET_FUNCTIONS; - case 8: - return UNKNOWN; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TPrimitiveTypeEntry.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TPrimitiveTypeEntry.java deleted file mode 100644 index 9d2abf2b3b084..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TPrimitiveTypeEntry.java +++ /dev/null @@ -1,512 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TPrimitiveTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPrimitiveTypeEntry"); - - private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField TYPE_QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("typeQualifiers", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TPrimitiveTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TPrimitiveTypeEntryTupleSchemeFactory()); - } - - private TTypeId type; // required - private TTypeQualifiers typeQualifiers; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see TTypeId - */ - TYPE((short)1, "type"), - TYPE_QUALIFIERS((short)2, "typeQualifiers"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // TYPE - return TYPE; - case 2: // TYPE_QUALIFIERS - return TYPE_QUALIFIERS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.TYPE_QUALIFIERS}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TTypeId.class))); - tmpMap.put(_Fields.TYPE_QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("typeQualifiers", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifiers.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPrimitiveTypeEntry.class, metaDataMap); - } - - public TPrimitiveTypeEntry() { - } - - public TPrimitiveTypeEntry( - TTypeId type) - { - this(); - this.type = type; - } - - /** - * Performs a deep copy on other. - */ - public TPrimitiveTypeEntry(TPrimitiveTypeEntry other) { - if (other.isSetType()) { - this.type = other.type; - } - if (other.isSetTypeQualifiers()) { - this.typeQualifiers = new TTypeQualifiers(other.typeQualifiers); - } - } - - public TPrimitiveTypeEntry deepCopy() { - return new TPrimitiveTypeEntry(this); - } - - @Override - public void clear() { - this.type = null; - this.typeQualifiers = null; - } - - /** - * - * @see TTypeId - */ - public TTypeId getType() { - return this.type; - } - - /** - * - * @see TTypeId - */ - public void setType(TTypeId type) { - this.type = type; - } - - public void unsetType() { - this.type = null; - } - - /** Returns true if field type is set (has been assigned a value) and false otherwise */ - public boolean isSetType() { - return this.type != null; - } - - public void setTypeIsSet(boolean value) { - if (!value) { - this.type = null; - } - } - - public TTypeQualifiers getTypeQualifiers() { - return this.typeQualifiers; - } - - public void setTypeQualifiers(TTypeQualifiers typeQualifiers) { - this.typeQualifiers = typeQualifiers; - } - - public void unsetTypeQualifiers() { - this.typeQualifiers = null; - } - - /** Returns true if field typeQualifiers is set (has been assigned a value) and false otherwise */ - public boolean isSetTypeQualifiers() { - return this.typeQualifiers != null; - } - - public void setTypeQualifiersIsSet(boolean value) { - if (!value) { - this.typeQualifiers = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TYPE: - if (value == null) { - unsetType(); - } else { - setType((TTypeId)value); - } - break; - - case TYPE_QUALIFIERS: - if (value == null) { - unsetTypeQualifiers(); - } else { - setTypeQualifiers((TTypeQualifiers)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TYPE: - return getType(); - - case TYPE_QUALIFIERS: - return getTypeQualifiers(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case TYPE: - return isSetType(); - case TYPE_QUALIFIERS: - return isSetTypeQualifiers(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TPrimitiveTypeEntry) - return this.equals((TPrimitiveTypeEntry)that); - return false; - } - - public boolean equals(TPrimitiveTypeEntry that) { - if (that == null) - return false; - - boolean this_present_type = true && this.isSetType(); - boolean that_present_type = true && that.isSetType(); - if (this_present_type || that_present_type) { - if (!(this_present_type && that_present_type)) - return false; - if (!this.type.equals(that.type)) - return false; - } - - boolean this_present_typeQualifiers = true && this.isSetTypeQualifiers(); - boolean that_present_typeQualifiers = true && that.isSetTypeQualifiers(); - if (this_present_typeQualifiers || that_present_typeQualifiers) { - if (!(this_present_typeQualifiers && that_present_typeQualifiers)) - return false; - if (!this.typeQualifiers.equals(that.typeQualifiers)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_type = true && (isSetType()); - builder.append(present_type); - if (present_type) - builder.append(type.getValue()); - - boolean present_typeQualifiers = true && (isSetTypeQualifiers()); - builder.append(present_typeQualifiers); - if (present_typeQualifiers) - builder.append(typeQualifiers); - - return builder.toHashCode(); - } - - public int compareTo(TPrimitiveTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TPrimitiveTypeEntry typedOther = (TPrimitiveTypeEntry)other; - - lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTypeQualifiers()).compareTo(typedOther.isSetTypeQualifiers()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTypeQualifiers()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeQualifiers, typedOther.typeQualifiers); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TPrimitiveTypeEntry("); - boolean first = true; - - sb.append("type:"); - if (this.type == null) { - sb.append("null"); - } else { - sb.append(this.type); - } - first = false; - if (isSetTypeQualifiers()) { - if (!first) sb.append(", "); - sb.append("typeQualifiers:"); - if (this.typeQualifiers == null) { - sb.append("null"); - } else { - sb.append(this.typeQualifiers); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetType()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (typeQualifiers != null) { - typeQualifiers.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TPrimitiveTypeEntryStandardSchemeFactory implements SchemeFactory { - public TPrimitiveTypeEntryStandardScheme getScheme() { - return new TPrimitiveTypeEntryStandardScheme(); - } - } - - private static class TPrimitiveTypeEntryStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.type = TTypeId.findByValue(iprot.readI32()); - struct.setTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // TYPE_QUALIFIERS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.typeQualifiers = new TTypeQualifiers(); - struct.typeQualifiers.read(iprot); - struct.setTypeQualifiersIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.type != null) { - oprot.writeFieldBegin(TYPE_FIELD_DESC); - oprot.writeI32(struct.type.getValue()); - oprot.writeFieldEnd(); - } - if (struct.typeQualifiers != null) { - if (struct.isSetTypeQualifiers()) { - oprot.writeFieldBegin(TYPE_QUALIFIERS_FIELD_DESC); - struct.typeQualifiers.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TPrimitiveTypeEntryTupleSchemeFactory implements SchemeFactory { - public TPrimitiveTypeEntryTupleScheme getScheme() { - return new TPrimitiveTypeEntryTupleScheme(); - } - } - - private static class TPrimitiveTypeEntryTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.type.getValue()); - BitSet optionals = new BitSet(); - if (struct.isSetTypeQualifiers()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetTypeQualifiers()) { - struct.typeQualifiers.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.type = TTypeId.findByValue(iprot.readI32()); - struct.setTypeIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.typeQualifiers = new TTypeQualifiers(); - struct.typeQualifiers.read(iprot); - struct.setTypeQualifiersIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TProtocolVersion.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TProtocolVersion.java deleted file mode 100644 index a4279d29f662e..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TProtocolVersion.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TProtocolVersion implements org.apache.thrift.TEnum { - HIVE_CLI_SERVICE_PROTOCOL_V1(0), - HIVE_CLI_SERVICE_PROTOCOL_V2(1), - HIVE_CLI_SERVICE_PROTOCOL_V3(2), - HIVE_CLI_SERVICE_PROTOCOL_V4(3), - HIVE_CLI_SERVICE_PROTOCOL_V5(4), - HIVE_CLI_SERVICE_PROTOCOL_V6(5), - HIVE_CLI_SERVICE_PROTOCOL_V7(6), - HIVE_CLI_SERVICE_PROTOCOL_V8(7); - - private final int value; - - private TProtocolVersion(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TProtocolVersion findByValue(int value) { - switch (value) { - case 0: - return HIVE_CLI_SERVICE_PROTOCOL_V1; - case 1: - return HIVE_CLI_SERVICE_PROTOCOL_V2; - case 2: - return HIVE_CLI_SERVICE_PROTOCOL_V3; - case 3: - return HIVE_CLI_SERVICE_PROTOCOL_V4; - case 4: - return HIVE_CLI_SERVICE_PROTOCOL_V5; - case 5: - return HIVE_CLI_SERVICE_PROTOCOL_V6; - case 6: - return HIVE_CLI_SERVICE_PROTOCOL_V7; - case 7: - return HIVE_CLI_SERVICE_PROTOCOL_V8; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TRenewDelegationTokenReq.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TRenewDelegationTokenReq.java deleted file mode 100644 index a3e39c8cdf321..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TRenewDelegationTokenReq.java +++ /dev/null @@ -1,491 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TRenewDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRenewDelegationTokenReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRenewDelegationTokenReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String delegationToken; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - DELEGATION_TOKEN((short)2, "delegationToken"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // DELEGATION_TOKEN - return DELEGATION_TOKEN; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenReq.class, metaDataMap); - } - - public TRenewDelegationTokenReq() { - } - - public TRenewDelegationTokenReq( - TSessionHandle sessionHandle, - String delegationToken) - { - this(); - this.sessionHandle = sessionHandle; - this.delegationToken = delegationToken; - } - - /** - * Performs a deep copy on other. - */ - public TRenewDelegationTokenReq(TRenewDelegationTokenReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetDelegationToken()) { - this.delegationToken = other.delegationToken; - } - } - - public TRenewDelegationTokenReq deepCopy() { - return new TRenewDelegationTokenReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.delegationToken = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getDelegationToken() { - return this.delegationToken; - } - - public void setDelegationToken(String delegationToken) { - this.delegationToken = delegationToken; - } - - public void unsetDelegationToken() { - this.delegationToken = null; - } - - /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ - public boolean isSetDelegationToken() { - return this.delegationToken != null; - } - - public void setDelegationTokenIsSet(boolean value) { - if (!value) { - this.delegationToken = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case DELEGATION_TOKEN: - if (value == null) { - unsetDelegationToken(); - } else { - setDelegationToken((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case DELEGATION_TOKEN: - return getDelegationToken(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case DELEGATION_TOKEN: - return isSetDelegationToken(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TRenewDelegationTokenReq) - return this.equals((TRenewDelegationTokenReq)that); - return false; - } - - public boolean equals(TRenewDelegationTokenReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_delegationToken = true && this.isSetDelegationToken(); - boolean that_present_delegationToken = true && that.isSetDelegationToken(); - if (this_present_delegationToken || that_present_delegationToken) { - if (!(this_present_delegationToken && that_present_delegationToken)) - return false; - if (!this.delegationToken.equals(that.delegationToken)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - builder.append(present_sessionHandle); - if (present_sessionHandle) - builder.append(sessionHandle); - - boolean present_delegationToken = true && (isSetDelegationToken()); - builder.append(present_delegationToken); - if (present_delegationToken) - builder.append(delegationToken); - - return builder.toHashCode(); - } - - public int compareTo(TRenewDelegationTokenReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TRenewDelegationTokenReq typedOther = (TRenewDelegationTokenReq)other; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(typedOther.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, typedOther.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(typedOther.isSetDelegationToken()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDelegationToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, typedOther.delegationToken); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TRenewDelegationTokenReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("delegationToken:"); - if (this.delegationToken == null) { - sb.append("null"); - } else { - sb.append(this.delegationToken); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - if (!isSetDelegationToken()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'delegationToken' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TRenewDelegationTokenReqStandardSchemeFactory implements SchemeFactory { - public TRenewDelegationTokenReqStandardScheme getScheme() { - return new TRenewDelegationTokenReqStandardScheme(); - } - } - - private static class TRenewDelegationTokenReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // DELEGATION_TOKEN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.delegationToken != null) { - oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); - oprot.writeString(struct.delegationToken); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRenewDelegationTokenReqTupleSchemeFactory implements SchemeFactory { - public TRenewDelegationTokenReqTupleScheme getScheme() { - return new TRenewDelegationTokenReqTupleScheme(); - } - } - - private static class TRenewDelegationTokenReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.delegationToken); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TRenewDelegationTokenResp.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TRenewDelegationTokenResp.java deleted file mode 100644 index 5f3eb6c4d4b90..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TRenewDelegationTokenResp.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TRenewDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRenewDelegationTokenRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRenewDelegationTokenRespTupleSchemeFactory()); - } - - private TStatus status; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenResp.class, metaDataMap); - } - - public TRenewDelegationTokenResp() { - } - - public TRenewDelegationTokenResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TRenewDelegationTokenResp(TRenewDelegationTokenResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TRenewDelegationTokenResp deepCopy() { - return new TRenewDelegationTokenResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TRenewDelegationTokenResp) - return this.equals((TRenewDelegationTokenResp)that); - return false; - } - - public boolean equals(TRenewDelegationTokenResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_status = true && (isSetStatus()); - builder.append(present_status); - if (present_status) - builder.append(status); - - return builder.toHashCode(); - } - - public int compareTo(TRenewDelegationTokenResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TRenewDelegationTokenResp typedOther = (TRenewDelegationTokenResp)other; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TRenewDelegationTokenResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TRenewDelegationTokenRespStandardSchemeFactory implements SchemeFactory { - public TRenewDelegationTokenRespStandardScheme getScheme() { - return new TRenewDelegationTokenRespStandardScheme(); - } - } - - private static class TRenewDelegationTokenRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRenewDelegationTokenRespTupleSchemeFactory implements SchemeFactory { - public TRenewDelegationTokenRespTupleScheme getScheme() { - return new TRenewDelegationTokenRespTupleScheme(); - } - } - - private static class TRenewDelegationTokenRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TRow.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TRow.java deleted file mode 100644 index a44cfb08ff01a..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TRow.java +++ /dev/null @@ -1,439 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TRow implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRow"); - - private static final org.apache.thrift.protocol.TField COL_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("colVals", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRowStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRowTupleSchemeFactory()); - } - - private List colVals; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - COL_VALS((short)1, "colVals"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // COL_VALS - return COL_VALS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.COL_VALS, new org.apache.thrift.meta_data.FieldMetaData("colVals", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnValue.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRow.class, metaDataMap); - } - - public TRow() { - } - - public TRow( - List colVals) - { - this(); - this.colVals = colVals; - } - - /** - * Performs a deep copy on other. - */ - public TRow(TRow other) { - if (other.isSetColVals()) { - List __this__colVals = new ArrayList(); - for (TColumnValue other_element : other.colVals) { - __this__colVals.add(new TColumnValue(other_element)); - } - this.colVals = __this__colVals; - } - } - - public TRow deepCopy() { - return new TRow(this); - } - - @Override - public void clear() { - this.colVals = null; - } - - public int getColValsSize() { - return (this.colVals == null) ? 0 : this.colVals.size(); - } - - public java.util.Iterator getColValsIterator() { - return (this.colVals == null) ? null : this.colVals.iterator(); - } - - public void addToColVals(TColumnValue elem) { - if (this.colVals == null) { - this.colVals = new ArrayList(); - } - this.colVals.add(elem); - } - - public List getColVals() { - return this.colVals; - } - - public void setColVals(List colVals) { - this.colVals = colVals; - } - - public void unsetColVals() { - this.colVals = null; - } - - /** Returns true if field colVals is set (has been assigned a value) and false otherwise */ - public boolean isSetColVals() { - return this.colVals != null; - } - - public void setColValsIsSet(boolean value) { - if (!value) { - this.colVals = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case COL_VALS: - if (value == null) { - unsetColVals(); - } else { - setColVals((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case COL_VALS: - return getColVals(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case COL_VALS: - return isSetColVals(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TRow) - return this.equals((TRow)that); - return false; - } - - public boolean equals(TRow that) { - if (that == null) - return false; - - boolean this_present_colVals = true && this.isSetColVals(); - boolean that_present_colVals = true && that.isSetColVals(); - if (this_present_colVals || that_present_colVals) { - if (!(this_present_colVals && that_present_colVals)) - return false; - if (!this.colVals.equals(that.colVals)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_colVals = true && (isSetColVals()); - builder.append(present_colVals); - if (present_colVals) - builder.append(colVals); - - return builder.toHashCode(); - } - - public int compareTo(TRow other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TRow typedOther = (TRow)other; - - lastComparison = Boolean.valueOf(isSetColVals()).compareTo(typedOther.isSetColVals()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColVals()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.colVals, typedOther.colVals); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TRow("); - boolean first = true; - - sb.append("colVals:"); - if (this.colVals == null) { - sb.append("null"); - } else { - sb.append(this.colVals); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetColVals()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'colVals' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TRowStandardSchemeFactory implements SchemeFactory { - public TRowStandardScheme getScheme() { - return new TRowStandardScheme(); - } - } - - private static class TRowStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRow struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // COL_VALS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list46 = iprot.readListBegin(); - struct.colVals = new ArrayList(_list46.size); - for (int _i47 = 0; _i47 < _list46.size; ++_i47) - { - TColumnValue _elem48; // optional - _elem48 = new TColumnValue(); - _elem48.read(iprot); - struct.colVals.add(_elem48); - } - iprot.readListEnd(); - } - struct.setColValsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TRow struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.colVals != null) { - oprot.writeFieldBegin(COL_VALS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.colVals.size())); - for (TColumnValue _iter49 : struct.colVals) - { - _iter49.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRowTupleSchemeFactory implements SchemeFactory { - public TRowTupleScheme getScheme() { - return new TRowTupleScheme(); - } - } - - private static class TRowTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.colVals.size()); - for (TColumnValue _iter50 : struct.colVals) - { - _iter50.write(oprot); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list51 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.colVals = new ArrayList(_list51.size); - for (int _i52 = 0; _i52 < _list51.size; ++_i52) - { - TColumnValue _elem53; // optional - _elem53 = new TColumnValue(); - _elem53.read(iprot); - struct.colVals.add(_elem53); - } - } - struct.setColValsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TRowSet.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TRowSet.java deleted file mode 100644 index d16c8a4bb32da..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TRowSet.java +++ /dev/null @@ -1,702 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TRowSet implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowSet"); - - private static final org.apache.thrift.protocol.TField START_ROW_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("startRowOffset", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRowSetStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRowSetTupleSchemeFactory()); - } - - private long startRowOffset; // required - private List rows; // required - private List columns; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - START_ROW_OFFSET((short)1, "startRowOffset"), - ROWS((short)2, "rows"), - COLUMNS((short)3, "columns"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // START_ROW_OFFSET - return START_ROW_OFFSET; - case 2: // ROWS - return ROWS; - case 3: // COLUMNS - return COLUMNS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __STARTROWOFFSET_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.COLUMNS}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.START_ROW_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("startRowOffset", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRow.class)))); - tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumn.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowSet.class, metaDataMap); - } - - public TRowSet() { - } - - public TRowSet( - long startRowOffset, - List rows) - { - this(); - this.startRowOffset = startRowOffset; - setStartRowOffsetIsSet(true); - this.rows = rows; - } - - /** - * Performs a deep copy on other. - */ - public TRowSet(TRowSet other) { - __isset_bitfield = other.__isset_bitfield; - this.startRowOffset = other.startRowOffset; - if (other.isSetRows()) { - List __this__rows = new ArrayList(); - for (TRow other_element : other.rows) { - __this__rows.add(new TRow(other_element)); - } - this.rows = __this__rows; - } - if (other.isSetColumns()) { - List __this__columns = new ArrayList(); - for (TColumn other_element : other.columns) { - __this__columns.add(new TColumn(other_element)); - } - this.columns = __this__columns; - } - } - - public TRowSet deepCopy() { - return new TRowSet(this); - } - - @Override - public void clear() { - setStartRowOffsetIsSet(false); - this.startRowOffset = 0; - this.rows = null; - this.columns = null; - } - - public long getStartRowOffset() { - return this.startRowOffset; - } - - public void setStartRowOffset(long startRowOffset) { - this.startRowOffset = startRowOffset; - setStartRowOffsetIsSet(true); - } - - public void unsetStartRowOffset() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); - } - - /** Returns true if field startRowOffset is set (has been assigned a value) and false otherwise */ - public boolean isSetStartRowOffset() { - return EncodingUtils.testBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); - } - - public void setStartRowOffsetIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID, value); - } - - public int getRowsSize() { - return (this.rows == null) ? 0 : this.rows.size(); - } - - public java.util.Iterator getRowsIterator() { - return (this.rows == null) ? null : this.rows.iterator(); - } - - public void addToRows(TRow elem) { - if (this.rows == null) { - this.rows = new ArrayList(); - } - this.rows.add(elem); - } - - public List getRows() { - return this.rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public void unsetRows() { - this.rows = null; - } - - /** Returns true if field rows is set (has been assigned a value) and false otherwise */ - public boolean isSetRows() { - return this.rows != null; - } - - public void setRowsIsSet(boolean value) { - if (!value) { - this.rows = null; - } - } - - public int getColumnsSize() { - return (this.columns == null) ? 0 : this.columns.size(); - } - - public java.util.Iterator getColumnsIterator() { - return (this.columns == null) ? null : this.columns.iterator(); - } - - public void addToColumns(TColumn elem) { - if (this.columns == null) { - this.columns = new ArrayList(); - } - this.columns.add(elem); - } - - public List getColumns() { - return this.columns; - } - - public void setColumns(List columns) { - this.columns = columns; - } - - public void unsetColumns() { - this.columns = null; - } - - /** Returns true if field columns is set (has been assigned a value) and false otherwise */ - public boolean isSetColumns() { - return this.columns != null; - } - - public void setColumnsIsSet(boolean value) { - if (!value) { - this.columns = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case START_ROW_OFFSET: - if (value == null) { - unsetStartRowOffset(); - } else { - setStartRowOffset((Long)value); - } - break; - - case ROWS: - if (value == null) { - unsetRows(); - } else { - setRows((List)value); - } - break; - - case COLUMNS: - if (value == null) { - unsetColumns(); - } else { - setColumns((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case START_ROW_OFFSET: - return Long.valueOf(getStartRowOffset()); - - case ROWS: - return getRows(); - - case COLUMNS: - return getColumns(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case START_ROW_OFFSET: - return isSetStartRowOffset(); - case ROWS: - return isSetRows(); - case COLUMNS: - return isSetColumns(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TRowSet) - return this.equals((TRowSet)that); - return false; - } - - public boolean equals(TRowSet that) { - if (that == null) - return false; - - boolean this_present_startRowOffset = true; - boolean that_present_startRowOffset = true; - if (this_present_startRowOffset || that_present_startRowOffset) { - if (!(this_present_startRowOffset && that_present_startRowOffset)) - return false; - if (this.startRowOffset != that.startRowOffset) - return false; - } - - boolean this_present_rows = true && this.isSetRows(); - boolean that_present_rows = true && that.isSetRows(); - if (this_present_rows || that_present_rows) { - if (!(this_present_rows && that_present_rows)) - return false; - if (!this.rows.equals(that.rows)) - return false; - } - - boolean this_present_columns = true && this.isSetColumns(); - boolean that_present_columns = true && that.isSetColumns(); - if (this_present_columns || that_present_columns) { - if (!(this_present_columns && that_present_columns)) - return false; - if (!this.columns.equals(that.columns)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_startRowOffset = true; - builder.append(present_startRowOffset); - if (present_startRowOffset) - builder.append(startRowOffset); - - boolean present_rows = true && (isSetRows()); - builder.append(present_rows); - if (present_rows) - builder.append(rows); - - boolean present_columns = true && (isSetColumns()); - builder.append(present_columns); - if (present_columns) - builder.append(columns); - - return builder.toHashCode(); - } - - public int compareTo(TRowSet other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TRowSet typedOther = (TRowSet)other; - - lastComparison = Boolean.valueOf(isSetStartRowOffset()).compareTo(typedOther.isSetStartRowOffset()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStartRowOffset()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRowOffset, typedOther.startRowOffset); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRows()).compareTo(typedOther.isSetRows()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, typedOther.rows); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TRowSet("); - boolean first = true; - - sb.append("startRowOffset:"); - sb.append(this.startRowOffset); - first = false; - if (!first) sb.append(", "); - sb.append("rows:"); - if (this.rows == null) { - sb.append("null"); - } else { - sb.append(this.rows); - } - first = false; - if (isSetColumns()) { - if (!first) sb.append(", "); - sb.append("columns:"); - if (this.columns == null) { - sb.append("null"); - } else { - sb.append(this.columns); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStartRowOffset()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'startRowOffset' is unset! Struct:" + toString()); - } - - if (!isSetRows()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'rows' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TRowSetStandardSchemeFactory implements SchemeFactory { - public TRowSetStandardScheme getScheme() { - return new TRowSetStandardScheme(); - } - } - - private static class TRowSetStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // START_ROW_OFFSET - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.startRowOffset = iprot.readI64(); - struct.setStartRowOffsetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // ROWS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list118 = iprot.readListBegin(); - struct.rows = new ArrayList(_list118.size); - for (int _i119 = 0; _i119 < _list118.size; ++_i119) - { - TRow _elem120; // optional - _elem120 = new TRow(); - _elem120.read(iprot); - struct.rows.add(_elem120); - } - iprot.readListEnd(); - } - struct.setRowsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // COLUMNS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list121 = iprot.readListBegin(); - struct.columns = new ArrayList(_list121.size); - for (int _i122 = 0; _i122 < _list121.size; ++_i122) - { - TColumn _elem123; // optional - _elem123 = new TColumn(); - _elem123.read(iprot); - struct.columns.add(_elem123); - } - iprot.readListEnd(); - } - struct.setColumnsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TRowSet struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(START_ROW_OFFSET_FIELD_DESC); - oprot.writeI64(struct.startRowOffset); - oprot.writeFieldEnd(); - if (struct.rows != null) { - oprot.writeFieldBegin(ROWS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.rows.size())); - for (TRow _iter124 : struct.rows) - { - _iter124.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.columns != null) { - if (struct.isSetColumns()) { - oprot.writeFieldBegin(COLUMNS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); - for (TColumn _iter125 : struct.columns) - { - _iter125.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRowSetTupleSchemeFactory implements SchemeFactory { - public TRowSetTupleScheme getScheme() { - return new TRowSetTupleScheme(); - } - } - - private static class TRowSetTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI64(struct.startRowOffset); - { - oprot.writeI32(struct.rows.size()); - for (TRow _iter126 : struct.rows) - { - _iter126.write(oprot); - } - } - BitSet optionals = new BitSet(); - if (struct.isSetColumns()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetColumns()) { - { - oprot.writeI32(struct.columns.size()); - for (TColumn _iter127 : struct.columns) - { - _iter127.write(oprot); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.startRowOffset = iprot.readI64(); - struct.setStartRowOffsetIsSet(true); - { - org.apache.thrift.protocol.TList _list128 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.rows = new ArrayList(_list128.size); - for (int _i129 = 0; _i129 < _list128.size; ++_i129) - { - TRow _elem130; // optional - _elem130 = new TRow(); - _elem130.read(iprot); - struct.rows.add(_elem130); - } - } - struct.setRowsIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new ArrayList(_list131.size); - for (int _i132 = 0; _i132 < _list131.size; ++_i132) - { - TColumn _elem133; // optional - _elem133 = new TColumn(); - _elem133.read(iprot); - struct.columns.add(_elem133); - } - } - struct.setColumnsIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TSessionHandle.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TSessionHandle.java deleted file mode 100644 index 82c00dd68a98b..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TSessionHandle.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TSessionHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSessionHandle"); - - private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TSessionHandleStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TSessionHandleTupleSchemeFactory()); - } - - private THandleIdentifier sessionId; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_ID((short)1, "sessionId"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_ID - return SESSION_ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSessionHandle.class, metaDataMap); - } - - public TSessionHandle() { - } - - public TSessionHandle( - THandleIdentifier sessionId) - { - this(); - this.sessionId = sessionId; - } - - /** - * Performs a deep copy on other. - */ - public TSessionHandle(TSessionHandle other) { - if (other.isSetSessionId()) { - this.sessionId = new THandleIdentifier(other.sessionId); - } - } - - public TSessionHandle deepCopy() { - return new TSessionHandle(this); - } - - @Override - public void clear() { - this.sessionId = null; - } - - public THandleIdentifier getSessionId() { - return this.sessionId; - } - - public void setSessionId(THandleIdentifier sessionId) { - this.sessionId = sessionId; - } - - public void unsetSessionId() { - this.sessionId = null; - } - - /** Returns true if field sessionId is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionId() { - return this.sessionId != null; - } - - public void setSessionIdIsSet(boolean value) { - if (!value) { - this.sessionId = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_ID: - if (value == null) { - unsetSessionId(); - } else { - setSessionId((THandleIdentifier)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_ID: - return getSessionId(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_ID: - return isSetSessionId(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TSessionHandle) - return this.equals((TSessionHandle)that); - return false; - } - - public boolean equals(TSessionHandle that) { - if (that == null) - return false; - - boolean this_present_sessionId = true && this.isSetSessionId(); - boolean that_present_sessionId = true && that.isSetSessionId(); - if (this_present_sessionId || that_present_sessionId) { - if (!(this_present_sessionId && that_present_sessionId)) - return false; - if (!this.sessionId.equals(that.sessionId)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_sessionId = true && (isSetSessionId()); - builder.append(present_sessionId); - if (present_sessionId) - builder.append(sessionId); - - return builder.toHashCode(); - } - - public int compareTo(TSessionHandle other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TSessionHandle typedOther = (TSessionHandle)other; - - lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(typedOther.isSetSessionId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, typedOther.sessionId); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TSessionHandle("); - boolean first = true; - - sb.append("sessionId:"); - if (this.sessionId == null) { - sb.append("null"); - } else { - sb.append(this.sessionId); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionId' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionId != null) { - sessionId.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TSessionHandleStandardSchemeFactory implements SchemeFactory { - public TSessionHandleStandardScheme getScheme() { - return new TSessionHandleStandardScheme(); - } - } - - private static class TSessionHandleStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TSessionHandle struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionId = new THandleIdentifier(); - struct.sessionId.read(iprot); - struct.setSessionIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TSessionHandle struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionId != null) { - oprot.writeFieldBegin(SESSION_ID_FIELD_DESC); - struct.sessionId.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TSessionHandleTupleSchemeFactory implements SchemeFactory { - public TSessionHandleTupleScheme getScheme() { - return new TSessionHandleTupleScheme(); - } - } - - private static class TSessionHandleTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionId.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionId = new THandleIdentifier(); - struct.sessionId.read(iprot); - struct.setSessionIdIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStatus.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStatus.java deleted file mode 100644 index 24a746e94965d..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStatus.java +++ /dev/null @@ -1,874 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStatus"); - - private static final org.apache.thrift.protocol.TField STATUS_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("statusCode", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField INFO_MESSAGES_FIELD_DESC = new org.apache.thrift.protocol.TField("infoMessages", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TStatusStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TStatusTupleSchemeFactory()); - } - - private TStatusCode statusCode; // required - private List infoMessages; // optional - private String sqlState; // optional - private int errorCode; // optional - private String errorMessage; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see TStatusCode - */ - STATUS_CODE((short)1, "statusCode"), - INFO_MESSAGES((short)2, "infoMessages"), - SQL_STATE((short)3, "sqlState"), - ERROR_CODE((short)4, "errorCode"), - ERROR_MESSAGE((short)5, "errorMessage"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS_CODE - return STATUS_CODE; - case 2: // INFO_MESSAGES - return INFO_MESSAGES; - case 3: // SQL_STATE - return SQL_STATE; - case 4: // ERROR_CODE - return ERROR_CODE; - case 5: // ERROR_MESSAGE - return ERROR_MESSAGE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERRORCODE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private _Fields optionals[] = {_Fields.INFO_MESSAGES,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS_CODE, new org.apache.thrift.meta_data.FieldMetaData("statusCode", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TStatusCode.class))); - tmpMap.put(_Fields.INFO_MESSAGES, new org.apache.thrift.meta_data.FieldMetaData("infoMessages", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStatus.class, metaDataMap); - } - - public TStatus() { - } - - public TStatus( - TStatusCode statusCode) - { - this(); - this.statusCode = statusCode; - } - - /** - * Performs a deep copy on other. - */ - public TStatus(TStatus other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetStatusCode()) { - this.statusCode = other.statusCode; - } - if (other.isSetInfoMessages()) { - List __this__infoMessages = new ArrayList(); - for (String other_element : other.infoMessages) { - __this__infoMessages.add(other_element); - } - this.infoMessages = __this__infoMessages; - } - if (other.isSetSqlState()) { - this.sqlState = other.sqlState; - } - this.errorCode = other.errorCode; - if (other.isSetErrorMessage()) { - this.errorMessage = other.errorMessage; - } - } - - public TStatus deepCopy() { - return new TStatus(this); - } - - @Override - public void clear() { - this.statusCode = null; - this.infoMessages = null; - this.sqlState = null; - setErrorCodeIsSet(false); - this.errorCode = 0; - this.errorMessage = null; - } - - /** - * - * @see TStatusCode - */ - public TStatusCode getStatusCode() { - return this.statusCode; - } - - /** - * - * @see TStatusCode - */ - public void setStatusCode(TStatusCode statusCode) { - this.statusCode = statusCode; - } - - public void unsetStatusCode() { - this.statusCode = null; - } - - /** Returns true if field statusCode is set (has been assigned a value) and false otherwise */ - public boolean isSetStatusCode() { - return this.statusCode != null; - } - - public void setStatusCodeIsSet(boolean value) { - if (!value) { - this.statusCode = null; - } - } - - public int getInfoMessagesSize() { - return (this.infoMessages == null) ? 0 : this.infoMessages.size(); - } - - public java.util.Iterator getInfoMessagesIterator() { - return (this.infoMessages == null) ? null : this.infoMessages.iterator(); - } - - public void addToInfoMessages(String elem) { - if (this.infoMessages == null) { - this.infoMessages = new ArrayList(); - } - this.infoMessages.add(elem); - } - - public List getInfoMessages() { - return this.infoMessages; - } - - public void setInfoMessages(List infoMessages) { - this.infoMessages = infoMessages; - } - - public void unsetInfoMessages() { - this.infoMessages = null; - } - - /** Returns true if field infoMessages is set (has been assigned a value) and false otherwise */ - public boolean isSetInfoMessages() { - return this.infoMessages != null; - } - - public void setInfoMessagesIsSet(boolean value) { - if (!value) { - this.infoMessages = null; - } - } - - public String getSqlState() { - return this.sqlState; - } - - public void setSqlState(String sqlState) { - this.sqlState = sqlState; - } - - public void unsetSqlState() { - this.sqlState = null; - } - - /** Returns true if field sqlState is set (has been assigned a value) and false otherwise */ - public boolean isSetSqlState() { - return this.sqlState != null; - } - - public void setSqlStateIsSet(boolean value) { - if (!value) { - this.sqlState = null; - } - } - - public int getErrorCode() { - return this.errorCode; - } - - public void setErrorCode(int errorCode) { - this.errorCode = errorCode; - setErrorCodeIsSet(true); - } - - public void unsetErrorCode() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); - } - - /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ - public boolean isSetErrorCode() { - return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); - } - - public void setErrorCodeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); - } - - public String getErrorMessage() { - return this.errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - public void unsetErrorMessage() { - this.errorMessage = null; - } - - /** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */ - public boolean isSetErrorMessage() { - return this.errorMessage != null; - } - - public void setErrorMessageIsSet(boolean value) { - if (!value) { - this.errorMessage = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS_CODE: - if (value == null) { - unsetStatusCode(); - } else { - setStatusCode((TStatusCode)value); - } - break; - - case INFO_MESSAGES: - if (value == null) { - unsetInfoMessages(); - } else { - setInfoMessages((List)value); - } - break; - - case SQL_STATE: - if (value == null) { - unsetSqlState(); - } else { - setSqlState((String)value); - } - break; - - case ERROR_CODE: - if (value == null) { - unsetErrorCode(); - } else { - setErrorCode((Integer)value); - } - break; - - case ERROR_MESSAGE: - if (value == null) { - unsetErrorMessage(); - } else { - setErrorMessage((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS_CODE: - return getStatusCode(); - - case INFO_MESSAGES: - return getInfoMessages(); - - case SQL_STATE: - return getSqlState(); - - case ERROR_CODE: - return Integer.valueOf(getErrorCode()); - - case ERROR_MESSAGE: - return getErrorMessage(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS_CODE: - return isSetStatusCode(); - case INFO_MESSAGES: - return isSetInfoMessages(); - case SQL_STATE: - return isSetSqlState(); - case ERROR_CODE: - return isSetErrorCode(); - case ERROR_MESSAGE: - return isSetErrorMessage(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TStatus) - return this.equals((TStatus)that); - return false; - } - - public boolean equals(TStatus that) { - if (that == null) - return false; - - boolean this_present_statusCode = true && this.isSetStatusCode(); - boolean that_present_statusCode = true && that.isSetStatusCode(); - if (this_present_statusCode || that_present_statusCode) { - if (!(this_present_statusCode && that_present_statusCode)) - return false; - if (!this.statusCode.equals(that.statusCode)) - return false; - } - - boolean this_present_infoMessages = true && this.isSetInfoMessages(); - boolean that_present_infoMessages = true && that.isSetInfoMessages(); - if (this_present_infoMessages || that_present_infoMessages) { - if (!(this_present_infoMessages && that_present_infoMessages)) - return false; - if (!this.infoMessages.equals(that.infoMessages)) - return false; - } - - boolean this_present_sqlState = true && this.isSetSqlState(); - boolean that_present_sqlState = true && that.isSetSqlState(); - if (this_present_sqlState || that_present_sqlState) { - if (!(this_present_sqlState && that_present_sqlState)) - return false; - if (!this.sqlState.equals(that.sqlState)) - return false; - } - - boolean this_present_errorCode = true && this.isSetErrorCode(); - boolean that_present_errorCode = true && that.isSetErrorCode(); - if (this_present_errorCode || that_present_errorCode) { - if (!(this_present_errorCode && that_present_errorCode)) - return false; - if (this.errorCode != that.errorCode) - return false; - } - - boolean this_present_errorMessage = true && this.isSetErrorMessage(); - boolean that_present_errorMessage = true && that.isSetErrorMessage(); - if (this_present_errorMessage || that_present_errorMessage) { - if (!(this_present_errorMessage && that_present_errorMessage)) - return false; - if (!this.errorMessage.equals(that.errorMessage)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_statusCode = true && (isSetStatusCode()); - builder.append(present_statusCode); - if (present_statusCode) - builder.append(statusCode.getValue()); - - boolean present_infoMessages = true && (isSetInfoMessages()); - builder.append(present_infoMessages); - if (present_infoMessages) - builder.append(infoMessages); - - boolean present_sqlState = true && (isSetSqlState()); - builder.append(present_sqlState); - if (present_sqlState) - builder.append(sqlState); - - boolean present_errorCode = true && (isSetErrorCode()); - builder.append(present_errorCode); - if (present_errorCode) - builder.append(errorCode); - - boolean present_errorMessage = true && (isSetErrorMessage()); - builder.append(present_errorMessage); - if (present_errorMessage) - builder.append(errorMessage); - - return builder.toHashCode(); - } - - public int compareTo(TStatus other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TStatus typedOther = (TStatus)other; - - lastComparison = Boolean.valueOf(isSetStatusCode()).compareTo(typedOther.isSetStatusCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatusCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statusCode, typedOther.statusCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetInfoMessages()).compareTo(typedOther.isSetInfoMessages()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetInfoMessages()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoMessages, typedOther.infoMessages); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(typedOther.isSetSqlState()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSqlState()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, typedOther.sqlState); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(typedOther.isSetErrorCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErrorCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, typedOther.errorCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(typedOther.isSetErrorMessage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErrorMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, typedOther.errorMessage); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TStatus("); - boolean first = true; - - sb.append("statusCode:"); - if (this.statusCode == null) { - sb.append("null"); - } else { - sb.append(this.statusCode); - } - first = false; - if (isSetInfoMessages()) { - if (!first) sb.append(", "); - sb.append("infoMessages:"); - if (this.infoMessages == null) { - sb.append("null"); - } else { - sb.append(this.infoMessages); - } - first = false; - } - if (isSetSqlState()) { - if (!first) sb.append(", "); - sb.append("sqlState:"); - if (this.sqlState == null) { - sb.append("null"); - } else { - sb.append(this.sqlState); - } - first = false; - } - if (isSetErrorCode()) { - if (!first) sb.append(", "); - sb.append("errorCode:"); - sb.append(this.errorCode); - first = false; - } - if (isSetErrorMessage()) { - if (!first) sb.append(", "); - sb.append("errorMessage:"); - if (this.errorMessage == null) { - sb.append("null"); - } else { - sb.append(this.errorMessage); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatusCode()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'statusCode' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TStatusStandardSchemeFactory implements SchemeFactory { - public TStatusStandardScheme getScheme() { - return new TStatusStandardScheme(); - } - } - - private static class TStatusStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TStatus struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.statusCode = TStatusCode.findByValue(iprot.readI32()); - struct.setStatusCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // INFO_MESSAGES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list134 = iprot.readListBegin(); - struct.infoMessages = new ArrayList(_list134.size); - for (int _i135 = 0; _i135 < _list134.size; ++_i135) - { - String _elem136; // optional - _elem136 = iprot.readString(); - struct.infoMessages.add(_elem136); - } - iprot.readListEnd(); - } - struct.setInfoMessagesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SQL_STATE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.sqlState = iprot.readString(); - struct.setSqlStateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // ERROR_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.errorCode = iprot.readI32(); - struct.setErrorCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // ERROR_MESSAGE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.errorMessage = iprot.readString(); - struct.setErrorMessageIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TStatus struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.statusCode != null) { - oprot.writeFieldBegin(STATUS_CODE_FIELD_DESC); - oprot.writeI32(struct.statusCode.getValue()); - oprot.writeFieldEnd(); - } - if (struct.infoMessages != null) { - if (struct.isSetInfoMessages()) { - oprot.writeFieldBegin(INFO_MESSAGES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.infoMessages.size())); - for (String _iter137 : struct.infoMessages) - { - oprot.writeString(_iter137); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (struct.sqlState != null) { - if (struct.isSetSqlState()) { - oprot.writeFieldBegin(SQL_STATE_FIELD_DESC); - oprot.writeString(struct.sqlState); - oprot.writeFieldEnd(); - } - } - if (struct.isSetErrorCode()) { - oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); - oprot.writeI32(struct.errorCode); - oprot.writeFieldEnd(); - } - if (struct.errorMessage != null) { - if (struct.isSetErrorMessage()) { - oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC); - oprot.writeString(struct.errorMessage); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TStatusTupleSchemeFactory implements SchemeFactory { - public TStatusTupleScheme getScheme() { - return new TStatusTupleScheme(); - } - } - - private static class TStatusTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.statusCode.getValue()); - BitSet optionals = new BitSet(); - if (struct.isSetInfoMessages()) { - optionals.set(0); - } - if (struct.isSetSqlState()) { - optionals.set(1); - } - if (struct.isSetErrorCode()) { - optionals.set(2); - } - if (struct.isSetErrorMessage()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetInfoMessages()) { - { - oprot.writeI32(struct.infoMessages.size()); - for (String _iter138 : struct.infoMessages) - { - oprot.writeString(_iter138); - } - } - } - if (struct.isSetSqlState()) { - oprot.writeString(struct.sqlState); - } - if (struct.isSetErrorCode()) { - oprot.writeI32(struct.errorCode); - } - if (struct.isSetErrorMessage()) { - oprot.writeString(struct.errorMessage); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.statusCode = TStatusCode.findByValue(iprot.readI32()); - struct.setStatusCodeIsSet(true); - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list139 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.infoMessages = new ArrayList(_list139.size); - for (int _i140 = 0; _i140 < _list139.size; ++_i140) - { - String _elem141; // optional - _elem141 = iprot.readString(); - struct.infoMessages.add(_elem141); - } - } - struct.setInfoMessagesIsSet(true); - } - if (incoming.get(1)) { - struct.sqlState = iprot.readString(); - struct.setSqlStateIsSet(true); - } - if (incoming.get(2)) { - struct.errorCode = iprot.readI32(); - struct.setErrorCodeIsSet(true); - } - if (incoming.get(3)) { - struct.errorMessage = iprot.readString(); - struct.setErrorMessageIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStatusCode.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStatusCode.java deleted file mode 100644 index e7fde45fd131a..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStatusCode.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TStatusCode implements org.apache.thrift.TEnum { - SUCCESS_STATUS(0), - SUCCESS_WITH_INFO_STATUS(1), - STILL_EXECUTING_STATUS(2), - ERROR_STATUS(3), - INVALID_HANDLE_STATUS(4); - - private final int value; - - private TStatusCode(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TStatusCode findByValue(int value) { - switch (value) { - case 0: - return SUCCESS_STATUS; - case 1: - return SUCCESS_WITH_INFO_STATUS; - case 2: - return STILL_EXECUTING_STATUS; - case 3: - return ERROR_STATUS; - case 4: - return INVALID_HANDLE_STATUS; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStringColumn.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStringColumn.java deleted file mode 100644 index 3dae460c8621d..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStringColumn.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TStringColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TStringColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TStringColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringColumn.class, metaDataMap); - } - - public TStringColumn() { - } - - public TStringColumn( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = nulls; - } - - /** - * Performs a deep copy on other. - */ - public TStringColumn(TStringColumn other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(); - for (String other_element : other.values) { - __this__values.add(other_element); - } - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); -; - } - } - - public TStringColumn deepCopy() { - return new TStringColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(String elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return nulls; - } - - public void setNulls(byte[] nulls) { - setNulls(nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(nulls)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = nulls; - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TStringColumn) - return this.equals((TStringColumn)that); - return false; - } - - public boolean equals(TStringColumn that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_values = true && (isSetValues()); - builder.append(present_values); - if (present_values) - builder.append(values); - - boolean present_nulls = true && (isSetNulls()); - builder.append(present_nulls); - if (present_nulls) - builder.append(nulls); - - return builder.toHashCode(); - } - - public int compareTo(TStringColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TStringColumn typedOther = (TStringColumn)other; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(typedOther.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, typedOther.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(typedOther.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, typedOther.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TStringColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TStringColumnStandardSchemeFactory implements SchemeFactory { - public TStringColumnStandardScheme getScheme() { - return new TStringColumnStandardScheme(); - } - } - - private static class TStringColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TStringColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); - struct.values = new ArrayList(_list102.size); - for (int _i103 = 0; _i103 < _list102.size; ++_i103) - { - String _elem104; // optional - _elem104 = iprot.readString(); - struct.values.add(_elem104); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TStringColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); - for (String _iter105 : struct.values) - { - oprot.writeString(_iter105); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TStringColumnTupleSchemeFactory implements SchemeFactory { - public TStringColumnTupleScheme getScheme() { - return new TStringColumnTupleScheme(); - } - } - - private static class TStringColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (String _iter106 : struct.values) - { - oprot.writeString(_iter106); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list107 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.values = new ArrayList(_list107.size); - for (int _i108 = 0; _i108 < _list107.size; ++_i108) - { - String _elem109; // optional - _elem109 = iprot.readString(); - struct.values.add(_elem109); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStringValue.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStringValue.java deleted file mode 100644 index af7a109775a8b..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStringValue.java +++ /dev/null @@ -1,389 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TStringValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringValue"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TStringValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TStringValueTupleSchemeFactory()); - } - - private String value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringValue.class, metaDataMap); - } - - public TStringValue() { - } - - /** - * Performs a deep copy on other. - */ - public TStringValue(TStringValue other) { - if (other.isSetValue()) { - this.value = other.value; - } - } - - public TStringValue deepCopy() { - return new TStringValue(this); - } - - @Override - public void clear() { - this.value = null; - } - - public String getValue() { - return this.value; - } - - public void setValue(String value) { - this.value = value; - } - - public void unsetValue() { - this.value = null; - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return this.value != null; - } - - public void setValueIsSet(boolean value) { - if (!value) { - this.value = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TStringValue) - return this.equals((TStringValue)that); - return false; - } - - public boolean equals(TStringValue that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (!this.value.equals(that.value)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_value = true && (isSetValue()); - builder.append(present_value); - if (present_value) - builder.append(value); - - return builder.toHashCode(); - } - - public int compareTo(TStringValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TStringValue typedOther = (TStringValue)other; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(typedOther.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, typedOther.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TStringValue("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - if (this.value == null) { - sb.append("null"); - } else { - sb.append(this.value); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TStringValueStandardSchemeFactory implements SchemeFactory { - public TStringValueStandardScheme getScheme() { - return new TStringValueStandardScheme(); - } - } - - private static class TStringValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TStringValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.value = iprot.readString(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TStringValue struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.value != null) { - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeString(struct.value); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TStringValueTupleSchemeFactory implements SchemeFactory { - public TStringValueTupleScheme getScheme() { - return new TStringValueTupleScheme(); - } - } - - private static class TStringValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeString(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readString(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStructTypeEntry.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStructTypeEntry.java deleted file mode 100644 index 20f5fb6c29073..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TStructTypeEntry.java +++ /dev/null @@ -1,448 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TStructTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStructTypeEntry"); - - private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TStructTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TStructTypeEntryTupleSchemeFactory()); - } - - private Map nameToTypePtr; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // NAME_TO_TYPE_PTR - return NAME_TO_TYPE_PTR; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStructTypeEntry.class, metaDataMap); - } - - public TStructTypeEntry() { - } - - public TStructTypeEntry( - Map nameToTypePtr) - { - this(); - this.nameToTypePtr = nameToTypePtr; - } - - /** - * Performs a deep copy on other. - */ - public TStructTypeEntry(TStructTypeEntry other) { - if (other.isSetNameToTypePtr()) { - Map __this__nameToTypePtr = new HashMap(); - for (Map.Entry other_element : other.nameToTypePtr.entrySet()) { - - String other_element_key = other_element.getKey(); - Integer other_element_value = other_element.getValue(); - - String __this__nameToTypePtr_copy_key = other_element_key; - - Integer __this__nameToTypePtr_copy_value = other_element_value; - - __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); - } - this.nameToTypePtr = __this__nameToTypePtr; - } - } - - public TStructTypeEntry deepCopy() { - return new TStructTypeEntry(this); - } - - @Override - public void clear() { - this.nameToTypePtr = null; - } - - public int getNameToTypePtrSize() { - return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); - } - - public void putToNameToTypePtr(String key, int val) { - if (this.nameToTypePtr == null) { - this.nameToTypePtr = new HashMap(); - } - this.nameToTypePtr.put(key, val); - } - - public Map getNameToTypePtr() { - return this.nameToTypePtr; - } - - public void setNameToTypePtr(Map nameToTypePtr) { - this.nameToTypePtr = nameToTypePtr; - } - - public void unsetNameToTypePtr() { - this.nameToTypePtr = null; - } - - /** Returns true if field nameToTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetNameToTypePtr() { - return this.nameToTypePtr != null; - } - - public void setNameToTypePtrIsSet(boolean value) { - if (!value) { - this.nameToTypePtr = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME_TO_TYPE_PTR: - if (value == null) { - unsetNameToTypePtr(); - } else { - setNameToTypePtr((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME_TO_TYPE_PTR: - return getNameToTypePtr(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case NAME_TO_TYPE_PTR: - return isSetNameToTypePtr(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TStructTypeEntry) - return this.equals((TStructTypeEntry)that); - return false; - } - - public boolean equals(TStructTypeEntry that) { - if (that == null) - return false; - - boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); - boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); - if (this_present_nameToTypePtr || that_present_nameToTypePtr) { - if (!(this_present_nameToTypePtr && that_present_nameToTypePtr)) - return false; - if (!this.nameToTypePtr.equals(that.nameToTypePtr)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_nameToTypePtr = true && (isSetNameToTypePtr()); - builder.append(present_nameToTypePtr); - if (present_nameToTypePtr) - builder.append(nameToTypePtr); - - return builder.toHashCode(); - } - - public int compareTo(TStructTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TStructTypeEntry typedOther = (TStructTypeEntry)other; - - lastComparison = Boolean.valueOf(isSetNameToTypePtr()).compareTo(typedOther.isSetNameToTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNameToTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nameToTypePtr, typedOther.nameToTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TStructTypeEntry("); - boolean first = true; - - sb.append("nameToTypePtr:"); - if (this.nameToTypePtr == null) { - sb.append("null"); - } else { - sb.append(this.nameToTypePtr); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetNameToTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nameToTypePtr' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TStructTypeEntryStandardSchemeFactory implements SchemeFactory { - public TStructTypeEntryStandardScheme getScheme() { - return new TStructTypeEntryStandardScheme(); - } - } - - private static class TStructTypeEntryStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TStructTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // NAME_TO_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map10 = iprot.readMapBegin(); - struct.nameToTypePtr = new HashMap(2*_map10.size); - for (int _i11 = 0; _i11 < _map10.size; ++_i11) - { - String _key12; // required - int _val13; // required - _key12 = iprot.readString(); - _val13 = iprot.readI32(); - struct.nameToTypePtr.put(_key12, _val13); - } - iprot.readMapEnd(); - } - struct.setNameToTypePtrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TStructTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.nameToTypePtr != null) { - oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); - for (Map.Entry _iter14 : struct.nameToTypePtr.entrySet()) - { - oprot.writeString(_iter14.getKey()); - oprot.writeI32(_iter14.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TStructTypeEntryTupleSchemeFactory implements SchemeFactory { - public TStructTypeEntryTupleScheme getScheme() { - return new TStructTypeEntryTupleScheme(); - } - } - - private static class TStructTypeEntryTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.nameToTypePtr.size()); - for (Map.Entry _iter15 : struct.nameToTypePtr.entrySet()) - { - oprot.writeString(_iter15.getKey()); - oprot.writeI32(_iter15.getValue()); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TMap _map16 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.nameToTypePtr = new HashMap(2*_map16.size); - for (int _i17 = 0; _i17 < _map16.size; ++_i17) - { - String _key18; // required - int _val19; // required - _key18 = iprot.readString(); - _val19 = iprot.readI32(); - struct.nameToTypePtr.put(_key18, _val19); - } - } - struct.setNameToTypePtrIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTableSchema.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTableSchema.java deleted file mode 100644 index ff5e54db7c16c..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTableSchema.java +++ /dev/null @@ -1,439 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TTableSchema implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableSchema"); - - private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TTableSchemaStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TTableSchemaTupleSchemeFactory()); - } - - private List columns; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - COLUMNS((short)1, "columns"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // COLUMNS - return COLUMNS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnDesc.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableSchema.class, metaDataMap); - } - - public TTableSchema() { - } - - public TTableSchema( - List columns) - { - this(); - this.columns = columns; - } - - /** - * Performs a deep copy on other. - */ - public TTableSchema(TTableSchema other) { - if (other.isSetColumns()) { - List __this__columns = new ArrayList(); - for (TColumnDesc other_element : other.columns) { - __this__columns.add(new TColumnDesc(other_element)); - } - this.columns = __this__columns; - } - } - - public TTableSchema deepCopy() { - return new TTableSchema(this); - } - - @Override - public void clear() { - this.columns = null; - } - - public int getColumnsSize() { - return (this.columns == null) ? 0 : this.columns.size(); - } - - public java.util.Iterator getColumnsIterator() { - return (this.columns == null) ? null : this.columns.iterator(); - } - - public void addToColumns(TColumnDesc elem) { - if (this.columns == null) { - this.columns = new ArrayList(); - } - this.columns.add(elem); - } - - public List getColumns() { - return this.columns; - } - - public void setColumns(List columns) { - this.columns = columns; - } - - public void unsetColumns() { - this.columns = null; - } - - /** Returns true if field columns is set (has been assigned a value) and false otherwise */ - public boolean isSetColumns() { - return this.columns != null; - } - - public void setColumnsIsSet(boolean value) { - if (!value) { - this.columns = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case COLUMNS: - if (value == null) { - unsetColumns(); - } else { - setColumns((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case COLUMNS: - return getColumns(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case COLUMNS: - return isSetColumns(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TTableSchema) - return this.equals((TTableSchema)that); - return false; - } - - public boolean equals(TTableSchema that) { - if (that == null) - return false; - - boolean this_present_columns = true && this.isSetColumns(); - boolean that_present_columns = true && that.isSetColumns(); - if (this_present_columns || that_present_columns) { - if (!(this_present_columns && that_present_columns)) - return false; - if (!this.columns.equals(that.columns)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_columns = true && (isSetColumns()); - builder.append(present_columns); - if (present_columns) - builder.append(columns); - - return builder.toHashCode(); - } - - public int compareTo(TTableSchema other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TTableSchema typedOther = (TTableSchema)other; - - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(typedOther.isSetColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, typedOther.columns); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TTableSchema("); - boolean first = true; - - sb.append("columns:"); - if (this.columns == null) { - sb.append("null"); - } else { - sb.append(this.columns); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetColumns()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'columns' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TTableSchemaStandardSchemeFactory implements SchemeFactory { - public TTableSchemaStandardScheme getScheme() { - return new TTableSchemaStandardScheme(); - } - } - - private static class TTableSchemaStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TTableSchema struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // COLUMNS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list38 = iprot.readListBegin(); - struct.columns = new ArrayList(_list38.size); - for (int _i39 = 0; _i39 < _list38.size; ++_i39) - { - TColumnDesc _elem40; // optional - _elem40 = new TColumnDesc(); - _elem40.read(iprot); - struct.columns.add(_elem40); - } - iprot.readListEnd(); - } - struct.setColumnsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TTableSchema struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.columns != null) { - oprot.writeFieldBegin(COLUMNS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); - for (TColumnDesc _iter41 : struct.columns) - { - _iter41.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TTableSchemaTupleSchemeFactory implements SchemeFactory { - public TTableSchemaTupleScheme getScheme() { - return new TTableSchemaTupleScheme(); - } - } - - private static class TTableSchemaTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.columns.size()); - for (TColumnDesc _iter42 : struct.columns) - { - _iter42.write(oprot); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list43 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new ArrayList(_list43.size); - for (int _i44 = 0; _i44 < _list43.size; ++_i44) - { - TColumnDesc _elem45; // optional - _elem45 = new TColumnDesc(); - _elem45.read(iprot); - struct.columns.add(_elem45); - } - } - struct.setColumnsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeDesc.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeDesc.java deleted file mode 100644 index 251f86a914719..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeDesc.java +++ /dev/null @@ -1,439 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TTypeDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeDesc"); - - private static final org.apache.thrift.protocol.TField TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("types", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TTypeDescStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TTypeDescTupleSchemeFactory()); - } - - private List types; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - TYPES((short)1, "types"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // TYPES - return TYPES; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TYPES, new org.apache.thrift.meta_data.FieldMetaData("types", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeEntry.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeDesc.class, metaDataMap); - } - - public TTypeDesc() { - } - - public TTypeDesc( - List types) - { - this(); - this.types = types; - } - - /** - * Performs a deep copy on other. - */ - public TTypeDesc(TTypeDesc other) { - if (other.isSetTypes()) { - List __this__types = new ArrayList(); - for (TTypeEntry other_element : other.types) { - __this__types.add(new TTypeEntry(other_element)); - } - this.types = __this__types; - } - } - - public TTypeDesc deepCopy() { - return new TTypeDesc(this); - } - - @Override - public void clear() { - this.types = null; - } - - public int getTypesSize() { - return (this.types == null) ? 0 : this.types.size(); - } - - public java.util.Iterator getTypesIterator() { - return (this.types == null) ? null : this.types.iterator(); - } - - public void addToTypes(TTypeEntry elem) { - if (this.types == null) { - this.types = new ArrayList(); - } - this.types.add(elem); - } - - public List getTypes() { - return this.types; - } - - public void setTypes(List types) { - this.types = types; - } - - public void unsetTypes() { - this.types = null; - } - - /** Returns true if field types is set (has been assigned a value) and false otherwise */ - public boolean isSetTypes() { - return this.types != null; - } - - public void setTypesIsSet(boolean value) { - if (!value) { - this.types = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TYPES: - if (value == null) { - unsetTypes(); - } else { - setTypes((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TYPES: - return getTypes(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case TYPES: - return isSetTypes(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TTypeDesc) - return this.equals((TTypeDesc)that); - return false; - } - - public boolean equals(TTypeDesc that) { - if (that == null) - return false; - - boolean this_present_types = true && this.isSetTypes(); - boolean that_present_types = true && that.isSetTypes(); - if (this_present_types || that_present_types) { - if (!(this_present_types && that_present_types)) - return false; - if (!this.types.equals(that.types)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_types = true && (isSetTypes()); - builder.append(present_types); - if (present_types) - builder.append(types); - - return builder.toHashCode(); - } - - public int compareTo(TTypeDesc other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TTypeDesc typedOther = (TTypeDesc)other; - - lastComparison = Boolean.valueOf(isSetTypes()).compareTo(typedOther.isSetTypes()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTypes()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.types, typedOther.types); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TTypeDesc("); - boolean first = true; - - sb.append("types:"); - if (this.types == null) { - sb.append("null"); - } else { - sb.append(this.types); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetTypes()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'types' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TTypeDescStandardSchemeFactory implements SchemeFactory { - public TTypeDescStandardScheme getScheme() { - return new TTypeDescStandardScheme(); - } - } - - private static class TTypeDescStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeDesc struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // TYPES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list30 = iprot.readListBegin(); - struct.types = new ArrayList(_list30.size); - for (int _i31 = 0; _i31 < _list30.size; ++_i31) - { - TTypeEntry _elem32; // optional - _elem32 = new TTypeEntry(); - _elem32.read(iprot); - struct.types.add(_elem32); - } - iprot.readListEnd(); - } - struct.setTypesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TTypeDesc struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.types != null) { - oprot.writeFieldBegin(TYPES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.types.size())); - for (TTypeEntry _iter33 : struct.types) - { - _iter33.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TTypeDescTupleSchemeFactory implements SchemeFactory { - public TTypeDescTupleScheme getScheme() { - return new TTypeDescTupleScheme(); - } - } - - private static class TTypeDescTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.types.size()); - for (TTypeEntry _iter34 : struct.types) - { - _iter34.write(oprot); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list35 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.types = new ArrayList(_list35.size); - for (int _i36 = 0; _i36 < _list35.size; ++_i36) - { - TTypeEntry _elem37; // optional - _elem37 = new TTypeEntry(); - _elem37.read(iprot); - struct.types.add(_elem37); - } - } - struct.setTypesIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeEntry.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeEntry.java deleted file mode 100644 index d0d70c1279572..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeEntry.java +++ /dev/null @@ -1,610 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TTypeEntry extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeEntry"); - private static final org.apache.thrift.protocol.TField PRIMITIVE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("primitiveEntry", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField ARRAY_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("arrayEntry", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField MAP_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("mapEntry", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField STRUCT_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("structEntry", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField UNION_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("unionEntry", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.protocol.TField USER_DEFINED_TYPE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("userDefinedTypeEntry", org.apache.thrift.protocol.TType.STRUCT, (short)6); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - PRIMITIVE_ENTRY((short)1, "primitiveEntry"), - ARRAY_ENTRY((short)2, "arrayEntry"), - MAP_ENTRY((short)3, "mapEntry"), - STRUCT_ENTRY((short)4, "structEntry"), - UNION_ENTRY((short)5, "unionEntry"), - USER_DEFINED_TYPE_ENTRY((short)6, "userDefinedTypeEntry"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // PRIMITIVE_ENTRY - return PRIMITIVE_ENTRY; - case 2: // ARRAY_ENTRY - return ARRAY_ENTRY; - case 3: // MAP_ENTRY - return MAP_ENTRY; - case 4: // STRUCT_ENTRY - return STRUCT_ENTRY; - case 5: // UNION_ENTRY - return UNION_ENTRY; - case 6: // USER_DEFINED_TYPE_ENTRY - return USER_DEFINED_TYPE_ENTRY; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.PRIMITIVE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("primitiveEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPrimitiveTypeEntry.class))); - tmpMap.put(_Fields.ARRAY_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("arrayEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TArrayTypeEntry.class))); - tmpMap.put(_Fields.MAP_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("mapEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TMapTypeEntry.class))); - tmpMap.put(_Fields.STRUCT_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("structEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStructTypeEntry.class))); - tmpMap.put(_Fields.UNION_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("unionEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUnionTypeEntry.class))); - tmpMap.put(_Fields.USER_DEFINED_TYPE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("userDefinedTypeEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUserDefinedTypeEntry.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeEntry.class, metaDataMap); - } - - public TTypeEntry() { - super(); - } - - public TTypeEntry(TTypeEntry._Fields setField, Object value) { - super(setField, value); - } - - public TTypeEntry(TTypeEntry other) { - super(other); - } - public TTypeEntry deepCopy() { - return new TTypeEntry(this); - } - - public static TTypeEntry primitiveEntry(TPrimitiveTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setPrimitiveEntry(value); - return x; - } - - public static TTypeEntry arrayEntry(TArrayTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setArrayEntry(value); - return x; - } - - public static TTypeEntry mapEntry(TMapTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setMapEntry(value); - return x; - } - - public static TTypeEntry structEntry(TStructTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setStructEntry(value); - return x; - } - - public static TTypeEntry unionEntry(TUnionTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setUnionEntry(value); - return x; - } - - public static TTypeEntry userDefinedTypeEntry(TUserDefinedTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setUserDefinedTypeEntry(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case PRIMITIVE_ENTRY: - if (value instanceof TPrimitiveTypeEntry) { - break; - } - throw new ClassCastException("Was expecting value of type TPrimitiveTypeEntry for field 'primitiveEntry', but got " + value.getClass().getSimpleName()); - case ARRAY_ENTRY: - if (value instanceof TArrayTypeEntry) { - break; - } - throw new ClassCastException("Was expecting value of type TArrayTypeEntry for field 'arrayEntry', but got " + value.getClass().getSimpleName()); - case MAP_ENTRY: - if (value instanceof TMapTypeEntry) { - break; - } - throw new ClassCastException("Was expecting value of type TMapTypeEntry for field 'mapEntry', but got " + value.getClass().getSimpleName()); - case STRUCT_ENTRY: - if (value instanceof TStructTypeEntry) { - break; - } - throw new ClassCastException("Was expecting value of type TStructTypeEntry for field 'structEntry', but got " + value.getClass().getSimpleName()); - case UNION_ENTRY: - if (value instanceof TUnionTypeEntry) { - break; - } - throw new ClassCastException("Was expecting value of type TUnionTypeEntry for field 'unionEntry', but got " + value.getClass().getSimpleName()); - case USER_DEFINED_TYPE_ENTRY: - if (value instanceof TUserDefinedTypeEntry) { - break; - } - throw new ClassCastException("Was expecting value of type TUserDefinedTypeEntry for field 'userDefinedTypeEntry', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case PRIMITIVE_ENTRY: - if (field.type == PRIMITIVE_ENTRY_FIELD_DESC.type) { - TPrimitiveTypeEntry primitiveEntry; - primitiveEntry = new TPrimitiveTypeEntry(); - primitiveEntry.read(iprot); - return primitiveEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case ARRAY_ENTRY: - if (field.type == ARRAY_ENTRY_FIELD_DESC.type) { - TArrayTypeEntry arrayEntry; - arrayEntry = new TArrayTypeEntry(); - arrayEntry.read(iprot); - return arrayEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case MAP_ENTRY: - if (field.type == MAP_ENTRY_FIELD_DESC.type) { - TMapTypeEntry mapEntry; - mapEntry = new TMapTypeEntry(); - mapEntry.read(iprot); - return mapEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRUCT_ENTRY: - if (field.type == STRUCT_ENTRY_FIELD_DESC.type) { - TStructTypeEntry structEntry; - structEntry = new TStructTypeEntry(); - structEntry.read(iprot); - return structEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case UNION_ENTRY: - if (field.type == UNION_ENTRY_FIELD_DESC.type) { - TUnionTypeEntry unionEntry; - unionEntry = new TUnionTypeEntry(); - unionEntry.read(iprot); - return unionEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case USER_DEFINED_TYPE_ENTRY: - if (field.type == USER_DEFINED_TYPE_ENTRY_FIELD_DESC.type) { - TUserDefinedTypeEntry userDefinedTypeEntry; - userDefinedTypeEntry = new TUserDefinedTypeEntry(); - userDefinedTypeEntry.read(iprot); - return userDefinedTypeEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case PRIMITIVE_ENTRY: - TPrimitiveTypeEntry primitiveEntry = (TPrimitiveTypeEntry)value_; - primitiveEntry.write(oprot); - return; - case ARRAY_ENTRY: - TArrayTypeEntry arrayEntry = (TArrayTypeEntry)value_; - arrayEntry.write(oprot); - return; - case MAP_ENTRY: - TMapTypeEntry mapEntry = (TMapTypeEntry)value_; - mapEntry.write(oprot); - return; - case STRUCT_ENTRY: - TStructTypeEntry structEntry = (TStructTypeEntry)value_; - structEntry.write(oprot); - return; - case UNION_ENTRY: - TUnionTypeEntry unionEntry = (TUnionTypeEntry)value_; - unionEntry.write(oprot); - return; - case USER_DEFINED_TYPE_ENTRY: - TUserDefinedTypeEntry userDefinedTypeEntry = (TUserDefinedTypeEntry)value_; - userDefinedTypeEntry.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case PRIMITIVE_ENTRY: - TPrimitiveTypeEntry primitiveEntry; - primitiveEntry = new TPrimitiveTypeEntry(); - primitiveEntry.read(iprot); - return primitiveEntry; - case ARRAY_ENTRY: - TArrayTypeEntry arrayEntry; - arrayEntry = new TArrayTypeEntry(); - arrayEntry.read(iprot); - return arrayEntry; - case MAP_ENTRY: - TMapTypeEntry mapEntry; - mapEntry = new TMapTypeEntry(); - mapEntry.read(iprot); - return mapEntry; - case STRUCT_ENTRY: - TStructTypeEntry structEntry; - structEntry = new TStructTypeEntry(); - structEntry.read(iprot); - return structEntry; - case UNION_ENTRY: - TUnionTypeEntry unionEntry; - unionEntry = new TUnionTypeEntry(); - unionEntry.read(iprot); - return unionEntry; - case USER_DEFINED_TYPE_ENTRY: - TUserDefinedTypeEntry userDefinedTypeEntry; - userDefinedTypeEntry = new TUserDefinedTypeEntry(); - userDefinedTypeEntry.read(iprot); - return userDefinedTypeEntry; - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case PRIMITIVE_ENTRY: - TPrimitiveTypeEntry primitiveEntry = (TPrimitiveTypeEntry)value_; - primitiveEntry.write(oprot); - return; - case ARRAY_ENTRY: - TArrayTypeEntry arrayEntry = (TArrayTypeEntry)value_; - arrayEntry.write(oprot); - return; - case MAP_ENTRY: - TMapTypeEntry mapEntry = (TMapTypeEntry)value_; - mapEntry.write(oprot); - return; - case STRUCT_ENTRY: - TStructTypeEntry structEntry = (TStructTypeEntry)value_; - structEntry.write(oprot); - return; - case UNION_ENTRY: - TUnionTypeEntry unionEntry = (TUnionTypeEntry)value_; - unionEntry.write(oprot); - return; - case USER_DEFINED_TYPE_ENTRY: - TUserDefinedTypeEntry userDefinedTypeEntry = (TUserDefinedTypeEntry)value_; - userDefinedTypeEntry.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case PRIMITIVE_ENTRY: - return PRIMITIVE_ENTRY_FIELD_DESC; - case ARRAY_ENTRY: - return ARRAY_ENTRY_FIELD_DESC; - case MAP_ENTRY: - return MAP_ENTRY_FIELD_DESC; - case STRUCT_ENTRY: - return STRUCT_ENTRY_FIELD_DESC; - case UNION_ENTRY: - return UNION_ENTRY_FIELD_DESC; - case USER_DEFINED_TYPE_ENTRY: - return USER_DEFINED_TYPE_ENTRY_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public TPrimitiveTypeEntry getPrimitiveEntry() { - if (getSetField() == _Fields.PRIMITIVE_ENTRY) { - return (TPrimitiveTypeEntry)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'primitiveEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setPrimitiveEntry(TPrimitiveTypeEntry value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.PRIMITIVE_ENTRY; - value_ = value; - } - - public TArrayTypeEntry getArrayEntry() { - if (getSetField() == _Fields.ARRAY_ENTRY) { - return (TArrayTypeEntry)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'arrayEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setArrayEntry(TArrayTypeEntry value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.ARRAY_ENTRY; - value_ = value; - } - - public TMapTypeEntry getMapEntry() { - if (getSetField() == _Fields.MAP_ENTRY) { - return (TMapTypeEntry)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'mapEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setMapEntry(TMapTypeEntry value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.MAP_ENTRY; - value_ = value; - } - - public TStructTypeEntry getStructEntry() { - if (getSetField() == _Fields.STRUCT_ENTRY) { - return (TStructTypeEntry)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'structEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStructEntry(TStructTypeEntry value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.STRUCT_ENTRY; - value_ = value; - } - - public TUnionTypeEntry getUnionEntry() { - if (getSetField() == _Fields.UNION_ENTRY) { - return (TUnionTypeEntry)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'unionEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setUnionEntry(TUnionTypeEntry value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.UNION_ENTRY; - value_ = value; - } - - public TUserDefinedTypeEntry getUserDefinedTypeEntry() { - if (getSetField() == _Fields.USER_DEFINED_TYPE_ENTRY) { - return (TUserDefinedTypeEntry)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'userDefinedTypeEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setUserDefinedTypeEntry(TUserDefinedTypeEntry value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.USER_DEFINED_TYPE_ENTRY; - value_ = value; - } - - public boolean isSetPrimitiveEntry() { - return setField_ == _Fields.PRIMITIVE_ENTRY; - } - - - public boolean isSetArrayEntry() { - return setField_ == _Fields.ARRAY_ENTRY; - } - - - public boolean isSetMapEntry() { - return setField_ == _Fields.MAP_ENTRY; - } - - - public boolean isSetStructEntry() { - return setField_ == _Fields.STRUCT_ENTRY; - } - - - public boolean isSetUnionEntry() { - return setField_ == _Fields.UNION_ENTRY; - } - - - public boolean isSetUserDefinedTypeEntry() { - return setField_ == _Fields.USER_DEFINED_TYPE_ENTRY; - } - - - public boolean equals(Object other) { - if (other instanceof TTypeEntry) { - return equals((TTypeEntry)other); - } else { - return false; - } - } - - public boolean equals(TTypeEntry other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TTypeEntry other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - HashCodeBuilder hcb = new HashCodeBuilder(); - hcb.append(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - hcb.append(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - hcb.append(value); - } - } - return hcb.toHashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeId.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeId.java deleted file mode 100644 index 40f05894623c0..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeId.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TTypeId implements org.apache.thrift.TEnum { - BOOLEAN_TYPE(0), - TINYINT_TYPE(1), - SMALLINT_TYPE(2), - INT_TYPE(3), - BIGINT_TYPE(4), - FLOAT_TYPE(5), - DOUBLE_TYPE(6), - STRING_TYPE(7), - TIMESTAMP_TYPE(8), - BINARY_TYPE(9), - ARRAY_TYPE(10), - MAP_TYPE(11), - STRUCT_TYPE(12), - UNION_TYPE(13), - USER_DEFINED_TYPE(14), - DECIMAL_TYPE(15), - NULL_TYPE(16), - DATE_TYPE(17), - VARCHAR_TYPE(18), - CHAR_TYPE(19), - INTERVAL_YEAR_MONTH_TYPE(20), - INTERVAL_DAY_TIME_TYPE(21); - - private final int value; - - private TTypeId(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TTypeId findByValue(int value) { - switch (value) { - case 0: - return BOOLEAN_TYPE; - case 1: - return TINYINT_TYPE; - case 2: - return SMALLINT_TYPE; - case 3: - return INT_TYPE; - case 4: - return BIGINT_TYPE; - case 5: - return FLOAT_TYPE; - case 6: - return DOUBLE_TYPE; - case 7: - return STRING_TYPE; - case 8: - return TIMESTAMP_TYPE; - case 9: - return BINARY_TYPE; - case 10: - return ARRAY_TYPE; - case 11: - return MAP_TYPE; - case 12: - return STRUCT_TYPE; - case 13: - return UNION_TYPE; - case 14: - return USER_DEFINED_TYPE; - case 15: - return DECIMAL_TYPE; - case 16: - return NULL_TYPE; - case 17: - return DATE_TYPE; - case 18: - return VARCHAR_TYPE; - case 19: - return CHAR_TYPE; - case 20: - return INTERVAL_YEAR_MONTH_TYPE; - case 21: - return INTERVAL_DAY_TIME_TYPE; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeQualifierValue.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeQualifierValue.java deleted file mode 100644 index a3e3829372276..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeQualifierValue.java +++ /dev/null @@ -1,361 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TTypeQualifierValue extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifierValue"); - private static final org.apache.thrift.protocol.TField I32_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Value", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)2); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - I32_VALUE((short)1, "i32Value"), - STRING_VALUE((short)2, "stringValue"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // I32_VALUE - return I32_VALUE; - case 2: // STRING_VALUE - return STRING_VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.I32_VALUE, new org.apache.thrift.meta_data.FieldMetaData("i32Value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifierValue.class, metaDataMap); - } - - public TTypeQualifierValue() { - super(); - } - - public TTypeQualifierValue(TTypeQualifierValue._Fields setField, Object value) { - super(setField, value); - } - - public TTypeQualifierValue(TTypeQualifierValue other) { - super(other); - } - public TTypeQualifierValue deepCopy() { - return new TTypeQualifierValue(this); - } - - public static TTypeQualifierValue i32Value(int value) { - TTypeQualifierValue x = new TTypeQualifierValue(); - x.setI32Value(value); - return x; - } - - public static TTypeQualifierValue stringValue(String value) { - TTypeQualifierValue x = new TTypeQualifierValue(); - x.setStringValue(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case I32_VALUE: - if (value instanceof Integer) { - break; - } - throw new ClassCastException("Was expecting value of type Integer for field 'i32Value', but got " + value.getClass().getSimpleName()); - case STRING_VALUE: - if (value instanceof String) { - break; - } - throw new ClassCastException("Was expecting value of type String for field 'stringValue', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case I32_VALUE: - if (field.type == I32_VALUE_FIELD_DESC.type) { - Integer i32Value; - i32Value = iprot.readI32(); - return i32Value; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRING_VALUE: - if (field.type == STRING_VALUE_FIELD_DESC.type) { - String stringValue; - stringValue = iprot.readString(); - return stringValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case I32_VALUE: - Integer i32Value = (Integer)value_; - oprot.writeI32(i32Value); - return; - case STRING_VALUE: - String stringValue = (String)value_; - oprot.writeString(stringValue); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case I32_VALUE: - Integer i32Value; - i32Value = iprot.readI32(); - return i32Value; - case STRING_VALUE: - String stringValue; - stringValue = iprot.readString(); - return stringValue; - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case I32_VALUE: - Integer i32Value = (Integer)value_; - oprot.writeI32(i32Value); - return; - case STRING_VALUE: - String stringValue = (String)value_; - oprot.writeString(stringValue); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case I32_VALUE: - return I32_VALUE_FIELD_DESC; - case STRING_VALUE: - return STRING_VALUE_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public int getI32Value() { - if (getSetField() == _Fields.I32_VALUE) { - return (Integer)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i32Value' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI32Value(int value) { - setField_ = _Fields.I32_VALUE; - value_ = value; - } - - public String getStringValue() { - if (getSetField() == _Fields.STRING_VALUE) { - return (String)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringValue(String value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.STRING_VALUE; - value_ = value; - } - - public boolean isSetI32Value() { - return setField_ == _Fields.I32_VALUE; - } - - - public boolean isSetStringValue() { - return setField_ == _Fields.STRING_VALUE; - } - - - public boolean equals(Object other) { - if (other instanceof TTypeQualifierValue) { - return equals((TTypeQualifierValue)other); - } else { - return false; - } - } - - public boolean equals(TTypeQualifierValue other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TTypeQualifierValue other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - HashCodeBuilder hcb = new HashCodeBuilder(); - hcb.append(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - hcb.append(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - hcb.append(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - hcb.append(value); - } - } - return hcb.toHashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - -} diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeQualifiers.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeQualifiers.java deleted file mode 100644 index 39355551d3722..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TTypeQualifiers.java +++ /dev/null @@ -1,450 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TTypeQualifiers implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifiers"); - - private static final org.apache.thrift.protocol.TField QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("qualifiers", org.apache.thrift.protocol.TType.MAP, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TTypeQualifiersStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TTypeQualifiersTupleSchemeFactory()); - } - - private Map qualifiers; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - QUALIFIERS((short)1, "qualifiers"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // QUALIFIERS - return QUALIFIERS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("qualifiers", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifierValue.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifiers.class, metaDataMap); - } - - public TTypeQualifiers() { - } - - public TTypeQualifiers( - Map qualifiers) - { - this(); - this.qualifiers = qualifiers; - } - - /** - * Performs a deep copy on other. - */ - public TTypeQualifiers(TTypeQualifiers other) { - if (other.isSetQualifiers()) { - Map __this__qualifiers = new HashMap(); - for (Map.Entry other_element : other.qualifiers.entrySet()) { - - String other_element_key = other_element.getKey(); - TTypeQualifierValue other_element_value = other_element.getValue(); - - String __this__qualifiers_copy_key = other_element_key; - - TTypeQualifierValue __this__qualifiers_copy_value = new TTypeQualifierValue(other_element_value); - - __this__qualifiers.put(__this__qualifiers_copy_key, __this__qualifiers_copy_value); - } - this.qualifiers = __this__qualifiers; - } - } - - public TTypeQualifiers deepCopy() { - return new TTypeQualifiers(this); - } - - @Override - public void clear() { - this.qualifiers = null; - } - - public int getQualifiersSize() { - return (this.qualifiers == null) ? 0 : this.qualifiers.size(); - } - - public void putToQualifiers(String key, TTypeQualifierValue val) { - if (this.qualifiers == null) { - this.qualifiers = new HashMap(); - } - this.qualifiers.put(key, val); - } - - public Map getQualifiers() { - return this.qualifiers; - } - - public void setQualifiers(Map qualifiers) { - this.qualifiers = qualifiers; - } - - public void unsetQualifiers() { - this.qualifiers = null; - } - - /** Returns true if field qualifiers is set (has been assigned a value) and false otherwise */ - public boolean isSetQualifiers() { - return this.qualifiers != null; - } - - public void setQualifiersIsSet(boolean value) { - if (!value) { - this.qualifiers = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case QUALIFIERS: - if (value == null) { - unsetQualifiers(); - } else { - setQualifiers((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case QUALIFIERS: - return getQualifiers(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case QUALIFIERS: - return isSetQualifiers(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TTypeQualifiers) - return this.equals((TTypeQualifiers)that); - return false; - } - - public boolean equals(TTypeQualifiers that) { - if (that == null) - return false; - - boolean this_present_qualifiers = true && this.isSetQualifiers(); - boolean that_present_qualifiers = true && that.isSetQualifiers(); - if (this_present_qualifiers || that_present_qualifiers) { - if (!(this_present_qualifiers && that_present_qualifiers)) - return false; - if (!this.qualifiers.equals(that.qualifiers)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_qualifiers = true && (isSetQualifiers()); - builder.append(present_qualifiers); - if (present_qualifiers) - builder.append(qualifiers); - - return builder.toHashCode(); - } - - public int compareTo(TTypeQualifiers other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TTypeQualifiers typedOther = (TTypeQualifiers)other; - - lastComparison = Boolean.valueOf(isSetQualifiers()).compareTo(typedOther.isSetQualifiers()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetQualifiers()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.qualifiers, typedOther.qualifiers); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TTypeQualifiers("); - boolean first = true; - - sb.append("qualifiers:"); - if (this.qualifiers == null) { - sb.append("null"); - } else { - sb.append(this.qualifiers); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetQualifiers()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'qualifiers' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TTypeQualifiersStandardSchemeFactory implements SchemeFactory { - public TTypeQualifiersStandardScheme getScheme() { - return new TTypeQualifiersStandardScheme(); - } - } - - private static class TTypeQualifiersStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeQualifiers struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // QUALIFIERS - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); - struct.qualifiers = new HashMap(2*_map0.size); - for (int _i1 = 0; _i1 < _map0.size; ++_i1) - { - String _key2; // required - TTypeQualifierValue _val3; // required - _key2 = iprot.readString(); - _val3 = new TTypeQualifierValue(); - _val3.read(iprot); - struct.qualifiers.put(_key2, _val3); - } - iprot.readMapEnd(); - } - struct.setQualifiersIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TTypeQualifiers struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.qualifiers != null) { - oprot.writeFieldBegin(QUALIFIERS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.qualifiers.size())); - for (Map.Entry _iter4 : struct.qualifiers.entrySet()) - { - oprot.writeString(_iter4.getKey()); - _iter4.getValue().write(oprot); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TTypeQualifiersTupleSchemeFactory implements SchemeFactory { - public TTypeQualifiersTupleScheme getScheme() { - return new TTypeQualifiersTupleScheme(); - } - } - - private static class TTypeQualifiersTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.qualifiers.size()); - for (Map.Entry _iter5 : struct.qualifiers.entrySet()) - { - oprot.writeString(_iter5.getKey()); - _iter5.getValue().write(oprot); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.qualifiers = new HashMap(2*_map6.size); - for (int _i7 = 0; _i7 < _map6.size; ++_i7) - { - String _key8; // required - TTypeQualifierValue _val9; // required - _key8 = iprot.readString(); - _val9 = new TTypeQualifierValue(); - _val9.read(iprot); - struct.qualifiers.put(_key8, _val9); - } - } - struct.setQualifiersIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TUnionTypeEntry.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TUnionTypeEntry.java deleted file mode 100644 index 73dd45d3dd01a..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TUnionTypeEntry.java +++ /dev/null @@ -1,448 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TUnionTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUnionTypeEntry"); - - private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TUnionTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TUnionTypeEntryTupleSchemeFactory()); - } - - private Map nameToTypePtr; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // NAME_TO_TYPE_PTR - return NAME_TO_TYPE_PTR; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUnionTypeEntry.class, metaDataMap); - } - - public TUnionTypeEntry() { - } - - public TUnionTypeEntry( - Map nameToTypePtr) - { - this(); - this.nameToTypePtr = nameToTypePtr; - } - - /** - * Performs a deep copy on other. - */ - public TUnionTypeEntry(TUnionTypeEntry other) { - if (other.isSetNameToTypePtr()) { - Map __this__nameToTypePtr = new HashMap(); - for (Map.Entry other_element : other.nameToTypePtr.entrySet()) { - - String other_element_key = other_element.getKey(); - Integer other_element_value = other_element.getValue(); - - String __this__nameToTypePtr_copy_key = other_element_key; - - Integer __this__nameToTypePtr_copy_value = other_element_value; - - __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); - } - this.nameToTypePtr = __this__nameToTypePtr; - } - } - - public TUnionTypeEntry deepCopy() { - return new TUnionTypeEntry(this); - } - - @Override - public void clear() { - this.nameToTypePtr = null; - } - - public int getNameToTypePtrSize() { - return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); - } - - public void putToNameToTypePtr(String key, int val) { - if (this.nameToTypePtr == null) { - this.nameToTypePtr = new HashMap(); - } - this.nameToTypePtr.put(key, val); - } - - public Map getNameToTypePtr() { - return this.nameToTypePtr; - } - - public void setNameToTypePtr(Map nameToTypePtr) { - this.nameToTypePtr = nameToTypePtr; - } - - public void unsetNameToTypePtr() { - this.nameToTypePtr = null; - } - - /** Returns true if field nameToTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetNameToTypePtr() { - return this.nameToTypePtr != null; - } - - public void setNameToTypePtrIsSet(boolean value) { - if (!value) { - this.nameToTypePtr = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME_TO_TYPE_PTR: - if (value == null) { - unsetNameToTypePtr(); - } else { - setNameToTypePtr((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME_TO_TYPE_PTR: - return getNameToTypePtr(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case NAME_TO_TYPE_PTR: - return isSetNameToTypePtr(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TUnionTypeEntry) - return this.equals((TUnionTypeEntry)that); - return false; - } - - public boolean equals(TUnionTypeEntry that) { - if (that == null) - return false; - - boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); - boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); - if (this_present_nameToTypePtr || that_present_nameToTypePtr) { - if (!(this_present_nameToTypePtr && that_present_nameToTypePtr)) - return false; - if (!this.nameToTypePtr.equals(that.nameToTypePtr)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_nameToTypePtr = true && (isSetNameToTypePtr()); - builder.append(present_nameToTypePtr); - if (present_nameToTypePtr) - builder.append(nameToTypePtr); - - return builder.toHashCode(); - } - - public int compareTo(TUnionTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TUnionTypeEntry typedOther = (TUnionTypeEntry)other; - - lastComparison = Boolean.valueOf(isSetNameToTypePtr()).compareTo(typedOther.isSetNameToTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNameToTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nameToTypePtr, typedOther.nameToTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TUnionTypeEntry("); - boolean first = true; - - sb.append("nameToTypePtr:"); - if (this.nameToTypePtr == null) { - sb.append("null"); - } else { - sb.append(this.nameToTypePtr); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetNameToTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nameToTypePtr' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TUnionTypeEntryStandardSchemeFactory implements SchemeFactory { - public TUnionTypeEntryStandardScheme getScheme() { - return new TUnionTypeEntryStandardScheme(); - } - } - - private static class TUnionTypeEntryStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // NAME_TO_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin(); - struct.nameToTypePtr = new HashMap(2*_map20.size); - for (int _i21 = 0; _i21 < _map20.size; ++_i21) - { - String _key22; // required - int _val23; // required - _key22 = iprot.readString(); - _val23 = iprot.readI32(); - struct.nameToTypePtr.put(_key22, _val23); - } - iprot.readMapEnd(); - } - struct.setNameToTypePtrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.nameToTypePtr != null) { - oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); - for (Map.Entry _iter24 : struct.nameToTypePtr.entrySet()) - { - oprot.writeString(_iter24.getKey()); - oprot.writeI32(_iter24.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TUnionTypeEntryTupleSchemeFactory implements SchemeFactory { - public TUnionTypeEntryTupleScheme getScheme() { - return new TUnionTypeEntryTupleScheme(); - } - } - - private static class TUnionTypeEntryTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.nameToTypePtr.size()); - for (Map.Entry _iter25 : struct.nameToTypePtr.entrySet()) - { - oprot.writeString(_iter25.getKey()); - oprot.writeI32(_iter25.getValue()); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TMap _map26 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.nameToTypePtr = new HashMap(2*_map26.size); - for (int _i27 = 0; _i27 < _map26.size; ++_i27) - { - String _key28; // required - int _val29; // required - _key28 = iprot.readString(); - _val29 = iprot.readI32(); - struct.nameToTypePtr.put(_key28, _val29); - } - } - struct.setNameToTypePtrIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TUserDefinedTypeEntry.java b/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TUserDefinedTypeEntry.java deleted file mode 100644 index 3a111a2c8c2c6..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/gen/java/org/apache/hive/service/cli/thrift/TUserDefinedTypeEntry.java +++ /dev/null @@ -1,385 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.cli.thrift; - -import org.apache.commons.lang.builder.HashCodeBuilder; -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class TUserDefinedTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUserDefinedTypeEntry"); - - private static final org.apache.thrift.protocol.TField TYPE_CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("typeClassName", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TUserDefinedTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TUserDefinedTypeEntryTupleSchemeFactory()); - } - - private String typeClassName; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - TYPE_CLASS_NAME((short)1, "typeClassName"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // TYPE_CLASS_NAME - return TYPE_CLASS_NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TYPE_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("typeClassName", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUserDefinedTypeEntry.class, metaDataMap); - } - - public TUserDefinedTypeEntry() { - } - - public TUserDefinedTypeEntry( - String typeClassName) - { - this(); - this.typeClassName = typeClassName; - } - - /** - * Performs a deep copy on other. - */ - public TUserDefinedTypeEntry(TUserDefinedTypeEntry other) { - if (other.isSetTypeClassName()) { - this.typeClassName = other.typeClassName; - } - } - - public TUserDefinedTypeEntry deepCopy() { - return new TUserDefinedTypeEntry(this); - } - - @Override - public void clear() { - this.typeClassName = null; - } - - public String getTypeClassName() { - return this.typeClassName; - } - - public void setTypeClassName(String typeClassName) { - this.typeClassName = typeClassName; - } - - public void unsetTypeClassName() { - this.typeClassName = null; - } - - /** Returns true if field typeClassName is set (has been assigned a value) and false otherwise */ - public boolean isSetTypeClassName() { - return this.typeClassName != null; - } - - public void setTypeClassNameIsSet(boolean value) { - if (!value) { - this.typeClassName = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TYPE_CLASS_NAME: - if (value == null) { - unsetTypeClassName(); - } else { - setTypeClassName((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TYPE_CLASS_NAME: - return getTypeClassName(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case TYPE_CLASS_NAME: - return isSetTypeClassName(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TUserDefinedTypeEntry) - return this.equals((TUserDefinedTypeEntry)that); - return false; - } - - public boolean equals(TUserDefinedTypeEntry that) { - if (that == null) - return false; - - boolean this_present_typeClassName = true && this.isSetTypeClassName(); - boolean that_present_typeClassName = true && that.isSetTypeClassName(); - if (this_present_typeClassName || that_present_typeClassName) { - if (!(this_present_typeClassName && that_present_typeClassName)) - return false; - if (!this.typeClassName.equals(that.typeClassName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - HashCodeBuilder builder = new HashCodeBuilder(); - - boolean present_typeClassName = true && (isSetTypeClassName()); - builder.append(present_typeClassName); - if (present_typeClassName) - builder.append(typeClassName); - - return builder.toHashCode(); - } - - public int compareTo(TUserDefinedTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - TUserDefinedTypeEntry typedOther = (TUserDefinedTypeEntry)other; - - lastComparison = Boolean.valueOf(isSetTypeClassName()).compareTo(typedOther.isSetTypeClassName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTypeClassName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeClassName, typedOther.typeClassName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TUserDefinedTypeEntry("); - boolean first = true; - - sb.append("typeClassName:"); - if (this.typeClassName == null) { - sb.append("null"); - } else { - sb.append(this.typeClassName); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetTypeClassName()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeClassName' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TUserDefinedTypeEntryStandardSchemeFactory implements SchemeFactory { - public TUserDefinedTypeEntryStandardScheme getScheme() { - return new TUserDefinedTypeEntryStandardScheme(); - } - } - - private static class TUserDefinedTypeEntryStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // TYPE_CLASS_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.typeClassName = iprot.readString(); - struct.setTypeClassNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.typeClassName != null) { - oprot.writeFieldBegin(TYPE_CLASS_NAME_FIELD_DESC); - oprot.writeString(struct.typeClassName); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TUserDefinedTypeEntryTupleSchemeFactory implements SchemeFactory { - public TUserDefinedTypeEntryTupleScheme getScheme() { - return new TUserDefinedTypeEntryTupleScheme(); - } - } - - private static class TUserDefinedTypeEntryTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeString(struct.typeClassName); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.typeClassName = iprot.readString(); - struct.setTypeClassNameIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/AbstractService.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/AbstractService.java deleted file mode 100644 index 7e557aeccf5b0..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/AbstractService.java +++ /dev/null @@ -1,184 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.conf.HiveConf; - -/** - * AbstractService. - * - */ -public abstract class AbstractService implements Service { - - private static final Log LOG = LogFactory.getLog(AbstractService.class); - - /** - * Service state: initially {@link STATE#NOTINITED}. - */ - private Service.STATE state = STATE.NOTINITED; - - /** - * Service name. - */ - private final String name; - /** - * Service start time. Will be zero until the service is started. - */ - private long startTime; - - /** - * The configuration. Will be null until the service is initialized. - */ - private HiveConf hiveConf; - - /** - * List of state change listeners; it is final to ensure - * that it will never be null. - */ - private final List listeners = - new ArrayList(); - - /** - * Construct the service. - * - * @param name - * service name - */ - public AbstractService(String name) { - this.name = name; - } - - @Override - public synchronized Service.STATE getServiceState() { - return state; - } - - /** - * {@inheritDoc} - * - * @throws IllegalStateException - * if the current service state does not permit - * this action - */ - @Override - public synchronized void init(HiveConf hiveConf) { - ensureCurrentState(STATE.NOTINITED); - this.hiveConf = hiveConf; - changeState(STATE.INITED); - LOG.info("Service:" + getName() + " is inited."); - } - - /** - * {@inheritDoc} - * - * @throws IllegalStateException - * if the current service state does not permit - * this action - */ - @Override - public synchronized void start() { - startTime = System.currentTimeMillis(); - ensureCurrentState(STATE.INITED); - changeState(STATE.STARTED); - LOG.info("Service:" + getName() + " is started."); - } - - /** - * {@inheritDoc} - * - * @throws IllegalStateException - * if the current service state does not permit - * this action - */ - @Override - public synchronized void stop() { - if (state == STATE.STOPPED || - state == STATE.INITED || - state == STATE.NOTINITED) { - // already stopped, or else it was never - // started (eg another service failing canceled startup) - return; - } - ensureCurrentState(STATE.STARTED); - changeState(STATE.STOPPED); - LOG.info("Service:" + getName() + " is stopped."); - } - - @Override - public synchronized void register(ServiceStateChangeListener l) { - listeners.add(l); - } - - @Override - public synchronized void unregister(ServiceStateChangeListener l) { - listeners.remove(l); - } - - @Override - public String getName() { - return name; - } - - @Override - public synchronized HiveConf getHiveConf() { - return hiveConf; - } - - @Override - public long getStartTime() { - return startTime; - } - - /** - * Verify that a service is in a given state. - * - * @param currentState - * the desired state - * @throws IllegalStateException - * if the service state is different from - * the desired state - */ - private void ensureCurrentState(Service.STATE currentState) { - ServiceOperations.ensureCurrentState(state, currentState); - } - - /** - * Change to a new state and notify all listeners. - * This is a private method that is only invoked from synchronized methods, - * which avoid having to clone the listener list. It does imply that - * the state change listener methods should be short lived, as they - * will delay the state transition. - * - * @param newState - * new service state - */ - private void changeState(Service.STATE newState) { - state = newState; - // notify listeners - for (ServiceStateChangeListener l : listeners) { - l.stateChanged(this); - } - } - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/CompositeService.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/CompositeService.java deleted file mode 100644 index 897911872b80f..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/CompositeService.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.List; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.conf.HiveConf; - -/** - * CompositeService. - * - */ -public class CompositeService extends AbstractService { - - private static final Log LOG = LogFactory.getLog(CompositeService.class); - - private final List serviceList = new ArrayList(); - - public CompositeService(String name) { - super(name); - } - - public Collection getServices() { - return Collections.unmodifiableList(serviceList); - } - - protected synchronized void addService(Service service) { - serviceList.add(service); - } - - protected synchronized boolean removeService(Service service) { - return serviceList.remove(service); - } - - @Override - public synchronized void init(HiveConf hiveConf) { - for (Service service : serviceList) { - service.init(hiveConf); - } - super.init(hiveConf); - } - - @Override - public synchronized void start() { - int i = 0; - try { - for (int n = serviceList.size(); i < n; i++) { - Service service = serviceList.get(i); - service.start(); - } - super.start(); - } catch (Throwable e) { - LOG.error("Error starting services " + getName(), e); - // Note that the state of the failed service is still INITED and not - // STARTED. Even though the last service is not started completely, still - // call stop() on all services including failed service to make sure cleanup - // happens. - stop(i); - throw new ServiceException("Failed to Start " + getName(), e); - } - - } - - @Override - public synchronized void stop() { - if (this.getServiceState() == STATE.STOPPED) { - // The base composite-service is already stopped, don't do anything again. - return; - } - if (serviceList.size() > 0) { - stop(serviceList.size() - 1); - } - super.stop(); - } - - private synchronized void stop(int numOfServicesStarted) { - // stop in reserve order of start - for (int i = numOfServicesStarted; i >= 0; i--) { - Service service = serviceList.get(i); - try { - service.stop(); - } catch (Throwable t) { - LOG.info("Error stopping " + service.getName(), t); - } - } - } - - /** - * JVM Shutdown hook for CompositeService which will stop the given - * CompositeService gracefully in case of JVM shutdown. - */ - public static class CompositeServiceShutdownHook implements Runnable { - - private final CompositeService compositeService; - - public CompositeServiceShutdownHook(CompositeService compositeService) { - this.compositeService = compositeService; - } - - @Override - public void run() { - try { - // Stop the Composite Service - compositeService.stop(); - } catch (Throwable t) { - LOG.info("Error stopping " + compositeService.getName(), t); - } - } - } - - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/CookieSigner.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/CookieSigner.java deleted file mode 100644 index f2a80c9d5ffbc..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/CookieSigner.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service; - -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.logging.LogFactory; -import org.apache.commons.logging.Log; - -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; - -/** - * The cookie signer generates a signature based on SHA digest - * and appends it to the cookie value generated at the - * server side. It uses SHA digest algorithm to sign and verify signatures. - */ -public class CookieSigner { - private static final String SIGNATURE = "&s="; - private static final String SHA_STRING = "SHA"; - private byte[] secretBytes; - private static final Log LOG = LogFactory.getLog(CookieSigner.class); - - /** - * Constructor - * @param secret Secret Bytes - */ - public CookieSigner(byte[] secret) { - if (secret == null) { - throw new IllegalArgumentException(" NULL Secret Bytes"); - } - this.secretBytes = secret.clone(); - } - - /** - * Sign the cookie given the string token as input. - * @param str Input token - * @return Signed token that can be used to create a cookie - */ - public String signCookie(String str) { - if (str == null || str.isEmpty()) { - throw new IllegalArgumentException("NULL or empty string to sign"); - } - String signature = getSignature(str); - - if (LOG.isDebugEnabled()) { - LOG.debug("Signature generated for " + str + " is " + signature); - } - return str + SIGNATURE + signature; - } - - /** - * Verify a signed string and extracts the original string. - * @param signedStr The already signed string - * @return Raw Value of the string without the signature - */ - public String verifyAndExtract(String signedStr) { - int index = signedStr.lastIndexOf(SIGNATURE); - if (index == -1) { - throw new IllegalArgumentException("Invalid input sign: " + signedStr); - } - String originalSignature = signedStr.substring(index + SIGNATURE.length()); - String rawValue = signedStr.substring(0, index); - String currentSignature = getSignature(rawValue); - - if (LOG.isDebugEnabled()) { - LOG.debug("Signature generated for " + rawValue + " inside verify is " + currentSignature); - } - if (!MessageDigest.isEqual(originalSignature.getBytes(), currentSignature.getBytes())) { - throw new IllegalArgumentException("Invalid sign, original = " + originalSignature + - " current = " + currentSignature); - } - return rawValue; - } - - /** - * Get the signature of the input string based on SHA digest algorithm. - * @param str Input token - * @return Signed String - */ - private String getSignature(String str) { - try { - MessageDigest md = MessageDigest.getInstance(SHA_STRING); - md.update(str.getBytes()); - md.update(secretBytes); - byte[] digest = md.digest(); - return new Base64(0).encodeToString(digest); - } catch (NoSuchAlgorithmException ex) { - throw new RuntimeException("Invalid SHA digest String: " + SHA_STRING + - " " + ex.getMessage(), ex); - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/ServiceOperations.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/ServiceOperations.java deleted file mode 100644 index f16863c1b41aa..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/ServiceOperations.java +++ /dev/null @@ -1,141 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.conf.HiveConf; - -/** - * ServiceOperations. - * - */ -public final class ServiceOperations { - private static final Log LOG = LogFactory.getLog(ServiceOperations.class); - - private ServiceOperations() { - } - - /** - * Verify that a service is in a given state. - * @param state the actual state a service is in - * @param expectedState the desired state - * @throws IllegalStateException if the service state is different from - * the desired state - */ - public static void ensureCurrentState(Service.STATE state, - Service.STATE expectedState) { - if (state != expectedState) { - throw new IllegalStateException("For this operation, the " + - "current service state must be " - + expectedState - + " instead of " + state); - } - } - - /** - * Initialize a service. - * - * The service state is checked before the operation begins. - * This process is not thread safe. - * @param service a service that must be in the state - * {@link Service.STATE#NOTINITED} - * @param configuration the configuration to initialize the service with - * @throws RuntimeException on a state change failure - * @throws IllegalStateException if the service is in the wrong state - */ - - public static void init(Service service, HiveConf configuration) { - Service.STATE state = service.getServiceState(); - ensureCurrentState(state, Service.STATE.NOTINITED); - service.init(configuration); - } - - /** - * Start a service. - * - * The service state is checked before the operation begins. - * This process is not thread safe. - * @param service a service that must be in the state - * {@link Service.STATE#INITED} - * @throws RuntimeException on a state change failure - * @throws IllegalStateException if the service is in the wrong state - */ - - public static void start(Service service) { - Service.STATE state = service.getServiceState(); - ensureCurrentState(state, Service.STATE.INITED); - service.start(); - } - - /** - * Initialize then start a service. - * - * The service state is checked before the operation begins. - * This process is not thread safe. - * @param service a service that must be in the state - * {@link Service.STATE#NOTINITED} - * @param configuration the configuration to initialize the service with - * @throws RuntimeException on a state change failure - * @throws IllegalStateException if the service is in the wrong state - */ - public static void deploy(Service service, HiveConf configuration) { - init(service, configuration); - start(service); - } - - /** - * Stop a service. - * - * Do nothing if the service is null or not in a state in which it can be/needs to be stopped. - * - * The service state is checked before the operation begins. - * This process is not thread safe. - * @param service a service or null - */ - public static void stop(Service service) { - if (service != null) { - Service.STATE state = service.getServiceState(); - if (state == Service.STATE.STARTED) { - service.stop(); - } - } - } - - /** - * Stop a service; if it is null do nothing. Exceptions are caught and - * logged at warn level. (but not Throwables). This operation is intended to - * be used in cleanup operations - * - * @param service a service; may be null - * @return any exception that was caught; null if none was. - */ - public static Exception stopQuietly(Service service) { - try { - stop(service); - } catch (Exception e) { - LOG.warn("When stopping the service " + service.getName() - + " : " + e, - e); - return e; - } - return null; - } - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/ServiceUtils.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/ServiceUtils.java deleted file mode 100644 index edb5eff9615bf..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/ServiceUtils.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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. - */ -package org.apache.hive.service; - -public class ServiceUtils { - - /* - * Get the index separating the user name from domain name (the user's name up - * to the first '/' or '@'). - * - * @param userName full user name. - * @return index of domain match or -1 if not found - */ - public static int indexOfDomainMatch(String userName) { - if (userName == null) { - return -1; - } - - int idx = userName.indexOf('/'); - int idx2 = userName.indexOf('@'); - int endIdx = Math.min(idx, idx2); // Use the earlier match. - // Unless at least one of '/' or '@' was not found, in - // which case, user the latter match. - if (endIdx == -1) { - endIdx = Math.max(idx, idx2); - } - return endIdx; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java deleted file mode 100644 index 10000f12ab329..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/HiveAuthFactory.java +++ /dev/null @@ -1,419 +0,0 @@ -/** - * 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. - */ -package org.apache.hive.service.auth; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.net.InetSocketAddress; -import java.net.UnknownHostException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Objects; - -import javax.net.ssl.SSLServerSocket; -import javax.security.auth.login.LoginException; -import javax.security.sasl.Sasl; - -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hadoop.hive.metastore.HiveMetaStore; -import org.apache.hadoop.hive.metastore.HiveMetaStore.HMSHandler; -import org.apache.hadoop.hive.metastore.api.MetaException; -import org.apache.hadoop.hive.shims.HadoopShims.KerberosNameShim; -import org.apache.hadoop.hive.shims.ShimLoader; -import org.apache.hadoop.hive.thrift.DBTokenStore; -import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge; -import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge.Server.ServerMode; -import org.apache.hadoop.security.SecurityUtil; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hadoop.security.authorize.ProxyUsers; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.thrift.ThriftCLIService; -import org.apache.thrift.TProcessorFactory; -import org.apache.thrift.transport.TSSLTransportFactory; -import org.apache.thrift.transport.TServerSocket; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.transport.TTransport; -import org.apache.thrift.transport.TTransportException; -import org.apache.thrift.transport.TTransportFactory; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class helps in some aspects of authentication. It creates the proper Thrift classes for the - * given configuration as well as helps with authenticating requests. - */ -public class HiveAuthFactory { - private static final Logger LOG = LoggerFactory.getLogger(HiveAuthFactory.class); - - - public enum AuthTypes { - NOSASL("NOSASL"), - NONE("NONE"), - LDAP("LDAP"), - KERBEROS("KERBEROS"), - CUSTOM("CUSTOM"), - PAM("PAM"); - - private final String authType; - - AuthTypes(String authType) { - this.authType = authType; - } - - public String getAuthName() { - return authType; - } - - } - - private HadoopThriftAuthBridge.Server saslServer; - private String authTypeStr; - private final String transportMode; - private final HiveConf conf; - - public static final String HS2_PROXY_USER = "hive.server2.proxy.user"; - public static final String HS2_CLIENT_TOKEN = "hiveserver2ClientToken"; - - private static Field keytabFile = null; - private static Method getKeytab = null; - static { - Class clz = UserGroupInformation.class; - try { - keytabFile = clz.getDeclaredField("keytabFile"); - keytabFile.setAccessible(true); - } catch (NoSuchFieldException nfe) { - LOG.debug("Cannot find private field \"keytabFile\" in class: " + - UserGroupInformation.class.getCanonicalName(), nfe); - keytabFile = null; - } - - try { - getKeytab = clz.getDeclaredMethod("getKeytab"); - getKeytab.setAccessible(true); - } catch(NoSuchMethodException nme) { - LOG.debug("Cannot find private method \"getKeytab\" in class:" + - UserGroupInformation.class.getCanonicalName(), nme); - getKeytab = null; - } - } - - public HiveAuthFactory(HiveConf conf) throws TTransportException, IOException { - this.conf = conf; - transportMode = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_TRANSPORT_MODE); - authTypeStr = conf.getVar(HiveConf.ConfVars.HIVE_SERVER2_AUTHENTICATION); - - // In http mode we use NOSASL as the default auth type - if ("http".equalsIgnoreCase(transportMode)) { - if (authTypeStr == null) { - authTypeStr = AuthTypes.NOSASL.getAuthName(); - } - } else { - if (authTypeStr == null) { - authTypeStr = AuthTypes.NONE.getAuthName(); - } - if (authTypeStr.equalsIgnoreCase(AuthTypes.KERBEROS.getAuthName())) { - String principal = conf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL); - String keytab = conf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB); - if (needUgiLogin(UserGroupInformation.getCurrentUser(), - SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keytab)) { - saslServer = ShimLoader.getHadoopThriftAuthBridge().createServer(principal, keytab); - } else { - // Using the default constructor to avoid unnecessary UGI login. - saslServer = new HadoopThriftAuthBridge.Server(); - } - - // start delegation token manager - try { - // rawStore is only necessary for DBTokenStore - Object rawStore = null; - String tokenStoreClass = conf.getVar(HiveConf.ConfVars.METASTORE_CLUSTER_DELEGATION_TOKEN_STORE_CLS); - - if (tokenStoreClass.equals(DBTokenStore.class.getName())) { - HMSHandler baseHandler = new HiveMetaStore.HMSHandler( - "new db based metaserver", conf, true); - rawStore = baseHandler.getMS(); - } - - saslServer.startDelegationTokenSecretManager(conf, rawStore, ServerMode.HIVESERVER2); - } - catch (MetaException|IOException e) { - throw new TTransportException("Failed to start token manager", e); - } - } - } - } - - public Map getSaslProperties() { - Map saslProps = new HashMap(); - SaslQOP saslQOP = SaslQOP.fromString(conf.getVar(ConfVars.HIVE_SERVER2_THRIFT_SASL_QOP)); - saslProps.put(Sasl.QOP, saslQOP.toString()); - saslProps.put(Sasl.SERVER_AUTH, "true"); - return saslProps; - } - - public TTransportFactory getAuthTransFactory() throws LoginException { - TTransportFactory transportFactory; - if (authTypeStr.equalsIgnoreCase(AuthTypes.KERBEROS.getAuthName())) { - try { - transportFactory = saslServer.createTransportFactory(getSaslProperties()); - } catch (TTransportException e) { - throw new LoginException(e.getMessage()); - } - } else if (authTypeStr.equalsIgnoreCase(AuthTypes.NONE.getAuthName())) { - transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr); - } else if (authTypeStr.equalsIgnoreCase(AuthTypes.LDAP.getAuthName())) { - transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr); - } else if (authTypeStr.equalsIgnoreCase(AuthTypes.PAM.getAuthName())) { - transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr); - } else if (authTypeStr.equalsIgnoreCase(AuthTypes.NOSASL.getAuthName())) { - transportFactory = new TTransportFactory(); - } else if (authTypeStr.equalsIgnoreCase(AuthTypes.CUSTOM.getAuthName())) { - transportFactory = PlainSaslHelper.getPlainTransportFactory(authTypeStr); - } else { - throw new LoginException("Unsupported authentication type " + authTypeStr); - } - return transportFactory; - } - - /** - * Returns the thrift processor factory for HiveServer2 running in binary mode - * @param service - * @return - * @throws LoginException - */ - public TProcessorFactory getAuthProcFactory(ThriftCLIService service) throws LoginException { - if (authTypeStr.equalsIgnoreCase(AuthTypes.KERBEROS.getAuthName())) { - return KerberosSaslHelper.getKerberosProcessorFactory(saslServer, service); - } else { - return PlainSaslHelper.getPlainProcessorFactory(service); - } - } - - public String getRemoteUser() { - return saslServer == null ? null : saslServer.getRemoteUser(); - } - - public String getIpAddress() { - if (saslServer == null || saslServer.getRemoteAddress() == null) { - return null; - } else { - return saslServer.getRemoteAddress().getHostAddress(); - } - } - - // Perform kerberos login using the hadoop shim API if the configuration is available - public static void loginFromKeytab(HiveConf hiveConf) throws IOException { - String principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL); - String keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB); - if (principal.isEmpty() || keyTabFile.isEmpty()) { - throw new IOException("HiveServer2 Kerberos principal or keytab is not correctly configured"); - } else { - UserGroupInformation.loginUserFromKeytab(SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keyTabFile); - } - } - - // Perform SPNEGO login using the hadoop shim API if the configuration is available - public static UserGroupInformation loginFromSpnegoKeytabAndReturnUGI(HiveConf hiveConf) - throws IOException { - String principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_PRINCIPAL); - String keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_KEYTAB); - if (principal.isEmpty() || keyTabFile.isEmpty()) { - throw new IOException("HiveServer2 SPNEGO principal or keytab is not correctly configured"); - } else { - return UserGroupInformation.loginUserFromKeytabAndReturnUGI(SecurityUtil.getServerPrincipal(principal, "0.0.0.0"), keyTabFile); - } - } - - public static TTransport getSocketTransport(String host, int port, int loginTimeout) { - return new TSocket(host, port, loginTimeout); - } - - public static TTransport getSSLSocket(String host, int port, int loginTimeout) - throws TTransportException { - return TSSLTransportFactory.getClientSocket(host, port, loginTimeout); - } - - public static TTransport getSSLSocket(String host, int port, int loginTimeout, - String trustStorePath, String trustStorePassWord) throws TTransportException { - TSSLTransportFactory.TSSLTransportParameters params = - new TSSLTransportFactory.TSSLTransportParameters(); - params.setTrustStore(trustStorePath, trustStorePassWord); - params.requireClientAuth(true); - return TSSLTransportFactory.getClientSocket(host, port, loginTimeout, params); - } - - public static TServerSocket getServerSocket(String hiveHost, int portNum) - throws TTransportException { - InetSocketAddress serverAddress; - if (hiveHost == null || hiveHost.isEmpty()) { - // Wildcard bind - serverAddress = new InetSocketAddress(portNum); - } else { - serverAddress = new InetSocketAddress(hiveHost, portNum); - } - return new TServerSocket(serverAddress); - } - - public static TServerSocket getServerSSLSocket(String hiveHost, int portNum, String keyStorePath, - String keyStorePassWord, List sslVersionBlacklist) throws TTransportException, - UnknownHostException { - TSSLTransportFactory.TSSLTransportParameters params = - new TSSLTransportFactory.TSSLTransportParameters(); - params.setKeyStore(keyStorePath, keyStorePassWord); - InetSocketAddress serverAddress; - if (hiveHost == null || hiveHost.isEmpty()) { - // Wildcard bind - serverAddress = new InetSocketAddress(portNum); - } else { - serverAddress = new InetSocketAddress(hiveHost, portNum); - } - TServerSocket thriftServerSocket = - TSSLTransportFactory.getServerSocket(portNum, 0, serverAddress.getAddress(), params); - if (thriftServerSocket.getServerSocket() instanceof SSLServerSocket) { - List sslVersionBlacklistLocal = new ArrayList(); - for (String sslVersion : sslVersionBlacklist) { - sslVersionBlacklistLocal.add(sslVersion.trim().toLowerCase(Locale.ROOT)); - } - SSLServerSocket sslServerSocket = (SSLServerSocket) thriftServerSocket.getServerSocket(); - List enabledProtocols = new ArrayList(); - for (String protocol : sslServerSocket.getEnabledProtocols()) { - if (sslVersionBlacklistLocal.contains(protocol.toLowerCase(Locale.ROOT))) { - LOG.debug("Disabling SSL Protocol: " + protocol); - } else { - enabledProtocols.add(protocol); - } - } - sslServerSocket.setEnabledProtocols(enabledProtocols.toArray(new String[0])); - LOG.info("SSL Server Socket Enabled Protocols: " - + Arrays.toString(sslServerSocket.getEnabledProtocols())); - } - return thriftServerSocket; - } - - // retrieve delegation token for the given user - public String getDelegationToken(String owner, String renewer) throws HiveSQLException { - if (saslServer == null) { - throw new HiveSQLException( - "Delegation token only supported over kerberos authentication", "08S01"); - } - - try { - String tokenStr = saslServer.getDelegationTokenWithService(owner, renewer, HS2_CLIENT_TOKEN); - if (tokenStr == null || tokenStr.isEmpty()) { - throw new HiveSQLException( - "Received empty retrieving delegation token for user " + owner, "08S01"); - } - return tokenStr; - } catch (IOException e) { - throw new HiveSQLException( - "Error retrieving delegation token for user " + owner, "08S01", e); - } catch (InterruptedException e) { - throw new HiveSQLException("delegation token retrieval interrupted", "08S01", e); - } - } - - // cancel given delegation token - public void cancelDelegationToken(String delegationToken) throws HiveSQLException { - if (saslServer == null) { - throw new HiveSQLException( - "Delegation token only supported over kerberos authentication", "08S01"); - } - try { - saslServer.cancelDelegationToken(delegationToken); - } catch (IOException e) { - throw new HiveSQLException( - "Error canceling delegation token " + delegationToken, "08S01", e); - } - } - - public void renewDelegationToken(String delegationToken) throws HiveSQLException { - if (saslServer == null) { - throw new HiveSQLException( - "Delegation token only supported over kerberos authentication", "08S01"); - } - try { - saslServer.renewDelegationToken(delegationToken); - } catch (IOException e) { - throw new HiveSQLException( - "Error renewing delegation token " + delegationToken, "08S01", e); - } - } - - public String getUserFromToken(String delegationToken) throws HiveSQLException { - if (saslServer == null) { - throw new HiveSQLException( - "Delegation token only supported over kerberos authentication", "08S01"); - } - try { - return saslServer.getUserFromToken(delegationToken); - } catch (IOException e) { - throw new HiveSQLException( - "Error extracting user from delegation token " + delegationToken, "08S01", e); - } - } - - public static void verifyProxyAccess(String realUser, String proxyUser, String ipAddress, - HiveConf hiveConf) throws HiveSQLException { - try { - UserGroupInformation sessionUgi; - if (UserGroupInformation.isSecurityEnabled()) { - KerberosNameShim kerbName = ShimLoader.getHadoopShims().getKerberosNameShim(realUser); - sessionUgi = UserGroupInformation.createProxyUser( - kerbName.getServiceName(), UserGroupInformation.getLoginUser()); - } else { - sessionUgi = UserGroupInformation.createRemoteUser(realUser); - } - if (!proxyUser.equalsIgnoreCase(realUser)) { - ProxyUsers.refreshSuperUserGroupsConfiguration(hiveConf); - ProxyUsers.authorize(UserGroupInformation.createProxyUser(proxyUser, sessionUgi), - ipAddress, hiveConf); - } - } catch (IOException e) { - throw new HiveSQLException( - "Failed to validate proxy privilege of " + realUser + " for " + proxyUser, "08S01", e); - } - } - - public static boolean needUgiLogin(UserGroupInformation ugi, String principal, String keytab) { - return null == ugi || !ugi.hasKerberosCredentials() || !ugi.getUserName().equals(principal) || - !Objects.equals(keytab, getKeytabFromUgi()); - } - - private static String getKeytabFromUgi() { - synchronized (UserGroupInformation.class) { - try { - if (keytabFile != null) { - return (String) keytabFile.get(null); - } else if (getKeytab != null) { - return (String) getKeytab.invoke(UserGroupInformation.getCurrentUser()); - } else { - return null; - } - } catch (Exception e) { - LOG.debug("Fail to get keytabFile path via reflection", e); - return null; - } - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/HttpAuthUtils.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/HttpAuthUtils.java deleted file mode 100644 index f7375ee707830..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/HttpAuthUtils.java +++ /dev/null @@ -1,189 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.auth; - -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.PrivilegedExceptionAction; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Random; -import java.util.Set; -import java.util.StringTokenizer; - -import javax.security.auth.Subject; - -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.shims.ShimLoader; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.http.protocol.BasicHttpContext; -import org.apache.http.protocol.HttpContext; -import org.ietf.jgss.GSSContext; -import org.ietf.jgss.GSSManager; -import org.ietf.jgss.GSSName; -import org.ietf.jgss.Oid; - -/** - * Utility functions for HTTP mode authentication. - */ -public final class HttpAuthUtils { - public static final String WWW_AUTHENTICATE = "WWW-Authenticate"; - public static final String AUTHORIZATION = "Authorization"; - public static final String BASIC = "Basic"; - public static final String NEGOTIATE = "Negotiate"; - private static final Log LOG = LogFactory.getLog(HttpAuthUtils.class); - private static final String COOKIE_ATTR_SEPARATOR = "&"; - private static final String COOKIE_CLIENT_USER_NAME = "cu"; - private static final String COOKIE_CLIENT_RAND_NUMBER = "rn"; - private static final String COOKIE_KEY_VALUE_SEPARATOR = "="; - private static final Set COOKIE_ATTRIBUTES = - new HashSet(Arrays.asList(COOKIE_CLIENT_USER_NAME, COOKIE_CLIENT_RAND_NUMBER)); - - /** - * @return Stringified Base64 encoded kerberosAuthHeader on success - * @throws Exception - */ - public static String getKerberosServiceTicket(String principal, String host, - String serverHttpUrl, boolean assumeSubject) throws Exception { - String serverPrincipal = - ShimLoader.getHadoopThriftAuthBridge().getServerPrincipal(principal, host); - if (assumeSubject) { - // With this option, we're assuming that the external application, - // using the JDBC driver has done a JAAS kerberos login already - AccessControlContext context = AccessController.getContext(); - Subject subject = Subject.getSubject(context); - if (subject == null) { - throw new Exception("The Subject is not set"); - } - return Subject.doAs(subject, new HttpKerberosClientAction(serverPrincipal, serverHttpUrl)); - } else { - // JAAS login from ticket cache to setup the client UserGroupInformation - UserGroupInformation clientUGI = - ShimLoader.getHadoopThriftAuthBridge().getCurrentUGIWithConf("kerberos"); - return clientUGI.doAs(new HttpKerberosClientAction(serverPrincipal, serverHttpUrl)); - } - } - - /** - * Creates and returns a HS2 cookie token. - * @param clientUserName Client User name. - * @return An unsigned cookie token generated from input parameters. - * The final cookie generated is of the following format : - * {@code cu=&rn=&s=} - */ - public static String createCookieToken(String clientUserName) { - StringBuffer sb = new StringBuffer(); - sb.append(COOKIE_CLIENT_USER_NAME).append(COOKIE_KEY_VALUE_SEPARATOR).append(clientUserName) - .append(COOKIE_ATTR_SEPARATOR); - sb.append(COOKIE_CLIENT_RAND_NUMBER).append(COOKIE_KEY_VALUE_SEPARATOR) - .append((new Random(System.currentTimeMillis())).nextLong()); - return sb.toString(); - } - - /** - * Parses a cookie token to retrieve client user name. - * @param tokenStr Token String. - * @return A valid user name if input is of valid format, else returns null. - */ - public static String getUserNameFromCookieToken(String tokenStr) { - Map map = splitCookieToken(tokenStr); - - if (!map.keySet().equals(COOKIE_ATTRIBUTES)) { - LOG.error("Invalid token with missing attributes " + tokenStr); - return null; - } - return map.get(COOKIE_CLIENT_USER_NAME); - } - - /** - * Splits the cookie token into attributes pairs. - * @param str input token. - * @return a map with the attribute pairs of the token if the input is valid. - * Else, returns null. - */ - private static Map splitCookieToken(String tokenStr) { - Map map = new HashMap(); - StringTokenizer st = new StringTokenizer(tokenStr, COOKIE_ATTR_SEPARATOR); - - while (st.hasMoreTokens()) { - String part = st.nextToken(); - int separator = part.indexOf(COOKIE_KEY_VALUE_SEPARATOR); - if (separator == -1) { - LOG.error("Invalid token string " + tokenStr); - return null; - } - String key = part.substring(0, separator); - String value = part.substring(separator + 1); - map.put(key, value); - } - return map; - } - - - private HttpAuthUtils() { - throw new UnsupportedOperationException("Can't initialize class"); - } - - /** - * We'll create an instance of this class within a doAs block so that the client's TGT credentials - * can be read from the Subject - */ - public static class HttpKerberosClientAction implements PrivilegedExceptionAction { - public static final String HTTP_RESPONSE = "HTTP_RESPONSE"; - public static final String SERVER_HTTP_URL = "SERVER_HTTP_URL"; - private final String serverPrincipal; - private final String serverHttpUrl; - private final Base64 base64codec; - private final HttpContext httpContext; - - public HttpKerberosClientAction(String serverPrincipal, String serverHttpUrl) { - this.serverPrincipal = serverPrincipal; - this.serverHttpUrl = serverHttpUrl; - base64codec = new Base64(0); - httpContext = new BasicHttpContext(); - httpContext.setAttribute(SERVER_HTTP_URL, serverHttpUrl); - } - - @Override - public String run() throws Exception { - // This Oid for Kerberos GSS-API mechanism. - Oid mechOid = new Oid("1.2.840.113554.1.2.2"); - // Oid for kerberos principal name - Oid krb5PrincipalOid = new Oid("1.2.840.113554.1.2.2.1"); - GSSManager manager = GSSManager.getInstance(); - // GSS name for server - GSSName serverName = manager.createName(serverPrincipal, krb5PrincipalOid); - // Create a GSSContext for authentication with the service. - // We're passing client credentials as null since we want them to be read from the Subject. - GSSContext gssContext = - manager.createContext(serverName, mechOid, null, GSSContext.DEFAULT_LIFETIME); - gssContext.requestMutualAuth(false); - // Establish context - byte[] inToken = new byte[0]; - byte[] outToken = gssContext.initSecContext(inToken, 0, inToken.length); - gssContext.dispose(); - // Base64 encoded and stringified token for server - return new String(base64codec.encode(outToken)); - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/KerberosSaslHelper.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/KerberosSaslHelper.java deleted file mode 100644 index 52eb752f1e026..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/KerberosSaslHelper.java +++ /dev/null @@ -1,111 +0,0 @@ -/** - * 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. - */ -package org.apache.hive.service.auth; - -import java.io.IOException; -import java.util.Map; -import javax.security.sasl.SaslException; - -import org.apache.hadoop.hive.shims.ShimLoader; -import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge; -import org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge.Server; -import org.apache.hive.service.cli.thrift.TCLIService; -import org.apache.hive.service.cli.thrift.TCLIService.Iface; -import org.apache.hive.service.cli.thrift.ThriftCLIService; -import org.apache.thrift.TProcessor; -import org.apache.thrift.TProcessorFactory; -import org.apache.thrift.transport.TSaslClientTransport; -import org.apache.thrift.transport.TTransport; - -public final class KerberosSaslHelper { - - public static TProcessorFactory getKerberosProcessorFactory(Server saslServer, - ThriftCLIService service) { - return new CLIServiceProcessorFactory(saslServer, service); - } - - public static TTransport getKerberosTransport(String principal, String host, - TTransport underlyingTransport, Map saslProps, boolean assumeSubject) - throws SaslException { - try { - String[] names = principal.split("[/@]"); - if (names.length != 3) { - throw new IllegalArgumentException("Kerberos principal should have 3 parts: " + principal); - } - - if (assumeSubject) { - return createSubjectAssumedTransport(principal, underlyingTransport, saslProps); - } else { - HadoopThriftAuthBridge.Client authBridge = - ShimLoader.getHadoopThriftAuthBridge().createClientWithConf("kerberos"); - return authBridge.createClientTransport(principal, host, "KERBEROS", null, - underlyingTransport, saslProps); - } - } catch (IOException e) { - throw new SaslException("Failed to open client transport", e); - } - } - - public static TTransport createSubjectAssumedTransport(String principal, - TTransport underlyingTransport, Map saslProps) throws IOException { - String[] names = principal.split("[/@]"); - try { - TTransport saslTransport = - new TSaslClientTransport("GSSAPI", null, names[0], names[1], saslProps, null, - underlyingTransport); - return new TSubjectAssumingTransport(saslTransport); - } catch (SaslException se) { - throw new IOException("Could not instantiate SASL transport", se); - } - } - - public static TTransport getTokenTransport(String tokenStr, String host, - TTransport underlyingTransport, Map saslProps) throws SaslException { - HadoopThriftAuthBridge.Client authBridge = - ShimLoader.getHadoopThriftAuthBridge().createClientWithConf("kerberos"); - - try { - return authBridge.createClientTransport(null, host, "DIGEST", tokenStr, underlyingTransport, - saslProps); - } catch (IOException e) { - throw new SaslException("Failed to open client transport", e); - } - } - - private KerberosSaslHelper() { - throw new UnsupportedOperationException("Can't initialize class"); - } - - private static class CLIServiceProcessorFactory extends TProcessorFactory { - - private final ThriftCLIService service; - private final Server saslServer; - - CLIServiceProcessorFactory(Server saslServer, ThriftCLIService service) { - super(null); - this.service = service; - this.saslServer = saslServer; - } - - @Override - public TProcessor getProcessor(TTransport trans) { - TProcessor sqlProcessor = new TCLIService.Processor(service); - return saslServer.wrapNonAssumingProcessor(sqlProcessor); - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java deleted file mode 100644 index afc144199f1e8..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/PlainSaslHelper.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * 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. - */ -package org.apache.hive.service.auth; - -import java.io.IOException; -import java.security.Security; -import java.util.HashMap; -import javax.security.auth.callback.Callback; -import javax.security.auth.callback.CallbackHandler; -import javax.security.auth.callback.NameCallback; -import javax.security.auth.callback.PasswordCallback; -import javax.security.auth.callback.UnsupportedCallbackException; -import javax.security.auth.login.LoginException; -import javax.security.sasl.AuthenticationException; -import javax.security.sasl.AuthorizeCallback; -import javax.security.sasl.SaslException; - -import org.apache.hive.service.auth.AuthenticationProviderFactory.AuthMethods; -import org.apache.hive.service.auth.PlainSaslServer.SaslPlainProvider; -import org.apache.hive.service.cli.thrift.TCLIService.Iface; -import org.apache.hive.service.cli.thrift.ThriftCLIService; -import org.apache.thrift.TProcessor; -import org.apache.thrift.TProcessorFactory; -import org.apache.thrift.transport.TSaslClientTransport; -import org.apache.thrift.transport.TSaslServerTransport; -import org.apache.thrift.transport.TTransport; -import org.apache.thrift.transport.TTransportFactory; - -public final class PlainSaslHelper { - - public static TProcessorFactory getPlainProcessorFactory(ThriftCLIService service) { - return new SQLPlainProcessorFactory(service); - } - - // Register Plain SASL server provider - static { - Security.addProvider(new SaslPlainProvider()); - } - - public static TTransportFactory getPlainTransportFactory(String authTypeStr) - throws LoginException { - TSaslServerTransport.Factory saslFactory = new TSaslServerTransport.Factory(); - try { - saslFactory.addServerDefinition("PLAIN", authTypeStr, null, new HashMap(), - new PlainServerCallbackHandler(authTypeStr)); - } catch (AuthenticationException e) { - throw new LoginException("Error setting callback handler" + e); - } - return saslFactory; - } - - public static TTransport getPlainTransport(String username, String password, - TTransport underlyingTransport) throws SaslException { - return new TSaslClientTransport("PLAIN", null, null, null, new HashMap(), - new PlainCallbackHandler(username, password), underlyingTransport); - } - - private PlainSaslHelper() { - throw new UnsupportedOperationException("Can't initialize class"); - } - - private static final class PlainServerCallbackHandler implements CallbackHandler { - - private final AuthMethods authMethod; - - PlainServerCallbackHandler(String authMethodStr) throws AuthenticationException { - authMethod = AuthMethods.getValidAuthMethod(authMethodStr); - } - - @Override - public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { - String username = null; - String password = null; - AuthorizeCallback ac = null; - - for (Callback callback : callbacks) { - if (callback instanceof NameCallback) { - NameCallback nc = (NameCallback) callback; - username = nc.getName(); - } else if (callback instanceof PasswordCallback) { - PasswordCallback pc = (PasswordCallback) callback; - password = new String(pc.getPassword()); - } else if (callback instanceof AuthorizeCallback) { - ac = (AuthorizeCallback) callback; - } else { - throw new UnsupportedCallbackException(callback); - } - } - PasswdAuthenticationProvider provider = - AuthenticationProviderFactory.getAuthenticationProvider(authMethod); - provider.Authenticate(username, password); - if (ac != null) { - ac.setAuthorized(true); - } - } - } - - public static class PlainCallbackHandler implements CallbackHandler { - - private final String username; - private final String password; - - public PlainCallbackHandler(String username, String password) { - this.username = username; - this.password = password; - } - - @Override - public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { - for (Callback callback : callbacks) { - if (callback instanceof NameCallback) { - NameCallback nameCallback = (NameCallback) callback; - nameCallback.setName(username); - } else if (callback instanceof PasswordCallback) { - PasswordCallback passCallback = (PasswordCallback) callback; - passCallback.setPassword(password.toCharArray()); - } else { - throw new UnsupportedCallbackException(callback); - } - } - } - } - - private static final class SQLPlainProcessorFactory extends TProcessorFactory { - - private final ThriftCLIService service; - - SQLPlainProcessorFactory(ThriftCLIService service) { - super(null); - this.service = service; - } - - @Override - public TProcessor getProcessor(TTransport trans) { - return new TSetIpAddressProcessor(service); - } - } - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java deleted file mode 100644 index 9a61ad49942c8..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/auth/TSetIpAddressProcessor.java +++ /dev/null @@ -1,114 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.auth; - -import org.apache.hive.service.cli.thrift.TCLIService; -import org.apache.hive.service.cli.thrift.TCLIService.Iface; -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.transport.TSaslClientTransport; -import org.apache.thrift.transport.TSaslServerTransport; -import org.apache.thrift.transport.TSocket; -import org.apache.thrift.transport.TTransport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This class is responsible for setting the ipAddress for operations executed via HiveServer2. - * - * - IP address is only set for operations that calls listeners with hookContext - * - IP address is only set if the underlying transport mechanism is socket - * - * @see org.apache.hadoop.hive.ql.hooks.ExecuteWithHookContext - */ -public class TSetIpAddressProcessor extends TCLIService.Processor { - - private static final Logger LOGGER = LoggerFactory.getLogger(TSetIpAddressProcessor.class.getName()); - - public TSetIpAddressProcessor(Iface iface) { - super(iface); - } - - @Override - public boolean process(final TProtocol in, final TProtocol out) throws TException { - setIpAddress(in); - setUserName(in); - try { - return super.process(in, out); - } finally { - THREAD_LOCAL_USER_NAME.remove(); - THREAD_LOCAL_IP_ADDRESS.remove(); - } - } - - private void setUserName(final TProtocol in) { - TTransport transport = in.getTransport(); - if (transport instanceof TSaslServerTransport) { - String userName = ((TSaslServerTransport) transport).getSaslServer().getAuthorizationID(); - THREAD_LOCAL_USER_NAME.set(userName); - } - } - - protected void setIpAddress(final TProtocol in) { - TTransport transport = in.getTransport(); - TSocket tSocket = getUnderlyingSocketFromTransport(transport); - if (tSocket == null) { - LOGGER.warn("Unknown Transport, cannot determine ipAddress"); - } else { - THREAD_LOCAL_IP_ADDRESS.set(tSocket.getSocket().getInetAddress().getHostAddress()); - } - } - - private TSocket getUnderlyingSocketFromTransport(TTransport transport) { - while (transport != null) { - if (transport instanceof TSaslServerTransport) { - transport = ((TSaslServerTransport) transport).getUnderlyingTransport(); - } - if (transport instanceof TSaslClientTransport) { - transport = ((TSaslClientTransport) transport).getUnderlyingTransport(); - } - if (transport instanceof TSocket) { - return (TSocket) transport; - } - } - return null; - } - - private static final ThreadLocal THREAD_LOCAL_IP_ADDRESS = new ThreadLocal() { - @Override - protected synchronized String initialValue() { - return null; - } - }; - - private static final ThreadLocal THREAD_LOCAL_USER_NAME = new ThreadLocal() { - @Override - protected synchronized String initialValue() { - return null; - } - }; - - public static String getUserIpAddress() { - return THREAD_LOCAL_IP_ADDRESS.get(); - } - - public static String getUserName() { - return THREAD_LOCAL_USER_NAME.get(); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/CLIService.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/CLIService.java deleted file mode 100644 index 791ddcbd2c5b6..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/CLIService.java +++ /dev/null @@ -1,507 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CancellationException; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import javax.security.auth.login.LoginException; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hadoop.hive.metastore.HiveMetaStoreClient; -import org.apache.hadoop.hive.metastore.IMetaStoreClient; -import org.apache.hadoop.hive.metastore.api.MetaException; -import org.apache.hadoop.hive.ql.exec.FunctionRegistry; -import org.apache.hadoop.hive.ql.metadata.Hive; -import org.apache.hadoop.hive.ql.metadata.HiveException; -import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hadoop.hive.shims.Utils; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hive.service.CompositeService; -import org.apache.hive.service.ServiceException; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.cli.operation.Operation; -import org.apache.hive.service.cli.session.SessionManager; -import org.apache.hive.service.cli.thrift.TProtocolVersion; -import org.apache.hive.service.server.HiveServer2; - -/** - * CLIService. - * - */ -public class CLIService extends CompositeService implements ICLIService { - - public static final TProtocolVersion SERVER_VERSION; - - static { - TProtocolVersion[] protocols = TProtocolVersion.values(); - SERVER_VERSION = protocols[protocols.length - 1]; - } - - private final Log LOG = LogFactory.getLog(CLIService.class.getName()); - - private HiveConf hiveConf; - private SessionManager sessionManager; - private UserGroupInformation serviceUGI; - private UserGroupInformation httpUGI; - // The HiveServer2 instance running this service - private final HiveServer2 hiveServer2; - - public CLIService(HiveServer2 hiveServer2) { - super(CLIService.class.getSimpleName()); - this.hiveServer2 = hiveServer2; - } - - @Override - public synchronized void init(HiveConf hiveConf) { - this.hiveConf = hiveConf; - sessionManager = new SessionManager(hiveServer2); - addService(sessionManager); - // If the hadoop cluster is secure, do a kerberos login for the service from the keytab - if (UserGroupInformation.isSecurityEnabled()) { - try { - HiveAuthFactory.loginFromKeytab(hiveConf); - this.serviceUGI = Utils.getUGI(); - } catch (IOException e) { - throw new ServiceException("Unable to login to kerberos with given principal/keytab", e); - } catch (LoginException e) { - throw new ServiceException("Unable to login to kerberos with given principal/keytab", e); - } - - // Also try creating a UGI object for the SPNego principal - String principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_PRINCIPAL); - String keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_KEYTAB); - if (principal.isEmpty() || keyTabFile.isEmpty()) { - LOG.info("SPNego httpUGI not created, spNegoPrincipal: " + principal + - ", ketabFile: " + keyTabFile); - } else { - try { - this.httpUGI = HiveAuthFactory.loginFromSpnegoKeytabAndReturnUGI(hiveConf); - LOG.info("SPNego httpUGI successfully created."); - } catch (IOException e) { - LOG.warn("SPNego httpUGI creation failed: ", e); - } - } - } - // creates connection to HMS and thus *must* occur after kerberos login above - try { - applyAuthorizationConfigPolicy(hiveConf); - } catch (Exception e) { - throw new RuntimeException("Error applying authorization policy on hive configuration: " - + e.getMessage(), e); - } - setupBlockedUdfs(); - super.init(hiveConf); - } - - private void applyAuthorizationConfigPolicy(HiveConf newHiveConf) throws HiveException, - MetaException { - // authorization setup using SessionState should be revisited eventually, as - // authorization and authentication are not session specific settings - SessionState ss = new SessionState(newHiveConf); - ss.setIsHiveServerQuery(true); - SessionState.start(ss); - ss.applyAuthorizationPolicy(); - } - - private void setupBlockedUdfs() { - FunctionRegistry.setupPermissionsForBuiltinUDFs( - hiveConf.getVar(ConfVars.HIVE_SERVER2_BUILTIN_UDF_WHITELIST), - hiveConf.getVar(ConfVars.HIVE_SERVER2_BUILTIN_UDF_BLACKLIST)); - } - - public UserGroupInformation getServiceUGI() { - return this.serviceUGI; - } - - public UserGroupInformation getHttpUGI() { - return this.httpUGI; - } - - @Override - public synchronized void start() { - super.start(); - // Initialize and test a connection to the metastore - IMetaStoreClient metastoreClient = null; - try { - metastoreClient = new HiveMetaStoreClient(hiveConf); - metastoreClient.getDatabases("default"); - } catch (Exception e) { - throw new ServiceException("Unable to connect to MetaStore!", e); - } - finally { - if (metastoreClient != null) { - metastoreClient.close(); - } - } - } - - @Override - public synchronized void stop() { - super.stop(); - } - - /** - * @deprecated Use {@link #openSession(TProtocolVersion, String, String, String, Map)} - */ - @Deprecated - public SessionHandle openSession(TProtocolVersion protocol, String username, String password, - Map configuration) throws HiveSQLException { - SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, null, configuration, false, null); - LOG.debug(sessionHandle + ": openSession()"); - return sessionHandle; - } - - /** - * @deprecated Use {@link #openSessionWithImpersonation(TProtocolVersion, String, String, String, Map, String)} - */ - @Deprecated - public SessionHandle openSessionWithImpersonation(TProtocolVersion protocol, String username, - String password, Map configuration, String delegationToken) - throws HiveSQLException { - SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, null, configuration, - true, delegationToken); - LOG.debug(sessionHandle + ": openSessionWithImpersonation()"); - return sessionHandle; - } - - public SessionHandle openSession(TProtocolVersion protocol, String username, String password, String ipAddress, - Map configuration) throws HiveSQLException { - SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, ipAddress, configuration, false, null); - LOG.debug(sessionHandle + ": openSession()"); - return sessionHandle; - } - - public SessionHandle openSessionWithImpersonation(TProtocolVersion protocol, String username, - String password, String ipAddress, Map configuration, String delegationToken) - throws HiveSQLException { - SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, ipAddress, configuration, - true, delegationToken); - LOG.debug(sessionHandle + ": openSession()"); - return sessionHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map) - */ - @Override - public SessionHandle openSession(String username, String password, Map configuration) - throws HiveSQLException { - SessionHandle sessionHandle = sessionManager.openSession(SERVER_VERSION, username, password, null, configuration, false, null); - LOG.debug(sessionHandle + ": openSession()"); - return sessionHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map) - */ - @Override - public SessionHandle openSessionWithImpersonation(String username, String password, Map configuration, - String delegationToken) throws HiveSQLException { - SessionHandle sessionHandle = sessionManager.openSession(SERVER_VERSION, username, password, null, configuration, - true, delegationToken); - LOG.debug(sessionHandle + ": openSession()"); - return sessionHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#closeSession(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public void closeSession(SessionHandle sessionHandle) - throws HiveSQLException { - sessionManager.closeSession(sessionHandle); - LOG.debug(sessionHandle + ": closeSession()"); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getInfo(org.apache.hive.service.cli.SessionHandle, java.util.List) - */ - @Override - public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType getInfoType) - throws HiveSQLException { - GetInfoValue infoValue = sessionManager.getSession(sessionHandle) - .getInfo(getInfoType); - LOG.debug(sessionHandle + ": getInfo()"); - return infoValue; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#executeStatement(org.apache.hive.service.cli.SessionHandle, - * java.lang.String, java.util.Map) - */ - @Override - public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, - Map confOverlay) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .executeStatement(statement, confOverlay); - LOG.debug(sessionHandle + ": executeStatement()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#executeStatementAsync(org.apache.hive.service.cli.SessionHandle, - * java.lang.String, java.util.Map) - */ - @Override - public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, - Map confOverlay) throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .executeStatementAsync(statement, confOverlay); - LOG.debug(sessionHandle + ": executeStatementAsync()"); - return opHandle; - } - - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getTypeInfo(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getTypeInfo(SessionHandle sessionHandle) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getTypeInfo(); - LOG.debug(sessionHandle + ": getTypeInfo()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getCatalogs(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getCatalogs(SessionHandle sessionHandle) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getCatalogs(); - LOG.debug(sessionHandle + ": getCatalogs()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getSchemas(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String) - */ - @Override - public OperationHandle getSchemas(SessionHandle sessionHandle, - String catalogName, String schemaName) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getSchemas(catalogName, schemaName); - LOG.debug(sessionHandle + ": getSchemas()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getTables(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.util.List) - */ - @Override - public OperationHandle getTables(SessionHandle sessionHandle, - String catalogName, String schemaName, String tableName, List tableTypes) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getTables(catalogName, schemaName, tableName, tableTypes); - LOG.debug(sessionHandle + ": getTables()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getTableTypes(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getTableTypes(SessionHandle sessionHandle) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getTableTypes(); - LOG.debug(sessionHandle + ": getTableTypes()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getColumns(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getColumns(SessionHandle sessionHandle, - String catalogName, String schemaName, String tableName, String columnName) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getColumns(catalogName, schemaName, tableName, columnName); - LOG.debug(sessionHandle + ": getColumns()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getFunctions(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getFunctions(SessionHandle sessionHandle, - String catalogName, String schemaName, String functionName) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getFunctions(catalogName, schemaName, functionName); - LOG.debug(sessionHandle + ": getFunctions()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getOperationStatus(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public OperationStatus getOperationStatus(OperationHandle opHandle) - throws HiveSQLException { - Operation operation = sessionManager.getOperationManager().getOperation(opHandle); - /** - * If this is a background operation run asynchronously, - * we block for a configured duration, before we return - * (duration: HIVE_SERVER2_LONG_POLLING_TIMEOUT). - * However, if the background operation is complete, we return immediately. - */ - if (operation.shouldRunAsync()) { - HiveConf conf = operation.getParentSession().getHiveConf(); - long timeout = HiveConf.getTimeVar(conf, - HiveConf.ConfVars.HIVE_SERVER2_LONG_POLLING_TIMEOUT, TimeUnit.MILLISECONDS); - try { - operation.getBackgroundHandle().get(timeout, TimeUnit.MILLISECONDS); - } catch (TimeoutException e) { - // No Op, return to the caller since long polling timeout has expired - LOG.trace(opHandle + ": Long polling timed out"); - } catch (CancellationException e) { - // The background operation thread was cancelled - LOG.trace(opHandle + ": The background operation was cancelled", e); - } catch (ExecutionException e) { - // The background operation thread was aborted - LOG.warn(opHandle + ": The background operation was aborted", e); - } catch (InterruptedException e) { - // No op, this thread was interrupted - // In this case, the call might return sooner than long polling timeout - } - } - OperationStatus opStatus = operation.getStatus(); - LOG.debug(opHandle + ": getOperationStatus()"); - return opStatus; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#cancelOperation(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public void cancelOperation(OperationHandle opHandle) - throws HiveSQLException { - sessionManager.getOperationManager().getOperation(opHandle) - .getParentSession().cancelOperation(opHandle); - LOG.debug(opHandle + ": cancelOperation()"); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#closeOperation(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public void closeOperation(OperationHandle opHandle) - throws HiveSQLException { - sessionManager.getOperationManager().getOperation(opHandle) - .getParentSession().closeOperation(opHandle); - LOG.debug(opHandle + ": closeOperation"); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getResultSetMetadata(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public TableSchema getResultSetMetadata(OperationHandle opHandle) - throws HiveSQLException { - TableSchema tableSchema = sessionManager.getOperationManager() - .getOperation(opHandle).getParentSession().getResultSetMetadata(opHandle); - LOG.debug(opHandle + ": getResultSetMetadata()"); - return tableSchema; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#fetchResults(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public RowSet fetchResults(OperationHandle opHandle) - throws HiveSQLException { - return fetchResults(opHandle, Operation.DEFAULT_FETCH_ORIENTATION, - Operation.DEFAULT_FETCH_MAX_ROWS, FetchType.QUERY_OUTPUT); - } - - @Override - public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, - long maxRows, FetchType fetchType) throws HiveSQLException { - RowSet rowSet = sessionManager.getOperationManager().getOperation(opHandle) - .getParentSession().fetchResults(opHandle, orientation, maxRows, fetchType); - LOG.debug(opHandle + ": fetchResults()"); - return rowSet; - } - - // obtain delegation token for the give user from metastore - public synchronized String getDelegationTokenFromMetaStore(String owner) - throws HiveSQLException, UnsupportedOperationException, LoginException, IOException { - if (!hiveConf.getBoolVar(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL) || - !hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS)) { - throw new UnsupportedOperationException( - "delegation token is can only be obtained for a secure remote metastore"); - } - - try { - Hive.closeCurrent(); - return Hive.get(hiveConf).getDelegationToken(owner, owner); - } catch (HiveException e) { - if (e.getCause() instanceof UnsupportedOperationException) { - throw (UnsupportedOperationException)e.getCause(); - } else { - throw new HiveSQLException("Error connect metastore to setup impersonation", e); - } - } - } - - @Override - public String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String owner, String renewer) throws HiveSQLException { - String delegationToken = sessionManager.getSession(sessionHandle) - .getDelegationToken(authFactory, owner, renewer); - LOG.info(sessionHandle + ": getDelegationToken()"); - return delegationToken; - } - - @Override - public void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException { - sessionManager.getSession(sessionHandle).cancelDelegationToken(authFactory, tokenStr); - LOG.info(sessionHandle + ": cancelDelegationToken()"); - } - - @Override - public void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException { - sessionManager.getSession(sessionHandle).renewDelegationToken(authFactory, tokenStr); - LOG.info(sessionHandle + ": renewDelegationToken()"); - } - - public SessionManager getSessionManager() { - return sessionManager; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/Column.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/Column.java deleted file mode 100644 index 26d0f718f383a..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/Column.java +++ /dev/null @@ -1,423 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.nio.ByteBuffer; -import java.util.AbstractList; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.BitSet; -import java.util.List; - -import com.google.common.primitives.Booleans; -import com.google.common.primitives.Bytes; -import com.google.common.primitives.Doubles; -import com.google.common.primitives.Ints; -import com.google.common.primitives.Longs; -import com.google.common.primitives.Shorts; -import org.apache.hive.service.cli.thrift.TBinaryColumn; -import org.apache.hive.service.cli.thrift.TBoolColumn; -import org.apache.hive.service.cli.thrift.TByteColumn; -import org.apache.hive.service.cli.thrift.TColumn; -import org.apache.hive.service.cli.thrift.TDoubleColumn; -import org.apache.hive.service.cli.thrift.TI16Column; -import org.apache.hive.service.cli.thrift.TI32Column; -import org.apache.hive.service.cli.thrift.TI64Column; -import org.apache.hive.service.cli.thrift.TStringColumn; - -/** - * Column. - */ -public class Column extends AbstractList { - - private static final int DEFAULT_SIZE = 100; - - private final Type type; - - private BitSet nulls; - - private int size; - private boolean[] boolVars; - private byte[] byteVars; - private short[] shortVars; - private int[] intVars; - private long[] longVars; - private double[] doubleVars; - private List stringVars; - private List binaryVars; - - public Column(Type type, BitSet nulls, Object values) { - this.type = type; - this.nulls = nulls; - if (type == Type.BOOLEAN_TYPE) { - boolVars = (boolean[]) values; - size = boolVars.length; - } else if (type == Type.TINYINT_TYPE) { - byteVars = (byte[]) values; - size = byteVars.length; - } else if (type == Type.SMALLINT_TYPE) { - shortVars = (short[]) values; - size = shortVars.length; - } else if (type == Type.INT_TYPE) { - intVars = (int[]) values; - size = intVars.length; - } else if (type == Type.BIGINT_TYPE) { - longVars = (long[]) values; - size = longVars.length; - } else if (type == Type.DOUBLE_TYPE) { - doubleVars = (double[]) values; - size = doubleVars.length; - } else if (type == Type.BINARY_TYPE) { - binaryVars = (List) values; - size = binaryVars.size(); - } else if (type == Type.STRING_TYPE) { - stringVars = (List) values; - size = stringVars.size(); - } else { - throw new IllegalStateException("invalid union object"); - } - } - - public Column(Type type) { - nulls = new BitSet(); - switch (type) { - case BOOLEAN_TYPE: - boolVars = new boolean[DEFAULT_SIZE]; - break; - case TINYINT_TYPE: - byteVars = new byte[DEFAULT_SIZE]; - break; - case SMALLINT_TYPE: - shortVars = new short[DEFAULT_SIZE]; - break; - case INT_TYPE: - intVars = new int[DEFAULT_SIZE]; - break; - case BIGINT_TYPE: - longVars = new long[DEFAULT_SIZE]; - break; - case FLOAT_TYPE: - case DOUBLE_TYPE: - type = Type.DOUBLE_TYPE; - doubleVars = new double[DEFAULT_SIZE]; - break; - case BINARY_TYPE: - binaryVars = new ArrayList(); - break; - default: - type = Type.STRING_TYPE; - stringVars = new ArrayList(); - } - this.type = type; - } - - public Column(TColumn colValues) { - if (colValues.isSetBoolVal()) { - type = Type.BOOLEAN_TYPE; - nulls = toBitset(colValues.getBoolVal().getNulls()); - boolVars = Booleans.toArray(colValues.getBoolVal().getValues()); - size = boolVars.length; - } else if (colValues.isSetByteVal()) { - type = Type.TINYINT_TYPE; - nulls = toBitset(colValues.getByteVal().getNulls()); - byteVars = Bytes.toArray(colValues.getByteVal().getValues()); - size = byteVars.length; - } else if (colValues.isSetI16Val()) { - type = Type.SMALLINT_TYPE; - nulls = toBitset(colValues.getI16Val().getNulls()); - shortVars = Shorts.toArray(colValues.getI16Val().getValues()); - size = shortVars.length; - } else if (colValues.isSetI32Val()) { - type = Type.INT_TYPE; - nulls = toBitset(colValues.getI32Val().getNulls()); - intVars = Ints.toArray(colValues.getI32Val().getValues()); - size = intVars.length; - } else if (colValues.isSetI64Val()) { - type = Type.BIGINT_TYPE; - nulls = toBitset(colValues.getI64Val().getNulls()); - longVars = Longs.toArray(colValues.getI64Val().getValues()); - size = longVars.length; - } else if (colValues.isSetDoubleVal()) { - type = Type.DOUBLE_TYPE; - nulls = toBitset(colValues.getDoubleVal().getNulls()); - doubleVars = Doubles.toArray(colValues.getDoubleVal().getValues()); - size = doubleVars.length; - } else if (colValues.isSetBinaryVal()) { - type = Type.BINARY_TYPE; - nulls = toBitset(colValues.getBinaryVal().getNulls()); - binaryVars = colValues.getBinaryVal().getValues(); - size = binaryVars.size(); - } else if (colValues.isSetStringVal()) { - type = Type.STRING_TYPE; - nulls = toBitset(colValues.getStringVal().getNulls()); - stringVars = colValues.getStringVal().getValues(); - size = stringVars.size(); - } else { - throw new IllegalStateException("invalid union object"); - } - } - - public Column extractSubset(int start, int end) { - BitSet subNulls = nulls.get(start, end); - if (type == Type.BOOLEAN_TYPE) { - Column subset = new Column(type, subNulls, Arrays.copyOfRange(boolVars, start, end)); - boolVars = Arrays.copyOfRange(boolVars, end, size); - nulls = nulls.get(start, size); - size = boolVars.length; - return subset; - } - if (type == Type.TINYINT_TYPE) { - Column subset = new Column(type, subNulls, Arrays.copyOfRange(byteVars, start, end)); - byteVars = Arrays.copyOfRange(byteVars, end, size); - nulls = nulls.get(start, size); - size = byteVars.length; - return subset; - } - if (type == Type.SMALLINT_TYPE) { - Column subset = new Column(type, subNulls, Arrays.copyOfRange(shortVars, start, end)); - shortVars = Arrays.copyOfRange(shortVars, end, size); - nulls = nulls.get(start, size); - size = shortVars.length; - return subset; - } - if (type == Type.INT_TYPE) { - Column subset = new Column(type, subNulls, Arrays.copyOfRange(intVars, start, end)); - intVars = Arrays.copyOfRange(intVars, end, size); - nulls = nulls.get(start, size); - size = intVars.length; - return subset; - } - if (type == Type.BIGINT_TYPE) { - Column subset = new Column(type, subNulls, Arrays.copyOfRange(longVars, start, end)); - longVars = Arrays.copyOfRange(longVars, end, size); - nulls = nulls.get(start, size); - size = longVars.length; - return subset; - } - if (type == Type.DOUBLE_TYPE) { - Column subset = new Column(type, subNulls, Arrays.copyOfRange(doubleVars, start, end)); - doubleVars = Arrays.copyOfRange(doubleVars, end, size); - nulls = nulls.get(start, size); - size = doubleVars.length; - return subset; - } - if (type == Type.BINARY_TYPE) { - Column subset = new Column(type, subNulls, binaryVars.subList(start, end)); - binaryVars = binaryVars.subList(end, binaryVars.size()); - nulls = nulls.get(start, size); - size = binaryVars.size(); - return subset; - } - if (type == Type.STRING_TYPE) { - Column subset = new Column(type, subNulls, stringVars.subList(start, end)); - stringVars = stringVars.subList(end, stringVars.size()); - nulls = nulls.get(start, size); - size = stringVars.size(); - return subset; - } - throw new IllegalStateException("invalid union object"); - } - - private static final byte[] MASKS = new byte[] { - 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, (byte)0x80 - }; - - private static BitSet toBitset(byte[] nulls) { - BitSet bitset = new BitSet(); - int bits = nulls.length * 8; - for (int i = 0; i < bits; i++) { - bitset.set(i, (nulls[i / 8] & MASKS[i % 8]) != 0); - } - return bitset; - } - - private static byte[] toBinary(BitSet bitset) { - byte[] nulls = new byte[1 + (bitset.length() / 8)]; - for (int i = 0; i < bitset.length(); i++) { - nulls[i / 8] |= bitset.get(i) ? MASKS[i % 8] : 0; - } - return nulls; - } - - public Type getType() { - return type; - } - - @Override - public Object get(int index) { - if (nulls.get(index)) { - return null; - } - switch (type) { - case BOOLEAN_TYPE: - return boolVars[index]; - case TINYINT_TYPE: - return byteVars[index]; - case SMALLINT_TYPE: - return shortVars[index]; - case INT_TYPE: - return intVars[index]; - case BIGINT_TYPE: - return longVars[index]; - case DOUBLE_TYPE: - return doubleVars[index]; - case STRING_TYPE: - return stringVars.get(index); - case BINARY_TYPE: - return binaryVars.get(index).array(); - } - return null; - } - - @Override - public int size() { - return size; - } - - public TColumn toTColumn() { - TColumn value = new TColumn(); - ByteBuffer nullMasks = ByteBuffer.wrap(toBinary(nulls)); - switch (type) { - case BOOLEAN_TYPE: - value.setBoolVal(new TBoolColumn(Booleans.asList(Arrays.copyOfRange(boolVars, 0, size)), nullMasks)); - break; - case TINYINT_TYPE: - value.setByteVal(new TByteColumn(Bytes.asList(Arrays.copyOfRange(byteVars, 0, size)), nullMasks)); - break; - case SMALLINT_TYPE: - value.setI16Val(new TI16Column(Shorts.asList(Arrays.copyOfRange(shortVars, 0, size)), nullMasks)); - break; - case INT_TYPE: - value.setI32Val(new TI32Column(Ints.asList(Arrays.copyOfRange(intVars, 0, size)), nullMasks)); - break; - case BIGINT_TYPE: - value.setI64Val(new TI64Column(Longs.asList(Arrays.copyOfRange(longVars, 0, size)), nullMasks)); - break; - case DOUBLE_TYPE: - value.setDoubleVal(new TDoubleColumn(Doubles.asList(Arrays.copyOfRange(doubleVars, 0, size)), nullMasks)); - break; - case STRING_TYPE: - value.setStringVal(new TStringColumn(stringVars, nullMasks)); - break; - case BINARY_TYPE: - value.setBinaryVal(new TBinaryColumn(binaryVars, nullMasks)); - break; - } - return value; - } - - private static final ByteBuffer EMPTY_BINARY = ByteBuffer.allocate(0); - private static final String EMPTY_STRING = ""; - - public void addValue(Type type, Object field) { - switch (type) { - case BOOLEAN_TYPE: - nulls.set(size, field == null); - boolVars()[size] = field == null ? true : (Boolean)field; - break; - case TINYINT_TYPE: - nulls.set(size, field == null); - byteVars()[size] = field == null ? 0 : (Byte) field; - break; - case SMALLINT_TYPE: - nulls.set(size, field == null); - shortVars()[size] = field == null ? 0 : (Short)field; - break; - case INT_TYPE: - nulls.set(size, field == null); - intVars()[size] = field == null ? 0 : (Integer)field; - break; - case BIGINT_TYPE: - nulls.set(size, field == null); - longVars()[size] = field == null ? 0 : (Long)field; - break; - case FLOAT_TYPE: - nulls.set(size, field == null); - doubleVars()[size] = field == null ? 0 : Double.valueOf(field.toString()); - break; - case DOUBLE_TYPE: - nulls.set(size, field == null); - doubleVars()[size] = field == null ? 0 : (Double)field; - break; - case BINARY_TYPE: - nulls.set(binaryVars.size(), field == null); - binaryVars.add(field == null ? EMPTY_BINARY : ByteBuffer.wrap((byte[])field)); - break; - default: - nulls.set(stringVars.size(), field == null); - stringVars.add(field == null ? EMPTY_STRING : String.valueOf(field)); - break; - } - size++; - } - - private boolean[] boolVars() { - if (boolVars.length == size) { - boolean[] newVars = new boolean[size << 1]; - System.arraycopy(boolVars, 0, newVars, 0, size); - return boolVars = newVars; - } - return boolVars; - } - - private byte[] byteVars() { - if (byteVars.length == size) { - byte[] newVars = new byte[size << 1]; - System.arraycopy(byteVars, 0, newVars, 0, size); - return byteVars = newVars; - } - return byteVars; - } - - private short[] shortVars() { - if (shortVars.length == size) { - short[] newVars = new short[size << 1]; - System.arraycopy(shortVars, 0, newVars, 0, size); - return shortVars = newVars; - } - return shortVars; - } - - private int[] intVars() { - if (intVars.length == size) { - int[] newVars = new int[size << 1]; - System.arraycopy(intVars, 0, newVars, 0, size); - return intVars = newVars; - } - return intVars; - } - - private long[] longVars() { - if (longVars.length == size) { - long[] newVars = new long[size << 1]; - System.arraycopy(longVars, 0, newVars, 0, size); - return longVars = newVars; - } - return longVars; - } - - private double[] doubleVars() { - if (doubleVars.length == size) { - double[] newVars = new double[size << 1]; - System.arraycopy(doubleVars, 0, newVars, 0, size); - return doubleVars = newVars; - } - return doubleVars; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java deleted file mode 100644 index 47a582e2223e4..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/ColumnBasedSet.java +++ /dev/null @@ -1,149 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.apache.hive.service.cli.thrift.TColumn; -import org.apache.hive.service.cli.thrift.TRow; -import org.apache.hive.service.cli.thrift.TRowSet; - -/** - * ColumnBasedSet. - */ -public class ColumnBasedSet implements RowSet { - - private long startOffset; - - private final Type[] types; // non-null only for writing (server-side) - private final List columns; - - public ColumnBasedSet(TableSchema schema) { - types = schema.toTypes(); - columns = new ArrayList(); - for (ColumnDescriptor colDesc : schema.getColumnDescriptors()) { - columns.add(new Column(colDesc.getType())); - } - } - - public ColumnBasedSet(TRowSet tRowSet) { - types = null; - columns = new ArrayList(); - for (TColumn tvalue : tRowSet.getColumns()) { - columns.add(new Column(tvalue)); - } - startOffset = tRowSet.getStartRowOffset(); - } - - private ColumnBasedSet(Type[] types, List columns, long startOffset) { - this.types = types; - this.columns = columns; - this.startOffset = startOffset; - } - - @Override - public ColumnBasedSet addRow(Object[] fields) { - for (int i = 0; i < fields.length; i++) { - columns.get(i).addValue(types[i], fields[i]); - } - return this; - } - - public List getColumns() { - return columns; - } - - @Override - public int numColumns() { - return columns.size(); - } - - @Override - public int numRows() { - return columns.isEmpty() ? 0 : columns.get(0).size(); - } - - @Override - public ColumnBasedSet extractSubset(int maxRows) { - int numRows = Math.min(numRows(), maxRows); - - List subset = new ArrayList(); - for (int i = 0; i < columns.size(); i++) { - subset.add(columns.get(i).extractSubset(0, numRows)); - } - ColumnBasedSet result = new ColumnBasedSet(types, subset, startOffset); - startOffset += numRows; - return result; - } - - @Override - public long getStartOffset() { - return startOffset; - } - - @Override - public void setStartOffset(long startOffset) { - this.startOffset = startOffset; - } - - public TRowSet toTRowSet() { - TRowSet tRowSet = new TRowSet(startOffset, new ArrayList()); - for (int i = 0; i < columns.size(); i++) { - tRowSet.addToColumns(columns.get(i).toTColumn()); - } - return tRowSet; - } - - @Override - public Iterator iterator() { - return new Iterator() { - - private int index; - private final Object[] convey = new Object[numColumns()]; - - @Override - public boolean hasNext() { - return index < numRows(); - } - - @Override - public Object[] next() { - for (int i = 0; i < columns.size(); i++) { - convey[i] = columns.get(i).get(index); - } - index++; - return convey; - } - - @Override - public void remove() { - throw new UnsupportedOperationException("remove"); - } - }; - } - - public Object[] fill(int index, Object[] convey) { - for (int i = 0; i < columns.size(); i++) { - convey[i] = columns.get(i).get(index); - } - return convey; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java deleted file mode 100644 index f0bbf14693160..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import org.apache.hadoop.hive.metastore.api.FieldSchema; -import org.apache.hive.service.cli.thrift.TColumnDesc; - - -/** - * ColumnDescriptor. - * - */ -public class ColumnDescriptor { - private final String name; - private final String comment; - private final TypeDescriptor type; - // ordinal position of this column in the schema - private final int position; - - public ColumnDescriptor(String name, String comment, TypeDescriptor type, int position) { - this.name = name; - this.comment = comment; - this.type = type; - this.position = position; - } - - public ColumnDescriptor(TColumnDesc tColumnDesc) { - name = tColumnDesc.getColumnName(); - comment = tColumnDesc.getComment(); - type = new TypeDescriptor(tColumnDesc.getTypeDesc()); - position = tColumnDesc.getPosition(); - } - - public ColumnDescriptor(FieldSchema column, int position) { - name = column.getName(); - comment = column.getComment(); - type = new TypeDescriptor(column.getType()); - this.position = position; - } - - public static ColumnDescriptor newPrimitiveColumnDescriptor(String name, String comment, Type type, int position) { - // Current usage looks like it's only for metadata columns, but if that changes then - // this method may need to require a type qualifiers aruments. - return new ColumnDescriptor(name, comment, new TypeDescriptor(type), position); - } - - public String getName() { - return name; - } - - public String getComment() { - return comment; - } - - public TypeDescriptor getTypeDescriptor() { - return type; - } - - public int getOrdinalPosition() { - return position; - } - - public TColumnDesc toTColumnDesc() { - TColumnDesc tColumnDesc = new TColumnDesc(); - tColumnDesc.setColumnName(name); - tColumnDesc.setComment(comment); - tColumnDesc.setTypeDesc(type.toTTypeDesc()); - tColumnDesc.setPosition(position); - return tColumnDesc; - } - - public Type getType() { - return type.getType(); - } - - public boolean isPrimitive() { - return type.getType().isPrimitiveType(); - } - - public String getTypeName() { - return type.getTypeName(); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/ColumnValue.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/ColumnValue.java deleted file mode 100644 index a770bea9c2aa6..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/ColumnValue.java +++ /dev/null @@ -1,304 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.math.BigDecimal; -import java.sql.Date; -import java.sql.Timestamp; - -import org.apache.hadoop.hive.common.type.HiveChar; -import org.apache.hadoop.hive.common.type.HiveIntervalDayTime; -import org.apache.hadoop.hive.common.type.HiveIntervalYearMonth; -import org.apache.hadoop.hive.common.type.HiveVarchar; -import org.apache.hive.service.cli.thrift.TBoolValue; -import org.apache.hive.service.cli.thrift.TByteValue; -import org.apache.hive.service.cli.thrift.TColumnValue; -import org.apache.hive.service.cli.thrift.TDoubleValue; -import org.apache.hive.service.cli.thrift.TI16Value; -import org.apache.hive.service.cli.thrift.TI32Value; -import org.apache.hive.service.cli.thrift.TI64Value; -import org.apache.hive.service.cli.thrift.TStringValue; - -import org.apache.spark.unsafe.types.UTF8String; - -/** - * Protocols before HIVE_CLI_SERVICE_PROTOCOL_V6 (used by RowBasedSet) - * - */ -public class ColumnValue { - - private static TColumnValue booleanValue(Boolean value) { - TBoolValue tBoolValue = new TBoolValue(); - if (value != null) { - tBoolValue.setValue(value); - } - return TColumnValue.boolVal(tBoolValue); - } - - private static TColumnValue byteValue(Byte value) { - TByteValue tByteValue = new TByteValue(); - if (value != null) { - tByteValue.setValue(value); - } - return TColumnValue.byteVal(tByteValue); - } - - private static TColumnValue shortValue(Short value) { - TI16Value tI16Value = new TI16Value(); - if (value != null) { - tI16Value.setValue(value); - } - return TColumnValue.i16Val(tI16Value); - } - - private static TColumnValue intValue(Integer value) { - TI32Value tI32Value = new TI32Value(); - if (value != null) { - tI32Value.setValue(value); - } - return TColumnValue.i32Val(tI32Value); - } - - private static TColumnValue longValue(Long value) { - TI64Value tI64Value = new TI64Value(); - if (value != null) { - tI64Value.setValue(value); - } - return TColumnValue.i64Val(tI64Value); - } - - private static TColumnValue floatValue(Float value) { - TDoubleValue tDoubleValue = new TDoubleValue(); - if (value != null) { - tDoubleValue.setValue(value); - } - return TColumnValue.doubleVal(tDoubleValue); - } - - private static TColumnValue doubleValue(Double value) { - TDoubleValue tDoubleValue = new TDoubleValue(); - if (value != null) { - tDoubleValue.setValue(value); - } - return TColumnValue.doubleVal(tDoubleValue); - } - - private static TColumnValue stringValue(String value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value); - } - return TColumnValue.stringVal(tStringValue); - } - - private static TColumnValue stringValue(HiveChar value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value.toString()); - } - return TColumnValue.stringVal(tStringValue); - } - - private static TColumnValue stringValue(HiveVarchar value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value.toString()); - } - return TColumnValue.stringVal(tStringValue); - } - - private static TColumnValue dateValue(Date value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value.toString()); - } - return new TColumnValue(TColumnValue.stringVal(tStringValue)); - } - - private static TColumnValue timestampValue(Timestamp value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value.toString()); - } - return TColumnValue.stringVal(tStringValue); - } - - private static TColumnValue stringValue(HiveIntervalYearMonth value) { - TStringValue tStrValue = new TStringValue(); - if (value != null) { - tStrValue.setValue(value.toString()); - } - return TColumnValue.stringVal(tStrValue); - } - - private static TColumnValue stringValue(HiveIntervalDayTime value) { - TStringValue tStrValue = new TStringValue(); - if (value != null) { - tStrValue.setValue(value.toString()); - } - return TColumnValue.stringVal(tStrValue); - } - - public static TColumnValue toTColumnValue(Type type, Object value) { - switch (type) { - case BOOLEAN_TYPE: - return booleanValue((Boolean)value); - case TINYINT_TYPE: - return byteValue((Byte)value); - case SMALLINT_TYPE: - return shortValue((Short)value); - case INT_TYPE: - return intValue((Integer)value); - case BIGINT_TYPE: - return longValue((Long)value); - case FLOAT_TYPE: - return floatValue((Float)value); - case DOUBLE_TYPE: - return doubleValue((Double)value); - case STRING_TYPE: - return stringValue((String)value); - case CHAR_TYPE: - return stringValue((HiveChar)value); - case VARCHAR_TYPE: - return stringValue((HiveVarchar)value); - case DATE_TYPE: - return dateValue((Date)value); - case TIMESTAMP_TYPE: - return timestampValue((Timestamp)value); - case INTERVAL_YEAR_MONTH_TYPE: - return stringValue((HiveIntervalYearMonth) value); - case INTERVAL_DAY_TIME_TYPE: - return stringValue((HiveIntervalDayTime) value); - case DECIMAL_TYPE: - String plainStr = value == null ? null : ((BigDecimal)value).toPlainString(); - return stringValue(plainStr); - case BINARY_TYPE: - String strVal = value == null ? null : UTF8String.fromBytes((byte[])value).toString(); - return stringValue(strVal); - case ARRAY_TYPE: - case MAP_TYPE: - case STRUCT_TYPE: - case UNION_TYPE: - case USER_DEFINED_TYPE: - return stringValue((String)value); - case NULL_TYPE: - return stringValue((String)value); - default: - return null; - } - } - - private static Boolean getBooleanValue(TBoolValue tBoolValue) { - if (tBoolValue.isSetValue()) { - return tBoolValue.isValue(); - } - return null; - } - - private static Byte getByteValue(TByteValue tByteValue) { - if (tByteValue.isSetValue()) { - return tByteValue.getValue(); - } - return null; - } - - private static Short getShortValue(TI16Value tI16Value) { - if (tI16Value.isSetValue()) { - return tI16Value.getValue(); - } - return null; - } - - private static Integer getIntegerValue(TI32Value tI32Value) { - if (tI32Value.isSetValue()) { - return tI32Value.getValue(); - } - return null; - } - - private static Long getLongValue(TI64Value tI64Value) { - if (tI64Value.isSetValue()) { - return tI64Value.getValue(); - } - return null; - } - - private static Double getDoubleValue(TDoubleValue tDoubleValue) { - if (tDoubleValue.isSetValue()) { - return tDoubleValue.getValue(); - } - return null; - } - - private static String getStringValue(TStringValue tStringValue) { - if (tStringValue.isSetValue()) { - return tStringValue.getValue(); - } - return null; - } - - private static Date getDateValue(TStringValue tStringValue) { - if (tStringValue.isSetValue()) { - return Date.valueOf(tStringValue.getValue()); - } - return null; - } - - private static Timestamp getTimestampValue(TStringValue tStringValue) { - if (tStringValue.isSetValue()) { - return Timestamp.valueOf(tStringValue.getValue()); - } - return null; - } - - private static byte[] getBinaryValue(TStringValue tString) { - if (tString.isSetValue()) { - return tString.getValue().getBytes(); - } - return null; - } - - private static BigDecimal getBigDecimalValue(TStringValue tStringValue) { - if (tStringValue.isSetValue()) { - return new BigDecimal(tStringValue.getValue()); - } - return null; - } - - public static Object toColumnValue(TColumnValue value) { - TColumnValue._Fields field = value.getSetField(); - switch (field) { - case BOOL_VAL: - return getBooleanValue(value.getBoolVal()); - case BYTE_VAL: - return getByteValue(value.getByteVal()); - case I16_VAL: - return getShortValue(value.getI16Val()); - case I32_VAL: - return getIntegerValue(value.getI32Val()); - case I64_VAL: - return getLongValue(value.getI64Val()); - case DOUBLE_VAL: - return getDoubleValue(value.getDoubleVal()); - case STRING_VAL: - return getStringValue(value.getStringVal()); - } - throw new IllegalArgumentException("never"); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java deleted file mode 100644 index 9cad5be198c06..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/EmbeddedCLIServiceClient.java +++ /dev/null @@ -1,208 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.util.List; -import java.util.Map; - -import org.apache.hive.service.auth.HiveAuthFactory; - - -/** - * EmbeddedCLIServiceClient. - * - */ -public class EmbeddedCLIServiceClient extends CLIServiceClient { - private final ICLIService cliService; - - public EmbeddedCLIServiceClient(ICLIService cliService) { - this.cliService = cliService; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#openSession(java.lang.String, java.lang.String, java.util.Map) - */ - @Override - public SessionHandle openSession(String username, String password, - Map configuration) throws HiveSQLException { - return cliService.openSession(username, password, configuration); - } - - @Override - public SessionHandle openSessionWithImpersonation(String username, String password, - Map configuration, String delegationToken) throws HiveSQLException { - throw new HiveSQLException("Impersonated session is not supported in the embedded mode"); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#closeSession(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public void closeSession(SessionHandle sessionHandle) throws HiveSQLException { - cliService.closeSession(sessionHandle); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#getInfo(org.apache.hive.service.cli.SessionHandle, java.util.List) - */ - @Override - public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType getInfoType) - throws HiveSQLException { - return cliService.getInfo(sessionHandle, getInfoType); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#executeStatement(org.apache.hive.service.cli.SessionHandle, - * java.lang.String, java.util.Map) - */ - @Override - public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, - Map confOverlay) throws HiveSQLException { - return cliService.executeStatement(sessionHandle, statement, confOverlay); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#executeStatementAsync(org.apache.hive.service.cli.SessionHandle, - * java.lang.String, java.util.Map) - */ - @Override - public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, - Map confOverlay) throws HiveSQLException { - return cliService.executeStatementAsync(sessionHandle, statement, confOverlay); - } - - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#getTypeInfo(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getTypeInfo(SessionHandle sessionHandle) throws HiveSQLException { - return cliService.getTypeInfo(sessionHandle); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#getCatalogs(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getCatalogs(SessionHandle sessionHandle) throws HiveSQLException { - return cliService.getCatalogs(sessionHandle); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#getSchemas(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String) - */ - @Override - public OperationHandle getSchemas(SessionHandle sessionHandle, String catalogName, - String schemaName) throws HiveSQLException { - return cliService.getSchemas(sessionHandle, catalogName, schemaName); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#getTables(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.util.List) - */ - @Override - public OperationHandle getTables(SessionHandle sessionHandle, String catalogName, - String schemaName, String tableName, List tableTypes) throws HiveSQLException { - return cliService.getTables(sessionHandle, catalogName, schemaName, tableName, tableTypes); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#getTableTypes(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getTableTypes(SessionHandle sessionHandle) throws HiveSQLException { - return cliService.getTableTypes(sessionHandle); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#getColumns(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.lang.String) - */ - @Override - public OperationHandle getColumns(SessionHandle sessionHandle, String catalogName, - String schemaName, String tableName, String columnName) throws HiveSQLException { - return cliService.getColumns(sessionHandle, catalogName, schemaName, tableName, columnName); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#getFunctions(org.apache.hive.service.cli.SessionHandle, java.lang.String) - */ - @Override - public OperationHandle getFunctions(SessionHandle sessionHandle, - String catalogName, String schemaName, String functionName) - throws HiveSQLException { - return cliService.getFunctions(sessionHandle, catalogName, schemaName, functionName); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#getOperationStatus(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public OperationStatus getOperationStatus(OperationHandle opHandle) throws HiveSQLException { - return cliService.getOperationStatus(opHandle); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#cancelOperation(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public void cancelOperation(OperationHandle opHandle) throws HiveSQLException { - cliService.cancelOperation(opHandle); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#closeOperation(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public void closeOperation(OperationHandle opHandle) throws HiveSQLException { - cliService.closeOperation(opHandle); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.CLIServiceClient#getResultSetMetadata(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public TableSchema getResultSetMetadata(OperationHandle opHandle) throws HiveSQLException { - return cliService.getResultSetMetadata(opHandle); - } - - @Override - public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, - long maxRows, FetchType fetchType) throws HiveSQLException { - return cliService.fetchResults(opHandle, orientation, maxRows, fetchType); - } - - - @Override - public String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String owner, String renewer) throws HiveSQLException { - return cliService.getDelegationToken(sessionHandle, authFactory, owner, renewer); - } - - @Override - public void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException { - cliService.cancelDelegationToken(sessionHandle, authFactory, tokenStr); - } - - @Override - public void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException { - cliService.renewDelegationToken(sessionHandle, authFactory, tokenStr); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/FetchOrientation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/FetchOrientation.java deleted file mode 100644 index ffa6f2e1f3743..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/FetchOrientation.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import org.apache.hive.service.cli.thrift.TFetchOrientation; - -/** - * FetchOrientation. - * - */ -public enum FetchOrientation { - FETCH_NEXT(TFetchOrientation.FETCH_NEXT), - FETCH_PRIOR(TFetchOrientation.FETCH_PRIOR), - FETCH_RELATIVE(TFetchOrientation.FETCH_RELATIVE), - FETCH_ABSOLUTE(TFetchOrientation.FETCH_ABSOLUTE), - FETCH_FIRST(TFetchOrientation.FETCH_FIRST), - FETCH_LAST(TFetchOrientation.FETCH_LAST); - - private TFetchOrientation tFetchOrientation; - - FetchOrientation(TFetchOrientation tFetchOrientation) { - this.tFetchOrientation = tFetchOrientation; - } - - public static FetchOrientation getFetchOrientation(TFetchOrientation tFetchOrientation) { - for (FetchOrientation fetchOrientation : values()) { - if (tFetchOrientation.equals(fetchOrientation.toTFetchOrientation())) { - return fetchOrientation; - } - } - // TODO: Should this really default to FETCH_NEXT? - return FETCH_NEXT; - } - - public TFetchOrientation toTFetchOrientation() { - return tFetchOrientation; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/GetInfoType.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/GetInfoType.java deleted file mode 100644 index 8dd33a88fdeb2..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/GetInfoType.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import org.apache.hive.service.cli.thrift.TGetInfoType; - -/** - * GetInfoType. - * - */ -public enum GetInfoType { - CLI_MAX_DRIVER_CONNECTIONS(TGetInfoType.CLI_MAX_DRIVER_CONNECTIONS), - CLI_MAX_CONCURRENT_ACTIVITIES(TGetInfoType.CLI_MAX_CONCURRENT_ACTIVITIES), - CLI_DATA_SOURCE_NAME(TGetInfoType.CLI_DATA_SOURCE_NAME), - CLI_FETCH_DIRECTION(TGetInfoType.CLI_FETCH_DIRECTION), - CLI_SERVER_NAME(TGetInfoType.CLI_SERVER_NAME), - CLI_SEARCH_PATTERN_ESCAPE(TGetInfoType.CLI_SEARCH_PATTERN_ESCAPE), - CLI_DBMS_NAME(TGetInfoType.CLI_DBMS_NAME), - CLI_DBMS_VER(TGetInfoType.CLI_DBMS_VER), - CLI_ACCESSIBLE_TABLES(TGetInfoType.CLI_ACCESSIBLE_TABLES), - CLI_ACCESSIBLE_PROCEDURES(TGetInfoType.CLI_ACCESSIBLE_PROCEDURES), - CLI_CURSOR_COMMIT_BEHAVIOR(TGetInfoType.CLI_CURSOR_COMMIT_BEHAVIOR), - CLI_DATA_SOURCE_READ_ONLY(TGetInfoType.CLI_DATA_SOURCE_READ_ONLY), - CLI_DEFAULT_TXN_ISOLATION(TGetInfoType.CLI_DEFAULT_TXN_ISOLATION), - CLI_IDENTIFIER_CASE(TGetInfoType.CLI_IDENTIFIER_CASE), - CLI_IDENTIFIER_QUOTE_CHAR(TGetInfoType.CLI_IDENTIFIER_QUOTE_CHAR), - CLI_MAX_COLUMN_NAME_LEN(TGetInfoType.CLI_MAX_COLUMN_NAME_LEN), - CLI_MAX_CURSOR_NAME_LEN(TGetInfoType.CLI_MAX_CURSOR_NAME_LEN), - CLI_MAX_SCHEMA_NAME_LEN(TGetInfoType.CLI_MAX_SCHEMA_NAME_LEN), - CLI_MAX_CATALOG_NAME_LEN(TGetInfoType.CLI_MAX_CATALOG_NAME_LEN), - CLI_MAX_TABLE_NAME_LEN(TGetInfoType.CLI_MAX_TABLE_NAME_LEN), - CLI_SCROLL_CONCURRENCY(TGetInfoType.CLI_SCROLL_CONCURRENCY), - CLI_TXN_CAPABLE(TGetInfoType.CLI_TXN_CAPABLE), - CLI_USER_NAME(TGetInfoType.CLI_USER_NAME), - CLI_TXN_ISOLATION_OPTION(TGetInfoType.CLI_TXN_ISOLATION_OPTION), - CLI_INTEGRITY(TGetInfoType.CLI_INTEGRITY), - CLI_GETDATA_EXTENSIONS(TGetInfoType.CLI_GETDATA_EXTENSIONS), - CLI_NULL_COLLATION(TGetInfoType.CLI_NULL_COLLATION), - CLI_ALTER_TABLE(TGetInfoType.CLI_ALTER_TABLE), - CLI_ORDER_BY_COLUMNS_IN_SELECT(TGetInfoType.CLI_ORDER_BY_COLUMNS_IN_SELECT), - CLI_SPECIAL_CHARACTERS(TGetInfoType.CLI_SPECIAL_CHARACTERS), - CLI_MAX_COLUMNS_IN_GROUP_BY(TGetInfoType.CLI_MAX_COLUMNS_IN_GROUP_BY), - CLI_MAX_COLUMNS_IN_INDEX(TGetInfoType.CLI_MAX_COLUMNS_IN_INDEX), - CLI_MAX_COLUMNS_IN_ORDER_BY(TGetInfoType.CLI_MAX_COLUMNS_IN_ORDER_BY), - CLI_MAX_COLUMNS_IN_SELECT(TGetInfoType.CLI_MAX_COLUMNS_IN_SELECT), - CLI_MAX_COLUMNS_IN_TABLE(TGetInfoType.CLI_MAX_COLUMNS_IN_TABLE), - CLI_MAX_INDEX_SIZE(TGetInfoType.CLI_MAX_INDEX_SIZE), - CLI_MAX_ROW_SIZE(TGetInfoType.CLI_MAX_ROW_SIZE), - CLI_MAX_STATEMENT_LEN(TGetInfoType.CLI_MAX_STATEMENT_LEN), - CLI_MAX_TABLES_IN_SELECT(TGetInfoType.CLI_MAX_TABLES_IN_SELECT), - CLI_MAX_USER_NAME_LEN(TGetInfoType.CLI_MAX_USER_NAME_LEN), - CLI_OJ_CAPABILITIES(TGetInfoType.CLI_OJ_CAPABILITIES), - - CLI_XOPEN_CLI_YEAR(TGetInfoType.CLI_XOPEN_CLI_YEAR), - CLI_CURSOR_SENSITIVITY(TGetInfoType.CLI_CURSOR_SENSITIVITY), - CLI_DESCRIBE_PARAMETER(TGetInfoType.CLI_DESCRIBE_PARAMETER), - CLI_CATALOG_NAME(TGetInfoType.CLI_CATALOG_NAME), - CLI_COLLATION_SEQ(TGetInfoType.CLI_COLLATION_SEQ), - CLI_MAX_IDENTIFIER_LEN(TGetInfoType.CLI_MAX_IDENTIFIER_LEN); - - private final TGetInfoType tInfoType; - - GetInfoType(TGetInfoType tInfoType) { - this.tInfoType = tInfoType; - } - - public static GetInfoType getGetInfoType(TGetInfoType tGetInfoType) { - for (GetInfoType infoType : values()) { - if (tGetInfoType.equals(infoType.tInfoType)) { - return infoType; - } - } - throw new IllegalArgumentException("Unrecognized Thrift TGetInfoType value: " + tGetInfoType); - } - - public TGetInfoType toTGetInfoType() { - return tInfoType; - } - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/GetInfoValue.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/GetInfoValue.java deleted file mode 100644 index ba92ff4ab5c11..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/GetInfoValue.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import org.apache.hive.service.cli.thrift.TGetInfoValue; - -/** - * GetInfoValue. - * - */ -public class GetInfoValue { - private String stringValue = null; - private short shortValue; - private int intValue; - private long longValue; - - public GetInfoValue(String stringValue) { - this.stringValue = stringValue; - } - - public GetInfoValue(short shortValue) { - this.shortValue = shortValue; - } - - public GetInfoValue(int intValue) { - this.intValue = intValue; - } - - public GetInfoValue(long longValue) { - this.longValue = longValue; - } - - public GetInfoValue(TGetInfoValue tGetInfoValue) { - switch (tGetInfoValue.getSetField()) { - case STRING_VALUE: - stringValue = tGetInfoValue.getStringValue(); - break; - default: - throw new IllegalArgumentException("Unreconigzed TGetInfoValue"); - } - } - - public TGetInfoValue toTGetInfoValue() { - TGetInfoValue tInfoValue = new TGetInfoValue(); - if (stringValue != null) { - tInfoValue.setStringValue(stringValue); - } - return tInfoValue; - } - - public String getStringValue() { - return stringValue; - } - - public short getShortValue() { - return shortValue; - } - - public int getIntValue() { - return intValue; - } - - public long getLongValue() { - return longValue; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/Handle.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/Handle.java deleted file mode 100644 index cf3427ae20f3c..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/Handle.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * 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. - */ -package org.apache.hive.service.cli; - -import org.apache.hive.service.cli.thrift.THandleIdentifier; - - - - -public abstract class Handle { - - private final HandleIdentifier handleId; - - public Handle() { - handleId = new HandleIdentifier(); - } - - public Handle(HandleIdentifier handleId) { - this.handleId = handleId; - } - - public Handle(THandleIdentifier tHandleIdentifier) { - this.handleId = new HandleIdentifier(tHandleIdentifier); - } - - public HandleIdentifier getHandleIdentifier() { - return handleId; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((handleId == null) ? 0 : handleId.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (!(obj instanceof Handle)) { - return false; - } - Handle other = (Handle) obj; - if (handleId == null) { - if (other.handleId != null) { - return false; - } - } else if (!handleId.equals(other.handleId)) { - return false; - } - return true; - } - - @Override - public abstract String toString(); - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java deleted file mode 100644 index 4dc80da8dc500..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/HandleIdentifier.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.nio.ByteBuffer; -import java.util.UUID; - -import org.apache.hive.service.cli.thrift.THandleIdentifier; - -/** - * HandleIdentifier. - * - */ -public class HandleIdentifier { - private final UUID publicId; - private final UUID secretId; - - public HandleIdentifier() { - publicId = UUID.randomUUID(); - secretId = UUID.randomUUID(); - } - - public HandleIdentifier(UUID publicId, UUID secretId) { - this.publicId = publicId; - this.secretId = secretId; - } - - public HandleIdentifier(THandleIdentifier tHandleId) { - ByteBuffer bb = ByteBuffer.wrap(tHandleId.getGuid()); - this.publicId = new UUID(bb.getLong(), bb.getLong()); - bb = ByteBuffer.wrap(tHandleId.getSecret()); - this.secretId = new UUID(bb.getLong(), bb.getLong()); - } - - public UUID getPublicId() { - return publicId; - } - - public UUID getSecretId() { - return secretId; - } - - public THandleIdentifier toTHandleIdentifier() { - byte[] guid = new byte[16]; - byte[] secret = new byte[16]; - ByteBuffer guidBB = ByteBuffer.wrap(guid); - ByteBuffer secretBB = ByteBuffer.wrap(secret); - guidBB.putLong(publicId.getMostSignificantBits()); - guidBB.putLong(publicId.getLeastSignificantBits()); - secretBB.putLong(secretId.getMostSignificantBits()); - secretBB.putLong(secretId.getLeastSignificantBits()); - return new THandleIdentifier(ByteBuffer.wrap(guid), ByteBuffer.wrap(secret)); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((publicId == null) ? 0 : publicId.hashCode()); - result = prime * result + ((secretId == null) ? 0 : secretId.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (!(obj instanceof HandleIdentifier)) { - return false; - } - HandleIdentifier other = (HandleIdentifier) obj; - if (publicId == null) { - if (other.publicId != null) { - return false; - } - } else if (!publicId.equals(other.publicId)) { - return false; - } - if (secretId == null) { - if (other.secretId != null) { - return false; - } - } else if (!secretId.equals(other.secretId)) { - return false; - } - return true; - } - - @Override - public String toString() { - return publicId.toString(); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/HiveSQLException.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/HiveSQLException.java deleted file mode 100644 index 86e57fbf31fe0..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/HiveSQLException.java +++ /dev/null @@ -1,249 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; - -import org.apache.hive.service.cli.thrift.TStatus; -import org.apache.hive.service.cli.thrift.TStatusCode; - -/** - * HiveSQLException. - * - */ -public class HiveSQLException extends SQLException { - - /** - * - */ - private static final long serialVersionUID = -6095254671958748094L; - - /** - * - */ - public HiveSQLException() { - super(); - } - - /** - * @param reason - */ - public HiveSQLException(String reason) { - super(reason); - } - - /** - * @param cause - */ - public HiveSQLException(Throwable cause) { - super(cause); - } - - /** - * @param reason - * @param sqlState - */ - public HiveSQLException(String reason, String sqlState) { - super(reason, sqlState); - } - - /** - * @param reason - * @param cause - */ - public HiveSQLException(String reason, Throwable cause) { - super(reason, cause); - } - - /** - * @param reason - * @param sqlState - * @param vendorCode - */ - public HiveSQLException(String reason, String sqlState, int vendorCode) { - super(reason, sqlState, vendorCode); - } - - /** - * @param reason - * @param sqlState - * @param cause - */ - public HiveSQLException(String reason, String sqlState, Throwable cause) { - super(reason, sqlState, cause); - } - - /** - * @param reason - * @param sqlState - * @param vendorCode - * @param cause - */ - public HiveSQLException(String reason, String sqlState, int vendorCode, Throwable cause) { - super(reason, sqlState, vendorCode, cause); - } - - public HiveSQLException(TStatus status) { - // TODO: set correct vendorCode field - super(status.getErrorMessage(), status.getSqlState(), status.getErrorCode()); - if (status.getInfoMessages() != null) { - initCause(toCause(status.getInfoMessages())); - } - } - - /** - * Converts current object to a {@link TStatus} object - * @return a {@link TStatus} object - */ - public TStatus toTStatus() { - // TODO: convert sqlState, etc. - TStatus tStatus = new TStatus(TStatusCode.ERROR_STATUS); - tStatus.setSqlState(getSQLState()); - tStatus.setErrorCode(getErrorCode()); - tStatus.setErrorMessage(getMessage()); - tStatus.setInfoMessages(toString(this)); - return tStatus; - } - - /** - * Converts the specified {@link Exception} object into a {@link TStatus} object - * @param e a {@link Exception} object - * @return a {@link TStatus} object - */ - public static TStatus toTStatus(Exception e) { - if (e instanceof HiveSQLException) { - return ((HiveSQLException)e).toTStatus(); - } - TStatus tStatus = new TStatus(TStatusCode.ERROR_STATUS); - tStatus.setErrorMessage(e.getMessage()); - tStatus.setInfoMessages(toString(e)); - return tStatus; - } - - /** - * Converts a {@link Throwable} object into a flattened list of texts including its stack trace - * and the stack traces of the nested causes. - * @param ex a {@link Throwable} object - * @return a flattened list of texts including the {@link Throwable} object's stack trace - * and the stack traces of the nested causes. - */ - public static List toString(Throwable ex) { - return toString(ex, null); - } - - private static List toString(Throwable cause, StackTraceElement[] parent) { - StackTraceElement[] trace = cause.getStackTrace(); - int m = trace.length - 1; - if (parent != null) { - int n = parent.length - 1; - while (m >= 0 && n >= 0 && trace[m].equals(parent[n])) { - m--; - n--; - } - } - List detail = enroll(cause, trace, m); - cause = cause.getCause(); - if (cause != null) { - detail.addAll(toString(cause, trace)); - } - return detail; - } - - private static List enroll(Throwable ex, StackTraceElement[] trace, int max) { - List details = new ArrayList(); - StringBuilder builder = new StringBuilder(); - builder.append('*').append(ex.getClass().getName()).append(':'); - builder.append(ex.getMessage()).append(':'); - builder.append(trace.length).append(':').append(max); - details.add(builder.toString()); - for (int i = 0; i <= max; i++) { - builder.setLength(0); - builder.append(trace[i].getClassName()).append(':'); - builder.append(trace[i].getMethodName()).append(':'); - String fileName = trace[i].getFileName(); - builder.append(fileName == null ? "" : fileName).append(':'); - builder.append(trace[i].getLineNumber()); - details.add(builder.toString()); - } - return details; - } - - /** - * Converts a flattened list of texts including the stack trace and the stack - * traces of the nested causes into a {@link Throwable} object. - * @param details a flattened list of texts including the stack trace and the stack - * traces of the nested causes - * @return a {@link Throwable} object - */ - public static Throwable toCause(List details) { - return toStackTrace(details, null, 0); - } - - private static Throwable toStackTrace(List details, StackTraceElement[] parent, int index) { - String detail = details.get(index++); - if (!detail.startsWith("*")) { - return null; // should not be happened. ignore remaining - } - int i1 = detail.indexOf(':'); - int i3 = detail.lastIndexOf(':'); - int i2 = detail.substring(0, i3).lastIndexOf(':'); - String exceptionClass = detail.substring(1, i1); - String exceptionMessage = detail.substring(i1 + 1, i2); - Throwable ex = newInstance(exceptionClass, exceptionMessage); - - Integer length = Integer.valueOf(detail.substring(i2 + 1, i3)); - Integer unique = Integer.valueOf(detail.substring(i3 + 1)); - - int i = 0; - StackTraceElement[] trace = new StackTraceElement[length]; - for (; i <= unique; i++) { - detail = details.get(index++); - int j1 = detail.indexOf(':'); - int j3 = detail.lastIndexOf(':'); - int j2 = detail.substring(0, j3).lastIndexOf(':'); - String className = detail.substring(0, j1); - String methodName = detail.substring(j1 + 1, j2); - String fileName = detail.substring(j2 + 1, j3); - if (fileName.isEmpty()) { - fileName = null; - } - int lineNumber = Integer.valueOf(detail.substring(j3 + 1)); - trace[i] = new StackTraceElement(className, methodName, fileName, lineNumber); - } - int common = trace.length - i; - if (common > 0) { - System.arraycopy(parent, parent.length - common, trace, trace.length - common, common); - } - if (details.size() > index) { - ex.initCause(toStackTrace(details, trace, index)); - } - ex.setStackTrace(trace); - return ex; - } - - private static Throwable newInstance(String className, String message) { - try { - return (Throwable)Class.forName(className).getConstructor(String.class).newInstance(message); - } catch (Exception e) { - return new RuntimeException(className + ":" + message); - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/ICLIService.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/ICLIService.java deleted file mode 100644 index c9cc1f4da56f1..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/ICLIService.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * 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. - */ -package org.apache.hive.service.cli; - -import java.util.List; -import java.util.Map; - - - - -import org.apache.hive.service.auth.HiveAuthFactory; - -public interface ICLIService { - - SessionHandle openSession(String username, String password, - Map configuration) - throws HiveSQLException; - - SessionHandle openSessionWithImpersonation(String username, String password, - Map configuration, String delegationToken) - throws HiveSQLException; - - void closeSession(SessionHandle sessionHandle) - throws HiveSQLException; - - GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) - throws HiveSQLException; - - OperationHandle executeStatement(SessionHandle sessionHandle, String statement, - Map confOverlay) - throws HiveSQLException; - - OperationHandle executeStatementAsync(SessionHandle sessionHandle, - String statement, Map confOverlay) - throws HiveSQLException; - - OperationHandle getTypeInfo(SessionHandle sessionHandle) - throws HiveSQLException; - - OperationHandle getCatalogs(SessionHandle sessionHandle) - throws HiveSQLException; - - OperationHandle getSchemas(SessionHandle sessionHandle, - String catalogName, String schemaName) - throws HiveSQLException; - - OperationHandle getTables(SessionHandle sessionHandle, - String catalogName, String schemaName, String tableName, List tableTypes) - throws HiveSQLException; - - OperationHandle getTableTypes(SessionHandle sessionHandle) - throws HiveSQLException; - - OperationHandle getColumns(SessionHandle sessionHandle, - String catalogName, String schemaName, String tableName, String columnName) - throws HiveSQLException; - - OperationHandle getFunctions(SessionHandle sessionHandle, - String catalogName, String schemaName, String functionName) - throws HiveSQLException; - - OperationStatus getOperationStatus(OperationHandle opHandle) - throws HiveSQLException; - - void cancelOperation(OperationHandle opHandle) - throws HiveSQLException; - - void closeOperation(OperationHandle opHandle) - throws HiveSQLException; - - TableSchema getResultSetMetadata(OperationHandle opHandle) - throws HiveSQLException; - - RowSet fetchResults(OperationHandle opHandle) - throws HiveSQLException; - - RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, - long maxRows, FetchType fetchType) throws HiveSQLException; - - String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String owner, String renewer) throws HiveSQLException; - - void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException; - - void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException; - - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/OperationHandle.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/OperationHandle.java deleted file mode 100644 index 5426e28471239..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/OperationHandle.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * 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. - */ -package org.apache.hive.service.cli; - -import org.apache.hive.service.cli.thrift.TOperationHandle; -import org.apache.hive.service.cli.thrift.TProtocolVersion; - -public class OperationHandle extends Handle { - - private final OperationType opType; - private final TProtocolVersion protocol; - private boolean hasResultSet = false; - - public OperationHandle(OperationType opType, TProtocolVersion protocol) { - super(); - this.opType = opType; - this.protocol = protocol; - } - - // dummy handle for ThriftCLIService - public OperationHandle(TOperationHandle tOperationHandle) { - this(tOperationHandle, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1); - } - - public OperationHandle(TOperationHandle tOperationHandle, TProtocolVersion protocol) { - super(tOperationHandle.getOperationId()); - this.opType = OperationType.getOperationType(tOperationHandle.getOperationType()); - this.hasResultSet = tOperationHandle.isHasResultSet(); - this.protocol = protocol; - } - - public OperationType getOperationType() { - return opType; - } - - public void setHasResultSet(boolean hasResultSet) { - this.hasResultSet = hasResultSet; - } - - public boolean hasResultSet() { - return hasResultSet; - } - - public TOperationHandle toTOperationHandle() { - TOperationHandle tOperationHandle = new TOperationHandle(); - tOperationHandle.setOperationId(getHandleIdentifier().toTHandleIdentifier()); - tOperationHandle.setOperationType(opType.toTOperationType()); - tOperationHandle.setHasResultSet(hasResultSet); - return tOperationHandle; - } - - public TProtocolVersion getProtocolVersion() { - return protocol; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + ((opType == null) ? 0 : opType.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - if (!(obj instanceof OperationHandle)) { - return false; - } - OperationHandle other = (OperationHandle) obj; - if (opType != other.opType) { - return false; - } - return true; - } - - @Override - public String toString() { - return "OperationHandle [opType=" + opType + ", getHandleIdentifier()=" + getHandleIdentifier() - + "]"; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/OperationState.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/OperationState.java deleted file mode 100644 index 1165180118413..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/OperationState.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import org.apache.hive.service.cli.thrift.TOperationState; - -/** - * OperationState. - * - */ -public enum OperationState { - INITIALIZED(TOperationState.INITIALIZED_STATE, false), - RUNNING(TOperationState.RUNNING_STATE, false), - FINISHED(TOperationState.FINISHED_STATE, true), - CANCELED(TOperationState.CANCELED_STATE, true), - CLOSED(TOperationState.CLOSED_STATE, true), - ERROR(TOperationState.ERROR_STATE, true), - UNKNOWN(TOperationState.UKNOWN_STATE, false), - PENDING(TOperationState.PENDING_STATE, false); - - private final TOperationState tOperationState; - private final boolean terminal; - - OperationState(TOperationState tOperationState, boolean terminal) { - this.tOperationState = tOperationState; - this.terminal = terminal; - } - - // must be sync with TOperationState in order - public static OperationState getOperationState(TOperationState tOperationState) { - return OperationState.values()[tOperationState.getValue()]; - } - - public static void validateTransition(OperationState oldState, - OperationState newState) - throws HiveSQLException { - switch (oldState) { - case INITIALIZED: - switch (newState) { - case PENDING: - case RUNNING: - case CANCELED: - case CLOSED: - return; - } - break; - case PENDING: - switch (newState) { - case RUNNING: - case FINISHED: - case CANCELED: - case ERROR: - case CLOSED: - return; - } - break; - case RUNNING: - switch (newState) { - case FINISHED: - case CANCELED: - case ERROR: - case CLOSED: - return; - } - break; - case FINISHED: - case CANCELED: - case ERROR: - if (OperationState.CLOSED.equals(newState)) { - return; - } - break; - default: - // fall-through - } - throw new HiveSQLException("Illegal Operation state transition " + - "from " + oldState + " to " + newState); - } - - public void validateTransition(OperationState newState) - throws HiveSQLException { - validateTransition(this, newState); - } - - public TOperationState toTOperationState() { - return tOperationState; - } - - public boolean isTerminal() { - return terminal; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/OperationType.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/OperationType.java deleted file mode 100644 index 429d9a4c25688..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/OperationType.java +++ /dev/null @@ -1,58 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import org.apache.hive.service.cli.thrift.TOperationType; - -/** - * OperationType. - * - */ -public enum OperationType { - - UNKNOWN_OPERATION(TOperationType.UNKNOWN), - EXECUTE_STATEMENT(TOperationType.EXECUTE_STATEMENT), - GET_TYPE_INFO(TOperationType.GET_TYPE_INFO), - GET_CATALOGS(TOperationType.GET_CATALOGS), - GET_SCHEMAS(TOperationType.GET_SCHEMAS), - GET_TABLES(TOperationType.GET_TABLES), - GET_TABLE_TYPES(TOperationType.GET_TABLE_TYPES), - GET_COLUMNS(TOperationType.GET_COLUMNS), - GET_FUNCTIONS(TOperationType.GET_FUNCTIONS); - - private TOperationType tOperationType; - - OperationType(TOperationType tOpType) { - this.tOperationType = tOpType; - } - - public static OperationType getOperationType(TOperationType tOperationType) { - // TODO: replace this with a Map? - for (OperationType opType : values()) { - if (tOperationType.equals(opType.tOperationType)) { - return opType; - } - } - return OperationType.UNKNOWN_OPERATION; - } - - public TOperationType toTOperationType() { - return tOperationType; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/PatternOrIdentifier.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/PatternOrIdentifier.java deleted file mode 100644 index 6e4d43fd5df63..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/PatternOrIdentifier.java +++ /dev/null @@ -1,47 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -/** - * PatternOrIdentifier. - * - */ -public class PatternOrIdentifier { - - boolean isPattern = false; - String text; - - public PatternOrIdentifier(String tpoi) { - text = tpoi; - isPattern = false; - } - - public boolean isPattern() { - return isPattern; - } - - public boolean isIdentifier() { - return !isPattern; - } - - @Override - public String toString() { - return text; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/RowBasedSet.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/RowBasedSet.java deleted file mode 100644 index 7452137f077db..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/RowBasedSet.java +++ /dev/null @@ -1,140 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -import org.apache.hive.service.cli.thrift.TColumnValue; -import org.apache.hive.service.cli.thrift.TRow; -import org.apache.hive.service.cli.thrift.TRowSet; - -/** - * RowBasedSet - */ -public class RowBasedSet implements RowSet { - - private long startOffset; - - private final Type[] types; // non-null only for writing (server-side) - private final RemovableList rows; - - public RowBasedSet(TableSchema schema) { - types = schema.toTypes(); - rows = new RemovableList(); - } - - public RowBasedSet(TRowSet tRowSet) { - types = null; - rows = new RemovableList(tRowSet.getRows()); - startOffset = tRowSet.getStartRowOffset(); - } - - private RowBasedSet(Type[] types, List rows, long startOffset) { - this.types = types; - this.rows = new RemovableList(rows); - this.startOffset = startOffset; - } - - @Override - public RowBasedSet addRow(Object[] fields) { - TRow tRow = new TRow(); - for (int i = 0; i < fields.length; i++) { - tRow.addToColVals(ColumnValue.toTColumnValue(types[i], fields[i])); - } - rows.add(tRow); - return this; - } - - @Override - public int numColumns() { - return rows.isEmpty() ? 0 : rows.get(0).getColVals().size(); - } - - @Override - public int numRows() { - return rows.size(); - } - - public RowBasedSet extractSubset(int maxRows) { - int numRows = Math.min(numRows(), maxRows); - RowBasedSet result = new RowBasedSet(types, rows.subList(0, numRows), startOffset); - rows.removeRange(0, numRows); - startOffset += numRows; - return result; - } - - public long getStartOffset() { - return startOffset; - } - - public void setStartOffset(long startOffset) { - this.startOffset = startOffset; - } - - public int getSize() { - return rows.size(); - } - - public TRowSet toTRowSet() { - TRowSet tRowSet = new TRowSet(); - tRowSet.setStartRowOffset(startOffset); - tRowSet.setRows(new ArrayList(rows)); - return tRowSet; - } - - @Override - public Iterator iterator() { - return new Iterator() { - - final Iterator iterator = rows.iterator(); - final Object[] convey = new Object[numColumns()]; - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public Object[] next() { - TRow row = iterator.next(); - List values = row.getColVals(); - for (int i = 0; i < values.size(); i++) { - convey[i] = ColumnValue.toColumnValue(values.get(i)); - } - return convey; - } - - @Override - public void remove() { - throw new UnsupportedOperationException("remove"); - } - }; - } - - private static class RemovableList extends ArrayList { - RemovableList() { super(); } - RemovableList(List rows) { super(rows); } - @Override - public void removeRange(int fromIndex, int toIndex) { - super.removeRange(fromIndex, toIndex); - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/RowSet.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/RowSet.java deleted file mode 100644 index ab0787e1d389e..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/RowSet.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import org.apache.hive.service.cli.thrift.TRowSet; - -public interface RowSet extends Iterable { - - RowSet addRow(Object[] fields); - - RowSet extractSubset(int maxRows); - - int numColumns(); - - int numRows(); - - long getStartOffset(); - - void setStartOffset(long startOffset); - - TRowSet toTRowSet(); -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/RowSetFactory.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/RowSetFactory.java deleted file mode 100644 index e8f68eaaf9063..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/RowSetFactory.java +++ /dev/null @@ -1,41 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import org.apache.hive.service.cli.thrift.TProtocolVersion; -import org.apache.hive.service.cli.thrift.TRowSet; - -import static org.apache.hive.service.cli.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V6; - -public class RowSetFactory { - - public static RowSet create(TableSchema schema, TProtocolVersion version) { - if (version.getValue() >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue()) { - return new ColumnBasedSet(schema); - } - return new RowBasedSet(schema); - } - - public static RowSet create(TRowSet results, TProtocolVersion version) { - if (version.getValue() >= HIVE_CLI_SERVICE_PROTOCOL_V6.getValue()) { - return new ColumnBasedSet(results); - } - return new RowBasedSet(results); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/SessionHandle.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/SessionHandle.java deleted file mode 100644 index 52e0ad4834d8b..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/SessionHandle.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.util.UUID; - -import org.apache.hive.service.cli.thrift.TProtocolVersion; -import org.apache.hive.service.cli.thrift.TSessionHandle; - - -/** - * SessionHandle. - * - */ -public class SessionHandle extends Handle { - - private final TProtocolVersion protocol; - - public SessionHandle(TProtocolVersion protocol) { - this.protocol = protocol; - } - - // dummy handle for ThriftCLIService - public SessionHandle(TSessionHandle tSessionHandle) { - this(tSessionHandle, TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V1); - } - - public SessionHandle(TSessionHandle tSessionHandle, TProtocolVersion protocol) { - super(tSessionHandle.getSessionId()); - this.protocol = protocol; - } - - public UUID getSessionId() { - return getHandleIdentifier().getPublicId(); - } - - public TSessionHandle toTSessionHandle() { - TSessionHandle tSessionHandle = new TSessionHandle(); - tSessionHandle.setSessionId(getHandleIdentifier().toTHandleIdentifier()); - return tSessionHandle; - } - - public TProtocolVersion getProtocolVersion() { - return protocol; - } - - @Override - public String toString() { - return "SessionHandle [" + getHandleIdentifier() + "]"; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/TableSchema.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/TableSchema.java deleted file mode 100644 index ee019bc737101..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/TableSchema.java +++ /dev/null @@ -1,102 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.hadoop.hive.metastore.api.FieldSchema; -import org.apache.hadoop.hive.metastore.api.Schema; -import org.apache.hive.service.cli.thrift.TColumnDesc; -import org.apache.hive.service.cli.thrift.TTableSchema; - -/** - * TableSchema. - * - */ -public class TableSchema { - private final List columns = new ArrayList(); - - public TableSchema() { - } - - public TableSchema(int numColumns) { - // TODO: remove this constructor - } - - public TableSchema(TTableSchema tTableSchema) { - for (TColumnDesc tColumnDesc : tTableSchema.getColumns()) { - columns.add(new ColumnDescriptor(tColumnDesc)); - } - } - - public TableSchema(List fieldSchemas) { - int pos = 1; - for (FieldSchema field : fieldSchemas) { - columns.add(new ColumnDescriptor(field, pos++)); - } - } - - public TableSchema(Schema schema) { - this(schema.getFieldSchemas()); - } - - public List getColumnDescriptors() { - return new ArrayList(columns); - } - - public ColumnDescriptor getColumnDescriptorAt(int pos) { - return columns.get(pos); - } - - public int getSize() { - return columns.size(); - } - - public void clear() { - columns.clear(); - } - - - public TTableSchema toTTableSchema() { - TTableSchema tTableSchema = new TTableSchema(); - for (ColumnDescriptor col : columns) { - tTableSchema.addToColumns(col.toTColumnDesc()); - } - return tTableSchema; - } - - public Type[] toTypes() { - Type[] types = new Type[columns.size()]; - for (int i = 0; i < types.length; i++) { - types[i] = columns.get(i).getType(); - } - return types; - } - - public TableSchema addPrimitiveColumn(String columnName, Type columnType, String columnComment) { - columns.add(ColumnDescriptor.newPrimitiveColumnDescriptor(columnName, columnComment, columnType, columns.size() + 1)); - return this; - } - - public TableSchema addStringColumn(String columnName, String columnComment) { - columns.add(ColumnDescriptor.newPrimitiveColumnDescriptor(columnName, columnComment, Type.STRING_TYPE, columns.size() + 1)); - return this; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/Type.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/Type.java deleted file mode 100644 index 7752ec03a29b7..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/Type.java +++ /dev/null @@ -1,349 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.sql.DatabaseMetaData; -import java.util.Locale; - -import org.apache.hadoop.hive.common.type.HiveDecimal; -import org.apache.hive.service.cli.thrift.TTypeId; - -/** - * Type. - * - */ -public enum Type { - NULL_TYPE("VOID", - java.sql.Types.NULL, - TTypeId.NULL_TYPE), - BOOLEAN_TYPE("BOOLEAN", - java.sql.Types.BOOLEAN, - TTypeId.BOOLEAN_TYPE), - TINYINT_TYPE("TINYINT", - java.sql.Types.TINYINT, - TTypeId.TINYINT_TYPE), - SMALLINT_TYPE("SMALLINT", - java.sql.Types.SMALLINT, - TTypeId.SMALLINT_TYPE), - INT_TYPE("INT", - java.sql.Types.INTEGER, - TTypeId.INT_TYPE), - BIGINT_TYPE("BIGINT", - java.sql.Types.BIGINT, - TTypeId.BIGINT_TYPE), - FLOAT_TYPE("FLOAT", - java.sql.Types.FLOAT, - TTypeId.FLOAT_TYPE), - DOUBLE_TYPE("DOUBLE", - java.sql.Types.DOUBLE, - TTypeId.DOUBLE_TYPE), - STRING_TYPE("STRING", - java.sql.Types.VARCHAR, - TTypeId.STRING_TYPE), - CHAR_TYPE("CHAR", - java.sql.Types.CHAR, - TTypeId.CHAR_TYPE, - true, false, false), - VARCHAR_TYPE("VARCHAR", - java.sql.Types.VARCHAR, - TTypeId.VARCHAR_TYPE, - true, false, false), - DATE_TYPE("DATE", - java.sql.Types.DATE, - TTypeId.DATE_TYPE), - TIMESTAMP_TYPE("TIMESTAMP", - java.sql.Types.TIMESTAMP, - TTypeId.TIMESTAMP_TYPE), - INTERVAL_YEAR_MONTH_TYPE("INTERVAL_YEAR_MONTH", - java.sql.Types.OTHER, - TTypeId.INTERVAL_YEAR_MONTH_TYPE), - INTERVAL_DAY_TIME_TYPE("INTERVAL_DAY_TIME", - java.sql.Types.OTHER, - TTypeId.INTERVAL_DAY_TIME_TYPE), - BINARY_TYPE("BINARY", - java.sql.Types.BINARY, - TTypeId.BINARY_TYPE), - DECIMAL_TYPE("DECIMAL", - java.sql.Types.DECIMAL, - TTypeId.DECIMAL_TYPE, - true, false, false), - ARRAY_TYPE("ARRAY", - java.sql.Types.ARRAY, - TTypeId.ARRAY_TYPE, - true, true), - MAP_TYPE("MAP", - java.sql.Types.JAVA_OBJECT, - TTypeId.MAP_TYPE, - true, true), - STRUCT_TYPE("STRUCT", - java.sql.Types.STRUCT, - TTypeId.STRUCT_TYPE, - true, false), - UNION_TYPE("UNIONTYPE", - java.sql.Types.OTHER, - TTypeId.UNION_TYPE, - true, false), - USER_DEFINED_TYPE("USER_DEFINED", - java.sql.Types.OTHER, - TTypeId.USER_DEFINED_TYPE, - true, false); - - private final String name; - private final TTypeId tType; - private final int javaSQLType; - private final boolean isQualified; - private final boolean isComplex; - private final boolean isCollection; - - Type(String name, int javaSQLType, TTypeId tType, boolean isQualified, boolean isComplex, boolean isCollection) { - this.name = name; - this.javaSQLType = javaSQLType; - this.tType = tType; - this.isQualified = isQualified; - this.isComplex = isComplex; - this.isCollection = isCollection; - } - - Type(String name, int javaSQLType, TTypeId tType, boolean isComplex, boolean isCollection) { - this(name, javaSQLType, tType, false, isComplex, isCollection); - } - - Type(String name, int javaSqlType, TTypeId tType) { - this(name, javaSqlType, tType, false, false, false); - } - - public boolean isPrimitiveType() { - return !isComplex; - } - - public boolean isQualifiedType() { - return isQualified; - } - - public boolean isComplexType() { - return isComplex; - } - - public boolean isCollectionType() { - return isCollection; - } - - public static Type getType(TTypeId tType) { - for (Type type : values()) { - if (tType.equals(type.tType)) { - return type; - } - } - throw new IllegalArgumentException("Unregonized Thrift TTypeId value: " + tType); - } - - public static Type getType(String name) { - if (name == null) { - throw new IllegalArgumentException("Invalid type name: null"); - } - for (Type type : values()) { - if (name.equalsIgnoreCase(type.name)) { - return type; - } else if (type.isQualifiedType() || type.isComplexType()) { - if (name.toUpperCase(Locale.ROOT).startsWith(type.name)) { - return type; - } - } - } - throw new IllegalArgumentException("Unrecognized type name: " + name); - } - - /** - * Radix for this type (typically either 2 or 10) - * Null is returned for data types where this is not applicable. - */ - public Integer getNumPrecRadix() { - if (this.isNumericType()) { - return 10; - } - return null; - } - - /** - * Maximum precision for numeric types. - * Returns null for non-numeric types. - * @return - */ - public Integer getMaxPrecision() { - switch (this) { - case TINYINT_TYPE: - return 3; - case SMALLINT_TYPE: - return 5; - case INT_TYPE: - return 10; - case BIGINT_TYPE: - return 19; - case FLOAT_TYPE: - return 7; - case DOUBLE_TYPE: - return 15; - case DECIMAL_TYPE: - return HiveDecimal.MAX_PRECISION; - default: - return null; - } - } - - public boolean isNumericType() { - switch (this) { - case TINYINT_TYPE: - case SMALLINT_TYPE: - case INT_TYPE: - case BIGINT_TYPE: - case FLOAT_TYPE: - case DOUBLE_TYPE: - case DECIMAL_TYPE: - return true; - default: - return false; - } - } - - /** - * Prefix used to quote a literal of this type (may be null) - */ - public String getLiteralPrefix() { - return null; - } - - /** - * Suffix used to quote a literal of this type (may be null) - * @return - */ - public String getLiteralSuffix() { - return null; - } - - /** - * Can you use NULL for this type? - * @return - * DatabaseMetaData.typeNoNulls - does not allow NULL values - * DatabaseMetaData.typeNullable - allows NULL values - * DatabaseMetaData.typeNullableUnknown - nullability unknown - */ - public Short getNullable() { - // All Hive types are nullable - return DatabaseMetaData.typeNullable; - } - - /** - * Is the type case sensitive? - * @return - */ - public Boolean isCaseSensitive() { - switch (this) { - case STRING_TYPE: - return true; - default: - return false; - } - } - - /** - * Parameters used in creating the type (may be null) - * @return - */ - public String getCreateParams() { - return null; - } - - /** - * Can you use WHERE based on this type? - * @return - * DatabaseMetaData.typePredNone - No support - * DatabaseMetaData.typePredChar - Only support with WHERE .. LIKE - * DatabaseMetaData.typePredBasic - Supported except for WHERE .. LIKE - * DatabaseMetaData.typeSearchable - Supported for all WHERE .. - */ - public Short getSearchable() { - if (isPrimitiveType()) { - return DatabaseMetaData.typeSearchable; - } - return DatabaseMetaData.typePredNone; - } - - /** - * Is this type unsigned? - * @return - */ - public Boolean isUnsignedAttribute() { - if (isNumericType()) { - return false; - } - return true; - } - - /** - * Can this type represent money? - * @return - */ - public Boolean isFixedPrecScale() { - return false; - } - - /** - * Can this type be used for an auto-increment value? - * @return - */ - public Boolean isAutoIncrement() { - return false; - } - - /** - * Localized version of type name (may be null). - * @return - */ - public String getLocalizedName() { - return null; - } - - /** - * Minimum scale supported for this type - * @return - */ - public Short getMinimumScale() { - return 0; - } - - /** - * Maximum scale supported for this type - * @return - */ - public Short getMaximumScale() { - return 0; - } - - public TTypeId toTType() { - return tType; - } - - public int toJavaSQLType() { - return javaSQLType; - } - - public String getName() { - return name; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java deleted file mode 100644 index b80fd67884add..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/TypeDescriptor.java +++ /dev/null @@ -1,159 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.util.List; - -import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; -import org.apache.hadoop.hive.serde2.typeinfo.TypeInfoFactory; -import org.apache.hive.service.cli.thrift.TPrimitiveTypeEntry; -import org.apache.hive.service.cli.thrift.TTypeDesc; -import org.apache.hive.service.cli.thrift.TTypeEntry; - -/** - * TypeDescriptor. - * - */ -public class TypeDescriptor { - - private final Type type; - private String typeName = null; - private TypeQualifiers typeQualifiers = null; - - public TypeDescriptor(Type type) { - this.type = type; - } - - public TypeDescriptor(TTypeDesc tTypeDesc) { - List tTypeEntries = tTypeDesc.getTypes(); - TPrimitiveTypeEntry top = tTypeEntries.get(0).getPrimitiveEntry(); - this.type = Type.getType(top.getType()); - if (top.isSetTypeQualifiers()) { - setTypeQualifiers(TypeQualifiers.fromTTypeQualifiers(top.getTypeQualifiers())); - } - } - - public TypeDescriptor(String typeName) { - this.type = Type.getType(typeName); - if (this.type.isComplexType()) { - this.typeName = typeName; - } else if (this.type.isQualifiedType()) { - PrimitiveTypeInfo pti = TypeInfoFactory.getPrimitiveTypeInfo(typeName); - setTypeQualifiers(TypeQualifiers.fromTypeInfo(pti)); - } - } - - public Type getType() { - return type; - } - - public TTypeDesc toTTypeDesc() { - TPrimitiveTypeEntry primitiveEntry = new TPrimitiveTypeEntry(type.toTType()); - if (getTypeQualifiers() != null) { - primitiveEntry.setTypeQualifiers(getTypeQualifiers().toTTypeQualifiers()); - } - TTypeEntry entry = TTypeEntry.primitiveEntry(primitiveEntry); - - TTypeDesc desc = new TTypeDesc(); - desc.addToTypes(entry); - return desc; - } - - public String getTypeName() { - if (typeName != null) { - return typeName; - } else { - return type.getName(); - } - } - - public TypeQualifiers getTypeQualifiers() { - return typeQualifiers; - } - - public void setTypeQualifiers(TypeQualifiers typeQualifiers) { - this.typeQualifiers = typeQualifiers; - } - - /** - * The column size for this type. - * For numeric data this is the maximum precision. - * For character data this is the length in characters. - * For datetime types this is the length in characters of the String representation - * (assuming the maximum allowed precision of the fractional seconds component). - * For binary data this is the length in bytes. - * Null is returned for data types where the column size is not applicable. - */ - public Integer getColumnSize() { - if (type.isNumericType()) { - return getPrecision(); - } - switch (type) { - case STRING_TYPE: - case BINARY_TYPE: - return Integer.MAX_VALUE; - case CHAR_TYPE: - case VARCHAR_TYPE: - return typeQualifiers.getCharacterMaximumLength(); - case DATE_TYPE: - return 10; - case TIMESTAMP_TYPE: - return 29; - default: - return null; - } - } - - /** - * Maximum precision for numeric types. - * Returns null for non-numeric types. - * @return - */ - public Integer getPrecision() { - if (this.type == Type.DECIMAL_TYPE) { - return typeQualifiers.getPrecision(); - } - return this.type.getMaxPrecision(); - } - - /** - * The number of fractional digits for this type. - * Null is returned for data types where this is not applicable. - */ - public Integer getDecimalDigits() { - switch (this.type) { - case BOOLEAN_TYPE: - case TINYINT_TYPE: - case SMALLINT_TYPE: - case INT_TYPE: - case BIGINT_TYPE: - return 0; - case FLOAT_TYPE: - return 7; - case DOUBLE_TYPE: - return 15; - case DECIMAL_TYPE: - return typeQualifiers.getScale(); - case TIMESTAMP_TYPE: - return 9; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java deleted file mode 100644 index c6da52c15a2b5..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/TypeQualifiers.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.util.HashMap; -import java.util.Map; - -import org.apache.hadoop.hive.serde2.typeinfo.CharTypeInfo; -import org.apache.hadoop.hive.serde2.typeinfo.DecimalTypeInfo; -import org.apache.hadoop.hive.serde2.typeinfo.PrimitiveTypeInfo; -import org.apache.hadoop.hive.serde2.typeinfo.VarcharTypeInfo; -import org.apache.hive.service.cli.thrift.TCLIServiceConstants; -import org.apache.hive.service.cli.thrift.TTypeQualifierValue; -import org.apache.hive.service.cli.thrift.TTypeQualifiers; - -/** - * This class holds type qualifier information for a primitive type, - * such as char/varchar length or decimal precision/scale. - */ -public class TypeQualifiers { - private Integer characterMaximumLength; - private Integer precision; - private Integer scale; - - public TypeQualifiers() {} - - public Integer getCharacterMaximumLength() { - return characterMaximumLength; - } - public void setCharacterMaximumLength(int characterMaximumLength) { - this.characterMaximumLength = characterMaximumLength; - } - - public TTypeQualifiers toTTypeQualifiers() { - TTypeQualifiers ret = null; - - Map qMap = new HashMap(); - if (getCharacterMaximumLength() != null) { - TTypeQualifierValue val = new TTypeQualifierValue(); - val.setI32Value(getCharacterMaximumLength().intValue()); - qMap.put(TCLIServiceConstants.CHARACTER_MAXIMUM_LENGTH, val); - } - - if (precision != null) { - TTypeQualifierValue val = new TTypeQualifierValue(); - val.setI32Value(precision.intValue()); - qMap.put(TCLIServiceConstants.PRECISION, val); - } - - if (scale != null) { - TTypeQualifierValue val = new TTypeQualifierValue(); - val.setI32Value(scale.intValue()); - qMap.put(TCLIServiceConstants.SCALE, val); - } - - if (qMap.size() > 0) { - ret = new TTypeQualifiers(qMap); - } - - return ret; - } - - public static TypeQualifiers fromTTypeQualifiers(TTypeQualifiers ttq) { - TypeQualifiers ret = null; - if (ttq != null) { - ret = new TypeQualifiers(); - Map tqMap = ttq.getQualifiers(); - - if (tqMap.containsKey(TCLIServiceConstants.CHARACTER_MAXIMUM_LENGTH)) { - ret.setCharacterMaximumLength( - tqMap.get(TCLIServiceConstants.CHARACTER_MAXIMUM_LENGTH).getI32Value()); - } - - if (tqMap.containsKey(TCLIServiceConstants.PRECISION)) { - ret.setPrecision(tqMap.get(TCLIServiceConstants.PRECISION).getI32Value()); - } - - if (tqMap.containsKey(TCLIServiceConstants.SCALE)) { - ret.setScale(tqMap.get(TCLIServiceConstants.SCALE).getI32Value()); - } - } - return ret; - } - - public static TypeQualifiers fromTypeInfo(PrimitiveTypeInfo pti) { - TypeQualifiers result = null; - if (pti instanceof VarcharTypeInfo) { - result = new TypeQualifiers(); - result.setCharacterMaximumLength(((VarcharTypeInfo)pti).getLength()); - } else if (pti instanceof CharTypeInfo) { - result = new TypeQualifiers(); - result.setCharacterMaximumLength(((CharTypeInfo)pti).getLength()); - } else if (pti instanceof DecimalTypeInfo) { - result = new TypeQualifiers(); - result.setPrecision(((DecimalTypeInfo)pti).precision()); - result.setScale(((DecimalTypeInfo)pti).scale()); - } - return result; - } - - public Integer getPrecision() { - return precision; - } - - public void setPrecision(Integer precision) { - this.precision = precision; - } - - public Integer getScale() { - return scale; - } - - public void setScale(Integer scale) { - this.scale = scale; - } - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/ClassicTableTypeMapping.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/ClassicTableTypeMapping.java deleted file mode 100644 index af36057bdaeca..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/ClassicTableTypeMapping.java +++ /dev/null @@ -1,86 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import org.apache.hadoop.hive.metastore.TableType; - -/** - * ClassicTableTypeMapping. - * Classic table type mapping : - * Managed Table to Table - * External Table to Table - * Virtual View to View - */ -public class ClassicTableTypeMapping implements TableTypeMapping { - - public enum ClassicTableTypes { - TABLE, - VIEW, - } - - private final Map hiveToClientMap = new HashMap(); - private final Map clientToHiveMap = new HashMap(); - - public ClassicTableTypeMapping() { - hiveToClientMap.put(TableType.MANAGED_TABLE.toString(), - ClassicTableTypes.TABLE.toString()); - hiveToClientMap.put(TableType.EXTERNAL_TABLE.toString(), - ClassicTableTypes.TABLE.toString()); - hiveToClientMap.put(TableType.VIRTUAL_VIEW.toString(), - ClassicTableTypes.VIEW.toString()); - - clientToHiveMap.put(ClassicTableTypes.TABLE.toString(), - TableType.MANAGED_TABLE.toString()); - clientToHiveMap.put(ClassicTableTypes.VIEW.toString(), - TableType.VIRTUAL_VIEW.toString()); - } - - @Override - public String mapToHiveType(String clientTypeName) { - if (clientToHiveMap.containsKey(clientTypeName)) { - return clientToHiveMap.get(clientTypeName); - } else { - return clientTypeName; - } - } - - @Override - public String mapToClientType(String hiveTypeName) { - if (hiveToClientMap.containsKey(hiveTypeName)) { - return hiveToClientMap.get(hiveTypeName); - } else { - return hiveTypeName; - } - } - - @Override - public Set getTableTypeNames() { - Set typeNameSet = new HashSet(); - for (ClassicTableTypes typeNames : ClassicTableTypes.values()) { - typeNameSet.add(typeNames.toString()); - } - return typeNameSet; - } - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java deleted file mode 100644 index 6740d3bb59dc3..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/ExecuteStatementOperation.java +++ /dev/null @@ -1,83 +0,0 @@ -/** - * 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. - */ -package org.apache.hive.service.cli.operation; - -import java.sql.SQLException; -import java.util.HashMap; -import java.util.Map; - -import org.apache.hadoop.hive.ql.processors.CommandProcessor; -import org.apache.hadoop.hive.ql.processors.CommandProcessorFactory; -import org.apache.hadoop.hive.ql.session.OperationLog; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationType; -import org.apache.hive.service.cli.session.HiveSession; - -public abstract class ExecuteStatementOperation extends Operation { - protected String statement = null; - protected Map confOverlay = new HashMap(); - - public ExecuteStatementOperation(HiveSession parentSession, String statement, - Map confOverlay, boolean runInBackground) { - super(parentSession, OperationType.EXECUTE_STATEMENT, runInBackground); - this.statement = statement; - setConfOverlay(confOverlay); - } - - public String getStatement() { - return statement; - } - - public static ExecuteStatementOperation newExecuteStatementOperation( - HiveSession parentSession, String statement, Map confOverlay, boolean runAsync) - throws HiveSQLException { - String[] tokens = statement.trim().split("\\s+"); - CommandProcessor processor = null; - try { - processor = CommandProcessorFactory.getForHiveCommand(tokens, parentSession.getHiveConf()); - } catch (SQLException e) { - throw new HiveSQLException(e.getMessage(), e.getSQLState(), e); - } - if (processor == null) { - return new SQLOperation(parentSession, statement, confOverlay, runAsync); - } - return new HiveCommandOperation(parentSession, statement, processor, confOverlay); - } - - protected Map getConfOverlay() { - return confOverlay; - } - - protected void setConfOverlay(Map confOverlay) { - if (confOverlay != null) { - this.confOverlay = confOverlay; - } - } - - protected void registerCurrentOperationLog() { - if (isOperationLogEnabled) { - if (operationLog == null) { - LOG.warn("Failed to get current OperationLog object of Operation: " + - getHandle().getHandleIdentifier()); - isOperationLogEnabled = false; - return; - } - OperationLog.setCurrentOperationLog(operationLog); - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java deleted file mode 100644 index 581d975344060..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetCatalogsOperation.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationType; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; - -/** - * GetCatalogsOperation. - * - */ -public class GetCatalogsOperation extends MetadataOperation { - private static final TableSchema RESULT_SET_SCHEMA = new TableSchema() - .addStringColumn("TABLE_CAT", "Catalog name. NULL if not applicable."); - - protected final RowSet rowSet; - - protected GetCatalogsOperation(HiveSession parentSession) { - super(parentSession, OperationType.GET_CATALOGS); - rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion()); - } - - @Override - public void runInternal() throws HiveSQLException { - setState(OperationState.RUNNING); - try { - if (isAuthV2Enabled()) { - authorizeMetaGets(HiveOperationType.GET_CATALOGS, null); - } - setState(OperationState.FINISHED); - } catch (HiveSQLException e) { - setState(OperationState.ERROR); - throw e; - } - - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getResultSetSchema() - */ - @Override - public TableSchema getResultSetSchema() throws HiveSQLException { - return RESULT_SET_SCHEMA; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getNextRowSet(org.apache.hive.service.cli.FetchOrientation, long) - */ - @Override - public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { - assertState(OperationState.FINISHED); - validateDefaultFetchOrientation(orientation); - if (orientation.equals(FetchOrientation.FETCH_FIRST)) { - rowSet.setStartOffset(0); - } - return rowSet.extractSubset((int)maxRows); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java deleted file mode 100644 index 96ba4890075ac..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java +++ /dev/null @@ -1,234 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.sql.DatabaseMetaData; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.regex.Pattern; - -import org.apache.hadoop.hive.metastore.IMetaStoreClient; -import org.apache.hadoop.hive.metastore.api.Table; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject.HivePrivilegeObjectType; -import org.apache.hive.service.cli.ColumnDescriptor; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationType; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.Type; -import org.apache.hive.service.cli.session.HiveSession; - -/** - * GetColumnsOperation. - * - */ -public class GetColumnsOperation extends MetadataOperation { - - protected static final TableSchema RESULT_SET_SCHEMA = new TableSchema() - .addPrimitiveColumn("TABLE_CAT", Type.STRING_TYPE, - "Catalog name. NULL if not applicable") - .addPrimitiveColumn("TABLE_SCHEM", Type.STRING_TYPE, - "Schema name") - .addPrimitiveColumn("TABLE_NAME", Type.STRING_TYPE, - "Table name") - .addPrimitiveColumn("COLUMN_NAME", Type.STRING_TYPE, - "Column name") - .addPrimitiveColumn("DATA_TYPE", Type.INT_TYPE, - "SQL type from java.sql.Types") - .addPrimitiveColumn("TYPE_NAME", Type.STRING_TYPE, - "Data source dependent type name, for a UDT the type name is fully qualified") - .addPrimitiveColumn("COLUMN_SIZE", Type.INT_TYPE, - "Column size. For char or date types this is the maximum number of characters," - + " for numeric or decimal types this is precision.") - .addPrimitiveColumn("BUFFER_LENGTH", Type.TINYINT_TYPE, - "Unused") - .addPrimitiveColumn("DECIMAL_DIGITS", Type.INT_TYPE, - "The number of fractional digits") - .addPrimitiveColumn("NUM_PREC_RADIX", Type.INT_TYPE, - "Radix (typically either 10 or 2)") - .addPrimitiveColumn("NULLABLE", Type.INT_TYPE, - "Is NULL allowed") - .addPrimitiveColumn("REMARKS", Type.STRING_TYPE, - "Comment describing column (may be null)") - .addPrimitiveColumn("COLUMN_DEF", Type.STRING_TYPE, - "Default value (may be null)") - .addPrimitiveColumn("SQL_DATA_TYPE", Type.INT_TYPE, - "Unused") - .addPrimitiveColumn("SQL_DATETIME_SUB", Type.INT_TYPE, - "Unused") - .addPrimitiveColumn("CHAR_OCTET_LENGTH", Type.INT_TYPE, - "For char types the maximum number of bytes in the column") - .addPrimitiveColumn("ORDINAL_POSITION", Type.INT_TYPE, - "Index of column in table (starting at 1)") - .addPrimitiveColumn("IS_NULLABLE", Type.STRING_TYPE, - "\"NO\" means column definitely does not allow NULL values; " - + "\"YES\" means the column might allow NULL values. An empty " - + "string means nobody knows.") - .addPrimitiveColumn("SCOPE_CATALOG", Type.STRING_TYPE, - "Catalog of table that is the scope of a reference attribute " - + "(null if DATA_TYPE isn't REF)") - .addPrimitiveColumn("SCOPE_SCHEMA", Type.STRING_TYPE, - "Schema of table that is the scope of a reference attribute " - + "(null if the DATA_TYPE isn't REF)") - .addPrimitiveColumn("SCOPE_TABLE", Type.STRING_TYPE, - "Table name that this the scope of a reference attribure " - + "(null if the DATA_TYPE isn't REF)") - .addPrimitiveColumn("SOURCE_DATA_TYPE", Type.SMALLINT_TYPE, - "Source type of a distinct type or user-generated Ref type, " - + "SQL type from java.sql.Types (null if DATA_TYPE isn't DISTINCT or user-generated REF)") - .addPrimitiveColumn("IS_AUTO_INCREMENT", Type.STRING_TYPE, - "Indicates whether this column is auto incremented."); - - private final String catalogName; - private final String schemaName; - private final String tableName; - private final String columnName; - - protected final RowSet rowSet; - - protected GetColumnsOperation(HiveSession parentSession, String catalogName, String schemaName, - String tableName, String columnName) { - super(parentSession, OperationType.GET_COLUMNS); - this.catalogName = catalogName; - this.schemaName = schemaName; - this.tableName = tableName; - this.columnName = columnName; - this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion()); - } - - @Override - public void runInternal() throws HiveSQLException { - setState(OperationState.RUNNING); - try { - IMetaStoreClient metastoreClient = getParentSession().getMetaStoreClient(); - String schemaPattern = convertSchemaPattern(schemaName); - String tablePattern = convertIdentifierPattern(tableName, true); - - Pattern columnPattern = null; - if (columnName != null) { - columnPattern = Pattern.compile(convertIdentifierPattern(columnName, false)); - } - - List dbNames = metastoreClient.getDatabases(schemaPattern); - Collections.sort(dbNames); - Map> db2Tabs = new HashMap<>(); - - for (String dbName : dbNames) { - List tableNames = metastoreClient.getTables(dbName, tablePattern); - Collections.sort(tableNames); - db2Tabs.put(dbName, tableNames); - } - - if (isAuthV2Enabled()) { - List privObjs = getPrivObjs(db2Tabs); - String cmdStr = "catalog : " + catalogName + ", schemaPattern : " + schemaName - + ", tablePattern : " + tableName; - authorizeMetaGets(HiveOperationType.GET_COLUMNS, privObjs, cmdStr); - } - - for (Entry> dbTabs : db2Tabs.entrySet()) { - String dbName = dbTabs.getKey(); - List tableNames = dbTabs.getValue(); - for (Table table : metastoreClient.getTableObjectsByName(dbName, tableNames)) { - TableSchema schema = new TableSchema(metastoreClient.getSchema(dbName, table.getTableName())); - for (ColumnDescriptor column : schema.getColumnDescriptors()) { - if (columnPattern != null && !columnPattern.matcher(column.getName()).matches()) { - continue; - } - Object[] rowData = new Object[] { - null, // TABLE_CAT - table.getDbName(), // TABLE_SCHEM - table.getTableName(), // TABLE_NAME - column.getName(), // COLUMN_NAME - column.getType().toJavaSQLType(), // DATA_TYPE - column.getTypeName(), // TYPE_NAME - column.getTypeDescriptor().getColumnSize(), // COLUMN_SIZE - null, // BUFFER_LENGTH, unused - column.getTypeDescriptor().getDecimalDigits(), // DECIMAL_DIGITS - column.getType().getNumPrecRadix(), // NUM_PREC_RADIX - DatabaseMetaData.columnNullable, // NULLABLE - column.getComment(), // REMARKS - null, // COLUMN_DEF - null, // SQL_DATA_TYPE - null, // SQL_DATETIME_SUB - null, // CHAR_OCTET_LENGTH - column.getOrdinalPosition(), // ORDINAL_POSITION - "YES", // IS_NULLABLE - null, // SCOPE_CATALOG - null, // SCOPE_SCHEMA - null, // SCOPE_TABLE - null, // SOURCE_DATA_TYPE - "NO", // IS_AUTO_INCREMENT - }; - rowSet.addRow(rowData); - } - } - } - setState(OperationState.FINISHED); - } catch (Exception e) { - setState(OperationState.ERROR); - throw new HiveSQLException(e); - } - - } - - - private List getPrivObjs(Map> db2Tabs) { - List privObjs = new ArrayList<>(); - for (Entry> dbTabs : db2Tabs.entrySet()) { - for (String tabName : dbTabs.getValue()) { - privObjs.add(new HivePrivilegeObject(HivePrivilegeObjectType.TABLE_OR_VIEW, dbTabs.getKey(), - tabName)); - } - } - return privObjs; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getResultSetSchema() - */ - @Override - public TableSchema getResultSetSchema() throws HiveSQLException { - assertState(OperationState.FINISHED); - return RESULT_SET_SCHEMA; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getNextRowSet(org.apache.hive.service.cli.FetchOrientation, long) - */ - @Override - public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { - assertState(OperationState.FINISHED); - validateDefaultFetchOrientation(orientation); - if (orientation.equals(FetchOrientation.FETCH_FIRST)) { - rowSet.setStartOffset(0); - } - return rowSet.extractSubset((int)maxRows); - } - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java deleted file mode 100644 index 5dec8bdbf45de..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetFunctionsOperation.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.sql.DatabaseMetaData; -import java.util.List; -import java.util.Set; - -import org.apache.hadoop.hive.metastore.IMetaStoreClient; -import org.apache.hadoop.hive.ql.exec.FunctionInfo; -import org.apache.hadoop.hive.ql.exec.FunctionRegistry; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObjectUtils; -import org.apache.hive.service.cli.CLIServiceUtils; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationType; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.Type; -import org.apache.hive.service.cli.session.HiveSession; -import org.apache.thrift.TException; - -/** - * GetFunctionsOperation. - * - */ -public class GetFunctionsOperation extends MetadataOperation { - private static final TableSchema RESULT_SET_SCHEMA = new TableSchema() - .addPrimitiveColumn("FUNCTION_CAT", Type.STRING_TYPE, - "Function catalog (may be null)") - .addPrimitiveColumn("FUNCTION_SCHEM", Type.STRING_TYPE, - "Function schema (may be null)") - .addPrimitiveColumn("FUNCTION_NAME", Type.STRING_TYPE, - "Function name. This is the name used to invoke the function") - .addPrimitiveColumn("REMARKS", Type.STRING_TYPE, - "Explanatory comment on the function") - .addPrimitiveColumn("FUNCTION_TYPE", Type.INT_TYPE, - "Kind of function.") - .addPrimitiveColumn("SPECIFIC_NAME", Type.STRING_TYPE, - "The name which uniquely identifies this function within its schema"); - - private final String catalogName; - private final String schemaName; - private final String functionName; - - protected final RowSet rowSet; - - public GetFunctionsOperation(HiveSession parentSession, - String catalogName, String schemaName, String functionName) { - super(parentSession, OperationType.GET_FUNCTIONS); - this.catalogName = catalogName; - this.schemaName = schemaName; - this.functionName = functionName; - this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion()); - } - - @Override - public void runInternal() throws HiveSQLException { - setState(OperationState.RUNNING); - if (isAuthV2Enabled()) { - // get databases for schema pattern - IMetaStoreClient metastoreClient = getParentSession().getMetaStoreClient(); - String schemaPattern = convertSchemaPattern(schemaName); - List matchingDbs; - try { - matchingDbs = metastoreClient.getDatabases(schemaPattern); - } catch (TException e) { - setState(OperationState.ERROR); - throw new HiveSQLException(e); - } - // authorize this call on the schema objects - List privObjs = HivePrivilegeObjectUtils - .getHivePrivDbObjects(matchingDbs); - String cmdStr = "catalog : " + catalogName + ", schemaPattern : " + schemaName; - authorizeMetaGets(HiveOperationType.GET_FUNCTIONS, privObjs, cmdStr); - } - - try { - if ((null == catalogName || "".equals(catalogName)) - && (null == schemaName || "".equals(schemaName))) { - Set functionNames = FunctionRegistry - .getFunctionNames(CLIServiceUtils.patternToRegex(functionName)); - for (String functionName : functionNames) { - FunctionInfo functionInfo = FunctionRegistry.getFunctionInfo(functionName); - Object[] rowData = new Object[] { - null, // FUNCTION_CAT - null, // FUNCTION_SCHEM - functionInfo.getDisplayName(), // FUNCTION_NAME - "", // REMARKS - (functionInfo.isGenericUDTF() ? - DatabaseMetaData.functionReturnsTable - : DatabaseMetaData.functionNoTable), // FUNCTION_TYPE - functionInfo.getClass().getCanonicalName() - }; - rowSet.addRow(rowData); - } - } - setState(OperationState.FINISHED); - } catch (Exception e) { - setState(OperationState.ERROR); - throw new HiveSQLException(e); - } - } - - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getResultSetSchema() - */ - @Override - public TableSchema getResultSetSchema() throws HiveSQLException { - assertState(OperationState.FINISHED); - return RESULT_SET_SCHEMA; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getNextRowSet(org.apache.hive.service.cli.FetchOrientation, long) - */ - @Override - public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { - assertState(OperationState.FINISHED); - validateDefaultFetchOrientation(orientation); - if (orientation.equals(FetchOrientation.FETCH_FIRST)) { - rowSet.setStartOffset(0); - } - return rowSet.extractSubset((int)maxRows); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java deleted file mode 100644 index 3516bc2ba242c..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetSchemasOperation.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import org.apache.hadoop.hive.metastore.IMetaStoreClient; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationType; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; - -/** - * GetSchemasOperation. - * - */ -public class GetSchemasOperation extends MetadataOperation { - private final String catalogName; - private final String schemaName; - - private static final TableSchema RESULT_SET_SCHEMA = new TableSchema() - .addStringColumn("TABLE_SCHEM", "Schema name.") - .addStringColumn("TABLE_CATALOG", "Catalog name."); - - protected RowSet rowSet; - - protected GetSchemasOperation(HiveSession parentSession, - String catalogName, String schemaName) { - super(parentSession, OperationType.GET_SCHEMAS); - this.catalogName = catalogName; - this.schemaName = schemaName; - this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion()); - } - - @Override - public void runInternal() throws HiveSQLException { - setState(OperationState.RUNNING); - if (isAuthV2Enabled()) { - String cmdStr = "catalog : " + catalogName + ", schemaPattern : " + schemaName; - authorizeMetaGets(HiveOperationType.GET_SCHEMAS, null, cmdStr); - } - try { - IMetaStoreClient metastoreClient = getParentSession().getMetaStoreClient(); - String schemaPattern = convertSchemaPattern(schemaName); - for (String dbName : metastoreClient.getDatabases(schemaPattern)) { - rowSet.addRow(new Object[] {dbName, DEFAULT_HIVE_CATALOG}); - } - setState(OperationState.FINISHED); - } catch (Exception e) { - setState(OperationState.ERROR); - throw new HiveSQLException(e); - } - } - - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getResultSetSchema() - */ - @Override - public TableSchema getResultSetSchema() throws HiveSQLException { - assertState(OperationState.FINISHED); - return RESULT_SET_SCHEMA; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getNextRowSet(org.apache.hive.service.cli.FetchOrientation, long) - */ - @Override - public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { - assertState(OperationState.FINISHED); - validateDefaultFetchOrientation(orientation); - if (orientation.equals(FetchOrientation.FETCH_FIRST)) { - rowSet.setStartOffset(0); - } - return rowSet.extractSubset((int)maxRows); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java deleted file mode 100644 index b372f55cedd1c..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetTableTypesOperation.java +++ /dev/null @@ -1,93 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.TableType; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationType; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; - -/** - * GetTableTypesOperation. - * - */ -public class GetTableTypesOperation extends MetadataOperation { - - protected static TableSchema RESULT_SET_SCHEMA = new TableSchema() - .addStringColumn("TABLE_TYPE", "Table type name."); - - protected final RowSet rowSet; - private final TableTypeMapping tableTypeMapping; - - protected GetTableTypesOperation(HiveSession parentSession) { - super(parentSession, OperationType.GET_TABLE_TYPES); - String tableMappingStr = getParentSession().getHiveConf() - .getVar(HiveConf.ConfVars.HIVE_SERVER2_TABLE_TYPE_MAPPING); - tableTypeMapping = - TableTypeMappingFactory.getTableTypeMapping(tableMappingStr); - rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion()); - } - - @Override - public void runInternal() throws HiveSQLException { - setState(OperationState.RUNNING); - if (isAuthV2Enabled()) { - authorizeMetaGets(HiveOperationType.GET_TABLETYPES, null); - } - try { - for (TableType type : TableType.values()) { - rowSet.addRow(new String[] {tableTypeMapping.mapToClientType(type.toString())}); - } - setState(OperationState.FINISHED); - } catch (Exception e) { - setState(OperationState.ERROR); - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getResultSetSchema() - */ - @Override - public TableSchema getResultSetSchema() throws HiveSQLException { - assertState(OperationState.FINISHED); - return RESULT_SET_SCHEMA; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getNextRowSet(org.apache.hive.service.cli.FetchOrientation, long) - */ - @Override - public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { - assertState(OperationState.FINISHED); - validateDefaultFetchOrientation(orientation); - if (orientation.equals(FetchOrientation.FETCH_FIRST)) { - rowSet.setStartOffset(0); - } - return rowSet.extractSubset((int)maxRows); - } - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java deleted file mode 100644 index 2af17a662a296..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetTablesOperation.java +++ /dev/null @@ -1,135 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.IMetaStoreClient; -import org.apache.hadoop.hive.metastore.api.Table; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObjectUtils; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationType; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; - -/** - * GetTablesOperation. - * - */ -public class GetTablesOperation extends MetadataOperation { - - private final String catalogName; - private final String schemaName; - private final String tableName; - private final List tableTypes = new ArrayList(); - protected final RowSet rowSet; - private final TableTypeMapping tableTypeMapping; - - - private static final TableSchema RESULT_SET_SCHEMA = new TableSchema() - .addStringColumn("TABLE_CAT", "Catalog name. NULL if not applicable.") - .addStringColumn("TABLE_SCHEM", "Schema name.") - .addStringColumn("TABLE_NAME", "Table name.") - .addStringColumn("TABLE_TYPE", "The table type, e.g. \"TABLE\", \"VIEW\", etc.") - .addStringColumn("REMARKS", "Comments about the table."); - - protected GetTablesOperation(HiveSession parentSession, - String catalogName, String schemaName, String tableName, - List tableTypes) { - super(parentSession, OperationType.GET_TABLES); - this.catalogName = catalogName; - this.schemaName = schemaName; - this.tableName = tableName; - String tableMappingStr = getParentSession().getHiveConf() - .getVar(HiveConf.ConfVars.HIVE_SERVER2_TABLE_TYPE_MAPPING); - tableTypeMapping = - TableTypeMappingFactory.getTableTypeMapping(tableMappingStr); - if (tableTypes != null) { - this.tableTypes.addAll(tableTypes); - } - this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion()); - } - - @Override - public void runInternal() throws HiveSQLException { - setState(OperationState.RUNNING); - try { - IMetaStoreClient metastoreClient = getParentSession().getMetaStoreClient(); - String schemaPattern = convertSchemaPattern(schemaName); - List matchingDbs = metastoreClient.getDatabases(schemaPattern); - if(isAuthV2Enabled()){ - List privObjs = HivePrivilegeObjectUtils.getHivePrivDbObjects(matchingDbs); - String cmdStr = "catalog : " + catalogName + ", schemaPattern : " + schemaName; - authorizeMetaGets(HiveOperationType.GET_TABLES, privObjs, cmdStr); - } - - String tablePattern = convertIdentifierPattern(tableName, true); - for (String dbName : metastoreClient.getDatabases(schemaPattern)) { - List tableNames = metastoreClient.getTables(dbName, tablePattern); - for (Table table : metastoreClient.getTableObjectsByName(dbName, tableNames)) { - Object[] rowData = new Object[] { - DEFAULT_HIVE_CATALOG, - table.getDbName(), - table.getTableName(), - tableTypeMapping.mapToClientType(table.getTableType()), - table.getParameters().get("comment") - }; - if (tableTypes.isEmpty() || tableTypes.contains( - tableTypeMapping.mapToClientType(table.getTableType()))) { - rowSet.addRow(rowData); - } - } - } - setState(OperationState.FINISHED); - } catch (Exception e) { - setState(OperationState.ERROR); - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getResultSetSchema() - */ - @Override - public TableSchema getResultSetSchema() throws HiveSQLException { - assertState(OperationState.FINISHED); - return RESULT_SET_SCHEMA; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getNextRowSet(org.apache.hive.service.cli.FetchOrientation, long) - */ - @Override - public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { - assertState(OperationState.FINISHED); - validateDefaultFetchOrientation(orientation); - if (orientation.equals(FetchOrientation.FETCH_FIRST)) { - rowSet.setStartOffset(0); - } - return rowSet.extractSubset((int)maxRows); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java deleted file mode 100644 index 3e81f8afbd85f..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/GetTypeInfoOperation.java +++ /dev/null @@ -1,142 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationType; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.Type; -import org.apache.hive.service.cli.session.HiveSession; - -/** - * GetTypeInfoOperation. - * - */ -public class GetTypeInfoOperation extends MetadataOperation { - - private static final TableSchema RESULT_SET_SCHEMA = new TableSchema() - .addPrimitiveColumn("TYPE_NAME", Type.STRING_TYPE, - "Type name") - .addPrimitiveColumn("DATA_TYPE", Type.INT_TYPE, - "SQL data type from java.sql.Types") - .addPrimitiveColumn("PRECISION", Type.INT_TYPE, - "Maximum precision") - .addPrimitiveColumn("LITERAL_PREFIX", Type.STRING_TYPE, - "Prefix used to quote a literal (may be null)") - .addPrimitiveColumn("LITERAL_SUFFIX", Type.STRING_TYPE, - "Suffix used to quote a literal (may be null)") - .addPrimitiveColumn("CREATE_PARAMS", Type.STRING_TYPE, - "Parameters used in creating the type (may be null)") - .addPrimitiveColumn("NULLABLE", Type.SMALLINT_TYPE, - "Can you use NULL for this type") - .addPrimitiveColumn("CASE_SENSITIVE", Type.BOOLEAN_TYPE, - "Is it case sensitive") - .addPrimitiveColumn("SEARCHABLE", Type.SMALLINT_TYPE, - "Can you use \"WHERE\" based on this type") - .addPrimitiveColumn("UNSIGNED_ATTRIBUTE", Type.BOOLEAN_TYPE, - "Is it unsigned") - .addPrimitiveColumn("FIXED_PREC_SCALE", Type.BOOLEAN_TYPE, - "Can it be a money value") - .addPrimitiveColumn("AUTO_INCREMENT", Type.BOOLEAN_TYPE, - "Can it be used for an auto-increment value") - .addPrimitiveColumn("LOCAL_TYPE_NAME", Type.STRING_TYPE, - "Localized version of type name (may be null)") - .addPrimitiveColumn("MINIMUM_SCALE", Type.SMALLINT_TYPE, - "Minimum scale supported") - .addPrimitiveColumn("MAXIMUM_SCALE", Type.SMALLINT_TYPE, - "Maximum scale supported") - .addPrimitiveColumn("SQL_DATA_TYPE", Type.INT_TYPE, - "Unused") - .addPrimitiveColumn("SQL_DATETIME_SUB", Type.INT_TYPE, - "Unused") - .addPrimitiveColumn("NUM_PREC_RADIX", Type.INT_TYPE, - "Usually 2 or 10"); - - protected final RowSet rowSet; - - protected GetTypeInfoOperation(HiveSession parentSession) { - super(parentSession, OperationType.GET_TYPE_INFO); - rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion()); - } - - @Override - public void runInternal() throws HiveSQLException { - setState(OperationState.RUNNING); - if (isAuthV2Enabled()) { - authorizeMetaGets(HiveOperationType.GET_TYPEINFO, null); - } - try { - for (Type type : Type.values()) { - Object[] rowData = new Object[] { - type.getName(), // TYPE_NAME - type.toJavaSQLType(), // DATA_TYPE - type.getMaxPrecision(), // PRECISION - type.getLiteralPrefix(), // LITERAL_PREFIX - type.getLiteralSuffix(), // LITERAL_SUFFIX - type.getCreateParams(), // CREATE_PARAMS - type.getNullable(), // NULLABLE - type.isCaseSensitive(), // CASE_SENSITIVE - type.getSearchable(), // SEARCHABLE - type.isUnsignedAttribute(), // UNSIGNED_ATTRIBUTE - type.isFixedPrecScale(), // FIXED_PREC_SCALE - type.isAutoIncrement(), // AUTO_INCREMENT - type.getLocalizedName(), // LOCAL_TYPE_NAME - type.getMinimumScale(), // MINIMUM_SCALE - type.getMaximumScale(), // MAXIMUM_SCALE - null, // SQL_DATA_TYPE, unused - null, // SQL_DATETIME_SUB, unused - type.getNumPrecRadix() //NUM_PREC_RADIX - }; - rowSet.addRow(rowData); - } - setState(OperationState.FINISHED); - } catch (Exception e) { - setState(OperationState.ERROR); - throw new HiveSQLException(e); - } - } - - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getResultSetSchema() - */ - @Override - public TableSchema getResultSetSchema() throws HiveSQLException { - assertState(OperationState.FINISHED); - return RESULT_SET_SCHEMA; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getNextRowSet(org.apache.hive.service.cli.FetchOrientation, long) - */ - @Override - public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { - assertState(OperationState.FINISHED); - validateDefaultFetchOrientation(orientation); - if (orientation.equals(FetchOrientation.FETCH_FIRST)) { - rowSet.setStartOffset(0); - } - return rowSet.extractSubset((int)maxRows); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java deleted file mode 100644 index 5b6e6ad042412..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/HiveCommandOperation.java +++ /dev/null @@ -1,215 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.PrintStream; -import java.io.UnsupportedEncodingException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -import static java.nio.charset.StandardCharsets.UTF_8; - -import org.apache.hadoop.hive.metastore.api.Schema; -import org.apache.hadoop.hive.ql.processors.CommandProcessor; -import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; -import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hadoop.io.IOUtils; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; - -/** - * Executes a HiveCommand - */ -public class HiveCommandOperation extends ExecuteStatementOperation { - private CommandProcessor commandProcessor; - private TableSchema resultSchema = null; - - /** - * For processors other than Hive queries (Driver), they output to session.out (a temp file) - * first and the fetchOne/fetchN/fetchAll functions get the output from pipeIn. - */ - private BufferedReader resultReader; - - - protected HiveCommandOperation(HiveSession parentSession, String statement, - CommandProcessor commandProcessor, Map confOverlay) { - super(parentSession, statement, confOverlay, false); - this.commandProcessor = commandProcessor; - setupSessionIO(parentSession.getSessionState()); - } - - private void setupSessionIO(SessionState sessionState) { - try { - LOG.info("Putting temp output to file " + sessionState.getTmpOutputFile().toString()); - sessionState.in = null; // hive server's session input stream is not used - // open a per-session file in auto-flush mode for writing temp results - sessionState.out = new PrintStream(new FileOutputStream(sessionState.getTmpOutputFile()), true, UTF_8.name()); - // TODO: for hadoop jobs, progress is printed out to session.err, - // we should find a way to feed back job progress to client - sessionState.err = new PrintStream(System.err, true, UTF_8.name()); - } catch (IOException e) { - LOG.error("Error in creating temp output file ", e); - try { - sessionState.in = null; - sessionState.out = new PrintStream(System.out, true, UTF_8.name()); - sessionState.err = new PrintStream(System.err, true, UTF_8.name()); - } catch (UnsupportedEncodingException ee) { - LOG.error("Error creating PrintStream", e); - ee.printStackTrace(); - sessionState.out = null; - sessionState.err = null; - } - } - } - - - private void tearDownSessionIO() { - IOUtils.cleanup(LOG, parentSession.getSessionState().out); - IOUtils.cleanup(LOG, parentSession.getSessionState().err); - } - - @Override - public void runInternal() throws HiveSQLException { - setState(OperationState.RUNNING); - try { - String command = getStatement().trim(); - String[] tokens = statement.split("\\s"); - String commandArgs = command.substring(tokens[0].length()).trim(); - - CommandProcessorResponse response = commandProcessor.run(commandArgs); - int returnCode = response.getResponseCode(); - if (returnCode != 0) { - throw toSQLException("Error while processing statement", response); - } - Schema schema = response.getSchema(); - if (schema != null) { - setHasResultSet(true); - resultSchema = new TableSchema(schema); - } else { - setHasResultSet(false); - resultSchema = new TableSchema(); - } - } catch (HiveSQLException e) { - setState(OperationState.ERROR); - throw e; - } catch (Exception e) { - setState(OperationState.ERROR); - throw new HiveSQLException("Error running query: " + e.toString(), e); - } - setState(OperationState.FINISHED); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.operation.Operation#close() - */ - @Override - public void close() throws HiveSQLException { - setState(OperationState.CLOSED); - tearDownSessionIO(); - cleanTmpFile(); - cleanupOperationLog(); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.operation.Operation#getResultSetSchema() - */ - @Override - public TableSchema getResultSetSchema() throws HiveSQLException { - return resultSchema; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.operation.Operation#getNextRowSet(org.apache.hive.service.cli.FetchOrientation, long) - */ - @Override - public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { - validateDefaultFetchOrientation(orientation); - if (orientation.equals(FetchOrientation.FETCH_FIRST)) { - resetResultReader(); - } - List rows = readResults((int) maxRows); - RowSet rowSet = RowSetFactory.create(resultSchema, getProtocolVersion()); - - for (String row : rows) { - rowSet.addRow(new String[] {row}); - } - return rowSet; - } - - /** - * Reads the temporary results for non-Hive (non-Driver) commands to the - * resulting List of strings. - * @param nLines number of lines read at once. If it is <= 0, then read all lines. - */ - private List readResults(int nLines) throws HiveSQLException { - if (resultReader == null) { - SessionState sessionState = getParentSession().getSessionState(); - File tmp = sessionState.getTmpOutputFile(); - try { - resultReader = new BufferedReader(new FileReader(tmp)); - } catch (FileNotFoundException e) { - LOG.error("File " + tmp + " not found. ", e); - throw new HiveSQLException(e); - } - } - List results = new ArrayList(); - - for (int i = 0; i < nLines || nLines <= 0; ++i) { - try { - String line = resultReader.readLine(); - if (line == null) { - // reached the end of the result file - break; - } else { - results.add(line); - } - } catch (IOException e) { - LOG.error("Reading temp results encountered an exception: ", e); - throw new HiveSQLException(e); - } - } - return results; - } - - private void cleanTmpFile() { - resetResultReader(); - SessionState sessionState = getParentSession().getSessionState(); - File tmp = sessionState.getTmpOutputFile(); - tmp.delete(); - } - - private void resetResultReader() { - if (resultReader != null) { - IOUtils.cleanup(LOG, resultReader); - resultReader = null; - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/HiveTableTypeMapping.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/HiveTableTypeMapping.java deleted file mode 100644 index b530f217125b8..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/HiveTableTypeMapping.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.util.HashSet; -import java.util.Set; - -import org.apache.hadoop.hive.metastore.TableType; - -/** - * HiveTableTypeMapping. - * Default table type mapping - * - */ -public class HiveTableTypeMapping implements TableTypeMapping { - - @Override - public String mapToHiveType(String clientTypeName) { - return clientTypeName; - } - - @Override - public String mapToClientType(String hiveTypeName) { - return hiveTypeName; - } - - @Override - public Set getTableTypeNames() { - Set typeNameSet = new HashSet(); - for (TableType typeNames : TableType.values()) { - typeNameSet.add(typeNames.toString()); - } - return typeNameSet; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java deleted file mode 100644 index 6c819876a556d..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.util.List; - -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAccessControlException; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthzContext; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveAuthzPluginException; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject; -import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationType; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; - -/** - * MetadataOperation. - * - */ -public abstract class MetadataOperation extends Operation { - - protected static final String DEFAULT_HIVE_CATALOG = ""; - protected static TableSchema RESULT_SET_SCHEMA; - private static final char SEARCH_STRING_ESCAPE = '\\'; - - protected MetadataOperation(HiveSession parentSession, OperationType opType) { - super(parentSession, opType, false); - setHasResultSet(true); - } - - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#close() - */ - @Override - public void close() throws HiveSQLException { - setState(OperationState.CLOSED); - cleanupOperationLog(); - } - - /** - * Convert wildchars and escape sequence from JDBC format to datanucleous/regex - */ - protected String convertIdentifierPattern(final String pattern, boolean datanucleusFormat) { - if (pattern == null) { - return convertPattern("%", true); - } else { - return convertPattern(pattern, datanucleusFormat); - } - } - - /** - * Convert wildchars and escape sequence of schema pattern from JDBC format to datanucleous/regex - * The schema pattern treats empty string also as wildchar - */ - protected String convertSchemaPattern(final String pattern) { - if ((pattern == null) || pattern.isEmpty()) { - return convertPattern("%", true); - } else { - return convertPattern(pattern, true); - } - } - - /** - * Convert a pattern containing JDBC catalog search wildcards into - * Java regex patterns. - * - * @param pattern input which may contain '%' or '_' wildcard characters, or - * these characters escaped using {@link #getSearchStringEscape()}. - * @return replace %/_ with regex search characters, also handle escaped - * characters. - * - * The datanucleus module expects the wildchar as '*'. The columns search on the - * other hand is done locally inside the hive code and that requires the regex wildchar - * format '.*' This is driven by the datanucleusFormat flag. - */ - private String convertPattern(final String pattern, boolean datanucleusFormat) { - String wStr; - if (datanucleusFormat) { - wStr = "*"; - } else { - wStr = ".*"; - } - return pattern - .replaceAll("([^\\\\])%", "$1" + wStr).replaceAll("\\\\%", "%").replaceAll("^%", wStr) - .replaceAll("([^\\\\])_", "$1.").replaceAll("\\\\_", "_").replaceAll("^_", "."); - } - - protected boolean isAuthV2Enabled(){ - SessionState ss = SessionState.get(); - return (ss.isAuthorizationModeV2() && - HiveConf.getBoolVar(ss.getConf(), HiveConf.ConfVars.HIVE_AUTHORIZATION_ENABLED)); - } - - protected void authorizeMetaGets(HiveOperationType opType, List inpObjs) - throws HiveSQLException { - authorizeMetaGets(opType, inpObjs, null); - } - - protected void authorizeMetaGets(HiveOperationType opType, List inpObjs, - String cmdString) throws HiveSQLException { - SessionState ss = SessionState.get(); - HiveAuthzContext.Builder ctxBuilder = new HiveAuthzContext.Builder(); - ctxBuilder.setUserIpAddress(ss.getUserIpAddress()); - ctxBuilder.setCommandString(cmdString); - try { - ss.getAuthorizerV2().checkPrivileges(opType, inpObjs, null, - ctxBuilder.build()); - } catch (HiveAuthzPluginException | HiveAccessControlException e) { - throw new HiveSQLException(e.getMessage(), e); - } - } - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/Operation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/Operation.java deleted file mode 100644 index 51bb28748d9e2..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/Operation.java +++ /dev/null @@ -1,325 +0,0 @@ -/** - * 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. - */ -package org.apache.hive.service.cli.operation; - -import java.io.File; -import java.io.FileNotFoundException; -import java.util.EnumSet; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; -import org.apache.hadoop.hive.ql.session.OperationLog; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationHandle; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationStatus; -import org.apache.hive.service.cli.OperationType; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; -import org.apache.hive.service.cli.thrift.TProtocolVersion; - -public abstract class Operation { - protected final HiveSession parentSession; - private OperationState state = OperationState.INITIALIZED; - private final OperationHandle opHandle; - private HiveConf configuration; - public static final Log LOG = LogFactory.getLog(Operation.class.getName()); - public static final FetchOrientation DEFAULT_FETCH_ORIENTATION = FetchOrientation.FETCH_NEXT; - public static final long DEFAULT_FETCH_MAX_ROWS = 100; - protected boolean hasResultSet; - protected volatile HiveSQLException operationException; - protected final boolean runAsync; - protected volatile Future backgroundHandle; - protected OperationLog operationLog; - protected boolean isOperationLogEnabled; - - private long operationTimeout; - private long lastAccessTime; - - protected static final EnumSet DEFAULT_FETCH_ORIENTATION_SET = - EnumSet.of( - FetchOrientation.FETCH_NEXT, - FetchOrientation.FETCH_FIRST, - FetchOrientation.FETCH_PRIOR); - - protected Operation(HiveSession parentSession, OperationType opType, boolean runInBackground) { - this.parentSession = parentSession; - this.runAsync = runInBackground; - this.opHandle = new OperationHandle(opType, parentSession.getProtocolVersion()); - lastAccessTime = System.currentTimeMillis(); - operationTimeout = HiveConf.getTimeVar(parentSession.getHiveConf(), - HiveConf.ConfVars.HIVE_SERVER2_IDLE_OPERATION_TIMEOUT, TimeUnit.MILLISECONDS); - } - - public Future getBackgroundHandle() { - return backgroundHandle; - } - - protected void setBackgroundHandle(Future backgroundHandle) { - this.backgroundHandle = backgroundHandle; - } - - public boolean shouldRunAsync() { - return runAsync; - } - - public void setConfiguration(HiveConf configuration) { - this.configuration = new HiveConf(configuration); - } - - public HiveConf getConfiguration() { - return new HiveConf(configuration); - } - - public HiveSession getParentSession() { - return parentSession; - } - - public OperationHandle getHandle() { - return opHandle; - } - - public TProtocolVersion getProtocolVersion() { - return opHandle.getProtocolVersion(); - } - - public OperationType getType() { - return opHandle.getOperationType(); - } - - public OperationStatus getStatus() { - return new OperationStatus(state, operationException); - } - - public boolean hasResultSet() { - return hasResultSet; - } - - protected void setHasResultSet(boolean hasResultSet) { - this.hasResultSet = hasResultSet; - opHandle.setHasResultSet(hasResultSet); - } - - public OperationLog getOperationLog() { - return operationLog; - } - - protected final OperationState setState(OperationState newState) throws HiveSQLException { - state.validateTransition(newState); - this.state = newState; - this.lastAccessTime = System.currentTimeMillis(); - return this.state; - } - - public boolean isTimedOut(long current) { - if (operationTimeout == 0) { - return false; - } - if (operationTimeout > 0) { - // check only when it's in terminal state - return state.isTerminal() && lastAccessTime + operationTimeout <= current; - } - return lastAccessTime + -operationTimeout <= current; - } - - public long getLastAccessTime() { - return lastAccessTime; - } - - public long getOperationTimeout() { - return operationTimeout; - } - - public void setOperationTimeout(long operationTimeout) { - this.operationTimeout = operationTimeout; - } - - protected void setOperationException(HiveSQLException operationException) { - this.operationException = operationException; - } - - protected final void assertState(OperationState state) throws HiveSQLException { - if (this.state != state) { - throw new HiveSQLException("Expected state " + state + ", but found " + this.state); - } - this.lastAccessTime = System.currentTimeMillis(); - } - - public boolean isRunning() { - return OperationState.RUNNING.equals(state); - } - - public boolean isFinished() { - return OperationState.FINISHED.equals(state); - } - - public boolean isCanceled() { - return OperationState.CANCELED.equals(state); - } - - public boolean isFailed() { - return OperationState.ERROR.equals(state); - } - - protected void createOperationLog() { - if (parentSession.isOperationLogEnabled()) { - File operationLogFile = new File(parentSession.getOperationLogSessionDir(), - opHandle.getHandleIdentifier().toString()); - isOperationLogEnabled = true; - - // create log file - try { - if (operationLogFile.exists()) { - LOG.warn("The operation log file should not exist, but it is already there: " + - operationLogFile.getAbsolutePath()); - operationLogFile.delete(); - } - if (!operationLogFile.createNewFile()) { - // the log file already exists and cannot be deleted. - // If it can be read/written, keep its contents and use it. - if (!operationLogFile.canRead() || !operationLogFile.canWrite()) { - LOG.warn("The already existed operation log file cannot be recreated, " + - "and it cannot be read or written: " + operationLogFile.getAbsolutePath()); - isOperationLogEnabled = false; - return; - } - } - } catch (Exception e) { - LOG.warn("Unable to create operation log file: " + operationLogFile.getAbsolutePath(), e); - isOperationLogEnabled = false; - return; - } - - // create OperationLog object with above log file - try { - operationLog = new OperationLog(opHandle.toString(), operationLogFile, parentSession.getHiveConf()); - } catch (FileNotFoundException e) { - LOG.warn("Unable to instantiate OperationLog object for operation: " + - opHandle, e); - isOperationLogEnabled = false; - return; - } - - // register this operationLog to current thread - OperationLog.setCurrentOperationLog(operationLog); - } - } - - protected void unregisterOperationLog() { - if (isOperationLogEnabled) { - OperationLog.removeCurrentOperationLog(); - } - } - - /** - * Invoked before runInternal(). - * Set up some preconditions, or configurations. - */ - protected void beforeRun() { - createOperationLog(); - } - - /** - * Invoked after runInternal(), even if an exception is thrown in runInternal(). - * Clean up resources, which was set up in beforeRun(). - */ - protected void afterRun() { - unregisterOperationLog(); - } - - /** - * Implemented by subclass of Operation class to execute specific behaviors. - * @throws HiveSQLException - */ - protected abstract void runInternal() throws HiveSQLException; - - public void run() throws HiveSQLException { - beforeRun(); - try { - runInternal(); - } finally { - afterRun(); - } - } - - protected void cleanupOperationLog() { - if (isOperationLogEnabled) { - if (operationLog == null) { - LOG.error("Operation [ " + opHandle.getHandleIdentifier() + " ] " - + "logging is enabled, but its OperationLog object cannot be found."); - } else { - operationLog.close(); - } - } - } - - // TODO: make this abstract and implement in subclasses. - public void cancel() throws HiveSQLException { - setState(OperationState.CANCELED); - throw new UnsupportedOperationException("SQLOperation.cancel()"); - } - - public abstract void close() throws HiveSQLException; - - public abstract TableSchema getResultSetSchema() throws HiveSQLException; - - public abstract RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException; - - public RowSet getNextRowSet() throws HiveSQLException { - return getNextRowSet(FetchOrientation.FETCH_NEXT, DEFAULT_FETCH_MAX_ROWS); - } - - /** - * Verify if the given fetch orientation is part of the default orientation types. - * @param orientation - * @throws HiveSQLException - */ - protected void validateDefaultFetchOrientation(FetchOrientation orientation) - throws HiveSQLException { - validateFetchOrientation(orientation, DEFAULT_FETCH_ORIENTATION_SET); - } - - /** - * Verify if the given fetch orientation is part of the supported orientation types. - * @param orientation - * @param supportedOrientations - * @throws HiveSQLException - */ - protected void validateFetchOrientation(FetchOrientation orientation, - EnumSet supportedOrientations) throws HiveSQLException { - if (!supportedOrientations.contains(orientation)) { - throw new HiveSQLException("The fetch type " + orientation.toString() + - " is not supported for this resultset", "HY106"); - } - } - - protected HiveSQLException toSQLException(String prefix, CommandProcessorResponse response) { - HiveSQLException ex = new HiveSQLException(prefix + ": " + response.getErrorMessage(), - response.getSQLState(), response.getResponseCode()); - if (response.getException() != null) { - ex.initCause(response.getException()); - } - return ex; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java deleted file mode 100644 index 92c340a29c107..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java +++ /dev/null @@ -1,284 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.api.FieldSchema; -import org.apache.hadoop.hive.metastore.api.Schema; -import org.apache.hadoop.hive.ql.session.OperationLog; -import org.apache.hive.service.AbstractService; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationHandle; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationStatus; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; -import org.apache.log4j.Appender; -import org.apache.log4j.Logger; - -/** - * OperationManager. - * - */ -public class OperationManager extends AbstractService { - private final Log LOG = LogFactory.getLog(OperationManager.class.getName()); - - private final Map handleToOperation = - new HashMap(); - - public OperationManager() { - super(OperationManager.class.getSimpleName()); - } - - @Override - public synchronized void init(HiveConf hiveConf) { - if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED)) { - initOperationLogCapture(hiveConf.getVar( - HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LEVEL)); - } else { - LOG.debug("Operation level logging is turned off"); - } - super.init(hiveConf); - } - - @Override - public synchronized void start() { - super.start(); - // TODO - } - - @Override - public synchronized void stop() { - // TODO - super.stop(); - } - - private void initOperationLogCapture(String loggingMode) { - // Register another Appender (with the same layout) that talks to us. - Appender ap = new LogDivertAppender(this, OperationLog.getLoggingLevel(loggingMode)); - Logger.getRootLogger().addAppender(ap); - } - - public ExecuteStatementOperation newExecuteStatementOperation(HiveSession parentSession, - String statement, Map confOverlay, boolean runAsync) - throws HiveSQLException { - ExecuteStatementOperation executeStatementOperation = ExecuteStatementOperation - .newExecuteStatementOperation(parentSession, statement, confOverlay, runAsync); - addOperation(executeStatementOperation); - return executeStatementOperation; - } - - public GetTypeInfoOperation newGetTypeInfoOperation(HiveSession parentSession) { - GetTypeInfoOperation operation = new GetTypeInfoOperation(parentSession); - addOperation(operation); - return operation; - } - - public GetCatalogsOperation newGetCatalogsOperation(HiveSession parentSession) { - GetCatalogsOperation operation = new GetCatalogsOperation(parentSession); - addOperation(operation); - return operation; - } - - public GetSchemasOperation newGetSchemasOperation(HiveSession parentSession, - String catalogName, String schemaName) { - GetSchemasOperation operation = new GetSchemasOperation(parentSession, catalogName, schemaName); - addOperation(operation); - return operation; - } - - public MetadataOperation newGetTablesOperation(HiveSession parentSession, - String catalogName, String schemaName, String tableName, - List tableTypes) { - MetadataOperation operation = - new GetTablesOperation(parentSession, catalogName, schemaName, tableName, tableTypes); - addOperation(operation); - return operation; - } - - public GetTableTypesOperation newGetTableTypesOperation(HiveSession parentSession) { - GetTableTypesOperation operation = new GetTableTypesOperation(parentSession); - addOperation(operation); - return operation; - } - - public GetColumnsOperation newGetColumnsOperation(HiveSession parentSession, - String catalogName, String schemaName, String tableName, String columnName) { - GetColumnsOperation operation = new GetColumnsOperation(parentSession, - catalogName, schemaName, tableName, columnName); - addOperation(operation); - return operation; - } - - public GetFunctionsOperation newGetFunctionsOperation(HiveSession parentSession, - String catalogName, String schemaName, String functionName) { - GetFunctionsOperation operation = new GetFunctionsOperation(parentSession, - catalogName, schemaName, functionName); - addOperation(operation); - return operation; - } - - public Operation getOperation(OperationHandle operationHandle) throws HiveSQLException { - Operation operation = getOperationInternal(operationHandle); - if (operation == null) { - throw new HiveSQLException("Invalid OperationHandle: " + operationHandle); - } - return operation; - } - - private synchronized Operation getOperationInternal(OperationHandle operationHandle) { - return handleToOperation.get(operationHandle); - } - - private synchronized Operation removeTimedOutOperation(OperationHandle operationHandle) { - Operation operation = handleToOperation.get(operationHandle); - if (operation != null && operation.isTimedOut(System.currentTimeMillis())) { - handleToOperation.remove(operationHandle); - return operation; - } - return null; - } - - private synchronized void addOperation(Operation operation) { - handleToOperation.put(operation.getHandle(), operation); - } - - private synchronized Operation removeOperation(OperationHandle opHandle) { - return handleToOperation.remove(opHandle); - } - - public OperationStatus getOperationStatus(OperationHandle opHandle) - throws HiveSQLException { - return getOperation(opHandle).getStatus(); - } - - public void cancelOperation(OperationHandle opHandle) throws HiveSQLException { - Operation operation = getOperation(opHandle); - OperationState opState = operation.getStatus().getState(); - if (opState == OperationState.CANCELED || - opState == OperationState.CLOSED || - opState == OperationState.FINISHED || - opState == OperationState.ERROR || - opState == OperationState.UNKNOWN) { - // Cancel should be a no-op in either cases - LOG.debug(opHandle + ": Operation is already aborted in state - " + opState); - } - else { - LOG.debug(opHandle + ": Attempting to cancel from state - " + opState); - operation.cancel(); - } - } - - public void closeOperation(OperationHandle opHandle) throws HiveSQLException { - Operation operation = removeOperation(opHandle); - if (operation == null) { - throw new HiveSQLException("Operation does not exist!"); - } - operation.close(); - } - - public TableSchema getOperationResultSetSchema(OperationHandle opHandle) - throws HiveSQLException { - return getOperation(opHandle).getResultSetSchema(); - } - - public RowSet getOperationNextRowSet(OperationHandle opHandle) - throws HiveSQLException { - return getOperation(opHandle).getNextRowSet(); - } - - public RowSet getOperationNextRowSet(OperationHandle opHandle, - FetchOrientation orientation, long maxRows) - throws HiveSQLException { - return getOperation(opHandle).getNextRowSet(orientation, maxRows); - } - - public RowSet getOperationLogRowSet(OperationHandle opHandle, - FetchOrientation orientation, long maxRows) - throws HiveSQLException { - // get the OperationLog object from the operation - OperationLog operationLog = getOperation(opHandle).getOperationLog(); - if (operationLog == null) { - throw new HiveSQLException("Couldn't find log associated with operation handle: " + opHandle); - } - - // read logs - List logs; - try { - logs = operationLog.readOperationLog(isFetchFirst(orientation), maxRows); - } catch (SQLException e) { - throw new HiveSQLException(e.getMessage(), e.getCause()); - } - - - // convert logs to RowSet - TableSchema tableSchema = new TableSchema(getLogSchema()); - RowSet rowSet = RowSetFactory.create(tableSchema, getOperation(opHandle).getProtocolVersion()); - for (String log : logs) { - rowSet.addRow(new String[] {log}); - } - - return rowSet; - } - - private boolean isFetchFirst(FetchOrientation fetchOrientation) { - //TODO: Since OperationLog is moved to package o.a.h.h.ql.session, - // we may add a Enum there and map FetchOrientation to it. - if (fetchOrientation.equals(FetchOrientation.FETCH_FIRST)) { - return true; - } - return false; - } - - private Schema getLogSchema() { - Schema schema = new Schema(); - FieldSchema fieldSchema = new FieldSchema(); - fieldSchema.setName("operation_log"); - fieldSchema.setType("string"); - schema.addToFieldSchemas(fieldSchema); - return schema; - } - - public OperationLog getOperationLogByThread() { - return OperationLog.getCurrentOperationLog(); - } - - public List removeExpiredOperations(OperationHandle[] handles) { - List removed = new ArrayList(); - for (OperationHandle handle : handles) { - Operation operation = removeTimedOutOperation(handle); - if (operation != null) { - LOG.warn("Operation " + handle + " is timed-out and will be closed"); - removed.add(operation); - } - } - return removed; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java deleted file mode 100644 index c7726f1fac07a..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java +++ /dev/null @@ -1,456 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.io.IOException; -import java.io.Serializable; -import java.nio.charset.StandardCharsets; -import java.security.PrivilegedExceptionAction; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.Future; -import java.util.concurrent.RejectedExecutionException; - -import org.apache.commons.codec.binary.Base64; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.api.FieldSchema; -import org.apache.hadoop.hive.metastore.api.Schema; -import org.apache.hadoop.hive.ql.CommandNeedRetryException; -import org.apache.hadoop.hive.ql.Driver; -import org.apache.hadoop.hive.ql.exec.ExplainTask; -import org.apache.hadoop.hive.ql.exec.Task; -import org.apache.hadoop.hive.ql.metadata.Hive; -import org.apache.hadoop.hive.ql.metadata.HiveException; -import org.apache.hadoop.hive.ql.parse.VariableSubstitution; -import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; -import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hadoop.hive.serde.serdeConstants; -import org.apache.hadoop.hive.serde2.SerDe; -import org.apache.hadoop.hive.serde2.SerDeException; -import org.apache.hadoop.hive.serde2.SerDeUtils; -import org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.shims.Utils; -import org.apache.hadoop.io.BytesWritable; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; -import org.apache.hive.service.server.ThreadWithGarbageCleanup; - -/** - * SQLOperation. - * - */ -public class SQLOperation extends ExecuteStatementOperation { - - private Driver driver = null; - private CommandProcessorResponse response; - private TableSchema resultSchema = null; - private Schema mResultSchema = null; - private SerDe serde = null; - private boolean fetchStarted = false; - - public SQLOperation(HiveSession parentSession, String statement, Map confOverlay, boolean runInBackground) { - // TODO: call setRemoteUser in ExecuteStatementOperation or higher. - super(parentSession, statement, confOverlay, runInBackground); - } - - /*** - * Compile the query and extract metadata - * @param sqlOperationConf - * @throws HiveSQLException - */ - public void prepare(HiveConf sqlOperationConf) throws HiveSQLException { - setState(OperationState.RUNNING); - - try { - driver = new Driver(sqlOperationConf, getParentSession().getUserName()); - - // set the operation handle information in Driver, so that thrift API users - // can use the operation handle they receive, to lookup query information in - // Yarn ATS - String guid64 = Base64.encodeBase64URLSafeString(getHandle().getHandleIdentifier() - .toTHandleIdentifier().getGuid()).trim(); - driver.setOperationId(guid64); - - // In Hive server mode, we are not able to retry in the FetchTask - // case, when calling fetch queries since execute() has returned. - // For now, we disable the test attempts. - driver.setTryCount(Integer.MAX_VALUE); - - String subStatement = new VariableSubstitution().substitute(sqlOperationConf, statement); - response = driver.compileAndRespond(subStatement); - if (0 != response.getResponseCode()) { - throw toSQLException("Error while compiling statement", response); - } - - mResultSchema = driver.getSchema(); - - // hasResultSet should be true only if the query has a FetchTask - // "explain" is an exception for now - if(driver.getPlan().getFetchTask() != null) { - //Schema has to be set - if (mResultSchema == null || !mResultSchema.isSetFieldSchemas()) { - throw new HiveSQLException("Error compiling query: Schema and FieldSchema " + - "should be set when query plan has a FetchTask"); - } - resultSchema = new TableSchema(mResultSchema); - setHasResultSet(true); - } else { - setHasResultSet(false); - } - // Set hasResultSet true if the plan has ExplainTask - // TODO explain should use a FetchTask for reading - for (Task task: driver.getPlan().getRootTasks()) { - if (task.getClass() == ExplainTask.class) { - resultSchema = new TableSchema(mResultSchema); - setHasResultSet(true); - break; - } - } - } catch (HiveSQLException e) { - setState(OperationState.ERROR); - throw e; - } catch (Exception e) { - setState(OperationState.ERROR); - throw new HiveSQLException("Error running query: " + e.toString(), e); - } - } - - private void runQuery(HiveConf sqlOperationConf) throws HiveSQLException { - try { - // In Hive server mode, we are not able to retry in the FetchTask - // case, when calling fetch queries since execute() has returned. - // For now, we disable the test attempts. - driver.setTryCount(Integer.MAX_VALUE); - response = driver.run(); - if (0 != response.getResponseCode()) { - throw toSQLException("Error while processing statement", response); - } - } catch (HiveSQLException e) { - // If the operation was cancelled by another thread, - // Driver#run will return a non-zero response code. - // We will simply return if the operation state is CANCELED, - // otherwise throw an exception - if (getStatus().getState() == OperationState.CANCELED) { - return; - } - else { - setState(OperationState.ERROR); - throw e; - } - } catch (Exception e) { - setState(OperationState.ERROR); - throw new HiveSQLException("Error running query: " + e.toString(), e); - } - setState(OperationState.FINISHED); - } - - @Override - public void runInternal() throws HiveSQLException { - setState(OperationState.PENDING); - final HiveConf opConfig = getConfigForOperation(); - prepare(opConfig); - if (!shouldRunAsync()) { - runQuery(opConfig); - } else { - // We'll pass ThreadLocals in the background thread from the foreground (handler) thread - final SessionState parentSessionState = SessionState.get(); - // ThreadLocal Hive object needs to be set in background thread. - // The metastore client in Hive is associated with right user. - final Hive parentHive = getSessionHive(); - // Current UGI will get used by metastore when metsatore is in embedded mode - // So this needs to get passed to the new background thread - final UserGroupInformation currentUGI = getCurrentUGI(opConfig); - // Runnable impl to call runInternal asynchronously, - // from a different thread - Runnable backgroundOperation = new Runnable() { - @Override - public void run() { - PrivilegedExceptionAction doAsAction = new PrivilegedExceptionAction() { - @Override - public Object run() throws HiveSQLException { - Hive.set(parentHive); - SessionState.setCurrentSessionState(parentSessionState); - // Set current OperationLog in this async thread for keeping on saving query log. - registerCurrentOperationLog(); - try { - runQuery(opConfig); - } catch (HiveSQLException e) { - setOperationException(e); - LOG.error("Error running hive query: ", e); - } finally { - unregisterOperationLog(); - } - return null; - } - }; - - try { - currentUGI.doAs(doAsAction); - } catch (Exception e) { - setOperationException(new HiveSQLException(e)); - LOG.error("Error running hive query as user : " + currentUGI.getShortUserName(), e); - } - finally { - /** - * We'll cache the ThreadLocal RawStore object for this background thread for an orderly cleanup - * when this thread is garbage collected later. - * @see org.apache.hive.service.server.ThreadWithGarbageCleanup#finalize() - */ - if (ThreadWithGarbageCleanup.currentThread() instanceof ThreadWithGarbageCleanup) { - ThreadWithGarbageCleanup currentThread = - (ThreadWithGarbageCleanup) ThreadWithGarbageCleanup.currentThread(); - currentThread.cacheThreadLocalRawStore(); - } - } - } - }; - try { - // This submit blocks if no background threads are available to run this operation - Future backgroundHandle = - getParentSession().getSessionManager().submitBackgroundOperation(backgroundOperation); - setBackgroundHandle(backgroundHandle); - } catch (RejectedExecutionException rejected) { - setState(OperationState.ERROR); - throw new HiveSQLException("The background threadpool cannot accept" + - " new task for execution, please retry the operation", rejected); - } - } - } - - /** - * Returns the current UGI on the stack - * @param opConfig - * @return UserGroupInformation - * @throws HiveSQLException - */ - private UserGroupInformation getCurrentUGI(HiveConf opConfig) throws HiveSQLException { - try { - return Utils.getUGI(); - } catch (Exception e) { - throw new HiveSQLException("Unable to get current user", e); - } - } - - /** - * Returns the ThreadLocal Hive for the current thread - * @return Hive - * @throws HiveSQLException - */ - private Hive getSessionHive() throws HiveSQLException { - try { - return Hive.get(); - } catch (HiveException e) { - throw new HiveSQLException("Failed to get ThreadLocal Hive object", e); - } - } - - private void cleanup(OperationState state) throws HiveSQLException { - setState(state); - if (shouldRunAsync()) { - Future backgroundHandle = getBackgroundHandle(); - if (backgroundHandle != null) { - backgroundHandle.cancel(true); - } - } - if (driver != null) { - driver.close(); - driver.destroy(); - } - driver = null; - - SessionState ss = SessionState.get(); - if (ss.getTmpOutputFile() != null) { - ss.getTmpOutputFile().delete(); - } - } - - @Override - public void cancel() throws HiveSQLException { - cleanup(OperationState.CANCELED); - } - - @Override - public void close() throws HiveSQLException { - cleanup(OperationState.CLOSED); - cleanupOperationLog(); - } - - @Override - public TableSchema getResultSetSchema() throws HiveSQLException { - assertState(OperationState.FINISHED); - if (resultSchema == null) { - resultSchema = new TableSchema(driver.getSchema()); - } - return resultSchema; - } - - private final transient List convey = new ArrayList(); - - @Override - public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { - validateDefaultFetchOrientation(orientation); - assertState(OperationState.FINISHED); - - RowSet rowSet = RowSetFactory.create(resultSchema, getProtocolVersion()); - - try { - /* if client is requesting fetch-from-start and its not the first time reading from this operation - * then reset the fetch position to beginning - */ - if (orientation.equals(FetchOrientation.FETCH_FIRST) && fetchStarted) { - driver.resetFetch(); - } - fetchStarted = true; - driver.setMaxRows((int) maxRows); - if (driver.getResults(convey)) { - return decode(convey, rowSet); - } - return rowSet; - } catch (IOException e) { - throw new HiveSQLException(e); - } catch (CommandNeedRetryException e) { - throw new HiveSQLException(e); - } catch (Exception e) { - throw new HiveSQLException(e); - } finally { - convey.clear(); - } - } - - private RowSet decode(List rows, RowSet rowSet) throws Exception { - if (driver.isFetchingTable()) { - return prepareFromRow(rows, rowSet); - } - return decodeFromString(rows, rowSet); - } - - // already encoded to thrift-able object in ThriftFormatter - private RowSet prepareFromRow(List rows, RowSet rowSet) throws Exception { - for (Object row : rows) { - rowSet.addRow((Object[]) row); - } - return rowSet; - } - - private RowSet decodeFromString(List rows, RowSet rowSet) - throws SQLException, SerDeException { - getSerDe(); - StructObjectInspector soi = (StructObjectInspector) serde.getObjectInspector(); - List fieldRefs = soi.getAllStructFieldRefs(); - - Object[] deserializedFields = new Object[fieldRefs.size()]; - Object rowObj; - ObjectInspector fieldOI; - - int protocol = getProtocolVersion().getValue(); - for (Object rowString : rows) { - rowObj = serde.deserialize(new BytesWritable(((String)rowString).getBytes(StandardCharsets.UTF_8))); - for (int i = 0; i < fieldRefs.size(); i++) { - StructField fieldRef = fieldRefs.get(i); - fieldOI = fieldRef.getFieldObjectInspector(); - Object fieldData = soi.getStructFieldData(rowObj, fieldRef); - deserializedFields[i] = SerDeUtils.toThriftPayload(fieldData, fieldOI, protocol); - } - rowSet.addRow(deserializedFields); - } - return rowSet; - } - - private SerDe getSerDe() throws SQLException { - if (serde != null) { - return serde; - } - try { - List fieldSchemas = mResultSchema.getFieldSchemas(); - StringBuilder namesSb = new StringBuilder(); - StringBuilder typesSb = new StringBuilder(); - - if (fieldSchemas != null && !fieldSchemas.isEmpty()) { - for (int pos = 0; pos < fieldSchemas.size(); pos++) { - if (pos != 0) { - namesSb.append(","); - typesSb.append(","); - } - namesSb.append(fieldSchemas.get(pos).getName()); - typesSb.append(fieldSchemas.get(pos).getType()); - } - } - String names = namesSb.toString(); - String types = typesSb.toString(); - - serde = new LazySimpleSerDe(); - Properties props = new Properties(); - if (names.length() > 0) { - LOG.debug("Column names: " + names); - props.setProperty(serdeConstants.LIST_COLUMNS, names); - } - if (types.length() > 0) { - LOG.debug("Column types: " + types); - props.setProperty(serdeConstants.LIST_COLUMN_TYPES, types); - } - SerDeUtils.initializeSerDe(serde, new HiveConf(), props, null); - - } catch (Exception ex) { - ex.printStackTrace(); - throw new SQLException("Could not create ResultSet: " + ex.getMessage(), ex); - } - return serde; - } - - /** - * If there are query specific settings to overlay, then create a copy of config - * There are two cases we need to clone the session config that's being passed to hive driver - * 1. Async query - - * If the client changes a config setting, that shouldn't reflect in the execution already underway - * 2. confOverlay - - * The query specific settings should only be applied to the query config and not session - * @return new configuration - * @throws HiveSQLException - */ - private HiveConf getConfigForOperation() throws HiveSQLException { - HiveConf sqlOperationConf = getParentSession().getHiveConf(); - if (!getConfOverlay().isEmpty() || shouldRunAsync()) { - // clone the parent session config for this query - sqlOperationConf = new HiveConf(sqlOperationConf); - - // apply overlay query specific settings, if any - for (Map.Entry confEntry : getConfOverlay().entrySet()) { - try { - sqlOperationConf.verifyAndSet(confEntry.getKey(), confEntry.getValue()); - } catch (IllegalArgumentException e) { - throw new HiveSQLException("Error applying statement specific settings", e); - } - } - } - return sqlOperationConf; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/TableTypeMapping.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/TableTypeMapping.java deleted file mode 100644 index e59d19ea6be42..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/operation/TableTypeMapping.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.util.Set; - - -public interface TableTypeMapping { - /** - * Map client's table type name to hive's table type - * @param clientTypeName - * @return - */ - String mapToHiveType(String clientTypeName); - - /** - * Map hive's table type name to client's table type - * @param hiveTypeName - * @return - */ - String mapToClientType(String hiveTypeName); - - /** - * Get all the table types of this mapping - * @return - */ - Set getTableTypeNames(); -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/HiveSession.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/HiveSession.java deleted file mode 100644 index 65f9b298bf4f6..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/HiveSession.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.session; - -import java.util.List; -import java.util.Map; - -import org.apache.hadoop.hive.metastore.IMetaStoreClient; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.cli.*; - -public interface HiveSession extends HiveSessionBase { - - void open(Map sessionConfMap) throws Exception; - - IMetaStoreClient getMetaStoreClient() throws HiveSQLException; - - /** - * getInfo operation handler - * @param getInfoType - * @return - * @throws HiveSQLException - */ - GetInfoValue getInfo(GetInfoType getInfoType) throws HiveSQLException; - - /** - * execute operation handler - * @param statement - * @param confOverlay - * @return - * @throws HiveSQLException - */ - OperationHandle executeStatement(String statement, - Map confOverlay) throws HiveSQLException; - - /** - * execute operation handler - * @param statement - * @param confOverlay - * @return - * @throws HiveSQLException - */ - OperationHandle executeStatementAsync(String statement, - Map confOverlay) throws HiveSQLException; - - /** - * getTypeInfo operation handler - * @return - * @throws HiveSQLException - */ - OperationHandle getTypeInfo() throws HiveSQLException; - - /** - * getCatalogs operation handler - * @return - * @throws HiveSQLException - */ - OperationHandle getCatalogs() throws HiveSQLException; - - /** - * getSchemas operation handler - * @param catalogName - * @param schemaName - * @return - * @throws HiveSQLException - */ - OperationHandle getSchemas(String catalogName, String schemaName) - throws HiveSQLException; - - /** - * getTables operation handler - * @param catalogName - * @param schemaName - * @param tableName - * @param tableTypes - * @return - * @throws HiveSQLException - */ - OperationHandle getTables(String catalogName, String schemaName, - String tableName, List tableTypes) throws HiveSQLException; - - /** - * getTableTypes operation handler - * @return - * @throws HiveSQLException - */ - OperationHandle getTableTypes() throws HiveSQLException ; - - /** - * getColumns operation handler - * @param catalogName - * @param schemaName - * @param tableName - * @param columnName - * @return - * @throws HiveSQLException - */ - OperationHandle getColumns(String catalogName, String schemaName, - String tableName, String columnName) throws HiveSQLException; - - /** - * getFunctions operation handler - * @param catalogName - * @param schemaName - * @param functionName - * @return - * @throws HiveSQLException - */ - OperationHandle getFunctions(String catalogName, String schemaName, - String functionName) throws HiveSQLException; - - /** - * close the session - * @throws HiveSQLException - */ - void close() throws HiveSQLException; - - void cancelOperation(OperationHandle opHandle) throws HiveSQLException; - - void closeOperation(OperationHandle opHandle) throws HiveSQLException; - - TableSchema getResultSetMetadata(OperationHandle opHandle) - throws HiveSQLException; - - RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, - long maxRows, FetchType fetchType) throws HiveSQLException; - - String getDelegationToken(HiveAuthFactory authFactory, String owner, - String renewer) throws HiveSQLException; - - void cancelDelegationToken(HiveAuthFactory authFactory, String tokenStr) - throws HiveSQLException; - - void renewDelegationToken(HiveAuthFactory authFactory, String tokenStr) - throws HiveSQLException; - - void closeExpiredOperations(); - - long getNoOperationTime(); -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java deleted file mode 100644 index b72c18b2b2135..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/HiveSessionBase.java +++ /dev/null @@ -1,90 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.session; - -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hive.service.cli.SessionHandle; -import org.apache.hive.service.cli.operation.OperationManager; -import org.apache.hive.service.cli.thrift.TProtocolVersion; - -import java.io.File; - -/** - * Methods that don't need to be executed under a doAs - * context are here. Rest of them in HiveSession interface - */ -public interface HiveSessionBase { - - TProtocolVersion getProtocolVersion(); - - /** - * Set the session manager for the session - * @param sessionManager - */ - void setSessionManager(SessionManager sessionManager); - - /** - * Get the session manager for the session - */ - SessionManager getSessionManager(); - - /** - * Set operation manager for the session - * @param operationManager - */ - void setOperationManager(OperationManager operationManager); - - /** - * Check whether operation logging is enabled and session dir is created successfully - */ - boolean isOperationLogEnabled(); - - /** - * Get the session dir, which is the parent dir of operation logs - * @return a file representing the parent directory of operation logs - */ - File getOperationLogSessionDir(); - - /** - * Set the session dir, which is the parent dir of operation logs - * @param operationLogRootDir the parent dir of the session dir - */ - void setOperationLogSessionDir(File operationLogRootDir); - - SessionHandle getSessionHandle(); - - String getUsername(); - - String getPassword(); - - HiveConf getHiveConf(); - - SessionState getSessionState(); - - String getUserName(); - - void setUserName(String userName); - - String getIpAddress(); - - void setIpAddress(String ipAddress); - - long getLastAccessTime(); -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java deleted file mode 100644 index 745f385e87f78..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java +++ /dev/null @@ -1,834 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.session; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.common.cli.HiveFileProcessor; -import org.apache.hadoop.hive.common.cli.IHiveFileProcessor; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hadoop.hive.metastore.IMetaStoreClient; -import org.apache.hadoop.hive.metastore.api.MetaException; -import org.apache.hadoop.hive.ql.exec.FetchFormatter; -import org.apache.hadoop.hive.ql.exec.ListSinkOperator; -import org.apache.hadoop.hive.ql.exec.Utilities; -import org.apache.hadoop.hive.ql.history.HiveHistory; -import org.apache.hadoop.hive.ql.metadata.Hive; -import org.apache.hadoop.hive.ql.metadata.HiveException; -import org.apache.hadoop.hive.ql.parse.VariableSubstitution; -import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hadoop.hive.shims.ShimLoader; -import org.apache.hive.common.util.HiveVersionInfo; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.FetchType; -import org.apache.hive.service.cli.GetInfoType; -import org.apache.hive.service.cli.GetInfoValue; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationHandle; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.SessionHandle; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.operation.ExecuteStatementOperation; -import org.apache.hive.service.cli.operation.GetCatalogsOperation; -import org.apache.hive.service.cli.operation.GetColumnsOperation; -import org.apache.hive.service.cli.operation.GetFunctionsOperation; -import org.apache.hive.service.cli.operation.GetSchemasOperation; -import org.apache.hive.service.cli.operation.GetTableTypesOperation; -import org.apache.hive.service.cli.operation.GetTypeInfoOperation; -import org.apache.hive.service.cli.operation.MetadataOperation; -import org.apache.hive.service.cli.operation.Operation; -import org.apache.hive.service.cli.operation.OperationManager; -import org.apache.hive.service.cli.thrift.TProtocolVersion; -import org.apache.hive.service.server.ThreadWithGarbageCleanup; - -import static org.apache.hadoop.hive.conf.SystemVariables.ENV_PREFIX; -import static org.apache.hadoop.hive.conf.SystemVariables.HIVECONF_PREFIX; -import static org.apache.hadoop.hive.conf.SystemVariables.HIVEVAR_PREFIX; -import static org.apache.hadoop.hive.conf.SystemVariables.METACONF_PREFIX; -import static org.apache.hadoop.hive.conf.SystemVariables.SYSTEM_PREFIX; - -/** - * HiveSession - * - */ -public class HiveSessionImpl implements HiveSession { - private final SessionHandle sessionHandle; - private String username; - private final String password; - private HiveConf hiveConf; - private SessionState sessionState; - private String ipAddress; - private static final String FETCH_WORK_SERDE_CLASS = - "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"; - private static final Log LOG = LogFactory.getLog(HiveSessionImpl.class); - private SessionManager sessionManager; - private OperationManager operationManager; - private final Set opHandleSet = new HashSet(); - private boolean isOperationLogEnabled; - private File sessionLogDir; - private volatile long lastAccessTime; - private volatile long lastIdleTime; - - public HiveSessionImpl(TProtocolVersion protocol, String username, String password, - HiveConf serverhiveConf, String ipAddress) { - this.username = username; - this.password = password; - this.sessionHandle = new SessionHandle(protocol); - this.hiveConf = new HiveConf(serverhiveConf); - this.ipAddress = ipAddress; - - try { - // In non-impersonation mode, map scheduler queue to current user - // if fair scheduler is configured. - if (! hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS) && - hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_MAP_FAIR_SCHEDULER_QUEUE)) { - ShimLoader.getHadoopShims().refreshDefaultQueue(hiveConf, username); - } - } catch (IOException e) { - LOG.warn("Error setting scheduler queue: " + e, e); - } - // Set an explicit session name to control the download directory name - hiveConf.set(ConfVars.HIVESESSIONID.varname, - sessionHandle.getHandleIdentifier().toString()); - // Use thrift transportable formatter - hiveConf.set(ListSinkOperator.OUTPUT_FORMATTER, - FetchFormatter.ThriftFormatter.class.getName()); - hiveConf.setInt(ListSinkOperator.OUTPUT_PROTOCOL, protocol.getValue()); - } - - @Override - /** - * Opens a new HiveServer2 session for the client connection. - * Creates a new SessionState object that will be associated with this HiveServer2 session. - * When the server executes multiple queries in the same session, - * this SessionState object is reused across multiple queries. - * Note that if doAs is true, this call goes through a proxy object, - * which wraps the method logic in a UserGroupInformation#doAs. - * That's why it is important to create SessionState here rather than in the constructor. - */ - public void open(Map sessionConfMap) throws HiveSQLException { - sessionState = new SessionState(hiveConf, username); - sessionState.setUserIpAddress(ipAddress); - sessionState.setIsHiveServerQuery(true); - SessionState.start(sessionState); - try { - sessionState.reloadAuxJars(); - } catch (IOException e) { - String msg = "Failed to load reloadable jar file path: " + e; - LOG.error(msg, e); - throw new HiveSQLException(msg, e); - } - // Process global init file: .hiverc - processGlobalInitFile(); - if (sessionConfMap != null) { - configureSession(sessionConfMap); - } - lastAccessTime = System.currentTimeMillis(); - lastIdleTime = lastAccessTime; - } - - /** - * It is used for processing hiverc file from HiveServer2 side. - */ - private class GlobalHivercFileProcessor extends HiveFileProcessor { - @Override - protected BufferedReader loadFile(String fileName) throws IOException { - FileInputStream initStream = null; - BufferedReader bufferedReader = null; - initStream = new FileInputStream(fileName); - bufferedReader = new BufferedReader(new InputStreamReader(initStream)); - return bufferedReader; - } - - @Override - protected int processCmd(String cmd) { - int rc = 0; - String cmd_trimed = cmd.trim(); - try { - executeStatementInternal(cmd_trimed, null, false); - } catch (HiveSQLException e) { - rc = -1; - LOG.warn("Failed to execute HQL command in global .hiverc file.", e); - } - return rc; - } - } - - private void processGlobalInitFile() { - IHiveFileProcessor processor = new GlobalHivercFileProcessor(); - - try { - String hiverc = hiveConf.getVar(ConfVars.HIVE_SERVER2_GLOBAL_INIT_FILE_LOCATION); - if (hiverc != null) { - File hivercFile = new File(hiverc); - if (hivercFile.isDirectory()) { - hivercFile = new File(hivercFile, SessionManager.HIVERCFILE); - } - if (hivercFile.isFile()) { - LOG.info("Running global init file: " + hivercFile); - int rc = processor.processFile(hivercFile.getAbsolutePath()); - if (rc != 0) { - LOG.error("Failed on initializing global .hiverc file"); - } - } else { - LOG.debug("Global init file " + hivercFile + " does not exist"); - } - } - } catch (IOException e) { - LOG.warn("Failed on initializing global .hiverc file", e); - } - } - - private void configureSession(Map sessionConfMap) throws HiveSQLException { - SessionState.setCurrentSessionState(sessionState); - for (Map.Entry entry : sessionConfMap.entrySet()) { - String key = entry.getKey(); - if (key.startsWith("set:")) { - try { - setVariable(key.substring(4), entry.getValue()); - } catch (Exception e) { - throw new HiveSQLException(e); - } - } else if (key.startsWith("use:")) { - SessionState.get().setCurrentDatabase(entry.getValue()); - } else { - hiveConf.verifyAndSet(key, entry.getValue()); - } - } - } - - // Copy from org.apache.hadoop.hive.ql.processors.SetProcessor, only change: - // setConf(varname, propName, varvalue, true) when varname.startsWith(HIVECONF_PREFIX) - public static int setVariable(String varname, String varvalue) throws Exception { - SessionState ss = SessionState.get(); - if (varvalue.contains("\n")){ - ss.err.println("Warning: Value had a \\n character in it."); - } - varname = varname.trim(); - if (varname.startsWith(ENV_PREFIX)){ - ss.err.println("env:* variables can not be set."); - return 1; - } else if (varname.startsWith(SYSTEM_PREFIX)){ - String propName = varname.substring(SYSTEM_PREFIX.length()); - System.getProperties().setProperty(propName, - new VariableSubstitution().substitute(ss.getConf(),varvalue)); - } else if (varname.startsWith(HIVECONF_PREFIX)){ - String propName = varname.substring(HIVECONF_PREFIX.length()); - setConf(varname, propName, varvalue, true); - } else if (varname.startsWith(HIVEVAR_PREFIX)) { - String propName = varname.substring(HIVEVAR_PREFIX.length()); - ss.getHiveVariables().put(propName, - new VariableSubstitution().substitute(ss.getConf(),varvalue)); - } else if (varname.startsWith(METACONF_PREFIX)) { - String propName = varname.substring(METACONF_PREFIX.length()); - Hive hive = Hive.get(ss.getConf()); - hive.setMetaConf(propName, new VariableSubstitution().substitute(ss.getConf(), varvalue)); - } else { - setConf(varname, varname, varvalue, true); - } - return 0; - } - - // returns non-null string for validation fail - private static void setConf(String varname, String key, String varvalue, boolean register) - throws IllegalArgumentException { - HiveConf conf = SessionState.get().getConf(); - String value = new VariableSubstitution().substitute(conf, varvalue); - if (conf.getBoolVar(HiveConf.ConfVars.HIVECONFVALIDATION)) { - HiveConf.ConfVars confVars = HiveConf.getConfVars(key); - if (confVars != null) { - if (!confVars.isType(value)) { - StringBuilder message = new StringBuilder(); - message.append("'SET ").append(varname).append('=').append(varvalue); - message.append("' FAILED because ").append(key).append(" expects "); - message.append(confVars.typeString()).append(" type value."); - throw new IllegalArgumentException(message.toString()); - } - String fail = confVars.validate(value); - if (fail != null) { - StringBuilder message = new StringBuilder(); - message.append("'SET ").append(varname).append('=').append(varvalue); - message.append("' FAILED in validation : ").append(fail).append('.'); - throw new IllegalArgumentException(message.toString()); - } - } else if (key.startsWith("hive.")) { - throw new IllegalArgumentException("hive configuration " + key + " does not exists."); - } - } - conf.verifyAndSet(key, value); - if (register) { - SessionState.get().getOverriddenConfigurations().put(key, value); - } - } - - @Override - public void setOperationLogSessionDir(File operationLogRootDir) { - if (!operationLogRootDir.exists()) { - LOG.warn("The operation log root directory is removed, recreating: " + - operationLogRootDir.getAbsolutePath()); - if (!operationLogRootDir.mkdirs()) { - LOG.warn("Unable to create operation log root directory: " + - operationLogRootDir.getAbsolutePath()); - } - } - if (!operationLogRootDir.canWrite()) { - LOG.warn("The operation log root directory is not writable: " + - operationLogRootDir.getAbsolutePath()); - } - sessionLogDir = new File(operationLogRootDir, sessionHandle.getHandleIdentifier().toString()); - isOperationLogEnabled = true; - if (!sessionLogDir.exists()) { - if (!sessionLogDir.mkdir()) { - LOG.warn("Unable to create operation log session directory: " + - sessionLogDir.getAbsolutePath()); - isOperationLogEnabled = false; - } - } - if (isOperationLogEnabled) { - LOG.info("Operation log session directory is created: " + sessionLogDir.getAbsolutePath()); - } - } - - @Override - public boolean isOperationLogEnabled() { - return isOperationLogEnabled; - } - - @Override - public File getOperationLogSessionDir() { - return sessionLogDir; - } - - @Override - public TProtocolVersion getProtocolVersion() { - return sessionHandle.getProtocolVersion(); - } - - @Override - public SessionManager getSessionManager() { - return sessionManager; - } - - @Override - public void setSessionManager(SessionManager sessionManager) { - this.sessionManager = sessionManager; - } - - private OperationManager getOperationManager() { - return operationManager; - } - - @Override - public void setOperationManager(OperationManager operationManager) { - this.operationManager = operationManager; - } - - protected synchronized void acquire(boolean userAccess) { - // Need to make sure that the this HiveServer2's session's SessionState is - // stored in the thread local for the handler thread. - SessionState.setCurrentSessionState(sessionState); - if (userAccess) { - lastAccessTime = System.currentTimeMillis(); - } - } - - /** - * 1. We'll remove the ThreadLocal SessionState as this thread might now serve - * other requests. - * 2. We'll cache the ThreadLocal RawStore object for this background thread for an orderly cleanup - * when this thread is garbage collected later. - * @see org.apache.hive.service.server.ThreadWithGarbageCleanup#finalize() - */ - protected synchronized void release(boolean userAccess) { - SessionState.detachSession(); - if (ThreadWithGarbageCleanup.currentThread() instanceof ThreadWithGarbageCleanup) { - ThreadWithGarbageCleanup currentThread = - (ThreadWithGarbageCleanup) ThreadWithGarbageCleanup.currentThread(); - currentThread.cacheThreadLocalRawStore(); - } - if (userAccess) { - lastAccessTime = System.currentTimeMillis(); - } - if (opHandleSet.isEmpty()) { - lastIdleTime = System.currentTimeMillis(); - } else { - lastIdleTime = 0; - } - } - - @Override - public SessionHandle getSessionHandle() { - return sessionHandle; - } - - @Override - public String getUsername() { - return username; - } - - @Override - public String getPassword() { - return password; - } - - @Override - public HiveConf getHiveConf() { - hiveConf.setVar(HiveConf.ConfVars.HIVEFETCHOUTPUTSERDE, FETCH_WORK_SERDE_CLASS); - return hiveConf; - } - - @Override - public IMetaStoreClient getMetaStoreClient() throws HiveSQLException { - try { - return Hive.get(getHiveConf()).getMSC(); - } catch (HiveException e) { - throw new HiveSQLException("Failed to get metastore connection", e); - } catch (MetaException e) { - throw new HiveSQLException("Failed to get metastore connection", e); - } - } - - @Override - public GetInfoValue getInfo(GetInfoType getInfoType) - throws HiveSQLException { - acquire(true); - try { - switch (getInfoType) { - case CLI_SERVER_NAME: - return new GetInfoValue("Hive"); - case CLI_DBMS_NAME: - return new GetInfoValue("Apache Hive"); - case CLI_DBMS_VER: - return new GetInfoValue(HiveVersionInfo.getVersion()); - case CLI_MAX_COLUMN_NAME_LEN: - return new GetInfoValue(128); - case CLI_MAX_SCHEMA_NAME_LEN: - return new GetInfoValue(128); - case CLI_MAX_TABLE_NAME_LEN: - return new GetInfoValue(128); - case CLI_TXN_CAPABLE: - default: - throw new HiveSQLException("Unrecognized GetInfoType value: " + getInfoType.toString()); - } - } finally { - release(true); - } - } - - @Override - public OperationHandle executeStatement(String statement, Map confOverlay) - throws HiveSQLException { - return executeStatementInternal(statement, confOverlay, false); - } - - @Override - public OperationHandle executeStatementAsync(String statement, Map confOverlay) - throws HiveSQLException { - return executeStatementInternal(statement, confOverlay, true); - } - - private OperationHandle executeStatementInternal(String statement, Map confOverlay, - boolean runAsync) - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - ExecuteStatementOperation operation = operationManager - .newExecuteStatementOperation(getSession(), statement, confOverlay, runAsync); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - // Referring to SQLOperation.java, there is no chance that a HiveSQLException throws and the asyn - // background operation submits to thread pool successfully at the same time. So, Cleanup - // opHandle directly when got HiveSQLException - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getTypeInfo() - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - GetTypeInfoOperation operation = operationManager.newGetTypeInfoOperation(getSession()); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getCatalogs() - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - GetCatalogsOperation operation = operationManager.newGetCatalogsOperation(getSession()); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getSchemas(String catalogName, String schemaName) - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - GetSchemasOperation operation = - operationManager.newGetSchemasOperation(getSession(), catalogName, schemaName); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getTables(String catalogName, String schemaName, String tableName, - List tableTypes) - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - MetadataOperation operation = - operationManager.newGetTablesOperation(getSession(), catalogName, schemaName, tableName, tableTypes); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getTableTypes() - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - GetTableTypesOperation operation = operationManager.newGetTableTypesOperation(getSession()); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getColumns(String catalogName, String schemaName, - String tableName, String columnName) throws HiveSQLException { - acquire(true); - String addedJars = Utilities.getResourceFiles(hiveConf, SessionState.ResourceType.JAR); - if (StringUtils.isNotBlank(addedJars)) { - IMetaStoreClient metastoreClient = getSession().getMetaStoreClient(); - metastoreClient.setHiveAddedJars(addedJars); - } - OperationManager operationManager = getOperationManager(); - GetColumnsOperation operation = operationManager.newGetColumnsOperation(getSession(), - catalogName, schemaName, tableName, columnName); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getFunctions(String catalogName, String schemaName, String functionName) - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - GetFunctionsOperation operation = operationManager - .newGetFunctionsOperation(getSession(), catalogName, schemaName, functionName); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public void close() throws HiveSQLException { - try { - acquire(true); - // Iterate through the opHandles and close their operations - for (OperationHandle opHandle : opHandleSet) { - operationManager.closeOperation(opHandle); - } - opHandleSet.clear(); - // Cleanup session log directory. - cleanupSessionLogDir(); - // Cleanup pipeout file. - cleanupPipeoutFile(); - HiveHistory hiveHist = sessionState.getHiveHistory(); - if (null != hiveHist) { - hiveHist.closeStream(); - } - try { - sessionState.close(); - } finally { - sessionState = null; - } - } catch (IOException ioe) { - throw new HiveSQLException("Failure to close", ioe); - } finally { - if (sessionState != null) { - try { - sessionState.close(); - } catch (Throwable t) { - LOG.warn("Error closing session", t); - } - sessionState = null; - } - release(true); - } - } - - private void cleanupPipeoutFile() { - String lScratchDir = hiveConf.getVar(ConfVars.LOCALSCRATCHDIR); - String sessionID = hiveConf.getVar(ConfVars.HIVESESSIONID); - - File[] fileAry = new File(lScratchDir).listFiles( - (dir, name) -> name.startsWith(sessionID) && name.endsWith(".pipeout")); - - for (File file : fileAry) { - try { - FileUtils.forceDelete(file); - } catch (Exception e) { - LOG.error("Failed to cleanup pipeout file: " + file, e); - } - } - } - - private void cleanupSessionLogDir() { - if (isOperationLogEnabled) { - try { - FileUtils.forceDelete(sessionLogDir); - } catch (Exception e) { - LOG.error("Failed to cleanup session log dir: " + sessionHandle, e); - } - } - } - - @Override - public SessionState getSessionState() { - return sessionState; - } - - @Override - public String getUserName() { - return username; - } - - @Override - public void setUserName(String userName) { - this.username = userName; - } - - @Override - public long getLastAccessTime() { - return lastAccessTime; - } - - @Override - public void closeExpiredOperations() { - OperationHandle[] handles = opHandleSet.toArray(new OperationHandle[opHandleSet.size()]); - if (handles.length > 0) { - List operations = operationManager.removeExpiredOperations(handles); - if (!operations.isEmpty()) { - closeTimedOutOperations(operations); - } - } - } - - @Override - public long getNoOperationTime() { - return lastIdleTime > 0 ? System.currentTimeMillis() - lastIdleTime : 0; - } - - private void closeTimedOutOperations(List operations) { - acquire(false); - try { - for (Operation operation : operations) { - opHandleSet.remove(operation.getHandle()); - try { - operation.close(); - } catch (Exception e) { - LOG.warn("Exception is thrown closing timed-out operation " + operation.getHandle(), e); - } - } - } finally { - release(false); - } - } - - @Override - public void cancelOperation(OperationHandle opHandle) throws HiveSQLException { - acquire(true); - try { - sessionManager.getOperationManager().cancelOperation(opHandle); - } finally { - release(true); - } - } - - @Override - public void closeOperation(OperationHandle opHandle) throws HiveSQLException { - acquire(true); - try { - operationManager.closeOperation(opHandle); - opHandleSet.remove(opHandle); - } finally { - release(true); - } - } - - @Override - public TableSchema getResultSetMetadata(OperationHandle opHandle) throws HiveSQLException { - acquire(true); - try { - return sessionManager.getOperationManager().getOperationResultSetSchema(opHandle); - } finally { - release(true); - } - } - - @Override - public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, - long maxRows, FetchType fetchType) throws HiveSQLException { - acquire(true); - try { - if (fetchType == FetchType.QUERY_OUTPUT) { - return operationManager.getOperationNextRowSet(opHandle, orientation, maxRows); - } - return operationManager.getOperationLogRowSet(opHandle, orientation, maxRows); - } finally { - release(true); - } - } - - protected HiveSession getSession() { - return this; - } - - @Override - public String getIpAddress() { - return ipAddress; - } - - @Override - public void setIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - } - - @Override - public String getDelegationToken(HiveAuthFactory authFactory, String owner, String renewer) - throws HiveSQLException { - HiveAuthFactory.verifyProxyAccess(getUsername(), owner, getIpAddress(), getHiveConf()); - return authFactory.getDelegationToken(owner, renewer); - } - - @Override - public void cancelDelegationToken(HiveAuthFactory authFactory, String tokenStr) - throws HiveSQLException { - HiveAuthFactory.verifyProxyAccess(getUsername(), getUserFromToken(authFactory, tokenStr), - getIpAddress(), getHiveConf()); - authFactory.cancelDelegationToken(tokenStr); - } - - @Override - public void renewDelegationToken(HiveAuthFactory authFactory, String tokenStr) - throws HiveSQLException { - HiveAuthFactory.verifyProxyAccess(getUsername(), getUserFromToken(authFactory, tokenStr), - getIpAddress(), getHiveConf()); - authFactory.renewDelegationToken(tokenStr); - } - - // extract the real user from the given token string - private String getUserFromToken(HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException { - return authFactory.getUserFromToken(tokenStr); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java deleted file mode 100644 index 762dbb2faadec..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/HiveSessionImplwithUGI.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.session; - -import java.io.IOException; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.fs.FileSystem; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.ql.metadata.Hive; -import org.apache.hadoop.hive.ql.metadata.HiveException; -import org.apache.hadoop.hive.shims.Utils; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.thrift.TProtocolVersion; - -/** - * - * HiveSessionImplwithUGI. - * HiveSession with connecting user's UGI and delegation token if required - */ -public class HiveSessionImplwithUGI extends HiveSessionImpl { - public static final String HS2TOKEN = "HiveServer2ImpersonationToken"; - - private UserGroupInformation sessionUgi = null; - private String delegationTokenStr = null; - private Hive sessionHive = null; - private HiveSession proxySession = null; - static final Log LOG = LogFactory.getLog(HiveSessionImplwithUGI.class); - - public HiveSessionImplwithUGI(TProtocolVersion protocol, String username, String password, - HiveConf hiveConf, String ipAddress, String delegationToken) throws HiveSQLException { - super(protocol, username, password, hiveConf, ipAddress); - setSessionUGI(username); - setDelegationToken(delegationToken); - - // create a new metastore connection for this particular user session - Hive.set(null); - try { - sessionHive = Hive.get(getHiveConf()); - } catch (HiveException e) { - throw new HiveSQLException("Failed to setup metastore connection", e); - } - } - - // setup appropriate UGI for the session - public void setSessionUGI(String owner) throws HiveSQLException { - if (owner == null) { - throw new HiveSQLException("No username provided for impersonation"); - } - if (UserGroupInformation.isSecurityEnabled()) { - try { - sessionUgi = UserGroupInformation.createProxyUser( - owner, UserGroupInformation.getLoginUser()); - } catch (IOException e) { - throw new HiveSQLException("Couldn't setup proxy user", e); - } - } else { - sessionUgi = UserGroupInformation.createRemoteUser(owner); - } - } - - public UserGroupInformation getSessionUgi() { - return this.sessionUgi; - } - - public String getDelegationToken() { - return this.delegationTokenStr; - } - - @Override - protected synchronized void acquire(boolean userAccess) { - super.acquire(userAccess); - // if we have a metastore connection with impersonation, then set it first - if (sessionHive != null) { - Hive.set(sessionHive); - } - } - - /** - * Close the file systems for the session and remove it from the FileSystem cache. - * Cancel the session's delegation token and close the metastore connection - */ - @Override - public void close() throws HiveSQLException { - try { - acquire(true); - cancelDelegationToken(); - } finally { - try { - super.close(); - } finally { - try { - FileSystem.closeAllForUGI(sessionUgi); - } catch (IOException ioe) { - throw new HiveSQLException("Could not clean up file-system handles for UGI: " - + sessionUgi, ioe); - } - } - } - } - - /** - * Enable delegation token for the session - * save the token string and set the token.signature in hive conf. The metastore client uses - * this token.signature to determine where to use kerberos or delegation token - * @throws HiveException - * @throws IOException - */ - private void setDelegationToken(String delegationTokenStr) throws HiveSQLException { - this.delegationTokenStr = delegationTokenStr; - if (delegationTokenStr != null) { - getHiveConf().set("hive.metastore.token.signature", HS2TOKEN); - try { - Utils.setTokenStr(sessionUgi, delegationTokenStr, HS2TOKEN); - } catch (IOException e) { - throw new HiveSQLException("Couldn't setup delegation token in the ugi", e); - } - } - } - - // If the session has a delegation token obtained from the metastore, then cancel it - private void cancelDelegationToken() throws HiveSQLException { - if (delegationTokenStr != null) { - try { - Hive.get(getHiveConf()).cancelDelegationToken(delegationTokenStr); - } catch (HiveException e) { - throw new HiveSQLException("Couldn't cancel delegation token", e); - } - // close the metastore connection created with this delegation token - Hive.closeCurrent(); - } - } - - @Override - protected HiveSession getSession() { - assert proxySession != null; - - return proxySession; - } - - public void setProxySession(HiveSession proxySession) { - this.proxySession = proxySession; - } - - @Override - public String getDelegationToken(HiveAuthFactory authFactory, String owner, - String renewer) throws HiveSQLException { - return authFactory.getDelegationToken(owner, renewer); - } - - @Override - public void cancelDelegationToken(HiveAuthFactory authFactory, String tokenStr) - throws HiveSQLException { - authFactory.cancelDelegationToken(tokenStr); - } - - @Override - public void renewDelegationToken(HiveAuthFactory authFactory, String tokenStr) - throws HiveSQLException { - authFactory.renewDelegationToken(tokenStr); - } - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/SessionManager.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/SessionManager.java deleted file mode 100644 index 859f9c8b449e5..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/session/SessionManager.java +++ /dev/null @@ -1,361 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.session; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.Future; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hive.service.CompositeService; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.SessionHandle; -import org.apache.hive.service.cli.operation.OperationManager; -import org.apache.hive.service.cli.thrift.TProtocolVersion; -import org.apache.hive.service.server.HiveServer2; -import org.apache.hive.service.server.ThreadFactoryWithGarbageCleanup; - -/** - * SessionManager. - * - */ -public class SessionManager extends CompositeService { - - private static final Log LOG = LogFactory.getLog(SessionManager.class); - public static final String HIVERCFILE = ".hiverc"; - private HiveConf hiveConf; - private final Map handleToSession = - new ConcurrentHashMap(); - private final OperationManager operationManager = new OperationManager(); - private ThreadPoolExecutor backgroundOperationPool; - private boolean isOperationLogEnabled; - private File operationLogRootDir; - - private long checkInterval; - private long sessionTimeout; - private boolean checkOperation; - - private volatile boolean shutdown; - // The HiveServer2 instance running this service - private final HiveServer2 hiveServer2; - - public SessionManager(HiveServer2 hiveServer2) { - super(SessionManager.class.getSimpleName()); - this.hiveServer2 = hiveServer2; - } - - @Override - public synchronized void init(HiveConf hiveConf) { - this.hiveConf = hiveConf; - //Create operation log root directory, if operation logging is enabled - if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED)) { - initOperationLogRootDir(); - } - createBackgroundOperationPool(); - addService(operationManager); - super.init(hiveConf); - } - - private void createBackgroundOperationPool() { - int poolSize = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_ASYNC_EXEC_THREADS); - LOG.info("HiveServer2: Background operation thread pool size: " + poolSize); - int poolQueueSize = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_ASYNC_EXEC_WAIT_QUEUE_SIZE); - LOG.info("HiveServer2: Background operation thread wait queue size: " + poolQueueSize); - long keepAliveTime = HiveConf.getTimeVar( - hiveConf, ConfVars.HIVE_SERVER2_ASYNC_EXEC_KEEPALIVE_TIME, TimeUnit.SECONDS); - LOG.info( - "HiveServer2: Background operation thread keepalive time: " + keepAliveTime + " seconds"); - - // Create a thread pool with #poolSize threads - // Threads terminate when they are idle for more than the keepAliveTime - // A bounded blocking queue is used to queue incoming operations, if #operations > poolSize - String threadPoolName = "HiveServer2-Background-Pool"; - backgroundOperationPool = new ThreadPoolExecutor(poolSize, poolSize, - keepAliveTime, TimeUnit.SECONDS, new LinkedBlockingQueue(poolQueueSize), - new ThreadFactoryWithGarbageCleanup(threadPoolName)); - backgroundOperationPool.allowCoreThreadTimeOut(true); - - checkInterval = HiveConf.getTimeVar( - hiveConf, ConfVars.HIVE_SERVER2_SESSION_CHECK_INTERVAL, TimeUnit.MILLISECONDS); - sessionTimeout = HiveConf.getTimeVar( - hiveConf, ConfVars.HIVE_SERVER2_IDLE_SESSION_TIMEOUT, TimeUnit.MILLISECONDS); - checkOperation = HiveConf.getBoolVar(hiveConf, - ConfVars.HIVE_SERVER2_IDLE_SESSION_CHECK_OPERATION); - } - - private void initOperationLogRootDir() { - operationLogRootDir = new File( - hiveConf.getVar(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LOG_LOCATION)); - isOperationLogEnabled = true; - - if (operationLogRootDir.exists() && !operationLogRootDir.isDirectory()) { - LOG.warn("The operation log root directory exists, but it is not a directory: " + - operationLogRootDir.getAbsolutePath()); - isOperationLogEnabled = false; - } - - if (!operationLogRootDir.exists()) { - if (!operationLogRootDir.mkdirs()) { - LOG.warn("Unable to create operation log root directory: " + - operationLogRootDir.getAbsolutePath()); - isOperationLogEnabled = false; - } - } - - if (isOperationLogEnabled) { - LOG.info("Operation log root directory is created: " + operationLogRootDir.getAbsolutePath()); - try { - FileUtils.forceDeleteOnExit(operationLogRootDir); - } catch (IOException e) { - LOG.warn("Failed to schedule cleanup HS2 operation logging root dir: " + - operationLogRootDir.getAbsolutePath(), e); - } - } - } - - @Override - public synchronized void start() { - super.start(); - if (checkInterval > 0) { - startTimeoutChecker(); - } - } - - private void startTimeoutChecker() { - final long interval = Math.max(checkInterval, 3000L); // minimum 3 seconds - Runnable timeoutChecker = new Runnable() { - @Override - public void run() { - for (sleepInterval(interval); !shutdown; sleepInterval(interval)) { - long current = System.currentTimeMillis(); - for (HiveSession session : new ArrayList(handleToSession.values())) { - if (sessionTimeout > 0 && session.getLastAccessTime() + sessionTimeout <= current - && (!checkOperation || session.getNoOperationTime() > sessionTimeout)) { - SessionHandle handle = session.getSessionHandle(); - LOG.warn("Session " + handle + " is Timed-out (last access : " + - new Date(session.getLastAccessTime()) + ") and will be closed"); - try { - closeSession(handle); - } catch (HiveSQLException e) { - LOG.warn("Exception is thrown closing session " + handle, e); - } - } else { - session.closeExpiredOperations(); - } - } - } - } - - private void sleepInterval(long interval) { - try { - Thread.sleep(interval); - } catch (InterruptedException e) { - // ignore - } - } - }; - backgroundOperationPool.execute(timeoutChecker); - } - - @Override - public synchronized void stop() { - super.stop(); - shutdown = true; - if (backgroundOperationPool != null) { - backgroundOperationPool.shutdown(); - long timeout = hiveConf.getTimeVar( - ConfVars.HIVE_SERVER2_ASYNC_EXEC_SHUTDOWN_TIMEOUT, TimeUnit.SECONDS); - try { - backgroundOperationPool.awaitTermination(timeout, TimeUnit.SECONDS); - } catch (InterruptedException e) { - LOG.warn("HIVE_SERVER2_ASYNC_EXEC_SHUTDOWN_TIMEOUT = " + timeout + - " seconds has been exceeded. RUNNING background operations will be shut down", e); - } - backgroundOperationPool = null; - } - cleanupLoggingRootDir(); - } - - private void cleanupLoggingRootDir() { - if (isOperationLogEnabled) { - try { - FileUtils.forceDelete(operationLogRootDir); - } catch (Exception e) { - LOG.warn("Failed to cleanup root dir of HS2 logging: " + operationLogRootDir - .getAbsolutePath(), e); - } - } - } - - public SessionHandle openSession(TProtocolVersion protocol, String username, String password, String ipAddress, - Map sessionConf) throws HiveSQLException { - return openSession(protocol, username, password, ipAddress, sessionConf, false, null); - } - - /** - * Opens a new session and creates a session handle. - * The username passed to this method is the effective username. - * If withImpersonation is true (==doAs true) we wrap all the calls in HiveSession - * within a UGI.doAs, where UGI corresponds to the effective user. - * - * Please see {@code org.apache.hive.service.cli.thrift.ThriftCLIService.getUserName()} for - * more details. - * - * @param protocol - * @param username - * @param password - * @param ipAddress - * @param sessionConf - * @param withImpersonation - * @param delegationToken - * @return - * @throws HiveSQLException - */ - public SessionHandle openSession(TProtocolVersion protocol, String username, String password, String ipAddress, - Map sessionConf, boolean withImpersonation, String delegationToken) - throws HiveSQLException { - HiveSession session; - // If doAs is set to true for HiveServer2, we will create a proxy object for the session impl. - // Within the proxy object, we wrap the method call in a UserGroupInformation#doAs - if (withImpersonation) { - HiveSessionImplwithUGI sessionWithUGI = new HiveSessionImplwithUGI(protocol, username, password, - hiveConf, ipAddress, delegationToken); - session = HiveSessionProxy.getProxy(sessionWithUGI, sessionWithUGI.getSessionUgi()); - sessionWithUGI.setProxySession(session); - } else { - session = new HiveSessionImpl(protocol, username, password, hiveConf, ipAddress); - } - session.setSessionManager(this); - session.setOperationManager(operationManager); - try { - session.open(sessionConf); - } catch (Exception e) { - try { - session.close(); - } catch (Throwable t) { - LOG.warn("Error closing session", t); - } - session = null; - throw new HiveSQLException("Failed to open new session: " + e, e); - } - if (isOperationLogEnabled) { - session.setOperationLogSessionDir(operationLogRootDir); - } - handleToSession.put(session.getSessionHandle(), session); - return session.getSessionHandle(); - } - - public void closeSession(SessionHandle sessionHandle) throws HiveSQLException { - HiveSession session = handleToSession.remove(sessionHandle); - if (session == null) { - throw new HiveSQLException("Session does not exist!"); - } - session.close(); - } - - public HiveSession getSession(SessionHandle sessionHandle) throws HiveSQLException { - HiveSession session = handleToSession.get(sessionHandle); - if (session == null) { - throw new HiveSQLException("Invalid SessionHandle: " + sessionHandle); - } - return session; - } - - public OperationManager getOperationManager() { - return operationManager; - } - - private static ThreadLocal threadLocalIpAddress = new ThreadLocal() { - @Override - protected synchronized String initialValue() { - return null; - } - }; - - public static void setIpAddress(String ipAddress) { - threadLocalIpAddress.set(ipAddress); - } - - public static void clearIpAddress() { - threadLocalIpAddress.remove(); - } - - public static String getIpAddress() { - return threadLocalIpAddress.get(); - } - - private static ThreadLocal threadLocalUserName = new ThreadLocal(){ - @Override - protected synchronized String initialValue() { - return null; - } - }; - - public static void setUserName(String userName) { - threadLocalUserName.set(userName); - } - - public static void clearUserName() { - threadLocalUserName.remove(); - } - - public static String getUserName() { - return threadLocalUserName.get(); - } - - private static ThreadLocal threadLocalProxyUserName = new ThreadLocal(){ - @Override - protected synchronized String initialValue() { - return null; - } - }; - - public static void setProxyUserName(String userName) { - LOG.debug("setting proxy user name based on query param to: " + userName); - threadLocalProxyUserName.set(userName); - } - - public static String getProxyUserName() { - return threadLocalProxyUserName.get(); - } - - public static void clearProxyUserName() { - threadLocalProxyUserName.remove(); - } - - public Future submitBackgroundOperation(Runnable r) { - return backgroundOperationPool.submit(r); - } - - public int getOpenSessionCount() { - return handleToSession.size(); - } -} - diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java deleted file mode 100644 index 21b8bf7de75ce..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java +++ /dev/null @@ -1,108 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.thrift; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hadoop.hive.shims.ShimLoader; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.cli.CLIService; -import org.apache.hive.service.server.ThreadFactoryWithGarbageCleanup; -import org.apache.thrift.TProcessorFactory; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.thrift.server.TThreadPoolServer; -import org.apache.thrift.transport.TServerSocket; -import org.apache.thrift.transport.TTransportFactory; - - -public class ThriftBinaryCLIService extends ThriftCLIService { - - public ThriftBinaryCLIService(CLIService cliService) { - super(cliService, ThriftBinaryCLIService.class.getSimpleName()); - } - - @Override - public void run() { - try { - // Server thread pool - String threadPoolName = "HiveServer2-Handler-Pool"; - ExecutorService executorService = new ThreadPoolExecutor(minWorkerThreads, maxWorkerThreads, - workerKeepAliveTime, TimeUnit.SECONDS, new SynchronousQueue(), - new ThreadFactoryWithGarbageCleanup(threadPoolName)); - - // Thrift configs - hiveAuthFactory = new HiveAuthFactory(hiveConf); - TTransportFactory transportFactory = hiveAuthFactory.getAuthTransFactory(); - TProcessorFactory processorFactory = hiveAuthFactory.getAuthProcFactory(this); - TServerSocket serverSocket = null; - List sslVersionBlacklist = new ArrayList(); - for (String sslVersion : hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(",")) { - sslVersionBlacklist.add(sslVersion); - } - if (!hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_USE_SSL)) { - serverSocket = HiveAuthFactory.getServerSocket(hiveHost, portNum); - } else { - String keyStorePath = hiveConf.getVar(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH).trim(); - if (keyStorePath.isEmpty()) { - throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname - + " Not configured for SSL connection"); - } - String keyStorePassword = ShimLoader.getHadoopShims().getPassword(hiveConf, - HiveConf.ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname); - serverSocket = HiveAuthFactory.getServerSSLSocket(hiveHost, portNum, keyStorePath, - keyStorePassword, sslVersionBlacklist); - } - - // Server args - int maxMessageSize = hiveConf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_MAX_MESSAGE_SIZE); - int requestTimeout = (int) hiveConf.getTimeVar( - HiveConf.ConfVars.HIVE_SERVER2_THRIFT_LOGIN_TIMEOUT, TimeUnit.SECONDS); - int beBackoffSlotLength = (int) hiveConf.getTimeVar( - HiveConf.ConfVars.HIVE_SERVER2_THRIFT_LOGIN_BEBACKOFF_SLOT_LENGTH, TimeUnit.MILLISECONDS); - TThreadPoolServer.Args sargs = new TThreadPoolServer.Args(serverSocket) - .processorFactory(processorFactory).transportFactory(transportFactory) - .protocolFactory(new TBinaryProtocol.Factory()) - .inputProtocolFactory(new TBinaryProtocol.Factory(true, true, maxMessageSize, maxMessageSize)) - .requestTimeout(requestTimeout).requestTimeoutUnit(TimeUnit.SECONDS) - .beBackoffSlotLength(beBackoffSlotLength).beBackoffSlotLengthUnit(TimeUnit.MILLISECONDS) - .executorService(executorService); - - // TCP Server - server = new TThreadPoolServer(sargs); - server.setServerEventHandler(serverEventHandler); - String msg = "Starting " + ThriftBinaryCLIService.class.getSimpleName() + " on port " - + serverSocket.getServerSocket().getLocalPort() + " with " + minWorkerThreads + "..." + maxWorkerThreads + " worker threads"; - LOG.info(msg); - server.serve(); - } catch (Throwable t) { - LOG.fatal( - "Error starting HiveServer2: could not start " - + ThriftBinaryCLIService.class.getSimpleName(), t); - System.exit(-1); - } - } - -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java deleted file mode 100644 index 8fce9d9383438..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java +++ /dev/null @@ -1,689 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.thrift; - -import javax.security.auth.login.LoginException; -import java.io.IOException; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hive.service.AbstractService; -import org.apache.hive.service.ServiceException; -import org.apache.hive.service.ServiceUtils; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.auth.TSetIpAddressProcessor; -import org.apache.hive.service.cli.*; -import org.apache.hive.service.cli.session.SessionManager; -import org.apache.hive.service.server.HiveServer2; -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.server.ServerContext; -import org.apache.thrift.server.TServer; -import org.apache.thrift.server.TServerEventHandler; -import org.apache.thrift.transport.TTransport; - -/** - * ThriftCLIService. - * - */ -public abstract class ThriftCLIService extends AbstractService implements TCLIService.Iface, Runnable { - - public static final Log LOG = LogFactory.getLog(ThriftCLIService.class.getName()); - - protected CLIService cliService; - private static final TStatus OK_STATUS = new TStatus(TStatusCode.SUCCESS_STATUS); - protected static HiveAuthFactory hiveAuthFactory; - - protected int portNum; - protected InetAddress serverIPAddress; - protected String hiveHost; - protected TServer server; - protected org.eclipse.jetty.server.Server httpServer; - - private boolean isStarted = false; - protected boolean isEmbedded = false; - - protected HiveConf hiveConf; - - protected int minWorkerThreads; - protected int maxWorkerThreads; - protected long workerKeepAliveTime; - - protected TServerEventHandler serverEventHandler; - protected ThreadLocal currentServerContext; - - static class ThriftCLIServerContext implements ServerContext { - private SessionHandle sessionHandle = null; - - public void setSessionHandle(SessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public SessionHandle getSessionHandle() { - return sessionHandle; - } - } - - public ThriftCLIService(CLIService service, String serviceName) { - super(serviceName); - this.cliService = service; - currentServerContext = new ThreadLocal(); - serverEventHandler = new TServerEventHandler() { - @Override - public ServerContext createContext( - TProtocol input, TProtocol output) { - return new ThriftCLIServerContext(); - } - - @Override - public void deleteContext(ServerContext serverContext, - TProtocol input, TProtocol output) { - ThriftCLIServerContext context = (ThriftCLIServerContext)serverContext; - SessionHandle sessionHandle = context.getSessionHandle(); - if (sessionHandle != null) { - LOG.info("Session disconnected without closing properly, close it now"); - try { - cliService.closeSession(sessionHandle); - } catch (HiveSQLException e) { - LOG.warn("Failed to close session: " + e, e); - } - } - } - - @Override - public void preServe() { - } - - @Override - public void processContext(ServerContext serverContext, - TTransport input, TTransport output) { - currentServerContext.set(serverContext); - } - }; - } - - @Override - public synchronized void init(HiveConf hiveConf) { - this.hiveConf = hiveConf; - // Initialize common server configs needed in both binary & http modes - String portString; - hiveHost = System.getenv("HIVE_SERVER2_THRIFT_BIND_HOST"); - if (hiveHost == null) { - hiveHost = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST); - } - try { - if (hiveHost != null && !hiveHost.isEmpty()) { - serverIPAddress = InetAddress.getByName(hiveHost); - } else { - serverIPAddress = InetAddress.getLocalHost(); - } - } catch (UnknownHostException e) { - throw new ServiceException(e); - } - // HTTP mode - if (HiveServer2.isHTTPTransportMode(hiveConf)) { - workerKeepAliveTime = - hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_WORKER_KEEPALIVE_TIME, - TimeUnit.SECONDS); - portString = System.getenv("HIVE_SERVER2_THRIFT_HTTP_PORT"); - if (portString != null) { - portNum = Integer.valueOf(portString); - } else { - portNum = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT); - } - } - // Binary mode - else { - workerKeepAliveTime = - hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_WORKER_KEEPALIVE_TIME, TimeUnit.SECONDS); - portString = System.getenv("HIVE_SERVER2_THRIFT_PORT"); - if (portString != null) { - portNum = Integer.valueOf(portString); - } else { - portNum = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_PORT); - } - } - minWorkerThreads = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_MIN_WORKER_THREADS); - maxWorkerThreads = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_MAX_WORKER_THREADS); - super.init(hiveConf); - } - - @Override - public synchronized void start() { - super.start(); - if (!isStarted && !isEmbedded) { - new Thread(this).start(); - isStarted = true; - } - } - - @Override - public synchronized void stop() { - if (isStarted && !isEmbedded) { - if(server != null) { - server.stop(); - LOG.info("Thrift server has stopped"); - } - if((httpServer != null) && httpServer.isStarted()) { - try { - httpServer.stop(); - LOG.info("Http server has stopped"); - } catch (Exception e) { - LOG.error("Error stopping Http server: ", e); - } - } - isStarted = false; - } - super.stop(); - } - - public int getPortNumber() { - return portNum; - } - - public InetAddress getServerIPAddress() { - return serverIPAddress; - } - - @Override - public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) - throws TException { - TGetDelegationTokenResp resp = new TGetDelegationTokenResp(); - resp.setStatus(notSupportTokenErrorStatus()); - return resp; - } - - @Override - public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) - throws TException { - TCancelDelegationTokenResp resp = new TCancelDelegationTokenResp(); - resp.setStatus(notSupportTokenErrorStatus()); - return resp; - } - - @Override - public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) - throws TException { - TRenewDelegationTokenResp resp = new TRenewDelegationTokenResp(); - resp.setStatus(notSupportTokenErrorStatus()); - return resp; - } - - private TStatus notSupportTokenErrorStatus() { - TStatus errorStatus = new TStatus(TStatusCode.ERROR_STATUS); - errorStatus.setErrorMessage("Delegation token is not supported"); - return errorStatus; - } - - @Override - public TOpenSessionResp OpenSession(TOpenSessionReq req) throws TException { - LOG.info("Client protocol version: " + req.getClient_protocol()); - TOpenSessionResp resp = new TOpenSessionResp(); - try { - SessionHandle sessionHandle = getSessionHandle(req, resp); - resp.setSessionHandle(sessionHandle.toTSessionHandle()); - // TODO: set real configuration map - resp.setConfiguration(new HashMap()); - resp.setStatus(OK_STATUS); - ThriftCLIServerContext context = - (ThriftCLIServerContext)currentServerContext.get(); - if (context != null) { - context.setSessionHandle(sessionHandle); - } - } catch (Exception e) { - LOG.warn("Error opening session: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - private String getIpAddress() { - String clientIpAddress; - // Http transport mode. - // We set the thread local ip address, in ThriftHttpServlet. - if (cliService.getHiveConf().getVar( - ConfVars.HIVE_SERVER2_TRANSPORT_MODE).equalsIgnoreCase("http")) { - clientIpAddress = SessionManager.getIpAddress(); - } - else { - // Kerberos - if (isKerberosAuthMode()) { - clientIpAddress = hiveAuthFactory.getIpAddress(); - } - // Except kerberos, NOSASL - else { - clientIpAddress = TSetIpAddressProcessor.getUserIpAddress(); - } - } - LOG.debug("Client's IP Address: " + clientIpAddress); - return clientIpAddress; - } - - /** - * Returns the effective username. - * 1. If hive.server2.allow.user.substitution = false: the username of the connecting user - * 2. If hive.server2.allow.user.substitution = true: the username of the end user, - * that the connecting user is trying to proxy for. - * This includes a check whether the connecting user is allowed to proxy for the end user. - * @param req - * @return - * @throws HiveSQLException - */ - private String getUserName(TOpenSessionReq req) throws HiveSQLException { - String userName = null; - // Kerberos - if (isKerberosAuthMode()) { - userName = hiveAuthFactory.getRemoteUser(); - } - // Except kerberos, NOSASL - if (userName == null) { - userName = TSetIpAddressProcessor.getUserName(); - } - // Http transport mode. - // We set the thread local username, in ThriftHttpServlet. - if (cliService.getHiveConf().getVar( - ConfVars.HIVE_SERVER2_TRANSPORT_MODE).equalsIgnoreCase("http")) { - userName = SessionManager.getUserName(); - } - if (userName == null) { - userName = req.getUsername(); - } - - userName = getShortName(userName); - String effectiveClientUser = getProxyUser(userName, req.getConfiguration(), getIpAddress()); - LOG.debug("Client's username: " + effectiveClientUser); - return effectiveClientUser; - } - - private String getShortName(String userName) { - String ret = null; - if (userName != null) { - int indexOfDomainMatch = ServiceUtils.indexOfDomainMatch(userName); - ret = (indexOfDomainMatch <= 0) ? userName : - userName.substring(0, indexOfDomainMatch); - } - - return ret; - } - - /** - * Create a session handle - * @param req - * @param res - * @return - * @throws HiveSQLException - * @throws LoginException - * @throws IOException - */ - SessionHandle getSessionHandle(TOpenSessionReq req, TOpenSessionResp res) - throws HiveSQLException, LoginException, IOException { - String userName = getUserName(req); - String ipAddress = getIpAddress(); - TProtocolVersion protocol = getMinVersion(CLIService.SERVER_VERSION, - req.getClient_protocol()); - res.setServerProtocolVersion(protocol); - SessionHandle sessionHandle; - if (cliService.getHiveConf().getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS) && - (userName != null)) { - String delegationTokenStr = getDelegationToken(userName); - sessionHandle = cliService.openSessionWithImpersonation(protocol, userName, - req.getPassword(), ipAddress, req.getConfiguration(), delegationTokenStr); - } else { - sessionHandle = cliService.openSession(protocol, userName, req.getPassword(), - ipAddress, req.getConfiguration()); - } - return sessionHandle; - } - - - private String getDelegationToken(String userName) - throws HiveSQLException, LoginException, IOException { - if (userName == null || !cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) - .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString())) { - return null; - } - try { - return cliService.getDelegationTokenFromMetaStore(userName); - } catch (UnsupportedOperationException e) { - // The delegation token is not applicable in the given deployment mode - } - return null; - } - - private TProtocolVersion getMinVersion(TProtocolVersion... versions) { - TProtocolVersion[] values = TProtocolVersion.values(); - int current = values[values.length - 1].getValue(); - for (TProtocolVersion version : versions) { - if (current > version.getValue()) { - current = version.getValue(); - } - } - for (TProtocolVersion version : values) { - if (version.getValue() == current) { - return version; - } - } - throw new IllegalArgumentException("never"); - } - - @Override - public TCloseSessionResp CloseSession(TCloseSessionReq req) throws TException { - TCloseSessionResp resp = new TCloseSessionResp(); - try { - SessionHandle sessionHandle = new SessionHandle(req.getSessionHandle()); - cliService.closeSession(sessionHandle); - resp.setStatus(OK_STATUS); - ThriftCLIServerContext context = - (ThriftCLIServerContext)currentServerContext.get(); - if (context != null) { - context.setSessionHandle(null); - } - } catch (Exception e) { - LOG.warn("Error closing session: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetInfoResp GetInfo(TGetInfoReq req) throws TException { - TGetInfoResp resp = new TGetInfoResp(); - try { - GetInfoValue getInfoValue = - cliService.getInfo(new SessionHandle(req.getSessionHandle()), - GetInfoType.getGetInfoType(req.getInfoType())); - resp.setInfoValue(getInfoValue.toTGetInfoValue()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting info: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws TException { - TExecuteStatementResp resp = new TExecuteStatementResp(); - try { - SessionHandle sessionHandle = new SessionHandle(req.getSessionHandle()); - String statement = req.getStatement(); - Map confOverlay = req.getConfOverlay(); - Boolean runAsync = req.isRunAsync(); - OperationHandle operationHandle = runAsync ? - cliService.executeStatementAsync(sessionHandle, statement, confOverlay) - : cliService.executeStatement(sessionHandle, statement, confOverlay); - resp.setOperationHandle(operationHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error executing statement: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws TException { - TGetTypeInfoResp resp = new TGetTypeInfoResp(); - try { - OperationHandle operationHandle = cliService.getTypeInfo(new SessionHandle(req.getSessionHandle())); - resp.setOperationHandle(operationHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting type info: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws TException { - TGetCatalogsResp resp = new TGetCatalogsResp(); - try { - OperationHandle opHandle = cliService.getCatalogs(new SessionHandle(req.getSessionHandle())); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting catalogs: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws TException { - TGetSchemasResp resp = new TGetSchemasResp(); - try { - OperationHandle opHandle = cliService.getSchemas( - new SessionHandle(req.getSessionHandle()), req.getCatalogName(), req.getSchemaName()); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting schemas: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetTablesResp GetTables(TGetTablesReq req) throws TException { - TGetTablesResp resp = new TGetTablesResp(); - try { - OperationHandle opHandle = cliService - .getTables(new SessionHandle(req.getSessionHandle()), req.getCatalogName(), - req.getSchemaName(), req.getTableName(), req.getTableTypes()); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting tables: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws TException { - TGetTableTypesResp resp = new TGetTableTypesResp(); - try { - OperationHandle opHandle = cliService.getTableTypes(new SessionHandle(req.getSessionHandle())); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting table types: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetColumnsResp GetColumns(TGetColumnsReq req) throws TException { - TGetColumnsResp resp = new TGetColumnsResp(); - try { - OperationHandle opHandle = cliService.getColumns( - new SessionHandle(req.getSessionHandle()), - req.getCatalogName(), - req.getSchemaName(), - req.getTableName(), - req.getColumnName()); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting columns: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws TException { - TGetFunctionsResp resp = new TGetFunctionsResp(); - try { - OperationHandle opHandle = cliService.getFunctions( - new SessionHandle(req.getSessionHandle()), req.getCatalogName(), - req.getSchemaName(), req.getFunctionName()); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting functions: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws TException { - TGetOperationStatusResp resp = new TGetOperationStatusResp(); - try { - OperationStatus operationStatus = cliService.getOperationStatus( - new OperationHandle(req.getOperationHandle())); - resp.setOperationState(operationStatus.getState().toTOperationState()); - HiveSQLException opException = operationStatus.getOperationException(); - if (opException != null) { - resp.setSqlState(opException.getSQLState()); - resp.setErrorCode(opException.getErrorCode()); - resp.setErrorMessage(opException.getMessage()); - } - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting operation status: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException { - TCancelOperationResp resp = new TCancelOperationResp(); - try { - cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error cancelling operation: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws TException { - TCloseOperationResp resp = new TCloseOperationResp(); - try { - cliService.closeOperation(new OperationHandle(req.getOperationHandle())); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error closing operation: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) - throws TException { - TGetResultSetMetadataResp resp = new TGetResultSetMetadataResp(); - try { - TableSchema schema = cliService.getResultSetMetadata(new OperationHandle(req.getOperationHandle())); - resp.setSchema(schema.toTTableSchema()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting result set metadata: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TFetchResultsResp FetchResults(TFetchResultsReq req) throws TException { - TFetchResultsResp resp = new TFetchResultsResp(); - try { - RowSet rowSet = cliService.fetchResults( - new OperationHandle(req.getOperationHandle()), - FetchOrientation.getFetchOrientation(req.getOrientation()), - req.getMaxRows(), - FetchType.getFetchType(req.getFetchType())); - resp.setResults(rowSet.toTRowSet()); - resp.setHasMoreRows(false); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error fetching results: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public abstract void run(); - - /** - * If the proxy user name is provided then check privileges to substitute the user. - * @param realUser - * @param sessionConf - * @param ipAddress - * @return - * @throws HiveSQLException - */ - private String getProxyUser(String realUser, Map sessionConf, - String ipAddress) throws HiveSQLException { - String proxyUser = null; - // Http transport mode. - // We set the thread local proxy username, in ThriftHttpServlet. - if (cliService.getHiveConf().getVar( - ConfVars.HIVE_SERVER2_TRANSPORT_MODE).equalsIgnoreCase("http")) { - proxyUser = SessionManager.getProxyUserName(); - LOG.debug("Proxy user from query string: " + proxyUser); - } - - if (proxyUser == null && sessionConf != null && sessionConf.containsKey(HiveAuthFactory.HS2_PROXY_USER)) { - String proxyUserFromThriftBody = sessionConf.get(HiveAuthFactory.HS2_PROXY_USER); - LOG.debug("Proxy user from thrift body: " + proxyUserFromThriftBody); - proxyUser = proxyUserFromThriftBody; - } - - if (proxyUser == null) { - return realUser; - } - - // check whether substitution is allowed - if (!hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ALLOW_USER_SUBSTITUTION)) { - throw new HiveSQLException("Proxy user substitution is not allowed"); - } - - // If there's no authentication, then directly substitute the user - if (HiveAuthFactory.AuthTypes.NONE.toString() - .equalsIgnoreCase(hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION))) { - return proxyUser; - } - - // Verify proxy user privilege of the realUser for the proxyUser - HiveAuthFactory.verifyProxyAccess(realUser, proxyUser, ipAddress, hiveConf); - LOG.debug("Verified proxy user: " + proxyUser); - return proxyUser; - } - - private boolean isKerberosAuthMode() { - return cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) - .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java deleted file mode 100644 index 1af45398b895c..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java +++ /dev/null @@ -1,440 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.thrift; - -import java.util.List; -import java.util.Map; - -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.cli.*; -import org.apache.thrift.TException; - -/** - * ThriftCLIServiceClient. - * - */ -public class ThriftCLIServiceClient extends CLIServiceClient { - private final TCLIService.Iface cliService; - - public ThriftCLIServiceClient(TCLIService.Iface cliService) { - this.cliService = cliService; - } - - public void checkStatus(TStatus status) throws HiveSQLException { - if (TStatusCode.ERROR_STATUS.equals(status.getStatusCode())) { - throw new HiveSQLException(status); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map) - */ - @Override - public SessionHandle openSession(String username, String password, - Map configuration) - throws HiveSQLException { - try { - TOpenSessionReq req = new TOpenSessionReq(); - req.setUsername(username); - req.setPassword(password); - req.setConfiguration(configuration); - TOpenSessionResp resp = cliService.OpenSession(req); - checkStatus(resp.getStatus()); - return new SessionHandle(resp.getSessionHandle(), resp.getServerProtocolVersion()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#closeSession(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public SessionHandle openSessionWithImpersonation(String username, String password, - Map configuration, String delegationToken) throws HiveSQLException { - throw new HiveSQLException("open with impersonation operation is not supported in the client"); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#closeSession(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public void closeSession(SessionHandle sessionHandle) throws HiveSQLException { - try { - TCloseSessionReq req = new TCloseSessionReq(sessionHandle.toTSessionHandle()); - TCloseSessionResp resp = cliService.CloseSession(req); - checkStatus(resp.getStatus()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getInfo(org.apache.hive.service.cli.SessionHandle, java.util.List) - */ - @Override - public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) - throws HiveSQLException { - try { - // FIXME extract the right info type - TGetInfoReq req = new TGetInfoReq(sessionHandle.toTSessionHandle(), infoType.toTGetInfoType()); - TGetInfoResp resp = cliService.GetInfo(req); - checkStatus(resp.getStatus()); - return new GetInfoValue(resp.getInfoValue()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#executeStatement(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.util.Map) - */ - @Override - public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, - Map confOverlay) - throws HiveSQLException { - return executeStatementInternal(sessionHandle, statement, confOverlay, false); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#executeStatementAsync(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.util.Map) - */ - @Override - public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, - Map confOverlay) - throws HiveSQLException { - return executeStatementInternal(sessionHandle, statement, confOverlay, true); - } - - private OperationHandle executeStatementInternal(SessionHandle sessionHandle, String statement, - Map confOverlay, boolean isAsync) - throws HiveSQLException { - try { - TExecuteStatementReq req = - new TExecuteStatementReq(sessionHandle.toTSessionHandle(), statement); - req.setConfOverlay(confOverlay); - req.setRunAsync(isAsync); - TExecuteStatementResp resp = cliService.ExecuteStatement(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getTypeInfo(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getTypeInfo(SessionHandle sessionHandle) throws HiveSQLException { - try { - TGetTypeInfoReq req = new TGetTypeInfoReq(sessionHandle.toTSessionHandle()); - TGetTypeInfoResp resp = cliService.GetTypeInfo(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getCatalogs(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getCatalogs(SessionHandle sessionHandle) throws HiveSQLException { - try { - TGetCatalogsReq req = new TGetCatalogsReq(sessionHandle.toTSessionHandle()); - TGetCatalogsResp resp = cliService.GetCatalogs(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getSchemas(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String) - */ - @Override - public OperationHandle getSchemas(SessionHandle sessionHandle, String catalogName, - String schemaName) - throws HiveSQLException { - try { - TGetSchemasReq req = new TGetSchemasReq(sessionHandle.toTSessionHandle()); - req.setCatalogName(catalogName); - req.setSchemaName(schemaName); - TGetSchemasResp resp = cliService.GetSchemas(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getTables(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.util.List) - */ - @Override - public OperationHandle getTables(SessionHandle sessionHandle, String catalogName, - String schemaName, String tableName, List tableTypes) - throws HiveSQLException { - try { - TGetTablesReq req = new TGetTablesReq(sessionHandle.toTSessionHandle()); - req.setTableName(tableName); - req.setTableTypes(tableTypes); - req.setSchemaName(schemaName); - TGetTablesResp resp = cliService.GetTables(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getTableTypes(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getTableTypes(SessionHandle sessionHandle) throws HiveSQLException { - try { - TGetTableTypesReq req = new TGetTableTypesReq(sessionHandle.toTSessionHandle()); - TGetTableTypesResp resp = cliService.GetTableTypes(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getColumns(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getColumns(SessionHandle sessionHandle, - String catalogName, String schemaName, String tableName, String columnName) - throws HiveSQLException { - try { - TGetColumnsReq req = new TGetColumnsReq(); - req.setSessionHandle(sessionHandle.toTSessionHandle()); - req.setCatalogName(catalogName); - req.setSchemaName(schemaName); - req.setTableName(tableName); - req.setColumnName(columnName); - TGetColumnsResp resp = cliService.GetColumns(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getFunctions(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getFunctions(SessionHandle sessionHandle, - String catalogName, String schemaName, String functionName) throws HiveSQLException { - try { - TGetFunctionsReq req = new TGetFunctionsReq(sessionHandle.toTSessionHandle(), functionName); - req.setCatalogName(catalogName); - req.setSchemaName(schemaName); - TGetFunctionsResp resp = cliService.GetFunctions(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getOperationStatus(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public OperationStatus getOperationStatus(OperationHandle opHandle) throws HiveSQLException { - try { - TGetOperationStatusReq req = new TGetOperationStatusReq(opHandle.toTOperationHandle()); - TGetOperationStatusResp resp = cliService.GetOperationStatus(req); - // Checks the status of the RPC call, throws an exception in case of error - checkStatus(resp.getStatus()); - OperationState opState = OperationState.getOperationState(resp.getOperationState()); - HiveSQLException opException = null; - if (opState == OperationState.ERROR) { - opException = new HiveSQLException(resp.getErrorMessage(), resp.getSqlState(), resp.getErrorCode()); - } - return new OperationStatus(opState, opException); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#cancelOperation(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public void cancelOperation(OperationHandle opHandle) throws HiveSQLException { - try { - TCancelOperationReq req = new TCancelOperationReq(opHandle.toTOperationHandle()); - TCancelOperationResp resp = cliService.CancelOperation(req); - checkStatus(resp.getStatus()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#closeOperation(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public void closeOperation(OperationHandle opHandle) - throws HiveSQLException { - try { - TCloseOperationReq req = new TCloseOperationReq(opHandle.toTOperationHandle()); - TCloseOperationResp resp = cliService.CloseOperation(req); - checkStatus(resp.getStatus()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getResultSetMetadata(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public TableSchema getResultSetMetadata(OperationHandle opHandle) - throws HiveSQLException { - try { - TGetResultSetMetadataReq req = new TGetResultSetMetadataReq(opHandle.toTOperationHandle()); - TGetResultSetMetadataResp resp = cliService.GetResultSetMetadata(req); - checkStatus(resp.getStatus()); - return new TableSchema(resp.getSchema()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - @Override - public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, long maxRows, - FetchType fetchType) throws HiveSQLException { - try { - TFetchResultsReq req = new TFetchResultsReq(); - req.setOperationHandle(opHandle.toTOperationHandle()); - req.setOrientation(orientation.toTFetchOrientation()); - req.setMaxRows(maxRows); - req.setFetchType(fetchType.toTFetchType()); - TFetchResultsResp resp = cliService.FetchResults(req); - checkStatus(resp.getStatus()); - return RowSetFactory.create(resp.getResults(), opHandle.getProtocolVersion()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#fetchResults(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public RowSet fetchResults(OperationHandle opHandle) throws HiveSQLException { - // TODO: set the correct default fetch size - return fetchResults(opHandle, FetchOrientation.FETCH_NEXT, 10000, FetchType.QUERY_OUTPUT); - } - - @Override - public String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String owner, String renewer) throws HiveSQLException { - TGetDelegationTokenReq req = new TGetDelegationTokenReq( - sessionHandle.toTSessionHandle(), owner, renewer); - try { - TGetDelegationTokenResp tokenResp = cliService.GetDelegationToken(req); - checkStatus(tokenResp.getStatus()); - return tokenResp.getDelegationToken(); - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - @Override - public void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException { - TCancelDelegationTokenReq cancelReq = new TCancelDelegationTokenReq( - sessionHandle.toTSessionHandle(), tokenStr); - try { - TCancelDelegationTokenResp cancelResp = - cliService.CancelDelegationToken(cancelReq); - checkStatus(cancelResp.getStatus()); - return; - } catch (TException e) { - throw new HiveSQLException(e); - } - } - - @Override - public void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException { - TRenewDelegationTokenReq cancelReq = new TRenewDelegationTokenReq( - sessionHandle.toTSessionHandle(), tokenStr); - try { - TRenewDelegationTokenResp renewResp = - cliService.RenewDelegationToken(cancelReq); - checkStatus(renewResp.getStatus()); - return; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java deleted file mode 100644 index 504e63dbc5e5e..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.thrift; - -import java.util.Arrays; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hadoop.hive.shims.ShimLoader; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hadoop.util.Shell; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.cli.CLIService; -import org.apache.hive.service.cli.thrift.TCLIService.Iface; -import org.apache.hive.service.server.ThreadFactoryWithGarbageCleanup; -import org.apache.thrift.TProcessor; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.thrift.protocol.TProtocolFactory; -import org.apache.thrift.server.TServlet; -import org.eclipse.jetty.server.AbstractConnectionFactory; -import org.eclipse.jetty.server.ConnectionFactory; -import org.eclipse.jetty.server.HttpConnectionFactory; -import org.eclipse.jetty.server.ServerConnector; -import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.ssl.SslContextFactory; -import org.eclipse.jetty.util.thread.ExecutorThreadPool; -import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; - - -public class ThriftHttpCLIService extends ThriftCLIService { - - public ThriftHttpCLIService(CLIService cliService) { - super(cliService, ThriftHttpCLIService.class.getSimpleName()); - } - - /** - * Configure Jetty to serve http requests. Example of a client connection URL: - * http://localhost:10000/servlets/thrifths2/ A gateway may cause actual target URL to differ, - * e.g. http://gateway:port/hive2/servlets/thrifths2/ - */ - @Override - public void run() { - try { - // Server thread pool - // Start with minWorkerThreads, expand till maxWorkerThreads and reject subsequent requests - String threadPoolName = "HiveServer2-HttpHandler-Pool"; - ThreadPoolExecutor executorService = new ThreadPoolExecutor(minWorkerThreads, maxWorkerThreads, - workerKeepAliveTime, TimeUnit.SECONDS, new SynchronousQueue(), - new ThreadFactoryWithGarbageCleanup(threadPoolName)); - ExecutorThreadPool threadPool = new ExecutorThreadPool(executorService); - - // HTTP Server - httpServer = new org.eclipse.jetty.server.Server(threadPool); - - // Connector configs - - ConnectionFactory[] connectionFactories; - boolean useSsl = hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_USE_SSL); - String schemeName = useSsl ? "https" : "http"; - // Change connector if SSL is used - if (useSsl) { - String keyStorePath = hiveConf.getVar(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH).trim(); - String keyStorePassword = ShimLoader.getHadoopShims().getPassword(hiveConf, - HiveConf.ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname); - if (keyStorePath.isEmpty()) { - throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname - + " Not configured for SSL connection"); - } - SslContextFactory sslContextFactory = new SslContextFactory.Server(); - String[] excludedProtocols = hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(","); - LOG.info("HTTP Server SSL: adding excluded protocols: " + Arrays.toString(excludedProtocols)); - sslContextFactory.addExcludeProtocols(excludedProtocols); - LOG.info("HTTP Server SSL: SslContextFactory.getExcludeProtocols = " + - Arrays.toString(sslContextFactory.getExcludeProtocols())); - sslContextFactory.setKeyStorePath(keyStorePath); - sslContextFactory.setKeyStorePassword(keyStorePassword); - connectionFactories = AbstractConnectionFactory.getFactories( - sslContextFactory, new HttpConnectionFactory()); - } else { - connectionFactories = new ConnectionFactory[] { new HttpConnectionFactory() }; - } - ServerConnector connector = new ServerConnector( - httpServer, - null, - // Call this full constructor to set this, which forces daemon threads: - new ScheduledExecutorScheduler("HiveServer2-HttpHandler-JettyScheduler", true), - null, - -1, - -1, - connectionFactories); - - connector.setPort(portNum); - // Linux:yes, Windows:no - connector.setReuseAddress(!Shell.WINDOWS); - int maxIdleTime = (int) hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_MAX_IDLE_TIME, - TimeUnit.MILLISECONDS); - connector.setIdleTimeout(maxIdleTime); - - httpServer.addConnector(connector); - - // Thrift configs - hiveAuthFactory = new HiveAuthFactory(hiveConf); - TProcessor processor = new TCLIService.Processor(this); - TProtocolFactory protocolFactory = new TBinaryProtocol.Factory(); - // Set during the init phase of HiveServer2 if auth mode is kerberos - // UGI for the hive/_HOST (kerberos) principal - UserGroupInformation serviceUGI = cliService.getServiceUGI(); - // UGI for the http/_HOST (SPNego) principal - UserGroupInformation httpUGI = cliService.getHttpUGI(); - String authType = hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION); - TServlet thriftHttpServlet = new ThriftHttpServlet(processor, protocolFactory, authType, - serviceUGI, httpUGI); - - // Context handler - final ServletContextHandler context = new ServletContextHandler( - ServletContextHandler.SESSIONS); - context.setContextPath("/"); - String httpPath = getHttpPath(hiveConf - .getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_HTTP_PATH)); - httpServer.setHandler(context); - context.addServlet(new ServletHolder(thriftHttpServlet), httpPath); - - // TODO: check defaults: maxTimeout, keepalive, maxBodySize, bodyRecieveDuration, etc. - // Finally, start the server - httpServer.start(); - String msg = "Started " + ThriftHttpCLIService.class.getSimpleName() + " in " + schemeName - + " mode on port " + connector.getLocalPort()+ " path=" + httpPath + " with " + minWorkerThreads + "..." - + maxWorkerThreads + " worker threads"; - LOG.info(msg); - httpServer.join(); - } catch (Throwable t) { - LOG.fatal( - "Error starting HiveServer2: could not start " - + ThriftHttpCLIService.class.getSimpleName(), t); - System.exit(-1); - } - } - - /** - * The config parameter can be like "path", "/path", "/path/", "path/*", "/path1/path2/*" and so on. - * httpPath should end up as "/*", "/path/*" or "/path1/../pathN/*" - * @param httpPath - * @return - */ - private String getHttpPath(String httpPath) { - if(httpPath == null || httpPath.equals("")) { - httpPath = "/*"; - } - else { - if(!httpPath.startsWith("/")) { - httpPath = "/" + httpPath; - } - if(httpPath.endsWith("/")) { - httpPath = httpPath + "*"; - } - if(!httpPath.endsWith("/*")) { - httpPath = httpPath + "/*"; - } - } - return httpPath; - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java deleted file mode 100644 index e15d2d0566d2b..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java +++ /dev/null @@ -1,545 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.thrift; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.security.PrivilegedExceptionAction; -import java.util.Map; -import java.util.Random; -import java.util.Set; -import java.util.concurrent.TimeUnit; - -import javax.servlet.ServletException; -import javax.servlet.http.Cookie; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.ws.rs.core.NewCookie; - -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.codec.binary.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hadoop.hive.shims.HadoopShims.KerberosNameShim; -import org.apache.hadoop.hive.shims.ShimLoader; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hive.service.auth.AuthenticationProviderFactory; -import org.apache.hive.service.auth.AuthenticationProviderFactory.AuthMethods; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.auth.HttpAuthUtils; -import org.apache.hive.service.auth.HttpAuthenticationException; -import org.apache.hive.service.auth.PasswdAuthenticationProvider; -import org.apache.hive.service.cli.session.SessionManager; -import org.apache.hive.service.CookieSigner; -import org.apache.thrift.TProcessor; -import org.apache.thrift.protocol.TProtocolFactory; -import org.apache.thrift.server.TServlet; -import org.ietf.jgss.GSSContext; -import org.ietf.jgss.GSSCredential; -import org.ietf.jgss.GSSException; -import org.ietf.jgss.GSSManager; -import org.ietf.jgss.GSSName; -import org.ietf.jgss.Oid; - -/** - * - * ThriftHttpServlet - * - */ -public class ThriftHttpServlet extends TServlet { - - private static final long serialVersionUID = 1L; - public static final Log LOG = LogFactory.getLog(ThriftHttpServlet.class.getName()); - private final String authType; - private final UserGroupInformation serviceUGI; - private final UserGroupInformation httpUGI; - private HiveConf hiveConf = new HiveConf(); - - // Class members for cookie based authentication. - private CookieSigner signer; - public static final String AUTH_COOKIE = "hive.server2.auth"; - private static final Random RAN = new Random(); - private boolean isCookieAuthEnabled; - private String cookieDomain; - private String cookiePath; - private int cookieMaxAge; - private boolean isCookieSecure; - private boolean isHttpOnlyCookie; - - public ThriftHttpServlet(TProcessor processor, TProtocolFactory protocolFactory, - String authType, UserGroupInformation serviceUGI, UserGroupInformation httpUGI) { - super(processor, protocolFactory); - this.authType = authType; - this.serviceUGI = serviceUGI; - this.httpUGI = httpUGI; - this.isCookieAuthEnabled = hiveConf.getBoolVar( - ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_AUTH_ENABLED); - // Initialize the cookie based authentication related variables. - if (isCookieAuthEnabled) { - // Generate the signer with secret. - String secret = Long.toString(RAN.nextLong()); - LOG.debug("Using the random number as the secret for cookie generation " + secret); - this.signer = new CookieSigner(secret.getBytes()); - this.cookieMaxAge = (int) hiveConf.getTimeVar( - ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_MAX_AGE, TimeUnit.SECONDS); - this.cookieDomain = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_DOMAIN); - this.cookiePath = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_PATH); - this.isCookieSecure = hiveConf.getBoolVar( - ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_IS_SECURE); - this.isHttpOnlyCookie = hiveConf.getBoolVar( - ConfVars.HIVE_SERVER2_THRIFT_HTTP_COOKIE_IS_HTTPONLY); - } - } - - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - String clientUserName = null; - String clientIpAddress; - boolean requireNewCookie = false; - - try { - // If the cookie based authentication is already enabled, parse the - // request and validate the request cookies. - if (isCookieAuthEnabled) { - clientUserName = validateCookie(request); - requireNewCookie = (clientUserName == null); - if (requireNewCookie) { - LOG.info("Could not validate cookie sent, will try to generate a new cookie"); - } - } - // If the cookie based authentication is not enabled or the request does - // not have a valid cookie, use the kerberos or password based authentication - // depending on the server setup. - if (clientUserName == null) { - // For a kerberos setup - if (isKerberosAuthMode(authType)) { - clientUserName = doKerberosAuth(request); - } - // For password based authentication - else { - clientUserName = doPasswdAuth(request, authType); - } - } - LOG.debug("Client username: " + clientUserName); - - // Set the thread local username to be used for doAs if true - SessionManager.setUserName(clientUserName); - - // find proxy user if any from query param - String doAsQueryParam = getDoAsQueryParam(request.getQueryString()); - if (doAsQueryParam != null) { - SessionManager.setProxyUserName(doAsQueryParam); - } - - clientIpAddress = request.getRemoteAddr(); - LOG.debug("Client IP Address: " + clientIpAddress); - // Set the thread local ip address - SessionManager.setIpAddress(clientIpAddress); - // Generate new cookie and add it to the response - if (requireNewCookie && - !authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.NOSASL.toString())) { - String cookieToken = HttpAuthUtils.createCookieToken(clientUserName); - Cookie hs2Cookie = createCookie(signer.signCookie(cookieToken)); - - if (isHttpOnlyCookie) { - response.setHeader("SET-COOKIE", getHttpOnlyCookieHeader(hs2Cookie)); - } else { - response.addCookie(hs2Cookie); - } - LOG.info("Cookie added for clientUserName " + clientUserName); - } - super.doPost(request, response); - } - catch (HttpAuthenticationException e) { - LOG.error("Error: ", e); - // Send a 401 to the client - response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); - if(isKerberosAuthMode(authType)) { - response.addHeader(HttpAuthUtils.WWW_AUTHENTICATE, HttpAuthUtils.NEGOTIATE); - } - response.getWriter().println("Authentication Error: " + e.getMessage()); - } - finally { - // Clear the thread locals - SessionManager.clearUserName(); - SessionManager.clearIpAddress(); - SessionManager.clearProxyUserName(); - } - } - - /** - * Retrieves the client name from cookieString. If the cookie does not - * correspond to a valid client, the function returns null. - * @param cookies HTTP Request cookies. - * @return Client Username if cookieString has a HS2 Generated cookie that is currently valid. - * Else, returns null. - */ - private String getClientNameFromCookie(Cookie[] cookies) { - // Current Cookie Name, Current Cookie Value - String currName, currValue; - - // Following is the main loop which iterates through all the cookies send by the client. - // The HS2 generated cookies are of the format hive.server2.auth= - // A cookie which is identified as a hiveserver2 generated cookie is validated - // by calling signer.verifyAndExtract(). If the validation passes, send the - // username for which the cookie is validated to the caller. If no client side - // cookie passes the validation, return null to the caller. - for (Cookie currCookie : cookies) { - // Get the cookie name - currName = currCookie.getName(); - if (!currName.equals(AUTH_COOKIE)) { - // Not a HS2 generated cookie, continue. - continue; - } - // If we reached here, we have match for HS2 generated cookie - currValue = currCookie.getValue(); - // Validate the value. - currValue = signer.verifyAndExtract(currValue); - // Retrieve the user name, do the final validation step. - if (currValue != null) { - String userName = HttpAuthUtils.getUserNameFromCookieToken(currValue); - - if (userName == null) { - LOG.warn("Invalid cookie token " + currValue); - continue; - } - //We have found a valid cookie in the client request. - if (LOG.isDebugEnabled()) { - LOG.debug("Validated the cookie for user " + userName); - } - return userName; - } - } - // No valid HS2 generated cookies found, return null - return null; - } - - /** - * Convert cookie array to human readable cookie string - * @param cookies Cookie Array - * @return String containing all the cookies separated by a newline character. - * Each cookie is of the format [key]=[value] - */ - private String toCookieStr(Cookie[] cookies) { - String cookieStr = ""; - - for (Cookie c : cookies) { - cookieStr += c.getName() + "=" + c.getValue() + " ;\n"; - } - return cookieStr; - } - - /** - * Validate the request cookie. This function iterates over the request cookie headers - * and finds a cookie that represents a valid client/server session. If it finds one, it - * returns the client name associated with the session. Else, it returns null. - * @param request The HTTP Servlet Request send by the client - * @return Client Username if the request has valid HS2 cookie, else returns null - * @throws UnsupportedEncodingException - */ - private String validateCookie(HttpServletRequest request) throws UnsupportedEncodingException { - // Find all the valid cookies associated with the request. - Cookie[] cookies = request.getCookies(); - - if (cookies == null) { - if (LOG.isDebugEnabled()) { - LOG.debug("No valid cookies associated with the request " + request); - } - return null; - } - if (LOG.isDebugEnabled()) { - LOG.debug("Received cookies: " + toCookieStr(cookies)); - } - return getClientNameFromCookie(cookies); - } - - /** - * Generate a server side cookie given the cookie value as the input. - * @param str Input string token. - * @return The generated cookie. - * @throws UnsupportedEncodingException - */ - private Cookie createCookie(String str) throws UnsupportedEncodingException { - if (LOG.isDebugEnabled()) { - LOG.debug("Cookie name = " + AUTH_COOKIE + " value = " + str); - } - Cookie cookie = new Cookie(AUTH_COOKIE, str); - - cookie.setMaxAge(cookieMaxAge); - if (cookieDomain != null) { - cookie.setDomain(cookieDomain); - } - if (cookiePath != null) { - cookie.setPath(cookiePath); - } - cookie.setSecure(isCookieSecure); - return cookie; - } - - /** - * Generate httponly cookie from HS2 cookie - * @param cookie HS2 generated cookie - * @return The httponly cookie - */ - private static String getHttpOnlyCookieHeader(Cookie cookie) { - NewCookie newCookie = new NewCookie(cookie.getName(), cookie.getValue(), - cookie.getPath(), cookie.getDomain(), cookie.getVersion(), - cookie.getComment(), cookie.getMaxAge(), cookie.getSecure()); - return newCookie + "; HttpOnly"; - } - - /** - * Do the LDAP/PAM authentication - * @param request - * @param authType - * @throws HttpAuthenticationException - */ - private String doPasswdAuth(HttpServletRequest request, String authType) - throws HttpAuthenticationException { - String userName = getUsername(request, authType); - // No-op when authType is NOSASL - if (!authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.NOSASL.toString())) { - try { - AuthMethods authMethod = AuthMethods.getValidAuthMethod(authType); - PasswdAuthenticationProvider provider = - AuthenticationProviderFactory.getAuthenticationProvider(authMethod); - provider.Authenticate(userName, getPassword(request, authType)); - - } catch (Exception e) { - throw new HttpAuthenticationException(e); - } - } - return userName; - } - - /** - * Do the GSS-API kerberos authentication. - * We already have a logged in subject in the form of serviceUGI, - * which GSS-API will extract information from. - * In case of a SPNego request we use the httpUGI, - * for the authenticating service tickets. - * @param request - * @return - * @throws HttpAuthenticationException - */ - private String doKerberosAuth(HttpServletRequest request) - throws HttpAuthenticationException { - // Try authenticating with the http/_HOST principal - if (httpUGI != null) { - try { - return httpUGI.doAs(new HttpKerberosServerAction(request, httpUGI)); - } catch (Exception e) { - LOG.info("Failed to authenticate with http/_HOST kerberos principal, " + - "trying with hive/_HOST kerberos principal"); - } - } - // Now try with hive/_HOST principal - try { - return serviceUGI.doAs(new HttpKerberosServerAction(request, serviceUGI)); - } catch (Exception e) { - LOG.error("Failed to authenticate with hive/_HOST kerberos principal"); - throw new HttpAuthenticationException(e); - } - - } - - class HttpKerberosServerAction implements PrivilegedExceptionAction { - HttpServletRequest request; - UserGroupInformation serviceUGI; - - HttpKerberosServerAction(HttpServletRequest request, - UserGroupInformation serviceUGI) { - this.request = request; - this.serviceUGI = serviceUGI; - } - - @Override - public String run() throws HttpAuthenticationException { - // Get own Kerberos credentials for accepting connection - GSSManager manager = GSSManager.getInstance(); - GSSContext gssContext = null; - String serverPrincipal = getPrincipalWithoutRealm( - serviceUGI.getUserName()); - try { - // This Oid for Kerberos GSS-API mechanism. - Oid kerberosMechOid = new Oid("1.2.840.113554.1.2.2"); - // Oid for SPNego GSS-API mechanism. - Oid spnegoMechOid = new Oid("1.3.6.1.5.5.2"); - // Oid for kerberos principal name - Oid krb5PrincipalOid = new Oid("1.2.840.113554.1.2.2.1"); - - // GSS name for server - GSSName serverName = manager.createName(serverPrincipal, krb5PrincipalOid); - - // GSS credentials for server - GSSCredential serverCreds = manager.createCredential(serverName, - GSSCredential.DEFAULT_LIFETIME, - new Oid[]{kerberosMechOid, spnegoMechOid}, - GSSCredential.ACCEPT_ONLY); - - // Create a GSS context - gssContext = manager.createContext(serverCreds); - // Get service ticket from the authorization header - String serviceTicketBase64 = getAuthHeader(request, authType); - byte[] inToken = Base64.decodeBase64(serviceTicketBase64.getBytes()); - gssContext.acceptSecContext(inToken, 0, inToken.length); - // Authenticate or deny based on its context completion - if (!gssContext.isEstablished()) { - throw new HttpAuthenticationException("Kerberos authentication failed: " + - "unable to establish context with the service ticket " + - "provided by the client."); - } - else { - return getPrincipalWithoutRealmAndHost(gssContext.getSrcName().toString()); - } - } - catch (GSSException e) { - throw new HttpAuthenticationException("Kerberos authentication failed: ", e); - } - finally { - if (gssContext != null) { - try { - gssContext.dispose(); - } catch (GSSException e) { - // No-op - } - } - } - } - - private String getPrincipalWithoutRealm(String fullPrincipal) - throws HttpAuthenticationException { - KerberosNameShim fullKerberosName; - try { - fullKerberosName = ShimLoader.getHadoopShims().getKerberosNameShim(fullPrincipal); - } catch (IOException e) { - throw new HttpAuthenticationException(e); - } - String serviceName = fullKerberosName.getServiceName(); - String hostName = fullKerberosName.getHostName(); - String principalWithoutRealm = serviceName; - if (hostName != null) { - principalWithoutRealm = serviceName + "/" + hostName; - } - return principalWithoutRealm; - } - - private String getPrincipalWithoutRealmAndHost(String fullPrincipal) - throws HttpAuthenticationException { - KerberosNameShim fullKerberosName; - try { - fullKerberosName = ShimLoader.getHadoopShims().getKerberosNameShim(fullPrincipal); - return fullKerberosName.getShortName(); - } catch (IOException e) { - throw new HttpAuthenticationException(e); - } - } - } - - private String getUsername(HttpServletRequest request, String authType) - throws HttpAuthenticationException { - String[] creds = getAuthHeaderTokens(request, authType); - // Username must be present - if (creds[0] == null || creds[0].isEmpty()) { - throw new HttpAuthenticationException("Authorization header received " + - "from the client does not contain username."); - } - return creds[0]; - } - - private String getPassword(HttpServletRequest request, String authType) - throws HttpAuthenticationException { - String[] creds = getAuthHeaderTokens(request, authType); - // Password must be present - if (creds[1] == null || creds[1].isEmpty()) { - throw new HttpAuthenticationException("Authorization header received " + - "from the client does not contain username."); - } - return creds[1]; - } - - private String[] getAuthHeaderTokens(HttpServletRequest request, - String authType) throws HttpAuthenticationException { - String authHeaderBase64 = getAuthHeader(request, authType); - String authHeaderString = StringUtils.newStringUtf8( - Base64.decodeBase64(authHeaderBase64.getBytes())); - String[] creds = authHeaderString.split(":"); - return creds; - } - - /** - * Returns the base64 encoded auth header payload - * @param request - * @param authType - * @return - * @throws HttpAuthenticationException - */ - private String getAuthHeader(HttpServletRequest request, String authType) - throws HttpAuthenticationException { - String authHeader = request.getHeader(HttpAuthUtils.AUTHORIZATION); - // Each http request must have an Authorization header - if (authHeader == null || authHeader.isEmpty()) { - throw new HttpAuthenticationException("Authorization header received " + - "from the client is empty."); - } - - String authHeaderBase64String; - int beginIndex; - if (isKerberosAuthMode(authType)) { - beginIndex = (HttpAuthUtils.NEGOTIATE + " ").length(); - } - else { - beginIndex = (HttpAuthUtils.BASIC + " ").length(); - } - authHeaderBase64String = authHeader.substring(beginIndex); - // Authorization header must have a payload - if (authHeaderBase64String == null || authHeaderBase64String.isEmpty()) { - throw new HttpAuthenticationException("Authorization header received " + - "from the client does not contain any data."); - } - return authHeaderBase64String; - } - - private boolean isKerberosAuthMode(String authType) { - return authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); - } - - private static String getDoAsQueryParam(String queryString) { - if (LOG.isDebugEnabled()) { - LOG.debug("URL query string:" + queryString); - } - if (queryString == null) { - return null; - } - Map params = javax.servlet.http.HttpUtils.parseQueryString( queryString ); - Set keySet = params.keySet(); - for (String key: keySet) { - if (key.equalsIgnoreCase("doAs")) { - return params.get(key)[0]; - } - } - return null; - } - -} - - diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/server/HiveServer2.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/server/HiveServer2.java deleted file mode 100644 index 95233996cbbcb..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/server/HiveServer2.java +++ /dev/null @@ -1,277 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.server; - -import java.util.Properties; - -import scala.runtime.AbstractFunction0; -import scala.runtime.BoxedUnit; - -import org.apache.commons.cli.GnuParser; -import org.apache.commons.cli.HelpFormatter; -import org.apache.commons.cli.Option; -import org.apache.commons.cli.OptionBuilder; -import org.apache.commons.cli.Options; -import org.apache.commons.cli.ParseException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.shims.ShimLoader; -import org.apache.hive.common.util.HiveStringUtils; -import org.apache.hive.service.CompositeService; -import org.apache.hive.service.cli.CLIService; -import org.apache.hive.service.cli.thrift.ThriftBinaryCLIService; -import org.apache.hive.service.cli.thrift.ThriftCLIService; -import org.apache.hive.service.cli.thrift.ThriftHttpCLIService; - -import org.apache.spark.util.ShutdownHookManager; - -/** - * HiveServer2. - * - */ -public class HiveServer2 extends CompositeService { - private static final Log LOG = LogFactory.getLog(HiveServer2.class); - - private CLIService cliService; - private ThriftCLIService thriftCLIService; - - public HiveServer2() { - super(HiveServer2.class.getSimpleName()); - HiveConf.setLoadHiveServer2Config(true); - } - - @Override - public synchronized void init(HiveConf hiveConf) { - cliService = new CLIService(this); - addService(cliService); - if (isHTTPTransportMode(hiveConf)) { - thriftCLIService = new ThriftHttpCLIService(cliService); - } else { - thriftCLIService = new ThriftBinaryCLIService(cliService); - } - addService(thriftCLIService); - super.init(hiveConf); - - // Add a shutdown hook for catching SIGTERM & SIGINT - // this must be higher than the Hadoop Filesystem priority of 10, - // which the default priority is. - // The signature of the callback must match that of a scala () -> Unit - // function - ShutdownHookManager.addShutdownHook( - new AbstractFunction0() { - public BoxedUnit apply() { - try { - LOG.info("Hive Server Shutdown hook invoked"); - stop(); - } catch (Throwable e) { - LOG.warn("Ignoring Exception while stopping Hive Server from shutdown hook", - e); - } - return BoxedUnit.UNIT; - } - }); - } - - public static boolean isHTTPTransportMode(HiveConf hiveConf) { - String transportMode = System.getenv("HIVE_SERVER2_TRANSPORT_MODE"); - if (transportMode == null) { - transportMode = hiveConf.getVar(HiveConf.ConfVars.HIVE_SERVER2_TRANSPORT_MODE); - } - if (transportMode != null && (transportMode.equalsIgnoreCase("http"))) { - return true; - } - return false; - } - - @Override - public synchronized void start() { - super.start(); - } - - @Override - public synchronized void stop() { - LOG.info("Shutting down HiveServer2"); - super.stop(); - } - - private static void startHiveServer2() throws Throwable { - long attempts = 0, maxAttempts = 1; - while (true) { - LOG.info("Starting HiveServer2"); - HiveConf hiveConf = new HiveConf(); - maxAttempts = hiveConf.getLongVar(HiveConf.ConfVars.HIVE_SERVER2_MAX_START_ATTEMPTS); - HiveServer2 server = null; - try { - server = new HiveServer2(); - server.init(hiveConf); - server.start(); - ShimLoader.getHadoopShims().startPauseMonitor(hiveConf); - break; - } catch (Throwable throwable) { - if (server != null) { - try { - server.stop(); - } catch (Throwable t) { - LOG.info("Exception caught when calling stop of HiveServer2 before retrying start", t); - } finally { - server = null; - } - } - if (++attempts >= maxAttempts) { - throw new Error("Max start attempts " + maxAttempts + " exhausted", throwable); - } else { - LOG.warn("Error starting HiveServer2 on attempt " + attempts - + ", will retry in 60 seconds", throwable); - try { - Thread.sleep(60L * 1000L); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - } - } - } - } - - public static void main(String[] args) { - HiveConf.setLoadHiveServer2Config(true); - ServerOptionsProcessor oproc = new ServerOptionsProcessor("hiveserver2"); - ServerOptionsProcessorResponse oprocResponse = oproc.parse(args); - - HiveStringUtils.startupShutdownMessage(HiveServer2.class, args, LOG); - - // Call the executor which will execute the appropriate command based on the parsed options - oprocResponse.getServerOptionsExecutor().execute(); - } - - /** - * ServerOptionsProcessor. - * Process arguments given to HiveServer2 (-hiveconf property=value) - * Set properties in System properties - * Create an appropriate response object, - * which has executor to execute the appropriate command based on the parsed options. - */ - public static class ServerOptionsProcessor { - private final Options options = new Options(); - private org.apache.commons.cli.CommandLine commandLine; - private final String serverName; - private final StringBuilder debugMessage = new StringBuilder(); - - @SuppressWarnings("static-access") - public ServerOptionsProcessor(String serverName) { - this.serverName = serverName; - // -hiveconf x=y - options.addOption(OptionBuilder - .withValueSeparator() - .hasArgs(2) - .withArgName("property=value") - .withLongOpt("hiveconf") - .withDescription("Use value for given property") - .create()); - options.addOption(new Option("H", "help", false, "Print help information")); - } - - public ServerOptionsProcessorResponse parse(String[] argv) { - try { - commandLine = new GnuParser().parse(options, argv); - // Process --hiveconf - // Get hiveconf param values and set the System property values - Properties confProps = commandLine.getOptionProperties("hiveconf"); - for (String propKey : confProps.stringPropertyNames()) { - // save logging message for log4j output latter after log4j initialize properly - debugMessage.append("Setting " + propKey + "=" + confProps.getProperty(propKey) + ";\n"); - System.setProperty(propKey, confProps.getProperty(propKey)); - } - - // Process --help - if (commandLine.hasOption('H')) { - return new ServerOptionsProcessorResponse(new HelpOptionExecutor(serverName, options)); - } - } catch (ParseException e) { - // Error out & exit - we were not able to parse the args successfully - System.err.println("Error starting HiveServer2 with given arguments: "); - System.err.println(e.getMessage()); - System.exit(-1); - } - // Default executor, when no option is specified - return new ServerOptionsProcessorResponse(new StartOptionExecutor()); - } - - StringBuilder getDebugMessage() { - return debugMessage; - } - } - - /** - * The response sent back from {@link ServerOptionsProcessor#parse(String[])} - */ - static class ServerOptionsProcessorResponse { - private final ServerOptionsExecutor serverOptionsExecutor; - - ServerOptionsProcessorResponse(ServerOptionsExecutor serverOptionsExecutor) { - this.serverOptionsExecutor = serverOptionsExecutor; - } - - ServerOptionsExecutor getServerOptionsExecutor() { - return serverOptionsExecutor; - } - } - - /** - * The executor interface for running the appropriate HiveServer2 command based on parsed options - */ - interface ServerOptionsExecutor { - void execute(); - } - - /** - * HelpOptionExecutor: executes the --help option by printing out the usage - */ - static class HelpOptionExecutor implements ServerOptionsExecutor { - private final Options options; - private final String serverName; - - HelpOptionExecutor(String serverName, Options options) { - this.options = options; - this.serverName = serverName; - } - - @Override - public void execute() { - new HelpFormatter().printHelp(serverName, options); - System.exit(0); - } - } - - /** - * StartOptionExecutor: starts HiveServer2. - * This is the default executor, when no option is specified. - */ - static class StartOptionExecutor implements ServerOptionsExecutor { - @Override - public void execute() { - try { - startHiveServer2(); - } catch (Throwable t) { - LOG.fatal("Error starting HiveServer2", t); - System.exit(-1); - } - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java b/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java deleted file mode 100644 index 8ee98103f7ef7..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/java/org/apache/hive/service/server/ThreadWithGarbageCleanup.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * 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. - */ - - -package org.apache.hive.service.server; - -import java.util.Map; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.hadoop.hive.metastore.HiveMetaStore; -import org.apache.hadoop.hive.metastore.RawStore; - -/** - * A HiveServer2 thread used to construct new server threads. - * In particular, this thread ensures an orderly cleanup, - * when killed by its corresponding ExecutorService. - */ -public class ThreadWithGarbageCleanup extends Thread { - private static final Log LOG = LogFactory.getLog(ThreadWithGarbageCleanup.class); - - Map threadRawStoreMap = - ThreadFactoryWithGarbageCleanup.getThreadRawStoreMap(); - - public ThreadWithGarbageCleanup(Runnable runnable) { - super(runnable); - } - - /** - * Add any Thread specific garbage cleanup code here. - * Currently, it shuts down the RawStore object for this thread if it is not null. - */ - @Override - public void finalize() throws Throwable { - cleanRawStore(); - super.finalize(); - } - - private void cleanRawStore() { - Long threadId = this.getId(); - RawStore threadLocalRawStore = threadRawStoreMap.get(threadId); - if (threadLocalRawStore != null) { - LOG.debug("RawStore: " + threadLocalRawStore + ", for the thread: " + - this.getName() + " will be closed now."); - threadLocalRawStore.shutdown(); - threadRawStoreMap.remove(threadId); - } - } - - /** - * Cache the ThreadLocal RawStore object. Called from the corresponding thread. - */ - public void cacheThreadLocalRawStore() { - Long threadId = this.getId(); - RawStore threadLocalRawStore = HiveMetaStore.HMSHandler.getRawStore(); - if (threadLocalRawStore != null && !threadRawStoreMap.containsKey(threadId)) { - LOG.debug("Adding RawStore: " + threadLocalRawStore + ", for the thread: " + - this.getName() + " to threadRawStoreMap for future cleanup."); - threadRawStoreMap.put(threadId, threadLocalRawStore); - } - } -} diff --git a/sql/hive-thriftserver/v1.2/src/main/scala/org/apache/spark/sql/hive/thriftserver/ThriftserverShimUtils.scala b/sql/hive-thriftserver/v1.2/src/main/scala/org/apache/spark/sql/hive/thriftserver/ThriftserverShimUtils.scala deleted file mode 100644 index fbfc698ecb4bf..0000000000000 --- a/sql/hive-thriftserver/v1.2/src/main/scala/org/apache/spark/sql/hive/thriftserver/ThriftserverShimUtils.scala +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.hive.thriftserver - -import org.apache.commons.logging.LogFactory -import org.apache.hadoop.hive.ql.session.SessionState -import org.apache.hive.service.cli.{RowSet, RowSetFactory, TableSchema, Type} -import org.apache.hive.service.cli.Type._ -import org.apache.hive.service.cli.thrift.TProtocolVersion._ - -/** - * Various utilities for hive-thriftserver used to upgrade the built-in Hive. - */ -private[thriftserver] object ThriftserverShimUtils { - - private[thriftserver] type TProtocolVersion = org.apache.hive.service.cli.thrift.TProtocolVersion - private[thriftserver] type Client = org.apache.hive.service.cli.thrift.TCLIService.Client - private[thriftserver] type TOpenSessionReq = org.apache.hive.service.cli.thrift.TOpenSessionReq - private[thriftserver] type TGetSchemasReq = org.apache.hive.service.cli.thrift.TGetSchemasReq - private[thriftserver] type TGetTablesReq = org.apache.hive.service.cli.thrift.TGetTablesReq - private[thriftserver] type TGetColumnsReq = org.apache.hive.service.cli.thrift.TGetColumnsReq - private[thriftserver] type TGetInfoReq = org.apache.hive.service.cli.thrift.TGetInfoReq - private[thriftserver] type TExecuteStatementReq = - org.apache.hive.service.cli.thrift.TExecuteStatementReq - - private[thriftserver] def getConsole: SessionState.LogHelper = { - val LOG = LogFactory.getLog(classOf[SparkSQLCLIDriver]) - new SessionState.LogHelper(LOG) - } - - private[thriftserver] def resultRowSet( - getResultSetSchema: TableSchema, - getProtocolVersion: TProtocolVersion): RowSet = { - RowSetFactory.create(getResultSetSchema, getProtocolVersion) - } - - private[thriftserver] def toJavaSQLType(s: String): Int = Type.getType(s).toJavaSQLType - - private[thriftserver] def supportedType(): Seq[Type] = { - Seq(NULL_TYPE, BOOLEAN_TYPE, STRING_TYPE, BINARY_TYPE, - TINYINT_TYPE, SMALLINT_TYPE, INT_TYPE, BIGINT_TYPE, - FLOAT_TYPE, DOUBLE_TYPE, DECIMAL_TYPE, - DATE_TYPE, TIMESTAMP_TYPE, - ARRAY_TYPE, MAP_TYPE, STRUCT_TYPE) - } - - private[thriftserver] val testedProtocolVersions = Seq( - HIVE_CLI_SERVICE_PROTOCOL_V1, - HIVE_CLI_SERVICE_PROTOCOL_V2, - HIVE_CLI_SERVICE_PROTOCOL_V3, - HIVE_CLI_SERVICE_PROTOCOL_V4, - HIVE_CLI_SERVICE_PROTOCOL_V5, - HIVE_CLI_SERVICE_PROTOCOL_V6, - HIVE_CLI_SERVICE_PROTOCOL_V7, - HIVE_CLI_SERVICE_PROTOCOL_V8) -} diff --git a/sql/hive-thriftserver/v2.3/if/TCLIService.thrift b/sql/hive-thriftserver/v2.3/if/TCLIService.thrift deleted file mode 100644 index 9026cd25df5b3..0000000000000 --- a/sql/hive-thriftserver/v2.3/if/TCLIService.thrift +++ /dev/null @@ -1,1269 +0,0 @@ -// 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. - -// Coding Conventions for this file: -// -// Structs/Enums/Unions -// * Struct, Enum, and Union names begin with a "T", -// and use a capital letter for each new word, with no underscores. -// * All fields should be declared as either optional or required. -// -// Functions -// * Function names start with a capital letter and have a capital letter for -// each new word, with no underscores. -// * Each function should take exactly one parameter, named TFunctionNameReq, -// and should return either void or TFunctionNameResp. This convention allows -// incremental updates. -// -// Services -// * Service names begin with the letter "T", use a capital letter for each -// new word (with no underscores), and end with the word "Service". - -namespace java org.apache.hive.service.rpc.thrift -namespace cpp apache.hive.service.rpc.thrift - -// List of protocol versions. A new token should be -// added to the end of this list every time a change is made. -enum TProtocolVersion { - HIVE_CLI_SERVICE_PROTOCOL_V1, - - // V2 adds support for asynchronous execution - HIVE_CLI_SERVICE_PROTOCOL_V2 - - // V3 add varchar type, primitive type qualifiers - HIVE_CLI_SERVICE_PROTOCOL_V3 - - // V4 add decimal precision/scale, char type - HIVE_CLI_SERVICE_PROTOCOL_V4 - - // V5 adds error details when GetOperationStatus returns in error state - HIVE_CLI_SERVICE_PROTOCOL_V5 - - // V6 uses binary type for binary payload (was string) and uses columnar result set - HIVE_CLI_SERVICE_PROTOCOL_V6 - - // V7 adds support for delegation token based connection - HIVE_CLI_SERVICE_PROTOCOL_V7 - - // V8 adds support for interval types - HIVE_CLI_SERVICE_PROTOCOL_V8 - - // V9 adds support for serializing ResultSets in SerDe - HIVE_CLI_SERVICE_PROTOCOL_V9 - - // V10 adds support for in place updates via GetOperationStatus - HIVE_CLI_SERVICE_PROTOCOL_V10 -} - -enum TTypeId { - BOOLEAN_TYPE, - TINYINT_TYPE, - SMALLINT_TYPE, - INT_TYPE, - BIGINT_TYPE, - FLOAT_TYPE, - DOUBLE_TYPE, - STRING_TYPE, - TIMESTAMP_TYPE, - BINARY_TYPE, - ARRAY_TYPE, - MAP_TYPE, - STRUCT_TYPE, - UNION_TYPE, - USER_DEFINED_TYPE, - DECIMAL_TYPE, - NULL_TYPE, - DATE_TYPE, - VARCHAR_TYPE, - CHAR_TYPE, - INTERVAL_YEAR_MONTH_TYPE, - INTERVAL_DAY_TIME_TYPE -} - -const set PRIMITIVE_TYPES = [ - TTypeId.BOOLEAN_TYPE, - TTypeId.TINYINT_TYPE, - TTypeId.SMALLINT_TYPE, - TTypeId.INT_TYPE, - TTypeId.BIGINT_TYPE, - TTypeId.FLOAT_TYPE, - TTypeId.DOUBLE_TYPE, - TTypeId.STRING_TYPE, - TTypeId.TIMESTAMP_TYPE, - TTypeId.BINARY_TYPE, - TTypeId.DECIMAL_TYPE, - TTypeId.NULL_TYPE, - TTypeId.DATE_TYPE, - TTypeId.VARCHAR_TYPE, - TTypeId.CHAR_TYPE, - TTypeId.INTERVAL_YEAR_MONTH_TYPE, - TTypeId.INTERVAL_DAY_TIME_TYPE -] - -const set COMPLEX_TYPES = [ - TTypeId.ARRAY_TYPE - TTypeId.MAP_TYPE - TTypeId.STRUCT_TYPE - TTypeId.UNION_TYPE - TTypeId.USER_DEFINED_TYPE -] - -const set COLLECTION_TYPES = [ - TTypeId.ARRAY_TYPE - TTypeId.MAP_TYPE -] - -const map TYPE_NAMES = { - TTypeId.BOOLEAN_TYPE: "BOOLEAN", - TTypeId.TINYINT_TYPE: "TINYINT", - TTypeId.SMALLINT_TYPE: "SMALLINT", - TTypeId.INT_TYPE: "INT", - TTypeId.BIGINT_TYPE: "BIGINT", - TTypeId.FLOAT_TYPE: "FLOAT", - TTypeId.DOUBLE_TYPE: "DOUBLE", - TTypeId.STRING_TYPE: "STRING", - TTypeId.TIMESTAMP_TYPE: "TIMESTAMP", - TTypeId.BINARY_TYPE: "BINARY", - TTypeId.ARRAY_TYPE: "ARRAY", - TTypeId.MAP_TYPE: "MAP", - TTypeId.STRUCT_TYPE: "STRUCT", - TTypeId.UNION_TYPE: "UNIONTYPE", - TTypeId.DECIMAL_TYPE: "DECIMAL", - TTypeId.NULL_TYPE: "NULL" - TTypeId.DATE_TYPE: "DATE" - TTypeId.VARCHAR_TYPE: "VARCHAR" - TTypeId.CHAR_TYPE: "CHAR" - TTypeId.INTERVAL_YEAR_MONTH_TYPE: "INTERVAL_YEAR_MONTH" - TTypeId.INTERVAL_DAY_TIME_TYPE: "INTERVAL_DAY_TIME" -} - -// Thrift does not support recursively defined types or forward declarations, -// which makes it difficult to represent Hive's nested types. -// To get around these limitations TTypeDesc employs a type list that maps -// integer "pointers" to TTypeEntry objects. The following examples show -// how different types are represented using this scheme: -// -// "INT": -// TTypeDesc { -// types = [ -// TTypeEntry.primitive_entry { -// type = INT_TYPE -// } -// ] -// } -// -// "ARRAY": -// TTypeDesc { -// types = [ -// TTypeEntry.array_entry { -// object_type_ptr = 1 -// }, -// TTypeEntry.primitive_entry { -// type = INT_TYPE -// } -// ] -// } -// -// "MAP": -// TTypeDesc { -// types = [ -// TTypeEntry.map_entry { -// key_type_ptr = 1 -// value_type_ptr = 2 -// }, -// TTypeEntry.primitive_entry { -// type = INT_TYPE -// }, -// TTypeEntry.primitive_entry { -// type = STRING_TYPE -// } -// ] -// } - -typedef i32 TTypeEntryPtr - -// Valid TTypeQualifiers key names -const string CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength" - -// Type qualifier key name for decimal -const string PRECISION = "precision" -const string SCALE = "scale" - -union TTypeQualifierValue { - 1: optional i32 i32Value - 2: optional string stringValue -} - -// Type qualifiers for primitive type. -struct TTypeQualifiers { - 1: required map qualifiers -} - -// Type entry for a primitive type. -struct TPrimitiveTypeEntry { - // The primitive type token. This must satisfy the condition - // that type is in the PRIMITIVE_TYPES set. - 1: required TTypeId type - 2: optional TTypeQualifiers typeQualifiers -} - -// Type entry for an ARRAY type. -struct TArrayTypeEntry { - 1: required TTypeEntryPtr objectTypePtr -} - -// Type entry for a MAP type. -struct TMapTypeEntry { - 1: required TTypeEntryPtr keyTypePtr - 2: required TTypeEntryPtr valueTypePtr -} - -// Type entry for a STRUCT type. -struct TStructTypeEntry { - 1: required map nameToTypePtr -} - -// Type entry for a UNIONTYPE type. -struct TUnionTypeEntry { - 1: required map nameToTypePtr -} - -struct TUserDefinedTypeEntry { - // The fully qualified name of the class implementing this type. - 1: required string typeClassName -} - -// We use a union here since Thrift does not support inheritance. -union TTypeEntry { - 1: TPrimitiveTypeEntry primitiveEntry - 2: TArrayTypeEntry arrayEntry - 3: TMapTypeEntry mapEntry - 4: TStructTypeEntry structEntry - 5: TUnionTypeEntry unionEntry - 6: TUserDefinedTypeEntry userDefinedTypeEntry -} - -// Type descriptor for columns. -struct TTypeDesc { - // The "top" type is always the first element of the list. - // If the top type is an ARRAY, MAP, STRUCT, or UNIONTYPE - // type, then subsequent elements represent nested types. - 1: required list types -} - -// A result set column descriptor. -struct TColumnDesc { - // The name of the column - 1: required string columnName - - // The type descriptor for this column - 2: required TTypeDesc typeDesc - - // The ordinal position of this column in the schema - 3: required i32 position - - 4: optional string comment -} - -// Metadata used to describe the schema (column names, types, comments) -// of result sets. -struct TTableSchema { - 1: required list columns -} - -// A Boolean column value. -struct TBoolValue { - // NULL if value is unset. - 1: optional bool value -} - -// A Byte column value. -struct TByteValue { - // NULL if value is unset. - 1: optional byte value -} - -// A signed, 16 bit column value. -struct TI16Value { - // NULL if value is unset - 1: optional i16 value -} - -// A signed, 32 bit column value -struct TI32Value { - // NULL if value is unset - 1: optional i32 value -} - -// A signed 64 bit column value -struct TI64Value { - // NULL if value is unset - 1: optional i64 value -} - -// A floating point 64 bit column value -struct TDoubleValue { - // NULL if value is unset - 1: optional double value -} - -struct TStringValue { - // NULL if value is unset - 1: optional string value -} - -// A single column value in a result set. -// Note that Hive's type system is richer than Thrift's, -// so in some cases we have to map multiple Hive types -// to the same Thrift type. On the client-side this is -// disambiguated by looking at the Schema of the -// result set. -union TColumnValue { - 1: TBoolValue boolVal // BOOLEAN - 2: TByteValue byteVal // TINYINT - 3: TI16Value i16Val // SMALLINT - 4: TI32Value i32Val // INT - 5: TI64Value i64Val // BIGINT, TIMESTAMP - 6: TDoubleValue doubleVal // FLOAT, DOUBLE - 7: TStringValue stringVal // STRING, LIST, MAP, STRUCT, UNIONTYPE, BINARY, DECIMAL, NULL, INTERVAL_YEAR_MONTH, INTERVAL_DAY_TIME -} - -// Represents a row in a rowset. -struct TRow { - 1: required list colVals -} - -struct TBoolColumn { - 1: required list values - 2: required binary nulls -} - -struct TByteColumn { - 1: required list values - 2: required binary nulls -} - -struct TI16Column { - 1: required list values - 2: required binary nulls -} - -struct TI32Column { - 1: required list values - 2: required binary nulls -} - -struct TI64Column { - 1: required list values - 2: required binary nulls -} - -struct TDoubleColumn { - 1: required list values - 2: required binary nulls -} - -struct TStringColumn { - 1: required list values - 2: required binary nulls -} - -struct TBinaryColumn { - 1: required list values - 2: required binary nulls -} - -// Note that Hive's type system is richer than Thrift's, -// so in some cases we have to map multiple Hive types -// to the same Thrift type. On the client-side this is -// disambiguated by looking at the Schema of the -// result set. -union TColumn { - 1: TBoolColumn boolVal // BOOLEAN - 2: TByteColumn byteVal // TINYINT - 3: TI16Column i16Val // SMALLINT - 4: TI32Column i32Val // INT - 5: TI64Column i64Val // BIGINT, TIMESTAMP - 6: TDoubleColumn doubleVal // FLOAT, DOUBLE - 7: TStringColumn stringVal // STRING, LIST, MAP, STRUCT, UNIONTYPE, DECIMAL, NULL - 8: TBinaryColumn binaryVal // BINARY -} - -// Represents a rowset -struct TRowSet { - // The starting row offset of this rowset. - 1: required i64 startRowOffset - 2: required list rows - 3: optional list columns - 4: optional binary binaryColumns - 5: optional i32 columnCount -} - -// The return status code contained in each response. -enum TStatusCode { - SUCCESS_STATUS, - SUCCESS_WITH_INFO_STATUS, - STILL_EXECUTING_STATUS, - ERROR_STATUS, - INVALID_HANDLE_STATUS -} - -// The return status of a remote request -struct TStatus { - 1: required TStatusCode statusCode - - // If status is SUCCESS_WITH_INFO, info_msgs may be populated with - // additional diagnostic information. - 2: optional list infoMessages - - // If status is ERROR, then the following fields may be set - 3: optional string sqlState // as defined in the ISO/IEF CLI specification - 4: optional i32 errorCode // internal error code - 5: optional string errorMessage -} - -// The state of an operation (i.e. a query or other -// asynchronous operation that generates a result set) -// on the server. -enum TOperationState { - // The operation has been initialized - INITIALIZED_STATE, - - // The operation is running. In this state the result - // set is not available. - RUNNING_STATE, - - // The operation has completed. When an operation is in - // this state its result set may be fetched. - FINISHED_STATE, - - // The operation was canceled by a client - CANCELED_STATE, - - // The operation was closed by a client - CLOSED_STATE, - - // The operation failed due to an error - ERROR_STATE, - - // The operation is in an unrecognized state - UKNOWN_STATE, - - // The operation is in an pending state - PENDING_STATE, - - // The operation is in an timedout state - TIMEDOUT_STATE, -} - -// A string identifier. This is interpreted literally. -typedef string TIdentifier - -// A search pattern. -// -// Valid search pattern characters: -// '_': Any single character. -// '%': Any sequence of zero or more characters. -// '\': Escape character used to include special characters, -// e.g. '_', '%', '\'. If a '\' precedes a non-special -// character it has no special meaning and is interpreted -// literally. -typedef string TPattern - - -// A search pattern or identifier. Used as input -// parameter for many of the catalog functions. -typedef string TPatternOrIdentifier - -struct THandleIdentifier { - // 16 byte globally unique identifier - // This is the public ID of the handle and - // can be used for reporting. - 1: required binary guid, - - // 16 byte secret generated by the server - // and used to verify that the handle is not - // being hijacked by another user. - 2: required binary secret, -} - -// Client-side handle to persistent -// session information on the server-side. -struct TSessionHandle { - 1: required THandleIdentifier sessionId -} - -// The subtype of an OperationHandle. -enum TOperationType { - EXECUTE_STATEMENT, - GET_TYPE_INFO, - GET_CATALOGS, - GET_SCHEMAS, - GET_TABLES, - GET_TABLE_TYPES, - GET_COLUMNS, - GET_FUNCTIONS, - UNKNOWN, -} - -// Client-side reference to a task running -// asynchronously on the server. -struct TOperationHandle { - 1: required THandleIdentifier operationId - 2: required TOperationType operationType - - // If hasResultSet = TRUE, then this operation - // generates a result set that can be fetched. - // Note that the result set may be empty. - // - // If hasResultSet = FALSE, then this operation - // does not generate a result set, and calling - // GetResultSetMetadata or FetchResults against - // this OperationHandle will generate an error. - 3: required bool hasResultSet - - // For operations that don't generate result sets, - // modifiedRowCount is either: - // - // 1) The number of rows that were modified by - // the DML operation (e.g. number of rows inserted, - // number of rows deleted, etc). - // - // 2) 0 for operations that don't modify or add rows. - // - // 3) < 0 if the operation is capable of modifiying rows, - // but Hive is unable to determine how many rows were - // modified. For example, Hive's LOAD DATA command - // doesn't generate row count information because - // Hive doesn't inspect the data as it is loaded. - // - // modifiedRowCount is unset if the operation generates - // a result set. - 4: optional double modifiedRowCount -} - - -// OpenSession() -// -// Open a session (connection) on the server against -// which operations may be executed. -struct TOpenSessionReq { - // The version of the HiveServer2 protocol that the client is using. - 1: required TProtocolVersion client_protocol = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10 - - // Username and password for authentication. - // Depending on the authentication scheme being used, - // this information may instead be provided by a lower - // protocol layer, in which case these fields may be - // left unset. - 2: optional string username - 3: optional string password - - // Configuration overlay which is applied when the session is - // first created. - 4: optional map configuration -} - -struct TOpenSessionResp { - 1: required TStatus status - - // The protocol version that the server is using. - 2: required TProtocolVersion serverProtocolVersion = TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10 - - // Session Handle - 3: optional TSessionHandle sessionHandle - - // The configuration settings for this session. - 4: optional map configuration -} - - -// CloseSession() -// -// Closes the specified session and frees any resources -// currently allocated to that session. Any open -// operations in that session will be canceled. -struct TCloseSessionReq { - 1: required TSessionHandle sessionHandle -} - -struct TCloseSessionResp { - 1: required TStatus status -} - - - -enum TGetInfoType { - CLI_MAX_DRIVER_CONNECTIONS = 0, - CLI_MAX_CONCURRENT_ACTIVITIES = 1, - CLI_DATA_SOURCE_NAME = 2, - CLI_FETCH_DIRECTION = 8, - CLI_SERVER_NAME = 13, - CLI_SEARCH_PATTERN_ESCAPE = 14, - CLI_DBMS_NAME = 17, - CLI_DBMS_VER = 18, - CLI_ACCESSIBLE_TABLES = 19, - CLI_ACCESSIBLE_PROCEDURES = 20, - CLI_CURSOR_COMMIT_BEHAVIOR = 23, - CLI_DATA_SOURCE_READ_ONLY = 25, - CLI_DEFAULT_TXN_ISOLATION = 26, - CLI_IDENTIFIER_CASE = 28, - CLI_IDENTIFIER_QUOTE_CHAR = 29, - CLI_MAX_COLUMN_NAME_LEN = 30, - CLI_MAX_CURSOR_NAME_LEN = 31, - CLI_MAX_SCHEMA_NAME_LEN = 32, - CLI_MAX_CATALOG_NAME_LEN = 34, - CLI_MAX_TABLE_NAME_LEN = 35, - CLI_SCROLL_CONCURRENCY = 43, - CLI_TXN_CAPABLE = 46, - CLI_USER_NAME = 47, - CLI_TXN_ISOLATION_OPTION = 72, - CLI_INTEGRITY = 73, - CLI_GETDATA_EXTENSIONS = 81, - CLI_NULL_COLLATION = 85, - CLI_ALTER_TABLE = 86, - CLI_ORDER_BY_COLUMNS_IN_SELECT = 90, - CLI_SPECIAL_CHARACTERS = 94, - CLI_MAX_COLUMNS_IN_GROUP_BY = 97, - CLI_MAX_COLUMNS_IN_INDEX = 98, - CLI_MAX_COLUMNS_IN_ORDER_BY = 99, - CLI_MAX_COLUMNS_IN_SELECT = 100, - CLI_MAX_COLUMNS_IN_TABLE = 101, - CLI_MAX_INDEX_SIZE = 102, - CLI_MAX_ROW_SIZE = 104, - CLI_MAX_STATEMENT_LEN = 105, - CLI_MAX_TABLES_IN_SELECT = 106, - CLI_MAX_USER_NAME_LEN = 107, - CLI_OJ_CAPABILITIES = 115, - - CLI_XOPEN_CLI_YEAR = 10000, - CLI_CURSOR_SENSITIVITY = 10001, - CLI_DESCRIBE_PARAMETER = 10002, - CLI_CATALOG_NAME = 10003, - CLI_COLLATION_SEQ = 10004, - CLI_MAX_IDENTIFIER_LEN = 10005, -} - -union TGetInfoValue { - 1: string stringValue - 2: i16 smallIntValue - 3: i32 integerBitmask - 4: i32 integerFlag - 5: i32 binaryValue - 6: i64 lenValue -} - -// GetInfo() -// -// This function is based on ODBC's CLIGetInfo() function. -// The function returns general information about the data source -// using the same keys as ODBC. -struct TGetInfoReq { - // The sesssion to run this request against - 1: required TSessionHandle sessionHandle - - 2: required TGetInfoType infoType -} - -struct TGetInfoResp { - 1: required TStatus status - - 2: required TGetInfoValue infoValue -} - - -// ExecuteStatement() -// -// Execute a statement. -// The returned OperationHandle can be used to check on the -// status of the statement, and to fetch results once the -// statement has finished executing. -struct TExecuteStatementReq { - // The session to execute the statement against - 1: required TSessionHandle sessionHandle - - // The statement to be executed (DML, DDL, SET, etc) - 2: required string statement - - // Configuration properties that are overlayed on top of the - // the existing session configuration before this statement - // is executed. These properties apply to this statement - // only and will not affect the subsequent state of the Session. - 3: optional map confOverlay - - // Execute asynchronously when runAsync is true - 4: optional bool runAsync = false - - // The number of seconds after which the query will timeout on the server - 5: optional i64 queryTimeout = 0 -} - -struct TExecuteStatementResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - -// GetTypeInfo() -// -// Get information about types supported by the HiveServer instance. -// The information is returned as a result set which can be fetched -// using the OperationHandle provided in the response. -// -// Refer to the documentation for ODBC's CLIGetTypeInfo function for -// the format of the result set. -struct TGetTypeInfoReq { - // The session to run this request against. - 1: required TSessionHandle sessionHandle -} - -struct TGetTypeInfoResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetCatalogs() -// -// Returns the list of catalogs (databases) -// Results are ordered by TABLE_CATALOG -// -// Resultset columns : -// col1 -// name: TABLE_CAT -// type: STRING -// desc: Catalog name. NULL if not applicable. -// -struct TGetCatalogsReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle -} - -struct TGetCatalogsResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetSchemas() -// -// Retrieves the schema names available in this database. -// The results are ordered by TABLE_CATALOG and TABLE_SCHEM. -// col1 -// name: TABLE_SCHEM -// type: STRING -// desc: schema name -// col2 -// name: TABLE_CATALOG -// type: STRING -// desc: catalog name -struct TGetSchemasReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle - - // Name of the catalog. Must not contain a search pattern. - 2: optional TIdentifier catalogName - - // schema name or pattern - 3: optional TPatternOrIdentifier schemaName -} - -struct TGetSchemasResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetTables() -// -// Returns a list of tables with catalog, schema, and table -// type information. The information is returned as a result -// set which can be fetched using the OperationHandle -// provided in the response. -// Results are ordered by TABLE_TYPE, TABLE_CAT, TABLE_SCHEM, and TABLE_NAME -// -// Result Set Columns: -// -// col1 -// name: TABLE_CAT -// type: STRING -// desc: Catalog name. NULL if not applicable. -// -// col2 -// name: TABLE_SCHEM -// type: STRING -// desc: Schema name. -// -// col3 -// name: TABLE_NAME -// type: STRING -// desc: Table name. -// -// col4 -// name: TABLE_TYPE -// type: STRING -// desc: The table type, e.g. "TABLE", "VIEW", etc. -// -// col5 -// name: REMARKS -// type: STRING -// desc: Comments about the table -// -struct TGetTablesReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle - - // Name of the catalog or a search pattern. - 2: optional TPatternOrIdentifier catalogName - - // Name of the schema or a search pattern. - 3: optional TPatternOrIdentifier schemaName - - // Name of the table or a search pattern. - 4: optional TPatternOrIdentifier tableName - - // List of table types to match - // e.g. "TABLE", "VIEW", "SYSTEM TABLE", "GLOBAL TEMPORARY", - // "LOCAL TEMPORARY", "ALIAS", "SYNONYM", etc. - 5: optional list tableTypes -} - -struct TGetTablesResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetTableTypes() -// -// Returns the table types available in this database. -// The results are ordered by table type. -// -// col1 -// name: TABLE_TYPE -// type: STRING -// desc: Table type name. -struct TGetTableTypesReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle -} - -struct TGetTableTypesResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetColumns() -// -// Returns a list of columns in the specified tables. -// The information is returned as a result set which can be fetched -// using the OperationHandle provided in the response. -// Results are ordered by TABLE_CAT, TABLE_SCHEM, TABLE_NAME, -// and ORDINAL_POSITION. -// -// Result Set Columns are the same as those for the ODBC CLIColumns -// function. -// -struct TGetColumnsReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle - - // Name of the catalog. Must not contain a search pattern. - 2: optional TIdentifier catalogName - - // Schema name or search pattern - 3: optional TPatternOrIdentifier schemaName - - // Table name or search pattern - 4: optional TPatternOrIdentifier tableName - - // Column name or search pattern - 5: optional TPatternOrIdentifier columnName -} - -struct TGetColumnsResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - - -// GetFunctions() -// -// Returns a list of functions supported by the data source. The -// behavior of this function matches -// java.sql.DatabaseMetaData.getFunctions() both in terms of -// inputs and outputs. -// -// Result Set Columns: -// -// col1 -// name: FUNCTION_CAT -// type: STRING -// desc: Function catalog (may be null) -// -// col2 -// name: FUNCTION_SCHEM -// type: STRING -// desc: Function schema (may be null) -// -// col3 -// name: FUNCTION_NAME -// type: STRING -// desc: Function name. This is the name used to invoke the function. -// -// col4 -// name: REMARKS -// type: STRING -// desc: Explanatory comment on the function. -// -// col5 -// name: FUNCTION_TYPE -// type: SMALLINT -// desc: Kind of function. One of: -// * functionResultUnknown - Cannot determine if a return value or a table -// will be returned. -// * functionNoTable - Does not a return a table. -// * functionReturnsTable - Returns a table. -// -// col6 -// name: SPECIFIC_NAME -// type: STRING -// desc: The name which uniquely identifies this function within its schema. -// In this case this is the fully qualified class name of the class -// that implements this function. -// -struct TGetFunctionsReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle - - // A catalog name; must match the catalog name as it is stored in the - // database; "" retrieves those without a catalog; null means - // that the catalog name should not be used to narrow the search. - 2: optional TIdentifier catalogName - - // A schema name pattern; must match the schema name as it is stored - // in the database; "" retrieves those without a schema; null means - // that the schema name should not be used to narrow the search. - 3: optional TPatternOrIdentifier schemaName - - // A function name pattern; must match the function name as it is stored - // in the database. - 4: required TPatternOrIdentifier functionName -} - -struct TGetFunctionsResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - -struct TGetPrimaryKeysReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle - - // Name of the catalog. - 2: optional TIdentifier catalogName - - // Name of the schema. - 3: optional TIdentifier schemaName - - // Name of the table. - 4: optional TIdentifier tableName -} - -struct TGetPrimaryKeysResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - -struct TGetCrossReferenceReq { - // Session to run this request against - 1: required TSessionHandle sessionHandle - - // Name of the parent catalog. - 2: optional TIdentifier parentCatalogName - - // Name of the parent schema. - 3: optional TIdentifier parentSchemaName - - // Name of the parent table. - 4: optional TIdentifier parentTableName - - // Name of the foreign catalog. - 5: optional TIdentifier foreignCatalogName - - // Name of the foreign schema. - 6: optional TIdentifier foreignSchemaName - - // Name of the foreign table. - 7: optional TIdentifier foreignTableName -} - -struct TGetCrossReferenceResp { - 1: required TStatus status - 2: optional TOperationHandle operationHandle -} - -// GetOperationStatus() -// -// Get the status of an operation running on the server. -struct TGetOperationStatusReq { - // Session to run this request against - 1: required TOperationHandle operationHandle - // optional arguments to get progress information - 2: optional bool getProgressUpdate -} - -struct TGetOperationStatusResp { - 1: required TStatus status - 2: optional TOperationState operationState - - // If operationState is ERROR_STATE, then the following fields may be set - // sqlState as defined in the ISO/IEF CLI specification - 3: optional string sqlState - - // Internal error code - 4: optional i32 errorCode - - // Error message - 5: optional string errorMessage - - // List of statuses of sub tasks - 6: optional string taskStatus - - // When was the operation started - 7: optional i64 operationStarted - - // When was the operation completed - 8: optional i64 operationCompleted - - // If the operation has the result - 9: optional bool hasResultSet - - 10: optional TProgressUpdateResp progressUpdateResponse - -} - - -// CancelOperation() -// -// Cancels processing on the specified operation handle and -// frees any resources which were allocated. -struct TCancelOperationReq { - // Operation to cancel - 1: required TOperationHandle operationHandle -} - -struct TCancelOperationResp { - 1: required TStatus status -} - - -// CloseOperation() -// -// Given an operation in the FINISHED, CANCELED, -// or ERROR states, CloseOperation() will free -// all of the resources which were allocated on -// the server to service the operation. -struct TCloseOperationReq { - 1: required TOperationHandle operationHandle -} - -struct TCloseOperationResp { - 1: required TStatus status -} - - -// GetResultSetMetadata() -// -// Retrieves schema information for the specified operation -struct TGetResultSetMetadataReq { - // Operation for which to fetch result set schema information - 1: required TOperationHandle operationHandle -} - -struct TGetResultSetMetadataResp { - 1: required TStatus status - 2: optional TTableSchema schema -} - - -enum TFetchOrientation { - // Get the next rowset. The fetch offset is ignored. - FETCH_NEXT, - - // Get the previous rowset. The fetch offset is ignored. - FETCH_PRIOR, - - // Return the rowset at the given fetch offset relative - // to the curren rowset. - // NOT SUPPORTED - FETCH_RELATIVE, - - // Return the rowset at the specified fetch offset. - // NOT SUPPORTED - FETCH_ABSOLUTE, - - // Get the first rowset in the result set. - FETCH_FIRST, - - // Get the last rowset in the result set. - // NOT SUPPORTED - FETCH_LAST -} - -// FetchResults() -// -// Fetch rows from the server corresponding to -// a particular OperationHandle. -struct TFetchResultsReq { - // Operation from which to fetch results. - 1: required TOperationHandle operationHandle - - // The fetch orientation. This must be either - // FETCH_NEXT, FETCH_PRIOR or FETCH_FIRST. Defaults to FETCH_NEXT. - 2: required TFetchOrientation orientation = TFetchOrientation.FETCH_NEXT - - // Max number of rows that should be returned in - // the rowset. - 3: required i64 maxRows - - // The type of a fetch results request. 0 represents Query output. 1 represents Log - 4: optional i16 fetchType = 0 -} - -struct TFetchResultsResp { - 1: required TStatus status - - // TRUE if there are more rows left to fetch from the server. - 2: optional bool hasMoreRows - - // The rowset. This is optional so that we have the - // option in the future of adding alternate formats for - // representing result set data, e.g. delimited strings, - // binary encoded, etc. - 3: optional TRowSet results -} - -// GetDelegationToken() -// Retrieve delegation token for the current user -struct TGetDelegationTokenReq { - // session handle - 1: required TSessionHandle sessionHandle - - // userid for the proxy user - 2: required string owner - - // designated renewer userid - 3: required string renewer -} - -struct TGetDelegationTokenResp { - // status of the request - 1: required TStatus status - - // delegation token string - 2: optional string delegationToken -} - -// CancelDelegationToken() -// Cancel the given delegation token -struct TCancelDelegationTokenReq { - // session handle - 1: required TSessionHandle sessionHandle - - // delegation token to cancel - 2: required string delegationToken -} - -struct TCancelDelegationTokenResp { - // status of the request - 1: required TStatus status -} - -// RenewDelegationToken() -// Renew the given delegation token -struct TRenewDelegationTokenReq { - // session handle - 1: required TSessionHandle sessionHandle - - // delegation token to renew - 2: required string delegationToken -} - -struct TRenewDelegationTokenResp { - // status of the request - 1: required TStatus status -} - -enum TJobExecutionStatus { - IN_PROGRESS, - COMPLETE, - NOT_AVAILABLE -} - -struct TProgressUpdateResp { - 1: required list headerNames - 2: required list> rows - 3: required double progressedPercentage - 4: required TJobExecutionStatus status - 5: required string footerSummary - 6: required i64 startTime -} - -service TCLIService { - - TOpenSessionResp OpenSession(1:TOpenSessionReq req); - - TCloseSessionResp CloseSession(1:TCloseSessionReq req); - - TGetInfoResp GetInfo(1:TGetInfoReq req); - - TExecuteStatementResp ExecuteStatement(1:TExecuteStatementReq req); - - TGetTypeInfoResp GetTypeInfo(1:TGetTypeInfoReq req); - - TGetCatalogsResp GetCatalogs(1:TGetCatalogsReq req); - - TGetSchemasResp GetSchemas(1:TGetSchemasReq req); - - TGetTablesResp GetTables(1:TGetTablesReq req); - - TGetTableTypesResp GetTableTypes(1:TGetTableTypesReq req); - - TGetColumnsResp GetColumns(1:TGetColumnsReq req); - - TGetFunctionsResp GetFunctions(1:TGetFunctionsReq req); - - TGetPrimaryKeysResp GetPrimaryKeys(1:TGetPrimaryKeysReq req); - - TGetCrossReferenceResp GetCrossReference(1:TGetCrossReferenceReq req); - - TGetOperationStatusResp GetOperationStatus(1:TGetOperationStatusReq req); - - TCancelOperationResp CancelOperation(1:TCancelOperationReq req); - - TCloseOperationResp CloseOperation(1:TCloseOperationReq req); - - TGetResultSetMetadataResp GetResultSetMetadata(1:TGetResultSetMetadataReq req); - - TFetchResultsResp FetchResults(1:TFetchResultsReq req); - - TGetDelegationTokenResp GetDelegationToken(1:TGetDelegationTokenReq req); - - TCancelDelegationTokenResp CancelDelegationToken(1:TCancelDelegationTokenReq req); - - TRenewDelegationTokenResp RenewDelegationToken(1:TRenewDelegationTokenReq req); -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TArrayTypeEntry.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TArrayTypeEntry.java deleted file mode 100644 index 358e322632144..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TArrayTypeEntry.java +++ /dev/null @@ -1,387 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TArrayTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TArrayTypeEntry"); - - private static final org.apache.thrift.protocol.TField OBJECT_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("objectTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TArrayTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TArrayTypeEntryTupleSchemeFactory()); - } - - private int objectTypePtr; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OBJECT_TYPE_PTR((short)1, "objectTypePtr"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OBJECT_TYPE_PTR - return OBJECT_TYPE_PTR; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __OBJECTTYPEPTR_ISSET_ID = 0; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OBJECT_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("objectTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TArrayTypeEntry.class, metaDataMap); - } - - public TArrayTypeEntry() { - } - - public TArrayTypeEntry( - int objectTypePtr) - { - this(); - this.objectTypePtr = objectTypePtr; - setObjectTypePtrIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TArrayTypeEntry(TArrayTypeEntry other) { - __isset_bitfield = other.__isset_bitfield; - this.objectTypePtr = other.objectTypePtr; - } - - public TArrayTypeEntry deepCopy() { - return new TArrayTypeEntry(this); - } - - @Override - public void clear() { - setObjectTypePtrIsSet(false); - this.objectTypePtr = 0; - } - - public int getObjectTypePtr() { - return this.objectTypePtr; - } - - public void setObjectTypePtr(int objectTypePtr) { - this.objectTypePtr = objectTypePtr; - setObjectTypePtrIsSet(true); - } - - public void unsetObjectTypePtr() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); - } - - /** Returns true if field objectTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetObjectTypePtr() { - return EncodingUtils.testBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID); - } - - public void setObjectTypePtrIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OBJECTTYPEPTR_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OBJECT_TYPE_PTR: - if (value == null) { - unsetObjectTypePtr(); - } else { - setObjectTypePtr((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OBJECT_TYPE_PTR: - return getObjectTypePtr(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OBJECT_TYPE_PTR: - return isSetObjectTypePtr(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TArrayTypeEntry) - return this.equals((TArrayTypeEntry)that); - return false; - } - - public boolean equals(TArrayTypeEntry that) { - if (that == null) - return false; - - boolean this_present_objectTypePtr = true; - boolean that_present_objectTypePtr = true; - if (this_present_objectTypePtr || that_present_objectTypePtr) { - if (!(this_present_objectTypePtr && that_present_objectTypePtr)) - return false; - if (this.objectTypePtr != that.objectTypePtr) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_objectTypePtr = true; - list.add(present_objectTypePtr); - if (present_objectTypePtr) - list.add(objectTypePtr); - - return list.hashCode(); - } - - @Override - public int compareTo(TArrayTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetObjectTypePtr()).compareTo(other.isSetObjectTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetObjectTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.objectTypePtr, other.objectTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TArrayTypeEntry("); - boolean first = true; - - sb.append("objectTypePtr:"); - sb.append(this.objectTypePtr); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetObjectTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'objectTypePtr' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TArrayTypeEntryStandardSchemeFactory implements SchemeFactory { - public TArrayTypeEntryStandardScheme getScheme() { - return new TArrayTypeEntryStandardScheme(); - } - } - - private static class TArrayTypeEntryStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OBJECT_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.objectTypePtr = iprot.readI32(); - struct.setObjectTypePtrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(OBJECT_TYPE_PTR_FIELD_DESC); - oprot.writeI32(struct.objectTypePtr); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TArrayTypeEntryTupleSchemeFactory implements SchemeFactory { - public TArrayTypeEntryTupleScheme getScheme() { - return new TArrayTypeEntryTupleScheme(); - } - } - - private static class TArrayTypeEntryTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.objectTypePtr); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TArrayTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.objectTypePtr = iprot.readI32(); - struct.setObjectTypePtrIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TBinaryColumn.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TBinaryColumn.java deleted file mode 100644 index a869cee007c0b..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TBinaryColumn.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TBinaryColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBinaryColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBinaryColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBinaryColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBinaryColumn.class, metaDataMap); - } - - public TBinaryColumn() { - } - - public TBinaryColumn( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TBinaryColumn(TBinaryColumn other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TBinaryColumn deepCopy() { - return new TBinaryColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(ByteBuffer elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBinaryColumn) - return this.equals((TBinaryColumn)that); - return false; - } - - public boolean equals(TBinaryColumn that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); - - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); - - return list.hashCode(); - } - - @Override - public int compareTo(TBinaryColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TBinaryColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.values, sb); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TBinaryColumnStandardSchemeFactory implements SchemeFactory { - public TBinaryColumnStandardScheme getScheme() { - return new TBinaryColumnStandardScheme(); - } - } - - private static class TBinaryColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBinaryColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list110 = iprot.readListBegin(); - struct.values = new ArrayList(_list110.size); - ByteBuffer _elem111; - for (int _i112 = 0; _i112 < _list110.size; ++_i112) - { - _elem111 = iprot.readBinary(); - struct.values.add(_elem111); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBinaryColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); - for (ByteBuffer _iter113 : struct.values) - { - oprot.writeBinary(_iter113); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBinaryColumnTupleSchemeFactory implements SchemeFactory { - public TBinaryColumnTupleScheme getScheme() { - return new TBinaryColumnTupleScheme(); - } - } - - private static class TBinaryColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (ByteBuffer _iter114 : struct.values) - { - oprot.writeBinary(_iter114); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBinaryColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list115 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.values = new ArrayList(_list115.size); - ByteBuffer _elem116; - for (int _i117 = 0; _i117 < _list115.size; ++_i117) - { - _elem116 = iprot.readBinary(); - struct.values.add(_elem116); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TBoolColumn.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TBoolColumn.java deleted file mode 100644 index 9bb636672aa1e..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TBoolColumn.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TBoolColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBoolColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBoolColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolColumn.class, metaDataMap); - } - - public TBoolColumn() { - } - - public TBoolColumn( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TBoolColumn(TBoolColumn other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TBoolColumn deepCopy() { - return new TBoolColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(boolean elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBoolColumn) - return this.equals((TBoolColumn)that); - return false; - } - - public boolean equals(TBoolColumn that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); - - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); - - return list.hashCode(); - } - - @Override - public int compareTo(TBoolColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TBoolColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TBoolColumnStandardSchemeFactory implements SchemeFactory { - public TBoolColumnStandardScheme getScheme() { - return new TBoolColumnStandardScheme(); - } - } - - private static class TBoolColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list54 = iprot.readListBegin(); - struct.values = new ArrayList(_list54.size); - boolean _elem55; - for (int _i56 = 0; _i56 < _list54.size; ++_i56) - { - _elem55 = iprot.readBool(); - struct.values.add(_elem55); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBoolColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, struct.values.size())); - for (boolean _iter57 : struct.values) - { - oprot.writeBool(_iter57); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBoolColumnTupleSchemeFactory implements SchemeFactory { - public TBoolColumnTupleScheme getScheme() { - return new TBoolColumnTupleScheme(); - } - } - - private static class TBoolColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (boolean _iter58 : struct.values) - { - oprot.writeBool(_iter58); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBoolColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list59 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BOOL, iprot.readI32()); - struct.values = new ArrayList(_list59.size); - boolean _elem60; - for (int _i61 = 0; _i61 < _list59.size; ++_i61) - { - _elem60 = iprot.readBool(); - struct.values.add(_elem60); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TBoolValue.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TBoolValue.java deleted file mode 100644 index 87b3070a89b11..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TBoolValue.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TBoolValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TBoolValue"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BOOL, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TBoolValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TBoolValueTupleSchemeFactory()); - } - - private boolean value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TBoolValue.class, metaDataMap); - } - - public TBoolValue() { - } - - /** - * Performs a deep copy on other. - */ - public TBoolValue(TBoolValue other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TBoolValue deepCopy() { - return new TBoolValue(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = false; - } - - public boolean isValue() { - return this.value; - } - - public void setValue(boolean value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return isValue(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TBoolValue) - return this.equals((TBoolValue)that); - return false; - } - - public boolean equals(TBoolValue that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); - - return list.hashCode(); - } - - @Override - public int compareTo(TBoolValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TBoolValue("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TBoolValueStandardSchemeFactory implements SchemeFactory { - public TBoolValueStandardScheme getScheme() { - return new TBoolValueStandardScheme(); - } - } - - private static class TBoolValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TBoolValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.value = iprot.readBool(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TBoolValue struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeBool(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TBoolValueTupleSchemeFactory implements SchemeFactory { - public TBoolValueTupleScheme getScheme() { - return new TBoolValueTupleScheme(); - } - } - - private static class TBoolValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeBool(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TBoolValue struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readBool(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TByteColumn.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TByteColumn.java deleted file mode 100644 index 68b3d3c31eb03..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TByteColumn.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TByteColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TByteColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TByteColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteColumn.class, metaDataMap); - } - - public TByteColumn() { - } - - public TByteColumn( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TByteColumn(TByteColumn other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TByteColumn deepCopy() { - return new TByteColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(byte elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TByteColumn) - return this.equals((TByteColumn)that); - return false; - } - - public boolean equals(TByteColumn that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); - - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); - - return list.hashCode(); - } - - @Override - public int compareTo(TByteColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TByteColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TByteColumnStandardSchemeFactory implements SchemeFactory { - public TByteColumnStandardScheme getScheme() { - return new TByteColumnStandardScheme(); - } - } - - private static class TByteColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TByteColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list62 = iprot.readListBegin(); - struct.values = new ArrayList(_list62.size); - byte _elem63; - for (int _i64 = 0; _i64 < _list62.size; ++_i64) - { - _elem63 = iprot.readByte(); - struct.values.add(_elem63); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TByteColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, struct.values.size())); - for (byte _iter65 : struct.values) - { - oprot.writeByte(_iter65); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TByteColumnTupleSchemeFactory implements SchemeFactory { - public TByteColumnTupleScheme getScheme() { - return new TByteColumnTupleScheme(); - } - } - - private static class TByteColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (byte _iter66 : struct.values) - { - oprot.writeByte(_iter66); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TByteColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list67 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.BYTE, iprot.readI32()); - struct.values = new ArrayList(_list67.size); - byte _elem68; - for (int _i69 = 0; _i69 < _list67.size; ++_i69) - { - _elem68 = iprot.readByte(); - struct.values.add(_elem68); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TByteValue.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TByteValue.java deleted file mode 100644 index a3d5951335fa7..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TByteValue.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TByteValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TByteValue"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.BYTE, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TByteValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TByteValueTupleSchemeFactory()); - } - - private byte value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TByteValue.class, metaDataMap); - } - - public TByteValue() { - } - - /** - * Performs a deep copy on other. - */ - public TByteValue(TByteValue other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TByteValue deepCopy() { - return new TByteValue(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0; - } - - public byte getValue() { - return this.value; - } - - public void setValue(byte value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((Byte)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TByteValue) - return this.equals((TByteValue)that); - return false; - } - - public boolean equals(TByteValue that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); - - return list.hashCode(); - } - - @Override - public int compareTo(TByteValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TByteValue("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TByteValueStandardSchemeFactory implements SchemeFactory { - public TByteValueStandardScheme getScheme() { - return new TByteValueStandardScheme(); - } - } - - private static class TByteValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TByteValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) { - struct.value = iprot.readByte(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TByteValue struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeByte(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TByteValueTupleSchemeFactory implements SchemeFactory { - public TByteValueTupleScheme getScheme() { - return new TByteValueTupleScheme(); - } - } - - private static class TByteValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeByte(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TByteValue struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readByte(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCLIService.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCLIService.java deleted file mode 100644 index 6584c24a0142a..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCLIService.java +++ /dev/null @@ -1,18138 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TCLIService { - - public interface Iface { - - public TOpenSessionResp OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException; - - public TCloseSessionResp CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException; - - public TGetInfoResp GetInfo(TGetInfoReq req) throws org.apache.thrift.TException; - - public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException; - - public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException; - - public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException; - - public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException; - - public TGetTablesResp GetTables(TGetTablesReq req) throws org.apache.thrift.TException; - - public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException; - - public TGetColumnsResp GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException; - - public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException; - - public TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req) throws org.apache.thrift.TException; - - public TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req) throws org.apache.thrift.TException; - - public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException; - - public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException; - - public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException; - - public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException; - - public TFetchResultsResp FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException; - - public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException; - - public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException; - - public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException; - - } - - public interface AsyncIface { - - public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetTypeInfo(TGetTypeInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetCatalogs(TGetCatalogsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - } - - public static class Client extends org.apache.thrift.TServiceClient implements Iface { - public static class Factory implements org.apache.thrift.TServiceClientFactory { - public Factory() {} - public Client getClient(org.apache.thrift.protocol.TProtocol prot) { - return new Client(prot); - } - public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - return new Client(iprot, oprot); - } - } - - public Client(org.apache.thrift.protocol.TProtocol prot) - { - super(prot, prot); - } - - public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { - super(iprot, oprot); - } - - public TOpenSessionResp OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException - { - send_OpenSession(req); - return recv_OpenSession(); - } - - public void send_OpenSession(TOpenSessionReq req) throws org.apache.thrift.TException - { - OpenSession_args args = new OpenSession_args(); - args.setReq(req); - sendBase("OpenSession", args); - } - - public TOpenSessionResp recv_OpenSession() throws org.apache.thrift.TException - { - OpenSession_result result = new OpenSession_result(); - receiveBase(result, "OpenSession"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "OpenSession failed: unknown result"); - } - - public TCloseSessionResp CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException - { - send_CloseSession(req); - return recv_CloseSession(); - } - - public void send_CloseSession(TCloseSessionReq req) throws org.apache.thrift.TException - { - CloseSession_args args = new CloseSession_args(); - args.setReq(req); - sendBase("CloseSession", args); - } - - public TCloseSessionResp recv_CloseSession() throws org.apache.thrift.TException - { - CloseSession_result result = new CloseSession_result(); - receiveBase(result, "CloseSession"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CloseSession failed: unknown result"); - } - - public TGetInfoResp GetInfo(TGetInfoReq req) throws org.apache.thrift.TException - { - send_GetInfo(req); - return recv_GetInfo(); - } - - public void send_GetInfo(TGetInfoReq req) throws org.apache.thrift.TException - { - GetInfo_args args = new GetInfo_args(); - args.setReq(req); - sendBase("GetInfo", args); - } - - public TGetInfoResp recv_GetInfo() throws org.apache.thrift.TException - { - GetInfo_result result = new GetInfo_result(); - receiveBase(result, "GetInfo"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetInfo failed: unknown result"); - } - - public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException - { - send_ExecuteStatement(req); - return recv_ExecuteStatement(); - } - - public void send_ExecuteStatement(TExecuteStatementReq req) throws org.apache.thrift.TException - { - ExecuteStatement_args args = new ExecuteStatement_args(); - args.setReq(req); - sendBase("ExecuteStatement", args); - } - - public TExecuteStatementResp recv_ExecuteStatement() throws org.apache.thrift.TException - { - ExecuteStatement_result result = new ExecuteStatement_result(); - receiveBase(result, "ExecuteStatement"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "ExecuteStatement failed: unknown result"); - } - - public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException - { - send_GetTypeInfo(req); - return recv_GetTypeInfo(); - } - - public void send_GetTypeInfo(TGetTypeInfoReq req) throws org.apache.thrift.TException - { - GetTypeInfo_args args = new GetTypeInfo_args(); - args.setReq(req); - sendBase("GetTypeInfo", args); - } - - public TGetTypeInfoResp recv_GetTypeInfo() throws org.apache.thrift.TException - { - GetTypeInfo_result result = new GetTypeInfo_result(); - receiveBase(result, "GetTypeInfo"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTypeInfo failed: unknown result"); - } - - public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException - { - send_GetCatalogs(req); - return recv_GetCatalogs(); - } - - public void send_GetCatalogs(TGetCatalogsReq req) throws org.apache.thrift.TException - { - GetCatalogs_args args = new GetCatalogs_args(); - args.setReq(req); - sendBase("GetCatalogs", args); - } - - public TGetCatalogsResp recv_GetCatalogs() throws org.apache.thrift.TException - { - GetCatalogs_result result = new GetCatalogs_result(); - receiveBase(result, "GetCatalogs"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetCatalogs failed: unknown result"); - } - - public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException - { - send_GetSchemas(req); - return recv_GetSchemas(); - } - - public void send_GetSchemas(TGetSchemasReq req) throws org.apache.thrift.TException - { - GetSchemas_args args = new GetSchemas_args(); - args.setReq(req); - sendBase("GetSchemas", args); - } - - public TGetSchemasResp recv_GetSchemas() throws org.apache.thrift.TException - { - GetSchemas_result result = new GetSchemas_result(); - receiveBase(result, "GetSchemas"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetSchemas failed: unknown result"); - } - - public TGetTablesResp GetTables(TGetTablesReq req) throws org.apache.thrift.TException - { - send_GetTables(req); - return recv_GetTables(); - } - - public void send_GetTables(TGetTablesReq req) throws org.apache.thrift.TException - { - GetTables_args args = new GetTables_args(); - args.setReq(req); - sendBase("GetTables", args); - } - - public TGetTablesResp recv_GetTables() throws org.apache.thrift.TException - { - GetTables_result result = new GetTables_result(); - receiveBase(result, "GetTables"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTables failed: unknown result"); - } - - public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException - { - send_GetTableTypes(req); - return recv_GetTableTypes(); - } - - public void send_GetTableTypes(TGetTableTypesReq req) throws org.apache.thrift.TException - { - GetTableTypes_args args = new GetTableTypes_args(); - args.setReq(req); - sendBase("GetTableTypes", args); - } - - public TGetTableTypesResp recv_GetTableTypes() throws org.apache.thrift.TException - { - GetTableTypes_result result = new GetTableTypes_result(); - receiveBase(result, "GetTableTypes"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetTableTypes failed: unknown result"); - } - - public TGetColumnsResp GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException - { - send_GetColumns(req); - return recv_GetColumns(); - } - - public void send_GetColumns(TGetColumnsReq req) throws org.apache.thrift.TException - { - GetColumns_args args = new GetColumns_args(); - args.setReq(req); - sendBase("GetColumns", args); - } - - public TGetColumnsResp recv_GetColumns() throws org.apache.thrift.TException - { - GetColumns_result result = new GetColumns_result(); - receiveBase(result, "GetColumns"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetColumns failed: unknown result"); - } - - public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException - { - send_GetFunctions(req); - return recv_GetFunctions(); - } - - public void send_GetFunctions(TGetFunctionsReq req) throws org.apache.thrift.TException - { - GetFunctions_args args = new GetFunctions_args(); - args.setReq(req); - sendBase("GetFunctions", args); - } - - public TGetFunctionsResp recv_GetFunctions() throws org.apache.thrift.TException - { - GetFunctions_result result = new GetFunctions_result(); - receiveBase(result, "GetFunctions"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetFunctions failed: unknown result"); - } - - public TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req) throws org.apache.thrift.TException - { - send_GetPrimaryKeys(req); - return recv_GetPrimaryKeys(); - } - - public void send_GetPrimaryKeys(TGetPrimaryKeysReq req) throws org.apache.thrift.TException - { - GetPrimaryKeys_args args = new GetPrimaryKeys_args(); - args.setReq(req); - sendBase("GetPrimaryKeys", args); - } - - public TGetPrimaryKeysResp recv_GetPrimaryKeys() throws org.apache.thrift.TException - { - GetPrimaryKeys_result result = new GetPrimaryKeys_result(); - receiveBase(result, "GetPrimaryKeys"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetPrimaryKeys failed: unknown result"); - } - - public TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req) throws org.apache.thrift.TException - { - send_GetCrossReference(req); - return recv_GetCrossReference(); - } - - public void send_GetCrossReference(TGetCrossReferenceReq req) throws org.apache.thrift.TException - { - GetCrossReference_args args = new GetCrossReference_args(); - args.setReq(req); - sendBase("GetCrossReference", args); - } - - public TGetCrossReferenceResp recv_GetCrossReference() throws org.apache.thrift.TException - { - GetCrossReference_result result = new GetCrossReference_result(); - receiveBase(result, "GetCrossReference"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetCrossReference failed: unknown result"); - } - - public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException - { - send_GetOperationStatus(req); - return recv_GetOperationStatus(); - } - - public void send_GetOperationStatus(TGetOperationStatusReq req) throws org.apache.thrift.TException - { - GetOperationStatus_args args = new GetOperationStatus_args(); - args.setReq(req); - sendBase("GetOperationStatus", args); - } - - public TGetOperationStatusResp recv_GetOperationStatus() throws org.apache.thrift.TException - { - GetOperationStatus_result result = new GetOperationStatus_result(); - receiveBase(result, "GetOperationStatus"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetOperationStatus failed: unknown result"); - } - - public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException - { - send_CancelOperation(req); - return recv_CancelOperation(); - } - - public void send_CancelOperation(TCancelOperationReq req) throws org.apache.thrift.TException - { - CancelOperation_args args = new CancelOperation_args(); - args.setReq(req); - sendBase("CancelOperation", args); - } - - public TCancelOperationResp recv_CancelOperation() throws org.apache.thrift.TException - { - CancelOperation_result result = new CancelOperation_result(); - receiveBase(result, "CancelOperation"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CancelOperation failed: unknown result"); - } - - public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException - { - send_CloseOperation(req); - return recv_CloseOperation(); - } - - public void send_CloseOperation(TCloseOperationReq req) throws org.apache.thrift.TException - { - CloseOperation_args args = new CloseOperation_args(); - args.setReq(req); - sendBase("CloseOperation", args); - } - - public TCloseOperationResp recv_CloseOperation() throws org.apache.thrift.TException - { - CloseOperation_result result = new CloseOperation_result(); - receiveBase(result, "CloseOperation"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CloseOperation failed: unknown result"); - } - - public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException - { - send_GetResultSetMetadata(req); - return recv_GetResultSetMetadata(); - } - - public void send_GetResultSetMetadata(TGetResultSetMetadataReq req) throws org.apache.thrift.TException - { - GetResultSetMetadata_args args = new GetResultSetMetadata_args(); - args.setReq(req); - sendBase("GetResultSetMetadata", args); - } - - public TGetResultSetMetadataResp recv_GetResultSetMetadata() throws org.apache.thrift.TException - { - GetResultSetMetadata_result result = new GetResultSetMetadata_result(); - receiveBase(result, "GetResultSetMetadata"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetResultSetMetadata failed: unknown result"); - } - - public TFetchResultsResp FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException - { - send_FetchResults(req); - return recv_FetchResults(); - } - - public void send_FetchResults(TFetchResultsReq req) throws org.apache.thrift.TException - { - FetchResults_args args = new FetchResults_args(); - args.setReq(req); - sendBase("FetchResults", args); - } - - public TFetchResultsResp recv_FetchResults() throws org.apache.thrift.TException - { - FetchResults_result result = new FetchResults_result(); - receiveBase(result, "FetchResults"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "FetchResults failed: unknown result"); - } - - public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException - { - send_GetDelegationToken(req); - return recv_GetDelegationToken(); - } - - public void send_GetDelegationToken(TGetDelegationTokenReq req) throws org.apache.thrift.TException - { - GetDelegationToken_args args = new GetDelegationToken_args(); - args.setReq(req); - sendBase("GetDelegationToken", args); - } - - public TGetDelegationTokenResp recv_GetDelegationToken() throws org.apache.thrift.TException - { - GetDelegationToken_result result = new GetDelegationToken_result(); - receiveBase(result, "GetDelegationToken"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetDelegationToken failed: unknown result"); - } - - public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException - { - send_CancelDelegationToken(req); - return recv_CancelDelegationToken(); - } - - public void send_CancelDelegationToken(TCancelDelegationTokenReq req) throws org.apache.thrift.TException - { - CancelDelegationToken_args args = new CancelDelegationToken_args(); - args.setReq(req); - sendBase("CancelDelegationToken", args); - } - - public TCancelDelegationTokenResp recv_CancelDelegationToken() throws org.apache.thrift.TException - { - CancelDelegationToken_result result = new CancelDelegationToken_result(); - receiveBase(result, "CancelDelegationToken"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CancelDelegationToken failed: unknown result"); - } - - public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException - { - send_RenewDelegationToken(req); - return recv_RenewDelegationToken(); - } - - public void send_RenewDelegationToken(TRenewDelegationTokenReq req) throws org.apache.thrift.TException - { - RenewDelegationToken_args args = new RenewDelegationToken_args(); - args.setReq(req); - sendBase("RenewDelegationToken", args); - } - - public TRenewDelegationTokenResp recv_RenewDelegationToken() throws org.apache.thrift.TException - { - RenewDelegationToken_result result = new RenewDelegationToken_result(); - receiveBase(result, "RenewDelegationToken"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "RenewDelegationToken failed: unknown result"); - } - - } - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { - public static class Factory implements org.apache.thrift.async.TAsyncClientFactory { - private org.apache.thrift.async.TAsyncClientManager clientManager; - private org.apache.thrift.protocol.TProtocolFactory protocolFactory; - public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { - this.clientManager = clientManager; - this.protocolFactory = protocolFactory; - } - public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) { - return new AsyncClient(protocolFactory, clientManager, transport); - } - } - - public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { - super(protocolFactory, clientManager, transport); - } - - public void OpenSession(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - OpenSession_call method_call = new OpenSession_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class OpenSession_call extends org.apache.thrift.async.TAsyncMethodCall { - private TOpenSessionReq req; - public OpenSession_call(TOpenSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("OpenSession", org.apache.thrift.protocol.TMessageType.CALL, 0)); - OpenSession_args args = new OpenSession_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TOpenSessionResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_OpenSession(); - } - } - - public void CloseSession(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - CloseSession_call method_call = new CloseSession_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class CloseSession_call extends org.apache.thrift.async.TAsyncMethodCall { - private TCloseSessionReq req; - public CloseSession_call(TCloseSessionReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("CloseSession", org.apache.thrift.protocol.TMessageType.CALL, 0)); - CloseSession_args args = new CloseSession_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TCloseSessionResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_CloseSession(); - } - } - - public void GetInfo(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetInfo_call method_call = new GetInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetInfo_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetInfoReq req; - public GetInfo_call(TGetInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetInfo_args args = new GetInfo_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetInfoResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetInfo(); - } - } - - public void ExecuteStatement(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - ExecuteStatement_call method_call = new ExecuteStatement_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class ExecuteStatement_call extends org.apache.thrift.async.TAsyncMethodCall { - private TExecuteStatementReq req; - public ExecuteStatement_call(TExecuteStatementReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("ExecuteStatement", org.apache.thrift.protocol.TMessageType.CALL, 0)); - ExecuteStatement_args args = new ExecuteStatement_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TExecuteStatementResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_ExecuteStatement(); - } - } - - public void GetTypeInfo(TGetTypeInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetTypeInfo_call method_call = new GetTypeInfo_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetTypeInfo_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetTypeInfoReq req; - public GetTypeInfo_call(TGetTypeInfoReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetTypeInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetTypeInfo_args args = new GetTypeInfo_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetTypeInfoResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetTypeInfo(); - } - } - - public void GetCatalogs(TGetCatalogsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetCatalogs_call method_call = new GetCatalogs_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetCatalogs_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetCatalogsReq req; - public GetCatalogs_call(TGetCatalogsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetCatalogs", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetCatalogs_args args = new GetCatalogs_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetCatalogsResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetCatalogs(); - } - } - - public void GetSchemas(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetSchemas_call method_call = new GetSchemas_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetSchemas_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetSchemasReq req; - public GetSchemas_call(TGetSchemasReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetSchemas", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetSchemas_args args = new GetSchemas_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetSchemasResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetSchemas(); - } - } - - public void GetTables(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetTables_call method_call = new GetTables_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetTables_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetTablesReq req; - public GetTables_call(TGetTablesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetTables", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetTables_args args = new GetTables_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetTablesResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetTables(); - } - } - - public void GetTableTypes(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetTableTypes_call method_call = new GetTableTypes_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetTableTypes_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetTableTypesReq req; - public GetTableTypes_call(TGetTableTypesReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetTableTypes", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetTableTypes_args args = new GetTableTypes_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetTableTypesResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetTableTypes(); - } - } - - public void GetColumns(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetColumns_call method_call = new GetColumns_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetColumns_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetColumnsReq req; - public GetColumns_call(TGetColumnsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetColumns", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetColumns_args args = new GetColumns_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetColumnsResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetColumns(); - } - } - - public void GetFunctions(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetFunctions_call method_call = new GetFunctions_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetFunctions_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetFunctionsReq req; - public GetFunctions_call(TGetFunctionsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetFunctions", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetFunctions_args args = new GetFunctions_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetFunctionsResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetFunctions(); - } - } - - public void GetPrimaryKeys(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetPrimaryKeys_call method_call = new GetPrimaryKeys_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetPrimaryKeys_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetPrimaryKeysReq req; - public GetPrimaryKeys_call(TGetPrimaryKeysReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetPrimaryKeys", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetPrimaryKeys_args args = new GetPrimaryKeys_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetPrimaryKeysResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetPrimaryKeys(); - } - } - - public void GetCrossReference(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetCrossReference_call method_call = new GetCrossReference_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetCrossReference_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetCrossReferenceReq req; - public GetCrossReference_call(TGetCrossReferenceReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetCrossReference", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetCrossReference_args args = new GetCrossReference_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetCrossReferenceResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetCrossReference(); - } - } - - public void GetOperationStatus(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetOperationStatus_call method_call = new GetOperationStatus_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetOperationStatus_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetOperationStatusReq req; - public GetOperationStatus_call(TGetOperationStatusReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetOperationStatus", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetOperationStatus_args args = new GetOperationStatus_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetOperationStatusResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetOperationStatus(); - } - } - - public void CancelOperation(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - CancelOperation_call method_call = new CancelOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class CancelOperation_call extends org.apache.thrift.async.TAsyncMethodCall { - private TCancelOperationReq req; - public CancelOperation_call(TCancelOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("CancelOperation", org.apache.thrift.protocol.TMessageType.CALL, 0)); - CancelOperation_args args = new CancelOperation_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TCancelOperationResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_CancelOperation(); - } - } - - public void CloseOperation(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - CloseOperation_call method_call = new CloseOperation_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class CloseOperation_call extends org.apache.thrift.async.TAsyncMethodCall { - private TCloseOperationReq req; - public CloseOperation_call(TCloseOperationReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("CloseOperation", org.apache.thrift.protocol.TMessageType.CALL, 0)); - CloseOperation_args args = new CloseOperation_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TCloseOperationResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_CloseOperation(); - } - } - - public void GetResultSetMetadata(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetResultSetMetadata_call method_call = new GetResultSetMetadata_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetResultSetMetadata_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetResultSetMetadataReq req; - public GetResultSetMetadata_call(TGetResultSetMetadataReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetResultSetMetadata", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetResultSetMetadata_args args = new GetResultSetMetadata_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetResultSetMetadataResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetResultSetMetadata(); - } - } - - public void FetchResults(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - FetchResults_call method_call = new FetchResults_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class FetchResults_call extends org.apache.thrift.async.TAsyncMethodCall { - private TFetchResultsReq req; - public FetchResults_call(TFetchResultsReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("FetchResults", org.apache.thrift.protocol.TMessageType.CALL, 0)); - FetchResults_args args = new FetchResults_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TFetchResultsResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_FetchResults(); - } - } - - public void GetDelegationToken(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - GetDelegationToken_call method_call = new GetDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class GetDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { - private TGetDelegationTokenReq req; - public GetDelegationToken_call(TGetDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("GetDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); - GetDelegationToken_args args = new GetDelegationToken_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TGetDelegationTokenResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_GetDelegationToken(); - } - } - - public void CancelDelegationToken(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - CancelDelegationToken_call method_call = new CancelDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class CancelDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { - private TCancelDelegationTokenReq req; - public CancelDelegationToken_call(TCancelDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("CancelDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); - CancelDelegationToken_args args = new CancelDelegationToken_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TCancelDelegationTokenResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_CancelDelegationToken(); - } - } - - public void RenewDelegationToken(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - RenewDelegationToken_call method_call = new RenewDelegationToken_call(req, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class RenewDelegationToken_call extends org.apache.thrift.async.TAsyncMethodCall { - private TRenewDelegationTokenReq req; - public RenewDelegationToken_call(TRenewDelegationTokenReq req, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { - super(client, protocolFactory, transport, resultHandler, false); - this.req = req; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("RenewDelegationToken", org.apache.thrift.protocol.TMessageType.CALL, 0)); - RenewDelegationToken_args args = new RenewDelegationToken_args(); - args.setReq(req); - args.write(prot); - prot.writeMessageEnd(); - } - - public TRenewDelegationTokenResp getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_RenewDelegationToken(); - } - } - - } - - public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); - public Processor(I iface) { - super(iface, getProcessMap(new HashMap>())); - } - - protected Processor(I iface, Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static Map> getProcessMap(Map> processMap) { - processMap.put("OpenSession", new OpenSession()); - processMap.put("CloseSession", new CloseSession()); - processMap.put("GetInfo", new GetInfo()); - processMap.put("ExecuteStatement", new ExecuteStatement()); - processMap.put("GetTypeInfo", new GetTypeInfo()); - processMap.put("GetCatalogs", new GetCatalogs()); - processMap.put("GetSchemas", new GetSchemas()); - processMap.put("GetTables", new GetTables()); - processMap.put("GetTableTypes", new GetTableTypes()); - processMap.put("GetColumns", new GetColumns()); - processMap.put("GetFunctions", new GetFunctions()); - processMap.put("GetPrimaryKeys", new GetPrimaryKeys()); - processMap.put("GetCrossReference", new GetCrossReference()); - processMap.put("GetOperationStatus", new GetOperationStatus()); - processMap.put("CancelOperation", new CancelOperation()); - processMap.put("CloseOperation", new CloseOperation()); - processMap.put("GetResultSetMetadata", new GetResultSetMetadata()); - processMap.put("FetchResults", new FetchResults()); - processMap.put("GetDelegationToken", new GetDelegationToken()); - processMap.put("CancelDelegationToken", new CancelDelegationToken()); - processMap.put("RenewDelegationToken", new RenewDelegationToken()); - return processMap; - } - - public static class OpenSession extends org.apache.thrift.ProcessFunction { - public OpenSession() { - super("OpenSession"); - } - - public OpenSession_args getEmptyArgsInstance() { - return new OpenSession_args(); - } - - protected boolean isOneway() { - return false; - } - - public OpenSession_result getResult(I iface, OpenSession_args args) throws org.apache.thrift.TException { - OpenSession_result result = new OpenSession_result(); - result.success = iface.OpenSession(args.req); - return result; - } - } - - public static class CloseSession extends org.apache.thrift.ProcessFunction { - public CloseSession() { - super("CloseSession"); - } - - public CloseSession_args getEmptyArgsInstance() { - return new CloseSession_args(); - } - - protected boolean isOneway() { - return false; - } - - public CloseSession_result getResult(I iface, CloseSession_args args) throws org.apache.thrift.TException { - CloseSession_result result = new CloseSession_result(); - result.success = iface.CloseSession(args.req); - return result; - } - } - - public static class GetInfo extends org.apache.thrift.ProcessFunction { - public GetInfo() { - super("GetInfo"); - } - - public GetInfo_args getEmptyArgsInstance() { - return new GetInfo_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetInfo_result getResult(I iface, GetInfo_args args) throws org.apache.thrift.TException { - GetInfo_result result = new GetInfo_result(); - result.success = iface.GetInfo(args.req); - return result; - } - } - - public static class ExecuteStatement extends org.apache.thrift.ProcessFunction { - public ExecuteStatement() { - super("ExecuteStatement"); - } - - public ExecuteStatement_args getEmptyArgsInstance() { - return new ExecuteStatement_args(); - } - - protected boolean isOneway() { - return false; - } - - public ExecuteStatement_result getResult(I iface, ExecuteStatement_args args) throws org.apache.thrift.TException { - ExecuteStatement_result result = new ExecuteStatement_result(); - result.success = iface.ExecuteStatement(args.req); - return result; - } - } - - public static class GetTypeInfo extends org.apache.thrift.ProcessFunction { - public GetTypeInfo() { - super("GetTypeInfo"); - } - - public GetTypeInfo_args getEmptyArgsInstance() { - return new GetTypeInfo_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetTypeInfo_result getResult(I iface, GetTypeInfo_args args) throws org.apache.thrift.TException { - GetTypeInfo_result result = new GetTypeInfo_result(); - result.success = iface.GetTypeInfo(args.req); - return result; - } - } - - public static class GetCatalogs extends org.apache.thrift.ProcessFunction { - public GetCatalogs() { - super("GetCatalogs"); - } - - public GetCatalogs_args getEmptyArgsInstance() { - return new GetCatalogs_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetCatalogs_result getResult(I iface, GetCatalogs_args args) throws org.apache.thrift.TException { - GetCatalogs_result result = new GetCatalogs_result(); - result.success = iface.GetCatalogs(args.req); - return result; - } - } - - public static class GetSchemas extends org.apache.thrift.ProcessFunction { - public GetSchemas() { - super("GetSchemas"); - } - - public GetSchemas_args getEmptyArgsInstance() { - return new GetSchemas_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetSchemas_result getResult(I iface, GetSchemas_args args) throws org.apache.thrift.TException { - GetSchemas_result result = new GetSchemas_result(); - result.success = iface.GetSchemas(args.req); - return result; - } - } - - public static class GetTables extends org.apache.thrift.ProcessFunction { - public GetTables() { - super("GetTables"); - } - - public GetTables_args getEmptyArgsInstance() { - return new GetTables_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetTables_result getResult(I iface, GetTables_args args) throws org.apache.thrift.TException { - GetTables_result result = new GetTables_result(); - result.success = iface.GetTables(args.req); - return result; - } - } - - public static class GetTableTypes extends org.apache.thrift.ProcessFunction { - public GetTableTypes() { - super("GetTableTypes"); - } - - public GetTableTypes_args getEmptyArgsInstance() { - return new GetTableTypes_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetTableTypes_result getResult(I iface, GetTableTypes_args args) throws org.apache.thrift.TException { - GetTableTypes_result result = new GetTableTypes_result(); - result.success = iface.GetTableTypes(args.req); - return result; - } - } - - public static class GetColumns extends org.apache.thrift.ProcessFunction { - public GetColumns() { - super("GetColumns"); - } - - public GetColumns_args getEmptyArgsInstance() { - return new GetColumns_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetColumns_result getResult(I iface, GetColumns_args args) throws org.apache.thrift.TException { - GetColumns_result result = new GetColumns_result(); - result.success = iface.GetColumns(args.req); - return result; - } - } - - public static class GetFunctions extends org.apache.thrift.ProcessFunction { - public GetFunctions() { - super("GetFunctions"); - } - - public GetFunctions_args getEmptyArgsInstance() { - return new GetFunctions_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetFunctions_result getResult(I iface, GetFunctions_args args) throws org.apache.thrift.TException { - GetFunctions_result result = new GetFunctions_result(); - result.success = iface.GetFunctions(args.req); - return result; - } - } - - public static class GetPrimaryKeys extends org.apache.thrift.ProcessFunction { - public GetPrimaryKeys() { - super("GetPrimaryKeys"); - } - - public GetPrimaryKeys_args getEmptyArgsInstance() { - return new GetPrimaryKeys_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetPrimaryKeys_result getResult(I iface, GetPrimaryKeys_args args) throws org.apache.thrift.TException { - GetPrimaryKeys_result result = new GetPrimaryKeys_result(); - result.success = iface.GetPrimaryKeys(args.req); - return result; - } - } - - public static class GetCrossReference extends org.apache.thrift.ProcessFunction { - public GetCrossReference() { - super("GetCrossReference"); - } - - public GetCrossReference_args getEmptyArgsInstance() { - return new GetCrossReference_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetCrossReference_result getResult(I iface, GetCrossReference_args args) throws org.apache.thrift.TException { - GetCrossReference_result result = new GetCrossReference_result(); - result.success = iface.GetCrossReference(args.req); - return result; - } - } - - public static class GetOperationStatus extends org.apache.thrift.ProcessFunction { - public GetOperationStatus() { - super("GetOperationStatus"); - } - - public GetOperationStatus_args getEmptyArgsInstance() { - return new GetOperationStatus_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetOperationStatus_result getResult(I iface, GetOperationStatus_args args) throws org.apache.thrift.TException { - GetOperationStatus_result result = new GetOperationStatus_result(); - result.success = iface.GetOperationStatus(args.req); - return result; - } - } - - public static class CancelOperation extends org.apache.thrift.ProcessFunction { - public CancelOperation() { - super("CancelOperation"); - } - - public CancelOperation_args getEmptyArgsInstance() { - return new CancelOperation_args(); - } - - protected boolean isOneway() { - return false; - } - - public CancelOperation_result getResult(I iface, CancelOperation_args args) throws org.apache.thrift.TException { - CancelOperation_result result = new CancelOperation_result(); - result.success = iface.CancelOperation(args.req); - return result; - } - } - - public static class CloseOperation extends org.apache.thrift.ProcessFunction { - public CloseOperation() { - super("CloseOperation"); - } - - public CloseOperation_args getEmptyArgsInstance() { - return new CloseOperation_args(); - } - - protected boolean isOneway() { - return false; - } - - public CloseOperation_result getResult(I iface, CloseOperation_args args) throws org.apache.thrift.TException { - CloseOperation_result result = new CloseOperation_result(); - result.success = iface.CloseOperation(args.req); - return result; - } - } - - public static class GetResultSetMetadata extends org.apache.thrift.ProcessFunction { - public GetResultSetMetadata() { - super("GetResultSetMetadata"); - } - - public GetResultSetMetadata_args getEmptyArgsInstance() { - return new GetResultSetMetadata_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetResultSetMetadata_result getResult(I iface, GetResultSetMetadata_args args) throws org.apache.thrift.TException { - GetResultSetMetadata_result result = new GetResultSetMetadata_result(); - result.success = iface.GetResultSetMetadata(args.req); - return result; - } - } - - public static class FetchResults extends org.apache.thrift.ProcessFunction { - public FetchResults() { - super("FetchResults"); - } - - public FetchResults_args getEmptyArgsInstance() { - return new FetchResults_args(); - } - - protected boolean isOneway() { - return false; - } - - public FetchResults_result getResult(I iface, FetchResults_args args) throws org.apache.thrift.TException { - FetchResults_result result = new FetchResults_result(); - result.success = iface.FetchResults(args.req); - return result; - } - } - - public static class GetDelegationToken extends org.apache.thrift.ProcessFunction { - public GetDelegationToken() { - super("GetDelegationToken"); - } - - public GetDelegationToken_args getEmptyArgsInstance() { - return new GetDelegationToken_args(); - } - - protected boolean isOneway() { - return false; - } - - public GetDelegationToken_result getResult(I iface, GetDelegationToken_args args) throws org.apache.thrift.TException { - GetDelegationToken_result result = new GetDelegationToken_result(); - result.success = iface.GetDelegationToken(args.req); - return result; - } - } - - public static class CancelDelegationToken extends org.apache.thrift.ProcessFunction { - public CancelDelegationToken() { - super("CancelDelegationToken"); - } - - public CancelDelegationToken_args getEmptyArgsInstance() { - return new CancelDelegationToken_args(); - } - - protected boolean isOneway() { - return false; - } - - public CancelDelegationToken_result getResult(I iface, CancelDelegationToken_args args) throws org.apache.thrift.TException { - CancelDelegationToken_result result = new CancelDelegationToken_result(); - result.success = iface.CancelDelegationToken(args.req); - return result; - } - } - - public static class RenewDelegationToken extends org.apache.thrift.ProcessFunction { - public RenewDelegationToken() { - super("RenewDelegationToken"); - } - - public RenewDelegationToken_args getEmptyArgsInstance() { - return new RenewDelegationToken_args(); - } - - protected boolean isOneway() { - return false; - } - - public RenewDelegationToken_result getResult(I iface, RenewDelegationToken_args args) throws org.apache.thrift.TException { - RenewDelegationToken_result result = new RenewDelegationToken_result(); - result.success = iface.RenewDelegationToken(args.req); - return result; - } - } - - } - - public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor { - private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName()); - public AsyncProcessor(I iface) { - super(iface, getProcessMap(new HashMap>())); - } - - protected AsyncProcessor(I iface, Map> processMap) { - super(iface, getProcessMap(processMap)); - } - - private static Map> getProcessMap(Map> processMap) { - processMap.put("OpenSession", new OpenSession()); - processMap.put("CloseSession", new CloseSession()); - processMap.put("GetInfo", new GetInfo()); - processMap.put("ExecuteStatement", new ExecuteStatement()); - processMap.put("GetTypeInfo", new GetTypeInfo()); - processMap.put("GetCatalogs", new GetCatalogs()); - processMap.put("GetSchemas", new GetSchemas()); - processMap.put("GetTables", new GetTables()); - processMap.put("GetTableTypes", new GetTableTypes()); - processMap.put("GetColumns", new GetColumns()); - processMap.put("GetFunctions", new GetFunctions()); - processMap.put("GetPrimaryKeys", new GetPrimaryKeys()); - processMap.put("GetCrossReference", new GetCrossReference()); - processMap.put("GetOperationStatus", new GetOperationStatus()); - processMap.put("CancelOperation", new CancelOperation()); - processMap.put("CloseOperation", new CloseOperation()); - processMap.put("GetResultSetMetadata", new GetResultSetMetadata()); - processMap.put("FetchResults", new FetchResults()); - processMap.put("GetDelegationToken", new GetDelegationToken()); - processMap.put("CancelDelegationToken", new CancelDelegationToken()); - processMap.put("RenewDelegationToken", new RenewDelegationToken()); - return processMap; - } - - public static class OpenSession extends org.apache.thrift.AsyncProcessFunction { - public OpenSession() { - super("OpenSession"); - } - - public OpenSession_args getEmptyArgsInstance() { - return new OpenSession_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TOpenSessionResp o) { - OpenSession_result result = new OpenSession_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - OpenSession_result result = new OpenSession_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, OpenSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.OpenSession(args.req,resultHandler); - } - } - - public static class CloseSession extends org.apache.thrift.AsyncProcessFunction { - public CloseSession() { - super("CloseSession"); - } - - public CloseSession_args getEmptyArgsInstance() { - return new CloseSession_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TCloseSessionResp o) { - CloseSession_result result = new CloseSession_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - CloseSession_result result = new CloseSession_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, CloseSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.CloseSession(args.req,resultHandler); - } - } - - public static class GetInfo extends org.apache.thrift.AsyncProcessFunction { - public GetInfo() { - super("GetInfo"); - } - - public GetInfo_args getEmptyArgsInstance() { - return new GetInfo_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetInfoResp o) { - GetInfo_result result = new GetInfo_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetInfo_result result = new GetInfo_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetInfo(args.req,resultHandler); - } - } - - public static class ExecuteStatement extends org.apache.thrift.AsyncProcessFunction { - public ExecuteStatement() { - super("ExecuteStatement"); - } - - public ExecuteStatement_args getEmptyArgsInstance() { - return new ExecuteStatement_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TExecuteStatementResp o) { - ExecuteStatement_result result = new ExecuteStatement_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - ExecuteStatement_result result = new ExecuteStatement_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, ExecuteStatement_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.ExecuteStatement(args.req,resultHandler); - } - } - - public static class GetTypeInfo extends org.apache.thrift.AsyncProcessFunction { - public GetTypeInfo() { - super("GetTypeInfo"); - } - - public GetTypeInfo_args getEmptyArgsInstance() { - return new GetTypeInfo_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetTypeInfoResp o) { - GetTypeInfo_result result = new GetTypeInfo_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetTypeInfo_result result = new GetTypeInfo_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetTypeInfo_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetTypeInfo(args.req,resultHandler); - } - } - - public static class GetCatalogs extends org.apache.thrift.AsyncProcessFunction { - public GetCatalogs() { - super("GetCatalogs"); - } - - public GetCatalogs_args getEmptyArgsInstance() { - return new GetCatalogs_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetCatalogsResp o) { - GetCatalogs_result result = new GetCatalogs_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetCatalogs_result result = new GetCatalogs_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetCatalogs_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetCatalogs(args.req,resultHandler); - } - } - - public static class GetSchemas extends org.apache.thrift.AsyncProcessFunction { - public GetSchemas() { - super("GetSchemas"); - } - - public GetSchemas_args getEmptyArgsInstance() { - return new GetSchemas_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetSchemasResp o) { - GetSchemas_result result = new GetSchemas_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetSchemas_result result = new GetSchemas_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetSchemas_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetSchemas(args.req,resultHandler); - } - } - - public static class GetTables extends org.apache.thrift.AsyncProcessFunction { - public GetTables() { - super("GetTables"); - } - - public GetTables_args getEmptyArgsInstance() { - return new GetTables_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetTablesResp o) { - GetTables_result result = new GetTables_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetTables_result result = new GetTables_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetTables_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetTables(args.req,resultHandler); - } - } - - public static class GetTableTypes extends org.apache.thrift.AsyncProcessFunction { - public GetTableTypes() { - super("GetTableTypes"); - } - - public GetTableTypes_args getEmptyArgsInstance() { - return new GetTableTypes_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetTableTypesResp o) { - GetTableTypes_result result = new GetTableTypes_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetTableTypes_result result = new GetTableTypes_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetTableTypes_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetTableTypes(args.req,resultHandler); - } - } - - public static class GetColumns extends org.apache.thrift.AsyncProcessFunction { - public GetColumns() { - super("GetColumns"); - } - - public GetColumns_args getEmptyArgsInstance() { - return new GetColumns_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetColumnsResp o) { - GetColumns_result result = new GetColumns_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetColumns_result result = new GetColumns_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetColumns_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetColumns(args.req,resultHandler); - } - } - - public static class GetFunctions extends org.apache.thrift.AsyncProcessFunction { - public GetFunctions() { - super("GetFunctions"); - } - - public GetFunctions_args getEmptyArgsInstance() { - return new GetFunctions_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetFunctionsResp o) { - GetFunctions_result result = new GetFunctions_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetFunctions_result result = new GetFunctions_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetFunctions_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetFunctions(args.req,resultHandler); - } - } - - public static class GetPrimaryKeys extends org.apache.thrift.AsyncProcessFunction { - public GetPrimaryKeys() { - super("GetPrimaryKeys"); - } - - public GetPrimaryKeys_args getEmptyArgsInstance() { - return new GetPrimaryKeys_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetPrimaryKeysResp o) { - GetPrimaryKeys_result result = new GetPrimaryKeys_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetPrimaryKeys_result result = new GetPrimaryKeys_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetPrimaryKeys_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetPrimaryKeys(args.req,resultHandler); - } - } - - public static class GetCrossReference extends org.apache.thrift.AsyncProcessFunction { - public GetCrossReference() { - super("GetCrossReference"); - } - - public GetCrossReference_args getEmptyArgsInstance() { - return new GetCrossReference_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetCrossReferenceResp o) { - GetCrossReference_result result = new GetCrossReference_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetCrossReference_result result = new GetCrossReference_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetCrossReference_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetCrossReference(args.req,resultHandler); - } - } - - public static class GetOperationStatus extends org.apache.thrift.AsyncProcessFunction { - public GetOperationStatus() { - super("GetOperationStatus"); - } - - public GetOperationStatus_args getEmptyArgsInstance() { - return new GetOperationStatus_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetOperationStatusResp o) { - GetOperationStatus_result result = new GetOperationStatus_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetOperationStatus_result result = new GetOperationStatus_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetOperationStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetOperationStatus(args.req,resultHandler); - } - } - - public static class CancelOperation extends org.apache.thrift.AsyncProcessFunction { - public CancelOperation() { - super("CancelOperation"); - } - - public CancelOperation_args getEmptyArgsInstance() { - return new CancelOperation_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TCancelOperationResp o) { - CancelOperation_result result = new CancelOperation_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - CancelOperation_result result = new CancelOperation_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, CancelOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.CancelOperation(args.req,resultHandler); - } - } - - public static class CloseOperation extends org.apache.thrift.AsyncProcessFunction { - public CloseOperation() { - super("CloseOperation"); - } - - public CloseOperation_args getEmptyArgsInstance() { - return new CloseOperation_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TCloseOperationResp o) { - CloseOperation_result result = new CloseOperation_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - CloseOperation_result result = new CloseOperation_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, CloseOperation_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.CloseOperation(args.req,resultHandler); - } - } - - public static class GetResultSetMetadata extends org.apache.thrift.AsyncProcessFunction { - public GetResultSetMetadata() { - super("GetResultSetMetadata"); - } - - public GetResultSetMetadata_args getEmptyArgsInstance() { - return new GetResultSetMetadata_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetResultSetMetadataResp o) { - GetResultSetMetadata_result result = new GetResultSetMetadata_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetResultSetMetadata_result result = new GetResultSetMetadata_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetResultSetMetadata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetResultSetMetadata(args.req,resultHandler); - } - } - - public static class FetchResults extends org.apache.thrift.AsyncProcessFunction { - public FetchResults() { - super("FetchResults"); - } - - public FetchResults_args getEmptyArgsInstance() { - return new FetchResults_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TFetchResultsResp o) { - FetchResults_result result = new FetchResults_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - FetchResults_result result = new FetchResults_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, FetchResults_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.FetchResults(args.req,resultHandler); - } - } - - public static class GetDelegationToken extends org.apache.thrift.AsyncProcessFunction { - public GetDelegationToken() { - super("GetDelegationToken"); - } - - public GetDelegationToken_args getEmptyArgsInstance() { - return new GetDelegationToken_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TGetDelegationTokenResp o) { - GetDelegationToken_result result = new GetDelegationToken_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - GetDelegationToken_result result = new GetDelegationToken_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, GetDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.GetDelegationToken(args.req,resultHandler); - } - } - - public static class CancelDelegationToken extends org.apache.thrift.AsyncProcessFunction { - public CancelDelegationToken() { - super("CancelDelegationToken"); - } - - public CancelDelegationToken_args getEmptyArgsInstance() { - return new CancelDelegationToken_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TCancelDelegationTokenResp o) { - CancelDelegationToken_result result = new CancelDelegationToken_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - CancelDelegationToken_result result = new CancelDelegationToken_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, CancelDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.CancelDelegationToken(args.req,resultHandler); - } - } - - public static class RenewDelegationToken extends org.apache.thrift.AsyncProcessFunction { - public RenewDelegationToken() { - super("RenewDelegationToken"); - } - - public RenewDelegationToken_args getEmptyArgsInstance() { - return new RenewDelegationToken_args(); - } - - public AsyncMethodCallback getResultHandler(final AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) { - final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback() { - public void onComplete(TRenewDelegationTokenResp o) { - RenewDelegationToken_result result = new RenewDelegationToken_result(); - result.success = o; - try { - fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); - return; - } catch (Exception e) { - LOGGER.error("Exception writing to internal frame buffer", e); - } - fb.close(); - } - public void onError(Exception e) { - byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; - org.apache.thrift.TBase msg; - RenewDelegationToken_result result = new RenewDelegationToken_result(); - { - msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; - msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); - } - try { - fcall.sendResponse(fb,msg,msgType,seqid); - return; - } catch (Exception ex) { - LOGGER.error("Exception writing to internal frame buffer", ex); - } - fb.close(); - } - }; - } - - protected boolean isOneway() { - return false; - } - - public void start(I iface, RenewDelegationToken_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { - iface.RenewDelegationToken(args.req,resultHandler); - } - } - - } - - public static class OpenSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OpenSession_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new OpenSession_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new OpenSession_argsTupleSchemeFactory()); - } - - private TOpenSessionReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOpenSessionReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_args.class, metaDataMap); - } - - public OpenSession_args() { - } - - public OpenSession_args( - TOpenSessionReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public OpenSession_args(OpenSession_args other) { - if (other.isSetReq()) { - this.req = new TOpenSessionReq(other.req); - } - } - - public OpenSession_args deepCopy() { - return new OpenSession_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TOpenSessionReq getReq() { - return this.req; - } - - public void setReq(TOpenSessionReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TOpenSessionReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof OpenSession_args) - return this.equals((OpenSession_args)that); - return false; - } - - public boolean equals(OpenSession_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(OpenSession_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("OpenSession_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class OpenSession_argsStandardSchemeFactory implements SchemeFactory { - public OpenSession_argsStandardScheme getScheme() { - return new OpenSession_argsStandardScheme(); - } - } - - private static class OpenSession_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TOpenSessionReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, OpenSession_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class OpenSession_argsTupleSchemeFactory implements SchemeFactory { - public OpenSession_argsTupleScheme getScheme() { - return new OpenSession_argsTupleScheme(); - } - } - - private static class OpenSession_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TOpenSessionReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class OpenSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OpenSession_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new OpenSession_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new OpenSession_resultTupleSchemeFactory()); - } - - private TOpenSessionResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOpenSessionResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(OpenSession_result.class, metaDataMap); - } - - public OpenSession_result() { - } - - public OpenSession_result( - TOpenSessionResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public OpenSession_result(OpenSession_result other) { - if (other.isSetSuccess()) { - this.success = new TOpenSessionResp(other.success); - } - } - - public OpenSession_result deepCopy() { - return new OpenSession_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TOpenSessionResp getSuccess() { - return this.success; - } - - public void setSuccess(TOpenSessionResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TOpenSessionResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof OpenSession_result) - return this.equals((OpenSession_result)that); - return false; - } - - public boolean equals(OpenSession_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(OpenSession_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("OpenSession_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class OpenSession_resultStandardSchemeFactory implements SchemeFactory { - public OpenSession_resultStandardScheme getScheme() { - return new OpenSession_resultStandardScheme(); - } - } - - private static class OpenSession_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, OpenSession_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TOpenSessionResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, OpenSession_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class OpenSession_resultTupleSchemeFactory implements SchemeFactory { - public OpenSession_resultTupleScheme getScheme() { - return new OpenSession_resultTupleScheme(); - } - } - - private static class OpenSession_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, OpenSession_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, OpenSession_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TOpenSessionResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class CloseSession_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CloseSession_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CloseSession_argsTupleSchemeFactory()); - } - - private TCloseSessionReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCloseSessionReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_args.class, metaDataMap); - } - - public CloseSession_args() { - } - - public CloseSession_args( - TCloseSessionReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public CloseSession_args(CloseSession_args other) { - if (other.isSetReq()) { - this.req = new TCloseSessionReq(other.req); - } - } - - public CloseSession_args deepCopy() { - return new CloseSession_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TCloseSessionReq getReq() { - return this.req; - } - - public void setReq(TCloseSessionReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TCloseSessionReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CloseSession_args) - return this.equals((CloseSession_args)that); - return false; - } - - public boolean equals(CloseSession_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(CloseSession_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CloseSession_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CloseSession_argsStandardSchemeFactory implements SchemeFactory { - public CloseSession_argsStandardScheme getScheme() { - return new CloseSession_argsStandardScheme(); - } - } - - private static class CloseSession_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TCloseSessionReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CloseSession_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CloseSession_argsTupleSchemeFactory implements SchemeFactory { - public CloseSession_argsTupleScheme getScheme() { - return new CloseSession_argsTupleScheme(); - } - } - - private static class CloseSession_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CloseSession_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TCloseSessionReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class CloseSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseSession_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CloseSession_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CloseSession_resultTupleSchemeFactory()); - } - - private TCloseSessionResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCloseSessionResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseSession_result.class, metaDataMap); - } - - public CloseSession_result() { - } - - public CloseSession_result( - TCloseSessionResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public CloseSession_result(CloseSession_result other) { - if (other.isSetSuccess()) { - this.success = new TCloseSessionResp(other.success); - } - } - - public CloseSession_result deepCopy() { - return new CloseSession_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TCloseSessionResp getSuccess() { - return this.success; - } - - public void setSuccess(TCloseSessionResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TCloseSessionResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CloseSession_result) - return this.equals((CloseSession_result)that); - return false; - } - - public boolean equals(CloseSession_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(CloseSession_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CloseSession_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CloseSession_resultStandardSchemeFactory implements SchemeFactory { - public CloseSession_resultStandardScheme getScheme() { - return new CloseSession_resultStandardScheme(); - } - } - - private static class CloseSession_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CloseSession_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TCloseSessionResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CloseSession_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CloseSession_resultTupleSchemeFactory implements SchemeFactory { - public CloseSession_resultTupleScheme getScheme() { - return new CloseSession_resultTupleScheme(); - } - } - - private static class CloseSession_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CloseSession_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CloseSession_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TCloseSessionResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfo_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetInfo_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetInfo_argsTupleSchemeFactory()); - } - - private TGetInfoReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetInfoReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_args.class, metaDataMap); - } - - public GetInfo_args() { - } - - public GetInfo_args( - TGetInfoReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetInfo_args(GetInfo_args other) { - if (other.isSetReq()) { - this.req = new TGetInfoReq(other.req); - } - } - - public GetInfo_args deepCopy() { - return new GetInfo_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetInfoReq getReq() { - return this.req; - } - - public void setReq(TGetInfoReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetInfoReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetInfo_args) - return this.equals((GetInfo_args)that); - return false; - } - - public boolean equals(GetInfo_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetInfo_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetInfo_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetInfo_argsStandardSchemeFactory implements SchemeFactory { - public GetInfo_argsStandardScheme getScheme() { - return new GetInfo_argsStandardScheme(); - } - } - - private static class GetInfo_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetInfoReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetInfo_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetInfo_argsTupleSchemeFactory implements SchemeFactory { - public GetInfo_argsTupleScheme getScheme() { - return new GetInfo_argsTupleScheme(); - } - } - - private static class GetInfo_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetInfoReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetInfo_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetInfo_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetInfo_resultTupleSchemeFactory()); - } - - private TGetInfoResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetInfoResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetInfo_result.class, metaDataMap); - } - - public GetInfo_result() { - } - - public GetInfo_result( - TGetInfoResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetInfo_result(GetInfo_result other) { - if (other.isSetSuccess()) { - this.success = new TGetInfoResp(other.success); - } - } - - public GetInfo_result deepCopy() { - return new GetInfo_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetInfoResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetInfoResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetInfoResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetInfo_result) - return this.equals((GetInfo_result)that); - return false; - } - - public boolean equals(GetInfo_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetInfo_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetInfo_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetInfo_resultStandardSchemeFactory implements SchemeFactory { - public GetInfo_resultStandardScheme getScheme() { - return new GetInfo_resultStandardScheme(); - } - } - - private static class GetInfo_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetInfoResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetInfo_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetInfo_resultTupleSchemeFactory implements SchemeFactory { - public GetInfo_resultTupleScheme getScheme() { - return new GetInfo_resultTupleScheme(); - } - } - - private static class GetInfo_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetInfoResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class ExecuteStatement_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteStatement_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ExecuteStatement_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ExecuteStatement_argsTupleSchemeFactory()); - } - - private TExecuteStatementReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TExecuteStatementReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_args.class, metaDataMap); - } - - public ExecuteStatement_args() { - } - - public ExecuteStatement_args( - TExecuteStatementReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public ExecuteStatement_args(ExecuteStatement_args other) { - if (other.isSetReq()) { - this.req = new TExecuteStatementReq(other.req); - } - } - - public ExecuteStatement_args deepCopy() { - return new ExecuteStatement_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TExecuteStatementReq getReq() { - return this.req; - } - - public void setReq(TExecuteStatementReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TExecuteStatementReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ExecuteStatement_args) - return this.equals((ExecuteStatement_args)that); - return false; - } - - public boolean equals(ExecuteStatement_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(ExecuteStatement_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("ExecuteStatement_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class ExecuteStatement_argsStandardSchemeFactory implements SchemeFactory { - public ExecuteStatement_argsStandardScheme getScheme() { - return new ExecuteStatement_argsStandardScheme(); - } - } - - private static class ExecuteStatement_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TExecuteStatementReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ExecuteStatement_argsTupleSchemeFactory implements SchemeFactory { - public ExecuteStatement_argsTupleScheme getScheme() { - return new ExecuteStatement_argsTupleScheme(); - } - } - - private static class ExecuteStatement_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TExecuteStatementReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class ExecuteStatement_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ExecuteStatement_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new ExecuteStatement_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new ExecuteStatement_resultTupleSchemeFactory()); - } - - private TExecuteStatementResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TExecuteStatementResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ExecuteStatement_result.class, metaDataMap); - } - - public ExecuteStatement_result() { - } - - public ExecuteStatement_result( - TExecuteStatementResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public ExecuteStatement_result(ExecuteStatement_result other) { - if (other.isSetSuccess()) { - this.success = new TExecuteStatementResp(other.success); - } - } - - public ExecuteStatement_result deepCopy() { - return new ExecuteStatement_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TExecuteStatementResp getSuccess() { - return this.success; - } - - public void setSuccess(TExecuteStatementResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TExecuteStatementResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof ExecuteStatement_result) - return this.equals((ExecuteStatement_result)that); - return false; - } - - public boolean equals(ExecuteStatement_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(ExecuteStatement_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("ExecuteStatement_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class ExecuteStatement_resultStandardSchemeFactory implements SchemeFactory { - public ExecuteStatement_resultStandardScheme getScheme() { - return new ExecuteStatement_resultStandardScheme(); - } - } - - private static class ExecuteStatement_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TExecuteStatementResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class ExecuteStatement_resultTupleSchemeFactory implements SchemeFactory { - public ExecuteStatement_resultTupleScheme getScheme() { - return new ExecuteStatement_resultTupleScheme(); - } - } - - private static class ExecuteStatement_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, ExecuteStatement_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TExecuteStatementResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetTypeInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetTypeInfo_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTypeInfo_argsTupleSchemeFactory()); - } - - private TGetTypeInfoReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetTypeInfoReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_args.class, metaDataMap); - } - - public GetTypeInfo_args() { - } - - public GetTypeInfo_args( - TGetTypeInfoReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetTypeInfo_args(GetTypeInfo_args other) { - if (other.isSetReq()) { - this.req = new TGetTypeInfoReq(other.req); - } - } - - public GetTypeInfo_args deepCopy() { - return new GetTypeInfo_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetTypeInfoReq getReq() { - return this.req; - } - - public void setReq(TGetTypeInfoReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetTypeInfoReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetTypeInfo_args) - return this.equals((GetTypeInfo_args)that); - return false; - } - - public boolean equals(GetTypeInfo_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetTypeInfo_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTypeInfo_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetTypeInfo_argsStandardSchemeFactory implements SchemeFactory { - public GetTypeInfo_argsStandardScheme getScheme() { - return new GetTypeInfo_argsStandardScheme(); - } - } - - private static class GetTypeInfo_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetTypeInfoReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetTypeInfo_argsTupleSchemeFactory implements SchemeFactory { - public GetTypeInfo_argsTupleScheme getScheme() { - return new GetTypeInfo_argsTupleScheme(); - } - } - - private static class GetTypeInfo_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetTypeInfoReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetTypeInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTypeInfo_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetTypeInfo_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTypeInfo_resultTupleSchemeFactory()); - } - - private TGetTypeInfoResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetTypeInfoResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTypeInfo_result.class, metaDataMap); - } - - public GetTypeInfo_result() { - } - - public GetTypeInfo_result( - TGetTypeInfoResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetTypeInfo_result(GetTypeInfo_result other) { - if (other.isSetSuccess()) { - this.success = new TGetTypeInfoResp(other.success); - } - } - - public GetTypeInfo_result deepCopy() { - return new GetTypeInfo_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetTypeInfoResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetTypeInfoResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetTypeInfoResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetTypeInfo_result) - return this.equals((GetTypeInfo_result)that); - return false; - } - - public boolean equals(GetTypeInfo_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetTypeInfo_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTypeInfo_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetTypeInfo_resultStandardSchemeFactory implements SchemeFactory { - public GetTypeInfo_resultStandardScheme getScheme() { - return new GetTypeInfo_resultStandardScheme(); - } - } - - private static class GetTypeInfo_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetTypeInfoResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetTypeInfo_resultTupleSchemeFactory implements SchemeFactory { - public GetTypeInfo_resultTupleScheme getScheme() { - return new GetTypeInfo_resultTupleScheme(); - } - } - - private static class GetTypeInfo_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetTypeInfo_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetTypeInfoResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetCatalogs_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCatalogs_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetCatalogs_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetCatalogs_argsTupleSchemeFactory()); - } - - private TGetCatalogsReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetCatalogsReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_args.class, metaDataMap); - } - - public GetCatalogs_args() { - } - - public GetCatalogs_args( - TGetCatalogsReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetCatalogs_args(GetCatalogs_args other) { - if (other.isSetReq()) { - this.req = new TGetCatalogsReq(other.req); - } - } - - public GetCatalogs_args deepCopy() { - return new GetCatalogs_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetCatalogsReq getReq() { - return this.req; - } - - public void setReq(TGetCatalogsReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetCatalogsReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetCatalogs_args) - return this.equals((GetCatalogs_args)that); - return false; - } - - public boolean equals(GetCatalogs_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetCatalogs_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetCatalogs_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetCatalogs_argsStandardSchemeFactory implements SchemeFactory { - public GetCatalogs_argsStandardScheme getScheme() { - return new GetCatalogs_argsStandardScheme(); - } - } - - private static class GetCatalogs_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetCatalogsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetCatalogs_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetCatalogs_argsTupleSchemeFactory implements SchemeFactory { - public GetCatalogs_argsTupleScheme getScheme() { - return new GetCatalogs_argsTupleScheme(); - } - } - - private static class GetCatalogs_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetCatalogsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetCatalogs_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCatalogs_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetCatalogs_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetCatalogs_resultTupleSchemeFactory()); - } - - private TGetCatalogsResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetCatalogsResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCatalogs_result.class, metaDataMap); - } - - public GetCatalogs_result() { - } - - public GetCatalogs_result( - TGetCatalogsResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetCatalogs_result(GetCatalogs_result other) { - if (other.isSetSuccess()) { - this.success = new TGetCatalogsResp(other.success); - } - } - - public GetCatalogs_result deepCopy() { - return new GetCatalogs_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetCatalogsResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetCatalogsResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetCatalogsResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetCatalogs_result) - return this.equals((GetCatalogs_result)that); - return false; - } - - public boolean equals(GetCatalogs_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetCatalogs_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetCatalogs_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetCatalogs_resultStandardSchemeFactory implements SchemeFactory { - public GetCatalogs_resultStandardScheme getScheme() { - return new GetCatalogs_resultStandardScheme(); - } - } - - private static class GetCatalogs_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetCatalogs_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetCatalogsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetCatalogs_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetCatalogs_resultTupleSchemeFactory implements SchemeFactory { - public GetCatalogs_resultTupleScheme getScheme() { - return new GetCatalogs_resultTupleScheme(); - } - } - - private static class GetCatalogs_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetCatalogs_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetCatalogsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetSchemas_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetSchemas_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetSchemas_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetSchemas_argsTupleSchemeFactory()); - } - - private TGetSchemasReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetSchemasReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_args.class, metaDataMap); - } - - public GetSchemas_args() { - } - - public GetSchemas_args( - TGetSchemasReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetSchemas_args(GetSchemas_args other) { - if (other.isSetReq()) { - this.req = new TGetSchemasReq(other.req); - } - } - - public GetSchemas_args deepCopy() { - return new GetSchemas_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetSchemasReq getReq() { - return this.req; - } - - public void setReq(TGetSchemasReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetSchemasReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetSchemas_args) - return this.equals((GetSchemas_args)that); - return false; - } - - public boolean equals(GetSchemas_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetSchemas_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetSchemas_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetSchemas_argsStandardSchemeFactory implements SchemeFactory { - public GetSchemas_argsStandardScheme getScheme() { - return new GetSchemas_argsStandardScheme(); - } - } - - private static class GetSchemas_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetSchemasReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetSchemas_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetSchemas_argsTupleSchemeFactory implements SchemeFactory { - public GetSchemas_argsTupleScheme getScheme() { - return new GetSchemas_argsTupleScheme(); - } - } - - private static class GetSchemas_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetSchemas_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetSchemasReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetSchemas_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetSchemas_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetSchemas_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetSchemas_resultTupleSchemeFactory()); - } - - private TGetSchemasResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetSchemasResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetSchemas_result.class, metaDataMap); - } - - public GetSchemas_result() { - } - - public GetSchemas_result( - TGetSchemasResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetSchemas_result(GetSchemas_result other) { - if (other.isSetSuccess()) { - this.success = new TGetSchemasResp(other.success); - } - } - - public GetSchemas_result deepCopy() { - return new GetSchemas_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetSchemasResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetSchemasResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetSchemasResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetSchemas_result) - return this.equals((GetSchemas_result)that); - return false; - } - - public boolean equals(GetSchemas_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetSchemas_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetSchemas_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetSchemas_resultStandardSchemeFactory implements SchemeFactory { - public GetSchemas_resultStandardScheme getScheme() { - return new GetSchemas_resultStandardScheme(); - } - } - - private static class GetSchemas_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetSchemas_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetSchemasResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetSchemas_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetSchemas_resultTupleSchemeFactory implements SchemeFactory { - public GetSchemas_resultTupleScheme getScheme() { - return new GetSchemas_resultTupleScheme(); - } - } - - private static class GetSchemas_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetSchemas_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetSchemasResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetTables_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTables_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetTables_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTables_argsTupleSchemeFactory()); - } - - private TGetTablesReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetTablesReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_args.class, metaDataMap); - } - - public GetTables_args() { - } - - public GetTables_args( - TGetTablesReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetTables_args(GetTables_args other) { - if (other.isSetReq()) { - this.req = new TGetTablesReq(other.req); - } - } - - public GetTables_args deepCopy() { - return new GetTables_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetTablesReq getReq() { - return this.req; - } - - public void setReq(TGetTablesReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetTablesReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetTables_args) - return this.equals((GetTables_args)that); - return false; - } - - public boolean equals(GetTables_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetTables_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTables_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetTables_argsStandardSchemeFactory implements SchemeFactory { - public GetTables_argsStandardScheme getScheme() { - return new GetTables_argsStandardScheme(); - } - } - - private static class GetTables_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetTablesReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetTables_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetTables_argsTupleSchemeFactory implements SchemeFactory { - public GetTables_argsTupleScheme getScheme() { - return new GetTables_argsTupleScheme(); - } - } - - private static class GetTables_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetTables_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetTablesReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetTables_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTables_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetTables_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTables_resultTupleSchemeFactory()); - } - - private TGetTablesResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetTablesResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTables_result.class, metaDataMap); - } - - public GetTables_result() { - } - - public GetTables_result( - TGetTablesResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetTables_result(GetTables_result other) { - if (other.isSetSuccess()) { - this.success = new TGetTablesResp(other.success); - } - } - - public GetTables_result deepCopy() { - return new GetTables_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetTablesResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetTablesResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetTablesResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetTables_result) - return this.equals((GetTables_result)that); - return false; - } - - public boolean equals(GetTables_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetTables_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTables_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetTables_resultStandardSchemeFactory implements SchemeFactory { - public GetTables_resultStandardScheme getScheme() { - return new GetTables_resultStandardScheme(); - } - } - - private static class GetTables_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTables_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetTablesResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetTables_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetTables_resultTupleSchemeFactory implements SchemeFactory { - public GetTables_resultTupleScheme getScheme() { - return new GetTables_resultTupleScheme(); - } - } - - private static class GetTables_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTables_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetTables_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetTablesResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetTableTypes_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTableTypes_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetTableTypes_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTableTypes_argsTupleSchemeFactory()); - } - - private TGetTableTypesReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetTableTypesReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_args.class, metaDataMap); - } - - public GetTableTypes_args() { - } - - public GetTableTypes_args( - TGetTableTypesReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetTableTypes_args(GetTableTypes_args other) { - if (other.isSetReq()) { - this.req = new TGetTableTypesReq(other.req); - } - } - - public GetTableTypes_args deepCopy() { - return new GetTableTypes_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetTableTypesReq getReq() { - return this.req; - } - - public void setReq(TGetTableTypesReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetTableTypesReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetTableTypes_args) - return this.equals((GetTableTypes_args)that); - return false; - } - - public boolean equals(GetTableTypes_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetTableTypes_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTableTypes_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetTableTypes_argsStandardSchemeFactory implements SchemeFactory { - public GetTableTypes_argsStandardScheme getScheme() { - return new GetTableTypes_argsStandardScheme(); - } - } - - private static class GetTableTypes_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetTableTypesReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetTableTypes_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetTableTypes_argsTupleSchemeFactory implements SchemeFactory { - public GetTableTypes_argsTupleScheme getScheme() { - return new GetTableTypes_argsTupleScheme(); - } - } - - private static class GetTableTypes_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetTableTypesReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetTableTypes_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetTableTypes_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetTableTypes_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetTableTypes_resultTupleSchemeFactory()); - } - - private TGetTableTypesResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetTableTypesResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetTableTypes_result.class, metaDataMap); - } - - public GetTableTypes_result() { - } - - public GetTableTypes_result( - TGetTableTypesResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetTableTypes_result(GetTableTypes_result other) { - if (other.isSetSuccess()) { - this.success = new TGetTableTypesResp(other.success); - } - } - - public GetTableTypes_result deepCopy() { - return new GetTableTypes_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetTableTypesResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetTableTypesResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetTableTypesResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetTableTypes_result) - return this.equals((GetTableTypes_result)that); - return false; - } - - public boolean equals(GetTableTypes_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetTableTypes_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetTableTypes_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetTableTypes_resultStandardSchemeFactory implements SchemeFactory { - public GetTableTypes_resultStandardScheme getScheme() { - return new GetTableTypes_resultStandardScheme(); - } - } - - private static class GetTableTypes_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetTableTypes_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetTableTypesResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetTableTypes_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetTableTypes_resultTupleSchemeFactory implements SchemeFactory { - public GetTableTypes_resultTupleScheme getScheme() { - return new GetTableTypes_resultTupleScheme(); - } - } - - private static class GetTableTypes_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetTableTypes_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetTableTypesResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetColumns_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetColumns_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetColumns_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetColumns_argsTupleSchemeFactory()); - } - - private TGetColumnsReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetColumnsReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_args.class, metaDataMap); - } - - public GetColumns_args() { - } - - public GetColumns_args( - TGetColumnsReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetColumns_args(GetColumns_args other) { - if (other.isSetReq()) { - this.req = new TGetColumnsReq(other.req); - } - } - - public GetColumns_args deepCopy() { - return new GetColumns_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetColumnsReq getReq() { - return this.req; - } - - public void setReq(TGetColumnsReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetColumnsReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetColumns_args) - return this.equals((GetColumns_args)that); - return false; - } - - public boolean equals(GetColumns_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetColumns_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetColumns_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetColumns_argsStandardSchemeFactory implements SchemeFactory { - public GetColumns_argsStandardScheme getScheme() { - return new GetColumns_argsStandardScheme(); - } - } - - private static class GetColumns_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetColumnsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetColumns_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetColumns_argsTupleSchemeFactory implements SchemeFactory { - public GetColumns_argsTupleScheme getScheme() { - return new GetColumns_argsTupleScheme(); - } - } - - private static class GetColumns_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetColumns_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetColumnsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetColumns_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetColumns_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetColumns_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetColumns_resultTupleSchemeFactory()); - } - - private TGetColumnsResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetColumnsResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetColumns_result.class, metaDataMap); - } - - public GetColumns_result() { - } - - public GetColumns_result( - TGetColumnsResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetColumns_result(GetColumns_result other) { - if (other.isSetSuccess()) { - this.success = new TGetColumnsResp(other.success); - } - } - - public GetColumns_result deepCopy() { - return new GetColumns_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetColumnsResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetColumnsResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetColumnsResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetColumns_result) - return this.equals((GetColumns_result)that); - return false; - } - - public boolean equals(GetColumns_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetColumns_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetColumns_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetColumns_resultStandardSchemeFactory implements SchemeFactory { - public GetColumns_resultStandardScheme getScheme() { - return new GetColumns_resultStandardScheme(); - } - } - - private static class GetColumns_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetColumns_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetColumnsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetColumns_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetColumns_resultTupleSchemeFactory implements SchemeFactory { - public GetColumns_resultTupleScheme getScheme() { - return new GetColumns_resultTupleScheme(); - } - } - - private static class GetColumns_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetColumns_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetColumns_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetColumnsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetFunctions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetFunctions_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetFunctions_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetFunctions_argsTupleSchemeFactory()); - } - - private TGetFunctionsReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetFunctionsReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_args.class, metaDataMap); - } - - public GetFunctions_args() { - } - - public GetFunctions_args( - TGetFunctionsReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetFunctions_args(GetFunctions_args other) { - if (other.isSetReq()) { - this.req = new TGetFunctionsReq(other.req); - } - } - - public GetFunctions_args deepCopy() { - return new GetFunctions_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetFunctionsReq getReq() { - return this.req; - } - - public void setReq(TGetFunctionsReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetFunctionsReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetFunctions_args) - return this.equals((GetFunctions_args)that); - return false; - } - - public boolean equals(GetFunctions_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetFunctions_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetFunctions_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetFunctions_argsStandardSchemeFactory implements SchemeFactory { - public GetFunctions_argsStandardScheme getScheme() { - return new GetFunctions_argsStandardScheme(); - } - } - - private static class GetFunctions_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetFunctionsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetFunctions_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetFunctions_argsTupleSchemeFactory implements SchemeFactory { - public GetFunctions_argsTupleScheme getScheme() { - return new GetFunctions_argsTupleScheme(); - } - } - - private static class GetFunctions_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetFunctions_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetFunctionsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetFunctions_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetFunctions_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetFunctions_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetFunctions_resultTupleSchemeFactory()); - } - - private TGetFunctionsResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetFunctionsResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetFunctions_result.class, metaDataMap); - } - - public GetFunctions_result() { - } - - public GetFunctions_result( - TGetFunctionsResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetFunctions_result(GetFunctions_result other) { - if (other.isSetSuccess()) { - this.success = new TGetFunctionsResp(other.success); - } - } - - public GetFunctions_result deepCopy() { - return new GetFunctions_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetFunctionsResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetFunctionsResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetFunctionsResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetFunctions_result) - return this.equals((GetFunctions_result)that); - return false; - } - - public boolean equals(GetFunctions_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetFunctions_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetFunctions_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetFunctions_resultStandardSchemeFactory implements SchemeFactory { - public GetFunctions_resultStandardScheme getScheme() { - return new GetFunctions_resultStandardScheme(); - } - } - - private static class GetFunctions_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetFunctions_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetFunctionsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetFunctions_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetFunctions_resultTupleSchemeFactory implements SchemeFactory { - public GetFunctions_resultTupleScheme getScheme() { - return new GetFunctions_resultTupleScheme(); - } - } - - private static class GetFunctions_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetFunctions_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetFunctionsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetPrimaryKeys_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetPrimaryKeys_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetPrimaryKeys_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetPrimaryKeys_argsTupleSchemeFactory()); - } - - private TGetPrimaryKeysReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetPrimaryKeysReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetPrimaryKeys_args.class, metaDataMap); - } - - public GetPrimaryKeys_args() { - } - - public GetPrimaryKeys_args( - TGetPrimaryKeysReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetPrimaryKeys_args(GetPrimaryKeys_args other) { - if (other.isSetReq()) { - this.req = new TGetPrimaryKeysReq(other.req); - } - } - - public GetPrimaryKeys_args deepCopy() { - return new GetPrimaryKeys_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetPrimaryKeysReq getReq() { - return this.req; - } - - public void setReq(TGetPrimaryKeysReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetPrimaryKeysReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetPrimaryKeys_args) - return this.equals((GetPrimaryKeys_args)that); - return false; - } - - public boolean equals(GetPrimaryKeys_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetPrimaryKeys_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetPrimaryKeys_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetPrimaryKeys_argsStandardSchemeFactory implements SchemeFactory { - public GetPrimaryKeys_argsStandardScheme getScheme() { - return new GetPrimaryKeys_argsStandardScheme(); - } - } - - private static class GetPrimaryKeys_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetPrimaryKeysReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetPrimaryKeys_argsTupleSchemeFactory implements SchemeFactory { - public GetPrimaryKeys_argsTupleScheme getScheme() { - return new GetPrimaryKeys_argsTupleScheme(); - } - } - - private static class GetPrimaryKeys_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetPrimaryKeysReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetPrimaryKeys_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetPrimaryKeys_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetPrimaryKeys_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetPrimaryKeys_resultTupleSchemeFactory()); - } - - private TGetPrimaryKeysResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetPrimaryKeysResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetPrimaryKeys_result.class, metaDataMap); - } - - public GetPrimaryKeys_result() { - } - - public GetPrimaryKeys_result( - TGetPrimaryKeysResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetPrimaryKeys_result(GetPrimaryKeys_result other) { - if (other.isSetSuccess()) { - this.success = new TGetPrimaryKeysResp(other.success); - } - } - - public GetPrimaryKeys_result deepCopy() { - return new GetPrimaryKeys_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetPrimaryKeysResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetPrimaryKeysResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetPrimaryKeysResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetPrimaryKeys_result) - return this.equals((GetPrimaryKeys_result)that); - return false; - } - - public boolean equals(GetPrimaryKeys_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetPrimaryKeys_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetPrimaryKeys_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetPrimaryKeys_resultStandardSchemeFactory implements SchemeFactory { - public GetPrimaryKeys_resultStandardScheme getScheme() { - return new GetPrimaryKeys_resultStandardScheme(); - } - } - - private static class GetPrimaryKeys_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetPrimaryKeysResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetPrimaryKeys_resultTupleSchemeFactory implements SchemeFactory { - public GetPrimaryKeys_resultTupleScheme getScheme() { - return new GetPrimaryKeys_resultTupleScheme(); - } - } - - private static class GetPrimaryKeys_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetPrimaryKeys_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetPrimaryKeysResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetCrossReference_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCrossReference_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetCrossReference_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetCrossReference_argsTupleSchemeFactory()); - } - - private TGetCrossReferenceReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetCrossReferenceReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCrossReference_args.class, metaDataMap); - } - - public GetCrossReference_args() { - } - - public GetCrossReference_args( - TGetCrossReferenceReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetCrossReference_args(GetCrossReference_args other) { - if (other.isSetReq()) { - this.req = new TGetCrossReferenceReq(other.req); - } - } - - public GetCrossReference_args deepCopy() { - return new GetCrossReference_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetCrossReferenceReq getReq() { - return this.req; - } - - public void setReq(TGetCrossReferenceReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetCrossReferenceReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetCrossReference_args) - return this.equals((GetCrossReference_args)that); - return false; - } - - public boolean equals(GetCrossReference_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetCrossReference_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetCrossReference_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetCrossReference_argsStandardSchemeFactory implements SchemeFactory { - public GetCrossReference_argsStandardScheme getScheme() { - return new GetCrossReference_argsStandardScheme(); - } - } - - private static class GetCrossReference_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetCrossReference_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetCrossReferenceReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetCrossReference_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetCrossReference_argsTupleSchemeFactory implements SchemeFactory { - public GetCrossReference_argsTupleScheme getScheme() { - return new GetCrossReference_argsTupleScheme(); - } - } - - private static class GetCrossReference_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetCrossReferenceReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetCrossReference_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetCrossReference_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetCrossReference_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetCrossReference_resultTupleSchemeFactory()); - } - - private TGetCrossReferenceResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetCrossReferenceResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetCrossReference_result.class, metaDataMap); - } - - public GetCrossReference_result() { - } - - public GetCrossReference_result( - TGetCrossReferenceResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetCrossReference_result(GetCrossReference_result other) { - if (other.isSetSuccess()) { - this.success = new TGetCrossReferenceResp(other.success); - } - } - - public GetCrossReference_result deepCopy() { - return new GetCrossReference_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetCrossReferenceResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetCrossReferenceResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetCrossReferenceResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetCrossReference_result) - return this.equals((GetCrossReference_result)that); - return false; - } - - public boolean equals(GetCrossReference_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetCrossReference_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetCrossReference_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetCrossReference_resultStandardSchemeFactory implements SchemeFactory { - public GetCrossReference_resultStandardScheme getScheme() { - return new GetCrossReference_resultStandardScheme(); - } - } - - private static class GetCrossReference_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetCrossReference_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetCrossReferenceResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetCrossReference_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetCrossReference_resultTupleSchemeFactory implements SchemeFactory { - public GetCrossReference_resultTupleScheme getScheme() { - return new GetCrossReference_resultTupleScheme(); - } - } - - private static class GetCrossReference_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetCrossReference_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetCrossReferenceResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetOperationStatus_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetOperationStatus_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetOperationStatus_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetOperationStatus_argsTupleSchemeFactory()); - } - - private TGetOperationStatusReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetOperationStatusReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_args.class, metaDataMap); - } - - public GetOperationStatus_args() { - } - - public GetOperationStatus_args( - TGetOperationStatusReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetOperationStatus_args(GetOperationStatus_args other) { - if (other.isSetReq()) { - this.req = new TGetOperationStatusReq(other.req); - } - } - - public GetOperationStatus_args deepCopy() { - return new GetOperationStatus_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetOperationStatusReq getReq() { - return this.req; - } - - public void setReq(TGetOperationStatusReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetOperationStatusReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetOperationStatus_args) - return this.equals((GetOperationStatus_args)that); - return false; - } - - public boolean equals(GetOperationStatus_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetOperationStatus_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetOperationStatus_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetOperationStatus_argsStandardSchemeFactory implements SchemeFactory { - public GetOperationStatus_argsStandardScheme getScheme() { - return new GetOperationStatus_argsStandardScheme(); - } - } - - private static class GetOperationStatus_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetOperationStatusReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetOperationStatus_argsTupleSchemeFactory implements SchemeFactory { - public GetOperationStatus_argsTupleScheme getScheme() { - return new GetOperationStatus_argsTupleScheme(); - } - } - - private static class GetOperationStatus_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetOperationStatusReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetOperationStatus_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetOperationStatus_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetOperationStatus_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetOperationStatus_resultTupleSchemeFactory()); - } - - private TGetOperationStatusResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetOperationStatusResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetOperationStatus_result.class, metaDataMap); - } - - public GetOperationStatus_result() { - } - - public GetOperationStatus_result( - TGetOperationStatusResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetOperationStatus_result(GetOperationStatus_result other) { - if (other.isSetSuccess()) { - this.success = new TGetOperationStatusResp(other.success); - } - } - - public GetOperationStatus_result deepCopy() { - return new GetOperationStatus_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetOperationStatusResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetOperationStatusResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetOperationStatusResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetOperationStatus_result) - return this.equals((GetOperationStatus_result)that); - return false; - } - - public boolean equals(GetOperationStatus_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetOperationStatus_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetOperationStatus_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetOperationStatus_resultStandardSchemeFactory implements SchemeFactory { - public GetOperationStatus_resultStandardScheme getScheme() { - return new GetOperationStatus_resultStandardScheme(); - } - } - - private static class GetOperationStatus_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetOperationStatusResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetOperationStatus_resultTupleSchemeFactory implements SchemeFactory { - public GetOperationStatus_resultTupleScheme getScheme() { - return new GetOperationStatus_resultTupleScheme(); - } - } - - private static class GetOperationStatus_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetOperationStatus_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetOperationStatusResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class CancelOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelOperation_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CancelOperation_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CancelOperation_argsTupleSchemeFactory()); - } - - private TCancelOperationReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCancelOperationReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_args.class, metaDataMap); - } - - public CancelOperation_args() { - } - - public CancelOperation_args( - TCancelOperationReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public CancelOperation_args(CancelOperation_args other) { - if (other.isSetReq()) { - this.req = new TCancelOperationReq(other.req); - } - } - - public CancelOperation_args deepCopy() { - return new CancelOperation_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TCancelOperationReq getReq() { - return this.req; - } - - public void setReq(TCancelOperationReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TCancelOperationReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CancelOperation_args) - return this.equals((CancelOperation_args)that); - return false; - } - - public boolean equals(CancelOperation_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(CancelOperation_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CancelOperation_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CancelOperation_argsStandardSchemeFactory implements SchemeFactory { - public CancelOperation_argsStandardScheme getScheme() { - return new CancelOperation_argsStandardScheme(); - } - } - - private static class CancelOperation_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TCancelOperationReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CancelOperation_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CancelOperation_argsTupleSchemeFactory implements SchemeFactory { - public CancelOperation_argsTupleScheme getScheme() { - return new CancelOperation_argsTupleScheme(); - } - } - - private static class CancelOperation_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TCancelOperationReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class CancelOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelOperation_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CancelOperation_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CancelOperation_resultTupleSchemeFactory()); - } - - private TCancelOperationResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCancelOperationResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelOperation_result.class, metaDataMap); - } - - public CancelOperation_result() { - } - - public CancelOperation_result( - TCancelOperationResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public CancelOperation_result(CancelOperation_result other) { - if (other.isSetSuccess()) { - this.success = new TCancelOperationResp(other.success); - } - } - - public CancelOperation_result deepCopy() { - return new CancelOperation_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TCancelOperationResp getSuccess() { - return this.success; - } - - public void setSuccess(TCancelOperationResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TCancelOperationResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CancelOperation_result) - return this.equals((CancelOperation_result)that); - return false; - } - - public boolean equals(CancelOperation_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(CancelOperation_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CancelOperation_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CancelOperation_resultStandardSchemeFactory implements SchemeFactory { - public CancelOperation_resultStandardScheme getScheme() { - return new CancelOperation_resultStandardScheme(); - } - } - - private static class CancelOperation_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CancelOperation_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TCancelOperationResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CancelOperation_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CancelOperation_resultTupleSchemeFactory implements SchemeFactory { - public CancelOperation_resultTupleScheme getScheme() { - return new CancelOperation_resultTupleScheme(); - } - } - - private static class CancelOperation_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CancelOperation_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CancelOperation_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TCancelOperationResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class CloseOperation_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseOperation_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CloseOperation_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CloseOperation_argsTupleSchemeFactory()); - } - - private TCloseOperationReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCloseOperationReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_args.class, metaDataMap); - } - - public CloseOperation_args() { - } - - public CloseOperation_args( - TCloseOperationReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public CloseOperation_args(CloseOperation_args other) { - if (other.isSetReq()) { - this.req = new TCloseOperationReq(other.req); - } - } - - public CloseOperation_args deepCopy() { - return new CloseOperation_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TCloseOperationReq getReq() { - return this.req; - } - - public void setReq(TCloseOperationReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TCloseOperationReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CloseOperation_args) - return this.equals((CloseOperation_args)that); - return false; - } - - public boolean equals(CloseOperation_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(CloseOperation_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CloseOperation_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CloseOperation_argsStandardSchemeFactory implements SchemeFactory { - public CloseOperation_argsStandardScheme getScheme() { - return new CloseOperation_argsStandardScheme(); - } - } - - private static class CloseOperation_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TCloseOperationReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CloseOperation_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CloseOperation_argsTupleSchemeFactory implements SchemeFactory { - public CloseOperation_argsTupleScheme getScheme() { - return new CloseOperation_argsTupleScheme(); - } - } - - private static class CloseOperation_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CloseOperation_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TCloseOperationReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class CloseOperation_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CloseOperation_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CloseOperation_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CloseOperation_resultTupleSchemeFactory()); - } - - private TCloseOperationResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCloseOperationResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CloseOperation_result.class, metaDataMap); - } - - public CloseOperation_result() { - } - - public CloseOperation_result( - TCloseOperationResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public CloseOperation_result(CloseOperation_result other) { - if (other.isSetSuccess()) { - this.success = new TCloseOperationResp(other.success); - } - } - - public CloseOperation_result deepCopy() { - return new CloseOperation_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TCloseOperationResp getSuccess() { - return this.success; - } - - public void setSuccess(TCloseOperationResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TCloseOperationResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CloseOperation_result) - return this.equals((CloseOperation_result)that); - return false; - } - - public boolean equals(CloseOperation_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(CloseOperation_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CloseOperation_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CloseOperation_resultStandardSchemeFactory implements SchemeFactory { - public CloseOperation_resultStandardScheme getScheme() { - return new CloseOperation_resultStandardScheme(); - } - } - - private static class CloseOperation_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CloseOperation_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TCloseOperationResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CloseOperation_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CloseOperation_resultTupleSchemeFactory implements SchemeFactory { - public CloseOperation_resultTupleScheme getScheme() { - return new CloseOperation_resultTupleScheme(); - } - } - - private static class CloseOperation_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CloseOperation_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CloseOperation_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TCloseOperationResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetResultSetMetadata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetResultSetMetadata_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetResultSetMetadata_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetResultSetMetadata_argsTupleSchemeFactory()); - } - - private TGetResultSetMetadataReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetResultSetMetadataReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_args.class, metaDataMap); - } - - public GetResultSetMetadata_args() { - } - - public GetResultSetMetadata_args( - TGetResultSetMetadataReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetResultSetMetadata_args(GetResultSetMetadata_args other) { - if (other.isSetReq()) { - this.req = new TGetResultSetMetadataReq(other.req); - } - } - - public GetResultSetMetadata_args deepCopy() { - return new GetResultSetMetadata_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetResultSetMetadataReq getReq() { - return this.req; - } - - public void setReq(TGetResultSetMetadataReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetResultSetMetadataReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetResultSetMetadata_args) - return this.equals((GetResultSetMetadata_args)that); - return false; - } - - public boolean equals(GetResultSetMetadata_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetResultSetMetadata_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetResultSetMetadata_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetResultSetMetadata_argsStandardSchemeFactory implements SchemeFactory { - public GetResultSetMetadata_argsStandardScheme getScheme() { - return new GetResultSetMetadata_argsStandardScheme(); - } - } - - private static class GetResultSetMetadata_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetResultSetMetadataReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetResultSetMetadata_argsTupleSchemeFactory implements SchemeFactory { - public GetResultSetMetadata_argsTupleScheme getScheme() { - return new GetResultSetMetadata_argsTupleScheme(); - } - } - - private static class GetResultSetMetadata_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetResultSetMetadataReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetResultSetMetadata_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetResultSetMetadata_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetResultSetMetadata_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetResultSetMetadata_resultTupleSchemeFactory()); - } - - private TGetResultSetMetadataResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetResultSetMetadataResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetResultSetMetadata_result.class, metaDataMap); - } - - public GetResultSetMetadata_result() { - } - - public GetResultSetMetadata_result( - TGetResultSetMetadataResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetResultSetMetadata_result(GetResultSetMetadata_result other) { - if (other.isSetSuccess()) { - this.success = new TGetResultSetMetadataResp(other.success); - } - } - - public GetResultSetMetadata_result deepCopy() { - return new GetResultSetMetadata_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetResultSetMetadataResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetResultSetMetadataResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetResultSetMetadataResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetResultSetMetadata_result) - return this.equals((GetResultSetMetadata_result)that); - return false; - } - - public boolean equals(GetResultSetMetadata_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetResultSetMetadata_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetResultSetMetadata_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetResultSetMetadata_resultStandardSchemeFactory implements SchemeFactory { - public GetResultSetMetadata_resultStandardScheme getScheme() { - return new GetResultSetMetadata_resultStandardScheme(); - } - } - - private static class GetResultSetMetadata_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetResultSetMetadataResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetResultSetMetadata_resultTupleSchemeFactory implements SchemeFactory { - public GetResultSetMetadata_resultTupleScheme getScheme() { - return new GetResultSetMetadata_resultTupleScheme(); - } - } - - private static class GetResultSetMetadata_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetResultSetMetadata_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetResultSetMetadataResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class FetchResults_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FetchResults_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new FetchResults_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new FetchResults_argsTupleSchemeFactory()); - } - - private TFetchResultsReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFetchResultsReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_args.class, metaDataMap); - } - - public FetchResults_args() { - } - - public FetchResults_args( - TFetchResultsReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public FetchResults_args(FetchResults_args other) { - if (other.isSetReq()) { - this.req = new TFetchResultsReq(other.req); - } - } - - public FetchResults_args deepCopy() { - return new FetchResults_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TFetchResultsReq getReq() { - return this.req; - } - - public void setReq(TFetchResultsReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TFetchResultsReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof FetchResults_args) - return this.equals((FetchResults_args)that); - return false; - } - - public boolean equals(FetchResults_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(FetchResults_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("FetchResults_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class FetchResults_argsStandardSchemeFactory implements SchemeFactory { - public FetchResults_argsStandardScheme getScheme() { - return new FetchResults_argsStandardScheme(); - } - } - - private static class FetchResults_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TFetchResultsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, FetchResults_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class FetchResults_argsTupleSchemeFactory implements SchemeFactory { - public FetchResults_argsTupleScheme getScheme() { - return new FetchResults_argsTupleScheme(); - } - } - - private static class FetchResults_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TFetchResultsReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class FetchResults_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FetchResults_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new FetchResults_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new FetchResults_resultTupleSchemeFactory()); - } - - private TFetchResultsResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TFetchResultsResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(FetchResults_result.class, metaDataMap); - } - - public FetchResults_result() { - } - - public FetchResults_result( - TFetchResultsResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public FetchResults_result(FetchResults_result other) { - if (other.isSetSuccess()) { - this.success = new TFetchResultsResp(other.success); - } - } - - public FetchResults_result deepCopy() { - return new FetchResults_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TFetchResultsResp getSuccess() { - return this.success; - } - - public void setSuccess(TFetchResultsResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TFetchResultsResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof FetchResults_result) - return this.equals((FetchResults_result)that); - return false; - } - - public boolean equals(FetchResults_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(FetchResults_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("FetchResults_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class FetchResults_resultStandardSchemeFactory implements SchemeFactory { - public FetchResults_resultStandardScheme getScheme() { - return new FetchResults_resultStandardScheme(); - } - } - - private static class FetchResults_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, FetchResults_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TFetchResultsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, FetchResults_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class FetchResults_resultTupleSchemeFactory implements SchemeFactory { - public FetchResults_resultTupleScheme getScheme() { - return new FetchResults_resultTupleScheme(); - } - } - - private static class FetchResults_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, FetchResults_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, FetchResults_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TFetchResultsResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class GetDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetDelegationToken_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetDelegationToken_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetDelegationToken_argsTupleSchemeFactory()); - } - - private TGetDelegationTokenReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetDelegationTokenReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_args.class, metaDataMap); - } - - public GetDelegationToken_args() { - } - - public GetDelegationToken_args( - TGetDelegationTokenReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public GetDelegationToken_args(GetDelegationToken_args other) { - if (other.isSetReq()) { - this.req = new TGetDelegationTokenReq(other.req); - } - } - - public GetDelegationToken_args deepCopy() { - return new GetDelegationToken_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TGetDelegationTokenReq getReq() { - return this.req; - } - - public void setReq(TGetDelegationTokenReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TGetDelegationTokenReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetDelegationToken_args) - return this.equals((GetDelegationToken_args)that); - return false; - } - - public boolean equals(GetDelegationToken_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(GetDelegationToken_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetDelegationToken_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetDelegationToken_argsStandardSchemeFactory implements SchemeFactory { - public GetDelegationToken_argsStandardScheme getScheme() { - return new GetDelegationToken_argsStandardScheme(); - } - } - - private static class GetDelegationToken_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TGetDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetDelegationToken_argsTupleSchemeFactory implements SchemeFactory { - public GetDelegationToken_argsTupleScheme getScheme() { - return new GetDelegationToken_argsTupleScheme(); - } - } - - private static class GetDelegationToken_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TGetDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class GetDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetDelegationToken_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new GetDelegationToken_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new GetDelegationToken_resultTupleSchemeFactory()); - } - - private TGetDelegationTokenResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetDelegationTokenResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetDelegationToken_result.class, metaDataMap); - } - - public GetDelegationToken_result() { - } - - public GetDelegationToken_result( - TGetDelegationTokenResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public GetDelegationToken_result(GetDelegationToken_result other) { - if (other.isSetSuccess()) { - this.success = new TGetDelegationTokenResp(other.success); - } - } - - public GetDelegationToken_result deepCopy() { - return new GetDelegationToken_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TGetDelegationTokenResp getSuccess() { - return this.success; - } - - public void setSuccess(TGetDelegationTokenResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TGetDelegationTokenResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof GetDelegationToken_result) - return this.equals((GetDelegationToken_result)that); - return false; - } - - public boolean equals(GetDelegationToken_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(GetDelegationToken_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("GetDelegationToken_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class GetDelegationToken_resultStandardSchemeFactory implements SchemeFactory { - public GetDelegationToken_resultStandardScheme getScheme() { - return new GetDelegationToken_resultStandardScheme(); - } - } - - private static class GetDelegationToken_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TGetDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class GetDelegationToken_resultTupleSchemeFactory implements SchemeFactory { - public GetDelegationToken_resultTupleScheme getScheme() { - return new GetDelegationToken_resultTupleScheme(); - } - } - - private static class GetDelegationToken_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, GetDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TGetDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class CancelDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelDelegationToken_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CancelDelegationToken_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CancelDelegationToken_argsTupleSchemeFactory()); - } - - private TCancelDelegationTokenReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCancelDelegationTokenReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_args.class, metaDataMap); - } - - public CancelDelegationToken_args() { - } - - public CancelDelegationToken_args( - TCancelDelegationTokenReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public CancelDelegationToken_args(CancelDelegationToken_args other) { - if (other.isSetReq()) { - this.req = new TCancelDelegationTokenReq(other.req); - } - } - - public CancelDelegationToken_args deepCopy() { - return new CancelDelegationToken_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TCancelDelegationTokenReq getReq() { - return this.req; - } - - public void setReq(TCancelDelegationTokenReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TCancelDelegationTokenReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CancelDelegationToken_args) - return this.equals((CancelDelegationToken_args)that); - return false; - } - - public boolean equals(CancelDelegationToken_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(CancelDelegationToken_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CancelDelegationToken_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CancelDelegationToken_argsStandardSchemeFactory implements SchemeFactory { - public CancelDelegationToken_argsStandardScheme getScheme() { - return new CancelDelegationToken_argsStandardScheme(); - } - } - - private static class CancelDelegationToken_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TCancelDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CancelDelegationToken_argsTupleSchemeFactory implements SchemeFactory { - public CancelDelegationToken_argsTupleScheme getScheme() { - return new CancelDelegationToken_argsTupleScheme(); - } - } - - private static class CancelDelegationToken_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TCancelDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class CancelDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CancelDelegationToken_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new CancelDelegationToken_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new CancelDelegationToken_resultTupleSchemeFactory()); - } - - private TCancelDelegationTokenResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TCancelDelegationTokenResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CancelDelegationToken_result.class, metaDataMap); - } - - public CancelDelegationToken_result() { - } - - public CancelDelegationToken_result( - TCancelDelegationTokenResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public CancelDelegationToken_result(CancelDelegationToken_result other) { - if (other.isSetSuccess()) { - this.success = new TCancelDelegationTokenResp(other.success); - } - } - - public CancelDelegationToken_result deepCopy() { - return new CancelDelegationToken_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TCancelDelegationTokenResp getSuccess() { - return this.success; - } - - public void setSuccess(TCancelDelegationTokenResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TCancelDelegationTokenResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof CancelDelegationToken_result) - return this.equals((CancelDelegationToken_result)that); - return false; - } - - public boolean equals(CancelDelegationToken_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(CancelDelegationToken_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("CancelDelegationToken_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class CancelDelegationToken_resultStandardSchemeFactory implements SchemeFactory { - public CancelDelegationToken_resultStandardScheme getScheme() { - return new CancelDelegationToken_resultStandardScheme(); - } - } - - private static class CancelDelegationToken_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TCancelDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class CancelDelegationToken_resultTupleSchemeFactory implements SchemeFactory { - public CancelDelegationToken_resultTupleScheme getScheme() { - return new CancelDelegationToken_resultTupleScheme(); - } - } - - private static class CancelDelegationToken_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, CancelDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TCancelDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - - public static class RenewDelegationToken_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RenewDelegationToken_args"); - - private static final org.apache.thrift.protocol.TField REQ_FIELD_DESC = new org.apache.thrift.protocol.TField("req", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new RenewDelegationToken_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new RenewDelegationToken_argsTupleSchemeFactory()); - } - - private TRenewDelegationTokenReq req; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - REQ((short)1, "req"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // REQ - return REQ; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.REQ, new org.apache.thrift.meta_data.FieldMetaData("req", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRenewDelegationTokenReq.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_args.class, metaDataMap); - } - - public RenewDelegationToken_args() { - } - - public RenewDelegationToken_args( - TRenewDelegationTokenReq req) - { - this(); - this.req = req; - } - - /** - * Performs a deep copy on other. - */ - public RenewDelegationToken_args(RenewDelegationToken_args other) { - if (other.isSetReq()) { - this.req = new TRenewDelegationTokenReq(other.req); - } - } - - public RenewDelegationToken_args deepCopy() { - return new RenewDelegationToken_args(this); - } - - @Override - public void clear() { - this.req = null; - } - - public TRenewDelegationTokenReq getReq() { - return this.req; - } - - public void setReq(TRenewDelegationTokenReq req) { - this.req = req; - } - - public void unsetReq() { - this.req = null; - } - - /** Returns true if field req is set (has been assigned a value) and false otherwise */ - public boolean isSetReq() { - return this.req != null; - } - - public void setReqIsSet(boolean value) { - if (!value) { - this.req = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case REQ: - if (value == null) { - unsetReq(); - } else { - setReq((TRenewDelegationTokenReq)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case REQ: - return getReq(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case REQ: - return isSetReq(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof RenewDelegationToken_args) - return this.equals((RenewDelegationToken_args)that); - return false; - } - - public boolean equals(RenewDelegationToken_args that) { - if (that == null) - return false; - - boolean this_present_req = true && this.isSetReq(); - boolean that_present_req = true && that.isSetReq(); - if (this_present_req || that_present_req) { - if (!(this_present_req && that_present_req)) - return false; - if (!this.req.equals(that.req)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_req = true && (isSetReq()); - list.add(present_req); - if (present_req) - list.add(req); - - return list.hashCode(); - } - - @Override - public int compareTo(RenewDelegationToken_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetReq()).compareTo(other.isSetReq()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetReq()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.req, other.req); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("RenewDelegationToken_args("); - boolean first = true; - - sb.append("req:"); - if (this.req == null) { - sb.append("null"); - } else { - sb.append(this.req); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (req != null) { - req.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class RenewDelegationToken_argsStandardSchemeFactory implements SchemeFactory { - public RenewDelegationToken_argsStandardScheme getScheme() { - return new RenewDelegationToken_argsStandardScheme(); - } - } - - private static class RenewDelegationToken_argsStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // REQ - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.req = new TRenewDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.req != null) { - oprot.writeFieldBegin(REQ_FIELD_DESC); - struct.req.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class RenewDelegationToken_argsTupleSchemeFactory implements SchemeFactory { - public RenewDelegationToken_argsTupleScheme getScheme() { - return new RenewDelegationToken_argsTupleScheme(); - } - } - - private static class RenewDelegationToken_argsTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetReq()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetReq()) { - struct.req.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.req = new TRenewDelegationTokenReq(); - struct.req.read(iprot); - struct.setReqIsSet(true); - } - } - } - - } - - public static class RenewDelegationToken_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("RenewDelegationToken_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new RenewDelegationToken_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new RenewDelegationToken_resultTupleSchemeFactory()); - } - - private TRenewDelegationTokenResp success; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRenewDelegationTokenResp.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RenewDelegationToken_result.class, metaDataMap); - } - - public RenewDelegationToken_result() { - } - - public RenewDelegationToken_result( - TRenewDelegationTokenResp success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on other. - */ - public RenewDelegationToken_result(RenewDelegationToken_result other) { - if (other.isSetSuccess()) { - this.success = new TRenewDelegationTokenResp(other.success); - } - } - - public RenewDelegationToken_result deepCopy() { - return new RenewDelegationToken_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public TRenewDelegationTokenResp getSuccess() { - return this.success; - } - - public void setSuccess(TRenewDelegationTokenResp success) { - this.success = success; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((TRenewDelegationTokenResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof RenewDelegationToken_result) - return this.equals((RenewDelegationToken_result)that); - return false; - } - - public boolean equals(RenewDelegationToken_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_success = true && (isSetSuccess()); - list.add(present_success); - if (present_success) - list.add(success); - - return list.hashCode(); - } - - @Override - public int compareTo(RenewDelegationToken_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("RenewDelegationToken_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - if (success != null) { - success.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class RenewDelegationToken_resultStandardSchemeFactory implements SchemeFactory { - public RenewDelegationToken_resultStandardScheme getScheme() { - return new RenewDelegationToken_resultStandardScheme(); - } - } - - private static class RenewDelegationToken_resultStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.success = new TRenewDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - struct.success.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class RenewDelegationToken_resultTupleSchemeFactory implements SchemeFactory { - public RenewDelegationToken_resultTupleScheme getScheme() { - return new RenewDelegationToken_resultTupleScheme(); - } - } - - private static class RenewDelegationToken_resultTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - struct.success.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, RenewDelegationToken_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.success = new TRenewDelegationTokenResp(); - struct.success.read(iprot); - struct.setSuccessIsSet(true); - } - } - } - - } - -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCLIServiceConstants.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCLIServiceConstants.java deleted file mode 100644 index 930bed731ed2a..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCLIServiceConstants.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -public class TCLIServiceConstants { - - public static final Set PRIMITIVE_TYPES = new HashSet(); - static { - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.BOOLEAN_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.TINYINT_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.SMALLINT_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.INT_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.BIGINT_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.FLOAT_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.DOUBLE_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.STRING_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.TIMESTAMP_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.BINARY_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.DECIMAL_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.NULL_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.DATE_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.VARCHAR_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.CHAR_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.INTERVAL_YEAR_MONTH_TYPE); - PRIMITIVE_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.INTERVAL_DAY_TIME_TYPE); - } - - public static final Set COMPLEX_TYPES = new HashSet(); - static { - COMPLEX_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.ARRAY_TYPE); - COMPLEX_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.MAP_TYPE); - COMPLEX_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.STRUCT_TYPE); - COMPLEX_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.UNION_TYPE); - COMPLEX_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.USER_DEFINED_TYPE); - } - - public static final Set COLLECTION_TYPES = new HashSet(); - static { - COLLECTION_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.ARRAY_TYPE); - COLLECTION_TYPES.add(org.apache.hive.service.rpc.thrift.TTypeId.MAP_TYPE); - } - - public static final Map TYPE_NAMES = new HashMap(); - static { - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.BOOLEAN_TYPE, "BOOLEAN"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.TINYINT_TYPE, "TINYINT"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.SMALLINT_TYPE, "SMALLINT"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.INT_TYPE, "INT"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.BIGINT_TYPE, "BIGINT"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.FLOAT_TYPE, "FLOAT"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.DOUBLE_TYPE, "DOUBLE"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.STRING_TYPE, "STRING"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.TIMESTAMP_TYPE, "TIMESTAMP"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.BINARY_TYPE, "BINARY"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.ARRAY_TYPE, "ARRAY"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.MAP_TYPE, "MAP"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.STRUCT_TYPE, "STRUCT"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.UNION_TYPE, "UNIONTYPE"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.DECIMAL_TYPE, "DECIMAL"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.NULL_TYPE, "NULL"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.DATE_TYPE, "DATE"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.VARCHAR_TYPE, "VARCHAR"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.CHAR_TYPE, "CHAR"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.INTERVAL_YEAR_MONTH_TYPE, "INTERVAL_YEAR_MONTH"); - TYPE_NAMES.put(org.apache.hive.service.rpc.thrift.TTypeId.INTERVAL_DAY_TIME_TYPE, "INTERVAL_DAY_TIME"); - } - - public static final String CHARACTER_MAXIMUM_LENGTH = "characterMaximumLength"; - - public static final String PRECISION = "precision"; - - public static final String SCALE = "scale"; - -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCancelDelegationTokenReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCancelDelegationTokenReq.java deleted file mode 100644 index a7d4e7de1f60d..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCancelDelegationTokenReq.java +++ /dev/null @@ -1,495 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TCancelDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCancelDelegationTokenReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCancelDelegationTokenReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String delegationToken; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - DELEGATION_TOKEN((short)2, "delegationToken"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // DELEGATION_TOKEN - return DELEGATION_TOKEN; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenReq.class, metaDataMap); - } - - public TCancelDelegationTokenReq() { - } - - public TCancelDelegationTokenReq( - TSessionHandle sessionHandle, - String delegationToken) - { - this(); - this.sessionHandle = sessionHandle; - this.delegationToken = delegationToken; - } - - /** - * Performs a deep copy on other. - */ - public TCancelDelegationTokenReq(TCancelDelegationTokenReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetDelegationToken()) { - this.delegationToken = other.delegationToken; - } - } - - public TCancelDelegationTokenReq deepCopy() { - return new TCancelDelegationTokenReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.delegationToken = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getDelegationToken() { - return this.delegationToken; - } - - public void setDelegationToken(String delegationToken) { - this.delegationToken = delegationToken; - } - - public void unsetDelegationToken() { - this.delegationToken = null; - } - - /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ - public boolean isSetDelegationToken() { - return this.delegationToken != null; - } - - public void setDelegationTokenIsSet(boolean value) { - if (!value) { - this.delegationToken = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case DELEGATION_TOKEN: - if (value == null) { - unsetDelegationToken(); - } else { - setDelegationToken((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case DELEGATION_TOKEN: - return getDelegationToken(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case DELEGATION_TOKEN: - return isSetDelegationToken(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCancelDelegationTokenReq) - return this.equals((TCancelDelegationTokenReq)that); - return false; - } - - public boolean equals(TCancelDelegationTokenReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_delegationToken = true && this.isSetDelegationToken(); - boolean that_present_delegationToken = true && that.isSetDelegationToken(); - if (this_present_delegationToken || that_present_delegationToken) { - if (!(this_present_delegationToken && that_present_delegationToken)) - return false; - if (!this.delegationToken.equals(that.delegationToken)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_delegationToken = true && (isSetDelegationToken()); - list.add(present_delegationToken); - if (present_delegationToken) - list.add(delegationToken); - - return list.hashCode(); - } - - @Override - public int compareTo(TCancelDelegationTokenReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDelegationToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, other.delegationToken); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCancelDelegationTokenReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("delegationToken:"); - if (this.delegationToken == null) { - sb.append("null"); - } else { - sb.append(this.delegationToken); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - if (!isSetDelegationToken()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'delegationToken' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCancelDelegationTokenReqStandardSchemeFactory implements SchemeFactory { - public TCancelDelegationTokenReqStandardScheme getScheme() { - return new TCancelDelegationTokenReqStandardScheme(); - } - } - - private static class TCancelDelegationTokenReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // DELEGATION_TOKEN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.delegationToken != null) { - oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); - oprot.writeString(struct.delegationToken); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCancelDelegationTokenReqTupleSchemeFactory implements SchemeFactory { - public TCancelDelegationTokenReqTupleScheme getScheme() { - return new TCancelDelegationTokenReqTupleScheme(); - } - } - - private static class TCancelDelegationTokenReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.delegationToken); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCancelDelegationTokenResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCancelDelegationTokenResp.java deleted file mode 100644 index 611e92ca2af30..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCancelDelegationTokenResp.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TCancelDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelDelegationTokenResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCancelDelegationTokenRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCancelDelegationTokenRespTupleSchemeFactory()); - } - - private TStatus status; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelDelegationTokenResp.class, metaDataMap); - } - - public TCancelDelegationTokenResp() { - } - - public TCancelDelegationTokenResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TCancelDelegationTokenResp(TCancelDelegationTokenResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TCancelDelegationTokenResp deepCopy() { - return new TCancelDelegationTokenResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCancelDelegationTokenResp) - return this.equals((TCancelDelegationTokenResp)that); - return false; - } - - public boolean equals(TCancelDelegationTokenResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - return list.hashCode(); - } - - @Override - public int compareTo(TCancelDelegationTokenResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCancelDelegationTokenResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCancelDelegationTokenRespStandardSchemeFactory implements SchemeFactory { - public TCancelDelegationTokenRespStandardScheme getScheme() { - return new TCancelDelegationTokenRespStandardScheme(); - } - } - - private static class TCancelDelegationTokenRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCancelDelegationTokenRespTupleSchemeFactory implements SchemeFactory { - public TCancelDelegationTokenRespTupleScheme getScheme() { - return new TCancelDelegationTokenRespTupleScheme(); - } - } - - private static class TCancelDelegationTokenRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCancelDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCancelOperationReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCancelOperationReq.java deleted file mode 100644 index 4076c573fafb7..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCancelOperationReq.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TCancelOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationReq"); - - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCancelOperationReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCancelOperationReqTupleSchemeFactory()); - } - - private TOperationHandle operationHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OPERATION_HANDLE((short)1, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationReq.class, metaDataMap); - } - - public TCancelOperationReq() { - } - - public TCancelOperationReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TCancelOperationReq(TCancelOperationReq other) { - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TCancelOperationReq deepCopy() { - return new TCancelOperationReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCancelOperationReq) - return this.equals((TCancelOperationReq)that); - return false; - } - - public boolean equals(TCancelOperationReq that) { - if (that == null) - return false; - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TCancelOperationReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCancelOperationReq("); - boolean first = true; - - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCancelOperationReqStandardSchemeFactory implements SchemeFactory { - public TCancelOperationReqStandardScheme getScheme() { - return new TCancelOperationReqStandardScheme(); - } - } - - private static class TCancelOperationReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelOperationReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCancelOperationReqTupleSchemeFactory implements SchemeFactory { - public TCancelOperationReqTupleScheme getScheme() { - return new TCancelOperationReqTupleScheme(); - } - } - - private static class TCancelOperationReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.operationHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCancelOperationResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCancelOperationResp.java deleted file mode 100644 index 7bcc765c85daa..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCancelOperationResp.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TCancelOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCancelOperationResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCancelOperationRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCancelOperationRespTupleSchemeFactory()); - } - - private TStatus status; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCancelOperationResp.class, metaDataMap); - } - - public TCancelOperationResp() { - } - - public TCancelOperationResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TCancelOperationResp(TCancelOperationResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TCancelOperationResp deepCopy() { - return new TCancelOperationResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCancelOperationResp) - return this.equals((TCancelOperationResp)that); - return false; - } - - public boolean equals(TCancelOperationResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - return list.hashCode(); - } - - @Override - public int compareTo(TCancelOperationResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCancelOperationResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCancelOperationRespStandardSchemeFactory implements SchemeFactory { - public TCancelOperationRespStandardScheme getScheme() { - return new TCancelOperationRespStandardScheme(); - } - } - - private static class TCancelOperationRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCancelOperationResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCancelOperationResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCancelOperationRespTupleSchemeFactory implements SchemeFactory { - public TCancelOperationRespTupleScheme getScheme() { - return new TCancelOperationRespTupleScheme(); - } - } - - private static class TCancelOperationRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCancelOperationResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCloseOperationReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCloseOperationReq.java deleted file mode 100644 index 47a6b8329c05b..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCloseOperationReq.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TCloseOperationReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationReq"); - - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCloseOperationReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCloseOperationReqTupleSchemeFactory()); - } - - private TOperationHandle operationHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OPERATION_HANDLE((short)1, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationReq.class, metaDataMap); - } - - public TCloseOperationReq() { - } - - public TCloseOperationReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TCloseOperationReq(TCloseOperationReq other) { - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TCloseOperationReq deepCopy() { - return new TCloseOperationReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCloseOperationReq) - return this.equals((TCloseOperationReq)that); - return false; - } - - public boolean equals(TCloseOperationReq that) { - if (that == null) - return false; - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TCloseOperationReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCloseOperationReq("); - boolean first = true; - - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCloseOperationReqStandardSchemeFactory implements SchemeFactory { - public TCloseOperationReqStandardScheme getScheme() { - return new TCloseOperationReqStandardScheme(); - } - } - - private static class TCloseOperationReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseOperationReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCloseOperationReqTupleSchemeFactory implements SchemeFactory { - public TCloseOperationReqTupleScheme getScheme() { - return new TCloseOperationReqTupleScheme(); - } - } - - private static class TCloseOperationReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.operationHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCloseOperationResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCloseOperationResp.java deleted file mode 100644 index 0860a2b1c5bac..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCloseOperationResp.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TCloseOperationResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseOperationResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCloseOperationRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCloseOperationRespTupleSchemeFactory()); - } - - private TStatus status; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseOperationResp.class, metaDataMap); - } - - public TCloseOperationResp() { - } - - public TCloseOperationResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TCloseOperationResp(TCloseOperationResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TCloseOperationResp deepCopy() { - return new TCloseOperationResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCloseOperationResp) - return this.equals((TCloseOperationResp)that); - return false; - } - - public boolean equals(TCloseOperationResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - return list.hashCode(); - } - - @Override - public int compareTo(TCloseOperationResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCloseOperationResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCloseOperationRespStandardSchemeFactory implements SchemeFactory { - public TCloseOperationRespStandardScheme getScheme() { - return new TCloseOperationRespStandardScheme(); - } - } - - private static class TCloseOperationRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseOperationResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseOperationResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCloseOperationRespTupleSchemeFactory implements SchemeFactory { - public TCloseOperationRespTupleScheme getScheme() { - return new TCloseOperationRespTupleScheme(); - } - } - - private static class TCloseOperationRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCloseOperationResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCloseSessionReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCloseSessionReq.java deleted file mode 100644 index 43ee87f487a67..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCloseSessionReq.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TCloseSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCloseSessionReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCloseSessionReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionReq.class, metaDataMap); - } - - public TCloseSessionReq() { - } - - public TCloseSessionReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TCloseSessionReq(TCloseSessionReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - } - - public TCloseSessionReq deepCopy() { - return new TCloseSessionReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCloseSessionReq) - return this.equals((TCloseSessionReq)that); - return false; - } - - public boolean equals(TCloseSessionReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TCloseSessionReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCloseSessionReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCloseSessionReqStandardSchemeFactory implements SchemeFactory { - public TCloseSessionReqStandardScheme getScheme() { - return new TCloseSessionReqStandardScheme(); - } - } - - private static class TCloseSessionReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseSessionReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCloseSessionReqTupleSchemeFactory implements SchemeFactory { - public TCloseSessionReqTupleScheme getScheme() { - return new TCloseSessionReqTupleScheme(); - } - } - - private static class TCloseSessionReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCloseSessionResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCloseSessionResp.java deleted file mode 100644 index 38f82ac8d3cd2..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TCloseSessionResp.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TCloseSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TCloseSessionResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TCloseSessionRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TCloseSessionRespTupleSchemeFactory()); - } - - private TStatus status; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TCloseSessionResp.class, metaDataMap); - } - - public TCloseSessionResp() { - } - - public TCloseSessionResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TCloseSessionResp(TCloseSessionResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TCloseSessionResp deepCopy() { - return new TCloseSessionResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TCloseSessionResp) - return this.equals((TCloseSessionResp)that); - return false; - } - - public boolean equals(TCloseSessionResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - return list.hashCode(); - } - - @Override - public int compareTo(TCloseSessionResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TCloseSessionResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TCloseSessionRespStandardSchemeFactory implements SchemeFactory { - public TCloseSessionRespStandardScheme getScheme() { - return new TCloseSessionRespStandardScheme(); - } - } - - private static class TCloseSessionRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TCloseSessionResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TCloseSessionResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TCloseSessionRespTupleSchemeFactory implements SchemeFactory { - public TCloseSessionRespTupleScheme getScheme() { - return new TCloseSessionRespTupleScheme(); - } - } - - private static class TCloseSessionRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TCloseSessionResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TColumn.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TColumn.java deleted file mode 100644 index dd79482200961..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TColumn.java +++ /dev/null @@ -1,736 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -public class TColumn extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumn"); - private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField BYTE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("byteVal", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField I16_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i16Val", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField I32_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Val", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField I64_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i64Val", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.protocol.TField DOUBLE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleVal", org.apache.thrift.protocol.TType.STRUCT, (short)6); - private static final org.apache.thrift.protocol.TField STRING_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("stringVal", org.apache.thrift.protocol.TType.STRUCT, (short)7); - private static final org.apache.thrift.protocol.TField BINARY_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryVal", org.apache.thrift.protocol.TType.STRUCT, (short)8); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - BOOL_VAL((short)1, "boolVal"), - BYTE_VAL((short)2, "byteVal"), - I16_VAL((short)3, "i16Val"), - I32_VAL((short)4, "i32Val"), - I64_VAL((short)5, "i64Val"), - DOUBLE_VAL((short)6, "doubleVal"), - STRING_VAL((short)7, "stringVal"), - BINARY_VAL((short)8, "binaryVal"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // BOOL_VAL - return BOOL_VAL; - case 2: // BYTE_VAL - return BYTE_VAL; - case 3: // I16_VAL - return I16_VAL; - case 4: // I32_VAL - return I32_VAL; - case 5: // I64_VAL - return I64_VAL; - case 6: // DOUBLE_VAL - return DOUBLE_VAL; - case 7: // STRING_VAL - return STRING_VAL; - case 8: // BINARY_VAL - return BINARY_VAL; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolColumn.class))); - tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteColumn.class))); - tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Column.class))); - tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Column.class))); - tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Column.class))); - tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleColumn.class))); - tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringColumn.class))); - tmpMap.put(_Fields.BINARY_VAL, new org.apache.thrift.meta_data.FieldMetaData("binaryVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBinaryColumn.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumn.class, metaDataMap); - } - - public TColumn() { - super(); - } - - public TColumn(TColumn._Fields setField, Object value) { - super(setField, value); - } - - public TColumn(TColumn other) { - super(other); - } - public TColumn deepCopy() { - return new TColumn(this); - } - - public static TColumn boolVal(TBoolColumn value) { - TColumn x = new TColumn(); - x.setBoolVal(value); - return x; - } - - public static TColumn byteVal(TByteColumn value) { - TColumn x = new TColumn(); - x.setByteVal(value); - return x; - } - - public static TColumn i16Val(TI16Column value) { - TColumn x = new TColumn(); - x.setI16Val(value); - return x; - } - - public static TColumn i32Val(TI32Column value) { - TColumn x = new TColumn(); - x.setI32Val(value); - return x; - } - - public static TColumn i64Val(TI64Column value) { - TColumn x = new TColumn(); - x.setI64Val(value); - return x; - } - - public static TColumn doubleVal(TDoubleColumn value) { - TColumn x = new TColumn(); - x.setDoubleVal(value); - return x; - } - - public static TColumn stringVal(TStringColumn value) { - TColumn x = new TColumn(); - x.setStringVal(value); - return x; - } - - public static TColumn binaryVal(TBinaryColumn value) { - TColumn x = new TColumn(); - x.setBinaryVal(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case BOOL_VAL: - if (value instanceof TBoolColumn) { - break; - } - throw new ClassCastException("Was expecting value of type TBoolColumn for field 'boolVal', but got " + value.getClass().getSimpleName()); - case BYTE_VAL: - if (value instanceof TByteColumn) { - break; - } - throw new ClassCastException("Was expecting value of type TByteColumn for field 'byteVal', but got " + value.getClass().getSimpleName()); - case I16_VAL: - if (value instanceof TI16Column) { - break; - } - throw new ClassCastException("Was expecting value of type TI16Column for field 'i16Val', but got " + value.getClass().getSimpleName()); - case I32_VAL: - if (value instanceof TI32Column) { - break; - } - throw new ClassCastException("Was expecting value of type TI32Column for field 'i32Val', but got " + value.getClass().getSimpleName()); - case I64_VAL: - if (value instanceof TI64Column) { - break; - } - throw new ClassCastException("Was expecting value of type TI64Column for field 'i64Val', but got " + value.getClass().getSimpleName()); - case DOUBLE_VAL: - if (value instanceof TDoubleColumn) { - break; - } - throw new ClassCastException("Was expecting value of type TDoubleColumn for field 'doubleVal', but got " + value.getClass().getSimpleName()); - case STRING_VAL: - if (value instanceof TStringColumn) { - break; - } - throw new ClassCastException("Was expecting value of type TStringColumn for field 'stringVal', but got " + value.getClass().getSimpleName()); - case BINARY_VAL: - if (value instanceof TBinaryColumn) { - break; - } - throw new ClassCastException("Was expecting value of type TBinaryColumn for field 'binaryVal', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case BOOL_VAL: - if (field.type == BOOL_VAL_FIELD_DESC.type) { - TBoolColumn boolVal; - boolVal = new TBoolColumn(); - boolVal.read(iprot); - return boolVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BYTE_VAL: - if (field.type == BYTE_VAL_FIELD_DESC.type) { - TByteColumn byteVal; - byteVal = new TByteColumn(); - byteVal.read(iprot); - return byteVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I16_VAL: - if (field.type == I16_VAL_FIELD_DESC.type) { - TI16Column i16Val; - i16Val = new TI16Column(); - i16Val.read(iprot); - return i16Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I32_VAL: - if (field.type == I32_VAL_FIELD_DESC.type) { - TI32Column i32Val; - i32Val = new TI32Column(); - i32Val.read(iprot); - return i32Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I64_VAL: - if (field.type == I64_VAL_FIELD_DESC.type) { - TI64Column i64Val; - i64Val = new TI64Column(); - i64Val.read(iprot); - return i64Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case DOUBLE_VAL: - if (field.type == DOUBLE_VAL_FIELD_DESC.type) { - TDoubleColumn doubleVal; - doubleVal = new TDoubleColumn(); - doubleVal.read(iprot); - return doubleVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRING_VAL: - if (field.type == STRING_VAL_FIELD_DESC.type) { - TStringColumn stringVal; - stringVal = new TStringColumn(); - stringVal.read(iprot); - return stringVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BINARY_VAL: - if (field.type == BINARY_VAL_FIELD_DESC.type) { - TBinaryColumn binaryVal; - binaryVal = new TBinaryColumn(); - binaryVal.read(iprot); - return binaryVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_VAL: - TBoolColumn boolVal = (TBoolColumn)value_; - boolVal.write(oprot); - return; - case BYTE_VAL: - TByteColumn byteVal = (TByteColumn)value_; - byteVal.write(oprot); - return; - case I16_VAL: - TI16Column i16Val = (TI16Column)value_; - i16Val.write(oprot); - return; - case I32_VAL: - TI32Column i32Val = (TI32Column)value_; - i32Val.write(oprot); - return; - case I64_VAL: - TI64Column i64Val = (TI64Column)value_; - i64Val.write(oprot); - return; - case DOUBLE_VAL: - TDoubleColumn doubleVal = (TDoubleColumn)value_; - doubleVal.write(oprot); - return; - case STRING_VAL: - TStringColumn stringVal = (TStringColumn)value_; - stringVal.write(oprot); - return; - case BINARY_VAL: - TBinaryColumn binaryVal = (TBinaryColumn)value_; - binaryVal.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case BOOL_VAL: - TBoolColumn boolVal; - boolVal = new TBoolColumn(); - boolVal.read(iprot); - return boolVal; - case BYTE_VAL: - TByteColumn byteVal; - byteVal = new TByteColumn(); - byteVal.read(iprot); - return byteVal; - case I16_VAL: - TI16Column i16Val; - i16Val = new TI16Column(); - i16Val.read(iprot); - return i16Val; - case I32_VAL: - TI32Column i32Val; - i32Val = new TI32Column(); - i32Val.read(iprot); - return i32Val; - case I64_VAL: - TI64Column i64Val; - i64Val = new TI64Column(); - i64Val.read(iprot); - return i64Val; - case DOUBLE_VAL: - TDoubleColumn doubleVal; - doubleVal = new TDoubleColumn(); - doubleVal.read(iprot); - return doubleVal; - case STRING_VAL: - TStringColumn stringVal; - stringVal = new TStringColumn(); - stringVal.read(iprot); - return stringVal; - case BINARY_VAL: - TBinaryColumn binaryVal; - binaryVal = new TBinaryColumn(); - binaryVal.read(iprot); - return binaryVal; - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_VAL: - TBoolColumn boolVal = (TBoolColumn)value_; - boolVal.write(oprot); - return; - case BYTE_VAL: - TByteColumn byteVal = (TByteColumn)value_; - byteVal.write(oprot); - return; - case I16_VAL: - TI16Column i16Val = (TI16Column)value_; - i16Val.write(oprot); - return; - case I32_VAL: - TI32Column i32Val = (TI32Column)value_; - i32Val.write(oprot); - return; - case I64_VAL: - TI64Column i64Val = (TI64Column)value_; - i64Val.write(oprot); - return; - case DOUBLE_VAL: - TDoubleColumn doubleVal = (TDoubleColumn)value_; - doubleVal.write(oprot); - return; - case STRING_VAL: - TStringColumn stringVal = (TStringColumn)value_; - stringVal.write(oprot); - return; - case BINARY_VAL: - TBinaryColumn binaryVal = (TBinaryColumn)value_; - binaryVal.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case BOOL_VAL: - return BOOL_VAL_FIELD_DESC; - case BYTE_VAL: - return BYTE_VAL_FIELD_DESC; - case I16_VAL: - return I16_VAL_FIELD_DESC; - case I32_VAL: - return I32_VAL_FIELD_DESC; - case I64_VAL: - return I64_VAL_FIELD_DESC; - case DOUBLE_VAL: - return DOUBLE_VAL_FIELD_DESC; - case STRING_VAL: - return STRING_VAL_FIELD_DESC; - case BINARY_VAL: - return BINARY_VAL_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public TBoolColumn getBoolVal() { - if (getSetField() == _Fields.BOOL_VAL) { - return (TBoolColumn)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBoolVal(TBoolColumn value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BOOL_VAL; - value_ = value; - } - - public TByteColumn getByteVal() { - if (getSetField() == _Fields.BYTE_VAL) { - return (TByteColumn)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setByteVal(TByteColumn value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BYTE_VAL; - value_ = value; - } - - public TI16Column getI16Val() { - if (getSetField() == _Fields.I16_VAL) { - return (TI16Column)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI16Val(TI16Column value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I16_VAL; - value_ = value; - } - - public TI32Column getI32Val() { - if (getSetField() == _Fields.I32_VAL) { - return (TI32Column)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI32Val(TI32Column value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I32_VAL; - value_ = value; - } - - public TI64Column getI64Val() { - if (getSetField() == _Fields.I64_VAL) { - return (TI64Column)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI64Val(TI64Column value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I64_VAL; - value_ = value; - } - - public TDoubleColumn getDoubleVal() { - if (getSetField() == _Fields.DOUBLE_VAL) { - return (TDoubleColumn)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setDoubleVal(TDoubleColumn value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.DOUBLE_VAL; - value_ = value; - } - - public TStringColumn getStringVal() { - if (getSetField() == _Fields.STRING_VAL) { - return (TStringColumn)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringVal(TStringColumn value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.STRING_VAL; - value_ = value; - } - - public TBinaryColumn getBinaryVal() { - if (getSetField() == _Fields.BINARY_VAL) { - return (TBinaryColumn)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'binaryVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBinaryVal(TBinaryColumn value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BINARY_VAL; - value_ = value; - } - - public boolean isSetBoolVal() { - return setField_ == _Fields.BOOL_VAL; - } - - - public boolean isSetByteVal() { - return setField_ == _Fields.BYTE_VAL; - } - - - public boolean isSetI16Val() { - return setField_ == _Fields.I16_VAL; - } - - - public boolean isSetI32Val() { - return setField_ == _Fields.I32_VAL; - } - - - public boolean isSetI64Val() { - return setField_ == _Fields.I64_VAL; - } - - - public boolean isSetDoubleVal() { - return setField_ == _Fields.DOUBLE_VAL; - } - - - public boolean isSetStringVal() { - return setField_ == _Fields.STRING_VAL; - } - - - public boolean isSetBinaryVal() { - return setField_ == _Fields.BINARY_VAL; - } - - - public boolean equals(Object other) { - if (other instanceof TColumn) { - return equals((TColumn)other); - } else { - return false; - } - } - - public boolean equals(TColumn other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TColumn other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - List list = new ArrayList(); - list.add(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - list.add(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - list.add(value); - } - } - return list.hashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TColumnDesc.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TColumnDesc.java deleted file mode 100644 index 31472c8f54b94..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TColumnDesc.java +++ /dev/null @@ -1,704 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TColumnDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnDesc"); - - private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField TYPE_DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("typeDesc", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField POSITION_FIELD_DESC = new org.apache.thrift.protocol.TField("position", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TColumnDescStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TColumnDescTupleSchemeFactory()); - } - - private String columnName; // required - private TTypeDesc typeDesc; // required - private int position; // required - private String comment; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - COLUMN_NAME((short)1, "columnName"), - TYPE_DESC((short)2, "typeDesc"), - POSITION((short)3, "position"), - COMMENT((short)4, "comment"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // COLUMN_NAME - return COLUMN_NAME; - case 2: // TYPE_DESC - return TYPE_DESC; - case 3: // POSITION - return POSITION; - case 4: // COMMENT - return COMMENT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __POSITION_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.COMMENT}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TYPE_DESC, new org.apache.thrift.meta_data.FieldMetaData("typeDesc", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeDesc.class))); - tmpMap.put(_Fields.POSITION, new org.apache.thrift.meta_data.FieldMetaData("position", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnDesc.class, metaDataMap); - } - - public TColumnDesc() { - } - - public TColumnDesc( - String columnName, - TTypeDesc typeDesc, - int position) - { - this(); - this.columnName = columnName; - this.typeDesc = typeDesc; - this.position = position; - setPositionIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TColumnDesc(TColumnDesc other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetColumnName()) { - this.columnName = other.columnName; - } - if (other.isSetTypeDesc()) { - this.typeDesc = new TTypeDesc(other.typeDesc); - } - this.position = other.position; - if (other.isSetComment()) { - this.comment = other.comment; - } - } - - public TColumnDesc deepCopy() { - return new TColumnDesc(this); - } - - @Override - public void clear() { - this.columnName = null; - this.typeDesc = null; - setPositionIsSet(false); - this.position = 0; - this.comment = null; - } - - public String getColumnName() { - return this.columnName; - } - - public void setColumnName(String columnName) { - this.columnName = columnName; - } - - public void unsetColumnName() { - this.columnName = null; - } - - /** Returns true if field columnName is set (has been assigned a value) and false otherwise */ - public boolean isSetColumnName() { - return this.columnName != null; - } - - public void setColumnNameIsSet(boolean value) { - if (!value) { - this.columnName = null; - } - } - - public TTypeDesc getTypeDesc() { - return this.typeDesc; - } - - public void setTypeDesc(TTypeDesc typeDesc) { - this.typeDesc = typeDesc; - } - - public void unsetTypeDesc() { - this.typeDesc = null; - } - - /** Returns true if field typeDesc is set (has been assigned a value) and false otherwise */ - public boolean isSetTypeDesc() { - return this.typeDesc != null; - } - - public void setTypeDescIsSet(boolean value) { - if (!value) { - this.typeDesc = null; - } - } - - public int getPosition() { - return this.position; - } - - public void setPosition(int position) { - this.position = position; - setPositionIsSet(true); - } - - public void unsetPosition() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __POSITION_ISSET_ID); - } - - /** Returns true if field position is set (has been assigned a value) and false otherwise */ - public boolean isSetPosition() { - return EncodingUtils.testBit(__isset_bitfield, __POSITION_ISSET_ID); - } - - public void setPositionIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __POSITION_ISSET_ID, value); - } - - public String getComment() { - return this.comment; - } - - public void setComment(String comment) { - this.comment = comment; - } - - public void unsetComment() { - this.comment = null; - } - - /** Returns true if field comment is set (has been assigned a value) and false otherwise */ - public boolean isSetComment() { - return this.comment != null; - } - - public void setCommentIsSet(boolean value) { - if (!value) { - this.comment = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case COLUMN_NAME: - if (value == null) { - unsetColumnName(); - } else { - setColumnName((String)value); - } - break; - - case TYPE_DESC: - if (value == null) { - unsetTypeDesc(); - } else { - setTypeDesc((TTypeDesc)value); - } - break; - - case POSITION: - if (value == null) { - unsetPosition(); - } else { - setPosition((Integer)value); - } - break; - - case COMMENT: - if (value == null) { - unsetComment(); - } else { - setComment((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case COLUMN_NAME: - return getColumnName(); - - case TYPE_DESC: - return getTypeDesc(); - - case POSITION: - return getPosition(); - - case COMMENT: - return getComment(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case COLUMN_NAME: - return isSetColumnName(); - case TYPE_DESC: - return isSetTypeDesc(); - case POSITION: - return isSetPosition(); - case COMMENT: - return isSetComment(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TColumnDesc) - return this.equals((TColumnDesc)that); - return false; - } - - public boolean equals(TColumnDesc that) { - if (that == null) - return false; - - boolean this_present_columnName = true && this.isSetColumnName(); - boolean that_present_columnName = true && that.isSetColumnName(); - if (this_present_columnName || that_present_columnName) { - if (!(this_present_columnName && that_present_columnName)) - return false; - if (!this.columnName.equals(that.columnName)) - return false; - } - - boolean this_present_typeDesc = true && this.isSetTypeDesc(); - boolean that_present_typeDesc = true && that.isSetTypeDesc(); - if (this_present_typeDesc || that_present_typeDesc) { - if (!(this_present_typeDesc && that_present_typeDesc)) - return false; - if (!this.typeDesc.equals(that.typeDesc)) - return false; - } - - boolean this_present_position = true; - boolean that_present_position = true; - if (this_present_position || that_present_position) { - if (!(this_present_position && that_present_position)) - return false; - if (this.position != that.position) - return false; - } - - boolean this_present_comment = true && this.isSetComment(); - boolean that_present_comment = true && that.isSetComment(); - if (this_present_comment || that_present_comment) { - if (!(this_present_comment && that_present_comment)) - return false; - if (!this.comment.equals(that.comment)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_columnName = true && (isSetColumnName()); - list.add(present_columnName); - if (present_columnName) - list.add(columnName); - - boolean present_typeDesc = true && (isSetTypeDesc()); - list.add(present_typeDesc); - if (present_typeDesc) - list.add(typeDesc); - - boolean present_position = true; - list.add(present_position); - if (present_position) - list.add(position); - - boolean present_comment = true && (isSetComment()); - list.add(present_comment); - if (present_comment) - list.add(comment); - - return list.hashCode(); - } - - @Override - public int compareTo(TColumnDesc other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumnName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnName, other.columnName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTypeDesc()).compareTo(other.isSetTypeDesc()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTypeDesc()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeDesc, other.typeDesc); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPosition()).compareTo(other.isSetPosition()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPosition()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.position, other.position); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetComment()).compareTo(other.isSetComment()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetComment()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.comment, other.comment); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TColumnDesc("); - boolean first = true; - - sb.append("columnName:"); - if (this.columnName == null) { - sb.append("null"); - } else { - sb.append(this.columnName); - } - first = false; - if (!first) sb.append(", "); - sb.append("typeDesc:"); - if (this.typeDesc == null) { - sb.append("null"); - } else { - sb.append(this.typeDesc); - } - first = false; - if (!first) sb.append(", "); - sb.append("position:"); - sb.append(this.position); - first = false; - if (isSetComment()) { - if (!first) sb.append(", "); - sb.append("comment:"); - if (this.comment == null) { - sb.append("null"); - } else { - sb.append(this.comment); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetColumnName()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'columnName' is unset! Struct:" + toString()); - } - - if (!isSetTypeDesc()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeDesc' is unset! Struct:" + toString()); - } - - if (!isSetPosition()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'position' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (typeDesc != null) { - typeDesc.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TColumnDescStandardSchemeFactory implements SchemeFactory { - public TColumnDescStandardScheme getScheme() { - return new TColumnDescStandardScheme(); - } - } - - private static class TColumnDescStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TColumnDesc struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // COLUMN_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.columnName = iprot.readString(); - struct.setColumnNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // TYPE_DESC - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.typeDesc = new TTypeDesc(); - struct.typeDesc.read(iprot); - struct.setTypeDescIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // POSITION - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.position = iprot.readI32(); - struct.setPositionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // COMMENT - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.comment = iprot.readString(); - struct.setCommentIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TColumnDesc struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.columnName != null) { - oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); - oprot.writeString(struct.columnName); - oprot.writeFieldEnd(); - } - if (struct.typeDesc != null) { - oprot.writeFieldBegin(TYPE_DESC_FIELD_DESC); - struct.typeDesc.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(POSITION_FIELD_DESC); - oprot.writeI32(struct.position); - oprot.writeFieldEnd(); - if (struct.comment != null) { - if (struct.isSetComment()) { - oprot.writeFieldBegin(COMMENT_FIELD_DESC); - oprot.writeString(struct.comment); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TColumnDescTupleSchemeFactory implements SchemeFactory { - public TColumnDescTupleScheme getScheme() { - return new TColumnDescTupleScheme(); - } - } - - private static class TColumnDescTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeString(struct.columnName); - struct.typeDesc.write(oprot); - oprot.writeI32(struct.position); - BitSet optionals = new BitSet(); - if (struct.isSetComment()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetComment()) { - oprot.writeString(struct.comment); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TColumnDesc struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.columnName = iprot.readString(); - struct.setColumnNameIsSet(true); - struct.typeDesc = new TTypeDesc(); - struct.typeDesc.read(iprot); - struct.setTypeDescIsSet(true); - struct.position = iprot.readI32(); - struct.setPositionIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.comment = iprot.readString(); - struct.setCommentIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TColumnValue.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TColumnValue.java deleted file mode 100644 index d1cc8e919bc0c..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TColumnValue.java +++ /dev/null @@ -1,675 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -public class TColumnValue extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TColumnValue"); - private static final org.apache.thrift.protocol.TField BOOL_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("boolVal", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField BYTE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("byteVal", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField I16_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i16Val", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField I32_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Val", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField I64_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("i64Val", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.protocol.TField DOUBLE_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("doubleVal", org.apache.thrift.protocol.TType.STRUCT, (short)6); - private static final org.apache.thrift.protocol.TField STRING_VAL_FIELD_DESC = new org.apache.thrift.protocol.TField("stringVal", org.apache.thrift.protocol.TType.STRUCT, (short)7); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - BOOL_VAL((short)1, "boolVal"), - BYTE_VAL((short)2, "byteVal"), - I16_VAL((short)3, "i16Val"), - I32_VAL((short)4, "i32Val"), - I64_VAL((short)5, "i64Val"), - DOUBLE_VAL((short)6, "doubleVal"), - STRING_VAL((short)7, "stringVal"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // BOOL_VAL - return BOOL_VAL; - case 2: // BYTE_VAL - return BYTE_VAL; - case 3: // I16_VAL - return I16_VAL; - case 4: // I32_VAL - return I32_VAL; - case 5: // I64_VAL - return I64_VAL; - case 6: // DOUBLE_VAL - return DOUBLE_VAL; - case 7: // STRING_VAL - return STRING_VAL; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.BOOL_VAL, new org.apache.thrift.meta_data.FieldMetaData("boolVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TBoolValue.class))); - tmpMap.put(_Fields.BYTE_VAL, new org.apache.thrift.meta_data.FieldMetaData("byteVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TByteValue.class))); - tmpMap.put(_Fields.I16_VAL, new org.apache.thrift.meta_data.FieldMetaData("i16Val", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI16Value.class))); - tmpMap.put(_Fields.I32_VAL, new org.apache.thrift.meta_data.FieldMetaData("i32Val", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI32Value.class))); - tmpMap.put(_Fields.I64_VAL, new org.apache.thrift.meta_data.FieldMetaData("i64Val", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TI64Value.class))); - tmpMap.put(_Fields.DOUBLE_VAL, new org.apache.thrift.meta_data.FieldMetaData("doubleVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TDoubleValue.class))); - tmpMap.put(_Fields.STRING_VAL, new org.apache.thrift.meta_data.FieldMetaData("stringVal", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStringValue.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TColumnValue.class, metaDataMap); - } - - public TColumnValue() { - super(); - } - - public TColumnValue(TColumnValue._Fields setField, Object value) { - super(setField, value); - } - - public TColumnValue(TColumnValue other) { - super(other); - } - public TColumnValue deepCopy() { - return new TColumnValue(this); - } - - public static TColumnValue boolVal(TBoolValue value) { - TColumnValue x = new TColumnValue(); - x.setBoolVal(value); - return x; - } - - public static TColumnValue byteVal(TByteValue value) { - TColumnValue x = new TColumnValue(); - x.setByteVal(value); - return x; - } - - public static TColumnValue i16Val(TI16Value value) { - TColumnValue x = new TColumnValue(); - x.setI16Val(value); - return x; - } - - public static TColumnValue i32Val(TI32Value value) { - TColumnValue x = new TColumnValue(); - x.setI32Val(value); - return x; - } - - public static TColumnValue i64Val(TI64Value value) { - TColumnValue x = new TColumnValue(); - x.setI64Val(value); - return x; - } - - public static TColumnValue doubleVal(TDoubleValue value) { - TColumnValue x = new TColumnValue(); - x.setDoubleVal(value); - return x; - } - - public static TColumnValue stringVal(TStringValue value) { - TColumnValue x = new TColumnValue(); - x.setStringVal(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case BOOL_VAL: - if (value instanceof TBoolValue) { - break; - } - throw new ClassCastException("Was expecting value of type TBoolValue for field 'boolVal', but got " + value.getClass().getSimpleName()); - case BYTE_VAL: - if (value instanceof TByteValue) { - break; - } - throw new ClassCastException("Was expecting value of type TByteValue for field 'byteVal', but got " + value.getClass().getSimpleName()); - case I16_VAL: - if (value instanceof TI16Value) { - break; - } - throw new ClassCastException("Was expecting value of type TI16Value for field 'i16Val', but got " + value.getClass().getSimpleName()); - case I32_VAL: - if (value instanceof TI32Value) { - break; - } - throw new ClassCastException("Was expecting value of type TI32Value for field 'i32Val', but got " + value.getClass().getSimpleName()); - case I64_VAL: - if (value instanceof TI64Value) { - break; - } - throw new ClassCastException("Was expecting value of type TI64Value for field 'i64Val', but got " + value.getClass().getSimpleName()); - case DOUBLE_VAL: - if (value instanceof TDoubleValue) { - break; - } - throw new ClassCastException("Was expecting value of type TDoubleValue for field 'doubleVal', but got " + value.getClass().getSimpleName()); - case STRING_VAL: - if (value instanceof TStringValue) { - break; - } - throw new ClassCastException("Was expecting value of type TStringValue for field 'stringVal', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case BOOL_VAL: - if (field.type == BOOL_VAL_FIELD_DESC.type) { - TBoolValue boolVal; - boolVal = new TBoolValue(); - boolVal.read(iprot); - return boolVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BYTE_VAL: - if (field.type == BYTE_VAL_FIELD_DESC.type) { - TByteValue byteVal; - byteVal = new TByteValue(); - byteVal.read(iprot); - return byteVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I16_VAL: - if (field.type == I16_VAL_FIELD_DESC.type) { - TI16Value i16Val; - i16Val = new TI16Value(); - i16Val.read(iprot); - return i16Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I32_VAL: - if (field.type == I32_VAL_FIELD_DESC.type) { - TI32Value i32Val; - i32Val = new TI32Value(); - i32Val.read(iprot); - return i32Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case I64_VAL: - if (field.type == I64_VAL_FIELD_DESC.type) { - TI64Value i64Val; - i64Val = new TI64Value(); - i64Val.read(iprot); - return i64Val; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case DOUBLE_VAL: - if (field.type == DOUBLE_VAL_FIELD_DESC.type) { - TDoubleValue doubleVal; - doubleVal = new TDoubleValue(); - doubleVal.read(iprot); - return doubleVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRING_VAL: - if (field.type == STRING_VAL_FIELD_DESC.type) { - TStringValue stringVal; - stringVal = new TStringValue(); - stringVal.read(iprot); - return stringVal; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_VAL: - TBoolValue boolVal = (TBoolValue)value_; - boolVal.write(oprot); - return; - case BYTE_VAL: - TByteValue byteVal = (TByteValue)value_; - byteVal.write(oprot); - return; - case I16_VAL: - TI16Value i16Val = (TI16Value)value_; - i16Val.write(oprot); - return; - case I32_VAL: - TI32Value i32Val = (TI32Value)value_; - i32Val.write(oprot); - return; - case I64_VAL: - TI64Value i64Val = (TI64Value)value_; - i64Val.write(oprot); - return; - case DOUBLE_VAL: - TDoubleValue doubleVal = (TDoubleValue)value_; - doubleVal.write(oprot); - return; - case STRING_VAL: - TStringValue stringVal = (TStringValue)value_; - stringVal.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case BOOL_VAL: - TBoolValue boolVal; - boolVal = new TBoolValue(); - boolVal.read(iprot); - return boolVal; - case BYTE_VAL: - TByteValue byteVal; - byteVal = new TByteValue(); - byteVal.read(iprot); - return byteVal; - case I16_VAL: - TI16Value i16Val; - i16Val = new TI16Value(); - i16Val.read(iprot); - return i16Val; - case I32_VAL: - TI32Value i32Val; - i32Val = new TI32Value(); - i32Val.read(iprot); - return i32Val; - case I64_VAL: - TI64Value i64Val; - i64Val = new TI64Value(); - i64Val.read(iprot); - return i64Val; - case DOUBLE_VAL: - TDoubleValue doubleVal; - doubleVal = new TDoubleValue(); - doubleVal.read(iprot); - return doubleVal; - case STRING_VAL: - TStringValue stringVal; - stringVal = new TStringValue(); - stringVal.read(iprot); - return stringVal; - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case BOOL_VAL: - TBoolValue boolVal = (TBoolValue)value_; - boolVal.write(oprot); - return; - case BYTE_VAL: - TByteValue byteVal = (TByteValue)value_; - byteVal.write(oprot); - return; - case I16_VAL: - TI16Value i16Val = (TI16Value)value_; - i16Val.write(oprot); - return; - case I32_VAL: - TI32Value i32Val = (TI32Value)value_; - i32Val.write(oprot); - return; - case I64_VAL: - TI64Value i64Val = (TI64Value)value_; - i64Val.write(oprot); - return; - case DOUBLE_VAL: - TDoubleValue doubleVal = (TDoubleValue)value_; - doubleVal.write(oprot); - return; - case STRING_VAL: - TStringValue stringVal = (TStringValue)value_; - stringVal.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case BOOL_VAL: - return BOOL_VAL_FIELD_DESC; - case BYTE_VAL: - return BYTE_VAL_FIELD_DESC; - case I16_VAL: - return I16_VAL_FIELD_DESC; - case I32_VAL: - return I32_VAL_FIELD_DESC; - case I64_VAL: - return I64_VAL_FIELD_DESC; - case DOUBLE_VAL: - return DOUBLE_VAL_FIELD_DESC; - case STRING_VAL: - return STRING_VAL_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public TBoolValue getBoolVal() { - if (getSetField() == _Fields.BOOL_VAL) { - return (TBoolValue)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'boolVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBoolVal(TBoolValue value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BOOL_VAL; - value_ = value; - } - - public TByteValue getByteVal() { - if (getSetField() == _Fields.BYTE_VAL) { - return (TByteValue)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'byteVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setByteVal(TByteValue value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.BYTE_VAL; - value_ = value; - } - - public TI16Value getI16Val() { - if (getSetField() == _Fields.I16_VAL) { - return (TI16Value)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i16Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI16Val(TI16Value value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I16_VAL; - value_ = value; - } - - public TI32Value getI32Val() { - if (getSetField() == _Fields.I32_VAL) { - return (TI32Value)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i32Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI32Val(TI32Value value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I32_VAL; - value_ = value; - } - - public TI64Value getI64Val() { - if (getSetField() == _Fields.I64_VAL) { - return (TI64Value)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i64Val' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI64Val(TI64Value value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.I64_VAL; - value_ = value; - } - - public TDoubleValue getDoubleVal() { - if (getSetField() == _Fields.DOUBLE_VAL) { - return (TDoubleValue)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'doubleVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setDoubleVal(TDoubleValue value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.DOUBLE_VAL; - value_ = value; - } - - public TStringValue getStringVal() { - if (getSetField() == _Fields.STRING_VAL) { - return (TStringValue)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'stringVal' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringVal(TStringValue value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.STRING_VAL; - value_ = value; - } - - public boolean isSetBoolVal() { - return setField_ == _Fields.BOOL_VAL; - } - - - public boolean isSetByteVal() { - return setField_ == _Fields.BYTE_VAL; - } - - - public boolean isSetI16Val() { - return setField_ == _Fields.I16_VAL; - } - - - public boolean isSetI32Val() { - return setField_ == _Fields.I32_VAL; - } - - - public boolean isSetI64Val() { - return setField_ == _Fields.I64_VAL; - } - - - public boolean isSetDoubleVal() { - return setField_ == _Fields.DOUBLE_VAL; - } - - - public boolean isSetStringVal() { - return setField_ == _Fields.STRING_VAL; - } - - - public boolean equals(Object other) { - if (other instanceof TColumnValue) { - return equals((TColumnValue)other); - } else { - return false; - } - } - - public boolean equals(TColumnValue other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TColumnValue other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - List list = new ArrayList(); - list.add(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - list.add(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - list.add(value); - } - } - return list.hashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TDoubleColumn.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TDoubleColumn.java deleted file mode 100644 index f93c9b4f0edc3..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TDoubleColumn.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TDoubleColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TDoubleColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TDoubleColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleColumn.class, metaDataMap); - } - - public TDoubleColumn() { - } - - public TDoubleColumn( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TDoubleColumn(TDoubleColumn other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TDoubleColumn deepCopy() { - return new TDoubleColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(double elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TDoubleColumn) - return this.equals((TDoubleColumn)that); - return false; - } - - public boolean equals(TDoubleColumn that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); - - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); - - return list.hashCode(); - } - - @Override - public int compareTo(TDoubleColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TDoubleColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TDoubleColumnStandardSchemeFactory implements SchemeFactory { - public TDoubleColumnStandardScheme getScheme() { - return new TDoubleColumnStandardScheme(); - } - } - - private static class TDoubleColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list94 = iprot.readListBegin(); - struct.values = new ArrayList(_list94.size); - double _elem95; - for (int _i96 = 0; _i96 < _list94.size; ++_i96) - { - _elem95 = iprot.readDouble(); - struct.values.add(_elem95); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TDoubleColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, struct.values.size())); - for (double _iter97 : struct.values) - { - oprot.writeDouble(_iter97); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TDoubleColumnTupleSchemeFactory implements SchemeFactory { - public TDoubleColumnTupleScheme getScheme() { - return new TDoubleColumnTupleScheme(); - } - } - - private static class TDoubleColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (double _iter98 : struct.values) - { - oprot.writeDouble(_iter98); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list99 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.DOUBLE, iprot.readI32()); - struct.values = new ArrayList(_list99.size); - double _elem100; - for (int _i101 = 0; _i101 < _list99.size; ++_i101) - { - _elem100 = iprot.readDouble(); - struct.values.add(_elem100); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TDoubleValue.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TDoubleValue.java deleted file mode 100644 index 5700355aad94d..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TDoubleValue.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TDoubleValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TDoubleValue"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.DOUBLE, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TDoubleValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TDoubleValueTupleSchemeFactory()); - } - - private double value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TDoubleValue.class, metaDataMap); - } - - public TDoubleValue() { - } - - /** - * Performs a deep copy on other. - */ - public TDoubleValue(TDoubleValue other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TDoubleValue deepCopy() { - return new TDoubleValue(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0.0; - } - - public double getValue() { - return this.value; - } - - public void setValue(double value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((Double)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TDoubleValue) - return this.equals((TDoubleValue)that); - return false; - } - - public boolean equals(TDoubleValue that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); - - return list.hashCode(); - } - - @Override - public int compareTo(TDoubleValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TDoubleValue("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TDoubleValueStandardSchemeFactory implements SchemeFactory { - public TDoubleValueStandardScheme getScheme() { - return new TDoubleValueStandardScheme(); - } - } - - private static class TDoubleValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TDoubleValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.value = iprot.readDouble(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TDoubleValue struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeDouble(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TDoubleValueTupleSchemeFactory implements SchemeFactory { - public TDoubleValueTupleScheme getScheme() { - return new TDoubleValueTupleScheme(); - } - } - - private static class TDoubleValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeDouble(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TDoubleValue struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readDouble(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TExecuteStatementReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TExecuteStatementReq.java deleted file mode 100644 index 1f73cec61af78..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TExecuteStatementReq.java +++ /dev/null @@ -1,863 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TExecuteStatementReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField STATEMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("statement", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField CONF_OVERLAY_FIELD_DESC = new org.apache.thrift.protocol.TField("confOverlay", org.apache.thrift.protocol.TType.MAP, (short)3); - private static final org.apache.thrift.protocol.TField RUN_ASYNC_FIELD_DESC = new org.apache.thrift.protocol.TField("runAsync", org.apache.thrift.protocol.TType.BOOL, (short)4); - private static final org.apache.thrift.protocol.TField QUERY_TIMEOUT_FIELD_DESC = new org.apache.thrift.protocol.TField("queryTimeout", org.apache.thrift.protocol.TType.I64, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TExecuteStatementReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TExecuteStatementReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String statement; // required - private Map confOverlay; // optional - private boolean runAsync; // optional - private long queryTimeout; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - STATEMENT((short)2, "statement"), - CONF_OVERLAY((short)3, "confOverlay"), - RUN_ASYNC((short)4, "runAsync"), - QUERY_TIMEOUT((short)5, "queryTimeout"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // STATEMENT - return STATEMENT; - case 3: // CONF_OVERLAY - return CONF_OVERLAY; - case 4: // RUN_ASYNC - return RUN_ASYNC; - case 5: // QUERY_TIMEOUT - return QUERY_TIMEOUT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __RUNASYNC_ISSET_ID = 0; - private static final int __QUERYTIMEOUT_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.CONF_OVERLAY,_Fields.RUN_ASYNC,_Fields.QUERY_TIMEOUT}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.STATEMENT, new org.apache.thrift.meta_data.FieldMetaData("statement", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.CONF_OVERLAY, new org.apache.thrift.meta_data.FieldMetaData("confOverlay", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.RUN_ASYNC, new org.apache.thrift.meta_data.FieldMetaData("runAsync", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.QUERY_TIMEOUT, new org.apache.thrift.meta_data.FieldMetaData("queryTimeout", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementReq.class, metaDataMap); - } - - public TExecuteStatementReq() { - this.runAsync = false; - - this.queryTimeout = 0L; - - } - - public TExecuteStatementReq( - TSessionHandle sessionHandle, - String statement) - { - this(); - this.sessionHandle = sessionHandle; - this.statement = statement; - } - - /** - * Performs a deep copy on other. - */ - public TExecuteStatementReq(TExecuteStatementReq other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetStatement()) { - this.statement = other.statement; - } - if (other.isSetConfOverlay()) { - Map __this__confOverlay = new HashMap(other.confOverlay); - this.confOverlay = __this__confOverlay; - } - this.runAsync = other.runAsync; - this.queryTimeout = other.queryTimeout; - } - - public TExecuteStatementReq deepCopy() { - return new TExecuteStatementReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.statement = null; - this.confOverlay = null; - this.runAsync = false; - - this.queryTimeout = 0L; - - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getStatement() { - return this.statement; - } - - public void setStatement(String statement) { - this.statement = statement; - } - - public void unsetStatement() { - this.statement = null; - } - - /** Returns true if field statement is set (has been assigned a value) and false otherwise */ - public boolean isSetStatement() { - return this.statement != null; - } - - public void setStatementIsSet(boolean value) { - if (!value) { - this.statement = null; - } - } - - public int getConfOverlaySize() { - return (this.confOverlay == null) ? 0 : this.confOverlay.size(); - } - - public void putToConfOverlay(String key, String val) { - if (this.confOverlay == null) { - this.confOverlay = new HashMap(); - } - this.confOverlay.put(key, val); - } - - public Map getConfOverlay() { - return this.confOverlay; - } - - public void setConfOverlay(Map confOverlay) { - this.confOverlay = confOverlay; - } - - public void unsetConfOverlay() { - this.confOverlay = null; - } - - /** Returns true if field confOverlay is set (has been assigned a value) and false otherwise */ - public boolean isSetConfOverlay() { - return this.confOverlay != null; - } - - public void setConfOverlayIsSet(boolean value) { - if (!value) { - this.confOverlay = null; - } - } - - public boolean isRunAsync() { - return this.runAsync; - } - - public void setRunAsync(boolean runAsync) { - this.runAsync = runAsync; - setRunAsyncIsSet(true); - } - - public void unsetRunAsync() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RUNASYNC_ISSET_ID); - } - - /** Returns true if field runAsync is set (has been assigned a value) and false otherwise */ - public boolean isSetRunAsync() { - return EncodingUtils.testBit(__isset_bitfield, __RUNASYNC_ISSET_ID); - } - - public void setRunAsyncIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RUNASYNC_ISSET_ID, value); - } - - public long getQueryTimeout() { - return this.queryTimeout; - } - - public void setQueryTimeout(long queryTimeout) { - this.queryTimeout = queryTimeout; - setQueryTimeoutIsSet(true); - } - - public void unsetQueryTimeout() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); - } - - /** Returns true if field queryTimeout is set (has been assigned a value) and false otherwise */ - public boolean isSetQueryTimeout() { - return EncodingUtils.testBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID); - } - - public void setQueryTimeoutIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __QUERYTIMEOUT_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case STATEMENT: - if (value == null) { - unsetStatement(); - } else { - setStatement((String)value); - } - break; - - case CONF_OVERLAY: - if (value == null) { - unsetConfOverlay(); - } else { - setConfOverlay((Map)value); - } - break; - - case RUN_ASYNC: - if (value == null) { - unsetRunAsync(); - } else { - setRunAsync((Boolean)value); - } - break; - - case QUERY_TIMEOUT: - if (value == null) { - unsetQueryTimeout(); - } else { - setQueryTimeout((Long)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case STATEMENT: - return getStatement(); - - case CONF_OVERLAY: - return getConfOverlay(); - - case RUN_ASYNC: - return isRunAsync(); - - case QUERY_TIMEOUT: - return getQueryTimeout(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case STATEMENT: - return isSetStatement(); - case CONF_OVERLAY: - return isSetConfOverlay(); - case RUN_ASYNC: - return isSetRunAsync(); - case QUERY_TIMEOUT: - return isSetQueryTimeout(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TExecuteStatementReq) - return this.equals((TExecuteStatementReq)that); - return false; - } - - public boolean equals(TExecuteStatementReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_statement = true && this.isSetStatement(); - boolean that_present_statement = true && that.isSetStatement(); - if (this_present_statement || that_present_statement) { - if (!(this_present_statement && that_present_statement)) - return false; - if (!this.statement.equals(that.statement)) - return false; - } - - boolean this_present_confOverlay = true && this.isSetConfOverlay(); - boolean that_present_confOverlay = true && that.isSetConfOverlay(); - if (this_present_confOverlay || that_present_confOverlay) { - if (!(this_present_confOverlay && that_present_confOverlay)) - return false; - if (!this.confOverlay.equals(that.confOverlay)) - return false; - } - - boolean this_present_runAsync = true && this.isSetRunAsync(); - boolean that_present_runAsync = true && that.isSetRunAsync(); - if (this_present_runAsync || that_present_runAsync) { - if (!(this_present_runAsync && that_present_runAsync)) - return false; - if (this.runAsync != that.runAsync) - return false; - } - - boolean this_present_queryTimeout = true && this.isSetQueryTimeout(); - boolean that_present_queryTimeout = true && that.isSetQueryTimeout(); - if (this_present_queryTimeout || that_present_queryTimeout) { - if (!(this_present_queryTimeout && that_present_queryTimeout)) - return false; - if (this.queryTimeout != that.queryTimeout) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_statement = true && (isSetStatement()); - list.add(present_statement); - if (present_statement) - list.add(statement); - - boolean present_confOverlay = true && (isSetConfOverlay()); - list.add(present_confOverlay); - if (present_confOverlay) - list.add(confOverlay); - - boolean present_runAsync = true && (isSetRunAsync()); - list.add(present_runAsync); - if (present_runAsync) - list.add(runAsync); - - boolean present_queryTimeout = true && (isSetQueryTimeout()); - list.add(present_queryTimeout); - if (present_queryTimeout) - list.add(queryTimeout); - - return list.hashCode(); - } - - @Override - public int compareTo(TExecuteStatementReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStatement()).compareTo(other.isSetStatement()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatement()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statement, other.statement); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetConfOverlay()).compareTo(other.isSetConfOverlay()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConfOverlay()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.confOverlay, other.confOverlay); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRunAsync()).compareTo(other.isSetRunAsync()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRunAsync()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.runAsync, other.runAsync); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetQueryTimeout()).compareTo(other.isSetQueryTimeout()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetQueryTimeout()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.queryTimeout, other.queryTimeout); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TExecuteStatementReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("statement:"); - if (this.statement == null) { - sb.append("null"); - } else { - sb.append(this.statement); - } - first = false; - if (isSetConfOverlay()) { - if (!first) sb.append(", "); - sb.append("confOverlay:"); - if (this.confOverlay == null) { - sb.append("null"); - } else { - sb.append(this.confOverlay); - } - first = false; - } - if (isSetRunAsync()) { - if (!first) sb.append(", "); - sb.append("runAsync:"); - sb.append(this.runAsync); - first = false; - } - if (isSetQueryTimeout()) { - if (!first) sb.append(", "); - sb.append("queryTimeout:"); - sb.append(this.queryTimeout); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - if (!isSetStatement()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'statement' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TExecuteStatementReqStandardSchemeFactory implements SchemeFactory { - public TExecuteStatementReqStandardScheme getScheme() { - return new TExecuteStatementReqStandardScheme(); - } - } - - private static class TExecuteStatementReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // STATEMENT - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.statement = iprot.readString(); - struct.setStatementIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // CONF_OVERLAY - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map162 = iprot.readMapBegin(); - struct.confOverlay = new HashMap(2*_map162.size); - String _key163; - String _val164; - for (int _i165 = 0; _i165 < _map162.size; ++_i165) - { - _key163 = iprot.readString(); - _val164 = iprot.readString(); - struct.confOverlay.put(_key163, _val164); - } - iprot.readMapEnd(); - } - struct.setConfOverlayIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // RUN_ASYNC - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.runAsync = iprot.readBool(); - struct.setRunAsyncIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // QUERY_TIMEOUT - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.queryTimeout = iprot.readI64(); - struct.setQueryTimeoutIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.statement != null) { - oprot.writeFieldBegin(STATEMENT_FIELD_DESC); - oprot.writeString(struct.statement); - oprot.writeFieldEnd(); - } - if (struct.confOverlay != null) { - if (struct.isSetConfOverlay()) { - oprot.writeFieldBegin(CONF_OVERLAY_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.confOverlay.size())); - for (Map.Entry _iter166 : struct.confOverlay.entrySet()) - { - oprot.writeString(_iter166.getKey()); - oprot.writeString(_iter166.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - if (struct.isSetRunAsync()) { - oprot.writeFieldBegin(RUN_ASYNC_FIELD_DESC); - oprot.writeBool(struct.runAsync); - oprot.writeFieldEnd(); - } - if (struct.isSetQueryTimeout()) { - oprot.writeFieldBegin(QUERY_TIMEOUT_FIELD_DESC); - oprot.writeI64(struct.queryTimeout); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TExecuteStatementReqTupleSchemeFactory implements SchemeFactory { - public TExecuteStatementReqTupleScheme getScheme() { - return new TExecuteStatementReqTupleScheme(); - } - } - - private static class TExecuteStatementReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.statement); - BitSet optionals = new BitSet(); - if (struct.isSetConfOverlay()) { - optionals.set(0); - } - if (struct.isSetRunAsync()) { - optionals.set(1); - } - if (struct.isSetQueryTimeout()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetConfOverlay()) { - { - oprot.writeI32(struct.confOverlay.size()); - for (Map.Entry _iter167 : struct.confOverlay.entrySet()) - { - oprot.writeString(_iter167.getKey()); - oprot.writeString(_iter167.getValue()); - } - } - } - if (struct.isSetRunAsync()) { - oprot.writeBool(struct.runAsync); - } - if (struct.isSetQueryTimeout()) { - oprot.writeI64(struct.queryTimeout); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.statement = iprot.readString(); - struct.setStatementIsSet(true); - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map168 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.confOverlay = new HashMap(2*_map168.size); - String _key169; - String _val170; - for (int _i171 = 0; _i171 < _map168.size; ++_i171) - { - _key169 = iprot.readString(); - _val170 = iprot.readString(); - struct.confOverlay.put(_key169, _val170); - } - } - struct.setConfOverlayIsSet(true); - } - if (incoming.get(1)) { - struct.runAsync = iprot.readBool(); - struct.setRunAsyncIsSet(true); - } - if (incoming.get(2)) { - struct.queryTimeout = iprot.readI64(); - struct.setQueryTimeoutIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TExecuteStatementResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TExecuteStatementResp.java deleted file mode 100644 index 7101fa5bdb84c..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TExecuteStatementResp.java +++ /dev/null @@ -1,509 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TExecuteStatementResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TExecuteStatementResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TExecuteStatementRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TExecuteStatementRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TExecuteStatementResp.class, metaDataMap); - } - - public TExecuteStatementResp() { - } - - public TExecuteStatementResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TExecuteStatementResp(TExecuteStatementResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TExecuteStatementResp deepCopy() { - return new TExecuteStatementResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TExecuteStatementResp) - return this.equals((TExecuteStatementResp)that); - return false; - } - - public boolean equals(TExecuteStatementResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TExecuteStatementResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TExecuteStatementResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TExecuteStatementRespStandardSchemeFactory implements SchemeFactory { - public TExecuteStatementRespStandardScheme getScheme() { - return new TExecuteStatementRespStandardScheme(); - } - } - - private static class TExecuteStatementRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TExecuteStatementRespTupleSchemeFactory implements SchemeFactory { - public TExecuteStatementRespTupleScheme getScheme() { - return new TExecuteStatementRespTupleScheme(); - } - } - - private static class TExecuteStatementRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TExecuteStatementResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TFetchOrientation.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TFetchOrientation.java deleted file mode 100644 index 159be45259434..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TFetchOrientation.java +++ /dev/null @@ -1,57 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TFetchOrientation implements org.apache.thrift.TEnum { - FETCH_NEXT(0), - FETCH_PRIOR(1), - FETCH_RELATIVE(2), - FETCH_ABSOLUTE(3), - FETCH_FIRST(4), - FETCH_LAST(5); - - private final int value; - - private TFetchOrientation(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TFetchOrientation findByValue(int value) { - switch (value) { - case 0: - return FETCH_NEXT; - case 1: - return FETCH_PRIOR; - case 2: - return FETCH_RELATIVE; - case 3: - return FETCH_ABSOLUTE; - case 4: - return FETCH_FIRST; - case 5: - return FETCH_LAST; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TFetchResultsReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TFetchResultsReq.java deleted file mode 100644 index 2c93339d0c68b..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TFetchResultsReq.java +++ /dev/null @@ -1,714 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TFetchResultsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsReq"); - - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField ORIENTATION_FIELD_DESC = new org.apache.thrift.protocol.TField("orientation", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField MAX_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("maxRows", org.apache.thrift.protocol.TType.I64, (short)3); - private static final org.apache.thrift.protocol.TField FETCH_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("fetchType", org.apache.thrift.protocol.TType.I16, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFetchResultsReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFetchResultsReqTupleSchemeFactory()); - } - - private TOperationHandle operationHandle; // required - private TFetchOrientation orientation; // required - private long maxRows; // required - private short fetchType; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OPERATION_HANDLE((short)1, "operationHandle"), - /** - * - * @see TFetchOrientation - */ - ORIENTATION((short)2, "orientation"), - MAX_ROWS((short)3, "maxRows"), - FETCH_TYPE((short)4, "fetchType"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_HANDLE - return OPERATION_HANDLE; - case 2: // ORIENTATION - return ORIENTATION; - case 3: // MAX_ROWS - return MAX_ROWS; - case 4: // FETCH_TYPE - return FETCH_TYPE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __MAXROWS_ISSET_ID = 0; - private static final int __FETCHTYPE_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.FETCH_TYPE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - tmpMap.put(_Fields.ORIENTATION, new org.apache.thrift.meta_data.FieldMetaData("orientation", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TFetchOrientation.class))); - tmpMap.put(_Fields.MAX_ROWS, new org.apache.thrift.meta_data.FieldMetaData("maxRows", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.FETCH_TYPE, new org.apache.thrift.meta_data.FieldMetaData("fetchType", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsReq.class, metaDataMap); - } - - public TFetchResultsReq() { - this.orientation = org.apache.hive.service.rpc.thrift.TFetchOrientation.FETCH_NEXT; - - this.fetchType = (short)0; - - } - - public TFetchResultsReq( - TOperationHandle operationHandle, - TFetchOrientation orientation, - long maxRows) - { - this(); - this.operationHandle = operationHandle; - this.orientation = orientation; - this.maxRows = maxRows; - setMaxRowsIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TFetchResultsReq(TFetchResultsReq other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - if (other.isSetOrientation()) { - this.orientation = other.orientation; - } - this.maxRows = other.maxRows; - this.fetchType = other.fetchType; - } - - public TFetchResultsReq deepCopy() { - return new TFetchResultsReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - this.orientation = org.apache.hive.service.rpc.thrift.TFetchOrientation.FETCH_NEXT; - - setMaxRowsIsSet(false); - this.maxRows = 0; - this.fetchType = (short)0; - - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - /** - * - * @see TFetchOrientation - */ - public TFetchOrientation getOrientation() { - return this.orientation; - } - - /** - * - * @see TFetchOrientation - */ - public void setOrientation(TFetchOrientation orientation) { - this.orientation = orientation; - } - - public void unsetOrientation() { - this.orientation = null; - } - - /** Returns true if field orientation is set (has been assigned a value) and false otherwise */ - public boolean isSetOrientation() { - return this.orientation != null; - } - - public void setOrientationIsSet(boolean value) { - if (!value) { - this.orientation = null; - } - } - - public long getMaxRows() { - return this.maxRows; - } - - public void setMaxRows(long maxRows) { - this.maxRows = maxRows; - setMaxRowsIsSet(true); - } - - public void unsetMaxRows() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MAXROWS_ISSET_ID); - } - - /** Returns true if field maxRows is set (has been assigned a value) and false otherwise */ - public boolean isSetMaxRows() { - return EncodingUtils.testBit(__isset_bitfield, __MAXROWS_ISSET_ID); - } - - public void setMaxRowsIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MAXROWS_ISSET_ID, value); - } - - public short getFetchType() { - return this.fetchType; - } - - public void setFetchType(short fetchType) { - this.fetchType = fetchType; - setFetchTypeIsSet(true); - } - - public void unsetFetchType() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); - } - - /** Returns true if field fetchType is set (has been assigned a value) and false otherwise */ - public boolean isSetFetchType() { - return EncodingUtils.testBit(__isset_bitfield, __FETCHTYPE_ISSET_ID); - } - - public void setFetchTypeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FETCHTYPE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - case ORIENTATION: - if (value == null) { - unsetOrientation(); - } else { - setOrientation((TFetchOrientation)value); - } - break; - - case MAX_ROWS: - if (value == null) { - unsetMaxRows(); - } else { - setMaxRows((Long)value); - } - break; - - case FETCH_TYPE: - if (value == null) { - unsetFetchType(); - } else { - setFetchType((Short)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - case ORIENTATION: - return getOrientation(); - - case MAX_ROWS: - return getMaxRows(); - - case FETCH_TYPE: - return getFetchType(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - case ORIENTATION: - return isSetOrientation(); - case MAX_ROWS: - return isSetMaxRows(); - case FETCH_TYPE: - return isSetFetchType(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TFetchResultsReq) - return this.equals((TFetchResultsReq)that); - return false; - } - - public boolean equals(TFetchResultsReq that) { - if (that == null) - return false; - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - boolean this_present_orientation = true && this.isSetOrientation(); - boolean that_present_orientation = true && that.isSetOrientation(); - if (this_present_orientation || that_present_orientation) { - if (!(this_present_orientation && that_present_orientation)) - return false; - if (!this.orientation.equals(that.orientation)) - return false; - } - - boolean this_present_maxRows = true; - boolean that_present_maxRows = true; - if (this_present_maxRows || that_present_maxRows) { - if (!(this_present_maxRows && that_present_maxRows)) - return false; - if (this.maxRows != that.maxRows) - return false; - } - - boolean this_present_fetchType = true && this.isSetFetchType(); - boolean that_present_fetchType = true && that.isSetFetchType(); - if (this_present_fetchType || that_present_fetchType) { - if (!(this_present_fetchType && that_present_fetchType)) - return false; - if (this.fetchType != that.fetchType) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - boolean present_orientation = true && (isSetOrientation()); - list.add(present_orientation); - if (present_orientation) - list.add(orientation.getValue()); - - boolean present_maxRows = true; - list.add(present_maxRows); - if (present_maxRows) - list.add(maxRows); - - boolean present_fetchType = true && (isSetFetchType()); - list.add(present_fetchType); - if (present_fetchType) - list.add(fetchType); - - return list.hashCode(); - } - - @Override - public int compareTo(TFetchResultsReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOrientation()).compareTo(other.isSetOrientation()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOrientation()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.orientation, other.orientation); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetMaxRows()).compareTo(other.isSetMaxRows()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetMaxRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.maxRows, other.maxRows); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFetchType()).compareTo(other.isSetFetchType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFetchType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fetchType, other.fetchType); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFetchResultsReq("); - boolean first = true; - - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("orientation:"); - if (this.orientation == null) { - sb.append("null"); - } else { - sb.append(this.orientation); - } - first = false; - if (!first) sb.append(", "); - sb.append("maxRows:"); - sb.append(this.maxRows); - first = false; - if (isSetFetchType()) { - if (!first) sb.append(", "); - sb.append("fetchType:"); - sb.append(this.fetchType); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - if (!isSetOrientation()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'orientation' is unset! Struct:" + toString()); - } - - if (!isSetMaxRows()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'maxRows' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TFetchResultsReqStandardSchemeFactory implements SchemeFactory { - public TFetchResultsReqStandardScheme getScheme() { - return new TFetchResultsReqStandardScheme(); - } - } - - private static class TFetchResultsReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // ORIENTATION - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.orientation = org.apache.hive.service.rpc.thrift.TFetchOrientation.findByValue(iprot.readI32()); - struct.setOrientationIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // MAX_ROWS - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.maxRows = iprot.readI64(); - struct.setMaxRowsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // FETCH_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.fetchType = iprot.readI16(); - struct.setFetchTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchResultsReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.orientation != null) { - oprot.writeFieldBegin(ORIENTATION_FIELD_DESC); - oprot.writeI32(struct.orientation.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(MAX_ROWS_FIELD_DESC); - oprot.writeI64(struct.maxRows); - oprot.writeFieldEnd(); - if (struct.isSetFetchType()) { - oprot.writeFieldBegin(FETCH_TYPE_FIELD_DESC); - oprot.writeI16(struct.fetchType); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TFetchResultsReqTupleSchemeFactory implements SchemeFactory { - public TFetchResultsReqTupleScheme getScheme() { - return new TFetchResultsReqTupleScheme(); - } - } - - private static class TFetchResultsReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.operationHandle.write(oprot); - oprot.writeI32(struct.orientation.getValue()); - oprot.writeI64(struct.maxRows); - BitSet optionals = new BitSet(); - if (struct.isSetFetchType()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetFetchType()) { - oprot.writeI16(struct.fetchType); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - struct.orientation = org.apache.hive.service.rpc.thrift.TFetchOrientation.findByValue(iprot.readI32()); - struct.setOrientationIsSet(true); - struct.maxRows = iprot.readI64(); - struct.setMaxRowsIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.fetchType = iprot.readI16(); - struct.setFetchTypeIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TFetchResultsResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TFetchResultsResp.java deleted file mode 100644 index 8f86cee3ad468..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TFetchResultsResp.java +++ /dev/null @@ -1,612 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TFetchResultsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TFetchResultsResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField HAS_MORE_ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("hasMoreRows", org.apache.thrift.protocol.TType.BOOL, (short)2); - private static final org.apache.thrift.protocol.TField RESULTS_FIELD_DESC = new org.apache.thrift.protocol.TField("results", org.apache.thrift.protocol.TType.STRUCT, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TFetchResultsRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TFetchResultsRespTupleSchemeFactory()); - } - - private TStatus status; // required - private boolean hasMoreRows; // optional - private TRowSet results; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - HAS_MORE_ROWS((short)2, "hasMoreRows"), - RESULTS((short)3, "results"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // HAS_MORE_ROWS - return HAS_MORE_ROWS; - case 3: // RESULTS - return RESULTS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __HASMOREROWS_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.HAS_MORE_ROWS,_Fields.RESULTS}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.HAS_MORE_ROWS, new org.apache.thrift.meta_data.FieldMetaData("hasMoreRows", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.RESULTS, new org.apache.thrift.meta_data.FieldMetaData("results", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRowSet.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TFetchResultsResp.class, metaDataMap); - } - - public TFetchResultsResp() { - } - - public TFetchResultsResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TFetchResultsResp(TFetchResultsResp other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - this.hasMoreRows = other.hasMoreRows; - if (other.isSetResults()) { - this.results = new TRowSet(other.results); - } - } - - public TFetchResultsResp deepCopy() { - return new TFetchResultsResp(this); - } - - @Override - public void clear() { - this.status = null; - setHasMoreRowsIsSet(false); - this.hasMoreRows = false; - this.results = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public boolean isHasMoreRows() { - return this.hasMoreRows; - } - - public void setHasMoreRows(boolean hasMoreRows) { - this.hasMoreRows = hasMoreRows; - setHasMoreRowsIsSet(true); - } - - public void unsetHasMoreRows() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); - } - - /** Returns true if field hasMoreRows is set (has been assigned a value) and false otherwise */ - public boolean isSetHasMoreRows() { - return EncodingUtils.testBit(__isset_bitfield, __HASMOREROWS_ISSET_ID); - } - - public void setHasMoreRowsIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASMOREROWS_ISSET_ID, value); - } - - public TRowSet getResults() { - return this.results; - } - - public void setResults(TRowSet results) { - this.results = results; - } - - public void unsetResults() { - this.results = null; - } - - /** Returns true if field results is set (has been assigned a value) and false otherwise */ - public boolean isSetResults() { - return this.results != null; - } - - public void setResultsIsSet(boolean value) { - if (!value) { - this.results = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case HAS_MORE_ROWS: - if (value == null) { - unsetHasMoreRows(); - } else { - setHasMoreRows((Boolean)value); - } - break; - - case RESULTS: - if (value == null) { - unsetResults(); - } else { - setResults((TRowSet)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case HAS_MORE_ROWS: - return isHasMoreRows(); - - case RESULTS: - return getResults(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case HAS_MORE_ROWS: - return isSetHasMoreRows(); - case RESULTS: - return isSetResults(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TFetchResultsResp) - return this.equals((TFetchResultsResp)that); - return false; - } - - public boolean equals(TFetchResultsResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_hasMoreRows = true && this.isSetHasMoreRows(); - boolean that_present_hasMoreRows = true && that.isSetHasMoreRows(); - if (this_present_hasMoreRows || that_present_hasMoreRows) { - if (!(this_present_hasMoreRows && that_present_hasMoreRows)) - return false; - if (this.hasMoreRows != that.hasMoreRows) - return false; - } - - boolean this_present_results = true && this.isSetResults(); - boolean that_present_results = true && that.isSetResults(); - if (this_present_results || that_present_results) { - if (!(this_present_results && that_present_results)) - return false; - if (!this.results.equals(that.results)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_hasMoreRows = true && (isSetHasMoreRows()); - list.add(present_hasMoreRows); - if (present_hasMoreRows) - list.add(hasMoreRows); - - boolean present_results = true && (isSetResults()); - list.add(present_results); - if (present_results) - list.add(results); - - return list.hashCode(); - } - - @Override - public int compareTo(TFetchResultsResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetHasMoreRows()).compareTo(other.isSetHasMoreRows()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHasMoreRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasMoreRows, other.hasMoreRows); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetResults()).compareTo(other.isSetResults()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetResults()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.results, other.results); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TFetchResultsResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetHasMoreRows()) { - if (!first) sb.append(", "); - sb.append("hasMoreRows:"); - sb.append(this.hasMoreRows); - first = false; - } - if (isSetResults()) { - if (!first) sb.append(", "); - sb.append("results:"); - if (this.results == null) { - sb.append("null"); - } else { - sb.append(this.results); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (results != null) { - results.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TFetchResultsRespStandardSchemeFactory implements SchemeFactory { - public TFetchResultsRespStandardScheme getScheme() { - return new TFetchResultsRespStandardScheme(); - } - } - - private static class TFetchResultsRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TFetchResultsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // HAS_MORE_ROWS - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.hasMoreRows = iprot.readBool(); - struct.setHasMoreRowsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // RESULTS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.results = new TRowSet(); - struct.results.read(iprot); - struct.setResultsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TFetchResultsResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.isSetHasMoreRows()) { - oprot.writeFieldBegin(HAS_MORE_ROWS_FIELD_DESC); - oprot.writeBool(struct.hasMoreRows); - oprot.writeFieldEnd(); - } - if (struct.results != null) { - if (struct.isSetResults()) { - oprot.writeFieldBegin(RESULTS_FIELD_DESC); - struct.results.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TFetchResultsRespTupleSchemeFactory implements SchemeFactory { - public TFetchResultsRespTupleScheme getScheme() { - return new TFetchResultsRespTupleScheme(); - } - } - - private static class TFetchResultsRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetHasMoreRows()) { - optionals.set(0); - } - if (struct.isSetResults()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetHasMoreRows()) { - oprot.writeBool(struct.hasMoreRows); - } - if (struct.isSetResults()) { - struct.results.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TFetchResultsResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.hasMoreRows = iprot.readBool(); - struct.setHasMoreRowsIsSet(true); - } - if (incoming.get(1)) { - struct.results = new TRowSet(); - struct.results.read(iprot); - struct.setResultsIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetCatalogsReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetCatalogsReq.java deleted file mode 100644 index b8a2ca6648069..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetCatalogsReq.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetCatalogsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetCatalogsReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetCatalogsReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsReq.class, metaDataMap); - } - - public TGetCatalogsReq() { - } - - public TGetCatalogsReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetCatalogsReq(TGetCatalogsReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - } - - public TGetCatalogsReq deepCopy() { - return new TGetCatalogsReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetCatalogsReq) - return this.equals((TGetCatalogsReq)that); - return false; - } - - public boolean equals(TGetCatalogsReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetCatalogsReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetCatalogsReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetCatalogsReqStandardSchemeFactory implements SchemeFactory { - public TGetCatalogsReqStandardScheme getScheme() { - return new TGetCatalogsReqStandardScheme(); - } - } - - private static class TGetCatalogsReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetCatalogsReqTupleSchemeFactory implements SchemeFactory { - public TGetCatalogsReqTupleScheme getScheme() { - return new TGetCatalogsReqTupleScheme(); - } - } - - private static class TGetCatalogsReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetCatalogsResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetCatalogsResp.java deleted file mode 100644 index eeeac9a1f9292..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetCatalogsResp.java +++ /dev/null @@ -1,509 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetCatalogsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCatalogsResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetCatalogsRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetCatalogsRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCatalogsResp.class, metaDataMap); - } - - public TGetCatalogsResp() { - } - - public TGetCatalogsResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetCatalogsResp(TGetCatalogsResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetCatalogsResp deepCopy() { - return new TGetCatalogsResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetCatalogsResp) - return this.equals((TGetCatalogsResp)that); - return false; - } - - public boolean equals(TGetCatalogsResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetCatalogsResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetCatalogsResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetCatalogsRespStandardSchemeFactory implements SchemeFactory { - public TGetCatalogsRespStandardScheme getScheme() { - return new TGetCatalogsRespStandardScheme(); - } - } - - private static class TGetCatalogsRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetCatalogsRespTupleSchemeFactory implements SchemeFactory { - public TGetCatalogsRespTupleScheme getScheme() { - return new TGetCatalogsRespTupleScheme(); - } - } - - private static class TGetCatalogsRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetCatalogsResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetColumnsReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetColumnsReq.java deleted file mode 100644 index ba80279294957..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetColumnsReq.java +++ /dev/null @@ -1,822 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetColumnsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField COLUMN_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("columnName", org.apache.thrift.protocol.TType.STRING, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetColumnsReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetColumnsReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - private String tableName; // optional - private String columnName; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"), - TABLE_NAME((short)4, "tableName"), - COLUMN_NAME((short)5, "columnName"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - case 4: // TABLE_NAME - return TABLE_NAME; - case 5: // COLUMN_NAME - return COLUMN_NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.COLUMN_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.COLUMN_NAME, new org.apache.thrift.meta_data.FieldMetaData("columnName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsReq.class, metaDataMap); - } - - public TGetColumnsReq() { - } - - public TGetColumnsReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetColumnsReq(TGetColumnsReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - if (other.isSetTableName()) { - this.tableName = other.tableName; - } - if (other.isSetColumnName()) { - this.columnName = other.columnName; - } - } - - public TGetColumnsReq deepCopy() { - return new TGetColumnsReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - this.tableName = null; - this.columnName = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - public String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - public String getTableName() { - return this.tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public void unsetTableName() { - this.tableName = null; - } - - /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ - public boolean isSetTableName() { - return this.tableName != null; - } - - public void setTableNameIsSet(boolean value) { - if (!value) { - this.tableName = null; - } - } - - public String getColumnName() { - return this.columnName; - } - - public void setColumnName(String columnName) { - this.columnName = columnName; - } - - public void unsetColumnName() { - this.columnName = null; - } - - /** Returns true if field columnName is set (has been assigned a value) and false otherwise */ - public boolean isSetColumnName() { - return this.columnName != null; - } - - public void setColumnNameIsSet(boolean value) { - if (!value) { - this.columnName = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((String)value); - } - break; - - case TABLE_NAME: - if (value == null) { - unsetTableName(); - } else { - setTableName((String)value); - } - break; - - case COLUMN_NAME: - if (value == null) { - unsetColumnName(); - } else { - setColumnName((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - case TABLE_NAME: - return getTableName(); - - case COLUMN_NAME: - return getColumnName(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - case TABLE_NAME: - return isSetTableName(); - case COLUMN_NAME: - return isSetColumnName(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetColumnsReq) - return this.equals((TGetColumnsReq)that); - return false; - } - - public boolean equals(TGetColumnsReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - boolean this_present_tableName = true && this.isSetTableName(); - boolean that_present_tableName = true && that.isSetTableName(); - if (this_present_tableName || that_present_tableName) { - if (!(this_present_tableName && that_present_tableName)) - return false; - if (!this.tableName.equals(that.tableName)) - return false; - } - - boolean this_present_columnName = true && this.isSetColumnName(); - boolean that_present_columnName = true && that.isSetColumnName(); - if (this_present_columnName || that_present_columnName) { - if (!(this_present_columnName && that_present_columnName)) - return false; - if (!this.columnName.equals(that.columnName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_catalogName = true && (isSetCatalogName()); - list.add(present_catalogName); - if (present_catalogName) - list.add(catalogName); - - boolean present_schemaName = true && (isSetSchemaName()); - list.add(present_schemaName); - if (present_schemaName) - list.add(schemaName); - - boolean present_tableName = true && (isSetTableName()); - list.add(present_tableName); - if (present_tableName) - list.add(tableName); - - boolean present_columnName = true && (isSetColumnName()); - list.add(present_columnName); - if (present_columnName) - list.add(columnName); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetColumnsReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTableName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumnName()).compareTo(other.isSetColumnName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumnName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnName, other.columnName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetColumnsReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - if (isSetTableName()) { - if (!first) sb.append(", "); - sb.append("tableName:"); - if (this.tableName == null) { - sb.append("null"); - } else { - sb.append(this.tableName); - } - first = false; - } - if (isSetColumnName()) { - if (!first) sb.append(", "); - sb.append("columnName:"); - if (this.columnName == null) { - sb.append("null"); - } else { - sb.append(this.columnName); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetColumnsReqStandardSchemeFactory implements SchemeFactory { - public TGetColumnsReqStandardScheme getScheme() { - return new TGetColumnsReqStandardScheme(); - } - } - - private static class TGetColumnsReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // TABLE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // COLUMN_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.columnName = iprot.readString(); - struct.setColumnNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetColumnsReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - if (struct.tableName != null) { - if (struct.isSetTableName()) { - oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); - oprot.writeString(struct.tableName); - oprot.writeFieldEnd(); - } - } - if (struct.columnName != null) { - if (struct.isSetColumnName()) { - oprot.writeFieldBegin(COLUMN_NAME_FIELD_DESC); - oprot.writeString(struct.columnName); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetColumnsReqTupleSchemeFactory implements SchemeFactory { - public TGetColumnsReqTupleScheme getScheme() { - return new TGetColumnsReqTupleScheme(); - } - } - - private static class TGetColumnsReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - if (struct.isSetTableName()) { - optionals.set(2); - } - if (struct.isSetColumnName()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - if (struct.isSetTableName()) { - oprot.writeString(struct.tableName); - } - if (struct.isSetColumnName()) { - oprot.writeString(struct.columnName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - if (incoming.get(2)) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } - if (incoming.get(3)) { - struct.columnName = iprot.readString(); - struct.setColumnNameIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetColumnsResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetColumnsResp.java deleted file mode 100644 index c68aac9042fc1..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetColumnsResp.java +++ /dev/null @@ -1,509 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetColumnsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetColumnsResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetColumnsRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetColumnsRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetColumnsResp.class, metaDataMap); - } - - public TGetColumnsResp() { - } - - public TGetColumnsResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetColumnsResp(TGetColumnsResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetColumnsResp deepCopy() { - return new TGetColumnsResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetColumnsResp) - return this.equals((TGetColumnsResp)that); - return false; - } - - public boolean equals(TGetColumnsResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetColumnsResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetColumnsResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetColumnsRespStandardSchemeFactory implements SchemeFactory { - public TGetColumnsRespStandardScheme getScheme() { - return new TGetColumnsRespStandardScheme(); - } - } - - private static class TGetColumnsRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetColumnsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetColumnsResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetColumnsRespTupleSchemeFactory implements SchemeFactory { - public TGetColumnsRespTupleScheme getScheme() { - return new TGetColumnsRespTupleScheme(); - } - } - - private static class TGetColumnsRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetColumnsResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetCrossReferenceReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetCrossReferenceReq.java deleted file mode 100644 index 972957063b297..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetCrossReferenceReq.java +++ /dev/null @@ -1,1034 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetCrossReferenceReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCrossReferenceReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField PARENT_CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentCatalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField PARENT_SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentSchemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField PARENT_TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("parentTableName", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField FOREIGN_CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignCatalogName", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField FOREIGN_SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignSchemaName", org.apache.thrift.protocol.TType.STRING, (short)6); - private static final org.apache.thrift.protocol.TField FOREIGN_TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("foreignTableName", org.apache.thrift.protocol.TType.STRING, (short)7); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetCrossReferenceReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetCrossReferenceReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String parentCatalogName; // optional - private String parentSchemaName; // optional - private String parentTableName; // optional - private String foreignCatalogName; // optional - private String foreignSchemaName; // optional - private String foreignTableName; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - PARENT_CATALOG_NAME((short)2, "parentCatalogName"), - PARENT_SCHEMA_NAME((short)3, "parentSchemaName"), - PARENT_TABLE_NAME((short)4, "parentTableName"), - FOREIGN_CATALOG_NAME((short)5, "foreignCatalogName"), - FOREIGN_SCHEMA_NAME((short)6, "foreignSchemaName"), - FOREIGN_TABLE_NAME((short)7, "foreignTableName"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // PARENT_CATALOG_NAME - return PARENT_CATALOG_NAME; - case 3: // PARENT_SCHEMA_NAME - return PARENT_SCHEMA_NAME; - case 4: // PARENT_TABLE_NAME - return PARENT_TABLE_NAME; - case 5: // FOREIGN_CATALOG_NAME - return FOREIGN_CATALOG_NAME; - case 6: // FOREIGN_SCHEMA_NAME - return FOREIGN_SCHEMA_NAME; - case 7: // FOREIGN_TABLE_NAME - return FOREIGN_TABLE_NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.PARENT_CATALOG_NAME,_Fields.PARENT_SCHEMA_NAME,_Fields.PARENT_TABLE_NAME,_Fields.FOREIGN_CATALOG_NAME,_Fields.FOREIGN_SCHEMA_NAME,_Fields.FOREIGN_TABLE_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.PARENT_CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentCatalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.PARENT_SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentSchemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.PARENT_TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("parentTableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.FOREIGN_CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignCatalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.FOREIGN_SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignSchemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.FOREIGN_TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("foreignTableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCrossReferenceReq.class, metaDataMap); - } - - public TGetCrossReferenceReq() { - } - - public TGetCrossReferenceReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetCrossReferenceReq(TGetCrossReferenceReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetParentCatalogName()) { - this.parentCatalogName = other.parentCatalogName; - } - if (other.isSetParentSchemaName()) { - this.parentSchemaName = other.parentSchemaName; - } - if (other.isSetParentTableName()) { - this.parentTableName = other.parentTableName; - } - if (other.isSetForeignCatalogName()) { - this.foreignCatalogName = other.foreignCatalogName; - } - if (other.isSetForeignSchemaName()) { - this.foreignSchemaName = other.foreignSchemaName; - } - if (other.isSetForeignTableName()) { - this.foreignTableName = other.foreignTableName; - } - } - - public TGetCrossReferenceReq deepCopy() { - return new TGetCrossReferenceReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.parentCatalogName = null; - this.parentSchemaName = null; - this.parentTableName = null; - this.foreignCatalogName = null; - this.foreignSchemaName = null; - this.foreignTableName = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getParentCatalogName() { - return this.parentCatalogName; - } - - public void setParentCatalogName(String parentCatalogName) { - this.parentCatalogName = parentCatalogName; - } - - public void unsetParentCatalogName() { - this.parentCatalogName = null; - } - - /** Returns true if field parentCatalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetParentCatalogName() { - return this.parentCatalogName != null; - } - - public void setParentCatalogNameIsSet(boolean value) { - if (!value) { - this.parentCatalogName = null; - } - } - - public String getParentSchemaName() { - return this.parentSchemaName; - } - - public void setParentSchemaName(String parentSchemaName) { - this.parentSchemaName = parentSchemaName; - } - - public void unsetParentSchemaName() { - this.parentSchemaName = null; - } - - /** Returns true if field parentSchemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetParentSchemaName() { - return this.parentSchemaName != null; - } - - public void setParentSchemaNameIsSet(boolean value) { - if (!value) { - this.parentSchemaName = null; - } - } - - public String getParentTableName() { - return this.parentTableName; - } - - public void setParentTableName(String parentTableName) { - this.parentTableName = parentTableName; - } - - public void unsetParentTableName() { - this.parentTableName = null; - } - - /** Returns true if field parentTableName is set (has been assigned a value) and false otherwise */ - public boolean isSetParentTableName() { - return this.parentTableName != null; - } - - public void setParentTableNameIsSet(boolean value) { - if (!value) { - this.parentTableName = null; - } - } - - public String getForeignCatalogName() { - return this.foreignCatalogName; - } - - public void setForeignCatalogName(String foreignCatalogName) { - this.foreignCatalogName = foreignCatalogName; - } - - public void unsetForeignCatalogName() { - this.foreignCatalogName = null; - } - - /** Returns true if field foreignCatalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetForeignCatalogName() { - return this.foreignCatalogName != null; - } - - public void setForeignCatalogNameIsSet(boolean value) { - if (!value) { - this.foreignCatalogName = null; - } - } - - public String getForeignSchemaName() { - return this.foreignSchemaName; - } - - public void setForeignSchemaName(String foreignSchemaName) { - this.foreignSchemaName = foreignSchemaName; - } - - public void unsetForeignSchemaName() { - this.foreignSchemaName = null; - } - - /** Returns true if field foreignSchemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetForeignSchemaName() { - return this.foreignSchemaName != null; - } - - public void setForeignSchemaNameIsSet(boolean value) { - if (!value) { - this.foreignSchemaName = null; - } - } - - public String getForeignTableName() { - return this.foreignTableName; - } - - public void setForeignTableName(String foreignTableName) { - this.foreignTableName = foreignTableName; - } - - public void unsetForeignTableName() { - this.foreignTableName = null; - } - - /** Returns true if field foreignTableName is set (has been assigned a value) and false otherwise */ - public boolean isSetForeignTableName() { - return this.foreignTableName != null; - } - - public void setForeignTableNameIsSet(boolean value) { - if (!value) { - this.foreignTableName = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case PARENT_CATALOG_NAME: - if (value == null) { - unsetParentCatalogName(); - } else { - setParentCatalogName((String)value); - } - break; - - case PARENT_SCHEMA_NAME: - if (value == null) { - unsetParentSchemaName(); - } else { - setParentSchemaName((String)value); - } - break; - - case PARENT_TABLE_NAME: - if (value == null) { - unsetParentTableName(); - } else { - setParentTableName((String)value); - } - break; - - case FOREIGN_CATALOG_NAME: - if (value == null) { - unsetForeignCatalogName(); - } else { - setForeignCatalogName((String)value); - } - break; - - case FOREIGN_SCHEMA_NAME: - if (value == null) { - unsetForeignSchemaName(); - } else { - setForeignSchemaName((String)value); - } - break; - - case FOREIGN_TABLE_NAME: - if (value == null) { - unsetForeignTableName(); - } else { - setForeignTableName((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case PARENT_CATALOG_NAME: - return getParentCatalogName(); - - case PARENT_SCHEMA_NAME: - return getParentSchemaName(); - - case PARENT_TABLE_NAME: - return getParentTableName(); - - case FOREIGN_CATALOG_NAME: - return getForeignCatalogName(); - - case FOREIGN_SCHEMA_NAME: - return getForeignSchemaName(); - - case FOREIGN_TABLE_NAME: - return getForeignTableName(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case PARENT_CATALOG_NAME: - return isSetParentCatalogName(); - case PARENT_SCHEMA_NAME: - return isSetParentSchemaName(); - case PARENT_TABLE_NAME: - return isSetParentTableName(); - case FOREIGN_CATALOG_NAME: - return isSetForeignCatalogName(); - case FOREIGN_SCHEMA_NAME: - return isSetForeignSchemaName(); - case FOREIGN_TABLE_NAME: - return isSetForeignTableName(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetCrossReferenceReq) - return this.equals((TGetCrossReferenceReq)that); - return false; - } - - public boolean equals(TGetCrossReferenceReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_parentCatalogName = true && this.isSetParentCatalogName(); - boolean that_present_parentCatalogName = true && that.isSetParentCatalogName(); - if (this_present_parentCatalogName || that_present_parentCatalogName) { - if (!(this_present_parentCatalogName && that_present_parentCatalogName)) - return false; - if (!this.parentCatalogName.equals(that.parentCatalogName)) - return false; - } - - boolean this_present_parentSchemaName = true && this.isSetParentSchemaName(); - boolean that_present_parentSchemaName = true && that.isSetParentSchemaName(); - if (this_present_parentSchemaName || that_present_parentSchemaName) { - if (!(this_present_parentSchemaName && that_present_parentSchemaName)) - return false; - if (!this.parentSchemaName.equals(that.parentSchemaName)) - return false; - } - - boolean this_present_parentTableName = true && this.isSetParentTableName(); - boolean that_present_parentTableName = true && that.isSetParentTableName(); - if (this_present_parentTableName || that_present_parentTableName) { - if (!(this_present_parentTableName && that_present_parentTableName)) - return false; - if (!this.parentTableName.equals(that.parentTableName)) - return false; - } - - boolean this_present_foreignCatalogName = true && this.isSetForeignCatalogName(); - boolean that_present_foreignCatalogName = true && that.isSetForeignCatalogName(); - if (this_present_foreignCatalogName || that_present_foreignCatalogName) { - if (!(this_present_foreignCatalogName && that_present_foreignCatalogName)) - return false; - if (!this.foreignCatalogName.equals(that.foreignCatalogName)) - return false; - } - - boolean this_present_foreignSchemaName = true && this.isSetForeignSchemaName(); - boolean that_present_foreignSchemaName = true && that.isSetForeignSchemaName(); - if (this_present_foreignSchemaName || that_present_foreignSchemaName) { - if (!(this_present_foreignSchemaName && that_present_foreignSchemaName)) - return false; - if (!this.foreignSchemaName.equals(that.foreignSchemaName)) - return false; - } - - boolean this_present_foreignTableName = true && this.isSetForeignTableName(); - boolean that_present_foreignTableName = true && that.isSetForeignTableName(); - if (this_present_foreignTableName || that_present_foreignTableName) { - if (!(this_present_foreignTableName && that_present_foreignTableName)) - return false; - if (!this.foreignTableName.equals(that.foreignTableName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_parentCatalogName = true && (isSetParentCatalogName()); - list.add(present_parentCatalogName); - if (present_parentCatalogName) - list.add(parentCatalogName); - - boolean present_parentSchemaName = true && (isSetParentSchemaName()); - list.add(present_parentSchemaName); - if (present_parentSchemaName) - list.add(parentSchemaName); - - boolean present_parentTableName = true && (isSetParentTableName()); - list.add(present_parentTableName); - if (present_parentTableName) - list.add(parentTableName); - - boolean present_foreignCatalogName = true && (isSetForeignCatalogName()); - list.add(present_foreignCatalogName); - if (present_foreignCatalogName) - list.add(foreignCatalogName); - - boolean present_foreignSchemaName = true && (isSetForeignSchemaName()); - list.add(present_foreignSchemaName); - if (present_foreignSchemaName) - list.add(foreignSchemaName); - - boolean present_foreignTableName = true && (isSetForeignTableName()); - list.add(present_foreignTableName); - if (present_foreignTableName) - list.add(foreignTableName); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetCrossReferenceReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetParentCatalogName()).compareTo(other.isSetParentCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetParentCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentCatalogName, other.parentCatalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetParentSchemaName()).compareTo(other.isSetParentSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetParentSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentSchemaName, other.parentSchemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetParentTableName()).compareTo(other.isSetParentTableName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetParentTableName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentTableName, other.parentTableName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetForeignCatalogName()).compareTo(other.isSetForeignCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetForeignCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.foreignCatalogName, other.foreignCatalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetForeignSchemaName()).compareTo(other.isSetForeignSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetForeignSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.foreignSchemaName, other.foreignSchemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetForeignTableName()).compareTo(other.isSetForeignTableName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetForeignTableName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.foreignTableName, other.foreignTableName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetCrossReferenceReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetParentCatalogName()) { - if (!first) sb.append(", "); - sb.append("parentCatalogName:"); - if (this.parentCatalogName == null) { - sb.append("null"); - } else { - sb.append(this.parentCatalogName); - } - first = false; - } - if (isSetParentSchemaName()) { - if (!first) sb.append(", "); - sb.append("parentSchemaName:"); - if (this.parentSchemaName == null) { - sb.append("null"); - } else { - sb.append(this.parentSchemaName); - } - first = false; - } - if (isSetParentTableName()) { - if (!first) sb.append(", "); - sb.append("parentTableName:"); - if (this.parentTableName == null) { - sb.append("null"); - } else { - sb.append(this.parentTableName); - } - first = false; - } - if (isSetForeignCatalogName()) { - if (!first) sb.append(", "); - sb.append("foreignCatalogName:"); - if (this.foreignCatalogName == null) { - sb.append("null"); - } else { - sb.append(this.foreignCatalogName); - } - first = false; - } - if (isSetForeignSchemaName()) { - if (!first) sb.append(", "); - sb.append("foreignSchemaName:"); - if (this.foreignSchemaName == null) { - sb.append("null"); - } else { - sb.append(this.foreignSchemaName); - } - first = false; - } - if (isSetForeignTableName()) { - if (!first) sb.append(", "); - sb.append("foreignTableName:"); - if (this.foreignTableName == null) { - sb.append("null"); - } else { - sb.append(this.foreignTableName); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetCrossReferenceReqStandardSchemeFactory implements SchemeFactory { - public TGetCrossReferenceReqStandardScheme getScheme() { - return new TGetCrossReferenceReqStandardScheme(); - } - } - - private static class TGetCrossReferenceReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // PARENT_CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.parentCatalogName = iprot.readString(); - struct.setParentCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PARENT_SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.parentSchemaName = iprot.readString(); - struct.setParentSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // PARENT_TABLE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.parentTableName = iprot.readString(); - struct.setParentTableNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // FOREIGN_CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.foreignCatalogName = iprot.readString(); - struct.setForeignCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // FOREIGN_SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.foreignSchemaName = iprot.readString(); - struct.setForeignSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // FOREIGN_TABLE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.foreignTableName = iprot.readString(); - struct.setForeignTableNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.parentCatalogName != null) { - if (struct.isSetParentCatalogName()) { - oprot.writeFieldBegin(PARENT_CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.parentCatalogName); - oprot.writeFieldEnd(); - } - } - if (struct.parentSchemaName != null) { - if (struct.isSetParentSchemaName()) { - oprot.writeFieldBegin(PARENT_SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.parentSchemaName); - oprot.writeFieldEnd(); - } - } - if (struct.parentTableName != null) { - if (struct.isSetParentTableName()) { - oprot.writeFieldBegin(PARENT_TABLE_NAME_FIELD_DESC); - oprot.writeString(struct.parentTableName); - oprot.writeFieldEnd(); - } - } - if (struct.foreignCatalogName != null) { - if (struct.isSetForeignCatalogName()) { - oprot.writeFieldBegin(FOREIGN_CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.foreignCatalogName); - oprot.writeFieldEnd(); - } - } - if (struct.foreignSchemaName != null) { - if (struct.isSetForeignSchemaName()) { - oprot.writeFieldBegin(FOREIGN_SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.foreignSchemaName); - oprot.writeFieldEnd(); - } - } - if (struct.foreignTableName != null) { - if (struct.isSetForeignTableName()) { - oprot.writeFieldBegin(FOREIGN_TABLE_NAME_FIELD_DESC); - oprot.writeString(struct.foreignTableName); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetCrossReferenceReqTupleSchemeFactory implements SchemeFactory { - public TGetCrossReferenceReqTupleScheme getScheme() { - return new TGetCrossReferenceReqTupleScheme(); - } - } - - private static class TGetCrossReferenceReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetParentCatalogName()) { - optionals.set(0); - } - if (struct.isSetParentSchemaName()) { - optionals.set(1); - } - if (struct.isSetParentTableName()) { - optionals.set(2); - } - if (struct.isSetForeignCatalogName()) { - optionals.set(3); - } - if (struct.isSetForeignSchemaName()) { - optionals.set(4); - } - if (struct.isSetForeignTableName()) { - optionals.set(5); - } - oprot.writeBitSet(optionals, 6); - if (struct.isSetParentCatalogName()) { - oprot.writeString(struct.parentCatalogName); - } - if (struct.isSetParentSchemaName()) { - oprot.writeString(struct.parentSchemaName); - } - if (struct.isSetParentTableName()) { - oprot.writeString(struct.parentTableName); - } - if (struct.isSetForeignCatalogName()) { - oprot.writeString(struct.foreignCatalogName); - } - if (struct.isSetForeignSchemaName()) { - oprot.writeString(struct.foreignSchemaName); - } - if (struct.isSetForeignTableName()) { - oprot.writeString(struct.foreignTableName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(6); - if (incoming.get(0)) { - struct.parentCatalogName = iprot.readString(); - struct.setParentCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.parentSchemaName = iprot.readString(); - struct.setParentSchemaNameIsSet(true); - } - if (incoming.get(2)) { - struct.parentTableName = iprot.readString(); - struct.setParentTableNameIsSet(true); - } - if (incoming.get(3)) { - struct.foreignCatalogName = iprot.readString(); - struct.setForeignCatalogNameIsSet(true); - } - if (incoming.get(4)) { - struct.foreignSchemaName = iprot.readString(); - struct.setForeignSchemaNameIsSet(true); - } - if (incoming.get(5)) { - struct.foreignTableName = iprot.readString(); - struct.setForeignTableNameIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetCrossReferenceResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetCrossReferenceResp.java deleted file mode 100644 index 1bfe6d192df06..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetCrossReferenceResp.java +++ /dev/null @@ -1,509 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetCrossReferenceResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetCrossReferenceResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetCrossReferenceRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetCrossReferenceRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetCrossReferenceResp.class, metaDataMap); - } - - public TGetCrossReferenceResp() { - } - - public TGetCrossReferenceResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetCrossReferenceResp(TGetCrossReferenceResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetCrossReferenceResp deepCopy() { - return new TGetCrossReferenceResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetCrossReferenceResp) - return this.equals((TGetCrossReferenceResp)that); - return false; - } - - public boolean equals(TGetCrossReferenceResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetCrossReferenceResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetCrossReferenceResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetCrossReferenceRespStandardSchemeFactory implements SchemeFactory { - public TGetCrossReferenceRespStandardScheme getScheme() { - return new TGetCrossReferenceRespStandardScheme(); - } - } - - private static class TGetCrossReferenceRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetCrossReferenceRespTupleSchemeFactory implements SchemeFactory { - public TGetCrossReferenceRespTupleScheme getScheme() { - return new TGetCrossReferenceRespTupleScheme(); - } - } - - private static class TGetCrossReferenceRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetCrossReferenceResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetDelegationTokenReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetDelegationTokenReq.java deleted file mode 100644 index e3e28c5860522..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetDelegationTokenReq.java +++ /dev/null @@ -1,596 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OWNER_FIELD_DESC = new org.apache.thrift.protocol.TField("owner", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField RENEWER_FIELD_DESC = new org.apache.thrift.protocol.TField("renewer", org.apache.thrift.protocol.TType.STRING, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetDelegationTokenReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetDelegationTokenReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String owner; // required - private String renewer; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - OWNER((short)2, "owner"), - RENEWER((short)3, "renewer"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // OWNER - return OWNER; - case 3: // RENEWER - return RENEWER; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.OWNER, new org.apache.thrift.meta_data.FieldMetaData("owner", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.RENEWER, new org.apache.thrift.meta_data.FieldMetaData("renewer", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenReq.class, metaDataMap); - } - - public TGetDelegationTokenReq() { - } - - public TGetDelegationTokenReq( - TSessionHandle sessionHandle, - String owner, - String renewer) - { - this(); - this.sessionHandle = sessionHandle; - this.owner = owner; - this.renewer = renewer; - } - - /** - * Performs a deep copy on other. - */ - public TGetDelegationTokenReq(TGetDelegationTokenReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetOwner()) { - this.owner = other.owner; - } - if (other.isSetRenewer()) { - this.renewer = other.renewer; - } - } - - public TGetDelegationTokenReq deepCopy() { - return new TGetDelegationTokenReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.owner = null; - this.renewer = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getOwner() { - return this.owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public void unsetOwner() { - this.owner = null; - } - - /** Returns true if field owner is set (has been assigned a value) and false otherwise */ - public boolean isSetOwner() { - return this.owner != null; - } - - public void setOwnerIsSet(boolean value) { - if (!value) { - this.owner = null; - } - } - - public String getRenewer() { - return this.renewer; - } - - public void setRenewer(String renewer) { - this.renewer = renewer; - } - - public void unsetRenewer() { - this.renewer = null; - } - - /** Returns true if field renewer is set (has been assigned a value) and false otherwise */ - public boolean isSetRenewer() { - return this.renewer != null; - } - - public void setRenewerIsSet(boolean value) { - if (!value) { - this.renewer = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case OWNER: - if (value == null) { - unsetOwner(); - } else { - setOwner((String)value); - } - break; - - case RENEWER: - if (value == null) { - unsetRenewer(); - } else { - setRenewer((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case OWNER: - return getOwner(); - - case RENEWER: - return getRenewer(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case OWNER: - return isSetOwner(); - case RENEWER: - return isSetRenewer(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetDelegationTokenReq) - return this.equals((TGetDelegationTokenReq)that); - return false; - } - - public boolean equals(TGetDelegationTokenReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_owner = true && this.isSetOwner(); - boolean that_present_owner = true && that.isSetOwner(); - if (this_present_owner || that_present_owner) { - if (!(this_present_owner && that_present_owner)) - return false; - if (!this.owner.equals(that.owner)) - return false; - } - - boolean this_present_renewer = true && this.isSetRenewer(); - boolean that_present_renewer = true && that.isSetRenewer(); - if (this_present_renewer || that_present_renewer) { - if (!(this_present_renewer && that_present_renewer)) - return false; - if (!this.renewer.equals(that.renewer)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_owner = true && (isSetOwner()); - list.add(present_owner); - if (present_owner) - list.add(owner); - - boolean present_renewer = true && (isSetRenewer()); - list.add(present_renewer); - if (present_renewer) - list.add(renewer); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetDelegationTokenReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOwner()).compareTo(other.isSetOwner()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOwner()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.owner, other.owner); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRenewer()).compareTo(other.isSetRenewer()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRenewer()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.renewer, other.renewer); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetDelegationTokenReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("owner:"); - if (this.owner == null) { - sb.append("null"); - } else { - sb.append(this.owner); - } - first = false; - if (!first) sb.append(", "); - sb.append("renewer:"); - if (this.renewer == null) { - sb.append("null"); - } else { - sb.append(this.renewer); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - if (!isSetOwner()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'owner' is unset! Struct:" + toString()); - } - - if (!isSetRenewer()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'renewer' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetDelegationTokenReqStandardSchemeFactory implements SchemeFactory { - public TGetDelegationTokenReqStandardScheme getScheme() { - return new TGetDelegationTokenReqStandardScheme(); - } - } - - private static class TGetDelegationTokenReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OWNER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.owner = iprot.readString(); - struct.setOwnerIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // RENEWER - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.renewer = iprot.readString(); - struct.setRenewerIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.owner != null) { - oprot.writeFieldBegin(OWNER_FIELD_DESC); - oprot.writeString(struct.owner); - oprot.writeFieldEnd(); - } - if (struct.renewer != null) { - oprot.writeFieldBegin(RENEWER_FIELD_DESC); - oprot.writeString(struct.renewer); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetDelegationTokenReqTupleSchemeFactory implements SchemeFactory { - public TGetDelegationTokenReqTupleScheme getScheme() { - return new TGetDelegationTokenReqTupleScheme(); - } - } - - private static class TGetDelegationTokenReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.owner); - oprot.writeString(struct.renewer); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.owner = iprot.readString(); - struct.setOwnerIsSet(true); - struct.renewer = iprot.readString(); - struct.setRenewerIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetDelegationTokenResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetDelegationTokenResp.java deleted file mode 100644 index 6ef2acbbd9435..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetDelegationTokenResp.java +++ /dev/null @@ -1,504 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetDelegationTokenResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetDelegationTokenRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetDelegationTokenRespTupleSchemeFactory()); - } - - private TStatus status; // required - private String delegationToken; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - DELEGATION_TOKEN((short)2, "delegationToken"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // DELEGATION_TOKEN - return DELEGATION_TOKEN; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.DELEGATION_TOKEN}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetDelegationTokenResp.class, metaDataMap); - } - - public TGetDelegationTokenResp() { - } - - public TGetDelegationTokenResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetDelegationTokenResp(TGetDelegationTokenResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetDelegationToken()) { - this.delegationToken = other.delegationToken; - } - } - - public TGetDelegationTokenResp deepCopy() { - return new TGetDelegationTokenResp(this); - } - - @Override - public void clear() { - this.status = null; - this.delegationToken = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public String getDelegationToken() { - return this.delegationToken; - } - - public void setDelegationToken(String delegationToken) { - this.delegationToken = delegationToken; - } - - public void unsetDelegationToken() { - this.delegationToken = null; - } - - /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ - public boolean isSetDelegationToken() { - return this.delegationToken != null; - } - - public void setDelegationTokenIsSet(boolean value) { - if (!value) { - this.delegationToken = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case DELEGATION_TOKEN: - if (value == null) { - unsetDelegationToken(); - } else { - setDelegationToken((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case DELEGATION_TOKEN: - return getDelegationToken(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case DELEGATION_TOKEN: - return isSetDelegationToken(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetDelegationTokenResp) - return this.equals((TGetDelegationTokenResp)that); - return false; - } - - public boolean equals(TGetDelegationTokenResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_delegationToken = true && this.isSetDelegationToken(); - boolean that_present_delegationToken = true && that.isSetDelegationToken(); - if (this_present_delegationToken || that_present_delegationToken) { - if (!(this_present_delegationToken && that_present_delegationToken)) - return false; - if (!this.delegationToken.equals(that.delegationToken)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_delegationToken = true && (isSetDelegationToken()); - list.add(present_delegationToken); - if (present_delegationToken) - list.add(delegationToken); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetDelegationTokenResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDelegationToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, other.delegationToken); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetDelegationTokenResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetDelegationToken()) { - if (!first) sb.append(", "); - sb.append("delegationToken:"); - if (this.delegationToken == null) { - sb.append("null"); - } else { - sb.append(this.delegationToken); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetDelegationTokenRespStandardSchemeFactory implements SchemeFactory { - public TGetDelegationTokenRespStandardScheme getScheme() { - return new TGetDelegationTokenRespStandardScheme(); - } - } - - private static class TGetDelegationTokenRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // DELEGATION_TOKEN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.delegationToken != null) { - if (struct.isSetDelegationToken()) { - oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); - oprot.writeString(struct.delegationToken); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetDelegationTokenRespTupleSchemeFactory implements SchemeFactory { - public TGetDelegationTokenRespTupleScheme getScheme() { - return new TGetDelegationTokenRespTupleScheme(); - } - } - - private static class TGetDelegationTokenRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetDelegationToken()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetDelegationToken()) { - oprot.writeString(struct.delegationToken); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetFunctionsReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetFunctionsReq.java deleted file mode 100644 index ad4f8a5b031e8..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetFunctionsReq.java +++ /dev/null @@ -1,711 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetFunctionsReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("functionName", org.apache.thrift.protocol.TType.STRING, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetFunctionsReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetFunctionsReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - private String functionName; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"), - FUNCTION_NAME((short)4, "functionName"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - case 4: // FUNCTION_NAME - return FUNCTION_NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData("functionName", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsReq.class, metaDataMap); - } - - public TGetFunctionsReq() { - } - - public TGetFunctionsReq( - TSessionHandle sessionHandle, - String functionName) - { - this(); - this.sessionHandle = sessionHandle; - this.functionName = functionName; - } - - /** - * Performs a deep copy on other. - */ - public TGetFunctionsReq(TGetFunctionsReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - if (other.isSetFunctionName()) { - this.functionName = other.functionName; - } - } - - public TGetFunctionsReq deepCopy() { - return new TGetFunctionsReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - this.functionName = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - public String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - public String getFunctionName() { - return this.functionName; - } - - public void setFunctionName(String functionName) { - this.functionName = functionName; - } - - public void unsetFunctionName() { - this.functionName = null; - } - - /** Returns true if field functionName is set (has been assigned a value) and false otherwise */ - public boolean isSetFunctionName() { - return this.functionName != null; - } - - public void setFunctionNameIsSet(boolean value) { - if (!value) { - this.functionName = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((String)value); - } - break; - - case FUNCTION_NAME: - if (value == null) { - unsetFunctionName(); - } else { - setFunctionName((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - case FUNCTION_NAME: - return getFunctionName(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - case FUNCTION_NAME: - return isSetFunctionName(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetFunctionsReq) - return this.equals((TGetFunctionsReq)that); - return false; - } - - public boolean equals(TGetFunctionsReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - boolean this_present_functionName = true && this.isSetFunctionName(); - boolean that_present_functionName = true && that.isSetFunctionName(); - if (this_present_functionName || that_present_functionName) { - if (!(this_present_functionName && that_present_functionName)) - return false; - if (!this.functionName.equals(that.functionName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_catalogName = true && (isSetCatalogName()); - list.add(present_catalogName); - if (present_catalogName) - list.add(catalogName); - - boolean present_schemaName = true && (isSetSchemaName()); - list.add(present_schemaName); - if (present_schemaName) - list.add(schemaName); - - boolean present_functionName = true && (isSetFunctionName()); - list.add(present_functionName); - if (present_functionName) - list.add(functionName); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetFunctionsReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFunctionName()).compareTo(other.isSetFunctionName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFunctionName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.functionName, other.functionName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetFunctionsReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - if (!first) sb.append(", "); - sb.append("functionName:"); - if (this.functionName == null) { - sb.append("null"); - } else { - sb.append(this.functionName); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - if (!isSetFunctionName()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'functionName' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetFunctionsReqStandardSchemeFactory implements SchemeFactory { - public TGetFunctionsReqStandardScheme getScheme() { - return new TGetFunctionsReqStandardScheme(); - } - } - - private static class TGetFunctionsReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // FUNCTION_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.functionName = iprot.readString(); - struct.setFunctionNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - if (struct.functionName != null) { - oprot.writeFieldBegin(FUNCTION_NAME_FIELD_DESC); - oprot.writeString(struct.functionName); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetFunctionsReqTupleSchemeFactory implements SchemeFactory { - public TGetFunctionsReqTupleScheme getScheme() { - return new TGetFunctionsReqTupleScheme(); - } - } - - private static class TGetFunctionsReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.functionName); - BitSet optionals = new BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.functionName = iprot.readString(); - struct.setFunctionNameIsSet(true); - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetFunctionsResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetFunctionsResp.java deleted file mode 100644 index ead37fb91cc2f..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetFunctionsResp.java +++ /dev/null @@ -1,509 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetFunctionsResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetFunctionsResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetFunctionsRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetFunctionsRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetFunctionsResp.class, metaDataMap); - } - - public TGetFunctionsResp() { - } - - public TGetFunctionsResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetFunctionsResp(TGetFunctionsResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetFunctionsResp deepCopy() { - return new TGetFunctionsResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetFunctionsResp) - return this.equals((TGetFunctionsResp)that); - return false; - } - - public boolean equals(TGetFunctionsResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetFunctionsResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetFunctionsResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetFunctionsRespStandardSchemeFactory implements SchemeFactory { - public TGetFunctionsRespStandardScheme getScheme() { - return new TGetFunctionsRespStandardScheme(); - } - } - - private static class TGetFunctionsRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetFunctionsRespTupleSchemeFactory implements SchemeFactory { - public TGetFunctionsRespTupleScheme getScheme() { - return new TGetFunctionsRespTupleScheme(); - } - } - - private static class TGetFunctionsRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetFunctionsResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetInfoReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetInfoReq.java deleted file mode 100644 index b319b70e5eba5..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetInfoReq.java +++ /dev/null @@ -1,507 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField INFO_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoType", org.apache.thrift.protocol.TType.I32, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetInfoReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetInfoReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private TGetInfoType infoType; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - /** - * - * @see TGetInfoType - */ - INFO_TYPE((short)2, "infoType"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // INFO_TYPE - return INFO_TYPE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.INFO_TYPE, new org.apache.thrift.meta_data.FieldMetaData("infoType", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TGetInfoType.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoReq.class, metaDataMap); - } - - public TGetInfoReq() { - } - - public TGetInfoReq( - TSessionHandle sessionHandle, - TGetInfoType infoType) - { - this(); - this.sessionHandle = sessionHandle; - this.infoType = infoType; - } - - /** - * Performs a deep copy on other. - */ - public TGetInfoReq(TGetInfoReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetInfoType()) { - this.infoType = other.infoType; - } - } - - public TGetInfoReq deepCopy() { - return new TGetInfoReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.infoType = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - /** - * - * @see TGetInfoType - */ - public TGetInfoType getInfoType() { - return this.infoType; - } - - /** - * - * @see TGetInfoType - */ - public void setInfoType(TGetInfoType infoType) { - this.infoType = infoType; - } - - public void unsetInfoType() { - this.infoType = null; - } - - /** Returns true if field infoType is set (has been assigned a value) and false otherwise */ - public boolean isSetInfoType() { - return this.infoType != null; - } - - public void setInfoTypeIsSet(boolean value) { - if (!value) { - this.infoType = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case INFO_TYPE: - if (value == null) { - unsetInfoType(); - } else { - setInfoType((TGetInfoType)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case INFO_TYPE: - return getInfoType(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case INFO_TYPE: - return isSetInfoType(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetInfoReq) - return this.equals((TGetInfoReq)that); - return false; - } - - public boolean equals(TGetInfoReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_infoType = true && this.isSetInfoType(); - boolean that_present_infoType = true && that.isSetInfoType(); - if (this_present_infoType || that_present_infoType) { - if (!(this_present_infoType && that_present_infoType)) - return false; - if (!this.infoType.equals(that.infoType)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_infoType = true && (isSetInfoType()); - list.add(present_infoType); - if (present_infoType) - list.add(infoType.getValue()); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetInfoReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetInfoType()).compareTo(other.isSetInfoType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetInfoType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoType, other.infoType); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetInfoReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("infoType:"); - if (this.infoType == null) { - sb.append("null"); - } else { - sb.append(this.infoType); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - if (!isSetInfoType()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'infoType' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetInfoReqStandardSchemeFactory implements SchemeFactory { - public TGetInfoReqStandardScheme getScheme() { - return new TGetInfoReqStandardScheme(); - } - } - - private static class TGetInfoReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // INFO_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.infoType = org.apache.hive.service.rpc.thrift.TGetInfoType.findByValue(iprot.readI32()); - struct.setInfoTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetInfoReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.infoType != null) { - oprot.writeFieldBegin(INFO_TYPE_FIELD_DESC); - oprot.writeI32(struct.infoType.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetInfoReqTupleSchemeFactory implements SchemeFactory { - public TGetInfoReqTupleScheme getScheme() { - return new TGetInfoReqTupleScheme(); - } - } - - private static class TGetInfoReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeI32(struct.infoType.getValue()); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.infoType = org.apache.hive.service.rpc.thrift.TGetInfoType.findByValue(iprot.readI32()); - struct.setInfoTypeIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetInfoResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetInfoResp.java deleted file mode 100644 index 9be810b024987..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetInfoResp.java +++ /dev/null @@ -1,497 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField INFO_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("infoValue", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetInfoRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetInfoRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TGetInfoValue infoValue; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - INFO_VALUE((short)2, "infoValue"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // INFO_VALUE - return INFO_VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.INFO_VALUE, new org.apache.thrift.meta_data.FieldMetaData("infoValue", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TGetInfoValue.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoResp.class, metaDataMap); - } - - public TGetInfoResp() { - } - - public TGetInfoResp( - TStatus status, - TGetInfoValue infoValue) - { - this(); - this.status = status; - this.infoValue = infoValue; - } - - /** - * Performs a deep copy on other. - */ - public TGetInfoResp(TGetInfoResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetInfoValue()) { - this.infoValue = new TGetInfoValue(other.infoValue); - } - } - - public TGetInfoResp deepCopy() { - return new TGetInfoResp(this); - } - - @Override - public void clear() { - this.status = null; - this.infoValue = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TGetInfoValue getInfoValue() { - return this.infoValue; - } - - public void setInfoValue(TGetInfoValue infoValue) { - this.infoValue = infoValue; - } - - public void unsetInfoValue() { - this.infoValue = null; - } - - /** Returns true if field infoValue is set (has been assigned a value) and false otherwise */ - public boolean isSetInfoValue() { - return this.infoValue != null; - } - - public void setInfoValueIsSet(boolean value) { - if (!value) { - this.infoValue = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case INFO_VALUE: - if (value == null) { - unsetInfoValue(); - } else { - setInfoValue((TGetInfoValue)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case INFO_VALUE: - return getInfoValue(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case INFO_VALUE: - return isSetInfoValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetInfoResp) - return this.equals((TGetInfoResp)that); - return false; - } - - public boolean equals(TGetInfoResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_infoValue = true && this.isSetInfoValue(); - boolean that_present_infoValue = true && that.isSetInfoValue(); - if (this_present_infoValue || that_present_infoValue) { - if (!(this_present_infoValue && that_present_infoValue)) - return false; - if (!this.infoValue.equals(that.infoValue)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_infoValue = true && (isSetInfoValue()); - list.add(present_infoValue); - if (present_infoValue) - list.add(infoValue); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetInfoResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetInfoValue()).compareTo(other.isSetInfoValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetInfoValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoValue, other.infoValue); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetInfoResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (!first) sb.append(", "); - sb.append("infoValue:"); - if (this.infoValue == null) { - sb.append("null"); - } else { - sb.append(this.infoValue); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - if (!isSetInfoValue()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'infoValue' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetInfoRespStandardSchemeFactory implements SchemeFactory { - public TGetInfoRespStandardScheme getScheme() { - return new TGetInfoRespStandardScheme(); - } - } - - private static class TGetInfoRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // INFO_VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.infoValue = new TGetInfoValue(); - struct.infoValue.read(iprot); - struct.setInfoValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetInfoResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.infoValue != null) { - oprot.writeFieldBegin(INFO_VALUE_FIELD_DESC); - struct.infoValue.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetInfoRespTupleSchemeFactory implements SchemeFactory { - public TGetInfoRespTupleScheme getScheme() { - return new TGetInfoRespTupleScheme(); - } - } - - private static class TGetInfoRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - struct.infoValue.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - struct.infoValue = new TGetInfoValue(); - struct.infoValue.read(iprot); - struct.setInfoValueIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetInfoType.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetInfoType.java deleted file mode 100644 index 5b219b62656d7..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetInfoType.java +++ /dev/null @@ -1,180 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TGetInfoType implements org.apache.thrift.TEnum { - CLI_MAX_DRIVER_CONNECTIONS(0), - CLI_MAX_CONCURRENT_ACTIVITIES(1), - CLI_DATA_SOURCE_NAME(2), - CLI_FETCH_DIRECTION(8), - CLI_SERVER_NAME(13), - CLI_SEARCH_PATTERN_ESCAPE(14), - CLI_DBMS_NAME(17), - CLI_DBMS_VER(18), - CLI_ACCESSIBLE_TABLES(19), - CLI_ACCESSIBLE_PROCEDURES(20), - CLI_CURSOR_COMMIT_BEHAVIOR(23), - CLI_DATA_SOURCE_READ_ONLY(25), - CLI_DEFAULT_TXN_ISOLATION(26), - CLI_IDENTIFIER_CASE(28), - CLI_IDENTIFIER_QUOTE_CHAR(29), - CLI_MAX_COLUMN_NAME_LEN(30), - CLI_MAX_CURSOR_NAME_LEN(31), - CLI_MAX_SCHEMA_NAME_LEN(32), - CLI_MAX_CATALOG_NAME_LEN(34), - CLI_MAX_TABLE_NAME_LEN(35), - CLI_SCROLL_CONCURRENCY(43), - CLI_TXN_CAPABLE(46), - CLI_USER_NAME(47), - CLI_TXN_ISOLATION_OPTION(72), - CLI_INTEGRITY(73), - CLI_GETDATA_EXTENSIONS(81), - CLI_NULL_COLLATION(85), - CLI_ALTER_TABLE(86), - CLI_ORDER_BY_COLUMNS_IN_SELECT(90), - CLI_SPECIAL_CHARACTERS(94), - CLI_MAX_COLUMNS_IN_GROUP_BY(97), - CLI_MAX_COLUMNS_IN_INDEX(98), - CLI_MAX_COLUMNS_IN_ORDER_BY(99), - CLI_MAX_COLUMNS_IN_SELECT(100), - CLI_MAX_COLUMNS_IN_TABLE(101), - CLI_MAX_INDEX_SIZE(102), - CLI_MAX_ROW_SIZE(104), - CLI_MAX_STATEMENT_LEN(105), - CLI_MAX_TABLES_IN_SELECT(106), - CLI_MAX_USER_NAME_LEN(107), - CLI_OJ_CAPABILITIES(115), - CLI_XOPEN_CLI_YEAR(10000), - CLI_CURSOR_SENSITIVITY(10001), - CLI_DESCRIBE_PARAMETER(10002), - CLI_CATALOG_NAME(10003), - CLI_COLLATION_SEQ(10004), - CLI_MAX_IDENTIFIER_LEN(10005); - - private final int value; - - private TGetInfoType(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TGetInfoType findByValue(int value) { - switch (value) { - case 0: - return CLI_MAX_DRIVER_CONNECTIONS; - case 1: - return CLI_MAX_CONCURRENT_ACTIVITIES; - case 2: - return CLI_DATA_SOURCE_NAME; - case 8: - return CLI_FETCH_DIRECTION; - case 13: - return CLI_SERVER_NAME; - case 14: - return CLI_SEARCH_PATTERN_ESCAPE; - case 17: - return CLI_DBMS_NAME; - case 18: - return CLI_DBMS_VER; - case 19: - return CLI_ACCESSIBLE_TABLES; - case 20: - return CLI_ACCESSIBLE_PROCEDURES; - case 23: - return CLI_CURSOR_COMMIT_BEHAVIOR; - case 25: - return CLI_DATA_SOURCE_READ_ONLY; - case 26: - return CLI_DEFAULT_TXN_ISOLATION; - case 28: - return CLI_IDENTIFIER_CASE; - case 29: - return CLI_IDENTIFIER_QUOTE_CHAR; - case 30: - return CLI_MAX_COLUMN_NAME_LEN; - case 31: - return CLI_MAX_CURSOR_NAME_LEN; - case 32: - return CLI_MAX_SCHEMA_NAME_LEN; - case 34: - return CLI_MAX_CATALOG_NAME_LEN; - case 35: - return CLI_MAX_TABLE_NAME_LEN; - case 43: - return CLI_SCROLL_CONCURRENCY; - case 46: - return CLI_TXN_CAPABLE; - case 47: - return CLI_USER_NAME; - case 72: - return CLI_TXN_ISOLATION_OPTION; - case 73: - return CLI_INTEGRITY; - case 81: - return CLI_GETDATA_EXTENSIONS; - case 85: - return CLI_NULL_COLLATION; - case 86: - return CLI_ALTER_TABLE; - case 90: - return CLI_ORDER_BY_COLUMNS_IN_SELECT; - case 94: - return CLI_SPECIAL_CHARACTERS; - case 97: - return CLI_MAX_COLUMNS_IN_GROUP_BY; - case 98: - return CLI_MAX_COLUMNS_IN_INDEX; - case 99: - return CLI_MAX_COLUMNS_IN_ORDER_BY; - case 100: - return CLI_MAX_COLUMNS_IN_SELECT; - case 101: - return CLI_MAX_COLUMNS_IN_TABLE; - case 102: - return CLI_MAX_INDEX_SIZE; - case 104: - return CLI_MAX_ROW_SIZE; - case 105: - return CLI_MAX_STATEMENT_LEN; - case 106: - return CLI_MAX_TABLES_IN_SELECT; - case 107: - return CLI_MAX_USER_NAME_LEN; - case 115: - return CLI_OJ_CAPABILITIES; - case 10000: - return CLI_XOPEN_CLI_YEAR; - case 10001: - return CLI_CURSOR_SENSITIVITY; - case 10002: - return CLI_DESCRIBE_PARAMETER; - case 10003: - return CLI_CATALOG_NAME; - case 10004: - return CLI_COLLATION_SEQ; - case 10005: - return CLI_MAX_IDENTIFIER_LEN; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetInfoValue.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetInfoValue.java deleted file mode 100644 index 8e3045a58e5ac..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetInfoValue.java +++ /dev/null @@ -1,597 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -public class TGetInfoValue extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetInfoValue"); - private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField SMALL_INT_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("smallIntValue", org.apache.thrift.protocol.TType.I16, (short)2); - private static final org.apache.thrift.protocol.TField INTEGER_BITMASK_FIELD_DESC = new org.apache.thrift.protocol.TField("integerBitmask", org.apache.thrift.protocol.TType.I32, (short)3); - private static final org.apache.thrift.protocol.TField INTEGER_FLAG_FIELD_DESC = new org.apache.thrift.protocol.TField("integerFlag", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField BINARY_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryValue", org.apache.thrift.protocol.TType.I32, (short)5); - private static final org.apache.thrift.protocol.TField LEN_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("lenValue", org.apache.thrift.protocol.TType.I64, (short)6); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STRING_VALUE((short)1, "stringValue"), - SMALL_INT_VALUE((short)2, "smallIntValue"), - INTEGER_BITMASK((short)3, "integerBitmask"), - INTEGER_FLAG((short)4, "integerFlag"), - BINARY_VALUE((short)5, "binaryValue"), - LEN_VALUE((short)6, "lenValue"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STRING_VALUE - return STRING_VALUE; - case 2: // SMALL_INT_VALUE - return SMALL_INT_VALUE; - case 3: // INTEGER_BITMASK - return INTEGER_BITMASK; - case 4: // INTEGER_FLAG - return INTEGER_FLAG; - case 5: // BINARY_VALUE - return BINARY_VALUE; - case 6: // LEN_VALUE - return LEN_VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.SMALL_INT_VALUE, new org.apache.thrift.meta_data.FieldMetaData("smallIntValue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - tmpMap.put(_Fields.INTEGER_BITMASK, new org.apache.thrift.meta_data.FieldMetaData("integerBitmask", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.INTEGER_FLAG, new org.apache.thrift.meta_data.FieldMetaData("integerFlag", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.BINARY_VALUE, new org.apache.thrift.meta_data.FieldMetaData("binaryValue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.LEN_VALUE, new org.apache.thrift.meta_data.FieldMetaData("lenValue", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetInfoValue.class, metaDataMap); - } - - public TGetInfoValue() { - super(); - } - - public TGetInfoValue(TGetInfoValue._Fields setField, Object value) { - super(setField, value); - } - - public TGetInfoValue(TGetInfoValue other) { - super(other); - } - public TGetInfoValue deepCopy() { - return new TGetInfoValue(this); - } - - public static TGetInfoValue stringValue(String value) { - TGetInfoValue x = new TGetInfoValue(); - x.setStringValue(value); - return x; - } - - public static TGetInfoValue smallIntValue(short value) { - TGetInfoValue x = new TGetInfoValue(); - x.setSmallIntValue(value); - return x; - } - - public static TGetInfoValue integerBitmask(int value) { - TGetInfoValue x = new TGetInfoValue(); - x.setIntegerBitmask(value); - return x; - } - - public static TGetInfoValue integerFlag(int value) { - TGetInfoValue x = new TGetInfoValue(); - x.setIntegerFlag(value); - return x; - } - - public static TGetInfoValue binaryValue(int value) { - TGetInfoValue x = new TGetInfoValue(); - x.setBinaryValue(value); - return x; - } - - public static TGetInfoValue lenValue(long value) { - TGetInfoValue x = new TGetInfoValue(); - x.setLenValue(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case STRING_VALUE: - if (value instanceof String) { - break; - } - throw new ClassCastException("Was expecting value of type String for field 'stringValue', but got " + value.getClass().getSimpleName()); - case SMALL_INT_VALUE: - if (value instanceof Short) { - break; - } - throw new ClassCastException("Was expecting value of type Short for field 'smallIntValue', but got " + value.getClass().getSimpleName()); - case INTEGER_BITMASK: - if (value instanceof Integer) { - break; - } - throw new ClassCastException("Was expecting value of type Integer for field 'integerBitmask', but got " + value.getClass().getSimpleName()); - case INTEGER_FLAG: - if (value instanceof Integer) { - break; - } - throw new ClassCastException("Was expecting value of type Integer for field 'integerFlag', but got " + value.getClass().getSimpleName()); - case BINARY_VALUE: - if (value instanceof Integer) { - break; - } - throw new ClassCastException("Was expecting value of type Integer for field 'binaryValue', but got " + value.getClass().getSimpleName()); - case LEN_VALUE: - if (value instanceof Long) { - break; - } - throw new ClassCastException("Was expecting value of type Long for field 'lenValue', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case STRING_VALUE: - if (field.type == STRING_VALUE_FIELD_DESC.type) { - String stringValue; - stringValue = iprot.readString(); - return stringValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case SMALL_INT_VALUE: - if (field.type == SMALL_INT_VALUE_FIELD_DESC.type) { - Short smallIntValue; - smallIntValue = iprot.readI16(); - return smallIntValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case INTEGER_BITMASK: - if (field.type == INTEGER_BITMASK_FIELD_DESC.type) { - Integer integerBitmask; - integerBitmask = iprot.readI32(); - return integerBitmask; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case INTEGER_FLAG: - if (field.type == INTEGER_FLAG_FIELD_DESC.type) { - Integer integerFlag; - integerFlag = iprot.readI32(); - return integerFlag; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case BINARY_VALUE: - if (field.type == BINARY_VALUE_FIELD_DESC.type) { - Integer binaryValue; - binaryValue = iprot.readI32(); - return binaryValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case LEN_VALUE: - if (field.type == LEN_VALUE_FIELD_DESC.type) { - Long lenValue; - lenValue = iprot.readI64(); - return lenValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case STRING_VALUE: - String stringValue = (String)value_; - oprot.writeString(stringValue); - return; - case SMALL_INT_VALUE: - Short smallIntValue = (Short)value_; - oprot.writeI16(smallIntValue); - return; - case INTEGER_BITMASK: - Integer integerBitmask = (Integer)value_; - oprot.writeI32(integerBitmask); - return; - case INTEGER_FLAG: - Integer integerFlag = (Integer)value_; - oprot.writeI32(integerFlag); - return; - case BINARY_VALUE: - Integer binaryValue = (Integer)value_; - oprot.writeI32(binaryValue); - return; - case LEN_VALUE: - Long lenValue = (Long)value_; - oprot.writeI64(lenValue); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case STRING_VALUE: - String stringValue; - stringValue = iprot.readString(); - return stringValue; - case SMALL_INT_VALUE: - Short smallIntValue; - smallIntValue = iprot.readI16(); - return smallIntValue; - case INTEGER_BITMASK: - Integer integerBitmask; - integerBitmask = iprot.readI32(); - return integerBitmask; - case INTEGER_FLAG: - Integer integerFlag; - integerFlag = iprot.readI32(); - return integerFlag; - case BINARY_VALUE: - Integer binaryValue; - binaryValue = iprot.readI32(); - return binaryValue; - case LEN_VALUE: - Long lenValue; - lenValue = iprot.readI64(); - return lenValue; - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case STRING_VALUE: - String stringValue = (String)value_; - oprot.writeString(stringValue); - return; - case SMALL_INT_VALUE: - Short smallIntValue = (Short)value_; - oprot.writeI16(smallIntValue); - return; - case INTEGER_BITMASK: - Integer integerBitmask = (Integer)value_; - oprot.writeI32(integerBitmask); - return; - case INTEGER_FLAG: - Integer integerFlag = (Integer)value_; - oprot.writeI32(integerFlag); - return; - case BINARY_VALUE: - Integer binaryValue = (Integer)value_; - oprot.writeI32(binaryValue); - return; - case LEN_VALUE: - Long lenValue = (Long)value_; - oprot.writeI64(lenValue); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case STRING_VALUE: - return STRING_VALUE_FIELD_DESC; - case SMALL_INT_VALUE: - return SMALL_INT_VALUE_FIELD_DESC; - case INTEGER_BITMASK: - return INTEGER_BITMASK_FIELD_DESC; - case INTEGER_FLAG: - return INTEGER_FLAG_FIELD_DESC; - case BINARY_VALUE: - return BINARY_VALUE_FIELD_DESC; - case LEN_VALUE: - return LEN_VALUE_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public String getStringValue() { - if (getSetField() == _Fields.STRING_VALUE) { - return (String)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringValue(String value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.STRING_VALUE; - value_ = value; - } - - public short getSmallIntValue() { - if (getSetField() == _Fields.SMALL_INT_VALUE) { - return (Short)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'smallIntValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setSmallIntValue(short value) { - setField_ = _Fields.SMALL_INT_VALUE; - value_ = value; - } - - public int getIntegerBitmask() { - if (getSetField() == _Fields.INTEGER_BITMASK) { - return (Integer)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'integerBitmask' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setIntegerBitmask(int value) { - setField_ = _Fields.INTEGER_BITMASK; - value_ = value; - } - - public int getIntegerFlag() { - if (getSetField() == _Fields.INTEGER_FLAG) { - return (Integer)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'integerFlag' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setIntegerFlag(int value) { - setField_ = _Fields.INTEGER_FLAG; - value_ = value; - } - - public int getBinaryValue() { - if (getSetField() == _Fields.BINARY_VALUE) { - return (Integer)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'binaryValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setBinaryValue(int value) { - setField_ = _Fields.BINARY_VALUE; - value_ = value; - } - - public long getLenValue() { - if (getSetField() == _Fields.LEN_VALUE) { - return (Long)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'lenValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setLenValue(long value) { - setField_ = _Fields.LEN_VALUE; - value_ = value; - } - - public boolean isSetStringValue() { - return setField_ == _Fields.STRING_VALUE; - } - - - public boolean isSetSmallIntValue() { - return setField_ == _Fields.SMALL_INT_VALUE; - } - - - public boolean isSetIntegerBitmask() { - return setField_ == _Fields.INTEGER_BITMASK; - } - - - public boolean isSetIntegerFlag() { - return setField_ == _Fields.INTEGER_FLAG; - } - - - public boolean isSetBinaryValue() { - return setField_ == _Fields.BINARY_VALUE; - } - - - public boolean isSetLenValue() { - return setField_ == _Fields.LEN_VALUE; - } - - - public boolean equals(Object other) { - if (other instanceof TGetInfoValue) { - return equals((TGetInfoValue)other); - } else { - return false; - } - } - - public boolean equals(TGetInfoValue other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TGetInfoValue other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - List list = new ArrayList(); - list.add(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - list.add(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - list.add(value); - } - } - return list.hashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetOperationStatusReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetOperationStatusReq.java deleted file mode 100644 index af31ce2b22819..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetOperationStatusReq.java +++ /dev/null @@ -1,501 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetOperationStatusReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusReq"); - - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField GET_PROGRESS_UPDATE_FIELD_DESC = new org.apache.thrift.protocol.TField("getProgressUpdate", org.apache.thrift.protocol.TType.BOOL, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetOperationStatusReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetOperationStatusReqTupleSchemeFactory()); - } - - private TOperationHandle operationHandle; // required - private boolean getProgressUpdate; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OPERATION_HANDLE((short)1, "operationHandle"), - GET_PROGRESS_UPDATE((short)2, "getProgressUpdate"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_HANDLE - return OPERATION_HANDLE; - case 2: // GET_PROGRESS_UPDATE - return GET_PROGRESS_UPDATE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __GETPROGRESSUPDATE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.GET_PROGRESS_UPDATE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - tmpMap.put(_Fields.GET_PROGRESS_UPDATE, new org.apache.thrift.meta_data.FieldMetaData("getProgressUpdate", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusReq.class, metaDataMap); - } - - public TGetOperationStatusReq() { - } - - public TGetOperationStatusReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetOperationStatusReq(TGetOperationStatusReq other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - this.getProgressUpdate = other.getProgressUpdate; - } - - public TGetOperationStatusReq deepCopy() { - return new TGetOperationStatusReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - setGetProgressUpdateIsSet(false); - this.getProgressUpdate = false; - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public boolean isGetProgressUpdate() { - return this.getProgressUpdate; - } - - public void setGetProgressUpdate(boolean getProgressUpdate) { - this.getProgressUpdate = getProgressUpdate; - setGetProgressUpdateIsSet(true); - } - - public void unsetGetProgressUpdate() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); - } - - /** Returns true if field getProgressUpdate is set (has been assigned a value) and false otherwise */ - public boolean isSetGetProgressUpdate() { - return EncodingUtils.testBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID); - } - - public void setGetProgressUpdateIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GETPROGRESSUPDATE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - case GET_PROGRESS_UPDATE: - if (value == null) { - unsetGetProgressUpdate(); - } else { - setGetProgressUpdate((Boolean)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - case GET_PROGRESS_UPDATE: - return isGetProgressUpdate(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - case GET_PROGRESS_UPDATE: - return isSetGetProgressUpdate(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetOperationStatusReq) - return this.equals((TGetOperationStatusReq)that); - return false; - } - - public boolean equals(TGetOperationStatusReq that) { - if (that == null) - return false; - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - boolean this_present_getProgressUpdate = true && this.isSetGetProgressUpdate(); - boolean that_present_getProgressUpdate = true && that.isSetGetProgressUpdate(); - if (this_present_getProgressUpdate || that_present_getProgressUpdate) { - if (!(this_present_getProgressUpdate && that_present_getProgressUpdate)) - return false; - if (this.getProgressUpdate != that.getProgressUpdate) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - boolean present_getProgressUpdate = true && (isSetGetProgressUpdate()); - list.add(present_getProgressUpdate); - if (present_getProgressUpdate) - list.add(getProgressUpdate); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetOperationStatusReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetGetProgressUpdate()).compareTo(other.isSetGetProgressUpdate()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGetProgressUpdate()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.getProgressUpdate, other.getProgressUpdate); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetOperationStatusReq("); - boolean first = true; - - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - if (isSetGetProgressUpdate()) { - if (!first) sb.append(", "); - sb.append("getProgressUpdate:"); - sb.append(this.getProgressUpdate); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetOperationStatusReqStandardSchemeFactory implements SchemeFactory { - public TGetOperationStatusReqStandardScheme getScheme() { - return new TGetOperationStatusReqStandardScheme(); - } - } - - private static class TGetOperationStatusReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // GET_PROGRESS_UPDATE - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.getProgressUpdate = iprot.readBool(); - struct.setGetProgressUpdateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.isSetGetProgressUpdate()) { - oprot.writeFieldBegin(GET_PROGRESS_UPDATE_FIELD_DESC); - oprot.writeBool(struct.getProgressUpdate); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetOperationStatusReqTupleSchemeFactory implements SchemeFactory { - public TGetOperationStatusReqTupleScheme getScheme() { - return new TGetOperationStatusReqTupleScheme(); - } - } - - private static class TGetOperationStatusReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.operationHandle.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetGetProgressUpdate()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetGetProgressUpdate()) { - oprot.writeBool(struct.getProgressUpdate); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.getProgressUpdate = iprot.readBool(); - struct.setGetProgressUpdateIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetOperationStatusResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetOperationStatusResp.java deleted file mode 100644 index dbfbb44aa6986..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetOperationStatusResp.java +++ /dev/null @@ -1,1342 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetOperationStatusResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetOperationStatusResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationState", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField TASK_STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("taskStatus", org.apache.thrift.protocol.TType.STRING, (short)6); - private static final org.apache.thrift.protocol.TField OPERATION_STARTED_FIELD_DESC = new org.apache.thrift.protocol.TField("operationStarted", org.apache.thrift.protocol.TType.I64, (short)7); - private static final org.apache.thrift.protocol.TField OPERATION_COMPLETED_FIELD_DESC = new org.apache.thrift.protocol.TField("operationCompleted", org.apache.thrift.protocol.TType.I64, (short)8); - private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)9); - private static final org.apache.thrift.protocol.TField PROGRESS_UPDATE_RESPONSE_FIELD_DESC = new org.apache.thrift.protocol.TField("progressUpdateResponse", org.apache.thrift.protocol.TType.STRUCT, (short)10); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetOperationStatusRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetOperationStatusRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationState operationState; // optional - private String sqlState; // optional - private int errorCode; // optional - private String errorMessage; // optional - private String taskStatus; // optional - private long operationStarted; // optional - private long operationCompleted; // optional - private boolean hasResultSet; // optional - private TProgressUpdateResp progressUpdateResponse; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - /** - * - * @see TOperationState - */ - OPERATION_STATE((short)2, "operationState"), - SQL_STATE((short)3, "sqlState"), - ERROR_CODE((short)4, "errorCode"), - ERROR_MESSAGE((short)5, "errorMessage"), - TASK_STATUS((short)6, "taskStatus"), - OPERATION_STARTED((short)7, "operationStarted"), - OPERATION_COMPLETED((short)8, "operationCompleted"), - HAS_RESULT_SET((short)9, "hasResultSet"), - PROGRESS_UPDATE_RESPONSE((short)10, "progressUpdateResponse"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_STATE - return OPERATION_STATE; - case 3: // SQL_STATE - return SQL_STATE; - case 4: // ERROR_CODE - return ERROR_CODE; - case 5: // ERROR_MESSAGE - return ERROR_MESSAGE; - case 6: // TASK_STATUS - return TASK_STATUS; - case 7: // OPERATION_STARTED - return OPERATION_STARTED; - case 8: // OPERATION_COMPLETED - return OPERATION_COMPLETED; - case 9: // HAS_RESULT_SET - return HAS_RESULT_SET; - case 10: // PROGRESS_UPDATE_RESPONSE - return PROGRESS_UPDATE_RESPONSE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERRORCODE_ISSET_ID = 0; - private static final int __OPERATIONSTARTED_ISSET_ID = 1; - private static final int __OPERATIONCOMPLETED_ISSET_ID = 2; - private static final int __HASRESULTSET_ISSET_ID = 3; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.OPERATION_STATE,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE,_Fields.TASK_STATUS,_Fields.OPERATION_STARTED,_Fields.OPERATION_COMPLETED,_Fields.HAS_RESULT_SET,_Fields.PROGRESS_UPDATE_RESPONSE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_STATE, new org.apache.thrift.meta_data.FieldMetaData("operationState", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationState.class))); - tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.TASK_STATUS, new org.apache.thrift.meta_data.FieldMetaData("taskStatus", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.OPERATION_STARTED, new org.apache.thrift.meta_data.FieldMetaData("operationStarted", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.OPERATION_COMPLETED, new org.apache.thrift.meta_data.FieldMetaData("operationCompleted", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.PROGRESS_UPDATE_RESPONSE, new org.apache.thrift.meta_data.FieldMetaData("progressUpdateResponse", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT , "TProgressUpdateResp"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetOperationStatusResp.class, metaDataMap); - } - - public TGetOperationStatusResp() { - } - - public TGetOperationStatusResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetOperationStatusResp(TGetOperationStatusResp other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationState()) { - this.operationState = other.operationState; - } - if (other.isSetSqlState()) { - this.sqlState = other.sqlState; - } - this.errorCode = other.errorCode; - if (other.isSetErrorMessage()) { - this.errorMessage = other.errorMessage; - } - if (other.isSetTaskStatus()) { - this.taskStatus = other.taskStatus; - } - this.operationStarted = other.operationStarted; - this.operationCompleted = other.operationCompleted; - this.hasResultSet = other.hasResultSet; - if (other.isSetProgressUpdateResponse()) { - this.progressUpdateResponse = other.progressUpdateResponse; - } - } - - public TGetOperationStatusResp deepCopy() { - return new TGetOperationStatusResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationState = null; - this.sqlState = null; - setErrorCodeIsSet(false); - this.errorCode = 0; - this.errorMessage = null; - this.taskStatus = null; - setOperationStartedIsSet(false); - this.operationStarted = 0; - setOperationCompletedIsSet(false); - this.operationCompleted = 0; - setHasResultSetIsSet(false); - this.hasResultSet = false; - this.progressUpdateResponse = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - /** - * - * @see TOperationState - */ - public TOperationState getOperationState() { - return this.operationState; - } - - /** - * - * @see TOperationState - */ - public void setOperationState(TOperationState operationState) { - this.operationState = operationState; - } - - public void unsetOperationState() { - this.operationState = null; - } - - /** Returns true if field operationState is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationState() { - return this.operationState != null; - } - - public void setOperationStateIsSet(boolean value) { - if (!value) { - this.operationState = null; - } - } - - public String getSqlState() { - return this.sqlState; - } - - public void setSqlState(String sqlState) { - this.sqlState = sqlState; - } - - public void unsetSqlState() { - this.sqlState = null; - } - - /** Returns true if field sqlState is set (has been assigned a value) and false otherwise */ - public boolean isSetSqlState() { - return this.sqlState != null; - } - - public void setSqlStateIsSet(boolean value) { - if (!value) { - this.sqlState = null; - } - } - - public int getErrorCode() { - return this.errorCode; - } - - public void setErrorCode(int errorCode) { - this.errorCode = errorCode; - setErrorCodeIsSet(true); - } - - public void unsetErrorCode() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); - } - - /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ - public boolean isSetErrorCode() { - return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); - } - - public void setErrorCodeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); - } - - public String getErrorMessage() { - return this.errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - public void unsetErrorMessage() { - this.errorMessage = null; - } - - /** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */ - public boolean isSetErrorMessage() { - return this.errorMessage != null; - } - - public void setErrorMessageIsSet(boolean value) { - if (!value) { - this.errorMessage = null; - } - } - - public String getTaskStatus() { - return this.taskStatus; - } - - public void setTaskStatus(String taskStatus) { - this.taskStatus = taskStatus; - } - - public void unsetTaskStatus() { - this.taskStatus = null; - } - - /** Returns true if field taskStatus is set (has been assigned a value) and false otherwise */ - public boolean isSetTaskStatus() { - return this.taskStatus != null; - } - - public void setTaskStatusIsSet(boolean value) { - if (!value) { - this.taskStatus = null; - } - } - - public long getOperationStarted() { - return this.operationStarted; - } - - public void setOperationStarted(long operationStarted) { - this.operationStarted = operationStarted; - setOperationStartedIsSet(true); - } - - public void unsetOperationStarted() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); - } - - /** Returns true if field operationStarted is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationStarted() { - return EncodingUtils.testBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID); - } - - public void setOperationStartedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OPERATIONSTARTED_ISSET_ID, value); - } - - public long getOperationCompleted() { - return this.operationCompleted; - } - - public void setOperationCompleted(long operationCompleted) { - this.operationCompleted = operationCompleted; - setOperationCompletedIsSet(true); - } - - public void unsetOperationCompleted() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); - } - - /** Returns true if field operationCompleted is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationCompleted() { - return EncodingUtils.testBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID); - } - - public void setOperationCompletedIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OPERATIONCOMPLETED_ISSET_ID, value); - } - - public boolean isHasResultSet() { - return this.hasResultSet; - } - - public void setHasResultSet(boolean hasResultSet) { - this.hasResultSet = hasResultSet; - setHasResultSetIsSet(true); - } - - public void unsetHasResultSet() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); - } - - /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ - public boolean isSetHasResultSet() { - return EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); - } - - public void setHasResultSetIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); - } - - public TProgressUpdateResp getProgressUpdateResponse() { - return this.progressUpdateResponse; - } - - public void setProgressUpdateResponse(TProgressUpdateResp progressUpdateResponse) { - this.progressUpdateResponse = progressUpdateResponse; - } - - public void unsetProgressUpdateResponse() { - this.progressUpdateResponse = null; - } - - /** Returns true if field progressUpdateResponse is set (has been assigned a value) and false otherwise */ - public boolean isSetProgressUpdateResponse() { - return this.progressUpdateResponse != null; - } - - public void setProgressUpdateResponseIsSet(boolean value) { - if (!value) { - this.progressUpdateResponse = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_STATE: - if (value == null) { - unsetOperationState(); - } else { - setOperationState((TOperationState)value); - } - break; - - case SQL_STATE: - if (value == null) { - unsetSqlState(); - } else { - setSqlState((String)value); - } - break; - - case ERROR_CODE: - if (value == null) { - unsetErrorCode(); - } else { - setErrorCode((Integer)value); - } - break; - - case ERROR_MESSAGE: - if (value == null) { - unsetErrorMessage(); - } else { - setErrorMessage((String)value); - } - break; - - case TASK_STATUS: - if (value == null) { - unsetTaskStatus(); - } else { - setTaskStatus((String)value); - } - break; - - case OPERATION_STARTED: - if (value == null) { - unsetOperationStarted(); - } else { - setOperationStarted((Long)value); - } - break; - - case OPERATION_COMPLETED: - if (value == null) { - unsetOperationCompleted(); - } else { - setOperationCompleted((Long)value); - } - break; - - case HAS_RESULT_SET: - if (value == null) { - unsetHasResultSet(); - } else { - setHasResultSet((Boolean)value); - } - break; - - case PROGRESS_UPDATE_RESPONSE: - if (value == null) { - unsetProgressUpdateResponse(); - } else { - setProgressUpdateResponse((TProgressUpdateResp)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_STATE: - return getOperationState(); - - case SQL_STATE: - return getSqlState(); - - case ERROR_CODE: - return getErrorCode(); - - case ERROR_MESSAGE: - return getErrorMessage(); - - case TASK_STATUS: - return getTaskStatus(); - - case OPERATION_STARTED: - return getOperationStarted(); - - case OPERATION_COMPLETED: - return getOperationCompleted(); - - case HAS_RESULT_SET: - return isHasResultSet(); - - case PROGRESS_UPDATE_RESPONSE: - return getProgressUpdateResponse(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_STATE: - return isSetOperationState(); - case SQL_STATE: - return isSetSqlState(); - case ERROR_CODE: - return isSetErrorCode(); - case ERROR_MESSAGE: - return isSetErrorMessage(); - case TASK_STATUS: - return isSetTaskStatus(); - case OPERATION_STARTED: - return isSetOperationStarted(); - case OPERATION_COMPLETED: - return isSetOperationCompleted(); - case HAS_RESULT_SET: - return isSetHasResultSet(); - case PROGRESS_UPDATE_RESPONSE: - return isSetProgressUpdateResponse(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetOperationStatusResp) - return this.equals((TGetOperationStatusResp)that); - return false; - } - - public boolean equals(TGetOperationStatusResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationState = true && this.isSetOperationState(); - boolean that_present_operationState = true && that.isSetOperationState(); - if (this_present_operationState || that_present_operationState) { - if (!(this_present_operationState && that_present_operationState)) - return false; - if (!this.operationState.equals(that.operationState)) - return false; - } - - boolean this_present_sqlState = true && this.isSetSqlState(); - boolean that_present_sqlState = true && that.isSetSqlState(); - if (this_present_sqlState || that_present_sqlState) { - if (!(this_present_sqlState && that_present_sqlState)) - return false; - if (!this.sqlState.equals(that.sqlState)) - return false; - } - - boolean this_present_errorCode = true && this.isSetErrorCode(); - boolean that_present_errorCode = true && that.isSetErrorCode(); - if (this_present_errorCode || that_present_errorCode) { - if (!(this_present_errorCode && that_present_errorCode)) - return false; - if (this.errorCode != that.errorCode) - return false; - } - - boolean this_present_errorMessage = true && this.isSetErrorMessage(); - boolean that_present_errorMessage = true && that.isSetErrorMessage(); - if (this_present_errorMessage || that_present_errorMessage) { - if (!(this_present_errorMessage && that_present_errorMessage)) - return false; - if (!this.errorMessage.equals(that.errorMessage)) - return false; - } - - boolean this_present_taskStatus = true && this.isSetTaskStatus(); - boolean that_present_taskStatus = true && that.isSetTaskStatus(); - if (this_present_taskStatus || that_present_taskStatus) { - if (!(this_present_taskStatus && that_present_taskStatus)) - return false; - if (!this.taskStatus.equals(that.taskStatus)) - return false; - } - - boolean this_present_operationStarted = true && this.isSetOperationStarted(); - boolean that_present_operationStarted = true && that.isSetOperationStarted(); - if (this_present_operationStarted || that_present_operationStarted) { - if (!(this_present_operationStarted && that_present_operationStarted)) - return false; - if (this.operationStarted != that.operationStarted) - return false; - } - - boolean this_present_operationCompleted = true && this.isSetOperationCompleted(); - boolean that_present_operationCompleted = true && that.isSetOperationCompleted(); - if (this_present_operationCompleted || that_present_operationCompleted) { - if (!(this_present_operationCompleted && that_present_operationCompleted)) - return false; - if (this.operationCompleted != that.operationCompleted) - return false; - } - - boolean this_present_hasResultSet = true && this.isSetHasResultSet(); - boolean that_present_hasResultSet = true && that.isSetHasResultSet(); - if (this_present_hasResultSet || that_present_hasResultSet) { - if (!(this_present_hasResultSet && that_present_hasResultSet)) - return false; - if (this.hasResultSet != that.hasResultSet) - return false; - } - - boolean this_present_progressUpdateResponse = true && this.isSetProgressUpdateResponse(); - boolean that_present_progressUpdateResponse = true && that.isSetProgressUpdateResponse(); - if (this_present_progressUpdateResponse || that_present_progressUpdateResponse) { - if (!(this_present_progressUpdateResponse && that_present_progressUpdateResponse)) - return false; - if (!this.progressUpdateResponse.equals(that.progressUpdateResponse)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_operationState = true && (isSetOperationState()); - list.add(present_operationState); - if (present_operationState) - list.add(operationState.getValue()); - - boolean present_sqlState = true && (isSetSqlState()); - list.add(present_sqlState); - if (present_sqlState) - list.add(sqlState); - - boolean present_errorCode = true && (isSetErrorCode()); - list.add(present_errorCode); - if (present_errorCode) - list.add(errorCode); - - boolean present_errorMessage = true && (isSetErrorMessage()); - list.add(present_errorMessage); - if (present_errorMessage) - list.add(errorMessage); - - boolean present_taskStatus = true && (isSetTaskStatus()); - list.add(present_taskStatus); - if (present_taskStatus) - list.add(taskStatus); - - boolean present_operationStarted = true && (isSetOperationStarted()); - list.add(present_operationStarted); - if (present_operationStarted) - list.add(operationStarted); - - boolean present_operationCompleted = true && (isSetOperationCompleted()); - list.add(present_operationCompleted); - if (present_operationCompleted) - list.add(operationCompleted); - - boolean present_hasResultSet = true && (isSetHasResultSet()); - list.add(present_hasResultSet); - if (present_hasResultSet) - list.add(hasResultSet); - - boolean present_progressUpdateResponse = true && (isSetProgressUpdateResponse()); - list.add(present_progressUpdateResponse); - if (present_progressUpdateResponse) - list.add(progressUpdateResponse); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetOperationStatusResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationState()).compareTo(other.isSetOperationState()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationState()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationState, other.operationState); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSqlState()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, other.sqlState); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErrorCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErrorMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, other.errorMessage); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTaskStatus()).compareTo(other.isSetTaskStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTaskStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.taskStatus, other.taskStatus); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationStarted()).compareTo(other.isSetOperationStarted()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationStarted()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationStarted, other.operationStarted); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationCompleted()).compareTo(other.isSetOperationCompleted()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationCompleted()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationCompleted, other.operationCompleted); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHasResultSet()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasResultSet, other.hasResultSet); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetProgressUpdateResponse()).compareTo(other.isSetProgressUpdateResponse()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetProgressUpdateResponse()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.progressUpdateResponse, other.progressUpdateResponse); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetOperationStatusResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationState()) { - if (!first) sb.append(", "); - sb.append("operationState:"); - if (this.operationState == null) { - sb.append("null"); - } else { - sb.append(this.operationState); - } - first = false; - } - if (isSetSqlState()) { - if (!first) sb.append(", "); - sb.append("sqlState:"); - if (this.sqlState == null) { - sb.append("null"); - } else { - sb.append(this.sqlState); - } - first = false; - } - if (isSetErrorCode()) { - if (!first) sb.append(", "); - sb.append("errorCode:"); - sb.append(this.errorCode); - first = false; - } - if (isSetErrorMessage()) { - if (!first) sb.append(", "); - sb.append("errorMessage:"); - if (this.errorMessage == null) { - sb.append("null"); - } else { - sb.append(this.errorMessage); - } - first = false; - } - if (isSetTaskStatus()) { - if (!first) sb.append(", "); - sb.append("taskStatus:"); - if (this.taskStatus == null) { - sb.append("null"); - } else { - sb.append(this.taskStatus); - } - first = false; - } - if (isSetOperationStarted()) { - if (!first) sb.append(", "); - sb.append("operationStarted:"); - sb.append(this.operationStarted); - first = false; - } - if (isSetOperationCompleted()) { - if (!first) sb.append(", "); - sb.append("operationCompleted:"); - sb.append(this.operationCompleted); - first = false; - } - if (isSetHasResultSet()) { - if (!first) sb.append(", "); - sb.append("hasResultSet:"); - sb.append(this.hasResultSet); - first = false; - } - if (isSetProgressUpdateResponse()) { - if (!first) sb.append(", "); - sb.append("progressUpdateResponse:"); - if (this.progressUpdateResponse == null) { - sb.append("null"); - } else { - sb.append(this.progressUpdateResponse); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetOperationStatusRespStandardSchemeFactory implements SchemeFactory { - public TGetOperationStatusRespStandardScheme getScheme() { - return new TGetOperationStatusRespStandardScheme(); - } - } - - private static class TGetOperationStatusRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_STATE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.operationState = org.apache.hive.service.rpc.thrift.TOperationState.findByValue(iprot.readI32()); - struct.setOperationStateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SQL_STATE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.sqlState = iprot.readString(); - struct.setSqlStateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // ERROR_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.errorCode = iprot.readI32(); - struct.setErrorCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // ERROR_MESSAGE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.errorMessage = iprot.readString(); - struct.setErrorMessageIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // TASK_STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.taskStatus = iprot.readString(); - struct.setTaskStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 7: // OPERATION_STARTED - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.operationStarted = iprot.readI64(); - struct.setOperationStartedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 8: // OPERATION_COMPLETED - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.operationCompleted = iprot.readI64(); - struct.setOperationCompletedIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 9: // HAS_RESULT_SET - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.hasResultSet = iprot.readBool(); - struct.setHasResultSetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 10: // PROGRESS_UPDATE_RESPONSE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.progressUpdateResponse = new TProgressUpdateResp(); - struct.progressUpdateResponse.read(iprot); - struct.setProgressUpdateResponseIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationState != null) { - if (struct.isSetOperationState()) { - oprot.writeFieldBegin(OPERATION_STATE_FIELD_DESC); - oprot.writeI32(struct.operationState.getValue()); - oprot.writeFieldEnd(); - } - } - if (struct.sqlState != null) { - if (struct.isSetSqlState()) { - oprot.writeFieldBegin(SQL_STATE_FIELD_DESC); - oprot.writeString(struct.sqlState); - oprot.writeFieldEnd(); - } - } - if (struct.isSetErrorCode()) { - oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); - oprot.writeI32(struct.errorCode); - oprot.writeFieldEnd(); - } - if (struct.errorMessage != null) { - if (struct.isSetErrorMessage()) { - oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC); - oprot.writeString(struct.errorMessage); - oprot.writeFieldEnd(); - } - } - if (struct.taskStatus != null) { - if (struct.isSetTaskStatus()) { - oprot.writeFieldBegin(TASK_STATUS_FIELD_DESC); - oprot.writeString(struct.taskStatus); - oprot.writeFieldEnd(); - } - } - if (struct.isSetOperationStarted()) { - oprot.writeFieldBegin(OPERATION_STARTED_FIELD_DESC); - oprot.writeI64(struct.operationStarted); - oprot.writeFieldEnd(); - } - if (struct.isSetOperationCompleted()) { - oprot.writeFieldBegin(OPERATION_COMPLETED_FIELD_DESC); - oprot.writeI64(struct.operationCompleted); - oprot.writeFieldEnd(); - } - if (struct.isSetHasResultSet()) { - oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC); - oprot.writeBool(struct.hasResultSet); - oprot.writeFieldEnd(); - } - if (struct.progressUpdateResponse != null) { - if (struct.isSetProgressUpdateResponse()) { - oprot.writeFieldBegin(PROGRESS_UPDATE_RESPONSE_FIELD_DESC); - struct.progressUpdateResponse.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetOperationStatusRespTupleSchemeFactory implements SchemeFactory { - public TGetOperationStatusRespTupleScheme getScheme() { - return new TGetOperationStatusRespTupleScheme(); - } - } - - private static class TGetOperationStatusRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationState()) { - optionals.set(0); - } - if (struct.isSetSqlState()) { - optionals.set(1); - } - if (struct.isSetErrorCode()) { - optionals.set(2); - } - if (struct.isSetErrorMessage()) { - optionals.set(3); - } - if (struct.isSetTaskStatus()) { - optionals.set(4); - } - if (struct.isSetOperationStarted()) { - optionals.set(5); - } - if (struct.isSetOperationCompleted()) { - optionals.set(6); - } - if (struct.isSetHasResultSet()) { - optionals.set(7); - } - if (struct.isSetProgressUpdateResponse()) { - optionals.set(8); - } - oprot.writeBitSet(optionals, 9); - if (struct.isSetOperationState()) { - oprot.writeI32(struct.operationState.getValue()); - } - if (struct.isSetSqlState()) { - oprot.writeString(struct.sqlState); - } - if (struct.isSetErrorCode()) { - oprot.writeI32(struct.errorCode); - } - if (struct.isSetErrorMessage()) { - oprot.writeString(struct.errorMessage); - } - if (struct.isSetTaskStatus()) { - oprot.writeString(struct.taskStatus); - } - if (struct.isSetOperationStarted()) { - oprot.writeI64(struct.operationStarted); - } - if (struct.isSetOperationCompleted()) { - oprot.writeI64(struct.operationCompleted); - } - if (struct.isSetHasResultSet()) { - oprot.writeBool(struct.hasResultSet); - } - if (struct.isSetProgressUpdateResponse()) { - struct.progressUpdateResponse.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetOperationStatusResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(9); - if (incoming.get(0)) { - struct.operationState = org.apache.hive.service.rpc.thrift.TOperationState.findByValue(iprot.readI32()); - struct.setOperationStateIsSet(true); - } - if (incoming.get(1)) { - struct.sqlState = iprot.readString(); - struct.setSqlStateIsSet(true); - } - if (incoming.get(2)) { - struct.errorCode = iprot.readI32(); - struct.setErrorCodeIsSet(true); - } - if (incoming.get(3)) { - struct.errorMessage = iprot.readString(); - struct.setErrorMessageIsSet(true); - } - if (incoming.get(4)) { - struct.taskStatus = iprot.readString(); - struct.setTaskStatusIsSet(true); - } - if (incoming.get(5)) { - struct.operationStarted = iprot.readI64(); - struct.setOperationStartedIsSet(true); - } - if (incoming.get(6)) { - struct.operationCompleted = iprot.readI64(); - struct.setOperationCompletedIsSet(true); - } - if (incoming.get(7)) { - struct.hasResultSet = iprot.readBool(); - struct.setHasResultSetIsSet(true); - } - if (incoming.get(8)) { - struct.progressUpdateResponse = new TProgressUpdateResp(); - struct.progressUpdateResponse.read(iprot); - struct.setProgressUpdateResponseIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetPrimaryKeysReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetPrimaryKeysReq.java deleted file mode 100644 index 1bec9b51c72d8..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetPrimaryKeysReq.java +++ /dev/null @@ -1,716 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetPrimaryKeysReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetPrimaryKeysReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetPrimaryKeysReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetPrimaryKeysReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - private String tableName; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"), - TABLE_NAME((short)4, "tableName"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - case 4: // TABLE_NAME - return TABLE_NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetPrimaryKeysReq.class, metaDataMap); - } - - public TGetPrimaryKeysReq() { - } - - public TGetPrimaryKeysReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetPrimaryKeysReq(TGetPrimaryKeysReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - if (other.isSetTableName()) { - this.tableName = other.tableName; - } - } - - public TGetPrimaryKeysReq deepCopy() { - return new TGetPrimaryKeysReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - this.tableName = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - public String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - public String getTableName() { - return this.tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public void unsetTableName() { - this.tableName = null; - } - - /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ - public boolean isSetTableName() { - return this.tableName != null; - } - - public void setTableNameIsSet(boolean value) { - if (!value) { - this.tableName = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((String)value); - } - break; - - case TABLE_NAME: - if (value == null) { - unsetTableName(); - } else { - setTableName((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - case TABLE_NAME: - return getTableName(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - case TABLE_NAME: - return isSetTableName(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetPrimaryKeysReq) - return this.equals((TGetPrimaryKeysReq)that); - return false; - } - - public boolean equals(TGetPrimaryKeysReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - boolean this_present_tableName = true && this.isSetTableName(); - boolean that_present_tableName = true && that.isSetTableName(); - if (this_present_tableName || that_present_tableName) { - if (!(this_present_tableName && that_present_tableName)) - return false; - if (!this.tableName.equals(that.tableName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_catalogName = true && (isSetCatalogName()); - list.add(present_catalogName); - if (present_catalogName) - list.add(catalogName); - - boolean present_schemaName = true && (isSetSchemaName()); - list.add(present_schemaName); - if (present_schemaName) - list.add(schemaName); - - boolean present_tableName = true && (isSetTableName()); - list.add(present_tableName); - if (present_tableName) - list.add(tableName); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetPrimaryKeysReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTableName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetPrimaryKeysReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - if (isSetTableName()) { - if (!first) sb.append(", "); - sb.append("tableName:"); - if (this.tableName == null) { - sb.append("null"); - } else { - sb.append(this.tableName); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetPrimaryKeysReqStandardSchemeFactory implements SchemeFactory { - public TGetPrimaryKeysReqStandardScheme getScheme() { - return new TGetPrimaryKeysReqStandardScheme(); - } - } - - private static class TGetPrimaryKeysReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // TABLE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - if (struct.tableName != null) { - if (struct.isSetTableName()) { - oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); - oprot.writeString(struct.tableName); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetPrimaryKeysReqTupleSchemeFactory implements SchemeFactory { - public TGetPrimaryKeysReqTupleScheme getScheme() { - return new TGetPrimaryKeysReqTupleScheme(); - } - } - - private static class TGetPrimaryKeysReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - if (struct.isSetTableName()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - if (struct.isSetTableName()) { - oprot.writeString(struct.tableName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - if (incoming.get(2)) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetPrimaryKeysResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetPrimaryKeysResp.java deleted file mode 100644 index 72d9507fe1031..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetPrimaryKeysResp.java +++ /dev/null @@ -1,509 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetPrimaryKeysResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetPrimaryKeysResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetPrimaryKeysRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetPrimaryKeysRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetPrimaryKeysResp.class, metaDataMap); - } - - public TGetPrimaryKeysResp() { - } - - public TGetPrimaryKeysResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetPrimaryKeysResp(TGetPrimaryKeysResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetPrimaryKeysResp deepCopy() { - return new TGetPrimaryKeysResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetPrimaryKeysResp) - return this.equals((TGetPrimaryKeysResp)that); - return false; - } - - public boolean equals(TGetPrimaryKeysResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetPrimaryKeysResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetPrimaryKeysResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetPrimaryKeysRespStandardSchemeFactory implements SchemeFactory { - public TGetPrimaryKeysRespStandardScheme getScheme() { - return new TGetPrimaryKeysRespStandardScheme(); - } - } - - private static class TGetPrimaryKeysRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetPrimaryKeysRespTupleSchemeFactory implements SchemeFactory { - public TGetPrimaryKeysRespTupleScheme getScheme() { - return new TGetPrimaryKeysRespTupleScheme(); - } - } - - private static class TGetPrimaryKeysRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetPrimaryKeysResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetResultSetMetadataReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetResultSetMetadataReq.java deleted file mode 100644 index b94d827de264d..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetResultSetMetadataReq.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetResultSetMetadataReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataReq"); - - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetResultSetMetadataReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetResultSetMetadataReqTupleSchemeFactory()); - } - - private TOperationHandle operationHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OPERATION_HANDLE((short)1, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataReq.class, metaDataMap); - } - - public TGetResultSetMetadataReq() { - } - - public TGetResultSetMetadataReq( - TOperationHandle operationHandle) - { - this(); - this.operationHandle = operationHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetResultSetMetadataReq(TGetResultSetMetadataReq other) { - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetResultSetMetadataReq deepCopy() { - return new TGetResultSetMetadataReq(this); - } - - @Override - public void clear() { - this.operationHandle = null; - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetResultSetMetadataReq) - return this.equals((TGetResultSetMetadataReq)that); - return false; - } - - public boolean equals(TGetResultSetMetadataReq that) { - if (that == null) - return false; - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetResultSetMetadataReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetResultSetMetadataReq("); - boolean first = true; - - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetResultSetMetadataReqStandardSchemeFactory implements SchemeFactory { - public TGetResultSetMetadataReqStandardScheme getScheme() { - return new TGetResultSetMetadataReqStandardScheme(); - } - } - - private static class TGetResultSetMetadataReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationHandle != null) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetResultSetMetadataReqTupleSchemeFactory implements SchemeFactory { - public TGetResultSetMetadataReqTupleScheme getScheme() { - return new TGetResultSetMetadataReqTupleScheme(); - } - } - - private static class TGetResultSetMetadataReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.operationHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetResultSetMetadataResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetResultSetMetadataResp.java deleted file mode 100644 index ae2021ebd5a10..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetResultSetMetadataResp.java +++ /dev/null @@ -1,509 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetResultSetMetadataResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetResultSetMetadataResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField SCHEMA_FIELD_DESC = new org.apache.thrift.protocol.TField("schema", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetResultSetMetadataRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetResultSetMetadataRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TTableSchema schema; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - SCHEMA((short)2, "schema"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // SCHEMA - return SCHEMA; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.SCHEMA}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.SCHEMA, new org.apache.thrift.meta_data.FieldMetaData("schema", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTableSchema.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetResultSetMetadataResp.class, metaDataMap); - } - - public TGetResultSetMetadataResp() { - } - - public TGetResultSetMetadataResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetResultSetMetadataResp(TGetResultSetMetadataResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetSchema()) { - this.schema = new TTableSchema(other.schema); - } - } - - public TGetResultSetMetadataResp deepCopy() { - return new TGetResultSetMetadataResp(this); - } - - @Override - public void clear() { - this.status = null; - this.schema = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TTableSchema getSchema() { - return this.schema; - } - - public void setSchema(TTableSchema schema) { - this.schema = schema; - } - - public void unsetSchema() { - this.schema = null; - } - - /** Returns true if field schema is set (has been assigned a value) and false otherwise */ - public boolean isSetSchema() { - return this.schema != null; - } - - public void setSchemaIsSet(boolean value) { - if (!value) { - this.schema = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case SCHEMA: - if (value == null) { - unsetSchema(); - } else { - setSchema((TTableSchema)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case SCHEMA: - return getSchema(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case SCHEMA: - return isSetSchema(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetResultSetMetadataResp) - return this.equals((TGetResultSetMetadataResp)that); - return false; - } - - public boolean equals(TGetResultSetMetadataResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_schema = true && this.isSetSchema(); - boolean that_present_schema = true && that.isSetSchema(); - if (this_present_schema || that_present_schema) { - if (!(this_present_schema && that_present_schema)) - return false; - if (!this.schema.equals(that.schema)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_schema = true && (isSetSchema()); - list.add(present_schema); - if (present_schema) - list.add(schema); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetResultSetMetadataResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSchema()).compareTo(other.isSetSchema()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchema()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schema, other.schema); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetResultSetMetadataResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetSchema()) { - if (!first) sb.append(", "); - sb.append("schema:"); - if (this.schema == null) { - sb.append("null"); - } else { - sb.append(this.schema); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (schema != null) { - schema.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetResultSetMetadataRespStandardSchemeFactory implements SchemeFactory { - public TGetResultSetMetadataRespStandardScheme getScheme() { - return new TGetResultSetMetadataRespStandardScheme(); - } - } - - private static class TGetResultSetMetadataRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SCHEMA - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.schema = new TTableSchema(); - struct.schema.read(iprot); - struct.setSchemaIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.schema != null) { - if (struct.isSetSchema()) { - oprot.writeFieldBegin(SCHEMA_FIELD_DESC); - struct.schema.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetResultSetMetadataRespTupleSchemeFactory implements SchemeFactory { - public TGetResultSetMetadataRespTupleScheme getScheme() { - return new TGetResultSetMetadataRespTupleScheme(); - } - } - - private static class TGetResultSetMetadataRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetSchema()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSchema()) { - struct.schema.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetResultSetMetadataResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.schema = new TTableSchema(); - struct.schema.read(iprot); - struct.setSchemaIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetSchemasReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetSchemasReq.java deleted file mode 100644 index 17eed87ae096f..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetSchemasReq.java +++ /dev/null @@ -1,610 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetSchemasReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetSchemasReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetSchemasReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasReq.class, metaDataMap); - } - - public TGetSchemasReq() { - } - - public TGetSchemasReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetSchemasReq(TGetSchemasReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - } - - public TGetSchemasReq deepCopy() { - return new TGetSchemasReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - public String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetSchemasReq) - return this.equals((TGetSchemasReq)that); - return false; - } - - public boolean equals(TGetSchemasReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_catalogName = true && (isSetCatalogName()); - list.add(present_catalogName); - if (present_catalogName) - list.add(catalogName); - - boolean present_schemaName = true && (isSetSchemaName()); - list.add(present_schemaName); - if (present_schemaName) - list.add(schemaName); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetSchemasReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetSchemasReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetSchemasReqStandardSchemeFactory implements SchemeFactory { - public TGetSchemasReqStandardScheme getScheme() { - return new TGetSchemasReqStandardScheme(); - } - } - - private static class TGetSchemasReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetSchemasReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetSchemasReqTupleSchemeFactory implements SchemeFactory { - public TGetSchemasReqTupleScheme getScheme() { - return new TGetSchemasReqTupleScheme(); - } - } - - private static class TGetSchemasReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetSchemasResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetSchemasResp.java deleted file mode 100644 index e5317f7ff5046..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetSchemasResp.java +++ /dev/null @@ -1,509 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetSchemasResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetSchemasResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetSchemasRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetSchemasRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetSchemasResp.class, metaDataMap); - } - - public TGetSchemasResp() { - } - - public TGetSchemasResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetSchemasResp(TGetSchemasResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetSchemasResp deepCopy() { - return new TGetSchemasResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetSchemasResp) - return this.equals((TGetSchemasResp)that); - return false; - } - - public boolean equals(TGetSchemasResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetSchemasResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetSchemasResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetSchemasRespStandardSchemeFactory implements SchemeFactory { - public TGetSchemasRespStandardScheme getScheme() { - return new TGetSchemasRespStandardScheme(); - } - } - - private static class TGetSchemasRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetSchemasResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetSchemasResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetSchemasRespTupleSchemeFactory implements SchemeFactory { - public TGetSchemasRespTupleScheme getScheme() { - return new TGetSchemasRespTupleScheme(); - } - } - - private static class TGetSchemasRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetSchemasResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTableTypesReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTableTypesReq.java deleted file mode 100644 index c027748a336e6..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTableTypesReq.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetTableTypesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTableTypesReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTableTypesReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesReq.class, metaDataMap); - } - - public TGetTableTypesReq() { - } - - public TGetTableTypesReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetTableTypesReq(TGetTableTypesReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - } - - public TGetTableTypesReq deepCopy() { - return new TGetTableTypesReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetTableTypesReq) - return this.equals((TGetTableTypesReq)that); - return false; - } - - public boolean equals(TGetTableTypesReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetTableTypesReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTableTypesReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetTableTypesReqStandardSchemeFactory implements SchemeFactory { - public TGetTableTypesReqStandardScheme getScheme() { - return new TGetTableTypesReqStandardScheme(); - } - } - - private static class TGetTableTypesReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTableTypesReqTupleSchemeFactory implements SchemeFactory { - public TGetTableTypesReqTupleScheme getScheme() { - return new TGetTableTypesReqTupleScheme(); - } - } - - private static class TGetTableTypesReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTableTypesResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTableTypesResp.java deleted file mode 100644 index c6ce0d4368fdd..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTableTypesResp.java +++ /dev/null @@ -1,509 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetTableTypesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTableTypesResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTableTypesRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTableTypesRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTableTypesResp.class, metaDataMap); - } - - public TGetTableTypesResp() { - } - - public TGetTableTypesResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetTableTypesResp(TGetTableTypesResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetTableTypesResp deepCopy() { - return new TGetTableTypesResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetTableTypesResp) - return this.equals((TGetTableTypesResp)that); - return false; - } - - public boolean equals(TGetTableTypesResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetTableTypesResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTableTypesResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetTableTypesRespStandardSchemeFactory implements SchemeFactory { - public TGetTableTypesRespStandardScheme getScheme() { - return new TGetTableTypesRespStandardScheme(); - } - } - - private static class TGetTableTypesRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTableTypesRespTupleSchemeFactory implements SchemeFactory { - public TGetTableTypesRespTupleScheme getScheme() { - return new TGetTableTypesRespTupleScheme(); - } - } - - private static class TGetTableTypesRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTableTypesResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTablesReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTablesReq.java deleted file mode 100644 index 1aa3f946727b6..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTablesReq.java +++ /dev/null @@ -1,871 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetTablesReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField CATALOG_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("catalogName", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField SCHEMA_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("schemaName", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField TABLE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("tableName", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField TABLE_TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("tableTypes", org.apache.thrift.protocol.TType.LIST, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTablesReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTablesReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String catalogName; // optional - private String schemaName; // optional - private String tableName; // optional - private List tableTypes; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - CATALOG_NAME((short)2, "catalogName"), - SCHEMA_NAME((short)3, "schemaName"), - TABLE_NAME((short)4, "tableName"), - TABLE_TYPES((short)5, "tableTypes"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // CATALOG_NAME - return CATALOG_NAME; - case 3: // SCHEMA_NAME - return SCHEMA_NAME; - case 4: // TABLE_NAME - return TABLE_NAME; - case 5: // TABLE_TYPES - return TABLE_TYPES; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.CATALOG_NAME,_Fields.SCHEMA_NAME,_Fields.TABLE_NAME,_Fields.TABLE_TYPES}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.CATALOG_NAME, new org.apache.thrift.meta_data.FieldMetaData("catalogName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.SCHEMA_NAME, new org.apache.thrift.meta_data.FieldMetaData("schemaName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.TABLE_NAME, new org.apache.thrift.meta_data.FieldMetaData("tableName", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "TPatternOrIdentifier"))); - tmpMap.put(_Fields.TABLE_TYPES, new org.apache.thrift.meta_data.FieldMetaData("tableTypes", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesReq.class, metaDataMap); - } - - public TGetTablesReq() { - } - - public TGetTablesReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetTablesReq(TGetTablesReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetCatalogName()) { - this.catalogName = other.catalogName; - } - if (other.isSetSchemaName()) { - this.schemaName = other.schemaName; - } - if (other.isSetTableName()) { - this.tableName = other.tableName; - } - if (other.isSetTableTypes()) { - List __this__tableTypes = new ArrayList(other.tableTypes); - this.tableTypes = __this__tableTypes; - } - } - - public TGetTablesReq deepCopy() { - return new TGetTablesReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.catalogName = null; - this.schemaName = null; - this.tableName = null; - this.tableTypes = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getCatalogName() { - return this.catalogName; - } - - public void setCatalogName(String catalogName) { - this.catalogName = catalogName; - } - - public void unsetCatalogName() { - this.catalogName = null; - } - - /** Returns true if field catalogName is set (has been assigned a value) and false otherwise */ - public boolean isSetCatalogName() { - return this.catalogName != null; - } - - public void setCatalogNameIsSet(boolean value) { - if (!value) { - this.catalogName = null; - } - } - - public String getSchemaName() { - return this.schemaName; - } - - public void setSchemaName(String schemaName) { - this.schemaName = schemaName; - } - - public void unsetSchemaName() { - this.schemaName = null; - } - - /** Returns true if field schemaName is set (has been assigned a value) and false otherwise */ - public boolean isSetSchemaName() { - return this.schemaName != null; - } - - public void setSchemaNameIsSet(boolean value) { - if (!value) { - this.schemaName = null; - } - } - - public String getTableName() { - return this.tableName; - } - - public void setTableName(String tableName) { - this.tableName = tableName; - } - - public void unsetTableName() { - this.tableName = null; - } - - /** Returns true if field tableName is set (has been assigned a value) and false otherwise */ - public boolean isSetTableName() { - return this.tableName != null; - } - - public void setTableNameIsSet(boolean value) { - if (!value) { - this.tableName = null; - } - } - - public int getTableTypesSize() { - return (this.tableTypes == null) ? 0 : this.tableTypes.size(); - } - - public java.util.Iterator getTableTypesIterator() { - return (this.tableTypes == null) ? null : this.tableTypes.iterator(); - } - - public void addToTableTypes(String elem) { - if (this.tableTypes == null) { - this.tableTypes = new ArrayList(); - } - this.tableTypes.add(elem); - } - - public List getTableTypes() { - return this.tableTypes; - } - - public void setTableTypes(List tableTypes) { - this.tableTypes = tableTypes; - } - - public void unsetTableTypes() { - this.tableTypes = null; - } - - /** Returns true if field tableTypes is set (has been assigned a value) and false otherwise */ - public boolean isSetTableTypes() { - return this.tableTypes != null; - } - - public void setTableTypesIsSet(boolean value) { - if (!value) { - this.tableTypes = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CATALOG_NAME: - if (value == null) { - unsetCatalogName(); - } else { - setCatalogName((String)value); - } - break; - - case SCHEMA_NAME: - if (value == null) { - unsetSchemaName(); - } else { - setSchemaName((String)value); - } - break; - - case TABLE_NAME: - if (value == null) { - unsetTableName(); - } else { - setTableName((String)value); - } - break; - - case TABLE_TYPES: - if (value == null) { - unsetTableTypes(); - } else { - setTableTypes((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case CATALOG_NAME: - return getCatalogName(); - - case SCHEMA_NAME: - return getSchemaName(); - - case TABLE_NAME: - return getTableName(); - - case TABLE_TYPES: - return getTableTypes(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case CATALOG_NAME: - return isSetCatalogName(); - case SCHEMA_NAME: - return isSetSchemaName(); - case TABLE_NAME: - return isSetTableName(); - case TABLE_TYPES: - return isSetTableTypes(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetTablesReq) - return this.equals((TGetTablesReq)that); - return false; - } - - public boolean equals(TGetTablesReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_catalogName = true && this.isSetCatalogName(); - boolean that_present_catalogName = true && that.isSetCatalogName(); - if (this_present_catalogName || that_present_catalogName) { - if (!(this_present_catalogName && that_present_catalogName)) - return false; - if (!this.catalogName.equals(that.catalogName)) - return false; - } - - boolean this_present_schemaName = true && this.isSetSchemaName(); - boolean that_present_schemaName = true && that.isSetSchemaName(); - if (this_present_schemaName || that_present_schemaName) { - if (!(this_present_schemaName && that_present_schemaName)) - return false; - if (!this.schemaName.equals(that.schemaName)) - return false; - } - - boolean this_present_tableName = true && this.isSetTableName(); - boolean that_present_tableName = true && that.isSetTableName(); - if (this_present_tableName || that_present_tableName) { - if (!(this_present_tableName && that_present_tableName)) - return false; - if (!this.tableName.equals(that.tableName)) - return false; - } - - boolean this_present_tableTypes = true && this.isSetTableTypes(); - boolean that_present_tableTypes = true && that.isSetTableTypes(); - if (this_present_tableTypes || that_present_tableTypes) { - if (!(this_present_tableTypes && that_present_tableTypes)) - return false; - if (!this.tableTypes.equals(that.tableTypes)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_catalogName = true && (isSetCatalogName()); - list.add(present_catalogName); - if (present_catalogName) - list.add(catalogName); - - boolean present_schemaName = true && (isSetSchemaName()); - list.add(present_schemaName); - if (present_schemaName) - list.add(schemaName); - - boolean present_tableName = true && (isSetTableName()); - list.add(present_tableName); - if (present_tableName) - list.add(tableName); - - boolean present_tableTypes = true && (isSetTableTypes()); - list.add(present_tableTypes); - if (present_tableTypes) - list.add(tableTypes); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetTablesReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetCatalogName()).compareTo(other.isSetCatalogName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetCatalogName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.catalogName, other.catalogName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSchemaName()).compareTo(other.isSetSchemaName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSchemaName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.schemaName, other.schemaName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTableName()).compareTo(other.isSetTableName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTableName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableName, other.tableName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTableTypes()).compareTo(other.isSetTableTypes()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTableTypes()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tableTypes, other.tableTypes); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTablesReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (isSetCatalogName()) { - if (!first) sb.append(", "); - sb.append("catalogName:"); - if (this.catalogName == null) { - sb.append("null"); - } else { - sb.append(this.catalogName); - } - first = false; - } - if (isSetSchemaName()) { - if (!first) sb.append(", "); - sb.append("schemaName:"); - if (this.schemaName == null) { - sb.append("null"); - } else { - sb.append(this.schemaName); - } - first = false; - } - if (isSetTableName()) { - if (!first) sb.append(", "); - sb.append("tableName:"); - if (this.tableName == null) { - sb.append("null"); - } else { - sb.append(this.tableName); - } - first = false; - } - if (isSetTableTypes()) { - if (!first) sb.append(", "); - sb.append("tableTypes:"); - if (this.tableTypes == null) { - sb.append("null"); - } else { - sb.append(this.tableTypes); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetTablesReqStandardSchemeFactory implements SchemeFactory { - public TGetTablesReqStandardScheme getScheme() { - return new TGetTablesReqStandardScheme(); - } - } - - private static class TGetTablesReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // CATALOG_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SCHEMA_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // TABLE_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // TABLE_TYPES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list172 = iprot.readListBegin(); - struct.tableTypes = new ArrayList(_list172.size); - String _elem173; - for (int _i174 = 0; _i174 < _list172.size; ++_i174) - { - _elem173 = iprot.readString(); - struct.tableTypes.add(_elem173); - } - iprot.readListEnd(); - } - struct.setTableTypesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.catalogName != null) { - if (struct.isSetCatalogName()) { - oprot.writeFieldBegin(CATALOG_NAME_FIELD_DESC); - oprot.writeString(struct.catalogName); - oprot.writeFieldEnd(); - } - } - if (struct.schemaName != null) { - if (struct.isSetSchemaName()) { - oprot.writeFieldBegin(SCHEMA_NAME_FIELD_DESC); - oprot.writeString(struct.schemaName); - oprot.writeFieldEnd(); - } - } - if (struct.tableName != null) { - if (struct.isSetTableName()) { - oprot.writeFieldBegin(TABLE_NAME_FIELD_DESC); - oprot.writeString(struct.tableName); - oprot.writeFieldEnd(); - } - } - if (struct.tableTypes != null) { - if (struct.isSetTableTypes()) { - oprot.writeFieldBegin(TABLE_TYPES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tableTypes.size())); - for (String _iter175 : struct.tableTypes) - { - oprot.writeString(_iter175); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTablesReqTupleSchemeFactory implements SchemeFactory { - public TGetTablesReqTupleScheme getScheme() { - return new TGetTablesReqTupleScheme(); - } - } - - private static class TGetTablesReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetCatalogName()) { - optionals.set(0); - } - if (struct.isSetSchemaName()) { - optionals.set(1); - } - if (struct.isSetTableName()) { - optionals.set(2); - } - if (struct.isSetTableTypes()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetCatalogName()) { - oprot.writeString(struct.catalogName); - } - if (struct.isSetSchemaName()) { - oprot.writeString(struct.schemaName); - } - if (struct.isSetTableName()) { - oprot.writeString(struct.tableName); - } - if (struct.isSetTableTypes()) { - { - oprot.writeI32(struct.tableTypes.size()); - for (String _iter176 : struct.tableTypes) - { - oprot.writeString(_iter176); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - struct.catalogName = iprot.readString(); - struct.setCatalogNameIsSet(true); - } - if (incoming.get(1)) { - struct.schemaName = iprot.readString(); - struct.setSchemaNameIsSet(true); - } - if (incoming.get(2)) { - struct.tableName = iprot.readString(); - struct.setTableNameIsSet(true); - } - if (incoming.get(3)) { - { - org.apache.thrift.protocol.TList _list177 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.tableTypes = new ArrayList(_list177.size); - String _elem178; - for (int _i179 = 0; _i179 < _list177.size; ++_i179) - { - _elem178 = iprot.readString(); - struct.tableTypes.add(_elem178); - } - } - struct.setTableTypesIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTablesResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTablesResp.java deleted file mode 100644 index 0b7c3825d35a5..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTablesResp.java +++ /dev/null @@ -1,509 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetTablesResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTablesResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTablesRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTablesRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTablesResp.class, metaDataMap); - } - - public TGetTablesResp() { - } - - public TGetTablesResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetTablesResp(TGetTablesResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetTablesResp deepCopy() { - return new TGetTablesResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetTablesResp) - return this.equals((TGetTablesResp)that); - return false; - } - - public boolean equals(TGetTablesResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetTablesResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTablesResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetTablesRespStandardSchemeFactory implements SchemeFactory { - public TGetTablesRespStandardScheme getScheme() { - return new TGetTablesRespStandardScheme(); - } - } - - private static class TGetTablesRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTablesResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTablesResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTablesRespTupleSchemeFactory implements SchemeFactory { - public TGetTablesRespTupleScheme getScheme() { - return new TGetTablesRespTupleScheme(); - } - } - - private static class TGetTablesRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTablesResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTypeInfoReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTypeInfoReq.java deleted file mode 100644 index 2e0ec60e4bc3d..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTypeInfoReq.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetTypeInfoReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTypeInfoReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTypeInfoReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoReq.class, metaDataMap); - } - - public TGetTypeInfoReq() { - } - - public TGetTypeInfoReq( - TSessionHandle sessionHandle) - { - this(); - this.sessionHandle = sessionHandle; - } - - /** - * Performs a deep copy on other. - */ - public TGetTypeInfoReq(TGetTypeInfoReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - } - - public TGetTypeInfoReq deepCopy() { - return new TGetTypeInfoReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetTypeInfoReq) - return this.equals((TGetTypeInfoReq)that); - return false; - } - - public boolean equals(TGetTypeInfoReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetTypeInfoReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTypeInfoReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetTypeInfoReqStandardSchemeFactory implements SchemeFactory { - public TGetTypeInfoReqStandardScheme getScheme() { - return new TGetTypeInfoReqStandardScheme(); - } - } - - private static class TGetTypeInfoReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTypeInfoReqTupleSchemeFactory implements SchemeFactory { - public TGetTypeInfoReqTupleScheme getScheme() { - return new TGetTypeInfoReqTupleScheme(); - } - } - - private static class TGetTypeInfoReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTypeInfoResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTypeInfoResp.java deleted file mode 100644 index cc2910ef29feb..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TGetTypeInfoResp.java +++ /dev/null @@ -1,509 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TGetTypeInfoResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TGetTypeInfoResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationHandle", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TGetTypeInfoRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TGetTypeInfoRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TOperationHandle operationHandle; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - OPERATION_HANDLE((short)2, "operationHandle"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // OPERATION_HANDLE - return OPERATION_HANDLE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.OPERATION_HANDLE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.OPERATION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("operationHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TOperationHandle.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TGetTypeInfoResp.class, metaDataMap); - } - - public TGetTypeInfoResp() { - } - - public TGetTypeInfoResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TGetTypeInfoResp(TGetTypeInfoResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetOperationHandle()) { - this.operationHandle = new TOperationHandle(other.operationHandle); - } - } - - public TGetTypeInfoResp deepCopy() { - return new TGetTypeInfoResp(this); - } - - @Override - public void clear() { - this.status = null; - this.operationHandle = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public TOperationHandle getOperationHandle() { - return this.operationHandle; - } - - public void setOperationHandle(TOperationHandle operationHandle) { - this.operationHandle = operationHandle; - } - - public void unsetOperationHandle() { - this.operationHandle = null; - } - - /** Returns true if field operationHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationHandle() { - return this.operationHandle != null; - } - - public void setOperationHandleIsSet(boolean value) { - if (!value) { - this.operationHandle = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case OPERATION_HANDLE: - if (value == null) { - unsetOperationHandle(); - } else { - setOperationHandle((TOperationHandle)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case OPERATION_HANDLE: - return getOperationHandle(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case OPERATION_HANDLE: - return isSetOperationHandle(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TGetTypeInfoResp) - return this.equals((TGetTypeInfoResp)that); - return false; - } - - public boolean equals(TGetTypeInfoResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_operationHandle = true && this.isSetOperationHandle(); - boolean that_present_operationHandle = true && that.isSetOperationHandle(); - if (this_present_operationHandle || that_present_operationHandle) { - if (!(this_present_operationHandle && that_present_operationHandle)) - return false; - if (!this.operationHandle.equals(that.operationHandle)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_operationHandle = true && (isSetOperationHandle()); - list.add(present_operationHandle); - if (present_operationHandle) - list.add(operationHandle); - - return list.hashCode(); - } - - @Override - public int compareTo(TGetTypeInfoResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationHandle()).compareTo(other.isSetOperationHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationHandle, other.operationHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TGetTypeInfoResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (isSetOperationHandle()) { - if (!first) sb.append(", "); - sb.append("operationHandle:"); - if (this.operationHandle == null) { - sb.append("null"); - } else { - sb.append(this.operationHandle); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (operationHandle != null) { - operationHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TGetTypeInfoRespStandardSchemeFactory implements SchemeFactory { - public TGetTypeInfoRespStandardScheme getScheme() { - return new TGetTypeInfoRespStandardScheme(); - } - } - - private static class TGetTypeInfoRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationHandle != null) { - if (struct.isSetOperationHandle()) { - oprot.writeFieldBegin(OPERATION_HANDLE_FIELD_DESC); - struct.operationHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TGetTypeInfoRespTupleSchemeFactory implements SchemeFactory { - public TGetTypeInfoRespTupleScheme getScheme() { - return new TGetTypeInfoRespTupleScheme(); - } - } - - private static class TGetTypeInfoRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - BitSet optionals = new BitSet(); - if (struct.isSetOperationHandle()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetOperationHandle()) { - struct.operationHandle.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TGetTypeInfoResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.operationHandle = new TOperationHandle(); - struct.operationHandle.read(iprot); - struct.setOperationHandleIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/THandleIdentifier.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/THandleIdentifier.java deleted file mode 100644 index a3879d830000b..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/THandleIdentifier.java +++ /dev/null @@ -1,508 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class THandleIdentifier implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("THandleIdentifier"); - - private static final org.apache.thrift.protocol.TField GUID_FIELD_DESC = new org.apache.thrift.protocol.TField("guid", org.apache.thrift.protocol.TType.STRING, (short)1); - private static final org.apache.thrift.protocol.TField SECRET_FIELD_DESC = new org.apache.thrift.protocol.TField("secret", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new THandleIdentifierStandardSchemeFactory()); - schemes.put(TupleScheme.class, new THandleIdentifierTupleSchemeFactory()); - } - - private ByteBuffer guid; // required - private ByteBuffer secret; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - GUID((short)1, "guid"), - SECRET((short)2, "secret"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // GUID - return GUID; - case 2: // SECRET - return SECRET; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.GUID, new org.apache.thrift.meta_data.FieldMetaData("guid", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.SECRET, new org.apache.thrift.meta_data.FieldMetaData("secret", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(THandleIdentifier.class, metaDataMap); - } - - public THandleIdentifier() { - } - - public THandleIdentifier( - ByteBuffer guid, - ByteBuffer secret) - { - this(); - this.guid = org.apache.thrift.TBaseHelper.copyBinary(guid); - this.secret = org.apache.thrift.TBaseHelper.copyBinary(secret); - } - - /** - * Performs a deep copy on other. - */ - public THandleIdentifier(THandleIdentifier other) { - if (other.isSetGuid()) { - this.guid = org.apache.thrift.TBaseHelper.copyBinary(other.guid); - } - if (other.isSetSecret()) { - this.secret = org.apache.thrift.TBaseHelper.copyBinary(other.secret); - } - } - - public THandleIdentifier deepCopy() { - return new THandleIdentifier(this); - } - - @Override - public void clear() { - this.guid = null; - this.secret = null; - } - - public byte[] getGuid() { - setGuid(org.apache.thrift.TBaseHelper.rightSize(guid)); - return guid == null ? null : guid.array(); - } - - public ByteBuffer bufferForGuid() { - return org.apache.thrift.TBaseHelper.copyBinary(guid); - } - - public void setGuid(byte[] guid) { - this.guid = guid == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(guid, guid.length)); - } - - public void setGuid(ByteBuffer guid) { - this.guid = org.apache.thrift.TBaseHelper.copyBinary(guid); - } - - public void unsetGuid() { - this.guid = null; - } - - /** Returns true if field guid is set (has been assigned a value) and false otherwise */ - public boolean isSetGuid() { - return this.guid != null; - } - - public void setGuidIsSet(boolean value) { - if (!value) { - this.guid = null; - } - } - - public byte[] getSecret() { - setSecret(org.apache.thrift.TBaseHelper.rightSize(secret)); - return secret == null ? null : secret.array(); - } - - public ByteBuffer bufferForSecret() { - return org.apache.thrift.TBaseHelper.copyBinary(secret); - } - - public void setSecret(byte[] secret) { - this.secret = secret == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(secret, secret.length)); - } - - public void setSecret(ByteBuffer secret) { - this.secret = org.apache.thrift.TBaseHelper.copyBinary(secret); - } - - public void unsetSecret() { - this.secret = null; - } - - /** Returns true if field secret is set (has been assigned a value) and false otherwise */ - public boolean isSetSecret() { - return this.secret != null; - } - - public void setSecretIsSet(boolean value) { - if (!value) { - this.secret = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case GUID: - if (value == null) { - unsetGuid(); - } else { - setGuid((ByteBuffer)value); - } - break; - - case SECRET: - if (value == null) { - unsetSecret(); - } else { - setSecret((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case GUID: - return getGuid(); - - case SECRET: - return getSecret(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case GUID: - return isSetGuid(); - case SECRET: - return isSetSecret(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof THandleIdentifier) - return this.equals((THandleIdentifier)that); - return false; - } - - public boolean equals(THandleIdentifier that) { - if (that == null) - return false; - - boolean this_present_guid = true && this.isSetGuid(); - boolean that_present_guid = true && that.isSetGuid(); - if (this_present_guid || that_present_guid) { - if (!(this_present_guid && that_present_guid)) - return false; - if (!this.guid.equals(that.guid)) - return false; - } - - boolean this_present_secret = true && this.isSetSecret(); - boolean that_present_secret = true && that.isSetSecret(); - if (this_present_secret || that_present_secret) { - if (!(this_present_secret && that_present_secret)) - return false; - if (!this.secret.equals(that.secret)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_guid = true && (isSetGuid()); - list.add(present_guid); - if (present_guid) - list.add(guid); - - boolean present_secret = true && (isSetSecret()); - list.add(present_secret); - if (present_secret) - list.add(secret); - - return list.hashCode(); - } - - @Override - public int compareTo(THandleIdentifier other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetGuid()).compareTo(other.isSetGuid()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetGuid()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.guid, other.guid); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSecret()).compareTo(other.isSetSecret()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSecret()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.secret, other.secret); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("THandleIdentifier("); - boolean first = true; - - sb.append("guid:"); - if (this.guid == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.guid, sb); - } - first = false; - if (!first) sb.append(", "); - sb.append("secret:"); - if (this.secret == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.secret, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetGuid()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'guid' is unset! Struct:" + toString()); - } - - if (!isSetSecret()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'secret' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class THandleIdentifierStandardSchemeFactory implements SchemeFactory { - public THandleIdentifierStandardScheme getScheme() { - return new THandleIdentifierStandardScheme(); - } - } - - private static class THandleIdentifierStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, THandleIdentifier struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // GUID - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.guid = iprot.readBinary(); - struct.setGuidIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SECRET - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.secret = iprot.readBinary(); - struct.setSecretIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, THandleIdentifier struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.guid != null) { - oprot.writeFieldBegin(GUID_FIELD_DESC); - oprot.writeBinary(struct.guid); - oprot.writeFieldEnd(); - } - if (struct.secret != null) { - oprot.writeFieldBegin(SECRET_FIELD_DESC); - oprot.writeBinary(struct.secret); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class THandleIdentifierTupleSchemeFactory implements SchemeFactory { - public THandleIdentifierTupleScheme getScheme() { - return new THandleIdentifierTupleScheme(); - } - } - - private static class THandleIdentifierTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeBinary(struct.guid); - oprot.writeBinary(struct.secret); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, THandleIdentifier struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.guid = iprot.readBinary(); - struct.setGuidIsSet(true); - struct.secret = iprot.readBinary(); - struct.setSecretIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI16Column.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI16Column.java deleted file mode 100644 index 3c44b602b4ff7..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI16Column.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TI16Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Column"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI16ColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI16ColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Column.class, metaDataMap); - } - - public TI16Column() { - } - - public TI16Column( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TI16Column(TI16Column other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TI16Column deepCopy() { - return new TI16Column(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(short elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TI16Column) - return this.equals((TI16Column)that); - return false; - } - - public boolean equals(TI16Column that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); - - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); - - return list.hashCode(); - } - - @Override - public int compareTo(TI16Column other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI16Column("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TI16ColumnStandardSchemeFactory implements SchemeFactory { - public TI16ColumnStandardScheme getScheme() { - return new TI16ColumnStandardScheme(); - } - } - - private static class TI16ColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list70 = iprot.readListBegin(); - struct.values = new ArrayList(_list70.size); - short _elem71; - for (int _i72 = 0; _i72 < _list70.size; ++_i72) - { - _elem71 = iprot.readI16(); - struct.values.add(_elem71); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TI16Column struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, struct.values.size())); - for (short _iter73 : struct.values) - { - oprot.writeI16(_iter73); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI16ColumnTupleSchemeFactory implements SchemeFactory { - public TI16ColumnTupleScheme getScheme() { - return new TI16ColumnTupleScheme(); - } - } - - private static class TI16ColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (short _iter74 : struct.values) - { - oprot.writeI16(_iter74); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI16Column struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list75 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I16, iprot.readI32()); - struct.values = new ArrayList(_list75.size); - short _elem76; - for (int _i77 = 0; _i77 < _list75.size; ++_i77) - { - _elem76 = iprot.readI16(); - struct.values.add(_elem76); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI16Value.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI16Value.java deleted file mode 100644 index 29fb4cb85201d..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI16Value.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TI16Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI16Value"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I16, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI16ValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI16ValueTupleSchemeFactory()); - } - - private short value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I16))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI16Value.class, metaDataMap); - } - - public TI16Value() { - } - - /** - * Performs a deep copy on other. - */ - public TI16Value(TI16Value other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TI16Value deepCopy() { - return new TI16Value(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0; - } - - public short getValue() { - return this.value; - } - - public void setValue(short value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((Short)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TI16Value) - return this.equals((TI16Value)that); - return false; - } - - public boolean equals(TI16Value that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); - - return list.hashCode(); - } - - @Override - public int compareTo(TI16Value other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI16Value("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TI16ValueStandardSchemeFactory implements SchemeFactory { - public TI16ValueStandardScheme getScheme() { - return new TI16ValueStandardScheme(); - } - } - - private static class TI16ValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI16Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I16) { - struct.value = iprot.readI16(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TI16Value struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeI16(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI16ValueTupleSchemeFactory implements SchemeFactory { - public TI16ValueTupleScheme getScheme() { - return new TI16ValueTupleScheme(); - } - } - - private static class TI16ValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeI16(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI16Value struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readI16(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI32Column.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI32Column.java deleted file mode 100644 index 9834f1ce8f01b..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI32Column.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TI32Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Column"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI32ColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI32ColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Column.class, metaDataMap); - } - - public TI32Column() { - } - - public TI32Column( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TI32Column(TI32Column other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TI32Column deepCopy() { - return new TI32Column(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(int elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TI32Column) - return this.equals((TI32Column)that); - return false; - } - - public boolean equals(TI32Column that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); - - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); - - return list.hashCode(); - } - - @Override - public int compareTo(TI32Column other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI32Column("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TI32ColumnStandardSchemeFactory implements SchemeFactory { - public TI32ColumnStandardScheme getScheme() { - return new TI32ColumnStandardScheme(); - } - } - - private static class TI32ColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list78 = iprot.readListBegin(); - struct.values = new ArrayList(_list78.size); - int _elem79; - for (int _i80 = 0; _i80 < _list78.size; ++_i80) - { - _elem79 = iprot.readI32(); - struct.values.add(_elem79); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TI32Column struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.values.size())); - for (int _iter81 : struct.values) - { - oprot.writeI32(_iter81); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI32ColumnTupleSchemeFactory implements SchemeFactory { - public TI32ColumnTupleScheme getScheme() { - return new TI32ColumnTupleScheme(); - } - } - - private static class TI32ColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (int _iter82 : struct.values) - { - oprot.writeI32(_iter82); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI32Column struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list83 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.values = new ArrayList(_list83.size); - int _elem84; - for (int _i85 = 0; _i85 < _list83.size; ++_i85) - { - _elem84 = iprot.readI32(); - struct.values.add(_elem84); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI32Value.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI32Value.java deleted file mode 100644 index 8a69632b2d76e..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI32Value.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TI32Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI32Value"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I32, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI32ValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI32ValueTupleSchemeFactory()); - } - - private int value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI32Value.class, metaDataMap); - } - - public TI32Value() { - } - - /** - * Performs a deep copy on other. - */ - public TI32Value(TI32Value other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TI32Value deepCopy() { - return new TI32Value(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0; - } - - public int getValue() { - return this.value; - } - - public void setValue(int value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TI32Value) - return this.equals((TI32Value)that); - return false; - } - - public boolean equals(TI32Value that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); - - return list.hashCode(); - } - - @Override - public int compareTo(TI32Value other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI32Value("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TI32ValueStandardSchemeFactory implements SchemeFactory { - public TI32ValueStandardScheme getScheme() { - return new TI32ValueStandardScheme(); - } - } - - private static class TI32ValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI32Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.value = iprot.readI32(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TI32Value struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeI32(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI32ValueTupleSchemeFactory implements SchemeFactory { - public TI32ValueTupleScheme getScheme() { - return new TI32ValueTupleScheme(); - } - } - - private static class TI32ValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeI32(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI32Value struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readI32(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI64Column.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI64Column.java deleted file mode 100644 index cd5ef2d7a9ed9..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI64Column.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TI64Column implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Column"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI64ColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI64ColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Column.class, metaDataMap); - } - - public TI64Column() { - } - - public TI64Column( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TI64Column(TI64Column other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TI64Column deepCopy() { - return new TI64Column(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(long elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TI64Column) - return this.equals((TI64Column)that); - return false; - } - - public boolean equals(TI64Column that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); - - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); - - return list.hashCode(); - } - - @Override - public int compareTo(TI64Column other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI64Column("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TI64ColumnStandardSchemeFactory implements SchemeFactory { - public TI64ColumnStandardScheme getScheme() { - return new TI64ColumnStandardScheme(); - } - } - - private static class TI64ColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Column struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list86 = iprot.readListBegin(); - struct.values = new ArrayList(_list86.size); - long _elem87; - for (int _i88 = 0; _i88 < _list86.size; ++_i88) - { - _elem87 = iprot.readI64(); - struct.values.add(_elem87); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TI64Column struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.values.size())); - for (long _iter89 : struct.values) - { - oprot.writeI64(_iter89); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI64ColumnTupleSchemeFactory implements SchemeFactory { - public TI64ColumnTupleScheme getScheme() { - return new TI64ColumnTupleScheme(); - } - } - - private static class TI64ColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (long _iter90 : struct.values) - { - oprot.writeI64(_iter90); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI64Column struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list91 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); - struct.values = new ArrayList(_list91.size); - long _elem92; - for (int _i93 = 0; _i93 < _list91.size; ++_i93) - { - _elem92 = iprot.readI64(); - struct.values.add(_elem92); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI64Value.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI64Value.java deleted file mode 100644 index 393c0bd28610d..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TI64Value.java +++ /dev/null @@ -1,390 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TI64Value implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TI64Value"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.I64, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TI64ValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TI64ValueTupleSchemeFactory()); - } - - private long value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __VALUE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TI64Value.class, metaDataMap); - } - - public TI64Value() { - } - - /** - * Performs a deep copy on other. - */ - public TI64Value(TI64Value other) { - __isset_bitfield = other.__isset_bitfield; - this.value = other.value; - } - - public TI64Value deepCopy() { - return new TI64Value(this); - } - - @Override - public void clear() { - setValueIsSet(false); - this.value = 0; - } - - public long getValue() { - return this.value; - } - - public void setValue(long value) { - this.value = value; - setValueIsSet(true); - } - - public void unsetValue() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return EncodingUtils.testBit(__isset_bitfield, __VALUE_ISSET_ID); - } - - public void setValueIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUE_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((Long)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TI64Value) - return this.equals((TI64Value)that); - return false; - } - - public boolean equals(TI64Value that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (this.value != that.value) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); - - return list.hashCode(); - } - - @Override - public int compareTo(TI64Value other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TI64Value("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - sb.append(this.value); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TI64ValueStandardSchemeFactory implements SchemeFactory { - public TI64ValueStandardScheme getScheme() { - return new TI64ValueStandardScheme(); - } - } - - private static class TI64ValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TI64Value struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.value = iprot.readI64(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TI64Value struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeI64(struct.value); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TI64ValueTupleSchemeFactory implements SchemeFactory { - public TI64ValueTupleScheme getScheme() { - return new TI64ValueTupleScheme(); - } - } - - private static class TI64ValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeI64(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TI64Value struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readI64(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TJobExecutionStatus.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TJobExecutionStatus.java deleted file mode 100644 index b39f208c1b878..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TJobExecutionStatus.java +++ /dev/null @@ -1,48 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TJobExecutionStatus implements org.apache.thrift.TEnum { - IN_PROGRESS(0), - COMPLETE(1), - NOT_AVAILABLE(2); - - private final int value; - - private TJobExecutionStatus(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TJobExecutionStatus findByValue(int value) { - switch (value) { - case 0: - return IN_PROGRESS; - case 1: - return COMPLETE; - case 2: - return NOT_AVAILABLE; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TMapTypeEntry.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TMapTypeEntry.java deleted file mode 100644 index 7ebc15c9432be..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TMapTypeEntry.java +++ /dev/null @@ -1,482 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TMapTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TMapTypeEntry"); - - private static final org.apache.thrift.protocol.TField KEY_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("keyTypePtr", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField VALUE_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("valueTypePtr", org.apache.thrift.protocol.TType.I32, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TMapTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TMapTypeEntryTupleSchemeFactory()); - } - - private int keyTypePtr; // required - private int valueTypePtr; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - KEY_TYPE_PTR((short)1, "keyTypePtr"), - VALUE_TYPE_PTR((short)2, "valueTypePtr"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // KEY_TYPE_PTR - return KEY_TYPE_PTR; - case 2: // VALUE_TYPE_PTR - return VALUE_TYPE_PTR; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __KEYTYPEPTR_ISSET_ID = 0; - private static final int __VALUETYPEPTR_ISSET_ID = 1; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.KEY_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("keyTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - tmpMap.put(_Fields.VALUE_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("valueTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr"))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TMapTypeEntry.class, metaDataMap); - } - - public TMapTypeEntry() { - } - - public TMapTypeEntry( - int keyTypePtr, - int valueTypePtr) - { - this(); - this.keyTypePtr = keyTypePtr; - setKeyTypePtrIsSet(true); - this.valueTypePtr = valueTypePtr; - setValueTypePtrIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TMapTypeEntry(TMapTypeEntry other) { - __isset_bitfield = other.__isset_bitfield; - this.keyTypePtr = other.keyTypePtr; - this.valueTypePtr = other.valueTypePtr; - } - - public TMapTypeEntry deepCopy() { - return new TMapTypeEntry(this); - } - - @Override - public void clear() { - setKeyTypePtrIsSet(false); - this.keyTypePtr = 0; - setValueTypePtrIsSet(false); - this.valueTypePtr = 0; - } - - public int getKeyTypePtr() { - return this.keyTypePtr; - } - - public void setKeyTypePtr(int keyTypePtr) { - this.keyTypePtr = keyTypePtr; - setKeyTypePtrIsSet(true); - } - - public void unsetKeyTypePtr() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); - } - - /** Returns true if field keyTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetKeyTypePtr() { - return EncodingUtils.testBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID); - } - - public void setKeyTypePtrIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __KEYTYPEPTR_ISSET_ID, value); - } - - public int getValueTypePtr() { - return this.valueTypePtr; - } - - public void setValueTypePtr(int valueTypePtr) { - this.valueTypePtr = valueTypePtr; - setValueTypePtrIsSet(true); - } - - public void unsetValueTypePtr() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); - } - - /** Returns true if field valueTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetValueTypePtr() { - return EncodingUtils.testBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID); - } - - public void setValueTypePtrIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __VALUETYPEPTR_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case KEY_TYPE_PTR: - if (value == null) { - unsetKeyTypePtr(); - } else { - setKeyTypePtr((Integer)value); - } - break; - - case VALUE_TYPE_PTR: - if (value == null) { - unsetValueTypePtr(); - } else { - setValueTypePtr((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case KEY_TYPE_PTR: - return getKeyTypePtr(); - - case VALUE_TYPE_PTR: - return getValueTypePtr(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case KEY_TYPE_PTR: - return isSetKeyTypePtr(); - case VALUE_TYPE_PTR: - return isSetValueTypePtr(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TMapTypeEntry) - return this.equals((TMapTypeEntry)that); - return false; - } - - public boolean equals(TMapTypeEntry that) { - if (that == null) - return false; - - boolean this_present_keyTypePtr = true; - boolean that_present_keyTypePtr = true; - if (this_present_keyTypePtr || that_present_keyTypePtr) { - if (!(this_present_keyTypePtr && that_present_keyTypePtr)) - return false; - if (this.keyTypePtr != that.keyTypePtr) - return false; - } - - boolean this_present_valueTypePtr = true; - boolean that_present_valueTypePtr = true; - if (this_present_valueTypePtr || that_present_valueTypePtr) { - if (!(this_present_valueTypePtr && that_present_valueTypePtr)) - return false; - if (this.valueTypePtr != that.valueTypePtr) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_keyTypePtr = true; - list.add(present_keyTypePtr); - if (present_keyTypePtr) - list.add(keyTypePtr); - - boolean present_valueTypePtr = true; - list.add(present_valueTypePtr); - if (present_valueTypePtr) - list.add(valueTypePtr); - - return list.hashCode(); - } - - @Override - public int compareTo(TMapTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetKeyTypePtr()).compareTo(other.isSetKeyTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetKeyTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.keyTypePtr, other.keyTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetValueTypePtr()).compareTo(other.isSetValueTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValueTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.valueTypePtr, other.valueTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TMapTypeEntry("); - boolean first = true; - - sb.append("keyTypePtr:"); - sb.append(this.keyTypePtr); - first = false; - if (!first) sb.append(", "); - sb.append("valueTypePtr:"); - sb.append(this.valueTypePtr); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetKeyTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'keyTypePtr' is unset! Struct:" + toString()); - } - - if (!isSetValueTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'valueTypePtr' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TMapTypeEntryStandardSchemeFactory implements SchemeFactory { - public TMapTypeEntryStandardScheme getScheme() { - return new TMapTypeEntryStandardScheme(); - } - } - - private static class TMapTypeEntryStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TMapTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // KEY_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.keyTypePtr = iprot.readI32(); - struct.setKeyTypePtrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // VALUE_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.valueTypePtr = iprot.readI32(); - struct.setValueTypePtrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TMapTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(KEY_TYPE_PTR_FIELD_DESC); - oprot.writeI32(struct.keyTypePtr); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(VALUE_TYPE_PTR_FIELD_DESC); - oprot.writeI32(struct.valueTypePtr); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TMapTypeEntryTupleSchemeFactory implements SchemeFactory { - public TMapTypeEntryTupleScheme getScheme() { - return new TMapTypeEntryTupleScheme(); - } - } - - private static class TMapTypeEntryTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.keyTypePtr); - oprot.writeI32(struct.valueTypePtr); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TMapTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.keyTypePtr = iprot.readI32(); - struct.setKeyTypePtrIsSet(true); - struct.valueTypePtr = iprot.readI32(); - struct.setValueTypePtrIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOpenSessionReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOpenSessionReq.java deleted file mode 100644 index e47abbb862cf1..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOpenSessionReq.java +++ /dev/null @@ -1,778 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TOpenSessionReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionReq"); - - private static final org.apache.thrift.protocol.TField CLIENT_PROTOCOL_FIELD_DESC = new org.apache.thrift.protocol.TField("client_protocol", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField USERNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("username", org.apache.thrift.protocol.TType.STRING, (short)2); - private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TOpenSessionReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TOpenSessionReqTupleSchemeFactory()); - } - - private TProtocolVersion client_protocol; // required - private String username; // optional - private String password; // optional - private Map configuration; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see TProtocolVersion - */ - CLIENT_PROTOCOL((short)1, "client_protocol"), - USERNAME((short)2, "username"), - PASSWORD((short)3, "password"), - CONFIGURATION((short)4, "configuration"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // CLIENT_PROTOCOL - return CLIENT_PROTOCOL; - case 2: // USERNAME - return USERNAME; - case 3: // PASSWORD - return PASSWORD; - case 4: // CONFIGURATION - return CONFIGURATION; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.USERNAME,_Fields.PASSWORD,_Fields.CONFIGURATION}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.CLIENT_PROTOCOL, new org.apache.thrift.meta_data.FieldMetaData("client_protocol", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); - tmpMap.put(_Fields.USERNAME, new org.apache.thrift.meta_data.FieldMetaData("username", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionReq.class, metaDataMap); - } - - public TOpenSessionReq() { - this.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; - - } - - public TOpenSessionReq( - TProtocolVersion client_protocol) - { - this(); - this.client_protocol = client_protocol; - } - - /** - * Performs a deep copy on other. - */ - public TOpenSessionReq(TOpenSessionReq other) { - if (other.isSetClient_protocol()) { - this.client_protocol = other.client_protocol; - } - if (other.isSetUsername()) { - this.username = other.username; - } - if (other.isSetPassword()) { - this.password = other.password; - } - if (other.isSetConfiguration()) { - Map __this__configuration = new HashMap(other.configuration); - this.configuration = __this__configuration; - } - } - - public TOpenSessionReq deepCopy() { - return new TOpenSessionReq(this); - } - - @Override - public void clear() { - this.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; - - this.username = null; - this.password = null; - this.configuration = null; - } - - /** - * - * @see TProtocolVersion - */ - public TProtocolVersion getClient_protocol() { - return this.client_protocol; - } - - /** - * - * @see TProtocolVersion - */ - public void setClient_protocol(TProtocolVersion client_protocol) { - this.client_protocol = client_protocol; - } - - public void unsetClient_protocol() { - this.client_protocol = null; - } - - /** Returns true if field client_protocol is set (has been assigned a value) and false otherwise */ - public boolean isSetClient_protocol() { - return this.client_protocol != null; - } - - public void setClient_protocolIsSet(boolean value) { - if (!value) { - this.client_protocol = null; - } - } - - public String getUsername() { - return this.username; - } - - public void setUsername(String username) { - this.username = username; - } - - public void unsetUsername() { - this.username = null; - } - - /** Returns true if field username is set (has been assigned a value) and false otherwise */ - public boolean isSetUsername() { - return this.username != null; - } - - public void setUsernameIsSet(boolean value) { - if (!value) { - this.username = null; - } - } - - public String getPassword() { - return this.password; - } - - public void setPassword(String password) { - this.password = password; - } - - public void unsetPassword() { - this.password = null; - } - - /** Returns true if field password is set (has been assigned a value) and false otherwise */ - public boolean isSetPassword() { - return this.password != null; - } - - public void setPasswordIsSet(boolean value) { - if (!value) { - this.password = null; - } - } - - public int getConfigurationSize() { - return (this.configuration == null) ? 0 : this.configuration.size(); - } - - public void putToConfiguration(String key, String val) { - if (this.configuration == null) { - this.configuration = new HashMap(); - } - this.configuration.put(key, val); - } - - public Map getConfiguration() { - return this.configuration; - } - - public void setConfiguration(Map configuration) { - this.configuration = configuration; - } - - public void unsetConfiguration() { - this.configuration = null; - } - - /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ - public boolean isSetConfiguration() { - return this.configuration != null; - } - - public void setConfigurationIsSet(boolean value) { - if (!value) { - this.configuration = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case CLIENT_PROTOCOL: - if (value == null) { - unsetClient_protocol(); - } else { - setClient_protocol((TProtocolVersion)value); - } - break; - - case USERNAME: - if (value == null) { - unsetUsername(); - } else { - setUsername((String)value); - } - break; - - case PASSWORD: - if (value == null) { - unsetPassword(); - } else { - setPassword((String)value); - } - break; - - case CONFIGURATION: - if (value == null) { - unsetConfiguration(); - } else { - setConfiguration((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case CLIENT_PROTOCOL: - return getClient_protocol(); - - case USERNAME: - return getUsername(); - - case PASSWORD: - return getPassword(); - - case CONFIGURATION: - return getConfiguration(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case CLIENT_PROTOCOL: - return isSetClient_protocol(); - case USERNAME: - return isSetUsername(); - case PASSWORD: - return isSetPassword(); - case CONFIGURATION: - return isSetConfiguration(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TOpenSessionReq) - return this.equals((TOpenSessionReq)that); - return false; - } - - public boolean equals(TOpenSessionReq that) { - if (that == null) - return false; - - boolean this_present_client_protocol = true && this.isSetClient_protocol(); - boolean that_present_client_protocol = true && that.isSetClient_protocol(); - if (this_present_client_protocol || that_present_client_protocol) { - if (!(this_present_client_protocol && that_present_client_protocol)) - return false; - if (!this.client_protocol.equals(that.client_protocol)) - return false; - } - - boolean this_present_username = true && this.isSetUsername(); - boolean that_present_username = true && that.isSetUsername(); - if (this_present_username || that_present_username) { - if (!(this_present_username && that_present_username)) - return false; - if (!this.username.equals(that.username)) - return false; - } - - boolean this_present_password = true && this.isSetPassword(); - boolean that_present_password = true && that.isSetPassword(); - if (this_present_password || that_present_password) { - if (!(this_present_password && that_present_password)) - return false; - if (!this.password.equals(that.password)) - return false; - } - - boolean this_present_configuration = true && this.isSetConfiguration(); - boolean that_present_configuration = true && that.isSetConfiguration(); - if (this_present_configuration || that_present_configuration) { - if (!(this_present_configuration && that_present_configuration)) - return false; - if (!this.configuration.equals(that.configuration)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_client_protocol = true && (isSetClient_protocol()); - list.add(present_client_protocol); - if (present_client_protocol) - list.add(client_protocol.getValue()); - - boolean present_username = true && (isSetUsername()); - list.add(present_username); - if (present_username) - list.add(username); - - boolean present_password = true && (isSetPassword()); - list.add(present_password); - if (present_password) - list.add(password); - - boolean present_configuration = true && (isSetConfiguration()); - list.add(present_configuration); - if (present_configuration) - list.add(configuration); - - return list.hashCode(); - } - - @Override - public int compareTo(TOpenSessionReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetClient_protocol()).compareTo(other.isSetClient_protocol()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetClient_protocol()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.client_protocol, other.client_protocol); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetUsername()).compareTo(other.isSetUsername()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUsername()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.username, other.username); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPassword()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConfiguration()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TOpenSessionReq("); - boolean first = true; - - sb.append("client_protocol:"); - if (this.client_protocol == null) { - sb.append("null"); - } else { - sb.append(this.client_protocol); - } - first = false; - if (isSetUsername()) { - if (!first) sb.append(", "); - sb.append("username:"); - if (this.username == null) { - sb.append("null"); - } else { - sb.append(this.username); - } - first = false; - } - if (isSetPassword()) { - if (!first) sb.append(", "); - sb.append("password:"); - if (this.password == null) { - sb.append("null"); - } else { - sb.append(this.password); - } - first = false; - } - if (isSetConfiguration()) { - if (!first) sb.append(", "); - sb.append("configuration:"); - if (this.configuration == null) { - sb.append("null"); - } else { - sb.append(this.configuration); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetClient_protocol()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'client_protocol' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TOpenSessionReqStandardSchemeFactory implements SchemeFactory { - public TOpenSessionReqStandardScheme getScheme() { - return new TOpenSessionReqStandardScheme(); - } - } - - private static class TOpenSessionReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // CLIENT_PROTOCOL - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); - struct.setClient_protocolIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // USERNAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PASSWORD - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.password = iprot.readString(); - struct.setPasswordIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CONFIGURATION - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map142 = iprot.readMapBegin(); - struct.configuration = new HashMap(2*_map142.size); - String _key143; - String _val144; - for (int _i145 = 0; _i145 < _map142.size; ++_i145) - { - _key143 = iprot.readString(); - _val144 = iprot.readString(); - struct.configuration.put(_key143, _val144); - } - iprot.readMapEnd(); - } - struct.setConfigurationIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.client_protocol != null) { - oprot.writeFieldBegin(CLIENT_PROTOCOL_FIELD_DESC); - oprot.writeI32(struct.client_protocol.getValue()); - oprot.writeFieldEnd(); - } - if (struct.username != null) { - if (struct.isSetUsername()) { - oprot.writeFieldBegin(USERNAME_FIELD_DESC); - oprot.writeString(struct.username); - oprot.writeFieldEnd(); - } - } - if (struct.password != null) { - if (struct.isSetPassword()) { - oprot.writeFieldBegin(PASSWORD_FIELD_DESC); - oprot.writeString(struct.password); - oprot.writeFieldEnd(); - } - } - if (struct.configuration != null) { - if (struct.isSetConfiguration()) { - oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (Map.Entry _iter146 : struct.configuration.entrySet()) - { - oprot.writeString(_iter146.getKey()); - oprot.writeString(_iter146.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TOpenSessionReqTupleSchemeFactory implements SchemeFactory { - public TOpenSessionReqTupleScheme getScheme() { - return new TOpenSessionReqTupleScheme(); - } - } - - private static class TOpenSessionReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.client_protocol.getValue()); - BitSet optionals = new BitSet(); - if (struct.isSetUsername()) { - optionals.set(0); - } - if (struct.isSetPassword()) { - optionals.set(1); - } - if (struct.isSetConfiguration()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetUsername()) { - oprot.writeString(struct.username); - } - if (struct.isSetPassword()) { - oprot.writeString(struct.password); - } - if (struct.isSetConfiguration()) { - { - oprot.writeI32(struct.configuration.size()); - for (Map.Entry _iter147 : struct.configuration.entrySet()) - { - oprot.writeString(_iter147.getKey()); - oprot.writeString(_iter147.getValue()); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.client_protocol = org.apache.hive.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); - struct.setClient_protocolIsSet(true); - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.username = iprot.readString(); - struct.setUsernameIsSet(true); - } - if (incoming.get(1)) { - struct.password = iprot.readString(); - struct.setPasswordIsSet(true); - } - if (incoming.get(2)) { - { - org.apache.thrift.protocol.TMap _map148 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new HashMap(2*_map148.size); - String _key149; - String _val150; - for (int _i151 = 0; _i151 < _map148.size; ++_i151) - { - _key149 = iprot.readString(); - _val150 = iprot.readString(); - struct.configuration.put(_key149, _val150); - } - } - struct.setConfigurationIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOpenSessionResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOpenSessionResp.java deleted file mode 100644 index ee1c87bfd76fa..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOpenSessionResp.java +++ /dev/null @@ -1,783 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TOpenSessionResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOpenSessionResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField SERVER_PROTOCOL_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("serverProtocolVersion", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField CONFIGURATION_FIELD_DESC = new org.apache.thrift.protocol.TField("configuration", org.apache.thrift.protocol.TType.MAP, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TOpenSessionRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TOpenSessionRespTupleSchemeFactory()); - } - - private TStatus status; // required - private TProtocolVersion serverProtocolVersion; // required - private TSessionHandle sessionHandle; // optional - private Map configuration; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"), - /** - * - * @see TProtocolVersion - */ - SERVER_PROTOCOL_VERSION((short)2, "serverProtocolVersion"), - SESSION_HANDLE((short)3, "sessionHandle"), - CONFIGURATION((short)4, "configuration"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - case 2: // SERVER_PROTOCOL_VERSION - return SERVER_PROTOCOL_VERSION; - case 3: // SESSION_HANDLE - return SESSION_HANDLE; - case 4: // CONFIGURATION - return CONFIGURATION; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.SESSION_HANDLE,_Fields.CONFIGURATION}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - tmpMap.put(_Fields.SERVER_PROTOCOL_VERSION, new org.apache.thrift.meta_data.FieldMetaData("serverProtocolVersion", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TProtocolVersion.class))); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.CONFIGURATION, new org.apache.thrift.meta_data.FieldMetaData("configuration", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOpenSessionResp.class, metaDataMap); - } - - public TOpenSessionResp() { - this.serverProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; - - } - - public TOpenSessionResp( - TStatus status, - TProtocolVersion serverProtocolVersion) - { - this(); - this.status = status; - this.serverProtocolVersion = serverProtocolVersion; - } - - /** - * Performs a deep copy on other. - */ - public TOpenSessionResp(TOpenSessionResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - if (other.isSetServerProtocolVersion()) { - this.serverProtocolVersion = other.serverProtocolVersion; - } - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetConfiguration()) { - Map __this__configuration = new HashMap(other.configuration); - this.configuration = __this__configuration; - } - } - - public TOpenSessionResp deepCopy() { - return new TOpenSessionResp(this); - } - - @Override - public void clear() { - this.status = null; - this.serverProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion.HIVE_CLI_SERVICE_PROTOCOL_V10; - - this.sessionHandle = null; - this.configuration = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - /** - * - * @see TProtocolVersion - */ - public TProtocolVersion getServerProtocolVersion() { - return this.serverProtocolVersion; - } - - /** - * - * @see TProtocolVersion - */ - public void setServerProtocolVersion(TProtocolVersion serverProtocolVersion) { - this.serverProtocolVersion = serverProtocolVersion; - } - - public void unsetServerProtocolVersion() { - this.serverProtocolVersion = null; - } - - /** Returns true if field serverProtocolVersion is set (has been assigned a value) and false otherwise */ - public boolean isSetServerProtocolVersion() { - return this.serverProtocolVersion != null; - } - - public void setServerProtocolVersionIsSet(boolean value) { - if (!value) { - this.serverProtocolVersion = null; - } - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public int getConfigurationSize() { - return (this.configuration == null) ? 0 : this.configuration.size(); - } - - public void putToConfiguration(String key, String val) { - if (this.configuration == null) { - this.configuration = new HashMap(); - } - this.configuration.put(key, val); - } - - public Map getConfiguration() { - return this.configuration; - } - - public void setConfiguration(Map configuration) { - this.configuration = configuration; - } - - public void unsetConfiguration() { - this.configuration = null; - } - - /** Returns true if field configuration is set (has been assigned a value) and false otherwise */ - public boolean isSetConfiguration() { - return this.configuration != null; - } - - public void setConfigurationIsSet(boolean value) { - if (!value) { - this.configuration = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - case SERVER_PROTOCOL_VERSION: - if (value == null) { - unsetServerProtocolVersion(); - } else { - setServerProtocolVersion((TProtocolVersion)value); - } - break; - - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case CONFIGURATION: - if (value == null) { - unsetConfiguration(); - } else { - setConfiguration((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - case SERVER_PROTOCOL_VERSION: - return getServerProtocolVersion(); - - case SESSION_HANDLE: - return getSessionHandle(); - - case CONFIGURATION: - return getConfiguration(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - case SERVER_PROTOCOL_VERSION: - return isSetServerProtocolVersion(); - case SESSION_HANDLE: - return isSetSessionHandle(); - case CONFIGURATION: - return isSetConfiguration(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TOpenSessionResp) - return this.equals((TOpenSessionResp)that); - return false; - } - - public boolean equals(TOpenSessionResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_serverProtocolVersion = true && this.isSetServerProtocolVersion(); - boolean that_present_serverProtocolVersion = true && that.isSetServerProtocolVersion(); - if (this_present_serverProtocolVersion || that_present_serverProtocolVersion) { - if (!(this_present_serverProtocolVersion && that_present_serverProtocolVersion)) - return false; - if (!this.serverProtocolVersion.equals(that.serverProtocolVersion)) - return false; - } - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_configuration = true && this.isSetConfiguration(); - boolean that_present_configuration = true && that.isSetConfiguration(); - if (this_present_configuration || that_present_configuration) { - if (!(this_present_configuration && that_present_configuration)) - return false; - if (!this.configuration.equals(that.configuration)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - boolean present_serverProtocolVersion = true && (isSetServerProtocolVersion()); - list.add(present_serverProtocolVersion); - if (present_serverProtocolVersion) - list.add(serverProtocolVersion.getValue()); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_configuration = true && (isSetConfiguration()); - list.add(present_configuration); - if (present_configuration) - list.add(configuration); - - return list.hashCode(); - } - - @Override - public int compareTo(TOpenSessionResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetServerProtocolVersion()).compareTo(other.isSetServerProtocolVersion()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetServerProtocolVersion()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverProtocolVersion, other.serverProtocolVersion); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetConfiguration()).compareTo(other.isSetConfiguration()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetConfiguration()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.configuration, other.configuration); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TOpenSessionResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (!first) sb.append(", "); - sb.append("serverProtocolVersion:"); - if (this.serverProtocolVersion == null) { - sb.append("null"); - } else { - sb.append(this.serverProtocolVersion); - } - first = false; - if (isSetSessionHandle()) { - if (!first) sb.append(", "); - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - } - if (isSetConfiguration()) { - if (!first) sb.append(", "); - sb.append("configuration:"); - if (this.configuration == null) { - sb.append("null"); - } else { - sb.append(this.configuration); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - if (!isSetServerProtocolVersion()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'serverProtocolVersion' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TOpenSessionRespStandardSchemeFactory implements SchemeFactory { - public TOpenSessionRespStandardScheme getScheme() { - return new TOpenSessionRespStandardScheme(); - } - } - - private static class TOpenSessionRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TOpenSessionResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // SERVER_PROTOCOL_VERSION - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.serverProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); - struct.setServerProtocolVersionIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // CONFIGURATION - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map152 = iprot.readMapBegin(); - struct.configuration = new HashMap(2*_map152.size); - String _key153; - String _val154; - for (int _i155 = 0; _i155 < _map152.size; ++_i155) - { - _key153 = iprot.readString(); - _val154 = iprot.readString(); - struct.configuration.put(_key153, _val154); - } - iprot.readMapEnd(); - } - struct.setConfigurationIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TOpenSessionResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.serverProtocolVersion != null) { - oprot.writeFieldBegin(SERVER_PROTOCOL_VERSION_FIELD_DESC); - oprot.writeI32(struct.serverProtocolVersion.getValue()); - oprot.writeFieldEnd(); - } - if (struct.sessionHandle != null) { - if (struct.isSetSessionHandle()) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - } - if (struct.configuration != null) { - if (struct.isSetConfiguration()) { - oprot.writeFieldBegin(CONFIGURATION_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.configuration.size())); - for (Map.Entry _iter156 : struct.configuration.entrySet()) - { - oprot.writeString(_iter156.getKey()); - oprot.writeString(_iter156.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TOpenSessionRespTupleSchemeFactory implements SchemeFactory { - public TOpenSessionRespTupleScheme getScheme() { - return new TOpenSessionRespTupleScheme(); - } - } - - private static class TOpenSessionRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - oprot.writeI32(struct.serverProtocolVersion.getValue()); - BitSet optionals = new BitSet(); - if (struct.isSetSessionHandle()) { - optionals.set(0); - } - if (struct.isSetConfiguration()) { - optionals.set(1); - } - oprot.writeBitSet(optionals, 2); - if (struct.isSetSessionHandle()) { - struct.sessionHandle.write(oprot); - } - if (struct.isSetConfiguration()) { - { - oprot.writeI32(struct.configuration.size()); - for (Map.Entry _iter157 : struct.configuration.entrySet()) - { - oprot.writeString(_iter157.getKey()); - oprot.writeString(_iter157.getValue()); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TOpenSessionResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - struct.serverProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion.findByValue(iprot.readI32()); - struct.setServerProtocolVersionIsSet(true); - BitSet incoming = iprot.readBitSet(2); - if (incoming.get(0)) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } - if (incoming.get(1)) { - { - org.apache.thrift.protocol.TMap _map158 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.configuration = new HashMap(2*_map158.size); - String _key159; - String _val160; - for (int _i161 = 0; _i161 < _map158.size; ++_i161) - { - _key159 = iprot.readString(); - _val160 = iprot.readString(); - struct.configuration.put(_key159, _val160); - } - } - struct.setConfigurationIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOperationHandle.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOperationHandle.java deleted file mode 100644 index 9eaf2be3ed5ea..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOperationHandle.java +++ /dev/null @@ -1,709 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TOperationHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TOperationHandle"); - - private static final org.apache.thrift.protocol.TField OPERATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("operationId", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField OPERATION_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("operationType", org.apache.thrift.protocol.TType.I32, (short)2); - private static final org.apache.thrift.protocol.TField HAS_RESULT_SET_FIELD_DESC = new org.apache.thrift.protocol.TField("hasResultSet", org.apache.thrift.protocol.TType.BOOL, (short)3); - private static final org.apache.thrift.protocol.TField MODIFIED_ROW_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("modifiedRowCount", org.apache.thrift.protocol.TType.DOUBLE, (short)4); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TOperationHandleStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TOperationHandleTupleSchemeFactory()); - } - - private THandleIdentifier operationId; // required - private TOperationType operationType; // required - private boolean hasResultSet; // required - private double modifiedRowCount; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - OPERATION_ID((short)1, "operationId"), - /** - * - * @see TOperationType - */ - OPERATION_TYPE((short)2, "operationType"), - HAS_RESULT_SET((short)3, "hasResultSet"), - MODIFIED_ROW_COUNT((short)4, "modifiedRowCount"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // OPERATION_ID - return OPERATION_ID; - case 2: // OPERATION_TYPE - return OPERATION_TYPE; - case 3: // HAS_RESULT_SET - return HAS_RESULT_SET; - case 4: // MODIFIED_ROW_COUNT - return MODIFIED_ROW_COUNT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __HASRESULTSET_ISSET_ID = 0; - private static final int __MODIFIEDROWCOUNT_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.MODIFIED_ROW_COUNT}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.OPERATION_ID, new org.apache.thrift.meta_data.FieldMetaData("operationId", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); - tmpMap.put(_Fields.OPERATION_TYPE, new org.apache.thrift.meta_data.FieldMetaData("operationType", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TOperationType.class))); - tmpMap.put(_Fields.HAS_RESULT_SET, new org.apache.thrift.meta_data.FieldMetaData("hasResultSet", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); - tmpMap.put(_Fields.MODIFIED_ROW_COUNT, new org.apache.thrift.meta_data.FieldMetaData("modifiedRowCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TOperationHandle.class, metaDataMap); - } - - public TOperationHandle() { - } - - public TOperationHandle( - THandleIdentifier operationId, - TOperationType operationType, - boolean hasResultSet) - { - this(); - this.operationId = operationId; - this.operationType = operationType; - this.hasResultSet = hasResultSet; - setHasResultSetIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TOperationHandle(TOperationHandle other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetOperationId()) { - this.operationId = new THandleIdentifier(other.operationId); - } - if (other.isSetOperationType()) { - this.operationType = other.operationType; - } - this.hasResultSet = other.hasResultSet; - this.modifiedRowCount = other.modifiedRowCount; - } - - public TOperationHandle deepCopy() { - return new TOperationHandle(this); - } - - @Override - public void clear() { - this.operationId = null; - this.operationType = null; - setHasResultSetIsSet(false); - this.hasResultSet = false; - setModifiedRowCountIsSet(false); - this.modifiedRowCount = 0.0; - } - - public THandleIdentifier getOperationId() { - return this.operationId; - } - - public void setOperationId(THandleIdentifier operationId) { - this.operationId = operationId; - } - - public void unsetOperationId() { - this.operationId = null; - } - - /** Returns true if field operationId is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationId() { - return this.operationId != null; - } - - public void setOperationIdIsSet(boolean value) { - if (!value) { - this.operationId = null; - } - } - - /** - * - * @see TOperationType - */ - public TOperationType getOperationType() { - return this.operationType; - } - - /** - * - * @see TOperationType - */ - public void setOperationType(TOperationType operationType) { - this.operationType = operationType; - } - - public void unsetOperationType() { - this.operationType = null; - } - - /** Returns true if field operationType is set (has been assigned a value) and false otherwise */ - public boolean isSetOperationType() { - return this.operationType != null; - } - - public void setOperationTypeIsSet(boolean value) { - if (!value) { - this.operationType = null; - } - } - - public boolean isHasResultSet() { - return this.hasResultSet; - } - - public void setHasResultSet(boolean hasResultSet) { - this.hasResultSet = hasResultSet; - setHasResultSetIsSet(true); - } - - public void unsetHasResultSet() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); - } - - /** Returns true if field hasResultSet is set (has been assigned a value) and false otherwise */ - public boolean isSetHasResultSet() { - return EncodingUtils.testBit(__isset_bitfield, __HASRESULTSET_ISSET_ID); - } - - public void setHasResultSetIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __HASRESULTSET_ISSET_ID, value); - } - - public double getModifiedRowCount() { - return this.modifiedRowCount; - } - - public void setModifiedRowCount(double modifiedRowCount) { - this.modifiedRowCount = modifiedRowCount; - setModifiedRowCountIsSet(true); - } - - public void unsetModifiedRowCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); - } - - /** Returns true if field modifiedRowCount is set (has been assigned a value) and false otherwise */ - public boolean isSetModifiedRowCount() { - return EncodingUtils.testBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID); - } - - public void setModifiedRowCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MODIFIEDROWCOUNT_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case OPERATION_ID: - if (value == null) { - unsetOperationId(); - } else { - setOperationId((THandleIdentifier)value); - } - break; - - case OPERATION_TYPE: - if (value == null) { - unsetOperationType(); - } else { - setOperationType((TOperationType)value); - } - break; - - case HAS_RESULT_SET: - if (value == null) { - unsetHasResultSet(); - } else { - setHasResultSet((Boolean)value); - } - break; - - case MODIFIED_ROW_COUNT: - if (value == null) { - unsetModifiedRowCount(); - } else { - setModifiedRowCount((Double)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case OPERATION_ID: - return getOperationId(); - - case OPERATION_TYPE: - return getOperationType(); - - case HAS_RESULT_SET: - return isHasResultSet(); - - case MODIFIED_ROW_COUNT: - return getModifiedRowCount(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case OPERATION_ID: - return isSetOperationId(); - case OPERATION_TYPE: - return isSetOperationType(); - case HAS_RESULT_SET: - return isSetHasResultSet(); - case MODIFIED_ROW_COUNT: - return isSetModifiedRowCount(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TOperationHandle) - return this.equals((TOperationHandle)that); - return false; - } - - public boolean equals(TOperationHandle that) { - if (that == null) - return false; - - boolean this_present_operationId = true && this.isSetOperationId(); - boolean that_present_operationId = true && that.isSetOperationId(); - if (this_present_operationId || that_present_operationId) { - if (!(this_present_operationId && that_present_operationId)) - return false; - if (!this.operationId.equals(that.operationId)) - return false; - } - - boolean this_present_operationType = true && this.isSetOperationType(); - boolean that_present_operationType = true && that.isSetOperationType(); - if (this_present_operationType || that_present_operationType) { - if (!(this_present_operationType && that_present_operationType)) - return false; - if (!this.operationType.equals(that.operationType)) - return false; - } - - boolean this_present_hasResultSet = true; - boolean that_present_hasResultSet = true; - if (this_present_hasResultSet || that_present_hasResultSet) { - if (!(this_present_hasResultSet && that_present_hasResultSet)) - return false; - if (this.hasResultSet != that.hasResultSet) - return false; - } - - boolean this_present_modifiedRowCount = true && this.isSetModifiedRowCount(); - boolean that_present_modifiedRowCount = true && that.isSetModifiedRowCount(); - if (this_present_modifiedRowCount || that_present_modifiedRowCount) { - if (!(this_present_modifiedRowCount && that_present_modifiedRowCount)) - return false; - if (this.modifiedRowCount != that.modifiedRowCount) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_operationId = true && (isSetOperationId()); - list.add(present_operationId); - if (present_operationId) - list.add(operationId); - - boolean present_operationType = true && (isSetOperationType()); - list.add(present_operationType); - if (present_operationType) - list.add(operationType.getValue()); - - boolean present_hasResultSet = true; - list.add(present_hasResultSet); - if (present_hasResultSet) - list.add(hasResultSet); - - boolean present_modifiedRowCount = true && (isSetModifiedRowCount()); - list.add(present_modifiedRowCount); - if (present_modifiedRowCount) - list.add(modifiedRowCount); - - return list.hashCode(); - } - - @Override - public int compareTo(TOperationHandle other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetOperationId()).compareTo(other.isSetOperationId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationId, other.operationId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetOperationType()).compareTo(other.isSetOperationType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetOperationType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.operationType, other.operationType); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetHasResultSet()).compareTo(other.isSetHasResultSet()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHasResultSet()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.hasResultSet, other.hasResultSet); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetModifiedRowCount()).compareTo(other.isSetModifiedRowCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetModifiedRowCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.modifiedRowCount, other.modifiedRowCount); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TOperationHandle("); - boolean first = true; - - sb.append("operationId:"); - if (this.operationId == null) { - sb.append("null"); - } else { - sb.append(this.operationId); - } - first = false; - if (!first) sb.append(", "); - sb.append("operationType:"); - if (this.operationType == null) { - sb.append("null"); - } else { - sb.append(this.operationType); - } - first = false; - if (!first) sb.append(", "); - sb.append("hasResultSet:"); - sb.append(this.hasResultSet); - first = false; - if (isSetModifiedRowCount()) { - if (!first) sb.append(", "); - sb.append("modifiedRowCount:"); - sb.append(this.modifiedRowCount); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetOperationId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationId' is unset! Struct:" + toString()); - } - - if (!isSetOperationType()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'operationType' is unset! Struct:" + toString()); - } - - if (!isSetHasResultSet()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'hasResultSet' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (operationId != null) { - operationId.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TOperationHandleStandardSchemeFactory implements SchemeFactory { - public TOperationHandleStandardScheme getScheme() { - return new TOperationHandleStandardScheme(); - } - } - - private static class TOperationHandleStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TOperationHandle struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // OPERATION_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.operationId = new THandleIdentifier(); - struct.operationId.read(iprot); - struct.setOperationIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // OPERATION_TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.operationType = org.apache.hive.service.rpc.thrift.TOperationType.findByValue(iprot.readI32()); - struct.setOperationTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // HAS_RESULT_SET - if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { - struct.hasResultSet = iprot.readBool(); - struct.setHasResultSetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // MODIFIED_ROW_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.modifiedRowCount = iprot.readDouble(); - struct.setModifiedRowCountIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TOperationHandle struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.operationId != null) { - oprot.writeFieldBegin(OPERATION_ID_FIELD_DESC); - struct.operationId.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.operationType != null) { - oprot.writeFieldBegin(OPERATION_TYPE_FIELD_DESC); - oprot.writeI32(struct.operationType.getValue()); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(HAS_RESULT_SET_FIELD_DESC); - oprot.writeBool(struct.hasResultSet); - oprot.writeFieldEnd(); - if (struct.isSetModifiedRowCount()) { - oprot.writeFieldBegin(MODIFIED_ROW_COUNT_FIELD_DESC); - oprot.writeDouble(struct.modifiedRowCount); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TOperationHandleTupleSchemeFactory implements SchemeFactory { - public TOperationHandleTupleScheme getScheme() { - return new TOperationHandleTupleScheme(); - } - } - - private static class TOperationHandleTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.operationId.write(oprot); - oprot.writeI32(struct.operationType.getValue()); - oprot.writeBool(struct.hasResultSet); - BitSet optionals = new BitSet(); - if (struct.isSetModifiedRowCount()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetModifiedRowCount()) { - oprot.writeDouble(struct.modifiedRowCount); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TOperationHandle struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.operationId = new THandleIdentifier(); - struct.operationId.read(iprot); - struct.setOperationIdIsSet(true); - struct.operationType = org.apache.hive.service.rpc.thrift.TOperationType.findByValue(iprot.readI32()); - struct.setOperationTypeIsSet(true); - struct.hasResultSet = iprot.readBool(); - struct.setHasResultSetIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.modifiedRowCount = iprot.readDouble(); - struct.setModifiedRowCountIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOperationState.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOperationState.java deleted file mode 100644 index 4390b4b887583..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOperationState.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TOperationState implements org.apache.thrift.TEnum { - INITIALIZED_STATE(0), - RUNNING_STATE(1), - FINISHED_STATE(2), - CANCELED_STATE(3), - CLOSED_STATE(4), - ERROR_STATE(5), - UKNOWN_STATE(6), - PENDING_STATE(7), - TIMEDOUT_STATE(8); - - private final int value; - - private TOperationState(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TOperationState findByValue(int value) { - switch (value) { - case 0: - return INITIALIZED_STATE; - case 1: - return RUNNING_STATE; - case 2: - return FINISHED_STATE; - case 3: - return CANCELED_STATE; - case 4: - return CLOSED_STATE; - case 5: - return ERROR_STATE; - case 6: - return UKNOWN_STATE; - case 7: - return PENDING_STATE; - case 8: - return TIMEDOUT_STATE; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOperationType.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOperationType.java deleted file mode 100644 index 08002ad1dc8e8..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TOperationType.java +++ /dev/null @@ -1,66 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TOperationType implements org.apache.thrift.TEnum { - EXECUTE_STATEMENT(0), - GET_TYPE_INFO(1), - GET_CATALOGS(2), - GET_SCHEMAS(3), - GET_TABLES(4), - GET_TABLE_TYPES(5), - GET_COLUMNS(6), - GET_FUNCTIONS(7), - UNKNOWN(8); - - private final int value; - - private TOperationType(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TOperationType findByValue(int value) { - switch (value) { - case 0: - return EXECUTE_STATEMENT; - case 1: - return GET_TYPE_INFO; - case 2: - return GET_CATALOGS; - case 3: - return GET_SCHEMAS; - case 4: - return GET_TABLES; - case 5: - return GET_TABLE_TYPES; - case 6: - return GET_COLUMNS; - case 7: - return GET_FUNCTIONS; - case 8: - return UNKNOWN; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TPrimitiveTypeEntry.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TPrimitiveTypeEntry.java deleted file mode 100644 index 910c90967f614..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TPrimitiveTypeEntry.java +++ /dev/null @@ -1,516 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TPrimitiveTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPrimitiveTypeEntry"); - - private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField TYPE_QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("typeQualifiers", org.apache.thrift.protocol.TType.STRUCT, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TPrimitiveTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TPrimitiveTypeEntryTupleSchemeFactory()); - } - - private TTypeId type; // required - private TTypeQualifiers typeQualifiers; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see TTypeId - */ - TYPE((short)1, "type"), - TYPE_QUALIFIERS((short)2, "typeQualifiers"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // TYPE - return TYPE; - case 2: // TYPE_QUALIFIERS - return TYPE_QUALIFIERS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.TYPE_QUALIFIERS}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TTypeId.class))); - tmpMap.put(_Fields.TYPE_QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("typeQualifiers", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifiers.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPrimitiveTypeEntry.class, metaDataMap); - } - - public TPrimitiveTypeEntry() { - } - - public TPrimitiveTypeEntry( - TTypeId type) - { - this(); - this.type = type; - } - - /** - * Performs a deep copy on other. - */ - public TPrimitiveTypeEntry(TPrimitiveTypeEntry other) { - if (other.isSetType()) { - this.type = other.type; - } - if (other.isSetTypeQualifiers()) { - this.typeQualifiers = new TTypeQualifiers(other.typeQualifiers); - } - } - - public TPrimitiveTypeEntry deepCopy() { - return new TPrimitiveTypeEntry(this); - } - - @Override - public void clear() { - this.type = null; - this.typeQualifiers = null; - } - - /** - * - * @see TTypeId - */ - public TTypeId getType() { - return this.type; - } - - /** - * - * @see TTypeId - */ - public void setType(TTypeId type) { - this.type = type; - } - - public void unsetType() { - this.type = null; - } - - /** Returns true if field type is set (has been assigned a value) and false otherwise */ - public boolean isSetType() { - return this.type != null; - } - - public void setTypeIsSet(boolean value) { - if (!value) { - this.type = null; - } - } - - public TTypeQualifiers getTypeQualifiers() { - return this.typeQualifiers; - } - - public void setTypeQualifiers(TTypeQualifiers typeQualifiers) { - this.typeQualifiers = typeQualifiers; - } - - public void unsetTypeQualifiers() { - this.typeQualifiers = null; - } - - /** Returns true if field typeQualifiers is set (has been assigned a value) and false otherwise */ - public boolean isSetTypeQualifiers() { - return this.typeQualifiers != null; - } - - public void setTypeQualifiersIsSet(boolean value) { - if (!value) { - this.typeQualifiers = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TYPE: - if (value == null) { - unsetType(); - } else { - setType((TTypeId)value); - } - break; - - case TYPE_QUALIFIERS: - if (value == null) { - unsetTypeQualifiers(); - } else { - setTypeQualifiers((TTypeQualifiers)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TYPE: - return getType(); - - case TYPE_QUALIFIERS: - return getTypeQualifiers(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case TYPE: - return isSetType(); - case TYPE_QUALIFIERS: - return isSetTypeQualifiers(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TPrimitiveTypeEntry) - return this.equals((TPrimitiveTypeEntry)that); - return false; - } - - public boolean equals(TPrimitiveTypeEntry that) { - if (that == null) - return false; - - boolean this_present_type = true && this.isSetType(); - boolean that_present_type = true && that.isSetType(); - if (this_present_type || that_present_type) { - if (!(this_present_type && that_present_type)) - return false; - if (!this.type.equals(that.type)) - return false; - } - - boolean this_present_typeQualifiers = true && this.isSetTypeQualifiers(); - boolean that_present_typeQualifiers = true && that.isSetTypeQualifiers(); - if (this_present_typeQualifiers || that_present_typeQualifiers) { - if (!(this_present_typeQualifiers && that_present_typeQualifiers)) - return false; - if (!this.typeQualifiers.equals(that.typeQualifiers)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_type = true && (isSetType()); - list.add(present_type); - if (present_type) - list.add(type.getValue()); - - boolean present_typeQualifiers = true && (isSetTypeQualifiers()); - list.add(present_typeQualifiers); - if (present_typeQualifiers) - list.add(typeQualifiers); - - return list.hashCode(); - } - - @Override - public int compareTo(TPrimitiveTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetType()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, other.type); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTypeQualifiers()).compareTo(other.isSetTypeQualifiers()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTypeQualifiers()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeQualifiers, other.typeQualifiers); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TPrimitiveTypeEntry("); - boolean first = true; - - sb.append("type:"); - if (this.type == null) { - sb.append("null"); - } else { - sb.append(this.type); - } - first = false; - if (isSetTypeQualifiers()) { - if (!first) sb.append(", "); - sb.append("typeQualifiers:"); - if (this.typeQualifiers == null) { - sb.append("null"); - } else { - sb.append(this.typeQualifiers); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetType()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (typeQualifiers != null) { - typeQualifiers.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TPrimitiveTypeEntryStandardSchemeFactory implements SchemeFactory { - public TPrimitiveTypeEntryStandardScheme getScheme() { - return new TPrimitiveTypeEntryStandardScheme(); - } - } - - private static class TPrimitiveTypeEntryStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // TYPE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.type = org.apache.hive.service.rpc.thrift.TTypeId.findByValue(iprot.readI32()); - struct.setTypeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // TYPE_QUALIFIERS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.typeQualifiers = new TTypeQualifiers(); - struct.typeQualifiers.read(iprot); - struct.setTypeQualifiersIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.type != null) { - oprot.writeFieldBegin(TYPE_FIELD_DESC); - oprot.writeI32(struct.type.getValue()); - oprot.writeFieldEnd(); - } - if (struct.typeQualifiers != null) { - if (struct.isSetTypeQualifiers()) { - oprot.writeFieldBegin(TYPE_QUALIFIERS_FIELD_DESC); - struct.typeQualifiers.write(oprot); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TPrimitiveTypeEntryTupleSchemeFactory implements SchemeFactory { - public TPrimitiveTypeEntryTupleScheme getScheme() { - return new TPrimitiveTypeEntryTupleScheme(); - } - } - - private static class TPrimitiveTypeEntryTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.type.getValue()); - BitSet optionals = new BitSet(); - if (struct.isSetTypeQualifiers()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetTypeQualifiers()) { - struct.typeQualifiers.write(oprot); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TPrimitiveTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.type = org.apache.hive.service.rpc.thrift.TTypeId.findByValue(iprot.readI32()); - struct.setTypeIsSet(true); - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.typeQualifiers = new TTypeQualifiers(); - struct.typeQualifiers.read(iprot); - struct.setTypeQualifiersIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TProgressUpdateResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TProgressUpdateResp.java deleted file mode 100644 index ecc413aad4cdc..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TProgressUpdateResp.java +++ /dev/null @@ -1,1033 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TProgressUpdateResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TProgressUpdateResp"); - - private static final org.apache.thrift.protocol.TField HEADER_NAMES_FIELD_DESC = new org.apache.thrift.protocol.TField("headerNames", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final org.apache.thrift.protocol.TField PROGRESSED_PERCENTAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("progressedPercentage", org.apache.thrift.protocol.TType.DOUBLE, (short)3); - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField FOOTER_SUMMARY_FIELD_DESC = new org.apache.thrift.protocol.TField("footerSummary", org.apache.thrift.protocol.TType.STRING, (short)5); - private static final org.apache.thrift.protocol.TField START_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("startTime", org.apache.thrift.protocol.TType.I64, (short)6); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TProgressUpdateRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TProgressUpdateRespTupleSchemeFactory()); - } - - private List headerNames; // required - private List> rows; // required - private double progressedPercentage; // required - private TJobExecutionStatus status; // required - private String footerSummary; // required - private long startTime; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - HEADER_NAMES((short)1, "headerNames"), - ROWS((short)2, "rows"), - PROGRESSED_PERCENTAGE((short)3, "progressedPercentage"), - /** - * - * @see TJobExecutionStatus - */ - STATUS((short)4, "status"), - FOOTER_SUMMARY((short)5, "footerSummary"), - START_TIME((short)6, "startTime"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // HEADER_NAMES - return HEADER_NAMES; - case 2: // ROWS - return ROWS; - case 3: // PROGRESSED_PERCENTAGE - return PROGRESSED_PERCENTAGE; - case 4: // STATUS - return STATUS; - case 5: // FOOTER_SUMMARY - return FOOTER_SUMMARY; - case 6: // START_TIME - return START_TIME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __PROGRESSEDPERCENTAGE_ISSET_ID = 0; - private static final int __STARTTIME_ISSET_ID = 1; - private byte __isset_bitfield = 0; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.HEADER_NAMES, new org.apache.thrift.meta_data.FieldMetaData("headerNames", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))))); - tmpMap.put(_Fields.PROGRESSED_PERCENTAGE, new org.apache.thrift.meta_data.FieldMetaData("progressedPercentage", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.DOUBLE))); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TJobExecutionStatus.class))); - tmpMap.put(_Fields.FOOTER_SUMMARY, new org.apache.thrift.meta_data.FieldMetaData("footerSummary", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.START_TIME, new org.apache.thrift.meta_data.FieldMetaData("startTime", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TProgressUpdateResp.class, metaDataMap); - } - - public TProgressUpdateResp() { - } - - public TProgressUpdateResp( - List headerNames, - List> rows, - double progressedPercentage, - TJobExecutionStatus status, - String footerSummary, - long startTime) - { - this(); - this.headerNames = headerNames; - this.rows = rows; - this.progressedPercentage = progressedPercentage; - setProgressedPercentageIsSet(true); - this.status = status; - this.footerSummary = footerSummary; - this.startTime = startTime; - setStartTimeIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public TProgressUpdateResp(TProgressUpdateResp other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetHeaderNames()) { - List __this__headerNames = new ArrayList(other.headerNames); - this.headerNames = __this__headerNames; - } - if (other.isSetRows()) { - List> __this__rows = new ArrayList>(other.rows.size()); - for (List other_element : other.rows) { - List __this__rows_copy = new ArrayList(other_element); - __this__rows.add(__this__rows_copy); - } - this.rows = __this__rows; - } - this.progressedPercentage = other.progressedPercentage; - if (other.isSetStatus()) { - this.status = other.status; - } - if (other.isSetFooterSummary()) { - this.footerSummary = other.footerSummary; - } - this.startTime = other.startTime; - } - - public TProgressUpdateResp deepCopy() { - return new TProgressUpdateResp(this); - } - - @Override - public void clear() { - this.headerNames = null; - this.rows = null; - setProgressedPercentageIsSet(false); - this.progressedPercentage = 0.0; - this.status = null; - this.footerSummary = null; - setStartTimeIsSet(false); - this.startTime = 0; - } - - public int getHeaderNamesSize() { - return (this.headerNames == null) ? 0 : this.headerNames.size(); - } - - public java.util.Iterator getHeaderNamesIterator() { - return (this.headerNames == null) ? null : this.headerNames.iterator(); - } - - public void addToHeaderNames(String elem) { - if (this.headerNames == null) { - this.headerNames = new ArrayList(); - } - this.headerNames.add(elem); - } - - public List getHeaderNames() { - return this.headerNames; - } - - public void setHeaderNames(List headerNames) { - this.headerNames = headerNames; - } - - public void unsetHeaderNames() { - this.headerNames = null; - } - - /** Returns true if field headerNames is set (has been assigned a value) and false otherwise */ - public boolean isSetHeaderNames() { - return this.headerNames != null; - } - - public void setHeaderNamesIsSet(boolean value) { - if (!value) { - this.headerNames = null; - } - } - - public int getRowsSize() { - return (this.rows == null) ? 0 : this.rows.size(); - } - - public java.util.Iterator> getRowsIterator() { - return (this.rows == null) ? null : this.rows.iterator(); - } - - public void addToRows(List elem) { - if (this.rows == null) { - this.rows = new ArrayList>(); - } - this.rows.add(elem); - } - - public List> getRows() { - return this.rows; - } - - public void setRows(List> rows) { - this.rows = rows; - } - - public void unsetRows() { - this.rows = null; - } - - /** Returns true if field rows is set (has been assigned a value) and false otherwise */ - public boolean isSetRows() { - return this.rows != null; - } - - public void setRowsIsSet(boolean value) { - if (!value) { - this.rows = null; - } - } - - public double getProgressedPercentage() { - return this.progressedPercentage; - } - - public void setProgressedPercentage(double progressedPercentage) { - this.progressedPercentage = progressedPercentage; - setProgressedPercentageIsSet(true); - } - - public void unsetProgressedPercentage() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); - } - - /** Returns true if field progressedPercentage is set (has been assigned a value) and false otherwise */ - public boolean isSetProgressedPercentage() { - return EncodingUtils.testBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID); - } - - public void setProgressedPercentageIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PROGRESSEDPERCENTAGE_ISSET_ID, value); - } - - /** - * - * @see TJobExecutionStatus - */ - public TJobExecutionStatus getStatus() { - return this.status; - } - - /** - * - * @see TJobExecutionStatus - */ - public void setStatus(TJobExecutionStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public String getFooterSummary() { - return this.footerSummary; - } - - public void setFooterSummary(String footerSummary) { - this.footerSummary = footerSummary; - } - - public void unsetFooterSummary() { - this.footerSummary = null; - } - - /** Returns true if field footerSummary is set (has been assigned a value) and false otherwise */ - public boolean isSetFooterSummary() { - return this.footerSummary != null; - } - - public void setFooterSummaryIsSet(boolean value) { - if (!value) { - this.footerSummary = null; - } - } - - public long getStartTime() { - return this.startTime; - } - - public void setStartTime(long startTime) { - this.startTime = startTime; - setStartTimeIsSet(true); - } - - public void unsetStartTime() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIME_ISSET_ID); - } - - /** Returns true if field startTime is set (has been assigned a value) and false otherwise */ - public boolean isSetStartTime() { - return EncodingUtils.testBit(__isset_bitfield, __STARTTIME_ISSET_ID); - } - - public void setStartTimeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIME_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case HEADER_NAMES: - if (value == null) { - unsetHeaderNames(); - } else { - setHeaderNames((List)value); - } - break; - - case ROWS: - if (value == null) { - unsetRows(); - } else { - setRows((List>)value); - } - break; - - case PROGRESSED_PERCENTAGE: - if (value == null) { - unsetProgressedPercentage(); - } else { - setProgressedPercentage((Double)value); - } - break; - - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TJobExecutionStatus)value); - } - break; - - case FOOTER_SUMMARY: - if (value == null) { - unsetFooterSummary(); - } else { - setFooterSummary((String)value); - } - break; - - case START_TIME: - if (value == null) { - unsetStartTime(); - } else { - setStartTime((Long)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case HEADER_NAMES: - return getHeaderNames(); - - case ROWS: - return getRows(); - - case PROGRESSED_PERCENTAGE: - return getProgressedPercentage(); - - case STATUS: - return getStatus(); - - case FOOTER_SUMMARY: - return getFooterSummary(); - - case START_TIME: - return getStartTime(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case HEADER_NAMES: - return isSetHeaderNames(); - case ROWS: - return isSetRows(); - case PROGRESSED_PERCENTAGE: - return isSetProgressedPercentage(); - case STATUS: - return isSetStatus(); - case FOOTER_SUMMARY: - return isSetFooterSummary(); - case START_TIME: - return isSetStartTime(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TProgressUpdateResp) - return this.equals((TProgressUpdateResp)that); - return false; - } - - public boolean equals(TProgressUpdateResp that) { - if (that == null) - return false; - - boolean this_present_headerNames = true && this.isSetHeaderNames(); - boolean that_present_headerNames = true && that.isSetHeaderNames(); - if (this_present_headerNames || that_present_headerNames) { - if (!(this_present_headerNames && that_present_headerNames)) - return false; - if (!this.headerNames.equals(that.headerNames)) - return false; - } - - boolean this_present_rows = true && this.isSetRows(); - boolean that_present_rows = true && that.isSetRows(); - if (this_present_rows || that_present_rows) { - if (!(this_present_rows && that_present_rows)) - return false; - if (!this.rows.equals(that.rows)) - return false; - } - - boolean this_present_progressedPercentage = true; - boolean that_present_progressedPercentage = true; - if (this_present_progressedPercentage || that_present_progressedPercentage) { - if (!(this_present_progressedPercentage && that_present_progressedPercentage)) - return false; - if (this.progressedPercentage != that.progressedPercentage) - return false; - } - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - boolean this_present_footerSummary = true && this.isSetFooterSummary(); - boolean that_present_footerSummary = true && that.isSetFooterSummary(); - if (this_present_footerSummary || that_present_footerSummary) { - if (!(this_present_footerSummary && that_present_footerSummary)) - return false; - if (!this.footerSummary.equals(that.footerSummary)) - return false; - } - - boolean this_present_startTime = true; - boolean that_present_startTime = true; - if (this_present_startTime || that_present_startTime) { - if (!(this_present_startTime && that_present_startTime)) - return false; - if (this.startTime != that.startTime) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_headerNames = true && (isSetHeaderNames()); - list.add(present_headerNames); - if (present_headerNames) - list.add(headerNames); - - boolean present_rows = true && (isSetRows()); - list.add(present_rows); - if (present_rows) - list.add(rows); - - boolean present_progressedPercentage = true; - list.add(present_progressedPercentage); - if (present_progressedPercentage) - list.add(progressedPercentage); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status.getValue()); - - boolean present_footerSummary = true && (isSetFooterSummary()); - list.add(present_footerSummary); - if (present_footerSummary) - list.add(footerSummary); - - boolean present_startTime = true; - list.add(present_startTime); - if (present_startTime) - list.add(startTime); - - return list.hashCode(); - } - - @Override - public int compareTo(TProgressUpdateResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetHeaderNames()).compareTo(other.isSetHeaderNames()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetHeaderNames()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.headerNames, other.headerNames); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetProgressedPercentage()).compareTo(other.isSetProgressedPercentage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetProgressedPercentage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.progressedPercentage, other.progressedPercentage); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetFooterSummary()).compareTo(other.isSetFooterSummary()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetFooterSummary()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.footerSummary, other.footerSummary); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetStartTime()).compareTo(other.isSetStartTime()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStartTime()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startTime, other.startTime); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TProgressUpdateResp("); - boolean first = true; - - sb.append("headerNames:"); - if (this.headerNames == null) { - sb.append("null"); - } else { - sb.append(this.headerNames); - } - first = false; - if (!first) sb.append(", "); - sb.append("rows:"); - if (this.rows == null) { - sb.append("null"); - } else { - sb.append(this.rows); - } - first = false; - if (!first) sb.append(", "); - sb.append("progressedPercentage:"); - sb.append(this.progressedPercentage); - first = false; - if (!first) sb.append(", "); - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - if (!first) sb.append(", "); - sb.append("footerSummary:"); - if (this.footerSummary == null) { - sb.append("null"); - } else { - sb.append(this.footerSummary); - } - first = false; - if (!first) sb.append(", "); - sb.append("startTime:"); - sb.append(this.startTime); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetHeaderNames()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'headerNames' is unset! Struct:" + toString()); - } - - if (!isSetRows()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'rows' is unset! Struct:" + toString()); - } - - if (!isSetProgressedPercentage()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'progressedPercentage' is unset! Struct:" + toString()); - } - - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - if (!isSetFooterSummary()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'footerSummary' is unset! Struct:" + toString()); - } - - if (!isSetStartTime()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'startTime' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TProgressUpdateRespStandardSchemeFactory implements SchemeFactory { - public TProgressUpdateRespStandardScheme getScheme() { - return new TProgressUpdateRespStandardScheme(); - } - } - - private static class TProgressUpdateRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TProgressUpdateResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // HEADER_NAMES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list180 = iprot.readListBegin(); - struct.headerNames = new ArrayList(_list180.size); - String _elem181; - for (int _i182 = 0; _i182 < _list180.size; ++_i182) - { - _elem181 = iprot.readString(); - struct.headerNames.add(_elem181); - } - iprot.readListEnd(); - } - struct.setHeaderNamesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // ROWS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list183 = iprot.readListBegin(); - struct.rows = new ArrayList>(_list183.size); - List _elem184; - for (int _i185 = 0; _i185 < _list183.size; ++_i185) - { - { - org.apache.thrift.protocol.TList _list186 = iprot.readListBegin(); - _elem184 = new ArrayList(_list186.size); - String _elem187; - for (int _i188 = 0; _i188 < _list186.size; ++_i188) - { - _elem187 = iprot.readString(); - _elem184.add(_elem187); - } - iprot.readListEnd(); - } - struct.rows.add(_elem184); - } - iprot.readListEnd(); - } - struct.setRowsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // PROGRESSED_PERCENTAGE - if (schemeField.type == org.apache.thrift.protocol.TType.DOUBLE) { - struct.progressedPercentage = iprot.readDouble(); - struct.setProgressedPercentageIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.status = org.apache.hive.service.rpc.thrift.TJobExecutionStatus.findByValue(iprot.readI32()); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // FOOTER_SUMMARY - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.footerSummary = iprot.readString(); - struct.setFooterSummaryIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 6: // START_TIME - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.startTime = iprot.readI64(); - struct.setStartTimeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TProgressUpdateResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.headerNames != null) { - oprot.writeFieldBegin(HEADER_NAMES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.headerNames.size())); - for (String _iter189 : struct.headerNames) - { - oprot.writeString(_iter189); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.rows != null) { - oprot.writeFieldBegin(ROWS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.rows.size())); - for (List _iter190 : struct.rows) - { - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter190.size())); - for (String _iter191 : _iter190) - { - oprot.writeString(_iter191); - } - oprot.writeListEnd(); - } - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(PROGRESSED_PERCENTAGE_FIELD_DESC); - oprot.writeDouble(struct.progressedPercentage); - oprot.writeFieldEnd(); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - oprot.writeI32(struct.status.getValue()); - oprot.writeFieldEnd(); - } - if (struct.footerSummary != null) { - oprot.writeFieldBegin(FOOTER_SUMMARY_FIELD_DESC); - oprot.writeString(struct.footerSummary); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(START_TIME_FIELD_DESC); - oprot.writeI64(struct.startTime); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TProgressUpdateRespTupleSchemeFactory implements SchemeFactory { - public TProgressUpdateRespTupleScheme getScheme() { - return new TProgressUpdateRespTupleScheme(); - } - } - - private static class TProgressUpdateRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.headerNames.size()); - for (String _iter192 : struct.headerNames) - { - oprot.writeString(_iter192); - } - } - { - oprot.writeI32(struct.rows.size()); - for (List _iter193 : struct.rows) - { - { - oprot.writeI32(_iter193.size()); - for (String _iter194 : _iter193) - { - oprot.writeString(_iter194); - } - } - } - } - oprot.writeDouble(struct.progressedPercentage); - oprot.writeI32(struct.status.getValue()); - oprot.writeString(struct.footerSummary); - oprot.writeI64(struct.startTime); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TProgressUpdateResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list195 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.headerNames = new ArrayList(_list195.size); - String _elem196; - for (int _i197 = 0; _i197 < _list195.size; ++_i197) - { - _elem196 = iprot.readString(); - struct.headerNames.add(_elem196); - } - } - struct.setHeaderNamesIsSet(true); - { - org.apache.thrift.protocol.TList _list198 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32()); - struct.rows = new ArrayList>(_list198.size); - List _elem199; - for (int _i200 = 0; _i200 < _list198.size; ++_i200) - { - { - org.apache.thrift.protocol.TList _list201 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - _elem199 = new ArrayList(_list201.size); - String _elem202; - for (int _i203 = 0; _i203 < _list201.size; ++_i203) - { - _elem202 = iprot.readString(); - _elem199.add(_elem202); - } - } - struct.rows.add(_elem199); - } - } - struct.setRowsIsSet(true); - struct.progressedPercentage = iprot.readDouble(); - struct.setProgressedPercentageIsSet(true); - struct.status = org.apache.hive.service.rpc.thrift.TJobExecutionStatus.findByValue(iprot.readI32()); - struct.setStatusIsSet(true); - struct.footerSummary = iprot.readString(); - struct.setFooterSummaryIsSet(true); - struct.startTime = iprot.readI64(); - struct.setStartTimeIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TProtocolVersion.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TProtocolVersion.java deleted file mode 100644 index 18a782513c500..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TProtocolVersion.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TProtocolVersion implements org.apache.thrift.TEnum { - HIVE_CLI_SERVICE_PROTOCOL_V1(0), - HIVE_CLI_SERVICE_PROTOCOL_V2(1), - HIVE_CLI_SERVICE_PROTOCOL_V3(2), - HIVE_CLI_SERVICE_PROTOCOL_V4(3), - HIVE_CLI_SERVICE_PROTOCOL_V5(4), - HIVE_CLI_SERVICE_PROTOCOL_V6(5), - HIVE_CLI_SERVICE_PROTOCOL_V7(6), - HIVE_CLI_SERVICE_PROTOCOL_V8(7), - HIVE_CLI_SERVICE_PROTOCOL_V9(8), - HIVE_CLI_SERVICE_PROTOCOL_V10(9); - - private final int value; - - private TProtocolVersion(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TProtocolVersion findByValue(int value) { - switch (value) { - case 0: - return HIVE_CLI_SERVICE_PROTOCOL_V1; - case 1: - return HIVE_CLI_SERVICE_PROTOCOL_V2; - case 2: - return HIVE_CLI_SERVICE_PROTOCOL_V3; - case 3: - return HIVE_CLI_SERVICE_PROTOCOL_V4; - case 4: - return HIVE_CLI_SERVICE_PROTOCOL_V5; - case 5: - return HIVE_CLI_SERVICE_PROTOCOL_V6; - case 6: - return HIVE_CLI_SERVICE_PROTOCOL_V7; - case 7: - return HIVE_CLI_SERVICE_PROTOCOL_V8; - case 8: - return HIVE_CLI_SERVICE_PROTOCOL_V9; - case 9: - return HIVE_CLI_SERVICE_PROTOCOL_V10; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TRenewDelegationTokenReq.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TRenewDelegationTokenReq.java deleted file mode 100644 index 8957ebc8d2fff..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TRenewDelegationTokenReq.java +++ /dev/null @@ -1,495 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TRenewDelegationTokenReq implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenReq"); - - private static final org.apache.thrift.protocol.TField SESSION_HANDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionHandle", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField DELEGATION_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("delegationToken", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRenewDelegationTokenReqStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRenewDelegationTokenReqTupleSchemeFactory()); - } - - private TSessionHandle sessionHandle; // required - private String delegationToken; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_HANDLE((short)1, "sessionHandle"), - DELEGATION_TOKEN((short)2, "delegationToken"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_HANDLE - return SESSION_HANDLE; - case 2: // DELEGATION_TOKEN - return DELEGATION_TOKEN; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_HANDLE, new org.apache.thrift.meta_data.FieldMetaData("sessionHandle", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSessionHandle.class))); - tmpMap.put(_Fields.DELEGATION_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("delegationToken", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenReq.class, metaDataMap); - } - - public TRenewDelegationTokenReq() { - } - - public TRenewDelegationTokenReq( - TSessionHandle sessionHandle, - String delegationToken) - { - this(); - this.sessionHandle = sessionHandle; - this.delegationToken = delegationToken; - } - - /** - * Performs a deep copy on other. - */ - public TRenewDelegationTokenReq(TRenewDelegationTokenReq other) { - if (other.isSetSessionHandle()) { - this.sessionHandle = new TSessionHandle(other.sessionHandle); - } - if (other.isSetDelegationToken()) { - this.delegationToken = other.delegationToken; - } - } - - public TRenewDelegationTokenReq deepCopy() { - return new TRenewDelegationTokenReq(this); - } - - @Override - public void clear() { - this.sessionHandle = null; - this.delegationToken = null; - } - - public TSessionHandle getSessionHandle() { - return this.sessionHandle; - } - - public void setSessionHandle(TSessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public void unsetSessionHandle() { - this.sessionHandle = null; - } - - /** Returns true if field sessionHandle is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionHandle() { - return this.sessionHandle != null; - } - - public void setSessionHandleIsSet(boolean value) { - if (!value) { - this.sessionHandle = null; - } - } - - public String getDelegationToken() { - return this.delegationToken; - } - - public void setDelegationToken(String delegationToken) { - this.delegationToken = delegationToken; - } - - public void unsetDelegationToken() { - this.delegationToken = null; - } - - /** Returns true if field delegationToken is set (has been assigned a value) and false otherwise */ - public boolean isSetDelegationToken() { - return this.delegationToken != null; - } - - public void setDelegationTokenIsSet(boolean value) { - if (!value) { - this.delegationToken = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_HANDLE: - if (value == null) { - unsetSessionHandle(); - } else { - setSessionHandle((TSessionHandle)value); - } - break; - - case DELEGATION_TOKEN: - if (value == null) { - unsetDelegationToken(); - } else { - setDelegationToken((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_HANDLE: - return getSessionHandle(); - - case DELEGATION_TOKEN: - return getDelegationToken(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_HANDLE: - return isSetSessionHandle(); - case DELEGATION_TOKEN: - return isSetDelegationToken(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TRenewDelegationTokenReq) - return this.equals((TRenewDelegationTokenReq)that); - return false; - } - - public boolean equals(TRenewDelegationTokenReq that) { - if (that == null) - return false; - - boolean this_present_sessionHandle = true && this.isSetSessionHandle(); - boolean that_present_sessionHandle = true && that.isSetSessionHandle(); - if (this_present_sessionHandle || that_present_sessionHandle) { - if (!(this_present_sessionHandle && that_present_sessionHandle)) - return false; - if (!this.sessionHandle.equals(that.sessionHandle)) - return false; - } - - boolean this_present_delegationToken = true && this.isSetDelegationToken(); - boolean that_present_delegationToken = true && that.isSetDelegationToken(); - if (this_present_delegationToken || that_present_delegationToken) { - if (!(this_present_delegationToken && that_present_delegationToken)) - return false; - if (!this.delegationToken.equals(that.delegationToken)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionHandle = true && (isSetSessionHandle()); - list.add(present_sessionHandle); - if (present_sessionHandle) - list.add(sessionHandle); - - boolean present_delegationToken = true && (isSetDelegationToken()); - list.add(present_delegationToken); - if (present_delegationToken) - list.add(delegationToken); - - return list.hashCode(); - } - - @Override - public int compareTo(TRenewDelegationTokenReq other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionHandle()).compareTo(other.isSetSessionHandle()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionHandle()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionHandle, other.sessionHandle); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetDelegationToken()).compareTo(other.isSetDelegationToken()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetDelegationToken()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delegationToken, other.delegationToken); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TRenewDelegationTokenReq("); - boolean first = true; - - sb.append("sessionHandle:"); - if (this.sessionHandle == null) { - sb.append("null"); - } else { - sb.append(this.sessionHandle); - } - first = false; - if (!first) sb.append(", "); - sb.append("delegationToken:"); - if (this.delegationToken == null) { - sb.append("null"); - } else { - sb.append(this.delegationToken); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionHandle()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionHandle' is unset! Struct:" + toString()); - } - - if (!isSetDelegationToken()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'delegationToken' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionHandle != null) { - sessionHandle.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TRenewDelegationTokenReqStandardSchemeFactory implements SchemeFactory { - public TRenewDelegationTokenReqStandardScheme getScheme() { - return new TRenewDelegationTokenReqStandardScheme(); - } - } - - private static class TRenewDelegationTokenReqStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_HANDLE - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // DELEGATION_TOKEN - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionHandle != null) { - oprot.writeFieldBegin(SESSION_HANDLE_FIELD_DESC); - struct.sessionHandle.write(oprot); - oprot.writeFieldEnd(); - } - if (struct.delegationToken != null) { - oprot.writeFieldBegin(DELEGATION_TOKEN_FIELD_DESC); - oprot.writeString(struct.delegationToken); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRenewDelegationTokenReqTupleSchemeFactory implements SchemeFactory { - public TRenewDelegationTokenReqTupleScheme getScheme() { - return new TRenewDelegationTokenReqTupleScheme(); - } - } - - private static class TRenewDelegationTokenReqTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionHandle.write(oprot); - oprot.writeString(struct.delegationToken); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenReq struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionHandle = new TSessionHandle(); - struct.sessionHandle.read(iprot); - struct.setSessionHandleIsSet(true); - struct.delegationToken = iprot.readString(); - struct.setDelegationTokenIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TRenewDelegationTokenResp.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TRenewDelegationTokenResp.java deleted file mode 100644 index 6f5004ccc38e4..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TRenewDelegationTokenResp.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TRenewDelegationTokenResp implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRenewDelegationTokenResp"); - - private static final org.apache.thrift.protocol.TField STATUS_FIELD_DESC = new org.apache.thrift.protocol.TField("status", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRenewDelegationTokenRespStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRenewDelegationTokenRespTupleSchemeFactory()); - } - - private TStatus status; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - STATUS((short)1, "status"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS - return STATUS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS, new org.apache.thrift.meta_data.FieldMetaData("status", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStatus.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRenewDelegationTokenResp.class, metaDataMap); - } - - public TRenewDelegationTokenResp() { - } - - public TRenewDelegationTokenResp( - TStatus status) - { - this(); - this.status = status; - } - - /** - * Performs a deep copy on other. - */ - public TRenewDelegationTokenResp(TRenewDelegationTokenResp other) { - if (other.isSetStatus()) { - this.status = new TStatus(other.status); - } - } - - public TRenewDelegationTokenResp deepCopy() { - return new TRenewDelegationTokenResp(this); - } - - @Override - public void clear() { - this.status = null; - } - - public TStatus getStatus() { - return this.status; - } - - public void setStatus(TStatus status) { - this.status = status; - } - - public void unsetStatus() { - this.status = null; - } - - /** Returns true if field status is set (has been assigned a value) and false otherwise */ - public boolean isSetStatus() { - return this.status != null; - } - - public void setStatusIsSet(boolean value) { - if (!value) { - this.status = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS: - if (value == null) { - unsetStatus(); - } else { - setStatus((TStatus)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS: - return getStatus(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS: - return isSetStatus(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TRenewDelegationTokenResp) - return this.equals((TRenewDelegationTokenResp)that); - return false; - } - - public boolean equals(TRenewDelegationTokenResp that) { - if (that == null) - return false; - - boolean this_present_status = true && this.isSetStatus(); - boolean that_present_status = true && that.isSetStatus(); - if (this_present_status || that_present_status) { - if (!(this_present_status && that_present_status)) - return false; - if (!this.status.equals(that.status)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_status = true && (isSetStatus()); - list.add(present_status); - if (present_status) - list.add(status); - - return list.hashCode(); - } - - @Override - public int compareTo(TRenewDelegationTokenResp other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatus()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TRenewDelegationTokenResp("); - boolean first = true; - - sb.append("status:"); - if (this.status == null) { - sb.append("null"); - } else { - sb.append(this.status); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatus()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'status' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (status != null) { - status.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TRenewDelegationTokenRespStandardSchemeFactory implements SchemeFactory { - public TRenewDelegationTokenRespStandardScheme getScheme() { - return new TRenewDelegationTokenRespStandardScheme(); - } - } - - private static class TRenewDelegationTokenRespStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.status != null) { - oprot.writeFieldBegin(STATUS_FIELD_DESC); - struct.status.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRenewDelegationTokenRespTupleSchemeFactory implements SchemeFactory { - public TRenewDelegationTokenRespTupleScheme getScheme() { - return new TRenewDelegationTokenRespTupleScheme(); - } - } - - private static class TRenewDelegationTokenRespTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.status.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TRenewDelegationTokenResp struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.status = new TStatus(); - struct.status.read(iprot); - struct.setStatusIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TRow.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TRow.java deleted file mode 100644 index e95299df97c3a..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TRow.java +++ /dev/null @@ -1,443 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TRow implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRow"); - - private static final org.apache.thrift.protocol.TField COL_VALS_FIELD_DESC = new org.apache.thrift.protocol.TField("colVals", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRowStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRowTupleSchemeFactory()); - } - - private List colVals; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - COL_VALS((short)1, "colVals"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // COL_VALS - return COL_VALS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.COL_VALS, new org.apache.thrift.meta_data.FieldMetaData("colVals", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnValue.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRow.class, metaDataMap); - } - - public TRow() { - } - - public TRow( - List colVals) - { - this(); - this.colVals = colVals; - } - - /** - * Performs a deep copy on other. - */ - public TRow(TRow other) { - if (other.isSetColVals()) { - List __this__colVals = new ArrayList(other.colVals.size()); - for (TColumnValue other_element : other.colVals) { - __this__colVals.add(new TColumnValue(other_element)); - } - this.colVals = __this__colVals; - } - } - - public TRow deepCopy() { - return new TRow(this); - } - - @Override - public void clear() { - this.colVals = null; - } - - public int getColValsSize() { - return (this.colVals == null) ? 0 : this.colVals.size(); - } - - public java.util.Iterator getColValsIterator() { - return (this.colVals == null) ? null : this.colVals.iterator(); - } - - public void addToColVals(TColumnValue elem) { - if (this.colVals == null) { - this.colVals = new ArrayList(); - } - this.colVals.add(elem); - } - - public List getColVals() { - return this.colVals; - } - - public void setColVals(List colVals) { - this.colVals = colVals; - } - - public void unsetColVals() { - this.colVals = null; - } - - /** Returns true if field colVals is set (has been assigned a value) and false otherwise */ - public boolean isSetColVals() { - return this.colVals != null; - } - - public void setColValsIsSet(boolean value) { - if (!value) { - this.colVals = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case COL_VALS: - if (value == null) { - unsetColVals(); - } else { - setColVals((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case COL_VALS: - return getColVals(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case COL_VALS: - return isSetColVals(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TRow) - return this.equals((TRow)that); - return false; - } - - public boolean equals(TRow that) { - if (that == null) - return false; - - boolean this_present_colVals = true && this.isSetColVals(); - boolean that_present_colVals = true && that.isSetColVals(); - if (this_present_colVals || that_present_colVals) { - if (!(this_present_colVals && that_present_colVals)) - return false; - if (!this.colVals.equals(that.colVals)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_colVals = true && (isSetColVals()); - list.add(present_colVals); - if (present_colVals) - list.add(colVals); - - return list.hashCode(); - } - - @Override - public int compareTo(TRow other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetColVals()).compareTo(other.isSetColVals()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColVals()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.colVals, other.colVals); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TRow("); - boolean first = true; - - sb.append("colVals:"); - if (this.colVals == null) { - sb.append("null"); - } else { - sb.append(this.colVals); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetColVals()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'colVals' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TRowStandardSchemeFactory implements SchemeFactory { - public TRowStandardScheme getScheme() { - return new TRowStandardScheme(); - } - } - - private static class TRowStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRow struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // COL_VALS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list46 = iprot.readListBegin(); - struct.colVals = new ArrayList(_list46.size); - TColumnValue _elem47; - for (int _i48 = 0; _i48 < _list46.size; ++_i48) - { - _elem47 = new TColumnValue(); - _elem47.read(iprot); - struct.colVals.add(_elem47); - } - iprot.readListEnd(); - } - struct.setColValsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TRow struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.colVals != null) { - oprot.writeFieldBegin(COL_VALS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.colVals.size())); - for (TColumnValue _iter49 : struct.colVals) - { - _iter49.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRowTupleSchemeFactory implements SchemeFactory { - public TRowTupleScheme getScheme() { - return new TRowTupleScheme(); - } - } - - private static class TRowTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.colVals.size()); - for (TColumnValue _iter50 : struct.colVals) - { - _iter50.write(oprot); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TRow struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list51 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.colVals = new ArrayList(_list51.size); - TColumnValue _elem52; - for (int _i53 = 0; _i53 < _list51.size; ++_i53) - { - _elem52 = new TColumnValue(); - _elem52.read(iprot); - struct.colVals.add(_elem52); - } - } - struct.setColValsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TRowSet.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TRowSet.java deleted file mode 100644 index da3d9d3ca8820..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TRowSet.java +++ /dev/null @@ -1,920 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TRowSet implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TRowSet"); - - private static final org.apache.thrift.protocol.TField START_ROW_OFFSET_FIELD_DESC = new org.apache.thrift.protocol.TField("startRowOffset", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField ROWS_FIELD_DESC = new org.apache.thrift.protocol.TField("rows", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)3); - private static final org.apache.thrift.protocol.TField BINARY_COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("binaryColumns", org.apache.thrift.protocol.TType.STRING, (short)4); - private static final org.apache.thrift.protocol.TField COLUMN_COUNT_FIELD_DESC = new org.apache.thrift.protocol.TField("columnCount", org.apache.thrift.protocol.TType.I32, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TRowSetStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TRowSetTupleSchemeFactory()); - } - - private long startRowOffset; // required - private List rows; // required - private List columns; // optional - private ByteBuffer binaryColumns; // optional - private int columnCount; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - START_ROW_OFFSET((short)1, "startRowOffset"), - ROWS((short)2, "rows"), - COLUMNS((short)3, "columns"), - BINARY_COLUMNS((short)4, "binaryColumns"), - COLUMN_COUNT((short)5, "columnCount"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // START_ROW_OFFSET - return START_ROW_OFFSET; - case 2: // ROWS - return ROWS; - case 3: // COLUMNS - return COLUMNS; - case 4: // BINARY_COLUMNS - return BINARY_COLUMNS; - case 5: // COLUMN_COUNT - return COLUMN_COUNT; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __STARTROWOFFSET_ISSET_ID = 0; - private static final int __COLUMNCOUNT_ISSET_ID = 1; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.COLUMNS,_Fields.BINARY_COLUMNS,_Fields.COLUMN_COUNT}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.START_ROW_OFFSET, new org.apache.thrift.meta_data.FieldMetaData("startRowOffset", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.ROWS, new org.apache.thrift.meta_data.FieldMetaData("rows", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TRow.class)))); - tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumn.class)))); - tmpMap.put(_Fields.BINARY_COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("binaryColumns", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - tmpMap.put(_Fields.COLUMN_COUNT, new org.apache.thrift.meta_data.FieldMetaData("columnCount", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TRowSet.class, metaDataMap); - } - - public TRowSet() { - } - - public TRowSet( - long startRowOffset, - List rows) - { - this(); - this.startRowOffset = startRowOffset; - setStartRowOffsetIsSet(true); - this.rows = rows; - } - - /** - * Performs a deep copy on other. - */ - public TRowSet(TRowSet other) { - __isset_bitfield = other.__isset_bitfield; - this.startRowOffset = other.startRowOffset; - if (other.isSetRows()) { - List __this__rows = new ArrayList(other.rows.size()); - for (TRow other_element : other.rows) { - __this__rows.add(new TRow(other_element)); - } - this.rows = __this__rows; - } - if (other.isSetColumns()) { - List __this__columns = new ArrayList(other.columns.size()); - for (TColumn other_element : other.columns) { - __this__columns.add(new TColumn(other_element)); - } - this.columns = __this__columns; - } - if (other.isSetBinaryColumns()) { - this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(other.binaryColumns); - } - this.columnCount = other.columnCount; - } - - public TRowSet deepCopy() { - return new TRowSet(this); - } - - @Override - public void clear() { - setStartRowOffsetIsSet(false); - this.startRowOffset = 0; - this.rows = null; - this.columns = null; - this.binaryColumns = null; - setColumnCountIsSet(false); - this.columnCount = 0; - } - - public long getStartRowOffset() { - return this.startRowOffset; - } - - public void setStartRowOffset(long startRowOffset) { - this.startRowOffset = startRowOffset; - setStartRowOffsetIsSet(true); - } - - public void unsetStartRowOffset() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); - } - - /** Returns true if field startRowOffset is set (has been assigned a value) and false otherwise */ - public boolean isSetStartRowOffset() { - return EncodingUtils.testBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID); - } - - public void setStartRowOffsetIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTROWOFFSET_ISSET_ID, value); - } - - public int getRowsSize() { - return (this.rows == null) ? 0 : this.rows.size(); - } - - public java.util.Iterator getRowsIterator() { - return (this.rows == null) ? null : this.rows.iterator(); - } - - public void addToRows(TRow elem) { - if (this.rows == null) { - this.rows = new ArrayList(); - } - this.rows.add(elem); - } - - public List getRows() { - return this.rows; - } - - public void setRows(List rows) { - this.rows = rows; - } - - public void unsetRows() { - this.rows = null; - } - - /** Returns true if field rows is set (has been assigned a value) and false otherwise */ - public boolean isSetRows() { - return this.rows != null; - } - - public void setRowsIsSet(boolean value) { - if (!value) { - this.rows = null; - } - } - - public int getColumnsSize() { - return (this.columns == null) ? 0 : this.columns.size(); - } - - public java.util.Iterator getColumnsIterator() { - return (this.columns == null) ? null : this.columns.iterator(); - } - - public void addToColumns(TColumn elem) { - if (this.columns == null) { - this.columns = new ArrayList(); - } - this.columns.add(elem); - } - - public List getColumns() { - return this.columns; - } - - public void setColumns(List columns) { - this.columns = columns; - } - - public void unsetColumns() { - this.columns = null; - } - - /** Returns true if field columns is set (has been assigned a value) and false otherwise */ - public boolean isSetColumns() { - return this.columns != null; - } - - public void setColumnsIsSet(boolean value) { - if (!value) { - this.columns = null; - } - } - - public byte[] getBinaryColumns() { - setBinaryColumns(org.apache.thrift.TBaseHelper.rightSize(binaryColumns)); - return binaryColumns == null ? null : binaryColumns.array(); - } - - public ByteBuffer bufferForBinaryColumns() { - return org.apache.thrift.TBaseHelper.copyBinary(binaryColumns); - } - - public void setBinaryColumns(byte[] binaryColumns) { - this.binaryColumns = binaryColumns == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(binaryColumns, binaryColumns.length)); - } - - public void setBinaryColumns(ByteBuffer binaryColumns) { - this.binaryColumns = org.apache.thrift.TBaseHelper.copyBinary(binaryColumns); - } - - public void unsetBinaryColumns() { - this.binaryColumns = null; - } - - /** Returns true if field binaryColumns is set (has been assigned a value) and false otherwise */ - public boolean isSetBinaryColumns() { - return this.binaryColumns != null; - } - - public void setBinaryColumnsIsSet(boolean value) { - if (!value) { - this.binaryColumns = null; - } - } - - public int getColumnCount() { - return this.columnCount; - } - - public void setColumnCount(int columnCount) { - this.columnCount = columnCount; - setColumnCountIsSet(true); - } - - public void unsetColumnCount() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); - } - - /** Returns true if field columnCount is set (has been assigned a value) and false otherwise */ - public boolean isSetColumnCount() { - return EncodingUtils.testBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID); - } - - public void setColumnCountIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COLUMNCOUNT_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case START_ROW_OFFSET: - if (value == null) { - unsetStartRowOffset(); - } else { - setStartRowOffset((Long)value); - } - break; - - case ROWS: - if (value == null) { - unsetRows(); - } else { - setRows((List)value); - } - break; - - case COLUMNS: - if (value == null) { - unsetColumns(); - } else { - setColumns((List)value); - } - break; - - case BINARY_COLUMNS: - if (value == null) { - unsetBinaryColumns(); - } else { - setBinaryColumns((ByteBuffer)value); - } - break; - - case COLUMN_COUNT: - if (value == null) { - unsetColumnCount(); - } else { - setColumnCount((Integer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case START_ROW_OFFSET: - return getStartRowOffset(); - - case ROWS: - return getRows(); - - case COLUMNS: - return getColumns(); - - case BINARY_COLUMNS: - return getBinaryColumns(); - - case COLUMN_COUNT: - return getColumnCount(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case START_ROW_OFFSET: - return isSetStartRowOffset(); - case ROWS: - return isSetRows(); - case COLUMNS: - return isSetColumns(); - case BINARY_COLUMNS: - return isSetBinaryColumns(); - case COLUMN_COUNT: - return isSetColumnCount(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TRowSet) - return this.equals((TRowSet)that); - return false; - } - - public boolean equals(TRowSet that) { - if (that == null) - return false; - - boolean this_present_startRowOffset = true; - boolean that_present_startRowOffset = true; - if (this_present_startRowOffset || that_present_startRowOffset) { - if (!(this_present_startRowOffset && that_present_startRowOffset)) - return false; - if (this.startRowOffset != that.startRowOffset) - return false; - } - - boolean this_present_rows = true && this.isSetRows(); - boolean that_present_rows = true && that.isSetRows(); - if (this_present_rows || that_present_rows) { - if (!(this_present_rows && that_present_rows)) - return false; - if (!this.rows.equals(that.rows)) - return false; - } - - boolean this_present_columns = true && this.isSetColumns(); - boolean that_present_columns = true && that.isSetColumns(); - if (this_present_columns || that_present_columns) { - if (!(this_present_columns && that_present_columns)) - return false; - if (!this.columns.equals(that.columns)) - return false; - } - - boolean this_present_binaryColumns = true && this.isSetBinaryColumns(); - boolean that_present_binaryColumns = true && that.isSetBinaryColumns(); - if (this_present_binaryColumns || that_present_binaryColumns) { - if (!(this_present_binaryColumns && that_present_binaryColumns)) - return false; - if (!this.binaryColumns.equals(that.binaryColumns)) - return false; - } - - boolean this_present_columnCount = true && this.isSetColumnCount(); - boolean that_present_columnCount = true && that.isSetColumnCount(); - if (this_present_columnCount || that_present_columnCount) { - if (!(this_present_columnCount && that_present_columnCount)) - return false; - if (this.columnCount != that.columnCount) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_startRowOffset = true; - list.add(present_startRowOffset); - if (present_startRowOffset) - list.add(startRowOffset); - - boolean present_rows = true && (isSetRows()); - list.add(present_rows); - if (present_rows) - list.add(rows); - - boolean present_columns = true && (isSetColumns()); - list.add(present_columns); - if (present_columns) - list.add(columns); - - boolean present_binaryColumns = true && (isSetBinaryColumns()); - list.add(present_binaryColumns); - if (present_binaryColumns) - list.add(binaryColumns); - - boolean present_columnCount = true && (isSetColumnCount()); - list.add(present_columnCount); - if (present_columnCount) - list.add(columnCount); - - return list.hashCode(); - } - - @Override - public int compareTo(TRowSet other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStartRowOffset()).compareTo(other.isSetStartRowOffset()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStartRowOffset()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startRowOffset, other.startRowOffset); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRows()).compareTo(other.isSetRows()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRows()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rows, other.rows); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetBinaryColumns()).compareTo(other.isSetBinaryColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetBinaryColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.binaryColumns, other.binaryColumns); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetColumnCount()).compareTo(other.isSetColumnCount()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumnCount()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columnCount, other.columnCount); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TRowSet("); - boolean first = true; - - sb.append("startRowOffset:"); - sb.append(this.startRowOffset); - first = false; - if (!first) sb.append(", "); - sb.append("rows:"); - if (this.rows == null) { - sb.append("null"); - } else { - sb.append(this.rows); - } - first = false; - if (isSetColumns()) { - if (!first) sb.append(", "); - sb.append("columns:"); - if (this.columns == null) { - sb.append("null"); - } else { - sb.append(this.columns); - } - first = false; - } - if (isSetBinaryColumns()) { - if (!first) sb.append(", "); - sb.append("binaryColumns:"); - if (this.binaryColumns == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.binaryColumns, sb); - } - first = false; - } - if (isSetColumnCount()) { - if (!first) sb.append(", "); - sb.append("columnCount:"); - sb.append(this.columnCount); - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStartRowOffset()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'startRowOffset' is unset! Struct:" + toString()); - } - - if (!isSetRows()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'rows' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TRowSetStandardSchemeFactory implements SchemeFactory { - public TRowSetStandardScheme getScheme() { - return new TRowSetStandardScheme(); - } - } - - private static class TRowSetStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TRowSet struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // START_ROW_OFFSET - if (schemeField.type == org.apache.thrift.protocol.TType.I64) { - struct.startRowOffset = iprot.readI64(); - struct.setStartRowOffsetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // ROWS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list118 = iprot.readListBegin(); - struct.rows = new ArrayList(_list118.size); - TRow _elem119; - for (int _i120 = 0; _i120 < _list118.size; ++_i120) - { - _elem119 = new TRow(); - _elem119.read(iprot); - struct.rows.add(_elem119); - } - iprot.readListEnd(); - } - struct.setRowsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // COLUMNS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list121 = iprot.readListBegin(); - struct.columns = new ArrayList(_list121.size); - TColumn _elem122; - for (int _i123 = 0; _i123 < _list121.size; ++_i123) - { - _elem122 = new TColumn(); - _elem122.read(iprot); - struct.columns.add(_elem122); - } - iprot.readListEnd(); - } - struct.setColumnsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // BINARY_COLUMNS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.binaryColumns = iprot.readBinary(); - struct.setBinaryColumnsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // COLUMN_COUNT - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.columnCount = iprot.readI32(); - struct.setColumnCountIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TRowSet struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(START_ROW_OFFSET_FIELD_DESC); - oprot.writeI64(struct.startRowOffset); - oprot.writeFieldEnd(); - if (struct.rows != null) { - oprot.writeFieldBegin(ROWS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.rows.size())); - for (TRow _iter124 : struct.rows) - { - _iter124.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.columns != null) { - if (struct.isSetColumns()) { - oprot.writeFieldBegin(COLUMNS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); - for (TColumn _iter125 : struct.columns) - { - _iter125.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (struct.binaryColumns != null) { - if (struct.isSetBinaryColumns()) { - oprot.writeFieldBegin(BINARY_COLUMNS_FIELD_DESC); - oprot.writeBinary(struct.binaryColumns); - oprot.writeFieldEnd(); - } - } - if (struct.isSetColumnCount()) { - oprot.writeFieldBegin(COLUMN_COUNT_FIELD_DESC); - oprot.writeI32(struct.columnCount); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TRowSetTupleSchemeFactory implements SchemeFactory { - public TRowSetTupleScheme getScheme() { - return new TRowSetTupleScheme(); - } - } - - private static class TRowSetTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI64(struct.startRowOffset); - { - oprot.writeI32(struct.rows.size()); - for (TRow _iter126 : struct.rows) - { - _iter126.write(oprot); - } - } - BitSet optionals = new BitSet(); - if (struct.isSetColumns()) { - optionals.set(0); - } - if (struct.isSetBinaryColumns()) { - optionals.set(1); - } - if (struct.isSetColumnCount()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetColumns()) { - { - oprot.writeI32(struct.columns.size()); - for (TColumn _iter127 : struct.columns) - { - _iter127.write(oprot); - } - } - } - if (struct.isSetBinaryColumns()) { - oprot.writeBinary(struct.binaryColumns); - } - if (struct.isSetColumnCount()) { - oprot.writeI32(struct.columnCount); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TRowSet struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.startRowOffset = iprot.readI64(); - struct.setStartRowOffsetIsSet(true); - { - org.apache.thrift.protocol.TList _list128 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.rows = new ArrayList(_list128.size); - TRow _elem129; - for (int _i130 = 0; _i130 < _list128.size; ++_i130) - { - _elem129 = new TRow(); - _elem129.read(iprot); - struct.rows.add(_elem129); - } - } - struct.setRowsIsSet(true); - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new ArrayList(_list131.size); - TColumn _elem132; - for (int _i133 = 0; _i133 < _list131.size; ++_i133) - { - _elem132 = new TColumn(); - _elem132.read(iprot); - struct.columns.add(_elem132); - } - } - struct.setColumnsIsSet(true); - } - if (incoming.get(1)) { - struct.binaryColumns = iprot.readBinary(); - struct.setBinaryColumnsIsSet(true); - } - if (incoming.get(2)) { - struct.columnCount = iprot.readI32(); - struct.setColumnCountIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TSessionHandle.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TSessionHandle.java deleted file mode 100644 index b5cb6e7b15aa6..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TSessionHandle.java +++ /dev/null @@ -1,394 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TSessionHandle implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TSessionHandle"); - - private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRUCT, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TSessionHandleStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TSessionHandleTupleSchemeFactory()); - } - - private THandleIdentifier sessionId; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SESSION_ID((short)1, "sessionId"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // SESSION_ID - return SESSION_ID; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, THandleIdentifier.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TSessionHandle.class, metaDataMap); - } - - public TSessionHandle() { - } - - public TSessionHandle( - THandleIdentifier sessionId) - { - this(); - this.sessionId = sessionId; - } - - /** - * Performs a deep copy on other. - */ - public TSessionHandle(TSessionHandle other) { - if (other.isSetSessionId()) { - this.sessionId = new THandleIdentifier(other.sessionId); - } - } - - public TSessionHandle deepCopy() { - return new TSessionHandle(this); - } - - @Override - public void clear() { - this.sessionId = null; - } - - public THandleIdentifier getSessionId() { - return this.sessionId; - } - - public void setSessionId(THandleIdentifier sessionId) { - this.sessionId = sessionId; - } - - public void unsetSessionId() { - this.sessionId = null; - } - - /** Returns true if field sessionId is set (has been assigned a value) and false otherwise */ - public boolean isSetSessionId() { - return this.sessionId != null; - } - - public void setSessionIdIsSet(boolean value) { - if (!value) { - this.sessionId = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SESSION_ID: - if (value == null) { - unsetSessionId(); - } else { - setSessionId((THandleIdentifier)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SESSION_ID: - return getSessionId(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SESSION_ID: - return isSetSessionId(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TSessionHandle) - return this.equals((TSessionHandle)that); - return false; - } - - public boolean equals(TSessionHandle that) { - if (that == null) - return false; - - boolean this_present_sessionId = true && this.isSetSessionId(); - boolean that_present_sessionId = true && that.isSetSessionId(); - if (this_present_sessionId || that_present_sessionId) { - if (!(this_present_sessionId && that_present_sessionId)) - return false; - if (!this.sessionId.equals(that.sessionId)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_sessionId = true && (isSetSessionId()); - list.add(present_sessionId); - if (present_sessionId) - list.add(sessionId); - - return list.hashCode(); - } - - @Override - public int compareTo(TSessionHandle other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSessionId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TSessionHandle("); - boolean first = true; - - sb.append("sessionId:"); - if (this.sessionId == null) { - sb.append("null"); - } else { - sb.append(this.sessionId); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetSessionId()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'sessionId' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - if (sessionId != null) { - sessionId.validate(); - } - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TSessionHandleStandardSchemeFactory implements SchemeFactory { - public TSessionHandleStandardScheme getScheme() { - return new TSessionHandleStandardScheme(); - } - } - - private static class TSessionHandleStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TSessionHandle struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // SESSION_ID - if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { - struct.sessionId = new THandleIdentifier(); - struct.sessionId.read(iprot); - struct.setSessionIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TSessionHandle struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.sessionId != null) { - oprot.writeFieldBegin(SESSION_ID_FIELD_DESC); - struct.sessionId.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TSessionHandleTupleSchemeFactory implements SchemeFactory { - public TSessionHandleTupleScheme getScheme() { - return new TSessionHandleTupleScheme(); - } - } - - private static class TSessionHandleTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - struct.sessionId.write(oprot); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TSessionHandle struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.sessionId = new THandleIdentifier(); - struct.sessionId.read(iprot); - struct.setSessionIdIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStatus.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStatus.java deleted file mode 100644 index 50f4531b0a209..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStatus.java +++ /dev/null @@ -1,875 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TStatus implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStatus"); - - private static final org.apache.thrift.protocol.TField STATUS_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("statusCode", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField INFO_MESSAGES_FIELD_DESC = new org.apache.thrift.protocol.TField("infoMessages", org.apache.thrift.protocol.TType.LIST, (short)2); - private static final org.apache.thrift.protocol.TField SQL_STATE_FIELD_DESC = new org.apache.thrift.protocol.TField("sqlState", org.apache.thrift.protocol.TType.STRING, (short)3); - private static final org.apache.thrift.protocol.TField ERROR_CODE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorCode", org.apache.thrift.protocol.TType.I32, (short)4); - private static final org.apache.thrift.protocol.TField ERROR_MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("errorMessage", org.apache.thrift.protocol.TType.STRING, (short)5); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TStatusStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TStatusTupleSchemeFactory()); - } - - private TStatusCode statusCode; // required - private List infoMessages; // optional - private String sqlState; // optional - private int errorCode; // optional - private String errorMessage; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - /** - * - * @see TStatusCode - */ - STATUS_CODE((short)1, "statusCode"), - INFO_MESSAGES((short)2, "infoMessages"), - SQL_STATE((short)3, "sqlState"), - ERROR_CODE((short)4, "errorCode"), - ERROR_MESSAGE((short)5, "errorMessage"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // STATUS_CODE - return STATUS_CODE; - case 2: // INFO_MESSAGES - return INFO_MESSAGES; - case 3: // SQL_STATE - return SQL_STATE; - case 4: // ERROR_CODE - return ERROR_CODE; - case 5: // ERROR_MESSAGE - return ERROR_MESSAGE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final int __ERRORCODE_ISSET_ID = 0; - private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.INFO_MESSAGES,_Fields.SQL_STATE,_Fields.ERROR_CODE,_Fields.ERROR_MESSAGE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.STATUS_CODE, new org.apache.thrift.meta_data.FieldMetaData("statusCode", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TStatusCode.class))); - tmpMap.put(_Fields.INFO_MESSAGES, new org.apache.thrift.meta_data.FieldMetaData("infoMessages", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.SQL_STATE, new org.apache.thrift.meta_data.FieldMetaData("sqlState", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.ERROR_CODE, new org.apache.thrift.meta_data.FieldMetaData("errorCode", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.ERROR_MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("errorMessage", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStatus.class, metaDataMap); - } - - public TStatus() { - } - - public TStatus( - TStatusCode statusCode) - { - this(); - this.statusCode = statusCode; - } - - /** - * Performs a deep copy on other. - */ - public TStatus(TStatus other) { - __isset_bitfield = other.__isset_bitfield; - if (other.isSetStatusCode()) { - this.statusCode = other.statusCode; - } - if (other.isSetInfoMessages()) { - List __this__infoMessages = new ArrayList(other.infoMessages); - this.infoMessages = __this__infoMessages; - } - if (other.isSetSqlState()) { - this.sqlState = other.sqlState; - } - this.errorCode = other.errorCode; - if (other.isSetErrorMessage()) { - this.errorMessage = other.errorMessage; - } - } - - public TStatus deepCopy() { - return new TStatus(this); - } - - @Override - public void clear() { - this.statusCode = null; - this.infoMessages = null; - this.sqlState = null; - setErrorCodeIsSet(false); - this.errorCode = 0; - this.errorMessage = null; - } - - /** - * - * @see TStatusCode - */ - public TStatusCode getStatusCode() { - return this.statusCode; - } - - /** - * - * @see TStatusCode - */ - public void setStatusCode(TStatusCode statusCode) { - this.statusCode = statusCode; - } - - public void unsetStatusCode() { - this.statusCode = null; - } - - /** Returns true if field statusCode is set (has been assigned a value) and false otherwise */ - public boolean isSetStatusCode() { - return this.statusCode != null; - } - - public void setStatusCodeIsSet(boolean value) { - if (!value) { - this.statusCode = null; - } - } - - public int getInfoMessagesSize() { - return (this.infoMessages == null) ? 0 : this.infoMessages.size(); - } - - public java.util.Iterator getInfoMessagesIterator() { - return (this.infoMessages == null) ? null : this.infoMessages.iterator(); - } - - public void addToInfoMessages(String elem) { - if (this.infoMessages == null) { - this.infoMessages = new ArrayList(); - } - this.infoMessages.add(elem); - } - - public List getInfoMessages() { - return this.infoMessages; - } - - public void setInfoMessages(List infoMessages) { - this.infoMessages = infoMessages; - } - - public void unsetInfoMessages() { - this.infoMessages = null; - } - - /** Returns true if field infoMessages is set (has been assigned a value) and false otherwise */ - public boolean isSetInfoMessages() { - return this.infoMessages != null; - } - - public void setInfoMessagesIsSet(boolean value) { - if (!value) { - this.infoMessages = null; - } - } - - public String getSqlState() { - return this.sqlState; - } - - public void setSqlState(String sqlState) { - this.sqlState = sqlState; - } - - public void unsetSqlState() { - this.sqlState = null; - } - - /** Returns true if field sqlState is set (has been assigned a value) and false otherwise */ - public boolean isSetSqlState() { - return this.sqlState != null; - } - - public void setSqlStateIsSet(boolean value) { - if (!value) { - this.sqlState = null; - } - } - - public int getErrorCode() { - return this.errorCode; - } - - public void setErrorCode(int errorCode) { - this.errorCode = errorCode; - setErrorCodeIsSet(true); - } - - public void unsetErrorCode() { - __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ERRORCODE_ISSET_ID); - } - - /** Returns true if field errorCode is set (has been assigned a value) and false otherwise */ - public boolean isSetErrorCode() { - return EncodingUtils.testBit(__isset_bitfield, __ERRORCODE_ISSET_ID); - } - - public void setErrorCodeIsSet(boolean value) { - __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ERRORCODE_ISSET_ID, value); - } - - public String getErrorMessage() { - return this.errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - public void unsetErrorMessage() { - this.errorMessage = null; - } - - /** Returns true if field errorMessage is set (has been assigned a value) and false otherwise */ - public boolean isSetErrorMessage() { - return this.errorMessage != null; - } - - public void setErrorMessageIsSet(boolean value) { - if (!value) { - this.errorMessage = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case STATUS_CODE: - if (value == null) { - unsetStatusCode(); - } else { - setStatusCode((TStatusCode)value); - } - break; - - case INFO_MESSAGES: - if (value == null) { - unsetInfoMessages(); - } else { - setInfoMessages((List)value); - } - break; - - case SQL_STATE: - if (value == null) { - unsetSqlState(); - } else { - setSqlState((String)value); - } - break; - - case ERROR_CODE: - if (value == null) { - unsetErrorCode(); - } else { - setErrorCode((Integer)value); - } - break; - - case ERROR_MESSAGE: - if (value == null) { - unsetErrorMessage(); - } else { - setErrorMessage((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case STATUS_CODE: - return getStatusCode(); - - case INFO_MESSAGES: - return getInfoMessages(); - - case SQL_STATE: - return getSqlState(); - - case ERROR_CODE: - return getErrorCode(); - - case ERROR_MESSAGE: - return getErrorMessage(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case STATUS_CODE: - return isSetStatusCode(); - case INFO_MESSAGES: - return isSetInfoMessages(); - case SQL_STATE: - return isSetSqlState(); - case ERROR_CODE: - return isSetErrorCode(); - case ERROR_MESSAGE: - return isSetErrorMessage(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TStatus) - return this.equals((TStatus)that); - return false; - } - - public boolean equals(TStatus that) { - if (that == null) - return false; - - boolean this_present_statusCode = true && this.isSetStatusCode(); - boolean that_present_statusCode = true && that.isSetStatusCode(); - if (this_present_statusCode || that_present_statusCode) { - if (!(this_present_statusCode && that_present_statusCode)) - return false; - if (!this.statusCode.equals(that.statusCode)) - return false; - } - - boolean this_present_infoMessages = true && this.isSetInfoMessages(); - boolean that_present_infoMessages = true && that.isSetInfoMessages(); - if (this_present_infoMessages || that_present_infoMessages) { - if (!(this_present_infoMessages && that_present_infoMessages)) - return false; - if (!this.infoMessages.equals(that.infoMessages)) - return false; - } - - boolean this_present_sqlState = true && this.isSetSqlState(); - boolean that_present_sqlState = true && that.isSetSqlState(); - if (this_present_sqlState || that_present_sqlState) { - if (!(this_present_sqlState && that_present_sqlState)) - return false; - if (!this.sqlState.equals(that.sqlState)) - return false; - } - - boolean this_present_errorCode = true && this.isSetErrorCode(); - boolean that_present_errorCode = true && that.isSetErrorCode(); - if (this_present_errorCode || that_present_errorCode) { - if (!(this_present_errorCode && that_present_errorCode)) - return false; - if (this.errorCode != that.errorCode) - return false; - } - - boolean this_present_errorMessage = true && this.isSetErrorMessage(); - boolean that_present_errorMessage = true && that.isSetErrorMessage(); - if (this_present_errorMessage || that_present_errorMessage) { - if (!(this_present_errorMessage && that_present_errorMessage)) - return false; - if (!this.errorMessage.equals(that.errorMessage)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_statusCode = true && (isSetStatusCode()); - list.add(present_statusCode); - if (present_statusCode) - list.add(statusCode.getValue()); - - boolean present_infoMessages = true && (isSetInfoMessages()); - list.add(present_infoMessages); - if (present_infoMessages) - list.add(infoMessages); - - boolean present_sqlState = true && (isSetSqlState()); - list.add(present_sqlState); - if (present_sqlState) - list.add(sqlState); - - boolean present_errorCode = true && (isSetErrorCode()); - list.add(present_errorCode); - if (present_errorCode) - list.add(errorCode); - - boolean present_errorMessage = true && (isSetErrorMessage()); - list.add(present_errorMessage); - if (present_errorMessage) - list.add(errorMessage); - - return list.hashCode(); - } - - @Override - public int compareTo(TStatus other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetStatusCode()).compareTo(other.isSetStatusCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetStatusCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.statusCode, other.statusCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetInfoMessages()).compareTo(other.isSetInfoMessages()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetInfoMessages()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.infoMessages, other.infoMessages); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetSqlState()).compareTo(other.isSetSqlState()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSqlState()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sqlState, other.sqlState); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetErrorCode()).compareTo(other.isSetErrorCode()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErrorCode()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorCode, other.errorCode); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetErrorMessage()).compareTo(other.isSetErrorMessage()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetErrorMessage()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.errorMessage, other.errorMessage); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TStatus("); - boolean first = true; - - sb.append("statusCode:"); - if (this.statusCode == null) { - sb.append("null"); - } else { - sb.append(this.statusCode); - } - first = false; - if (isSetInfoMessages()) { - if (!first) sb.append(", "); - sb.append("infoMessages:"); - if (this.infoMessages == null) { - sb.append("null"); - } else { - sb.append(this.infoMessages); - } - first = false; - } - if (isSetSqlState()) { - if (!first) sb.append(", "); - sb.append("sqlState:"); - if (this.sqlState == null) { - sb.append("null"); - } else { - sb.append(this.sqlState); - } - first = false; - } - if (isSetErrorCode()) { - if (!first) sb.append(", "); - sb.append("errorCode:"); - sb.append(this.errorCode); - first = false; - } - if (isSetErrorMessage()) { - if (!first) sb.append(", "); - sb.append("errorMessage:"); - if (this.errorMessage == null) { - sb.append("null"); - } else { - sb.append(this.errorMessage); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetStatusCode()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'statusCode' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bitfield = 0; - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TStatusStandardSchemeFactory implements SchemeFactory { - public TStatusStandardScheme getScheme() { - return new TStatusStandardScheme(); - } - } - - private static class TStatusStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TStatus struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // STATUS_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.statusCode = org.apache.hive.service.rpc.thrift.TStatusCode.findByValue(iprot.readI32()); - struct.setStatusCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // INFO_MESSAGES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list134 = iprot.readListBegin(); - struct.infoMessages = new ArrayList(_list134.size); - String _elem135; - for (int _i136 = 0; _i136 < _list134.size; ++_i136) - { - _elem135 = iprot.readString(); - struct.infoMessages.add(_elem135); - } - iprot.readListEnd(); - } - struct.setInfoMessagesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 3: // SQL_STATE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.sqlState = iprot.readString(); - struct.setSqlStateIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 4: // ERROR_CODE - if (schemeField.type == org.apache.thrift.protocol.TType.I32) { - struct.errorCode = iprot.readI32(); - struct.setErrorCodeIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 5: // ERROR_MESSAGE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.errorMessage = iprot.readString(); - struct.setErrorMessageIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TStatus struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.statusCode != null) { - oprot.writeFieldBegin(STATUS_CODE_FIELD_DESC); - oprot.writeI32(struct.statusCode.getValue()); - oprot.writeFieldEnd(); - } - if (struct.infoMessages != null) { - if (struct.isSetInfoMessages()) { - oprot.writeFieldBegin(INFO_MESSAGES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.infoMessages.size())); - for (String _iter137 : struct.infoMessages) - { - oprot.writeString(_iter137); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - } - if (struct.sqlState != null) { - if (struct.isSetSqlState()) { - oprot.writeFieldBegin(SQL_STATE_FIELD_DESC); - oprot.writeString(struct.sqlState); - oprot.writeFieldEnd(); - } - } - if (struct.isSetErrorCode()) { - oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); - oprot.writeI32(struct.errorCode); - oprot.writeFieldEnd(); - } - if (struct.errorMessage != null) { - if (struct.isSetErrorMessage()) { - oprot.writeFieldBegin(ERROR_MESSAGE_FIELD_DESC); - oprot.writeString(struct.errorMessage); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TStatusTupleSchemeFactory implements SchemeFactory { - public TStatusTupleScheme getScheme() { - return new TStatusTupleScheme(); - } - } - - private static class TStatusTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeI32(struct.statusCode.getValue()); - BitSet optionals = new BitSet(); - if (struct.isSetInfoMessages()) { - optionals.set(0); - } - if (struct.isSetSqlState()) { - optionals.set(1); - } - if (struct.isSetErrorCode()) { - optionals.set(2); - } - if (struct.isSetErrorMessage()) { - optionals.set(3); - } - oprot.writeBitSet(optionals, 4); - if (struct.isSetInfoMessages()) { - { - oprot.writeI32(struct.infoMessages.size()); - for (String _iter138 : struct.infoMessages) - { - oprot.writeString(_iter138); - } - } - } - if (struct.isSetSqlState()) { - oprot.writeString(struct.sqlState); - } - if (struct.isSetErrorCode()) { - oprot.writeI32(struct.errorCode); - } - if (struct.isSetErrorMessage()) { - oprot.writeString(struct.errorMessage); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TStatus struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.statusCode = org.apache.hive.service.rpc.thrift.TStatusCode.findByValue(iprot.readI32()); - struct.setStatusCodeIsSet(true); - BitSet incoming = iprot.readBitSet(4); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TList _list139 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.infoMessages = new ArrayList(_list139.size); - String _elem140; - for (int _i141 = 0; _i141 < _list139.size; ++_i141) - { - _elem140 = iprot.readString(); - struct.infoMessages.add(_elem140); - } - } - struct.setInfoMessagesIsSet(true); - } - if (incoming.get(1)) { - struct.sqlState = iprot.readString(); - struct.setSqlStateIsSet(true); - } - if (incoming.get(2)) { - struct.errorCode = iprot.readI32(); - struct.setErrorCodeIsSet(true); - } - if (incoming.get(3)) { - struct.errorMessage = iprot.readString(); - struct.setErrorMessageIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStatusCode.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStatusCode.java deleted file mode 100644 index fbf14184fa9a8..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStatusCode.java +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TStatusCode implements org.apache.thrift.TEnum { - SUCCESS_STATUS(0), - SUCCESS_WITH_INFO_STATUS(1), - STILL_EXECUTING_STATUS(2), - ERROR_STATUS(3), - INVALID_HANDLE_STATUS(4); - - private final int value; - - private TStatusCode(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TStatusCode findByValue(int value) { - switch (value) { - case 0: - return SUCCESS_STATUS; - case 1: - return SUCCESS_WITH_INFO_STATUS; - case 2: - return STILL_EXECUTING_STATUS; - case 3: - return ERROR_STATUS; - case 4: - return INVALID_HANDLE_STATUS; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStringColumn.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStringColumn.java deleted file mode 100644 index c83a1fd0de3c2..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStringColumn.java +++ /dev/null @@ -1,548 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TStringColumn implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringColumn"); - - private static final org.apache.thrift.protocol.TField VALUES_FIELD_DESC = new org.apache.thrift.protocol.TField("values", org.apache.thrift.protocol.TType.LIST, (short)1); - private static final org.apache.thrift.protocol.TField NULLS_FIELD_DESC = new org.apache.thrift.protocol.TField("nulls", org.apache.thrift.protocol.TType.STRING, (short)2); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TStringColumnStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TStringColumnTupleSchemeFactory()); - } - - private List values; // required - private ByteBuffer nulls; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUES((short)1, "values"), - NULLS((short)2, "nulls"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUES - return VALUES; - case 2: // NULLS - return NULLS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUES, new org.apache.thrift.meta_data.FieldMetaData("values", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - tmpMap.put(_Fields.NULLS, new org.apache.thrift.meta_data.FieldMetaData("nulls", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringColumn.class, metaDataMap); - } - - public TStringColumn() { - } - - public TStringColumn( - List values, - ByteBuffer nulls) - { - this(); - this.values = values; - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - /** - * Performs a deep copy on other. - */ - public TStringColumn(TStringColumn other) { - if (other.isSetValues()) { - List __this__values = new ArrayList(other.values); - this.values = __this__values; - } - if (other.isSetNulls()) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(other.nulls); - } - } - - public TStringColumn deepCopy() { - return new TStringColumn(this); - } - - @Override - public void clear() { - this.values = null; - this.nulls = null; - } - - public int getValuesSize() { - return (this.values == null) ? 0 : this.values.size(); - } - - public java.util.Iterator getValuesIterator() { - return (this.values == null) ? null : this.values.iterator(); - } - - public void addToValues(String elem) { - if (this.values == null) { - this.values = new ArrayList(); - } - this.values.add(elem); - } - - public List getValues() { - return this.values; - } - - public void setValues(List values) { - this.values = values; - } - - public void unsetValues() { - this.values = null; - } - - /** Returns true if field values is set (has been assigned a value) and false otherwise */ - public boolean isSetValues() { - return this.values != null; - } - - public void setValuesIsSet(boolean value) { - if (!value) { - this.values = null; - } - } - - public byte[] getNulls() { - setNulls(org.apache.thrift.TBaseHelper.rightSize(nulls)); - return nulls == null ? null : nulls.array(); - } - - public ByteBuffer bufferForNulls() { - return org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void setNulls(byte[] nulls) { - this.nulls = nulls == null ? (ByteBuffer)null : ByteBuffer.wrap(Arrays.copyOf(nulls, nulls.length)); - } - - public void setNulls(ByteBuffer nulls) { - this.nulls = org.apache.thrift.TBaseHelper.copyBinary(nulls); - } - - public void unsetNulls() { - this.nulls = null; - } - - /** Returns true if field nulls is set (has been assigned a value) and false otherwise */ - public boolean isSetNulls() { - return this.nulls != null; - } - - public void setNullsIsSet(boolean value) { - if (!value) { - this.nulls = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUES: - if (value == null) { - unsetValues(); - } else { - setValues((List)value); - } - break; - - case NULLS: - if (value == null) { - unsetNulls(); - } else { - setNulls((ByteBuffer)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUES: - return getValues(); - - case NULLS: - return getNulls(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUES: - return isSetValues(); - case NULLS: - return isSetNulls(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TStringColumn) - return this.equals((TStringColumn)that); - return false; - } - - public boolean equals(TStringColumn that) { - if (that == null) - return false; - - boolean this_present_values = true && this.isSetValues(); - boolean that_present_values = true && that.isSetValues(); - if (this_present_values || that_present_values) { - if (!(this_present_values && that_present_values)) - return false; - if (!this.values.equals(that.values)) - return false; - } - - boolean this_present_nulls = true && this.isSetNulls(); - boolean that_present_nulls = true && that.isSetNulls(); - if (this_present_nulls || that_present_nulls) { - if (!(this_present_nulls && that_present_nulls)) - return false; - if (!this.nulls.equals(that.nulls)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_values = true && (isSetValues()); - list.add(present_values); - if (present_values) - list.add(values); - - boolean present_nulls = true && (isSetNulls()); - list.add(present_nulls); - if (present_nulls) - list.add(nulls); - - return list.hashCode(); - } - - @Override - public int compareTo(TStringColumn other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValues()).compareTo(other.isSetValues()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValues()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.values, other.values); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetNulls()).compareTo(other.isSetNulls()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNulls()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nulls, other.nulls); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TStringColumn("); - boolean first = true; - - sb.append("values:"); - if (this.values == null) { - sb.append("null"); - } else { - sb.append(this.values); - } - first = false; - if (!first) sb.append(", "); - sb.append("nulls:"); - if (this.nulls == null) { - sb.append("null"); - } else { - org.apache.thrift.TBaseHelper.toString(this.nulls, sb); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetValues()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'values' is unset! Struct:" + toString()); - } - - if (!isSetNulls()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nulls' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TStringColumnStandardSchemeFactory implements SchemeFactory { - public TStringColumnStandardScheme getScheme() { - return new TStringColumnStandardScheme(); - } - } - - private static class TStringColumnStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TStringColumn struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); - struct.values = new ArrayList(_list102.size); - String _elem103; - for (int _i104 = 0; _i104 < _list102.size; ++_i104) - { - _elem103 = iprot.readString(); - struct.values.add(_elem103); - } - iprot.readListEnd(); - } - struct.setValuesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - case 2: // NULLS - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TStringColumn struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.values != null) { - oprot.writeFieldBegin(VALUES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.values.size())); - for (String _iter105 : struct.values) - { - oprot.writeString(_iter105); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - if (struct.nulls != null) { - oprot.writeFieldBegin(NULLS_FIELD_DESC); - oprot.writeBinary(struct.nulls); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TStringColumnTupleSchemeFactory implements SchemeFactory { - public TStringColumnTupleScheme getScheme() { - return new TStringColumnTupleScheme(); - } - } - - private static class TStringColumnTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.values.size()); - for (String _iter106 : struct.values) - { - oprot.writeString(_iter106); - } - } - oprot.writeBinary(struct.nulls); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TStringColumn struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list107 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.values = new ArrayList(_list107.size); - String _elem108; - for (int _i109 = 0; _i109 < _list107.size; ++_i109) - { - _elem108 = iprot.readString(); - struct.values.add(_elem108); - } - } - struct.setValuesIsSet(true); - struct.nulls = iprot.readBinary(); - struct.setNullsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStringValue.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStringValue.java deleted file mode 100644 index 13874e5516632..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStringValue.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TStringValue implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStringValue"); - - private static final org.apache.thrift.protocol.TField VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("value", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TStringValueStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TStringValueTupleSchemeFactory()); - } - - private String value; // optional - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - VALUE((short)1, "value"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // VALUE - return VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - private static final _Fields optionals[] = {_Fields.VALUE}; - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.VALUE, new org.apache.thrift.meta_data.FieldMetaData("value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStringValue.class, metaDataMap); - } - - public TStringValue() { - } - - /** - * Performs a deep copy on other. - */ - public TStringValue(TStringValue other) { - if (other.isSetValue()) { - this.value = other.value; - } - } - - public TStringValue deepCopy() { - return new TStringValue(this); - } - - @Override - public void clear() { - this.value = null; - } - - public String getValue() { - return this.value; - } - - public void setValue(String value) { - this.value = value; - } - - public void unsetValue() { - this.value = null; - } - - /** Returns true if field value is set (has been assigned a value) and false otherwise */ - public boolean isSetValue() { - return this.value != null; - } - - public void setValueIsSet(boolean value) { - if (!value) { - this.value = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case VALUE: - if (value == null) { - unsetValue(); - } else { - setValue((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case VALUE: - return getValue(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case VALUE: - return isSetValue(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TStringValue) - return this.equals((TStringValue)that); - return false; - } - - public boolean equals(TStringValue that) { - if (that == null) - return false; - - boolean this_present_value = true && this.isSetValue(); - boolean that_present_value = true && that.isSetValue(); - if (this_present_value || that_present_value) { - if (!(this_present_value && that_present_value)) - return false; - if (!this.value.equals(that.value)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_value = true && (isSetValue()); - list.add(present_value); - if (present_value) - list.add(value); - - return list.hashCode(); - } - - @Override - public int compareTo(TStringValue other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetValue()).compareTo(other.isSetValue()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetValue()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.value, other.value); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TStringValue("); - boolean first = true; - - if (isSetValue()) { - sb.append("value:"); - if (this.value == null) { - sb.append("null"); - } else { - sb.append(this.value); - } - first = false; - } - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TStringValueStandardSchemeFactory implements SchemeFactory { - public TStringValueStandardScheme getScheme() { - return new TStringValueStandardScheme(); - } - } - - private static class TStringValueStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TStringValue struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // VALUE - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.value = iprot.readString(); - struct.setValueIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TStringValue struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.value != null) { - if (struct.isSetValue()) { - oprot.writeFieldBegin(VALUE_FIELD_DESC); - oprot.writeString(struct.value); - oprot.writeFieldEnd(); - } - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TStringValueTupleSchemeFactory implements SchemeFactory { - public TStringValueTupleScheme getScheme() { - return new TStringValueTupleScheme(); - } - } - - private static class TStringValueTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetValue()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetValue()) { - oprot.writeString(struct.value); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TStringValue struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.value = iprot.readString(); - struct.setValueIsSet(true); - } - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStructTypeEntry.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStructTypeEntry.java deleted file mode 100644 index 6c2c4f5dd2ddf..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TStructTypeEntry.java +++ /dev/null @@ -1,452 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TStructTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStructTypeEntry"); - - private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TStructTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TStructTypeEntryTupleSchemeFactory()); - } - - private Map nameToTypePtr; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // NAME_TO_TYPE_PTR - return NAME_TO_TYPE_PTR; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStructTypeEntry.class, metaDataMap); - } - - public TStructTypeEntry() { - } - - public TStructTypeEntry( - Map nameToTypePtr) - { - this(); - this.nameToTypePtr = nameToTypePtr; - } - - /** - * Performs a deep copy on other. - */ - public TStructTypeEntry(TStructTypeEntry other) { - if (other.isSetNameToTypePtr()) { - Map __this__nameToTypePtr = new HashMap(other.nameToTypePtr.size()); - for (Map.Entry other_element : other.nameToTypePtr.entrySet()) { - - String other_element_key = other_element.getKey(); - Integer other_element_value = other_element.getValue(); - - String __this__nameToTypePtr_copy_key = other_element_key; - - Integer __this__nameToTypePtr_copy_value = other_element_value; - - __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); - } - this.nameToTypePtr = __this__nameToTypePtr; - } - } - - public TStructTypeEntry deepCopy() { - return new TStructTypeEntry(this); - } - - @Override - public void clear() { - this.nameToTypePtr = null; - } - - public int getNameToTypePtrSize() { - return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); - } - - public void putToNameToTypePtr(String key, int val) { - if (this.nameToTypePtr == null) { - this.nameToTypePtr = new HashMap(); - } - this.nameToTypePtr.put(key, val); - } - - public Map getNameToTypePtr() { - return this.nameToTypePtr; - } - - public void setNameToTypePtr(Map nameToTypePtr) { - this.nameToTypePtr = nameToTypePtr; - } - - public void unsetNameToTypePtr() { - this.nameToTypePtr = null; - } - - /** Returns true if field nameToTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetNameToTypePtr() { - return this.nameToTypePtr != null; - } - - public void setNameToTypePtrIsSet(boolean value) { - if (!value) { - this.nameToTypePtr = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME_TO_TYPE_PTR: - if (value == null) { - unsetNameToTypePtr(); - } else { - setNameToTypePtr((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME_TO_TYPE_PTR: - return getNameToTypePtr(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case NAME_TO_TYPE_PTR: - return isSetNameToTypePtr(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TStructTypeEntry) - return this.equals((TStructTypeEntry)that); - return false; - } - - public boolean equals(TStructTypeEntry that) { - if (that == null) - return false; - - boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); - boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); - if (this_present_nameToTypePtr || that_present_nameToTypePtr) { - if (!(this_present_nameToTypePtr && that_present_nameToTypePtr)) - return false; - if (!this.nameToTypePtr.equals(that.nameToTypePtr)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_nameToTypePtr = true && (isSetNameToTypePtr()); - list.add(present_nameToTypePtr); - if (present_nameToTypePtr) - list.add(nameToTypePtr); - - return list.hashCode(); - } - - @Override - public int compareTo(TStructTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNameToTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nameToTypePtr, other.nameToTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TStructTypeEntry("); - boolean first = true; - - sb.append("nameToTypePtr:"); - if (this.nameToTypePtr == null) { - sb.append("null"); - } else { - sb.append(this.nameToTypePtr); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetNameToTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nameToTypePtr' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TStructTypeEntryStandardSchemeFactory implements SchemeFactory { - public TStructTypeEntryStandardScheme getScheme() { - return new TStructTypeEntryStandardScheme(); - } - } - - private static class TStructTypeEntryStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TStructTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // NAME_TO_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map10 = iprot.readMapBegin(); - struct.nameToTypePtr = new HashMap(2*_map10.size); - String _key11; - int _val12; - for (int _i13 = 0; _i13 < _map10.size; ++_i13) - { - _key11 = iprot.readString(); - _val12 = iprot.readI32(); - struct.nameToTypePtr.put(_key11, _val12); - } - iprot.readMapEnd(); - } - struct.setNameToTypePtrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TStructTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.nameToTypePtr != null) { - oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); - for (Map.Entry _iter14 : struct.nameToTypePtr.entrySet()) - { - oprot.writeString(_iter14.getKey()); - oprot.writeI32(_iter14.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TStructTypeEntryTupleSchemeFactory implements SchemeFactory { - public TStructTypeEntryTupleScheme getScheme() { - return new TStructTypeEntryTupleScheme(); - } - } - - private static class TStructTypeEntryTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.nameToTypePtr.size()); - for (Map.Entry _iter15 : struct.nameToTypePtr.entrySet()) - { - oprot.writeString(_iter15.getKey()); - oprot.writeI32(_iter15.getValue()); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TStructTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TMap _map16 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.nameToTypePtr = new HashMap(2*_map16.size); - String _key17; - int _val18; - for (int _i19 = 0; _i19 < _map16.size; ++_i19) - { - _key17 = iprot.readString(); - _val18 = iprot.readI32(); - struct.nameToTypePtr.put(_key17, _val18); - } - } - struct.setNameToTypePtrIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTableSchema.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTableSchema.java deleted file mode 100644 index 007b1603546ac..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTableSchema.java +++ /dev/null @@ -1,443 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TTableSchema implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTableSchema"); - - private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TTableSchemaStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TTableSchemaTupleSchemeFactory()); - } - - private List columns; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - COLUMNS((short)1, "columns"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // COLUMNS - return COLUMNS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.COLUMNS, new org.apache.thrift.meta_data.FieldMetaData("columns", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TColumnDesc.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTableSchema.class, metaDataMap); - } - - public TTableSchema() { - } - - public TTableSchema( - List columns) - { - this(); - this.columns = columns; - } - - /** - * Performs a deep copy on other. - */ - public TTableSchema(TTableSchema other) { - if (other.isSetColumns()) { - List __this__columns = new ArrayList(other.columns.size()); - for (TColumnDesc other_element : other.columns) { - __this__columns.add(new TColumnDesc(other_element)); - } - this.columns = __this__columns; - } - } - - public TTableSchema deepCopy() { - return new TTableSchema(this); - } - - @Override - public void clear() { - this.columns = null; - } - - public int getColumnsSize() { - return (this.columns == null) ? 0 : this.columns.size(); - } - - public java.util.Iterator getColumnsIterator() { - return (this.columns == null) ? null : this.columns.iterator(); - } - - public void addToColumns(TColumnDesc elem) { - if (this.columns == null) { - this.columns = new ArrayList(); - } - this.columns.add(elem); - } - - public List getColumns() { - return this.columns; - } - - public void setColumns(List columns) { - this.columns = columns; - } - - public void unsetColumns() { - this.columns = null; - } - - /** Returns true if field columns is set (has been assigned a value) and false otherwise */ - public boolean isSetColumns() { - return this.columns != null; - } - - public void setColumnsIsSet(boolean value) { - if (!value) { - this.columns = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case COLUMNS: - if (value == null) { - unsetColumns(); - } else { - setColumns((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case COLUMNS: - return getColumns(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case COLUMNS: - return isSetColumns(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TTableSchema) - return this.equals((TTableSchema)that); - return false; - } - - public boolean equals(TTableSchema that) { - if (that == null) - return false; - - boolean this_present_columns = true && this.isSetColumns(); - boolean that_present_columns = true && that.isSetColumns(); - if (this_present_columns || that_present_columns) { - if (!(this_present_columns && that_present_columns)) - return false; - if (!this.columns.equals(that.columns)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_columns = true && (isSetColumns()); - list.add(present_columns); - if (present_columns) - list.add(columns); - - return list.hashCode(); - } - - @Override - public int compareTo(TTableSchema other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetColumns()).compareTo(other.isSetColumns()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetColumns()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.columns, other.columns); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TTableSchema("); - boolean first = true; - - sb.append("columns:"); - if (this.columns == null) { - sb.append("null"); - } else { - sb.append(this.columns); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetColumns()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'columns' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TTableSchemaStandardSchemeFactory implements SchemeFactory { - public TTableSchemaStandardScheme getScheme() { - return new TTableSchemaStandardScheme(); - } - } - - private static class TTableSchemaStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TTableSchema struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // COLUMNS - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list38 = iprot.readListBegin(); - struct.columns = new ArrayList(_list38.size); - TColumnDesc _elem39; - for (int _i40 = 0; _i40 < _list38.size; ++_i40) - { - _elem39 = new TColumnDesc(); - _elem39.read(iprot); - struct.columns.add(_elem39); - } - iprot.readListEnd(); - } - struct.setColumnsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TTableSchema struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.columns != null) { - oprot.writeFieldBegin(COLUMNS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.columns.size())); - for (TColumnDesc _iter41 : struct.columns) - { - _iter41.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TTableSchemaTupleSchemeFactory implements SchemeFactory { - public TTableSchemaTupleScheme getScheme() { - return new TTableSchemaTupleScheme(); - } - } - - private static class TTableSchemaTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.columns.size()); - for (TColumnDesc _iter42 : struct.columns) - { - _iter42.write(oprot); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TTableSchema struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list43 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.columns = new ArrayList(_list43.size); - TColumnDesc _elem44; - for (int _i45 = 0; _i45 < _list43.size; ++_i45) - { - _elem44 = new TColumnDesc(); - _elem44.read(iprot); - struct.columns.add(_elem44); - } - } - struct.setColumnsIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeDesc.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeDesc.java deleted file mode 100644 index 055a14d06a2d6..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeDesc.java +++ /dev/null @@ -1,443 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TTypeDesc implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeDesc"); - - private static final org.apache.thrift.protocol.TField TYPES_FIELD_DESC = new org.apache.thrift.protocol.TField("types", org.apache.thrift.protocol.TType.LIST, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TTypeDescStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TTypeDescTupleSchemeFactory()); - } - - private List types; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - TYPES((short)1, "types"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // TYPES - return TYPES; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TYPES, new org.apache.thrift.meta_data.FieldMetaData("types", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeEntry.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeDesc.class, metaDataMap); - } - - public TTypeDesc() { - } - - public TTypeDesc( - List types) - { - this(); - this.types = types; - } - - /** - * Performs a deep copy on other. - */ - public TTypeDesc(TTypeDesc other) { - if (other.isSetTypes()) { - List __this__types = new ArrayList(other.types.size()); - for (TTypeEntry other_element : other.types) { - __this__types.add(new TTypeEntry(other_element)); - } - this.types = __this__types; - } - } - - public TTypeDesc deepCopy() { - return new TTypeDesc(this); - } - - @Override - public void clear() { - this.types = null; - } - - public int getTypesSize() { - return (this.types == null) ? 0 : this.types.size(); - } - - public java.util.Iterator getTypesIterator() { - return (this.types == null) ? null : this.types.iterator(); - } - - public void addToTypes(TTypeEntry elem) { - if (this.types == null) { - this.types = new ArrayList(); - } - this.types.add(elem); - } - - public List getTypes() { - return this.types; - } - - public void setTypes(List types) { - this.types = types; - } - - public void unsetTypes() { - this.types = null; - } - - /** Returns true if field types is set (has been assigned a value) and false otherwise */ - public boolean isSetTypes() { - return this.types != null; - } - - public void setTypesIsSet(boolean value) { - if (!value) { - this.types = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TYPES: - if (value == null) { - unsetTypes(); - } else { - setTypes((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TYPES: - return getTypes(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case TYPES: - return isSetTypes(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TTypeDesc) - return this.equals((TTypeDesc)that); - return false; - } - - public boolean equals(TTypeDesc that) { - if (that == null) - return false; - - boolean this_present_types = true && this.isSetTypes(); - boolean that_present_types = true && that.isSetTypes(); - if (this_present_types || that_present_types) { - if (!(this_present_types && that_present_types)) - return false; - if (!this.types.equals(that.types)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_types = true && (isSetTypes()); - list.add(present_types); - if (present_types) - list.add(types); - - return list.hashCode(); - } - - @Override - public int compareTo(TTypeDesc other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetTypes()).compareTo(other.isSetTypes()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTypes()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.types, other.types); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TTypeDesc("); - boolean first = true; - - sb.append("types:"); - if (this.types == null) { - sb.append("null"); - } else { - sb.append(this.types); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetTypes()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'types' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TTypeDescStandardSchemeFactory implements SchemeFactory { - public TTypeDescStandardScheme getScheme() { - return new TTypeDescStandardScheme(); - } - } - - private static class TTypeDescStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeDesc struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // TYPES - if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list30 = iprot.readListBegin(); - struct.types = new ArrayList(_list30.size); - TTypeEntry _elem31; - for (int _i32 = 0; _i32 < _list30.size; ++_i32) - { - _elem31 = new TTypeEntry(); - _elem31.read(iprot); - struct.types.add(_elem31); - } - iprot.readListEnd(); - } - struct.setTypesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TTypeDesc struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.types != null) { - oprot.writeFieldBegin(TYPES_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.types.size())); - for (TTypeEntry _iter33 : struct.types) - { - _iter33.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TTypeDescTupleSchemeFactory implements SchemeFactory { - public TTypeDescTupleScheme getScheme() { - return new TTypeDescTupleScheme(); - } - } - - private static class TTypeDescTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.types.size()); - for (TTypeEntry _iter34 : struct.types) - { - _iter34.write(oprot); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TTypeDesc struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TList _list35 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.types = new ArrayList(_list35.size); - TTypeEntry _elem36; - for (int _i37 = 0; _i37 < _list35.size; ++_i37) - { - _elem36 = new TTypeEntry(); - _elem36.read(iprot); - struct.types.add(_elem36); - } - } - struct.setTypesIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeEntry.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeEntry.java deleted file mode 100644 index b609151b8fbee..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeEntry.java +++ /dev/null @@ -1,614 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -public class TTypeEntry extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeEntry"); - private static final org.apache.thrift.protocol.TField PRIMITIVE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("primitiveEntry", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField ARRAY_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("arrayEntry", org.apache.thrift.protocol.TType.STRUCT, (short)2); - private static final org.apache.thrift.protocol.TField MAP_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("mapEntry", org.apache.thrift.protocol.TType.STRUCT, (short)3); - private static final org.apache.thrift.protocol.TField STRUCT_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("structEntry", org.apache.thrift.protocol.TType.STRUCT, (short)4); - private static final org.apache.thrift.protocol.TField UNION_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("unionEntry", org.apache.thrift.protocol.TType.STRUCT, (short)5); - private static final org.apache.thrift.protocol.TField USER_DEFINED_TYPE_ENTRY_FIELD_DESC = new org.apache.thrift.protocol.TField("userDefinedTypeEntry", org.apache.thrift.protocol.TType.STRUCT, (short)6); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - PRIMITIVE_ENTRY((short)1, "primitiveEntry"), - ARRAY_ENTRY((short)2, "arrayEntry"), - MAP_ENTRY((short)3, "mapEntry"), - STRUCT_ENTRY((short)4, "structEntry"), - UNION_ENTRY((short)5, "unionEntry"), - USER_DEFINED_TYPE_ENTRY((short)6, "userDefinedTypeEntry"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // PRIMITIVE_ENTRY - return PRIMITIVE_ENTRY; - case 2: // ARRAY_ENTRY - return ARRAY_ENTRY; - case 3: // MAP_ENTRY - return MAP_ENTRY; - case 4: // STRUCT_ENTRY - return STRUCT_ENTRY; - case 5: // UNION_ENTRY - return UNION_ENTRY; - case 6: // USER_DEFINED_TYPE_ENTRY - return USER_DEFINED_TYPE_ENTRY; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.PRIMITIVE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("primitiveEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPrimitiveTypeEntry.class))); - tmpMap.put(_Fields.ARRAY_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("arrayEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TArrayTypeEntry.class))); - tmpMap.put(_Fields.MAP_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("mapEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TMapTypeEntry.class))); - tmpMap.put(_Fields.STRUCT_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("structEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStructTypeEntry.class))); - tmpMap.put(_Fields.UNION_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("unionEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUnionTypeEntry.class))); - tmpMap.put(_Fields.USER_DEFINED_TYPE_ENTRY, new org.apache.thrift.meta_data.FieldMetaData("userDefinedTypeEntry", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TUserDefinedTypeEntry.class))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeEntry.class, metaDataMap); - } - - public TTypeEntry() { - super(); - } - - public TTypeEntry(TTypeEntry._Fields setField, Object value) { - super(setField, value); - } - - public TTypeEntry(TTypeEntry other) { - super(other); - } - public TTypeEntry deepCopy() { - return new TTypeEntry(this); - } - - public static TTypeEntry primitiveEntry(TPrimitiveTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setPrimitiveEntry(value); - return x; - } - - public static TTypeEntry arrayEntry(TArrayTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setArrayEntry(value); - return x; - } - - public static TTypeEntry mapEntry(TMapTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setMapEntry(value); - return x; - } - - public static TTypeEntry structEntry(TStructTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setStructEntry(value); - return x; - } - - public static TTypeEntry unionEntry(TUnionTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setUnionEntry(value); - return x; - } - - public static TTypeEntry userDefinedTypeEntry(TUserDefinedTypeEntry value) { - TTypeEntry x = new TTypeEntry(); - x.setUserDefinedTypeEntry(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case PRIMITIVE_ENTRY: - if (value instanceof TPrimitiveTypeEntry) { - break; - } - throw new ClassCastException("Was expecting value of type TPrimitiveTypeEntry for field 'primitiveEntry', but got " + value.getClass().getSimpleName()); - case ARRAY_ENTRY: - if (value instanceof TArrayTypeEntry) { - break; - } - throw new ClassCastException("Was expecting value of type TArrayTypeEntry for field 'arrayEntry', but got " + value.getClass().getSimpleName()); - case MAP_ENTRY: - if (value instanceof TMapTypeEntry) { - break; - } - throw new ClassCastException("Was expecting value of type TMapTypeEntry for field 'mapEntry', but got " + value.getClass().getSimpleName()); - case STRUCT_ENTRY: - if (value instanceof TStructTypeEntry) { - break; - } - throw new ClassCastException("Was expecting value of type TStructTypeEntry for field 'structEntry', but got " + value.getClass().getSimpleName()); - case UNION_ENTRY: - if (value instanceof TUnionTypeEntry) { - break; - } - throw new ClassCastException("Was expecting value of type TUnionTypeEntry for field 'unionEntry', but got " + value.getClass().getSimpleName()); - case USER_DEFINED_TYPE_ENTRY: - if (value instanceof TUserDefinedTypeEntry) { - break; - } - throw new ClassCastException("Was expecting value of type TUserDefinedTypeEntry for field 'userDefinedTypeEntry', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case PRIMITIVE_ENTRY: - if (field.type == PRIMITIVE_ENTRY_FIELD_DESC.type) { - TPrimitiveTypeEntry primitiveEntry; - primitiveEntry = new TPrimitiveTypeEntry(); - primitiveEntry.read(iprot); - return primitiveEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case ARRAY_ENTRY: - if (field.type == ARRAY_ENTRY_FIELD_DESC.type) { - TArrayTypeEntry arrayEntry; - arrayEntry = new TArrayTypeEntry(); - arrayEntry.read(iprot); - return arrayEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case MAP_ENTRY: - if (field.type == MAP_ENTRY_FIELD_DESC.type) { - TMapTypeEntry mapEntry; - mapEntry = new TMapTypeEntry(); - mapEntry.read(iprot); - return mapEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRUCT_ENTRY: - if (field.type == STRUCT_ENTRY_FIELD_DESC.type) { - TStructTypeEntry structEntry; - structEntry = new TStructTypeEntry(); - structEntry.read(iprot); - return structEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case UNION_ENTRY: - if (field.type == UNION_ENTRY_FIELD_DESC.type) { - TUnionTypeEntry unionEntry; - unionEntry = new TUnionTypeEntry(); - unionEntry.read(iprot); - return unionEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case USER_DEFINED_TYPE_ENTRY: - if (field.type == USER_DEFINED_TYPE_ENTRY_FIELD_DESC.type) { - TUserDefinedTypeEntry userDefinedTypeEntry; - userDefinedTypeEntry = new TUserDefinedTypeEntry(); - userDefinedTypeEntry.read(iprot); - return userDefinedTypeEntry; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case PRIMITIVE_ENTRY: - TPrimitiveTypeEntry primitiveEntry = (TPrimitiveTypeEntry)value_; - primitiveEntry.write(oprot); - return; - case ARRAY_ENTRY: - TArrayTypeEntry arrayEntry = (TArrayTypeEntry)value_; - arrayEntry.write(oprot); - return; - case MAP_ENTRY: - TMapTypeEntry mapEntry = (TMapTypeEntry)value_; - mapEntry.write(oprot); - return; - case STRUCT_ENTRY: - TStructTypeEntry structEntry = (TStructTypeEntry)value_; - structEntry.write(oprot); - return; - case UNION_ENTRY: - TUnionTypeEntry unionEntry = (TUnionTypeEntry)value_; - unionEntry.write(oprot); - return; - case USER_DEFINED_TYPE_ENTRY: - TUserDefinedTypeEntry userDefinedTypeEntry = (TUserDefinedTypeEntry)value_; - userDefinedTypeEntry.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case PRIMITIVE_ENTRY: - TPrimitiveTypeEntry primitiveEntry; - primitiveEntry = new TPrimitiveTypeEntry(); - primitiveEntry.read(iprot); - return primitiveEntry; - case ARRAY_ENTRY: - TArrayTypeEntry arrayEntry; - arrayEntry = new TArrayTypeEntry(); - arrayEntry.read(iprot); - return arrayEntry; - case MAP_ENTRY: - TMapTypeEntry mapEntry; - mapEntry = new TMapTypeEntry(); - mapEntry.read(iprot); - return mapEntry; - case STRUCT_ENTRY: - TStructTypeEntry structEntry; - structEntry = new TStructTypeEntry(); - structEntry.read(iprot); - return structEntry; - case UNION_ENTRY: - TUnionTypeEntry unionEntry; - unionEntry = new TUnionTypeEntry(); - unionEntry.read(iprot); - return unionEntry; - case USER_DEFINED_TYPE_ENTRY: - TUserDefinedTypeEntry userDefinedTypeEntry; - userDefinedTypeEntry = new TUserDefinedTypeEntry(); - userDefinedTypeEntry.read(iprot); - return userDefinedTypeEntry; - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case PRIMITIVE_ENTRY: - TPrimitiveTypeEntry primitiveEntry = (TPrimitiveTypeEntry)value_; - primitiveEntry.write(oprot); - return; - case ARRAY_ENTRY: - TArrayTypeEntry arrayEntry = (TArrayTypeEntry)value_; - arrayEntry.write(oprot); - return; - case MAP_ENTRY: - TMapTypeEntry mapEntry = (TMapTypeEntry)value_; - mapEntry.write(oprot); - return; - case STRUCT_ENTRY: - TStructTypeEntry structEntry = (TStructTypeEntry)value_; - structEntry.write(oprot); - return; - case UNION_ENTRY: - TUnionTypeEntry unionEntry = (TUnionTypeEntry)value_; - unionEntry.write(oprot); - return; - case USER_DEFINED_TYPE_ENTRY: - TUserDefinedTypeEntry userDefinedTypeEntry = (TUserDefinedTypeEntry)value_; - userDefinedTypeEntry.write(oprot); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case PRIMITIVE_ENTRY: - return PRIMITIVE_ENTRY_FIELD_DESC; - case ARRAY_ENTRY: - return ARRAY_ENTRY_FIELD_DESC; - case MAP_ENTRY: - return MAP_ENTRY_FIELD_DESC; - case STRUCT_ENTRY: - return STRUCT_ENTRY_FIELD_DESC; - case UNION_ENTRY: - return UNION_ENTRY_FIELD_DESC; - case USER_DEFINED_TYPE_ENTRY: - return USER_DEFINED_TYPE_ENTRY_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public TPrimitiveTypeEntry getPrimitiveEntry() { - if (getSetField() == _Fields.PRIMITIVE_ENTRY) { - return (TPrimitiveTypeEntry)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'primitiveEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setPrimitiveEntry(TPrimitiveTypeEntry value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.PRIMITIVE_ENTRY; - value_ = value; - } - - public TArrayTypeEntry getArrayEntry() { - if (getSetField() == _Fields.ARRAY_ENTRY) { - return (TArrayTypeEntry)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'arrayEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setArrayEntry(TArrayTypeEntry value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.ARRAY_ENTRY; - value_ = value; - } - - public TMapTypeEntry getMapEntry() { - if (getSetField() == _Fields.MAP_ENTRY) { - return (TMapTypeEntry)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'mapEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setMapEntry(TMapTypeEntry value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.MAP_ENTRY; - value_ = value; - } - - public TStructTypeEntry getStructEntry() { - if (getSetField() == _Fields.STRUCT_ENTRY) { - return (TStructTypeEntry)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'structEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStructEntry(TStructTypeEntry value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.STRUCT_ENTRY; - value_ = value; - } - - public TUnionTypeEntry getUnionEntry() { - if (getSetField() == _Fields.UNION_ENTRY) { - return (TUnionTypeEntry)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'unionEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setUnionEntry(TUnionTypeEntry value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.UNION_ENTRY; - value_ = value; - } - - public TUserDefinedTypeEntry getUserDefinedTypeEntry() { - if (getSetField() == _Fields.USER_DEFINED_TYPE_ENTRY) { - return (TUserDefinedTypeEntry)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'userDefinedTypeEntry' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setUserDefinedTypeEntry(TUserDefinedTypeEntry value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.USER_DEFINED_TYPE_ENTRY; - value_ = value; - } - - public boolean isSetPrimitiveEntry() { - return setField_ == _Fields.PRIMITIVE_ENTRY; - } - - - public boolean isSetArrayEntry() { - return setField_ == _Fields.ARRAY_ENTRY; - } - - - public boolean isSetMapEntry() { - return setField_ == _Fields.MAP_ENTRY; - } - - - public boolean isSetStructEntry() { - return setField_ == _Fields.STRUCT_ENTRY; - } - - - public boolean isSetUnionEntry() { - return setField_ == _Fields.UNION_ENTRY; - } - - - public boolean isSetUserDefinedTypeEntry() { - return setField_ == _Fields.USER_DEFINED_TYPE_ENTRY; - } - - - public boolean equals(Object other) { - if (other instanceof TTypeEntry) { - return equals((TTypeEntry)other); - } else { - return false; - } - } - - public boolean equals(TTypeEntry other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TTypeEntry other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - List list = new ArrayList(); - list.add(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - list.add(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - list.add(value); - } - } - return list.hashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeId.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeId.java deleted file mode 100644 index a3735ebf3ec07..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeId.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - - -import java.util.Map; -import java.util.HashMap; -import org.apache.thrift.TEnum; - -public enum TTypeId implements org.apache.thrift.TEnum { - BOOLEAN_TYPE(0), - TINYINT_TYPE(1), - SMALLINT_TYPE(2), - INT_TYPE(3), - BIGINT_TYPE(4), - FLOAT_TYPE(5), - DOUBLE_TYPE(6), - STRING_TYPE(7), - TIMESTAMP_TYPE(8), - BINARY_TYPE(9), - ARRAY_TYPE(10), - MAP_TYPE(11), - STRUCT_TYPE(12), - UNION_TYPE(13), - USER_DEFINED_TYPE(14), - DECIMAL_TYPE(15), - NULL_TYPE(16), - DATE_TYPE(17), - VARCHAR_TYPE(18), - CHAR_TYPE(19), - INTERVAL_YEAR_MONTH_TYPE(20), - INTERVAL_DAY_TIME_TYPE(21); - - private final int value; - - private TTypeId(int value) { - this.value = value; - } - - /** - * Get the integer value of this enum value, as defined in the Thrift IDL. - */ - public int getValue() { - return value; - } - - /** - * Find a the enum type by its integer value, as defined in the Thrift IDL. - * @return null if the value is not found. - */ - public static TTypeId findByValue(int value) { - switch (value) { - case 0: - return BOOLEAN_TYPE; - case 1: - return TINYINT_TYPE; - case 2: - return SMALLINT_TYPE; - case 3: - return INT_TYPE; - case 4: - return BIGINT_TYPE; - case 5: - return FLOAT_TYPE; - case 6: - return DOUBLE_TYPE; - case 7: - return STRING_TYPE; - case 8: - return TIMESTAMP_TYPE; - case 9: - return BINARY_TYPE; - case 10: - return ARRAY_TYPE; - case 11: - return MAP_TYPE; - case 12: - return STRUCT_TYPE; - case 13: - return UNION_TYPE; - case 14: - return USER_DEFINED_TYPE; - case 15: - return DECIMAL_TYPE; - case 16: - return NULL_TYPE; - case 17: - return DATE_TYPE; - case 18: - return VARCHAR_TYPE; - case 19: - return CHAR_TYPE; - case 20: - return INTERVAL_YEAR_MONTH_TYPE; - case 21: - return INTERVAL_DAY_TIME_TYPE; - default: - return null; - } - } -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeQualifierValue.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeQualifierValue.java deleted file mode 100644 index 1720c0e9a72c2..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeQualifierValue.java +++ /dev/null @@ -1,365 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -public class TTypeQualifierValue extends org.apache.thrift.TUnion { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifierValue"); - private static final org.apache.thrift.protocol.TField I32_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("i32Value", org.apache.thrift.protocol.TType.I32, (short)1); - private static final org.apache.thrift.protocol.TField STRING_VALUE_FIELD_DESC = new org.apache.thrift.protocol.TField("stringValue", org.apache.thrift.protocol.TType.STRING, (short)2); - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - I32_VALUE((short)1, "i32Value"), - STRING_VALUE((short)2, "stringValue"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // I32_VALUE - return I32_VALUE; - case 2: // STRING_VALUE - return STRING_VALUE; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.I32_VALUE, new org.apache.thrift.meta_data.FieldMetaData("i32Value", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); - tmpMap.put(_Fields.STRING_VALUE, new org.apache.thrift.meta_data.FieldMetaData("stringValue", org.apache.thrift.TFieldRequirementType.OPTIONAL, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifierValue.class, metaDataMap); - } - - public TTypeQualifierValue() { - super(); - } - - public TTypeQualifierValue(TTypeQualifierValue._Fields setField, Object value) { - super(setField, value); - } - - public TTypeQualifierValue(TTypeQualifierValue other) { - super(other); - } - public TTypeQualifierValue deepCopy() { - return new TTypeQualifierValue(this); - } - - public static TTypeQualifierValue i32Value(int value) { - TTypeQualifierValue x = new TTypeQualifierValue(); - x.setI32Value(value); - return x; - } - - public static TTypeQualifierValue stringValue(String value) { - TTypeQualifierValue x = new TTypeQualifierValue(); - x.setStringValue(value); - return x; - } - - - @Override - protected void checkType(_Fields setField, Object value) throws ClassCastException { - switch (setField) { - case I32_VALUE: - if (value instanceof Integer) { - break; - } - throw new ClassCastException("Was expecting value of type Integer for field 'i32Value', but got " + value.getClass().getSimpleName()); - case STRING_VALUE: - if (value instanceof String) { - break; - } - throw new ClassCastException("Was expecting value of type String for field 'stringValue', but got " + value.getClass().getSimpleName()); - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TField field) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(field.id); - if (setField != null) { - switch (setField) { - case I32_VALUE: - if (field.type == I32_VALUE_FIELD_DESC.type) { - Integer i32Value; - i32Value = iprot.readI32(); - return i32Value; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - case STRING_VALUE: - if (field.type == STRING_VALUE_FIELD_DESC.type) { - String stringValue; - stringValue = iprot.readString(); - return stringValue; - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - return null; - } - } - - @Override - protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case I32_VALUE: - Integer i32Value = (Integer)value_; - oprot.writeI32(i32Value); - return; - case STRING_VALUE: - String stringValue = (String)value_; - oprot.writeString(stringValue); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol iprot, short fieldID) throws org.apache.thrift.TException { - _Fields setField = _Fields.findByThriftId(fieldID); - if (setField != null) { - switch (setField) { - case I32_VALUE: - Integer i32Value; - i32Value = iprot.readI32(); - return i32Value; - case STRING_VALUE: - String stringValue; - stringValue = iprot.readString(); - return stringValue; - default: - throw new IllegalStateException("setField wasn't null, but didn't match any of the case statements!"); - } - } else { - throw new TProtocolException("Couldn't find a field with field id " + fieldID); - } - } - - @Override - protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - switch (setField_) { - case I32_VALUE: - Integer i32Value = (Integer)value_; - oprot.writeI32(i32Value); - return; - case STRING_VALUE: - String stringValue = (String)value_; - oprot.writeString(stringValue); - return; - default: - throw new IllegalStateException("Cannot write union with unknown field " + setField_); - } - } - - @Override - protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) { - switch (setField) { - case I32_VALUE: - return I32_VALUE_FIELD_DESC; - case STRING_VALUE: - return STRING_VALUE_FIELD_DESC; - default: - throw new IllegalArgumentException("Unknown field id " + setField); - } - } - - @Override - protected org.apache.thrift.protocol.TStruct getStructDesc() { - return STRUCT_DESC; - } - - @Override - protected _Fields enumForId(short id) { - return _Fields.findByThriftIdOrThrow(id); - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - - public int getI32Value() { - if (getSetField() == _Fields.I32_VALUE) { - return (Integer)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'i32Value' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setI32Value(int value) { - setField_ = _Fields.I32_VALUE; - value_ = value; - } - - public String getStringValue() { - if (getSetField() == _Fields.STRING_VALUE) { - return (String)getFieldValue(); - } else { - throw new RuntimeException("Cannot get field 'stringValue' because union is currently set to " + getFieldDesc(getSetField()).name); - } - } - - public void setStringValue(String value) { - if (value == null) throw new NullPointerException(); - setField_ = _Fields.STRING_VALUE; - value_ = value; - } - - public boolean isSetI32Value() { - return setField_ == _Fields.I32_VALUE; - } - - - public boolean isSetStringValue() { - return setField_ == _Fields.STRING_VALUE; - } - - - public boolean equals(Object other) { - if (other instanceof TTypeQualifierValue) { - return equals((TTypeQualifierValue)other); - } else { - return false; - } - } - - public boolean equals(TTypeQualifierValue other) { - return other != null && getSetField() == other.getSetField() && getFieldValue().equals(other.getFieldValue()); - } - - @Override - public int compareTo(TTypeQualifierValue other) { - int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), other.getSetField()); - if (lastComparison == 0) { - return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), other.getFieldValue()); - } - return lastComparison; - } - - - @Override - public int hashCode() { - List list = new ArrayList(); - list.add(this.getClass().getName()); - org.apache.thrift.TFieldIdEnum setField = getSetField(); - if (setField != null) { - list.add(setField.getThriftFieldId()); - Object value = getFieldValue(); - if (value instanceof org.apache.thrift.TEnum) { - list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue()); - } else { - list.add(value); - } - } - return list.hashCode(); - } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - -} diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeQualifiers.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeQualifiers.java deleted file mode 100644 index f46d2ceb79caa..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TTypeQualifiers.java +++ /dev/null @@ -1,454 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TTypeQualifiers implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTypeQualifiers"); - - private static final org.apache.thrift.protocol.TField QUALIFIERS_FIELD_DESC = new org.apache.thrift.protocol.TField("qualifiers", org.apache.thrift.protocol.TType.MAP, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TTypeQualifiersStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TTypeQualifiersTupleSchemeFactory()); - } - - private Map qualifiers; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - QUALIFIERS((short)1, "qualifiers"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // QUALIFIERS - return QUALIFIERS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.QUALIFIERS, new org.apache.thrift.meta_data.FieldMetaData("qualifiers", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TTypeQualifierValue.class)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTypeQualifiers.class, metaDataMap); - } - - public TTypeQualifiers() { - } - - public TTypeQualifiers( - Map qualifiers) - { - this(); - this.qualifiers = qualifiers; - } - - /** - * Performs a deep copy on other. - */ - public TTypeQualifiers(TTypeQualifiers other) { - if (other.isSetQualifiers()) { - Map __this__qualifiers = new HashMap(other.qualifiers.size()); - for (Map.Entry other_element : other.qualifiers.entrySet()) { - - String other_element_key = other_element.getKey(); - TTypeQualifierValue other_element_value = other_element.getValue(); - - String __this__qualifiers_copy_key = other_element_key; - - TTypeQualifierValue __this__qualifiers_copy_value = new TTypeQualifierValue(other_element_value); - - __this__qualifiers.put(__this__qualifiers_copy_key, __this__qualifiers_copy_value); - } - this.qualifiers = __this__qualifiers; - } - } - - public TTypeQualifiers deepCopy() { - return new TTypeQualifiers(this); - } - - @Override - public void clear() { - this.qualifiers = null; - } - - public int getQualifiersSize() { - return (this.qualifiers == null) ? 0 : this.qualifiers.size(); - } - - public void putToQualifiers(String key, TTypeQualifierValue val) { - if (this.qualifiers == null) { - this.qualifiers = new HashMap(); - } - this.qualifiers.put(key, val); - } - - public Map getQualifiers() { - return this.qualifiers; - } - - public void setQualifiers(Map qualifiers) { - this.qualifiers = qualifiers; - } - - public void unsetQualifiers() { - this.qualifiers = null; - } - - /** Returns true if field qualifiers is set (has been assigned a value) and false otherwise */ - public boolean isSetQualifiers() { - return this.qualifiers != null; - } - - public void setQualifiersIsSet(boolean value) { - if (!value) { - this.qualifiers = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case QUALIFIERS: - if (value == null) { - unsetQualifiers(); - } else { - setQualifiers((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case QUALIFIERS: - return getQualifiers(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case QUALIFIERS: - return isSetQualifiers(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TTypeQualifiers) - return this.equals((TTypeQualifiers)that); - return false; - } - - public boolean equals(TTypeQualifiers that) { - if (that == null) - return false; - - boolean this_present_qualifiers = true && this.isSetQualifiers(); - boolean that_present_qualifiers = true && that.isSetQualifiers(); - if (this_present_qualifiers || that_present_qualifiers) { - if (!(this_present_qualifiers && that_present_qualifiers)) - return false; - if (!this.qualifiers.equals(that.qualifiers)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_qualifiers = true && (isSetQualifiers()); - list.add(present_qualifiers); - if (present_qualifiers) - list.add(qualifiers); - - return list.hashCode(); - } - - @Override - public int compareTo(TTypeQualifiers other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetQualifiers()).compareTo(other.isSetQualifiers()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetQualifiers()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.qualifiers, other.qualifiers); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TTypeQualifiers("); - boolean first = true; - - sb.append("qualifiers:"); - if (this.qualifiers == null) { - sb.append("null"); - } else { - sb.append(this.qualifiers); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetQualifiers()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'qualifiers' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TTypeQualifiersStandardSchemeFactory implements SchemeFactory { - public TTypeQualifiersStandardScheme getScheme() { - return new TTypeQualifiersStandardScheme(); - } - } - - private static class TTypeQualifiersStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TTypeQualifiers struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // QUALIFIERS - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin(); - struct.qualifiers = new HashMap(2*_map0.size); - String _key1; - TTypeQualifierValue _val2; - for (int _i3 = 0; _i3 < _map0.size; ++_i3) - { - _key1 = iprot.readString(); - _val2 = new TTypeQualifierValue(); - _val2.read(iprot); - struct.qualifiers.put(_key1, _val2); - } - iprot.readMapEnd(); - } - struct.setQualifiersIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TTypeQualifiers struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.qualifiers != null) { - oprot.writeFieldBegin(QUALIFIERS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.qualifiers.size())); - for (Map.Entry _iter4 : struct.qualifiers.entrySet()) - { - oprot.writeString(_iter4.getKey()); - _iter4.getValue().write(oprot); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TTypeQualifiersTupleSchemeFactory implements SchemeFactory { - public TTypeQualifiersTupleScheme getScheme() { - return new TTypeQualifiersTupleScheme(); - } - } - - private static class TTypeQualifiersTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.qualifiers.size()); - for (Map.Entry _iter5 : struct.qualifiers.entrySet()) - { - oprot.writeString(_iter5.getKey()); - _iter5.getValue().write(oprot); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TTypeQualifiers struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TMap _map6 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.qualifiers = new HashMap(2*_map6.size); - String _key7; - TTypeQualifierValue _val8; - for (int _i9 = 0; _i9 < _map6.size; ++_i9) - { - _key7 = iprot.readString(); - _val8 = new TTypeQualifierValue(); - _val8.read(iprot); - struct.qualifiers.put(_key7, _val8); - } - } - struct.setQualifiersIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TUnionTypeEntry.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TUnionTypeEntry.java deleted file mode 100644 index d53f74cb8eff1..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TUnionTypeEntry.java +++ /dev/null @@ -1,452 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TUnionTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUnionTypeEntry"); - - private static final org.apache.thrift.protocol.TField NAME_TO_TYPE_PTR_FIELD_DESC = new org.apache.thrift.protocol.TField("nameToTypePtr", org.apache.thrift.protocol.TType.MAP, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TUnionTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TUnionTypeEntryTupleSchemeFactory()); - } - - private Map nameToTypePtr; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - NAME_TO_TYPE_PTR((short)1, "nameToTypePtr"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // NAME_TO_TYPE_PTR - return NAME_TO_TYPE_PTR; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.NAME_TO_TYPE_PTR, new org.apache.thrift.meta_data.FieldMetaData("nameToTypePtr", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32 , "TTypeEntryPtr")))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUnionTypeEntry.class, metaDataMap); - } - - public TUnionTypeEntry() { - } - - public TUnionTypeEntry( - Map nameToTypePtr) - { - this(); - this.nameToTypePtr = nameToTypePtr; - } - - /** - * Performs a deep copy on other. - */ - public TUnionTypeEntry(TUnionTypeEntry other) { - if (other.isSetNameToTypePtr()) { - Map __this__nameToTypePtr = new HashMap(other.nameToTypePtr.size()); - for (Map.Entry other_element : other.nameToTypePtr.entrySet()) { - - String other_element_key = other_element.getKey(); - Integer other_element_value = other_element.getValue(); - - String __this__nameToTypePtr_copy_key = other_element_key; - - Integer __this__nameToTypePtr_copy_value = other_element_value; - - __this__nameToTypePtr.put(__this__nameToTypePtr_copy_key, __this__nameToTypePtr_copy_value); - } - this.nameToTypePtr = __this__nameToTypePtr; - } - } - - public TUnionTypeEntry deepCopy() { - return new TUnionTypeEntry(this); - } - - @Override - public void clear() { - this.nameToTypePtr = null; - } - - public int getNameToTypePtrSize() { - return (this.nameToTypePtr == null) ? 0 : this.nameToTypePtr.size(); - } - - public void putToNameToTypePtr(String key, int val) { - if (this.nameToTypePtr == null) { - this.nameToTypePtr = new HashMap(); - } - this.nameToTypePtr.put(key, val); - } - - public Map getNameToTypePtr() { - return this.nameToTypePtr; - } - - public void setNameToTypePtr(Map nameToTypePtr) { - this.nameToTypePtr = nameToTypePtr; - } - - public void unsetNameToTypePtr() { - this.nameToTypePtr = null; - } - - /** Returns true if field nameToTypePtr is set (has been assigned a value) and false otherwise */ - public boolean isSetNameToTypePtr() { - return this.nameToTypePtr != null; - } - - public void setNameToTypePtrIsSet(boolean value) { - if (!value) { - this.nameToTypePtr = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case NAME_TO_TYPE_PTR: - if (value == null) { - unsetNameToTypePtr(); - } else { - setNameToTypePtr((Map)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case NAME_TO_TYPE_PTR: - return getNameToTypePtr(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case NAME_TO_TYPE_PTR: - return isSetNameToTypePtr(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TUnionTypeEntry) - return this.equals((TUnionTypeEntry)that); - return false; - } - - public boolean equals(TUnionTypeEntry that) { - if (that == null) - return false; - - boolean this_present_nameToTypePtr = true && this.isSetNameToTypePtr(); - boolean that_present_nameToTypePtr = true && that.isSetNameToTypePtr(); - if (this_present_nameToTypePtr || that_present_nameToTypePtr) { - if (!(this_present_nameToTypePtr && that_present_nameToTypePtr)) - return false; - if (!this.nameToTypePtr.equals(that.nameToTypePtr)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_nameToTypePtr = true && (isSetNameToTypePtr()); - list.add(present_nameToTypePtr); - if (present_nameToTypePtr) - list.add(nameToTypePtr); - - return list.hashCode(); - } - - @Override - public int compareTo(TUnionTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetNameToTypePtr()).compareTo(other.isSetNameToTypePtr()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetNameToTypePtr()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.nameToTypePtr, other.nameToTypePtr); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TUnionTypeEntry("); - boolean first = true; - - sb.append("nameToTypePtr:"); - if (this.nameToTypePtr == null) { - sb.append("null"); - } else { - sb.append(this.nameToTypePtr); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetNameToTypePtr()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'nameToTypePtr' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TUnionTypeEntryStandardSchemeFactory implements SchemeFactory { - public TUnionTypeEntryStandardScheme getScheme() { - return new TUnionTypeEntryStandardScheme(); - } - } - - private static class TUnionTypeEntryStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // NAME_TO_TYPE_PTR - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map20 = iprot.readMapBegin(); - struct.nameToTypePtr = new HashMap(2*_map20.size); - String _key21; - int _val22; - for (int _i23 = 0; _i23 < _map20.size; ++_i23) - { - _key21 = iprot.readString(); - _val22 = iprot.readI32(); - struct.nameToTypePtr.put(_key21, _val22); - } - iprot.readMapEnd(); - } - struct.setNameToTypePtrIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.nameToTypePtr != null) { - oprot.writeFieldBegin(NAME_TO_TYPE_PTR_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, struct.nameToTypePtr.size())); - for (Map.Entry _iter24 : struct.nameToTypePtr.entrySet()) - { - oprot.writeString(_iter24.getKey()); - oprot.writeI32(_iter24.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TUnionTypeEntryTupleSchemeFactory implements SchemeFactory { - public TUnionTypeEntryTupleScheme getScheme() { - return new TUnionTypeEntryTupleScheme(); - } - } - - private static class TUnionTypeEntryTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - { - oprot.writeI32(struct.nameToTypePtr.size()); - for (Map.Entry _iter25 : struct.nameToTypePtr.entrySet()) - { - oprot.writeString(_iter25.getKey()); - oprot.writeI32(_iter25.getValue()); - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TUnionTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - { - org.apache.thrift.protocol.TMap _map26 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.nameToTypePtr = new HashMap(2*_map26.size); - String _key27; - int _val28; - for (int _i29 = 0; _i29 < _map26.size; ++_i29) - { - _key27 = iprot.readString(); - _val28 = iprot.readI32(); - struct.nameToTypePtr.put(_key27, _val28); - } - } - struct.setNameToTypePtrIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TUserDefinedTypeEntry.java b/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TUserDefinedTypeEntry.java deleted file mode 100644 index b80c4dd5c6302..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/gen/java/org/apache/hive/service/rpc/thrift/TUserDefinedTypeEntry.java +++ /dev/null @@ -1,389 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.9.3) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - * @generated - */ -package org.apache.hive.service.rpc.thrift; - -import org.apache.thrift.scheme.IScheme; -import org.apache.thrift.scheme.SchemeFactory; -import org.apache.thrift.scheme.StandardScheme; - -import org.apache.thrift.scheme.TupleScheme; -import org.apache.thrift.protocol.TTupleProtocol; -import org.apache.thrift.protocol.TProtocolException; -import org.apache.thrift.EncodingUtils; -import org.apache.thrift.TException; -import org.apache.thrift.async.AsyncMethodCallback; -import org.apache.thrift.server.AbstractNonblockingServer.*; -import java.util.List; -import java.util.ArrayList; -import java.util.Map; -import java.util.HashMap; -import java.util.EnumMap; -import java.util.Set; -import java.util.HashSet; -import java.util.EnumSet; -import java.util.Collections; -import java.util.BitSet; -import java.nio.ByteBuffer; -import java.util.Arrays; -import javax.annotation.Generated; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)") -public class TUserDefinedTypeEntry implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TUserDefinedTypeEntry"); - - private static final org.apache.thrift.protocol.TField TYPE_CLASS_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("typeClassName", org.apache.thrift.protocol.TType.STRING, (short)1); - - private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new TUserDefinedTypeEntryStandardSchemeFactory()); - schemes.put(TupleScheme.class, new TUserDefinedTypeEntryTupleSchemeFactory()); - } - - private String typeClassName; // required - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - TYPE_CLASS_NAME((short)1, "typeClassName"); - - private static final Map byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 1: // TYPE_CLASS_NAME - return TYPE_CLASS_NAME; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.TYPE_CLASS_NAME, new org.apache.thrift.meta_data.FieldMetaData("typeClassName", org.apache.thrift.TFieldRequirementType.REQUIRED, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TUserDefinedTypeEntry.class, metaDataMap); - } - - public TUserDefinedTypeEntry() { - } - - public TUserDefinedTypeEntry( - String typeClassName) - { - this(); - this.typeClassName = typeClassName; - } - - /** - * Performs a deep copy on other. - */ - public TUserDefinedTypeEntry(TUserDefinedTypeEntry other) { - if (other.isSetTypeClassName()) { - this.typeClassName = other.typeClassName; - } - } - - public TUserDefinedTypeEntry deepCopy() { - return new TUserDefinedTypeEntry(this); - } - - @Override - public void clear() { - this.typeClassName = null; - } - - public String getTypeClassName() { - return this.typeClassName; - } - - public void setTypeClassName(String typeClassName) { - this.typeClassName = typeClassName; - } - - public void unsetTypeClassName() { - this.typeClassName = null; - } - - /** Returns true if field typeClassName is set (has been assigned a value) and false otherwise */ - public boolean isSetTypeClassName() { - return this.typeClassName != null; - } - - public void setTypeClassNameIsSet(boolean value) { - if (!value) { - this.typeClassName = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case TYPE_CLASS_NAME: - if (value == null) { - unsetTypeClassName(); - } else { - setTypeClassName((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case TYPE_CLASS_NAME: - return getTypeClassName(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case TYPE_CLASS_NAME: - return isSetTypeClassName(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof TUserDefinedTypeEntry) - return this.equals((TUserDefinedTypeEntry)that); - return false; - } - - public boolean equals(TUserDefinedTypeEntry that) { - if (that == null) - return false; - - boolean this_present_typeClassName = true && this.isSetTypeClassName(); - boolean that_present_typeClassName = true && that.isSetTypeClassName(); - if (this_present_typeClassName || that_present_typeClassName) { - if (!(this_present_typeClassName && that_present_typeClassName)) - return false; - if (!this.typeClassName.equals(that.typeClassName)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - List list = new ArrayList(); - - boolean present_typeClassName = true && (isSetTypeClassName()); - list.add(present_typeClassName); - if (present_typeClassName) - list.add(typeClassName); - - return list.hashCode(); - } - - @Override - public int compareTo(TUserDefinedTypeEntry other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetTypeClassName()).compareTo(other.isSetTypeClassName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTypeClassName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeClassName, other.typeClassName); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - schemes.get(iprot.getScheme()).getScheme().read(iprot, this); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - schemes.get(oprot.getScheme()).getScheme().write(oprot, this); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("TUserDefinedTypeEntry("); - boolean first = true; - - sb.append("typeClassName:"); - if (this.typeClassName == null) { - sb.append("null"); - } else { - sb.append(this.typeClassName); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - if (!isSetTypeClassName()) { - throw new org.apache.thrift.protocol.TProtocolException("Required field 'typeClassName' is unset! Struct:" + toString()); - } - - // check for sub-struct validity - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private static class TUserDefinedTypeEntryStandardSchemeFactory implements SchemeFactory { - public TUserDefinedTypeEntryStandardScheme getScheme() { - return new TUserDefinedTypeEntryStandardScheme(); - } - } - - private static class TUserDefinedTypeEntryStandardScheme extends StandardScheme { - - public void read(org.apache.thrift.protocol.TProtocol iprot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 1: // TYPE_CLASS_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.typeClassName = iprot.readString(); - struct.setTypeClassNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - struct.validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.typeClassName != null) { - oprot.writeFieldBegin(TYPE_CLASS_NAME_FIELD_DESC); - oprot.writeString(struct.typeClassName); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class TUserDefinedTypeEntryTupleSchemeFactory implements SchemeFactory { - public TUserDefinedTypeEntryTupleScheme getScheme() { - return new TUserDefinedTypeEntryTupleScheme(); - } - } - - private static class TUserDefinedTypeEntryTupleScheme extends TupleScheme { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - oprot.writeString(struct.typeClassName); - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, TUserDefinedTypeEntry struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - struct.typeClassName = iprot.readString(); - struct.setTypeClassNameIsSet(true); - } - } - -} - diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/CLIService.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/CLIService.java deleted file mode 100644 index bdc1e6251e560..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/CLIService.java +++ /dev/null @@ -1,573 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.io.IOException; -import java.util.List; -import java.util.Map; -import java.util.concurrent.CancellationException; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; - -import javax.security.auth.login.LoginException; - -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hadoop.hive.metastore.HiveMetaStoreClient; -import org.apache.hadoop.hive.metastore.IMetaStoreClient; -import org.apache.hadoop.hive.metastore.api.MetaException; -import org.apache.hadoop.hive.ql.exec.FunctionRegistry; -import org.apache.hadoop.hive.ql.metadata.Hive; -import org.apache.hadoop.hive.ql.metadata.HiveException; -import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hadoop.hive.shims.Utils; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hive.service.CompositeService; -import org.apache.hive.service.ServiceException; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.cli.operation.Operation; -import org.apache.hive.service.cli.session.HiveSession; -import org.apache.hive.service.cli.session.SessionManager; -import org.apache.hive.service.rpc.thrift.TProtocolVersion; -import org.apache.hive.service.server.HiveServer2; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * CLIService. - * - */ -public class CLIService extends CompositeService implements ICLIService { - - public static final TProtocolVersion SERVER_VERSION; - - static { - TProtocolVersion[] protocols = TProtocolVersion.values(); - SERVER_VERSION = protocols[protocols.length - 1]; - } - - private final Logger LOG = LoggerFactory.getLogger(CLIService.class.getName()); - - private HiveConf hiveConf; - private SessionManager sessionManager; - private UserGroupInformation serviceUGI; - private UserGroupInformation httpUGI; - // The HiveServer2 instance running this service - private final HiveServer2 hiveServer2; - - public CLIService(HiveServer2 hiveServer2) { - super(CLIService.class.getSimpleName()); - this.hiveServer2 = hiveServer2; - } - - @Override - public synchronized void init(HiveConf hiveConf) { - this.hiveConf = hiveConf; - sessionManager = new SessionManager(hiveServer2); - addService(sessionManager); - // If the hadoop cluster is secure, do a kerberos login for the service from the keytab - if (UserGroupInformation.isSecurityEnabled()) { - try { - HiveAuthFactory.loginFromKeytab(hiveConf); - this.serviceUGI = Utils.getUGI(); - } catch (IOException e) { - throw new ServiceException("Unable to login to kerberos with given principal/keytab", e); - } catch (LoginException e) { - throw new ServiceException("Unable to login to kerberos with given principal/keytab", e); - } - - // Also try creating a UGI object for the SPNego principal - String principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_PRINCIPAL); - String keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_SPNEGO_KEYTAB); - if (principal.isEmpty() || keyTabFile.isEmpty()) { - LOG.info("SPNego httpUGI not created, spNegoPrincipal: " + principal + - ", ketabFile: " + keyTabFile); - } else { - try { - this.httpUGI = HiveAuthFactory.loginFromSpnegoKeytabAndReturnUGI(hiveConf); - LOG.info("SPNego httpUGI successfully created."); - } catch (IOException e) { - LOG.warn("SPNego httpUGI creation failed: ", e); - } - } - } - // creates connection to HMS and thus *must* occur after kerberos login above - try { - applyAuthorizationConfigPolicy(hiveConf); - } catch (Exception e) { - throw new RuntimeException("Error applying authorization policy on hive configuration: " - + e.getMessage(), e); - } - setupBlockedUdfs(); - super.init(hiveConf); - } - - private void applyAuthorizationConfigPolicy(HiveConf newHiveConf) throws HiveException, - MetaException { - // authorization setup using SessionState should be revisited eventually, as - // authorization and authentication are not session specific settings - SessionState ss = new SessionState(newHiveConf); - ss.setIsHiveServerQuery(true); - SessionState.start(ss); - ss.applyAuthorizationPolicy(); - } - - private void setupBlockedUdfs() { - FunctionRegistry.setupPermissionsForBuiltinUDFs( - hiveConf.getVar(ConfVars.HIVE_SERVER2_BUILTIN_UDF_WHITELIST), - hiveConf.getVar(ConfVars.HIVE_SERVER2_BUILTIN_UDF_BLACKLIST)); - } - - public UserGroupInformation getServiceUGI() { - return this.serviceUGI; - } - - public UserGroupInformation getHttpUGI() { - return this.httpUGI; - } - - @Override - public synchronized void start() { - super.start(); - // Initialize and test a connection to the metastore - IMetaStoreClient metastoreClient = null; - try { - metastoreClient = new HiveMetaStoreClient(hiveConf); - metastoreClient.getDatabases("default"); - } catch (Exception e) { - throw new ServiceException("Unable to connect to MetaStore!", e); - } - finally { - if (metastoreClient != null) { - metastoreClient.close(); - } - } - } - - @Override - public synchronized void stop() { - super.stop(); - } - - /** - * @deprecated Use {@link #openSession(TProtocolVersion, String, String, String, Map)} - */ - @Deprecated - public SessionHandle openSession(TProtocolVersion protocol, String username, String password, - Map configuration) throws HiveSQLException { - SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, null, configuration, false, null); - LOG.debug(sessionHandle + ": openSession()"); - return sessionHandle; - } - - /** - * @deprecated Use {@link #openSessionWithImpersonation(TProtocolVersion, String, String, String, Map, String)} - */ - @Deprecated - public SessionHandle openSessionWithImpersonation(TProtocolVersion protocol, String username, - String password, Map configuration, String delegationToken) - throws HiveSQLException { - SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, null, configuration, - true, delegationToken); - LOG.debug(sessionHandle + ": openSessionWithImpersonation()"); - return sessionHandle; - } - - public SessionHandle openSession(TProtocolVersion protocol, String username, String password, String ipAddress, - Map configuration) throws HiveSQLException { - SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, ipAddress, configuration, false, null); - LOG.debug(sessionHandle + ": openSession()"); - return sessionHandle; - } - - public SessionHandle openSessionWithImpersonation(TProtocolVersion protocol, String username, - String password, String ipAddress, Map configuration, String delegationToken) - throws HiveSQLException { - SessionHandle sessionHandle = sessionManager.openSession(protocol, username, password, ipAddress, configuration, - true, delegationToken); - LOG.debug(sessionHandle + ": openSession()"); - return sessionHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map) - */ - @Override - public SessionHandle openSession(String username, String password, Map configuration) - throws HiveSQLException { - SessionHandle sessionHandle = sessionManager.openSession(SERVER_VERSION, username, password, null, configuration, false, null); - LOG.debug(sessionHandle + ": openSession()"); - return sessionHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map) - */ - @Override - public SessionHandle openSessionWithImpersonation(String username, String password, Map configuration, - String delegationToken) throws HiveSQLException { - SessionHandle sessionHandle = sessionManager.openSession(SERVER_VERSION, username, password, null, configuration, - true, delegationToken); - LOG.debug(sessionHandle + ": openSession()"); - return sessionHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#closeSession(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public void closeSession(SessionHandle sessionHandle) - throws HiveSQLException { - sessionManager.closeSession(sessionHandle); - LOG.debug(sessionHandle + ": closeSession()"); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getInfo(org.apache.hive.service.cli.SessionHandle, java.util.List) - */ - @Override - public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType getInfoType) - throws HiveSQLException { - GetInfoValue infoValue = sessionManager.getSession(sessionHandle) - .getInfo(getInfoType); - LOG.debug(sessionHandle + ": getInfo()"); - return infoValue; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#executeStatement(org.apache.hive.service.cli.SessionHandle, - * java.lang.String, java.util.Map) - */ - @Override - public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, - Map confOverlay) throws HiveSQLException { - HiveSession session = sessionManager.getSession(sessionHandle); - // need to reset the monitor, as operation handle is not available down stream, Ideally the - // monitor should be associated with the operation handle. - session.getSessionState().updateProgressMonitor(null); - OperationHandle opHandle = session.executeStatement(statement, confOverlay); - LOG.debug(sessionHandle + ": executeStatement()"); - return opHandle; - } - - /** - * Execute statement on the server with a timeout. This is a blocking call. - */ - @Override - public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, - Map confOverlay, long queryTimeout) throws HiveSQLException { - HiveSession session = sessionManager.getSession(sessionHandle); - // need to reset the monitor, as operation handle is not available down stream, Ideally the - // monitor should be associated with the operation handle. - session.getSessionState().updateProgressMonitor(null); - OperationHandle opHandle = session.executeStatement(statement, confOverlay, queryTimeout); - LOG.debug(sessionHandle + ": executeStatement()"); - return opHandle; - } - - /** - * Execute statement asynchronously on the server. This is a non-blocking call - */ - @Override - public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, - Map confOverlay) throws HiveSQLException { - HiveSession session = sessionManager.getSession(sessionHandle); - // need to reset the monitor, as operation handle is not available down stream, Ideally the - // monitor should be associated with the operation handle. - session.getSessionState().updateProgressMonitor(null); - OperationHandle opHandle = session.executeStatementAsync(statement, confOverlay); - LOG.debug(sessionHandle + ": executeStatementAsync()"); - return opHandle; - } - - /** - * Execute statement asynchronously on the server with a timeout. This is a non-blocking call - */ - @Override - public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, - Map confOverlay, long queryTimeout) throws HiveSQLException { - HiveSession session = sessionManager.getSession(sessionHandle); - // need to reset the monitor, as operation handle is not available down stream, Ideally the - // monitor should be associated with the operation handle. - session.getSessionState().updateProgressMonitor(null); - OperationHandle opHandle = session.executeStatementAsync(statement, confOverlay, queryTimeout); - LOG.debug(sessionHandle + ": executeStatementAsync()"); - return opHandle; - } - - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getTypeInfo(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getTypeInfo(SessionHandle sessionHandle) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getTypeInfo(); - LOG.debug(sessionHandle + ": getTypeInfo()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getCatalogs(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getCatalogs(SessionHandle sessionHandle) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getCatalogs(); - LOG.debug(sessionHandle + ": getCatalogs()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getSchemas(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String) - */ - @Override - public OperationHandle getSchemas(SessionHandle sessionHandle, - String catalogName, String schemaName) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getSchemas(catalogName, schemaName); - LOG.debug(sessionHandle + ": getSchemas()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getTables(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.util.List) - */ - @Override - public OperationHandle getTables(SessionHandle sessionHandle, - String catalogName, String schemaName, String tableName, List tableTypes) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getTables(catalogName, schemaName, tableName, tableTypes); - LOG.debug(sessionHandle + ": getTables()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getTableTypes(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getTableTypes(SessionHandle sessionHandle) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getTableTypes(); - LOG.debug(sessionHandle + ": getTableTypes()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getColumns(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getColumns(SessionHandle sessionHandle, - String catalogName, String schemaName, String tableName, String columnName) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getColumns(catalogName, schemaName, tableName, columnName); - LOG.debug(sessionHandle + ": getColumns()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getFunctions(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getFunctions(SessionHandle sessionHandle, - String catalogName, String schemaName, String functionName) - throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getFunctions(catalogName, schemaName, functionName); - LOG.debug(sessionHandle + ": getFunctions()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getPrimaryKeys(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getPrimaryKeys(SessionHandle sessionHandle, - String catalog, String schema, String table) throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getPrimaryKeys(catalog, schema, table); - LOG.debug(sessionHandle + ": getPrimaryKeys()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getCrossReference(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getCrossReference(SessionHandle sessionHandle, - String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, - String foreignSchema, String foreignTable) throws HiveSQLException { - OperationHandle opHandle = sessionManager.getSession(sessionHandle) - .getCrossReference(primaryCatalog, primarySchema, primaryTable, - foreignCatalog, - foreignSchema, foreignTable); - LOG.debug(sessionHandle + ": getCrossReference()"); - return opHandle; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getOperationStatus(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public OperationStatus getOperationStatus(OperationHandle opHandle) - throws HiveSQLException { - Operation operation = sessionManager.getOperationManager().getOperation(opHandle); - /** - * If this is a background operation run asynchronously, - * we block for a configured duration, before we return - * (duration: HIVE_SERVER2_LONG_POLLING_TIMEOUT). - * However, if the background operation is complete, we return immediately. - */ - if (operation.shouldRunAsync()) { - HiveConf conf = operation.getParentSession().getHiveConf(); - long timeout = HiveConf.getTimeVar(conf, - HiveConf.ConfVars.HIVE_SERVER2_LONG_POLLING_TIMEOUT, TimeUnit.MILLISECONDS); - try { - operation.getBackgroundHandle().get(timeout, TimeUnit.MILLISECONDS); - } catch (TimeoutException e) { - // No Op, return to the caller since long polling timeout has expired - LOG.trace(opHandle + ": Long polling timed out"); - } catch (CancellationException e) { - // The background operation thread was cancelled - LOG.trace(opHandle + ": The background operation was cancelled", e); - } catch (ExecutionException e) { - // The background operation thread was aborted - LOG.warn(opHandle + ": The background operation was aborted", e); - } catch (InterruptedException e) { - // No op, this thread was interrupted - // In this case, the call might return sooner than long polling timeout - } - } - OperationStatus opStatus = operation.getStatus(); - LOG.debug(opHandle + ": getOperationStatus()"); - return opStatus; - } - - public HiveConf getSessionConf(SessionHandle sessionHandle) throws HiveSQLException { - return sessionManager.getSession(sessionHandle).getHiveConf(); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#cancelOperation(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public void cancelOperation(OperationHandle opHandle) - throws HiveSQLException { - sessionManager.getOperationManager().getOperation(opHandle) - .getParentSession().cancelOperation(opHandle); - LOG.debug(opHandle + ": cancelOperation()"); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#closeOperation(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public void closeOperation(OperationHandle opHandle) - throws HiveSQLException { - sessionManager.getOperationManager().getOperation(opHandle) - .getParentSession().closeOperation(opHandle); - LOG.debug(opHandle + ": closeOperation"); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getResultSetMetadata(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public TableSchema getResultSetMetadata(OperationHandle opHandle) - throws HiveSQLException { - TableSchema tableSchema = sessionManager.getOperationManager() - .getOperation(opHandle).getParentSession().getResultSetMetadata(opHandle); - LOG.debug(opHandle + ": getResultSetMetadata()"); - return tableSchema; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#fetchResults(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public RowSet fetchResults(OperationHandle opHandle) - throws HiveSQLException { - return fetchResults(opHandle, Operation.DEFAULT_FETCH_ORIENTATION, - Operation.DEFAULT_FETCH_MAX_ROWS, FetchType.QUERY_OUTPUT); - } - - @Override - public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, - long maxRows, FetchType fetchType) throws HiveSQLException { - RowSet rowSet = sessionManager.getOperationManager().getOperation(opHandle) - .getParentSession().fetchResults(opHandle, orientation, maxRows, fetchType); - LOG.debug(opHandle + ": fetchResults()"); - return rowSet; - } - - // obtain delegation token for the give user from metastore - public synchronized String getDelegationTokenFromMetaStore(String owner) - throws HiveSQLException, UnsupportedOperationException, LoginException, IOException { - if (!hiveConf.getBoolVar(HiveConf.ConfVars.METASTORE_USE_THRIFT_SASL) || - !hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ENABLE_DOAS)) { - throw new UnsupportedOperationException( - "delegation token is can only be obtained for a secure remote metastore"); - } - - try { - Hive.closeCurrent(); - return Hive.get(hiveConf).getDelegationToken(owner, owner); - } catch (HiveException e) { - if (e.getCause() instanceof UnsupportedOperationException) { - throw (UnsupportedOperationException)e.getCause(); - } else { - throw new HiveSQLException("Error connect metastore to setup impersonation", e); - } - } - } - - @Override - public String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String owner, String renewer) throws HiveSQLException { - String delegationToken = sessionManager.getSession(sessionHandle) - .getDelegationToken(authFactory, owner, renewer); - LOG.info(sessionHandle + ": getDelegationToken()"); - return delegationToken; - } - - @Override - public void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException { - sessionManager.getSession(sessionHandle).cancelDelegationToken(authFactory, tokenStr); - LOG.info(sessionHandle + ": cancelDelegationToken()"); - } - - @Override - public void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException { - sessionManager.getSession(sessionHandle).renewDelegationToken(authFactory, tokenStr); - LOG.info(sessionHandle + ": renewDelegationToken()"); - } - - public SessionManager getSessionManager() { - return sessionManager; - } -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java deleted file mode 100644 index d8e61a87e7f62..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/ColumnDescriptor.java +++ /dev/null @@ -1,92 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import org.apache.hadoop.hive.serde2.thrift.Type; -import org.apache.hive.service.rpc.thrift.TColumnDesc; - - -/** - * ColumnDescriptor. - * - */ -public class ColumnDescriptor { - private final String name; - private final String comment; - private final TypeDescriptor type; - // ordinal position of this column in the schema - private final int position; - - public ColumnDescriptor(String name, String comment, TypeDescriptor type, int position) { - this.name = name; - this.comment = comment; - this.type = type; - this.position = position; - } - - public ColumnDescriptor(TColumnDesc tColumnDesc) { - name = tColumnDesc.getColumnName(); - comment = tColumnDesc.getComment(); - type = new TypeDescriptor(tColumnDesc.getTypeDesc()); - position = tColumnDesc.getPosition(); - } - - public static ColumnDescriptor newPrimitiveColumnDescriptor(String name, String comment, Type type, int position) { - // Current usage looks like it's only for metadata columns, but if that changes then - // this method may need to require a type qualifiers aruments. - return new ColumnDescriptor(name, comment, new TypeDescriptor(type), position); - } - - public String getName() { - return name; - } - - public String getComment() { - return comment; - } - - public TypeDescriptor getTypeDescriptor() { - return type; - } - - public int getOrdinalPosition() { - return position; - } - - public TColumnDesc toTColumnDesc() { - TColumnDesc tColumnDesc = new TColumnDesc(); - tColumnDesc.setColumnName(name); - tColumnDesc.setComment(comment); - tColumnDesc.setTypeDesc(type.toTTypeDesc()); - tColumnDesc.setPosition(position); - return tColumnDesc; - } - - public Type getType() { - return type.getType(); - } - - public boolean isPrimitive() { - return type.getType().isPrimitiveType(); - } - - public String getTypeName() { - return type.getTypeName(); - } -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/ColumnValue.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/ColumnValue.java deleted file mode 100644 index 53f0465a056d8..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/ColumnValue.java +++ /dev/null @@ -1,307 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import java.math.BigDecimal; -import java.sql.Date; -import java.sql.Timestamp; - -import org.apache.hadoop.hive.common.type.HiveChar; -import org.apache.hadoop.hive.common.type.HiveIntervalDayTime; -import org.apache.hadoop.hive.common.type.HiveIntervalYearMonth; -import org.apache.hadoop.hive.common.type.HiveVarchar; -import org.apache.hadoop.hive.serde2.thrift.Type; -import org.apache.hive.service.rpc.thrift.TBoolValue; -import org.apache.hive.service.rpc.thrift.TByteValue; -import org.apache.hive.service.rpc.thrift.TColumnValue; -import org.apache.hive.service.rpc.thrift.TDoubleValue; -import org.apache.hive.service.rpc.thrift.TI16Value; -import org.apache.hive.service.rpc.thrift.TI32Value; -import org.apache.hive.service.rpc.thrift.TI64Value; -import org.apache.hive.service.rpc.thrift.TStringValue; - -import org.apache.spark.unsafe.types.UTF8String; - -/** - * Protocols before HIVE_CLI_SERVICE_PROTOCOL_V6 (used by RowBasedSet) - * - */ -public class ColumnValue { - - private static TColumnValue booleanValue(Boolean value) { - TBoolValue tBoolValue = new TBoolValue(); - if (value != null) { - tBoolValue.setValue(value); - } - return TColumnValue.boolVal(tBoolValue); - } - - private static TColumnValue byteValue(Byte value) { - TByteValue tByteValue = new TByteValue(); - if (value != null) { - tByteValue.setValue(value); - } - return TColumnValue.byteVal(tByteValue); - } - - private static TColumnValue shortValue(Short value) { - TI16Value tI16Value = new TI16Value(); - if (value != null) { - tI16Value.setValue(value); - } - return TColumnValue.i16Val(tI16Value); - } - - private static TColumnValue intValue(Integer value) { - TI32Value tI32Value = new TI32Value(); - if (value != null) { - tI32Value.setValue(value); - } - return TColumnValue.i32Val(tI32Value); - } - - private static TColumnValue longValue(Long value) { - TI64Value tI64Value = new TI64Value(); - if (value != null) { - tI64Value.setValue(value); - } - return TColumnValue.i64Val(tI64Value); - } - - private static TColumnValue floatValue(Float value) { - TDoubleValue tDoubleValue = new TDoubleValue(); - if (value != null) { - tDoubleValue.setValue(value); - } - return TColumnValue.doubleVal(tDoubleValue); - } - - private static TColumnValue doubleValue(Double value) { - TDoubleValue tDoubleValue = new TDoubleValue(); - if (value != null) { - tDoubleValue.setValue(value); - } - return TColumnValue.doubleVal(tDoubleValue); - } - - private static TColumnValue stringValue(String value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value); - } - return TColumnValue.stringVal(tStringValue); - } - - private static TColumnValue stringValue(HiveChar value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value.toString()); - } - return TColumnValue.stringVal(tStringValue); - } - - private static TColumnValue stringValue(HiveVarchar value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value.toString()); - } - return TColumnValue.stringVal(tStringValue); - } - - private static TColumnValue dateValue(Date value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value.toString()); - } - return new TColumnValue(TColumnValue.stringVal(tStringValue)); - } - - private static TColumnValue timestampValue(Timestamp value) { - TStringValue tStringValue = new TStringValue(); - if (value != null) { - tStringValue.setValue(value.toString()); - } - return TColumnValue.stringVal(tStringValue); - } - - private static TColumnValue stringValue(HiveIntervalYearMonth value) { - TStringValue tStrValue = new TStringValue(); - if (value != null) { - tStrValue.setValue(value.toString()); - } - return TColumnValue.stringVal(tStrValue); - } - - private static TColumnValue stringValue(HiveIntervalDayTime value) { - TStringValue tStrValue = new TStringValue(); - if (value != null) { - tStrValue.setValue(value.toString()); - } - return TColumnValue.stringVal(tStrValue); - } - - public static TColumnValue toTColumnValue(TypeDescriptor typeDescriptor, Object value) { - Type type = typeDescriptor.getType(); - - switch (type) { - case BOOLEAN_TYPE: - return booleanValue((Boolean)value); - case TINYINT_TYPE: - return byteValue((Byte)value); - case SMALLINT_TYPE: - return shortValue((Short)value); - case INT_TYPE: - return intValue((Integer)value); - case BIGINT_TYPE: - return longValue((Long)value); - case FLOAT_TYPE: - return floatValue((Float)value); - case DOUBLE_TYPE: - return doubleValue((Double)value); - case STRING_TYPE: - return stringValue((String)value); - case CHAR_TYPE: - return stringValue((HiveChar)value); - case VARCHAR_TYPE: - return stringValue((HiveVarchar)value); - case DATE_TYPE: - return dateValue((Date)value); - case TIMESTAMP_TYPE: - return timestampValue((Timestamp)value); - case INTERVAL_YEAR_MONTH_TYPE: - return stringValue((HiveIntervalYearMonth) value); - case INTERVAL_DAY_TIME_TYPE: - return stringValue((HiveIntervalDayTime) value); - case DECIMAL_TYPE: - String plainStr = value == null ? null : ((BigDecimal)value).toPlainString(); - return stringValue(plainStr); - case BINARY_TYPE: - String strVal = value == null ? null : UTF8String.fromBytes((byte[])value).toString(); - return stringValue(strVal); - case ARRAY_TYPE: - case MAP_TYPE: - case STRUCT_TYPE: - case UNION_TYPE: - case USER_DEFINED_TYPE: - return stringValue((String)value); - case NULL_TYPE: - return stringValue((String)value); - default: - return null; - } - } - - private static Boolean getBooleanValue(TBoolValue tBoolValue) { - if (tBoolValue.isSetValue()) { - return tBoolValue.isValue(); - } - return null; - } - - private static Byte getByteValue(TByteValue tByteValue) { - if (tByteValue.isSetValue()) { - return tByteValue.getValue(); - } - return null; - } - - private static Short getShortValue(TI16Value tI16Value) { - if (tI16Value.isSetValue()) { - return tI16Value.getValue(); - } - return null; - } - - private static Integer getIntegerValue(TI32Value tI32Value) { - if (tI32Value.isSetValue()) { - return tI32Value.getValue(); - } - return null; - } - - private static Long getLongValue(TI64Value tI64Value) { - if (tI64Value.isSetValue()) { - return tI64Value.getValue(); - } - return null; - } - - private static Double getDoubleValue(TDoubleValue tDoubleValue) { - if (tDoubleValue.isSetValue()) { - return tDoubleValue.getValue(); - } - return null; - } - - private static String getStringValue(TStringValue tStringValue) { - if (tStringValue.isSetValue()) { - return tStringValue.getValue(); - } - return null; - } - - private static Date getDateValue(TStringValue tStringValue) { - if (tStringValue.isSetValue()) { - return Date.valueOf(tStringValue.getValue()); - } - return null; - } - - private static Timestamp getTimestampValue(TStringValue tStringValue) { - if (tStringValue.isSetValue()) { - return Timestamp.valueOf(tStringValue.getValue()); - } - return null; - } - - private static byte[] getBinaryValue(TStringValue tString) { - if (tString.isSetValue()) { - return tString.getValue().getBytes(); - } - return null; - } - - private static BigDecimal getBigDecimalValue(TStringValue tStringValue) { - if (tStringValue.isSetValue()) { - return new BigDecimal(tStringValue.getValue()); - } - return null; - } - - public static Object toColumnValue(TColumnValue value) { - TColumnValue._Fields field = value.getSetField(); - switch (field) { - case BOOL_VAL: - return getBooleanValue(value.getBoolVal()); - case BYTE_VAL: - return getByteValue(value.getByteVal()); - case I16_VAL: - return getShortValue(value.getI16Val()); - case I32_VAL: - return getIntegerValue(value.getI32Val()); - case I64_VAL: - return getLongValue(value.getI64Val()); - case DOUBLE_VAL: - return getDoubleValue(value.getDoubleVal()); - case STRING_VAL: - return getStringValue(value.getStringVal()); - } - throw new IllegalArgumentException("never"); - } -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/GetInfoType.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/GetInfoType.java deleted file mode 100644 index a64d262a8f301..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/GetInfoType.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import org.apache.hive.service.rpc.thrift.TGetInfoType; - -/** - * GetInfoType. - * - */ -public enum GetInfoType { - CLI_MAX_DRIVER_CONNECTIONS(TGetInfoType.CLI_MAX_DRIVER_CONNECTIONS), - CLI_MAX_CONCURRENT_ACTIVITIES(TGetInfoType.CLI_MAX_CONCURRENT_ACTIVITIES), - CLI_DATA_SOURCE_NAME(TGetInfoType.CLI_DATA_SOURCE_NAME), - CLI_FETCH_DIRECTION(TGetInfoType.CLI_FETCH_DIRECTION), - CLI_SERVER_NAME(TGetInfoType.CLI_SERVER_NAME), - CLI_SEARCH_PATTERN_ESCAPE(TGetInfoType.CLI_SEARCH_PATTERN_ESCAPE), - CLI_DBMS_NAME(TGetInfoType.CLI_DBMS_NAME), - CLI_DBMS_VER(TGetInfoType.CLI_DBMS_VER), - CLI_ACCESSIBLE_TABLES(TGetInfoType.CLI_ACCESSIBLE_TABLES), - CLI_ACCESSIBLE_PROCEDURES(TGetInfoType.CLI_ACCESSIBLE_PROCEDURES), - CLI_CURSOR_COMMIT_BEHAVIOR(TGetInfoType.CLI_CURSOR_COMMIT_BEHAVIOR), - CLI_DATA_SOURCE_READ_ONLY(TGetInfoType.CLI_DATA_SOURCE_READ_ONLY), - CLI_DEFAULT_TXN_ISOLATION(TGetInfoType.CLI_DEFAULT_TXN_ISOLATION), - CLI_IDENTIFIER_CASE(TGetInfoType.CLI_IDENTIFIER_CASE), - CLI_IDENTIFIER_QUOTE_CHAR(TGetInfoType.CLI_IDENTIFIER_QUOTE_CHAR), - CLI_MAX_COLUMN_NAME_LEN(TGetInfoType.CLI_MAX_COLUMN_NAME_LEN), - CLI_MAX_CURSOR_NAME_LEN(TGetInfoType.CLI_MAX_CURSOR_NAME_LEN), - CLI_MAX_SCHEMA_NAME_LEN(TGetInfoType.CLI_MAX_SCHEMA_NAME_LEN), - CLI_MAX_CATALOG_NAME_LEN(TGetInfoType.CLI_MAX_CATALOG_NAME_LEN), - CLI_MAX_TABLE_NAME_LEN(TGetInfoType.CLI_MAX_TABLE_NAME_LEN), - CLI_SCROLL_CONCURRENCY(TGetInfoType.CLI_SCROLL_CONCURRENCY), - CLI_TXN_CAPABLE(TGetInfoType.CLI_TXN_CAPABLE), - CLI_USER_NAME(TGetInfoType.CLI_USER_NAME), - CLI_TXN_ISOLATION_OPTION(TGetInfoType.CLI_TXN_ISOLATION_OPTION), - CLI_INTEGRITY(TGetInfoType.CLI_INTEGRITY), - CLI_GETDATA_EXTENSIONS(TGetInfoType.CLI_GETDATA_EXTENSIONS), - CLI_NULL_COLLATION(TGetInfoType.CLI_NULL_COLLATION), - CLI_ALTER_TABLE(TGetInfoType.CLI_ALTER_TABLE), - CLI_ORDER_BY_COLUMNS_IN_SELECT(TGetInfoType.CLI_ORDER_BY_COLUMNS_IN_SELECT), - CLI_SPECIAL_CHARACTERS(TGetInfoType.CLI_SPECIAL_CHARACTERS), - CLI_MAX_COLUMNS_IN_GROUP_BY(TGetInfoType.CLI_MAX_COLUMNS_IN_GROUP_BY), - CLI_MAX_COLUMNS_IN_INDEX(TGetInfoType.CLI_MAX_COLUMNS_IN_INDEX), - CLI_MAX_COLUMNS_IN_ORDER_BY(TGetInfoType.CLI_MAX_COLUMNS_IN_ORDER_BY), - CLI_MAX_COLUMNS_IN_SELECT(TGetInfoType.CLI_MAX_COLUMNS_IN_SELECT), - CLI_MAX_COLUMNS_IN_TABLE(TGetInfoType.CLI_MAX_COLUMNS_IN_TABLE), - CLI_MAX_INDEX_SIZE(TGetInfoType.CLI_MAX_INDEX_SIZE), - CLI_MAX_ROW_SIZE(TGetInfoType.CLI_MAX_ROW_SIZE), - CLI_MAX_STATEMENT_LEN(TGetInfoType.CLI_MAX_STATEMENT_LEN), - CLI_MAX_TABLES_IN_SELECT(TGetInfoType.CLI_MAX_TABLES_IN_SELECT), - CLI_MAX_USER_NAME_LEN(TGetInfoType.CLI_MAX_USER_NAME_LEN), - CLI_OJ_CAPABILITIES(TGetInfoType.CLI_OJ_CAPABILITIES), - - CLI_XOPEN_CLI_YEAR(TGetInfoType.CLI_XOPEN_CLI_YEAR), - CLI_CURSOR_SENSITIVITY(TGetInfoType.CLI_CURSOR_SENSITIVITY), - CLI_DESCRIBE_PARAMETER(TGetInfoType.CLI_DESCRIBE_PARAMETER), - CLI_CATALOG_NAME(TGetInfoType.CLI_CATALOG_NAME), - CLI_COLLATION_SEQ(TGetInfoType.CLI_COLLATION_SEQ), - CLI_MAX_IDENTIFIER_LEN(TGetInfoType.CLI_MAX_IDENTIFIER_LEN); - - private final TGetInfoType tInfoType; - - GetInfoType(TGetInfoType tInfoType) { - this.tInfoType = tInfoType; - } - - public static GetInfoType getGetInfoType(TGetInfoType tGetInfoType) { - for (GetInfoType infoType : values()) { - if (tGetInfoType.equals(infoType.tInfoType)) { - return infoType; - } - } - throw new IllegalArgumentException("Unrecognized Thrift TGetInfoType value: " + tGetInfoType); - } - - public TGetInfoType toTGetInfoType() { - return tInfoType; - } - -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/GetInfoValue.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/GetInfoValue.java deleted file mode 100644 index 2b2359cc13c0f..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/GetInfoValue.java +++ /dev/null @@ -1,82 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli; - -import org.apache.hive.service.rpc.thrift.TGetInfoValue; - -/** - * GetInfoValue. - * - */ -public class GetInfoValue { - private String stringValue = null; - private short shortValue; - private int intValue; - private long longValue; - - public GetInfoValue(String stringValue) { - this.stringValue = stringValue; - } - - public GetInfoValue(short shortValue) { - this.shortValue = shortValue; - } - - public GetInfoValue(int intValue) { - this.intValue = intValue; - } - - public GetInfoValue(long longValue) { - this.longValue = longValue; - } - - public GetInfoValue(TGetInfoValue tGetInfoValue) { - switch (tGetInfoValue.getSetField()) { - case STRING_VALUE: - stringValue = tGetInfoValue.getStringValue(); - break; - default: - throw new IllegalArgumentException("Unreconigzed TGetInfoValue"); - } - } - - public TGetInfoValue toTGetInfoValue() { - TGetInfoValue tInfoValue = new TGetInfoValue(); - if (stringValue != null) { - tInfoValue.setStringValue(stringValue); - } - return tInfoValue; - } - - public String getStringValue() { - return stringValue; - } - - public short getShortValue() { - return shortValue; - } - - public int getIntValue() { - return intValue; - } - - public long getLongValue() { - return longValue; - } -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/ICLIService.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/ICLIService.java deleted file mode 100644 index 3200909477821..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/ICLIService.java +++ /dev/null @@ -1,113 +0,0 @@ -/** - * 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. - */ -package org.apache.hive.service.cli; - -import java.util.List; -import java.util.Map; - - - - -import org.apache.hive.service.auth.HiveAuthFactory; - -public interface ICLIService { - - SessionHandle openSession(String username, String password, - Map configuration) - throws HiveSQLException; - - SessionHandle openSessionWithImpersonation(String username, String password, - Map configuration, String delegationToken) - throws HiveSQLException; - - void closeSession(SessionHandle sessionHandle) - throws HiveSQLException; - - GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) - throws HiveSQLException; - - OperationHandle executeStatement(SessionHandle sessionHandle, String statement, - Map confOverlay) throws HiveSQLException; - - OperationHandle executeStatement(SessionHandle sessionHandle, String statement, - Map confOverlay, long queryTimeout) throws HiveSQLException; - - OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, - Map confOverlay) throws HiveSQLException; - OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, - Map confOverlay, long queryTimeout) throws HiveSQLException; - - OperationHandle getTypeInfo(SessionHandle sessionHandle) - throws HiveSQLException; - - OperationHandle getCatalogs(SessionHandle sessionHandle) - throws HiveSQLException; - - OperationHandle getSchemas(SessionHandle sessionHandle, - String catalogName, String schemaName) - throws HiveSQLException; - - OperationHandle getTables(SessionHandle sessionHandle, - String catalogName, String schemaName, String tableName, List tableTypes) - throws HiveSQLException; - - OperationHandle getTableTypes(SessionHandle sessionHandle) - throws HiveSQLException; - - OperationHandle getColumns(SessionHandle sessionHandle, - String catalogName, String schemaName, String tableName, String columnName) - throws HiveSQLException; - - OperationHandle getFunctions(SessionHandle sessionHandle, - String catalogName, String schemaName, String functionName) - throws HiveSQLException; - - OperationStatus getOperationStatus(OperationHandle opHandle) - throws HiveSQLException; - - void cancelOperation(OperationHandle opHandle) - throws HiveSQLException; - - void closeOperation(OperationHandle opHandle) - throws HiveSQLException; - - TableSchema getResultSetMetadata(OperationHandle opHandle) - throws HiveSQLException; - - RowSet fetchResults(OperationHandle opHandle) - throws HiveSQLException; - - RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, - long maxRows, FetchType fetchType) throws HiveSQLException; - - String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String owner, String renewer) throws HiveSQLException; - - void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException; - - void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException; - - OperationHandle getPrimaryKeys(SessionHandle sessionHandle, String catalog, - String schema, String table) throws HiveSQLException; - - OperationHandle getCrossReference(SessionHandle sessionHandle, - String primaryCatalog, String primarySchema, String primaryTable, - String foreignCatalog, String foreignSchema, String foreignTable) throws HiveSQLException; -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java deleted file mode 100644 index c25c742d392b3..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/GetColumnsOperation.java +++ /dev/null @@ -1,251 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.sql.DatabaseMetaData; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import java.util.regex.Pattern; - -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hadoop.hive.metastore.IMetaStoreClient; -import org.apache.hadoop.hive.metastore.api.PrimaryKeysRequest; -import org.apache.hadoop.hive.metastore.api.SQLPrimaryKey; -import org.apache.hadoop.hive.metastore.api.Table; -import org.apache.hadoop.hive.ql.metadata.TableIterable; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HiveOperationType; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject; -import org.apache.hadoop.hive.ql.security.authorization.plugin.HivePrivilegeObject.HivePrivilegeObjectType; -import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hadoop.hive.serde2.thrift.Type; -import org.apache.hive.service.cli.ColumnDescriptor; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationType; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; - -/** - * GetColumnsOperation. - * - */ -public class GetColumnsOperation extends MetadataOperation { - - protected static final TableSchema RESULT_SET_SCHEMA = new TableSchema() - .addPrimitiveColumn("TABLE_CAT", Type.STRING_TYPE, - "Catalog name. NULL if not applicable") - .addPrimitiveColumn("TABLE_SCHEM", Type.STRING_TYPE, - "Schema name") - .addPrimitiveColumn("TABLE_NAME", Type.STRING_TYPE, - "Table name") - .addPrimitiveColumn("COLUMN_NAME", Type.STRING_TYPE, - "Column name") - .addPrimitiveColumn("DATA_TYPE", Type.INT_TYPE, - "SQL type from java.sql.Types") - .addPrimitiveColumn("TYPE_NAME", Type.STRING_TYPE, - "Data source dependent type name, for a UDT the type name is fully qualified") - .addPrimitiveColumn("COLUMN_SIZE", Type.INT_TYPE, - "Column size. For char or date types this is the maximum number of characters," - + " for numeric or decimal types this is precision.") - .addPrimitiveColumn("BUFFER_LENGTH", Type.TINYINT_TYPE, - "Unused") - .addPrimitiveColumn("DECIMAL_DIGITS", Type.INT_TYPE, - "The number of fractional digits") - .addPrimitiveColumn("NUM_PREC_RADIX", Type.INT_TYPE, - "Radix (typically either 10 or 2)") - .addPrimitiveColumn("NULLABLE", Type.INT_TYPE, - "Is NULL allowed") - .addPrimitiveColumn("REMARKS", Type.STRING_TYPE, - "Comment describing column (may be null)") - .addPrimitiveColumn("COLUMN_DEF", Type.STRING_TYPE, - "Default value (may be null)") - .addPrimitiveColumn("SQL_DATA_TYPE", Type.INT_TYPE, - "Unused") - .addPrimitiveColumn("SQL_DATETIME_SUB", Type.INT_TYPE, - "Unused") - .addPrimitiveColumn("CHAR_OCTET_LENGTH", Type.INT_TYPE, - "For char types the maximum number of bytes in the column") - .addPrimitiveColumn("ORDINAL_POSITION", Type.INT_TYPE, - "Index of column in table (starting at 1)") - .addPrimitiveColumn("IS_NULLABLE", Type.STRING_TYPE, - "\"NO\" means column definitely does not allow NULL values; " - + "\"YES\" means the column might allow NULL values. An empty " - + "string means nobody knows.") - .addPrimitiveColumn("SCOPE_CATALOG", Type.STRING_TYPE, - "Catalog of table that is the scope of a reference attribute " - + "(null if DATA_TYPE isn't REF)") - .addPrimitiveColumn("SCOPE_SCHEMA", Type.STRING_TYPE, - "Schema of table that is the scope of a reference attribute " - + "(null if the DATA_TYPE isn't REF)") - .addPrimitiveColumn("SCOPE_TABLE", Type.STRING_TYPE, - "Table name that this the scope of a reference attribure " - + "(null if the DATA_TYPE isn't REF)") - .addPrimitiveColumn("SOURCE_DATA_TYPE", Type.SMALLINT_TYPE, - "Source type of a distinct type or user-generated Ref type, " - + "SQL type from java.sql.Types (null if DATA_TYPE isn't DISTINCT or user-generated REF)") - .addPrimitiveColumn("IS_AUTO_INCREMENT", Type.STRING_TYPE, - "Indicates whether this column is auto incremented."); - - private final String catalogName; - private final String schemaName; - private final String tableName; - private final String columnName; - - protected final RowSet rowSet; - - protected GetColumnsOperation(HiveSession parentSession, String catalogName, String schemaName, - String tableName, String columnName) { - super(parentSession, OperationType.GET_COLUMNS); - this.catalogName = catalogName; - this.schemaName = schemaName; - this.tableName = tableName; - this.columnName = columnName; - this.rowSet = RowSetFactory.create(RESULT_SET_SCHEMA, getProtocolVersion(), false); - } - - @Override - public void runInternal() throws HiveSQLException { - setState(OperationState.RUNNING); - try { - IMetaStoreClient metastoreClient = getParentSession().getMetaStoreClient(); - String schemaPattern = convertSchemaPattern(schemaName); - String tablePattern = convertIdentifierPattern(tableName, true); - - Pattern columnPattern = null; - if (columnName != null) { - columnPattern = Pattern.compile(convertIdentifierPattern(columnName, false)); - } - - List dbNames = metastoreClient.getDatabases(schemaPattern); - Collections.sort(dbNames); - Map> db2Tabs = new HashMap<>(); - - for (String dbName : dbNames) { - List tableNames = metastoreClient.getTables(dbName, tablePattern); - Collections.sort(tableNames); - db2Tabs.put(dbName, tableNames); - } - - if (isAuthV2Enabled()) { - List privObjs = getPrivObjs(db2Tabs); - String cmdStr = "catalog : " + catalogName + ", schemaPattern : " + schemaName - + ", tablePattern : " + tableName; - authorizeMetaGets(HiveOperationType.GET_COLUMNS, privObjs, cmdStr); - } - - int maxBatchSize = SessionState.get().getConf().getIntVar(ConfVars.METASTORE_BATCH_RETRIEVE_MAX); - for (Entry> dbTabs : db2Tabs.entrySet()) { - String dbName = dbTabs.getKey(); - List tableNames = dbTabs.getValue(); - - for (Table table : new TableIterable(metastoreClient, dbName, tableNames, maxBatchSize)) { - - TableSchema schema = new TableSchema(metastoreClient.getSchema(dbName, - table.getTableName())); - List primaryKeys = metastoreClient.getPrimaryKeys(new PrimaryKeysRequest(dbName, table.getTableName())); - Set pkColNames = new HashSet<>(); - for(SQLPrimaryKey key : primaryKeys) { - pkColNames.add(key.getColumn_name().toLowerCase()); - } - for (ColumnDescriptor column : schema.getColumnDescriptors()) { - if (columnPattern != null && !columnPattern.matcher(column.getName()).matches()) { - continue; - } - Object[] rowData = new Object[] { - null, // TABLE_CAT - table.getDbName(), // TABLE_SCHEM - table.getTableName(), // TABLE_NAME - column.getName(), // COLUMN_NAME - column.getType().toJavaSQLType(), // DATA_TYPE - column.getTypeName(), // TYPE_NAME - column.getTypeDescriptor().getColumnSize(), // COLUMN_SIZE - null, // BUFFER_LENGTH, unused - column.getTypeDescriptor().getDecimalDigits(), // DECIMAL_DIGITS - column.getType().getNumPrecRadix(), // NUM_PREC_RADIX - pkColNames.contains(column.getName().toLowerCase()) ? DatabaseMetaData.columnNoNulls - : DatabaseMetaData.columnNullable, // NULLABLE - column.getComment(), // REMARKS - null, // COLUMN_DEF - null, // SQL_DATA_TYPE - null, // SQL_DATETIME_SUB - null, // CHAR_OCTET_LENGTH - column.getOrdinalPosition(), // ORDINAL_POSITION - pkColNames.contains(column.getName().toLowerCase()) ? "NO" : "YES", // IS_NULLABLE - null, // SCOPE_CATALOG - null, // SCOPE_SCHEMA - null, // SCOPE_TABLE - null, // SOURCE_DATA_TYPE - "NO", // IS_AUTO_INCREMENT - }; - rowSet.addRow(rowData); - } - } - } - setState(OperationState.FINISHED); - } catch (Exception e) { - setState(OperationState.ERROR); - throw new HiveSQLException(e); - } - - } - - - private List getPrivObjs(Map> db2Tabs) { - List privObjs = new ArrayList<>(); - for (Entry> dbTabs : db2Tabs.entrySet()) { - for (String tabName : dbTabs.getValue()) { - privObjs.add(new HivePrivilegeObject(HivePrivilegeObjectType.TABLE_OR_VIEW, dbTabs.getKey(), - tabName)); - } - } - return privObjs; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getResultSetSchema() - */ - @Override - public TableSchema getResultSetSchema() throws HiveSQLException { - assertState(OperationState.FINISHED); - return RESULT_SET_SCHEMA; - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.Operation#getNextRowSet(org.apache.hive.service.cli.FetchOrientation, long) - */ - @Override - public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { - assertState(OperationState.FINISHED); - validateDefaultFetchOrientation(orientation); - if (orientation.equals(FetchOrientation.FETCH_FIRST)) { - rowSet.setStartOffset(0); - } - return rowSet.extractSubset((int)maxRows); - } - -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/Operation.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/Operation.java deleted file mode 100644 index f26c715add987..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/Operation.java +++ /dev/null @@ -1,347 +0,0 @@ -/** - * 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. - */ -package org.apache.hive.service.cli.operation; - -import java.io.File; -import java.io.FileNotFoundException; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; - -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.ql.QueryState; -import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; -import org.apache.hadoop.hive.ql.session.OperationLog; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationHandle; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationStatus; -import org.apache.hive.service.cli.OperationType; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; -import org.apache.hive.service.rpc.thrift.TProtocolVersion; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public abstract class Operation { - protected final HiveSession parentSession; - private OperationState state = OperationState.INITIALIZED; - private final OperationHandle opHandle; - private HiveConf configuration; - public static final Logger LOG = LoggerFactory.getLogger(Operation.class.getName()); - public static final FetchOrientation DEFAULT_FETCH_ORIENTATION = FetchOrientation.FETCH_NEXT; - public static final long DEFAULT_FETCH_MAX_ROWS = 100; - protected boolean hasResultSet; - protected volatile HiveSQLException operationException; - protected final boolean runAsync; - protected volatile Future backgroundHandle; - protected OperationLog operationLog; - protected boolean isOperationLogEnabled; - protected Map confOverlay = new HashMap(); - - private long operationTimeout; - private long lastAccessTime; - - protected final QueryState queryState; - - protected static final EnumSet DEFAULT_FETCH_ORIENTATION_SET = - EnumSet.of( - FetchOrientation.FETCH_NEXT, - FetchOrientation.FETCH_FIRST, - FetchOrientation.FETCH_PRIOR); - - protected Operation(HiveSession parentSession, OperationType opType) { - this(parentSession, null, opType); - } - - protected Operation(HiveSession parentSession, Map confOverlay, - OperationType opType) { - this(parentSession, confOverlay, opType, false); - } - - protected Operation(HiveSession parentSession, - Map confOverlay, OperationType opType, boolean runInBackground) { - this.parentSession = parentSession; - this.confOverlay = confOverlay; - this.runAsync = runInBackground; - this.opHandle = new OperationHandle(opType, parentSession.getProtocolVersion()); - lastAccessTime = System.currentTimeMillis(); - operationTimeout = HiveConf.getTimeVar(parentSession.getHiveConf(), - HiveConf.ConfVars.HIVE_SERVER2_IDLE_OPERATION_TIMEOUT, TimeUnit.MILLISECONDS); - queryState = new QueryState(parentSession.getHiveConf(), confOverlay, runInBackground); - } - - public Future getBackgroundHandle() { - return backgroundHandle; - } - - protected void setBackgroundHandle(Future backgroundHandle) { - this.backgroundHandle = backgroundHandle; - } - - public boolean shouldRunAsync() { - return runAsync; - } - - public void setConfiguration(HiveConf configuration) { - this.configuration = new HiveConf(configuration); - } - - public HiveConf getConfiguration() { - return new HiveConf(configuration); - } - - public HiveSession getParentSession() { - return parentSession; - } - - public OperationHandle getHandle() { - return opHandle; - } - - public TProtocolVersion getProtocolVersion() { - return opHandle.getProtocolVersion(); - } - - public OperationType getType() { - return opHandle.getOperationType(); - } - - public OperationStatus getStatus() { - return new OperationStatus(state, operationException); - } - - public boolean hasResultSet() { - return hasResultSet; - } - - protected void setHasResultSet(boolean hasResultSet) { - this.hasResultSet = hasResultSet; - opHandle.setHasResultSet(hasResultSet); - } - - public OperationLog getOperationLog() { - return operationLog; - } - - protected final OperationState setState(OperationState newState) throws HiveSQLException { - state.validateTransition(newState); - this.state = newState; - this.lastAccessTime = System.currentTimeMillis(); - return this.state; - } - - public boolean isTimedOut(long current) { - if (operationTimeout == 0) { - return false; - } - if (operationTimeout > 0) { - // check only when it's in terminal state - return state.isTerminal() && lastAccessTime + operationTimeout <= current; - } - return lastAccessTime + -operationTimeout <= current; - } - - public long getLastAccessTime() { - return lastAccessTime; - } - - public long getOperationTimeout() { - return operationTimeout; - } - - public void setOperationTimeout(long operationTimeout) { - this.operationTimeout = operationTimeout; - } - - protected void setOperationException(HiveSQLException operationException) { - this.operationException = operationException; - } - - protected final void assertState(OperationState state) throws HiveSQLException { - if (this.state != state) { - throw new HiveSQLException("Expected state " + state + ", but found " + this.state); - } - this.lastAccessTime = System.currentTimeMillis(); - } - - public boolean isRunning() { - return OperationState.RUNNING.equals(state); - } - - public boolean isFinished() { - return OperationState.FINISHED.equals(state); - } - - public boolean isCanceled() { - return OperationState.CANCELED.equals(state); - } - - public boolean isFailed() { - return OperationState.ERROR.equals(state); - } - - protected void createOperationLog() { - if (parentSession.isOperationLogEnabled()) { - File operationLogFile = new File(parentSession.getOperationLogSessionDir(), - opHandle.getHandleIdentifier().toString()); - isOperationLogEnabled = true; - - // create log file - try { - if (operationLogFile.exists()) { - LOG.warn("The operation log file should not exist, but it is already there: " + - operationLogFile.getAbsolutePath()); - operationLogFile.delete(); - } - if (!operationLogFile.createNewFile()) { - // the log file already exists and cannot be deleted. - // If it can be read/written, keep its contents and use it. - if (!operationLogFile.canRead() || !operationLogFile.canWrite()) { - LOG.warn("The already existed operation log file cannot be recreated, " + - "and it cannot be read or written: " + operationLogFile.getAbsolutePath()); - isOperationLogEnabled = false; - return; - } - } - } catch (Exception e) { - LOG.warn("Unable to create operation log file: " + operationLogFile.getAbsolutePath(), e); - isOperationLogEnabled = false; - return; - } - - // create OperationLog object with above log file - try { - operationLog = new OperationLog(opHandle.toString(), operationLogFile, parentSession.getHiveConf()); - } catch (FileNotFoundException e) { - LOG.warn("Unable to instantiate OperationLog object for operation: " + - opHandle, e); - isOperationLogEnabled = false; - return; - } - - // register this operationLog to current thread - OperationLog.setCurrentOperationLog(operationLog); - } - } - - protected void unregisterOperationLog() { - if (isOperationLogEnabled) { - OperationLog.removeCurrentOperationLog(); - } - } - - /** - * Invoked before runInternal(). - * Set up some preconditions, or configurations. - */ - protected void beforeRun() { - createOperationLog(); - } - - /** - * Invoked after runInternal(), even if an exception is thrown in runInternal(). - * Clean up resources, which was set up in beforeRun(). - */ - protected void afterRun() { - unregisterOperationLog(); - } - - /** - * Implemented by subclass of Operation class to execute specific behaviors. - * @throws HiveSQLException - */ - protected abstract void runInternal() throws HiveSQLException; - - public void run() throws HiveSQLException { - beforeRun(); - try { - runInternal(); - } finally { - afterRun(); - } - } - - protected void cleanupOperationLog() { - if (isOperationLogEnabled) { - if (operationLog == null) { - LOG.error("Operation [ " + opHandle.getHandleIdentifier() + " ] " - + "logging is enabled, but its OperationLog object cannot be found."); - } else { - operationLog.close(); - } - } - } - - // TODO: make this abstract and implement in subclasses. - public void cancel() throws HiveSQLException { - setState(OperationState.CANCELED); - throw new UnsupportedOperationException("SQLOperation.cancel()"); - } - - public abstract void close() throws HiveSQLException; - - public abstract TableSchema getResultSetSchema() throws HiveSQLException; - - public abstract RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException; - - public RowSet getNextRowSet() throws HiveSQLException { - return getNextRowSet(FetchOrientation.FETCH_NEXT, DEFAULT_FETCH_MAX_ROWS); - } - - /** - * Verify if the given fetch orientation is part of the default orientation types. - * @param orientation - * @throws HiveSQLException - */ - protected void validateDefaultFetchOrientation(FetchOrientation orientation) - throws HiveSQLException { - validateFetchOrientation(orientation, DEFAULT_FETCH_ORIENTATION_SET); - } - - /** - * Verify if the given fetch orientation is part of the supported orientation types. - * @param orientation - * @param supportedOrientations - * @throws HiveSQLException - */ - protected void validateFetchOrientation(FetchOrientation orientation, - EnumSet supportedOrientations) throws HiveSQLException { - if (!supportedOrientations.contains(orientation)) { - throw new HiveSQLException("The fetch type " + orientation.toString() + - " is not supported for this resultset", "HY106"); - } - } - - protected HiveSQLException toSQLException(String prefix, CommandProcessorResponse response) { - HiveSQLException ex = new HiveSQLException(prefix + ": " + response.getErrorMessage(), - response.getSQLState(), response.getResponseCode()); - if (response.getException() != null) { - ex.initCause(response.getException()); - } - return ex; - } - - protected Map getConfOverlay() { - return confOverlay; - } -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java deleted file mode 100644 index 75edc5763ce44..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/OperationManager.java +++ /dev/null @@ -1,309 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.api.FieldSchema; -import org.apache.hadoop.hive.metastore.api.Schema; -import org.apache.hadoop.hive.ql.session.OperationLog; -import org.apache.hive.service.AbstractService; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationHandle; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.OperationStatus; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; -import org.apache.log4j.Appender; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * OperationManager. - * - */ -public class OperationManager extends AbstractService { - private final Logger LOG = LoggerFactory.getLogger(OperationManager.class.getName()); - - private final Map handleToOperation = - new HashMap(); - - public OperationManager() { - super(OperationManager.class.getSimpleName()); - } - - @Override - public synchronized void init(HiveConf hiveConf) { - if (hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED)) { - initOperationLogCapture(hiveConf.getVar( - HiveConf.ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LEVEL)); - } else { - LOG.debug("Operation level logging is turned off"); - } - super.init(hiveConf); - } - - @Override - public synchronized void start() { - super.start(); - // TODO - } - - @Override - public synchronized void stop() { - // TODO - super.stop(); - } - - private void initOperationLogCapture(String loggingMode) { - // Register another Appender (with the same layout) that talks to us. - Appender ap = new LogDivertAppender(this, OperationLog.getLoggingLevel(loggingMode)); - org.apache.log4j.Logger.getRootLogger().addAppender(ap); - } - - public ExecuteStatementOperation newExecuteStatementOperation(HiveSession parentSession, - String statement, Map confOverlay, boolean runAsync) - throws HiveSQLException { - ExecuteStatementOperation executeStatementOperation = ExecuteStatementOperation - .newExecuteStatementOperation(parentSession, statement, confOverlay, runAsync, 0); - addOperation(executeStatementOperation); - return executeStatementOperation; - } - - public ExecuteStatementOperation newExecuteStatementOperation(HiveSession parentSession, - String statement, Map confOverlay, boolean runAsync, long queryTimeout) - throws HiveSQLException { - return newExecuteStatementOperation(parentSession, statement, confOverlay, runAsync); - } - - public GetTypeInfoOperation newGetTypeInfoOperation(HiveSession parentSession) { - GetTypeInfoOperation operation = new GetTypeInfoOperation(parentSession); - addOperation(operation); - return operation; - } - - public GetCatalogsOperation newGetCatalogsOperation(HiveSession parentSession) { - GetCatalogsOperation operation = new GetCatalogsOperation(parentSession); - addOperation(operation); - return operation; - } - - public GetSchemasOperation newGetSchemasOperation(HiveSession parentSession, - String catalogName, String schemaName) { - GetSchemasOperation operation = new GetSchemasOperation(parentSession, catalogName, schemaName); - addOperation(operation); - return operation; - } - - public MetadataOperation newGetTablesOperation(HiveSession parentSession, - String catalogName, String schemaName, String tableName, - List tableTypes) { - MetadataOperation operation = - new GetTablesOperation(parentSession, catalogName, schemaName, tableName, tableTypes); - addOperation(operation); - return operation; - } - - public GetTableTypesOperation newGetTableTypesOperation(HiveSession parentSession) { - GetTableTypesOperation operation = new GetTableTypesOperation(parentSession); - addOperation(operation); - return operation; - } - - public GetColumnsOperation newGetColumnsOperation(HiveSession parentSession, - String catalogName, String schemaName, String tableName, String columnName) { - GetColumnsOperation operation = new GetColumnsOperation(parentSession, - catalogName, schemaName, tableName, columnName); - addOperation(operation); - return operation; - } - - public GetFunctionsOperation newGetFunctionsOperation(HiveSession parentSession, - String catalogName, String schemaName, String functionName) { - GetFunctionsOperation operation = new GetFunctionsOperation(parentSession, - catalogName, schemaName, functionName); - addOperation(operation); - return operation; - } - - public GetPrimaryKeysOperation newGetPrimaryKeysOperation(HiveSession parentSession, - String catalogName, String schemaName, String tableName) { - GetPrimaryKeysOperation operation = new GetPrimaryKeysOperation(parentSession, - catalogName, schemaName, tableName); - addOperation(operation); - return operation; - } - - public GetCrossReferenceOperation newGetCrossReferenceOperation( - HiveSession session, String primaryCatalog, String primarySchema, - String primaryTable, String foreignCatalog, String foreignSchema, - String foreignTable) { - GetCrossReferenceOperation operation = new GetCrossReferenceOperation(session, - primaryCatalog, primarySchema, primaryTable, foreignCatalog, foreignSchema, - foreignTable); - addOperation(operation); - return operation; - } - - public Operation getOperation(OperationHandle operationHandle) throws HiveSQLException { - Operation operation = getOperationInternal(operationHandle); - if (operation == null) { - throw new HiveSQLException("Invalid OperationHandle: " + operationHandle); - } - return operation; - } - - private synchronized Operation getOperationInternal(OperationHandle operationHandle) { - return handleToOperation.get(operationHandle); - } - - private synchronized Operation removeTimedOutOperation(OperationHandle operationHandle) { - Operation operation = handleToOperation.get(operationHandle); - if (operation != null && operation.isTimedOut(System.currentTimeMillis())) { - handleToOperation.remove(operationHandle); - return operation; - } - return null; - } - - private synchronized void addOperation(Operation operation) { - handleToOperation.put(operation.getHandle(), operation); - } - - private synchronized Operation removeOperation(OperationHandle opHandle) { - return handleToOperation.remove(opHandle); - } - - public OperationStatus getOperationStatus(OperationHandle opHandle) - throws HiveSQLException { - return getOperation(opHandle).getStatus(); - } - - public void cancelOperation(OperationHandle opHandle) throws HiveSQLException { - Operation operation = getOperation(opHandle); - OperationState opState = operation.getStatus().getState(); - if (opState == OperationState.CANCELED || - opState == OperationState.CLOSED || - opState == OperationState.FINISHED || - opState == OperationState.ERROR || - opState == OperationState.UNKNOWN) { - // Cancel should be a no-op in either cases - LOG.debug(opHandle + ": Operation is already aborted in state - " + opState); - } - else { - LOG.debug(opHandle + ": Attempting to cancel from state - " + opState); - operation.cancel(); - } - } - - public void closeOperation(OperationHandle opHandle) throws HiveSQLException { - Operation operation = removeOperation(opHandle); - if (operation == null) { - throw new HiveSQLException("Operation does not exist!"); - } - operation.close(); - } - - public TableSchema getOperationResultSetSchema(OperationHandle opHandle) - throws HiveSQLException { - return getOperation(opHandle).getResultSetSchema(); - } - - public RowSet getOperationNextRowSet(OperationHandle opHandle) - throws HiveSQLException { - return getOperation(opHandle).getNextRowSet(); - } - - public RowSet getOperationNextRowSet(OperationHandle opHandle, - FetchOrientation orientation, long maxRows) - throws HiveSQLException { - return getOperation(opHandle).getNextRowSet(orientation, maxRows); - } - - public RowSet getOperationLogRowSet(OperationHandle opHandle, - FetchOrientation orientation, long maxRows) - throws HiveSQLException { - // get the OperationLog object from the operation - OperationLog operationLog = getOperation(opHandle).getOperationLog(); - if (operationLog == null) { - throw new HiveSQLException("Couldn't find log associated with operation handle: " + opHandle); - } - - // read logs - List logs; - try { - logs = operationLog.readOperationLog(isFetchFirst(orientation), maxRows); - } catch (SQLException e) { - throw new HiveSQLException(e.getMessage(), e.getCause()); - } - - - // convert logs to RowSet - TableSchema tableSchema = new TableSchema(getLogSchema()); - RowSet rowSet = RowSetFactory.create(tableSchema, - getOperation(opHandle).getProtocolVersion(), false); - for (String log : logs) { - rowSet.addRow(new String[] {log}); - } - - return rowSet; - } - - private boolean isFetchFirst(FetchOrientation fetchOrientation) { - //TODO: Since OperationLog is moved to package o.a.h.h.ql.session, - // we may add a Enum there and map FetchOrientation to it. - if (fetchOrientation.equals(FetchOrientation.FETCH_FIRST)) { - return true; - } - return false; - } - - private Schema getLogSchema() { - Schema schema = new Schema(); - FieldSchema fieldSchema = new FieldSchema(); - fieldSchema.setName("operation_log"); - fieldSchema.setType("string"); - schema.addToFieldSchemas(fieldSchema); - return schema; - } - - public OperationLog getOperationLogByThread() { - return OperationLog.getCurrentOperationLog(); - } - - public List removeExpiredOperations(OperationHandle[] handles) { - List removed = new ArrayList(); - for (OperationHandle handle : handles) { - Operation operation = removeTimedOutOperation(handle); - if (operation != null) { - LOG.warn("Operation " + handle + " is timed-out and will be closed"); - removed.add(operation); - } - } - return removed; - } -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java deleted file mode 100644 index e2ac1ea78c1ab..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/operation/SQLOperation.java +++ /dev/null @@ -1,456 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.operation; - -import java.io.IOException; -import java.io.Serializable; -import java.security.PrivilegedExceptionAction; -import java.sql.SQLException; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.concurrent.Future; -import java.util.concurrent.RejectedExecutionException; - -import static java.nio.charset.StandardCharsets.UTF_8; - -import org.apache.commons.codec.binary.Base64; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.metastore.api.FieldSchema; -import org.apache.hadoop.hive.metastore.api.Schema; -import org.apache.hadoop.hive.ql.CommandNeedRetryException; -import org.apache.hadoop.hive.ql.Driver; -import org.apache.hadoop.hive.ql.QueryState; -import org.apache.hadoop.hive.ql.exec.ExplainTask; -import org.apache.hadoop.hive.ql.exec.Task; -import org.apache.hadoop.hive.ql.metadata.Hive; -import org.apache.hadoop.hive.ql.metadata.HiveException; -import org.apache.hadoop.hive.ql.processors.CommandProcessorResponse; -import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hadoop.hive.serde.serdeConstants; -import org.apache.hadoop.hive.serde2.AbstractSerDe; -import org.apache.hadoop.hive.serde2.SerDeException; -import org.apache.hadoop.hive.serde2.SerDeUtils; -import org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe; -import org.apache.hadoop.hive.serde2.objectinspector.ObjectInspector; -import org.apache.hadoop.hive.serde2.objectinspector.StructField; -import org.apache.hadoop.hive.serde2.objectinspector.StructObjectInspector; -import org.apache.hadoop.hive.shims.Utils; -import org.apache.hadoop.io.BytesWritable; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationState; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.RowSetFactory; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.session.HiveSession; -import org.apache.hive.service.server.ThreadWithGarbageCleanup; - -/** - * SQLOperation. - * - */ -public class SQLOperation extends ExecuteStatementOperation { - - private Driver driver = null; - private CommandProcessorResponse response; - private TableSchema resultSchema = null; - private Schema mResultSchema = null; - private AbstractSerDe serde = null; - private boolean fetchStarted = false; - - public SQLOperation(HiveSession parentSession, String statement, Map confOverlay, - boolean runInBackground, long queryTimeout) { - // TODO: call setRemoteUser in ExecuteStatementOperation or higher. - super(parentSession, statement, confOverlay, runInBackground); - } - - /*** - * Compile the query and extract metadata - * @param queryState - * @throws HiveSQLException - */ - public void prepare(QueryState queryState) throws HiveSQLException { - setState(OperationState.RUNNING); - - try { - driver = new Driver(queryState, getParentSession().getUserName()); - - // set the operation handle information in Driver, so that thrift API users - // can use the operation handle they receive, to lookup query information in - // Yarn ATS - String guid64 = Base64.encodeBase64URLSafeString(getHandle().getHandleIdentifier() - .toTHandleIdentifier().getGuid()).trim(); - driver.setOperationId(guid64); - - // In Hive server mode, we are not able to retry in the FetchTask - // case, when calling fetch queries since execute() has returned. - // For now, we disable the test attempts. - driver.setTryCount(Integer.MAX_VALUE); - - response = driver.compileAndRespond(statement); - if (0 != response.getResponseCode()) { - throw toSQLException("Error while compiling statement", response); - } - - mResultSchema = driver.getSchema(); - - // hasResultSet should be true only if the query has a FetchTask - // "explain" is an exception for now - if(driver.getPlan().getFetchTask() != null) { - //Schema has to be set - if (mResultSchema == null || !mResultSchema.isSetFieldSchemas()) { - throw new HiveSQLException("Error compiling query: Schema and FieldSchema " + - "should be set when query plan has a FetchTask"); - } - resultSchema = new TableSchema(mResultSchema); - setHasResultSet(true); - } else { - setHasResultSet(false); - } - // Set hasResultSet true if the plan has ExplainTask - // TODO explain should use a FetchTask for reading - for (Task task: driver.getPlan().getRootTasks()) { - if (task.getClass() == ExplainTask.class) { - resultSchema = new TableSchema(mResultSchema); - setHasResultSet(true); - break; - } - } - } catch (HiveSQLException e) { - setState(OperationState.ERROR); - throw e; - } catch (Exception e) { - setState(OperationState.ERROR); - throw new HiveSQLException("Error running query: " + e.toString(), e); - } - } - - private void runQuery(HiveConf sqlOperationConf) throws HiveSQLException { - try { - // In Hive server mode, we are not able to retry in the FetchTask - // case, when calling fetch queries since execute() has returned. - // For now, we disable the test attempts. - driver.setTryCount(Integer.MAX_VALUE); - response = driver.run(); - if (0 != response.getResponseCode()) { - throw toSQLException("Error while processing statement", response); - } - } catch (HiveSQLException e) { - // If the operation was cancelled by another thread, - // Driver#run will return a non-zero response code. - // We will simply return if the operation state is CANCELED, - // otherwise throw an exception - if (getStatus().getState() == OperationState.CANCELED) { - return; - } - else { - setState(OperationState.ERROR); - throw e; - } - } catch (Exception e) { - setState(OperationState.ERROR); - throw new HiveSQLException("Error running query: " + e.toString(), e); - } - setState(OperationState.FINISHED); - } - - @Override - public void runInternal() throws HiveSQLException { - setState(OperationState.PENDING); - final HiveConf opConfig = getConfigForOperation(); - prepare(queryState); - if (!shouldRunAsync()) { - runQuery(opConfig); - } else { - // We'll pass ThreadLocals in the background thread from the foreground (handler) thread - final SessionState parentSessionState = SessionState.get(); - // ThreadLocal Hive object needs to be set in background thread. - // The metastore client in Hive is associated with right user. - final Hive parentHive = getSessionHive(); - // Current UGI will get used by metastore when metsatore is in embedded mode - // So this needs to get passed to the new background thread - final UserGroupInformation currentUGI = getCurrentUGI(opConfig); - // Runnable impl to call runInternal asynchronously, - // from a different thread - Runnable backgroundOperation = new Runnable() { - @Override - public void run() { - PrivilegedExceptionAction doAsAction = new PrivilegedExceptionAction() { - @Override - public Object run() throws HiveSQLException { - Hive.set(parentHive); - SessionState.setCurrentSessionState(parentSessionState); - // Set current OperationLog in this async thread for keeping on saving query log. - registerCurrentOperationLog(); - try { - runQuery(opConfig); - } catch (HiveSQLException e) { - setOperationException(e); - LOG.error("Error running hive query: ", e); - } finally { - unregisterOperationLog(); - } - return null; - } - }; - - try { - currentUGI.doAs(doAsAction); - } catch (Exception e) { - setOperationException(new HiveSQLException(e)); - LOG.error("Error running hive query as user : " + currentUGI.getShortUserName(), e); - } - finally { - /** - * We'll cache the ThreadLocal RawStore object for this background thread for an orderly cleanup - * when this thread is garbage collected later. - * @see org.apache.hive.service.server.ThreadWithGarbageCleanup#finalize() - */ - if (ThreadWithGarbageCleanup.currentThread() instanceof ThreadWithGarbageCleanup) { - ThreadWithGarbageCleanup currentThread = - (ThreadWithGarbageCleanup) ThreadWithGarbageCleanup.currentThread(); - currentThread.cacheThreadLocalRawStore(); - } - } - } - }; - try { - // This submit blocks if no background threads are available to run this operation - Future backgroundHandle = - getParentSession().getSessionManager().submitBackgroundOperation(backgroundOperation); - setBackgroundHandle(backgroundHandle); - } catch (RejectedExecutionException rejected) { - setState(OperationState.ERROR); - throw new HiveSQLException("The background threadpool cannot accept" + - " new task for execution, please retry the operation", rejected); - } - } - } - - /** - * Returns the current UGI on the stack - * @param opConfig - * @return UserGroupInformation - * @throws HiveSQLException - */ - private UserGroupInformation getCurrentUGI(HiveConf opConfig) throws HiveSQLException { - try { - return Utils.getUGI(); - } catch (Exception e) { - throw new HiveSQLException("Unable to get current user", e); - } - } - - /** - * Returns the ThreadLocal Hive for the current thread - * @return Hive - * @throws HiveSQLException - */ - private Hive getSessionHive() throws HiveSQLException { - try { - return Hive.get(); - } catch (HiveException e) { - throw new HiveSQLException("Failed to get ThreadLocal Hive object", e); - } - } - - private void cleanup(OperationState state) throws HiveSQLException { - setState(state); - if (shouldRunAsync()) { - Future backgroundHandle = getBackgroundHandle(); - if (backgroundHandle != null) { - backgroundHandle.cancel(true); - } - } - if (driver != null) { - driver.close(); - driver.destroy(); - } - driver = null; - - SessionState ss = SessionState.get(); - if (ss.getTmpOutputFile() != null) { - ss.getTmpOutputFile().delete(); - } - } - - @Override - public void cancel() throws HiveSQLException { - cleanup(OperationState.CANCELED); - } - - @Override - public void close() throws HiveSQLException { - cleanup(OperationState.CLOSED); - cleanupOperationLog(); - } - - @Override - public TableSchema getResultSetSchema() throws HiveSQLException { - assertState(OperationState.FINISHED); - if (resultSchema == null) { - resultSchema = new TableSchema(driver.getSchema()); - } - return resultSchema; - } - - private final transient List convey = new ArrayList(); - - @Override - public RowSet getNextRowSet(FetchOrientation orientation, long maxRows) throws HiveSQLException { - validateDefaultFetchOrientation(orientation); - assertState(OperationState.FINISHED); - - RowSet rowSet = RowSetFactory.create(resultSchema, getProtocolVersion(), false); - - try { - /* if client is requesting fetch-from-start and its not the first time reading from this operation - * then reset the fetch position to beginning - */ - if (orientation.equals(FetchOrientation.FETCH_FIRST) && fetchStarted) { - driver.resetFetch(); - } - fetchStarted = true; - driver.setMaxRows((int) maxRows); - if (driver.getResults(convey)) { - return decode(convey, rowSet); - } - return rowSet; - } catch (IOException e) { - throw new HiveSQLException(e); - } catch (CommandNeedRetryException e) { - throw new HiveSQLException(e); - } catch (Exception e) { - throw new HiveSQLException(e); - } finally { - convey.clear(); - } - } - - private RowSet decode(List rows, RowSet rowSet) throws Exception { - if (driver.isFetchingTable()) { - return prepareFromRow(rows, rowSet); - } - return decodeFromString(rows, rowSet); - } - - // already encoded to thrift-able object in ThriftFormatter - private RowSet prepareFromRow(List rows, RowSet rowSet) throws Exception { - for (Object row : rows) { - rowSet.addRow((Object[]) row); - } - return rowSet; - } - - private RowSet decodeFromString(List rows, RowSet rowSet) - throws SQLException, SerDeException { - getSerDe(); - StructObjectInspector soi = (StructObjectInspector) serde.getObjectInspector(); - List fieldRefs = soi.getAllStructFieldRefs(); - - Object[] deserializedFields = new Object[fieldRefs.size()]; - Object rowObj; - ObjectInspector fieldOI; - - int protocol = getProtocolVersion().getValue(); - for (Object rowString : rows) { - rowObj = serde.deserialize(new BytesWritable(((String)rowString).getBytes(UTF_8))); - for (int i = 0; i < fieldRefs.size(); i++) { - StructField fieldRef = fieldRefs.get(i); - fieldOI = fieldRef.getFieldObjectInspector(); - Object fieldData = soi.getStructFieldData(rowObj, fieldRef); - deserializedFields[i] = SerDeUtils.toThriftPayload(fieldData, fieldOI, protocol); - } - rowSet.addRow(deserializedFields); - } - return rowSet; - } - - private AbstractSerDe getSerDe() throws SQLException { - if (serde != null) { - return serde; - } - try { - List fieldSchemas = mResultSchema.getFieldSchemas(); - StringBuilder namesSb = new StringBuilder(); - StringBuilder typesSb = new StringBuilder(); - - if (fieldSchemas != null && !fieldSchemas.isEmpty()) { - for (int pos = 0; pos < fieldSchemas.size(); pos++) { - if (pos != 0) { - namesSb.append(","); - typesSb.append(","); - } - namesSb.append(fieldSchemas.get(pos).getName()); - typesSb.append(fieldSchemas.get(pos).getType()); - } - } - String names = namesSb.toString(); - String types = typesSb.toString(); - - serde = new LazySimpleSerDe(); - Properties props = new Properties(); - if (names.length() > 0) { - LOG.debug("Column names: " + names); - props.setProperty(serdeConstants.LIST_COLUMNS, names); - } - if (types.length() > 0) { - LOG.debug("Column types: " + types); - props.setProperty(serdeConstants.LIST_COLUMN_TYPES, types); - } - SerDeUtils.initializeSerDe(serde, new HiveConf(), props, null); - - } catch (Exception ex) { - ex.printStackTrace(); - throw new SQLException("Could not create ResultSet: " + ex.getMessage(), ex); - } - return serde; - } - - /** - * If there are query specific settings to overlay, then create a copy of config - * There are two cases we need to clone the session config that's being passed to hive driver - * 1. Async query - - * If the client changes a config setting, that shouldn't reflect in the execution already underway - * 2. confOverlay - - * The query specific settings should only be applied to the query config and not session - * @return new configuration - * @throws HiveSQLException - */ - private HiveConf getConfigForOperation() throws HiveSQLException { - HiveConf sqlOperationConf = getParentSession().getHiveConf(); - if (!getConfOverlay().isEmpty() || shouldRunAsync()) { - // clone the parent session config for this query - sqlOperationConf = new HiveConf(sqlOperationConf); - - // apply overlay query specific settings, if any - for (Map.Entry confEntry : getConfOverlay().entrySet()) { - try { - sqlOperationConf.verifyAndSet(confEntry.getKey(), confEntry.getValue()); - } catch (IllegalArgumentException e) { - throw new HiveSQLException("Error applying statement specific settings", e); - } - } - } - return sqlOperationConf; - } -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java deleted file mode 100644 index 14e9c4704c977..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/HiveSessionImpl.java +++ /dev/null @@ -1,893 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.session; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.lang3.StringUtils; -import org.apache.hadoop.hive.common.cli.HiveFileProcessor; -import org.apache.hadoop.hive.common.cli.IHiveFileProcessor; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hadoop.hive.conf.VariableSubstitution; -import org.apache.hadoop.hive.metastore.IMetaStoreClient; -import org.apache.hadoop.hive.metastore.api.MetaException; -import org.apache.hadoop.hive.ql.exec.Utilities; -import org.apache.hadoop.hive.ql.history.HiveHistory; -import org.apache.hadoop.hive.ql.metadata.Hive; -import org.apache.hadoop.hive.ql.metadata.HiveException; -import org.apache.hadoop.hive.ql.session.SessionState; -import org.apache.hadoop.hive.serde2.SerDeUtils; -import org.apache.hadoop.hive.serde2.thrift.ThriftFormatter; -import org.apache.hadoop.hive.shims.ShimLoader; -import org.apache.hive.common.util.HiveVersionInfo; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.cli.FetchOrientation; -import org.apache.hive.service.cli.FetchType; -import org.apache.hive.service.cli.GetInfoType; -import org.apache.hive.service.cli.GetInfoValue; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.OperationHandle; -import org.apache.hive.service.cli.RowSet; -import org.apache.hive.service.cli.SessionHandle; -import org.apache.hive.service.cli.TableSchema; -import org.apache.hive.service.cli.operation.ExecuteStatementOperation; -import org.apache.hive.service.cli.operation.GetCatalogsOperation; -import org.apache.hive.service.cli.operation.GetColumnsOperation; -import org.apache.hive.service.cli.operation.GetCrossReferenceOperation; -import org.apache.hive.service.cli.operation.GetFunctionsOperation; -import org.apache.hive.service.cli.operation.GetPrimaryKeysOperation; -import org.apache.hive.service.cli.operation.GetSchemasOperation; -import org.apache.hive.service.cli.operation.GetTableTypesOperation; -import org.apache.hive.service.cli.operation.GetTypeInfoOperation; -import org.apache.hive.service.cli.operation.MetadataOperation; -import org.apache.hive.service.cli.operation.Operation; -import org.apache.hive.service.cli.operation.OperationManager; -import org.apache.hive.service.rpc.thrift.TProtocolVersion; -import org.apache.hive.service.server.ThreadWithGarbageCleanup; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import static org.apache.hadoop.hive.conf.SystemVariables.ENV_PREFIX; -import static org.apache.hadoop.hive.conf.SystemVariables.HIVECONF_PREFIX; -import static org.apache.hadoop.hive.conf.SystemVariables.HIVEVAR_PREFIX; -import static org.apache.hadoop.hive.conf.SystemVariables.METACONF_PREFIX; -import static org.apache.hadoop.hive.conf.SystemVariables.SYSTEM_PREFIX; - -/** - * HiveSession - * - */ -public class HiveSessionImpl implements HiveSession { - private final SessionHandle sessionHandle; - private String username; - private final String password; - private HiveConf hiveConf; - private SessionState sessionState; - private String ipAddress; - private static final String FETCH_WORK_SERDE_CLASS = - "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe"; - private static final Logger LOG = LoggerFactory.getLogger(HiveSessionImpl.class); - private SessionManager sessionManager; - private OperationManager operationManager; - private final Set opHandleSet = new HashSet(); - private boolean isOperationLogEnabled; - private File sessionLogDir; - private volatile long lastAccessTime; - private volatile long lastIdleTime; - - public HiveSessionImpl(TProtocolVersion protocol, String username, String password, - HiveConf serverhiveConf, String ipAddress) { - this.username = username; - this.password = password; - this.sessionHandle = new SessionHandle(protocol); - this.hiveConf = new HiveConf(serverhiveConf); - this.ipAddress = ipAddress; - - try { - // In non-impersonation mode, map scheduler queue to current user - // if fair scheduler is configured. - if (! hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS) && - hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_MAP_FAIR_SCHEDULER_QUEUE)) { - ShimLoader.getHadoopShims().refreshDefaultQueue(hiveConf, username); - } - } catch (IOException e) { - LOG.warn("Error setting scheduler queue: " + e, e); - } - // Set an explicit session name to control the download directory name - hiveConf.set(ConfVars.HIVESESSIONID.varname, - sessionHandle.getHandleIdentifier().toString()); - // Use thrift transportable formatter - hiveConf.set(SerDeUtils.LIST_SINK_OUTPUT_FORMATTER, ThriftFormatter.class.getName()); - hiveConf.setInt(SerDeUtils.LIST_SINK_OUTPUT_PROTOCOL, protocol.getValue()); - } - - @Override - /** - * Opens a new HiveServer2 session for the client connection. - * Creates a new SessionState object that will be associated with this HiveServer2 session. - * When the server executes multiple queries in the same session, - * this SessionState object is reused across multiple queries. - * Note that if doAs is true, this call goes through a proxy object, - * which wraps the method logic in a UserGroupInformation#doAs. - * That's why it is important to create SessionState here rather than in the constructor. - */ - public void open(Map sessionConfMap) throws HiveSQLException { - sessionState = new SessionState(hiveConf, username); - sessionState.setUserIpAddress(ipAddress); - sessionState.setIsHiveServerQuery(true); - SessionState.start(sessionState); - try { - sessionState.loadAuxJars(); - sessionState.loadReloadableAuxJars(); - } catch (IOException e) { - String msg = "Failed to load reloadable jar file path: " + e; - LOG.error(msg, e); - throw new HiveSQLException(msg, e); - } - // Process global init file: .hiverc - processGlobalInitFile(); - if (sessionConfMap != null) { - configureSession(sessionConfMap); - } - lastAccessTime = System.currentTimeMillis(); - lastIdleTime = lastAccessTime; - } - - /** - * It is used for processing hiverc file from HiveServer2 side. - */ - private class GlobalHivercFileProcessor extends HiveFileProcessor { - @Override - protected BufferedReader loadFile(String fileName) throws IOException { - FileInputStream initStream = null; - BufferedReader bufferedReader = null; - initStream = new FileInputStream(fileName); - bufferedReader = new BufferedReader(new InputStreamReader(initStream)); - return bufferedReader; - } - - @Override - protected int processCmd(String cmd) { - int rc = 0; - String cmd_trimed = cmd.trim(); - try { - executeStatementInternal(cmd_trimed, null, false, 0); - } catch (HiveSQLException e) { - rc = -1; - LOG.warn("Failed to execute HQL command in global .hiverc file.", e); - } - return rc; - } - } - - private void processGlobalInitFile() { - IHiveFileProcessor processor = new GlobalHivercFileProcessor(); - - try { - String hiverc = hiveConf.getVar(ConfVars.HIVE_SERVER2_GLOBAL_INIT_FILE_LOCATION); - if (hiverc != null) { - File hivercFile = new File(hiverc); - if (hivercFile.isDirectory()) { - hivercFile = new File(hivercFile, SessionManager.HIVERCFILE); - } - if (hivercFile.isFile()) { - LOG.info("Running global init file: " + hivercFile); - int rc = processor.processFile(hivercFile.getAbsolutePath()); - if (rc != 0) { - LOG.error("Failed on initializing global .hiverc file"); - } - } else { - LOG.debug("Global init file " + hivercFile + " does not exist"); - } - } - } catch (IOException e) { - LOG.warn("Failed on initializing global .hiverc file", e); - } - } - - private void configureSession(Map sessionConfMap) throws HiveSQLException { - SessionState.setCurrentSessionState(sessionState); - for (Map.Entry entry : sessionConfMap.entrySet()) { - String key = entry.getKey(); - if (key.startsWith("set:")) { - try { - setVariable(key.substring(4), entry.getValue()); - } catch (Exception e) { - throw new HiveSQLException(e); - } - } else if (key.startsWith("use:")) { - SessionState.get().setCurrentDatabase(entry.getValue()); - } else { - hiveConf.verifyAndSet(key, entry.getValue()); - } - } - } - - // Copy from org.apache.hadoop.hive.ql.processors.SetProcessor, only change: - // setConf(varname, propName, varvalue, true) when varname.startsWith(HIVECONF_PREFIX) - public static int setVariable(String varname, String varvalue) throws Exception { - SessionState ss = SessionState.get(); - VariableSubstitution substitution = new VariableSubstitution(() -> ss.getHiveVariables()); - if (varvalue.contains("\n")){ - ss.err.println("Warning: Value had a \\n character in it."); - } - varname = varname.trim(); - if (varname.startsWith(ENV_PREFIX)){ - ss.err.println("env:* variables can not be set."); - return 1; - } else if (varname.startsWith(SYSTEM_PREFIX)){ - String propName = varname.substring(SYSTEM_PREFIX.length()); - System.getProperties().setProperty(propName, substitution.substitute(ss.getConf(),varvalue)); - } else if (varname.startsWith(HIVECONF_PREFIX)){ - String propName = varname.substring(HIVECONF_PREFIX.length()); - setConf(varname, propName, varvalue, true); - } else if (varname.startsWith(HIVEVAR_PREFIX)) { - String propName = varname.substring(HIVEVAR_PREFIX.length()); - ss.getHiveVariables().put(propName, substitution.substitute(ss.getConf(),varvalue)); - } else if (varname.startsWith(METACONF_PREFIX)) { - String propName = varname.substring(METACONF_PREFIX.length()); - Hive hive = Hive.get(ss.getConf()); - hive.setMetaConf(propName, substitution.substitute(ss.getConf(), varvalue)); - } else { - setConf(varname, varname, varvalue, true); - } - return 0; - } - - // returns non-null string for validation fail - private static void setConf(String varname, String key, String varvalue, boolean register) - throws IllegalArgumentException { - VariableSubstitution substitution = - new VariableSubstitution(() -> SessionState.get().getHiveVariables()); - HiveConf conf = SessionState.get().getConf(); - String value = substitution.substitute(conf, varvalue); - if (conf.getBoolVar(HiveConf.ConfVars.HIVECONFVALIDATION)) { - HiveConf.ConfVars confVars = HiveConf.getConfVars(key); - if (confVars != null) { - if (!confVars.isType(value)) { - StringBuilder message = new StringBuilder(); - message.append("'SET ").append(varname).append('=').append(varvalue); - message.append("' FAILED because ").append(key).append(" expects "); - message.append(confVars.typeString()).append(" type value."); - throw new IllegalArgumentException(message.toString()); - } - String fail = confVars.validate(value); - if (fail != null) { - StringBuilder message = new StringBuilder(); - message.append("'SET ").append(varname).append('=').append(varvalue); - message.append("' FAILED in validation : ").append(fail).append('.'); - throw new IllegalArgumentException(message.toString()); - } - } else if (key.startsWith("hive.")) { - throw new IllegalArgumentException("hive configuration " + key + " does not exists."); - } - } - conf.verifyAndSet(key, value); - if (register) { - SessionState.get().getOverriddenConfigurations().put(key, value); - } - } - - @Override - public void setOperationLogSessionDir(File operationLogRootDir) { - if (!operationLogRootDir.exists()) { - LOG.warn("The operation log root directory is removed, recreating: " + - operationLogRootDir.getAbsolutePath()); - if (!operationLogRootDir.mkdirs()) { - LOG.warn("Unable to create operation log root directory: " + - operationLogRootDir.getAbsolutePath()); - } - } - if (!operationLogRootDir.canWrite()) { - LOG.warn("The operation log root directory is not writable: " + - operationLogRootDir.getAbsolutePath()); - } - sessionLogDir = new File(operationLogRootDir, sessionHandle.getHandleIdentifier().toString()); - isOperationLogEnabled = true; - if (!sessionLogDir.exists()) { - if (!sessionLogDir.mkdir()) { - LOG.warn("Unable to create operation log session directory: " + - sessionLogDir.getAbsolutePath()); - isOperationLogEnabled = false; - } - } - if (isOperationLogEnabled) { - LOG.info("Operation log session directory is created: " + sessionLogDir.getAbsolutePath()); - } - } - - @Override - public boolean isOperationLogEnabled() { - return isOperationLogEnabled; - } - - @Override - public File getOperationLogSessionDir() { - return sessionLogDir; - } - - @Override - public TProtocolVersion getProtocolVersion() { - return sessionHandle.getProtocolVersion(); - } - - @Override - public SessionManager getSessionManager() { - return sessionManager; - } - - @Override - public void setSessionManager(SessionManager sessionManager) { - this.sessionManager = sessionManager; - } - - private OperationManager getOperationManager() { - return operationManager; - } - - @Override - public void setOperationManager(OperationManager operationManager) { - this.operationManager = operationManager; - } - - protected synchronized void acquire(boolean userAccess) { - // Need to make sure that the this HiveServer2's session's SessionState is - // stored in the thread local for the handler thread. - SessionState.setCurrentSessionState(sessionState); - if (userAccess) { - lastAccessTime = System.currentTimeMillis(); - } - } - - /** - * 1. We'll remove the ThreadLocal SessionState as this thread might now serve - * other requests. - * 2. We'll cache the ThreadLocal RawStore object for this background thread for an orderly cleanup - * when this thread is garbage collected later. - * @see org.apache.hive.service.server.ThreadWithGarbageCleanup#finalize() - */ - protected synchronized void release(boolean userAccess) { - SessionState.detachSession(); - if (ThreadWithGarbageCleanup.currentThread() instanceof ThreadWithGarbageCleanup) { - ThreadWithGarbageCleanup currentThread = - (ThreadWithGarbageCleanup) ThreadWithGarbageCleanup.currentThread(); - currentThread.cacheThreadLocalRawStore(); - } - if (userAccess) { - lastAccessTime = System.currentTimeMillis(); - } - if (opHandleSet.isEmpty()) { - lastIdleTime = System.currentTimeMillis(); - } else { - lastIdleTime = 0; - } - } - - @Override - public SessionHandle getSessionHandle() { - return sessionHandle; - } - - @Override - public String getUsername() { - return username; - } - - @Override - public String getPassword() { - return password; - } - - @Override - public HiveConf getHiveConf() { - hiveConf.setVar(HiveConf.ConfVars.HIVEFETCHOUTPUTSERDE, FETCH_WORK_SERDE_CLASS); - return hiveConf; - } - - @Override - public IMetaStoreClient getMetaStoreClient() throws HiveSQLException { - try { - return Hive.get(getHiveConf()).getMSC(); - } catch (HiveException e) { - throw new HiveSQLException("Failed to get metastore connection", e); - } catch (MetaException e) { - throw new HiveSQLException("Failed to get metastore connection", e); - } - } - - @Override - public GetInfoValue getInfo(GetInfoType getInfoType) - throws HiveSQLException { - acquire(true); - try { - switch (getInfoType) { - case CLI_SERVER_NAME: - return new GetInfoValue("Hive"); - case CLI_DBMS_NAME: - return new GetInfoValue("Apache Hive"); - case CLI_DBMS_VER: - return new GetInfoValue(HiveVersionInfo.getVersion()); - case CLI_MAX_COLUMN_NAME_LEN: - return new GetInfoValue(128); - case CLI_MAX_SCHEMA_NAME_LEN: - return new GetInfoValue(128); - case CLI_MAX_TABLE_NAME_LEN: - return new GetInfoValue(128); - case CLI_TXN_CAPABLE: - default: - throw new HiveSQLException("Unrecognized GetInfoType value: " + getInfoType.toString()); - } - } finally { - release(true); - } - } - - @Override - public OperationHandle executeStatement(String statement, Map confOverlay) - throws HiveSQLException { - return executeStatementInternal(statement, confOverlay, false, 0); - } - - @Override - public OperationHandle executeStatement(String statement, Map confOverlay, - long queryTimeout) throws HiveSQLException { - return executeStatementInternal(statement, confOverlay, false, queryTimeout); - } - - @Override - public OperationHandle executeStatementAsync(String statement, Map confOverlay) - throws HiveSQLException { - return executeStatementInternal(statement, confOverlay, true, 0); - } - - @Override - public OperationHandle executeStatementAsync(String statement, Map confOverlay, - long queryTimeout) throws HiveSQLException { - return executeStatementInternal(statement, confOverlay, true, queryTimeout); - } - - private OperationHandle executeStatementInternal(String statement, - Map confOverlay, boolean runAsync, long queryTimeout) throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - ExecuteStatementOperation operation = operationManager - .newExecuteStatementOperation(getSession(), statement, confOverlay, runAsync, queryTimeout); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - // Referring to SQLOperation.java, there is no chance that a HiveSQLException throws and the asyn - // background operation submits to thread pool successfully at the same time. So, Cleanup - // opHandle directly when got HiveSQLException - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getTypeInfo() - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - GetTypeInfoOperation operation = operationManager.newGetTypeInfoOperation(getSession()); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getCatalogs() - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - GetCatalogsOperation operation = operationManager.newGetCatalogsOperation(getSession()); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getSchemas(String catalogName, String schemaName) - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - GetSchemasOperation operation = - operationManager.newGetSchemasOperation(getSession(), catalogName, schemaName); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getTables(String catalogName, String schemaName, String tableName, - List tableTypes) - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - MetadataOperation operation = - operationManager.newGetTablesOperation(getSession(), catalogName, schemaName, tableName, tableTypes); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getTableTypes() - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - GetTableTypesOperation operation = operationManager.newGetTableTypesOperation(getSession()); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getColumns(String catalogName, String schemaName, - String tableName, String columnName) throws HiveSQLException { - acquire(true); - String addedJars = Utilities.getResourceFiles(hiveConf, SessionState.ResourceType.JAR); - if (StringUtils.isNotBlank(addedJars)) { - IMetaStoreClient metastoreClient = getSession().getMetaStoreClient(); - metastoreClient.setHiveAddedJars(addedJars); - } - OperationManager operationManager = getOperationManager(); - GetColumnsOperation operation = operationManager.newGetColumnsOperation(getSession(), - catalogName, schemaName, tableName, columnName); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getFunctions(String catalogName, String schemaName, String functionName) - throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - GetFunctionsOperation operation = operationManager - .newGetFunctionsOperation(getSession(), catalogName, schemaName, functionName); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public void close() throws HiveSQLException { - try { - acquire(true); - // Iterate through the opHandles and close their operations - for (OperationHandle opHandle : opHandleSet) { - operationManager.closeOperation(opHandle); - } - opHandleSet.clear(); - // Cleanup session log directory. - cleanupSessionLogDir(); - // Cleanup pipeout file. - cleanupPipeoutFile(); - HiveHistory hiveHist = sessionState.getHiveHistory(); - if (null != hiveHist) { - hiveHist.closeStream(); - } - try { - sessionState.close(); - } finally { - sessionState = null; - } - } catch (IOException ioe) { - throw new HiveSQLException("Failure to close", ioe); - } finally { - if (sessionState != null) { - try { - sessionState.close(); - } catch (Throwable t) { - LOG.warn("Error closing session", t); - } - sessionState = null; - } - release(true); - } - } - - private void cleanupPipeoutFile() { - String lScratchDir = hiveConf.getVar(ConfVars.LOCALSCRATCHDIR); - String sessionID = hiveConf.getVar(ConfVars.HIVESESSIONID); - - File[] fileAry = new File(lScratchDir).listFiles( - (dir, name) -> name.startsWith(sessionID) && name.endsWith(".pipeout")); - - for (File file : fileAry) { - try { - FileUtils.forceDelete(file); - } catch (Exception e) { - LOG.error("Failed to cleanup pipeout file: " + file, e); - } - } - } - - private void cleanupSessionLogDir() { - if (isOperationLogEnabled) { - try { - FileUtils.forceDelete(sessionLogDir); - } catch (Exception e) { - LOG.error("Failed to cleanup session log dir: " + sessionHandle, e); - } - } - } - - @Override - public SessionState getSessionState() { - return sessionState; - } - - @Override - public String getUserName() { - return username; - } - - @Override - public void setUserName(String userName) { - this.username = userName; - } - - @Override - public long getLastAccessTime() { - return lastAccessTime; - } - - @Override - public void closeExpiredOperations() { - OperationHandle[] handles = opHandleSet.toArray(new OperationHandle[opHandleSet.size()]); - if (handles.length > 0) { - List operations = operationManager.removeExpiredOperations(handles); - if (!operations.isEmpty()) { - closeTimedOutOperations(operations); - } - } - } - - @Override - public long getNoOperationTime() { - return lastIdleTime > 0 ? System.currentTimeMillis() - lastIdleTime : 0; - } - - private void closeTimedOutOperations(List operations) { - acquire(false); - try { - for (Operation operation : operations) { - opHandleSet.remove(operation.getHandle()); - try { - operation.close(); - } catch (Exception e) { - LOG.warn("Exception is thrown closing timed-out operation " + operation.getHandle(), e); - } - } - } finally { - release(false); - } - } - - @Override - public void cancelOperation(OperationHandle opHandle) throws HiveSQLException { - acquire(true); - try { - sessionManager.getOperationManager().cancelOperation(opHandle); - } finally { - release(true); - } - } - - @Override - public void closeOperation(OperationHandle opHandle) throws HiveSQLException { - acquire(true); - try { - operationManager.closeOperation(opHandle); - opHandleSet.remove(opHandle); - } finally { - release(true); - } - } - - @Override - public TableSchema getResultSetMetadata(OperationHandle opHandle) throws HiveSQLException { - acquire(true); - try { - return sessionManager.getOperationManager().getOperationResultSetSchema(opHandle); - } finally { - release(true); - } - } - - @Override - public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, - long maxRows, FetchType fetchType) throws HiveSQLException { - acquire(true); - try { - if (fetchType == FetchType.QUERY_OUTPUT) { - return operationManager.getOperationNextRowSet(opHandle, orientation, maxRows); - } - return operationManager.getOperationLogRowSet(opHandle, orientation, maxRows); - } finally { - release(true); - } - } - - protected HiveSession getSession() { - return this; - } - - @Override - public String getIpAddress() { - return ipAddress; - } - - @Override - public void setIpAddress(String ipAddress) { - this.ipAddress = ipAddress; - } - - @Override - public String getDelegationToken(HiveAuthFactory authFactory, String owner, String renewer) - throws HiveSQLException { - HiveAuthFactory.verifyProxyAccess(getUsername(), owner, getIpAddress(), getHiveConf()); - return authFactory.getDelegationToken(owner, renewer, getIpAddress()); - } - - @Override - public void cancelDelegationToken(HiveAuthFactory authFactory, String tokenStr) - throws HiveSQLException { - HiveAuthFactory.verifyProxyAccess(getUsername(), getUserFromToken(authFactory, tokenStr), - getIpAddress(), getHiveConf()); - authFactory.cancelDelegationToken(tokenStr); - } - - @Override - public void renewDelegationToken(HiveAuthFactory authFactory, String tokenStr) - throws HiveSQLException { - HiveAuthFactory.verifyProxyAccess(getUsername(), getUserFromToken(authFactory, tokenStr), - getIpAddress(), getHiveConf()); - authFactory.renewDelegationToken(tokenStr); - } - - // extract the real user from the given token string - private String getUserFromToken(HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException { - return authFactory.getUserFromToken(tokenStr); - } - - @Override - public OperationHandle getPrimaryKeys(String catalog, String schema, - String table) throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - GetPrimaryKeysOperation operation = operationManager - .newGetPrimaryKeysOperation(getSession(), catalog, schema, table); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } - - @Override - public OperationHandle getCrossReference(String primaryCatalog, - String primarySchema, String primaryTable, String foreignCatalog, - String foreignSchema, String foreignTable) throws HiveSQLException { - acquire(true); - - OperationManager operationManager = getOperationManager(); - GetCrossReferenceOperation operation = operationManager - .newGetCrossReferenceOperation(getSession(), primaryCatalog, - primarySchema, primaryTable, foreignCatalog, - foreignSchema, foreignTable); - OperationHandle opHandle = operation.getHandle(); - try { - operation.run(); - opHandleSet.add(opHandle); - return opHandle; - } catch (HiveSQLException e) { - operationManager.closeOperation(opHandle); - throw e; - } finally { - release(true); - } - } -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/SessionManager.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/SessionManager.java deleted file mode 100644 index 49221b13bb892..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/session/SessionManager.java +++ /dev/null @@ -1,361 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.session; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Date; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.Future; -import java.util.concurrent.LinkedBlockingQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.apache.commons.io.FileUtils; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hive.service.CompositeService; -import org.apache.hive.service.cli.HiveSQLException; -import org.apache.hive.service.cli.SessionHandle; -import org.apache.hive.service.cli.operation.OperationManager; -import org.apache.hive.service.rpc.thrift.TProtocolVersion; -import org.apache.hive.service.server.HiveServer2; -import org.apache.hive.service.server.ThreadFactoryWithGarbageCleanup; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * SessionManager. - * - */ -public class SessionManager extends CompositeService { - - private static final Logger LOG = LoggerFactory.getLogger(SessionManager.class); - public static final String HIVERCFILE = ".hiverc"; - private HiveConf hiveConf; - private final Map handleToSession = - new ConcurrentHashMap(); - private final OperationManager operationManager = new OperationManager(); - private ThreadPoolExecutor backgroundOperationPool; - private boolean isOperationLogEnabled; - private File operationLogRootDir; - - private long checkInterval; - private long sessionTimeout; - private boolean checkOperation; - - private volatile boolean shutdown; - // The HiveServer2 instance running this service - private final HiveServer2 hiveServer2; - - public SessionManager(HiveServer2 hiveServer2) { - super(SessionManager.class.getSimpleName()); - this.hiveServer2 = hiveServer2; - } - - @Override - public synchronized void init(HiveConf hiveConf) { - this.hiveConf = hiveConf; - //Create operation log root directory, if operation logging is enabled - if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED)) { - initOperationLogRootDir(); - } - createBackgroundOperationPool(); - addService(operationManager); - super.init(hiveConf); - } - - private void createBackgroundOperationPool() { - int poolSize = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_ASYNC_EXEC_THREADS); - LOG.info("HiveServer2: Background operation thread pool size: " + poolSize); - int poolQueueSize = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_ASYNC_EXEC_WAIT_QUEUE_SIZE); - LOG.info("HiveServer2: Background operation thread wait queue size: " + poolQueueSize); - long keepAliveTime = HiveConf.getTimeVar( - hiveConf, ConfVars.HIVE_SERVER2_ASYNC_EXEC_KEEPALIVE_TIME, TimeUnit.SECONDS); - LOG.info( - "HiveServer2: Background operation thread keepalive time: " + keepAliveTime + " seconds"); - - // Create a thread pool with #poolSize threads - // Threads terminate when they are idle for more than the keepAliveTime - // A bounded blocking queue is used to queue incoming operations, if #operations > poolSize - String threadPoolName = "HiveServer2-Background-Pool"; - backgroundOperationPool = new ThreadPoolExecutor(poolSize, poolSize, - keepAliveTime, TimeUnit.SECONDS, new LinkedBlockingQueue(poolQueueSize), - new ThreadFactoryWithGarbageCleanup(threadPoolName)); - backgroundOperationPool.allowCoreThreadTimeOut(true); - - checkInterval = HiveConf.getTimeVar( - hiveConf, ConfVars.HIVE_SERVER2_SESSION_CHECK_INTERVAL, TimeUnit.MILLISECONDS); - sessionTimeout = HiveConf.getTimeVar( - hiveConf, ConfVars.HIVE_SERVER2_IDLE_SESSION_TIMEOUT, TimeUnit.MILLISECONDS); - checkOperation = HiveConf.getBoolVar(hiveConf, - ConfVars.HIVE_SERVER2_IDLE_SESSION_CHECK_OPERATION); - } - - private void initOperationLogRootDir() { - operationLogRootDir = new File( - hiveConf.getVar(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_LOG_LOCATION)); - isOperationLogEnabled = true; - - if (operationLogRootDir.exists() && !operationLogRootDir.isDirectory()) { - LOG.warn("The operation log root directory exists, but it is not a directory: " + - operationLogRootDir.getAbsolutePath()); - isOperationLogEnabled = false; - } - - if (!operationLogRootDir.exists()) { - if (!operationLogRootDir.mkdirs()) { - LOG.warn("Unable to create operation log root directory: " + - operationLogRootDir.getAbsolutePath()); - isOperationLogEnabled = false; - } - } - - if (isOperationLogEnabled) { - LOG.info("Operation log root directory is created: " + operationLogRootDir.getAbsolutePath()); - try { - FileUtils.forceDeleteOnExit(operationLogRootDir); - } catch (IOException e) { - LOG.warn("Failed to schedule cleanup HS2 operation logging root dir: " + - operationLogRootDir.getAbsolutePath(), e); - } - } - } - - @Override - public synchronized void start() { - super.start(); - if (checkInterval > 0) { - startTimeoutChecker(); - } - } - - private void startTimeoutChecker() { - final long interval = Math.max(checkInterval, 3000L); // minimum 3 seconds - Runnable timeoutChecker = new Runnable() { - @Override - public void run() { - for (sleepInterval(interval); !shutdown; sleepInterval(interval)) { - long current = System.currentTimeMillis(); - for (HiveSession session : new ArrayList(handleToSession.values())) { - if (sessionTimeout > 0 && session.getLastAccessTime() + sessionTimeout <= current - && (!checkOperation || session.getNoOperationTime() > sessionTimeout)) { - SessionHandle handle = session.getSessionHandle(); - LOG.warn("Session " + handle + " is Timed-out (last access : " + - new Date(session.getLastAccessTime()) + ") and will be closed"); - try { - closeSession(handle); - } catch (HiveSQLException e) { - LOG.warn("Exception is thrown closing session " + handle, e); - } - } else { - session.closeExpiredOperations(); - } - } - } - } - - private void sleepInterval(long interval) { - try { - Thread.sleep(interval); - } catch (InterruptedException e) { - // ignore - } - } - }; - backgroundOperationPool.execute(timeoutChecker); - } - - @Override - public synchronized void stop() { - super.stop(); - shutdown = true; - if (backgroundOperationPool != null) { - backgroundOperationPool.shutdown(); - long timeout = hiveConf.getTimeVar( - ConfVars.HIVE_SERVER2_ASYNC_EXEC_SHUTDOWN_TIMEOUT, TimeUnit.SECONDS); - try { - backgroundOperationPool.awaitTermination(timeout, TimeUnit.SECONDS); - } catch (InterruptedException e) { - LOG.warn("HIVE_SERVER2_ASYNC_EXEC_SHUTDOWN_TIMEOUT = " + timeout + - " seconds has been exceeded. RUNNING background operations will be shut down", e); - } - backgroundOperationPool = null; - } - cleanupLoggingRootDir(); - } - - private void cleanupLoggingRootDir() { - if (isOperationLogEnabled) { - try { - FileUtils.forceDelete(operationLogRootDir); - } catch (Exception e) { - LOG.warn("Failed to cleanup root dir of HS2 logging: " + operationLogRootDir - .getAbsolutePath(), e); - } - } - } - - public SessionHandle openSession(TProtocolVersion protocol, String username, String password, String ipAddress, - Map sessionConf) throws HiveSQLException { - return openSession(protocol, username, password, ipAddress, sessionConf, false, null); - } - - /** - * Opens a new session and creates a session handle. - * The username passed to this method is the effective username. - * If withImpersonation is true (==doAs true) we wrap all the calls in HiveSession - * within a UGI.doAs, where UGI corresponds to the effective user. - * - * Please see {@code org.apache.hive.service.cli.thrift.ThriftCLIService.getUserName()} for - * more details. - * - * @param protocol - * @param username - * @param password - * @param ipAddress - * @param sessionConf - * @param withImpersonation - * @param delegationToken - * @return - * @throws HiveSQLException - */ - public SessionHandle openSession(TProtocolVersion protocol, String username, String password, String ipAddress, - Map sessionConf, boolean withImpersonation, String delegationToken) - throws HiveSQLException { - HiveSession session; - // If doAs is set to true for HiveServer2, we will create a proxy object for the session impl. - // Within the proxy object, we wrap the method call in a UserGroupInformation#doAs - if (withImpersonation) { - HiveSessionImplwithUGI sessionWithUGI = new HiveSessionImplwithUGI(protocol, username, password, - hiveConf, ipAddress, delegationToken); - session = HiveSessionProxy.getProxy(sessionWithUGI, sessionWithUGI.getSessionUgi()); - sessionWithUGI.setProxySession(session); - } else { - session = new HiveSessionImpl(protocol, username, password, hiveConf, ipAddress); - } - session.setSessionManager(this); - session.setOperationManager(operationManager); - try { - session.open(sessionConf); - } catch (Exception e) { - try { - session.close(); - } catch (Throwable t) { - LOG.warn("Error closing session", t); - } - session = null; - throw new HiveSQLException("Failed to open new session: " + e, e); - } - if (isOperationLogEnabled) { - session.setOperationLogSessionDir(operationLogRootDir); - } - handleToSession.put(session.getSessionHandle(), session); - return session.getSessionHandle(); - } - - public void closeSession(SessionHandle sessionHandle) throws HiveSQLException { - HiveSession session = handleToSession.remove(sessionHandle); - if (session == null) { - throw new HiveSQLException("Session does not exist!"); - } - session.close(); - } - - public HiveSession getSession(SessionHandle sessionHandle) throws HiveSQLException { - HiveSession session = handleToSession.get(sessionHandle); - if (session == null) { - throw new HiveSQLException("Invalid SessionHandle: " + sessionHandle); - } - return session; - } - - public OperationManager getOperationManager() { - return operationManager; - } - - private static ThreadLocal threadLocalIpAddress = new ThreadLocal() { - @Override - protected synchronized String initialValue() { - return null; - } - }; - - public static void setIpAddress(String ipAddress) { - threadLocalIpAddress.set(ipAddress); - } - - public static void clearIpAddress() { - threadLocalIpAddress.remove(); - } - - public static String getIpAddress() { - return threadLocalIpAddress.get(); - } - - private static ThreadLocal threadLocalUserName = new ThreadLocal(){ - @Override - protected synchronized String initialValue() { - return null; - } - }; - - public static void setUserName(String userName) { - threadLocalUserName.set(userName); - } - - public static void clearUserName() { - threadLocalUserName.remove(); - } - - public static String getUserName() { - return threadLocalUserName.get(); - } - - private static ThreadLocal threadLocalProxyUserName = new ThreadLocal(){ - @Override - protected synchronized String initialValue() { - return null; - } - }; - - public static void setProxyUserName(String userName) { - LOG.debug("setting proxy user name based on query param to: " + userName); - threadLocalProxyUserName.set(userName); - } - - public static String getProxyUserName() { - return threadLocalProxyUserName.get(); - } - - public static void clearProxyUserName() { - threadLocalProxyUserName.remove(); - } - - public Future submitBackgroundOperation(Runnable r) { - return backgroundOperationPool.submit(r); - } - - public int getOpenSessionCount() { - return handleToSession.size(); - } -} - diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java deleted file mode 100644 index fc19c65daaf54..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftBinaryCLIService.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.thrift; - -import java.util.ArrayList; -import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.apache.hadoop.hive.common.auth.HiveAuthUtils; -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hadoop.hive.shims.ShimLoader; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.cli.CLIService; -import org.apache.hive.service.server.ThreadFactoryWithGarbageCleanup; -import org.apache.thrift.TProcessorFactory; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.thrift.server.TThreadPoolServer; -import org.apache.thrift.transport.TServerSocket; -import org.apache.thrift.transport.TTransportFactory; - - -public class ThriftBinaryCLIService extends ThriftCLIService { - - public ThriftBinaryCLIService(CLIService cliService) { - super(cliService, ThriftBinaryCLIService.class.getSimpleName()); - } - - @Override - public void run() { - try { - // Server thread pool - String threadPoolName = "HiveServer2-Handler-Pool"; - ExecutorService executorService = new ThreadPoolExecutor(minWorkerThreads, maxWorkerThreads, - workerKeepAliveTime, TimeUnit.SECONDS, new SynchronousQueue(), - new ThreadFactoryWithGarbageCleanup(threadPoolName)); - - // Thrift configs - hiveAuthFactory = new HiveAuthFactory(hiveConf); - TTransportFactory transportFactory = hiveAuthFactory.getAuthTransFactory(); - TProcessorFactory processorFactory = hiveAuthFactory.getAuthProcFactory(this); - TServerSocket serverSocket = null; - List sslVersionBlacklist = new ArrayList(); - for (String sslVersion : hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(",")) { - sslVersionBlacklist.add(sslVersion); - } - if (!hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_USE_SSL)) { - serverSocket = HiveAuthUtils.getServerSocket(hiveHost, portNum); - } else { - String keyStorePath = hiveConf.getVar(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH).trim(); - if (keyStorePath.isEmpty()) { - throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname - + " Not configured for SSL connection"); - } - String keyStorePassword = ShimLoader.getHadoopShims().getPassword(hiveConf, - HiveConf.ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname); - serverSocket = HiveAuthUtils.getServerSSLSocket(hiveHost, portNum, keyStorePath, - keyStorePassword, sslVersionBlacklist); - } - - // Server args - int maxMessageSize = hiveConf.getIntVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_MAX_MESSAGE_SIZE); - int requestTimeout = (int) hiveConf.getTimeVar( - HiveConf.ConfVars.HIVE_SERVER2_THRIFT_LOGIN_TIMEOUT, TimeUnit.SECONDS); - int beBackoffSlotLength = (int) hiveConf.getTimeVar( - HiveConf.ConfVars.HIVE_SERVER2_THRIFT_LOGIN_BEBACKOFF_SLOT_LENGTH, TimeUnit.MILLISECONDS); - TThreadPoolServer.Args sargs = new TThreadPoolServer.Args(serverSocket) - .processorFactory(processorFactory).transportFactory(transportFactory) - .protocolFactory(new TBinaryProtocol.Factory()) - .inputProtocolFactory(new TBinaryProtocol.Factory(true, true, maxMessageSize, maxMessageSize)) - .requestTimeout(requestTimeout).requestTimeoutUnit(TimeUnit.SECONDS) - .beBackoffSlotLength(beBackoffSlotLength).beBackoffSlotLengthUnit(TimeUnit.MILLISECONDS) - .executorService(executorService); - - // TCP Server - server = new TThreadPoolServer(sargs); - server.setServerEventHandler(serverEventHandler); - String msg = "Starting " + ThriftBinaryCLIService.class.getSimpleName() + " on port " - + portNum + " with " + minWorkerThreads + "..." + maxWorkerThreads + " worker threads"; - LOG.info(msg); - server.serve(); - } catch (Throwable t) { - LOG.error( - "Error starting HiveServer2: could not start " - + ThriftBinaryCLIService.class.getSimpleName(), t); - System.exit(-1); - } - } - -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java deleted file mode 100644 index d41c3b493bb47..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIService.java +++ /dev/null @@ -1,726 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.thrift; - -import javax.security.auth.login.LoginException; -import java.io.IOException; -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.TimeUnit; - -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hive.service.AbstractService; -import org.apache.hive.service.ServiceException; -import org.apache.hive.service.ServiceUtils; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.auth.TSetIpAddressProcessor; -import org.apache.hive.service.cli.*; -import org.apache.hive.service.cli.session.SessionManager; -import org.apache.hive.service.rpc.thrift.*; -import org.apache.hive.service.server.HiveServer2; -import org.apache.thrift.TException; -import org.apache.thrift.protocol.TProtocol; -import org.apache.thrift.server.ServerContext; -import org.apache.thrift.server.TServer; -import org.apache.thrift.server.TServerEventHandler; -import org.apache.thrift.transport.TTransport; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * ThriftCLIService. - * - */ -public abstract class ThriftCLIService extends AbstractService implements TCLIService.Iface, Runnable { - - public static final Logger LOG = LoggerFactory.getLogger(ThriftCLIService.class.getName()); - - protected CLIService cliService; - private static final TStatus OK_STATUS = new TStatus(TStatusCode.SUCCESS_STATUS); - protected static HiveAuthFactory hiveAuthFactory; - - protected int portNum; - protected InetAddress serverIPAddress; - protected String hiveHost; - protected TServer server; - protected org.eclipse.jetty.server.Server httpServer; - - private boolean isStarted = false; - protected boolean isEmbedded = false; - - protected HiveConf hiveConf; - - protected int minWorkerThreads; - protected int maxWorkerThreads; - protected long workerKeepAliveTime; - - protected TServerEventHandler serverEventHandler; - protected ThreadLocal currentServerContext; - - static class ThriftCLIServerContext implements ServerContext { - private SessionHandle sessionHandle = null; - - public void setSessionHandle(SessionHandle sessionHandle) { - this.sessionHandle = sessionHandle; - } - - public SessionHandle getSessionHandle() { - return sessionHandle; - } - } - - public ThriftCLIService(CLIService service, String serviceName) { - super(serviceName); - this.cliService = service; - currentServerContext = new ThreadLocal(); - serverEventHandler = new TServerEventHandler() { - @Override - public ServerContext createContext( - TProtocol input, TProtocol output) { - return new ThriftCLIServerContext(); - } - - @Override - public void deleteContext(ServerContext serverContext, - TProtocol input, TProtocol output) { - ThriftCLIServerContext context = (ThriftCLIServerContext)serverContext; - SessionHandle sessionHandle = context.getSessionHandle(); - if (sessionHandle != null) { - LOG.info("Session disconnected without closing properly, close it now"); - try { - cliService.closeSession(sessionHandle); - } catch (HiveSQLException e) { - LOG.warn("Failed to close session: " + e, e); - } - } - } - - @Override - public void preServe() { - } - - @Override - public void processContext(ServerContext serverContext, - TTransport input, TTransport output) { - currentServerContext.set(serverContext); - } - }; - } - - @Override - public synchronized void init(HiveConf hiveConf) { - this.hiveConf = hiveConf; - // Initialize common server configs needed in both binary & http modes - String portString; - hiveHost = System.getenv("HIVE_SERVER2_THRIFT_BIND_HOST"); - if (hiveHost == null) { - hiveHost = hiveConf.getVar(ConfVars.HIVE_SERVER2_THRIFT_BIND_HOST); - } - try { - if (hiveHost != null && !hiveHost.isEmpty()) { - serverIPAddress = InetAddress.getByName(hiveHost); - } else { - serverIPAddress = InetAddress.getLocalHost(); - } - } catch (UnknownHostException e) { - throw new ServiceException(e); - } - // HTTP mode - if (HiveServer2.isHTTPTransportMode(hiveConf)) { - workerKeepAliveTime = - hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_WORKER_KEEPALIVE_TIME, - TimeUnit.SECONDS); - portString = System.getenv("HIVE_SERVER2_THRIFT_HTTP_PORT"); - if (portString != null) { - portNum = Integer.valueOf(portString); - } else { - portNum = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_PORT); - } - } - // Binary mode - else { - workerKeepAliveTime = - hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_WORKER_KEEPALIVE_TIME, TimeUnit.SECONDS); - portString = System.getenv("HIVE_SERVER2_THRIFT_PORT"); - if (portString != null) { - portNum = Integer.valueOf(portString); - } else { - portNum = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_PORT); - } - } - minWorkerThreads = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_MIN_WORKER_THREADS); - maxWorkerThreads = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_THRIFT_MAX_WORKER_THREADS); - super.init(hiveConf); - } - - @Override - public synchronized void start() { - super.start(); - if (!isStarted && !isEmbedded) { - new Thread(this).start(); - isStarted = true; - } - } - - @Override - public synchronized void stop() { - if (isStarted && !isEmbedded) { - if(server != null) { - server.stop(); - LOG.info("Thrift server has stopped"); - } - if((httpServer != null) && httpServer.isStarted()) { - try { - httpServer.stop(); - LOG.info("Http server has stopped"); - } catch (Exception e) { - LOG.error("Error stopping Http server: ", e); - } - } - isStarted = false; - } - super.stop(); - } - - public int getPortNumber() { - return portNum; - } - - public InetAddress getServerIPAddress() { - return serverIPAddress; - } - - @Override - public TGetDelegationTokenResp GetDelegationToken(TGetDelegationTokenReq req) - throws TException { - TGetDelegationTokenResp resp = new TGetDelegationTokenResp(); - resp.setStatus(notSupportTokenErrorStatus()); - return resp; - } - - @Override - public TCancelDelegationTokenResp CancelDelegationToken(TCancelDelegationTokenReq req) - throws TException { - TCancelDelegationTokenResp resp = new TCancelDelegationTokenResp(); - resp.setStatus(notSupportTokenErrorStatus()); - return resp; - } - - @Override - public TRenewDelegationTokenResp RenewDelegationToken(TRenewDelegationTokenReq req) - throws TException { - TRenewDelegationTokenResp resp = new TRenewDelegationTokenResp(); - resp.setStatus(notSupportTokenErrorStatus()); - return resp; - } - - private TStatus notSupportTokenErrorStatus() { - TStatus errorStatus = new TStatus(TStatusCode.ERROR_STATUS); - errorStatus.setErrorMessage("Delegation token is not supported"); - return errorStatus; - } - - @Override - public TOpenSessionResp OpenSession(TOpenSessionReq req) throws TException { - LOG.info("Client protocol version: " + req.getClient_protocol()); - TOpenSessionResp resp = new TOpenSessionResp(); - try { - SessionHandle sessionHandle = getSessionHandle(req, resp); - resp.setSessionHandle(sessionHandle.toTSessionHandle()); - // TODO: set real configuration map - resp.setConfiguration(new HashMap()); - resp.setStatus(OK_STATUS); - ThriftCLIServerContext context = - (ThriftCLIServerContext)currentServerContext.get(); - if (context != null) { - context.setSessionHandle(sessionHandle); - } - } catch (Exception e) { - LOG.warn("Error opening session: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - private String getIpAddress() { - String clientIpAddress; - // Http transport mode. - // We set the thread local ip address, in ThriftHttpServlet. - if (cliService.getHiveConf().getVar( - ConfVars.HIVE_SERVER2_TRANSPORT_MODE).equalsIgnoreCase("http")) { - clientIpAddress = SessionManager.getIpAddress(); - } - else { - // Kerberos - if (isKerberosAuthMode()) { - clientIpAddress = hiveAuthFactory.getIpAddress(); - } - // Except kerberos, NOSASL - else { - clientIpAddress = TSetIpAddressProcessor.getUserIpAddress(); - } - } - LOG.debug("Client's IP Address: " + clientIpAddress); - return clientIpAddress; - } - - /** - * Returns the effective username. - * 1. If hive.server2.allow.user.substitution = false: the username of the connecting user - * 2. If hive.server2.allow.user.substitution = true: the username of the end user, - * that the connecting user is trying to proxy for. - * This includes a check whether the connecting user is allowed to proxy for the end user. - * @param req - * @return - * @throws HiveSQLException - */ - private String getUserName(TOpenSessionReq req) throws HiveSQLException { - String userName = null; - // Kerberos - if (isKerberosAuthMode()) { - userName = hiveAuthFactory.getRemoteUser(); - } - // Except kerberos, NOSASL - if (userName == null) { - userName = TSetIpAddressProcessor.getUserName(); - } - // Http transport mode. - // We set the thread local username, in ThriftHttpServlet. - if (cliService.getHiveConf().getVar( - ConfVars.HIVE_SERVER2_TRANSPORT_MODE).equalsIgnoreCase("http")) { - userName = SessionManager.getUserName(); - } - if (userName == null) { - userName = req.getUsername(); - } - - userName = getShortName(userName); - String effectiveClientUser = getProxyUser(userName, req.getConfiguration(), getIpAddress()); - LOG.debug("Client's username: " + effectiveClientUser); - return effectiveClientUser; - } - - private String getShortName(String userName) { - String ret = null; - if (userName != null) { - int indexOfDomainMatch = ServiceUtils.indexOfDomainMatch(userName); - ret = (indexOfDomainMatch <= 0) ? userName : - userName.substring(0, indexOfDomainMatch); - } - - return ret; - } - - /** - * Create a session handle - * @param req - * @param res - * @return - * @throws HiveSQLException - * @throws LoginException - * @throws IOException - */ - SessionHandle getSessionHandle(TOpenSessionReq req, TOpenSessionResp res) - throws HiveSQLException, LoginException, IOException { - String userName = getUserName(req); - String ipAddress = getIpAddress(); - TProtocolVersion protocol = getMinVersion(CLIService.SERVER_VERSION, - req.getClient_protocol()); - res.setServerProtocolVersion(protocol); - SessionHandle sessionHandle; - if (cliService.getHiveConf().getBoolVar(ConfVars.HIVE_SERVER2_ENABLE_DOAS) && - (userName != null)) { - String delegationTokenStr = getDelegationToken(userName); - sessionHandle = cliService.openSessionWithImpersonation(protocol, userName, - req.getPassword(), ipAddress, req.getConfiguration(), delegationTokenStr); - } else { - sessionHandle = cliService.openSession(protocol, userName, req.getPassword(), - ipAddress, req.getConfiguration()); - } - return sessionHandle; - } - - - private String getDelegationToken(String userName) - throws HiveSQLException, LoginException, IOException { - if (userName == null || !cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) - .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString())) { - return null; - } - try { - return cliService.getDelegationTokenFromMetaStore(userName); - } catch (UnsupportedOperationException e) { - // The delegation token is not applicable in the given deployment mode - } - return null; - } - - private TProtocolVersion getMinVersion(TProtocolVersion... versions) { - TProtocolVersion[] values = TProtocolVersion.values(); - int current = values[values.length - 1].getValue(); - for (TProtocolVersion version : versions) { - if (current > version.getValue()) { - current = version.getValue(); - } - } - for (TProtocolVersion version : values) { - if (version.getValue() == current) { - return version; - } - } - throw new IllegalArgumentException("never"); - } - - @Override - public TCloseSessionResp CloseSession(TCloseSessionReq req) throws TException { - TCloseSessionResp resp = new TCloseSessionResp(); - try { - SessionHandle sessionHandle = new SessionHandle(req.getSessionHandle()); - cliService.closeSession(sessionHandle); - resp.setStatus(OK_STATUS); - ThriftCLIServerContext context = - (ThriftCLIServerContext)currentServerContext.get(); - if (context != null) { - context.setSessionHandle(null); - } - } catch (Exception e) { - LOG.warn("Error closing session: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetInfoResp GetInfo(TGetInfoReq req) throws TException { - TGetInfoResp resp = new TGetInfoResp(); - try { - GetInfoValue getInfoValue = - cliService.getInfo(new SessionHandle(req.getSessionHandle()), - GetInfoType.getGetInfoType(req.getInfoType())); - resp.setInfoValue(getInfoValue.toTGetInfoValue()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting info: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TExecuteStatementResp ExecuteStatement(TExecuteStatementReq req) throws TException { - TExecuteStatementResp resp = new TExecuteStatementResp(); - try { - SessionHandle sessionHandle = new SessionHandle(req.getSessionHandle()); - String statement = req.getStatement(); - Map confOverlay = req.getConfOverlay(); - Boolean runAsync = req.isRunAsync(); - long queryTimeout = req.getQueryTimeout(); - OperationHandle operationHandle = runAsync ? - cliService.executeStatementAsync(sessionHandle, statement, confOverlay, queryTimeout) - : cliService.executeStatement(sessionHandle, statement, confOverlay, queryTimeout); - resp.setOperationHandle(operationHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error executing statement: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetTypeInfoResp GetTypeInfo(TGetTypeInfoReq req) throws TException { - TGetTypeInfoResp resp = new TGetTypeInfoResp(); - try { - OperationHandle operationHandle = cliService.getTypeInfo(new SessionHandle(req.getSessionHandle())); - resp.setOperationHandle(operationHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting type info: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetCatalogsResp GetCatalogs(TGetCatalogsReq req) throws TException { - TGetCatalogsResp resp = new TGetCatalogsResp(); - try { - OperationHandle opHandle = cliService.getCatalogs(new SessionHandle(req.getSessionHandle())); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting catalogs: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetSchemasResp GetSchemas(TGetSchemasReq req) throws TException { - TGetSchemasResp resp = new TGetSchemasResp(); - try { - OperationHandle opHandle = cliService.getSchemas( - new SessionHandle(req.getSessionHandle()), req.getCatalogName(), req.getSchemaName()); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting schemas: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetTablesResp GetTables(TGetTablesReq req) throws TException { - TGetTablesResp resp = new TGetTablesResp(); - try { - OperationHandle opHandle = cliService - .getTables(new SessionHandle(req.getSessionHandle()), req.getCatalogName(), - req.getSchemaName(), req.getTableName(), req.getTableTypes()); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting tables: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetTableTypesResp GetTableTypes(TGetTableTypesReq req) throws TException { - TGetTableTypesResp resp = new TGetTableTypesResp(); - try { - OperationHandle opHandle = cliService.getTableTypes(new SessionHandle(req.getSessionHandle())); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting table types: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetColumnsResp GetColumns(TGetColumnsReq req) throws TException { - TGetColumnsResp resp = new TGetColumnsResp(); - try { - OperationHandle opHandle = cliService.getColumns( - new SessionHandle(req.getSessionHandle()), - req.getCatalogName(), - req.getSchemaName(), - req.getTableName(), - req.getColumnName()); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting columns: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetFunctionsResp GetFunctions(TGetFunctionsReq req) throws TException { - TGetFunctionsResp resp = new TGetFunctionsResp(); - try { - OperationHandle opHandle = cliService.getFunctions( - new SessionHandle(req.getSessionHandle()), req.getCatalogName(), - req.getSchemaName(), req.getFunctionName()); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting functions: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetOperationStatusResp GetOperationStatus(TGetOperationStatusReq req) throws TException { - TGetOperationStatusResp resp = new TGetOperationStatusResp(); - try { - OperationStatus operationStatus = cliService.getOperationStatus( - new OperationHandle(req.getOperationHandle())); - resp.setOperationState(operationStatus.getState().toTOperationState()); - HiveSQLException opException = operationStatus.getOperationException(); - if (opException != null) { - resp.setSqlState(opException.getSQLState()); - resp.setErrorCode(opException.getErrorCode()); - resp.setErrorMessage(opException.getMessage()); - } - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting operation status: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TCancelOperationResp CancelOperation(TCancelOperationReq req) throws TException { - TCancelOperationResp resp = new TCancelOperationResp(); - try { - cliService.cancelOperation(new OperationHandle(req.getOperationHandle())); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error cancelling operation: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TCloseOperationResp CloseOperation(TCloseOperationReq req) throws TException { - TCloseOperationResp resp = new TCloseOperationResp(); - try { - cliService.closeOperation(new OperationHandle(req.getOperationHandle())); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error closing operation: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetResultSetMetadataResp GetResultSetMetadata(TGetResultSetMetadataReq req) - throws TException { - TGetResultSetMetadataResp resp = new TGetResultSetMetadataResp(); - try { - TableSchema schema = cliService.getResultSetMetadata(new OperationHandle(req.getOperationHandle())); - resp.setSchema(schema.toTTableSchema()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting result set metadata: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TFetchResultsResp FetchResults(TFetchResultsReq req) throws TException { - TFetchResultsResp resp = new TFetchResultsResp(); - try { - RowSet rowSet = cliService.fetchResults( - new OperationHandle(req.getOperationHandle()), - FetchOrientation.getFetchOrientation(req.getOrientation()), - req.getMaxRows(), - FetchType.getFetchType(req.getFetchType())); - resp.setResults(rowSet.toTRowSet()); - resp.setHasMoreRows(false); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error fetching results: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetPrimaryKeysResp GetPrimaryKeys(TGetPrimaryKeysReq req) - throws TException { - TGetPrimaryKeysResp resp = new TGetPrimaryKeysResp(); - try { - OperationHandle opHandle = cliService.getPrimaryKeys( - new SessionHandle(req.getSessionHandle()), req.getCatalogName(), - req.getSchemaName(), req.getTableName()); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting functions: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public TGetCrossReferenceResp GetCrossReference(TGetCrossReferenceReq req) - throws TException { - TGetCrossReferenceResp resp = new TGetCrossReferenceResp(); - try { - OperationHandle opHandle = cliService.getCrossReference( - new SessionHandle(req.getSessionHandle()), req.getParentCatalogName(), - req.getParentSchemaName(), req.getParentTableName(), - req.getForeignCatalogName(), req.getForeignSchemaName(), req.getForeignTableName()); - resp.setOperationHandle(opHandle.toTOperationHandle()); - resp.setStatus(OK_STATUS); - } catch (Exception e) { - LOG.warn("Error getting functions: ", e); - resp.setStatus(HiveSQLException.toTStatus(e)); - } - return resp; - } - - @Override - public abstract void run(); - - /** - * If the proxy user name is provided then check privileges to substitute the user. - * @param realUser - * @param sessionConf - * @param ipAddress - * @return - * @throws HiveSQLException - */ - private String getProxyUser(String realUser, Map sessionConf, - String ipAddress) throws HiveSQLException { - String proxyUser = null; - // Http transport mode. - // We set the thread local proxy username, in ThriftHttpServlet. - if (cliService.getHiveConf().getVar( - ConfVars.HIVE_SERVER2_TRANSPORT_MODE).equalsIgnoreCase("http")) { - proxyUser = SessionManager.getProxyUserName(); - LOG.debug("Proxy user from query string: " + proxyUser); - } - - if (proxyUser == null && sessionConf != null && sessionConf.containsKey(HiveAuthFactory.HS2_PROXY_USER)) { - String proxyUserFromThriftBody = sessionConf.get(HiveAuthFactory.HS2_PROXY_USER); - LOG.debug("Proxy user from thrift body: " + proxyUserFromThriftBody); - proxyUser = proxyUserFromThriftBody; - } - - if (proxyUser == null) { - return realUser; - } - - // check whether substitution is allowed - if (!hiveConf.getBoolVar(HiveConf.ConfVars.HIVE_SERVER2_ALLOW_USER_SUBSTITUTION)) { - throw new HiveSQLException("Proxy user substitution is not allowed"); - } - - // If there's no authentication, then directly substitute the user - if (HiveAuthFactory.AuthTypes.NONE.toString() - .equalsIgnoreCase(hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION))) { - return proxyUser; - } - - // Verify proxy user privilege of the realUser for the proxyUser - HiveAuthFactory.verifyProxyAccess(realUser, proxyUser, ipAddress, hiveConf); - LOG.debug("Verified proxy user: " + proxyUser); - return proxyUser; - } - - private boolean isKerberosAuthMode() { - return cliService.getHiveConf().getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION) - .equalsIgnoreCase(HiveAuthFactory.AuthTypes.KERBEROS.toString()); - } -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java deleted file mode 100644 index b13ddf72f77e7..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftCLIServiceClient.java +++ /dev/null @@ -1,493 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.thrift; - -import java.util.List; -import java.util.Map; - -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.cli.*; -import org.apache.hive.service.rpc.thrift.*; -import org.apache.thrift.TException; - -/** - * ThriftCLIServiceClient. - * - */ -public class ThriftCLIServiceClient extends CLIServiceClient { - private final TCLIService.Iface cliService; - - public ThriftCLIServiceClient(TCLIService.Iface cliService) { - this.cliService = cliService; - } - - public void checkStatus(TStatus status) throws HiveSQLException { - if (TStatusCode.ERROR_STATUS.equals(status.getStatusCode())) { - throw new HiveSQLException(status); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#openSession(java.lang.String, java.lang.String, java.util.Map) - */ - @Override - public SessionHandle openSession(String username, String password, - Map configuration) - throws HiveSQLException { - try { - TOpenSessionReq req = new TOpenSessionReq(); - req.setUsername(username); - req.setPassword(password); - req.setConfiguration(configuration); - TOpenSessionResp resp = cliService.OpenSession(req); - checkStatus(resp.getStatus()); - return new SessionHandle(resp.getSessionHandle(), resp.getServerProtocolVersion()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#closeSession(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public SessionHandle openSessionWithImpersonation(String username, String password, - Map configuration, String delegationToken) throws HiveSQLException { - throw new HiveSQLException("open with impersonation operation is not supported in the client"); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#closeSession(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public void closeSession(SessionHandle sessionHandle) throws HiveSQLException { - try { - TCloseSessionReq req = new TCloseSessionReq(sessionHandle.toTSessionHandle()); - TCloseSessionResp resp = cliService.CloseSession(req); - checkStatus(resp.getStatus()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getInfo(org.apache.hive.service.cli.SessionHandle, java.util.List) - */ - @Override - public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType infoType) - throws HiveSQLException { - try { - // FIXME extract the right info type - TGetInfoReq req = new TGetInfoReq(sessionHandle.toTSessionHandle(), infoType.toTGetInfoType()); - TGetInfoResp resp = cliService.GetInfo(req); - checkStatus(resp.getStatus()); - return new GetInfoValue(resp.getInfoValue()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#executeStatement(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.util.Map) - */ - @Override - public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, - Map confOverlay) throws HiveSQLException { - return executeStatementInternal(sessionHandle, statement, confOverlay, false, 0); - } - - @Override - public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, - Map confOverlay, long queryTimeout) throws HiveSQLException { - return executeStatementInternal(sessionHandle, statement, confOverlay, false, queryTimeout); - } - - @Override - public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, - Map confOverlay) throws HiveSQLException { - return executeStatementInternal(sessionHandle, statement, confOverlay, true, 0); - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#executeStatementAsync(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.util.Map) - */ - @Override - public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, - Map confOverlay, long queryTimeout) throws HiveSQLException { - return executeStatementInternal(sessionHandle, statement, confOverlay, true, queryTimeout); - } - - private OperationHandle executeStatementInternal(SessionHandle sessionHandle, String statement, - Map confOverlay, boolean isAsync, long queryTimeout) throws HiveSQLException { - try { - TExecuteStatementReq req = - new TExecuteStatementReq(sessionHandle.toTSessionHandle(), statement); - req.setConfOverlay(confOverlay); - req.setRunAsync(isAsync); - req.setQueryTimeout(queryTimeout); - TExecuteStatementResp resp = cliService.ExecuteStatement(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getTypeInfo(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getTypeInfo(SessionHandle sessionHandle) throws HiveSQLException { - try { - TGetTypeInfoReq req = new TGetTypeInfoReq(sessionHandle.toTSessionHandle()); - TGetTypeInfoResp resp = cliService.GetTypeInfo(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getCatalogs(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getCatalogs(SessionHandle sessionHandle) throws HiveSQLException { - try { - TGetCatalogsReq req = new TGetCatalogsReq(sessionHandle.toTSessionHandle()); - TGetCatalogsResp resp = cliService.GetCatalogs(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getSchemas(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String) - */ - @Override - public OperationHandle getSchemas(SessionHandle sessionHandle, String catalogName, - String schemaName) - throws HiveSQLException { - try { - TGetSchemasReq req = new TGetSchemasReq(sessionHandle.toTSessionHandle()); - req.setCatalogName(catalogName); - req.setSchemaName(schemaName); - TGetSchemasResp resp = cliService.GetSchemas(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getTables(org.apache.hive.service.cli.SessionHandle, java.lang.String, java.lang.String, java.lang.String, java.util.List) - */ - @Override - public OperationHandle getTables(SessionHandle sessionHandle, String catalogName, - String schemaName, String tableName, List tableTypes) - throws HiveSQLException { - try { - TGetTablesReq req = new TGetTablesReq(sessionHandle.toTSessionHandle()); - req.setTableName(tableName); - req.setTableTypes(tableTypes); - req.setSchemaName(schemaName); - TGetTablesResp resp = cliService.GetTables(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getTableTypes(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getTableTypes(SessionHandle sessionHandle) throws HiveSQLException { - try { - TGetTableTypesReq req = new TGetTableTypesReq(sessionHandle.toTSessionHandle()); - TGetTableTypesResp resp = cliService.GetTableTypes(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getColumns(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getColumns(SessionHandle sessionHandle, - String catalogName, String schemaName, String tableName, String columnName) - throws HiveSQLException { - try { - TGetColumnsReq req = new TGetColumnsReq(); - req.setSessionHandle(sessionHandle.toTSessionHandle()); - req.setCatalogName(catalogName); - req.setSchemaName(schemaName); - req.setTableName(tableName); - req.setColumnName(columnName); - TGetColumnsResp resp = cliService.GetColumns(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getFunctions(org.apache.hive.service.cli.SessionHandle) - */ - @Override - public OperationHandle getFunctions(SessionHandle sessionHandle, - String catalogName, String schemaName, String functionName) throws HiveSQLException { - try { - TGetFunctionsReq req = new TGetFunctionsReq(sessionHandle.toTSessionHandle(), functionName); - req.setCatalogName(catalogName); - req.setSchemaName(schemaName); - TGetFunctionsResp resp = cliService.GetFunctions(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getOperationStatus(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public OperationStatus getOperationStatus(OperationHandle opHandle) throws HiveSQLException { - try { - TGetOperationStatusReq req = new TGetOperationStatusReq(opHandle.toTOperationHandle()); - TGetOperationStatusResp resp = cliService.GetOperationStatus(req); - // Checks the status of the RPC call, throws an exception in case of error - checkStatus(resp.getStatus()); - OperationState opState = OperationState.getOperationState(resp.getOperationState()); - HiveSQLException opException = null; - if (opState == OperationState.ERROR) { - opException = new HiveSQLException(resp.getErrorMessage(), resp.getSqlState(), resp.getErrorCode()); - } - return new OperationStatus(opState, opException); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#cancelOperation(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public void cancelOperation(OperationHandle opHandle) throws HiveSQLException { - try { - TCancelOperationReq req = new TCancelOperationReq(opHandle.toTOperationHandle()); - TCancelOperationResp resp = cliService.CancelOperation(req); - checkStatus(resp.getStatus()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#closeOperation(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public void closeOperation(OperationHandle opHandle) - throws HiveSQLException { - try { - TCloseOperationReq req = new TCloseOperationReq(opHandle.toTOperationHandle()); - TCloseOperationResp resp = cliService.CloseOperation(req); - checkStatus(resp.getStatus()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#getResultSetMetadata(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public TableSchema getResultSetMetadata(OperationHandle opHandle) - throws HiveSQLException { - try { - TGetResultSetMetadataReq req = new TGetResultSetMetadataReq(opHandle.toTOperationHandle()); - TGetResultSetMetadataResp resp = cliService.GetResultSetMetadata(req); - checkStatus(resp.getStatus()); - return new TableSchema(resp.getSchema()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - @Override - public RowSet fetchResults(OperationHandle opHandle, FetchOrientation orientation, long maxRows, - FetchType fetchType) throws HiveSQLException { - try { - TFetchResultsReq req = new TFetchResultsReq(); - req.setOperationHandle(opHandle.toTOperationHandle()); - req.setOrientation(orientation.toTFetchOrientation()); - req.setMaxRows(maxRows); - req.setFetchType(fetchType.toTFetchType()); - TFetchResultsResp resp = cliService.FetchResults(req); - checkStatus(resp.getStatus()); - return RowSetFactory.create(resp.getResults(), opHandle.getProtocolVersion()); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - /* (non-Javadoc) - * @see org.apache.hive.service.cli.ICLIService#fetchResults(org.apache.hive.service.cli.OperationHandle) - */ - @Override - public RowSet fetchResults(OperationHandle opHandle) throws HiveSQLException { - // TODO: set the correct default fetch size - return fetchResults(opHandle, FetchOrientation.FETCH_NEXT, 10000, FetchType.QUERY_OUTPUT); - } - - @Override - public String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String owner, String renewer) throws HiveSQLException { - TGetDelegationTokenReq req = new TGetDelegationTokenReq( - sessionHandle.toTSessionHandle(), owner, renewer); - try { - TGetDelegationTokenResp tokenResp = cliService.GetDelegationToken(req); - checkStatus(tokenResp.getStatus()); - return tokenResp.getDelegationToken(); - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - @Override - public void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException { - TCancelDelegationTokenReq cancelReq = new TCancelDelegationTokenReq( - sessionHandle.toTSessionHandle(), tokenStr); - try { - TCancelDelegationTokenResp cancelResp = - cliService.CancelDelegationToken(cancelReq); - checkStatus(cancelResp.getStatus()); - return; - } catch (TException e) { - throw new HiveSQLException(e); - } - } - - @Override - public void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, - String tokenStr) throws HiveSQLException { - TRenewDelegationTokenReq cancelReq = new TRenewDelegationTokenReq( - sessionHandle.toTSessionHandle(), tokenStr); - try { - TRenewDelegationTokenResp renewResp = - cliService.RenewDelegationToken(cancelReq); - checkStatus(renewResp.getStatus()); - return; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - @Override - public OperationHandle getPrimaryKeys(SessionHandle sessionHandle, - String catalog, String schema, String table) throws HiveSQLException { - try { - TGetPrimaryKeysReq req = new TGetPrimaryKeysReq(sessionHandle.toTSessionHandle()); - req.setCatalogName(catalog); - req.setSchemaName(schema); - req.setTableName(table); - TGetPrimaryKeysResp resp = cliService.GetPrimaryKeys(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } - - @Override - public OperationHandle getCrossReference(SessionHandle sessionHandle, - String primaryCatalog, String primarySchema, String primaryTable, - String foreignCatalog, String foreignSchema, String foreignTable) throws HiveSQLException { - try { - TGetCrossReferenceReq req = new TGetCrossReferenceReq(sessionHandle.toTSessionHandle()); - req.setParentCatalogName(primaryCatalog); - req.setParentSchemaName(primarySchema); - req.setParentTableName(primaryTable); - req.setForeignCatalogName(foreignCatalog); - req.setForeignSchemaName(foreignSchema); - req.setForeignTableName(foreignTable); - TGetCrossReferenceResp resp = cliService.GetCrossReference(req); - checkStatus(resp.getStatus()); - TProtocolVersion protocol = sessionHandle.getProtocolVersion(); - return new OperationHandle(resp.getOperationHandle(), protocol); - } catch (HiveSQLException e) { - throw e; - } catch (Exception e) { - throw new HiveSQLException(e); - } - } -} diff --git a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java b/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java deleted file mode 100644 index 08626e7eb146d..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java +++ /dev/null @@ -1,183 +0,0 @@ -/** - * 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. - */ - -package org.apache.hive.service.cli.thrift; - -import java.util.Arrays; -import java.util.concurrent.SynchronousQueue; -import java.util.concurrent.ThreadPoolExecutor; -import java.util.concurrent.TimeUnit; - -import org.apache.hadoop.hive.conf.HiveConf; -import org.apache.hadoop.hive.conf.HiveConf.ConfVars; -import org.apache.hadoop.hive.shims.ShimLoader; -import org.apache.hadoop.security.UserGroupInformation; -import org.apache.hadoop.util.Shell; -import org.apache.hive.service.auth.HiveAuthFactory; -import org.apache.hive.service.cli.CLIService; -import org.apache.hive.service.rpc.thrift.TCLIService; -import org.apache.hive.service.rpc.thrift.TCLIService.Iface; -import org.apache.hive.service.server.ThreadFactoryWithGarbageCleanup; -import org.apache.thrift.TProcessor; -import org.apache.thrift.protocol.TBinaryProtocol; -import org.apache.thrift.protocol.TProtocolFactory; -import org.apache.thrift.server.TServlet; -import org.eclipse.jetty.server.AbstractConnectionFactory; -import org.eclipse.jetty.server.ConnectionFactory; -import org.eclipse.jetty.server.HttpConnectionFactory; -import org.eclipse.jetty.server.ServerConnector; -import org.eclipse.jetty.servlet.ServletContextHandler; -import org.eclipse.jetty.servlet.ServletHolder; -import org.eclipse.jetty.util.ssl.SslContextFactory; -import org.eclipse.jetty.util.thread.ExecutorThreadPool; -import org.eclipse.jetty.util.thread.ScheduledExecutorScheduler; - - -public class ThriftHttpCLIService extends ThriftCLIService { - - public ThriftHttpCLIService(CLIService cliService) { - super(cliService, ThriftHttpCLIService.class.getSimpleName()); - } - - /** - * Configure Jetty to serve http requests. Example of a client connection URL: - * http://localhost:10000/servlets/thrifths2/ A gateway may cause actual target URL to differ, - * e.g. http://gateway:port/hive2/servlets/thrifths2/ - */ - @Override - public void run() { - try { - // Server thread pool - // Start with minWorkerThreads, expand till maxWorkerThreads and reject subsequent requests - String threadPoolName = "HiveServer2-HttpHandler-Pool"; - ThreadPoolExecutor executorService = new ThreadPoolExecutor(minWorkerThreads, maxWorkerThreads, - workerKeepAliveTime, TimeUnit.SECONDS, new SynchronousQueue(), - new ThreadFactoryWithGarbageCleanup(threadPoolName)); - ExecutorThreadPool threadPool = new ExecutorThreadPool(executorService); - - // HTTP Server - httpServer = new org.eclipse.jetty.server.Server(threadPool); - - // Connector configs - - ConnectionFactory[] connectionFactories; - boolean useSsl = hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_USE_SSL); - String schemeName = useSsl ? "https" : "http"; - // Change connector if SSL is used - if (useSsl) { - String keyStorePath = hiveConf.getVar(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH).trim(); - String keyStorePassword = ShimLoader.getHadoopShims().getPassword(hiveConf, - HiveConf.ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PASSWORD.varname); - if (keyStorePath.isEmpty()) { - throw new IllegalArgumentException(ConfVars.HIVE_SERVER2_SSL_KEYSTORE_PATH.varname - + " Not configured for SSL connection"); - } - SslContextFactory sslContextFactory = new SslContextFactory.Server(); - String[] excludedProtocols = hiveConf.getVar(ConfVars.HIVE_SSL_PROTOCOL_BLACKLIST).split(","); - LOG.info("HTTP Server SSL: adding excluded protocols: " + Arrays.toString(excludedProtocols)); - sslContextFactory.addExcludeProtocols(excludedProtocols); - LOG.info("HTTP Server SSL: SslContextFactory.getExcludeProtocols = " + - Arrays.toString(sslContextFactory.getExcludeProtocols())); - sslContextFactory.setKeyStorePath(keyStorePath); - sslContextFactory.setKeyStorePassword(keyStorePassword); - connectionFactories = AbstractConnectionFactory.getFactories( - sslContextFactory, new HttpConnectionFactory()); - } else { - connectionFactories = new ConnectionFactory[] { new HttpConnectionFactory() }; - } - ServerConnector connector = new ServerConnector( - httpServer, - null, - // Call this full constructor to set this, which forces daemon threads: - new ScheduledExecutorScheduler("HiveServer2-HttpHandler-JettyScheduler", true), - null, - -1, - -1, - connectionFactories); - - connector.setPort(portNum); - // Linux:yes, Windows:no - connector.setReuseAddress(!Shell.WINDOWS); - int maxIdleTime = (int) hiveConf.getTimeVar(ConfVars.HIVE_SERVER2_THRIFT_HTTP_MAX_IDLE_TIME, - TimeUnit.MILLISECONDS); - connector.setIdleTimeout(maxIdleTime); - - httpServer.addConnector(connector); - - // Thrift configs - hiveAuthFactory = new HiveAuthFactory(hiveConf); - TProcessor processor = new TCLIService.Processor(this); - TProtocolFactory protocolFactory = new TBinaryProtocol.Factory(); - // Set during the init phase of HiveServer2 if auth mode is kerberos - // UGI for the hive/_HOST (kerberos) principal - UserGroupInformation serviceUGI = cliService.getServiceUGI(); - // UGI for the http/_HOST (SPNego) principal - UserGroupInformation httpUGI = cliService.getHttpUGI(); - String authType = hiveConf.getVar(ConfVars.HIVE_SERVER2_AUTHENTICATION); - TServlet thriftHttpServlet = new ThriftHttpServlet(processor, protocolFactory, authType, - serviceUGI, httpUGI, hiveAuthFactory); - - // Context handler - final ServletContextHandler context = new ServletContextHandler( - ServletContextHandler.SESSIONS); - context.setContextPath("/"); - String httpPath = getHttpPath(hiveConf - .getVar(HiveConf.ConfVars.HIVE_SERVER2_THRIFT_HTTP_PATH)); - httpServer.setHandler(context); - context.addServlet(new ServletHolder(thriftHttpServlet), httpPath); - - // TODO: check defaults: maxTimeout, keepalive, maxBodySize, bodyRecieveDuration, etc. - // Finally, start the server - httpServer.start(); - String msg = "Started " + ThriftHttpCLIService.class.getSimpleName() + " in " + schemeName - + " mode on port " + portNum + " path=" + httpPath + " with " + minWorkerThreads + "..." - + maxWorkerThreads + " worker threads"; - LOG.info(msg); - httpServer.join(); - } catch (Throwable t) { - LOG.error( - "Error starting HiveServer2: could not start " - + ThriftHttpCLIService.class.getSimpleName(), t); - System.exit(-1); - } - } - - /** - * The config parameter can be like "path", "/path", "/path/", "path/*", "/path1/path2/*" and so on. - * httpPath should end up as "/*", "/path/*" or "/path1/../pathN/*" - * @param httpPath - * @return - */ - private String getHttpPath(String httpPath) { - if(httpPath == null || httpPath.equals("")) { - httpPath = "/*"; - } - else { - if(!httpPath.startsWith("/")) { - httpPath = "/" + httpPath; - } - if(httpPath.endsWith("/")) { - httpPath = httpPath + "*"; - } - if(!httpPath.endsWith("/*")) { - httpPath = httpPath + "/*"; - } - } - return httpPath; - } -} diff --git a/sql/hive-thriftserver/v2.3/src/main/scala/org/apache/spark/sql/hive/thriftserver/ThriftserverShimUtils.scala b/sql/hive-thriftserver/v2.3/src/main/scala/org/apache/spark/sql/hive/thriftserver/ThriftserverShimUtils.scala deleted file mode 100644 index 850382fe2bfd7..0000000000000 --- a/sql/hive-thriftserver/v2.3/src/main/scala/org/apache/spark/sql/hive/thriftserver/ThriftserverShimUtils.scala +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.hive.thriftserver - -import org.apache.hadoop.hive.ql.session.SessionState -import org.apache.hadoop.hive.serde2.thrift.Type -import org.apache.hadoop.hive.serde2.thrift.Type._ -import org.apache.hive.service.cli.{RowSet, RowSetFactory, TableSchema} -import org.apache.hive.service.rpc.thrift.TProtocolVersion._ -import org.slf4j.LoggerFactory - -/** - * Various utilities for hive-thriftserver used to upgrade the built-in Hive. - */ -private[thriftserver] object ThriftserverShimUtils { - - private[thriftserver] type TProtocolVersion = org.apache.hive.service.rpc.thrift.TProtocolVersion - private[thriftserver] type Client = org.apache.hive.service.rpc.thrift.TCLIService.Client - private[thriftserver] type TOpenSessionReq = org.apache.hive.service.rpc.thrift.TOpenSessionReq - private[thriftserver] type TGetSchemasReq = org.apache.hive.service.rpc.thrift.TGetSchemasReq - private[thriftserver] type TGetTablesReq = org.apache.hive.service.rpc.thrift.TGetTablesReq - private[thriftserver] type TGetColumnsReq = org.apache.hive.service.rpc.thrift.TGetColumnsReq - private[thriftserver] type TGetInfoReq = org.apache.hive.service.rpc.thrift.TGetInfoReq - private[thriftserver] type TExecuteStatementReq = - org.apache.hive.service.rpc.thrift.TExecuteStatementReq - - private[thriftserver] def getConsole: SessionState.LogHelper = { - val LOG = LoggerFactory.getLogger(classOf[SparkSQLCLIDriver]) - new SessionState.LogHelper(LOG) - } - - private[thriftserver] def resultRowSet( - getResultSetSchema: TableSchema, - getProtocolVersion: TProtocolVersion): RowSet = { - RowSetFactory.create(getResultSetSchema, getProtocolVersion, false) - } - - private[thriftserver] def toJavaSQLType(s: String): Int = Type.getType(s).toJavaSQLType - - private[thriftserver] def supportedType(): Seq[Type] = { - Seq(NULL_TYPE, BOOLEAN_TYPE, STRING_TYPE, BINARY_TYPE, - TINYINT_TYPE, SMALLINT_TYPE, INT_TYPE, BIGINT_TYPE, - FLOAT_TYPE, DOUBLE_TYPE, DECIMAL_TYPE, - DATE_TYPE, TIMESTAMP_TYPE, - ARRAY_TYPE, MAP_TYPE, STRUCT_TYPE) - } - - private[thriftserver] val testedProtocolVersions = Seq( - HIVE_CLI_SERVICE_PROTOCOL_V1, - HIVE_CLI_SERVICE_PROTOCOL_V2, - HIVE_CLI_SERVICE_PROTOCOL_V3, - HIVE_CLI_SERVICE_PROTOCOL_V4, - HIVE_CLI_SERVICE_PROTOCOL_V5, - HIVE_CLI_SERVICE_PROTOCOL_V6, - HIVE_CLI_SERVICE_PROTOCOL_V7, - HIVE_CLI_SERVICE_PROTOCOL_V8, - HIVE_CLI_SERVICE_PROTOCOL_V9, - HIVE_CLI_SERVICE_PROTOCOL_V10) -} diff --git a/sql/hive/benchmarks/InsertIntoHiveTableBenchmark-hive2.3-results.txt b/sql/hive/benchmarks/InsertIntoHiveTableBenchmark-hive2.3-results.txt new file mode 100644 index 0000000000000..080beb1a7e04c --- /dev/null +++ b/sql/hive/benchmarks/InsertIntoHiveTableBenchmark-hive2.3-results.txt @@ -0,0 +1,11 @@ +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz +insert hive table benchmark: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative +------------------------------------------------------------------------------------------------------------------------ +INSERT INTO DYNAMIC 3706 3988 399 0.0 361896.5 1.0X +INSERT INTO HYBRID 546 570 22 0.0 53358.1 6.8X +INSERT INTO STATIC 174 184 6 0.1 16982.0 21.3X +INSERT OVERWRITE DYNAMIC 3263 3290 39 0.0 318624.1 1.1X +INSERT OVERWRITE HYBRID 493 536 42 0.0 48105.7 7.5X +INSERT OVERWRITE STATIC 187 196 10 0.1 18240.2 19.8X + diff --git a/sql/hive/benchmarks/InsertIntoHiveTableBenchmark-jdk11-hive2.3-results.txt b/sql/hive/benchmarks/InsertIntoHiveTableBenchmark-jdk11-hive2.3-results.txt new file mode 100644 index 0000000000000..df4abe92db528 --- /dev/null +++ b/sql/hive/benchmarks/InsertIntoHiveTableBenchmark-jdk11-hive2.3-results.txt @@ -0,0 +1,11 @@ +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz +insert hive table benchmark: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative +------------------------------------------------------------------------------------------------------------------------ +INSERT INTO DYNAMIC 4281 4685 572 0.0 418070.8 1.0X +INSERT INTO HYBRID 776 834 56 0.0 75780.6 5.5X +INSERT INTO STATIC 196 215 14 0.1 19143.1 21.8X +INSERT OVERWRITE DYNAMIC 4597 4775 253 0.0 448878.6 0.9X +INSERT OVERWRITE HYBRID 722 737 22 0.0 70517.6 5.9X +INSERT OVERWRITE STATIC 193 211 14 0.1 18830.4 22.2X + diff --git a/sql/hive/benchmarks/ObjectHashAggregateExecBenchmark-jdk11-results.txt b/sql/hive/benchmarks/ObjectHashAggregateExecBenchmark-jdk11-results.txt index 4a8058766319f..90b7b9bede66d 100644 --- a/sql/hive/benchmarks/ObjectHashAggregateExecBenchmark-jdk11-results.txt +++ b/sql/hive/benchmarks/ObjectHashAggregateExecBenchmark-jdk11-results.txt @@ -2,44 +2,44 @@ Hive UDAF vs Spark AF ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz hive udaf vs spark af: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -hive udaf w/o group by 6492 7169 388 0.0 99066.1 1.0X -spark af w/o group by 58 88 24 1.1 890.2 111.3X -hive udaf w/ group by 4864 4888 33 0.0 74221.0 1.3X -spark af w/ group by w/o fallback 60 67 7 1.1 912.9 108.5X -spark af w/ group by w/ fallback 154 164 27 0.4 2348.2 42.2X +hive udaf w/o group by 7504 7577 56 0.0 114496.1 1.0X +spark af w/o group by 37 44 7 1.8 560.2 204.4X +hive udaf w/ group by 5867 6075 194 0.0 89527.2 1.3X +spark af w/ group by w/o fallback 40 46 6 1.6 608.7 188.1X +spark af w/ group by w/ fallback 50 55 5 1.3 764.4 149.8X ================================================================================================ ObjectHashAggregateExec vs SortAggregateExec - typed_count ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz object agg v.s. sort agg: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -sort agg w/ group by 51728 51728 0 2.0 493.3 1.0X -object agg w/ group by w/o fallback 10174 10218 34 10.3 97.0 5.1X -object agg w/ group by w/ fallback 29341 29537 277 3.6 279.8 1.8X -sort agg w/o group by 7541 7577 28 13.9 71.9 6.9X -object agg w/o group by w/o fallback 5574 5620 38 18.8 53.2 9.3X +sort agg w/ group by 41856 42278 597 2.5 399.2 1.0X +object agg w/ group by w/o fallback 12479 12754 320 8.4 119.0 3.4X +object agg w/ group by w/ fallback 25981 26058 109 4.0 247.8 1.6X +sort agg w/o group by 7351 7473 116 14.3 70.1 5.7X +object agg w/o group by w/o fallback 7095 7406 490 14.8 67.7 5.9X ================================================================================================ ObjectHashAggregateExec vs SortAggregateExec - percentile_approx ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz object agg v.s. sort agg: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -sort agg w/ group by 900 925 14 2.3 429.0 1.0X -object agg w/ group by w/o fallback 597 633 14 3.5 284.6 1.5X -object agg w/ group by w/ fallback 905 923 10 2.3 431.6 1.0X -sort agg w/o group by 611 631 10 3.4 291.4 1.5X -object agg w/o group by w/o fallback 559 576 11 3.8 266.5 1.6X +sort agg w/ group by 952 1047 92 2.2 453.9 1.0X +object agg w/ group by w/o fallback 829 957 90 2.5 395.2 1.1X +object agg w/ group by w/ fallback 972 1107 128 2.2 463.5 1.0X +sort agg w/o group by 732 858 98 2.9 349.1 1.3X +object agg w/o group by w/o fallback 770 897 92 2.7 367.4 1.2X diff --git a/sql/hive/benchmarks/ObjectHashAggregateExecBenchmark-results.txt b/sql/hive/benchmarks/ObjectHashAggregateExecBenchmark-results.txt index 8c58a5a5fdf0b..60486269993a6 100644 --- a/sql/hive/benchmarks/ObjectHashAggregateExecBenchmark-results.txt +++ b/sql/hive/benchmarks/ObjectHashAggregateExecBenchmark-results.txt @@ -2,44 +2,44 @@ Hive UDAF vs Spark AF ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz hive udaf vs spark af: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -hive udaf w/o group by 7014 7206 120 0.0 107031.0 1.0X -spark af w/o group by 47 59 11 1.4 716.9 149.3X -hive udaf w/ group by 4811 4831 28 0.0 73409.1 1.5X -spark af w/ group by w/o fallback 50 56 7 1.3 762.9 140.3X -spark af w/ group by w/ fallback 126 130 8 0.5 1916.6 55.8X +hive udaf w/o group by 4805 4881 55 0.0 73323.1 1.0X +spark af w/o group by 34 39 6 2.0 511.6 143.3X +hive udaf w/ group by 3770 3884 202 0.0 57526.2 1.3X +spark af w/ group by w/o fallback 34 39 5 1.9 525.7 139.5X +spark af w/ group by w/ fallback 39 44 5 1.7 596.5 122.9X ================================================================================================ ObjectHashAggregateExec vs SortAggregateExec - typed_count ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz object agg v.s. sort agg: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -sort agg w/ group by 42969 43306 476 2.4 409.8 1.0X -object agg w/ group by w/o fallback 9744 9844 145 10.8 92.9 4.4X -object agg w/ group by w/ fallback 26814 26960 206 3.9 255.7 1.6X -sort agg w/o group by 6278 6330 57 16.7 59.9 6.8X -object agg w/o group by w/o fallback 5433 5478 60 19.3 51.8 7.9X +sort agg w/ group by 30645 31295 919 3.4 292.3 1.0X +object agg w/ group by w/o fallback 7025 7425 425 14.9 67.0 4.4X +object agg w/ group by w/ fallback 17222 18169 1251 6.1 164.2 1.8X +sort agg w/o group by 4755 4827 143 22.1 45.3 6.4X +object agg w/o group by w/o fallback 4183 4495 269 25.1 39.9 7.3X ================================================================================================ ObjectHashAggregateExec vs SortAggregateExec - percentile_approx ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz object agg v.s. sort agg: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -sort agg w/ group by 756 773 9 2.8 360.3 1.0X -object agg w/ group by w/o fallback 548 560 7 3.8 261.3 1.4X -object agg w/ group by w/ fallback 759 773 7 2.8 362.0 1.0X -sort agg w/o group by 471 483 13 4.4 224.8 1.6X -object agg w/o group by w/o fallback 471 482 12 4.5 224.7 1.6X +sort agg w/ group by 625 673 29 3.4 297.9 1.0X +object agg w/ group by w/o fallback 509 549 24 4.1 242.9 1.2X +object agg w/ group by w/ fallback 600 652 33 3.5 286.2 1.0X +sort agg w/o group by 461 499 20 4.6 219.6 1.4X +object agg w/o group by w/o fallback 470 510 22 4.5 224.0 1.3X diff --git a/sql/hive/benchmarks/OrcReadBenchmark-jdk11-results.txt b/sql/hive/benchmarks/OrcReadBenchmark-jdk11-results.txt index d516d3369ad05..114a9c2b4e896 100644 --- a/sql/hive/benchmarks/OrcReadBenchmark-jdk11-results.txt +++ b/sql/hive/benchmarks/OrcReadBenchmark-jdk11-results.txt @@ -2,155 +2,155 @@ SQL Single Numeric Column Scan ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz SQL Single TINYINT Column Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 1750 1872 173 9.0 111.2 1.0X -Native ORC Vectorized 433 499 68 36.3 27.5 4.0X -Hive built-in ORC 2540 2575 49 6.2 161.5 0.7X +Native ORC MR 873 886 12 18.0 55.5 1.0X +Native ORC Vectorized 114 162 42 138.2 7.2 7.7X +Hive built-in ORC 1854 1924 99 8.5 117.9 0.5X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz SQL Single SMALLINT Column Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 1979 2001 31 7.9 125.8 1.0X -Native ORC Vectorized 261 303 42 60.3 16.6 7.6X -Hive built-in ORC 2559 2583 34 6.1 162.7 0.8X +Native ORC MR 1136 1330 275 13.8 72.2 1.0X +Native ORC Vectorized 191 288 85 82.1 12.2 5.9X +Hive built-in ORC 2056 2068 17 7.7 130.7 0.6X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz SQL Single INT Column Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 2094 2158 91 7.5 133.2 1.0X -Native ORC Vectorized 309 361 41 50.8 19.7 6.8X -Hive built-in ORC 2649 2744 135 5.9 168.4 0.8X +Native ORC MR 1389 1457 97 11.3 88.3 1.0X +Native ORC Vectorized 394 408 11 40.0 25.0 3.5X +Hive built-in ORC 2089 2105 23 7.5 132.8 0.7X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz SQL Single BIGINT Column Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 2256 2271 22 7.0 143.4 1.0X -Native ORC Vectorized 511 518 11 30.8 32.5 4.4X -Hive built-in ORC 2867 2880 19 5.5 182.3 0.8X +Native ORC MR 1361 1372 15 11.6 86.6 1.0X +Native ORC Vectorized 468 487 15 33.6 29.7 2.9X +Hive built-in ORC 2305 2323 25 6.8 146.6 0.6X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz SQL Single FLOAT Column Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 2270 2325 78 6.9 144.3 1.0X -Native ORC Vectorized 502 508 5 31.3 31.9 4.5X -Hive built-in ORC 2862 2880 24 5.5 182.0 0.8X +Native ORC MR 1278 1285 10 12.3 81.2 1.0X +Native ORC Vectorized 379 428 49 41.6 24.1 3.4X +Hive built-in ORC 2138 2143 6 7.4 135.9 0.6X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz SQL Single DOUBLE Column Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 2376 2426 71 6.6 151.0 1.0X -Native ORC Vectorized 609 616 8 25.8 38.7 3.9X -Hive built-in ORC 2979 2991 17 5.3 189.4 0.8X +Native ORC MR 1327 1341 20 11.9 84.3 1.0X +Native ORC Vectorized 443 466 21 35.5 28.1 3.0X +Hive built-in ORC 2476 2538 88 6.4 157.4 0.5X ================================================================================================ Int and String Scan ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz Int and String Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 4112 4232 170 2.6 392.1 1.0X -Native ORC Vectorized 2199 2223 35 4.8 209.7 1.9X -Hive built-in ORC 5150 5238 123 2.0 491.2 0.8X +Native ORC MR 2987 3079 130 3.5 284.9 1.0X +Native ORC Vectorized 1570 1582 16 6.7 149.8 1.9X +Hive built-in ORC 3680 3689 13 2.8 350.9 0.8X ================================================================================================ Partitioned Table Scan ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz Partitioned Table: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Data column - Native ORC MR 2398 2435 53 6.6 152.4 1.0X -Data column - Native ORC Vectorized 458 482 26 34.3 29.1 5.2X -Data column - Hive built-in ORC 3126 3171 64 5.0 198.8 0.8X -Partition column - Native ORC MR 1639 1680 58 9.6 104.2 1.5X -Partition column - Native ORC Vectorized 105 119 11 149.6 6.7 22.8X -Partition column - Hive built-in ORC 2223 2229 8 7.1 141.4 1.1X -Both columns - Native ORC MR 2588 2608 28 6.1 164.5 0.9X -Both columns - Native ORC Vectorized 489 522 49 32.2 31.1 4.9X -Both columns - Hive built-in ORC 3258 3292 48 4.8 207.1 0.7X +Data column - Native ORC MR 2264 2285 29 6.9 144.0 1.0X +Data column - Native ORC Vectorized 513 573 41 30.7 32.6 4.4X +Data column - Hive built-in ORC 3257 3303 65 4.8 207.1 0.7X +Partition column - Native ORC MR 1482 1500 24 10.6 94.2 1.5X +Partition column - Native ORC Vectorized 48 77 29 326.2 3.1 47.0X +Partition column - Hive built-in ORC 2104 2105 1 7.5 133.8 1.1X +Both columns - Native ORC MR 2414 2422 11 6.5 153.5 0.9X +Both columns - Native ORC Vectorized 527 566 46 29.8 33.5 4.3X +Both columns - Hive built-in ORC 3101 3123 31 5.1 197.2 0.7X ================================================================================================ Repeated String Scan ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz Repeated String: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 1991 2028 52 5.3 189.9 1.0X -Native ORC Vectorized 392 398 8 26.7 37.4 5.1X -Hive built-in ORC 2810 2816 8 3.7 268.0 0.7X +Native ORC MR 1440 1458 26 7.3 137.3 1.0X +Native ORC Vectorized 253 314 97 41.4 24.1 5.7X +Hive built-in ORC 1907 1915 11 5.5 181.9 0.8X ================================================================================================ String with Nulls Scan ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz String with Nulls Scan (0.0%): Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 3638 3647 13 2.9 346.9 1.0X -Native ORC Vectorized 1171 1181 14 9.0 111.7 3.1X -Hive built-in ORC 4847 4871 34 2.2 462.2 0.8X +Native ORC MR 2394 2484 128 4.4 228.3 1.0X +Native ORC Vectorized 811 819 10 12.9 77.3 3.0X +Hive built-in ORC 3317 3325 12 3.2 316.3 0.7X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz String with Nulls Scan (50.0%): Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 3280 3283 5 3.2 312.8 1.0X -Native ORC Vectorized 1199 1206 10 8.7 114.4 2.7X -Hive built-in ORC 4263 4273 14 2.5 406.5 0.8X +Native ORC MR 1920 1987 94 5.5 183.1 1.0X +Native ORC Vectorized 937 989 46 11.2 89.3 2.0X +Hive built-in ORC 2839 3060 313 3.7 270.7 0.7X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz String with Nulls Scan (95.0%): Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 1935 1950 21 5.4 184.6 1.0X -Native ORC Vectorized 451 459 10 23.2 43.1 4.3X -Hive built-in ORC 2542 2552 14 4.1 242.4 0.8X +Native ORC MR 1050 1060 14 10.0 100.1 1.0X +Native ORC Vectorized 283 357 88 37.1 27.0 3.7X +Hive built-in ORC 1745 1752 10 6.0 166.4 0.6X ================================================================================================ Single Column Scan From Wide Columns ================================================================================================ -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz Single Column Scan from 100 columns: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 270 292 23 3.9 257.2 1.0X -Native ORC Vectorized 143 155 12 7.3 136.2 1.9X -Hive built-in ORC 1593 1627 48 0.7 1519.1 0.2X +Native ORC MR 125 155 38 8.4 119.5 1.0X +Native ORC Vectorized 87 121 35 12.1 82.7 1.4X +Hive built-in ORC 1261 1401 198 0.8 1202.9 0.1X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz Single Column Scan from 200 columns: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 369 386 17 2.8 351.5 1.0X -Native ORC Vectorized 218 231 15 4.8 208.3 1.7X -Hive built-in ORC 3092 3101 12 0.3 2949.1 0.1X +Native ORC MR 151 197 47 7.0 143.8 1.0X +Native ORC Vectorized 90 121 36 11.7 85.7 1.7X +Hive built-in ORC 2285 2293 12 0.5 2178.9 0.1X -OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 11.0.10+9-LTS on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) Platinum 8171M CPU @ 2.60GHz Single Column Scan from 300 columns: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 498 531 33 2.1 475.0 1.0X -Native ORC Vectorized 360 376 18 2.9 342.9 1.4X -Hive built-in ORC 4786 4786 1 0.2 4564.1 0.1X +Native ORC MR 172 232 55 6.1 163.7 1.0X +Native ORC Vectorized 111 154 37 9.4 106.2 1.5X +Hive built-in ORC 3211 3218 10 0.3 3062.5 0.1X diff --git a/sql/hive/benchmarks/OrcReadBenchmark-results.txt b/sql/hive/benchmarks/OrcReadBenchmark-results.txt index c7d6c976192b2..c8f47da641dcf 100644 --- a/sql/hive/benchmarks/OrcReadBenchmark-results.txt +++ b/sql/hive/benchmarks/OrcReadBenchmark-results.txt @@ -2,155 +2,155 @@ SQL Single Numeric Column Scan ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz SQL Single TINYINT Column Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 1844 1851 10 8.5 117.2 1.0X -Native ORC Vectorized 284 312 36 55.5 18.0 6.5X -Hive built-in ORC 2380 2380 1 6.6 151.3 0.8X +Native ORC MR 897 922 25 17.5 57.0 1.0X +Native ORC Vectorized 117 128 13 134.6 7.4 7.7X +Hive built-in ORC 1328 1332 6 11.8 84.4 0.7X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz SQL Single SMALLINT Column Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 1999 2031 45 7.9 127.1 1.0X -Native ORC Vectorized 252 264 15 62.5 16.0 7.9X -Hive built-in ORC 2483 2509 37 6.3 157.9 0.8X +Native ORC MR 1003 1010 10 15.7 63.8 1.0X +Native ORC Vectorized 148 168 34 106.0 9.4 6.8X +Hive built-in ORC 1348 1364 23 11.7 85.7 0.7X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz SQL Single INT Column Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 2134 2135 2 7.4 135.7 1.0X -Native ORC Vectorized 329 351 34 47.8 20.9 6.5X -Hive built-in ORC 2672 2716 61 5.9 169.9 0.8X +Native ORC MR 1043 1047 6 15.1 66.3 1.0X +Native ORC Vectorized 168 174 10 93.8 10.7 6.2X +Hive built-in ORC 1398 1440 60 11.3 88.9 0.7X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz SQL Single BIGINT Column Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 2172 2247 105 7.2 138.1 1.0X -Native ORC Vectorized 407 427 23 38.7 25.9 5.3X -Hive built-in ORC 2806 2822 22 5.6 178.4 0.8X +Native ORC MR 1114 1182 96 14.1 70.8 1.0X +Native ORC Vectorized 249 259 17 63.3 15.8 4.5X +Hive built-in ORC 1533 1682 210 10.3 97.5 0.7X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz SQL Single FLOAT Column Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 2187 2200 19 7.2 139.0 1.0X -Native ORC Vectorized 451 457 5 34.9 28.7 4.8X -Hive built-in ORC 2886 2938 73 5.4 183.5 0.8X +Native ORC MR 1120 1127 10 14.0 71.2 1.0X +Native ORC Vectorized 228 232 4 69.1 14.5 4.9X +Hive built-in ORC 1474 1481 9 10.7 93.7 0.8X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz SQL Single DOUBLE Column Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 2313 2319 9 6.8 147.1 1.0X -Native ORC Vectorized 554 562 7 28.4 35.2 4.2X -Hive built-in ORC 2927 2933 8 5.4 186.1 0.8X +Native ORC MR 1177 1206 42 13.4 74.8 1.0X +Native ORC Vectorized 270 295 47 58.3 17.2 4.4X +Hive built-in ORC 1500 1504 6 10.5 95.4 0.8X ================================================================================================ Int and String Scan ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz Int and String Scan: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 4162 4294 186 2.5 397.0 1.0X -Native ORC Vectorized 2236 2258 32 4.7 213.2 1.9X -Hive built-in ORC 5054 5135 114 2.1 482.0 0.8X +Native ORC MR 2174 2184 14 4.8 207.3 1.0X +Native ORC Vectorized 1179 1195 22 8.9 112.4 1.8X +Hive built-in ORC 2639 2669 43 4.0 251.7 0.8X ================================================================================================ Partitioned Table Scan ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz Partitioned Table: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Data column - Native ORC MR 2436 2447 16 6.5 154.8 1.0X -Data column - Native ORC Vectorized 421 443 35 37.4 26.8 5.8X -Data column - Hive built-in ORC 3007 3026 27 5.2 191.2 0.8X -Partition column - Native ORC MR 1603 1630 39 9.8 101.9 1.5X -Partition column - Native ORC Vectorized 84 96 15 186.7 5.4 28.9X -Partition column - Hive built-in ORC 2174 2187 18 7.2 138.2 1.1X -Both columns - Native ORC MR 2609 2645 51 6.0 165.9 0.9X -Both columns - Native ORC Vectorized 460 470 9 34.2 29.3 5.3X -Both columns - Hive built-in ORC 3094 3099 8 5.1 196.7 0.8X +Data column - Native ORC MR 1502 1510 11 10.5 95.5 1.0X +Data column - Native ORC Vectorized 256 292 50 61.4 16.3 5.9X +Data column - Hive built-in ORC 1783 1793 15 8.8 113.3 0.8X +Partition column - Native ORC MR 968 979 11 16.2 61.6 1.6X +Partition column - Native ORC Vectorized 46 52 16 340.2 2.9 32.5X +Partition column - Hive built-in ORC 1370 1375 6 11.5 87.1 1.1X +Both columns - Native ORC MR 1516 1525 13 10.4 96.4 1.0X +Both columns - Native ORC Vectorized 288 298 10 54.6 18.3 5.2X +Both columns - Hive built-in ORC 1796 1827 44 8.8 114.2 0.8X ================================================================================================ Repeated String Scan ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz Repeated String: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 2036 2046 13 5.1 194.2 1.0X -Native ORC Vectorized 366 386 18 28.6 34.9 5.6X -Hive built-in ORC 2683 2686 4 3.9 255.9 0.8X +Native ORC MR 1035 1057 32 10.1 98.7 1.0X +Native ORC Vectorized 197 200 2 53.3 18.8 5.3X +Hive built-in ORC 1435 1453 25 7.3 136.9 0.7X ================================================================================================ String with Nulls Scan ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz String with Nulls Scan (0.0%): Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 3614 3643 40 2.9 344.7 1.0X -Native ORC Vectorized 1072 1087 22 9.8 102.2 3.4X -Hive built-in ORC 4625 4636 15 2.3 441.1 0.8X +Native ORC MR 1905 1927 31 5.5 181.7 1.0X +Native ORC Vectorized 563 645 80 18.6 53.7 3.4X +Hive built-in ORC 2469 2477 11 4.2 235.5 0.8X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz String with Nulls Scan (50.0%): Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 3347 3376 42 3.1 319.2 1.0X -Native ORC Vectorized 1220 1225 7 8.6 116.3 2.7X -Hive built-in ORC 4168 4184 23 2.5 397.5 0.8X +Native ORC MR 1733 1743 14 6.1 165.3 1.0X +Native ORC Vectorized 636 667 39 16.5 60.6 2.7X +Hive built-in ORC 2201 2267 93 4.8 209.9 0.8X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz String with Nulls Scan (95.0%): Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 1851 1862 16 5.7 176.5 1.0X -Native ORC Vectorized 466 471 7 22.5 44.4 4.0X -Hive built-in ORC 2523 2529 8 4.2 240.6 0.7X +Native ORC MR 966 1052 134 10.9 92.1 1.0X +Native ORC Vectorized 241 247 6 43.4 23.0 4.0X +Hive built-in ORC 1285 1287 3 8.2 122.5 0.8X ================================================================================================ Single Column Scan From Wide Columns ================================================================================================ -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz Single Column Scan from 100 columns: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 250 264 15 4.2 238.1 1.0X -Native ORC Vectorized 121 138 24 8.7 115.5 2.1X -Hive built-in ORC 1761 1792 43 0.6 1679.3 0.1X +Native ORC MR 124 134 17 8.5 118.3 1.0X +Native ORC Vectorized 64 71 12 16.5 60.8 1.9X +Hive built-in ORC 1037 1043 9 1.0 988.9 0.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz Single Column Scan from 200 columns: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 319 341 17 3.3 304.5 1.0X -Native ORC Vectorized 188 222 50 5.6 178.8 1.7X -Hive built-in ORC 3492 3508 24 0.3 3329.8 0.1X +Native ORC MR 143 154 16 7.3 136.6 1.0X +Native ORC Vectorized 85 92 13 12.4 80.7 1.7X +Hive built-in ORC 1987 1997 15 0.5 1894.5 0.1X -OpenJDK 64-Bit Server VM 1.8.0_232-8u232-b09-0ubuntu1~18.04.1-b09 on Linux 4.15.0-1044-aws -Intel(R) Xeon(R) CPU E5-2670 v2 @ 2.50GHz +OpenJDK 64-Bit Server VM 1.8.0_282-b08 on Linux 5.4.0-1043-azure +Intel(R) Xeon(R) CPU E5-2673 v3 @ 2.40GHz Single Column Scan from 300 columns: Best Time(ms) Avg Time(ms) Stdev(ms) Rate(M/s) Per Row(ns) Relative ------------------------------------------------------------------------------------------------------------------------ -Native ORC MR 443 456 12 2.4 422.9 1.0X -Native ORC Vectorized 306 321 23 3.4 292.0 1.4X -Hive built-in ORC 5295 5312 24 0.2 5049.9 0.1X +Native ORC MR 167 190 23 6.3 159.3 1.0X +Native ORC Vectorized 105 117 14 10.0 99.7 1.6X +Hive built-in ORC 2976 2985 13 0.4 2837.8 0.1X diff --git a/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala b/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala index db1f6fbd97d90..c263932c2f535 100644 --- a/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala +++ b/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveCompatibilitySuite.scala @@ -22,14 +22,15 @@ import java.io.File import org.scalatest.BeforeAndAfter import org.apache.spark.sql.catalyst.rules.RuleExecutor -import org.apache.spark.sql.hive.HiveUtils import org.apache.spark.sql.hive.test.TestHive import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.internal.SQLConf.StoreAssignmentPolicy +import org.apache.spark.tags.SlowHiveTest /** * Runs the test cases that are included in the hive distribution. */ +@SlowHiveTest class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { // TODO: bundle in jar files... get from classpath private lazy val hiveQueryDir = TestHive.getHiveFile( @@ -39,6 +40,8 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { private val originalInMemoryPartitionPruning = TestHive.conf.inMemoryPartitionPruning private val originalCrossJoinEnabled = TestHive.conf.crossJoinEnabled private val originalSessionLocalTimeZone = TestHive.conf.sessionLocalTimeZone + private val originalCreateHiveTable = + TestHive.conf.getConf(SQLConf.LEGACY_CREATE_HIVE_TABLE_BY_DEFAULT) def testCases: Seq[(String, File)] = { hiveQueryDir.listFiles.map(f => f.getName.stripSuffix(".q") -> f) @@ -53,11 +56,12 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { TestHive.setConf(SQLConf.IN_MEMORY_PARTITION_PRUNING, true) // Ensures that cross joins are enabled so that we can test them TestHive.setConf(SQLConf.CROSS_JOINS_ENABLED, true) - // Ensures that the table insertion behaivor is consistent with Hive + // Ensures that the table insertion behavior is consistent with Hive TestHive.setConf(SQLConf.STORE_ASSIGNMENT_POLICY, StoreAssignmentPolicy.LEGACY.toString) // Fix session local timezone to America/Los_Angeles for those timezone sensitive tests // (timestamp_*) TestHive.setConf(SQLConf.SESSION_LOCAL_TIMEZONE, "America/Los_Angeles") + TestHive.setConf(SQLConf.LEGACY_CREATE_HIVE_TABLE_BY_DEFAULT, true) RuleExecutor.resetMetrics() } @@ -68,6 +72,7 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { TestHive.setConf(SQLConf.IN_MEMORY_PARTITION_PRUNING, originalInMemoryPartitionPruning) TestHive.setConf(SQLConf.CROSS_JOINS_ENABLED, originalCrossJoinEnabled) TestHive.setConf(SQLConf.SESSION_LOCAL_TIMEZONE, originalSessionLocalTimeZone) + TestHive.setConf(SQLConf.LEGACY_CREATE_HIVE_TABLE_BY_DEFAULT, originalCreateHiveTable) // For debugging dump some statistics about how much time was spent in various optimizer rules logWarning(RuleExecutor.dumpTimeSpent()) @@ -77,7 +82,7 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { } /** A list of tests deemed out of scope currently and thus completely disregarded. */ - override def blackList: Seq[String] = Seq( + override def excludeList: Seq[String] = Seq( // These tests use hooks that are not on the classpath and thus break all subsequent execution. "hook_order", "hook_context_cs", @@ -300,7 +305,7 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { // Unsupported underscore syntax. "inputddl5", - // Thift is broken... + // Thrift is broken... "inputddl8", // Hive changed ordering of ddl: @@ -491,7 +496,7 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "drop_partitions_filter2", "drop_partitions_filter3", - // The following failes due to truncate table + // The following fails due to truncate table "truncate_table", // We do not support DFS command. @@ -508,7 +513,7 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { // This test uses CREATE EXTERNAL TABLE without specifying LOCATION "alter2", - // [SPARK-16248][SQL] Whitelist the list of Hive fallback functions + // [SPARK-16248][SQL] Include the list of Hive fallback functions "udf_field", "udf_reflect2", "udf_xpath", @@ -596,7 +601,7 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "udf_radians" ) - private def commonWhiteList = Seq( + private def commonIncludeList = Seq( "add_part_exist", "add_part_multiple", "add_partition_no_whitelist", @@ -711,7 +716,7 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "groupby_multi_insert_common_distinct", "groupby_multi_single_reducer2", "groupby_multi_single_reducer3", - "groupby_mutli_insert_common_distinct", + "groupby_multi_insert_common_distinct", "groupby_neg_float", "groupby_ppd", "groupby_ppr", @@ -953,8 +958,8 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { "subq2", "subquery_exists", "subquery_exists_having", - "subquery_notexists", - "subquery_notexists_having", + "subquery_nonexistent", + "subquery_nonexistent_having", "subquery_in_having", "tablename_with_select", "timestamp_comparison", @@ -1134,14 +1139,11 @@ class HiveCompatibilitySuite extends HiveQueryFileTest with BeforeAndAfter { ) /** - * The set of tests that are believed to be working in catalyst. Tests not on whiteList or - * blacklist are implicitly marked as ignored. + * The set of tests that are believed to be working in catalyst. Tests not on includeList or + * excludeList are implicitly marked as ignored. */ - override def whiteList: Seq[String] = if (HiveUtils.isHive23) { - commonWhiteList ++ Seq( + override def includeList: Seq[String] = + commonIncludeList ++ Seq( "decimal_1_1" ) - } else { - commonWhiteList - } } diff --git a/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveWindowFunctionQuerySuite.scala b/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveWindowFunctionQuerySuite.scala index 2c0970c85449f..1b801ad69564c 100644 --- a/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveWindowFunctionQuerySuite.scala +++ b/sql/hive/compatibility/src/test/scala/org/apache/spark/sql/hive/execution/HiveWindowFunctionQuerySuite.scala @@ -763,7 +763,7 @@ class HiveWindowFunctionQueryFileSuite } } - override def blackList: Seq[String] = Seq( + override def excludeList: Seq[String] = Seq( // Partitioned table functions are not supported. "ptf*", // tests of windowing.q are in HiveWindowFunctionQueryBaseSuite @@ -791,12 +791,12 @@ class HiveWindowFunctionQueryFileSuite "windowing_adjust_rowcontainer_sz" ) - override def whiteList: Seq[String] = Seq( + override def includeList: Seq[String] = Seq( "windowing_udaf2" ) - // Only run those query tests in the realWhileList (do not try other ignored query files). + // Only run those query tests in the realIncludeList (do not try other ignored query files). override def testCases: Seq[(String, File)] = super.testCases.filter { - case (name, _) => realWhiteList.contains(name) + case (name, _) => realIncludeList.contains(name) } } diff --git a/sql/hive/pom.xml b/sql/hive/pom.xml index 474c6066ed040..729d3f414287e 100644 --- a/sql/hive/pom.xml +++ b/sql/hive/pom.xml @@ -22,7 +22,7 @@ org.apache.spark spark-parent_2.12 - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../../pom.xml @@ -35,11 +35,6 @@ - - - ${hive.parquet.group} - parquet-hadoop-bundle - org.apache.spark spark-core_${scala.binary.version} @@ -77,6 +72,13 @@ test-jar test + + org.apache.parquet + parquet-hadoop + ${parquet.version} + test-jar + test + org.apache.avro avro-mapred - ${avro.mapred.classifier} commons-httpclient @@ -167,6 +166,11 @@ org.datanucleus datanucleus-core + + org.apache.hadoop + ${hadoop-client-runtime.artifact} + ${hadoop.deps.scope} + org.apache.thrift libthrift @@ -217,6 +221,15 @@ + + scala-2.13 + + + org.scala-lang.modules + scala-parallel-collections_${scala.binary.version} + + + diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala index 02a5117f005e8..2d72443a8b661 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala @@ -34,7 +34,7 @@ class HiveContext private[hive](_sparkSession: SparkSession) self => def this(sc: SparkContext) = { - this(SparkSession.builder().sparkContext(HiveUtils.withHiveExternalCatalog(sc)).getOrCreate()) + this(SparkSession.builder().enableHiveSupport().sparkContext(sc).getOrCreate()) } def this(sc: JavaSparkContext) = this(sc.sc) diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala index 2faf42028f3a2..7f50d522ff42c 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala @@ -40,8 +40,7 @@ import org.apache.spark.sql.catalyst.analysis.TableAlreadyExistsException import org.apache.spark.sql.catalyst.catalog._ import org.apache.spark.sql.catalyst.catalog.ExternalCatalogUtils._ import org.apache.spark.sql.catalyst.expressions._ -import org.apache.spark.sql.catalyst.util.CaseInsensitiveMap -import org.apache.spark.sql.connector.catalog.TableCatalog +import org.apache.spark.sql.catalyst.util.{CaseInsensitiveMap, DateTimeUtils} import org.apache.spark.sql.execution.command.DDLUtils import org.apache.spark.sql.execution.datasources.{PartitioningUtils, SourceOptions} import org.apache.spark.sql.hive.client.HiveClient @@ -61,6 +60,10 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat import HiveExternalCatalog._ import CatalogTableType._ + // SPARK-32256: Make sure `VersionInfo` is initialized before touching the isolated classloader. + // This is to ensure Hive can get the Hadoop version when using the isolated classloader. + org.apache.hadoop.util.VersionInfo.getVersion() + /** * A Hive client used to interact with the metastore. */ @@ -426,18 +429,8 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat val properties = new mutable.HashMap[String, String] properties.put(CREATED_SPARK_VERSION, table.createVersion) - - // Serialized JSON schema string may be too long to be stored into a single metastore table - // property. In this case, we split the JSON string and store each part as a separate table - // property. - val threshold = conf.get(SCHEMA_STRING_LENGTH_THRESHOLD) - val schemaJsonString = schema.json - // Split the JSON string. - val parts = schemaJsonString.grouped(threshold).toSeq - properties.put(DATASOURCE_SCHEMA_NUMPARTS, parts.size.toString) - parts.zipWithIndex.foreach { case (part, index) => - properties.put(s"$DATASOURCE_SCHEMA_PART_PREFIX$index", part) - } + CatalogTable.splitLargeTableProp( + DATASOURCE_SCHEMA, schema.json, properties.put, conf.get(SCHEMA_STRING_LENGTH_THRESHOLD)) if (partitionColumns.nonEmpty) { properties.put(DATASOURCE_SCHEMA_NUMPARTCOLS, partitionColumns.length.toString) @@ -741,8 +734,8 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat case None if table.tableType == VIEW => // If this is a view created by Spark 2.2 or higher versions, we should restore its schema // from table properties. - if (table.properties.contains(DATASOURCE_SCHEMA_NUMPARTS)) { - table = table.copy(schema = getSchemaFromTableProperties(table)) + CatalogTable.readLargeTableProp(table.properties, DATASOURCE_SCHEMA).foreach { schemaJson => + table = table.copy(schema = DataType.fromJson(schemaJson).asInstanceOf[StructType]) } // No provider in table properties, which means this is a Hive serde table. @@ -792,8 +785,9 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat // If this is a Hive serde table created by Spark 2.1 or higher versions, we should restore its // schema from table properties. - if (table.properties.contains(DATASOURCE_SCHEMA_NUMPARTS)) { - val schemaFromTableProps = getSchemaFromTableProperties(table) + val schemaJson = CatalogTable.readLargeTableProp(table.properties, DATASOURCE_SCHEMA) + if (schemaJson.isDefined) { + val schemaFromTableProps = DataType.fromJson(schemaJson.get).asInstanceOf[StructType] val partColumnNames = getPartitionColumnsFromTableProperties(table) val reorderedSchema = reorderSchema(schema = schemaFromTableProps, partColumnNames) @@ -829,11 +823,12 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat updateLocationInStorageProps(table, newPath = None).copy( locationUri = tableLocation.map(CatalogUtils.stringToURI(_))) } - val storageWithoutHiveGeneratedProperties = storageWithLocation.copy( - properties = storageWithLocation.properties.filterKeys(!HIVE_GENERATED_STORAGE_PROPERTIES(_))) + val storageWithoutHiveGeneratedProperties = storageWithLocation.copy(properties = + storageWithLocation.properties.filterKeys(!HIVE_GENERATED_STORAGE_PROPERTIES(_)).toMap) val partitionProvider = table.properties.get(TABLE_PARTITION_PROVIDER) - val schemaFromTableProps = getSchemaFromTableProperties(table) + val schemaFromTableProps = CatalogTable.readLargeTableProp(table.properties, DATASOURCE_SCHEMA) + .map(json => DataType.fromJson(json).asInstanceOf[StructType]).getOrElse(new StructType()) val partColumnNames = getPartitionColumnsFromTableProperties(table) val reorderedSchema = reorderSchema(schema = schemaFromTableProps, partColumnNames) @@ -844,7 +839,7 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat partitionColumnNames = partColumnNames, bucketSpec = getBucketSpecFromTableProperties(table), tracksPartitionsInCatalog = partitionProvider == Some(TABLE_PARTITION_PROVIDER_CATALOG), - properties = table.properties.filterKeys(!HIVE_GENERATED_TABLE_PROPERTIES(_))) + properties = table.properties.filterKeys(!HIVE_GENERATED_TABLE_PROPERTIES(_)).toMap) } override def tableExists(db: String, table: String): Boolean = withClient { @@ -947,9 +942,10 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat // Hive metastore is not case preserving and the partition columns are always lower cased. We need // to lower case the column names in partition specification before calling partition related Hive // APIs, to match this behaviour. - private def lowerCasePartitionSpec(spec: TablePartitionSpec): TablePartitionSpec = { + private def toMetaStorePartitionSpec(spec: TablePartitionSpec): TablePartitionSpec = { // scalastyle:off caselocale - spec.map { case (k, v) => k.toLowerCase -> v } + val lowNames = spec.map { case (k, v) => k.toLowerCase -> v } + ExternalCatalogUtils.convertNullPartitionValues(lowNames) // scalastyle:on caselocale } @@ -998,8 +994,9 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat } p.copy(storage = p.storage.copy(locationUri = Some(partitionPath.toUri))) } - val lowerCasedParts = partsWithLocation.map(p => p.copy(spec = lowerCasePartitionSpec(p.spec))) - client.createPartitions(db, table, lowerCasedParts, ignoreIfExists) + val metaStoreParts = partsWithLocation + .map(p => p.copy(spec = toMetaStorePartitionSpec(p.spec))) + client.createPartitions(db, table, metaStoreParts, ignoreIfExists) } override def dropPartitions( @@ -1011,7 +1008,7 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat retainData: Boolean): Unit = withClient { requireTableExists(db, table) client.dropPartitions( - db, table, parts.map(lowerCasePartitionSpec), ignoreIfNotExists, purge, retainData) + db, table, parts.map(toMetaStorePartitionSpec), ignoreIfNotExists, purge, retainData) } override def renamePartitions( @@ -1020,7 +1017,7 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat specs: Seq[TablePartitionSpec], newSpecs: Seq[TablePartitionSpec]): Unit = withClient { client.renamePartitions( - db, table, specs.map(lowerCasePartitionSpec), newSpecs.map(lowerCasePartitionSpec)) + db, table, specs.map(toMetaStorePartitionSpec), newSpecs.map(toMetaStorePartitionSpec)) val tableMeta = getTable(db, table) val partitionColumnNames = tableMeta.partitionColumnNames @@ -1036,7 +1033,7 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat val fs = tablePath.getFileSystem(hadoopConf) val newParts = newSpecs.map { spec => val rightPath = renamePartitionDirectory(fs, tablePath, partitionColumnNames, spec) - val partition = client.getPartition(db, table, lowerCasePartitionSpec(spec)) + val partition = client.getPartition(db, table, toMetaStorePartitionSpec(spec)) partition.copy(storage = partition.storage.copy(locationUri = Some(rightPath.toUri))) } alterPartitions(db, table, newParts) @@ -1121,7 +1118,7 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat val colStats = new mutable.HashMap[String, CatalogColumnStat] val colStatsProps = properties.filterKeys(_.startsWith(STATISTICS_COL_STATS_PREFIX)).map { case (k, v) => k.drop(STATISTICS_COL_STATS_PREFIX.length) -> v - } + }.toMap // Find all the column names by matching the KEY_VERSION properties for them. colStatsProps.keys.filter { @@ -1146,12 +1143,9 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat db: String, table: String, newParts: Seq[CatalogTablePartition]): Unit = withClient { - val lowerCasedParts = newParts.map(p => p.copy(spec = lowerCasePartitionSpec(p.spec))) - - val rawTable = getRawTable(db, table) - + val metaStoreParts = newParts.map(p => p.copy(spec = toMetaStorePartitionSpec(p.spec))) // convert partition statistics to properties so that we can persist them through hive api - val withStatsProps = lowerCasedParts.map { p => + val withStatsProps = metaStoreParts.map { p => if (p.stats.isDefined) { val statsProperties = statsToProperties(p.stats.get) p.copy(parameters = p.parameters ++ statsProperties) @@ -1167,7 +1161,7 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat db: String, table: String, spec: TablePartitionSpec): CatalogTablePartition = withClient { - val part = client.getPartition(db, table, lowerCasePartitionSpec(spec)) + val part = client.getPartition(db, table, toMetaStorePartitionSpec(spec)) restorePartitionMetadata(part, getTable(db, table)) } @@ -1205,7 +1199,7 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat db: String, table: String, spec: TablePartitionSpec): Option[CatalogTablePartition] = withClient { - client.getPartitionOption(db, table, lowerCasePartitionSpec(spec)).map { part => + client.getPartitionOption(db, table, toMetaStorePartitionSpec(spec)).map { part => restorePartitionMetadata(part, getTable(db, table)) } } @@ -1220,7 +1214,7 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat val catalogTable = getTable(db, table) val partColNameMap = buildLowerCasePartColNameMap(catalogTable).mapValues(escapePathName) val clientPartitionNames = - client.getPartitionNames(catalogTable, partialSpec.map(lowerCasePartitionSpec)) + client.getPartitionNames(catalogTable, partialSpec.map(toMetaStorePartitionSpec)) clientPartitionNames.map { partitionPath => val partSpec = PartitioningUtils.parsePathFragmentAsSeq(partitionPath) partSpec.map { case (partName, partValue) => @@ -1239,11 +1233,12 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat table: String, partialSpec: Option[TablePartitionSpec] = None): Seq[CatalogTablePartition] = withClient { val partColNameMap = buildLowerCasePartColNameMap(getTable(db, table)) - val res = client.getPartitions(db, table, partialSpec.map(lowerCasePartitionSpec)).map { part => - part.copy(spec = restorePartitionSpec(part.spec, partColNameMap)) + val metaStoreSpec = partialSpec.map(toMetaStorePartitionSpec) + val res = client.getPartitions(db, table, metaStoreSpec) + .map { part => part.copy(spec = restorePartitionSpec(part.spec, partColNameMap)) } - partialSpec match { + metaStoreSpec match { // This might be a bug of Hive: When the partition value inside the partial partition spec // contains dot, and we ask Hive to list partitions w.r.t. the partial partition spec, Hive // treats dot as matching any single character and may return more partitions than we @@ -1261,11 +1256,13 @@ private[spark] class HiveExternalCatalog(conf: SparkConf, hadoopConf: Configurat defaultTimeZoneId: String): Seq[CatalogTablePartition] = withClient { val rawTable = getRawTable(db, table) val catalogTable = restoreTableMetadata(rawTable) + val timeZoneId = CaseInsensitiveMap(catalogTable.storage.properties).getOrElse( + DateTimeUtils.TIMEZONE_OPTION, defaultTimeZoneId) val partColNameMap = buildLowerCasePartColNameMap(catalogTable) val clientPrunedPartitions = - client.getPartitionsByFilter(rawTable, predicates).map { part => + client.getPartitionsByFilter(rawTable, predicates, timeZoneId).map { part => part.copy(spec = restorePartitionSpec(part.spec, partColNameMap)) } prunePartitionsByFilter(catalogTable, clientPrunedPartitions, predicates, defaultTimeZoneId) @@ -1335,7 +1332,6 @@ object HiveExternalCatalog { val DATASOURCE_PROVIDER = DATASOURCE_PREFIX + "provider" val DATASOURCE_SCHEMA = DATASOURCE_PREFIX + "schema" val DATASOURCE_SCHEMA_PREFIX = DATASOURCE_SCHEMA + "." - val DATASOURCE_SCHEMA_NUMPARTS = DATASOURCE_SCHEMA_PREFIX + "numParts" val DATASOURCE_SCHEMA_NUMPARTCOLS = DATASOURCE_SCHEMA_PREFIX + "numPartCols" val DATASOURCE_SCHEMA_NUMSORTCOLS = DATASOURCE_SCHEMA_PREFIX + "numSortCols" val DATASOURCE_SCHEMA_NUMBUCKETS = DATASOURCE_SCHEMA_PREFIX + "numBuckets" @@ -1368,40 +1364,6 @@ object HiveExternalCatalog { val EMPTY_DATA_SCHEMA = new StructType() .add("col", "array", nullable = true, comment = "from deserializer") - // A persisted data source table always store its schema in the catalog. - private def getSchemaFromTableProperties(metadata: CatalogTable): StructType = { - val errorMessage = "Could not read schema from the hive metastore because it is corrupted." - val props = metadata.properties - val schema = props.get(DATASOURCE_SCHEMA) - if (schema.isDefined) { - // Originally, we used `spark.sql.sources.schema` to store the schema of a data source table. - // After SPARK-6024, we removed this flag. - // Although we are not using `spark.sql.sources.schema` any more, we need to still support. - DataType.fromJson(schema.get).asInstanceOf[StructType] - } else if (props.filterKeys(_.startsWith(DATASOURCE_SCHEMA_PREFIX)).isEmpty) { - // If there is no schema information in table properties, it means the schema of this table - // was empty when saving into metastore, which is possible in older version(prior to 2.1) of - // Spark. We should respect it. - new StructType() - } else { - val numSchemaParts = props.get(DATASOURCE_SCHEMA_NUMPARTS) - if (numSchemaParts.isDefined) { - val parts = (0 until numSchemaParts.get.toInt).map { index => - val part = metadata.properties.get(s"$DATASOURCE_SCHEMA_PART_PREFIX$index").orNull - if (part == null) { - throw new AnalysisException(errorMessage + - s" (missing part $index of the schema, ${numSchemaParts.get} parts are expected).") - } - part - } - // Stick all parts back to a single schema string. - DataType.fromJson(parts.mkString).asInstanceOf[StructType] - } else { - throw new AnalysisException(errorMessage) - } - } - } - private def getColumnNamesByType( props: Map[String, String], colType: String, diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala index 16e9014340244..37a1fc0bae655 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveInspectors.scala @@ -18,11 +18,12 @@ package org.apache.spark.sql.hive import java.lang.reflect.{ParameterizedType, Type, WildcardType} +import java.time.Duration import scala.collection.JavaConverters._ import org.apache.hadoop.{io => hadoopIo} -import org.apache.hadoop.hive.common.`type`.{HiveChar, HiveDecimal, HiveVarchar} +import org.apache.hadoop.hive.common.`type`.{HiveChar, HiveDecimal, HiveIntervalDayTime, HiveIntervalYearMonth, HiveVarchar} import org.apache.hadoop.hive.serde2.{io => hiveIo} import org.apache.hadoop.hive.serde2.objectinspector.{StructField => HiveStructField, _} import org.apache.hadoop.hive.serde2.objectinspector.primitive._ @@ -346,6 +347,17 @@ private[hive] trait HiveInspectors { withNullSafe(o => getTimestampWritable(o)) case _: TimestampObjectInspector => withNullSafe(o => DateTimeUtils.toJavaTimestamp(o.asInstanceOf[Long])) + case _: HiveIntervalDayTimeObjectInspector if x.preferWritable() => + withNullSafe(o => getHiveIntervalDayTimeWritable(o)) + case _: HiveIntervalDayTimeObjectInspector => + withNullSafe(o => { + val duration = IntervalUtils.microsToDuration(o.asInstanceOf[Long]) + new HiveIntervalDayTime(duration.getSeconds, duration.getNano) + }) + case _: HiveIntervalYearMonthObjectInspector if x.preferWritable() => + withNullSafe(o => getHiveIntervalYearMonthWritable(o)) + case _: HiveIntervalYearMonthObjectInspector => + withNullSafe(o => new HiveIntervalYearMonth(o.asInstanceOf[Int])) case _: VoidObjectInspector => (_: Any) => null // always be null for void object inspector } @@ -512,6 +524,13 @@ private[hive] trait HiveInspectors { _ => constant case poi: VoidObjectInspector => _ => null // always be null for void object inspector + case dt: WritableConstantHiveIntervalDayTimeObjectInspector => + val constant = dt.getWritableConstantValue.asInstanceOf[HiveIntervalDayTime] + _ => IntervalUtils.durationToMicros( + Duration.ofSeconds(constant.getTotalSeconds).plusNanos(constant.getNanos.toLong)) + case ym: WritableConstantHiveIntervalYearMonthObjectInspector => + val constant = ym.getWritableConstantValue.asInstanceOf[HiveIntervalYearMonth] + _ => constant.getTotalMonths case pi: PrimitiveObjectInspector => pi match { // We think HiveVarchar/HiveChar is also a String case hvoi: HiveVarcharObjectInspector if hvoi.preferWritable() => @@ -647,6 +666,42 @@ private[hive] trait HiveInspectors { null } } + case dt: HiveIntervalDayTimeObjectInspector if dt.preferWritable() => + data: Any => { + if (data != null) { + val dayTime = dt.getPrimitiveWritableObject(data).getHiveIntervalDayTime + IntervalUtils.durationToMicros( + Duration.ofSeconds(dayTime.getTotalSeconds).plusNanos(dayTime.getNanos.toLong)) + } else { + null + } + } + case dt: HiveIntervalDayTimeObjectInspector => + data: Any => { + if (data != null) { + val dayTime = dt.getPrimitiveJavaObject(data) + IntervalUtils.durationToMicros( + Duration.ofSeconds(dayTime.getTotalSeconds).plusNanos(dayTime.getNanos.toLong)) + } else { + null + } + } + case ym: HiveIntervalYearMonthObjectInspector if ym.preferWritable() => + data: Any => { + if (data != null) { + ym.getPrimitiveWritableObject(data).getHiveIntervalYearMonth.getTotalMonths + } else { + null + } + } + case ym: HiveIntervalYearMonthObjectInspector => + data: Any => { + if (data != null) { + ym.getPrimitiveJavaObject(data).getTotalMonths + } else { + null + } + } case _ => data: Any => { if (data != null) { @@ -694,7 +749,7 @@ private[hive] trait HiveInspectors { } data: Any => { if (data != null) { - InternalRow.fromSeq(unwrappers.map(_(data))) + InternalRow.fromSeq(unwrappers.map(_(data)).toSeq) } else { null } @@ -785,6 +840,10 @@ private[hive] trait HiveInspectors { case BinaryType => PrimitiveObjectInspectorFactory.javaByteArrayObjectInspector case DateType => PrimitiveObjectInspectorFactory.javaDateObjectInspector case TimestampType => PrimitiveObjectInspectorFactory.javaTimestampObjectInspector + case DayTimeIntervalType => + PrimitiveObjectInspectorFactory.javaHiveIntervalDayTimeObjectInspector + case YearMonthIntervalType => + PrimitiveObjectInspectorFactory.javaHiveIntervalYearMonthObjectInspector // TODO decimal precision? case DecimalType() => PrimitiveObjectInspectorFactory.javaHiveDecimalObjectInspector case StructType(fields) => @@ -830,6 +889,10 @@ private[hive] trait HiveInspectors { getDecimalWritableConstantObjectInspector(value) case Literal(_, NullType) => getPrimitiveNullWritableConstantObjectInspector + case Literal(_, DayTimeIntervalType) => + getHiveIntervalDayTimeWritableConstantObjectInspector + case Literal(_, YearMonthIntervalType) => + getHiveIntervalYearMonthWritableConstantObjectInspector case Literal(value, ArrayType(dt, _)) => val listObjectInspector = toInspector(dt) if (value == null) { @@ -872,7 +935,7 @@ private[hive] trait HiveInspectors { StructType(s.getAllStructFieldRefs.asScala.map(f => types.StructField( f.getFieldName, inspectorToDataType(f.getFieldObjectInspector), nullable = true) - )) + ).toSeq) case l: ListObjectInspector => ArrayType(inspectorToDataType(l.getListElementObjectInspector)) case m: MapObjectInspector => MapType( @@ -906,6 +969,10 @@ private[hive] trait HiveInspectors { case _: JavaDateObjectInspector => DateType case _: WritableTimestampObjectInspector => TimestampType case _: JavaTimestampObjectInspector => TimestampType + case _: WritableHiveIntervalDayTimeObjectInspector => DayTimeIntervalType + case _: JavaHiveIntervalDayTimeObjectInspector => DayTimeIntervalType + case _: WritableHiveIntervalYearMonthObjectInspector => YearMonthIntervalType + case _: JavaHiveIntervalYearMonthObjectInspector => YearMonthIntervalType case _: WritableVoidObjectInspector => NullType case _: JavaVoidObjectInspector => NullType } @@ -967,6 +1034,14 @@ private[hive] trait HiveInspectors { PrimitiveObjectInspectorFactory.getPrimitiveWritableConstantObjectInspector( TypeInfoFactory.voidTypeInfo, null) + private def getHiveIntervalDayTimeWritableConstantObjectInspector: ObjectInspector = + PrimitiveObjectInspectorFactory.getPrimitiveWritableConstantObjectInspector( + TypeInfoFactory.intervalDayTimeTypeInfo, null) + + private def getHiveIntervalYearMonthWritableConstantObjectInspector: ObjectInspector = + PrimitiveObjectInspectorFactory.getPrimitiveWritableConstantObjectInspector( + TypeInfoFactory.intervalYearMonthTypeInfo, null) + private def getStringWritable(value: Any): hadoopIo.Text = if (value == null) null else new hadoopIo.Text(value.asInstanceOf[UTF8String].getBytes) @@ -1024,6 +1099,22 @@ private[hive] trait HiveInspectors { new hiveIo.TimestampWritable(DateTimeUtils.toJavaTimestamp(value.asInstanceOf[Long])) } + private def getHiveIntervalDayTimeWritable(value: Any): hiveIo.HiveIntervalDayTimeWritable = + if (value == null) { + null + } else { + val duration = IntervalUtils.microsToDuration(value.asInstanceOf[Long]) + new hiveIo.HiveIntervalDayTimeWritable( + new HiveIntervalDayTime(duration.getSeconds, duration.getNano)) + } + + private def getHiveIntervalYearMonthWritable(value: Any): hiveIo.HiveIntervalYearMonthWritable = + if (value == null) { + null + } else { + new hiveIo.HiveIntervalYearMonthWritable(new HiveIntervalYearMonth(value.asInstanceOf[Int])) + } + private def getDecimalWritable(value: Any): hiveIo.HiveDecimalWritable = if (value == null) { null @@ -1039,6 +1130,7 @@ private[hive] trait HiveInspectors { private def decimalTypeInfo(decimalType: DecimalType): TypeInfo = decimalType match { case DecimalType.Fixed(precision, scale) => new DecimalTypeInfo(precision, scale) + case dt => throw new AnalysisException(s"${dt.catalogString} is not supported.") } def toTypeInfo: TypeInfo = dt match { @@ -1046,8 +1138,8 @@ private[hive] trait HiveInspectors { getListTypeInfo(elemType.toTypeInfo) case StructType(fields) => getStructTypeInfo( - java.util.Arrays.asList(fields.map(_.name) : _*), - java.util.Arrays.asList(fields.map(_.dataType.toTypeInfo) : _*)) + java.util.Arrays.asList(fields.map(_.name): _*), + java.util.Arrays.asList(fields.map(_.dataType.toTypeInfo): _*)) case MapType(keyType, valueType, _) => getMapTypeInfo(keyType.toTypeInfo, valueType.toTypeInfo) case BinaryType => binaryTypeInfo @@ -1063,6 +1155,11 @@ private[hive] trait HiveInspectors { case DateType => dateTypeInfo case TimestampType => timestampTypeInfo case NullType => voidTypeInfo + case DayTimeIntervalType => intervalDayTimeTypeInfo + case YearMonthIntervalType => intervalYearMonthTypeInfo + case dt => + throw new AnalysisException( + s"${dt.catalogString} cannot be converted to Hive TypeInfo") } } } diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala index 2981e391c0439..e02589e5cad00 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveMetastoreCatalog.scala @@ -131,12 +131,12 @@ private[hive] class HiveMetastoreCatalog(sparkSession: SparkSession) extends Log // Consider table and storage properties. For properties existing in both sides, storage // properties will supersede table properties. if (serde.contains("parquet")) { - val options = relation.tableMeta.properties.filterKeys(isParquetProperty) ++ + val options = relation.tableMeta.properties.filterKeys(isParquetProperty).toMap ++ relation.tableMeta.storage.properties + (ParquetOptions.MERGE_SCHEMA -> SQLConf.get.getConf(HiveUtils.CONVERT_METASTORE_PARQUET_WITH_SCHEMA_MERGING).toString) convertToLogicalRelation(relation, options, classOf[ParquetFileFormat], "parquet") } else { - val options = relation.tableMeta.properties.filterKeys(isOrcProperty) ++ + val options = relation.tableMeta.properties.filterKeys(isOrcProperty).toMap ++ relation.tableMeta.storage.properties if (SQLConf.get.getConf(SQLConf.ORC_IMPLEMENTATION) == "native") { convertToLogicalRelation( @@ -332,7 +332,7 @@ private[hive] object HiveMetastoreCatalog { metastoreSchema: StructType, inferredSchema: StructType): StructType = try { // scalastyle:off caselocale - // Find any nullable fields in mestastore schema that are missing from the inferred schema. + // Find any nullable fields in metastore schema that are missing from the inferred schema. val metastoreFields = metastoreSchema.map(f => f.name.toLowerCase -> f).toMap val missingNullables = metastoreFields .filterKeys(!inferredSchema.map(_.name.toLowerCase).contains(_)) diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionCatalog.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionCatalog.scala index bc7760c982aab..7cbaa8a0b6477 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionCatalog.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionCatalog.scala @@ -29,12 +29,11 @@ import org.apache.hadoop.hive.ql.udf.generic.{AbstractGenericUDAFResolver, Gener import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.catalyst.FunctionIdentifier -import org.apache.spark.sql.catalyst.analysis.FunctionRegistry -import org.apache.spark.sql.catalyst.catalog.{CatalogFunction, ExternalCatalog, FunctionResourceLoader, GlobalTempViewManager, SessionCatalog} +import org.apache.spark.sql.catalyst.analysis.{FunctionRegistry, TableFunctionRegistry} +import org.apache.spark.sql.catalyst.catalog._ import org.apache.spark.sql.catalyst.expressions.{Cast, Expression} import org.apache.spark.sql.catalyst.parser.ParserInterface import org.apache.spark.sql.hive.HiveShim.HiveFunctionWrapper -import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types.{DecimalType, DoubleType} import org.apache.spark.util.Utils @@ -44,7 +43,7 @@ private[sql] class HiveSessionCatalog( globalTempViewManagerBuilder: () => GlobalTempViewManager, val metastoreCatalog: HiveMetastoreCatalog, functionRegistry: FunctionRegistry, - conf: SQLConf, + tableFunctionRegistry: TableFunctionRegistry, hadoopConf: Configuration, parser: ParserInterface, functionResourceLoader: FunctionResourceLoader) @@ -52,11 +51,54 @@ private[sql] class HiveSessionCatalog( externalCatalogBuilder, globalTempViewManagerBuilder, functionRegistry, - conf, + tableFunctionRegistry, hadoopConf, parser, functionResourceLoader) { + private def makeHiveFunctionExpression( + name: String, + clazz: Class[_], + input: Seq[Expression]): Expression = { + var udfExpr: Option[Expression] = None + try { + // When we instantiate hive UDF wrapper class, we may throw exception if the input + // expressions don't satisfy the hive UDF, such as type mismatch, input number + // mismatch, etc. Here we catch the exception and throw AnalysisException instead. + if (classOf[UDF].isAssignableFrom(clazz)) { + udfExpr = Some(HiveSimpleUDF(name, new HiveFunctionWrapper(clazz.getName), input)) + udfExpr.get.dataType // Force it to check input data types. + } else if (classOf[GenericUDF].isAssignableFrom(clazz)) { + udfExpr = Some(HiveGenericUDF(name, new HiveFunctionWrapper(clazz.getName), input)) + udfExpr.get.dataType // Force it to check input data types. + } else if (classOf[AbstractGenericUDAFResolver].isAssignableFrom(clazz)) { + udfExpr = Some(HiveUDAFFunction(name, new HiveFunctionWrapper(clazz.getName), input)) + udfExpr.get.dataType // Force it to check input data types. + } else if (classOf[UDAF].isAssignableFrom(clazz)) { + udfExpr = Some(HiveUDAFFunction( + name, + new HiveFunctionWrapper(clazz.getName), + input, + isUDAFBridgeRequired = true)) + udfExpr.get.dataType // Force it to check input data types. + } else if (classOf[GenericUDTF].isAssignableFrom(clazz)) { + udfExpr = Some(HiveGenericUDTF(name, new HiveFunctionWrapper(clazz.getName), input)) + // Force it to check data types. + udfExpr.get.asInstanceOf[HiveGenericUDTF].elementSchema + } + } catch { + case NonFatal(e) => + val errorMsg = s"No handler for UDF/UDAF/UDTF '${clazz.getCanonicalName}': $e" + val analysisException = new AnalysisException(errorMsg) + analysisException.setStackTrace(e.getStackTrace) + throw analysisException + } + udfExpr.getOrElse { + throw new InvalidUDFClassException( + s"No handler for UDF/UDAF/UDTF '${clazz.getCanonicalName}'") + } + } + /** * Constructs a [[Expression]] based on the provided class that represents a function. * @@ -69,49 +111,14 @@ private[sql] class HiveSessionCatalog( // Current thread context classloader may not be the one loaded the class. Need to switch // context classloader to initialize instance properly. Utils.withContextClassLoader(clazz.getClassLoader) { - Try(super.makeFunctionExpression(name, clazz, input)).getOrElse { - var udfExpr: Option[Expression] = None - try { - // When we instantiate hive UDF wrapper class, we may throw exception if the input - // expressions don't satisfy the hive UDF, such as type mismatch, input number - // mismatch, etc. Here we catch the exception and throw AnalysisException instead. - if (classOf[UDF].isAssignableFrom(clazz)) { - udfExpr = Some(HiveSimpleUDF(name, new HiveFunctionWrapper(clazz.getName), input)) - udfExpr.get.dataType // Force it to check input data types. - } else if (classOf[GenericUDF].isAssignableFrom(clazz)) { - udfExpr = Some(HiveGenericUDF(name, new HiveFunctionWrapper(clazz.getName), input)) - udfExpr.get.dataType // Force it to check input data types. - } else if (classOf[AbstractGenericUDAFResolver].isAssignableFrom(clazz)) { - udfExpr = Some(HiveUDAFFunction(name, new HiveFunctionWrapper(clazz.getName), input)) - udfExpr.get.dataType // Force it to check input data types. - } else if (classOf[UDAF].isAssignableFrom(clazz)) { - udfExpr = Some(HiveUDAFFunction( - name, - new HiveFunctionWrapper(clazz.getName), - input, - isUDAFBridgeRequired = true)) - udfExpr.get.dataType // Force it to check input data types. - } else if (classOf[GenericUDTF].isAssignableFrom(clazz)) { - udfExpr = Some(HiveGenericUDTF(name, new HiveFunctionWrapper(clazz.getName), input)) - udfExpr.get.asInstanceOf[HiveGenericUDTF].elementSchema // Force it to check data types. - } - } catch { - case NonFatal(e) => - val noHandlerMsg = s"No handler for UDF/UDAF/UDTF '${clazz.getCanonicalName}': $e" - val errorMsg = - if (classOf[GenericUDTF].isAssignableFrom(clazz)) { - s"$noHandlerMsg\nPlease make sure your function overrides " + - "`public StructObjectInspector initialize(ObjectInspector[] args)`." - } else { - noHandlerMsg - } - val analysisException = new AnalysisException(errorMsg) - analysisException.setStackTrace(e.getStackTrace) - throw analysisException - } - udfExpr.getOrElse { - throw new AnalysisException(s"No handler for UDF/UDAF/UDTF '${clazz.getCanonicalName}'") - } + try { + super.makeFunctionExpression(name, clazz, input) + } catch { + // If `super.makeFunctionExpression` throw `InvalidUDFClassException`, we construct + // Hive UDF/UDAF/UDTF with function definition. Otherwise, we just throw it earlier. + case _: InvalidUDFClassException => + makeHiveFunctionExpression(name, clazz, input) + case NonFatal(e) => throw e } } } diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionStateBuilder.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionStateBuilder.scala index 64726755237a6..7bf9b283de99c 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionStateBuilder.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveSessionStateBuilder.scala @@ -17,27 +17,29 @@ package org.apache.spark.sql.hive -import org.apache.spark.annotation.Unstable import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.analysis.{Analyzer, ResolveSessionCatalog} import org.apache.spark.sql.catalyst.catalog.ExternalCatalogWithListener -import org.apache.spark.sql.catalyst.optimizer.Optimizer import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan import org.apache.spark.sql.catalyst.rules.Rule -import org.apache.spark.sql.execution.{SparkOptimizer, SparkPlanner} +import org.apache.spark.sql.execution.SparkPlanner +import org.apache.spark.sql.execution.aggregate.ResolveEncodersInScalaAgg import org.apache.spark.sql.execution.analysis.DetectAmbiguousSelfJoin import org.apache.spark.sql.execution.command.CommandCheck import org.apache.spark.sql.execution.datasources._ import org.apache.spark.sql.execution.datasources.v2.TableCapabilityCheck +import org.apache.spark.sql.execution.streaming.ResolveWriteToStream import org.apache.spark.sql.hive.client.HiveClient import org.apache.spark.sql.hive.execution.PruneHiveTablePartitions import org.apache.spark.sql.internal.{BaseSessionStateBuilder, SessionResourceLoader, SessionState} +import org.apache.spark.util.Utils /** * Builder that produces a Hive-aware `SessionState`. */ -@Unstable -class HiveSessionStateBuilder(session: SparkSession, parentState: Option[SessionState] = None) +class HiveSessionStateBuilder( + session: SparkSession, + parentState: Option[SessionState]) extends BaseSessionStateBuilder(session, parentState) { private def externalCatalog: ExternalCatalogWithListener = session.sharedState.externalCatalog @@ -59,7 +61,7 @@ class HiveSessionStateBuilder(session: SparkSession, parentState: Option[Session () => session.sharedState.globalTempViewManager, new HiveMetastoreCatalog(session), functionRegistry, - conf, + tableFunctionRegistry, SessionState.newHadoopConf(session.sparkContext.hadoopConfiguration, conf), sqlParser, resourceLoader) @@ -70,23 +72,24 @@ class HiveSessionStateBuilder(session: SparkSession, parentState: Option[Session /** * A logical query plan `Analyzer` with rules specific to Hive. */ - override protected def analyzer: Analyzer = new Analyzer(catalogManager, conf) { + override protected def analyzer: Analyzer = new Analyzer(catalogManager) { override val extendedResolutionRules: Seq[Rule[LogicalPlan]] = new ResolveHiveSerdeTable(session) +: new FindDataSourceTable(session) +: new ResolveSQLOnFile(session) +: new FallBackFileSourceV2(session) +: - new ResolveSessionCatalog( - catalogManager, conf, catalog.isTempView, catalog.isTempFunction) +: + ResolveEncodersInScalaAgg +: + new ResolveSessionCatalog(catalogManager) +: + ResolveWriteToStream +: customResolutionRules override val postHocResolutionRules: Seq[Rule[LogicalPlan]] = - new DetectAmbiguousSelfJoin(conf) +: + DetectAmbiguousSelfJoin +: new DetermineTableStats(session) +: - RelationConversions(conf, catalog) +: + RelationConversions(catalog) +: PreprocessTableCreation(session) +: - PreprocessTableInsertion(conf) +: - DataSourceAnalysis(conf) +: + PreprocessTableInsertion +: + DataSourceAnalysis +: HiveAnalysis +: customPostHocResolutionRules @@ -94,7 +97,7 @@ class HiveSessionStateBuilder(session: SparkSession, parentState: Option[Session PreWriteCheck +: PreReadCheck +: TableCapabilityCheck +: - CommandCheck(conf) +: + CommandCheck +: customCheckRules } @@ -105,11 +108,12 @@ class HiveSessionStateBuilder(session: SparkSession, parentState: Option[Session * Planner that takes into account Hive-specific strategies. */ override protected def planner: SparkPlanner = { - new SparkPlanner(session, conf, experimentalMethods) with HiveStrategies { + new SparkPlanner(session, experimentalMethods) with HiveStrategies { override val sparkSession: SparkSession = session override def extraPlanningStrategies: Seq[Strategy] = - super.extraPlanningStrategies ++ customPlanningStrategies ++ Seq(HiveTableScans, Scripts) + super.extraPlanningStrategies ++ customPlanningStrategies ++ + Seq(HiveTableScans, HiveScripts) } } @@ -122,7 +126,10 @@ class HiveSessionResourceLoader( extends SessionResourceLoader(session) { private lazy val client = clientBuilder() override def addJar(path: String): Unit = { - client.addJar(path) - super.addJar(path) + val uri = Utils.resolveURI(path) + resolveJars(uri).foreach { p => + client.addJar(p) + super.addJar(p) + } } } diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala index 04a6a8f8aa9a5..3a53a2a8dadd8 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveShim.scala @@ -17,18 +17,16 @@ package org.apache.spark.sql.hive -import java.io.{InputStream, OutputStream} -import java.lang.reflect.Method import java.rmi.server.UID import scala.collection.JavaConverters._ import scala.language.implicitConversions -import scala.reflect.ClassTag import com.google.common.base.Objects import org.apache.avro.Schema import org.apache.hadoop.conf.Configuration import org.apache.hadoop.fs.Path +import org.apache.hadoop.hive.ql.exec.SerializationUtilities import org.apache.hadoop.hive.ql.exec.UDF import org.apache.hadoop.hive.ql.plan.{FileSinkDesc, TableDesc} import org.apache.hadoop.hive.ql.udf.generic.GenericUDFMacro @@ -148,60 +146,12 @@ private[hive] object HiveShim { case _ => false } - private lazy val serUtilClass = - Utils.classForName("org.apache.hadoop.hive.ql.exec.SerializationUtilities") - private lazy val utilClass = Utils.classForName("org.apache.hadoop.hive.ql.exec.Utilities") - private val deserializeMethodName = "deserializeObjectByKryo" - private val serializeMethodName = "serializeObjectByKryo" - - private def findMethod(klass: Class[_], name: String, args: Class[_]*): Method = { - val method = klass.getDeclaredMethod(name, args: _*) - method.setAccessible(true) - method - } - def deserializePlan[UDFType](is: java.io.InputStream, clazz: Class[_]): UDFType = { - if (HiveUtils.isHive23) { - val borrowKryo = serUtilClass.getMethod("borrowKryo") - val kryo = borrowKryo.invoke(serUtilClass) - val deserializeObjectByKryo = findMethod(serUtilClass, deserializeMethodName, - kryo.getClass.getSuperclass, classOf[InputStream], classOf[Class[_]]) - try { - deserializeObjectByKryo.invoke(null, kryo, is, clazz).asInstanceOf[UDFType] - } finally { - serUtilClass.getMethod("releaseKryo", kryo.getClass.getSuperclass).invoke(null, kryo) - } - } else { - val runtimeSerializationKryo = utilClass.getField("runtimeSerializationKryo") - val threadLocalValue = runtimeSerializationKryo.get(utilClass) - val getMethod = threadLocalValue.getClass.getMethod("get") - val kryo = getMethod.invoke(threadLocalValue) - val deserializeObjectByKryo = findMethod(utilClass, deserializeMethodName, - kryo.getClass, classOf[InputStream], classOf[Class[_]]) - deserializeObjectByKryo.invoke(null, kryo, is, clazz).asInstanceOf[UDFType] - } + SerializationUtilities.deserializePlan(is, clazz).asInstanceOf[UDFType] } def serializePlan(function: AnyRef, out: java.io.OutputStream): Unit = { - if (HiveUtils.isHive23) { - val borrowKryo = serUtilClass.getMethod("borrowKryo") - val kryo = borrowKryo.invoke(serUtilClass) - val serializeObjectByKryo = findMethod(serUtilClass, serializeMethodName, - kryo.getClass.getSuperclass, classOf[Object], classOf[OutputStream]) - try { - serializeObjectByKryo.invoke(null, kryo, function, out) - } finally { - serUtilClass.getMethod("releaseKryo", kryo.getClass.getSuperclass).invoke(null, kryo) - } - } else { - val runtimeSerializationKryo = utilClass.getField("runtimeSerializationKryo") - val threadLocalValue = runtimeSerializationKryo.get(utilClass) - val getMethod = threadLocalValue.getClass.getMethod("get") - val kryo = getMethod.invoke(threadLocalValue) - val serializeObjectByKryo = findMethod(utilClass, serializeMethodName, - kryo.getClass, classOf[Object], classOf[OutputStream]) - serializeObjectByKryo.invoke(null, kryo, function, out) - } + SerializationUtilities.serializePlan(function, out) } def writeExternal(out: java.io.ObjectOutput): Unit = { diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala index b9c98f4ea15e9..2bca463217f78 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveStrategies.scala @@ -28,11 +28,13 @@ import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.planning._ import org.apache.spark.sql.catalyst.plans.logical.{InsertIntoDir, InsertIntoStatement, LogicalPlan, ScriptTransformation, Statistics} import org.apache.spark.sql.catalyst.rules.Rule +import org.apache.spark.sql.connector.catalog.CatalogV2Util.assertNoNullTypeInSchema import org.apache.spark.sql.execution._ import org.apache.spark.sql.execution.command.{CreateTableCommand, DDLUtils} -import org.apache.spark.sql.execution.datasources.CreateTable +import org.apache.spark.sql.execution.datasources.{CreateTable, DataSourceStrategy} import org.apache.spark.sql.hive.execution._ -import org.apache.spark.sql.internal.{HiveSerDe, SQLConf} +import org.apache.spark.sql.hive.execution.HiveScriptTransformationExec +import org.apache.spark.sql.internal.HiveSerDe /** @@ -48,7 +50,7 @@ class ResolveHiveSerdeTable(session: SparkSession) extends Rule[LogicalPlan] { throw new AnalysisException("Creating bucketed Hive serde table is not supported yet.") } - val defaultStorage = HiveSerDe.getDefaultStorage(session.sessionState.conf) + val defaultStorage = HiveSerDe.getDefaultStorage(conf) val options = new HiveOptions(table.storage.properties) val fileStorage = if (options.fileFormat.isDefined) { @@ -115,7 +117,6 @@ class DetermineTableStats(session: SparkSession) extends Rule[LogicalPlan] { private def hiveTableWithStats(relation: HiveTableRelation): HiveTableRelation = { val table = relation.tableMeta val partitionCols = relation.partitionCols - val conf = session.sessionState.conf // For partitioned tables, the partition directory may be outside of the table directory. // Which is expensive to get table size. Please see how we implemented it in the AnalyzeTable. val sizeInBytes = if (conf.fallBackToHdfsForStatsEnabled && partitionCols.isEmpty) { @@ -144,7 +145,7 @@ class DetermineTableStats(session: SparkSession) extends Rule[LogicalPlan] { // handles InsertIntoStatement specially as the table in InsertIntoStatement is not added in its // children, hence not matched directly by previous HiveTableRelation case. - case i @ InsertIntoStatement(relation: HiveTableRelation, _, _, _, _) + case i @ InsertIntoStatement(relation: HiveTableRelation, _, _, _, _, _) if DDLUtils.isHiveTable(relation.tableMeta) && relation.tableMeta.stats.isEmpty => i.copy(table = hiveTableWithStats(relation)) } @@ -158,7 +159,8 @@ class DetermineTableStats(session: SparkSession) extends Rule[LogicalPlan] { */ object HiveAnalysis extends Rule[LogicalPlan] { override def apply(plan: LogicalPlan): LogicalPlan = plan resolveOperators { - case InsertIntoStatement(r: HiveTableRelation, partSpec, query, overwrite, ifPartitionNotExists) + case InsertIntoStatement( + r: HiveTableRelation, partSpec, _, query, overwrite, ifPartitionNotExists) if DDLUtils.isHiveTable(r.tableMeta) => InsertIntoHiveTable(r.tableMeta, partSpec, query, overwrite, ifPartitionNotExists, query.output.map(_.name)) @@ -189,7 +191,6 @@ object HiveAnalysis extends Rule[LogicalPlan] { * `PreprocessTableCreation`, `PreprocessTableInsertion`, `DataSourceAnalysis` and `HiveAnalysis`. */ case class RelationConversions( - conf: SQLConf, sessionCatalog: HiveSessionCatalog) extends Rule[LogicalPlan] { private def isConvertible(relation: HiveTableRelation): Boolean = { isConvertible(relation.tableMeta) @@ -197,8 +198,8 @@ case class RelationConversions( private def isConvertible(tableMeta: CatalogTable): Boolean = { val serde = tableMeta.storage.serde.getOrElse("").toLowerCase(Locale.ROOT) - serde.contains("parquet") && SQLConf.get.getConf(HiveUtils.CONVERT_METASTORE_PARQUET) || - serde.contains("orc") && SQLConf.get.getConf(HiveUtils.CONVERT_METASTORE_ORC) + serde.contains("parquet") && conf.getConf(HiveUtils.CONVERT_METASTORE_PARQUET) || + serde.contains("orc") && conf.getConf(HiveUtils.CONVERT_METASTORE_ORC) } private val metastoreCatalog = sessionCatalog.metastoreCatalog @@ -207,11 +208,11 @@ case class RelationConversions( plan resolveOperators { // Write path case InsertIntoStatement( - r: HiveTableRelation, partition, query, overwrite, ifPartitionNotExists) + r: HiveTableRelation, partition, cols, query, overwrite, ifPartitionNotExists) if query.resolved && DDLUtils.isHiveTable(r.tableMeta) && - (!r.isPartitioned || SQLConf.get.getConf(HiveUtils.CONVERT_INSERTING_PARTITIONED_TABLE)) + (!r.isPartitioned || conf.getConf(HiveUtils.CONVERT_INSERTING_PARTITIONED_TABLE)) && isConvertible(r) => - InsertIntoStatement(metastoreCatalog.convert(r), partition, + InsertIntoStatement(metastoreCatalog.convert(r), partition, cols, query, overwrite, ifPartitionNotExists) // Read path @@ -221,10 +222,13 @@ case class RelationConversions( // CTAS case CreateTable(tableDesc, mode, Some(query)) - if DDLUtils.isHiveTable(tableDesc) && tableDesc.partitionColumnNames.isEmpty && - isConvertible(tableDesc) && SQLConf.get.getConf(HiveUtils.CONVERT_METASTORE_CTAS) => + if query.resolved && DDLUtils.isHiveTable(tableDesc) && + tableDesc.partitionColumnNames.isEmpty && isConvertible(tableDesc) && + conf.getConf(HiveUtils.CONVERT_METASTORE_CTAS) => // validation is required to be done here before relation conversion. DDLUtils.checkDataColNames(tableDesc.copy(schema = query.schema)) + // This is for CREATE TABLE .. STORED AS PARQUET/ORC AS SELECT null + assertNoNullTypeInSchema(query.schema) OptimizedCreateHiveTableAsSelectCommand( tableDesc, query, query.output.map(_.name), mode) } @@ -237,11 +241,11 @@ private[hive] trait HiveStrategies { val sparkSession: SparkSession - object Scripts extends Strategy { + object HiveScripts extends Strategy { def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match { - case ScriptTransformation(input, script, output, child, ioschema) => - val hiveIoSchema = HiveScriptIOSchema(ioschema) - ScriptTransformationExec(input, script, output, planLater(child), hiveIoSchema) :: Nil + case ScriptTransformation(script, output, child, ioschema) => + val hiveIoSchema = ScriptTransformationIOSchema(ioschema) + HiveScriptTransformationExec(script, output, planLater(child), hiveIoSchema) :: Nil case _ => Nil } } @@ -252,20 +256,21 @@ private[hive] trait HiveStrategies { */ object HiveTableScans extends Strategy { def apply(plan: LogicalPlan): Seq[SparkPlan] = plan match { - case ScanOperation(projectList, predicates, relation: HiveTableRelation) => + case ScanOperation(projectList, filters, relation: HiveTableRelation) => // Filter out all predicates that only deal with partition keys, these are given to the // hive table scan operator to be used for partition pruning. val partitionKeyIds = AttributeSet(relation.partitionCols) - val (pruningPredicates, otherPredicates) = predicates.partition { predicate => - !predicate.references.isEmpty && - predicate.references.subsetOf(partitionKeyIds) - } + val normalizedFilters = DataSourceStrategy.normalizeExprs( + filters.filter(_.deterministic), relation.output) + + val partitionKeyFilters = DataSourceStrategy.getPushedDownFilters(relation.partitionCols, + normalizedFilters) pruneFilterProject( projectList, - otherPredicates, + filters.filter(f => f.references.isEmpty || !f.references.subsetOf(partitionKeyIds)), identity[Seq[Expression]], - HiveTableScanExec(_, relation, pruningPredicates)(sparkSession)) :: Nil + HiveTableScanExec(_, relation, partitionKeyFilters.toSeq)(sparkSession)) :: Nil case _ => Nil } diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala index 04caf57efdc74..8c2f02cfa1185 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveUtils.scala @@ -24,7 +24,7 @@ import java.util.concurrent.TimeUnit import scala.collection.JavaConverters._ import scala.collection.mutable.HashMap -import scala.language.implicitConversions +import scala.util.Try import org.apache.commons.lang3.{JavaVersion, SystemUtils} import org.apache.hadoop.conf.Configuration @@ -34,53 +34,54 @@ import org.apache.hadoop.hive.ql.session.SessionState import org.apache.hadoop.util.VersionInfo import org.apache.hive.common.util.HiveVersionInfo -import org.apache.spark.{SparkConf, SparkContext} +import org.apache.spark.SparkConf import org.apache.spark.deploy.SparkHadoopUtil import org.apache.spark.internal.Logging import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.catalog.CatalogTable import org.apache.spark.sql.execution.command.DDLUtils +import org.apache.spark.sql.execution.datasources.DataSource import org.apache.spark.sql.hive.client._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.internal.SQLConf._ -import org.apache.spark.sql.internal.StaticSQLConf.{CATALOG_IMPLEMENTATION, WAREHOUSE_PATH} +import org.apache.spark.sql.internal.StaticSQLConf.WAREHOUSE_PATH import org.apache.spark.sql.types._ import org.apache.spark.util.{ChildFirstURLClassLoader, Utils} private[spark] object HiveUtils extends Logging { - def withHiveExternalCatalog(sc: SparkContext): SparkContext = { - sc.conf.set(CATALOG_IMPLEMENTATION.key, "hive") - sc - } + /** The version of hive used internally by Spark SQL. */ + val builtinHiveVersion: String = HiveVersionInfo.getVersion - private val hiveVersion = HiveVersionInfo.getVersion - val isHive23: Boolean = hiveVersion.startsWith("2.3") + val BUILTIN_HIVE_VERSION = buildStaticConf("spark.sql.hive.version") + .doc("The compiled, a.k.a, builtin Hive version of the Spark distribution bundled with." + + " Note that, this a read-only conf and only used to report the built-in hive version." + + " If you want a different metastore client for Spark to call, please refer to" + + " spark.sql.hive.metastore.version.") + .version("1.1.1") + .stringConf + .checkValue(_ == builtinHiveVersion, + "The builtin Hive version is read-only, please use spark.sql.hive.metastore.version") + .createWithDefault(builtinHiveVersion) - /** The version of hive used internally by Spark SQL. */ - val builtinHiveVersion: String = if (isHive23) hiveVersion else "1.2.1" + private def isCompatibleHiveVersion(hiveVersionStr: String): Boolean = { + Try { IsolatedClientLoader.hiveVersion(hiveVersionStr) }.isSuccess + } val HIVE_METASTORE_VERSION = buildStaticConf("spark.sql.hive.metastore.version") .doc("Version of the Hive metastore. Available options are " + - "0.12.0 through 2.3.7 and " + + "0.12.0 through 2.3.8 and " + "3.0.0 through 3.1.2.") .version("1.4.0") .stringConf + .checkValue(isCompatibleHiveVersion, "Unsupported Hive Metastore version") .createWithDefault(builtinHiveVersion) - // A fake config which is only here for backward compatibility reasons. This config has no effect - // to Spark, just for reporting the builtin Hive version of Spark to existing applications that - // already rely on this config. - val FAKE_HIVE_VERSION = buildConf("spark.sql.hive.version") - .doc(s"deprecated, please use ${HIVE_METASTORE_VERSION.key} to get the Hive version in Spark.") - .version("1.1.1") - .fallbackConf(HIVE_METASTORE_VERSION) - val HIVE_METASTORE_JARS = buildStaticConf("spark.sql.hive.metastore.jars") .doc(s""" | Location of the jars that should be used to instantiate the HiveMetastoreClient. - | This property can be one of three options: " + | This property can be one of four options: | 1. "builtin" | Use Hive ${builtinHiveVersion}, which is bundled with the Spark assembly when | -Phive is enabled. When this option is chosen, @@ -88,12 +89,35 @@ private[spark] object HiveUtils extends Logging { | ${builtinHiveVersion} or not defined. | 2. "maven" | Use Hive jars of specified version downloaded from Maven repositories. - | 3. A classpath in the standard format for both Hive and Hadoop. + | 3. "path" + | Use Hive jars configured by `spark.sql.hive.metastore.jars.path` + | in comma separated format. Support both local or remote paths.The provided jars + | should be the same version as ${HIVE_METASTORE_VERSION}. + | 4. A classpath in the standard format for both Hive and Hadoop. The provided jars + | should be the same version as ${HIVE_METASTORE_VERSION}. """.stripMargin) .version("1.4.0") .stringConf .createWithDefault("builtin") + val HIVE_METASTORE_JARS_PATH = buildStaticConf("spark.sql.hive.metastore.jars.path") + .doc(s""" + | Comma-separated paths of the jars that used to instantiate the HiveMetastoreClient. + | This configuration is useful only when `{$HIVE_METASTORE_JARS.key}` is set as `path`. + | The paths can be any of the following format: + | 1. file://path/to/jar/foo.jar + | 2. hdfs://nameservice/path/to/jar/foo.jar + | 3. /path/to/jar/ (path without URI scheme follow conf `fs.defaultFS`'s URI schema) + | 4. [http/https/ftp]://path/to/jar/foo.jar + | Note that 1, 2, and 3 support wildcard. For example: + | 1. file://path/to/jar/*,file://path2/to/jar/*/*.jar + | 2. hdfs://nameservice/path/to/jar/*,hdfs://nameservice2/path/to/jar/*/*.jar + """.stripMargin) + .version("3.1.0") + .stringConf + .toSequence + .createWithDefault(Nil) + val CONVERT_METASTORE_PARQUET = buildConf("spark.sql.hive.convertMetastoreParquet") .doc("When set to true, the built-in Parquet reader and writer are used to process " + "parquet tables created by using the HiveQL syntax, instead of Hive serde.") @@ -178,6 +202,7 @@ private[spark] object HiveUtils extends Logging { * The location of the jars that should be used to instantiate the HiveMetastoreClient. This * property can be one of three options: * - a classpath in the standard format for both hive and hadoop. + * - path - attempt to discover the jars with paths configured by `HIVE_METASTORE_JARS_PATH`. * - builtin - attempt to discover the jars that were used to load Spark SQL and use those. This * option is only valid when using the execution version of Hive. * - maven - download the correct version of hive on demand from maven. @@ -186,6 +211,13 @@ private[spark] object HiveUtils extends Logging { conf.getConf(HIVE_METASTORE_JARS) } + /** + * Hive jars paths, only work when `HIVE_METASTORE_JARS` is `path`. + */ + private def hiveMetastoreJarsPath(conf: SQLConf): Seq[String] = { + conf.getConf(HIVE_METASTORE_JARS_PATH) + } + /** * A comma separated list of class prefixes that should be loaded using the classloader that * is shared between Spark SQL and a specific version of Hive. An example of classes that should @@ -336,6 +368,20 @@ private[spark] object HiveUtils extends Logging { val hiveMetastoreBarrierPrefixes = HiveUtils.hiveMetastoreBarrierPrefixes(sqlConf) val metaVersion = IsolatedClientLoader.hiveVersion(hiveMetastoreVersion) + def addLocalHiveJars(file: File): Seq[URL] = { + if (file.getName == "*") { + val files = file.getParentFile.listFiles() + if (files == null) { + logWarning(s"Hive jar path '${file.getPath}' does not exist.") + Nil + } else { + files.filter(_.getName.toLowerCase(Locale.ROOT).endsWith(".jar")).map(_.toURI.toURL).toSeq + } + } else { + file.toURI.toURL :: Nil + } + } + val isolatedLoader = if (hiveMetastoreJars == "builtin") { if (builtinHiveVersion != hiveMetastoreVersion) { throw new IllegalArgumentException( @@ -396,24 +442,43 @@ private[spark] object HiveUtils extends Logging { config = configurations, barrierPrefixes = hiveMetastoreBarrierPrefixes, sharedPrefixes = hiveMetastoreSharedPrefixes) + } else if (hiveMetastoreJars == "path") { + // Convert to files and expand any directories. + val jars = + HiveUtils.hiveMetastoreJarsPath(sqlConf) + .flatMap { + case path if path.contains("\\") && Utils.isWindows => + addLocalHiveJars(new File(path)) + case path => + DataSource.checkAndGlobPathIfNecessary( + pathStrings = Seq(path), + hadoopConf = hadoopConf, + checkEmptyGlobPath = true, + checkFilesExist = false, + enableGlobbing = true + ).map(_.toUri.toURL) + } + + logInfo( + s"Initializing HiveMetastoreConnection version $hiveMetastoreVersion " + + s"using path: ${jars.mkString(";")}") + new IsolatedClientLoader( + version = metaVersion, + sparkConf = conf, + hadoopConf = hadoopConf, + execJars = jars, + config = configurations, + isolationOn = true, + barrierPrefixes = hiveMetastoreBarrierPrefixes, + sharedPrefixes = hiveMetastoreSharedPrefixes) } else { // Convert to files and expand any directories. val jars = hiveMetastoreJars .split(File.pathSeparator) - .flatMap { - case path if new File(path).getName == "*" => - val files = new File(path).getParentFile.listFiles() - if (files == null) { - logWarning(s"Hive jar path '$path' does not exist.") - Nil - } else { - files.filter(_.getName.toLowerCase(Locale.ROOT).endsWith(".jar")) - } - case path => - new File(path) :: Nil - } - .map(_.toURI.toURL) + .flatMap { path => + addLocalHiveJars(new File(path)) + } logInfo( s"Initializing HiveMetastoreConnection version $hiveMetastoreVersion " + @@ -505,7 +570,7 @@ private[spark] object HiveUtils extends Logging { // partition columns are part of the schema val partCols = hiveTable.getPartCols.asScala.map(HiveClientImpl.fromHiveColumn) val dataCols = hiveTable.getCols.asScala.map(HiveClientImpl.fromHiveColumn) - table.copy(schema = StructType(dataCols ++ partCols)) + table.copy(schema = StructType((dataCols ++ partCols).toSeq)) } } } diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/TableReader.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/TableReader.scala index 4d18eb6289418..96949a33a137a 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/TableReader.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/TableReader.scala @@ -28,6 +28,7 @@ import org.apache.hadoop.hive.ql.exec.Utilities import org.apache.hadoop.hive.ql.metadata.{Partition => HivePartition, Table => HiveTable} import org.apache.hadoop.hive.ql.plan.TableDesc import org.apache.hadoop.hive.serde2.Deserializer +import org.apache.hadoop.hive.serde2.avro.AvroSerdeUtils.AvroTableProperties import org.apache.hadoop.hive.serde2.objectinspector.{ObjectInspectorConverters, StructObjectInspector} import org.apache.hadoop.hive.serde2.objectinspector.primitive._ import org.apache.hadoop.io.Writable @@ -39,7 +40,7 @@ import org.apache.spark.deploy.SparkHadoopUtil import org.apache.spark.internal.Logging import org.apache.spark.rdd.{EmptyRDD, HadoopRDD, NewHadoopRDD, RDD, UnionRDD} import org.apache.spark.sql.SparkSession -import org.apache.spark.sql.catalyst.InternalRow +import org.apache.spark.sql.catalyst.{InternalRow, SQLConfHelper} import org.apache.spark.sql.catalyst.analysis.CastSupport import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.util.DateTimeUtils @@ -68,7 +69,7 @@ class HadoopTableReader( @transient private val tableDesc: TableDesc, @transient private val sparkSession: SparkSession, hadoopConf: Configuration) - extends TableReader with CastSupport with Logging { + extends TableReader with CastSupport with SQLConfHelper with Logging { // Hadoop honors "mapreduce.job.maps" as hint, // but will ignore when mapreduce.jobtracker.address is "local". @@ -239,6 +240,8 @@ class HadoopTableReader( fillPartitionKeys(partValues, mutableRow) val tableProperties = tableDesc.getProperties + val avroSchemaProperties = Seq(AvroTableProperties.SCHEMA_LITERAL, + AvroTableProperties.SCHEMA_URL).map(_.getPropName()) // Create local references so that the outer object isn't serialized. val localTableDesc = tableDesc @@ -248,10 +251,15 @@ class HadoopTableReader( // SPARK-13709: For SerDes like AvroSerDe, some essential information (e.g. Avro schema // information) may be defined in table properties. Here we should merge table properties // and partition properties before initializing the deserializer. Note that partition - // properties take a higher priority here. For example, a partition may have a different - // SerDe as the one defined in table properties. + // properties take a higher priority here except for the Avro table properties + // to support schema evolution: in that case the properties given at table level will + // be used (for details please check SPARK-26836). + // For example, a partition may have a different SerDe as the one defined in table + // properties. val props = new Properties(tableProperties) - partProps.asScala.foreach { + partProps.asScala.filterNot { case (k, _) => + avroSchemaProperties.contains(k) && tableProperties.containsKey(k) + }.foreach { case (key, value) => props.setProperty(key, value) } DeserializerLock.synchronized { @@ -308,7 +316,7 @@ class HadoopTableReader( /** * Creates a HadoopRDD based on the broadcasted HiveConf and other job properties that will be - * applied locally on each slave. + * applied locally on each executor. */ private def createOldHadoopRDD(tableDesc: TableDesc, path: String): RDD[Writable] = { val initializeJobConfFunc = HadoopTableReader.initializeLocalJobConfFunc(path, tableDesc) _ @@ -330,7 +338,7 @@ class HadoopTableReader( /** * Creates a NewHadoopRDD based on the broadcasted HiveConf and other job properties that will be - * applied locally on each slave. + * applied locally on each executor. */ private def createNewHadoopRDD(tableDesc: TableDesc, path: String): RDD[Writable] = { val newJobConf = new JobConf(hadoopConf) @@ -486,13 +494,19 @@ private[hive] object HadoopTableReader extends HiveInspectors with Logging { var i = 0 val length = fieldRefs.length while (i < length) { - val fieldValue = soi.getStructFieldData(raw, fieldRefs(i)) - if (fieldValue == null) { - mutableRow.setNullAt(fieldOrdinals(i)) - } else { - unwrappers(i)(fieldValue, mutableRow, fieldOrdinals(i)) + try { + val fieldValue = soi.getStructFieldData(raw, fieldRefs(i)) + if (fieldValue == null) { + mutableRow.setNullAt(fieldOrdinals(i)) + } else { + unwrappers(i)(fieldValue, mutableRow, fieldOrdinals(i)) + } + i += 1 + } catch { + case ex: Throwable => + logError(s"Exception thrown in field <${fieldRefs(i).getFieldName}>") + throw ex } - i += 1 } mutableRow: InternalRow diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClient.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClient.scala index 3ea80eaf6f714..48f3837740933 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClient.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClient.scala @@ -233,7 +233,8 @@ private[hive] trait HiveClient { /** Returns partitions filtered by predicates for the given table. */ def getPartitionsByFilter( catalogTable: CatalogTable, - predicates: Seq[Expression]): Seq[CatalogTablePartition] + predicates: Seq[Expression], + timeZoneId: String): Seq[CatalogTablePartition] /** Loads a static partition into an existing table. */ def loadPartition( diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala index 6ad5e9d3c9080..e9728b8c0461d 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala @@ -17,8 +17,9 @@ package org.apache.spark.sql.hive.client -import java.io.{File, PrintStream} +import java.io.PrintStream import java.lang.{Iterable => JIterable} +import java.lang.reflect.InvocationTargetException import java.nio.charset.StandardCharsets.UTF_8 import java.util.{Locale, Map => JMap} import java.util.concurrent.TimeUnit._ @@ -48,19 +49,19 @@ import org.apache.spark.internal.Logging import org.apache.spark.metrics.source.HiveCatalogMetrics import org.apache.spark.sql.AnalysisException import org.apache.spark.sql.catalyst.TableIdentifier -import org.apache.spark.sql.catalyst.analysis.{NoSuchDatabaseException, NoSuchPartitionException} +import org.apache.spark.sql.catalyst.analysis.{NoSuchDatabaseException, NoSuchPartitionException, NoSuchPartitionsException, PartitionAlreadyExistsException, PartitionsAlreadyExistException} import org.apache.spark.sql.catalyst.catalog._ import org.apache.spark.sql.catalyst.catalog.CatalogTypes.TablePartitionSpec import org.apache.spark.sql.catalyst.expressions.Expression import org.apache.spark.sql.catalyst.parser.{CatalystSqlParser, ParseException} +import org.apache.spark.sql.catalyst.util.CharVarcharUtils import org.apache.spark.sql.connector.catalog.SupportsNamespaces._ import org.apache.spark.sql.execution.QueryExecutionException import org.apache.spark.sql.hive.HiveExternalCatalog -import org.apache.spark.sql.hive.HiveExternalCatalog.{DATASOURCE_SCHEMA, DATASOURCE_SCHEMA_NUMPARTS, DATASOURCE_SCHEMA_PART_PREFIX} -import org.apache.spark.sql.hive.HiveUtils +import org.apache.spark.sql.hive.HiveExternalCatalog.DATASOURCE_SCHEMA import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types._ -import org.apache.spark.util.{CircularBuffer, Utils} +import org.apache.spark.util.{CircularBuffer, ShutdownHookManager, Utils} /** * A class that wraps the HiveClient and converts its responses to externally visible classes. @@ -154,6 +155,25 @@ private[hive] class HiveClientImpl( } } + private def closeState(): Unit = withHiveState { + // These temp files are registered in o.a.h.u.ShutdownHookManager too during state start. + // The state.close() will delete them if they are not null and try remove them from the + // o.a.h.u.ShutdownHookManager which causes undesirable IllegalStateException. + // We delete them ahead with a high priority hook here and set them to null to bypass the + // deletion in state.close(). + if (state.getTmpOutputFile != null) { + state.getTmpOutputFile.delete() + state.setTmpOutputFile(null) + } + if (state.getTmpErrOutputFile != null) { + state.getTmpErrOutputFile.delete() + state.setTmpErrOutputFile(null) + } + state.close() + } + + ShutdownHookManager.addShutdownHook(() => closeState()) + // Log the default warehouse location. logInfo( s"Warehouse location for Hive client " + @@ -166,12 +186,10 @@ private[hive] class HiveClientImpl( Hive.set(clientLoader.cachedHive.asInstanceOf[Hive]) } // Hive 2.3 will set UDFClassLoader to hiveConf when initializing SessionState - // since HIVE-11878, and ADDJarCommand will add jars to clientLoader.classLoader. - // For this reason we cannot load the jars added by ADDJarCommand because of class loader + // since HIVE-11878, and ADDJarsCommand will add jars to clientLoader.classLoader. + // For this reason we cannot load the jars added by ADDJarsCommand because of class loader // got changed. We reset it to clientLoader.ClassLoader here. - if (HiveUtils.isHive23) { - state.getConf.setClassLoader(clientLoader.classLoader) - } + state.getConf.setClassLoader(clientLoader.classLoader) SessionState.start(state) state.out = new PrintStream(outputBuffer, true, UTF_8.name()) state.err = new PrintStream(outputBuffer, true, UTF_8.name()) @@ -179,9 +197,7 @@ private[hive] class HiveClientImpl( } /** Returns the configuration for the current session. */ - def conf: HiveConf = if (!HiveUtils.isHive23) { - state.getConf - } else { + def conf: HiveConf = { val hiveConf = state.getConf // Hive changed the default of datanucleus.schema.autoCreateAll from true to false // and hive.metastore.schema.verification from false to true since Hive 2.0. @@ -276,15 +292,17 @@ private[hive] class HiveClientImpl( def withHiveState[A](f: => A): A = retryLocked { val original = Thread.currentThread().getContextClassLoader val originalConfLoader = state.getConf.getClassLoader - // The classloader in clientLoader could be changed after addJar, always use the latest - // classloader. We explicitly set the context class loader since "conf.setClassLoader" does + // We explicitly set the context class loader since "conf.setClassLoader" does // not do that, and the Hive client libraries may need to load classes defined by the client's - // class loader. + // class loader. See SPARK-19804 for more details. Thread.currentThread().setContextClassLoader(clientLoader.classLoader) state.getConf.setClassLoader(clientLoader.classLoader) // Set the thread local metastore client to the client associated with this HiveClientImpl. Hive.set(client) // Replace conf in the thread local Hive with current conf + // with the side-effect of Hive.get(conf) to avoid using out-of-date HiveConf. + // See discussion in https://github.com/apache/spark/pull/16826/files#r104606859 + // for more details. Hive.get(conf) // setCurrentSessionState will use the classLoader associated // with the HiveConf in `state` to override the context class loader of the current @@ -293,11 +311,9 @@ private[hive] class HiveClientImpl( val ret = try { f } catch { - case e: NoClassDefFoundError - if HiveUtils.isHive23 && e.getMessage.contains("org/apache/hadoop/hive/serde2/SerDe") => + case e: NoClassDefFoundError if e.getMessage.contains("apache/hadoop/hive/serde2/SerDe") => throw new ClassNotFoundException("The SerDe interface removed since Hive 2.3(HIVE-15167)." + - " Please migrate your custom SerDes to Hive 2.3 or build your own Spark with" + - " hive-1.2 profile. See HIVE-15167 for more details.", e) + " Please migrate your custom SerDes to Hive 2.3. See HIVE-15167 for more details.", e) } finally { state.getConf.setClassLoader(originalConfLoader) Thread.currentThread().setContextClassLoader(original) @@ -374,14 +390,14 @@ private[hive] class HiveClientImpl( override def getDatabase(dbName: String): CatalogDatabase = withHiveState { Option(client.getDatabase(dbName)).map { d => - val paras = Option(d.getParameters).map(_.asScala.toMap).getOrElse(Map()) ++ + val params = Option(d.getParameters).map(_.asScala.toMap).getOrElse(Map()) ++ Map(PROP_OWNER -> shim.getDatabaseOwnerName(d)) CatalogDatabase( name = d.getName, description = Option(d.getDescription).getOrElse(""), locationUri = CatalogUtils.stringToURI(d.getLocationUri), - properties = paras) + properties = params) }.getOrElse(throw new NoSuchDatabaseException(dbName)) } @@ -390,7 +406,7 @@ private[hive] class HiveClientImpl( } override def listDatabases(pattern: String): Seq[String] = withHiveState { - client.getDatabasesByPattern(pattern).asScala + client.getDatabasesByPattern(pattern).asScala.toSeq } private def getRawTableOption(dbName: String, tableName: String): Option[HiveTable] = { @@ -400,7 +416,7 @@ private[hive] class HiveClientImpl( private def getRawTablesByName(dbName: String, tableNames: Seq[String]): Seq[HiveTable] = { try { msClient.getTableObjectsByName(dbName, tableNames.asJava).asScala - .map(extraFixesForNonView).map(new HiveTable(_)) + .map(extraFixesForNonView).map(new HiveTable(_)).toSeq } catch { case ex: Exception => throw new HiveException(s"Unable to fetch tables of db $dbName", ex); @@ -434,7 +450,7 @@ private[hive] class HiveClientImpl( throw new SparkException( s"${ex.getMessage}, db: ${h.getDbName}, table: ${h.getTableName}", ex) } - val schema = StructType(cols ++ partCols) + val schema = StructType((cols ++ partCols).toSeq) val bucketSpec = if (h.getNumBuckets > 0) { val sortColumnOrders = h.getSortCols.asScala @@ -450,7 +466,7 @@ private[hive] class HiveClientImpl( } else { Seq.empty } - Option(BucketSpec(h.getNumBuckets, h.getBucketCols.asScala, sortColumnNames)) + Option(BucketSpec(h.getNumBuckets, h.getBucketCols.asScala.toSeq, sortColumnNames.toSeq)) } else { None } @@ -502,7 +518,7 @@ private[hive] class HiveClientImpl( throw new AnalysisException(s"Hive $tableTypeStr is not supported.") }, schema = schema, - partitionColumnNames = partCols.map(_.name), + partitionColumnNames = partCols.map(_.name).toSeq, // If the table is written by Spark, we will put bucketing information in table properties, // and will always overwrite the bucket spec in hive metastore by the bucketing information // in table properties. This means, if we have bucket spec in both hive metastore and @@ -539,7 +555,7 @@ private[hive] class HiveClientImpl( // that created by older versions of Spark. viewOriginalText = Option(h.getViewOriginalText), viewText = Option(h.getViewExpandedText), - unsupportedFeatures = unsupportedFeatures, + unsupportedFeatures = unsupportedFeatures.toSeq, ignoredProperties = ignoredProperties.toMap) } @@ -586,9 +602,7 @@ private[hive] class HiveClientImpl( val it = oldTable.getParameters.entrySet.iterator while (it.hasNext) { val entry = it.next() - val isSchemaProp = entry.getKey.startsWith(DATASOURCE_SCHEMA_PART_PREFIX) || - entry.getKey == DATASOURCE_SCHEMA || entry.getKey == DATASOURCE_SCHEMA_NUMPARTS - if (isSchemaProp) { + if (CatalogTable.isLargeTableProp(DATASOURCE_SCHEMA, entry.getKey)) { it.remove() } } @@ -605,7 +619,17 @@ private[hive] class HiveClientImpl( table: String, parts: Seq[CatalogTablePartition], ignoreIfExists: Boolean): Unit = withHiveState { - shim.createPartitions(client, db, table, parts, ignoreIfExists) + def replaceExistException(e: Throwable): Unit = e match { + case _: HiveException if e.getCause.isInstanceOf[AlreadyExistsException] => + throw new PartitionsAlreadyExistException(db, table, parts.map(_.spec)) + case _ => throw e + } + try { + shim.createPartitions(client, db, table, parts, ignoreIfExists) + } catch { + case e: InvocationTargetException => replaceExistException(e.getCause) + case e: Throwable => replaceExistException(e) + } } override def dropPartitions( @@ -626,9 +650,7 @@ private[hive] class HiveClientImpl( // (b='1', c='1') and (b='1', c='2'), a partial spec of (b='1') will match both. val parts = client.getPartitions(hiveTable, s.asJava).asScala if (parts.isEmpty && !ignoreIfNotExists) { - throw new AnalysisException( - s"No partition is dropped. One partition spec '$s' does not exist in table '$table' " + - s"database '$db'") + throw new NoSuchPartitionsException(db, table, Seq(s)) } parts.map(_.getValues) }.distinct @@ -638,7 +660,7 @@ private[hive] class HiveClientImpl( shim.dropPartition(client, db, table, partition, !retainData, purge) } catch { case e: Exception => - val remainingParts = matchingParts.toBuffer -- droppedParts + val remainingParts = matchingParts.toBuffer --= droppedParts logError( s""" |====================== @@ -665,6 +687,9 @@ private[hive] class HiveClientImpl( val catalogTable = getTable(db, table) val hiveTable = toHiveTable(catalogTable, Some(userName)) specs.zip(newSpecs).foreach { case (oldSpec, newSpec) => + if (client.getPartition(hiveTable, newSpec.asJava, false) != null) { + throw new PartitionAlreadyExistsException(db, table, newSpec) + } val hivePart = getPartitionOption(catalogTable, oldSpec) .map { p => toHivePartition(p.copy(spec = newSpec), hiveTable) } .getOrElse { throw new NoSuchPartitionException(db, table, oldSpec) } @@ -708,7 +733,7 @@ private[hive] class HiveClientImpl( assert(s.values.forall(_.nonEmpty), s"partition spec '$s' is invalid") client.getPartitionNames(table.database, table.identifier.table, s.asJava, -1) } - hivePartitionNames.asScala.sorted + hivePartitionNames.asScala.sorted.toSeq } override def getPartitionOption( @@ -735,39 +760,43 @@ private[hive] class HiveClientImpl( } val parts = client.getPartitions(hiveTable, partSpec.asJava).asScala.map(fromHivePartition) HiveCatalogMetrics.incrementFetchedPartitions(parts.length) - parts + parts.toSeq } override def getPartitionsByFilter( table: CatalogTable, - predicates: Seq[Expression]): Seq[CatalogTablePartition] = withHiveState { + predicates: Seq[Expression], + timeZoneId: String): Seq[CatalogTablePartition] = withHiveState { val hiveTable = toHiveTable(table, Some(userName)) - val parts = shim.getPartitionsByFilter(client, hiveTable, predicates).map(fromHivePartition) + val parts = shim.getPartitionsByFilter(client, hiveTable, predicates, timeZoneId) + .map(fromHivePartition) HiveCatalogMetrics.incrementFetchedPartitions(parts.length) parts } override def listTables(dbName: String): Seq[String] = withHiveState { - client.getAllTables(dbName).asScala + client.getAllTables(dbName).asScala.toSeq } override def listTables(dbName: String, pattern: String): Seq[String] = withHiveState { - client.getTablesByPattern(dbName, pattern).asScala + client.getTablesByPattern(dbName, pattern).asScala.toSeq } override def listTablesByType( dbName: String, pattern: String, tableType: CatalogTableType): Seq[String] = withHiveState { + val hiveTableType = toHiveTableType(tableType) try { // Try with Hive API getTablesByType first, it's supported from Hive 2.3+. - shim.getTablesByType(client, dbName, pattern, toHiveTableType(tableType)) + shim.getTablesByType(client, dbName, pattern, hiveTableType) } catch { case _: UnsupportedOperationException => // Fallback to filter logic if getTablesByType not supported. val tableNames = client.getTablesByPattern(dbName, pattern).asScala - val tables = getTablesByName(dbName, tableNames).filter(_.tableType == tableType) - tables.map(_.identifier.table) + getRawTablesByName(dbName, tableNames.toSeq) + .filter(_.getTableType == hiveTableType) + .map(_.getTableName) } } @@ -927,16 +956,8 @@ private[hive] class HiveClientImpl( } def addJar(path: String): Unit = { - val uri = new Path(path).toUri - val jarURL = if (uri.getScheme == null) { - // `path` is a local file path without a URL scheme - new File(path).toURI.toURL - } else { - // `path` is a URL with a scheme - uri.toURL - } - clientLoader.addJar(jarURL) - runSqlHive(s"ADD JAR $path") + val jarURI = Utils.resolveURI(path) + clientLoader.addJar(jarURI.toURL) } def newSession(): HiveClientImpl = { @@ -981,11 +1002,11 @@ private[hive] class HiveClientImpl( private[hive] object HiveClientImpl extends Logging { /** Converts the native StructField to Hive's FieldSchema. */ def toHiveColumn(c: StructField): FieldSchema = { - val typeString = if (c.metadata.contains(HIVE_TYPE_STRING)) { - c.metadata.getString(HIVE_TYPE_STRING) - } else { - c.dataType.catalogString - } + // For Hive Serde, we still need to to restore the raw type for char and varchar type. + // When reading data in parquet, orc, or avro file format with string type for char, + // the tailing spaces may lost if we are not going to pad it. + val typeString = CharVarcharUtils.getRawTypeString(c.metadata) + .getOrElse(HiveVoidType.replaceVoidType(c.dataType).catalogString) new FieldSchema(c.name, typeString, c.getComment().orNull) } @@ -1003,17 +1024,10 @@ private[hive] object HiveClientImpl extends Logging { /** Builds the native StructField from Hive's FieldSchema. */ def fromHiveColumn(hc: FieldSchema): StructField = { val columnType = getSparkSQLDataType(hc) - val metadata = if (hc.getType != columnType.catalogString) { - new MetadataBuilder().putString(HIVE_TYPE_STRING, hc.getType).build() - } else { - Metadata.empty - } - val field = StructField( name = hc.getName, dataType = columnType, - nullable = true, - metadata = metadata) + nullable = true) Option(hc.getComment).map(field.withComment).getOrElse(field) } @@ -1271,3 +1285,22 @@ private[hive] object HiveClientImpl extends Logging { hiveConf } } + +private[hive] case object HiveVoidType extends DataType { + override def defaultSize: Int = 1 + override def asNullable: DataType = HiveVoidType + override def simpleString: String = "void" + + def replaceVoidType(dt: DataType): DataType = dt match { + case ArrayType(et, nullable) => + ArrayType(replaceVoidType(et), nullable) + case MapType(kt, vt, nullable) => + MapType(replaceVoidType(kt), replaceVoidType(vt), nullable) + case StructType(fields) => + StructType(fields.map { field => + field.copy(dataType = replaceVoidType(field.dataType)) + }) + case _: NullType => HiveVoidType + case _ => dt + } +} diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala index 2b806609426a1..2f7fe96013dea 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveShim.scala @@ -41,13 +41,13 @@ import org.apache.hadoop.hive.serde.serdeConstants import org.apache.spark.internal.Logging import org.apache.spark.sql.AnalysisException -import org.apache.spark.sql.SparkSession import org.apache.spark.sql.catalyst.FunctionIdentifier import org.apache.spark.sql.catalyst.analysis.NoSuchPermanentFunctionException import org.apache.spark.sql.catalyst.catalog.{CatalogFunction, CatalogTablePartition, CatalogUtils, FunctionResource, FunctionResourceType} import org.apache.spark.sql.catalyst.expressions._ +import org.apache.spark.sql.catalyst.util.{DateFormatter, DateTimeUtils, TypeUtils} import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.sql.types.{AtomicType, IntegralType, StringType} +import org.apache.spark.sql.types.{AtomicType, DateType, IntegralType, StringType} import org.apache.spark.unsafe.types.UTF8String import org.apache.spark.util.Utils @@ -79,7 +79,11 @@ private[client] sealed abstract class Shim { def getAllPartitions(hive: Hive, table: Table): Seq[Partition] - def getPartitionsByFilter(hive: Hive, table: Table, predicates: Seq[Expression]): Seq[Partition] + def getPartitionsByFilter( + hive: Hive, + table: Table, + predicates: Seq[Expression], + timeZoneId: String): Seq[Partition] def getCommandProcessor(token: String, conf: HiveConf): CommandProcessor @@ -349,7 +353,8 @@ private[client] class Shim_v0_12 extends Shim with Logging { override def getPartitionsByFilter( hive: Hive, table: Table, - predicates: Seq[Expression]): Seq[Partition] = { + predicates: Seq[Expression], + timeZoneId: String): Seq[Partition] = { // getPartitionsByFilter() doesn't support binary comparison ops in Hive 0.12. // See HIVE-4888. logDebug("Hive 0.12 doesn't support predicate pushdown to metastore. " + @@ -363,7 +368,7 @@ private[client] class Shim_v0_12 extends Shim with Logging { override def getDriverResults(driver: Driver): Seq[String] = { val res = new JArrayList[String]() getDriverResultsMethod.invoke(driver, res) - res.asScala + res.asScala.toSeq } override def getMetastoreClientConnectRetryDelayMillis(conf: HiveConf): Long = { @@ -600,7 +605,7 @@ private[client] class Shim_v0_13 extends Shim_v0_12 { } FunctionResource(FunctionResourceType.fromString(resourceType), uri.getUri()) } - CatalogFunction(name, hf.getClassName, resources) + CatalogFunction(name, hf.getClassName, resources.toSeq) } override def getFunctionOption(hive: Hive, db: String, name: String): Option[CatalogFunction] = { @@ -623,7 +628,7 @@ private[client] class Shim_v0_13 extends Shim_v0_12 { } override def listFunctions(hive: Hive, db: String, pattern: String): Seq[String] = { - hive.getFunctions(db, pattern).asScala + hive.getFunctions(db, pattern).asScala.toSeq } /** @@ -632,7 +637,9 @@ private[client] class Shim_v0_13 extends Shim_v0_12 { * * Unsupported predicates are skipped. */ - def convertFilters(table: Table, filters: Seq[Expression]): String = { + def convertFilters(table: Table, filters: Seq[Expression], timeZoneId: String): String = { + lazy val dateFormatter = DateFormatter(DateTimeUtils.getZoneId(timeZoneId)) + /** * An extractor that matches all binary comparison operators except null-safe equality. * @@ -650,6 +657,8 @@ private[client] class Shim_v0_13 extends Shim_v0_12 { case Literal(null, _) => None // `null`s can be cast as other types; we want to avoid NPEs. case Literal(value, _: IntegralType) => Some(value.toString) case Literal(value, _: StringType) => Some(quoteStringLiteral(value.toString)) + case Literal(value, _: DateType) => + Some(dateFormatter.format(value.asInstanceOf[Int])) case _ => None } } @@ -691,7 +700,22 @@ private[client] class Shim_v0_13 extends Shim_v0_12 { } def unapply(values: Set[Any]): Option[Seq[String]] = { - val extractables = values.toSeq.map(valueToLiteralString.lift) + val extractables = values.filter(_ != null).toSeq.map(valueToLiteralString.lift) + if (extractables.nonEmpty && extractables.forall(_.isDefined)) { + Some(extractables.map(_.get)) + } else { + None + } + } + } + + object ExtractableDateValues { + private lazy val valueToLiteralString: PartialFunction[Any, String] = { + case value: Int => dateFormatter.format(value) + } + + def unapply(values: Set[Any]): Option[Seq[String]] = { + val extractables = values.filter(_ != null).toSeq.map(valueToLiteralString.lift) if (extractables.nonEmpty && extractables.forall(_.isDefined)) { Some(extractables.map(_.get)) } else { @@ -708,9 +732,11 @@ private[client] class Shim_v0_13 extends Shim_v0_12 { .map(col => col.getName).toSet def unapply(attr: Attribute): Option[String] = { - if (varcharKeys.contains(attr.name)) { + val resolver = SQLConf.get.resolver + if (varcharKeys.exists(c => resolver(c, attr.name))) { None - } else if (attr.dataType.isInstanceOf[IntegralType] || attr.dataType == StringType) { + } else if (attr.dataType.isInstanceOf[IntegralType] || attr.dataType == StringType || + attr.dataType == DateType) { Some(attr.name) } else { None @@ -722,13 +748,23 @@ private[client] class Shim_v0_13 extends Shim_v0_12 { values.map(value => s"$name = $value").mkString("(", " or ", ")") } + def convertNotInToAnd(name: String, values: Seq[String]): String = { + values.map(value => s"$name != $value").mkString("(", " and ", ")") + } + + def hasNullLiteral(list: Seq[Expression]): Boolean = list.exists { + case Literal(null, _) => true + case _ => false + } + val useAdvanced = SQLConf.get.advancedPartitionPredicatePushdownEnabled + val inSetThreshold = SQLConf.get.metastorePartitionPruningInSetThreshold object ExtractAttribute { def unapply(expr: Expression): Option[Attribute] = { expr match { case attr: Attribute => Some(attr) - case Cast(child @ AtomicType(), dt: AtomicType, _) + case Cast(child @ IntegralType(), dt: IntegralType, _) if Cast.canUpCast(child.dataType.asInstanceOf[AtomicType], dt) => unapply(child) case _ => None } @@ -736,14 +772,44 @@ private[client] class Shim_v0_13 extends Shim_v0_12 { } def convert(expr: Expression): Option[String] = expr match { + case Not(InSet(_, values)) if values.size > inSetThreshold => + None + + case Not(In(_, list)) if hasNullLiteral(list) => None + case Not(InSet(_, list)) if list.contains(null) => None + case In(ExtractAttribute(SupportedAttribute(name)), ExtractableLiterals(values)) if useAdvanced => Some(convertInToOr(name, values)) + case Not(In(ExtractAttribute(SupportedAttribute(name)), ExtractableLiterals(values))) + if useAdvanced => + Some(convertNotInToAnd(name, values)) + + case InSet(child, values) if useAdvanced && values.size > inSetThreshold => + val dataType = child.dataType + // Skip null here is safe, more details could see at ExtractableLiterals. + val sortedValues = values.filter(_ != null).toSeq + .sorted(TypeUtils.getInterpretedOrdering(dataType)) + convert(And(GreaterThanOrEqual(child, Literal(sortedValues.head, dataType)), + LessThanOrEqual(child, Literal(sortedValues.last, dataType)))) + + case InSet(child @ ExtractAttribute(SupportedAttribute(name)), ExtractableDateValues(values)) + if useAdvanced && child.dataType == DateType => + Some(convertInToOr(name, values)) + + case Not(InSet(child @ ExtractAttribute(SupportedAttribute(name)), + ExtractableDateValues(values))) if useAdvanced && child.dataType == DateType => + Some(convertNotInToAnd(name, values)) + case InSet(ExtractAttribute(SupportedAttribute(name)), ExtractableValues(values)) if useAdvanced => Some(convertInToOr(name, values)) + case Not(InSet(ExtractAttribute(SupportedAttribute(name)), ExtractableValues(values))) + if useAdvanced => + Some(convertNotInToAnd(name, values)) + case op @ SpecialBinaryComparison( ExtractAttribute(SupportedAttribute(name)), ExtractableLiteral(value)) => Some(s"$name ${op.symbol} $value") @@ -752,6 +818,15 @@ private[client] class Shim_v0_13 extends Shim_v0_12 { ExtractableLiteral(value), ExtractAttribute(SupportedAttribute(name))) => Some(s"$value ${op.symbol} $name") + case Contains(ExtractAttribute(SupportedAttribute(name)), ExtractableLiteral(value)) => + Some(s"$name like " + (("\".*" + value.drop(1)).dropRight(1) + ".*\"")) + + case StartsWith(ExtractAttribute(SupportedAttribute(name)), ExtractableLiteral(value)) => + Some(s"$name like " + (value.dropRight(1) + ".*\"")) + + case EndsWith(ExtractAttribute(SupportedAttribute(name)), ExtractableLiteral(value)) => + Some(s"$name like " + ("\".*" + value.drop(1))) + case And(expr1, expr2) if useAdvanced => val converted = convert(expr1) ++ convert(expr2) if (converted.isEmpty) { @@ -766,6 +841,14 @@ private[client] class Shim_v0_13 extends Shim_v0_12 { right <- convert(expr2) } yield s"($left or $right)" + case Not(EqualTo( + ExtractAttribute(SupportedAttribute(name)), ExtractableLiteral(value))) if useAdvanced => + Some(s"$name != $value") + + case Not(EqualTo( + ExtractableLiteral(value), ExtractAttribute(SupportedAttribute(name)))) if useAdvanced => + Some(s"$value != $name") + case _ => None } @@ -786,11 +869,12 @@ private[client] class Shim_v0_13 extends Shim_v0_12 { override def getPartitionsByFilter( hive: Hive, table: Table, - predicates: Seq[Expression]): Seq[Partition] = { + predicates: Seq[Expression], + timeZoneId: String): Seq[Partition] = { // Hive getPartitionsByFilter() takes a string that represents partition // predicates like "str_key=\"value\" and int_key=1 ..." - val filter = convertFilters(table, predicates) + val filter = convertFilters(table, predicates, timeZoneId) val partitions = if (filter.isEmpty) { @@ -842,7 +926,7 @@ private[client] class Shim_v0_13 extends Shim_v0_12 { case s: String => s case a: Array[Object] => a(0).asInstanceOf[String] } - } + }.toSeq } override def getDatabaseOwnerName(db: Database): String = { @@ -1251,7 +1335,7 @@ private[client] class Shim_v2_3 extends Shim_v2_1 { pattern: String, tableType: TableType): Seq[String] = { getTablesByTypeMethod.invoke(hive, dbName, pattern, tableType) - .asInstanceOf[JList[String]].asScala + .asInstanceOf[JList[String]].asScala.toSeq } } @@ -1326,10 +1410,7 @@ private[client] class Shim_v3_0 extends Shim_v2_3 { inheritTableSpecs: Boolean, isSkewedStoreAsSubdir: Boolean, isSrcLocal: Boolean): Unit = { - val session = SparkSession.getActiveSession - assert(session.nonEmpty) - val database = session.get.sessionState.catalog.getCurrentDatabase - val table = hive.getTable(database, tableName) + val table = hive.getTable(tableName) val loadFileType = if (replace) { clazzLoadFileType.getEnumConstants.find(_.toString.equalsIgnoreCase("REPLACE_ALL")) } else { diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala index 42a0ec0253b85..6171d32e53881 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/IsolatedClientLoader.scala @@ -37,7 +37,7 @@ import org.apache.spark.sql.catalyst.util.quietly import org.apache.spark.sql.hive.HiveUtils import org.apache.spark.sql.internal.NonClosableMutableURLClassLoader import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.util.{MutableURLClassLoader, Utils} +import org.apache.spark.util.{MutableURLClassLoader, Utils, VersionUtils} /** Factory for `IsolatedClientLoader` with specific versions of hive. */ private[hive] object IsolatedClientLoader extends Logging { @@ -52,12 +52,9 @@ private[hive] object IsolatedClientLoader extends Logging { config: Map[String, String] = Map.empty, ivyPath: Option[String] = None, sharedPrefixes: Seq[String] = Seq.empty, - barrierPrefixes: Seq[String] = Seq.empty, - sharesHadoopClasses: Boolean = true): IsolatedClientLoader = synchronized { + barrierPrefixes: Seq[String] = Seq.empty): IsolatedClientLoader = synchronized { val resolvedVersion = hiveVersion(hiveMetastoreVersion) - // We will first try to share Hadoop classes. If we cannot resolve the Hadoop artifact - // with the given version, we will use Hadoop 2.7 and then will not share Hadoop classes. - var _sharesHadoopClasses = sharesHadoopClasses + // We will use Hadoop 2.7 if we cannot resolve the Hadoop artifact. val files = if (resolvedVersions.contains((resolvedVersion, hadoopVersion))) { resolvedVersions((resolvedVersion, hadoopVersion)) } else { @@ -72,10 +69,8 @@ private[hive] object IsolatedClientLoader extends Logging { val fallbackVersion = "2.7.4" logWarning(s"Failed to resolve Hadoop artifacts for the version $hadoopVersion. We " + s"will change the hadoop version from $hadoopVersion to $fallbackVersion and try " + - "again. Hadoop classes will not be shared between Spark and Hive metastore client. " + - "It is recommended to set jars used by Hive metastore client through " + + "again. It is recommended to set jars used by Hive metastore client through " + "spark.sql.hive.metastore.jars in the production environment.") - _sharesHadoopClasses = false (downloadVersion( resolvedVersion, fallbackVersion, ivyPath, remoteRepos), fallbackVersion) } @@ -89,28 +84,36 @@ private[hive] object IsolatedClientLoader extends Logging { execJars = files, hadoopConf = hadoopConf, config = config, - sharesHadoopClasses = _sharesHadoopClasses, sharedPrefixes = sharedPrefixes, barrierPrefixes = barrierPrefixes) } - def hiveVersion(version: String): HiveVersion = version match { - case "12" | "0.12" | "0.12.0" => hive.v12 - case "13" | "0.13" | "0.13.0" | "0.13.1" => hive.v13 - case "14" | "0.14" | "0.14.0" => hive.v14 - case "1.0" | "1.0.0" | "1.0.1" => hive.v1_0 - case "1.1" | "1.1.0" | "1.1.1" => hive.v1_1 - case "1.2" | "1.2.0" | "1.2.1" | "1.2.2" => hive.v1_2 - case "2.0" | "2.0.0" | "2.0.1" => hive.v2_0 - case "2.1" | "2.1.0" | "2.1.1" => hive.v2_1 - case "2.2" | "2.2.0" => hive.v2_2 - case "2.3" | "2.3.0" | "2.3.1" | "2.3.2" | "2.3.3" | "2.3.4" | "2.3.5" | "2.3.6" | "2.3.7" => - hive.v2_3 - case "3.0" | "3.0.0" => hive.v3_0 - case "3.1" | "3.1.0" | "3.1.1" | "3.1.2" => hive.v3_1 - case version => + def hiveVersion(version: String): HiveVersion = { + VersionUtils.majorMinorPatchVersion(version).flatMap { + case (12, _, _) | (0, 12, _) => Some(hive.v12) + case (13, _, _) | (0, 13, _) => Some(hive.v13) + case (14, _, _) | (0, 14, _) => Some(hive.v14) + case (1, 0, _) => Some(hive.v1_0) + case (1, 1, _) => Some(hive.v1_1) + case (1, 2, _) => Some(hive.v1_2) + case (2, 0, _) => Some(hive.v2_0) + case (2, 1, _) => Some(hive.v2_1) + case (2, 2, _) => Some(hive.v2_2) + case (2, 3, _) => Some(hive.v2_3) + case (3, 0, _) => Some(hive.v3_0) + case (3, 1, _) => Some(hive.v3_1) + case _ => None + }.getOrElse { throw new UnsupportedOperationException(s"Unsupported Hive Metastore version ($version). " + s"Please set ${HiveUtils.HIVE_METASTORE_VERSION.key} with a valid version.") + } + } + + def supportsHadoopShadedClient(hadoopVersion: String): Boolean = { + VersionUtils.majorMinorPatchVersion(hadoopVersion).exists { + case (3, 2, v) if v >= 2 => true + case _ => false + } } private def downloadVersion( @@ -118,21 +121,27 @@ private[hive] object IsolatedClientLoader extends Logging { hadoopVersion: String, ivyPath: Option[String], remoteRepos: String): Seq[URL] = { + val hadoopJarNames = if (supportsHadoopShadedClient(hadoopVersion)) { + Seq(s"org.apache.hadoop:hadoop-client-api:$hadoopVersion", + s"org.apache.hadoop:hadoop-client-runtime:$hadoopVersion") + } else { + Seq(s"org.apache.hadoop:hadoop-client:$hadoopVersion") + } val hiveArtifacts = version.extraDeps ++ Seq("hive-metastore", "hive-exec", "hive-common", "hive-serde") .map(a => s"org.apache.hive:$a:${version.fullVersion}") ++ - Seq("com.google.guava:guava:14.0.1", - s"org.apache.hadoop:hadoop-client:$hadoopVersion") + Seq("com.google.guava:guava:14.0.1") ++ hadoopJarNames - val classpath = quietly { + val classpaths = quietly { SparkSubmitUtils.resolveMavenCoordinates( hiveArtifacts.mkString(","), SparkSubmitUtils.buildIvySettings( Some(remoteRepos), ivyPath), + transitive = true, exclusions = version.exclusions) } - val allFiles = classpath.split(",").map(new File(_)).toSet + val allFiles = classpaths.map(new File(_)).toSet // TODO: Remove copy logic. val tempDir = Utils.createTempDir(namePrefix = s"hive-${version}") @@ -164,7 +173,6 @@ private[hive] object IsolatedClientLoader extends Logging { * @param config A set of options that will be added to the HiveConf of the constructed client. * @param isolationOn When true, custom versions of barrier classes will be constructed. Must be * true unless loading the version of hive that is on Spark's classloader. - * @param sharesHadoopClasses When true, we will share Hadoop classes between Spark and * @param baseClassLoader The spark classloader that is used to load shared classes. */ private[hive] class IsolatedClientLoader( @@ -174,7 +182,6 @@ private[hive] class IsolatedClientLoader( val execJars: Seq[URL] = Seq.empty, val config: Map[String, String] = Map.empty, val isolationOn: Boolean = true, - val sharesHadoopClasses: Boolean = true, val baseClassLoader: ClassLoader = Thread.currentThread().getContextClassLoader, val sharedPrefixes: Seq[String] = Seq.empty, val barrierPrefixes: Seq[String] = Seq.empty) @@ -191,7 +198,7 @@ private[hive] class IsolatedClientLoader( name.startsWith("org.apache.log4j") || // log4j1.x name.startsWith("org.apache.logging.log4j") || // log4j2 name.startsWith("org.apache.spark.") || - (sharesHadoopClasses && isHadoopClass) || + isHadoopClass || name.startsWith("scala.") || (name.startsWith("com.google") && !name.startsWith("com.google.cloud")) || name.startsWith("java.") || diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/package.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/package.scala index 8526d86454604..bb78944fb1613 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/package.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/client/package.scala @@ -22,7 +22,20 @@ package object client { private[hive] sealed abstract class HiveVersion( val fullVersion: String, val extraDeps: Seq[String] = Nil, - val exclusions: Seq[String] = Nil) + val exclusions: Seq[String] = Nil) extends Ordered[HiveVersion] { + override def compare(that: HiveVersion): Int = { + val thisVersionParts = fullVersion.split('.').map(_.toInt) + val thatVersionParts = that.fullVersion.split('.').map(_.toInt) + assert(thisVersionParts.length == thatVersionParts.length) + thisVersionParts.zip(thatVersionParts).foreach { case (l, r) => + val candidate = l - r + if (candidate != 0) { + return candidate + } + } + 0 + } + } // scalastyle:off private[hive] object hive { @@ -87,11 +100,13 @@ package object client { "org.apache.curator:*", "org.pentaho:pentaho-aggdesigner-algorithm")) - // Since HIVE-14496, Hive materialized view need calcite-core. + // Since HIVE-23980, calcite-core included in Hive package jar. // For spark, only VersionsSuite currently creates a hive materialized view for testing. - case object v2_3 extends HiveVersion("2.3.7", - exclusions = Seq("org.apache.calcite:calcite-druid", + case object v2_3 extends HiveVersion("2.3.8", + exclusions = Seq("org.apache.calcite:calcite-core", + "org.apache.calcite:calcite-druid", "org.apache.calcite.avatica:avatica", + "com.fasterxml.jackson.core:*", "org.apache.curator:*", "org.pentaho:pentaho-aggdesigner-algorithm")) @@ -101,7 +116,6 @@ package object client { extraDeps = Seq("org.apache.logging.log4j:log4j-api:2.10.0", "org.apache.derby:derby:10.14.1.0"), exclusions = Seq("org.apache.calcite:calcite-druid", - "org.apache.calcite.avatica:avatica", "org.apache.curator:*", "org.pentaho:pentaho-aggdesigner-algorithm")) @@ -111,7 +125,6 @@ package object client { extraDeps = Seq("org.apache.logging.log4j:log4j-api:2.10.0", "org.apache.derby:derby:10.14.1.0"), exclusions = Seq("org.apache.calcite:calcite-druid", - "org.apache.calcite.avatica:avatica", "org.apache.curator:*", "org.pentaho:pentaho-aggdesigner-algorithm")) diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/CreateHiveTableAsSelectCommand.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/CreateHiveTableAsSelectCommand.scala index 9f79997e2979a..fe5d74f889dbb 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/CreateHiveTableAsSelectCommand.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/CreateHiveTableAsSelectCommand.scala @@ -22,6 +22,7 @@ import scala.util.control.NonFatal import org.apache.spark.sql.{AnalysisException, Row, SaveMode, SparkSession} import org.apache.spark.sql.catalyst.catalog.{CatalogTable, SessionCatalog} import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan +import org.apache.spark.sql.catalyst.util.CharVarcharUtils import org.apache.spark.sql.execution.SparkPlan import org.apache.spark.sql.execution.command.{DataWritingCommand, DDLUtils} import org.apache.spark.sql.execution.datasources.{HadoopFsRelation, InsertIntoHadoopFsRelationCommand, LogicalRelation} @@ -54,19 +55,22 @@ trait CreateHiveTableAsSelectBase extends DataWritingCommand { val command = getWritingCommand(catalog, tableDesc, tableExists = true) command.run(sparkSession, child) + DataWritingCommand.propogateMetrics(sparkSession.sparkContext, command, metrics) } else { // TODO ideally, we should get the output data ready first and then // add the relation into catalog, just in case of failure occurs while data // processing. + val tableSchema = CharVarcharUtils.getRawSchema(outputColumns.toStructType) assert(tableDesc.schema.isEmpty) catalog.createTable( - tableDesc.copy(schema = outputColumns.toStructType), ignoreIfExists = false) + tableDesc.copy(schema = tableSchema), ignoreIfExists = false) try { // Read back the metadata of the table which was created just now. val createdTableMeta = catalog.getTableMetadata(tableDesc.identifier) val command = getWritingCommand(catalog, createdTableMeta, tableExists = false) command.run(sparkSession, child) + DataWritingCommand.propogateMetrics(sparkSession.sparkContext, command, metrics) } catch { case NonFatal(e) => // drop the created table. @@ -126,6 +130,9 @@ case class CreateHiveTableAsSelectCommand( override def writingCommandClassName: String = Utils.getSimpleName(classOf[InsertIntoHiveTable]) + + override protected def withNewChildInternal( + newChild: LogicalPlan): CreateHiveTableAsSelectCommand = copy(query = newChild) } /** @@ -173,4 +180,7 @@ case class OptimizedCreateHiveTableAsSelectCommand( override def writingCommandClassName: String = Utils.getSimpleName(classOf[InsertIntoHadoopFsRelationCommand]) + + override protected def withNewChildInternal( + newChild: LogicalPlan): OptimizedCreateHiveTableAsSelectCommand = copy(query = newChild) } diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveFileFormat.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveFileFormat.scala index c51c521cacba0..d4ec590f79f5e 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveFileFormat.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveFileFormat.scala @@ -108,7 +108,7 @@ class HiveFileFormat(fileSinkConf: FileSinkDesc) } class HiveOutputWriter( - path: String, + val path: String, fileSinkConf: FileSinkDesc, jobConf: JobConf, dataSchema: StructType) extends OutputWriter with HiveInspectors { diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveOptions.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveOptions.scala index 802ddafdbee4d..7b51618772edc 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveOptions.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveOptions.scala @@ -87,7 +87,7 @@ class HiveOptions(@transient private val parameters: CaseInsensitiveMap[String]) def serdeProperties: Map[String, String] = parameters.filterKeys { k => !lowerCasedOptionNames.contains(k.toLowerCase(Locale.ROOT)) - }.map { case (k, v) => delimiterOptions.getOrElse(k, k) -> v } + }.map { case (k, v) => delimiterOptions.getOrElse(k, k) -> v }.toMap } object HiveOptions { diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveScriptTransformationExec.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveScriptTransformationExec.scala new file mode 100644 index 0000000000000..219b1a27f70a2 --- /dev/null +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveScriptTransformationExec.scala @@ -0,0 +1,316 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution + +import java.io._ +import java.util.Properties + +import scala.collection.JavaConverters._ +import scala.util.control.NonFatal + +import org.apache.hadoop.conf.Configuration +import org.apache.hadoop.hive.ql.exec.{RecordReader, RecordWriter} +import org.apache.hadoop.hive.serde.serdeConstants +import org.apache.hadoop.hive.serde2.AbstractSerDe +import org.apache.hadoop.hive.serde2.objectinspector._ +import org.apache.hadoop.io.Writable + +import org.apache.spark.TaskContext +import org.apache.spark.sql.catalyst.InternalRow +import org.apache.spark.sql.catalyst.expressions._ +import org.apache.spark.sql.execution._ +import org.apache.spark.sql.hive.HiveInspectors +import org.apache.spark.sql.hive.HiveShim._ +import org.apache.spark.sql.types.DataType +import org.apache.spark.util.{CircularBuffer, Utils} + +/** + * Transforms the input by forking and running the specified script. + * + * @param script the command that should be executed. + * @param output the attributes that are produced by the script. + * @param child logical plan whose output is transformed. + * @param ioschema the class set that defines how to handle input/output data. + */ +private[hive] case class HiveScriptTransformationExec( + script: String, + output: Seq[Attribute], + child: SparkPlan, + ioschema: ScriptTransformationIOSchema) + extends BaseScriptTransformationExec { + import HiveScriptIOSchema._ + + private def createOutputIteratorWithSerde( + writerThread: BaseScriptTransformationWriterThread, + inputStream: InputStream, + proc: Process, + stderrBuffer: CircularBuffer, + outputSerde: AbstractSerDe, + outputSoi: StructObjectInspector, + hadoopConf: Configuration): Iterator[InternalRow] = { + new Iterator[InternalRow] with HiveInspectors { + var curLine: String = null + val scriptOutputStream = new DataInputStream(inputStream) + + val scriptOutputReader = + recordReader(ioschema, scriptOutputStream, hadoopConf).orNull + + var scriptOutputWritable: Writable = null + val reusedWritableObject = outputSerde.getSerializedClass.getConstructor().newInstance() + val mutableRow = new SpecificInternalRow(output.map(_.dataType)) + + @transient + lazy val unwrappers = outputSoi.getAllStructFieldRefs.asScala.map(unwrapperFor) + + override def hasNext: Boolean = { + try { + if (scriptOutputWritable == null) { + scriptOutputWritable = reusedWritableObject + + if (scriptOutputReader != null) { + if (scriptOutputReader.next(scriptOutputWritable) <= 0) { + checkFailureAndPropagate(writerThread, null, proc, stderrBuffer) + return false + } + } else { + try { + scriptOutputWritable.readFields(scriptOutputStream) + } catch { + case _: EOFException => + // This means that the stdout of `proc` (i.e. TRANSFORM process) has exhausted. + // Ideally the proc should *not* be alive at this point but + // there can be a lag between EOF being written out and the process + // being terminated. So explicitly waiting for the process to be done. + checkFailureAndPropagate(writerThread, null, proc, stderrBuffer) + return false + } + } + } + + true + } catch { + case NonFatal(e) => + // If this exception is due to abrupt / unclean termination of `proc`, + // then detect it and propagate a better exception message for end users + checkFailureAndPropagate(writerThread, e, proc, stderrBuffer) + + throw e + } + } + + override def next(): InternalRow = { + if (!hasNext) { + throw new NoSuchElementException + } + val raw = outputSerde.deserialize(scriptOutputWritable) + scriptOutputWritable = null + val dataList = outputSoi.getStructFieldsDataAsList(raw) + var i = 0 + while (i < dataList.size()) { + if (dataList.get(i) == null) { + mutableRow.setNullAt(i) + } else { + unwrappers(i)(dataList.get(i), mutableRow, i) + } + i += 1 + } + mutableRow + } + } + } + + override def processIterator( + inputIterator: Iterator[InternalRow], + hadoopConf: Configuration): Iterator[InternalRow] = { + + val (outputStream, proc, inputStream, stderrBuffer) = initProc + + val (inputSerde, inputSoi) = initInputSerDe(ioschema, child.output).getOrElse((null, null)) + + // For HiveScriptTransformationExec, if inputSerde == null, but outputSerde != null + // We will use StringBuffer to pass data, in this case, we should cast data as string too. + val finalInput = if (inputSerde == null) { + inputExpressionsWithoutSerde + } else { + child.output + } + + val outputProjection = new InterpretedProjection(finalInput, child.output) + + // This new thread will consume the ScriptTransformation's input rows and write them to the + // external process. That process's output will be read by this current thread. + val writerThread = HiveScriptTransformationWriterThread( + inputIterator.map(outputProjection), + finalInput.map(_.dataType), + inputSerde, + inputSoi, + ioschema, + outputStream, + proc, + stderrBuffer, + TaskContext.get(), + hadoopConf + ) + + val (outputSerde, outputSoi) = { + initOutputSerDe(ioschema, output).getOrElse((null, null)) + } + + val outputIterator = if (outputSerde == null) { + createOutputIteratorWithoutSerde(writerThread, inputStream, proc, stderrBuffer) + } else { + createOutputIteratorWithSerde( + writerThread, inputStream, proc, stderrBuffer, outputSerde, outputSoi, hadoopConf) + } + + writerThread.start() + + outputIterator + } + + override protected def withNewChildInternal(newChild: SparkPlan): HiveScriptTransformationExec = + copy(child = newChild) +} + +private[hive] case class HiveScriptTransformationWriterThread( + iter: Iterator[InternalRow], + inputSchema: Seq[DataType], + inputSerde: AbstractSerDe, + inputSoi: StructObjectInspector, + ioSchema: ScriptTransformationIOSchema, + outputStream: OutputStream, + proc: Process, + stderrBuffer: CircularBuffer, + taskContext: TaskContext, + conf: Configuration) + extends BaseScriptTransformationWriterThread with HiveInspectors { + import HiveScriptIOSchema._ + + override def processRows(): Unit = { + val dataOutputStream = new DataOutputStream(outputStream) + val scriptInputWriter = recordWriter(ioSchema, dataOutputStream, conf).orNull + + if (inputSerde == null) { + processRowsWithoutSerde() + } else { + // Convert Spark InternalRows to hive data via `HiveInspectors.wrapperFor`. + val hiveData = new Array[Any](inputSchema.length) + val fieldOIs = inputSoi.getAllStructFieldRefs.asScala.map(_.getFieldObjectInspector).toArray + val wrappers = fieldOIs.zip(inputSchema).map { case (f, dt) => wrapperFor(f, dt) } + + iter.foreach { row => + var i = 0 + while (i < fieldOIs.length) { + hiveData(i) = if (row.isNullAt(i)) null else wrappers(i)(row.get(i, inputSchema(i))) + i += 1 + } + + val writable = inputSerde.serialize(hiveData, inputSoi) + if (scriptInputWriter != null) { + scriptInputWriter.write(writable) + } else { + prepareWritable(writable, ioSchema.outputSerdeProps).write(dataOutputStream) + } + } + } + } +} + +object HiveScriptIOSchema extends HiveInspectors { + + def initInputSerDe( + ioschema: ScriptTransformationIOSchema, + input: Seq[Expression]): Option[(AbstractSerDe, StructObjectInspector)] = { + ioschema.inputSerdeClass.map { serdeClass => + val (columns, columnTypes) = parseAttrs(input) + val serde = initSerDe(serdeClass, columns, columnTypes, ioschema.inputSerdeProps) + val fieldObjectInspectors = columnTypes.map(toInspector) + val objectInspector = ObjectInspectorFactory + .getStandardStructObjectInspector(columns.asJava, fieldObjectInspectors.asJava) + (serde, objectInspector) + } + } + + def initOutputSerDe( + ioschema: ScriptTransformationIOSchema, + output: Seq[Attribute]): Option[(AbstractSerDe, StructObjectInspector)] = { + ioschema.outputSerdeClass.map { serdeClass => + val (columns, columnTypes) = parseAttrs(output) + val serde = initSerDe(serdeClass, columns, columnTypes, ioschema.outputSerdeProps) + val structObjectInspector = serde.getObjectInspector().asInstanceOf[StructObjectInspector] + (serde, structObjectInspector) + } + } + + private def parseAttrs(attrs: Seq[Expression]): (Seq[String], Seq[DataType]) = { + val columns = attrs.zipWithIndex.map(e => s"${e._1.prettyName}_${e._2}") + val columnTypes = attrs.map(_.dataType) + (columns, columnTypes) + } + + def initSerDe( + serdeClassName: String, + columns: Seq[String], + columnTypes: Seq[DataType], + serdeProps: Seq[(String, String)]): AbstractSerDe = { + + val serde = Utils.classForName[AbstractSerDe](serdeClassName).getConstructor(). + newInstance() + + val columnTypesNames = columnTypes.map(_.toTypeInfo.getTypeName()).mkString(",") + + var propsMap = serdeProps.toMap + (serdeConstants.LIST_COLUMNS -> columns.mkString(",")) + propsMap = propsMap + (serdeConstants.LIST_COLUMN_TYPES -> columnTypesNames) + + val properties = new Properties() + // Can not use properties.putAll(propsMap.asJava) in scala-2.12 + // See https://github.com/scala/bug/issues/10418 + propsMap.foreach { case (k, v) => properties.put(k, v) } + serde.initialize(null, properties) + + serde + } + + def recordReader( + ioschema: ScriptTransformationIOSchema, + inputStream: InputStream, + conf: Configuration): Option[RecordReader] = { + ioschema.recordReaderClass.map { klass => + val instance = Utils.classForName[RecordReader](klass).getConstructor(). + newInstance() + val props = new Properties() + // Can not use props.putAll(outputSerdeProps.toMap.asJava) in scala-2.12 + // See https://github.com/scala/bug/issues/10418 + ioschema.outputSerdeProps.toMap.foreach { case (k, v) => props.put(k, v) } + instance.initialize(inputStream, conf, props) + instance + } + } + + def recordWriter( + ioschema: ScriptTransformationIOSchema, + outputStream: OutputStream, + conf: Configuration): Option[RecordWriter] = { + ioschema.recordWriterClass.map { klass => + val instance = Utils.classForName[RecordWriter](klass).getConstructor(). + newInstance() + instance.initialize(outputStream, conf) + instance + } + } +} diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala index 4dccacef337e9..41820b0135f4a 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/HiveTableScanExec.scala @@ -156,7 +156,7 @@ case class HiveTableScanExec( // Only partitioned values are needed here, since the predicate has already been bound to // partition key attribute references. - val row = InternalRow.fromSeq(castedValues) + val row = InternalRow.fromSeq(castedValues.toSeq) shouldKeep.eval(row).asInstanceOf[Boolean] } } diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveDirCommand.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveDirCommand.scala index b66c302a7d7ea..09aa1e8eea1f8 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveDirCommand.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveDirCommand.scala @@ -29,6 +29,7 @@ import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.catalog.{CatalogStorageFormat, CatalogTable} import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan import org.apache.spark.sql.execution.SparkPlan +import org.apache.spark.sql.execution.command.DDLUtils import org.apache.spark.sql.hive.client.HiveClientImpl import org.apache.spark.sql.util.SchemaUtils @@ -63,12 +64,16 @@ case class InsertIntoHiveDirCommand( s"when inserting into ${storage.locationUri.get}", sparkSession.sessionState.conf.caseSensitiveAnalysis) - val hiveTable = HiveClientImpl.toHiveTable(CatalogTable( + val table = CatalogTable( identifier = TableIdentifier(storage.locationUri.get.toString, Some("default")), + provider = Some(DDLUtils.HIVE_PROVIDER), tableType = org.apache.spark.sql.catalyst.catalog.CatalogTableType.VIEW, storage = storage, schema = outputColumns.toStructType - )) + ) + DDLUtils.checkDataColNames(table) + + val hiveTable = HiveClientImpl.toHiveTable(table) hiveTable.getMetadata.put(serdeConstants.SERIALIZATION_LIB, storage.serde.getOrElse(classOf[LazySimpleSerDe].getName)) @@ -132,5 +137,8 @@ case class InsertIntoHiveDirCommand( Seq.empty[Row] } + + override protected def withNewChildInternal( + newChild: LogicalPlan): InsertIntoHiveDirCommand = copy(query = newChild) } diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveTable.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveTable.scala index 19f439598142e..fcd11e67587cf 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveTable.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/InsertIntoHiveTable.scala @@ -26,13 +26,16 @@ import org.apache.hadoop.hive.ql.plan.TableDesc import org.apache.spark.SparkException import org.apache.spark.sql.{AnalysisException, Row, SparkSession} -import org.apache.spark.sql.catalyst.catalog.{CatalogTable, CatalogTableType, ExternalCatalog, ExternalCatalogUtils} +import org.apache.spark.sql.catalyst.catalog._ import org.apache.spark.sql.catalyst.expressions.Attribute import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan +import org.apache.spark.sql.catalyst.util.CaseInsensitiveMap import org.apache.spark.sql.execution.SparkPlan import org.apache.spark.sql.execution.command.CommandUtils +import org.apache.spark.sql.hive.HiveExternalCatalog import org.apache.spark.sql.hive.HiveShim.{ShimFileSinkDesc => FileSinkDesc} import org.apache.spark.sql.hive.client.HiveClientImpl +import org.apache.spark.sql.hive.client.hive._ /** @@ -130,6 +133,7 @@ case class InsertIntoHiveTable( val numDynamicPartitions = partition.values.count(_.isEmpty) val numStaticPartitions = partition.values.count(_.nonEmpty) val partitionSpec = partition.map { + case (key, Some(null)) => key -> ExternalCatalogUtils.DEFAULT_PARTITION_NAME case (key, Some(value)) => key -> value case (key, None) => key -> "" } @@ -169,7 +173,7 @@ case class InsertIntoHiveTable( table.bucketSpec match { case Some(bucketSpec) => // Writes to bucketed hive tables are allowed only if user does not care about maintaining - // table's bucketing ie. both "hive.enforce.bucketing" and "hive.enforce.sorting" are + // table's bucketing i.e. both "hive.enforce.bucketing" and "hive.enforce.sorting" are // set to false val enforceBucketingConfig = "hive.enforce.bucketing" val enforceSortingConfig = "hive.enforce.sorting" @@ -223,9 +227,13 @@ case class InsertIntoHiveTable( ExternalCatalogUtils.unescapePathName(splitPart(1)) }.toMap + val caseInsensitiveDpMap = CaseInsensitiveMap(dpMap) + val updatedPartitionSpec = partition.map { + case (key, Some(null)) => key -> ExternalCatalogUtils.DEFAULT_PARTITION_NAME case (key, Some(value)) => key -> value - case (key, None) if dpMap.contains(key) => key -> dpMap(key) + case (key, None) if caseInsensitiveDpMap.contains(key) => + key -> caseInsensitiveDpMap(key) case (key, _) => throw new SparkException(s"Dynamic partition key $key is not among " + "written partition paths.") @@ -239,7 +247,7 @@ case class InsertIntoHiveTable( if (fs.exists(partitionPath)) { if (!fs.delete(partitionPath, true)) { throw new RuntimeException( - "Cannot remove partition directory '" + partitionPath.toString) + s"Cannot remove partition directory '$partitionPath'") } } } @@ -285,13 +293,27 @@ case class InsertIntoHiveTable( // Newer Hive largely improves insert overwrite performance. As Spark uses older Hive // version and we may not want to catch up new Hive version every time. We delete the // Hive partition first and then load data file into the Hive partition. - if (partitionPath.nonEmpty && overwrite) { + val hiveVersion = externalCatalog.asInstanceOf[ExternalCatalogWithListener] + .unwrapped.asInstanceOf[HiveExternalCatalog] + .client + .version + // SPARK-31684: + // For Hive 2.0.0 and onwards, as https://issues.apache.org/jira/browse/HIVE-11940 + // has been fixed, and there is no performance issue anymore. We should leave the + // overwrite logic to hive to avoid failure in `FileSystem#checkPath` when the table + // and partition locations do not belong to the same `FileSystem` + // TODO(SPARK-31675): For Hive 2.2.0 and earlier, if the table and partition locations + // do not belong together, we will still get the same error thrown by hive encryption + // check. see https://issues.apache.org/jira/browse/HIVE-14380. + // So we still disable for Hive overwrite for Hive 1.x for better performance because + // the partition and table are on the same cluster in most cases. + if (partitionPath.nonEmpty && overwrite && hiveVersion < v2_0) { partitionPath.foreach { path => val fs = path.getFileSystem(hadoopConf) if (fs.exists(path)) { if (!fs.delete(path, true)) { throw new RuntimeException( - "Cannot remove partition directory '" + path.toString) + s"Cannot remove partition directory '$path'") } // Don't let Hive do overwrite operation since it is slower. doHiveOverwrite = false @@ -321,4 +343,7 @@ case class InsertIntoHiveTable( isSrcLocal = false) } } + + override protected def withNewChildInternal(newChild: LogicalPlan): InsertIntoHiveTable = + copy(query = newChild) } diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/PruneHiveTablePartitions.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/PruneHiveTablePartitions.scala index da6e4c52cf3a7..a831e8b8983cc 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/PruneHiveTablePartitions.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/PruneHiveTablePartitions.scala @@ -21,13 +21,13 @@ import org.apache.hadoop.hive.common.StatsSetupConst import org.apache.spark.sql.SparkSession import org.apache.spark.sql.catalyst.analysis.CastSupport -import org.apache.spark.sql.catalyst.catalog.{CatalogStatistics, CatalogTable, CatalogTablePartition, ExternalCatalogUtils, HiveTableRelation} -import org.apache.spark.sql.catalyst.expressions.{And, AttributeSet, Expression, ExpressionSet, SubqueryExpression} +import org.apache.spark.sql.catalyst.catalog._ +import org.apache.spark.sql.catalyst.expressions.{And, AttributeSet, Expression, ExpressionSet, PredicateHelper, SubqueryExpression} import org.apache.spark.sql.catalyst.planning.PhysicalOperation import org.apache.spark.sql.catalyst.plans.logical.{Filter, LogicalPlan, Project} +import org.apache.spark.sql.catalyst.plans.logical.statsEstimation.FilterEstimation import org.apache.spark.sql.catalyst.rules.Rule import org.apache.spark.sql.execution.datasources.DataSourceStrategy -import org.apache.spark.sql.internal.SQLConf /** * Prune hive table partitions using partition filters on [[HiveTableRelation]]. The pruned @@ -35,15 +35,13 @@ import org.apache.spark.sql.internal.SQLConf * the hive table relation will be updated based on pruned partitions. * * This rule is executed in optimization phase, so the statistics can be updated before physical - * planning, which is useful for some spark strategy, eg. + * planning, which is useful for some spark strategy, e.g. * [[org.apache.spark.sql.execution.SparkStrategies.JoinSelection]]. * * TODO: merge this with PruneFileSourcePartitions after we completely make hive as a data source. */ private[sql] class PruneHiveTablePartitions(session: SparkSession) - extends Rule[LogicalPlan] with CastSupport { - - override val conf: SQLConf = session.sessionState.conf + extends Rule[LogicalPlan] with CastSupport with PredicateHelper { /** * Extract the partition filters from the filters on the table. @@ -54,9 +52,8 @@ private[sql] class PruneHiveTablePartitions(session: SparkSession) val normalizedFilters = DataSourceStrategy.normalizeExprs( filters.filter(f => f.deterministic && !SubqueryExpression.hasSubquery(f)), relation.output) val partitionColumnSet = AttributeSet(relation.partitionCols) - ExpressionSet(normalizedFilters.filter { f => - !f.references.isEmpty && f.references.subsetOf(partitionColumnSet) - }) + ExpressionSet( + normalizedFilters.flatMap(extractPredicatesWithinOutputSet(_, partitionColumnSet))) } /** @@ -79,8 +76,9 @@ private[sql] class PruneHiveTablePartitions(session: SparkSession) * Update the statistics of the table. */ private def updateTableMeta( - tableMeta: CatalogTable, - prunedPartitions: Seq[CatalogTablePartition]): CatalogTable = { + relation: HiveTableRelation, + prunedPartitions: Seq[CatalogTablePartition], + partitionKeyFilters: ExpressionSet): CatalogTable = { val sizeOfPartitions = prunedPartitions.map { partition => val rawDataSize = partition.parameters.get(StatsSetupConst.RAW_DATA_SIZE).map(_.toLong) val totalSize = partition.parameters.get(StatsSetupConst.TOTAL_SIZE).map(_.toLong) @@ -93,10 +91,18 @@ private[sql] class PruneHiveTablePartitions(session: SparkSession) } } if (sizeOfPartitions.forall(_ > 0)) { - val sizeInBytes = sizeOfPartitions.sum - tableMeta.copy(stats = Some(CatalogStatistics(sizeInBytes = BigInt(sizeInBytes)))) + val filteredStats = + FilterEstimation(Filter(partitionKeyFilters.reduce(And), relation)).estimate + val colStats = filteredStats.map(_.attributeStats.map { case (attr, colStat) => + (attr.name, colStat.toCatalogColumnStat(attr.name, attr.dataType)) + }) + relation.tableMeta.copy( + stats = Some(CatalogStatistics( + sizeInBytes = BigInt(sizeOfPartitions.sum), + rowCount = filteredStats.flatMap(_.rowCount), + colStats = colStats.getOrElse(Map.empty)))) } else { - tableMeta + relation.tableMeta } } @@ -106,7 +112,7 @@ private[sql] class PruneHiveTablePartitions(session: SparkSession) val partitionKeyFilters = getPartitionKeyFilters(filters, relation) if (partitionKeyFilters.nonEmpty) { val newPartitions = prunePartitions(relation, partitionKeyFilters) - val newTableMeta = updateTableMeta(relation.tableMeta, newPartitions) + val newTableMeta = updateTableMeta(relation, newPartitions, partitionKeyFilters) val newRelation = relation.copy( tableMeta = newTableMeta, prunedPartitions = Some(newPartitions)) // Keep partition filters so that they are visible in physical planning diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/SaveAsHiveFile.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/SaveAsHiveFile.scala index 4be3cd45454c6..c712a4a2b7c23 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/SaveAsHiveFile.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/SaveAsHiveFile.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.hive.execution -import java.io.{File, IOException} +import java.io.IOException import java.net.URI import java.text.SimpleDateFormat import java.util.{Date, Locale, Random} diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala deleted file mode 100644 index c7183fd7385a6..0000000000000 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/execution/ScriptTransformationExec.scala +++ /dev/null @@ -1,468 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.hive.execution - -import java.io._ -import java.nio.charset.StandardCharsets -import java.util.Properties -import java.util.concurrent.TimeUnit -import javax.annotation.Nullable - -import scala.collection.JavaConverters._ -import scala.util.control.NonFatal - -import org.apache.hadoop.conf.Configuration -import org.apache.hadoop.hive.ql.exec.{RecordReader, RecordWriter} -import org.apache.hadoop.hive.serde.serdeConstants -import org.apache.hadoop.hive.serde2.AbstractSerDe -import org.apache.hadoop.hive.serde2.objectinspector._ -import org.apache.hadoop.io.Writable - -import org.apache.spark.{SparkException, TaskContext} -import org.apache.spark.internal.Logging -import org.apache.spark.rdd.RDD -import org.apache.spark.sql.catalyst.{CatalystTypeConverters, InternalRow} -import org.apache.spark.sql.catalyst.expressions._ -import org.apache.spark.sql.catalyst.plans.logical.ScriptInputOutputSchema -import org.apache.spark.sql.catalyst.plans.physical.Partitioning -import org.apache.spark.sql.execution._ -import org.apache.spark.sql.hive.HiveInspectors -import org.apache.spark.sql.hive.HiveShim._ -import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.sql.types.DataType -import org.apache.spark.util.{CircularBuffer, RedirectThread, SerializableConfiguration, Utils} - -/** - * Transforms the input by forking and running the specified script. - * - * @param input the set of expression that should be passed to the script. - * @param script the command that should be executed. - * @param output the attributes that are produced by the script. - */ -case class ScriptTransformationExec( - input: Seq[Expression], - script: String, - output: Seq[Attribute], - child: SparkPlan, - ioschema: HiveScriptIOSchema) - extends UnaryExecNode { - - override def producedAttributes: AttributeSet = outputSet -- inputSet - - override def outputPartitioning: Partitioning = child.outputPartitioning - - protected override def doExecute(): RDD[InternalRow] = { - def processIterator(inputIterator: Iterator[InternalRow], hadoopConf: Configuration) - : Iterator[InternalRow] = { - val cmd = List("/bin/bash", "-c", script) - val builder = new ProcessBuilder(cmd.asJava) - - val proc = builder.start() - val inputStream = proc.getInputStream - val outputStream = proc.getOutputStream - val errorStream = proc.getErrorStream - - // In order to avoid deadlocks, we need to consume the error output of the child process. - // To avoid issues caused by large error output, we use a circular buffer to limit the amount - // of error output that we retain. See SPARK-7862 for more discussion of the deadlock / hang - // that motivates this. - val stderrBuffer = new CircularBuffer(2048) - new RedirectThread( - errorStream, - stderrBuffer, - "Thread-ScriptTransformation-STDERR-Consumer").start() - - val outputProjection = new InterpretedProjection(input, child.output) - - // This nullability is a performance optimization in order to avoid an Option.foreach() call - // inside of a loop - @Nullable val (inputSerde, inputSoi) = ioschema.initInputSerDe(input).getOrElse((null, null)) - - // This new thread will consume the ScriptTransformation's input rows and write them to the - // external process. That process's output will be read by this current thread. - val writerThread = new ScriptTransformationWriterThread( - inputIterator.map(outputProjection), - input.map(_.dataType), - inputSerde, - inputSoi, - ioschema, - outputStream, - proc, - stderrBuffer, - TaskContext.get(), - hadoopConf - ) - - // This nullability is a performance optimization in order to avoid an Option.foreach() call - // inside of a loop - @Nullable val (outputSerde, outputSoi) = { - ioschema.initOutputSerDe(output).getOrElse((null, null)) - } - - val reader = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8)) - val outputIterator: Iterator[InternalRow] = new Iterator[InternalRow] with HiveInspectors { - var curLine: String = null - val scriptOutputStream = new DataInputStream(inputStream) - - @Nullable val scriptOutputReader = - ioschema.recordReader(scriptOutputStream, hadoopConf).orNull - - var scriptOutputWritable: Writable = null - val reusedWritableObject: Writable = if (null != outputSerde) { - outputSerde.getSerializedClass().getConstructor().newInstance() - } else { - null - } - val mutableRow = new SpecificInternalRow(output.map(_.dataType)) - - @transient - lazy val unwrappers = outputSoi.getAllStructFieldRefs.asScala.map(unwrapperFor) - - private def checkFailureAndPropagate(cause: Throwable = null): Unit = { - if (writerThread.exception.isDefined) { - throw writerThread.exception.get - } - - // There can be a lag between reader read EOF and the process termination. - // If the script fails to startup, this kind of error may be missed. - // So explicitly waiting for the process termination. - val timeout = conf.getConf(SQLConf.SCRIPT_TRANSFORMATION_EXIT_TIMEOUT) - val exitRes = proc.waitFor(timeout, TimeUnit.SECONDS) - if (!exitRes) { - log.warn(s"Transformation script process exits timeout in $timeout seconds") - } - - if (!proc.isAlive) { - val exitCode = proc.exitValue() - if (exitCode != 0) { - logError(stderrBuffer.toString) // log the stderr circular buffer - throw new SparkException(s"Subprocess exited with status $exitCode. " + - s"Error: ${stderrBuffer.toString}", cause) - } - } - } - - override def hasNext: Boolean = { - try { - if (outputSerde == null) { - if (curLine == null) { - curLine = reader.readLine() - if (curLine == null) { - checkFailureAndPropagate() - return false - } - } - } else if (scriptOutputWritable == null) { - scriptOutputWritable = reusedWritableObject - - if (scriptOutputReader != null) { - if (scriptOutputReader.next(scriptOutputWritable) <= 0) { - checkFailureAndPropagate() - return false - } - } else { - try { - scriptOutputWritable.readFields(scriptOutputStream) - } catch { - case _: EOFException => - // This means that the stdout of `proc` (ie. TRANSFORM process) has exhausted. - // Ideally the proc should *not* be alive at this point but - // there can be a lag between EOF being written out and the process - // being terminated. So explicitly waiting for the process to be done. - checkFailureAndPropagate() - return false - } - } - } - - true - } catch { - case NonFatal(e) => - // If this exception is due to abrupt / unclean termination of `proc`, - // then detect it and propagate a better exception message for end users - checkFailureAndPropagate(e) - - throw e - } - } - - override def next(): InternalRow = { - if (!hasNext) { - throw new NoSuchElementException - } - if (outputSerde == null) { - val prevLine = curLine - curLine = reader.readLine() - if (!ioschema.schemaLess) { - new GenericInternalRow( - prevLine.split(ioschema.outputRowFormatMap("TOK_TABLEROWFORMATFIELD")) - .map(CatalystTypeConverters.convertToCatalyst)) - } else { - new GenericInternalRow( - prevLine.split(ioschema.outputRowFormatMap("TOK_TABLEROWFORMATFIELD"), 2) - .map(CatalystTypeConverters.convertToCatalyst)) - } - } else { - val raw = outputSerde.deserialize(scriptOutputWritable) - scriptOutputWritable = null - val dataList = outputSoi.getStructFieldsDataAsList(raw) - var i = 0 - while (i < dataList.size()) { - if (dataList.get(i) == null) { - mutableRow.setNullAt(i) - } else { - unwrappers(i)(dataList.get(i), mutableRow, i) - } - i += 1 - } - mutableRow - } - } - } - - writerThread.start() - - outputIterator - } - - val broadcastedHadoopConf = - new SerializableConfiguration(sqlContext.sessionState.newHadoopConf()) - - child.execute().mapPartitions { iter => - if (iter.hasNext) { - val proj = UnsafeProjection.create(schema) - processIterator(iter, broadcastedHadoopConf.value).map(proj) - } else { - // If the input iterator has no rows then do not launch the external script. - Iterator.empty - } - } - } -} - -private class ScriptTransformationWriterThread( - iter: Iterator[InternalRow], - inputSchema: Seq[DataType], - @Nullable inputSerde: AbstractSerDe, - @Nullable inputSoi: StructObjectInspector, - ioschema: HiveScriptIOSchema, - outputStream: OutputStream, - proc: Process, - stderrBuffer: CircularBuffer, - taskContext: TaskContext, - conf: Configuration - ) extends Thread("Thread-ScriptTransformation-Feed") with HiveInspectors with Logging { - - setDaemon(true) - - @volatile private var _exception: Throwable = null - - /** Contains the exception thrown while writing the parent iterator to the external process. */ - def exception: Option[Throwable] = Option(_exception) - - override def run(): Unit = Utils.logUncaughtExceptions { - TaskContext.setTaskContext(taskContext) - - val dataOutputStream = new DataOutputStream(outputStream) - @Nullable val scriptInputWriter = ioschema.recordWriter(dataOutputStream, conf).orNull - - // We can't use Utils.tryWithSafeFinally here because we also need a `catch` block, so - // let's use a variable to record whether the `finally` block was hit due to an exception - var threwException: Boolean = true - val len = inputSchema.length - try { - if (inputSerde == null) { - iter.foreach { row => - val data = if (len == 0) { - ioschema.inputRowFormatMap("TOK_TABLEROWFORMATLINES") - } else { - val sb = new StringBuilder - sb.append(row.get(0, inputSchema(0))) - var i = 1 - while (i < len) { - sb.append(ioschema.inputRowFormatMap("TOK_TABLEROWFORMATFIELD")) - sb.append(row.get(i, inputSchema(i))) - i += 1 - } - sb.append(ioschema.inputRowFormatMap("TOK_TABLEROWFORMATLINES")) - sb.toString() - } - outputStream.write(data.getBytes(StandardCharsets.UTF_8)) - } - } else { - // Convert Spark InternalRows to hive data via `HiveInspectors.wrapperFor`. - val hiveData = new Array[Any](inputSchema.length) - val fieldOIs = inputSoi.getAllStructFieldRefs.asScala.map(_.getFieldObjectInspector).toArray - val wrappers = fieldOIs.zip(inputSchema).map { case (f, dt) => wrapperFor(f, dt) } - - iter.foreach { row => - var i = 0 - while (i < fieldOIs.length) { - hiveData(i) = if (row.isNullAt(i)) null else wrappers(i)(row.get(i, inputSchema(i))) - i += 1 - } - - val writable = inputSerde.serialize(hiveData, inputSoi) - if (scriptInputWriter != null) { - scriptInputWriter.write(writable) - } else { - prepareWritable(writable, ioschema.outputSerdeProps).write(dataOutputStream) - } - } - } - threwException = false - } catch { - // SPARK-25158 Exception should not be thrown again, otherwise it will be captured by - // SparkUncaughtExceptionHandler, then Executor will exit because of this Uncaught Exception, - // so pass the exception to `ScriptTransformationExec` is enough. - case t: Throwable => - // An error occurred while writing input, so kill the child process. According to the - // Javadoc this call will not throw an exception: - _exception = t - proc.destroy() - logError("Thread-ScriptTransformation-Feed exit cause by: ", t) - } finally { - try { - Utils.tryLogNonFatalError(outputStream.close()) - if (proc.waitFor() != 0) { - logError(stderrBuffer.toString) // log the stderr circular buffer - } - } catch { - case NonFatal(exceptionFromFinallyBlock) => - if (!threwException) { - throw exceptionFromFinallyBlock - } else { - log.error("Exception in finally block", exceptionFromFinallyBlock) - } - } - } - } -} - -object HiveScriptIOSchema { - def apply(input: ScriptInputOutputSchema): HiveScriptIOSchema = { - HiveScriptIOSchema( - input.inputRowFormat, - input.outputRowFormat, - input.inputSerdeClass, - input.outputSerdeClass, - input.inputSerdeProps, - input.outputSerdeProps, - input.recordReaderClass, - input.recordWriterClass, - input.schemaLess) - } -} - -/** - * The wrapper class of Hive input and output schema properties - */ -case class HiveScriptIOSchema ( - inputRowFormat: Seq[(String, String)], - outputRowFormat: Seq[(String, String)], - inputSerdeClass: Option[String], - outputSerdeClass: Option[String], - inputSerdeProps: Seq[(String, String)], - outputSerdeProps: Seq[(String, String)], - recordReaderClass: Option[String], - recordWriterClass: Option[String], - schemaLess: Boolean) - extends HiveInspectors { - - private val defaultFormat = Map( - ("TOK_TABLEROWFORMATFIELD", "\t"), - ("TOK_TABLEROWFORMATLINES", "\n") - ) - - val inputRowFormatMap = inputRowFormat.toMap.withDefault((k) => defaultFormat(k)) - val outputRowFormatMap = outputRowFormat.toMap.withDefault((k) => defaultFormat(k)) - - - def initInputSerDe(input: Seq[Expression]): Option[(AbstractSerDe, StructObjectInspector)] = { - inputSerdeClass.map { serdeClass => - val (columns, columnTypes) = parseAttrs(input) - val serde = initSerDe(serdeClass, columns, columnTypes, inputSerdeProps) - val fieldObjectInspectors = columnTypes.map(toInspector) - val objectInspector = ObjectInspectorFactory - .getStandardStructObjectInspector(columns.asJava, fieldObjectInspectors.asJava) - (serde, objectInspector) - } - } - - def initOutputSerDe(output: Seq[Attribute]): Option[(AbstractSerDe, StructObjectInspector)] = { - outputSerdeClass.map { serdeClass => - val (columns, columnTypes) = parseAttrs(output) - val serde = initSerDe(serdeClass, columns, columnTypes, outputSerdeProps) - val structObjectInspector = serde.getObjectInspector().asInstanceOf[StructObjectInspector] - (serde, structObjectInspector) - } - } - - private def parseAttrs(attrs: Seq[Expression]): (Seq[String], Seq[DataType]) = { - val columns = attrs.zipWithIndex.map(e => s"${e._1.prettyName}_${e._2}") - val columnTypes = attrs.map(_.dataType) - (columns, columnTypes) - } - - private def initSerDe( - serdeClassName: String, - columns: Seq[String], - columnTypes: Seq[DataType], - serdeProps: Seq[(String, String)]): AbstractSerDe = { - - val serde = Utils.classForName[AbstractSerDe](serdeClassName).getConstructor(). - newInstance() - - val columnTypesNames = columnTypes.map(_.toTypeInfo.getTypeName()).mkString(",") - - var propsMap = serdeProps.toMap + (serdeConstants.LIST_COLUMNS -> columns.mkString(",")) - propsMap = propsMap + (serdeConstants.LIST_COLUMN_TYPES -> columnTypesNames) - - val properties = new Properties() - // Can not use properties.putAll(propsMap.asJava) in scala-2.12 - // See https://github.com/scala/bug/issues/10418 - propsMap.foreach { case (k, v) => properties.put(k, v) } - serde.initialize(null, properties) - - serde - } - - def recordReader( - inputStream: InputStream, - conf: Configuration): Option[RecordReader] = { - recordReaderClass.map { klass => - val instance = Utils.classForName[RecordReader](klass).getConstructor(). - newInstance() - val props = new Properties() - // Can not use props.putAll(outputSerdeProps.toMap.asJava) in scala-2.12 - // See https://github.com/scala/bug/issues/10418 - outputSerdeProps.toMap.foreach { case (k, v) => props.put(k, v) } - instance.initialize(inputStream, conf, props) - instance - } - } - - def recordWriter(outputStream: OutputStream, conf: Configuration): Option[RecordWriter] = { - recordWriterClass.map { klass => - val instance = Utils.classForName[RecordWriter](klass).getConstructor(). - newInstance() - instance.initialize(outputStream, conf) - instance - } - } -} diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala index 05d608a2016a5..7c3d1617bfaeb 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/hiveUDFs.scala @@ -17,7 +17,6 @@ package org.apache.spark.sql.hive -import java.lang.{Boolean => JBoolean} import java.nio.ByteBuffer import scala.collection.JavaConverters._ @@ -39,8 +38,12 @@ import org.apache.spark.sql.catalyst.expressions.aggregate._ import org.apache.spark.sql.catalyst.expressions.codegen.CodegenFallback import org.apache.spark.sql.hive.HiveShim._ import org.apache.spark.sql.types._ -import org.apache.spark.util.Utils +/** + * Here we cannot extends `ImplicitTypeCasts` to compatible with UDF input data type, the reason is: + * we use children data type to reflect UDF method first and will get exception if it fails so that + * we can never go into `ImplicitTypeCasts`. + */ private[hive] case class HiveSimpleUDF( name: String, funcWrapper: HiveFunctionWrapper, children: Seq[Expression]) extends Expression @@ -107,6 +110,9 @@ private[hive] case class HiveSimpleUDF( override def prettyName: String = name override def sql: String = s"$name(${children.map(_.sql).mkString(", ")})" + + override protected def withNewChildrenInternal(newChildren: IndexedSeq[Expression]): Expression = + copy(children = newChildren) } // Adapter from Catalyst ExpressionResult to Hive DeferredObject @@ -183,6 +189,9 @@ private[hive] case class HiveGenericUDF( override def toString: String = { s"$nodeName#${funcWrapper.functionClassName}(${children.mkString(",")})" } + + override protected def withNewChildrenInternal(newChildren: IndexedSeq[Expression]): Expression = + copy(children = newChildren) } /** @@ -210,10 +219,14 @@ private[hive] case class HiveGenericUDTF( } @transient - protected lazy val inputInspectors = children.map(toInspector) + protected lazy val inputInspector = { + val inspectors = children.map(toInspector) + val fields = inspectors.indices.map(index => s"_col$index").asJava + ObjectInspectorFactory.getStandardStructObjectInspector(fields, inspectors.asJava) + } @transient - protected lazy val outputInspector = function.initialize(inputInspectors.toArray) + protected lazy val outputInspector = function.initialize(inputInspector) @transient protected lazy val udtInput = new Array[AnyRef](children.length) @@ -224,7 +237,7 @@ private[hive] case class HiveGenericUDTF( override lazy val elementSchema = StructType(outputInspector.getAllStructFieldRefs.asScala.map { field => StructField(field.getFieldName, inspectorToDataType(field.getFieldObjectInspector), nullable = true) - }) + }.toSeq) @transient private lazy val inputDataTypes: Array[DataType] = children.map(_.dataType).toArray @@ -257,7 +270,7 @@ private[hive] case class HiveGenericUDTF( def collectRows(): Seq[InternalRow] = { val toCollect = collected collected = new ArrayBuffer[InternalRow] - toCollect + toCollect.toSeq } } @@ -272,6 +285,9 @@ private[hive] case class HiveGenericUDTF( } override def prettyName: String = name + + override protected def withNewChildrenInternal(newChildren: IndexedSeq[Expression]): Expression = + copy(children = newChildren) } /** @@ -344,20 +360,8 @@ private[hive] case class HiveUDAFFunction( funcWrapper.createFunction[AbstractGenericUDAFResolver]() } - val clazz = Utils.classForName(classOf[SimpleGenericUDAFParameterInfo].getName) - if (HiveUtils.isHive23) { - val ctor = clazz.getDeclaredConstructor( - classOf[Array[ObjectInspector]], JBoolean.TYPE, JBoolean.TYPE, JBoolean.TYPE) - val args = Array[AnyRef](inputInspectors, JBoolean.FALSE, JBoolean.FALSE, JBoolean.FALSE) - val parameterInfo = ctor.newInstance(args: _*).asInstanceOf[SimpleGenericUDAFParameterInfo] - resolver.getEvaluator(parameterInfo) - } else { - val ctor = clazz.getDeclaredConstructor( - classOf[Array[ObjectInspector]], JBoolean.TYPE, JBoolean.TYPE) - val args = Array[AnyRef](inputInspectors, JBoolean.FALSE, JBoolean.FALSE) - val parameterInfo = ctor.newInstance(args: _*).asInstanceOf[SimpleGenericUDAFParameterInfo] - resolver.getEvaluator(parameterInfo) - } + val parameterInfo = new SimpleGenericUDAFParameterInfo(inputInspectors, false, false, false) + resolver.getEvaluator(parameterInfo) } private case class HiveEvaluator( @@ -533,6 +537,9 @@ private[hive] case class HiveUDAFFunction( buffer } } + + override protected def withNewChildrenInternal(newChildren: IndexedSeq[Expression]): Expression = + copy(children = newChildren) } case class HiveUDAFBuffer(buf: AggregationBuffer, canDoMerge: Boolean) diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFileFormat.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFileFormat.scala index 7f2eb14956dc1..d2ac06ad0a16a 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFileFormat.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFileFormat.scala @@ -32,12 +32,14 @@ import org.apache.hadoop.fs.{FileStatus, Path} import org.apache.hadoop.hive.conf.HiveConf.ConfVars import org.apache.hadoop.hive.ql.io.orc._ import org.apache.hadoop.hive.ql.io.sarg.SearchArgument +import org.apache.hadoop.hive.serde2.objectinspector import org.apache.hadoop.hive.serde2.objectinspector.{SettableStructObjectInspector, StructObjectInspector} import org.apache.hadoop.hive.serde2.typeinfo.{StructTypeInfo, TypeInfoUtils} import org.apache.hadoop.io.{NullWritable, Writable} import org.apache.hadoop.mapred.{JobConf, OutputFormat => MapRedOutputFormat, RecordWriter, Reporter} import org.apache.hadoop.mapreduce._ import org.apache.hadoop.mapreduce.lib.input.FileInputFormat +import org.apache.orc.OrcConf import org.apache.orc.OrcConf.COMPRESS import org.apache.spark.{SPARK_VERSION_SHORT, TaskContext} @@ -47,7 +49,7 @@ import org.apache.spark.sql.SparkSession import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.execution.datasources._ -import org.apache.spark.sql.execution.datasources.orc.OrcOptions +import org.apache.spark.sql.execution.datasources.orc.{OrcFilters, OrcOptions} import org.apache.spark.sql.hive.{HiveInspectors, HiveShim} import org.apache.spark.sql.sources.{Filter, _} import org.apache.spark.sql.types._ @@ -70,14 +72,12 @@ class OrcFileFormat extends FileFormat with DataSourceRegister with Serializable val orcOptions = new OrcOptions(options, sparkSession.sessionState.conf) if (orcOptions.mergeSchema) { SchemaMergeUtils.mergeSchemasInParallel( - sparkSession, - files, - OrcFileOperator.readOrcSchemasInParallel) + sparkSession, options, files, OrcFileOperator.readOrcSchemasInParallel) } else { val ignoreCorruptFiles = sparkSession.sessionState.conf.ignoreCorruptFiles OrcFileOperator.readSchema( files.map(_.getPath.toString), - Some(sparkSession.sessionState.newHadoopConf()), + Some(sparkSession.sessionState.newHadoopConfWithOptions(options)), ignoreCorruptFiles ) } @@ -141,7 +141,7 @@ class OrcFileFormat extends FileFormat with DataSourceRegister with Serializable if (sparkSession.sessionState.conf.orcFilterPushDown) { // Sets pushed predicates - OrcFilters.createFilter(requiredSchema, filters.toArray).foreach { f => + OrcFilters.createFilter(requiredSchema, filters).foreach { f => hadoopConf.set(OrcFileFormat.SARG_PUSHDOWN, toKryo(f)) hadoopConf.setBoolean(ConfVars.HIVEOPTINDEXFILTER.varname, true) } @@ -271,7 +271,7 @@ private[orc] class OrcSerializer(dataSchema: StructType, conf: Configuration) } private[orc] class OrcOutputWriter( - path: String, + val path: String, dataSchema: StructType, context: TaskAttemptContext) extends OutputWriter { @@ -298,7 +298,7 @@ private[orc] class OrcOutputWriter( override def close(): Unit = { if (recordWriterInstantiated) { - // Hive 1.2.1 ORC initializes its private `writer` field at the first write. + // Hive ORC initializes its private `writer` field at the first write. OrcFileFormat.addSparkVersionMetadata(recordWriter) recordWriter.close(Reporter.NULL) } @@ -325,13 +325,19 @@ private[orc] object OrcFileFormat extends HiveInspectors with Logging { val deserializer = new OrcSerde val mutableRow = new SpecificInternalRow(requiredSchema.map(_.dataType)) val unsafeProjection = UnsafeProjection.create(requiredSchema) + val forcePositionalEvolution = OrcConf.FORCE_POSITIONAL_EVOLUTION.getBoolean(conf) def unwrap(oi: StructObjectInspector): Iterator[InternalRow] = { val (fieldRefs, fieldOrdinals) = requiredSchema.zipWithIndex.map { case (field, ordinal) => - var ref = oi.getStructFieldRef(field.name) - if (ref == null) { - ref = oi.getStructFieldRef("_col" + dataSchema.fieldIndex(field.name)) + var ref: objectinspector.StructField = null + if (forcePositionalEvolution) { + ref = oi.getAllStructFieldRefs.get(dataSchema.fieldIndex(field.name)) + } else { + ref = oi.getStructFieldRef(field.name) + if (ref == null) { + ref = oi.getStructFieldRef("_col" + dataSchema.fieldIndex(field.name)) + } } ref -> ordinal }.unzip diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFilters.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFilters.scala deleted file mode 100644 index f9c514567c639..0000000000000 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/orc/OrcFilters.scala +++ /dev/null @@ -1,262 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.hive.orc - -import java.lang.reflect.Method - -import org.apache.hadoop.hive.ql.io.sarg.SearchArgument -import org.apache.hadoop.hive.ql.io.sarg.SearchArgument.Builder -import org.apache.hadoop.hive.ql.io.sarg.SearchArgumentFactory.newBuilder - -import org.apache.spark.SparkException -import org.apache.spark.internal.Logging -import org.apache.spark.sql.connector.catalog.CatalogV2Implicits.quoteIfNeeded -import org.apache.spark.sql.execution.datasources.orc.{OrcFilters => DatasourceOrcFilters} -import org.apache.spark.sql.execution.datasources.orc.OrcFilters.buildTree -import org.apache.spark.sql.hive.HiveUtils -import org.apache.spark.sql.sources._ -import org.apache.spark.sql.types._ - -/** - * Helper object for building ORC `SearchArgument`s, which are used for ORC predicate push-down. - * - * Due to limitation of ORC `SearchArgument` builder, we had to end up with a pretty weird double- - * checking pattern when converting `And`/`Or`/`Not` filters. - * - * An ORC `SearchArgument` must be built in one pass using a single builder. For example, you can't - * build `a = 1` and `b = 2` first, and then combine them into `a = 1 AND b = 2`. This is quite - * different from the cases in Spark SQL or Parquet, where complex filters can be easily built using - * existing simpler ones. - * - * The annoying part is that, `SearchArgument` builder methods like `startAnd()`, `startOr()`, and - * `startNot()` mutate internal state of the builder instance. This forces us to translate all - * convertible filters with a single builder instance. However, before actually converting a filter, - * we've no idea whether it can be recognized by ORC or not. Thus, when an inconvertible filter is - * found, we may already end up with a builder whose internal state is inconsistent. - * - * For example, to convert an `And` filter with builder `b`, we call `b.startAnd()` first, and then - * try to convert its children. Say we convert `left` child successfully, but find that `right` - * child is inconvertible. Alas, `b.startAnd()` call can't be rolled back, and `b` is inconsistent - * now. - * - * The workaround employed here is that, for `And`/`Or`/`Not`, we first try to convert their - * children with brand new builders, and only do the actual conversion with the right builder - * instance when the children are proven to be convertible. - * - * P.S.: Hive seems to use `SearchArgument` together with `ExprNodeGenericFuncDesc` only. Usage of - * builder methods mentioned above can only be found in test code, where all tested filters are - * known to be convertible. - */ -private[orc] object OrcFilters extends Logging { - - private def findMethod(klass: Class[_], name: String, args: Class[_]*): Method = { - val method = klass.getMethod(name, args: _*) - method.setAccessible(true) - method - } - - def createFilter(schema: StructType, filters: Array[Filter]): Option[SearchArgument] = { - if (HiveUtils.isHive23) { - DatasourceOrcFilters.createFilter(schema, filters).asInstanceOf[Option[SearchArgument]] - } else { - val dataTypeMap = schema.map(f => quoteIfNeeded(f.name) -> f.dataType).toMap - // TODO (SPARK-25557): ORC doesn't support nested predicate pushdown, so they are removed. - val newFilters = filters.filter(!_.containsNestedColumn) - // Combines all convertible filters using `And` to produce a single conjunction - val conjunctionOptional = buildTree(convertibleFilters(schema, dataTypeMap, newFilters)) - conjunctionOptional.map { conjunction => - // Then tries to build a single ORC `SearchArgument` for the conjunction predicate. - // The input predicate is fully convertible. There should not be any empty result in the - // following recursive method call `buildSearchArgument`. - buildSearchArgument(dataTypeMap, conjunction, newBuilder).build() - } - } - } - - def convertibleFilters( - schema: StructType, - dataTypeMap: Map[String, DataType], - filters: Seq[Filter]): Seq[Filter] = { - import org.apache.spark.sql.sources._ - - def convertibleFiltersHelper( - filter: Filter, - canPartialPushDown: Boolean): Option[Filter] = filter match { - // At here, it is not safe to just convert one side and remove the other side - // if we do not understand what the parent filters are. - // - // Here is an example used to explain the reason. - // Let's say we have NOT(a = 2 AND b in ('1')) and we do not understand how to - // convert b in ('1'). If we only convert a = 2, we will end up with a filter - // NOT(a = 2), which will generate wrong results. - // - // Pushing one side of AND down is only safe to do at the top level or in the child - // AND before hitting NOT or OR conditions, and in this case, the unsupported predicate - // can be safely removed. - case And(left, right) => - val leftResultOptional = convertibleFiltersHelper(left, canPartialPushDown) - val rightResultOptional = convertibleFiltersHelper(right, canPartialPushDown) - (leftResultOptional, rightResultOptional) match { - case (Some(leftResult), Some(rightResult)) => Some(And(leftResult, rightResult)) - case (Some(leftResult), None) if canPartialPushDown => Some(leftResult) - case (None, Some(rightResult)) if canPartialPushDown => Some(rightResult) - case _ => None - } - - // The Or predicate is convertible when both of its children can be pushed down. - // That is to say, if one/both of the children can be partially pushed down, the Or - // predicate can be partially pushed down as well. - // - // Here is an example used to explain the reason. - // Let's say we have - // (a1 AND a2) OR (b1 AND b2), - // a1 and b1 is convertible, while a2 and b2 is not. - // The predicate can be converted as - // (a1 OR b1) AND (a1 OR b2) AND (a2 OR b1) AND (a2 OR b2) - // As per the logical in And predicate, we can push down (a1 OR b1). - case Or(left, right) => - for { - lhs <- convertibleFiltersHelper(left, canPartialPushDown) - rhs <- convertibleFiltersHelper(right, canPartialPushDown) - } yield Or(lhs, rhs) - case Not(pred) => - val childResultOptional = convertibleFiltersHelper(pred, canPartialPushDown = false) - childResultOptional.map(Not) - case other => - for (_ <- buildLeafSearchArgument(dataTypeMap, other, newBuilder())) yield other - } - filters.flatMap { filter => - convertibleFiltersHelper(filter, true) - } - } - - /** - * Build a SearchArgument and return the builder so far. - * - * @param dataTypeMap a map from the attribute name to its data type. - * @param expression the input predicates, which should be fully convertible to SearchArgument. - * @param builder the input SearchArgument.Builder. - * @return the builder so far. - */ - private def buildSearchArgument( - dataTypeMap: Map[String, DataType], - expression: Filter, - builder: Builder): Builder = { - expression match { - case And(left, right) => - val lhs = buildSearchArgument(dataTypeMap, left, builder.startAnd()) - val rhs = buildSearchArgument(dataTypeMap, right, lhs) - rhs.end() - - case Or(left, right) => - val lhs = buildSearchArgument(dataTypeMap, left, builder.startOr()) - val rhs = buildSearchArgument(dataTypeMap, right, lhs) - rhs.end() - - case Not(child) => - buildSearchArgument(dataTypeMap, child, builder.startNot()).end() - - case other => - buildLeafSearchArgument(dataTypeMap, other, builder).getOrElse { - throw new SparkException( - "The input filter of OrcFilters.buildSearchArgument should be fully convertible.") - } - } - } - - /** - * Build a SearchArgument for a leaf predicate and return the builder so far. - * - * @param dataTypeMap a map from the attribute name to its data type. - * @param expression the input filter predicates. - * @param builder the input SearchArgument.Builder. - * @return the builder so far. - */ - private def buildLeafSearchArgument( - dataTypeMap: Map[String, DataType], - expression: Filter, - builder: Builder): Option[Builder] = { - def isSearchableType(dataType: DataType): Boolean = dataType match { - // Only the values in the Spark types below can be recognized by - // the `SearchArgumentImpl.BuilderImpl.boxLiteral()` method. - case ByteType | ShortType | FloatType | DoubleType => true - case IntegerType | LongType | StringType | BooleanType => true - case TimestampType | _: DecimalType => true - case _ => false - } - - import org.apache.spark.sql.sources._ - - // NOTE: For all case branches dealing with leaf predicates below, the additional `startAnd()` - // call is mandatory. ORC `SearchArgument` builder requires that all leaf predicates must be - // wrapped by a "parent" predicate (`And`, `Or`, or `Not`). - expression match { - // NOTE: For all case branches dealing with leaf predicates below, the additional `startAnd()` - // call is mandatory. ORC `SearchArgument` builder requires that all leaf predicates must be - // wrapped by a "parent" predicate (`And`, `Or`, or `Not`). - - case EqualTo(attribute, value) if isSearchableType(dataTypeMap(attribute)) => - val bd = builder.startAnd() - val method = findMethod(bd.getClass, "equals", classOf[String], classOf[Object]) - Some(method.invoke(bd, attribute, value.asInstanceOf[AnyRef]).asInstanceOf[Builder].end()) - - case EqualNullSafe(attribute, value) if isSearchableType(dataTypeMap(attribute)) => - val bd = builder.startAnd() - val method = findMethod(bd.getClass, "nullSafeEquals", classOf[String], classOf[Object]) - Some(method.invoke(bd, attribute, value.asInstanceOf[AnyRef]).asInstanceOf[Builder].end()) - - case LessThan(attribute, value) if isSearchableType(dataTypeMap(attribute)) => - val bd = builder.startAnd() - val method = findMethod(bd.getClass, "lessThan", classOf[String], classOf[Object]) - Some(method.invoke(bd, attribute, value.asInstanceOf[AnyRef]).asInstanceOf[Builder].end()) - - case LessThanOrEqual(attribute, value) if isSearchableType(dataTypeMap(attribute)) => - val bd = builder.startAnd() - val method = findMethod(bd.getClass, "lessThanEquals", classOf[String], classOf[Object]) - Some(method.invoke(bd, attribute, value.asInstanceOf[AnyRef]).asInstanceOf[Builder].end()) - - case GreaterThan(attribute, value) if isSearchableType(dataTypeMap(attribute)) => - val bd = builder.startNot() - val method = findMethod(bd.getClass, "lessThanEquals", classOf[String], classOf[Object]) - Some(method.invoke(bd, attribute, value.asInstanceOf[AnyRef]).asInstanceOf[Builder].end()) - - case GreaterThanOrEqual(attribute, value) if isSearchableType(dataTypeMap(attribute)) => - val bd = builder.startNot() - val method = findMethod(bd.getClass, "lessThan", classOf[String], classOf[Object]) - Some(method.invoke(bd, attribute, value.asInstanceOf[AnyRef]).asInstanceOf[Builder].end()) - - case IsNull(attribute) if isSearchableType(dataTypeMap(attribute)) => - val bd = builder.startAnd() - val method = findMethod(bd.getClass, "isNull", classOf[String]) - Some(method.invoke(bd, attribute).asInstanceOf[Builder].end()) - - case IsNotNull(attribute) if isSearchableType(dataTypeMap(attribute)) => - val bd = builder.startNot() - val method = findMethod(bd.getClass, "isNull", classOf[String]) - Some(method.invoke(bd, attribute).asInstanceOf[Builder].end()) - - case In(attribute, values) if isSearchableType(dataTypeMap(attribute)) => - val bd = builder.startAnd() - val method = findMethod(bd.getClass, "in", classOf[String], classOf[Array[Object]]) - Some(method.invoke(bd, attribute, values.map(_.asInstanceOf[AnyRef])) - .asInstanceOf[Builder].end()) - - case _ => None - } - } -} diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/package.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/package.scala index 14276c9b583f2..f89a8a55d8f7e 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/package.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/package.scala @@ -23,5 +23,8 @@ package org.apache.spark.sql * - Using HiveQL to express queries. * - Reading metadata from the Hive Metastore using HiveSerDes. * - Hive UDFs, UDAs, UDTs + * + * Note that this is a private package. All classes in this package are considered an internal API + * to Spark and are subject to change between minor releases. */ package object hive diff --git a/sql/hive/src/test/java/org/apache/spark/sql/hive/JavaDataFrameSuite.java b/sql/hive/src/test/java/org/apache/spark/sql/hive/JavaDataFrameSuite.java index 2b532389bafb6..268a31dc4a5cd 100644 --- a/sql/hive/src/test/java/org/apache/spark/sql/hive/JavaDataFrameSuite.java +++ b/sql/hive/src/test/java/org/apache/spark/sql/hive/JavaDataFrameSuite.java @@ -85,7 +85,7 @@ public void testUDAF() { udaf.distinct(col("value")), udaf.apply(col("value")), registeredUDAF.apply(col("value")), - callUDF("mydoublesum", col("value"))); + callUDF("mydoublesum", col("value"))); // test deprecated one List expectedResult = new ArrayList<>(); expectedResult.add(RowFactory.create(4950.0, 9900.0, 9900.0, 9900.0)); diff --git a/sql/hive/src/test/resources/data/scripts/cat.py b/sql/hive/src/test/resources/data/scripts/cat.py index aea0362f899fa..420d9f832a184 100644 --- a/sql/hive/src/test/resources/data/scripts/cat.py +++ b/sql/hive/src/test/resources/data/scripts/cat.py @@ -16,7 +16,6 @@ # specific language governing permissions and limitations # under the License. # -from __future__ import print_function import sys import os diff --git a/sql/hive/src/test/resources/data/scripts/dumpdata_script.py b/sql/hive/src/test/resources/data/scripts/dumpdata_script.py index 5b360208d36f6..f724fdc85b177 100644 --- a/sql/hive/src/test/resources/data/scripts/dumpdata_script.py +++ b/sql/hive/src/test/resources/data/scripts/dumpdata_script.py @@ -18,12 +18,9 @@ # import sys -if sys.version_info[0] >= 3: - xrange = range - -for i in xrange(50): - for j in xrange(5): - for k in xrange(20022): +for i in range(50): + for j in range(5): + for k in range(20022): print(20000 * i + k) for line in sys.stdin: diff --git a/sql/hive/src/test/resources/data/scripts/test_transform.py b/sql/hive/src/test/resources/data/scripts/test_transform.py index ac6d11d8b919c..dedb370f6c90e 100755 --- a/sql/hive/src/test/resources/data/scripts/test_transform.py +++ b/sql/hive/src/test/resources/data/scripts/test_transform.py @@ -1,3 +1,21 @@ +# +# 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. +# import sys delim = sys.argv[1] diff --git a/sql/hive/src/test/resources/golden/constant null testing-0-237a6af90a857da1efcbe98f6bbbf9d6 b/sql/hive/src/test/resources/golden/constant null testing-0-6a01a94ef1b0d29152c88cd3083fd70b similarity index 100% rename from sql/hive/src/test/resources/golden/constant null testing-0-237a6af90a857da1efcbe98f6bbbf9d6 rename to sql/hive/src/test/resources/golden/constant null testing-0-6a01a94ef1b0d29152c88cd3083fd70b diff --git a/sql/hive/src/test/resources/golden/timestamp cast #2-0-732ed232ac592c5e7f7c913a88874fd2 b/sql/hive/src/test/resources/golden/timestamp cast #2-0-732ed232ac592c5e7f7c913a88874fd2 deleted file mode 100644 index 5625e59da8873..0000000000000 --- a/sql/hive/src/test/resources/golden/timestamp cast #2-0-732ed232ac592c5e7f7c913a88874fd2 +++ /dev/null @@ -1 +0,0 @@ -1.2 diff --git a/sql/hive/src/test/resources/golden/timestamp cast #3-0-9f6fcc8c1a29c793c2238bad91453e9f b/sql/hive/src/test/resources/golden/timestamp cast #3-0-9f6fcc8c1a29c793c2238bad91453e9f new file mode 100644 index 0000000000000..f99e724db6af8 --- /dev/null +++ b/sql/hive/src/test/resources/golden/timestamp cast #3-0-9f6fcc8c1a29c793c2238bad91453e9f @@ -0,0 +1,2 @@ +1.2 + diff --git a/sql/hive/src/test/resources/golden/timestamp cast #4-0-732ed232ac592c5e7f7c913a88874fd2 b/sql/hive/src/test/resources/golden/timestamp cast #4-0-732ed232ac592c5e7f7c913a88874fd2 deleted file mode 100644 index 5625e59da8873..0000000000000 --- a/sql/hive/src/test/resources/golden/timestamp cast #4-0-732ed232ac592c5e7f7c913a88874fd2 +++ /dev/null @@ -1 +0,0 @@ -1.2 diff --git a/sql/hive/src/test/resources/golden/timestamp cast #4-0-e9286317470d42e9f8122bc98a2c1ce1 b/sql/hive/src/test/resources/golden/timestamp cast #4-0-e9286317470d42e9f8122bc98a2c1ce1 new file mode 100644 index 0000000000000..decdb1d30e6a6 --- /dev/null +++ b/sql/hive/src/test/resources/golden/timestamp cast #4-0-e9286317470d42e9f8122bc98a2c1ce1 @@ -0,0 +1,2 @@ +-1.2 + diff --git a/sql/hive/src/test/resources/golden/timestamp cast #6-0-6d2da5cfada03605834e38bc4075bc79 b/sql/hive/src/test/resources/golden/timestamp cast #6-0-6d2da5cfada03605834e38bc4075bc79 deleted file mode 100644 index 1d94c8a014fb4..0000000000000 --- a/sql/hive/src/test/resources/golden/timestamp cast #6-0-6d2da5cfada03605834e38bc4075bc79 +++ /dev/null @@ -1 +0,0 @@ --1.2 diff --git a/sql/hive/src/test/resources/golden/timestamp cast #8-0-6d2da5cfada03605834e38bc4075bc79 b/sql/hive/src/test/resources/golden/timestamp cast #8-0-6d2da5cfada03605834e38bc4075bc79 deleted file mode 100644 index 1d94c8a014fb4..0000000000000 --- a/sql/hive/src/test/resources/golden/timestamp cast #8-0-6d2da5cfada03605834e38bc4075bc79 +++ /dev/null @@ -1 +0,0 @@ --1.2 diff --git a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/add_partition_no_includelist.q b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/add_partition_no_includelist.q new file mode 100644 index 0000000000000..17677122a1bca --- /dev/null +++ b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/add_partition_no_includelist.q @@ -0,0 +1,7 @@ +SET hive.metastore.partition.name.whitelist.pattern=; +-- Test with no partition name include-list pattern + +CREATE TABLE part_noincludelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING); +SHOW PARTITIONS part_noincludelist_test; + +ALTER TABLE part_noincludelist_test ADD PARTITION (ds='1,2,3,4'); diff --git a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/add_partition_no_whitelist.q b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/add_partition_no_whitelist.q deleted file mode 100644 index f51c53c2ff627..0000000000000 --- a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/add_partition_no_whitelist.q +++ /dev/null @@ -1,7 +0,0 @@ -SET hive.metastore.partition.name.whitelist.pattern=; --- Test with no partition name whitelist pattern - -CREATE TABLE part_nowhitelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING); -SHOW PARTITIONS part_nowhitelist_test; - -ALTER TABLE part_nowhitelist_test ADD PARTITION (ds='1,2,3,4'); diff --git a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/add_partition_with_includelist.q b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/add_partition_with_includelist.q new file mode 100644 index 0000000000000..7e7f30dc37305 --- /dev/null +++ b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/add_partition_with_includelist.q @@ -0,0 +1,7 @@ +SET hive.metastore.partition.name.whitelist.pattern=[A-Za-z]*; +-- This pattern matches only letters. + +CREATE TABLE part_includelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING); +SHOW PARTITIONS part_includelist_test; + +ALTER TABLE part_includelist_test ADD PARTITION (ds='Part'); diff --git a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/add_partition_with_whitelist.q b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/add_partition_with_whitelist.q deleted file mode 100644 index 009c7610ef917..0000000000000 --- a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/add_partition_with_whitelist.q +++ /dev/null @@ -1,9 +0,0 @@ -SET hive.metastore.partition.name.whitelist.pattern=[A-Za-z]*; --- This pattern matches only letters. - -CREATE TABLE part_whitelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING); -SHOW PARTITIONS part_whitelist_test; - -ALTER TABLE part_whitelist_test ADD PARTITION (ds='Part'); - - diff --git a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/alter_partition_with_includelist.q b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/alter_partition_with_includelist.q new file mode 100644 index 0000000000000..fcef12cbaac4e --- /dev/null +++ b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/alter_partition_with_includelist.q @@ -0,0 +1,9 @@ +SET hive.metastore.partition.name.whitelist.pattern=[A-Za-z]*; +-- This pattern matches only letters. + +CREATE TABLE part_includelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING); +SHOW PARTITIONS part_includelist_test; + +ALTER TABLE part_includelist_test ADD PARTITION (ds='Part'); + +ALTER TABLE part_includelist_test PARTITION (ds='Part') rename to partition (ds='Apart'); diff --git a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/alter_partition_with_whitelist.q b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/alter_partition_with_whitelist.q deleted file mode 100644 index 301362a881456..0000000000000 --- a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/alter_partition_with_whitelist.q +++ /dev/null @@ -1,9 +0,0 @@ -SET hive.metastore.partition.name.whitelist.pattern=[A-Za-z]*; --- This pattern matches only letters. - -CREATE TABLE part_whitelist_test (key STRING, value STRING) PARTITIONED BY (ds STRING); -SHOW PARTITIONS part_whitelist_test; - -ALTER TABLE part_whitelist_test ADD PARTITION (ds='Part'); - -ALTER TABLE part_whitelist_test PARTITION (ds='Part') rename to partition (ds='Apart'); diff --git a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/auto_sortmerge_join_13.q b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/auto_sortmerge_join_13.q index 28bbc2d8f1a3e..df5334c785f6a 100644 --- a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/auto_sortmerge_join_13.q +++ b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/auto_sortmerge_join_13.q @@ -19,7 +19,7 @@ set hive.optimize.bucketmapjoin = true; set hive.optimize.bucketmapjoin.sortedmerge = true; set hive.auto.convert.join=true; --- A SMB join followed by a mutli-insert +-- A SMB join followed by a multi-insert explain from ( SELECT a.key key1, a.value value1, b.key key2, b.value value2 @@ -41,7 +41,7 @@ select * from dest2 order by k1, k2; set hive.auto.convert.join.noconditionaltask=true; set hive.auto.convert.join.noconditionaltask.size=200; --- A SMB join followed by a mutli-insert +-- A SMB join followed by a multi-insert explain from ( SELECT a.key key1, a.value value1, b.key key2, b.value value2 @@ -61,7 +61,7 @@ select * from dest1 order by k1, k2; select * from dest2 order by k1, k2; set hive.auto.convert.sortmerge.join.to.mapjoin=true; --- A SMB join followed by a mutli-insert +-- A SMB join followed by a multi-insert explain from ( SELECT a.key key1, a.value value1, b.key key2, b.value value2 diff --git a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/bucketsortoptimize_insert_3.q b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/bucketsortoptimize_insert_3.q index 91e97de62c82f..843ba4a3dbacd 100644 --- a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/bucketsortoptimize_insert_3.q +++ b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/bucketsortoptimize_insert_3.q @@ -18,7 +18,7 @@ FROM src INSERT OVERWRITE TABLE test_table1 PARTITION (ds = '1') SELECT *; -- Insert data into the bucketed table by selecting from another bucketed table --- The bucketing positions dont match - although the actual bucketing do. +-- The bucketing positions don't match - although the actual bucketing do. -- This should be a map-only operation EXPLAIN INSERT OVERWRITE TABLE test_table2 PARTITION (ds = '1') @@ -37,7 +37,7 @@ CREATE TABLE test_table3 (key INT, value STRING) PARTITIONED BY (ds STRING) CLUSTERED BY (value) SORTED BY (value) INTO 2 BUCKETS; -- Insert data into the bucketed table by selecting from another bucketed table --- The bucketing positions dont match - this should be a map-reduce operation +-- The bucketing positions don't match - this should be a map-reduce operation EXPLAIN INSERT OVERWRITE TABLE test_table2 PARTITION (ds = '1') SELECT x.key, x.value from diff --git a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/smb_mapjoin_20.q b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/smb_mapjoin_20.q index f70e7d5c86237..4c56cad2411fc 100644 --- a/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/smb_mapjoin_20.q +++ b/sql/hive/src/test/resources/ql/src/test/queries/clientpositive/smb_mapjoin_20.q @@ -32,7 +32,7 @@ CREATE TABLE test_table3 (key STRING, value1 int, value2 string) PARTITIONED BY CLUSTERED BY (value1) SORTED BY (value1) INTO 2 BUCKETS; -- Insert data into the bucketed table by selecting from another bucketed table --- This should be a map-only operation, although the bucketing positions dont match +-- This should be a map-only operation, although the bucketing positions don't match EXPLAIN INSERT OVERWRITE TABLE test_table3 PARTITION (ds = '1') SELECT a.value, a.key, a.value FROM test_table1 a WHERE a.ds = '1'; diff --git a/sql/hive/src/test/resources/regression-test-SPARK-8489/test-2.13.jar b/sql/hive/src/test/resources/regression-test-SPARK-8489/test-2.13.jar new file mode 100644 index 0000000000000..0d10f7ff03b35 Binary files /dev/null and b/sql/hive/src/test/resources/regression-test-SPARK-8489/test-2.13.jar differ diff --git a/sql/hive/src/test/resources/schemaWithOneField.avsc b/sql/hive/src/test/resources/schemaWithOneField.avsc new file mode 100644 index 0000000000000..e6e2431707f6e --- /dev/null +++ b/sql/hive/src/test/resources/schemaWithOneField.avsc @@ -0,0 +1,12 @@ +{ + "namespace": "test", + "name": "some_schema", + "type": "record", + "fields": [ + { + "name": "col2", + "type": "string" + } + ] +} + diff --git a/sql/hive/src/test/resources/schemaWithTwoFields.avsc b/sql/hive/src/test/resources/schemaWithTwoFields.avsc new file mode 100644 index 0000000000000..3d1d24cfa2e96 --- /dev/null +++ b/sql/hive/src/test/resources/schemaWithTwoFields.avsc @@ -0,0 +1,16 @@ +{ + "namespace": "test", + "name": "some_schema", + "type": "record", + "fields": [ + { + "name": "col1", + "type": "string", + "default": "col1_default" + }, + { + "name": "col2", + "type": "string" + } + ] +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/HiveCharVarcharTestSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/HiveCharVarcharTestSuite.scala new file mode 100644 index 0000000000000..bb7918c881c7e --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/HiveCharVarcharTestSuite.scala @@ -0,0 +1,76 @@ +/* + * 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. + */ + +package org.apache.spark.sql + +import org.apache.spark.sql.execution.command.CharVarcharDDLTestBase +import org.apache.spark.sql.hive.test.TestHiveSingleton + +class HiveCharVarcharTestSuite extends CharVarcharTestSuite with TestHiveSingleton { + + // The default Hive serde doesn't support nested null values. + override def format: String = "hive OPTIONS(fileFormat='parquet')" + + private var originalPartitionMode = "" + + override protected def beforeAll(): Unit = { + super.beforeAll() + originalPartitionMode = spark.conf.get("hive.exec.dynamic.partition.mode", "") + spark.conf.set("hive.exec.dynamic.partition.mode", "nonstrict") + } + + override protected def afterAll(): Unit = { + if (originalPartitionMode == "") { + spark.conf.unset("hive.exec.dynamic.partition.mode") + } else { + spark.conf.set("hive.exec.dynamic.partition.mode", originalPartitionMode) + } + super.afterAll() + } + + test("SPARK-33892: SHOW CREATE TABLE AS SERDE w/ char/varchar") { + withTable("t") { + sql(s"CREATE TABLE t(v VARCHAR(3), c CHAR(5)) USING $format") + val rest = sql("SHOW CREATE TABLE t AS SERDE").head().getString(0) + assert(rest.contains("VARCHAR(3)")) + assert(rest.contains("CHAR(5)")) + } + } +} + +class HiveCharVarcharDDLTestSuite extends CharVarcharDDLTestBase with TestHiveSingleton { + + // The default Hive serde doesn't support nested null values. + override def format: String = "hive OPTIONS(fileFormat='parquet')" + + private var originalPartitionMode = "" + + override protected def beforeAll(): Unit = { + super.beforeAll() + originalPartitionMode = spark.conf.get("hive.exec.dynamic.partition.mode", "") + spark.conf.set("hive.exec.dynamic.partition.mode", "nonstrict") + } + + override protected def afterAll(): Unit = { + if (originalPartitionMode == "") { + spark.conf.unset("hive.exec.dynamic.partition.mode") + } else { + spark.conf.set("hive.exec.dynamic.partition.mode", originalPartitionMode) + } + super.afterAll() + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/execution/benchmark/InsertIntoHiveTableBenchmark.scala b/sql/hive/src/test/scala/org/apache/spark/sql/execution/benchmark/InsertIntoHiveTableBenchmark.scala new file mode 100644 index 0000000000000..1df91a1174ba4 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/execution/benchmark/InsertIntoHiveTableBenchmark.scala @@ -0,0 +1,136 @@ +/* + * 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. + */ + +package org.apache.spark.sql.execution.benchmark + +import org.apache.spark.benchmark.Benchmark +import org.apache.spark.sql.SparkSession +import org.apache.spark.sql.hive.test.TestHive + +/** + * Benchmark to measure hive table write performance. + * To run this benchmark: + * {{{ + * 1. without sbt: bin/spark-submit --class + * --jars ,, + * + * 2. build/sbt "hive/test:runMain " + * 3. generate result: + * SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "hive/test:runMain " + * Results will be written to "benchmarks/InsertIntoHiveTableBenchmark-hive2.3-results.txt". + * }}} + */ +object InsertIntoHiveTableBenchmark extends SqlBasedBenchmark { + + override def getSparkSession: SparkSession = TestHive.sparkSession + + val tempView = "temp" + val numRows = 1024 * 10 + val sql = spark.sql _ + + // scalastyle:off hadoopconfiguration + private val hadoopConf = spark.sparkContext.hadoopConfiguration + // scalastyle:on hadoopconfiguration + hadoopConf.set("hive.exec.dynamic.partition", "true") + hadoopConf.set("hive.exec.dynamic.partition.mode", "nonstrict") + hadoopConf.set("hive.exec.max.dynamic.partitions", numRows.toString) + + def withTable(tableNames: String*)(f: => Unit): Unit = { + tableNames.foreach { name => + sql(s"CREATE TABLE $name(a INT) STORED AS TEXTFILE PARTITIONED BY (b INT, c INT)") + } + try f finally { + tableNames.foreach { name => + spark.sql(s"DROP TABLE IF EXISTS $name") + } + } + } + + def insertOverwriteDynamic(table: String, benchmark: Benchmark): Unit = { + benchmark.addCase("INSERT OVERWRITE DYNAMIC") { _ => + sql(s"INSERT OVERWRITE TABLE $table SELECT CAST(id AS INT) AS a," + + s" CAST(id % 10 AS INT) AS b, CAST(id % 100 AS INT) AS c FROM $tempView") + } + } + + def insertOverwriteHybrid(table: String, benchmark: Benchmark): Unit = { + benchmark.addCase("INSERT OVERWRITE HYBRID") { _ => + sql(s"INSERT OVERWRITE TABLE $table partition(b=1, c) SELECT CAST(id AS INT) AS a," + + s" CAST(id % 10 AS INT) AS c FROM $tempView") + } + } + + def insertOverwriteStatic(table: String, benchmark: Benchmark): Unit = { + benchmark.addCase("INSERT OVERWRITE STATIC") { _ => + sql(s"INSERT OVERWRITE TABLE $table partition(b=1, c=10) SELECT CAST(id AS INT) AS a" + + s" FROM $tempView") + } + } + + def insertIntoDynamic(table: String, benchmark: Benchmark): Unit = { + benchmark.addCase("INSERT INTO DYNAMIC") { _ => + sql(s"INSERT INTO TABLE $table SELECT CAST(id AS INT) AS a," + + s" CAST(id % 10 AS INT) AS b, CAST(id % 100 AS INT) AS c FROM $tempView") + } + } + + def insertIntoHybrid(table: String, benchmark: Benchmark): Unit = { + benchmark.addCase("INSERT INTO HYBRID") { _ => + sql(s"INSERT INTO TABLE $table partition(b=1, c) SELECT CAST(id AS INT) AS a," + + s" CAST(id % 10 AS INT) AS c FROM $tempView") + } + } + + def insertIntoStatic(table: String, benchmark: Benchmark): Unit = { + benchmark.addCase("INSERT INTO STATIC") { _ => + sql(s"INSERT INTO TABLE $table partition(b=1, c=10) SELECT CAST(id AS INT) AS a" + + s" FROM $tempView") + } + } + + override def runBenchmarkSuite(mainArgs: Array[String]): Unit = { + spark.range(numRows).createOrReplaceTempView(tempView) + + try { + val t1 = "t1" + val t2 = "t2" + val t3 = "t3" + val t4 = "t4" + val t5 = "t5" + val t6 = "t6" + + val benchmark = new Benchmark(s"insert hive table benchmark", numRows, output = output) + + withTable(t1, t2, t3, t4, t5, t6) { + + insertIntoDynamic(t1, benchmark) + insertIntoHybrid(t2, benchmark) + insertIntoStatic(t3, benchmark) + + insertOverwriteDynamic(t4, benchmark) + insertOverwriteHybrid(t5, benchmark) + insertOverwriteStatic(t6, benchmark) + + benchmark.run() + } + } finally { + spark.catalog.dropTempView(tempView) + } + } + + override def suffix: String = "-hive2.3" +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/execution/benchmark/ObjectHashAggregateExecBenchmark.scala b/sql/hive/src/test/scala/org/apache/spark/sql/execution/benchmark/ObjectHashAggregateExecBenchmark.scala index 3f806ad24ca10..46a60efc5b569 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/execution/benchmark/ObjectHashAggregateExecBenchmark.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/execution/benchmark/ObjectHashAggregateExecBenchmark.scala @@ -35,8 +35,7 @@ import org.apache.spark.sql.types.LongType * To run this benchmark: * {{{ * 1. without sbt: bin/spark-submit --class - * --jars ,, - * --packages org.spark-project.hive:hive-exec:1.2.1.spark2 + * --jars ,, * * 2. build/sbt "hive/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "hive/test:runMain " diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/CachedTableSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/CachedTableSuite.scala index fc793534641df..a8598db1003d8 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/CachedTableSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/CachedTableSuite.scala @@ -19,7 +19,7 @@ package org.apache.spark.sql.hive import java.io.File -import org.apache.spark.sql.{AnalysisException, Dataset, QueryTest, SaveMode} +import org.apache.spark.sql.{AnalysisException, Dataset, QueryTest, Row, SaveMode} import org.apache.spark.sql.catalyst.parser.ParseException import org.apache.spark.sql.execution.columnar.InMemoryTableScanExec import org.apache.spark.sql.execution.datasources.{CatalogFileIndex, HadoopFsRelation, LogicalRelation} @@ -113,7 +113,7 @@ class CachedTableSuite extends QueryTest with SQLTestUtils with TestHiveSingleto e = intercept[AnalysisException] { sql("UNCACHE TABLE nonexistentTable") }.getMessage - assert(e.contains(s"$expectedErrorMsg default.nonexistentTable")) + assert(e.contains("Table or view not found: nonexistentTable")) sql("UNCACHE TABLE IF EXISTS nonexistentTable") } @@ -364,14 +364,14 @@ class CachedTableSuite extends QueryTest with SQLTestUtils with TestHiveSingleto // Cache the table 'cachedTable' in temp db with qualified table name, // and then check whether the table is cached with expected name sql(s"CACHE TABLE $db.cachedTable OPTIONS('storageLevel' 'MEMORY_ONLY')") - assertCached(sql(s"SELECT * FROM $db.cachedTable"), s"`$db`.`cachedTable`", MEMORY_ONLY) + assertCached(sql(s"SELECT * FROM $db.cachedTable"), s"$db.cachedTable", MEMORY_ONLY) assert(spark.catalog.isCached(s"$db.cachedTable"), s"Table '$db.cachedTable' should be cached.") // Refresh the table 'cachedTable' in temp db with qualified table name, and then check // whether the table is still cached with the same name and storage level. sql(s"REFRESH TABLE $db.cachedTable") - assertCached(sql(s"select * from $db.cachedTable"), s"`$db`.`cachedTable`", MEMORY_ONLY) + assertCached(sql(s"select * from $db.cachedTable"), s"$db.cachedTable", MEMORY_ONLY) assert(spark.catalog.isCached(s"$db.cachedTable"), s"Table '$db.cachedTable' should be cached after refreshing with its qualified name.") @@ -382,7 +382,7 @@ class CachedTableSuite extends QueryTest with SQLTestUtils with TestHiveSingleto // 'cachedTable', instead of '$db.cachedTable' activateDatabase(db) { sql("REFRESH TABLE cachedTable") - assertCached(sql("SELECT * FROM cachedTable"), s"`$db`.`cachedTable`", MEMORY_ONLY) + assertCached(sql("SELECT * FROM cachedTable"), s"$db.cachedTable", MEMORY_ONLY) assert(spark.catalog.isCached("cachedTable"), s"Table '$db.cachedTable' should be cached after refreshing with its " + "unqualified name.") @@ -403,13 +403,13 @@ class CachedTableSuite extends QueryTest with SQLTestUtils with TestHiveSingleto // Cache the table 'cachedTable' in default db without qualified table name , and then // check whether the table is cached with expected name. sql("CACHE TABLE cachedTable OPTIONS('storageLevel' 'DISK_ONLY')") - assertCached(sql("SELECT * FROM cachedTable"), "`default`.`cachedTable`", DISK_ONLY) + assertCached(sql("SELECT * FROM cachedTable"), "cachedTable", DISK_ONLY) assert(spark.catalog.isCached("cachedTable"), "Table 'cachedTable' should be cached.") // Refresh the table 'cachedTable' in default db with unqualified table name, and then // check whether the table is still cached with the same name. sql("REFRESH TABLE cachedTable") - assertCached(sql("SELECT * FROM cachedTable"), "`default`.`cachedTable`", DISK_ONLY) + assertCached(sql("SELECT * FROM cachedTable"), "cachedTable", DISK_ONLY) assert(spark.catalog.isCached("cachedTable"), "Table 'cachedTable' should be cached after refreshing with its unqualified name.") @@ -421,7 +421,7 @@ class CachedTableSuite extends QueryTest with SQLTestUtils with TestHiveSingleto activateDatabase(db) { sql("REFRESH TABLE default.cachedTable") assertCached( - sql("SELECT * FROM default.cachedTable"), "`default`.`cachedTable`", DISK_ONLY) + sql("SELECT * FROM default.cachedTable"), "cachedTable", DISK_ONLY) assert(spark.catalog.isCached("default.cachedTable"), "Table 'cachedTable' should be cached after refreshing with its qualified name.") } @@ -429,4 +429,99 @@ class CachedTableSuite extends QueryTest with SQLTestUtils with TestHiveSingleto } } } + + test("SPARK-33963: do not use table stats while looking in table cache") { + val t = "table_on_test" + withTable(t) { + sql(s"CREATE TABLE $t (col int)") + assert(!spark.catalog.isCached(t)) + sql(s"CACHE TABLE $t") + assert(spark.catalog.isCached(t)) + } + } + + test("SPARK-33965: cache table in spark_catalog") { + withNamespace("spark_catalog.ns") { + sql("CREATE NAMESPACE spark_catalog.ns") + val t = "spark_catalog.ns.tbl" + withTable(t) { + sql(s"CREATE TABLE $t (col int)") + assert(!spark.catalog.isCached(t)) + sql(s"CACHE TABLE $t") + assert(spark.catalog.isCached(t)) + } + } + } + + test("SPARK-34076: should be able to drop temp view with cached tables") { + val t = "cachedTable" + val v = "tempView" + withTable(t) { + withTempView(v) { + sql(s"CREATE TEMPORARY VIEW $v AS SELECT key FROM src LIMIT 10") + sql(s"CREATE TABLE $t AS SELECT * FROM src") + sql(s"CACHE TABLE $t") + } + } + } + + test("SPARK-34076: should be able to drop global temp view with cached tables") { + val t = "cachedTable" + val v = "globalTempView" + withTable(t) { + withGlobalTempView(v) { + sql(s"CREATE GLOBAL TEMPORARY VIEW $v AS SELECT key FROM src LIMIT 10") + sql(s"CREATE TABLE $t AS SELECT * FROM src") + sql(s"CACHE TABLE $t") + } + } + } + + private def getPartitionLocation(t: String, partition: String): String = { + val information = sql(s"SHOW TABLE EXTENDED LIKE '$t' PARTITION ($partition)") + .select("information") + .first().getString(0) + information + .split("\\r?\\n") + .filter(_.startsWith("Location:")) + .head + .replace("Location: file:", "") + } + + test("SPARK-34213: LOAD DATA refreshes cached table") { + withTable("src_tbl") { + withTable("dst_tbl") { + sql("CREATE TABLE src_tbl (c0 int, part int) USING hive PARTITIONED BY (part)") + sql("INSERT INTO src_tbl PARTITION (part=0) SELECT 0") + sql("CREATE TABLE dst_tbl (c0 int, part int) USING hive PARTITIONED BY (part)") + sql("INSERT INTO dst_tbl PARTITION (part=1) SELECT 1") + sql("CACHE TABLE dst_tbl") + assert(spark.catalog.isCached("dst_tbl")) + checkAnswer(sql("SELECT * FROM dst_tbl"), Row(1, 1)) + val location = getPartitionLocation("src_tbl", "part=0") + sql(s"LOAD DATA LOCAL INPATH '$location' INTO TABLE dst_tbl PARTITION (part=0)") + assert(spark.catalog.isCached("dst_tbl")) + checkAnswer(sql("SELECT * FROM dst_tbl"), Seq(Row(0, 0), Row(1, 1))) + } + } + } + + test("SPARK-34262: ALTER TABLE .. SET LOCATION refreshes cached table") { + withTable("src_tbl") { + withTable("dst_tbl") { + sql("CREATE TABLE src_tbl (c0 int, part int) USING hive PARTITIONED BY (part)") + sql("INSERT INTO src_tbl PARTITION (part=0) SELECT 0") + sql("CREATE TABLE dst_tbl (c0 int, part int) USING hive PARTITIONED BY (part)") + sql("ALTER TABLE dst_tbl ADD PARTITION (part=0)") + sql("INSERT INTO dst_tbl PARTITION (part=1) SELECT 1") + sql("CACHE TABLE dst_tbl") + assert(spark.catalog.isCached("dst_tbl")) + checkAnswer(sql("SELECT * FROM dst_tbl"), Row(1, 1)) + val location = getPartitionLocation("src_tbl", "part=0") + sql(s"ALTER TABLE dst_tbl PARTITION (part=0) SET LOCATION '$location'") + assert(spark.catalog.isCached("dst_tbl")) + checkAnswer(sql("SELECT * FROM dst_tbl"), Seq(Row(0, 0), Row(1, 1))) + } + } + } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/ClasspathDependenciesSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/ClasspathDependenciesSuite.scala index a696d6aaff27b..c136c4c9790fd 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/ClasspathDependenciesSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/ClasspathDependenciesSuite.scala @@ -57,20 +57,12 @@ class ClasspathDependenciesSuite extends SparkFunSuite { } } - test("shaded Protobuf") { - if (HiveUtils.isHive23) { - assertLoads("com.google.protobuf.ServiceException") - } else { - assertLoads("org.apache.hive.com.google.protobuf.ServiceException") - } + test("protobuf") { + assertLoads("com.google.protobuf.ServiceException") } - test("shaded Kryo") { - if (HiveUtils.isHive23) { - assertLoads("com.esotericsoftware.kryo.Kryo") - } else { - assertLoads("org.apache.hive.com.esotericsoftware.kryo.Kryo") - } + test("kryo") { + assertLoads("com.esotericsoftware.kryo.Kryo") } test("hive-common") { @@ -89,12 +81,7 @@ class ClasspathDependenciesSuite extends SparkFunSuite { } test("parquet-hadoop-bundle") { - if (HiveUtils.isHive23) { - assertLoads("org.apache.parquet.hadoop.ParquetOutputFormat") - assertLoads("org.apache.parquet.hadoop.ParquetInputFormat") - } else { - assertLoads("parquet.hadoop.ParquetOutputFormat") - assertLoads("parquet.hadoop.ParquetInputFormat") - } + assertLoads("org.apache.parquet.hadoop.ParquetOutputFormat") + assertLoads("org.apache.parquet.hadoop.ParquetInputFormat") } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogSuite.scala index 473a93bf129df..e413e0ee73cb9 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogSuite.scala @@ -17,8 +17,6 @@ package org.apache.spark.sql.hive -import java.net.URI - import org.apache.hadoop.conf.Configuration import org.apache.spark.SparkConf @@ -181,41 +179,25 @@ class HiveExternalCatalogSuite extends ExternalCatalogSuite { "INSERT overwrite directory \"fs://localhost/tmp\" select 1 as a")) } - test("SPARK-31061: alterTable should be able to change table provider") { + test("SPARK-31061: alterTable should be able to change table provider/hive") { val catalog = newBasicCatalog() - val parquetTable = CatalogTable( - identifier = TableIdentifier("parq_tbl", Some("db1")), - tableType = CatalogTableType.MANAGED, - storage = storageFormat.copy(locationUri = Some(new URI("file:/some/path"))), - schema = new StructType().add("col1", "int").add("col2", "string"), - provider = Some("parquet")) - catalog.createTable(parquetTable, ignoreIfExists = false) - - val rawTable = externalCatalog.getTable("db1", "parq_tbl") - assert(rawTable.provider === Some("parquet")) - - val fooTable = parquetTable.copy(provider = Some("foo")) - catalog.alterTable(fooTable) - val alteredTable = externalCatalog.getTable("db1", "parq_tbl") - assert(alteredTable.provider === Some("foo")) - } - - test("SPARK-31061: alterTable should be able to change table provider from hive") { - val catalog = newBasicCatalog() - val hiveTable = CatalogTable( - identifier = TableIdentifier("parq_tbl", Some("db1")), - tableType = CatalogTableType.MANAGED, - storage = storageFormat, - schema = new StructType().add("col1", "int").add("col2", "string"), - provider = Some("hive")) - catalog.createTable(hiveTable, ignoreIfExists = false) - - val rawTable = externalCatalog.getTable("db1", "parq_tbl") - assert(rawTable.provider === Some("hive")) - - val fooTable = rawTable.copy(provider = Some("foo")) - catalog.alterTable(fooTable) - val alteredTable = externalCatalog.getTable("db1", "parq_tbl") - assert(alteredTable.provider === Some("foo")) + Seq("parquet", "hive").foreach( provider => { + val tableDDL = CatalogTable( + identifier = TableIdentifier("parq_tbl", Some("db1")), + tableType = CatalogTableType.MANAGED, + storage = storageFormat, + schema = new StructType().add("col1", "int"), + provider = Some(provider)) + catalog.dropTable("db1", "parq_tbl", true, true) + catalog.createTable(tableDDL, ignoreIfExists = false) + + val rawTable = externalCatalog.getTable("db1", "parq_tbl") + assert(rawTable.provider === Some(provider)) + + val fooTable = rawTable.copy(provider = Some("foo")) + catalog.alterTable(fooTable) + val alteredTable = externalCatalog.getTable("db1", "parq_tbl") + assert(alteredTable.provider === Some("foo")) + }) } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogVersionsSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogVersionsSuite.scala index 8be3d26bfc93a..60cca97ef384e 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogVersionsSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveExternalCatalogVersionsSuite.scala @@ -27,7 +27,7 @@ import scala.util.control.NonFatal import org.apache.commons.lang3.{JavaVersion, SystemUtils} import org.apache.hadoop.conf.Configuration -import org.apache.spark.{SecurityManager, SparkConf, TestUtils} +import org.apache.spark.{SparkConf, TestUtils} import org.apache.spark.internal.config.MASTER_REST_SERVER_ENABLED import org.apache.spark.internal.config.UI.UI_ENABLED import org.apache.spark.sql.{QueryTest, Row, SparkSession} @@ -35,32 +35,44 @@ import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.catalog.CatalogTableType import org.apache.spark.sql.internal.StaticSQLConf.WAREHOUSE_PATH import org.apache.spark.sql.test.SQLTestUtils -import org.apache.spark.tags.ExtendedHiveTest +import org.apache.spark.tags.{ExtendedHiveTest, SlowHiveTest} import org.apache.spark.util.Utils /** * Test HiveExternalCatalog backward compatibility. * * Note that, this test suite will automatically download spark binary packages of different - * versions to a local directory `/tmp/spark-test`. If there is already a spark folder with - * expected version under this local directory, e.g. `/tmp/spark-test/spark-2.0.3`, we will skip the - * downloading for this spark version. + * versions to a local directory. If the `spark.test.cache-dir` system property is defined, this + * directory will be used. If there is already a spark folder with expected version under this + * local directory, e.g. `/{cache-dir}/spark-2.0.3`, downloading for this spark version will be + * skipped. If the system property is not present, a temporary directory will be used and cleaned + * up after the test. */ +@SlowHiveTest @ExtendedHiveTest class HiveExternalCatalogVersionsSuite extends SparkSubmitTestUtils { - private val isTestAtLeastJava9 = SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9) + import HiveExternalCatalogVersionsSuite._ private val wareHousePath = Utils.createTempDir(namePrefix = "warehouse") private val tmpDataDir = Utils.createTempDir(namePrefix = "test-data") - // For local test, you can set `sparkTestingDir` to a static value like `/tmp/test-spark`, to + // For local test, you can set `spark.test.cache-dir` to a static value like `/tmp/test-spark`, to // avoid downloading Spark of different versions in each run. - private val sparkTestingDir = new File("/tmp/test-spark") + private val sparkTestingDir = Option(System.getProperty(SPARK_TEST_CACHE_DIR_SYSTEM_PROPERTY)) + .map(new File(_)).getOrElse(Utils.createTempDir(namePrefix = "test-spark")) private val unusedJar = TestUtils.createJarWithClasses(Seq.empty) + val hiveVersion = if (SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)) { + HiveUtils.builtinHiveVersion + } else { + "1.2.1" + } override def afterAll(): Unit = { try { Utils.deleteRecursively(wareHousePath) Utils.deleteRecursively(tmpDataDir) - Utils.deleteRecursively(sparkTestingDir) + // Only delete sparkTestingDir if it wasn't defined to a static location by the system prop + if (Option(System.getProperty(SPARK_TEST_CACHE_DIR_SYSTEM_PROPERTY)).isEmpty) { + Utils.deleteRecursively(sparkTestingDir) + } } finally { super.afterAll() } @@ -81,7 +93,11 @@ class HiveExternalCatalogVersionsSuite extends SparkSubmitTestUtils { mirrors.distinct :+ "https://archive.apache.org/dist" :+ PROCESS_TABLES.releaseMirror logInfo(s"Trying to download Spark $version from $sites") for (site <- sites) { - val filename = s"spark-$version-bin-hadoop2.7.tgz" + val filename = if (version.startsWith("3")) { + s"spark-$version-bin-hadoop3.2.tgz" + } else { + s"spark-$version-bin-hadoop2.7.tgz" + } val url = s"$site/spark/spark-$version/$filename" logInfo(s"Downloading Spark $version from $url") try { @@ -118,7 +134,6 @@ class HiveExternalCatalogVersionsSuite extends SparkSubmitTestUtils { // if the caller passes the name of an existing file, we want doFetchFile to write over it with // the contents from the specified url. conf.set("spark.files.overwrite", "true") - val securityManager = new SecurityManager(conf) val hadoopConf = new Configuration val outDir = new File(targetDir) @@ -127,7 +142,7 @@ class HiveExternalCatalogVersionsSuite extends SparkSubmitTestUtils { } // propagate exceptions up to the caller of getFileFromUrl - Utils.doFetchFile(urlString, outDir, filename, conf, securityManager, hadoopConf) + Utils.doFetchFile(urlString, outDir, filename, conf, hadoopConf) } private def getStringFromUrl(urlString: String): String = { @@ -141,7 +156,9 @@ class HiveExternalCatalogVersionsSuite extends SparkSubmitTestUtils { new String(Files.readAllBytes(contentPath), StandardCharsets.UTF_8) } - private def prepare(): Unit = { + override def beforeAll(): Unit = { + super.beforeAll() + val tempPyFile = File.createTempFile("test", ".py") // scalastyle:off line.size.limit Files.write(tempPyFile.toPath, @@ -177,7 +194,7 @@ class HiveExternalCatalogVersionsSuite extends SparkSubmitTestUtils { // scalastyle:on line.size.limit if (PROCESS_TABLES.testingVersions.isEmpty) { - fail("Fail to get the lates Spark versions to test.") + logError("Fail to get the latest Spark versions to test.") } PROCESS_TABLES.testingVersions.zipWithIndex.foreach { case (version, index) => @@ -191,7 +208,7 @@ class HiveExternalCatalogVersionsSuite extends SparkSubmitTestUtils { "--master", "local[2]", "--conf", s"${UI_ENABLED.key}=false", "--conf", s"${MASTER_REST_SERVER_ENABLED.key}=false", - "--conf", s"${HiveUtils.HIVE_METASTORE_VERSION.key}=1.2.1", + "--conf", s"${HiveUtils.HIVE_METASTORE_VERSION.key}=$hiveVersion", "--conf", s"${HiveUtils.HIVE_METASTORE_JARS.key}=maven", "--conf", s"${WAREHOUSE_PATH.key}=${wareHousePath.getCanonicalPath}", "--conf", s"spark.sql.test.version.index=$index", @@ -203,47 +220,43 @@ class HiveExternalCatalogVersionsSuite extends SparkSubmitTestUtils { tempPyFile.delete() } - override def beforeAll(): Unit = { - super.beforeAll() - if (!isTestAtLeastJava9) { - prepare() - } - } - test("backward compatibility") { - // TODO SPARK-28704 Test backward compatibility on JDK9+ once we have a version supports JDK9+ - assume(!isTestAtLeastJava9) val args = Seq( "--class", PROCESS_TABLES.getClass.getName.stripSuffix("$"), "--name", "HiveExternalCatalog backward compatibility test", "--master", "local[2]", "--conf", s"${UI_ENABLED.key}=false", "--conf", s"${MASTER_REST_SERVER_ENABLED.key}=false", - "--conf", s"${HiveUtils.HIVE_METASTORE_VERSION.key}=1.2.1", + "--conf", s"${HiveUtils.HIVE_METASTORE_VERSION.key}=$hiveVersion", "--conf", s"${HiveUtils.HIVE_METASTORE_JARS.key}=maven", "--conf", s"${WAREHOUSE_PATH.key}=${wareHousePath.getCanonicalPath}", "--driver-java-options", s"-Dderby.system.home=${wareHousePath.getCanonicalPath}", unusedJar.toString) - runSparkSubmit(args) + if (PROCESS_TABLES.testingVersions.nonEmpty) runSparkSubmit(args) } } object PROCESS_TABLES extends QueryTest with SQLTestUtils { - val releaseMirror = "https://dist.apache.org/repos/dist/release" + val releaseMirror = sys.env.getOrElse("SPARK_RELEASE_MIRROR", + "https://dist.apache.org/repos/dist/release") // Tests the latest version of every release line. val testingVersions: Seq[String] = { import scala.io.Source - try { - Source.fromURL(s"${releaseMirror}/spark").mkString + val versions: Seq[String] = try Utils.tryWithResource( + Source.fromURL(s"$releaseMirror/spark")) { source => + source.mkString .split("\n") - .filter(_.contains("""
  • """.r.findFirstMatchIn(_).get.group(1)) .filter(_ < org.apache.spark.SPARK_VERSION) } catch { - // do not throw exception during object initialization. - case NonFatal(_) => Seq("2.3.4", "2.4.5") // A temporary fallback to use a specific version + // Do not throw exception during object initialization. + case NonFatal(_) => Nil } + versions + .filter(v => v.startsWith("3") || !TestUtils.isPythonVersionAtLeast38()) + .filter(v => v.startsWith("3") || !SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)) } protected var spark: SparkSession = _ @@ -305,3 +318,8 @@ object PROCESS_TABLES extends QueryTest with SQLTestUtils { } } } + +object HiveExternalCatalogVersionsSuite { + private val SPARK_TEST_CACHE_DIR_SYSTEM_PROPERTY = "spark.test.cache-dir" +} + diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetadataCacheSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetadataCacheSuite.scala index 743cdbd6457d7..db8ebcd45f3eb 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetadataCacheSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetadataCacheSuite.scala @@ -21,7 +21,6 @@ import org.apache.hadoop.fs.Path import org.apache.spark.SparkException import org.apache.spark.sql.QueryTest -import org.apache.spark.sql.execution.adaptive.AdaptiveTestUtils.assertExceptionMessage import org.apache.spark.sql.hive.test.TestHiveSingleton import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SQLTestUtils @@ -100,7 +99,7 @@ class HiveMetadataCacheSuite extends QueryTest with SQLTestUtils with TestHiveSi val e = intercept[SparkException] { sql("select * from test").count() } - assertExceptionMessage(e, "FileNotFoundException") + assert(e.getMessage.contains("FileNotFoundException")) // Test refreshing the cache. spark.catalog.refreshTable("test") @@ -115,7 +114,7 @@ class HiveMetadataCacheSuite extends QueryTest with SQLTestUtils with TestHiveSi val e2 = intercept[SparkException] { sql("select * from test").count() } - assertExceptionMessage(e2, "FileNotFoundException") + assert(e.getMessage.contains("FileNotFoundException")) spark.catalog.refreshByPath(dir.getAbsolutePath) assert(sql("select * from test").count() == 3) } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreCatalogSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreCatalogSuite.scala index 95e99c653d6f6..1a6f6843d3911 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreCatalogSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveMetastoreCatalogSuite.scala @@ -113,24 +113,19 @@ class HiveMetastoreCatalogSuite extends TestHiveSingleton with SQLTestUtils { .add("c9", "date") .add("c10", "timestamp") .add("c11", "string") - .add("c12", "string", true, - new MetadataBuilder().putString(HIVE_TYPE_STRING, "char(10)").build()) - .add("c13", "string", true, - new MetadataBuilder().putString(HIVE_TYPE_STRING, "varchar(10)").build()) + .add("c12", CharType(10), true) + .add("c13", VarcharType(10), true) .add("c14", "binary") .add("c15", "decimal") .add("c16", "decimal(10)") .add("c17", "decimal(10,2)") .add("c18", "array") .add("c19", "array") - .add("c20", "array", true, - new MetadataBuilder().putString(HIVE_TYPE_STRING, "array").build()) + .add("c20", ArrayType(CharType(10)), true) .add("c21", "map") - .add("c22", "map", true, - new MetadataBuilder().putString(HIVE_TYPE_STRING, "map").build()) + .add("c22", MapType(IntegerType, CharType(10)), true) .add("c23", "struct") - .add("c24", "struct", true, - new MetadataBuilder().putString(HIVE_TYPE_STRING, "struct").build()) + .add("c24", new StructType().add("c", VarcharType(10)).add("d", "int"), true) assert(schema == expectedSchema) } } @@ -206,13 +201,8 @@ class DataSourceWithHiveMetastoreCatalogSuite assert(columns.map(_.dataType) === Seq(DecimalType(10, 3), StringType)) checkAnswer(table("t"), testDF) - if (HiveUtils.isHive23) { - assert(sparkSession.metadataHive.runSqlHive("SELECT * FROM t") === - Seq("1.100\t1", "2.100\t2")) - } else { - assert(sparkSession.metadataHive.runSqlHive("SELECT * FROM t") === - Seq("1.1\t1", "2.1\t2")) - } + assert(sparkSession.metadataHive.runSqlHive("SELECT * FROM t") === + Seq("1.100\t1", "2.100\t2")) } } @@ -244,13 +234,8 @@ class DataSourceWithHiveMetastoreCatalogSuite assert(columns.map(_.dataType) === Seq(DecimalType(10, 3), StringType)) checkAnswer(table("t"), testDF) - if (HiveUtils.isHive23) { - assert(sparkSession.metadataHive.runSqlHive("SELECT * FROM t") === - Seq("1.100\t1", "2.100\t2")) - } else { - assert(sparkSession.metadataHive.runSqlHive("SELECT * FROM t") === - Seq("1.1\t1", "2.1\t2")) - } + assert(sparkSession.metadataHive.runSqlHive("SELECT * FROM t") === + Seq("1.100\t1", "2.100\t2")) } } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetMetastoreSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetMetastoreSuite.scala index 0bdaa0c23c537..035175430d927 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetMetastoreSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetMetastoreSuite.scala @@ -473,7 +473,7 @@ class HiveParquetMetastoreSuite extends ParquetPartitioningTest { checkCached(tableIdentifier) // For insert into non-partitioned table, we will do the conversion, // so the converted test_insert_parquet should be cached. - sessionState.refreshTable("test_insert_parquet") + spark.catalog.refreshTable("test_insert_parquet") assert(getCachedDataSourceTable(tableIdentifier) === null) sql( """ @@ -486,7 +486,7 @@ class HiveParquetMetastoreSuite extends ParquetPartitioningTest { sql("select * from test_insert_parquet"), sql("select a, b from jt").collect()) // Invalidate the cache. - sessionState.refreshTable("test_insert_parquet") + spark.catalog.refreshTable("test_insert_parquet") assert(getCachedDataSourceTable(tableIdentifier) === null) // Create a partitioned table. @@ -536,7 +536,7 @@ class HiveParquetMetastoreSuite extends ParquetPartitioningTest { |select b, '2015-04-02', a FROM jt """.stripMargin).collect()) - sessionState.refreshTable("test_parquet_partitioned_cache_test") + spark.catalog.refreshTable("test_parquet_partitioned_cache_test") assert(getCachedDataSourceTable(tableIdentifier) === null) dropTables("test_insert_parquet", "test_parquet_partitioned_cache_test") diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSourceSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSourceSuite.scala index b557fe73f1154..b3ea54a7bc931 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSourceSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSourceSuite.scala @@ -25,7 +25,6 @@ import org.apache.spark.sql.catalyst.catalog.HiveTableRelation import org.apache.spark.sql.execution.datasources.LogicalRelation import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types._ -import org.apache.spark.util.Utils /** * A suite of tests for the Parquet support through the data sources API. @@ -230,6 +229,12 @@ class HiveParquetSourceSuite extends ParquetPartitioningTest { withTempPath { path => withTable("parq_tbl1", "parq_tbl2", "parq_tbl3", "tbl1", "tbl2", "tbl3", "tbl4", "tbl5", "tbl6") { + + def checkErrorMsg(path: String): String = { + s"Path: ${path} is a directory, which is not supported by the record reader " + + s"when `mapreduce.input.fileinputformat.input.dir.recursive` is false." + } + val parquetTblStatement1 = s""" |CREATE EXTERNAL TABLE parq_tbl1( @@ -287,7 +292,7 @@ class HiveParquetSourceSuite extends ParquetPartitioningTest { val msg = intercept[IOException] { sql("SELECT * FROM tbl1").show() }.getMessage - assert(msg.contains("Not a file:")) + assert(msg.contains(checkErrorMsg(s"$path/l1"))) } val l1DirStatement = @@ -305,7 +310,7 @@ class HiveParquetSourceSuite extends ParquetPartitioningTest { val msg = intercept[IOException] { sql("SELECT * FROM tbl2").show() }.getMessage - assert(msg.contains("Not a file:")) + assert(msg.contains(checkErrorMsg(s"$path/l1/l2"))) } val l2DirStatement = @@ -323,7 +328,7 @@ class HiveParquetSourceSuite extends ParquetPartitioningTest { val msg = intercept[IOException] { sql("SELECT * FROM tbl3").show() }.getMessage - assert(msg.contains("Not a file:")) + assert(msg.contains(checkErrorMsg(s"$path/l1/l2/l3"))) } val wildcardTopDirStatement = @@ -341,7 +346,7 @@ class HiveParquetSourceSuite extends ParquetPartitioningTest { val msg = intercept[IOException] { sql("SELECT * FROM tbl4").show() }.getMessage - assert(msg.contains("Not a file:")) + assert(msg.contains(checkErrorMsg(s"$path/l1/l2"))) } val wildcardL1DirStatement = @@ -359,7 +364,7 @@ class HiveParquetSourceSuite extends ParquetPartitioningTest { val msg = intercept[IOException] { sql("SELECT * FROM tbl5").show() }.getMessage - assert(msg.contains("Not a file:")) + assert(msg.contains(checkErrorMsg(s"$path/l1/l2/l3"))) } val wildcardL2DirStatement = diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala index 470c6a342b4dd..8940ab4664562 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveParquetSuite.scala @@ -17,7 +17,7 @@ package org.apache.spark.sql.hive -import org.apache.spark.sql.{QueryTest, Row} +import org.apache.spark.sql.{AnalysisException, QueryTest, Row} import org.apache.spark.sql.execution.datasources.parquet.ParquetTest import org.apache.spark.sql.hive.test.TestHiveSingleton import org.apache.spark.sql.internal.SQLConf @@ -106,4 +106,21 @@ class HiveParquetSuite extends QueryTest with ParquetTest with TestHiveSingleton } } } + + test("SPARK-33323: Add query resolved check before convert hive relation") { + withTable("t") { + val msg = intercept[AnalysisException] { + sql( + s""" + |CREATE TABLE t STORED AS PARQUET AS + |SELECT * FROM ( + | SELECT c3 FROM ( + | SELECT c1, c2 from values(1,2) t(c1, c2) + | ) + |) + """.stripMargin) + }.getMessage + assert(msg.contains("cannot resolve 'c3' given input columns")) + } + } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSQLInsertTestSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSQLInsertTestSuite.scala new file mode 100644 index 0000000000000..0b1d511f08511 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSQLInsertTestSuite.scala @@ -0,0 +1,40 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive + +import org.apache.spark.sql.SQLInsertTestSuite +import org.apache.spark.sql.hive.test.TestHiveSingleton + +class HiveSQLInsertTestSuite extends SQLInsertTestSuite with TestHiveSingleton { + + private val originalPartitionMode = spark.conf.getOption("hive.exec.dynamic.partition.mode") + + override protected def beforeAll(): Unit = { + super.beforeAll() + spark.conf.set("hive.exec.dynamic.partition.mode", "nonstrict") + } + + override protected def afterAll(): Unit = { + originalPartitionMode + .map(v => spark.conf.set("hive.exec.dynamic.partition.mode", v)) + .getOrElse(spark.conf.unset("hive.exec.dynamic.partition.mode")) + super.afterAll() + } + + override def format: String = "hive OPTIONS(fileFormat='parquet')" +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSchemaInferenceSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSchemaInferenceSuite.scala index 590ef949ffbd7..ebf02287489a7 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSchemaInferenceSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSchemaInferenceSuite.scala @@ -118,18 +118,19 @@ class HiveSchemaInferenceSuite properties = Map.empty), true) - // Add partition records (if specified) - if (!partitionCols.isEmpty) { - spark.catalog.recoverPartitions(TEST_TABLE_NAME) - } - // Check that the table returned by HiveExternalCatalog has schemaPreservesCase set to false // and that the raw table returned by the Hive client doesn't have any Spark SQL properties // set (table needs to be obtained from client since HiveExternalCatalog filters these // properties out). assert(!externalCatalog.getTable(DATABASE, TEST_TABLE_NAME).schemaPreservesCase) val rawTable = client.getTable(DATABASE, TEST_TABLE_NAME) - assert(rawTable.properties.filterKeys(_.startsWith(DATASOURCE_SCHEMA_PREFIX)) == Map.empty) + assert(rawTable.properties.filterKeys(_.startsWith(DATASOURCE_SCHEMA_PREFIX)).isEmpty) + + // Add partition records (if specified) + if (!partitionCols.isEmpty) { + spark.catalog.recoverPartitions(TEST_TABLE_NAME) + } + schema } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSharedStateSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSharedStateSuite.scala index 78535b094b83d..e2e96bfc3a89f 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSharedStateSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSharedStateSuite.scala @@ -17,38 +17,55 @@ package org.apache.spark.sql.hive +import org.apache.hadoop.fs.Path +import org.apache.hadoop.hive.common.FileUtils import org.apache.hadoop.hive.conf.HiveConf.ConfVars import org.apache.spark.{SparkConf, SparkContext, SparkFunSuite} -import org.apache.spark.sql.internal.SharedState +import org.apache.spark.internal.config.UI +import org.apache.spark.sql.SparkSession +import org.apache.spark.sql.internal.StaticSQLConf import org.apache.spark.sql.internal.StaticSQLConf._ import org.apache.spark.util.Utils class HiveSharedStateSuite extends SparkFunSuite { + override def beforeEach(): Unit = { + SparkSession.clearActiveSession() + SparkSession.clearDefaultSession() + super.beforeEach() + } + test("initial configs should be passed to SharedState but not SparkContext") { val conf = new SparkConf().setMaster("local").setAppName("SharedState Test") val sc = SparkContext.getOrCreate(conf) + val warehousePath = Utils.createTempDir().toString val invalidPath = "invalid/path" val metastorePath = Utils.createTempDir() val tmpDb = "tmp_db" // The initial configs used to generate SharedState, none of these should affect the global - // shared SparkContext's configurations. Especially, all these configs are passed to the cloned - // confs inside SharedState except metastore warehouse dir. + // shared SparkContext's configurations, except spark.sql.warehouse.dir. + // Especially, all these configs are passed to the cloned confs inside SharedState for sharing + // cross sessions. val initialConfigs = Map("spark.foo" -> "bar", - WAREHOUSE_PATH.key -> invalidPath, - ConfVars.METASTOREWAREHOUSE.varname -> invalidPath, + WAREHOUSE_PATH.key -> warehousePath, + ConfVars.METASTOREWAREHOUSE.varname -> warehousePath, CATALOG_IMPLEMENTATION.key -> "hive", ConfVars.METASTORECONNECTURLKEY.varname -> s"jdbc:derby:;databaseName=$metastorePath/metastore_db;create=true", GLOBAL_TEMP_DATABASE.key -> tmpDb) - val state = new SharedState(sc, initialConfigs) - assert(sc.conf.get(WAREHOUSE_PATH.key) !== invalidPath, - "warehouse conf in session options can't affect application wide spark conf") - assert(sc.hadoopConfiguration.get(ConfVars.METASTOREWAREHOUSE.varname) !== invalidPath, - "warehouse conf in session options can't affect application wide hadoop conf") + val builder = SparkSession.builder() + initialConfigs.foreach { case (k, v) => builder.config(k, v) } + val ss = builder.getOrCreate() + val state = ss.sharedState + val qualifiedWHPath = + FileUtils.makeQualified(new Path(warehousePath), sc.hadoopConfiguration).toString + assert(sc.conf.get(WAREHOUSE_PATH.key) === qualifiedWHPath, + "initial warehouse conf in session options can affect application wide spark conf") + assert(sc.hadoopConfiguration.get(ConfVars.METASTOREWAREHOUSE.varname) === qualifiedWHPath, + "initial warehouse conf in session options can affect application wide hadoop conf") assert(!state.sparkContext.conf.contains("spark.foo"), "static spark conf should not be affected by session") @@ -57,9 +74,39 @@ class HiveSharedStateSuite extends SparkFunSuite { val client = state.externalCatalog.unwrapped.asInstanceOf[HiveExternalCatalog].client assert(client.getConf("spark.foo", "") === "bar", "session level conf should be passed to catalog") - assert(client.getConf(ConfVars.METASTOREWAREHOUSE.varname, invalidPath) !== invalidPath, - "session level conf should be passed to catalog except warehouse dir") + assert(client.getConf(ConfVars.METASTOREWAREHOUSE.varname, "") === qualifiedWHPath, + "session level conf should be passed to catalog") assert(state.globalTempViewManager.database === tmpDb) + + val ss2 = + builder.config("spark.foo", "bar2222").config(WAREHOUSE_PATH.key, invalidPath).getOrCreate() + + assert(!ss2.sparkContext.conf.get(WAREHOUSE_PATH.key).contains(invalidPath), + "warehouse conf in session options can't affect application wide spark conf") + assert(ss2.sparkContext.hadoopConfiguration.get(ConfVars.METASTOREWAREHOUSE.varname) !== + invalidPath, "warehouse conf in session options can't affect application wide hadoop conf") + assert(ss.conf.get("spark.foo") === "bar2222", "session level conf should be passed to catalog") + assert(!ss.conf.get(WAREHOUSE_PATH).contains(invalidPath), + "session level conf should be passed to catalog") + } + + test("SPARK-34568: When SparkContext's conf not enable hive, " + + "we should respect `enableHiveSupport()` when build SparkSession too") { + val conf = new SparkConf().setMaster("local").setAppName("SPARK-34568") + .set(UI.UI_ENABLED, false) + val sc = SparkContext.getOrCreate(conf) + val catalog = sc.conf.get(StaticSQLConf.CATALOG_IMPLEMENTATION) + try { + sc.conf.set(StaticSQLConf.CATALOG_IMPLEMENTATION, "in-memory") + val sparkSession = SparkSession.builder().enableHiveSupport().sparkContext(sc).getOrCreate() + assert( + sparkSession.sparkContext.conf.get(StaticSQLConf.CATALOG_IMPLEMENTATION) === "in-memory") + assert(sparkSession.sharedState.conf.get(StaticSQLConf.CATALOG_IMPLEMENTATION) === "hive") + assert(sparkSession.sessionState.catalog.getClass + .getCanonicalName.contains("HiveSessionCatalog")) + } finally { + sc.conf.set(StaticSQLConf.CATALOG_IMPLEMENTATION, catalog) + } } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveShimSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveShimSuite.scala index 14d07cdf8db08..89131a79e59de 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveShimSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveShimSuite.scala @@ -16,9 +16,6 @@ */ package org.apache.spark.sql.hive -import scala.collection.JavaConverters._ -import scala.language.implicitConversions - import org.apache.hadoop.conf.Configuration import org.apache.hadoop.hive.serde2.ColumnProjectionUtils @@ -35,18 +32,10 @@ class HiveShimSuite extends SparkFunSuite { // test when READ_COLUMN_NAMES_CONF_STR is empty HiveShim.appendReadColumns(conf, ids, names) - if (HiveUtils.isHive23) { - assert(names === ColumnProjectionUtils.getReadColumnNames(conf)) - } else { - assert(names.asJava === ColumnProjectionUtils.getReadColumnNames(conf)) - } + assert(names === ColumnProjectionUtils.getReadColumnNames(conf)) // test when READ_COLUMN_NAMES_CONF_STR is non-empty HiveShim.appendReadColumns(conf, moreIds, moreNames) - if (HiveUtils.isHive23) { - assert((names ++ moreNames) === ColumnProjectionUtils.getReadColumnNames(conf)) - } else { - assert((names ++ moreNames).asJava === ColumnProjectionUtils.getReadColumnNames(conf)) - } + assert((names ++ moreNames) === ColumnProjectionUtils.getReadColumnNames(conf)) } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveShowCreateTableSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveShowCreateTableSuite.scala index cfcf70c0e79f0..2fb67c793dc6a 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveShowCreateTableSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveShowCreateTableSuite.scala @@ -25,6 +25,22 @@ import org.apache.spark.sql.internal.{HiveSerDe, SQLConf} class HiveShowCreateTableSuite extends ShowCreateTableSuite with TestHiveSingleton { + private var origCreateHiveTableConfig = false + + protected override def beforeAll(): Unit = { + super.beforeAll() + origCreateHiveTableConfig = + spark.conf.get(SQLConf.LEGACY_CREATE_HIVE_TABLE_BY_DEFAULT) + spark.conf.set(SQLConf.LEGACY_CREATE_HIVE_TABLE_BY_DEFAULT.key, true) + } + + protected override def afterAll(): Unit = { + spark.conf.set( + SQLConf.LEGACY_CREATE_HIVE_TABLE_BY_DEFAULT.key, + origCreateHiveTableConfig) + super.afterAll() + } + test("view") { Seq(true, false).foreach { serde => withView("v1") { @@ -279,7 +295,7 @@ class HiveShowCreateTableSuite extends ShowCreateTableSuite with TestHiveSinglet table.copy( createTime = 0L, lastAccessTime = 0L, - properties = table.properties.filterKeys(!nondeterministicProps.contains(_)), + properties = table.properties.filterKeys(!nondeterministicProps.contains(_)).toMap, stats = None, ignoredProperties = Map.empty, storage = table.storage.copy(properties = Map.empty), diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSparkSubmitSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSparkSubmitSuite.scala index 8b97489e2d818..d56d7f39e39e3 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSparkSubmitSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveSparkSubmitSuite.scala @@ -23,8 +23,10 @@ import scala.util.Properties import org.apache.commons.lang3.{JavaVersion, SystemUtils} import org.apache.hadoop.fs.Path -import org.scalatest.{BeforeAndAfterEach, Matchers} +import org.apache.hadoop.hive.common.FileUtils import org.scalatest.Assertions._ +import org.scalatest.BeforeAndAfterEach +import org.scalatest.matchers.must.Matchers import org.apache.spark._ import org.apache.spark.internal.Logging @@ -35,15 +37,16 @@ import org.apache.spark.sql.catalyst.catalog._ import org.apache.spark.sql.execution.command.DDLUtils import org.apache.spark.sql.expressions.Window import org.apache.spark.sql.hive.test.{HiveTestJars, TestHiveContext} -import org.apache.spark.sql.internal.SQLConf.SHUFFLE_PARTITIONS +import org.apache.spark.sql.internal.SQLConf.{LEGACY_TIME_PARSER_POLICY, SHUFFLE_PARTITIONS} import org.apache.spark.sql.internal.StaticSQLConf.WAREHOUSE_PATH import org.apache.spark.sql.types.{DecimalType, StructType} -import org.apache.spark.tags.ExtendedHiveTest +import org.apache.spark.tags.{ExtendedHiveTest, SlowHiveTest} import org.apache.spark.util.{ResetSystemProperties, Utils} /** * This suite tests spark-submit with applications using HiveContext. */ +@SlowHiveTest @ExtendedHiveTest class HiveSparkSubmitSuite extends SparkSubmitTestUtils @@ -151,7 +154,7 @@ class HiveSparkSubmitSuite // For more detail, see sql/hive/src/test/resources/regression-test-SPARK-8489/*scala. // TODO: revisit for Scala 2.13 support val version = Properties.versionNumberString match { - case v if v.startsWith("2.12") => v.substring(0, 4) + case v if v.startsWith("2.12") || v.startsWith("2.13") => v.substring(0, 4) case x => throw new Exception(s"Unsupported Scala Version: $x") } val jarDir = getTestResourcePath("regression-test-SPARK-8489") @@ -335,6 +338,30 @@ class HiveSparkSubmitSuite unusedJar.toString) runSparkSubmit(argsForShowTables) } + + test("SPARK-34772: RebaseDateTime loadRebaseRecords should use Spark classloader " + + "instead of context") { + assume(!SystemUtils.isJavaVersionAtLeast(JavaVersion.JAVA_9)) + val unusedJar = TestUtils.createJarWithClasses(Seq.empty) + + // We need to specify the metastore database location in case of conflict with other hive + // versions. + withTempDir { file => + file.delete() + val metastore = s"jdbc:derby:;databaseName=${file.getAbsolutePath};create=true" + + val args = Seq( + "--class", SPARK_34772.getClass.getName.stripSuffix("$"), + "--name", "SPARK-34772", + "--master", "local-cluster[2,1,1024]", + "--conf", s"${LEGACY_TIME_PARSER_POLICY.key}=LEGACY", + "--conf", s"${HiveUtils.HIVE_METASTORE_VERSION.key}=1.2.1", + "--conf", s"${HiveUtils.HIVE_METASTORE_JARS.key}=maven", + "--conf", s"spark.hadoop.javax.jdo.option.ConnectionURL=$metastore", + unusedJar.toString) + runSparkSubmit(args) + } + } } object SetMetastoreURLTest extends Logging { @@ -406,10 +433,11 @@ object SetWarehouseLocationTest extends Logging { } - if (sparkSession.conf.get(WAREHOUSE_PATH.key) != expectedWarehouseLocation) { + val qualifiedWHPath = FileUtils.makeQualified( + new Path(expectedWarehouseLocation), sparkSession.sparkContext.hadoopConfiguration).toString + if (sparkSession.conf.get(WAREHOUSE_PATH.key) != qualifiedWHPath) { throw new Exception( - s"${WAREHOUSE_PATH.key} is not set to the expected warehouse location " + - s"$expectedWarehouseLocation.") + s"${WAREHOUSE_PATH.key} is not set to the expected warehouse location $qualifiedWHPath.") } val catalog = sparkSession.sessionState.catalog @@ -422,7 +450,7 @@ object SetWarehouseLocationTest extends Logging { val tableMetadata = catalog.getTableMetadata(TableIdentifier("testLocation", Some("default"))) val expectedLocation = - CatalogUtils.stringToURI(s"file:${expectedWarehouseLocation.toString}/testlocation") + CatalogUtils.stringToURI(s"$qualifiedWHPath/testlocation") val actualLocation = tableMetadata.location if (actualLocation != expectedLocation) { throw new Exception( @@ -438,7 +466,7 @@ object SetWarehouseLocationTest extends Logging { val tableMetadata = catalog.getTableMetadata(TableIdentifier("testLocation", Some("testLocationDB"))) val expectedLocation = CatalogUtils.stringToURI( - s"file:${expectedWarehouseLocation.toString}/testlocationdb.db/testlocation") + s"$qualifiedWHPath/testlocationdb.db/testlocation") val actualLocation = tableMetadata.location if (actualLocation != expectedLocation) { throw new Exception( @@ -709,7 +737,7 @@ object SPARK_9757 extends QueryTest { val df = hiveContext .range(10) - .select(callUDF("struct", ($"id" + 0.2) cast DecimalType(10, 3)) as "dec_struct") + .select(call_udf("struct", ($"id" + 0.2) cast DecimalType(10, 3)) as "dec_struct") df.write.option("path", dir.getCanonicalPath).mode("overwrite").saveAsTable("t") checkAnswer(hiveContext.table("t"), df) } @@ -768,8 +796,6 @@ object SPARK_14244 extends QueryTest { val hiveContext = new TestHiveContext(sparkContext) spark = hiveContext.sparkSession - import hiveContext.implicits._ - try { val window = Window.orderBy("id") val df = spark.range(2).select(cume_dist().over(window).as("cdist")).orderBy("cdist") @@ -845,3 +871,18 @@ object SPARK_18989_DESC_TABLE { } } } + +object SPARK_34772 { + def main(args: Array[String]): Unit = { + val spark = SparkSession.builder() + .config(UI_ENABLED.key, "false") + .enableHiveSupport() + .getOrCreate() + try { + spark.sql("CREATE TABLE t (c int) PARTITIONED BY (p date)") + spark.sql("SELECT * FROM t WHERE p='2021-01-01'").collect() + } finally { + spark.sql("DROP TABLE IF EXISTS t") + } + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUserDefinedTypeSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUserDefinedTypeSuite.scala index ca1af73b038a7..d0af8dc7ae49f 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUserDefinedTypeSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUserDefinedTypeSuite.scala @@ -18,7 +18,6 @@ package org.apache.spark.sql.hive import scala.collection.JavaConverters._ -import scala.util.Random import org.apache.hadoop.hive.ql.udf.generic.GenericUDF import org.apache.hadoop.hive.serde2.objectinspector.{ObjectInspector, StandardListObjectInspector} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUtilsSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUtilsSuite.scala index 4ad97eaa2b1c8..d8e1e01292820 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUtilsSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/HiveUtilsSuite.scala @@ -23,9 +23,8 @@ import org.apache.hadoop.hive.conf.HiveConf.ConfVars import org.apache.spark.SparkConf import org.apache.spark.deploy.SparkHadoopUtil import org.apache.spark.sql.QueryTest -import org.apache.spark.sql.execution.HiveResult import org.apache.spark.sql.hive.test.TestHiveSingleton -import org.apache.spark.sql.test.{ExamplePoint, ExamplePointUDT, SQLTestUtils} +import org.apache.spark.sql.test.SQLTestUtils import org.apache.spark.util.ChildFirstURLClassLoader class HiveUtilsSuite extends QueryTest with SQLTestUtils with TestHiveSingleton { diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertSuite.scala index 421dcb499bd6a..b715f484fa02a 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/InsertSuite.scala @@ -35,7 +35,7 @@ import org.apache.spark.util.Utils case class TestData(key: Int, value: String) -case class ThreeCloumntable(key: Int, value: String, key1: String) +case class ThreeColumnTable(key: Int, value: String, key1: String) class InsertSuite extends QueryTest with TestHiveSingleton with BeforeAndAfter with SQLTestUtils with PrivateMethodTester { @@ -277,7 +277,8 @@ class InsertSuite extends QueryTest with TestHiveSingleton with BeforeAndAfter test("Test partition mode = strict") { withSQLConf(("hive.exec.dynamic.partition.mode", "strict")) { withTable("partitioned") { - sql("CREATE TABLE partitioned (id bigint, data string) PARTITIONED BY (part string)") + sql("CREATE TABLE partitioned (id bigint, data string) USING hive " + + "PARTITIONED BY (part string)") val data = (1 to 10).map(i => (i, s"data-$i", if ((i % 2) == 0) "even" else "odd")) .toDF("id", "data", "part") @@ -763,7 +764,7 @@ class InsertSuite extends QueryTest with TestHiveSingleton with BeforeAndAfter val path = dir.toURI.getPath val e = intercept[AnalysisException] { - sql(s"INSERT OVERWRITE LOCAL DIRECTORY '${path}' TABLE notexists") + sql(s"INSERT OVERWRITE LOCAL DIRECTORY '${path}' TABLE nonexistent") }.getMessage assert(e.contains("Table or view not found")) } @@ -847,4 +848,26 @@ class InsertSuite extends QueryTest with TestHiveSingleton with BeforeAndAfter } } } + + test("SPARK-32508 " + + "Disallow empty part col values in partition spec before static partition writing") { + withTable("t1") { + spark.sql( + """ + |CREATE TABLE t1 (c1 int) + |PARTITIONED BY (d string) + """.stripMargin) + + val e = intercept[AnalysisException] { + spark.sql( + """ + |INSERT OVERWRITE TABLE t1 PARTITION(d='') + |SELECT 1 + """.stripMargin) + }.getMessage + + assert(!e.contains("get partition: Value for key d is null or empty")) + assert(e.contains("Partition spec is invalid")) + } + } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/ListTablesSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/ListTablesSuite.scala index 32db22e704b3e..49cd0885e722a 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/ListTablesSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/ListTablesSuite.scala @@ -22,9 +22,13 @@ import org.scalatest.BeforeAndAfterAll import org.apache.spark.sql.QueryTest import org.apache.spark.sql.Row import org.apache.spark.sql.catalyst.TableIdentifier +import org.apache.spark.sql.catalyst.analysis.AnalysisTest import org.apache.spark.sql.hive.test.TestHiveSingleton -class ListTablesSuite extends QueryTest with TestHiveSingleton with BeforeAndAfterAll { +class ListTablesSuite extends QueryTest + with AnalysisTest + with TestHiveSingleton + with BeforeAndAfterAll { import hiveContext._ import hiveContext.implicits._ @@ -33,8 +37,8 @@ class ListTablesSuite extends QueryTest with TestHiveSingleton with BeforeAndAft override def beforeAll(): Unit = { super.beforeAll() // The catalog in HiveContext is a case insensitive one. - sessionState.catalog.createTempView( - "ListTablesSuiteTable", df.logicalPlan, overrideIfExists = true) + createTempView( + sessionState.catalog, "ListTablesSuiteTable", df.logicalPlan, overrideIfExists = true) sql("CREATE TABLE HiveListTablesSuiteTable (key int, value string)") sql("CREATE DATABASE IF NOT EXISTS ListTablesSuiteDB") sql("CREATE TABLE ListTablesSuiteDB.HiveInDBListTablesSuiteTable (key int, value string)") diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala index 41a26344f7c21..ba441922d3600 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala @@ -256,13 +256,13 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv sql("SELECT `c_!@(3)` FROM expectedJsonTable").collect().toSeq) // Discard the cached relation. - sessionState.refreshTable("jsonTable") + spark.catalog.refreshTable("jsonTable") checkAnswer( sql("SELECT * FROM jsonTable"), sql("SELECT `c_!@(3)` FROM expectedJsonTable").collect().toSeq) - sessionState.refreshTable("jsonTable") + spark.catalog.refreshTable("jsonTable") val expectedSchema = StructType(StructField("c_!@(3)", IntegerType, true) :: Nil) assert(expectedSchema === table("jsonTable").schema) @@ -350,7 +350,7 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv """.stripMargin) // Discard the cached relation. - sessionState.refreshTable("ctasJsonTable") + spark.catalog.refreshTable("ctasJsonTable") // Schema should not be changed. assert(table("ctasJsonTable").schema === table("jsonTable").schema) @@ -438,7 +438,7 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv sql("SELECT * FROM savedJsonTable tmp where tmp.a > 5"), (6 to 10).map(i => Row(i, s"str$i"))) - sessionState.refreshTable("savedJsonTable") + spark.catalog.refreshTable("savedJsonTable") checkAnswer( sql("SELECT * FROM savedJsonTable where savedJsonTable.a < 5"), @@ -711,14 +711,14 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv identifier = TableIdentifier("wide_schema"), tableType = CatalogTableType.EXTERNAL, storage = CatalogStorageFormat.empty.copy( - properties = Map("path" -> tempDir.getCanonicalPath) + locationUri = Some(tempDir.toURI) ), schema = schema, provider = Some("json") ) spark.sessionState.catalog.createTable(tableDesc, ignoreIfExists = false) - sessionState.refreshTable("wide_schema") + spark.catalog.refreshTable("wide_schema") val actualSchema = table("wide_schema").schema assert(schema === actualSchema) @@ -751,7 +751,7 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv hiveClient.createTable(hiveTable, ignoreIfExists = false) - sessionState.refreshTable(tableName) + spark.catalog.refreshTable(tableName) val actualSchema = table(tableName).schema assert(schema === actualSchema) } @@ -763,7 +763,7 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv withTable(tableName) { df.write.format("parquet").partitionBy("d", "b").saveAsTable(tableName) - sessionState.refreshTable(tableName) + spark.catalog.refreshTable(tableName) val metastoreTable = hiveClient.getTable("default", tableName) val expectedPartitionColumns = StructType(df.schema("d") :: df.schema("b") :: Nil) @@ -798,7 +798,7 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv .bucketBy(8, "d", "b") .sortBy("c") .saveAsTable(tableName) - sessionState.refreshTable(tableName) + spark.catalog.refreshTable(tableName) val metastoreTable = hiveClient.getTable("default", tableName) val expectedBucketByColumns = StructType(df.schema("d") :: df.schema("b") :: Nil) val expectedSortByColumns = StructType(df.schema("c") :: Nil) @@ -1076,7 +1076,8 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv identifier = TableIdentifier("skip_hive_metadata", Some("default")), tableType = CatalogTableType.EXTERNAL, storage = CatalogStorageFormat.empty.copy( - properties = Map("path" -> tempPath.getCanonicalPath, "skipHiveMetadata" -> "true") + locationUri = Some(tempPath.toURI), + properties = Map("skipHiveMetadata" -> "true") ), schema = schema, provider = Some("parquet") @@ -1337,7 +1338,7 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv val e = intercept[AnalysisException] { sharedState.externalCatalog.getTable("default", "t") }.getMessage - assert(e.contains(s"Could not read schema from the hive metastore because it is corrupted")) + assert(e.contains("Cannot read table property 'spark.sql.sources.schema' as it's corrupted")) withDebugMode { val tableMeta = sharedState.externalCatalog.getTable("default", "t") @@ -1354,7 +1355,7 @@ class MetastoreDataSourcesSuite extends QueryTest with SQLTestUtils with TestHiv val newSession = sparkSession.newSession() newSession.sql("CREATE TABLE abc(i int) USING json") val tableMeta = newSession.sessionState.catalog.getTableMetadata(TableIdentifier("abc")) - assert(tableMeta.properties(DATASOURCE_SCHEMA_NUMPARTS).toInt == 1) + assert(tableMeta.properties.contains(DATASOURCE_SCHEMA)) assert(tableMeta.properties(DATASOURCE_PROVIDER) == "json") } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/ParquetEncryptionSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/ParquetEncryptionSuite.scala new file mode 100644 index 0000000000000..184ccadcb2612 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/ParquetEncryptionSuite.scala @@ -0,0 +1,96 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive + +import java.io.File +import java.io.RandomAccessFile +import java.nio.charset.StandardCharsets +import java.util.Base64 + +import org.apache.spark.sql.QueryTest +import org.apache.spark.sql.hive.test.TestHiveSingleton + +/** + * A test suite that tests parquet modular encryption usage. + */ +class ParquetEncryptionSuite extends QueryTest with TestHiveSingleton { + import spark.implicits._ + + private val encoder = Base64.getEncoder + private val footerKey = + encoder.encodeToString("0123456789012345".getBytes(StandardCharsets.UTF_8)) + private val key1 = encoder.encodeToString("1234567890123450".getBytes(StandardCharsets.UTF_8)) + private val key2 = encoder.encodeToString("1234567890123451".getBytes(StandardCharsets.UTF_8)) + + test("SPARK-34990: Write and read an encrypted parquet") { + withTempDir { dir => + withSQLConf( + "parquet.crypto.factory.class" -> + "org.apache.parquet.crypto.keytools.PropertiesDrivenCryptoFactory", + "parquet.encryption.kms.client.class" -> + "org.apache.parquet.crypto.keytools.mocks.InMemoryKMS", + "parquet.encryption.key.list" -> + s"footerKey: ${footerKey}, key1: ${key1}, key2: ${key2}") { + + val inputDF = Seq((1, 22, 333)).toDF("a", "b", "c") + val parquetDir = new File(dir, "parquet").getCanonicalPath + inputDF.write + .option("parquet.encryption.column.keys", "key1: a, b; key2: c") + .option("parquet.encryption.footer.key", "footerKey") + .parquet(parquetDir) + + verifyParquetEncrypted(parquetDir) + + val parquetDF = spark.read.parquet(parquetDir) + assert(parquetDF.inputFiles.nonEmpty) + val readDataset = parquetDF.select("a", "b", "c") + checkAnswer(readDataset, inputDF) + } + } + } + + /** + * Verify that the directory contains an encrypted parquet in + * encrypted footer mode by means of checking for all the parquet part files + * in the parquet directory that their magic string is PARE, as defined in the spec: + * https://github.com/apache/parquet-format/blob/master/Encryption.md#54-encrypted-footer-mode + */ + private def verifyParquetEncrypted(parquetDir: String): Unit = { + val parquetPartitionFiles = getListOfParquetFiles(new File(parquetDir)) + assert(parquetPartitionFiles.size >= 1) + parquetPartitionFiles.foreach { parquetFile => + val magicString = "PARE" + val magicStringLength = magicString.length() + val byteArray = new Array[Byte](magicStringLength) + val randomAccessFile = new RandomAccessFile(parquetFile, "r") + try { + randomAccessFile.read(byteArray, 0, magicStringLength) + } finally { + randomAccessFile.close() + } + val stringRead = new String(byteArray, StandardCharsets.UTF_8) + assert(magicString == stringRead) + } + } + + private def getListOfParquetFiles(dir: File): List[File] = { + dir.listFiles.filter(_.isFile).toList.filter { file => + file.getName.endsWith("parquet") + } + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/PartitionProviderCompatibilitySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/PartitionProviderCompatibilitySuite.scala index 80afc9d8f44bc..e1b0637963b75 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/PartitionProviderCompatibilitySuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/PartitionProviderCompatibilitySuite.scala @@ -53,7 +53,8 @@ class PartitionProviderCompatibilitySuite s"ALTER TABLE $tableName PARTITION (partCol=1) SET LOCATION '/foo'", s"ALTER TABLE $tableName DROP PARTITION (partCol=1)", s"DESCRIBE $tableName PARTITION (partCol=1)", - s"SHOW PARTITIONS $tableName") + s"SHOW PARTITIONS $tableName", + s"SHOW TABLE EXTENDED LIKE '$tableName' PARTITION (partCol=1)") withSQLConf(SQLConf.HIVE_MANAGE_FILESOURCE_PARTITIONS.key -> "true") { for (cmd <- unsupportedCommands) { @@ -124,10 +125,15 @@ class PartitionProviderCompatibilitySuite } // disabled withSQLConf(SQLConf.HIVE_MANAGE_FILESOURCE_PARTITIONS.key -> "false") { - val e = intercept[AnalysisException] { - spark.sql(s"show partitions test") + Seq( + "SHOW PARTITIONS test", + "SHOW TABLE EXTENDED LIKE 'test' PARTITION (partCol=1)" + ).foreach { showPartitions => + val e = intercept[AnalysisException] { + spark.sql(showPartitions) + } + assert(e.getMessage.contains("filesource partition management is disabled")) } - assert(e.getMessage.contains("filesource partition management is disabled")) spark.sql("refresh table test") assert(spark.sql("select * from test").count() == 5) } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/PartitionedTablePerfStatsSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/PartitionedTablePerfStatsSuite.scala index 3af163af0968c..de3b1ffccf00c 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/PartitionedTablePerfStatsSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/PartitionedTablePerfStatsSuite.scala @@ -300,7 +300,7 @@ class PartitionedTablePerfStatsSuite HiveCatalogMetrics.reset() assert(spark.sql("show partitions test").count() == 100) - assert(HiveCatalogMetrics.METRIC_HIVE_CLIENT_CALLS.getCount() < 10) + assert(HiveCatalogMetrics.METRIC_HIVE_CLIENT_CALLS.getCount() <= 10) } } } @@ -323,7 +323,7 @@ class PartitionedTablePerfStatsSuite HiveCatalogMetrics.reset() assert(spark.sql("show partitions test").count() == 100) - assert(HiveCatalogMetrics.METRIC_HIVE_CLIENT_CALLS.getCount() < 10) + assert(HiveCatalogMetrics.METRIC_HIVE_CLIENT_CALLS.getCount() <= 10) } } } @@ -390,8 +390,8 @@ class PartitionedTablePerfStatsSuite withSQLConf(SQLConf.HIVE_MANAGE_FILESOURCE_PARTITIONS.key -> "false") { withTable("test") { withTempDir { dir => - HiveCatalogMetrics.reset() setupPartitionedHiveTable("test", dir, 50) + HiveCatalogMetrics.reset() // select the table in multi-threads val executorPool = Executors.newFixedThreadPool(10) (1 to 10).map(threadId => { diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/QueryPartitionSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/QueryPartitionSuite.scala index 1e396553c9c52..cec6ec1ee1275 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/QueryPartitionSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/QueryPartitionSuite.scala @@ -17,12 +17,8 @@ package org.apache.spark.sql.hive -import java.io.File import java.sql.Timestamp -import com.google.common.io.Files -import org.apache.hadoop.fs.FileSystem - import org.apache.spark.internal.config._ import org.apache.spark.sql._ import org.apache.spark.sql.hive.test.TestHiveSingleton @@ -42,7 +38,7 @@ class QueryPartitionSuite extends QueryTest with SQLTestUtils with TestHiveSingl testData.createOrReplaceTempView("testData") // create the table for test - sql(s"CREATE TABLE table_with_partition(key int,value string) " + + sql(s"CREATE TABLE table_with_partition(key int,value string) USING hive " + s"PARTITIONED by (ds string) location '${tmpDir.toURI}' ") sql("INSERT OVERWRITE TABLE table_with_partition partition (ds='1') " + "SELECT key,value FROM testData") @@ -85,7 +81,8 @@ class QueryPartitionSuite extends QueryTest with SQLTestUtils with TestHiveSingl test("SPARK-21739: Cast expression should initialize timezoneId") { withTable("table_with_timestamp_partition") { - sql("CREATE TABLE table_with_timestamp_partition(value int) PARTITIONED BY (ts TIMESTAMP)") + sql("CREATE TABLE table_with_timestamp_partition(value int) USING hive " + + "PARTITIONED BY (ts TIMESTAMP)") sql("INSERT OVERWRITE TABLE table_with_timestamp_partition " + "PARTITION (ts = '2010-01-01 00:00:00.000') VALUES (1)") diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala index c1eab63ec073f..8afdd50b0c96b 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala @@ -31,7 +31,7 @@ import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.analysis.NoSuchPartitionException import org.apache.spark.sql.catalyst.catalog.{CatalogColumnStat, CatalogStatistics, HiveTableRelation} -import org.apache.spark.sql.catalyst.plans.logical.{ColumnStat, HistogramBin, HistogramSerializer} +import org.apache.spark.sql.catalyst.plans.logical.HistogramBin import org.apache.spark.sql.catalyst.util.{DateTimeUtils, StringUtils} import org.apache.spark.sql.execution.command.{AnalyzeColumnCommand, CommandUtils, DDLUtils} import org.apache.spark.sql.execution.datasources.LogicalRelation @@ -101,14 +101,9 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto .asInstanceOf[HiveTableRelation] val properties = relation.tableMeta.ignoredProperties - if (HiveUtils.isHive23) { - // Since HIVE-6727, Hive fixes table-level stats for external tables are incorrect. - assert(properties("totalSize").toLong == 6) - assert(properties.get("rawDataSize").isEmpty) - } else { - assert(properties("totalSize").toLong <= 0, "external table totalSize must be <= 0") - assert(properties("rawDataSize").toLong <= 0, "external table rawDataSize must be <= 0") - } + // Since HIVE-6727, Hive fixes table-level stats for external tables are incorrect. + assert(properties("totalSize").toLong == 6) + assert(properties.get("rawDataSize").isEmpty) val sizeInBytes = relation.stats.sizeInBytes assert(sizeInBytes === BigInt(file1.length() + file2.length())) @@ -170,7 +165,8 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto // Partitioned table val partTable = "part_table" withTable(partTable) { - sql(s"CREATE TABLE $partTable (key STRING, value STRING) PARTITIONED BY (ds STRING)") + sql(s"CREATE TABLE $partTable (key STRING, value STRING) USING hive " + + "PARTITIONED BY (ds STRING)") sql(s"INSERT INTO TABLE $partTable PARTITION (ds='2010-01-01') SELECT * FROM src") sql(s"INSERT INTO TABLE $partTable PARTITION (ds='2010-01-02') SELECT * FROM src") sql(s"INSERT INTO TABLE $partTable PARTITION (ds='2010-01-03') SELECT * FROM src") @@ -196,7 +192,8 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto SQLConf.PARALLEL_FILE_LISTING_IN_STATS_COMPUTATION.key -> "True") { val checkSizeTable = "checkSizeTable" withTable(checkSizeTable) { - sql(s"CREATE TABLE $checkSizeTable (key STRING, value STRING) PARTITIONED BY (ds STRING)") + sql(s"CREATE TABLE $checkSizeTable (key STRING, value STRING) USING hive " + + "PARTITIONED BY (ds STRING)") sql(s"INSERT INTO TABLE $checkSizeTable PARTITION (ds='2010-01-01') SELECT * FROM src") sql(s"INSERT INTO TABLE $checkSizeTable PARTITION (ds='2010-01-02') SELECT * FROM src") sql(s"INSERT INTO TABLE $checkSizeTable PARTITION (ds='2010-01-03') SELECT * FROM src") @@ -279,7 +276,8 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto test("SPARK-22745 - read Hive's statistics for partition") { val tableName = "hive_stats_part_table" withTable(tableName) { - sql(s"CREATE TABLE $tableName (key STRING, value STRING) PARTITIONED BY (ds STRING)") + sql(s"CREATE TABLE $tableName (key STRING, value STRING) USING hive " + + "PARTITIONED BY (ds STRING)") sql(s"INSERT INTO TABLE $tableName PARTITION (ds='2017-01-01') SELECT * FROM src") var partition = spark.sessionState.catalog .getPartition(TableIdentifier(tableName), Map("ds" -> "2017-01-01")) @@ -301,7 +299,8 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto val tableName = "analyzeTable_part" withTable(tableName) { withTempPath { path => - sql(s"CREATE TABLE $tableName (key STRING, value STRING) PARTITIONED BY (ds STRING)") + sql(s"CREATE TABLE $tableName (key STRING, value STRING) USING hive " + + "PARTITIONED BY (ds STRING)") val partitionDates = List("2010-01-01", "2010-01-02", "2010-01-03") partitionDates.foreach { ds => @@ -326,6 +325,7 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto sql( s""" |CREATE TABLE $sourceTableName (key STRING, value STRING) + |USING hive |PARTITIONED BY (ds STRING) |LOCATION '${path.toURI}' """.stripMargin) @@ -343,6 +343,7 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto sql( s""" |CREATE TABLE $tableName (key STRING, value STRING) + |USING hive |PARTITIONED BY (ds STRING) |LOCATION '${path.toURI}' """.stripMargin) @@ -376,7 +377,8 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto } withTable(tableName) { - sql(s"CREATE TABLE $tableName (key STRING, value STRING) PARTITIONED BY (ds STRING)") + sql(s"CREATE TABLE $tableName (key STRING, value STRING) USING hive " + + "PARTITIONED BY (ds STRING)") createPartition("2010-01-01", "SELECT '1', 'A' from src") createPartition("2010-01-02", "SELECT '1', 'A' from src UNION ALL SELECT '1', 'A' from src") @@ -429,7 +431,8 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto } withTable(tableName) { - sql(s"CREATE TABLE $tableName (key STRING, value STRING) PARTITIONED BY (ds STRING, hr INT)") + sql(s"CREATE TABLE $tableName (key STRING, value STRING) USING hive " + + "PARTITIONED BY (ds STRING, hr INT)") createPartition("2010-01-01", 10, "SELECT '1', 'A' from src") createPartition("2010-01-01", 11, "SELECT '1', 'A' from src") @@ -477,7 +480,8 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto } withTable(tableName) { - sql(s"CREATE TABLE $tableName (key STRING, value STRING) PARTITIONED BY (ds STRING, hr INT)") + sql(s"CREATE TABLE $tableName (key STRING, value STRING) USING hive " + + "PARTITIONED BY (ds STRING, hr INT)") createPartition("2010-01-01", 10, "SELECT '1', 'A' from src") createPartition("2010-01-01", 11, "SELECT '1', 'A' from src") @@ -731,7 +735,7 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto } } - test("analyze column command paramaters validation") { + test("analyze column command parameters validation") { val e1 = intercept[IllegalArgumentException] { AnalyzeColumnCommand(TableIdentifier("test"), Option(Seq("c1")), true).run(spark) } @@ -811,32 +815,6 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto } } - test("alter table rename after analyze table") { - Seq(true, false).foreach { analyzedBySpark => - val oldName = "tab1" - val newName = "tab2" - withTable(oldName, newName) { - createNonPartitionedTable(oldName, analyzedByHive = true, analyzedBySpark = analyzedBySpark) - val fetchedStats1 = checkTableStats( - oldName, hasSizeInBytes = true, expectedRowCounts = Some(500)) - sql(s"ALTER TABLE $oldName RENAME TO $newName") - val fetchedStats2 = checkTableStats( - newName, hasSizeInBytes = true, expectedRowCounts = Some(500)) - assert(fetchedStats1 == fetchedStats2) - - // ALTER TABLE RENAME does not affect the contents of Hive specific statistics - val describeResult = hiveClient.runSqlHive(s"DESCRIBE FORMATTED $newName") - - val rawDataSize = extractStatsPropValues(describeResult, "rawDataSize") - val numRows = extractStatsPropValues(describeResult, "numRows") - val totalSize = extractStatsPropValues(describeResult, "totalSize") - assert(rawDataSize.isDefined && rawDataSize.get > 0, "rawDataSize is lost") - assert(numRows.isDefined && numRows.get == 500, "numRows is lost") - assert(totalSize.isDefined && totalSize.get > 0, "totalSize is lost") - } - } - } - test("alter table should not have the side effect to store statistics in Spark side") { val table = "alter_table_side_effect" withTable(table) { @@ -872,25 +850,10 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto assert(totalSize.isDefined && totalSize.get > 0, "totalSize is lost") val numRows = extractStatsPropValues(describeResult, "numRows") - if (HiveUtils.isHive23) { - // Since HIVE-15653(Hive 2.3.0), Hive fixs some ALTER TABLE commands drop table stats. - assert(numRows.isDefined && numRows.get == 500) - val rawDataSize = extractStatsPropValues(describeResult, "rawDataSize") - assert(rawDataSize.isDefined && rawDataSize.get == 5312) - checkTableStats(tabName, hasSizeInBytes = true, expectedRowCounts = Some(500)) - } else { - // ALTER TABLE SET/UNSET TBLPROPERTIES invalidates some Hive specific statistics, but not - // Spark specific statistics. This is triggered by the Hive alterTable API. - assert(numRows.isDefined && numRows.get == -1, "numRows is lost") - val rawDataSize = extractStatsPropValues(describeResult, "rawDataSize") - assert(rawDataSize.isDefined && rawDataSize.get == -1, "rawDataSize is lost") - - if (analyzedBySpark) { - checkTableStats(tabName, hasSizeInBytes = true, expectedRowCounts = Some(500)) - } else { - checkTableStats(tabName, hasSizeInBytes = true, expectedRowCounts = None) - } - } + assert(numRows.isDefined && numRows.get == 500) + val rawDataSize = extractStatsPropValues(describeResult, "rawDataSize") + assert(rawDataSize.isDefined && rawDataSize.get == 5312) + checkTableStats(tabName, hasSizeInBytes = true, expectedRowCounts = Some(500)) } } } @@ -911,7 +874,7 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto */ private def getStatsProperties(tableName: String): Map[String, String] = { val hTable = hiveClient.getTable(spark.sessionState.catalog.getCurrentDatabase, tableName) - hTable.properties.filterKeys(_.startsWith(STATISTICS_PREFIX)) + hTable.properties.filterKeys(_.startsWith(STATISTICS_PREFIX)).toMap } test("change stats after insert command for hive table") { @@ -981,7 +944,8 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto Seq(false, true).foreach { autoUpdate => withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> autoUpdate.toString) { withTable(table) { - sql(s"CREATE TABLE $table (i INT, j STRING) PARTITIONED BY (ds STRING, hr STRING)") + sql(s"CREATE TABLE $table (i INT, j STRING) USING hive " + + "PARTITIONED BY (ds STRING, hr STRING)") // table has two partitions initially for (ds <- Seq("2008-04-08"); hr <- Seq("11", "12")) { sql(s"INSERT OVERWRITE TABLE $table PARTITION (ds='$ds',hr='$hr') SELECT 1, 'a'") @@ -993,12 +957,16 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto assert(fetched1.get.colStats.size == 2) withTempPaths(numPaths = 2) { case Seq(dir1, dir2) => - val file1 = new File(dir1 + "/data") + val partDir1 = new File(new File(dir1, "ds=2008-04-09"), "hr=11") + val file1 = new File(partDir1, "data") + file1.getParentFile.mkdirs() Utils.tryWithResource(new PrintWriter(file1)) { writer => writer.write("1,a") } - val file2 = new File(dir2 + "/data") + val partDir2 = new File(new File(dir2, "ds=2008-04-09"), "hr=12") + val file2 = new File(partDir2, "data") + file2.getParentFile.mkdirs() Utils.tryWithResource(new PrintWriter(file2)) { writer => writer.write("1,a") } @@ -1007,8 +975,8 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto sql( s""" |ALTER TABLE $table ADD - |PARTITION (ds='2008-04-09', hr='11') LOCATION '${dir1.toURI.toString}' - |PARTITION (ds='2008-04-09', hr='12') LOCATION '${dir2.toURI.toString}' + |PARTITION (ds='2008-04-09', hr='11') LOCATION '${partDir1.toURI.toString}' + |PARTITION (ds='2008-04-09', hr='12') LOCATION '${partDir1.toURI.toString}' """.stripMargin) if (autoUpdate) { val fetched2 = checkTableStats(table, hasSizeInBytes = true, expectedRowCounts = None) @@ -1054,6 +1022,7 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto sql( s""" |CREATE TABLE $managedTable (key INT, value STRING) + |USING hive |PARTITIONED BY (ds STRING, hr STRING) """.stripMargin) @@ -1128,7 +1097,7 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto def checkColStatsProps(expected: Map[String, String]): Unit = { sql(s"ANALYZE TABLE $tableName COMPUTE STATISTICS FOR COLUMNS " + stats.keys.mkString(", ")) val table = hiveClient.getTable("default", tableName) - val props = table.properties.filterKeys(_.startsWith("spark.sql.statistics.colStats")) + val props = table.properties.filterKeys(_.startsWith("spark.sql.statistics.colStats")).toMap assert(props == expected) } @@ -1533,26 +1502,27 @@ class StatisticsSuite extends StatisticsCollectionTestBase with TestHiveSingleto Seq(tbl, ext_tbl).foreach { tblName => sql(s"INSERT INTO $tblName VALUES (1, 'a', '2019-12-13')") + val expectedSize = 657 // analyze table sql(s"ANALYZE TABLE $tblName COMPUTE STATISTICS NOSCAN") var tableStats = getTableStats(tblName) - assert(tableStats.sizeInBytes == 601) + assert(tableStats.sizeInBytes == expectedSize) assert(tableStats.rowCount.isEmpty) sql(s"ANALYZE TABLE $tblName COMPUTE STATISTICS") tableStats = getTableStats(tblName) - assert(tableStats.sizeInBytes == 601) + assert(tableStats.sizeInBytes == expectedSize) assert(tableStats.rowCount.get == 1) // analyze a single partition sql(s"ANALYZE TABLE $tblName PARTITION (ds='2019-12-13') COMPUTE STATISTICS NOSCAN") var partStats = getPartitionStats(tblName, Map("ds" -> "2019-12-13")) - assert(partStats.sizeInBytes == 601) + assert(partStats.sizeInBytes == expectedSize) assert(partStats.rowCount.isEmpty) sql(s"ANALYZE TABLE $tblName PARTITION (ds='2019-12-13') COMPUTE STATISTICS") partStats = getPartitionStats(tblName, Map("ds" -> "2019-12-13")) - assert(partStats.sizeInBytes == 601) + assert(partStats.sizeInBytes == expectedSize) assert(partStats.rowCount.get == 1) } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/FiltersSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/FiltersSuite.scala index 2a4efd0cce6e0..fcdc97325d010 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/FiltersSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/FiltersSuite.scala @@ -17,6 +17,7 @@ package org.apache.spark.sql.hive.client +import java.sql.Date import java.util.Collections import org.apache.hadoop.hive.metastore.api.FieldSchema @@ -29,6 +30,7 @@ import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.plans.PlanTest import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types._ +import org.apache.spark.unsafe.types.UTF8String /** * A set of tests for the filter conversion logic used when pushing partition pruning into the @@ -63,6 +65,28 @@ class FiltersSuite extends SparkFunSuite with Logging with PlanTest { (Literal(1) === a("intcol", IntegerType)) :: (Literal("a") === a("strcol", IntegerType)) :: Nil, "1 = intcol and \"a\" = strcol") + filterTest("date filter", + (a("datecol", DateType) === Literal(Date.valueOf("2019-01-01"))) :: Nil, + "datecol = 2019-01-01") + + filterTest("date filter with IN predicate", + (a("datecol", DateType) in + (Literal(Date.valueOf("2019-01-01")), Literal(Date.valueOf("2019-01-07")))) :: Nil, + "(datecol = 2019-01-01 or datecol = 2019-01-07)") + + filterTest("date and string filter", + (Literal(Date.valueOf("2019-01-01")) === a("datecol", DateType)) :: + (Literal("a") === a("strcol", IntegerType)) :: Nil, + "2019-01-01 = datecol and \"a\" = strcol") + + filterTest("date filter with null", + (a("datecol", DateType) === Literal(null)) :: Nil, + "") + + filterTest("string filter with InSet predicate", + InSet(a("strcol", StringType), Set("1", "2").map(s => UTF8String.fromString(s))) :: Nil, + "(strcol = \"1\" or strcol = \"2\")") + filterTest("skip varchar", (Literal("") === a("varchar", StringType)) :: Nil, "") @@ -76,6 +100,55 @@ class FiltersSuite extends SparkFunSuite with Logging with PlanTest { (a("intcol", IntegerType) in (Literal(1), Literal(null))) :: Nil, "(intcol = 1)") + filterTest("NOT: int and string filters", + (a("intcol", IntegerType) =!= Literal(1)) :: (Literal("a") =!= a("strcol", IntegerType)) :: Nil, + """intcol != 1 and "a" != strcol""") + + filterTest("NOT: date filter", + (a("datecol", DateType) =!= Literal(Date.valueOf("2019-01-01"))) :: Nil, + "datecol != 2019-01-01") + + filterTest("not-in, string filter", + (Not(In(a("strcol", StringType), Seq(Literal("a"), Literal("b"))))) :: Nil, + """(strcol != "a" and strcol != "b")""") + + filterTest("not-in, string filter with null", + (Not(In(a("strcol", StringType), Seq(Literal("a"), Literal("b"), Literal(null))))) :: Nil, + "") + + filterTest("not-in, date filter", + (Not(In(a("datecol", DateType), + Seq(Literal(Date.valueOf("2021-01-01")), Literal(Date.valueOf("2021-01-02")))))) :: Nil, + """(datecol != 2021-01-01 and datecol != 2021-01-02)""") + + filterTest("not-in, date filter with null", + (Not(In(a("datecol", DateType), + Seq(Literal(Date.valueOf("2021-01-01")), Literal(Date.valueOf("2021-01-02")), + Literal(null))))) :: Nil, + "") + + filterTest("not-inset, string filter", + (Not(InSet(a("strcol", StringType), Set(Literal("a").eval(), Literal("b").eval())))) :: Nil, + """(strcol != "a" and strcol != "b")""") + + filterTest("not-inset, string filter with null", + (Not(InSet(a("strcol", StringType), + Set(Literal("a").eval(), Literal("b").eval(), Literal(null).eval())))) :: Nil, + "") + + filterTest("not-inset, date filter", + (Not(InSet(a("datecol", DateType), + Set(Literal(Date.valueOf("2020-01-01")).eval(), + Literal(Date.valueOf("2020-01-02")).eval())))) :: Nil, + """(datecol != 2020-01-01 and datecol != 2020-01-02)""") + + filterTest("not-inset, date filter with null", + (Not(InSet(a("datecol", DateType), + Set(Literal(Date.valueOf("2020-01-01")).eval(), + Literal(Date.valueOf("2020-01-02")).eval(), + Literal(null).eval())))) :: Nil, + "") + // Applying the predicate `x IN (NULL)` should return an empty set, but since this optimization // will be applied by Catalyst, this filter converter does not need to account for this. filterTest("SPARK-24879 IN predicates with only NULLs will not cause a NPE", @@ -89,7 +162,7 @@ class FiltersSuite extends SparkFunSuite with Logging with PlanTest { private def filterTest(name: String, filters: Seq[Expression], result: String) = { test(name) { withSQLConf(SQLConf.ADVANCED_PARTITION_PREDICATE_PUSHDOWN.key -> "true") { - val converted = shim.convertFilters(testTable, filters) + val converted = shim.convertFilters(testTable, filters, conf.sessionLocalTimeZone) if (converted != result) { fail(s"Expected ${filters.mkString(",")} to convert to '$result' but got '$converted'") } @@ -104,7 +177,7 @@ class FiltersSuite extends SparkFunSuite with Logging with PlanTest { val filters = (Literal(1) === a("intcol", IntegerType) || Literal(2) === a("intcol", IntegerType)) :: Nil - val converted = shim.convertFilters(testTable, filters) + val converted = shim.convertFilters(testTable, filters, conf.sessionLocalTimeZone) if (enabled) { assert(converted == "(1 = intcol or 2 = intcol)") } else { @@ -114,5 +187,69 @@ class FiltersSuite extends SparkFunSuite with Logging with PlanTest { } } + test("SPARK-33416: Avoid Hive metastore stack overflow when InSet predicate have many values") { + def checkConverted(inSet: InSet, result: String): Unit = { + assert(shim.convertFilters(testTable, inSet :: Nil, conf.sessionLocalTimeZone) == result) + } + + withSQLConf(SQLConf.HIVE_METASTORE_PARTITION_PRUNING_INSET_THRESHOLD.key -> "15") { + checkConverted( + InSet(a("intcol", IntegerType), + Range(1, 20).map(s => Literal(s).eval(EmptyRow)).toSet), + "(intcol >= 1 and intcol <= 19)") + + checkConverted( + InSet(a("stringcol", StringType), + Range(1, 20).map(s => Literal(s.toString).eval(EmptyRow)).toSet), + "(stringcol >= \"1\" and stringcol <= \"9\")") + + checkConverted( + InSet(a("intcol", IntegerType).cast(LongType), + Range(1, 20).map(s => Literal(s.toLong).eval(EmptyRow)).toSet), + "(intcol >= 1 and intcol <= 19)") + + checkConverted( + InSet(a("doublecol", DoubleType), + Range(1, 20).map(s => Literal(s.toDouble).eval(EmptyRow)).toSet), + "") + + checkConverted( + InSet(a("datecol", DateType), + Range(1, 20).map(d => Literal(d, DateType).eval(EmptyRow)).toSet), + "(datecol >= 1970-01-02 and datecol <= 1970-01-20)") + } + } + + test("SPARK-34515: Fix NPE if InSet contains null value during getPartitionsByFilter") { + withSQLConf(SQLConf.HIVE_METASTORE_PARTITION_PRUNING_INSET_THRESHOLD.key -> "2") { + val filter = InSet(a("p", IntegerType), Set(null, 1, 2)) + val converted = shim.convertFilters(testTable, Seq(filter), conf.sessionLocalTimeZone) + assert(converted == "(p >= 1 and p <= 2)") + } + } + + test("Don't push not inset if it's values exceeds the threshold") { + withSQLConf(SQLConf.HIVE_METASTORE_PARTITION_PRUNING_INSET_THRESHOLD.key -> "2") { + val filter = Not(InSet(a("p", IntegerType), Set(1, 2, 3))) + val converted = shim.convertFilters(testTable, Seq(filter), conf.sessionLocalTimeZone) + assert(converted.isEmpty) + } + } + + test("SPARK-34538: Skip InSet null value during push filter to Hive metastore") { + withSQLConf(SQLConf.HIVE_METASTORE_PARTITION_PRUNING_INSET_THRESHOLD.key -> "3") { + val intFilter = InSet(a("p", IntegerType), Set(null, 1, 2)) + val intConverted = shim.convertFilters(testTable, Seq(intFilter), conf.sessionLocalTimeZone) + assert(intConverted == "(p = 1 or p = 2)") + } + + withSQLConf(SQLConf.HIVE_METASTORE_PARTITION_PRUNING_INSET_THRESHOLD.key -> "3") { + val dateFilter = InSet(a("p", DateType), Set(null, + Literal(Date.valueOf("2020-01-01")).eval(), Literal(Date.valueOf("2021-01-01")).eval())) + val dateConverted = shim.convertFilters(testTable, Seq(dateFilter), conf.sessionLocalTimeZone) + assert(dateConverted == "(p = 2020-01-01 or p = 2021-01-01)") + } + } + private def a(name: String, dataType: DataType) = AttributeReference(name, dataType)() } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HadoopVersionInfoSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HadoopVersionInfoSuite.scala new file mode 100644 index 0000000000000..6ada46412bf9f --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HadoopVersionInfoSuite.scala @@ -0,0 +1,90 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.client + +import java.io.File +import java.net.URLClassLoader + +import org.apache.hadoop.conf.Configuration +import org.apache.hadoop.util.VersionInfo + +import org.apache.spark.{SparkConf, SparkFunSuite} +import org.apache.spark.sql.hive.{HiveExternalCatalog, HiveUtils} +import org.apache.spark.util.Utils + +/** + * This test suite requires a clean JVM because it's testing the initialization of static codes in + * `org.apache.hadoop.util.VersionInfo`. + */ +class HadoopVersionInfoSuite extends SparkFunSuite { + override protected val enableAutoThreadAudit = false + + test("SPARK-32256: Hadoop VersionInfo should be preloaded") { + val ivyPath = + Utils.createTempDir(namePrefix = s"${classOf[HadoopVersionInfoSuite].getSimpleName}-ivy") + try { + val hadoopConf = new Configuration() + hadoopConf.set("test", "success") + hadoopConf.set("datanucleus.schema.autoCreateAll", "true") + hadoopConf.set("hive.metastore.schema.verification", "false") + + // Download jars for Hive 2.0 + val client = IsolatedClientLoader.forVersion( + hiveMetastoreVersion = "2.0", + hadoopVersion = "2.7.4", + sparkConf = new SparkConf(), + hadoopConf = hadoopConf, + config = HiveClientBuilder.buildConf(Map.empty), + ivyPath = Some(ivyPath.getCanonicalPath)) + val jars = client.classLoader.getParent.asInstanceOf[URLClassLoader].getURLs + .map(u => new File(u.toURI)) + // Drop all Hadoop jars to use the existing Hadoop jars on the classpath + .filter(!_.getName.startsWith("org.apache.hadoop_hadoop-")) + + val sparkConf = new SparkConf() + sparkConf.set(HiveUtils.HIVE_METASTORE_VERSION, "2.0") + sparkConf.set( + HiveUtils.HIVE_METASTORE_JARS, + jars.map(_.getCanonicalPath).mkString(File.pathSeparator)) + HiveClientBuilder.buildConf(Map.empty).foreach { case (k, v) => + hadoopConf.set(k, v) + } + new HiveExternalCatalog(sparkConf, hadoopConf).client.getState + } finally { + Utils.deleteRecursively(ivyPath) + } + } + + test("SPARK-32212: test supportHadoopShadedClient()") { + Seq("3.2.2", "3.2.3", "3.2.2.1", "3.2.2-XYZ", "3.2.2.4-SNAPSHOT").foreach { version => + assert(IsolatedClientLoader.supportsHadoopShadedClient(version), s"version $version") + } + + // negative cases + Seq("3.1.3", "3.2", "3.2.1", "4").foreach { version => + assert(!IsolatedClientLoader.supportsHadoopShadedClient(version), s"version $version") + } + } + + test("SPARK-32212: built-in Hadoop version should support shaded client if it is not hadoop 2") { + val hadoopVersion = VersionInfo.getVersion + if (!hadoopVersion.startsWith("2")) { + assert(IsolatedClientLoader.supportsHadoopShadedClient(hadoopVersion)) + } + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientBuilder.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientBuilder.scala index ab73f668c6ca6..f40b4f00d9fd0 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientBuilder.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientBuilder.scala @@ -33,7 +33,7 @@ private[client] object HiveClientBuilder { Some(new File(sys.props("java.io.tmpdir"), "hive-ivy-cache").getAbsolutePath)) } - private def buildConf(extraConf: Map[String, String]) = { + private[client] def buildConf(extraConf: Map[String, String]): Map[String, String] = { lazy val warehousePath = Utils.createTempDir() lazy val metastorePath = Utils.createTempDir() metastorePath.delete() @@ -46,15 +46,13 @@ private[client] object HiveClientBuilder { def buildClient( version: String, hadoopConf: Configuration, - extraConf: Map[String, String] = Map.empty, - sharesHadoopClasses: Boolean = true): HiveClient = { + extraConf: Map[String, String] = Map.empty): HiveClient = { IsolatedClientLoader.forVersion( hiveMetastoreVersion = version, hadoopVersion = VersionInfo.getVersion, sparkConf = new SparkConf(), hadoopConf = hadoopConf, config = buildConf(extraConf), - ivyPath = ivyPath, - sharesHadoopClasses = sharesHadoopClasses).createClient() + ivyPath = ivyPath).createClient() } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientUserNameSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientUserNameSuite.scala index 77956f4fe69da..b94d517e89e30 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientUserNameSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveClientUserNameSuite.scala @@ -21,7 +21,6 @@ import java.security.PrivilegedExceptionAction import org.apache.hadoop.conf.Configuration import org.apache.hadoop.security.UserGroupInformation -import org.scalatest.{BeforeAndAfterAll, PrivateMethodTester} import org.apache.spark.util.Utils diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HivePartitionFilteringSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HivePartitionFilteringSuite.scala index 2d615f6fdc261..16e1a415977a1 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HivePartitionFilteringSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HivePartitionFilteringSuite.scala @@ -17,6 +17,8 @@ package org.apache.spark.sql.hive.client +import java.sql.Date + import org.apache.hadoop.conf.Configuration import org.apache.hadoop.hive.conf.HiveConf import org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat @@ -26,9 +28,11 @@ import org.scalatest.BeforeAndAfterAll import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.catalog._ +import org.apache.spark.sql.catalyst.catalog.ExternalCatalogUtils.DEFAULT_PARTITION_NAME import org.apache.spark.sql.catalyst.dsl.expressions._ import org.apache.spark.sql.catalyst.expressions._ -import org.apache.spark.sql.types.{BooleanType, IntegerType, LongType, StructType} +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.types.{BooleanType, DateType, IntegerType, LongType, StringType, StructType} import org.apache.spark.util.Utils class HivePartitionFilteringSuite(version: String) @@ -36,47 +40,55 @@ class HivePartitionFilteringSuite(version: String) private val tryDirectSqlKey = HiveConf.ConfVars.METASTORE_TRY_DIRECT_SQL.varname - private val testPartitionCount = 3 * 5 * 4 + // Support default partition in metastoredirectsql since HIVE-11898(Hive 2.0.0). + private val defaultPartition = if (version >= "2.0") Some(DEFAULT_PARTITION_NAME) else None + + private val dsValue = 20170101 to 20170103 + private val hValue = 0 to 4 + private val chunkValue = Seq("aa", "ab", "ba", "bb") + private val dateValue = Seq("2019-01-01", "2019-01-02", "2019-01-03") ++ defaultPartition + private val dateStrValue = Seq("2020-01-01", "2020-01-02", "2020-01-03") + private val testPartitionCount = + dsValue.size * hValue.size * chunkValue.size * dateValue.size * dateStrValue.size + + private val storageFormat = CatalogStorageFormat( + locationUri = None, + inputFormat = Some(classOf[TextInputFormat].getName), + outputFormat = Some(classOf[HiveIgnoreKeyTextOutputFormat[_, _]].getName), + serde = Some(classOf[LazySimpleSerDe].getName()), + compressed = false, + properties = Map.empty + ) private def init(tryDirectSql: Boolean): HiveClient = { - val storageFormat = CatalogStorageFormat( - locationUri = None, - inputFormat = None, - outputFormat = None, - serde = None, - compressed = false, - properties = Map.empty) - val hadoopConf = new Configuration() hadoopConf.setBoolean(tryDirectSqlKey, tryDirectSql) hadoopConf.set("hive.metastore.warehouse.dir", Utils.createTempDir().toURI().toString()) val client = buildClient(hadoopConf) val tableSchema = new StructType().add("value", "int").add("ds", "int").add("h", "int").add("chunk", "string") + .add("d", "date").add("datestr", "string") val table = CatalogTable( identifier = TableIdentifier("test", Some("default")), tableType = CatalogTableType.MANAGED, schema = tableSchema, - partitionColumnNames = Seq("ds", "h", "chunk"), - storage = CatalogStorageFormat( - locationUri = None, - inputFormat = Some(classOf[TextInputFormat].getName), - outputFormat = Some(classOf[HiveIgnoreKeyTextOutputFormat[_, _]].getName), - serde = Some(classOf[LazySimpleSerDe].getName()), - compressed = false, - properties = Map.empty - )) + partitionColumnNames = Seq("ds", "h", "chunk", "d", "datestr"), + storage = storageFormat) client.createTable(table, ignoreIfExists = false) val partitions = for { - ds <- 20170101 to 20170103 - h <- 0 to 4 - chunk <- Seq("aa", "ab", "ba", "bb") + ds <- dsValue + h <- hValue + chunk <- chunkValue + date <- dateValue + dateStr <- dateStrValue } yield CatalogTablePartition(Map( "ds" -> ds.toString, "h" -> h.toString, - "chunk" -> chunk + "chunk" -> chunk, + "d" -> date, + "datestr" -> dateStr ), storageFormat) assert(partitions.size == testPartitionCount) @@ -102,7 +114,7 @@ class HivePartitionFilteringSuite(version: String) test(s"getPartitionsByFilter returns all partitions when $tryDirectSqlKey=false") { val client = init(false) val filteredPartitions = client.getPartitionsByFilter(client.getTable("default", "test"), - Seq(attr("ds") === 20170101)) + Seq(attr("ds") === 20170101), SQLConf.get.sessionLocalTimeZone) assert(filteredPartitions.size == testPartitionCount) } @@ -111,17 +123,21 @@ class HivePartitionFilteringSuite(version: String) // Should return all partitions where <=> is not supported testMetastorePartitionFiltering( attr("ds") <=> 20170101, - 20170101 to 20170103, - 0 to 4, - "aa" :: "ab" :: "ba" :: "bb" :: Nil) + dsValue, + hValue, + chunkValue, + dateValue, + dateStrValue) } test("getPartitionsByFilter: ds=20170101") { testMetastorePartitionFiltering( attr("ds") === 20170101, 20170101 to 20170101, - 0 to 4, - "aa" :: "ab" :: "ba" :: "bb" :: Nil) + hValue, + chunkValue, + dateValue, + dateStrValue) } test("getPartitionsByFilter: ds=(20170101 + 1) and h=0") { @@ -129,41 +145,51 @@ class HivePartitionFilteringSuite(version: String) // comparisons to non-literal values testMetastorePartitionFiltering( attr("ds") === (Literal(20170101) + 1) && attr("h") === 0, - 20170101 to 20170103, + dsValue, 0 to 0, - "aa" :: "ab" :: "ba" :: "bb" :: Nil) + chunkValue, + dateValue, + dateStrValue) } test("getPartitionsByFilter: chunk='aa'") { testMetastorePartitionFiltering( attr("chunk") === "aa", - 20170101 to 20170103, - 0 to 4, - "aa" :: Nil) + dsValue, + hValue, + "aa" :: Nil, + dateValue, + dateStrValue) } test("getPartitionsByFilter: cast(chunk as int)=1 (not a valid partition predicate)") { testMetastorePartitionFiltering( attr("chunk").cast(IntegerType) === 1, - 20170101 to 20170103, - 0 to 4, - "aa" :: "ab" :: "ba" :: "bb" :: Nil) + dsValue, + hValue, + chunkValue, + dateValue, + dateStrValue) } test("getPartitionsByFilter: cast(chunk as boolean)=true (not a valid partition predicate)") { testMetastorePartitionFiltering( attr("chunk").cast(BooleanType) === true, - 20170101 to 20170103, - 0 to 4, - "aa" :: "ab" :: "ba" :: "bb" :: Nil) + dsValue, + hValue, + chunkValue, + dateValue, + dateStrValue) } test("getPartitionsByFilter: 20170101=ds") { testMetastorePartitionFiltering( Literal(20170101) === attr("ds"), 20170101 to 20170101, - 0 to 4, - "aa" :: "ab" :: "ba" :: "bb" :: Nil) + hValue, + chunkValue, + dateValue, + dateStrValue) } test("getPartitionsByFilter: ds=20170101 and h=2") { @@ -171,7 +197,9 @@ class HivePartitionFilteringSuite(version: String) attr("ds") === 20170101 && attr("h") === 2, 20170101 to 20170101, 2 to 2, - "aa" :: "ab" :: "ba" :: "bb" :: Nil) + chunkValue, + dateValue, + dateStrValue) } test("getPartitionsByFilter: cast(ds as long)=20170101L and h=2") { @@ -179,39 +207,49 @@ class HivePartitionFilteringSuite(version: String) attr("ds").cast(LongType) === 20170101L && attr("h") === 2, 20170101 to 20170101, 2 to 2, - "aa" :: "ab" :: "ba" :: "bb" :: Nil) + chunkValue, + dateValue, + dateStrValue) } test("getPartitionsByFilter: ds=20170101 or ds=20170102") { testMetastorePartitionFiltering( attr("ds") === 20170101 || attr("ds") === 20170102, 20170101 to 20170102, - 0 to 4, - "aa" :: "ab" :: "ba" :: "bb" :: Nil) + hValue, + chunkValue, + dateValue, + dateStrValue) } test("getPartitionsByFilter: ds in (20170102, 20170103) (using IN expression)") { testMetastorePartitionFiltering( attr("ds").in(20170102, 20170103), 20170102 to 20170103, - 0 to 4, - "aa" :: "ab" :: "ba" :: "bb" :: Nil) + hValue, + chunkValue, + dateValue, + dateStrValue) } test("getPartitionsByFilter: cast(ds as long) in (20170102L, 20170103L) (using IN expression)") { testMetastorePartitionFiltering( attr("ds").cast(LongType).in(20170102L, 20170103L), 20170102 to 20170103, - 0 to 4, - "aa" :: "ab" :: "ba" :: "bb" :: Nil) + hValue, + chunkValue, + dateValue, + dateStrValue) } test("getPartitionsByFilter: ds in (20170102, 20170103) (using INSET expression)") { testMetastorePartitionFiltering( attr("ds").in(20170102, 20170103), 20170102 to 20170103, - 0 to 4, - "aa" :: "ab" :: "ba" :: "bb" :: Nil, { + hValue, + chunkValue, + dateValue, + dateStrValue, { case expr @ In(v, list) if expr.inSetConvertible => InSet(v, list.map(_.eval(EmptyRow)).toSet) }) @@ -222,8 +260,10 @@ class HivePartitionFilteringSuite(version: String) testMetastorePartitionFiltering( attr("ds").cast(LongType).in(20170102L, 20170103L), 20170102 to 20170103, - 0 to 4, - "aa" :: "ab" :: "ba" :: "bb" :: Nil, { + hValue, + chunkValue, + dateValue, + dateStrValue, { case expr @ In(v, list) if expr.inSetConvertible => InSet(v, list.map(_.eval(EmptyRow)).toSet) }) @@ -232,58 +272,307 @@ class HivePartitionFilteringSuite(version: String) test("getPartitionsByFilter: chunk in ('ab', 'ba') (using IN expression)") { testMetastorePartitionFiltering( attr("chunk").in("ab", "ba"), - 20170101 to 20170103, - 0 to 4, - "ab" :: "ba" :: Nil) + dsValue, + hValue, + "ab" :: "ba" :: Nil, + dateValue, + dateStrValue) } test("getPartitionsByFilter: chunk in ('ab', 'ba') (using INSET expression)") { testMetastorePartitionFiltering( attr("chunk").in("ab", "ba"), - 20170101 to 20170103, - 0 to 4, - "ab" :: "ba" :: Nil, { + dsValue, + hValue, + "ab" :: "ba" :: Nil, + dateValue, + dateStrValue, { case expr @ In(v, list) if expr.inSetConvertible => InSet(v, list.map(_.eval(EmptyRow)).toSet) }) } test("getPartitionsByFilter: (ds=20170101 and h>=2) or (ds=20170102 and h<2)") { - val day1 = (20170101 to 20170101, 2 to 4, Seq("aa", "ab", "ba", "bb")) - val day2 = (20170102 to 20170102, 0 to 1, Seq("aa", "ab", "ba", "bb")) + val day1 = (20170101 to 20170101, 2 to 4, chunkValue, dateValue, dateStrValue) + val day2 = (20170102 to 20170102, 0 to 1, chunkValue, dateValue, dateStrValue) testMetastorePartitionFiltering((attr("ds") === 20170101 && attr("h") >= 2) || (attr("ds") === 20170102 && attr("h") < 2), day1 :: day2 :: Nil) } test("getPartitionsByFilter: (ds=20170101 and h>=2) or (ds=20170102 and h<(1+1))") { - val day1 = (20170101 to 20170101, 2 to 4, Seq("aa", "ab", "ba", "bb")) + val day1 = (20170101 to 20170101, 2 to 4, chunkValue, dateValue, dateStrValue) // Day 2 should include all hours because we can't build a filter for h<(7+1) - val day2 = (20170102 to 20170102, 0 to 4, Seq("aa", "ab", "ba", "bb")) + val day2 = (20170102 to 20170102, 0 to 4, chunkValue, dateValue, dateStrValue) testMetastorePartitionFiltering((attr("ds") === 20170101 && attr("h") >= 2) || (attr("ds") === 20170102 && attr("h") < (Literal(1) + 1)), day1 :: day2 :: Nil) } test("getPartitionsByFilter: " + "chunk in ('ab', 'ba') and ((ds=20170101 and h>=2) or (ds=20170102 and h<2))") { - val day1 = (20170101 to 20170101, 2 to 4, Seq("ab", "ba")) - val day2 = (20170102 to 20170102, 0 to 1, Seq("ab", "ba")) + val day1 = (20170101 to 20170101, 2 to 4, Seq("ab", "ba"), dateValue, dateStrValue) + val day2 = (20170102 to 20170102, 0 to 1, Seq("ab", "ba"), dateValue, dateStrValue) testMetastorePartitionFiltering(attr("chunk").in("ab", "ba") && ((attr("ds") === 20170101 && attr("h") >= 2) || (attr("ds") === 20170102 && attr("h") < 2)), day1 :: day2 :: Nil) } - test("create client with sharesHadoopClasses = false") { - buildClient(new Configuration(), sharesHadoopClasses = false) + test("getPartitionsByFilter: chunk contains bb") { + testMetastorePartitionFiltering( + attr("chunk").contains("bb"), + dsValue, + hValue, + Seq("bb"), + dateValue, + dateStrValue) + } + + test("getPartitionsByFilter: chunk startsWith b") { + testMetastorePartitionFiltering( + attr("chunk").startsWith("b"), + dsValue, + hValue, + Seq("ba", "bb"), + dateValue, + dateStrValue) + } + + test("getPartitionsByFilter: chunk endsWith b") { + testMetastorePartitionFiltering( + attr("chunk").endsWith("b"), + dsValue, + hValue, + Seq("ab", "bb"), + dateValue, + dateStrValue) + } + + test("getPartitionsByFilter: chunk in ('ab', 'ba') and ((cast(ds as string)>'20170102')") { + testMetastorePartitionFiltering( + attr("chunk").in("ab", "ba") && (attr("ds").cast(StringType) > "20170102"), + dsValue, + hValue, + Seq("ab", "ba"), + dateValue, + dateStrValue) + } + + test("getPartitionsByFilter: ds<>20170101") { + testMetastorePartitionFiltering( + attr("ds") =!= 20170101, + 20170102 to 20170103, + hValue, + chunkValue, + dateValue, + dateStrValue) + } + + test("getPartitionsByFilter: h<>0 and chunk<>ab and d<>2019-01-01") { + testMetastorePartitionFiltering( + attr("h") =!= 0 && attr("chunk") =!= "ab" && attr("d") =!= Date.valueOf("2019-01-01"), + dsValue, + 1 to 4, + Seq("aa", "ba", "bb"), + Seq("2019-01-02", "2019-01-03"), + dateStrValue) + } + + test("getPartitionsByFilter: d=2019-01-01") { + testMetastorePartitionFiltering( + attr("d") === Date.valueOf("2019-01-01"), + dsValue, + hValue, + chunkValue, + Seq("2019-01-01"), + dateStrValue) + } + + test("getPartitionsByFilter: d>2019-01-02") { + testMetastorePartitionFiltering( + attr("d") > Date.valueOf("2019-01-02"), + dsValue, + hValue, + chunkValue, + Seq("2019-01-03"), + dateStrValue) + } + + test("getPartitionsByFilter: In(d, 2019-01-01, 2019-01-02)") { + testMetastorePartitionFiltering( + In(attr("d"), + Seq("2019-01-01", "2019-01-02").map(d => Literal(Date.valueOf(d)))), + dsValue, + hValue, + chunkValue, + Seq("2019-01-01", "2019-01-02"), + dateStrValue) + } + + test("getPartitionsByFilter: InSet(d, 2019-01-01, 2019-01-02)") { + testMetastorePartitionFiltering( + InSet(attr("d"), + Set("2019-01-01", "2019-01-02").map(d => Literal(Date.valueOf(d)).eval(EmptyRow))), + dsValue, + hValue, + chunkValue, + Seq("2019-01-01", "2019-01-02"), + dateStrValue) + } + + test("getPartitionsByFilter: not in/inset string type") { + def check(condition: Expression, result: Seq[String]): Unit = { + testMetastorePartitionFiltering( + condition, + dsValue, + hValue, + result, + dateValue, + dateStrValue + ) + } + + check( + Not(In(attr("chunk"), Seq(Literal("aa"), Literal("ab")))), + Seq("ba", "bb") + ) + check( + Not(In(attr("chunk"), Seq(Literal("aa"), Literal("ab"), Literal(null)))), + chunkValue + ) + + check( + Not(InSet(attr("chunk"), Set(Literal("aa").eval(), Literal("ab").eval()))), + Seq("ba", "bb") + ) + check( + Not(InSet(attr("chunk"), Set("aa", "ab", null))), + chunkValue + ) + } + + test("getPartitionsByFilter: not in/inset date type") { + def check(condition: Expression, result: Seq[String]): Unit = { + testMetastorePartitionFiltering( + condition, + dsValue, + hValue, + chunkValue, + result, + dateStrValue + ) + } + + check( + Not(In(attr("d"), + Seq(Literal(Date.valueOf("2019-01-01")), + Literal(Date.valueOf("2019-01-02"))))), + Seq("2019-01-03") + ) + check( + Not(In(attr("d"), + Seq(Literal(Date.valueOf("2019-01-01")), + Literal(Date.valueOf("2019-01-02")), Literal(null)))), + dateValue + ) + + check( + Not(InSet(attr("d"), + Set(Literal(Date.valueOf("2019-01-01")).eval(), + Literal(Date.valueOf("2019-01-02")).eval()))), + Seq("2019-01-03") + ) + check( + Not(InSet(attr("d"), + Set(Literal(Date.valueOf("2019-01-01")).eval(), + Literal(Date.valueOf("2019-01-02")).eval(), null))), + dateValue + ) + } + + test("getPartitionsByFilter: cast(datestr as date)= 2020-01-01") { + testMetastorePartitionFiltering( + attr("datestr").cast(DateType) === Date.valueOf("2020-01-01"), + dsValue, + hValue, + chunkValue, + dateValue, + dateStrValue) + } + + test("getPartitionsByFilter: IS NULL / IS NOT NULL") { + // returns all partitions + Seq(attr("d").isNull, attr("d").isNotNull).foreach { filterExpr => + testMetastorePartitionFiltering( + filterExpr, + dsValue, + hValue, + chunkValue, + dateValue, + dateStrValue) + } + } + + test("getPartitionsByFilter: IS NULL / IS NOT NULL with other filter") { + Seq(attr("d").isNull, attr("d").isNotNull).foreach { filterExpr => + testMetastorePartitionFiltering( + filterExpr && attr("d") === Date.valueOf("2019-01-01"), + dsValue, + hValue, + chunkValue, + Seq("2019-01-01"), + dateStrValue) + } + } + + test("getPartitionsByFilter: d =!= 2019-01-01") { + testMetastorePartitionFiltering( + attr("d") =!= Date.valueOf("2019-01-01"), + dsValue, + hValue, + chunkValue, + Seq("2019-01-02", "2019-01-03"), + dateStrValue) + } + + test("getPartitionsByFilter: d =!= 2019-01-01 || IS NULL") { + testMetastorePartitionFiltering( + attr("d") =!= Date.valueOf("2019-01-01") || attr("d").isNull, + dsValue, + hValue, + chunkValue, + dateValue, + dateStrValue) + } + + test("getPartitionsByFilter: d <=> 2019-01-01") { + testMetastorePartitionFiltering( + attr("d") <=> Date.valueOf("2019-01-01"), + dsValue, + hValue, + chunkValue, + dateValue, + dateStrValue) + } + + test("getPartitionsByFilter: d <=> null") { + testMetastorePartitionFiltering( + attr("d") <=> Literal(null, DateType), + dsValue, + hValue, + chunkValue, + dateValue, + dateStrValue) } private def testMetastorePartitionFiltering( filterExpr: Expression, expectedDs: Seq[Int], expectedH: Seq[Int], - expectedChunks: Seq[String]): Unit = { + expectedChunks: Seq[String], + expectedD: Seq[String], + expectedDatestr: Seq[String]): Unit = { testMetastorePartitionFiltering( filterExpr, - (expectedDs, expectedH, expectedChunks) :: Nil, + (expectedDs, expectedH, expectedChunks, expectedD, expectedDatestr) :: Nil, identity) } @@ -292,43 +581,51 @@ class HivePartitionFilteringSuite(version: String) expectedDs: Seq[Int], expectedH: Seq[Int], expectedChunks: Seq[String], + expectedD: Seq[String], + expectedDatestr: Seq[String], transform: Expression => Expression): Unit = { testMetastorePartitionFiltering( filterExpr, - (expectedDs, expectedH, expectedChunks) :: Nil, + (expectedDs, expectedH, expectedChunks, expectedD, expectedDatestr) :: Nil, transform) } private def testMetastorePartitionFiltering( filterExpr: Expression, - expectedPartitionCubes: Seq[(Seq[Int], Seq[Int], Seq[String])]): Unit = { + expectedPartitionCubes: + Seq[(Seq[Int], Seq[Int], Seq[String], Seq[String], Seq[String])]): Unit = { testMetastorePartitionFiltering(filterExpr, expectedPartitionCubes, identity) } private def testMetastorePartitionFiltering( filterExpr: Expression, - expectedPartitionCubes: Seq[(Seq[Int], Seq[Int], Seq[String])], + expectedPartitionCubes: Seq[(Seq[Int], Seq[Int], Seq[String], Seq[String], Seq[String])], transform: Expression => Expression): Unit = { val filteredPartitions = client.getPartitionsByFilter(client.getTable("default", "test"), Seq( transform(filterExpr) - )) + ), SQLConf.get.sessionLocalTimeZone) val expectedPartitionCount = expectedPartitionCubes.map { - case (expectedDs, expectedH, expectedChunks) => - expectedDs.size * expectedH.size * expectedChunks.size + case (expectedDs, expectedH, expectedChunks, expectedD, expectedDatestr) => + expectedDs.size * expectedH.size * expectedChunks.size * + expectedD.size * expectedDatestr.size }.sum val expectedPartitions = expectedPartitionCubes.map { - case (expectedDs, expectedH, expectedChunks) => + case (expectedDs, expectedH, expectedChunks, expectedD, expectedDatestr) => for { ds <- expectedDs h <- expectedH chunk <- expectedChunks + d <- expectedD + datestr <- expectedDatestr } yield Set( "ds" -> ds.toString, "h" -> h.toString, - "chunk" -> chunk + "chunk" -> chunk, + "d" -> d, + "datestr" -> datestr ) }.reduce(_ ++ _) diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveVersionSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveVersionSuite.scala index dd58c302e0197..02e9b7fb151fd 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveVersionSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/HiveVersionSuite.scala @@ -28,9 +28,7 @@ private[client] abstract class HiveVersionSuite(version: String) extends SparkFu override protected val enableAutoThreadAudit = false protected var client: HiveClient = null - protected def buildClient( - hadoopConf: Configuration, - sharesHadoopClasses: Boolean = true): HiveClient = { + protected def buildClient(hadoopConf: Configuration): HiveClient = { // Hive changed the default of datanucleus.schema.autoCreateAll from true to false and // hive.metastore.schema.verification from false to true since 2.0 // For details, see the JIRA HIVE-6113 and HIVE-12463 @@ -46,8 +44,7 @@ private[client] abstract class HiveVersionSuite(version: String) extends SparkFu HiveClientBuilder.buildClient( version, hadoopConf, - HiveUtils.formatTimeVarsForHiveClient(hadoopConf), - sharesHadoopClasses = sharesHadoopClasses) + HiveUtils.formatTimeVarsForHiveClient(hadoopConf)) } override def suiteName: String = s"${super.suiteName}($version)" diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/VersionsSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/VersionsSuite.scala index d1dd13623650d..b5500eaf47158 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/VersionsSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/client/VersionsSuite.scala @@ -33,7 +33,7 @@ import org.apache.spark.SparkFunSuite import org.apache.spark.internal.Logging import org.apache.spark.sql.{AnalysisException, Row} import org.apache.spark.sql.catalyst.{FunctionIdentifier, TableIdentifier} -import org.apache.spark.sql.catalyst.analysis.{NoSuchDatabaseException, NoSuchPermanentFunctionException} +import org.apache.spark.sql.catalyst.analysis.{NoSuchDatabaseException, NoSuchPermanentFunctionException, PartitionsAlreadyExistException} import org.apache.spark.sql.catalyst.catalog._ import org.apache.spark.sql.catalyst.expressions.{AttributeReference, EqualTo, Literal} import org.apache.spark.sql.catalyst.util.quietly @@ -41,7 +41,7 @@ import org.apache.spark.sql.hive.{HiveExternalCatalog, HiveUtils} import org.apache.spark.sql.hive.test.TestHiveVersion import org.apache.spark.sql.types.IntegerType import org.apache.spark.sql.types.StructType -import org.apache.spark.tags.ExtendedHiveTest +import org.apache.spark.tags.{ExtendedHiveTest, SlowHiveTest} import org.apache.spark.util.{MutableURLClassLoader, Utils} /** @@ -51,6 +51,7 @@ import org.apache.spark.util.{MutableURLClassLoader, Utils} * is not fully tested. */ // TODO: Refactor this to `HiveClientSuite` and make it a subclass of `HiveVersionSuite` +@SlowHiveTest @ExtendedHiveTest class VersionsSuite extends SparkFunSuite with Logging { @@ -487,7 +488,8 @@ class VersionsSuite extends SparkFunSuite with Logging { test(s"$version: getPartitionsByFilter") { // Only one partition [1, 1] for key2 == 1 val result = client.getPartitionsByFilter(client.getTable("default", "src_part"), - Seq(EqualTo(AttributeReference("key2", IntegerType)(), Literal(1)))) + Seq(EqualTo(AttributeReference("key2", IntegerType)(), Literal(1))), + versionSpark.conf.sessionLocalTimeZone) // Hive 0.12 doesn't support getPartitionsByFilter, it ignores the filter condition. if (version != "0.12") { @@ -592,6 +594,27 @@ class VersionsSuite extends SparkFunSuite with Logging { assert(client.getPartitionOption("default", "src_part", spec).isEmpty) } + test(s"$version: createPartitions if already exists") { + val partitions = Seq(CatalogTablePartition( + Map("key1" -> "101", "key2" -> "102"), + storageFormat)) + try { + client.createPartitions("default", "src_part", partitions, ignoreIfExists = false) + val errMsg = intercept[PartitionsAlreadyExistException] { + client.createPartitions("default", "src_part", partitions, ignoreIfExists = false) + }.getMessage + assert(errMsg.contains("partitions already exists")) + } finally { + client.dropPartitions( + "default", + "src_part", + partitions.map(_.spec), + ignoreIfNotExists = true, + purge = false, + retainData = false) + } + } + /////////////////////////////////////////////////////////////////////////// // Function related API /////////////////////////////////////////////////////////////////////////// @@ -796,6 +819,7 @@ class VersionsSuite extends SparkFunSuite with Logging { versionSpark.sql( """ |CREATE TABLE tbl(c1 string) + |USING hive |PARTITIONED BY (ds STRING) """.stripMargin) versionSpark.sql("INSERT OVERWRITE TABLE tbl partition (ds='2') SELECT '1'") @@ -982,7 +1006,7 @@ class VersionsSuite extends SparkFunSuite with Logging { """.stripMargin ) - val errorMsg = "Cannot safely cast 'f0': DecimalType(2,1) to BinaryType" + val errorMsg = "Cannot safely cast 'f0': decimal(2,1) to binary" if (isPartitioned) { val insertStmt = s"INSERT OVERWRITE TABLE $tableName partition (ds='a') SELECT 1.3" diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/AggregationQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/AggregationQuerySuite.scala index fac981267f4d7..70dcfb05c2ba9 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/AggregationQuerySuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/AggregationQuerySuite.scala @@ -31,6 +31,7 @@ import org.apache.spark.sql.hive.test.TestHiveSingleton import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SQLTestUtils import org.apache.spark.sql.types._ +import org.apache.spark.tags.SlowHiveTest import org.apache.spark.unsafe.UnsafeAlignedOffset @@ -780,7 +781,7 @@ abstract class AggregationQuerySuite extends QueryTest with SQLTestUtils with Te assert(math.abs(corr6 + 1.0) < 1e-12) // Test for udaf_corr in HiveCompatibilitySuite - // udaf_corr has been blacklisted due to numerical errors + // udaf_corr has been excluded due to numerical errors // We test it here: // SELECT corr(b, c) FROM covar_tab WHERE a < 1; => NULL // SELECT corr(b, c) FROM covar_tab WHERE a < 3; => NULL @@ -824,7 +825,7 @@ abstract class AggregationQuerySuite extends QueryTest with SQLTestUtils with Te """ |SELECT corr(b, c) FROM covar_tab WHERE a = 3 """.stripMargin), - Row(Double.NaN) :: Nil) + Row(null) :: Nil) checkAnswer( spark.sql( @@ -833,10 +834,10 @@ abstract class AggregationQuerySuite extends QueryTest with SQLTestUtils with Te """.stripMargin), Row(1, null) :: Row(2, null) :: - Row(3, Double.NaN) :: - Row(4, Double.NaN) :: - Row(5, Double.NaN) :: - Row(6, Double.NaN) :: Nil) + Row(3, null) :: + Row(4, null) :: + Row(5, null) :: + Row(6, null) :: Nil) val corr7 = spark.sql("SELECT corr(b, c) FROM covar_tab").collect()(0).getDouble(0) assert(math.abs(corr7 - 0.6633880657639323) < 1e-12) @@ -868,7 +869,7 @@ abstract class AggregationQuerySuite extends QueryTest with SQLTestUtils with Te // one row test val df3 = Seq.tabulate(1)(x => (1 * x, x * x * x - 2)).toDF("a", "b") - checkAnswer(df3.groupBy().agg(covar_samp("a", "b")), Row(Double.NaN)) + checkAnswer(df3.groupBy().agg(covar_samp("a", "b")), Row(null)) checkAnswer(df3.groupBy().agg(covar_pop("a", "b")), Row(0.0)) } @@ -1054,6 +1055,7 @@ abstract class AggregationQuerySuite extends QueryTest with SQLTestUtils with Te class HashAggregationQuerySuite extends AggregationQuerySuite +@SlowHiveTest class HashAggregationQueryWithControlledFallbackSuite extends AggregationQuerySuite { override protected def checkAnswer(actual: => DataFrame, expectedAnswer: Seq[Row]): Unit = { diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveCommandSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveCommandSuite.scala index dcec8bf5c0cc6..8834006888576 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveCommandSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveCommandSuite.scala @@ -22,9 +22,8 @@ import java.io.File import com.google.common.io.Files import org.apache.hadoop.fs.{FileContext, FsConstants, Path} -import org.apache.spark.sql.{AnalysisException, QueryTest, Row, SaveMode} +import org.apache.spark.sql.{AnalysisException, QueryTest, Row} import org.apache.spark.sql.catalyst.TableIdentifier -import org.apache.spark.sql.catalyst.analysis.NoSuchTableException import org.apache.spark.sql.catalyst.catalog.{CatalogStorageFormat, CatalogTable, CatalogTableType} import org.apache.spark.sql.execution.command.LoadDataCommand import org.apache.spark.sql.hive.test.TestHiveSingleton @@ -33,7 +32,6 @@ import org.apache.spark.sql.test.SQLTestUtils import org.apache.spark.sql.types.StructType class HiveCommandSuite extends QueryTest with SQLTestUtils with TestHiveSingleton { - import testImplicits._ protected override def beforeAll(): Unit = { super.beforeAll() @@ -58,27 +56,11 @@ class HiveCommandSuite extends QueryTest with SQLTestUtils with TestHiveSingleto |STORED AS PARQUET |TBLPROPERTIES('prop1Key'="prop1Val", '`prop2Key`'="prop2Val") """.stripMargin) - sql("CREATE TABLE parquet_tab3(col1 int, `col 2` int) USING hive") sql("CREATE TABLE parquet_tab4 (price int, qty int) partitioned by (year int, month int)") sql("INSERT INTO parquet_tab4 PARTITION(year = 2015, month = 1) SELECT 1, 1") sql("INSERT INTO parquet_tab4 PARTITION(year = 2015, month = 2) SELECT 2, 2") sql("INSERT INTO parquet_tab4 PARTITION(year = 2016, month = 2) SELECT 3, 3") sql("INSERT INTO parquet_tab4 PARTITION(year = 2016, month = 3) SELECT 3, 3") - sql( - """ - |CREATE TABLE parquet_tab5 (price int, qty int) - |PARTITIONED BY (year int, month int, hour int, minute int, sec int, extra int) - """.stripMargin) - sql( - """ - |INSERT INTO parquet_tab5 - |PARTITION(year = 2016, month = 3, hour = 10, minute = 10, sec = 10, extra = 1) SELECT 3, 3 - """.stripMargin) - sql( - """ - |INSERT INTO parquet_tab5 - |PARTITION(year = 2016, month = 4, hour = 10, minute = 10, sec = 10, extra = 1) SELECT 3, 3 - """.stripMargin) sql("CREATE VIEW parquet_view1 as select * from parquet_tab4") } @@ -86,37 +68,13 @@ class HiveCommandSuite extends QueryTest with SQLTestUtils with TestHiveSingleto try { sql("DROP TABLE IF EXISTS parquet_tab1") sql("DROP TABLE IF EXISTS parquet_tab2") - sql("DROP TABLE IF EXISTS parquet_tab3") sql("DROP VIEW IF EXISTS parquet_view1") sql("DROP TABLE IF EXISTS parquet_tab4") - sql("DROP TABLE IF EXISTS parquet_tab5") } finally { super.afterAll() } } - test("show tables") { - withTable("show1a", "show2b") { - sql("CREATE TABLE show1a(c1 int)") - sql("CREATE TABLE show2b(c2 int)") - checkAnswer( - sql("SHOW TABLES IN default 'show1*'"), - Row("default", "show1a", false) :: Nil) - checkAnswer( - sql("SHOW TABLES IN default 'show1*|show2*'"), - Row("default", "show1a", false) :: - Row("default", "show2b", false) :: Nil) - checkAnswer( - sql("SHOW TABLES 'show1*|show2*'"), - Row("default", "show1a", false) :: - Row("default", "show2b", false) :: Nil) - assert( - sql("SHOW TABLES").count() >= 2) - assert( - sql("SHOW TABLES IN default").count() >= 2) - } - } - test("show views") { withView("show1a", "show2b", "global_temp.temp1", "temp2") { sql("CREATE VIEW show1a AS SELECT 1 AS id") @@ -171,7 +129,7 @@ class HiveCommandSuite extends QueryTest with SQLTestUtils with TestHiveSingleto checkAnswer( sql(s"SHOW TBLPROPERTIES parquet_tab1('my_key1')"), - Row("v1") :: Nil + Row("my_key1", "v1") :: Nil ) } @@ -184,13 +142,23 @@ class HiveCommandSuite extends QueryTest with SQLTestUtils with TestHiveSingleto // When key is not found, a row containing the error is returned. checkAnswer( sql("SHOW TBLPROPERTIES parquet_tab1('invalid.prop.key')"), - Row("Table default.parquet_tab1 does not have property: invalid.prop.key") :: Nil + Row("invalid.prop.key", + "Table default.parquet_tab1 does not have property: invalid.prop.key") :: Nil ) } - test("show tblproperties for hive table") { - checkAnswer(sql("SHOW TBLPROPERTIES parquet_tab2('prop1Key')"), Row("prop1Val")) - checkAnswer(sql("SHOW TBLPROPERTIES parquet_tab2('`prop2Key`')"), Row("prop2Val")) + test("SPARK-34240 Unify output of SHOW TBLPROPERTIES and pass output attributes properly") { + checkAnswer(sql("SHOW TBLPROPERTIES parquet_tab2").filter("key != 'transient_lastDdlTime'"), + Row("prop1Key", "prop1Val") :: Row("`prop2Key`", "prop2Val") :: Nil) + checkAnswer(sql("SHOW TBLPROPERTIES parquet_tab2('prop1Key')"), Row("prop1Key", "prop1Val")) + checkAnswer(sql("SHOW TBLPROPERTIES parquet_tab2('`prop2Key`')"), Row("`prop2Key`", "prop2Val")) + withSQLConf(SQLConf.LEGACY_KEEP_COMMAND_OUTPUT_SCHEMA.key -> "true") { + checkAnswer(sql("SHOW TBLPROPERTIES parquet_tab2").filter("key != 'transient_lastDdlTime'"), + Row("prop1Key", "prop1Val") :: Row("`prop2Key`", "prop2Val") :: Nil) + checkAnswer(sql("SHOW TBLPROPERTIES parquet_tab2('prop1Key')"), Row("prop1Val")) + checkAnswer(sql("SHOW TBLPROPERTIES parquet_tab2('`prop2Key`')"), + Row("prop2Val")) + } } Seq(true, false).foreach { local => @@ -349,154 +317,6 @@ class HiveCommandSuite extends QueryTest with SQLTestUtils with TestHiveSingleto } } - test("Truncate Table") { - withTable("non_part_table", "part_table") { - sql( - """ - |CREATE TABLE non_part_table (employeeID INT, employeeName STRING) - |ROW FORMAT DELIMITED - |FIELDS TERMINATED BY '|' - |LINES TERMINATED BY '\n' - """.stripMargin) - - val testData = hiveContext.getHiveFile("data/files/employee.dat").toURI - - sql(s"""LOAD DATA LOCAL INPATH "$testData" INTO TABLE non_part_table""") - checkAnswer( - sql("SELECT * FROM non_part_table WHERE employeeID = 16"), - Row(16, "john") :: Nil) - - val testResults = sql("SELECT * FROM non_part_table").collect() - - sql("TRUNCATE TABLE non_part_table") - checkAnswer(sql("SELECT * FROM non_part_table"), Seq.empty[Row]) - - sql( - """ - |CREATE TABLE part_table (employeeID INT, employeeName STRING) - |PARTITIONED BY (c STRING, d STRING) - |ROW FORMAT DELIMITED - |FIELDS TERMINATED BY '|' - |LINES TERMINATED BY '\n' - """.stripMargin) - - sql(s"""LOAD DATA LOCAL INPATH "$testData" INTO TABLE part_table PARTITION(c="1", d="1")""") - checkAnswer( - sql("SELECT employeeID, employeeName FROM part_table WHERE c = '1' AND d = '1'"), - testResults) - - sql(s"""LOAD DATA LOCAL INPATH "$testData" INTO TABLE part_table PARTITION(c="1", d="2")""") - checkAnswer( - sql("SELECT employeeID, employeeName FROM part_table WHERE c = '1' AND d = '2'"), - testResults) - - sql(s"""LOAD DATA LOCAL INPATH "$testData" INTO TABLE part_table PARTITION(c="2", d="2")""") - checkAnswer( - sql("SELECT employeeID, employeeName FROM part_table WHERE c = '2' AND d = '2'"), - testResults) - - sql("TRUNCATE TABLE part_table PARTITION(c='1', d='1')") - checkAnswer( - sql("SELECT employeeID, employeeName FROM part_table WHERE c = '1' AND d = '1'"), - Seq.empty[Row]) - checkAnswer( - sql("SELECT employeeID, employeeName FROM part_table WHERE c = '1' AND d = '2'"), - testResults) - - sql("TRUNCATE TABLE part_table PARTITION(c='1')") - checkAnswer( - sql("SELECT employeeID, employeeName FROM part_table WHERE c = '1'"), - Seq.empty[Row]) - - sql("TRUNCATE TABLE part_table") - checkAnswer( - sql("SELECT employeeID, employeeName FROM part_table"), - Seq.empty[Row]) - } - } - - - test("show partitions - show everything") { - checkAnswer( - sql("show partitions parquet_tab4"), - Row("year=2015/month=1") :: - Row("year=2015/month=2") :: - Row("year=2016/month=2") :: - Row("year=2016/month=3") :: Nil) - - checkAnswer( - sql("show partitions default.parquet_tab4"), - Row("year=2015/month=1") :: - Row("year=2015/month=2") :: - Row("year=2016/month=2") :: - Row("year=2016/month=3") :: Nil) - } - - test("show partitions - show everything more than 5 part keys") { - checkAnswer( - sql("show partitions parquet_tab5"), - Row("year=2016/month=3/hour=10/minute=10/sec=10/extra=1") :: - Row("year=2016/month=4/hour=10/minute=10/sec=10/extra=1") :: Nil) - } - - test("show partitions - filter") { - checkAnswer( - sql("show partitions default.parquet_tab4 PARTITION(year=2015)"), - Row("year=2015/month=1") :: - Row("year=2015/month=2") :: Nil) - - checkAnswer( - sql("show partitions default.parquet_tab4 PARTITION(year=2015, month=1)"), - Row("year=2015/month=1") :: Nil) - - checkAnswer( - sql("show partitions default.parquet_tab4 PARTITION(month=2)"), - Row("year=2015/month=2") :: - Row("year=2016/month=2") :: Nil) - } - - test("show partitions - empty row") { - withTempView("parquet_temp") { - sql( - """ - |CREATE TEMPORARY VIEW parquet_temp (c1 INT, c2 STRING) - |USING org.apache.spark.sql.parquet.DefaultSource - """.stripMargin) - // An empty sequence of row is returned for session temporary table. - intercept[NoSuchTableException] { - sql("SHOW PARTITIONS parquet_temp") - } - - val message1 = intercept[AnalysisException] { - sql("SHOW PARTITIONS parquet_tab3") - }.getMessage - assert(message1.contains("not allowed on a table that is not partitioned")) - - val message2 = intercept[AnalysisException] { - sql("SHOW PARTITIONS parquet_tab4 PARTITION(abcd=2015, xyz=1)") - }.getMessage - assert(message2.contains("Non-partitioning column(s) [abcd, xyz] are specified")) - - val message3 = intercept[AnalysisException] { - sql("SHOW PARTITIONS parquet_view1") - }.getMessage - assert(message3.contains("is not allowed on a view")) - } - } - - test("show partitions - datasource") { - withTable("part_datasrc") { - val df = (1 to 3).map(i => (i, s"val_$i", i * 2)).toDF("a", "b", "c") - df.write - .partitionBy("a") - .format("parquet") - .mode(SaveMode.Overwrite) - .saveAsTable("part_datasrc") - - assert(sql("SHOW PARTITIONS part_datasrc").count() == 3) - } - } - test("SPARK-25918: LOAD DATA LOCAL INPATH should handle a relative path") { val localFS = FileContext.getLocalFSFileContext() val workingDir = localFS.getWorkingDirectory diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveComparisonTest.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveComparisonTest.scala index 2e4c01830432f..67b51f9347827 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveComparisonTest.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveComparisonTest.scala @@ -171,7 +171,7 @@ abstract class HiveComparisonTest extends SparkFunSuite with BeforeAndAfterAll { // and does not return it as a query answer. case _: SetCommand => Seq("0") case _: ExplainCommand => answer - case _: DescribeCommandBase | ShowColumnsCommand(_, _) => + case _: DescribeCommandBase | ShowColumnsCommand(_, _, _) => // Filter out non-deterministic lines and lines which do not have actual results but // can introduce problems because of the way Hive formats these lines. // Then, remove empty lines. Do not sort the results. @@ -371,11 +371,11 @@ abstract class HiveComparisonTest extends SparkFunSuite with BeforeAndAfterAll { // We will ignore the ExplainCommand, ShowFunctions, DescribeFunction if ((!hiveQuery.logical.isInstanceOf[ExplainCommand]) && - (!hiveQuery.logical.isInstanceOf[ShowFunctionsStatement]) && - (!hiveQuery.logical.isInstanceOf[DescribeFunctionStatement]) && + (!hiveQuery.logical.isInstanceOf[ShowFunctions]) && + (!hiveQuery.logical.isInstanceOf[DescribeFunction]) && (!hiveQuery.logical.isInstanceOf[DescribeCommandBase]) && (!hiveQuery.logical.isInstanceOf[DescribeRelation]) && - (!hiveQuery.logical.isInstanceOf[DescribeColumnStatement]) && + (!hiveQuery.logical.isInstanceOf[DescribeColumn]) && preparedHive != catalyst) { val hivePrintOut = s"== HIVE - ${preparedHive.size} row(s) ==" +: preparedHive diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala index e8548fd62ddc1..9a39f1872be09 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveDDLSuite.scala @@ -19,34 +19,38 @@ package org.apache.spark.sql.hive.execution import java.io.File import java.net.URI +import java.util.Locale import org.apache.hadoop.fs.Path import org.apache.parquet.format.converter.ParquetMetadataConverter.NO_FILTER -import org.apache.parquet.hadoop.ParquetFileReader import org.scalatest.BeforeAndAfterEach import org.apache.spark.SparkException import org.apache.spark.sql.{AnalysisException, QueryTest, Row, SaveMode} import org.apache.spark.sql.catalyst.TableIdentifier -import org.apache.spark.sql.catalyst.analysis.{NoSuchPartitionException, TableAlreadyExistsException} +import org.apache.spark.sql.catalyst.analysis.TableAlreadyExistsException import org.apache.spark.sql.catalyst.catalog._ import org.apache.spark.sql.catalyst.parser.ParseException +import org.apache.spark.sql.connector.FakeV2Provider import org.apache.spark.sql.connector.catalog.CatalogManager import org.apache.spark.sql.connector.catalog.SupportsNamespaces.PROP_OWNER import org.apache.spark.sql.execution.command.{DDLSuite, DDLUtils} +import org.apache.spark.sql.execution.datasources.parquet.ParquetFooterReader import org.apache.spark.sql.functions._ import org.apache.spark.sql.hive.HiveExternalCatalog import org.apache.spark.sql.hive.HiveUtils.{CONVERT_METASTORE_ORC, CONVERT_METASTORE_PARQUET} import org.apache.spark.sql.hive.orc.OrcFileOperator -import org.apache.spark.sql.hive.test.TestHiveSingleton +import org.apache.spark.sql.hive.test.{TestHive, TestHiveSingleton, TestHiveSparkSession} import org.apache.spark.sql.internal.{HiveSerDe, SQLConf} import org.apache.spark.sql.internal.SQLConf.ORC_IMPLEMENTATION import org.apache.spark.sql.internal.StaticSQLConf.CATALOG_IMPLEMENTATION import org.apache.spark.sql.test.SQLTestUtils import org.apache.spark.sql.types._ +import org.apache.spark.tags.SlowHiveTest import org.apache.spark.util.Utils // TODO(gatorsmile): combine HiveCatalogedDDLSuite and HiveDDLSuite +@SlowHiveTest class HiveCatalogedDDLSuite extends DDLSuite with TestHiveSingleton with BeforeAndAfterEach { override def afterEach(): Unit = { try { @@ -125,7 +129,7 @@ class HiveCatalogedDDLSuite extends DDLSuite with TestHiveSingleton with BeforeA createTime = 0L, lastAccessTime = 0L, owner = "", - properties = table.properties.filterKeys(!nondeterministicProps.contains(_)), + properties = table.properties.filterKeys(!nondeterministicProps.contains(_)).toMap, // View texts are checked separately viewText = None ) @@ -155,22 +159,6 @@ class HiveCatalogedDDLSuite extends DDLSuite with TestHiveSingleton with BeforeA testChangeColumn(isDatasourceTable = false) } - test("alter table: rename partition") { - testRenamePartitions(isDatasourceTable = false) - } - - test("alter table: drop partition") { - testDropPartitions(isDatasourceTable = false) - } - - test("alter table: add partition") { - testAddPartitions(isDatasourceTable = false) - } - - test("drop table") { - testDropTable(isDatasourceTable = false) - } - test("alter datasource table add columns - orc") { testAddColumn("orc") } @@ -381,11 +369,11 @@ class HiveCatalogedDDLSuite extends DDLSuite with TestHiveSingleton with BeforeA val db = "spark_29425_1" sql(s"CREATE DATABASE $db") assert(sql(s"DESCRIBE DATABASE EXTENDED $db") - .where("database_description_item='Owner'") + .where("info_name='Owner'") .collect().head.getString(1) === Utils.getCurrentUserName()) sql(s"ALTER DATABASE $db SET DBPROPERTIES('abc'='xyz')") assert(sql(s"DESCRIBE DATABASE EXTENDED $db") - .where("database_description_item='Owner'") + .where("info_name='Owner'") .collect().head.getString(1) === Utils.getCurrentUserName()) } finally { catalog.reset() @@ -404,6 +392,7 @@ class HiveCatalogedDDLSuite extends DDLSuite with TestHiveSingleton with BeforeA } } +@SlowHiveTest class HiveDDLSuite extends QueryTest with SQLTestUtils with TestHiveSingleton with BeforeAndAfterEach { import testImplicits._ @@ -454,15 +443,15 @@ class HiveDDLSuite withTable("tab1", "tab2") { (("a", "b") :: Nil).toDF().write.json(tempDir.getCanonicalPath) - var e = intercept[AnalysisException] { sql("CREATE TABLE tab1 USING hive") }.getMessage - assert(e.contains("Unable to infer the schema. The schema specification is required to " + - "create the table `default`.`tab1`")) + assertAnalysisError( + "CREATE TABLE tab1 USING hive", + "Unable to infer the schema. The schema specification is required to " + + "create the table `default`.`tab1`") - e = intercept[AnalysisException] { - sql(s"CREATE TABLE tab2 USING hive location '${tempDir.getCanonicalPath}'") - }.getMessage - assert(e.contains("Unable to infer the schema. The schema specification is required to " + - "create the table `default`.`tab2`")) + assertAnalysisError( + s"CREATE TABLE tab2 USING hive location '${tempDir.getCanonicalPath}'", + "Unable to infer the schema. The schema specification is required to " + + "create the table `default`.`tab2`") } } } @@ -584,26 +573,23 @@ class HiveDDLSuite } test("create table: partition column names exist in table definition") { - val e = intercept[AnalysisException] { - sql("CREATE TABLE tbl(a int) PARTITIONED BY (a string)") - } - assert(e.message == "Found duplicate column(s) in the table definition of `default`.`tbl`: `a`") + assertAnalysisError( + "CREATE TABLE tbl(a int) PARTITIONED BY (a string)", + "Found duplicate column(s) in the table definition of `default`.`tbl`: `a`") } test("create partitioned table without specifying data type for the partition columns") { - val e = intercept[AnalysisException] { - sql("CREATE TABLE tbl(a int) PARTITIONED BY (b) STORED AS parquet") - } - assert(e.message.contains("Must specify a data type for each partition column while creating " + - "Hive partitioned table.")) + assertAnalysisError( + "CREATE TABLE tbl(a int) PARTITIONED BY (b) STORED AS parquet", + "partition column b is not defined in table") } test("add/drop partition with location - managed table") { val tab = "tab_with_partitions" withTempDir { tmpDir => val basePath = new File(tmpDir.getCanonicalPath) - val part1Path = new File(basePath + "/part1") - val part2Path = new File(basePath + "/part2") + val part1Path = new File(new File(basePath, "part10"), "part11") + val part2Path = new File(new File(basePath, "part20"), "part21") val dirSet = part1Path :: part2Path :: Nil // Before data insertion, all the directory are empty @@ -647,11 +633,10 @@ class HiveDDLSuite test("SPARK-19129: drop partition with a empty string will drop the whole table") { val df = spark.createDataFrame(Seq((0, "a"), (1, "b"))).toDF("partCol1", "name") df.write.mode("overwrite").partitionBy("partCol1").saveAsTable("partitionedTable") - val e = intercept[AnalysisException] { - spark.sql("alter table partitionedTable drop partition(partCol1='')") - }.getMessage - assert(e.contains("Partition spec is invalid. The spec ([partCol1=]) contains an empty " + - "partition column value")) + assertAnalysisError( + "alter table partitionedTable drop partition(partCol1='')", + "Partition spec is invalid. The spec ([partCol1=]) contains an empty " + + "partition column value") } test("add/drop partitions - external table") { @@ -696,11 +681,10 @@ class HiveDDLSuite // After data insertion, all the directory are not empty assert(dirSet.forall(dir => dir.listFiles.nonEmpty)) - val message = intercept[AnalysisException] { - sql(s"ALTER TABLE $externalTab DROP PARTITION (ds='2008-04-09', unknownCol='12')") - } - assert(message.getMessage.contains("unknownCol is not a valid partition column in table " + - "`default`.`exttable_with_partitions`")) + assertAnalysisError( + s"ALTER TABLE $externalTab DROP PARTITION (ds='2008-04-09', unknownCol='12')", + "unknownCol is not a valid partition column in table " + + "`default`.`exttable_with_partitions`") sql( s""" @@ -802,15 +786,18 @@ class HiveDDLSuite sql(s"ALTER VIEW $viewName UNSET TBLPROPERTIES ('p')") checkProperties(Map()) - val message = intercept[AnalysisException] { - sql(s"ALTER VIEW $viewName UNSET TBLPROPERTIES ('p')") - }.getMessage - assert(message.contains( - "Attempted to unset non-existent property 'p' in table '`default`.`view1`'")) + assertAnalysisError( + s"ALTER VIEW $viewName UNSET TBLPROPERTIES ('p')", + "Attempted to unset non-existent property 'p' in table '`default`.`view1`'") } } } + private def assertAnalysisError(sqlText: String, message: String): Unit = { + val e = intercept[AnalysisException](sql(sqlText)) + assert(e.message.contains(message)) + } + private def assertErrorForAlterTableOnView(sqlText: String): Unit = { val message = intercept[AnalysisException](sql(sqlText)).getMessage assert(message.contains("Cannot alter a view with ALTER TABLE. Please use ALTER VIEW instead")) @@ -821,13 +808,26 @@ class HiveDDLSuite assert(message.contains("Cannot alter a table with ALTER VIEW. Please use ALTER TABLE instead")) } + private def assertErrorForAlterTableOnView( + sqlText: String, viewName: String, cmdName: String): Unit = { + assertAnalysisError( + sqlText, + s"$viewName is a view. '$cmdName' expects a table. Please use ALTER VIEW instead.") + } + + private def assertErrorForAlterViewOnTable( + sqlText: String, tableName: String, cmdName: String): Unit = { + assertAnalysisError( + sqlText, + s"$tableName is a table. '$cmdName' expects a view. Please use ALTER TABLE instead.") + } + test("create table - SET TBLPROPERTIES EXTERNAL to TRUE") { val tabName = "tab1" withTable(tabName) { - val message = intercept[AnalysisException] { - sql(s"CREATE TABLE $tabName (height INT, length INT) TBLPROPERTIES('EXTERNAL'='TRUE')") - }.getMessage - assert(message.contains("Cannot set or change the preserved property key: 'EXTERNAL'")) + assertAnalysisError( + s"CREATE TABLE $tabName (height INT, length INT) TBLPROPERTIES('EXTERNAL'='TRUE')", + "Cannot set or change the preserved property key: 'EXTERNAL'") } } @@ -838,10 +838,9 @@ class HiveDDLSuite sql(s"CREATE TABLE $tabName (height INT, length INT)") assert( catalog.getTableMetadata(TableIdentifier(tabName)).tableType == CatalogTableType.MANAGED) - val message = intercept[AnalysisException] { - sql(s"ALTER TABLE $tabName SET TBLPROPERTIES ('EXTERNAL' = 'TRUE')") - }.getMessage - assert(message.contains("Cannot set or change the preserved property key: 'EXTERNAL'")) + assertAnalysisError( + s"ALTER TABLE $tabName SET TBLPROPERTIES ('EXTERNAL' = 'TRUE')", + "Cannot set or change the preserved property key: 'EXTERNAL'") // The table type is not changed to external assert( catalog.getTableMetadata(TableIdentifier(tabName)).tableType == CatalogTableType.MANAGED) @@ -871,32 +870,65 @@ class HiveDDLSuite assertErrorForAlterTableOnView(s"ALTER TABLE $oldViewName RENAME TO $newViewName") - assertErrorForAlterViewOnTable(s"ALTER VIEW $tabName SET TBLPROPERTIES ('p' = 'an')") + assertErrorForAlterViewOnTable( + s"ALTER VIEW $tabName SET TBLPROPERTIES ('p' = 'an')", + tabName, + "ALTER VIEW ... SET TBLPROPERTIES") - assertErrorForAlterTableOnView(s"ALTER TABLE $oldViewName SET TBLPROPERTIES ('p' = 'an')") + assertErrorForAlterTableOnView( + s"ALTER TABLE $oldViewName SET TBLPROPERTIES ('p' = 'an')", + oldViewName, + "ALTER TABLE ... SET TBLPROPERTIES") - assertErrorForAlterViewOnTable(s"ALTER VIEW $tabName UNSET TBLPROPERTIES ('p')") + assertErrorForAlterViewOnTable( + s"ALTER VIEW $tabName UNSET TBLPROPERTIES ('p')", + tabName, + "ALTER VIEW ... UNSET TBLPROPERTIES") - assertErrorForAlterTableOnView(s"ALTER TABLE $oldViewName UNSET TBLPROPERTIES ('p')") + assertErrorForAlterTableOnView( + s"ALTER TABLE $oldViewName UNSET TBLPROPERTIES ('p')", + oldViewName, + "ALTER TABLE ... UNSET TBLPROPERTIES") - assertErrorForAlterTableOnView(s"ALTER TABLE $oldViewName SET LOCATION '/path/to/home'") + assertErrorForAlterTableOnView( + s"ALTER TABLE $oldViewName SET LOCATION '/path/to/home'", + oldViewName, + "ALTER TABLE ... SET LOCATION ...") - assertErrorForAlterTableOnView(s"ALTER TABLE $oldViewName SET SERDE 'whatever'") + assertErrorForAlterTableOnView( + s"ALTER TABLE $oldViewName SET SERDE 'whatever'", + oldViewName, + "ALTER TABLE ... SET [SERDE|SERDEPROPERTIES]") - assertErrorForAlterTableOnView(s"ALTER TABLE $oldViewName SET SERDEPROPERTIES ('x' = 'y')") + assertErrorForAlterTableOnView( + s"ALTER TABLE $oldViewName SET SERDEPROPERTIES ('x' = 'y')", + oldViewName, + "ALTER TABLE ... SET [SERDE|SERDEPROPERTIES]") assertErrorForAlterTableOnView( - s"ALTER TABLE $oldViewName PARTITION (a=1, b=2) SET SERDEPROPERTIES ('x' = 'y')") + s"ALTER TABLE $oldViewName PARTITION (a=1, b=2) SET SERDEPROPERTIES ('x' = 'y')", + oldViewName, + "ALTER TABLE ... SET [SERDE|SERDEPROPERTIES]") assertErrorForAlterTableOnView( - s"ALTER TABLE $oldViewName ADD IF NOT EXISTS PARTITION (a='4', b='8')") + s"ALTER TABLE $oldViewName RECOVER PARTITIONS", + oldViewName, + "ALTER TABLE ... RECOVER PARTITIONS") - assertErrorForAlterTableOnView(s"ALTER TABLE $oldViewName DROP IF EXISTS PARTITION (a='2')") + assertErrorForAlterTableOnView( + s"ALTER TABLE $oldViewName PARTITION (a='1') RENAME TO PARTITION (a='100')", + oldViewName, + "ALTER TABLE ... RENAME TO PARTITION") - assertErrorForAlterTableOnView(s"ALTER TABLE $oldViewName RECOVER PARTITIONS") + assertErrorForAlterTableOnView( + s"ALTER TABLE $oldViewName ADD IF NOT EXISTS PARTITION (a='4', b='8')", + oldViewName, + "ALTER TABLE ... ADD PARTITION ...") assertErrorForAlterTableOnView( - s"ALTER TABLE $oldViewName PARTITION (a='1') RENAME TO PARTITION (a='100')") + s"ALTER TABLE $oldViewName DROP IF EXISTS PARTITION (a='2')", + oldViewName, + "ALTER TABLE ... DROP PARTITION ...") assert(catalog.tableExists(TableIdentifier(tabName))) assert(catalog.tableExists(TableIdentifier(oldViewName))) @@ -973,7 +1005,7 @@ class HiveDDLSuite } test("alter table partition - storage information") { - sql("CREATE TABLE boxes (height INT, length INT) PARTITIONED BY (width INT)") + sql("CREATE TABLE boxes (height INT, length INT) STORED AS textfile PARTITIONED BY (width INT)") sql("INSERT OVERWRITE TABLE boxes PARTITION (width=4) SELECT 4, 4") val catalog = spark.sessionState.catalog val expectedSerde = "com.sparkbricks.serde.ColumnarSerDe" @@ -990,7 +1022,7 @@ class HiveDDLSuite |""".stripMargin) val newPart = catalog.getPartition(TableIdentifier("boxes"), Map("width" -> "4")) assert(newPart.storage.serde == Some(expectedSerde)) - assert(newPart.storage.properties.filterKeys(expectedSerdeProps.contains) == + assert(newPart.storage.properties.filterKeys(expectedSerdeProps.contains).toMap == expectedSerdeProps) } @@ -1035,10 +1067,9 @@ class HiveDDLSuite test("drop table using drop view") { withTable("tab1") { sql("CREATE TABLE tab1(c1 int)") - val message = intercept[AnalysisException] { - sql("DROP VIEW tab1") - }.getMessage - assert(message.contains("Cannot drop a table with DROP VIEW. Please use DROP TABLE instead")) + assertAnalysisError( + "DROP VIEW tab1", + "tab1 is a table. 'DROP VIEW' expects a view. Please use DROP TABLE instead.") } } @@ -1047,10 +1078,9 @@ class HiveDDLSuite spark.range(10).write.saveAsTable("tab1") withView("view1") { sql("CREATE VIEW view1 AS SELECT * FROM tab1") - val message = intercept[AnalysisException] { - sql("DROP TABLE view1") - }.getMessage - assert(message.contains("Cannot drop a view with DROP TABLE. Please use DROP VIEW instead")) + assertAnalysisError( + "DROP TABLE view1", + "Cannot drop a view with DROP TABLE. Please use DROP VIEW instead") } } } @@ -1188,7 +1218,7 @@ class HiveDDLSuite expectedDBUri, Map.empty)) // the database directory was created - assert(fs.exists(dbPath) && fs.isDirectory(dbPath)) + assert(fs.exists(dbPath) && fs.getFileStatus(dbPath).isDirectory) sql(s"USE $dbName") val tabName = "tab1" @@ -1204,10 +1234,9 @@ class HiveDDLSuite sql(s"USE default") val sqlDropDatabase = s"DROP DATABASE $dbName ${if (cascade) "CASCADE" else "RESTRICT"}" if (tableExists && !cascade) { - val message = intercept[AnalysisException] { - sql(sqlDropDatabase) - }.getMessage - assert(message.contains(s"Database $dbName is not empty. One or more tables exist.")) + assertAnalysisError( + sqlDropDatabase, + s"Database $dbName is not empty. One or more tables exist.") // the database directory was not removed assert(fs.exists(new Path(expectedDBLocation))) } else { @@ -1236,17 +1265,15 @@ class HiveDDLSuite test("drop default database") { Seq("true", "false").foreach { caseSensitive => withSQLConf(SQLConf.CASE_SENSITIVE.key -> caseSensitive) { - var message = intercept[AnalysisException] { - sql("DROP DATABASE default") - }.getMessage - assert(message.contains("Can not drop default database")) + assertAnalysisError( + "DROP DATABASE default", + "Can not drop default database") // SQLConf.CASE_SENSITIVE does not affect the result // because the Hive metastore is not case sensitive. - message = intercept[AnalysisException] { - sql("DROP DATABASE DeFault") - }.getMessage - assert(message.contains("Can not drop default database")) + assertAnalysisError( + "DROP DATABASE DeFault", + "Can not drop default database") } } } @@ -1636,10 +1663,9 @@ class HiveDDLSuite } // When tableExists is not invoked, we still can get an AnalysisException - val e = intercept[AnalysisException] { - sql(s"DESCRIBE $indexTabName") - }.getMessage - assert(e.contains("Hive index table is not supported.")) + assertAnalysisError( + s"DESCRIBE $indexTabName", + "Hive index table is not supported.") } finally { client.runSqlHive(s"DROP INDEX IF EXISTS $indexName ON $tabName") } @@ -1709,84 +1735,18 @@ class HiveDDLSuite sql("CREATE TABLE tbl(a INT) STORED AS parquet") Seq(DATASOURCE_PREFIX, STATISTICS_PREFIX).foreach { forbiddenPrefix => - val e = intercept[AnalysisException] { - sql(s"ALTER TABLE tbl SET TBLPROPERTIES ('${forbiddenPrefix}foo' = 'loser')") - } - assert(e.getMessage.contains(forbiddenPrefix + "foo")) - - val e2 = intercept[AnalysisException] { - sql(s"ALTER TABLE tbl UNSET TBLPROPERTIES ('${forbiddenPrefix}foo')") - } - assert(e2.getMessage.contains(forbiddenPrefix + "foo")) - - val e3 = intercept[AnalysisException] { - sql(s"CREATE TABLE tbl2 (a INT) TBLPROPERTIES ('${forbiddenPrefix}foo'='anything')") - } - assert(e3.getMessage.contains(forbiddenPrefix + "foo")) - } - } - } - - test("truncate table - datasource table") { - import testImplicits._ - - val data = (1 to 10).map { i => (i, i) }.toDF("width", "length") - // Test both a Hive compatible and incompatible code path. - Seq("json", "parquet").foreach { format => - withTable("rectangles") { - data.write.format(format).saveAsTable("rectangles") - assert(spark.table("rectangles").collect().nonEmpty, - "bad test; table was empty to begin with") - - sql("TRUNCATE TABLE rectangles") - assert(spark.table("rectangles").collect().isEmpty) + assertAnalysisError( + s"ALTER TABLE tbl SET TBLPROPERTIES ('${forbiddenPrefix}foo' = 'loser')", + s"${forbiddenPrefix}foo") - // not supported since the table is not partitioned - val e = intercept[AnalysisException] { - sql("TRUNCATE TABLE rectangles PARTITION (width=1)") - } - assert(e.message.contains("Operation not allowed")) - } - } - } - - test("truncate partitioned table - datasource table") { - import testImplicits._ - - val data = (1 to 10).map { i => (i % 3, i % 5, i) }.toDF("width", "length", "height") - - withTable("partTable") { - data.write.partitionBy("width", "length").saveAsTable("partTable") - // supported since partitions are stored in the metastore - sql("TRUNCATE TABLE partTable PARTITION (width=1, length=1)") - assert(spark.table("partTable").filter($"width" === 1).collect().nonEmpty) - assert(spark.table("partTable").filter($"width" === 1 && $"length" === 1).collect().isEmpty) - } - - withTable("partTable") { - data.write.partitionBy("width", "length").saveAsTable("partTable") - // support partial partition spec - sql("TRUNCATE TABLE partTable PARTITION (width=1)") - assert(spark.table("partTable").collect().nonEmpty) - assert(spark.table("partTable").filter($"width" === 1).collect().isEmpty) - } - - withTable("partTable") { - data.write.partitionBy("width", "length").saveAsTable("partTable") - // do nothing if no partition is matched for the given partial partition spec - sql("TRUNCATE TABLE partTable PARTITION (width=100)") - assert(spark.table("partTable").count() == data.count()) + assertAnalysisError( + s"ALTER TABLE tbl UNSET TBLPROPERTIES ('${forbiddenPrefix}foo')", + s"${forbiddenPrefix}foo") - // throw exception if no partition is matched for the given non-partial partition spec. - intercept[NoSuchPartitionException] { - sql("TRUNCATE TABLE partTable PARTITION (width=100, length=100)") + assertAnalysisError( + s"CREATE TABLE tbl2 (a INT) TBLPROPERTIES ('${forbiddenPrefix}foo'='anything')", + s"${forbiddenPrefix}foo") } - - // throw exception if the column in partition spec is not a partition column. - val e = intercept[AnalysisException] { - sql("TRUNCATE TABLE partTable PARTITION (unknown=1)") - } - assert(e.message.contains("unknown is not a valid partition column")) } } @@ -1893,6 +1853,138 @@ class HiveDDLSuite } } + test("SPARK-34370: support Avro schema evolution (add column with avro.schema.url)") { + checkAvroSchemaEvolutionAddColumn( + s"'avro.schema.url'='${TestHive.getHiveFile("schemaWithOneField.avsc").toURI}'", + s"'avro.schema.url'='${TestHive.getHiveFile("schemaWithTwoFields.avsc").toURI}'") + } + + test("SPARK-26836: support Avro schema evolution (add column with avro.schema.literal)") { + val originalSchema = + """ + |{ + | "namespace": "test", + | "name": "some_schema", + | "type": "record", + | "fields": [ + | { + | "name": "col2", + | "type": "string" + | } + | ] + |} + """.stripMargin + val evolvedSchema = + """ + |{ + | "namespace": "test", + | "name": "some_schema", + | "type": "record", + | "fields": [ + | { + | "name": "col1", + | "type": "string", + | "default": "col1_default" + | }, + | { + | "name": "col2", + | "type": "string" + | } + | ] + |} + """.stripMargin + checkAvroSchemaEvolutionAddColumn( + s"'avro.schema.literal'='$originalSchema'", + s"'avro.schema.literal'='$evolvedSchema'") + } + + private def checkAvroSchemaEvolutionAddColumn( + originalSerdeProperties: String, + evolvedSerdeProperties: String) = { + withTable("t") { + sql( + s""" + |CREATE TABLE t PARTITIONED BY (ds string) + |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe' + |WITH SERDEPROPERTIES ($originalSerdeProperties) + |STORED AS + |INPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat' + |OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat' + """.stripMargin) + sql("INSERT INTO t partition (ds='1981-01-07') VALUES ('col2_value')") + sql(s"ALTER TABLE t SET SERDEPROPERTIES ($evolvedSerdeProperties)") + sql("INSERT INTO t partition (ds='1983-04-27') VALUES ('col1_value', 'col2_value')") + checkAnswer(spark.table("t"), Row("col1_default", "col2_value", "1981-01-07") + :: Row("col1_value", "col2_value", "1983-04-27") :: Nil) + } + } + + test("SPARK-34370: support Avro schema evolution (remove column with avro.schema.url)") { + checkAvroSchemaEvolutionRemoveColumn( + s"'avro.schema.url'='${TestHive.getHiveFile("schemaWithTwoFields.avsc").toURI}'", + s"'avro.schema.url'='${TestHive.getHiveFile("schemaWithOneField.avsc").toURI}'") + } + + test("SPARK-26836: support Avro schema evolution (remove column with avro.schema.literal)") { + val originalSchema = + """ + |{ + | "namespace": "test", + | "name": "some_schema", + | "type": "record", + | "fields": [ + | { + | "name": "col1", + | "type": "string", + | "default": "col1_default" + | }, + | { + | "name": "col2", + | "type": "string" + | } + | ] + |} + """.stripMargin + val evolvedSchema = + """ + |{ + | "namespace": "test", + | "name": "some_schema", + | "type": "record", + | "fields": [ + | { + | "name": "col2", + | "type": "string" + | } + | ] + |} + """.stripMargin + checkAvroSchemaEvolutionRemoveColumn( + s"'avro.schema.literal'='$originalSchema'", + s"'avro.schema.literal'='$evolvedSchema'") + } + + private def checkAvroSchemaEvolutionRemoveColumn( + originalSerdeProperties: String, + evolvedSerdeProperties: String) = { + withTable("t") { + sql( + s""" + |CREATE TABLE t PARTITIONED BY (ds string) + |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.avro.AvroSerDe' + |WITH SERDEPROPERTIES ($originalSerdeProperties) + |STORED AS + |INPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat' + |OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat' + """.stripMargin) + sql("INSERT INTO t partition (ds='1983-04-27') VALUES ('col1_value', 'col2_value')") + sql(s"ALTER TABLE t SET SERDEPROPERTIES ($evolvedSerdeProperties)") + sql("INSERT INTO t partition (ds='1981-01-07') VALUES ('col2_value')") + checkAnswer(spark.table("t"), Row("col2_value", "1981-01-07") + :: Row("col2_value", "1983-04-27") :: Nil) + } + } + test("append data to hive serde table") { withTable("t", "t1") { Seq(1 -> "a").toDF("i", "j") @@ -2144,10 +2236,9 @@ class HiveDDLSuite assert(loc.listFiles().length >= 1) checkAnswer(spark.table("t"), Row("1") :: Nil) } else { - val e = intercept[AnalysisException] { - spark.sql("INSERT INTO TABLE t SELECT 1") - }.getMessage - assert(e.contains("java.net.URISyntaxException: Relative path in absolute URI: a:b")) + assertAnalysisError( + "INSERT INTO TABLE t SELECT 1", + "java.net.URISyntaxException: Relative path in absolute URI: a:b") } } @@ -2186,15 +2277,13 @@ class HiveDDLSuite Row("1", "2") :: Row("1", "2017-03-03 12:13%3A14") :: Nil) } } else { - val e = intercept[AnalysisException] { - spark.sql("INSERT INTO TABLE t1 PARTITION(b=2) SELECT 1") - }.getMessage - assert(e.contains("java.net.URISyntaxException: Relative path in absolute URI: a:b")) - - val e1 = intercept[AnalysisException] { - spark.sql("INSERT INTO TABLE t1 PARTITION(b='2017-03-03 12:13%3A14') SELECT 1") - }.getMessage - assert(e1.contains("java.net.URISyntaxException: Relative path in absolute URI: a:b")) + assertAnalysisError( + "INSERT INTO TABLE t1 PARTITION(b=2) SELECT 1", + "java.net.URISyntaxException: Relative path in absolute URI: a:b") + + assertAnalysisError( + "INSERT INTO TABLE t1 PARTITION(b='2017-03-03 12:13%3A14') SELECT 1", + "java.net.URISyntaxException: Relative path in absolute URI: a:b") } } } @@ -2241,8 +2330,8 @@ class HiveDDLSuite ) sql("ALTER TABLE tab ADD COLUMNS (c5 char(10))") - assert(spark.table("tab").schema.find(_.name == "c5") - .get.metadata.getString("HIVE_TYPE_STRING") == "char(10)") + assert(spark.sharedState.externalCatalog.getTable("default", "tab") + .schema.find(_.name == "c5").get.dataType == CharType(10)) } } } @@ -2279,36 +2368,143 @@ class HiveDDLSuite sql("CREATE TABLE tab (c1 int) PARTITIONED BY (c2 int) STORED AS PARQUET") if (!caseSensitive) { // duplicating partitioning column name - val e1 = intercept[AnalysisException] { - sql("ALTER TABLE tab ADD COLUMNS (C2 string)") - }.getMessage - assert(e1.contains("Found duplicate column(s)")) + assertAnalysisError( + "ALTER TABLE tab ADD COLUMNS (C2 string)", + "Found duplicate column(s)") // duplicating data column name - val e2 = intercept[AnalysisException] { - sql("ALTER TABLE tab ADD COLUMNS (C1 string)") - }.getMessage - assert(e2.contains("Found duplicate column(s)")) + assertAnalysisError( + "ALTER TABLE tab ADD COLUMNS (C1 string)", + "Found duplicate column(s)") } else { // hive catalog will still complains that c1 is duplicate column name because hive // identifiers are case insensitive. - val e1 = intercept[AnalysisException] { - sql("ALTER TABLE tab ADD COLUMNS (C2 string)") - }.getMessage - assert(e1.contains("HiveException")) + assertAnalysisError( + "ALTER TABLE tab ADD COLUMNS (C2 string)", + "HiveException") // hive catalog will still complains that c1 is duplicate column name because hive // identifiers are case insensitive. - val e2 = intercept[AnalysisException] { - sql("ALTER TABLE tab ADD COLUMNS (C1 string)") - }.getMessage - assert(e2.contains("HiveException")) + assertAnalysisError( + "ALTER TABLE tab ADD COLUMNS (C1 string)", + "HiveException") } } } } } + test("SPARK-20680: do not support for null column datatype") { + withTable("t") { + withView("tabNullType") { + hiveClient.runSqlHive("CREATE TABLE t (t1 int)") + hiveClient.runSqlHive("INSERT INTO t VALUES (3)") + hiveClient.runSqlHive("CREATE VIEW tabNullType AS SELECT NULL AS col FROM t") + checkAnswer(spark.table("tabNullType"), Row(null)) + // No exception shows + val desc = spark.sql("DESC tabNullType").collect().toSeq + assert(desc.contains(Row("col", NullType.simpleString, null))) + } + } + + // Forbid CTAS with null type + withTable("t1", "t2", "t3") { + assertAnalysisError( + "CREATE TABLE t1 USING PARQUET AS SELECT null as null_col", + "Cannot create tables with null type") + + assertAnalysisError( + "CREATE TABLE t2 AS SELECT null as null_col", + "Cannot create tables with null type") + + assertAnalysisError( + "CREATE TABLE t3 STORED AS PARQUET AS SELECT null as null_col", + "Cannot create tables with null type") + } + + // Forbid Replace table AS SELECT with null type + withTable("t") { + val v2Source = classOf[FakeV2Provider].getName + assertAnalysisError( + s"CREATE OR REPLACE TABLE t USING $v2Source AS SELECT null as null_col", + "Cannot create tables with null type") + } + + // Forbid creating table with VOID type in Spark + withTable("t1", "t2", "t3", "t4") { + assertAnalysisError( + "CREATE TABLE t1 (v VOID) USING PARQUET", + "Cannot create tables with null type") + assertAnalysisError( + "CREATE TABLE t2 (v VOID) USING hive", + "Cannot create tables with null type") + assertAnalysisError( + "CREATE TABLE t3 (v VOID)", + "Cannot create tables with null type") + assertAnalysisError( + "CREATE TABLE t4 (v VOID) STORED AS PARQUET", + "Cannot create tables with null type") + } + + // Forbid Replace table with VOID type + withTable("t") { + val v2Source = classOf[FakeV2Provider].getName + assertAnalysisError( + s"CREATE OR REPLACE TABLE t (v VOID) USING $v2Source", + "Cannot create tables with null type") + } + + // Make sure spark.catalog.createTable with null type will fail + val schema1 = new StructType().add("c", NullType) + assertHiveTableNullType(schema1) + assertDSTableNullType(schema1) + + val schema2 = new StructType() + .add("c", StructType(Seq(StructField.apply("c1", NullType)))) + assertHiveTableNullType(schema2) + assertDSTableNullType(schema2) + + val schema3 = new StructType().add("c", ArrayType(NullType)) + assertHiveTableNullType(schema3) + assertDSTableNullType(schema3) + + val schema4 = new StructType() + .add("c", MapType(StringType, NullType)) + assertHiveTableNullType(schema4) + assertDSTableNullType(schema4) + + val schema5 = new StructType() + .add("c", MapType(NullType, StringType)) + assertHiveTableNullType(schema5) + assertDSTableNullType(schema5) + } + + private def assertHiveTableNullType(schema: StructType): Unit = { + withTable("t") { + val e = intercept[AnalysisException] { + spark.catalog.createTable( + tableName = "t", + source = "hive", + schema = schema, + options = Map("fileFormat" -> "parquet")) + }.getMessage + assert(e.contains("Cannot create tables with null type")) + } + } + + private def assertDSTableNullType(schema: StructType): Unit = { + withTable("t") { + val e = intercept[AnalysisException] { + spark.catalog.createTable( + tableName = "t", + source = "json", + schema = schema, + options = Map.empty[String, String]) + }.getMessage + assert(e.contains("Cannot create tables with null type")) + } + } + test("SPARK-21216: join with a streaming DataFrame") { import org.apache.spark.sql.execution.streaming.MemoryStream import testImplicits._ @@ -2370,7 +2566,7 @@ class HiveDDLSuite OrcFileOperator.getFileReader(maybeFile.get.toPath.toString).get.getCompression.name case "parquet" => - val footer = ParquetFileReader.readFooter( + val footer = ParquetFooterReader.readFooter( sparkContext.hadoopConfiguration, new Path(maybeFile.get.getPath), NO_FILTER) footer.getBlocks.get(0).getColumns.get(0).getCodec.toString } @@ -2489,9 +2685,9 @@ class HiveDDLSuite test("load command for non local invalid path validation") { withTable("tbl") { sql("CREATE TABLE tbl(i INT, j STRING) USING hive") - val e = intercept[AnalysisException]( - sql("load data inpath '/doesnotexist.csv' into table tbl")) - assert(e.message.contains("LOAD DATA input path does not exist")) + assertAnalysisError( + "load data inpath '/doesnotexist.csv' into table tbl", + "LOAD DATA input path does not exist") } } @@ -2570,8 +2766,7 @@ class HiveDDLSuite |AS SELECT 1 as a, "a" as b """.stripMargin) }.getMessage - assert(err1.contains("Schema may not be specified in a Create Table As Select " + - "(CTAS) statement")) + assert(err1.contains("Schema may not be specified in a Create Table As Select")) val err2 = intercept[ParseException] { spark.sql( @@ -2582,8 +2777,7 @@ class HiveDDLSuite |AS SELECT 1 as a, "a" as b """.stripMargin) }.getMessage - assert(err2.contains("Create Partitioned Table As Select cannot specify data type for " + - "the partition columns of the target table")) + assert(err2.contains("Partition column types may not be specified in Create Table As Select")) } test("Hive CTAS with dynamic partition") { @@ -2640,69 +2834,44 @@ class HiveDDLSuite test("Create Table LIKE with row format") { val catalog = spark.sessionState.catalog - withTable("sourceHiveTable", "sourceDsTable", "targetHiveTable1", "targetHiveTable2") { + withTable("sourceHiveTable", "sourceDsTable") { sql("CREATE TABLE sourceHiveTable(a INT, b INT) STORED AS PARQUET") sql("CREATE TABLE sourceDsTable(a INT, b INT) USING PARQUET") // row format doesn't work in create targetDsTable - var e = intercept[AnalysisException] { - spark.sql( - """ - |CREATE TABLE targetDsTable LIKE sourceHiveTable USING PARQUET - |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' - """.stripMargin) - }.getMessage - assert(e.contains("'ROW FORMAT' must be used with 'STORED AS'")) + assertAnalysisError( + """ + |CREATE TABLE targetDsTable LIKE sourceHiveTable USING PARQUET + |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + """.stripMargin, + "Operation not allowed: CREATE TABLE LIKE ... USING ... ROW FORMAT SERDE") // row format doesn't work with provider hive - e = intercept[AnalysisException] { - spark.sql( - """ - |CREATE TABLE targetHiveTable LIKE sourceHiveTable USING hive - |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' - |WITH SERDEPROPERTIES ('test' = 'test') - """.stripMargin) - }.getMessage - assert(e.contains("'ROW FORMAT' must be used with 'STORED AS'")) + assertAnalysisError( + """ + |CREATE TABLE targetHiveTable LIKE sourceHiveTable USING hive + |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + |WITH SERDEPROPERTIES ('test' = 'test') + """.stripMargin, + "Operation not allowed: CREATE TABLE LIKE ... USING ... ROW FORMAT SERDE") // row format doesn't work without 'STORED AS' - e = intercept[AnalysisException] { - spark.sql( - """ - |CREATE TABLE targetDsTable LIKE sourceDsTable - |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' - |WITH SERDEPROPERTIES ('test' = 'test') - """.stripMargin) - }.getMessage - assert(e.contains("'ROW FORMAT' must be used with 'STORED AS'")) - - // row format works with STORED AS hive format (from hive table) - spark.sql( + assertAnalysisError( """ - |CREATE TABLE targetHiveTable1 LIKE sourceHiveTable STORED AS PARQUET + |CREATE TABLE targetDsTable LIKE sourceDsTable |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' |WITH SERDEPROPERTIES ('test' = 'test') - """.stripMargin) - var table = catalog.getTableMetadata(TableIdentifier("targetHiveTable1")) - assert(table.provider === Some("hive")) - assert(table.storage.inputFormat === - Some("org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat")) - assert(table.storage.serde === Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")) - assert(table.storage.properties("test") == "test") + """.stripMargin, + "'ROW FORMAT' must be used with 'STORED AS'") - // row format works with STORED AS hive format (from datasource table) - spark.sql( + // 'INPUTFORMAT' and 'OUTPUTFORMAT' conflict with 'USING' + assertAnalysisError( """ - |CREATE TABLE targetHiveTable2 LIKE sourceDsTable STORED AS PARQUET + |CREATE TABLE targetDsTable LIKE sourceDsTable USING format + |STORED AS INPUTFORMAT 'inFormat' OUTPUTFORMAT 'outFormat' |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' - |WITH SERDEPROPERTIES ('test' = 'test') - """.stripMargin) - table = catalog.getTableMetadata(TableIdentifier("targetHiveTable2")) - assert(table.provider === Some("hive")) - assert(table.storage.inputFormat === - Some("org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat")) - assert(table.storage.serde === Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")) - assert(table.storage.properties("test") == "test") + """.stripMargin, + "Operation not allowed: CREATE TABLE LIKE ... USING ... STORED AS") } } @@ -2720,4 +2889,144 @@ class HiveDDLSuite checkAnswer(sql("SHOW PARTITIONS ta_part"), Row("ts=10") :: Nil) } } + + test("SPARK-31904: Fix case sensitive problem of char and varchar partition columns") { + withTable("t1", "t2") { + sql("CREATE TABLE t1(a STRING, B VARCHAR(10), C CHAR(10)) STORED AS parquet") + sql("CREATE TABLE t2 USING parquet PARTITIONED BY (b, c) AS SELECT * FROM t1") + // make sure there is no exception + assert(sql("SELECT * FROM t2 WHERE b = 'A'").collect().isEmpty) + assert(sql("SELECT * FROM t2 WHERE c = 'A'").collect().isEmpty) + } + } + + test("SPARK-33546: CREATE TABLE LIKE should validate row format & file format") { + val catalog = spark.sessionState.catalog + withTable("sourceHiveTable", "sourceDsTable") { + sql("CREATE TABLE sourceHiveTable(a INT, b INT) STORED AS PARQUET") + sql("CREATE TABLE sourceDsTable(a INT, b INT) USING PARQUET") + + // ROW FORMAT SERDE ... STORED AS [SEQUENCEFILE | RCFILE | TEXTFILE] + val allowSerdeFileFormats = Seq("TEXTFILE", "SEQUENCEFILE", "RCFILE") + Seq("sourceHiveTable", "sourceDsTable").foreach { sourceTable => + allowSerdeFileFormats.foreach { format => + withTable("targetTable") { + spark.sql( + s""" + |CREATE TABLE targetTable LIKE $sourceTable + |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + |STORED AS $format + """.stripMargin) + + val expectedSerde = HiveSerDe.sourceToSerDe(format) + val table = catalog.getTableMetadata(TableIdentifier("targetTable", Some("default"))) + assert(table.provider === Some("hive")) + assert(table.storage.inputFormat === Some(expectedSerde.get.inputFormat.get)) + assert(table.storage.outputFormat === Some(expectedSerde.get.outputFormat.get)) + assert(table.storage.serde === + Some("org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe")) + } + } + + // negative case + hiveFormats.filterNot(allowSerdeFileFormats.contains(_)).foreach { format => + withTable("targetTable") { + assertAnalysisError( + s""" + |CREATE TABLE targetTable LIKE $sourceTable + |ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + |STORED AS $format + """.stripMargin, + s"ROW FORMAT SERDE is incompatible with format '${format.toLowerCase(Locale.ROOT)}'") + } + } + } + + // ROW FORMAT DELIMITED ... STORED AS TEXTFILE + Seq("sourceHiveTable", "sourceDsTable").foreach { sourceTable => + withTable("targetTable") { + spark.sql( + s""" + |CREATE TABLE targetTable LIKE $sourceTable + |ROW FORMAT DELIMITED + |STORED AS TEXTFILE + """.stripMargin) + + val expectedSerde = HiveSerDe.sourceToSerDe("TEXTFILE") + val table = catalog.getTableMetadata(TableIdentifier("targetTable", Some("default"))) + assert(table.provider === Some("hive")) + assert(table.storage.inputFormat === Some(expectedSerde.get.inputFormat.get)) + assert(table.storage.outputFormat === Some(expectedSerde.get.outputFormat.get)) + assert(table.storage.serde === Some(expectedSerde.get.serde.get)) + + // negative case + assertAnalysisError( + s""" + |CREATE TABLE targetTable LIKE $sourceTable + |ROW FORMAT DELIMITED + |STORED AS PARQUET + """.stripMargin, + "ROW FORMAT DELIMITED is only compatible with 'textfile'") + } + } + + // ROW FORMAT ... STORED AS INPUTFORMAT ... OUTPUTFORMAT ... + hiveFormats.foreach { tableType => + val expectedSerde = HiveSerDe.sourceToSerDe(tableType) + Seq("sourceHiveTable", "sourceDsTable").foreach { sourceTable => + withTable("targetTable") { + spark.sql( + s""" + |CREATE TABLE targetTable LIKE $sourceTable + |ROW FORMAT SERDE '${expectedSerde.get.serde.get}' + |STORED AS INPUTFORMAT '${expectedSerde.get.inputFormat.get}' + |OUTPUTFORMAT '${expectedSerde.get.outputFormat.get}' + """.stripMargin) + + val table = catalog.getTableMetadata(TableIdentifier("targetTable", Some("default"))) + assert(table.provider === Some("hive")) + assert(table.storage.inputFormat === Some(expectedSerde.get.inputFormat.get)) + assert(table.storage.outputFormat === Some(expectedSerde.get.outputFormat.get)) + assert(table.storage.serde === Some(expectedSerde.get.serde.get)) + } + } + } + } + } + + test("SPARK-33844: Insert overwrite directory should check schema too") { + withView("v") { + spark.range(1).createTempView("v") + withTempPath { path => + val e = intercept[AnalysisException] { + spark.sql(s"INSERT OVERWRITE LOCAL DIRECTORY '${path.getCanonicalPath}' " + + s"STORED AS PARQUET SELECT ID, if(1=1, 1, 0), abs(id), '^-' FROM v") + }.getMessage + assert(e.contains("Attribute name \"(IF((1 = 1), 1, 0))\" contains" + + " invalid character(s) among \" ,;{}()\\n\\t=\". Please use alias to rename it.")) + } + } + } + + test("SPARK-34261: Avoid side effect if create exists temporary function") { + withUserDefinedFunction("f1" -> true) { + sql("CREATE TEMPORARY FUNCTION f1 AS 'org.apache.hadoop.hive.ql.udf.UDFUUID'") + + val jarName = "TestUDTF.jar" + val jar = spark.asInstanceOf[TestHiveSparkSession].getHiveFile(jarName).toURI.toString + spark.sparkContext.addedJars.keys.find(_.contains(jarName)) + .foreach(spark.sparkContext.addedJars.remove) + assert(!spark.sparkContext.listJars().exists(_.contains(jarName))) + val msg = intercept[AnalysisException] { + sql("CREATE TEMPORARY FUNCTION f1 AS " + + s"'org.apache.hadoop.hive.ql.udf.UDFUUID' USING JAR '$jar'") + }.getMessage + assert(msg.contains("Function f1 already exists")) + assert(!spark.sparkContext.listJars().exists(_.contains(jarName))) + + sql("CREATE OR REPLACE TEMPORARY FUNCTION f1 AS " + + s"'org.apache.hadoop.hive.ql.udf.UDFUUID' USING JAR '$jar'") + assert(spark.sparkContext.listJars().exists(_.contains(jarName))) + } + } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQueryFileTest.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQueryFileTest.scala index bb4ce6d3aa3f1..192fff2b98879 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQueryFileTest.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQueryFileTest.scala @@ -25,18 +25,18 @@ import org.apache.spark.sql.catalyst.util._ * A framework for running the query tests that are listed as a set of text files. * * TestSuites that derive from this class must provide a map of testCaseName to testCaseFiles - * that should be included. Additionally, there is support for whitelisting and blacklisting + * that should be included. Additionally, there is support for including and excluding * tests as development progresses. */ abstract class HiveQueryFileTest extends HiveComparisonTest { /** A list of tests deemed out of scope and thus completely disregarded */ - def blackList: Seq[String] = Nil + def excludeList: Seq[String] = Nil /** - * The set of tests that are believed to be working in catalyst. Tests not in whiteList - * blacklist are implicitly marked as ignored. + * The set of tests that are believed to be working in catalyst. Tests not in includeList or + * excludeList are implicitly marked as ignored. */ - def whiteList: Seq[String] = ".*" :: Nil + def includeList: Seq[String] = ".*" :: Nil def testCases: Seq[(String, File)] @@ -45,25 +45,34 @@ abstract class HiveQueryFileTest extends HiveComparisonTest { runOnlyDirectories.nonEmpty || skipDirectories.nonEmpty - val whiteListProperty: String = "spark.hive.whitelist" - // Allow the whiteList to be overridden by a system property - val realWhiteList: Seq[String] = - Option(System.getProperty(whiteListProperty)).map(_.split(",").toSeq).getOrElse(whiteList) + val deprecatedIncludeListProperty: String = "spark.hive.whitelist" + val includeListProperty: String = "spark.hive.includelist" + if (System.getProperty(deprecatedIncludeListProperty) != null) { + logWarning(s"System property `$deprecatedIncludeListProperty` is deprecated; please update " + + s"to use new property: $includeListProperty") + } + // Allow the includeList to be overridden by a system property + val realIncludeList: Seq[String] = + Option(System.getProperty(includeListProperty)) + .orElse(Option(System.getProperty(deprecatedIncludeListProperty))) + .map(_.split(",").toSeq) + .getOrElse(includeList) // Go through all the test cases and add them to scala test. testCases.sorted.foreach { case (testCaseName, testCaseFile) => - if (blackList.map(_.r.pattern.matcher(testCaseName).matches()).reduceLeft(_||_)) { - logDebug(s"Blacklisted test skipped $testCaseName") - } else if (realWhiteList.map(_.r.pattern.matcher(testCaseName).matches()).reduceLeft(_||_) || + if (excludeList.map(_.r.pattern.matcher(testCaseName).matches()).reduceLeft(_||_)) { + logDebug(s"Excluded test skipped $testCaseName") + } else if ( + realIncludeList.map(_.r.pattern.matcher(testCaseName).matches()).reduceLeft(_||_) || runAll) { // Build a test case and submit it to scala test framework... val queriesString = fileToString(testCaseFile) createQueryTest(testCaseName, queriesString, reset = true, tryWithoutResettingFirst = true) } else { - // Only output warnings for the built in whitelist as this clutters the output when the user - // trying to execute a single test from the commandline. - if (System.getProperty(whiteListProperty) == null && !runAll) { + // Only output warnings for the built in includeList as this clutters the output when the + // user is trying to execute a single test from the commandline. + if (System.getProperty(includeListProperty) == null && !runAll) { ignore(testCaseName) {} } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala index 63b985fbe4d32..b08368f0fecb2 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveQuerySuite.scala @@ -19,6 +19,7 @@ package org.apache.spark.sql.hive.execution import java.io.File import java.net.URI +import java.nio.file.Files import java.sql.Timestamp import java.util.Locale @@ -34,11 +35,12 @@ import org.apache.spark.sql.catalyst.expressions.Cast import org.apache.spark.sql.catalyst.parser.ParseException import org.apache.spark.sql.catalyst.plans.logical.Project import org.apache.spark.sql.execution.joins.BroadcastNestedLoopJoinExec -import org.apache.spark.sql.hive._ +import org.apache.spark.sql.hive.HiveUtils.{builtinHiveVersion => hiveVersion} import org.apache.spark.sql.hive.test.{HiveTestJars, TestHive} import org.apache.spark.sql.hive.test.TestHive._ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SQLTestUtils +import org.apache.spark.tags.SlowHiveTest case class TestData(a: Int, b: String) @@ -46,6 +48,7 @@ case class TestData(a: Int, b: String) * A set of test cases expressed in Hive QL that are not covered by the tests * included in the hive distribution. */ +@SlowHiveTest class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAndAfter { import org.apache.spark.sql.hive.test.TestHive.implicits._ @@ -201,14 +204,17 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd |IF(TRUE, CAST(NULL AS BINARY), CAST("1" AS BINARY)) AS COL18, |IF(FALSE, CAST(NULL AS DATE), CAST("1970-01-01" AS DATE)) AS COL19, |IF(TRUE, CAST(NULL AS DATE), CAST("1970-01-01" AS DATE)) AS COL20, - |IF(TRUE, CAST(NULL AS TIMESTAMP), CAST(1 AS TIMESTAMP)) AS COL21, + |IF(TRUE, CAST(NULL AS TIMESTAMP), CAST('1969-12-31 16:00:01' AS TIMESTAMP)) AS COL21, |IF(FALSE, CAST(NULL AS DECIMAL), CAST(1 AS DECIMAL)) AS COL22, |IF(TRUE, CAST(NULL AS DECIMAL), CAST(1 AS DECIMAL)) AS COL23 |FROM src LIMIT 1""".stripMargin) test("constant null testing timestamp") { - val r1 = sql("SELECT IF(FALSE, CAST(NULL AS TIMESTAMP), CAST(1 AS TIMESTAMP)) AS COL20") - .collect().head + val r1 = sql( + """ + |SELECT IF(FALSE, CAST(NULL AS TIMESTAMP), + |CAST('1969-12-31 16:00:01' AS TIMESTAMP)) AS COL20 + """.stripMargin).collect().head assert(new Timestamp(1000) == r1.getTimestamp(0)) } @@ -552,37 +558,31 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd // Jdk version leads to different query output for double, so not use createQueryTest here test("timestamp cast #1") { - val res = sql("SELECT CAST(CAST(1 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 1").collect().head + val res = sql("SELECT CAST(TIMESTAMP_SECONDS(1) AS DOUBLE) FROM src LIMIT 1").collect().head assert(1 == res.getDouble(0)) } - createQueryTest("timestamp cast #2", - "SELECT CAST(CAST(1.2 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 1") - - test("timestamp cast #3") { - val res = sql("SELECT CAST(CAST(1200 AS TIMESTAMP) AS INT) FROM src LIMIT 1").collect().head - assert(1200 == res.getInt(0)) + test("timestamp cast #2") { + val res = sql("SELECT CAST(TIMESTAMP_SECONDS(-1) AS DOUBLE) FROM src LIMIT 1").collect().head + assert(-1 == res.get(0)) } + createQueryTest("timestamp cast #3", + "SELECT CAST(TIMESTAMP_SECONDS(1.2) AS DOUBLE) FROM src LIMIT 1") + createQueryTest("timestamp cast #4", - "SELECT CAST(CAST(1.2 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 1") + "SELECT CAST(TIMESTAMP_SECONDS(-1.2) AS DOUBLE) FROM src LIMIT 1") test("timestamp cast #5") { - val res = sql("SELECT CAST(CAST(-1 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 1").collect().head - assert(-1 == res.get(0)) + val res = sql("SELECT CAST(TIMESTAMP_SECONDS(1200) AS INT) FROM src LIMIT 1").collect().head + assert(1200 == res.getInt(0)) } - createQueryTest("timestamp cast #6", - "SELECT CAST(CAST(-1.2 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 1") - - test("timestamp cast #7") { - val res = sql("SELECT CAST(CAST(-1200 AS TIMESTAMP) AS INT) FROM src LIMIT 1").collect().head + test("timestamp cast #6") { + val res = sql("SELECT CAST(TIMESTAMP_SECONDS(-1200) AS INT) FROM src LIMIT 1").collect().head assert(-1200 == res.getInt(0)) } - createQueryTest("timestamp cast #8", - "SELECT CAST(CAST(-1.2 AS TIMESTAMP) AS DOUBLE) FROM src LIMIT 1") - createQueryTest("select null from table", "SELECT null FROM src LIMIT 1") @@ -830,6 +830,18 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd assert(sql(s"list jar $testJar").count() == 1) } + test("SPARK-34955: ADD JAR should treat paths which contains white spaces") { + withTempDir { dir => + val file = File.createTempFile("someprefix1", "somesuffix1", dir) + Files.write(file.toPath, "test_file1".getBytes) + val jarFile = new File(dir, "test file.jar") + TestUtils.createJar(Seq(file), jarFile) + sql(s"ADD JAR '${jarFile.getAbsolutePath}'") + assert(sql("LIST JARS"). + filter(_.getString(0).contains(s"${jarFile.getName}".replace(" ", "%20"))).count() > 0) + } + } + test("CREATE TEMPORARY FUNCTION") { val funcJar = TestHive.getHiveFile("TestUDTF.jar") val jarURL = funcJar.toURI.toURL @@ -858,6 +870,273 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd assert(sql(s"list file $testFile").count() == 1) } + test("ADD ARCHIVE/LIST ARCHIVES commands") { + withTempDir { dir => + val file1 = File.createTempFile("someprefix1", "somesuffix1", dir) + val file2 = File.createTempFile("someprefix2", "somesuffix2", dir) + + Files.write(file1.toPath, "file1".getBytes) + Files.write(file2.toPath, "file2".getBytes) + + val zipFile = new File(dir, "test.zip") + val jarFile = new File(dir, "test.jar") + TestUtils.createJar(Seq(file1), zipFile) + TestUtils.createJar(Seq(file2), jarFile) + + sql(s"ADD ARCHIVE ${zipFile.getAbsolutePath}#foo") + sql(s"ADD ARCHIVE ${jarFile.getAbsolutePath}#bar") + + val checkAddArchive = + sparkContext.parallelize( + Seq( + "foo", + s"foo/${file1.getName}", + "nonexistence", + "bar", + s"bar/${file2.getName}"), 1).map { name => + val file = new File(SparkFiles.get(name)) + val contents = + if (file.isFile) { + Some(String.join("", new String(Files.readAllBytes(file.toPath)))) + } else { + None + } + (name, file.canRead, contents) + }.collect() + + assert(checkAddArchive(0) === ("foo", true, None)) + assert(checkAddArchive(1) === (s"foo/${file1.getName}", true, Some("file1"))) + assert(checkAddArchive(2) === ("nonexistence", false, None)) + assert(checkAddArchive(3) === ("bar", true, None)) + assert(checkAddArchive(4) === (s"bar/${file2.getName}", true, Some("file2"))) + assert(sql("list archives"). + filter(_.getString(0).contains(s"${zipFile.getAbsolutePath}")).count() > 0) + assert(sql("list archive"). + filter(_.getString(0).contains(s"${jarFile.getAbsolutePath}")).count() > 0) + assert(sql(s"list archive ${zipFile.getAbsolutePath}").count() === 1) + assert(sql(s"list archives ${zipFile.getAbsolutePath} nonexistence").count() === 1) + assert(sql(s"list archives ${zipFile.getAbsolutePath} " + + s"${jarFile.getAbsolutePath}").count === 2) + } + } + + test("ADD ARCHIVE/List ARCHIVES commands - unsupported archive formats") { + withTempDir { dir => + val file1 = File.createTempFile("someprefix1", "somesuffix1", dir) + val file2 = File.createTempFile("someprefix2", "somesuffix2", dir) + + Files.write(file1.toPath, "file1".getBytes) + Files.write(file2.toPath, "file2".getBytes) + + // Emulate unsupported archive formats with .bz2 and .xz suffix. + val bz2File = new File(dir, "test.bz2") + val xzFile = new File(dir, "test.xz") + TestUtils.createJar(Seq(file1), bz2File) + TestUtils.createJar(Seq(file2), xzFile) + + sql(s"ADD ARCHIVE ${bz2File.getAbsolutePath}#foo") + sql(s"ADD ARCHIVE ${xzFile.getAbsolutePath}#bar") + + val checkAddArchive = + sparkContext.parallelize( + Seq( + "foo", + "bar"), 1).map { name => + val file = new File(SparkFiles.get(name)) + val contents = + if (file.isFile) { + Some(Files.readAllBytes(file.toPath).toSeq) + } else { + None + } + (name, file.canRead, contents) + }.collect() + + assert(checkAddArchive(0) === ("foo", true, Some(Files.readAllBytes(bz2File.toPath).toSeq))) + assert(checkAddArchive(1) === ("bar", true, Some(Files.readAllBytes(xzFile.toPath).toSeq))) + assert(sql("list archives"). + filter(_.getString(0).contains(s"${bz2File.getAbsolutePath}")).count() > 0) + assert(sql("list archive"). + filter(_.getString(0).contains(s"${xzFile.getAbsolutePath}")).count() > 0) + assert(sql(s"list archive ${bz2File.getAbsolutePath}").count() === 1) + assert(sql(s"list archives ${bz2File.getAbsolutePath} " + + s"${xzFile.getAbsolutePath}").count === 2) + } + } + + test("SPARK-35105: ADD FILES command with multiple files") { + withTempDir { dir => + val file1 = File.createTempFile("someprefix1", "somesuffix1", dir) + val file2 = File.createTempFile("someprefix2", "somesuffix 2", dir) + val file3 = File.createTempFile("someprefix3", "somesuffix 3", dir) + val file4 = File.createTempFile("someprefix4", "somesuffix4", dir) + + Files.write(file1.toPath, "file1".getBytes) + Files.write(file2.toPath, "file2".getBytes) + Files.write(file3.toPath, "file3".getBytes) + Files.write(file4.toPath, "file3".getBytes) + + sql(s"ADD FILE ${file1.getAbsolutePath} '${file2.getAbsoluteFile}'") + sql(s"""ADD FILES "${file3.getAbsolutePath}" ${file4.getAbsoluteFile}""") + val listFiles = sql(s"LIST FILES ${file1.getAbsolutePath} " + + s"'${file2.getAbsolutePath}' '${file3.getAbsolutePath}' ${file4.getAbsolutePath}") + assert(listFiles.count === 4) + assert(listFiles.filter(_.getString(0).contains(file1.getName)).count() === 1) + assert(listFiles.filter( + _.getString(0).contains(file2.getName.replace(" ", "%20"))).count() === 1) + assert(listFiles.filter( + _.getString(0).contains(file3.getName.replace(" ", "%20"))).count() === 1) + assert(listFiles.filter(_.getString(0).contains(file4.getName)).count() === 1) + } + } + + test("SPARK-35105: ADD JARS command with multiple files") { + withTempDir { dir => + val file1 = new File(dir, "test1.txt") + val file2 = new File(dir, "test2.txt") + val file3 = new File(dir, "test3.txt") + val file4 = new File(dir, "test4.txt") + + Files.write(file1.toPath, "file1".getBytes) + Files.write(file2.toPath, "file2".getBytes) + Files.write(file3.toPath, "file3".getBytes) + Files.write(file4.toPath, "file4".getBytes) + + val jarFile1 = File.createTempFile("someprefix1", "somesuffix 1", dir) + val jarFile2 = File.createTempFile("someprefix2", "somesuffix2", dir) + val jarFile3 = File.createTempFile("someprefix3", "somesuffix3", dir) + val jarFile4 = File.createTempFile("someprefix4", "somesuffix 4", dir) + + TestUtils.createJar(Seq(file1), jarFile1) + TestUtils.createJar(Seq(file2), jarFile2) + TestUtils.createJar(Seq(file3), jarFile3) + TestUtils.createJar(Seq(file4), jarFile4) + + sql(s"""ADD JAR "${jarFile1.getAbsolutePath}" ${jarFile2.getAbsoluteFile}""") + sql(s"ADD JARS ${jarFile3.getAbsolutePath} '${jarFile4.getAbsoluteFile}'") + val listFiles = sql(s"LIST JARS '${jarFile1.getAbsolutePath}' " + + s"${jarFile2.getAbsolutePath} ${jarFile3.getAbsolutePath} '${jarFile4.getAbsoluteFile}'") + assert(listFiles.count === 4) + assert(listFiles.filter( + _.getString(0).contains(jarFile1.getName.replace(" ", "%20"))).count() === 1) + assert(listFiles.filter(_.getString(0).contains(jarFile2.getName)).count() === 1) + assert(listFiles.filter(_.getString(0).contains(jarFile3.getName)).count() === 1) + assert(listFiles.filter( + _.getString(0).contains(jarFile4.getName.replace(" ", "%20"))).count() === 1) + } + } + + test("SPARK-35105: ADD ARCHIVES command with multiple files") { + withTempDir { dir => + val file1 = new File(dir, "test1.txt") + val file2 = new File(dir, "test2.txt") + val file3 = new File(dir, "test3.txt") + val file4 = new File(dir, "test4.txt") + + Files.write(file1.toPath, "file1".getBytes) + Files.write(file2.toPath, "file2".getBytes) + Files.write(file3.toPath, "file3".getBytes) + Files.write(file4.toPath, "file4".getBytes) + + val jarFile1 = File.createTempFile("someprefix1", "somesuffix1", dir) + val jarFile2 = File.createTempFile("someprefix2", "somesuffix 2", dir) + val jarFile3 = File.createTempFile("someprefix3", "somesuffix3", dir) + val jarFile4 = File.createTempFile("someprefix4", "somesuffix 4", dir) + + TestUtils.createJar(Seq(file1), jarFile1) + TestUtils.createJar(Seq(file2), jarFile2) + TestUtils.createJar(Seq(file3), jarFile3) + TestUtils.createJar(Seq(file4), jarFile4) + + sql(s"""ADD ARCHIVE ${jarFile1.getAbsolutePath} "${jarFile2.getAbsoluteFile}"""") + sql(s"ADD ARCHIVES ${jarFile3.getAbsolutePath} '${jarFile4.getAbsoluteFile}'") + val listFiles = sql(s"LIST ARCHIVES ${jarFile1.getAbsolutePath} " + + s"'${jarFile2.getAbsolutePath}' ${jarFile3.getAbsolutePath} '${jarFile4.getAbsolutePath}'") + assert(listFiles.count === 4) + assert(listFiles.filter(_.getString(0).contains(jarFile1.getName)).count() === 1) + assert(listFiles.filter( + _.getString(0).contains(jarFile2.getName.replace(" ", "%20"))).count() === 1) + assert(listFiles.filter(_.getString(0).contains(jarFile3.getName)).count() === 1) + assert(listFiles.filter( + _.getString(0).contains(jarFile4.getName.replace(" ", "%20"))).count() === 1) + } + } + + test("SPARK-34977: LIST FILES/JARS/ARCHIVES should handle multiple quoted path arguments") { + withTempDir { dir => + val file1 = File.createTempFile("someprefix1", "somesuffix1", dir) + val file2 = File.createTempFile("someprefix2", "somesuffix2", dir) + val file3 = File.createTempFile("someprefix3", "somesuffix 3", dir) + + Files.write(file1.toPath, "file1".getBytes) + Files.write(file2.toPath, "file2".getBytes) + Files.write(file3.toPath, "file3".getBytes) + + sql(s"ADD FILE ${file1.getAbsolutePath}") + sql(s"ADD FILE ${file2.getAbsolutePath}") + sql(s"ADD FILE '${file3.getAbsolutePath}'") + val listFiles = sql("LIST FILES " + + s"""'${file1.getAbsolutePath}' ${file2.getAbsolutePath} "${file3.getAbsolutePath}"""") + + assert(listFiles.count === 3) + assert(listFiles.filter(_.getString(0).contains(file1.getName)).count() === 1) + assert(listFiles.filter(_.getString(0).contains(file2.getName)).count() === 1) + assert(listFiles.filter( + _.getString(0).contains(file3.getName.replace(" ", "%20"))).count() === 1) + + val file4 = File.createTempFile("someprefix4", "somesuffix4", dir) + val file5 = File.createTempFile("someprefix5", "somesuffix5", dir) + val file6 = File.createTempFile("someprefix6", "somesuffix6", dir) + Files.write(file4.toPath, "file4".getBytes) + Files.write(file5.toPath, "file5".getBytes) + Files.write(file6.toPath, "file6".getBytes) + + val jarFile1 = new File(dir, "test1.jar") + val jarFile2 = new File(dir, "test2.jar") + val jarFile3 = new File(dir, "test 3.jar") + TestUtils.createJar(Seq(file4), jarFile1) + TestUtils.createJar(Seq(file5), jarFile2) + TestUtils.createJar(Seq(file6), jarFile3) + + sql(s"ADD ARCHIVE ${jarFile1.getAbsolutePath}") + sql(s"ADD ARCHIVE ${jarFile2.getAbsolutePath}#foo") + sql(s"ADD ARCHIVE '${jarFile3.getAbsolutePath}'") + val listArchives = sql(s"LIST ARCHIVES '${jarFile1.getAbsolutePath}' " + + s"""${jarFile2.getAbsolutePath} "${jarFile3.getAbsolutePath}"""") + + assert(listArchives.count === 3) + assert(listArchives.filter(_.getString(0).contains(jarFile1.getName)).count() === 1) + assert(listArchives.filter(_.getString(0).contains(jarFile2.getName)).count() === 1) + assert(listArchives.filter( + _.getString(0).contains(jarFile3.getName.replace(" ", "%20"))).count() === 1) + + val file7 = File.createTempFile("someprefix7", "somesuffix7", dir) + val file8 = File.createTempFile("someprefix8", "somesuffix8", dir) + val file9 = File.createTempFile("someprefix9", "somesuffix9", dir) + Files.write(file4.toPath, "file7".getBytes) + Files.write(file5.toPath, "file8".getBytes) + Files.write(file6.toPath, "file9".getBytes) + + val jarFile4 = new File(dir, "test4.jar") + val jarFile5 = new File(dir, "test5.jar") + val jarFile6 = new File(dir, "test 6.jar") + TestUtils.createJar(Seq(file7), jarFile4) + TestUtils.createJar(Seq(file8), jarFile5) + TestUtils.createJar(Seq(file9), jarFile6) + + sql(s"ADD JAR ${jarFile4.getAbsolutePath}") + sql(s"ADD JAR ${jarFile5.getAbsolutePath}") + sql(s"ADD JAR '${jarFile6.getAbsolutePath}'") + val listJars = sql(s"LIST JARS '${jarFile4.getAbsolutePath}' " + + s"""${jarFile5.getAbsolutePath} "${jarFile6.getAbsolutePath}"""") + assert(listJars.count === 3) + assert(listJars.filter(_.getString(0).contains(jarFile4.getName)).count() === 1) + assert(listJars.filter(_.getString(0).contains(jarFile5.getName)).count() === 1) + assert(listJars.filter( + _.getString(0).contains(jarFile6.getName.replace(" ", "%20"))).count() === 1) + } + } + createQueryTest("dynamic_partition", """ |DROP TABLE IF EXISTS dynamic_part_table; @@ -1221,6 +1500,28 @@ class HiveQuerySuite extends HiveComparisonTest with SQLTestUtils with BeforeAnd } } } + + test("SPARK-33084: Add jar support Ivy URI in SQL") { + val testData = TestHive.getHiveFile("data/files/sample.json").toURI + withTable("t") { + // hive-catalog-core has some transitive dependencies which dont exist on maven central + // and hence cannot be found in the test environment or are non-jar (.pom) which cause + // failures in tests. Use transitive=false as it should be good enough to test the Ivy + // support in Hive ADD JAR + sql(s"ADD JAR ivy://org.apache.hive.hcatalog:hive-hcatalog-core:$hiveVersion" + + "?transitive=false") + sql( + """CREATE TABLE t(a string, b string) + |ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'""".stripMargin) + sql(s"""LOAD DATA LOCAL INPATH "$testData" INTO TABLE t""") + sql("SELECT * FROM src JOIN t on src.key = t.a") + assert(sql("LIST JARS").filter(_.getString(0).contains( + s"org.apache.hive.hcatalog_hive-hcatalog-core-$hiveVersion.jar")).count() > 0) + assert(sql("LIST JAR"). + filter(_.getString(0).contains( + s"org.apache.hive.hcatalog_hive-hcatalog-core-$hiveVersion.jar")).count() > 0) + } + } } // for SPARK-2180 test diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSQLViewSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSQLViewSuite.scala index fa43ff14fd796..8aae7a1545b1a 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSQLViewSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSQLViewSuite.scala @@ -17,12 +17,12 @@ package org.apache.spark.sql.hive.execution -import org.apache.spark.sql.{AnalysisException, Row, SaveMode, SparkSession} +import org.apache.spark.sql.{AnalysisException, Row} import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.catalog.{CatalogStorageFormat, CatalogTable, CatalogTableType} import org.apache.spark.sql.execution.SQLViewSuite -import org.apache.spark.sql.hive.test.{TestHive, TestHiveSingleton} -import org.apache.spark.sql.types.StructType +import org.apache.spark.sql.hive.test.TestHiveSingleton +import org.apache.spark.sql.types.{NullType, StructType} /** * A test suite for Hive view related functionality. @@ -137,4 +137,24 @@ class HiveSQLViewSuite extends SQLViewSuite with TestHiveSingleton { } } } + + test("SPARK-20680: Add HiveVoidType to compatible with Hive void type") { + withView("v1") { + sql("create view v1 as select null as c") + val df = sql("select * from v1") + assert(df.schema.fields.head.dataType == NullType) + checkAnswer( + df, + Row(null) + ) + + sql("alter view v1 as select null as c1, 1 as c2") + val df2 = sql("select * from v1") + assert(df2.schema.fields.head.dataType == NullType) + checkAnswer( + df2, + Row(null, 1) + ) + } + } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveScriptTransformationSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveScriptTransformationSuite.scala new file mode 100644 index 0000000000000..71a745b180494 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveScriptTransformationSuite.scala @@ -0,0 +1,574 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution + +import java.sql.Timestamp +import java.time.{Duration, Period} +import java.time.temporal.ChronoUnit + +import org.apache.hadoop.hive.serde2.`lazy`.LazySimpleSerDe +import org.scalatest.exceptions.TestFailedException + +import org.apache.spark.{SparkException, TestUtils} +import org.apache.spark.sql.Row +import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference} +import org.apache.spark.sql.catalyst.util.DateTimeConstants +import org.apache.spark.sql.execution._ +import org.apache.spark.sql.functions._ +import org.apache.spark.sql.hive.test.TestHiveSingleton +import org.apache.spark.sql.types._ +import org.apache.spark.unsafe.types.CalendarInterval + +class HiveScriptTransformationSuite extends BaseScriptTransformationSuite with TestHiveSingleton { + import testImplicits._ + + import ScriptTransformationIOSchema._ + + override protected def defaultSerDe(): String = "hive-serde" + + override def createScriptTransformationExec( + script: String, + output: Seq[Attribute], + child: SparkPlan, + ioschema: ScriptTransformationIOSchema): BaseScriptTransformationExec = { + HiveScriptTransformationExec( + script = script, + output = output, + child = child, + ioschema = ioschema + ) + } + + private val hiveIOSchema: ScriptTransformationIOSchema = { + defaultIOSchema.copy( + inputSerdeClass = Some(classOf[LazySimpleSerDe].getCanonicalName), + outputSerdeClass = Some(classOf[LazySimpleSerDe].getCanonicalName) + ) + } + + test("cat with LazySimpleSerDe") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + + val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") + checkAnswer( + rowsDf, + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq(AttributeReference("a", StringType)()), + child = child, + ioschema = hiveIOSchema + ), + rowsDf.collect()) + assert(uncaughtExceptionHandler.exception.isEmpty) + } + + test("script transformation should not swallow errors from upstream operators (hive serde)") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + + val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") + val e = intercept[TestFailedException] { + checkAnswer( + rowsDf, + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq(AttributeReference("a", StringType)()), + child = ExceptionInjectingOperator(child), + ioschema = hiveIOSchema + ), + rowsDf.collect()) + } + assert(e.getMessage().contains("intentional exception")) + // Before SPARK-25158, uncaughtExceptionHandler will catch IllegalArgumentException + assert(uncaughtExceptionHandler.exception.isEmpty) + } + + test("SPARK-14400 script transformation should fail for bad script command (hive serde)") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + + val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") + + val e = intercept[SparkException] { + val plan = + createScriptTransformationExec( + script = "some_non_existent_command", + output = Seq(AttributeReference("a", StringType)()), + child = rowsDf.queryExecution.sparkPlan, + ioschema = hiveIOSchema) + SparkPlanTest.executePlan(plan, hiveContext) + } + assert(e.getMessage.contains("Subprocess exited with status")) + assert(uncaughtExceptionHandler.exception.isEmpty) + } + + test("SPARK-24339 verify the result after pruning the unused columns (hive serde)") { + val rowsDf = Seq( + ("Bob", 16, 176), + ("Alice", 32, 164), + ("David", 60, 192), + ("Amy", 24, 180) + ).toDF("name", "age", "height") + + checkAnswer( + rowsDf, + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq(AttributeReference("name", StringType)()), + child = child, + ioschema = hiveIOSchema + ), + rowsDf.select("name").collect()) + assert(uncaughtExceptionHandler.exception.isEmpty) + } + + test("SPARK-30973: TRANSFORM should wait for the termination of the script (hive serde)") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + + val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") + val e = intercept[SparkException] { + val plan = + createScriptTransformationExec( + script = "some_non_existent_command", + output = Seq(AttributeReference("a", StringType)()), + child = rowsDf.queryExecution.sparkPlan, + ioschema = hiveIOSchema) + SparkPlanTest.executePlan(plan, hiveContext) + } + assert(e.getMessage.contains("Subprocess exited with status")) + assert(uncaughtExceptionHandler.exception.isEmpty) + } + + test("SPARK-32388: TRANSFORM should handle schema less correctly (hive serde)") { + withTempView("v") { + val df = Seq( + (1, "1", 1.0, BigDecimal(1.0), new Timestamp(1)), + (2, "2", 2.0, BigDecimal(2.0), new Timestamp(2)), + (3, "3", 3.0, BigDecimal(3.0), new Timestamp(3)) + ).toDF("a", "b", "c", "d", "e") // Note column d's data type is Decimal(38, 18) + df.createTempView("v") + + // In hive default serde mode, if we don't define output schema, + // when output column size > 2 and don't specify serde, + // it will choose take rest columns in second column as output schema + // (key: String, value: String) + checkAnswer( + sql( + s""" + |SELECT TRANSFORM(a, b, c, d, e) + | USING 'cat' + |FROM v + """.stripMargin), + identity, + df.select( + 'a.cast("string").as("key"), + concat_ws("\t", + 'b.cast("string"), + 'c.cast("string"), + 'd.cast("string"), + 'e.cast("string")).as("value")).collect()) + + // In hive default serde mode, if we don't define output schema, + // when output column size > 2 and just specify serde, + // it will choose take rest columns in second column as output schema + // (key: String, value: String) + checkAnswer( + sql( + s""" + |SELECT TRANSFORM(a, b, c, d, e) + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = '\t' + | ) + | USING 'cat' + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = '\t' + | ) + |FROM v + """.stripMargin), + identity, + df.select( + 'a.cast("string").as("key"), + 'b.cast("string").as("value")).collect()) + + + // In hive default serde mode, if we don't define output schema, + // when output column size > 2 and specify serde with + // 'serialization.last.column.takes.rest=true', + // it will choose take rest columns in second column as output schema + // (key: String, value: String) + checkAnswer( + sql( + s""" + |SELECT TRANSFORM(a, b, c, d, e) + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = '\t', + | 'serialization.last.column.takes.rest' = 'true' + | ) + | USING 'cat' + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = '\t', + | 'serialization.last.column.takes.rest' = 'true' + | ) + |FROM v + """.stripMargin), + identity, + df.select( + 'a.cast("string").as("key"), + concat_ws("\t", + 'b.cast("string"), + 'c.cast("string"), + 'd.cast("string"), + 'e.cast("string")).as("value")).collect()) + + // In hive default serde mode, if we don't define output schema, + // when output column size > 2 and specify serde + // with 'serialization.last.column.takes.rest=false', + // it will choose first two column as output schema (key: String, value: String) + checkAnswer( + sql( + s""" + |SELECT TRANSFORM(a, b, c, d, e) + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = '\t', + | 'serialization.last.column.takes.rest' = 'false' + | ) + | USING 'cat' + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = '\t', + | 'serialization.last.column.takes.rest' = 'false' + | ) + |FROM v + """.stripMargin), + identity, + df.select( + 'a.cast("string").as("key"), + 'b.cast("string").as("value")).collect()) + + // In hive default serde mode, if we don't define output schema, + // when output column size = 2 and specify serde, it will these two column as + // output schema (key: String, value: String) + checkAnswer( + sql( + s""" + |SELECT TRANSFORM(a, b) + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = '\t', + | 'serialization.last.column.takes.rest' = 'true' + | ) + | USING 'cat' + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = '\t', + | 'serialization.last.column.takes.rest' = 'true' + | ) + |FROM v + """.stripMargin), + identity, + df.select( + 'a.cast("string").as("key"), + 'b.cast("string").as("value")).collect()) + + // In hive default serde mode, if we don't define output schema, + // when output column size < 2 and specify serde, it will return null for deficiency + // output schema (key: String, value: String) + checkAnswer( + sql( + s""" + |SELECT TRANSFORM(a) + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = '\t', + | 'serialization.last.column.takes.rest' = 'true' + | ) + | USING 'cat' + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = '\t', + | 'serialization.last.column.takes.rest' = 'true' + | ) + |FROM v + """.stripMargin), + identity, + df.select( + 'a.cast("string").as("key"), + lit(null)).collect()) + } + } + + testBasicInputDataTypesWith(hiveIOSchema, "hive serde") + + test("SPARK-32400: TRANSFORM supports complex data types type (hive serde)") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + withTempView("v") { + val df = Seq( + (1, "1", Array(0, 1, 2), Map("a" -> 1)), + (2, "2", Array(3, 4, 5), Map("b" -> 2)) + ).toDF("a", "b", "c", "d") + .select('a, 'b, 'c, 'd, struct('a, 'b).as("e")) + df.createTempView("v") + + // Hive serde support ArrayType/MapType/StructType as input and output data type + checkAnswer( + df.select('c, 'd, 'e), + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq( + AttributeReference("c", ArrayType(IntegerType))(), + AttributeReference("d", MapType(StringType, IntegerType))(), + AttributeReference("e", StructType( + Seq( + StructField("col1", IntegerType, false), + StructField("col2", StringType, true))))()), + child = child, + ioschema = hiveIOSchema + ), + df.select('c, 'd, 'e).collect()) + } + } + + test("SPARK-32400: TRANSFORM supports complex data types end to end (hive serde)") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + withTempView("v") { + val df = Seq( + (1, "1", Array(0, 1, 2), Map("a" -> 1)), + (2, "2", Array(3, 4, 5), Map("b" -> 2)) + ).toDF("a", "b", "c", "d") + .select('a, 'b, 'c, 'd, struct('a, 'b).as("e")) + df.createTempView("v") + + // Hive serde support ArrayType/MapType/StructType as input and output data type + val query = sql( + """ + |SELECT TRANSFORM (c, d, e) + |USING 'cat' AS (c array, d map, e struct) + |FROM v + """.stripMargin) + checkAnswer(query, identity, df.select('c, 'd, 'e).collect()) + } + } + + test("SPARK-32400: TRANSFORM doesn't support CalendarIntervalType/UserDefinedType (hive serde)") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + withTempView("v") { + val df = Seq( + (1, new CalendarInterval(7, 1, 1000), new TestUDT.MyDenseVector(Array(1, 2, 3))), + (1, new CalendarInterval(7, 1, 1000), new TestUDT.MyDenseVector(Array(1, 2, 3))) + ).toDF("a", "b", "c") + df.createTempView("v") + + val e1 = intercept[SparkException] { + val plan = createScriptTransformationExec( + script = "cat", + output = Seq( + AttributeReference("a", IntegerType)(), + AttributeReference("b", CalendarIntervalType)()), + child = df.select('a, 'b).queryExecution.sparkPlan, + ioschema = hiveIOSchema) + SparkPlanTest.executePlan(plan, hiveContext) + }.getMessage + assert(e1.contains("interval cannot be converted to Hive TypeInfo")) + + val e2 = intercept[SparkException] { + val plan = createScriptTransformationExec( + script = "cat", + output = Seq( + AttributeReference("a", IntegerType)(), + AttributeReference("c", new TestUDT.MyDenseVectorUDT)()), + child = df.select('a, 'c).queryExecution.sparkPlan, + ioschema = hiveIOSchema) + SparkPlanTest.executePlan(plan, hiveContext) + }.getMessage + assert(e2.contains("array cannot be converted to Hive TypeInfo")) + } + } + + test("SPARK-32400: TRANSFORM doesn't support" + + " CalendarIntervalType/UserDefinedType end to end (hive serde)") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + withTempView("v") { + val df = Seq( + (1, new CalendarInterval(7, 1, 1000), new TestUDT.MyDenseVector(Array(1, 2, 3))), + (1, new CalendarInterval(7, 1, 1000), new TestUDT.MyDenseVector(Array(1, 2, 3))) + ).toDF("a", "b", "c") + df.createTempView("v") + + val e1 = intercept[SparkException] { + sql( + """ + |SELECT TRANSFORM(a, b) USING 'cat' AS (a, b) + |FROM v + """.stripMargin).collect() + }.getMessage + assert(e1.contains("interval cannot be converted to Hive TypeInfo")) + + val e2 = intercept[SparkException] { + sql( + """ + |SELECT TRANSFORM(a, c) USING 'cat' AS (a, c) + |FROM v + """.stripMargin).collect() + }.getMessage + assert(e2.contains("array cannot be converted to Hive TypeInfo")) + } + } + + test("SPARK-32685: When use specified serde, filed.delim's default value is '\t'") { + val query1 = sql( + """ + |SELECT split(value, "\t") FROM ( + |SELECT TRANSFORM(a, b, c) + |USING 'cat' + |FROM (SELECT 1 AS a, 2 AS b, 3 AS c) t + |) temp; + """.stripMargin) + checkAnswer(query1, identity, Row(Seq("2", "3")) :: Nil) + + val query2 = sql( + """ + |SELECT split(value, "\t") FROM ( + |SELECT TRANSFORM(a, b, c) + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + |USING 'cat' + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'serialization.last.column.takes.rest' = 'true' + | ) + |FROM (SELECT 1 AS a, 2 AS b, 3 AS c) t + |) temp; + """.stripMargin) + checkAnswer(query2, identity, Row(Seq("2", "3")) :: Nil) + + val query3 = sql( + """ + |SELECT split(value, "&") FROM ( + |SELECT TRANSFORM(a, b, c) + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = '&' + | ) + |USING 'cat' + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'serialization.last.column.takes.rest' = 'true', + | 'field.delim' = '&' + | ) + |FROM (SELECT 1 AS a, 2 AS b, 3 AS c) t + |) temp; + """.stripMargin) + checkAnswer(query3, identity, Row(Seq("2", "3")) :: Nil) + + val query4 = sql( + """ + |SELECT split(value, "&") FROM ( + |SELECT TRANSFORM(a, b, c) + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + |USING 'cat' + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'serialization.last.column.takes.rest' = 'true', + | 'field.delim' = '&' + | ) + |FROM (SELECT 1 AS a, 2 AS b, 3 AS c) t + |) temp; + """.stripMargin) + checkAnswer(query4, identity, Row(null) :: Nil) + } + + test("SPARK-32684: Script transform hive serde mode null format is same with hive as '\\N'") { + val query1 = sql( + """ + |SELECT TRANSFORM(null, null, null) + |USING 'cat' + |FROM (SELECT 1 AS a) t + """.stripMargin) + checkAnswer(query1, identity, Row(null, "\\N\t\\N") :: Nil) + + val query2 = sql( + """ + |SELECT TRANSFORM(null, null, null) + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = ',' + | ) + |USING 'cat' AS (a) + | ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe' + | WITH SERDEPROPERTIES ( + | 'field.delim' = '&' + | ) + |FROM (SELECT 1 AS a) t + """.stripMargin) + checkAnswer(query2, identity, Row("\\N,\\N,\\N") :: Nil) + + } + + test("SPARK-34879: HiveInspectors supports DayTimeIntervalType and YearMonthIntervalType") { + assume(TestUtils.testCommandAvailable("/bin/bash")) + withTempView("v") { + val df = Seq( + (Duration.ofDays(1), + Duration.ofSeconds(100).plusNanos(123456), + Duration.of(Long.MaxValue, ChronoUnit.MICROS), + Period.ofMonths(10)), + (Duration.ofDays(1), + Duration.ofSeconds(100).plusNanos(1123456789), + Duration.ofSeconds(Long.MaxValue / DateTimeConstants.MICROS_PER_SECOND), + Period.ofMonths(10)) + ).toDF("a", "b", "c", "d") + df.createTempView("v") + + // Hive serde supports DayTimeIntervalType/YearMonthIntervalType as input and output data type + checkAnswer( + df, + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq( + AttributeReference("a", DayTimeIntervalType)(), + AttributeReference("b", DayTimeIntervalType)(), + AttributeReference("c", DayTimeIntervalType)(), + AttributeReference("d", YearMonthIntervalType)()), + child = child, + ioschema = hiveIOSchema), + df.select($"a", $"b", $"c", $"d").collect()) + } + } + + test("SPARK-34879: HiveInspectors throw overflow when" + + " HiveIntervalDayTime overflow then DayTimeIntervalType") { + withTempView("v") { + val df = Seq(("579025220 15:30:06.000001000")).toDF("a") + df.createTempView("v") + + val e = intercept[Exception] { + checkAnswer( + df, + (child: SparkPlan) => createScriptTransformationExec( + script = "cat", + output = Seq(AttributeReference("a", DayTimeIntervalType)()), + child = child, + ioschema = hiveIOSchema), + df.select($"a").collect()) + }.getMessage + assert(e.contains("java.lang.ArithmeticException: long overflow")) + } + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSerDeReadWriteSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSerDeReadWriteSuite.scala index f8ba7bf2c1a62..aae49f70ca93f 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSerDeReadWriteSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSerDeReadWriteSuite.scala @@ -135,11 +135,12 @@ class HiveSerDeReadWriteSuite extends QueryTest with SQLTestUtils with TestHiveS } // MAP withTable("hive_serde") { - hiveClient.runSqlHive(s"CREATE TABLE hive_serde (c1 MAP ) STORED AS $fileFormat") - hiveClient.runSqlHive("INSERT INTO TABLE hive_serde SELECT MAP(1, 'a') FROM (SELECT 1) t") - checkAnswer(spark.table("hive_serde"), Row(Map(1 -> "a"))) - spark.sql("INSERT INTO TABLE hive_serde SELECT MAP(2, 'b')") - checkAnswer(spark.table("hive_serde"), Seq(Row(Map(1 -> "a")), Row(Map(2 -> "b")))) + hiveClient.runSqlHive( + s"CREATE TABLE hive_serde (c1 MAP ) STORED AS $fileFormat") + hiveClient.runSqlHive("INSERT INTO TABLE hive_serde SELECT MAP('1', 'a') FROM (SELECT 1) t") + checkAnswer(spark.table("hive_serde"), Row(Map("1" -> "a"))) + spark.sql("INSERT INTO TABLE hive_serde SELECT MAP('2', 'b')") + checkAnswer(spark.table("hive_serde"), Seq(Row(Map("1" -> "a")), Row(Map("2" -> "b")))) } // STRUCT @@ -154,7 +155,7 @@ class HiveSerDeReadWriteSuite extends QueryTest with SQLTestUtils with TestHiveS } } - Seq("PARQUET", "ORC").foreach { fileFormat => + Seq("SEQUENCEFILE", "TEXTFILE", "RCFILE", "ORC", "PARQUET", "AVRO").foreach { fileFormat => test(s"Read/Write Hive $fileFormat serde table") { // Numeric Types checkNumericTypes(fileFormat, "TINYINT", 2) diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSerDeSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSerDeSuite.scala index 24b1e3405379c..d7129bcb37e69 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSerDeSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveSerDeSuite.scala @@ -21,11 +21,10 @@ import java.net.URI import org.scalatest.BeforeAndAfterAll -import org.apache.spark.sql.{AnalysisException, SaveMode, SparkSession} +import org.apache.spark.sql.{AnalysisException, SparkSession} import org.apache.spark.sql.catalyst.catalog.CatalogTable import org.apache.spark.sql.catalyst.plans.PlanTest import org.apache.spark.sql.execution.command.{CreateTableCommand, DDLUtils} -import org.apache.spark.sql.execution.datasources.CreateTable import org.apache.spark.sql.execution.metric.InputOutputMetricsHelper import org.apache.spark.sql.hive.test.TestHive import org.apache.spark.sql.internal.{HiveSerDe, SQLConf} @@ -71,8 +70,8 @@ class HiveSerDeSuite extends HiveComparisonTest with PlanTest with BeforeAndAfte } private def extractTableDesc(sql: String): (CatalogTable, Boolean) = { - TestHive.sessionState.sqlParser.parsePlan(sql).collect { - case CreateTable(tableDesc, mode, _) => (tableDesc, mode == SaveMode.Ignore) + TestHive.sessionState.analyzer.execute(TestHive.sessionState.sqlParser.parsePlan(sql)).collect { + case CreateTableCommand(tableDesc, ifNotExists) => (tableDesc, ifNotExists) }.head } @@ -89,7 +88,7 @@ class HiveSerDeSuite extends HiveComparisonTest with PlanTest with BeforeAndAfte test("Test the default fileformat for Hive-serde tables") { withSQLConf("hive.default.fileformat" -> "orc") { val (desc, exists) = extractTableDesc( - "CREATE TABLE IF NOT EXISTS fileformat_test (id int)") + "CREATE TABLE IF NOT EXISTS fileformat_test (id int) USING hive") assert(exists) assert(desc.storage.inputFormat == Some("org.apache.hadoop.hive.ql.io.orc.OrcInputFormat")) assert(desc.storage.outputFormat == Some("org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat")) @@ -97,7 +96,8 @@ class HiveSerDeSuite extends HiveComparisonTest with PlanTest with BeforeAndAfte } withSQLConf("hive.default.fileformat" -> "parquet") { - val (desc, exists) = extractTableDesc("CREATE TABLE IF NOT EXISTS fileformat_test (id int)") + val (desc, exists) = extractTableDesc( + "CREATE TABLE IF NOT EXISTS fileformat_test (id int) USING hive") assert(exists) val input = desc.storage.inputFormat val output = desc.storage.outputFormat diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveTableScanSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveTableScanSuite.scala index 67d7ed0841abb..5b43f82f253ea 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveTableScanSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveTableScanSuite.scala @@ -17,7 +17,10 @@ package org.apache.spark.sql.hive.execution +import java.io.{File, IOException} + import org.apache.spark.sql.Row +import org.apache.spark.sql.functions.col import org.apache.spark.sql.hive.test.{TestHive, TestHiveSingleton} import org.apache.spark.sql.hive.test.TestHive._ import org.apache.spark.sql.hive.test.TestHive.implicits._ @@ -110,6 +113,7 @@ class HiveTableScanSuite extends HiveComparisonTest with SQLTestUtils with TestH sql( s""" |CREATE TABLE $table(id string) + |USING hive |PARTITIONED BY (p1 string,p2 string,p3 string,p4 string,p5 string) """.stripMargin) sql( @@ -154,6 +158,7 @@ class HiveTableScanSuite extends HiveComparisonTest with SQLTestUtils with TestH sql( s""" |CREATE TABLE $table(id string) + |USING hive |PARTITIONED BY (p1 string,p2 string,p3 string,p4 string,p5 string) """.stripMargin) sql( @@ -179,6 +184,7 @@ class HiveTableScanSuite extends HiveComparisonTest with SQLTestUtils with TestH sql( s""" |CREATE TABLE $table (id int) + |USING hive |PARTITIONED BY (a int, b int) """.stripMargin) val scan1 = getHiveTableScanExec(s"SELECT * FROM $table WHERE a = 1 AND b = 2") @@ -187,6 +193,86 @@ class HiveTableScanSuite extends HiveComparisonTest with SQLTestUtils with TestH } } + test("SPARK-32867: When explain, HiveTableRelation show limited message") { + withSQLConf("hive.exec.dynamic.partition.mode" -> "nonstrict") { + withTable("df") { + spark.range(30) + .select(col("id"), col("id").as("k")) + .write + .partitionBy("k") + .format("hive") + .mode("overwrite") + .saveAsTable("df") + + val scan1 = getHiveTableScanExec("SELECT * FROM df WHERE df.k < 3") + assert(scan1.simpleString(100).replaceAll("#\\d+L", "") == + "Scan hive default.df [id, k]," + + " HiveTableRelation [" + + "`default`.`df`," + + " org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe," + + " Data Cols: [id]," + + " Partition Cols: [k]," + + " Pruned Partitions: [(k=0), (k=1), (k=2)]" + + "]," + + " [isnotnull(k), (k < 3)]") + + val scan2 = getHiveTableScanExec("SELECT * FROM df WHERE df.k < 30") + assert(scan2.simpleString(100).replaceAll("#\\d+L", "") == + "Scan hive default.df [id, k]," + + " HiveTableRelation [" + + "`default`.`df`," + + " org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe," + + " Data Cols: [id]," + + " Partition Cols: [k]," + + " Pruned Partitions: [(k=0), (k=1), (k=10), (k=11), (k=12), (k=13), (k=14), (k=15)," + + " (k=16), (k=17), (k=18), (k=19), (k..." + + "]," + + " [isnotnull(k), (k < 30)]") + + sql( + """ + |ALTER TABLE df PARTITION (k=10) SET SERDE + |'org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe'; + """.stripMargin) + + val scan3 = getHiveTableScanExec("SELECT * FROM df WHERE df.k < 30") + assert(scan3.simpleString(100).replaceAll("#\\d+L", "") == + "Scan hive default.df [id, k]," + + " HiveTableRelation [" + + "`default`.`df`," + + " org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe," + + " Data Cols: [id]," + + " Partition Cols: [k]," + + " Pruned Partitions: [(k=0), (k=1)," + + " (k=10, org.apache.hadoop.hive.serde2.columnar.ColumnarSerDe)," + + " (k=11), (k=12), (k=1..." + + "]," + + " [isnotnull(k), (k < 30)]") + } + } + } + + test("SPARK-32069: Improve error message on reading unexpected directory") { + withTable("t") { + withTempDir { f => + sql(s"CREATE TABLE t(i LONG) USING hive LOCATION '${f.getAbsolutePath}'") + sql("INSERT INTO t VALUES(1)") + val dir = new File(f.getCanonicalPath + "/data") + dir.mkdir() + sql("set mapreduce.input.fileinputformat.input.dir.recursive=true") + assert(sql("select * from t").collect().head.getLong(0) == 1) + sql("set mapreduce.input.fileinputformat.input.dir.recursive=false") + val e = intercept[IOException] { + sql("SELECT * FROM t").collect() + } + assert(e.getMessage.contains(s"Path: ${dir.getAbsoluteFile} is a directory, " + + s"which is not supported by the record reader " + + s"when `mapreduce.input.fileinputformat.input.dir.recursive` is false.")) + dir.delete() + } + } + } + private def getHiveTableScanExec(query: String): HiveTableScanExec = { sql(query).queryExecution.sparkPlan.collectFirst { case p: HiveTableScanExec => p diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDAFSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDAFSuite.scala index 9e33a8ee4cc5c..ed44dcd8d7a29 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDAFSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDAFSuite.scala @@ -161,6 +161,20 @@ class HiveUDAFSuite extends QueryTest checkAnswer(sql("select histogram_numeric(a,2) from abc where a=3"), Row(null)) } } + + test("SPARK-32243: Spark UDAF Invalid arguments number error should throw earlier") { + // func need two arguments + val functionName = "longProductSum" + val functionClass = "org.apache.spark.sql.hive.execution.LongProductSum" + withUserDefinedFunction(functionName -> true) { + sql(s"CREATE TEMPORARY FUNCTION $functionName AS '$functionClass'") + val e = intercept[AnalysisException] { + sql(s"SELECT $functionName(100)") + }.getMessage + assert(e.contains( + s"Invalid number of arguments for function $functionName. Expected: 2; Found: 1;")) + } + } } /** diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDFSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDFSuite.scala index 7bca2af379934..f98828760b410 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDFSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/HiveUDFSuite.scala @@ -20,6 +20,8 @@ package org.apache.spark.sql.hive.execution import java.io.{DataInput, DataOutput, File, PrintWriter} import java.util.{ArrayList, Arrays, Properties} +import scala.collection.JavaConverters._ + import org.apache.hadoop.conf.Configuration import org.apache.hadoop.hive.ql.exec.UDF import org.apache.hadoop.hive.ql.udf.{UDAFPercentile, UDFType} @@ -30,6 +32,7 @@ import org.apache.hadoop.hive.serde2.objectinspector.{ObjectInspector, ObjectIns import org.apache.hadoop.hive.serde2.objectinspector.primitive.PrimitiveObjectInspectorFactory import org.apache.hadoop.io.{LongWritable, Writable} +import org.apache.spark.{SparkFiles, TestUtils} import org.apache.spark.sql.{AnalysisException, QueryTest, Row} import org.apache.spark.sql.catalyst.plans.logical.Project import org.apache.spark.sql.execution.command.FunctionsCommand @@ -434,8 +437,8 @@ class HiveUDFSuite extends QueryTest with TestHiveSingleton with SQLTestUtils { withTempView("tab1") { Seq(Tuple1(1451400761)).toDF("test_date").createOrReplaceTempView("tab1") sql(s"CREATE TEMPORARY FUNCTION testUDFToDate AS '${classOf[GenericUDFToDate].getName}'") - val count = sql("select testUDFToDate(cast(test_date as timestamp))" + - " from tab1 group by testUDFToDate(cast(test_date as timestamp))").count() + val count = sql("select testUDFToDate(timestamp_seconds(test_date))" + + " from tab1 group by testUDFToDate(timestamp_seconds(test_date))").count() sql("DROP TEMPORARY FUNCTION IF EXISTS testUDFToDate") assert(count == 1) } @@ -658,6 +661,65 @@ class HiveUDFSuite extends QueryTest with TestHiveSingleton with SQLTestUtils { } } + test("SPARK-32877: add test for Hive UDF complex decimal type") { + withUserDefinedFunction("testArraySum" -> false) { + sql(s"CREATE FUNCTION testArraySum AS '${classOf[ArraySumUDF].getName}'") + checkAnswer( + sql("SELECT testArraySum(array(1, 1.1, 1.2))"), + Seq(Row(3.3))) + + val msg = intercept[AnalysisException] { + sql("SELECT testArraySum(1)") + }.getMessage + assert(msg.contains(s"No handler for UDF/UDAF/UDTF '${classOf[ArraySumUDF].getName}'")) + + val msg2 = intercept[AnalysisException] { + sql("SELECT testArraySum(1, 2)") + }.getMessage + assert(msg2.contains(s"No handler for UDF/UDAF/UDTF '${classOf[ArraySumUDF].getName}'")) + } + } + + test("SPARK-35236: CREATE FUNCTION should take an archive in USING clause") { + withTempDir { dir => + withUserDefinedFunction("testListFiles1" -> false) { + val text1 = File.createTempFile("test1_", ".txt", dir) + val json1 = File.createTempFile("test1_", ".json", dir) + val zipFile1 = File.createTempFile("test1_", ".zip", dir) + TestUtils.createJar(Seq(text1, json1), zipFile1) + + sql(s"CREATE FUNCTION testListFiles1 AS '${classOf[ListFiles].getName}' " + + s"USING ARCHIVE '${zipFile1.getAbsolutePath}'") + val df1 = sql(s"SELECT testListFiles1('${SparkFiles.get(zipFile1.getName)}')") + val fileList1 = + df1.collect().map(_.getList[String](0)).head.asScala.filter(_ != "META-INF") + + assert(fileList1.length === 2) + assert(fileList1.contains(text1.getName)) + assert(fileList1.contains(json1.getName)) + } + + // Test for file#alias style archive registration. + withUserDefinedFunction("testListFiles2" -> false) { + val text2 = File.createTempFile("test2_", ".txt", dir) + val json2 = File.createTempFile("test2_", ".json", dir) + val csv2 = File.createTempFile("test2", ".csv", dir) + val zipFile2 = File.createTempFile("test2_", ".zip", dir) + TestUtils.createJar(Seq(text2, json2, csv2), zipFile2) + + sql(s"CREATE FUNCTION testListFiles2 AS '${classOf[ListFiles].getName}' " + + s"USING ARCHIVE '${zipFile2.getAbsolutePath}#foo'") + val df2 = sql(s"SELECT testListFiles2('${SparkFiles.get("foo")}')") + val fileList2 = + df2.collect().map(_.getList[String](0)).head.asScala.filter(_ != "META-INF") + + assert(fileList2.length === 3) + assert(fileList2.contains(text2.getName)) + assert(fileList2.contains(json2.getName)) + assert(fileList2.contains(csv2.getName)) + } + } + } } class TestPair(x: Int, y: Int) extends Writable with Serializable { @@ -741,3 +803,21 @@ class StatelessUDF extends UDF { result } } + +class ArraySumUDF extends UDF { + def evaluate(values: java.util.List[java.lang.Double]): java.lang.Double = { + var r = 0d + for (v <- values.asScala) { + r += v + } + r + } +} + +class ListFiles extends UDF { + import java.util.{ArrayList, Arrays, List => JList} + def evaluate(path: String): JList[String] = { + val fileArray = new File(path).list() + if (fileArray != null) Arrays.asList(fileArray: _*) else new ArrayList[String]() + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/Hive_2_1_DDLSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/Hive_2_1_DDLSuite.scala index b20ef035594da..6f37e39a532d6 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/Hive_2_1_DDLSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/Hive_2_1_DDLSuite.scala @@ -27,13 +27,14 @@ import org.apache.spark.sql.hive.{HiveExternalCatalog, HiveUtils} import org.apache.spark.sql.hive.test.TestHiveSingleton import org.apache.spark.sql.internal.StaticSQLConf._ import org.apache.spark.sql.types._ -import org.apache.spark.tags.ExtendedHiveTest +import org.apache.spark.tags.{ExtendedHiveTest, SlowHiveTest} import org.apache.spark.util.Utils /** * A separate set of DDL tests that uses Hive 2.1 libraries, which behave a little differently * from the built-in ones. */ +@SlowHiveTest @ExtendedHiveTest class Hive_2_1_DDLSuite extends SparkFunSuite with TestHiveSingleton with BeforeAndAfterEach with BeforeAndAfterAll { diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/ObjectHashAggregateSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/ObjectHashAggregateSuite.scala index 327e4104d59a8..2bca25ed48d97 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/ObjectHashAggregateSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/ObjectHashAggregateSuite.scala @@ -20,11 +20,9 @@ package org.apache.spark.sql.hive.execution import scala.util.Random import org.apache.hadoop.hive.ql.udf.generic.GenericUDAFMax -import org.scalatest.Matchers._ +import org.scalatest.matchers.must.Matchers._ import org.apache.spark.sql._ -import org.apache.spark.sql.catalyst.FunctionIdentifier -import org.apache.spark.sql.catalyst.analysis.UnresolvedFunction import org.apache.spark.sql.catalyst.expressions.{ExpressionEvalHelper, Literal} import org.apache.spark.sql.catalyst.expressions.aggregate.ApproximatePercentile import org.apache.spark.sql.execution.adaptive.AdaptiveSparkPlanHelper @@ -221,7 +219,7 @@ class ObjectHashAggregateSuite val withPartialSafe = max($"c2") // A Spark SQL native distinct aggregate function - val withDistinct = countDistinct($"c3") + val withDistinct = count_distinct($"c3") val allAggs = Seq( "typed" -> typed, diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruneFileSourcePartitionsSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruneFileSourcePartitionsSuite.scala index c9c36992906a8..ab37645b1c90c 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruneFileSourcePartitionsSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruneFileSourcePartitionsSuite.scala @@ -17,24 +17,24 @@ package org.apache.spark.sql.hive.execution -import org.scalatest.Matchers._ +import org.scalatest.matchers.should.Matchers._ -import org.apache.spark.sql.QueryTest import org.apache.spark.sql.catalyst.TableIdentifier import org.apache.spark.sql.catalyst.dsl.expressions._ import org.apache.spark.sql.catalyst.dsl.plans._ import org.apache.spark.sql.catalyst.plans.logical.{Filter, LogicalPlan, Project} import org.apache.spark.sql.catalyst.rules.RuleExecutor +import org.apache.spark.sql.execution.{FileSourceScanExec, SparkPlan} import org.apache.spark.sql.execution.datasources.{CatalogFileIndex, HadoopFsRelation, LogicalRelation, PruneFileSourcePartitions} import org.apache.spark.sql.execution.datasources.parquet.ParquetFileFormat import org.apache.spark.sql.execution.joins.BroadcastHashJoinExec import org.apache.spark.sql.functions.broadcast -import org.apache.spark.sql.hive.test.TestHiveSingleton import org.apache.spark.sql.internal.SQLConf -import org.apache.spark.sql.test.SQLTestUtils import org.apache.spark.sql.types.StructType -class PruneFileSourcePartitionsSuite extends QueryTest with SQLTestUtils with TestHiveSingleton { +class PruneFileSourcePartitionsSuite extends PrunePartitionSuiteBase { + + override def format: String = "parquet" object Optimize extends RuleExecutor[LogicalPlan] { val batches = Batch("PruneFileSourcePartitions", Once, PruneFileSourcePartitions) :: Nil @@ -108,4 +108,10 @@ class PruneFileSourcePartitionsSuite extends QueryTest with SQLTestUtils with Te } } } + + override def getScanExecPartitionSize(plan: SparkPlan): Long = { + plan.collectFirst { + case p: FileSourceScanExec => p + }.get.selectedPartitions.length + } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruneHiveTablePartitionsSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruneHiveTablePartitionsSuite.scala index e41709841a736..677b250960960 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruneHiveTablePartitionsSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PruneHiveTablePartitionsSuite.scala @@ -17,14 +17,16 @@ package org.apache.spark.sql.hive.execution -import org.apache.spark.sql.QueryTest import org.apache.spark.sql.catalyst.analysis.EliminateSubqueryAliases -import org.apache.spark.sql.catalyst.plans.logical.LogicalPlan +import org.apache.spark.sql.catalyst.plans.logical.{ColumnStat, LogicalPlan} import org.apache.spark.sql.catalyst.rules.RuleExecutor -import org.apache.spark.sql.hive.test.TestHiveSingleton -import org.apache.spark.sql.test.SQLTestUtils +import org.apache.spark.sql.execution.SparkPlan +import org.apache.spark.sql.internal.SQLConf +import org.apache.spark.sql.types.LongType -class PruneHiveTablePartitionsSuite extends QueryTest with SQLTestUtils with TestHiveSingleton { +class PruneHiveTablePartitionsSuite extends PrunePartitionSuiteBase { + + override def format(): String = "hive" object Optimize extends RuleExecutor[LogicalPlan] { val batches = @@ -32,7 +34,7 @@ class PruneHiveTablePartitionsSuite extends QueryTest with SQLTestUtils with Tes EliminateSubqueryAliases, new PruneHiveTablePartitions(spark)) :: Nil } - test("SPARK-15616 statistics pruned after going throuhg PruneHiveTablePartitions") { + test("SPARK-15616: statistics pruned after going through PruneHiveTablePartitions") { withTable("test", "temp") { sql( s""" @@ -54,4 +56,84 @@ class PruneHiveTablePartitionsSuite extends QueryTest with SQLTestUtils with Tes Optimize.execute(analyzed2).stats.sizeInBytes) } } + + test("Avoid generating too many predicates in partition pruning") { + withTempView("temp") { + withTable("t") { + sql( + s""" + |CREATE TABLE t(i INT, p0 INT, p1 INT) + |USING $format + |PARTITIONED BY (p0, p1)""".stripMargin) + + spark.range(0, 10, 1).selectExpr("id as col") + .createOrReplaceTempView("temp") + + for (part <- (0 to 25)) { + sql( + s""" + |INSERT OVERWRITE TABLE t PARTITION (p0='$part', p1='$part') + |SELECT col FROM temp""".stripMargin) + } + val scale = 20 + val predicate = (1 to scale).map(i => s"(p0 = '$i' AND p1 = '$i')").mkString(" OR ") + val expectedStr = { + // left + "(((((((p0 = 1) && (p1 = 1)) || ((p0 = 2) && (p1 = 2))) ||" + + " ((p0 = 3) && (p1 = 3))) || (((p0 = 4) && (p1 = 4)) ||" + + " ((p0 = 5) && (p1 = 5)))) || (((((p0 = 6) && (p1 = 6)) ||" + + " ((p0 = 7) && (p1 = 7))) || ((p0 = 8) && (p1 = 8))) ||" + + " (((p0 = 9) && (p1 = 9)) || ((p0 = 10) && (p1 = 10))))) ||" + + // right + " ((((((p0 = 11) && (p1 = 11)) || ((p0 = 12) && (p1 = 12))) ||" + + " ((p0 = 13) && (p1 = 13))) || (((p0 = 14) && (p1 = 14)) ||" + + " ((p0 = 15) && (p1 = 15)))) || (((((p0 = 16) && (p1 = 16)) ||" + + " ((p0 = 17) && (p1 = 17))) || ((p0 = 18) && (p1 = 18))) ||" + + " (((p0 = 19) && (p1 = 19)) || ((p0 = 20) && (p1 = 20))))))" + } + assertPrunedPartitions(s"SELECT * FROM t WHERE $predicate", scale, + expectedStr) + } + } + } + + test("SPARK-34119: Keep necessary stats after PruneHiveTablePartitions") { + withTable("SPARK_34119") { + withSQLConf( + SQLConf.CBO_ENABLED.key -> "true", + "hive.exec.dynamic.partition.mode" -> "nonstrict") { + sql(s"CREATE TABLE SPARK_34119 PARTITIONED BY (p) STORED AS textfile AS " + + "(SELECT id, CAST(id % 5 AS STRING) AS p FROM range(20))") + sql(s"ANALYZE TABLE SPARK_34119 COMPUTE STATISTICS FOR ALL COLUMNS") + + checkOptimizedPlanStats(sql(s"SELECT id FROM SPARK_34119"), + 320L, + Some(20), + Seq(ColumnStat( + distinctCount = Some(20), + min = Some(0), + max = Some(19), + nullCount = Some(0), + avgLen = Some(LongType.defaultSize), + maxLen = Some(LongType.defaultSize)))) + + checkOptimizedPlanStats(sql("SELECT id FROM SPARK_34119 WHERE p = '2'"), + 64L, + Some(4), + Seq(ColumnStat( + distinctCount = Some(4), + min = Some(0), + max = Some(19), + nullCount = Some(0), + avgLen = Some(LongType.defaultSize), + maxLen = Some(LongType.defaultSize)))) + } + } + } + + override def getScanExecPartitionSize(plan: SparkPlan): Long = { + plan.collectFirst { + case p: HiveTableScanExec => p + }.get.prunedPartitions.size + } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PrunePartitionSuiteBase.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PrunePartitionSuiteBase.scala new file mode 100644 index 0000000000000..3b13cee2d1fda --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/PrunePartitionSuiteBase.scala @@ -0,0 +1,115 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution + +import org.apache.spark.sql.StatisticsCollectionTestBase +import org.apache.spark.sql.catalyst.expressions.{AttributeReference, BinaryOperator, Expression, IsNotNull, Literal} +import org.apache.spark.sql.execution.{FileSourceScanExec, SparkPlan} +import org.apache.spark.sql.hive.test.TestHiveSingleton +import org.apache.spark.sql.internal.SQLConf.ADAPTIVE_EXECUTION_ENABLED + +abstract class PrunePartitionSuiteBase extends StatisticsCollectionTestBase with TestHiveSingleton { + + protected def format: String + + test("SPARK-28169: Convert scan predicate condition to CNF") { + withSQLConf(ADAPTIVE_EXECUTION_ENABLED.key -> "false") { + withTempView("temp") { + withTable("t") { + sql( + s""" + |CREATE TABLE t(i INT, p STRING) + |USING $format + |PARTITIONED BY (p)""".stripMargin) + + spark.range(0, 1000, 1).selectExpr("id as col") + .createOrReplaceTempView("temp") + + for (part <- Seq(1, 2, 3, 4)) { + sql( + s""" + |INSERT OVERWRITE TABLE t PARTITION (p='$part') + |SELECT col FROM temp""".stripMargin) + } + + assertPrunedPartitions( + "SELECT * FROM t WHERE p = '1' OR (p = '2' AND i = 1)", 2, + "((p = '1') || (p = '2'))") + assertPrunedPartitions( + "SELECT * FROM t WHERE (p = '1' AND i = 2) OR (i = 1 OR p = '2')", 4, + "") + assertPrunedPartitions( + "SELECT * FROM t WHERE (p = '1' AND i = 2) OR (p = '3' AND i = 3 )", 2, + "((p = '1') || (p = '3'))") + assertPrunedPartitions( + "SELECT * FROM t WHERE (p = '1' AND i = 2) OR (p = '2' OR p = '3')", 3, + "((p = '1') || ((p = '2') || (p = '3')))") + assertPrunedPartitions( + "SELECT * FROM t", 4, + "") + assertPrunedPartitions( + "SELECT * FROM t WHERE p = '1' AND i = 2", 1, + "(p = '1')") + assertPrunedPartitions( + """ + |SELECT i, COUNT(1) FROM ( + |SELECT * FROM t WHERE p = '1' OR (p = '2' AND i = 1) + |) tmp GROUP BY i + """.stripMargin, 2, "((p = '1') || (p = '2'))") + } + } + } + } + + private def getCleanStringRepresentation(exp: Expression): String = exp match { + case attr: AttributeReference => + attr.sql.replaceAll("spark_catalog.default.t.", "") + case l: Literal => + l.sql + case e: BinaryOperator => + s"(${getCleanStringRepresentation(e.left)} ${e.symbol} " + + s"${getCleanStringRepresentation(e.right)})" + } + + protected def assertPrunedPartitions( + query: String, + expectedPartitionCount: Long, + expectedPushedDownFilters: String): Unit = { + val qe = sql(query).queryExecution + val plan = qe.sparkPlan + assert(getScanExecPartitionSize(plan) == expectedPartitionCount) + + val pushedDownPartitionFilters = qe.executedPlan.collectFirst { + case scan: FileSourceScanExec => scan.partitionFilters + case scan: HiveTableScanExec => scan.partitionPruningPred + }.map(exps => exps.filterNot(e => e.isInstanceOf[IsNotNull])) + val pushedFilters = pushedDownPartitionFilters.map(filters => { + filters.foldLeft("")((currentStr, exp) => { + if (currentStr == "") { + s"${getCleanStringRepresentation(exp)}" + } else { + s"$currentStr AND ${getCleanStringRepresentation(exp)}" + } + }) + }) + + assert(pushedFilters == Some(expectedPushedDownFilters)) + } + + protected def getScanExecPartitionSize(plan: SparkPlan): Long +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLMetricsSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLMetricsSuite.scala index 4d6dafd598a2e..a2de43d737704 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLMetricsSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLMetricsSuite.scala @@ -18,7 +18,9 @@ package org.apache.spark.sql.hive.execution import org.apache.spark.sql.execution.adaptive.DisableAdaptiveExecutionSuite +import org.apache.spark.sql.execution.command.DataWritingCommandExec import org.apache.spark.sql.execution.metric.SQLMetricsTestUtils +import org.apache.spark.sql.hive.HiveUtils import org.apache.spark.sql.hive.test.TestHiveSingleton // Disable AQE because metric info is different with AQE on/off @@ -34,4 +36,29 @@ class SQLMetricsSuite extends SQLMetricsTestUtils with TestHiveSingleton testMetricsDynamicPartition("hive", "hive", "t1") } } + + test("SPARK-34567: Add metrics for CTAS operator") { + Seq(false, true).foreach { canOptimized => + withSQLConf(HiveUtils.CONVERT_METASTORE_CTAS.key -> canOptimized.toString) { + withTable("t") { + val df = sql(s"CREATE TABLE t STORED AS PARQUET AS SELECT 1 as a") + val dataWritingCommandExec = + df.queryExecution.executedPlan.asInstanceOf[DataWritingCommandExec] + dataWritingCommandExec.executeCollect() + val createTableAsSelect = dataWritingCommandExec.cmd + if (canOptimized) { + assert(createTableAsSelect.isInstanceOf[OptimizedCreateHiveTableAsSelectCommand]) + } else { + assert(createTableAsSelect.isInstanceOf[CreateHiveTableAsSelectCommand]) + } + assert(createTableAsSelect.metrics.contains("numFiles")) + assert(createTableAsSelect.metrics("numFiles").value == 1) + assert(createTableAsSelect.metrics.contains("numOutputBytes")) + assert(createTableAsSelect.metrics("numOutputBytes").value > 0) + assert(createTableAsSelect.metrics.contains("numOutputRows")) + assert(createTableAsSelect.metrics("numOutputRows").value == 1) + } + } + } + } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala index 79c6ade2807d3..f3aad782cebc6 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala @@ -33,6 +33,7 @@ import org.apache.spark.sql.catalyst.analysis.{EliminateSubqueryAliases, Functio import org.apache.spark.sql.catalyst.catalog.{CatalogTableType, CatalogUtils, HiveTableRelation} import org.apache.spark.sql.catalyst.parser.ParseException import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, SubqueryAlias} +import org.apache.spark.sql.execution.TestUncaughtExceptionHandler import org.apache.spark.sql.execution.adaptive.{DisableAdaptiveExecutionSuite, EnableAdaptiveExecutionSuite} import org.apache.spark.sql.execution.command.{FunctionsCommand, LoadDataCommand} import org.apache.spark.sql.execution.datasources.{HadoopFsRelation, LogicalRelation} @@ -43,7 +44,7 @@ import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.internal.StaticSQLConf.GLOBAL_TEMP_DATABASE import org.apache.spark.sql.test.SQLTestUtils import org.apache.spark.sql.types._ -import org.apache.spark.util.Utils +import org.apache.spark.tags.SlowHiveTest case class Nested1(f1: Nested2) case class Nested2(f2: Nested3) @@ -91,7 +92,8 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi test("script") { withTempView("script_table") { assume(TestUtils.testCommandAvailable("/bin/bash")) - assume(TestUtils.testCommandAvailable("echo | sed")) + assume(TestUtils.testCommandAvailable("echo")) + assume(TestUtils.testCommandAvailable("sed")) val scriptFilePath = getTestResourcePath("test_script.sh") val df = Seq(("x1", "y1", "z1"), ("x2", "y2", "z2")).toDF("c1", "c2", "c3") df.createOrReplaceTempView("script_table") @@ -226,7 +228,7 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi checkAnswer(sql(s"SHOW functions $db.temp_abs"), Row("temp_abs")) checkAnswer(sql(s"SHOW functions `$db`.`temp_abs`"), Row("temp_abs")) checkAnswer(sql(s"SHOW functions `$db`.`temp_abs`"), Row("temp_abs")) - checkAnswer(sql("SHOW functions `a function doens't exist`"), Nil) + checkAnswer(sql("SHOW functions `a function doesn't exist`"), Nil) checkAnswer(sql("SHOW functions `temp_weekofyea*`"), Row("temp_weekofyear")) // this probably will failed if we add more function with `sha` prefixing. @@ -710,8 +712,7 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi |AS SELECT key, value FROM mytable1 """.stripMargin) }.getMessage - assert(e.contains("Create Partitioned Table As Select cannot specify data type for " + - "the partition columns of the target table")) + assert(e.contains("Partition column types may not be specified in Create Table As Select")) } } } @@ -767,14 +768,14 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi sql("SELECT * FROM nested").collect().toSeq) intercept[AnalysisException] { - sql("CREATE TABLE test_ctas_1234 AS SELECT * from notexists").collect() + sql("CREATE TABLE test_ctas_1234 AS SELECT * from nonexistent").collect() } } } } test("test CTAS") { - withTable("test_ctas_1234") { + withTable("test_ctas_123") { sql("CREATE TABLE test_ctas_123 AS SELECT key, value FROM src") checkAnswer( sql("SELECT key, value FROM test_ctas_123 ORDER BY key"), @@ -1172,7 +1173,7 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi test("SPARK-6785: HiveQuerySuite - Date comparison test 2") { checkAnswer( - sql("SELECT CAST(CAST(0 AS timestamp) AS date) > CAST(0 AS timestamp) FROM src LIMIT 1"), + sql("SELECT CAST(timestamp_seconds(0) AS date) > timestamp_seconds(0) FROM src LIMIT 1"), Row(false)) } @@ -1182,10 +1183,10 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi sql( """ | SELECT - | CAST(CAST(0 AS timestamp) AS date), - | CAST(CAST(CAST(0 AS timestamp) AS date) AS string), - | CAST(0 AS timestamp), - | CAST(CAST(0 AS timestamp) AS string), + | CAST(timestamp_seconds(0) AS date), + | CAST(CAST(timestamp_seconds(0) AS date) AS string), + | timestamp_seconds(0), + | CAST(timestamp_seconds(0) AS string), | CAST(CAST(CAST('1970-01-01 23:00:00' AS timestamp) AS date) AS timestamp) | FROM src LIMIT 1 """.stripMargin), @@ -1738,12 +1739,12 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi |SELECT 'blarr' """.stripMargin) - // project list is the same order of paritioning columns in table definition + // project list is the same order of partitioning columns in table definition checkAnswer( sql(s"SELECT p1, p2, p3, p4, p5, c1 FROM $table"), Row("a", "b", "c", "d", "e", "blarr") :: Nil) - // project list does not have the same order of paritioning columns in table definition + // project list does not have the same order of partitioning columns in table definition checkAnswer( sql(s"SELECT p2, p3, p4, p1, p5, c1 FROM $table"), Row("b", "c", "d", "a", "e", "blarr") :: Nil) @@ -1968,7 +1969,7 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi for (i <- 1 to 3) { Files.write(s"$i", new File(dirPath, s"part-r-0000$i"), StandardCharsets.UTF_8) } - withTable("load_t_folder_wildcard") { + withTable("load_t") { sql("CREATE TABLE load_t (a STRING) USING hive") sql(s"LOAD DATA LOCAL INPATH '${ path.substring(0, path.length - 1) @@ -2025,6 +2026,7 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi sql( """ |CREATE TABLE part_table (c STRING) + |STORED AS textfile |PARTITIONED BY (d STRING) """.stripMargin) sql(s"LOAD DATA LOCAL INPATH '$path/part-r-000011' " + @@ -2158,32 +2160,6 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi } } - test("SPARK-21101 UDTF should override initialize(ObjectInspector[] args)") { - withUserDefinedFunction("udtf_stack1" -> true, "udtf_stack2" -> true) { - sql( - s""" - |CREATE TEMPORARY FUNCTION udtf_stack1 - |AS 'org.apache.spark.sql.hive.execution.UDTFStack' - |USING JAR '${hiveContext.getHiveFile("SPARK-21101-1.0.jar").toURI}' - """.stripMargin) - val cnt = - sql("SELECT udtf_stack1(2, 'A', 10, date '2015-01-01', 'B', 20, date '2016-01-01')").count() - assert(cnt === 2) - - sql( - s""" - |CREATE TEMPORARY FUNCTION udtf_stack2 - |AS 'org.apache.spark.sql.hive.execution.UDTFStack2' - |USING JAR '${hiveContext.getHiveFile("SPARK-21101-1.0.jar").toURI}' - """.stripMargin) - val e = intercept[org.apache.spark.sql.AnalysisException] { - sql("SELECT udtf_stack2(2, 'A', 10, date '2015-01-01', 'B', 20, date '2016-01-01')") - } - assert( - e.getMessage.contains("public StructObjectInspector initialize(ObjectInspector[] args)")) - } - } - test("SPARK-21721: Clear FileSystem deleterOnExit cache if path is successfully removed") { val table = "test21721" withTable(table) { @@ -2203,39 +2179,63 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi } } - test("SPARK-21912 ORC/Parquet table should not create invalid column names") { + test("SPARK-21912 Parquet table should not create invalid column names") { Seq(" ", ",", ";", "{", "}", "(", ")", "\n", "\t", "=").foreach { name => - Seq("ORC", "PARQUET").foreach { source => - withTable("t21912") { - val m = intercept[AnalysisException] { - sql(s"CREATE TABLE t21912(`col$name` INT) USING $source") - }.getMessage - assert(m.contains(s"contains invalid character(s)")) + val source = "PARQUET" + withTable("t21912") { + val m = intercept[AnalysisException] { + sql(s"CREATE TABLE t21912(`col$name` INT) USING $source") + }.getMessage + assert(m.contains(s"contains invalid character(s)")) - val m1 = intercept[AnalysisException] { - sql(s"CREATE TABLE t21912 STORED AS $source AS SELECT 1 `col$name`") - }.getMessage - assert(m1.contains(s"contains invalid character(s)")) + val m1 = intercept[AnalysisException] { + sql(s"CREATE TABLE t21912 STORED AS $source AS SELECT 1 `col$name`") + }.getMessage + assert(m1.contains(s"contains invalid character(s)")) + + val m2 = intercept[AnalysisException] { + sql(s"CREATE TABLE t21912 USING $source AS SELECT 1 `col$name`") + }.getMessage + assert(m2.contains(s"contains invalid character(s)")) - val m2 = intercept[AnalysisException] { - sql(s"CREATE TABLE t21912 USING $source AS SELECT 1 `col$name`") + withSQLConf(HiveUtils.CONVERT_METASTORE_PARQUET.key -> "false") { + val m3 = intercept[AnalysisException] { + sql(s"CREATE TABLE t21912(`col$name` INT) USING hive OPTIONS (fileFormat '$source')") }.getMessage - assert(m2.contains(s"contains invalid character(s)")) + assert(m3.contains(s"contains invalid character(s)")) + } - withSQLConf(HiveUtils.CONVERT_METASTORE_PARQUET.key -> "false") { - val m3 = intercept[AnalysisException] { - sql(s"CREATE TABLE t21912(`col$name` INT) USING hive OPTIONS (fileFormat '$source')") - }.getMessage - assert(m3.contains(s"contains invalid character(s)")) - } + sql(s"CREATE TABLE t21912(`col` INT) USING $source") + val m4 = intercept[AnalysisException] { + sql(s"ALTER TABLE t21912 ADD COLUMNS(`col$name` INT)") + }.getMessage + assert(m4.contains(s"contains invalid character(s)")) + } + } + } - sql(s"CREATE TABLE t21912(`col` INT) USING $source") - val m4 = intercept[AnalysisException] { - sql(s"ALTER TABLE t21912 ADD COLUMNS(`col$name` INT)") - }.getMessage - assert(m4.contains(s"contains invalid character(s)")) + test("SPARK-32889: ORC table column name supports special characters") { + // " " "," is not allowed. + Seq("$", ";", "{", "}", "(", ")", "\n", "\t", "=").foreach { name => + val source = "ORC" + Seq(s"CREATE TABLE t32889(`$name` INT) USING $source", + s"CREATE TABLE t32889 STORED AS $source AS SELECT 1 `$name`", + s"CREATE TABLE t32889 USING $source AS SELECT 1 `$name`", + s"CREATE TABLE t32889(`$name` INT) USING hive OPTIONS (fileFormat '$source')") + .foreach { command => + withTable("t32889") { + sql(command) + assertResult(name)( + sessionState.catalog.getTableMetadata(TableIdentifier("t32889")).schema.fields(0).name) } } + + withTable("t32889") { + sql(s"CREATE TABLE t32889(`col` INT) USING $source") + sql(s"ALTER TABLE t32889 ADD COLUMNS(`$name` INT)") + assertResult(name)( + sessionState.catalog.getTableMetadata(TableIdentifier("t32889")).schema.fields(1).name) + } } } @@ -2544,8 +2544,47 @@ abstract class SQLQuerySuiteBase extends QueryTest with SQLTestUtils with TestHi assert(e.getMessage.contains("Cannot modify the value of a static config")) } } + + test("SPARK-29295: dynamic partition map parsed from partition path should be case insensitive") { + withTable("t") { + withSQLConf("hive.exec.dynamic.partition" -> "true", + "hive.exec.dynamic.partition.mode" -> "nonstrict") { + withTempDir { loc => + sql(s"CREATE TABLE t(c1 INT) PARTITIONED BY(P1 STRING) LOCATION '${loc.getAbsolutePath}'") + sql("INSERT OVERWRITE TABLE t PARTITION(P1) VALUES(1, 'caseSensitive')") + checkAnswer(sql("select * from t"), Row(1, "caseSensitive")) + } + } + } + } + + test("SPARK-32668: HiveGenericUDTF initialize UDTF should use StructObjectInspector method") { + withUserDefinedFunction("udtf_stack1" -> true, "udtf_stack2" -> true) { + sql( + s""" + |CREATE TEMPORARY FUNCTION udtf_stack1 + |AS 'org.apache.spark.sql.hive.execution.UDTFStack' + |USING JAR '${hiveContext.getHiveFile("SPARK-21101-1.0.jar").toURI}' + """.stripMargin) + sql( + s""" + |CREATE TEMPORARY FUNCTION udtf_stack2 + |AS 'org.apache.spark.sql.hive.execution.UDTFStack2' + |USING JAR '${hiveContext.getHiveFile("SPARK-21101-1.0.jar").toURI}' + """.stripMargin) + + Seq("udtf_stack1", "udtf_stack2").foreach { udf => + checkAnswer( + sql(s"SELECT $udf(2, 'A', 10, date '2015-01-01', 'B', 20, date '2016-01-01')"), + Seq(Row("A", 10, Date.valueOf("2015-01-01")), + Row("B", 20, Date.valueOf("2016-01-01")))) + } + } + } } +@SlowHiveTest class SQLQuerySuite extends SQLQuerySuiteBase with DisableAdaptiveExecutionSuite +@SlowHiveTest class SQLQuerySuiteAE extends SQLQuerySuiteBase with EnableAdaptiveExecutionSuite diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/ScriptTransformationSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/ScriptTransformationSuite.scala deleted file mode 100644 index b97eb869a9e54..0000000000000 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/ScriptTransformationSuite.scala +++ /dev/null @@ -1,280 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.hive.execution - -import java.sql.Timestamp - -import org.apache.hadoop.hive.serde2.`lazy`.LazySimpleSerDe -import org.scalatest.Assertions._ -import org.scalatest.BeforeAndAfterEach -import org.scalatest.exceptions.TestFailedException - -import org.apache.spark.{SparkException, TaskContext, TestUtils} -import org.apache.spark.rdd.RDD -import org.apache.spark.sql.Column -import org.apache.spark.sql.catalyst.InternalRow -import org.apache.spark.sql.catalyst.expressions.{Attribute, AttributeReference} -import org.apache.spark.sql.catalyst.plans.physical.Partitioning -import org.apache.spark.sql.execution.{SparkPlan, SparkPlanTest, UnaryExecNode} -import org.apache.spark.sql.hive.HiveUtils -import org.apache.spark.sql.hive.test.TestHiveSingleton -import org.apache.spark.sql.test.SQLTestUtils -import org.apache.spark.sql.types.StringType - -class ScriptTransformationSuite extends SparkPlanTest with SQLTestUtils with TestHiveSingleton - with BeforeAndAfterEach { - import spark.implicits._ - - private val noSerdeIOSchema = HiveScriptIOSchema( - inputRowFormat = Seq.empty, - outputRowFormat = Seq.empty, - inputSerdeClass = None, - outputSerdeClass = None, - inputSerdeProps = Seq.empty, - outputSerdeProps = Seq.empty, - recordReaderClass = None, - recordWriterClass = None, - schemaLess = false - ) - - private val serdeIOSchema = noSerdeIOSchema.copy( - inputSerdeClass = Some(classOf[LazySimpleSerDe].getCanonicalName), - outputSerdeClass = Some(classOf[LazySimpleSerDe].getCanonicalName) - ) - - private var defaultUncaughtExceptionHandler: Thread.UncaughtExceptionHandler = _ - - private val uncaughtExceptionHandler = new TestUncaughtExceptionHandler - - protected override def beforeAll(): Unit = { - super.beforeAll() - defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler - Thread.setDefaultUncaughtExceptionHandler(uncaughtExceptionHandler) - } - - protected override def afterAll(): Unit = { - super.afterAll() - Thread.setDefaultUncaughtExceptionHandler(defaultUncaughtExceptionHandler) - } - - override protected def afterEach(): Unit = { - super.afterEach() - uncaughtExceptionHandler.cleanStatus() - } - - test("cat without SerDe") { - assume(TestUtils.testCommandAvailable("/bin/bash")) - - val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") - checkAnswer( - rowsDf, - (child: SparkPlan) => new ScriptTransformationExec( - input = Seq(rowsDf.col("a").expr), - script = "cat", - output = Seq(AttributeReference("a", StringType)()), - child = child, - ioschema = noSerdeIOSchema - ), - rowsDf.collect()) - assert(uncaughtExceptionHandler.exception.isEmpty) - } - - test("cat with LazySimpleSerDe") { - assume(TestUtils.testCommandAvailable("/bin/bash")) - - val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") - checkAnswer( - rowsDf, - (child: SparkPlan) => new ScriptTransformationExec( - input = Seq(rowsDf.col("a").expr), - script = "cat", - output = Seq(AttributeReference("a", StringType)()), - child = child, - ioschema = serdeIOSchema - ), - rowsDf.collect()) - assert(uncaughtExceptionHandler.exception.isEmpty) - } - - test("script transformation should not swallow errors from upstream operators (no serde)") { - assume(TestUtils.testCommandAvailable("/bin/bash")) - - val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") - val e = intercept[TestFailedException] { - checkAnswer( - rowsDf, - (child: SparkPlan) => new ScriptTransformationExec( - input = Seq(rowsDf.col("a").expr), - script = "cat", - output = Seq(AttributeReference("a", StringType)()), - child = ExceptionInjectingOperator(child), - ioschema = noSerdeIOSchema - ), - rowsDf.collect()) - } - assert(e.getMessage().contains("intentional exception")) - // Before SPARK-25158, uncaughtExceptionHandler will catch IllegalArgumentException - assert(uncaughtExceptionHandler.exception.isEmpty) - } - - test("script transformation should not swallow errors from upstream operators (with serde)") { - assume(TestUtils.testCommandAvailable("/bin/bash")) - - val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") - val e = intercept[TestFailedException] { - checkAnswer( - rowsDf, - (child: SparkPlan) => new ScriptTransformationExec( - input = Seq(rowsDf.col("a").expr), - script = "cat", - output = Seq(AttributeReference("a", StringType)()), - child = ExceptionInjectingOperator(child), - ioschema = serdeIOSchema - ), - rowsDf.collect()) - } - assert(e.getMessage().contains("intentional exception")) - // Before SPARK-25158, uncaughtExceptionHandler will catch IllegalArgumentException - assert(uncaughtExceptionHandler.exception.isEmpty) - } - - test("SPARK-14400 script transformation should fail for bad script command") { - assume(TestUtils.testCommandAvailable("/bin/bash")) - - val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") - - val e = intercept[SparkException] { - val plan = - new ScriptTransformationExec( - input = Seq(rowsDf.col("a").expr), - script = "some_non_existent_command", - output = Seq(AttributeReference("a", StringType)()), - child = rowsDf.queryExecution.sparkPlan, - ioschema = serdeIOSchema) - SparkPlanTest.executePlan(plan, hiveContext) - } - assert(e.getMessage.contains("Subprocess exited with status")) - assert(uncaughtExceptionHandler.exception.isEmpty) - } - - test("SPARK-24339 verify the result after pruning the unused columns") { - val rowsDf = Seq( - ("Bob", 16, 176), - ("Alice", 32, 164), - ("David", 60, 192), - ("Amy", 24, 180)).toDF("name", "age", "height") - - checkAnswer( - rowsDf, - (child: SparkPlan) => new ScriptTransformationExec( - input = Seq(rowsDf.col("name").expr), - script = "cat", - output = Seq(AttributeReference("name", StringType)()), - child = child, - ioschema = serdeIOSchema - ), - rowsDf.select("name").collect()) - assert(uncaughtExceptionHandler.exception.isEmpty) - } - - test("SPARK-25990: TRANSFORM should handle different data types correctly") { - assume(TestUtils.testCommandAvailable("python")) - val scriptFilePath = getTestResourcePath("test_script.py") - - withTempView("v") { - val df = Seq( - (1, "1", 1.0, BigDecimal(1.0), new Timestamp(1)), - (2, "2", 2.0, BigDecimal(2.0), new Timestamp(2)), - (3, "3", 3.0, BigDecimal(3.0), new Timestamp(3)) - ).toDF("a", "b", "c", "d", "e") // Note column d's data type is Decimal(38, 18) - df.createTempView("v") - - val query = sql( - s""" - |SELECT - |TRANSFORM(a, b, c, d, e) - |USING 'python $scriptFilePath' AS (a, b, c, d, e) - |FROM v - """.stripMargin) - - // In Hive 1.2, the string representation of a decimal omits trailing zeroes. - // But in Hive 2.3, it is always padded to 18 digits with trailing zeroes if necessary. - val decimalToString: Column => Column = if (HiveUtils.isHive23) { - c => c.cast("string") - } else { - c => c.cast("decimal(1, 0)").cast("string") - } - checkAnswer(query, identity, df.select( - 'a.cast("string"), - 'b.cast("string"), - 'c.cast("string"), - decimalToString('d), - 'e.cast("string")).collect()) - } - } - - test("SPARK-30973: TRANSFORM should wait for the termination of the script (no serde)") { - assume(TestUtils.testCommandAvailable("/bin/bash")) - - val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") - val e = intercept[SparkException] { - val plan = - new ScriptTransformationExec( - input = Seq(rowsDf.col("a").expr), - script = "some_non_existent_command", - output = Seq(AttributeReference("a", StringType)()), - child = rowsDf.queryExecution.sparkPlan, - ioschema = noSerdeIOSchema) - SparkPlanTest.executePlan(plan, hiveContext) - } - assert(e.getMessage.contains("Subprocess exited with status")) - assert(uncaughtExceptionHandler.exception.isEmpty) - } - - test("SPARK-30973: TRANSFORM should wait for the termination of the script (with serde)") { - assume(TestUtils.testCommandAvailable("/bin/bash")) - - val rowsDf = Seq("a", "b", "c").map(Tuple1.apply).toDF("a") - val e = intercept[SparkException] { - val plan = - new ScriptTransformationExec( - input = Seq(rowsDf.col("a").expr), - script = "some_non_existent_command", - output = Seq(AttributeReference("a", StringType)()), - child = rowsDf.queryExecution.sparkPlan, - ioschema = serdeIOSchema) - SparkPlanTest.executePlan(plan, hiveContext) - } - assert(e.getMessage.contains("Subprocess exited with status")) - assert(uncaughtExceptionHandler.exception.isEmpty) - } -} - -private case class ExceptionInjectingOperator(child: SparkPlan) extends UnaryExecNode { - override protected def doExecute(): RDD[InternalRow] = { - child.execute().map { x => - assert(TaskContext.get() != null) // Make sure that TaskContext is defined. - Thread.sleep(1000) // This sleep gives the external process time to start. - throw new IllegalArgumentException("intentional exception") - } - } - - override def output: Seq[Attribute] = child.output - - override def outputPartitioning: Partitioning = child.outputPartitioning -} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/TestingTypedCount.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/TestingTypedCount.scala index 31b24301767af..ee233fbd7238f 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/TestingTypedCount.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/TestingTypedCount.scala @@ -22,6 +22,7 @@ import java.io.{ByteArrayInputStream, ByteArrayOutputStream, DataInputStream, Da import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.expressions._ import org.apache.spark.sql.catalyst.expressions.aggregate.{ImperativeAggregate, TypedImperativeAggregate} +import org.apache.spark.sql.catalyst.trees.UnaryLike import org.apache.spark.sql.hive.execution.TestingTypedCount.State import org.apache.spark.sql.types._ @@ -32,12 +33,11 @@ case class TestingTypedCount( child: Expression, mutableAggBufferOffset: Int = 0, inputAggBufferOffset: Int = 0) - extends TypedImperativeAggregate[TestingTypedCount.State] { + extends TypedImperativeAggregate[TestingTypedCount.State] + with UnaryLike[Expression] { def this(child: Expression) = this(child, 0, 0) - override def children: Seq[Expression] = child :: Nil - override def dataType: DataType = LongType override def nullable: Boolean = false @@ -78,6 +78,9 @@ case class TestingTypedCount( copy(inputAggBufferOffset = newInputAggBufferOffset) override val prettyName: String = "typed_count" + + override protected def withNewChildInternal(newChild: Expression): TestingTypedCount = + copy(child = newChild) } object TestingTypedCount { diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/UDAQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/UDAQuerySuite.scala index e6856a58b0ea9..50f13efccc915 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/UDAQuerySuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/UDAQuerySuite.scala @@ -17,23 +17,15 @@ package org.apache.spark.sql.hive.execution -import java.lang.{Double => jlDouble, Integer => jlInt, Long => jlLong} - -import scala.collection.JavaConverters._ -import scala.util.Random - -import test.org.apache.spark.sql.MyDoubleAvg -import test.org.apache.spark.sql.MyDoubleSum +import java.lang.{Double => jlDouble, Long => jlLong} import org.apache.spark.sql._ import org.apache.spark.sql.catalyst.InternalRow import org.apache.spark.sql.catalyst.encoders.ExpressionEncoder import org.apache.spark.sql.catalyst.expressions.GenericInternalRow -import org.apache.spark.sql.catalyst.expressions.UnsafeRow -import org.apache.spark.sql.expressions.{Aggregator} +import org.apache.spark.sql.expressions.Aggregator import org.apache.spark.sql.functions._ import org.apache.spark.sql.hive.test.TestHiveSingleton -import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.test.SQLTestUtils import org.apache.spark.sql.types._ @@ -119,6 +111,27 @@ object CountSerDeAgg extends Aggregator[Int, CountSerDeSQL, CountSerDeSQL] { def outputEncoder: Encoder[CountSerDeSQL] = ExpressionEncoder[CountSerDeSQL]() } +object ArrayDataAgg extends Aggregator[Array[Double], Array[Double], Array[Double]] { + def zero: Array[Double] = Array(0.0, 0.0, 0.0) + def reduce(s: Array[Double], array: Array[Double]): Array[Double] = { + require(s.length == array.length) + for ( j <- 0 until s.length ) { + s(j) += array(j) + } + s + } + def merge(s1: Array[Double], s2: Array[Double]): Array[Double] = { + require(s1.length == s2.length) + for ( j <- 0 until s1.length ) { + s1(j) += s2(j) + } + s1 + } + def finish(s: Array[Double]): Array[Double] = s + def bufferEncoder: Encoder[Array[Double]] = ExpressionEncoder[Array[Double]] + def outputEncoder: Encoder[Array[Double]] = ExpressionEncoder[Array[Double]] +} + abstract class UDAQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleton { import testImplicits._ @@ -156,20 +169,11 @@ abstract class UDAQuerySuite extends QueryTest with SQLTestUtils with TestHiveSi (3, null, null)).toDF("key", "value1", "value2") data2.write.saveAsTable("agg2") - val data3 = Seq[(Seq[Integer], Integer, Integer)]( - (Seq[Integer](1, 1), 10, -10), - (Seq[Integer](null), -60, 60), - (Seq[Integer](1, 1), 30, -30), - (Seq[Integer](1), 30, 30), - (Seq[Integer](2), 1, 1), - (null, -10, 10), - (Seq[Integer](2, 3), -1, null), - (Seq[Integer](2, 3), 1, 1), - (Seq[Integer](2, 3, 4), null, 1), - (Seq[Integer](null), 100, -10), - (Seq[Integer](3), null, 3), - (null, null, null), - (Seq[Integer](3), null, null)).toDF("key", "value1", "value2") + val data3 = Seq[(Seq[Double], Int)]( + (Seq(1.0, 2.0, 3.0), 0), + (Seq(4.0, 5.0, 6.0), 0), + (Seq(7.0, 8.0, 9.0), 0) + ).toDF("data", "dummy") data3.write.saveAsTable("agg3") val data4 = Seq[Boolean](true, false, true).toDF("boolvalues") @@ -184,6 +188,7 @@ abstract class UDAQuerySuite extends QueryTest with SQLTestUtils with TestHiveSi spark.udf.register("mydoublesum", udaf(MyDoubleSumAgg)) spark.udf.register("mydoubleavg", udaf(MyDoubleAvgAgg)) spark.udf.register("longProductSum", udaf(LongProductSumAgg)) + spark.udf.register("arraysum", udaf(ArrayDataAgg)) } override def afterAll(): Unit = { @@ -354,6 +359,12 @@ abstract class UDAQuerySuite extends QueryTest with SQLTestUtils with TestHiveSi Row(3, 0, null, 1, 3, 0, 0, 0, null, 1, 3, 0, 2, 2) :: Nil) } + test("SPARK-32159: array encoders should be resolved in analyzer") { + checkAnswer( + spark.sql("SELECT arraysum(data) FROM agg3"), + Row(Seq(12.0, 15.0, 18.0)) :: Nil) + } + test("verify aggregator ser/de behavior") { val data = sparkContext.parallelize((1 to 100).toSeq, 3).toDF("value1") val agg = udaf(CountSerDeAgg) diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/WindowQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/WindowQuerySuite.scala index 15712a18ce751..6bf7bd6cbb90e 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/WindowQuerySuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/WindowQuerySuite.scala @@ -62,7 +62,6 @@ class WindowQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleto // Moved because: // - Spark uses a different default stddev (sample instead of pop) // - Tiny numerical differences in stddev results. - // - Different StdDev behavior when n=1 (NaN instead of 0) checkAnswer(sql(s""" |select p_mfgr,p_name, p_size, |rank() over(distribute by p_mfgr sort by p_name) as r, @@ -88,22 +87,22 @@ class WindowQuerySuite extends QueryTest with SQLTestUtils with TestHiveSingleto Row("Manufacturer#1", "almond antique salmon chartreuse burlywood", 6, 4, 3, 0.6666666666666666, 0.6, 2, 4, 11.0, 15.448840301675292, 2, 6, 2), Row("Manufacturer#1", "almond aquamarine burnished black steel", 28, 5, 4, 0.8333333333333334, 0.8, 3, 5, 14.4, 15.388307249337076, 2, 28, 34), Row("Manufacturer#1", "almond aquamarine pink moccasin thistle", 42, 6, 5, 1.0, 1.0, 3, 6, 19.0, 17.787636155487327, 2, 42, 6), - Row("Manufacturer#2", "almond antique violet chocolate turquoise", 14, 1, 1, 0.2, 0.0, 1, 1, 14.0, Double.NaN, 4, 14, 14), + Row("Manufacturer#2", "almond antique violet chocolate turquoise", 14, 1, 1, 0.2, 0.0, 1, 1, 14.0, null, 4, 14, 14), Row("Manufacturer#2", "almond antique violet turquoise frosted", 40, 2, 2, 0.4, 0.25, 1, 2, 27.0, 18.384776310850235, 4, 40, 14), Row("Manufacturer#2", "almond aquamarine midnight light salmon", 2, 3, 3, 0.6, 0.5, 2, 3, 18.666666666666668, 19.42506971244462, 4, 2, 14), Row("Manufacturer#2", "almond aquamarine rose maroon antique", 25, 4, 4, 0.8, 0.75, 2, 4, 20.25, 16.17353805861084, 4, 25, 40), Row("Manufacturer#2", "almond aquamarine sandy cyan gainsboro", 18, 5, 5, 1.0, 1.0, 3, 5, 19.8, 14.042791745233567, 4, 18, 2), - Row("Manufacturer#3", "almond antique chartreuse khaki white", 17, 1, 1, 0.2, 0.0, 1, 1, 17.0,Double.NaN, 2, 17, 17), + Row("Manufacturer#3", "almond antique chartreuse khaki white", 17, 1, 1, 0.2, 0.0, 1, 1, 17.0, null, 2, 17, 17), Row("Manufacturer#3", "almond antique forest lavender goldenrod", 14, 2, 2, 0.4, 0.25, 1, 2, 15.5, 2.1213203435596424, 2, 14, 17), Row("Manufacturer#3", "almond antique metallic orange dim", 19, 3, 3, 0.6, 0.5, 2, 3, 16.666666666666668, 2.516611478423583, 2, 19, 17), Row("Manufacturer#3", "almond antique misty red olive", 1, 4, 4, 0.8, 0.75, 2, 4, 12.75, 8.098353742170895, 2, 1, 14), Row("Manufacturer#3", "almond antique olive coral navajo", 45, 5, 5, 1.0, 1.0, 3, 5, 19.2, 16.037456157383566, 2, 45, 19), - Row("Manufacturer#4", "almond antique gainsboro frosted violet", 10, 1, 1, 0.2, 0.0, 1, 1, 10.0, Double.NaN, 0, 10, 10), + Row("Manufacturer#4", "almond antique gainsboro frosted violet", 10, 1, 1, 0.2, 0.0, 1, 1, 10.0, null, 0, 10, 10), Row("Manufacturer#4", "almond antique violet mint lemon", 39, 2, 2, 0.4, 0.25, 1, 2, 24.5, 20.506096654409877, 0, 39, 10), Row("Manufacturer#4", "almond aquamarine floral ivory bisque", 27, 3, 3, 0.6, 0.5, 2, 3, 25.333333333333332, 14.571661996262929, 0, 27, 10), Row("Manufacturer#4", "almond aquamarine yellow dodger mint", 7, 4, 4, 0.8, 0.75, 2, 4, 20.75, 15.01943185787443, 0, 7, 39), Row("Manufacturer#4", "almond azure aquamarine papaya violet", 12, 5, 5, 1.0, 1.0, 3, 5, 19.0, 13.583077707206124, 0, 12, 27), - Row("Manufacturer#5", "almond antique blue firebrick mint", 31, 1, 1, 0.2, 0.0, 1, 1, 31.0, Double.NaN, 1, 31, 31), + Row("Manufacturer#5", "almond antique blue firebrick mint", 31, 1, 1, 0.2, 0.0, 1, 1, 31.0, null, 1, 31, 31), Row("Manufacturer#5", "almond antique medium spring khaki", 6, 2, 2, 0.4, 0.25, 1, 2, 18.5, 17.67766952966369, 1, 6, 31), Row("Manufacturer#5", "almond antique sky peru orange", 2, 3, 3, 0.6, 0.5, 2, 3, 13.0, 15.716233645501712, 1, 2, 31), Row("Manufacturer#5", "almond aquamarine dodger light gainsboro", 46, 4, 4, 0.8, 0.75, 2, 4, 21.25, 20.902551678363736, 1, 46, 6), diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableAddPartitionSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableAddPartitionSuite.scala new file mode 100644 index 0000000000000..24f62abe66095 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableAddPartitionSuite.scala @@ -0,0 +1,50 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution.command + +import org.apache.spark.sql.execution.command.v1 +import org.apache.spark.sql.internal.SQLConf + +/** + * The class contains tests for the `ALTER TABLE .. ADD PARTITION` command to check + * V1 Hive external table catalog. + */ +class AlterTableAddPartitionSuite + extends v1.AlterTableAddPartitionSuiteBase + with CommandSuiteBase { + + test("hive client calls") { + Seq(false, true).foreach { statsOn => + withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> statsOn.toString) { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + assert(!statsOn || getTableSize(t) > 0) + + checkHiveClientCalls(expected = 17) { + sql(s"ALTER TABLE $t ADD PARTITION (part=1)") + } + sql(s"CACHE TABLE $t") + checkHiveClientCalls(expected = 17) { + sql(s"ALTER TABLE $t ADD PARTITION (part=2)") + } + } + } + } + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableDropPartitionSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableDropPartitionSuite.scala new file mode 100644 index 0000000000000..eeebfd32a2838 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableDropPartitionSuite.scala @@ -0,0 +1,53 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution.command + +import org.apache.spark.sql.execution.command.v1 +import org.apache.spark.sql.internal.SQLConf + +/** + * The class contains tests for the `ALTER TABLE .. DROP PARTITION` command to check + * V1 Hive external table catalog. + */ +class AlterTableDropPartitionSuite + extends v1.AlterTableDropPartitionSuiteBase + with CommandSuiteBase { + + test("hive client calls") { + Seq(false, true).foreach { statsOn => + withSQLConf(SQLConf.AUTO_SIZE_UPDATE_ENABLED.key -> statsOn.toString) { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + sql(s"INSERT INTO $t PARTITION (part=1) SELECT 1") + sql(s"ALTER TABLE $t ADD PARTITION (part=2)") // empty partition + checkHiveClientCalls(expected = if (statsOn) 24 else 16) { + sql(s"ALTER TABLE $t DROP PARTITION (part=2)") + } + checkHiveClientCalls(expected = if (statsOn) 29 else 16) { + sql(s"ALTER TABLE $t DROP PARTITION (part=0)") + } + sql(s"CACHE TABLE $t") + checkHiveClientCalls(expected = if (statsOn) 29 else 16) { + sql(s"ALTER TABLE $t DROP PARTITION (part=1)") + } + } + } + } + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableRecoverPartitionsSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableRecoverPartitionsSuite.scala new file mode 100644 index 0000000000000..a6badb98a8645 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableRecoverPartitionsSuite.scala @@ -0,0 +1,28 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution.command + +import org.apache.spark.sql.execution.command.v1 + +/** + * The class contains tests for the `ALTER TABLE .. RECOVER PARTITIONS` command to check + * V1 Hive external table catalog. + */ +class AlterTableRecoverPartitionsSuite + extends v1.AlterTableRecoverPartitionsSuiteBase + with CommandSuiteBase diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableRenamePartitionSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableRenamePartitionSuite.scala new file mode 100644 index 0000000000000..c1f4d111a97f9 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableRenamePartitionSuite.scala @@ -0,0 +1,52 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution.command + +import org.apache.spark.sql.execution.command.v1 + +/** + * The class contains tests for the `ALTER TABLE .. RENAME PARTITION` command to check + * V1 Hive external table catalog. + */ +class AlterTableRenamePartitionSuite + extends v1.AlterTableRenamePartitionSuiteBase + with CommandSuiteBase { + + test("hive client calls") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, part int) $defaultUsing PARTITIONED BY (part)") + sql(s"INSERT INTO $t PARTITION (part=0) SELECT 0") + + checkHiveClientCalls(expected = 18) { + sql(s"ALTER TABLE $t PARTITION (part=0) RENAME TO PARTITION (part=1)") + } + sql(s"CACHE TABLE $t") + checkHiveClientCalls(expected = 18) { + sql(s"ALTER TABLE $t PARTITION (part=1) RENAME TO PARTITION (part=2)") + } + } + + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int, PART int) $defaultUsing PARTITIONED BY (PART)") + sql(s"INSERT INTO $t PARTITION (PART=0) SELECT 0") + checkHiveClientCalls(expected = 23) { + sql(s"ALTER TABLE $t PARTITION (PART=0) RENAME TO PARTITION (PART=1)") + } + } + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableRenameSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableRenameSuite.scala new file mode 100644 index 0000000000000..c282cb13d5515 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/AlterTableRenameSuite.scala @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution.command + +import org.apache.spark.sql.execution.command.v1 + +/** + * The class contains tests for the `ALTER TABLE .. RENAME` command to check + * V1 Hive external table catalog. + */ +class AlterTableRenameSuite extends v1.AlterTableRenameSuiteBase with CommandSuiteBase diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/CommandSuiteBase.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/CommandSuiteBase.scala new file mode 100644 index 0000000000000..0709b12cdfc11 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/CommandSuiteBase.scala @@ -0,0 +1,58 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution.command + +import org.apache.spark.metrics.source.HiveCatalogMetrics +import org.apache.spark.sql.catalyst.catalog.CatalogTypes.TablePartitionSpec +import org.apache.spark.sql.connector.catalog.CatalogManager +import org.apache.spark.sql.hive.test.TestHiveSingleton + +/** + * The trait contains settings and utility functions. It can be mixed to the test suites for + * datasource v1 Hive external catalog. This trait complements the common trait + * `org.apache.spark.sql.execution.command.DDLCommandTestUtils` with utility functions and + * settings for all unified datasource V1 and V2 test suites. + */ +trait CommandSuiteBase extends TestHiveSingleton { + def version: String = "Hive V1" // The prefix is added to test names + def catalog: String = CatalogManager.SESSION_CATALOG_NAME + def defaultUsing: String = "USING HIVE" // The clause is used in creating tables under testing + + def checkLocation( + t: String, + spec: TablePartitionSpec, + expected: String): Unit = { + val tablePath = t.split('.') + val tableName = tablePath.last + val ns = tablePath.init.mkString(".") + val partSpec = spec.map { case (key, value) => s"$key = $value"}.mkString(", ") + val information = + spark.sql(s"SHOW TABLE EXTENDED IN $ns LIKE '$tableName' PARTITION($partSpec)") + .select("information") + .first().getString(0) + val location = information.split("\\r?\\n").filter(_.startsWith("Location:")).head + assert(location.endsWith(expected)) + } + + def checkHiveClientCalls[T](expected: Int)(f: => T): Unit = { + HiveCatalogMetrics.reset() + assert(HiveCatalogMetrics.METRIC_HIVE_CLIENT_CALLS.getCount === 0) + f + assert(HiveCatalogMetrics.METRIC_HIVE_CLIENT_CALLS.getCount === expected) + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/DropTableSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/DropTableSuite.scala new file mode 100644 index 0000000000000..0ca6184c9469e --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/DropTableSuite.scala @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution.command + +import org.apache.spark.sql.execution.command.v1 + +/** + * The class contains tests for the `DROP TABLE` command to check V1 Hive external table catalog. + */ +class DropTableSuite extends v1.DropTableSuiteBase with CommandSuiteBase { + test("hive client calls") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int) $defaultUsing") + checkHiveClientCalls(expected = 15) { + sql(s"DROP TABLE $t") + } + } + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/MsckRepairTableSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/MsckRepairTableSuite.scala new file mode 100644 index 0000000000000..fc40aa2b82f93 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/MsckRepairTableSuite.scala @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution.command + +import org.apache.spark.sql.execution.command.v1 + +/** + * The class contains tests for the `MSCK REPAIR TABLE` command to check + * V1 Hive external table catalog. + */ +class MsckRepairTableSuite extends v1.MsckRepairTableSuiteBase with CommandSuiteBase diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/ShowNamespacesSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/ShowNamespacesSuite.scala new file mode 100644 index 0000000000000..7aae000144ef0 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/ShowNamespacesSuite.scala @@ -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. + */ + +package org.apache.spark.sql.hive.execution.command + +import org.apache.spark.sql.execution.command.v1 +import org.apache.spark.sql.internal.SQLConf + +/** + * The class contains tests for the `SHOW NAMESPACES` and `SHOW DATABASES` commands to check + * V1 Hive external table catalog. + */ +class ShowNamespacesSuite extends v1.ShowNamespacesSuiteBase with CommandSuiteBase { + test("case sensitivity") { + Seq(true, false).foreach { caseSensitive => + withSQLConf(SQLConf.CASE_SENSITIVE.key -> caseSensitive.toString) { + withNamespace(s"$catalog.AAA", s"$catalog.bbb") { + sql(s"CREATE NAMESPACE $catalog.AAA") + sql(s"CREATE NAMESPACE $catalog.bbb") + runShowNamespacesSql( + s"SHOW NAMESPACES IN $catalog", + Seq("aaa", "bbb") ++ builtinTopNamespaces) + runShowNamespacesSql(s"SHOW NAMESPACES IN $catalog LIKE 'AAA'", Seq("aaa")) + runShowNamespacesSql(s"SHOW NAMESPACES IN $catalog LIKE 'aaa'", Seq("aaa")) + } + } + } + } + + test("hive client calls") { + withNamespace(s"$catalog.ns1", s"$catalog.ns2") { + sql(s"CREATE NAMESPACE $catalog.ns1") + sql(s"CREATE NAMESPACE $catalog.ns2") + + checkHiveClientCalls(expected = 1) { + sql(s"SHOW NAMESPACES IN $catalog") + } + } + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/ShowPartitionsSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/ShowPartitionsSuite.scala new file mode 100644 index 0000000000000..c3d9790e1f6e5 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/ShowPartitionsSuite.scala @@ -0,0 +1,50 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution.command + +import org.apache.spark.sql.Row +import org.apache.spark.sql.execution.command.v1 + +/** + * The class contains tests for the `SHOW PARTITIONS` command to check + * V1 Hive external table catalog. + */ +class ShowPartitionsSuite extends v1.ShowPartitionsSuiteBase with CommandSuiteBase { + test("SPARK-33904: null and empty string as partition values") { + withSQLConf("hive.exec.dynamic.partition.mode" -> "nonstrict") { + withNamespaceAndTable("ns", "tbl") { t => + createNullPartTable(t, "hive") + runShowPartitionsSql( + s"SHOW PARTITIONS $t", + Row("part=__HIVE_DEFAULT_PARTITION__") :: Nil) + checkAnswer(spark.table(t), + Row(0, "__HIVE_DEFAULT_PARTITION__") :: + Row(1, "__HIVE_DEFAULT_PARTITION__") :: Nil) + } + } + } + + test("hive client calls") { + withNamespaceAndTable("ns", "dateTable") { t => + createDateTable(t) + checkHiveClientCalls(expected = 10) { + sql(s"SHOW PARTITIONS $t") + } + } + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/ShowTablesSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/ShowTablesSuite.scala new file mode 100644 index 0000000000000..b6db9a3e74315 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/ShowTablesSuite.scala @@ -0,0 +1,34 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution.command + +import org.apache.spark.sql.execution.command.v1 + +/** + * The class contains tests for the `SHOW TABLES` command to check V1 Hive external table catalog. + */ +class ShowTablesSuite extends v1.ShowTablesSuiteBase with CommandSuiteBase { + test("hive client calls") { + withNamespaceAndTable("ns", "tbl") { t => + sql(s"CREATE TABLE $t (id int) $defaultUsing") + checkHiveClientCalls(expected = 3) { + sql(s"SHOW TABLES IN $catalog.ns") + } + } + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/TruncateTableSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/TruncateTableSuite.scala new file mode 100644 index 0000000000000..37d20eff8211d --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/command/TruncateTableSuite.scala @@ -0,0 +1,26 @@ +/* + * 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. + */ + +package org.apache.spark.sql.hive.execution.command + +import org.apache.spark.sql.execution.command.v1 + +/** + * The class contains tests for the `TRUNCATE TABLE` command to check + * V1 Hive external table catalog. + */ +class TruncateTableSuite extends v1.TruncateTableSuiteBase with CommandSuiteBase diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcFilterSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcFilterSuite.scala deleted file mode 100644 index 5fc41067f661d..0000000000000 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcFilterSuite.scala +++ /dev/null @@ -1,484 +0,0 @@ -/* - * 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. - */ - -package org.apache.spark.sql.hive.orc - -import java.nio.charset.StandardCharsets -import java.sql.{Date, Timestamp} - -import scala.collection.JavaConverters._ - -import org.apache.hadoop.hive.ql.io.sarg.{PredicateLeaf, SearchArgument} - -import org.apache.spark.sql.{Column, DataFrame} -import org.apache.spark.sql.catalyst.dsl.expressions._ -import org.apache.spark.sql.catalyst.expressions._ -import org.apache.spark.sql.catalyst.planning.PhysicalOperation -import org.apache.spark.sql.execution.datasources.{DataSourceStrategy, HadoopFsRelation, LogicalRelation} -import org.apache.spark.sql.execution.datasources.orc.OrcTest -import org.apache.spark.sql.hive.HiveUtils -import org.apache.spark.sql.hive.test.TestHiveSingleton -import org.apache.spark.sql.types._ - -/** - * A test suite that tests Hive ORC filter API based filter pushdown optimization. - */ -class HiveOrcFilterSuite extends OrcTest with TestHiveSingleton { - - override val orcImp: String = "hive" - - private def checkFilterPredicate( - df: DataFrame, - predicate: Predicate, - checker: (SearchArgument) => Unit): Unit = { - val output = predicate.collect { case a: Attribute => a }.distinct - val query = df - .select(output.map(e => Column(e)): _*) - .where(Column(predicate)) - - var maybeRelation: Option[HadoopFsRelation] = None - val maybeAnalyzedPredicate = query.queryExecution.optimizedPlan.collect { - case PhysicalOperation(_, filters, LogicalRelation(orcRelation: HadoopFsRelation, _, _, _)) => - maybeRelation = Some(orcRelation) - filters - }.flatten.reduceLeftOption(_ && _) - assert(maybeAnalyzedPredicate.isDefined, "No filter is analyzed from the given query") - - val (_, selectedFilters, _) = - DataSourceStrategy.selectFilters(maybeRelation.get, maybeAnalyzedPredicate.toSeq) - assert(selectedFilters.nonEmpty, "No filter is pushed down") - - val maybeFilter = OrcFilters.createFilter(query.schema, selectedFilters.toArray) - assert(maybeFilter.isDefined, s"Couldn't generate filter predicate for $selectedFilters") - checker(maybeFilter.get) - } - - private def checkFilterPredicate - (predicate: Predicate, filterOperator: PredicateLeaf.Operator) - (implicit df: DataFrame): Unit = { - def checkComparisonOperator(filter: SearchArgument) = { - val operator = filter.getLeaves.asScala - assert(operator.map(_.getOperator).contains(filterOperator)) - } - checkFilterPredicate(df, predicate, checkComparisonOperator) - } - - private def checkFilterPredicateWithDiffHiveVersion - (predicate: Predicate, stringExpr: String) - (implicit df: DataFrame): Unit = { - def checkLogicalOperator(filter: SearchArgument) = { - if (HiveUtils.isHive23) { - assert(filter.toString == stringExpr.replace("\n", ", ")) - } else { - assert(filter.toString == stringExpr) - } - } - checkFilterPredicate(df, predicate, checkLogicalOperator) - } - - private def assertResultWithDiffHiveVersion(expected : String)(c : scala.Any) = { - if (HiveUtils.isHive23) { - assertResult(expected.replace("\n", ", "))(c) - } else { - assertResult(expected)(c) - } - } - - private def checkNoFilterPredicate - (predicate: Predicate) - (implicit df: DataFrame): Unit = { - val output = predicate.collect { case a: Attribute => a }.distinct - val query = df - .select(output.map(e => Column(e)): _*) - .where(Column(predicate)) - - var maybeRelation: Option[HadoopFsRelation] = None - val maybeAnalyzedPredicate = query.queryExecution.optimizedPlan.collect { - case PhysicalOperation(_, filters, LogicalRelation(orcRelation: HadoopFsRelation, _, _, _)) => - maybeRelation = Some(orcRelation) - filters - }.flatten.reduceLeftOption(_ && _) - assert(maybeAnalyzedPredicate.isDefined, "No filter is analyzed from the given query") - - val (_, selectedFilters, _) = - DataSourceStrategy.selectFilters(maybeRelation.get, maybeAnalyzedPredicate.toSeq) - assert(selectedFilters.nonEmpty, "No filter is pushed down") - - val maybeFilter = OrcFilters.createFilter(query.schema, selectedFilters.toArray) - assert(maybeFilter.isEmpty, s"Could generate filter predicate for $selectedFilters") - } - - test("filter pushdown - integer") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === 1, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < 2, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= 4, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(1) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(1) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(2) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(3) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(1) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(4) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - long") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i.toLong)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === 1, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < 2, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= 4, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(1) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(1) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(2) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(3) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(1) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(4) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - float") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i.toFloat)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === 1, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < 2, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= 4, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(1) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(1) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(2) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(3) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(1) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(4) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - double") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i.toDouble)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === 1, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> 1, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < 2, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > 3, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= 1, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= 4, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(1) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(1) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(2) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(3) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(1) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(4) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - string") { - withOrcDataFrame((1 to 4).map(i => Tuple1(i.toString))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === "1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> "1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < "2", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > "3", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= "1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= "4", PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal("1") === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal("1") <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal("2") > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal("3") < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal("1") >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal("4") <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - boolean") { - withOrcDataFrame((true :: false :: Nil).map(b => Tuple1.apply(Option(b)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === true, PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> true, PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < true, PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > false, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= false, PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= false, PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(false) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(false) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(false) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(true) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(true) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(true) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - decimal") { - withOrcDataFrame((1 to 4).map(i => Tuple1.apply(BigDecimal.valueOf(i)))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === BigDecimal.valueOf(1), PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> BigDecimal.valueOf(1), PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < BigDecimal.valueOf(2), PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > BigDecimal.valueOf(3), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= BigDecimal.valueOf(1), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= BigDecimal.valueOf(4), PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate( - Literal(BigDecimal.valueOf(1)) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate( - Literal(BigDecimal.valueOf(1)) <=> $"_1", PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate( - Literal(BigDecimal.valueOf(2)) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate( - Literal(BigDecimal.valueOf(3)) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate( - Literal(BigDecimal.valueOf(1)) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate( - Literal(BigDecimal.valueOf(4)) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - timestamp") { - val timeString = "2015-08-20 14:57:00" - val timestamps = (1 to 4).map { i => - val milliseconds = Timestamp.valueOf(timeString).getTime + i * 3600 - new Timestamp(milliseconds) - } - withOrcDataFrame(timestamps.map(Tuple1(_))) { implicit df => - checkFilterPredicate($"_1".isNull, PredicateLeaf.Operator.IS_NULL) - - checkFilterPredicate($"_1" === timestamps(0), PredicateLeaf.Operator.EQUALS) - checkFilterPredicate($"_1" <=> timestamps(0), PredicateLeaf.Operator.NULL_SAFE_EQUALS) - - checkFilterPredicate($"_1" < timestamps(1), PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate($"_1" > timestamps(2), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" <= timestamps(0), PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate($"_1" >= timestamps(3), PredicateLeaf.Operator.LESS_THAN) - - checkFilterPredicate(Literal(timestamps(0)) === $"_1", PredicateLeaf.Operator.EQUALS) - checkFilterPredicate(Literal(timestamps(0)) <=> $"_1", - PredicateLeaf.Operator.NULL_SAFE_EQUALS) - checkFilterPredicate(Literal(timestamps(1)) > $"_1", PredicateLeaf.Operator.LESS_THAN) - checkFilterPredicate(Literal(timestamps(2)) < $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(timestamps(0)) >= $"_1", PredicateLeaf.Operator.LESS_THAN_EQUALS) - checkFilterPredicate(Literal(timestamps(3)) <= $"_1", PredicateLeaf.Operator.LESS_THAN) - } - } - - test("filter pushdown - combinations with logical operators") { - withOrcDataFrame((1 to 4).map(i => Tuple1(Option(i)))) { implicit df => - // Because `ExpressionTree` is not accessible at Hive 1.2.x, this should be checked - // in string form in order to check filter creation including logical operators - // such as `and`, `or` or `not`. So, this function uses `SearchArgument.toString()` - // to produce string expression and then compare it to given string expression below. - // This might have to be changed after Hive version is upgraded. - checkFilterPredicateWithDiffHiveVersion( - $"_1".isNotNull, - """leaf-0 = (IS_NULL _1) - |expr = (not leaf-0)""".stripMargin.trim - ) - checkFilterPredicateWithDiffHiveVersion( - $"_1" =!= 1, - """leaf-0 = (IS_NULL _1) - |leaf-1 = (EQUALS _1 1) - |expr = (and (not leaf-0) (not leaf-1))""".stripMargin.trim - ) - checkFilterPredicateWithDiffHiveVersion( - !($"_1" < 4), - """leaf-0 = (IS_NULL _1) - |leaf-1 = (LESS_THAN _1 4) - |expr = (and (not leaf-0) (not leaf-1))""".stripMargin.trim - ) - checkFilterPredicateWithDiffHiveVersion( - $"_1" < 2 || $"_1" > 3, - """leaf-0 = (LESS_THAN _1 2) - |leaf-1 = (LESS_THAN_EQUALS _1 3) - |expr = (or leaf-0 (not leaf-1))""".stripMargin.trim - ) - checkFilterPredicateWithDiffHiveVersion( - $"_1" < 2 && $"_1" > 3, - """leaf-0 = (IS_NULL _1) - |leaf-1 = (LESS_THAN _1 2) - |leaf-2 = (LESS_THAN_EQUALS _1 3) - |expr = (and (not leaf-0) leaf-1 (not leaf-2))""".stripMargin.trim - ) - } - } - - test("no filter pushdown - non-supported types") { - implicit class IntToBinary(int: Int) { - def b: Array[Byte] = int.toString.getBytes(StandardCharsets.UTF_8) - } - // ArrayType - withOrcDataFrame((1 to 4).map(i => Tuple1(Array(i)))) { implicit df => - checkNoFilterPredicate($"_1".isNull) - } - // BinaryType - withOrcDataFrame((1 to 4).map(i => Tuple1(i.b))) { implicit df => - checkNoFilterPredicate($"_1" <=> 1.b) - } - // DateType - if (!HiveUtils.isHive23) { - val stringDate = "2015-01-01" - withOrcDataFrame(Seq(Tuple1(Date.valueOf(stringDate)))) { implicit df => - checkNoFilterPredicate($"_1" === Date.valueOf(stringDate)) - } - } - // MapType - withOrcDataFrame((1 to 4).map(i => Tuple1(Map(i -> i)))) { implicit df => - checkNoFilterPredicate($"_1".isNotNull) - } - } - - test("SPARK-12218 and SPARK-25699 Converting conjunctions into ORC SearchArguments") { - import org.apache.spark.sql.sources._ - // The `LessThan` should be converted while the `StringContains` shouldn't - val schema = new StructType( - Array( - StructField("a", IntegerType, nullable = true), - StructField("b", StringType, nullable = true))) - assertResultWithDiffHiveVersion( - """leaf-0 = (LESS_THAN a 10) - |expr = leaf-0 - """.stripMargin.trim - ) { - OrcFilters.createFilter(schema, Array( - LessThan("a", 10), - StringContains("b", "prefix") - )).get.toString - } - - // The `LessThan` should be converted while the whole inner `And` shouldn't - assertResultWithDiffHiveVersion( - """leaf-0 = (LESS_THAN a 10) - |expr = leaf-0 - """.stripMargin.trim - ) { - OrcFilters.createFilter(schema, Array( - LessThan("a", 10), - Not(And( - GreaterThan("a", 1), - StringContains("b", "prefix") - )) - )).get.toString - } - - // Safely remove unsupported `StringContains` predicate and push down `LessThan` - assertResultWithDiffHiveVersion( - """leaf-0 = (LESS_THAN a 10) - |expr = leaf-0 - """.stripMargin.trim - ) { - OrcFilters.createFilter(schema, Array( - And( - LessThan("a", 10), - StringContains("b", "prefix") - ) - )).get.toString - } - - // Safely remove unsupported `StringContains` predicate, push down `LessThan` and `GreaterThan`. - assertResultWithDiffHiveVersion( - """leaf-0 = (LESS_THAN a 10) - |leaf-1 = (LESS_THAN_EQUALS a 1) - |expr = (and leaf-0 (not leaf-1)) - """.stripMargin.trim - ) { - OrcFilters.createFilter(schema, Array( - And( - And( - LessThan("a", 10), - StringContains("b", "prefix") - ), - GreaterThan("a", 1) - ) - )).get.toString - } - } - - test("SPARK-27699 Converting disjunctions into ORC SearchArguments") { - import org.apache.spark.sql.sources._ - // The `LessThan` should be converted while the `StringContains` shouldn't - val schema = new StructType( - Array( - StructField("a", IntegerType, nullable = true), - StructField("b", StringType, nullable = true))) - - // The predicate `StringContains` predicate is not able to be pushed down. - assertResultWithDiffHiveVersion("leaf-0 = (LESS_THAN_EQUALS a 10)\nleaf-1 = (LESS_THAN a 1)\n" + - "expr = (or (not leaf-0) leaf-1)") { - OrcFilters.createFilter(schema, Array( - Or( - GreaterThan("a", 10), - And( - StringContains("b", "prefix"), - LessThan("a", 1) - ) - ) - )).get.toString - } - - assertResultWithDiffHiveVersion("leaf-0 = (LESS_THAN_EQUALS a 10)\nleaf-1 = (LESS_THAN a 1)\n" + - "expr = (or (not leaf-0) leaf-1)") { - OrcFilters.createFilter(schema, Array( - Or( - And( - GreaterThan("a", 10), - StringContains("b", "foobar") - ), - And( - StringContains("b", "prefix"), - LessThan("a", 1) - ) - ) - )).get.toString - } - - assert(OrcFilters.createFilter(schema, Array( - Or( - StringContains("b", "foobar"), - And( - StringContains("b", "prefix"), - LessThan("a", 1) - ) - ) - )).isEmpty) - } -} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala index 990d9425fb7fc..280ffb05fc1dd 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcQuerySuite.scala @@ -20,6 +20,7 @@ package org.apache.spark.sql.hive.orc import java.io.File import com.google.common.io.Files +import org.apache.orc.OrcConf import org.apache.spark.sql.{AnalysisException, Row} import org.apache.spark.sql.catalyst.TableIdentifier @@ -168,9 +169,6 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton { } } - // Since Hive 1.2.1 library code path still has this problem, users may hit this - // when spark.sql.hive.convertMetastoreOrc=false. However, after SPARK-22279, - // Apache Spark with the default configuration doesn't hit this bug. test("SPARK-22267 Spark SQL incorrectly reads ORC files when column order is different") { Seq("native", "hive").foreach { orcImpl => withSQLConf(SQLConf.ORC_IMPLEMENTATION.key -> orcImpl) { @@ -179,10 +177,12 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton { Seq(1 -> 2).toDF("c1", "c2").write.orc(path) checkAnswer(spark.read.orc(path), Row(1, 2)) - withSQLConf(HiveUtils.CONVERT_METASTORE_ORC.key -> "true") { // default since 2.3.0 - withTable("t") { - sql(s"CREATE EXTERNAL TABLE t(c2 INT, c1 INT) STORED AS ORC LOCATION '$path'") - checkAnswer(spark.table("t"), Row(2, 1)) + Seq(true, false).foreach { convertMetastoreOrc => + withSQLConf(HiveUtils.CONVERT_METASTORE_ORC.key -> convertMetastoreOrc.toString) { + withTable("t") { + sql(s"CREATE EXTERNAL TABLE t(c2 INT, c1 INT) STORED AS ORC LOCATION '$path'") + checkAnswer(spark.table("t"), Row(2, 1)) + } } } } @@ -190,9 +190,6 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton { } } - // Since Hive 1.2.1 library code path still has this problem, users may hit this - // when spark.sql.hive.convertMetastoreOrc=false. However, after SPARK-22279, - // Apache Spark with the default configuration doesn't hit this bug. test("SPARK-19809 NullPointerException on zero-size ORC file") { Seq("native", "hive").foreach { orcImpl => withSQLConf(SQLConf.ORC_IMPLEMENTATION.key -> orcImpl) { @@ -201,8 +198,10 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton { sql(s"CREATE TABLE spark_19809(a int) STORED AS ORC LOCATION '$dir'") Files.touch(new File(s"${dir.getCanonicalPath}", "zero.orc")) - withSQLConf(HiveUtils.CONVERT_METASTORE_ORC.key -> "true") { // default since 2.3.0 - checkAnswer(spark.table("spark_19809"), Seq.empty) + Seq(true, false).foreach { convertMetastoreOrc => + withSQLConf(HiveUtils.CONVERT_METASTORE_ORC.key -> convertMetastoreOrc.toString) { + checkAnswer(spark.table("spark_19809"), Seq.empty) + } } } } @@ -224,7 +223,6 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton { } test("SPARK-26437 Can not query decimal type when value is 0") { - assume(HiveUtils.isHive23, "bad test: This bug fixed by HIVE-13083(Hive 2.0.1)") withSQLConf(HiveUtils.CONVERT_METASTORE_ORC.key -> "false") { withTable("spark_26437") { sql("CREATE TABLE spark_26437 STORED AS ORCFILE AS SELECT 0.00 AS c1") @@ -257,7 +255,6 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton { withSQLConf(HiveUtils.CONVERT_METASTORE_ORC.key -> "true", HiveUtils.CONVERT_INSERTING_PARTITIONED_TABLE.key -> conversion) { withTable("dummy_orc_partitioned") { - spark.sessionState.refreshTable("dummy_orc_partitioned") spark.sql( s""" |CREATE TABLE dummy_orc_partitioned(key INT, value STRING) @@ -288,4 +285,102 @@ class HiveOrcQuerySuite extends OrcQueryTest with TestHiveSingleton { } } } + + test("SPARK-32234 read ORC table with column names all starting with '_col'") { + Seq("native", "hive").foreach { orcImpl => + Seq("false", "true").foreach { vectorized => + withSQLConf( + SQLConf.ORC_IMPLEMENTATION.key -> orcImpl, + SQLConf.ORC_VECTORIZED_READER_ENABLED.key -> vectorized) { + withTable("test_hive_orc_impl") { + spark.sql( + s""" + | CREATE TABLE test_hive_orc_impl + | (_col1 INT, _col2 STRING, _col3 INT) + | STORED AS ORC + """.stripMargin) + spark.sql( + s""" + | INSERT INTO + | test_hive_orc_impl + | VALUES(9, '12', 2020) + """.stripMargin) + + val df = spark.sql("SELECT _col2 FROM test_hive_orc_impl") + checkAnswer(df, Row("12")) + } + } + } + } + } + + test("SPARK-32864: Support ORC forced positional evolution") { + Seq("native", "hive").foreach { orcImpl => + Seq(true, false).foreach { forcePositionalEvolution => + Seq(true, false).foreach { convertMetastore => + withSQLConf(SQLConf.ORC_IMPLEMENTATION.key -> orcImpl, + OrcConf.FORCE_POSITIONAL_EVOLUTION.getAttribute -> forcePositionalEvolution.toString, + HiveUtils.CONVERT_METASTORE_ORC.key -> convertMetastore.toString) { + withTempPath { f => + val path = f.getCanonicalPath + Seq[(Integer, Integer)]((1, 2), (3, 4), (5, 6), (null, null)) + .toDF("c1", "c2").write.orc(path) + val correctAnswer = Seq(Row(1, 2), Row(3, 4), Row(5, 6), Row(null, null)) + checkAnswer(spark.read.orc(path), correctAnswer) + + withTable("t") { + sql(s"CREATE EXTERNAL TABLE t(c3 INT, c2 INT) STORED AS ORC LOCATION '$path'") + + val expected = if (forcePositionalEvolution) { + correctAnswer + } else { + Seq(Row(null, 2), Row(null, 4), Row(null, 6), Row(null, null)) + } + + checkAnswer(spark.table("t"), expected) + } + } + } + } + } + } + } + + test("SPARK-32864: Support ORC forced positional evolution with partitioned table") { + Seq("native", "hive").foreach { orcImpl => + Seq(true, false).foreach { forcePositionalEvolution => + Seq(true, false).foreach { convertMetastore => + withSQLConf(SQLConf.ORC_IMPLEMENTATION.key -> orcImpl, + OrcConf.FORCE_POSITIONAL_EVOLUTION.getAttribute -> forcePositionalEvolution.toString, + HiveUtils.CONVERT_METASTORE_ORC.key -> convertMetastore.toString) { + withTempPath { f => + val path = f.getCanonicalPath + Seq[(Integer, Integer, Integer)]((1, 2, 1), (3, 4, 2), (5, 6, 3), (null, null, 4)) + .toDF("c1", "c2", "p").write.partitionBy("p").orc(path) + val correctAnswer = Seq(Row(1, 2, 1), Row(3, 4, 2), Row(5, 6, 3), Row(null, null, 4)) + checkAnswer(spark.read.orc(path), correctAnswer) + + withTable("t") { + sql( + s""" + |CREATE EXTERNAL TABLE t(c3 INT, c2 INT) + |PARTITIONED BY (p int) + |STORED AS ORC + |LOCATION '$path' + |""".stripMargin) + sql("MSCK REPAIR TABLE t") + val expected = if (forcePositionalEvolution) { + correctAnswer + } else { + Seq(Row(null, 2, 1), Row(null, 4, 2), Row(null, 6, 3), Row(null, null, 4)) + } + + checkAnswer(spark.table("t"), expected) + } + } + } + } + } + } + } } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcSourceSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcSourceSuite.scala index 91fd8a47339fc..e94e0b39c859c 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcSourceSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/HiveOrcSourceSuite.scala @@ -149,12 +149,7 @@ class HiveOrcSourceSuite extends OrcSuite with TestHiveSingleton { test("Check BloomFilter creation") { Seq(true, false).foreach { convertMetastore => withSQLConf(HiveUtils.CONVERT_METASTORE_ORC.key -> s"$convertMetastore") { - if (HiveUtils.isHive23) { - testBloomFilterCreation(org.apache.orc.OrcProto.Stream.Kind.BLOOM_FILTER_UTF8) - } else { - // Before ORC-101 - testBloomFilterCreation(org.apache.orc.OrcProto.Stream.Kind.BLOOM_FILTER) - } + testBloomFilterCreation(org.apache.orc.OrcProto.Stream.Kind.BLOOM_FILTER_UTF8) } } } @@ -162,7 +157,7 @@ class HiveOrcSourceSuite extends OrcSuite with TestHiveSingleton { test("Enforce direct encoding column-wise selectively") { Seq(true, false).foreach { convertMetastore => withSQLConf(HiveUtils.CONVERT_METASTORE_ORC.key -> s"$convertMetastore") { - testSelectiveDictionaryEncoding(isSelective = false, isHive23 = HiveUtils.isHive23) + testSelectiveDictionaryEncoding(isSelective = false, isHiveOrc = true) } } } @@ -322,7 +317,6 @@ class HiveOrcSourceSuite extends OrcSuite with TestHiveSingleton { } test("SPARK-31580: Read a file written before ORC-569") { - assume(HiveUtils.isHive23) // Hive 1.2 doesn't use Apache ORC // Test ORC file came from ORC-621 val df = readResourceOrcFile("test-data/TestStringDictionary.testRowIndex.orc") assert(df.where("str < 'row 001000'").count() === 1000) diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcReadBenchmark.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcReadBenchmark.scala index a26412c5163ec..6acb03e919e68 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcReadBenchmark.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/orc/OrcReadBenchmark.scala @@ -33,8 +33,7 @@ import org.apache.spark.sql.types._ * {{{ * To run this benchmark: * 1. without sbt: bin/spark-submit --class - * --jars ,,,, - * + * --jars ,, * 2. build/sbt "hive/test:runMain " * 3. generate result: SPARK_GENERATE_BENCHMARK_FILES=1 build/sbt "hive/test:runMain " * Results will be written to "benchmarks/OrcReadBenchmark-results.txt". diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/security/HiveHadoopDelegationTokenManagerSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/security/HiveHadoopDelegationTokenManagerSuite.scala index 97eab4f3f4f77..f8f555197daef 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/security/HiveHadoopDelegationTokenManagerSuite.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/security/HiveHadoopDelegationTokenManagerSuite.scala @@ -52,8 +52,8 @@ class HiveHadoopDelegationTokenManagerSuite extends SparkFunSuite { throw new ClassNotFoundException(name) } - val prefixBlacklist = Seq("java", "scala", "com.sun.", "sun.") - if (prefixBlacklist.exists(name.startsWith(_))) { + val prefixExcludeList = Seq("java", "scala", "com.sun.", "sun.") + if (prefixExcludeList.exists(name.startsWith(_))) { return currentLoader.loadClass(name) } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala b/sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala index a3e2444cae887..ec73d7f71887f 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/hive/test/TestHive.scala @@ -23,7 +23,6 @@ import java.util.{Set => JavaSet} import scala.collection.JavaConverters._ import scala.collection.mutable -import scala.language.implicitConversions import org.apache.hadoop.conf.Configuration import org.apache.hadoop.fs.Path @@ -38,11 +37,12 @@ import org.apache.spark.internal.config.UI._ import org.apache.spark.sql.{DataFrame, Dataset, SparkSession, SQLContext} import org.apache.spark.sql.catalyst.analysis.UnresolvedRelation import org.apache.spark.sql.catalyst.catalog.ExternalCatalogWithListener +import org.apache.spark.sql.catalyst.expressions.CodegenObjectFactoryMode import org.apache.spark.sql.catalyst.optimizer.ConvertToLocalRelation import org.apache.spark.sql.catalyst.plans.logical.{LogicalPlan, OneRowRelation} +import org.apache.spark.sql.connector.catalog.CatalogManager import org.apache.spark.sql.connector.catalog.CatalogV2Implicits._ import org.apache.spark.sql.execution.{QueryExecution, SQLExecution} -import org.apache.spark.sql.execution.command.CacheTableCommand import org.apache.spark.sql.hive._ import org.apache.spark.sql.hive.client.HiveClient import org.apache.spark.sql.internal.{SessionState, SharedState, SQLConf, WithTestConf} @@ -58,6 +58,7 @@ object TestHive new SparkConf() .set("spark.sql.test", "") .set(SQLConf.CODEGEN_FALLBACK.key, "false") + .set(SQLConf.CODEGEN_FACTORY_MODE.key, CodegenObjectFactoryMode.CODEGEN_ONLY.toString) .set(HiveUtils.HIVE_METASTORE_BARRIER_PREFIXES.key, "org.apache.spark.sql.hive.execution.PairSerDe") .set(WAREHOUSE_PATH.key, TestHiveContext.makeWarehouseDir().toURI.getPath) @@ -128,12 +129,12 @@ class TestHiveContext( * If loadTestTables is false, no test tables are loaded. Note that this flag can only be true * when running in the JVM, i.e. it needs to be false when calling from Python. */ - def this(sc: SparkContext, loadTestTables: Boolean = true) { - this(new TestHiveSparkSession(HiveUtils.withHiveExternalCatalog(sc), loadTestTables)) + def this(sc: SparkContext, loadTestTables: Boolean = true) = { + this(new TestHiveSparkSession(TestHiveContext.withHiveExternalCatalog(sc), loadTestTables)) } - def this(sc: SparkContext, hiveClient: HiveClient) { - this(new TestHiveSparkSession(HiveUtils.withHiveExternalCatalog(sc), + def this(sc: SparkContext, hiveClient: HiveClient) = { + this(new TestHiveSparkSession(TestHiveContext.withHiveExternalCatalog(sc), hiveClient, loadTestTables = false)) } @@ -176,7 +177,7 @@ private[hive] class TestHiveSparkSession( private val loadTestTables: Boolean) extends SparkSession(sc) with Logging { self => - def this(sc: SparkContext, loadTestTables: Boolean) { + def this(sc: SparkContext, loadTestTables: Boolean) = { this( sc, existingSharedState = None, @@ -184,7 +185,7 @@ private[hive] class TestHiveSparkSession( loadTestTables) } - def this(sc: SparkContext, hiveClient: HiveClient, loadTestTables: Boolean) { + def this(sc: SparkContext, hiveClient: HiveClient, loadTestTables: Boolean) = { this( sc, existingSharedState = Some(new TestHiveSharedState(sc, Some(hiveClient))), @@ -326,20 +327,22 @@ private[hive] class TestHiveSparkSession( } if (loadTestTables) { + def createTableSQL(tblName: String): String = { + s"CREATE TABLE $tblName (key INT, value STRING) STORED AS textfile" + } // The test tables that are defined in the Hive QTestUtil. // /itests/util/src/main/java/org/apache/hadoop/hive/ql/QTestUtil.java // https://github.com/apache/hive/blob/branch-0.13/data/scripts/q_test_init.sql @transient val hiveQTestUtilTables: Seq[TestTable] = Seq( TestTable("src", - "CREATE TABLE src (key INT, value STRING) STORED AS TEXTFILE".cmd, + createTableSQL("src").cmd, s"LOAD DATA LOCAL INPATH '${quoteHiveFile("data/files/kv1.txt")}' INTO TABLE src".cmd), TestTable("src1", - "CREATE TABLE src1 (key INT, value STRING) STORED AS TEXTFILE".cmd, + createTableSQL("src1").cmd, s"LOAD DATA LOCAL INPATH '${quoteHiveFile("data/files/kv3.txt")}' INTO TABLE src1".cmd), TestTable("srcpart", () => { - "CREATE TABLE srcpart (key INT, value STRING) PARTITIONED BY (ds STRING, hr STRING)" - .cmd.apply() + s"${createTableSQL("srcpart")} PARTITIONED BY (ds STRING, hr STRING)".cmd.apply() for (ds <- Seq("2008-04-08", "2008-04-09"); hr <- Seq("11", "12")) { s""" |LOAD DATA LOCAL INPATH '${quoteHiveFile("data/files/kv1.txt")}' @@ -348,8 +351,7 @@ private[hive] class TestHiveSparkSession( } }), TestTable("srcpart1", () => { - "CREATE TABLE srcpart1 (key INT, value STRING) PARTITIONED BY (ds STRING, hr INT)" - .cmd.apply() + s"${createTableSQL("srcpart1")} PARTITIONED BY (ds STRING, hr INT)".cmd.apply() for (ds <- Seq("2008-04-08", "2008-04-09"); hr <- 11 to 12) { s""" |LOAD DATA LOCAL INPATH '${quoteHiveFile("data/files/kv1.txt")}' @@ -494,7 +496,10 @@ private[hive] class TestHiveSparkSession( def getLoadedTables: collection.mutable.HashSet[String] = sharedState.loadedTables def loadTestTable(name: String): Unit = { - if (!sharedState.loadedTables.contains(name)) { + // LOAD DATA does not work on temporary views. Since temporary views are resolved first, + // skip loading if there exists a temporary view with the given name. + if (sessionState.catalog.getTempView(name).isEmpty && + !sharedState.loadedTables.contains(name)) { // Marks the table as loaded first to prevent infinite mutually recursive table loading. sharedState.loadedTables += name logDebug(s"Loading test table $name") @@ -582,24 +587,22 @@ private[hive] class TestHiveQueryExecution( logicalPlan: LogicalPlan) extends QueryExecution(sparkSession, logicalPlan) with Logging { - def this(sparkSession: TestHiveSparkSession, sql: String) { + def this(sparkSession: TestHiveSparkSession, sql: String) = { this(sparkSession, sparkSession.sessionState.sqlParser.parsePlan(sql)) } - def this(sql: String) { + def this(sql: String) = { this(TestHive.sparkSession, sql) } override lazy val analyzed: LogicalPlan = sparkSession.withActive { - val describedTables = logical match { - case CacheTableCommand(tbl, _, _, _) => tbl :: Nil - case _ => Nil - } - // Make sure any test tables referenced are loaded. - val referencedTables = - describedTables ++ - logical.collect { case UnresolvedRelation(ident) => ident.asTableIdentifier } + val referencedTables = logical.collect { + case UnresolvedRelation(ident, _, _) => + if (ident.length > 1 && ident.head.equalsIgnoreCase(CatalogManager.SESSION_CATALOG_NAME)) { + ident.tail.asTableIdentifier + } else ident.asTableIdentifier + } val resolver = sparkSession.sessionState.conf.resolver val referencedTestTables = referencedTables.flatMap { tbl => val testTableOpt = sparkSession.testTables.keys.find(resolver(_, tbl.table)) @@ -644,6 +647,10 @@ private[hive] object TestHiveContext { scratchDir } + private def withHiveExternalCatalog(sc: SparkContext): SparkContext = { + sc.conf.set(CATALOG_IMPLEMENTATION.key, "hive") + sc + } } private[sql] class TestHiveSessionStateBuilder( @@ -677,7 +684,7 @@ private[hive] object HiveTestJars { val fileName = urlString.split("/").last val targetFile = new File(hiveTestJarsDir, fileName) if (!targetFile.exists()) { - Utils.doFetchFile(urlString, hiveTestJarsDir, fileName, new SparkConf, null, null) + Utils.doFetchFile(urlString, hiveTestJarsDir, fileName, new SparkConf, null) } targetFile } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/sources/DisableUnnecessaryBucketedScanWithHiveSupportSuite.scala b/sql/hive/src/test/scala/org/apache/spark/sql/sources/DisableUnnecessaryBucketedScanWithHiveSupportSuite.scala new file mode 100644 index 0000000000000..30eb93cb5c3e8 --- /dev/null +++ b/sql/hive/src/test/scala/org/apache/spark/sql/sources/DisableUnnecessaryBucketedScanWithHiveSupportSuite.scala @@ -0,0 +1,31 @@ +/* + * 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. + */ + +package org.apache.spark.sql.sources + +import org.apache.spark.sql.hive.test.TestHiveSingleton +import org.apache.spark.sql.internal.StaticSQLConf.CATALOG_IMPLEMENTATION + +class DisableUnnecessaryBucketedScanWithHiveSupportSuite + extends DisableUnnecessaryBucketedScanSuite + with TestHiveSingleton { + + protected override def beforeAll(): Unit = { + super.beforeAll() + assert(spark.sparkContext.conf.get(CATALOG_IMPLEMENTATION) == "hive") + } +} diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/sources/HadoopFsRelationTest.scala b/sql/hive/src/test/scala/org/apache/spark/sql/sources/HadoopFsRelationTest.scala index cbea74103343e..2637a1d18e345 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/sources/HadoopFsRelationTest.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/sources/HadoopFsRelationTest.scala @@ -18,6 +18,7 @@ package org.apache.spark.sql.sources import java.io.File +import java.util.Locale import scala.util.Random @@ -154,12 +155,23 @@ abstract class HadoopFsRelationTest extends QueryTest with SQLTestUtils with Tes java8ApiConfValues.foreach { java8Api => withSQLConf( SQLConf.DATETIME_JAVA8API_ENABLED.key -> java8Api.toString, - SQLConf.LEGACY_PARQUET_REBASE_MODE_IN_WRITE.key -> CORRECTED.toString, - SQLConf.LEGACY_AVRO_REBASE_MODE_IN_WRITE.key -> CORRECTED.toString) { + SQLConf.PARQUET_REBASE_MODE_IN_WRITE.key -> CORRECTED.toString, + SQLConf.PARQUET_INT96_REBASE_MODE_IN_WRITE.key -> CORRECTED.toString, + SQLConf.AVRO_REBASE_MODE_IN_WRITE.key -> CORRECTED.toString) { val dataGenerator = RandomDataGenerator.forType( dataType = dataType, nullable = true, - new Random(seed) + new Random(seed), + // TODO(SPARK-34440): Allow saving/loading datetime in ORC w/o rebasing + // The ORC datasource always performs datetime rebasing that can lead to + // shifting of the original dates/timestamps. For instance, 1582-10-06 is valid + // date in the Proleptic Gregorian calendar but it does not exist in the Julian + // calendar. The ORC datasource shifts the date to the next valid date 1582-10-15 + // during rebasing of this date to the Julian calendar. Since the test compares + // the original date before saving and the date loaded back from the ORC files, + // we set `validJulianDatetime` to `true` to generate only Proleptic Gregorian + // dates that exist in the Julian calendar and will be not changed during rebase. + validJulianDatetime = dataSourceName.toLowerCase(Locale.ROOT).contains("orc") ).getOrElse { fail(s"Failed to create data generator for schema $dataType") } diff --git a/sql/hive/src/test/scala/org/apache/spark/sql/sources/SimpleTextRelation.scala b/sql/hive/src/test/scala/org/apache/spark/sql/sources/SimpleTextRelation.scala index d1b97b2852fbc..debe1ab734cc9 100644 --- a/sql/hive/src/test/scala/org/apache/spark/sql/sources/SimpleTextRelation.scala +++ b/sql/hive/src/test/scala/org/apache/spark/sql/sources/SimpleTextRelation.scala @@ -117,7 +117,7 @@ class SimpleTextSource extends TextBasedFileFormat with DataSourceRegister { } } -class SimpleTextOutputWriter(path: String, dataSchema: StructType, context: TaskAttemptContext) +class SimpleTextOutputWriter(val path: String, dataSchema: StructType, context: TaskAttemptContext) extends OutputWriter { private val writer = CodecStreams.createOutputStreamWriter(context, new Path(path)) diff --git a/streaming/pom.xml b/streaming/pom.xml index ea351d449481a..bd8d352092e73 100644 --- a/streaming/pom.xml +++ b/streaming/pom.xml @@ -21,7 +21,7 @@ org.apache.spark spark-parent_2.12 - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml @@ -109,7 +109,7 @@ org.seleniumhq.selenium - selenium-htmlunit-driver + htmlunit-driver test diff --git a/streaming/src/main/scala/org/apache/spark/status/api/v1/streaming/ApiStreamingRootResource.scala b/streaming/src/main/scala/org/apache/spark/status/api/v1/streaming/ApiStreamingRootResource.scala index a2571b910f615..99d59e4a1447a 100644 --- a/streaming/src/main/scala/org/apache/spark/status/api/v1/streaming/ApiStreamingRootResource.scala +++ b/streaming/src/main/scala/org/apache/spark/status/api/v1/streaming/ApiStreamingRootResource.scala @@ -23,9 +23,7 @@ import javax.ws.rs.core.MediaType import org.apache.spark.status.api.v1.NotFoundException import org.apache.spark.streaming.Time -import org.apache.spark.streaming.ui.StreamingJobProgressListener import org.apache.spark.streaming.ui.StreamingJobProgressListener._ -import org.apache.spark.ui.SparkUI @Produces(Array(MediaType.APPLICATION_JSON)) private[v1] class ApiStreamingRootResource extends BaseStreamingAppResource { diff --git a/streaming/src/main/scala/org/apache/spark/streaming/DStreamGraph.scala b/streaming/src/main/scala/org/apache/spark/streaming/DStreamGraph.scala index 683db21d3f0e1..43aaa7e1eeaec 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/DStreamGraph.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/DStreamGraph.scala @@ -19,7 +19,7 @@ package org.apache.spark.streaming import java.io.{IOException, ObjectInputStream, ObjectOutputStream} -import scala.collection.mutable.ArrayBuffer +import scala.collection.mutable import scala.collection.parallel.immutable.ParVector import org.apache.spark.internal.Logging @@ -29,8 +29,8 @@ import org.apache.spark.util.Utils final private[streaming] class DStreamGraph extends Serializable with Logging { - private val inputStreams = new ArrayBuffer[InputDStream[_]]() - private val outputStreams = new ArrayBuffer[DStream[_]]() + private var inputStreams = mutable.ArraySeq.empty[InputDStream[_]] + private var outputStreams = mutable.ArraySeq.empty[DStream[_]] @volatile private var inputStreamNameAndID: Seq[(String, Int)] = Nil @@ -91,14 +91,14 @@ final private[streaming] class DStreamGraph extends Serializable with Logging { def addInputStream(inputStream: InputDStream[_]): Unit = { this.synchronized { inputStream.setGraph(this) - inputStreams += inputStream + inputStreams = inputStreams :+ inputStream } } def addOutputStream(outputStream: DStream[_]): Unit = { this.synchronized { outputStream.setGraph(this) - outputStreams += outputStream + outputStreams = outputStreams :+ outputStream } } @@ -123,7 +123,7 @@ final private[streaming] class DStreamGraph extends Serializable with Logging { val jobOption = outputStream.generateJob(time) jobOption.foreach(_.setCallSite(outputStream.creationSite)) jobOption - } + }.toSeq } logDebug("Generated " + jobs.length + " jobs for time " + time) jobs diff --git a/streaming/src/main/scala/org/apache/spark/streaming/State.scala b/streaming/src/main/scala/org/apache/spark/streaming/State.scala index 734c6ef42696e..c4cd1a9dc336b 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/State.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/State.scala @@ -17,8 +17,6 @@ package org.apache.spark.streaming -import scala.language.implicitConversions - import org.apache.spark.annotation.Experimental /** diff --git a/streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala b/streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala index 2d53a1b4c78b6..af3f5a060f54b 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingContext.scala @@ -67,7 +67,7 @@ class JavaStreamingContext(val ssc: StreamingContext) extends Closeable { * @param master Name of the Spark Master * @param appName Name to be used when registering with the scheduler * @param batchDuration The time interval at which streaming data will be divided into batches - * @param sparkHome The SPARK_HOME directory on the slave nodes + * @param sparkHome The SPARK_HOME directory on the worker nodes * @param jarFile JAR file containing job code, to ship to cluster. This can be a path on the * local file system or an HDFS, HTTP, HTTPS, or FTP URL. */ @@ -84,7 +84,7 @@ class JavaStreamingContext(val ssc: StreamingContext) extends Closeable { * @param master Name of the Spark Master * @param appName Name to be used when registering with the scheduler * @param batchDuration The time interval at which streaming data will be divided into batches - * @param sparkHome The SPARK_HOME directory on the slave nodes + * @param sparkHome The SPARK_HOME directory on the worker nodes * @param jars Collection of JARs to send to the cluster. These can be paths on the local file * system or HDFS, HTTP, HTTPS, or FTP URLs. */ @@ -101,7 +101,7 @@ class JavaStreamingContext(val ssc: StreamingContext) extends Closeable { * @param master Name of the Spark Master * @param appName Name to be used when registering with the scheduler * @param batchDuration The time interval at which streaming data will be divided into batches - * @param sparkHome The SPARK_HOME directory on the slave nodes + * @param sparkHome The SPARK_HOME directory on the worker nodes * @param jars Collection of JARs to send to the cluster. These can be paths on the local file * system or HDFS, HTTP, HTTPS, or FTP URLs. * @param environment Environment variables to set on worker nodes @@ -366,7 +366,7 @@ class JavaStreamingContext(val ssc: StreamingContext) extends Closeable { implicit val cm: ClassTag[T] = implicitly[ClassTag[AnyRef]].asInstanceOf[ClassTag[T]] val sQueue = new scala.collection.mutable.Queue[RDD[T]] - sQueue.enqueue(queue.asScala.map(_.rdd).toSeq: _*) + sQueue ++= queue.asScala.map(_.rdd) ssc.queueStream(sQueue) } @@ -390,7 +390,7 @@ class JavaStreamingContext(val ssc: StreamingContext) extends Closeable { implicit val cm: ClassTag[T] = implicitly[ClassTag[AnyRef]].asInstanceOf[ClassTag[T]] val sQueue = new scala.collection.mutable.Queue[RDD[T]] - sQueue.enqueue(queue.asScala.map(_.rdd).toSeq: _*) + sQueue ++= queue.asScala.map(_.rdd) ssc.queueStream(sQueue, oneAtATime) } @@ -415,7 +415,7 @@ class JavaStreamingContext(val ssc: StreamingContext) extends Closeable { implicit val cm: ClassTag[T] = implicitly[ClassTag[AnyRef]].asInstanceOf[ClassTag[T]] val sQueue = new scala.collection.mutable.Queue[RDD[T]] - sQueue.enqueue(queue.asScala.map(_.rdd).toSeq: _*) + sQueue ++= queue.asScala.map(_.rdd) ssc.queueStream(sQueue, oneAtATime, defaultRDD.rdd) } diff --git a/streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingListenerWrapper.scala b/streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingListenerWrapper.scala index ee8370d262609..7555e2f57fccb 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingListenerWrapper.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/api/java/JavaStreamingListenerWrapper.scala @@ -65,7 +65,7 @@ private[streaming] class JavaStreamingListenerWrapper(javaStreamingListener: Jav private def toJavaBatchInfo(batchInfo: BatchInfo): JavaBatchInfo = { JavaBatchInfo( batchInfo.batchTime, - batchInfo.streamIdToInputInfo.mapValues(toJavaStreamInputInfo(_)).asJava, + batchInfo.streamIdToInputInfo.mapValues(toJavaStreamInputInfo).toMap.asJava, batchInfo.submissionTime, batchInfo.processingStartTime.getOrElse(-1), batchInfo.processingEndTime.getOrElse(-1), @@ -73,7 +73,7 @@ private[streaming] class JavaStreamingListenerWrapper(javaStreamingListener: Jav batchInfo.processingDelay.getOrElse(-1), batchInfo.totalDelay.getOrElse(-1), batchInfo.numRecords, - batchInfo.outputOperationInfos.mapValues(toJavaOutputOperationInfo(_)).asJava + batchInfo.outputOperationInfos.mapValues(toJavaOutputOperationInfo).toMap.asJava ) } diff --git a/streaming/src/main/scala/org/apache/spark/streaming/api/python/PythonDStream.scala b/streaming/src/main/scala/org/apache/spark/streaming/api/python/PythonDStream.scala index 570663c6f6ad3..7a8e3f1d2ccf4 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/api/python/PythonDStream.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/api/python/PythonDStream.scala @@ -163,7 +163,7 @@ private[python] object PythonTransformFunctionSerializer { private[streaming] object PythonDStream { /** - * can not access PythonTransformFunctionSerializer.register() via Py4j + * cannot access PythonTransformFunctionSerializer.register() via Py4j * Py4JError: PythonTransformFunctionSerializerregister does not exist in the JVM */ def registerSerializer(ser: PythonTransformFunctionSerializer): Unit = { diff --git a/streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala b/streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala index e037f26088347..ca4f3670d5ad7 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/dstream/DStream.scala @@ -960,7 +960,7 @@ object DStream { /** Get the creation site of a DStream from the stack trace of when the DStream is created. */ private[streaming] def getCreationSite(): CallSite = { /** Filtering function that excludes non-user classes for a streaming application */ - def streamingExclustionFunction(className: String): Boolean = { + def streamingExclusionFunction(className: String): Boolean = { def doesMatch(r: Regex): Boolean = r.findFirstIn(className).isDefined val isSparkClass = doesMatch(SPARK_CLASS_REGEX) val isSparkExampleClass = doesMatch(SPARK_EXAMPLES_CLASS_REGEX) @@ -972,6 +972,6 @@ object DStream { // non-Spark and non-Scala class, as the rest would streaming application classes. (isSparkClass || isScalaClass) && !isSparkExampleClass && !isSparkStreamingTestClass } - org.apache.spark.util.Utils.getCallSite(streamingExclustionFunction) + org.apache.spark.util.Utils.getCallSite(streamingExclusionFunction) } } diff --git a/streaming/src/main/scala/org/apache/spark/streaming/dstream/UnionDStream.scala b/streaming/src/main/scala/org/apache/spark/streaming/dstream/UnionDStream.scala index d46c0a01e05d9..2f4536ec6f0c2 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/dstream/UnionDStream.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/dstream/UnionDStream.scala @@ -45,7 +45,7 @@ class UnionDStream[T: ClassTag](parents: Array[DStream[T]]) s" time $validTime") } if (rdds.nonEmpty) { - Some(ssc.sc.union(rdds)) + Some(ssc.sc.union(rdds.toSeq)) } else { None } diff --git a/streaming/src/main/scala/org/apache/spark/streaming/rdd/MapWithStateRDD.scala b/streaming/src/main/scala/org/apache/spark/streaming/rdd/MapWithStateRDD.scala index 8da5a5f8193cf..662312b7b0db8 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/rdd/MapWithStateRDD.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/rdd/MapWithStateRDD.scala @@ -75,7 +75,7 @@ private[streaming] object MapWithStateRDDRecord { } } - MapWithStateRDDRecord(newStateMap, mappedData) + MapWithStateRDDRecord(newStateMap, mappedData.toSeq) } } diff --git a/streaming/src/main/scala/org/apache/spark/streaming/rdd/WriteAheadLogBackedBlockRDD.scala b/streaming/src/main/scala/org/apache/spark/streaming/rdd/WriteAheadLogBackedBlockRDD.scala index f677c492d561f..6494e512713f8 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/rdd/WriteAheadLogBackedBlockRDD.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/rdd/WriteAheadLogBackedBlockRDD.scala @@ -96,7 +96,7 @@ class WriteAheadLogBackedBlockRDD[T: ClassTag]( @transient private val hadoopConfig = sc.hadoopConfiguration private val broadcastedHadoopConf = new SerializableConfiguration(hadoopConfig) - override def isValid(): Boolean = true + override def isValid: Boolean = true override def getPartitions: Array[Partition] = { assertValid() diff --git a/streaming/src/main/scala/org/apache/spark/streaming/receiver/ReceivedBlockHandler.scala b/streaming/src/main/scala/org/apache/spark/streaming/receiver/ReceivedBlockHandler.scala index 12ed8015117e5..7a561ecb4990f 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/receiver/ReceivedBlockHandler.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/receiver/ReceivedBlockHandler.scala @@ -234,7 +234,7 @@ private[streaming] class CountingIterator[T](iterator: Iterator[T]) extends Iter private def isFullyConsumed: Boolean = !iterator.hasNext - def hasNext(): Boolean = iterator.hasNext + def hasNext: Boolean = iterator.hasNext def count(): Option[Long] = { if (isFullyConsumed) Some(_count) else None diff --git a/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManager.scala b/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManager.scala index 58bd56c591d04..1037950a4424f 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManager.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManager.scala @@ -22,8 +22,10 @@ import scala.util.Random import org.apache.spark.{ExecutorAllocationClient, SparkConf} import org.apache.spark.internal.Logging +import org.apache.spark.internal.config.DECOMMISSION_ENABLED import org.apache.spark.internal.config.Streaming._ import org.apache.spark.resource.ResourceProfile +import org.apache.spark.scheduler.ExecutorDecommissionInfo import org.apache.spark.streaming.util.RecurringTimer import org.apache.spark.util.{Clock, Utils} @@ -133,7 +135,13 @@ private[streaming] class ExecutorAllocationManager( logDebug(s"Removable executors (${removableExecIds.size}): ${removableExecIds}") if (removableExecIds.nonEmpty) { val execIdToRemove = removableExecIds(Random.nextInt(removableExecIds.size)) - client.killExecutor(execIdToRemove) + if (conf.get(DECOMMISSION_ENABLED)) { + client.decommissionExecutor(execIdToRemove, + ExecutorDecommissionInfo("spark scale down", None), + adjustTargetNumExecutors = true) + } else { + client.killExecutor(execIdToRemove) + } logInfo(s"Requested to kill executor $execIdToRemove") } else { logInfo(s"No non-receiver executors to kill") diff --git a/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala b/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala index 6c71b18b46213..4ac1c62822e7a 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceivedBlockTracker.scala @@ -21,7 +21,6 @@ import java.nio.ByteBuffer import scala.collection.JavaConverters._ import scala.collection.mutable -import scala.language.implicitConversions import scala.util.control.NonFatal import org.apache.hadoop.conf.Configuration @@ -116,7 +115,9 @@ private[streaming] class ReceivedBlockTracker( // a few thousand elements. So we explicitly allocate a collection for serialization which // we know doesn't have this issue. (See SPARK-26734). val streamIdToBlocks = streamIds.map { streamId => - (streamId, mutable.ArrayBuffer(getReceivedBlockQueue(streamId).clone(): _*)) + val blocks = mutable.ArrayBuffer[ReceivedBlockInfo]() + blocks ++= getReceivedBlockQueue(streamId).clone() + (streamId, blocks.toSeq) }.toMap val allocatedBlocks = AllocatedBlocks(streamIdToBlocks) if (writeToLog(BatchAllocationEvent(batchTime, allocatedBlocks))) { diff --git a/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverSchedulingPolicy.scala b/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverSchedulingPolicy.scala index 4105171a3db24..0e4a64f6c0e4b 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverSchedulingPolicy.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverSchedulingPolicy.scala @@ -128,14 +128,14 @@ private[streaming] class ReceiverSchedulingPolicy { } // Assign idle executors to receivers that have less executors - val idleExecutors = numReceiversOnExecutor.filter(_._2 == 0).map(_._1) + val idleExecutors = numReceiversOnExecutor.filter(_._2 == 0).keys for (executor <- idleExecutors) { // Assign an idle executor to the receiver that has least candidate executors. val leastScheduledExecutors = scheduledLocations.minBy(_.size) leastScheduledExecutors += executor } - receivers.map(_.streamId).zip(scheduledLocations).toMap + receivers.map(_.streamId).zip(scheduledLocations.map(_.toSeq)).toMap } /** @@ -183,7 +183,7 @@ private[streaming] class ReceiverSchedulingPolicy { val executorWeights: Map[ExecutorCacheTaskLocation, Double] = { receiverTrackingInfoMap.values.flatMap(convertReceiverTrackingInfoToExecutorWeights) - .groupBy(_._1).mapValues(_.map(_._2).sum) // Sum weights for each executor + .groupBy(_._1).mapValues(_.map(_._2).sum).toMap // Sum weights for each executor } val idleExecutors = executors.toSet -- executorWeights.keys diff --git a/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala b/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala index 13cf5cc0e71ea..342a0a43b5068 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala @@ -248,7 +248,7 @@ class ReceiverTracker(ssc: StreamingContext, skipReceiverLaunch: Boolean = false _.runningExecutor.map { _.executorId } - } + }.toMap } else { Map.empty } @@ -415,7 +415,7 @@ class ReceiverTracker(ssc: StreamingContext, skipReceiverLaunch: Boolean = false } /** - * Run the dummy Spark job to ensure that all slaves have registered. This avoids all the + * Run the dummy Spark job to ensure that all executors have registered. This avoids all the * receivers to be scheduled on the same node. * * TODO Should poll the executor number and wait for executors according to diff --git a/streaming/src/main/scala/org/apache/spark/streaming/ui/AllBatchesTable.scala b/streaming/src/main/scala/org/apache/spark/streaming/ui/AllBatchesTable.scala index 1e443f656734c..c0eec0e0b0a85 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/ui/AllBatchesTable.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/ui/AllBatchesTable.scala @@ -17,30 +17,41 @@ package org.apache.spark.streaming.ui -import scala.xml.Node - -import org.apache.spark.ui.{UIUtils => SparkUIUtils} +import java.net.URLEncoder +import java.nio.charset.StandardCharsets.UTF_8 +import javax.servlet.http.HttpServletRequest -private[ui] abstract class BatchTableBase(tableId: String, batchInterval: Long) { +import scala.xml.Node - protected def columns: Seq[Node] = { - Batch Time - Records - Scheduling Delay - {SparkUIUtils.tooltip("Time taken by Streaming scheduler to submit jobs of a batch", "top")} - - Processing Time - {SparkUIUtils.tooltip("Time taken to process all jobs of a batch", "top")} - } +import org.apache.spark.ui.{PagedDataSource, PagedTable, UIUtils => SparkUIUtils} + +private[ui] class StreamingPagedTable( + request: HttpServletRequest, + tableTag: String, + batches: Seq[BatchUIData], + basePath: String, + subPath: String, + batchInterval: Long) extends PagedTable[BatchUIData] { + + private val(sortColumn, desc, pageSize) = getTableParameters(request, tableTag, "Batch Time") + private val parameterPath = s"$basePath/$subPath/?${getParameterOtherTable(request, tableTag)}" + private val encodedSortColumn = URLEncoder.encode(sortColumn, UTF_8.name()) + + private val firstFailureReason: Option[String] = + if (!tableTag.equals("waitingBatches")) { + getFirstFailureReason(batches) + } else { + None + } /** * Return the first failure reason if finding in the batches. */ - protected def getFirstFailureReason(batches: Seq[BatchUIData]): Option[String] = { + private def getFirstFailureReason(batches: Seq[BatchUIData]): Option[String] = { batches.flatMap(_.outputOperations.flatMap(_._2.failureReason)).headOption } - protected def getFirstFailureTableCell(batch: BatchUIData): Seq[Node] = { + private def getFirstFailureTableCell(batch: BatchUIData): Seq[Node] = { val firstFailureReason = batch.outputOperations.flatMap(_._2.failureReason).headOption firstFailureReason.map { failureReason => val failureReasonForUI = UIUtils.createOutputOperationFailureForUI(failureReason) @@ -49,147 +60,154 @@ private[ui] abstract class BatchTableBase(tableId: String, batchInterval: Long) }.getOrElse(-) } - protected def baseRow(batch: BatchUIData): Seq[Node] = { - val batchTime = batch.batchTime.milliseconds - val formattedBatchTime = SparkUIUtils.formatBatchTime(batchTime, batchInterval) - val numRecords = batch.numRecords - val schedulingDelay = batch.schedulingDelay - val formattedSchedulingDelay = schedulingDelay.map(SparkUIUtils.formatDuration).getOrElse("-") - val processingTime = batch.processingDelay - val formattedProcessingTime = processingTime.map(SparkUIUtils.formatDuration).getOrElse("-") - val batchTimeId = s"batch-$batchTime" - - - - {formattedBatchTime} - - - {numRecords.toString} records - - {formattedSchedulingDelay} - - - {formattedProcessingTime} - - } - - private def batchTable: Seq[Node] = { - - - {columns} - - - {renderRows} - -
    - } - - def toNodeSeq: Seq[Node] = { - batchTable - } - - protected def createOutputOperationProgressBar(batch: BatchUIData): Seq[Node] = { + private def createOutputOperationProgressBar(batch: BatchUIData): Seq[Node] = { { - SparkUIUtils.makeProgressBar( - started = batch.numActiveOutputOp, - completed = batch.numCompletedOutputOp, - failed = batch.numFailedOutputOp, - skipped = 0, - reasonToNumKilled = Map.empty, - total = batch.outputOperations.size) + SparkUIUtils.makeProgressBar( + started = batch.numActiveOutputOp, + completed = batch.numCompletedOutputOp, + failed = batch.numFailedOutputOp, + skipped = 0, + reasonToNumKilled = Map.empty, + total = batch.outputOperations.size) } } - /** - * Return HTML for all rows of this table. - */ - protected def renderRows: Seq[Node] -} + override def tableId: String = s"$tableTag-table" -private[ui] class ActiveBatchTable( - runningBatches: Seq[BatchUIData], - waitingBatches: Seq[BatchUIData], - batchInterval: Long) extends BatchTableBase("active-batches-table", batchInterval) { + override def tableCssClass: String = + "table table-bordered table-sm table-striped table-head-clickable table-cell-width-limited" - private val firstFailureReason = getFirstFailureReason(runningBatches) + override def pageSizeFormField: String = s"$tableTag.pageSize" - override protected def columns: Seq[Node] = super.columns ++ { - Output Ops: Succeeded/Total - Status ++ { - if (firstFailureReason.nonEmpty) { - Error - } else { - Nil - } - } - } + override def pageNumberFormField: String = s"$tableTag.page" - override protected def renderRows: Seq[Node] = { - // The "batchTime"s of "waitingBatches" must be greater than "runningBatches"'s, so display - // waiting batches before running batches - waitingBatches.flatMap(batch => {waitingBatchRow(batch)}) ++ - runningBatches.flatMap(batch => {runningBatchRow(batch)}) + override def pageLink(page: Int): String = { + parameterPath + + s"&$tableTag.sort=$encodedSortColumn" + + s"&$tableTag.desc=$desc" + + s"&$pageNumberFormField=$page" + + s"&$pageSizeFormField=$pageSize" + + s"#$tableTag" } - private def runningBatchRow(batch: BatchUIData): Seq[Node] = { - baseRow(batch) ++ createOutputOperationProgressBar(batch) ++ processing ++ { - if (firstFailureReason.nonEmpty) { - getFirstFailureTableCell(batch) - } else { - Nil + override def goButtonFormPath: String = + s"$parameterPath&$tableTag.sort=$encodedSortColumn&$tableTag.desc=$desc#$tableTag" + + override def dataSource: PagedDataSource[BatchUIData] = + new StreamingDataSource(batches, pageSize, sortColumn, desc) + + override def headers: Seq[Node] = { + // headers, sortable and tooltips + val headersAndCssClasses: Seq[(String, Boolean, Option[String])] = { + Seq( + ("Batch Time", true, None), + ("Records", true, None), + ("Scheduling Delay", true, Some("Time taken by Streaming scheduler to submit jobs " + + "of a batch")), + ("Processing Time", true, Some("Time taken to process all jobs of a batch"))) ++ { + if (tableTag.equals("completedBatches")) { + Seq( + ("Total Delay", true, Some("Total time taken to handle a batch")), + ("Output Ops: Succeeded/Total", false, None)) + } else { + Seq( + ("Output Ops: Succeeded/Total", false, None), + ("Status", false, None)) + } + } ++ { + if (firstFailureReason.nonEmpty) { + Seq(("Error", false, None)) + } else { + Nil + } } } + // check if sort column is a valid sortable column + isSortColumnValid(headersAndCssClasses, sortColumn) + + headerRow(headersAndCssClasses, desc, pageSize, sortColumn, parameterPath, tableTag, tableTag) } - private def waitingBatchRow(batch: BatchUIData): Seq[Node] = { - baseRow(batch) ++ createOutputOperationProgressBar(batch) ++ queued++ { - if (firstFailureReason.nonEmpty) { - // Waiting batches have not run yet, so must have no failure reasons. - - - } else { - Nil + override def row(batch: BatchUIData): Seq[Node] = { + val batchTime = batch.batchTime.milliseconds + val formattedBatchTime = SparkUIUtils.formatBatchTime(batchTime, batchInterval) + val numRecords = batch.numRecords + val schedulingDelay = batch.schedulingDelay + val formattedSchedulingDelay = schedulingDelay.map(SparkUIUtils.formatDuration).getOrElse("-") + val processingTime = batch.processingDelay + val formattedProcessingTime = processingTime.map(SparkUIUtils.formatDuration).getOrElse("-") + val batchTimeId = s"batch-$batchTime" + val totalDelay = batch.totalDelay + val formattedTotalDelay = totalDelay.map(SparkUIUtils.formatDuration).getOrElse("-") + + + + + {formattedBatchTime} + + + {numRecords.toString} records + {formattedSchedulingDelay} + {formattedProcessingTime} + { + if (tableTag.equals("completedBatches")) { + {formattedTotalDelay} ++ + createOutputOperationProgressBar(batch) ++ { + if (firstFailureReason.nonEmpty) { + getFirstFailureTableCell(batch) + } else { + Nil + } + } + } else if (tableTag.equals("runningBatches")) { + createOutputOperationProgressBar(batch) ++ + processing ++ { + if (firstFailureReason.nonEmpty) { + getFirstFailureTableCell(batch) + } else { + Nil + } + } + } else { + createOutputOperationProgressBar(batch) ++ + queued ++ { + if (firstFailureReason.nonEmpty) { + // Waiting batches have not run yet, so must have no failure reasons. + - + } else { + Nil + } + } + } } - } + } } -private[ui] class CompletedBatchTable(batches: Seq[BatchUIData], batchInterval: Long) - extends BatchTableBase("completed-batches-table", batchInterval) { +private[ui] class StreamingDataSource(info: Seq[BatchUIData], pageSize: Int, sortColumn: String, + desc: Boolean) extends PagedDataSource[BatchUIData](pageSize) { - private val firstFailureReason = getFirstFailureReason(batches) + private val data = info.sorted(ordering(sortColumn, desc)) - override protected def columns: Seq[Node] = super.columns ++ { - Total Delay {SparkUIUtils.tooltip("Total time taken to handle a batch", "top")} - Output Ops: Succeeded/Total ++ { - if (firstFailureReason.nonEmpty) { - Error - } else { - Nil - } - } - } + override protected def dataSize: Int = data.size - override protected def renderRows: Seq[Node] = { - batches.flatMap(batch => {completedBatchRow(batch)}) - } + override protected def sliceData(from: Int, to: Int): Seq[BatchUIData] = data.slice(from, to) - private def completedBatchRow(batch: BatchUIData): Seq[Node] = { - val totalDelay = batch.totalDelay - val formattedTotalDelay = totalDelay.map(SparkUIUtils.formatDuration).getOrElse("-") - - baseRow(batch) ++ { - - {formattedTotalDelay} - - } ++ createOutputOperationProgressBar(batch)++ { - if (firstFailureReason.nonEmpty) { - getFirstFailureTableCell(batch) - } else { - Nil - } + private def ordering(column: String, desc: Boolean): Ordering[BatchUIData] = { + val ordering: Ordering[BatchUIData] = column match { + case "Batch Time" => Ordering.by(_.batchTime.milliseconds) + case "Records" => Ordering.by(_.numRecords) + case "Scheduling Delay" => Ordering.by(_.schedulingDelay.getOrElse(Long.MaxValue)) + case "Processing Time" => Ordering.by(_.processingDelay.getOrElse(Long.MaxValue)) + case "Total Delay" => Ordering.by(_.totalDelay.getOrElse(Long.MaxValue)) + case unknownColumn => throw new IllegalArgumentException(s"Unknown Column: $unknownColumn") + } + if (desc) { + ordering.reverse + } else { + ordering } } } diff --git a/streaming/src/main/scala/org/apache/spark/streaming/ui/StreamingPage.scala b/streaming/src/main/scala/org/apache/spark/streaming/ui/StreamingPage.scala index 3bdf009dbce66..42d0e50a068ec 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/ui/StreamingPage.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/ui/StreamingPage.scala @@ -20,10 +20,12 @@ package org.apache.spark.streaming.ui import java.util.concurrent.TimeUnit import javax.servlet.http.HttpServletRequest +import scala.collection.mutable import scala.xml.{Node, Unparsed} import org.apache.spark.internal.Logging import org.apache.spark.ui.{GraphUIData, JsCollector, UIUtils => SparkUIUtils, WebUIPage} +import org.apache.spark.util.Utils /** * A helper class for "scheduling delay", "processing time" and "total delay" to generate data that @@ -86,7 +88,7 @@ private[ui] class StreamingPage(parent: StreamingTab) onClickTimelineFunc ++ basicInfo ++ listener.synchronized { generateStatTable() ++ - generateBatchListTables() + generateBatchListTables(request) } SparkUIUtils.headerSparkPage(request, "Streaming Statistics", content, parent) } @@ -432,50 +434,97 @@ private[ui] class StreamingPage(parent: StreamingTab) } - private def generateBatchListTables(): Seq[Node] = { + private def streamingTable(request: HttpServletRequest, batches: Seq[BatchUIData], + tableTag: String): Seq[Node] = { + val interval: Long = listener.batchDuration + val streamingPage = Option(request.getParameter(s"$tableTag.page")).map(_.toInt).getOrElse(1) + + try { + new StreamingPagedTable( + request, + tableTag, + batches, + SparkUIUtils.prependBaseUri(request, parent.basePath), + "streaming", + interval + ).table(streamingPage) + } catch { + case e @ (_: IllegalArgumentException | _: IndexOutOfBoundsException) => +
    +

    Error while rendering streaming table:

    +
    +            {Utils.exceptionString(e)}
    +          
    +
    + } + } + + private def generateBatchListTables(request: HttpServletRequest): Seq[Node] = { val runningBatches = listener.runningBatches.sortBy(_.batchTime.milliseconds).reverse val waitingBatches = listener.waitingBatches.sortBy(_.batchTime.milliseconds).reverse val completedBatches = listener.retainedCompletedBatches. sortBy(_.batchTime.milliseconds).reverse - val activeBatchesContent = { -
    -
    - -

    - - Active Batches ({runningBatches.size + waitingBatches.size}) -

    -
    -
    - {new ActiveBatchTable(runningBatches, waitingBatches, listener.batchDuration).toNodeSeq} + val content = mutable.ListBuffer[Node]() + + if (runningBatches.nonEmpty) { + content ++= +
    +
    + +

    + + Running Batches ({runningBatches.size}) +

    +
    +
    + { streamingTable(request, runningBatches, "runningBatches") } +
    -
    } - val completedBatchesContent = { -
    -
    - -

    - - Completed Batches (last {completedBatches.size} - out of {listener.numTotalCompletedBatches}) -

    -
    -
    - {new CompletedBatchTable(completedBatches, listener.batchDuration).toNodeSeq} + if (waitingBatches.nonEmpty) { + content ++= +
    +
    + +

    + + Waiting Batches ({waitingBatches.size}) +

    +
    +
    + { streamingTable(request, waitingBatches, "waitingBatches") } +
    -
    } - activeBatchesContent ++ completedBatchesContent + if (completedBatches.nonEmpty) { + content ++= +
    +
    + +

    + + Completed Batches (last {completedBatches.size} + out of {listener.numTotalCompletedBatches}) +

    +
    +
    + { streamingTable(request, completedBatches, "completedBatches") } +
    +
    +
    + } + content } } diff --git a/streaming/src/main/scala/org/apache/spark/streaming/util/BatchedWriteAheadLog.scala b/streaming/src/main/scala/org/apache/spark/streaming/util/BatchedWriteAheadLog.scala index 31e4c6b59a64a..d0a3517af70b9 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/util/BatchedWriteAheadLog.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/util/BatchedWriteAheadLog.scala @@ -170,7 +170,7 @@ private[util] class BatchedWriteAheadLog(val wrappedLog: WriteAheadLog, conf: Sp // We take the latest record for the timestamp. Please refer to the class Javadoc for // detailed explanation val time = sortedByTime.last.time - segment = wrappedLog.write(aggregate(sortedByTime), time) + segment = wrappedLog.write(aggregate(sortedByTime.toSeq), time) } buffer.foreach(_.promise.success(segment)) } catch { diff --git a/streaming/src/main/scala/org/apache/spark/streaming/util/FileBasedWriteAheadLog.scala b/streaming/src/main/scala/org/apache/spark/streaming/util/FileBasedWriteAheadLog.scala index d33f83c819086..d1f9dfb791355 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/util/FileBasedWriteAheadLog.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/util/FileBasedWriteAheadLog.scala @@ -146,7 +146,7 @@ private[streaming] class FileBasedWriteAheadLog( } else { // For performance gains, it makes sense to parallelize the recovery if // closeFileAfterWrite = true - seqToParIterator(executionContext, logFilesToRead, readFile).asJava + seqToParIterator(executionContext, logFilesToRead.toSeq, readFile).asJava } } @@ -277,10 +277,10 @@ private[streaming] object FileBasedWriteAheadLog { } def getCallerName(): Option[String] = { - val blacklist = Seq("WriteAheadLog", "Logging", "java.lang", "scala.") + val ignoreList = Seq("WriteAheadLog", "Logging", "java.lang", "scala.") Thread.currentThread.getStackTrace() .map(_.getClassName) - .find { c => !blacklist.exists(c.contains) } + .find { c => !ignoreList.exists(c.contains) } .flatMap(_.split("\\.").lastOption) .flatMap(_.split("\\$\\$").headOption) } @@ -293,7 +293,7 @@ private[streaming] object FileBasedWriteAheadLog { val startTime = startTimeStr.toLong val stopTime = stopTimeStr.toLong Some(LogInfo(startTime, stopTime, file.toString)) - case None => + case None | Some(_) => None } }.sortBy { _.startTime } diff --git a/streaming/src/main/scala/org/apache/spark/streaming/util/HdfsUtils.scala b/streaming/src/main/scala/org/apache/spark/streaming/util/HdfsUtils.scala index 146577214de17..ef040681adf37 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/util/HdfsUtils.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/util/HdfsUtils.scala @@ -39,7 +39,7 @@ private[streaming] object HdfsUtils { throw new IllegalStateException("File exists and there is no append support!") } } else { - // we dont' want to use hdfs erasure coding, as that lacks support for append and hflush + // we don't want to use hdfs erasure coding, as that lacks support for append and hflush SparkHadoopUtil.createFile(dfs, dfsPath, false) } } @@ -58,7 +58,7 @@ private[streaming] object HdfsUtils { // If we are really unlucky, the file may be deleted as we're opening the stream. // This can happen as clean up is performed by daemon threads that may be left over from // previous runs. - if (!dfs.isFile(dfsPath)) null else throw e + if (!dfs.getFileStatus(dfsPath).isFile) null else throw e } } @@ -92,6 +92,10 @@ private[streaming] object HdfsUtils { def checkFileExists(path: String, conf: Configuration): Boolean = { val hdpPath = new Path(path) val fs = getFileSystemForPath(hdpPath, conf) - fs.isFile(hdpPath) + try { + fs.getFileStatus(hdpPath).isFile + } catch { + case _: FileNotFoundException => false + } } } diff --git a/streaming/src/main/scala/org/apache/spark/streaming/util/RawTextHelper.scala b/streaming/src/main/scala/org/apache/spark/streaming/util/RawTextHelper.scala index 9cdfdb8374322..e207dab7de068 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/util/RawTextHelper.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/util/RawTextHelper.scala @@ -93,7 +93,7 @@ object RawTextHelper { } /** - * Warms up the SparkContext in master and slave by running tasks to force JIT kick in + * Warms up the SparkContext in master and executor by running tasks to force JIT kick in * before real workload starts. */ def warmUp(sc: SparkContext): Unit = { diff --git a/streaming/src/main/scala/org/apache/spark/streaming/util/RawTextSender.scala b/streaming/src/main/scala/org/apache/spark/streaming/util/RawTextSender.scala index 5d4fcf8bd1596..a63d50f1334fe 100644 --- a/streaming/src/main/scala/org/apache/spark/streaming/util/RawTextSender.scala +++ b/streaming/src/main/scala/org/apache/spark/streaming/util/RawTextSender.scala @@ -26,7 +26,7 @@ import scala.io.Source import org.apache.spark.SparkConf import org.apache.spark.internal.Logging import org.apache.spark.serializer.KryoSerializer -import org.apache.spark.util.IntParam +import org.apache.spark.util.{IntParam, Utils} /** * A helper program that sends blocks of Kryo-serialized text strings out on a socket at a @@ -45,7 +45,7 @@ object RawTextSender extends Logging { val Array(IntParam(port), file, IntParam(blockSize), IntParam(bytesPerSec)) = args // Repeat the input data multiple times to fill in a buffer - val lines = Source.fromFile(file).getLines().toArray + val lines = Utils.tryWithResource(Source.fromFile(file))(_.getLines().toArray) val bufferStream = new ByteArrayOutputStream(blockSize + 1000) val ser = new KryoSerializer(new SparkConf()).newInstance() val serStream = ser.serializeStream(bufferStream) diff --git a/streaming/src/test/java/test/org/apache/spark/streaming/JavaAPISuite.java b/streaming/src/test/java/test/org/apache/spark/streaming/JavaAPISuite.java index c7cde5674f547..8a57b0c58b228 100644 --- a/streaming/src/test/java/test/org/apache/spark/streaming/JavaAPISuite.java +++ b/streaming/src/test/java/test/org/apache/spark/streaming/JavaAPISuite.java @@ -1595,7 +1595,7 @@ public void testContextGetOrCreate() throws InterruptedException { /* TEST DISABLED: Pending a discussion about checkpoint() semantics with TD @SuppressWarnings("unchecked") @Test - public void testCheckpointofIndividualStream() throws InterruptedException { + public void testCheckpointOfIndividualStream() throws InterruptedException { List> inputData = Arrays.asList( Arrays.asList("this", "is"), Arrays.asList("a", "test"), diff --git a/streaming/src/test/scala/org/apache/spark/streaming/DStreamScopeSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/DStreamScopeSuite.scala index 36036fcd44b04..541a6e2d48b51 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/DStreamScopeSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/DStreamScopeSuite.scala @@ -190,7 +190,7 @@ class DStreamScopeSuite assertDefined(foreachBaseScope) assert(foreachBaseScope.get.name === "foreachRDD") - val rddScopes = generatedRDDs.map { _.scope } + val rddScopes = generatedRDDs.map { _.scope }.toSeq assertDefined(rddScopes: _*) rddScopes.zipWithIndex.foreach { case (rddScope, idx) => assert(rddScope.get.name === "reduceByKey") diff --git a/streaming/src/test/scala/org/apache/spark/streaming/InputStreamsSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/InputStreamsSuite.scala index 53ef840864bce..03182ae64db3d 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/InputStreamsSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/InputStreamsSuite.scala @@ -264,7 +264,7 @@ class InputStreamsSuite extends TestSuiteBase with BeforeAndAfter { def write(path: Path, text: String): Unit = { val out = fs.create(path, true) - IOUtils.write(text, out) + IOUtils.write(text, out, StandardCharsets.UTF_8) out.close() } diff --git a/streaming/src/test/scala/org/apache/spark/streaming/JavaTestUtils.scala b/streaming/src/test/scala/org/apache/spark/streaming/JavaTestUtils.scala index 0c4a64ccc513f..42a5aaba5178f 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/JavaTestUtils.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/JavaTestUtils.scala @@ -36,7 +36,7 @@ trait JavaTestBase extends TestSuiteBase { ssc: JavaStreamingContext, data: JList[JList[T]], numPartitions: Int): JavaDStream[T] = { - val seqData = data.asScala.map(_.asScala) + val seqData = data.asScala.map(_.asScala.toSeq).toSeq implicit val cm: ClassTag[T] = implicitly[ClassTag[AnyRef]].asInstanceOf[ClassTag[T]] diff --git a/streaming/src/test/scala/org/apache/spark/streaming/LocalStreamingContext.scala b/streaming/src/test/scala/org/apache/spark/streaming/LocalStreamingContext.scala index 5bf24a9705dc9..99ad8ede78ed4 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/LocalStreamingContext.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/LocalStreamingContext.scala @@ -30,7 +30,7 @@ import org.apache.spark.internal.Logging trait LocalStreamingContext extends BeforeAndAfterEach { self: Suite => @transient var ssc: StreamingContext = _ - @transient var stopSparkContext: Boolean = true + @transient val stopSparkContext: Boolean = true override def afterEach(): Unit = { try { diff --git a/streaming/src/test/scala/org/apache/spark/streaming/MapWithStateSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/MapWithStateSuite.scala index b2b8d2f41fc80..3ffaa62bd75ac 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/MapWithStateSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/MapWithStateSuite.scala @@ -541,12 +541,12 @@ class MapWithStateSuite extends SparkFunSuite with LocalStreamingContext // Setup the stream computation val ssc = new StreamingContext(sc, Seconds(1)) val inputStream = new TestInputStream(ssc, input, numPartitions = 2) - val trackeStateStream = inputStream.map(x => (x, 1)).mapWithState(mapWithStateSpec) + val trackedStateStream = inputStream.map(x => (x, 1)).mapWithState(mapWithStateSpec) val collectedOutputs = new ConcurrentLinkedQueue[Seq[T]] - val outputStream = new TestOutputStream(trackeStateStream, collectedOutputs) + val outputStream = new TestOutputStream(trackedStateStream, collectedOutputs) val collectedStateSnapshots = new ConcurrentLinkedQueue[Seq[(K, S)]] val stateSnapshotStream = new TestOutputStream( - trackeStateStream.stateSnapshots(), collectedStateSnapshots) + trackedStateStream.stateSnapshots(), collectedStateSnapshots) outputStream.register() stateSnapshotStream.register() diff --git a/streaming/src/test/scala/org/apache/spark/streaming/MasterFailureTest.scala b/streaming/src/test/scala/org/apache/spark/streaming/MasterFailureTest.scala index d0a5ababc7cac..4fc9d13cddadc 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/MasterFailureTest.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/MasterFailureTest.scala @@ -284,7 +284,7 @@ object MasterFailureTest extends Logging { }) } } - mergedOutput + mergedOutput.toSeq } /** @@ -332,7 +332,7 @@ class KillingThread(ssc: StreamingContext, maxKillWaitTime: Long) extends Thread override def run(): Unit = { try { // If it is the first killing, then allow the first checkpoint to be created - var minKillWaitTime = if (MasterFailureTest.killCount == 0) 5000 else 2000 + val minKillWaitTime = if (MasterFailureTest.killCount == 0) 5000 else 2000 val killWaitTime = minKillWaitTime + math.abs(Random.nextLong % maxKillWaitTime) logInfo("Kill wait time = " + killWaitTime) Thread.sleep(killWaitTime) diff --git a/streaming/src/test/scala/org/apache/spark/streaming/ReceivedBlockHandlerSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/ReceivedBlockHandlerSuite.scala index 0976494b6d094..425e39c5980a1 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/ReceivedBlockHandlerSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/ReceivedBlockHandlerSuite.scala @@ -26,8 +26,10 @@ import scala.concurrent.duration._ import scala.reflect.ClassTag import org.apache.hadoop.conf.Configuration -import org.scalatest.{BeforeAndAfter, Matchers} +import org.scalatest.BeforeAndAfter import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark._ import org.apache.spark.broadcast.BroadcastManager @@ -69,11 +71,11 @@ abstract class BaseReceivedBlockHandlerSuite(enableEncryption: Boolean) val hadoopConf = new Configuration() val streamId = 1 val securityMgr = new SecurityManager(conf, encryptionKey) - val broadcastManager = new BroadcastManager(true, conf, securityMgr) + val broadcastManager = new BroadcastManager(true, conf) val mapOutputTracker = new MapOutputTrackerMaster(conf, broadcastManager, true) val shuffleManager = new SortShuffleManager(conf) val serializer = new KryoSerializer(conf) - var serializerManager = new SerializerManager(serializer, conf, encryptionKey) + val serializerManager = new SerializerManager(serializer, conf, encryptionKey) val manualClock = new ManualClock val blockManagerSize = 10000000 val blockManagerBuffer = new ArrayBuffer[BlockManager]() @@ -91,7 +93,7 @@ abstract class BaseReceivedBlockHandlerSuite(enableEncryption: Boolean) val blockManagerInfo = new mutable.HashMap[BlockManagerId, BlockManagerInfo]() blockManagerMaster = new BlockManagerMaster(rpcEnv.setupEndpoint("blockmanager", new BlockManagerMasterEndpoint(rpcEnv, true, conf, - new LiveListenerBus(conf), None, blockManagerInfo)), + new LiveListenerBus(conf), None, blockManagerInfo, mapOutputTracker)), rpcEnv.setupEndpoint("blockmanagerHeartbeat", new BlockManagerMasterHeartbeatEndpoint(rpcEnv, true, blockManagerInfo)), conf, true) diff --git a/streaming/src/test/scala/org/apache/spark/streaming/ReceivedBlockTrackerSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/ReceivedBlockTrackerSuite.scala index 368411cc2214b..420f7f20ce186 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/ReceivedBlockTrackerSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/ReceivedBlockTrackerSuite.scala @@ -28,8 +28,10 @@ import scala.util.Random import org.apache.hadoop.conf.Configuration import org.mockito.ArgumentMatchers.any import org.mockito.Mockito.{doThrow, reset, spy} -import org.scalatest.{BeforeAndAfter, Matchers} +import org.scalatest.BeforeAndAfter import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.{SparkConf, SparkFunSuite} import org.apache.spark.internal.Logging diff --git a/streaming/src/test/scala/org/apache/spark/streaming/ReceiverInputDStreamSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/ReceiverInputDStreamSuite.scala index 6b332206e8f6d..9d4b67bccecaf 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/ReceiverInputDStreamSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/ReceiverInputDStreamSuite.scala @@ -22,7 +22,6 @@ import scala.util.Random import org.apache.spark.{SparkConf, SparkEnv} import org.apache.spark.rdd.BlockRDD import org.apache.spark.storage.{StorageLevel, StreamBlockId} -import org.apache.spark.streaming.StreamingConf.RECEIVER_WAL_ENABLE_CONF_KEY import org.apache.spark.streaming.dstream.ReceiverInputDStream import org.apache.spark.streaming.rdd.WriteAheadLogBackedBlockRDD import org.apache.spark.streaming.receiver.{BlockManagerBasedStoreResult, Receiver, WriteAheadLogBasedStoreResult} diff --git a/streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala index 4eff464dcdafb..29eb1db638627 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/StreamingContextSuite.scala @@ -18,6 +18,7 @@ package org.apache.spark.streaming import java.io.{File, NotSerializableException} +import java.nio.charset.StandardCharsets import java.util.Locale import java.util.concurrent.{CountDownLatch, TimeUnit} import java.util.concurrent.atomic.AtomicInteger @@ -293,8 +294,7 @@ class StreamingContextSuite } } - // TODO (SPARK-31728): re-enable it - ignore("stop gracefully") { + test("stop gracefully") { val conf = new SparkConf().setMaster(master).setAppName(appName) conf.set("spark.dummyTimeConfig", "3600s") val sc = new SparkContext(conf) @@ -910,7 +910,7 @@ class StreamingContextSuite def createCorruptedCheckpoint(): String = { val checkpointDirectory = Utils.createTempDir().getAbsolutePath() val fakeCheckpointFile = Checkpoint.checkpointFile(checkpointDirectory, Time(1000)) - FileUtils.write(new File(fakeCheckpointFile.toString()), "blablabla") + FileUtils.write(new File(fakeCheckpointFile.toString()), "blablabla", StandardCharsets.UTF_8) assert(Checkpoint.getCheckpointFiles(checkpointDirectory).nonEmpty) checkpointDirectory } diff --git a/streaming/src/test/scala/org/apache/spark/streaming/StreamingListenerSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/StreamingListenerSuite.scala index 679c58dbae92b..b54d60aa29c4f 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/StreamingListenerSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/StreamingListenerSuite.scala @@ -25,8 +25,9 @@ import scala.concurrent.ExecutionContext.Implicits.global import scala.concurrent.Future import org.mockito.Mockito.{mock, reset, verifyNoMoreInteractions} -import org.scalatest.Matchers import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.scalatest.time.SpanSugar._ import org.apache.spark.SparkException diff --git a/streaming/src/test/scala/org/apache/spark/streaming/TestSuiteBase.scala b/streaming/src/test/scala/org/apache/spark/streaming/TestSuiteBase.scala index 55c2950261a07..7ce4343acbdac 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/TestSuiteBase.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/TestSuiteBase.scala @@ -17,11 +17,10 @@ package org.apache.spark.streaming -import java.io.{File, IOException, ObjectInputStream} +import java.io.{IOException, ObjectInputStream} import java.util.concurrent.{ConcurrentLinkedQueue, TimeUnit} import scala.collection.JavaConverters._ -import scala.language.implicitConversions import scala.reflect.ClassTag import org.scalatest.BeforeAndAfterEach diff --git a/streaming/src/test/scala/org/apache/spark/streaming/UISeleniumSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/UISeleniumSuite.scala index bdc9e9ee2aed1..f797101992573 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/UISeleniumSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/UISeleniumSuite.scala @@ -21,8 +21,10 @@ import scala.collection.mutable.Queue import org.openqa.selenium.WebDriver import org.openqa.selenium.htmlunit.HtmlUnitDriver -import org.scalatest._ +import org.scalatest.BeforeAndAfterAll import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.scalatest.time.SpanSugar._ import org.scalatestplus.selenium.WebBrowser @@ -63,7 +65,7 @@ class UISeleniumSuite .setMaster("local") .setAppName("test") .set(UI_ENABLED, true) - val ssc = new StreamingContext(conf, Seconds(1)) + val ssc = new StreamingContext(conf, Milliseconds(100)) assert(ssc.sc.ui.isDefined, "Spark UI is not started!") ssc } @@ -104,7 +106,7 @@ class UISeleniumSuite find(cssSelector( """ul li a[href*="streaming"]""")) should not be (None) } - eventually(timeout(10.seconds), interval(50.milliseconds)) { + eventually(timeout(10.seconds), interval(500.milliseconds)) { // check whether streaming page exists go to (sparkUI.webUrl.stripSuffix("/") + "/streaming") val h3Text = findAll(cssSelector("h3")).map(_.text).toSeq @@ -125,24 +127,37 @@ class UISeleniumSuite // Check batch tables val h4Text = findAll(cssSelector("h4")).map(_.text).toSeq - h4Text.exists(_.matches("Active Batches \\(\\d+\\)")) should be (true) h4Text.exists(_.matches("Completed Batches \\(last \\d+ out of \\d+\\)")) should be (true) - findAll(cssSelector("""#active-batches-table th""")).map(_.text).toSeq should be { - List("Batch Time", "Records", "Scheduling Delay (?)", "Processing Time (?)", - "Output Ops: Succeeded/Total", "Status") - } - findAll(cssSelector("""#completed-batches-table th""")).map(_.text).toSeq should be { - List("Batch Time", "Records", "Scheduling Delay (?)", "Processing Time (?)", - "Total Delay (?)", "Output Ops: Succeeded/Total") + val arrow = 0x25BE.toChar + findAll(cssSelector("""#completedBatches-table th""")).map(_.text).toList should be { + List(s"Batch Time $arrow", "Records", "Scheduling Delay", "Processing Time", + "Total Delay", "Output Ops: Succeeded/Total") } - val batchLinks = - findAll(cssSelector("""#completed-batches-table a""")).flatMap(_.attribute("href")).toSeq + val pageSize = 1 + val pagedTablePath = "/streaming/?completedBatches.sort=Batch+Time" + + "&completedBatches.desc=true&completedBatches.page=1" + + s"&completedBatches.pageSize=$pageSize#completedBatches" + + go to (sparkUI.webUrl.stripSuffix("/") + pagedTablePath) + val completedTableRows = findAll(cssSelector("""#completedBatches-table tr""")) + .map(_.text).toList + // header row + pagesize + completedTableRows.length should be (1 + pageSize) + + val sortedBatchTimePath = "/streaming/?&completedBatches.sort=Batch+Time" + + s"&completedBatches.desc=false&completedBatches.pageSize=$pageSize#completedBatches" + + // sort batches in ascending order of batch time + go to (sparkUI.webUrl.stripSuffix("/") + sortedBatchTimePath) + + val batchLinks = findAll(cssSelector("""#completedBatches-table td a""")) + .flatMap(_.attribute("href")).toSeq batchLinks.size should be >= 1 // Check a normal batch page - go to (batchLinks.last) // Last should be the first batch, so it will have some jobs + go to (batchLinks.head) // Head is the first batch, so it will have some jobs val summaryText = findAll(cssSelector("li strong")).map(_.text).toSeq summaryText should contain ("Batch Duration:") summaryText should contain ("Input data size:") diff --git a/streaming/src/test/scala/org/apache/spark/streaming/rdd/MapWithStateRDDSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/rdd/MapWithStateRDDSuite.scala index 58ce3a93251a9..f06b1feb8c0cd 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/rdd/MapWithStateRDDSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/rdd/MapWithStateRDDSuite.scala @@ -320,7 +320,7 @@ class MapWithStateRDDSuite extends SparkFunSuite with RDDCheckpointTester with B makeStateRDDWithLongLineageDataRDD, reliableCheckpoint = true, rddCollectFunc _) /** Generate MapWithStateRDD with parent state RDD having a long lineage */ - def makeStateRDDWithLongLineageParenttateRDD( + def makeStateRDDWithLongLineageParentStateRDD( longLineageRDD: RDD[Int]): MapWithStateRDD[Int, Int, Int, Int] = { // Create a MapWithStateRDD that has a long lineage using the data RDD with a long lineage @@ -337,9 +337,9 @@ class MapWithStateRDDSuite extends SparkFunSuite with RDDCheckpointTester with B } testRDD( - makeStateRDDWithLongLineageParenttateRDD, reliableCheckpoint = true, rddCollectFunc _) + makeStateRDDWithLongLineageParentStateRDD, reliableCheckpoint = true, rddCollectFunc _) testRDDPartitions( - makeStateRDDWithLongLineageParenttateRDD, reliableCheckpoint = true, rddCollectFunc _) + makeStateRDDWithLongLineageParentStateRDD, reliableCheckpoint = true, rddCollectFunc _) } test("checkpointing empty state RDD") { diff --git a/streaming/src/test/scala/org/apache/spark/streaming/receiver/BlockGeneratorSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/receiver/BlockGeneratorSuite.scala index 4c0dd0d258c53..31456b0b95b18 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/receiver/BlockGeneratorSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/receiver/BlockGeneratorSuite.scala @@ -23,9 +23,9 @@ import scala.collection.JavaConverters._ import scala.collection.mutable import org.scalatest.BeforeAndAfter -import org.scalatest.Matchers._ import org.scalatest.concurrent.{Signaler, ThreadSignaler, TimeLimits} import org.scalatest.concurrent.Eventually._ +import org.scalatest.matchers.should.Matchers._ import org.scalatest.time.SpanSugar._ import org.apache.spark.{SparkConf, SparkException, SparkFunSuite} diff --git a/streaming/src/test/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManagerSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManagerSuite.scala index 65efa10bfcf92..c2b039244d01f 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManagerSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/scheduler/ExecutorAllocationManagerSuite.scala @@ -17,17 +17,18 @@ package org.apache.spark.streaming.scheduler -import org.mockito.ArgumentMatchers.{eq => meq} +import org.mockito.ArgumentMatchers.{any, eq => meq} import org.mockito.Mockito.{never, reset, times, verify, when} -import org.scalatest.{BeforeAndAfterEach, PrivateMethodTester} +import org.scalatest.PrivateMethodTester import org.scalatest.concurrent.Eventually.{eventually, timeout} import org.scalatest.time.SpanSugar._ import org.scalatestplus.mockito.MockitoSugar import org.apache.spark.{ExecutorAllocationClient, SparkConf} -import org.apache.spark.internal.config.{DYN_ALLOCATION_ENABLED, DYN_ALLOCATION_TESTING} +import org.apache.spark.internal.config.{DECOMMISSION_ENABLED, DYN_ALLOCATION_ENABLED, DYN_ALLOCATION_TESTING} import org.apache.spark.internal.config.Streaming._ import org.apache.spark.resource.ResourceProfile +import org.apache.spark.scheduler.ExecutorDecommissionInfo import org.apache.spark.streaming.{DummyInputDStream, Seconds, StreamingContext, TestSuiteBase} import org.apache.spark.util.{ManualClock, Utils} @@ -44,11 +45,22 @@ class ExecutorAllocationManagerSuite extends TestSuiteBase } test("basic functionality") { + basicTest(decommissioning = false) + } + + test("basic decommissioning") { + basicTest(decommissioning = true) + } + + def basicTest(decommissioning: Boolean): Unit = { // Test that adding batch processing time info to allocation manager // causes executors to be requested and killed accordingly + conf.set(DECOMMISSION_ENABLED, decommissioning) // There is 1 receiver, and exec 1 has been allocated to it - withAllocationManager(numReceivers = 1) { case (receiverTracker, allocationManager) => + withAllocationManager(numReceivers = 1, conf = conf) { + case (receiverTracker, allocationManager) => + when(receiverTracker.allocatedExecutors).thenReturn(Map(1 -> Some("1"))) /** Add data point for batch processing time and verify executor allocation */ @@ -83,53 +95,67 @@ class ExecutorAllocationManagerSuite extends TestSuiteBase Map.empty)} } - /** Verify that a particular executor was killed */ - def verifyKilledExec(expectedKilledExec: Option[String]): Unit = { - if (expectedKilledExec.nonEmpty) { - verify(allocationClient, times(1)).killExecutor(meq(expectedKilledExec.get)) + /** Verify that a particular executor was scaled down. */ + def verifyScaledDownExec(expectedExec: Option[String]): Unit = { + if (expectedExec.nonEmpty) { + val decomInfo = ExecutorDecommissionInfo("spark scale down", None) + if (decommissioning) { + verify(allocationClient, times(1)).decommissionExecutor( + meq(expectedExec.get), meq(decomInfo), meq(true), any()) + verify(allocationClient, never).killExecutor(meq(expectedExec.get)) + } else { + verify(allocationClient, times(1)).killExecutor(meq(expectedExec.get)) + verify(allocationClient, never).decommissionExecutor( + meq(expectedExec.get), meq(decomInfo), meq(true), any()) + } } else { - verify(allocationClient, never).killExecutor(null) + if (decommissioning) { + verify(allocationClient, never).decommissionExecutor(null, null, false) + verify(allocationClient, never).decommissionExecutor(null, null, true) + } else { + verify(allocationClient, never).killExecutor(null) + } } } // Batch proc time = batch interval, should increase allocation by 1 addBatchProcTimeAndVerifyAllocation(batchDurationMillis) { verifyTotalRequestedExecs(Some(3)) // one already allocated, increase allocation by 1 - verifyKilledExec(None) + verifyScaledDownExec(None) } // Batch proc time = batch interval * 2, should increase allocation by 2 addBatchProcTimeAndVerifyAllocation(batchDurationMillis * 2) { verifyTotalRequestedExecs(Some(4)) - verifyKilledExec(None) + verifyScaledDownExec(None) } // Batch proc time slightly more than the scale up ratio, should increase allocation by 1 addBatchProcTimeAndVerifyAllocation( batchDurationMillis * STREAMING_DYN_ALLOCATION_SCALING_UP_RATIO.defaultValue.get + 1) { verifyTotalRequestedExecs(Some(3)) - verifyKilledExec(None) + verifyScaledDownExec(None) } // Batch proc time slightly less than the scale up ratio, should not change allocation addBatchProcTimeAndVerifyAllocation( batchDurationMillis * STREAMING_DYN_ALLOCATION_SCALING_UP_RATIO.defaultValue.get - 1) { verifyTotalRequestedExecs(None) - verifyKilledExec(None) + verifyScaledDownExec(None) } // Batch proc time slightly more than the scale down ratio, should not change allocation addBatchProcTimeAndVerifyAllocation( batchDurationMillis * STREAMING_DYN_ALLOCATION_SCALING_DOWN_RATIO.defaultValue.get + 1) { verifyTotalRequestedExecs(None) - verifyKilledExec(None) + verifyScaledDownExec(None) } // Batch proc time slightly more than the scale down ratio, should not change allocation addBatchProcTimeAndVerifyAllocation( batchDurationMillis * STREAMING_DYN_ALLOCATION_SCALING_DOWN_RATIO.defaultValue.get - 1) { verifyTotalRequestedExecs(None) - verifyKilledExec(Some("2")) + verifyScaledDownExec(Some("2")) } } } diff --git a/streaming/src/test/scala/org/apache/spark/streaming/scheduler/ReceiverTrackerSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/scheduler/ReceiverTrackerSuite.scala index 1a0154600bf3c..5a8941de3fafd 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/scheduler/ReceiverTrackerSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/scheduler/ReceiverTrackerSuite.scala @@ -203,7 +203,7 @@ private[streaming] object RateTestReceiver { */ class StoppableReceiver extends Receiver[Int](StorageLevel.MEMORY_ONLY) { - var receivingThreadOption: Option[Thread] = None + val receivingThreadOption: Option[Thread] = None def onStart(): Unit = { val thread = new Thread() { diff --git a/streaming/src/test/scala/org/apache/spark/streaming/scheduler/rate/PIDRateEstimatorSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/scheduler/rate/PIDRateEstimatorSuite.scala index 1a0460cd669af..bad5cd2564988 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/scheduler/rate/PIDRateEstimatorSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/scheduler/rate/PIDRateEstimatorSuite.scala @@ -20,7 +20,8 @@ package org.apache.spark.streaming.scheduler.rate import scala.util.Random import org.scalatest.Inspectors.forAll -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.{SparkConf, SparkFunSuite} import org.apache.spark.streaming.Seconds diff --git a/streaming/src/test/scala/org/apache/spark/streaming/ui/StreamingJobProgressListenerSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/ui/StreamingJobProgressListenerSuite.scala index 10f92f9386173..01177f1cca70a 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/ui/StreamingJobProgressListenerSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/ui/StreamingJobProgressListenerSuite.scala @@ -19,7 +19,8 @@ package org.apache.spark.streaming.ui import java.util.Properties -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.scheduler.SparkListenerJobStart import org.apache.spark.streaming.{LocalStreamingContext, _} diff --git a/streaming/src/test/scala/org/apache/spark/streaming/ui/UIUtilsSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/ui/UIUtilsSuite.scala index 576083723f8bd..7f96bbfd7b19a 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/ui/UIUtilsSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/ui/UIUtilsSuite.scala @@ -20,12 +20,13 @@ package org.apache.spark.streaming.ui import java.util.TimeZone import java.util.concurrent.TimeUnit -import org.scalatest.Matchers +import org.scalatest.matchers.must.Matchers +import org.scalatest.matchers.should.Matchers._ import org.apache.spark.SparkFunSuite import org.apache.spark.ui.{UIUtils => SparkUIUtils} -class UIUtilsSuite extends SparkFunSuite with Matchers{ +class UIUtilsSuite extends SparkFunSuite with Matchers { test("shortTimeUnitString") { assert("ns" === UIUtils.shortTimeUnitString(TimeUnit.NANOSECONDS)) diff --git a/streaming/src/test/scala/org/apache/spark/streaming/util/WriteAheadLogSuite.scala b/streaming/src/test/scala/org/apache/spark/streaming/util/WriteAheadLogSuite.scala index bb60d6fa7bf78..60e04403937a2 100644 --- a/streaming/src/test/scala/org/apache/spark/streaming/util/WriteAheadLogSuite.scala +++ b/streaming/src/test/scala/org/apache/spark/streaming/util/WriteAheadLogSuite.scala @@ -612,7 +612,7 @@ object WriteAheadLogSuite { } } writer.close() - segments + segments.toSeq } /** @@ -685,7 +685,7 @@ object WriteAheadLogSuite { } finally { reader.close() } - buffer + buffer.toSeq } /** Read all the data from a log file using reader class and return the list of byte buffers. */ diff --git a/tools/pom.xml b/tools/pom.xml index 6e806413ef261..8fe8ab358d60c 100644 --- a/tools/pom.xml +++ b/tools/pom.xml @@ -20,7 +20,7 @@ org.apache.spark spark-parent_2.12 - 3.1.0-SNAPSHOT + 3.2.0-SNAPSHOT ../pom.xml diff --git a/tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala b/tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala index f9bc499961ad7..a6fee8616df11 100644 --- a/tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala +++ b/tools/src/main/scala/org/apache/spark/tools/GenerateMIMAIgnore.scala @@ -24,6 +24,7 @@ import scala.reflect.runtime.universe.runtimeMirror import scala.util.Try import org.clapper.classutil.ClassFinder +import org.objectweb.asm.Opcodes /** * A tool for generating classes to be excluded during binary checking with MIMA. It is expected @@ -146,7 +147,7 @@ object GenerateMIMAIgnore { * and subpackages both from directories and jars present on the classpath. */ private def getClasses(packageName: String): Set[String] = { - val finder = ClassFinder() + val finder = ClassFinder(maybeOverrideAsmVersion = Some(Opcodes.ASM7)) finder .getClasses .map(_.name)